diff --git a/.clang-format b/.clang-format index f4d9bcfd0e367..e98e5cd70af8d 100644 --- a/.clang-format +++ b/.clang-format @@ -16,8 +16,8 @@ AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: All -AlwaysBreakAfterReturnType: AllDefinitions +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: MultiLine @@ -35,7 +35,7 @@ BraceWrapping: AfterUnion: true AfterExternBlock: false BeforeElse: false - BeforeWhile: true + BeforeWhile: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true @@ -62,7 +62,8 @@ IndentGotoLabels: true IndentPPDirectives: None IndentExternBlock: NoIndent -SpaceAfterCStyleCast: true +PointerAlignment: Right +SpaceAfterCStyleCast: false SpacesInCStyleCastParentheses: false SpacesInConditionalStatement: false SpacesInContainerLiterals: true diff --git a/.editorconfig b/.editorconfig index 636c5445335ca..cdd3c4ea96685 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,8 @@ root = true [*.{c,cg,cpp,gradle,h,java,m,metal,pl,py,S,sh,txt}] indent_size = 4 indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true [*.{html,js,json,m4,yml,yaml,vcxproj,vcxproj.filters}] indent_size = 2 diff --git a/.github/actions/setup-gdk-desktop/action.yml b/.github/actions/setup-gdk-desktop/action.yml new file mode 100644 index 0000000000000..10427ace3c9e5 --- /dev/null +++ b/.github/actions/setup-gdk-desktop/action.yml @@ -0,0 +1,82 @@ +name: 'Setup GDK (Game Development Kit) for Windows Desktop' +description: 'Download GDK and install into MSBuild' +inputs: + # Keep edition and ref in sync! + edition: + description: 'GDK edition' + default: '240601' # YYMMUU (Year Month Update) + ref: + description: 'Git reference' + default: 'June_2024_Update_1' + folder: + description: 'Folder where to create Directory.Build.props' + required: true + default: '${{ github.workspace }}' +runs: + using: 'composite' + steps: + - uses: actions/setup-python@main + with: + python-version: 3.x + - name: 'Calculate variables' + id: calc + shell: pwsh + run: | + $vs_folder=@(vswhere -latest -property installationPath) + echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT + + echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT + + echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT + - name: 'Restore cached GDK' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: '${{ steps.calc.outputs.gdk-path }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Download GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --download ` + --temp-folder "${{ runner.temp }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --no-user-props + - name: 'Extract GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --extract ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --temp-folder "${{ runner.temp }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --no-user-props + - name: 'Cache GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: '${{ steps.calc.outputs.gdk-path }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Copy MSBuild files into GDK' + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --copy-msbuild ` + --no-user-props + - name: 'Write user props' + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --temp-folder "${{ runner.temp }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + "--props-folder=${{ inputs.folder }}" diff --git a/.github/actions/setup-ninja/action.yml b/.github/actions/setup-ninja/action.yml new file mode 100644 index 0000000000000..b9283598d773d --- /dev/null +++ b/.github/actions/setup-ninja/action.yml @@ -0,0 +1,62 @@ +name: 'Setup ninja' +description: 'Download ninja and add it to the PATH environment variable' +inputs: + version: + description: 'Ninja version' + default: '1.12.1' +runs: + using: 'composite' + steps: + - name: 'Calculate variables' + id: calc + shell: sh + run: | + case "${{ runner.os }}-${{ runner.arch }}" in + "Linux-X86" | "Linux-X64") + archive="ninja-linux.zip" + ;; + "Linux-ARM64") + archive="ninja-linux-aarch64.zip" + ;; + "macOS-X86" | "macOS-X64" | "macOS-ARM64") + archive="ninja-mac.zip" + ;; + "Windows-X86" | "Windows-X64") + archive="ninja-win.zip" + ;; + "Windows-ARM64") + archive="ninja-winarm64.zip" + ;; + *) + echo "Unsupported ${{ runner.os }}-${{ runner.arch }}" + exit 1; + ;; + esac + echo "archive=${archive}" >> ${GITHUB_OUTPUT} + echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT} + - name: 'Restore cached ${{ steps.calc.outputs.archive }}' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Cache ${{ steps.calc.outputs.archive }}' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Extract libusb' + shell: pwsh + run: | + 7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Set output variables' + id: final + shell: pwsh + run: | + echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH diff --git a/.github/actions/setup-vita-gles/action.yml b/.github/actions/setup-vita-gles/action.yml new file mode 100644 index 0000000000000..e263737b31e20 --- /dev/null +++ b/.github/actions/setup-vita-gles/action.yml @@ -0,0 +1,93 @@ +name: 'Setup GLES for PlayStation Vita' +description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk' +inputs: + pib-version: + description: 'PIB version' + default: '1.1.4' + pvr-version: + description: 'PVR_PSP2 version' + default: '3.9' + type: + description: '"pib" or "pvr"' + default: '' +runs: + using: 'composite' + steps: + - name: 'Calculate variables' + id: calc + shell: sh + run: | + if test "x${VITASDK}" = "x"; then + echo "VITASDK must be defined" + exit 1; + fi + case "x${{ inputs.type }}" in + "xpvr") + echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT} + ;; + "xpib") + echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT} + ;; + *) + echo "Invalid type. Must be 'pib' or 'pvr'." + exit 1 + ;; + esac + - uses: actions/cache/restore@v4 + id: restore-cache + with: + path: /vita/dependencies + key: '${{ steps.calc.outputs.cache-key }}' + - name: 'Download PVR_PSP2 (GLES)' + if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }} + shell: sh + run: | + pvr_psp2_version=${{ inputs.pvr-version }} + + mkdir -p /vita/dependencies/include + mkdir -p /vita/dependencies/lib + + # Configure PVR_PSP2 headers + wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp + unzip /tmp/v$pvr_psp2_version.zip -d/tmp + cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include + rm /tmp/v$pvr_psp2_version.zip + + # include guard of PVR_PSP2's khrplatform.h does not match the usual one + sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h + + # Configure PVR_PSP2 stub libraries + wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs + find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \; + rm /tmp/vitasdk_stubs.zip + rm -rf /tmp/pvr_psp2_stubs + + - name: 'Download gl4es4vita (OpenGL)' + if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }} + shell: sh + run: | + gl4es4vita_version=${{ inputs.pib-version }} + + mkdir -p /vita/dependencies/include + mkdir -p /vita/dependencies/lib + + # Configure gl4es4vita headers + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp + unzip -o /tmp/include.zip -d/vita/dependencies/include + rm /tmp/include.zip + + # Configure gl4es4vita stub libraries + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib + + - uses: actions/cache/save@v4 + if: ${{ !steps.restore-cache.outputs.cache-hit }} + with: + path: /vita/dependencies + key: '${{ steps.calc.outputs.cache-key }}' + + - name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir + shell: sh + run: | + cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi diff --git a/.github/cmake/CMakeLists.txt b/.github/cmake/CMakeLists.txt new file mode 100644 index 0000000000000..48757010a674b --- /dev/null +++ b/.github/cmake/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.0...3.5) +project(ci_utils C CXX) + +set(txt "CC=${CMAKE_C_COMPILER} +CXX=${CMAKE_CXX_COMPILER} +CFLAGS=${CMAKE_C_FLAGS} +CXXFLAGS=${CMAKE_CXX_FLAGS} +LDFLAGS=${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_C_STANDARD_LIBRARIES} +") + +message("${txt}") + +set(VAR_PATH "/tmp/env.txt" CACHE PATH "Where to write environment file") +message(STATUS "Writing CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS environment to ${VAR_PATH}") + +file(WRITE "${VAR_PATH}" "${txt}") diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index ccc02666f1323..0000000000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Build (Android) - -on: [push, pull_request] - -jobs: - android: - name: ${{ matrix.platform.name }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - platform: - - { name: Android.mk } - - { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" } - - steps: - - uses: actions/checkout@v3 - - uses: nttld/setup-ndk@v1 - id: setup_ndk - with: - ndk-version: r21e - - name: Build (Android.mk) - if: ${{ matrix.platform.name == 'Android.mk' }} - run: | - ./build-scripts/androidbuildlibs.sh - - name: Setup (CMake) - if: ${{ matrix.platform.name == 'CMake' }} - run: | - sudo apt-get update - sudo apt-get install ninja-build pkg-config - - name: Configure (CMake) - if: ${{ matrix.platform.name == 'CMake' }} - run: | - cmake -B build \ - -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ - -DSDL_WERROR=ON \ - -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ - -DANDROID_ABI=${{ matrix.platform.android_abi }} \ - -DSDL_STATIC_PIC=ON \ - -DSDL_VENDOR_INFO="Github Workflow" \ - -DCMAKE_INSTALL_PREFIX=prefix \ - -DCMAKE_BUILD_TYPE=Release \ - -GNinja - - name: Build (CMake) - if: ${{ matrix.platform.name == 'CMake' }} - run: | - cmake --build build --config Release --parallel --verbose - - name: Install (CMake) - if: ${{ matrix.platform.name == 'CMake' }} - run: | - cmake --install build --config Release - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV - ( cd prefix; find ) | LC_ALL=C sort -u - - name: Verify CMake configuration files - if: ${{ matrix.platform.name == 'CMake' }} - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \ - -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \ - -DANDROID_ABI=${{ matrix.platform.android_abi }} \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} - cmake --build cmake_config_build --verbose - - name: Verify sdl2-config - if: ${{ matrix.platform.name == 'CMake' }} - run: | - export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" - export PATH=${{ env.SDL2_DIR }}/bin:$PATH - cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc - if: ${{ matrix.platform.name == 'CMake' }} - run: | - export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}" - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig - cmake/test/test_pkgconfig.sh - - name: Verify Android.mk - if: ${{ matrix.platform.name == 'CMake' }} - run: | - export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules - ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000000..09652e024817c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,48 @@ +name: 'Build (All)' + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + controller: + name: 'Create test plan' + runs-on: 'ubuntu-latest' + outputs: + platforms-level1: ${{ steps.plan.outputs.platforms-level1 }} + platforms-others: ${{ steps.plan.outputs.platforms-others }} + steps: + - uses: actions/setup-python@main + with: + python-version: 3.x + - uses: actions/checkout@main + with: + sparse-checkout: '.github/workflows/create-test-plan.py' + - name: 'Create plan' + id: plan + run: | + # Adding [sdl-ci-filter GLOB] to the commit message will limit the jobs + # e.g. [sdl-ci-filter msvc-*] + EOF=$(openssl rand -hex 32) + cat >/tmp/commit_message.txt <<$EOF + ${{ github.event.head_commit.message }} + $EOF + + python .github/workflows/create-test-plan.py \ + --github-variable-prefix platforms \ + --github-ci \ + --verbose \ + ${{ (github.repository_owner != 'libsdl-org' && '--no-artifact') || '' }} \ + --commit-message-file /tmp/commit_message.txt + level1: + needs: [controller] + uses: './.github/workflows/generic.yml' + with: + platforms: ${{ needs.controller.outputs.platforms-level1 }} + level2: + needs: [controller, level1] + uses: './.github/workflows/generic.yml' + with: + platforms: ${{ needs.controller.outputs.platforms-others }} diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py new file mode 100755 index 0000000000000..ae3ec82faf89d --- /dev/null +++ b/.github/workflows/create-test-plan.py @@ -0,0 +1,788 @@ +#!/usr/bin/env python +import argparse +import dataclasses +import fnmatch +from enum import Enum +import json +import logging +import os +import re +from typing import Optional + +logger = logging.getLogger(__name__) + + +class AppleArch(Enum): + ARM64 = "arm64" + X86_64 = "x86_64" + + +class MsvcArch(Enum): + X86 = "x86" + X64 = "x64" + Arm64 = "arm64" + + +class JobOs(Enum): + WindowsLatest = "windows-latest" + UbuntuLatest = "ubuntu-latest" + MacosLatest = "macos-latest" + Ubuntu22_04 = "ubuntu-22.04" + Ubuntu24_04 = "ubuntu-24.04" + Macos13 = "macos-13" + + +class SdlPlatform(Enum): + Android = "android" + Emscripten = "emscripten" + Haiku = "haiku" + Msys2 = "msys2" + Linux = "linux" + MacOS = "macos" + Ios = "ios" + Tvos = "tvos" + Msvc = "msvc" + N3ds = "n3ds" + Ps2 = "ps2" + Psp = "psp" + Vita = "vita" + Riscos = "riscos" + FreeBSD = "freebsd" + NetBSD = "netbsd" + OpenBSD = "openbsd" + Watcom = "watcom" + + +class Msys2Platform(Enum): + Mingw32 = "mingw32" + Mingw64 = "mingw64" + Clang64 = "clang64" + Ucrt64 = "ucrt64" + + +class IntelCompiler(Enum): + Icx = "icx" + + +class VitaGLES(Enum): + Pib = "pib" + Pvr = "pvr" + +class WatcomPlatform(Enum): + Windows = "windows" + OS2 = "OS/2" + + +@dataclasses.dataclass(slots=True) +class JobSpec: + name: str + os: JobOs + platform: SdlPlatform + artifact: Optional[str] + container: Optional[str] = None + autotools: bool = False + no_cmake: bool = False + xcode: bool = False + android_mk: bool = False + lean: bool = False + android_arch: Optional[str] = None + android_abi: Optional[str] = None + android_platform: Optional[int] = None + msys2_platform: Optional[Msys2Platform] = None + intel: Optional[IntelCompiler] = None + apple_archs: Optional[set[AppleArch]] = None + msvc_project: Optional[str] = None + msvc_arch: Optional[MsvcArch] = None + msvc_static_crt: bool = False + clang_cl: bool = False + gdk: bool = False + vita_gles: Optional[VitaGLES] = None + watcom_platform: Optional[WatcomPlatform] = None + + +JOB_SPECS = { + "msys2-mingw32": JobSpec(name="Windows (msys2, mingw32)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw32", msys2_platform=Msys2Platform.Mingw32, ), + "msys2-mingw64": JobSpec(name="Windows (msys2, mingw64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64", msys2_platform=Msys2Platform.Mingw64, ), + "msys2-clang64": JobSpec(name="Windows (msys2, clang64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-clang", msys2_platform=Msys2Platform.Clang64, ), + "msys2-ucrt64": JobSpec(name="Windows (msys2, ucrt64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msys2, artifact="SDL-mingw64-ucrt", msys2_platform=Msys2Platform.Ucrt64, ), + "msvc-x64": JobSpec(name="Windows (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_project="VisualC/SDL.sln", ), + "msvc-x86": JobSpec(name="Windows (MSVC, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_project="VisualC/SDL.sln", ), + "msvc-static-x86": JobSpec(name="Windows (MSVC, static VCRT, x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x86", msvc_arch=MsvcArch.X86, msvc_static_crt=True, ), + "msvc-static-x64": JobSpec(name="Windows (MSVC, static VCRT, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-x64", msvc_arch=MsvcArch.X64, msvc_static_crt=True, ), + "msvc-clang-x64": JobSpec(name="Windows (MSVC, clang-cl x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x64", msvc_arch=MsvcArch.X64, clang_cl=True, ), + "msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ), + "msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ), + "msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ), + "ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", autotools=True), + "steamrt-sniper": JobSpec(name="Steam Linux Runtime (Sniper)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Linux, artifact="SDL-slrsniper", container="registry.gitlab.steamos.cloud/steamrt/sniper/sdk:beta", ), + "ubuntu-intel-icx": JobSpec(name="Ubuntu 22.04 (Intel oneAPI)", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04-oneapi", intel=IntelCompiler.Icx, ), + "macos-gnu-arm64-x64": JobSpec(name="MacOS (GNU prefix)", os=JobOs.MacosLatest, platform=SdlPlatform.MacOS, artifact="SDL-macos-arm64-x64-gnu",autotools=True, apple_archs={AppleArch.X86_64, AppleArch.ARM64, }, ), + "ios": JobSpec(name="iOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Ios, artifact="SDL-ios-arm64", xcode=True, ), + "tvos": JobSpec(name="tvOS (CMake & xcode)", os=JobOs.MacosLatest, platform=SdlPlatform.Tvos, artifact="SDL-tvos-arm64", xcode=True, ), + "android-cmake": JobSpec(name="Android (CMake)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact="SDL-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, ), + "android-mk": JobSpec(name="Android (Android.mk)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Android, artifact=None, no_cmake=True, android_mk=True, ), + "emscripten": JobSpec(name="Emscripten", os=JobOs.UbuntuLatest, platform=SdlPlatform.Emscripten, artifact="SDL-emscripten", ), + "haiku": JobSpec(name="Haiku", os=JobOs.UbuntuLatest, platform=SdlPlatform.Haiku, artifact="SDL-haiku-x64", container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ), + "n3ds": JobSpec(name="Nintendo 3DS", os=JobOs.UbuntuLatest, platform=SdlPlatform.N3ds, artifact="SDL-n3ds", container="devkitpro/devkitarm:latest", ), + "ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ), + "psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ), + "vita-pib": JobSpec(name="Sony PlayStation Vita (GLES w/ pib)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pib", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pib, ), + "vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ), + "riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ), + "netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", autotools=True, ), + "openbsd": JobSpec(name="OpenBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.OpenBSD, artifact="SDL-openbsd-x64", autotools=True, ), + "freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", autotools=True, ), + "watcom-win32": JobSpec(name="Watcom (Windows)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.Windows ), + "watcom-os2": JobSpec(name="Watcom (OS/2)", os=JobOs.WindowsLatest, platform=SdlPlatform.Watcom, artifact="SDL-watcom-win32", no_cmake=True, watcom_platform=WatcomPlatform.OS2 ), + # "watcom-win32" + # "watcom-os2" +} + + +class StaticLibType(Enum): + MSVC = "SDL2-static.lib" + A = "libSDL2.a" + + +class SharedLibType(Enum): + WIN32 = "SDL2.dll" + SO_0 = "libSDL2-2.0.so.0" + SO = "libSDL2.so" + DYLIB = "libSDL2-2.0.0.dylib" + FRAMEWORK = "SDL2.framework/Versions/A/SDL2" + + +@dataclasses.dataclass(slots=True) +class JobDetails: + name: str + key: str + os: str + platform: str + artifact: str + no_autotools: bool + no_cmake: bool + build_autotools_tests: bool = True + build_tests: bool = True + container: str = "" + cmake_build_type: str = "RelWithDebInfo" + shell: str = "sh" + sudo: str = "sudo" + cmake_config_emulator: str = "" + apk_packages: list[str] = dataclasses.field(default_factory=list) + apt_packages: list[str] = dataclasses.field(default_factory=list) + brew_packages: list[str] = dataclasses.field(default_factory=list) + cmake_toolchain_file: str = "" + cmake_arguments: list[str] = dataclasses.field(default_factory=list) + cmake_generator: str = "Ninja" + cmake_build_arguments: list[str] = dataclasses.field(default_factory=list) + cppflags: list[str] = dataclasses.field(default_factory=list) + cc: str = "" + cxx: str = "" + cflags: list[str] = dataclasses.field(default_factory=list) + cxxflags: list[str] = dataclasses.field(default_factory=list) + ldflags: list[str] = dataclasses.field(default_factory=list) + pollute_directories: list[str] = dataclasses.field(default_factory=list) + use_cmake: bool = True + shared: bool = True + static: bool = True + shared_lib: Optional[SharedLibType] = None + static_lib: Optional[StaticLibType] = None + run_tests: bool = True + test_pkg_config: bool = True + cc_from_cmake: bool = False + source_cmd: str = "" + pretest_cmd: str = "" + android_apks: list[str] = dataclasses.field(default_factory=list) + android_ndk: bool = False + android_mk: bool = False + minidump: bool = False + intel: bool = False + msys2_msystem: str = "" + msys2_env: str = "" + msys2_no_perl: bool = False + werror: bool = True + msvc_vcvars_arch: str = "" + msvc_vcvars_sdk: str = "" + msvc_project: str = "" + msvc_project_flags: list[str] = dataclasses.field(default_factory=list) + setup_ninja: bool = False + setup_libusb_arch: str = "" + xcode_sdk: str = "" + xcode_target: str = "" + setup_gdk_folder: str = "" + cpactions: bool = False + cpactions_os: str = "" + cpactions_version: str = "" + cpactions_arch: str = "" + cpactions_setup_cmd: str = "" + cpactions_install_cmd: str = "" + setup_vita_gles_type: str = "" + check_sources: bool = False + watcom_makefile: str = "" + binutils_strings: str = "strings" + + def to_workflow(self, enable_artifacts: bool) -> dict[str, str|bool]: + data = { + "name": self.name, + "key": self.key, + "os": self.os, + "container": self.container if self.container else "", + "platform": self.platform, + "artifact": self.artifact, + "enable-artifacts": enable_artifacts, + "shell": self.shell, + "msys2-msystem": self.msys2_msystem, + "msys2-env": self.msys2_env, + "msys2-no-perl": self.msys2_no_perl, + "android-ndk": self.android_ndk, + "intel": self.intel, + "apk-packages": my_shlex_join(self.apk_packages), + "apt-packages": my_shlex_join(self.apt_packages), + "test-pkg-config": self.test_pkg_config, + "brew-packages": my_shlex_join(self.brew_packages), + "pollute-directories": my_shlex_join(self.pollute_directories), + "no-autotools": self.no_autotools, + "no-cmake": self.no_cmake, + "build-autotools-tests": self.build_autotools_tests, + "build-tests": self.build_tests, + "source-cmd": self.source_cmd, + "pretest-cmd": self.pretest_cmd, + "cmake-config-emulator": self.cmake_config_emulator, + "cc": self.cc, + "cxx": self.cxx, + "cflags": my_shlex_join(self.cppflags + self.cflags), + "cxxflags": my_shlex_join(self.cppflags + self.cxxflags), + "ldflags": my_shlex_join(self.ldflags), + "cmake-generator": self.cmake_generator, + "cmake-toolchain-file": self.cmake_toolchain_file, + "cmake-arguments": my_shlex_join(self.cmake_arguments), + "cmake-build-arguments": my_shlex_join(self.cmake_build_arguments), + "shared": self.shared, + "static": self.static, + "shared-lib": self.shared_lib.value if self.shared_lib else None, + "static-lib": self.static_lib.value if self.static_lib else None, + "cmake-build-type": self.cmake_build_type, + "run-tests": self.run_tests, + "android-apks": my_shlex_join(self.android_apks), + "android-mk": self.android_mk, + "werror": self.werror, + "sudo": self.sudo, + "msvc-vcvars-arch": self.msvc_vcvars_arch, + "msvc-vcvars-sdk": self.msvc_vcvars_sdk, + "msvc-project": self.msvc_project, + "msvc-project-flags": my_shlex_join(self.msvc_project_flags), + "setup-ninja": self.setup_ninja, + "setup-libusb-arch": self.setup_libusb_arch, + "cc-from-cmake": self.cc_from_cmake, + "xcode-sdk": self.xcode_sdk, + "xcode-target": self.xcode_target, + "cpactions": self.cpactions, + "cpactions-os": self.cpactions_os, + "cpactions-version": self.cpactions_version, + "cpactions-arch": self.cpactions_arch, + "cpactions-setup-cmd": self.cpactions_setup_cmd, + "cpactions-install-cmd": self.cpactions_install_cmd, + "setup-vita-gles-type": self.setup_vita_gles_type, + "setup-gdk-folder": self.setup_gdk_folder, + "check-sources": self.check_sources, + "watcom-makefile": self.watcom_makefile, + "binutils-strings": self.binutils_strings, + } + return {k: v for k, v in data.items() if v != ""} + + +def my_shlex_join(s): + def escape(s): + if s[:1] == "'" and s[-1:] == "'": + return s + if set(s).intersection(set("; \t")): + s = s.replace("\\", "\\\\").replace("\"", "\\\"") + return f'"{s}"' + return s + + return " ".join(escape(e) for e in s) + + +def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDetails: + job = JobDetails( + name=spec.name, + key=key, + os=spec.os.value, + artifact=spec.artifact or "", + container=spec.container or "", + platform=spec.platform.value, + sudo="sudo", + no_autotools=not spec.autotools, + no_cmake=spec.no_cmake, + ) + if job.os.startswith("ubuntu"): + job.apt_packages.extend([ + "ninja-build", + "pkg-config", + ]) + if spec.msvc_static_crt: + job.cmake_arguments.append("-DSDL_FORCE_STATIC_VCRT=ON") + pretest_cmd = [] + if trackmem_symbol_names: + pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=1") + else: + pretest_cmd.append("export SDL_TRACKMEM_SYMBOL_NAMES=0") + win32 = spec.platform in (SdlPlatform.Msys2, SdlPlatform.Msvc) + fpic = None + build_parallel = True + if spec.lean: + job.cppflags.append("-DSDL_LEAN_AND_MEAN=1") + if win32: + job.cmake_arguments.append("-DSDLTEST_PROCDUMP=ON") + job.minidump = True + if spec.intel is not None: + match spec.intel: + case IntelCompiler.Icx: + job.cc = "icx" + job.cxx = "icpx" + case _: + raise ValueError(f"Invalid intel={spec.intel}") + job.source_cmd = f"source /opt/intel/oneapi/setvars.sh;" + job.intel = True + job.shell = "bash" + job.cmake_arguments.extend(( + f"-DCMAKE_C_COMPILER={job.cc}", + f"-DCMAKE_CXX_COMPILER={job.cxx}", + "-DCMAKE_SYSTEM_NAME=Linux", + )) + match spec.platform: + case SdlPlatform.Msvc: + job.setup_ninja = not spec.gdk + job.msvc_project = spec.msvc_project if spec.msvc_project else "" + job.msvc_project_flags.append("-p:TreatWarningsAsError=true") + job.test_pkg_config = False + job.shared_lib = SharedLibType.WIN32 + job.static_lib = StaticLibType.MSVC + job.cmake_arguments.extend(( + "-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase", + "-DCMAKE_EXE_LINKER_FLAGS=-DEBUG", + "-DCMAKE_SHARED_LINKER_FLAGS=-DEBUG", + )) + job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$:Debug>'") + + if spec.clang_cl: + job.cmake_arguments.extend(( + "-DCMAKE_C_COMPILER=clang-cl", + "-DCMAKE_CXX_COMPILER=clang-cl", + )) + match spec.msvc_arch: + case MsvcArch.X86: + job.cflags.append("/clang:-m32") + job.ldflags.append("/MACHINE:X86") + case MsvcArch.X64: + job.cflags.append("/clang:-m64") + job.ldflags.append("/MACHINE:X64") + case _: + raise ValueError(f"Unsupported clang-cl architecture (arch={spec.msvc_arch})") + if spec.msvc_project: + match spec.msvc_arch: + case MsvcArch.X86: + msvc_platform = "Win32" + case MsvcArch.X64: + msvc_platform = "x64" + case _: + raise ValueError(f"Unsupported vcxproj architecture (arch={spec.msvc_arch})") + if spec.gdk: + msvc_platform = f"Gaming.Desktop.{msvc_platform}" + job.msvc_project_flags.append(f"-p:Platform={msvc_platform}") + match spec.msvc_arch: + case MsvcArch.X86: + job.msvc_vcvars_arch = "x64_x86" + case MsvcArch.X64: + job.msvc_vcvars_arch = "x64" + case MsvcArch.Arm64: + job.msvc_vcvars_arch = "x64_arm64" + job.run_tests = False + if spec.gdk: + job.setup_gdk_folder = "VisualC-GDK" + else: + match spec.msvc_arch: + case MsvcArch.X86: + job.setup_libusb_arch = "x86" + case MsvcArch.X64: + job.setup_libusb_arch = "x64" + case SdlPlatform.Linux: + if spec.name.startswith("Ubuntu"): + assert spec.os.value.startswith("ubuntu-") + job.apt_packages.extend(( + "gnome-desktop-testing", + "libasound2-dev", + "libpulse-dev", + "libaudio-dev", + "libjack-dev", + "libsndio-dev", + "libusb-1.0-0-dev", + "libx11-dev", + "libxext-dev", + "libxrandr-dev", + "libxcursor-dev", + "libxfixes-dev", + "libxi-dev", + "libxss-dev", + "libwayland-dev", + "libxkbcommon-dev", + "libdrm-dev", + "libgbm-dev", + "libgl1-mesa-dev", + "libgles2-mesa-dev", + "libegl1-mesa-dev", + "libdbus-1-dev", + "libibus-1.0-dev", + "libudev-dev", + "fcitx-libs-dev", + )) + ubuntu_year, ubuntu_month = [int(v) for v in spec.os.value.removeprefix("ubuntu-").split(".", 1)] + if ubuntu_year >= 22: + job.apt_packages.extend(("libpipewire-0.3-dev", "libdecor-0-dev")) + job.apt_packages.extend(( + "libunwind-dev", # For SDL_test memory tracking + )) + if trackmem_symbol_names: + # older libunwind is slow + job.cmake_arguments.append("-DSDLTEST_TIMEOUT_MULTIPLIER=2") + job.shared_lib = SharedLibType.SO_0 + job.static_lib = StaticLibType.A + fpic = True + case SdlPlatform.Ios | SdlPlatform.Tvos: + job.brew_packages.extend([ + "ninja", + ]) + job.run_tests = False + job.test_pkg_config = False + job.shared_lib = SharedLibType.DYLIB + job.static_lib = StaticLibType.A + match spec.platform: + case SdlPlatform.Ios: + if spec.xcode: + job.xcode_sdk = "iphoneos" + job.xcode_target = "Static Library-iOS" + job.cmake_arguments.extend([ + "-DCMAKE_SYSTEM_NAME=iOS", + "-DCMAKE_OSX_ARCHITECTURES=\"arm64\"", + "-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0", + ]) + case SdlPlatform.Tvos: + if spec.xcode: + job.xcode_sdk = "appletvos" + job.xcode_target = "Static Library-tvOS" + job.cmake_arguments.extend([ + "-DCMAKE_SYSTEM_NAME=tvOS", + "-DCMAKE_OSX_ARCHITECTURES=\"arm64\"", + "-DCMAKE_OSX_DEPLOYMENT_TARGET=9.0", + ]) + case SdlPlatform.MacOS: + osx_arch = ";".join(e.value for e in spec.apple_archs) if spec.apple_archs else "arm64" + job.cmake_arguments.extend(( + f"'-DCMAKE_OSX_ARCHITECTURES={osx_arch}'", + "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11", + )) + job.build_autotools_tests = False + job.shared_lib = SharedLibType.DYLIB + job.static_lib = StaticLibType.A + job.apt_packages = [] + job.brew_packages.extend(( + "autoconf", + "ninja", + )) + if spec.xcode: + job.xcode_sdk = "macosx" + case SdlPlatform.Android: + job.android_mk = spec.android_mk + job.run_tests = False + job.shared_lib = SharedLibType.SO + job.static_lib = StaticLibType.A + if spec.android_mk or not spec.no_cmake: + job.android_ndk = True + if spec.android_mk: + job.apt_packages = [] + if not spec.no_cmake: + job.cmake_arguments.extend(( + f"-DANDROID_PLATFORM={spec.android_platform}", + f"-DANDROID_ABI={spec.android_abi}", + )) + job.cmake_toolchain_file = "${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" + job.cc = f"${{ANDROID_NDK_HOME}}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target={spec.android_arch}-none-linux-androideabi{spec.android_platform}" + + job.android_apks = [ + "testaudiorecording-apk", + "testautomation-apk", + "testcontroller-apk", + "testmultiaudio-apk", + "testsprite-apk", + ] + case SdlPlatform.Emscripten: + job.run_tests = False + job.shared = False + job.cmake_config_emulator = "emcmake" + job.cmake_build_type = "Debug" + job.test_pkg_config = False + job.cmake_arguments.extend(( + "-DSDLTEST_BROWSER=chrome", + "-DSDLTEST_TIMEOUT_MULTIPLIER=4", + "-DSDLTEST_CHROME_BINARY=${CHROME_BINARY}", + )) + job.static_lib = StaticLibType.A + case SdlPlatform.Ps2: + build_parallel = False + job.shared = False + job.sudo = "" + job.apt_packages = [] + job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", "git", ] + job.cmake_toolchain_file = "${PS2DEV}/ps2sdk/ps2dev.cmake" + job.run_tests = False + job.shared = False + job.cc = "mips64r5900el-ps2-elf-gcc" + job.ldflags = ["-L${PS2DEV}/ps2sdk/ee/lib", "-L${PS2DEV}/gsKit/lib", "-L${PS2DEV}/ps2sdk/ports/lib", ] + job.static_lib = StaticLibType.A + case SdlPlatform.Psp: + build_parallel = False + job.sudo = "" + job.apt_packages = [] + job.apk_packages = ["cmake", "gmp", "mpc1", "mpfr4", "ninja", "pkgconf", ] + job.cmake_toolchain_file = "${PSPDEV}/psp/share/pspdev.cmake" + job.run_tests = False + job.shared = False + job.cc = "psp-gcc" + job.ldflags = ["-L${PSPDEV}/lib", "-L${PSPDEV}/psp/lib", "-L${PSPDEV}/psp/sdk/lib", ] + job.pollute_directories = ["${PSPDEV}/include", "${PSPDEV}/psp/include", "${PSPDEV}/psp/sdk/include", ] + job.static_lib = StaticLibType.A + case SdlPlatform.Vita: + job.sudo = "" + job.apt_packages = [] + job.apk_packages = ["cmake", "ninja", "pkgconf", "bash", "tar"] + job.cmake_toolchain_file = "${VITASDK}/share/vita.toolchain.cmake" + assert spec.vita_gles is not None + job.setup_vita_gles_type = { + VitaGLES.Pib: "pib", + VitaGLES.Pvr: "pvr", + }[spec.vita_gles] + job.cmake_arguments.extend(( + f"-DVIDEO_VITA_PIB={ 'true' if spec.vita_gles == VitaGLES.Pib else 'false' }", + f"-DVIDEO_VITA_PVR={ 'true' if spec.vita_gles == VitaGLES.Pvr else 'false' }", + "-DSDL_ARMNEON=ON", + "-DSDL_ARMSIMD=ON", + )) + # Fix vita.toolchain.cmake (https://github.com/vitasdk/vita-toolchain/pull/253) + job.source_cmd = r"""sed -i -E "s#set\\( PKG_CONFIG_EXECUTABLE \"\\$\\{VITASDK}/bin/arm-vita-eabi-pkg-config\" \\)#set\\( PKG_CONFIG_EXECUTABLE \"${VITASDK}/bin/arm-vita-eabi-pkg-config\" CACHE PATH \"Path of pkg-config executable\" \\)#" ${VITASDK}/share/vita.toolchain.cmake""" + job.run_tests = False + job.shared = False + job.cc = "arm-vita-eabi-gcc" + job.static_lib = StaticLibType.A + case SdlPlatform.Haiku: + fpic = False + job.build_autotools_tests = False + job.run_tests = False + job.cc = "x86_64-unknown-haiku-gcc" + job.cxx = "x86_64-unknown-haiku-g++" + job.sudo = "" + job.cmake_arguments.extend(( + f"-DCMAKE_C_COMPILER={job.cc}", + f"-DCMAKE_CXX_COMPILER={job.cxx}", + "-DSDL_UNIX_CONSOLE_BUILD=ON", + )) + job.shared_lib = SharedLibType.SO_0 + job.static_lib = StaticLibType.A + case SdlPlatform.N3ds: + job.cmake_generator = "Unix Makefiles" + job.cmake_build_arguments.append("-j$(nproc)") + job.shared = False + job.apt_packages = [] + job.run_tests = False + job.cc_from_cmake = True + job.cmake_toolchain_file = "${DEVKITPRO}/cmake/3DS.cmake" + job.binutils_strings = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-strings" + job.static_lib = StaticLibType.A + case SdlPlatform.Msys2: + job.shell = "msys2 {0}" + assert spec.msys2_platform + job.msys2_msystem = spec.msys2_platform.value + job.msys2_env = { + "mingw32": "mingw-w64-i686", + "mingw64": "mingw-w64-x86_64", + "clang32": "mingw-w64-clang-i686", + "clang64": "mingw-w64-clang-x86_64", + "ucrt64": "mingw-w64-ucrt-x86_64", + }[spec.msys2_platform.value] + job.msys2_no_perl = spec.msys2_platform in (Msys2Platform.Mingw32, ) + job.shared_lib = SharedLibType.WIN32 + job.static_lib = StaticLibType.A + case SdlPlatform.Riscos: + # FIXME: Enable SDL_WERROR + job.werror = False + job.build_autotools_tests = False + job.apt_packages = ["cmake", "ninja-build"] + job.test_pkg_config = False + job.shared = False + job.run_tests = False + job.sudo = "" + job.cmake_arguments.extend(( + "-DRISCOS:BOOL=ON", + "-DCMAKE_DISABLE_PRECOMPILE_HEADERS:BOOL=ON", + "-DSDL_GCC_ATOMICS:BOOL=OFF", + )) + job.cmake_toolchain_file = "/home/riscos/env/toolchain-riscos.cmake" + job.static_lib = StaticLibType.A + case SdlPlatform.FreeBSD | SdlPlatform.NetBSD | SdlPlatform.OpenBSD: + job.build_autotools_tests = False + job.cpactions = True + job.no_cmake = True + job.run_tests = False + job.apt_packages = [] + job.shared_lib = SharedLibType.SO_0 + job.static_lib = StaticLibType.A + match spec.platform: + case SdlPlatform.FreeBSD: + job.cpactions_os = "freebsd" + job.cpactions_version = "14.3" + job.cpactions_arch = "x86-64" + job.cpactions_setup_cmd = "sudo pkg update" + job.cpactions_install_cmd = "sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd" + job.cmake_arguments.extend(( + "-DSDL_CHECK_REQUIRED_INCLUDES=/usr/local/include", + "-DSDL_CHECK_REQUIRED_LINK_OPTIONS=-L/usr/local/lib", + )) + case SdlPlatform.NetBSD: + job.cpactions_os = "netbsd" + job.cpactions_version = "10.1" + job.cpactions_arch = "x86-64" + job.cpactions_setup_cmd = "export PATH=\"/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH\"; export PKG_CONFIG_PATH=\"/usr/pkg/lib/pkgconfig\";export PKG_PATH=\"https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f \"1 2\" -d.)/All/\";echo \"PKG_PATH=$PKG_PATH\";echo \"uname -a -> \"$(uname -a)\"\";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update" + job.cpactions_install_cmd = "sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1" + case SdlPlatform.OpenBSD: + job.cpactions_os = "openbsd" + job.cpactions_version = "7.7" + job.cpactions_arch = "x86-64" + job.cpactions_setup_cmd = "sudo pkg_add -u" + job.cpactions_install_cmd = "sudo pkg_add cmake ninja pkgconf wayland wayland-protocols libxkbcommon libinotify pulseaudio dbus ibus" + case SdlPlatform.Watcom: + match spec.watcom_platform: + case WatcomPlatform.OS2: + job.watcom_makefile = "Makefile.os2" + job.run_tests = False + case WatcomPlatform.Windows: + job.watcom_makefile = "Makefile.w32" + job.run_tests = True + case _: + raise ValueError(f"Unsupported watcom_platform=${spec.watcom_platform}") + case _: + raise ValueError(f"Unsupported platform={spec.platform}") + + if "ubuntu" in spec.name.lower(): + job.check_sources = True + + if not build_parallel: + job.cmake_build_arguments.append("-j1") + if job.cflags: + job.cmake_arguments.append(f"-DCMAKE_C_FLAGS={my_shlex_join(job.cflags)}") + if job.cxxflags: + job.cmake_arguments.append(f"-DCMAKE_CXX_FLAGS={my_shlex_join(job.cxxflags)}") + if job.ldflags: + job.cmake_arguments.append(f"-DCMAKE_SHARED_LINKER_FLAGS={my_shlex_join(job.ldflags)}") + job.cmake_arguments.append(f"-DCMAKE_EXE_LINKER_FLAGS={my_shlex_join(job.ldflags)}") + job.pretest_cmd = "\n".join(pretest_cmd) + def tf(b): + return "ON" if b else "OFF" + + if fpic is not None: + job.cmake_arguments.append(f"-DCMAKE_POSITION_INDEPENDENT_CODE={tf(fpic)}") + + if job.no_cmake: + job.cmake_arguments = [] + + return job + + +def spec_to_platform(spec: JobSpec, key: str, enable_artifacts: bool, trackmem_symbol_names: bool) -> dict[str, str|bool]: + logger.info("spec=%r", spec) + job = spec_to_job(spec, key=key, trackmem_symbol_names=trackmem_symbol_names) + logger.info("job=%r", job) + platform = job.to_workflow(enable_artifacts=enable_artifacts) + logger.info("platform=%r", platform) + return platform + + +def main(): + parser = argparse.ArgumentParser(allow_abbrev=False) + parser.add_argument("--github-variable-prefix", default="platforms") + parser.add_argument("--github-ci", action="store_true") + parser.add_argument("--verbose", action="store_true") + parser.add_argument("--commit-message-file") + parser.add_argument("--no-artifact", dest="enable_artifacts", action="store_false") + parser.add_argument("--trackmem-symbol-names", dest="trackmem_symbol_names", action="store_true") + args = parser.parse_args() + + logging.basicConfig(level=logging.INFO if args.verbose else logging.WARNING) + + remaining_keys = set(JOB_SPECS.keys()) + + all_level_keys = ( + # Level 1 + ( + "haiku", + ), + ) + + filters = [] + if args.commit_message_file: + with open(args.commit_message_file, "r") as f: + commit_message = f.read() + for m in re.finditer(r"\[sdl-ci-filter (.*)]", commit_message, flags=re.M): + filters.append(m.group(1).strip(" \t\n\r\t'\"")) + + if re.search(r"\[sdl-ci-artifacts?]", commit_message, flags=re.M): + args.enable_artifacts = True + + if re.search(r"\[sdl-ci-(full-)?trackmem(-symbol-names)?]", commit_message, flags=re.M): + args.trackmem_symbol_names = True + + if not filters: + filters.append("*") + + logger.info("filters: %r", filters) + + all_level_platforms = {} + + all_platforms = {key: spec_to_platform(spec, key=key, enable_artifacts=args.enable_artifacts, trackmem_symbol_names=args.trackmem_symbol_names) for key, spec in JOB_SPECS.items()} + + for level_i, level_keys in enumerate(all_level_keys, 1): + level_key = f"level{level_i}" + logger.info("Level %d: keys=%r", level_i, level_keys) + assert all(k in remaining_keys for k in level_keys) + level_platforms = tuple(all_platforms[key] for key in level_keys) + remaining_keys.difference_update(level_keys) + all_level_platforms[level_key] = level_platforms + logger.info("=" * 80) + + logger.info("Keys before filter: %r", remaining_keys) + + filtered_remaining_keys = set() + for filter in filters: + filtered_remaining_keys.update(fnmatch.filter(remaining_keys, filter)) + + logger.info("Keys after filter: %r", filtered_remaining_keys) + + remaining_keys = filtered_remaining_keys + + logger.info("Remaining: %r", remaining_keys) + all_level_platforms["others"] = tuple(all_platforms[key] for key in remaining_keys) + + if args.github_ci: + for level, platforms in all_level_platforms.items(): + platforms_json = json.dumps(platforms) + txt = f"{args.github_variable_prefix}-{level}={platforms_json}" + logger.info("%s", txt) + if "GITHUB_OUTPUT" in os.environ: + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(txt) + f.write("\n") + else: + logger.warning("GITHUB_OUTPUT not defined") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml deleted file mode 100644 index 56f77b6ce0b4d..0000000000000 --- a/.github/workflows/emscripten.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build (Emscripten) - -on: [push, pull_request] - -jobs: - emscripten: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: mymindstorm/setup-emsdk@v10 - with: - version: 2.0.32 - - name: Install ninja - run: | - sudo apt-get -y update - sudo apt-get install -y ninja-build - - name: Configure CMake - run: | - emcmake cmake -S . -B build \ - -DSDL_WERROR=ON \ - -DSDL_TESTS=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=prefix \ - -GNinja - - name: Build - run: cmake --build build/ --verbose - - name: Run build-time tests - run: | - set -eu - export SDL_TESTS_QUICK=1 - # FIXME: enable Emscripten build time tests - # ctest -VV --test-dir build/ - - name: Install - run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV - cmake --install build/ - - name: Verify CMake configuration files - run: | - emcmake cmake -S cmake/test -B cmake_config_build \ - -DCMAKE_BUILD_TYPE=Release \ - -DSDL_VENDOR_INFO="Github Workflow" \ - -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} - cmake --build cmake_config_build --verbose diff --git a/.github/workflows/generic.yml b/.github/workflows/generic.yml new file mode 100644 index 0000000000000..80713c4e6fd76 --- /dev/null +++ b/.github/workflows/generic.yml @@ -0,0 +1,352 @@ +name: 'Build' +run-name: 'Configure, Build and Test SDL' + +on: + workflow_call: + inputs: + platforms: + description: 'JSON-encoded test properties' + type: string + required: true + +jobs: + build: + name: ${{ matrix.platform.name }} + runs-on: ${{ matrix.platform.os }} + container: ${{ matrix.platform.container }} + defaults: + run: + shell: ${{ matrix.platform.shell }} + strategy: + fail-fast: false + matrix: + platform: ${{ fromJSON(inputs.platforms) }} + steps: + - name: 'Set up MSYS2' + if: ${{ matrix.platform.platform == 'msys2' }} + uses: msys2/setup-msys2@v2 + with: + msystem: ${{ matrix.platform.msys2-msystem }} + install: >- + ${{ matrix.platform.msys2-env }}-cc + ${{ matrix.platform.msys2-env }}-cmake + ${{ matrix.platform.msys2-env }}-ninja + ${{ (!matrix.platform.msys2-no-perl && format('{0}-perl', matrix.platform.msys2-env)) || '' }} + ${{ matrix.platform.msys2-env }}-pkg-config + ${{ matrix.platform.msys2-env }}-clang-tools-extra + - name: 'About this job' + run: | + echo "key=${{ matrix.platform.key }}" + echo "name=${{ matrix.platform.name }}" + echo "os=${{ matrix.platform.os }}" + echo "" + echo "Add [sdl-ci-filter ${{ matrix.platform.key }}] to your commit message to reduce the number of jobs." + - uses: actions/checkout@v4 + - name: 'Set up ninja' + if: ${{ matrix.platform.setup-ninja }} + uses: ./.github/actions/setup-ninja + - uses: mymindstorm/setup-emsdk@v14 + if: ${{ matrix.platform.platform == 'emscripten' }} + with: + version: 3.1.35 + - uses: nttld/setup-ndk@v1 + if: ${{ matrix.platform.android-ndk }} + id: setup-ndk + with: + local-cache: true + ndk-version: r21e + - uses: ilammy/msvc-dev-cmd@v1 + if: ${{ matrix.platform.platform == 'msvc' }} + with: + arch: ${{ matrix.platform.msvc-vcvars-arch }} + sdk: ${{ matrix.platform.msvc-vcvars-sdk }} + - name: 'Set up Windows GDK Desktop' + uses: ./.github/actions/setup-gdk-desktop + if: ${{ matrix.platform.setup-gdk-folder != '' }} + with: + folder: '${{ matrix.platform.setup-gdk-folder }}' + - name: 'Setup Intel oneAPI toolchain' + id: intel + if: ${{ matrix.platform.intel }} + run: | + # Download the key to system keyring + wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + + # Add signed entry to apt sources and configure the APT client to use Intel repository: + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + + # Update package list + sudo apt-get update -y + + # Install oneAPI + sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic + - name: 'Install apk packages' + if: ${{ matrix.platform.apk-packages != '' }} + run: | + ${{ matrix.platform.sudo }} apk update + ${{ matrix.platform.sudo }} apk add ${{ matrix.platform.apk-packages }} + - name: 'Install apt packages' + if: ${{ matrix.platform.apt-packages != '' }} + run: | + ${{ matrix.platform.sudo }} apt-get update + ${{ matrix.platform.sudo }} apt-get install -y ${{ matrix.platform.apt-packages }} + - name: 'Install brew packages' + if: ${{ matrix.platform.brew-packages != '' }} + run: | + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + brew update + brew install ${{ matrix.platform.brew-packages }} + - name: 'Set up GLES for VITA' # Must be after apk + if: ${{ matrix.platform.setup-vita-gles-type != '' }} + uses: ./.github/actions/setup-vita-gles + with: + type: ${{ matrix.platform.setup-vita-gles-type }} + + - name: 'Configure (Autotools)' + if: ${{ !matrix.platform.no-autotools }} + run: | + ${{ matrix.platform.source_cmd }} + set -eu + rm -rf build-autotools + mkdir build-autotools + ./autogen.sh + ( + cd build-autotools + ../configure \ + --enable-vendor-info="Github Workflow" \ + --enable-werror \ + --prefix=${{ github.workspace }}/autotools_prefix \ + ) + if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then + curdir="$(pwd)" + multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + ( + mkdir -p build-autotools/test + cd build-autotools/test + ../../test/configure \ + --enable-werror \ + --x-includes=/usr/include \ + --x-libraries="/usr/lib/${multiarch}" \ + --prefix=${{ github.workspace }}/autotools_prefix \ + SDL_CFLAGS="-I${curdir}/include" \ + SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \ + ac_cv_lib_SDL2_ttf_TTF_Init=no \ + ${NULL+} + ) + fi + - name: 'Build (Autotools)' + if: ${{ !matrix.platform.no-autotools }} + run: | + ${{ matrix.platform.source_cmd }} + set -eu + parallel="$(getconf _NPROCESSORS_ONLN)" + make -j"${parallel}" -C build-autotools V=1 + if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then + make -j"${parallel}" -C build-autotools/test V=1 + fi + - name: 'Run build-time tests (Autotools)' + if: ${{ !matrix.platform.no-autotools && matrix.platform.build-autotools-tests && matrix.platform.run-tests }} + run: | + ${{ matrix.platform.source_cmd }} + set -eu + curdir="$(pwd)" + parallel="$(getconf _NPROCESSORS_ONLN)" + export SDL_TESTS_QUICK=1 + make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" + if test "${{ runner.os }}" = "Linux"; then + # This should show us the SDL_REVISION + strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL- + fi + - name: 'Install (Autotools)' + if: ${{ !matrix.platform.no-autotools }} + run: | + ${{ matrix.platform.source_cmd }} + set -eu + curdir="$(pwd)" + parallel="$(getconf _NPROCESSORS_ONLN)" + make -j"${parallel}" -C build-autotools install V=1 + if test "x${{ (matrix.platform.build-autotools-tests && 'yes') || 'no' }}" = "xyes" ; then + make -j"${parallel}" -C build-autotools/test install V=1 + fi + ( cd autotools_prefix; find . ) | LC_ALL=C sort -u + echo "prefix=$(pwd)/autotools_prefix" >> $GITHUB_OUTPUT + + - name: 'Configure (CMake)' + if: ${{ !matrix.platform.no-cmake }} + #shell: ${{ matrix.platform.shell }} + run: | + ${{ matrix.platform.source-cmd }} + ${{ matrix.platform.cmake-config-emulator }} cmake -S . -B build -G "${{ matrix.platform.cmake-generator }}" \ + -Wdeprecated -Wdev -Werror \ + ${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \ + -DSDL_WERROR=${{ matrix.platform.werror }} \ + -DSDL_TESTS=${{ matrix.platform.build-tests }} \ + -DSDLTEST_TRACKMEM=OFF \ + -DSDL_INSTALL_TESTS=${{ matrix.platform.build-tests }} \ + -DSDL_DISABLE_INSTALL_DOCS=OFF \ + -DSDL_DISABLE_INSTALL_DOCS=OFF \ + ${{ matrix.platform.cmake-arguments }} \ + -DSDL_SHARED=${{ matrix.platform.shared }} \ + -DSDL_STATIC=${{ matrix.platform.static }} \ + -DSDL_TEST=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_INSTALL_PREFIX=prefix \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DSDL_CMAKE_DEBUG_POSTFIX="" \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} + - name: 'Build (CMake)' + id: cmake-build + if: ${{ !matrix.platform.no-cmake }} +# shell: ${{ matrix.platform.shell }} + run: | + ${{ matrix.platform.source-cmd }} + cmake --build build --config ${{ matrix.platform.cmake-build-type }} --verbose -- ${{ matrix.platform.cmake-build-arguments }} + - name: 'Verify SDL_REVISION' + if: ${{ !matrix.platform.no-cmake }} + run: | + echo "This should show us the SDL_REVISION" + echo "Shared library:" + ${{ (matrix.platform.shared-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.shared-lib)) || 'echo ""' }} + echo "Static library:" + ${{ (matrix.platform.static-lib && format('{0} build/{1} | grep "Github Workflow"', matrix.platform.binutils-strings, matrix.platform.static-lib)) || 'echo ""' }} + - name: 'Run build-time tests (CMake)' + id: cmake-tests + if: ${{ !matrix.platform.no-cmake && matrix.platform.run-tests }} +# shell: ${{ matrix.platform.shell }} + run: | + ${{ matrix.platform.source-cmd }} + ${{ matrix.platform.pretest-cmd }} + set -eu + export SDL_TESTS_QUICK=1 + ctest -VV --test-dir build/ -j2 + - name: 'Install (CMake)' + id: cmake-install + if: ${{ steps.build.outcome == 'success' }} +# shell: ${{ matrix.platform.shell }} + run: | + ${{ matrix.platform.source-cmd }} + cmake --install build --config ${{ matrix.platform.cmake-build-type }} + echo "prefix=$(pwd)/prefix" >> $GITHUB_OUTPUT + ( cd prefix; find . ) | LC_ALL=C sort -u + - name: 'Verify CMake configuration files (CMake)' + if: ${{ steps.cmake-install.outcome == 'success' }} +# shell: ${{ matrix.platform.shell }} + run: | + ${{ matrix.platform.source-cmd }} + ${{ matrix.platform.cmake-config-emulator }} cmake -S cmake/test -B cmake_test_build -GNinja \ + ${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \ + -DTEST_SHARED=${{ matrix.platform.shared }} \ + -DTEST_STATIC=${{ matrix.platform.static }} \ + ${{ matrix.platform.cmake-arguments }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \ + -DCMAKE_PREFIX_PATH="${{ steps.cmake-install.outputs.prefix }}" + cmake --build cmake_test_build --verbose --config ${{ matrix.platform.cmake-build-type }} -- ${{ matrix.platform.cmake-build-arguments }} + - name: 'Extract CC/CXX/CFLAGS/CXXFLAGS from CMake toolchain' + if: ${{ steps.cmake-install.outcome == 'success' && matrix.platform.cc-from-cmake }} +# shell: ${{ matrix.platform.shell }} + run: | + cmake -S .github/cmake -B /tmp/cmake_extract \ + ${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} \ + -DVAR_PATH=/tmp/env.txt + cat /tmp/env.txt >> $GITHUB_ENV + - name: 'Verify sdl2.pc (CMake)' +# shell: ${{ matrix.platform.shell }} + if: ${{ steps.cmake-install.outcome == 'success' && matrix.platform.test-pkg-config }} + run: | + ${{ matrix.platform.source-cmd }} + ${{ matrix.platform.cc && format('export CC="{0}"', matrix.platform.cc) || '' }} + ${{ matrix.platform.cflags && format('export CFLAGS="{0}"', matrix.platform.cflags) || '' }} + ${{ matrix.platform.ldflags && format('export LDFLAGS="{0}"', matrix.platform.ldflags) || '' }} + export PKG_CONFIG_PATH=${{ steps.cmake-install.outputs.prefix }}/lib/pkgconfig + cmake/test/test_pkgconfig.sh + - name: 'Build (cross-platform-actions, BSD)' + id: cpactions + if: ${{ matrix.platform.cpactions }} + uses: cross-platform-actions/action@v0.29.0 + with: + operating_system: '${{ matrix.platform.cpactions-os }}' + architecture: '${{ matrix.platform.cpactions-arch }}' + version: '${{ matrix.platform.cpactions-version }}' + run: | + ${{ matrix.platform.cpactions-setup-cmd }} + ${{ matrix.platform.cpactions-install-cmd }} + cmake -S . -B build -GNinja \ + ${{ matrix.platform.cmake-toolchain-file != '' && format('-DCMAKE_TOOLCHAIN_FILE={0}', matrix.platform.cmake-toolchain-file) || '' }} \ + -Wdeprecated -Wdev -Werror \ + -DSDL_WERROR=${{ matrix.platform.werror }} \ + -DSDL_DISABLE_INSTALL_DOCS=OFF \ + ${{ matrix.platform.cmake-arguments }} \ + -DSDL_SHARED=${{ matrix.platform.shared }} \ + -DSDL_STATIC=${{ matrix.platform.static }} \ + -DSDL_TEST=ON \ + -DSDL_VENDOR_INFO="Github Workflow" \ + -DCMAKE_INSTALL_PREFIX=prefix \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=${{ matrix.platform.cmake-build-type }} + cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --verbose + + cmake --build build/ --config ${{ matrix.platform.cmake-build-type }} --target clean + rm -rf build/CMakeFiles + rm -rf build/docs + - name: 'Set up Watcom' + uses: open-watcom/setup-watcom@v0 + if: ${{ matrix.platform.watcom-makefile != '' }} + - name: 'Build (Watcom)' + if: ${{ matrix.platform.watcom-makefile != '' }} + run: | + wmake -f ${{ matrix.platform.watcom-makefile }} ENABLE_WERROR=1 + - name: 'Build tests (Watcom)' + if: ${{ matrix.platform.watcom-makefile != '' }} + run: | + cd test + wmake -f ${{ matrix.platform.watcom-makefile }} ENABLE_WERROR=1 + - name: 'Run tests (Watcom)' + if: ${{ matrix.platform.watcom-makefile != '' && matrix.platform.run-tests }} + run: | + cd test + wmake -f ${{ matrix.platform.watcom-makefile }} check-quick + - name: 'Distclean (Watcom)' + if: ${{ matrix.platform.watcom-makefile != '' }} + run: | + wmake -f ${{ matrix.platform.watcom-makefile }} distclean + cd test + wmake -f ${{ matrix.platform.watcom-makefile }} distclean + - name: 'Add msbuild to PATH' + id: setup-msbuild + if: ${{ matrix.platform.msvc-project != '' }} + uses: microsoft/setup-msbuild@v2 + - name: Build msbuild + if: ${{ matrix.platform.msvc-project != '' }} + run: | + "$(cygpath -u '${{ steps.setup-msbuild.outputs.msbuildPath }}\msbuild.exe')" ${{ matrix.platform.msvc-project }} -m -p:BuildInParallel=true -p:Configuration=Release ${{ matrix.platform.msvc-project-flags }} + - name: 'Build (Android.mk)' + if: ${{ matrix.platform.android-mk }} + run: | + ./build-scripts/androidbuildlibs.sh + - name: 'Build (xcode)' + if: ${{ matrix.platform.xcode-sdk != '' }} + run: | + xcodebuild -project Xcode/SDL/SDL.xcodeproj -target "${{ matrix.platform.xcode-target }}" -configuration Release -sdk ${{ matrix.platform.xcode-sdk }} clean build + - name: 'Setup Python' + uses: 'actions/setup-python@main' + if: ${{ matrix.platform.check-sources }} + with: + python-version: '3.x' + - name: 'Check Sources' + if: ${{ matrix.platform.check-sources }} + run: | + set -e + build-scripts/test-versioning.sh + - name: 'Upload binary package' + uses: actions/upload-artifact@v4 + if: ${{ always() && steps.cmake-tests.outcome == 'failure' }} + with: + if-no-files-found: ignore + name: '${{ matrix.platform.artifact }}-minidumps' + path: | + build/**/*.dmp + build/**/*.exe + build/**/*.dll + build/**/*.pdb diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml deleted file mode 100644 index 6034ce071b750..0000000000000 --- a/.github/workflows/ios.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build (iOS/tvOS) - -on: [push, pull_request] - -jobs: - Build: - name: ${{ matrix.platform.name }} - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - platform: - - { name: iOS, target: Static Library-iOS, sdk: iphoneos } - - { name: tvOS, target: Static Library-tvOS, sdk: appletvos } - - steps: - - uses: actions/checkout@v3 - - name: Build - run: xcodebuild -project Xcode/SDL/SDL.xcodeproj -target '${{ matrix.platform.target }}' -configuration Release -sdk ${{ matrix.platform.sdk }} clean build \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index b09ae9447a8e4..0000000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,206 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - Build: - name: ${{ matrix.platform.name }} - runs-on: ${{ matrix.platform.os }} - - defaults: - run: - shell: ${{ matrix.platform.shell }} - - strategy: - fail-fast: false - matrix: - platform: - - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } - - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } - - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 } - - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 } - - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 } - - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh } - - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true } - - { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh } - - { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true } - - { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' } - - { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true } - - steps: - - name: Set up MSYS2 - if: matrix.platform.shell == 'msys2 {0}' - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.platform.msystem }} - install: >- - ${{ matrix.platform.msys-env }}-cc - ${{ matrix.platform.msys-env }}-cmake - ${{ matrix.platform.msys-env }}-ninja - ${{ matrix.platform.msys-env }}-pkg-config - - - name: Setup Linux dependencies - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install build-essential git make autoconf automake libtool \ - pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ - libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ - libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ - libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ - libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev - - - name: Setup extra Ubuntu 22.04 dependencies - if: matrix.platform.os == 'ubuntu-22.04' - run: | - sudo apt-get install libpipewire-0.3-dev libdecor-0-dev - - - name: Setup Macos dependencies - if: runner.os == 'macOS' - run: | - brew install \ - ninja - - uses: actions/checkout@v3 - - name: Check that versioning is consistent - # We only need to run this once: arbitrarily use the Linux/CMake build - if: "runner.os == 'Linux' && ! matrix.platform.autotools" - run: ./build-scripts/test-versioning.sh - - name: Configure (CMake) - if: "! matrix.platform.autotools" - run: | - cmake -S . -B build -G Ninja \ - -DSDL_TESTS=ON \ - -DSDL_WERROR=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DSDL_VENDOR_INFO="Github Workflow" \ - -DCMAKE_INSTALL_PREFIX=cmake_prefix \ - -DCMAKE_BUILD_TYPE=Release \ - ${{ matrix.platform.cmake }} - - name: Build (CMake) - if: "! matrix.platform.autotools" - run: | - cmake --build build/ --config Release --verbose --parallel - - name: Run build-time tests (CMake) - if: "! matrix.platform.autotools" - run: | - set -eu - export SDL_TESTS_QUICK=1 - ctest -VV --test-dir build/ - if test "${{ runner.os }}" = "Linux"; then - # This should show us the SDL_REVISION - strings build/libSDL2-2.0.so.0 | grep SDL- - fi - - name: Install (CMake) - if: "! matrix.platform.autotools" - run: | - set -eu - cmake --install build/ --config Release - echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV - ( cd cmake_prefix; find ) | LC_ALL=C sort -u - - name: Configure (Autotools) - if: matrix.platform.autotools - run: | - set -eu - rm -fr build-autotools - mkdir build-autotools - ./autogen.sh - ( - cd build-autotools - ${{ github.workspace }}/configure \ - --enable-vendor-info="Github Workflow" \ - --enable-werror \ - --prefix=${{ github.workspace }}/autotools_prefix \ - ) - if test "${{ runner.os }}" != "macOS" ; then - curdir="$(pwd)" - multiarch="$(dpkg-architecture -qDEB_HOST_MULTIARCH)" - ( - mkdir -p build-autotools/test - cd build-autotools/test - ${{ github.workspace }}/test/configure \ - --enable-werror \ - --x-includes=/usr/include \ - --x-libraries="/usr/lib/${multiarch}" \ - --prefix=${{ github.workspace }}/autotools_prefix \ - SDL_CFLAGS="-I${curdir}/include" \ - SDL_LIBS="-L${curdir}/build-autotools/build/.libs -lSDL2" \ - ac_cv_lib_SDL2_ttf_TTF_Init=no \ - ${NULL+} - ) - fi - - name: Build (Autotools) - if: matrix.platform.autotools - run: | - set -eu - parallel="$(getconf _NPROCESSORS_ONLN)" - make -j"${parallel}" -C build-autotools V=1 - if test "${{ runner.os }}" != "macOS" ; then - make -j"${parallel}" -C build-autotools/test V=1 - fi - - name: Run build-time tests (Autotools) - if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }} - run: | - set -eu - curdir="$(pwd)" - parallel="$(getconf _NPROCESSORS_ONLN)" - export SDL_TESTS_QUICK=1 - make -j"${parallel}" -C build-autotools/test check LD_LIBRARY_PATH="${curdir}/build-autotools/build/.libs" - if test "${{ runner.os }}" = "Linux"; then - # This should show us the SDL_REVISION - strings "${curdir}/build-autotools/build/.libs/libSDL2-2.0.so.0" | grep SDL- - fi - - name: Install (Autotools) - if: matrix.platform.autotools - run: | - set -eu - curdir="$(pwd)" - parallel="$(getconf _NPROCESSORS_ONLN)" - make -j"${parallel}" -C build-autotools install V=1 - if test "${{ runner.os }}" != "macOS" ; then - make -j"${parallel}" -C build-autotools/test install V=1 - fi - ( cd autotools_prefix; find . ) | LC_ALL=C sort -u - echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} - cmake --build cmake_config_build --verbose - - name: Verify sdl2-config - run: | - export PATH=${{ env.SDL2_DIR }}/bin:$PATH - cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc - run: | - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig - cmake/test/test_pkgconfig.sh - - name: Distcheck (Autotools) - if: matrix.platform.autotools - run: | - set -eu - parallel="$(getconf _NPROCESSORS_ONLN)" - make -j"${parallel}" -C build-autotools dist V=1 - # Similar to Automake `make distcheck`: check that the tarball - # release is sufficient to do a new build - mkdir distcheck - tar -C distcheck -zxf build-autotools/SDL2-*.tar.gz - ( cd distcheck/SDL2-* && ./configure ) - make -j"${parallel}" -C distcheck/SDL2-* - - name: Run installed-tests (Autotools) - if: "runner.os == 'Linux' && matrix.platform.autotools" - run: | - set -eu - parallel="$(getconf _NPROCESSORS_ONLN)" - sudo make -j"${parallel}" -C build-autotools install - sudo make -j"${parallel}" -C build-autotools/test install - export SDL_TESTS_QUICK=1 - # We need to set LD_LIBRARY_PATH because it isn't in the default - # linker search path. We don't need to set XDG_DATA_DIRS for - # ginsttest-runner, because /usr/local/share *is* in the default - # search path for that. - env --chdir=/ \ - LD_LIBRARY_PATH=/usr/local/lib \ - SDL_AUDIODRIVER=dummy \ - SDL_VIDEODRIVER=dummy \ - ginsttest-runner --tap SDL2 diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml deleted file mode 100644 index 78fb73a7c6812..0000000000000 --- a/.github/workflows/msvc.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Build (MSVC) - -on: [push, pull_request] - -jobs: - Build: - name: ${{ matrix.platform.name }} - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - platform: - - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64' } - - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32' } - - { name: Windows static VCRT (x64), flags: -A x64 -DSDL_FORCE_STATIC_VCRT=ON } - - { name: Windows static VCRT (x86), flags: -A Win32 -DSDL_FORCE_STATIC_VCRT=ON } - - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64 } - - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32 } - - { name: Windows (ARM), flags: -A ARM } - - { name: Windows (ARM64), flags: -A ARM64 } - - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF, nowerror: true, - project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0' } - - steps: - - uses: actions/checkout@v3 - - name: Create CMake project using SDL as a subproject - shell: python - run: | - import os - import textwrap - srcdir = r"${{ github.workspace }}".replace("\\", "/") - builddir = f"{ srcdir }/build" - os.makedirs(builddir) - with open(f"{ builddir }/CMakeLists.txt", "w") as f: - f.write(textwrap.dedent(f"""\ - cmake_minimum_required(VERSION 3.0) - project(sdl_user) - add_subdirectory("{ srcdir }" SDL) - """)) - - name: Configure (CMake) - run: cmake -S build -B build ` - -DSDL_WERROR=${{ !matrix.platform.nowerror }} ` - -DSDL_TESTS=ON ` - -DSDL_INSTALL_TESTS=ON ` - -DSDL_VENDOR_INFO="Github Workflow" ` - -DSDL2_DISABLE_INSTALL=OFF ` - ${{ matrix.platform.flags }} ` - -DCMAKE_INSTALL_PREFIX=prefix - - name: Build (CMake) - run: cmake --build build/ --config Release --parallel - - name: Run build-time tests - if: "! contains(matrix.platform.name, 'ARM')" - run: | - $env:SDL_TESTS_QUICK=1 - ctest -VV --test-dir build/ -C Release - - name: Install (CMake) - run: | - echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV - cmake --install build/ - - name: Verify CMake configuration files - if: ${{ !contains(matrix.platform.name, 'UWP') }} # FIXME: cmake/test/CMakeLists.txt should support UWP - run: | - cmake -S cmake/test -B cmake_config_build ` - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} ` - ${{ matrix.platform.flags }} - cmake --build cmake_config_build --config Release - - - name: Add msbuild to PATH - if: ${{ matrix.platform.project != '' }} - uses: microsoft/setup-msbuild@v1.1.3 - - name: Build msbuild - if: ${{ matrix.platform.project != '' }} - run: msbuild ${{ matrix.platform.project }} /m /p:BuildInParallel=true /p:Configuration=Release ${{ matrix.platform.projectflags }} diff --git a/.github/workflows/n3ds.yml b/.github/workflows/n3ds.yml deleted file mode 100644 index f35577e669dba..0000000000000 --- a/.github/workflows/n3ds.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build (Nintendo 3DS) - -on: [push, pull_request] - -jobs: - n3ds: - runs-on: ubuntu-latest - container: - image: devkitpro/devkitarm:latest - steps: - - uses: actions/checkout@v3 - - name: Install build requirements - run: | - apt update - apt install ninja-build - - name: Configure CMake - run: | - cmake -S . -B build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ - -DSDL_WERROR=ON \ - -DSDL_TESTS=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DSDL_VENDOR_INFO="Github Workflow" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=prefix - - name: Build - run: cmake --build build --verbose - - name: Install CMake - run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV - cmake --install build/ - ( cd prefix; find ) | LC_ALL=C sort -u - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake \ - -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ - -DCMAKE_BUILD_TYPE=Release - cmake --build cmake_config_build --verbose - # Not running test_pkgconfig.sh and test_sdlconfig.sh - # as invoking the compiler manually is not supported diff --git a/.github/workflows/ps2.yaml b/.github/workflows/ps2.yaml deleted file mode 100644 index bfb0b1ceb38f8..0000000000000 --- a/.github/workflows/ps2.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: Build (Sony Playstation 2) - -on: [push, pull_request] - -jobs: - ps2: - runs-on: ubuntu-latest - container: ps2dev/ps2dev:latest - steps: - - uses: actions/checkout@v3 - - name: Setup dependencies - run: | - apk update - apk add cmake gmp mpc1 mpfr4 ninja pkgconf make git - - # To be removed once ps2_drivers is part of PS2DEV - - name: Install ps2_drivers lib - run: | - git clone https://github.com/fjtrujy/ps2_drivers.git - cd ps2_drivers - make -j $(getconf _NPROCESSORS_ONLN) clean - make -j $(getconf _NPROCESSORS_ONLN) - make -j $(getconf _NPROCESSORS_ONLN) install - - - name: Configure (CMake) - run: | - cmake -S . -B build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \ - -DSDL_WERROR=ON \ - -DSDL_TESTS=ON \ - -DCMAKE_INSTALL_PREFIX=cmake_prefix \ - -DCMAKE_BUILD_TYPE=Release - - name: Build - run: cmake --build build --config Release --verbose --parallel - - name: Install (CMake) - run: | - set -eu - cmake --install build/ --config Release - echo "SDL2_DIR=$(pwd)/cmake_prefix" >> $GITHUB_ENV - ( cd cmake_prefix; find ) | LC_ALL=C sort -u - - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake \ - -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ - -DCMAKE_BUILD_TYPE=Release - cmake --build cmake_config_build --verbose - - name: Verify sdl2-config - run: | - export CC=mips64r5900el-ps2-elf-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH - export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" - cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc - run: | - export CC=mips64r5900el-ps2-elf-gcc - export EXTRA_LDFLAGS="-L$PS2DEV/ps2sdk/ee/lib -L$PS2DEV/gsKit/lib -L$PS2DEV/ps2sdk/ports/lib" - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig - cmake/test/test_pkgconfig.sh - - - name: Get short SHA - id: slug - run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" - - - name: Upload artifacts - if: ${{ success() }} - uses: actions/upload-artifact@v3 - with: - name: tests-${{ steps.slug.outputs.sha8 }} - path: | - build/test diff --git a/.github/workflows/psp.yaml b/.github/workflows/psp.yaml deleted file mode 100644 index addc7b11fc26d..0000000000000 --- a/.github/workflows/psp.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build (Sony Playstation Portable) - -on: [push, pull_request] - -jobs: - psp: - runs-on: ubuntu-latest - container: pspdev/pspdev:latest - steps: - - uses: actions/checkout@v3 - - name: Setup dependencies - run: | - apk update - apk add cmake gmp mpc1 mpfr4 make pkgconf - - name: Configure CMake - run: | - cmake -S . -B build \ - -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \ - -DSDL_WERROR=ON \ - -DSDL_TESTS=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=prefix - - name: Build - run: cmake --build build --config Release - - name: Install - run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV - cmake --install build --config Release - ( cd prefix; find ) | LC_ALL=C sort -u - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build \ - -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ - -DTEST_SHARED=FALSE \ - -DCMAKE_BUILD_TYPE=Release - cmake --build cmake_config_build --verbose - - name: Verify sdl2-config - run: | - export CC=psp-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH - export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" - cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc - run: | - export CC=psp-gcc - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig - export EXTRA_LDFLAGS="-L$PSPDEV/lib -L$PSPDEV/psp/lib -L$PSPDEV/psp/sdk/lib" - cmake/test/test_pkgconfig.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000000..42fb0ee5c1af3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,403 @@ +name: 'release' +run-name: 'Create SDL release artifacts for ${{ inputs.commit }}' + +on: + workflow_dispatch: + inputs: + commit: + description: 'Commit of SDL' + required: true + +jobs: + + src: + runs-on: ubuntu-latest + outputs: + project: ${{ steps.releaser.outputs.project }} + version: ${{ steps.releaser.outputs.version }} + src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }} + src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }} + src-zip: ${{ steps.releaser.outputs.src-zip }} + steps: + - name: 'Set up Python' + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: 'Fetch build-release.py' + uses: actions/checkout@v4 + with: + sparse-checkout: 'build-scripts/build-release.py' + - name: 'Set up SDL sources' + uses: actions/checkout@v4 + with: + path: 'SDL' + fetch-depth: 0 + - name: 'Build Source archive' + id: releaser + shell: bash + run: | + python build-scripts/build-release.py \ + --actions source \ + --commit ${{ inputs.commit }} \ + --root "${{ github.workspace }}/SDL" \ + --github \ + --debug + - name: 'Store source archives' + uses: actions/upload-artifact@v4 + with: + name: sources + path: '${{ github.workspace}}/dist' + + linux-verify: + needs: [src] + runs-on: ubuntu-latest + steps: + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Unzip ${{ needs.src.outputs.src-zip }}' + id: zip + run: | + mkdir /tmp/zipdir + cd /tmp/zipdir + unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}" + echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: tar + run: | + mkdir -p /tmp/tardir + tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Compare contents of ${{ needs.src.outputs.src-zip }} and ${{ needs.src.outputs.src-tar-gz }}' + run: | + diff /tmp/zipdir /tmp/tardir + - name: 'Test versioning' + shell: bash + run: | + ${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh + - name: 'CMake (configure + build + tests + examples)' + run: | + cmake -S ${{ steps.tar.outputs.path }} -B /tmp/build -DSDL_TEST_LIBRARY=TRUE -DSDL_TESTS=TRUE -DSDL_EXAMPLES=TRUE + cmake --build /tmp/build --verbose + ctest --test-dir /tmp/build --no-tests=error --output-on-failure + + dmg: + needs: [src] + runs-on: macos-latest + outputs: + dmg: ${{ steps.releaser.outputs.dmg }} + steps: + - name: 'Set up Python' + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: 'Fetch build-release.py' + uses: actions/checkout@v4 + with: + sparse-checkout: 'build-scripts/build-release.py' + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: tar + run: | + mkdir -p "${{ github.workspace }}/tardir" + tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Build SDL2.dmg' + id: releaser + shell: bash + run: | + python build-scripts/build-release.py \ + --actions dmg \ + --commit ${{ inputs.commit }} \ + --root "${{ steps.tar.outputs.path }}" \ + --github \ + --debug + - name: 'Store DMG image file' + uses: actions/upload-artifact@v4 + with: + name: dmg + path: '${{ github.workspace }}/dist' + + dmg-verify: + needs: [dmg, src] + runs-on: macos-latest + steps: + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Download ${{ needs.dmg.outputs.dmg }}' + uses: actions/download-artifact@v4 + with: + name: dmg + path: '${{ github.workspace }}' + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: src + run: | + mkdir -p /tmp/tardir + tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Mount ${{ needs.dmg.outputs.dmg }}' + id: mount + run: | + hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}' + mount_point="/Volumes/${{ needs.src.outputs.project }}" + if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.framework" ]; then + echo "Cannot find ${{ needs.src.outputs.project }}.framework!" + exit 1 + fi + echo "mount_point=$mount_point">>$GITHUB_OUTPUT + - name: 'CMake (configure + build) Darwin' + run: | + set -e + cmake -S "${{ steps.src.outputs.path }}/cmake/test" \ + -DTEST_FULL=FALSE \ + -DTEST_STATIC=FALSE \ + -DTEST_TEST=FALSE \ + -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \ + -DCMAKE_SYSTEM_NAME=Darwin \ + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ + -Werror=dev \ + -B build_darwin + cmake --build build_darwin --config Release --verbose + + cmake -S "${{ steps.src.outputs.path }}/cmake/test" \ + -DTEST_FULL=FALSE \ + -DTEST_STATIC=FALSE \ + -DTEST_TEST=FALSE \ + -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount_point }}" \ + -DCMAKE_SYSTEM_NAME=Darwin \ + -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ + -Werror=dev \ + -B build_darwin_2 + cmake --build build_darwin --config Release --verbose + + msvc: + needs: [src] + runs-on: windows-2025 + outputs: + VC-x86: ${{ steps.releaser.outputs.VC-x86 }} + VC-x64: ${{ steps.releaser.outputs.VC-x64 }} + VC-devel: ${{ steps.releaser.outputs.VC-devel }} + steps: + - name: 'Set up Python' + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: 'Fetch build-release.py' + uses: actions/checkout@v4 + with: + sparse-checkout: 'build-scripts/build-release.py' + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Unzip ${{ needs.src.outputs.src-zip }}' + id: zip + run: | + New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue + cd C:\temp + unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}" + echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT + - name: 'Build MSVC binary archives' + id: releaser + run: | + python build-scripts/build-release.py ` + --actions msvc ` + --commit ${{ inputs.commit }} ` + --root "${{ steps.zip.outputs.path }}" ` + --github ` + --debug + - name: 'Store MSVC archives' + uses: actions/upload-artifact@v4 + with: + name: win32 + path: '${{ github.workspace }}/dist' + + msvc-verify: + needs: [msvc, src] + runs-on: windows-latest + steps: + - name: 'Fetch .github/actions/setup-ninja/action.yml' + uses: actions/checkout@v4 + with: + sparse-checkout: '.github/actions/setup-ninja/action.yml' + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Download MSVC binaries' + uses: actions/download-artifact@v4 + with: + name: win32 + path: '${{ github.workspace }}' + - name: 'Unzip ${{ needs.src.outputs.src-zip }}' + id: src + run: | + mkdir '${{ github.workspace }}/sources' + cd '${{ github.workspace }}/sources' + unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}" + echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT + - name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}' + id: bin + run: | + mkdir '${{ github.workspace }}/vc' + cd '${{ github.workspace }}/vc' + unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}" + echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT + - name: Set up ninja + uses: ./.github/actions/setup-ninja + - name: 'Configure vcvars x86' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64_x86 + - name: 'CMake (configure + build + tests) x86' + run: | + cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_x86 ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` + -DTEST_FULL=FALSE ` + -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` + -DTEST_TEST=TRUE ` + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 + cmake --build build_x86 --config Release --verbose + #ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure + - name: 'Configure vcvars x64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + - name: 'CMake (configure + build + tests) x64' + run: | + cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_x64 ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` + -DTEST_FULL=FALSE ` + -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` + -DTEST_TEST=TRUE ` + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 + cmake --build build_x64 --config Release --verbose + #ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure + + mingw: + needs: [src] + runs-on: ubuntu-24.04 # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default + outputs: + mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }} + mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }} + steps: + - name: 'Set up Python' + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: 'Fetch build-release.py' + uses: actions/checkout@v4 + with: + sparse-checkout: 'build-scripts/build-release.py' + - name: 'Install Mingw toolchain' + run: | + sudo apt-get update -y + sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: tar + run: | + mkdir -p /tmp/tardir + tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Build MinGW binary archives' + id: releaser + run: | + python build-scripts/build-release.py \ + --actions mingw \ + --commit ${{ inputs.commit }} \ + --root "${{ steps.tar.outputs.path }}" \ + --github \ + --debug + - name: 'Store MinGW archives' + uses: actions/upload-artifact@v4 + with: + name: mingw + path: '${{ github.workspace }}/dist' + + mingw-verify: + needs: [mingw, src] + runs-on: ubuntu-latest + steps: + - name: 'Install Mingw toolchain' + run: | + sudo apt-get update -y + sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Download MinGW binaries' + uses: actions/download-artifact@v4 + with: + name: mingw + path: '${{ github.workspace }}' + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: src + run: | + mkdir -p /tmp/tardir + tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Untar and install ${{ needs.mingw.outputs.mingw-devel-tar-gz }}' + id: bin + run: | + mkdir -p /tmp/mingw-tardir + tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}" + make -C /tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }} cross CROSS_PATH=/tmp/deps-mingw + echo "path=/tmp/deps-mingw" >>$GITHUB_OUTPUT + - name: 'CMake (configure + build) i686' + run: | + set -e + cmake -S "${{ steps.src.outputs.path }}/cmake/test" \ + -DCMAKE_BUILD_TYPE="Release" \ + -DTEST_FULL=FALSE \ + -DTEST_STATIC=TRUE \ + -DTEST_TEST=TRUE \ + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \ + -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \ + -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \ + -Werror=dev \ + -B build_x86 + cmake --build build_x86 --config Release --verbose + - name: 'CMake (configure + build) x86_64' + run: | + set -e + cmake -S "${{ steps.src.outputs.path }}/cmake/test" \ + -DCMAKE_BUILD_TYPE="Release" \ + -DTEST_FULL=FALSE \ + -DTEST_STATIC=TRUE \ + -DTEST_TEST=TRUE \ + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" \ + -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \ + -DCMAKE_C_FLAGS="-DSDL_DISABLE_SSE4_2" \ + -Werror=dev \ + -B build_x64 + cmake --build build_x64 --config Release --verbose diff --git a/.github/workflows/riscos.yml b/.github/workflows/riscos.yml deleted file mode 100644 index 1fec840664fbd..0000000000000 --- a/.github/workflows/riscos.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Build (RISC OS) - -on: [push, pull_request] - -jobs: - Build: - name: ${{ matrix.platform.name }} - runs-on: ubuntu-latest - container: riscosdotinfo/riscos-gccsdk-4.7:latest - - strategy: - fail-fast: false - matrix: - platform: - - { name: autotools, test_args: '-DTEST_SHARED=FALSE' } # FIXME: autotools should build and install shared libraries - - { name: CMake } - - steps: - - name: Setup dependencies - run: apt-get update && apt-get install -y cmake ninja-build - - uses: actions/checkout@v3 - - name: Configure (autotools) - if: ${{ contains(matrix.platform.name, 'autotools') }} - run: | - mkdir build_autotools - cd build_autotools - ../configure \ - --host=arm-unknown-riscos \ - --disable-gcc-atomics \ - --prefix=${{ github.workspace }}/prefix_autotools - - name: Build (autotools) - if: ${{ contains(matrix.platform.name, 'autotools') }} - run: make -C build_autotools -j`nproc` V=1 - - name: Install (autotools) - if: ${{ contains(matrix.platform.name, 'autotools') }} - run: | - echo "SDL2_DIR=${{ github.workspace }}/prefix_autotools" >> $GITHUB_ENV - make -C build_autotools install - ( cd ${{ github.workspace }}/prefix_autotools; find ) | LC_ALL=C sort -u - - name: Configure (CMake) - if: ${{ contains(matrix.platform.name, 'CMake') }} - run: | - cmake -S . -B build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \ - -DRISCOS=ON \ - -DSDL_GCC_ATOMICS=OFF \ - -DSDL_TESTS=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DSDL_VENDOR_INFO="Github Workflow" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/prefix_cmake - - name: Build (CMake) - if: ${{ contains(matrix.platform.name, 'CMake') }} - run: cmake --build build --verbose - - name: Install (CMake) - if: ${{ contains(matrix.platform.name, 'CMake') }} - run: | - echo "SDL2_DIR=${{ github.workspace }}/prefix_cmake" >> $GITHUB_ENV - cmake --install build/ - ( cd ${{ github.workspace }}/prefix_cmake; find ) | LC_ALL=C sort -u - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ - -DCMAKE_BUILD_TYPE=Release \ - ${{ matrix.platform.test_args }} - cmake --build cmake_config_build --verbose diff --git a/.github/workflows/vita.yaml b/.github/workflows/vita.yaml deleted file mode 100644 index ac3b17c43515a..0000000000000 --- a/.github/workflows/vita.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build (Sony Playstation Vita) - -on: [push, pull_request] - -defaults: - run: - shell: sh - -jobs: - vita: - runs-on: ubuntu-latest - container: - image: vitasdk/vitasdk:latest - steps: - - uses: actions/checkout@v3 - - name: Install build requirements - run: | - apk update - apk add cmake ninja pkgconf bash - - name: Configure CMake - run: | - cmake -S . -B build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \ - -DSDL_WERROR=ON \ - -DSDL_TESTS=ON \ - -DSDL_INSTALL_TESTS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=prefix - - name: Build - run: cmake --build build --verbose - - name: Install CMake - run: | - echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV - cmake --install build/ - ( cd prefix; find ) | LC_ALL=C sort -u - - name: Verify CMake configuration files - run: | - cmake -S cmake/test -B cmake_config_build -G Ninja \ - -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \ - -DTEST_SHARED=FALSE \ - -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} \ - -DCMAKE_BUILD_TYPE=Release - cmake --build cmake_config_build --verbose - - name: Verify sdl2-config - run: | - export CC=arm-vita-eabi-gcc - export PATH=${{ env.SDL2_DIR }}/bin:$PATH - cmake/test/test_sdlconfig.sh - - name: Verify sdl2.pc - run: | - export CC=arm-vita-eabi-gcc - export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig - cmake/test/test_pkgconfig.sh diff --git a/.github/workflows/vmactions.yml b/.github/workflows/vmactions.yml deleted file mode 100644 index 4485f5c59d96f..0000000000000 --- a/.github/workflows/vmactions.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build (VM Actions) - -on: [push, pull_request] - -jobs: - freebsd: - runs-on: macos-12 - name: FreeBSD - steps: - - uses: actions/checkout@v3 - - name: Build - uses: vmactions/freebsd-vm@v0 - with: - usesh: true - prepare: | - pkg install -y \ - gmake \ - pkgconf \ - libXcursor \ - libXext \ - libXinerama \ - libXi \ - libXfixes \ - libXrandr \ - libXScrnSaver \ - libXxf86vm \ - wayland \ - wayland-protocols \ - libxkbcommon \ - mesa-libs \ - libglvnd \ - evdev-proto \ - libinotify \ - alsa-lib \ - jackit \ - nas \ - pipewire \ - pulseaudio \ - sndio \ - dbus \ - zh-fcitx \ - ibus \ - libsamplerate \ - libudev-devd - - run: | - mkdir build_autotools - (cd build_autotools && CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ../configure) - gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1 diff --git a/.github/workflows/watcom.yml b/.github/workflows/watcom.yml deleted file mode 100644 index bef3cf957239f..0000000000000 --- a/.github/workflows/watcom.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build (OpenWatcom) - -on: [push, pull_request] - -jobs: - os2: - name: ${{ matrix.platform.name }} - runs-on: windows-latest - - strategy: - matrix: - platform: - - { name: Windows, makefile: Makefile.w32 } - - { name: OS/2, makefile: Makefile.os2 } - - steps: - - uses: actions/checkout@v3 - - uses: open-watcom/setup-watcom@v0 - - name: Build SDL2 - run: | - wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 - - name: Build tests - run: | - cd test && wmake -f ${{ matrix.platform.makefile }} ENABLE_WERROR=1 - cd .. - - name: Run tests - if: "matrix.platform.makefile == 'Makefile.w32'" - run: | - cd test && wmake -f ${{ matrix.platform.makefile }} check-quick - cd .. - - name: distclean - run: | - wmake -f ${{ matrix.platform.makefile }} distclean - cd test && wmake -f ${{ matrix.platform.makefile }} distclean - cd .. diff --git a/.gitignore b/.gitignore index a746abbc16217..f53f91c3b9231 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,8 @@ build gen Build buildbot -/VERSION.txt +/REVISION.txt +dist *.so *.so.* @@ -62,6 +63,11 @@ cmake-build-* xcuserdata *.xcworkspace +# for QtCreator +CMakeLists.txt.user +build*/ +*.pro.user* + # for Visual C++ .vs Debug @@ -98,6 +104,7 @@ VisualC/visualtest/testsprite2_sample.actions VisualC/visualtest/testsprite2_sample.config VisualC/visualtest/testsprite2_sample.parameters VisualC-GDK/**/Layout +VisualC-GDK/shaders/*.h # for Android android-project/local.properties @@ -173,6 +180,7 @@ test/testyuv test/torturethread builddir/ +!build-scripts/ debian/*.debhelper.log debian/*.substvars debian/*.tar.gz diff --git a/.wikiheaders-options b/.wikiheaders-options index 31ccd43353675..d10cd3c9bc7cc 100644 --- a/.wikiheaders-options +++ b/.wikiheaders-options @@ -1,8 +1,9 @@ -projectfullname = SDL_mixer -projectshortname = SDL_mixer +projectfullname = Simple Directmedia Layer +projectshortname = SDL incsubdir = include -wikisubdir = -apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_) +wikisubdir = SDL2 +readmesubdir = docs +apiprefixregex = (SDL_|SDLK_|KMOD_|AUDIO_|[US]int\d+) mainincludefname = SDL.h versionfname = include/SDL_version.h versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z @@ -10,6 +11,22 @@ versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z versionpatchregex = \A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z selectheaderregex = \ASDL.*?\.h\Z projecturl = https://libsdl.org/ -wikiurl = https://wiki.libsdl.org +wikiurl = https://wiki.libsdl.org/SDL2 bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new warn_about_missing = 0 +#wikipreamble = (This is the legacy documentation for SDL2, the previous stable version; [SDL3](https://wiki.libsdl.org/SDL3/) is the current stable version.) +wikiheaderfiletext = Defined in [%fname%](https://github.com/libsdl-org/SDL/blob/SDL2/include/%fname%) +manpageheaderfiletext = Defined in %fname% + +# All SDL_config_*.h headers are uncategorized, in case something slips in from them. +# All SDL_test_* headers become uncategorized, everything else just converts like SDL_audio.h -> Audio +# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments. +headercategoryeval = s/\ASDL_config_.*?\.h\Z//; s/\ASDL_test_.*?\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst(); + +# !!! FIXME: maybe later, but there are probably documentation gaps to fix first. +quickrefenabled = 0 +quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gesture,GameController,Joystick,Haptic,Audio,Timer,Render,LoadSO,Thread,Mutex,Atomic,Filesystem,RWOPS,Pixels,Surface,Blendmode,Rect,Clipboard,Messagebox,Vulkan,Metal,Platform,Power,Sensor,Bits,Endian,Assert,CPUInfo,Locale,System,Misc,GUID,Main,Stdinc +quickreftitle = SDL2 API Quick Reference +quickrefurl = https://libsdl.org/ +quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL2/QuickReference +quickrefmacroregex = \A(SDL_Atomic...Ref|SDL_assert.*?|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast|SDL_Load...)\Z diff --git a/Android.mk b/Android.mk index 06146cd40cd0d..3ccbd44ca1dd7 100644 --- a/Android.mk +++ b/Android.mk @@ -12,7 +12,7 @@ LOCAL_MODULE := SDL2 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)/include +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) LOCAL_SRC_FILES := \ $(subst $(LOCAL_PATH)/,, \ @@ -35,6 +35,7 @@ LOCAL_SRC_FILES := \ $(wildcard $(LOCAL_PATH)/src/hidapi/android/*.cpp) \ $(wildcard $(LOCAL_PATH)/src/joystick/*.c) \ $(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \ + $(wildcard $(LOCAL_PATH)/src/joystick/dummy/*.c) \ $(wildcard $(LOCAL_PATH)/src/joystick/hidapi/*.c) \ $(wildcard $(LOCAL_PATH)/src/joystick/virtual/*.c) \ $(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \ @@ -63,7 +64,6 @@ LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES LOCAL_CFLAGS += \ -Wall -Wextra \ -Wdocumentation \ - -Wdocumentation-unknown-command \ -Wmissing-prototypes \ -Wunreachable-code-break \ -Wunneeded-internal-declaration \ @@ -78,6 +78,8 @@ LOCAL_CFLAGS += \ # Warnings we haven't fixed (yet) LOCAL_CFLAGS += -Wno-unused-parameter -Wno-sign-compare +LOCAL_CXXFLAGS += -std=gnu++11 + LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid LOCAL_LDFLAGS := -Wl,--no-undefined diff --git a/CMakeLists.txt b/CMakeLists.txt index 021b66cd57311..d609224783019 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,11 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there") endif() -cmake_minimum_required(VERSION 3.0.0) -project(SDL2 C CXX) +# MSVC runtime library flags are selected by an abstraction. +set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) + +cmake_minimum_required(VERSION 3.0.0...3.10) +project(SDL2 C) if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) set(SDL2_SUBPROJECT OFF) @@ -12,12 +15,17 @@ else() endif() if (HAIKU) + enable_language(CXX) set(LINKER_LANGUAGE CXX) endif() set(EXTRA_LIBS) set(EXTRA_LDFLAGS) +set(CMAKE_LIBS) +set(PKGCONFIG_LDFLAGS) +set(PKGCONFIG_DEPENDS) + # This is a virtual "library" that just exists to collect up compiler and # linker options that used to be global to this CMake project. When you # specify it as part of a real library's target_link_libraries(), that @@ -27,14 +35,8 @@ set(EXTRA_LDFLAGS) add_library(sdl-build-options INTERFACE) if(WINDOWS_STORE) - cmake_minimum_required(VERSION 3.11.0) - target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1") - target_compile_options(sdl-build-options INTERFACE "-ZW") -endif() - -# Build in parallel under Visual Studio. Not enabled by default. -if(MSVC) - target_compile_options(sdl-build-options INTERFACE "/MP") + target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP") + target_compile_options(sdl-build-options INTERFACE "$<$:-ZW>" "$<$:-EHsc>") endif() # CMake 3.0 expands the "if(${A})" in "set(OFF 1);set(A OFF);if(${A})" to "if(1)" @@ -74,6 +76,7 @@ find_package(PkgConfig) list(APPEND CMAKE_MODULE_PATH "${SDL2_SOURCE_DIR}/cmake") include(${SDL2_SOURCE_DIR}/cmake/macros.cmake) include(${SDL2_SOURCE_DIR}/cmake/sdlchecks.cmake) +include(${SDL2_SOURCE_DIR}/cmake/sdlplatform.cmake) include(${SDL2_SOURCE_DIR}/cmake/CheckCPUArchitecture.cmake) # Enable large file support on 32-bit glibc, so that we can access files @@ -85,7 +88,7 @@ endif() # See docs/release_checklist.md set(SDL_MAJOR_VERSION 2) -set(SDL_MINOR_VERSION 26) +set(SDL_MINOR_VERSION 33) set(SDL_MICRO_VERSION 0) set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}") @@ -135,8 +138,13 @@ set(SDL_GENERATED_HEADERS) #message(STATUS "${LT_VERSION} :: ${LT_AGE} :: ${LT_REVISION} :: ${LT_CURRENT} :: ${LT_RELEASE}") -# General settings & flags -set(LIBRARY_OUTPUT_DIRECTORY "build") +check_cpu_architecture(x86 SDL_CPU_X86) +check_cpu_architecture(x64 SDL_CPU_X64) +check_cpu_architecture(arm32 SDL_CPU_ARM32) +check_cpu_architecture(arm64 SDL_CPU_ARM64) +check_cpu_architecture(arm64ec SDL_CPU_ARM64EC) +check_cpu_architecture(loongarch64 SDL_CPU_LOONGARCH64) + # Check for 64 or 32 bit set(SIZEOF_VOIDP ${CMAKE_SIZEOF_VOID_P}) if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -152,56 +160,7 @@ if(NOT LIBTYPE) endif() # Get the platform -if(WIN32) - if(NOT WINDOWS) - set(WINDOWS TRUE) - endif() -elseif(UNIX AND NOT APPLE) - if(CMAKE_SYSTEM_NAME MATCHES ".*Linux") - set(LINUX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") - set(FREEBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") - set(NETBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") - set(OPENBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*") - set(GNU TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") - set(BSDI TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") - set(FREEBSD TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*") - set(SYSV5 TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*") - set(SOLARIS TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*") - set(HPUX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*") - set(AIX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*") - set(MINIX TRUE) - endif() -elseif(APPLE) - if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*") - set(DARWIN TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*") - set(MACOSX TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*") - set(TVOS TRUE) - elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*") - # !!! FIXME: remove the version check when we start requiring >= 3.14.0 - if(CMAKE_VERSION VERSION_LESS 3.14) - set(IOS TRUE) - endif() - endif() -elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") - message_error("BeOS support has been removed as of SDL 2.0.2.") -elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*") - set(HAIKU TRUE) -elseif(NINTENDO_3DS) - set(N3DS TRUE) -endif() +SDL_DetectCMakePlatform() # Don't mistake osx for unix if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT RISCOS) @@ -239,7 +198,7 @@ endif() # so we'll just use libusb when it's available. libusb does not support iOS, # so we default to yes on iOS. # TODO: Windows can support libusb, the hid.c file just depends on Unix APIs -if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR ANDROID) +if((WINDOWS AND NOT WINDOWS_STORE) OR IOS OR TVOS OR VISIONOS OR WATCHOS OR ANDROID) set(HIDAPI_SKIP_LIBUSB TRUE) else() set(HIDAPI_SKIP_LIBUSB FALSE) @@ -254,7 +213,7 @@ else() endif() # Compiler info -if(CMAKE_C_COMPILER_ID MATCHES "Clang") +if(CMAKE_C_COMPILER_ID MATCHES "Clang|IntelLLVM") set(USE_CLANG TRUE) set(OPT_DEF_ASM TRUE) # Visual Studio 2019 v16.2 added support for Clang/LLVM. @@ -268,23 +227,28 @@ elseif(CMAKE_COMPILER_IS_GNUCC) elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+ set(OPT_DEF_ASM TRUE) #set(CMAKE_C_FLAGS "/ZI /WX- / +elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$") + set(OPT_DEF_ASM TRUE) + set(USE_INTELCC TRUE) +elseif(CMAKE_C_COMPILER_ID MATCHES "QCC") + set(USE_QCC TRUE) else() set(OPT_DEF_ASM FALSE) endif() -if(USE_GCC OR USE_CLANG) +if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC) set(OPT_DEF_GCC_ATOMICS ON) endif() # Default option knobs -if(APPLE OR ARCH_64 OR MSVC_CLANG) - if(NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm") - set(OPT_DEF_SSEMATH ON) - endif() -endif() -if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS) +if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA OR PSP OR PS2 OR N3DS OR SDL_CPU_ARM64EC) set(OPT_DEF_LIBC ON) endif() +if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS) + set(SDL_SYSTEM_ICONV_DEFAULT OFF) +else() + set(SDL_SYSTEM_ICONV_DEFAULT ON) +endif() if(NOT ("$ENV{CFLAGS}" STREQUAL "")) if(CMAKE_VERSION VERSION_LESS 3.11.0) @@ -294,9 +258,17 @@ if(NOT ("$ENV{CFLAGS}" STREQUAL "")) endif() endif() +# Build in parallel under Visual Studio. Not enabled by default. +if(MSVC AND NOT USE_CLANG) + target_compile_options(sdl-build-options INTERFACE "/MP") +endif() + if(MSVC) option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF) if(SDL_FORCE_STATIC_VCRT) + if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + endif() foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) @@ -336,6 +308,8 @@ if(WINDOWS) set(CMAKE_SHARED_LIBRARY_PREFIX "") endif() +set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_GNU_SOURCE=1") + # Emscripten toolchain has a nonempty default value for this, and the checks # in this file need to change that, so remember the original value, and # restore back to that afterwards. For check_function_exists() to work in @@ -369,7 +343,6 @@ endif() # All these ENABLED_BY_DEFAULT vars will default to ON if not specified, so # you only need to have a platform override them if they are disabling. -set(OPT_DEF_ASM TRUE) if(EMSCRIPTEN) # Set up default values for the currently supported set of subsystems: # Emscripten/Javascript does not have assembly support, a dynamic library @@ -390,6 +363,11 @@ if(VITA OR PSP OR PS2 OR N3DS) set(SDL_LOADSO_ENABLED_BY_DEFAULT OFF) endif() +set(SDL_X11_XRANDR_DEFAULT ON) +if(SOLARIS) + set(SDL_X11_XRANDR_DEFAULT OFF) +endif() + # When defined, respect CMake's BUILD_SHARED_LIBS setting: set(SDL_STATIC_ENABLED_BY_DEFAULT ON) if (NOT DEFINED SDL_SHARED_ENABLED_BY_DEFAULT) @@ -433,18 +411,21 @@ set_option(SDL2_DISABLE_UNINSTALL "Disable uninstallation of SDL2" OFF) option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto") #set_option(SDL_DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON) +set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM}) +dep_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_SSE "Use SSE assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_SSE2 "Use SSE2 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_SSE3 "Use SSE3 assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" OFF "SDL_ASSEMBLY;SDL_CPU_X86 OR SDL_CPU_X64" OFF) +dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY" OFF) +dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF) +dep_option(SDL_ARMNEON "Use NEON assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF) +dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF) +dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF) + set_option(SDL_LIBC "Use the system C library" ${OPT_DEF_LIBC}) set_option(SDL_GCC_ATOMICS "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS}) -set_option(SDL_ASSEMBLY "Enable assembly routines" ${OPT_DEF_ASM}) -set_option(SDL_SSEMATH "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH}) -set_option(SDL_MMX "Use MMX assembly routines" ${OPT_DEF_ASM}) -set_option(SDL_3DNOW "Use 3Dnow! MMX assembly routines" ${OPT_DEF_ASM}) -set_option(SDL_SSE "Use SSE assembly routines" ${OPT_DEF_ASM}) -set_option(SDL_SSE2 "Use SSE2 assembly routines" ${OPT_DEF_SSEMATH}) -set_option(SDL_SSE3 "Use SSE3 assembly routines" ${OPT_DEF_SSEMATH}) -set_option(SDL_ALTIVEC "Use Altivec assembly routines" ${OPT_DEF_ASM}) -set_option(SDL_ARMSIMD "use SIMD assembly blitters on ARM" OFF) -set_option(SDL_ARMNEON "use NEON assembly blitters on ARM" OFF) dep_option(SDL_DBUS "Enable D-Bus support" ON ${UNIX_SYS} OFF) set_option(SDL_DISKAUDIO "Support the disk writer audio driver" ON) set_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON) @@ -452,7 +433,8 @@ set_option(SDL_DIRECTFB "Use DirectFB video driver" OFF) dep_option(SDL_DIRECTFB_SHARED "Dynamically load directfb support" ON "SDL_DIRECTFB" OFF) set_option(SDL_DUMMYVIDEO "Use dummy video driver" ON) dep_option(SDL_IBUS "Enable IBus support" ON ${UNIX_SYS} OFF) -set_option(SDL_SYSTEM_ICONV "Use iconv() from system-installed libraries" ON) +set_option(SDL_SYSTEM_ICONV "Use iconv() from system-installed libraries" ${SDL_SYSTEM_ICONV_DEFAULT}) +set_option(SDL_LIBICONV "Prefer iconv() from libiconv, if available, over libc version" OFF) set_option(SDL_OPENGL "Include OpenGL support" ON) set_option(SDL_OPENGLES "Include OpenGL ES support" ON) set_option(SDL_PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_ENABLED_BY_DEFAULT}) @@ -482,17 +464,19 @@ set_option(SDL_RPATH "Use an rpath when linking SDL" ${UNIX_SYS}) set_option(SDL_CLOCK_GETTIME "Use clock_gettime() instead of gettimeofday()" ${SDL_CLOCK_GETTIME_ENABLED_BY_DEFAULT}) set_option(SDL_X11 "Use X11 video driver" ${UNIX_SYS}) dep_option(SDL_X11_SHARED "Dynamically load X11 support" ON "SDL_X11" OFF) -set(SDL_X11_OPTIONS Xcursor Xdbe XInput Xfixes Xrandr Xscrnsaver XShape) -foreach(_SUB ${SDL_X11_OPTIONS}) - string(TOUPPER "SDL_X11_${_SUB}" _OPT) - dep_option(${_OPT} "Enable ${_SUB} support" ON "SDL_X11" OFF) -endforeach() +dep_option(SDL_X11_XCURSOR "Enable Xcursor support" ON SDL_X11 OFF) +dep_option(SDL_X11_XDBE "Enable Xdbe support" ON SDL_X11 OFF) +dep_option(SDL_X11_XINPUT "Enable XInput support" ON SDL_X11 OFF) +dep_option(SDL_X11_XFIXES "Enable Xfixes support" ON SDL_X11 OFF) +dep_option(SDL_X11_XRANDR "Enable Xrandr support" "${SDL_X11_XRANDR_DEFAULT}" SDL_X11 OFF) +dep_option(SDL_X11_XSCRNSAVER "Enable Xscrnsaver support" ON SDL_X11 OFF) +dep_option(SDL_X11_XSHAPE "Enable XShape support" ON SDL_X11 OFF) set_option(SDL_WAYLAND "Use Wayland video driver" ${UNIX_SYS}) dep_option(SDL_WAYLAND_SHARED "Dynamically load Wayland support" ON "SDL_WAYLAND" OFF) dep_option(SDL_WAYLAND_LIBDECOR "Use client-side window decorations on Wayland" ON "SDL_WAYLAND" OFF) dep_option(SDL_WAYLAND_LIBDECOR_SHARED "Dynamically load libdecor support" ON "SDL_WAYLAND_LIBDECOR;SDL_WAYLAND_SHARED" OFF) dep_option(SDL_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "SDL_WAYLAND" OFF) -set_option(SDL_RPI "Use Raspberry Pi video driver" ${UNIX_SYS}) +set_option(SDL_RPI "Use Raspberry Pi 0-3 video driver" ${UNIX_SYS}) set_option(SDL_COCOA "Use Cocoa video driver" ${APPLE}) set_option(SDL_DIRECTX "Use DirectX for Windows audio/video" ${WINDOWS}) set_option(SDL_XINPUT "Use Xinput for Windows" ${WINDOWS}) @@ -511,6 +495,7 @@ set_option(SDL_HIDAPI "Enable the HIDAPI subsystem" ON) dep_option(SDL_HIDAPI_LIBUSB "Use libusb for low level joystick drivers" OFF SDL_HIDAPI OFF) dep_option(SDL_HIDAPI_JOYSTICK "Use HIDAPI for low level joystick drivers" ON SDL_HIDAPI OFF) dep_option(SDL_VIRTUAL_JOYSTICK "Enable the virtual-joystick driver" ON SDL_HIDAPI OFF) +set_option(SDL_LIBUDEV "Enable libudev support" ON) set_option(SDL_ASAN "Use AddressSanitizer to detect memory errors" OFF) option_string(SDL_VENDOR_INFO "Vendor name and/or version to add to SDL_REVISION" "") set_option(SDL_CCACHE "Use Ccache to speed up build" ON) @@ -527,26 +512,6 @@ set_option(SDL_INSTALL_TESTS "Install test-cases" OFF) set(HAVE_STATIC_PIC "${SDL_STATIC_PIC}") -if(SDL_WERROR) - if(MSVC) - cmake_push_check_state(RESET) - check_c_compiler_flag(/WX HAVE_WX) - if(HAVE_WX) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") - endif() - elseif(USE_GCC OR USE_CLANG) - cmake_push_check_state(RESET) - check_c_compiler_flag(-Werror HAVE_WERROR) - if(HAVE_WERROR) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror") - endif() - cmake_pop_check_state() - endif() -endif() - if(SDL_HIDAPI) if(HIDAPI_ONLY_LIBUSB) set(SDL_HIDAPI_LIBUSB ON CACHE BOOL "" FORCE) @@ -585,6 +550,15 @@ file(GLOB SOURCE_FILES ${SDL2_SOURCE_DIR}/src/video/*.c ${SDL2_SOURCE_DIR}/src/video/yuv2rgb/*.c) +if(USE_INTELCC) + # warning #39: division by zero + # warning #239: floating point underflow + # warning #264: floating-point value does not fit in required floating-point type + set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_exp.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd239 -wd264") + set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39") + set_property(SOURCE "${SDL2_SOURCE_DIR}/src/libm/e_log10.c" APPEND_STRING PROPERTY COMPILE_FLAGS " -wd39") +endif() + set(SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED 1) if(SDL_ASSERTIONS MATCHES "^(auto|)$") @@ -613,7 +587,7 @@ if(NOT SDL_FOREGROUNDING_SIGNAL STREQUAL "OFF") endif() # Compiler option evaluation -if(USE_GCC OR USE_CLANG) +if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC) # Check for -Wall first, so later things can override pieces of it. # Note: clang-cl treats -Wall as -Weverything (which is very loud), # /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough. @@ -627,11 +601,50 @@ if(USE_GCC OR USE_CLANG) endif() endif() + check_c_compiler_flag(-Wundef HAVE_GCC_WUNDEF) + if(HAVE_GCC_WUNDEF) + list(APPEND EXTRA_CFLAGS "-Wundef") + endif() + check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING) if(HAVE_GCC_NO_STRICT_ALIASING) list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing") endif() + check_c_compiler_flag(-Wdocumentation HAVE_GCC_WDOCUMENTATION) + if(HAVE_GCC_WDOCUMENTATION) + if(SDL_WERROR) + check_c_compiler_flag(-Werror=documentation HAVE_GCC_WERROR_DOCUMENTATION) + if(HAVE_GCC_WERROR_DOCUMENTATION) + list(APPEND EXTRA_CFLAGS "-Werror=documentation") + endif() + endif() + list(APPEND EXTRA_CFLAGS "-Wdocumentation") + endif() + + check_c_compiler_flag(-Wdocumentation-unknown-command HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND) + if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND) + if(SDL_WERROR) + check_c_compiler_flag(-Werror=documentation-unknown-command HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND) + if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND) + list(APPEND EXTRA_CFLAGS "-Werror=documentation-unknown-command") + endif() + endif() + list(APPEND EXTRA_CFLAGS "-Wdocumentation-unknown-command") + endif() + + check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS) + if(HAVE_GCC_COMMENT_BLOCK_COMMANDS) + list(APPEND EXTRA_CFLAGS "-fcomment-block-commands=threadsafety") + list(APPEND EXTRA_CFLAGS "-fcomment-block-commands=deprecated") + else() + check_c_compiler_flag(/clang:-fcomment-block-commands=threadsafety HAVE_CLANG_COMMENT_BLOCK_COMMANDS) + if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS) + list(APPEND EXTRA_CFLAGS "/clang:-fcomment-block-commands=threadsafety") + list(APPEND EXTRA_CFLAGS "/clang:-fcomment-block-commands=deprecated") + endif() + endif() + check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT) if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT) if(SDL_WERROR) @@ -670,11 +683,6 @@ if(USE_GCC OR USE_CLANG) endif() endif() - set(CMAKE_REQUIRED_FLAGS "-mpreferred-stack-boundary=2") - check_c_source_compiles("int x = 0; int main(int argc, char **argv) { return 0; }" - HAVE_GCC_PREFERRED_STACK_BOUNDARY) - set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) - set(CMAKE_REQUIRED_FLAGS "-fvisibility=hidden -Werror") check_c_source_compiles(" #if !defined(__GNUC__) || __GNUC__ < 4 @@ -691,6 +699,11 @@ if(USE_GCC OR USE_CLANG) list(APPEND EXTRA_CFLAGS "-Wshadow") endif() + check_c_compiler_flag(-Wunused-local-typedefs HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS) + if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS) + list(APPEND EXTRA_CFLAGS "-Wno-unused-local-typedefs") + endif() + if(APPLE) cmake_push_check_state(RESET) # FIXME: don't use deprecated declarations @@ -742,6 +755,11 @@ if(MSVC) if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64") list(APPEND EXTRA_LDFLAGS_BUILD "-CETCOMPAT") endif() + + # for VS >= 17.14 targeting ARM64: inline the Interlocked funcs + if(MSVC_VERSION GREATER 1943 AND SDL_CPU_ARM64 AND NOT SDL_LIBC) + list(APPEND EXTRA_CFLAGS /forceInterlockedFunctions-) + endif() endif() if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") @@ -751,7 +769,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") endif() if(SDL_ASSEMBLY) - if(USE_GCC OR USE_CLANG) + if(USE_GCC OR USE_CLANG OR USE_INTELCC) # TODO: Those all seem to be quite GCC specific - needs to be # reworked for better compiler support set(HAVE_ASSEMBLY TRUE) @@ -835,8 +853,9 @@ if(SDL_ASSEMBLY) #ifndef __SSE2__ #error Assembler CPP flag not enabled #endif - int main(int argc, char **argv) { return 0; }" HAVE_SSE2) - if(HAVE_SSE2) + int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE2) + if(CPU_SUPPORTS_SSE2) + set(HAVE_SSE2 TRUE) list(APPEND EXTRA_CFLAGS "-msse2") endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) @@ -858,8 +877,9 @@ if(SDL_ASSEMBLY) #ifndef __SSE3__ #error Assembler CPP flag not enabled #endif - int main(int argc, char **argv) { return 0; }" HAVE_SSE3) - if(HAVE_SSE3) + int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_SSE3) + if(CPU_SUPPORTS_SSE3) + set(HAVE_SSE3 TRUE) list(APPEND EXTRA_CFLAGS "-msse3") endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) @@ -892,9 +912,9 @@ if(SDL_ASSEMBLY) vector unsigned int vzero() { return vec_splat_u32(0); } - int main(int argc, char **argv) { return 0; }" HAVE_ALTIVEC) + int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_ALTIVEC) set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) - if(HAVE_ALTIVEC OR HAVE_ALTIVEC_H_HDR) + if(CPU_SUPPORTS_ALTIVEC OR HAVE_ALTIVEC_H_HDR) set(HAVE_ALTIVEC TRUE) # if only HAVE_ALTIVEC_H_HDR is set list(APPEND EXTRA_CFLAGS "-maltivec") set(SDL_ALTIVEC_BLITTERS 1) @@ -904,6 +924,23 @@ if(SDL_ASSEMBLY) endif() endif() + if(SDL_LSX) + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "-mlsx") + check_c_source_compiles(" + #ifndef __loongarch_sx + #error Assembler CPP flag not enabled + #endif + int main(int argc, char **argv) { return 0; }" CPU_SUPPORTS_LSX) + check_include_file("lsxintrin.h" HAVE_LSXINTRIN_H) + cmake_pop_check_state() + + if(CPU_SUPPORTS_LSX AND HAVE_LSXINTRIN_H) + list(APPEND EXTRA_CFLAGS "-mlsx") + set(HAVE_LSX TRUE) + endif() + endif() + if(SDL_ARMSIMD) set(ORIG_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -x assembler-with-cpp") @@ -962,12 +999,22 @@ if(SDL_ASSEMBLY) # TODO: SDL_cpuinfo.h needs to support the user's configuration wish # for MSVC - right now it is always activated if(NOT ARCH_64) - set(HAVE_MMX TRUE) - set(HAVE_3DNOW TRUE) + if(SDL_MMX) + set(HAVE_MMX TRUE) + endif() + if(SDL_3DNOW) + set(HAVE_3DNOW TRUE) + endif() + endif() + if(SDL_SSE) + set(HAVE_SSE TRUE) + endif() + if(SDL_SSE2) + set(HAVE_SSE2 TRUE) + endif() + if(SDL_SSE3) + set(HAVE_SSE3 TRUE) endif() - set(HAVE_SSE TRUE) - set(HAVE_SSE2 TRUE) - set(HAVE_SSE3 TRUE) check_include_file("immintrin.h" HAVE_IMMINTRIN_H) endif() endif() @@ -1023,15 +1070,11 @@ if(SDL_LIBC) sys/types.h wchar.h ) - if(NOT EMSCRIPTEN) - list(APPEND headers_to_check libunwind.h) - endif() foreach(_HEADER ${headers_to_check}) string(TOUPPER "HAVE_${_HEADER}" _UPPER) string(REGEX REPLACE "[./]" "_" _HAVE_H ${_UPPER}) check_include_file("${_HEADER}" ${_HAVE_H}) endforeach() - check_include_file(linux/input.h HAVE_LINUX_INPUT_H) set(STDC_HEADER_NAMES "stddef.h;stdarg.h;stdlib.h;string.h;stdio.h;wchar.h;float.h") check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS) @@ -1056,6 +1099,7 @@ if(SDL_LIBC) endforeach() check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION) + check_symbol_exists(sigtimedwait "signal.h" HAVE_SIGTIMEDWAIT) check_symbol_exists(setjmp "setjmp.h" HAVE_SETJMP) check_symbol_exists(nanosleep "time.h" HAVE_NANOSLEEP) check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF) @@ -1063,11 +1107,14 @@ if(SDL_LIBC) check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL) check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO) check_symbol_exists(poll "poll.h" HAVE_POLL) + check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE) + check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE) check_library_exists(m pow "" HAVE_LIBM) if(HAVE_LIBM) set(CMAKE_REQUIRED_LIBRARIES m) - foreach(_FN + endif() + foreach(_FN atan atan2 atanf atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt @@ -1075,7 +1122,8 @@ if(SDL_LIBC) string(TOUPPER ${_FN} _UPPER) set(_HAVEVAR "HAVE_${_UPPER}") check_symbol_exists("${_FN}" "math.h" ${_HAVEVAR}) - endforeach() + endforeach() + if(HAVE_LIBM) set(CMAKE_REQUIRED_LIBRARIES) if(NOT VITA) list(APPEND EXTRA_LIBS m) @@ -1083,16 +1131,31 @@ if(SDL_LIBC) endif() if(SDL_SYSTEM_ICONV) - check_library_exists(iconv iconv_open "" HAVE_LIBICONV) - if(HAVE_LIBICONV) - list(APPEND EXTRA_LIBS iconv) + check_c_source_compiles(" + #define LIBICONV_PLUG 1 /* in case libiconv header is in include path */ + #include + #include + int main(int argc, char **argv) { + return !iconv_open(NULL,NULL); + }" ICONV_IN_LIBC) + + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_LIBRARIES iconv) + check_c_source_compiles(" + #include + #include + int main(int argc, char **argv) { + return !iconv_open(NULL,NULL); + }" ICONV_IN_LIBICONV) + cmake_pop_check_state() + + if(ICONV_IN_LIBC OR ICONV_IN_LIBICONV) set(HAVE_ICONV 1) set(HAVE_SYSTEM_ICONV TRUE) - else() - check_library_exists(c iconv_open "" HAVE_BUILTIN_ICONV) - if(HAVE_BUILTIN_ICONV) - set(HAVE_ICONV 1) - set(HAVE_SYSTEM_ICONV TRUE) + if(ICONV_IN_LIBICONV AND (SDL_LIBICONV OR (NOT ICONV_IN_LIBC))) + set(SDL_USE_LIBICONV 1) + set(HAVE_LIBICONV TRUE) + list(APPEND EXTRA_LIBS iconv) endif() endif() endif() @@ -1117,6 +1180,10 @@ else() set(HAVE_STDARG_H 1) set(HAVE_STDDEF_H 1) check_include_file(stdint.h HAVE_STDINT_H) + + if(MSVC AND USE_CLANG) + check_c_compiler_flag("/Q_no-use-libirc" HAS_Q_NO_USE_LIBIRC ) + endif() endif() endif() @@ -1399,18 +1466,19 @@ elseif(EMSCRIPTEN) endif() CheckPTHREAD() - - if(HAVE_LIBUNWIND_H) - list(APPEND EXTRA_TEST_LIBS unwind) - endif() + CheckLibUnwind() elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(SDL_AUDIO) if(SYSV5 OR SOLARIS OR HPUX) - set(SDL_AUDIO_DRIVER_SUNAUDIO 1) - file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) - list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) - set(HAVE_SDL_AUDIO TRUE) + # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first. + check_include_file(sys/audioio.h HAVE_SYS_AUDIOIO_H) + if(HAVE_SYS_AUDIOIO_H) + set(SDL_AUDIO_DRIVER_SUNAUDIO 1) + file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) + list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) + set(HAVE_SDL_AUDIO TRUE) + endif() elseif(NETBSD) set(SDL_AUDIO_DRIVER_NETBSD 1) file(GLOB NETBSD_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/netbsd/*.c) @@ -1421,6 +1489,12 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c) list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES}) set(HAVE_SDL_AUDIO TRUE) + elseif(QNX) + set(SDL_AUDIO_DRIVER_QSA 1) + file(GLOB QSA_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/qsa/*.c) + list(APPEND SOURCE_FILES ${QSA_AUDIO_SOURCES}) + list(APPEND EXTRA_LIBS asound) + set(HAVE_SDL_AUDIO TRUE) endif() CheckOSS() CheckALSA() @@ -1452,6 +1526,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) set(SDL_VIDEO_VULKAN 1) set(HAVE_VULKAN TRUE) endif() + CheckQNXScreen() endif() if(UNIX) @@ -1463,7 +1538,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) #ifndef EVIOCGNAME #error EVIOCGNAME() ioctl not available #endif - int main(int argc, char** argv) { return 0; }" HAVE_INPUT_EVENTS) + int main(int argc, char** argv) { return 0; }" HAVE_LINUX_INPUT_H) if(LINUX) check_c_source_compiles(" @@ -1485,13 +1560,25 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) ioctl(0, KDENABIO, 1); return 0; }" HAVE_INPUT_KBIO) + elseif(OPENBSD OR NETBSD) + check_c_source_compiles(" + #include + #include + #include + #include + #include + int main(int argc, char **argv) { + struct wskbd_map_data data; + ioctl(0, WSKBDIO_GETMAP, &data); + return 0; + }" HAVE_INPUT_WSCONS) endif() - if(HAVE_INPUT_EVENTS) + if(HAVE_LINUX_INPUT_H) set(SDL_INPUT_LINUXEV 1) endif() - if(SDL_HAPTIC AND HAVE_INPUT_EVENTS) + if(SDL_HAPTIC AND HAVE_LINUX_INPUT_H) set(SDL_HAPTIC_LINUX 1) file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/linux/*.c) list(APPEND SOURCE_FILES ${HAPTIC_SOURCES}) @@ -1506,7 +1593,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) set(SDL_INPUT_FBSDKBIO 1) endif() - check_include_file("libudev.h" HAVE_LIBUDEV_H) + if(HAVE_INPUT_WSCONS) + set(SDL_INPUT_WSCONS 1) + endif() + + CheckLibUDev() check_include_file("sys/inotify.h" HAVE_SYS_INOTIFY_H) check_symbol_exists(inotify_init "sys/inotify.h" HAVE_INOTIFY_INIT) check_symbol_exists(inotify_init1 "sys/inotify.h" HAVE_INOTIFY_INIT1) @@ -1550,15 +1641,8 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) endif() endif() - if(HAVE_LIBUNWIND_H) - # We've already found the header, so link the lib if present. - # NB: This .pc file is not present on FreeBSD where the implicitly - # linked base system libgcc_s includes all libunwind ABI. - pkg_search_module(UNWIND libunwind) - pkg_search_module(UNWIND_GENERIC libunwind-generic) - list(APPEND EXTRA_TEST_LIBS ${UNWIND_LIBRARIES} ${UNWIND_GENERIC_LIBRARIES}) - endif() endif() + CheckLibUnwind() if(HAVE_DBUS_DBUS_H) list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_dbus.c") @@ -1580,7 +1664,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_udev.c") endif() - if(HAVE_INPUT_EVENTS) + if(HAVE_LINUX_INPUT_H) list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev.c") list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_kbd.c") endif() @@ -1589,6 +1673,11 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/freebsd/SDL_evdev_kbd_freebsd.c") endif() + if(HAVE_INPUT_WSCONS) + list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/openbsd/SDL_wscons_kbd.c") + list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/openbsd/SDL_wscons_mouse.c") + endif() + # Always compiled for Linux, unconditionally: list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_evdev_capabilities.c") list(APPEND SOURCE_FILES "${SDL2_SOURCE_DIR}/src/core/linux/SDL_threadprio.c") @@ -1605,7 +1694,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(FREEBSD OR NETBSD OR OPENBSD OR BSDI) CheckUSBHID() endif() - if(LINUX AND HAVE_LINUX_INPUT_H AND NOT ANDROID) + if((LINUX OR FREEBSD) AND HAVE_LINUX_INPUT_H AND NOT ANDROID) set(SDL_JOYSTICK_LINUX 1) file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/linux/*.c ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) list(APPEND SOURCE_FILES ${JOYSTICK_SOURCES}) @@ -1616,14 +1705,14 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) CheckPTHREAD() if(SDL_CLOCK_GETTIME) - check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT) - if(FOUND_CLOCK_GETTIME_LIBRT) - list(APPEND EXTRA_LIBS rt) + check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC) + if(FOUND_CLOCK_GETTIME_LIBC) set(HAVE_CLOCK_GETTIME 1) else() - check_library_exists(c clock_gettime "" FOUND_CLOCK_GETTIME_LIBC) - if(FOUND_CLOCK_GETTIME_LIBC) + check_library_exists(rt clock_gettime "" FOUND_CLOCK_GETTIME_LIBRT) + if(FOUND_CLOCK_GETTIME_LIBRT) set(HAVE_CLOCK_GETTIME 1) + list(APPEND EXTRA_LIBS rt) endif() endif() endif() @@ -1686,6 +1775,13 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) set(HAVE_RPATH TRUE) endif() + if(QNX) + # QNX's *printf() family generates a SIGSEGV if NULL is passed for a string + # specifier (on purpose), but SDL expects "(null)". Use the built-in + # implementation. + set(HAVE_VSNPRINTF 0) + set(USE_POSIX_SPAWN 1) + endif() elseif(WINDOWS) find_program(WINDRES windres) @@ -1697,18 +1793,11 @@ elseif(WINDOWS) list(APPEND SOURCE_FILES ${CORE_SOURCES}) if(WINDOWS_STORE) + enable_language(CXX) file(GLOB WINRT_SOURCE_FILES ${SDL2_SOURCE_DIR}/src/core/winrt/*.c ${SDL2_SOURCE_DIR}/src/core/winrt/*.cpp) list(APPEND SOURCE_FILES ${WINRT_SOURCE_FILES}) endif() - if(MSVC AND NOT SDL_LIBC) - # Prevent codegen that would use the VC runtime libraries. - set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/GS-") - if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM") - set_property(DIRECTORY . APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE") - endif() - endif() - if(SDL_MISC) if(WINDOWS_STORE) file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp) @@ -1734,17 +1823,15 @@ elseif(WINDOWS) check_include_file(d3d9.h HAVE_D3D_H) check_include_file(d3d11_1.h HAVE_D3D11_H) check_c_source_compiles(" - #include - #include #include + #include ID3D12Device1 *device; - #if WDK_NTDDI_VERSION > 0x0A000008 - int main(int argc, char **argv) { return 0; } - #endif" HAVE_D3D12_H) + int main(int argc, char **argv) {return 0; } + " HAVE_D3D12_H) check_include_file(ddraw.h HAVE_DDRAW_H) check_include_file(dsound.h HAVE_DSOUND_H) check_include_file(dinput.h HAVE_DINPUT_H) - if(WINDOWS_STORE OR CMAKE_GENERATOR_PLATFORM STREQUAL "ARM") + if(WINDOWS_STORE OR SDL_CPU_ARM32) set(HAVE_DINPUT_H 0) endif() check_include_file(dxgi.h HAVE_DXGI_H) @@ -1752,8 +1839,10 @@ elseif(WINDOWS) set(HAVE_DIRECTX TRUE) if(NOT MINGW AND NOT USE_WINSDK_DIRECTX) # TODO: change $ENV{DXSDL_DIR} to get the path from the include checks - target_link_directories(sdl-build-options INTERFACE "$$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}") - target_include_directories(sdl-build-options INTERFACE "$ENV{DXSDK_DIR}\\Include") + file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\lib\\${PROCESSOR_ARCH}" SDL2_TMP_DXSDK_LIB_DIR) + target_link_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_LIB_DIR}") + file(TO_CMAKE_PATH "$ENV{DXSDK_DIR}\\Include" SDL2_TMP_DXSDK_INCLUDE_DIR) + target_include_directories(sdl-build-options INTERFACE "${SDL2_TMP_DXSDK_INCLUDE_DIR}") endif() endif() set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) @@ -1765,16 +1854,6 @@ elseif(WINDOWS) #include #include int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_H) - check_c_source_compiles(" - #include - #include - XINPUT_GAMEPAD_EX x1; - int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_GAMEPAD_EX) - check_c_source_compiles(" - #include - #include - XINPUT_STATE_EX s1; - int main(int argc, char **argv) { return 0; }" HAVE_XINPUT_STATE_EX) check_c_source_compiles(" #define COBJMACROS #include @@ -1904,7 +1983,7 @@ elseif(WINDOWS) # Libraries for Win32 native and MinGW if(NOT WINDOWS_STORE) - list(APPEND EXTRA_LIBS user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32) + list(APPEND EXTRA_LIBS kernel32 user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32) endif() if(WINDOWS_STORE) @@ -1998,6 +2077,7 @@ elseif(WINDOWS) endif() endif() + enable_language(RC) file(GLOB VERSION_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.rc) file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/windows/*.c) if(MINGW OR CYGWIN) @@ -2015,7 +2095,7 @@ elseif(APPLE) # !!! FIXME: we need Carbon for some very old API calls in # !!! FIXME: src/video/cocoa/SDL_cocoakeyboard.c, but we should figure out # !!! FIXME: how to dump those. - if(DARWIN OR MACOSX) + if(MACOS) set(SDL_FRAMEWORK_COCOA 1) set(SDL_FRAMEWORK_CARBON 1) endif() @@ -2029,12 +2109,12 @@ elseif(APPLE) set(HAVE_SDL_FILE TRUE) endif() - if(IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) endif() if(SDL_MISC) - if(IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m) else() file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m) @@ -2059,10 +2139,10 @@ elseif(APPLE) if(SDL_JOYSTICK) file(GLOB MFI_JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/iphoneos/*.m) - if(IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) file(GLOB JOYSTICK_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/steam/*.c) set(SDL_JOYSTICK_MFI 1) - if(IOS) + if(IOS OR VISIONOS OR WATCHOS) set(SDL_FRAMEWORK_COREMOTION 1) endif() set(SDL_FRAMEWORK_GAMECONTROLLER 1) @@ -2103,7 +2183,7 @@ elseif(APPLE) endif() if(SDL_HAPTIC) - if (IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) file(GLOB HAPTIC_SOURCES ${SDL2_SOURCE_DIR}/src/haptic/dummy/*.c) set(SDL_HAPTIC_DUMMY 1) else() @@ -2117,7 +2197,7 @@ elseif(APPLE) endif() if(SDL_POWER) - if (IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) file(GLOB POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/uikit/*.m) set(SDL_POWER_UIKIT 1) else() @@ -2150,7 +2230,7 @@ elseif(APPLE) endif() if(SDL_SENSOR) - if(IOS) + if(IOS OR VISIONOS OR WATCHOS) set(SDL_SENSOR_COREMOTION 1) set(HAVE_SDL_SENSORS TRUE) file(GLOB SENSOR_SOURCES ${SDL2_SOURCE_DIR}/src/sensor/coremotion/*.m) @@ -2160,7 +2240,7 @@ elseif(APPLE) # iOS hack needed - http://code.google.com/p/ios-cmake/ ? if(SDL_VIDEO) - if (IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) set(SDL_VIDEO_DRIVER_UIKIT 1) set(SDL_FRAMEWORK_COREGRAPHICS 1) set(SDL_FRAMEWORK_QUARTZCORE 1) @@ -2181,7 +2261,7 @@ elseif(APPLE) endif() if(SDL_OPENGLES) - if(IOS OR TVOS) + if(IOS OR TVOS OR VISIONOS OR WATCHOS) set(SDL_FRAMEWORK_OPENGLES 1) set(SDL_VIDEO_OPENGL_ES 1) set(SDL_VIDEO_RENDER_OGL_ES 1) @@ -2224,73 +2304,96 @@ elseif(APPLE) endif() endif() + # Minimum version for $ + cmake_minimum_required(VERSION 3.24) + # Actually load the frameworks at the end so we don't duplicate include. if(SDL_FRAMEWORK_COREVIDEO) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreVideo") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreVideo") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COCOA) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Cocoa") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Cocoa") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_IOKIT) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,IOKit") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,IOKit") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_FF) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,ForceFeedback") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,ForceFeedback") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_CARBON) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Carbon") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Carbon") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COREAUDIO) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreAudio") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreAudio") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_AUDIOTOOLBOX) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AudioToolbox") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AudioToolbox") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_AVFOUNDATION) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,AVFoundation") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,AVFoundation") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COREBLUETOOTH) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreBluetooth") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreBluetooth") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COREGRAPHICS) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreGraphics") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreGraphics") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COREMOTION) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,CoreMotion") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,CoreMotion") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_FOUNDATION) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Foundation") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Foundation") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_GAMECONTROLLER) find_library(GAMECONTROLLER GameController) if(GAMECONTROLLER) - list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,GameController") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,GameController") + list(APPEND CMAKE_LIBS "$") endif() endif() if(SDL_FRAMEWORK_METAL) - if(IOS OR TVOS) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,Metal") + if(IOS OR TVOS OR VISIONOS OR WATCHOS) + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,Metal") + list(APPEND CMAKE_LIBS "$") else() - list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,Metal") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,Metal") + list(APPEND CMAKE_LIBS "$") endif() endif() if(SDL_FRAMEWORK_OPENGLES) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,OpenGLES") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,OpenGLES") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_QUARTZCORE) - if(IOS OR TVOS) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,QuartzCore") + if(IOS OR TVOS OR VISIONOS OR WATCHOS) + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,QuartzCore") + list(APPEND CMAKE_LIBS "$") else() - list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,QuartzCore") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,QuartzCore") + list(APPEND CMAKE_LIBS "$") endif() endif() if(SDL_FRAMEWORK_UIKIT) - list(APPEND EXTRA_LDFLAGS "-Wl,-framework,UIKit") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-framework,UIKit") + list(APPEND CMAKE_LIBS "$") endif() if(SDL_FRAMEWORK_COREHAPTICS) find_library(COREHAPTICS CoreHaptics) if(COREHAPTICS) - list(APPEND EXTRA_LDFLAGS "-Wl,-weak_framework,CoreHaptics") + list(APPEND PKGCONFIG_LDFLAGS "-Wl,-weak_framework,CoreHaptics") + list(APPEND CMAKE_LIBS "$") endif() endif() @@ -2450,7 +2553,7 @@ elseif(VITA) ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_sysmutex.c ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_syssem.c ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_systhread.c - ${SDL2_SOURCE_DIR}/src/thread/vita/SDL_syscond.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c) set(HAVE_SDL_THREADS TRUE) endif() @@ -2484,6 +2587,9 @@ elseif(VITA) set(SDL_VIDEO_OPENGL_ES2 1) list(APPEND EXTRA_LIBS pib + libScePiglet_stub_weak + taihen_stub_weak + SceShaccCg_stub_weak ) set(HAVE_VIDEO_VITA_PIB ON) set(SDL_VIDEO_VITA_PIB 1) @@ -2496,7 +2602,6 @@ elseif(VITA) check_include_file(gpu_es4/psp2_pvr_hint.h HAVE_PVR_H) if(HAVE_PVR_H) target_compile_definitions(sdl-build-options INTERFACE "-D__psp2__") - check_include_file(gl4esinit.h HAVE_GL4ES_H) set(SDL_VIDEO_OPENGL_EGL 1) set(HAVE_OPENGLES TRUE) set(SDL_VIDEO_OPENGL_ES 1) @@ -2507,17 +2612,21 @@ elseif(VITA) list(APPEND EXTRA_LIBS libgpu_es4_ext_stub_weak libIMGEGL_stub_weak + SceIme_stub ) set(HAVE_VIDEO_VITA_PVR ON) set(SDL_VIDEO_VITA_PVR 1) - if(HAVE_GL4ES_H) - set(HAVE_OPENGL TRUE) - set(SDL_VIDEO_OPENGL 1) - set(SDL_VIDEO_RENDER_OGL 1) - list(APPEND EXTRA_LIBS libGL_stub) - set(SDL_VIDEO_VITA_PVR_OGL 1) + if(SDL_OPENGL) + check_include_file(gl4esinit.h HAVE_GL4ES_H) + if(HAVE_GL4ES_H) + set(HAVE_OPENGL TRUE) + set(SDL_VIDEO_OPENGL 1) + set(SDL_VIDEO_RENDER_OGL 1) + list(APPEND EXTRA_LIBS libGL_stub) + set(SDL_VIDEO_VITA_PVR_OGL 1) + endif() endif() else() @@ -2547,19 +2656,6 @@ elseif(VITA) SceProcessmgr_stub m ) - if(HAVE_VITA_PIB) - list(PREPEND EXTRA_LIBS - pib - libScePiglet_stub - SceShaccCg_stub - taihen_stub - ) - endif() - if(HAVE_VITA_PVR) - list(PREPEND EXTRA_LIBS - SceIme_stub - ) - endif() endif() set(HAVE_ARMSIMD TRUE) @@ -2609,10 +2705,18 @@ elseif(PSP) endif() if(SDL_THREADS) set(SDL_THREAD_PSP 1) - file(GLOB PSP_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL2_SOURCE_DIR}/src/thread/psp/*.c) + file(GLOB PSP_THREAD_SOURCES + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c + ${SDL2_SOURCE_DIR}/src/thread/psp/*.c) list(APPEND SOURCE_FILES ${PSP_THREAD_SOURCES}) set(HAVE_SDL_THREADS TRUE) endif() + if(SDL_LOCALE) + file(GLOB PSP_LOCALE_SOURCES ${SDL2_SOURCE_DIR}/src/locale/psp/*.c) + list(APPEND SOURCE_FILES ${PSP_LOCALE_SOURCES}) + set(HAVE_SDL_LOCALE TRUE) + endif() if(SDL_TIMERS) set(SDL_TIMER_PSP 1) file(GLOB PSP_TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/psp/*.c) @@ -2642,10 +2746,9 @@ elseif(PSP) ) if(NOT SDL2_DISABLE_SDL2MAIN) list(INSERT SDL_LIBS 0 "-lSDL2main") - endif(NOT SDL2_DISABLE_SDL2MAIN) + endif() elseif(PS2) - list(APPEND EXTRA_CFLAGS "-DPS2" "-D__PS2__" "-I$ENV{PS2SDK}/ports/include" "-I$ENV{PS2DEV}/gsKit/include") file(GLOB PS2_MAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/ps2/*.c) set(SDLMAIN_SOURCES ${SDLMAIN_SOURCES} ${PS2_MAIN_SOURCES}) @@ -2670,7 +2773,11 @@ elseif(PS2) endif() if(SDL_THREADS) set(SDL_THREAD_PS2 1) - file(GLOB PS2_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_sysmutex.c ${SDL2_SOURCE_DIR}/src/thread/ps2/*.c) + file(GLOB PS2_THREAD_SOURCES + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_sysmutex.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c + ${SDL2_SOURCE_DIR}/src/thread/ps2/*.c) list(APPEND SOURCE_FILES ${PS2_THREAD_SOURCES}) set(HAVE_SDL_THREADS TRUE) endif() @@ -2801,7 +2908,9 @@ elseif(N3DS) if(SDL_THREADS) set(SDL_THREAD_N3DS 1) file(GLOB N3DS_THREAD_SOURCES ${SDL2_SOURCE_DIR}/src/thread/n3ds/*.c) - list(APPEND SOURCE_FILES ${N3DS_THREAD_SOURCES} ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c) + list(APPEND SOURCE_FILES ${N3DS_THREAD_SOURCES} + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_systls.c + ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c) set(HAVE_SDL_THREADS TRUE) endif() @@ -2840,6 +2949,17 @@ elseif(N3DS) else() message_error("SDL_FILE must be enabled to build on N3DS") endif() + + if(NOT SDL2_DISABLE_SDL2MAIN) + list(INSERT SDL_LIBS 0 "-lSDL2main") + endif() + + foreach(lib ${CMAKE_C_STANDARD_LIBRARIES}) + if(lib MATCHES "^-l") + string(SUBSTRING "${lib}" 2 -1 lib) + endif() + list(APPEND EXTRA_LIBS ${lib}) + endforeach() endif() if(HAVE_VULKAN AND NOT SDL_LOADSO) @@ -2926,6 +3046,26 @@ if(NOT SDLMAIN_SOURCES) file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/dummy/*.c) endif() +if(SDL_WERROR) + if(MSVC) + cmake_push_check_state(RESET) + check_c_compiler_flag(/WX HAVE_WX) + if(HAVE_WX) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") + endif() + elseif(USE_GCC OR USE_CLANG OR USE_INTELCC) + cmake_push_check_state(RESET) + check_c_compiler_flag(-Werror HAVE_WERROR) + if(HAVE_WERROR) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -Werror") + endif() + cmake_pop_check_state() + endif() +endif() + # Append the -MMD -MT flags # if(DEPENDENCY_TRACKING) # if(COMPILER_IS_GNUCC) @@ -2942,7 +3082,7 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" lower_build_type) execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/include-config-${lower_build_type}") # 3. generate SDL_config in an build_type-dependent folder (which should be first in the include search path) file(GENERATE - OUTPUT "${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h" + OUTPUT "${SDL2_BINARY_DIR}/include-config-$>/SDL2/SDL_config.h" INPUT "${SDL2_BINARY_DIR}/SDL_config.h.intermediate") # Prepare the flags and remove duplicates @@ -2958,10 +3098,14 @@ endif() listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS) set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) +if(USE_GCC OR USE_CLANG) + string(REGEX REPLACE "(^| )-I" "\\1 -isystem" EXTRA_CFLAGS "${EXTRA_CFLAGS}") +endif() + # Compat helpers for the configuration files -if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt") - file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION) +if(EXISTS "${PROJECT_SOURCE_DIR}/REVISION.txt") + file(READ "${PROJECT_SOURCE_DIR}/REVISION.txt" SDL_SOURCE_VERSION) string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION) endif() @@ -2993,9 +3137,9 @@ else() endif() configure_file("${SDL2_SOURCE_DIR}/include/SDL_revision.h.cmake" - "${SDL2_BINARY_DIR}/include/SDL_revision.h") + "${SDL2_BINARY_DIR}/include/SDL2/SDL_revision.h") -# Copy all non-generated headers to "${SDL2_BINARY_DIR}/include" +# Copy all non-generated headers to "${SDL2_BINARY_DIR}/include/SDL2" # This is done to avoid the inclusion of a pre-generated SDL_config.h file(GLOB SDL2_INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h) set(SDL2_COPIED_INCLUDE_FILES) @@ -3004,7 +3148,7 @@ foreach(_hdr IN LISTS SDL2_INCLUDE_FILES) list(REMOVE_ITEM SDL2_INCLUDE_FILES "${_hdr}") else() get_filename_component(_name "${_hdr}" NAME) - set(_bin_hdr "${SDL2_BINARY_DIR}/include/${_name}") + set(_bin_hdr "${SDL2_BINARY_DIR}/include/SDL2/${_name}") list(APPEND SDL2_COPIED_INCLUDE_FILES "${_bin_hdr}") add_custom_command(OUTPUT "${_bin_hdr}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr}" "${_bin_hdr}" @@ -3020,9 +3164,17 @@ else() set(sdl_static_libname "SDL2") endif() -set(prefix ${CMAKE_INSTALL_PREFIX}) +# CMAKE_PREFIX_PATH and CMAKE_INSTALL_FULL_BINDIR can be a non-absolute path +# when a master-project does e.g. `set(CMAKE_INSTALL_PREFIX "libs/SDL2" CACHE PATH "prefix" FORCE)`. +if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}") +endif() +if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_FULL_BINDIR}") + set(CMAKE_INSTALL_FULL_BINDIR "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_FULL_BINDIR}") +endif() file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}") +set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "\${prefix}") set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}") @@ -3047,7 +3199,7 @@ endif() # Clean up the different lists listtostr(EXTRA_LIBS _EXTRA_LIBS "-l") -set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS}) +set(SDL_STATIC_LIBS ${EXTRA_LDFLAGS} ${_EXTRA_LIBS} ${PKGCONFIG_LDFLAGS}) list(REMOVE_DUPLICATES SDL_STATIC_LIBS) listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS) set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS}) @@ -3059,6 +3211,7 @@ string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_STATIC_LIBS "$ if(NOT SDL_SHARED) string(REGEX REPLACE "-lSDL2( |$)" "-l${sdl_static_libname} " SDL_LIBS "${SDL_LIBS}") endif() +listtostr(PKGCONFIG_DEPENDS PKGCONFIG_DEPENDS) if(SDL_STATIC AND SDL_SHARED AND NOT sdl_static_libname STREQUAL "SDL2") message(STATUS "\"pkg-config --static --libs sdl2\" will return invalid information") @@ -3080,9 +3233,11 @@ macro(check_add_debug_flag FLAG SUFFIX) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}") endif() - check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX}) - if (HAS_CXX_${SUFFIX}) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}") + if(CMAKE_CXX_COMPILER) + check_cxx_compiler_flag(${FLAG} HAS_CXX_${SUFFIX}) + if (HAS_CXX_${SUFFIX}) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}") + endif() endif() endmacro() @@ -3101,18 +3256,20 @@ macro(asan_check_add_debug_flag2 ASAN_FLAG) set (STORED_REQLIBS ${CMAKE_REQUIRED_LIBRARIES}) set (CMAKE_REQUIRED_LIBRARIES "${FLAG};asan") - check_c_compiler_flag (${FLAG} HAS_C_FLAG_${ASAN_FLAG}) - check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG}) - set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS}) + check_c_compiler_flag (${FLAG} HAS_C_FLAG_${ASAN_FLAG}) if (HAS_C_FLAG_${ASAN_FLAG}) set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAG}") endif() - if (HAS_CXX_${ASAN_FLAG}) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}") + if(CMAKE_CXX_COMPILER) + check_cxx_compiler_flag (${FLAG} HAS_CXX_FLAG_${ASAN_FLAG}) + if (HAS_CXX_${ASAN_FLAG}) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}") + endif() endif() + set (CMAKE_REQUIRED_LIBRARIES ${STORED_REQLIBS}) if(HAS_C_${ASAN_FLAG} OR HAS_CXX_${ASAN_FLAG}) set(HAVE_ASAN ON) endif() @@ -3139,8 +3296,8 @@ if (SDL_ASAN) endif() endif() -if(SDL_CCACHE) - cmake_minimum_required(VERSION 3.4) +if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4) + cmake_minimum_required(VERSION 3.4...3.5) find_program(CCACHE_BINARY ccache) if(CCACHE_BINARY) set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY}) @@ -3150,6 +3307,8 @@ if(SDL_CCACHE) else() set(HAVE_CCACHE OFF) endif() +else() + set(HAVE_CCACHE OFF) endif() if(SDL_TESTS) @@ -3235,22 +3394,27 @@ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) add_dependencies(SDL2main sdl_headers_copy) # alias target for in-tree builds add_library(SDL2::SDL2main ALIAS SDL2main) - target_include_directories(SDL2main BEFORE PRIVATE "${SDL2_BINARY_DIR}/include" PRIVATE "${SDL2_BINARY_DIR}/include-config-$>") + target_include_directories(SDL2main BEFORE + PRIVATE "${SDL2_BINARY_DIR}/include" + PRIVATE "${SDL2_BINARY_DIR}/include/SDL2" + PRIVATE "${SDL2_BINARY_DIR}/include-config-$>/SDL2" + ) target_include_directories(SDL2main PUBLIC "$" $ $) if (WIN32) target_link_libraries(SDL2main PRIVATE shell32) endif() if(MINGW OR CYGWIN) - cmake_minimum_required(VERSION 3.13) if(CMAKE_SIZEOF_VOID_P EQUAL 4) - target_link_options(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") + target_link_libraries(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=_WinMain@16>") else() - target_link_options(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") + target_link_libraries(SDL2main PUBLIC "$<$,EXECUTABLE>:-Wl,--undefined=WinMain>") endif() endif() if (NOT ANDROID) set_target_properties(SDL2main PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() + set_property(TARGET SDL2main APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") + set_property(TARGET SDL2main PROPERTY INTERFACE_SDL_VERSION "SDL2") endif() if(ANDROID) @@ -3258,6 +3422,12 @@ if(ANDROID) endif() if(APPLE) + cmake_push_check_state(RESET) + check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC) + cmake_pop_check_state() + if(NOT COMPILER_SUPPORTS_FOBJC_ARC) + message(FATAL_ERROR "Compiler does not support -fobjc-arc: this is required on Apple platforms") + endif() target_compile_options(sdl-build-options INTERFACE "-fobjc-arc") endif() @@ -3268,7 +3438,7 @@ endif() if(APPLE) foreach(SOURCE_FILE ${SOURCE_FILES}) get_filename_component(FILE_EXTENSION ${SOURCE_FILE} EXT) - if(FILE_EXTENSION STREQUAL "m") + if(FILE_EXTENSION STREQUAL ".m") set_property(SOURCE ${SOURCE_FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -x objective-c") endif() endforeach() @@ -3280,12 +3450,15 @@ if(SDL_SHARED) # alias target for in-tree builds add_library(SDL2::SDL2 ALIAS SDL2) set_target_properties(SDL2 PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + set_target_properties(SDL2 PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE) if(NOT SDL_LIBC) - check_cpu_architecture(x86 HAS_X86) - if(HAS_X86) + if(SDL_CPU_X86) # FIXME: should be added for all architectures (missing symbols for ARM) target_link_libraries(SDL2 PRIVATE "-nodefaultlib:MSVCRT") endif() + if(HAS_Q_NO_USE_LIBIRC) + target_compile_options(SDL2 PRIVATE /Q_no-use-libirc) + endif() endif() if(APPLE) # FIXME: Remove SOVERSION in SDL3 @@ -3312,21 +3485,22 @@ if(SDL_SHARED) OUTPUT_NAME "SDL2") endif() # Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB. - if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM") + if(MSVC AND NOT SDL_LIBC AND NOT MSVC_CLANG AND NOT SDL_CPU_ARM32) # Don't try to link with the default set of libraries. if(NOT WINDOWS_STORE) - set_target_properties(SDL2 PROPERTIES LINK_FLAGS_RELEASE "/NODEFAULTLIB") - set_target_properties(SDL2 PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB") + set_property(TARGET SDL2 APPEND_STRING PROPERTY LINK_FLAGS " /NODEFAULTLIB") endif() - set_target_properties(SDL2 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB") + set_property(TARGET SDL2 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS " /NODEFAULTLIB") endif() # FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS - target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD}) + target_link_libraries(SDL2 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_LIBS}) target_include_directories(SDL2 PUBLIC "$" - "$>>" + "$" + "$>/SDL2>" "$" - "$") + "$" + ) # This picks up all the compiler options and such we've accumulated up to here. target_link_libraries(SDL2 PRIVATE $) if(MINGW OR CYGWIN) @@ -3338,8 +3512,10 @@ if(SDL_SHARED) set_target_properties(SDL2 PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() # Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library - set_property(TARGET SDL2 PROPERTY INTERFACE_SDL2_SHARED TRUE) set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED) + set_property(TARGET SDL2 PROPERTY INTERFACE_SDL2_SHARED TRUE) + set_property(TARGET SDL2 APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") + set_property(TARGET SDL2 PROPERTY INTERFACE_SDL_VERSION "SDL2") endif() if(SDL_STATIC) @@ -3353,20 +3529,24 @@ if(SDL_STATIC) target_compile_definitions(SDL2-static PRIVATE SDL_STATIC_LIB) # TODO: Win32 platforms keep the same suffix .lib for import and static # libraries - do we need to consider this? - target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS}) + target_link_libraries(SDL2-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_LIBS}) target_include_directories(SDL2-static PUBLIC "$" - "$>>" + "$" + "$>/SDL2>" "$" - "$") + "$" + ) # This picks up all the compiler options and such we've accumulated up to here. target_link_libraries(SDL2-static PRIVATE $) if(NOT ANDROID) set_target_properties(SDL2-static PROPERTIES DEBUG_POSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}") endif() # Use `Compatible Interface Properties` to allow consumers to enforce a shared/static library - set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL2_SHARED FALSE) set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SDL2_SHARED) + set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL2_SHARED FALSE) + set_property(TARGET SDL2-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") + set_property(TARGET SDL2-static PROPERTY INTERFACE_SDL_VERSION "SDL2") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSDL_BUILD_MAJOR_VERSION=${SDL_MAJOR_VERSION}") @@ -3384,10 +3564,31 @@ if(SDL_TEST) EXPORT_NAME SDL2test) target_include_directories(SDL2_test PUBLIC "$" - "$>>" + "$" + "$>/SDL2>" "$" "$") target_link_libraries(SDL2_test PRIVATE ${EXTRA_TEST_LIBS}) + target_include_directories(SDL2_test PRIVATE ${EXTRA_TEST_INCLUDES}) + set_property(TARGET SDL2_test APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION") + set_property(TARGET SDL2_test PROPERTY INTERFACE_SDL_VERSION "SDL2") +endif() + +if(MSVC AND NOT SDL_LIBC) + set(targets ) + if(TARGET SDL2) + list(APPEND targets SDL2) + endif() + if(TARGET SDL2-static) + list(APPEND targets SDL2-static) + endif() + if(TARGET SDL2_test) + list(APPEND targets SDL2_test) + endif() + set_property(TARGET ${targets} APPEND PROPERTY COMPILE_OPTIONS "/GS-;/Gs1048576") + if(NOT ARCH_64 AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM") + set_property(TARGET ${targets} APPEND PROPERTY COMPILE_OPTIONS "/arch:SSE") + endif() endif() ##### Installation targets ##### @@ -3397,6 +3598,9 @@ if(NOT SDL2_DISABLE_INSTALL) LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + if(MSVC) + SDL_install_pdb(SDL2 "${CMAKE_INSTALL_BINDIR}") + endif() endif() if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN) @@ -3404,6 +3608,9 @@ if(NOT SDL2_DISABLE_INSTALL) LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + if(MSVC) + SDL_install_pdb(SDL2main "${CMAKE_INSTALL_LIBDIR}") + endif() endif() if(SDL_STATIC) @@ -3411,6 +3618,9 @@ if(NOT SDL2_DISABLE_INSTALL) LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + if(MSVC) + SDL_install_pdb(SDL2-static "${CMAKE_INSTALL_LIBDIR}") + endif() endif() if(SDL_TEST) @@ -3418,6 +3628,9 @@ if(NOT SDL2_DISABLE_INSTALL) LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + if(MSVC) + SDL_install_pdb(SDL2_test "${CMAKE_INSTALL_LIBDIR}") + endif() endif() ##### Export files ##### @@ -3492,6 +3705,7 @@ if(NOT SDL2_DISABLE_INSTALL) FILES ${CMAKE_CURRENT_BINARY_DIR}/SDL2Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/SDL2ConfigVersion.cmake + ${SDL2_SOURCE_DIR}/cmake/sdlfind.cmake DESTINATION "${SDL_INSTALL_CMAKEDIR}" COMPONENT Devel ) @@ -3499,8 +3713,8 @@ if(NOT SDL2_DISABLE_INSTALL) install( FILES ${SDL2_INCLUDE_FILES} - "${SDL2_BINARY_DIR}/include/SDL_revision.h" - "${SDL2_BINARY_DIR}/include-config-$>/SDL_config.h" + "${SDL2_BINARY_DIR}/include/SDL2/SDL_revision.h" + "${SDL2_BINARY_DIR}/include-config-$>/SDL2/SDL_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2) string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE) diff --git a/LICENSE.txt b/LICENSE.txt index 728a3d7087fd9..23abb73f2b67d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (C) 1997-2022 Sam Lantinga +Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Makefile.in b/Makefile.in index d4eeee402898b..27e0bbbf3b44e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -27,6 +27,7 @@ LDFLAGS = @BUILD_LDFLAGS@ EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ LIBTOOL = @LIBTOOL@ INSTALL = @INSTALL@ +FGREP = @FGREP@ AR = @AR@ RANLIB = @RANLIB@ RC = @RC@ @@ -51,7 +52,7 @@ WAYLAND_SCANNER_CODE_MODE = @WAYLAND_SCANNER_CODE_MODE@ INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@ -SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* mingw sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake.in src test VisualC VisualC-WinRT Xcode Xcode-iOS wayland-protocols +SRC_DIST = *.md *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac docs include Makefile.* mingw sdl2-config.cmake.in sdl2-config-version.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake.in src test VisualC VisualC-GDK VisualC-WinRT Xcode Xcode-iOS wayland-protocols GEN_DIST = SDL2.spec ifneq ($V,1) @@ -130,7 +131,7 @@ HDRS = \ begin_code.h \ close_code.h -SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test) +SDLTEST_HDRS = $(shell ls $(srcdir)/include | $(FGREP) SDL_test) LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ diff --git a/Makefile.minimal b/Makefile.minimal index 97ce201ea3352..f9c4b53cb5d18 100644 --- a/Makefile.minimal +++ b/Makefile.minimal @@ -1,7 +1,7 @@ # Makefile to build the SDL library -INCLUDE = -I./include -CFLAGS = -g -O2 $(INCLUDE) +CPPFLAGS = -I./include +CFLAGS = -g -O2 AR = ar RANLIB = ranlib diff --git a/Makefile.os2 b/Makefile.os2 index 2e38ed0d4708e..113ae2ac74c8b 100644 --- a/Makefile.os2 +++ b/Makefile.os2 @@ -1,4 +1,4 @@ -# Open Watcom makefile to build SDL2.dll for OS/2 +# Open Watcom makefile to build SDL2.dll for OS/2: # wmake -f Makefile.os2 # # If you have GNU libiconv installed (iconv2.dll), you @@ -14,7 +14,7 @@ LIBNAME = SDL2 MAJOR_VERSION = 2 -MINOR_VERSION = 26 +MINOR_VERSION = 33 MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) DESCRIPTION = Simple DirectMedia Layer 2 @@ -56,7 +56,7 @@ CFLAGS_DLL+= -bd # iconv: LIBICONV_LIB=iconv2.lib !ifeq LIBICONV 1 -CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 +CFLAGS_DLL+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DSDL_USE_LIBICONV LIBS+= $(ICONVLIB) !else LIBS+= libuls.lib libconv.lib @@ -81,7 +81,7 @@ SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c & SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c & SDL_sensor.c SDL_touch.c SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c -SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & +SRCS+= SDL_render.c yuv_rgb_sse.c yuv_rgb_std.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c & SDL_render_sw.c SDL_rotate.c SDL_triangle.c SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c & @@ -94,7 +94,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_os2joystick.c SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SDL_hidapi_steamdeck.c SDL_steam_virtual_gamepad.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c @@ -152,6 +152,8 @@ SDL_blendpoint.obj: SDL_blendpoint.c wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< SDL_RLEaccel.obj: SDL_RLEaccel.c wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< +yuv_rgb_sse.obj: yuv_rgb_sse.c + wcc386 $(CFLAGS_DLL) -wcd=202 -fo=$^@ $< !ifeq HIDAPI 1 # c99 mode needed because of structs with flexible array members in libusb.h SDL_hidapi.obj: SDL_hidapi.c diff --git a/Makefile.w32 b/Makefile.w32 index 82609036b9794..a3901beb2b439 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -1,11 +1,11 @@ -# Open Watcom makefile to build SDL2.dll for Win32 +# Open Watcom makefile to build SDL2.dll for Win32: # wmake -f Makefile.w32 # # To error out upon warnings: wmake -f Makefile.w32 ENABLE_WERROR=1 LIBNAME = SDL2 MAJOR_VERSION = 2 -MINOR_VERSION = 26 +MINOR_VERSION = 33 MICRO_VERSION = 0 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION) @@ -60,7 +60,7 @@ SRCS+= SDL_events.c SDL_quit.c SDL_keyboard.c SDL_mouse.c SDL_windowevents.c & SDL_clipboardevents.c SDL_dropevents.c SDL_displayevents.c SDL_gesture.c & SDL_sensor.c SDL_touch.c SRCS+= SDL_haptic.c SDL_hidapi.c SDL_gamecontroller.c SDL_joystick.c controller_type.c -SRCS+= SDL_render.c yuv_rgb.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & +SRCS+= SDL_render.c yuv_rgb_sse.c yuv_rgb_std.c SDL_yuv.c SDL_yuv_sw.c SDL_blendfillrect.c & SDL_blendline.c SDL_blendpoint.c SDL_drawline.c SDL_drawpoint.c & SDL_render_sw.c SDL_rotate.c SDL_triangle.c SRCS+= SDL_blit.c SDL_blit_0.c SDL_blit_1.c SDL_blit_A.c SDL_blit_auto.c & @@ -73,7 +73,7 @@ SRCS+= SDL_systimer.c SRCS+= SDL_sysloadso.c SRCS+= SDL_sysfilesystem.c SRCS+= SDL_syshaptic.c SDL_sysjoystick.c SDL_virtualjoystick.c -SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c +SRCS+= SDL_hidapijoystick.c SDL_hidapi_rumble.c SDL_hidapi_combined.c SDL_hidapi_gamecube.c SDL_hidapi_luna.c SDL_hidapi_ps3.c SDL_hidapi_ps4.c SDL_hidapi_ps5.c SDL_hidapi_shield.c SDL_hidapi_stadia.c SDL_hidapi_switch.c SDL_hidapi_wii.c SDL_hidapi_xbox360.c SDL_hidapi_xbox360w.c SDL_hidapi_xboxone.c SDL_hidapi_steam.c SDL_hidapi_steamdeck.c SRCS+= SDL_dummyaudio.c SDL_diskaudio.c SRCS+= SDL_nullvideo.c SDL_nullframebuffer.c SDL_nullevents.c SRCS+= SDL_dummysensor.c @@ -93,7 +93,7 @@ SRCS+= SDL_render_gl.c SDL_shaders_gl.c SRCS+= SDL_render_gles2.c SDL_shaders_gles2.c SRCS+= SDL_windowssensor.c SRCS+= SDL_syscond_cv.c -SRCS+= SDL_windowsclipboard.c SDL_windowsevents.c SDL_windowsframebuffer.c SDL_windowskeyboard.c SDL_windowsmessagebox.c SDL_windowsmodes.c SDL_windowsmouse.c SDL_windowsopengl.c SDL_windowsopengles.c SDL_windowsshape.c SDL_windowsvideo.c SDL_windowsvulkan.c SDL_windowswindow.c +SRCS+= SDL_windowsclipboard.c SDL_windowsevents.c SDL_windowsframebuffer.c SDL_windowskeyboard.c SDL_windowsmessagebox.c SDL_windowsmodes.c SDL_windowsmouse.c SDL_windowsopengl.c SDL_windowsopengles.c SDL_windowsshape.c SDL_windowsvideo.c SDL_windowsvulkan.c SDL_windowswindow.c SDL_steam_virtual_gamepad.c SRCS+= SDL_dynapi.c @@ -147,6 +147,9 @@ SDL_RLEaccel.obj: SDL_RLEaccel.c SDL_malloc.obj: SDL_malloc.c wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< +yuv_rgb_sse.obj: yuv_rgb_sse.c + wcc386 $(CFLAGS_DLL) -wcd=202 -fo=$^@ $< + # SDL2libm MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & k_cos.c k_rem_pio2.c k_sin.c k_tan.c & diff --git a/SDL2Config.cmake.in b/SDL2Config.cmake.in index 8c18aa5d44d8a..cc8bcf26d2750 100644 --- a/SDL2Config.cmake.in +++ b/SDL2Config.cmake.in @@ -30,6 +30,18 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake") set(SDL2_SDL2test_FOUND TRUE) endif() + +include("${CMAKE_CURRENT_LIST_DIR}/sdlfind.cmake") + +set(SDL_ALSA @SDL_ALSA@) +set(SDL_ALSA_SHARED @SDL_ALSA_SHARED@) +if(SDL_ALSA AND NOT SDL_ALSA_SHARED AND TARGET SDL2::SDL2-static) + sdlFindALSA() +endif() +unset(SDL_ALSA) +unset(SDL_ALSA_SHARED) + + check_required_components(SDL2) # Create SDL2::SDL2 alias for static-only builds @@ -62,4 +74,4 @@ if(TARGET SDL2::SDL2main) list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main) endif() -set(SDL2TEST_LIBRARY SDL2::SDL2test) \ No newline at end of file +set(SDL2TEST_LIBRARY SDL2::SDL2test) diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index c8208b41f7e86..1a1676a4ee5c4 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -173,6 +173,12 @@ Windows true + + $(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ + + + Building shader blobs (Xbox Series) + @@ -201,6 +207,12 @@ Windows true + + $(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one + + + Building shader blobs (Xbox One) + @@ -259,6 +271,12 @@ true true + + $(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ + + + Building shader blobs (Xbox Series) + @@ -288,6 +306,12 @@ true true + + $(ProjectDir)..\shaders\buildshaders.bat $(ProjectDir)..\ one + + + Building shader blobs (Xbox One) + @@ -412,6 +436,7 @@ + @@ -474,7 +499,6 @@ - @@ -519,7 +543,13 @@ + + + + + + @@ -563,7 +593,7 @@ - + @@ -601,6 +631,7 @@ + @@ -608,6 +639,7 @@ + @@ -752,7 +784,9 @@ - + + + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 02dc97ef30f0b..56494d4831c90 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -31,7 +31,7 @@ {377061e4-3856-4f05-b916-0d3b360df0f6} - + {226a6643-1c65-4c7f-92aa-861313d974bb} @@ -501,6 +501,9 @@ joystick + + joystick + joystick @@ -777,9 +780,6 @@ video\khronos\vulkan - - video\khronos\vulkan - video\khronos\vulkan @@ -925,8 +925,8 @@ file - - filesystem\windows + + filesystem\gdk haptic @@ -943,6 +943,9 @@ joystick + + joystick + libm @@ -1081,6 +1084,9 @@ joystick\hidapi + + joystick\hidapi + joystick\hidapi diff --git a/VisualC-GDK/clean.sh b/VisualC-GDK/clean.sh index a026b71a30ef3..235b79c49431c 100755 --- a/VisualC-GDK/clean.sh +++ b/VisualC-GDK/clean.sh @@ -4,3 +4,4 @@ find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -del find . -depth -type d \( -name Gaming.Desktop.x64 \) -exec rm -rv {} \; find . -depth -type d \( -name Gaming.Xbox.Scarlett.x64 \) -exec rm -rv {} \; find . -depth -type d \( -name Gaming.Xbox.XboxOne.x64 \) -exec rm -rv {} \; +rm shaders/*.h diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl new file mode 100644 index 0000000000000..47eff4cc2444e --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_Colors.hlsl @@ -0,0 +1,19 @@ +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define ColorRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + "DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + "DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + "DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0)" + +[RootSignature(ColorRS)] +float4 main(PixelShaderInput input) : SV_TARGET0 +{ + return input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl new file mode 100644 index 0000000000000..cffbc2261822c --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.5960}; + const float3 Gcoeff = {1.1644, -0.3918, -0.8130}; + const float3 Bcoeff = {1.1644, 2.0172, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl new file mode 100644 index 0000000000000..81d409c94eb2c --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.7927}; + const float3 Gcoeff = {1.1644, -0.2132, -0.5329}; + const float3 Bcoeff = {1.1644, 2.1124, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl new file mode 100644 index 0000000000000..494bce5192d3b --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {0.0, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.0000, 0.0000, 1.4020}; + const float3 Gcoeff = {1.0000, -0.3441, -0.7141}; + const float3 Bcoeff = {1.0000, 1.7720, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).rg; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl new file mode 100644 index 0000000000000..794c763728af1 --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.5960}; + const float3 Gcoeff = {1.1644, -0.3918, -0.8130}; + const float3 Bcoeff = {1.1644, 2.0172, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl new file mode 100644 index 0000000000000..f5b9522c0f8c5 --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.7927}; + const float3 Gcoeff = {1.1644, -0.2132, -0.5329}; + const float3 Bcoeff = {1.1644, 2.1124, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl new file mode 100644 index 0000000000000..1b467b480369e --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG.hlsl @@ -0,0 +1,43 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureUV : register(t1); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(NVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {0.0, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.0000, 0.0000, 1.4020}; + const float3 Gcoeff = {1.0000, -0.3441, -0.7141}; + const float3 Bcoeff = {1.0000, 1.7720, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.yz = theTextureUV.Sample(theSampler, input.tex).gr; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl new file mode 100644 index 0000000000000..0dcdf89c69bab --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_Textures.hlsl @@ -0,0 +1,24 @@ +Texture2D theTexture : register(t0); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define TextureRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(TextureRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + return theTexture.Sample(theSampler, input.tex) * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl new file mode 100644 index 0000000000000..09e58943a7f8e --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601.hlsl @@ -0,0 +1,46 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureU : register(t1); +Texture2D theTextureV : register(t2); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define YUVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(YUVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.5960}; + const float3 Gcoeff = {1.1644, -0.3918, -0.8130}; + const float3 Bcoeff = {1.1644, 2.0172, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.y = theTextureU.Sample(theSampler, input.tex).r; + yuv.z = theTextureV.Sample(theSampler, input.tex).r; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl new file mode 100644 index 0000000000000..f5aa0cd7e4abb --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709.hlsl @@ -0,0 +1,46 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureU : register(t1); +Texture2D theTextureV : register(t2); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define YUVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(YUVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {-0.0627451017, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.1644, 0.0000, 1.7927}; + const float3 Gcoeff = {1.1644, -0.2132, -0.5329}; + const float3 Bcoeff = {1.1644, 2.1124, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.y = theTextureU.Sample(theSampler, input.tex).r; + yuv.z = theTextureV.Sample(theSampler, input.tex).r; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl new file mode 100644 index 0000000000000..84d09b8bff031 --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG.hlsl @@ -0,0 +1,46 @@ +Texture2D theTextureY : register(t0); +Texture2D theTextureU : register(t1); +Texture2D theTextureV : register(t2); +SamplerState theSampler : register(s0); + +struct PixelShaderInput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define YUVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(YUVRS)] +float4 main(PixelShaderInput input) : SV_TARGET +{ + const float3 offset = {0.0, -0.501960814, -0.501960814}; + const float3 Rcoeff = {1.0000, 0.0000, 1.4020}; + const float3 Gcoeff = {1.0000, -0.3441, -0.7141}; + const float3 Bcoeff = {1.0000, 1.7720, 0.0000}; + + float4 Output; + + float3 yuv; + yuv.x = theTextureY.Sample(theSampler, input.tex).r; + yuv.y = theTextureU.Sample(theSampler, input.tex).r; + yuv.z = theTextureV.Sample(theSampler, input.tex).r; + + yuv += offset; + Output.r = dot(yuv, Rcoeff); + Output.g = dot(yuv, Gcoeff); + Output.b = dot(yuv, Bcoeff); + Output.a = 1.0f; + + return Output * input.color; +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/D3D12_VertexShader.hlsl b/VisualC-GDK/shaders/D3D12_VertexShader.hlsl new file mode 100644 index 0000000000000..e10b488925ef2 --- /dev/null +++ b/VisualC-GDK/shaders/D3D12_VertexShader.hlsl @@ -0,0 +1,95 @@ +#pragma pack_matrix( row_major ) + +struct VertexShaderConstants +{ + matrix model; + matrix projectionAndView; +}; +ConstantBuffer Constants : register(b0); + +struct VertexShaderInput +{ + float3 pos : POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +struct VertexShaderOutput +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD0; + float4 color : COLOR0; +}; + +#define ColorRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + "DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + "DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + "DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0)" + +#define TextureRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +#define YUVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t2), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +#define NVRS \ + "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ + " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ + " DENY_GEOMETRY_SHADER_ROOT_ACCESS |" \ + " DENY_HULL_SHADER_ROOT_ACCESS )," \ + "RootConstants(num32BitConstants=32, b0),"\ + "DescriptorTable ( SRV(t0), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( SRV(t1), visibility = SHADER_VISIBILITY_PIXEL ),"\ + "DescriptorTable ( Sampler(s0), visibility = SHADER_VISIBILITY_PIXEL )" + +[RootSignature(ColorRS)] +VertexShaderOutput mainColor(VertexShaderInput input) +{ + VertexShaderOutput output; + float4 pos = float4(input.pos, 1.0f); + + // Transform the vertex position into projected space. + pos = mul(pos, Constants.model); + pos = mul(pos, Constants.projectionAndView); + output.pos = pos; + + // Pass through texture coordinates and color values without transformation + output.tex = input.tex; + output.color = input.color; + + return output; +} + +[RootSignature(TextureRS)] +VertexShaderOutput mainTexture(VertexShaderInput input) +{ + return mainColor(input); +} + +[RootSignature(YUVRS)] +VertexShaderOutput mainYUV(VertexShaderInput input) +{ + return mainColor(input); +} + +[RootSignature(NVRS)] +VertexShaderOutput mainNV(VertexShaderInput input) +{ + return mainColor(input); +} \ No newline at end of file diff --git a/VisualC-GDK/shaders/buildshaders.bat b/VisualC-GDK/shaders/buildshaders.bat new file mode 100644 index 0000000000000..4447b5e2f8267 --- /dev/null +++ b/VisualC-GDK/shaders/buildshaders.bat @@ -0,0 +1,35 @@ +if %2.==one. goto setxboxone +rem Xbox Series compile +set XBOXDXC="%GameDKLatest%\GXDK\bin\Scarlett\DXC.exe" +set SUFFIX=_Series.h +goto startbuild + +:setxboxone +set XBOXDXC="%GameDKLatest%\GXDK\bin\XboxOne\DXC.exe" +set SUFFIX=_One.h + +:startbuild +echo Building with %XBOXDXC% +cd "%1\shaders" +rem Root Signatures +%XBOXDXC% -E ColorRS -T rootsig_1_1 -rootsig-define ColorRS -Fh D3D12_RootSig_Color%SUFFIX% -Vn D3D12_RootSig_Color D3D12_VertexShader.hlsl +%XBOXDXC% -E TextureRS -T rootsig_1_1 -rootsig-define TextureRS -Fh D3D12_RootSig_Texture%SUFFIX% -Vn D3D12_RootSig_Texture D3D12_VertexShader.hlsl +%XBOXDXC% -E YUVRS -T rootsig_1_1 -rootsig-define YUVRS -Fh D3D12_RootSig_YUV%SUFFIX% -Vn D3D12_RootSig_YUV D3D12_VertexShader.hlsl +%XBOXDXC% -E NVRS -T rootsig_1_1 -rootsig-define NVRS -Fh D3D12_RootSig_NV%SUFFIX% -Vn D3D12_RootSig_NV D3D12_VertexShader.hlsl +rem Vertex Shaders +%XBOXDXC% -E mainColor -T vs_6_0 -Fh D3D12_VertexShader_Color%SUFFIX% -Vn D3D12_VertexShader_Color D3D12_VertexShader.hlsl +%XBOXDXC% -E mainTexture -T vs_6_0 -Fh D3D12_VertexShader_Texture%SUFFIX% -Vn D3D12_VertexShader_Texture D3D12_VertexShader.hlsl +%XBOXDXC% -E mainNV -T vs_6_0 -Fh D3D12_VertexShader_NV%SUFFIX% -Vn D3D12_VertexShader_NV D3D12_VertexShader.hlsl +%XBOXDXC% -E mainYUV -T vs_6_0 -Fh D3D12_VertexShader_YUV%SUFFIX% -Vn D3D12_VertexShader_YUV D3D12_VertexShader.hlsl +rem Pixel Shaders +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Colors%SUFFIX% -Vn D3D12_PixelShader_Colors D3D12_PixelShader_Colors.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT601%SUFFIX% -Vn D3D12_PixelShader_NV12_BT601 D3D12_PixelShader_NV12_BT601.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_BT709%SUFFIX% -Vn D3D12_PixelShader_NV12_BT709 D3D12_PixelShader_NV12_BT709.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV12_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV12_JPEG D3D12_PixelShader_NV12_JPEG.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT601%SUFFIX% -Vn D3D12_PixelShader_NV21_BT601 D3D12_PixelShader_NV21_BT601.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_BT709%SUFFIX% -Vn D3D12_PixelShader_NV21_BT709 D3D12_PixelShader_NV21_BT709.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_NV21_JPEG%SUFFIX% -Vn D3D12_PixelShader_NV21_JPEG D3D12_PixelShader_NV21_JPEG.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_Textures%SUFFIX% -Vn D3D12_PixelShader_Textures D3D12_PixelShader_Textures.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT601%SUFFIX% -Vn D3D12_PixelShader_YUV_BT601 D3D12_PixelShader_YUV_BT601.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_BT709%SUFFIX% -Vn D3D12_PixelShader_YUV_BT709 D3D12_PixelShader_YUV_BT709.hlsl +%XBOXDXC% -E main -T ps_6_0 -Fh D3D12_PixelShader_YUV_JPEG%SUFFIX% -Vn D3D12_PixelShader_YUV_JPEG D3D12_PixelShader_YUV_JPEG.hlsl \ No newline at end of file diff --git a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj index ca6473c8cbfca..47329347888fc 100644 --- a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj +++ b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj @@ -139,7 +139,7 @@ Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -211,7 +211,7 @@ true Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -409,7 +409,7 @@ - + Document true true diff --git a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj.filters b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj.filters index 1124f2c6e605c..5f744f1685b2f 100644 --- a/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj.filters +++ b/VisualC-GDK/tests/testgamecontroller/testgamecontroller.vcxproj.filters @@ -21,7 +21,7 @@ logos - + wingdk diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp index ed69ecbeab238..21c89d25fdfd9 100644 --- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp +++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -239,17 +239,17 @@ LoadSprite(const char *file) /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h); if (!sprites[i]) { - return (-1); + return -1; } if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError()); SDL_DestroyTexture(sprites[i]); - return (-1); + return -1; } } /* We're ready to roll. :) */ - return (0); + return 0; } void @@ -364,8 +364,9 @@ loop() #endif } for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } DrawSprites(state->renderers[i], sprites[i]); } } @@ -460,7 +461,7 @@ main(int argc, char *argv[]) soundname = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (soundname == NULL) { + if (!soundname) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } diff --git a/VisualC-GDK/tests/testgdk/testgdk.vcxproj b/VisualC-GDK/tests/testgdk/testgdk.vcxproj index f024a89a56e41..a78a22741c155 100644 --- a/VisualC-GDK/tests/testgdk/testgdk.vcxproj +++ b/VisualC-GDK/tests/testgdk/testgdk.vcxproj @@ -139,7 +139,7 @@ Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -223,7 +223,7 @@ true Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\" - + Document true true diff --git a/VisualC-GDK/tests/testgdk/testgdk.vcxproj.filters b/VisualC-GDK/tests/testgdk/testgdk.vcxproj.filters index b82a989857379..436bd53ea7a1e 100644 --- a/VisualC-GDK/tests/testgdk/testgdk.vcxproj.filters +++ b/VisualC-GDK/tests/testgdk/testgdk.vcxproj.filters @@ -18,7 +18,7 @@ logos - + wingdk diff --git a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj index 651a346e53f16..54401dcab2b8c 100644 --- a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj +++ b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj @@ -139,7 +139,7 @@ Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -223,7 +223,7 @@ true Windows - xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies) + xgameruntime.lib;../Microsoft.Xbox.Services.GDK.C.Thunks.lib;%(AdditionalDependencies) @@ -352,7 +352,7 @@ copy "%(FullPath)" "$(OutDir)\" - + Document true true diff --git a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj.filters b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj.filters index e945fe5489779..83c26bf2127a3 100644 --- a/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj.filters +++ b/VisualC-GDK/tests/testsprite2/testsprite2.vcxproj.filters @@ -18,7 +18,7 @@ logos - + wingdk diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 9d7c013514b86..cff9ce712101e 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -125,6 +125,7 @@ + @@ -184,6 +185,14 @@ + + + + + + + + @@ -237,6 +246,7 @@ + @@ -344,7 +354,9 @@ true - + + + {89e9b32e-a86a-47c3-a948-d2b1622925ce} @@ -359,6 +371,7 @@ 10.0.16299.0 10.0.16299.0 10.0 + 10.0.0.0 @@ -379,7 +392,7 @@ DynamicLibrary true - v142 + v143 DynamicLibrary @@ -591,4 +604,4 @@ - + \ No newline at end of file diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 6599cdabb0ba2..0045d54760cb9 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -255,6 +255,9 @@ Source Files + + Source Files + Source Files @@ -558,6 +561,9 @@ Source Files + + Source Files + Source Files @@ -846,4 +852,4 @@ Source Files - \ No newline at end of file + diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 2c85790e2cab7..b068b3330c326 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -44,22 +44,6 @@ - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.40219.1 @@ -137,6 +121,7 @@ OldStyle true OnlyExplicitInline + true _DEBUG;%(PreprocessorDefinitions) @@ -335,6 +320,7 @@ + @@ -392,7 +378,6 @@ - @@ -437,7 +422,13 @@ + + + + + + @@ -492,6 +483,7 @@ + @@ -499,6 +491,7 @@ + @@ -620,7 +613,9 @@ - + + + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 082e257b4547c..60899f55c472c 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -501,6 +501,9 @@ joystick + + joystick + joystick @@ -777,9 +780,6 @@ video\khronos\vulkan - - video\khronos\vulkan - video\khronos\vulkan @@ -934,6 +934,9 @@ joystick + + joystick + libm @@ -1072,6 +1075,9 @@ joystick\hidapi + + joystick\hidapi + joystick\hidapi diff --git a/VisualC/pkg-support/cmake/sdl2-config.cmake b/VisualC/pkg-support/cmake/sdl2-config.cmake index 1a25259c0ea41..56d561a323e21 100644 --- a/VisualC/pkg-support/cmake/sdl2-config.cmake +++ b/VisualC/pkg-support/cmake/sdl2-config.cmake @@ -1,7 +1,7 @@ # SDL2 CMake configuration file: # This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.0...3.28) include(FeatureSummary) set_package_properties(SDL2 PROPERTIES @@ -68,6 +68,8 @@ if(EXISTS "${_sdl2_library}" AND EXISTS "${_sdl2_dll_library}") IMPORTED_LOCATION "${_sdl2_dll_library}" COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED" INTERFACE_SDL2_SHARED "ON" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2_FOUND TRUE) @@ -77,6 +79,8 @@ endif() unset(_sdl2_library) unset(_sdl2_dll_library) +set(SDL2_SDL2-static_FOUND FALSE) + set(_sdl2main_library "${SDL2_LIBDIR}/SDL2main.lib") if(EXISTS "${_sdl2main_library}") if(NOT TARGET SDL2::SDL2main) @@ -84,11 +88,13 @@ if(EXISTS "${_sdl2main_library}") set_target_properties(SDL2::SDL2main PROPERTIES IMPORTED_LOCATION "${_sdl2main_library}" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2main_FOUND TRUE) else() - set(SDL2_SDL2_FOUND FALSE) + set(SDL2_SDL2main_FOUND FALSE) endif() unset(_sdl2main_library) @@ -100,11 +106,13 @@ if(EXISTS "${_sdl2test_library}") PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" IMPORTED_LOCATION "${_sdl2test_library}" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2test_FOUND TRUE) else() - set(SDL2_SDL2_FOUND FALSE) + set(SDL2_SDL2test_FOUND FALSE) endif() unset(_sdl2test_library) diff --git a/VisualC/tests/testatomic/testatomic.vcxproj b/VisualC/tests/testatomic/testatomic.vcxproj index 25e89048e755d..772f14f1c895f 100644 --- a/VisualC/tests/testatomic/testatomic.vcxproj +++ b/VisualC/tests/testatomic/testatomic.vcxproj @@ -188,6 +188,12 @@ false true + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false diff --git a/VisualC/tests/testautomation/testautomation.vcxproj b/VisualC/tests/testautomation/testautomation.vcxproj index d58dc0b3264eb..b781dcac9169e 100644 --- a/VisualC/tests/testautomation/testautomation.vcxproj +++ b/VisualC/tests/testautomation/testautomation.vcxproj @@ -210,6 +210,7 @@ + @@ -224,6 +225,7 @@ + @@ -231,4 +233,4 @@ - + \ No newline at end of file diff --git a/VisualC/tests/testplatform/testplatform.vcxproj b/VisualC/tests/testplatform/testplatform.vcxproj index c0a7008627054..68163f6b8c010 100644 --- a/VisualC/tests/testplatform/testplatform.vcxproj +++ b/VisualC/tests/testplatform/testplatform.vcxproj @@ -216,6 +216,12 @@ false true + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false diff --git a/VisualC/tests/testpower/testpower.vcxproj b/VisualC/tests/testpower/testpower.vcxproj index 906d4350d57c0..b0f87d30e7011 100644 --- a/VisualC/tests/testpower/testpower.vcxproj +++ b/VisualC/tests/testpower/testpower.vcxproj @@ -188,6 +188,12 @@ false true + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false diff --git a/VisualC/tests/testsurround/testsurround.vcxproj b/VisualC/tests/testsurround/testsurround.vcxproj index 32860525eb621..6de4442c5018b 100644 --- a/VisualC/tests/testsurround/testsurround.vcxproj +++ b/VisualC/tests/testsurround/testsurround.vcxproj @@ -194,6 +194,12 @@ false true + + {da956fd3-e143-46f2-9fe5-c77bebc56b1a} + false + false + true + {da956fd3-e142-46f2-9dd5-c78bebb56b7a} false diff --git a/WhatsNew.txt b/WhatsNew.txt index 1f95f059257e4..90d94243db0c4 100644 --- a/WhatsNew.txt +++ b/WhatsNew.txt @@ -1,6 +1,42 @@ This is a list of major changes in SDL's version history. +--------------------------------------------------------------------------- +2.30.0: +--------------------------------------------------------------------------- + +General: +* Added support for 2 bits-per-pixel indexed surface formats +* Added the function SDL_GameControllerGetSteamHandle() to get the Steam API handle for a controller, if available +* Added the event SDL_CONTROLLERSTEAMHANDLEUPDATED which is sent when the Steam API handle for a controller changes. This could also change the name, VID, and PID of the controller. +* Added the environment variable SDL_LOGGING to control default log output + +macOS: +* Added the hint SDL_HINT_JOYSTICK_IOKIT to control whether the IOKit controller driver should be used +* Added the hint SDL_HINT_JOYSTICK_MFI to control whether the GCController controller driver should be used +* Added the hint SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE to choose whether high or low power GPU should be used for rendering, in the case where there are multiple GPUs available + +Xbox: +* Added the function SDL_GDKGetDefaultUser() + +--------------------------------------------------------------------------- +2.28.2: +--------------------------------------------------------------------------- + +General: +* Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers + + +--------------------------------------------------------------------------- +2.28.0: +--------------------------------------------------------------------------- + +General: +* Added SDL_HasWindowSurface() and SDL_DestroyWindowSurface() to switch between the window surface and rendering APIs +* Added a display event SDL_DISPLAYEVENT_MOVED which is sent when the primary monitor changes or displays change position relative to each other +* Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active + + --------------------------------------------------------------------------- 2.26.0: --------------------------------------------------------------------------- @@ -24,7 +60,7 @@ General: * Added access to the individual left and right gyro sensors of the combined Joy-Cons controller * Added a microsecond timestamp to SDL_SensorEvent and SDL_ControllerSensorEvent, when the hardware provides that information * Added SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() to retrieve the last sensor data with the associated microsecond timestamp -* Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices +* Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices * SDL_GetRevision() now includes more information about the SDL build, including the git commit hash if available Windows: @@ -645,7 +681,7 @@ iOS: tvOS: * Added support for Apple TV -* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote. +* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote. Android: * Fixed SDL not resizing window when Android screen resolution changes @@ -790,8 +826,8 @@ Linux: * Added experimental Wayland and Mir support, disabled by default Android: -* Joystick support (minimum SDK version required to build SDL is now 12, - the required runtime version remains at 10, but on such devices joystick +* Joystick support (minimum SDK version required to build SDL is now 12, + the required runtime version remains at 10, but on such devices joystick support won't be available). * Hotplugging support for joysticks * Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default. @@ -844,7 +880,7 @@ iOS: Android: IMPORTANT: You MUST get the updated SDLActivity.java to match C code -* Moved EGL initialization to native code +* Moved EGL initialization to native code * Fixed the accelerometer axis rotation relative to the device rotation * Fixed race conditions when handling the EGL context on pause/resume * Touch devices are available for enumeration immediately after init diff --git a/Xcode-iOS/Demos/src/accelerometer.c b/Xcode-iOS/Demos/src/accelerometer.c index 0af153676bd49..4c166a621ceb8 100644 --- a/Xcode-iOS/Demos/src/accelerometer.c +++ b/Xcode-iOS/Demos/src/accelerometer.c @@ -118,7 +118,7 @@ initializeTextures(SDL_Renderer *renderer) /* load the ship */ bmp_surface = SDL_LoadBMP("ship.bmp"); - if (bmp_surface == NULL) { + if (!bmp_surface) { fatalError("could not ship.bmp"); } /* set blue to transparent on the ship */ @@ -140,7 +140,7 @@ initializeTextures(SDL_Renderer *renderer) /* load the space background */ bmp_surface = SDL_LoadBMP("space.bmp"); - if (bmp_surface == NULL) { + if (!bmp_surface) { fatalError("could not load space.bmp"); } /* create space texture from surface */ @@ -179,7 +179,7 @@ main(int argc, char *argv[]) printf("There are %d joysticks available\n", SDL_NumJoysticks()); printf("Default joystick (index 0) is %s\n", SDL_JoystickName(0)); accelerometer = SDL_JoystickOpen(0); - if (accelerometer == NULL) { + if (!accelerometer) { fatalError("Could not open joystick (accelerometer)"); } printf("joystick number of axis = %d\n", diff --git a/Xcode-iOS/Demos/src/fireworks.c b/Xcode-iOS/Demos/src/fireworks.c index 600d20bbb47e8..9f444b4b2bb61 100644 --- a/Xcode-iOS/Demos/src/fireworks.c +++ b/Xcode-iOS/Demos/src/fireworks.c @@ -52,9 +52,9 @@ void spawnTrailFromEmitter(struct particle *emitter); void spawnEmitterParticle(GLfloat x, GLfloat y); void explodeEmitter(struct particle *emitter); void initializeParticles(void); -void initializeTexture(); +void initializeTexture(void); int nextPowerOfTwo(int x); -void drawParticles(); +void drawParticles(void); void stepParticles(double deltaTime); /* helper function (used in texture loading) @@ -84,14 +84,16 @@ stepParticles(double deltaTime) /* is the particle actually active, or is it marked for deletion? */ if (curr->isActive) { /* is the particle off the screen? */ - if (curr->y > screen_h) + if (curr->y > screen_h) { curr->isActive = 0; - else if (curr->y < 0) + } else if (curr->y < 0) { curr->isActive = 0; - if (curr->x > screen_w) + } + if (curr->x > screen_w) { curr->isActive = 0; - else if (curr->x < 0) + } else if (curr->x < 0) { curr->isActive = 0; + } /* step velocity, then step position */ curr->yvel += ACCEL * deltaMilliseconds; @@ -133,15 +135,17 @@ stepParticles(double deltaTime) } /* if we're a dust particle, shrink our size */ - if (curr->type == dust) + if (curr->type == dust) { curr->size -= deltaMilliseconds * 0.010f; + } } /* if we're still active, pack ourselves in the array next to the last active guy (pack the array tightly) */ - if (curr->isActive) + if (curr->isActive) { *(slot++) = *curr; + } } /* endif (curr->isActive) */ curr++; } @@ -155,7 +159,7 @@ stepParticles(double deltaTime) This draws all the particles shown on screen */ void -drawParticles() +drawParticles(void) { /* draw the background */ @@ -188,8 +192,9 @@ explodeEmitter(struct particle *emitter) int i; for (i = 0; i < 200; i++) { - if (num_active_particles >= MAX_PARTICLES) + if (num_active_particles >= MAX_PARTICLES) { return; + } /* come up with a random angle and speed for new particle */ float theta = randomFloat(0, 2.0f * 3.141592); @@ -226,8 +231,9 @@ void spawnTrailFromEmitter(struct particle *emitter) { - if (num_active_particles >= MAX_PARTICLES) + if (num_active_particles >= MAX_PARTICLES) { return; + } /* select the particle at the slot at the end of our array */ struct particle *p = &particles[num_active_particles]; @@ -262,8 +268,9 @@ void spawnEmitterParticle(GLfloat x, GLfloat y) { - if (num_active_particles >= MAX_PARTICLES) + if (num_active_particles >= MAX_PARTICLES) { return; + } /* find particle at endpoint of array */ struct particle *p = &particles[num_active_particles]; @@ -317,7 +324,7 @@ initializeParticles(void) loads the particle texture */ void -initializeTexture() +initializeTexture(void) { int bpp; /* texture bits per pixel */ @@ -327,7 +334,7 @@ initializeTexture() to format passed into OpenGL */ bmp_surface = SDL_LoadBMP("stroke.bmp"); - if (bmp_surface == NULL) { + if (!bmp_surface) { fatalError("could not load stroke.bmp"); } @@ -449,7 +456,10 @@ main(int argc, char *argv[]) while (!done) { SDL_Event event; double deltaTime = updateDeltaTime(); + SDL_bool hasEvents = SDL_FALSE; + while (SDL_PollEvent(&event)) { + hasEvents = SDL_TRUE; if (event.type == SDL_QUIT) { done = 1; } @@ -459,10 +469,17 @@ main(int argc, char *argv[]) spawnEmitterParticle(x, y); } } - stepParticles(deltaTime); - drawParticles(); - SDL_GL_SwapWindow(window); - SDL_Delay(1); + + /* Only update and render if we have active particles or just received events */ + if (num_active_particles > 0 || hasEvents) { + stepParticles(deltaTime); + drawParticles(); + SDL_GL_SwapWindow(window); + SDL_Delay(16); // Target 60 FPS when active + } else { + /* Idle state - wait for events with longer delay to save CPU */ + SDL_Delay(100); // Much longer delay when idle + } } /* delete textures */ diff --git a/Xcode-iOS/Demos/src/happy.c b/Xcode-iOS/Demos/src/happy.c index 73d4d4feb3033..163d3463f5369 100644 --- a/Xcode-iOS/Demos/src/happy.c +++ b/Xcode-iOS/Demos/src/happy.c @@ -108,7 +108,7 @@ initializeTexture(SDL_Renderer *renderer) SDL_Surface *bmp_surface; /* load the bmp */ bmp_surface = SDL_LoadBMP("icon.bmp"); - if (bmp_surface == NULL) { + if (!bmp_surface) { fatalError("could not load bmp"); } /* set white to transparent on the happyface */ diff --git a/Xcode-iOS/Demos/src/keyboard.c b/Xcode-iOS/Demos/src/keyboard.c index 4d630bae5f5ca..3e1bedf5b85f5 100644 --- a/Xcode-iOS/Demos/src/keyboard.c +++ b/Xcode-iOS/Demos/src/keyboard.c @@ -196,7 +196,7 @@ loadFont(void) } void -draw() +draw(void) { SDL_SetRenderDrawColor(renderer, bg_color.r, bg_color.g, bg_color.b, bg_color.a); SDL_RenderClear(renderer); diff --git a/Xcode-iOS/Demos/src/mixer.c b/Xcode-iOS/Demos/src/mixer.c index 18e33f134c8af..4c4ffbad08c02 100644 --- a/Xcode-iOS/Demos/src/mixer.c +++ b/Xcode-iOS/Demos/src/mixer.c @@ -207,9 +207,9 @@ playSound(struct sound *s) break; } /* if this channel's sound is older than the oldest so far, set it to oldest */ - if (mixer.channels[i].timestamp < - mixer.channels[oldest_channel].timestamp) + if (mixer.channels[i].timestamp < mixer.channels[oldest_channel].timestamp) { oldest_channel = i; + } } /* no empty channels, take the oldest one */ diff --git a/Xcode-iOS/Demos/src/touch.c b/Xcode-iOS/Demos/src/touch.c index 6c184630daf8e..4b7ff95484d5a 100644 --- a/Xcode-iOS/Demos/src/touch.c +++ b/Xcode-iOS/Demos/src/touch.c @@ -57,7 +57,7 @@ initializeTexture(SDL_Renderer *renderer) { SDL_Surface *bmp_surface; bmp_surface = SDL_LoadBMP("stroke.bmp"); - if (bmp_surface == NULL) { + if (!bmp_surface) { fatalError("could not load stroke.bmp"); } brush = diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist index 09bae6c16e89c..a383a2e7b61e4 100644 --- a/Xcode/SDL/Info-Framework.plist +++ b/Xcode/SDL/Info-Framework.plist @@ -19,10 +19,10 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.26.0 + 2.33.0 CFBundleSignature SDLX CFBundleVersion - 2.26.0 + 2.33.0 diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index b59a594fb8522..caa62eee31602 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -160,7 +160,6 @@ A75FCD1023E25AB700529352 /* SDL_uikitview.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A61923E2513D00DCD162 /* SDL_uikitview.h */; }; A75FCD1123E25AB700529352 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCD1223E25AB700529352 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */; }; - A75FCD1323E25AB700529352 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A75FCD1423E25AB700529352 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCD1523E25AB700529352 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A92E23E2514000DCD162 /* SDL_dropevents_c.h */; }; A75FCD1623E25AB700529352 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5C623E2513D00DCD162 /* SDL_haptic_c.h */; }; @@ -207,7 +206,6 @@ A75FCD4823E25AB700529352 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; }; A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; }; - A75FCD4E23E25AB700529352 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; A75FCD4F23E25AB700529352 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCD5023E25AB700529352 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; }; A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; }; @@ -283,7 +281,6 @@ A75FCDA123E25AB700529352 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; A75FCDA223E25AB700529352 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A75FCDA323E25AB700529352 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; }; - A75FCDA423E25AB700529352 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; A75FCDA523E25AB700529352 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCDA623E25AB700529352 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; }; A75FCDA723E25AB700529352 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; }; @@ -371,7 +368,6 @@ A75FCE0223E25AB700529352 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5DD23E2513D00DCD162 /* SDL_log.c */; }; A75FCE0323E25AB700529352 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */; }; A75FCE0423E25AB700529352 /* SDL_offscreenframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5F223E2513D00DCD162 /* SDL_offscreenframebuffer.c */; }; - A75FCE0523E25AB700529352 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; A75FCE0623E25AB700529352 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90123E2514000DCD162 /* SDL_render_gles.c */; }; A75FCE0723E25AB700529352 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A78623E2513E00DCD162 /* SDL_systhread.c */; }; A75FCE0823E25AB700529352 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A92F23E2514000DCD162 /* SDL_windowevents.c */; }; @@ -536,7 +532,6 @@ A75FCEC923E25AC700529352 /* SDL_uikitview.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A61923E2513D00DCD162 /* SDL_uikitview.h */; }; A75FCECA23E25AC700529352 /* SDL_bits.h in Headers */ = {isa = PBXBuildFile; fileRef = AADA5B8616CCAB3000107CF7 /* SDL_bits.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCECB23E25AC700529352 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */; }; - A75FCECC23E25AC700529352 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A75FCECD23E25AC700529352 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557CC1595D4D800BBD41B /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCECE23E25AC700529352 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A92E23E2514000DCD162 /* SDL_dropevents_c.h */; }; A75FCECF23E25AC700529352 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5C623E2513D00DCD162 /* SDL_haptic_c.h */; }; @@ -583,7 +578,6 @@ A75FCF0123E25AC700529352 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; }; A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; }; - A75FCF0723E25AC700529352 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; A75FCF0823E25AC700529352 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCF0923E25AC700529352 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; }; A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; }; @@ -659,7 +653,6 @@ A75FCF5A23E25AC700529352 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; A75FCF5B23E25AC700529352 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A75FCF5C23E25AC700529352 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; }; - A75FCF5D23E25AC700529352 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; A75FCF5E23E25AC700529352 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; }; A75FCF5F23E25AC700529352 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; }; A75FCF6023E25AC700529352 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; }; @@ -747,7 +740,6 @@ A75FCFBB23E25AC700529352 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5DD23E2513D00DCD162 /* SDL_log.c */; }; A75FCFBC23E25AC700529352 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */; }; A75FCFBD23E25AC700529352 /* SDL_offscreenframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5F223E2513D00DCD162 /* SDL_offscreenframebuffer.c */; }; - A75FCFBE23E25AC700529352 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; A75FCFBF23E25AC700529352 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90123E2514000DCD162 /* SDL_render_gles.c */; }; A75FCFC023E25AC700529352 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A78623E2513E00DCD162 /* SDL_systhread.c */; }; A75FCFC123E25AC700529352 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A92F23E2514000DCD162 /* SDL_windowevents.c */; }; @@ -947,7 +939,6 @@ A769B09623E259AE00872273 /* SDL_coremotionsensor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A57B23E2513D00DCD162 /* SDL_coremotionsensor.h */; }; A769B09723E259AE00872273 /* SDL_uikitview.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A61923E2513D00DCD162 /* SDL_uikitview.h */; }; A769B09923E259AE00872273 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */; }; - A769B09A23E259AE00872273 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A769B09C23E259AE00872273 /* SDL_dropevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A92E23E2514000DCD162 /* SDL_dropevents_c.h */; }; A769B09D23E259AE00872273 /* SDL_haptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5C623E2513D00DCD162 /* SDL_haptic_c.h */; }; A769B09F23E259AE00872273 /* SDL_dataqueue.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A57023E2513D00DCD162 /* SDL_dataqueue.h */; }; @@ -979,7 +970,6 @@ A769B0CD23E259AE00872273 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A78423E2513E00DCD162 /* SDL_systhread_c.h */; }; A769B0D023E259AE00872273 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; }; A769B0D123E259AE00872273 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; }; - A769B0D423E259AE00872273 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; A769B0D623E259AE00872273 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; }; A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; }; A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5CF23E2513D00DCD162 /* SDL_syshaptic_c.h */; }; @@ -1041,7 +1031,6 @@ A769B12923E259AE00872273 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; A769B12A23E259AE00872273 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A769B12B23E259AE00872273 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; }; - A769B12C23E259AE00872273 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; A769B12E23E259AE00872273 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; }; A769B12F23E259AE00872273 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; }; A769B13223E259AE00872273 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60A23E2513D00DCD162 /* SDL_nullvideo.h */; }; @@ -1107,7 +1096,6 @@ A769B18B23E259AE00872273 /* SDL_log.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5DD23E2513D00DCD162 /* SDL_log.c */; }; A769B18C23E259AE00872273 /* SDL_cocoaopengl.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A67F23E2513E00DCD162 /* SDL_cocoaopengl.m */; }; A769B18D23E259AE00872273 /* SDL_offscreenframebuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A5F223E2513D00DCD162 /* SDL_offscreenframebuffer.c */; }; - A769B18E23E259AE00872273 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; A769B18F23E259AE00872273 /* SDL_render_gles.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A90123E2514000DCD162 /* SDL_render_gles.c */; }; A769B19023E259AE00872273 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A78623E2513E00DCD162 /* SDL_systhread.c */; }; A769B19123E259AE00872273 /* SDL_windowevents.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A92F23E2514000DCD162 /* SDL_windowevents.c */; }; @@ -1760,10 +1748,6 @@ A7D8AC9B23E2514100DCD162 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A7D8AC9D23E2514100DCD162 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A7D8AC9E23E2514100DCD162 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; - A7D8ACA023E2514100DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; - A7D8ACA123E2514100DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; - A7D8ACA323E2514100DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; - A7D8ACA423E2514100DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A7D8ACA623E2514100DCD162 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A62923E2513D00DCD162 /* SDL_uikitview.m */; }; A7D8ACA723E2514100DCD162 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A62923E2513D00DCD162 /* SDL_uikitview.m */; }; A7D8ACA923E2514100DCD162 /* SDL_uikitview.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A62923E2513D00DCD162 /* SDL_uikitview.m */; }; @@ -2120,12 +2104,6 @@ A7D8B26923E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; }; A7D8B26A23E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; }; A7D8B26B23E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; }; - A7D8B26C23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; - A7D8B26D23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; - A7D8B26E23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; - A7D8B26F23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; - A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; - A7D8B27123E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; }; A7D8B27223E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; }; A7D8B27323E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; }; A7D8B27423E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; }; @@ -2162,12 +2140,6 @@ A7D8B29323E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; }; A7D8B29423E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; }; A7D8B29523E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; }; - A7D8B29623E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; - A7D8B29723E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; - A7D8B29823E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; - A7D8B29923E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; - A7D8B29A23E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; - A7D8B29B23E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; }; A7D8B29C23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; A7D8B29D23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; A7D8B29E23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; }; @@ -2246,12 +2218,6 @@ A7D8B3B923E2514200DCD162 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76B23E2513E00DCD162 /* SDL_blit.h */; }; A7D8B3BA23E2514200DCD162 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76B23E2513E00DCD162 /* SDL_blit.h */; }; A7D8B3BB23E2514200DCD162 /* SDL_blit.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A76B23E2513E00DCD162 /* SDL_blit.h */; }; - A7D8B3BF23E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; - A7D8B3C023E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; - A7D8B3C123E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; - A7D8B3C223E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; - A7D8B3C323E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; - A7D8B3C423E2514200DCD162 /* yuv_rgb.c in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */; }; A7D8B3C823E2514200DCD162 /* yuv_rgb_sse_func.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A77023E2513E00DCD162 /* yuv_rgb_sse_func.h */; }; A7D8B3C923E2514300DCD162 /* yuv_rgb_sse_func.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A77023E2513E00DCD162 /* yuv_rgb_sse_func.h */; }; A7D8B3CA23E2514300DCD162 /* yuv_rgb_sse_func.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A77023E2513E00DCD162 /* yuv_rgb_sse_func.h */; }; @@ -3188,7 +3154,6 @@ A7D8BBC723E2561500DCD162 /* SDL_steamcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A7A523E2513E00DCD162 /* SDL_steamcontroller.h */; }; A7D8BBCB23E2561600DCD162 /* SDL_steamcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A7A523E2513E00DCD162 /* SDL_steamcontroller.h */; }; A7D8BBCF23E2561600DCD162 /* SDL_steamcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A7A523E2513E00DCD162 /* SDL_steamcontroller.h */; }; - A7D8BBD123E2574800DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A7D8BBD223E2574800DCD162 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */; }; A7D8BBD323E2574800DCD162 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61E23E2513D00DCD162 /* SDL_uikitappdelegate.m */; }; A7D8BBD423E2574800DCD162 /* SDL_uikitclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62123E2513D00DCD162 /* SDL_uikitclipboard.h */; }; @@ -3215,7 +3180,6 @@ A7D8BBE923E2574800DCD162 /* SDL_uikitvulkan.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A62523E2513D00DCD162 /* SDL_uikitvulkan.m */; }; A7D8BBEA23E2574800DCD162 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; }; A7D8BBEB23E2574800DCD162 /* SDL_uikitwindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61A23E2513D00DCD162 /* SDL_uikitwindow.m */; }; - A7D8BBEC23E2574800DCD162 /* keyinfotable.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62823E2513D00DCD162 /* keyinfotable.h */; }; A7D8BBED23E2574800DCD162 /* SDL_uikitappdelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */; }; A7D8BBEE23E2574800DCD162 /* SDL_uikitappdelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A7D8A61E23E2513D00DCD162 /* SDL_uikitappdelegate.m */; }; A7D8BBEF23E2574800DCD162 /* SDL_uikitclipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62123E2513D00DCD162 /* SDL_uikitclipboard.h */; }; @@ -3364,6 +3328,87 @@ DB31407017554B71006C0E22 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; }; DB31407217554B71006C0E22 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; }; DB31408D17554D3C006C0E22 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; }; + F316AB852B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB862B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB872B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB882B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB892B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB8A2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB8B2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB8C2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB8D2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */; }; + F316AB8E2B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB8F2B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB902B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB912B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB922B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB932B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB942B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB952B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB962B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */; }; + F316AB972B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB982B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB992B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9A2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9B2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9C2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9D2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9E2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316AB9F2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */; }; + F316ABA02B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA12B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA22B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA32B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA42B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA52B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA62B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA72B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA82B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */; }; + F316ABA92B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAA2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAB2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAC2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAD2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAE2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABAF2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABB02B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABB12B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */; }; + F316ABB22B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB32B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB42B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB52B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB62B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB72B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB82B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABB92B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABBA2B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */ = {isa = PBXBuildFile; fileRef = F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */; }; + F316ABBB2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABBC2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABBD2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABBE2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABBF2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABC02B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABC12B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABC22B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABC32B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */; }; + F316ABC42B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABC52B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABC62B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABC72B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABC82B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABC92B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABCA2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABCB2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABCC2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */; }; + F316ABCD2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABCE2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABCF2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD02B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD12B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD22B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD32B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD42B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; + F316ABD52B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */ = {isa = PBXBuildFile; fileRef = F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */; }; F31A92C828D4CB39003BFD6A /* SDL_offscreenopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */; }; F31A92C928D4CB39003BFD6A /* SDL_offscreenopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */; }; F31A92CA28D4CB39003BFD6A /* SDL_offscreenopengles.h in Headers */ = {isa = PBXBuildFile; fileRef = F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */; }; @@ -3396,6 +3441,51 @@ F34B9895291DEFF500AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; F34B9896291DEFF700AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; F34B9897291DEFFA00AAC96E /* SDL_hidapi_steam.c in Sources */ = {isa = PBXBuildFile; fileRef = A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */; }; + F362B9322B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9332B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9342B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9352B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9362B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9372B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9382B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B9392B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B93A2B33916600D30B94 /* controller_list.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B91F2B33916600D30B94 /* controller_list.h */; }; + F362B93D2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B93E2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B93F2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9402B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9412B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9422B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9432B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9442B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9452B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */; }; + F362B9462B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B9472B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B9482B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B9492B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B94A2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B94B2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B94C2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B94D2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B94E2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */; }; + F362B9522B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9532B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9542B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9552B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9562B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9572B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9582B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B9592B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B95A2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */ = {isa = PBXBuildFile; fileRef = F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */; }; + F362B95B2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B95C2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B95D2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B95E2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B95F2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B9602B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B9612B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B9622B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; + F362B9632B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */ = {isa = PBXBuildFile; fileRef = F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */; }; F3631C6424884ACF004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; }; F3631C652488534E004F28EA /* SDL_locale.h in Headers */ = {isa = PBXBuildFile; fileRef = 566E26792462701100718109 /* SDL_locale.h */; settings = {ATTRIBUTES = (Public, ); }; }; F376F6192559B29300CFC0BC /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F376F6182559B29300CFC0BC /* OpenGLES.framework */; platformFilter = ios; }; @@ -3797,7 +3887,6 @@ A7D8A62523E2513D00DCD162 /* SDL_uikitvulkan.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitvulkan.m; sourceTree = ""; }; A7D8A62623E2513D00DCD162 /* SDL_uikitmessagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitmessagebox.h; sourceTree = ""; }; A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitwindow.h; sourceTree = ""; }; - A7D8A62823E2513D00DCD162 /* keyinfotable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyinfotable.h; sourceTree = ""; }; A7D8A62923E2513D00DCD162 /* SDL_uikitview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitview.m; sourceTree = ""; }; A7D8A62A23E2513D00DCD162 /* SDL_uikitclipboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitclipboard.m; sourceTree = ""; }; A7D8A62B23E2513D00DCD162 /* SDL_uikitopenglview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitopenglview.h; sourceTree = ""; }; @@ -3861,14 +3950,12 @@ A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_vi.h; sourceTree = ""; }; A7D8A73023E2513E00DCD162 /* vulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan.h; sourceTree = ""; }; A7D8A73123E2513E00DCD162 /* vk_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vk_platform.h; sourceTree = ""; }; - A7D8A73223E2513E00DCD162 /* vulkan.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vulkan.hpp; sourceTree = ""; }; A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_fuchsia.h; sourceTree = ""; }; A7D8A73423E2513E00DCD162 /* vulkan_wayland.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_wayland.h; sourceTree = ""; }; A7D8A73523E2513E00DCD162 /* vulkan_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_win32.h; sourceTree = ""; }; A7D8A73623E2513E00DCD162 /* vulkan_macos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_macos.h; sourceTree = ""; }; A7D8A73723E2513E00DCD162 /* vulkan_xlib_xrandr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xlib_xrandr.h; sourceTree = ""; }; A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xcb.h; sourceTree = ""; }; - A7D8A73923E2513E00DCD162 /* vulkan_mir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_mir.h; sourceTree = ""; }; A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xlib.h; sourceTree = ""; }; A7D8A73B23E2513E00DCD162 /* vulkan_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_ios.h; sourceTree = ""; }; A7D8A73C23E2513E00DCD162 /* vulkan_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_core.h; sourceTree = ""; }; @@ -3882,7 +3969,6 @@ A7D8A76923E2513E00DCD162 /* SDL_shape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_shape.c; sourceTree = ""; }; A7D8A76A23E2513E00DCD162 /* SDL_yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_yuv_c.h; sourceTree = ""; }; A7D8A76B23E2513E00DCD162 /* SDL_blit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_blit.h; sourceTree = ""; }; - A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb.c; sourceTree = ""; }; A7D8A77023E2513E00DCD162 /* yuv_rgb_sse_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_sse_func.h; sourceTree = ""; }; A7D8A77123E2513E00DCD162 /* yuv_rgb_std_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_std_func.h; sourceTree = ""; }; A7D8A77223E2513E00DCD162 /* yuv_rgb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb.h; sourceTree = ""; }; @@ -4104,9 +4190,23 @@ DB31407717554B71006C0E22 /* libSDL2.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSDL2.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; E2D187CF28A5673500D2B4F1 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL2.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E2D187D228A5673500D2B4F1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_common.h; sourceTree = ""; }; + F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_internal.h; sourceTree = ""; }; + F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb_std.c; sourceTree = ""; }; + F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb_sse.c; sourceTree = ""; }; + F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_lsx.h; sourceTree = ""; }; + F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yuv_rgb_lsx.c; sourceTree = ""; }; + F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_sse.h; sourceTree = ""; }; + F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_std.h; sourceTree = ""; }; + F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = yuv_rgb_lsx_func.h; sourceTree = ""; }; F31A92C628D4CB39003BFD6A /* SDL_offscreenopengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_offscreenopengles.h; sourceTree = ""; }; F31A92C728D4CB39003BFD6A /* SDL_offscreenopengles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_offscreenopengles.c; sourceTree = ""; }; F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_combined.c; sourceTree = ""; }; + F362B91F2B33916600D30B94 /* controller_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_list.h; sourceTree = ""; }; + F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_steamdeck.c; sourceTree = ""; }; + F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapi_nintendo.h; sourceTree = ""; }; + F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_steam_virtual_gamepad.h; sourceTree = ""; }; + F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_steam_virtual_gamepad.c; sourceTree = ""; }; F376F6182559B29300CFC0BC /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; }; F376F61A2559B2AF00CFC0BC /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/iOSSupport/System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; F376F6312559B31D00CFC0BC /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/iOSSupport/System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; @@ -4769,7 +4869,6 @@ A7D8A61823E2513D00DCD162 /* uikit */ = { isa = PBXGroup; children = ( - A7D8A62823E2513D00DCD162 /* keyinfotable.h */, A7D8A62F23E2513D00DCD162 /* SDL_uikitappdelegate.h */, A7D8A61E23E2513D00DCD162 /* SDL_uikitappdelegate.m */, A7D8A62123E2513D00DCD162 /* SDL_uikitclipboard.h */, @@ -4884,7 +4983,6 @@ A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */, A7D8A73B23E2513E00DCD162 /* vulkan_ios.h */, A7D8A73623E2513E00DCD162 /* vulkan_macos.h */, - A7D8A73923E2513E00DCD162 /* vulkan_mir.h */, A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */, A7D8A73423E2513E00DCD162 /* vulkan_wayland.h */, A7D8A73523E2513E00DCD162 /* vulkan_win32.h */, @@ -4892,7 +4990,6 @@ A7D8A73723E2513E00DCD162 /* vulkan_xlib_xrandr.h */, A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */, A7D8A73023E2513E00DCD162 /* vulkan.h */, - A7D8A73223E2513E00DCD162 /* vulkan.hpp */, ); path = vulkan; sourceTree = ""; @@ -4900,9 +4997,17 @@ A7D8A76C23E2513E00DCD162 /* yuv2rgb */ = { isa = PBXGroup; children = ( + F316AB7C2B5A02C2002EF551 /* yuv_rgb_common.h */, + F316AB7D2B5A02C2002EF551 /* yuv_rgb_internal.h */, + F316AB842B5A02C3002EF551 /* yuv_rgb_lsx_func.h */, + F316AB812B5A02C3002EF551 /* yuv_rgb_lsx.c */, + F316AB802B5A02C3002EF551 /* yuv_rgb_lsx.h */, A7D8A77023E2513E00DCD162 /* yuv_rgb_sse_func.h */, + F316AB7F2B5A02C3002EF551 /* yuv_rgb_sse.c */, + F316AB822B5A02C3002EF551 /* yuv_rgb_sse.h */, A7D8A77123E2513E00DCD162 /* yuv_rgb_std_func.h */, - A7D8A76E23E2513E00DCD162 /* yuv_rgb.c */, + F316AB7E2B5A02C3002EF551 /* yuv_rgb_std.c */, + F316AB832B5A02C3002EF551 /* yuv_rgb_std.h */, A7D8A77223E2513E00DCD162 /* yuv_rgb.h */, ); path = yuv2rgb; @@ -4950,12 +5055,15 @@ A7D8A7AA23E2513E00DCD162 /* iphoneos */, A7D8A7A123E2513E00DCD162 /* steam */, 75E09157241EA924004729E1 /* virtual */, - A7D8A7AD23E2513E00DCD162 /* SDL_gamecontroller.c */, - A7D8A7A923E2513E00DCD162 /* SDL_joystick.c */, + F362B91F2B33916600D30B94 /* controller_list.h */, F3820712284F3609004DD584 /* controller_type.c */, A7D8A7D923E2513E00DCD162 /* controller_type.h */, + A7D8A7AD23E2513E00DCD162 /* SDL_gamecontroller.c */, A7D8A79E23E2513E00DCD162 /* SDL_gamecontrollerdb.h */, A7D8A7D023E2513E00DCD162 /* SDL_joystick_c.h */, + A7D8A7A923E2513E00DCD162 /* SDL_joystick.c */, + F362B9512B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c */, + F362B9502B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h */, A7D8A7CF23E2513E00DCD162 /* SDL_sysjoystick.h */, A7D8A7CB23E2513E00DCD162 /* usb_ids.h */, ); @@ -4994,6 +5102,7 @@ F32305FE28939F6400E66D30 /* SDL_hidapi_combined.c */, A7D8A7C923E2513E00DCD162 /* SDL_hidapi_gamecube.c */, F3F07D59269640160074468B /* SDL_hidapi_luna.c */, + F362B93C2B33920400D30B94 /* SDL_hidapi_nintendo.h */, F388C95428B5F6F600661ECF /* SDL_hidapi_ps3.c */, A7D8A7C323E2513E00DCD162 /* SDL_hidapi_ps4.c */, F3A4909D2554D38500E92A8B /* SDL_hidapi_ps5.c */, @@ -5002,6 +5111,7 @@ 9846B07B287A9020000C35C8 /* SDL_hidapi_shield.c */, F3984CCF25BCC92800374F43 /* SDL_hidapi_stadia.c */, A75FDAAC23E2795C00529352 /* SDL_hidapi_steam.c */, + F362B93B2B33920400D30B94 /* SDL_hidapi_steamdeck.c */, A7D8A7C623E2513E00DCD162 /* SDL_hidapi_switch.c */, F3D60A8228C16A1800788A3A /* SDL_hidapi_wii.c */, A7D8A7C223E2513E00DCD162 /* SDL_hidapi_xbox360.c */, @@ -5393,6 +5503,7 @@ A75FCD0223E25AB700529352 /* close_code.h in Headers */, A75FCD0323E25AB700529352 /* SDL.h in Headers */, A75FCD0423E25AB700529352 /* SDL_uikitmetalview.h in Headers */, + F362B9592B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A75FCD0523E25AB700529352 /* SDL_assert.h in Headers */, A75FCD0623E25AB700529352 /* SDL_shape_internals.h in Headers */, A75FCD0723E25AB700529352 /* SDL_glfuncs.h in Headers */, @@ -5408,7 +5519,6 @@ A75FCD1023E25AB700529352 /* SDL_uikitview.h in Headers */, A75FCD1123E25AB700529352 /* SDL_bits.h in Headers */, A75FCD1223E25AB700529352 /* SDL_uikitappdelegate.h in Headers */, - A75FCD1323E25AB700529352 /* keyinfotable.h in Headers */, A75FCD1423E25AB700529352 /* SDL_blendmode.h in Headers */, A75FCD1523E25AB700529352 /* SDL_dropevents_c.h in Headers */, A75FCD1623E25AB700529352 /* SDL_haptic_c.h in Headers */, @@ -5456,6 +5566,7 @@ A75FCD4323E25AB700529352 /* SDL_keyboard.h in Headers */, A75FCD4423E25AB700529352 /* SDL_uikitevents.h in Headers */, A75FCD4523E25AB700529352 /* SDL_gesture_c.h in Headers */, + F362B9392B33916600D30B94 /* controller_list.h in Headers */, A75FCD4623E25AB700529352 /* SDL_shaders_gl.h in Headers */, A75FCD4723E25AB700529352 /* SDL_systhread_c.h in Headers */, A1BB8B7327F6CF330057CFA8 /* SDL_list.h in Headers */, @@ -5463,11 +5574,11 @@ 5616CA63252BB35F005D5928 /* SDL_sysurl.h in Headers */, A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */, - A75FCD4E23E25AB700529352 /* vulkan.hpp in Headers */, A75FCD4F23E25AB700529352 /* SDL_loadso.h in Headers */, A75FCD5023E25AB700529352 /* gl2ext.h in Headers */, A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCD5323E25AB700529352 /* SDL_syshaptic_c.h in Headers */, + F316ABC22B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A75FCD5423E25AB700529352 /* SDL_hints_c.h in Headers */, A75FCD5523E25AB700529352 /* SDL_audiodev_c.h in Headers */, A75FCD5623E25AB700529352 /* SDL_audio_c.h in Headers */, @@ -5481,6 +5592,7 @@ A75FCD5E23E25AB700529352 /* yuv_rgb_std_func.h in Headers */, A75FCD5F23E25AB700529352 /* vulkan_core.h in Headers */, A75FCD6023E25AB700529352 /* SDL_syssensor.h in Headers */, + F316ABD42B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A75FCD6123E25AB700529352 /* SDL_dynapi.h in Headers */, A75FCD6223E25AB700529352 /* SDL_assert_c.h in Headers */, A75FCD6323E25AB700529352 /* SDL_diskaudio.h in Headers */, @@ -5490,6 +5602,7 @@ A75FCD6723E25AB700529352 /* SDL_wave.h in Headers */, A75FCD6823E25AB700529352 /* SDL_cocoaopengl.h in Headers */, A75FCD6923E25AB700529352 /* yuv_rgb_sse_func.h in Headers */, + F316ABCB2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A75FCD6B23E25AB700529352 /* SDL_offscreenevents_c.h in Headers */, F3973FA928A59BDD00B84553 /* SDL_vacopy.h in Headers */, A1626A592617008D003F1973 /* SDL_triangle.h in Headers */, @@ -5513,6 +5626,8 @@ A75FCD7F23E25AB700529352 /* SDL_opengles.h in Headers */, A75FCD8023E25AB700529352 /* SDL_shaders_gles2.h in Headers */, A75FCD8123E25AB700529352 /* SDL_opengles2.h in Headers */, + F316AB8C2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, + F316ABB02B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A75FCD8223E25AB700529352 /* SDL_glesfuncs.h in Headers */, A75FCD8323E25AB700529352 /* SDL_blendpoint.h in Headers */, A75FCD8423E25AB700529352 /* SDL_offscreenvideo.h in Headers */, @@ -5542,7 +5657,6 @@ A75FCDA123E25AB700529352 /* vulkan_xlib.h in Headers */, A75FCDA223E25AB700529352 /* SDL_uikitwindow.h in Headers */, A75FCDA323E25AB700529352 /* vulkan_vi.h in Headers */, - A75FCDA423E25AB700529352 /* vulkan_mir.h in Headers */, A75FCDA523E25AB700529352 /* SDL_quit.h in Headers */, A75FCDA623E25AB700529352 /* default_cursor.h in Headers */, A75FCDA723E25AB700529352 /* SDL_render_sw_c.h in Headers */, @@ -5602,11 +5716,13 @@ A75FCDDE23E25AB700529352 /* SDL_video.h in Headers */, A75FCDDF23E25AB700529352 /* SDL_opengles2_gl2.h in Headers */, A75FCDE023E25AB700529352 /* SDL_sensor.h in Headers */, + F362B94D2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A75FCDE123E25AB700529352 /* SDL_sysvideo.h in Headers */, F386F6EE2884663E001840AA /* SDL_log_c.h in Headers */, A75FCDE223E25AB700529352 /* SDL_opengles2_gl2platform.h in Headers */, A75FCDE323E25AB700529352 /* SDL_opengles2_gl2ext.h in Headers */, A75FCDE523E25AB700529352 /* SDL_dynapi_overrides.h in Headers */, + F316AB952B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A75FCDE623E25AB700529352 /* SDL_cocoawindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5622,6 +5738,7 @@ A75FCEBB23E25AC700529352 /* close_code.h in Headers */, A75FCEBC23E25AC700529352 /* SDL.h in Headers */, A75FCEBD23E25AC700529352 /* SDL_uikitmetalview.h in Headers */, + F362B95A2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A75FCEBE23E25AC700529352 /* SDL_assert.h in Headers */, A75FCEBF23E25AC700529352 /* SDL_shape_internals.h in Headers */, A75FCEC023E25AC700529352 /* SDL_glfuncs.h in Headers */, @@ -5637,7 +5754,6 @@ A75FCEC923E25AC700529352 /* SDL_uikitview.h in Headers */, A75FCECA23E25AC700529352 /* SDL_bits.h in Headers */, A75FCECB23E25AC700529352 /* SDL_uikitappdelegate.h in Headers */, - A75FCECC23E25AC700529352 /* keyinfotable.h in Headers */, A75FCECD23E25AC700529352 /* SDL_blendmode.h in Headers */, A75FCECE23E25AC700529352 /* SDL_dropevents_c.h in Headers */, A75FCECF23E25AC700529352 /* SDL_haptic_c.h in Headers */, @@ -5685,6 +5801,7 @@ A75FCEFC23E25AC700529352 /* SDL_keyboard.h in Headers */, A75FCEFD23E25AC700529352 /* SDL_uikitevents.h in Headers */, A75FCEFE23E25AC700529352 /* SDL_gesture_c.h in Headers */, + F362B93A2B33916600D30B94 /* controller_list.h in Headers */, A75FCEFF23E25AC700529352 /* SDL_shaders_gl.h in Headers */, A75FCF0023E25AC700529352 /* SDL_systhread_c.h in Headers */, A1BB8B7427F6CF330057CFA8 /* SDL_list.h in Headers */, @@ -5692,11 +5809,11 @@ 5616CA66252BB361005D5928 /* SDL_sysurl.h in Headers */, A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */, A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */, - A75FCF0723E25AC700529352 /* vulkan.hpp in Headers */, A75FCF0823E25AC700529352 /* SDL_loadso.h in Headers */, A75FCF0923E25AC700529352 /* gl2ext.h in Headers */, A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */, A75FCF0C23E25AC700529352 /* SDL_syshaptic_c.h in Headers */, + F316ABC32B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A75FCF0D23E25AC700529352 /* SDL_hints_c.h in Headers */, A75FCF0E23E25AC700529352 /* SDL_audiodev_c.h in Headers */, A75FCF0F23E25AC700529352 /* SDL_audio_c.h in Headers */, @@ -5710,6 +5827,7 @@ A75FCF1723E25AC700529352 /* yuv_rgb_std_func.h in Headers */, A75FCF1823E25AC700529352 /* vulkan_core.h in Headers */, A75FCF1923E25AC700529352 /* SDL_syssensor.h in Headers */, + F316ABD52B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A75FCF1A23E25AC700529352 /* SDL_dynapi.h in Headers */, A75FCF1B23E25AC700529352 /* SDL_assert_c.h in Headers */, A75FCF1C23E25AC700529352 /* SDL_diskaudio.h in Headers */, @@ -5719,6 +5837,7 @@ A75FCF2023E25AC700529352 /* SDL_wave.h in Headers */, A75FCF2123E25AC700529352 /* SDL_cocoaopengl.h in Headers */, A75FCF2223E25AC700529352 /* yuv_rgb_sse_func.h in Headers */, + F316ABCC2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A75FCF2423E25AC700529352 /* SDL_offscreenevents_c.h in Headers */, F3973FAA28A59BDD00B84553 /* SDL_vacopy.h in Headers */, A1626A5A2617008D003F1973 /* SDL_triangle.h in Headers */, @@ -5742,6 +5861,8 @@ A75FCF3823E25AC700529352 /* SDL_opengles.h in Headers */, A75FCF3923E25AC700529352 /* SDL_shaders_gles2.h in Headers */, A75FCF3A23E25AC700529352 /* SDL_opengles2.h in Headers */, + F316AB8D2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, + F316ABB12B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A75FCF3B23E25AC700529352 /* SDL_glesfuncs.h in Headers */, A75FCF3C23E25AC700529352 /* SDL_blendpoint.h in Headers */, A75FCF3D23E25AC700529352 /* SDL_offscreenvideo.h in Headers */, @@ -5771,7 +5892,6 @@ A75FCF5A23E25AC700529352 /* vulkan_xlib.h in Headers */, A75FCF5B23E25AC700529352 /* SDL_uikitwindow.h in Headers */, A75FCF5C23E25AC700529352 /* vulkan_vi.h in Headers */, - A75FCF5D23E25AC700529352 /* vulkan_mir.h in Headers */, A75FCF5E23E25AC700529352 /* SDL_quit.h in Headers */, A75FCF5F23E25AC700529352 /* default_cursor.h in Headers */, A75FCF6023E25AC700529352 /* SDL_render_sw_c.h in Headers */, @@ -5831,11 +5951,13 @@ A75FCF9723E25AC700529352 /* SDL_video.h in Headers */, A75FCF9823E25AC700529352 /* SDL_opengles2_gl2.h in Headers */, A75FCF9923E25AC700529352 /* SDL_sensor.h in Headers */, + F362B94E2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A75FCF9A23E25AC700529352 /* SDL_sysvideo.h in Headers */, F386F6EF2884663E001840AA /* SDL_log_c.h in Headers */, A75FCF9B23E25AC700529352 /* SDL_opengles2_gl2platform.h in Headers */, A75FCF9C23E25AC700529352 /* SDL_opengles2_gl2ext.h in Headers */, A75FCF9E23E25AC700529352 /* SDL_dynapi_overrides.h in Headers */, + F316AB962B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A75FCF9F23E25AC700529352 /* SDL_cocoawindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5856,7 +5978,6 @@ A769B09623E259AE00872273 /* SDL_coremotionsensor.h in Headers */, A769B09723E259AE00872273 /* SDL_uikitview.h in Headers */, A769B09923E259AE00872273 /* SDL_uikitappdelegate.h in Headers */, - A769B09A23E259AE00872273 /* keyinfotable.h in Headers */, A769B09C23E259AE00872273 /* SDL_dropevents_c.h in Headers */, A769B09D23E259AE00872273 /* SDL_haptic_c.h in Headers */, A769B09F23E259AE00872273 /* SDL_dataqueue.h in Headers */, @@ -5880,6 +6001,7 @@ A769B0BC23E259AE00872273 /* SDL_sysaudio.h in Headers */, A769B0BF23E259AE00872273 /* math_libm.h in Headers */, A769B0C023E259AE00872273 /* SDL_uikitvideo.h in Headers */, + F316ABC02B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A769B0C123E259AE00872273 /* SDL_cocoamouse.h in Headers */, A769B0C323E259AE00872273 /* SDL_blit_slow.h in Headers */, F3973FA728A59BDD00B84553 /* SDL_vacopy.h in Headers */, @@ -5895,7 +6017,6 @@ A769B0D023E259AE00872273 /* SDL_cocoakeyboard.h in Headers */, 5616CA5D252BB35E005D5928 /* SDL_sysurl.h in Headers */, A769B0D123E259AE00872273 /* SDL_uikitvulkan.h in Headers */, - A769B0D423E259AE00872273 /* vulkan.hpp in Headers */, A769B0D623E259AE00872273 /* gl2ext.h in Headers */, A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */, A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */, @@ -5911,13 +6032,16 @@ A769B0E523E259AE00872273 /* vulkan_android.h in Headers */, A769B0E623E259AE00872273 /* yuv_rgb_std_func.h in Headers */, A769B0E723E259AE00872273 /* vulkan_core.h in Headers */, + F362B9572B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A769B0E823E259AE00872273 /* SDL_syssensor.h in Headers */, + F316AB8A2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, A769B0E923E259AE00872273 /* SDL_dynapi.h in Headers */, A769B0EA23E259AE00872273 /* SDL_assert_c.h in Headers */, A769B0EB23E259AE00872273 /* SDL_diskaudio.h in Headers */, A769B0ED23E259AE00872273 /* SDL_drawpoint.h in Headers */, A769B0EF23E259AE00872273 /* SDL_wave.h in Headers */, A769B0F023E259AE00872273 /* SDL_cocoaopengl.h in Headers */, + F316ABC92B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A1626A572617008D003F1973 /* SDL_triangle.h in Headers */, A769B0F123E259AE00872273 /* yuv_rgb_sse_func.h in Headers */, A769B0F323E259AE00872273 /* SDL_offscreenevents_c.h in Headers */, @@ -5938,9 +6062,11 @@ A769B10A23E259AE00872273 /* SDL_blendpoint.h in Headers */, A769B10B23E259AE00872273 /* SDL_offscreenvideo.h in Headers */, A769B10C23E259AE00872273 /* SDL_nullevents_c.h in Headers */, + F316ABD22B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A769B10D23E259AE00872273 /* SDL_sysjoystick.h in Headers */, A769B10E23E259AE00872273 /* scancodes_linux.h in Headers */, A769B11023E259AE00872273 /* SDL_touch_c.h in Headers */, + F362B94B2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A769B11123E259AE00872273 /* SDL_gamecontrollerdb.h in Headers */, A769B11223E259AE00872273 /* SDL_cocoavulkan.h in Headers */, A769B11323E259AE00872273 /* gl2platform.h in Headers */, @@ -5952,6 +6078,7 @@ A769B11D23E259AE00872273 /* vulkan_xlib_xrandr.h in Headers */, A769B11E23E259AE00872273 /* SDL_sensor_c.h in Headers */, A769B11F23E259AE00872273 /* SDL_sysrender.h in Headers */, + F316AB932B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A769B12023E259AE00872273 /* SDL_rotate.h in Headers */, A769B12523E259AE00872273 /* scancodes_darwin.h in Headers */, A769B12623E259AE00872273 /* controller_type.h in Headers */, @@ -5960,7 +6087,6 @@ F386F6F52884663E001840AA /* SDL_utils_c.h in Headers */, A769B12A23E259AE00872273 /* SDL_uikitwindow.h in Headers */, A769B12B23E259AE00872273 /* vulkan_vi.h in Headers */, - A769B12C23E259AE00872273 /* vulkan_mir.h in Headers */, A769B12E23E259AE00872273 /* default_cursor.h in Headers */, A769B12F23E259AE00872273 /* SDL_render_sw_c.h in Headers */, A769B13223E259AE00872273 /* SDL_nullvideo.h in Headers */, @@ -5997,11 +6123,13 @@ A769B15623E259AE00872273 /* SDL_syshaptic.h in Headers */, A769B15723E259AE00872273 /* SDL_vulkan_internal.h in Headers */, A769B15923E259AE00872273 /* SDL_cocoaevents.h in Headers */, + F362B9372B33916600D30B94 /* controller_list.h in Headers */, A769B15A23E259AE00872273 /* vk_icd.h in Headers */, A769B15B23E259AE00872273 /* SDL_nullframebuffer_c.h in Headers */, A769B15D23E259AE00872273 /* SDL_dynapi_procs.h in Headers */, A769B15E23E259AE00872273 /* vulkan_fuchsia.h in Headers */, A769B16123E259AE00872273 /* usb_ids.h in Headers */, + F316ABAE2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A769B16323E259AE00872273 /* SDL_gles2funcs.h in Headers */, A769B16923E259AE00872273 /* SDL_sysvideo.h in Headers */, A769B16D23E259AE00872273 /* SDL_dynapi_overrides.h in Headers */, @@ -6024,6 +6152,7 @@ A7D88A1E23E2437C00DCD162 /* SDL_bits.h in Headers */, A7D8BA0223E2514400DCD162 /* SDL_blendfillrect.h in Headers */, A7D8B9EA23E2514400DCD162 /* SDL_blendline.h in Headers */, + F316ABC52B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A7D88A1F23E2437C00DCD162 /* SDL_blendmode.h in Headers */, A7D8BA0E23E2514400DCD162 /* SDL_blendpoint.h in Headers */, A7D8B3B723E2514200DCD162 /* SDL_blit.h in Headers */, @@ -6059,6 +6188,7 @@ A7D8BB4023E2514500DCD162 /* SDL_displayevents_c.h in Headers */, A7D8BA1A23E2514400DCD162 /* SDL_draw.h in Headers */, A7D8BA0823E2514400DCD162 /* SDL_drawline.h in Headers */, + F316ABBC2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8B9F023E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2E23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79523E2514400DCD162 /* SDL_dummyaudio.h in Headers */, @@ -6083,14 +6213,17 @@ A7D8BA7A23E2514400DCD162 /* SDL_glfuncs.h in Headers */, A7D88A2D23E2437C00DCD162 /* SDL_haptic.h in Headers */, A7D8AABD23E2514100DCD162 /* SDL_haptic_c.h in Headers */, + F316AB8F2B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A75FDBC623EA380300529352 /* SDL_hidapi_rumble.h in Headers */, A7D8B55823E2514300DCD162 /* SDL_hidapijoystick_c.h in Headers */, A7D88A2E23E2437C00DCD162 /* SDL_hints.h in Headers */, A7D8B94B23E2514400DCD162 /* SDL_hints_c.h in Headers */, + F316ABCE2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8A99A23E2514000DCD162 /* SDL_internal.h in Headers */, F395C1942569C68F00942BFF /* SDL_iokitjoystick_c.h in Headers */, A7D88A2F23E2437C00DCD162 /* SDL_joystick.h in Headers */, A7D8B58823E2514300DCD162 /* SDL_joystick_c.h in Headers */, + F316AB862B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, A7D88A3023E2437C00DCD162 /* SDL_keyboard.h in Headers */, A7D8BB8823E2514500DCD162 /* SDL_keyboard_c.h in Headers */, A7D88A3323E2437C00DCD162 /* SDL_keycode.h in Headers */, @@ -6161,6 +6294,8 @@ A7D8B5D623E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B61223E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B9D823E2514400DCD162 /* SDL_sysrender.h in Headers */, + F362B9472B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, + F316ABAA2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8A97C23E2514000DCD162 /* SDL_syssensor.h in Headers */, A7D88A5323E2437C00DCD162 /* SDL_system.h in Headers */, A7D8B3E723E2514300DCD162 /* SDL_systhread.h in Headers */, @@ -6199,6 +6334,7 @@ A7D8B9CC23E2514400DCD162 /* SDL_yuv_sw_c.h in Headers */, A7D88A1623E2437C00DCD162 /* begin_code.h in Headers */, A7D8BB4623E2514500DCD162 /* blank_cursor.h in Headers */, + F362B9532B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A7D88A1823E2437C00DCD162 /* close_code.h in Headers */, A7D8B5B823E2514300DCD162 /* controller_type.h in Headers */, A7D8BB4C23E2514500DCD162 /* default_cursor.h in Headers */, @@ -6209,7 +6345,6 @@ A7D8B22523E2514200DCD162 /* gl2ext.h in Headers */, A7D8B23123E2514200DCD162 /* gl2platform.h in Headers */, A75FDB5923E39E6100529352 /* hidapi.h in Headers */, - A7D8ACA023E2514100DCD162 /* keyinfotable.h in Headers */, A7D8B23723E2514200DCD162 /* khrplatform.h in Headers */, A7D8BB0423E2514500DCD162 /* math_libm.h in Headers */, A7D8BAC223E2514500DCD162 /* math_private.h in Headers */, @@ -6224,16 +6359,15 @@ A7D8B26723E2514200DCD162 /* vk_platform.h in Headers */, A7D8B2AF23E2514200DCD162 /* vk_sdk_platform.h in Headers */, A7D8B26123E2514200DCD162 /* vulkan.h in Headers */, - A7D8B26D23E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B2B523E2514200DCD162 /* vulkan_android.h in Headers */, A7D8B2A923E2514200DCD162 /* vulkan_core.h in Headers */, A7D8B27323E2514200DCD162 /* vulkan_fuchsia.h in Headers */, A7D8B2A323E2514200DCD162 /* vulkan_ios.h in Headers */, A7D8B28523E2514200DCD162 /* vulkan_macos.h in Headers */, - A7D8B29723E2514200DCD162 /* vulkan_mir.h in Headers */, A7D8B25B23E2514200DCD162 /* vulkan_vi.h in Headers */, A7D8B27923E2514200DCD162 /* vulkan_wayland.h in Headers */, A7D8B27F23E2514200DCD162 /* vulkan_win32.h in Headers */, + F362B9332B33916600D30B94 /* controller_list.h in Headers */, A7D8B29123E2514200DCD162 /* vulkan_xcb.h in Headers */, A7D8B29D23E2514200DCD162 /* vulkan_xlib.h in Headers */, A7D8B28B23E2514200DCD162 /* vulkan_xlib_xrandr.h in Headers */, @@ -6258,6 +6392,7 @@ A7D88BD523E24BED00DCD162 /* SDL_bits.h in Headers */, A7D8BA0323E2514400DCD162 /* SDL_blendfillrect.h in Headers */, A7D8B9EB23E2514400DCD162 /* SDL_blendline.h in Headers */, + F316ABC62B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A7D88BD623E24BED00DCD162 /* SDL_blendmode.h in Headers */, A7D8BA0F23E2514400DCD162 /* SDL_blendpoint.h in Headers */, A7D8B3B823E2514200DCD162 /* SDL_blit.h in Headers */, @@ -6293,6 +6428,7 @@ A7D8BB4123E2514500DCD162 /* SDL_displayevents_c.h in Headers */, A7D8BA1B23E2514400DCD162 /* SDL_draw.h in Headers */, A7D8BA0923E2514400DCD162 /* SDL_drawline.h in Headers */, + F316ABBD2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8B9F123E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2F23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79623E2514400DCD162 /* SDL_dummyaudio.h in Headers */, @@ -6317,14 +6453,17 @@ A7D8BA7B23E2514400DCD162 /* SDL_glfuncs.h in Headers */, A7D88BE423E24BED00DCD162 /* SDL_haptic.h in Headers */, A7D8AABE23E2514100DCD162 /* SDL_haptic_c.h in Headers */, + F316AB902B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A75FDBC723EA380300529352 /* SDL_hidapi_rumble.h in Headers */, A7D8B55923E2514300DCD162 /* SDL_hidapijoystick_c.h in Headers */, A7D88BE523E24BED00DCD162 /* SDL_hints.h in Headers */, A7D8B94C23E2514400DCD162 /* SDL_hints_c.h in Headers */, + F316ABCF2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8A99B23E2514000DCD162 /* SDL_internal.h in Headers */, F395C1952569C68F00942BFF /* SDL_iokitjoystick_c.h in Headers */, A7D88BE623E24BED00DCD162 /* SDL_joystick.h in Headers */, A7D8B58923E2514300DCD162 /* SDL_joystick_c.h in Headers */, + F316AB872B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, A7D88BE723E24BED00DCD162 /* SDL_keyboard.h in Headers */, A7D8BB8923E2514500DCD162 /* SDL_keyboard_c.h in Headers */, A7D88BEB23E24BED00DCD162 /* SDL_keycode.h in Headers */, @@ -6395,6 +6534,8 @@ A7D8B5D723E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B61323E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B9D923E2514400DCD162 /* SDL_sysrender.h in Headers */, + F362B9482B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, + F316ABAB2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8A97D23E2514000DCD162 /* SDL_syssensor.h in Headers */, A7D88C0E23E24BED00DCD162 /* SDL_system.h in Headers */, A7D8B3E823E2514300DCD162 /* SDL_systhread.h in Headers */, @@ -6433,6 +6574,7 @@ A7D8B9CD23E2514400DCD162 /* SDL_yuv_sw_c.h in Headers */, A7D88BCC23E24BED00DCD162 /* begin_code.h in Headers */, A7D8BB4723E2514500DCD162 /* blank_cursor.h in Headers */, + F362B9542B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A7D88BCE23E24BED00DCD162 /* close_code.h in Headers */, A7D8B5B923E2514300DCD162 /* controller_type.h in Headers */, A7D8BB4D23E2514500DCD162 /* default_cursor.h in Headers */, @@ -6443,7 +6585,6 @@ A7D8B22623E2514200DCD162 /* gl2ext.h in Headers */, A7D8B23223E2514200DCD162 /* gl2platform.h in Headers */, A75FDB5A23E39E6100529352 /* hidapi.h in Headers */, - A7D8ACA123E2514100DCD162 /* keyinfotable.h in Headers */, A7D8B23823E2514200DCD162 /* khrplatform.h in Headers */, A7D8BB0523E2514500DCD162 /* math_libm.h in Headers */, A7D8BAC323E2514500DCD162 /* math_private.h in Headers */, @@ -6458,16 +6599,15 @@ A7D8B26823E2514200DCD162 /* vk_platform.h in Headers */, A7D8B2B023E2514200DCD162 /* vk_sdk_platform.h in Headers */, A7D8B26223E2514200DCD162 /* vulkan.h in Headers */, - A7D8B26E23E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B2B623E2514200DCD162 /* vulkan_android.h in Headers */, A7D8B2AA23E2514200DCD162 /* vulkan_core.h in Headers */, A7D8B27423E2514200DCD162 /* vulkan_fuchsia.h in Headers */, A7D8B2A423E2514200DCD162 /* vulkan_ios.h in Headers */, A7D8B28623E2514200DCD162 /* vulkan_macos.h in Headers */, - A7D8B29823E2514200DCD162 /* vulkan_mir.h in Headers */, A7D8B25C23E2514200DCD162 /* vulkan_vi.h in Headers */, A7D8B27A23E2514200DCD162 /* vulkan_wayland.h in Headers */, A7D8B28023E2514200DCD162 /* vulkan_win32.h in Headers */, + F362B9342B33916600D30B94 /* controller_list.h in Headers */, A7D8B29223E2514200DCD162 /* vulkan_xcb.h in Headers */, A7D8B29E23E2514200DCD162 /* vulkan_xlib.h in Headers */, A7D8B28C23E2514200DCD162 /* vulkan_xlib_xrandr.h in Headers */, @@ -6493,7 +6633,6 @@ A7D8A97323E2514000DCD162 /* SDL_coremotionsensor.h in Headers */, A7D8AC4923E2514100DCD162 /* SDL_uikitview.h in Headers */, A7D8ACCD23E2514100DCD162 /* SDL_uikitappdelegate.h in Headers */, - A7D8ACA323E2514100DCD162 /* keyinfotable.h in Headers */, A7D8BB3123E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8AAC023E2514100DCD162 /* SDL_haptic_c.h in Headers */, A7D8A94923E2514000DCD162 /* SDL_dataqueue.h in Headers */, @@ -6517,6 +6656,7 @@ A7D8B85E23E2514400DCD162 /* SDL_sysaudio.h in Headers */, A7D8BB0723E2514500DCD162 /* math_libm.h in Headers */, A7D8AC7F23E2514100DCD162 /* SDL_uikitvideo.h in Headers */, + F316ABBF2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8AF2223E2514100DCD162 /* SDL_cocoamouse.h in Headers */, A7D8ADF023E2514100DCD162 /* SDL_blit_slow.h in Headers */, F3973FA628A59BDD00B84553 /* SDL_vacopy.h in Headers */, @@ -6532,7 +6672,6 @@ A7D8AE9223E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */, 5616CA5A252BB35D005D5928 /* SDL_sysurl.h in Headers */, A7D8ACE523E2514100DCD162 /* SDL_uikitvulkan.h in Headers */, - A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B22823E2514200DCD162 /* gl2ext.h in Headers */, A7D8BB7323E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8AAE423E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, @@ -6548,13 +6687,16 @@ A7D8B2B823E2514200DCD162 /* vulkan_android.h in Headers */, A7D8B3D223E2514300DCD162 /* yuv_rgb_std_func.h in Headers */, A7D8B2AC23E2514200DCD162 /* vulkan_core.h in Headers */, + F362B9562B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A7D8A97F23E2514000DCD162 /* SDL_syssensor.h in Headers */, + F316AB892B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, A7D8AB0E23E2514100DCD162 /* SDL_dynapi.h in Headers */, A7D8B61B23E2514300DCD162 /* SDL_assert_c.h in Headers */, A7D8B8A623E2514400DCD162 /* SDL_diskaudio.h in Headers */, A7D8B9F323E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8B87023E2514400DCD162 /* SDL_wave.h in Headers */, A7D8AEE023E2514100DCD162 /* SDL_cocoaopengl.h in Headers */, + F316ABC82B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A1626A562617008D003F1973 /* SDL_triangle.h in Headers */, A7D8B3CC23E2514300DCD162 /* yuv_rgb_sse_func.h in Headers */, A7D8AB5F23E2514100DCD162 /* SDL_offscreenevents_c.h in Headers */, @@ -6575,9 +6717,11 @@ A7D8BA1123E2514400DCD162 /* SDL_blendpoint.h in Headers */, A7D8AB7123E2514100DCD162 /* SDL_offscreenvideo.h in Headers */, A7D8AC0123E2514100DCD162 /* SDL_nullevents_c.h in Headers */, + F316ABD12B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8B58523E2514300DCD162 /* SDL_sysjoystick.h in Headers */, A7D8BB6123E2514500DCD162 /* scancodes_linux.h in Headers */, A7D8BB6723E2514500DCD162 /* SDL_touch_c.h in Headers */, + F362B94A2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A7D8B4B023E2514300DCD162 /* SDL_gamecontrollerdb.h in Headers */, A7D8AEEC23E2514100DCD162 /* SDL_cocoavulkan.h in Headers */, A7D8B23423E2514200DCD162 /* gl2platform.h in Headers */, @@ -6589,6 +6733,7 @@ A7D8B28E23E2514200DCD162 /* vulkan_xlib_xrandr.h in Headers */, A7D8A99123E2514000DCD162 /* SDL_sensor_c.h in Headers */, A7D8B9DB23E2514400DCD162 /* SDL_sysrender.h in Headers */, + F316AB922B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A7D8BA3523E2514400DCD162 /* SDL_rotate.h in Headers */, A7D8BB5523E2514500DCD162 /* scancodes_darwin.h in Headers */, A7D8B5BB23E2514300DCD162 /* controller_type.h in Headers */, @@ -6597,7 +6742,6 @@ F386F6F42884663E001840AA /* SDL_utils_c.h in Headers */, A7D8AC9D23E2514100DCD162 /* SDL_uikitwindow.h in Headers */, A7D8B25E23E2514200DCD162 /* vulkan_vi.h in Headers */, - A7D8B29A23E2514200DCD162 /* vulkan_mir.h in Headers */, A7D8BB4F23E2514500DCD162 /* default_cursor.h in Headers */, A7D8B9FF23E2514400DCD162 /* SDL_render_sw_c.h in Headers */, A7D8ABFB23E2514100DCD162 /* SDL_nullvideo.h in Headers */, @@ -6634,11 +6778,13 @@ A7D8AAD823E2514100DCD162 /* SDL_syshaptic.h in Headers */, A7D8AD2123E2514100DCD162 /* SDL_vulkan_internal.h in Headers */, A7D8AF1623E2514100DCD162 /* SDL_cocoaevents.h in Headers */, + F362B9362B33916600D30B94 /* controller_list.h in Headers */, A7D8B25823E2514200DCD162 /* vk_icd.h in Headers */, A7D8ABE923E2514100DCD162 /* SDL_nullframebuffer_c.h in Headers */, A7D8AB2023E2514100DCD162 /* SDL_dynapi_procs.h in Headers */, A7D8B27623E2514200DCD162 /* vulkan_fuchsia.h in Headers */, A7D8B57323E2514300DCD162 /* usb_ids.h in Headers */, + F316ABAD2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8BA5923E2514400DCD162 /* SDL_gles2funcs.h in Headers */, A7D8AC4323E2514100DCD162 /* SDL_sysvideo.h in Headers */, A7D8AB1423E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, @@ -6661,6 +6807,7 @@ AADA5B8716CCAB3000107CF7 /* SDL_bits.h in Headers */, A7D8BA0123E2514400DCD162 /* SDL_blendfillrect.h in Headers */, A7D8B9E923E2514400DCD162 /* SDL_blendline.h in Headers */, + F316ABC42B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, AA7558041595D4D800BBD41B /* SDL_blendmode.h in Headers */, A7D8BA0D23E2514400DCD162 /* SDL_blendpoint.h in Headers */, A7D8B3B623E2514200DCD162 /* SDL_blit.h in Headers */, @@ -6696,6 +6843,7 @@ A7D8BB3F23E2514500DCD162 /* SDL_displayevents_c.h in Headers */, A7D8BA1923E2514400DCD162 /* SDL_draw.h in Headers */, A7D8BA0723E2514400DCD162 /* SDL_drawline.h in Headers */, + F316ABBB2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8B9EF23E2514400DCD162 /* SDL_drawpoint.h in Headers */, A7D8BB2D23E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8B79423E2514400DCD162 /* SDL_dummyaudio.h in Headers */, @@ -6720,14 +6868,17 @@ A7D8BA7923E2514400DCD162 /* SDL_glfuncs.h in Headers */, AA7558181595D4D800BBD41B /* SDL_haptic.h in Headers */, A7D8AABC23E2514100DCD162 /* SDL_haptic_c.h in Headers */, + F316AB8E2B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A75FDBC523EA380300529352 /* SDL_hidapi_rumble.h in Headers */, A7D8B55723E2514300DCD162 /* SDL_hidapijoystick_c.h in Headers */, AA75581A1595D4D800BBD41B /* SDL_hints.h in Headers */, A7D8B94A23E2514400DCD162 /* SDL_hints_c.h in Headers */, + F316ABCD2B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8A99923E2514000DCD162 /* SDL_internal.h in Headers */, F395C1932569C68F00942BFF /* SDL_iokitjoystick_c.h in Headers */, AA75581E1595D4D800BBD41B /* SDL_joystick.h in Headers */, A7D8B58723E2514300DCD162 /* SDL_joystick_c.h in Headers */, + F316AB852B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, AA7558201595D4D800BBD41B /* SDL_keyboard.h in Headers */, A7D8BB8723E2514500DCD162 /* SDL_keyboard_c.h in Headers */, AA7558221595D4D800BBD41B /* SDL_keycode.h in Headers */, @@ -6798,6 +6949,8 @@ A7D8B5D523E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B61123E2514300DCD162 /* SDL_syspower.h in Headers */, A7D8B9D723E2514400DCD162 /* SDL_sysrender.h in Headers */, + F362B9462B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, + F316ABA92B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8A97B23E2514000DCD162 /* SDL_syssensor.h in Headers */, AA75584E1595D4D800BBD41B /* SDL_system.h in Headers */, A7D8B3E623E2514300DCD162 /* SDL_systhread.h in Headers */, @@ -6836,6 +6989,7 @@ A7D8B9CB23E2514400DCD162 /* SDL_yuv_sw_c.h in Headers */, AA7557FA1595D4D800BBD41B /* begin_code.h in Headers */, A7D8BB4523E2514500DCD162 /* blank_cursor.h in Headers */, + F362B9522B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, AA7557FC1595D4D800BBD41B /* close_code.h in Headers */, A7D8B5B723E2514300DCD162 /* controller_type.h in Headers */, A7D8BB4B23E2514500DCD162 /* default_cursor.h in Headers */, @@ -6846,7 +7000,6 @@ A7D8B22423E2514200DCD162 /* gl2ext.h in Headers */, A7D8B23023E2514200DCD162 /* gl2platform.h in Headers */, A75FDB5823E39E6100529352 /* hidapi.h in Headers */, - A7D8BBD123E2574800DCD162 /* keyinfotable.h in Headers */, A7D8B23623E2514200DCD162 /* khrplatform.h in Headers */, A7D8BB0323E2514500DCD162 /* math_libm.h in Headers */, A7D8BAC123E2514500DCD162 /* math_private.h in Headers */, @@ -6861,16 +7014,15 @@ A7D8B26623E2514200DCD162 /* vk_platform.h in Headers */, A7D8B2AE23E2514200DCD162 /* vk_sdk_platform.h in Headers */, A7D8B26023E2514200DCD162 /* vulkan.h in Headers */, - A7D8B26C23E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B2B423E2514200DCD162 /* vulkan_android.h in Headers */, A7D8B2A823E2514200DCD162 /* vulkan_core.h in Headers */, A7D8B27223E2514200DCD162 /* vulkan_fuchsia.h in Headers */, A7D8B2A223E2514200DCD162 /* vulkan_ios.h in Headers */, A7D8B28423E2514200DCD162 /* vulkan_macos.h in Headers */, - A7D8B29623E2514200DCD162 /* vulkan_mir.h in Headers */, A7D8B25A23E2514200DCD162 /* vulkan_vi.h in Headers */, A7D8B27823E2514200DCD162 /* vulkan_wayland.h in Headers */, A7D8B27E23E2514200DCD162 /* vulkan_win32.h in Headers */, + F362B9322B33916600D30B94 /* controller_list.h in Headers */, A7D8B29023E2514200DCD162 /* vulkan_xcb.h in Headers */, A7D8B29C23E2514200DCD162 /* vulkan_xlib.h in Headers */, A7D8B28A23E2514200DCD162 /* vulkan_xlib_xrandr.h in Headers */, @@ -6885,9 +7037,11 @@ buildActionMask = 2147483647; files = ( A7D8B9A423E2514400DCD162 /* SDL_shaders_metal_tvos.h in Headers */, + F316ABBE2B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8AC0C23E2514100DCD162 /* SDL_shape_internals.h in Headers */, A7D8BA7C23E2514400DCD162 /* SDL_glfuncs.h in Headers */, A7D8AC0623E2514100DCD162 /* SDL_rect_c.h in Headers */, + F362B9352B33916600D30B94 /* controller_list.h in Headers */, 75E09166241EA924004729E1 /* SDL_virtualjoystick_c.h in Headers */, A7D8B99E23E2514400DCD162 /* SDL_shaders_metal_osx.h in Headers */, A7D8B98F23E2514400DCD162 /* SDL_shaders_metal_ios.h in Headers */, @@ -6904,7 +7058,9 @@ A7D8B3EF23E2514300DCD162 /* SDL_thread_c.h in Headers */, A7D8AF0923E2514100DCD162 /* SDL_cocoamessagebox.h in Headers */, A7D8BA0423E2514400DCD162 /* SDL_blendfillrect.h in Headers */, + F362B9552B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, A7D8B55A23E2514300DCD162 /* SDL_hidapijoystick_c.h in Headers */, + F316ABAC2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8B2C323E2514200DCD162 /* SDL_pixels_c.h in Headers */, A7D8B58A23E2514300DCD162 /* SDL_joystick_c.h in Headers */, A75FDB5B23E39E6100529352 /* hidapi.h in Headers */, @@ -6919,13 +7075,13 @@ A7D8B9CE23E2514400DCD162 /* SDL_yuv_sw_c.h in Headers */, A7D8BBFD23E2574800DCD162 /* SDL_uikitvideo.h in Headers */, A7D8BBAE23E2514500DCD162 /* SDL_windowevents_c.h in Headers */, + F316AB912B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A7D8AF0323E2514100DCD162 /* SDL_cocoavideo.h in Headers */, A7D8BB3C23E2514500DCD162 /* SDL_gesture_c.h in Headers */, A7D8BBEF23E2574800DCD162 /* SDL_uikitclipboard.h in Headers */, A7D8BA7623E2514400DCD162 /* SDL_shaders_gl.h in Headers */, A7D8B42B23E2514300DCD162 /* SDL_systhread_c.h in Headers */, A7D8AE9123E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */, - A7D8B26F23E2514200DCD162 /* vulkan.hpp in Headers */, A7D8B22723E2514200DCD162 /* gl2ext.h in Headers */, A7D8BB7223E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8AAE323E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, @@ -6962,6 +7118,7 @@ A7D8BBF123E2574800DCD162 /* SDL_uikitevents.h in Headers */, A7D8BBFF23E2574800DCD162 /* SDL_uikitview.h in Headers */, A7D8BBA823E2514500DCD162 /* SDL_events_c.h in Headers */, + F316ABC72B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A7D8BAC423E2514500DCD162 /* math_private.h in Headers */, A7D8B27B23E2514200DCD162 /* vulkan_wayland.h in Headers */, A7D8BBF523E2574800DCD162 /* SDL_uikitmetalview.h in Headers */, @@ -6969,7 +7126,6 @@ A7D8BA5223E2514400DCD162 /* SDL_shaders_gles2.h in Headers */, A7D8BA4623E2514400DCD162 /* SDL_glesfuncs.h in Headers */, A7D8BA1023E2514400DCD162 /* SDL_blendpoint.h in Headers */, - A7D8BBEC23E2574800DCD162 /* keyinfotable.h in Headers */, A7D8AB7023E2514100DCD162 /* SDL_offscreenvideo.h in Headers */, A7D8AC0023E2514100DCD162 /* SDL_nullevents_c.h in Headers */, A7D8B58423E2514300DCD162 /* SDL_sysjoystick.h in Headers */, @@ -6995,11 +7151,12 @@ A7D8B5BA23E2514300DCD162 /* controller_type.h in Headers */, A7D8B29F23E2514200DCD162 /* vulkan_xlib.h in Headers */, A7D8B25D23E2514200DCD162 /* vulkan_vi.h in Headers */, - A7D8B29923E2514200DCD162 /* vulkan_mir.h in Headers */, + F316AB882B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, A1BB8B6F27F6CF330057CFA8 /* SDL_list.h in Headers */, A7D8BB4E23E2514500DCD162 /* default_cursor.h in Headers */, A7D8B9FE23E2514400DCD162 /* SDL_render_sw_c.h in Headers */, A7D8BBED23E2574800DCD162 /* SDL_uikitappdelegate.h in Headers */, + F362B9492B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A7D8BBF923E2574800DCD162 /* SDL_uikitopengles.h in Headers */, F31A92CC28D4CB39003BFD6A /* SDL_offscreenopengles.h in Headers */, A7D8ABFA23E2514100DCD162 /* SDL_nullvideo.h in Headers */, @@ -7020,6 +7177,7 @@ A7D8BB2423E2514500DCD162 /* scancodes_windows.h in Headers */, A7D8B5C623E2514300DCD162 /* SDL_rwopsbundlesupport.h in Headers */, A7D8B61423E2514300DCD162 /* SDL_syspower.h in Headers */, + F316ABD02B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8B28723E2514200DCD162 /* vulkan_macos.h in Headers */, A7D8B29323E2514200DCD162 /* vulkan_xcb.h in Headers */, A7D8B2A523E2514200DCD162 /* vulkan_ios.h in Headers */, @@ -7059,6 +7217,7 @@ DB313FC917554B71006C0E22 /* close_code.h in Headers */, DB313FF917554B71006C0E22 /* SDL.h in Headers */, A7D8AC6223E2514100DCD162 /* SDL_uikitmetalview.h in Headers */, + F362B9582B33EB7300D30B94 /* SDL_steam_virtual_gamepad.h in Headers */, DB313FCA17554B71006C0E22 /* SDL_assert.h in Headers */, A7D8AC0E23E2514100DCD162 /* SDL_shape_internals.h in Headers */, A7D8BA7E23E2514400DCD162 /* SDL_glfuncs.h in Headers */, @@ -7075,7 +7234,6 @@ A7D8AC4A23E2514100DCD162 /* SDL_uikitview.h in Headers */, DB313FFC17554B71006C0E22 /* SDL_bits.h in Headers */, A7D8ACCE23E2514100DCD162 /* SDL_uikitappdelegate.h in Headers */, - A7D8ACA423E2514100DCD162 /* keyinfotable.h in Headers */, DB313FCD17554B71006C0E22 /* SDL_blendmode.h in Headers */, A7D8BB3223E2514500DCD162 /* SDL_dropevents_c.h in Headers */, A7D8AAC123E2514100DCD162 /* SDL_haptic_c.h in Headers */, @@ -7122,18 +7280,19 @@ DB313FDA17554B71006C0E22 /* SDL_keyboard.h in Headers */, A7D8ACC223E2514100DCD162 /* SDL_uikitevents.h in Headers */, A7D8BB3E23E2514500DCD162 /* SDL_gesture_c.h in Headers */, + F362B9382B33916600D30B94 /* controller_list.h in Headers */, A7D8BA7823E2514400DCD162 /* SDL_shaders_gl.h in Headers */, A7D8B42D23E2514300DCD162 /* SDL_systhread_c.h in Headers */, A1BB8B7227F6CF330057CFA8 /* SDL_list.h in Headers */, DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */, A7D8AE9323E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */, A7D8ACE623E2514100DCD162 /* SDL_uikitvulkan.h in Headers */, - A7D8B27123E2514200DCD162 /* vulkan.hpp in Headers */, DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */, A7D8B22923E2514200DCD162 /* gl2ext.h in Headers */, A7D8BB7423E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */, A7D8AAE523E2514100DCD162 /* SDL_syshaptic_c.h in Headers */, A7D8B94F23E2514400DCD162 /* SDL_hints_c.h in Headers */, + F316ABC12B5A02C3002EF551 /* yuv_rgb_sse.h in Headers */, A7D8B7B723E2514400DCD162 /* SDL_audiodev_c.h in Headers */, A7D8B7A523E2514400DCD162 /* SDL_audio_c.h in Headers */, A7D8AC6E23E2514100DCD162 /* SDL_uikitmodes.h in Headers */, @@ -7147,6 +7306,7 @@ A7D8B2AD23E2514200DCD162 /* vulkan_core.h in Headers */, A7D8A98023E2514000DCD162 /* SDL_syssensor.h in Headers */, A7D8AB0F23E2514100DCD162 /* SDL_dynapi.h in Headers */, + F316ABD32B5A02C3002EF551 /* yuv_rgb_lsx_func.h in Headers */, A7D8B61C23E2514300DCD162 /* SDL_assert_c.h in Headers */, A7D8B8A723E2514400DCD162 /* SDL_diskaudio.h in Headers */, DB313FDE17554B71006C0E22 /* SDL_main.h in Headers */, @@ -7156,6 +7316,7 @@ A7D8AEE123E2514100DCD162 /* SDL_cocoaopengl.h in Headers */, A7D8B3CD23E2514300DCD162 /* yuv_rgb_sse_func.h in Headers */, 5605721B2473688D00B46B66 /* SDL_syslocale.h in Headers */, + F316ABCA2B5A02C3002EF551 /* yuv_rgb_std.h in Headers */, A7D8AB6023E2514100DCD162 /* SDL_offscreenevents_c.h in Headers */, F3973FA828A59BDD00B84553 /* SDL_vacopy.h in Headers */, A1626A582617008D003F1973 /* SDL_triangle.h in Headers */, @@ -7179,6 +7340,8 @@ A7D8BA5423E2514400DCD162 /* SDL_shaders_gles2.h in Headers */, DB313FE417554B71006C0E22 /* SDL_opengles2.h in Headers */, A7D8BA4823E2514400DCD162 /* SDL_glesfuncs.h in Headers */, + F316AB8B2B5A02C3002EF551 /* yuv_rgb_common.h in Headers */, + F316ABAF2B5A02C3002EF551 /* yuv_rgb_lsx.h in Headers */, A7D8BA1223E2514400DCD162 /* SDL_blendpoint.h in Headers */, A7D8AB7223E2514100DCD162 /* SDL_offscreenvideo.h in Headers */, A7D8AC0223E2514100DCD162 /* SDL_nullevents_c.h in Headers */, @@ -7207,7 +7370,6 @@ A7D8B2A123E2514200DCD162 /* vulkan_xlib.h in Headers */, A7D8AC9E23E2514100DCD162 /* SDL_uikitwindow.h in Headers */, A7D8B25F23E2514200DCD162 /* vulkan_vi.h in Headers */, - A7D8B29B23E2514200DCD162 /* vulkan_mir.h in Headers */, DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */, A7D8BB5023E2514500DCD162 /* default_cursor.h in Headers */, A7D8BA0023E2514400DCD162 /* SDL_render_sw_c.h in Headers */, @@ -7268,11 +7430,13 @@ AAC070FE195606770073DCDF /* SDL_opengles2_gl2.h in Headers */, F3950CDA212BC88D00F51292 /* SDL_sensor.h in Headers */, A75FDBCB23EA380300529352 /* SDL_hidapi_rumble.h in Headers */, + F362B94C2B33920500D30B94 /* SDL_hidapi_nintendo.h in Headers */, A7D8AC4423E2514100DCD162 /* SDL_sysvideo.h in Headers */, F386F6ED2884663E001840AA /* SDL_log_c.h in Headers */, AAC07104195606770073DCDF /* SDL_opengles2_gl2platform.h in Headers */, AAC07101195606770073DCDF /* SDL_opengles2_gl2ext.h in Headers */, A7D8AB1523E2514100DCD162 /* SDL_dynapi_overrides.h in Headers */, + F316AB942B5A02C3002EF551 /* yuv_rgb_internal.h in Headers */, A7D8AEFF23E2514100DCD162 /* SDL_cocoawindow.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -7756,7 +7920,6 @@ A75FCE0223E25AB700529352 /* SDL_log.c in Sources */, A75FCE0323E25AB700529352 /* SDL_cocoaopengl.m in Sources */, A75FCE0423E25AB700529352 /* SDL_offscreenframebuffer.c in Sources */, - A75FCE0523E25AB700529352 /* yuv_rgb.c in Sources */, F323060628939F6400E66D30 /* SDL_hidapi_combined.c in Sources */, A75FCE0623E25AB700529352 /* SDL_render_gles.c in Sources */, A75FCE0723E25AB700529352 /* SDL_systhread.c in Sources */, @@ -7779,6 +7942,7 @@ A75FCE1923E25AB700529352 /* SDL_offscreenevents.c in Sources */, A75FCE1A23E25AB700529352 /* SDL_uikitview.m in Sources */, A75FCE1B23E25AB700529352 /* SDL_nullevents.c in Sources */, + F362B9442B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A75FCE1C23E25AB700529352 /* SDL_audiodev.c in Sources */, A75FCE1D23E25AB700529352 /* SDL_cocoaclipboard.m in Sources */, A75FCE1E23E25AB700529352 /* SDL_blit_slow.c in Sources */, @@ -7842,6 +8006,7 @@ A75FCE5323E25AB700529352 /* SDL_mixer.c in Sources */, 5616CA64252BB35F005D5928 /* SDL_url.c in Sources */, A75FCE5423E25AB700529352 /* SDL_events.c in Sources */, + F316AB9E2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F386F7002884663E001840AA /* SDL_utils.c in Sources */, A75FCE5523E25AB700529352 /* SDL_blit_0.c in Sources */, A75FCE5623E25AB700529352 /* k_tan.c in Sources */, @@ -7858,6 +8023,7 @@ F3ADAB922576F0B400A6B1D9 /* SDL_sysurl.m in Sources */, A75FCE6323E25AB700529352 /* SDL_string.c in Sources */, A75FCE6423E25AB700529352 /* SDL_render_gl.c in Sources */, + F316ABA72B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A75FCE6523E25AB700529352 /* SDL_uikitopengles.m in Sources */, A75FCE6723E25AB700529352 /* SDL_cocoamodes.m in Sources */, A75FCE6823E25AB700529352 /* k_rem_pio2.c in Sources */, @@ -7910,10 +8076,12 @@ A75FCE9B23E25AB700529352 /* SDL_drawpoint.c in Sources */, A75FCE9C23E25AB700529352 /* e_sqrt.c in Sources */, A75FCE9D23E25AB700529352 /* SDL_cocoavideo.m in Sources */, + F362B9622B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A75FCE9F23E25AB700529352 /* SDL.c in Sources */, A75FCEA123E25AB700529352 /* SDL_cocoavulkan.m in Sources */, A75FCEA223E25AB700529352 /* SDL_uikitappdelegate.m in Sources */, A75FCEA323E25AB700529352 /* SDL_offscreenwindow.c in Sources */, + F316ABB92B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -7952,7 +8120,6 @@ A75FCFBB23E25AC700529352 /* SDL_log.c in Sources */, A75FCFBC23E25AC700529352 /* SDL_cocoaopengl.m in Sources */, A75FCFBD23E25AC700529352 /* SDL_offscreenframebuffer.c in Sources */, - A75FCFBE23E25AC700529352 /* yuv_rgb.c in Sources */, F323060728939F6400E66D30 /* SDL_hidapi_combined.c in Sources */, A75FCFBF23E25AC700529352 /* SDL_render_gles.c in Sources */, A75FCFC023E25AC700529352 /* SDL_systhread.c in Sources */, @@ -7975,6 +8142,7 @@ A75FCFD223E25AC700529352 /* SDL_offscreenevents.c in Sources */, A75FCFD323E25AC700529352 /* SDL_uikitview.m in Sources */, A75FCFD423E25AC700529352 /* SDL_nullevents.c in Sources */, + F362B9452B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A75FCFD523E25AC700529352 /* SDL_audiodev.c in Sources */, A75FCFD623E25AC700529352 /* SDL_cocoaclipboard.m in Sources */, A75FCFD723E25AC700529352 /* SDL_blit_slow.c in Sources */, @@ -8038,6 +8206,7 @@ A75FD00C23E25AC700529352 /* SDL_mixer.c in Sources */, 5616CA67252BB361005D5928 /* SDL_url.c in Sources */, A75FD00D23E25AC700529352 /* SDL_events.c in Sources */, + F316AB9F2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F386F7012884663E001840AA /* SDL_utils.c in Sources */, A75FD00E23E25AC700529352 /* SDL_blit_0.c in Sources */, A75FD00F23E25AC700529352 /* k_tan.c in Sources */, @@ -8054,6 +8223,7 @@ F3ADAB932576F0B400A6B1D9 /* SDL_sysurl.m in Sources */, A75FD01C23E25AC700529352 /* SDL_string.c in Sources */, A75FD01D23E25AC700529352 /* SDL_render_gl.c in Sources */, + F316ABA82B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A75FD01E23E25AC700529352 /* SDL_uikitopengles.m in Sources */, A75FD02023E25AC700529352 /* SDL_cocoamodes.m in Sources */, A75FD02123E25AC700529352 /* k_rem_pio2.c in Sources */, @@ -8106,10 +8276,12 @@ A75FD05423E25AC700529352 /* SDL_drawpoint.c in Sources */, A75FD05523E25AC700529352 /* e_sqrt.c in Sources */, A75FD05623E25AC700529352 /* SDL_cocoavideo.m in Sources */, + F362B9632B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A75FD05823E25AC700529352 /* SDL.c in Sources */, A75FD05A23E25AC700529352 /* SDL_cocoavulkan.m in Sources */, A75FD05B23E25AC700529352 /* SDL_uikitappdelegate.m in Sources */, A75FD05C23E25AC700529352 /* SDL_offscreenwindow.c in Sources */, + F316ABBA2B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -8140,11 +8312,12 @@ A769B18723E259AE00872273 /* SDL_hidapi_xbox360w.c in Sources */, A769B18823E259AE00872273 /* SDL_atomic.c in Sources */, A769B18923E259AE00872273 /* SDL_displayevents.c in Sources */, + F316ABA52B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A769B18B23E259AE00872273 /* SDL_log.c in Sources */, A769B18C23E259AE00872273 /* SDL_cocoaopengl.m in Sources */, A769B18D23E259AE00872273 /* SDL_offscreenframebuffer.c in Sources */, - A769B18E23E259AE00872273 /* yuv_rgb.c in Sources */, A769B18F23E259AE00872273 /* SDL_render_gles.c in Sources */, + F362B9602B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A769B19023E259AE00872273 /* SDL_systhread.c in Sources */, A769B19123E259AE00872273 /* SDL_windowevents.c in Sources */, A769B19223E259AE00872273 /* s_scalbn.c in Sources */, @@ -8157,6 +8330,7 @@ A769B19A23E259AE00872273 /* SDL_syssem.c in Sources */, A769B19B23E259AE00872273 /* SDL_hidapi_xbox360.c in Sources */, A769B19C23E259AE00872273 /* SDL_coreaudio.m in Sources */, + F362B9422B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A769B19D23E259AE00872273 /* SDL_blendline.c in Sources */, A769B19E23E259AE00872273 /* SDL_blit_A.c in Sources */, A769B19F23E259AE00872273 /* SDL_d3dmath.c in Sources */, @@ -8235,6 +8409,7 @@ A769B1E923E259AE00872273 /* SDL_uikit_main.c in Sources */, F3F07D5F269640160074468B /* SDL_hidapi_luna.c in Sources */, A769B1EA23E259AE00872273 /* SDL_stdlib.c in Sources */, + F316ABB72B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, A769B1EB23E259AE00872273 /* SDL_dummyaudio.c in Sources */, A769B1EC23E259AE00872273 /* SDL_fillrect.c in Sources */, A769B1ED23E259AE00872273 /* SDL_nullframebuffer.c in Sources */, @@ -8250,6 +8425,7 @@ A769B1F923E259AE00872273 /* SDL_joystick.c in Sources */, A769B1FA23E259AE00872273 /* SDL_render_gles2.c in Sources */, A769B1FB23E259AE00872273 /* SDL_surface.c in Sources */, + F316AB9C2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F395BF6A25633B2400942BFF /* SDL_crc32.c in Sources */, A769B1FC23E259AE00872273 /* SDL_hidapi_xboxone.c in Sources */, A769B1FD23E259AE00872273 /* SDL_blit_auto.c in Sources */, @@ -8343,7 +8519,6 @@ A7D8AB2623E2514100DCD162 /* SDL_log.c in Sources */, A7D8AE8923E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7423E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, - A7D8B3C023E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA3E23E2514400DCD162 /* SDL_render_gles.c in Sources */, A7D8B43523E2514300DCD162 /* SDL_systhread.c in Sources */, F323060028939F6400E66D30 /* SDL_hidapi_combined.c in Sources */, @@ -8368,6 +8543,7 @@ A7D8ABF223E2514100DCD162 /* SDL_nullevents.c in Sources */, A7D8B81923E2514400DCD162 /* SDL_audiodev.c in Sources */, A7D8AF0D23E2514100DCD162 /* SDL_cocoaclipboard.m in Sources */, + F362B93E2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A7D8ABCE23E2514100DCD162 /* SDL_blit_slow.c in Sources */, A7D8BA9823E2514400DCD162 /* s_copysign.c in Sources */, A7D8AAB723E2514100DCD162 /* SDL_haptic.c in Sources */, @@ -8431,6 +8607,7 @@ A7D8ADE723E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0A23E2514500DCD162 /* k_tan.c in Sources */, A75FDBCF23EA380300529352 /* SDL_hidapi_rumble.c in Sources */, + F316AB982B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F386F6FA2884663E001840AA /* SDL_utils.c in Sources */, A7D8B8A923E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC123E2514200DCD162 /* SDL_egl.c in Sources */, @@ -8447,6 +8624,7 @@ F3ADAB8E2576F0B400A6B1D9 /* SDL_sysurl.m in Sources */, A7D8AC8223E2514100DCD162 /* SDL_uikitopengles.m in Sources */, A7D8AE9523E2514100DCD162 /* SDL_cocoamodes.m in Sources */, + F316ABA12B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8BAA423E2514400DCD162 /* k_rem_pio2.c in Sources */, A7D8BB9A23E2514500DCD162 /* SDL_gesture.c in Sources */, A7D8B95723E2514400DCD162 /* SDL_getenv.c in Sources */, @@ -8499,10 +8677,12 @@ A7D8BA2623E2514400DCD162 /* SDL_drawpoint.c in Sources */, A7D8BAF823E2514500DCD162 /* e_sqrt.c in Sources */, A7D8AEAD23E2514100DCD162 /* SDL_cocoavideo.m in Sources */, + F362B95C2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A7D8A94C23E2514000DCD162 /* SDL.c in Sources */, A7D8AEA123E2514100DCD162 /* SDL_cocoavulkan.m in Sources */, A7D8AC6423E2514100DCD162 /* SDL_uikitappdelegate.m in Sources */, A7D8AB6223E2514100DCD162 /* SDL_offscreenwindow.c in Sources */, + F316ABB32B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -8539,7 +8719,6 @@ A7D8AB2723E2514100DCD162 /* SDL_log.c in Sources */, A7D8AE8A23E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7523E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, - A7D8B3C123E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA3F23E2514400DCD162 /* SDL_render_gles.c in Sources */, A7D8B43623E2514300DCD162 /* SDL_systhread.c in Sources */, F323060128939F6400E66D30 /* SDL_hidapi_combined.c in Sources */, @@ -8564,6 +8743,7 @@ A7D8ABF323E2514100DCD162 /* SDL_nullevents.c in Sources */, A7D8B81A23E2514400DCD162 /* SDL_audiodev.c in Sources */, A7D8AF0E23E2514100DCD162 /* SDL_cocoaclipboard.m in Sources */, + F362B93F2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A7D8ABCF23E2514100DCD162 /* SDL_blit_slow.c in Sources */, A7D8BA9923E2514400DCD162 /* s_copysign.c in Sources */, A7D8AAB823E2514100DCD162 /* SDL_haptic.c in Sources */, @@ -8627,6 +8807,7 @@ A7D8ADE823E2514100DCD162 /* SDL_blit_0.c in Sources */, A7D8BB0B23E2514500DCD162 /* k_tan.c in Sources */, A75FDBD023EA380300529352 /* SDL_hidapi_rumble.c in Sources */, + F316AB992B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F386F6FB2884663E001840AA /* SDL_utils.c in Sources */, A7D8B8AA23E2514400DCD162 /* SDL_diskaudio.c in Sources */, A7D8AFC223E2514200DCD162 /* SDL_egl.c in Sources */, @@ -8643,6 +8824,7 @@ F3ADAB8F2576F0B400A6B1D9 /* SDL_sysurl.m in Sources */, A7D8AC8323E2514100DCD162 /* SDL_uikitopengles.m in Sources */, A7D8AE9623E2514100DCD162 /* SDL_cocoamodes.m in Sources */, + F316ABA22B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8BAA523E2514400DCD162 /* k_rem_pio2.c in Sources */, A7D8BB9B23E2514500DCD162 /* SDL_gesture.c in Sources */, A7D8B95823E2514400DCD162 /* SDL_getenv.c in Sources */, @@ -8695,10 +8877,12 @@ A7D8BA2723E2514400DCD162 /* SDL_drawpoint.c in Sources */, A7D8BAF923E2514500DCD162 /* e_sqrt.c in Sources */, A7D8AEAE23E2514100DCD162 /* SDL_cocoavideo.m in Sources */, + F362B95D2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A7D8A94D23E2514000DCD162 /* SDL.c in Sources */, A7D8AEA223E2514100DCD162 /* SDL_cocoavulkan.m in Sources */, A7D8AC6523E2514100DCD162 /* SDL_uikitappdelegate.m in Sources */, A7D8AB6323E2514100DCD162 /* SDL_offscreenwindow.c in Sources */, + F316ABB42B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -8729,11 +8913,12 @@ A7D8B56123E2514300DCD162 /* SDL_hidapi_xbox360w.c in Sources */, A7D8A95B23E2514000DCD162 /* SDL_atomic.c in Sources */, A7D8BB2B23E2514500DCD162 /* SDL_displayevents.c in Sources */, + F316ABA42B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8AB2923E2514100DCD162 /* SDL_log.c in Sources */, A7D8AE8C23E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7723E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, - A7D8B3C323E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA4123E2514400DCD162 /* SDL_render_gles.c in Sources */, + F362B95F2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, A7D8B43823E2514300DCD162 /* SDL_systhread.c in Sources */, A7D8BB3723E2514500DCD162 /* SDL_windowevents.c in Sources */, A7D8BABF23E2514400DCD162 /* s_scalbn.c in Sources */, @@ -8746,6 +8931,7 @@ A7D8B42623E2514300DCD162 /* SDL_syssem.c in Sources */, A7D8B53D23E2514300DCD162 /* SDL_hidapi_xbox360.c in Sources */, A7D8B8D623E2514400DCD162 /* SDL_coreaudio.m in Sources */, + F362B9412B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A7D8BA2323E2514400DCD162 /* SDL_blendline.c in Sources */, A7D8ADF623E2514100DCD162 /* SDL_blit_A.c in Sources */, A7D8BA3B23E2514400DCD162 /* SDL_d3dmath.c in Sources */, @@ -8824,6 +9010,7 @@ A7D8BC0723E2590800DCD162 /* SDL_uikit_main.c in Sources */, F3F07D5E269640160074468B /* SDL_hidapi_luna.c in Sources */, A7D8B97223E2514400DCD162 /* SDL_stdlib.c in Sources */, + F316ABB62B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, A7D8B79E23E2514400DCD162 /* SDL_dummyaudio.c in Sources */, A7D8B3A823E2514200DCD162 /* SDL_fillrect.c in Sources */, A7D8ABE323E2514100DCD162 /* SDL_nullframebuffer.c in Sources */, @@ -8839,6 +9026,7 @@ A7D8B4E023E2514300DCD162 /* SDL_joystick.c in Sources */, A7D8BA4D23E2514400DCD162 /* SDL_render_gles2.c in Sources */, A7D8AC3123E2514100DCD162 /* SDL_surface.c in Sources */, + F316AB9B2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, F395BF6925633B2400942BFF /* SDL_crc32.c in Sources */, A7D8B54F23E2514300DCD162 /* SDL_hidapi_xboxone.c in Sources */, A7D8AD2723E2514100DCD162 /* SDL_blit_auto.c in Sources */, @@ -8937,7 +9125,6 @@ A7D8AB2523E2514100DCD162 /* SDL_log.c in Sources */, A7D8AE8823E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7323E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, - A7D8B3BF23E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA3D23E2514400DCD162 /* SDL_render_gles.c in Sources */, A7D8B43423E2514300DCD162 /* SDL_systhread.c in Sources */, A7D8BB3323E2514500DCD162 /* SDL_windowevents.c in Sources */, @@ -8966,6 +9153,7 @@ A7D8BBE523E2574800DCD162 /* SDL_uikitview.m in Sources */, A7D8BBE923E2574800DCD162 /* SDL_uikitvulkan.m in Sources */, A7D8ABCD23E2514100DCD162 /* SDL_blit_slow.c in Sources */, + F362B93D2B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, A7D8BA9723E2514400DCD162 /* s_copysign.c in Sources */, F3984CD025BCC92900374F43 /* SDL_hidapi_stadia.c in Sources */, A7D8AAB623E2514100DCD162 /* SDL_haptic.c in Sources */, @@ -8974,6 +9162,8 @@ A7D8BBC523E2561500DCD162 /* SDL_steamcontroller.c in Sources */, A7D8AD3223E2514100DCD162 /* SDL_blit_N.c in Sources */, A7D8BB7B23E2514500DCD162 /* SDL_dropevents.c in Sources */, + F362B95B2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, + F316AB972B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, A7D8BACD23E2514500DCD162 /* e_atan2.c in Sources */, A7D8BA8B23E2514400DCD162 /* s_sin.c in Sources */, A7D8BBEB23E2574800DCD162 /* SDL_uikitwindow.m in Sources */, @@ -9047,9 +9237,11 @@ A7D8BB6923E2514500DCD162 /* SDL_keyboard.c in Sources */, A7D8ACE723E2514100DCD162 /* SDL_rect.c in Sources */, A7D8AE9A23E2514100DCD162 /* SDL_cocoaopengles.m in Sources */, + F316ABB22B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, A7D8B96823E2514400DCD162 /* SDL_qsort.c in Sources */, A7D8B55123E2514300DCD162 /* SDL_hidapi_switch.c in Sources */, A7D8B96223E2514400DCD162 /* SDL_strtokr.c in Sources */, + F316ABA02B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8BB7523E2514500DCD162 /* SDL_clipboardevents.c in Sources */, A1BB8B6327F6CF330057CFA8 /* SDL_list.c in Sources */, A7D8BAB523E2514400DCD162 /* k_cos.c in Sources */, @@ -9134,7 +9326,6 @@ A7D8AE8B23E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7623E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, 5616CA58252BB35C005D5928 /* SDL_url.c in Sources */, - A7D8B3C223E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA4023E2514400DCD162 /* SDL_render_gles.c in Sources */, A7D8B43723E2514300DCD162 /* SDL_systhread.c in Sources */, F3973FAE28A59BDD00B84553 /* SDL_crc16.c in Sources */, @@ -9161,6 +9352,7 @@ A7D8ABD023E2514100DCD162 /* SDL_blit_slow.c in Sources */, A7D8BA9A23E2514400DCD162 /* s_copysign.c in Sources */, A7D8AAB923E2514100DCD162 /* SDL_haptic.c in Sources */, + F362B9402B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, F3984CD325BCC92900374F43 /* SDL_hidapi_stadia.c in Sources */, A7D8AF2723E2514100DCD162 /* SDL_cocoametalview.m in Sources */, A7D8B86323E2514400DCD162 /* SDL_audiotypecvt.c in Sources */, @@ -9169,6 +9361,8 @@ A7D8BBFA23E2574800DCD162 /* SDL_uikitopengles.m in Sources */, A7D8BAD023E2514500DCD162 /* e_atan2.c in Sources */, A7D8BA8E23E2514400DCD162 /* s_sin.c in Sources */, + F362B95E2B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, + F316AB9A2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, A7D8B5EA23E2514300DCD162 /* SDL_power.c in Sources */, A7D8AED923E2514100DCD162 /* SDL_cocoakeyboard.m in Sources */, A7D8AB1923E2514100DCD162 /* SDL_dynapi.c in Sources */, @@ -9242,9 +9436,11 @@ A7D8BC0023E2574800DCD162 /* SDL_uikitview.m in Sources */, A7D8AE9D23E2514100DCD162 /* SDL_cocoaopengles.m in Sources */, A7D8B96B23E2514400DCD162 /* SDL_qsort.c in Sources */, + F316ABB52B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, A7D8B55423E2514300DCD162 /* SDL_hidapi_switch.c in Sources */, A7D8B96523E2514400DCD162 /* SDL_strtokr.c in Sources */, A7D8BB7823E2514500DCD162 /* SDL_clipboardevents.c in Sources */, + F316ABA32B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8BAB823E2514400DCD162 /* k_cos.c in Sources */, A1BB8B6627F6CF330057CFA8 /* SDL_list.c in Sources */, A7D8B54823E2514300DCD162 /* SDL_hidapijoystick.c in Sources */, @@ -9326,7 +9522,6 @@ A7D8AB2A23E2514100DCD162 /* SDL_log.c in Sources */, A7D8AE8D23E2514100DCD162 /* SDL_cocoaopengl.m in Sources */, A7D8AB7823E2514100DCD162 /* SDL_offscreenframebuffer.c in Sources */, - A7D8B3C423E2514200DCD162 /* yuv_rgb.c in Sources */, A7D8BA4223E2514400DCD162 /* SDL_render_gles.c in Sources */, 5616CA61252BB35E005D5928 /* SDL_url.c in Sources */, A7D8B43923E2514300DCD162 /* SDL_systhread.c in Sources */, @@ -9356,6 +9551,7 @@ A7D8BA9C23E2514400DCD162 /* s_copysign.c in Sources */, A7D8AABB23E2514100DCD162 /* SDL_haptic.c in Sources */, A7D8AC9223E2514100DCD162 /* SDL_uikitvulkan.m in Sources */, + F362B9432B33920500D30B94 /* SDL_hidapi_steamdeck.c in Sources */, F3984CD625BCC92900374F43 /* SDL_hidapi_stadia.c in Sources */, A7D8AF2923E2514100DCD162 /* SDL_cocoametalview.m in Sources */, A7D8B86523E2514400DCD162 /* SDL_audiotypecvt.c in Sources */, @@ -9364,6 +9560,8 @@ A7D8AD3723E2514100DCD162 /* SDL_blit_N.c in Sources */, A7D8BB8023E2514500DCD162 /* SDL_dropevents.c in Sources */, A7D8BAD223E2514500DCD162 /* e_atan2.c in Sources */, + F362B9612B33EB7300D30B94 /* SDL_steam_virtual_gamepad.c in Sources */, + F316AB9D2B5A02C3002EF551 /* yuv_rgb_std.c in Sources */, A7D8BA9023E2514400DCD162 /* s_sin.c in Sources */, A7D8B5EC23E2514300DCD162 /* SDL_power.c in Sources */, A7D8AEDB23E2514100DCD162 /* SDL_cocoakeyboard.m in Sources */, @@ -9437,9 +9635,11 @@ A7D8ACEC23E2514100DCD162 /* SDL_rect.c in Sources */, A7D8AE9F23E2514100DCD162 /* SDL_cocoaopengles.m in Sources */, A7D8B96D23E2514400DCD162 /* SDL_qsort.c in Sources */, + F316ABB82B5A02C3002EF551 /* yuv_rgb_lsx.c in Sources */, A7D8B55623E2514300DCD162 /* SDL_hidapi_switch.c in Sources */, A7D8B96723E2514400DCD162 /* SDL_strtokr.c in Sources */, A7D8BB7A23E2514500DCD162 /* SDL_clipboardevents.c in Sources */, + F316ABA62B5A02C3002EF551 /* yuv_rgb_sse.c in Sources */, A7D8BABA23E2514400DCD162 /* k_cos.c in Sources */, A1BB8B6927F6CF330057CFA8 /* SDL_list.c in Sources */, A7D8B54A23E2514300DCD162 /* SDL_hidapijoystick.c in Sources */, @@ -9528,8 +9728,8 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 3301.0.0; + DYLIB_CURRENT_VERSION = 3301.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_ALTIVEC_EXTENSIONS = YES; @@ -9558,7 +9758,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; STRIP_STYLE = "non-global"; @@ -9570,7 +9770,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.0.17; + MARKETING_VERSION = 2.33.0; OTHER_LDFLAGS = "-liconv"; }; name = Release; @@ -9613,8 +9813,8 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 3301.0.0; + DYLIB_CURRENT_VERSION = 3301.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -9643,7 +9843,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.11; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL2; PRODUCT_NAME = SDL2; @@ -9656,7 +9856,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_LINK_OBJC_RUNTIME = NO; - MARKETING_VERSION = 2.0.17; + MARKETING_VERSION = 2.33.0; OTHER_LDFLAGS = "-liconv"; }; name = Debug; @@ -9862,8 +10062,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 3301.0.0; + DYLIB_CURRENT_VERSION = 3301.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; @@ -9914,8 +10114,8 @@ CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 2601.0.0; - DYLIB_CURRENT_VERSION = 2601.0.0; + DYLIB_COMPATIBILITY_VERSION = 3301.0.0; + DYLIB_CURRENT_VERSION = 3301.0.0; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/Xcode/SDL/pkg-support/SDL.info b/Xcode/SDL/pkg-support/SDL.info index f08facd234d83..0e490a2339681 100644 --- a/Xcode/SDL/pkg-support/SDL.info +++ b/Xcode/SDL/pkg-support/SDL.info @@ -1,4 +1,4 @@ -Title SDL 2.0.0 +Title SDL 2.33.0 Version 1 Description SDL Library for Mac OS X (http://www.libsdl.org) DefaultLocation /Library/Frameworks diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake index 28c34bc7052f3..9205d1f2b8742 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl2-config.cmake @@ -31,8 +31,15 @@ endmacro() set(SDL2_FOUND TRUE) -string(REGEX REPLACE "SDL2\\.framework.*" "SDL2.framework" SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") -string(REGEX REPLACE "SDL2\\.framework.*" "" SDL2_FRAMEWORK_PARENT_PATH "${CMAKE_CURRENT_LIST_DIR}") +# Compute the installation prefix relative to this file. +set(SDL2_FRAMEWORK_PATH "${CMAKE_CURRENT_LIST_DIR}") # > /SDL2.framework/Resources/CMake/ +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/Current/Resources/CMake +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" REALPATH) # > /SDL2.framework/Versions/A/Resources/CMake/ +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/Resources/ +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/A/ +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/Versions/ +get_filename_component(SDL2_FRAMEWORK_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > /SDL2.framework/ +get_filename_component(SDL2_FRAMEWORK_PARENT_PATH "${SDL2_FRAMEWORK_PATH}" PATH) # > / # For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables. @@ -49,14 +56,16 @@ set(SDL2_LIBRARIES "SDL2::SDL2") # This is done for compatibility with CMake generated SDL2-target.cmake files. if(NOT TARGET SDL2::SDL2) - add_library(SDL2::SDL2 INTERFACE IMPORTED) + add_library(SDL2::SDL2 SHARED IMPORTED) set_target_properties(SDL2::SDL2 PROPERTIES - INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\"" + FRAMEWORK "TRUE" + IMPORTED_LOCATION "${SDL2_FRAMEWORK_PATH}/Versions/A/SDL2" INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}" - INTERFACE_LINK_OPTIONS "SHELL:-F \"${SDL2_FRAMEWORK_PARENT_PATH}\";SHELL:-framework SDL2" COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED" INTERFACE_SDL2_SHARED "ON" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2_FOUND TRUE) diff --git a/Xcode/SDL/pkg-support/resources/License.txt b/Xcode/SDL/pkg-support/resources/License.txt index d2785a68158ce..144831ccfcc8a 100644 --- a/Xcode/SDL/pkg-support/resources/License.txt +++ b/Xcode/SDL/pkg-support/resources/License.txt @@ -1,6 +1,6 @@ Simple DirectMedia Layer -Copyright (C) 1997-2022 Sam Lantinga +Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index 1d5183a7dab12..543d100d790f4 100644 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -155,6 +155,100 @@ DBEC54ED1A1A828A005B1EAB /* axis.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D61A1A8145005B1EAB /* axis.bmp */; }; DBEC54EE1A1A828D005B1EAB /* button.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D71A1A8145005B1EAB /* button.bmp */; }; DBEC54EF1A1A828F005B1EAB /* controllermap.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBEC54D81A1A8145005B1EAB /* controllermap.bmp */; }; + F3A249DB2B389C7A00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249DC2B389C7A00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249DE2B389CCA00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249DF2B389CCA00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249E12B389CDB00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249E22B389CDB00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249E42B389CE700A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249E52B389CE700A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249E72B389CF000A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249E82B389CF000A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249EA2B389CFB00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249EB2B389CFB00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249ED2B389D0900A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249EE2B389D0900A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249F02B389D3100A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249F12B389D3100A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249F32B389D3B00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249F42B389D3B00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249F62B389D4400A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249F72B389D4400A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249F92B389D5200A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249FA2B389D5200A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249FC2B389D5B00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A249FD2B389D5B00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A249FF2B389D6600A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A002B389D6600A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A022B389D6F00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A032B389D6F00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A052B389D7C00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A062B389D7C00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A082B389D8A00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A092B389D8A00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A0B2B389D9B00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A0C2B389D9B00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A0E2B389DA800A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A0F2B389DA800A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A112B389DB400A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A122B389DB400A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A142B389DC000A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A152B389DC000A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A172B389DCA00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A182B389DCA00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A1A2B389DD600A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A1B2B389DD600A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A1D2B389DE100A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A1E2B389DE100A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A202B389DEB00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A212B389DEB00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A232B389DF500A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A242B389DF500A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A262B389DFF00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A272B389DFF00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A292B389E0900A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A2A2B389E0900A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A2C2B389E1400A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A2D2B389E1400A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A302B389E2800A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A312B389E2800A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A332B389E3200A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A342B389E3200A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A362B389E4F00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A372B389E4F00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A392B389E5D00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A3A2B389E5D00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A3C2B389E6600A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A3D2B389E6600A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A3F2B389E7200A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A402B389E7200A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A422B389E7C00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A432B389E7C00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A452B389E8700A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A462B389E8700A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A482B389E9100A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A492B389E9100A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A4B2B389E9C00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A4C2B389E9C00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A4E2B389EA500A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A4F2B389EA500A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A512B389EB600A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A522B389EB600A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A542B389EC200A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A552B389EC200A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A572B389ECD00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A582B389ECD00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A5A2B389ED800A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A5B2B389ED800A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A5D2B389EE200A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A5E2B389EE200A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A602B389EED00A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A612B389EED00A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A632B389EF900A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A642B389EF900A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + F3A24A662B389F0400A5162D /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; }; + F3A24A672B389F0400A5162D /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; F3C17C6B28E4022A00E1A26D /* libSDL_test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DB166D7F16A1D12400A1396C /* libSDL_test.a */; }; F3C17C7428E40AF000E1A26D /* testutils.c in Sources */ = {isa = PBXBuildFile; fileRef = F3C17C7328E40ADE00E1A26D /* testutils.c */; }; F3C17C7628E40BA200E1A26D /* controllermap_back.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = F3C17C7528E40B6B00E1A26D /* controllermap_back.bmp */; }; @@ -727,47 +821,564 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + F3A249DD2B389C7A00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249DC2B389C7A00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249E02B389CCA00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249DF2B389CCA00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249E32B389CDB00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249E22B389CDB00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249E62B389CE700A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249E52B389CE700A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249E92B389CF000A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249E82B389CF000A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249EC2B389CFB00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249EB2B389CFB00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249EF2B389D0900A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249EE2B389D0900A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249F22B389D3100A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249F12B389D3100A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249F52B389D3B00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249F42B389D3B00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249F82B389D4400A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249F72B389D4400A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249FB2B389D5200A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249FA2B389D5200A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A249FE2B389D5B00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A249FD2B389D5B00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A012B389D6600A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A002B389D6600A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A042B389D6F00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A032B389D6F00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A072B389D7C00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A062B389D7C00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A0A2B389D8A00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A092B389D8A00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A0D2B389D9B00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A0C2B389D9B00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A102B389DA800A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A0F2B389DA800A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A132B389DB400A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A122B389DB400A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A162B389DC000A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A152B389DC000A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A192B389DCA00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A182B389DCA00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A1C2B389DD600A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A1B2B389DD600A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A1F2B389DE100A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A1E2B389DE100A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A222B389DEB00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A212B389DEB00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A252B389DF500A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A242B389DF500A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A282B389E0000A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A272B389DFF00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A2B2B389E0900A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A2A2B389E0900A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A2E2B389E1500A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A2D2B389E1400A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A322B389E2800A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A312B389E2800A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A352B389E3200A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A342B389E3200A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A382B389E4F00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A372B389E4F00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A3B2B389E5D00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A3A2B389E5D00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A3E2B389E6600A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A3D2B389E6600A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A412B389E7200A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A402B389E7200A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A442B389E7C00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A432B389E7C00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A472B389E8700A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A462B389E8700A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A4A2B389E9100A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A492B389E9100A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A4D2B389E9C00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A4C2B389E9C00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A502B389EA600A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A4F2B389EA500A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A532B389EB600A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A522B389EB600A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A562B389EC200A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A552B389EC200A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A592B389ECD00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A582B389ECD00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A5C2B389ED800A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A5B2B389ED800A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A5F2B389EE200A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A5E2B389EE200A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A622B389EED00A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A612B389EED00A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A652B389EF900A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A642B389EF900A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + F3A24A682B389F0400A5162D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + F3A24A672B389F0400A5162D /* SDL2.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0017958C10741F7900F5D044 /* testatomic */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testatomic; path = testatomic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017958C10741F7900F5D044 /* testatomic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testatomic.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0017958F1074216E00F5D044 /* testatomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testatomic.c; sourceTree = ""; }; - 001795AD107421BF00F5D044 /* testaudioinfo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testaudioinfo; path = testaudioinfo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001795AD107421BF00F5D044 /* testaudioinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testaudioinfo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001795B01074222D00F5D044 /* testaudioinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testaudioinfo.c; sourceTree = ""; }; 0017972110742F3200F5D044 /* testgl2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgl2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0017972710742FB900F5D044 /* testgl2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgl2.c; sourceTree = ""; }; - 00179748107430D600F5D044 /* testhaptic */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testhaptic; path = testhaptic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 00179748107430D600F5D044 /* testhaptic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testhaptic.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0017974E1074315700F5D044 /* testhaptic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testhaptic.c; sourceTree = ""; }; - 0017976E107431B300F5D044 /* testdraw2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testdraw2; path = testdraw2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017976E107431B300F5D044 /* testdraw2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdraw2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001797711074320D00F5D044 /* testdraw2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testdraw2.c; sourceTree = ""; }; - 0017978E107432AE00F5D044 /* testime */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testime; path = testime.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017978E107432AE00F5D044 /* testime.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testime.app; sourceTree = BUILT_PRODUCTS_DIR; }; 00179791107432FA00F5D044 /* testime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testime.c; sourceTree = ""; }; - 001797AE1074334C00F5D044 /* testintersections */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testintersections; path = testintersections.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001797AE1074334C00F5D044 /* testintersections.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testintersections.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001797B31074339C00F5D044 /* testintersections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testintersections.c; sourceTree = ""; }; - 001797D0107433C600F5D044 /* testloadso */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testloadso; path = testloadso.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001797D0107433C600F5D044 /* testloadso.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testloadso.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001797D31074343E00F5D044 /* testloadso.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testloadso.c; sourceTree = ""; }; - 001798121074355200F5D044 /* testmultiaudio */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testmultiaudio; path = testmultiaudio.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798121074355200F5D044 /* testmultiaudio.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testmultiaudio.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001798151074359B00F5D044 /* testmultiaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testmultiaudio.c; sourceTree = ""; }; 0017985A107436ED00F5D044 /* testnative.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testnative.c; sourceTree = ""; }; 0017985B107436ED00F5D044 /* testnative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testnative.h; sourceTree = ""; }; 0017985C107436ED00F5D044 /* testnativecocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = testnativecocoa.m; sourceTree = ""; }; 00179872107438D000F5D044 /* testnativex11.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testnativex11.c; sourceTree = ""; }; 001798941074392D00F5D044 /* testnative.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testnative.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 001798B5107439DF00F5D044 /* testpower */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testpower; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798B5107439DF00F5D044 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001798B910743A4900F5D044 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testpower.c; sourceTree = ""; }; - 001798F210743BEC00F5D044 /* testresample */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testresample; path = testresample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 001798F210743BEC00F5D044 /* testresample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testresample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 001798F910743E9200F5D044 /* testresample.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testresample.c; sourceTree = ""; }; - 0017991610743F1000F5D044 /* testsprite2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testsprite2; path = testsprite2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017991610743F1000F5D044 /* testsprite2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsprite2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0017991910743F5300F5D044 /* testsprite2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testsprite2.c; sourceTree = ""; }; - 0017993810743FB700F5D044 /* testwm2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testwm2; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0017993810743FB700F5D044 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0017993B10743FEF00F5D044 /* testwm2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testwm2.c; sourceTree = ""; }; - 002F341209CA1BFF00EBEB88 /* testfile */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testfile; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F341209CA1BFF00EBEB88 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; }; 002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testfile.c; sourceTree = ""; }; - 002F343109CA1F0300EBEB88 /* testiconv */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testiconv; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F343109CA1F0300EBEB88 /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; }; 002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testiconv.c; sourceTree = ""; }; - 002F344D09CA1FB300EBEB88 /* testoverlay2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testoverlay2; path = testoverlay2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F344D09CA1FB300EBEB88 /* testoverlay2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testoverlay2.app; sourceTree = BUILT_PRODUCTS_DIR; }; 002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testoverlay2.c; sourceTree = ""; }; - 002F346A09CA204F00EBEB88 /* testplatform */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testplatform; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 002F346A09CA204F00EBEB88 /* testplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; }; 002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testplatform.c; sourceTree = ""; }; 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; }; 00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = icon.bmp; sourceTree = ""; }; @@ -787,27 +1398,27 @@ 092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testjoystick.c; sourceTree = ""; }; 092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testkeys.c; sourceTree = ""; }; 092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = testlock.c; sourceTree = ""; }; - 4537749212091504002F0F45 /* testshape */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testshape; path = testshape.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4537749212091504002F0F45 /* testshape.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testshape.app; sourceTree = BUILT_PRODUCTS_DIR; }; 453774A4120915E3002F0F45 /* testshape.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testshape.c; sourceTree = ""; }; 66E88E8A203B778F0004D44E /* testyuv_cvt.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testyuv_cvt.c; sourceTree = ""; }; AAF02FF41F90089800B9A9FB /* SDL_test_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_memory.c; sourceTree = ""; }; BBFC088E164C6820003E6A99 /* testgamecontroller.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testgamecontroller.c; sourceTree = ""; }; - BBFC08CD164C6862003E6A99 /* testgamecontroller */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testgamecontroller; path = testgamecontroller.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566B60761D90300A33029 /* checkkeys */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = checkkeys; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC566D10761D90300A33029 /* loopwave */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = loopwave; path = loopwave.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567060761D90400A33029 /* testerror */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testerror; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5672E0761D90400A33029 /* testthread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testthread; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5673B0761D90400A33029 /* testjoystick */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testjoystick; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567480761D90400A33029 /* testkeys */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testkeys; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567550761D90400A33029 /* testlock */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testlock; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC5677D0761D90500A33029 /* testsem */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testsem; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567980761D90500A33029 /* testtimer */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testtimer; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567B20761D90500A33029 /* testversion */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testversion; path = testversion.app; sourceTree = BUILT_PRODUCTS_DIR; }; - BEC567F50761D90600A33029 /* torturethread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = torturethread; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BBFC08CD164C6862003E6A99 /* testgamecontroller.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamecontroller.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC566B60761D90300A33029 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC566D10761D90300A33029 /* loopwave.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwave.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567060761D90400A33029 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5672E0761D90400A33029 /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5673B0761D90400A33029 /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567480761D90400A33029 /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567550761D90400A33029 /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC5677D0761D90500A33029 /* testsem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567980761D90500A33029 /* testtimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567B20761D90500A33029 /* testversion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testversion.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BEC567F50761D90600A33029 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB0F48D717CA51D2008798C5 /* testdrawchessboard.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testdrawchessboard.c; sourceTree = ""; }; DB0F48D817CA51D2008798C5 /* testfilesystem.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testfilesystem.c; sourceTree = ""; }; - DB0F48EC17CA51E5008798C5 /* testdrawchessboard */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testdrawchessboard; path = testdrawchessboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB0F490117CA5212008798C5 /* testfilesystem */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testfilesystem; path = testfilesystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB0F48EC17CA51E5008798C5 /* testdrawchessboard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdrawchessboard.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB0F490117CA5212008798C5 /* testfilesystem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfilesystem.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB166CBB16A1C74100A1396C /* testgesture.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testgesture.c; sourceTree = ""; }; DB166CBC16A1C74100A1396C /* testgles.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testgles.c; sourceTree = ""; }; DB166CBD16A1C74100A1396C /* testmessage.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testmessage.c; sourceTree = ""; }; @@ -835,27 +1446,28 @@ DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_log.c; sourceTree = ""; }; DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_md5.c; sourceTree = ""; }; DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_random.c; sourceTree = ""; }; - DB166DBF16A1D2F600A1396C /* testgesture */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testgesture; path = testgesture.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166DD516A1D36A00A1396C /* testmessage */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testmessage; path = testmessage.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166DEE16A1D50C00A1396C /* testrelative */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testrelative; path = testrelative.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E0516A1D57C00A1396C /* testrendercopyex */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testrendercopyex; path = testrendercopyex.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E1C16A1D5AD00A1396C /* testrendertarget */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testrendertarget; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E3816A1D64D00A1396C /* testrumble */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testrumble; path = testrumble.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E5216A1D69000A1396C /* testscale */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testscale; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E6816A1D6F300A1396C /* testshader */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testshader; path = testshader.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E7E16A1D78400A1396C /* testspriteminimal */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testspriteminimal; path = testspriteminimal.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DB166E9116A1D78C00A1396C /* teststreaming */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = teststreaming; path = teststreaming.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166DBF16A1D2F600A1396C /* testgesture.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgesture.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166DD516A1D36A00A1396C /* testmessage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testmessage.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166DEE16A1D50C00A1396C /* testrelative.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrelative.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E0516A1D57C00A1396C /* testrendercopyex.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendercopyex.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E1C16A1D5AD00A1396C /* testrendertarget.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendertarget.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E3816A1D64D00A1396C /* testrumble.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrumble.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E5216A1D69000A1396C /* testscale.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testscale.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E6816A1D6F300A1396C /* testshader.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testshader.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E7E16A1D78400A1396C /* testspriteminimal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testspriteminimal.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB166E9116A1D78C00A1396C /* teststreaming.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = teststreaming.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB166ECF16A1D87000A1396C /* shapes */ = {isa = PBXFileReference; lastKnownFileType = folder; path = shapes; sourceTree = ""; }; DB445EF818184B7000B306B0 /* testdropfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdropfile.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB445EFA18184BB600B306B0 /* testdropfile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testdropfile.c; sourceTree = ""; }; - DB89957E18A19ABA0092407C /* testhotplug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = testhotplug; path = testhotplug.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DB89957E18A19ABA0092407C /* testhotplug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testhotplug.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB89958318A19B130092407C /* testhotplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = testhotplug.c; sourceTree = ""; }; DBBC552C182831D700F3CA8D /* TestDropFile-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TestDropFile-Info.plist"; sourceTree = SOURCE_ROOT; }; DBEC54D11A1A811D005B1EAB /* controllermap.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = controllermap.c; sourceTree = ""; }; DBEC54D61A1A8145005B1EAB /* axis.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = axis.bmp; sourceTree = ""; }; DBEC54D71A1A8145005B1EAB /* button.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = button.bmp; sourceTree = ""; }; DBEC54D81A1A8145005B1EAB /* controllermap.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = controllermap.bmp; sourceTree = ""; }; - DBEC54EA1A1A81C3005B1EAB /* controllermap */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = controllermap; path = controllermap.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DBEC54EA1A1A81C3005B1EAB /* controllermap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = controllermap.app; sourceTree = BUILT_PRODUCTS_DIR; }; + F3A24A2F2B389E1D00A5162D /* testoverlay2-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "testoverlay2-Info.plist"; sourceTree = ""; }; F3C17C6A28E3FD4400E1A26D /* config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = config.xcconfig; sourceTree = ""; }; F3C17C7328E40ADE00E1A26D /* testutils.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = testutils.c; sourceTree = ""; }; F3C17C7528E40B6B00E1A26D /* controllermap_back.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; path = controllermap_back.bmp; sourceTree = ""; }; @@ -869,6 +1481,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249E72B389CF000A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -876,6 +1489,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249EA2B389CFB00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -884,6 +1498,7 @@ buildActionMask = 2147483647; files = ( DB166DA316A1D1FA00A1396C /* libSDL_test.a in Frameworks */, + F3A24A082B389D8A00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -891,6 +1506,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A0B2B389D9B00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -899,6 +1515,7 @@ buildActionMask = 2147483647; files = ( DB166DA216A1D1E900A1396C /* libSDL_test.a in Frameworks */, + F3A249ED2B389D0900A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -907,6 +1524,7 @@ buildActionMask = 2147483647; files = ( DB166DA716A1D24D00A1396C /* libSDL_test.a in Frameworks */, + F3A24A142B389DC000A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -915,6 +1533,7 @@ buildActionMask = 2147483647; files = ( DB166DAA16A1D27700A1396C /* libSDL_test.a in Frameworks */, + F3A24A172B389DCA00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -922,6 +1541,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A202B389DEB00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -929,6 +1549,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A292B389E0900A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -936,6 +1557,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A2C2B389E1400A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -943,6 +1565,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A362B389E4F00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -950,6 +1573,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A422B389E7C00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -958,6 +1582,7 @@ buildActionMask = 2147483647; files = ( DB166DAB16A1D27C00A1396C /* libSDL_test.a in Frameworks */, + F3A249DB2B389C7A00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -966,6 +1591,7 @@ buildActionMask = 2147483647; files = ( DB166DAC16A1D29000A1396C /* libSDL_test.a in Frameworks */, + F3A24A632B389EF900A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -973,6 +1599,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249F92B389D5200A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -980,6 +1607,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A112B389DB400A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -987,6 +1615,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A302B389E2800A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -994,6 +1623,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A332B389E3200A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1002,6 +1632,7 @@ buildActionMask = 2147483647; files = ( DB166DA416A1D21700A1396C /* libSDL_test.a in Frameworks */, + F3A24A512B389EB600A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1009,6 +1640,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249FF2B389D6600A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1017,6 +1649,7 @@ buildActionMask = 2147483647; files = ( F3C17C6B28E4022A00E1A26D /* libSDL_test.a in Frameworks */, + F3A249DE2B389CCA00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1024,6 +1657,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249E42B389CE700A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1031,6 +1665,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249F62B389D4400A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1038,6 +1673,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A5A2B389ED800A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1045,6 +1681,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A1A2B389DD600A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1052,6 +1689,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A1D2B389DE100A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1059,6 +1697,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A232B389DF500A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1066,6 +1705,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A4B2B389E9C00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1073,6 +1713,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A5D2B389EE200A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1080,6 +1721,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A602B389EED00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1087,6 +1729,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A662B389F0400A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1094,6 +1737,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249F02B389D3100A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1101,6 +1745,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249FC2B389D5B00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1116,6 +1761,7 @@ buildActionMask = 2147483647; files = ( F3C17C7A28E40CA600E1A26D /* libSDL_test.a in Frameworks */, + F3A24A052B389D7C00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1123,6 +1769,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A262B389DFF00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1131,6 +1778,7 @@ buildActionMask = 2147483647; files = ( DB166DEA16A1D50C00A1396C /* libSDL_test.a in Frameworks */, + F3A24A392B389E5D00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1139,6 +1787,7 @@ buildActionMask = 2147483647; files = ( DB166E0116A1D57C00A1396C /* libSDL_test.a in Frameworks */, + F3A24A3C2B389E6600A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1147,6 +1796,7 @@ buildActionMask = 2147483647; files = ( DB166E1816A1D5AD00A1396C /* libSDL_test.a in Frameworks */, + F3A24A3F2B389E7200A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1154,6 +1804,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A452B389E8700A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1162,6 +1813,7 @@ buildActionMask = 2147483647; files = ( DB166E4B16A1D69000A1396C /* libSDL_test.a in Frameworks */, + F3A24A482B389E9100A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1169,6 +1821,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A4E2B389EA500A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1176,6 +1829,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A542B389EC200A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1183,6 +1837,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A572B389ECD00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1191,6 +1846,7 @@ buildActionMask = 2147483647; files = ( DB445EF418184B7000B306B0 /* libSDL_test.a in Frameworks */, + F3A249F32B389D3B00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1198,6 +1854,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A24A0E2B389DA800A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1205,6 +1862,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F3A249E12B389CDB00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1213,6 +1871,7 @@ buildActionMask = 2147483647; files = ( F3C17CED28E417F400E1A26D /* libSDL_test.a in Frameworks */, + F3A24A022B389D6F00A5162D /* SDL2.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1260,12 +1919,14 @@ 08FB7794FE84155DC02AAC07 /* SDLTest */ = { isa = PBXGroup; children = ( + F3A24A2F2B389E1D00A5162D /* testoverlay2-Info.plist */, F3C17C6A28E3FD4400E1A26D /* config.xcconfig */, 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */, 08FB7795FE84155DC02AAC07 /* Source */, DB166D8316A1D17E00A1396C /* SDL_Test */, 00794E4609D207B4003FC8A1 /* Resources */, 1AB674ADFE9D54B511CA2CBB /* Products */, + F3A249CF2B389C7A00A5162D /* Frameworks */, ); comments = "I made these tests link against our \"default\" framework which includes X11 stuff. If you didn't install the X11 headers with Xcode, you might have problems building the SDL.framework (which is a dependency). You can swap the dependencies around to get around this, or you can modify the default SDL.framework target to not include X11 stuff. (Go into its target build options and remove all the Preprocessor macros.)\n\n\n\nWe are sort of in a half-way state at the moment. Going \"all-the-way\" means we copy the SDL.framework inside the app bundle so we can run the test without the step of the user \"installing\" the framework. But there is an oversight/bug in Xcode that doesn't correctly find the location of the framework when in an embedded/nested Xcode project. We could probably try to hack this with a shell script that checks multiple directories for existence, but this is messier and more work than I prefer, so I rather just wait for Apple to fix this. In the meantime...\n\nThe \"All\" target will build the SDL framework from the Xcode project. The other targets do not have this dependency set (for flexibility reasons in case we make changes). If you have not built the framework, you will probably be unable to link. You will either need to build the framework, or you need to add \"-framework SDL\" to the link options and make sure you have the SDL.framework installed somewhere where it can be seen (like /Library/Frameworks...I think we already set this one up.) \n\nTo run though, you should have a copy of the SDL.framework in /Library/Frameworks or ~/Library/Frameworks.\n\n\n\n\ntestgl and testdyngl need -DHAVE_OPENGL\ntestgl needs to link against OpenGL.framework\n\n"; name = SDLTest; @@ -1336,53 +1997,53 @@ 1AB674ADFE9D54B511CA2CBB /* Products */ = { isa = PBXGroup; children = ( - BEC566B60761D90300A33029 /* checkkeys */, - BEC566D10761D90300A33029 /* loopwave */, - BEC567060761D90400A33029 /* testerror */, - BEC5672E0761D90400A33029 /* testthread */, - BEC5673B0761D90400A33029 /* testjoystick */, - BEC567480761D90400A33029 /* testkeys */, - BEC567550761D90400A33029 /* testlock */, - BEC5677D0761D90500A33029 /* testsem */, - BEC567980761D90500A33029 /* testtimer */, - BEC567B20761D90500A33029 /* testversion */, - BEC567F50761D90600A33029 /* torturethread */, - 002F341209CA1BFF00EBEB88 /* testfile */, - 002F343109CA1F0300EBEB88 /* testiconv */, - 002F344D09CA1FB300EBEB88 /* testoverlay2 */, - 002F346A09CA204F00EBEB88 /* testplatform */, - 0017958C10741F7900F5D044 /* testatomic */, - 001795AD107421BF00F5D044 /* testaudioinfo */, + BEC566B60761D90300A33029 /* checkkeys.app */, + BEC566D10761D90300A33029 /* loopwave.app */, + BEC567060761D90400A33029 /* testerror.app */, + BEC5672E0761D90400A33029 /* testthread.app */, + BEC5673B0761D90400A33029 /* testjoystick.app */, + BEC567480761D90400A33029 /* testkeys.app */, + BEC567550761D90400A33029 /* testlock.app */, + BEC5677D0761D90500A33029 /* testsem.app */, + BEC567980761D90500A33029 /* testtimer.app */, + BEC567B20761D90500A33029 /* testversion.app */, + BEC567F50761D90600A33029 /* torturethread.app */, + 002F341209CA1BFF00EBEB88 /* testfile.app */, + 002F343109CA1F0300EBEB88 /* testiconv.app */, + 002F344D09CA1FB300EBEB88 /* testoverlay2.app */, + 002F346A09CA204F00EBEB88 /* testplatform.app */, + 0017958C10741F7900F5D044 /* testatomic.app */, + 001795AD107421BF00F5D044 /* testaudioinfo.app */, 0017972110742F3200F5D044 /* testgl2.app */, - 00179748107430D600F5D044 /* testhaptic */, - 0017976E107431B300F5D044 /* testdraw2 */, - 0017978E107432AE00F5D044 /* testime */, - 001797AE1074334C00F5D044 /* testintersections */, - 001797D0107433C600F5D044 /* testloadso */, - 001798121074355200F5D044 /* testmultiaudio */, + 00179748107430D600F5D044 /* testhaptic.app */, + 0017976E107431B300F5D044 /* testdraw2.app */, + 0017978E107432AE00F5D044 /* testime.app */, + 001797AE1074334C00F5D044 /* testintersections.app */, + 001797D0107433C600F5D044 /* testloadso.app */, + 001798121074355200F5D044 /* testmultiaudio.app */, 001798941074392D00F5D044 /* testnative.app */, - 001798B5107439DF00F5D044 /* testpower */, - 001798F210743BEC00F5D044 /* testresample */, - 0017991610743F1000F5D044 /* testsprite2 */, - 0017993810743FB700F5D044 /* testwm2 */, - 4537749212091504002F0F45 /* testshape */, - BBFC08CD164C6862003E6A99 /* testgamecontroller */, + 001798B5107439DF00F5D044 /* testpower.app */, + 001798F210743BEC00F5D044 /* testresample.app */, + 0017991610743F1000F5D044 /* testsprite2.app */, + 0017993810743FB700F5D044 /* testwm2.app */, + 4537749212091504002F0F45 /* testshape.app */, + BBFC08CD164C6862003E6A99 /* testgamecontroller.app */, DB166D7F16A1D12400A1396C /* libSDL_test.a */, - DB166DBF16A1D2F600A1396C /* testgesture */, - DB166DD516A1D36A00A1396C /* testmessage */, - DB166DEE16A1D50C00A1396C /* testrelative */, - DB166E0516A1D57C00A1396C /* testrendercopyex */, - DB166E1C16A1D5AD00A1396C /* testrendertarget */, - DB166E3816A1D64D00A1396C /* testrumble */, - DB166E5216A1D69000A1396C /* testscale */, - DB166E6816A1D6F300A1396C /* testshader */, - DB166E7E16A1D78400A1396C /* testspriteminimal */, - DB166E9116A1D78C00A1396C /* teststreaming */, - DB0F48EC17CA51E5008798C5 /* testdrawchessboard */, - DB0F490117CA5212008798C5 /* testfilesystem */, - DB89957E18A19ABA0092407C /* testhotplug */, + DB166DBF16A1D2F600A1396C /* testgesture.app */, + DB166DD516A1D36A00A1396C /* testmessage.app */, + DB166DEE16A1D50C00A1396C /* testrelative.app */, + DB166E0516A1D57C00A1396C /* testrendercopyex.app */, + DB166E1C16A1D5AD00A1396C /* testrendertarget.app */, + DB166E3816A1D64D00A1396C /* testrumble.app */, + DB166E5216A1D69000A1396C /* testscale.app */, + DB166E6816A1D6F300A1396C /* testshader.app */, + DB166E7E16A1D78400A1396C /* testspriteminimal.app */, + DB166E9116A1D78C00A1396C /* teststreaming.app */, + DB0F48EC17CA51E5008798C5 /* testdrawchessboard.app */, + DB0F490117CA5212008798C5 /* testfilesystem.app */, + DB89957E18A19ABA0092407C /* testhotplug.app */, DB445EF818184B7000B306B0 /* testdropfile.app */, - DBEC54EA1A1A81C3005B1EAB /* controllermap */, + DBEC54EA1A1A81C3005B1EAB /* controllermap.app */, F3C17CDC28E416CF00E1A26D /* testgeometry.app */, ); name = Products; @@ -1412,6 +2073,13 @@ path = ../../src/test; sourceTree = ""; }; + F3A249CF2B389C7A00A5162D /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -1431,6 +2099,7 @@ buildPhases = ( 0017957910741F7900F5D044 /* Sources */, 0017957A10741F7900F5D044 /* Frameworks */, + F3A249E92B389CF000A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1438,7 +2107,7 @@ ); name = testatomic; productName = testalpha; - productReference = 0017958C10741F7900F5D044 /* testatomic */; + productReference = 0017958C10741F7900F5D044 /* testatomic.app */; productType = "com.apple.product-type.application"; }; 00179595107421BF00F5D044 /* testaudioinfo */ = { @@ -1447,6 +2116,7 @@ buildPhases = ( 0017959A107421BF00F5D044 /* Sources */, 0017959B107421BF00F5D044 /* Frameworks */, + F3A249EC2B389CFB00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1454,7 +2124,7 @@ ); name = testaudioinfo; productName = testalpha; - productReference = 001795AD107421BF00F5D044 /* testaudioinfo */; + productReference = 001795AD107421BF00F5D044 /* testaudioinfo.app */; productType = "com.apple.product-type.application"; }; 0017970910742F3200F5D044 /* testgl2 */ = { @@ -1463,6 +2133,7 @@ buildPhases = ( 0017970E10742F3200F5D044 /* Sources */, 0017970F10742F3200F5D044 /* Frameworks */, + F3A24A0A2B389D8A00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1479,6 +2150,7 @@ buildPhases = ( 00179735107430D600F5D044 /* Sources */, 00179736107430D600F5D044 /* Frameworks */, + F3A24A0D2B389D9B00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1486,7 +2158,7 @@ ); name = testhaptic; productName = testalpha; - productReference = 00179748107430D600F5D044 /* testhaptic */; + productReference = 00179748107430D600F5D044 /* testhaptic.app */; productType = "com.apple.product-type.application"; }; 00179756107431B300F5D044 /* testdraw2 */ = { @@ -1495,6 +2167,7 @@ buildPhases = ( 0017975B107431B300F5D044 /* Sources */, 0017975C107431B300F5D044 /* Frameworks */, + F3A249EF2B389D0900A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1502,7 +2175,7 @@ ); name = testdraw2; productName = testalpha; - productReference = 0017976E107431B300F5D044 /* testdraw2 */; + productReference = 0017976E107431B300F5D044 /* testdraw2.app */; productType = "com.apple.product-type.application"; }; 00179776107432AE00F5D044 /* testime */ = { @@ -1511,6 +2184,7 @@ buildPhases = ( 0017977B107432AE00F5D044 /* Sources */, 0017977C107432AE00F5D044 /* Frameworks */, + F3A24A162B389DC000A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1518,7 +2192,7 @@ ); name = testime; productName = testalpha; - productReference = 0017978E107432AE00F5D044 /* testime */; + productReference = 0017978E107432AE00F5D044 /* testime.app */; productType = "com.apple.product-type.application"; }; 001797961074334C00F5D044 /* testintersections */ = { @@ -1527,6 +2201,7 @@ buildPhases = ( 0017979B1074334C00F5D044 /* Sources */, 0017979C1074334C00F5D044 /* Frameworks */, + F3A24A192B389DCA00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1534,7 +2209,7 @@ ); name = testintersections; productName = testalpha; - productReference = 001797AE1074334C00F5D044 /* testintersections */; + productReference = 001797AE1074334C00F5D044 /* testintersections.app */; productType = "com.apple.product-type.application"; }; 001797B8107433C600F5D044 /* testloadso */ = { @@ -1543,6 +2218,7 @@ buildPhases = ( 001797BD107433C600F5D044 /* Sources */, 001797BE107433C600F5D044 /* Frameworks */, + F3A24A222B389DEB00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1550,7 +2226,7 @@ ); name = testloadso; productName = testalpha; - productReference = 001797D0107433C600F5D044 /* testloadso */; + productReference = 001797D0107433C600F5D044 /* testloadso.app */; productType = "com.apple.product-type.application"; }; 001797FA1074355200F5D044 /* testmultiaudio */ = { @@ -1560,6 +2236,7 @@ 001797FF1074355200F5D044 /* Sources */, 001798001074355200F5D044 /* Frameworks */, F3C17D3828E424B100E1A26D /* Resources */, + F3A24A2B2B389E0900A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1567,7 +2244,7 @@ ); name = testmultiaudio; productName = testalpha; - productReference = 001798121074355200F5D044 /* testmultiaudio */; + productReference = 001798121074355200F5D044 /* testmultiaudio.app */; productType = "com.apple.product-type.application"; }; 001798781074392D00F5D044 /* testnative */ = { @@ -1577,6 +2254,7 @@ 0017987E1074392D00F5D044 /* Sources */, 001798821074392D00F5D044 /* Frameworks */, DB166DDA16A1D40F00A1396C /* CopyFiles */, + F3A24A2E2B389E1500A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1593,6 +2271,7 @@ buildPhases = ( 001798A2107439DF00F5D044 /* Sources */, 001798A3107439DF00F5D044 /* Frameworks */, + F3A24A382B389E4F00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1600,7 +2279,7 @@ ); name = testpower; productName = testalpha; - productReference = 001798B5107439DF00F5D044 /* testpower */; + productReference = 001798B5107439DF00F5D044 /* testpower.app */; productType = "com.apple.product-type.application"; }; 001798DA10743BEC00F5D044 /* testresample */ = { @@ -1609,6 +2288,7 @@ buildPhases = ( 001798DF10743BEC00F5D044 /* Sources */, 001798E010743BEC00F5D044 /* Frameworks */, + F3A24A442B389E7C00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1616,7 +2296,7 @@ ); name = testresample; productName = testalpha; - productReference = 001798F210743BEC00F5D044 /* testresample */; + productReference = 001798F210743BEC00F5D044 /* testresample.app */; productType = "com.apple.product-type.application"; }; 001798FE10743F1000F5D044 /* testsprite2 */ = { @@ -1626,6 +2306,7 @@ 0017990310743F1000F5D044 /* Sources */, 0017990410743F1000F5D044 /* Frameworks */, F3C17D3A28E4252200E1A26D /* Resources */, + F3A249DD2B389C7A00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1633,7 +2314,7 @@ ); name = testsprite2; productName = testalpha; - productReference = 0017991610743F1000F5D044 /* testsprite2 */; + productReference = 0017991610743F1000F5D044 /* testsprite2.app */; productType = "com.apple.product-type.application"; }; 0017992010743FB700F5D044 /* testwm2 */ = { @@ -1642,6 +2323,7 @@ buildPhases = ( 0017992510743FB700F5D044 /* Sources */, 0017992610743FB700F5D044 /* Frameworks */, + F3A24A652B389EF900A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1649,7 +2331,7 @@ ); name = testwm2; productName = testalpha; - productReference = 0017993810743FB700F5D044 /* testwm2 */; + productReference = 0017993810743FB700F5D044 /* testwm2.app */; productType = "com.apple.product-type.application"; }; 002F340109CA1BFF00EBEB88 /* testfile */ = { @@ -1658,6 +2340,7 @@ buildPhases = ( 002F340709CA1BFF00EBEB88 /* Sources */, 002F340809CA1BFF00EBEB88 /* Frameworks */, + F3A249FB2B389D5200A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1665,7 +2348,7 @@ ); name = testfile; productName = testalpha; - productReference = 002F341209CA1BFF00EBEB88 /* testfile */; + productReference = 002F341209CA1BFF00EBEB88 /* testfile.app */; productType = "com.apple.product-type.application"; }; 002F342009CA1F0300EBEB88 /* testiconv */ = { @@ -1675,6 +2358,7 @@ 002F342609CA1F0300EBEB88 /* Sources */, 002F342709CA1F0300EBEB88 /* Frameworks */, 00794EEC09D2371F003FC8A1 /* CopyFiles */, + F3A24A132B389DB400A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1682,7 +2366,7 @@ ); name = testiconv; productName = testalpha; - productReference = 002F343109CA1F0300EBEB88 /* testiconv */; + productReference = 002F343109CA1F0300EBEB88 /* testiconv.app */; productType = "com.apple.product-type.application"; }; 002F343C09CA1FB300EBEB88 /* testoverlay2 */ = { @@ -1692,6 +2376,7 @@ 002F344209CA1FB300EBEB88 /* Sources */, 002F344309CA1FB300EBEB88 /* Frameworks */, 00794EF409D237C7003FC8A1 /* CopyFiles */, + F3A24A322B389E2800A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1699,7 +2384,7 @@ ); name = testoverlay2; productName = testalpha; - productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2 */; + productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2.app */; productType = "com.apple.product-type.application"; }; 002F345909CA204F00EBEB88 /* testplatform */ = { @@ -1708,6 +2393,7 @@ buildPhases = ( 002F345F09CA204F00EBEB88 /* Sources */, 002F346009CA204F00EBEB88 /* Frameworks */, + F3A24A352B389E3200A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1715,7 +2401,7 @@ ); name = testplatform; productName = testalpha; - productReference = 002F346A09CA204F00EBEB88 /* testplatform */; + productReference = 002F346A09CA204F00EBEB88 /* testplatform.app */; productType = "com.apple.product-type.application"; }; 4537749112091504002F0F45 /* testshape */ = { @@ -1725,6 +2411,7 @@ 4537748F12091504002F0F45 /* Sources */, 4537749012091504002F0F45 /* Frameworks */, DB166ECE16A1D85400A1396C /* CopyFiles */, + F3A24A532B389EB600A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1732,7 +2419,7 @@ ); name = testshape; productName = testshape; - productReference = 4537749212091504002F0F45 /* testshape */; + productReference = 4537749212091504002F0F45 /* testshape.app */; productType = "com.apple.product-type.application"; }; BBFC08B7164C6862003E6A99 /* testgamecontroller */ = { @@ -1742,6 +2429,7 @@ BBFC08BC164C6862003E6A99 /* Sources */, BBFC08BE164C6862003E6A99 /* Frameworks */, F3C17D3528E4242100E1A26D /* Resources */, + F3A24A012B389D6600A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1749,7 +2437,7 @@ ); name = testgamecontroller; productName = testjoystick; - productReference = BBFC08CD164C6862003E6A99 /* testgamecontroller */; + productReference = BBFC08CD164C6862003E6A99 /* testgamecontroller.app */; productType = "com.apple.product-type.application"; }; BEC566AB0761D90300A33029 /* checkkeys */ = { @@ -1758,6 +2446,7 @@ buildPhases = ( BEC566B00761D90300A33029 /* Sources */, BEC566B20761D90300A33029 /* Frameworks */, + F3A249E02B389CCA00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1765,7 +2454,7 @@ ); name = checkkeys; productName = checkkeys; - productReference = BEC566B60761D90300A33029 /* checkkeys */; + productReference = BEC566B60761D90300A33029 /* checkkeys.app */; productType = "com.apple.product-type.application"; }; BEC566C50761D90300A33029 /* loopwave */ = { @@ -1775,6 +2464,7 @@ BEC566CA0761D90300A33029 /* Sources */, BEC566CC0761D90300A33029 /* Frameworks */, 00794E6409D2084F003FC8A1 /* CopyFiles */, + F3A249E62B389CE700A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1782,7 +2472,7 @@ ); name = loopwave; productName = loopwave; - productReference = BEC566D10761D90300A33029 /* loopwave */; + productReference = BEC566D10761D90300A33029 /* loopwave.app */; productType = "com.apple.product-type.application"; }; BEC566FB0761D90300A33029 /* testerror */ = { @@ -1791,6 +2481,7 @@ buildPhases = ( BEC567000761D90300A33029 /* Sources */, BEC567020761D90300A33029 /* Frameworks */, + F3A249F82B389D4400A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1798,7 +2489,7 @@ ); name = testerror; productName = testerror; - productReference = BEC567060761D90400A33029 /* testerror */; + productReference = BEC567060761D90400A33029 /* testerror.app */; productType = "com.apple.product-type.application"; }; BEC567230761D90400A33029 /* testthread */ = { @@ -1807,6 +2498,7 @@ buildPhases = ( BEC567280761D90400A33029 /* Sources */, BEC5672A0761D90400A33029 /* Frameworks */, + F3A24A5C2B389ED800A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1814,7 +2506,7 @@ ); name = testthread; productName = testthread; - productReference = BEC5672E0761D90400A33029 /* testthread */; + productReference = BEC5672E0761D90400A33029 /* testthread.app */; productType = "com.apple.product-type.application"; }; BEC567300761D90400A33029 /* testjoystick */ = { @@ -1823,6 +2515,7 @@ buildPhases = ( BEC567350761D90400A33029 /* Sources */, BEC567370761D90400A33029 /* Frameworks */, + F3A24A1C2B389DD600A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1830,7 +2523,7 @@ ); name = testjoystick; productName = testjoystick; - productReference = BEC5673B0761D90400A33029 /* testjoystick */; + productReference = BEC5673B0761D90400A33029 /* testjoystick.app */; productType = "com.apple.product-type.application"; }; BEC5673D0761D90400A33029 /* testkeys */ = { @@ -1839,6 +2532,7 @@ buildPhases = ( BEC567420761D90400A33029 /* Sources */, BEC567440761D90400A33029 /* Frameworks */, + F3A24A1F2B389DE100A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1846,7 +2540,7 @@ ); name = testkeys; productName = testkeys; - productReference = BEC567480761D90400A33029 /* testkeys */; + productReference = BEC567480761D90400A33029 /* testkeys.app */; productType = "com.apple.product-type.application"; }; BEC5674A0761D90400A33029 /* testlock */ = { @@ -1855,6 +2549,7 @@ buildPhases = ( BEC5674F0761D90400A33029 /* Sources */, BEC567510761D90400A33029 /* Frameworks */, + F3A24A252B389DF500A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1862,7 +2557,7 @@ ); name = testlock; productName = testlock; - productReference = BEC567550761D90400A33029 /* testlock */; + productReference = BEC567550761D90400A33029 /* testlock.app */; productType = "com.apple.product-type.application"; }; BEC567720761D90500A33029 /* testsem */ = { @@ -1871,6 +2566,7 @@ buildPhases = ( BEC567770761D90500A33029 /* Sources */, BEC567790761D90500A33029 /* Frameworks */, + F3A24A4D2B389E9C00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1878,7 +2574,7 @@ ); name = testsem; productName = testsem; - productReference = BEC5677D0761D90500A33029 /* testsem */; + productReference = BEC5677D0761D90500A33029 /* testsem.app */; productType = "com.apple.product-type.application"; }; BEC5678D0761D90500A33029 /* testtimer */ = { @@ -1887,6 +2583,7 @@ buildPhases = ( BEC567920761D90500A33029 /* Sources */, BEC567940761D90500A33029 /* Frameworks */, + F3A24A5F2B389EE200A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1894,7 +2591,7 @@ ); name = testtimer; productName = testtimer; - productReference = BEC567980761D90500A33029 /* testtimer */; + productReference = BEC567980761D90500A33029 /* testtimer.app */; productType = "com.apple.product-type.application"; }; BEC567A70761D90500A33029 /* testversion */ = { @@ -1903,6 +2600,7 @@ buildPhases = ( BEC567AC0761D90500A33029 /* Sources */, BEC567AE0761D90500A33029 /* Frameworks */, + F3A24A622B389EED00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1910,7 +2608,7 @@ ); name = testversion; productName = testversion; - productReference = BEC567B20761D90500A33029 /* testversion */; + productReference = BEC567B20761D90500A33029 /* testversion.app */; productType = "com.apple.product-type.application"; }; BEC567EA0761D90600A33029 /* torturethread */ = { @@ -1919,6 +2617,7 @@ buildPhases = ( BEC567EF0761D90600A33029 /* Sources */, BEC567F10761D90600A33029 /* Frameworks */, + F3A24A682B389F0400A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1926,7 +2625,7 @@ ); name = torturethread; productName = torturethread; - productReference = BEC567F50761D90600A33029 /* torturethread */; + productReference = BEC567F50761D90600A33029 /* torturethread.app */; productType = "com.apple.product-type.application"; }; DB0F48D917CA51E5008798C5 /* testdrawchessboard */ = { @@ -1935,6 +2634,7 @@ buildPhases = ( DB0F48DA17CA51E5008798C5 /* Sources */, DB0F48DC17CA51E5008798C5 /* Frameworks */, + F3A249F22B389D3100A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1942,7 +2642,7 @@ ); name = testdrawchessboard; productName = testalpha; - productReference = DB0F48EC17CA51E5008798C5 /* testdrawchessboard */; + productReference = DB0F48EC17CA51E5008798C5 /* testdrawchessboard.app */; productType = "com.apple.product-type.application"; }; DB0F48EF17CA5212008798C5 /* testfilesystem */ = { @@ -1951,6 +2651,7 @@ buildPhases = ( DB0F48F017CA5212008798C5 /* Sources */, DB0F48F217CA5212008798C5 /* Frameworks */, + F3A249FE2B389D5B00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1958,7 +2659,7 @@ ); name = testfilesystem; productName = testalpha; - productReference = DB0F490117CA5212008798C5 /* testfilesystem */; + productReference = DB0F490117CA5212008798C5 /* testfilesystem.app */; productType = "com.apple.product-type.application"; }; DB166D7E16A1D12400A1396C /* SDL_test */ = { @@ -1984,6 +2685,7 @@ buildPhases = ( DB166DAE16A1D2F600A1396C /* Sources */, DB166DB016A1D2F600A1396C /* Frameworks */, + F3A24A072B389D7C00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -1991,7 +2693,7 @@ ); name = testgesture; productName = testalpha; - productReference = DB166DBF16A1D2F600A1396C /* testgesture */; + productReference = DB166DBF16A1D2F600A1396C /* testgesture.app */; productType = "com.apple.product-type.application"; }; DB166DC416A1D36A00A1396C /* testmessage */ = { @@ -2000,6 +2702,7 @@ buildPhases = ( DB166DC516A1D36A00A1396C /* Sources */, DB166DC716A1D36A00A1396C /* Frameworks */, + F3A24A282B389E0000A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2007,7 +2710,7 @@ ); name = testmessage; productName = testalpha; - productReference = DB166DD516A1D36A00A1396C /* testmessage */; + productReference = DB166DD516A1D36A00A1396C /* testmessage.app */; productType = "com.apple.product-type.application"; }; DB166DDC16A1D50C00A1396C /* testrelative */ = { @@ -2016,6 +2719,7 @@ buildPhases = ( DB166DDD16A1D50C00A1396C /* Sources */, DB166DDF16A1D50C00A1396C /* Frameworks */, + F3A24A3B2B389E5D00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2023,7 +2727,7 @@ ); name = testrelative; productName = testalpha; - productReference = DB166DEE16A1D50C00A1396C /* testrelative */; + productReference = DB166DEE16A1D50C00A1396C /* testrelative.app */; productType = "com.apple.product-type.application"; }; DB166DF316A1D57C00A1396C /* testrendercopyex */ = { @@ -2033,6 +2737,7 @@ DB166DF416A1D57C00A1396C /* Sources */, DB166DF616A1D57C00A1396C /* Frameworks */, DB166E2116A1D5DF00A1396C /* CopyFiles */, + F3A24A3E2B389E6600A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2040,7 +2745,7 @@ ); name = testrendercopyex; productName = testalpha; - productReference = DB166E0516A1D57C00A1396C /* testrendercopyex */; + productReference = DB166E0516A1D57C00A1396C /* testrendercopyex.app */; productType = "com.apple.product-type.application"; }; DB166E0A16A1D5AD00A1396C /* testrendertarget */ = { @@ -2050,6 +2755,7 @@ DB166E0B16A1D5AD00A1396C /* Sources */, DB166E0D16A1D5AD00A1396C /* Frameworks */, DB166E2416A1D61000A1396C /* CopyFiles */, + F3A24A412B389E7200A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2057,7 +2763,7 @@ ); name = testrendertarget; productName = testalpha; - productReference = DB166E1C16A1D5AD00A1396C /* testrendertarget */; + productReference = DB166E1C16A1D5AD00A1396C /* testrendertarget.app */; productType = "com.apple.product-type.application"; }; DB166E2716A1D64D00A1396C /* testrumble */ = { @@ -2066,6 +2772,7 @@ buildPhases = ( DB166E2816A1D64D00A1396C /* Sources */, DB166E2A16A1D64D00A1396C /* Frameworks */, + F3A24A472B389E8700A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2073,7 +2780,7 @@ ); name = testrumble; productName = testalpha; - productReference = DB166E3816A1D64D00A1396C /* testrumble */; + productReference = DB166E3816A1D64D00A1396C /* testrumble.app */; productType = "com.apple.product-type.application"; }; DB166E3D16A1D69000A1396C /* testscale */ = { @@ -2083,6 +2790,7 @@ DB166E3E16A1D69000A1396C /* Sources */, DB166E4016A1D69000A1396C /* Frameworks */, DB166E4C16A1D69000A1396C /* CopyFiles */, + F3A24A4A2B389E9100A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2090,7 +2798,7 @@ ); name = testscale; productName = testalpha; - productReference = DB166E5216A1D69000A1396C /* testscale */; + productReference = DB166E5216A1D69000A1396C /* testscale.app */; productType = "com.apple.product-type.application"; }; DB166E5716A1D6F300A1396C /* testshader */ = { @@ -2099,6 +2807,7 @@ buildPhases = ( DB166E5816A1D6F300A1396C /* Sources */, DB166E5A16A1D6F300A1396C /* Frameworks */, + F3A24A502B389EA600A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2106,7 +2815,7 @@ ); name = testshader; productName = testsem; - productReference = DB166E6816A1D6F300A1396C /* testshader */; + productReference = DB166E6816A1D6F300A1396C /* testshader.app */; productType = "com.apple.product-type.application"; }; DB166E6D16A1D78400A1396C /* testspriteminimal */ = { @@ -2116,6 +2825,7 @@ DB166E6E16A1D78400A1396C /* Sources */, DB166E7016A1D78400A1396C /* Frameworks */, DB166E9B16A1D7FC00A1396C /* CopyFiles */, + F3A24A562B389EC200A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2123,7 +2833,7 @@ ); name = testspriteminimal; productName = testspriteminimal; - productReference = DB166E7E16A1D78400A1396C /* testspriteminimal */; + productReference = DB166E7E16A1D78400A1396C /* testspriteminimal.app */; productType = "com.apple.product-type.application"; }; DB166E8016A1D78C00A1396C /* teststreaming */ = { @@ -2133,6 +2843,7 @@ DB166E8116A1D78C00A1396C /* Sources */, DB166E8316A1D78C00A1396C /* Frameworks */, DB166E9916A1D7EE00A1396C /* CopyFiles */, + F3A24A592B389ECD00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2140,7 +2851,7 @@ ); name = teststreaming; productName = teststreaming; - productReference = DB166E9116A1D78C00A1396C /* teststreaming */; + productReference = DB166E9116A1D78C00A1396C /* teststreaming.app */; productType = "com.apple.product-type.application"; }; DB445EE618184B7000B306B0 /* testdropfile */ = { @@ -2149,6 +2860,7 @@ buildPhases = ( DB445EE718184B7000B306B0 /* Sources */, DB445EE918184B7000B306B0 /* Frameworks */, + F3A249F52B389D3B00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2165,6 +2877,7 @@ buildPhases = ( DB89956E18A19ABA0092407C /* Sources */, DB89957018A19ABA0092407C /* Frameworks */, + F3A24A102B389DA800A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2172,7 +2885,7 @@ ); name = testhotplug; productName = testalpha; - productReference = DB89957E18A19ABA0092407C /* testhotplug */; + productReference = DB89957E18A19ABA0092407C /* testhotplug.app */; productType = "com.apple.product-type.application"; }; DBEC54D91A1A81C3005B1EAB /* controllermap */ = { @@ -2182,6 +2895,7 @@ DBEC54DA1A1A81C3005B1EAB /* Sources */, DBEC54DC1A1A81C3005B1EAB /* Frameworks */, DBEC54EC1A1A827C005B1EAB /* CopyFiles */, + F3A249E32B389CDB00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2189,7 +2903,7 @@ ); name = controllermap; productName = checkkeys; - productReference = DBEC54EA1A1A81C3005B1EAB /* controllermap */; + productReference = DBEC54EA1A1A81C3005B1EAB /* controllermap.app */; productType = "com.apple.product-type.application"; }; F3C17CDB28E416CF00E1A26D /* testgeometry */ = { @@ -2198,6 +2912,7 @@ buildPhases = ( F3C17CD828E416CF00E1A26D /* Sources */, F3C17CD928E416CF00E1A26D /* Frameworks */, + F3A24A042B389D6F00A5162D /* Embed Frameworks */, ); buildRules = ( ); @@ -2217,8 +2932,153 @@ LastSwiftUpdateCheck = 1400; LastUpgradeCheck = 0420; TargetAttributes = { + 0017957410741F7900F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 00179595107421BF00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 0017970910742F3200F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 00179730107430D600F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 00179756107431B300F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 00179776107432AE00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001797961074334C00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001797B8107433C600F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001797FA1074355200F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001798781074392D00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 0017989D107439DF00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001798DA10743BEC00F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 001798FE10743F1000F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 0017992010743FB700F5D044 = { + DevelopmentTeam = EH385AYQ6F; + }; + 002F340109CA1BFF00EBEB88 = { + DevelopmentTeam = EH385AYQ6F; + }; + 002F342009CA1F0300EBEB88 = { + DevelopmentTeam = EH385AYQ6F; + }; + 002F343C09CA1FB300EBEB88 = { + DevelopmentTeam = EH385AYQ6F; + }; + 002F345909CA204F00EBEB88 = { + DevelopmentTeam = EH385AYQ6F; + }; + 4537749112091504002F0F45 = { + DevelopmentTeam = EH385AYQ6F; + }; + BBFC08B7164C6862003E6A99 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC566920761D90300A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC566AB0761D90300A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC566C50761D90300A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC566FB0761D90300A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC567230761D90400A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC567300761D90400A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC5673D0761D90400A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC5674A0761D90400A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC567720761D90500A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC5678D0761D90500A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC567A70761D90500A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + BEC567EA0761D90600A33029 = { + DevelopmentTeam = EH385AYQ6F; + }; + DB0F48D917CA51E5008798C5 = { + DevelopmentTeam = EH385AYQ6F; + }; + DB0F48EF17CA5212008798C5 = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166D7E16A1D12400A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166DAD16A1D2F600A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166DC416A1D36A00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166DDC16A1D50C00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166DF316A1D57C00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E0A16A1D5AD00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E2716A1D64D00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E3D16A1D69000A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E5716A1D6F300A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E6D16A1D78400A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB166E8016A1D78C00A1396C = { + DevelopmentTeam = EH385AYQ6F; + }; + DB445EE618184B7000B306B0 = { + DevelopmentTeam = EH385AYQ6F; + }; + DB89956D18A19ABA0092407C = { + DevelopmentTeam = EH385AYQ6F; + }; + DBEC54D91A1A81C3005B1EAB = { + DevelopmentTeam = EH385AYQ6F; + }; F3C17CDB28E416CF00E1A26D = { CreatedOnToolsVersion = 14.0.1; + DevelopmentTeam = EH385AYQ6F; }; }; }; @@ -3387,6 +4247,8 @@ 002A85C51073008E007319AE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + INFOPLIST_FILE = "testoverlay2-Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; PRODUCT_NAME = testoverlay2; }; name = Debug; @@ -3524,6 +4386,8 @@ 002A85E71073009D007319AE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + INFOPLIST_FILE = "testoverlay2-Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; PRODUCT_NAME = testoverlay2; }; name = Release; diff --git a/acinclude/libtool.m4 b/acinclude/libtool.m4 index 3236ddab00bec..dd8e3962ee34d 100644 --- a/acinclude/libtool.m4 +++ b/acinclude/libtool.m4 @@ -219,8 +219,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -1023,6 +1023,21 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ rm -f conftest.* fi]) + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + AC_CACHE_CHECK([for -no_fixup_chains linker flag], + [lt_cv_support_no_fixup_chains], + [ save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([],[])], + lt_cv_support_no_fixup_chains=yes, + lt_cv_support_no_fixup_chains=no + ) + LDFLAGS=$save_LDFLAGS + ] + ) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no @@ -1047,7 +1062,7 @@ _LT_EOF echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -1072,7 +1087,12 @@ _LT_EOF 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + if test yes = "$lt_cv_support_no_fixup_chains"; then + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains' + else + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + fi + ;; esac ;; esac @@ -1365,7 +1385,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -1380,7 +1400,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" @@ -1409,7 +1429,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) @@ -1540,15 +1560,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -1687,7 +1700,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1869,11 +1882,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -1930,7 +1943,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -2298,7 +2311,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -2356,7 +2369,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -2525,7 +2538,7 @@ bsdi[[45]]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -2554,14 +2567,14 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' #soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization. m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix #soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization. ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -2571,14 +2584,14 @@ m4_if([$1], [],[ dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -2628,7 +2641,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -3267,7 +3280,7 @@ if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -3376,7 +3389,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -3473,10 +3486,10 @@ cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' - lt_cv_deplibs_check_method=pass_all # SDL customization + lt_cv_deplibs_check_method=pass_all # SDL customization. ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -3485,10 +3498,10 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi - lt_cv_deplibs_check_method=pass_all # SDL customization + lt_cv_deplibs_check_method=pass_all # SDL customization. ;; cegcc*) @@ -3641,7 +3654,7 @@ file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -3693,7 +3706,7 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in @@ -3784,7 +3797,7 @@ lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -3929,7 +3942,7 @@ case $host_os in aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) @@ -4008,7 +4021,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -4023,7 +4036,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4059,7 +4072,7 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then @@ -4235,7 +4248,7 @@ m4_if([$1], [CXX], [ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -4311,7 +4324,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -4559,7 +4572,7 @@ m4_if([$1], [CXX], [ # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -4663,7 +4676,7 @@ m4_if([$1], [CXX], [ esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], @@ -4938,9 +4951,9 @@ m4_if([$1], [CXX], [ pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4996,16 +5009,16 @@ dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + cygwin* | mingw* | windows* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5111,7 +5124,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' @@ -5568,14 +5581,14 @@ _LT_EOF _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5585,14 +5598,14 @@ _LT_EOF # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_cmds, $1)='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' @@ -5616,7 +5629,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -6225,7 +6238,7 @@ _LT_TAGVAR(objext, $1)=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other @@ -6435,7 +6448,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else GXX=no @@ -6644,10 +6657,10 @@ if test yes != "$_lt_caught_CXX_error"; then esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6811,7 +6824,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6876,7 +6889,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7215,7 +7228,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # FIXME: insert proper C++ library support @@ -7299,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7310,7 +7323,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' @@ -8331,7 +8344,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -8344,7 +8357,7 @@ AC_CACHE_VAL(lt_cv_to_host_file_cmd, ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -8370,9 +8383,9 @@ AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac diff --git a/acinclude/ltoptions.m4 b/acinclude/ltoptions.m4 index 94b082976667c..7d7e68864bbf3 100644 --- a/acinclude/ltoptions.m4 +++ b/acinclude/ltoptions.m4 @@ -128,7 +128,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) diff --git a/android-project/app/build.gradle b/android-project/app/build.gradle index baa0edc8de148..4d416e96af7cb 100644 --- a/android-project/app/build.gradle +++ b/android-project/app/build.gradle @@ -8,22 +8,22 @@ else { } android { - compileSdkVersion 31 + if (buildAsApplication) { + namespace "org.libsdl.app" + } + compileSdkVersion 35 defaultConfig { - if (buildAsApplication) { - applicationId "org.libsdl.app" - } - minSdkVersion 16 - targetSdkVersion 31 + minSdkVersion 21 + targetSdkVersion 35 versionCode 1 versionName "1.0" externalNativeBuild { ndkBuild { - arguments "APP_PLATFORM=android-16" + arguments "APP_PLATFORM=android-21" abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } // cmake { - // arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static" + // arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static" // // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' // abiFilters 'arm64-v8a' // } @@ -53,10 +53,10 @@ android { } } - lintOptions { + lint { abortOnError false } - + if (buildAsLibrary) { libraryVariants.all { variant -> variant.outputs.each { output -> diff --git a/android-project/app/proguard-rules.pro b/android-project/app/proguard-rules.pro index eaf0e916cdf0b..a4c988665bf8a 100644 --- a/android-project/app/proguard-rules.pro +++ b/android-project/app/proguard-rules.pro @@ -15,3 +15,84 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLInputConnection { + void nativeCommitText(java.lang.String, int); + void nativeGenerateScancodeForUnichar(char); +} + +-keep,includedescriptorclasses class org.libsdl.app.SDLActivity { + # for some reason these aren't compatible with allowoptimization modifier + boolean supportsRelativeMouse(); + void setWindowStyle(boolean); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLActivity { + java.lang.String nativeGetHint(java.lang.String); # Java-side doesn't use this, so it gets minified, but C-side still tries to register it + boolean onNativeSoftReturnKey(); + void onNativeKeyboardFocusLost(); + boolean isScreenKeyboardShown(); + android.util.DisplayMetrics getDisplayDPI(); + java.lang.String clipboardGetText(); + boolean clipboardHasText(); + void clipboardSetText(java.lang.String); + int createCustomCursor(int[], int, int, int, int); + void destroyCustomCursor(int); + android.content.Context getContext(); + boolean getManifestEnvironmentVariables(); + android.view.Surface getNativeSurface(); + void initTouch(); + boolean isAndroidTV(); + boolean isChromebook(); + boolean isDeXMode(); + boolean isTablet(); + void manualBackButton(); + int messageboxShowMessageBox(int, java.lang.String, java.lang.String, int[], int[], java.lang.String[], int[]); + void minimizeWindow(); + int openURL(java.lang.String); + void requestPermission(java.lang.String, int); + int showToast(java.lang.String, int, int, int, int); + boolean sendMessage(int, int); + boolean setActivityTitle(java.lang.String); + boolean setCustomCursor(int); + void setOrientation(int, int, boolean, java.lang.String); + boolean setRelativeMouseEnabled(boolean); + boolean setSystemCursor(int); + boolean shouldMinimizeOnFocusLoss(); + boolean showTextInput(int, int, int, int); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.HIDDeviceManager { + boolean initialize(boolean, boolean); + boolean openDevice(int); + int sendOutputReport(int, byte[]); + int sendFeatureReport(int, byte[]); + boolean getFeatureReport(int, byte[]); + void closeDevice(int); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLAudioManager { + int[] getAudioOutputDevices(); + int[] getAudioInputDevices(); + int[] audioOpen(int, int, int, int, int); + void audioWriteFloatBuffer(float[]); + void audioWriteShortBuffer(short[]); + void audioWriteByteBuffer(byte[]); + void audioClose(); + int[] captureOpen(int, int, int, int, int); + int captureReadFloatBuffer(float[], boolean); + int captureReadShortBuffer(short[], boolean); + int captureReadByteBuffer(byte[], boolean); + void captureClose(); + void audioSetThreadPriority(boolean, int); + native int nativeSetupJNI(); + native void removeAudioDevice(boolean, int); + native void addAudioDevice(boolean, int); +} + +-keep,includedescriptorclasses,allowoptimization class org.libsdl.app.SDLControllerManager { + void pollInputDevices(); + void pollHapticDevices(); + void hapticRun(int, float, int); + void hapticStop(int); +} diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index d997afe4a49d4..5157374b52865 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -3,7 +3,6 @@ com.gamemaker.game --> @@ -63,7 +62,7 @@ - - diff --git a/android-project/build.gradle b/android-project/build.gradle index 6f629c8aa758e..639cd52b2ead4 100644 --- a/android-project/build.gradle +++ b/android-project/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.3' + classpath 'com.android.tools.build:gradle:8.6.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android-project/gradle/wrapper/gradle-wrapper.properties b/android-project/gradle/wrapper/gradle-wrapper.properties index ada5af48a6c48..9d17becdbebd3 100644 --- a/android-project/gradle/wrapper/gradle-wrapper.properties +++ b/android-project/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Nov 11 18:20:34 PST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/android-project/gradlew b/android-project/gradlew index 9d82f78915133..3427607f42fd1 100755 --- a/android-project/gradlew +++ b/android-project/gradlew @@ -126,8 +126,8 @@ if $cygwin ; then # Now convert the arguments - kludge to limit ourselves to /bin/sh i=0 for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` diff --git a/build-scripts/androidbuild.sh b/build-scripts/androidbuild.sh index 814578182432c..1a107e27dee25 100755 --- a/build-scripts/androidbuild.sh +++ b/build-scripts/androidbuild.sh @@ -80,7 +80,8 @@ do cd $folder done -ACTIVITY="${folder}Activity" +# Uppercase the first char in the activity class name because it's Java +ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity" sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml # Fill in a default Activity diff --git a/build-scripts/androidbuildlibs.sh b/build-scripts/androidbuildlibs.sh index dc72172936f75..0ee583ab77deb 100755 --- a/build-scripts/androidbuildlibs.sh +++ b/build-scripts/androidbuildlibs.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Build the Android libraries without needing a project # (AndroidManifest.xml, jni/{Application,Android}.mk, etc.) diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py new file mode 100755 index 0000000000000..e25bda8c11ce0 --- /dev/null +++ b/build-scripts/build-release.py @@ -0,0 +1,1561 @@ +#!/usr/bin/env python3 + +""" +This script is shared between SDL2, SDL3, and all satellite libraries. +Don't specialize this script for doing project-specific modifications. +Rather, modify release-info.json. +""" + +import argparse +import collections +import dataclasses +from collections.abc import Callable +import contextlib +import datetime +import fnmatch +import glob +import io +import json +import logging +import multiprocessing +import os +from pathlib import Path +import platform +import re +import shlex +import shutil +import subprocess +import sys +import tarfile +import tempfile +import textwrap +import typing +import zipfile + + +logger = logging.getLogger(__name__) +GIT_HASH_FILENAME = ".git-hash" +REVISION_TXT = "REVISION.txt" + +RE_ILLEGAL_MINGW_LIBRARIES = re.compile(r"(?:lib)?(?:gcc|(?:std)?c[+][+]|(?:win)?pthread).*", flags=re.I) + + +def safe_isotime_to_datetime(str_isotime: str) -> datetime.datetime: + try: + return datetime.datetime.fromisoformat(str_isotime) + except ValueError: + pass + logger.warning("Invalid iso time: %s", str_isotime) + if str_isotime[-6:-5] in ("+", "-"): + # Commits can have isotime with invalid timezone offset (e.g. "2021-07-04T20:01:40+32:00") + modified_str_isotime = str_isotime[:-6] + "+00:00" + try: + return datetime.datetime.fromisoformat(modified_str_isotime) + except ValueError: + pass + raise ValueError(f"Invalid isotime: {str_isotime}") + + +def arc_join(*parts: list[str]) -> str: + assert all(p[:1] != "/" and p[-1:] != "/" for p in parts), f"None of {parts} may start or end with '/'" + return "/".join(p for p in parts if p) + + +@dataclasses.dataclass(frozen=True) +class VsArchPlatformConfig: + arch: str + configuration: str + platform: str + + def extra_context(self): + return { + "ARCH": self.arch, + "CONFIGURATION": self.configuration, + "PLATFORM": self.platform, + } + + +@contextlib.contextmanager +def chdir(path): + original_cwd = os.getcwd() + try: + os.chdir(path) + yield + finally: + os.chdir(original_cwd) + + +class Executer: + def __init__(self, root: Path, dry: bool=False): + self.root = root + self.dry = dry + + def run(self, cmd, cwd=None, env=None): + logger.info("Executing args=%r", cmd) + sys.stdout.flush() + if not self.dry: + subprocess.check_call(cmd, cwd=cwd or self.root, env=env, text=True) + + def check_output(self, cmd, cwd=None, dry_out=None, env=None, text=True): + logger.info("Executing args=%r", cmd) + sys.stdout.flush() + if self.dry: + return dry_out + return subprocess.check_output(cmd, cwd=cwd or self.root, env=env, text=text) + + +class SectionPrinter: + @contextlib.contextmanager + def group(self, title: str): + print(f"{title}:") + yield + + +class GitHubSectionPrinter(SectionPrinter): + def __init__(self): + super().__init__() + self.in_group = False + + @contextlib.contextmanager + def group(self, title: str): + print(f"::group::{title}") + assert not self.in_group, "Can enter a group only once" + self.in_group = True + yield + self.in_group = False + print("::endgroup::") + + +class VisualStudio: + def __init__(self, executer: Executer, year: typing.Optional[str]=None): + self.executer = executer + self.vsdevcmd = self.find_vsdevcmd(year) + self.msbuild = self.find_msbuild() + + @property + def dry(self) -> bool: + return self.executer.dry + + VS_YEAR_TO_VERSION = { + "2022": 17, + "2019": 16, + "2017": 15, + "2015": 14, + "2013": 12, + } + + def find_vsdevcmd(self, year: typing.Optional[str]=None) -> typing.Optional[Path]: + vswhere_spec = ["-latest"] + if year is not None: + try: + version = self.VS_YEAR_TO_VERSION[year] + except KeyError: + logger.error("Invalid Visual Studio year") + return None + vswhere_spec.extend(["-version", f"[{version},{version+1})"]) + vswhere_cmd = ["vswhere"] + vswhere_spec + ["-property", "installationPath"] + vs_install_path = Path(self.executer.check_output(vswhere_cmd, dry_out="/tmp").strip()) + logger.info("VS install_path = %s", vs_install_path) + assert vs_install_path.is_dir(), "VS installation path does not exist" + vsdevcmd_path = vs_install_path / "Common7/Tools/vsdevcmd.bat" + logger.info("vsdevcmd path = %s", vsdevcmd_path) + if self.dry: + vsdevcmd_path.parent.mkdir(parents=True, exist_ok=True) + vsdevcmd_path.touch(exist_ok=True) + assert vsdevcmd_path.is_file(), "vsdevcmd.bat batch file does not exist" + return vsdevcmd_path + + def find_msbuild(self) -> typing.Optional[Path]: + vswhere_cmd = ["vswhere", "-latest", "-requires", "Microsoft.Component.MSBuild", "-find", r"MSBuild\**\Bin\MSBuild.exe"] + msbuild_path = Path(self.executer.check_output(vswhere_cmd, dry_out="/tmp/MSBuild.exe").strip()) + logger.info("MSBuild path = %s", msbuild_path) + if self.dry: + msbuild_path.parent.mkdir(parents=True, exist_ok=True) + msbuild_path.touch(exist_ok=True) + assert msbuild_path.is_file(), "MSBuild.exe does not exist" + return msbuild_path + + def build(self, arch_platform: VsArchPlatformConfig, projects: list[Path]): + assert projects, "Need at least one project to build" + + vsdev_cmd_str = f"\"{self.vsdevcmd}\" -arch={arch_platform.arch}" + msbuild_cmd_str = " && ".join([f"\"{self.msbuild}\" \"{project}\" /m /p:BuildInParallel=true /p:Platform={arch_platform.platform} /p:Configuration={arch_platform.configuration}" for project in projects]) + bat_contents = f"{vsdev_cmd_str} && {msbuild_cmd_str}\n" + bat_path = Path(tempfile.gettempdir()) / "cmd.bat" + with bat_path.open("w") as f: + f.write(bat_contents) + + logger.info("Running cmd.exe script (%s): %s", bat_path, bat_contents) + cmd = ["cmd.exe", "/D", "/E:ON", "/V:OFF", "/S", "/C", f"CALL {str(bat_path)}"] + self.executer.run(cmd) + + +class Archiver: + def __init__(self, zip_path: typing.Optional[Path]=None, tgz_path: typing.Optional[Path]=None, txz_path: typing.Optional[Path]=None): + self._zip_files = [] + self._tar_files = [] + self._added_files = set() + if zip_path: + self._zip_files.append(zipfile.ZipFile(zip_path, "w", compression=zipfile.ZIP_DEFLATED)) + if tgz_path: + self._tar_files.append(tarfile.open(tgz_path, "w:gz")) + if txz_path: + self._tar_files.append(tarfile.open(txz_path, "w:xz")) + + @property + def added_files(self) -> set[str]: + return self._added_files + + def add_file_data(self, arcpath: str, data: bytes, mode: int, time: datetime.datetime): + for zf in self._zip_files: + file_data_time = (time.year, time.month, time.day, time.hour, time.minute, time.second) + zip_info = zipfile.ZipInfo(filename=arcpath, date_time=file_data_time) + zip_info.external_attr = mode << 16 + zip_info.compress_type = zipfile.ZIP_DEFLATED + zf.writestr(zip_info, data=data) + for tf in self._tar_files: + tar_info = tarfile.TarInfo(arcpath) + tar_info.type = tarfile.REGTYPE + tar_info.mode = mode + tar_info.size = len(data) + tar_info.mtime = int(time.timestamp()) + tf.addfile(tar_info, fileobj=io.BytesIO(data)) + + self._added_files.add(arcpath) + + def add_symlink(self, arcpath: str, target: str, time: datetime.datetime, files_for_zip): + logger.debug("Adding symlink (target=%r) -> %s", target, arcpath) + for zf in self._zip_files: + file_data_time = (time.year, time.month, time.day, time.hour, time.minute, time.second) + for f in files_for_zip: + zip_info = zipfile.ZipInfo(filename=f["arcpath"], date_time=file_data_time) + zip_info.external_attr = f["mode"] << 16 + zip_info.compress_type = zipfile.ZIP_DEFLATED + zf.writestr(zip_info, data=f["data"]) + for tf in self._tar_files: + tar_info = tarfile.TarInfo(arcpath) + tar_info.type = tarfile.SYMTYPE + tar_info.mode = 0o777 + tar_info.mtime = int(time.timestamp()) + tar_info.linkname = target + tf.addfile(tar_info) + + self._added_files.update(f["arcpath"] for f in files_for_zip) + + def add_git_hash(self, arcdir: str, commit: str, time: datetime.datetime): + arcpath = arc_join(arcdir, GIT_HASH_FILENAME) + data = f"{commit}\n".encode() + self.add_file_data(arcpath=arcpath, data=data, mode=0o100644, time=time) + + def add_file_path(self, arcpath: str, path: Path): + assert path.is_file(), f"{path} should be a file" + logger.debug("Adding %s -> %s", path, arcpath) + for zf in self._zip_files: + zf.write(path, arcname=arcpath) + for tf in self._tar_files: + tf.add(path, arcname=arcpath) + + def add_file_directory(self, arcdirpath: str, dirpath: Path): + assert dirpath.is_dir() + if arcdirpath and arcdirpath[-1:] != "/": + arcdirpath += "/" + for f in dirpath.iterdir(): + if f.is_file(): + arcpath = f"{arcdirpath}{f.name}" + logger.debug("Adding %s to %s", f, arcpath) + self.add_file_path(arcpath=arcpath, path=f) + + def close(self): + # Archiver is intentionally made invalid after this function + del self._zip_files + self._zip_files = None + del self._tar_files + self._tar_files = None + + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + self.close() + + +class NodeInArchive: + def __init__(self, arcpath: str, path: typing.Optional[Path]=None, data: typing.Optional[bytes]=None, mode: typing.Optional[int]=None, symtarget: typing.Optional[str]=None, time: typing.Optional[datetime.datetime]=None, directory: bool=False): + self.arcpath = arcpath + self.path = path + self.data = data + self.mode = mode + self.symtarget = symtarget + self.time = time + self.directory = directory + + @classmethod + def from_fs(cls, arcpath: str, path: Path, mode: int=0o100644, time: typing.Optional[datetime.datetime]=None) -> "NodeInArchive": + if time is None: + time = datetime.datetime.fromtimestamp(os.stat(path).st_mtime) + return cls(arcpath=arcpath, path=path, mode=mode) + + @classmethod + def from_data(cls, arcpath: str, data: bytes, time: datetime.datetime) -> "NodeInArchive": + return cls(arcpath=arcpath, data=data, time=time, mode=0o100644) + + @classmethod + def from_text(cls, arcpath: str, text: str, time: datetime.datetime) -> "NodeInArchive": + return cls.from_data(arcpath=arcpath, data=text.encode(), time=time) + + @classmethod + def from_symlink(cls, arcpath: str, symtarget: str) -> "NodeInArchive": + return cls(arcpath=arcpath, symtarget=symtarget) + + @classmethod + def from_directory(cls, arcpath: str) -> "NodeInArchive": + return cls(arcpath=arcpath, directory=True) + + def __repr__(self) -> str: + return f"<{type(self).__name__}:arcpath={self.arcpath},path='{str(self.path)}',len(data)={len(self.data) if self.data else 'n/a'},directory={self.directory},symtarget={self.symtarget}>" + + +def configure_file(path: Path, context: dict[str, str]) -> bytes: + text = path.read_text() + return configure_text(text, context=context).encode() + + +def configure_text(text: str, context: dict[str, str]) -> str: + original_text = text + for txt, repl in context.items(): + text = text.replace(f"@<@{txt}@>@", repl) + success = all(thing not in text for thing in ("@<@", "@>@")) + if not success: + raise ValueError(f"Failed to configure {repr(original_text)}") + return text + + +def configure_text_list(text_list: list[str], context: dict[str, str]) -> list[str]: + return [configure_text(text=e, context=context) for e in text_list] + + +class ArchiveFileTree: + def __init__(self): + self._tree: dict[str, NodeInArchive] = {} + + def add_file(self, file: NodeInArchive): + self._tree[file.arcpath] = file + + def __iter__(self) -> typing.Iterable[NodeInArchive]: + yield from self._tree.values() + + def __contains__(self, value: str) -> bool: + return value in self._tree + + def get_latest_mod_time(self) -> datetime.datetime: + return max(item.time for item in self._tree.values() if item.time) + + def add_to_archiver(self, archive_base: str, archiver: Archiver): + remaining_symlinks = set() + added_files = dict() + + def calculate_symlink_target(s: NodeInArchive) -> str: + dest_dir = os.path.dirname(s.arcpath) + if dest_dir: + dest_dir += "/" + target = dest_dir + s.symtarget + while True: + new_target, n = re.subn(r"([^/]+/+[.]{2}/)", "", target) + target = new_target + if not n: + break + return target + + # Add files in first pass + for arcpath, node in self._tree.items(): + assert node is not None, f"{arcpath} -> node" + if node.data is not None: + archiver.add_file_data(arcpath=arc_join(archive_base, arcpath), data=node.data, time=node.time, mode=node.mode) + assert node.arcpath is not None, f"{node=}" + added_files[node.arcpath] = node + elif node.path is not None: + archiver.add_file_path(arcpath=arc_join(archive_base, arcpath), path=node.path) + assert node.arcpath is not None, f"{node=}" + added_files[node.arcpath] = node + elif node.symtarget is not None: + remaining_symlinks.add(node) + elif node.directory: + pass + else: + raise ValueError(f"Invalid Archive Node: {repr(node)}") + + assert None not in added_files + + # Resolve symlinks in second pass: zipfile does not support symlinks, so add files to zip archive + while True: + if not remaining_symlinks: + break + symlinks_this_time = set() + extra_added_files = {} + for symlink in remaining_symlinks: + symlink_files_for_zip = {} + symlink_target_path = calculate_symlink_target(symlink) + if symlink_target_path in added_files: + symlink_files_for_zip[symlink.arcpath] = added_files[symlink_target_path] + else: + symlink_target_path_slash = symlink_target_path + "/" + for added_file in added_files: + if added_file.startswith(symlink_target_path_slash): + path_in_symlink = symlink.arcpath + "/" + added_file.removeprefix(symlink_target_path_slash) + symlink_files_for_zip[path_in_symlink] = added_files[added_file] + if symlink_files_for_zip: + symlinks_this_time.add(symlink) + extra_added_files.update(symlink_files_for_zip) + files_for_zip = [{"arcpath": f"{archive_base}/{sym_path}", "data": sym_info.data, "mode": sym_info.mode} for sym_path, sym_info in symlink_files_for_zip.items()] + archiver.add_symlink(arcpath=f"{archive_base}/{symlink.arcpath}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip) + # if not symlinks_this_time: + # logger.info("files added: %r", set(path for path in added_files.keys())) + assert symlinks_this_time, f"No targets found for symlinks: {remaining_symlinks}" + remaining_symlinks.difference_update(symlinks_this_time) + added_files.update(extra_added_files) + + def add_directory_tree(self, arc_dir: str, path: Path, time: datetime.datetime): + assert path.is_dir() + for files_dir, _, filenames in os.walk(path): + files_dir_path = Path(files_dir) + rel_files_path = files_dir_path.relative_to(path) + for filename in filenames: + self.add_file(NodeInArchive.from_fs(arcpath=arc_join(arc_dir, str(rel_files_path), filename), path=files_dir_path / filename, time=time)) + + def _add_files_recursively(self, arc_dir: str, paths: list[Path], time: datetime.datetime): + logger.debug(f"_add_files_recursively({arc_dir=} {paths=})") + for path in paths: + arcpath = arc_join(arc_dir, path.name) + if path.is_file(): + logger.debug("Adding %s as %s", path, arcpath) + self.add_file(NodeInArchive.from_fs(arcpath=arcpath, path=path, time=time)) + elif path.is_dir(): + self._add_files_recursively(arc_dir=arc_join(arc_dir, path.name), paths=list(path.iterdir()), time=time) + else: + raise ValueError(f"Unsupported file type to add recursively: {path}") + + def add_file_mapping(self, arc_dir: str, file_mapping: dict[str, list[str]], file_mapping_root: Path, context: dict[str, str], time: datetime.datetime): + for meta_rel_destdir, meta_file_globs in file_mapping.items(): + rel_destdir = configure_text(meta_rel_destdir, context=context) + assert "@" not in rel_destdir, f"archive destination should not contain an @ after configuration ({repr(meta_rel_destdir)}->{repr(rel_destdir)})" + for meta_file_glob in meta_file_globs: + file_glob = configure_text(meta_file_glob, context=context) + assert "@" not in rel_destdir, f"archive glob should not contain an @ after configuration ({repr(meta_file_glob)}->{repr(file_glob)})" + if ":" in file_glob: + original_path, new_filename = file_glob.rsplit(":", 1) + assert ":" not in original_path, f"Too many ':' in {repr(file_glob)}" + assert "/" not in new_filename, f"New filename cannot contain a '/' in {repr(file_glob)}" + path = file_mapping_root / original_path + arcpath = arc_join(arc_dir, rel_destdir, new_filename) + if path.suffix == ".in": + data = configure_file(path, context=context) + logger.debug("Adding processed %s -> %s", path, arcpath) + self.add_file(NodeInArchive.from_data(arcpath=arcpath, data=data, time=time)) + else: + logger.debug("Adding %s -> %s", path, arcpath) + self.add_file(NodeInArchive.from_fs(arcpath=arcpath, path=path, time=time)) + else: + relative_file_paths = glob.glob(file_glob, root_dir=file_mapping_root) + assert relative_file_paths, f"Glob '{file_glob}' does not match any file" + self._add_files_recursively(arc_dir=arc_join(arc_dir, rel_destdir), paths=[file_mapping_root / p for p in relative_file_paths], time=time) + + +class SourceCollector: + # TreeItem = collections.namedtuple("TreeItem", ("path", "mode", "data", "symtarget", "directory", "time")) + def __init__(self, root: Path, commit: str, filter: typing.Optional[Callable[[str], bool]], executer: Executer): + self.root = root + self.commit = commit + self.filter = filter + self.executer = executer + + def get_archive_file_tree(self) -> ArchiveFileTree: + git_archive_args = ["git", "archive", "--format=tar.gz", self.commit, "-o", "/dev/stdout"] + logger.info("Executing args=%r", git_archive_args) + contents_tgz = subprocess.check_output(git_archive_args, cwd=self.root, text=False) + tar_archive = tarfile.open(fileobj=io.BytesIO(contents_tgz), mode="r:gz") + filenames = tuple(m.name for m in tar_archive if (m.isfile() or m.issym())) + + file_times = self._get_file_times(paths=filenames) + git_contents = ArchiveFileTree() + for ti in tar_archive: + if self.filter and not self.filter(ti.name): + continue + data = None + symtarget = None + directory = False + file_time = None + if ti.isfile(): + contents_file = tar_archive.extractfile(ti.name) + data = contents_file.read() + file_time = file_times[ti.name] + elif ti.issym(): + symtarget = ti.linkname + file_time = file_times[ti.name] + elif ti.isdir(): + directory = True + else: + raise ValueError(f"{ti.name}: unknown type") + node = NodeInArchive(arcpath=ti.name, data=data, mode=ti.mode, symtarget=symtarget, time=file_time, directory=directory) + git_contents.add_file(node) + return git_contents + + def _get_file_times(self, paths: tuple[str, ...]) -> dict[str, datetime.datetime]: + dry_out = textwrap.dedent("""\ + time=2024-03-14T15:40:25-07:00 + + M\tCMakeLists.txt + """) + git_log_out = self.executer.check_output(["git", "log", "--name-status", '--pretty=time=%cI', self.commit], dry_out=dry_out, cwd=self.root).splitlines(keepends=False) + current_time = None + set_paths = set(paths) + path_times: dict[str, datetime.datetime] = {} + for line in git_log_out: + if not line: + continue + if line.startswith("time="): + current_time = safe_isotime_to_datetime(line.removeprefix("time=")) + continue + mod_type, file_paths = line.split(maxsplit=1) + assert current_time is not None + for file_path in file_paths.split("\t"): + if file_path in set_paths and file_path not in path_times: + path_times[file_path] = current_time + + # FIXME: find out why some files are not shown in "git log" + # assert set(path_times.keys()) == set_paths + if set(path_times.keys()) != set_paths: + found_times = set(path_times.keys()) + paths_without_times = set_paths.difference(found_times) + logger.warning("No times found for these paths: %s", paths_without_times) + max_time = max(time for time in path_times.values()) + for path in paths_without_times: + path_times[path] = max_time + + return path_times + + +class AndroidApiVersion: + def __init__(self, name: str, ints: tuple[int, ...]): + self.name = name + self.ints = ints + + def __repr__(self) -> str: + return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>" + +ANDROID_ABI_EXTRA_LINK_OPTIONS = {} + +class Releaser: + def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool): + self.release_info = release_info + self.project = release_info["name"] + self.version = self.extract_sdl_version(root=root, release_info=release_info) + self.root = root + self.commit = commit + self.revision = revision + self.dist_path = dist_path + self.section_printer = section_printer + self.executer = executer + self.cmake_generator = cmake_generator + self.cpu_count = multiprocessing.cpu_count() + self.deps_path = deps_path + self.overwrite = overwrite + self.github = github + self.fast = fast + self.arc_time = datetime.datetime.now() + + self.artifacts: dict[str, Path] = {} + + def get_context(self, extra_context: typing.Optional[dict[str, str]]=None) -> dict[str, str]: + ctx = { + "PROJECT_NAME": self.project, + "PROJECT_VERSION": self.version, + "PROJECT_COMMIT": self.commit, + "PROJECT_REVISION": self.revision, + "PROJECT_ROOT": str(self.root), + } + if extra_context: + ctx.update(extra_context) + return ctx + + @property + def dry(self) -> bool: + return self.executer.dry + + def prepare(self): + logger.debug("Creating dist folder") + self.dist_path.mkdir(parents=True, exist_ok=True) + + @classmethod + def _path_filter(cls, path: str) -> bool: + if ".gitmodules" in path: + return True + if path.startswith(".git"): + return False + return True + + @classmethod + def _external_repo_path_filter(cls, path: str) -> bool: + if not cls._path_filter(path): + return False + if path.startswith("test/") or path.startswith("tests/"): + return False + return True + + def create_source_archives(self) -> None: + source_collector = SourceCollector(root=self.root, commit=self.commit, executer=self.executer, filter=self._path_filter) + print(f"Collecting sources of {self.project}...") + archive_tree: ArchiveFileTree = source_collector.get_archive_file_tree() + latest_mod_time = archive_tree.get_latest_mod_time() + archive_tree.add_file(NodeInArchive.from_text(arcpath=REVISION_TXT, text=f"{self.revision}\n", time=latest_mod_time)) + archive_tree.add_file(NodeInArchive.from_text(arcpath=f"{GIT_HASH_FILENAME}", text=f"{self.commit}\n", time=latest_mod_time)) + archive_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["source"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=latest_mod_time) + + if "Makefile.am" in archive_tree: + patched_time = latest_mod_time + datetime.timedelta(minutes=1) + print(f"Makefile.am detected -> touching aclocal.m4, */Makefile.in, configure") + for node_data in archive_tree: + arc_name = os.path.basename(node_data.arcpath) + arc_name_we, arc_name_ext = os.path.splitext(arc_name) + if arc_name in ("aclocal.m4", "configure", "Makefile.in"): + print(f"Bumping time of {node_data.arcpath}") + node_data.time = patched_time + + archive_base = f"{self.project}-{self.version}" + zip_path = self.dist_path / f"{archive_base}.zip" + tgz_path = self.dist_path / f"{archive_base}.tar.gz" + txz_path = self.dist_path / f"{archive_base}.tar.xz" + + logger.info("Creating zip/tgz/txz source archives ...") + if self.dry: + zip_path.touch() + tgz_path.touch() + txz_path.touch() + else: + with Archiver(zip_path=zip_path, tgz_path=tgz_path, txz_path=txz_path) as archiver: + print(f"Adding source files of {self.project}...") + archive_tree.add_to_archiver(archive_base=archive_base, archiver=archiver) + + for extra_repo in self.release_info["source"].get("extra-repos", []): + extra_repo_root = self.root / extra_repo + assert (extra_repo_root / ".git").exists(), f"{extra_repo_root} must be a git repo" + extra_repo_commit = self.executer.check_output(["git", "rev-parse", "HEAD"], dry_out=f"gitsha-extra-repo-{extra_repo}", cwd=extra_repo_root).strip() + extra_repo_source_collector = SourceCollector(root=extra_repo_root, commit=extra_repo_commit, executer=self.executer, filter=self._external_repo_path_filter) + print(f"Collecting sources of {extra_repo} ...") + extra_repo_archive_tree = extra_repo_source_collector.get_archive_file_tree() + print(f"Adding source files of {extra_repo} ...") + extra_repo_archive_tree.add_to_archiver(archive_base=f"{archive_base}/{extra_repo}", archiver=archiver) + + for file in self.release_info["source"]["checks"]: + assert f"{archive_base}/{file}" in archiver.added_files, f"'{archive_base}/{file}' must exist" + + logger.info("... done") + + self.artifacts["src-zip"] = zip_path + self.artifacts["src-tar-gz"] = tgz_path + self.artifacts["src-tar-xz"] = txz_path + + if not self.dry: + with tgz_path.open("r+b") as f: + # Zero the embedded timestamp in the gzip'ed tarball + f.seek(4, 0) + f.write(b"\x00\x00\x00\x00") + + def create_dmg(self, configuration: str="Release") -> None: + dmg_in = self.root / self.release_info["dmg"]["path"] + xcode_project = self.root / self.release_info["dmg"]["project"] + assert xcode_project.is_dir(), f"{xcode_project} must be a directory" + assert (xcode_project / "project.pbxproj").is_file, f"{xcode_project} must contain project.pbxproj" + if not self.fast: + dmg_in.unlink(missing_ok=True) + build_xcconfig = self.release_info["dmg"].get("build-xcconfig") + if build_xcconfig: + shutil.copy(self.root / build_xcconfig, xcode_project.parent / "build.xcconfig") + + xcode_scheme = self.release_info["dmg"].get("scheme") + xcode_target = self.release_info["dmg"].get("target") + assert xcode_scheme or xcode_target, "dmg needs scheme or target" + assert not (xcode_scheme and xcode_target), "dmg cannot have both scheme and target set" + if xcode_scheme: + scheme_or_target = "-scheme" + target_like = xcode_scheme + else: + scheme_or_target = "-target" + target_like = xcode_target + self.executer.run(["xcodebuild", "ONLY_ACTIVE_ARCH=NO", "-project", xcode_project, scheme_or_target, target_like, "-configuration", configuration]) + if self.dry: + dmg_in.parent.mkdir(parents=True, exist_ok=True) + dmg_in.touch() + + assert dmg_in.is_file(), f"{self.project}.dmg was not created by xcodebuild" + + dmg_out = self.dist_path / f"{self.project}-{self.version}.dmg" + shutil.copy(dmg_in, dmg_out) + self.artifacts["dmg"] = dmg_out + + @property + def git_hash_data(self) -> bytes: + return f"{self.commit}\n".encode() + + def verify_mingw_library(self, triplet: str, path: Path): + objdump_output = self.executer.check_output([f"{triplet}-objdump", "-p", str(path)]) + libraries = re.findall(r"DLL Name: ([^\n]+)", objdump_output) + logger.info("%s (%s) libraries: %r", path, triplet, libraries) + illegal_libraries = list(filter(RE_ILLEGAL_MINGW_LIBRARIES.match, libraries)) + logger.error("Detected 'illegal' libraries: %r", illegal_libraries) + if illegal_libraries: + raise Exception(f"{path} links to illegal libraries: {illegal_libraries}") + + def create_mingw_archives(self) -> None: + build_type = "Release" + build_parent_dir = self.root / "build-mingw" + ARCH_TO_GNU_ARCH = { + # "arm64": "aarch64", + "x86": "i686", + "x64": "x86_64", + } + ARCH_TO_TRIPLET = { + # "arm64": "aarch64-w64-mingw32", + "x86": "i686-w64-mingw32", + "x64": "x86_64-w64-mingw32", + } + + new_env = dict(os.environ) + + cmake_prefix_paths = [] + mingw_deps_path = self.deps_path / "mingw-deps" + + if "dependencies" in self.release_info["mingw"]: + shutil.rmtree(mingw_deps_path, ignore_errors=True) + mingw_deps_path.mkdir() + + for triplet in ARCH_TO_TRIPLET.values(): + (mingw_deps_path / triplet).mkdir() + + def extract_filter(member: tarfile.TarInfo, path: str, /): + if member.name.startswith("SDL"): + member.name = "/".join(Path(member.name).parts[1:]) + return member + for dep in self.release_info.get("dependencies", {}): + extract_path = mingw_deps_path / f"extract-{dep}" + extract_path.mkdir() + with chdir(extract_path): + tar_path = self.deps_path / glob.glob(self.release_info["mingw"]["dependencies"][dep]["artifact"], root_dir=self.deps_path)[0] + logger.info("Extracting %s to %s", tar_path, mingw_deps_path) + assert tar_path.suffix in (".gz", ".xz") + with tarfile.open(tar_path, mode=f"r:{tar_path.suffix.strip('.')}") as tarf: + tarf.extractall(filter=extract_filter) + for arch, triplet in ARCH_TO_TRIPLET.items(): + install_cmd = self.release_info["mingw"]["dependencies"][dep]["install-command"] + extra_configure_data = { + "ARCH": ARCH_TO_GNU_ARCH[arch], + "TRIPLET": triplet, + "PREFIX": str(mingw_deps_path / triplet), + } + install_cmd = configure_text(install_cmd, context=self.get_context(extra_configure_data)) + self.executer.run(shlex.split(install_cmd), cwd=str(extract_path)) + + dep_binpath = mingw_deps_path / triplet / "bin" + assert dep_binpath.is_dir(), f"{dep_binpath} for PATH should exist" + dep_pkgconfig = mingw_deps_path / triplet / "lib/pkgconfig" + assert dep_pkgconfig.is_dir(), f"{dep_pkgconfig} for PKG_CONFIG_PATH should exist" + + new_env["PATH"] = os.pathsep.join([str(dep_binpath), new_env["PATH"]]) + new_env["PKG_CONFIG_PATH"] = str(dep_pkgconfig) + cmake_prefix_paths.append(mingw_deps_path) + + new_env["CFLAGS"] = f"-O2 -ffile-prefix-map={self.root}=/src/{self.project}" + new_env["CXXFLAGS"] = f"-O2 -ffile-prefix-map={self.root}=/src/{self.project}" + + assert any(system in self.release_info["mingw"] for system in ("autotools", "cmake")) + assert not all(system in self.release_info["mingw"] for system in ("autotools", "cmake")) + + mingw_archs = set() + arc_root = f"{self.project}-{self.version}" + archive_file_tree = ArchiveFileTree() + + if "autotools" in self.release_info["mingw"]: + for arch in self.release_info["mingw"]["autotools"]["archs"]: + triplet = ARCH_TO_TRIPLET[arch] + new_env["CC"] = f"{triplet}-gcc" + new_env["CXX"] = f"{triplet}-g++" + new_env["RC"] = f"{triplet}-windres" + + assert arch not in mingw_archs + mingw_archs.add(arch) + + build_path = build_parent_dir / f"build-{triplet}" + install_path = build_parent_dir / f"install-{triplet}" + shutil.rmtree(install_path, ignore_errors=True) + build_path.mkdir(parents=True, exist_ok=True) + context = self.get_context({ + "ARCH": arch, + "DEP_PREFIX": str(mingw_deps_path / triplet), + }) + extra_args = configure_text_list(text_list=self.release_info["mingw"]["autotools"]["args"], context=context) + + with self.section_printer.group(f"Configuring MinGW {triplet} (autotools)"): + assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" + self.executer.run([ + self.root / "configure", + f"--prefix={install_path}", + f"--includedir=${{prefix}}/include", + f"--libdir=${{prefix}}/lib", + f"--bindir=${{prefix}}/bin", + f"--host={triplet}", + f"--build=x86_64-none-linux-gnu", + "CFLAGS=-O2", + "CXXFLAGS=-O2", + "LDFLAGS=-Wl,-s", + ] + extra_args, cwd=build_path, env=new_env) + with self.section_printer.group(f"Build MinGW {triplet} (autotools)"): + self.executer.run(["make", f"-j{self.cpu_count}"], cwd=build_path, env=new_env) + with self.section_printer.group(f"Install MinGW {triplet} (autotools)"): + self.executer.run(["make", "install"], cwd=build_path, env=new_env) + self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll") + archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) + + print("Recording arch-dependent extra files for MinGW development archive ...") + extra_context = { + "TRIPLET": ARCH_TO_TRIPLET[arch], + } + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["autotools"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) + + if "cmake" in self.release_info["mingw"]: + assert self.release_info["mingw"]["cmake"]["shared-static"] in ("args", "both") + for arch in self.release_info["mingw"]["cmake"]["archs"]: + triplet = ARCH_TO_TRIPLET[arch] + new_env["CC"] = f"{triplet}-gcc" + new_env["CXX"] = f"{triplet}-g++" + new_env["RC"] = f"{triplet}-windres" + + assert arch not in mingw_archs + mingw_archs.add(arch) + + context = self.get_context({ + "ARCH": arch, + "DEP_PREFIX": str(mingw_deps_path / triplet), + }) + extra_args = configure_text_list(text_list=self.release_info["mingw"]["cmake"]["args"], context=context) + + build_path = build_parent_dir / f"build-{triplet}" + install_path = build_parent_dir / f"install-{triplet}" + shutil.rmtree(install_path, ignore_errors=True) + build_path.mkdir(parents=True, exist_ok=True) + if self.release_info["mingw"]["cmake"]["shared-static"] == "args": + args_for_shared_static = ([], ) + elif self.release_info["mingw"]["cmake"]["shared-static"] == "both": + args_for_shared_static = (["-DBUILD_SHARED_LIBS=ON"], ["-DBUILD_SHARED_LIBS=OFF"]) + for arg_for_shared_static in args_for_shared_static: + with self.section_printer.group(f"Configuring MinGW {triplet} (CMake)"): + assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" + self.executer.run([ + f"cmake", + f"-S", str(self.root), "-B", str(build_path), + f"-DCMAKE_BUILD_TYPE={build_type}", + f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', + f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', + f"-DCMAKE_PREFIX_PATH={mingw_deps_path / triplet}", + f"-DCMAKE_INSTALL_PREFIX={install_path}", + f"-DCMAKE_INSTALL_INCLUDEDIR=include", + f"-DCMAKE_INSTALL_LIBDIR=lib", + f"-DCMAKE_INSTALL_BINDIR=bin", + f"-DCMAKE_INSTALL_DATAROOTDIR=share", + f"-DCMAKE_TOOLCHAIN_FILE={self.root}/build-scripts/cmake-toolchain-mingw64-{ARCH_TO_GNU_ARCH[arch]}.cmake", + f"-G{self.cmake_generator}", + ] + extra_args + ([] if self.fast else ["--fresh"]) + arg_for_shared_static, cwd=build_path, env=new_env) + with self.section_printer.group(f"Build MinGW {triplet} (CMake)"): + self.executer.run(["cmake", "--build", str(build_path), "--verbose", "--config", build_type], cwd=build_path, env=new_env) + with self.section_printer.group(f"Install MinGW {triplet} (CMake)"): + self.executer.run(["cmake", "--install", str(build_path)], cwd=build_path, env=new_env) + self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll") + archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) + + print("Recording arch-dependent extra files for MinGW development archive ...") + extra_context = { + "TRIPLET": ARCH_TO_TRIPLET[arch], + } + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["cmake"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) + print("... done") + + print("Recording extra files for MinGW development archive ...") + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + print("... done") + + print("Creating zip/tgz/txz development archives ...") + zip_path = self.dist_path / f"{self.project}-devel-{self.version}-mingw.zip" + tgz_path = self.dist_path / f"{self.project}-devel-{self.version}-mingw.tar.gz" + txz_path = self.dist_path / f"{self.project}-devel-{self.version}-mingw.tar.xz" + + with Archiver(zip_path=zip_path, tgz_path=tgz_path, txz_path=txz_path) as archiver: + archive_file_tree.add_to_archiver(archive_base="", archiver=archiver) + archiver.add_git_hash(arcdir=arc_root, commit=self.commit, time=self.arc_time) + print("... done") + + self.artifacts["mingw-devel-zip"] = zip_path + self.artifacts["mingw-devel-tar-gz"] = tgz_path + self.artifacts["mingw-devel-tar-xz"] = txz_path + + def _detect_android_api(self, android_home: str) -> typing.Optional[AndroidApiVersion]: + platform_dirs = list(Path(p) for p in glob.glob(f"{android_home}/platforms/android-*")) + re_platform = re.compile("^android-([0-9]+)(?:-ext([0-9]+))?$") + platform_versions: list[AndroidApiVersion] = [] + for platform_dir in platform_dirs: + logger.debug("Found Android Platform SDK: %s", platform_dir) + if not (platform_dir / "android.jar").is_file(): + logger.debug("Skipping SDK, missing android.jar") + continue + if m:= re_platform.match(platform_dir.name): + platform_versions.append(AndroidApiVersion(name=platform_dir.name, ints=(int(m.group(1)), int(m.group(2) or 0)))) + platform_versions.sort(key=lambda v: v.ints) + logger.info("Available platform versions: %s", platform_versions) + platform_versions = list(filter(lambda v: v.ints >= self._android_api_minimum.ints, platform_versions)) + logger.info("Valid platform versions (>=%s): %s", self._android_api_minimum.ints, platform_versions) + if not platform_versions: + return None + android_api = platform_versions[0] + logger.info("Selected API version %s", android_api) + return android_api + + def _get_prefab_json_text(self) -> str: + return textwrap.dedent(f"""\ + {{ + "schema_version": 2, + "name": "{self.project}", + "version": "{self.version}", + "dependencies": [] + }} + """) + + def _get_prefab_module_json_text(self, library_name: typing.Optional[str], export_libraries: list[str]) -> str: + for lib in export_libraries: + assert isinstance(lib, str), f"{lib} must be a string" + module_json_dict = { + "export_libraries": export_libraries, + } + if library_name: + module_json_dict["library_name"] = f"lib{library_name}" + return json.dumps(module_json_dict, indent=4) + + @property + def _android_api_minimum(self) -> AndroidApiVersion: + value = self.release_info["android"]["api-minimum"] + if isinstance(value, int): + ints = (value, ) + elif isinstance(value, str): + ints = tuple(split(".")) + else: + raise ValueError("Invalid android.api-minimum: must be X or X.Y") + match len(ints): + case 1: name = f"android-{ints[0]}" + case 2: name = f"android-{ints[0]}-ext-{ints[1]}" + case _: raise ValueError("Invalid android.api-minimum: must be X or X.Y") + return AndroidApiVersion(name=name, ints=ints) + + @property + def _android_api_target(self): + return self.release_info["android"]["api-target"] + + @property + def _android_ndk_minimum(self): + return self.release_info["android"]["ndk-minimum"] + + def _get_prefab_abi_json_text(self, abi: str, cpp: bool, shared: bool) -> str: + abi_json_dict = { + "abi": abi, + "api": self._android_api_minimum.ints[0], + "ndk": self._android_ndk_minimum, + "stl": "c++_shared" if cpp else "none", + "static": not shared, + } + return json.dumps(abi_json_dict, indent=4) + + def _get_android_manifest_text(self) -> str: + return textwrap.dedent(f"""\ + + + + """) + + def create_android_archives(self, android_api: int, android_home: Path, android_ndk_home: Path) -> None: + cmake_toolchain_file = Path(android_ndk_home) / "build/cmake/android.toolchain.cmake" + if not cmake_toolchain_file.exists(): + logger.error("CMake toolchain file does not exist (%s)", cmake_toolchain_file) + raise SystemExit(1) + aar_path = self.root / "build-android" / f"{self.project}-{self.version}.aar" + android_dist_path = self.dist_path / f"{self.project}-devel-{self.version}-android.zip" + android_abis = self.release_info["android"]["abis"] + java_jars_added = False + module_data_added = False + android_deps_path = self.deps_path / "android-deps" + shutil.rmtree(android_deps_path, ignore_errors=True) + + for dep, depinfo in self.release_info["android"].get("dependencies", {}).items(): + dep_devel_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0] + + dep_extract_path = self.deps_path / f"extract/android/{dep}" + shutil.rmtree(dep_extract_path, ignore_errors=True) + dep_extract_path.mkdir(parents=True, exist_ok=True) + + with self.section_printer.group(f"Extracting Android dependency {dep} ({dep_devel_zip})"): + with zipfile.ZipFile(dep_devel_zip, "r") as zf: + zf.extractall(dep_extract_path) + + dep_devel_aar = dep_extract_path / glob.glob("*.aar", root_dir=dep_extract_path)[0] + self.executer.run([sys.executable, str(dep_devel_aar), "-o", str(android_deps_path)]) + + for module_name, module_info in self.release_info["android"]["modules"].items(): + assert "type" in module_info and module_info["type"] in ("interface", "library"), f"module {module_name} must have a valid type" + + aar_file_tree = ArchiveFileTree() + android_devel_file_tree = ArchiveFileTree() + + for android_abi in android_abis: + extra_link_options = ANDROID_ABI_EXTRA_LINK_OPTIONS.get(android_abi, "") + with self.section_printer.group(f"Building for Android {android_api} {android_abi}"): + build_dir = self.root / "build-android" / f"{android_abi}-build" + install_dir = self.root / "install-android" / f"{android_abi}-install" + shutil.rmtree(install_dir, ignore_errors=True) + assert not install_dir.is_dir(), f"{install_dir} should not exist prior to build" + build_type = "Release" + cmake_args = [ + "cmake", + "-S", str(self.root), + "-B", str(build_dir), + # NDK 21e does not support -ffile-prefix-map + # f'''-DCMAKE_C_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', + # f'''-DCMAKE_CXX_FLAGS="-ffile-prefix-map={self.root}=/src/{self.project}"''', + f"-DCMAKE_EXE_LINKER_FLAGS={extra_link_options}", + f"-DCMAKE_SHARED_LINKER_FLAGS={extra_link_options}", + f"-DCMAKE_TOOLCHAIN_FILE={cmake_toolchain_file}", + f"-DCMAKE_PREFIX_PATH={str(android_deps_path)}", + f"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH", + f"-DANDROID_HOME={android_home}", + f"-DANDROID_PLATFORM={android_api}", + f"-DANDROID_ABI={android_abi}", + "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", + f"-DCMAKE_INSTALL_PREFIX={install_dir}", + "-DCMAKE_INSTALL_INCLUDEDIR=include ", + "-DCMAKE_INSTALL_LIBDIR=lib", + "-DCMAKE_INSTALL_DATAROOTDIR=share", + f"-DCMAKE_BUILD_TYPE={build_type}", + f"-G{self.cmake_generator}", + ] + self.release_info["android"]["cmake"]["args"] + ([] if self.fast else ["--fresh"]) + build_args = [ + "cmake", + "--build", str(build_dir), + "--verbose", + "--config", build_type, + ] + install_args = [ + "cmake", + "--install", str(build_dir), + "--config", build_type, + ] + self.executer.run(cmake_args) + self.executer.run(build_args) + self.executer.run(install_args) + + for module_name, module_info in self.release_info["android"]["modules"].items(): + arcdir_prefab_module = f"prefab/modules/{module_name}" + if module_info["type"] == "library": + library = install_dir / module_info["library"] + assert library.suffix in (".so", ".a") + assert library.is_file(), f"CMake should have built library '{library}' for module {module_name}" + arcdir_prefab_libs = f"{arcdir_prefab_module}/libs/android.{android_abi}" + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath=f"{arcdir_prefab_libs}/{library.name}", path=library, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=f"{arcdir_prefab_libs}/abi.json", text=self._get_prefab_abi_json_text(abi=android_abi, cpp=False, shared=library.suffix == ".so"), time=self.arc_time)) + + if not module_data_added: + library_name = None + if module_info["type"] == "library": + library_name = Path(module_info["library"]).stem.removeprefix("lib") + export_libraries = module_info.get("export-libraries", []) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_module, "module.json"), text=self._get_prefab_module_json_text(library_name=library_name, export_libraries=export_libraries), time=self.arc_time)) + arcdir_prefab_include = f"prefab/modules/{module_name}/include" + if "includes" in module_info: + aar_file_tree.add_file_mapping(arc_dir=arcdir_prefab_include, file_mapping=module_info["includes"], file_mapping_root=install_dir, context=self.get_context(), time=self.arc_time) + else: + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_include, ".keep"), text="\n", time=self.arc_time)) + module_data_added = True + + if not java_jars_added: + java_jars_added = True + if "jars" in self.release_info["android"]: + classes_jar_path = install_dir / configure_text(text=self.release_info["android"]["jars"]["classes"], context=self.get_context()) + sources_jar_path = install_dir / configure_text(text=self.release_info["android"]["jars"]["sources"], context=self.get_context()) + doc_jar_path = install_dir / configure_text(text=self.release_info["android"]["jars"]["doc"], context=self.get_context()) + assert classes_jar_path.is_file(), f"CMake should have compiled the java sources and archived them into a JAR ({classes_jar_path})" + assert sources_jar_path.is_file(), f"CMake should have archived the java sources into a JAR ({sources_jar_path})" + assert doc_jar_path.is_file(), f"CMake should have archived javadoc into a JAR ({doc_jar_path})" + + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes.jar", path=classes_jar_path, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-sources.jar", path=sources_jar_path, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-doc.jar", path=doc_jar_path, time=self.arc_time)) + + assert ("jars" in self.release_info["android"] and java_jars_added) or "jars" not in self.release_info["android"], "Must have archived java JAR archives" + + aar_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["android"]["aar-files"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + + aar_file_tree.add_file(NodeInArchive.from_text(arcpath="prefab/prefab.json", text=self._get_prefab_json_text(), time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath="AndroidManifest.xml", text=self._get_android_manifest_text(), time=self.arc_time)) + + with Archiver(zip_path=aar_path) as archiver: + aar_file_tree.add_to_archiver(archive_base="", archiver=archiver) + archiver.add_git_hash(arcdir="", commit=self.commit, time=self.arc_time) + + android_devel_file_tree.add_file(NodeInArchive.from_fs(arcpath=aar_path.name, path=aar_path)) + android_devel_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["android"]["files"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + with Archiver(zip_path=android_dist_path) as archiver: + android_devel_file_tree.add_to_archiver(archive_base="", archiver=archiver) + archiver.add_git_hash(arcdir="", commit=self.commit, time=self.arc_time) + + self.artifacts[f"android-aar"] = android_dist_path + + def download_dependencies(self): + shutil.rmtree(self.deps_path, ignore_errors=True) + self.deps_path.mkdir(parents=True) + + if self.github: + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"dep-path={self.deps_path.absolute()}\n") + + for dep, depinfo in self.release_info.get("dependencies", {}).items(): + startswith = depinfo["startswith"] + dep_repo = depinfo["repo"] + # FIXME: dropped "--exclude-pre-releases" + dep_string_data = self.executer.check_output(["gh", "-R", dep_repo, "release", "list", "--exclude-drafts", "--json", "name,createdAt,tagName", "--jq", f'[.[]|select(.name|startswith("{startswith}"))]|max_by(.createdAt)']).strip() + dep_data = json.loads(dep_string_data) + dep_tag = dep_data["tagName"] + dep_version = dep_data["name"] + logger.info("Download dependency %s version %s (tag=%s) ", dep, dep_version, dep_tag) + self.executer.run(["gh", "-R", dep_repo, "release", "download", dep_tag], cwd=self.deps_path) + if self.github: + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"dep-{dep.lower()}-version={dep_version}\n") + + def verify_dependencies(self): + for dep, depinfo in self.release_info.get("dependencies", {}).items(): + if "mingw" in self.release_info: + mingw_matches = glob.glob(self.release_info["mingw"]["dependencies"][dep]["artifact"], root_dir=self.deps_path) + assert len(mingw_matches) == 1, f"Exactly one archive matches mingw {dep} dependency: {mingw_matches}" + if "dmg" in self.release_info: + dmg_matches = glob.glob(self.release_info["dmg"]["dependencies"][dep]["artifact"], root_dir=self.deps_path) + assert len(dmg_matches) == 1, f"Exactly one archive matches dmg {dep} dependency: {dmg_matches}" + if "msvc" in self.release_info: + msvc_matches = glob.glob(self.release_info["msvc"]["dependencies"][dep]["artifact"], root_dir=self.deps_path) + assert len(msvc_matches) == 1, f"Exactly one archive matches msvc {dep} dependency: {msvc_matches}" + if "android" in self.release_info: + android_matches = glob.glob(self.release_info["android"]["dependencies"][dep]["artifact"], root_dir=self.deps_path) + assert len(android_matches) == 1, f"Exactly one archive matches msvc {dep} dependency: {android_matches}" + + @staticmethod + def _arch_to_vs_platform(arch: str, configuration: str="Release") -> VsArchPlatformConfig: + ARCH_TO_VS_PLATFORM = { + "x86": VsArchPlatformConfig(arch="x86", platform="Win32", configuration=configuration), + "x64": VsArchPlatformConfig(arch="x64", platform="x64", configuration=configuration), + "arm64": VsArchPlatformConfig(arch="arm64", platform="ARM64", configuration=configuration), + } + return ARCH_TO_VS_PLATFORM[arch] + + def build_msvc(self): + with self.section_printer.group("Find Visual Studio"): + vs = VisualStudio(executer=self.executer) + for arch in self.release_info["msvc"].get("msbuild", {}).get("archs", []): + self._build_msvc_msbuild(arch_platform=self._arch_to_vs_platform(arch=arch), vs=vs) + if "cmake" in self.release_info["msvc"]: + deps_path = self.root / "msvc-deps" + shutil.rmtree(deps_path, ignore_errors=True) + dep_roots = [] + for dep, depinfo in self.release_info["msvc"].get("dependencies", {}).items(): + dep_extract_path = deps_path / f"extract-{dep}" + msvc_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0] + with zipfile.ZipFile(msvc_zip, "r") as zf: + zf.extractall(dep_extract_path) + contents_msvc_zip = glob.glob(str(dep_extract_path / "*")) + assert len(contents_msvc_zip) == 1, f"There must be exactly one root item in the root directory of {dep}" + dep_roots.append(contents_msvc_zip[0]) + + for arch in self.release_info["msvc"].get("cmake", {}).get("archs", []): + self._build_msvc_cmake(arch_platform=self._arch_to_vs_platform(arch=arch), dep_roots=dep_roots) + with self.section_printer.group("Create SDL VC development zip"): + self._build_msvc_devel() + + def _build_msvc_msbuild(self, arch_platform: VsArchPlatformConfig, vs: VisualStudio): + platform_context = self.get_context(arch_platform.extra_context()) + for dep, depinfo in self.release_info["msvc"].get("dependencies", {}).items(): + msvc_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0] + + src_globs = [configure_text(instr["src"], context=platform_context) for instr in depinfo["copy"]] + with zipfile.ZipFile(msvc_zip, "r") as zf: + for member in zf.namelist(): + member_path = "/".join(Path(member).parts[1:]) + for src_i, src_glob in enumerate(src_globs): + if fnmatch.fnmatch(member_path, src_glob): + dst = (self.root / configure_text(depinfo["copy"][src_i]["dst"], context=platform_context)).resolve() / Path(member_path).name + zip_data = zf.read(member) + if dst.exists(): + identical = False + if dst.is_file(): + orig_bytes = dst.read_bytes() + if orig_bytes == zip_data: + identical = True + if not identical: + logger.warning("Extracting dependency %s, will cause %s to be overwritten", dep, dst) + if not self.overwrite: + raise RuntimeError("Run with --overwrite to allow overwriting") + logger.debug("Extracting %s -> %s", member, dst) + + dst.parent.mkdir(exist_ok=True, parents=True) + dst.write_bytes(zip_data) + + prebuilt_paths = set(self.root / full_prebuilt_path for prebuilt_path in self.release_info["msvc"]["msbuild"].get("prebuilt", []) for full_prebuilt_path in glob.glob(configure_text(prebuilt_path, context=platform_context), root_dir=self.root)) + msbuild_paths = set(self.root / configure_text(f, context=platform_context) for file_mapping in (self.release_info["msvc"]["msbuild"]["files-lib"], self.release_info["msvc"]["msbuild"]["files-devel"]) for files_list in file_mapping.values() for f in files_list) + assert prebuilt_paths.issubset(msbuild_paths), f"msvc.msbuild.prebuilt must be a subset of (msvc.msbuild.files-lib, msvc.msbuild.files-devel)" + built_paths = msbuild_paths.difference(prebuilt_paths) + logger.info("MSbuild builds these files, to be included in the package: %s", built_paths) + if not self.fast: + for b in built_paths: + b.unlink(missing_ok=True) + + rel_projects: list[str] = self.release_info["msvc"]["msbuild"]["projects"] + projects = list(self.root / p for p in rel_projects) + + directory_build_props_src_relpath = self.release_info["msvc"]["msbuild"].get("directory-build-props") + for project in projects: + dir_b_props = project.parent / "Directory.Build.props" + dir_b_props.unlink(missing_ok = True) + if directory_build_props_src_relpath: + src = self.root / directory_build_props_src_relpath + logger.debug("Copying %s -> %s", src, dir_b_props) + shutil.copy(src=src, dst=dir_b_props) + + with self.section_printer.group(f"Build {arch_platform.arch} VS binary"): + vs.build(arch_platform=arch_platform, projects=projects) + + if self.dry: + for b in built_paths: + b.parent.mkdir(parents=True, exist_ok=True) + b.touch() + + for b in built_paths: + assert b.is_file(), f"{b} has not been created" + b.parent.mkdir(parents=True, exist_ok=True) + b.touch() + + zip_path = self.dist_path / f"{self.project}-{self.version}-win32-{arch_platform.arch}.zip" + zip_path.unlink(missing_ok=True) + + logger.info("Collecting files...") + archive_file_tree = ArchiveFileTree() + archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["msbuild"]["files-lib"], file_mapping_root=self.root, context=platform_context, time=self.arc_time) + archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["files-lib"], file_mapping_root=self.root, context=platform_context, time=self.arc_time) + + logger.info("Writing to %s", zip_path) + with Archiver(zip_path=zip_path) as archiver: + arc_root = f"" + archive_file_tree.add_to_archiver(archive_base=arc_root, archiver=archiver) + archiver.add_git_hash(arcdir=arc_root, commit=self.commit, time=self.arc_time) + self.artifacts[f"VC-{arch_platform.arch}"] = zip_path + + for p in built_paths: + assert p.is_file(), f"{p} should exist" + + def _arch_platform_to_build_path(self, arch_platform: VsArchPlatformConfig) -> Path: + return self.root / f"build-vs-{arch_platform.arch}" + + def _arch_platform_to_install_path(self, arch_platform: VsArchPlatformConfig) -> Path: + return self._arch_platform_to_build_path(arch_platform) / "prefix" + + def _build_msvc_cmake(self, arch_platform: VsArchPlatformConfig, dep_roots: list[Path]): + build_path = self._arch_platform_to_build_path(arch_platform) + install_path = self._arch_platform_to_install_path(arch_platform) + platform_context = self.get_context(extra_context=arch_platform.extra_context()) + + build_type = "Release" + extra_context = { + "ARCH": arch_platform.arch, + "PLATFORM": arch_platform.platform, + } + + built_paths = set(install_path / configure_text(f, context=platform_context) for file_mapping in (self.release_info["msvc"]["cmake"]["files-lib"], self.release_info["msvc"]["cmake"]["files-devel"]) for files_list in file_mapping.values() for f in files_list) + logger.info("CMake builds these files, to be included in the package: %s", built_paths) + if not self.fast: + for b in built_paths: + b.unlink(missing_ok=True) + + shutil.rmtree(install_path, ignore_errors=True) + build_path.mkdir(parents=True, exist_ok=True) + with self.section_printer.group(f"Configure VC CMake project for {arch_platform.arch}"): + self.executer.run([ + "cmake", "-S", str(self.root), "-B", str(build_path), + "-A", arch_platform.platform, + "-DCMAKE_INSTALL_BINDIR=bin", + "-DCMAKE_INSTALL_DATAROOTDIR=share", + "-DCMAKE_INSTALL_INCLUDEDIR=include", + "-DCMAKE_INSTALL_LIBDIR=lib", + f"-DCMAKE_BUILD_TYPE={build_type}", + f"-DCMAKE_INSTALL_PREFIX={install_path}", + # MSVC debug information format flags are selected by an abstraction + "-DCMAKE_POLICY_DEFAULT_CMP0141=NEW", + # MSVC debug information format + "-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase", + # Linker flags for executables + "-DCMAKE_EXE_LINKER_FLAGS=-INCREMENTAL:NO -DEBUG -OPT:REF -OPT:ICF", + # Linker flag for shared libraries + "-DCMAKE_SHARED_LINKER_FLAGS=-INCREMENTAL:NO -DEBUG -OPT:REF -OPT:ICF", + # MSVC runtime library flags are selected by an abstraction + "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW", + # Use statically linked runtime (-MT) (ideally, should be "MultiThreaded$<$:Debug>") + "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded", + f"-DCMAKE_PREFIX_PATH={';'.join(str(s) for s in dep_roots)}", + ] + self.release_info["msvc"]["cmake"]["args"] + ([] if self.fast else ["--fresh"])) + + with self.section_printer.group(f"Build VC CMake project for {arch_platform.arch}"): + self.executer.run(["cmake", "--build", str(build_path), "--verbose", "--config", build_type]) + with self.section_printer.group(f"Install VC CMake project for {arch_platform.arch}"): + self.executer.run(["cmake", "--install", str(build_path), "--config", build_type]) + + if self.dry: + for b in built_paths: + b.parent.mkdir(parents=True, exist_ok=True) + b.touch() + + zip_path = self.dist_path / f"{self.project}-{self.version}-win32-{arch_platform.arch}.zip" + zip_path.unlink(missing_ok=True) + + logger.info("Collecting files...") + archive_file_tree = ArchiveFileTree() + archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["cmake"]["files-lib"], file_mapping_root=install_path, context=platform_context, time=self.arc_time) + archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["files-lib"], file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) + + logger.info("Creating %s", zip_path) + with Archiver(zip_path=zip_path) as archiver: + arc_root = f"" + archive_file_tree.add_to_archiver(archive_base=arc_root, archiver=archiver) + archiver.add_git_hash(arcdir=arc_root, commit=self.commit, time=self.arc_time) + + for p in built_paths: + assert p.is_file(), f"{p} should exist" + + def _build_msvc_devel(self) -> None: + zip_path = self.dist_path / f"{self.project}-devel-{self.version}-VC.zip" + arc_root = f"{self.project}-{self.version}" + + def copy_files_devel(ctx): + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["files-devel"], file_mapping_root=self.root, context=ctx, time=self.arc_time) + + + logger.info("Collecting files...") + archive_file_tree = ArchiveFileTree() + if "msbuild" in self.release_info["msvc"]: + for arch in self.release_info["msvc"]["msbuild"]["archs"]: + arch_platform = self._arch_to_vs_platform(arch=arch) + platform_context = self.get_context(arch_platform.extra_context()) + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["msbuild"]["files-devel"], file_mapping_root=self.root, context=platform_context, time=self.arc_time) + copy_files_devel(ctx=platform_context) + if "cmake" in self.release_info["msvc"]: + for arch in self.release_info["msvc"]["cmake"]["archs"]: + arch_platform = self._arch_to_vs_platform(arch=arch) + platform_context = self.get_context(arch_platform.extra_context()) + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["cmake"]["files-devel"], file_mapping_root=self._arch_platform_to_install_path(arch_platform), context=platform_context, time=self.arc_time) + copy_files_devel(ctx=platform_context) + + with Archiver(zip_path=zip_path) as archiver: + archive_file_tree.add_to_archiver(archive_base="", archiver=archiver) + archiver.add_git_hash(arcdir=arc_root, commit=self.commit, time=self.arc_time) + self.artifacts["VC-devel"] = zip_path + + @classmethod + def extract_sdl_version(cls, root: Path, release_info: dict) -> str: + with open(root / release_info["version"]["file"], "r") as f: + text = f.read() + major = next(re.finditer(release_info["version"]["re_major"], text, flags=re.M)).group(1) + minor = next(re.finditer(release_info["version"]["re_minor"], text, flags=re.M)).group(1) + micro = next(re.finditer(release_info["version"]["re_micro"], text, flags=re.M)).group(1) + return f"{major}.{minor}.{micro}" + + +def main(argv=None) -> int: + if sys.version_info < (3, 11): + logger.error("This script needs at least python 3.11") + return 1 + + parser = argparse.ArgumentParser(allow_abbrev=False, description="Create SDL release artifacts") + parser.add_argument("--root", metavar="DIR", type=Path, default=Path(__file__).absolute().parents[1], help="Root of project") + parser.add_argument("--release-info", metavar="JSON", dest="path_release_info", type=Path, default=Path(__file__).absolute().parent / "release-info.json", help="Path of release-info.json") + parser.add_argument("--dependency-folder", metavar="FOLDER", dest="deps_path", type=Path, default="deps", help="Directory containing pre-built archives of dependencies (will be removed when downloading archives)") + parser.add_argument("--out", "-o", metavar="DIR", dest="dist_path", type=Path, default="dist", help="Output directory") + parser.add_argument("--github", action="store_true", help="Script is running on a GitHub runner") + parser.add_argument("--commit", default="HEAD", help="Git commit/tag of which a release should be created") + parser.add_argument("--actions", choices=["download", "source", "android", "mingw", "msvc", "dmg"], required=True, nargs="+", dest="actions", help="What to do?") + parser.set_defaults(loglevel=logging.INFO) + parser.add_argument('--vs-year', dest="vs_year", help="Visual Studio year") + parser.add_argument('--android-api', dest="android_api", help="Android API version") + parser.add_argument('--android-home', dest="android_home", default=os.environ.get("ANDROID_HOME"), help="Android Home folder") + parser.add_argument('--android-ndk-home', dest="android_ndk_home", default=os.environ.get("ANDROID_NDK_HOME"), help="Android NDK Home folder") + parser.add_argument('--cmake-generator', dest="cmake_generator", default="Ninja", help="CMake Generator") + parser.add_argument('--debug', action='store_const', const=logging.DEBUG, dest="loglevel", help="Print script debug information") + parser.add_argument('--dry-run', action='store_true', dest="dry", help="Don't execute anything") + parser.add_argument('--force', action='store_true', dest="force", help="Ignore a non-clean git tree") + parser.add_argument('--overwrite', action='store_true', dest="overwrite", help="Allow potentially overwriting other projects") + parser.add_argument('--fast', action='store_true', dest="fast", help="Don't do a rebuild") + + args = parser.parse_args(argv) + logging.basicConfig(level=args.loglevel, format='[%(levelname)s] %(message)s') + args.deps_path = args.deps_path.absolute() + args.dist_path = args.dist_path.absolute() + args.root = args.root.absolute() + args.dist_path = args.dist_path.absolute() + if args.dry: + args.dist_path = args.dist_path / "dry" + + if args.github: + section_printer: SectionPrinter = GitHubSectionPrinter() + else: + section_printer = SectionPrinter() + + if args.github and "GITHUB_OUTPUT" not in os.environ: + os.environ["GITHUB_OUTPUT"] = "/tmp/github_output.txt" + + executer = Executer(root=args.root, dry=args.dry) + + root_git_hash_path = args.root / GIT_HASH_FILENAME + root_is_maybe_archive = root_git_hash_path.is_file() + if root_is_maybe_archive: + logger.warning("%s detected: Building from archive", GIT_HASH_FILENAME) + archive_commit = root_git_hash_path.read_text().strip() + if args.commit != archive_commit: + logger.warning("Commit argument is %s, but archive commit is %s. Using %s.", args.commit, archive_commit, archive_commit) + args.commit = archive_commit + revision = (args.root / REVISION_TXT).read_text().strip() + else: + args.commit = executer.check_output(["git", "rev-parse", args.commit], dry_out="e5812a9fd2cda317b503325a702ba3c1c37861d9").strip() + revision = executer.check_output(["git", "describe", "--always", "--tags", "--long", args.commit], dry_out="preview-3.1.3-96-g9512f2144").strip() + logger.info("Using commit %s", args.commit) + + try: + with args.path_release_info.open() as f: + release_info = json.load(f) + except FileNotFoundError: + logger.error(f"Could not find {args.path_release_info}") + + releaser = Releaser( + release_info=release_info, + commit=args.commit, + revision=revision, + root=args.root, + dist_path=args.dist_path, + executer=executer, + section_printer=section_printer, + cmake_generator=args.cmake_generator, + deps_path=args.deps_path, + overwrite=args.overwrite, + github=args.github, + fast=args.fast, + ) + + if root_is_maybe_archive: + logger.warning("Building from archive. Skipping clean git tree check.") + else: + porcelain_status = executer.check_output(["git", "status", "--ignored", "--porcelain"], dry_out="\n").strip() + if porcelain_status: + print(porcelain_status) + logger.warning("The tree is dirty! Do not publish any generated artifacts!") + if not args.force: + raise Exception("The git repo contains modified and/or non-committed files. Run with --force to ignore.") + + if args.fast: + logger.warning("Doing fast build! Do not publish generated artifacts!") + + with section_printer.group("Arguments"): + print(f"project = {releaser.project}") + print(f"version = {releaser.version}") + print(f"revision = {revision}") + print(f"commit = {args.commit}") + print(f"out = {args.dist_path}") + print(f"actions = {args.actions}") + print(f"dry = {args.dry}") + print(f"force = {args.force}") + print(f"overwrite = {args.overwrite}") + print(f"cmake_generator = {args.cmake_generator}") + + releaser.prepare() + + if "download" in args.actions: + releaser.download_dependencies() + + if set(args.actions).intersection({"msvc", "mingw", "android"}): + print("Verifying presence of dependencies (run 'download' action to download) ...") + releaser.verify_dependencies() + print("... done") + + if "source" in args.actions: + if root_is_maybe_archive: + raise Exception("Cannot build source archive from source archive") + with section_printer.group("Create source archives"): + releaser.create_source_archives() + + if "dmg" in args.actions: + if platform.system() != "Darwin" and not args.dry: + parser.error("framework artifact(s) can only be built on Darwin") + + releaser.create_dmg() + + if "msvc" in args.actions: + if platform.system() != "Windows" and not args.dry: + parser.error("msvc artifact(s) can only be built on Windows") + releaser.build_msvc() + + if "mingw" in args.actions: + releaser.create_mingw_archives() + + if "android" in args.actions: + if args.android_home is None or not Path(args.android_home).is_dir(): + parser.error("Invalid $ANDROID_HOME or --android-home: must be a directory containing the Android SDK") + if args.android_ndk_home is None or not Path(args.android_ndk_home).is_dir(): + parser.error("Invalid $ANDROID_NDK_HOME or --android_ndk_home: must be a directory containing the Android NDK") + if args.android_api is None: + with section_printer.group("Detect Android APIS"): + args.android_api = releaser._detect_android_api(android_home=args.android_home) + else: + try: + android_api_ints = tuple(int(v) for v in args.android_api.split(".")) + match len(android_api_ints): + case 1: android_api_name = f"android-{android_api_ints[0]}" + case 2: android_api_name = f"android-{android_api_ints[0]}-ext-{android_api_ints[1]}" + case _: raise ValueError + except ValueError: + logger.error("Invalid --android-api, must be a 'X' or 'X.Y' version") + args.android_api = AndroidApiVersion(ints=android_api_ints, name=android_api_name) + if args.android_api is None: + parser.error("Invalid --android-api, and/or could not be detected") + android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}" + if not android_api_path.is_dir(): + logger.warning(f"Android API directory does not exist ({android_api_path})") + with section_printer.group("Android arguments"): + print(f"android_home = {args.android_home}") + print(f"android_ndk_home = {args.android_ndk_home}") + print(f"android_api = {args.android_api}") + releaser.create_android_archives( + android_api=args.android_api.ints[0], + android_home=args.android_home, + android_ndk_home=args.android_ndk_home, + ) + with section_printer.group("Summary"): + print(f"artifacts = {releaser.artifacts}") + + if args.github: + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"project={releaser.project}\n") + f.write(f"version={releaser.version}\n") + for k, v in releaser.artifacts.items(): + f.write(f"{k}={v.name}\n") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/build-scripts/clang-format-src.sh b/build-scripts/clang-format-src.sh new file mode 100755 index 0000000000000..c4af9a5913f52 --- /dev/null +++ b/build-scripts/clang-format-src.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +cd "$(dirname $0)/../src" + +echo "Running clang-format in $(pwd)" + +find . -regex '.*\.[chm]p*' -exec clang-format -i {} \; + +# Revert third-party code +git checkout \ + events/imKStoUCS.* \ + hidapi \ + joystick/controller_type.c \ + joystick/controller_type.h \ + joystick/hidapi/steam/controller_constants.h \ + joystick/hidapi/steam/controller_structs.h \ + libm \ + stdlib/SDL_malloc.c \ + stdlib/SDL_qsort.c \ + stdlib/SDL_strtokr.c \ + video/arm \ + video/khronos \ + video/x11/edid-parse.c \ + video/yuv2rgb +clang-format -i hidapi/SDL_hidapi.c + +# Revert generated code +git checkout dynapi/SDL_dynapi_overrides.h +git checkout dynapi/SDL_dynapi_procs.h +git checkout render/metal/SDL_shaders_metal_*.h + +echo "clang-format complete!" diff --git a/build-scripts/cmake-toolchain-mingw64-i686.cmake b/build-scripts/cmake-toolchain-mingw64-i686.cmake new file mode 100644 index 0000000000000..8be7b3a80fe07 --- /dev/null +++ b/build-scripts/cmake-toolchain-mingw64-i686.cmake @@ -0,0 +1,18 @@ +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR x86) + +find_program(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc) +find_program(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++) +find_program(CMAKE_RC_COMPILER NAMES i686-w64-mingw32-windres windres) + +if(NOT CMAKE_C_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.") +endif() + +if(NOT CMAKE_CXX_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.") +endif() + +if(NOT CMAKE_RC_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.") +endif() diff --git a/build-scripts/cmake-toolchain-mingw64-x86_64.cmake b/build-scripts/cmake-toolchain-mingw64-x86_64.cmake new file mode 100644 index 0000000000000..8bf436695e1fd --- /dev/null +++ b/build-scripts/cmake-toolchain-mingw64-x86_64.cmake @@ -0,0 +1,18 @@ +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR x86_64) + +find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc) +find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++) +find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres) + +if(NOT CMAKE_C_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.") +endif() + +if(NOT CMAKE_CXX_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.") +endif() + +if(NOT CMAKE_RC_COMPILER) + message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.") +endif() diff --git a/build-scripts/config.guess b/build-scripts/config.guess index 1817bdce90dc4..a9d01fde46176 100755 --- a/build-scripts/config.guess +++ b/build-scripts/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2022 Free Software Foundation, Inc. +# Copyright 1992-2025 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-05-25' +timestamp='2025-07-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ GUESS= # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. + # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -628,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -712,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -904,7 +912,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -966,11 +974,37 @@ EOF GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be @@ -1036,7 +1070,16 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; - loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) @@ -1191,7 +1234,7 @@ EOF GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1332,7 +1375,7 @@ EOF GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; @@ -1554,6 +1597,12 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-pc-ironclad-mlibc + ;; + *:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc + ;; esac # Do we have a guess based on uname results? @@ -1577,6 +1626,7 @@ cat > "$dummy.c" <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2022 Free Software Foundation, Inc. +Copyright 1992-2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -142,10 +141,22 @@ case $1 in # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | ironclad-* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -160,8 +171,12 @@ case $1 in esac ;; *-*) - # A lone config we happen to match not fitting any pattern case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; decstation-3100) basic_machine=mips-dec basic_os= @@ -169,28 +184,87 @@ case $1 in *-*) # Second component is usually, but not always the OS case $field2 in - # Prevent following clause from handling this valid os + # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; - zephyr*) - basic_machine=$field1-unknown - basic_os=$field2 - ;; # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) basic_machine=$field1-$field2 basic_os= ;; + tock* | zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; *) basic_machine=$field1 basic_os=$field2 @@ -271,26 +345,6 @@ case $1 in basic_machine=arm-unknown basic_os=cegcc ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; cray) basic_machine=j90-cray basic_os=unicos @@ -713,15 +767,26 @@ case $basic_machine in vendor=dec basic_os=tops20 ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; - dpx2*) + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull - basic_os=sysv3 + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull ;; encore | umax | mmax) cpu=ns32k @@ -836,18 +901,6 @@ case $basic_machine in next | m*-next) cpu=m68k vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac ;; np1) cpu=np1 @@ -936,14 +989,13 @@ case $basic_machine in ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1306,11 +1492,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1325,7 +1512,6 @@ case $basic_os in os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) ;; - uclinux-uclibc* ) + ironclad-mlibc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 ;; - nto-qnx*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - os2-emx) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) ;; - *-eabi* | *-gnueabi*) + rtmk-nova-) ;; - -*) + *-eabi*- | *-gnueabi*-) + ;; + ios*-simulator- | tvos*-simulator- | watchos*-simulator- ) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1809,7 +2283,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1879,12 +2353,12 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-format: "%Y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/build-scripts/create-release.py b/build-scripts/create-release.py new file mode 100755 index 0000000000000..221444993a92b --- /dev/null +++ b/build-scripts/create-release.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +import argparse +from pathlib import Path +import json +import logging +import re +import subprocess + +ROOT = Path(__file__).resolve().parents[1] + + +def determine_remote() -> str: + text = (ROOT / "build-scripts/release-info.json").read_text() + release_info = json.loads(text) + if "remote" in release_info: + return release_info["remote"] + project_with_version = release_info["name"] + project, _ = re.subn("([^a-zA-Z_])", "", project_with_version) + return f"libsdl-org/{project}" + + +def main(): + default_remote = determine_remote() + + current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip() + + parser = argparse.ArgumentParser(allow_abbrev=False) + parser.add_argument("--ref", required=True, help=f"Name of branch or tag containing release.yml") + parser.add_argument("--remote", "-R", default=default_remote, help=f"Remote repo (default={default_remote})") + parser.add_argument("--commit", default=current_commit, help=f"Commit (default={current_commit})") + args = parser.parse_args() + + + print(f"Running release.yml workflow:") + print(f" commit = {args.commit}") + print(f" remote = {args.remote}") + + subprocess.check_call(["gh", "-R", args.remote, "workflow", "run", "release.yml", "--ref", args.ref, "-f", f"commit={args.commit}"], cwd=ROOT) + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/build-scripts/gen_audio_channel_conversion.c b/build-scripts/gen_audio_channel_conversion.c index 37b370e107d07..38c3548d8ca9b 100644 --- a/build-scripts/gen_audio_channel_conversion.c +++ b/build-scripts/gen_audio_channel_conversion.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -395,7 +395,7 @@ int main(void) printf( "/*\n" " Simple DirectMedia Layer\n" - " Copyright (C) 1997-2022 Sam Lantinga \n" + " Copyright (C) 1997-2025 Sam Lantinga \n" "\n" " This software is provided 'as-is', without any express or implied\n" " warranty. In no event will the authors be held liable for any damages\n" diff --git a/build-scripts/gen_audio_resampler_filter.c b/build-scripts/gen_audio_resampler_filter.c index 99d77957ebb66..df0acca3ac953 100644 --- a/build-scripts/gen_audio_resampler_filter.c +++ b/build-scripts/gen_audio_resampler_filter.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -113,7 +113,7 @@ int main(void) printf( "/*\n" " Simple DirectMedia Layer\n" - " Copyright (C) 1997-2022 Sam Lantinga \n" + " Copyright (C) 1997-2025 Sam Lantinga \n" "\n" " This software is provided 'as-is', without any express or implied\n" " warranty. In no event will the authors be held liable for any damages\n" diff --git a/build-scripts/ltmain.sh b/build-scripts/ltmain.sh index 70a3e8253fcfe..42a03c3cda341 100644 --- a/build-scripts/ltmain.sh +++ b/build-scripts/ltmain.sh @@ -2415,10 +2415,10 @@ libtool_validate_options () # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in + case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -2750,7 +2750,7 @@ EOF # func_convert_core_file_wine_to_w32 ARG # Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. # @@ -2782,9 +2782,10 @@ func_convert_core_file_wine_to_w32 () # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. +# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. Assumes ARG has no leading or trailing path separator +# characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. @@ -3439,7 +3440,7 @@ func_mode_compile () # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -4316,7 +4317,7 @@ func_mode_install () 'exit $?' tstripme=$stripme case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= @@ -4429,7 +4430,7 @@ func_mode_install () # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -4657,7 +4658,7 @@ extern \"C\" { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; @@ -4669,7 +4670,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -4683,7 +4684,7 @@ extern \"C\" { func_basename "$dlprefile" name=$func_basename_result case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" @@ -4858,7 +4859,7 @@ static const void *lt_preloaded_setup() { # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` @@ -4934,7 +4935,7 @@ func_win32_libid () *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || @@ -5201,7 +5202,7 @@ func_extract_archives () # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw +# incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. @@ -5209,7 +5210,7 @@ func_extract_archives () # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific +# the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { @@ -5333,7 +5334,7 @@ func_exec_program_core () " case $host in # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) + *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 @@ -5401,7 +5402,7 @@ func_exec_program () file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done - # Usually 'no', except on cygwin/mingw when embedded into + # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then @@ -5533,7 +5534,7 @@ EOF #endif #include #include -#ifdef _MSC_VER +#if defined _WIN32 && !defined __GNUC__ # include # include # include @@ -5558,7 +5559,7 @@ EOF /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ -int _putenv (const char *); +_CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ @@ -5756,7 +5757,7 @@ main (int argc, char *argv[]) { EOF case $host in - *mingw* | *cygwin* ) + *mingw* | *windows* | *cygwin* ) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -5859,7 +5860,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" { char* p; @@ -5901,7 +5902,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); @@ -6320,7 +6321,7 @@ lt_update_lib_path (const char *name, const char *value) EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). @@ -6495,12 +6496,12 @@ func_mode_link () $debug_cmd case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. - # SDL customization: SDL code doesn't have any undefined symbols + # SDL customization: SDL code doesn't have any undefined symbols. allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying @@ -6508,7 +6509,7 @@ func_mode_link () # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. - # SDL customization: SDL code doesn't have any undefined symbols + # SDL customization: SDL code doesn't have any undefined symbols. # allow_undefined=yes ;; *) @@ -7003,7 +7004,7 @@ func_mode_link () ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; @@ -7023,7 +7024,7 @@ func_mode_link () -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -7095,7 +7096,7 @@ func_mode_link () continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -7118,7 +7119,7 @@ func_mode_link () -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" @@ -7303,13 +7304,29 @@ func_mode_link () # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fdiagnostics-color* simply affects output + # -frecord-gcc-switches used to verify flags were respected # -fsanitize=* Clang/GCC memory and address sanitizer + # -fno-sanitize* Clang/GCC memory and address sanitizer + # -shared-libsan Link with shared sanitizer runtimes (Clang) + # -static-libsan Link with static sanitizer runtimes (Clang) + # -no-canonical-prefixes Do not expand any symbolic links # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -rtlib=* select c runtime lib with clang + # --unwindlib=* select unwinder library with clang + # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking # -Wa,* Pass flags directly to the assembler + # -Werror, -Werror=* Report (specified) warnings as errors -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \ + -stdlib=*|-rtlib=*|--unwindlib=*| \ + -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ + -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \ + -fdiagnostics-color*|-frecord-gcc-switches| \ + -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" @@ -7639,7 +7656,7 @@ func_mode_link () found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -8022,7 +8039,7 @@ func_mode_link () fi case $host in # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present @@ -8165,8 +8182,8 @@ func_mode_link () fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) + case $host_os in + cygwin* | mingw* | windows* | cegcc* | os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no @@ -8235,8 +8252,8 @@ func_mode_link () soname=$dlname elif test -n "$soname_spec"; then # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) # | *os2* # SDL customization: removed OS/2 versioning support. + case $host_os in + cygwin* | mingw* | windows* | cegcc*) # | os2* # SDL customization: removed OS/2 versioning support. func_arith $current - $age major=$func_arith_result versuffix=-$major @@ -8378,7 +8395,7 @@ func_mode_link () test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in @@ -8395,7 +8412,7 @@ func_mode_link () fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8666,7 +8683,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8839,13 +8856,13 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; - freebsd-aout|qnx|sunos) + freebsd-aout|sco|sunos) current=$number_major revision=$number_minor age=0 @@ -8992,8 +9009,9 @@ func_mode_link () ;; qnx) - major=.$current - versuffix=.$current + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; sco) @@ -9146,7 +9164,7 @@ func_mode_link () if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) @@ -9660,7 +9678,7 @@ EOF orig_export_symbols= case $host_os in - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { @@ -10330,7 +10348,7 @@ EOF esac fi case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; @@ -10408,7 +10426,7 @@ EOF # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; - *cygwin* | *mingw* ) + *cygwin* | *mingw* | *windows* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) @@ -10561,7 +10579,7 @@ EOF *) exeext= ;; esac case $host in - *cygwin* | *mingw* ) + *cygwin* | *mingw* | windows* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result @@ -10893,7 +10911,7 @@ EOF # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *windows*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" diff --git a/build-scripts/release-info.json b/build-scripts/release-info.json new file mode 100644 index 0000000000000..02a294e59ba77 --- /dev/null +++ b/build-scripts/release-info.json @@ -0,0 +1,108 @@ +{ + "name": "SDL2", + "remote": "libsdl-org/SDL", + "version": { + "file": "include/SDL_version.h", + "re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$", + "re_minor": "^#define SDL_MINOR_VERSION\\s+([0-9]+)$", + "re_micro": "^#define SDL_PATCHLEVEL\\s+([0-9]+)$" + }, + "source": { + "checks": [ + "src/SDL.c", + "include/SDL.h", + "test/testsprite2.c", + "android-project/app/src/main/java/org/libsdl/app/SDLActivity.java" + ] + }, + "dmg": { + "project": "Xcode/SDL/SDL.xcodeproj", + "path": "Xcode/SDL/build/SDL2.dmg", + "target": "Standard DMG" + }, + "mingw": { + "autotools": { + "archs": ["x86", "x64"], + "args": [ + ], + "files": { + "@<@TRIPLET@>@/include/SDL2": [ + "include/SDL_config*.h" + ] + } + }, + "files": { + "": [ + "mingw/pkg-support/INSTALL.txt", + "mingw/pkg-support/Makefile", + "BUGS.txt", + "CREDITS.txt", + "README-SDL.txt", + "WhatsNew.txt", + "LICENSE.txt", + "README.md" + ], + "cmake": [ + "mingw/pkg-support/cmake/sdl2-config.cmake", + "mingw/pkg-support/cmake/sdl2-config-version.cmake" + ], + "docs": [ + "docs/*" + ], + "test": [ + "test/*" + ] + } + }, + "msvc": { + "msbuild": { + "archs": [ + "x86", + "x64" + ], + "projects": [ + "VisualC/SDL/SDL.vcxproj", + "VisualC/SDLmain/SDLmain.vcxproj", + "VisualC/SDLtest/SDLtest.vcxproj" + ], + "files-lib": { + "": [ + "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll" + ] + }, + "files-devel": { + "lib/@<@ARCH@>@": [ + "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll", + "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.lib", + "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.pdb", + "VisualC/SDLmain/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2main.lib", + "VisualC/SDLtest/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2test.lib" + ] + } + }, + "files-lib": { + "": [ + "README-SDL.txt" + ] + }, + "files-devel": { + "": [ + "README-SDL.txt", + "BUGS.txt", + "LICENSE.txt", + "README.md", + "WhatsNew.txt" + ], + "cmake": [ + "VisualC/pkg-support/cmake/sdl2-config.cmake", + "VisualC/pkg-support/cmake/sdl2-config-version.cmake" + ], + "docs": [ + "docs/*" + ], + "include": [ + "include/*.h" + ] + } + } +} diff --git a/build-scripts/setup-gdk-desktop.py b/build-scripts/setup-gdk-desktop.py new file mode 100644 index 0000000000000..d2309a0e3119e --- /dev/null +++ b/build-scripts/setup-gdk-desktop.py @@ -0,0 +1,303 @@ +#!/usr/bin/env python + +import argparse +import functools +import logging +import os +from pathlib import Path +import re +import shutil +import subprocess +import tempfile +import textwrap +import urllib.request +import zipfile + +# Update both variables when updating the GDK +GIT_REF = "June_2024_Update_1" +GDK_EDITION = "240601" # YYMMUU + +logger = logging.getLogger(__name__) + +class GdDesktopConfigurator: + def __init__(self, gdk_path, arch, vs_folder, vs_version=None, vs_toolset=None, temp_folder=None, git_ref=None, gdk_edition=None): + self.git_ref = git_ref or GIT_REF + self.gdk_edition = gdk_edition or GDK_EDITION + self.gdk_path = gdk_path + self.temp_folder = temp_folder or Path(tempfile.gettempdir()) + self.dl_archive_path = Path(self.temp_folder) / f"{ self.git_ref }.zip" + self.gdk_extract_path = Path(self.temp_folder) / f"GDK-{ self.git_ref }" + self.arch = arch + self.vs_folder = vs_folder + self._vs_version = vs_version + self._vs_toolset = vs_toolset + + def download_archive(self) -> None: + gdk_url = f"https://github.com/microsoft/GDK/archive/refs/tags/{ GIT_REF }.zip" + logger.info("Downloading %s to %s", gdk_url, self.dl_archive_path) + urllib.request.urlretrieve(gdk_url, self.dl_archive_path) + assert self.dl_archive_path.is_file() + + def extract_zip_archive(self) -> None: + extract_path = self.gdk_extract_path.parent + assert self.dl_archive_path.is_file() + logger.info("Extracting %s to %s", self.dl_archive_path, extract_path) + with zipfile.ZipFile(self.dl_archive_path) as zf: + zf.extractall(extract_path) + assert self.gdk_extract_path.is_dir(), f"{self.gdk_extract_path} must exist" + + def extract_development_kit(self) -> None: + extract_dks_cmd = self.gdk_extract_path / "SetupScripts/ExtractXboxOneDKs.cmd" + assert extract_dks_cmd.is_file() + logger.info("Extracting GDK Development Kit: running %s", extract_dks_cmd) + cmd = ["cmd.exe", "/C", str(extract_dks_cmd), str(self.gdk_extract_path), str(self.gdk_path)] + logger.debug("Running %r", cmd) + subprocess.check_call(cmd) + + def detect_vs_version(self) -> str: + vs_regex = re.compile("VS([0-9]{4})") + supported_vs_versions = [] + for p in self.gaming_grdk_build_path.iterdir(): + if not p.is_dir(): + continue + if m := vs_regex.match(p.name): + supported_vs_versions.append(m.group(1)) + logger.info(f"Supported Visual Studio versions: {supported_vs_versions}") + vs_versions = set(self.vs_folder.parts).intersection(set(supported_vs_versions)) + if not vs_versions: + raise RuntimeError("Visual Studio version is incompatible") + if len(vs_versions) > 1: + raise RuntimeError(f"Too many compatible VS versions found ({vs_versions})") + vs_version = vs_versions.pop() + logger.info(f"Used Visual Studio version: {vs_version}") + return vs_version + + def detect_vs_toolset(self) -> str: + toolset_paths = [] + for ts_path in self.gdk_toolset_parent_path.iterdir(): + if not ts_path.is_dir(): + continue + ms_props = ts_path / "Microsoft.Cpp.props" + if not ms_props.is_file(): + continue + toolset_paths.append(ts_path.name) + logger.info("Detected Visual Studio toolsets: %s", toolset_paths) + assert toolset_paths, "Have we detected at least one toolset?" + + def toolset_number(toolset: str) -> int: + if m:= re.match("[^0-9]*([0-9]+).*", toolset): + return int(m.group(1)) + return -9 + + return max(toolset_paths, key=toolset_number) + + @property + def vs_version(self) -> str: + if self._vs_version is None: + self._vs_version = self.detect_vs_version() + return self._vs_version + + @property + def vs_toolset(self) -> str: + if self._vs_toolset is None: + self._vs_toolset = self.detect_vs_toolset() + return self._vs_toolset + + @staticmethod + def copy_files_and_merge_into(srcdir: Path, dstdir: Path) -> None: + logger.info(f"Copy {srcdir} to {dstdir}") + for root, _, files in os.walk(srcdir): + dest_root = dstdir / Path(root).relative_to(srcdir) + if not dest_root.is_dir(): + dest_root.mkdir() + for file in files: + srcfile = Path(root) / file + dstfile = dest_root / file + shutil.copy(srcfile, dstfile) + + def copy_msbuild(self) -> None: + vc_toolset_parent_path = self.vs_folder / "MSBuild/Microsoft/VC" + if 1: + logger.info(f"Detected compatible Visual Studio version: {self.vs_version}") + srcdir = vc_toolset_parent_path + dstdir = self.gdk_toolset_parent_path + assert srcdir.is_dir(), "Source directory must exist" + assert dstdir.is_dir(), "Destination directory must exist" + + self.copy_files_and_merge_into(srcdir=srcdir, dstdir=dstdir) + + @property + def game_dk_path(self) -> Path: + return self.gdk_path / "Microsoft GDK" + + @property + def game_dk_latest_path(self) -> Path: + return self.game_dk_path / self.gdk_edition + + @property + def windows_sdk_path(self) -> Path: + return self.gdk_path / "Windows Kits/10" + + @property + def gaming_grdk_build_path(self) -> Path: + return self.game_dk_latest_path / "GRDK" + + @property + def gdk_toolset_parent_path(self) -> Path: + return self.gaming_grdk_build_path / f"VS{self.vs_version}/flatDeployment/MSBuild/Microsoft/VC" + + @property + def env(self) -> dict[str, str]: + game_dk = self.game_dk_path + game_dk_latest = self.game_dk_latest_path + windows_sdk_dir = self.windows_sdk_path + gaming_grdk_build = self.gaming_grdk_build_path + + return { + "GRDKEDITION": f"{self.gdk_edition}", + "GameDK": f"{game_dk}\\", + "GameDKLatest": f"{ game_dk_latest }\\", + "WindowsSdkDir": f"{ windows_sdk_dir }\\", + "GamingGRDKBuild": f"{ gaming_grdk_build }\\", + "VSInstallDir": f"{ self.vs_folder }\\", + } + + def create_user_props(self, path: Path) -> None: + vc_targets_path = self.gaming_grdk_build_path / f"VS{ self.vs_version }/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }" + vc_targets_path16 = self.gaming_grdk_build_path / f"VS2019/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }" + vc_targets_path17 = self.gaming_grdk_build_path / f"VS2022/flatDeployment/MSBuild/Microsoft/VC/{ self.vs_toolset }" + additional_include_directories = ";".join(str(p) for p in self.gdk_include_paths) + additional_library_directories = ";".join(str(p) for p in self.gdk_library_paths) + durango_xdk_install_path = self.gdk_path / "Microsoft GDK" + with path.open("w") as f: + f.write(textwrap.dedent(f"""\ + + + + { vc_targets_path }\\ + { vc_targets_path16 }\\ + { vc_targets_path17 }\\ + { self.gaming_grdk_build_path }\\ + Gaming.Desktop.x64 + Debug + { self.gdk_edition } + { durango_xdk_install_path } + + $(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2019\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\ + $(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2019\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\ + $(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2022\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\ + $(DurangoXdkInstallPath)\\{self.gdk_edition}\\GRDK\\VS2022\\flatDeployment\\MSBuild\\Microsoft\\VC\\{self.vs_toolset}\\Platforms\\$(Platform)\\ + + true + true + true + + + + { additional_include_directories };%(AdditionalIncludeDirectories) + + + { additional_library_directories };%(AdditionalLibraryDirectories) + + + + """)) + + @property + def gdk_include_paths(self) -> list[Path]: + return [ + self.gaming_grdk_build_path / "gamekit/include", + ] + + @property + def gdk_library_paths(self) -> list[Path]: + return [ + self.gaming_grdk_build_path / f"gamekit/lib/{self.arch}", + ] + + @property + def gdk_binary_path(self) -> list[Path]: + return [ + self.gaming_grdk_build_path / "bin", + self.game_dk_path / "bin", + ] + + @property + def build_env(self) -> dict[str, str]: + gdk_include = ";".join(str(p) for p in self.gdk_include_paths) + gdk_lib = ";".join(str(p) for p in self.gdk_library_paths) + gdk_path = ";".join(str(p) for p in self.gdk_binary_path) + return { + "GDK_INCLUDE": gdk_include, + "GDK_LIB": gdk_lib, + "GDK_PATH": gdk_path, + } + + def print_env(self) -> None: + for k, v in self.env.items(): + print(f"set \"{k}={v}\"") + print() + for k, v in self.build_env.items(): + print(f"set \"{k}={v}\"") + print() + print(f"set \"PATH=%GDK_PATH%;%PATH%\"") + print(f"set \"LIB=%GDK_LIB%;%LIB%\"") + print(f"set \"INCLUDE=%GDK_INCLUDE%;%INCLUDE%\"") + + +def main(): + logging.basicConfig(level=logging.INFO) + parser = argparse.ArgumentParser(allow_abbrev=False) + parser.add_argument("--arch", choices=["amd64"], default="amd64", help="Architecture") + parser.add_argument("--download", action="store_true", help="Download GDK") + parser.add_argument("--extract", action="store_true", help="Extract downloaded GDK") + parser.add_argument("--copy-msbuild", action="store_true", help="Copy MSBuild files") + parser.add_argument("--temp-folder", help="Temporary folder where to download and extract GDK") + parser.add_argument("--gdk-path", required=True, type=Path, help="Folder where to store the GDK") + parser.add_argument("--ref-edition", type=str, help="Git ref and GDK edition separated by comma") + parser.add_argument("--vs-folder", required=True, type=Path, help="Installation folder of Visual Studio") + parser.add_argument("--vs-version", required=False, type=int, help="Visual Studio version") + parser.add_argument("--vs-toolset", required=False, help="Visual Studio toolset (e.g. v150)") + parser.add_argument("--props-folder", required=False, type=Path, default=Path(), help="Visual Studio toolset (e.g. v150)") + parser.add_argument("--no-user-props", required=False, dest="user_props", action="store_false", help="Don't ") + args = parser.parse_args() + + logging.basicConfig(level=logging.INFO) + + git_ref = None + gdk_edition = None + if args.ref_edition is not None: + git_ref, gdk_edition = args.ref_edition.split(",", 1) + try: + int(gdk_edition) + except ValueError: + parser.error("Edition should be an integer (YYMMUU) (Y=year M=month U=update)") + + configurator = GdDesktopConfigurator( + arch=args.arch, + git_ref=git_ref, + gdk_edition=gdk_edition, + vs_folder=args.vs_folder, + vs_version=args.vs_version, + vs_toolset=args.vs_toolset, + gdk_path=args.gdk_path, + temp_folder=args.temp_folder, + ) + + if args.download: + configurator.download_archive() + + if args.extract: + configurator.extract_zip_archive() + + configurator.extract_development_kit() + + if args.copy_msbuild: + configurator.copy_msbuild() + + if args.user_props: + configurator.print_env() + configurator.create_user_props(args.props_folder / "Directory.Build.props") + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/build-scripts/showrev.sh b/build-scripts/showrev.sh index a061df4235832..7f33a6211c574 100755 --- a/build-scripts/showrev.sh +++ b/build-scripts/showrev.sh @@ -5,8 +5,8 @@ SDL_ROOT=$(dirname $0)/.. cd $SDL_ROOT -if [ -e ./VERSION.txt ]; then - cat ./VERSION.txt +if [ -e ./REVISION.txt ]; then + cat ./REVISION.txt exit 0 fi diff --git a/build-scripts/test-versioning.sh b/build-scripts/test-versioning.sh index 7d71c9e1511d6..ed77715165bcb 100755 --- a/build-scripts/test-versioning.sh +++ b/build-scripts/test-versioning.sh @@ -4,6 +4,8 @@ set -eu +cd `dirname $0`/.. + ref_major=$(sed -ne 's/^#define SDL_MAJOR_VERSION *//p' include/SDL_version.h) ref_minor=$(sed -ne 's/^#define SDL_MINOR_VERSION *//p' include/SDL_version.h) ref_micro=$(sed -ne 's/^#define SDL_PATCHLEVEL *//p' include/SDL_version.h) @@ -139,6 +141,25 @@ else not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_version.h $ref_version" fi +version=$(sed -Ene 's/Title SDL (.*)/\1/p' Xcode/SDL/pkg-support/SDL.info) + +if [ "$ref_version" = "$version" ]; then + ok "SDL.info Title $version" +else + not_ok "SDL.info Title $version disagrees with SDL_version.h $ref_version" +fi + +marketing=$(sed -Ene 's/.*MARKETING_VERSION = (.*);/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj) + +ref="$ref_version +$ref_version" + +if [ "$ref" = "$marketing" ]; then + ok "project.pbxproj MARKETING_VERSION is consistent" +else + not_ok "project.pbxproj MARKETING_VERSION is inconsistent, expected $ref, got $marketing" +fi + # For simplicity this assumes we'll never break ABI before SDL 3. dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL/SDL.xcodeproj/project.pbxproj) diff --git a/build-scripts/update-copyright.sh b/build-scripts/update-copyright.sh index c69ec7293467c..9bb46eac5b2f5 100755 --- a/build-scripts/update-copyright.sh +++ b/build-scripts/update-copyright.sh @@ -1,7 +1,15 @@ #!/bin/sh -find . -type f -exec grep -Il "Copyright" {} \; \ +if [ "$SED" = "" ]; then + if type gsed >/dev/null; then + SED=gsed + else + SED=sed + fi +fi + +find . -type f \ | grep -v \.git \ | while read file; do \ - LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \ + LC_ALL=C $SED -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \ done diff --git a/build-scripts/update-version.sh b/build-scripts/update-version.sh index 82174becf5fd9..9b25c2afcd1fd 100755 --- a/build-scripts/update-version.sh +++ b/build-scripts/update-version.sh @@ -30,6 +30,10 @@ echo "Updating version to '$NEWVERSION' ..." # !!! FIXME: This first one is a kinda scary search/replace that might fail later if another X.Y.Z version is added to the file. perl -w -pi -e 's/(\)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/Info-Framework.plist +perl -w -pi -e 's/(Title SDL )\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/pkg-support/SDL.info + +perl -w -pi -e 's/(MARKETING_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$NEWVERSION'/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj + DYVER=`expr $MINOR \* 100 + 1` perl -w -pi -e 's/(DYLIB_CURRENT_VERSION\s*=\s*)\d+\.\d+\.\d+/${1}'$DYVER'.0.0/;' Xcode/SDL/SDL.xcodeproj/project.pbxproj diff --git a/build-scripts/updaterev.sh b/build-scripts/updaterev.sh index cc8638210a196..d6bcae35e1dd5 100755 --- a/build-scripts/updaterev.sh +++ b/build-scripts/updaterev.sh @@ -29,7 +29,7 @@ done rev=`sh showrev.sh 2>/dev/null` if [ "$rev" != "" ]; then if [ -n "$dist" ]; then - echo "$rev" > "$outdir/VERSION.txt" + echo "$rev" > "$outdir/REVISION.txt" fi echo "/* Generated by updaterev.sh, do not edit */" >"$header.new" if [ -n "$vendor" ]; then diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl index 5aeeaf0d3d80f..42e8fa61fac3d 100755 --- a/build-scripts/wikiheaders.pl +++ b/build-scripts/wikiheaders.pl @@ -2,6 +2,7 @@ use warnings; use strict; +use File::Path; use Text::Wrap; $Text::Wrap::huge = 'overflow'; @@ -10,11 +11,12 @@ my $projectshortname = 'SDL'; my $wikisubdir = ''; my $incsubdir = 'include'; +my $readmesubdir = undef; my $apiprefixregex = undef; my $versionfname = 'include/SDL_version.h'; my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z'; my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z'; -my $versionpatchregex = '\A\#define\s+SDL_PATCHLEVEL\s+(\d+)\Z'; +my $versionmicroregex = '\A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z'; my $mainincludefname = 'SDL.h'; my $selectheaderregex = '\ASDL.*?\.h\Z'; my $projecturl = 'https://libsdl.org/'; @@ -22,10 +24,17 @@ my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new'; my $srcpath = undef; my $wikipath = undef; +my $wikireadmesubdir = 'README'; my $warn_about_missing = 0; my $copy_direction = 0; my $optionsfname = undef; my $wikipreamble = undef; +my $wikiheaderfiletext = 'Defined in %fname%'; +my $manpageheaderfiletext = 'Defined in %fname%'; +my $headercategoryeval = undef; +my $changeformat = undef; +my $manpath = undef; +my $gitrev = undef; foreach (@ARGV) { $warn_about_missing = 1, next if $_ eq '--warn-about-missing'; @@ -33,9 +42,20 @@ $copy_direction = 1, next if $_ eq '--copy-to-header'; $copy_direction = -1, next if $_ eq '--copy-to-wiki'; $copy_direction = -2, next if $_ eq '--copy-to-manpages'; + $copy_direction = -3, next if $_ eq '--report-coverage-gaps'; + $copy_direction = -4, next if $_ eq '--copy-to-latex'; if (/\A--options=(.*)\Z/) { $optionsfname = $1; next; + } elsif (/\A--changeformat=(.*)\Z/) { + $changeformat = $1; + next; + } elsif (/\A--manpath=(.*)\Z/) { + $manpath = $1; + next; + } elsif (/\A--rev=(.*)\Z/) { + $gitrev = $1; + next; } $srcpath = $_, next if not defined $srcpath; $wikipath = $_, next if not defined $wikipath; @@ -51,6 +71,8 @@ if (defined $optionsfname) { open OPTIONS, '<', $optionsfname or die("Failed to open options file '$optionsfname': $!\n"); while () { + next if /\A\s*\#/; # Skip lines that start with (optional whitespace, then) '#' as comments. + chomp; if (/\A(.*?)\=(.*)\Z/) { my $key = $1; @@ -67,9 +89,10 @@ $projectshortname = $val, next if $key eq 'projectshortname'; $wikisubdir = $val, next if $key eq 'wikisubdir'; $incsubdir = $val, next if $key eq 'incsubdir'; + $readmesubdir = $val, next if $key eq 'readmesubdir'; $versionmajorregex = $val, next if $key eq 'versionmajorregex'; $versionminorregex = $val, next if $key eq 'versionminorregex'; - $versionpatchregex = $val, next if $key eq 'versionpatchregex'; + $versionmicroregex = $val, next if $key eq 'versionmicroregex'; $versionfname = $val, next if $key eq 'versionfname'; $mainincludefname = $val, next if $key eq 'mainincludefname'; $selectheaderregex = $val, next if $key eq 'selectheaderregex'; @@ -77,11 +100,20 @@ $wikiurl = $val, next if $key eq 'wikiurl'; $bugreporturl = $val, next if $key eq 'bugreporturl'; $wikipreamble = $val, next if $key eq 'wikipreamble'; + $wikiheaderfiletext = $val, next if $key eq 'wikiheaderfiletext'; + $manpageheaderfiletext = $val, next if $key eq 'manpageheaderfiletext'; + $headercategoryeval = $val, next if $key eq 'headercategoryeval'; } } close(OPTIONS); } +sub escLaTeX { + my $str = shift; + $str =~ s/([_\#\&\^])/\\$1/g; + return $str; +} + my $wordwrap_mode = 'mediawiki'; sub wordwrap_atom { # don't call this directly. my $str = shift; @@ -131,6 +163,7 @@ sub wordwrap_with_bullet_indent { # don't call this directly. my $usual_prefix = ' ' x $bulletlen; foreach (@wrappedlines) { + s/\s*\Z//; $retval .= "$prefix$_\n"; $prefix = $usual_prefix; } @@ -157,6 +190,8 @@ sub wordwrap_one_paragraph { # don't call this directly. if ($item ne '') { $retval .= wordwrap_with_bullet_indent($bullet, $item); } + } elsif ($p =~ /\A\s*\|.*\|\s*\n/) { # Markdown table + $retval = "$p\n"; # don't wrap it (!!! FIXME: but maybe parse by lines until we run out of table...) } else { $retval = wordwrap_atom($p) . "\n"; } @@ -255,12 +290,32 @@ sub wikify_chunk { $str .= "$code<\/syntaxhighlight>"; } } elsif ($wikitype eq 'md') { + # convert `code` things first, so they aren't mistaken for other markdown items. + my $codedstr = ''; + while ($str =~ s/\A(.*?)(\`.*?\`)//ms) { + my $codeblock = $2; + $codedstr .= wikify_chunk($wikitype, $1, undef, undef); + if (defined $apiprefixregex) { + # Convert obvious API things to wikilinks, even inside `code` blocks, + # BUT ONLY IF the entire code block is the API thing, + # So something like "just call `SDL_Whatever`" will become + # "just call [`SDL_Whatever`](SDL_Whatever)", but + # "just call `SDL_Whatever(7)`" will not. It's just the safest + # way to do this without resorting to wrapping things in html tags. + $codeblock =~ s/\A\`($apiprefixregex[a-zA-Z0-9_]+)\`\Z/[`$1`]($1)/gms; + } + $codedstr .= $codeblock; + } + # Convert obvious API things to wikilinks. if (defined $apiprefixregex) { $str =~ s/\b($apiprefixregex[a-zA-Z0-9_]+)/[$1]($1)/gms; } + + $str = $codedstr . $str; + if (defined $code) { - $str .= "```$codelang$code```"; + $str .= "```$codelang\n$code\n```\n"; } } @@ -276,7 +331,7 @@ sub wikify { #print("WIKIFY WHOLE:\n\n$str\n\n\n"); - while ($str =~ s/\A(.*?)\`\`\`(c\+\+|c)(.*?)\`\`\`//ms) { + while ($str =~ s/\A(.*?)\`\`\`(.*?)\n(.*?)\n\`\`\`(\n|\Z)//ms) { $retval .= wikify_chunk($wikitype, $1, $2, $3); } $retval .= wikify_chunk($wikitype, $str, undef, undef); @@ -325,10 +380,15 @@ sub dewikify_chunk { # bullets $str =~ s/^\* /- /gm; + } elsif ($wikitype eq 'md') { + # Dump obvious wikilinks. The rest can just passthrough. + if (defined $apiprefixregex) { + $str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/$1/gms; + } } if (defined $code) { - $str .= "```$codelang$code```"; + $str .= "\n```$codelang\n$code\n```\n"; } } elsif ($dewikify_mode eq 'manpage') { $str =~ s/\./\\[char46]/gms; # make sure these can't become control codes. @@ -344,8 +404,8 @@ sub dewikify_chunk { # is also popular. :/ $str =~ s/\s*\(.*?)<\/code>\s*/\n.BR $1\n/gms; - # bold+italic - $str =~ s/\s*'''''(.*?)'''''\s*/\n.BI $1\n/gms; + # bold+italic (this looks bad, just make it bold). + $str =~ s/\s*'''''(.*?)'''''\s*/\n.B $1\n/gms; # bold $str =~ s/\s*'''(.*?)'''\s*/\n.B $1\n/gms; @@ -355,8 +415,29 @@ sub dewikify_chunk { # bullets $str =~ s/^\* /\n\\\(bu /gm; - } else { - die("Unexpected wikitype when converting to manpages\n"); # !!! FIXME: need to handle Markdown wiki pages. + } elsif ($wikitype eq 'md') { + # Dump obvious wikilinks. + if (defined $apiprefixregex) { + $str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/\n.BR $1\n/gms; + } + + # links + $str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\n.URL "$2" "$1"\n/g; + + # is also popular. :/ + $str =~ s/\s*\`(.*?)\`\s*/\n.BR $1\n/gms; + + # bold+italic (this looks bad, just make it bold). + $str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.B $1\n/gms; + + # bold + $str =~ s/\s*\*\*(.*?)\*\*\s*/\n.B $1\n/gms; + + # italic + $str =~ s/\s*\*(.*?)\*\s*/\n.I $1\n/gms; + + # bullets + $str =~ s/^\- /\n\\\(bu /gm; } if (defined $code) { @@ -369,8 +450,80 @@ sub dewikify_chunk { } $str .= ".EX\n$code\n.EE\n.PP\n"; } + } elsif ($dewikify_mode eq 'LaTeX') { + if ($wikitype eq 'mediawiki') { + # Dump obvious wikilinks. + if (defined $apiprefixregex) { + $str =~ s/\s*\[\[($apiprefixregex[a-zA-Z0-9_]+)\]\]/$1/gms; + } + + # links + $str =~ s/\[(https?\:\/\/.*?)\s+(.*?)\]/\\href{$1}{$2}/g; + + # is also popular. :/ + $str =~ s/\s*\(.*?)<\/code>/ \\texttt{$1}/gms; + + # bold+italic + $str =~ s/\s*'''''(.*?)'''''/ \\textbf{\\textit{$1}}/gms; + + # bold + $str =~ s/\s*'''(.*?)'''/ \\textbf{$1}/gms; + + # italic + $str =~ s/\s*''(.*?)''/ \\textit{$1}/gms; + + # bullets + $str =~ s/^\*\s+/ \\item /gm; + } elsif ($wikitype eq 'md') { + # Dump obvious wikilinks. + if (defined $apiprefixregex) { + $str =~ s/\[(\`?$apiprefixregex[a-zA-Z0-9_]+\`?)\]\($apiprefixregex[a-zA-Z0-9_]+\)/$1/gms; + } + + # links + $str =~ s/\[(.*?)]\((https?\:\/\/.*?)\)/\\href{$2}{$1}/g; + + # is also popular. :/ + $str =~ s/\s*\`(.*?)\`/ \\texttt{$1}/gms; + + # bold+italic + $str =~ s/\s*\*\*\*(.*?)\*\*\*/ \\textbf{\\textit{$1}}/gms; + + # bold + $str =~ s/\s*\*\*(.*?)\*\*/ \\textbf{$1}/gms; + + # italic + $str =~ s/\s*\*(.*?)\*/ \\textit{$1}/gms; + + # bullets + $str =~ s/^\-\s+/ \\item /gm; + } + + # Wrap bullet lists in itemize blocks... + $str =~ s/^(\s*\\item .*?)(\n\n|\Z)/\n\\begin{itemize}\n$1$2\n\\end{itemize}\n\n/gms; + + $str = escLaTeX($str); + + if (defined $code) { + $code =~ s/\A\n+//gms; + $code =~ s/\n+\Z//gms; + + if (($codelang eq '') || ($codelang eq 'output')) { + $str .= "\\begin{verbatim}\n$code\n\\end{verbatim}\n"; + } else { + if ($codelang eq 'c') { + $codelang = 'C'; + } elsif ($codelang eq 'c++') { + $codelang = 'C++'; + } else { + die("Unexpected codelang '$codelang'"); + } + $str .= "\n\\lstset{language=$codelang}\n"; + $str .= "\\begin{lstlisting}\n$code\n\\end{lstlisting}\n"; + } + } } else { - die("Unexpected dewikify_mode\n"); + die("Unexpected dewikify_mode"); } #print("\n\nDEWIKIFY CHUNK DONE:\n\n$str\n\n\n"); @@ -389,8 +542,14 @@ sub dewikify { $str =~ s/\A[\s\n]*\=\= .*? \=\=\s*?\n+//ms; my $retval = ''; - while ($str =~ s/\A(.*?)(.*?)<\/syntaxhighlight\>//ms) { - $retval .= dewikify_chunk($wikitype, $1, $2, $3); + if ($wikitype eq 'mediawiki') { + while ($str =~ s/\A(.*?)(.*?)<\/syntaxhighlight\>//ms) { + $retval .= dewikify_chunk($wikitype, $1, $2, $3); + } + } elsif ($wikitype eq 'md') { + while ($str =~ s/\A(.*?)\n```(.*?)\n(.*?)\n```\n//ms) { + $retval .= dewikify_chunk($wikitype, $1, $2, $3); + } } $retval .= dewikify_chunk($wikitype, $str, undef, undef); @@ -399,77 +558,246 @@ sub dewikify { return $retval; } +sub filecopy { + my $src = shift; + my $dst = shift; + my $endline = shift; + $endline = "\n" if not defined $endline; + + open(COPYIN, '<', $src) or die("Failed to open '$src' for reading: $!\n"); + open(COPYOUT, '>', $dst) or die("Failed to open '$dst' for writing: $!\n"); + while () { + chomp; + s/[ \t\r\n]*\Z//; + print COPYOUT "$_$endline"; + } + close(COPYOUT); + close(COPYIN); +} + sub usage { - die("USAGE: $0 [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing]\n\n"); + die("USAGE: $0 [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing] [--manpath=]\n\n"); } usage() if not defined $srcpath; usage() if not defined $wikipath; #usage() if $copy_direction == 0; +if (not defined $manpath) { + $manpath = "$srcpath/man"; +} + my @standard_wiki_sections = ( 'Draft', '[Brief]', 'Deprecated', + 'Header File', 'Syntax', 'Function Parameters', + 'Macro Parameters', + 'Fields', + 'Values', 'Return Value', 'Remarks', + 'Thread Safety', 'Version', 'Code Examples', - 'Related Functions' + 'See Also' ); # Sections that only ever exist in the wiki and shouldn't be deleted when # not found in the headers. my %only_wiki_sections = ( # The ones don't mean anything, I just need to check for key existence. 'Draft', 1, - 'Code Examples', 1 + 'Code Examples', 1, + 'Header File', 1 ); my %headers = (); # $headers{"SDL_audio.h"} -> reference to an array of all lines of text in SDL_audio.h. -my %headerfuncs = (); # $headerfuncs{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded! +my %headersyms = (); # $headersyms{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded! my %headerdecls = (); -my %headerfuncslocation = (); # $headerfuncslocation{"SDL_OpenAudio"} -> name of header holding SDL_OpenAudio define ("SDL_audio.h" in this case). -my %headerfuncschunk = (); # $headerfuncschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this function. -my %headerfuncshasdoxygen = (); # $headerfuncschunk{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function. +my %headersymslocation = (); # $headersymslocation{"SDL_OpenAudio"} -> name of header holding SDL_OpenAudio define ("SDL_audio.h" in this case). +my %headersymschunk = (); # $headersymschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this symbol. +my %headersymshasdoxygen = (); # $headersymshasdoxygen{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function. +my %headersymstype = (); # $headersymstype{"SDL_OpenAudio"} -> 1 (function), 2 (macro), 3 (struct), 4 (enum), 5 (other typedef) +my %headersymscategory = (); # $headersymscategory{"SDL_OpenAudio"} -> 'Audio' ... this is set with a `/* WIKI CATEGEORY: Audio */` comment in the headers that sets it on all symbols until a new comment changes it. So usually, once at the top of the header file. +my %headercategorydocs = (); # $headercategorydocs{"Audio"} -> (fake) symbol for this category's documentation. Undefined if not documented. +my %headersymsparaminfo = (); # $headersymsparaminfo{"SDL_OpenAudio"} -> reference to array of parameters, pushed by name, then C type string, repeating. Undef'd if void params, or not a function. +my %headersymsrettype = (); # $headersymsrettype{"SDL_OpenAudio"} -> string of C datatype of return value. Undef'd if not a function. +my %wikitypes = (); # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki' +my %wikisyms = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikisyms{"SDL_OpenAudio"}{"Remarks"}. +my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks' + +my %referenceonly = (); # $referenceonly{"Y"} -> symbol name that this symbol is bound to. This makes wiki pages that say "See X" where "X" is a typedef and "Y" is a define attached to it. These pages are generated in the wiki only and do not bridge to the headers or manpages. + +my @coverage_gap = (); # array of strings that weren't part of documentation, or blank, or basic preprocessor logic. Lets you see what this script is missing! + +sub add_coverage_gap { + if ($copy_direction == -3) { # --report-coverage-gaps + my $text = shift; + my $dent = shift; + my $lineno = shift; + return if $text =~ /\A\s*\Z/; # skip blank lines + return if $text =~ /\A\s*\#\s*(if|el|endif|include)/; # skip preprocessor floof. + push @coverage_gap, "$dent:$lineno: $text"; + } +} + +sub print_undocumented_section { + my $fh = shift; + my $typestr = shift; + my $typeval = shift; + + print $fh "## $typestr defined in the headers, but not in the wiki\n\n"; + my $header_only_sym = 0; + foreach (sort keys %headersyms) { + my $sym = $_; + if ((not defined $wikisyms{$sym}) && ($headersymstype{$sym} == $typeval)) { + print $fh "- [$sym]($sym)\n"; + $header_only_sym = 1; + } + } + if (!$header_only_sym) { + print $fh "(none)\n"; + } + print $fh "\n"; + + if (0) { # !!! FIXME: this lists things that _shouldn't_ be in the headers, like MigrationGuide, etc, but also we don't know if they're functions, macros, etc at this point (can we parse that from the wiki page, though?) + print $fh "## $typestr defined in the wiki, but not in the headers\n\n"; + + my $wiki_only_sym = 0; + foreach (sort keys %wikisyms) { + my $sym = $_; + if ((not defined $headersyms{$sym}) && ($headersymstype{$sym} == $typeval)) { + print $fh "- [$sym]($sym)\n"; + $wiki_only_sym = 1; + } + } + if (!$wiki_only_sym) { + print $fh "(none)\n"; + } + print $fh "\n"; + } +} + +sub strip_fn_declaration_metadata { + my $decl = shift; + $decl =~ s/SDL_(PRINTF|SCANF)_FORMAT_STRING\s*//; # don't want this metadata as part of the documentation. + $decl =~ s/SDL_ALLOC_SIZE2?\(.*?\)\s*//; # don't want this metadata as part of the documentation. + $decl =~ s/SDL_MALLOC\s*//; # don't want this metadata as part of the documentation. + $decl =~ s/SDL_(IN|OUT|INOUT)_.*?CAP\s*\(.*?\)\s*//g; # don't want this metadata as part of the documentation. + $decl =~ s/\)(\s*SDL_[a-zA-Z_]+(\(.*?\)|))*;/);/; # don't want this metadata as part of the documentation. + return $decl; +} + +sub sanitize_c_typename { + my $str = shift; + $str =~ s/\A\s+//; + $str =~ s/\s+\Z//; + $str =~ s/const\s*(\*+)/const $1/g; # one space between `const` and pointer stars: `char const* const *` becomes `char const * const *`. + $str =~ s/\*\s+\*/**/g; # drop spaces between pointers: `void * *` becomes `void **`. + $str =~ s/\s*(\*+)\Z/ $1/; # one space between pointer stars and what it points to: `void**` becomes `void **`. + return $str; +} my $incpath = "$srcpath"; $incpath .= "/$incsubdir" if $incsubdir ne ''; +my $wikireadmepath = "$wikipath/$wikireadmesubdir"; +my $readmepath = undef; +if (defined $readmesubdir) { + $readmepath = "$srcpath/$readmesubdir"; +} + opendir(DH, $incpath) or die("Can't opendir '$incpath': $!\n"); -while (readdir(DH)) { - my $dent = $_; +while (my $d = readdir(DH)) { + my $dent = $d; next if not $dent =~ /$selectheaderregex/; # just selected headers. open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n"); - my @contents = (); + # You can optionally set a wiki category with Perl code in .wikiheaders-options that gets eval()'d per-header, + # and also if you put `/* WIKI CATEGORY: blah */` on a line by itself, it'll change the category for any symbols + # below it in the same file. If no category is set, one won't be added for the symbol (beyond the standard CategoryFunction, etc) + my $current_wiki_category = undef; + if (defined $headercategoryeval) { + $_ = $dent; + $current_wiki_category = eval($headercategoryeval); + if (($current_wiki_category eq '') || ($current_wiki_category eq '-')) { + $current_wiki_category = undef; + } + #print("CATEGORY FOR '$dent' IS " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n"); + } + my @contents = (); + my $ignoring_lines = 0; + my $header_comment = -1; + my $saw_category_doxygen = -1; + my $lineno = 0; while () { chomp; + $lineno++; + my $symtype = 0; # nothing, yet. my $decl; my @templines; my $str; my $has_doxygen = 1; - if (/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) { # a function declaration without a doxygen comment? + + # Since a lot of macros are just preprocessor logic spam and not all macros are worth documenting anyhow, we only pay attention to them when they have a Doxygen comment attached. + # Functions and other things are a different story, though! + + if ($header_comment == -1) { + $header_comment = /\A\/\*\s*\Z/ ? 1 : 0; + } elsif (($header_comment == 1) && (/\A\*\/\s*\Z/)) { + $header_comment = 0; + } + + if ($ignoring_lines && /\A\s*\#\s*endif\s*\Z/) { + $ignoring_lines = 0; + push @contents, $_; + next; + } elsif ($ignoring_lines) { + push @contents, $_; + next; + } elsif (/\A\s*\#\s*ifndef\s+SDL_WIKI_DOCUMENTATION_SECTION\s*\Z/) { + $ignoring_lines = 1; + push @contents, $_; + next; + } elsif (/\A\s*\/\*\s*WIKI CATEGORY:\s*(.*?)\s*\*\/\s*\Z/) { + $current_wiki_category = (($1 eq '') || ($1 eq '-')) ? undef : $1; + #print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n"); + push @contents, $_; + next; + } elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) { # a function declaration without a doxygen comment? + $symtype = 1; # function declaration + @templines = (); + $decl = $_; + $str = ''; + $has_doxygen = 0; + } elsif (/\A\s*SDL_FORCE_INLINE/) { # a (forced-inline) function declaration without a doxygen comment? + $symtype = 1; # function declaration @templines = (); $decl = $_; $str = ''; $has_doxygen = 0; } elsif (not /\A\/\*\*\s*\Z/) { # not doxygen comment start? push @contents, $_; + add_coverage_gap($_, $dent, $lineno) if ($header_comment == 0); next; } else { # Start of a doxygen comment, parse it out. + my $is_category_doxygen = 0; + @templines = ( $_ ); while () { chomp; + $lineno++; push @templines, $_; last if /\A\s*\*\/\Z/; if (s/\A\s*\*\s*\`\`\`/```/) { # this is a hack, but a lot of other code relies on the whitespace being trimmed, but we can't trim it in code blocks... $str .= "$_\n"; while () { chomp; + $lineno++; push @templines, $_; s/\A\s*\*\s?//; if (s/\A\s*\`\`\`/```/) { @@ -480,116 +808,468 @@ sub usage { } } } else { - s/\A\s*\*\s*//; + s/\A\s*\*\s*//; # Strip off the " * " at the start of the comment line. + + # To add documentation to Category Pages, the rule is it has to + # be the first Doxygen comment in the header, and it must start with `# CategoryX` + # (otherwise we'll treat it as documentation for whatever's below it). `X` is + # the category name, which doesn't _necessarily_ have to match + # $current_wiki_category, but it probably should. + # + # For compatibility with Doxygen, if there's a `\file` here instead of + # `# CategoryName`, we'll accept it and use the $current_wiki_category if set. + if ($saw_category_doxygen == -1) { + $saw_category_doxygen = defined($current_wiki_category) && /\A\\file\s+/; + if ($saw_category_doxygen) { + $_ = "# Category$current_wiki_category"; + } else { + $saw_category_doxygen = /\A\# Category/; + } + $is_category_doxygen = $saw_category_doxygen; + } + $str .= "$_\n"; } } - $decl = ; - $decl = '' if not defined $decl; - chomp($decl); - if (not $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) { + if ($is_category_doxygen) { + $str =~ s/\s*\Z//; + $decl = ''; + $symtype = -1; # not a symbol at all. + } else { + $decl = ; + $lineno++ if defined $decl; + $decl = '' if not defined $decl; + chomp($decl); + if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) { + $symtype = 1; # function declaration + } elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) { + $symtype = 1; # (forced-inline) function declaration + } elsif ($decl =~ /\A\s*\#\s*define\s+/) { + $symtype = 2; # macro + } elsif ($decl =~ /\A\s*(typedef\s+|)(struct|union)/) { + $symtype = 3; # struct or union + } elsif ($decl =~ /\A\s*(typedef\s+|)enum/) { + $symtype = 4; # enum + } elsif ($decl =~ /\A\s*typedef\s+.*\Z/) { + $symtype = 5; # other typedef + } else { + #print "Found doxygen but no function sig:\n$str\n\n"; + foreach (@templines) { + push @contents, $_; + add_coverage_gap($_, $dent, $lineno); + } + push @contents, $decl; + add_coverage_gap($decl, $dent, $lineno); + next; + } + } + } + + my @paraminfo = (); + my $rettype = undef; + my @decllines = ( $decl ); + my $sym = ''; + + if ($symtype == -1) { # category documentation with no symbol attached. + @decllines = (); + if ($str =~ /^#\s*Category(.*?)\s*$/m) { + $sym = "[category documentation] $1"; # make a fake, unique symbol that's not valid C. + } else { + die("Unexpected category documentation line '$str' in '$incpath/$dent' ...?"); + } + $headercategorydocs{$current_wiki_category} = $sym; + } elsif ($symtype == 1) { # a function + my $is_forced_inline = ($decl =~ /\A\s*SDL_FORCE_INLINE/); + + if ($is_forced_inline) { + if (not $decl =~ /\)\s*(\{.*|)\s*\Z/) { + while () { + chomp; + $lineno++; + push @decllines, $_; + s/\A\s+//; + s/\s+\Z//; + $decl .= " $_"; + last if /\)\s*(\{.*|)\s*\Z/; + } + } + $decl =~ s/\s*\)\s*(\{.*|)\s*\Z/);/; + } else { + if (not $decl =~ /;/) { + while () { + chomp; + $lineno++; + push @decllines, $_; + s/\A\s+//; + s/\s+\Z//; + $decl .= " $_"; + last if /;/; + } + } + $decl =~ s/\s+\);\Z/);/; + $decl =~ s/\s+;\Z/;/; + } + + $decl =~ s/\s+\Z//; + + $decl = strip_fn_declaration_metadata($decl); + + my $paramsstr = undef; + + if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) { + $sym = $8; + $rettype = "$3$4$5$6"; + $paramsstr = $9; + } elsif ($is_forced_inline && $decl =~ /\A\s*SDL_FORCE_INLINE\s+(SDL_DEPRECATED\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) { + $sym = $6; + $rettype = "$2$3$4$5"; + $paramsstr = $7; + } else { #print "Found doxygen but no function sig:\n$str\n\n"; foreach (@templines) { push @contents, $_; } - push @contents, $decl; + foreach (@decllines) { + push @contents, $_; + } next; } - } - my @decllines = ( $decl ); + $rettype = sanitize_c_typename($rettype); + + if ($paramsstr =~ /\(/) { + die("\n\n$0 FAILURE!\n" . + "There's a '(' in the parameters for function '$sym' '$incpath/$dent'.\n" . + "This usually means there's a parameter that's a function pointer type.\n" . + "This causes problems for wikiheaders.pl and is less readable, too.\n" . + "Please put that function pointer into a typedef,\n" . + "and use the new type in this function's signature instead!\n\n"); + } + + my @params = split(/,/, $paramsstr); + my $dotdotdot = 0; + foreach (@params) { + my $p = $_; + $p =~ s/\A\s+//; + $p =~ s/\s+\Z//; + if (($p eq 'void') || ($p eq '')) { + die("Void parameter in a function with multiple params?! ('$sym' in '$incpath/$dent')") if (scalar(@params) != 1); + } elsif ($p eq '...') { + die("Mutiple '...' params?! ('$sym' in '$incpath/$dent')") if ($dotdotdot); + $dotdotdot = 1; + push @paraminfo, '...'; + push @paraminfo, '...'; + } elsif ($p =~ /\A(.*)\s+([a-zA-Z0-9_\*\[\]]+)\Z/) { + die("Parameter after '...' param?! ('$sym' in '$incpath/$dent')") if ($dotdotdot); + my $t = $1; + my $n = $2; + if ($n =~ s/\A(\*+)//) { + $t .= $1; # move any `*` that stuck to the name over. + } + if ($n =~ s/\[\]\Z//) { + $t = "$t*"; # move any `[]` that stuck to the name over, as a pointer. + } + $t = sanitize_c_typename($t); + #print("$t\n"); + #print("$n\n"); + push @paraminfo, $n; + push @paraminfo, $t; + } else { + die("Unexpected parameter '$p' in function '$sym' in '$incpath/$dent'!"); + } + } + + if (!$is_forced_inline) { # don't do with forced-inline because we don't want the implementation inserted in the wiki. + $decl = ''; # rebuild this with the line breaks, since it looks better for syntax highlighting. + foreach (@decllines) { + if ($decl eq '') { + $decl = $_; + $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /; + } else { + my $trimmed = $_; + # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too. + $trimmed =~ s/\A\s{28}//; # 28 for shrinking to match the removed "extern SDL_DECLSPEC SDLCALL " + $decl .= $trimmed; + } + $decl .= "\n"; + } + } - if (not $decl =~ /\)\s*;/) { + $decl = strip_fn_declaration_metadata($decl); + + # !!! FIXME: code duplication with typedef processing, below. + # We assume any `#define`s directly after the function are related to it: probably bitflags for an integer typedef. + # We'll also allow some other basic preprocessor lines. + # Blank lines are allowed, anything else, even comments, are not. + my $blank_lines = 0; + my $lastpos = tell(FH); + my $lastlineno = $lineno; + my $additional_decl = ''; + my $saw_define = 0; while () { chomp; - push @decllines, $_; - s/\A\s+//; - s/\s+\Z//; - $decl .= " $_"; - last if /\)\s*;/; - } - } - $decl =~ s/\s+\);\Z/);/; - $decl =~ s/\s+\Z//; - #print("DECL: [$decl]\n"); + $lineno++; + + if (/\A\s*\Z/) { + $blank_lines++; + } elsif (/\A\s*\#\s*(define|if|else|elif|endif)(\s+|\Z)/) { + if (/\A\s*\#\s*define\s+([a-zA-Z0-9_]*)/) { + $referenceonly{$1} = $sym; + $saw_define = 1; + } elsif (!$saw_define) { + # if the first non-blank thing isn't a #define, assume we're done. + seek(FH, $lastpos, 0); # re-read eaten lines again next time. + $lineno = $lastlineno; + last; + } - my $fn = ''; - if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) { - $fn = $6; - #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/; - } else { - #print "Found doxygen but no function sig:\n$str\n\n"; - foreach (@templines) { - push @contents, $_; + # update strings now that we know everything pending is to be applied to this declaration. Add pending blank lines and the new text. + + # At Sam's request, don't list property defines with functions. (See #9440) + my $is_property = /\A\s*\#\s*define\s+SDL_PROP_/; + if (!$is_property) { + if ($blank_lines > 0) { + while ($blank_lines > 0) { + $additional_decl .= "\n"; + push @decllines, ''; + $blank_lines--; + } + } + $additional_decl .= "\n$_"; + push @decllines, $_; + $lastpos = tell(FH); + } + } else { + seek(FH, $lastpos, 0); # re-read eaten lines again next time. + $lineno = $lastlineno; + last; + } } - foreach (@decllines) { - push @contents, $_; + $decl .= $additional_decl; + + } elsif ($symtype == 2) { # a macro + if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) { + $sym = $1; + } else { + #print "Found doxygen but no macro:\n$str\n\n"; + foreach (@templines) { + push @contents, $_; + } + foreach (@decllines) { + push @contents, $_; + } + next; } - next; - } - $decl = ''; # build this with the line breaks, since it looks better for syntax highlighting. - foreach (@decllines) { - if ($decl eq '') { - $decl = $_; - $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$2$3 /; + while ($decl =~ /\\\Z/) { + my $l = ; + last if not $l; + $lineno++; + chomp($l); + push @decllines, $l; + #$l =~ s/\A\s+//; + $l =~ s/\s+\Z//; + $decl .= "\n$l"; + } + } elsif (($symtype == 3) || ($symtype == 4)) { # struct or union or enum + my $has_definition = 0; + if ($decl =~ /\A\s*(typedef\s+|)(struct|union|enum)\s*(.*?)\s*(\n|\{|\;|\Z)/) { + my $ctype = $2; + my $origsym = $3; + my $ending = $4; + $sym = $origsym; + if ($sym =~ s/\A(.*?)(\s+)(.*?)\Z/$1/) { + die("Failed to parse '$origsym' correctly!") if ($sym ne $1); # Thought this was "typedef struct MySym MySym;" ... it was not. :( This is a hack! + } + if ($sym eq '') { + die("\n\n$0 FAILURE!\n" . + "There's a 'typedef $ctype' in $incpath/$dent without a name at the top.\n" . + "Instead of `typedef $ctype {} x;`, this should be `typedef $ctype x {} x;`.\n" . + "This causes problems for wikiheaders.pl and scripting language bindings.\n" . + "Please fix it!\n\n"); + } + $has_definition = ($ending ne ';'); } else { - my $trimmed = $_; - # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too. - $trimmed =~ s/\A\s{24}//; # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL " - $decl .= $trimmed; + #print "Found doxygen but no datatype:\n$str\n\n"; + foreach (@templines) { + push @contents, $_; + } + foreach (@decllines) { + push @contents, $_; + } + next; } - $decl .= "\n"; - } - #print("$fn:\n$str\n\n"); + # This block attempts to find the whole struct/union/enum definition by counting matching brackets. Kind of yucky. + if ($has_definition) { + my $started = 0; + my $brackets = 0; + my $pending = $decl; + + $decl = ''; + while (!$started || ($brackets != 0)) { + foreach my $seg (split(/([{}])/, $pending)) { + $decl .= $seg; + if ($seg eq '{') { + $started = 1; + $brackets++; + } elsif ($seg eq '}') { + die("Something is wrong with header $incpath/$dent while parsing $sym; is a bracket missing?\n") if ($brackets <= 0); + $brackets--; + } + } - # There might be multiple declarations of a function due to #ifdefs, - # and only one of them will have documentation. If we hit an - # undocumented one before, delete the placeholder line we left for - # it so it doesn't accumulate a new blank line on each run. - my $skipfn = 0; - if (defined $headerfuncshasdoxygen{$fn}) { - if ($headerfuncshasdoxygen{$fn} == 0) { # An undocumented declaration already exists, nuke its placeholder line. - delete $contents[$headerfuncschunk{$fn}]; # delete DOES NOT RENUMBER existing elements! - } else { # documented function already existed? - $skipfn = 1; # don't add this copy to the list of functions. - if ($has_doxygen) { - print STDERR "WARNING: Function '$fn' appears to be documented in multiple locations. Only keeping the first one we saw!\n"; + if (!$started || ($brackets != 0)) { + $pending = ; + die("EOF/error reading $incpath/$dent while parsing $sym\n") if not $pending; + $lineno++; + chomp($pending); + push @decllines, $pending; + $decl .= "\n"; + } } - push @contents, join("\n", @decllines); # just put the existing declation in as-is. + # this currently assumes the struct/union/enum ends on the line with the final bracket. I'm not writing a C parser here, fix the header! } - } + } elsif ($symtype == 5) { # other typedef + if ($decl =~ /\A\s*typedef\s+(.*)\Z/) { + my $tdstr = $1; - if (!$skipfn) { - $headerfuncs{$fn} = $str; - $headerdecls{$fn} = $decl; - $headerfuncslocation{$fn} = $dent; - $headerfuncschunk{$fn} = scalar(@contents); - $headerfuncshasdoxygen{$fn} = $has_doxygen; - push @contents, join("\n", @templines); - push @contents, join("\n", @decllines); - } + if (not $decl =~ /;/) { + while () { + chomp; + $lineno++; + push @decllines, $_; + s/\A\s+//; + s/\s+\Z//; + $decl .= " $_"; + last if /;/; + } + } + $decl =~ s/\s+(\))?;\Z/$1;/; - } - close(FH); + $tdstr =~ s/;\s*\Z//; - $headers{$dent} = \@contents; -} -closedir(DH); + #my $datatype; + if ($tdstr =~ /\A(.*?)\s*\((.*?)\s*\*\s*(.*?)\)\s*\((.*?)(\))?/) { # a function pointer type + $sym = $3; + #$datatype = "$1 ($2 *$sym)($4)"; + } elsif ($tdstr =~ /\A(.*[\s\*]+)(.*?)\s*\Z/) { + $sym = $2; + #$datatype = $1; + } else { + die("Failed to parse typedef '$tdstr' in $incpath/$dent!\n"); # I'm hitting a C grammar nail with a regexp hammer here, y'all. + } + $sym =~ s/\A\s+//; + $sym =~ s/\s+\Z//; + #$datatype =~ s/\A\s+//; + #$datatype =~ s/\s+\Z//; + } else { + #print "Found doxygen but no datatype:\n$str\n\n"; + foreach (@templines) { + push @contents, $_; + } + foreach (@decllines) { + push @contents, $_; + } + next; + } + + # We assume any `#define`s directly after the typedef are related to it: probably bitflags for an integer typedef. + # We'll also allow some other basic preprocessor lines. + # Blank lines are allowed, anything else, even comments, are not. + my $blank_lines = 0; + my $lastpos = tell(FH); + my $lastlineno = $lineno; + my $additional_decl = ''; + my $saw_define = 0; + while () { + chomp; + + $lineno++; + + if (/\A\s*\Z/) { + $blank_lines++; + } elsif (/\A\s*\#\s*(define|if|else|elif|endif)(\s+|\Z)/) { + if (/\A\s*\#\s*define\s+([a-zA-Z0-9_]*)/) { + $referenceonly{$1} = $sym; + $saw_define = 1; + } elsif (!$saw_define) { + # if the first non-blank thing isn't a #define, assume we're done. + seek(FH, $lastpos, 0); # re-read eaten lines again next time. + $lineno = $lastlineno; + last; + } + # update strings now that we know everything pending is to be applied to this declaration. Add pending blank lines and the new text. + if ($blank_lines > 0) { + while ($blank_lines > 0) { + $additional_decl .= "\n"; + push @decllines, ''; + $blank_lines--; + } + } + $additional_decl .= "\n$_"; + push @decllines, $_; + $lastpos = tell(FH); + } else { + seek(FH, $lastpos, 0); # re-read eaten lines again next time. + $lineno = $lastlineno; + last; + } + } + $decl .= $additional_decl; + } else { + die("Unexpected symtype $symtype"); + } + + #print("DECL: [$decl]\n"); + + #print("$sym:\n$str\n\n"); + + # There might be multiple declarations of a function due to #ifdefs, + # and only one of them will have documentation. If we hit an + # undocumented one before, delete the placeholder line we left for + # it so it doesn't accumulate a new blank line on each run. + my $skipsym = 0; + if (defined $headersymshasdoxygen{$sym}) { + if ($headersymshasdoxygen{$sym} == 0) { # An undocumented declaration already exists, nuke its placeholder line. + delete $contents[$headersymschunk{$sym}]; # delete DOES NOT RENUMBER existing elements! + } else { # documented function already existed? + $skipsym = 1; # don't add this copy to the list of functions. + if ($has_doxygen) { + print STDERR "WARNING: Symbol '$sym' appears to be documented in multiple locations. Only keeping the first one we saw!\n"; + } + push @contents, join("\n", @decllines) if (scalar(@decllines) > 0); # just put the existing declation in as-is. + } + } + + if (!$skipsym) { + $headersymscategory{$sym} = $current_wiki_category if defined $current_wiki_category; + $headersyms{$sym} = $str; + $headerdecls{$sym} = $decl; + $headersymslocation{$sym} = $dent; + $headersymschunk{$sym} = scalar(@contents); + $headersymshasdoxygen{$sym} = $has_doxygen; + $headersymstype{$sym} = $symtype; + $headersymsparaminfo{$sym} = \@paraminfo if (scalar(@paraminfo) > 0); + $headersymsrettype{$sym} = $rettype if (defined($rettype)); + push @contents, join("\n", @templines); + push @contents, join("\n", @decllines) if (scalar(@decllines) > 0); + } + + } + close(FH); + + $headers{$dent} = \@contents; +} +closedir(DH); -# !!! FIXME: we need to parse enums and typedefs and structs and defines and and and and and... -# !!! FIXME: (but functions are good enough for now.) -my %wikitypes = (); # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki' -my %wikifuncs = (); # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikifuncs{"SDL_OpenAudio"}{"Remarks"}. -my %wikisectionorder = (); # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks' opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n"); -while (readdir(DH)) { - my $dent = $_; +while (my $d = readdir(DH)) { + my $dent = $d; my $type = ''; if ($dent =~ /\.(md|mediawiki)\Z/) { $type = $1; @@ -597,17 +1277,48 @@ sub usage { next; # only dealing with wiki pages. } - my $fn = $dent; - $fn =~ s/\..*\Z//; + my $sym = $dent; + $sym =~ s/\..*\Z//; + # (There are other pages to ignore, but these are known ones to not bother parsing.) # Ignore FrontPage. - next if $fn eq 'FrontPage'; - - # Ignore "Category*" pages. - next if ($fn =~ /\ACategory/); + next if $sym eq 'FrontPage'; open(FH, '<', "$wikipath/$dent") or die("Can't open '$wikipath/$dent': $!\n"); + if ($sym =~ /\ACategory(.*?)\Z/) { # Special case for Category pages. + # Find the end of the category documentation in the existing file and append everything else to the new file. + my $cat = $1; + my $docstr = ''; + my $notdocstr = ''; + my $docs = 1; + while () { + chomp; + if ($docs) { + $docs = 0 if /\A\-\-\-\-\Z/; # Hit a footer? We're done. + $docs = 0 if /\A', $path) or die("Can't open '$path': $!\n"); + + print $fh "# Undocumented\n\n"; + print_undocumented_section($fh, 'Functions', 1); + #print_undocumented_section($fh, 'Macros', 2); + + close($fh); +} if ($warn_about_missing) { - foreach (keys %wikifuncs) { - my $fn = $_; - if (not defined $headerfuncs{$fn}) { - print("WARNING: $fn defined in the wiki but not the headers!\n"); + foreach (keys %wikisyms) { + my $sym = $_; + if (not defined $headersyms{$sym}) { + print STDERR "WARNING: $sym defined in the wiki but not the headers!\n"; } } - foreach (keys %headerfuncs) { - my $fn = $_; - if (not defined $wikifuncs{$fn}) { - print("WARNING: $fn defined in the headers but not the wiki!\n"); + foreach (keys %headersyms) { + my $sym = $_; + if (not defined $wikisyms{$sym}) { + print STDERR "WARNING: $sym defined in the headers but not the wiki!\n"; } } } @@ -721,22 +1452,44 @@ sub usage { $dewikify_mode = 'md'; $wordwrap_mode = 'md'; # the headers use Markdown format. - foreach (keys %headerfuncs) { - my $fn = $_; - next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it. - my $wikitype = $wikitypes{$fn}; - my $sectionsref = $wikifuncs{$fn}; - my $remarks = %$sectionsref{'Remarks'}; - my $params = %$sectionsref{'Function Parameters'}; - my $returns = %$sectionsref{'Return Value'}; - my $version = %$sectionsref{'Version'}; - my $related = %$sectionsref{'Related Functions'}; - my $deprecated = %$sectionsref{'Deprecated'}; - my $brief = %$sectionsref{'[Brief]'}; + foreach (keys %headersyms) { + my $sym = $_; + next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it. + my $symtype = $headersymstype{$sym}; + my $wikitype = $wikitypes{$sym}; + my $sectionsref = $wikisyms{$sym}; + my $remarks = $sectionsref->{'Remarks'}; + my $returns = $sectionsref->{'Return Value'}; + my $threadsafety = $sectionsref->{'Thread Safety'}; + my $version = $sectionsref->{'Version'}; + my $related = $sectionsref->{'See Also'}; + my $deprecated = $sectionsref->{'Deprecated'}; + my $brief = $sectionsref->{'[Brief]'}; my $addblank = 0; my $str = ''; - $headerfuncshasdoxygen{$fn} = 1; # Added/changed doxygen for this header. + my $params = undef; + my $paramstr = undef; + + if ($symtype == -1) { # category documentation block. + # nothing to be done here. + } elsif (($symtype == 1) || (($symtype == 5))) { # we'll assume a typedef (5) with a \param is a function pointer typedef. + $params = $sectionsref->{'Function Parameters'}; + $paramstr = '\param'; + } elsif ($symtype == 2) { + $params = $sectionsref->{'Macro Parameters'}; + $paramstr = '\param'; + } elsif ($symtype == 3) { + $params = $sectionsref->{'Fields'}; + $paramstr = '\field'; + } elsif ($symtype == 4) { + $params = $sectionsref->{'Values'}; + $paramstr = '\value'; + } else { + die("Unexpected symtype $symtype"); + } + + $headersymshasdoxygen{$sym} = 1; # Added/changed doxygen for this header. $brief = dewikify($wikitype, $brief); $brief =~ s/\A(.*?\.) /$1\n/; # \brief should only be one sentence, delimited by a period+space. Split if necessary. @@ -778,21 +1531,66 @@ sub usage { if ($wikitype eq 'mediawiki') { die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|'); # Dump the '{|' start while (scalar(@lines) >= 3) { + my $c_datatype = shift @lines; my $name = shift @lines; my $desc = shift @lines; - my $terminator = shift @lines; # the '|-' or '|}' line. + my $terminator; # the '|-' or '|}' line. + + if (($desc eq '|-') or ($desc eq '|}') or (not $desc =~ /\A\|/)) { # we seem to be out of cells, which means there was no datatype column on this one. + $terminator = $desc; + $desc = $name; + $name = $c_datatype; + $c_datatype = ''; + } else { + $terminator = shift @lines; + } + last if ($terminator ne '|-') and ($terminator ne '|}'); # we seem to have run out of table. $name =~ s/\A\|\s*//; $name =~ s/\A\*\*(.*?)\*\*/$1/; $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; $desc =~ s/\A\|\s*//; - #print STDERR "FN: $fn NAME: $name DESC: $desc TERM: $terminator\n"; + #print STDERR "SYM: $sym CDATATYPE: $c_datatype NAME: $name DESC: $desc TERM: $terminator\n"; + my $whitespacelen = length($name) + 8; + my $whitespace = ' ' x $whitespacelen; + $desc = wordwrap($desc, -$whitespacelen); + my @desclines = split /\n/, $desc; + my $firstline = shift @desclines; + $str .= "$paramstr $name $firstline\n"; + foreach (@desclines) { + $str .= "${whitespace}$_\n"; + } + } + } elsif ($wikitype eq 'md') { + my $l; + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A(\s*\|)?\s*\|\s*\|\s*\|\s*\Z/); + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*(\|\s*\-*\s*)?\|\s*\-*\s*\|\s*\-*\s*\|\s*\Z/); + while (scalar(@lines) >= 1) { + $l = shift @lines; + my $name; + my $desc; + if ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + # c datatype is $1, but we don't care about it here. + $name = $2; + $desc = $3; + } elsif ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + $name = $1; + $desc = $2; + } else { + last; # we seem to have run out of table. + } + + $name =~ s/\A\*\*(.*?)\*\*/$1/; + $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; + #print STDERR "SYM: $sym NAME: $name DESC: $desc\n"; my $whitespacelen = length($name) + 8; my $whitespace = ' ' x $whitespacelen; $desc = wordwrap($desc, -$whitespacelen); my @desclines = split /\n/, $desc; my $firstline = shift @desclines; - $str .= "\\param $name $firstline\n"; + $str .= "$paramstr $name $firstline\n"; foreach (@desclines) { $str .= "${whitespace}$_\n"; } @@ -805,8 +1603,9 @@ sub usage { if (defined $returns) { $str .= "\n" if $addblank; $addblank = 1; my $r = dewikify($wikitype, $returns); + $r =~ s/\A\(.*?\)\s*//; # Chop datatype in parentheses off the front. my $retstr = "\\returns"; - if ($r =~ s/\AReturn(s?) //) { + if ($r =~ s/\AReturn(s?)\s+//) { $retstr = "\\return$1"; } @@ -821,6 +1620,21 @@ sub usage { } } + if (defined $threadsafety) { + # !!! FIXME: lots of code duplication in all of these. + $str .= "\n" if $addblank; $addblank = 1; + my $v = dewikify($wikitype, $threadsafety); + my $whitespacelen = length("\\threadsafety") + 1; + my $whitespace = ' ' x $whitespacelen; + $v = wordwrap($v, -$whitespacelen); + my @desclines = split /\n/, $v; + my $firstline = shift @desclines; + $str .= "\\threadsafety $firstline\n"; + foreach (@desclines) { + $str .= "${whitespace}$_\n"; + } + } + if (defined $version) { # !!! FIXME: lots of code duplication in all of these. $str .= "\n" if $addblank; $addblank = 1; @@ -842,17 +1656,20 @@ sub usage { my $v = dewikify($wikitype, $related); my @desclines = split /\n/, $v; foreach (@desclines) { - s/\A(\:|\* )//; s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func" s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain. + s/\[(.*?)\]\(.*?\)/$1/; # in case some wikilinks remain. s/\A\/*//; + s/\A\s*[\:\*\-]\s*//; + s/\A\s+//; + s/\s+\Z//; $str .= "\\sa $_\n"; } } - my $header = $headerfuncslocation{$fn}; + my $header = $headersymslocation{$sym}; my $contentsref = $headers{$header}; - my $chunk = $headerfuncschunk{$fn}; + my $chunk = $headersymschunk{$sym}; my @lines = split /\n/, $str; @@ -870,10 +1687,10 @@ sub usage { } $output .= " */"; - #print("$fn:\n$output\n\n"); + #print("$sym:\n[$output]\n\n"); $$contentsref[$chunk] = $output; - #$$contentsref[$chunk+1] = $headerdecls{$fn}; + #$$contentsref[$chunk+1] = $headerdecls{$sym}; $changed_headers{$header} = 1; } @@ -883,12 +1700,12 @@ sub usage { # this is kinda inefficient, but oh well. my @removelines = (); - foreach (keys %headerfuncslocation) { - my $fn = $_; - next if $headerfuncshasdoxygen{$fn}; - next if $headerfuncslocation{$fn} ne $header; + foreach (keys %headersymslocation) { + my $sym = $_; + next if $headersymshasdoxygen{$sym}; + next if $headersymslocation{$sym} ne $header; # the index of the blank line we put before the function declaration in case we needed to replace it with new content from the wiki. - push @removelines, $headerfuncschunk{$fn}; + push @removelines, $headersymschunk{$sym}; } my $contentsref = $headers{$header}; @@ -905,18 +1722,42 @@ sub usage { rename($path, "$incpath/$header") or die("Can't rename '$path' to '$incpath/$header': $!\n"); } + if (defined $readmepath) { + if ( -d $wikireadmepath ) { + mkdir($readmepath); # just in case + opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n"); + while (readdir(DH)) { + my $dent = $_; + if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here. + next if $1 eq 'FrontPage'; + filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n"); + } + } + closedir(DH); + } + } + } elsif ($copy_direction == -1) { # --copy-to-wiki - foreach (keys %headerfuncs) { - my $fn = $_; - next if not $headerfuncshasdoxygen{$fn}; - my $wikitype = defined $wikitypes{$fn} ? $wikitypes{$fn} : 'mediawiki'; # default to MediaWiki for new stuff FOR NOW. - die("Unexpected wikitype '$wikitype'\n") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage')); - #print("$fn\n"); next; + if (defined $changeformat) { + $dewikify_mode = $changeformat; + $wordwrap_mode = $changeformat; + } + + foreach (keys %headersyms) { + my $sym = $_; + next if not $headersymshasdoxygen{$sym}; + next if $sym =~ /\A\[category documentation\]/; # not real symbols, we handle this elsewhere. + my $symtype = $headersymstype{$sym}; + my $origwikitype = defined $wikitypes{$sym} ? $wikitypes{$sym} : 'md'; # default to MarkDown for new stuff. + my $wikitype = (defined $changeformat) ? $changeformat : $origwikitype; + die("Unexpected wikitype '$wikitype'") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage')); + + #print("$sym\n"); next; $wordwrap_mode = $wikitype; - my $raw = $headerfuncs{$fn}; # raw doxygen text with comment characters stripped from start/end and start of each line. + my $raw = $headersyms{$sym}; # raw doxygen text with comment characters stripped from start/end and start of each line. next if not defined $raw; $raw =~ s/\A\s*\\brief\s+//; # Technically we don't need \brief (please turn on JAVADOC_AUTOBRIEF if you use Doxygen), so just in case one is present, strip it. @@ -932,27 +1773,20 @@ sub usage { $brief .= "$l "; } + $brief =~ s/\s+\Z//; $brief =~ s/\A(.*?\.) /$1\n\n/; # \brief should only be one sentence, delimited by a period+space. Split if necessary. my @briefsplit = split /\n/, $brief; + + next if not defined $briefsplit[0]; # No brief text? Probably a bogus Doxygen comment, skip it. + $brief = wikify($wikitype, shift @briefsplit) . "\n"; @doxygenlines = (@briefsplit, @doxygenlines); my $remarks = ''; - # !!! FIXME: wordwrap and wikify might handle this, now. while (@doxygenlines) { last if $doxygenlines[0] =~ /\A\\/; # some sort of doxygen command, assume we're past the general remarks. my $l = shift @doxygenlines; - if ($l =~ /\A\`\`\`/) { # syntax highlighting, don't reformat. - $remarks .= "$l\n"; - while ((@doxygenlines) && (not $l =~ /\`\`\`\Z/)) { - $l = shift @doxygenlines; - $remarks .= "$l\n"; - } - } else { - $l =~ s/\A\s*//; - $l =~ s/\s*\Z//; - $remarks .= "$l\n"; - } + $remarks .= "$l\n"; } #print("REMARKS:\n\n $remarks\n\n"); @@ -961,29 +1795,31 @@ sub usage { $remarks =~ s/\A\s*//; $remarks =~ s/\s*\Z//; - my $decl = $headerdecls{$fn}; - #$decl =~ s/\*\s+SDLCALL/ *SDLCALL/; # Try to make "void * Function" become "void *Function" - #$decl =~ s/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL/$2$3/; + my $decl = $headerdecls{$sym}; my $syntax = ''; if ($wikitype eq 'mediawiki') { $syntax = "\n$decl\n"; } elsif ($wikitype eq 'md') { + $decl =~ s/\n+\Z//; $syntax = "```c\n$decl\n```\n"; - } else { die("Expected wikitype '$wikitype'\n"); } + } else { die("Expected wikitype '$wikitype'"); } my %sections = (); $sections{'[Brief]'} = $brief; # include this section even if blank so we get a title line. $sections{'Remarks'} = "$remarks\n" if $remarks ne ''; $sections{'Syntax'} = $syntax; - my @params = (); # have to parse these and build up the wiki tables after, since Markdown needs to know the length of the largest string. :/ + my %params = (); # have to parse these and build up the wiki tables after, since Markdown needs to know the length of the largest string. :/ + my @paramsorder = (); + my $fnsigparams = $headersymsparaminfo{$sym}; while (@doxygenlines) { my $l = shift @doxygenlines; - if ($l =~ /\A\\param\s+(.*?)\s+(.*)\Z/) { - my $arg = $1; - my $desc = $2; + # We allow param/field/value interchangeably, even if it doesn't make sense. The next --copy-to-headers will correct it anyhow. + if ($l =~ /\A\\(param|field|value)\s+(.*?)\s+(.*)\Z/) { + my $arg = $2; + my $desc = $3; while (@doxygenlines) { my $subline = $doxygenlines[0]; $subline =~ s/\A\s*//; @@ -998,10 +1834,24 @@ sub usage { $desc =~ s/[\s\n]+\Z//ms; + # Validate this param. + if (defined($params{$arg})) { + print STDERR "WARNING: Symbol '$sym' has multiple '\\param $arg' declarations! Only keeping the first one!\n"; + } elsif (defined $fnsigparams) { + my $found = 0; + for (my $i = 0; $i < scalar(@$fnsigparams); $i += 2) { + $found = 1, last if (@$fnsigparams[$i] eq $arg); + } + if (!$found) { + print STDERR "WARNING: Symbol '$sym' has a '\\param $arg' for a param that doesn't exist. It will be removed!\n"; + } + } + # We need to know the length of the longest string to make Markdown tables, so we just store these off until everything is parsed. - push @params, $arg; - push @params, $desc; + $params{$arg} = $desc; + push @paramsorder, $arg; } elsif ($l =~ /\A\\r(eturns?)\s+(.*)\Z/) { + # !!! FIXME: complain if this isn't a function or macro. my $retstr = "R$1"; # "Return" or "Returns" my $desc = $2; while (@doxygenlines) { @@ -1016,7 +1866,20 @@ sub usage { } } $desc =~ s/[\s\n]+\Z//ms; - $sections{'Return Value'} = wordwrap("$retstr " . wikify($wikitype, $desc)) . "\n"; + + # Make sure the \returns info is valid. + my $rettype = $headersymsrettype{$sym}; + die("Don't have a rettype for '$sym' for some reason!") if (($symtype == 1) && (not defined($rettype))); + if (defined($sections{'Return Value'})) { + print STDERR "WARNING: Symbol '$sym' has multiple '\\return' declarations! Only keeping the first one!\n"; + } elsif (($symtype != 1) && ($symtype != 2) && ($symtype != 5)) { # !!! FIXME: if 5, make sure it's a function pointer typedef! + print STDERR "WARNING: Symbol '$sym' has a '\\return' declaration but isn't a function or macro! Removing it!\n"; + } elsif (($symtype == 1) && ($headersymsrettype{$sym} eq 'void')) { + print STDERR "WARNING: Function '$sym' has a '\\returns' declaration but function returns void! Removing it!\n"; + } else { + my $rettypestr = defined($rettype) ? ('(' . wikify($wikitype, $rettype) . ') ') : ''; + $sections{'Return Value'} = wordwrap("$rettypestr$retstr ". wikify($wikitype, $desc)) . "\n"; + } } elsif ($l =~ /\A\\deprecated\s+(.*)\Z/) { my $desc = $1; while (@doxygenlines) { @@ -1047,42 +1910,122 @@ sub usage { } $desc =~ s/[\s\n]+\Z//ms; $sections{'Version'} = wordwrap(wikify($wikitype, $desc)) . "\n"; + } elsif ($l =~ /\A\\threadsafety\s+(.*)\Z/) { + my $desc = $1; + while (@doxygenlines) { + my $subline = $doxygenlines[0]; + $subline =~ s/\A\s*//; + last if $subline =~ /\A\\/; # some sort of doxygen command, assume we're past this thing. + shift @doxygenlines; # dump this line from the array; we're using it. + if ($subline eq '') { # empty line, make sure it keeps the newline char. + $desc .= "\n"; + } else { + $desc .= " $subline"; + } + } + $desc =~ s/[\s\n]+\Z//ms; + $sections{'Thread Safety'} = wordwrap(wikify($wikitype, $desc)) . "\n"; } elsif ($l =~ /\A\\sa\s+(.*)\Z/) { my $sa = $1; $sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func" - $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'}; + $sections{'See Also'} = '' if not defined $sections{'See Also'}; if ($wikitype eq 'mediawiki') { - $sections{'Related Functions'} .= ":[[$sa]]\n"; + $sections{'See Also'} .= ":[[$sa]]\n"; } elsif ($wikitype eq 'md') { - $sections{'Related Functions'} .= "* [$sa]($sa)\n"; - } else { die("Expected wikitype '$wikitype'\n"); } + $sections{'See Also'} .= "- [$sa]($sa)\n"; + } else { die("Expected wikitype '$wikitype'"); } } } + # Make sure %params is in the same order as the actual function signature and add C datatypes... + my $params_has_c_datatype = 0; + my @final_params = (); + if (($symtype == 1) && (defined($headersymsparaminfo{$sym}))) { # is a function and we have param info for it... + my $fnsigparams = $headersymsparaminfo{$sym}; + for (my $i = 0; $i < scalar(@$fnsigparams); $i += 2) { + my $paramname = @$fnsigparams[$i]; + my $paramdesc = $params{$paramname}; + if (defined($paramdesc)) { + push @final_params, $paramname; # name + push @final_params, @$fnsigparams[$i+1]; # C datatype + push @final_params, $paramdesc; # description + $params_has_c_datatype = 1 if (defined(@$fnsigparams[$i+1])); + } else { + print STDERR "WARNING: Symbol '$sym' is missing a '\\param $paramname' declaration!\n"; + } + } + } else { + foreach (@paramsorder) { + my $paramname = $_; + my $paramdesc = $params{$paramname}; + if (defined($paramdesc)) { + push @final_params, $_; + push @final_params, undef; + push @final_params, $paramdesc; + } + } + } + + my $hfiletext = $wikiheaderfiletext; + $hfiletext =~ s/\%fname\%/$headersymslocation{$sym}/g; + $sections{'Header File'} = "$hfiletext\n"; + # Make sure this ends with a double-newline. - $sections{'Related Functions'} .= "\n" if defined $sections{'Related Functions'}; + $sections{'See Also'} .= "\n" if defined $sections{'See Also'}; + + if (0) { # !!! FIXME: this was a useful hack, but this needs to be generalized if we're going to do this always. + # Plug in a \since section if one wasn't listed. + if (not defined $sections{'Version'}) { + my $symtypename; + if ($symtype == 1) { + $symtypename = 'function'; + } elsif ($symtype == 2) { + $symtypename = 'macro'; + } elsif ($symtype == 3) { + $symtypename = 'struct'; + } elsif ($symtype == 4) { + $symtypename = 'enum'; + } elsif ($symtype == 5) { + $symtypename = 'datatype'; + } else { + die("Unexpected symbol type $symtype!"); + } + my $str = "This $symtypename is available since SDL 3.0.0."; + $sections{'Version'} = wordwrap(wikify($wikitype, $str)) . "\n"; + } + } # We can build the wiki table now that we have all the data. - if (scalar(@params) > 0) { + if (scalar(@final_params) > 0) { my $str = ''; if ($wikitype eq 'mediawiki') { - while (scalar(@params) > 0) { - my $arg = shift @params; - my $desc = wikify($wikitype, shift @params); + while (scalar(@final_params) > 0) { + my $arg = shift @final_params; + my $c_datatype = shift @final_params; + my $desc = wikify($wikitype, shift @final_params); + $c_datatype = '' if not defined $c_datatype; $str .= ($str eq '') ? "{|\n" : "|-\n"; + $str .= "|$c_datatype\n" if $params_has_c_datatype; $str .= "|'''$arg'''\n"; $str .= "|$desc\n"; } $str .= "|}\n"; } elsif ($wikitype eq 'md') { my $longest_arg = 0; + my $longest_c_datatype = 0; my $longest_desc = 0; my $which = 0; - foreach (@params) { + foreach (@final_params) { if ($which == 0) { - my $len = length($_) + 4; + my $len = length($_); $longest_arg = $len if ($len > $longest_arg); $which = 1; + } elsif ($which == 1) { + if (defined($_)) { + my $len = length(wikify($wikitype, $_)); + $longest_c_datatype = $len if ($len > $longest_c_datatype); + } + $which = 2; } else { my $len = length(wikify($wikitype, $_)); $longest_desc = $len if ($len > $longest_desc); @@ -1091,24 +2034,33 @@ sub usage { } # Markdown tables are sort of obnoxious. - $str .= '| ' . (' ' x ($longest_arg+4)) . ' | ' . (' ' x $longest_desc) . " |\n"; - $str .= '| ' . ('-' x ($longest_arg+4)) . ' | ' . ('-' x $longest_desc) . " |\n"; - - while (@params) { - my $arg = shift @params; - my $desc = wikify($wikitype, shift @params); - $str .= "| **$arg** " . (' ' x ($longest_arg - length($arg))) . "| $desc" . (' ' x ($longest_desc - length($desc))) . " |\n"; + my $c_datatype_cell; + $c_datatype_cell = ($longest_c_datatype > 0) ? ('| ' . (' ' x ($longest_c_datatype)) . ' ') : ''; + $str .= $c_datatype_cell . '| ' . (' ' x ($longest_arg+4)) . ' | ' . (' ' x $longest_desc) . " |\n"; + $c_datatype_cell = ($longest_c_datatype > 0) ? ('| ' . ('-' x ($longest_c_datatype)) . ' ') : ''; + $str .= $c_datatype_cell . '| ' . ('-' x ($longest_arg+4)) . ' | ' . ('-' x $longest_desc) . " |\n"; + + while (@final_params) { + my $arg = shift @final_params; + my $c_datatype = shift @final_params; + $c_datatype_cell = ''; + if ($params_has_c_datatype) { + $c_datatype = defined($c_datatype) ? wikify($wikitype, $c_datatype) : ''; + $c_datatype_cell = ($longest_c_datatype > 0) ? ("| $c_datatype " . (' ' x ($longest_c_datatype - length($c_datatype)))) : ''; + } + my $desc = wikify($wikitype, shift @final_params); + $str .= $c_datatype_cell . "| **$arg** " . (' ' x ($longest_arg - length($arg))) . "| $desc" . (' ' x ($longest_desc - length($desc))) . " |\n"; } } else { - die("Unexpected wikitype!\n"); # should have checked this elsewhere. + die("Unexpected wikitype!"); # should have checked this elsewhere. } $sections{'Function Parameters'} = $str; } - my $path = "$wikipath/$_.${wikitype}.tmp"; + my $path = "$wikipath/$sym.${wikitype}.tmp"; open(FH, '>', $path) or die("Can't open '$path': $!\n"); - my $sectionsref = $wikifuncs{$fn}; + my $sectionsref = $wikisyms{$sym}; foreach (@standard_wiki_sections) { # drop sections we either replaced or removed from the original wiki's contents. @@ -1117,7 +2069,7 @@ sub usage { } } - my $wikisectionorderref = $wikisectionorder{$fn}; + my $wikisectionorderref = $wikisectionorder{$sym}; # Make sure there's a footer in the wiki that puts this function in CategoryAPI... if (not $$sectionsref{'[footer]'}) { @@ -1125,23 +2077,62 @@ sub usage { push @$wikisectionorderref, '[footer]'; } - # !!! FIXME: This won't be CategoryAPI if we eventually handle things other than functions. - my $footer = $$sectionsref{'[footer]'}; - if ($wikitype eq 'mediawiki') { - $footer =~ s/\[\[CategoryAPI\]\],?\s*//g; - $footer = '[[CategoryAPI]]' . (($footer eq '') ? "\n" : ", $footer"); - } elsif ($wikitype eq 'md') { - $footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g; - $footer = '[CategoryAPI](CategoryAPI)' . (($footer eq '') ? '' : ', ') . $footer; - } else { die("Unexpected wikitype '$wikitype'\n"); } - $$sectionsref{'[footer]'} = $footer; + # If changing format, convert things that otherwise are passed through unmolested. + if (defined $changeformat) { + if (($dewikify_mode eq 'md') and ($origwikitype eq 'mediawiki')) { + $$sectionsref{'[footer]'} =~ s/\[\[(Category[a-zA-Z0-9_]+)\]\]/[$1]($1)/g; + } elsif (($dewikify_mode eq 'mediawiki') and ($origwikitype eq 'md')) { + $$sectionsref{'[footer]'} =~ s/\[(Category[a-zA-Z0-9_]+)\]\(.*?\)/[[$1]]/g; + } - if (defined $wikipreamble) { + foreach (keys %only_wiki_sections) { + my $sect = $_; + if (defined $$sectionsref{$sect}) { + $$sectionsref{$sect} = wikify($wikitype, dewikify($origwikitype, $$sectionsref{$sect})); + } + } + } + + if ($symtype != -1) { # Don't do these in category documentation block + my $footer = $$sectionsref{'[footer]'}; + + my $symtypename; + if ($symtype == 1) { + $symtypename = 'Function'; + } elsif ($symtype == 2) { + $symtypename = 'Macro'; + } elsif ($symtype == 3) { + $symtypename = 'Struct'; + } elsif ($symtype == 4) { + $symtypename = 'Enum'; + } elsif ($symtype == 5) { + $symtypename = 'Datatype'; + } else { + die("Unexpected symbol type $symtype!"); + } + + my $symcategory = $headersymscategory{$sym}; if ($wikitype eq 'mediawiki') { - print FH "====== $wikipreamble ======\n"; + $footer =~ s/\[\[CategoryAPI\]\],?\s*//g; + $footer =~ s/\[\[CategoryAPI${symtypename}\]\],?\s*//g; + $footer =~ s/\[\[Category${symcategory}\]\],?\s*//g if defined $symcategory; + $footer = "[[CategoryAPI]], [[CategoryAPI$symtypename]]" . (defined $symcategory ? ", [[Category$symcategory]]" : '') . (($footer eq '') ? "\n" : ", $footer"); } elsif ($wikitype eq 'md') { - print FH "###### $wikipreamble\n"; - } else { die("Unexpected wikitype '$wikitype'\n"); } + $footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g; + $footer =~ s/\[CategoryAPI${symtypename}\]\(CategoryAPI${symtypename}\),?\s*//g; + $footer =~ s/\[Category${symcategory}\]\(Category${symcategory}\),?\s*//g if defined $symcategory; + $footer = "[CategoryAPI](CategoryAPI), [CategoryAPI$symtypename](CategoryAPI$symtypename)" . (defined $symcategory ? ", [Category$symcategory](Category$symcategory)" : '') . (($footer eq '') ? '' : ', ') . $footer; + } else { die("Unexpected wikitype '$wikitype'"); } + $$sectionsref{'[footer]'} = $footer; + + if (defined $wikipreamble) { + my $wikified_preamble = wikify($wikitype, $wikipreamble); + if ($wikitype eq 'mediawiki') { + print FH "====== $wikified_preamble ======\n"; + } elsif ($wikitype eq 'md') { + print FH "###### $wikified_preamble\n"; + } else { die("Unexpected wikitype '$wikitype'"); } + } } my $prevsectstr = ''; @@ -1151,6 +2142,7 @@ sub usage { next if $sect eq '[start]'; next if (not defined $sections{$sect} and not defined $$sectionsref{$sect}); my $section = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect}; + if ($sect eq '[footer]') { # Make sure previous section ends with two newlines. if (substr($prevsectstr, -1) ne "\n") { @@ -1161,16 +2153,32 @@ sub usage { print FH "----\n"; # It's the same in Markdown and MediaWiki. } elsif ($sect eq '[Brief]') { if ($wikitype eq 'mediawiki') { - print FH "= $fn =\n\n"; + print FH "= $sym =\n\n"; } elsif ($wikitype eq 'md') { - print FH "# $fn\n\n"; - } else { die("Unexpected wikitype '$wikitype'\n"); } + print FH "# $sym\n\n"; + } else { die("Unexpected wikitype '$wikitype'"); } } else { - if ($wikitype eq 'mediawiki') { - print FH "\n== $sect ==\n\n"; - } elsif ($wikitype eq 'md') { - print FH "\n## $sect\n\n"; - } else { die("Unexpected wikitype '$wikitype'\n"); } + my $sectname = $sect; + if ($sectname eq 'Function Parameters') { # We use this same table for different things depending on what we're documenting, so rename it now. + if (($symtype == 1) || ($symtype == 5)) { # function (or typedef, in case it's a function pointer type). + } elsif ($symtype == 2) { # macro + $sectname = 'Macro Parameters'; + } elsif ($symtype == 3) { # struct/union + $sectname = 'Fields'; + } elsif ($symtype == 4) { # enum + $sectname = 'Values'; + } else { + die("Unexpected symtype $symtype"); + } + } + + if ($symtype != -1) { # Not for category documentation block + if ($wikitype eq 'mediawiki') { + print FH "\n== $sectname ==\n\n"; + } elsif ($wikitype eq 'md') { + print FH "\n## $sectname\n\n"; + } else { die("Unexpected wikitype '$wikitype'"); } + } } my $sectstr = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect}; @@ -1185,16 +2193,143 @@ sub usage { print FH "\n\n"; close(FH); + + if (defined $changeformat and ($origwikitype ne $wikitype)) { + system("cd '$wikipath' ; git mv '$_.${origwikitype}' '$_.${wikitype}'"); + unlink("$wikipath/$_.${origwikitype}"); + } + rename($path, "$wikipath/$_.${wikitype}") or die("Can't rename '$path' to '$wikipath/$_.${wikitype}': $!\n"); } + # Write out simple redirector pages if they don't already exist. + foreach (keys %referenceonly) { + my $sym = $_; + my $refersto = $referenceonly{$sym}; + my $path = "$wikipath/$sym.md"; # we only do Markdown for these. + next if (-f $path); # don't overwrite if it already exists. Delete the file if you need a rebuild! + open(FH, '>', $path) or die("Can't open '$path': $!\n"); + + if (defined $wikipreamble) { + my $wikified_preamble = wikify('md', $wikipreamble); + print FH "###### $wikified_preamble\n"; + } + + print FH "# $sym\n\nPlease refer to [$refersto]($refersto) for details.\n\n"; + print FH "----\n"; + print FH "[CategoryAPI](CategoryAPI), [CategoryAPIMacro](CategoryAPIMacro)\n\n"; + + close(FH); + } + + # Write out Category pages... + foreach (keys %headercategorydocs) { + my $cat = $_; + my $sym = $headercategorydocs{$cat}; # fake symbol + my $raw = $headersyms{$sym}; # raw doxygen text with comment characters stripped from start/end and start of each line. + my $wikitype = defined($wikitypes{$sym}) ? $wikitypes{$sym} : 'md'; + my $path = "$wikipath/Category$cat.$wikitype"; + + $raw = wordwrap(wikify($wikitype, $raw)); + + my $tmppath = "$path.tmp"; + open(FH, '>', $tmppath) or die("Can't open '$tmppath': $!\n"); + print FH "$raw\n\n"; + + if (! -f $path) { # Doesn't exist at all? Write out a template file. + # If writing from scratch, it's always a Markdown file. + die("Unexpected wikitype '$wikitype'!") if $wikitype ne 'md'; + print FH <<__EOF__ + + + +## Functions + + + + + +## Datatypes + + + + + +## Structs + + + + + +## Enums + + + + + +## Macros + + + + + +---- +[CategoryAPICategory](CategoryAPICategory) + +__EOF__ +; + } else { + my $endstr = $wikisyms{$sym}->{'[footer]'}; + if (defined($endstr)) { + print FH $endstr; + } + } + + close(FH); + rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n"); + } + + # Write out READMEs... + if (defined $readmepath) { + if ( -d $readmepath ) { + mkdir($wikireadmepath); # just in case + opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n"); + while (my $d = readdir(DH)) { + my $dent = $d; + if ($dent =~ /\AREADME\-(.*?\.md)\Z/) { # we only bridge Markdown files here. + my $wikifname = $1; + next if $wikifname eq 'FrontPage.md'; + filecopy("$readmepath/$dent", "$wikireadmepath/$wikifname", "\n"); + } + } + closedir(DH); + + my @pages = (); + opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n"); + while (my $d = readdir(DH)) { + my $dent = $d; + if ($dent =~ /\A(.*?)\.(mediawiki|md)\Z/) { + my $wikiname = $1; + next if $wikiname eq 'FrontPage'; + push @pages, $wikiname; + } + } + closedir(DH); + + open(FH, '>', "$wikireadmepath/FrontPage.md") or die("Can't open '$wikireadmepath/FrontPage.md': $!\n"); + print FH "# All READMEs available here\n\n"; + foreach (sort @pages) { + my $wikiname = $_; + print FH "- [$wikiname]($wikiname)\n"; + } + close(FH); + } + } + } elsif ($copy_direction == -2) { # --copy-to-manpages # This only takes from the wiki data, since it has sections we omit from the headers, like code examples. - my $manpath = "$srcpath/man"; - mkdir($manpath); - $manpath .= "/man3"; - mkdir($manpath); + File::Path::make_path("$manpath/man3"); $dewikify_mode = 'manpage'; $wordwrap_mode = 'manpage'; @@ -1209,41 +2344,62 @@ sub usage { close(FH); } - my $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`; - chomp($gitrev); + if (!$gitrev) { + $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`; + chomp($gitrev); + } # !!! FIXME open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n"); my $majorver = 0; my $minorver = 0; - my $patchver = 0; + my $microver = 0; while () { chomp; if (/$versionmajorregex/) { $majorver = int($1); } elsif (/$versionminorregex/) { $minorver = int($1); - } elsif (/$versionpatchregex/) { - $patchver = int($1); + } elsif (/$versionmicroregex/) { + $microver = int($1); } } close(FH); - my $fullversion = "$majorver.$minorver.$patchver"; - - foreach (keys %headerfuncs) { - my $fn = $_; - next if not defined $wikifuncs{$fn}; # don't have a page for that function, skip it. - my $wikitype = $wikitypes{$fn}; - my $sectionsref = $wikifuncs{$fn}; - my $remarks = %$sectionsref{'Remarks'}; - my $params = %$sectionsref{'Function Parameters'}; - my $returns = %$sectionsref{'Return Value'}; - my $version = %$sectionsref{'Version'}; - my $related = %$sectionsref{'Related Functions'}; - my $examples = %$sectionsref{'Code Examples'}; - my $deprecated = %$sectionsref{'Deprecated'}; - my $brief = %$sectionsref{'[Brief]'}; - my $decl = $headerdecls{$fn}; + my $fullversion = "$majorver.$minorver.$microver"; + + foreach (keys %headersyms) { + my $sym = $_; + next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it. + next if $sym =~ /\A\[category documentation\]/; # not real symbols + my $symtype = $headersymstype{$sym}; + my $wikitype = $wikitypes{$sym}; + my $sectionsref = $wikisyms{$sym}; + my $remarks = $sectionsref->{'Remarks'}; + my $params = $sectionsref->{'Function Parameters'}; + my $returns = $sectionsref->{'Return Value'}; + my $version = $sectionsref->{'Version'}; + my $threadsafety = $sectionsref->{'Thread Safety'}; + my $related = $sectionsref->{'See Also'}; + my $examples = $sectionsref->{'Code Examples'}; + my $deprecated = $sectionsref->{'Deprecated'}; + my $headerfile = $manpageheaderfiletext; + $headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g; + $headerfile .= "\n"; + + my $mansection; + my $mansectionname; + if (($symtype == 1) || ($symtype == 2)) { # functions or macros + $mansection = '3'; + $mansectionname = 'FUNCTIONS'; + } elsif (($symtype >= 3) && ($symtype <= 5)) { # struct/union/enum/typedef + $mansection = '3type'; + $mansectionname = 'DATATYPES'; + } else { + die("Unexpected symtype $symtype"); + } + + my $brief = $sectionsref->{'[Brief]'}; + my $decl = $headerdecls{$sym}; my $str = ''; $brief = "$brief"; @@ -1263,14 +2419,14 @@ sub usage { $str .= ".\\\" This manpage content is licensed under Creative Commons\n"; $str .= ".\\\" Attribution 4.0 International (CC BY 4.0)\n"; $str .= ".\\\" https://creativecommons.org/licenses/by/4.0/\n"; - $str .= ".\\\" This manpage was generated from ${projectshortname}'s wiki page for $fn:\n"; - $str .= ".\\\" $wikiurl/$fn\n"; + $str .= ".\\\" This manpage was generated from ${projectshortname}'s wiki page for $sym:\n"; + $str .= ".\\\" $wikiurl/$sym\n"; $str .= ".\\\" Generated with SDL/build-scripts/wikiheaders.pl\n"; $str .= ".\\\" revision $gitrev\n" if $gitrev ne ''; $str .= ".\\\" Please report issues in this manpage's content at:\n"; $str .= ".\\\" $bugreporturl\n"; $str .= ".\\\" Please report issues in the generation of this manpage from the wiki at:\n"; - $str .= ".\\\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$fn\n"; + $str .= ".\\\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$sym\n"; $str .= ".\\\" $projectshortname can be found at $projecturl\n"; # Define a .URL macro. The "www.tmac" thing decides if we're using GNU roff (which has a .URL macro already), and if so, overrides the macro we just created. @@ -1280,13 +2436,23 @@ sub usage { $str .= "..\n"; $str .= '.if \n[.g] .mso www.tmac' . "\n"; - $str .= ".TH $fn 3 \"$projectshortname $fullversion\" \"$projectfullname\" \"$projectshortname$majorver FUNCTIONS\"\n"; + $str .= ".TH $sym $mansection \"$projectshortname $fullversion\" \"$projectfullname\" \"$projectshortname$majorver $mansectionname\"\n"; $str .= ".SH NAME\n"; - $str .= "$fn"; + $str .= "$sym"; $str .= " \\- $brief" if (defined $brief); $str .= "\n"; + if (defined $deprecated) { + $str .= ".SH DEPRECATED\n"; + $str .= dewikify($wikitype, $deprecated) . "\n"; + } + + if (defined $headerfile) { + $str .= ".SH HEADER FILE\n"; + $str .= dewikify($wikitype, $headerfile) . "\n"; + } + $str .= ".SH SYNOPSIS\n"; $str .= ".nf\n"; $str .= ".B #include \\(dq$mainincludefname\\(dq\n"; @@ -1303,27 +2469,73 @@ sub usage { $str .= $remarks . "\n"; } - if (defined $deprecated) { - $str .= ".SH DEPRECATED\n"; - $str .= dewikify($wikitype, $deprecated) . "\n"; - } - if (defined $params) { - $str .= ".SH FUNCTION PARAMETERS\n"; + if (($symtype == 1) || ($symtype == 5)) { + $str .= ".SH FUNCTION PARAMETERS\n"; + } elsif ($symtype == 2) { # macro + $str .= ".SH MACRO PARAMETERS\n"; + } elsif ($symtype == 3) { # struct/union + $str .= ".SH FIELDS\n"; + } elsif ($symtype == 4) { # enum + $str .= ".SH VALUES\n"; + } else { + die("Unexpected symtype $symtype"); + } + my @lines = split /\n/, $params; if ($wikitype eq 'mediawiki') { die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|'); # Dump the '{|' start while (scalar(@lines) >= 3) { + my $c_datatype = shift @lines; my $name = shift @lines; my $desc = shift @lines; - my $terminator = shift @lines; # the '|-' or '|}' line. + my $terminator; # the '|-' or '|}' line. + + if (($desc eq '|-') or ($desc eq '|}') or (not $desc =~ /\A\|/)) { # we seem to be out of cells, which means there was no datatype column on this one. + $terminator = $desc; + $desc = $name; + $name = $c_datatype; + $c_datatype = ''; + } else { + $terminator = shift @lines; + } + last if ($terminator ne '|-') and ($terminator ne '|}'); # we seem to have run out of table. $name =~ s/\A\|\s*//; $name =~ s/\A\*\*(.*?)\*\*/$1/; $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; $desc =~ s/\A\|\s*//; $desc = dewikify($wikitype, $desc); - #print STDERR "FN: $fn NAME: $name DESC: $desc TERM: $terminator\n"; + #print STDERR "SYM: $sym CDATATYPE: $c_datatype NAME: $name DESC: $desc TERM: $terminator\n"; + + $str .= ".TP\n"; + $str .= ".I $name\n"; + $str .= "$desc\n"; + } + } elsif ($wikitype eq 'md') { + my $l; + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A(\s*\|)?\s*\|\s*\|\s*\|\s*\Z/); + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*(\|\s*\-*\s*)?\|\s*\-*\s*\|\s*\-*\s*\|\s*\Z/); + while (scalar(@lines) >= 1) { + $l = shift @lines; + my $name; + my $desc; + if ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + # c datatype is $1, but we don't care about it here. + $name = $2; + $desc = $3; + } elsif ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + $name = $1; + $desc = $2; + } else { + last; # we seem to have run out of table. + } + + $name =~ s/\A\*\*(.*?)\*\*/$1/; + $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; + $desc = dewikify($wikitype, $desc); $str .= ".TP\n"; $str .= ".I $name\n"; @@ -1335,8 +2547,10 @@ sub usage { } if (defined $returns) { + $returns = dewikify($wikitype, $returns); + $returns =~ s/\A\(.*?\)\s*//; # Chop datatype in parentheses off the front. $str .= ".SH RETURN VALUE\n"; - $str .= dewikify($wikitype, $returns) . "\n"; + $str .= "$returns\n"; } if (defined $examples) { @@ -1346,6 +2560,11 @@ sub usage { $dewikify_manpage_code_indent = 1; } + if (defined $threadsafety) { + $str .= ".SH THREAD SAFETY\n"; + $str .= dewikify($wikitype, $threadsafety) . "\n"; + } + if (defined $version) { $str .= ".SH AVAILABILITY\n"; $str .= dewikify($wikitype, $version) . "\n"; @@ -1358,15 +2577,23 @@ sub usage { my @desclines = split /\n/, $v; my $nextstr = ''; foreach (@desclines) { - s/\A(\:|\* )//; s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func" s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain. + s/\[(.*?)\]\(.*?\)/$1/; # in case some wikilinks remain. + s/\A\*\s*\Z//; s/\A\/*//; s/\A\.BR\s+//; # dewikify added this, but we want to handle it. + s/\A\.I\s+//; # dewikify added this, but we want to handle it. + s/\A\s*[\:\*\-]\s*//; s/\A\s+//; s/\s+\Z//; next if $_ eq ''; - $str .= "$nextstr.BR $_ (3)"; + my $seealso_symtype = $headersymstype{$_}; + my $seealso_mansection = '3'; + if (defined($seealso_symtype) && ($seealso_symtype >= 3) && ($seealso_symtype <= 5)) { # struct/union/enum/typedef + $seealso_mansection = '3type'; + } + $str .= "$nextstr.BR $_ ($seealso_mansection)"; $nextstr = ",\n"; } $str .= "\n"; @@ -1380,7 +2607,7 @@ sub usage { $str .= ".UE\n"; $str .= ".PP\n"; $str .= "This manpage was generated from\n"; - $str .= ".UR $wikiurl/$fn\n"; + $str .= ".UR $wikiurl/$sym\n"; $str .= "${projectshortname}'s wiki\n"; $str .= ".UE\n"; $str .= "using SDL/build-scripts/wikiheaders.pl"; @@ -1392,11 +2619,349 @@ sub usage { $str .= ".UE\n"; } - my $path = "$manpath/$_.3.tmp"; - open(FH, '>', $path) or die("Can't open '$path': $!\n"); + my $path = "$manpath/man3/$_.$mansection"; + my $tmppath = "$path.tmp"; + open(FH, '>', $tmppath) or die("Can't open '$tmppath': $!\n"); print FH $str; close(FH); - rename($path, "$manpath/$_.3") or die("Can't rename '$path' to '$manpath/$_.3': $!\n"); + rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n"); + } + +} elsif ($copy_direction == -4) { # --copy-to-latex + # This only takes from the wiki data, since it has sections we omit from the headers, like code examples. + + print STDERR "\n(The --copy-to-latex code is known to not be ready for serious use; send patches, not bug reports, please.)\n\n"; + + $dewikify_mode = 'LaTeX'; + $wordwrap_mode = 'LaTeX'; + + # !!! FIXME: code duplication with --copy-to-manpages section. + + my $introtxt = ''; + if (0) { + open(FH, '<', "$srcpath/LICENSE.txt") or die("Can't open '$srcpath/LICENSE.txt': $!\n"); + while () { + chomp; + $introtxt .= ".\\\" $_\n"; + } + close(FH); + } + + if (!$gitrev) { + $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`; + chomp($gitrev); + } + + # !!! FIXME + open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n"); + my $majorver = 0; + my $minorver = 0; + my $microver = 0; + while () { + chomp; + if (/$versionmajorregex/) { + $majorver = int($1); + } elsif (/$versionminorregex/) { + $minorver = int($1); + } elsif (/$versionmicroregex/) { + $microver = int($1); + } + } + close(FH); + my $fullversion = "$majorver.$minorver.$microver"; + + my $latex_fname = "$srcpath/$projectshortname.tex"; + my $latex_tmpfname = "$latex_fname.tmp"; + open(TEXFH, '>', "$latex_tmpfname") or die("Can't open '$latex_tmpfname' for writing: $!\n"); + + print TEXFH <<__EOF__ +\\documentclass{book} + +\\usepackage{listings} +\\usepackage{color} +\\usepackage{hyperref} + +\\definecolor{dkgreen}{rgb}{0,0.6,0} +\\definecolor{gray}{rgb}{0.5,0.5,0.5} +\\definecolor{mauve}{rgb}{0.58,0,0.82} + +\\setcounter{secnumdepth}{0} + +\\lstset{frame=tb, + language=C, + aboveskip=3mm, + belowskip=3mm, + showstringspaces=false, + columns=flexible, + basicstyle={\\small\\ttfamily}, + numbers=none, + numberstyle=\\tiny\\color{gray}, + keywordstyle=\\color{blue}, + commentstyle=\\color{dkgreen}, + stringstyle=\\color{mauve}, + breaklines=true, + breakatwhitespace=true, + tabsize=3 +} + +\\begin{document} +\\frontmatter + +\\title{$projectfullname $majorver.$minorver.$microver Reference Manual} +\\author{The $projectshortname Developers} +\\maketitle + +\\mainmatter + +__EOF__ +; + + # !!! FIXME: Maybe put this in the book intro? print TEXFH $introtxt; + + # Sort symbols by symbol type, then alphabetically. + my @headersymskeys = sort { + my $symtypea = $headersymstype{$a}; + my $symtypeb = $headersymstype{$b}; + $symtypea = 3 if ($symtypea > 3); + $symtypeb = 3 if ($symtypeb > 3); + my $rc = $symtypea <=> $symtypeb; + if ($rc == 0) { + $rc = lc($a) cmp lc($b); + } + return $rc; + } keys %headersyms; + + my $current_symtype = 0; + my $current_chapter = ''; + + foreach (@headersymskeys) { + my $sym = $_; + next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it. + next if $sym =~ /\A\[category documentation\]/; # not real symbols. + my $symtype = $headersymstype{$sym}; + my $wikitype = $wikitypes{$sym}; + my $sectionsref = $wikisyms{$sym}; + my $remarks = $sectionsref->{'Remarks'}; + my $params = $sectionsref->{'Function Parameters'}; + my $returns = $sectionsref->{'Return Value'}; + my $version = $sectionsref->{'Version'}; + my $threadsafety = $sectionsref->{'Thread Safety'}; + my $related = $sectionsref->{'See Also'}; + my $examples = $sectionsref->{'Code Examples'}; + my $deprecated = $sectionsref->{'Deprecated'}; + my $headerfile = $manpageheaderfiletext; + $headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g; + $headerfile .= "\n"; + + my $brief = $sectionsref->{'[Brief]'}; + my $decl = $headerdecls{$sym}; + my $str = ''; + + if ($current_symtype != $symtype) { + my $newchapter = ''; + if ($symtype == 1) { + $newchapter = 'Functions'; + } elsif ($symtype == 2) { + $newchapter = 'Macros'; + } else { + $newchapter = 'Datatypes'; + } + + if ($current_chapter ne $newchapter) { + $str .= "\n\n\\chapter{$projectshortname $newchapter}\n\n\\clearpage\n\n"; + $current_chapter = $newchapter; + } + $current_symtype = $symtype; + } + + $brief = "$brief"; + $brief =~ s/\A[\s\n]*\= .*? \=\s*?\n+//ms; + $brief =~ s/\A[\s\n]*\=\= .*? \=\=\s*?\n+//ms; + $brief =~ s/\A(.*?\.) /$1\n/; # \brief should only be one sentence, delimited by a period+space. Split if necessary. + my @briefsplit = split /\n/, $brief; + $brief = shift @briefsplit; + $brief = dewikify($wikitype, $brief); + + if (defined $remarks) { + $remarks = dewikify($wikitype, join("\n", @briefsplit) . $remarks); + } + + my $escapedsym = escLaTeX($sym); + $str .= "\\hypertarget{$sym}{%\n\\section{$escapedsym}\\label{$sym}}\n\n"; + $str .= $brief if (defined $brief); + $str .= "\n\n"; + + if (defined $deprecated) { + $str .= "\\subsection{Deprecated}\n\n"; + $str .= dewikify($wikitype, $deprecated) . "\n"; + } + + if (defined $headerfile) { + $str .= "\\subsection{Header File}\n\n"; + $str .= dewikify($wikitype, $headerfile) . "\n"; + } + + $str .= "\\subsection{Syntax}\n\n"; + $str .= "\\begin{lstlisting}\n$decl\n\\end{lstlisting}\n"; + + if (defined $params) { + if (($symtype == 1) || ($symtype == 5)) { + $str .= "\\subsection{Function Parameters}\n\n"; + } elsif ($symtype == 2) { # macro + $str .= "\\subsection{Macro Parameters}\n\n"; + } elsif ($symtype == 3) { # struct/union + $str .= "\\subsection{Fields}\n\n"; + } elsif ($symtype == 4) { # enum + $str .= "\\subsection{Values}\n\n"; + } else { + die("Unexpected symtype $symtype"); + } + + $str .= "\\begin{center}\n"; + $str .= " \\begin{tabular}{ | l | p{0.75\\textwidth} |}\n"; + $str .= " \\hline\n"; + + # !!! FIXME: this table parsing has gotten complicated and is pasted three times in this file; move it to a subroutine! + my @lines = split /\n/, $params; + if ($wikitype eq 'mediawiki') { + die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|'); # Dump the '{|' start + while (scalar(@lines) >= 3) { + my $name = shift @lines; + my $desc = shift @lines; + my $terminator = shift @lines; # the '|-' or '|}' line. + last if ($terminator ne '|-') and ($terminator ne '|}'); # we seem to have run out of table. + $name =~ s/\A\|\s*//; + $name =~ s/\A\*\*(.*?)\*\*/$1/; + $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; + $name = escLaTeX($name); + $desc =~ s/\A\|\s*//; + $desc = dewikify($wikitype, $desc); + #print STDERR "FN: $sym NAME: $name DESC: $desc TERM: $terminator\n"; + $str .= " \\textbf{$name} & $desc \\\\ \\hline\n"; + } + } elsif ($wikitype eq 'md') { + my $l; + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A(\s*\|)?\s*\|\s*\|\s*\|\s*\Z/); + $l = shift @lines; + die("Unexpected data parsing Markdown table") if (not $l =~ /\A\s*(\|\s*\-*\s*)?\|\s*\-*\s*\|\s*\-*\s*\|\s*\Z/); + while (scalar(@lines) >= 1) { + $l = shift @lines; + my $name; + my $desc; + if ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + # c datatype is $1, but we don't care about it here. + $name = $2; + $desc = $3; + } elsif ($l =~ /\A\s*\|\s*(.*?)\s*\|\s*(.*?)\s*\|\s*\Z/) { + $name = $1; + $desc = $2; + } else { + last; # we seem to have run out of table. + } + + $name =~ s/\A\*\*(.*?)\*\*/$1/; + $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/; + $name = escLaTeX($name); + $desc = dewikify($wikitype, $desc); + $str .= " \\textbf{$name} & $desc \\\\ \\hline\n"; + } + } else { + die("write me"); + } + + $str .= " \\end{tabular}\n"; + $str .= "\\end{center}\n"; + } + + if (defined $returns) { + $returns = dewikify($wikitype, $returns); + $returns =~ s/\A\(.*?\)\s*//; # Chop datatype in parentheses off the front. + $str .= "\\subsection{Return Value}\n\n"; + $str .= "$returns\n"; + } + + if (defined $remarks) { + $str .= "\\subsection{Remarks}\n\n"; + $str .= $remarks . "\n"; + } + + if (defined $examples) { + $str .= "\\subsection{Code Examples}\n\n"; + $dewikify_manpage_code_indent = 0; + $str .= dewikify($wikitype, $examples) . "\n"; + $dewikify_manpage_code_indent = 1; + } + + if (defined $threadsafety) { + $str .= "\\subsection{Thread Safety}\n\n"; + $str .= dewikify($wikitype, $threadsafety) . "\n"; + } + + if (defined $version) { + $str .= "\\subsection{Version}\n\n"; + $str .= dewikify($wikitype, $version) . "\n"; + } + + if (defined $related) { + $str .= "\\subsection{See Also}\n\n"; + $str .= "\\begin{itemize}\n"; + # !!! FIXME: lots of code duplication in all of these. + my $v = dewikify($wikitype, $related); + my @desclines = split /\n/, $v; + my $nextstr = ''; + foreach (@desclines) { + s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func" + s/\[\[(.*?)\]\]/$1/; # in case some wikilinks remain. + s/\[(.*?)\]\(.*?\)/$1/; # in case some wikilinks remain. + s/\A\*\s*\Z//; + s/\A\s*\\item\s*//; + s/\A\/*//; + s/\A\s*[\:\*\-]\s*//; + s/\A\s+//; + s/\s+\Z//; + next if $_ eq ''; + next if $_ eq '\begin{itemize}'; + next if $_ eq '\end{itemize}'; + $str .= " \\item $_\n"; + } + $str .= "\\end{itemize}\n"; + $str .= "\n"; + } + + # !!! FIXME: Maybe put copyright in the book intro? + if (0) { + $str .= ".SH COPYRIGHT\n"; + $str .= "This manpage is licensed under\n"; + $str .= ".UR https://creativecommons.org/licenses/by/4.0/\n"; + $str .= "Creative Commons Attribution 4.0 International (CC BY 4.0)\n"; + $str .= ".UE\n"; + $str .= ".PP\n"; + $str .= "This manpage was generated from\n"; + $str .= ".UR $wikiurl/$sym\n"; + $str .= "${projectshortname}'s wiki\n"; + $str .= ".UE\n"; + $str .= "using SDL/build-scripts/wikiheaders.pl"; + $str .= " revision $gitrev" if $gitrev ne ''; + $str .= ".\n"; + $str .= "Please report issues in this manpage at\n"; + $str .= ".UR $bugreporturl\n"; + $str .= "our bugtracker!\n"; + $str .= ".UE\n"; + } + + $str .= "\\clearpage\n\n"; + + print TEXFH $str; + } + + print TEXFH "\\end{document}\n\n"; + close(TEXFH); + rename($latex_tmpfname, $latex_fname) or die("Can't rename '$latex_tmpfname' to '$latex_fname': $!\n"); + +} elsif ($copy_direction == -3) { # --report-coverage-gaps + foreach (@coverage_gap) { + print("$_\n"); } } diff --git a/cmake/CheckCPUArchitecture.cmake b/cmake/CheckCPUArchitecture.cmake index 79639f1c2bc4a..f2e4b8329d961 100644 --- a/cmake/CheckCPUArchitecture.cmake +++ b/cmake/CheckCPUArchitecture.cmake @@ -27,11 +27,15 @@ function(check_cpu_architecture ARCH VARIABLE) if(ARCH STREQUAL "x86") _internal_check_cpu_architecture("defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)" x86 ${VARIABLE}) elseif(ARCH STREQUAL "x64") - _internal_check_cpu_architecture("defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)" x64 ${VARIABLE}) + _internal_check_cpu_architecture("(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)" x64 ${VARIABLE}) elseif(ARCH STREQUAL "arm32") _internal_check_cpu_architecture("defined(__arm__) || defined(_M_ARM)" arm32 ${VARIABLE}) elseif(ARCH STREQUAL "arm64") _internal_check_cpu_architecture("defined(__aarch64__) || defined(_M_ARM64)" arm64 ${VARIABLE}) + elseif(ARCH STREQUAL "arm64ec") + _internal_check_cpu_architecture("defined(_M_ARM64EC)" arm64ec ${VARIABLE}) + elseif(ARCH STREQUAL "loongarch64") + _internal_check_cpu_architecture("defined(__loongarch64)" loongarch64 ${VARIABLE}) else() message(WARNING "Unknown CPU architectures (${ARCH}).") set(${VARIABLE} FALSE) diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 6f6c329714a39..5060923e8ec53 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -29,7 +29,7 @@ ENDMACRO() # Message Output macro(MESSAGE_WARN _TEXT) - message(STATUS "*** WARNING: ${_TEXT}") + message(WARNING "${_TEXT}") endmacro() macro(MESSAGE_ERROR _TEXT) @@ -64,7 +64,7 @@ macro(MESSAGE_TESTED_OPTION _NAME) message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}") endmacro() -macro(LISTTOSTR _LIST _OUTPUT) +function(LISTTOSTR _LIST _OUTPUT) if(${ARGC} EQUAL 3) # prefix for each element set(_LPREFIX ${ARGV2}) @@ -73,10 +73,12 @@ macro(LISTTOSTR _LIST _OUTPUT) endif() # Do not use string(REPLACE ";" " ") here to avoid messing up list # entries + set(res) foreach(_ITEM ${${_LIST}}) - set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}") + set(res "${res} ${_LPREFIX}${_ITEM}") endforeach() -endmacro() + set(${_OUTPUT} "${res}" PARENT_SCOPE) +endfunction() macro(LISTTOSTRREV _LIST _OUTPUT) if(${ARGC} EQUAL 3) @@ -122,3 +124,25 @@ if(CMAKE_VERSION VERSION_LESS 3.13.0) link_directories(${ARGN}) endmacro() endif() + +# CMP0087: install(CODE) and install(SCRIPT) support generator expressions. +if(POLICY CMP0087) + cmake_policy(SET CMP0087 NEW) +endif() +function(SDL_install_pdb TARGET DIRECTORY) + get_property(type TARGET ${TARGET} PROPERTY TYPE) + if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$") + if(NOT CMAKE_VERSION VERSION_LESS 3.1) + install(FILES $ DESTINATION "${DIRECTORY}" OPTIONAL) + endif() + elseif(type STREQUAL "STATIC_LIBRARY") + if(NOT CMAKE_VERSION VERSION_LESS 3.15) + # FIXME: Use $) + set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"") + set(HAVE_ALSA_SHARED TRUE) + else() + message(WARNING "Unable to find asound shared object") + endif() + else() + message(WARNING "You must have SDL_LoadObject() support for dynamic ALSA loading") + endif() endif() - FindLibraryAndSONAME("asound") - if(SDL_ALSA_SHARED AND ASOUND_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_ALSA_DYNAMIC "\"${ASOUND_LIB_SONAME}\"") - set(HAVE_ALSA_SHARED TRUE) - else() - list(APPEND EXTRA_LIBS asound) + if(NOT HAVE_ALSA_SHARED) + list(APPEND CMAKE_LIBS ALSA::ALSA) + list(APPEND PKGCONFIG_DEPENDS alsa) endif() set(HAVE_SDL_AUDIO TRUE) + else() + set(HAVE_ALSA FALSE) + message(WARNING "Unable to found the alsa development library") endif() endif() endmacro() @@ -143,7 +166,7 @@ endmacro() # - HAVE_SDL_LOADSO opt macro(CheckPulseAudio) if(SDL_PULSEAUDIO) - pkg_check_modules(PKG_PULSEAUDIO libpulse-simple) + pkg_check_modules(PKG_PULSEAUDIO libpulse>=0.9.15) if(PKG_PULSEAUDIO_FOUND) set(HAVE_PULSEAUDIO TRUE) file(GLOB PULSEAUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/pulseaudio/*.c) @@ -153,9 +176,9 @@ macro(CheckPulseAudio) if(SDL_PULSEAUDIO_SHARED AND NOT HAVE_SDL_LOADSO) message_warn("You must have SDL_LoadObject() support for dynamic PulseAudio loading") endif() - FindLibraryAndSONAME("pulse-simple" LIBDIRS ${PKG_PULSEAUDIO_LIBRARY_DIRS}) - if(SDL_PULSEAUDIO_SHARED AND PULSE_SIMPLE_LIB AND HAVE_SDL_LOADSO) - set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_SIMPLE_LIB_SONAME}\"") + FindLibraryAndSONAME("pulse" LIBDIRS ${PKG_PULSEAUDIO_LIBRARY_DIRS}) + if(SDL_PULSEAUDIO_SHARED AND PULSE_LIB AND HAVE_SDL_LOADSO) + set(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC "\"${PULSE_LIB_SONAME}\"") set(HAVE_PULSEAUDIO_SHARED TRUE) else() list(APPEND EXTRA_LDFLAGS ${PKG_PULSEAUDIO_LDFLAGS}) @@ -357,7 +380,7 @@ macro(CheckLibSampleRate) set(HAVE_LIBSAMPLERATE TRUE) set(HAVE_LIBSAMPLERATE_H TRUE) if(SDL_LIBSAMPLERATE_SHARED) - target_include_directories(sdl-build-options INTERFACE $) + target_include_directories(sdl-build-options SYSTEM INTERFACE $) if(NOT HAVE_SDL_LOADSO) message_warn("You must have SDL_LoadObject() support for dynamic libsamplerate loading") else() @@ -400,6 +423,7 @@ endmacro() # - SDL_X11_SHARED opt # - HAVE_SDL_LOADSO opt macro(CheckX11) + cmake_push_check_state(RESET) if(SDL_X11) foreach(_LIB X11 Xext Xcursor Xi Xfixes Xrandr Xrender Xss) FindLibraryAndSONAME("${_LIB}") @@ -422,6 +446,7 @@ macro(CheckX11) if(X_INCLUDEDIR) list(APPEND EXTRA_CFLAGS "-I${X_INCLUDEDIR}") + list(APPEND CMAKE_REQUIRED_INCLUDES ${X_INCLUDEDIR}) endif() find_file(HAVE_XCURSOR_H NAMES "X11/Xcursor/Xcursor.h" HINTS "${X_INCLUDEDIR}") @@ -446,7 +471,9 @@ macro(CheckX11) list(APPEND SOURCE_FILES ${X11_SOURCES}) set(SDL_VIDEO_DRIVER_X11 1) - # !!! FIXME: why is this disabled for Apple? + # Note: Disabled on Apple because the dynamic mode backend for X11 doesn't + # work properly on Apple during several issues like inconsistent paths + # among platforms. See #6778 (https://github.com/libsdl-org/SDL/issues/6778) if(APPLE) set(SDL_X11_SHARED OFF) endif() @@ -597,6 +624,7 @@ macro(CheckX11) # Prevent Mesa from including X11 headers list(APPEND EXTRA_CFLAGS "-DMESA_EGL_NO_X11_HEADERS -DEGL_NO_X11") endif() + cmake_pop_check_state() endmacro() macro(WaylandProtocolGen _SCANNER _CODE_MODE _XML _PROTL) @@ -657,7 +685,7 @@ macro(CheckWayland) if(WAYLAND_FOUND) target_link_directories(sdl-build-options INTERFACE "${PKG_WAYLAND_LIBRARY_DIRS}") - target_include_directories(sdl-build-options INTERFACE "${PKG_WAYLAND_INCLUDE_DIRS}") + target_include_directories(sdl-build-options SYSTEM INTERFACE "${PKG_WAYLAND_INCLUDE_DIRS}") set(HAVE_WAYLAND TRUE) set(HAVE_SDL_VIDEO TRUE) @@ -667,7 +695,7 @@ macro(CheckWayland) # We have to generate some protocol interface code for some unstable Wayland features. file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") - target_include_directories(sdl-build-options INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") + target_include_directories(sdl-build-options SYSTEM INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols") file(GLOB WAYLAND_PROTOCOLS_XML RELATIVE "${SDL2_SOURCE_DIR}/wayland-protocols/" "${SDL2_SOURCE_DIR}/wayland-protocols/*.xml") foreach(_XML ${WAYLAND_PROTOCOLS_XML}) @@ -703,7 +731,7 @@ macro(CheckWayland) set(HAVE_WAYLAND_LIBDECOR TRUE) set(HAVE_LIBDECOR_H 1) target_link_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_LIBRARY_DIRS}") - target_include_directories(sdl-build-options INTERFACE "${PKG_LIBDECOR_INCLUDE_DIRS}") + target_include_directories(sdl-build-options SYSTEM INTERFACE "${PKG_LIBDECOR_INCLUDE_DIRS}") if(SDL_WAYLAND_LIBDECOR_SHARED AND NOT HAVE_SDL_LOADSO) message_warn("You must have SDL_LoadObject() support for dynamic libdecor loading") endif() @@ -714,6 +742,17 @@ macro(CheckWayland) else() list(APPEND EXTRA_LIBS ${PKG_LIBDECOR_LIBRARIES}) endif() + + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_FLAGS ${PKG_LIBDECOR_CFLAGS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${PKG_LIBDECOR_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${PKG_LIBDECOR_LINK_LIBRARIES}) + check_symbol_exists(libdecor_frame_get_max_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE) + check_symbol_exists(libdecor_frame_get_min_content_size "libdecor.h" HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE) + if(HAVE_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE AND HAVE_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE) + set(SDL_HAVE_LIBDECOR_GET_MIN_MAX 1) + endif() + cmake_pop_check_state() endif() endif() @@ -874,6 +913,22 @@ macro(CheckOpenGLES) endif() endmacro() +# Requires: +# - EGL +macro(CheckQNXScreen) + if(QNX AND HAVE_OPENGL_EGL) + check_c_source_compiles(" + #include + int main (int argc, char** argv) { return 0; }" HAVE_QNX_SCREEN) + if(HAVE_QNX_SCREEN) + set(SDL_VIDEO_DRIVER_QNX 1) + file(GLOB QNX_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/qnx/*.c) + list(APPEND SOURCE_FILES ${QNX_VIDEO_SOURCES}) + list(APPEND EXTRA_LIBS screen EGL) + endif() + endif() +endmacro() + # Requires: # - nada # Optional: @@ -892,7 +947,7 @@ macro(CheckPTHREAD) elseif(BSDI) set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") set(PTHREAD_LDFLAGS "") - elseif(DARWIN) + elseif(MACOS) set(PTHREAD_CFLAGS "-D_THREAD_SAFE") # causes Carbon.p complaints? # set(PTHREAD_CFLAGS "-D_REENTRANT -D_THREAD_SAFE") @@ -908,7 +963,11 @@ macro(CheckPTHREAD) set(PTHREAD_LDFLAGS "-lpthread") elseif(SOLARIS) set(PTHREAD_CFLAGS "-D_REENTRANT") - set(PTHREAD_LDFLAGS "-pthread -lposix4") + if(CMAKE_C_COMPILER_ID MATCHES "SunPro") + set(PTHREAD_LDFLAGS "-mt -lpthread") + else() + set(PTHREAD_LDFLAGS "-pthread") + endif() elseif(SYSV5) set(PTHREAD_CFLAGS "-D_REENTRANT -Kthread") set(PTHREAD_LDFLAGS "") @@ -924,6 +983,8 @@ macro(CheckPTHREAD) elseif(EMSCRIPTEN) set(PTHREAD_CFLAGS "-D_REENTRANT -pthread") set(PTHREAD_LDFLAGS "-pthread") + elseif(QNX) + # pthread support is baked in else() set(PTHREAD_CFLAGS "-D_REENTRANT") set(PTHREAD_LDFLAGS "-lpthread") @@ -946,7 +1007,6 @@ macro(CheckPTHREAD) list(APPEND SDL_CFLAGS ${PTHREAD_CFLAGS}) check_c_source_compiles(" - #define _GNU_SOURCE 1 #include int main(int argc, char **argv) { pthread_mutexattr_t attr; @@ -957,7 +1017,6 @@ macro(CheckPTHREAD) set(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1) else() check_c_source_compiles(" - #define _GNU_SOURCE 1 #include int main(int argc, char **argv) { pthread_mutexattr_t attr; @@ -988,10 +1047,13 @@ macro(CheckPTHREAD) check_include_files("pthread_np.h" HAVE_PTHREAD_NP_H) if (HAVE_PTHREAD_H) check_c_source_compiles(" - #define _GNU_SOURCE 1 #include int main(int argc, char **argv) { - pthread_setname_np(pthread_self(), \"\"); + #ifdef __APPLE__ + pthread_setname_np(\"\"); + #else + pthread_setname_np(pthread_self(),\"\"); + #endif return 0; }" HAVE_PTHREAD_SETNAME_NP) if (HAVE_PTHREAD_NP_H) @@ -1191,6 +1253,7 @@ macro(CheckHIDAPI) if(HAVE_HIDAPI) if(ANDROID) + enable_language(CXX) list(APPEND SOURCE_FILES ${SDL2_SOURCE_DIR}/src/hidapi/android/hid.cpp) endif() if(IOS OR TVOS) @@ -1218,13 +1281,18 @@ endmacro() # - n/a macro(CheckRPI) if(SDL_RPI) - pkg_check_modules(VIDEO_RPI bcm_host brcmegl) + pkg_check_modules(VIDEO_RPI bcm_host) if (NOT VIDEO_RPI_FOUND) set(VIDEO_RPI_INCLUDE_DIRS "/opt/vc/include" "/opt/vc/include/interface/vcos/pthreads" "/opt/vc/include/interface/vmcs_host/linux/" ) set(VIDEO_RPI_LIBRARY_DIRS "/opt/vc/lib" ) set(VIDEO_RPI_LIBRARIES bcm_host ) - set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib") endif() + + pkg_check_modules(VIDEO_RPI_EGL brcmegl) + if (NOT VIDEO_RPI_EGL_FOUND) + set(VIDEO_RPI_EGL_LDFLAGS "-Wl,-rpath,/opt/vc/lib") + endif() + listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I") listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L") @@ -1233,9 +1301,7 @@ macro(CheckRPI) set(CMAKE_REQUIRED_LIBRARIES "${VIDEO_RPI_LIBRARIES}") check_c_source_compiles(" #include - #include int main(int argc, char **argv) { - EGL_DISPMANX_WINDOW_T window; bcm_host_init(); }" HAVE_RPI) set(CMAKE_REQUIRED_FLAGS "${ORIG_CMAKE_REQUIRED_FLAGS}") @@ -1249,7 +1315,7 @@ macro(CheckRPI) list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES}) # !!! FIXME: shouldn't be using CMAKE_C_FLAGS, right? set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}") - list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS}) + list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS} ${VIDEO_RPI_EGL_LDFLAGS}) endif() endif() endmacro() @@ -1265,7 +1331,7 @@ macro(CheckKMSDRM) pkg_check_modules(PKG_KMSDRM libdrm gbm egl) if(PKG_KMSDRM_FOUND AND HAVE_OPENGL_EGL) target_link_directories(sdl-build-options INTERFACE ${PKG_KMSDRM_LIBRARY_DIRS}) - target_include_directories(sdl-build-options INTERFACE "${PKG_KMSDRM_INCLUDE_DIRS}") + target_include_directories(sdl-build-options SYSTEM INTERFACE "${PKG_KMSDRM_INCLUDE_DIRS}") set(HAVE_KMSDRM TRUE) set(HAVE_SDL_VIDEO TRUE) @@ -1291,3 +1357,64 @@ macro(CheckKMSDRM) endif() endif() endmacro() + +macro(CheckLibUDev) + if(SDL_LIBUDEV) + check_include_file("libudev.h" HAVE_LIBUDEV_HEADER) + if(HAVE_LIBUDEV_HEADER) + set(HAVE_LIBUDEV_H TRUE) + FindLibraryAndSONAME(udev) + if(UDEV_LIB_SONAME) + set(SDL_UDEV_DYNAMIC "\"${UDEV_LIB_SONAME}\"") + set(HAVE_LIBUDEV TRUE) + endif() + endif() + endif() +endmacro() + + +macro(CheckLibUnwind) + set(found_libunwind FALSE) + set(_libunwind_src "#include \nint main() {unw_context_t context; unw_getcontext(&context); return 0;}") + + if(NOT found_libunwind) + cmake_push_check_state() + check_c_source_compiles("${_libunwind_src}" LIBC_HAS_WORKING_LIBUNWIND) + cmake_pop_check_state() + if(LIBC_HAS_WORKING_LIBUNWIND) + set(found_libunwind TRUE) + endif() + endif() + + if(NOT found_libunwind) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_LIBRARIES "unwind") + check_c_source_compiles("${_libunwind_src}" LIBUNWIND_HAS_WORKINGLIBUNWIND) + cmake_pop_check_state() + if(LIBUNWIND_HAS_WORKINGLIBUNWIND) + set(found_libunwind TRUE) + list(APPEND EXTRA_TEST_LIBS unwind) + endif() + endif() + + if(NOT found_libunwind) + set(LibUnwind_PKG_CONFIG_SPEC libunwind libunwind-generic) + pkg_check_modules(PC_LIBUNWIND IMPORTED_TARGET ${LibUnwind_PKG_CONFIG_SPEC}) + if(PC_LIBUNWIND_FOUND) + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_LIBRARIES ${PC_LIBUNWIND_LIBRARIES}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${PC_LIBUNWIND_INCLUDE_DIRS}) + check_c_source_compiles("${_libunwind_src}" PC_LIBUNWIND_HAS_WORKING_LIBUNWIND) + cmake_pop_check_state() + if(PC_LIBUNWIND_HAS_WORKING_LIBUNWIND) + set(found_libunwind TRUE) + list(APPEND EXTRA_TEST_LIBS ${PC_LIBUNWIND_LIBRARIES}) + list(APPEND EXTRA_TEST_INCLUDES ${PC_LIBUNWIND_INCLUDE_DIRS}) + endif() + endif() + endif() + + if(found_libunwind) + set(HAVE_LIBUNWIND_H TRUE) + endif() +endmacro() diff --git a/cmake/sdlfind.cmake b/cmake/sdlfind.cmake new file mode 100644 index 0000000000000..a8145484f0b84 --- /dev/null +++ b/cmake/sdlfind.cmake @@ -0,0 +1,9 @@ + +macro(sdlFindALSA) + find_package(ALSA MODULE) + if(ALSA_FOUND AND (NOT TARGET ALSA::ALSA) ) + add_Library(ALSA::ALSA UNKNOWN IMPORTED) + set_property(TARGET ALSA::ALSA PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIRS}) + set_property(TARGET ALSA::ALSA APPEND PROPERTY IMPORTED_LOCATION ${ALSA_LIBRARY}) + endif() +endmacro() diff --git a/cmake/sdlplatform.cmake b/cmake/sdlplatform.cmake new file mode 100644 index 0000000000000..d0d57671ed609 --- /dev/null +++ b/cmake/sdlplatform.cmake @@ -0,0 +1,61 @@ +macro(SDL_DetectCMakePlatform) + set(SDL_CMAKE_PLATFORM ) + # Get the platform + if(WIN32) + set(SDL_CMAKE_PLATFORM WINDOWS) + elseif(UNIX AND NOT APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*Linux") + set(SDL_CMAKE_PLATFORM LINUX) + elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") + set(SDL_CMAKE_PLATFORM FREEBSD) + elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") + set(SDL_CMAKE_PLATFORM NETBSD) + elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") + set(SDL_CMAKE_PLATFORM OPENBSD) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*") + set(SDL_CMAKE_PLATFORM GNU) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") + set(SDL_CMAKE_PLATFORM BSDI) + elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") + set(SDL_CMAKE_PLATFORM FREEBSD) + elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*") + set(SDL_CMAKE_PLATFORM SYSV5) + elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*") + set(SDL_CMAKE_PLATFORM SOLARIS) + elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*") + set(SDL_CMAKE_PLATFORM HPUX) + elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*") + set(SDL_CMAKE_PLATFORM AIX) + elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*") + set(SDL_CMAKE_PLATFORM MINIX) + elseif(CMAKE_SYSTEM_NAME MATCHES "QNX") + set(SDL_CMAKE_PLATFORM QNX) + endif() + elseif(APPLE) + if(CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*") + set(SDL_CMAKE_PLATFORM MACOS) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*") + set(SDL_CMAKE_PLATFORM TVOS) + elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*") + # !!! FIXME: remove the version check when we start requiring >= 3.14.0 + if(CMAKE_VERSION VERSION_LESS 3.14) + set(SDL_CMAKE_PLATFORM IOS) + endif() + elseif(CMAKE_SYSTEM_NAME MATCHES ".*watchOS.*") + set(SDL_CMAKE_PLATFORM WATCHOS) + elseif (CMAKE_SYSTEM_NAME MATCHES "visionOS") + set(SDL_CMAKE_PLATFORM VISIONOS) + endif() + elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*") + message_error("BeOS support has been removed as of SDL 2.0.2.") + elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*") + set(SDL_CMAKE_PLATFORM HAIKU) + elseif(NINTENDO_3DS) + set(SDL_CMAKE_PLATFORM N3DS) + elseif(OS2) + set(SDL_CMAKE_PLATFORM OS2) + endif() + if(SDL_CMAKE_PLATFORM) + set(${SDL_CMAKE_PLATFORM} TRUE) + endif() +endmacro() diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index 388e86c54ce42..01fc1efcebd23 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.12) project(sdl_test LANGUAGES C) +include(CheckLanguage) +include(FeatureSummary) include(GenerateExportHeader) if(ANDROID) @@ -19,14 +21,31 @@ cmake_policy(SET CMP0074 NEW) # Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL2 outside of sysroot set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) -include(FeatureSummary) - option(TEST_SHARED "Test linking to shared SDL2 library" ON) add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library") option(TEST_STATIC "Test linking to static SDL2 library" ON) add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") +option(TEST_TEST "Test linking to SDL3_test library" ON) +add_feature_info("TEST_TEST" TEST_STATIC "Test linking to SDL test library") + +option(TEST_FULL "Run complete SDL test suite" OFF) +add_feature_info("TEST_FULL" TEST_FULL "Build full SDL testsuite") + +# FIXME: how to target ios/tvos with Swift? +# https://gitlab.kitware.com/cmake/cmake/-/issues/20104 +if(APPLE AND CMAKE_SYSTEM_NAME MATCHES ".*(Darwin|MacOS).*") + # multiple values for CMAKE_OSX_ARCHITECTURES not supported with Swift + list(LENGTH CMAKE_OSX_ARCHITECTURES count_osx_archs) + if(count_osx_archs LESS_EQUAL 1) + check_language(Swift) + if(CMAKE_Swift_COMPILER) + enable_language(Swift) + endif() + endif() +endif() + if(TEST_SHARED) find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2) if(EMSCRIPTEN OR (WIN32 AND NOT WINDOWS_STORE)) @@ -75,6 +94,17 @@ if(TEST_SHARED) generate_export_header(sharedlib-shared-vars EXPORT_MACRO_NAME MYLIBRARY_EXPORT) target_compile_definitions(sharedlib-shared-vars PRIVATE "EXPORT_HEADER=\"${CMAKE_CURRENT_BINARY_DIR}/sharedlib-shared-vars_export.h\"") set_target_properties(sharedlib-shared-vars PROPERTIES C_VISIBILITY_PRESET "hidden") + + if(TEST_TEST) + add_executable(sdltest-shared sdltest.c) + target_link_libraries(sdltest-shared PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2) + endif() + + if(CMAKE_Swift_COMPILER) + add_executable(swift-shared main.swift) + target_include_directories(swift-shared PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift") + target_link_libraries(swift-shared PRIVATE SDL2::SDL2) + endif() endif() if(TEST_STATIC) @@ -111,6 +141,26 @@ if(TEST_STATIC) target_link_libraries(cli-static-vars PRIVATE ${SDL2_STATIC_LIBRARIES}) target_include_directories(cli-static-vars PRIVATE ${SDL2_INCLUDE_DIRS}) endif() + + if(TEST_TEST) + add_executable(sdltest-static sdltest.c) + target_link_libraries(sdltest-static PRIVATE SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static) + endif() + + if(CMAKE_Swift_COMPILER) + add_executable(swift-static main.swift) + target_include_directories(swift-static PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/swift") + target_link_libraries(swift-static PRIVATE SDL2::SDL2-static) + endif() +endif() + +if(TEST_FULL) + enable_testing() + set(SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Test timeout multiplier") + set(SDL_TESTS_LINK_SHARED ${TEST_SHARED}) + + add_definitions(-DNO_BUILD_CONFIG) + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../test" SDL_test) endif() message(STATUS "SDL2_PREFIX: ${SDL2_PREFIX}") diff --git a/cmake/test/main.swift b/cmake/test/main.swift new file mode 100644 index 0000000000000..67789fdfe1bc0 --- /dev/null +++ b/cmake/test/main.swift @@ -0,0 +1,12 @@ +/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */ + +import SDL2 + +guard SDL_Init(Uint32(SDL_INIT_VIDEO)) == 0 else { + fatalError("SDL_Init error: \(String(cString: SDL_GetError()))") +} + +var sdlVersion = SDL_version() +SDL_GetVersion(&sdlVersion) + +print("SDL version: \(sdlVersion.major).\(sdlVersion.minor).\(sdlVersion.patch)") diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c index 4ffe9be1c4078..ca2d92ecd48e6 100644 --- a/cmake/test/main_gui.c +++ b/cmake/test/main_gui.c @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) { 640, 480, SDL_WINDOW_SHOWN ); - if (window == NULL) { + if (!window) { fprintf(stderr, "could not create window: %s\n", SDL_GetError()); return 1; } diff --git a/cmake/test/sdltest.c b/cmake/test/sdltest.c new file mode 100644 index 0000000000000..5c6d6972f0093 --- /dev/null +++ b/cmake/test/sdltest.c @@ -0,0 +1,9 @@ +#include "SDL.h" +#include "SDL_test.h" + + +int main(int argc, char *argv[]) { + SDLTest_CommonState state; + SDLTest_CommonDefaultArgs(&state, argc, argv); + return 0; +} diff --git a/cmake/test/swift/module.modulemap b/cmake/test/swift/module.modulemap new file mode 100644 index 0000000000000..a3a627422aeb8 --- /dev/null +++ b/cmake/test/swift/module.modulemap @@ -0,0 +1,4 @@ +module SDL2 [extern_c] { + header "shim.h" + export * +} diff --git a/cmake/test/swift/shim.h b/cmake/test/swift/shim.h new file mode 100644 index 0000000000000..ed54a9bb1d12f --- /dev/null +++ b/cmake/test/swift/shim.h @@ -0,0 +1,3 @@ +/* Contributed by Piotr Usewicz (https://github.com/pusewicz) */ + +#include "SDL.h" diff --git a/cmake/test/test_pkgconfig.sh b/cmake/test/test_pkgconfig.sh index 7afc00b0969e0..500cd0984dbfd 100755 --- a/cmake/test/test_pkgconfig.sh +++ b/cmake/test/test_pkgconfig.sh @@ -13,7 +13,7 @@ case "$machine" in *android* ) EXEPREFIX="lib" EXESUFFIX=".so" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared" + LDFLAGS="$LDFLAGS -shared" ;; * ) EXEPREFIX="" @@ -25,20 +25,20 @@ set -e # Get the canonical path of the folder containing this script testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") -CFLAGS="$( pkg-config sdl2 --cflags )" -LDFLAGS="$( pkg-config sdl2 --libs )" -STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )" - -compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $CFLAGS $EXTRA_CFLAGS" -link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS" -static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS" - -echo "-- CC: $CC" -echo "-- CFLAGS: $CFLAGS" -echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS" -echo "-- LDFLASG: $LDFLAGS" -echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS" -echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS" +SDL_CFLAGS="$( pkg-config sdl2 --cflags )" +SDL_LDFLAGS="$( pkg-config sdl2 --libs )" +SDL_STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )" + +compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS" +link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS" +static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS" + +echo "-- CC: $CC" +echo "-- CFLAGS: $CFLAGS" +echo "-- LDFLASG: $LDFLAGS" +echo "-- SDL_CFLAGS: $SDL_CFLAGS" +echo "-- SDL_LDFLAGS: $SDL_LDFLAGS" +echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS" echo "-- COMPILE: $compile_cmd" echo "-- LINK: $link_cmd" diff --git a/cmake/test/test_sdlconfig.sh b/cmake/test/test_sdlconfig.sh index 8de5421dc99b1..fa41dbb2535fb 100755 --- a/cmake/test/test_sdlconfig.sh +++ b/cmake/test/test_sdlconfig.sh @@ -13,7 +13,7 @@ case "$machine" in *android* ) EXEPREFIX="lib" EXESUFFIX=".so" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared" + LDFLAGS="$LDFLAGS -shared" ;; * ) EXEPREFIX="" @@ -25,20 +25,20 @@ set -e # Get the canonical path of the folder containing this script testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") -CFLAGS="$( sdl2-config --cflags )" -LDFLAGS="$( sdl2-config --libs )" -STATIC_LDFLAGS="$( sdl2-config --static-libs )" - -compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS" -link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS" -static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS" - -echo "-- CC: $CC" -echo "-- CFLAGS: $CFLAGS" -echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS" -echo "-- LDFLAGS: $LDFLAGS" -echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS" -echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS" +SDL_CFLAGS="$( sdl2-config --cflags )" +SDL_LDFLAGS="$( sdl2-config --libs )" +SDL_STATIC_LDFLAGS="$( sdl2-config --static-libs )" + +compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $SDL_CFLAGS" +link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS" +static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS" + +echo "-- CC: $CC" +echo "-- CFLAGS: $CFLAGS" +echo "-- LDFLAGS: $LDFLAGS" +echo "-- SDL_CFLAGS: $SDL_CFLAGS" +echo "-- SDL_LDFLAGS: $SDL_LDFLAGS" +echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS" echo "-- COMPILE: $compile_cmd" echo "-- LINK: $link_cmd" diff --git a/configure b/configure index 87c576def58ad..4ecefec717a82 100755 --- a/configure +++ b/configure @@ -677,6 +677,7 @@ ENABLE_STATIC_TRUE ENABLE_SHARED_FALSE ENABLE_SHARED_TRUE PKGCONFIG_LIBS_PRIV +PKGCONFIG_DEPENDS SDL_RLD_FLAGS SDL_STATIC_LIBS SDL_LIBS @@ -702,6 +703,8 @@ X_LIBS X_PRE_LIBS X_CFLAGS XMKMF +RPI_EGL_LIBS +RPI_EGL_CFLAGS RPI_LIBS RPI_CFLAGS DECOR_LIBS @@ -844,6 +847,7 @@ enable_assertions enable_dependency_tracking enable_libc enable_system_iconv +enable_libiconv enable_gcc_atomics enable_atomic enable_audio @@ -871,7 +875,6 @@ enable_sse2 enable_sse3 enable_altivec enable_lsx -enable_lasx enable_oss enable_alsa with_alsa_prefix @@ -990,6 +993,8 @@ DECOR_CFLAGS DECOR_LIBS RPI_CFLAGS RPI_LIBS +RPI_EGL_CFLAGS +RPI_EGL_LIBS XMKMF DIRECTFB_CFLAGS DIRECTFB_LIBS @@ -1640,7 +1645,9 @@ Optional Features: Use gcc -MMD -MT dependency tracking [default=yes] --enable-libc Use the system C library [default=yes] --enable-system-iconv Use iconv() from system-installed libraries - [default=yes] + [default=no for windows, yes for others] + --enable-libiconv Prefer iconv() from libiconv, if available, over + libc version [default=no] --enable-gcc-atomics Use gcc builtin atomics [default=yes] --enable-atomic Enable the atomic operations subsystem [default=yes] --enable-audio Enable the audio subsystem [default=yes] @@ -1665,13 +1672,12 @@ Optional Features: --enable-ssemath Allow GCC to use SSE floating point math [default=maybe] --enable-mmx use MMX assembly routines [default=yes] - --enable-3dnow use 3DNow! assembly routines [default=yes] + --enable-3dnow use 3DNow! assembly routines [default=no] --enable-sse use SSE assembly routines [default=yes] --enable-sse2 use SSE2 assembly routines [default=maybe] --enable-sse3 use SSE3 assembly routines [default=maybe] --enable-altivec use Altivec assembly routines [default=yes] --enable-lsx use LSX assembly routines [default=yes] - --enable-lasx use LASX assembly routines [default=yes] --enable-oss support the OSS audio API [default=maybe] --enable-alsa support the ALSA audio API [default=yes] --disable-alsatest Do not try to compile and run a test Alsa program @@ -1716,7 +1722,7 @@ Optional Features: [default=yes] --enable-libdecor-shared dynamically load libdecor [default=yes] - --enable-video-rpi use Raspberry Pi 2/3 video driver [default=yes] + --enable-video-rpi use Raspberry Pi 0-3 video driver [default=yes] --enable-video-x11 use X11 video driver [default=maybe] --enable-x11-shared dynamically load X11 support [default=maybe] --enable-video-x11-xcursor @@ -1846,6 +1852,10 @@ Some influential environment variables: DECOR_LIBS linker flags for DECOR, overriding pkg-config RPI_CFLAGS C compiler flags for RPI, overriding pkg-config RPI_LIBS linker flags for RPI, overriding pkg-config + RPI_EGL_CFLAGS + C compiler flags for RPI_EGL, overriding pkg-config + RPI_EGL_LIBS + linker flags for RPI_EGL, overriding pkg-config XMKMF Path to xmkmf, Makefile generator for X Window System DIRECTFB_CFLAGS C compiler flags for DIRECTFB, overriding pkg-config @@ -2448,6 +2458,58 @@ printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl ac_configure_args_raw= for ac_arg do @@ -3453,7 +3515,7 @@ orig_CFLAGS="$CFLAGS" # See docs/release_checklist.md SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=26 +SDL_MINOR_VERSION=33 SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION @@ -4979,7 +5041,7 @@ if test yes = "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -5106,7 +5168,7 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in @@ -5335,7 +5397,7 @@ else $as_nop lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5499,7 +5561,7 @@ else $as_nop case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -5512,7 +5574,7 @@ else $as_nop ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -5547,9 +5609,9 @@ else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac @@ -5583,7 +5645,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -5753,10 +5815,10 @@ cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' - lt_cv_deplibs_check_method=pass_all # SDL customization + lt_cv_deplibs_check_method=pass_all # SDL customization. ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -5765,10 +5827,10 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi - lt_cv_deplibs_check_method=pass_all # SDL customization + lt_cv_deplibs_check_method=pass_all # SDL customization. ;; cegcc*) @@ -5924,7 +5986,7 @@ file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -6078,7 +6140,7 @@ else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -6516,15 +6578,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6651,7 +6706,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -6730,7 +6785,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -6745,7 +6800,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -6781,7 +6836,7 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -7179,7 +7234,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -7198,7 +7253,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" @@ -7227,7 +7282,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) @@ -8043,6 +8098,43 @@ fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else $as_nop + lt_cv_support_no_fixup_chains=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} @@ -8095,7 +8187,7 @@ _LT_EOF echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -8123,7 +8215,12 @@ printf "%s\n" "$lt_cv_ld_force_load" >&6; } 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + if test yes = "$lt_cv_support_no_fixup_chains"; then + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup $wl-no_fixup_chains' + else + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + fi + ;; esac ;; esac @@ -8223,7 +8320,7 @@ fi enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 @@ -8839,8 +8936,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9023,7 +9120,7 @@ objext=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' @@ -9164,7 +9261,7 @@ lt_prog_compiler_static= # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -9267,7 +9364,7 @@ lt_prog_compiler_static= esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -9774,16 +9871,16 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + cygwin* | mingw* | windows* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -9889,7 +9986,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -10434,14 +10531,14 @@ fi export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10451,14 +10548,14 @@ fi # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_cmds='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' @@ -10482,7 +10579,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -11248,7 +11345,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -11306,7 +11403,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -11474,7 +11571,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -11503,14 +11600,14 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' #soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization. sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix #soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization. ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -11520,14 +11617,14 @@ cygwin* | mingw* | pw32* | cegcc*) dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -11577,7 +11674,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -12247,7 +12344,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -12574,11 +12671,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -12681,11 +12778,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -14523,7 +14620,7 @@ if test yes = "$GCC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -14657,7 +14754,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else GXX=no @@ -14955,10 +15052,10 @@ fi esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' @@ -15154,7 +15251,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -15219,7 +15316,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -15558,7 +15655,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # FIXME: insert proper C++ library support @@ -15642,7 +15739,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -15653,7 +15750,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' @@ -15967,7 +16064,7 @@ lt_prog_compiler_static_CXX= beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -16042,7 +16139,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' @@ -16536,9 +16633,9 @@ printf %s "checking whether the $compiler linker ($LD) supports shared libraries pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -16858,7 +16955,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -16887,13 +16984,13 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' #soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | sed -e 's/^lib//'`$shared_ext' # SDL customization. ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix #soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization + soname_spec='`echo $libname | $SED -e 's/^lib//'`$shared_ext' # SDL customization. ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' @@ -16903,14 +17000,14 @@ cygwin* | mingw* | pw32* | cegcc*) dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -16960,7 +17057,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -17652,6 +17749,79 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -18292,8 +18462,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` find_lib() { - gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` - gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` + gcc_bin_path=`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` + gcc_lib_path=`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'` env_lib_path=`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'` if test "$cross_compiling" = yes; then host_lib_path="" @@ -18694,12 +18864,26 @@ else $as_nop fi +enable_system_iconv_default=yes +case "$host" in + *-*-cygwin*|*-*-mingw*|*-*-darwin*|*-ios-*) + enable_system_iconv_default=no + ;; +esac # Check whether --enable-system-iconv was given. if test ${enable_system_iconv+y} then : enableval=$enable_system_iconv; else $as_nop - enable_system_iconv=yes + enable_system_iconv=$enable_system_iconv_default +fi + +# Check whether --enable-libiconv was given. +if test ${enable_libiconv+y} +then : + enableval=$enable_libiconv; +else $as_nop + enable_libiconv=no fi @@ -18816,12 +19000,6 @@ if test "x$ac_cv_header_signal_h" = xyes then : printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h -fi -ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_input_h" = xyes -then : - printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h - fi @@ -19577,6 +19755,12 @@ if test "x$ac_cv_func_sigaction" = xyes then : printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "sigtimedwait" "ac_cv_func_sigtimedwait" +if test "x$ac_cv_func_sigtimedwait" = xyes +then : + printf "%s\n" "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp" if test "x$ac_cv_func_setjmp" = xyes @@ -19619,6 +19803,18 @@ if test "x$ac_cv_func_poll" = xyes then : printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create" +if test "x$ac_cv_func_memfd_create" = xyes +then : + printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" +if test "x$ac_cv_func_posix_fallocate" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "_Exit" "ac_cv_func__Exit" if test "x$ac_cv_func__Exit" = xyes @@ -19923,53 +20119,90 @@ fi if test x$enable_system_iconv = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5 -printf %s "checking for iconv_open in -liconv... " >&6; } -if test ${ac_cv_lib_iconv_iconv_open+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv in libc" >&5 +printf %s "checking for iconv in libc... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char iconv_open (); + #define LIBICONV_PLUG 1 /* in case libiconv header is in include path */ + #include + #include + int main (void) { -return iconv_open (); + + iconv_open(NULL,NULL); + ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_iconv_iconv_open=yes + have_libc_iconv=yes else $as_nop - ac_cv_lib_iconv_iconv_open=no + have_libc_iconv=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5 -printf "%s\n" "$ac_cv_lib_iconv_iconv_open" >&6; } -if test "x$ac_cv_lib_iconv_iconv_open" = xyes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_libc_iconv" >&5 +printf "%s\n" "$have_libc_iconv" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv in libiconv" >&5 +printf %s "checking for iconv in libiconv... " >&6; } + save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main (void) +{ + + iconv_open(NULL,NULL); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" then : - LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv" + have_libiconv=yes +else $as_nop + have_libiconv=no fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_libiconv" >&5 +printf "%s\n" "$have_libiconv" >&6; } - ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" -if test "x$ac_cv_func_iconv" = xyes -then : - printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + if test x$have_libc_iconv = xyes || test x$have_libiconv = xyes; then -fi +printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h + + + if test x$have_libiconv = xyes; then + if test x$have_libc_iconv != xyes; then + use_libiconv=yes + elif test x$enable_libiconv = xyes; then + use_libiconv=yes + fi + fi + if test x$use_libiconv = xyes; then +printf "%s\n" "#define SDL_USE_LIBICONV 1" >>confdefs.h + + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv" + echo "-- Using iconv from libiconv" + else + echo "-- Using iconv from libc" + fi + fi fi ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include @@ -20470,7 +20703,7 @@ if test ${enable_3dnow+y} then : enableval=$enable_3dnow; else $as_nop - enable_3dnow=yes + enable_3dnow=no fi if test x$enable_3dnow = xyes; then @@ -20859,7 +21092,7 @@ printf "%s\n" "#define HAVE_ALTIVEC_H 1" >>confdefs.h fi fi - # Check whether --enable-lsx was given. +# Check whether --enable-lsx was given. if test ${enable_lsx+y} then : enableval=$enable_lsx; @@ -20867,20 +21100,20 @@ else $as_nop enable_lsx=yes fi - if test x$enable_lsx = xyes; then - save_CFLAGS="$CFLAGS" - have_gcc_lsx=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5 +if test x$enable_lsx = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_lsx=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlsx option" >&5 printf %s "checking for GCC -mlsx option... " >&6; } - lsx_CFLAGS="-mlsx" - CFLAGS="$save_CFLAGS $lsx_CFLAGS" + lsx_CFLAGS="-mlsx" + CFLAGS="$save_CFLAGS $lsx_CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifndef __loongarch_sx - #error Assembler CPP flag not enabled - #endif + #ifndef __loongarch_sx + #error Assembler CPP flag not enabled + #endif int main (void) @@ -20895,19 +21128,19 @@ then : have_gcc_lsx=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lsx" >&5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lsx" >&5 printf "%s\n" "$have_gcc_lsx" >&6; } - CFLAGS="$save_CFLAGS" + CFLAGS="$save_CFLAGS" - if test x$have_gcc_lsx = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS" - SUMMARY_math="${SUMMARY_math} lsx" - fi + if test x$have_gcc_lsx = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS" + SUMMARY_math="${SUMMARY_math} lsx" fi +fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsxintrin.h" >&5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lsxintrin.h" >&5 printf %s "checking for lsxintrin.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -20925,132 +21158,58 @@ else $as_nop have_lsxintrin_h_hdr=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_lsxintrin_h_hdr" >&5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_lsxintrin_h_hdr" >&5 printf "%s\n" "$have_lsxintrin_h_hdr" >&6; } - if test x$have_lsxintrin_h_hdr = xyes; then +if test x$have_lsxintrin_h_hdr = xyes; then printf "%s\n" "#define HAVE_LSXINTRIN_H 1" >>confdefs.h - fi +fi - # Check whether --enable-lasx was given. -if test ${enable_lasx+y} +CheckOSS() +{ + # Check whether --enable-oss was given. +if test ${enable_oss+y} then : - enableval=$enable_lasx; + enableval=$enable_oss; else $as_nop - enable_LASX=yes + enable_oss=maybe fi - if test x$enable_LASX = xyes; then - save_CFLAGS="$CFLAGS" - have_gcc_lasx=no - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mlasx option" >&5 -printf %s "checking for GCC -mlasx option... " >&6; } - lasx_CFLAGS="-mlasx" - CFLAGS="$save_CFLAGS $lasx_CFLAGS" + if test x$enable_oss = xmaybe; then + enable_oss=yes + fi - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test x$enable_audio = xyes -a x$enable_oss = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OSS audio support" >&5 +printf %s "checking for OSS audio support... " >&6; } + have_oss=no + if test x$have_oss != xyes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifndef __loongarch_asx - #error Assembler CPP flag not enabled - #endif + #include int main (void) { + int arg = SNDCTL_DSP_SETFRAGMENT; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : - have_gcc_lasx=yes + have_oss=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_lasx" >&5 -printf "%s\n" "$have_gcc_lasx" >&6; } - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_lasx = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS $lasx_CFLAGS" - SUMMARY_math="${SUMMARY_math} lasx" fi - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lasxintrin.h" >&5 -printf %s "checking for lasxintrin.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_lasxintrin_h_hdr=yes -else $as_nop - have_lasxintrin_h_hdr=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_lasxintrin_h_hdr" >&5 -printf "%s\n" "$have_lasxintrin_h_hdr" >&6; } - if test x$have_lasxintrin_h_hdr = xyes; then - -printf "%s\n" "#define HAVE_LASXINTRIN_H 1" >>confdefs.h - - fi - -CheckOSS() -{ - # Check whether --enable-oss was given. -if test ${enable_oss+y} -then : - enableval=$enable_oss; -else $as_nop - enable_oss=maybe -fi - - if test x$enable_oss = xmaybe; then - enable_oss=yes - fi - - if test x$enable_audio = xyes -a x$enable_oss = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OSS audio support" >&5 -printf %s "checking for OSS audio support... " >&6; } - have_oss=no - if test x$have_oss != xyes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main (void) -{ - - int arg = SNDCTL_DSP_SETFRAGMENT; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_oss=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_oss" >&5 -printf "%s\n" "$have_oss" >&6; } - if test x$have_oss = xyes; then - SUMMARY_audio="${SUMMARY_audio} oss" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_oss" >&5 +printf "%s\n" "$have_oss" >&6; } + if test x$have_oss = xyes; then + SUMMARY_audio="${SUMMARY_audio} oss" printf "%s\n" "#define SDL_AUDIO_DRIVER_OSS 1" >>confdefs.h @@ -21957,19 +22116,19 @@ fi if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libpulse-simple >= 0.9" >&5 -printf %s "checking for libpulse-simple >= 0.9... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libpulse >= 0.9.15" >&5 +printf %s "checking for libpulse >= 0.9.15... " >&6; } if test -n "$PULSEAUDIO_CFLAGS"; then pkg_cv_PULSEAUDIO_CFLAGS="$PULSEAUDIO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple >= 0.9\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpulse-simple >= 0.9") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse >= 0.9.15\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse >= 0.9.15") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags "libpulse-simple >= 0.9" 2>/dev/null` + pkg_cv_PULSEAUDIO_CFLAGS=`$PKG_CONFIG --cflags "libpulse >= 0.9.15" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21981,12 +22140,12 @@ if test -n "$PULSEAUDIO_LIBS"; then pkg_cv_PULSEAUDIO_LIBS="$PULSEAUDIO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-simple >= 0.9\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpulse-simple >= 0.9") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse >= 0.9.15\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpulse >= 0.9.15") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_PULSEAUDIO_LIBS=`$PKG_CONFIG --libs "libpulse-simple >= 0.9" 2>/dev/null` + pkg_cv_PULSEAUDIO_LIBS=`$PKG_CONFIG --libs "libpulse >= 0.9.15" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22007,9 +22166,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpulse-simple >= 0.9" 2>&1` + PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpulse >= 0.9.15" 2>&1` else - PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpulse-simple >= 0.9" 2>&1` + PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpulse >= 0.9.15" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PULSEAUDIO_PKG_ERRORS" >&5 @@ -22036,7 +22195,7 @@ else $as_nop enable_pulseaudio_shared=yes fi - pulseaudio_lib=`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` + pulseaudio_lib=`find_lib "libpulse.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'` printf "%s\n" "#define SDL_AUDIO_DRIVER_PULSEAUDIO 1" >>confdefs.h @@ -22050,7 +22209,7 @@ printf "%s\n" "$as_me: WARNING: You must have SDL_LoadObject() support for dynam fi if test x$have_loadso = xyes && \ test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then - echo "-- dynamic libpulse-simple -> $pulseaudio_lib" + echo "-- dynamic libpulse -> $pulseaudio_lib" printf "%s\n" "#define SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC \"$pulseaudio_lib\"" >>confdefs.h @@ -22269,7 +22428,6 @@ printf %s "checking for NAS audio support... " >&6; } have_nas=yes NAS_CFLAGS="-I/usr/X11R6/include/" NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_nas" >&5 @@ -22900,41 +23058,6 @@ printf "%s\n" "$have_gcc_no_strict_aliasing" >&6; } fi } -CheckStackBoundary() -{ - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -mpreferred-stack-boundary option" >&5 -printf %s "checking for GCC -mpreferred-stack-boundary option... " >&6; } - have_gcc_preferred_stack_boundary=no - - save_CFLAGS="$CFLAGS" - CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - int x = 0; - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_gcc_preferred_stack_boundary=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_preferred_stack_boundary" >&5 -printf "%s\n" "$have_gcc_preferred_stack_boundary" >&6; } - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_preferred_stack_boundary = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2" - fi -} - CheckWerror() { # Check whether --enable-werror was given. @@ -23099,6 +23222,41 @@ printf "%s\n" "$need_gcc_Wno_multichar" >&6; } fi } +CheckUnusedLocalTypedefs() +{ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GCC -Wunused-local-typedefs option" >&5 +printf %s "checking for GCC -Wunused-local-typedefs option... " >&6; } + have_gcc_unused_local_typedefs=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wunused-local-typedefs" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int x = 0; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + have_gcc_unused_local_typedefs=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_unused_local_typedefs" >&5 +printf "%s\n" "$have_gcc_unused_local_typedefs" >&6; } + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_unused_local_typedefs = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-unused-local-typedefs" + fi +} + CheckWayland() { # Check whether --enable-video-wayland was given. @@ -23329,6 +23487,122 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR \"$decor_lib\"" else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS" fi + + saved_cflags=$CFLAGS + CFLAGS="$CFLAGS $DECOR_CFLAGS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "libdecor_frame_get_min_content_size" "ac_cv_have_decl_libdecor_frame_get_min_content_size" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_libdecor_frame_get_min_content_size" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MIN_CONTENT_SIZE $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + libdecor_get_min_max=yes +fi +ac_fn_check_decl "$LINENO" "libdecor_frame_get_max_content_size" "ac_cv_have_decl_libdecor_frame_get_max_content_size" "#include +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_libdecor_frame_get_max_content_size" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_LIBDECOR_FRAME_GET_MAX_CONTENT_SIZE $ac_have_decl" >>confdefs.h +if test $ac_have_decl = 1 +then : + libdecor_get_min_max=yes +fi + + if test x$libdecor_get_min_max = xyes; then + +printf "%s\n" "#define SDL_HAVE_LIBDECOR_GET_MIN_MAX 1" >>confdefs.h + + fi + CFLAGS="$saved_cflags" fi fi fi @@ -23401,19 +23675,19 @@ fi if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host brcmegl" >&5 -printf %s "checking for bcm_host brcmegl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bcm_host" >&5 +printf %s "checking for bcm_host... " >&6; } if test -n "$RPI_CFLAGS"; then pkg_cv_RPI_CFLAGS="$RPI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5 + ($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host brcmegl" 2>/dev/null` + pkg_cv_RPI_CFLAGS=`$PKG_CONFIG --cflags "bcm_host" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23425,12 +23699,12 @@ if test -n "$RPI_LIBS"; then pkg_cv_RPI_LIBS="$RPI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host brcmegl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "bcm_host brcmegl") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5 + ($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host brcmegl" 2>/dev/null` + pkg_cv_RPI_LIBS=`$PKG_CONFIG --libs "bcm_host" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23451,9 +23725,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host brcmegl" 2>&1` + RPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host" 2>&1` else - RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host brcmegl" 2>&1` + RPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RPI_PKG_ERRORS" >&5 @@ -23471,13 +23745,92 @@ printf "%s\n" "yes" >&6; } video_rpi=yes fi +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for brcmegl" >&5 +printf %s "checking for brcmegl... " >&6; } + +if test -n "$RPI_EGL_CFLAGS"; then + pkg_cv_RPI_EGL_CFLAGS="$RPI_EGL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPI_EGL_CFLAGS=`$PKG_CONFIG --cflags "brcmegl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$RPI_EGL_LIBS"; then + pkg_cv_RPI_EGL_LIBS="$RPI_EGL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"brcmegl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "brcmegl") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPI_EGL_LIBS=`$PKG_CONFIG --libs "brcmegl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "brcmegl" 2>&1` + else + RPI_EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "brcmegl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$RPI_EGL_PKG_ERRORS" >&5 + + video_rpi_egl=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + video_rpi_egl=no +else + RPI_EGL_CFLAGS=$pkg_cv_RPI_EGL_CFLAGS + RPI_EGL_LIBS=$pkg_cv_RPI_EGL_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + video_rpi_egl=yes +fi + if test x$video_rpi = xno; then if test x$ARCH = xnetbsd; then RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux" - RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host" + RPI_LIBS="-L/usr/pkg/lib -lbcm_host" else RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux" - RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host" + RPI_LIBS="-L/opt/vc/lib -lbcm_host" + fi + fi + + if test x$video_rpi_egl = xno; then + if test x$ARCH = xnetbsd; then + RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib" + else + RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib" fi fi @@ -23485,22 +23838,20 @@ fi ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" # Add the Raspberry Pi compiler flags and libraries - CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS" + CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 2/3" >&5 -printf %s "checking for Raspberry Pi 2/3... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Raspberry Pi 0-3" >&5 +printf %s "checking for Raspberry Pi 0-3... " >&6; } have_video_rpi=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #include int main (void) { - EGL_DISPMANX_WINDOW_T window; bcm_host_init(); ; @@ -23523,7 +23874,7 @@ printf "%s\n" "$have_video_rpi" >&6; } CFLAGS="$CFLAGS $RPI_CFLAGS" SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS" EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS" SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c" printf "%s\n" "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h @@ -26107,6 +26458,9 @@ else $as_nop fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; + *-*-solaris*) + enable_video_vulkan=no + ;; *-*-darwin*) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -x objective-c" @@ -26163,6 +26517,14 @@ printf "%s\n" "#define SDL_VIDEO_VULKAN 1" >>confdefs.h CheckInputEvents() { + ac_fn_c_check_header_compile "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_input_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Linux 2.4 unified input interface" >&5 printf %s "checking for Linux 2.4 unified input interface... " >&6; } use_input_events=no @@ -27197,9 +27559,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_wince" >&5 printf "%s\n" "$have_wince" >&6; } - # This fixes Windows stack alignment with newer GCC - CheckStackBoundary - # headers needed elsewhere ac_fn_c_check_header_compile "$LINENO" "tpcshrd.h" "ac_cv_header_tpcshrd_h" "$ac_includes_default" if test "x$ac_cv_header_tpcshrd_h" = xyes @@ -27289,18 +27648,14 @@ then : have_d3d11=yes fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for d3d12 Windows SDK version" >&5 -printf %s "checking for d3d12 Windows SDK version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compatible d3d12 headers" >&5 +printf %s "checking for compatible d3d12 headers... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include #include +#include ID3D12Device1 *device; -#if WDK_NTDDI_VERSION <= 0x0A000008 -asdf -#endif int main (void) @@ -27319,6 +27674,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_d3d12" >&5 printf "%s\n" "$have_d3d12" >&6; } + ac_fn_c_check_header_compile "$LINENO" "ddraw.h" "ac_cv_header_ddraw_h" "$ac_includes_default" if test "x$ac_cv_header_ddraw_h" = xyes then : @@ -27383,77 +27739,16 @@ else $as_nop fi if test x$enable_xinput = xyes; then - have_xinput_gamepadex=no - have_xinput_stateex=no ac_fn_c_check_header_compile "$LINENO" "xinput.h" "ac_cv_header_xinput_h" "$ac_includes_default" if test "x$ac_cv_header_xinput_h" = xyes then : have_xinput=yes fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct XINPUT_GAMEPAD_EX" >&5 -printf %s "checking for struct XINPUT_GAMEPAD_EX... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -XINPUT_GAMEPAD_EX x1; - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_xinput_gamepadex=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_xinput_gamepadex" >&5 -printf "%s\n" "$have_xinput_gamepadex" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct XINPUT_STATE_EX" >&5 -printf %s "checking for struct XINPUT_STATE_EX... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -XINPUT_STATE_EX s1; - -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - have_xinput_stateex=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_xinput_stateex" >&5 -printf "%s\n" "$have_xinput_stateex" >&6; } - if test x$have_xinput = xyes; then printf "%s\n" "#define HAVE_XINPUT_H 1" >>confdefs.h - fi - if test x$have_xinput_gamepadex = xyes; then - -printf "%s\n" "#define HAVE_XINPUT_GAMEPAD_EX 1" >>confdefs.h - - fi - if test x$have_xinput_stateex = xyes; then - -printf "%s\n" "#define HAVE_XINPUT_STATE_EX 1" >>confdefs.h - fi fi @@ -28008,7 +28303,7 @@ fi enable_hidapi_libusb=yes require_hidapi_libusb=yes ;; - *-*-os2* ) + *-*-os2* ) enable_hidapi_libusb=yes ;; esac @@ -28104,7 +28399,8 @@ fi if test x$hidapi_support = xyes; then if test x$have_libusb_h = xyes; then - printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h + +printf "%s\n" "#define HAVE_LIBUSB 1" >>confdefs.h EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS" if test x$require_hidapi_libusb = xyes; then @@ -28162,14 +28458,14 @@ else $as_nop fi if test x$enable_clock_gettime = xyes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -printf %s "checking for clock_gettime in -lrt... " >&6; } -if test ${ac_cv_lib_rt_clock_gettime+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5 +printf %s "checking for clock_gettime in -lc... " >&6; } +if test ${ac_cv_lib_c_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28187,17 +28483,17 @@ return clock_gettime (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_rt_clock_gettime=yes + ac_cv_lib_c_clock_gettime=yes else $as_nop - ac_cv_lib_rt_clock_gettime=no + ac_cv_lib_c_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_clock_gettime" >&5 +printf "%s\n" "$ac_cv_lib_c_clock_gettime" >&6; } +if test "x$ac_cv_lib_c_clock_gettime" = xyes then : have_clock_gettime=yes fi @@ -28206,16 +28502,15 @@ fi printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lc" >&5 -printf %s "checking for clock_gettime in -lc... " >&6; } -if test ${ac_cv_lib_c_clock_gettime+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +printf %s "checking for clock_gettime in -lrt... " >&6; } +if test ${ac_cv_lib_rt_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -28233,26 +28528,26 @@ return clock_gettime (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_c_clock_gettime=yes + ac_cv_lib_rt_clock_gettime=yes else $as_nop - ac_cv_lib_c_clock_gettime=no + ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_clock_gettime" >&5 -printf "%s\n" "$ac_cv_lib_c_clock_gettime" >&6; } -if test "x$ac_cv_lib_c_clock_gettime" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes then : have_clock_gettime=yes fi if test x$have_clock_gettime = xyes; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - EXTRA_LDFLAGS="$EXTRA_LDFLAGS" fi fi fi @@ -28330,6 +28625,7 @@ printf "%s\n" "#define SDL_JOYSTICK_VIRTUAL 1" >>confdefs.h } CheckWarnAll +CheckUnusedLocalTypedefs CheckNoStrictAliasing CheckEventSignals @@ -28451,12 +28747,23 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h if test x$enable_audio = xyes; then case $ARCH in sysv5|solaris|hpux) + # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first. + ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audioio_h" = xyes +then : + have_sys_audioio_h=yes +else $as_nop + have_sys_audioio_h=no +fi + + if test x$have_sys_audioio_h = xyes; then printf "%s\n" "#define SDL_AUDIO_DRIVER_SUNAUDIO 1" >>confdefs.h - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + SUMMARY_audio="${SUMMARY_audio} sun" + have_audio=yes + fi ;; netbsd) # Don't use this on OpenBSD, it's busted. @@ -29401,7 +29708,7 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_OS2 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/video/os2/*.c" have_video=yes - SUMMARY_video="${SUMMARY_video} os/2" + SUMMARY_video="${SUMMARY_video} OS/2" fi # Set up files for the audio library if test x$enable_audio = xyes; then @@ -29410,7 +29717,7 @@ printf "%s\n" "#define SDL_AUDIO_DRIVER_OS2 1" >>confdefs.h SOURCES="$SOURCES $srcdir/src/audio/os2/*.c" have_audio=yes - SUMMARY_audio="${SUMMARY_audio} os/2" + SUMMARY_audio="${SUMMARY_audio} OS/2" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmmpm2" fi # Set up files for the thread library @@ -29800,6 +30107,8 @@ done +PKGCONFIG_DEPENDS="" + if test x$enable_shared = xyes; then PKGCONFIG_LIBS_PRIV=" Libs.private:" diff --git a/configure.ac b/configure.ac index cc30f9a164ba5..cd58faa21acda 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_PREREQ([2.63]) +AC_PREREQ([2.65]) AC_INIT AC_CONFIG_SRCDIR([src/SDL.c]) AC_CONFIG_HEADERS([include/SDL_config.h]) @@ -12,7 +12,7 @@ orig_CFLAGS="$CFLAGS" dnl Set various version strings - taken gratefully from the GTk sources # See docs/release_checklist.md SDL_MAJOR_VERSION=2 -SDL_MINOR_VERSION=26 +SDL_MINOR_VERSION=33 SDL_MICRO_VERSION=0 SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION @@ -62,6 +62,7 @@ AC_PROG_AWK AC_PROG_CC AC_PROG_CXX AC_PROG_EGREP +AC_PROG_FGREP AC_PROG_INSTALL AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG @@ -180,8 +181,8 @@ base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` dnl Function to find a library in the compiler search path find_lib() { - gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] - gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] + gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] + gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | $FGREP libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`] if test "$cross_compiling" = yes; then host_lib_path="" @@ -318,10 +319,20 @@ AC_ARG_ENABLE(libc, [AS_HELP_STRING([--enable-libc], [Use the system C library [default=yes]])], , enable_libc=yes) -dnl See whether we are allowed to use libiconv +dnl See whether we are allowed to use system iconv +enable_system_iconv_default=yes +case "$host" in + *-*-cygwin*|*-*-mingw*|*-*-darwin*|*-ios-*) + enable_system_iconv_default=no + ;; +esac AC_ARG_ENABLE(system-iconv, -[AS_HELP_STRING([--enable-system-iconv], [Use iconv() from system-installed libraries [default=yes]])], - , enable_system_iconv=yes) +[AS_HELP_STRING([--enable-system-iconv], [Use iconv() from system-installed libraries [default=no for windows, yes for others]])], + , enable_system_iconv=$enable_system_iconv_default) +dnl See whether we prefer libiconv over libc +AC_ARG_ENABLE(libiconv, +[AS_HELP_STRING([--enable-libiconv], [Prefer iconv() from libiconv, if available, over libc version [default=no]])], + , enable_libiconv=no) if test x$enable_libc = xyes; then AC_DEFINE(HAVE_LIBC, 1, [ ]) @@ -329,7 +340,7 @@ if test x$enable_libc = xyes; then dnl Check for C library headers dnl AC_CHECK_INCLUDES_DEFAULT is an autoconf-2.7x thing where AC_HEADER_STDC is deprecated. m4_ifdef([AC_CHECK_INCLUDES_DEFAULT], [AC_CHECK_INCLUDES_DEFAULT], [AC_HEADER_STDC]) - AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h linux/input.h) + AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h wchar.h inttypes.h stdint.h limits.h ctype.h math.h float.h iconv.h signal.h) dnl Check for typedefs, structures, etc. AC_TYPE_SIZE_T @@ -348,14 +359,52 @@ dnl Checks for library functions. AC_DEFINE(HAVE_MPROTECT, 1, [ ]) ],[]), ) - AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit) + AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction sigtimedwait setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit) AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf) if test x$enable_system_iconv = xyes; then - AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) - AC_CHECK_FUNCS(iconv) + AC_MSG_CHECKING(for iconv in libc) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #define LIBICONV_PLUG 1 /* in case libiconv header is in include path */ + #include + #include + ]],[[ + iconv_open(NULL,NULL); + ]])], [have_libc_iconv=yes],[have_libc_iconv=no]) + AC_MSG_RESULT($have_libc_iconv) + + AC_MSG_CHECKING(for iconv in libiconv) + save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]],[[ + iconv_open(NULL,NULL); + ]])], [have_libiconv=yes],[have_libiconv=no]) + LIBS="$save_LIBS" + AC_MSG_RESULT($have_libiconv) + + if test x$have_libc_iconv = xyes || test x$have_libiconv = xyes; then + AC_DEFINE(HAVE_ICONV,1,[ ]) + + if test x$have_libiconv = xyes; then + if test x$have_libc_iconv != xyes; then + use_libiconv=yes + elif test x$enable_libiconv = xyes; then + use_libiconv=yes + fi + fi + if test x$use_libiconv = xyes; then + AC_DEFINE(SDL_USE_LIBICONV,1,[ ]) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv" + echo "-- Using iconv from libiconv" + else + echo "-- Using iconv from libc" + fi + fi fi AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE([HAVE_SA_SIGACTION], 1, [ ])], ,[#include ]) @@ -649,8 +698,8 @@ dnl Check for various instruction support fi AC_ARG_ENABLE(3dnow, -[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=yes]])], - , enable_3dnow=yes) +[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=no]])], + , enable_3dnow=no) if test x$enable_3dnow = xyes; then save_CFLAGS="$CFLAGS" have_gcc_3dnow=no @@ -857,69 +906,37 @@ dnl Check for various instruction support fi fi - AC_ARG_ENABLE(lsx, +AC_ARG_ENABLE(lsx, [AS_HELP_STRING([--enable-lsx], [use LSX assembly routines [default=yes]])], , enable_lsx=yes) - if test x$enable_lsx = xyes; then - save_CFLAGS="$CFLAGS" - have_gcc_lsx=no - AC_MSG_CHECKING(for GCC -mlsx option) - lsx_CFLAGS="-mlsx" - CFLAGS="$save_CFLAGS $lsx_CFLAGS" - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #ifndef __loongarch_sx - #error Assembler CPP flag not enabled - #endif - ]], [])], [have_gcc_lsx=yes], []) - AC_MSG_RESULT($have_gcc_lsx) - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_lsx = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS" - SUMMARY_math="${SUMMARY_math} lsx" - fi - fi - - AC_MSG_CHECKING(for lsxintrin.h) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], - [have_lsxintrin_h_hdr=yes],[have_lsxintrin_h_hdr=no]) - AC_MSG_RESULT($have_lsxintrin_h_hdr) - if test x$have_lsxintrin_h_hdr = xyes; then - AC_DEFINE(HAVE_LSXINTRIN_H, 1, [ ]) - fi - - AC_ARG_ENABLE(lasx, -[AS_HELP_STRING([--enable-lasx], [use LASX assembly routines [default=yes]])], - , enable_LASX=yes) - if test x$enable_LASX = xyes; then - save_CFLAGS="$CFLAGS" - have_gcc_lasx=no - AC_MSG_CHECKING(for GCC -mlasx option) - lasx_CFLAGS="-mlasx" - CFLAGS="$save_CFLAGS $lasx_CFLAGS" +if test x$enable_lsx = xyes; then + save_CFLAGS="$CFLAGS" + have_gcc_lsx=no + AC_MSG_CHECKING(for GCC -mlsx option) + lsx_CFLAGS="-mlsx" + CFLAGS="$save_CFLAGS $lsx_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #ifndef __loongarch_asx - #error Assembler CPP flag not enabled - #endif - ]], [])], [have_gcc_lasx=yes], []) - AC_MSG_RESULT($have_gcc_lasx) - CFLAGS="$save_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifndef __loongarch_sx + #error Assembler CPP flag not enabled + #endif + ]], [])], [have_gcc_lsx=yes], []) + AC_MSG_RESULT($have_gcc_lsx) + CFLAGS="$save_CFLAGS" - if test x$have_gcc_lasx = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS $lasx_CFLAGS" - SUMMARY_math="${SUMMARY_math} lasx" - fi + if test x$have_gcc_lsx = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS $lsx_CFLAGS" + SUMMARY_math="${SUMMARY_math} lsx" fi +fi - AC_MSG_CHECKING(for lasxintrin.h) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], - [have_lasxintrin_h_hdr=yes],[have_lasxintrin_h_hdr=no]) - AC_MSG_RESULT($have_lasxintrin_h_hdr) - if test x$have_lasxintrin_h_hdr = xyes; then - AC_DEFINE(HAVE_LASXINTRIN_H, 1, [ ]) - fi +AC_MSG_CHECKING(for lsxintrin.h) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], + [have_lsxintrin_h_hdr=yes],[have_lsxintrin_h_hdr=no]) +AC_MSG_RESULT($have_lsxintrin_h_hdr) +if test x$have_lsxintrin_h_hdr = xyes; then + AC_DEFINE(HAVE_LSXINTRIN_H, 1, [ ]) +fi dnl See if the OSS audio interface is supported CheckOSS() @@ -1121,13 +1138,13 @@ CheckPulseAudio() [AS_HELP_STRING([--enable-pulseaudio], [use PulseAudio [default=yes]])], , enable_pulseaudio=yes) if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then - PKG_CHECK_MODULES([PULSEAUDIO], [libpulse-simple >= 0.9], audio_pulseaudio=yes, audio_pulseaudio=no) + PKG_CHECK_MODULES([PULSEAUDIO], [libpulse >= 0.9.15], audio_pulseaudio=yes, audio_pulseaudio=no) if test x$audio_pulseaudio = xyes; then AC_ARG_ENABLE(pulseaudio-shared, [AS_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [default=yes]])], , enable_pulseaudio_shared=yes) - pulseaudio_lib=[`find_lib "libpulse-simple.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] + pulseaudio_lib=[`find_lib "libpulse.so.*" "$PULSEAUDIO_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`] AC_DEFINE(SDL_AUDIO_DRIVER_PULSEAUDIO, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/pulseaudio/*.c" @@ -1138,7 +1155,7 @@ CheckPulseAudio() fi if test x$have_loadso = xyes && \ test x$enable_pulseaudio_shared = xyes && test x$pulseaudio_lib != x; then - echo "-- dynamic libpulse-simple -> $pulseaudio_lib" + echo "-- dynamic libpulse -> $pulseaudio_lib" AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC, "$pulseaudio_lib", [ ]) SUMMARY_audio="${SUMMARY_audio} pulse(dynamic)" @@ -1230,7 +1247,6 @@ CheckNAS() have_nas=yes NAS_CFLAGS="-I/usr/X11R6/include/" NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt" - fi AC_MSG_RESULT($have_nas) @@ -1557,26 +1573,6 @@ CheckNoStrictAliasing() fi } -dnl See if GCC's -mpreferred-stack-boundary is supported. -dnl Reference: http://bugzilla.libsdl.org/show_bug.cgi?id=1296 -CheckStackBoundary() -{ - AC_MSG_CHECKING(for GCC -mpreferred-stack-boundary option) - have_gcc_preferred_stack_boundary=no - - save_CFLAGS="$CFLAGS" - CFLAGS="$save_CFLAGS -mpreferred-stack-boundary=2" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - int x = 0; - ]],[])], [have_gcc_preferred_stack_boundary=yes],[]) - AC_MSG_RESULT($have_gcc_preferred_stack_boundary) - CFLAGS="$save_CFLAGS" - - if test x$have_gcc_preferred_stack_boundary = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2" - fi -} - dnl See if GCC's -Werror is supported. CheckWerror() { @@ -1673,6 +1669,27 @@ dnl Haiku headers use multicharacter constants all over the place. Ignore these fi } +dnl See if GCC's -Wunused-local-typedefs is supported and disable it +dnl because it triggers on gcc 4.8.4 for compile time asserts inside +dnl of functions. +CheckUnusedLocalTypedefs() +{ + AC_MSG_CHECKING(for GCC -Wunused-local-typedefs option) + have_gcc_unused_local_typedefs=no + + save_CFLAGS="$CFLAGS" + CFLAGS="$save_CFLAGS -Wunused-local-typedefs" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + int x = 0; + ]],[])], [have_gcc_unused_local_typedefs=yes],[]) + AC_MSG_RESULT($have_gcc_unused_local_typedefs) + CFLAGS="$save_CFLAGS" + + if test x$have_gcc_unused_local_typedefs = xyes; then + EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-unused-local-typedefs" + fi +} + dnl Check for Wayland CheckWayland() { @@ -1786,6 +1803,14 @@ dnl See if libdecor is available else EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DECOR_LIBS" fi + + saved_cflags=$CFLAGS + CFLAGS="$CFLAGS $DECOR_CFLAGS" + AC_CHECK_DECLS([libdecor_frame_get_min_content_size, libdecor_frame_get_max_content_size], [libdecor_get_min_max=yes], [ ], [[#include ]]) + if test x$libdecor_get_min_max = xyes; then + AC_DEFINE(SDL_HAVE_LIBDECOR_GET_MIN_MAX, 1, [ ]) + fi + CFLAGS="$saved_cflags" fi fi fi @@ -1822,18 +1847,27 @@ CheckNativeClient() CheckRPI() { AC_ARG_ENABLE(video-rpi, -[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 2/3 video driver [default=yes]])], +[AS_HELP_STRING([--enable-video-rpi], [use Raspberry Pi 0-3 video driver [default=yes]])], , enable_video_rpi=yes) if test x$enable_video = xyes -a x$enable_video_rpi = xyes; then - PKG_CHECK_MODULES([RPI], [bcm_host brcmegl], video_rpi=yes, video_rpi=no) + PKG_CHECK_MODULES([RPI], [bcm_host], video_rpi=yes, video_rpi=no) + PKG_CHECK_MODULES([RPI_EGL], [brcmegl], video_rpi_egl=yes, video_rpi_egl=no) if test x$video_rpi = xno; then if test x$ARCH = xnetbsd; then RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux" - RPI_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host" + RPI_LIBS="-L/usr/pkg/lib -lbcm_host" else RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux" - RPI_LIBS="-Wl,-rpath,/opt/vc/lib -L/opt/vc/lib -lbcm_host" + RPI_LIBS="-L/opt/vc/lib -lbcm_host" + fi + fi + + if test x$video_rpi_egl = xno; then + if test x$ARCH = xnetbsd; then + RPI_EGL_LIBS="-Wl,-R/usr/pkg/lib" + else + RPI_EGL_LIBS="-Wl,-rpath,/opt/vc/lib" fi fi @@ -1841,15 +1875,13 @@ CheckRPI() ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS" # Add the Raspberry Pi compiler flags and libraries - CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_LIBS" + CFLAGS="$CFLAGS $RPI_CFLAGS"; LIBS="$LIBS $RPI_EGL_LIBS $RPI_LIBS" - AC_MSG_CHECKING(for Raspberry Pi 2/3) + AC_MSG_CHECKING(for Raspberry Pi 0-3) have_video_rpi=no AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include - #include ]], [[ - EGL_DISPMANX_WINDOW_T window; bcm_host_init(); ]])], [have_video_rpi=yes],[]) AC_MSG_RESULT($have_video_rpi) @@ -1861,7 +1893,7 @@ CheckRPI() CFLAGS="$CFLAGS $RPI_CFLAGS" SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS" EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_LIBS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS $RPI_EGL_LIBS $RPI_LIBS" SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c" AC_DEFINE(SDL_VIDEO_DRIVER_RPI, 1, [ ]) SUMMARY_video="${SUMMARY_video} rpi" @@ -2710,6 +2742,10 @@ CheckVulkan() #endif ]],[])], [],[enable_video_vulkan=no]) ;; + *-*-solaris*) +dnl Strictly speaking, what's missing here is libxcb. Even without Vulkan support at the OS level, it should still compile if we had that. + enable_video_vulkan=no + ;; *-*-darwin*) save_CFLAGS="$CFLAGS" dnl Work around that we don't have Objective-C support in autoconf @@ -2748,6 +2784,8 @@ dnl See if we can use the new unified event interface in Linux 2.4 CheckInputEvents() { dnl Check for Linux 2.4 unified input event interface support + AC_CHECK_HEADERS(linux/input.h) + AC_MSG_CHECKING(for Linux 2.4 unified input interface) use_input_events=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -3276,9 +3314,6 @@ CheckWINDOWS() ],[]) AC_MSG_RESULT($have_wince) - # This fixes Windows stack alignment with newer GCC - CheckStackBoundary - # headers needed elsewhere AC_CHECK_HEADER(tpcshrd.h,have_tpcshrd_h=yes) if test x$have_tpcshrd_h = xyes; then @@ -3318,17 +3353,14 @@ CheckDIRECTX() if test x$enable_directx = xyes; then AC_CHECK_HEADER(d3d9.h, have_d3d=yes) AC_CHECK_HEADER(d3d11_1.h, have_d3d11=yes) - AC_MSG_CHECKING(for d3d12 Windows SDK version) + AC_MSG_CHECKING(for compatible d3d12 headers) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include #include +#include ID3D12Device1 *device; -#if WDK_NTDDI_VERSION <= 0x0A000008 -asdf -#endif ]])], [have_d3d12=yes],[have_d3d12=no]) AC_MSG_RESULT($have_d3d12) + AC_CHECK_HEADER(ddraw.h, have_ddraw=yes) AC_CHECK_HEADER(dsound.h, have_dsound=yes) AC_CHECK_HEADER(dinput.h, have_dinput=yes) @@ -3360,33 +3392,10 @@ asdf [AS_HELP_STRING([--enable-xinput], [use Xinput for Windows [default=yes]])], , enable_xinput=yes) if test x$enable_xinput = xyes; then - have_xinput_gamepadex=no - have_xinput_stateex=no AC_CHECK_HEADER(xinput.h, have_xinput=yes) - AC_MSG_CHECKING(for struct XINPUT_GAMEPAD_EX) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -XINPUT_GAMEPAD_EX x1; - ]],[])], [have_xinput_gamepadex=yes],[]) - AC_MSG_RESULT($have_xinput_gamepadex) - AC_MSG_CHECKING(for struct XINPUT_STATE_EX) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -XINPUT_STATE_EX s1; - ]],[])], [have_xinput_stateex=yes],[]) - AC_MSG_RESULT($have_xinput_stateex) - if test x$have_xinput = xyes; then AC_DEFINE(HAVE_XINPUT_H, 1, [ ]) fi - if test x$have_xinput_gamepadex = xyes; then - AC_DEFINE(HAVE_XINPUT_GAMEPAD_EX, 1, [ ]) - fi - if test x$have_xinput_stateex = xyes; then - AC_DEFINE(HAVE_XINPUT_STATE_EX, 1, [ ]) - fi fi AC_MSG_CHECKING(for windows.gaming.input.h) @@ -3607,7 +3616,7 @@ CheckHIDAPI() enable_hidapi_libusb=yes require_hidapi_libusb=yes ;; - *-*-os2* ) + *-*-os2* ) enable_hidapi_libusb=yes ;; esac @@ -3626,7 +3635,7 @@ CheckHIDAPI() if test x$hidapi_support = xyes; then if test x$have_libusb_h = xyes; then - AC_DEFINE(HAVE_LIBUSB) + AC_DEFINE(HAVE_LIBUSB, 1, [ ]) EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS" if test x$require_hidapi_libusb = xyes; then EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS" @@ -3672,15 +3681,14 @@ CheckClockGettime() [AS_HELP_STRING([--enable-clock_gettime], [use clock_gettime() instead of gettimeofday() on UNIX [default=yes]])], , enable_clock_gettime=yes) if test x$enable_clock_gettime = xyes; then - AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes) + AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes) if test x$have_clock_gettime = xyes; then - AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) else - AC_CHECK_LIB(c, clock_gettime, have_clock_gettime=yes) + AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes) if test x$have_clock_gettime = xyes; then - AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) - EXTRA_LDFLAGS="$EXTRA_LDFLAGS" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt" + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [ ]) fi fi fi @@ -3738,6 +3746,7 @@ CheckVirtualJoystick() dnl Do this on all platforms, before everything else (other things might want to override it). CheckWarnAll +CheckUnusedLocalTypedefs CheckNoStrictAliasing dnl Do this for every platform, but for some it doesn't mean anything, but better to catch it here anyhow. @@ -3859,10 +3868,14 @@ case "$host" in if test x$enable_audio = xyes; then case $ARCH in sysv5|solaris|hpux) - AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ]) - SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" - SUMMARY_audio="${SUMMARY_audio} sun" - have_audio=yes + # Newer Solaris-based systems, like OpenIndiana, don't have this interface anymore. Check for the header first. + AC_CHECK_HEADER(sys/audioio.h, have_sys_audioio_h=yes, have_sys_audioio_h=no) + if test x$have_sys_audioio_h = xyes; then + AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO, 1, [ ]) + SOURCES="$SOURCES $srcdir/src/audio/sun/*.c" + SUMMARY_audio="${SUMMARY_audio} sun" + have_audio=yes + fi ;; netbsd) # Don't use this on OpenBSD, it's busted. AC_DEFINE(SDL_AUDIO_DRIVER_NETBSD, 1, [ ]) @@ -4618,14 +4631,14 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan. AC_DEFINE(SDL_VIDEO_DRIVER_OS2, 1, [ ]) SOURCES="$SOURCES $srcdir/src/video/os2/*.c" have_video=yes - SUMMARY_video="${SUMMARY_video} os/2" + SUMMARY_video="${SUMMARY_video} OS/2" fi # Set up files for the audio library if test x$enable_audio = xyes; then AC_DEFINE(SDL_AUDIO_DRIVER_OS2, 1, [ ]) SOURCES="$SOURCES $srcdir/src/audio/os2/*.c" have_audio=yes - SUMMARY_audio="${SUMMARY_audio} os/2" + SUMMARY_audio="${SUMMARY_audio} OS/2" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmmpm2" fi # Set up files for the thread library @@ -4860,6 +4873,8 @@ AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AC_SUBST(SDL_STATIC_LIBS) AC_SUBST(SDL_RLD_FLAGS) +PKGCONFIG_DEPENDS="" +AC_SUBST(PKGCONFIG_DEPENDS) if test x$enable_shared = xyes; then PKGCONFIG_LIBS_PRIV=" Libs.private:" diff --git a/docs/README-android.md b/docs/README-android.md index a247e5721021d..6b4307839102a 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -1,475 +1,483 @@ -Android -================================================================================ - -Matt Styles wrote a tutorial on building SDL for Android with Visual Studio: -http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html - -The rest of this README covers the Android gradle style build process. - -If you are using the older ant build process, it is no longer officially -supported, but you can use the "android-project-ant" directory as a template. - - -Requirements -================================================================================ - -Android SDK (version 31 or later) -https://developer.android.com/sdk/index.html - -Android NDK r15c or later -https://developer.android.com/tools/sdk/ndk/index.html - -Minimum API level supported by SDL: 16 (Android 4.1) - - -How the port works -================================================================================ - -- Android applications are Java-based, optionally with parts written in C -- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to - the SDL library -- This means that your application C code must be placed inside an Android - Java project, along with some C support code that communicates with Java -- This eventually produces a standard Android .apk package - -The Android Java code implements an "Activity" and can be found in: -android-project/app/src/main/java/org/libsdl/app/SDLActivity.java - -The Java code loads your game code, the SDL shared library, and -dispatches to native functions implemented in the SDL library: -src/core/android/SDL_android.c - - -Building an app -================================================================================ - -For simple projects you can use the script located at build-scripts/androidbuild.sh - -There's two ways of using it: - - androidbuild.sh com.yourcompany.yourapp < sources.list - androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c - -sources.list should be a text file with a source file name in each line -Filenames should be specified relative to the current directory, for example if -you are in the build-scripts directory and want to create the testgles.c test, you'll -run: - - ./androidbuild.sh org.libsdl.testgles ../test/testgles.c - -One limitation of this script is that all sources provided will be aggregated into -a single directory, thus all your source files should have a unique name. - -Once the project is complete the script will tell you where the debug APK is located. -If you want to create a signed release APK, you can use the project created by this -utility to generate it. - -Finally, a word of caution: re running androidbuild.sh wipes any changes you may have -done in the build directory for the app! - - -For more complex projects, follow these instructions: - -1. Copy the android-project directory wherever you want to keep your projects - and rename it to the name of your project. -2. Move or symlink this SDL directory into the "/app/jni" directory -3. Edit "/app/jni/src/Android.mk" to include your source files - -4a. If you want to use Android Studio, simply open your directory and start building. - -4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device - - -If you already have a project that uses CMake, the instructions change somewhat: - -1. Do points 1 and 2 from the instruction above. -2. Edit "/app/build.gradle" to comment out or remove sections containing ndk-build - and uncomment the cmake sections. Add arguments to the CMake invocation as needed. -3. Edit "/app/jni/CMakeLists.txt" to include your project (it defaults to - adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static - as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)" - in your CMakeLists.txt file. Also be aware that you should use add_library() instead of - add_executable() for the target containing your "main" function. - -If you wish to use Android Studio, you can skip the last step. - -4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any - connected Android device - -Here's an explanation of the files in the Android project, so you can customize them: - - android-project/app - build.gradle - build info including the application version and SDK - src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application. - jni/ - directory holding native code - jni/Application.mk - Application JNI settings, including target platform and STL library - jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories - jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject - jni/SDL/ - (symlink to) directory holding the SDL library files - jni/SDL/Android.mk - Android makefile for creating the SDL shared library - jni/src/ - directory holding your C/C++ source - jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references - jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references - src/main/assets/ - directory holding asset files for your application - src/main/res/ - directory holding resources for your application - src/main/res/mipmap-* - directories holding icons for different phone hardware - src/main/res/values/strings.xml - strings used in your application, including the application name - src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application. - - -Customizing your application name -================================================================================ - -To customize your application name, edit AndroidManifest.xml and replace -"org.libsdl.app" with an identifier for your product package. - -Then create a Java class extending SDLActivity and place it in a directory -under src matching your package, e.g. - - src/com/gamemaker/game/MyGame.java - -Here's an example of a minimal class file: - - --- MyGame.java -------------------------- - package com.gamemaker.game; - - import org.libsdl.app.SDLActivity; - - /** - * A sample wrapper class that just calls SDLActivity - */ - - public class MyGame extends SDLActivity { } - - ------------------------------------------ - -Then replace "SDLActivity" in AndroidManifest.xml with the name of your -class, .e.g. "MyGame" - - -Customizing your application icon -================================================================================ - -Conceptually changing your icon is just replacing the "ic_launcher.png" files in -the drawable directories under the res directory. There are several directories -for different screen sizes. - - -Loading assets -================================================================================ - -Any files you put in the "app/src/main/assets" directory of your project -directory will get bundled into the application package and you can load -them using the standard functions in SDL_rwops.h. - -There are also a few Android specific functions that allow you to get other -useful paths for saving and loading data: -* SDL_AndroidGetInternalStoragePath() -* SDL_AndroidGetExternalStorageState() -* SDL_AndroidGetExternalStoragePath() - -See SDL_system.h for more details on these functions. - -The asset packaging system will, by default, compress certain file extensions. -SDL includes two asset file access mechanisms, the preferred one is the so -called "File Descriptor" method, which is faster and doesn't involve the Dalvik -GC, but given this method does not work on compressed assets, there is also the -"Input Stream" method, which is automatically used as a fall back by SDL. You -may want to keep this fact in mind when building your APK, specially when large -files are involved. -For more information on which extensions get compressed by default and how to -disable this behaviour, see for example: - -http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/ - - -Pause / Resume behaviour -================================================================================ - -If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default), -the event loop will block itself when the app is paused (ie, when the user -returns to the main Android dashboard). Blocking is better in terms of battery -use, and it allows your app to spring back to life instantaneously after resume -(versus polling for a resume message). - -Upon resume, SDL will attempt to restore the GL context automatically. -In modern devices (Android 3.0 and up) this will most likely succeed and your -app can continue to operate as it was. - -However, there's a chance (on older hardware, or on systems under heavy load), -where the GL context can not be restored. In that case you have to listen for -a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures -manually or quit the app. - -You should not use the SDL renderer API while the app going in background: -- SDL_APP_WILLENTERBACKGROUND: - after you read this message, GL context gets backed-up and you should not - use the SDL renderer API. - - When this event is received, you have to set the render target to NULL, if you're using it. - (eg call SDL_SetRenderTarget(renderer, NULL)) - -- SDL_APP_DIDENTERFOREGROUND: - GL context is restored, and the SDL renderer API is available (unless you - receive SDL_RENDER_DEVICE_RESET). - -Mouse / Touch events -================================================================================ - -In some case, SDL generates synthetic mouse (resp. touch) events for touch -(resp. mouse) devices. -To enable/disable this behavior, see SDL_hints.h: -- SDL_HINT_TOUCH_MOUSE_EVENTS -- SDL_HINT_MOUSE_TOUCH_EVENTS - -Misc -================================================================================ - -For some device, it appears to works better setting explicitly GL attributes -before creating a window: - SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); - SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6); - SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); - -Threads and the Java VM -================================================================================ - -For a quick tour on how Linux native threads interoperate with the Java VM, take -a look here: https://developer.android.com/guide/practices/jni.html - -If you want to use threads in your SDL app, it's strongly recommended that you -do so by creating them using SDL functions. This way, the required attach/detach -handling is managed by SDL automagically. If you have threads created by other -means and they make calls to SDL functions, make sure that you call -Android_JNI_SetupThread() before doing anything else otherwise SDL will attach -your thread automatically anyway (when you make an SDL call), but it'll never -detach it. - - -If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"), -it won't be able to find your java class and method because of the java class loader -which is different for native threads, than for java threads (eg your "main()"). - -the work-around is to find class/method, in you "main()" thread, and to use them -in your native thread. - -see: -https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class - -Using STL -================================================================================ - -You can use STL in your project by creating an Application.mk file in the jni -folder and adding the following line: - - APP_STL := c++_shared - -For more information go here: - https://developer.android.com/ndk/guides/cpp-support - - -Using the emulator -================================================================================ - -There are some good tips and tricks for getting the most out of the -emulator here: https://developer.android.com/tools/devices/emulator.html - -Especially useful is the info on setting up OpenGL ES 2.0 emulation. - -Notice that this software emulator is incredibly slow and needs a lot of disk space. -Using a real device works better. - - -Troubleshooting -================================================================================ - -You can see if adb can see any devices with the following command: - - adb devices - -You can see the output of log messages on the default device with: - - adb logcat - -You can push files to the device with: - - adb push local_file remote_path_and_file - -You can push files to the SD Card at /sdcard, for example: - - adb push moose.dat /sdcard/moose.dat - -You can see the files on the SD card with a shell command: - - adb shell ls /sdcard/ - -You can start a command shell on the default device with: - - adb shell - -You can remove the library files of your project (and not the SDL lib files) with: - - ndk-build clean - -You can do a build with the following command: - - ndk-build - -You can see the complete command line that ndk-build is using by passing V=1 on the command line: - - ndk-build V=1 - -If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace: - https://developer.android.com/ndk/guides/ndk-stack - -If you want to go through the process manually, you can use addr2line to convert the -addresses in the stack trace to lines in your code. - -For example, if your crash looks like this: - - I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0 - I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4 - I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c - I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c - I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030 - I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so - I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so - I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so - I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so - -You can see that there's a crash in the C library being called from the main code. -I run addr2line with the debug version of my code: - - arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so - -and then paste in the number after "pc" in the call stack, from the line that I care about: -000014bc - -I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23. - -You can add logging to your code to help show what's happening: - - #include - - __android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x); - -If you need to build without optimization turned on, you can create a file called -"Application.mk" in the jni directory, with the following line in it: - - APP_OPTIM := debug - - -Memory debugging -================================================================================ - -The best (and slowest) way to debug memory issues on Android is valgrind. -Valgrind has support for Android out of the box, just grab code using: - - svn co svn://svn.valgrind.org/valgrind/trunk valgrind - -... and follow the instructions in the file README.android to build it. - -One thing I needed to do on Mac OS X was change the path to the toolchain, -and add ranlib to the environment variables: -export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib - -Once valgrind is built, you can create a wrapper script to launch your -application with it, changing org.libsdl.app to your package identifier: - - --- start_valgrind_app ------------------- - #!/system/bin/sh - export TMPDIR=/data/data/org.libsdl.app - exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $* - ------------------------------------------ - -Then push it to the device: - - adb push start_valgrind_app /data/local - -and make it executable: - - adb shell chmod 755 /data/local/start_valgrind_app - -and tell Android to use the script to launch your application: - - adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app" - -If the setprop command says "could not set property", it's likely that -your package name is too long and you should make it shorter by changing -AndroidManifest.xml and the path to your class file in android-project/src - -You can then launch your application normally and waaaaaaaiiittt for it. -You can monitor the startup process with the logcat command above, and -when it's done (or even while it's running) you can grab the valgrind -output file: - - adb pull /sdcard/valgrind.log - -When you're done instrumenting with valgrind, you can disable the wrapper: - - adb shell setprop wrap.org.libsdl.app "" - - -Graphics debugging -================================================================================ - -If you are developing on a compatible Tegra-based tablet, NVidia provides -Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL -and GLES libraries, you must follow their instructions for installing the -interposer library on a rooted device. The non-rooted instructions are not -compatible with applications that use SDL2 for video. - -The Tegra Graphics Debugger is available from NVidia here: -https://developer.nvidia.com/tegra-graphics-debugger - - -Why is API level 16 the minimum required? -================================================================================ - -The latest NDK toolchain doesn't support targeting earlier than API level 16. -As of this writing, according to https://developer.android.com/about/dashboards/index.html -about 99% of the Android devices accessing Google Play support API level 16 or -higher (January 2018). - - -A note regarding the use of the "dirty rectangles" rendering technique -================================================================================ - -If your app uses a variation of the "dirty rectangles" rendering technique, -where you only update a portion of the screen on each frame, you may notice a -variety of visual glitches on Android, that are not present on other platforms. -This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2 -contexts, in particular the use of the eglSwapBuffers function. As stated in the -documentation for the function "The contents of ancillary buffers are always -undefined after calling eglSwapBuffers". -Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED -is not possible for SDL as it requires EGL 1.4, available only on the API level -17+, so the only workaround available on this platform is to redraw the entire -screen each frame. - -Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html - - -Ending your application -================================================================================ - -Two legitimate ways: - -- return from your main() function. Java side will automatically terminate the -Activity by calling Activity.finish(). - -- Android OS can decide to terminate your application by calling onDestroy() -(see Activity life cycle). Your application will receive a SDL_QUIT event you -can handle to save things and quit. - -Don't call exit() as it stops the activity badly. - -NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode -SDLK_AC_BACK, for any purpose. - -Known issues -================================================================================ - -- The number of buttons reported for each joystick is hardcoded to be 36, which -is the current maximum number of buttons Android can report. - +Android +================================================================================ + +Matt Styles wrote a tutorial on building SDL for Android with Visual Studio: +http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html + +The rest of this README covers the Android gradle style build process. + +If you are using the older ant build process, it is no longer officially +supported, but you can use the "android-project-ant" directory as a template. + + +Requirements +================================================================================ + +Android SDK (version 34 or later) +https://developer.android.com/sdk/index.html + +Android NDK r15c or later +https://developer.android.com/tools/sdk/ndk/index.html + +Minimum API level supported by SDL: 19 (Android 4.4) + + +How the port works +================================================================================ + +- Android applications are Java-based, optionally with parts written in C +- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to + the SDL library +- This means that your application C code must be placed inside an Android + Java project, along with some C support code that communicates with Java +- This eventually produces a standard Android .apk package + +The Android Java code implements an "Activity" and can be found in: +android-project/app/src/main/java/org/libsdl/app/SDLActivity.java + +The Java code loads your game code, the SDL shared library, and +dispatches to native functions implemented in the SDL library: +src/core/android/SDL_android.c + + +Building an app +================================================================================ + +For simple projects you can use the script located at build-scripts/androidbuild.sh + +There's two ways of using it: + + androidbuild.sh com.yourcompany.yourapp < sources.list + androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c + +sources.list should be a text file with a source file name in each line +Filenames should be specified relative to the current directory, for example if +you are in the build-scripts directory and want to create the testgles.c test, you'll +run: + + ./androidbuild.sh org.libsdl.testgles ../test/testgles.c + +One limitation of this script is that all sources provided will be aggregated into +a single directory, thus all your source files should have a unique name. + +Once the project is complete the script will tell you where the debug APK is located. +If you want to create a signed release APK, you can use the project created by this +utility to generate it. + +Finally, a word of caution: re running androidbuild.sh wipes any changes you may have +done in the build directory for the app! + + + +For more complex projects, follow these instructions: + +1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT). + + (The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.) + +2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory + +(This is needed as the source of SDL has to be compiled by the Android compiler) + +3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files. + +(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration) + +4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building. + +4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device + + +If you already have a project that uses CMake, the instructions change somewhat: + +1. Do points 1 and 2 from the instruction above. +2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build + and uncomment the cmake sections. Add arguments to the CMake invocation as needed. +3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to + adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static + as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)" + in your CMakeLists.txt file. Also be aware that you should use add_library() instead of + add_executable() for the target containing your "main" function. + +If you wish to use Android Studio, you can skip the last step. + +4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any + connected Android device + +Here's an explanation of the files in the Android project, so you can customize them: + + android-project/app + build.gradle - build info including the application version and SDK + src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application. + jni/ - directory holding native code + jni/Application.mk - Application JNI settings, including target platform and STL library + jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories + jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject + jni/SDL/ - (symlink to) directory holding the SDL library files + jni/SDL/Android.mk - Android makefile for creating the SDL shared library + jni/src/ - directory holding your C/C++ source + jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references + jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references + src/main/assets/ - directory holding asset files for your application + src/main/res/ - directory holding resources for your application + src/main/res/mipmap-* - directories holding icons for different phone hardware + src/main/res/values/strings.xml - strings used in your application, including the application name + src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application. + + +Customizing your application name +================================================================================ + +To customize your application name, edit AndroidManifest.xml and replace +"org.libsdl.app" with an identifier for your product package. + +Then create a Java class extending SDLActivity and place it in a directory +under src matching your package, e.g. + + src/com/gamemaker/game/MyGame.java + +Here's an example of a minimal class file: + + --- MyGame.java -------------------------- + package com.gamemaker.game; + + import org.libsdl.app.SDLActivity; + + /** + * A sample wrapper class that just calls SDLActivity + */ + + public class MyGame extends SDLActivity { } + + ------------------------------------------ + +Then replace "SDLActivity" in AndroidManifest.xml with the name of your +class, .e.g. "MyGame" + + +Customizing your application icon +================================================================================ + +Conceptually changing your icon is just replacing the "ic_launcher.png" files in +the drawable directories under the res directory. There are several directories +for different screen sizes. + + +Loading assets +================================================================================ + +Any files you put in the "app/src/main/assets" directory of your project +directory will get bundled into the application package and you can load +them using the standard functions in SDL_rwops.h. + +There are also a few Android specific functions that allow you to get other +useful paths for saving and loading data: +* SDL_AndroidGetInternalStoragePath() +* SDL_AndroidGetExternalStorageState() +* SDL_AndroidGetExternalStoragePath() + +See SDL_system.h for more details on these functions. + +The asset packaging system will, by default, compress certain file extensions. +SDL includes two asset file access mechanisms, the preferred one is the so +called "File Descriptor" method, which is faster and doesn't involve the Dalvik +GC, but given this method does not work on compressed assets, there is also the +"Input Stream" method, which is automatically used as a fall back by SDL. You +may want to keep this fact in mind when building your APK, specially when large +files are involved. +For more information on which extensions get compressed by default and how to +disable this behaviour, see for example: + +http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/ + + +Pause / Resume behaviour +================================================================================ + +If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default), +the event loop will block itself when the app is paused (ie, when the user +returns to the main Android dashboard). Blocking is better in terms of battery +use, and it allows your app to spring back to life instantaneously after resume +(versus polling for a resume message). + +Upon resume, SDL will attempt to restore the GL context automatically. +In modern devices (Android 3.0 and up) this will most likely succeed and your +app can continue to operate as it was. + +However, there's a chance (on older hardware, or on systems under heavy load), +where the GL context can not be restored. In that case you have to listen for +a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures +manually or quit the app. + +You should not use the SDL renderer API while the app going in background: +- SDL_APP_WILLENTERBACKGROUND: + after you read this message, GL context gets backed-up and you should not + use the SDL renderer API. + + When this event is received, you have to set the render target to NULL, if you're using it. + (eg call SDL_SetRenderTarget(renderer, NULL)) + +- SDL_APP_DIDENTERFOREGROUND: + GL context is restored, and the SDL renderer API is available (unless you + receive SDL_RENDER_DEVICE_RESET). + +Mouse / Touch events +================================================================================ + +In some case, SDL generates synthetic mouse (resp. touch) events for touch +(resp. mouse) devices. +To enable/disable this behavior, see SDL_hints.h: +- SDL_HINT_TOUCH_MOUSE_EVENTS +- SDL_HINT_MOUSE_TOUCH_EVENTS + +Misc +================================================================================ + +For some device, it appears to works better setting explicitly GL attributes +before creating a window: + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); + +Threads and the Java VM +================================================================================ + +For a quick tour on how Linux native threads interoperate with the Java VM, take +a look here: https://developer.android.com/guide/practices/jni.html + +If you want to use threads in your SDL app, it's strongly recommended that you +do so by creating them using SDL functions. This way, the required attach/detach +handling is managed by SDL automagically. If you have threads created by other +means and they make calls to SDL functions, make sure that you call +Android_JNI_SetupThread() before doing anything else otherwise SDL will attach +your thread automatically anyway (when you make an SDL call), but it'll never +detach it. + + +If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"), +it won't be able to find your java class and method because of the java class loader +which is different for native threads, than for java threads (eg your "main()"). + +the work-around is to find class/method, in you "main()" thread, and to use them +in your native thread. + +see: +https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class + +Using STL +================================================================================ + +You can use STL in your project by creating an Application.mk file in the jni +folder and adding the following line: + + APP_STL := c++_shared + +For more information go here: + https://developer.android.com/ndk/guides/cpp-support + + +Using the emulator +================================================================================ + +There are some good tips and tricks for getting the most out of the +emulator here: https://developer.android.com/tools/devices/emulator.html + +Especially useful is the info on setting up OpenGL ES 2.0 emulation. + +Notice that this software emulator is incredibly slow and needs a lot of disk space. +Using a real device works better. + + +Troubleshooting +================================================================================ + +You can see if adb can see any devices with the following command: + + adb devices + +You can see the output of log messages on the default device with: + + adb logcat + +You can push files to the device with: + + adb push local_file remote_path_and_file + +You can push files to the SD Card at /sdcard, for example: + + adb push moose.dat /sdcard/moose.dat + +You can see the files on the SD card with a shell command: + + adb shell ls /sdcard/ + +You can start a command shell on the default device with: + + adb shell + +You can remove the library files of your project (and not the SDL lib files) with: + + ndk-build clean + +You can do a build with the following command: + + ndk-build + +You can see the complete command line that ndk-build is using by passing V=1 on the command line: + + ndk-build V=1 + +If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace: + https://developer.android.com/ndk/guides/ndk-stack + +If you want to go through the process manually, you can use addr2line to convert the +addresses in the stack trace to lines in your code. + +For example, if your crash looks like this: + + I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0 + I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4 + I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c + I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c + I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030 + I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so + I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so + I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so + I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so + +You can see that there's a crash in the C library being called from the main code. +I run addr2line with the debug version of my code: + + arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so + +and then paste in the number after "pc" in the call stack, from the line that I care about: +000014bc + +I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23. + +You can add logging to your code to help show what's happening: + + #include + + __android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x); + +If you need to build without optimization turned on, you can create a file called +"Application.mk" in the jni directory, with the following line in it: + + APP_OPTIM := debug + + +Memory debugging +================================================================================ + +The best (and slowest) way to debug memory issues on Android is valgrind. +Valgrind has support for Android out of the box, just grab code using: + + svn co svn://svn.valgrind.org/valgrind/trunk valgrind + +... and follow the instructions in the file README.android to build it. + +One thing I needed to do on Mac OS X was change the path to the toolchain, +and add ranlib to the environment variables: +export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib + +Once valgrind is built, you can create a wrapper script to launch your +application with it, changing org.libsdl.app to your package identifier: + + --- start_valgrind_app ------------------- + #!/system/bin/sh + export TMPDIR=/data/data/org.libsdl.app + exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $* + ------------------------------------------ + +Then push it to the device: + + adb push start_valgrind_app /data/local + +and make it executable: + + adb shell chmod 755 /data/local/start_valgrind_app + +and tell Android to use the script to launch your application: + + adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app" + +If the setprop command says "could not set property", it's likely that +your package name is too long and you should make it shorter by changing +AndroidManifest.xml and the path to your class file in android-project/src + +You can then launch your application normally and waaaaaaaiiittt for it. +You can monitor the startup process with the logcat command above, and +when it's done (or even while it's running) you can grab the valgrind +output file: + + adb pull /sdcard/valgrind.log + +When you're done instrumenting with valgrind, you can disable the wrapper: + + adb shell setprop wrap.org.libsdl.app "" + + +Graphics debugging +================================================================================ + +If you are developing on a compatible Tegra-based tablet, NVidia provides +Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL +and GLES libraries, you must follow their instructions for installing the +interposer library on a rooted device. The non-rooted instructions are not +compatible with applications that use SDL2 for video. + +The Tegra Graphics Debugger is available from NVidia here: +https://developer.nvidia.com/tegra-graphics-debugger + + +Why is API level 19 the minimum required? +================================================================================ + +The latest NDK toolchain doesn't support targeting earlier than API level 19. +As of this writing, according to https://www.composables.com/tools/distribution-chart +about 99.7% of the Android devices accessing Google Play support API level 19 or +higher (August 2023). + + +A note regarding the use of the "dirty rectangles" rendering technique +================================================================================ + +If your app uses a variation of the "dirty rectangles" rendering technique, +where you only update a portion of the screen on each frame, you may notice a +variety of visual glitches on Android, that are not present on other platforms. +This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2 +contexts, in particular the use of the eglSwapBuffers function. As stated in the +documentation for the function "The contents of ancillary buffers are always +undefined after calling eglSwapBuffers". +Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED +is not possible for SDL as it requires EGL 1.4, available only on the API level +17+, so the only workaround available on this platform is to redraw the entire +screen each frame. + +Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html + + +Ending your application +================================================================================ + +Two legitimate ways: + +- return from your main() function. Java side will automatically terminate the +Activity by calling Activity.finish(). + +- Android OS can decide to terminate your application by calling onDestroy() +(see Activity life cycle). Your application will receive a SDL_QUIT event you +can handle to save things and quit. + +Don't call exit() as it stops the activity badly. + +NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode +SDLK_AC_BACK, for any purpose. + +Known issues +================================================================================ + +- The number of buttons reported for each joystick is hardcoded to be 36, which +is the current maximum number of buttons Android can report. + diff --git a/docs/README-cmake.md b/docs/README-cmake.md index b10751c1a3471..205ddbdea54d4 100644 --- a/docs/README-cmake.md +++ b/docs/README-cmake.md @@ -1,163 +1,163 @@ -# CMake - -(www.cmake.org) - -SDL's build system was traditionally based on autotools. Over time, this -approach has suffered from several issues across the different supported -platforms. -To solve these problems, a new build system based on CMake was introduced. -It is developed in parallel to the legacy autotools build system, so users -can experiment with it without complication. - -The CMake build system is supported on the following platforms: - -* FreeBSD -* Linux -* Microsoft Visual C -* MinGW and Msys -* macOS, iOS, and tvOS, with support for XCode -* Android -* Emscripten -* RiscOS -* Playstation Vita - -## Building SDL - -Assuming the source for SDL is located at `~/sdl` -```sh -cd ~ -mkdir build -cd build -cmake ~/sdl -cmake --build . -``` - -This will build the static and dynamic versions of SDL in the `~/build` directory. -Installation can be done using: - -```sh -cmake --install . # '--install' requires CMake 3.15, or newer -``` - -## Including SDL in your project - -SDL can be included in your project in 2 major ways: -- using a system SDL library, provided by your (*nix) distribution or a package manager -- using a vendored SDL library: this is SDL copied or symlinked in a subfolder. - -The following CMake script supports both, depending on the value of `MYGAME_VENDORED`. - -```cmake -cmake_minimum_required(VERSION 3.0) -project(mygame) - -# Create an option to switch between a system sdl library and a vendored sdl library -option(MYGAME_VENDORED "Use vendored libraries" OFF) - -if(MYGAME_VENDORED) - add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL) -else() - # 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found - find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2) - - # 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available - find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main) -endif() - -# Create your game executable target as usual -add_executable(mygame WIN32 mygame.c) - -# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications -if(TARGET SDL2::SDL2main) - # It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static) - target_link_libraries(mygame PRIVATE SDL2::SDL2main) -endif() - -# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary. -target_link_libraries(mygame PRIVATE SDL2::SDL2) -``` - -### A system SDL library - -For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure). - -The following components are available, to be used as an argument of `find_package`. - -| Component name | Description | -|----------------|--------------------------------------------------------------------------------------------| -| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] | -| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target | -| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target | -| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target | - -### Using a vendored SDL - -This only requires a copy of SDL in a subdirectory. - -## CMake configuration options for platforms - -### iOS/tvOS - -CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built -using Xcode or Make, possibly among other build-systems. - -When using a recent version of CMake (3.14+), it should be possible to: - -- build SDL for iOS, both static and dynamic -- build SDL test apps (as iOS/tvOS .app bundles) -- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis) - -To use, set the following CMake variables when running CMake's configuration stage: - -- `CMAKE_SYSTEM_NAME=` (either `iOS` or `tvOS`) -- `CMAKE_OSX_SYSROOT=` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`, - `appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.) -- `CMAKE_OSX_ARCHITECTURES=` (example: "arm64;armv7s;x86_64") - - -#### Examples - -- for iOS-Simulator, using the latest, installed SDK: - - ```bash - cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 - ``` - -- for iOS-Device, using the latest, installed SDK, 64-bit only - - ```bash - cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 - ``` - -- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit - - ```cmake - cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s" - ``` - -- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example): - - ```cmake - cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64 - ``` - -- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles): - - ```cmake - cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 - ``` - -- for tvOS-Simulator, using the latest, installed SDK: - - ```cmake - cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 - ``` - -- for tvOS-Device, using the latest, installed SDK: - - ```cmake - cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64` - ``` - - -[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons. +# CMake + +(www.cmake.org) + +SDL's build system was traditionally based on autotools. Over time, this +approach has suffered from several issues across the different supported +platforms. +To solve these problems, a new build system based on CMake was introduced. +It is developed in parallel to the legacy autotools build system, so users +can experiment with it without complication. + +The CMake build system is supported on the following platforms: + +* FreeBSD +* Linux +* Microsoft Visual C +* MinGW and Msys +* macOS, iOS, and tvOS, with support for XCode +* Android +* Emscripten +* RiscOS +* Playstation Vita + +## Building SDL + +Assuming the source for SDL is located at `~/sdl` +```sh +cd ~ +mkdir build +cd build +cmake ~/sdl +cmake --build . +``` + +This will build the static and dynamic versions of SDL in the `~/build` directory. +Installation can be done using: + +```sh +cmake --install . # '--install' requires CMake 3.15, or newer +``` + +## Including SDL in your project + +SDL can be included in your project in 2 major ways: +- using a system SDL library, provided by your (*nix) distribution or a package manager +- using a vendored SDL library: this is SDL copied or symlinked in a subfolder. + +The following CMake script supports both, depending on the value of `MYGAME_VENDORED`. + +```cmake +cmake_minimum_required(VERSION 3.5) +project(mygame) + +# Create an option to switch between a system sdl library and a vendored sdl library +option(MYGAME_VENDORED "Use vendored libraries" OFF) + +if(MYGAME_VENDORED) + add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL) +else() + # 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found + find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2) + + # 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available + find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main) +endif() + +# Create your game executable target as usual +add_executable(mygame WIN32 mygame.c) + +# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications +if(TARGET SDL2::SDL2main) + # It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static) + target_link_libraries(mygame PRIVATE SDL2::SDL2main) +endif() + +# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary. +target_link_libraries(mygame PRIVATE SDL2::SDL2) +``` + +### A system SDL library + +For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure). + +The following components are available, to be used as an argument of `find_package`. + +| Component name | Description | +|----------------|--------------------------------------------------------------------------------------------| +| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] | +| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target | +| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target | +| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target | + +### Using a vendored SDL + +This only requires a copy of SDL in a subdirectory. + +## CMake configuration options for platforms + +### iOS/tvOS + +CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built +using Xcode or Make, possibly among other build-systems. + +When using a recent version of CMake (3.14+), it should be possible to: + +- build SDL for iOS, both static and dynamic +- build SDL test apps (as iOS/tvOS .app bundles) +- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis) + +To use, set the following CMake variables when running CMake's configuration stage: + +- `CMAKE_SYSTEM_NAME=` (either `iOS` or `tvOS`) +- `CMAKE_OSX_SYSROOT=` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`, + `appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.) +- `CMAKE_OSX_ARCHITECTURES=` (example: "arm64;armv7s;x86_64") + + +#### Examples + +- for iOS-Simulator, using the latest, installed SDK: + + ```bash + cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 + ``` + +- for iOS-Device, using the latest, installed SDK, 64-bit only + + ```bash + cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 + ``` + +- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit + + ```cmake + cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s" + ``` + +- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example): + + ```cmake + cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64 + ``` + +- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles): + + ```cmake + cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 + ``` + +- for tvOS-Simulator, using the latest, installed SDK: + + ```cmake + cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64 + ``` + +- for tvOS-Device, using the latest, installed SDK: + + ```cmake + cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64` + ``` + + +[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons. diff --git a/docs/README-directfb.md b/docs/README-directfb.md index 3b28eef344e2e..c41cab2705e43 100644 --- a/docs/README-directfb.md +++ b/docs/README-directfb.md @@ -1,123 +1,123 @@ -DirectFB -======== - -Supports: - -- Hardware YUV overlays -- OpenGL - software only -- 2D/3D accelerations (depends on directfb driver) -- multiple displays -- windows - -What you need: - -* DirectFB 1.0.1, 1.2.x, 1.3.0 -* Kernel-Framebuffer support: required: vesafb, radeonfb .... -* Mesa 7.0.x - optional for OpenGL - -The `/etc/directfbrc` file should contain the following lines to make -your joystick work and avoid crashes: - -``` -disable-module=joystick -disable-module=cle266 -disable-module=cyber5k -no-linux-input-grab -``` - -To disable to use x11 backend when DISPLAY variable is found use - -``` -export SDL_DIRECTFB_X11_CHECK=0 -``` - -To disable the use of linux input devices, i.e. multimice/multikeyboard support, -use - -``` -export SDL_DIRECTFB_LINUX_INPUT=0 -``` - -To use hardware accelerated YUV-overlays for YUV-textures, use: - -``` -export SDL_DIRECTFB_YUV_DIRECT=1 -``` - -This is disabled by default. It will only support one -YUV texture, namely the first. Every other YUV texture will be -rendered in software. - -In addition, you may use (directfb-1.2.x) - -``` -export SDL_DIRECTFB_YUV_UNDERLAY=1 -``` - -to make the YUV texture an underlay. This will make the cursor to -be shown. - -Simple Window Manager -===================== - -The driver has support for a very, very basic window manager you may -want to use when running with `wm=default`. Use - -``` -export SDL_DIRECTFB_WM=1 -``` - -to enable basic window borders. In order to have the window title rendered, -you need to have the following font installed: - -``` -/usr/share/fonts/truetype/freefont/FreeSans.ttf -``` - -OpenGL Support -============== - -The following instructions will give you *software* OpenGL. However this -works at least on all directfb supported platforms. - -As of this writing 20100802 you need to pull Mesa from git and do the following: - -``` -git clone git://anongit.freedesktop.org/git/mesa/mesa -cd mesa -git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a -``` - -Edit `configs/linux-directfb` so that the Directories-section looks like this: - -``` -# Directories -SRC_DIRS = mesa glu -GLU_DIRS = sgi -DRIVER_DIRS = directfb -PROGRAM_DIRS = -``` - -Then do the following: - -``` -make linux-directfb -make - -echo Installing - please enter sudo pw. - -sudo make install INSTALL_DIR=/usr/local/dfb_GL -cd src/mesa/drivers/directfb -make -sudo make install INSTALL_DIR=/usr/local/dfb_GL -``` - -To run the SDL - testprograms: - -``` -export SDL_VIDEODRIVER=directfb -export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib -export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7 - -./testgl -``` +DirectFB +======== + +Supports: + +- Hardware YUV overlays +- OpenGL - software only +- 2D/3D accelerations (depends on directfb driver) +- multiple displays +- windows + +What you need: + +* DirectFB 1.0.1, 1.2.x, 1.3.0 +* Kernel-Framebuffer support: required: vesafb, radeonfb .... +* Mesa 7.0.x - optional for OpenGL + +The `/etc/directfbrc` file should contain the following lines to make +your joystick work and avoid crashes: + +``` +disable-module=joystick +disable-module=cle266 +disable-module=cyber5k +no-linux-input-grab +``` + +To disable to use x11 backend when DISPLAY variable is found use + +``` +export SDL_DIRECTFB_X11_CHECK=0 +``` + +To disable the use of linux input devices, i.e. multimice/multikeyboard support, +use + +``` +export SDL_DIRECTFB_LINUX_INPUT=0 +``` + +To use hardware accelerated YUV-overlays for YUV-textures, use: + +``` +export SDL_DIRECTFB_YUV_DIRECT=1 +``` + +This is disabled by default. It will only support one +YUV texture, namely the first. Every other YUV texture will be +rendered in software. + +In addition, you may use (directfb-1.2.x) + +``` +export SDL_DIRECTFB_YUV_UNDERLAY=1 +``` + +to make the YUV texture an underlay. This will make the cursor to +be shown. + +Simple Window Manager +===================== + +The driver has support for a very, very basic window manager you may +want to use when running with `wm=default`. Use + +``` +export SDL_DIRECTFB_WM=1 +``` + +to enable basic window borders. In order to have the window title rendered, +you need to have the following font installed: + +``` +/usr/share/fonts/truetype/freefont/FreeSans.ttf +``` + +OpenGL Support +============== + +The following instructions will give you *software* OpenGL. However this +works at least on all directfb supported platforms. + +As of this writing 20100802 you need to pull Mesa from git and do the following: + +``` +git clone git://anongit.freedesktop.org/git/mesa/mesa +cd mesa +git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a +``` + +Edit `configs/linux-directfb` so that the Directories-section looks like this: + +``` +# Directories +SRC_DIRS = mesa glu +GLU_DIRS = sgi +DRIVER_DIRS = directfb +PROGRAM_DIRS = +``` + +Then do the following: + +``` +make linux-directfb +make + +echo Installing - please enter sudo pw. + +sudo make install INSTALL_DIR=/usr/local/dfb_GL +cd src/mesa/drivers/directfb +make +sudo make install INSTALL_DIR=/usr/local/dfb_GL +``` + +To run the SDL - testprograms: + +``` +export SDL_VIDEODRIVER=directfb +export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib +export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7 + +./testgl +``` diff --git a/docs/README-dynapi.md b/docs/README-dynapi.md index 47b726b1df44b..6d447eab6906c 100644 --- a/docs/README-dynapi.md +++ b/docs/README-dynapi.md @@ -1,138 +1,138 @@ -# Dynamic API - -Originally posted on Ryan's Google+ account. - -Background: - -- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2, - but developers are shipping their own SDL2 with individual Steam games. - These games might stop getting updates, but a newer SDL2 might be needed later. - Certainly we'll always be fixing bugs in SDL, even if a new video target isn't - ever needed, and these fixes won't make it to a game shipping its own SDL. -- Even if we replace the SDL2 in those games with a compatible one, that is to - say, edit a developer's Steam depot (yuck!), there are developers that are - statically linking SDL2 that we can't do this for. We can't even force the - dynamic loader to ignore their SDL2 in this case, of course. -- If you don't ship an SDL2 with the game in some form, people that disabled the - Steam Runtime, or just tried to run the game from the command line instead of - Steam might find themselves unable to run the game, due to a missing dependency. -- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target - generic Linux boxes that may or may not have SDL2 installed, you have to ship - the library or risk a total failure to launch. So now, you might have to have - a non-Steam build plus a Steam build (that is, one with and one without SDL2 - included), which is inconvenient if you could have had one universal build - that works everywhere. -- We like the zlib license, but the biggest complaint from the open source - community about the license change is the static linking. The LGPL forced this - as a legal, not technical issue, but zlib doesn't care. Even those that aren't - concerned about the GNU freedoms found themselves solving the same problems: - swapping in a newer SDL to an older game often times can save the day. - Static linking stops this dead. - -So here's what we did: - -SDL now has, internally, a table of function pointers. So, this is what SDL_Init -now looks like: - -```c -UInt32 SDL_Init(Uint32 flags) -{ - return jump_table.SDL_Init(flags); -} -``` - -Except that is all done with a bunch of macro magic so we don't have to maintain -every one of these. - -What is jump_table.SDL_init()? Eventually, that's a function pointer of the real -SDL_Init() that you've been calling all this time. But at startup, it looks more -like this: - -```c -Uint32 SDL_Init_DEFAULT(Uint32 flags) -{ - SDL_InitDynamicAPI(); - return jump_table.SDL_Init(flags); -} -``` - -SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function -pointers, which means that this `_DEFAULT` function never gets called again. -First call to any SDL function sets the whole thing up. - -So you might be asking, what was the value in that? Isn't this what the operating -system's dynamic loader was supposed to do for us? Yes, but now we've got this -level of indirection, we can do things like this: - -```bash -export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0 -./MyGameThatIsStaticallyLinkedToSDL2 -``` - -And now, this game that is statically linked to SDL, can still be overridden -with a newer, or better, SDL. The statically linked one will only be used as -far as calling into the jump table in this case. But in cases where no override -is desired, the statically linked version will provide its own jump table, -and everyone is happy. - -So now: -- Developers can statically link SDL, and users can still replace it. - (We'd still rather you ship a shared library, though!) -- Developers can ship an SDL with their game, Valve can override it for, say, - new features on SteamOS, or distros can override it for their own needs, - but it'll also just work in the default case. -- Developers can ship the same package to everyone (Humble Bundle, GOG, etc), - and it'll do the right thing. -- End users (and Valve) can update a game's SDL in almost any case, - to keep abandoned games running on newer platforms. -- Everyone develops with SDL exactly as they have been doing all along. - Same headers, same ABI. Just get the latest version to enable this magic. - - -A little more about SDL_InitDynamicAPI(): - -Internally, InitAPI does some locking to make sure everything waits until a -single thread initializes everything (although even SDL_CreateThread() goes -through here before spinning a thread, too), and then decides if it should use -an external SDL library. If not, it sets up the jump table using the current -SDL's function pointers (which might be statically linked into a program, or in -a shared library of its own). If so, it loads that library and looks for and -calls a single function: - -```c -SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize); -``` - -That function takes a version number (more on that in a moment), the address of -the jump table, and the size, in bytes, of the table. -Now, we've got policy here: this table's layout never changes; new stuff gets -added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all -the needed functions if tablesize <= sizeof its own jump table. If tablesize is -bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but -if it's smaller, we know we can provide the entire API that the caller needs. - -The version variable is a failsafe switch. -Right now it's always 1. This number changes when there are major API changes -(so we know if the tablesize might be smaller, or entries in it have changed). -Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not -inconceivable to have a small dispatch library that only supplies this one -function and loads different, otherwise-incompatible SDL libraries and has the -right one initialize the jump table based on the version. For something that -must generically catch lots of different versions of SDL over time, like the -Steam Client, this isn't a bad option. - -Finally, I'm sure some people are reading this and thinking, -"I don't want that overhead in my project!" - -To which I would point out that the extra function call through the jump table -probably wouldn't even show up in a profile, but lucky you: this can all be -disabled. You can build SDL without this if you absolutely must, but we would -encourage you not to do that. However, on heavily locked down platforms like -iOS, or maybe when debugging, it makes sense to disable it. The way this is -designed in SDL, you just have to change one #define, and the entire system -vaporizes out, and SDL functions exactly like it always did. Most of it is -macro magic, so the system is contained to one C file and a few headers. -However, this is on by default and you have to edit a header file to turn it -off. Our hopes is that if we make it easy to disable, but not too easy, -everyone will ultimately be able to get what they want, but we've gently -nudged everyone towards what we think is the best solution. +# Dynamic API + +Originally posted on Ryan's Google+ account. + +Background: + +- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2, + but developers are shipping their own SDL2 with individual Steam games. + These games might stop getting updates, but a newer SDL2 might be needed later. + Certainly we'll always be fixing bugs in SDL, even if a new video target isn't + ever needed, and these fixes won't make it to a game shipping its own SDL. +- Even if we replace the SDL2 in those games with a compatible one, that is to + say, edit a developer's Steam depot (yuck!), there are developers that are + statically linking SDL2 that we can't do this for. We can't even force the + dynamic loader to ignore their SDL2 in this case, of course. +- If you don't ship an SDL2 with the game in some form, people that disabled the + Steam Runtime, or just tried to run the game from the command line instead of + Steam might find themselves unable to run the game, due to a missing dependency. +- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target + generic Linux boxes that may or may not have SDL2 installed, you have to ship + the library or risk a total failure to launch. So now, you might have to have + a non-Steam build plus a Steam build (that is, one with and one without SDL2 + included), which is inconvenient if you could have had one universal build + that works everywhere. +- We like the zlib license, but the biggest complaint from the open source + community about the license change is the static linking. The LGPL forced this + as a legal, not technical issue, but zlib doesn't care. Even those that aren't + concerned about the GNU freedoms found themselves solving the same problems: + swapping in a newer SDL to an older game often times can save the day. + Static linking stops this dead. + +So here's what we did: + +SDL now has, internally, a table of function pointers. So, this is what SDL_Init +now looks like: + +```c +Uint32 SDL_Init(Uint32 flags) +{ + return jump_table.SDL_Init(flags); +} +``` + +Except that is all done with a bunch of macro magic so we don't have to maintain +every one of these. + +What is jump_table.SDL_init()? Eventually, that's a function pointer of the real +SDL_Init() that you've been calling all this time. But at startup, it looks more +like this: + +```c +Uint32 SDL_Init_DEFAULT(Uint32 flags) +{ + SDL_InitDynamicAPI(); + return jump_table.SDL_Init(flags); +} +``` + +SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function +pointers, which means that this `_DEFAULT` function never gets called again. +First call to any SDL function sets the whole thing up. + +So you might be asking, what was the value in that? Isn't this what the operating +system's dynamic loader was supposed to do for us? Yes, but now we've got this +level of indirection, we can do things like this: + +```bash +export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0 +./MyGameThatIsStaticallyLinkedToSDL2 +``` + +And now, this game that is statically linked to SDL, can still be overridden +with a newer, or better, SDL. The statically linked one will only be used as +far as calling into the jump table in this case. But in cases where no override +is desired, the statically linked version will provide its own jump table, +and everyone is happy. + +So now: +- Developers can statically link SDL, and users can still replace it. + (We'd still rather you ship a shared library, though!) +- Developers can ship an SDL with their game, Valve can override it for, say, + new features on SteamOS, or distros can override it for their own needs, + but it'll also just work in the default case. +- Developers can ship the same package to everyone (Humble Bundle, GOG, etc), + and it'll do the right thing. +- End users (and Valve) can update a game's SDL in almost any case, + to keep abandoned games running on newer platforms. +- Everyone develops with SDL exactly as they have been doing all along. + Same headers, same ABI. Just get the latest version to enable this magic. + + +A little more about SDL_InitDynamicAPI(): + +Internally, InitAPI does some locking to make sure everything waits until a +single thread initializes everything (although even SDL_CreateThread() goes +through here before spinning a thread, too), and then decides if it should use +an external SDL library. If not, it sets up the jump table using the current +SDL's function pointers (which might be statically linked into a program, or in +a shared library of its own). If so, it loads that library and looks for and +calls a single function: + +```c +Sint32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize); +``` + +That function takes a version number (more on that in a moment), the address of +the jump table, and the size, in bytes, of the table. +Now, we've got policy here: this table's layout never changes; new stuff gets +added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all +the needed functions if tablesize <= sizeof its own jump table. If tablesize is +bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but +if it's smaller, we know we can provide the entire API that the caller needs. + +The version variable is a failsafe switch. +Right now it's always 1. This number changes when there are major API changes +(so we know if the tablesize might be smaller, or entries in it have changed). +Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not +inconceivable to have a small dispatch library that only supplies this one +function and loads different, otherwise-incompatible SDL libraries and has the +right one initialize the jump table based on the version. For something that +must generically catch lots of different versions of SDL over time, like the +Steam Client, this isn't a bad option. + +Finally, I'm sure some people are reading this and thinking, +"I don't want that overhead in my project!" + +To which I would point out that the extra function call through the jump table +probably wouldn't even show up in a profile, but lucky you: this can all be +disabled. You can build SDL without this if you absolutely must, but we would +encourage you not to do that. However, on heavily locked down platforms like +iOS, or maybe when debugging, it makes sense to disable it. The way this is +designed in SDL, you just have to change one #define, and the entire system +vaporizes out, and SDL functions exactly like it always did. Most of it is +macro magic, so the system is contained to one C file and a few headers. +However, this is on by default and you have to edit a header file to turn it +off. Our hopes is that if we make it easy to disable, but not too easy, +everyone will ultimately be able to get what they want, but we've gently +nudged everyone towards what we think is the best solution. diff --git a/docs/README-emscripten.md b/docs/README-emscripten.md index 5f8c277863f3b..cefad99c4ee80 100644 --- a/docs/README-emscripten.md +++ b/docs/README-emscripten.md @@ -1,76 +1,374 @@ -# Emscripten - -(This documentation is not very robust; we will update and expand this later.) - -## A quick note about audio - -Modern web browsers will not permit web pages to produce sound before the -user has interacted with them; this is for several reasons, not the least -of which being that no one likes when a random browser tab suddenly starts -making noise and the user has to scramble to figure out which and silence -it. - -To solve this, most browsers will refuse to let a web app use the audio -subsystem at all before the user has interacted with (clicked on) the page -in a meaningful way. SDL-based apps also have to deal with this problem; if -the user hasn't interacted with the page, SDL_OpenAudioDevice will fail. - -There are two reasonable ways to deal with this: if you are writing some -sort of media player thing, where the user expects there to be a volume -control when you mouseover the canvas, just default that control to a muted -state; if the user clicks on the control to unmute it, on this first click, -open the audio device. This allows the media to play at start, the user can -reasonably opt-in to listening, and you never get access denied to the audio -device. - -Many games do not have this sort of UI, and are more rigid about starting -audio along with everything else at the start of the process. For these, your -best bet is to write a little Javascript that puts up a "Click here to play!" -UI, and upon the user clicking, remove that UI and then call the Emscripten -app's main() function. As far as the application knows, the audio device was -available to be opened as soon as the program started, and since this magic -happens in a little Javascript, you don't have to change your C/C++ code at -all to make it happen. - -Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385 -for some Javascript code to steal for this approach. - - -## Building SDL/emscripten - -SDL currently requires at least Emscripten 2.0.32 to build. Newer versions -are likely to work, as well. - - -Build: - - $ mkdir build - $ cd build - $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2" - $ emmake make - -Or with cmake: - - $ mkdir build - $ cd build - $ emcmake cmake .. - $ emmake make - -To build one of the tests: - - $ cd test/ - $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html - -Uses GLES2 renderer or software - -Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere): - -SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): - - $ EMCONFIGURE_JS=1 emconfigure ../configure - build as usual... - -SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx): - - $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx - build as usual... +# Emscripten + +## The state of things + +(As of September 2023, but things move quickly and we don't update this +document often.) + +In modern times, all the browsers you probably care about (Chrome, Firefox, +Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some +reasonable base configurations: + +- WebAssembly (don't bother with asm.js any more) +- WebGL (which will look like OpenGL ES 2 or 3 to your app). +- Threads (see caveats, though!) +- Game controllers +- Autoupdating (so you can assume they have a recent version of the browser) + +All this to say we're at the point where you don't have to make a lot of +concessions to get even a fairly complex SDL-based game up and running. + + +## RTFM + +This document is a quick rundown of some high-level details. The +documentation at [emscripten.org](https://emscripten.org/) is vast +and extremely detailed for a wide variety of topics, and you should at +least skim through it at some point. + + +## Porting your app to Emscripten + +Many many things just need some simple adjustments and they'll compile +like any other C/C++ code, as long as SDL was handling the platform-specific +work for your program. + +First, you probably need this in at least one of your source files: + +```c +#ifdef __EMSCRIPTEN__ +#include +#endif +``` + +Second: assembly language code has to go. Replace it with C. You can even use +[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)! + +Third: Middleware has to go. If you have a third-party library you link +against, you either need an Emscripten port of it, or the source code to it +to compile yourself, or you need to remove it. + +Fourth: You still start in a function called main(), but you need to get out of +it and into a function that gets called repeatedly, and returns quickly, +called a mainloop. + +Somewhere in your program, you probably have something that looks like a more +complicated version of this: + +```c +void main(void) +{ + initialize_the_game(); + while (game_is_still_running) { + check_for_new_input(); + think_about_stuff(); + draw_the_next_frame(); + } + deinitialize_the_game(); +} +``` + +This will not work on Emscripten, because the main thread needs to be free +to do stuff and can't sit in this loop forever. So Emscripten lets you set up +a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop). + +```c +static void mainloop(void) /* this will run often, possibly at the monitor's refresh rate */ +{ + if (!game_is_still_running) { + deinitialize_the_game(); + #ifdef __EMSCRIPTEN__ + emscripten_cancel_main_loop(); /* this should "kill" the app. */ + #else + exit(0); + #endif + } + + check_for_new_input(); + think_about_stuff(); + draw_the_next_frame(); +} + +void main(void) +{ + initialize_the_game(); + #ifdef __EMSCRIPTEN__ + emscripten_set_main_loop(mainloop, 0, 1); + #else + while (1) { mainloop(); } + #endif +} +``` + +Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run +`mainloop` over and over until I end the program." The function will +run, and return, freeing the main thread for other tasks, and then +run again when it's time. The `1` parameter does some magic to make +your main() function end immediately; this is useful because you +don't want any shutdown code that might be sitting below this code +to actually run if main() were to continue on, since we're just +getting started. + +There's a lot of little details that are beyond the scope of this +document, but that's the biggest intial set of hurdles to porting +your app to the web. + + +## Do you need threads? + +If you plan to use threads, they work on all major browsers now. HOWEVER, +they bring with them a lot of careful considerations. Rendering _must_ +be done on the main thread. This is a general guideline for many +platforms, but a hard requirement on the web. + +Many other things also must happen on the main thread; often times SDL +and Emscripten make efforts to "proxy" work to the main thread that +must be there, but you have to be careful (and read more detailed +documentation than this for the finer points). + +Even when using threads, your main thread needs to set an Emscripten +mainloop that runs quickly and returns, or things will fail to work +correctly. + +You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html) +for all the finer points. Mostly SDL's thread API will work as expected, +but is built on pthreads, so it shares the same little incompatibilities +that are documented there, such as where you can use a mutex, and when +a thread will start running, etc. + + +IMPORTANT: You have to decide to either build something that uses +threads or something that doesn't; you can't have one build +that works everywhere. This is an Emscripten (or maybe WebAssembly? +Or just web browsers in general?) limitation. If you aren't using +threads, it's easier to not enable them at all, at build time. + +If you use threads, you _have to_ run from a web server that has +[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/) +or your program will fail to start at all. + +If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined +for checking with the C preprocessor, so you can build something +different depending on what sort of build you're compiling. + + +## Audio + +Audio works as expected at the API level, but not exactly like other +platforms. + +You'll only see a single default audio device. Audio capture also works; +if the browser pops up a prompt to ask for permission to access the +microphone, the SDL_OpenAudioDevice call will succeed and start producing +silence at a regular interval. Once the user approves the request, real +audio data will flow. If the user denies it, the app is not informed and +will just continue to receive silence. + +Modern web browsers will not permit web pages to produce sound before the +user has interacted with them (clicked or tapped on them, usually); this is +for several reasons, not the least of which being that no one likes when a +random browser tab suddenly starts making noise and the user has to scramble +to figure out which and silence it. + +SDL will allow you to open the audio device for playback in this +circumstance, and your audio callback will fire, but SDL will throw the audio +data away until the user interacts with the page. This helps apps that depend +on the audio callback to make progress, and also keeps audio playback in sync +once the app is finally allowed to make noise. + +There are two reasonable ways to deal with the silence at the app level: +if you are writing some sort of media player thing, where the user expects +there to be a volume control when you mouseover the canvas, just default +that control to a muted state; if the user clicks on the control to unmute +it, on this first click, open the audio device. This allows the media to +play at start, and the user can reasonably opt-in to listening. + +Many games do not have this sort of UI, and are more rigid about starting +audio along with everything else at the start of the process. For these, your +best bet is to write a little Javascript that puts up a "Click here to play!" +UI, and upon the user clicking, remove that UI and then call the Emscripten +app's main() function. As far as the application knows, the audio device was +available to be opened as soon as the program started, and since this magic +happens in a little Javascript, you don't have to change your C/C++ code at +all to make it happen. + +Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385 +for some Javascript code to steal for this approach. + + +## Rendering + +If you use SDL's 2D render API, it will use GLES2 internally, which +Emscripten will turn into WebGL calls. You can also use OpenGL ES 2 +directly by creating a GL context and drawing into it. + +Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually +present anything on the screen until your return from your mainloop +function. + + +## Building SDL/emscripten + +First: do you _really_ need to build SDL from source? + +If you aren't developing SDL itself, have a desire to mess with its source +code, or need something on the bleeding edge, don't build SDL. Just use +Emscripten's packaged version! + +Compile and link your app with `-sUSE_SDL=2` and it'll use a build of +SDL packaged with Emscripten. This comes from the same source code and +fixes the Emscripten project makes to SDL are generally merged into SDL's +revision control, so often this is much easier for app developers. + +`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL +1.2 instead; if you need SDL 1.2, this might be fine, but we generally +recommend you don't use SDL 1.2 in modern times. + + +If you want to build SDL, though... + +SDL currently requires at least Emscripten 3.1.35 to build. Newer versions +are likely to work, as well. + + +Build: + +This works on Linux/Unix and macOS. Please send comments about Windows. + +Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html) +first, and run `source emsdk_env.sh` at the command line so it finds the +tools. + +(These configure options might be overkill, but this has worked for me.) + +```bash +cd SDL +mkdir build +cd build +emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3" +emmake make -j4 +``` + +If you want to build with thread support, something like this works: + +```bash +emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread" +``` + +Or with cmake: + +```bash +mkdir build +cd build +emcmake cmake .. +emmake make -j4 +``` + +To build one of the tests: + +```bash +cd test/ +emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html +``` + +## Building your app + +You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but +mostly it uses the same command line arguments as Clang. + +Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL, +link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build. + +Usually you would produce a binary like this: + +```bash +gcc -o mygame mygame.c # or whatever +``` + +But for Emscripten, you want to output something else: + +```bash +emcc -o index.html mygame.c +``` + +This will produce several files...support Javascript and WebAssembly (.wasm) +files. The `-o index.html` will produce a simple HTML page that loads and +runs your app. You will (probably) eventually want to replace or customize +that file and do `-o index.js` instead to just build the code pieces. + +If you're working on a program of any serious size, you'll likely need to +link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access +to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb` +or the app will fail to start on iOS browsers, but this might be a bug that +goes away in the future. + + +## Data files + +Your game probably has data files. Here's how to access them. + +Filesystem access works like a Unix filesystem; you have a single directory +tree, possibly interpolated from several mounted locations, no drive letters, +'/' for a path separator. You can access them with standard file APIs like +open() or fopen() or SDL_RWops. You can read or write from the filesystem. + +By default, you probably have a "MEMFS" filesystem (all files are stored in +memory, but access to them is immediate and doesn't need to block). There are +other options, like "IDBFS" (files are stored in a local database, so they +don't need to be in RAM all the time and they can persist between runs of the +program, but access is not synchronous). You can mix and match these file +systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc, +but that's beyond the scope of this document. Please refer to Emscripten's +[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html) +for more info. + +The _easiest_ (but not the best) way to get at your data files is to embed +them in the app itself. Emscripten's linker has support for automating this. + +```bash +emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav +``` + +This will pack ../test/sample.wav in your app, and make it available at +"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available +before your main() function runs, and since it's in MEMFS, you can just +read it like you do on other platforms. `--embed-file` can also accept a +directory to pack an entire tree, and you can specify the argument multiple +times to pack unrelated things into the final installation. + +Note that this is absolutely the best approach if you have a few small +files to include and shouldn't worry about the issue further. However, if you +have hundreds of megabytes and/or thousands of files, this is not so great, +since the user will download it all every time they load your page, and it +all has to live in memory at runtime. + +[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html) +gives other options and details, and is worth a read. + + +## Debugging + +Debugging web apps is a mixed bag. You should compile and link with +`-gsource-map`, which embeds a ton of source-level debugging information into +the build, and make sure _the app source code is available on the web server_, +which is often a scary proposition for various reasons. + +When you debug from the browser's tools and hit a breakpoint, you can step +through the actual C/C++ source code, though, which can be nice. + +If you try debugging in Firefox and it doesn't work well for no apparent +reason, try Chrome, and vice-versa. These tools are still relatively new, +and improving all the time. + +SDL_Log() (or even plain old printf) will write to the Javascript console, +and honestly I find printf-style debugging to be easier than setting up a build +for proper debugging, so use whatever tools work best for you. + + +## Questions? + +Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues). +If something is wrong or unclear, we want to know! + + + diff --git a/docs/README-gdk.md b/docs/README-gdk.md index 5f6b18be3f409..7997c065ba4cd 100644 --- a/docs/README-gdk.md +++ b/docs/README-gdk.md @@ -3,7 +3,7 @@ GDK This port allows SDL applications to run via Microsoft's Game Development Kit (GDK). -Windows (GDK) and Xbox One/Xbox Series (GDKX) are supported. Although most of the Xbox code is included in the public SDL source code, NDA access is required for a small number of source files. If you have access to GDKX, these required Xbox files are posted on the GDK forums [here](https://forums.xboxlive.com/questions/130003/). +Windows (GDK) and Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets. Requirements @@ -11,6 +11,7 @@ Requirements * Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested) * Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022)) +* For Xbox, you will need the corresponding GDKX version (licensed developers only) * To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work. @@ -24,11 +25,17 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers * GDK-specific setup: * Initializing/uninitializing the game runtime, and initializing Xbox Live services * Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue. - + * An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. * Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`). * You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). - + +* Single-player games have some additional features available: + * Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer. + * `SDL_GetPrefPath` still works, but only for single-player titles. + + These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values! + * What doesn't work: * Compilation with anything other than through the included Visual C++ solution file @@ -58,7 +65,7 @@ In your game's existing Visual Studio Solution, go to Build > Configuration Mana Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project. -*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built. +*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built. ### 3. Configuring Project Settings ### @@ -139,6 +146,20 @@ To create the package: 6. Once the package is installed, you can run it from the start menu. 7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox. +Xbox GDKX Setup +--------------------- +In general, the same process in the Windows GDK instructions work. There are just a few additional notes: +* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target +* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target +* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define +* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox) +* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons) +* To create a package, use: + `makepkg pack /f PackageLayout.xml /lt /d . /pd Package` +* To install the package, use: + `xbapp install [PACKAGE].xvc` +* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again +* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets Troubleshooting --------------- diff --git a/docs/README-gesture.md b/docs/README-gesture.md index 7e9f95bc1f96e..ee6a0c541a45c 100644 --- a/docs/README-gesture.md +++ b/docs/README-gesture.md @@ -1,71 +1,71 @@ -Dollar Gestures -=========================================================================== -SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures. - -Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. - -Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID. - -Recording: ----------- -To begin recording on a touch device call: -SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices. - -Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event. -A SDL_DOLLARRECORD event is a dgesture with the following fields: - -* event.dgesture.touchId - the Id of the touch used to record the gesture. -* event.dgesture.gestureId - the unique id of the recorded gesture. - - -Performing: ------------ -As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields: - -* event.dgesture.touchId - the Id of the touch which performed the gesture. -* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke. -* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match. -* event.dgesture.numFingers - the number of fingers used to draw the stroke. - -Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed). - - - -Saving: -------- -To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored. - -To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored. - -Both functions return the number of gestures successfully saved. - - -Loading: --------- -To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file. - -SDL_LoadDollarTemplates returns the number of templates successfully loaded. - - - -=========================================================================== -Multi Gestures -=========================================================================== -SDL provides simple support for pinch/rotate/swipe gestures. -Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields: - -* event.mgesture.touchId - the Id of the touch on which the gesture was performed. -* event.mgesture.x - the normalized x coordinate of the gesture. (0..1) -* event.mgesture.y - the normalized y coordinate of the gesture. (0..1) -* event.mgesture.dTheta - the amount that the fingers rotated during this motion. -* event.mgesture.dDist - the amount that the fingers pinched during this motion. -* event.mgesture.numFingers - the number of fingers used in the gesture. - - -=========================================================================== -Notes -=========================================================================== -For a complete example see test/testgesture.c - -Please direct questions/comments to: - jim.tla+sdl_touch@gmail.com +Dollar Gestures +=========================================================================== +SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures. + +Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up. + +Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID. + +Recording: +---------- +To begin recording on a touch device call: +SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices. + +Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event. +A SDL_DOLLARRECORD event is a dgesture with the following fields: + +* event.dgesture.touchId - the Id of the touch used to record the gesture. +* event.dgesture.gestureId - the unique id of the recorded gesture. + + +Performing: +----------- +As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields: + +* event.dgesture.touchId - the Id of the touch which performed the gesture. +* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke. +* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match. +* event.dgesture.numFingers - the number of fingers used to draw the stroke. + +Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed). + + + +Saving: +------- +To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored. + +To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored. + +Both functions return the number of gestures successfully saved. + + +Loading: +-------- +To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file. + +SDL_LoadDollarTemplates returns the number of templates successfully loaded. + + + +=========================================================================== +Multi Gestures +=========================================================================== +SDL provides simple support for pinch/rotate/swipe gestures. +Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields: + +* event.mgesture.touchId - the Id of the touch on which the gesture was performed. +* event.mgesture.x - the normalized x coordinate of the gesture. (0..1) +* event.mgesture.y - the normalized y coordinate of the gesture. (0..1) +* event.mgesture.dTheta - the amount that the fingers rotated during this motion. +* event.mgesture.dDist - the amount that the fingers pinched during this motion. +* event.mgesture.numFingers - the number of fingers used in the gesture. + + +=========================================================================== +Notes +=========================================================================== +For a complete example see test/testgesture.c + +Please direct questions/comments to: + jim.tla+sdl_touch@gmail.com diff --git a/docs/README-ios.md b/docs/README-ios.md index e13f8baaec9e6..01e595b654c35 100644 --- a/docs/README-ios.md +++ b/docs/README-ios.md @@ -1,307 +1,307 @@ -iOS -====== - -Building the Simple DirectMedia Layer for iOS 9.0+ -============================================================================== - -Requirements: Mac OS X 10.9 or later and the iOS 9.0 or newer SDK. - -Instructions: - -1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode. -2. Select your desired target, and hit build. - - -Using the Simple DirectMedia Layer for iOS -============================================================================== - -1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology. -2. In the main view, delete all files except for Assets and LaunchScreen -3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj -4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name" -5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left -6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS" -7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library. -8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files -9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function. -10. Add any assets that your application needs. -11. Enjoy! - - -TODO: Add information regarding App Store requirements such as icons, etc. - - -Notes -- Retina / High-DPI and window sizes -============================================================================== - -Window and display mode sizes in SDL are in "screen coordinates" (or "points", -in Apple's terminology) rather than in pixels. On iOS this means that a window -created on an iPhone 6 will have a size in screen coordinates of 375 x 667, -rather than a size in pixels of 750 x 1334. All iOS apps are expected to -size their content based on screen coordinates / points rather than pixels, -as this allows different iOS devices to have different pixel densities -(Retina versus non-Retina screens, etc.) without apps caring too much. - -By default SDL will not use the full pixel density of the screen on -Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when -creating your window to enable high-dpi support. - -When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes -will still be in "screen coordinates" rather than pixels, but the window will -have a much greater pixel density when the device supports it, and the -SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on -whether raw OpenGL or the SDL_Render API is used) can be queried to determine -the size in pixels of the drawable screen framebuffer. - -Some OpenGL ES functions such as glViewport expect sizes in pixels rather than -sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an -orthographic projection matrix using the size in screen coordinates -(SDL_GetWindowSize()) can be used in order to display content at the same scale -no matter whether a Retina device is used or not. - - -Notes -- Application events -============================================================================== - -On iOS the application goes through a fixed life cycle and you will get -notifications of state changes via application events. When these events -are delivered you must handle them in an event callback because the OS may -not give you any processing time after the events are delivered. - -e.g. - - int HandleAppEvents(void *userdata, SDL_Event *event) - { - switch (event->type) - { - case SDL_APP_TERMINATING: - /* Terminate the app. - Shut everything down before returning from this function. - */ - return 0; - case SDL_APP_LOWMEMORY: - /* You will get this when your app is paused and iOS wants more memory. - Release as much memory as possible. - */ - return 0; - case SDL_APP_WILLENTERBACKGROUND: - /* Prepare your app to go into the background. Stop loops, etc. - This gets called when the user hits the home button, or gets a call. - */ - return 0; - case SDL_APP_DIDENTERBACKGROUND: - /* This will get called if the user accepted whatever sent your app to the background. - If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops. - When you get this, you have 5 seconds to save all your state or the app will be terminated. - Your app is NOT active at this point. - */ - return 0; - case SDL_APP_WILLENTERFOREGROUND: - /* This call happens when your app is coming back to the foreground. - Restore all your state here. - */ - return 0; - case SDL_APP_DIDENTERFOREGROUND: - /* Restart your loops here. - Your app is interactive and getting CPU again. - */ - return 0; - default: - /* No special processing, add it to the event queue */ - return 1; - } - } - - int main(int argc, char *argv[]) - { - SDL_SetEventFilter(HandleAppEvents, NULL); - - ... run your main loop - - return 0; - } - - -Notes -- Accelerometer as Joystick -============================================================================== - -SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. - -The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. - - -Notes -- OpenGL ES -============================================================================== - -Your SDL application for iOS uses OpenGL ES for video by default. - -OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute(). - -If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. - -Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0. - -OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this: - -- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called. -- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called. -- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called. - -The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h). - - -Notes -- Keyboard -============================================================================== - -The SDL keyboard API has been extended to support on-screen keyboards: - -void SDL_StartTextInput() - -- enables text events and reveals the onscreen keyboard. - -void SDL_StopTextInput() - -- disables text events and hides the onscreen keyboard. - -SDL_bool SDL_IsTextInputActive() - -- returns whether or not text events are enabled (and the onscreen keyboard is visible) - - -Notes -- Mouse -============================================================================== - -iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist - - -Notes -- Reading and Writing files -============================================================================== - -Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory. - -Once your application is installed its directory tree looks like: - - MySDLApp Home/ - MySDLApp.app - Documents/ - Library/ - Preferences/ - tmp/ - -When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences". - -More information on this subject is available here: -http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html - - -Notes -- xcFramework -============================================================================== - -The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform. - -In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package. - -The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac. - -This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes. - -In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this: - -#ifndef SDL_MAIN_HANDLED -#ifdef main -#undef main -#endif - -int -main(int argc, char *argv[]) -{ - return SDL_UIKitRunApp(argc, argv, SDL_main); -} -#endif /* !SDL_MAIN_HANDLED */ - -Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected: - -#include "SDL_main.h" -#include -#include - - -Notes -- iPhone SDL limitations -============================================================================== - -Windows: - Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS). - -Textures: - The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats. - -Loading Shared Objects: - This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h. - - -Notes -- CoreBluetooth.framework -============================================================================== - -SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot -more game controller devices, but it requires permission from the user before -your app will be able to talk to the Bluetooth hardware. "Made For iOS" -branded controllers do not need this as we don't have to speak to them -directly with raw bluetooth, so many apps can live without this. - -You'll need to link with CoreBluetooth.framework and add something like this -to your Info.plist: - -NSBluetoothPeripheralUsageDescription -MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app. - - -Game Center -============================================================================== - -Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using: - - int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); - -This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run. - -e.g. - - extern "C" - void ShowFrame(void*) - { - ... do event handling, frame logic and rendering ... - } - - int main(int argc, char *argv[]) - { - ... initialize game ... - - #if __IPHONEOS__ - // Initialize the Game Center for scoring and matchmaking - InitGameCenter(); - - // Set up the game to run in the window animation callback on iOS - // so that Game Center and so forth works correctly. - SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL); - #else - while ( running ) { - ShowFrame(0); - DelayFrame(); - } - #endif - return 0; - } - - -Deploying to older versions of iOS -============================================================================== - -SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0 - -In order to do that you need to download an older version of Xcode: -https://developer.apple.com/download/more/?name=Xcode - -Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport - -Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES - -Open your project and set your deployment target to the desired version of iOS - -Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController +iOS +====== + +Building the Simple DirectMedia Layer for iOS 9.0+ +============================================================================== + +Requirements: Mac OS X 10.9 or later and the iOS 9.0 or newer SDK. + +Instructions: + +1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode. +2. Select your desired target, and hit build. + + +Using the Simple DirectMedia Layer for iOS +============================================================================== + +1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology. +2. In the main view, delete all files except for Assets and LaunchScreen +3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj +4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name" +5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left +6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS" +7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library. +8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files +9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function. +10. Add any assets that your application needs. +11. Enjoy! + + +TODO: Add information regarding App Store requirements such as icons, etc. + + +Notes -- Retina / High-DPI and window sizes +============================================================================== + +Window and display mode sizes in SDL are in "screen coordinates" (or "points", +in Apple's terminology) rather than in pixels. On iOS this means that a window +created on an iPhone 6 will have a size in screen coordinates of 375 x 667, +rather than a size in pixels of 750 x 1334. All iOS apps are expected to +size their content based on screen coordinates / points rather than pixels, +as this allows different iOS devices to have different pixel densities +(Retina versus non-Retina screens, etc.) without apps caring too much. + +By default SDL will not use the full pixel density of the screen on +Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when +creating your window to enable high-dpi support. + +When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes +will still be in "screen coordinates" rather than pixels, but the window will +have a much greater pixel density when the device supports it, and the +SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on +whether raw OpenGL or the SDL_Render API is used) can be queried to determine +the size in pixels of the drawable screen framebuffer. + +Some OpenGL ES functions such as glViewport expect sizes in pixels rather than +sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an +orthographic projection matrix using the size in screen coordinates +(SDL_GetWindowSize()) can be used in order to display content at the same scale +no matter whether a Retina device is used or not. + + +Notes -- Application events +============================================================================== + +On iOS the application goes through a fixed life cycle and you will get +notifications of state changes via application events. When these events +are delivered you must handle them in an event callback because the OS may +not give you any processing time after the events are delivered. + +e.g. + + int HandleAppEvents(void *userdata, SDL_Event *event) + { + switch (event->type) + { + case SDL_APP_TERMINATING: + /* Terminate the app. + Shut everything down before returning from this function. + */ + return 0; + case SDL_APP_LOWMEMORY: + /* You will get this when your app is paused and iOS wants more memory. + Release as much memory as possible. + */ + return 0; + case SDL_APP_WILLENTERBACKGROUND: + /* Prepare your app to go into the background. Stop loops, etc. + This gets called when the user hits the home button, or gets a call. + */ + return 0; + case SDL_APP_DIDENTERBACKGROUND: + /* This will get called if the user accepted whatever sent your app to the background. + If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops. + When you get this, you have 5 seconds to save all your state or the app will be terminated. + Your app is NOT active at this point. + */ + return 0; + case SDL_APP_WILLENTERFOREGROUND: + /* This call happens when your app is coming back to the foreground. + Restore all your state here. + */ + return 0; + case SDL_APP_DIDENTERFOREGROUND: + /* Restart your loops here. + Your app is interactive and getting CPU again. + */ + return 0; + default: + /* No special processing, add it to the event queue */ + return 1; + } + } + + int main(int argc, char *argv[]) + { + SDL_SetEventFilter(HandleAppEvents, NULL); + + ... run your main loop + + return 0; + } + + +Notes -- Accelerometer as Joystick +============================================================================== + +SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory. + +The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF. + + +Notes -- OpenGL ES +============================================================================== + +Your SDL application for iOS uses OpenGL ES for video by default. + +OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute(). + +If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0. + +Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0. + +OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this: + +- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called. +- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called. +- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called. + +The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h). + + +Notes -- Keyboard +============================================================================== + +The SDL keyboard API has been extended to support on-screen keyboards: + +void SDL_StartTextInput() + -- enables text events and reveals the onscreen keyboard. + +void SDL_StopTextInput() + -- disables text events and hides the onscreen keyboard. + +SDL_bool SDL_IsTextInputActive() + -- returns whether or not text events are enabled (and the onscreen keyboard is visible) + + +Notes -- Mouse +============================================================================== + +iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist + + +Notes -- Reading and Writing files +============================================================================== + +Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory. + +Once your application is installed its directory tree looks like: + + MySDLApp Home/ + MySDLApp.app + Documents/ + Library/ + Preferences/ + tmp/ + +When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences". + +More information on this subject is available here: +http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html + + +Notes -- xcFramework +============================================================================== + +The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform. + +In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package. + +The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac. + +This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes. + +In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this: + +#ifndef SDL_MAIN_HANDLED +#ifdef main +#undef main +#endif + +int +main(int argc, char *argv[]) +{ + return SDL_UIKitRunApp(argc, argv, SDL_main); +} +#endif /* !SDL_MAIN_HANDLED */ + +Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected: + +#include "SDL_main.h" +#include +#include + + +Notes -- iPhone SDL limitations +============================================================================== + +Windows: + Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS). + +Textures: + The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats. + +Loading Shared Objects: + This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h. + + +Notes -- CoreBluetooth.framework +============================================================================== + +SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot +more game controller devices, but it requires permission from the user before +your app will be able to talk to the Bluetooth hardware. "Made For iOS" +branded controllers do not need this as we don't have to speak to them +directly with raw bluetooth, so many apps can live without this. + +You'll need to link with CoreBluetooth.framework and add something like this +to your Info.plist: + +NSBluetoothPeripheralUsageDescription +MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app. + + +Game Center +============================================================================== + +Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using: + + int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); + +This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run. + +e.g. + + extern "C" + void ShowFrame(void*) + { + ... do event handling, frame logic and rendering ... + } + + int main(int argc, char *argv[]) + { + ... initialize game ... + + #ifdef __IPHONEOS__ + // Initialize the Game Center for scoring and matchmaking + InitGameCenter(); + + // Set up the game to run in the window animation callback on iOS + // so that Game Center and so forth works correctly. + SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL); + #else + while ( running ) { + ShowFrame(0); + DelayFrame(); + } + #endif + return 0; + } + + +Deploying to older versions of iOS +============================================================================== + +SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0 + +In order to do that you need to download an older version of Xcode: +https://developer.apple.com/download/more/?name=Xcode + +Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport + +Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES + +Open your project and set your deployment target to the desired version of iOS + +Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController diff --git a/docs/README-linux.md b/docs/README-linux.md index 4634ecd884120..b28690b2d9344 100644 --- a/docs/README-linux.md +++ b/docs/README-linux.md @@ -1,96 +1,96 @@ -Linux -================================================================================ - -By default SDL will only link against glibc, the rest of the features will be -enabled dynamically at runtime depending on the available features on the target -system. So, for example if you built SDL with XRandR support and the target -system does not have the XRandR libraries installed, it will be disabled -at runtime, and you won't get a missing library error, at least with the -default configuration parameters. - - -Build Dependencies --------------------------------------------------------------------------------- - -Ubuntu 18.04, all available features enabled: - - sudo apt-get install build-essential git make autoconf automake libtool \ - pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ - libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ - libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ - libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ - libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev - -Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command line. - -Fedora 35, all available features enabled: - - sudo yum install gcc git-core make cmake autoconf automake libtool \ - alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \ - libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \ - libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \ - systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \ - mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \ - libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \ - libsamplerate-devel pipewire-jack-audio-connection-kit-devel \ - -NOTES: -- This includes all the audio targets except arts and esd, because Ubuntu - (and/or Debian) pulled their packages, but in theory SDL still supports them. - The sndio audio target is also unavailable on Fedora. -- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime - for higher-quality audio resampling. SDL will work without it if the library - is missing, so it's safe to build in support even if the end user doesn't - have this library installed. -- DirectFB isn't included because the configure script (currently) fails to find - it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the - configure script to include DirectFB support. Send patches. :) - - -Joystick does not work --------------------------------------------------------------------------------- - -If you compiled or are using a version of SDL with udev support (and you should!) -there's a few issues that may cause SDL to fail to detect your joystick. To -debug this, start by installing the evtest utility. On Ubuntu/Debian: - - sudo apt-get install evtest - -Then run: - - sudo evtest - -You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX" -Now run: - - cat /dev/input/event/XX - -If you get a permission error, you need to set a udev rule to change the mode of -your device (see below) - -Also, try: - - sudo udevadm info --query=all --name=input/eventXX - -If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it, -you need to set up an udev rule to force this variable. - -A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks -like: - - SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1" - SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1" - -You can set up similar rules for your device by changing the values listed in -idProduct and idVendor. To obtain these values, try: - - sudo udevadm info -a --name=input/eventXX | grep idVendor - sudo udevadm info -a --name=input/eventXX | grep idProduct - -If multiple values come up for each of these, the one you want is the first one of each. - -On other systems which ship with an older udev (such as CentOS), you may need -to set up a rule such as: - - SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1" - +Linux +================================================================================ + +By default SDL will only link against glibc, the rest of the features will be +enabled dynamically at runtime depending on the available features on the target +system. So, for example if you built SDL with XRandR support and the target +system does not have the XRandR libraries installed, it will be disabled +at runtime, and you won't get a missing library error, at least with the +default configuration parameters. + + +Build Dependencies +-------------------------------------------------------------------------------- + +Ubuntu 18.04, all available features enabled: + + sudo apt-get install build-essential git make autoconf automake libtool \ + pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \ + libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \ + libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \ + libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ + libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev + +Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command line. + +Fedora 35, all available features enabled: + + sudo yum install gcc git-core make cmake autoconf automake libtool \ + alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \ + libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \ + libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \ + systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \ + mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \ + libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \ + libsamplerate-devel pipewire-jack-audio-connection-kit-devel \ + +NOTES: +- This includes all the audio targets except arts and esd, because Ubuntu + (and/or Debian) pulled their packages, but in theory SDL still supports them. + The sndio audio target is also unavailable on Fedora. +- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime + for higher-quality audio resampling. SDL will work without it if the library + is missing, so it's safe to build in support even if the end user doesn't + have this library installed. +- DirectFB isn't included because the configure script (currently) fails to find + it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the + configure script to include DirectFB support. Send patches. :) + + +Joystick does not work +-------------------------------------------------------------------------------- + +If you compiled or are using a version of SDL with udev support (and you should!) +there's a few issues that may cause SDL to fail to detect your joystick. To +debug this, start by installing the evtest utility. On Ubuntu/Debian: + + sudo apt-get install evtest + +Then run: + + sudo evtest + +You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX" +Now run: + + cat /dev/input/event/XX + +If you get a permission error, you need to set a udev rule to change the mode of +your device (see below) + +Also, try: + + sudo udevadm info --query=all --name=input/eventXX + +If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it, +you need to set up an udev rule to force this variable. + +A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks +like: + + SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1" + SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1" + +You can set up similar rules for your device by changing the values listed in +idProduct and idVendor. To obtain these values, try: + + sudo udevadm info -a --name=input/eventXX | grep idVendor + sudo udevadm info -a --name=input/eventXX | grep idProduct + +If multiple values come up for each of these, the one you want is the first one of each. + +On other systems which ship with an older udev (such as CentOS), you may need +to set up a rule such as: + + SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1" + diff --git a/docs/README-macos.md b/docs/README-macos.md index cc94ef3c69c0e..8e0a4a998fa37 100644 --- a/docs/README-macos.md +++ b/docs/README-macos.md @@ -1,285 +1,285 @@ -# Mac OS X (aka macOS). - -These instructions are for people using Apple's Mac OS X (pronounced -"ten"), which in newer versions is just referred to as "macOS". - -From the developer's point of view, macOS is a sort of hybrid Mac and -Unix system, and you have the option of using either traditional -command line tools or Apple's IDE Xcode. - -# Command Line Build - -To build SDL using the command line, use the standard configure and make -process: - -```bash -mkdir build -cd build -../configure -make -sudo make install -``` - -CMake is also known to work, although it continues to be a work in progress: - -```bash -mkdir build -cd build -cmake -DCMAKE_BUILD_TYPE=Release .. -make -sudo make install -``` - - -You can also build SDL as a Universal library (a single binary for both -64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh -script. - -```bash -mkdir build -cd build -CC=$PWD/../build-scripts/clang-fat.sh ../configure -make -sudo make install -``` - -This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0 -ABI compatibility on ARM64 architectures. For best compatibility you -should compile your application the same way. - -Please note that building SDL requires at least Xcode 6 and the 10.9 SDK. -PowerPC support for macOS has been officially dropped as of SDL 2.0.2. -32-bit Intel and macOS 10.8 runtime support has been officially dropped as -of SDL 2.24.0. - -To use the library once it's built, you essential have two possibilities: -use the traditional autoconf/automake/make method, or use Xcode. - - -# Caveats for using SDL with Mac OS X - -If you register your own NSApplicationDelegate (using [NSApp setDelegate:]), -SDL will not register its own. This means that SDL will not terminate using -SDL_Quit if it receives a termination request, it will terminate like a -normal app, and it will not send a SDL_DROPFILE when you request to open a -file with the app. To solve these issues, put the following code in your -NSApplicationDelegate implementation: - - -```objc -- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender -{ - if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) { - SDL_Event event; - event.type = SDL_QUIT; - SDL_PushEvent(&event); - } - - return NSTerminateCancel; -} - -- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename -{ - if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) { - SDL_Event event; - event.type = SDL_DROPFILE; - event.drop.file = SDL_strdup([filename UTF8String]); - return (SDL_PushEvent(&event) > 0); - } - - return NO; -} -``` - -# Using the Simple DirectMedia Layer with a traditional Makefile - -An existing autoconf/automake build system for your SDL app has good chances -to work almost unchanged on macOS. However, to produce a "real" Mac binary -that you can distribute to users, you need to put the generated binary into a -so called "bundle", which is basically a fancy folder with a name like -"MyCoolGame.app". - -To get this build automatically, add something like the following rule to -your Makefile.am: - -```make -bundle_contents = APP_NAME.app/Contents -APP_NAME_bundle: EXE_NAME - mkdir -p $(bundle_contents)/MacOS - mkdir -p $(bundle_contents)/Resources - echo "APPL????" > $(bundle_contents)/PkgInfo - $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ -``` - -You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is -what will be visible to the user in the Finder. Usually it will be the same -as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME` -usually is "TestGame". You might also want to use `@PACKAGE@` to use the -package name as specified in your configure.ac file. - -If your project builds more than one application, you will have to do a bit -more. For each of your target applications, you need a separate rule. - -If you want the created bundles to be installed, you may want to add this -rule to your Makefile.am: - -```make -install-exec-hook: APP_NAME_bundle - rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app - mkdir -p $(DESTDIR)$(prefix)/Applications/ - cp -r $< /$(DESTDIR)$(prefix)Applications/ -``` - -This rule takes the Bundle created by the rule from step 3 and installs them -into "$(DESTDIR)$(prefix)/Applications/". - -Again, if you want to install multiple applications, you will have to augment -the make rule accordingly. - -But beware! That is only part of the story! With the above, you end up with -a barebones .app bundle, which is double-clickable from the Finder. But -there are some more things you should do before shipping your product... - -1. The bundle right now probably is dynamically linked against SDL. That - means that when you copy it to another computer, *it will not run*, - unless you also install SDL on that other computer. A good solution - for this dilemma is to static link against SDL. On OS X, you can - achieve that by linking against the libraries listed by - - ```bash - sdl-config --static-libs - ``` - - instead of those listed by - - ```bash - sdl-config --libs - ``` - - Depending on how exactly SDL is integrated into your build systems, the - way to achieve that varies, so I won't describe it here in detail - -2. Add an 'Info.plist' to your application. That is a special XML file which - contains some meta-information about your application (like some copyright - information, the version of your app, the name of an optional icon file, - and other things). Part of that information is displayed by the Finder - when you click on the .app, or if you look at the "Get Info" window. - More information about Info.plist files can be found on Apple's homepage. - - -As a final remark, let me add that I use some of the techniques (and some -variations of them) in [Exult](https://github.com/exult/exult) and -[ScummVM](https://github.com/scummvm/scummvm); both are available in source on -the net, so feel free to take a peek at them for inspiration! - - -# Using the Simple DirectMedia Layer with Xcode - -These instructions are for using Apple's Xcode IDE to build SDL applications. - -## First steps - -The first thing to do is to unpack the Xcode.tar.gz archive in the -top level SDL directory (where the Xcode.tar.gz archive resides). -Because Stuffit Expander will unpack the archive into a subdirectory, -you should unpack the archive manually from the command line: - -```bash -cd [path_to_SDL_source] -tar zxf Xcode.tar.gz -``` - -This will create a new folder called Xcode, which you can browse -normally from the Finder. - -## Building the Framework - -The SDL Library is packaged as a framework bundle, an organized -relocatable folder hierarchy of executable code, interface headers, -and additional resources. For practical purposes, you can think of a -framework as a more user and system-friendly shared library, whose library -file behaves more or less like a standard UNIX shared library. - -To build the framework, simply open the framework project and build it. -By default, the framework bundle "SDL.framework" is installed in -/Library/Frameworks. Therefore, the testers and project stationary expect -it to be located there. However, it will function the same in any of the -following locations: - -* ~/Library/Frameworks -* /Local/Library/Frameworks -* /System/Library/Frameworks - -## Build Options - -There are two "Build Styles" (See the "Targets" tab) for SDL. -"Deployment" should be used if you aren't tweaking the SDL library. -"Development" should be used to debug SDL apps or the library itself. - -## Building the Testers - -Open the SDLTest project and build away! - -## Using the Project Stationary - -Copy the stationary to the indicated folders to access it from -the "New Project" and "Add target" menus. What could be easier? - -## Setting up a new project by hand - -Some of you won't want to use the Stationary so I'll give some tips: - -(this is accurate as of Xcode 12.5.) - -* Click "File" -> "New" -> "Project... -* Choose "macOS" and then "App" from the "Application" section. -* Fill out the options in the next window. User interface is "XIB" and - Language is "Objective-C". -* Remove "main.m" from your project -* Remove "MainMenu.xib" from your project -* Remove "AppDelegates.*" from your project -* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path -* Add "\$(HOME)/Library/Frameworks" to the frameworks search path -* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" -* Add your files -* Clean and build - -## Building from command line - -Use `xcode-build` in the same directory as your .pbxproj file - -## Running your app - -You can send command line args to your app by either invoking it from -the command line (in *.app/Contents/MacOS) or by entering them in the -Executables" panel of the target settings. - -# Implementation Notes - -Some things that may be of interest about how it all works... - -## Working directory - -In SDL 1.2, the working directory of your SDL app is by default set to its -parent, but this is no longer the case in SDL 2.0. SDL2 does change the -working directory, which means it'll be whatever the command line prompt -that launched the program was using, or if launched by double-clicking in -the finger, it will be "/", the _root of the filesystem_. Plan accordingly! -You can use SDL_GetBasePath() to find where the program is running from and -chdir() there directly. - - -## You have a Cocoa App! - -Your SDL app is essentially a Cocoa application. When your app -starts up and the libraries finish loading, a Cocoa procedure is called, -which sets up the working directory and calls your main() method. -You are free to modify your Cocoa app with generally no consequence -to SDL. You cannot, however, easily change the SDL window itself. -Functionality may be added in the future to help this. - -# Bug reports - -Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/). -Please feel free to report bugs there! - +# Mac OS X (aka macOS). + +These instructions are for people using Apple's Mac OS X (pronounced +"ten"), which in newer versions is just referred to as "macOS". + +From the developer's point of view, macOS is a sort of hybrid Mac and +Unix system, and you have the option of using either traditional +command line tools or Apple's IDE Xcode. + +# Command Line Build + +To build SDL using the command line, use the standard configure and make +process: + +```bash +mkdir build +cd build +../configure +make +sudo make install +``` + +CMake is also known to work, although it continues to be a work in progress: + +```bash +mkdir build +cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +make +sudo make install +``` + + +You can also build SDL as a Universal library (a single binary for both +64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh +script. + +```bash +mkdir build +cd build +CC=$PWD/../build-scripts/clang-fat.sh ../configure +make +sudo make install +``` + +This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0 +ABI compatibility on ARM64 architectures. For best compatibility you +should compile your application the same way. + +Please note that building SDL requires at least Xcode 6 and the 10.9 SDK. +PowerPC support for macOS has been officially dropped as of SDL 2.0.2. +32-bit Intel and macOS 10.8 runtime support has been officially dropped as +of SDL 2.24.0. + +To use the library once it's built, you essential have two possibilities: +use the traditional autoconf/automake/make method, or use Xcode. + + +# Caveats for using SDL with Mac OS X + +If you register your own NSApplicationDelegate (using [NSApp setDelegate:]), +SDL will not register its own. This means that SDL will not terminate using +SDL_Quit if it receives a termination request, it will terminate like a +normal app, and it will not send a SDL_DROPFILE when you request to open a +file with the app. To solve these issues, put the following code in your +NSApplicationDelegate implementation: + + +```objc +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender +{ + if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_QUIT; + SDL_PushEvent(&event); + } + + return NSTerminateCancel; +} + +- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename +{ + if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) { + SDL_Event event; + event.type = SDL_DROPFILE; + event.drop.file = SDL_strdup([filename UTF8String]); + return (SDL_PushEvent(&event) > 0); + } + + return NO; +} +``` + +# Using the Simple DirectMedia Layer with a traditional Makefile + +An existing autoconf/automake build system for your SDL app has good chances +to work almost unchanged on macOS. However, to produce a "real" Mac binary +that you can distribute to users, you need to put the generated binary into a +so called "bundle", which is basically a fancy folder with a name like +"MyCoolGame.app". + +To get this build automatically, add something like the following rule to +your Makefile.am: + +```make +bundle_contents = APP_NAME.app/Contents +APP_NAME_bundle: EXE_NAME + mkdir -p $(bundle_contents)/MacOS + mkdir -p $(bundle_contents)/Resources + echo "APPL????" > $(bundle_contents)/PkgInfo + $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ +``` + +You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is +what will be visible to the user in the Finder. Usually it will be the same +as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME` +usually is "TestGame". You might also want to use `@PACKAGE@` to use the +package name as specified in your configure.ac file. + +If your project builds more than one application, you will have to do a bit +more. For each of your target applications, you need a separate rule. + +If you want the created bundles to be installed, you may want to add this +rule to your Makefile.am: + +```make +install-exec-hook: APP_NAME_bundle + rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app + mkdir -p $(DESTDIR)$(prefix)/Applications/ + cp -r $< /$(DESTDIR)$(prefix)Applications/ +``` + +This rule takes the Bundle created by the rule from step 3 and installs them +into "$(DESTDIR)$(prefix)/Applications/". + +Again, if you want to install multiple applications, you will have to augment +the make rule accordingly. + +But beware! That is only part of the story! With the above, you end up with +a barebones .app bundle, which is double-clickable from the Finder. But +there are some more things you should do before shipping your product... + +1. The bundle right now probably is dynamically linked against SDL. That + means that when you copy it to another computer, *it will not run*, + unless you also install SDL on that other computer. A good solution + for this dilemma is to static link against SDL. On OS X, you can + achieve that by linking against the libraries listed by + + ```bash + sdl-config --static-libs + ``` + + instead of those listed by + + ```bash + sdl-config --libs + ``` + + Depending on how exactly SDL is integrated into your build systems, the + way to achieve that varies, so I won't describe it here in detail + +2. Add an 'Info.plist' to your application. That is a special XML file which + contains some meta-information about your application (like some copyright + information, the version of your app, the name of an optional icon file, + and other things). Part of that information is displayed by the Finder + when you click on the .app, or if you look at the "Get Info" window. + More information about Info.plist files can be found on Apple's homepage. + + +As a final remark, let me add that I use some of the techniques (and some +variations of them) in [Exult](https://github.com/exult/exult) and +[ScummVM](https://github.com/scummvm/scummvm); both are available in source on +the net, so feel free to take a peek at them for inspiration! + + +# Using the Simple DirectMedia Layer with Xcode + +These instructions are for using Apple's Xcode IDE to build SDL applications. + +## First steps + +The first thing to do is to unpack the Xcode.tar.gz archive in the +top level SDL directory (where the Xcode.tar.gz archive resides). +Because Stuffit Expander will unpack the archive into a subdirectory, +you should unpack the archive manually from the command line: + +```bash +cd [path_to_SDL_source] +tar zxf Xcode.tar.gz +``` + +This will create a new folder called Xcode, which you can browse +normally from the Finder. + +## Building the Framework + +The SDL Library is packaged as a framework bundle, an organized +relocatable folder hierarchy of executable code, interface headers, +and additional resources. For practical purposes, you can think of a +framework as a more user and system-friendly shared library, whose library +file behaves more or less like a standard UNIX shared library. + +To build the framework, simply open the framework project and build it. +By default, the framework bundle "SDL.framework" is installed in +/Library/Frameworks. Therefore, the testers and project stationary expect +it to be located there. However, it will function the same in any of the +following locations: + +* ~/Library/Frameworks +* /Local/Library/Frameworks +* /System/Library/Frameworks + +## Build Options + +There are two "Build Styles" (See the "Targets" tab) for SDL. +"Deployment" should be used if you aren't tweaking the SDL library. +"Development" should be used to debug SDL apps or the library itself. + +## Building the Testers + +Open the SDLTest project and build away! + +## Using the Project Stationary + +Copy the stationary to the indicated folders to access it from +the "New Project" and "Add target" menus. What could be easier? + +## Setting up a new project by hand + +Some of you won't want to use the Stationary so I'll give some tips: + +(this is accurate as of Xcode 12.5.) + +* Click "File" -> "New" -> "Project... +* Choose "macOS" and then "App" from the "Application" section. +* Fill out the options in the next window. User interface is "XIB" and + Language is "Objective-C". +* Remove "main.m" from your project +* Remove "MainMenu.xib" from your project +* Remove "AppDelegates.*" from your project +* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path +* Add "\$(HOME)/Library/Frameworks" to the frameworks search path +* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" +* Add your files +* Clean and build + +## Building from command line + +Use `xcode-build` in the same directory as your .pbxproj file + +## Running your app + +You can send command line args to your app by either invoking it from +the command line (in *.app/Contents/MacOS) or by entering them in the +Executables" panel of the target settings. + +# Implementation Notes + +Some things that may be of interest about how it all works... + +## Working directory + +In SDL 1.2, the working directory of your SDL app is by default set to its +parent, but this is no longer the case in SDL 2.0 and later. SDL2 does not +change the working directory, which means it'll be whatever the command line +prompt that launched the program was using, or if launched by double-clicking +in the Finder, it will be "/", the _root of the filesystem_. Plan accordingly! +You can use SDL_GetBasePath() to find where the program is running from and +chdir() there directly. + + +## You have a Cocoa App! + +Your SDL app is essentially a Cocoa application. When your app +starts up and the libraries finish loading, a Cocoa procedure is called, +which sets up the working directory and calls your main() method. +You are free to modify your Cocoa app with generally no consequence +to SDL. You cannot, however, easily change the SDL window itself. +Functionality may be added in the future to help this. + +# Bug reports + +Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/). +Please feel free to report bugs there! + diff --git a/docs/README-n3ds.md b/docs/README-n3ds.md index 66e194d0b33a9..ff528eba542f2 100644 --- a/docs/README-n3ds.md +++ b/docs/README-n3ds.md @@ -1,27 +1,28 @@ -# Nintendo 3DS - -SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by: - -- [Pierre Wendling](https://github.com/FtZPetruska) - -Credits to: - -- The awesome people who ported SDL to other homebrew platforms. -- The Devkitpro team for making all the tools necessary to achieve this. - -## Building - -To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run: - -```bash -cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release -cmake --build build -cmake --install build -``` - -## Notes - -- Currently only software rendering is supported. -- SDL2main should be used to ensure ROMFS is enabled. -- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. -- `SDL_GetBasePath` returns the romfs root instead of the executable's directory. +# Nintendo 3DS + +SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by: + +- [Pierre Wendling](https://github.com/FtZPetruska) + +Credits to: + +- The awesome people who ported SDL to other homebrew platforms. +- The Devkitpro team for making all the tools necessary to achieve this. + +## Building + +To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run: + +```bash +cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release +cmake --build build +cmake --install build +``` + +## Notes + +- Currently only software rendering is supported. +- SDL2main should be used to ensure ROMFS is enabled. +- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function. +- `SDL_GetBasePath` returns the romfs root instead of the executable's directory. +- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information. diff --git a/docs/README-nacl.md b/docs/README-nacl.md index 53ada33c31c15..2906825d407b8 100644 --- a/docs/README-nacl.md +++ b/docs/README-nacl.md @@ -1,103 +1,103 @@ -Native Client -================================================================================ - -Requirements: - -* Native Client SDK (https://developer.chrome.com/native-client), - (tested with Pepper version 33 or higher). - -The SDL backend for Chrome's Native Client has been tested only with the PNaCl -toolchain, which generates binaries designed to run on ARM and x86_32/64 -platforms. This does not mean it won't work with the other toolchains! - -================================================================================ -Building SDL for NaCl -================================================================================ - -Set up the right environment variables (see naclbuild.sh), then configure SDL with: - - configure --host=pnacl --prefix some/install/destination - -Then "make". - -As an example of how to create a deployable app a Makefile project is provided -in test/nacl/Makefile, which includes some monkey patching of the common.mk file -provided by NaCl, without which linking properly to SDL won't work (the search -path can't be modified externally, so the linker won't find SDL's binaries unless -you dump them into the SDK path, which is inconvenient). -Also provided in test/nacl is the required support file, such as index.html, -manifest.json, etc. -SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure. -This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem), -hiding the asynchronous nature of the browser behind the scenes...which is not the -same as making it disappear! - - -================================================================================ -Running tests -================================================================================ - -Due to the nature of NaCl programs, building and running SDL tests is not as -straightforward as one would hope. The script naclbuild.sh in build-scripts -automates the process and should serve as a guide for users of SDL trying to build -their own applications. - -Basic usage: - - ./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35) - -This will build testgles2.c by default. - -If you want to build a different test, for example testrendercopyex.c: - - SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35 - -Once the build finishes, you have to serve the contents with a web server (the -script will give you instructions on how to do that with Python). - -================================================================================ -RWops and nacl_io -================================================================================ - -SDL_RWops work transparently with nacl_io. Two functions control the mount points: - - int mount(const char* source, const char* target, - const char* filesystemtype, - unsigned long mountflags, const void *data); - int umount(const char *target); - - For convenience, SDL will by default mount an httpfs tree at / before calling -the app's main function. Such setting can be overridden by calling: - - umount("/"); - -And then mounting a different filesystem at / - -It's important to consider that the asynchronous nature of file operations on a -browser is hidden from the application, effectively providing the developer with -a set of blocking file operations just like you get in a regular desktop -environment, which eases the job of porting to Native Client, but also introduces -a set of challenges of its own, in particular when big file sizes and slow -connections are involved. - -For more information on how nacl_io and mount points work, see: - - https://developer.chrome.com/native-client/devguide/coding/nacl_io - https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h - -To be able to save into the directory "/save/" (like backup of game) : - - mount("", "/save", "html5fs", 0, "type=PERSISTENT"); - -And add to manifest.json : - - "permissions": [ - "unlimitedStorage" - ] - -================================================================================ -TODO - Known Issues -================================================================================ -* Testing of all systems with a real application (something other than SDL's tests) -* Key events don't seem to work properly - +Native Client +================================================================================ + +Requirements: + +* Native Client SDK (https://developer.chrome.com/native-client), + (tested with Pepper version 33 or higher). + +The SDL backend for Chrome's Native Client has been tested only with the PNaCl +toolchain, which generates binaries designed to run on ARM and x86_32/64 +platforms. This does not mean it won't work with the other toolchains! + +================================================================================ +Building SDL for NaCl +================================================================================ + +Set up the right environment variables (see naclbuild.sh), then configure SDL with: + + configure --host=pnacl --prefix some/install/destination + +Then "make". + +As an example of how to create a deployable app a Makefile project is provided +in test/nacl/Makefile, which includes some monkey patching of the common.mk file +provided by NaCl, without which linking properly to SDL won't work (the search +path can't be modified externally, so the linker won't find SDL's binaries unless +you dump them into the SDK path, which is inconvenient). +Also provided in test/nacl is the required support file, such as index.html, +manifest.json, etc. +SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure. +This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem), +hiding the asynchronous nature of the browser behind the scenes...which is not the +same as making it disappear! + + +================================================================================ +Running tests +================================================================================ + +Due to the nature of NaCl programs, building and running SDL tests is not as +straightforward as one would hope. The script naclbuild.sh in build-scripts +automates the process and should serve as a guide for users of SDL trying to build +their own applications. + +Basic usage: + + ./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35) + +This will build testgles2.c by default. + +If you want to build a different test, for example testrendercopyex.c: + + SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35 + +Once the build finishes, you have to serve the contents with a web server (the +script will give you instructions on how to do that with Python). + +================================================================================ +RWops and nacl_io +================================================================================ + +SDL_RWops work transparently with nacl_io. Two functions control the mount points: + + int mount(const char* source, const char* target, + const char* filesystemtype, + unsigned long mountflags, const void *data); + int umount(const char *target); + + For convenience, SDL will by default mount an httpfs tree at / before calling +the app's main function. Such setting can be overridden by calling: + + umount("/"); + +And then mounting a different filesystem at / + +It's important to consider that the asynchronous nature of file operations on a +browser is hidden from the application, effectively providing the developer with +a set of blocking file operations just like you get in a regular desktop +environment, which eases the job of porting to Native Client, but also introduces +a set of challenges of its own, in particular when big file sizes and slow +connections are involved. + +For more information on how nacl_io and mount points work, see: + + https://developer.chrome.com/native-client/devguide/coding/nacl_io + https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h + +To be able to save into the directory "/save/" (like backup of game) : + + mount("", "/save", "html5fs", 0, "type=PERSISTENT"); + +And add to manifest.json : + + "permissions": [ + "unlimitedStorage" + ] + +================================================================================ +TODO - Known Issues +================================================================================ +* Testing of all systems with a real application (something other than SDL's tests) +* Key events don't seem to work properly + diff --git a/docs/README-os2.md b/docs/README-os2.md index 1815b944d0322..148eb33a60b15 100644 --- a/docs/README-os2.md +++ b/docs/README-os2.md @@ -3,7 +3,7 @@ Simple DirectMedia Layer 2 for OS/2 & eComStation SDL port for OS/2, authored by Andrey Vasilkin , 2016 -OpenGL and audio capture not supported by this port. +OpenGL not supported by this port. Additional optional environment variables: diff --git a/docs/README-pandora.md b/docs/README-pandora.md index a0277634b5ded..b89d52602ed17 100644 --- a/docs/README-pandora.md +++ b/docs/README-pandora.md @@ -1,17 +1,17 @@ -Pandora -===================================================================== - -( http://openpandora.org/ ) -- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES -support to work on the pandora under the framebuffer. This driver do not have -input support for now, so if you use it you will have to add your own control code. -The video driver name is "pandora" so if you have problem running it from -the framebuffer, try to set the following variable before starting your application : -"export SDL_VIDEODRIVER=pandora" - -- OpenGL ES support was added to the x11 driver, so it's working like the normal -x11 driver one with OpenGLX support, with SDL input event's etc.. - - -David Carré (Cpasjuste) -cpasjuste@gmail.com +Pandora +===================================================================== + +( http://openpandora.org/ ) +- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES +support to work on the pandora under the framebuffer. This driver do not have +input support for now, so if you use it you will have to add your own control code. +The video driver name is "pandora" so if you have problem running it from +the framebuffer, try to set the following variable before starting your application : +"export SDL_VIDEODRIVER=pandora" + +- OpenGL ES support was added to the x11 driver, so it's working like the normal +x11 driver one with OpenGLX support, with SDL input event's etc.. + + +David Carré (Cpasjuste) +cpasjuste@gmail.com diff --git a/docs/README-platforms.md b/docs/README-platforms.md index 711557dc046f4..14454ec5d5c46 100644 --- a/docs/README-platforms.md +++ b/docs/README-platforms.md @@ -1,8 +1,8 @@ -Platforms -========= - -We maintain the list of supported platforms on our wiki now, and how to -build and install SDL for those platforms: - - https://wiki.libsdl.org/Installation - +Platforms +========= + +We maintain the list of supported platforms on our wiki now, and how to +build and install SDL for those platforms: + + https://wiki.libsdl.org/Installation + diff --git a/docs/README-porting.md b/docs/README-porting.md index de3059226837b..82f35c6283d04 100644 --- a/docs/README-porting.md +++ b/docs/README-porting.md @@ -1,68 +1,68 @@ -Porting -======= - -* Porting To A New Platform - - The first thing you have to do when porting to a new platform, is look at -include/SDL_platform.h and create an entry there for your operating system. -The standard format is "__PLATFORM__", where PLATFORM is the name of the OS. -Ideally SDL_platform.h will be able to auto-detect the system it's building -on based on C preprocessor symbols. - -There are two basic ways of building SDL at the moment: - -1. The "UNIX" way: ./configure; make; make install - - If you have a GNUish system, then you might try this. Edit configure.ac, - take a look at the large section labelled: - - "Set up the configuration based on the host platform!" - - Add a section for your platform, and then re-run autogen.sh and build! - -2. Using an IDE: - - If you're using an IDE or other non-configure build system, you'll probably - want to create a custom SDL_config.h for your platform. Edit SDL_config.h, - add a section for your platform, and create a custom SDL_config_{platform}.h, - based on SDL_config_minimal.h and SDL_config.h.in - - Add the top level include directory to the header search path, and then add - the following sources to the project: - - src/*.c - src/atomic/*.c - src/audio/*.c - src/cpuinfo/*.c - src/events/*.c - src/file/*.c - src/haptic/*.c - src/joystick/*.c - src/power/*.c - src/render/*.c - src/render/software/*.c - src/stdlib/*.c - src/thread/*.c - src/timer/*.c - src/video/*.c - src/audio/disk/*.c - src/audio/dummy/*.c - src/filesystem/dummy/*.c - src/video/dummy/*.c - src/haptic/dummy/*.c - src/joystick/dummy/*.c - src/main/dummy/*.c - src/thread/generic/*.c - src/timer/dummy/*.c - src/loadso/dummy/*.c - - -Once you have a working library without any drivers, you can go back to each -of the major subsystems and start implementing drivers for your platform. - -If you have any questions, don't hesitate to ask on the SDL mailing list: - http://www.libsdl.org/mailing-list.php - -Enjoy! - Sam Lantinga (slouken@libsdl.org) - +Porting +======= + +* Porting To A New Platform + + The first thing you have to do when porting to a new platform, is look at +include/SDL_platform.h and create an entry there for your operating system. +The standard format is "__PLATFORM__", where PLATFORM is the name of the OS. +Ideally SDL_platform.h will be able to auto-detect the system it's building +on based on C preprocessor symbols. + +There are two basic ways of building SDL at the moment: + +1. The "UNIX" way: ./configure; make; make install + + If you have a GNUish system, then you might try this. Edit configure.ac, + take a look at the large section labelled: + + "Set up the configuration based on the host platform!" + + Add a section for your platform, and then re-run autogen.sh and build! + +2. Using an IDE: + + If you're using an IDE or other non-configure build system, you'll probably + want to create a custom SDL_config.h for your platform. Edit SDL_config.h, + add a section for your platform, and create a custom SDL_config_{platform}.h, + based on SDL_config_minimal.h and SDL_config.h.in + + Add the top level include directory to the header search path, and then add + the following sources to the project: + + src/*.c + src/atomic/*.c + src/audio/*.c + src/cpuinfo/*.c + src/events/*.c + src/file/*.c + src/haptic/*.c + src/joystick/*.c + src/power/*.c + src/render/*.c + src/render/software/*.c + src/stdlib/*.c + src/thread/*.c + src/timer/*.c + src/video/*.c + src/audio/disk/*.c + src/audio/dummy/*.c + src/filesystem/dummy/*.c + src/video/dummy/*.c + src/haptic/dummy/*.c + src/joystick/dummy/*.c + src/main/dummy/*.c + src/thread/generic/*.c + src/timer/dummy/*.c + src/loadso/dummy/*.c + + +Once you have a working library without any drivers, you can go back to each +of the major subsystems and start implementing drivers for your platform. + +If you have any questions, don't hesitate to ask on the SDL mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/docs/README-ps2.md b/docs/README-ps2.md index b27b57d1a1e8d..d573c435032c8 100644 --- a/docs/README-ps2.md +++ b/docs/README-ps2.md @@ -1,51 +1,55 @@ -PS2 -====== -SDL2 port for the Sony Playstation 2 contributed by: -- Francisco Javier Trujillo Mata - - -Credit to - - The guys that ported SDL to PSP & Vita because I'm taking them as reference. - - David G. F. for helping me with several issues and tests. - -## Building -To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run: -```bash -cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake -cmake --build build -cmake --install build -``` - -## Hints -The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`. -If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30. - -## Notes -If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer. -So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`. -It could be something similar as: -```c -..... - -SDL_PS2_SKIP_IOP_RESET(); - -int main(int argc, char *argv[]) -{ -..... -``` -For a release binary is recommendable to reset the IOP always. - -Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected. - -## Getting PS2 Dev -[Installing PS2 Dev](https://github.com/ps2dev/ps2dev) - -## Running on PCSX2 Emulator -[PCSX2](https://github.com/PCSX2/pcsx2) - -[More PCSX2 information](https://pcsx2.net/) - -## To Do -- PS2 Screen Keyboard -- Dialogs -- Others \ No newline at end of file +PS2 +====== +SDL2 port for the Sony Playstation 2 contributed by: +- Francisco Javier Trujillo Mata + + +Credit to + - The guys that ported SDL to PSP & Vita because I'm taking them as reference. + - David G. F. for helping me with several issues and tests. + +## Building +To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run: +```bash +cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/share/ps2dev.cmake +cmake --build build +cmake --install build +``` + +## Hints +The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`. +If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30. +- `SDL_HINT_PS2_GS_WIDTH`: Width of the framebuffer. Defaults to 640. +- `SDL_HINT_PS2_GS_HEIGHT`: Height of the framebuffer. Defaults to 448. +- `SDL_HINT_PS2_GS_PROGRESSIVE`: Whether to use progressive, instead of interlaced. Defaults to 0. +- `SDL_HINT_PS2_GS_MODE`: Regional standard of the signal. "NTSC" (60hz), "PAL" (50hz) or "" (the console's region, default). + +## Notes +If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer. +So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`. +It could be something similar as: +```c +..... + +SDL_PS2_SKIP_IOP_RESET(); + +int main(int argc, char *argv[]) +{ +..... +``` +For a release binary is recommendable to reset the IOP always. + +Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected. + +## Getting PS2 Dev +[Installing PS2 Dev](https://github.com/ps2dev/ps2dev) + +## Running on PCSX2 Emulator +[PCSX2](https://github.com/PCSX2/pcsx2) + +[More PCSX2 information](https://pcsx2.net/) + +## To Do +- PS2 Screen Keyboard +- Dialogs +- Others diff --git a/docs/README-psp.md b/docs/README-psp.md index 0c84f866bb34f..6f81cac5a7d26 100644 --- a/docs/README-psp.md +++ b/docs/README-psp.md @@ -1,36 +1,36 @@ -PSP -====== -SDL2 port for the Sony PSP contributed by: -- Captian Lex -- Francisco Javier Trujillo Mata -- Wouter Wijsman - - -Credit to - Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP - Geecko for his PSP GU lib "Glib2d" - -## Building -To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run: -```bash -cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake -cmake --build build -cmake --install build -``` - - -## Getting PSP Dev -[Installing PSP Dev](https://github.com/pspdev/pspdev) - -## Running on PPSSPP Emulator -[PPSSPP](https://github.com/hrydgard/ppsspp) - -[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions) - - -## Compiling a HelloWorld -[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world) - -## To Do -- PSP Screen Keyboard -- Dialogs \ No newline at end of file +PSP +====== +SDL2 port for the Sony PSP contributed by: +- Captian Lex +- Francisco Javier Trujillo Mata +- Wouter Wijsman + + +Credit to + Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP + Geecko for his PSP GU lib "Glib2d" + +## Building +To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run: +```bash +cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake +cmake --build build +cmake --install build +``` + + +## Getting PSP Dev +[Installing PSP Dev](https://github.com/pspdev/pspdev) + +## Running on PPSSPP Emulator +[PPSSPP](https://github.com/hrydgard/ppsspp) + +[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions) + + +## Compiling a HelloWorld +[PSP Hello World](https://pspdev.github.io/basic_programs.html#hello-world) + +## To Do +- PSP Screen Keyboard +- Dialogs diff --git a/docs/README-raspberrypi.md b/docs/README-raspberrypi.md index d2eddb862ab0c..f2f24c74e9c05 100644 --- a/docs/README-raspberrypi.md +++ b/docs/README-raspberrypi.md @@ -1,180 +1,180 @@ -Raspberry Pi -============ - -Requirements: - -Raspbian (other Linux distros may work as well). - -Features --------- - -* Works without X11 -* Hardware accelerated OpenGL ES 2.x -* Sound via ALSA -* Input (mouse/keyboard/joystick) via EVDEV -* Hotplugging of input devices via UDEV - - -Raspbian Build Dependencies ---------------------------- - -sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev - -You also need the VideoCore binary stuff that ships in /opt/vc for EGL and -OpenGL ES 2.x, it usually comes pre-installed, but in any case: - -sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev - - -NEON ----- - -If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so -that SDL will select some otherwise-disabled highly-optimized code. The -original Pi units don't have NEON, the Pi2 probably does, and the Pi3 -definitely does. - - -Cross compiling from x86 Linux ------------------------------- - -To cross compile SDL for Raspbian from your desktop machine, you'll need a -Raspbian system root and the cross compilation tools. We'll assume these tools -will be placed in /opt/rpi-tools - - sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools - -You'll also need a Raspbian binary image. -Get it from: http://downloads.raspberrypi.org/raspbian_latest -After unzipping, you'll get file with a name like: "-wheezy-raspbian.img" -Let's assume the sysroot will be built in /opt/rpi-sysroot. - - export SYSROOT=/opt/rpi-sysroot - sudo kpartx -a -v .img - sudo mount -o loop /dev/mapper/loop0p2 /mnt - sudo cp -r /mnt $SYSROOT - sudo apt-get install qemu binfmt-support qemu-user-static - sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin - sudo mount --bind /dev $SYSROOT/dev - sudo mount --bind /proc $SYSROOT/proc - sudo mount --bind /sys $SYSROOT/sys - -Now, before chrooting into the ARM sysroot, you'll need to apply a workaround, -edit $SYSROOT/etc/ld.so.preload and comment out all lines in it. - - sudo chroot $SYSROOT - apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev - exit - sudo umount $SYSROOT/dev - sudo umount $SYSROOT/proc - sudo umount $SYSROOT/sys - sudo umount /mnt - -There's one more fix required, as the libdl.so symlink uses an absolute path -which doesn't quite work in our setup. - - sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so - sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so - -The final step is compiling SDL itself. - - export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux" - cd - mkdir -p build;cd build - LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd - make - make install - -To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths: - - perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config - -Apps don't work or poor video/audio performance ------------------------------------------------ - -If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to -update the RPi's firmware. Note that doing so will fix these problems, but it -will also render the CMA - Dynamic Memory Split functionality useless. - -Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too -low in general, specially if a 1080p TV is hooked up. - -See here how to configure this setting: http://elinux.org/RPiconfig - -Using a fixed gpu_mem=128 is the best option (specially if you updated the -firmware, using CMA probably won't work, at least it's the current case). - -No input --------- - -Make sure you belong to the "input" group. - - sudo usermod -aG input `whoami` - -No HDMI Audio -------------- - -If you notice that ALSA works but there's no audio over HDMI, try adding: - - hdmi_drive=2 - -to your config.txt file and reboot. - -Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062 - -Text Input API support ----------------------- - -The Text Input API is supported, with translation of scan codes done via the -kernel symbol tables. For this to work, SDL needs access to a valid console. -If you notice there's no SDL_TEXTINPUT message being emitted, double check that -your app has read access to one of the following: - -* /proc/self/fd/0 -* /dev/tty -* /dev/tty[0...6] -* /dev/vc/0 -* /dev/console - -This is usually not a problem if you run from the physical terminal (as opposed -to running from a pseudo terminal, such as via SSH). If running from a PTS, a -quick workaround is to run your app as root or add yourself to the tty group, -then re-login to the system. - - sudo usermod -aG tty `whoami` - -The keyboard layout used by SDL is the same as the one the kernel uses. -To configure the layout on Raspbian: - - sudo dpkg-reconfigure keyboard-configuration - -To configure the locale, which controls which keys are interpreted as letters, -this determining the CAPS LOCK behavior: - - sudo dpkg-reconfigure locales - - -OpenGL problems ---------------- - -If you have desktop OpenGL headers installed at build time in your RPi or cross -compilation environment, support for it will be built in. However, the chipset -does not actually have support for it, which causes issues in certain SDL apps -since the presence of OpenGL support supersedes the ES/ES2 variants. -The workaround is to disable OpenGL at configuration time: - - ./configure --disable-video-opengl - -Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER -environment variable: - - export SDL_RENDER_DRIVER=opengles2 - -Notes ------ - -* When launching apps remotely (via SSH), SDL can prevent local keystrokes from - leaking into the console only if it has root privileges. Launching apps locally - does not suffer from this issue. - - +Raspberry Pi +============ + +Requirements: + +Raspbian (other Linux distros may work as well). + +Features +-------- + +* Works without X11 +* Hardware accelerated OpenGL ES 2.x +* Sound via ALSA +* Input (mouse/keyboard/joystick) via EVDEV +* Hotplugging of input devices via UDEV + + +Raspbian Build Dependencies +--------------------------- + +sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev + +You also need the VideoCore binary stuff that ships in /opt/vc for EGL and +OpenGL ES 2.x, it usually comes pre-installed, but in any case: + +sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev + + +NEON +---- + +If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so +that SDL will select some otherwise-disabled highly-optimized code. The +original Pi units don't have NEON, the Pi2 probably does, and the Pi3 +definitely does. + + +Cross compiling from x86 Linux +------------------------------ + +To cross compile SDL for Raspbian from your desktop machine, you'll need a +Raspbian system root and the cross compilation tools. We'll assume these tools +will be placed in /opt/rpi-tools + + sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools + +You'll also need a Raspbian binary image. +Get it from: http://downloads.raspberrypi.org/raspbian_latest +After unzipping, you'll get file with a name like: "-wheezy-raspbian.img" +Let's assume the sysroot will be built in /opt/rpi-sysroot. + + export SYSROOT=/opt/rpi-sysroot + sudo kpartx -a -v .img + sudo mount -o loop /dev/mapper/loop0p2 /mnt + sudo cp -r /mnt $SYSROOT + sudo apt-get install qemu binfmt-support qemu-user-static + sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin + sudo mount --bind /dev $SYSROOT/dev + sudo mount --bind /proc $SYSROOT/proc + sudo mount --bind /sys $SYSROOT/sys + +Now, before chrooting into the ARM sysroot, you'll need to apply a workaround, +edit $SYSROOT/etc/ld.so.preload and comment out all lines in it. + + sudo chroot $SYSROOT + apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev + exit + sudo umount $SYSROOT/dev + sudo umount $SYSROOT/proc + sudo umount $SYSROOT/sys + sudo umount /mnt + +There's one more fix required, as the libdl.so symlink uses an absolute path +which doesn't quite work in our setup. + + sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so + sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so + +The final step is compiling SDL itself. + + export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux" + cd + mkdir -p build;cd build + LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd + make + make install + +To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths: + + perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config + +Apps don't work or poor video/audio performance +----------------------------------------------- + +If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to +update the RPi's firmware. Note that doing so will fix these problems, but it +will also render the CMA - Dynamic Memory Split functionality useless. + +Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too +low in general, specially if a 1080p TV is hooked up. + +See here how to configure this setting: http://elinux.org/RPiconfig + +Using a fixed gpu_mem=128 is the best option (specially if you updated the +firmware, using CMA probably won't work, at least it's the current case). + +No input +-------- + +Make sure you belong to the "input" group. + + sudo usermod -aG input `whoami` + +No HDMI Audio +------------- + +If you notice that ALSA works but there's no audio over HDMI, try adding: + + hdmi_drive=2 + +to your config.txt file and reboot. + +Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062 + +Text Input API support +---------------------- + +The Text Input API is supported, with translation of scan codes done via the +kernel symbol tables. For this to work, SDL needs access to a valid console. +If you notice there's no SDL_TEXTINPUT message being emitted, double check that +your app has read access to one of the following: + +* /proc/self/fd/0 +* /dev/tty +* /dev/tty[0...6] +* /dev/vc/0 +* /dev/console + +This is usually not a problem if you run from the physical terminal (as opposed +to running from a pseudo terminal, such as via SSH). If running from a PTS, a +quick workaround is to run your app as root or add yourself to the tty group, +then re-login to the system. + + sudo usermod -aG tty `whoami` + +The keyboard layout used by SDL is the same as the one the kernel uses. +To configure the layout on Raspbian: + + sudo dpkg-reconfigure keyboard-configuration + +To configure the locale, which controls which keys are interpreted as letters, +this determining the CAPS LOCK behavior: + + sudo dpkg-reconfigure locales + + +OpenGL problems +--------------- + +If you have desktop OpenGL headers installed at build time in your RPi or cross +compilation environment, support for it will be built in. However, the chipset +does not actually have support for it, which causes issues in certain SDL apps +since the presence of OpenGL support supersedes the ES/ES2 variants. +The workaround is to disable OpenGL at configuration time: + + ./configure --disable-video-opengl + +Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER +environment variable: + + export SDL_RENDER_DRIVER=opengles2 + +Notes +----- + +* When launching apps remotely (via SSH), SDL can prevent local keystrokes from + leaking into the console only if it has root privileges. Launching apps locally + does not suffer from this issue. + + diff --git a/docs/README-touch.md b/docs/README-touch.md index 09188b81d0fd9..378c579565bde 100644 --- a/docs/README-touch.md +++ b/docs/README-touch.md @@ -1,86 +1,83 @@ -Touch -=========================================================================== -System Specific Notes -=========================================================================== -Linux: -The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it. - -Mac: -The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do. - -iPhone: -Works out of box. - -Windows: -Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com - -=========================================================================== -Events -=========================================================================== -SDL_FINGERDOWN: -Sent when a finger (or stylus) is placed on a touch device. -Fields: -* event.tfinger.touchId - the Id of the touch device. -* event.tfinger.fingerId - the Id of the finger which just went down. -* event.tfinger.x - the x coordinate of the touch (0..1) -* event.tfinger.y - the y coordinate of the touch (0..1) -* event.tfinger.pressure - the pressure of the touch (0..1) - -SDL_FINGERMOTION: -Sent when a finger (or stylus) is moved on the touch device. -Fields: -Same as SDL_FINGERDOWN but with additional: -* event.tfinger.dx - change in x coordinate during this motion event. -* event.tfinger.dy - change in y coordinate during this motion event. - -SDL_FINGERUP: -Sent when a finger (or stylus) is lifted from the touch device. -Fields: -Same as SDL_FINGERDOWN. - - -=========================================================================== -Functions -=========================================================================== -SDL provides the ability to access the underlying SDL_Finger structures. -These structures should _never_ be modified. - -The following functions are included from SDL_touch.h - -To get a SDL_TouchID call SDL_GetTouchDevice(int index). -This returns a SDL_TouchID. -IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this! - -The number of touch devices can be queried with SDL_GetNumTouchDevices(). - -A SDL_TouchID may be used to get pointers to SDL_Finger. - -SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device. - -The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following: - - float x = event.tfinger.x; - float y = event.tfinger.y; - - - -To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger. -This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed. -A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled. -As a result, be very careful to check for NULL return values. - -A SDL_Finger has the following fields: -* x, y: - The current coordinates of the touch. -* pressure: - The pressure of the touch. - - -=========================================================================== -Notes -=========================================================================== -For a complete example see test/testgesture.c - -Please direct questions/comments to: - jim.tla+sdl_touch@gmail.com - (original author, API was changed since) +Touch +=========================================================================== +System Specific Notes +=========================================================================== +Linux: +The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it. + +Mac: +The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do. + +iPhone: +Works out of box. + +Windows: +Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com + +Events +=========================================================================== +SDL_FINGERDOWN: +Sent when a finger (or stylus) is placed on a touch device. +Fields: +* event.tfinger.touchId - the Id of the touch device. +* event.tfinger.fingerId - the Id of the finger which just went down. +* event.tfinger.x - the x coordinate of the touch (0..1) +* event.tfinger.y - the y coordinate of the touch (0..1) +* event.tfinger.pressure - the pressure of the touch (0..1) + +SDL_FINGERMOTION: +Sent when a finger (or stylus) is moved on the touch device. +Fields: +Same as SDL_FINGERDOWN but with additional: +* event.tfinger.dx - change in x coordinate during this motion event. +* event.tfinger.dy - change in y coordinate during this motion event. + +SDL_FINGERUP: +Sent when a finger (or stylus) is lifted from the touch device. +Fields: +Same as SDL_FINGERDOWN. + + +Functions +=========================================================================== +SDL provides the ability to access the underlying SDL_Finger structures. +These structures should _never_ be modified. + +The following functions are included from SDL_touch.h + +To get a SDL_TouchID call SDL_GetTouchDevice(int index). +This returns a SDL_TouchID. +IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this! + +The number of touch devices can be queried with SDL_GetNumTouchDevices(). + +A SDL_TouchID may be used to get pointers to SDL_Finger. + +SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device. + +The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following: + + float x = event.tfinger.x; + float y = event.tfinger.y; + + + +To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger. +This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed. +A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled. +As a result, be very careful to check for NULL return values. + +A SDL_Finger has the following fields: +* x, y: + The current coordinates of the touch. +* pressure: + The pressure of the touch. + + +Notes +=========================================================================== +For a complete example see test/testgesture.c + +Please direct questions/comments to: + jim.tla+sdl_touch@gmail.com + (original author, API was changed since) diff --git a/docs/README-visualc.md b/docs/README-visualc.md index 759752a561ddf..fb0edb9ef30dd 100644 --- a/docs/README-visualc.md +++ b/docs/README-visualc.md @@ -17,10 +17,10 @@ _Editor's note: I've been able to successfully build SDL using Visual Studio 201 2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog, all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with the `Platform Toolset`. - + If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`. -3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_ +3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_ panel in the _FileView_ tab), and selecting `Build`. You may get a few warnings, but you should not get any errors. @@ -90,17 +90,17 @@ Here's a sample SDL snippet to verify everything is setup in your IDE: SDL_Init(SDL_INIT_VIDEO); window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); - + SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); return 0; } - ``` + ``` ### That's it! -I hope that this document has helped you get through the most difficult part of using the SDL: installing it. +I hope that this document has helped you get through the most difficult part of using the SDL: installing it. Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues). ### Credits diff --git a/docs/README-vita.md b/docs/README-vita.md index 503fef7d5f937..0a11cf806ba81 100644 --- a/docs/README-vita.md +++ b/docs/README-vita.md @@ -20,13 +20,13 @@ To build for the PSVita, make sure you have vitasdk and cmake installed and run: Notes ----- * gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON` - These renderers support 720p and 1080i resolutions. These can be specified with: + These renderers support 720p and 1080i resolutions. These can be specified with: `SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);` * Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK. They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);` anytime before video subsystem initialization. * gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON` -* By default SDL emits mouse events for touch events on every touchscreen. +* By default SDL emits mouse events for touch events on every touchscreen. Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead. Individual touchscreens can be disabled with: `SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);` diff --git a/docs/README-wince.md b/docs/README-wince.md index d5fb64fcb39c3..9fc6454d178e7 100644 --- a/docs/README-wince.md +++ b/docs/README-wince.md @@ -1,10 +1,10 @@ -WinCE -===== - -Windows CE is no longer supported by SDL. - -We have left the CE support in SDL 1.2 for those that must have it, and we -have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3. - ---ryan. - +WinCE +===== + +Windows CE is no longer supported by SDL. + +We have left the CE support in SDL 1.2 for those that must have it, and we +have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3. + +--ryan. + diff --git a/docs/README-windows.md b/docs/README-windows.md index ed0c93e2c7f9f..66b5fb0638a57 100644 --- a/docs/README-windows.md +++ b/docs/README-windows.md @@ -34,7 +34,7 @@ from a recent Chrome/Chromium install for Windows. The files you need are: - libGLESv2.dll - d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler) *or* d3dcompiler_43.dll (supports Windows XP or later) - + If you compile ANGLE from source, you can configure it so it does not need the d3dcompiler_* DLL at all (for details on this, see their documentation). However, by default SDL will try to preload the d3dcompiler_46.dll to @@ -48,7 +48,7 @@ Known Bugs: - SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears that there's a bug in the library which prevents the window contents from refreshing if this is set to anything other than the default value. - + ## Vulkan Surface Support Support for creating Vulkan surfaces is configured on by default. To disable diff --git a/docs/README-winrt.md b/docs/README-winrt.md index c05c77e02da01..d87ec0443c448 100644 --- a/docs/README-winrt.md +++ b/docs/README-winrt.md @@ -1,519 +1,519 @@ -WinRT -===== - -This port allows SDL applications to run on Microsoft's platforms that require -use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases, -refer to them as either "Windows Store", or for Windows 10, "UWP" apps. - -In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in -modern times this port is focused on UWP apps, which run on Windows 10, -and modern Xbox consoles. - - -Requirements ------------- - -* Microsoft Visual C++ (aka Visual Studio) 2019. - - Free, "Community" or "Express" editions may be used, so long as they - include support for either "Windows Store" or "Windows Phone" apps. - "Express" versions marked as supporting "Windows Desktop" development - typically do not include support for creating WinRT apps, to note. - (The "Community" editions of Visual C++ do, however, support both - desktop/Win32 and WinRT development). -* A valid Microsoft account - This requirement is not imposed by SDL, but - rather by Microsoft's Visual C++ toolchain. This is required to launch or - debug apps. - - -Status ------- - -Here is a rough list of what works, and what doesn't: - -* What works: - * compilation via Visual C++ 2019. - * compile-time platform detection for SDL programs. The C/C++ #define, - `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT. - * GPU-accelerated 2D rendering, via SDL_Renderer. - * OpenGL ES 2, via the ANGLE library (included separately from SDL) - * software rendering, via either SDL_Surface (optionally in conjunction with - SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the - SDL_Renderer APIs - * threads - * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(), - SDL_GetPerformanceFrequency(), etc.) - * file I/O via SDL_RWops - * mouse input (unsupported on Windows Phone) - * audio, via SDL's WASAPI backend (if you want to record, your app must - have "Microphone" capabilities enabled in its manifest, and the user must - not have blocked access. Otherwise, capture devices will fail to work, - presenting as a device disconnect shortly after opening it.) - * .DLL file loading. Libraries *MUST* be packaged inside applications. Loading - anything outside of the app is not supported. - * system path retrieval via SDL's filesystem APIs - * game controllers. Support is provided via the SDL_Joystick and - SDL_GameController APIs, and is backed by Microsoft's XInput API. Please - note, however, that Windows limits game-controller support in UWP apps to, - "Xbox compatible controllers" (many controllers that work in Win32 apps, - do not work in UWP, due to restrictions in UWP itself.) - * multi-touch input - * app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as - appropriate. - * window events - * using Direct3D 11.x APIs outside of SDL. Non-XAML / Direct3D-only apps can - choose to render content directly via Direct3D, using SDL to manage the - internal WinRT window, as well as input and audio. (Use - SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into - IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.) - -* What partially works: - * keyboard input. Most of WinRT's documented virtual keys are supported, as - well as many keys with documented hardware scancodes. Converting - SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs - (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs. - * SDLmain. WinRT uses a different signature for each app's main() function. - SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp - (in `SDL\src\main\winrt\`) directly in order for their C-style main() - functions to be called. - -* What doesn't work: - * compilation with anything other than Visual C++ - * programmatically-created custom cursors. These don't appear to be supported - by WinRT. Different OS-provided cursors can, however, be created via - SDL_CreateSystemCursor() (unsupported on Windows Phone) - * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently - supported by WinRT itself. - * joysticks and game controllers that either are not supported by - Microsoft's XInput API, or are not supported within UWP apps (many - controllers that work in Win32, do not work in UWP, due to restrictions in - UWP itself). - * turning off VSync when rendering on Windows Phone. Attempts to turn VSync - off on Windows Phone result either in Direct3D not drawing anything, or it - forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get - turned-on on Windows Phone. This limitation is not present in non-Phone - WinRT (such as Windows 8.x), where turning off VSync appears to work. - * probably anything else that's not listed as supported - - - -Upgrade Notes -------------- - -#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3 - -SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath(). -The fixes may affect older, SDL 2.0.3-based apps' save data. Please note -that these changes only apply to SDL-based WinRT apps, and not to apps for -any other platform. - -1. SDL_GetPrefPath() would return an invalid path, one in which the path's - directory had not been created. Attempts to create files there - (via fopen(), for example), would fail, unless that directory was - explicitly created beforehand. - -2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside - a WinRT 'Roaming' folder, the contents of which get automatically - synchronized across multiple devices. This process can occur while an - application runs, and can cause existing save-data to be overwritten - at unexpected times, with data from other devices. (Windows Phone apps - written with SDL 2.0.3 did not utilize a Roaming folder, due to API - restrictions in Windows Phone 8.0). - - -SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by: - -1. making sure that SDL_GetPrefPath() returns a directory in which data - can be written to immediately, without first needing to create directories. - -2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the - contents of which do not automatically get synchronized across devices - (and which require less work to use safely, in terms of data integrity). - -Apps that wish to get their Roaming folder's path can do so either by using -SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a -UCS-2/wide-char string), or directly through the WinRT class, -Windows.Storage.ApplicationData. - - - -Setup, High-Level Steps ------------------------ - -The steps for setting up a project for an SDL/WinRT app looks like the -following, at a high-level: - -1. create a new Visual C++ project using Microsoft's template for a, - "Direct3D App". -2. remove most of the files from the project. -3. make your app's project directly reference SDL/WinRT's own Visual C++ - project file, via use of Visual C++'s "References" dialog. This will setup - the linker, and will copy SDL's .dll files to your app's final output. -4. adjust your app's build settings, at minimum, telling it where to find SDL's - header files. -5. add files that contains a WinRT-appropriate main function, along with some - data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls) - work properly. -6. add SDL-specific app code. -7. build and run your app. - - -Setup, Detailed Steps ---------------------- - -### 1. Create a new project ### - -Create a new project using one of Visual C++'s templates for a plain, non-XAML, -"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use). If you -don't see one of these templates, in Visual C++'s 'New Project' dialog, try -using the textbox titled, 'Search Installed Templates' to look for one. - - -### 2. Remove unneeded files from the project ### - -In the new project, delete any file that has one of the following extensions: - -- .cpp -- .h -- .hlsl - -When you are done, you should be left with a few files, each of which will be a -necessary part of your app's project. These files will consist of: - -- an .appxmanifest file, which contains metadata on your WinRT app. This is - similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android. -- a few .png files, one of which is a splash screen (displayed when your app - launches), others are app icons. -- a .pfx file, used for code signing purposes. - - -### 3. Add references to SDL's project files ### - -SDL/WinRT can be built in multiple variations, spanning across three different -CPU architectures (x86, x64, and ARM) and two different configurations -(Debug and Release). WinRT and Visual C++ do not currently provide a means -for combining multiple variations of one library into a single file. -Furthermore, it does not provide an easy means for copying pre-built .dll files -into your app's final output (via Post-Build steps, for example). It does, -however, provide a system whereby an app can reference the MSVC projects of -libraries such that, when the app is built: - -1. each library gets built for the appropriate CPU architecture(s) and WinRT - platform(s). -2. each library's output, such as .dll files, get copied to the app's build - output. - -To set this up for SDL/WinRT, you'll need to run through the following steps: - -1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then - "Solution Explorer") -2. right click on your app's solution. -3. navigate to "Add", then to "Existing Project..." -4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT` - directory. -5. once the project has been added, right-click on your app's project and - select, "References..." -6. click on the button titled, "Add New Reference..." -7. check the box next to SDL -8. click OK to close the dialog -9. SDL will now show up in the list of references. Click OK to close that - dialog. - -Your project is now linked to SDL's project, insofar that when the app is -built, SDL will be built as well, with its build output getting included with -your app. - - -### 4. Adjust Your App's Build Settings ### - -Some build settings need to be changed in your app's project. This guide will -outline the following: - -- making sure that the compiler knows where to find SDL's header files -- **Optional for C++, but NECESSARY for compiling C code:** telling the - compiler not to use Microsoft's C++ extensions for WinRT development. -- **Optional:** telling the compiler not generate errors due to missing - precompiled header files. - -To change these settings: - -1. right-click on the project -2. choose "Properties" -3. in the drop-down box next to "Configuration", choose, "All Configurations" -4. in the drop-down box next to "Platform", choose, "All Platforms" -5. in the left-hand list, expand the "C/C++" section -6. select "General" -7. edit the "Additional Include Directories" setting, and add a path to SDL's - "include" directory -8. **Optional: to enable compilation of C code:** change the setting for - "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No". If you're - working with a completely C++ based project, this step can usually be - omitted. -9. **Optional: to disable precompiled headers (which can produce - 'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand - list, select "Precompiled Headers", then change the setting for "Precompiled - Header" from "Use (/Yu)" to "Not Using Precompiled Headers". -10. close the dialog, saving settings, by clicking the "OK" button - - -### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ### - -A few files should be included directly in your app's MSVC project, specifically: -1. a WinRT-appropriate main function (which is different than main() functions on - other platforms) -2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor - (if and when the app needs to do so). *If this cursor resource is not - included, mouse-position reporting may fail if and when the cursor is - hidden, due to possible bugs/design-oddities in Windows itself.* - -To include these files for C/C++ projects: - -1. right-click on your project (again, in Visual C++'s Solution Explorer), - navigate to "Add", then choose "Existing Item...". -2. navigate to the directory containing SDL's source code, then into its - subdirectory, 'src/main/winrt/'. Select, then add, the following files: - - `SDL_winrt_main_NonXAML.cpp` - - `SDL2-WinRTResources.rc` - - `SDL2-WinRTResource_BlankCursor.cur` -3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your - project), then click on "Properties...". -4. in the drop-down box next to "Configuration", choose, "All Configurations" -5. in the drop-down box next to "Platform", choose, "All Platforms" -6. in the left-hand list, click on "C/C++" -7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)". -8. click the OK button. This will close the dialog. - -**NOTE: C++/CX compilation is currently required in at least one file of your -app's project. This is to make sure that Visual C++'s linker builds a 'Windows -Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** - -For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's -main function, and generate SDL2-WinRTResources.res manually by using `rc` via -the Developer Command Prompt and including it as a within the -first block in your Visual Studio project file. - -### 6. Add app code and assets ### - -At this point, you can add in SDL-specific source code. Be sure to include a -C-style main function (ie: `int main(int argc, char *argv[])`). From there you -should be able to create a single `SDL_Window` (WinRT apps can only have one -window, at present), as well as an `SDL_Renderer`. Direct3D will be used to -draw content. Events are received via SDL's usual event functions -(`SDL_PollEvent`, etc.) If you have a set of existing source files and assets, -you can start adding them to the project now. If not, or if you would like to -make sure that you're setup correctly, some short and simple sample code is -provided below. - - -#### 6.A. ... when creating a new app #### - -If you are creating a new app (rather than porting an existing SDL-based app), -or if you would just like a simple app to test SDL/WinRT with before trying to -get existing code working, some working SDL/WinRT code is provided below. To -set this up: - -1. right click on your app's project -2. select Add, then New Item. An "Add New Item" dialog will show up. -3. from the left-hand list, choose "Visual C++" -4. from the middle/main list, choose "C++ File (.cpp)" -5. near the bottom of the dialog, next to "Name:", type in a name for your -source file, such as, "main.cpp". -6. click on the Add button. This will close the dialog, add the new file to -your project, and open the file in Visual C++'s text editor. -7. Copy and paste the following code into the new file, then save it. - -```c -#include - -int main(int argc, char **argv) -{ - SDL_DisplayMode mode; - SDL_Window * window = NULL; - SDL_Renderer * renderer = NULL; - SDL_Event evt; - SDL_bool keep_going = SDL_TRUE; - - if (SDL_Init(SDL_INIT_VIDEO) != 0) { - return 1; - } else if (SDL_GetCurrentDisplayMode(0, &mode) != 0) { - return 1; - } else if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) { - return 1; - } - - while (keep_going) { - while (SDL_PollEvent(&evt)) { - if ((evt.type == SDL_KEYDOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) { - keep_going = SDL_FALSE; - } - } - - SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); - SDL_RenderClear(renderer); - SDL_RenderPresent(renderer); - } - - SDL_Quit(); - return 0; -} -``` - -#### 6.B. Adding code and assets #### - -If you have existing code and assets that you'd like to add, you should be able -to add them now. The process for adding a set of files is as such. - -1. right click on the app's project -2. select Add, then click on "New Item..." -3. open any source, header, or asset files as appropriate. Support for C and -C++ is available. - -Do note that WinRT only supports a subset of the APIs that are available to -Win32-based apps. Many portions of the Win32 API and the C runtime are not -available. - -A list of unsupported C APIs can be found at - - -General information on using the C runtime in WinRT can be found at - - -A list of supported Win32 APIs for WinRT apps can be found at -. To note, -the list of supported Win32 APIs for Windows Phone 8.0 is different. -That list can be found at - - - -### 7. Build and run your app ### - -Your app project should now be setup, and you should be ready to build your app. -To run it on the local machine, open the Debug menu and choose "Start -Debugging". This will build your app, then run your app full-screen. To switch -out of your app, press the Windows key. Alternatively, you can choose to run -your app in a window. To do this, before building and running your app, find -the drop-down menu in Visual C++'s toolbar that says, "Local Machine". Expand -this by clicking on the arrow on the right side of the list, then click on -Simulator. Once you do that, any time you build and run the app, the app will -launch in window, rather than full-screen. - - -#### 7.A. Running apps on older, ARM-based, "Windows RT" devices #### - -**These instructions do not include Windows Phone, despite Windows Phone -typically running on ARM processors.** They are specifically for devices -that use the "Windows RT" operating system, which was a modified version of -Windows 8.x that ran primarily on ARM-based tablet computers. - -To build and run the app on ARM-based, "Windows RT" devices, you'll need to: - -- install Microsoft's "Remote Debugger" on the device. Visual C++ installs and - debugs ARM-based apps via IP networks. -- change a few options on the development machine, both to make sure it builds - for ARM (rather than x86 or x64), and to make sure it knows how to find the - Windows RT device (on the network). - -Microsoft's Remote Debugger can be found at -. Please note -that separate versions of this debugger exist for different versions of Visual -C++, one each for MSVC 2015, 2013, and 2012. - -To setup Visual C++ to launch your app on an ARM device: - -1. make sure the Remote Debugger is running on your ARM device, and that it's on - the same IP network as your development machine. -2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32". Click - it, then change the value to "ARM". -3. make sure Visual C++ knows the hostname or IP address of the ARM device. To - do this: - 1. open the app project's properties - 2. select "Debugging" - 3. next to "Machine Name", enter the hostname or IP address of the ARM - device - 4. if, and only if, you've turned off authentication in the Remote Debugger, - then change the setting for "Require Authentication" to No - 5. click "OK" -4. build and run the app (from Visual C++). The first time you do this, a - prompt will show up on the ARM device, asking for a Microsoft Account. You - do, unfortunately, need to log in here, and will need to follow the - subsequent registration steps in order to launch the app. After you do so, - if the app didn't already launch, try relaunching it again from within Visual - C++. - - -Troubleshooting ---------------- - -#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'" - -Try adding the following to your linker flags. In MSVC, this can be done by -right-clicking on the app project, navigating to Configuration Properties -> -Linker -> Command Line, then adding them to the Additional Options -section. - -* For Release builds / MSVC-Configurations, add: - - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib - -* For Debug builds / MSVC-Configurations, add: - - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib - - -#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values - -This may be caused by a bug in Windows itself, whereby hiding the mouse -cursor can cause mouse-position reporting to fail. - -SDL provides a workaround for this, but it requires that an app links to a -set of Win32-style cursor image-resource files. A copy of suitable resource -files can be found in `src/main/winrt/`. Adding them to an app's Visual C++ -project file should be sufficient to get the app to use them. - - -#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified." - -This can be caused for any one of a few reasons, which Visual Studio can -report, but won't always do so in an up-front manner. - -To help determine why this error comes up: - -1. open a copy of Visual Studio without opening a project file. This can be - accomplished via Windows' Start Menu, among other means. -2. show Visual Studio's Output window. This can be done by going to VS' - menu bar, then to View, and then to Output. -3. try opening the SDL project file directly by going to VS' menu bar, then - to File, then to Open, then to Project/Solution. When a File-Open dialog - appears, open the SDL project (such as the one in SDL's source code, in its - directory, VisualC-WinRT/UWP_VS2015/). -4. after attempting to open SDL's Visual Studio project file, additional error - information will be output to the Output window. - -If Visual Studio reports (via its Output window) that the project: - -"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections: -Microsoft.VisualStudio.ComponentGroup.UWP.VC" - -... then you will need to re-launch Visual Studio's installer, and make sure that -the workflow for "Universal Windows Platform development" is checked, and that its -optional component, "C++ Universal Windows Platform tools" is also checked. While -you are there, if you are planning on targeting UWP / Windows 10, also make sure -that you check the optional component, "Windows 10 SDK (10.0.10240.0)". After -making sure these items are checked as-appropriate, install them. - -Once you install these components, try re-launching Visual Studio, and re-opening -the SDL project file. If you still get the error dialog, try using the Output -window, again, seeing what Visual Studio says about it. - - -#### Game controllers / joysticks aren't working! - -Windows only permits certain game controllers and joysticks to work within -WinRT / UWP apps. Even if a game controller or joystick works in a Win32 -app, that device is not guaranteed to work inside a WinRT / UWP app. - -According to Microsoft, "Xbox compatible controllers" should work inside -UWP apps, potentially with more working in the future. This includes, but -may not be limited to, Microsoft-made Xbox controllers and USB adapters. -(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop) - - +WinRT +===== + +This port allows SDL applications to run on Microsoft's platforms that require +use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases, +refer to them as either "Windows Store", or for Windows 10, "UWP" apps. + +In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in +modern times this port is focused on UWP apps, which run on Windows 10, +and modern Xbox consoles. + + +Requirements +------------ + +* Microsoft Visual C++ (aka Visual Studio) 2019. + - Free, "Community" or "Express" editions may be used, so long as they + include support for either "Windows Store" or "Windows Phone" apps. + "Express" versions marked as supporting "Windows Desktop" development + typically do not include support for creating WinRT apps, to note. + (The "Community" editions of Visual C++ do, however, support both + desktop/Win32 and WinRT development). +* A valid Microsoft account - This requirement is not imposed by SDL, but + rather by Microsoft's Visual C++ toolchain. This is required to launch or + debug apps. + + +Status +------ + +Here is a rough list of what works, and what doesn't: + +* What works: + * compilation via Visual C++ 2019. + * compile-time platform detection for SDL programs. The C/C++ #define, + `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT. + * GPU-accelerated 2D rendering, via SDL_Renderer. + * OpenGL ES 2, via the ANGLE library (included separately from SDL) + * software rendering, via either SDL_Surface (optionally in conjunction with + SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the + SDL_Renderer APIs + * threads + * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(), + SDL_GetPerformanceFrequency(), etc.) + * file I/O via SDL_RWops + * mouse input (unsupported on Windows Phone) + * audio, via SDL's WASAPI backend (if you want to record, your app must + have "Microphone" capabilities enabled in its manifest, and the user must + not have blocked access. Otherwise, capture devices will fail to work, + presenting as a device disconnect shortly after opening it.) + * .DLL file loading. Libraries *MUST* be packaged inside applications. Loading + anything outside of the app is not supported. + * system path retrieval via SDL's filesystem APIs + * game controllers. Support is provided via the SDL_Joystick and + SDL_GameController APIs, and is backed by Microsoft's XInput API. Please + note, however, that Windows limits game-controller support in UWP apps to, + "Xbox compatible controllers" (many controllers that work in Win32 apps, + do not work in UWP, due to restrictions in UWP itself.) + * multi-touch input + * app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as + appropriate. + * window events + * using Direct3D 11.x APIs outside of SDL. Non-XAML / Direct3D-only apps can + choose to render content directly via Direct3D, using SDL to manage the + internal WinRT window, as well as input and audio. (Use + SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into + IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.) + +* What partially works: + * keyboard input. Most of WinRT's documented virtual keys are supported, as + well as many keys with documented hardware scancodes. Converting + SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs + (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs. + * SDLmain. WinRT uses a different signature for each app's main() function. + SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp + (in `SDL\src\main\winrt\`) directly in order for their C-style main() + functions to be called. + +* What doesn't work: + * compilation with anything other than Visual C++ + * programmatically-created custom cursors. These don't appear to be supported + by WinRT. Different OS-provided cursors can, however, be created via + SDL_CreateSystemCursor() (unsupported on Windows Phone) + * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently + supported by WinRT itself. + * joysticks and game controllers that either are not supported by + Microsoft's XInput API, or are not supported within UWP apps (many + controllers that work in Win32, do not work in UWP, due to restrictions in + UWP itself). + * turning off VSync when rendering on Windows Phone. Attempts to turn VSync + off on Windows Phone result either in Direct3D not drawing anything, or it + forcing VSync back on. As such, SDL_RENDERER_PRESENTVSYNC will always get + turned-on on Windows Phone. This limitation is not present in non-Phone + WinRT (such as Windows 8.x), where turning off VSync appears to work. + * probably anything else that's not listed as supported + + + +Upgrade Notes +------------- + +#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3 + +SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath(). +The fixes may affect older, SDL 2.0.3-based apps' save data. Please note +that these changes only apply to SDL-based WinRT apps, and not to apps for +any other platform. + +1. SDL_GetPrefPath() would return an invalid path, one in which the path's + directory had not been created. Attempts to create files there + (via fopen(), for example), would fail, unless that directory was + explicitly created beforehand. + +2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside + a WinRT 'Roaming' folder, the contents of which get automatically + synchronized across multiple devices. This process can occur while an + application runs, and can cause existing save-data to be overwritten + at unexpected times, with data from other devices. (Windows Phone apps + written with SDL 2.0.3 did not utilize a Roaming folder, due to API + restrictions in Windows Phone 8.0). + + +SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by: + +1. making sure that SDL_GetPrefPath() returns a directory in which data + can be written to immediately, without first needing to create directories. + +2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the + contents of which do not automatically get synchronized across devices + (and which require less work to use safely, in terms of data integrity). + +Apps that wish to get their Roaming folder's path can do so either by using +SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a +UCS-2/wide-char string), or directly through the WinRT class, +Windows.Storage.ApplicationData. + + + +Setup, High-Level Steps +----------------------- + +The steps for setting up a project for an SDL/WinRT app looks like the +following, at a high-level: + +1. create a new Visual C++ project using Microsoft's template for a, + "Direct3D App". +2. remove most of the files from the project. +3. make your app's project directly reference SDL/WinRT's own Visual C++ + project file, via use of Visual C++'s "References" dialog. This will setup + the linker, and will copy SDL's .dll files to your app's final output. +4. adjust your app's build settings, at minimum, telling it where to find SDL's + header files. +5. add files that contains a WinRT-appropriate main function, along with some + data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls) + work properly. +6. add SDL-specific app code. +7. build and run your app. + + +Setup, Detailed Steps +--------------------- + +### 1. Create a new project ### + +Create a new project using one of Visual C++'s templates for a plain, non-XAML, +"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use). If you +don't see one of these templates, in Visual C++'s 'New Project' dialog, try +using the textbox titled, 'Search Installed Templates' to look for one. + + +### 2. Remove unneeded files from the project ### + +In the new project, delete any file that has one of the following extensions: + +- .cpp +- .h +- .hlsl + +When you are done, you should be left with a few files, each of which will be a +necessary part of your app's project. These files will consist of: + +- an .appxmanifest file, which contains metadata on your WinRT app. This is + similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android. +- a few .png files, one of which is a splash screen (displayed when your app + launches), others are app icons. +- a .pfx file, used for code signing purposes. + + +### 3. Add references to SDL's project files ### + +SDL/WinRT can be built in multiple variations, spanning across three different +CPU architectures (x86, x64, and ARM) and two different configurations +(Debug and Release). WinRT and Visual C++ do not currently provide a means +for combining multiple variations of one library into a single file. +Furthermore, it does not provide an easy means for copying pre-built .dll files +into your app's final output (via Post-Build steps, for example). It does, +however, provide a system whereby an app can reference the MSVC projects of +libraries such that, when the app is built: + +1. each library gets built for the appropriate CPU architecture(s) and WinRT + platform(s). +2. each library's output, such as .dll files, get copied to the app's build + output. + +To set this up for SDL/WinRT, you'll need to run through the following steps: + +1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then + "Solution Explorer") +2. right click on your app's solution. +3. navigate to "Add", then to "Existing Project..." +4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT` + directory. +5. once the project has been added, right-click on your app's project and + select, "References..." +6. click on the button titled, "Add New Reference..." +7. check the box next to SDL +8. click OK to close the dialog +9. SDL will now show up in the list of references. Click OK to close that + dialog. + +Your project is now linked to SDL's project, insofar that when the app is +built, SDL will be built as well, with its build output getting included with +your app. + + +### 4. Adjust Your App's Build Settings ### + +Some build settings need to be changed in your app's project. This guide will +outline the following: + +- making sure that the compiler knows where to find SDL's header files +- **Optional for C++, but NECESSARY for compiling C code:** telling the + compiler not to use Microsoft's C++ extensions for WinRT development. +- **Optional:** telling the compiler not generate errors due to missing + precompiled header files. + +To change these settings: + +1. right-click on the project +2. choose "Properties" +3. in the drop-down box next to "Configuration", choose, "All Configurations" +4. in the drop-down box next to "Platform", choose, "All Platforms" +5. in the left-hand list, expand the "C/C++" section +6. select "General" +7. edit the "Additional Include Directories" setting, and add a path to SDL's + "include" directory +8. **Optional: to enable compilation of C code:** change the setting for + "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No". If you're + working with a completely C++ based project, this step can usually be + omitted. +9. **Optional: to disable precompiled headers (which can produce + 'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand + list, select "Precompiled Headers", then change the setting for "Precompiled + Header" from "Use (/Yu)" to "Not Using Precompiled Headers". +10. close the dialog, saving settings, by clicking the "OK" button + + +### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ### + +A few files should be included directly in your app's MSVC project, specifically: +1. a WinRT-appropriate main function (which is different than main() functions on + other platforms) +2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor + (if and when the app needs to do so). *If this cursor resource is not + included, mouse-position reporting may fail if and when the cursor is + hidden, due to possible bugs/design-oddities in Windows itself.* + +To include these files for C/C++ projects: + +1. right-click on your project (again, in Visual C++'s Solution Explorer), + navigate to "Add", then choose "Existing Item...". +2. navigate to the directory containing SDL's source code, then into its + subdirectory, 'src/main/winrt/'. Select, then add, the following files: + - `SDL_winrt_main_NonXAML.cpp` + - `SDL2-WinRTResources.rc` + - `SDL2-WinRTResource_BlankCursor.cur` +3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your + project), then click on "Properties...". +4. in the drop-down box next to "Configuration", choose, "All Configurations" +5. in the drop-down box next to "Platform", choose, "All Platforms" +6. in the left-hand list, click on "C/C++" +7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)". +8. click the OK button. This will close the dialog. + +**NOTE: C++/CX compilation is currently required in at least one file of your +app's project. This is to make sure that Visual C++'s linker builds a 'Windows +Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** + +For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's +main function, and generate SDL2-WinRTResources.res manually by using `rc` via +the Developer Command Prompt and including it as a within the +first block in your Visual Studio project file. + +### 6. Add app code and assets ### + +At this point, you can add in SDL-specific source code. Be sure to include a +C-style main function (ie: `int main(int argc, char *argv[])`). From there you +should be able to create a single `SDL_Window` (WinRT apps can only have one +window, at present), as well as an `SDL_Renderer`. Direct3D will be used to +draw content. Events are received via SDL's usual event functions +(`SDL_PollEvent`, etc.) If you have a set of existing source files and assets, +you can start adding them to the project now. If not, or if you would like to +make sure that you're setup correctly, some short and simple sample code is +provided below. + + +#### 6.A. ... when creating a new app #### + +If you are creating a new app (rather than porting an existing SDL-based app), +or if you would just like a simple app to test SDL/WinRT with before trying to +get existing code working, some working SDL/WinRT code is provided below. To +set this up: + +1. right click on your app's project +2. select Add, then New Item. An "Add New Item" dialog will show up. +3. from the left-hand list, choose "Visual C++" +4. from the middle/main list, choose "C++ File (.cpp)" +5. near the bottom of the dialog, next to "Name:", type in a name for your +source file, such as, "main.cpp". +6. click on the Add button. This will close the dialog, add the new file to +your project, and open the file in Visual C++'s text editor. +7. Copy and paste the following code into the new file, then save it. + +```c +#include + +int main(int argc, char **argv) +{ + SDL_DisplayMode mode; + SDL_Window * window = NULL; + SDL_Renderer * renderer = NULL; + SDL_Event evt; + SDL_bool keep_going = SDL_TRUE; + + if (SDL_Init(SDL_INIT_VIDEO) != 0) { + return 1; + } else if (SDL_GetCurrentDisplayMode(0, &mode) != 0) { + return 1; + } else if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) { + return 1; + } + + while (keep_going) { + while (SDL_PollEvent(&evt)) { + if ((evt.type == SDL_KEYDOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) { + keep_going = SDL_FALSE; + } + } + + SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + } + + SDL_Quit(); + return 0; +} +``` + +#### 6.B. Adding code and assets #### + +If you have existing code and assets that you'd like to add, you should be able +to add them now. The process for adding a set of files is as such. + +1. right click on the app's project +2. select Add, then click on "New Item..." +3. open any source, header, or asset files as appropriate. Support for C and +C++ is available. + +Do note that WinRT only supports a subset of the APIs that are available to +Win32-based apps. Many portions of the Win32 API and the C runtime are not +available. + +A list of unsupported C APIs can be found at + + +General information on using the C runtime in WinRT can be found at + + +A list of supported Win32 APIs for WinRT apps can be found at +. To note, +the list of supported Win32 APIs for Windows Phone 8.0 is different. +That list can be found at + + + +### 7. Build and run your app ### + +Your app project should now be setup, and you should be ready to build your app. +To run it on the local machine, open the Debug menu and choose "Start +Debugging". This will build your app, then run your app full-screen. To switch +out of your app, press the Windows key. Alternatively, you can choose to run +your app in a window. To do this, before building and running your app, find +the drop-down menu in Visual C++'s toolbar that says, "Local Machine". Expand +this by clicking on the arrow on the right side of the list, then click on +Simulator. Once you do that, any time you build and run the app, the app will +launch in window, rather than full-screen. + + +#### 7.A. Running apps on older, ARM-based, "Windows RT" devices #### + +**These instructions do not include Windows Phone, despite Windows Phone +typically running on ARM processors.** They are specifically for devices +that use the "Windows RT" operating system, which was a modified version of +Windows 8.x that ran primarily on ARM-based tablet computers. + +To build and run the app on ARM-based, "Windows RT" devices, you'll need to: + +- install Microsoft's "Remote Debugger" on the device. Visual C++ installs and + debugs ARM-based apps via IP networks. +- change a few options on the development machine, both to make sure it builds + for ARM (rather than x86 or x64), and to make sure it knows how to find the + Windows RT device (on the network). + +Microsoft's Remote Debugger can be found at +. Please note +that separate versions of this debugger exist for different versions of Visual +C++, one each for MSVC 2015, 2013, and 2012. + +To setup Visual C++ to launch your app on an ARM device: + +1. make sure the Remote Debugger is running on your ARM device, and that it's on + the same IP network as your development machine. +2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32". Click + it, then change the value to "ARM". +3. make sure Visual C++ knows the hostname or IP address of the ARM device. To + do this: + 1. open the app project's properties + 2. select "Debugging" + 3. next to "Machine Name", enter the hostname or IP address of the ARM + device + 4. if, and only if, you've turned off authentication in the Remote Debugger, + then change the setting for "Require Authentication" to No + 5. click "OK" +4. build and run the app (from Visual C++). The first time you do this, a + prompt will show up on the ARM device, asking for a Microsoft Account. You + do, unfortunately, need to log in here, and will need to follow the + subsequent registration steps in order to launch the app. After you do so, + if the app didn't already launch, try relaunching it again from within Visual + C++. + + +Troubleshooting +--------------- + +#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'" + +Try adding the following to your linker flags. In MSVC, this can be done by +right-clicking on the app project, navigating to Configuration Properties -> +Linker -> Command Line, then adding them to the Additional Options +section. + +* For Release builds / MSVC-Configurations, add: + + /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib + +* For Debug builds / MSVC-Configurations, add: + + /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib + + +#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values + +This may be caused by a bug in Windows itself, whereby hiding the mouse +cursor can cause mouse-position reporting to fail. + +SDL provides a workaround for this, but it requires that an app links to a +set of Win32-style cursor image-resource files. A copy of suitable resource +files can be found in `src/main/winrt/`. Adding them to an app's Visual C++ +project file should be sufficient to get the app to use them. + + +#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified." + +This can be caused for any one of a few reasons, which Visual Studio can +report, but won't always do so in an up-front manner. + +To help determine why this error comes up: + +1. open a copy of Visual Studio without opening a project file. This can be + accomplished via Windows' Start Menu, among other means. +2. show Visual Studio's Output window. This can be done by going to VS' + menu bar, then to View, and then to Output. +3. try opening the SDL project file directly by going to VS' menu bar, then + to File, then to Open, then to Project/Solution. When a File-Open dialog + appears, open the SDL project (such as the one in SDL's source code, in its + directory, VisualC-WinRT/UWP_VS2015/). +4. after attempting to open SDL's Visual Studio project file, additional error + information will be output to the Output window. + +If Visual Studio reports (via its Output window) that the project: + +"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections: +Microsoft.VisualStudio.ComponentGroup.UWP.VC" + +... then you will need to re-launch Visual Studio's installer, and make sure that +the workflow for "Universal Windows Platform development" is checked, and that its +optional component, "C++ Universal Windows Platform tools" is also checked. While +you are there, if you are planning on targeting UWP / Windows 10, also make sure +that you check the optional component, "Windows 10 SDK (10.0.10240.0)". After +making sure these items are checked as-appropriate, install them. + +Once you install these components, try re-launching Visual Studio, and re-opening +the SDL project file. If you still get the error dialog, try using the Output +window, again, seeing what Visual Studio says about it. + + +#### Game controllers / joysticks aren't working! + +Windows only permits certain game controllers and joysticks to work within +WinRT / UWP apps. Even if a game controller or joystick works in a Win32 +app, that device is not guaranteed to work inside a WinRT / UWP app. + +According to Microsoft, "Xbox compatible controllers" should work inside +UWP apps, potentially with more working in the future. This includes, but +may not be limited to, Microsoft-made Xbox controllers and USB adapters. +(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop) + + diff --git a/include/SDL.h b/include/SDL.h index 12e7f31a2869c..0fe0713391a97 100644 --- a/include/SDL.h +++ b/include/SDL.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,6 @@ * Main include header for the SDL library */ - #ifndef SDL_h_ #define SDL_h_ @@ -70,6 +69,8 @@ extern "C" { #endif +/* WIKI CATEGORY: Init */ + /* As of version 0.5, SDL is loaded dynamically into the application */ /** @@ -130,7 +131,7 @@ extern "C" { * call SDL_Quit() to force shutdown). If a subsystem is already loaded then * this call will increase the ref-count and return. * - * \param flags subsystem initialization flags + * \param flags subsystem initialization flags. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * diff --git a/include/SDL_assert.h b/include/SDL_assert.h index e71cf9792dbcb..5d7e19ae7cdb7 100644 --- a/include/SDL_assert.h +++ b/include/SDL_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,10 +55,14 @@ assert can have unique static variables associated with it. #define SDL_TriggerBreakpoint() __builtin_debugtrap() #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" ) #elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */ #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) #elif defined(__APPLE__) && defined(__arm__) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" ) +#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) ) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" ) #elif defined(__386__) && defined(__WATCOMC__) #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) @@ -125,12 +129,10 @@ typedef struct SDL_AssertData const struct SDL_AssertData *next; } SDL_AssertData; -#if (SDL_ASSERT_LEVEL > 0) - /* Never call this directly. Use the SDL_assert* macros. */ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, - const char *, - const char *, int) + const char *, + const char *, int) #if defined(__clang__) #if __has_feature(attribute_analyzer_noreturn) /* this tells Clang's static analysis that we're a custom assert function, @@ -151,9 +153,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, #define SDL_enabled_assert(condition) \ do { \ while ( !(condition) ) { \ - static struct SDL_AssertData sdl_assert_data = { \ - 0, 0, #condition, 0, 0, 0, 0 \ - }; \ + static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, NULL, 0, NULL, NULL }; \ const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ continue; /* go again. */ \ @@ -164,8 +164,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, } \ } while (SDL_NULL_WHILE_LOOP_CONDITION) -#endif /* enabled assertions support code */ - /* Enable various levels of assertions. */ #if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ # define SDL_assert(condition) SDL_disabled_assert(condition) @@ -195,8 +193,8 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, * A callback that fires when an SDL assertion fails. * * \param data a pointer to the SDL_AssertData structure corresponding to the - * current assertion - * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler() + * current assertion. + * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler(). * \returns an SDL_AssertState value indicating how to handle the failure. */ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( @@ -216,8 +214,8 @@ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! * * \param handler the SDL_AssertionHandler function to call when an assertion - * fails or NULL for the default handler - * \param userdata a pointer that is passed to `handler` + * fails or NULL for the default handler. + * \param userdata a pointer that is passed to `handler`. * * \since This function is available since SDL 2.0.0. * @@ -258,7 +256,7 @@ extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void * data, it is safe to pass a NULL pointer to this function to ignore it. * * \param puserdata pointer which is filled with the "userdata" pointer that - * was passed to SDL_SetAssertionHandler() + * was passed to SDL_SetAssertionHandler(). * \returns the SDL_AssertionHandler that is called when an assert triggers. * * \since This function is available since SDL 2.0.2. diff --git a/include/SDL_atomic.h b/include/SDL_atomic.h index f0c05f4bb84e3..226ec7c67f607 100644 --- a/include/SDL_atomic.h +++ b/include/SDL_atomic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,38 +20,29 @@ */ /** - * \file SDL_atomic.h + * # CategoryAtomic * * Atomic operations. * - * IMPORTANT: - * If you are not an expert in concurrent lockless programming, you should - * only be using the atomic lock and reference counting functions in this - * file. In all other cases you should be protecting your data structures - * with full mutexes. + * IMPORTANT: If you are not an expert in concurrent lockless programming, you + * should not be using any functions in this file. You should be protecting + * your data structures with full mutexes instead. * - * The list of "safe" functions to use are: - * SDL_AtomicLock() - * SDL_AtomicUnlock() - * SDL_AtomicIncRef() - * SDL_AtomicDecRef() + * ***Seriously, here be dragons!*** * - * Seriously, here be dragons! - * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - * - * You can find out a little more about lockless programming and the - * subtle issues that can arise here: - * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * You can find out a little more about lockless programming and the subtle + * issues that can arise here: + * https://learn.microsoft.com/en-us/windows/win32/dxtecharts/lockless-programming * * There's also lots of good information here: - * http://www.1024cores.net/home/lock-free-algorithms - * http://preshing.com/ * - * These operations may or may not actually be implemented using - * processor specific atomic operations. When possible they are - * implemented as true processor specific atomic operations. When that - * is not possible the are implemented using locks that *do* use the - * available atomic operations. + * - https://www.1024cores.net/home/lock-free-algorithms + * - https://preshing.com/ + * + * These operations may or may not actually be implemented using processor + * specific atomic operations. When possible they are implemented as true + * processor specific atomic operations. When that is not possible the are + * implemented using locks that *do* use the available atomic operations. * * All of the atomic operations that modify memory are full memory barriers. */ @@ -94,7 +85,7 @@ typedef int SDL_SpinLock; * ***Please note that spinlocks are dangerous if you don't know what you're * doing. Please be careful using any sort of spinlock!*** * - * \param lock a pointer to a lock variable + * \param lock a pointer to a lock variable. * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already * held. * @@ -111,7 +102,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); * ***Please note that spinlocks are dangerous if you don't know what you're * doing. Please be careful using any sort of spinlock!*** * - * \param lock a pointer to a lock variable + * \param lock a pointer to a lock variable. * * \since This function is available since SDL 2.0.0. * @@ -128,7 +119,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); * ***Please note that spinlocks are dangerous if you don't know what you're * doing. Please be careful using any sort of spinlock!*** * - * \param lock a pointer to a lock variable + * \param lock a pointer to a lock variable. * * \since This function is available since SDL 2.0.0. * @@ -209,7 +200,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) #ifdef __thumb__ /* The mcr instruction isn't available in thumb mode, use real functions */ #define SDL_MEMORY_BARRIER_USES_FUNCTION @@ -240,7 +231,7 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); /* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */ #if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) #define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */ -#elif (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) +#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__) #define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory") #elif (defined(__powerpc__) || defined(__powerpc64__)) #define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27"); @@ -249,19 +240,21 @@ typedef void (*SDL_KernelMemoryBarrierFunc)(); #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) #define SDL_CPUPauseInstruction() __yield() #elif defined(__WATCOMC__) && defined(__386__) - /* watcom assembler rejects PAUSE if CPU < i686, and it refuses REP NOP as an invalid combination. Hardcode the bytes. */ extern __inline void SDL_CPUPauseInstruction(void); - #pragma aux SDL_CPUPauseInstruction = "db 0f3h,90h" + #pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause" #else #define SDL_CPUPauseInstruction() #endif /** - * \brief A type representing an atomic integer value. It is a struct - * so people don't accidentally use numeric operations on it. + * A type representing an atomic integer value. + * + * It is a struct so people don't accidentally use numeric operations on it. */ -typedef struct { int value; } SDL_atomic_t; +typedef struct SDL_atomic_t { + int value; +} SDL_atomic_t; /** * Set an atomic variable to a new value if it is currently an old value. @@ -269,9 +262,9 @@ typedef struct { int value; } SDL_atomic_t; * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param oldval the old value - * \param newval the new value + * \param a a pointer to an SDL_atomic_t variable to be modified. + * \param oldval the old value. + * \param newval the new value. * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -290,8 +283,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value + * \param a a pointer to an SDL_atomic_t variable to be modified. + * \param v the desired value. * \returns the previous value of the atomic variable. * * \since This function is available since SDL 2.0.2. @@ -306,7 +299,7 @@ extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to an SDL_atomic_t variable + * \param a a pointer to an SDL_atomic_t variable. * \returns the current value of an atomic variable. * * \since This function is available since SDL 2.0.2. @@ -323,8 +316,8 @@ extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to an SDL_atomic_t variable to be modified - * \param v the desired value to add + * \param a a pointer to an SDL_atomic_t variable to be modified. + * \param v the desired value to add. * \returns the previous value of the atomic variable. * * \since This function is available since SDL 2.0.2. @@ -357,9 +350,9 @@ extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to a pointer - * \param oldval the old pointer value - * \param newval the new pointer value + * \param a a pointer to a pointer. + * \param oldval the old pointer value. + * \param newval the new pointer value. * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -376,8 +369,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void * * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to a pointer - * \param v the desired pointer value + * \param a a pointer to a pointer. + * \param v the desired pointer value. * \returns the previous value of the pointer. * * \since This function is available since SDL 2.0.2. @@ -393,7 +386,7 @@ extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); * ***Note: If you don't know what this function is for, you shouldn't use * it!*** * - * \param a a pointer to a pointer + * \param a a pointer to a pointer. * \returns the current value of a pointer. * * \since This function is available since SDL 2.0.2. diff --git a/include/SDL_audio.h b/include/SDL_audio.h index c42de3ed97b36..77d69dd864a08 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,9 +22,9 @@ /* !!! FIXME: several functions in here need Doxygen comments. */ /** - * \file SDL_audio.h + * # CategoryAudio * - * Access to the raw audio mixing buffer for the SDL library. + * Access to the raw audio mixing buffer for the SDL library. */ #ifndef SDL_audio_h_ @@ -44,24 +44,24 @@ extern "C" { #endif /** - * \brief Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * \verbatim - ++-----------------------sample is signed if set - || - || ++-----------sample is bigendian if set - || || - || || ++---sample is float if set - || || || - || || || +---sample bit size---+ - || || || | | - 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - \endverbatim - * - * There are macros in SDL 2.0 and later to query these bits. + * Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * ``` + * ++-----------------------sample is signed if set + * || + * || ++-----------sample is bigendian if set + * || || + * || || ++---sample is float if set + * || || || + * || || || +---sample bit size---+ + * || || || | | + * 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + * ``` + * + * There are macros in SDL 2.0 and later to query these bits. */ typedef Uint16 SDL_AudioFormat; @@ -149,33 +149,30 @@ typedef Uint16 SDL_AudioFormat; /* @} *//* Audio flags */ /** - * This function is called when the audio device needs more data. + * This function is called when the audio device needs more data. * - * \param userdata An application-specific parameter saved in - * the SDL_AudioSpec structure - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - * - * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if - * you like. Just open your audio device with a NULL callback. + * \param userdata An application-specific parameter saved in the + * SDL_AudioSpec structure. + * \param stream A pointer to the audio data buffer. + * \param len Length of **stream** in bytes. */ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, int len); /** - * The calculated values in this structure are calculated by SDL_OpenAudio(). - * - * For multi-channel audio, the default SDL channel mapping is: - * 2: FL FR (stereo) - * 3: FL FR LFE (2.1 surround) - * 4: FL FR BL BR (quad) - * 5: FL FR LFE BL BR (4.1 surround) - * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) - * 7: FL FR FC LFE BC SL SR (6.1 surround) - * 8: FL FR FC LFE BL BR SL SR (7.1 surround) + * The calculated values in this structure are calculated by SDL_OpenAudio(). + * + * For multi-channel audio, the default SDL channel mapping is: + * + * ``` + * 2: FL FR (stereo) + * 3: FL FR LFE (2.1 surround) + * 4: FL FR BL BR (quad) + * 5: FL FR LFE BL BR (4.1 surround) + * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) + * 7: FL FR FC LFE BC SL SR (6.1 surround) + * 8: FL FR FC LFE BL BR SL SR (7.1 surround) + * ``` */ typedef struct SDL_AudioSpec { @@ -196,11 +193,11 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, SDL_AudioFormat format); /** - * \brief Upper limit of filters in SDL_AudioCVT + * Upper limit of filters in SDL_AudioCVT * - * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is - * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, - * one of which is the terminating NULL pointer. + * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is + * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, one + * of which is the terminating NULL pointer. */ #define SDL_AUDIOCVT_MAX_FILTERS 9 @@ -287,7 +284,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); * meant to be proper names. * * \param index the index of the audio driver; the value ranges from 0 to - * SDL_GetNumAudioDrivers() - 1 + * SDL_GetNumAudioDrivers() - 1. * \returns the name of the audio driver at the requested index, or NULL if an * invalid index was specified. * @@ -314,7 +311,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); * specific need to designate the audio driver you want to use. You should * normally use SDL_Init() or SDL_InitSubSystem(). * - * \param driver_name the name of the desired audio driver + * \param driver_name the name of the desired audio driver. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -408,13 +405,13 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained); /** - * SDL Audio Device IDs. + * SDL Audio Device IDs. * - * A successful call to SDL_OpenAudio() is always device id 1, and legacy - * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls - * always returns devices >= 2 on success. The legacy calls are good both - * for backwards compatibility and when you don't care about multiple, - * specific, or capture devices. + * A successful call to SDL_OpenAudio() is always device id 1, and legacy SDL + * audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both for + * backwards compatibility and when you don't care about multiple, specific, + * or capture devices. */ typedef Uint32 SDL_AudioDeviceID; @@ -452,7 +449,7 @@ typedef Uint32 SDL_AudioDeviceID; * ``` * * \param iscapture zero to request playback devices, non-zero to request - * recording devices + * recording devices. * \returns the number of available devices exposed by the current driver or * -1 if an explicit list of devices can't be determined. A return * value of -1 does not necessarily mean an error condition. @@ -478,7 +475,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); * invalid next time any of several other SDL functions are called. * * \param index the index of the audio device; valid values range from 0 to - * SDL_GetNumAudioDevices() - 1 + * SDL_GetNumAudioDevices() - 1. * \param iscapture non-zero to query the list of recording devices, zero to * query the list of output devices. * \returns the name of the audio device at the requested index, or NULL on @@ -504,11 +501,11 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, * count. * * \param index the index of the audio device; valid values range from 0 to - * SDL_GetNumAudioDevices() - 1 + * SDL_GetNumAudioDevices() - 1. * \param iscapture non-zero to query the list of recording devices, zero to * query the list of output devices. * \param spec The SDL_AudioSpec to be initialized by this function. - * \returns 0 on success, nonzero on error + * \returns 0 on success, nonzero on error. * * \since This function is available since SDL 2.0.16. * @@ -542,7 +539,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index, * \param spec The SDL_AudioSpec to be initialized by this function. * \param iscapture non-zero to query the default recording device, zero to * query the default output device. - * \returns 0 on success, nonzero on error + * \returns 0 on success, nonzero on error. * * \since This function is available since SDL 2.24.0. * @@ -594,7 +591,7 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name, * frames_ (with stereo output, two samples--left and right--would make a * single sample frame). This number should be a power of two, and may be * adjusted by the audio driver to a value more suitable for the hardware. - * Good values seem to range between 512 and 8096 inclusive, depending on + * Good values seem to range between 512 and 4096 inclusive, depending on * the application and CPU speed. Smaller values reduce latency, but can * lead to underflow if the application is doing heavy processing and cannot * fill the audio buffer in time. Note that the number of sample frames is @@ -645,13 +642,13 @@ extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name, * driver-specific name as appropriate. NULL requests the most * reasonable default device. * \param iscapture non-zero to specify a device should be opened for - * recording, not playback + * recording, not playback. * \param desired an SDL_AudioSpec structure representing the desired output - * format; see SDL_OpenAudio() for more information + * format; see SDL_OpenAudio() for more information. * \param obtained an SDL_AudioSpec structure filled in with the actual output - * format; see SDL_OpenAudio() for more information - * \param allowed_changes 0, or one or more flags OR'd together - * \returns a valid device ID that is > 0 on success or 0 on failure; call + * format; see SDL_OpenAudio() for more information. + * \param allowed_changes 0, or one or more flags OR'd together. + * \returns a valid device ID > 0 on success or 0 on failure; call * SDL_GetError() for more information. * * For compatibility with SDL 1.2, this will never return 1, since @@ -712,7 +709,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); * Use this function to get the current audio state of an audio device. * * \param dev the ID of an audio device previously opened with - * SDL_OpenAudioDevice() + * SDL_OpenAudioDevice(). * \returns the SDL_AudioStatus of the specified audio device. * * \since This function is available since SDL 2.0.0. @@ -745,7 +742,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDevice * * ...and is only useful if you used the legacy SDL_OpenAudio() function. * - * \param pause_on non-zero to pause, 0 to unpause + * \param pause_on non-zero to pause, 0 to unpause. * * \since This function is available since SDL 2.0.0. * @@ -775,8 +772,8 @@ extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); * callback, you shouldn't pause the audio device, as it will lead to dropouts * in the audio playback. Instead, you should use SDL_LockAudioDevice(). * - * \param dev a device opened by SDL_OpenAudioDevice() - * \param pause_on non-zero to pause, 0 to unpause + * \param dev a device opened by SDL_OpenAudioDevice(). + * \param pause_on non-zero to pause, 0 to unpause. * * \since This function is available since SDL 2.0.0. * @@ -841,14 +838,14 @@ extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, * SDL_LoadWAV("sample.wav", &spec, &buf, &len); * ``` * - * \param src The data source for the WAVE data - * \param freesrc If non-zero, SDL will _always_ free the data source + * \param src The data source for the WAVE data. + * \param freesrc If non-zero, SDL will _always_ free the data source. * \param spec An SDL_AudioSpec that will be filled in with the wave file's - * format details + * format details. * \param audio_buf A pointer filled with the audio data, allocated by the * function. * \param audio_len A pointer filled with the length of the audio data buffer - * in bytes + * in bytes. * \returns This function, if successfully called, returns `spec`, which will * be filled with the audio data format of the wave source data. * `audio_buf` will be filled with a pointer to an allocated buffer @@ -874,8 +871,9 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, Uint32 * audio_len); /** - * Loads a WAV from a file. - * Compatibility convenience function. + * Loads a WAV from a file. + * + * Compatibility convenience function. */ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) @@ -888,7 +886,7 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, * this function with a NULL pointer. * * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or - * SDL_LoadWAV_RW() + * SDL_LoadWAV_RW(). * * \since This function is available since SDL 2.0.0. * @@ -912,15 +910,16 @@ extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); * and then can call SDL_ConvertAudio() to complete the conversion. * * \param cvt an SDL_AudioCVT structure filled in with audio conversion - * information + * information. * \param src_format the source format of the audio data; for more info see - * SDL_AudioFormat - * \param src_channels the number of channels in the source - * \param src_rate the frequency (sample-frames-per-second) of the source + * SDL_AudioFormat. + * \param src_channels the number of channels in the source. + * \param src_rate the frequency (sample-frames-per-second) of the source. * \param dst_format the destination format of the audio data; for more info - * see SDL_AudioFormat - * \param dst_channels the number of channels in the destination - * \param dst_rate the frequency (sample-frames-per-second) of the destination + * see SDL_AudioFormat. + * \param dst_channels the number of channels in the destination. + * \param dst_rate the frequency (sample-frames-per-second) of the + * destination. * \returns 1 if the audio filter is prepared, 0 if no conversion is needed, * or a negative error code on failure; call SDL_GetError() for more * information. @@ -991,12 +990,12 @@ typedef struct _SDL_AudioStream SDL_AudioStream; /** * Create a new audio stream. * - * \param src_format The format of the source audio - * \param src_channels The number of channels of the source audio - * \param src_rate The sampling rate of the source audio - * \param dst_format The format of the desired audio output - * \param dst_channels The number of channels of the desired audio output - * \param dst_rate The sampling rate of the desired audio output + * \param src_format The format of the source audio. + * \param src_channels The number of channels of the source audio. + * \param src_rate The sampling rate of the source audio. + * \param dst_format The format of the desired audio output. + * \param dst_channels The number of channels of the desired audio output. + * \param dst_rate The sampling rate of the desired audio output. * \returns 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.7. @@ -1018,9 +1017,9 @@ extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioForm /** * Add data to be converted/resampled to the stream. * - * \param stream The stream the audio data is being added to - * \param buf A pointer to the audio data to add - * \param len The number of bytes to write to the stream + * \param stream The stream the audio data is being added to. + * \param buf A pointer to the audio data to add. + * \param len The number of bytes to write to the stream. * \returns 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.7. @@ -1037,10 +1036,10 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const vo /** * Get converted/resampled data from the stream * - * \param stream The stream the audio is being requested from - * \param buf A buffer to fill with audio data - * \param len The maximum number of bytes to fill - * \returns the number of bytes read from the stream, or -1 on error + * \param stream The stream the audio is being requested from. + * \param buf A buffer to fill with audio data. + * \param len The maximum number of bytes to fill. + * \returns the number of bytes read from the stream, or -1 on error. * * \since This function is available since SDL 2.0.7. * @@ -1060,6 +1059,9 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *bu * resample correctly, so this number might be lower than what you expect, or * even be zero. Add more data or flush the stream if you need the data now. * + * \param stream the audio stream to query. + * \returns the number of bytes available. + * * \since This function is available since SDL 2.0.7. * * \sa SDL_NewAudioStream @@ -1079,6 +1081,9 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); * audio gaps in the output. Generally this is intended to signal the end of * input, so the complete output becomes available. * + * \param stream the audio stream to flush. + * \returns 0 on success, otherwise -1. + * * \since This function is available since SDL 2.0.7. * * \sa SDL_NewAudioStream @@ -1093,6 +1098,8 @@ extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); /** * Clear any pending data in the stream without converting it * + * \param stream the audio stream to clear. + * * \since This function is available since SDL 2.0.7. * * \sa SDL_NewAudioStream @@ -1107,6 +1114,8 @@ extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); /** * Free an audio stream * + * \param stream the audio stream to free. + * * \since This function is available since SDL 2.0.7. * * \sa SDL_NewAudioStream @@ -1118,6 +1127,9 @@ extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); */ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); +/** + * Maximum volume allowed in calls to SDL_MixAudio and SDL_MixAudioFormat. + */ #define SDL_MIX_MAXVOLUME 128 /** @@ -1132,11 +1144,11 @@ extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); * ...where `format` is the obtained format of the audio device from the * legacy SDL_OpenAudio() function. * - * \param dst the destination for the mixed audio - * \param src the source audio buffer to be mixed - * \param len the length of the audio buffer in bytes + * \param dst the destination for the mixed audio. + * \param src the source audio buffer to be mixed. + * \param len the length of the audio buffer in bytes. * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume + * for full audio volume. * * \since This function is available since SDL 2.0.0. * @@ -1165,13 +1177,13 @@ extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, * SDL_MixAudioFormat() is really only needed when you're mixing a single * audio stream with a volume adjustment. * - * \param dst the destination for the mixed audio - * \param src the source audio buffer to be mixed + * \param dst the destination for the mixed audio. + * \param src the source audio buffer to be mixed. * \param format the SDL_AudioFormat structure representing the desired audio - * format - * \param len the length of the audio buffer in bytes + * format. + * \param len the length of the audio buffer in bytes. * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME - * for full audio volume + * for full audio volume. * * \since This function is available since SDL 2.0.0. */ @@ -1215,9 +1227,9 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, * from planar audio formats into a non-planar one (see SDL_AudioFormat) * before queuing audio. * - * \param dev the device ID to which we will queue audio - * \param data the data to queue to the device for later playback - * \param len the number of bytes (not samples!) to which `data` points + * \param dev the device ID to which we will queue audio. + * \param data the data to queue to the device for later playback. + * \param len the number of bytes (not samples!) to which `data` points. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1263,9 +1275,9 @@ extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *da * You should not call SDL_LockAudio() on the device before dequeueing; SDL * handles locking internally for this function. * - * \param dev the device ID from which we will dequeue audio - * \param data a pointer into where audio data should be copied - * \param len the number of bytes (not samples!) to which (data) points + * \param dev the device ID from which we will dequeue audio. + * \param data a pointer into where audio data should be copied. + * \param len the number of bytes (not samples!) to which (data) points. * \returns the number of bytes dequeued, which could be less than requested; * call SDL_GetError() for more information. * @@ -1299,7 +1311,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *dat * You should not call SDL_LockAudio() on the device before querying; SDL * handles locking internally for this function. * - * \param dev the device ID of which we will query queued audio size + * \param dev the device ID of which we will query queued audio size. * \returns the number of bytes (not samples!) of queued audio. * * \since This function is available since SDL 2.0.4. @@ -1334,7 +1346,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); * * This function always succeeds and thus returns void. * - * \param dev the device ID of which to clear the audio queue + * \param dev the device ID of which to clear the audio queue. * * \since This function is available since SDL 2.0.4. * @@ -1406,7 +1418,7 @@ extern DECLSPEC void SDLCALL SDL_LockAudio(void); * at once, not only will you block the audio callback, you'll block the other * thread. * - * \param dev the ID of the device to be locked + * \param dev the ID of the device to be locked. * * \since This function is available since SDL 2.0.0. * @@ -1439,7 +1451,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); * * This function should be paired with a previous SDL_LockAudioDevice() call. * - * \param dev the ID of the device to be unlocked + * \param dev the ID of the device to be unlocked. * * \since This function is available since SDL 2.0.0. * @@ -1481,7 +1493,7 @@ extern DECLSPEC void SDLCALL SDL_CloseAudio(void); * The device ID is invalid as soon as the device is closed, and is eligible * for reuse in a new SDL_OpenAudioDevice() call immediately. * - * \param dev an audio device previously opened with SDL_OpenAudioDevice() + * \param dev an audio device previously opened with SDL_OpenAudioDevice(). * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_bits.h b/include/SDL_bits.h index 22cb853140ddf..747f556511385 100644 --- a/include/SDL_bits.h +++ b/include/SDL_bits.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_bits.h + * # CategoryBits * - * Functions for fiddling with bits and bitmasks. + * Functions for fiddling with bits and bitmasks. */ #ifndef SDL_bits_h_ @@ -56,6 +56,12 @@ extern __inline int _SDL_bsr_watcom(Uint32); modify exact [eax] nomemory; #endif +/** + * Use this function to get the index of the most significant (set) bit in a + * + * \param x the number to find the MSB of. + * \returns the index of the most significant bit of x, or -1 if x is 0. + */ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x) { diff --git a/include/SDL_blendmode.h b/include/SDL_blendmode.h index 08c9f9dd65346..c0c68113315fd 100644 --- a/include/SDL_blendmode.h +++ b/include/SDL_blendmode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_blendmode.h + * # CategoryBlendmode * - * Header file declaring the SDL_BlendMode enumeration + * Header file declaring the SDL_BlendMode enumeration */ #ifndef SDL_blendmode_h_ @@ -35,9 +35,9 @@ extern "C" { #endif /** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + * The blend mode used in SDL_RenderCopy() and drawing operations. */ -typedef enum +typedef enum SDL_BlendMode { SDL_BLENDMODE_NONE = 0x00000000, /**< no blending dstRGBA = srcRGBA */ @@ -52,7 +52,7 @@ typedef enum dstA = dstA */ SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) - dstA = (srcA * dstA) + (dstA * (1-srcA)) */ + dstA = dstA */ SDL_BLENDMODE_INVALID = 0x7FFFFFFF /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ @@ -60,21 +60,22 @@ typedef enum } SDL_BlendMode; /** - * \brief The blend operation used when combining source and destination pixel components + * The blend operation used when combining source and destination pixel + * components */ -typedef enum +typedef enum SDL_BlendOperation { SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ } SDL_BlendOperation; /** - * \brief The normalized factor used to multiply pixel components + * The normalized factor used to multiply pixel components */ -typedef enum +typedef enum SDL_BlendFactor { SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ @@ -158,18 +159,18 @@ typedef enum * case. * * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the source pixels + * blue components of the source pixels. * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and - * blue components of the destination pixels + * blue components of the destination pixels. * \param colorOperation the SDL_BlendOperation used to combine the red, * green, and blue components of the source and - * destination pixels + * destination pixels. * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the source pixels + * the source pixels. * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of - * the destination pixels + * the destination pixels. * \param alphaOperation the SDL_BlendOperation used to combine the alpha - * component of the source and destination pixels + * component of the source and destination pixels. * \returns an SDL_BlendMode that represents the chosen factors and * operations. * diff --git a/include/SDL_clipboard.h b/include/SDL_clipboard.h index 783c7c251a913..2ae16a1d05eb5 100644 --- a/include/SDL_clipboard.h +++ b/include/SDL_clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ /** - * \file SDL_clipboard.h + * # CategoryClipboard * * Include file for SDL clipboard handling */ @@ -41,7 +41,7 @@ extern "C" { /** * Put UTF-8 text into the clipboard. * - * \param text the text to store in the clipboard + * \param text the text to store in the clipboard. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -85,7 +85,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); /** * Put UTF-8 text into the primary selection. * - * \param text the text to store in the primary selection + * \param text the text to store in the primary selection. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * diff --git a/include/SDL_config.h b/include/SDL_config.h index f91cb47ec74a8..eabd78b52a168 100644 --- a/include/SDL_config.h +++ b/include/SDL_config.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,7 @@ #include "SDL_platform.h" -/** - * \file SDL_config.h - */ +/* WIKI CATEGORY: - */ /* Add any platform that doesn't build using the configure system. */ #if defined(__WIN32__) diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake index 8fcb63d18fbec..64b8413c8cdc7 100644 --- a/include/SDL_config.h.cmake +++ b/include/SDL_config.h.cmake @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,7 +49,7 @@ /* Comment this if you want to build without any C library requirements */ #cmakedefine HAVE_LIBC 1 -#if HAVE_LIBC +#ifdef HAVE_LIBC /* Useful headers */ #cmakedefine STDC_HEADERS 1 @@ -190,7 +190,10 @@ #cmakedefine HAVE_FOPEN64 1 #cmakedefine HAVE_FSEEKO 1 #cmakedefine HAVE_FSEEKO64 1 +#cmakedefine HAVE_MEMFD_CREATE 1 +#cmakedefine HAVE_POSIX_FALLOCATE 1 #cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SIGTIMEDWAIT 1 #cmakedefine HAVE_SA_SIGACTION 1 #cmakedefine HAVE_SETJMP 1 #cmakedefine HAVE_NANOSLEEP 1 @@ -200,6 +203,7 @@ #cmakedefine HAVE_GETPAGESIZE 1 #cmakedefine HAVE_MPROTECT 1 #cmakedefine HAVE_ICONV 1 +#cmakedefine SDL_USE_LIBICONV 1 #cmakedefine HAVE_PTHREAD_SETNAME_NP 1 #cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 #cmakedefine HAVE_SEM_TIMEDWAIT 1 @@ -240,7 +244,7 @@ #cmakedefine HAVE_LIBUDEV_H 1 #cmakedefine HAVE_LIBSAMPLERATE_H 1 -#cmakedefine HAVE_LIBDECOR_H 1 +#cmakedefine HAVE_LIBDECOR_H 1 #cmakedefine HAVE_D3D_H @HAVE_D3D_H@ #cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@ @@ -259,8 +263,7 @@ #cmakedefine HAVE_ROAPI_H @HAVE_ROAPI_H@ #cmakedefine HAVE_SHELLSCALINGAPI_H @HAVE_SHELLSCALINGAPI_H@ -#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@ -#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@ +#cmakedefine USE_POSIX_SPAWN @USE_POSIX_SPAWN@ /* SDL internal assertion support */ #if @SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED@ @@ -332,6 +335,7 @@ #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ #cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@ #cmakedefine SDL_INPUT_FBSDKBIO @SDL_INPUT_FBSDKBIO@ +#cmakedefine SDL_INPUT_WSCONS @SDL_INPUT_WSCONS@ #cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@ #cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@ #cmakedefine SDL_JOYSTICK_WGI @SDL_JOYSTICK_WGI@ @@ -359,6 +363,7 @@ #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@ #cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@ #cmakedefine SDL_LIBUSB_DYNAMIC @SDL_LIBUSB_DYNAMIC@ +#cmakedefine SDL_UDEV_DYNAMIC @SDL_UDEV_DYNAMIC@ /* Enable various sensor drivers */ #cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@ @@ -523,7 +528,7 @@ #cmakedefine SDL_ARM_NEON_BLITTERS @SDL_ARM_NEON_BLITTERS@ /* Whether SDL_DYNAMIC_API needs dlopen */ -#cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@ +#cmakedefine DYNAPI_NEEDS_DLOPEN @DYNAPI_NEEDS_DLOPEN@ /* Enable dynamic libsamplerate support */ #cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@ @@ -539,7 +544,9 @@ #cmakedefine SDL_VIDEO_VITA_PVR @SDL_VIDEO_VITA_PVR@ #cmakedefine SDL_VIDEO_VITA_PVR_OGL @SDL_VIDEO_VITA_PVR_OGL@ -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#cmakedefine SDL_HAVE_LIBDECOR_GET_MIN_MAX @SDL_HAVE_LIBDECOR_GET_MIN_MAX@ + +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ #if defined(_MSC_VER) && (_MSC_VER < 1600) typedef signed __int8 int8_t; diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 7b8d848e0b1bc..35281d158d869 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,7 +53,7 @@ /* Comment this if you want to build without any C library requirements */ #undef HAVE_LIBC -#if HAVE_LIBC +#ifdef HAVE_LIBC /* Useful headers */ #undef STDC_HEADERS @@ -195,6 +195,7 @@ #undef HAVE_FSEEKO #undef HAVE_FSEEKO64 #undef HAVE_SIGACTION +#undef HAVE_SIGTIMEDWAIT #undef HAVE_SA_SIGACTION #undef HAVE_SETJMP #undef HAVE_NANOSLEEP @@ -204,15 +205,19 @@ #undef HAVE_GETPAGESIZE #undef HAVE_MPROTECT #undef HAVE_ICONV +#undef SDL_USE_LIBICONV #undef HAVE_PTHREAD_SETNAME_NP #undef HAVE_PTHREAD_SET_NAME_NP #undef HAVE_SEM_TIMEDWAIT #undef HAVE_GETAUXVAL #undef HAVE_ELF_AUX_INFO #undef HAVE_POLL +#undef HAVE_MEMFD_CREATE +#undef HAVE_POSIX_FALLOCATE #undef HAVE__EXIT #else + #define HAVE_STDARG_H 1 #define HAVE_STDDEF_H 1 #define HAVE_STDINT_H 1 @@ -241,8 +246,6 @@ #undef HAVE_DXGI_H #undef HAVE_WINDOWS_GAMING_INPUT_H #undef HAVE_XINPUT_H -#undef HAVE_XINPUT_GAMEPAD_EX -#undef HAVE_XINPUT_STATE_EX #undef HAVE_MMDEVICEAPI_H #undef HAVE_AUDIOCLIENT_H @@ -491,4 +494,7 @@ /* Enable dynamic libsamplerate support */ #undef SDL_LIBSAMPLERATE_DYNAMIC +/* Libdecor get min/max content size functions */ +#undef SDL_HAVE_LIBDECOR_GET_MIN_MAX + #endif /* SDL_config_h_ */ diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h index 64918ae0b8a51..0609995e97dcb 100644 --- a/include/SDL_config_android.h +++ b/include/SDL_config_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_emscripten.h b/include/SDL_config_emscripten.h index 989e1243a7bbd..3f064905746d3 100644 --- a/include/SDL_config_emscripten.h +++ b/include/SDL_config_emscripten.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index 6db16eb4ccfb8..fed314e8bd66a 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index e7189f3a14b08..e9e6b6d328d91 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_minimal.h b/include/SDL_config_minimal.h index 2f2559eefefbc..5695871787f58 100644 --- a/include/SDL_config_minimal.h +++ b/include/SDL_config_minimal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,7 +34,7 @@ #define HAVE_STDARG_H 1 #define HAVE_STDDEF_H 1 -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ #if defined(_MSC_VER) && (_MSC_VER < 1600) typedef signed __int8 int8_t; diff --git a/include/SDL_config_ngage.h b/include/SDL_config_ngage.h index a9d2d37ab5ec2..b6042cd19e97a 100644 --- a/include/SDL_config_ngage.h +++ b/include/SDL_config_ngage.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h index c86769db4ea57..22fafb1f0e768 100644 --- a/include/SDL_config_os2.h +++ b/include/SDL_config_os2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -47,7 +47,7 @@ /* dynamically loaded libusb-1.0 dll: */ #define SDL_LIBUSB_DYNAMIC "usb100.dll" #endif -/*#undef SDL_JOYSTICK_VIRTUAL */ +#define SDL_JOYSTICK_VIRTUAL 1 /* Enable OpenGL support */ /* #undef SDL_VIDEO_OPENGL */ @@ -114,9 +114,6 @@ #define HAVE_MEMCPY 1 #define HAVE_MEMMOVE 1 #define HAVE_MEMCMP 1 -#define HAVE_WCSLEN 1 -#define HAVE_WCSLCPY 1 -#define HAVE_WCSLCAT 1 #define HAVE_WCSCMP 1 #define HAVE__WCSICMP 1 #define HAVE__WCSNICMP 1 diff --git a/include/SDL_config_pandora.h b/include/SDL_config_pandora.h index 01bbf49b06fcc..96375c1e0595f 100644 --- a/include/SDL_config_pandora.h +++ b/include/SDL_config_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h index 58e0b7ecbf0c2..77d2d74fd1a91 100644 --- a/include/SDL_config_windows.h +++ b/include/SDL_config_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -52,7 +52,7 @@ /* This is a set of defines to configure the SDL features */ -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_) /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ #if defined(_MSC_VER) && (_MSC_VER < 1600) typedef signed __int8 int8_t; @@ -99,9 +99,11 @@ typedef unsigned int uintptr_t; #define HAVE_D3D11_H 1 #define HAVE_ROAPI_H 1 #endif -#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */ +#if defined(__has_include) +#if __has_include() && __has_include() #define HAVE_D3D12_H 1 #endif +#endif #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */ #define HAVE_SHELLSCALINGAPI_H 1 #endif diff --git a/include/SDL_config_wingdk.h b/include/SDL_config_wingdk.h index 6f793d2aa2d84..2e329279db615 100644 --- a/include/SDL_config_wingdk.h +++ b/include/SDL_config_wingdk.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h index da894c883ea77..8fe0b66dbfe42 100644 --- a/include/SDL_config_winrt.h +++ b/include/SDL_config_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -54,7 +54,7 @@ /* Useful headers */ #define HAVE_DXGI_H 1 -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP +#if !SDL_WINAPI_FAMILY_PHONE #define HAVE_XINPUT_H 1 #endif @@ -161,7 +161,7 @@ #define SDL_AUDIO_DRIVER_DUMMY 1 /* Enable various input drivers */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE #define SDL_JOYSTICK_DISABLED 1 #define SDL_HAPTIC_DISABLED 1 #else @@ -208,9 +208,9 @@ #define SDL_VIDEO_RENDER_D3D11 1 /* Disable D3D12 as it's not implemented for WinRT */ -#define SDL_VIDEO_RENDER_D3D12 0 +/* #undef SDL_VIDEO_RENDER_D3D12 */ -#if SDL_VIDEO_OPENGL_ES2 +#ifdef SDL_VIDEO_OPENGL_ES2 #define SDL_VIDEO_RENDER_OGL_ES2 1 #endif diff --git a/include/SDL_config_xbox.h b/include/SDL_config_xbox.h index 54fa1a42b54e8..a06f52e544ede 100644 --- a/include/SDL_config_xbox.h +++ b/include/SDL_config_xbox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -209,16 +209,21 @@ #define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_WINDOWS 1 -/* #ifndef SDL_VIDEO_RENDER_D3D -#define SDL_VIDEO_RENDER_D3D 1 -#endif*/ -#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H) -#define SDL_VIDEO_RENDER_D3D11 1 -#endif #if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H) #define SDL_VIDEO_RENDER_D3D12 1 #endif +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + /* Enable system power support */ /*#define SDL_POWER_WINDOWS 1*/ #define SDL_POWER_HARDWIRED 1 diff --git a/include/SDL_copying.h b/include/SDL_copying.h index 49e3f9da07a50..bde7431896c96 100644 --- a/include/SDL_copying.h +++ b/include/SDL_copying.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index b5ad0fcb8869c..696a03bf7bd77 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,10 +19,16 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: CPUInfo */ + /** - * \file SDL_cpuinfo.h + * # CategoryCPUInfo + * + * CPU feature detection for SDL. * - * CPU feature detection for SDL. + * These functions are largely concerned with reporting if the system has + * access to various SIMD instruction sets, but also has other important info + * to share, such as number of logical CPU cores. */ #ifndef SDL_cpuinfo_h_ @@ -53,9 +59,11 @@ _m_prefetch(void *__P) #ifndef __MMX__ #define __MMX__ #endif +/* #ifndef __3dNOW__ #define __3dNOW__ #endif +*/ #endif #ifndef __SSE__ #define __SSE__ @@ -107,7 +115,8 @@ _m_prefetch(void *__P) #include #define __LASX__ #endif -#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) +#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) && \ + (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)) #include #else #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) diff --git a/include/SDL_egl.h b/include/SDL_egl.h index e8bd657b263bd..31290ec25a055 100644 --- a/include/SDL_egl.h +++ b/include/SDL_egl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +19,10 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_egl.h - * - * This is a simple file to encapsulate the EGL API headers. +/* + * This is a simple file to encapsulate the EGL API headers. */ + #if !defined(_MSC_VER) && !defined(__ANDROID__) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) #if defined(__vita__) || defined(__psp2__) diff --git a/include/SDL_endian.h b/include/SDL_endian.h index c3f84317fbdeb..96aca54c62d71 100644 --- a/include/SDL_endian.h +++ b/include/SDL_endian.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_endian.h + * # CategoryEndian * - * Functions for reading and writing endian-specific values + * Functions for reading and writing endian-specific values */ #ifndef SDL_endian_h_ @@ -33,7 +33,7 @@ #if defined(_MSC_VER) && (_MSC_VER >= 1400) /* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ -#ifdef __clang__ +#if defined(__clang__) && !_SDL_HAS_BUILTIN(_m_prefetch) #ifndef __PRFCHWINTRIN_H #define __PRFCHWINTRIN_H static __inline__ void __attribute__((__always_inline__, __nodebug__)) @@ -59,6 +59,15 @@ _m_prefetch(void *__P) #ifdef __linux__ #include #define SDL_BYTEORDER __BYTE_ORDER +#elif defined(__sun) && defined(__SVR4) /* Solaris */ +#include +#if defined(_LITTLE_ENDIAN) +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#elif defined(_BIG_ENDIAN) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#error Unsupported endianness +#endif #elif defined(__OpenBSD__) || defined(__DragonFly__) #include #define SDL_BYTEORDER BYTE_ORDER @@ -79,7 +88,7 @@ _m_prefetch(void *__P) defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MIPSEB__)) || \ defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ - defined(__sparc__) + defined(__sparc__) || defined(__sparc) #define SDL_BYTEORDER SDL_BIG_ENDIAN #else #define SDL_BYTEORDER SDL_LIL_ENDIAN @@ -140,7 +149,7 @@ extern "C" { #if HAS_BUILTIN_BSWAP16 #define SDL_Swap16(x) __builtin_bswap16(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) #pragma intrinsic(_byteswap_ushort) #define SDL_Swap16(x) _byteswap_ushort(x) #elif defined(__i386__) && !HAS_BROKEN_BSWAP @@ -180,6 +189,16 @@ extern __inline Uint16 SDL_Swap16(Uint16); parm [ax] \ modify [ax]; #else + +/** + * Use this function to swap the byte order of a 16-bit value. + * + * \param x the value to be swapped. + * \returns the swapped value. + * + * \sa SDL_SwapBE16 + * \sa SDL_SwapLE16 + */ SDL_FORCE_INLINE Uint16 SDL_Swap16(Uint16 x) { @@ -189,7 +208,7 @@ SDL_Swap16(Uint16 x) #if HAS_BUILTIN_BSWAP32 #define SDL_Swap32(x) __builtin_bswap32(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) #pragma intrinsic(_byteswap_ulong) #define SDL_Swap32(x) _byteswap_ulong(x) #elif defined(__i386__) && !HAS_BROKEN_BSWAP @@ -231,6 +250,16 @@ extern __inline Uint32 SDL_Swap32(Uint32); parm [eax] \ modify [eax]; #else + +/** + * Use this function to swap the byte order of a 32-bit value. + * + * \param x the value to be swapped. + * \returns the swapped value. + * + * \sa SDL_SwapBE32 + * \sa SDL_SwapLE32 + */ SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { @@ -241,7 +270,7 @@ SDL_Swap32(Uint32 x) #if HAS_BUILTIN_BSWAP64 #define SDL_Swap64(x) __builtin_bswap64(x) -#elif defined(_MSC_VER) && (_MSC_VER >= 1400) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) #pragma intrinsic(_byteswap_uint64) #define SDL_Swap64(x) _byteswap_uint64(x) #elif defined(__i386__) && !HAS_BROKEN_BSWAP @@ -276,6 +305,16 @@ extern __inline Uint64 SDL_Swap64(Uint64); parm [eax edx] \ modify [eax edx]; #else + +/** + * Use this function to swap the byte order of a 64-bit value. + * + * \param x the value to be swapped. + * \returns the swapped value. + * + * \sa SDL_SwapBE64 + * \sa SDL_SwapLE64 + */ SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { @@ -293,6 +332,15 @@ SDL_Swap64(Uint64 x) #endif +/** + * Use this function to swap the byte order of a floating point value. + * + * \param x the value to be swapped. + * \returns the swapped value. + * + * \sa SDL_SwapFloatBE + * \sa SDL_SwapFloatLE + */ SDL_FORCE_INLINE float SDL_SwapFloat(float x) { diff --git a/include/SDL_error.h b/include/SDL_error.h index 5c961e4284ef4..8d9cde0e77542 100644 --- a/include/SDL_error.h +++ b/include/SDL_error.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_error.h + * # CategoryError * - * Simple error message routines for SDL. + * Simple error message routines for SDL. */ #ifndef SDL_error_h_ @@ -53,9 +53,9 @@ extern "C" { * } * ``` * - * \param fmt a printf()-style message format string + * \param fmt a printf()-style message format string. * \param ... additional parameters matching % tokens in the `fmt` string, if - * any + * any. * \returns always -1. * * \since This function is available since SDL 2.0.0. @@ -109,8 +109,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetError(void); * otherwise operates exactly the same as SDL_GetError(). * * \param errstr A buffer to fill with the last error message that was set for - * the current thread - * \param maxlen The size of the buffer pointed to by the errstr parameter + * the current thread. + * \param maxlen The size of the buffer pointed to by the errstr parameter. * \returns the pointer passed in as the `errstr` parameter. * * \since This function is available since SDL 2.0.14. diff --git a/include/SDL_events.h b/include/SDL_events.h index 55a343e080a7c..b9596c0ef5eba 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_events.h + * # CategoryEvents * - * Include file for SDL event handling. + * Include file for SDL event handling. */ #ifndef SDL_events_h_ @@ -52,7 +52,7 @@ extern "C" { /** * The types of events that can be delivered. */ -typedef enum +typedef enum SDL_EventType { SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ @@ -131,6 +131,8 @@ typedef enum SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ + SDL_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, + SDL_CONTROLLERSTEAMHANDLEUPDATED, /**< Game controller Steam handle has changed */ /* Touch events */ SDL_FINGERDOWN = 0x700, @@ -165,7 +167,7 @@ typedef enum /* Internal events */ SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */ - /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + /** Events SDL_USEREVENT through SDL_LASTEVENT are for your use, * and should be allocated with SDL_RegisterEvents() */ SDL_USEREVENT = 0x8000, @@ -177,7 +179,7 @@ typedef enum } SDL_EventType; /** - * \brief Fields shared by every event + * Fields shared by every event */ typedef struct SDL_CommonEvent { @@ -186,14 +188,14 @@ typedef struct SDL_CommonEvent } SDL_CommonEvent; /** - * \brief Display state change event data (event.display.*) + * Display state change event data (event.display.*) */ typedef struct SDL_DisplayEvent { - Uint32 type; /**< ::SDL_DISPLAYEVENT */ + Uint32 type; /**< SDL_DISPLAYEVENT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 display; /**< The associated display index */ - Uint8 event; /**< ::SDL_DisplayEventID */ + Uint8 event; /**< SDL_DisplayEventID */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -201,14 +203,14 @@ typedef struct SDL_DisplayEvent } SDL_DisplayEvent; /** - * \brief Window state change event data (event.window.*) + * Window state change event data (event.window.*) */ typedef struct SDL_WindowEvent { - Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 type; /**< SDL_WINDOWEVENT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The associated window */ - Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 event; /**< SDL_WindowEventID */ Uint8 padding1; Uint8 padding2; Uint8 padding3; @@ -217,14 +219,14 @@ typedef struct SDL_WindowEvent } SDL_WindowEvent; /** - * \brief Keyboard button event structure (event.key.*) + * Keyboard button event structure (event.key.*) */ typedef struct SDL_KeyboardEvent { - Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 type; /**< SDL_KEYDOWN or SDL_KEYUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with keyboard focus, if any */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 repeat; /**< Non-zero if this is a key repeat */ Uint8 padding2; Uint8 padding3; @@ -232,12 +234,13 @@ typedef struct SDL_KeyboardEvent } SDL_KeyboardEvent; #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) + /** - * \brief Keyboard text editing event structure (event.edit.*) + * Keyboard text editing event structure (event.edit.*) */ typedef struct SDL_TextEditingEvent { - Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 type; /**< SDL_TEXTEDITING */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with keyboard focus, if any */ char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ @@ -246,12 +249,12 @@ typedef struct SDL_TextEditingEvent } SDL_TextEditingEvent; /** - * \brief Extended keyboard text editing event structure (event.editExt.*) when text would be - * truncated if stored in the text buffer SDL_TextEditingEvent + * Extended keyboard text editing event structure (event.editExt.*) when text + * would be truncated if stored in the text buffer SDL_TextEditingEvent */ typedef struct SDL_TextEditingExtEvent { - Uint32 type; /**< ::SDL_TEXTEDITING_EXT */ + Uint32 type; /**< SDL_TEXTEDITING_EXT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with keyboard focus, if any */ char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */ @@ -259,24 +262,43 @@ typedef struct SDL_TextEditingExtEvent Sint32 length; /**< The length of selected editing text */ } SDL_TextEditingExtEvent; +/** + * The maximum bytes of text that can be supplied in an SDL_TextInputEvent. + */ #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) + /** - * \brief Keyboard text input event structure (event.text.*) + * Keyboard text input event structure (event.text.*) + * + * `text` is limited to SDL_TEXTINPUTEVENT_TEXT_SIZE bytes. If the incoming + * string is larger than this, SDL will split it and send it in pieces, across + * multiple events. The string is in UTF-8 format, and if split, SDL + * guarantees that it will not split in the middle of a UTF-8 sequence, so any + * event will only contain complete codepoints. However, if there are several + * codepoints that go together into a single glyph (like an emoji "thumbs up" + * followed by a skin color), they may be split between events. + * + * This event will never be delivered unless text input is enabled by calling + * SDL_StartTextInput(). Text input is enabled by default on desktop + * platforms, and disabled by default on mobile platforms! + * + * \sa SDL_StartTextInput + * \sa SDL_StopTextInput */ typedef struct SDL_TextInputEvent { - Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 type; /**< SDL_TEXTINPUT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with keyboard focus, if any */ - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text; UTF-8 encoded. */ } SDL_TextInputEvent; /** - * \brief Mouse motion event structure (event.motion.*) + * Mouse motion event structure (event.motion.*) */ typedef struct SDL_MouseMotionEvent { - Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 type; /**< SDL_MOUSEMOTION */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with mouse focus, if any */ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ @@ -288,16 +310,16 @@ typedef struct SDL_MouseMotionEvent } SDL_MouseMotionEvent; /** - * \brief Mouse button event structure (event.button.*) + * Mouse button event structure (event.button.*) */ typedef struct SDL_MouseButtonEvent { - Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with mouse focus, if any */ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ Uint8 button; /**< The mouse button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ Uint8 padding1; Sint32 x; /**< X coordinate, relative to window */ @@ -305,11 +327,11 @@ typedef struct SDL_MouseButtonEvent } SDL_MouseButtonEvent; /** - * \brief Mouse wheel event structure (event.wheel.*) + * Mouse wheel event structure (event.wheel.*) */ typedef struct SDL_MouseWheelEvent { - Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 type; /**< SDL_MOUSEWHEEL */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The window with mouse focus, if any */ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ @@ -323,11 +345,11 @@ typedef struct SDL_MouseWheelEvent } SDL_MouseWheelEvent; /** - * \brief Joystick axis motion event structure (event.jaxis.*) + * Joystick axis motion event structure (event.jaxis.*) */ typedef struct SDL_JoyAxisEvent { - Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 type; /**< SDL_JOYAXISMOTION */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 axis; /**< The joystick axis index */ @@ -339,11 +361,11 @@ typedef struct SDL_JoyAxisEvent } SDL_JoyAxisEvent; /** - * \brief Joystick trackball motion event structure (event.jball.*) + * Joystick trackball motion event structure (event.jball.*) */ typedef struct SDL_JoyBallEvent { - Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 type; /**< SDL_JOYBALLMOTION */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 ball; /**< The joystick trackball index */ @@ -355,18 +377,18 @@ typedef struct SDL_JoyBallEvent } SDL_JoyBallEvent; /** - * \brief Joystick hat position change event structure (event.jhat.*) + * Joystick hat position change event structure (event.jhat.*) */ typedef struct SDL_JoyHatEvent { - Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 type; /**< SDL_JOYHATMOTION */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 hat; /**< The joystick hat index */ Uint8 value; /**< The hat position value. - * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP - * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT - * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP + * \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT + * \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN * * Note that zero means the POV is centered. */ @@ -375,46 +397,51 @@ typedef struct SDL_JoyHatEvent } SDL_JoyHatEvent; /** - * \brief Joystick button event structure (event.jbutton.*) + * Joystick button event structure (event.jbutton.*) */ typedef struct SDL_JoyButtonEvent { - Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The joystick button index */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 padding1; Uint8 padding2; } SDL_JoyButtonEvent; /** - * \brief Joystick device event structure (event.jdevice.*) + * Joystick device event structure (event.jdevice.*) + * + * SDL will send JOYSTICK_ADDED events for devices that are already plugged in + * during SDL_Init. + * + * \sa SDL_ControllerDeviceEvent */ typedef struct SDL_JoyDeviceEvent { - Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 type; /**< SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ } SDL_JoyDeviceEvent; /** - * \brief Joysick battery level change event structure (event.jbattery.*) + * Joysick battery level change event structure (event.jbattery.*) */ typedef struct SDL_JoyBatteryEvent { - Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */ + Uint32 type; /**< SDL_JOYBATTERYUPDATED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ SDL_JoystickPowerLevel level; /**< The joystick battery level */ } SDL_JoyBatteryEvent; /** - * \brief Game controller axis motion event structure (event.caxis.*) + * Game controller axis motion event structure (event.caxis.*) */ typedef struct SDL_ControllerAxisEvent { - Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 type; /**< SDL_CONTROLLERAXISMOTION */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ @@ -427,36 +454,42 @@ typedef struct SDL_ControllerAxisEvent /** - * \brief Game controller button event structure (event.cbutton.*) + * Game controller button event structure (event.cbutton.*) */ typedef struct SDL_ControllerButtonEvent { - Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 type; /**< SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Uint8 button; /**< The controller button (SDL_GameControllerButton) */ - Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ Uint8 padding1; Uint8 padding2; } SDL_ControllerButtonEvent; /** - * \brief Controller device event structure (event.cdevice.*) + * Controller device event structure (event.cdevice.*) + * + * Joysticks that are supported game controllers receive both an + * SDL_JoyDeviceEvent and an SDL_ControllerDeviceEvent. + * + * SDL will send CONTROLLERDEVICEADDED events for joysticks that are already + * plugged in during SDL_Init() and are recognized as game controllers. */ typedef struct SDL_ControllerDeviceEvent { - Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 type; /**< SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, or SDL_CONTROLLERSTEAMHANDLEUPDATED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ } SDL_ControllerDeviceEvent; /** - * \brief Game controller touchpad event structure (event.ctouchpad.*) + * Game controller touchpad event structure (event.ctouchpad.*) */ typedef struct SDL_ControllerTouchpadEvent { - Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ + Uint32 type; /**< SDL_CONTROLLERTOUCHPADDOWN or SDL_CONTROLLERTOUCHPADMOTION or SDL_CONTROLLERTOUCHPADUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ Sint32 touchpad; /**< The index of the touchpad */ @@ -467,24 +500,24 @@ typedef struct SDL_ControllerTouchpadEvent } SDL_ControllerTouchpadEvent; /** - * \brief Game controller sensor event structure (event.csensor.*) + * Game controller sensor event structure (event.csensor.*) */ typedef struct SDL_ControllerSensorEvent { - Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ + Uint32 type; /**< SDL_CONTROLLERSENSORUPDATE */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_JoystickID which; /**< The joystick instance id */ - Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ + Sint32 sensor; /**< The type of the sensor, one of the values of SDL_SensorType */ float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */ } SDL_ControllerSensorEvent; /** - * \brief Audio device event structure (event.adevice.*) + * Audio device event structure (event.adevice.*) */ typedef struct SDL_AudioDeviceEvent { - Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ + Uint32 type; /**< SDL_AUDIODEVICEADDED, or SDL_AUDIODEVICEREMOVED */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ @@ -495,11 +528,11 @@ typedef struct SDL_AudioDeviceEvent /** - * \brief Touch finger event structure (event.tfinger.*) + * Touch finger event structure (event.tfinger.*) */ typedef struct SDL_TouchFingerEvent { - Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 type; /**< SDL_FINGERMOTION or SDL_FINGERDOWN or SDL_FINGERUP */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_TouchID touchId; /**< The touch device id */ SDL_FingerID fingerId; @@ -513,11 +546,11 @@ typedef struct SDL_TouchFingerEvent /** - * \brief Multiple Finger Gesture Event (event.mgesture.*) + * Multiple Finger Gesture Event (event.mgesture.*) */ typedef struct SDL_MultiGestureEvent { - Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 type; /**< SDL_MULTIGESTURE */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_TouchID touchId; /**< The touch device id */ float dTheta; @@ -530,11 +563,11 @@ typedef struct SDL_MultiGestureEvent /** - * \brief Dollar Gesture Event (event.dgesture.*) + * Dollar Gesture Event (event.dgesture.*) */ typedef struct SDL_DollarGestureEvent { - Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ + Uint32 type; /**< SDL_DOLLARGESTURE or SDL_DOLLARRECORD */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_TouchID touchId; /**< The touch device id */ SDL_GestureID gestureId; @@ -546,13 +579,15 @@ typedef struct SDL_DollarGestureEvent /** - * \brief An event used to request a file open by the system (event.drop.*) - * This event is enabled by default, you can disable it with SDL_EventState(). - * \note If this event is enabled, you must free the filename in the event. + * An event used to request a file open by the system (event.drop.*) + * + * This event is enabled by default, you can disable it with SDL_EventState(). + * + * If this event is enabled, you must free the filename in the event. */ typedef struct SDL_DropEvent { - Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ + Uint32 type; /**< SDL_DROPBEGIN or SDL_DROPFILE or SDL_DROPTEXT or SDL_DROPCOMPLETE */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ Uint32 windowID; /**< The window that was dropped on, if any */ @@ -560,11 +595,11 @@ typedef struct SDL_DropEvent /** - * \brief Sensor event structure (event.sensor.*) + * Sensor event structure (event.sensor.*) */ typedef struct SDL_SensorEvent { - Uint32 type; /**< ::SDL_SENSORUPDATE */ + Uint32 type; /**< SDL_SENSORUPDATE */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Sint32 which; /**< The instance ID of the sensor */ float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ @@ -572,29 +607,20 @@ typedef struct SDL_SensorEvent } SDL_SensorEvent; /** - * \brief The "quit requested" event + * The "quit requested" event */ typedef struct SDL_QuitEvent { - Uint32 type; /**< ::SDL_QUIT */ + Uint32 type; /**< SDL_QUIT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ } SDL_QuitEvent; /** - * \brief OS Specific event - */ -typedef struct SDL_OSEvent -{ - Uint32 type; /**< ::SDL_QUIT */ - Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ -} SDL_OSEvent; - -/** - * \brief A user-defined event type (event.user.*) + * A user-defined event type (event.user.*) */ typedef struct SDL_UserEvent { - Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 type; /**< SDL_USEREVENT through SDL_LASTEVENT-1 */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ Uint32 windowID; /**< The associated window if any */ Sint32 code; /**< User defined event code */ @@ -607,20 +633,24 @@ struct SDL_SysWMmsg; typedef struct SDL_SysWMmsg SDL_SysWMmsg; /** - * \brief A video driver dependent system event (event.syswm.*) - * This event is disabled by default, you can enable it with SDL_EventState() + * A video driver dependent system event (event.syswm.*) * - * \note If you want to use this event, you should include SDL_syswm.h. + * This event is disabled by default, you can enable it with SDL_EventState() + * + * If you want to use this event, you should include SDL_syswm.h. */ typedef struct SDL_SysWMEvent { - Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 type; /**< SDL_SYSWMEVENT */ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ } SDL_SysWMEvent; /** - * \brief General event structure + * General event structure + * + * The SDL_Event structure is the core of all event handling in SDL. SDL_Event + * is a union of all event structures used in SDL. */ typedef union SDL_Event { @@ -703,7 +733,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NUL extern DECLSPEC void SDLCALL SDL_PumpEvents(void); /* @{ */ -typedef enum +typedef enum SDL_eventaction { SDL_ADDEVENT, SDL_PEEKEVENT, @@ -730,15 +760,15 @@ typedef enum * * This function is thread-safe. * - * \param events destination buffer for the retrieved events + * \param events destination buffer for the retrieved events. * \param numevents if action is SDL_ADDEVENT, the number of events to add * back to the event queue; if action is SDL_PEEKEVENT or - * SDL_GETEVENT, the maximum number of events to retrieve - * \param action action to take; see [[#action|Remarks]] for details + * SDL_GETEVENT, the maximum number of events to retrieve. + * \param action action to take; see [[#action|Remarks]] for details. * \param minType minimum value of the event type to be considered; - * SDL_FIRSTEVENT is a safe choice + * SDL_FIRSTEVENT is a safe choice. * \param maxType maximum value of the event type to be considered; - * SDL_LASTEVENT is a safe choice + * SDL_LASTEVENT is a safe choice. * \returns the number of events actually stored or a negative error code on * failure; call SDL_GetError() for more information. * @@ -759,7 +789,7 @@ extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, * If you need to check for a range of event types, use SDL_HasEvents() * instead. * - * \param type the type of event to be queried; see SDL_EventType for details + * \param type the type of event to be queried; see SDL_EventType for details. * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if * events matching `type` are not present. * @@ -776,9 +806,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); * If you need to check for a single event type, use SDL_HasEvent() instead. * * \param minType the low end of event type to be queried, inclusive; see - * SDL_EventType for details + * SDL_EventType for details. * \param maxType the high end of event type to be queried, inclusive; see - * SDL_EventType for details + * SDL_EventType for details. * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are * present, or SDL_FALSE if not. * @@ -802,7 +832,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); * sure that all pending OS events are flushed, you can call SDL_PumpEvents() * on the main thread immediately before the flush call. * - * \param type the type of event to be cleared; see SDL_EventType for details + * \param type the type of event to be cleared; see SDL_EventType for details. * * \since This function is available since SDL 2.0.0. * @@ -825,9 +855,9 @@ extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); * on the main thread immediately before the flush call. * * \param minType the low end of event type to be cleared, inclusive; see - * SDL_EventType for details + * SDL_EventType for details. * \param maxType the high end of event type to be cleared, inclusive; see - * SDL_EventType for details + * SDL_EventType for details. * * \since This function is available since SDL 2.0.0. * @@ -868,7 +898,7 @@ extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); * ``` * * \param event the SDL_Event structure to be filled with the next event from - * the queue, or NULL + * the queue, or NULL. * \returns 1 if there is a pending event or 0 if there are none available. * * \since This function is available since SDL 2.0.0. @@ -892,7 +922,7 @@ extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); * this function in the thread that initialized the video subsystem. * * \param event the SDL_Event structure to be filled in with the next event - * from the queue, or NULL + * from the queue, or NULL. * \returns 1 on success or 0 if there was an error while waiting for events; * call SDL_GetError() for more information. * @@ -915,9 +945,9 @@ extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); * this function in the thread that initialized the video subsystem. * * \param event the SDL_Event structure to be filled in with the next event - * from the queue, or NULL + * from the queue, or NULL. * \param timeout the maximum number of milliseconds to wait for the next - * available event + * available event. * \returns 1 on success or 0 if there was an error while waiting for events; * call SDL_GetError() for more information. This also returns 0 if * the timeout elapsed without an event arriving. @@ -952,7 +982,7 @@ extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, * get an event type that does not conflict with other code that also wants * its own custom event types. * - * \param event the SDL_Event to be added to the queue + * \param event the SDL_Event to be added to the queue. * \returns 1 on success, 0 if the event was filtered, or a negative error * code on failure; call SDL_GetError() for more information. A * common reason for error is the event queue being full. @@ -968,11 +998,11 @@ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); /** * A function pointer used for callbacks that watch the event queue. * - * \param userdata what was passed as `userdata` to SDL_SetEventFilter() - * or SDL_AddEventWatch, etc - * \param event the event that triggered the callback - * \returns 1 to permit event to be added to the queue, and 0 to disallow - * it. When used with SDL_AddEventWatch, the return value is ignored. + * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or + * SDL_AddEventWatch, etc. + * \param event the event that triggered the callback. + * \returns 1 to permit event to be added to the queue, and 0 to disallow it. + * When used with SDL_AddEventWatch, the return value is ignored. * * \sa SDL_SetEventFilter * \sa SDL_AddEventWatch @@ -995,7 +1025,7 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the * application at the next event poll. * - * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * There is one caveat when dealing with the SDL_QuitEvent event type. The * event filter is only called when the window manager desires to close the * application window. If the event filter returns 1, then the window will be * closed, otherwise the window will remain open if possible. @@ -1010,8 +1040,8 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); * the event filter, but events pushed onto the queue with SDL_PeepEvents() do * not. * - * \param filter An SDL_EventFilter function to call when an event happens - * \param userdata a pointer that is passed to `filter` + * \param filter An SDL_EventFilter function to call when an event happens. + * \param userdata a pointer that is passed to `filter`. * * \since This function is available since SDL 2.0.0. * @@ -1030,9 +1060,9 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, * This function can be used to "chain" filters, by saving the existing filter * before replacing it with a function that will call that saved filter. * - * \param filter the current callback function will be stored here + * \param filter the current callback function will be stored here. * \param userdata the pointer that is passed to the current event filter will - * be stored here + * be stored here. * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set. * * \since This function is available since SDL 2.0.0. @@ -1061,7 +1091,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, * through SDL_PeepEvents(). * * \param filter an SDL_EventFilter function to call when an event happens. - * \param userdata a pointer that is passed to `filter` + * \param userdata a pointer that is passed to `filter`. * * \since This function is available since SDL 2.0.0. * @@ -1077,8 +1107,8 @@ extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, * This function takes the same input as SDL_AddEventWatch() to identify and * delete the corresponding callback. * - * \param filter the function originally passed to SDL_AddEventWatch() - * \param userdata the pointer originally passed to SDL_AddEventWatch() + * \param filter the function originally passed to SDL_AddEventWatch(). + * \param userdata the pointer originally passed to SDL_AddEventWatch(). * * \since This function is available since SDL 2.0.0. * @@ -1095,8 +1125,8 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, * this function does not change the filter permanently, it only uses the * supplied filter until this function returns. * - * \param filter the SDL_EventFilter function to call when an event happens - * \param userdata a pointer that is passed to `filter` + * \param filter the SDL_EventFilter function to call when an event happens. + * \param userdata a pointer that is passed to `filter`. * * \since This function is available since SDL 2.0.0. * @@ -1122,8 +1152,8 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, * from the event queue and will not be filtered * - `SDL_ENABLE`: the event will be processed normally * - * \param type the type of event; see SDL_EventType for details - * \param state how to process the event + * \param type the type of event; see SDL_EventType for details. + * \param state how to process the event. * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state * of the event before this function makes any changes to it. * @@ -1145,7 +1175,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or * 0xFFFFFFFF), but is clearer to write. * - * \param numevents the number of events to be allocated + * \param numevents the number of events to be allocated. * \returns the beginning event number, or (Uint32)-1 if there are not enough * user-defined events left. * diff --git a/include/SDL_filesystem.h b/include/SDL_filesystem.h index 1914f81d91bb2..c72a6165fe5e1 100644 --- a/include/SDL_filesystem.h +++ b/include/SDL_filesystem.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_filesystem.h + * # CategoryFilesystem * - * \brief Include file for filesystem SDL API functions + * Include file for filesystem SDL API functions */ #ifndef SDL_filesystem_h_ @@ -64,7 +64,7 @@ extern "C" { * directory of the application as it is uncommon to store resources outside * the executable. As such it is not a writable directory. * - * The returned path is guaranteed to end with a path separator ('\' on + * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the @@ -120,14 +120,14 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * - * The returned path is guaranteed to end with a path separator ('\' on + * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * * The pointer returned is owned by the caller. Please call SDL_free() on the * pointer when done with it. * - * \param org the name of your organization - * \param app the name of your application + * \param org the name of your organization. + * \param app the name of your application. * \returns a UTF-8 string of the user directory in platform-dependent * notation. NULL if there's a problem (creating directory failed, * etc.). diff --git a/include/SDL_gamecontroller.h b/include/SDL_gamecontroller.h index 4703b639487be..72cce6e2b8ed1 100644 --- a/include/SDL_gamecontroller.h +++ b/include/SDL_gamecontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,10 +19,12 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: GameController */ + /** - * \file SDL_gamecontroller.h + * # CategoryGameController * - * Include file for SDL game controller event handling + * Include file for SDL game controller event handling */ #ifndef SDL_gamecontroller_h_ @@ -44,7 +46,7 @@ extern "C" { * \file SDL_gamecontroller.h * * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system + * with the SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system * for game controllers, and load appropriate drivers. * * If you would like to receive controller updates while the application @@ -58,7 +60,7 @@ extern "C" { struct _SDL_GameController; typedef struct _SDL_GameController SDL_GameController; -typedef enum +typedef enum SDL_GameControllerType { SDL_CONTROLLER_TYPE_UNKNOWN = 0, SDL_CONTROLLER_TYPE_XBOX360, @@ -73,10 +75,11 @@ typedef enum SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, - SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR, + SDL_CONTROLLER_TYPE_MAX } SDL_GameControllerType; -typedef enum +typedef enum SDL_GameControllerBindType { SDL_CONTROLLER_BINDTYPE_NONE = 0, SDL_CONTROLLER_BINDTYPE_BUTTON, @@ -85,7 +88,7 @@ typedef enum } SDL_GameControllerBindType; /** - * Get the SDL joystick layer binding for this controller button/axis mapping + * Get the SDL joystick layer binding for this controller button/axis mapping */ typedef struct SDL_GameControllerButtonBind { @@ -143,6 +146,10 @@ typedef struct SDL_GameControllerButtonBind * If a new mapping is loaded for an already known controller GUID, the later * version will overwrite the one currently loaded. * + * If this function is called before SDL_Init, SDL will generate an + * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged + * in at the time that SDL_Init is called. + * * Mappings not belonging to the current platform or with no platform field * specified will be ignored (i.e. mappings for Linux will be ignored in * Windows, etc). @@ -151,8 +158,8 @@ typedef struct SDL_GameControllerButtonBind * processing it, so take this into consideration if you are in a memory * constrained environment. * - * \param rw the data stream for the mappings to be added - * \param freerw non-zero to close the stream after being read + * \param rw the data stream for the mappings to be added. + * \param freerw non-zero to close the stream after being read. * \returns the number of mappings added or -1 on error; call SDL_GetError() * for more information. * @@ -161,13 +168,15 @@ typedef struct SDL_GameControllerButtonBind * \sa SDL_GameControllerAddMapping * \sa SDL_GameControllerAddMappingsFromFile * \sa SDL_GameControllerMappingForGUID + * \sa SDL_CONTROLLERDEVICEADDED */ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); /** - * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() + * Load a set of mappings from a file, filtered by the current + * SDL_GetPlatform() * - * Convenience macro. + * Convenience macro. */ #define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) @@ -189,7 +198,11 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" * ``` * - * \param mappingString the mapping string + * If this function is called before SDL_Init, SDL will generate an + * SDL_CONTROLLERDEVICEADDED event for matching controllers that are plugged + * in at the time that SDL_Init is called. + * + * \param mappingString the mapping string. * \returns 1 if a new mapping is added, 0 if an existing mapping is updated, * -1 on error; call SDL_GetError() for more information. * @@ -197,6 +210,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, * * \sa SDL_GameControllerMapping * \sa SDL_GameControllerMappingForGUID + * \sa SDL_CONTROLLERDEVICEADDED */ extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); @@ -212,6 +226,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); /** * Get the mapping at a particular index. * + * \param mapping_index mapping index. * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if * the index is out of range. * @@ -224,7 +239,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_ind * * The returned string must be freed with SDL_free(). * - * \param guid a structure containing the GUID for which a mapping is desired + * \param guid a structure containing the GUID for which a mapping is desired. * \returns a mapping string or NULL on error; call SDL_GetError() for more * information. * @@ -243,7 +258,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID * Details about mappings are discussed with SDL_GameControllerAddMapping(). * * \param gamecontroller the game controller you want to get the current - * mapping for + * mapping for. * \returns a string that has the controller's mapping or NULL if no mapping * is available; call SDL_GetError() for more information. * @@ -261,7 +276,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gam * SDL_JoystickOpen(). * * \param joystick_index the device_index of a device, up to - * SDL_NumJoysticks() + * SDL_NumJoysticks(). * \returns SDL_TRUE if the given joystick is supported by the game controller * interface, SDL_FALSE if it isn't or it's an invalid index. * @@ -281,7 +296,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); * SDL_JoystickOpen(). * * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 + * SDL_NumJoysticks()-1. * \returns the implementation-dependent name for the game controller, or NULL * if there is no name or the index is invalid. * @@ -302,7 +317,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_ * SDL_JoystickOpen(). * * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 + * SDL_NumJoysticks()-1. * \returns the implementation-dependent path for the game controller, or NULL * if there is no path or the index is invalid. * @@ -318,7 +333,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_ * This can be called before any controllers are opened. * * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 + * SDL_NumJoysticks()-1. * \returns the controller type. * * \since This function is available since SDL 2.0.12. @@ -331,7 +346,7 @@ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(in * This can be called before any controllers are opened. * * \param joystick_index the device_index of a device, from zero to - * SDL_NumJoysticks()-1 + * SDL_NumJoysticks()-1. * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if * no mapping is available. * @@ -351,7 +366,7 @@ extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joysti * be used there instead. * * \param joystick_index the device_index of a device, up to - * SDL_NumJoysticks() + * SDL_NumJoysticks(). * \returns a gamecontroller identifier or NULL if an error occurred; call * SDL_GetError() for more information. * @@ -366,7 +381,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_ /** * Get the SDL_GameController associated with an instance id. * - * \param joyid the instance id to get the SDL_GameController for + * \param joyid the instance id to get the SDL_GameController for. * \returns an SDL_GameController on success or NULL on failure; call * SDL_GetError() for more information. * @@ -398,7 +413,7 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in * it takes a controller identifier instead of the (unstable) device index. * * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() + * SDL_GameControllerOpen(). * \returns the implementation dependent name for the game controller, or NULL * if there is no name or the identifier passed is invalid. * @@ -416,7 +431,7 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *g * it takes a controller identifier instead of the (unstable) device index. * * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() + * SDL_GameControllerOpen(). * \returns the implementation dependent path for the game controller, or NULL * if there is no path or the identifier passed is invalid. * @@ -523,11 +538,25 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameCont */ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); +/** + * Get the Steam Input handle of an opened controller, if available. + * + * Returns an InputHandle_t for the controller that can be used with Steam + * Input API: https://partner.steamgames.com/doc/api/ISteamInput + * + * \param gamecontroller the game controller object to query. + * \returns the gamepad handle, or 0 if unavailable. + * + * \since This function is available since SDL 2.30.0. + */ +extern DECLSPEC Uint64 SDLCALL SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller); + + /** * Check if a controller has been opened and is currently connected. * * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() + * SDL_GameControllerOpen(). * \returns SDL_TRUE if the controller has been opened and is currently * connected, or SDL_FALSE if not. * @@ -552,7 +581,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameControlle * cause SDL to crash. * * \param gamecontroller the game controller object that you want to get a - * joystick from + * joystick from. * \returns a SDL_Joystick object; call SDL_GetError() for more information. * * \since This function is available since SDL 2.0.0. @@ -569,7 +598,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameCont * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0, * and 1 will have any effect. Other numbers will just be returned. * - * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` + * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`. * \returns the same value passed to the function, with exception to -1 * (SDL_QUERY), which will return the current state. * @@ -592,15 +621,19 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); /** - * The list of axes available from a controller + * The list of axes available from a controller * - * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, - * and are centered within ~8000 of zero, though advanced UI will allow users to set - * or autodetect the dead zone, which varies between controllers. + * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to + * SDL_JOYSTICK_AXIS_MAX, and are centered within ~8000 of zero, though + * advanced UI will allow users to set or autodetect the dead zone, which + * varies between controllers. * - * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. + * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX (fully + * pressed) when reported by SDL_GameControllerGetAxis(). Note that this is + * not the same range that will be reported by the lower-level + * SDL_GetJoystickAxis(). */ -typedef enum +typedef enum SDL_GameControllerAxis { SDL_CONTROLLER_AXIS_INVALID = -1, SDL_CONTROLLER_AXIS_LEFTX, @@ -624,7 +657,7 @@ typedef enum * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`, * respectively. * - * \param str string representing a SDL_GameController axis + * \param str string representing a SDL_GameController axis. * \returns the SDL_GameControllerAxis enum corresponding to the input string, * or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. * @@ -639,7 +672,7 @@ extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromStri * * The caller should not SDL_free() the returned string. * - * \param axis an enum value for a given SDL_GameControllerAxis + * \param axis an enum value for a given SDL_GameControllerAxis. * \returns a string for the given axis, or NULL if an invalid axis is * specified. The string returned is of the format used by * SDL_GameController mapping strings. @@ -653,8 +686,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameC /** * Get the SDL joystick layer binding for a controller axis mapping. * - * \param gamecontroller a game controller - * \param axis an axis enum value (one of the SDL_GameControllerAxis values) + * \param gamecontroller a game controller. + * \param axis an axis enum value (one of the SDL_GameControllerAxis values). * \returns a SDL_GameControllerButtonBind describing the bind. On failure * (like the given Controller axis doesn't exist on the device), its * `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. @@ -673,8 +706,8 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, * This merely reports whether the controller's mapping defined this axis, as * that is all the information SDL has about the physical device. * - * \param gamecontroller a game controller - * \param axis an axis enum value (an SDL_GameControllerAxis value) + * \param gamecontroller a game controller. + * \param axis an axis enum value (an SDL_GameControllerAxis value). * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -687,11 +720,15 @@ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameController * * The axis indices start at index 0. * - * The state is a value ranging from -32768 to 32767. Triggers, however, range - * from 0 to 32767 (they never return a negative value). + * For thumbsticks, the state is a value ranging from -32768 (up/left) to + * 32767 (down/right). * - * \param gamecontroller a game controller - * \param axis an axis index (one of the SDL_GameControllerAxis values) + * Triggers range from 0 when released to 32767 when fully pressed, and never + * return a negative value. Note that this differs from the value reported by + * the lower-level SDL_JoystickGetAxis(), which normally uses the full range. + * + * \param gamecontroller a game controller. + * \param axis an axis index (one of the SDL_GameControllerAxis values). * \returns axis state (including 0) on success or 0 (also) on failure; call * SDL_GetError() for more information. * @@ -703,9 +740,9 @@ extern DECLSPEC Sint16 SDLCALL SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); /** - * The list of buttons available from a controller + * The list of buttons available from a controller */ -typedef enum +typedef enum SDL_GameControllerButton { SDL_CONTROLLER_BUTTON_INVALID = -1, SDL_CONTROLLER_BUTTON_A, @@ -724,10 +761,10 @@ typedef enum SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */ - SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */ - SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */ - SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */ - SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */ + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */ SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ SDL_CONTROLLER_BUTTON_MAX } SDL_GameControllerButton; @@ -740,7 +777,7 @@ typedef enum * SDL_GameController mapping. You do not normally need to call this function * unless you are parsing SDL_GameController mappings in your own code. * - * \param str string representing a SDL_GameController axis + * \param str string representing a SDL_GameController axis. * \returns the SDL_GameControllerButton enum corresponding to the input * string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. * @@ -753,7 +790,7 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom * * The caller should not SDL_free() the returned string. * - * \param button an enum value for a given SDL_GameControllerButton + * \param button an enum value for a given SDL_GameControllerButton. * \returns a string for the given button, or NULL if an invalid button is * specified. The string returned is of the format used by * SDL_GameController mapping strings. @@ -767,8 +804,8 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_Gam /** * Get the SDL joystick layer binding for a controller button mapping. * - * \param gamecontroller a game controller - * \param button an button enum value (an SDL_GameControllerButton value) + * \param gamecontroller a game controller. + * \param button an button enum value (an SDL_GameControllerButton value). * \returns a SDL_GameControllerButtonBind describing the bind. On failure * (like the given Controller button doesn't exist on the device), * its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. @@ -787,8 +824,8 @@ SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, * This merely reports whether the controller's mapping defined this button, * as that is all the information SDL has about the physical device. * - * \param gamecontroller a game controller - * \param button a button enum value (an SDL_GameControllerButton value) + * \param gamecontroller a game controller. + * \param button a button enum value (an SDL_GameControllerButton value). * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -799,8 +836,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController /** * Get the current state of a button on a game controller. * - * \param gamecontroller a game controller - * \param button a button index (one of the SDL_GameControllerButton values) + * \param gamecontroller a game controller. + * \param button a button index (one of the SDL_GameControllerButton values). * \returns 1 for pressed state or 0 for not pressed state or error; call * SDL_GetError() for more information. * @@ -814,6 +851,9 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga /** * Get the number of touchpads on a game controller. * + * \param gamecontroller a controller. + * \returns number of touchpads. + * * \since This function is available since SDL 2.0.14. */ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); @@ -822,6 +862,10 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController * Get the number of supported simultaneous fingers on a touchpad on a game * controller. * + * \param gamecontroller a controller. + * \param touchpad a touchpad. + * \returns number of supported simultaneous fingers. + * * \since This function is available since SDL 2.0.14. */ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); @@ -829,6 +873,15 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameCont /** * Get the current state of a finger on a touchpad on a game controller. * + * \param gamecontroller a controller. + * \param touchpad a touchpad. + * \param finger a finger. + * \param state a pointer filled with the finger state. + * \param x a pointer filled with the x position. + * \param y a pointer filled with the y position. + * \param pressure a pointer filled with pressure value. + * \returns 0 on success or negative on failure. + * * \since This function is available since SDL 2.0.14. */ extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); @@ -836,8 +889,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameControll /** * Return whether a game controller has a particular sensor. * - * \param gamecontroller The controller to query - * \param type The type of sensor to query + * \param gamecontroller The controller to query. + * \param type The type of sensor to query. * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -847,9 +900,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController /** * Set whether data reporting for a game controller sensor is enabled. * - * \param gamecontroller The controller to update - * \param type The type of sensor to enable/disable - * \param enabled Whether data reporting should be enabled + * \param gamecontroller The controller to update. + * \param type The type of sensor to enable/disable. + * \param enabled Whether data reporting should be enabled. * \returns 0 or -1 if an error occurred. * * \since This function is available since SDL 2.0.14. @@ -859,8 +912,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameControlle /** * Query whether sensor data reporting is enabled for a game controller. * - * \param gamecontroller The controller to query - * \param type The type of sensor to query + * \param gamecontroller The controller to query. + * \param type The type of sensor to query. * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -871,8 +924,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameContr * Get the data rate (number of events per second) of a game controller * sensor. * - * \param gamecontroller The controller to query - * \param type The type of sensor to query + * \param gamecontroller The controller to query. + * \param type The type of sensor to query. * \return the data rate, or 0.0f if the data rate is not available. * * \since This function is available since SDL 2.0.16. @@ -885,10 +938,10 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro * The number of values and interpretation of the data is sensor dependent. * See SDL_sensor.h for the details for each type of sensor. * - * \param gamecontroller The controller to query - * \param type The type of sensor to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data + * \param gamecontroller The controller to query. + * \param type The type of sensor to query. + * \param data A pointer filled with the current sensor state. + * \param num_values The number of values to write to data. * \return 0 or -1 if an error occurred. * * \since This function is available since SDL 2.0.14. @@ -902,12 +955,12 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController * * The number of values and interpretation of the data is sensor dependent. * See SDL_sensor.h for the details for each type of sensor. * - * \param gamecontroller The controller to query - * \param type The type of sensor to query + * \param gamecontroller The controller to query. + * \param type The type of sensor to query. * \param timestamp A pointer filled with the timestamp in microseconds of the - * current sensor reading if available, or 0 if not - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data + * current sensor reading if available, or 0 if not. + * \param data A pointer filled with the current sensor state. + * \param num_values The number of values to write to data. * \return 0 or -1 if an error occurred. * * \since This function is available since SDL 2.26.0. @@ -920,13 +973,13 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_Gam * Each call to this function cancels any previous rumble effect, and calling * it with 0 intensity stops any rumbling. * - * \param gamecontroller The controller to vibrate + * \param gamecontroller The controller to vibrate. * \param low_frequency_rumble The intensity of the low frequency (left) - * rumble motor, from 0 to 0xFFFF + * rumble motor, from 0 to 0xFFFF. * \param high_frequency_rumble The intensity of the high frequency (right) - * rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if rumble isn't supported on this controller + * rumble motor, from 0 to 0xFFFF. + * \param duration_ms The duration of the rumble effect, in milliseconds. + * \returns 0, or -1 if rumble isn't supported on this controller. * * \since This function is available since SDL 2.0.9. * @@ -945,13 +998,13 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecon * want the (more common) whole-controller rumble, use * SDL_GameControllerRumble() instead. * - * \param gamecontroller The controller to vibrate + * \param gamecontroller The controller to vibrate. * \param left_rumble The intensity of the left trigger rumble motor, from 0 - * to 0xFFFF + * to 0xFFFF. * \param right_rumble The intensity of the right trigger rumble motor, from 0 - * to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if trigger rumble isn't supported on this controller + * to 0xFFFF. + * \param duration_ms The duration of the rumble effect, in milliseconds. + * \returns 0, or -1 if trigger rumble isn't supported on this controller. * * \since This function is available since SDL 2.0.14. * @@ -962,9 +1015,9 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController /** * Query whether a game controller has an LED. * - * \param gamecontroller The controller to query + * \param gamecontroller The controller to query. * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a - * modifiable LED + * modifiable LED. * * \since This function is available since SDL 2.0.14. */ @@ -973,9 +1026,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *ga /** * Query whether a game controller has rumble support. * - * \param gamecontroller The controller to query + * \param gamecontroller The controller to query. * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble - * support + * support. * * \since This function is available since SDL 2.0.18. * @@ -986,9 +1039,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController /** * Query whether a game controller has rumble support on triggers. * - * \param gamecontroller The controller to query + * \param gamecontroller The controller to query. * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger - * rumble support + * rumble support. * * \since This function is available since SDL 2.0.18. * @@ -999,11 +1052,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameCon /** * Update a game controller's LED color. * - * \param gamecontroller The controller to update - * \param red The intensity of the red LED - * \param green The intensity of the green LED - * \param blue The intensity of the blue LED - * \returns 0, or -1 if this controller does not have a modifiable LED + * \param gamecontroller The controller to update. + * \param red The intensity of the red LED. + * \param green The intensity of the green LED. + * \param blue The intensity of the blue LED. + * \returns 0, or -1 if this controller does not have a modifiable LED. * * \since This function is available since SDL 2.0.14. */ @@ -1012,11 +1065,11 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecon /** * Send a controller specific effect packet * - * \param gamecontroller The controller to affect - * \param data The data to send to the controller - * \param size The size of the data to send to the controller + * \param gamecontroller The controller to affect. + * \param data The data to send to the controller. + * \param size The size of the data to send to the controller. * \returns 0, or -1 if this controller or driver doesn't support effect - * packets + * packets. * * \since This function is available since SDL 2.0.16. */ @@ -1026,7 +1079,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gam * Close a game controller previously opened with SDL_GameControllerOpen(). * * \param gamecontroller a game controller identifier previously returned by - * SDL_GameControllerOpen() + * SDL_GameControllerOpen(). * * \since This function is available since SDL 2.0.0. * @@ -1038,9 +1091,9 @@ extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecon * Return the sfSymbolsName for a given button on a game controller on Apple * platforms. * - * \param gamecontroller the controller to query - * \param button a button on the game controller - * \returns the sfSymbolsName or NULL if the name can't be found + * \param gamecontroller the controller to query. + * \param button a button on the game controller. + * \returns the sfSymbolsName or NULL if the name can't be found. * * \since This function is available since SDL 2.0.18. * @@ -1052,9 +1105,9 @@ extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForBu * Return the sfSymbolsName for a given axis on a game controller on Apple * platforms. * - * \param gamecontroller the controller to query - * \param axis an axis on the game controller - * \returns the sfSymbolsName or NULL if the name can't be found + * \param gamecontroller the controller to query. + * \param axis an axis on the game controller. + * \returns the sfSymbolsName or NULL if the name can't be found. * * \since This function is available since SDL 2.0.18. * diff --git a/include/SDL_gesture.h b/include/SDL_gesture.h index e2caea2a92563..acfa56f31f51c 100644 --- a/include/SDL_gesture.h +++ b/include/SDL_gesture.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_gesture.h + * # CategoryGesture * - * Include file for SDL gesture event handling. + * Include file for SDL gesture event handling. */ #ifndef SDL_gesture_h_ @@ -51,7 +51,7 @@ typedef Sint64 SDL_GestureID; * If the parameter `touchId` is -1 (i.e., all devices), this function will * always return 1, regardless of whether there actually are any devices. * - * \param touchId the touch device id, or -1 for all touch devices + * \param touchId the touch device id, or -1 for all touch devices. * \returns 1 on success or 0 if the specified device could not be found. * * \since This function is available since SDL 2.0.0. @@ -64,7 +64,7 @@ extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); /** * Save all currently loaded Dollar Gesture templates. * - * \param dst a SDL_RWops to save to + * \param dst a SDL_RWops to save to. * \returns the number of saved templates on success or 0 on failure; call * SDL_GetError() for more information. * @@ -78,8 +78,8 @@ extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); /** * Save a currently loaded Dollar Gesture template. * - * \param gestureId a gesture id - * \param dst a SDL_RWops to save to + * \param gestureId a gesture id. + * \param dst a SDL_RWops to save to. * \returns 1 on success or 0 on failure; call SDL_GetError() for more * information. * @@ -94,8 +94,8 @@ extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_R /** * Load Dollar Gesture templates from a file. * - * \param touchId a touch id - * \param src a SDL_RWops to load from + * \param touchId a touch id. + * \param src a SDL_RWops to load from. * \returns the number of loaded templates on success or a negative error code * (or 0) on failure; call SDL_GetError() for more information. * diff --git a/include/SDL_guid.h b/include/SDL_guid.h index b971636a06b80..fd9a50e322939 100644 --- a/include/SDL_guid.h +++ b/include/SDL_guid.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,10 +19,13 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: GUID */ + /** - * \file SDL_guid.h + * # CategoryGUID * - * Include file for handling ::SDL_GUID values. + * A GUID is a 128-bit value that represents something that is uniquely + * identifiable by this value: "globally unique." */ #ifndef SDL_guid_h_ @@ -38,34 +41,38 @@ extern "C" { #endif /** - * An SDL_GUID is a 128-bit identifier for an input device that - * identifies that device across runs of SDL programs on the same - * platform. If the device is detached and then re-attached to a - * different port, or if the base system is rebooted, the device - * should still report the same GUID. + * An SDL_GUID is a 128-bit identifier. + * + * This is an acronym for "Globally Unique ID." + * + * While a GUID can be used to assign a unique value to almost anything, in + * SDL these are largely used to identify input devices across runs of SDL + * programs on the same platform.If the device is detached and then + * re-attached to a different port, or if the base system is rebooted, the + * device should still report the same GUID. * - * GUIDs are as precise as possible but are not guaranteed to - * distinguish physically distinct but equivalent devices. For - * example, two game controllers from the same vendor with the same - * product ID and revision may have the same GUID. + * GUIDs are as precise as possible but are not guaranteed to distinguish + * physically distinct but equivalent devices. For example, two game + * controllers from the same vendor with the same product ID and revision may + * have the same GUID. * - * GUIDs may be platform-dependent (i.e., the same device may report - * different GUIDs on different operating systems). + * GUIDs may be platform-dependent (i.e., the same device may report different + * GUIDs on different operating systems). */ -typedef struct { +typedef struct SDL_GUID { Uint8 data[16]; } SDL_GUID; /* Function prototypes */ /** - * Get an ASCII string representation for a given ::SDL_GUID. + * Get an ASCII string representation for a given SDL_GUID. * * You should supply at least 33 bytes for pszGUID. * - * \param guid the ::SDL_GUID you wish to convert to string - * \param pszGUID buffer in which to write the ASCII string - * \param cbGUID the size of pszGUID + * \param guid the SDL_GUID you wish to convert to string. + * \param pszGUID buffer in which to write the ASCII string. + * \param cbGUID the size of pszGUID. * * \since This function is available since SDL 2.24.0. * @@ -74,14 +81,14 @@ typedef struct { extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); /** - * Convert a GUID string into a ::SDL_GUID structure. + * Convert a GUID string into a SDL_GUID structure. * * Performs no error checking. If this function is given a string containing * an invalid GUID, the function will silently succeed, but the GUID generated * will not be useful. * - * \param pchGUID string containing an ASCII representation of a GUID - * \returns a ::SDL_GUID structure. + * \param pchGUID string containing an ASCII representation of a GUID. + * \returns a SDL_GUID structure. * * \since This function is available since SDL 2.24.0. * diff --git a/include/SDL_haptic.h b/include/SDL_haptic.h index f240ae927211e..f679c5734ecb5 100644 --- a/include/SDL_haptic.h +++ b/include/SDL_haptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,24 +20,25 @@ */ /** - * \file SDL_haptic.h + * # CategoryHaptic * - * \brief The SDL haptic subsystem allows you to control haptic (force feedback) - * devices. + * SDL haptic subsystem allows you to control haptic (force feedback) devices. * - * The basic usage is as follows: - * - Initialize the subsystem (::SDL_INIT_HAPTIC). - * - Open a haptic device. - * - SDL_HapticOpen() to open from index. - * - SDL_HapticOpenFromJoystick() to open from an existing joystick. - * - Create an effect (::SDL_HapticEffect). - * - Upload the effect with SDL_HapticNewEffect(). - * - Run the effect with SDL_HapticRunEffect(). - * - (optional) Free the effect with SDL_HapticDestroyEffect(). - * - Close the haptic device with SDL_HapticClose(). + * The basic usage is as follows: * - * \par Simple rumble example: - * \code + * - Initialize the subsystem (SDL_INIT_HAPTIC). + * - Open a haptic device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * Simple rumble example: + * + * ```c * SDL_Haptic *haptic; * * // Open the device @@ -56,10 +57,11 @@ * * // Clean up * SDL_HapticClose( haptic ); - * \endcode + * ``` * - * \par Complete example: - * \code + * Complete example: + * + * ```c * int test_haptic( SDL_Joystick * joystick ) { * SDL_Haptic *haptic; * SDL_HapticEffect effect; @@ -101,7 +103,7 @@ * * return 0; // Success * } - * \endcode + * ``` */ #ifndef SDL_haptic_h_ @@ -154,31 +156,29 @@ typedef struct _SDL_Haptic SDL_Haptic; /* @{ */ /** - * \brief Constant effect supported. + * Constant effect supported. * - * Constant haptic effect. + * Constant haptic effect. * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ #define SDL_HAPTIC_CONSTANT (1u<<0) /** - * \brief Sine wave effect supported. + * Sine wave effect supported. * - * Periodic haptic effect that simulates sine waves. + * Periodic haptic effect that simulates sine waves. * - * \sa SDL_HapticPeriodic + * \sa SDL_HapticPeriodic */ #define SDL_HAPTIC_SINE (1u<<1) /** - * \brief Left/Right effect supported. + * Left/Right effect supported. * - * Haptic effect for direct control over high/low frequency motors. + * Haptic effect for direct control over high/low frequency motors. * - * \sa SDL_HapticLeftRight - * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, - * we ran out of bits, and this is important for XInput devices. + * \sa SDL_HapticLeftRight */ #define SDL_HAPTIC_LEFTRIGHT (1u<<2) @@ -186,85 +186,85 @@ typedef struct _SDL_Haptic SDL_Haptic; /* #define SDL_HAPTIC_SQUARE (1<<2) */ /** - * \brief Triangle wave effect supported. + * Triangle wave effect supported. * - * Periodic haptic effect that simulates triangular waves. + * Periodic haptic effect that simulates triangular waves. * - * \sa SDL_HapticPeriodic + * \sa SDL_HapticPeriodic */ #define SDL_HAPTIC_TRIANGLE (1u<<3) /** - * \brief Sawtoothup wave effect supported. + * Sawtoothup wave effect supported. * - * Periodic haptic effect that simulates saw tooth up waves. + * Periodic haptic effect that simulates saw tooth up waves. * - * \sa SDL_HapticPeriodic + * \sa SDL_HapticPeriodic */ #define SDL_HAPTIC_SAWTOOTHUP (1u<<4) /** - * \brief Sawtoothdown wave effect supported. + * Sawtoothdown wave effect supported. * - * Periodic haptic effect that simulates saw tooth down waves. + * Periodic haptic effect that simulates saw tooth down waves. * - * \sa SDL_HapticPeriodic + * \sa SDL_HapticPeriodic */ #define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) /** - * \brief Ramp effect supported. + * Ramp effect supported. * - * Ramp haptic effect. + * Ramp haptic effect. * - * \sa SDL_HapticRamp + * \sa SDL_HapticRamp */ #define SDL_HAPTIC_RAMP (1u<<6) /** - * \brief Spring effect supported - uses axes position. + * Spring effect supported - uses axes position. * - * Condition haptic effect that simulates a spring. Effect is based on the - * axes position. + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ #define SDL_HAPTIC_SPRING (1u<<7) /** - * \brief Damper effect supported - uses axes velocity. + * Damper effect supported - uses axes velocity. * - * Condition haptic effect that simulates dampening. Effect is based on the - * axes velocity. + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ #define SDL_HAPTIC_DAMPER (1u<<8) /** - * \brief Inertia effect supported - uses axes acceleration. + * Inertia effect supported - uses axes acceleration. * - * Condition haptic effect that simulates inertia. Effect is based on the axes - * acceleration. + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ #define SDL_HAPTIC_INERTIA (1u<<9) /** - * \brief Friction effect supported - uses axes movement. + * Friction effect supported - uses axes movement. * - * Condition haptic effect that simulates friction. Effect is based on the - * axes movement. + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. * - * \sa SDL_HapticCondition + * \sa SDL_HapticCondition */ #define SDL_HAPTIC_FRICTION (1u<<10) /** - * \brief Custom effect is supported. + * Custom effect is supported. * - * User defined custom haptic effect. + * User defined custom haptic effect. */ #define SDL_HAPTIC_CUSTOM (1u<<11) @@ -273,39 +273,39 @@ typedef struct _SDL_Haptic SDL_Haptic; /* These last few are features the device has, not effects */ /** - * \brief Device can set global gain. + * Device can set global gain. * - * Device supports setting the global gain. + * Device supports setting the global gain. * - * \sa SDL_HapticSetGain + * \sa SDL_HapticSetGain */ #define SDL_HAPTIC_GAIN (1u<<12) /** - * \brief Device can set autocenter. + * Device can set autocenter. * - * Device supports setting autocenter. + * Device supports setting autocenter. * - * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticSetAutocenter */ #define SDL_HAPTIC_AUTOCENTER (1u<<13) /** - * \brief Device can be queried for effect status. + * Device can be queried for effect status. * - * Device supports querying effect status. + * Device supports querying effect status. * - * \sa SDL_HapticGetEffectStatus + * \sa SDL_HapticGetEffectStatus */ #define SDL_HAPTIC_STATUS (1u<<14) /** - * \brief Device can be paused. + * Device can be paused. * - * Devices supports being paused. + * Devices supports being paused. * - * \sa SDL_HapticPause - * \sa SDL_HapticUnpause + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause */ #define SDL_HAPTIC_PAUSE (1u<<15) @@ -316,31 +316,33 @@ typedef struct _SDL_Haptic SDL_Haptic; /* @{ */ /** - * \brief Uses polar coordinates for the direction. + * Uses polar coordinates for the direction. * - * \sa SDL_HapticDirection + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_POLAR 0 /** - * \brief Uses cartesian coordinates for the direction. + * Uses cartesian coordinates for the direction. * - * \sa SDL_HapticDirection + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_CARTESIAN 1 /** - * \brief Uses spherical coordinates for the direction. + * Uses spherical coordinates for the direction. * - * \sa SDL_HapticDirection + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_SPHERICAL 2 /** - * \brief Use this value to play an effect on the steering wheel axis. This - * provides better compatibility across platforms and devices as SDL will guess - * the correct axis. - * \sa SDL_HapticDirection + * Use this value to play an effect on the steering wheel axis. + * + * This provides better compatibility across platforms and devices as SDL will + * guess the correct axis. + * + * \sa SDL_HapticDirection */ #define SDL_HAPTIC_STEERING_AXIS 3 @@ -353,7 +355,7 @@ typedef struct _SDL_Haptic SDL_Haptic; */ /** - * \brief Used to play a device an infinite number of times. + * Used to play a device an infinite number of times. * * \sa SDL_HapticRunEffect */ @@ -361,77 +363,82 @@ typedef struct _SDL_Haptic SDL_Haptic; /** - * \brief Structure that represents a haptic direction. - * - * This is the direction where the force comes from, - * instead of the direction in which the force is exerted. - * - * Directions can be specified by: - * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. - * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. - * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. - * - * Cardinal directions of the haptic device are relative to the positioning - * of the device. North is considered to be away from the user. - * - * The following diagram represents the cardinal directions: - * \verbatim - .--. - |__| .-------. - |=.| |.-----.| - |--| || || - | | |'-----'| - |__|~')_____(' - [ COMPUTER ] - - - North (0,-1) - ^ - | - | - (-1,0) West <----[ HAPTIC ]----> East (1,0) - | - | - v - South (0,1) - - - [ USER ] - \|||/ - (o o) - ---ooO-(_)-Ooo--- - \endverbatim - * - * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a - * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses - * the first \c dir parameter. The cardinal directions would be: - * - North: 0 (0 degrees) - * - East: 9000 (90 degrees) - * - South: 18000 (180 degrees) - * - West: 27000 (270 degrees) - * - * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions - * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses - * the first three \c dir parameters. The cardinal directions would be: - * - North: 0,-1, 0 - * - East: 1, 0, 0 - * - South: 0, 1, 0 - * - West: -1, 0, 0 - * - * The Z axis represents the height of the effect if supported, otherwise - * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you - * can use any multiple you want, only the direction matters. - * - * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. - * The first two \c dir parameters are used. The \c dir parameters are as - * follows (all values are in hundredths of degrees): - * - Degrees from (1, 0) rotated towards (0, 1). - * - Degrees towards (0, 0, 1) (device needs at least 3 axes). - * - * - * Example of force coming from the south with all encodings (force coming - * from the south means the user will have to pull the stick to counteract): - * \code + * Structure that represents a haptic direction. + * + * This is the direction where the force comes from, instead of the direction + * in which the force is exerted. + * + * Directions can be specified by: + * + * - SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning of + * the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * + * ``` + * .--. + * |__| .-------. + * |=.| |.-----.| + * |--| || || + * | | |'-----'| + * |__|~')_____(' + * [ COMPUTER ] + * + * + * North (0,-1) + * ^ + * | + * | + * (-1,0) West <----[ HAPTIC ]----> East (1,0) + * | + * | + * v + * South (0,1) + * + * + * [ USER ] + * \|||/ + * (o o) + * ---ooO-(_)-Ooo--- + * ``` + * + * If type is SDL_HAPTIC_POLAR, direction is encoded by hundredths of a degree + * starting north and turning clockwise. SDL_HAPTIC_POLAR only uses the first + * `dir` parameter. The cardinal directions would be: + * + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is SDL_HAPTIC_CARTESIAN, direction is encoded by three positions (X + * axis, Y axis and Z axis (with 3 axes)). SDL_HAPTIC_CARTESIAN uses the first + * three `dir` parameters. The cardinal directions would be: + * + * - North: 0,-1, 0 + * - East: 1, 0, 0 + * - South: 0, 1, 0 + * - West: -1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise it's + * unused. In cartesian encoding (1, 2) would be the same as (2, 4), you can + * use any multiple you want, only the direction matters. + * + * If type is SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. The + * first two `dir` parameters are used. The `dir` parameters are as follows + * (all values are in hundredths of degrees): + * + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * + * ```c * SDL_HapticDirection direction; * * // Cartesian directions @@ -447,14 +454,14 @@ typedef struct _SDL_Haptic SDL_Haptic; * // Spherical coordinates * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. - * \endcode + * ``` * - * \sa SDL_HAPTIC_POLAR - * \sa SDL_HAPTIC_CARTESIAN - * \sa SDL_HAPTIC_SPHERICAL - * \sa SDL_HAPTIC_STEERING_AXIS - * \sa SDL_HapticEffect - * \sa SDL_HapticNumAxes + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HAPTIC_STEERING_AXIS + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes */ typedef struct SDL_HapticDirection { @@ -464,20 +471,20 @@ typedef struct SDL_HapticDirection /** - * \brief A structure containing a template for a Constant effect. + * A structure containing a template for a Constant effect. * - * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. + * This struct is exclusively for the SDL_HAPTIC_CONSTANT effect. * - * A constant effect applies a constant force in the specified direction - * to the joystick. + * A constant effect applies a constant force in the specified direction to + * the joystick. * - * \sa SDL_HAPTIC_CONSTANT - * \sa SDL_HapticEffect + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect */ typedef struct SDL_HapticConstant { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + Uint16 type; /**< SDL_HAPTIC_CONSTANT */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -499,68 +506,71 @@ typedef struct SDL_HapticConstant } SDL_HapticConstant; /** - * \brief A structure containing a template for a Periodic effect. - * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SINE - * - ::SDL_HAPTIC_LEFTRIGHT - * - ::SDL_HAPTIC_TRIANGLE - * - ::SDL_HAPTIC_SAWTOOTHUP - * - ::SDL_HAPTIC_SAWTOOTHDOWN - * - * A periodic effect consists in a wave-shaped effect that repeats itself - * over time. The type determines the shape of the wave and the parameters - * determine the dimensions of the wave. - * - * Phase is given by hundredth of a degree meaning that giving the phase a value - * of 9000 will displace it 25% of its period. Here are sample values: - * - 0: No phase displacement. - * - 9000: Displaced 25% of its period. - * - 18000: Displaced 50% of its period. - * - 27000: Displaced 75% of its period. - * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. - * - * Examples: - * \verbatim - SDL_HAPTIC_SINE - __ __ __ __ - / \ / \ / \ / - / \__/ \__/ \__/ - - SDL_HAPTIC_SQUARE - __ __ __ __ __ - | | | | | | | | | | - | |__| |__| |__| |__| | - - SDL_HAPTIC_TRIANGLE - /\ /\ /\ /\ /\ - / \ / \ / \ / \ / - / \/ \/ \/ \/ - - SDL_HAPTIC_SAWTOOTHUP - /| /| /| /| /| /| /| - / | / | / | / | / | / | / | - / |/ |/ |/ |/ |/ |/ | - - SDL_HAPTIC_SAWTOOTHDOWN - \ |\ |\ |\ |\ |\ |\ | - \ | \ | \ | \ | \ | \ | \ | - \| \| \| \| \| \| \| - \endverbatim - * - * \sa SDL_HAPTIC_SINE - * \sa SDL_HAPTIC_LEFTRIGHT - * \sa SDL_HAPTIC_TRIANGLE - * \sa SDL_HAPTIC_SAWTOOTHUP - * \sa SDL_HAPTIC_SAWTOOTHDOWN - * \sa SDL_HapticEffect + * A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * + * - SDL_HAPTIC_SINE + * - SDL_HAPTIC_SQUARE + * - SDL_HAPTIC_TRIANGLE + * - SDL_HAPTIC_SAWTOOTHUP + * - SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself over + * time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a degree meaning that giving the phase a + * value of 9000 will displace it 25% of its period. Here are sample values: + * + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * + * ``` + * SDL_HAPTIC_SINE + * __ __ __ __ + * / \ / \ / \ / + * / \__/ \__/ \__/ + * + * SDL_HAPTIC_SQUARE + * __ __ __ __ __ + * | | | | | | | | | | + * | |__| |__| |__| |__| | + * + * SDL_HAPTIC_TRIANGLE + * /\ /\ /\ /\ /\ + * / \ / \ / \ / \ / + * / \/ \/ \/ \/ + * + * SDL_HAPTIC_SAWTOOTHUP + * /| /| /| /| /| /| /| + * / | / | / | / | / | / | / | + * / |/ |/ |/ |/ |/ |/ | + * + * SDL_HAPTIC_SAWTOOTHDOWN + * \ |\ |\ |\ |\ |\ |\ | + * \ | \ | \ | \ | \ | \ | \ | + * \| \| \| \| \| \| \| + * ``` + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect */ typedef struct SDL_HapticPeriodic { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, - ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or - ::SDL_HAPTIC_SAWTOOTHDOWN */ + Uint16 type; /**< SDL_HAPTIC_SINE, SDL_HAPTIC_LEFTRIGHT, + SDL_HAPTIC_TRIANGLE, SDL_HAPTIC_SAWTOOTHUP or + SDL_HAPTIC_SAWTOOTHDOWN */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -585,35 +595,36 @@ typedef struct SDL_HapticPeriodic } SDL_HapticPeriodic; /** - * \brief A structure containing a template for a Condition effect. + * A structure containing a template for a Condition effect. * - * The struct handles the following effects: - * - ::SDL_HAPTIC_SPRING: Effect based on axes position. - * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. - * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. - * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * The struct handles the following effects: * - * Direction is handled by condition internals instead of a direction member. - * The condition effect specific members have three parameters. The first - * refers to the X axis, the second refers to the Y axis and the third - * refers to the Z axis. The right terms refer to the positive side of the - * axis and the left terms refer to the negative side of the axis. Please - * refer to the ::SDL_HapticDirection diagram for which side is positive and - * which is negative. + * - SDL_HAPTIC_SPRING: Effect based on axes position. + * - SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - SDL_HAPTIC_FRICTION: Effect based on axes movement. * - * \sa SDL_HapticDirection - * \sa SDL_HAPTIC_SPRING - * \sa SDL_HAPTIC_DAMPER - * \sa SDL_HAPTIC_INERTIA - * \sa SDL_HAPTIC_FRICTION - * \sa SDL_HapticEffect + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third refers + * to the Z axis. The right terms refer to the positive side of the axis and + * the left terms refer to the negative side of the axis. Please refer to the + * SDL_HapticDirection diagram for which side is positive and which is + * negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect */ typedef struct SDL_HapticCondition { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, - ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ - SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + Uint16 type; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER, + SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ Uint32 length; /**< Duration of the effect. */ @@ -633,22 +644,22 @@ typedef struct SDL_HapticCondition } SDL_HapticCondition; /** - * \brief A structure containing a template for a Ramp effect. + * A structure containing a template for a Ramp effect. * - * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * This struct is exclusively for the SDL_HAPTIC_RAMP effect. * - * The ramp effect starts at start strength and ends at end strength. - * It augments in linear fashion. If you use attack and fade with a ramp - * the effects get added to the ramp effect making the effect become - * quadratic instead of linear. + * The ramp effect starts at start strength and ends at end strength. It + * augments in linear fashion. If you use attack and fade with a ramp the + * effects get added to the ramp effect making the effect become quadratic + * instead of linear. * - * \sa SDL_HAPTIC_RAMP - * \sa SDL_HapticEffect + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect */ typedef struct SDL_HapticRamp { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + Uint16 type; /**< SDL_HAPTIC_RAMP */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -671,9 +682,9 @@ typedef struct SDL_HapticRamp } SDL_HapticRamp; /** - * \brief A structure containing a template for a Left/Right effect. + * A structure containing a template for a Left/Right effect. * - * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * This struct is exclusively for the SDL_HAPTIC_LEFTRIGHT effect. * * The Left/Right effect is used to explicitly control the large and small * motors, commonly found in modern game controllers. The small (right) motor @@ -685,7 +696,7 @@ typedef struct SDL_HapticRamp typedef struct SDL_HapticLeftRight { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + Uint16 type; /**< SDL_HAPTIC_LEFTRIGHT */ /* Replay */ Uint32 length; /**< Duration of the effect in milliseconds. */ @@ -696,24 +707,24 @@ typedef struct SDL_HapticLeftRight } SDL_HapticLeftRight; /** - * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * A structure containing a template for the SDL_HAPTIC_CUSTOM effect. * - * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. + * This struct is exclusively for the SDL_HAPTIC_CUSTOM effect. * - * A custom force feedback effect is much like a periodic effect, where the - * application can define its exact shape. You will have to allocate the - * data yourself. Data should consist of channels * samples Uint16 samples. + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the data + * yourself. Data should consist of channels * samples Uint16 samples. * - * If channels is one, the effect is rotated using the defined direction. - * Otherwise it uses the samples in data for the different axes. + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. * - * \sa SDL_HAPTIC_CUSTOM - * \sa SDL_HapticEffect + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect */ typedef struct SDL_HapticCustom { /* Header */ - Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + Uint16 type; /**< SDL_HAPTIC_CUSTOM */ SDL_HapticDirection direction; /**< Direction of the effect. */ /* Replay */ @@ -738,27 +749,28 @@ typedef struct SDL_HapticCustom } SDL_HapticCustom; /** - * \brief The generic template for any haptic effect. + * The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. Time + * values unless specified otherwise are in milliseconds. * - * All values max at 32767 (0x7FFF). Signed values also can be negative. - * Time values unless specified otherwise are in milliseconds. + * You can also pass SDL_HAPTIC_INFINITY to length instead of a 0-32767 value. + * Neither delay, interval, attack_length nor fade_length support + * SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. * - * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 - * value. Neither delay, interval, attack_length nor fade_length support - * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * Additionally, the SDL_HAPTIC_RAMP effect does not support a duration of + * SDL_HAPTIC_INFINITY. * - * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of - * ::SDL_HAPTIC_INFINITY. + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like the + * joystick. * - * Button triggers may not be supported on all devices, it is advised to not - * use them if possible. Buttons start at index 1 instead of index 0 like - * the joystick. + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. * - * If both attack_length and fade_level are 0, the envelope is not used, - * otherwise both values are used. + * Common parts: * - * Common parts: - * \code + * ```c * // Replay - All effects have this * Uint32 length; // Duration of effect (ms). * Uint16 delay; // Delay before starting effect. @@ -772,39 +784,39 @@ typedef struct SDL_HapticCustom * Uint16 attack_level; // Level at the start of the attack. * Uint16 fade_length; // Duration of the fade out (ms). * Uint16 fade_level; // Level at the end of the fade. - * \endcode - * - * - * Here we have an example of a constant effect evolution in time: - * \verbatim - Strength - ^ - | - | effect level --> _________________ - | / \ - | / \ - | / \ - | / \ - | attack_level --> | \ - | | | <--- fade_level - | - +--------------------------------------------------> Time - [--] [---] - attack_length fade_length - - [------------------][-----------------------] - delay length - \endverbatim - * - * Note either the attack_level or the fade_level may be above the actual - * effect level. - * - * \sa SDL_HapticConstant - * \sa SDL_HapticPeriodic - * \sa SDL_HapticCondition - * \sa SDL_HapticRamp - * \sa SDL_HapticLeftRight - * \sa SDL_HapticCustom + * ``` + * + * Here we have an example of a constant effect evolution in time: + * + * ``` + * Strength + * ^ + * | + * | effect level --> _________________ + * | / \ + * | / \ + * | / \ + * | / \ + * | attack_level --> | \ + * | | | <--- fade_level + * | + * +--------------------------------------------------> Time + * [--] [---] + * attack_length fade_length + * + * [------------------][-----------------------] + * delay length + * ``` + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom */ typedef union SDL_HapticEffect { @@ -859,7 +871,7 @@ extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); * autocenter will be disabled. To modify these values use SDL_HapticSetGain() * and SDL_HapticSetAutocenter(). * - * \param device_index index of the device to open + * \param device_index index of the device to open. * \returns the device identifier or NULL on failure; call SDL_GetError() for * more information. * @@ -879,7 +891,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); /** * Check if the haptic device at the designated index has been opened. * - * \param device_index the index of the device to query + * \param device_index the index of the device to query. * \returns 1 if it has been opened, 0 if it hasn't or on failure; call * SDL_GetError() for more information. * @@ -893,7 +905,7 @@ extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); /** * Get the index of a haptic device. * - * \param haptic the SDL_Haptic device to query + * \param haptic the SDL_Haptic device to query. * \returns the index of the specified haptic device or a negative error code * on failure; call SDL_GetError() for more information. * @@ -931,7 +943,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); /** * Query if a joystick has haptic features. * - * \param joystick the SDL_Joystick to test for haptic capabilities + * \param joystick the SDL_Joystick to test for haptic capabilities. * \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a * negative error code on failure; call SDL_GetError() for more * information. @@ -953,7 +965,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); * device will also get unallocated and you'll be unable to use force feedback * on that device. * - * \param joystick the SDL_Joystick to create a haptic device from + * \param joystick the SDL_Joystick to create a haptic device from. * \returns a valid haptic device identifier on success or NULL on failure; * call SDL_GetError() for more information. * @@ -969,7 +981,7 @@ extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * /** * Close a haptic device previously opened with SDL_HapticOpen(). * - * \param haptic the SDL_Haptic device to close + * \param haptic the SDL_Haptic device to close. * * \since This function is available since SDL 2.0.0. * @@ -984,7 +996,7 @@ extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); * approximation. Always check to see if your created effect was actually * created and do not rely solely on SDL_HapticNumEffects(). * - * \param haptic the SDL_Haptic device to query + * \param haptic the SDL_Haptic device to query. * \returns the number of effects the haptic device can store or a negative * error code on failure; call SDL_GetError() for more information. * @@ -1000,7 +1012,7 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); * * This is not supported on all platforms, but will always return a value. * - * \param haptic the SDL_Haptic device to query maximum playing effects + * \param haptic the SDL_Haptic device to query maximum playing effects. * \returns the number of effects the haptic device can play at the same time * or a negative error code on failure; call SDL_GetError() for more * information. @@ -1015,7 +1027,7 @@ extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); /** * Get the haptic device's supported features in bitwise manner. * - * \param haptic the SDL_Haptic device to query + * \param haptic the SDL_Haptic device to query. * \returns a list of supported haptic features in bitwise manner (OR'd), or 0 * on failure; call SDL_GetError() for more information. * @@ -1033,7 +1045,7 @@ extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); * The number of haptic axes might be useful if working with the * SDL_HapticDirection effect. * - * \param haptic the SDL_Haptic device to query + * \param haptic the SDL_Haptic device to query. * \returns the number of axes on success or a negative error code on failure; * call SDL_GetError() for more information. * @@ -1044,8 +1056,8 @@ extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); /** * Check to see if an effect is supported by a haptic device. * - * \param haptic the SDL_Haptic device to query - * \param effect the desired effect to query + * \param haptic the SDL_Haptic device to query. + * \param effect the desired effect to query. * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a * negative error code on failure; call SDL_GetError() for more * information. @@ -1062,9 +1074,9 @@ extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, /** * Create a new haptic effect on a specified device. * - * \param haptic an SDL_Haptic device to create the effect on + * \param haptic an SDL_Haptic device to create the effect on. * \param effect an SDL_HapticEffect structure containing the properties of - * the effect to create + * the effect to create. * \returns the ID of the effect on success or a negative error code on * failure; call SDL_GetError() for more information. * @@ -1085,10 +1097,10 @@ extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, * start playing from the start. You also cannot change the type either when * running SDL_HapticUpdateEffect(). * - * \param haptic the SDL_Haptic device that has the effect - * \param effect the identifier of the effect to update + * \param haptic the SDL_Haptic device that has the effect. + * \param effect the identifier of the effect to update. * \param data an SDL_HapticEffect structure containing the new effect - * properties to use + * properties to use. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1111,10 +1123,10 @@ extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, * set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY` * instead. * - * \param haptic the SDL_Haptic device to run the effect on - * \param effect the ID of the haptic effect to run + * \param haptic the SDL_Haptic device to run the effect on. + * \param effect the ID of the haptic effect to run. * \param iterations the number of iterations to run the effect; use - * `SDL_HAPTIC_INFINITY` to repeat forever + * `SDL_HAPTIC_INFINITY` to repeat forever. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1133,8 +1145,8 @@ extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, * * * * - * \param haptic the SDL_Haptic device to stop the effect on - * \param effect the ID of the haptic effect to stop + * \param haptic the SDL_Haptic device to stop the effect on. + * \param effect the ID of the haptic effect to stop. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1152,8 +1164,8 @@ extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, * This will stop the effect if it's running. Effects are automatically * destroyed when the device is closed. * - * \param haptic the SDL_Haptic device to destroy the effect on - * \param effect the ID of the haptic effect to destroy + * \param haptic the SDL_Haptic device to destroy the effect on. + * \param effect the ID of the haptic effect to destroy. * * \since This function is available since SDL 2.0.0. * @@ -1167,8 +1179,8 @@ extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, * * Device must support the SDL_HAPTIC_STATUS feature. * - * \param haptic the SDL_Haptic device to query for the effect status on - * \param effect the ID of the haptic effect to query its status + * \param haptic the SDL_Haptic device to query for the effect status on. + * \param effect the ID of the haptic effect to query its status. * \returns 0 if it isn't playing, 1 if it is playing, or a negative error * code on failure; call SDL_GetError() for more information. * @@ -1190,8 +1202,9 @@ extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, * SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the * maximum. * - * \param haptic the SDL_Haptic device to set the gain on - * \param gain value to set the gain to, should be between 0 and 100 (0 - 100) + * \param haptic the SDL_Haptic device to set the gain on. + * \param gain value to set the gain to, should be between 0 and 100 (0 - + * 100). * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1209,8 +1222,8 @@ extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); * * Device must support the SDL_HAPTIC_AUTOCENTER feature. * - * \param haptic the SDL_Haptic device to set autocentering on - * \param autocenter value to set autocenter to (0-100) + * \param haptic the SDL_Haptic device to set autocentering on. + * \param autocenter value to set autocenter to (0-100). * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1230,7 +1243,7 @@ extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, * Do not modify the effects nor add new ones while the device is paused. That * can cause all sorts of weird errors. * - * \param haptic the SDL_Haptic device to pause + * \param haptic the SDL_Haptic device to pause. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1245,7 +1258,7 @@ extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); * * Call to unpause after SDL_HapticPause(). * - * \param haptic the SDL_Haptic device to unpause + * \param haptic the SDL_Haptic device to unpause. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1258,7 +1271,7 @@ extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); /** * Stop all the currently playing effects on a haptic device. * - * \param haptic the SDL_Haptic device to stop + * \param haptic the SDL_Haptic device to stop. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1269,7 +1282,7 @@ extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); /** * Check whether rumble is supported on a haptic device. * - * \param haptic haptic device to check for rumble support + * \param haptic haptic device to check for rumble support. * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a * negative error code on failure; call SDL_GetError() for more * information. @@ -1285,7 +1298,7 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); /** * Initialize a haptic device for simple rumble playback. * - * \param haptic the haptic device to initialize for simple rumble playback + * \param haptic the haptic device to initialize for simple rumble playback. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1301,9 +1314,9 @@ extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); /** * Run a simple rumble effect on a haptic device. * - * \param haptic the haptic device to play the rumble effect on - * \param strength strength of the rumble to play as a 0-1 float value - * \param length length of the rumble to play in milliseconds + * \param haptic the haptic device to play the rumble effect on. + * \param strength strength of the rumble to play as a 0-1 float value. + * \param length length of the rumble to play in milliseconds. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1318,7 +1331,7 @@ extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float stre /** * Stop the simple rumble on a haptic device. * - * \param haptic the haptic device to stop the rumble effect on + * \param haptic the haptic device to stop the rumble effect on. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * diff --git a/include/SDL_hidapi.h b/include/SDL_hidapi.h index 354af5c52dbab..5bf7dcc1d73b9 100644 --- a/include/SDL_hidapi.h +++ b/include/SDL_hidapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,44 +19,35 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: HIDAPI */ + /** - * \file SDL_hidapi.h - * - * Header file for SDL HIDAPI functions. - * - * This is an adaptation of the original HIDAPI interface by Alan Ott, - * and includes source code licensed under the following BSD license: - * - Copyright (c) 2010, Alan Ott, Signal 11 Software - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Signal 11 Software nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. + * # CategoryHIDAPI + * + * Header file for SDL HIDAPI functions. + * + * This is an adaptation of the original HIDAPI interface by Alan Ott, and + * includes source code licensed under the following license: + * + * ``` + * HIDAPI - Multi-Platform library for + * communication with HID devices. + * + * Copyright 2009, Alan Ott, Signal 11 Software. + * All Rights Reserved. + * + * This software may be used by anyone for any reason so + * long as the copyright notice in the source files + * remains intact. + * ``` + * + * (Note that this license is the same as item three of SDL's zlib license, so + * it adds no new requirements on the user.) * * If you would like a version of SDL without this code, you can build SDL - * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example - * on iOS or tvOS to avoid a dependency on the CoreBluetooth framework. + * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for + * example on iOS or tvOS to avoid a dependency on the CoreBluetooth + * framework. */ #ifndef SDL_hidapi_h_ @@ -71,14 +62,15 @@ extern "C" { #endif /** - * \brief A handle representing an open HID device + * A handle representing an open HID device */ struct SDL_hid_device_; typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */ /** hidapi info structure */ + /** - * \brief Information about a connected HID device + * Information about a connected HID device */ typedef struct SDL_hid_device_info { @@ -234,13 +226,14 @@ extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, * The path name be determined by calling SDL_hid_enumerate(), or a * platform-specific path name can be used (eg: /dev/hidraw0 on Linux). * - * \param path The path name of the device to open + * \param path The path name of the device to open. + * \param bExclusive boolean exclusive. * \returns a pointer to a SDL_hid_device object on success or NULL on * failure. * * \since This function is available since SDL 2.0.18. */ -extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */); +extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive); /** * Write an Output report to a HID device. @@ -434,7 +427,7 @@ extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int /** * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers * - * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan + * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan. * * \since This function is available since SDL 2.0.18. */ diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 76a74f0ffd003..51324451981f8 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,20 +20,20 @@ */ /** - * \file SDL_hints.h + * # CategoryHints * - * Official documentation for SDL configuration variables + * Official documentation for SDL configuration variables * - * This file contains functions to set and get configuration hints, - * as well as listing each of them alphabetically. + * This file contains functions to set and get configuration hints, as well as + * listing each of them alphabetically. * - * The convention for naming hints is SDL_HINT_X, where "SDL_X" is - * the environment variable that can be used to override the default. + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is the + * environment variable that can be used to override the default. * - * In general these hints are just that - they may or may not be - * supported or applicable on any given platform, but they provide - * a way for an application or user to give the library a hint as - * to how they would like the library to work. + * In general these hints are just that - they may or may not be supported or + * applicable on any given platform, but they provide a way for an application + * or user to give the library a hint as to how they would like the library to + * work. */ #ifndef SDL_hints_h_ @@ -48,110 +48,132 @@ extern "C" { #endif /** - * \brief A variable controlling whether the Android / iOS built-in - * accelerometer should be listed as a joystick device. + * A variable controlling whether the Android / iOS built-in accelerometer + * should be listed as a joystick device. * - * This variable can be set to the following values: - * "0" - The accelerometer is not listed as a joystick - * "1" - The accelerometer is available as a 3 axis joystick (the default). + * This variable can be set to the following values: + * + * - "0": The accelerometer is not listed as a joystick + * - "1": The accelerometer is available as a 3 axis joystick (the default). */ #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" /** - * \brief Specify the behavior of Alt+Tab while the keyboard is grabbed. + * Specify the behavior of Alt+Tab while the keyboard is grabbed. * - * By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed - * and your window is full-screen. This prevents the user from getting stuck in - * your application if you've enabled keyboard grab. + * By default, SDL emulates Alt+Tab functionality while the keyboard is + * grabbed and your window is full-screen. This prevents the user from getting + * stuck in your application if you've enabled keyboard grab. * * The variable can be set to the following values: - * "0" - SDL will not handle Alt+Tab. Your application is responsible - for handling Alt+Tab while the keyboard is grabbed. - * "1" - SDL will minimize your window when Alt+Tab is pressed (default) -*/ + * + * - "0": SDL will not handle Alt+Tab. Your application is responsible for + * handling Alt+Tab while the keyboard is grabbed. + * - "1": SDL will minimize your window when Alt+Tab is pressed (default) + */ #define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED" /** - * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. - * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * If set to "0" then never set the top most bit on a SDL Window, even if the + * video mode expects it. + * + * This is a debugging aid for developers and not expected to be used by end + * users. The default is "1" + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - don't allow topmost - * "1" - allow topmost + * - "0": don't allow topmost + * - "1": allow topmost */ #define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" /** - * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. + * Android APK expansion main file version. * - * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. + * Should be a string number like "1", "2" etc. + * + * Must be set together with + * SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. * * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. + * after a given relative path was not found in the internal storage and + * assets. * - * By default this hint is not set and the APK expansion files are not searched. + * By default this hint is not set and the APK expansion files are not + * searched. */ #define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" - + /** - * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. + * Android APK expansion patch file version. + * + * Should be a string number like "1", "2" etc. * * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. * * If both hints were set then SDL_RWFromFile() will look into expansion files - * after a given relative path was not found in the internal storage and assets. + * after a given relative path was not found in the internal storage and + * assets. * - * By default this hint is not set and the APK expansion files are not searched. + * By default this hint is not set and the APK expansion files are not + * searched. */ #define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" /** - * \brief A variable to control whether the event loop will block itself when the app is paused. + * A variable to control whether the event loop will block itself when the app + * is paused. * * The variable can be set to the following values: - * "0" - Non blocking. - * "1" - Blocking. (default) + * + * - "0": Non blocking. + * - "1": Blocking. (default) * * The value should be set before SDL is initialized. */ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" /** - * \brief A variable to control whether SDL will pause audio in background - * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") + * A variable to control whether SDL will pause audio in background (Requires + * SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") * * The variable can be set to the following values: - * "0" - Non paused. - * "1" - Paused. (default) + * + * - "0": Non paused. + * - "1": Paused. (default) * * The value should be set before SDL is initialized. */ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" /** - * \brief A variable to control whether we trap the Android back button to handle it manually. - * This is necessary for the right mouse button to work on some Android devices, or - * to be able to trap the back button for use in your code reliably. If set to true, - * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of - * SDL_SCANCODE_AC_BACK. + * A variable to control whether we trap the Android back button to handle it + * manually. + * + * This is necessary for the right mouse button to work on some Android + * devices, or to be able to trap the back button for use in your code + * reliably. If set to true, the back button will show up as an SDL_KEYDOWN / + * SDL_KEYUP pair with a keycode of SDL_SCANCODE_AC_BACK. * * The variable can be set to the following values: - * "0" - Back button will be handled as usual for system. (default) - * "1" - Back button will be trapped, allowing you to handle the key press - * manually. (This will also let right mouse click work on systems - * where the right mouse button functions as back.) * - * The value of this hint is used at runtime, so it can be changed at any time. + * - "0": Back button will be handled as usual for system. (default) + * - "1": Back button will be trapped, allowing you to handle the key press + * manually. (This will also let right mouse click work on systems where the + * right mouse button functions as back.) + * + * The value of this hint is used at runtime, so it can be changed at any + * time. */ #define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" /** - * \brief Specify an application name. - * + * Specify an application name. + * * This hint lets you specify the application name sent to the OS when * required. For example, this will often appear in volume control applets for * audio streams, and in lists of applications which are inhibiting the - * screensaver. You should use a string that describes your program ("My Game + * screensaver. You should use a string that describes your program ("My Game * 2: The Revenge") * * Setting this to "" or leaving it unset will have SDL use a reasonable @@ -166,48 +188,51 @@ extern "C" { #define SDL_HINT_APP_NAME "SDL_APP_NAME" /** - * \brief A variable controlling whether controllers used with the Apple TV - * generate UI events. + * A variable controlling whether controllers used with the Apple TV generate + * UI events. * * When UI events are generated by controller input, the app will be - * backgrounded when the Apple TV remote's menu button is pressed, and when the - * pause or B buttons on gamepads are pressed. + * backgrounded when the Apple TV remote's menu button is pressed, and when + * the pause or B buttons on gamepads are pressed. * * More information about properly making use of controllers for the Apple TV * can be found here: * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ * - * This variable can be set to the following values: - * "0" - Controller input does not generate UI events (the default). - * "1" - Controller input generates UI events. + * This variable can be set to the following values: + * + * - "0": Controller input does not generate UI events (the default). + * - "1": Controller input generates UI events. */ #define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" /** - * \brief A variable controlling whether the Apple TV remote's joystick axes - * will automatically match the rotation of the remote. + * A variable controlling whether the Apple TV remote's joystick axes will + * automatically match the rotation of the remote. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Remote orientation does not affect joystick axes (the default). - * "1" - Joystick axes are based on the orientation of the remote. + * - "0": Remote orientation does not affect joystick axes (the default). + * - "1": Joystick axes are based on the orientation of the remote. */ #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" /** - * \brief A variable controlling the audio category on iOS and Mac OS X + * A variable controlling the audio category on iOS and Mac OS X * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) - * "playback" - Use the AVAudioSessionCategoryPlayback category + * - "ambient": Use the AVAudioSessionCategoryAmbient audio category, will be + * muted by the phone mute switch (default) + * - "playback": Use the AVAudioSessionCategoryPlayback category * - * For more information, see Apple's documentation: - * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html + * For more information, see Apple's documentation: + * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html */ #define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" /** - * \brief Specify an application name for an audio device. + * Specify an application name for an audio device. * * Some audio backends (such as PulseAudio) allow you to describe your audio * stream. Among other things, this description might show up in a system @@ -228,7 +253,7 @@ extern "C" { #define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" /** - * \brief Specify an application name for an audio device. + * Specify an application name for an audio device. * * Some audio backends (such as PulseAudio) allow you to describe your audio * stream. Among other things, this description might show up in a system @@ -249,11 +274,11 @@ extern "C" { #define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" /** - * \brief Specify an application role for an audio device. + * Specify an application role for an audio device. * * Some audio backends (such as Pipewire) allow you to describe the role of - * your audio stream. Among other things, this description might show up in - * a system control panel or software for displaying and manipulating media + * your audio stream. Among other things, this description might show up in a + * system control panel or software for displaying and manipulating media * playback/capture graphs. * * This hints lets you transmit that information to the OS. The contents of @@ -269,1214 +294,1798 @@ extern "C" { #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" /** - * \brief A variable controlling speed/quality tradeoff of audio resampling. + * A variable controlling speed/quality tradeoff of audio resampling. * - * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) - * to handle audio resampling. There are different resampling modes available - * that produce different levels of quality, using more CPU. + * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) + * to handle audio resampling. There are different resampling modes available + * that produce different levels of quality, using more CPU. * - * If this hint isn't specified to a valid setting, or libsamplerate isn't - * available, SDL will use the default, internal resampling algorithm. + * If this hint isn't specified to a valid setting, or libsamplerate isn't + * available, SDL will use the default, internal resampling algorithm. * - * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available. + * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is + * available. * - * This hint is currently only checked at audio subsystem initialization. + * This hint is currently only checked at audio subsystem initialization. * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) - * "1" or "fast" - Use fast, slightly higher quality resampling, if available - * "2" or "medium" - Use medium quality resampling, if available - * "3" or "best" - Use high quality resampling, if available + * - "0" or "default": Use SDL's internal resampling (Default when not set - + * low quality, fast) + * - "1" or "fast": Use fast, slightly higher quality resampling, if available + * - "2" or "medium": Use medium quality resampling, if available + * - "3" or "best": Use high quality resampling, if available */ #define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" /** - * \brief A variable controlling whether SDL updates joystick state when getting input events + * A variable controlling whether SDL updates joystick state when getting + * input events * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "0" - You'll call SDL_JoystickUpdate() manually - * "1" - SDL will automatically call SDL_JoystickUpdate() (default) + * - "0": You'll call SDL_JoystickUpdate() manually + * - "1": SDL will automatically call SDL_JoystickUpdate() (default) * - * This hint can be toggled on and off at runtime. + * This hint can be toggled on and off at runtime. */ #define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" /** - * \brief A variable controlling whether SDL updates sensor state when getting input events + * A variable controlling whether SDL updates sensor state when getting input + * events * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "0" - You'll call SDL_SensorUpdate() manually - * "1" - SDL will automatically call SDL_SensorUpdate() (default) + * - "0": You'll call SDL_SensorUpdate() manually + * - "1": SDL will automatically call SDL_SensorUpdate() (default) * - * This hint can be toggled on and off at runtime. + * This hint can be toggled on and off at runtime. */ #define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" /** - * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. + * Prevent SDL from using version 4 of the bitmap header when saving BMPs. * - * The bitmap header version 4 is required for proper alpha channel support and - * SDL will use it when required. Should this not be desired, this hint can - * force the use of the 40 byte header version which is supported everywhere. + * The bitmap header version 4 is required for proper alpha channel support + * and SDL will use it when required. Should this not be desired, this hint + * can force the use of the 40 byte header version which is supported + * everywhere. * * The variable can be set to the following values: - * "0" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file with an alpha mask. SDL will use the bitmap - * header version 4 and set the alpha mask accordingly. - * "1" - Surfaces with a colorkey or an alpha channel are saved to a - * 32-bit BMP file without an alpha mask. The alpha channel data - * will be in the file, but applications are going to ignore it. + * + * - "0": Surfaces with a colorkey or an alpha channel are saved to a 32-bit + * BMP file with an alpha mask. SDL will use the bitmap header version 4 and + * set the alpha mask accordingly. + * - "1": Surfaces with a colorkey or an alpha channel are saved to a 32-bit + * BMP file without an alpha mask. The alpha channel data will be in the + * file, but applications are going to ignore it. * * The default value is "0". */ #define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" /** - * \brief Override for SDL_GetDisplayUsableBounds() + * Override for SDL_GetDisplayUsableBounds() * - * If set, this hint will override the expected results for - * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want - * to do this, but this allows an embedded system to request that some of the - * screen be reserved for other uses when paired with a well-behaved - * application. + * If set, this hint will override the expected results for + * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want + * to do this, but this allows an embedded system to request that some of the + * screen be reserved for other uses when paired with a well-behaved + * application. * - * The contents of this hint must be 4 comma-separated integers, the first - * is the bounds x, then y, width and height, in that order. + * The contents of this hint must be 4 comma-separated integers, the first is + * the bounds x, then y, width and height, in that order. */ #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" /** - * \brief Disable giving back control to the browser automatically - * when running with asyncify + * Disable giving back control to the browser automatically when running with + * asyncify * - * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations - * such as refreshing the screen or polling events. + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations such as + * refreshing the screen or polling events. * * This hint only applies to the emscripten platform * * The variable can be set to the following values: - * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) - * "1" - Enable emscripten_sleep calls (the default) + * + * - "0": Disable emscripten_sleep calls (if you give back browser control + * manually or use asyncify for other purposes) + * - "1": Enable emscripten_sleep calls (the default) */ #define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" /** - * \brief override the binding element for keyboard inputs for Emscripten builds + * override the binding element for keyboard inputs for Emscripten builds * - * This hint only applies to the emscripten platform + * This hint only applies to the emscripten platform. + * + * The variable can be one of: * - * The variable can be one of - * "#window" - The javascript window object (this is the default) - * "#document" - The javascript document object - * "#screen" - the javascript window.screen object - * "#canvas" - the WebGL canvas element - * any other string without a leading # sign applies to the element on the page with that ID. + * - "#window": the javascript window object (this is the default) + * - "#document": the javascript document object + * - "#screen": the javascript window.screen object + * - "#canvas": the WebGL canvas element + * + * Any other string without a leading # sign applies to the element on the + * page with that ID. */ #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" /** - * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs + * A variable that controls whether the on-screen keyboard should be shown + * when text input is active + * + * The variable can be set to the following values: * - * The variable can be set to the following values: - * "0" - Do not scan for Steam Controllers - * "1" - Scan for Steam Controllers (the default) + * - "0": Do not show the on-screen keyboard + * - "1": Show the on-screen keyboard * - * The default value is "1". This hint must be set before initializing the joystick subsystem. + * The default value is "1". This hint must be set before text input is + * activated. */ -#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" +#define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" /** - * \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue. + * A variable controlling verbosity of the logging of SDL events pushed onto + * the internal queue. * - * This variable can be set to the following values, from least to most verbose: + * This variable can be set to the following values, from least to most + * verbose: * - * "0" - Don't log any events (default) - * "1" - Log most events (other than the really spammy ones). - * "2" - Include mouse and finger motion events. - * "3" - Include SDL_SysWMEvent events. + * - "0": Don't log any events (default) + * - "1": Log most events (other than the really spammy ones). + * - "2": Include mouse and finger motion events. + * - "3": Include SDL_SysWMEvent events. * - * This is generally meant to be used to debug SDL itself, but can be useful - * for application developers that need better visibility into what is going - * on in the event queue. Logged events are sent through SDL_Log(), which - * means by default they appear on stdout on most platforms or maybe - * OutputDebugString() on Windows, and can be funneled by the app with - * SDL_LogSetOutputFunction(), etc. + * This is generally meant to be used to debug SDL itself, but can be useful + * for application developers that need better visibility into what is going + * on in the event queue. Logged events are sent through SDL_Log(), which + * means by default they appear on stdout on most platforms or maybe + * OutputDebugString() on Windows, and can be funneled by the app with + * SDL_LogSetOutputFunction(), etc. * - * This hint can be toggled on and off at runtime, if you only need to log - * events for a small subset of program execution. + * This hint can be toggled on and off at runtime, if you only need to log + * events for a small subset of program execution. */ #define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" /** - * \brief A variable controlling whether raising the window should be done more forcefully + * A variable controlling whether raising the window should be done more + * forcefully + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - No forcing (the default) - * "1" - Extra level of forcing + * - "0": No forcing (the default) + * - "1": Extra level of forcing * - * At present, this is only an issue under MS Windows, which makes it nearly impossible to - * programmatically move a window to the foreground, for "security" reasons. See - * http://stackoverflow.com/a/34414846 for a discussion. + * At present, this is only an issue under MS Windows, which makes it nearly + * impossible to programmatically move a window to the foreground, for + * "security" reasons. See http://stackoverflow.com/a/34414846 for a + * discussion. */ #define SDL_HINT_FORCE_RAISEWINDOW "SDL_HINT_FORCE_RAISEWINDOW" /** - * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * A variable controlling how 3D acceleration is used to accelerate the SDL + * screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and how + * this is done. * - * SDL can try to accelerate the SDL screen surface by using streaming - * textures with a 3D rendering engine. This variable controls whether and - * how this is done. + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable 3D acceleration - * "1" - Enable 3D acceleration, using the default renderer. - * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * - "0": Disable 3D acceleration + * - "1": Enable 3D acceleration, using the default renderer. + * - "X": Enable 3D acceleration, using X where X is one of the valid + * rendering drivers. (e.g. "direct3d", "opengl", etc.) * - * By default SDL tries to make a best guess for each platform whether - * to use acceleration or not. + * By default SDL tries to make a best guess for each platform whether to use + * acceleration or not. */ #define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" /** - * \brief A variable that lets you manually hint extra gamecontroller db entries. + * A variable that lets you manually hint extra gamecontroller db entries. * - * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * The variable should be newline delimited rows of gamecontroller config + * data, see SDL_gamecontroller.h * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) You + * can update mappings after the system is initialized with + * SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() */ #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" /** - * \brief A variable that lets you provide a file with extra gamecontroller db entries. + * A variable that lets you provide a file with extra gamecontroller db + * entries. * - * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h + * The file should contain lines of gamecontroller config data, see + * SDL_gamecontroller.h * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) You + * can update mappings after the system is initialized with + * SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() */ #define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" /** - * \brief A variable that overrides the automatic controller type detection + * A variable that overrides the automatic controller type detection * - * The variable should be comma separated entries, in the form: VID/PID=type + * The variable should be comma separated entries, in the form: VID/PID=type * - * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd + * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd * - * The type should be one of: - * Xbox360 - * XboxOne - * PS3 - * PS4 - * PS5 - * SwitchPro + * The type should be one of: Xbox360 XboxOne PS3 PS4 PS5 SwitchPro * - * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * This hint affects what driver is used, and must be set before calling + * SDL_Init(SDL_INIT_GAMECONTROLLER) */ #define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" /** - * \brief A variable containing a list of devices to skip when scanning for game controllers. + * A variable containing a list of devices to skip when scanning for game + * controllers. * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. */ #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" /** - * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. + * If set, all devices will be skipped when scanning for game controllers + * except for the ones listed in this variable. * - * The format of the string is a comma separated list of USB VID/PID pairs - * in hexadecimal form, e.g. + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. * - * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD * - * The variable can also take the form of @file, in which case the named - * file will be loaded and interpreted as the value of the variable. + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. */ #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" /** - * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. - * - * For example, on Nintendo Switch controllers, normally you'd get: + * If set, game controller face buttons report their values according to their + * labels instead of their positional layout. + * + * For example, on Nintendo Switch controllers, normally you'd get: * + * ``` * (Y) * (X) (B) * (A) + * ``` * - * but if this hint is set, you'll get: + * but if this hint is set, you'll get: * + * ``` * (X) * (Y) (A) * (B) + * ``` * - * The variable can be set to the following values: - * "0" - Report the face buttons by position, as though they were on an Xbox controller. - * "1" - Report the face buttons by label instead of position + * The variable can be set to the following values: + * + * - "0": Report the face buttons by position, as though they were on an Xbox + * controller. + * - "1": Report the face buttons by label instead of position * - * The default value is "1". This hint may be set at any time. + * The default value is "1". This hint may be set at any time. */ #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" /** - * \brief A variable controlling whether grabbing input grabs the keyboard + * A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Grab will affect only the mouse - * "1" - Grab will affect mouse and keyboard + * - "0": Grab will affect only the mouse + * - "1": Grab will affect mouse and keyboard * - * By default SDL will not grab the keyboard so system shortcuts still work. + * By default SDL will not grab the keyboard so system shortcuts still work. */ #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" /** - * \brief A variable containing a list of devices to ignore in SDL_hid_enumerate() + * A variable containing a list of devices to ignore in SDL_hid_enumerate() * - * For example, to ignore the Shanwan DS3 controller and any Valve controller, you might - * have the string "0x2563/0x0523,0x28de/0x0000" + * For example, to ignore the Shanwan DS3 controller and any Valve controller, + * you might have the string "0x2563/0x0523,0x28de/0x0000" */ #define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" /** - * \brief A variable controlling whether the idle timer is disabled on iOS. + * A variable controlling whether the idle timer is disabled on iOS. * - * When an iOS app does not receive touches for some time, the screen is - * dimmed automatically. For games where the accelerometer is the only input - * this is problematic. This functionality can be disabled by setting this - * hint. + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. * - * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() - * accomplish the same thing on iOS. They should be preferred over this hint. + * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() + * accomplish the same thing on iOS. They should be preferred over this hint. * - * This variable can be set to the following values: - * "0" - Enable idle timer - * "1" - Disable idle timer + * This variable can be set to the following values: + * + * - "0": Enable idle timer + * - "1": Disable idle timer */ #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" /** - * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. + * A variable to control whether certain IMEs should handle text editing + * internally instead of sending SDL_TEXTEDITING events. * * The variable can be set to the following values: - * "0" - SDL_TEXTEDITING events are sent, and it is the application's - * responsibility to render the text from these events and - * differentiate it somehow from committed text. (default) - * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, - * and text that is being composed will be rendered in its own UI. + * + * - "0": SDL_TEXTEDITING events are sent, and it is the application's + * responsibility to render the text from these events and differentiate it + * somehow from committed text. (default) + * - "1": If supported by the IME then SDL_TEXTEDITING events are not sent, + * and text that is being composed will be rendered in its own UI. */ #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" /** - * \brief A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them. + * A variable to control whether certain IMEs should show native UI components + * (such as the Candidate List) instead of suppressing them. * * The variable can be set to the following values: - * "0" - Native UI components are not display. (default) - * "1" - Native UI components are displayed. + * + * - "0": Native UI components are not display. (default) + * - "1": Native UI components are displayed. */ #define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI" /** - * \brief A variable to control if extended IME text support is enabled. - * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise. - * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated. + * A variable to control if extended IME text support is enabled. + * + * If enabled then SDL_TextEditingExtEvent will be issued if the text would be + * truncated otherwise. Additionally SDL_TextInputEvent will be dispatched + * multiple times so that it is not truncated. * * The variable can be set to the following values: - * "0" - Legacy behavior. Text can be truncated, no heap allocations. (default) - * "1" - Modern behavior. + * + * - "0": Legacy behavior. Text can be truncated, no heap allocations. + * (default) + * - "1": Modern behavior. */ #define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT" /** - * \brief A variable controlling whether the home indicator bar on iPhone X - * should be hidden. + * A variable controlling whether the home indicator bar on iPhone X should be + * hidden. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - The indicator bar is not hidden (default for windowed applications) - * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) - * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) + * - "0": The indicator bar is not hidden (default for windowed applications) + * - "1": The indicator bar is hidden and is shown when the screen is touched + * (useful for movie playback applications) + * - "2": The indicator bar is dim and the first swipe makes it visible and + * the second swipe performs the "home" action (default for fullscreen + * applications) */ #define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" /** - * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * A variable that lets you enable joystick (and gamecontroller) events even + * when your app is in the background. * - * The variable can be set to the following values: - * "0" - Disable joystick & gamecontroller input events when the - * application is in the background. - * "1" - Enable joystick & gamecontroller input events when the - * application is in the background. + * The variable can be set to the following values: + * + * - "0": Disable joystick & gamecontroller input events when the application + * is in the background. + * - "1": Enable joystick & gamecontroller input events when the application + * is in the background. * - * The default value is "0". This hint may be set at any time. + * The default value is "0". This hint may be set at any time. */ #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" /** - * \brief A variable controlling whether the HIDAPI joystick drivers should be used. + * A variable containing a list of arcade stick style controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES "SDL_JOYSTICK_ARCADESTICK_DEVICES" + +/** + * A variable containing a list of devices that are not arcade stick style + * controllers. + * + * This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in + * device list. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" + +/** + * A variable containing a list of devices that should not be considerd + * joysticks. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES "SDL_JOYSTICK_BLACKLIST_DEVICES" + +/** + * A variable containing a list of devices that should be considered + * joysticks. + * + * This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in + * device list. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" + +/** + * A variable containing a list of flightstick style controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES "SDL_JOYSTICK_FLIGHTSTICK_DEVICES" + +/** + * A variable containing a list of devices that are not flightstick style + * controllers. + * + * This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in + * device list. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" + +/** + * A variable containing a list of devices known to have a GameCube form + * factor. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES "SDL_JOYSTICK_GAMECUBE_DEVICES" + +/** + * A variable containing a list of devices known not to have a GameCube form + * factor. + * + * This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in + * device list. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" + +/** + * A variable controlling whether the HIDAPI joystick drivers should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI drivers are not used - * "1" - HIDAPI drivers are used (the default) + * - "0": HIDAPI drivers are not used + * - "1": HIDAPI drivers are used (the default) * - * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. + * This variable is the default for all drivers, but can be overridden by the + * hints for specific drivers below. */ #define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" /** - * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. + * A variable controlling whether the HIDAPI driver for Nintendo GameCube + * controllers should be used. * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" /** - * \brief A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement - * the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2) - * this is useful for applications that need full compatibility for things like ADSR envelopes. - * Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0" - * Rumble is both at any arbitrary value, - * StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0" + * A variable controlling whether "low_frequency_rumble" and + * "high_frequency_rumble" is used to implement the GameCube controller's 3 + * rumble modes, Stop(0), Rumble(1), and StopHard(2) this is useful for + * applications that need full compatibility for things like ADSR envelopes. * - * This variable can be set to the following values: - * "0" - Normal rumble behavior is behavior is used (default) - * "1" - Proper GameCube controller rumble behavior is used + * Stop is implemented by setting "low_frequency_rumble" to "0" and + * "high_frequency_rumble" ">0" Rumble is both at any arbitrary value, + * StopHard is implemented by setting both "low_frequency_rumble" and + * "high_frequency_rumble" to "0" + * + * This variable can be set to the following values: * + * - "0": Normal rumble behavior is behavior is used (default) + * - "1": Proper GameCube controller rumble behavior is used */ #define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE" /** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ + * A variable controlling whether the HIDAPI driver for Nintendo Switch + * Joy-Cons should be used. + * + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ #define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS" /** - * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver - * - * This variable can be set to the following values: - * "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad - * "1" - Left and right Joy-Con controllers will be combined into a single controller (the default) - */ + * A variable controlling whether Nintendo Switch Joy-Con controllers will be + * combined into a single Pro-like controller when using the HIDAPI driver + * + * This variable can be set to the following values: + * + * - "0": Left and right Joy-Con controllers will not be combined and each + * will be a mini-gamepad + * - "1": Left and right Joy-Con controllers will be combined into a single + * controller (the default) + */ #define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS" /** - * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver - * - * This variable can be set to the following values: - * "0" - Left and right Joy-Con controllers will not be in vertical mode (the default) - * "1" - Left and right Joy-Con controllers will be in vertical mode - * - * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) - */ + * A variable controlling whether Nintendo Switch Joy-Con controllers will be + * in vertical mode when using the HIDAPI driver + * + * This variable can be set to the following values: + * + * - "0": Left and right Joy-Con controllers will not be in vertical mode (the + * default) + * - "1": Left and right Joy-Con controllers will be in vertical mode + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ #define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS" /** - * \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ + * A variable controlling whether the HIDAPI driver for Amazon Luna + * controllers connected via Bluetooth should be used. + * + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ #define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA" /** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ + * A variable controlling whether the HIDAPI driver for Nintendo Online + * classic controllers should be used. + * + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ #define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC" /** - * \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ + * A variable controlling whether the HIDAPI driver for NVIDIA SHIELD + * controllers should be used. + * + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ #define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD" /** - * \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used. + * A variable controlling whether the HIDAPI driver for PS3 controllers should + * be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms. + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on + * other platforms. * - * It is not possible to use this driver on Windows, due to limitations in the default drivers - * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows. + * It is not possible to use this driver on Windows, due to limitations in the + * default drivers installed. See https://github.com/ViGEm/DsHidMini for an + * alternative driver on Windows. */ #define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3" /** - * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. + * A variable controlling whether the HIDAPI driver for PS4 controllers should + * be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" /** - * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. + * A variable controlling whether extended input reports should be used for + * PS4 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports + * - "0": extended reports are not enabled (the default) + * - "1": extended reports * - * Extended input reports allow rumble on Bluetooth PS4 controllers, but - * break DirectInput handling for applications that don't use SDL. + * Extended input reports allow rumble on Bluetooth PS4 controllers, but break + * DirectInput handling for applications that don't use SDL. * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. + * Once extended reports are enabled, they can not be disabled without power + * cycling the controller. * - * For compatibility with applications written for versions of SDL prior - * to the introduction of PS5 controller support, this value will also - * control the state of extended reports on PS5 controllers when the - * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set. + * For compatibility with applications written for versions of SDL prior to + * the introduction of PS5 controller support, this value will also control + * the state of extended reports on PS5 controllers when the + * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set. */ #define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" /** - * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. + * A variable controlling whether the HIDAPI driver for PS5 controllers should + * be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" /** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller. + * A variable controlling whether the player LEDs should be lit to indicate + * which player is associated with a PS5 controller. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) + * - "0": player LEDs are not enabled + * - "1": player LEDs are enabled (the default) */ #define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED" /** - * \brief A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver. + * A variable controlling whether extended input reports should be used for + * PS5 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - extended reports are not enabled (the default) - * "1" - extended reports + * - "0": extended reports are not enabled (the default) + * - "1": extended reports * - * Extended input reports allow rumble on Bluetooth PS5 controllers, but - * break DirectInput handling for applications that don't use SDL. + * Extended input reports allow rumble on Bluetooth PS5 controllers, but break + * DirectInput handling for applications that don't use SDL. * - * Once extended reports are enabled, they can not be disabled without - * power cycling the controller. + * Once extended reports are enabled, they can not be disabled without power + * cycling the controller. * - * For compatibility with applications written for versions of SDL prior - * to the introduction of PS5 controller support, this value defaults to - * the value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE. + * For compatibility with applications written for versions of SDL prior to + * the introduction of PS5 controller support, this value defaults to the + * value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE. */ #define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE" /** - * \brief A variable controlling whether the HIDAPI driver for Google Stadia controllers should be used. + * A variable controlling whether the HIDAPI driver for Google Stadia + * controllers should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA" /** - * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used. + * A variable controlling whether the HIDAPI driver for Bluetooth Steam + * Controllers should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access - * and may prompt the user for permission on iOS and Android. + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used for Steam Controllers, which requires + * Bluetooth access and may prompt the user for permission on iOS and + * Android. * - * The default is "0" + * The default is "0" */ #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" /** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. + * A variable controlling whether the HIDAPI driver for the Steam Deck builtin + * controller should be used. + * + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK" + +/** + * A variable controlling whether the HIDAPI driver for Nintendo Switch + * controllers should be used. * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" /** - * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened + * A variable controlling whether the Home button LED should be turned on when + * a Nintendo Switch Pro controller is opened + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on + * - "0": home button LED is turned off + * - "1": home button LED is turned on * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. + * By default the Home button LED state is not changed. This hint can also be + * set to a floating point value between 0.0 and 1.0 which controls the + * brightness of the Home button LED. */ #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED" /** - * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened + * A variable controlling whether the Home button LED should be turned on when + * a Nintendo Switch Joy-Con controller is opened * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on + * This variable can be set to the following values: + * + * - "0": home button LED is turned off + * - "1": home button LED is turned on * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. + * By default the Home button LED state is not changed. This hint can also be + * set to a floating point value between 0.0 and 1.0 which controls the + * brightness of the Home button LED. */ #define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED" /** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller. + * A variable controlling whether the player LEDs should be lit to indicate + * which player is associated with a Nintendo Switch controller. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) + * - "0": player LEDs are not enabled + * - "1": player LEDs are enabled (the default) */ #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED" /** - * \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used. + * A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U + * controllers should be used. * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now. + * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE + * for now. */ #define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII" /** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller. + * A variable controlling whether the player LEDs should be lit to indicate + * which player is associated with a Wii controller. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) + * - "0": player LEDs are not enabled + * - "1": player LEDs are enabled (the default) */ #define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED" /** - * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. + * A variable controlling whether the HIDAPI driver for XBox controllers + * should be used. * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI + * The default is "0" on Windows, otherwise the value of + * SDL_HINT_JOYSTICK_HIDAPI */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** - * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used. + * A variable controlling whether the HIDAPI driver for XBox 360 controllers + * should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" /** - * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller. + * A variable controlling whether the player LEDs should be lit to indicate + * which player is associated with an Xbox 360 controller. * - * This variable can be set to the following values: - * "0" - player LEDs are not enabled - * "1" - player LEDs are enabled (the default) + * This variable can be set to the following values: + * + * - "0": player LEDs are not enabled + * - "1": player LEDs are enabled (the default) */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED" /** - * \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used. + * A variable controlling whether the HIDAPI driver for XBox 360 wireless + * controllers should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" /** - * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used. + * A variable controlling whether the HIDAPI driver for XBox One controllers + * should be used. * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used + * This variable can be set to the following values: + * + * - "0": HIDAPI driver is not used + * - "1": HIDAPI driver is used * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" /** - * \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened + * A variable controlling whether the Home button LED should be turned on when + * an Xbox One controller is opened + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - home button LED is turned off - * "1" - home button LED is turned on + * - "0": home button LED is turned off + * - "1": home button LED is turned on * - * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4. + * By default the Home button LED state is not changed. This hint can also be + * set to a floating point value between 0.0 and 1.0 which controls the + * brightness of the Home button LED. The default brightness is 0.4. */ #define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" /** - * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. - * - * This variable can be set to the following values: - * "0" - RAWINPUT drivers are not used - * "1" - RAWINPUT drivers are used (the default) - */ + * A variable controlling whether IOKit should be used for controller + * handling. + * + * This variable can be set to the following values: + * + * - "0": IOKit is not used + * - "1": IOKit is used (the default) + */ +#define SDL_HINT_JOYSTICK_IOKIT "SDL_JOYSTICK_IOKIT" + +/** + * A variable controlling whether GCController should be used for controller + * handling. + * + * This variable can be set to the following values: + * + * - "0": GCController is not used + * - "1": GCController is used (the default) + */ +#define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI" + +/** + * A variable controlling whether the RAWINPUT joystick drivers should be used + * for better handling XInput-capable devices. + * + * This variable can be set to the following values: + * + * - "0": RAWINPUT drivers are not used (the default) + * - "1": RAWINPUT drivers are used + */ #define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" /** - * \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput. - * - * This variable can be set to the following values: - * "0" - RAWINPUT driver will only use data from raw input APIs - * "1" - RAWINPUT driver will also pull data from XInput, providing - * better trigger axes, guide button presses, and rumble support - * for Xbox controllers - * - * The default is "1". This hint applies to any joysticks opened after setting the hint. - */ + * A variable controlling whether the RAWINPUT driver should pull correlated + * data from XInput. + * + * This variable can be set to the following values: + * + * - "0": RAWINPUT driver will only use data from raw input APIs + * - "1": RAWINPUT driver will also pull data from XInput, providing better + * trigger axes, guide button presses, and rumble support for Xbox + * controllers + * + * The default is "1". This hint applies to any joysticks opened after setting + * the hint. + */ #define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" /** - * \brief A variable controlling whether the ROG Chakram mice should show up as joysticks - * - * This variable can be set to the following values: - * "0" - ROG Chakram mice do not show up as joysticks (the default) - * "1" - ROG Chakram mice show up as joysticks - */ + * A variable controlling whether the ROG Chakram mice should show up as + * joysticks + * + * This variable can be set to the following values: + * + * - "0": ROG Chakram mice do not show up as joysticks (the default) + * - "1": ROG Chakram mice show up as joysticks + */ #define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM" /** - * \brief A variable controlling whether a separate thread should be used - * for handling joystick detection and raw input messages on Windows - * - * This variable can be set to the following values: - * "0" - A separate thread is not used (the default) - * "1" - A separate thread is used for handling raw input messages - * - */ + * A variable controlling whether a separate thread should be used for + * handling joystick detection and raw input messages on Windows + * + * This variable can be set to the following values: + * + * - "0": A separate thread is not used (the default) + * - "1": A separate thread is used for handling raw input messages + */ #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" /** - * \brief Determines whether SDL enforces that DRM master is required in order - * to initialize the KMSDRM video backend. + * A variable containing a list of throttle style controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES "SDL_JOYSTICK_THROTTLE_DEVICES" + +/** + * A variable containing a list of devices that are not throttle style + * controllers. + * + * This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in + * device list. * - * The DRM subsystem has a concept of a "DRM master" which is a DRM client that - * has the ability to set planes, set cursor, etc. When SDL is DRM master, it - * can draw to the screen using the SDL rendering APIs. Without DRM master, SDL - * is still able to process input and query attributes of attached displays, - * but it cannot change display state or draw to the screen directly. + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. * - * In some cases, it can be useful to have the KMSDRM backend even if it cannot - * be used for rendering. An app may want to use SDL for input processing while - * using another rendering API (such as an MMAL overlay on Raspberry Pi) or - * using its own code to render to DRM overlays that SDL doesn't support. + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" + +/** + * A variable controlling whether Windows.Gaming.Input should be used for + * controller handling. + * + * This variable can be set to the following values: + * + * - "0": WGI is not used + * - "1": WGI is used (the default) + */ +#define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI" + +/** + * A variable containing a list of wheel style controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_WHEEL_DEVICES "SDL_JOYSTICK_WHEEL_DEVICES" + +/** + * A variable containing a list of devices that are not wheel style + * controllers. + * + * This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device + * list. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" + +/** + * A variable containing a list of devices known to have all axes centered at + * zero. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" + +/** + * Determines whether SDL enforces that DRM master is required in order to + * initialize the KMSDRM video backend. + * + * The DRM subsystem has a concept of a "DRM master" which is a DRM client + * that has the ability to set planes, set cursor, etc. When SDL is DRM + * master, it can draw to the screen using the SDL rendering APIs. Without DRM + * master, SDL is still able to process input and query attributes of attached + * displays, but it cannot change display state or draw to the screen + * directly. + * + * In some cases, it can be useful to have the KMSDRM backend even if it + * cannot be used for rendering. An app may want to use SDL for input + * processing while using another rendering API (such as an MMAL overlay on + * Raspberry Pi) or using its own code to render to DRM overlays that SDL + * doesn't support. * * This hint must be set before initializing the video subsystem. * * This variable can be set to the following values: - * "0" - SDL will allow usage of the KMSDRM backend without DRM master - * "1" - SDL Will require DRM master to use the KMSDRM backend (default) + * + * - "0": SDL will allow usage of the KMSDRM backend without DRM master + * - "1": SDL Will require DRM master to use the KMSDRM backend (default) */ #define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" /** - * \brief A comma separated list of devices to open as joysticks - * - * This variable is currently only used by the Linux joystick driver. - */ + * A comma separated list of devices to open as joysticks + * + * This variable is currently only used by the Linux joystick driver. + */ #define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE" + /** - * \brief A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog. - * - * This variable can be set to the following values: - * "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default) - * "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats - */ + * A variable containing a list of devices and their desired number of haptic + * (force feedback) enabled axis. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form plus the number of desired axes, e.g. + * + * `0xAAAA/0xBBBB/1,0xCCCC/0xDDDD/3` + * + * This hint supports a "wildcard" device that will set the number of haptic + * axes on all initialized haptic devices which were not defined explicitly in + * this hint. + * + * `0xFFFF/0xFFFF/1` + * + * This hint should be set before a controller is opened. The number of haptic + * axes won't exceed the number of real axes found on the device. + */ +#define SDL_HINT_JOYSTICK_HAPTIC_AXES "SDL_JOYSTICK_HAPTIC_AXES" + +/** + * A variable controlling whether joysticks on Linux will always treat 'hat' + * axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking + * whether they may be analog. + * + * This variable can be set to the following values: + * + * - "0": Only map hat axis inputs to digital hat outputs if the input axes + * appear to actually be digital (the default) + * - "1": Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as + * digital hats + */ #define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS" /** - * \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values. - * - * This variable can be set to the following values: - * "0" - Return digital hat values based on unfiltered input axis values - * "1" - Return digital hat values with deadzones on the input axes taken into account (the default) - */ + * A variable controlling whether digital hats on Linux will apply deadzones + * to their underlying input axes or use unfiltered values. + * + * This variable can be set to the following values: + * + * - "0": Return digital hat values based on unfiltered input axis values + * - "1": Return digital hat values with deadzones on the input axes taken + * into account (the default) + */ #define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES" /** - * \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux - * - * This variable can be set to the following values: - * "0" - Use /dev/input/event* - * "1" - Use /dev/input/js* - * - * By default the /dev/input/event* interfaces are used - */ + * A variable controlling whether to use the classic /dev/input/js* joystick + * interface or the newer /dev/input/event* joystick interface on Linux + * + * This variable can be set to the following values: + * + * - "0": Use /dev/input/event* + * - "1": Use /dev/input/js* + * + * By default the /dev/input/event* interfaces are used + */ #define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC" /** - * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. - * - * This variable can be set to the following values: - * "0" - Return unfiltered joystick axis values (the default) - * "1" - Return axis values with deadzones taken into account - */ + * A variable controlling whether joysticks on Linux adhere to their + * HID-defined deadzones or return unfiltered values. + * + * This variable can be set to the following values: + * + * - "0": Return unfiltered joystick axis values (the default) + * - "1": Return axis values with deadzones taken into account + */ #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" /** -* \brief When set don't force the SDL app to become a foreground process -* -* This hint only applies to Mac OS X. -* -*/ + * A variable controlling the default SDL log levels. + * + * This variable is a comma separated set of category=level tokens that define + * the default logging levels for SDL applications. + * + * The category can be a numeric category, one of "app", "error", "assert", + * "system", "audio", "video", "render", "input", "test", or `*` for any + * unspecified category. + * + * The level can be a numeric level, one of "verbose", "debug", "info", + * "warn", "error", "critical", or "quiet" to disable that category. + * + * You can omit the category if you want to set the logging level for all + * categories. + * + * If this hint isn't set, the default log levels are equivalent to: + * "app=info,assert=warn,test=verbose,*=error" + */ +#define SDL_HINT_LOGGING "SDL_LOGGING" + +/** + * When set don't force the SDL app to become a foreground process + * + * This hint only applies to Mac OS X. + */ #define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" /** - * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac + * A variable that determines whether ctrl+click should generate a right-click + * event on Mac * - * If present, holding ctrl while left clicking will generate a right click - * event when on Mac. + * If present, holding ctrl while left clicking will generate a right click + * event when on Mac. */ #define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" /** - * \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing + * A variable controlling whether dispatching OpenGL context updates should + * block the dispatching thread until the main thread finishes processing * - * This variable can be set to the following values: - * "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default). - * "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution. + * This variable can be set to the following values: * - * Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread - * hangs because it's waiting for that background thread, but that background thread is also hanging because it's - * waiting for the main thread to do an update, this might fix your issue. + * - "0": Dispatching OpenGL context updates will block the dispatching thread + * until the main thread finishes processing (default). + * - "1": Dispatching OpenGL context updates will allow the dispatching thread + * to continue execution. * - * This hint only applies to macOS. + * Generally you want the default, but if you have OpenGL code in a background + * thread on a Mac, and the main thread hangs because it's waiting for that + * background thread, but that background thread is also hanging because it's + * waiting for the main thread to do an update, this might fix your issue. * - * This hint is available since SDL 2.24.0. + * This hint only applies to macOS. * + * This hint is available since SDL 2.24.0. */ #define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH" /** - * \brief A variable setting the double click radius, in pixels. + * A variable setting the double click radius, in pixels. */ #define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" /** - * \brief A variable setting the double click time, in milliseconds. + * A variable setting the double click time, in milliseconds. */ #define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" /** - * \brief Allow mouse click events when clicking to focus an SDL window + * Allow mouse click events when clicking to focus an SDL window + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Ignore mouse clicks that activate a window - * "1" - Generate events for mouse clicks that activate a window + * - "0": Ignore mouse clicks that activate a window + * - "1": Generate events for mouse clicks that activate a window * - * By default SDL will ignore mouse clicks that activate a window + * By default SDL will ignore mouse clicks that activate a window */ #define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" /** - * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode + * A variable setting the speed scale for mouse motion, in floating point, + * when the mouse is not in relative mode */ #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" /** - * \brief A variable controlling whether relative mouse mode constrains the mouse to the center of the window + * A variable controlling whether relative mouse mode constrains the mouse to + * the center of the window + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Relative mouse mode constrains the mouse to the window - * "1" - Relative mouse mode constrains the mouse to the center of the window + * - "0": Relative mouse mode constrains the mouse to the window + * - "1": Relative mouse mode constrains the mouse to the center of the window * - * Constraining to the center of the window works better for FPS games and when the - * application is running over RDP. Constraining to the whole window works better - * for 2D games and increases the chance that the mouse will be in the correct - * position when using high DPI mice. + * Constraining to the center of the window works better for FPS games and + * when the application is running over RDP. Constraining to the whole window + * works better for 2D games and increases the chance that the mouse will be + * in the correct position when using high DPI mice. * - * By default SDL will constrain the mouse to the center of the window + * By default SDL will constrain the mouse to the center of the window */ #define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" /** - * \brief A variable controlling whether relative mouse mode is implemented using mouse warping + * A variable controlling whether relative mouse mode is implemented using + * mouse warping + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Relative mouse mode uses raw input - * "1" - Relative mouse mode uses mouse warping + * - "0": Relative mouse mode uses raw input + * - "1": Relative mouse mode uses mouse warping * - * By default SDL will use raw input for relative mouse mode + * By default SDL will use raw input for relative mouse mode */ #define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" /** - * \brief A variable controlling whether relative mouse motion is affected by renderer scaling + * A variable controlling whether relative mouse motion is affected by + * renderer scaling + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Relative motion is unaffected by DPI or renderer's logical size - * "1" - Relative motion is scaled according to DPI scaling and logical size + * - "0": Relative motion is unaffected by DPI or renderer's logical size + * - "1": Relative motion is scaled according to DPI scaling and logical size * - * By default relative mouse deltas are affected by DPI and renderer scaling + * By default relative mouse deltas are affected by DPI and renderer scaling */ #define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" /** - * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode + * A variable setting the scale for mouse motion, in floating point, when the + * mouse is in relative mode */ #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" /** - * \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion. + * A variable controlling whether the system mouse acceleration curve is used + * for relative mouse motion. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Relative mouse motion will be unscaled (the default) - * "1" - Relative mouse motion will be scaled using the system mouse acceleration curve. + * - "0": Relative mouse motion will be unscaled (the default) + * - "1": Relative mouse motion will be scaled using the system mouse + * acceleration curve. * - * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale. + * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the + * system speed scale. */ #define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" /** - * \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode. + * A variable controlling whether a motion event should be generated for mouse + * warping in relative mode. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Warping the mouse will not generate a motion event in relative mode - * "1" - Warping the mouse will generate a motion event in relative mode + * - "0": Warping the mouse will not generate a motion event in relative mode + * - "1": Warping the mouse will generate a motion event in relative mode * - * By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping. + * By default warping the mouse will not generate motion events in relative + * mode. This avoids the application having to filter out large relative + * motion due to warping. */ #define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" /** - * \brief A variable controlling whether mouse events should generate synthetic touch events + * A variable controlling whether the hardware cursor stays visible when + * relative mode is active. + * + * This variable can be set to the following values: "0" - The cursor will be + * hidden while relative mode is active (default) "1" - The cursor will remain + * visible while relative mode is active + * + * Note that for systems without raw hardware inputs, relative mode is + * implemented using warping, so the hardware cursor will visibly warp between + * frames if this is enabled on those systems. + */ +#define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" + +/** + * A variable controlling whether mouse events should generate synthetic touch + * events + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Mouse events will not generate touch events (default for desktop platforms) - * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) + * - "0": Mouse events will not generate touch events (default for desktop + * platforms) + * - "1": Mouse events will generate touch events (default for mobile + * platforms, such as Android and iOS) */ #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" /** - * \brief A variable controlling whether the mouse is captured while mouse buttons are pressed + * A variable controlling whether the mouse is captured while mouse buttons + * are pressed * - * This variable can be set to the following values: - * "0" - The mouse is not captured while mouse buttons are pressed - * "1" - The mouse is captured while mouse buttons are pressed + * This variable can be set to the following values: + * + * - "0": The mouse is not captured while mouse buttons are pressed + * - "1": The mouse is captured while mouse buttons are pressed * - * By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged - * outside the window, the application continues to receive mouse events until the button is - * released. + * By default the mouse is captured while mouse buttons are pressed so if the + * mouse is dragged outside the window, the application continues to receive + * mouse events until the button is released. */ #define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" /** - * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. + * Tell SDL not to catch the SIGINT or SIGTERM signals. * - * This hint only applies to Unix-like platforms, and should set before - * any calls to SDL_Init() + * This hint only applies to Unix-like platforms, and should set before any + * calls to SDL_Init() * * The variable can be set to the following values: - * "0" - SDL will install a SIGINT and SIGTERM handler, and when it - * catches a signal, convert it into an SDL_QUIT event. - * "1" - SDL will not install a signal handler at all. + * + * - "0": SDL will install a SIGINT and SIGTERM handler, and when it catches a + * signal, convert it into an SDL_QUIT event. + * - "1": SDL will not install a signal handler at all. */ #define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" /** - * \brief A variable controlling what driver to use for OpenGL ES contexts. + * A variable controlling what driver to use for OpenGL ES contexts. * - * On some platforms, currently Windows and X11, OpenGL drivers may support - * creating contexts with an OpenGL ES profile. By default SDL uses these - * profiles, when available, otherwise it attempts to load an OpenGL ES - * library, e.g. that provided by the ANGLE project. This variable controls - * whether SDL follows this default behaviour or will always load an - * OpenGL ES library. + * On some platforms, currently Windows and X11, OpenGL drivers may support + * creating contexts with an OpenGL ES profile. By default SDL uses these + * profiles, when available, otherwise it attempts to load an OpenGL ES + * library, e.g. that provided by the ANGLE project. This variable controls + * whether SDL follows this default behaviour or will always load an OpenGL ES + * library. * - * Circumstances where this is useful include - * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, - * or emulator, e.g. those from ARM, Imagination or Qualcomm. - * - Resolving OpenGL ES function addresses at link time by linking with - * the OpenGL ES library instead of querying them at run time with - * SDL_GL_GetProcAddress(). + * Circumstances where this is useful include - Testing an app with a + * particular OpenGL ES implementation, e.g ANGLE, or emulator, e.g. those + * from ARM, Imagination or Qualcomm. - Resolving OpenGL ES function addresses + * at link time by linking with the OpenGL ES library instead of querying them + * at run time with SDL_GL_GetProcAddress(). * - * Caution: for an application to work with the default behaviour across - * different OpenGL drivers it must query the OpenGL ES function - * addresses at run time using SDL_GL_GetProcAddress(). + * Caution: for an application to work with the default behaviour across + * different OpenGL drivers it must query the OpenGL ES function addresses at + * run time using SDL_GL_GetProcAddress(). * - * This variable is ignored on most platforms because OpenGL ES is native - * or not supported. + * This variable is ignored on most platforms because OpenGL ES is native or + * not supported. * - * This variable can be set to the following values: - * "0" - Use ES profile of OpenGL, if available. (Default when not set.) - * "1" - Load OpenGL ES library using the default library names. + * This variable can be set to the following values: * + * - "0": Use ES profile of OpenGL, if available. (Default when not set.) + * - "1": Load OpenGL ES library using the default library names. */ #define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" /** - * \brief A variable controlling which orientations are allowed on iOS/Android. + * A variable controlling which orientations are allowed on iOS/Android. * - * In some circumstances it is necessary to be able to explicitly control - * which UI orientations are allowed. + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. * - * This variable is a space delimited list of the following values: - * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + * This variable is a space delimited list of the following values: + * + * - "LandscapeLeft" + * - "LandscapeRight" + * - "Portrait" + * - "PortraitUpsideDown" */ #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" /** - * \brief A variable controlling the use of a sentinel event when polling the event queue + * A variable controlling the use of a sentinel event when polling the event + * queue + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable poll sentinels - * "1" - Enable poll sentinels + * - "0": Disable poll sentinels + * - "1": Enable poll sentinels * - * When polling for events, SDL_PumpEvents is used to gather new events from devices. - * If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will - * become stuck until the new events stop. - * This is most noticeable when moving a high frequency mouse. + * When polling for events, SDL_PumpEvents is used to gather new events from + * devices. If a device keeps producing new events between calls to + * SDL_PumpEvents, a poll loop will become stuck until the new events stop. + * This is most noticeable when moving a high frequency mouse. * - * By default, poll sentinels are enabled. + * By default, poll sentinels are enabled. */ #define SDL_HINT_POLL_SENTINEL "SDL_POLL_SENTINEL" /** - * \brief Override for SDL_GetPreferredLocales() + * Override for SDL_GetPreferredLocales() * - * If set, this will be favored over anything the OS might report for the - * user's preferred locales. Changing this hint at runtime will not generate - * a SDL_LOCALECHANGED event (but if you can change the hint, you can push - * your own event, if you want). + * If set, this will be favored over anything the OS might report for the + * user's preferred locales. Changing this hint at runtime will not generate a + * SDL_LOCALECHANGED event (but if you can change the hint, you can push your + * own event, if you want). * - * The format of this hint is a comma-separated list of language and locale, - * combined with an underscore, as is a common format: "en_GB". Locale is - * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" + * The format of this hint is a comma-separated list of language and locale, + * combined with an underscore, as is a common format: "en_GB". Locale is + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" */ #define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" /** - * \brief A variable describing the content orientation on QtWayland-based platforms. + * A variable describing the content orientation on QtWayland-based platforms. + * + * On QtWayland platforms, windows are rotated client-side to allow for custom + * transitions. In order to correctly position overlays (e.g. volume bar) and + * gestures (e.g. events view, close/minimize gestures), the system needs to + * know in which orientation the application is currently drawing its + * contents. * - * On QtWayland platforms, windows are rotated client-side to allow for custom - * transitions. In order to correctly position overlays (e.g. volume bar) and - * gestures (e.g. events view, close/minimize gestures), the system needs to - * know in which orientation the application is currently drawing its contents. + * This does not cause the window to be rotated or resized, the application + * needs to take care of drawing the content in the right orientation (the + * framebuffer is always in portrait mode). * - * This does not cause the window to be rotated or resized, the application - * needs to take care of drawing the content in the right orientation (the - * framebuffer is always in portrait mode). + * This variable can be one of the following values: * - * This variable can be one of the following values: - * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" + * - "primary" (default) + * - "portrait" + * - "landscape" + * - "inverted-portrait" + * - "inverted-landscape" + * + * Since SDL 2.0.22 this variable accepts a comma-separated list of values + * above. */ #define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" /** - * \brief Flags to set on QtWayland windows to integrate with the native window manager. + * Flags to set on QtWayland windows to integrate with the native window + * manager. + * + * On QtWayland platforms, this hint controls the flags to set on the windows. + * For example, on Sailfish OS "OverridesSystemGestures" disables swipe + * gestures. * - * On QtWayland platforms, this hint controls the flags to set on the windows. - * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. + * This variable is a space-separated list of the following values (empty = no + * flags): * - * This variable is a space-separated list of the following values (empty = no flags): - * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" + * - "OverridesSystemGestures" + * - "StaysOnTop" + * - "BypassWindowManager" */ #define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" /** - * \brief A variable controlling whether the 2D render API is compatible or efficient. + * A variable controlling whether the 2D render API is compatible or + * efficient. * - * This variable can be set to the following values: - * - * "0" - Don't use batching to make rendering more efficient. - * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. + * This variable can be set to the following values: * - * Up to SDL 2.0.9, the render API would draw immediately when requested. Now - * it batches up draw requests and sends them all to the GPU only when forced - * to (during SDL_RenderPresent, when changing render targets, by updating a - * texture that the batch needs, etc). This is significantly more efficient, - * but it can cause problems for apps that expect to render on top of the - * render API's output. As such, SDL will disable batching if a specific - * render backend is requested (since this might indicate that the app is - * planning to use the underlying graphics API directly). This hint can - * be used to explicitly request batching in this instance. It is a contract - * that you will either never use the underlying graphics API directly, or - * if you do, you will call SDL_RenderFlush() before you do so any current - * batch goes to the GPU before your work begins. Not following this contract - * will result in undefined behavior. + * - "0": Don't use batching to make rendering more efficient. + * - "1": Use batching, but might cause problems if app makes its own direct + * OpenGL calls. + * + * Up to SDL 2.0.9, the render API would draw immediately when requested. Now + * it batches up draw requests and sends them all to the GPU only when forced + * to (during SDL_RenderPresent, when changing render targets, by updating a + * texture that the batch needs, etc). This is significantly more efficient, + * but it can cause problems for apps that expect to render on top of the + * render API's output. As such, SDL will disable batching if a specific + * render backend is requested (since this might indicate that the app is + * planning to use the underlying graphics API directly). This hint can be + * used to explicitly request batching in this instance. It is a contract that + * you will either never use the underlying graphics API directly, or if you + * do, you will call SDL_RenderFlush() before you do so any current batch goes + * to the GPU before your work begins. Not following this contract will result + * in undefined behavior. */ #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" /** - * \brief A variable controlling how the 2D render API renders lines + * A variable controlling how the 2D render API renders lines * - * This variable can be set to the following values: - * "0" - Use the default line drawing method (Bresenham's line algorithm as of SDL 2.0.20) - * "1" - Use the driver point API using Bresenham's line algorithm (correct, draws many points) - * "2" - Use the driver line API (occasionally misses line endpoints based on hardware driver quirks, was the default before 2.0.20) - * "3" - Use the driver geometry API (correct, draws thicker diagonal lines) + * This variable can be set to the following values: + * + * - "0": Use the default line drawing method (Bresenham's line algorithm as + * of SDL 2.0.20) + * - "1": Use the driver point API using Bresenham's line algorithm (correct, + * draws many points) + * - "2": Use the driver line API (occasionally misses line endpoints based on + * hardware driver quirks, was the default before 2.0.20) + * - "3": Use the driver geometry API (correct, draws thicker diagonal lines) * - * This variable should be set when the renderer is created. + * This variable should be set when the renderer is created. */ #define SDL_HINT_RENDER_LINE_METHOD "SDL_RENDER_LINE_METHOD" /** - * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. + * A variable controlling whether to enable Direct3D 11+'s Debug Layer. * - * This variable does not have any effect on the Direct3D 9 based renderer. + * This variable does not have any effect on the Direct3D 9 based renderer. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable Debug Layer use - * "1" - Enable Debug Layer use + * - "0": Disable Debug Layer use + * - "1": Enable Debug Layer use * - * By default, SDL does not use Direct3D Debug Layer. + * By default, SDL does not use Direct3D Debug Layer. */ #define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" /** - * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. + * A variable controlling whether the Direct3D device is initialized for + * thread-safe operations. * - * This variable can be set to the following values: - * "0" - Thread-safety is not enabled (faster) - * "1" - Thread-safety is enabled + * This variable can be set to the following values: + * + * - "0": Thread-safety is not enabled (faster) + * - "1": Thread-safety is enabled * - * By default the Direct3D device is created with thread-safety disabled. + * By default the Direct3D device is created with thread-safety disabled. */ #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" /** - * \brief A variable specifying which render driver to use. + * A variable specifying which render driver to use. * - * If the application doesn't pick a specific renderer to use, this variable - * specifies the name of the preferred renderer. If the preferred renderer - * can't be initialized, the normal default renderer is used. + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. * - * This variable is case insensitive and can be set to the following values: - * "direct3d" - * "direct3d11" - * "direct3d12" - * "opengl" - * "opengles2" - * "opengles" - * "metal" - * "software" + * This variable is case insensitive and can be set to the following values: * - * The default varies by platform, but it's the first one in the list that - * is available on the current platform. + * - "direct3d" + * - "direct3d11" + * - "direct3d12" + * - "opengl" + * - "opengles2" + * - "opengles" + * - "metal" + * - "software" + * + * The default varies by platform, but it's the first one in the list that is + * available on the current platform. */ #define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" /** - * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. + * A variable controlling the scaling policy for SDL_RenderSetLogicalSize. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen - * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen + * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on + * screen "1" or "overscan" - Will zoom the rendering so it fills the entire + * screen, allowing edges to be drawn offscreen * - * By default letterbox is used + * By default letterbox is used */ #define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" /** - * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * A variable controlling whether the OpenGL render driver uses shaders if + * they are available. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable shaders - * "1" - Enable shaders + * - "0": Disable shaders + * - "1": Enable shaders * - * By default shaders are used if OpenGL supports them. + * By default shaders are used if OpenGL supports them. */ #define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" /** - * \brief A variable controlling the scaling quality + * A variable controlling the scaling quality + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" or "nearest" - Nearest pixel sampling - * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) - * "2" or "best" - Currently this is the same as "linear" + * - "0" or "nearest": Nearest pixel sampling + * - "1" or "linear": Linear filtering (supported by OpenGL and Direct3D) + * - "2" or "best": Currently this is the same as "linear" * - * By default nearest pixel sampling is used + * By default nearest pixel sampling is used */ #define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" /** - * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * A variable controlling whether updates to the SDL screen surface should be + * synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable vsync - * "1" - Enable vsync + * - "0": Disable vsync + * - "1": Enable vsync * - * By default SDL does not sync screen surface updates with vertical refresh. + * By default SDL does not sync screen surface updates with vertical refresh. */ #define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" /** - * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS + * A variable controlling whether the Metal render driver select low power + * device over default one + * + * This variable can be set to the following values: + * + * - "0": Use the prefered OS device + * - "1": Select a low power one + * + * By default the prefered OS device is used. + */ +#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE" + +/** + * A variable containing a list of ROG gamepad capable mice. + * + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE" + +/** + * A variable containing a list of devices that are not ROG gamepad capable + * mice. * - * This variable can be set to the following values: - * "0" - It will be using VSYNC as defined in the main flag. Default - * "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed + * This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list. * - * By default SDL does not enable the automatic VSYNC + * The format of the string is a comma separated list of USB VID/PID pairs in + * hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named file + * will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED" + +/** + * Variable controlling the width of the PS2's framebuffer in pixels + * + * By default, this variable is "640" + */ +#define SDL_HINT_PS2_GS_WIDTH "SDL_PS2_GS_WIDTH" + +/** + * Variable controlling the height of the PS2's framebuffer in pixels + * + * By default, this variable is "448" + */ +#define SDL_HINT_PS2_GS_HEIGHT "SDL_PS2_GS_HEIGHT" + +/** + * Variable controlling whether the signal is interlaced or progressive + * + * - "0": Image is interlaced. (default) + * - "1": Image is progressive + */ +#define SDL_HINT_PS2_GS_PROGRESSIVE "SDL_PS2_GS_PROGRESSIVE" + +/** + * Variable controlling the video mode of the console + * + * - "": Console-native. (default) + * - "NTSC": 60hz region + * - "PAL": 50hz region + */ +#define SDL_HINT_PS2_GS_MODE "SDL_PS2_GS_MODE" + +/** + * A variable controlling if VSYNC is automatically disable if doesn't reach + * the enough FPS + * + * This variable can be set to the following values: + * + * - "0": It will be using VSYNC as defined in the main flag. Default + * - "1": If VSYNC was previously enabled, then it will disable VSYNC if + * doesn't reach enough speed + * + * By default SDL does not enable the automatic VSYNC */ #define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC" /** - * \brief A variable to control whether the return key on the soft keyboard - * should hide the soft keyboard on Android and iOS. + * A variable to control whether the return key on the soft keyboard should + * hide the soft keyboard on Android and iOS. * * The variable can be set to the following values: - * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) - * "1" - The return key will hide the keyboard. * - * The value of this hint is used at runtime, so it can be changed at any time. + * - "0": The return key will be handled as a key event. This is the behaviour + * of SDL <= 2.0.3. (default) + * - "1": The return key will hide the keyboard. + * + * The value of this hint is used at runtime, so it can be changed at any + * time. */ #define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" /** - * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI + * Tell SDL which Dispmanx layer to use on a Raspberry PI * * Also known as Z-order. The variable can take a negative or positive value. * The default is 10000. @@ -1484,7 +2093,7 @@ extern "C" { #define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" /** - * \brief Specify an "activity name" for screensaver inhibition. + * Specify an "activity name" for screensaver inhibition. * * Some platforms, notably Linux desktops, list the applications which are * inhibiting the screensaver or other power-saving features. @@ -1493,9 +2102,9 @@ extern "C" { * SDL_DisableScreenSaver() is used (or the screensaver is automatically * disabled). The contents of this hint are used when the screensaver is * disabled. You should use a string that describes what your program is doing - * (and, therefore, why the screensaver is disabled). For example, "Playing a + * (and, therefore, why the screensaver is disabled). For example, "Playing a * game" or "Watching a video". - * + * * Setting this to "" or leaving it unset will have SDL use a reasonable * default: "Playing a game" or something similar. * @@ -1504,606 +2113,715 @@ extern "C" { #define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME" /** - * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. + * Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as + * realtime. + * + * On some platforms, like Linux, a realtime priority thread may be subject to + * restrictions that require special handling by the application. This hint + * exists to let SDL know that the app is prepared to handle said + * restrictions. * - * On some platforms, like Linux, a realtime priority thread may be subject to restrictions - * that require special handling by the application. This hint exists to let SDL know that - * the app is prepared to handle said restrictions. - * - * On Linux, SDL will apply the following configuration to any thread that becomes realtime: - * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, - * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. - * * Exceeding this limit will result in the kernel sending SIGKILL to the app, - * * Refer to the man pages for more information. - * - * This variable can be set to the following values: - * "0" - default platform specific behaviour - * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy + * On Linux, SDL will apply the following configuration to any thread that + * becomes realtime: + * + * - The SCHED_RESET_ON_FORK bit will be set on the scheduling policy. + * - An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. + * - Exceeding this limit will result in the kernel sending SIGKILL to the + * app. + * + * Refer to the man pages for more information. + * + * This variable can be set to the following values: + * + * - "0": default platform specific behaviour + * - "1": Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling + * policy */ #define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" /** -* \brief A string specifying additional information to use with SDL_SetThreadPriority. -* -* By default SDL_SetThreadPriority will make appropriate system changes in order to -* apply a thread priority. For example on systems using pthreads the scheduler policy -* is changed automatically to a policy that works well with a given priority. -* Code which has specific requirements can override SDL's default behavior with this hint. -* -* pthread hint values are "current", "other", "fifo" and "rr". -* Currently no other platform hint values are defined but may be in the future. -* -* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro -* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME -* after calling SDL_SetThreadPriority(). -*/ + * A string specifying additional information to use with + * SDL_SetThreadPriority. + * + * By default SDL_SetThreadPriority will make appropriate system changes in + * order to apply a thread priority. For example on systems using pthreads the + * scheduler policy is changed automatically to a policy that works well with + * a given priority. Code which has specific requirements can override SDL's + * default behavior with this hint. + * + * pthread hint values are "current", "other", "fifo" and "rr". Currently no + * other platform hint values are defined but may be in the future. + */ #define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" /** -* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size -* -* Use this hint in case you need to set SDL's threads stack size to other than the default. -* This is specially useful if you build SDL against a non glibc libc library (such as musl) which -* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). -* Support for this hint is currently available only in the pthread, Windows, and PSP backend. -* -* Instead of this hint, in 2.0.9 and later, you can use -* SDL_CreateThreadWithStackSize(). This hint only works with the classic -* SDL_CreateThread(). -*/ + * A string specifying SDL's threads stack size in bytes or "0" for the + * backend's default size + * + * Use this hint in case you need to set SDL's threads stack size to other + * than the default. This is specially useful if you build SDL against a non + * glibc libc library (such as musl) which provides a relatively small default + * thread stack size (a few kilobytes versus the default 8MB glibc uses). + * Support for this hint is currently available only in the pthread, Windows, + * and PSP backend. + * + * Instead of this hint, in 2.0.9 and later, you can use + * SDL_CreateThreadWithStackSize(). This hint only works with the classic + * SDL_CreateThread(). + */ #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" /** - * \brief A variable that controls the timer resolution, in milliseconds. + * A variable that controls the timer resolution, in milliseconds. * - * The higher resolution the timer, the more frequently the CPU services - * timer interrupts, and the more precise delays are, but this takes up - * power and CPU time. This hint is only used on Windows. + * The higher resolution the timer, the more frequently the CPU services timer + * interrupts, and the more precise delays are, but this takes up power and + * CPU time. This hint is only used on Windows. * - * See this blog post for more information: - * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ * - * If this variable is set to "0", the system timer resolution is not set. + * If this variable is set to "0", the system timer resolution is not set. * - * The default value is "1". This hint may be set at any time. + * The default value is "1". This hint may be set at any time. */ #define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" /** - * \brief A variable controlling whether touch events should generate synthetic mouse events + * A variable controlling whether touch events should generate synthetic mouse + * events + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Touch events will not generate mouse events - * "1" - Touch events will generate mouse events + * - "0": Touch events will not generate mouse events + * - "1": Touch events will generate mouse events * - * By default SDL will generate mouse events for touch events + * By default SDL will generate mouse events for touch events */ #define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" /** - * \brief A variable controlling which touchpad should generate synthetic mouse events + * A variable controlling which touchpad should generate synthetic mouse + * events + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Only front touchpad should generate mouse events. Default - * "1" - Only back touchpad should generate mouse events. - * "2" - Both touchpads should generate mouse events. + * - "0": Only front touchpad should generate mouse events. Default + * - "1": Only back touchpad should generate mouse events. + * - "2": Both touchpads should generate mouse events. * - * By default SDL will generate mouse events for all touch devices + * By default SDL will generate mouse events for all touch devices */ #define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE" /** - * \brief A variable controlling whether the Android / tvOS remotes - * should be listed as joystick devices, instead of sending keyboard events. + * A variable controlling whether the Android / tvOS remotes should be listed + * as joystick devices, instead of sending keyboard events. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Remotes send enter/escape/arrow key events - * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). + * - "0": Remotes send enter/escape/arrow key events + * - "1": Remotes are available as 2 axis, 2 button joysticks (the default). */ #define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" /** - * \brief A variable controlling whether the screensaver is enabled. + * A variable controlling whether the screensaver is enabled. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable screensaver - * "1" - Enable screensaver + * - "0": Disable screensaver + * - "1": Enable screensaver * - * By default SDL will disable the screensaver. + * By default SDL will disable the screensaver. */ #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" /** - * \brief Tell the video driver that we only want a double buffer. + * Tell the video driver that we only want a double buffer. * - * By default, most lowlevel 2D APIs will use a triple buffer scheme that + * By default, most lowlevel 2D APIs will use a triple buffer scheme that * wastes no CPU time on waiting for vsync after issuing a flip, but * introduces a frame of latency. On the other hand, using a double buffer * scheme instead is recommended for cases where low latency is an important - * factor because we save a whole frame of latency. - * We do so by waiting for vsync immediately after issuing a flip, usually just - * after eglSwapBuffers call in the backend's *_SwapWindow function. + * factor because we save a whole frame of latency. We do so by waiting for + * vsync immediately after issuing a flip, usually just after eglSwapBuffers + * call in the backend's *_SwapWindow function. * * Since it's driver-specific, it's only supported where possible and * implemented. Currently supported the following drivers: * + * - Wayland (wayland) * - KMSDRM (kmsdrm) * - Raspberry Pi (raspberrypi) */ #define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" /** - * \brief A variable controlling whether the EGL window is allowed to be - * composited as transparent, rather than opaque. + * A variable controlling whether the EGL window is allowed to be composited + * as transparent, rather than opaque. * * Most window systems will always render windows opaque, even if the surface - * format has an alpha channel. This is not always true, however, so by default - * SDL will try to enforce opaque composition. To override this behavior, you - * can set this hint to "1". + * format has an alpha channel. This is not always true, however, so by + * default SDL will try to enforce opaque composition. To override this + * behavior, you can set this hint to "1". */ #define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY" /** - * \brief A variable controlling whether the graphics context is externally managed. + * A variable controlling whether the graphics context is externally managed. * * This variable can be set to the following values: - * "0" - SDL will manage graphics contexts that are attached to windows. - * "1" - Disable graphics context management on windows. * - * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the - * context will be automatically saved and restored when pausing the application. Additionally, some - * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this - * behavior, which is desireable when the application manages the graphics context, such as - * an externally managed OpenGL context or attaching a Vulkan surface to the window. + * - "0": SDL will manage graphics contexts that are attached to windows. + * - "1": Disable graphics context management on windows. + * + * By default SDL will manage OpenGL contexts in certain situations. For + * example, on Android the context will be automatically saved and restored + * when pausing the application. Additionally, some platforms will assume + * usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this + * behavior, which is desireable when the application manages the graphics + * context, such as an externally managed OpenGL context or attaching a Vulkan + * surface to the window. */ #define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" /** - * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) + * If set to 1, then do not allow high-DPI windows. + * + * ("Retina" on Mac and iOS) */ #define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" /** - * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. + * A variable that dictates policy for fullscreen Spaces on Mac OS X. + * + * This hint only applies to Mac OS X. * - * This hint only applies to Mac OS X. + * The variable can be set to the following values: * - * The variable can be set to the following values: - * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and - * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" - * button on their titlebars). - * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and - * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" - * button on their titlebars). + * - "0": Disable Spaces support (FULLSCREEN_DESKTOP won't use them and + * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" button on their + * titlebars). + * - "1": Enable Spaces support (FULLSCREEN_DESKTOP will use them and + * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" button on their + * titlebars). * - * The default value is "1". This hint must be set before any windows are created. + * The default value is "1". This hint must be set before any windows are + * created. */ #define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" /** - * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. - * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're - * seeing if "true" causes more problems than it solves in modern times. + * Minimize your SDL_Window if it loses key focus when in fullscreen mode. * + * Defaults to false. */ #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" /** - * \brief A variable controlling whether the libdecor Wayland backend is allowed to be used. + * A variable controlling whether the libdecor Wayland backend is allowed to + * be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - libdecor use is disabled. - * "1" - libdecor use is enabled (default). + * - "0": libdecor use is disabled. + * - "1": libdecor use is enabled (default). * - * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. + * libdecor is used over xdg-shell when xdg-decoration protocol is + * unavailable. */ #define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR" /** - * \brief A variable controlling whether the libdecor Wayland backend is preferred over native decrations. + * A variable controlling whether the libdecor Wayland backend is preferred + * over native decorations. + * + * When this hint is set, libdecor will be used to provide window decorations, + * even if xdg-decoration is available. (Note that, by default, libdecor will + * use xdg-decoration itself if available). * - * When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is - * available. (Note that, by default, libdecor will use xdg-decoration itself if available). + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - libdecor is enabled only if server-side decorations are unavailable. - * "1" - libdecor is always enabled if available. + * - "0": libdecor is enabled only if server-side decorations are unavailable. + * - "1": libdecor is always enabled if available. * - * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. + * libdecor is used over xdg-shell when xdg-decoration protocol is + * unavailable. */ #define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR" /** - * \brief A variable controlling whether video mode emulation is enabled under Wayland. + * A variable controlling whether video mode emulation is enabled under + * Wayland. + * + * When this hint is set, a standard set of emulated CVT video modes will be + * exposed for use by the application. If it is disabled, the only modes + * exposed will be the logical desktop size and, in the case of a scaled + * desktop, the native display resolution. * - * When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application. - * If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled - * desktop, the native display resolution. + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Video mode emulation is disabled. - * "1" - Video mode emulation is enabled. + * - "0": Video mode emulation is disabled. + * - "1": Video mode emulation is enabled. * - * By default video mode emulation is enabled. + * By default video mode emulation is enabled. */ #define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION" /** - * \brief Enable or disable mouse pointer warp emulation, needed by some older games. + * Enable or disable mouse pointer warp emulation, needed by some older games. + * + * When this hint is set, any SDL will emulate mouse warps using relative + * mouse mode. This is required for some older games (such as Source engine + * games), which warp the mouse to the centre of the screen rather than using + * relative mouse motion. Note that relative mouse mode may have different + * mouse acceleration behaviour than pointer warps. * - * When this hint is set, any SDL will emulate mouse warps using relative mouse mode. - * This is required for some older games (such as Source engine games), which warp the - * mouse to the centre of the screen rather than using relative mouse motion. Note that - * relative mouse mode may have different mouse acceleration behaviour than pointer warps. + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - All mouse warps fail, as mouse warping is not available under wayland. - * "1" - Some mouse warps will be emulated by forcing relative mouse mode. + * - "0": All mouse warps fail, as mouse warping is not available under + * wayland. + * - "1": Some mouse warps will be emulated by forcing relative mouse mode. * - * If not set, this is automatically enabled unless an application uses relative mouse - * mode directly. + * If not set, this is automatically enabled unless an application uses + * relative mouse mode directly. */ #define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP" /** -* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). -* -* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has -* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly -* created SDL_Window: -* -* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is -* needed for example when sharing an OpenGL context across multiple windows. -* -* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for -* OpenGL rendering. -* -* This variable can be set to the following values: -* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should -* share a pixel format with. -*/ + * A variable that is the address of another SDL_Window* (as a hex string + * formatted with "%p"). + * + * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is + * set to has SDL_WINDOW_OPENGL set (and running on WGL only, currently), then + * two things will occur on the newly created SDL_Window: + * + * 1. Its pixel format will be set to the same pixel format as this + * SDL_Window. This is needed for example when sharing an OpenGL context + * across multiple windows. + * + * 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be + * used for OpenGL rendering. + * + * This variable can be set to the following values: The address (as a string + * "%p") of the SDL_Window* that new windows created with + * SDL_CreateWindowFrom() should share a pixel format with. + */ #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" /** - * \brief When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL. + * When calling SDL_CreateWindowFrom(), make the window compatible with + * OpenGL. * * This variable can be set to the following values: - * "0" - Don't add any graphics flags to the SDL_WindowFlags - * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags + * + * - "0": Don't add any graphics flags to the SDL_WindowFlags + * - "1": Add SDL_WINDOW_OPENGL to the SDL_WindowFlags * * By default SDL will not make the foreign window compatible with OpenGL. */ #define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL" /** - * \brief When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan. + * When calling SDL_CreateWindowFrom(), make the window compatible with + * Vulkan. * * This variable can be set to the following values: - * "0" - Don't add any graphics flags to the SDL_WindowFlags - * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags + * + * - "0": Don't add any graphics flags to the SDL_WindowFlags + * - "1": Add SDL_WINDOW_VULKAN to the SDL_WindowFlags * * By default SDL will not make the foreign window compatible with Vulkan. */ #define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN" /** -* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries -* -* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It -* can use two different sets of binaries, those compiled by the user from source -* or those provided by the Chrome browser. In the later case, these binaries require -* that SDL loads a DLL providing the shader compiler. -* -* This variable can be set to the following values: -* "d3dcompiler_46.dll" - default, best for Vista or later. -* "d3dcompiler_43.dll" - for XP support. -* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. -* -*/ + * A variable specifying which shader compiler to preload when using the + * Chrome ANGLE binaries + * + * SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It can + * use two different sets of binaries, those compiled by the user from source + * or those provided by the Chrome browser. In the later case, these binaries + * require that SDL loads a DLL providing the shader compiler. + * + * This variable can be set to the following values: + * + * - "d3dcompiler_46.dll: default, best for Vista or later. + * - "d3dcompiler_43.dll: for XP support. + * - "none": do not load any library, useful if you compiled ANGLE from source + * and included the compiler in your binaries. + */ #define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" /** - * \brief A variable controlling whether X11 should use GLX or EGL by default + * A variable controlling whether X11 should use GLX or EGL by default * * This variable can be set to the following values: - * "0" - Use GLX - * "1" - Use EGL + * + * - "0": Use GLX + * - "1": Use EGL * * By default SDL will use GLX when both are present. */ #define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" /** - * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. - * + * A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint + * should be used. + * * This variable can be set to the following values: - * "0" - Disable _NET_WM_BYPASS_COMPOSITOR - * "1" - Enable _NET_WM_BYPASS_COMPOSITOR - * + * + * - "0": Disable _NET_WM_BYPASS_COMPOSITOR + * - "1": Enable _NET_WM_BYPASS_COMPOSITOR + * * By default SDL will use _NET_WM_BYPASS_COMPOSITOR - * */ #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" /** - * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. + * A variable controlling whether the X11 _NET_WM_PING protocol should be + * supported. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable _NET_WM_PING - * "1" - Enable _NET_WM_PING + * - "0": Disable _NET_WM_PING + * - "1": Enable _NET_WM_PING * - * By default SDL will use _NET_WM_PING, but for applications that know they - * will not always be able to respond to ping requests in a timely manner they can - * turn it off to avoid the window manager thinking the app is hung. - * The hint is checked in CreateWindow. + * By default SDL will use _NET_WM_PING, but for applications that know they + * will not always be able to respond to ping requests in a timely manner they + * can turn it off to avoid the window manager thinking the app is hung. The + * hint is checked in CreateWindow. */ #define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" /** - * \brief A variable forcing the visual ID chosen for new X11 windows - * + * A variable forcing the visual ID chosen for new X11 windows */ #define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" /** - * \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used. + * A no-longer-used variable controlling whether the X11 Xinerama extension + * should be used. * - * Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11. - * Now SDL never uses Xinerama, and does not check for this hint at all. - * The preprocessor define is left here for source compatibility. + * Before SDL 2.0.24, this would let apps and users disable Xinerama support + * on X11. Now SDL never uses Xinerama, and does not check for this hint at + * all. The preprocessor define is left here for source compatibility. */ #define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" /** - * \brief A variable controlling whether the X11 XRandR extension should be used. + * A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - Disable XRandR - * "1" - Enable XRandR + * - "0": Disable XRandR + * - "1": Enable XRandR * - * By default SDL will use XRandR. + * By default SDL will use XRandR. */ #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" /** - * \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used. + * A no-longer-used variable controlling whether the X11 VidMode extension + * should be used. * - * Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11. - * Now SDL never uses XVidMode, and does not check for this hint at all. - * The preprocessor define is left here for source compatibility. + * Before SDL 2.0.24, this would let apps and users disable XVidMode support + * on X11. Now SDL never uses XVidMode, and does not check for this hint at + * all. The preprocessor define is left here for source compatibility. */ #define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" /** - * \brief Controls how the fact chunk affects the loading of a WAVE file. + * Controls how the fact chunk affects the loading of a WAVE file. * - * The fact chunk stores information about the number of samples of a WAVE - * file. The Standards Update from Microsoft notes that this value can be used - * to 'determine the length of the data in seconds'. This is especially useful - * for compressed formats (for which this is a mandatory chunk) if they produce - * multiple sample frames per block and truncating the block is not allowed. - * The fact chunk can exactly specify how many sample frames there should be - * in this case. + * The fact chunk stores information about the number of samples of a WAVE + * file. The Standards Update from Microsoft notes that this value can be used + * to 'determine the length of the data in seconds'. This is especially useful + * for compressed formats (for which this is a mandatory chunk) if they + * produce multiple sample frames per block and truncating the block is not + * allowed. The fact chunk can exactly specify how many sample frames there + * should be in this case. * - * Unfortunately, most application seem to ignore the fact chunk and so SDL - * ignores it by default as well. + * Unfortunately, most application seem to ignore the fact chunk and so SDL + * ignores it by default as well. * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "truncate" - Use the number of samples to truncate the wave data if - * the fact chunk is present and valid - * "strict" - Like "truncate", but raise an error if the fact chunk - * is invalid, not present for non-PCM formats, or if the - * data chunk doesn't have that many samples - * "ignorezero" - Like "truncate", but ignore fact chunk if the number of - * samples is zero - * "ignore" - Ignore fact chunk entirely (default) + * - "truncate": Use the number of samples to truncate the wave data if the + * fact chunk is present and valid + * - "strict": Like "truncate", but raise an error if the fact chunk is + * invalid, not present for non-PCM formats, or if the data chunk doesn't + * have that many samples + * - "ignorezero": Like "truncate", but ignore fact chunk if the number of + * samples is zero + * - "ignore": Ignore fact chunk entirely (default) */ #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" /** - * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. + * Controls how the size of the RIFF chunk affects the loading of a WAVE file. * - * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE - * file) is not always reliable. In case the size is wrong, it's possible to - * just ignore it and step through the chunks until a fixed limit is reached. + * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE + * file) is not always reliable. In case the size is wrong, it's possible to + * just ignore it and step through the chunks until a fixed limit is reached. * - * Note that files that have trailing data unrelated to the WAVE file or - * corrupt files may slow down the loading process without a reliable boundary. - * By default, SDL stops after 10000 chunks to prevent wasting time. Use the - * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * Note that files that have trailing data unrelated to the WAVE file or + * corrupt files may slow down the loading process without a reliable + * boundary. By default, SDL stops after 10000 chunks to prevent wasting time. + * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "force" - Always use the RIFF chunk size as a boundary for the chunk search - * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) - * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB - * "maximum" - Search for chunks until the end of file (not recommended) + * - "force": Always use the RIFF chunk size as a boundary for the chunk + * search + * - "ignorezero": Like "force", but a zero size searches up to 4 GiB + * (default) + * - "ignore": Ignore the RIFF chunk size and always search up to 4 GiB + * - "maximum": Search for chunks until the end of file (not recommended) */ #define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" /** - * \brief Controls how a truncated WAVE file is handled. + * Controls how a truncated WAVE file is handled. * - * A WAVE file is considered truncated if any of the chunks are incomplete or - * the data chunk size is not a multiple of the block size. By default, SDL - * decodes until the first incomplete block, as most applications seem to do. + * A WAVE file is considered truncated if any of the chunks are incomplete or + * the data chunk size is not a multiple of the block size. By default, SDL + * decodes until the first incomplete block, as most applications seem to do. * - * This variable can be set to the following values: + * This variable can be set to the following values: * - * "verystrict" - Raise an error if the file is truncated - * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored - * "dropframe" - Decode until the first incomplete sample frame - * "dropblock" - Decode until the first incomplete block (default) + * - "verystrict": Raise an error if the file is truncated + * - "strict": Like "verystrict", but the size of the RIFF chunk is ignored + * - "dropframe": Decode until the first incomplete sample frame + * - "dropblock": Decode until the first incomplete block (default) */ #define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" /** - * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. - * The 0x406D1388 Exception is a trick used to inform Visual Studio of a - * thread's name, but it tends to cause problems with other debuggers, - * and the .NET runtime. Note that SDL 2.0.6 and later will still use - * the (safer) SetThreadDescription API, introduced in the Windows 10 - * Creators Update, if available. + * Tell SDL not to name threads on Windows with the 0x406D1388 Exception. + * + * The 0x406D1388 Exception is a trick used to inform Visual Studio of a + * thread's name, but it tends to cause problems with other debuggers, and the + * .NET runtime. Note that SDL 2.0.6 and later will still use the (safer) + * SetThreadDescription API, introduced in the Windows 10 Creators Update, if + * available. * * The variable can be set to the following values: - * "0" - SDL will raise the 0x406D1388 Exception to name threads. - * This is the default behavior of SDL <= 2.0.4. - * "1" - SDL will not raise this exception, and threads will be unnamed. (default) - * This is necessary with .NET languages or debuggers that aren't Visual Studio. + * + * - "0": SDL will raise the 0x406D1388 Exception to name threads. This is the + * default behavior of SDL <= 2.0.4. + * - "1": SDL will not raise this exception, and threads will be unnamed. + * (default) This is necessary with .NET languages or debuggers that aren't + * Visual Studio. */ #define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" /** - * \brief A variable controlling whether the windows message loop is processed by SDL + * Controls whether menus can be opened with their keyboard shortcut + * (Alt+mnemonic). + * + * If the mnemonics are enabled, then menus can be opened by pressing the Alt + * key and the corresponding mnemonic (for example, Alt+F opens the File + * menu). However, in case an invalid mnemonic is pressed, Windows makes an + * audible beep to convey that nothing happened. This is true even if the + * window has no menu at all! + * + * Because most SDL applications don't have menus, and some want to use the + * Alt key for other purposes, SDL disables mnemonics (and the beeping) by + * default. + * + * Note: This also affects keyboard events: with mnemonics enabled, when a + * menu is opened from the keyboard, you will not receive a KEYUP event for + * the mnemonic key, and *might* not receive one for Alt. * - * This variable can be set to the following values: - * "0" - The window message loop is not run - * "1" - The window message loop is processed in SDL_PumpEvents() + * This variable can be set to the following values: * - * By default SDL will process the windows message loop + * - "0": Alt+mnemonic does nothing, no beeping. (default) + * - "1": Alt+mnemonic opens menus, invalid mnemonics produce a beep. + */ +#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS" + +/** + * A variable controlling whether the windows message loop is processed by SDL + * + * This variable can be set to the following values: + * + * - "0": The window message loop is not run + * - "1": The window message loop is processed in SDL_PumpEvents() + * + * By default SDL will process the windows message loop */ #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" /** - * \brief Force SDL to use Critical Sections for mutexes on Windows. - * On Windows 7 and newer, Slim Reader/Writer Locks are available. - * They offer better performance, allocate no kernel ressources and - * use less memory. SDL will fall back to Critical Sections on older - * OS versions or if forced to by this hint. + * Force SDL to use Critical Sections for mutexes on Windows. * - * This variable can be set to the following values: - * "0" - Use SRW Locks when available. If not, fall back to Critical Sections. (default) - * "1" - Force the use of Critical Sections in all cases. + * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer + * better performance, allocate no kernel resources and use less memory. SDL + * will fall back to Critical Sections on older OS versions or if forced to by + * this hint. * + * This variable can be set to the following values: + * + * - "0": Use SRW Locks when available. If not, fall back to Critical + * Sections. (default) + * - "1": Force the use of Critical Sections in all cases. */ #define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" /** - * \brief Force SDL to use Kernel Semaphores on Windows. - * Kernel Semaphores are inter-process and require a context - * switch on every interaction. On Windows 8 and newer, the - * WaitOnAddress API is available. Using that and atomics to - * implement semaphores increases performance. - * SDL will fall back to Kernel Objects on older OS versions - * or if forced to by this hint. + * Force SDL to use Kernel Semaphores on Windows. * - * This variable can be set to the following values: - * "0" - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default) - * "1" - Force the use of Kernel Objects in all cases. + * Kernel Semaphores are inter-process and require a context switch on every + * interaction. On Windows 8 and newer, the WaitOnAddress API is available. + * Using that and atomics to implement semaphores increases performance. SDL + * will fall back to Kernel Objects on older OS versions or if forced to by + * this hint. + * + * This variable can be set to the following values: * + * - "0": Use Atomics and WaitOnAddress API when available. If not, fall back + * to Kernel Objects. (default) + * - "1": Force the use of Kernel Objects in all cases. */ #define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL" /** - * \brief A variable to specify custom icon resource id from RC file on Windows platform + * A variable to specify custom icon resource id from RC file on Windows + * platform */ #define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" + +/** + * A variable to specify custom icon resource id from RC file on Windows + * platform + */ #define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" /** - * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. + * Tell SDL not to generate window-close events for Alt+F4 on Windows. * * The variable can be set to the following values: - * "0" - SDL will generate a window-close event when it sees Alt+F4. - * "1" - SDL will only do normal key handling for Alt+F4. + * + * - "0": SDL will generate a window-close event when it sees Alt+F4. + * - "1": SDL will only do normal key handling for Alt+F4. */ #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" /** - * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9. - * Direct3D 9Ex contains changes to state management that can eliminate device - * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require - * some changes to your application to cope with the new behavior, so this - * is disabled by default. + * Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9. * - * This hint must be set before initializing the video subsystem. + * Direct3D 9Ex contains changes to state management that can eliminate device + * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may + * require some changes to your application to cope with the new behavior, so + * this is disabled by default. * - * For more information on Direct3D 9Ex, see: - * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex - * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements + * This hint must be set before initializing the video subsystem. + * + * For more information on Direct3D 9Ex, see: - + * https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex + * - + * https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements * - * This variable can be set to the following values: - * "0" - Use the original Direct3D 9 API (default) - * "1" - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable) + * This variable can be set to the following values: * + * - "0": Use the original Direct3D 9 API (default) + * - "1": Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex + * is unavailable) */ #define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX" /** - * \brief Controls whether SDL will declare the process to be DPI aware. - * - * This hint must be set before initializing the video subsystem. - * - * The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with - * a DPI scale factor. - * - * This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext) - * and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel - * even on high-DPI displays. - * - * For more information, see: - * https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows - * - * This variable can be set to the following values: - * "" - Do not change the DPI awareness (default). - * "unaware" - Declare the process as DPI unaware. (Windows 8.1 and later). - * "system" - Request system DPI awareness. (Vista and later). - * "permonitor" - Request per-monitor DPI awareness. (Windows 8.1 and later). - * "permonitorv2" - Request per-monitor V2 DPI awareness. (Windows 10, version 1607 and later). - * The most visible difference from "permonitor" is that window title bar will be scaled - * to the visually correct size when dragging between monitors with different scale factors. - * This is the preferred DPI awareness level. - * - * If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best - * available match. + * Controls whether SDL will declare the process to be DPI aware. + * + * This hint must be set before initializing the video subsystem. + * + * The main purpose of declaring DPI awareness is to disable OS bitmap scaling + * of SDL windows on monitors with a DPI scale factor. + * + * This hint is equivalent to requesting DPI awareness via external means + * (e.g. calling SetProcessDpiAwarenessContext) and does not cause SDL to use + * a virtualized coordinate system, so it will generally give you 1 SDL + * coordinate = 1 pixel even on high-DPI displays. + * + * For more information, see: + * https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows + * + * This variable can be set to the following values: + * + * - "": Do not change the DPI awareness (default). + * - "unaware": Declare the process as DPI unaware. (Windows 8.1 and later). + * - "system": Request system DPI awareness. (Vista and later). + * - "permonitor": Request per-monitor DPI awareness. (Windows 8.1 and later). + * - "permonitorv2": Request per-monitor V2 DPI awareness. (Windows 10, + * version 1607 and later). The most visible difference from "permonitor" is + * that window title bar will be scaled to the visually correct size when + * dragging between monitors with different scale factors. This is the + * preferred DPI awareness level. + * + * If the requested DPI awareness is not available on the currently running + * OS, SDL will try to request the best available match. */ #define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS" /** - * \brief Uses DPI-scaled points as the SDL coordinate system on Windows. - * - * This changes the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere. - * This means windows will be appropriately sized, even when created on high-DPI displays with scaling. - * - * e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings, - * will create a window with an 800x600 client area (in pixels). - * - * Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary), - * and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows. - * - * This variable can be set to the following values: - * "0" - SDL coordinates equal Windows coordinates. No automatic window resizing when dragging - * between monitors with different scale factors (unless this is performed by - * Windows itself, which is the case when the process is DPI unaware). - * "1" - SDL coordinates are in DPI-scaled points. Automatically resize windows as needed on - * displays with non-100% scale factors. + * Uses DPI-scaled points as the SDL coordinate system on Windows. + * + * This changes the SDL coordinate system units to be DPI-scaled points, + * rather than pixels everywhere. This means windows will be appropriately + * sized, even when created on high-DPI displays with scaling. + * + * e.g. requesting a 640x480 window from SDL, on a display with 125% scaling + * in Windows display settings, will create a window with an 800x600 client + * area (in pixels). + * + * Setting this to "1" implicitly requests process DPI awareness (setting + * SDL_WINDOWS_DPI_AWARENESS is unnecessary), and forces + * SDL_WINDOW_ALLOW_HIGHDPI on all windows. + * + * This variable can be set to the following values: + * + * - "0": SDL coordinates equal Windows coordinates. No automatic window + * resizing when dragging between monitors with different scale factors + * (unless this is performed by Windows itself, which is the case when the + * process is DPI unaware). + * - "1": SDL coordinates are in DPI-scaled points. Automatically resize + * windows as needed on displays with non-100% scale factors. */ #define SDL_HINT_WINDOWS_DPI_SCALING "SDL_WINDOWS_DPI_SCALING" /** - * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden + * A variable controlling whether the window frame and title bar are + * interactive when the cursor is hidden + * + * This variable can be set to the following values: * - * This variable can be set to the following values: - * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) - * "1" - The window frame is interactive when the cursor is hidden + * - "0": The window frame is not interactive when the cursor is hidden (no + * move, resize, etc) + * - "1": The window frame is interactive when the cursor is hidden * - * By default SDL will allow interaction with the window frame when the cursor is hidden + * By default SDL will allow interaction with the window frame when the cursor + * is hidden */ #define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" /** -* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called -* -* This variable can be set to the following values: -* "0" - The window is activated when the SDL_ShowWindow function is called -* "1" - The window is not activated when the SDL_ShowWindow function is called -* -* By default SDL will activate the window when the SDL_ShowWindow function is called -*/ + * A variable controlling whether the window is activated when the + * SDL_ShowWindow function is called + * + * This variable can be set to the following values: + * + * - "0": The window is activated when the SDL_ShowWindow function is called + * - "1": The window is not activated when the SDL_ShowWindow function is + * called + * + * By default SDL will activate the window when the SDL_ShowWindow function is + * called + */ #define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN" -/** \brief Allows back-button-press events on Windows Phone to be marked as handled +/** Allows back-button-press events on Windows Phone to be marked as handled * * Windows Phone devices typically feature a Back button. When pressed, * the OS will emit back-button-press events, which apps are expected to @@ -2151,11 +2869,12 @@ extern "C" { * * More details on back button behavior in Windows Phone apps can be found * at the following page, on Microsoft's developer site: + * * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx */ #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" -/** \brief Label text for a WinRT app's privacy policy link +/** Label text for a WinRT app's privacy policy link * * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, * Microsoft mandates that this policy be available via the Windows Settings charm. @@ -2177,221 +2896,267 @@ extern "C" { #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" /** - * \brief A URL to a WinRT app's privacy policy + * A URL to a WinRT app's privacy policy * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * be available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the app's - * privacy policy. + * All network-enabled WinRT apps must make a privacy policy available to its + * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be be + * available in the Windows Settings charm, as accessed from within the app. + * SDL provides code to add a URL-based link there, which can point to the + * app's privacy policy. * - * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL - * before calling any SDL_Init() functions. The contents of the hint should - * be a valid URL. For example, "http://www.example.com". + * To setup a URL to an app's privacy policy, set + * SDL_HINT_WINRT_PRIVACY_POLICY_URL before calling any SDL_Init() functions. + * The contents of the hint should be a valid URL. For example, + * "http://www.example.com". * - * The default value is "", which will prevent SDL from adding a privacy policy - * link to the Settings charm. This hint should only be set during app init. + * The default value is "", which will prevent SDL from adding a privacy + * policy link to the Settings charm. This hint should only be set during app + * init. * - * The label text of an app's "Privacy Policy" link may be customized via another - * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * The label text of an app's "Privacy Policy" link may be customized via + * another hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL - * will not get used on that platform. Network-enabled phone apps should display - * their privacy policy through some other, in-app means. + * Please note that on Windows Phone, Microsoft does not provide standard UI + * for displaying a privacy policy link, and as such, + * SDL_HINT_WINRT_PRIVACY_POLICY_URL will not get used on that platform. + * Network-enabled phone apps should display their privacy policy through some + * other, in-app means. */ #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" /** - * \brief Mark X11 windows as override-redirect. + * Mark X11 windows as override-redirect. * - * If set, this _might_ increase framerate at the expense of the desktop - * not working as expected. Override-redirect windows aren't noticed by the - * window manager at all. + * If set, this _might_ increase framerate at the expense of the desktop not + * working as expected. Override-redirect windows aren't noticed by the window + * manager at all. * - * You should probably only use this for fullscreen windows, and you probably - * shouldn't even use it for that. But it's here if you want to try! + * You should probably only use this for fullscreen windows, and you probably + * shouldn't even use it for that. But it's here if you want to try! */ #define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT "SDL_X11_FORCE_OVERRIDE_REDIRECT" /** - * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * A variable that lets you disable the detection and use of Xinput gamepad + * devices + * + * The variable can be set to the following values: * - * The variable can be set to the following values: - * "0" - Disable XInput detection (only uses direct input) - * "1" - Enable XInput detection (the default) + * - "0": Disable XInput detection (only uses direct input) + * - "1": Enable XInput detection (the default) */ #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" - /** - * \brief A variable that lets you disable the detection and use of DirectInput gamepad devices - * - * The variable can be set to the following values: - * "0" - Disable DirectInput detection (only uses XInput) - * "1" - Enable DirectInput detection (the default) - */ +/** + * A variable that lets you disable the detection and use of DirectInput + * gamepad devices + * + * The variable can be set to the following values: + * + * - "0": Disable DirectInput detection (only uses XInput) + * - "1": Enable DirectInput detection (the default) + */ #define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED" /** - * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. + * A variable that causes SDL to use the old axis and button mapping for + * XInput devices. * - * This hint is for backwards compatibility only and will be removed in SDL 2.1 + * This hint is for backwards compatibility only and will be removed in SDL + * 2.1 * - * The default value is "0". This hint must be set before SDL_Init() + * The default value is "0". This hint must be set before SDL_Init() */ #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" /** - * \brief A variable that causes SDL to not ignore audio "monitors" + * A variable that causes SDL to not ignore audio "monitors" * - * This is currently only used for PulseAudio and ignored elsewhere. + * This is currently only used for PulseAudio and ignored elsewhere. * - * By default, SDL ignores audio devices that aren't associated with physical - * hardware. Changing this hint to "1" will expose anything SDL sees that - * appears to be an audio source or sink. This will add "devices" to the list - * that the user probably doesn't want or need, but it can be useful in - * scenarios where you want to hook up SDL to some sort of virtual device, - * etc. + * By default, SDL ignores audio devices that aren't associated with physical + * hardware. Changing this hint to "1" will expose anything SDL sees that + * appears to be an audio source or sink. This will add "devices" to the list + * that the user probably doesn't want or need, but it can be useful in + * scenarios where you want to hook up SDL to some sort of virtual device, + * etc. * - * The default value is "0". This hint must be set before SDL_Init(). + * The default value is "0". This hint must be set before SDL_Init(). * - * This hint is available since SDL 2.0.16. Before then, virtual devices are - * always ignored. + * This hint is available since SDL 2.0.16. Before then, virtual devices are + * always ignored. */ #define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS" /** - * \brief A variable that forces X11 windows to create as a custom type. + * A variable that forces X11 windows to create as a custom type. * - * This is currently only used for X11 and ignored elsewhere. + * This is currently only used for X11 and ignored elsewhere. * - * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property - * to report to the window manager the type of window it wants to create. - * This might be set to various things if SDL_WINDOW_TOOLTIP or - * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that - * haven't set a specific type, this hint can be used to specify a custom - * type. For example, a dock window might set this to - * "_NET_WM_WINDOW_TYPE_DOCK". + * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property to + * report to the window manager the type of window it wants to create. This + * might be set to various things if SDL_WINDOW_TOOLTIP or + * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that + * haven't set a specific type, this hint can be used to specify a custom + * type. For example, a dock window might set this to + * "_NET_WM_WINDOW_TYPE_DOCK". * - * If not set or set to "", this hint is ignored. This hint must be set - * before the SDL_CreateWindow() call that it is intended to affect. + * If not set or set to "", this hint is ignored. This hint must be set before + * the SDL_CreateWindow() call that it is intended to affect. * - * This hint is available since SDL 2.0.22. + * This hint is available since SDL 2.0.22. */ #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" /** - * \brief A variable that decides whether to send SDL_QUIT when closing the final window. + * A variable that decides whether to send SDL_QUIT when closing the final + * window. * - * By default, SDL sends an SDL_QUIT event when there is only one window - * and it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most - * apps would also take the loss of this window as a signal to terminate the - * program. + * By default, SDL sends an SDL_QUIT event when there is only one window and + * it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most apps + * would also take the loss of this window as a signal to terminate the + * program. * - * However, it's not unreasonable in some cases to have the program continue - * to live on, perhaps to create new windows later. + * However, it's not unreasonable in some cases to have the program continue + * to live on, perhaps to create new windows later. * - * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event - * when the final window is requesting to close. Note that in this case, - * there are still other legitimate reasons one might get an SDL_QUIT - * event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c) - * on Unix, etc. + * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event when + * the final window is requesting to close. Note that in this case, there are + * still other legitimate reasons one might get an SDL_QUIT event: choosing + * "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c) on Unix, etc. * - * The default value is "1". This hint can be changed at any time. + * The default value is "1". This hint can be changed at any time. * - * This hint is available since SDL 2.0.22. Before then, you always get - * an SDL_QUIT event when closing the final window. + * This hint is available since SDL 2.0.22. Before then, you always get an + * SDL_QUIT event when closing the final window. */ #define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE" /** - * \brief A variable that decides what video backend to use. + * A variable that decides what video backend to use. * - * By default, SDL will try all available video backends in a reasonable - * order until it finds one that can work, but this hint allows the app - * or user to force a specific target, such as "x11" if, say, you are - * on Wayland but want to try talking to the X server instead. + * By default, SDL will try all available video backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "x11" if, say, you are on Wayland but want + * to try talking to the X server instead. * - * This functionality has existed since SDL 2.0.0 (indeed, before that) - * but before 2.0.22 this was an environment variable only. In 2.0.22, - * it was upgraded to a full SDL hint, so you can set the environment - * variable as usual or programatically set the hint with SDL_SetHint, - * which won't propagate to child processes. + * This functionality has existed since SDL 2.0.0 (indeed, before that) but + * before 2.0.22 this was an environment variable only. In 2.0.22, it was + * upgraded to a full SDL hint, so you can set the environment variable as + * usual or programatically set the hint with SDL_SetHint, which won't + * propagate to child processes. * - * The default value is unset, in which case SDL will try to figure out - * the best video backend on your behalf. This hint needs to be set - * before SDL_Init() is called to be useful. + * The default value is unset, in which case SDL will try to figure out the + * best video backend on your behalf. This hint needs to be set before + * SDL_Init() is called to be useful. * - * This hint is available since SDL 2.0.22. Before then, you could set - * the environment variable to get the same effect. + * This hint is available since SDL 2.0.22. Before then, you could set the + * environment variable to get the same effect. */ #define SDL_HINT_VIDEODRIVER "SDL_VIDEODRIVER" /** - * \brief A variable that decides what audio backend to use. + * A variable that decides what audio backend to use. * - * By default, SDL will try all available audio backends in a reasonable - * order until it finds one that can work, but this hint allows the app - * or user to force a specific target, such as "alsa" if, say, you are - * on PulseAudio but want to try talking to the lower level instead. + * By default, SDL will try all available audio backends in a reasonable order + * until it finds one that can work, but this hint allows the app or user to + * force a specific target, such as "alsa" if, say, you are on PulseAudio but + * want to try talking to the lower level instead. * - * This functionality has existed since SDL 2.0.0 (indeed, before that) - * but before 2.0.22 this was an environment variable only. In 2.0.22, - * it was upgraded to a full SDL hint, so you can set the environment - * variable as usual or programatically set the hint with SDL_SetHint, - * which won't propagate to child processes. + * This functionality has existed since SDL 2.0.0 (indeed, before that) but + * before 2.0.22 this was an environment variable only. In 2.0.22, it was + * upgraded to a full SDL hint, so you can set the environment variable as + * usual or programatically set the hint with SDL_SetHint, which won't + * propagate to child processes. * - * The default value is unset, in which case SDL will try to figure out - * the best audio backend on your behalf. This hint needs to be set - * before SDL_Init() is called to be useful. + * The default value is unset, in which case SDL will try to figure out the + * best audio backend on your behalf. This hint needs to be set before + * SDL_Init() is called to be useful. * - * This hint is available since SDL 2.0.22. Before then, you could set - * the environment variable to get the same effect. + * This hint is available since SDL 2.0.22. Before then, you could set the + * environment variable to get the same effect. */ #define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER" /** - * \brief A variable that decides what KMSDRM device to use. + * A variable that decides what KMSDRM device to use. * - * Internally, SDL might open something like "/dev/dri/cardNN" to - * access KMSDRM functionality, where "NN" is a device index number. + * Internally, SDL might open something like "/dev/dri/cardNN" to access + * KMSDRM functionality, where "NN" is a device index number. * - * SDL makes a guess at the best index to use (usually zero), but the - * app or user can set this hint to a number between 0 and 99 to - * force selection. + * SDL makes a guess at the best index to use (usually zero), but the app or + * user can set this hint to a number between 0 and 99 to force selection. * - * This hint is available since SDL 2.24.0. + * This hint is available since SDL 2.24.0. */ #define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX" /** - * \brief A variable that treats trackpads as touch devices. + * A variable that treats trackpads as touch devices. * - * On macOS (and possibly other platforms in the future), SDL will report - * touches on a trackpad as mouse input, which is generally what users - * expect from this device; however, these are often actually full - * multitouch-capable touch devices, so it might be preferable to some apps - * to treat them as such. + * On macOS (and possibly other platforms in the future), SDL will report + * touches on a trackpad as mouse input, which is generally what users expect + * from this device; however, these are often actually full multitouch-capable + * touch devices, so it might be preferable to some apps to treat them as + * such. * - * Setting this hint to true will make the trackpad input report as a - * multitouch device instead of a mouse. The default is false. + * Setting this hint to true will make the trackpad input report as a + * multitouch device instead of a mouse. The default is false. * - * Note that most platforms don't support this hint. As of 2.24.0, it - * only supports MacBooks' trackpads on macOS. Others may follow later. + * Note that most platforms don't support this hint. As of 2.24.0, it only + * supports MacBooks' trackpads on macOS. Others may follow later. * - * This hint is checked during SDL_Init and can not be changed after. + * This hint is checked during SDL_Init and can not be changed after. * - * This hint is available since SDL 2.24.0. + * This hint is available since SDL 2.24.0. */ #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" +/** + * Cause SDL to call dbus_shutdown() on quit. + * + * This is useful as a debug tool to validate memory leaks, but shouldn't ever + * be set in production applications, as other libraries used by the + * application might use dbus under the hood and this cause cause crashes if + * they continue after SDL_Quit(). + * + * This variable can be set to the following values: + * + * - "0": SDL will not call dbus_shutdown() on quit (default) + * - "1": SDL will call dbus_shutdown() on quit + * + * This hint is available since SDL 2.30.0. + */ +#define SDL_HINT_SHUTDOWN_DBUS_ON_QUIT "SDL_SHUTDOWN_DBUS_ON_QUIT" + +/** + * Specify if SDL_RWFromFile should use the resource dir on Apple platforms. + * + * SDL2 has always done this on Apple platforms, but it can be surprising to + * try opening a path to discover that SDL adjusts the path to elsewhere, so + * this hint allows that behavior to be disabled. + * + * If running from a App Bundle, this will be MyApp.app/Contents/Resources. If + * running as a normal Unix-like process, this will be the directory where the + * running binary lives. Setting this hint to 0 avoids this and just uses the + * requested path as-is. + * + * This variable can be set to the following values: + * + * - "0": SDL will not use the app resource directory. + * - "1": SDL will use the app's resource directory (default). + * + * This hint is available since SDL 2.32.0. + */ +#define SDL_HINT_APPLE_RWFROMFILE_USE_RESOURCES "SDL_APPLE_RWFROMFILE_USE_RESOURCES" + /** - * \brief An enumeration of hint priorities + * An enumeration of hint priorities */ -typedef enum +typedef enum SDL_HintPriority { SDL_HINT_DEFAULT, SDL_HINT_NORMAL, @@ -2406,9 +3171,9 @@ typedef enum * value. Hints will replace existing hints of their priority and lower. * Environment variables are considered to have override priority. * - * \param name the hint to set - * \param value the value of the hint variable - * \param priority the SDL_HintPriority level for the hint + * \param name the hint to set. + * \param value the value of the hint variable. + * \param priority the SDL_HintPriority level for the hint. * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -2427,8 +3192,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, * variable that takes precedence. You can use SDL_SetHintWithPriority() to * set the hint with override priority instead. * - * \param name the hint to set - * \param value the value of the hint variable + * \param name the hint to set. + * \param value the value of the hint variable. * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -2446,7 +3211,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, * the environment isn't set. Callbacks will be called normally with this * change. * - * \param name the hint to set + * \param name the hint to set. * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. * * \since This function is available since SDL 2.24.0. @@ -2474,7 +3239,7 @@ extern DECLSPEC void SDLCALL SDL_ResetHints(void); /** * Get the value of a hint. * - * \param name the hint to query + * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. * * \since This function is available since SDL 2.0.0. @@ -2487,8 +3252,8 @@ extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); /** * Get the boolean value of a hint variable. * - * \param name the name of the hint to get the boolean value from - * \param default_value the value to return if the hint does not exist + * \param name the name of the hint to get the boolean value from. + * \param default_value the value to return if the hint does not exist. * \returns the boolean value of a hint or the provided default value if the * hint does not exist. * @@ -2502,20 +3267,20 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool d /** * Type definition of the hint callback function. * - * \param userdata what was passed as `userdata` to SDL_AddHintCallback() - * \param name what was passed as `name` to SDL_AddHintCallback() - * \param oldValue the previous hint value - * \param newValue the new value hint is to be set to + * \param userdata what was passed as `userdata` to SDL_AddHintCallback(). + * \param name what was passed as `name` to SDL_AddHintCallback(). + * \param oldValue the previous hint value. + * \param newValue the new value hint is to be set to. */ typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); /** * Add a function to watch a particular hint. * - * \param name the hint to watch + * \param name the hint to watch. * \param callback An SDL_HintCallback function that will be called when the - * hint value changes - * \param userdata a pointer to pass to the callback function + * hint value changes. + * \param userdata a pointer to pass to the callback function. * * \since This function is available since SDL 2.0.0. * @@ -2528,10 +3293,10 @@ extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, /** * Remove a function watching a particular hint. * - * \param name the hint being watched + * \param name the hint being watched. * \param callback An SDL_HintCallback function that will be called when the - * hint value changes - * \param userdata a pointer being passed to the callback function + * hint value changes. + * \param userdata a pointer being passed to the callback function. * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_joystick.h b/include/SDL_joystick.h index 72c6604df2a36..08251e14569f3 100644 --- a/include/SDL_joystick.h +++ b/include/SDL_joystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,22 +20,26 @@ */ /** - * \file SDL_joystick.h + * # CategoryJoystick * - * Include file for SDL joystick event handling + * Include file for SDL joystick event handling * - * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick - * behind a device_index changing as joysticks are plugged and unplugged. + * The term "device_index" identifies currently plugged in joystick devices + * between 0 and SDL_NumJoysticks(), with the exact joystick behind a + * device_index changing as joysticks are plugged and unplugged. * - * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted - * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * The term "instance_id" is the current instantiation of a joystick device in + * the system, if the joystick is removed and then re-inserted then it will + * get a new instance_id, instance_id's are monotonically increasing + * identifiers of a joystick plugged in. * * The term "player_index" is the number assigned to a player on a specific - * controller. For XInput controllers this returns the XInput user index. - * Many joysticks will not be able to supply this information. + * controller. For XInput controllers this returns the XInput user index. Many + * joysticks will not be able to supply this information. * - * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of - * the device (a X360 wired controller for example). This identifier is platform dependent. + * The term JoystickGUID is a stable 128-bit identifier for a joystick device + * that does not change over time, it identifies class of the device (a X360 + * wired controller for example). This identifier is platform dependent. */ #ifndef SDL_joystick_h_ @@ -44,6 +48,7 @@ #include "SDL_stdinc.h" #include "SDL_error.h" #include "SDL_guid.h" +#include "SDL_mutex.h" #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ @@ -55,7 +60,7 @@ extern "C" { * \file SDL_joystick.h * * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system * for joysticks, and load appropriate drivers. * * If you would like to receive joystick updates while the application @@ -66,18 +71,27 @@ extern "C" { /** * The joystick structure used to identify an SDL joystick */ +#ifdef SDL_THREAD_SAFETY_ANALYSIS +extern SDL_mutex *SDL_joystick_lock; +#endif struct _SDL_Joystick; typedef struct _SDL_Joystick SDL_Joystick; -/* A structure that encodes the stable unique id for a joystick device */ +/** + * A structure that encodes the stable unique id for a joystick device. + * + * This is just a standard SDL_GUID by a different name. + */ typedef SDL_GUID SDL_JoystickGUID; /** - * This is a unique ID for a joystick for the time it is connected to the system, - * and is never reused for the lifetime of the application. If the joystick is - * disconnected and reconnected, it will get a new ID. + * This is a unique ID for a joystick for the time it is connected to the + * system, and is never reused for the lifetime of the application. * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + * If the joystick is disconnected and reconnected, it will get a new ID. + * + * The ID value starts at 0 and increments from there. The value -1 is an + * invalid ID. */ typedef Sint32 SDL_JoystickID; @@ -131,7 +145,7 @@ typedef enum * * \since This function is available since SDL 2.0.7. */ -extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); +extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock); /** @@ -146,7 +160,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void); * * \since This function is available since SDL 2.0.7. */ -extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void); +extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock); /** * Count the number of joysticks attached to the system. @@ -168,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); * This can be called before any joysticks are opened. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system) + * on the system). * \returns the name of the selected joystick. If no name can be found, this * function returns NULL; call SDL_GetError() for more information. * @@ -185,7 +199,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); * This can be called before any joysticks are opened. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system) + * on the system). * \returns the path of the selected joystick. If no path can be found, this * function returns NULL; call SDL_GetError() for more information. * @@ -200,6 +214,9 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index); * Get the player index of a joystick, or -1 if it's not available This can be * called before any joysticks are opened. * + * \param device_index device index. + * \returns player index, or -1 if not available. + * * \since This function is available since SDL 2.0.9. */ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); @@ -211,9 +228,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); * This function can be called before any joysticks are opened. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the GUID of the selected joystick. If called on an invalid index, - * this function returns a zero GUID + * this function returns a zero GUID. * * \since This function is available since SDL 2.0.0. * @@ -229,9 +246,9 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_in * available this function returns 0. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the USB vendor ID of the selected joystick. If called on an - * invalid index, this function returns zero + * invalid index, this function returns zero. * * \since This function is available since SDL 2.0.6. */ @@ -244,9 +261,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); * available this function returns 0. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the USB product ID of the selected joystick. If called on an - * invalid index, this function returns zero + * invalid index, this function returns zero. * * \since This function is available since SDL 2.0.6. */ @@ -259,9 +276,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); * isn't available this function returns 0. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the product version of the selected joystick. If called on an - * invalid index, this function returns zero + * invalid index, this function returns zero. * * \since This function is available since SDL 2.0.6. */ @@ -273,9 +290,9 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_in * This can be called before any joysticks are opened. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the SDL_JoystickType of the selected joystick. If called on an - * invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN` + * invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN`. * * \since This function is available since SDL 2.0.6. */ @@ -284,13 +301,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in /** * Get the instance ID of a joystick. * - * This can be called before any joysticks are opened. If the index is out of - * range, this function will return -1. + * This can be called before any joysticks are opened. * * \param device_index the index of the joystick to query (the N'th joystick - * on the system + * on the system. * \returns the instance id of the selected joystick. If called on an invalid - * index, this function returns zero + * index, this function returns -1. * * \since This function is available since SDL 2.0.6. */ @@ -307,7 +323,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int devic * The joystick subsystem must be initialized before a joystick can be opened * for use. * - * \param device_index the index of the joystick to query + * \param device_index the index of the joystick to query. * \returns a joystick identifier or NULL if an error occurred; call * SDL_GetError() for more information. * @@ -321,7 +337,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); /** * Get the SDL_Joystick associated with an instance id. * - * \param instance_id the instance id to get the SDL_Joystick for + * \param instance_id the instance id to get the SDL_Joystick for. * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() * for more information. * @@ -332,7 +348,7 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID /** * Get the SDL_Joystick associated with a player index. * - * \param player_index the player index to get the SDL_Joystick for + * \param player_index the player index to get the SDL_Joystick for. * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() * for more information. * @@ -343,6 +359,10 @@ extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_ind /** * Attach a new virtual joystick. * + * \param type joystick type. + * \param naxes number of axes. + * \param nbuttons number of buttons. + * \param nhats number of hats. * \returns the joystick's device index, or -1 if an error occurred. * * \since This function is available since SDL 2.0.14. @@ -355,8 +375,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, /** * The structure that defines an extended virtual joystick description * - * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx() - * All other elements of this structure are optional and can be left 0. + * The caller must zero the structure and then initialize the version with + * `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to + * SDL_JoystickAttachVirtualEx() All other elements of this structure are + * optional and can be left 0. * * \sa SDL_JoystickAttachVirtualEx */ @@ -387,13 +409,14 @@ typedef struct SDL_VirtualJoystickDesc } SDL_VirtualJoystickDesc; /** - * \brief The current version of the SDL_VirtualJoystickDesc structure + * The current version of the SDL_VirtualJoystickDesc structure */ #define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1 /** * Attach a new virtual joystick with extended properties. * + * \param desc joystick description. * \returns the joystick's device index, or -1 if an error occurred. * * \since This function is available since SDL 2.24.0. @@ -404,7 +427,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystic * Detach a virtual joystick. * * \param device_index a value previously returned from - * SDL_JoystickAttachVirtual() + * SDL_JoystickAttachVirtual(). * \returns 0 on success, or -1 if an error occurred. * * \since This function is available since SDL 2.0.14. @@ -482,7 +505,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in /** * Get the implementation dependent name of a joystick. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the name of the selected joystick. If no name can be found, this * function returns NULL; call SDL_GetError() for more information. * @@ -496,7 +519,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); /** * Get the implementation dependent path of a joystick. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the path of the selected joystick. If no path can be found, this * function returns NULL; call SDL_GetError() for more information. * @@ -512,7 +535,7 @@ extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick); * For XInput controllers this returns the XInput user index. Many joysticks * will not be able to supply this information. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the player index, or -1 if it's not available. * * \since This function is available since SDL 2.0.9. @@ -522,7 +545,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); /** * Set the player index of an opened joystick. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \param player_index Player index to assign to this joystick, or -1 to clear * the player index and turn off player LEDs. * @@ -535,7 +558,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, * * This function requires an open joystick. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the GUID of the given joystick. If called on an invalid index, * this function returns a zero GUID; call SDL_GetError() for more * information. @@ -552,7 +575,7 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joyst * * If the vendor ID isn't available this function returns 0. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the USB vendor ID of the selected joystick, or 0 if unavailable. * * \since This function is available since SDL 2.0.6. @@ -564,7 +587,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); * * If the product ID isn't available this function returns 0. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the USB product ID of the selected joystick, or 0 if unavailable. * * \since This function is available since SDL 2.0.6. @@ -576,7 +599,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); * * If the product version isn't available this function returns 0. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the product version of the selected joystick, or 0 if unavailable. * * \since This function is available since SDL 2.0.6. @@ -588,7 +611,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joyst * * If the firmware version isn't available this function returns 0. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the firmware version of the selected joystick, or 0 if * unavailable. * @@ -601,7 +624,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joys * * Returns the serial number of the joystick, or NULL if it is not available. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the serial number of the selected joystick, or NULL if * unavailable. * @@ -612,7 +635,7 @@ extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystic /** * Get the type of an opened joystick. * - * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen(). * \returns the SDL_JoystickType of the selected joystick. * * \since This function is available since SDL 2.0.6. @@ -624,9 +647,9 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joyst * * You should supply at least 33 bytes for pszGUID. * - * \param guid the SDL_JoystickGUID you wish to convert to string - * \param pszGUID buffer in which to write the ASCII string - * \param cbGUID the size of pszGUID + * \param guid the SDL_JoystickGUID you wish to convert to string. + * \param pszGUID buffer in which to write the ASCII string. + * \param cbGUID the size of pszGUID. * * \since This function is available since SDL 2.0.0. * @@ -643,7 +666,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch * an invalid GUID, the function will silently succeed, but the GUID generated * will not be useful. * - * \param pchGUID string containing an ASCII representation of a GUID + * \param pchGUID string containing an ASCII representation of a GUID. * \returns a SDL_JoystickGUID structure. * * \since This function is available since SDL 2.0.0. @@ -655,15 +678,15 @@ extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const cha /** * Get the device information encoded in a SDL_JoystickGUID structure * - * \param guid the SDL_JoystickGUID you wish to get info about + * \param guid the SDL_JoystickGUID you wish to get info about. * \param vendor A pointer filled in with the device VID, or 0 if not - * available + * available. * \param product A pointer filled in with the device PID, or 0 if not - * available + * available. * \param version A pointer filled in with the device version, or 0 if not - * available + * available. * \param crc16 A pointer filled in with a CRC used to distinguish different - * products with the same VID/PID, or 0 if not available + * products with the same VID/PID, or 0 if not available. * * \since This function is available since SDL 2.26.0. * @@ -674,7 +697,7 @@ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint /** * Get the status of a specified joystick. * - * \param joystick the joystick to query + * \param joystick the joystick to query. * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not; * call SDL_GetError() for more information. * @@ -688,7 +711,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick) /** * Get the instance ID of an opened joystick. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \returns the instance ID of the specified joystick on success or a negative * error code on failure; call SDL_GetError() for more information. * @@ -705,7 +728,7 @@ extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joys * separate buttons or a POV hat, and not axes, but all of this is up to the * device and platform. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \returns the number of axis controls/number of axes on success or a * negative error code on failure; call SDL_GetError() for more * information. @@ -725,7 +748,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); * * Most joysticks do not have trackballs. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \returns the number of trackballs on success or a negative error code on * failure; call SDL_GetError() for more information. * @@ -738,7 +761,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); /** * Get the number of POV hats on a joystick. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \returns the number of POV hats on success or a negative error code on * failure; call SDL_GetError() for more information. * @@ -752,7 +775,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); /** * Get the number of buttons on a joystick. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \returns the number of buttons on success or a negative error code on * failure; call SDL_GetError() for more information. * @@ -787,12 +810,17 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); * **WARNING**: Calling this function may delete all events currently in SDL's * event queue. * - * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` - * \returns 1 if enabled, 0 if disabled, or a negative error code on failure; - * call SDL_GetError() for more information. + * While `param` is meant to be one of `SDL_QUERY`, `SDL_IGNORE`, or + * `SDL_ENABLE`, this function accepts any value, with any non-zero value that + * isn't `SDL_QUERY` being treated as `SDL_ENABLE`. + * + * If SDL was built with events disabled (extremely uncommon!), this will do + * nothing and always return `SDL_IGNORE`. * - * If `state` is `SDL_QUERY` then the current state is returned, - * otherwise the new processing state is returned. + * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE`. + * \returns If `state` is `SDL_QUERY` then the current state is returned, + * otherwise `state` is returned (even if it was not one of the + * allowed values). * * \since This function is available since SDL 2.0.0. * @@ -800,6 +828,7 @@ extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); */ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); +/* Limits for joystick axes... */ #define SDL_JOYSTICK_AXIS_MAX 32767 #define SDL_JOYSTICK_AXIS_MIN -32768 @@ -816,8 +845,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); * 32767) representing the current position of the axis. It may be necessary * to impose certain tolerances on these values to account for jitter. * - * \param joystick an SDL_Joystick structure containing joystick information - * \param axis the axis to query; the axis indices start at index 0 + * \param joystick an SDL_Joystick structure containing joystick information. + * \param axis the axis to query; the axis indices start at index 0. * \returns a 16-bit signed integer representing the current position of the * axis or 0 on failure; call SDL_GetError() for more information. * @@ -835,8 +864,8 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, * * The axis indices start at index 0. * - * \param joystick an SDL_Joystick structure containing joystick information - * \param axis the axis to query; the axis indices start at index 0 + * \param joystick an SDL_Joystick structure containing joystick information. + * \param axis the axis to query; the axis indices start at index 0. * \param state Upon return, the initial value is supplied here. * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. * @@ -875,8 +904,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *j * - `SDL_HAT_LEFTUP` * - `SDL_HAT_LEFTDOWN` * - * \param joystick an SDL_Joystick structure containing joystick information - * \param hat the hat index to get the state from; indices start at index 0 + * \param joystick an SDL_Joystick structure containing joystick information. + * \param hat the hat index to get the state from; indices start at index 0. * \returns the current hat position. * * \since This function is available since SDL 2.0.0. @@ -894,10 +923,10 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, * * Most joysticks do not have trackballs. * - * \param joystick the SDL_Joystick to query - * \param ball the ball index to query; ball indices start at index 0 - * \param dx stores the difference in the x axis position since the last poll - * \param dy stores the difference in the y axis position since the last poll + * \param joystick the SDL_Joystick to query. + * \param ball the ball index to query; ball indices start at index 0. + * \param dx stores the difference in the x axis position since the last poll. + * \param dy stores the difference in the y axis position since the last poll. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -911,9 +940,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, /** * Get the current state of a button on a joystick. * - * \param joystick an SDL_Joystick structure containing joystick information + * \param joystick an SDL_Joystick structure containing joystick information. * \param button the button index to get the state from; indices start at - * index 0 + * index 0. * \returns 1 if the specified button is pressed, 0 otherwise. * * \since This function is available since SDL 2.0.0. @@ -929,13 +958,13 @@ extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, * Each call to this function cancels any previous rumble effect, and calling * it with 0 intensity stops any rumbling. * - * \param joystick The joystick to vibrate + * \param joystick The joystick to vibrate. * \param low_frequency_rumble The intensity of the low frequency (left) - * rumble motor, from 0 to 0xFFFF + * rumble motor, from 0 to 0xFFFF. * \param high_frequency_rumble The intensity of the high frequency (right) - * rumble motor, from 0 to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if rumble isn't supported on this joystick + * rumble motor, from 0 to 0xFFFF. + * \param duration_ms The duration of the rumble effect, in milliseconds. + * \returns 0, or -1 if rumble isn't supported on this joystick. * * \since This function is available since SDL 2.0.9. * @@ -954,13 +983,13 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo * want the (more common) whole-controller rumble, use SDL_JoystickRumble() * instead. * - * \param joystick The joystick to vibrate + * \param joystick The joystick to vibrate. * \param left_rumble The intensity of the left trigger rumble motor, from 0 - * to 0xFFFF + * to 0xFFFF. * \param right_rumble The intensity of the right trigger rumble motor, from 0 - * to 0xFFFF - * \param duration_ms The duration of the rumble effect, in milliseconds - * \returns 0, or -1 if trigger rumble isn't supported on this joystick + * to 0xFFFF. + * \param duration_ms The duration of the rumble effect, in milliseconds. + * \returns 0, or -1 if trigger rumble isn't supported on this joystick. * * \since This function is available since SDL 2.0.14. * @@ -974,7 +1003,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, U * An example of a joystick LED is the light on the back of a PlayStation 4's * DualShock 4 controller. * - * \param joystick The joystick to query + * \param joystick The joystick to query. * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -984,7 +1013,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); /** * Query whether a joystick has rumble support. * - * \param joystick The joystick to query + * \param joystick The joystick to query. * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.18. @@ -996,7 +1025,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick); /** * Query whether a joystick has rumble support on triggers. * - * \param joystick The joystick to query + * \param joystick The joystick to query. * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.18. @@ -1011,11 +1040,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joy * An example of a joystick LED is the light on the back of a PlayStation 4's * DualShock 4 controller. * - * \param joystick The joystick to update - * \param red The intensity of the red LED - * \param green The intensity of the green LED - * \param blue The intensity of the blue LED - * \returns 0 on success, -1 if this joystick does not have a modifiable LED + * \param joystick The joystick to update. + * \param red The intensity of the red LED. + * \param green The intensity of the green LED. + * \param blue The intensity of the blue LED. + * \returns 0 on success, -1 if this joystick does not have a modifiable LED. * * \since This function is available since SDL 2.0.14. */ @@ -1024,10 +1053,11 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red /** * Send a joystick specific effect packet * - * \param joystick The joystick to affect - * \param data The data to send to the joystick - * \param size The size of the data to send to the joystick - * \returns 0, or -1 if this joystick or driver doesn't support effect packets + * \param joystick The joystick to affect. + * \param data The data to send to the joystick. + * \param size The size of the data to send to the joystick. + * \returns 0, or -1 if this joystick or driver doesn't support effect + * packets. * * \since This function is available since SDL 2.0.16. */ @@ -1036,7 +1066,7 @@ extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const /** * Close a joystick previously opened with SDL_JoystickOpen(). * - * \param joystick The joystick device to close + * \param joystick The joystick device to close. * * \since This function is available since SDL 2.0.0. * @@ -1047,9 +1077,9 @@ extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); /** * Get the battery level of a joystick as SDL_JoystickPowerLevel. * - * \param joystick the SDL_Joystick to query + * \param joystick the SDL_Joystick to query. * \returns the current battery level as SDL_JoystickPowerLevel on success or - * `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown + * `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown. * * \since This function is available since SDL 2.0.4. */ diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index e7663fb34ced6..8a3ff4a6e391a 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_keyboard.h + * # CategoryKeyboard * - * Include file for SDL keyboard event handling + * Include file for SDL keyboard event handling */ #ifndef SDL_keyboard_h_ @@ -40,15 +40,16 @@ extern "C" { #endif /** - * \brief The SDL keysym structure, used in key events. + * The SDL keysym structure, used in key events. * - * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + * If you are looking for translated character input, see the SDL_TEXTINPUT + * event. */ typedef struct SDL_Keysym { - SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ - Uint16 mod; /**< current key modifiers */ + SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers - see SDL_Keymod for details */ Uint32 unused; } SDL_Keysym; @@ -84,7 +85,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * Note: This function doesn't take into account whether shift has been * pressed or not. * - * \param numkeys if non-NULL, receives the length of the returned array + * \param numkeys if non-NULL, receives the length of the returned array. * \returns a pointer to an array of key states. * * \since This function is available since SDL 2.0.0. @@ -129,7 +130,7 @@ extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); * This does not change the keyboard state, only the key modifier flags that * SDL reports. * - * \param modstate the desired SDL_Keymod for the keyboard + * \param modstate the desired SDL_Keymod for the keyboard. * * \since This function is available since SDL 2.0.0. * @@ -143,7 +144,7 @@ extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * * See SDL_Keycode for details. * - * \param scancode the desired SDL_Scancode to query + * \param scancode the desired SDL_Scancode to query. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 2.0.0. @@ -159,7 +160,7 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode * * See SDL_Scancode for details. * - * \param key the desired SDL_Keycode to query + * \param key the desired SDL_Keycode to query. * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. * * \since This function is available since SDL 2.0.0. @@ -183,7 +184,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); * unsuitable for creating a stable cross-platform two-way mapping between * strings and scancodes. * - * \param scancode the desired SDL_Scancode to query + * \param scancode the desired SDL_Scancode to query. * \returns a pointer to the name for the scancode. If the scancode doesn't * have a name this function returns an empty string (""). * @@ -197,7 +198,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); /** * Get a scancode from a human-readable name. * - * \param name the human-readable scancode name + * \param name the human-readable scancode name. * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't * recognized; call SDL_GetError() for more information. * @@ -214,7 +215,7 @@ extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); * * See SDL_Scancode and SDL_Keycode for details. * - * \param key the desired SDL_Keycode to query + * \param key the desired SDL_Keycode to query. * \returns a pointer to a UTF-8 string that stays valid at least until the * next call to this function. If you need it around any longer, you * must copy it. If the key doesn't have a name, this function @@ -231,7 +232,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); /** * Get a key code from a human-readable name. * - * \param name the human-readable key name + * \param name the human-readable key name. * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call * SDL_GetError() for more information. * @@ -253,6 +254,10 @@ extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * * On some platforms using this function activates the screen keyboard. * + * On desktop platforms, SDL_StartTextInput() is implicitly called on SDL + * video subsystem initialization which will cause SDL_TextInputEvent and + * SDL_TextEditingEvent to begin emitting. + * * \since This function is available since SDL 2.0.0. * * \sa SDL_SetTextInputRect @@ -293,6 +298,9 @@ extern DECLSPEC void SDLCALL SDL_ClearComposition(void); /** * Returns if an IME Composite or Candidate window is currently shown. * + * \returns SDL_TRUE if an IME Composite or Candidate window is currently + * shown else SDL_FALSE. + * * \since This function is available since SDL 2.0.22. */ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); @@ -300,6 +308,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); /** * Set the rectangle used to type Unicode text inputs. * + * Native input methods will place a window with word suggestions near it, + * without covering the text being inputted. + * * To start text input in a given location, this function is intended to be * called before SDL_StartTextInput, although some platforms support moving * the rectangle even while text input (and a composition) is active. @@ -309,7 +320,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); * any feedback. * * \param rect the SDL_Rect structure representing the rectangle to receive - * text (ignored if NULL) + * text (ignored if NULL). * * \since This function is available since SDL 2.0.0. * @@ -333,7 +344,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); /** * Check whether the screen keyboard is shown for given window. * - * \param window the window for which screen keyboard should be queried + * \param window the window for which screen keyboard should be queried. * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not. * * \since This function is available since SDL 2.0.0. diff --git a/include/SDL_keycode.h b/include/SDL_keycode.h index 65420f29fdcb3..3be801c3970fa 100644 --- a/include/SDL_keycode.h +++ b/include/SDL_keycode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_keycode.h + * # CategoryKeycode * - * Defines constants which identify keyboard keys and modifiers. + * Defines constants which identify keyboard keys and modifiers. */ #ifndef SDL_keycode_h_ @@ -32,22 +32,28 @@ #include "SDL_scancode.h" /** - * \brief The SDL virtual key representation. + * The SDL virtual key representation. * - * Values of this type are used to represent keyboard keys using the current - * layout of the keyboard. These values include Unicode values representing - * the unmodified character that would be generated by pressing the key, or - * an SDLK_* constant for those keys that do not generate characters. + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or an + * SDLK_* constant for those keys that do not generate characters. * - * A special exception is the number keys at the top of the keyboard which - * always map to SDLK_0...SDLK_9, regardless of layout. + * A special exception is the number keys at the top of the keyboard which map + * to SDLK_0...SDLK_9 on AZERTY layouts. + * + * The actual values that might be set for this type are listed in the + * SDL_KeyCode (capital C) enumeration. */ typedef Sint32 SDL_Keycode; #define SDLK_SCANCODE_MASK (1<<30) #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) -typedef enum +/** + * The possible values for keycodes. + */ +typedef enum SDL_KeyCode { SDLK_UNKNOWN = 0, @@ -327,9 +333,9 @@ typedef enum } SDL_KeyCode; /** - * \brief Enumeration of valid key mods (possibly OR'd together). + * Enumeration of valid key mods (possibly OR'd together). */ -typedef enum +typedef enum SDL_Keymod { KMOD_NONE = 0x0000, KMOD_LSHIFT = 0x0001, diff --git a/include/SDL_loadso.h b/include/SDL_loadso.h index 61857c813764a..1763b5280123e 100644 --- a/include/SDL_loadso.h +++ b/include/SDL_loadso.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,23 +19,25 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: LoadSO */ + /** - * \file SDL_loadso.h - * - * System dependent library loading routines - * - * Some things to keep in mind: - * \li These functions only work on C function names. Other languages may - * have name mangling and intrinsic language support that varies from - * compiler to compiler. - * \li Make sure you declare your function pointers with the same calling - * convention as the actual library function. Your code will crash - * mysteriously if you do not do this. - * \li Avoid namespace collisions. If you load a symbol from the library, - * it is not defined whether or not it goes into the global symbol - * namespace for the application. If it does and it conflicts with - * symbols in your code or other shared libraries, you will not get - * the results you expect. :) + * # CategoryLoadSO + * + * System-dependent library loading routines. + * + * Some things to keep in mind: + * + * - These functions only work on C function names. Other languages may have + * name mangling and intrinsic language support that varies from compiler to + * compiler. + * - Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * - Avoid namespace collisions. If you load a symbol from the library, it is + * not defined whether or not it goes into the global symbol namespace for + * the application. If it does and it conflicts with symbols in your code or + * other shared libraries, you will not get the results you expect. :) */ #ifndef SDL_loadso_h_ @@ -53,7 +55,7 @@ extern "C" { /** * Dynamically load a shared object. * - * \param sofile a system-dependent name of the object file + * \param sofile a system-dependent name of the object file. * \returns an opaque pointer to the object handle or NULL if there was an * error; call SDL_GetError() for more information. * @@ -79,8 +81,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); * * If the requested function doesn't exist, NULL is returned. * - * \param handle a valid shared object handle returned by SDL_LoadObject() - * \param name the name of the function to look up + * \param handle a valid shared object handle returned by SDL_LoadObject(). + * \param name the name of the function to look up. * \returns a pointer to the function or NULL if there was an error; call * SDL_GetError() for more information. * @@ -95,7 +97,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, /** * Unload a shared object from memory. * - * \param handle a valid shared object handle returned by SDL_LoadObject() + * \param handle a valid shared object handle returned by SDL_LoadObject(). * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_locale.h b/include/SDL_locale.h index 7515779947529..8126efc79a5bd 100644 --- a/include/SDL_locale.h +++ b/include/SDL_locale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_locale.h + * # CategoryLocale * - * Include file for SDL locale services + * Include file for SDL locale services */ #ifndef _SDL_locale_h diff --git a/include/SDL_log.h b/include/SDL_log.h index 1d8b20b62c5e2..6ce974a087284 100644 --- a/include/SDL_log.h +++ b/include/SDL_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,18 +20,19 @@ */ /** - * \file SDL_log.h + * # CategoryLog * - * Simple log messages with categories and priorities. + * Simple log messages with categories and priorities. * - * By default logs are quiet, but if you're debugging SDL you might want: + * By default logs are quiet, but if you're debugging SDL you might want: * - * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); * - * Here's where the messages go on different platforms: - * Windows: debug output stream - * Android: log output - * Others: standard error output (stderr) + * Here's where the messages go on different platforms: + * + * - Windows: debug output stream + * - Android: log output + * - Others: standard error output (stderr) */ #ifndef SDL_log_h_ @@ -47,21 +48,20 @@ extern "C" { /** - * \brief The maximum size of a log message prior to SDL 2.0.24 + * The maximum size of a log message prior to SDL 2.0.24 * - * As of 2.0.24 there is no limit to the length of SDL log messages. + * As of 2.0.24 there is no limit to the length of SDL log messages. */ #define SDL_MAX_LOG_MESSAGE 4096 /** - * \brief The predefined log categories + * The predefined log categories * - * By default the application category is enabled at the INFO level, - * the assert category is enabled at the WARN level, test is enabled - * at the VERBOSE level and all other categories are enabled at the - * CRITICAL level. + * By default the application category is enabled at the INFO level, the + * assert category is enabled at the WARN level, test is enabled at the + * VERBOSE level and all other categories are enabled at the ERROR level. */ -typedef enum +typedef enum SDL_LogCategory { SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_CATEGORY_ERROR, @@ -97,9 +97,9 @@ typedef enum } SDL_LogCategory; /** - * \brief The predefined log priorities + * The predefined log priorities */ -typedef enum +typedef enum SDL_LogPriority { SDL_LOG_PRIORITY_VERBOSE = 1, SDL_LOG_PRIORITY_DEBUG, @@ -114,7 +114,7 @@ typedef enum /** * Set the priority of all log categories. * - * \param priority the SDL_LogPriority to assign + * \param priority the SDL_LogPriority to assign. * * \since This function is available since SDL 2.0.0. * @@ -125,8 +125,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); /** * Set the priority of a particular log category. * - * \param category the category to assign a priority to - * \param priority the SDL_LogPriority to assign + * \param category the category to assign a priority to. + * \param priority the SDL_LogPriority to assign. * * \since This function is available since SDL 2.0.0. * @@ -139,8 +139,8 @@ extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, /** * Get the priority of a particular log category. * - * \param category the category to query - * \returns the SDL_LogPriority for the requested category + * \param category the category to query. + * \returns the SDL_LogPriority for the requested category. * * \since This function is available since SDL 2.0.0. * @@ -163,10 +163,9 @@ extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); /** * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. * - * = * \param fmt a printf() style message format string - * + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the `fmt` string, if - * any + * any. * * \since This function is available since SDL 2.0.0. * @@ -184,10 +183,10 @@ extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, . /** * Log a message with SDL_LOG_PRIORITY_VERBOSE. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -205,10 +204,10 @@ extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRI /** * Log a message with SDL_LOG_PRIORITY_DEBUG. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -226,10 +225,10 @@ extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING /** * Log a message with SDL_LOG_PRIORITY_INFO. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -247,10 +246,10 @@ extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING /** * Log a message with SDL_LOG_PRIORITY_WARN. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -268,10 +267,10 @@ extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING /** * Log a message with SDL_LOG_PRIORITY_ERROR. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -289,10 +288,10 @@ extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING /** * Log a message with SDL_LOG_PRIORITY_CRITICAL. * - * \param category the category of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -310,11 +309,11 @@ extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STR /** * Log a message with the specified category and priority. * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string + * \param category the category of the message. + * \param priority the priority of the message. + * \param fmt a printf() style message format string. * \param ... additional parameters matching % tokens in the **fmt** string, - * if any + * if any. * * \since This function is available since SDL 2.0.0. * @@ -334,10 +333,10 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, /** * Log a message with the specified category and priority. * - * \param category the category of the message - * \param priority the priority of the message - * \param fmt a printf() style message format string - * \param ap a variable argument list + * \param category the category of the message. + * \param priority the priority of the message. + * \param fmt a printf() style message format string. + * \param ap a variable argument list. * * \since This function is available since SDL 2.0.0. * @@ -352,17 +351,18 @@ extern DECLSPEC void SDLCALL SDL_LogMessage(int category, */ extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, SDL_LogPriority priority, - const char *fmt, va_list ap); + SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); /** * The prototype for the log output callback function. * * This function is called by SDL when there is new text to be logged. * - * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction() - * \param category the category of the message - * \param priority the priority of the message - * \param message the message being output + * \param userdata what was passed as `userdata` to + * SDL_LogSetOutputFunction(). + * \param category the category of the message. + * \param priority the priority of the message. + * \param message the message being output. */ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); @@ -370,9 +370,9 @@ typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_ * Get the current log output function. * * \param callback an SDL_LogOutputFunction filled in with the current log - * callback + * callback. * \param userdata a pointer filled in with the pointer that is passed to - * `callback` + * `callback`. * * \since This function is available since SDL 2.0.0. * @@ -383,8 +383,8 @@ extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *cal /** * Replace the default log output function with one of your own. * - * \param callback an SDL_LogOutputFunction to call instead of the default - * \param userdata a pointer that is passed to `callback` + * \param callback an SDL_LogOutputFunction to call instead of the default. + * \param userdata a pointer that is passed to `callback`. * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_main.h b/include/SDL_main.h index 113d11de06a5f..53be70e5d9009 100644 --- a/include/SDL_main.h +++ b/include/SDL_main.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,9 +25,9 @@ #include "SDL_stdinc.h" /** - * \file SDL_main.h + * # CategoryMain * - * Redefine main() on some platforms so that it is called by SDL. + * Redefine main() on some platforms so that it is called by SDL. */ #ifndef SDL_MAIN_HANDLED @@ -129,14 +129,14 @@ * * The application's main() function must be called with C linkage, * and should be declared like this: - * \code + * ```c * #ifdef __cplusplus * extern "C" * #endif * int main(int argc, char *argv[]) * { * } - * \endcode + * ``` */ #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) @@ -149,7 +149,7 @@ extern "C" { #endif /** - * The prototype for the application's main() function + * The prototype for the application's main() function */ typedef int (*SDL_main_func)(int argc, char *argv[]); extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); @@ -187,8 +187,8 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void); * \param name the window class name, in UTF-8 encoding. If NULL, SDL * currently uses "SDL_app" but this isn't guaranteed. * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL - * currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of - * what is specified here. + * currently uses `(CS_BYTEALIGNCLIENT \| CS_OWNDC)` regardless + * of what is specified here. * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL * will use `GetModuleHandle(NULL)` instead. * \returns 0 on success, -1 on error. SDL_GetError() may have details. @@ -222,8 +222,8 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); /** * Initialize and launch an SDL/WinRT application. * - * \param mainFunction the SDL app's C-style main(), an SDL_main_func - * \param reserved reserved for future use; should be NULL + * \param mainFunction the SDL app's C-style main(), an SDL_main_func. + * \param reserved reserved for future use; should be NULL. * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve * more information on the failure. * @@ -238,10 +238,10 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r /** * Initializes and launches an SDL application. * - * \param argc The argc parameter from the application's main() function - * \param argv The argv parameter from the application's main() function - * \param mainFunction The SDL app's C-style main(), an SDL_main_func - * \return the return value from mainFunction + * \param argc The argc parameter from the application's main() function. + * \param argv The argv parameter from the application's main() function. + * \param mainFunction The SDL app's C-style main(), an SDL_main_func. + * \return the return value from mainFunction. * * \since This function is available since SDL 2.0.10. */ @@ -254,8 +254,8 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun /** * Initialize and launch an SDL GDK application. * - * \param mainFunction the SDL app's C-style main(), an SDL_main_func - * \param reserved reserved for future use; should be NULL + * \param mainFunction the SDL app's C-style main(), an SDL_main_func. + * \param reserved reserved for future use; should be NULL. * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve * more information on the failure. * @@ -263,6 +263,13 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun */ extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved); +/** + * Callback from the application to let the suspend continue. + * + * \since This function is available since SDL 2.28.0. + */ +extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); + #endif /* __GDK__ */ #ifdef __cplusplus diff --git a/include/SDL_messagebox.h b/include/SDL_messagebox.h index d763534d216e9..725d4124adc2f 100644 --- a/include/SDL_messagebox.h +++ b/include/SDL_messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,9 +32,11 @@ extern "C" { #endif /** - * SDL_MessageBox flags. If supported will display warning icon, etc. + * SDL_MessageBox flags. + * + * If supported will display warning icon, etc. */ -typedef enum +typedef enum SDL_MessageBoxFlags { SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ @@ -46,7 +48,7 @@ typedef enum /** * Flags for SDL_MessageBoxButtonData. */ -typedef enum +typedef enum SDL_MessageBoxButtonFlags { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ @@ -55,9 +57,9 @@ typedef enum /** * Individual button data. */ -typedef struct +typedef struct SDL_MessageBoxButtonData { - Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + Uint32 flags; /**< SDL_MessageBoxButtonFlags */ int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ const char * text; /**< The UTF-8 button text */ } SDL_MessageBoxButtonData; @@ -65,12 +67,12 @@ typedef struct /** * RGB value used in a message box color scheme */ -typedef struct +typedef struct SDL_MessageBoxColor { Uint8 r, g, b; } SDL_MessageBoxColor; -typedef enum +typedef enum SDL_MessageBoxColorType { SDL_MESSAGEBOX_COLOR_BACKGROUND, SDL_MESSAGEBOX_COLOR_TEXT, @@ -83,7 +85,7 @@ typedef enum /** * A set of colors to use for message box dialogs */ -typedef struct +typedef struct SDL_MessageBoxColorScheme { SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; } SDL_MessageBoxColorScheme; @@ -91,9 +93,9 @@ typedef struct /** * MessageBox structure containing title, text, window, etc. */ -typedef struct +typedef struct SDL_MessageBoxData { - Uint32 flags; /**< ::SDL_MessageBoxFlags */ + Uint32 flags; /**< SDL_MessageBoxFlags */ SDL_Window *window; /**< Parent window, can be NULL */ const char *title; /**< UTF-8 title */ const char *message; /**< UTF-8 message text */ @@ -101,7 +103,7 @@ typedef struct int numbuttons; const SDL_MessageBoxButtonData *buttons; - const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ + const SDL_MessageBoxColorScheme *colorScheme; /**< SDL_MessageBoxColorScheme, can be NULL to use system settings */ } SDL_MessageBoxData; /** @@ -128,8 +130,9 @@ typedef struct * to stderr if you can. * * \param messageboxdata the SDL_MessageBoxData structure with title, text and - * other options - * \param buttonid the pointer to which user id of hit button should be copied + * other options. + * \param buttonid the pointer to which user id of hit button should be + * copied. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -168,10 +171,10 @@ extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *message * concern, check the return value from this function and fall back to writing * to stderr if you can. * - * \param flags an SDL_MessageBoxFlags value - * \param title UTF-8 title text - * \param message UTF-8 message text - * \param window the parent window, or NULL for no parent + * \param flags an SDL_MessageBoxFlags value. + * \param title UTF-8 title text. + * \param message UTF-8 message text. + * \param window the parent window, or NULL for no parent. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * diff --git a/include/SDL_metal.h b/include/SDL_metal.h index 92854710e434e..10b0d8db5a470 100644 --- a/include/SDL_metal.h +++ b/include/SDL_metal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,10 @@ */ /** - * \file SDL_metal.h + * # CategoryMetal * - * Header file for functions to creating Metal layers and views on SDL windows. + * Header file for functions to creating Metal layers and views on SDL + * windows. */ #ifndef SDL_metal_h_ @@ -37,9 +38,9 @@ extern "C" { #endif /** - * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). + * A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). * - * \note This can be cast directly to an NSView or UIView. + * This can be cast directly to an NSView or UIView. */ typedef void *SDL_MetalView; @@ -58,6 +59,9 @@ typedef void *SDL_MetalView; * The returned handle can be casted directly to a NSView or UIView. To access * the backing CAMetalLayer, call SDL_Metal_GetLayer(). * + * \param window the window. + * \returns handle NSView or UIView. + * * \since This function is available since SDL 2.0.12. * * \sa SDL_Metal_DestroyView @@ -71,6 +75,8 @@ extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was * called after SDL_CreateWindow. * + * \param view the SDL_MetalView object. + * * \since This function is available since SDL 2.0.12. * * \sa SDL_Metal_CreateView @@ -80,6 +86,9 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); /** * Get a pointer to the backing CAMetalLayer for the given view. * + * \param view the SDL_MetalView object. + * \returns a pointer. + * * \since This function is available since SDL 2.0.14. * * \sa SDL_Metal_CreateView @@ -90,9 +99,9 @@ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); * Get the size of a window's underlying drawable in pixels (for use with * setting viewport, scissor & etc). * - * \param window SDL_Window from which the drawable size should be queried - * \param w Pointer to variable for storing the width in pixels, may be NULL - * \param h Pointer to variable for storing the height in pixels, may be NULL + * \param window SDL_Window from which the drawable size should be queried. + * \param w Pointer to variable for storing the width in pixels, may be NULL. + * \param h Pointer to variable for storing the height in pixels, may be NULL. * * \since This function is available since SDL 2.0.14. * diff --git a/include/SDL_misc.h b/include/SDL_misc.h index 261b6b8713e01..86a82bc5d6ab0 100644 --- a/include/SDL_misc.h +++ b/include/SDL_misc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_misc.h + * # CategoryMisc * - * \brief Include file for SDL API functions that don't fit elsewhere. + * Include file for SDL API functions that don't fit elsewhere. */ #ifndef SDL_misc_h_ diff --git a/include/SDL_mouse.h b/include/SDL_mouse.h index b318c70383d55..628b7a2f835dd 100644 --- a/include/SDL_mouse.h +++ b/include/SDL_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_mouse.h + * # CategoryMouse * - * Include file for SDL mouse event handling. + * Include file for SDL mouse event handling. */ #ifndef SDL_mouse_h_ @@ -41,9 +41,9 @@ extern "C" { typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ /** - * \brief Cursor types for SDL_CreateSystemCursor(). + * Cursor types for SDL_CreateSystemCursor(). */ -typedef enum +typedef enum SDL_SystemCursor { SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ @@ -61,9 +61,9 @@ typedef enum } SDL_SystemCursor; /** - * \brief Scroll direction types for the Scroll event + * Scroll direction types for the Scroll event */ -typedef enum +typedef enum SDL_MouseWheelDirection { SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ @@ -90,9 +90,9 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); * either `x` or `y`. * * \param x the x coordinate of the mouse cursor position relative to the - * focus window + * focus window. * \param y the y coordinate of the mouse cursor position relative to the - * focus window + * focus window. * \returns a 32-bit button bitmask of the current button state. * * \since This function is available since SDL 2.0.0. @@ -120,9 +120,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); * reason to use this function, you probably want SDL_GetMouseState() instead. * * \param x filled in with the current X coord relative to the desktop; can be - * NULL + * NULL. * \param y filled in with the current Y coord relative to the desktop; can be - * NULL + * NULL. * \returns the current button state as a bitmask which can be tested using * the SDL_BUTTON(X) macros. * @@ -141,8 +141,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); * mouse deltas since the last call to SDL_GetRelativeMouseState() or since * event initialization. You can pass NULL for either `x` or `y`. * - * \param x a pointer filled with the last recorded x coordinate of the mouse - * \param y a pointer filled with the last recorded y coordinate of the mouse + * \param x a pointer filled with the last recorded x coordinate of the mouse. + * \param y a pointer filled with the last recorded y coordinate of the mouse. * \returns a 32-bit button bitmask of the relative button state. * * \since This function is available since SDL 2.0.0. @@ -162,9 +162,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); * mouse when used over Microsoft Remote Desktop. * * \param window the window to move the mouse into, or NULL for the current - * mouse focus - * \param x the x coordinate within the window - * \param y the y coordinate within the window + * mouse focus. + * \param x the x coordinate within the window. + * \param y the y coordinate within the window. * * \since This function is available since SDL 2.0.0. * @@ -184,8 +184,8 @@ extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, * Note that this function will appear to succeed, but not actually move the * mouse when used over Microsoft Remote Desktop. * - * \param x the x coordinate - * \param y the y coordinate + * \param x the x coordinate. + * \param y the y coordinate. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -198,13 +198,9 @@ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); /** * Set relative mouse mode. * - * While the mouse is in relative mode, the cursor is hidden, and the driver - * will try to report continuous motion in the current window. Only relative - * motion events will be delivered, the mouse position will not change. - * - * Note that this function will not be able to provide continuous relative - * motion when used over Microsoft Remote Desktop, instead motion is limited - * to the bounds of the screen. + * While the mouse is in relative mode, the cursor is hidden, the mouse + * position is constrained to the window, and SDL will report continuous + * relative mouse motion even if the mouse is at the edge of the window. * * This function will flush any pending mouse motion. * @@ -301,14 +297,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which * provides twelve readily available system cursors to pick from. * - * \param data the color value for each pixel of the cursor - * \param mask the mask value for each pixel of the cursor - * \param w the width of the cursor - * \param h the height of the cursor + * \param data the color value for each pixel of the cursor. + * \param mask the mask value for each pixel of the cursor. + * \param w the width of the cursor. + * \param h the height of the cursor. * \param hot_x the X-axis location of the upper left corner of the cursor - * relative to the actual mouse position + * relative to the actual mouse position. * \param hot_y the Y-axis location of the upper left corner of the cursor - * relative to the actual mouse position + * relative to the actual mouse position. * \returns a new cursor with the specified parameters on success or NULL on * failure; call SDL_GetError() for more information. * @@ -326,9 +322,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, /** * Create a color cursor. * - * \param surface an SDL_Surface structure representing the cursor image - * \param hot_x the x position of the cursor hot spot - * \param hot_y the y position of the cursor hot spot + * \param surface an SDL_Surface structure representing the cursor image. + * \param hot_x the x position of the cursor hot spot. + * \param hot_y the y position of the cursor hot spot. * \returns the new cursor on success or NULL on failure; call SDL_GetError() * for more information. * @@ -344,7 +340,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, /** * Create a system cursor. * - * \param id an SDL_SystemCursor enum value + * \param id an SDL_SystemCursor enum value. * \returns a cursor on success or NULL on failure; call SDL_GetError() for * more information. * @@ -362,7 +358,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if * this is desired for any reason. * - * \param cursor a cursor to make active + * \param cursor a cursor to make active. * * \since This function is available since SDL 2.0.0. * @@ -389,6 +385,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); /** * Get the default cursor. * + * You do not have to call SDL_FreeCursor() on the return value, but it is + * safe to do so. + * * \returns the default cursor on success or NULL on failure. * * \since This function is available since SDL 2.0.0. @@ -403,7 +402,7 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); * Use this function to free cursor resources created with SDL_CreateCursor(), * SDL_CreateColorCursor() or SDL_CreateSystemCursor(). * - * \param cursor the cursor to free + * \param cursor the cursor to free. * * \since This function is available since SDL 2.0.0. * @@ -438,9 +437,9 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); /** * Used as a mask when testing buttons in buttonstate. * - * - Button 1: Left mouse button - * - Button 2: Middle mouse button - * - Button 3: Right mouse button + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button */ #define SDL_BUTTON(X) (1 << ((X)-1)) #define SDL_BUTTON_LEFT 1 diff --git a/include/SDL_mutex.h b/include/SDL_mutex.h index 173468f6ace65..0fe3eb5a5f8c5 100644 --- a/include/SDL_mutex.h +++ b/include/SDL_mutex.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,14 +23,88 @@ #define SDL_mutex_h_ /** - * \file SDL_mutex.h + * # CategoryMutex * - * Functions to provide thread synchronization primitives. + * Functions to provide thread synchronization primitives. */ #include "SDL_stdinc.h" #include "SDL_error.h" +/******************************************************************************/ +/* Enable thread safety attributes only with clang. + * The attributes can be safely erased when compiling with other compilers. + */ +#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \ + defined(__clang__) && (!defined(SWIG)) +#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) +#else +#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) /* no-op */ +#endif + +#define SDL_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x)) + +#define SDL_SCOPED_CAPABILITY \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) + +#define SDL_GUARDED_BY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) + +#define SDL_PT_GUARDED_BY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) + +#define SDL_ACQUIRED_BEFORE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x)) + +#define SDL_ACQUIRED_AFTER(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x)) + +#define SDL_REQUIRES(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x)) + +#define SDL_REQUIRES_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x)) + +#define SDL_ACQUIRE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x)) + +#define SDL_ACQUIRE_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x)) + +#define SDL_RELEASE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x)) + +#define SDL_RELEASE_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x)) + +#define SDL_RELEASE_GENERIC(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x)) + +#define SDL_TRY_ACQUIRE(x, y) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y)) + +#define SDL_TRY_ACQUIRE_SHARED(x, y) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y)) + +#define SDL_EXCLUDES(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x)) + +#define SDL_ASSERT_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x)) + +#define SDL_ASSERT_SHARED_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x)) + +#define SDL_RETURN_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) + +#define SDL_NO_THREAD_SAFETY_ANALYSIS \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) + +/******************************************************************************/ + + #include "begin_code.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus @@ -38,13 +112,13 @@ extern "C" { #endif /** - * Synchronization functions which can time out return this value - * if they time out. + * Synchronization functions which can time out return this value if they time + * out. */ #define SDL_MUTEX_TIMEDOUT 1 /** - * This is the timeout value which corresponds to never time out. + * This is the timeout value which corresponds to never time out. */ #define SDL_MUTEX_MAXWAIT (~(Uint32)0) @@ -91,12 +165,12 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); * unlock it the same number of times before it is actually made available for * other threads in the system (this is known as a "recursive mutex"). * - * \param mutex the mutex to lock + * \param mutex the mutex to lock. * \return 0, or -1 on error. * * \since This function is available since SDL 2.0.0. */ -extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex); #define SDL_mutexP(m) SDL_LockMutex(m) /** @@ -108,7 +182,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); * This technique is useful if you need exclusive access to a resource but * don't want to wait for it, and will return to it to try again later. * - * \param mutex the mutex to try to lock + * \param mutex the mutex to try to lock. * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for * more information. * @@ -119,7 +193,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); * \sa SDL_LockMutex * \sa SDL_UnlockMutex */ -extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex); /** * Unlock the mutex. @@ -138,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); * * \since This function is available since SDL 2.0.0. */ -extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex); #define SDL_mutexV(m) SDL_UnlockMutex(m) /** @@ -150,7 +224,7 @@ extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); * to destroy a locked mutex, and may result in undefined behavior depending * on the platform. * - * \param mutex the mutex to destroy + * \param mutex the mutex to destroy. * * \since This function is available since SDL 2.0.0. * @@ -182,7 +256,7 @@ typedef struct SDL_semaphore SDL_sem; * is 0. Each post operation will atomically increment the semaphore value and * wake waiting threads and allow them to retry the wait operation. * - * \param initial_value the starting value of the semaphore + * \param initial_value the starting value of the semaphore. * \returns a new semaphore or NULL on failure; call SDL_GetError() for more * information. * @@ -203,7 +277,7 @@ extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); * It is not safe to destroy a semaphore if there are threads currently * waiting on it. * - * \param sem the semaphore to destroy + * \param sem the semaphore to destroy. * * \since This function is available since SDL 2.0.0. * @@ -227,7 +301,7 @@ extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); * This function is the equivalent of calling SDL_SemWaitTimeout() with a time * length of `SDL_MUTEX_MAXWAIT`. * - * \param sem the semaphore wait on + * \param sem the semaphore wait on. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -251,7 +325,7 @@ extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); * the semaphore doesn't have a positive value, the function immediately * returns SDL_MUTEX_TIMEDOUT. * - * \param sem the semaphore to wait on + * \param sem the semaphore to wait on. * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would * block, or a negative error code on failure; call SDL_GetError() * for more information. @@ -275,8 +349,8 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); * signal or error, or the specified time has elapsed. If the call is * successful it will atomically decrement the semaphore value. * - * \param sem the semaphore to wait on - * \param ms the length of the timeout, in milliseconds + * \param sem the semaphore to wait on. + * \param timeout the length of the timeout, in milliseconds. * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not * succeed in the allotted time, or a negative error code on failure; * call SDL_GetError() for more information. @@ -290,12 +364,12 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); * \sa SDL_SemValue * \sa SDL_SemWait */ -extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout); /** * Atomically increment a semaphore's value and wake waiting threads. * - * \param sem the semaphore to increment + * \param sem the semaphore to increment. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -313,7 +387,7 @@ extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); /** * Get the current value of a semaphore. * - * \param sem the semaphore to query + * \param sem the semaphore to query. * \returns the current value of the semaphore. * * \since This function is available since SDL 2.0.0. @@ -353,7 +427,7 @@ extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); /** * Destroy a condition variable. * - * \param cond the condition variable to destroy + * \param cond the condition variable to destroy. * * \since This function is available since SDL 2.0.0. * @@ -368,7 +442,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); /** * Restart one of the threads that are waiting on the condition variable. * - * \param cond the condition variable to signal + * \param cond the condition variable to signal. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -385,7 +459,7 @@ extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); /** * Restart all threads that are waiting on the condition variable. * - * \param cond the condition variable to signal + * \param cond the condition variable to signal. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -412,8 +486,8 @@ extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); * This function is the equivalent of calling SDL_CondWaitTimeout() with a * time length of `SDL_MUTEX_MAXWAIT`. * - * \param cond the condition variable to wait on - * \param mutex the mutex used to coordinate thread access + * \param cond the condition variable to wait on. + * \param mutex the mutex used to coordinate thread access. * \returns 0 when it is signaled or a negative error code on failure; call * SDL_GetError() for more information. * @@ -438,10 +512,10 @@ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); * * The mutex must be locked before calling this function. * - * \param cond the condition variable to wait on - * \param mutex the mutex used to coordinate thread access + * \param cond the condition variable to wait on. + * \param mutex the mutex used to coordinate thread access. * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT` - * to wait indefinitely + * to wait indefinitely. * \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if * the condition is not signaled in the allotted time, or a negative * error code on failure; call SDL_GetError() for more information. diff --git a/include/SDL_name.h b/include/SDL_name.h index 6ff35b46efe0d..0c48bcf315aae 100644 --- a/include/SDL_name.h +++ b/include/SDL_name.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/include/SDL_opengl.h b/include/SDL_opengl.h index 0f2b257abb9a1..c6250d131b7a0 100644 --- a/include/SDL_opengl.h +++ b/include/SDL_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,17 +19,11 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_opengl.h - * - * This is a simple file to encapsulate the OpenGL API headers. - */ - -/** - * \def NO_SDL_GLEXT +/* + * This is a simple file to encapsulate the OpenGL API headers. * - * Define this if you have your own version of glext.h and want to disable the - * version included in SDL_opengl.h. + * Define NO_SDL_GLEXT if you have your own version of glext.h and want + * to disable the version included in SDL_opengl.h. */ #ifndef SDL_opengl_h_ diff --git a/include/SDL_opengl_glext.h b/include/SDL_opengl_glext.h index 8527e1744f9d8..ff6ad12cef043 100644 --- a/include/SDL_opengl_glext.h +++ b/include/SDL_opengl_glext.h @@ -1,4 +1,8 @@ -#ifndef __gl_glext_h_ +/* SDL modified the include guard to be compatible with Mesa and Apple include guards: + * - Mesa uses: __gl_glext_h_ + * - Apple uses: __glext_h_ */ +#if !defined(__glext_h_) && !defined(__gl_glext_h_) +#define __glext_h_ 1 #define __gl_glext_h_ 1 #ifdef __cplusplus diff --git a/include/SDL_opengles.h b/include/SDL_opengles.h index 8511b9607f118..adf6ef782f739 100644 --- a/include/SDL_opengles.h +++ b/include/SDL_opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +19,10 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_opengles.h - * - * This is a simple file to encapsulate the OpenGL ES 1.X API headers. +/* + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. */ + #include "SDL_config.h" #ifdef __IPHONEOS__ diff --git a/include/SDL_opengles2.h b/include/SDL_opengles2.h index 172fcb3f4476a..5514197124a97 100644 --- a/include/SDL_opengles2.h +++ b/include/SDL_opengles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +19,10 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_opengles2.h - * - * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. +/* + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. */ + #include "SDL_config.h" #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) diff --git a/include/SDL_pixels.h b/include/SDL_pixels.h index 5d2c0c898217b..6f29811d337be 100644 --- a/include/SDL_pixels.h +++ b/include/SDL_pixels.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_pixels.h + * # CategoryPixels * - * Header for the enumerated pixel format definitions. + * Header for the enumerated pixel format definitions. */ #ifndef SDL_pixels_h_ @@ -61,7 +61,10 @@ typedef enum SDL_PIXELTYPE_ARRAYU16, SDL_PIXELTYPE_ARRAYU32, SDL_PIXELTYPE_ARRAYF16, - SDL_PIXELTYPE_ARRAYF32 + SDL_PIXELTYPE_ARRAYF32, + + /* This must be at the end of the list to avoid breaking the existing ABI */ + SDL_PIXELTYPE_INDEX2 } SDL_PixelType; /** Bitmap pixel order, high bit -> low bit. */ @@ -134,6 +137,7 @@ typedef enum #define SDL_ISPIXELFORMAT_INDEXED(format) \ (!SDL_ISPIXELFORMAT_FOURCC(format) && \ ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX2) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) @@ -177,6 +181,12 @@ typedef enum SDL_PIXELFORMAT_INDEX1MSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), + SDL_PIXELFORMAT_INDEX2LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, + 2, 0), + SDL_PIXELFORMAT_INDEX2MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, + 2, 0), SDL_PIXELFORMAT_INDEX4LSB = SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), @@ -276,11 +286,19 @@ typedef enum SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888, + SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888, + SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888, + SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888, #else SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888, + SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888, + SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888, + SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888, #endif SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ @@ -302,9 +320,10 @@ typedef enum } SDL_PixelFormatEnum; /** - * The bits of this structure can be directly reinterpreted as an integer-packed - * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888 - * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems). + * The bits of this structure can be directly reinterpreted as an + * integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format + * (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and + * SDL_PIXELFORMAT_RGBA8888 on big-endian systems). */ typedef struct SDL_Color { @@ -324,7 +343,30 @@ typedef struct SDL_Palette } SDL_Palette; /** - * \note Everything in the pixel format structure is read-only. + * A structure that contains pixel format information. + * + * Everything in the pixel format structure is read-only. + * + * A pixel format has either a palette or masks. If a palette is used `Rmask`, + * `Gmask`, `Bmask`, and `Amask` will be 0. + * + * An SDL_PixelFormat describes the format of the pixel data stored at the + * `pixels` field of an SDL_Surface. Every surface stores an SDL_PixelFormat + * in the `format` field. + * + * If you wish to do pixel level modifications on a surface, then + * understanding how SDL stores its color information is essential. + * + * For information on modern pixel color spaces, see the following Wikipedia + * article: http://en.wikipedia.org/wiki/RGBA_color_space + * + * \sa SDL_ConvertSurface + * \sa SDL_GetRGB + * \sa SDL_GetRGBA + * \sa SDL_MapRGB + * \sa SDL_MapRGBA + * \sa SDL_AllocFormat + * \sa SDL_FreeFormat */ typedef struct SDL_PixelFormat { @@ -352,7 +394,7 @@ typedef struct SDL_PixelFormat /** * Get the human readable name of a pixel format. * - * \param format the pixel format to query + * \param format the pixel format to query. * \returns the human readable name of the specified pixel format or * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. * @@ -363,12 +405,12 @@ extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); /** * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. * - * \param format one of the SDL_PixelFormatEnum values - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask a pointer filled in with the red mask for the format - * \param Gmask a pointer filled in with the green mask for the format - * \param Bmask a pointer filled in with the blue mask for the format - * \param Amask a pointer filled in with the alpha mask for the format + * \param format one of the SDL_PixelFormatEnum values. + * \param bpp a bits per pixel value; usually 15, 16, or 32. + * \param Rmask a pointer filled in with the red mask for the format. + * \param Gmask a pointer filled in with the green mask for the format. + * \param Bmask a pointer filled in with the blue mask for the format. + * \param Amask a pointer filled in with the alpha mask for the format. * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't * possible; call SDL_GetError() for more information. * @@ -389,12 +431,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't * possible. * - * \param bpp a bits per pixel value; usually 15, 16, or 32 - * \param Rmask the red mask for the format - * \param Gmask the green mask for the format - * \param Bmask the blue mask for the format - * \param Amask the alpha mask for the format - * \returns one of the SDL_PixelFormatEnum values + * \param bpp a bits per pixel value; usually 15, 16, or 32. + * \param Rmask the red mask for the format. + * \param Gmask the green mask for the format. + * \param Bmask the blue mask for the format. + * \param Amask the alpha mask for the format. + * \returns one of the SDL_PixelFormatEnum values. * * \since This function is available since SDL 2.0.0. * @@ -413,7 +455,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, * allocated), and hence should not be modified, especially the palette. Weird * errors such as `Blit combination not supported` may occur. * - * \param pixel_format one of the SDL_PixelFormatEnum values + * \param pixel_format one of the SDL_PixelFormatEnum values. * \returns the new SDL_PixelFormat structure or NULL on failure; call * SDL_GetError() for more information. * @@ -426,7 +468,7 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); /** * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat(). * - * \param format the SDL_PixelFormat structure to free + * \param format the SDL_PixelFormat structure to free. * * \since This function is available since SDL 2.0.0. * @@ -439,7 +481,7 @@ extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); * * The palette entries are initialized to white. * - * \param ncolors represents the number of color entries in the color palette + * \param ncolors represents the number of color entries in the color palette. * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if * there wasn't enough memory); call SDL_GetError() for more * information. @@ -453,8 +495,8 @@ extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); /** * Set the palette for a pixel format structure. * - * \param format the SDL_PixelFormat structure that will use the palette - * \param palette the SDL_Palette structure that will be used + * \param format the SDL_PixelFormat structure that will use the palette. + * \param palette the SDL_Palette structure that will be used. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -469,10 +511,10 @@ extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, /** * Set a range of colors in a palette. * - * \param palette the SDL_Palette structure to modify - * \param colors an array of SDL_Color structures to copy into the palette - * \param firstcolor the index of the first palette entry to modify - * \param ncolors the number of entries to modify + * \param palette the SDL_Palette structure to modify. + * \param colors an array of SDL_Color structures to copy into the palette. + * \param firstcolor the index of the first palette entry to modify. + * \param ncolors the number of entries to modify. * \returns 0 on success or a negative error code if not all of the colors * could be set; call SDL_GetError() for more information. * @@ -488,7 +530,7 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, /** * Free a palette created with SDL_AllocPalette(). * - * \param palette the SDL_Palette structure to be freed + * \param palette the SDL_Palette structure to be freed. * * \since This function is available since SDL 2.0.0. * @@ -514,11 +556,11 @@ extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); * format the return value can be assigned to a Uint16, and similarly a Uint8 * for an 8-bpp format). * - * \param format an SDL_PixelFormat structure describing the pixel format - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \returns a pixel value + * \param format an SDL_PixelFormat structure describing the pixel format. + * \param r the red component of the pixel in the range 0-255. + * \param g the green component of the pixel in the range 0-255. + * \param b the blue component of the pixel in the range 0-255. + * \returns a pixel value. * * \since This function is available since SDL 2.0.0. * @@ -548,12 +590,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, * for an 8-bpp format). * * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r the red component of the pixel in the range 0-255 - * \param g the green component of the pixel in the range 0-255 - * \param b the blue component of the pixel in the range 0-255 - * \param a the alpha component of the pixel in the range 0-255 - * \returns a pixel value + * pixel. + * \param r the red component of the pixel in the range 0-255. + * \param g the green component of the pixel in the range 0-255. + * \param b the blue component of the pixel in the range 0-255. + * \param a the alpha component of the pixel in the range 0-255. + * \returns a pixel value. * * \since This function is available since SDL 2.0.0. * @@ -573,12 +615,12 @@ extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). * - * \param pixel a pixel value + * \param pixel a pixel value. * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component + * pixel. + * \param r a pointer filled in with the red component. + * \param g a pointer filled in with the green component. + * \param b a pointer filled in with the blue component. * * \since This function is available since SDL 2.0.0. * @@ -601,13 +643,13 @@ extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, * If the surface has no alpha component, the alpha will be returned as 0xff * (100% opaque). * - * \param pixel a pixel value + * \param pixel a pixel value. * \param format an SDL_PixelFormat structure describing the format of the - * pixel - * \param r a pointer filled in with the red component - * \param g a pointer filled in with the green component - * \param b a pointer filled in with the blue component - * \param a a pointer filled in with the alpha component + * pixel. + * \param r a pointer filled in with the red component. + * \param g a pointer filled in with the green component. + * \param b a pointer filled in with the blue component. + * \param a a pointer filled in with the alpha component. * * \since This function is available since SDL 2.0.0. * @@ -623,8 +665,8 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, /** * Calculate a 256 entry gamma ramp for a gamma value. * - * \param gamma a gamma value where 0.0 is black and 1.0 is identity - * \param ramp an array of 256 values filled in with the gamma ramp + * \param gamma a gamma value where 0.0 is black and 1.0 is identity. + * \param ramp an array of 256 values filled in with the gamma ramp. * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_platform.h b/include/SDL_platform.h index a8e3ac225ec7b..64ece4fe70ace 100644 --- a/include/SDL_platform.h +++ b/include/SDL_platform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_platform.h + * # CategoryPlatform * - * Try to get a standard set of platform defines. + * Try to get a standard set of platform defines. */ #ifndef SDL_platform_h_ @@ -73,7 +73,13 @@ #if defined(__APPLE__) /* lets us know what version of Mac OS X we're compiling on */ #include +#ifndef __has_extension /* Older compilers don't support this */ +#define __has_extension(x) 0 #include +#undef __has_extension +#else +#include +#endif /* Fix building with older SDKs that don't define these See this for more information: @@ -166,6 +172,12 @@ #define WINAPI_FAMILY_WINRT 0 #endif /* HAVE_WINAPIFAMILY_H */ +#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP) +#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +#else +#define SDL_WINAPI_FAMILY_PHONE 0 +#endif + #if WINAPI_FAMILY_WINRT #undef __WINRT__ #define __WINRT__ 1 @@ -193,8 +205,10 @@ #undef __GDK__ #define __GDK__ 1 #endif -#if defined(__PSP__) +#if defined(__PSP__) || defined(__psp__) +#ifdef __PSP__ #undef __PSP__ +#endif #define __PSP__ 1 #endif #if defined(PS2) diff --git a/include/SDL_power.h b/include/SDL_power.h index ecb3f4b023439..755c5d42a391a 100644 --- a/include/SDL_power.h +++ b/include/SDL_power.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,9 +23,9 @@ #define SDL_power_h_ /** - * \file SDL_power.h + * # CategoryPower * - * Header for the SDL power management routines. + * Header for the SDL power management routines. */ #include "SDL_stdinc.h" @@ -37,9 +37,9 @@ extern "C" { #endif /** - * The basic state for the system's power supply. + * The basic state for the system's power supply. */ -typedef enum +typedef enum SDL_PowerState { SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ @@ -48,7 +48,6 @@ typedef enum SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ } SDL_PowerState; - /** * Get the current power supply details. * @@ -65,17 +64,17 @@ typedef enum * It's possible a platform can only report battery percentage or time left * but not both. * - * \param secs seconds of battery life left, you can pass a NULL here if you - * don't care, will return -1 if we can't determine a value, or - * we're not running on a battery - * \param pct percentage of battery life left, between 0 and 100, you can pass - * a NULL here if you don't care, will return -1 if we can't - * determine a value, or we're not running on a battery + * \param seconds seconds of battery life left, you can pass a NULL here if + * you don't care, will return -1 if we can't determine a + * value, or we're not running on a battery. + * \param percent percentage of battery life left, between 0 and 100, you can + * pass a NULL here if you don't care, will return -1 if we + * can't determine a value, or we're not running on a battery. * \returns an SDL_PowerState enum representing the current battery state. * * \since This function is available since SDL 2.0.0. */ -extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL_quit.h b/include/SDL_quit.h index 4090f7f19ba24..03630e232b4ad 100644 --- a/include/SDL_quit.h +++ b/include/SDL_quit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,20 @@ */ /** - * \file SDL_quit.h + * # CategoryQuit * - * Include file for SDL quit event handling. + * An SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. If + * it is not ignored or filtered, it is queued normally and the window is + * allowed to close. When the window is closed, screen updates will complete, + * but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and + * SIGTERM (system termination request), if handlers do not already exist, + * that generate SDL_QUIT events as well. There is no way to determine the + * cause of an SDL_QUIT event, but setting a signal handler in your + * application will override the default generation of quit events for that + * signal. */ #ifndef SDL_quit_h_ @@ -31,25 +42,6 @@ #include "SDL_stdinc.h" #include "SDL_error.h" -/** - * \file SDL_quit.h - * - * An ::SDL_QUIT event is generated when the user tries to close the application - * window. If it is ignored or filtered out, the window will remain open. - * If it is not ignored or filtered, it is queued normally and the window - * is allowed to close. When the window is closed, screen updates will - * complete, but have no effect. - * - * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) - * and SIGTERM (system termination request), if handlers do not already - * exist, that generate ::SDL_QUIT events as well. There is no way - * to determine the cause of an ::SDL_QUIT event, but setting a signal - * handler in your application will override the default generation of - * quit events for that signal. - * - * \sa SDL_Quit() - */ - /* There are no functions directly affecting the quit event */ #define SDL_QuitRequested() \ diff --git a/include/SDL_rect.h b/include/SDL_rect.h index 6c641c581c521..e2a4b485d0d0a 100644 --- a/include/SDL_rect.h +++ b/include/SDL_rect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_rect.h + * # CategoryRect * - * Header file for SDL_rect definition and management functions. + * Header file for SDL_rect definition and management functions. */ #ifndef SDL_rect_h_ @@ -106,6 +106,10 @@ typedef struct SDL_FRect /** * Returns true if point resides inside a rectangle. + * + * \param p the point to test. + * \param r the rectangle to test. + * \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise. */ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) { @@ -115,6 +119,9 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) /** * Returns true if the rectangle has no area. + * + * \param r the rectangle to test. + * \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise. */ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) { @@ -123,6 +130,10 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) /** * Returns true if the two rectangles are equal. + * + * \param a the first rectangle to test. + * \param b the second rectangle to test. + * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. */ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) { @@ -135,8 +146,8 @@ SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) * * If either pointer is NULL the function will return SDL_FALSE. * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle + * \param A an SDL_Rect structure representing the first rectangle. + * \param B an SDL_Rect structure representing the second rectangle. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -151,10 +162,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, * * If `result` is NULL then this function will return SDL_FALSE. * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle + * \param A an SDL_Rect structure representing the first rectangle. + * \param B an SDL_Rect structure representing the second rectangle. * \param result an SDL_Rect structure filled in with the intersection of - * rectangles `A` and `B` + * rectangles `A` and `B`. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -168,10 +179,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, /** * Calculate the union of two rectangles. * - * \param A an SDL_Rect structure representing the first rectangle - * \param B an SDL_Rect structure representing the second rectangle + * \param A an SDL_Rect structure representing the first rectangle. + * \param B an SDL_Rect structure representing the second rectangle. * \param result an SDL_Rect structure filled in with the union of rectangles - * `A` and `B` + * `A` and `B`. * * \since This function is available since SDL 2.0.0. */ @@ -186,11 +197,11 @@ extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, * considered. * * \param points an array of SDL_Point structures representing points to be - * enclosed - * \param count the number of structures in the `points` array - * \param clip an SDL_Rect used for clipping or NULL to enclose all points + * enclosed. + * \param count the number of structures in the `points` array. + * \param clip an SDL_Rect used for clipping or NULL to enclose all points. * \param result an SDL_Rect structure filled in with the minimal enclosing - * rectangle + * rectangle. * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the * points were outside of the clipping rectangle. * @@ -210,11 +221,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, * both ends will be clipped to the boundary of the rectangle and the new * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. * - * \param rect an SDL_Rect structure representing the rectangle to intersect - * \param X1 a pointer to the starting X-coordinate of the line - * \param Y1 a pointer to the starting Y-coordinate of the line - * \param X2 a pointer to the ending X-coordinate of the line - * \param Y2 a pointer to the ending Y-coordinate of the line + * \param rect an SDL_Rect structure representing the rectangle to intersect. + * \param X1 a pointer to the starting X-coordinate of the line. + * \param Y1 a pointer to the starting Y-coordinate of the line. + * \param X2 a pointer to the ending X-coordinate of the line. + * \param Y2 a pointer to the ending Y-coordinate of the line. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -229,6 +240,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * /** * Returns true if point resides inside a rectangle. + * + * \param p the point to test. + * \param r the rectangle to test. + * \returns SDL_TRUE if `p` is contained by `r`, SDL_FALSE otherwise. */ SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r) { @@ -238,6 +253,9 @@ SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect /** * Returns true if the rectangle has no area. + * + * \param r the rectangle to test. + * \returns SDL_TRUE if the rectangle is "empty", SDL_FALSE otherwise. */ SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r) { @@ -247,6 +265,11 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r) /** * Returns true if the two rectangles are equal, within some given epsilon. * + * \param a the first rectangle to test. + * \param b the second rectangle to test. + * \param epsilon the epsilon value for comparison. + * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. + * * \since This function is available since SDL 2.0.22. */ SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon) @@ -262,6 +285,10 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_F /** * Returns true if the two rectangles are equal, using a default epsilon. * + * \param a the first rectangle to test. + * \param b the second rectangle to test. + * \returns SDL_TRUE if the rectangles are equal, SDL_FALSE otherwise. + * * \since This function is available since SDL 2.0.22. */ SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b) @@ -274,8 +301,8 @@ SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b * * If either pointer is NULL the function will return SDL_FALSE. * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle + * \param A an SDL_FRect structure representing the first rectangle. + * \param B an SDL_FRect structure representing the second rectangle. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.22. @@ -290,10 +317,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A, * * If `result` is NULL then this function will return SDL_FALSE. * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle + * \param A an SDL_FRect structure representing the first rectangle. + * \param B an SDL_FRect structure representing the second rectangle. * \param result an SDL_FRect structure filled in with the intersection of - * rectangles `A` and `B` + * rectangles `A` and `B`. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.22. @@ -307,10 +334,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A, /** * Calculate the union of two rectangles with float precision. * - * \param A an SDL_FRect structure representing the first rectangle - * \param B an SDL_FRect structure representing the second rectangle + * \param A an SDL_FRect structure representing the first rectangle. + * \param B an SDL_FRect structure representing the second rectangle. * \param result an SDL_FRect structure filled in with the union of rectangles - * `A` and `B` + * `A` and `B`. * * \since This function is available since SDL 2.0.22. */ @@ -326,11 +353,11 @@ extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A, * considered. * * \param points an array of SDL_FPoint structures representing points to be - * enclosed - * \param count the number of structures in the `points` array - * \param clip an SDL_FRect used for clipping or NULL to enclose all points + * enclosed. + * \param count the number of structures in the `points` array. + * \param clip an SDL_FRect used for clipping or NULL to enclose all points. * \param result an SDL_FRect structure filled in with the minimal enclosing - * rectangle + * rectangle. * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the * points were outside of the clipping rectangle. * @@ -351,11 +378,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points, * both ends will be clipped to the boundary of the rectangle and the new * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. * - * \param rect an SDL_FRect structure representing the rectangle to intersect - * \param X1 a pointer to the starting X-coordinate of the line - * \param Y1 a pointer to the starting Y-coordinate of the line - * \param X2 a pointer to the ending X-coordinate of the line - * \param Y2 a pointer to the ending Y-coordinate of the line + * \param rect an SDL_FRect structure representing the rectangle to intersect. + * \param X1 a pointer to the starting X-coordinate of the line. + * \param Y1 a pointer to the starting Y-coordinate of the line. + * \param X2 a pointer to the ending X-coordinate of the line. + * \param Y2 a pointer to the ending Y-coordinate of the line. * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.22. diff --git a/include/SDL_render.h b/include/SDL_render.h index 5b7b059affc2c..26e372d60e1ce 100644 --- a/include/SDL_render.h +++ b/include/SDL_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,29 +20,31 @@ */ /** - * \file SDL_render.h + * # CategoryRender * - * Header file for SDL 2D rendering functions. + * Header file for SDL 2D rendering functions. * - * This API supports the following features: - * * single pixel points - * * single pixel lines - * * filled rectangles - * * texture images + * This API supports the following features: * - * The primitives may be drawn in opaque, blended, or additive modes. + * - single pixel points + * - single pixel lines + * - filled rectangles + * - texture images + * - 2D polygons * - * The texture images may be drawn in opaque, blended, or additive modes. - * They can have an additional color tint or alpha modulation applied to - * them, and may also be stretched with linear interpolation. + * The primitives may be drawn in opaque, blended, or additive modes. * - * This API is designed to accelerate simple 2D operations. You may - * want more functionality such as polygons and particle effects and - * in that case you should use SDL's OpenGL/Direct3D support or one - * of the many good 3D engines. + * The texture images may be drawn in opaque, blended, or additive modes. They + * can have an additional color tint or alpha modulation applied to them, and + * may also be stretched with linear interpolation. * - * These functions must be called from the main thread. - * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + * This API is designed to accelerate simple 2D operations. You may want more + * functionality such as 3D polygons and particle effects and in that case you + * should use SDL's OpenGL/Direct3D support or one of the many good 3D + * engines. + * + * These functions must be called from the main thread. See this bug for + * details: https://github.com/libsdl-org/SDL/issues/986 */ #ifndef SDL_render_h_ @@ -61,7 +63,7 @@ extern "C" { /** * Flags used when creating a rendering context */ -typedef enum +typedef enum SDL_RendererFlags { SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware @@ -78,7 +80,7 @@ typedef enum typedef struct SDL_RendererInfo { const char *name; /**< The name of the renderer */ - Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 flags; /**< Supported SDL_RendererFlags */ Uint32 num_texture_formats; /**< The number of available texture formats */ Uint32 texture_formats[16]; /**< The available texture formats */ int max_texture_width; /**< The maximum texture width */ @@ -86,7 +88,7 @@ typedef struct SDL_RendererInfo } SDL_RendererInfo; /** - * Vertex structure + * Vertex structure */ typedef struct SDL_Vertex { @@ -98,7 +100,7 @@ typedef struct SDL_Vertex /** * The scaling mode for a texture. */ -typedef enum +typedef enum SDL_ScaleMode { SDL_ScaleModeNearest, /**< nearest pixel sampling */ SDL_ScaleModeLinear, /**< linear filtering */ @@ -108,7 +110,7 @@ typedef enum /** * The access pattern allowed for a texture. */ -typedef enum +typedef enum SDL_TextureAccess { SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ @@ -118,7 +120,7 @@ typedef enum /** * The texture channel modulation used in SDL_RenderCopy(). */ -typedef enum +typedef enum SDL_TextureModulate { SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ @@ -128,7 +130,7 @@ typedef enum /** * Flip constants for SDL_RenderCopyEx */ -typedef enum +typedef enum SDL_RendererFlip { SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ @@ -171,9 +173,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); /** * Get info about a specific 2D rendering driver for the current display. * - * \param index the index of the driver to query information about + * \param index the index of the driver to query information about. * \param info an SDL_RendererInfo structure to be filled with information on - * the rendering driver + * the rendering driver. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -188,12 +190,12 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, /** * Create a window and default renderer. * - * \param width the width of the window - * \param height the height of the window + * \param width the width of the window. + * \param height the height of the window. * \param window_flags the flags used to create the window (see - * SDL_CreateWindow()) - * \param window a pointer filled with the window, or NULL on error - * \param renderer a pointer filled with the renderer, or NULL on error + * SDL_CreateWindow()). + * \param window a pointer filled with the window, or NULL on error. + * \param renderer a pointer filled with the renderer, or NULL on error. * \returns 0 on success, or -1 on error; call SDL_GetError() for more * information. * @@ -210,10 +212,10 @@ extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( /** * Create a 2D rendering context for a window. * - * \param window the window where rendering is displayed + * \param window the window where rendering is displayed. * \param index the index of the rendering driver to initialize, or -1 to - * initialize the first one supporting the requested flags - * \param flags 0, or one or more SDL_RendererFlags OR'd together + * initialize the first one supporting the requested flags. + * \param flags 0, or one or more SDL_RendererFlags OR'd together. * \returns a valid rendering context or NULL if there was an error; call * SDL_GetError() for more information. * @@ -236,14 +238,14 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, * SDL_Window as the final destination and not an SDL_Surface. * * \param surface the SDL_Surface structure representing the surface where - * rendering is done + * rendering is done. * \returns a valid rendering context or NULL if there was an error; call * SDL_GetError() for more information. * * \since This function is available since SDL 2.0.0. * * \sa SDL_CreateRenderer - * \sa SDL_CreateWindowRenderer + * \sa SDL_CreateWindowAndRenderer * \sa SDL_DestroyRenderer */ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); @@ -251,7 +253,7 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * /** * Get the renderer associated with a window. * - * \param window the window to query + * \param window the window to query. * \returns the rendering context on success or NULL on failure; call * SDL_GetError() for more information. * @@ -264,7 +266,7 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); /** * Get the window associated with a renderer. * - * \param renderer the renderer to query + * \param renderer the renderer to query. * \returns the window on success or NULL on failure; call SDL_GetError() for * more information. * @@ -275,9 +277,9 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer) /** * Get information about a rendering context. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param info an SDL_RendererInfo structure filled with information about the - * current renderer + * current renderer. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -295,9 +297,9 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, * has more pixels than the window that contains it, so use this instead of * SDL_GetWindowSize() to decide how much drawing area you have. * - * \param renderer the rendering context - * \param w an int filled with the width - * \param h an int filled with the height + * \param renderer the rendering context. + * \param w an int filled with the width. + * \param h an int filled with the height. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -314,11 +316,11 @@ extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, * You can set the texture scaling method by setting * `SDL_HINT_RENDER_SCALE_QUALITY` before creating the texture. * - * \param renderer the rendering context - * \param format one of the enumerated values in SDL_PixelFormatEnum - * \param access one of the enumerated values in SDL_TextureAccess - * \param w the width of the texture in pixels - * \param h the height of the texture in pixels + * \param renderer the rendering context. + * \param format one of the enumerated values in SDL_PixelFormatEnum. + * \param access one of the enumerated values in SDL_TextureAccess. + * \param w the width of the texture in pixels. + * \param h the height of the texture in pixels. * \returns a pointer to the created texture or NULL if no rendering context * was active, the format was unsupported, or the width or height * were out of range; call SDL_GetError() for more information. @@ -347,9 +349,9 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, * format of the surface. Use SDL_QueryTexture() to query the pixel format of * the texture. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param surface the SDL_Surface structure containing pixel data used to fill - * the texture + * the texture. * \returns the created texture or NULL on failure; call SDL_GetError() for * more information. * @@ -364,7 +366,7 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer /** * Query the attributes of a texture. * - * \param texture the texture to query + * \param texture the texture to query. * \param format a pointer filled in with the raw format of the texture; the * actual format may differ, but pixel transfers will use this * format (one of the SDL_PixelFormatEnum values). This argument @@ -399,10 +401,10 @@ extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, * Color modulation is not always supported by the renderer; it will return -1 * if color modulation is not supported. * - * \param texture the texture to update - * \param r the red color value multiplied into copy operations - * \param g the green color value multiplied into copy operations - * \param b the blue color value multiplied into copy operations + * \param texture the texture to update. + * \param r the red color value multiplied into copy operations. + * \param g the green color value multiplied into copy operations. + * \param b the blue color value multiplied into copy operations. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -418,10 +420,10 @@ extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, /** * Get the additional color value multiplied into render copy operations. * - * \param texture the texture to query - * \param r a pointer filled in with the current red color value - * \param g a pointer filled in with the current green color value - * \param b a pointer filled in with the current blue color value + * \param texture the texture to query. + * \param r a pointer filled in with the current red color value. + * \param g a pointer filled in with the current green color value. + * \param b a pointer filled in with the current blue color value. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -445,8 +447,8 @@ extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, * Alpha modulation is not always supported by the renderer; it will return -1 * if alpha modulation is not supported. * - * \param texture the texture to update - * \param alpha the source alpha value multiplied into copy operations + * \param texture the texture to update. + * \param alpha the source alpha value multiplied into copy operations. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -461,8 +463,8 @@ extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, /** * Get the additional alpha value multiplied into render copy operations. * - * \param texture the texture to query - * \param alpha a pointer filled in with the current alpha value + * \param texture the texture to query. + * \param alpha a pointer filled in with the current alpha value. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -480,8 +482,8 @@ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, * If the blend mode is not supported, the closest supported mode is chosen * and this function returns -1. * - * \param texture the texture to update - * \param blendMode the SDL_BlendMode to use for texture blending + * \param texture the texture to update. + * \param blendMode the SDL_BlendMode to use for texture blending. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -496,8 +498,8 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, /** * Get the blend mode used for texture copy operations. * - * \param texture the texture to query - * \param blendMode a pointer filled in with the current SDL_BlendMode + * \param texture the texture to query. + * \param blendMode a pointer filled in with the current SDL_BlendMode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -579,12 +581,12 @@ extern DECLSPEC void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture); * While this function will work with streaming textures, for optimization * reasons you may not get the pixels back if you lock the texture afterward. * - * \param texture the texture to update + * \param texture the texture to update. * \param rect an SDL_Rect structure representing the area to update, or NULL - * to update the entire texture - * \param pixels the raw pixel data in the format of the texture + * to update the entire texture. + * \param pixels the raw pixel data in the format of the texture. * \param pitch the number of bytes in a row of pixel data, including padding - * between lines + * between lines. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -606,18 +608,18 @@ extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, * block of Y and U/V planes in the proper order, but this function is * available if your pixel data is not contiguous. * - * \param texture the texture to update + * \param texture the texture to update. * \param rect a pointer to the rectangle of pixels to update, or NULL to - * update the entire texture - * \param Yplane the raw pixel data for the Y plane + * update the entire texture. + * \param Yplane the raw pixel data for the Y plane. * \param Ypitch the number of bytes between rows of pixel data for the Y - * plane - * \param Uplane the raw pixel data for the U plane + * plane. + * \param Uplane the raw pixel data for the U plane. * \param Upitch the number of bytes between rows of pixel data for the U - * plane - * \param Vplane the raw pixel data for the V plane + * plane. + * \param Vplane the raw pixel data for the V plane. * \param Vpitch the number of bytes between rows of pixel data for the V - * plane + * plane. * \returns 0 on success or -1 if the texture is not valid; call * SDL_GetError() for more information. * @@ -638,7 +640,7 @@ extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, * block of NV12/21 planes in the proper order, but this function is available * if your pixel data is not contiguous. * - * \param texture the texture to update + * \param texture the texture to update. * \param rect a pointer to the rectangle of pixels to update, or NULL to * update the entire texture. * \param Yplane the raw pixel data for the Y plane. @@ -668,13 +670,13 @@ extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture * texture, * changes. * * \param texture the texture to lock for access, which was created with - * `SDL_TEXTUREACCESS_STREAMING` + * `SDL_TEXTUREACCESS_STREAMING`. * \param rect an SDL_Rect structure representing the area to lock for access; - * NULL to lock the entire texture + * NULL to lock the entire texture. * \param pixels this is filled in with a pointer to the locked pixels, - * appropriately offset by the locked area + * appropriately offset by the locked area. * \param pitch this is filled in with the pitch of the locked pixels; the - * pitch is the length of one row in bytes + * pitch is the length of one row in bytes. * \returns 0 on success or a negative error code if the texture is not valid * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call * SDL_GetError() for more information. @@ -706,13 +708,13 @@ extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, * or SDL_DestroyTexture(). The caller should not free it. * * \param texture the texture to lock for access, which was created with - * `SDL_TEXTUREACCESS_STREAMING` + * `SDL_TEXTUREACCESS_STREAMING`. * \param rect a pointer to the rectangle to lock for access. If the rect is - * NULL, the entire texture will be locked + * NULL, the entire texture will be locked. * \param surface this is filled in with an SDL surface representing the - * locked area + * locked area. * \returns 0 on success, or -1 if the texture is not valid or was not created - * with `SDL_TEXTUREACCESS_STREAMING` + * with `SDL_TEXTUREACCESS_STREAMING`. * * \since This function is available since SDL 2.0.12. * @@ -734,7 +736,7 @@ extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, * Which is to say: locking and immediately unlocking a texture can result in * corrupted textures, depending on the renderer in use. * - * \param texture a texture locked by SDL_LockTexture() + * \param texture a texture locked by SDL_LockTexture(). * * \since This function is available since SDL 2.0.0. * @@ -745,7 +747,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); /** * Determine whether a renderer supports the use of render targets. * - * \param renderer the renderer that will be checked + * \param renderer the renderer that will be checked. * \returns SDL_TRUE if supported or SDL_FALSE if not. * * \since This function is available since SDL 2.0.0. @@ -763,9 +765,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *rendere * * The default render target is the window for which the renderer was created. * To stop rendering to a texture and render to the window again, call this - * function with a NULL `texture`. + * function with a NULL `texture`. This will reset the renderer's viewport, + * clipping rectangle, and scaling settings to the state they were in before + * setting a non-NULL `texture` target, losing any changes made in the + * meantime. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param texture the targeted texture, which must be created with the * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the * window instead of a texture. @@ -783,9 +788,9 @@ extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, * Get the current render target. * * The default render target is the window for which the renderer was created, - * and is reported a NULL here. + * and is reported as NULL here. * - * \param renderer the rendering context + * \param renderer the rendering context. * \returns the current render target or NULL for the default render target. * * \since This function is available since SDL 2.0.0. @@ -810,9 +815,9 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer * If this function results in scaling or subpixel drawing by the rendering * backend, it will be handled using the appropriate quality hints. * - * \param renderer the renderer for which resolution should be set - * \param w the width of the logical resolution - * \param h the height of the logical resolution + * \param renderer the renderer for which resolution should be set. + * \param w the width of the logical resolution. + * \param h the height of the logical resolution. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -833,9 +838,9 @@ extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, in * When using a target texture: Never return 0 for `w` and `h` at first. Then * it returns the logical width and height that are set. * - * \param renderer a rendering context - * \param w an int to be filled with the width - * \param h an int to be filled with the height + * \param renderer a rendering context. + * \param w an int to be filled with the width. + * \param h an int to be filled with the height. * * \since This function is available since SDL 2.0.0. * @@ -850,8 +855,8 @@ extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, i * when a resolution is between two multiples of a logical size, the viewport * size is rounded down to the lower multiple. * - * \param renderer the renderer for which integer scaling should be set - * \param enable enable or disable the integer scaling for rendering + * \param renderer the renderer for which integer scaling should be set. + * \param enable enable or disable the integer scaling for rendering. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -866,7 +871,7 @@ extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, /** * Get whether integer scales are forced for resolution-independent rendering. * - * \param renderer the renderer from which integer scaling should be queried + * \param renderer the renderer from which integer scaling should be queried. * \returns SDL_TRUE if integer scales are forced or SDL_FALSE if not and on * failure; call SDL_GetError() for more information. * @@ -882,9 +887,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * render * When the window is resized, the viewport is reset to fill the entire new * window size. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the drawing area, or NULL - * to set the viewport to the entire target + * to set the viewport to the entire target. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -898,8 +903,8 @@ extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, /** * Get the drawing area for the current target. * - * \param renderer the rendering context - * \param rect an SDL_Rect structure filled in with the current drawing area + * \param renderer the rendering context. + * \param rect an SDL_Rect structure filled in with the current drawing area. * * \since This function is available since SDL 2.0.0. * @@ -912,9 +917,9 @@ extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, * Set the clip rectangle for rendering on the specified target. * * \param renderer the rendering context for which clip rectangle should be - * set + * set. * \param rect an SDL_Rect structure representing the clip area, relative to - * the viewport, or NULL to disable clipping + * the viewport, or NULL to disable clipping. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -930,9 +935,9 @@ extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, * Get the clip rectangle for the current target. * * \param renderer the rendering context from which clip rectangle should be - * queried + * queried. * \param rect an SDL_Rect structure filled in with the current clipping area - * or an empty rectangle if clipping is disabled + * or an empty rectangle if clipping is disabled. * * \since This function is available since SDL 2.0.0. * @@ -945,7 +950,7 @@ extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, /** * Get whether clipping is enabled on the given renderer. * - * \param renderer the renderer from which clip state should be queried + * \param renderer the renderer from which clip state should be queried. * \returns SDL_TRUE if clipping is enabled or SDL_FALSE if not; call * SDL_GetError() for more information. * @@ -968,9 +973,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer * will be handled using the appropriate quality hints. For best results use * integer scaling factors. * - * \param renderer a rendering context - * \param scaleX the horizontal scaling factor - * \param scaleY the vertical scaling factor + * \param renderer a rendering context. + * \param scaleX the horizontal scaling factor. + * \param scaleY the vertical scaling factor. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -985,9 +990,9 @@ extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, /** * Get the drawing scale for the current target. * - * \param renderer the renderer from which drawing scale should be queried - * \param scaleX a pointer filled in with the horizontal scaling factor - * \param scaleY a pointer filled in with the vertical scaling factor + * \param renderer the renderer from which drawing scale should be queried. + * \param scaleX a pointer filled in with the horizontal scaling factor. + * \param scaleY a pointer filled in with the vertical scaling factor. * * \since This function is available since SDL 2.0.0. * @@ -1004,11 +1009,11 @@ extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, * and logical renderer size set * * \param renderer the renderer from which the logical coordinates should be - * calculated - * \param windowX the real X coordinate in the window - * \param windowY the real Y coordinate in the window - * \param logicalX the pointer filled with the logical x coordinate - * \param logicalY the pointer filled with the logical y coordinate + * calculated. + * \param windowX the real X coordinate in the window. + * \param windowY the real Y coordinate in the window. + * \param logicalX the pointer filled with the logical x coordinate. + * \param logicalY the pointer filled with the logical y coordinate. * * \since This function is available since SDL 2.0.18. * @@ -1030,11 +1035,11 @@ extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer, * and logical renderer size set * * \param renderer the renderer from which the window coordinates should be - * calculated - * \param logicalX the logical x coordinate - * \param logicalY the logical y coordinate - * \param windowX the pointer filled with the real X coordinate in the window - * \param windowY the pointer filled with the real Y coordinate in the window + * calculated. + * \param logicalX the logical x coordinate. + * \param logicalY the logical y coordinate. + * \param windowX the pointer filled with the real X coordinate in the window. + * \param windowY the pointer filled with the real Y coordinate in the window. * * \since This function is available since SDL 2.0.18. * @@ -1053,13 +1058,13 @@ extern DECLSPEC void SDLCALL SDL_RenderLogicalToWindow(SDL_Renderer * renderer, * Set the color for drawing or filling rectangles, lines, and points, and for * SDL_RenderClear(). * - * \param renderer the rendering context - * \param r the red value used to draw on the rendering target - * \param g the green value used to draw on the rendering target - * \param b the blue value used to draw on the rendering target + * \param renderer the rendering context. + * \param r the red value used to draw on the rendering target. + * \param g the green value used to draw on the rendering target. + * \param b the blue value used to draw on the rendering target. * \param a the alpha value used to draw on the rendering target; usually * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to - * specify how the alpha channel is used + * specify how the alpha channel is used. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1083,15 +1088,15 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, /** * Get the color used for drawing operations (Rect, Line and Clear). * - * \param renderer the rendering context + * \param renderer the rendering context. * \param r a pointer filled in with the red value used to draw on the - * rendering target + * rendering target. * \param g a pointer filled in with the green value used to draw on the - * rendering target + * rendering target. * \param b a pointer filled in with the blue value used to draw on the - * rendering target + * rendering target. * \param a a pointer filled in with the alpha value used to draw on the - * rendering target; usually `SDL_ALPHA_OPAQUE` (255) + * rendering target; usually `SDL_ALPHA_OPAQUE` (255). * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1108,8 +1113,8 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, * * If the blend mode is not supported, the closest supported mode is chosen. * - * \param renderer the rendering context - * \param blendMode the SDL_BlendMode to use for blending + * \param renderer the rendering context. + * \param blendMode the SDL_BlendMode to use for blending. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1131,8 +1136,8 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, /** * Get the blend mode used for drawing operations. * - * \param renderer the rendering context - * \param blendMode a pointer filled in with the current SDL_BlendMode + * \param renderer the rendering context. + * \param blendMode a pointer filled in with the current SDL_BlendMode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1149,7 +1154,7 @@ extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, * This function clears the entire rendering target, ignoring the viewport and * the clip rectangle. * - * \param renderer the rendering context + * \param renderer the rendering context. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1165,9 +1170,9 @@ extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); * SDL_RenderDrawPoint() draws a single point. If you want to draw multiple, * use SDL_RenderDrawPoints() instead. * - * \param renderer the rendering context - * \param x the x coordinate of the point - * \param y the y coordinate of the point + * \param renderer the rendering context. + * \param x the x coordinate of the point. + * \param y the y coordinate of the point. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1190,10 +1195,10 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, /** * Draw multiple points on the current rendering target. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param points an array of SDL_Point structures that represent the points to - * draw - * \param count the number of points to draw + * draw. + * \param count the number of points to draw. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1220,11 +1225,11 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, * SDL_RenderDrawLine() draws the line to include both end points. If you want * to draw multiple, connecting lines use SDL_RenderDrawLines() instead. * - * \param renderer the rendering context - * \param x1 the x coordinate of the start point - * \param y1 the y coordinate of the start point - * \param x2 the x coordinate of the end point - * \param y2 the y coordinate of the end point + * \param renderer the rendering context. + * \param x1 the x coordinate of the start point. + * \param y1 the y coordinate of the start point. + * \param x2 the x coordinate of the end point. + * \param y2 the y coordinate of the end point. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1247,10 +1252,10 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, /** * Draw a series of connected lines on the current rendering target. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param points an array of SDL_Point structures representing points along - * the lines - * \param count the number of points, drawing count-1 lines + * the lines. + * \param count the number of points, drawing count-1 lines. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1274,9 +1279,9 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, /** * Draw a rectangle on the current rendering target. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the rectangle to draw, or - * NULL to outline the entire rendering target + * NULL to outline the entire rendering target. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1299,10 +1304,10 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, /** * Draw some number of rectangles on the current rendering target. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rects an array of SDL_Rect structures representing the rectangles to - * be drawn - * \param count the number of rectangles + * be drawn. + * \param count the number of rectangles. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1330,9 +1335,9 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, * color's alpha value is ignored unless blending is enabled with the * appropriate call to SDL_SetRenderDrawBlendMode(). * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rect the SDL_Rect structure representing the rectangle to fill, or - * NULL for the entire rendering target + * NULL for the entire rendering target. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1356,10 +1361,10 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, * Fill some number of rectangles on the current rendering target with the * drawing color. * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rects an array of SDL_Rect structures representing the rectangles to - * be filled - * \param count the number of rectangles + * be filled. + * \param count the number of rectangles. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1390,12 +1395,13 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, * The texture alpha is affected based on its alpha modulation set by * SDL_SetTextureAlphaMod(). * - * \param renderer the rendering context - * \param texture the source texture - * \param srcrect the source SDL_Rect structure or NULL for the entire texture + * \param renderer the rendering context. + * \param texture the source texture. + * \param srcrect the source SDL_Rect structure or NULL for the entire + * texture. * \param dstrect the destination SDL_Rect structure or NULL for the entire * rendering target; the texture will be stretched to fill the - * given rectangle + * given rectangle. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1428,18 +1434,19 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, * The texture alpha is affected based on its alpha modulation set by * SDL_SetTextureAlphaMod(). * - * \param renderer the rendering context - * \param texture the source texture - * \param srcrect the source SDL_Rect structure or NULL for the entire texture + * \param renderer the rendering context. + * \param texture the source texture. + * \param srcrect the source SDL_Rect structure or NULL for the entire + * texture. * \param dstrect the destination SDL_Rect structure or NULL for the entire - * rendering target + * rendering target. * \param angle an angle in degrees that indicates the rotation that will be - * applied to dstrect, rotating it in a clockwise direction + * applied to dstrect, rotating it in a clockwise direction. * \param center a pointer to a point indicating the point around which * dstrect will be rotated (if NULL, rotation will be done - * around `dstrect.w / 2`, `dstrect.h / 2`) + * around `dstrect.w / 2`, `dstrect.h / 2`). * \param flip a SDL_RendererFlip value stating which flipping actions should - * be performed on the texture + * be performed on the texture. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1465,7 +1472,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, * \param renderer The renderer which should draw a point. * \param x The x coordinate of the point. * \param y The y coordinate of the point. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1476,9 +1483,9 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, * Draw multiple points on the current rendering target at subpixel precision. * * \param renderer The renderer which should draw multiple points. - * \param points The points to draw - * \param count The number of points to draw - * \return 0 on success, or -1 on error + * \param points The points to draw. + * \param count The number of points to draw. + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1494,7 +1501,7 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, * \param y1 The y coordinate of the start point. * \param x2 The x coordinate of the end point. * \param y2 The y coordinate of the end point. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1506,9 +1513,9 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, * subpixel precision. * * \param renderer The renderer which should draw multiple lines. - * \param points The points along the lines - * \param count The number of points, drawing count-1 lines - * \return 0 on success, or -1 on error + * \param points The points along the lines. + * \param count The number of points, drawing count-1 lines. + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1522,7 +1529,7 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, * \param renderer The renderer which should draw a rectangle. * \param rect A pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1536,7 +1543,7 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, * \param renderer The renderer which should draw multiple rectangles. * \param rects A pointer to an array of destination rectangles. * \param count The number of rectangles. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1551,7 +1558,7 @@ extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, * \param renderer The renderer which should fill a rectangle. * \param rect A pointer to the destination rectangle, or NULL for the entire * rendering target. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1565,7 +1572,7 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, * \param renderer The renderer which should fill multiple rectangles. * \param rects A pointer to an array of destination rectangles. * \param count The number of rectangles. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1583,7 +1590,7 @@ extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, * texture. * \param dstrect A pointer to the destination rectangle, or NULL for the * entire rendering target. - * \return 0 on success, or -1 on error + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1603,13 +1610,13 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, * \param dstrect A pointer to the destination rectangle, or NULL for the * entire rendering target. * \param angle An angle in degrees that indicates the rotation that will be - * applied to dstrect, rotating it in a clockwise direction + * applied to dstrect, rotating it in a clockwise direction. * \param center A pointer to a point indicating the point around which * dstrect will be rotated (if NULL, rotation will be done * around dstrect.w/2, dstrect.h/2). * \param flip An SDL_RendererFlip value stating which flipping actions should - * be performed on the texture - * \return 0 on success, or -1 on error + * be performed on the texture. + * \return 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.10. */ @@ -1634,7 +1641,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices Number of indices. - * \return 0 on success, or -1 if the operation is not supported + * \return 0 on success, or -1 if the operation is not supported. * * \since This function is available since SDL 2.0.18. * @@ -1653,18 +1660,18 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, * * \param renderer The rendering context. * \param texture (optional) The SDL texture to use. - * \param xy Vertex positions - * \param xy_stride Byte size to move from one element to the next element - * \param color Vertex colors (as SDL_Color) - * \param color_stride Byte size to move from one element to the next element - * \param uv Vertex normalized texture coordinates - * \param uv_stride Byte size to move from one element to the next element + * \param xy Vertex positions. + * \param xy_stride Byte size to move from one element to the next element. + * \param color Vertex colors (as SDL_Color). + * \param color_stride Byte size to move from one element to the next element. + * \param uv Vertex normalized texture coordinates. + * \param uv_stride Byte size to move from one element to the next element. * \param num_vertices Number of vertices. * \param indices (optional) An array of indices into the 'vertices' arrays, * if NULL all vertices will be rendered in sequential order. * \param num_indices Number of indices. - * \param size_indices Index size: 1 (byte), 2 (short), 4 (int) - * \return 0 on success, or -1 if the operation is not supported + * \param size_indices Index size: 1 (byte), 2 (short), 4 (int). + * \return 0 on success, or -1 if the operation is not supported. * * \since This function is available since SDL 2.0.18. * @@ -1693,13 +1700,13 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, * but it might contain additional padding (for example, 24bit RGB Windows * Bitmap data pads all rows to multiples of 4 bytes). * - * \param renderer the rendering context + * \param renderer the rendering context. * \param rect an SDL_Rect structure representing the area to read, or NULL - * for the entire render target + * for the entire render target. * \param format an SDL_PixelFormatEnum value of the desired format of the - * pixel data, or 0 to use the format of the rendering target - * \param pixels a pointer to the pixel data to copy into - * \param pitch the pitch of the `pixels` parameter + * pixel data, or 0 to use the format of the rendering target. + * \param pixels a pointer to the pixel data to copy into. + * \param pitch the pitch of the `pixels` parameter. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1729,10 +1736,16 @@ extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, * starting each new frame's drawing, even if you plan to overwrite every * pixel. * - * \param renderer the rendering context + * \param renderer the rendering context. + * + * \threadsafety You may only call this function on the main thread. If this + * happens to work on a background thread on any given platform + * or backend, it's purely by luck and you should not rely on it + * to work next time. * * \since This function is available since SDL 2.0.0. * + * \sa SDL_CreateRenderer * \sa SDL_RenderClear * \sa SDL_RenderDrawLine * \sa SDL_RenderDrawLines @@ -1753,7 +1766,7 @@ extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); * Passing NULL or an otherwise invalid texture will set the SDL error message * to "Invalid texture". * - * \param texture the texture to destroy + * \param texture the texture to destroy. * * \since This function is available since SDL 2.0.0. * @@ -1768,7 +1781,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); * If `renderer` is NULL, this function will return immediately after setting * the SDL error message to "Invalid renderer". See SDL_GetError(). * - * \param renderer the rendering context + * \param renderer the rendering context. * * \since This function is available since SDL 2.0.0. * @@ -1799,7 +1812,7 @@ extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); * and earlier, as earlier versions did not queue rendering commands at all, * instead flushing them to the OS immediately. * - * \param renderer the rendering context + * \param renderer the rendering context. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1830,11 +1843,11 @@ extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); * re-order the color channels in the shaders phase, so the uploaded texture * may have swapped color channels. * - * \param texture the texture to bind to the current OpenGL/ES/ES2 context + * \param texture the texture to bind to the current OpenGL/ES/ES2 context. * \param texw a pointer to a float value which will be filled with the - * texture width or NULL if you don't need that value + * texture width or NULL if you don't need that value. * \param texh a pointer to a float value which will be filled with the - * texture height or NULL if you don't need that value + * texture height or NULL if you don't need that value. * \returns 0 on success, or -1 if the operation is not supported; call * SDL_GetError() for more information. * @@ -1850,8 +1863,9 @@ extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw * * See SDL_GL_BindTexture() for examples on how to use these functions * - * \param texture the texture to unbind from the current OpenGL/ES/ES2 context - * \returns 0 on success, or -1 if the operation is not supported + * \param texture the texture to unbind from the current OpenGL/ES/ES2 + * context. + * \returns 0 on success, or -1 if the operation is not supported. * * \since This function is available since SDL 2.0.0. * @@ -1866,9 +1880,9 @@ extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); * This function returns `void *`, so SDL doesn't have to include Metal's * headers, but it can be safely cast to a `CAMetalLayer *`. * - * \param renderer The renderer to query + * \param renderer The renderer to query. * \returns a `CAMetalLayer *` on success, or NULL if the renderer isn't a - * Metal renderer + * Metal renderer. * * \since This function is available since SDL 2.0.8. * @@ -1885,9 +1899,9 @@ extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); * Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give * SDL a drawable to render to, which might happen if the window is * hidden/minimized/offscreen. This doesn't apply to command encoders for - * render targets, just the window's backbacker. Check your return values! + * render targets, just the window's backbuffer. Check your return values! * - * \param renderer The renderer to query + * \param renderer The renderer to query. * \returns an `id` on success, or NULL if the * renderer isn't a Metal renderer or there was an error. * @@ -1900,9 +1914,9 @@ extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * re /** * Toggle VSync of the given renderer. * - * \param renderer The renderer to toggle - * \param vsync 1 for on, 0 for off. All other values are reserved - * \returns a 0 int on success, or non-zero on failure + * \param renderer The renderer to toggle. + * \param vsync 1 for on, 0 for off. All other values are reserved. + * \returns a 0 int on success, or non-zero on failure. * * \since This function is available since SDL 2.0.18. */ diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h index 3960f567cbd98..43c1b0ec7776e 100644 --- a/include/SDL_rwops.h +++ b/include/SDL_rwops.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +19,13 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: RWOPS */ + /** - * \file SDL_rwops.h + * # CategoryRWOPS * - * This file provides a general interface for SDL to read and write - * data streams. It can easily be extended to files, memory, etc. + * This file provides a general interface for SDL to read and write data + * streams. It can easily be extended to files, memory, etc. */ #ifndef SDL_rwops_h_ @@ -57,7 +59,7 @@ typedef struct SDL_RWops Sint64 (SDLCALL * size) (struct SDL_RWops * context); /** - * Seek to \c offset relative to \c whence, one of stdio's whence values: + * Seek to `offset` relative to `whence`, one of stdio's whence values: * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END * * \return the final offset in the data stream, or -1 on error. @@ -66,8 +68,8 @@ typedef struct SDL_RWops int whence); /** - * Read up to \c maxnum objects each of size \c size from the data - * stream to the area pointed at by \c ptr. + * Read up to `maxnum` objects each of size `size` from the data + * stream to the area pointed at by `ptr`. * * \return the number of objects read, or 0 at error or end of file. */ @@ -75,8 +77,8 @@ typedef struct SDL_RWops size_t size, size_t maxnum); /** - * Write exactly \c num objects each of size \c size from the area - * pointed at by \c ptr to data stream. + * Write exactly `num` objects each of size `size` from the area + * pointed at by `ptr` to data stream. * * \return the number of objects written, or 0 at error or end of file. */ @@ -186,7 +188,7 @@ typedef struct SDL_RWops * * Closing the SDL_RWops will close the file handle SDL is holding internally. * - * \param file a UTF-8 string representing the filename to open + * \param file a UTF-8 string representing the filename to open. * \param mode an ASCII string representing the mode to be used for opening * the file. * \returns a pointer to the SDL_RWops structure that is created, or NULL on @@ -224,10 +226,10 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose); * `FILE*`, depending on what system headers are available to SDL. It is * always intended to be the `FILE*` type from the C runtime's stdio.h. * - * \param fp the `FILE*` that feeds the SDL_RWops stream + * \param fp the `FILE*` that feeds the SDL_RWops stream. * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops, * SDL_FALSE to leave the `FILE*` open when the RWops is - * closed + * closed. * \returns a pointer to the SDL_RWops structure that is created, or NULL on * failure; call SDL_GetError() for more information. * @@ -260,8 +262,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, * If you need to make sure the RWops never writes to the memory buffer, you * should use SDL_RWFromConstMem() with a read-only buffer of memory instead. * - * \param mem a pointer to a buffer to feed an SDL_RWops stream - * \param size the buffer size, in bytes + * \param mem a pointer to a buffer to feed an SDL_RWops stream. + * \param size the buffer size, in bytes. * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call * SDL_GetError() for more information. * @@ -295,8 +297,8 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); * If you need to write to a memory buffer, you should use SDL_RWFromMem() * with a writable buffer of memory instead. * - * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream - * \param size the buffer size, in bytes + * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream. + * \param size the buffer size, in bytes. * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call * SDL_GetError() for more information. * @@ -358,7 +360,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must * be responsible for managing that memory in their **close** method. * - * \param area the SDL_RWops structure to be freed + * \param area the SDL_RWops structure to be freed. * * \since This function is available since SDL 2.0.0. * @@ -366,6 +368,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); */ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); +/* Possible `whence` values for SDL_RWops seeking... */ #define RW_SEEK_SET 0 /**< Seek from the beginning of data */ #define RW_SEEK_CUR 1 /**< Seek relative to current read point */ #define RW_SEEK_END 2 /**< Seek relative to the end of data */ @@ -375,7 +378,7 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); * * Prior to SDL 2.0.10, this function was a macro. * - * \param context the SDL_RWops to get the size of the data stream from + * \param context the SDL_RWops to get the size of the data stream from. * \returns the size of the data stream in the SDL_RWops on success, -1 if * unknown or a negative error code on failure; call SDL_GetError() * for more information. @@ -402,10 +405,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); * * Prior to SDL 2.0.10, this function was a macro. * - * \param context a pointer to an SDL_RWops structure + * \param context a pointer to an SDL_RWops structure. * \param offset an offset in bytes, relative to **whence** location; can be - * negative - * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END` + * negative. + * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END`. * \returns the final offset in the data stream after the seek or -1 on error. * * \since This function is available since SDL 2.0.10. @@ -432,7 +435,7 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, * Prior to SDL 2.0.10, this function was a macro. * * \param context a SDL_RWops data stream object from which to get the current - * offset + * offset. * \returns the current offset in the stream, or -1 if the information can not * be determined. * @@ -462,10 +465,10 @@ extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); * * Prior to SDL 2.0.10, this function was a macro. * - * \param context a pointer to an SDL_RWops structure - * \param ptr a pointer to a buffer to read data into - * \param size the size of each object to read, in bytes - * \param maxnum the maximum number of objects to be read + * \param context a pointer to an SDL_RWops structure. + * \param ptr a pointer to a buffer to read data into. + * \param size the size of each object to read, in bytes. + * \param maxnum the maximum number of objects to be read. * \returns the number of objects read, or 0 at error or end of file; call * SDL_GetError() for more information. * @@ -496,10 +499,10 @@ extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, * * Prior to SDL 2.0.10, this function was a macro. * - * \param context a pointer to an SDL_RWops structure - * \param ptr a pointer to a buffer containing data to write - * \param size the size of an object to write, in bytes - * \param num the number of objects to write + * \param context a pointer to an SDL_RWops structure. + * \param ptr a pointer to a buffer containing data to write. + * \param size the size of an object to write, in bytes. + * \param num the number of objects to write. * \returns the number of objects written, which will be less than **num** on * error; call SDL_GetError() for more information. * @@ -530,7 +533,7 @@ extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, * * Prior to SDL 2.0.10, this function was a macro. * - * \param context SDL_RWops structure to close + * \param context SDL_RWops structure to close. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -555,9 +558,9 @@ extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); * * The data should be freed with SDL_free(). * - * \param src the SDL_RWops to read all available data from - * \param datasize if not NULL, will store the number of bytes read - * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning + * \param src the SDL_RWops to read all available data from. + * \param datasize if not NULL, will store the number of bytes read. + * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning. * \returns the data, or NULL if there was an error. * * \since This function is available since SDL 2.0.6. @@ -578,8 +581,8 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, * Prior to SDL 2.0.10, this function was a macro wrapping around * SDL_LoadFile_RW. * - * \param file the path to read all available data from - * \param datasize if not NULL, will store the number of bytes read + * \param file the path to read all available data from. + * \param datasize if not NULL, will store the number of bytes read. * \returns the data, or NULL if there was an error. * * \since This function is available since SDL 2.0.10. @@ -596,7 +599,7 @@ extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); /** * Use this function to read a byte from an SDL_RWops. * - * \param src the SDL_RWops to read from + * \param src the SDL_RWops to read from. * \returns the read byte on success or 0 on failure; call SDL_GetError() for * more information. * @@ -613,7 +616,7 @@ extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 16 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -629,7 +632,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 16 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -645,7 +648,7 @@ extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 32 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -661,7 +664,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 32 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -677,7 +680,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 64 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -693,7 +696,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); * SDL byteswaps the data only if necessary, so the data returned will be in * the native byte order. * - * \param src the stream from which to read data + * \param src the stream from which to read data. * \returns 64 bits of data in the native byte order of the platform. * * \since This function is available since SDL 2.0.0. @@ -713,8 +716,8 @@ extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); /** * Use this function to write a byte to an SDL_RWops. * - * \param dst the SDL_RWops to write to - * \param value the byte value to write + * \param dst the SDL_RWops to write to. + * \param value the byte value to write. * \returns 1 on success or 0 on failure; call SDL_GetError() for more * information. * @@ -732,8 +735,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); * specifies native format, and the data written will be in little-endian * format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. @@ -749,8 +752,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); * SDL byteswaps the data only if necessary, so the application always * specifies native format, and the data written will be in big-endian format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. @@ -767,8 +770,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); * specifies native format, and the data written will be in little-endian * format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. @@ -784,8 +787,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); * SDL byteswaps the data only if necessary, so the application always * specifies native format, and the data written will be in big-endian format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. @@ -802,8 +805,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); * specifies native format, and the data written will be in little-endian * format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. @@ -819,8 +822,8 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); * SDL byteswaps the data only if necessary, so the application always * specifies native format, and the data written will be in big-endian format. * - * \param dst the stream to which data will be written - * \param value the data to be written, in native format + * \param dst the stream to which data will be written. + * \param value the data to be written, in native format. * \returns 1 on successful write, 0 on error. * * \since This function is available since SDL 2.0.0. diff --git a/include/SDL_scancode.h b/include/SDL_scancode.h index 17e8fe2fd67de..0652d7ef66d8b 100644 --- a/include/SDL_scancode.h +++ b/include/SDL_scancode.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_scancode.h + * # CategoryScancode * - * Defines keyboard scancodes. + * Defines keyboard scancodes. */ #ifndef SDL_scancode_h_ @@ -31,16 +31,16 @@ #include "SDL_stdinc.h" /** - * \brief The SDL keyboard scancode representation. + * The SDL keyboard scancode representation. * - * Values of this type are used to represent keyboard keys, among other places - * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the - * SDL_Event structure. + * Values of this type are used to represent keyboard keys, among other places + * in the SDL_Keysym::scancode key.keysym.scancode field of the SDL_Event + * structure. * - * The values in this enumeration are based on the USB usage page standard: - * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf + * The values in this enumeration are based on the USB usage page standard: + * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf */ -typedef enum +typedef enum SDL_Scancode { SDL_SCANCODE_UNKNOWN = 0, diff --git a/include/SDL_sensor.h b/include/SDL_sensor.h index 684d2c6eb699b..d4b1c511d7df6 100644 --- a/include/SDL_sensor.h +++ b/include/SDL_sensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,10 +20,9 @@ */ /** - * \file SDL_sensor.h - * - * Include file for SDL sensor event handling + * # CategorySensor * + * Include file for SDL sensor event handling */ #ifndef SDL_sensor_h_ @@ -44,7 +43,7 @@ extern "C" { * \brief SDL_sensor.h * * In order to use these functions, SDL_Init() must have been called - * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system + * with the SDL_INIT_SENSOR flag. This causes SDL to scan the system * for sensors, and load appropriate drivers. */ @@ -52,21 +51,67 @@ struct _SDL_Sensor; typedef struct _SDL_Sensor SDL_Sensor; /** - * This is a unique ID for a sensor for the time it is connected to the system, - * and is never reused for the lifetime of the application. + * This is a unique ID for a sensor for the time it is connected to the + * system, and is never reused for the lifetime of the application. * - * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + * The ID value starts at 0 and increments from there. The value -1 is an + * invalid ID. */ typedef Sint32 SDL_SensorID; -/* The different sensors defined by SDL +/** + * The different sensors defined by SDL. * * Additional sensors may be available, using platform dependent semantics. * - * Hare are the additional Android sensors: + * Here are the additional Android sensors: + * * https://developer.android.com/reference/android/hardware/SensorEvent.html#values + * + * Accelerometer sensor notes: + * + * The accelerometer returns the current acceleration in SI meters per second + * squared. This measurement includes the force of gravity, so a device at + * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the + * earth, which is a positive Y value. + * + * - `values[0]`: Acceleration on the x axis + * - `values[1]`: Acceleration on the y axis + * - `values[2]`: Acceleration on the z axis + * + * For phones and tablets held in natural orientation and game controllers + * held in front of you, the axes are defined as follows: + * + * - -X ... +X : left ... right + * - -Y ... +Y : bottom ... top + * - -Z ... +Z : farther ... closer + * + * The accelerometer axis data is not changed when the device is rotated. + * + * Gyroscope sensor notes: + * + * The gyroscope returns the current rate of rotation in radians per second. + * The rotation is positive in the counter-clockwise direction. That is, an + * observer looking from a positive location on one of the axes would see + * positive rotation on that axis when it appeared to be rotating + * counter-clockwise. + * + * - `values[0]`: Angular speed around the x axis (pitch) + * - `values[1]`: Angular speed around the y axis (yaw) + * - `values[2]`: Angular speed around the z axis (roll) + * + * For phones and tablets held in natural orientation and game controllers + * held in front of you, the axes are defined as follows: + * + * - -X ... +X : left ... right + * - -Y ... +Y : bottom ... top + * - -Z ... +Z : farther ... closer + * + * The gyroscope axis data is not changed when the device is rotated. + * + * \sa SDL_GetDisplayOrientation */ -typedef enum +typedef enum SDL_SensorType { SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ @@ -79,52 +124,14 @@ typedef enum } SDL_SensorType; /** - * Accelerometer sensor - * - * The accelerometer returns the current acceleration in SI meters per - * second squared. This measurement includes the force of gravity, so - * a device at rest will have an value of SDL_STANDARD_GRAVITY away - * from the center of the earth. - * - * values[0]: Acceleration on the x axis - * values[1]: Acceleration on the y axis - * values[2]: Acceleration on the z axis - * - * For phones held in portrait mode and game controllers held in front of you, - * the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone is rotated. - * - * \sa SDL_GetDisplayOrientation() - */ -#define SDL_STANDARD_GRAVITY 9.80665f - -/** - * Gyroscope sensor - * - * The gyroscope returns the current rate of rotation in radians per second. - * The rotation is positive in the counter-clockwise direction. That is, - * an observer looking from a positive location on one of the axes would - * see positive rotation on that axis when it appeared to be rotating - * counter-clockwise. + * A constant to represent standard gravity for accelerometer sensors. * - * values[0]: Angular speed around the x axis (pitch) - * values[1]: Angular speed around the y axis (yaw) - * values[2]: Angular speed around the z axis (roll) - * - * For phones held in portrait mode and game controllers held in front of you, - * the axes are defined as follows: - * -X ... +X : left ... right - * -Y ... +Y : bottom ... top - * -Z ... +Z : farther ... closer - * - * The axis data is not changed when the phone or controller is rotated. - * - * \sa SDL_GetDisplayOrientation() + * The accelerometer returns the current acceleration in SI meters per second + * squared. This measurement includes the force of gravity, so a device at + * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the + * earth, which is a positive Y value. */ +#define SDL_STANDARD_GRAVITY 9.80665f /* Function prototypes */ @@ -155,7 +162,7 @@ extern DECLSPEC int SDLCALL SDL_NumSensors(void); /** * Get the implementation dependent name of a sensor. * - * \param device_index The sensor to obtain name from + * \param device_index The sensor to obtain name from. * \returns the sensor name, or NULL if `device_index` is out of range. * * \since This function is available since SDL 2.0.9. @@ -165,7 +172,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); /** * Get the type of a sensor. * - * \param device_index The sensor to get the type from + * \param device_index The sensor to get the type from. * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is * out of range. * @@ -176,7 +183,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index) /** * Get the platform dependent type of a sensor. * - * \param device_index The sensor to check + * \param device_index The sensor to check. * \returns the sensor platform dependent type, or -1 if `device_index` is out * of range. * @@ -187,7 +194,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index) /** * Get the instance ID of a sensor. * - * \param device_index The sensor to get instance id from + * \param device_index The sensor to get instance id from. * \returns the sensor instance ID, or -1 if `device_index` is out of range. * * \since This function is available since SDL 2.0.9. @@ -197,7 +204,7 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_in /** * Open a sensor for use. * - * \param device_index The sensor to open + * \param device_index The sensor to open. * \returns an SDL_Sensor sensor object, or NULL if an error occurred. * * \since This function is available since SDL 2.0.9. @@ -207,7 +214,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); /** * Return the SDL_Sensor associated with an instance id. * - * \param instance_id The sensor from instance id + * \param instance_id The sensor from instance id. * \returns an SDL_Sensor object. * * \since This function is available since SDL 2.0.9. @@ -217,7 +224,7 @@ extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instan /** * Get the implementation dependent name of a sensor * - * \param sensor The SDL_Sensor object + * \param sensor The SDL_Sensor object. * \returns the sensor name, or NULL if `sensor` is NULL. * * \since This function is available since SDL 2.0.9. @@ -227,7 +234,7 @@ extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); /** * Get the type of a sensor. * - * \param sensor The SDL_Sensor object to inspect + * \param sensor The SDL_Sensor object to inspect. * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is * NULL. * @@ -238,7 +245,7 @@ extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); /** * Get the platform dependent type of a sensor. * - * \param sensor The SDL_Sensor object to inspect + * \param sensor The SDL_Sensor object to inspect. * \returns the sensor platform dependent type, or -1 if `sensor` is NULL. * * \since This function is available since SDL 2.0.9. @@ -248,7 +255,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); /** * Get the instance ID of a sensor. * - * \param sensor The SDL_Sensor object to inspect + * \param sensor The SDL_Sensor object to inspect. * \returns the sensor instance ID, or -1 if `sensor` is NULL. * * \since This function is available since SDL 2.0.9. @@ -260,9 +267,9 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor) * * The number of values and interpretation of the data is sensor dependent. * - * \param sensor The SDL_Sensor object to query - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data + * \param sensor The SDL_Sensor object to query. + * \param data A pointer filled with the current sensor state. + * \param num_values The number of values to write to data. * \returns 0 or -1 if an error occurred. * * \since This function is available since SDL 2.0.9. @@ -275,11 +282,11 @@ extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, i * * The number of values and interpretation of the data is sensor dependent. * - * \param sensor The SDL_Sensor object to query + * \param sensor The SDL_Sensor object to query. * \param timestamp A pointer filled with the timestamp in microseconds of the - * current sensor reading if available, or 0 if not - * \param data A pointer filled with the current sensor state - * \param num_values The number of values to write to data + * current sensor reading if available, or 0 if not. + * \param data A pointer filled with the current sensor state. + * \param num_values The number of values to write to data. * \returns 0 or -1 if an error occurred. * * \since This function is available since SDL 2.26.0. @@ -289,7 +296,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, U /** * Close a sensor previously opened with SDL_SensorOpen(). * - * \param sensor The SDL_Sensor object to close + * \param sensor The SDL_Sensor object to close. * * \since This function is available since SDL 2.0.9. */ diff --git a/include/SDL_shape.h b/include/SDL_shape.h index 1bca9270e5cfe..d3560845f8587 100644 --- a/include/SDL_shape.h +++ b/include/SDL_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,18 +48,18 @@ extern "C" { * and flags. * * \param title The title of the window, in UTF-8 encoding. - * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. - * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or - * ::SDL_WINDOWPOS_UNDEFINED. + * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or + * SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or + * SDL_WINDOWPOS_UNDEFINED. * \param w The width of the window. * \param h The height of the window. * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with - * any of the following: ::SDL_WINDOW_OPENGL, - * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, - * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, - * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, - * and ::SDL_WINDOW_FULLSCREEN is always unset. + * any of the following: SDL_WINDOW_OPENGL, + * SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_HIDDEN, + * SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, + * SDL_WINDOW_MINIMIZED, SDL_WINDOW_BORDERLESS is always set, and + * SDL_WINDOW_FULLSCREEN is always unset. * \return the window created, or NULL if window creation failed. * * \since This function is available since SDL 2.0.0. diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 70dba7db69509..7590f5bd902db 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,10 +19,12 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: StdInc */ + /** - * \file SDL_stdinc.h + * # CategoryStdInc * - * This is a general header that includes C language support. + * This is a general header that includes C language support. */ #ifndef SDL_stdinc_h_ @@ -30,12 +32,6 @@ #include "SDL_config.h" -#ifdef __APPLE__ -#ifndef _DARWIN_C_SOURCE -#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */ -#endif -#endif - #ifdef HAVE_SYS_TYPES_H #include #endif @@ -85,7 +81,9 @@ Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx for more information. */ -# define _USE_MATH_DEFINES +# ifndef _USE_MATH_DEFINES +# define _USE_MATH_DEFINES +# endif # endif # include #endif @@ -111,7 +109,7 @@ # elif defined(__MRC__) void *alloca(unsigned); # else -char *alloca(); +void *alloca(size_t); # endif #endif @@ -133,15 +131,19 @@ char *alloca(); #endif /** - * The number of elements in an array. + * The number of elements in an array. */ #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) #define SDL_TABLESIZE(table) SDL_arraysize(table) /** - * Macro useful for building other macros with strings in them + * Macro useful for building other macros with strings in them * - * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") + * e.g: + * + * ```c + * #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") + * ``` */ #define SDL_STRINGIFY_ARG(arg) #arg @@ -189,54 +191,61 @@ typedef enum #endif /** - * \brief A signed 8-bit integer type. + * A signed 8-bit integer type. */ +typedef int8_t Sint8; #define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ #define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ -typedef int8_t Sint8; + /** - * \brief An unsigned 8-bit integer type. + * An unsigned 8-bit integer type. */ +typedef uint8_t Uint8; #define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ #define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ -typedef uint8_t Uint8; + /** - * \brief A signed 16-bit integer type. + * A signed 16-bit integer type. */ +typedef int16_t Sint16; #define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ #define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ -typedef int16_t Sint16; + /** - * \brief An unsigned 16-bit integer type. + * An unsigned 16-bit integer type. */ +typedef uint16_t Uint16; #define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ #define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ -typedef uint16_t Uint16; + /** - * \brief A signed 32-bit integer type. + * A signed 32-bit integer type. */ +typedef int32_t Sint32; #define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ #define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ -typedef int32_t Sint32; + /** - * \brief An unsigned 32-bit integer type. + * An unsigned 32-bit integer type. */ +typedef uint32_t Uint32; #define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ #define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ -typedef uint32_t Uint32; /** - * \brief A signed 64-bit integer type. + * A signed 64-bit integer type. */ +typedef int64_t Sint64; #define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ #define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ -typedef int64_t Sint64; + /** - * \brief An unsigned 64-bit integer type. + * An unsigned 64-bit integer type. */ +typedef uint64_t Uint64; #define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ #define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ -typedef uint64_t Uint64; + /* @} *//* Basic data types */ @@ -257,44 +266,44 @@ typedef uint64_t Uint64; * should define these but this is not true all platforms. * (for example win32) */ #ifndef SDL_PRIs64 -#ifdef PRIs64 -#define SDL_PRIs64 PRIs64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIs64 "I64d" -#elif defined(__LINUX__) && defined(__LP64__) +#elif defined(PRId64) +#define SDL_PRIs64 PRId64 +#elif defined(__LP64__) && !defined(__APPLE__) && !defined(__EMSCRIPTEN__) #define SDL_PRIs64 "ld" #else #define SDL_PRIs64 "lld" #endif #endif #ifndef SDL_PRIu64 -#ifdef PRIu64 -#define SDL_PRIu64 PRIu64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIu64 "I64u" -#elif defined(__LINUX__) && defined(__LP64__) +#elif defined(PRIu64) +#define SDL_PRIu64 PRIu64 +#elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIu64 "lu" #else #define SDL_PRIu64 "llu" #endif #endif #ifndef SDL_PRIx64 -#ifdef PRIx64 -#define SDL_PRIx64 PRIx64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIx64 "I64x" -#elif defined(__LINUX__) && defined(__LP64__) +#elif defined(PRIx64) +#define SDL_PRIx64 PRIx64 +#elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIx64 "lx" #else #define SDL_PRIx64 "llx" #endif #endif #ifndef SDL_PRIX64 -#ifdef PRIX64 -#define SDL_PRIX64 PRIX64 -#elif defined(__WIN32__) || defined(__GDK__) +#if defined(__WIN32__) || defined(__GDK__) #define SDL_PRIX64 "I64X" -#elif defined(__LINUX__) && defined(__LP64__) +#elif defined(PRIX64) +#define SDL_PRIX64 PRIX64 +#elif defined(__LP64__) && !defined(__APPLE__) #define SDL_PRIX64 "lX" #else #define SDL_PRIX64 "llX" @@ -340,7 +349,9 @@ typedef uint64_t Uint64; #define SDL_PRINTF_FORMAT_STRING #define SDL_SCANF_FORMAT_STRING #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #else #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ #include @@ -366,18 +377,25 @@ typedef uint64_t Uint64; #endif #if defined(__GNUC__) #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) +#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __printf__, fmtargnumber, 0 ))) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) +#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) __attribute__(( format( __scanf__, fmtargnumber, 0 ))) #else #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_PRINTF_VARARG_FUNCV( fmtargnumber ) #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNCV( fmtargnumber ) #endif #endif /* SDL_DISABLE_ANALYZE_MACROS */ #ifndef SDL_COMPILE_TIME_ASSERT #if defined(__cplusplus) +/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */ #if (__cplusplus >= 201103L) #define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) #endif +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L) +#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) #define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x) #endif @@ -410,8 +428,8 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); /** \cond */ #ifndef DOXYGEN_SHOULD_IGNORE_THIS -#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__) - /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +#if !defined(__VITA__) && !defined(__3DS__) +/* TODO: include/SDL_stdinc.h:422: error: size of array 'SDL_dummy_enum' is negative */ typedef enum { DUMMY_ENUM_VALUE @@ -449,6 +467,11 @@ typedef void (SDLCALL *SDL_free_func)(void *mem); /** * Get the original set of SDL memory functions * + * \param malloc_func filled with malloc function. + * \param calloc_func filled with calloc function. + * \param realloc_func filled with realloc function. + * \param free_func filled with free function. + * * \since This function is available since SDL 2.24.0. */ extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func, @@ -459,6 +482,11 @@ extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *mal /** * Get the current set of SDL memory functions * + * \param malloc_func filled with malloc function. + * \param calloc_func filled with calloc function. + * \param realloc_func filled with realloc function. + * \param free_func filled with free function. + * * \since This function is available since SDL 2.0.7. */ extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, @@ -469,6 +497,13 @@ extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func /** * Replace SDL's memory allocation functions with a custom set * + * \param malloc_func custom malloc function. + * \param calloc_func custom calloc function. + * \param realloc_func custom realloc function. + * \param free_func custom free function. + * \returns 0 on success or -1 on failure; call SDL_GetError() for more + * information. + * * \since This function is available since SDL 2.0.7. */ extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, @@ -479,6 +514,8 @@ extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, /** * Get the number of outstanding (unfreed) allocations * + * \returns number of unfreed allocations. + * * \since This function is available since SDL 2.0.7. */ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); @@ -486,8 +523,9 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); -extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); -extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); +typedef int (SDLCALL *SDL_CompareCallback)(const void *, const void *); +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare); +extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare); extern DECLSPEC int SDLCALL SDL_abs(int x); @@ -516,6 +554,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t le extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); +/* Some safe(r) macros for zero'ing structures... */ #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) #define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) @@ -528,9 +567,7 @@ extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, /* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) { -#ifdef __APPLE__ - memset_pattern4(dst, &val, dwords * 4); -#elif defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && defined(__i386__) int u0, u1, u2; __asm__ __volatile__ ( "cld \n\t" @@ -547,6 +584,7 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) return; } switch (dwords % 4) { + default: case 0: do { *_p++ = _val; SDL_FALLTHROUGH; case 3: *_p++ = _val; SDL_FALLTHROUGH; case 2: *_p++ = _val; SDL_FALLTHROUGH; @@ -609,11 +647,11 @@ extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); -extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(3); extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2); #ifndef HAVE_M_PI #ifndef M_PI @@ -694,8 +732,14 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t * outbytesleft); /** - * This function converts a string between encodings in one pass, returning a - * string that must be freed with SDL_free() or NULL on error. + * This function converts a buffer or string between encodings in one pass, + * returning a string that must be freed with SDL_free() or NULL on error. + * + * \param tocode the character encoding of the output string. + * \param fromcode the character encoding of data in `inbuf`. + * \param inbuf the string to convert to a different encoding. + * \param inbytesleft the size of the input string _in bytes_. + * \returns a new string, converted to the new encoding, or NULL on error. * * \since This function is available since SDL 2.0.0. */ @@ -703,9 +747,11 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); + +/* Some helper macros for common cases... */ #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) -#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) #define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) /* force builds using Clang's static analysis tools to use literal C runtime @@ -722,6 +768,27 @@ size_t strlcpy(char* dst, const char* src, size_t size); size_t strlcat(char* dst, const char* src, size_t size); #endif +#ifndef HAVE_WCSLCPY +size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size); +#endif + +#ifndef HAVE_WCSLCAT +size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size); +#endif + +#ifndef _WIN32 +/* strdup is not ANSI but POSIX, and its prototype might be hidden... */ +/* not for windows: might conflict with string.h where strdup may have + * dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */ +char *strdup(const char *str); +#endif + +/* Starting LLVM 16, the analyser errors out if these functions do not have + their prototype defined (clang-diagnostic-implicit-function-declaration) */ +#include +#include +#include + #define SDL_malloc malloc #define SDL_calloc calloc #define SDL_realloc realloc @@ -761,8 +828,14 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B } /** - * If a * b would overflow, return -1. Otherwise store a * b via ret - * and return 0. + * If a * b would overflow, return -1. + * + * Otherwise store a * b via ret and return 0. + * + * \param a the multiplicand. + * \param b the multiplier. + * \param ret on non-overflow output, stores the multiplication result. + * \returns -1 on overflow, 0 if result is multiplied without overflow. * * \since This function is available since SDL 2.24.0. */ @@ -791,8 +864,14 @@ SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a, #endif /** - * If a + b would overflow, return -1. Otherwise store a + b via ret - * and return 0. + * If a + b would overflow, return -1. + * + * Otherwise store a + b via ret and return 0. + * + * \param a the first addend. + * \param b the second addend. + * \param ret on non-overflow output, stores the addition result. + * \returns false on overflow, true if result is added without overflow. * * \since This function is available since SDL 2.24.0. */ diff --git a/include/SDL_surface.h b/include/SDL_surface.h index 838de654eed76..06f824523fbf0 100644 --- a/include/SDL_surface.h +++ b/include/SDL_surface.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_surface.h + * # CategorySurface * - * Header file for ::SDL_Surface definition and management functions. + * Header file for SDL_Surface definition and management functions. */ #ifndef SDL_surface_h_ @@ -43,7 +43,7 @@ extern "C" { /** * \name Surface flags * - * These are the currently supported flags for the ::SDL_Surface. + * These are the currently supported flags for the SDL_Surface. * * \internal * Used internally (read-only). @@ -57,17 +57,17 @@ extern "C" { /* @} *//* Surface flags */ /** - * Evaluates to true if the surface needs to be locked before access. + * Evaluates to true if the surface needs to be locked before access. */ #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */ /** - * \brief A collection of pixels used in software blitting. + * A collection of pixels used in software blitting. * - * \note This structure should be treated as read-only, except for \c pixels, - * which, if not NULL, contains the raw pixel data for the surface. + * This structure should be treated as read-only, except for `pixels`, which, + * if not NULL, contains the raw pixel data for the surface. */ typedef struct SDL_Surface { @@ -97,15 +97,15 @@ typedef struct SDL_Surface } SDL_Surface; /** - * \brief The type of function used for surface blitting functions. + * The type of function used for surface blitting functions. */ typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, struct SDL_Surface * dst, SDL_Rect * dstrect); /** - * \brief The formula used for converting between YUV and RGB + * The formula used for converting between YUV and RGB */ -typedef enum +typedef enum SDL_YUV_CONVERSION_MODE { SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ @@ -140,14 +140,14 @@ typedef enum * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a * different `blendMode`. * - * \param flags the flags are unused and should be set to 0 - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param Rmask the red mask for the pixels - * \param Gmask the green mask for the pixels - * \param Bmask the blue mask for the pixels - * \param Amask the alpha mask for the pixels + * \param flags the flags are unused and should be set to 0. + * \param width the width of the surface. + * \param height the height of the surface. + * \param depth the depth of the surface in bits. + * \param Rmask the red mask for the pixels. + * \param Gmask the green mask for the pixels. + * \param Bmask the blue mask for the pixels. + * \param Amask the alpha mask for the pixels. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -171,10 +171,10 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface * of providing pixel color masks, you provide it with a predefined format * from SDL_PixelFormatEnum. * - * \param flags the flags are unused and should be set to 0 - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits + * \param flags the flags are unused and should be set to 0. + * \param width the width of the surface. + * \param height the height of the surface. + * \param depth the depth of the surface in bits. * \param format the SDL_PixelFormatEnum for the new surface's pixel format. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. @@ -198,15 +198,15 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat * No copy is made of the pixel data. Pixel data is not managed automatically; * you must free the surface before you free the pixel data. * - * \param pixels a pointer to existing pixel data - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param pitch the pitch of the surface in bytes - * \param Rmask the red mask for the pixels - * \param Gmask the green mask for the pixels - * \param Bmask the blue mask for the pixels - * \param Amask the alpha mask for the pixels + * \param pixels a pointer to existing pixel data. + * \param width the width of the surface. + * \param height the height of the surface. + * \param depth the depth of the surface in bits. + * \param pitch the pitch of the surface in bytes. + * \param Rmask the red mask for the pixels. + * \param Gmask the green mask for the pixels. + * \param Bmask the blue mask for the pixels. + * \param Amask the alpha mask for the pixels. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -214,6 +214,7 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat * * \sa SDL_CreateRGBSurface * \sa SDL_CreateRGBSurfaceWithFormat + * \sa SDL_CreateRGBSurfaceWithFormatFrom * \sa SDL_FreeSurface */ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, @@ -239,11 +240,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, * No copy is made of the pixel data. Pixel data is not managed automatically; * you must free the surface before you free the pixel data. * - * \param pixels a pointer to existing pixel data - * \param width the width of the surface - * \param height the height of the surface - * \param depth the depth of the surface in bits - * \param pitch the pitch of the surface in bytes + * \param pixels a pointer to existing pixel data. + * \param width the width of the surface. + * \param height the height of the surface. + * \param depth the depth of the surface in bits. + * \param pitch the pitch of the surface in bytes. * \param format the SDL_PixelFormatEnum for the new surface's pixel format. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. @@ -278,8 +279,8 @@ extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); * * A single palette can be shared with many surfaces. * - * \param surface the SDL_Surface structure to update - * \param palette the SDL_Palette structure to use + * \param surface the SDL_Surface structure to update. + * \param palette the SDL_Palette structure to use. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -300,7 +301,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, * 0, then you can read and write to the surface at any time, and the pixel * format of the surface will not change. * - * \param surface the SDL_Surface structure to be locked + * \param surface the SDL_Surface structure to be locked. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -314,7 +315,7 @@ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); /** * Release a surface after directly accessing the pixels. * - * \param surface the SDL_Surface structure to be unlocked + * \param surface the SDL_Surface structure to be unlocked. * * \since This function is available since SDL 2.0.0. * @@ -329,11 +330,11 @@ extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); * result in a memory leak. * * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile. - * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap + * Alternatively, you might also use the macro SDL_LoadBMP to load a bitmap * from a file, convert it to an SDL_Surface and then close the file. * - * \param src the data stream for the surface - * \param freesrc non-zero to close the stream after being read + * \param src the data stream for the surface. + * \param freesrc non-zero to close the stream after being read. * \returns a pointer to a new SDL_Surface structure or NULL if there was an * error; call SDL_GetError() for more information. * @@ -363,9 +364,9 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are * not supported. * - * \param surface the SDL_Surface structure containing the image to be saved - * \param dst a data stream to save to - * \param freedst non-zero to close the stream after being written + * \param surface the SDL_Surface structure containing the image to be saved. + * \param dst a data stream to save to. + * \param freedst non-zero to close the stream after being written. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -378,9 +379,9 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW (SDL_Surface * surface, SDL_RWops * dst, int freedst); /** - * Save a surface to a file. + * Save a surface to a file. * - * Convenience macro. + * Convenience macro. */ #define SDL_SaveBMP(surface, file) \ SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) @@ -391,8 +392,8 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW * If RLE is enabled, color key and alpha blending blits are much faster, but * the surface must be locked before directly accessing the pixels. * - * \param surface the SDL_Surface structure to optimize - * \param flag 0 to disable, non-zero to enable RLE acceleration + * \param surface the SDL_Surface structure to optimize. + * \param flag 0 to disable, non-zero to enable RLE acceleration. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -410,7 +411,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, * * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. * - * \param surface the SDL_Surface structure to query + * \param surface the SDL_Surface structure to query. * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.14. @@ -432,9 +433,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); * RLE acceleration can substantially speed up blitting of images with large * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details. * - * \param surface the SDL_Surface structure to update - * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key - * \param key the transparent pixel + * \param surface the SDL_Surface structure to update. + * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key. + * \param key the transparent pixel. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -451,7 +452,7 @@ extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, * * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. * - * \param surface the SDL_Surface structure to query + * \param surface the SDL_Surface structure to query. * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.9. @@ -469,8 +470,8 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); * * If the surface doesn't have color key enabled this function returns -1. * - * \param surface the SDL_Surface structure to query - * \param key a pointer filled in with the transparent pixel + * \param surface the SDL_Surface structure to query. + * \param key a pointer filled in with the transparent pixel. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -491,10 +492,10 @@ extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, * * `srcC = srcC * (color / 255)` * - * \param surface the SDL_Surface structure to update - * \param r the red color value multiplied into blit operations - * \param g the green color value multiplied into blit operations - * \param b the blue color value multiplied into blit operations + * \param surface the SDL_Surface structure to update. + * \param r the red color value multiplied into blit operations. + * \param g the green color value multiplied into blit operations. + * \param b the blue color value multiplied into blit operations. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -510,10 +511,10 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, /** * Get the additional color value multiplied into blit operations. * - * \param surface the SDL_Surface structure to query - * \param r a pointer filled in with the current red color value - * \param g a pointer filled in with the current green color value - * \param b a pointer filled in with the current blue color value + * \param surface the SDL_Surface structure to query. + * \param r a pointer filled in with the current red color value. + * \param g a pointer filled in with the current green color value. + * \param b a pointer filled in with the current blue color value. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -534,8 +535,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, * * `srcA = srcA * (alpha / 255)` * - * \param surface the SDL_Surface structure to update - * \param alpha the alpha value multiplied into blit operations + * \param surface the SDL_Surface structure to update. + * \param alpha the alpha value multiplied into blit operations. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -550,8 +551,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, /** * Get the additional alpha value used in blit operations. * - * \param surface the SDL_Surface structure to query - * \param alpha a pointer filled in with the current alpha value + * \param surface the SDL_Surface structure to query. + * \param alpha a pointer filled in with the current alpha value. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -570,8 +571,8 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, * existing data, the blendmode of the SOURCE surface should be set to * `SDL_BLENDMODE_NONE`. * - * \param surface the SDL_Surface structure to update - * \param blendMode the SDL_BlendMode to use for blit blending + * \param surface the SDL_Surface structure to update. + * \param blendMode the SDL_BlendMode to use for blit blending. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -585,8 +586,8 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, /** * Get the blend mode used for blit operations. * - * \param surface the SDL_Surface structure to query - * \param blendMode a pointer filled in with the current SDL_BlendMode + * \param surface the SDL_Surface structure to query. + * \param blendMode a pointer filled in with the current SDL_BlendMode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -606,9 +607,9 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, * Note that blits are automatically clipped to the edges of the source and * destination surfaces. * - * \param surface the SDL_Surface structure to be clipped + * \param surface the SDL_Surface structure to be clipped. * \param rect the SDL_Rect structure representing the clipping rectangle, or - * NULL to disable clipping + * NULL to disable clipping. * \returns SDL_TRUE if the rectangle intersects the surface, otherwise * SDL_FALSE and blits will be completely clipped. * @@ -627,9 +628,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, * rectangle is drawn into. * * \param surface the SDL_Surface structure representing the surface to be - * clipped + * clipped. * \param rect an SDL_Rect structure filled in with the clipping rectangle for - * the surface + * the surface. * * \since This function is available since SDL 2.0.0. * @@ -658,11 +659,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface) * surface. The new, optimized surface can then be used as the source for * future blits, making them faster. * - * \param src the existing SDL_Surface structure to convert + * \param src the existing SDL_Surface structure to convert. * \param fmt the SDL_PixelFormat structure that the new surface is optimized - * for + * for. * \param flags the flags are unused and should be set to 0; this is a - * leftover from SDL 1.2's API + * leftover from SDL 1.2's API. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -683,11 +684,11 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface * it might be easier to call but it doesn't have access to palette * information for the destination surface, in case that would be important. * - * \param src the existing SDL_Surface structure to convert + * \param src the existing SDL_Surface structure to convert. * \param pixel_format the SDL_PixelFormatEnum that the new surface is - * optimized for + * optimized for. * \param flags the flags are unused and should be set to 0; this is a - * leftover from SDL 1.2's API + * leftover from SDL 1.2's API. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -703,14 +704,14 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat /** * Copy a block of pixels of one format to another format. * - * \param width the width of the block to copy, in pixels - * \param height the height of the block to copy, in pixels - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format - * \param src a pointer to the source pixels - * \param src_pitch the pitch of the source pixels, in bytes - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format - * \param dst a pointer to be filled in with new pixel data - * \param dst_pitch the pitch of the destination pixels, in bytes + * \param width the width of the block to copy, in pixels. + * \param height the height of the block to copy, in pixels. + * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format. + * \param src a pointer to the source pixels. + * \param src_pitch the pitch of the source pixels, in bytes. + * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format. + * \param dst a pointer to be filled in with new pixel data. + * \param dst_pitch the pitch of the destination pixels, in bytes. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -729,14 +730,14 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, * * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888. * - * \param width the width of the block to convert, in pixels - * \param height the height of the block to convert, in pixels - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format - * \param src a pointer to the source pixels - * \param src_pitch the pitch of the source pixels, in bytes - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format - * \param dst a pointer to be filled in with premultiplied pixel data - * \param dst_pitch the pitch of the destination pixels, in bytes + * \param width the width of the block to convert, in pixels. + * \param height the height of the block to convert, in pixels. + * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format. + * \param src a pointer to the source pixels. + * \param src_pitch the pitch of the source pixels, in bytes. + * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format. + * \param dst a pointer to be filled in with premultiplied pixel data. + * \param dst_pitch the pitch of the destination pixels, in bytes. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -760,10 +761,10 @@ extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, * SDL_SetClipRect()), then this function will fill based on the intersection * of the clip rectangle and `rect`. * - * \param dst the SDL_Surface structure that is the drawing target + * \param dst the SDL_Surface structure that is the drawing target. * \param rect the SDL_Rect structure representing the rectangle to fill, or - * NULL to fill the entire surface - * \param color the color to fill with + * NULL to fill the entire surface. + * \param color the color to fill with. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -786,10 +787,10 @@ extern DECLSPEC int SDLCALL SDL_FillRect * SDL_SetClipRect()), then this function will fill based on the intersection * of the clip rectangle and `rect`. * - * \param dst the SDL_Surface structure that is the drawing target - * \param rects an array of SDL_Rects representing the rectangles to fill. - * \param count the number of rectangles in the array - * \param color the color to fill with + * \param dst the SDL_Surface structure that is the drawing target. + * \param rects an array of SDL_Rect representing the rectangles to fill. + * \param count the number of rectangles in the array. + * \param color the color to fill with. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -800,63 +801,74 @@ extern DECLSPEC int SDLCALL SDL_FillRect extern DECLSPEC int SDLCALL SDL_FillRects (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); -/* !!! FIXME: merge this documentation with the wiki */ -/** - * Performs a fast blit from the source surface to the destination surface. - * - * This assumes that the source and destination rectangles are - * the same size. If either \c srcrect or \c dstrect are NULL, the entire - * surface (\c src or \c dst) is copied. The final blit rectangles are saved - * in \c srcrect and \c dstrect after all clipping is performed. - * - * \returns 0 if the blit is successful, otherwise it returns -1. - * - * The blit function should not be called on a locked surface. - * - * The blit semantics for surfaces with and without blending and colorkey - * are defined as follows: - * \verbatim - RGBA->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB, set destination alpha to source per-surface alpha value. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - - RGBA->RGBA: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source alpha-channel and per-surface alpha) - SDL_SRCCOLORKEY ignored. - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy all of RGBA to the destination. - if SDL_SRCCOLORKEY set, only copy the pixels matching the - RGB values of the source color key, ignoring alpha in the - comparison. - - RGB->RGB: - Source surface blend mode set to SDL_BLENDMODE_BLEND: - alpha-blend (using the source per-surface alpha) - Source surface blend mode set to SDL_BLENDMODE_NONE: - copy RGB. - both: - if SDL_SRCCOLORKEY set, only copy the pixels matching the - source color key. - \endverbatim - * - * You should call SDL_BlitSurface() unless you know exactly how SDL - * blitting works internally and how to use the other blit functions. +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are the same size. + * `dstrect`'s width and height are ignored, only its position is used. If + * either `srcrect` or `dstrect` are NULL, the entire surface (`src` or `dst`) + * is copied. The final blit rectangle is saved in `dstrect` after all + * clipping is performed. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey are + * defined as follows: + * + * ``` + * RGBA->RGB: + * Source surface blend mode set to SDL_BLENDMODE_BLEND: + * alpha-blend (using the source alpha-channel and per-surface alpha) + * SDL_SRCCOLORKEY ignored. + * Source surface blend mode set to SDL_BLENDMODE_NONE: + * copy RGB. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source color key, ignoring alpha in the + * comparison. + * + * RGB->RGBA: + * Source surface blend mode set to SDL_BLENDMODE_BLEND: + * alpha-blend (using the source per-surface alpha) + * Source surface blend mode set to SDL_BLENDMODE_NONE: + * copy RGB, set destination alpha to source per-surface alpha value. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source color key. + * + * RGBA->RGBA: + * Source surface blend mode set to SDL_BLENDMODE_BLEND: + * alpha-blend (using the source alpha-channel and per-surface alpha) + * SDL_SRCCOLORKEY ignored. + * Source surface blend mode set to SDL_BLENDMODE_NONE: + * copy all of RGBA to the destination. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source color key, ignoring alpha in the + * comparison. + * + * RGB->RGB: + * Source surface blend mode set to SDL_BLENDMODE_BLEND: + * alpha-blend (using the source per-surface alpha) + * Source surface blend mode set to SDL_BLENDMODE_NONE: + * copy RGB. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source color key. + * ``` + * + * You should call SDL_BlitSurface() unless you know exactly how SDL blitting + * works internally and how to use the other blit functions. + * + * \param src the SDL_Surface structure to be copied from. + * \param srcrect the SDL_Rect structure representing the rectangle to be + * copied, or NULL to copy the entire surface. + * \param dst the SDL_Surface structure that is the blit target. + * \param dstrect the SDL_Rect structure representing the x and y position in + * the destination surface, or NULL for (0,0). The width and + * height are ignored, and are copied from `srcrect`. If you + * want a specific width and height, you should use + * SDL_BlitScaled(). + * \returns 0 if the blit is successful or a negative error code on failure; + * call SDL_GetError() for more information. */ #define SDL_BlitSurface SDL_UpperBlit @@ -866,6 +878,18 @@ extern DECLSPEC int SDLCALL SDL_FillRects * SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a * macro for this function with a less confusing name. * + * \param src the SDL_Surface structure to be copied from. + * \param srcrect the SDL_Rect structure representing the rectangle to be + * copied, or NULL to copy the entire surface. + * \param dst the SDL_Surface structure that is the blit target. + * \param dstrect the SDL_Rect structure representing the x and y position in + * the destination surface, or NULL for (0,0). The width and + * height are ignored, and are copied from `srcrect`. If you + * want a specific width and height, you should use + * SDL_BlitScaled(). + * \returns 0 if the blit is successful or a negative error code on failure; + * call SDL_GetError() for more information. + * * \since This function is available since SDL 2.0.0. * * \sa SDL_BlitSurface @@ -883,12 +907,12 @@ extern DECLSPEC int SDLCALL SDL_UpperBlit * Unless you know what you're doing, you should be using SDL_BlitSurface() * instead. * - * \param src the SDL_Surface structure to be copied from + * \param src the SDL_Surface structure to be copied from. * \param srcrect the SDL_Rect structure representing the rectangle to be - * copied, or NULL to copy the entire surface - * \param dst the SDL_Surface structure that is the blit target + * copied, or NULL to copy the entire surface. + * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the rectangle that is - * copied into + * copied into. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -907,6 +931,13 @@ extern DECLSPEC int SDLCALL SDL_LowerBlit * * Please use SDL_BlitScaled() instead. * + * \param src the surface to be copied from. + * \param srcrect the rectangle to be copied. + * \param dst the surface that is the blit target. + * \param dstrect the rectangle that is copied into. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * * \since This function is available since SDL 2.0.0. */ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, @@ -917,6 +948,13 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, /** * Perform bilinear scaling between two surfaces of the same format, 32BPP. * + * \param src the surface to be copied from. + * \param srcrect the rectangle to be copied. + * \param dst the surface that is the blit target. + * \param dstrect the rectangle that is copied into. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * * \since This function is available since SDL 2.0.16. */ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src, @@ -925,14 +963,21 @@ extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src, const SDL_Rect * dstrect); -#define SDL_BlitScaled SDL_UpperBlitScaled - /** * Perform a scaled surface copy to a destination surface. * * SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is * merely a macro for this function with a less confusing name. * + * \param src the SDL_Surface structure to be copied from. + * \param srcrect the SDL_Rect structure representing the rectangle to be + * copied, or NULL to copy the entire surface. + * \param dst the SDL_Surface structure that is the blit target. + * \param dstrect the SDL_Rect structure representing the rectangle that is + * copied into, or NULL to copy into the entire surface. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * * \since This function is available since SDL 2.0.0. * * \sa SDL_BlitScaled @@ -941,18 +986,21 @@ extern DECLSPEC int SDLCALL SDL_UpperBlitScaled (SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect); +#define SDL_BlitScaled SDL_UpperBlitScaled + + /** * Perform low-level surface scaled blitting only. * * This is a semi-private function and it performs low-level surface blitting, * assuming the input rectangles have already been clipped. * - * \param src the SDL_Surface structure to be copied from + * \param src the SDL_Surface structure to be copied from. * \param srcrect the SDL_Rect structure representing the rectangle to be - * copied - * \param dst the SDL_Surface structure that is the blit target + * copied. + * \param dst the SDL_Surface structure that is the blit target. * \param dstrect the SDL_Rect structure representing the rectangle that is - * copied into + * copied into. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -967,6 +1015,8 @@ extern DECLSPEC int SDLCALL SDL_LowerBlitScaled /** * Set the YUV conversion mode * + * \param mode the YUV conversion mode. + * * \since This function is available since SDL 2.0.8. */ extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); @@ -974,6 +1024,8 @@ extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mo /** * Get the YUV conversion mode * + * \returns YUV conversion mode. + * * \since This function is available since SDL 2.0.8. */ extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); @@ -982,6 +1034,10 @@ extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); * Get the YUV conversion mode, returning the correct mode for the resolution * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC * + * \param width the resolution width. + * \param height the resolution height. + * \returns YUV conversion mode. + * * \since This function is available since SDL 2.0.8. */ extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); diff --git a/include/SDL_system.h b/include/SDL_system.h index 0edca635baa4e..336a11b705c6b 100644 --- a/include/SDL_system.h +++ b/include/SDL_system.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_system.h + * # CategorySystem * - * Include file for platform specific SDL API functions + * Include file for platform specific SDL API functions */ #ifndef SDL_system_h_ @@ -49,7 +49,7 @@ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsi * Set a callback for every Windows message, run before TranslateMessage(). * * \param callback The SDL_WindowsMessageHook function to call. - * \param userdata a pointer to pass to every iteration of `callback` + * \param userdata a pointer to pass to every iteration of `callback`. * * \since This function is available since SDL 2.0.4. */ @@ -66,7 +66,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook ca * controls on which monitor a full screen application will appear. * * \param displayIndex the display index for which to get the D3D9 adapter - * index + * index. * \returns the D3D9 adapter index on success or a negative error code on * failure; call SDL_GetError() for more information. * @@ -82,7 +82,7 @@ typedef struct IDirect3DDevice9 IDirect3DDevice9; * Once you are done using the device, you should release it to avoid a * resource leak. * - * \param renderer the renderer from which to get the associated D3D device + * \param renderer the renderer from which to get the associated D3D device. * \returns the D3D9 device associated with given renderer or NULL if it is * not a D3D9 renderer; call SDL_GetError() for more information. * @@ -98,7 +98,7 @@ typedef struct ID3D11Device ID3D11Device; * Once you are done using the device, you should release it to avoid a * resource leak. * - * \param renderer the renderer from which to get the associated D3D11 device + * \param renderer the renderer from which to get the associated D3D11 device. * \returns the D3D11 device associated with given renderer or NULL if it is * not a D3D11 renderer; call SDL_GetError() for more information. * @@ -118,7 +118,7 @@ typedef struct ID3D12Device ID3D12Device; * Once you are done using the device, you should release it to avoid a * resource leak. * - * \param renderer the renderer from which to get the associated D3D12 device + * \param renderer the renderer from which to get the associated D3D12 device. * \returns the D3D12 device associated with given renderer or NULL if it is * not a D3D12 renderer; call SDL_GetError() for more information. * @@ -140,9 +140,9 @@ extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* ren * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it * returns an SDL_bool. * - * \param displayIndex the display index for which to get both indices - * \param adapterIndex a pointer to be filled in with the adapter index - * \param outputIndex a pointer to be filled in with the output index + * \param displayIndex the display index for which to get both indices. + * \param adapterIndex a pointer to be filled in with the adapter index. + * \param outputIndex a pointer to be filled in with the output index. * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() * for more information. * @@ -176,7 +176,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int prio * \param threadID The Unix thread ID to change priority of. * \param sdlPriority The new SDL_ThreadPriority value. * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR, - * SCHED_OTHER, etc...) + * SCHED_OTHER, etc...). * \returns 0 on success, or -1 on error. * * \since This function is available since SDL 2.0.18. @@ -188,7 +188,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, /* Platform specific functions for iOS */ #ifdef __IPHONEOS__ -#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) +typedef void (SDLCALL *SDL_iOSAnimationCallback)(void*); /** * Use this function to set the animation callback on Apple iOS. @@ -210,9 +210,9 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, * This functions is also accessible using the macro * SDL_iOSSetAnimationCallback() since SDL 2.0.4. * - * \param window the window for which the animation callback should be set + * \param window the window for which the animation callback should be set. * \param interval the number of frames after which **callback** will be - * called + * called. * \param callback the function to call for every frame. * \param callbackParam a pointer that is passed to `callback`. * \returns 0 on success or a negative error code on failure; call @@ -222,9 +222,10 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, * * \sa SDL_iPhoneSetEventPump */ -extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam); +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); + +#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) -#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) /** * Use this function to enable or disable the SDL event pump on Apple iOS. @@ -234,7 +235,7 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, * This functions is also accessible using the macro SDL_iOSSetEventPump() * since SDL 2.0.4. * - * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it + * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it. * * \since This function is available since SDL 2.0.0. * @@ -242,6 +243,9 @@ extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, */ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); +#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) + +/* end of iOS-specific functions. */ #endif /* __IPHONEOS__ */ @@ -356,9 +360,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); /** - See the official Android developer guide for more information: - http://developer.android.com/guide/topics/data/data-storage.html -*/ + * See the official Android developer guide for more information: + * http://developer.android.com/guide/topics/data/data-storage.html + */ #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 @@ -441,11 +445,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permis * * https://developer.android.com/reference/android/view/Gravity * - * \param message text message to be shown - * \param duration 0=short, 1=long + * \param message text message to be shown. + * \param duration 0=short, 1=long. * \param gravity where the notification should appear on the screen. - * \param xoffset set this parameter only when gravity >=0 - * \param yoffset set this parameter only when gravity >=0 + * \param xoffset set this parameter only when gravity >=0. + * \param yoffset set this parameter only when gravity >=0. * \returns 0 if success, -1 if any error occurs. * * \since This function is available since SDL 2.0.16. @@ -457,8 +461,9 @@ extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int durati * * Override "boolean onUnhandledMessage(Message msg)" to handle the message. * - * \param command user command that must be greater or equal to 0x8000 - * \param param user parameter + * \param command user command that must be greater or equal to 0x8000. + * \param param user parameter. + * \returns 0 on success, otherwise -1. * * \since This function is available since SDL 2.0.22. */ @@ -470,9 +475,9 @@ extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param); #ifdef __WINRT__ /** - * \brief WinRT / Windows Phone path types + * WinRT / Windows Phone path types */ -typedef enum +typedef enum SDL_WinRT_Path { /** \brief The installed app's root directory. Files here are likely to be read-only. */ @@ -494,9 +499,9 @@ typedef enum /** - * \brief WinRT Device Family + * WinRT Device Family */ -typedef enum +typedef enum SDL_WinRT_DeviceFamily { /** \brief Unknown family */ SDL_WINRT_DEVICEFAMILY_UNKNOWN, @@ -524,7 +529,7 @@ typedef enum * * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * - * \param pathType the type of path to retrieve, one of SDL_WinRT_Path + * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if * the path is not available for any reason; call SDL_GetError() for * more information. @@ -547,7 +552,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path * * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * - * \param pathType the type of path to retrieve, one of SDL_WinRT_Path + * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if * the path is not available for any reason; call SDL_GetError() for * more information. @@ -567,6 +572,26 @@ extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathT */ extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); +/** + * Get the protocol activation URI if the app was launched via protocol + * activation. + * + * When a UWP/WinRT app is launched via a custom URI scheme (e.g., + * myapp://action?param=value), this function retrieves the full activation + * URI string. + * + * The URI is only available once per activation - after the first successful + * call, subsequent calls will return NULL. This ensures the URI is processed + * only once. + * + * \returns the protocol activation URI as a UTF-8 string that must be freed + * with SDL_free(), or NULL if the app was not activated via protocol + * or the URI was already retrieved. + * + * \since This function is available since SDL 2.33.0. + */ +extern DECLSPEC char * SDLCALL SDL_WinRTGetProtocolActivationURI(void); + #endif /* __WINRT__ */ /** @@ -593,7 +618,8 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void /* Functions used only by GDK */ #if defined(__GDK__) -typedef struct XTaskQueueObject * XTaskQueueHandle; +typedef struct XTaskQueueObject *XTaskQueueHandle; +typedef struct XUser *XUserHandle; /** * Gets a reference to the global async task queue handle for GDK, @@ -610,6 +636,20 @@ typedef struct XTaskQueueObject * XTaskQueueHandle; */ extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); +/** + * Gets a reference to the default user handle for GDK. + * + * This is effectively a synchronous version of XUserAddAsync, which always + * prefers the default user and allows a sign-in UI. + * + * \param outUserHandle a pointer to be filled in with the default user + * handle. + * \returns 0 if success, -1 if any error occurs. + * + * \since This function is available since SDL 2.28.0. + */ +extern DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle); + #endif /* Ends C function definitions when using C++ */ diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 45f8e7540d4fd..18f6873299d11 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,10 +19,17 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_syswm.h +/* WIKI CATEGORY: SYSWM */ + +/* + * # CategorySYSWM + * + * Include file for SDL custom system window manager hooks. * - * Include file for SDL custom system window manager hooks. + * Your application has access to a special type of event SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). */ #ifndef SDL_syswm_h_ @@ -33,14 +40,6 @@ #include "SDL_video.h" #include "SDL_version.h" -/** - * \brief SDL_syswm.h - * - * Your application has access to a special type of event ::SDL_SYSWMEVENT, - * which contains window-manager specific information and arrives whenever - * an unhandled window event occurs. This event is ignored by default, but - * you can enable it with SDL_EventState(). - */ struct SDL_SysWMinfo; #if !defined(SDL_PROTOTYPES_ONLY) @@ -129,10 +128,11 @@ extern "C" { #endif #if !defined(SDL_PROTOTYPES_ONLY) + /** - * These are the various supported windowing subsystems + * These are the various supported windowing subsystems */ -typedef enum +typedef enum SDL_SYSWM_TYPE { SDL_SYSWM_UNKNOWN, SDL_SYSWM_WINDOWS, @@ -152,7 +152,7 @@ typedef enum } SDL_SYSWM_TYPE; /** - * The custom event structure. + * The custom event structure. */ struct SDL_SysWMmsg { @@ -218,10 +218,10 @@ struct SDL_SysWMmsg }; /** - * The custom window manager information structure. + * The custom window manager information structure. * - * When this structure is returned, it holds information about which - * low level system it is using, and will be one of SDL_SYSWM_TYPE. + * When this structure is returned, it holds information about which low level + * system it is using, and will be one of SDL_SYSWM_TYPE. */ struct SDL_SysWMinfo { @@ -363,8 +363,8 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo; * `SDL_VERSION(&info.version)`, and then this function will fill in the rest * of the structure with information about the given window. * - * \param window the window about which information is being requested - * \param info an SDL_SysWMinfo structure filled in with window information + * \param window the window about which information is being requested. + * \param info an SDL_SysWMinfo structure filled in with window information. * \returns SDL_TRUE if the function is implemented and the `version` member * of the `info` struct is valid, or SDL_FALSE if the information * could not be retrieved; call SDL_GetError() for more information. diff --git a/include/SDL_test.h b/include/SDL_test.h index 8cc9d616a3216..78a7e623e4c7a 100644 --- a/include/SDL_test.h +++ b/include/SDL_test.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test.h * * Include file for SDL test framework. diff --git a/include/SDL_test_assert.h b/include/SDL_test_assert.h index 734230529e0f9..ff3b6b6bcd857 100644 --- a/include/SDL_test_assert.h +++ b/include/SDL_test_assert.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_assert.h * * Include file for SDL test framework. @@ -42,17 +42,17 @@ extern "C" { #endif -/** +/* * \brief Fails the assert. */ #define ASSERT_FAIL 0 -/** +/* * \brief Passes the assert. */ #define ASSERT_PASS 1 -/** +/* * \brief Assert that logs and break execution flow on failures. * * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). @@ -60,7 +60,7 @@ extern "C" { */ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); -/** +/* * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. * * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). @@ -70,25 +70,25 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as */ int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2); -/** +/* * \brief Explicitly pass without checking an assertion condition. Updates assertion counter. * * \param assertDescription Message to log with the assert describing it. */ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1); -/** +/* * \brief Resets the assert summary counters to zero. */ void SDLTest_ResetAssertSummary(void); -/** +/* * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. */ void SDLTest_LogAssertSummary(void); -/** +/* * \brief Converts the current assert summary state to a test result. * * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT diff --git a/include/SDL_test_common.h b/include/SDL_test_common.h index b86520d324281..64b5f83e80824 100644 --- a/include/SDL_test_common.h +++ b/include/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_common.h * * Include file for SDL test framework. @@ -129,7 +129,7 @@ extern "C" { /* Function prototypes */ -/** +/* * \brief Parse command line parameters and create common state. * * \param argv Array of command line parameters @@ -139,7 +139,7 @@ extern "C" { */ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); -/** +/* * \brief Process one common argument. * * \param state The common state describing the test window to create. @@ -150,7 +150,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); int SDLTest_CommonArg(SDLTest_CommonState * state, int index); -/** +/* * \brief Logs command line usage info. * * This logs the appropriate command line options for the subsystems in use @@ -164,7 +164,7 @@ int SDLTest_CommonArg(SDLTest_CommonState * state, int index); */ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options); -/** +/* * \brief Returns common usage information * * You should (probably) be using SDLTest_CommonLogUsage() instead, but this @@ -177,7 +177,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, cons */ const char *SDLTest_CommonUsage(SDLTest_CommonState * state); -/** +/* * \brief Open test window. * * \param state The common state describing the test window to create. @@ -186,7 +186,7 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state); */ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); -/** +/* * \brief Easy argument handling when test app doesn't need any custom args. * * \param state The common state describing the test window to create. @@ -197,7 +197,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); */ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv); -/** +/* * \brief Common event handler for test windows. * * \param state The common state used to create test window. @@ -207,7 +207,7 @@ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, */ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); -/** +/* * \brief Close test window. * * \param state The common state used to create test window. @@ -215,7 +215,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *do */ void SDLTest_CommonQuit(SDLTest_CommonState * state); -/** +/* * \brief Draws various window information (position, size, etc.) to the renderer. * * \param renderer The renderer to draw to. diff --git a/include/SDL_test_compare.h b/include/SDL_test_compare.h index 8a7a07008f1cd..3fcb935970c5f 100644 --- a/include/SDL_test_compare.h +++ b/include/SDL_test_compare.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_compare.h * * Include file for SDL test framework. @@ -46,7 +46,7 @@ extern "C" { #endif -/** +/* * \brief Compares a surface and with reference image data for equality * * \param surface Surface used in comparison diff --git a/include/SDL_test_crc32.h b/include/SDL_test_crc32.h index 049da74061c12..1dbeef27685f2 100644 --- a/include/SDL_test_crc32.h +++ b/include/SDL_test_crc32.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_crc32.h * * Include file for SDL test framework. @@ -60,7 +60,7 @@ extern "C" { #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ #endif -/** +/* * Data structure for CRC32 (checksum) computation */ typedef struct { @@ -69,7 +69,7 @@ extern "C" { /* ---------- Function Prototypes ------------- */ -/** +/* * \brief Initialize the CRC context * * Note: The function initializes the crc table required for all crc calculations. @@ -82,7 +82,7 @@ extern "C" { int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); -/** +/* * \brief calculate a crc32 from a data block * * \param crcContext pointer to context variable @@ -101,7 +101,7 @@ int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); -/** +/* * \brief clean up CRC context * * \param crcContext pointer to context variable diff --git a/include/SDL_test_font.h b/include/SDL_test_font.h index 6e7247dd767d3..0eade92394407 100644 --- a/include/SDL_test_font.h +++ b/include/SDL_test_font.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_font.h * * Include file for SDL test framework. @@ -41,7 +41,7 @@ extern "C" { #define FONT_CHARACTER_SIZE 8 #define FONT_LINE_HEIGHT (FONT_CHARACTER_SIZE + 2) -/** +/* * \brief Draw a string in the currently set font. * * \param renderer The renderer to draw on. @@ -53,7 +53,7 @@ extern "C" { */ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c); -/** +/* * \brief Draw a UTF-8 string in the currently set font. * * The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets. @@ -67,7 +67,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c); */ int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); -/** +/* * \brief Data used for multi-line text output */ typedef struct SDLTest_TextWindow @@ -78,7 +78,7 @@ typedef struct SDLTest_TextWindow char **lines; } SDLTest_TextWindow; -/** +/* * \brief Create a multi-line text output window * * \param x The X coordinate of the upper left corner of the window. @@ -92,7 +92,7 @@ typedef struct SDLTest_TextWindow */ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h); -/** +/* * \brief Display a multi-line text output window * * This function should be called every frame to display the text @@ -104,7 +104,7 @@ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h); */ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer); -/** +/* * \brief Add text to a multi-line text output window * * Adds UTF-8 text to the end of the current text. The newline character starts a @@ -119,7 +119,7 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render */ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); -/** +/* * \brief Add text to a multi-line text output window * * Adds UTF-8 text to the end of the current text. The newline character starts a @@ -134,7 +134,7 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_ST */ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len); -/** +/* * \brief Clear the text in a multi-line text output window * * \param textwin The text output window @@ -143,7 +143,7 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char */ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin); -/** +/* * \brief Free the storage associated with a multi-line text output window * * \param textwin The text output window @@ -152,7 +152,7 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin); */ void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin); -/** +/* * \brief Cleanup textures used by font drawing functions. */ void SDLTest_CleanupTextDrawing(void); diff --git a/include/SDL_test_fuzzer.h b/include/SDL_test_fuzzer.h index bbe8eb8749914..c6978ac810988 100644 --- a/include/SDL_test_fuzzer.h +++ b/include/SDL_test_fuzzer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_fuzzer.h * * Include file for SDL test framework. @@ -48,13 +48,13 @@ extern "C" { */ -/** +/* * \file * Note: The fuzzer implementation uses a static instance of random context * internally which makes it thread-UNsafe. */ -/** +/* * Initializes the fuzzer for a test * * \param execKey Execution "Key" that initializes the random number generator uniquely for the test. @@ -63,14 +63,14 @@ extern "C" { void SDLTest_FuzzerInit(Uint64 execKey); -/** +/* * Returns a random Uint8 * * \returns a generated integer */ Uint8 SDLTest_RandomUint8(void); -/** +/* * Returns a random Sint8 * * \returns a generated signed integer @@ -78,14 +78,14 @@ Uint8 SDLTest_RandomUint8(void); Sint8 SDLTest_RandomSint8(void); -/** +/* * Returns a random Uint16 * * \returns a generated integer */ Uint16 SDLTest_RandomUint16(void); -/** +/* * Returns a random Sint16 * * \returns a generated signed integer @@ -93,7 +93,7 @@ Uint16 SDLTest_RandomUint16(void); Sint16 SDLTest_RandomSint16(void); -/** +/* * Returns a random integer * * \returns a generated integer @@ -101,14 +101,14 @@ Sint16 SDLTest_RandomSint16(void); Sint32 SDLTest_RandomSint32(void); -/** +/* * Returns a random positive integer * * \returns a generated integer */ Uint32 SDLTest_RandomUint32(void); -/** +/* * Returns random Uint64. * * \returns a generated integer @@ -116,36 +116,36 @@ Uint32 SDLTest_RandomUint32(void); Uint64 SDLTest_RandomUint64(void); -/** +/* * Returns random Sint64. * * \returns a generated signed integer */ Sint64 SDLTest_RandomSint64(void); -/** +/* * \returns a random float in range [0.0 - 1.0] */ float SDLTest_RandomUnitFloat(void); -/** +/* * \returns a random double in range [0.0 - 1.0] */ double SDLTest_RandomUnitDouble(void); -/** +/* * \returns a random float. * */ float SDLTest_RandomFloat(void); -/** +/* * \returns a random double. * */ double SDLTest_RandomDouble(void); -/** +/* * Returns a random boundary value for Uint8 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -166,7 +166,7 @@ double SDLTest_RandomDouble(void); */ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Uint16 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -187,7 +187,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo */ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Uint32 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -208,7 +208,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL */ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Uint64 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -229,7 +229,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL */ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Sint8 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -251,7 +251,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Sint16 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -272,7 +272,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo */ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Sint32 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -293,7 +293,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL */ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); -/** +/* * Returns a random boundary value for Sint64 within the given boundaries. * Boundaries are inclusive, see the usage examples below. If validDomain * is true, the function will only return valid boundaries, otherwise non-valid @@ -315,7 +315,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); -/** +/* * Returns integer in range [min, max] (inclusive). * Min and max values can be negative values. * If Max in smaller than min, then the values are swapped. @@ -329,7 +329,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); -/** +/* * Generates random null-terminated string. The minimum length for * the string is 1 character, maximum length for the string is 255 * characters and it can contain ASCII characters from 32 to 126. @@ -341,7 +341,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); char * SDLTest_RandomAsciiString(void); -/** +/* * Generates random null-terminated string. The maximum length for * the string is defined by the maxLength parameter. * String can contain ASCII characters from 32 to 126. @@ -355,7 +355,7 @@ char * SDLTest_RandomAsciiString(void); char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); -/** +/* * Generates random null-terminated string. The length for * the string is defined by the size parameter. * String can contain ASCII characters from 32 to 126. @@ -368,7 +368,8 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); */ char * SDLTest_RandomAsciiStringOfSize(int size); -/** + +/* * Get the invocation count for the fuzzer since last ...FuzzerInit. * * \returns the invocation count. diff --git a/include/SDL_test_harness.h b/include/SDL_test_harness.h index 1fd4236beed9b..cfd62e8401bc0 100644 --- a/include/SDL_test_harness.h +++ b/include/SDL_test_harness.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_harness.h * * Include file for SDL test framework. @@ -69,7 +69,7 @@ typedef int (*SDLTest_TestCaseFp)(void *arg); /* !< Function pointer to a test case teardown function (run after every test) */ typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); -/** +/* * Holds information about a single test case. */ typedef struct SDLTest_TestCaseReference { @@ -83,7 +83,7 @@ typedef struct SDLTest_TestCaseReference { int enabled; } SDLTest_TestCaseReference; -/** +/* * Holds information about a test suite (multiple test cases). */ typedef struct SDLTest_TestSuiteReference { @@ -98,7 +98,7 @@ typedef struct SDLTest_TestSuiteReference { } SDLTest_TestSuiteReference; -/** +/* * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). * * Note: The returned string needs to be deallocated by the caller. @@ -109,7 +109,7 @@ typedef struct SDLTest_TestSuiteReference { */ char *SDLTest_GenerateRunSeed(const int length); -/** +/* * \brief Execute a test suite using the given run seed and execution key. * * \param testSuites Suites containing the test case. diff --git a/include/SDL_test_images.h b/include/SDL_test_images.h index e2bfc3600e201..d593a31565b0a 100644 --- a/include/SDL_test_images.h +++ b/include/SDL_test_images.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_images.h * * Include file for SDL test framework. @@ -44,7 +44,7 @@ extern "C" { #endif -/** +/* *Type for test images. */ typedef struct SDLTest_SurfaceImage_s { diff --git a/include/SDL_test_log.h b/include/SDL_test_log.h index e3d39ad279311..6f7f66145b05b 100644 --- a/include/SDL_test_log.h +++ b/include/SDL_test_log.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_log.h * * Include file for SDL test framework. @@ -42,14 +42,14 @@ extern "C" { #endif -/** +/* * \brief Prints given message with a timestamp in the TEST category and INFO priority. * * \param fmt Message to be logged */ void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); -/** +/* * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. * * \param fmt Message to be logged diff --git a/include/SDL_test_md5.h b/include/SDL_test_md5.h index 17b1d2be71e99..edd79451c70c4 100644 --- a/include/SDL_test_md5.h +++ b/include/SDL_test_md5.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_md5.h * * Include file for SDL test framework. @@ -77,7 +77,7 @@ extern "C" { /* ---------- Function Prototypes ------------- */ -/** +/* * \brief initialize the context * * \param mdContext pointer to context variable @@ -89,7 +89,7 @@ extern "C" { void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); -/** +/* * \brief update digest from variable length data * * \param mdContext pointer to context variable @@ -105,7 +105,7 @@ extern "C" { unsigned int inLen); -/** +/* * \brief complete digest computation * * \param mdContext pointer to context variable diff --git a/include/SDL_test_memory.h b/include/SDL_test_memory.h index cc2edc1b9bd42..e789fa802a512 100644 --- a/include/SDL_test_memory.h +++ b/include/SDL_test_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_memory.h * * Include file for SDL test framework. @@ -37,14 +37,14 @@ extern "C" { #endif -/** +/* * \brief Start tracking SDL memory allocations * * \note This should be called before any other SDL functions for complete tracking coverage */ int SDLTest_TrackAllocations(void); -/** +/* * \brief Print a log of any outstanding allocations * * \note This can be called after SDL_Quit() diff --git a/include/SDL_test_random.h b/include/SDL_test_random.h index b1d6060cb2449..05d6d3ee5e26a 100644 --- a/include/SDL_test_random.h +++ b/include/SDL_test_random.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** +/* * \file SDL_test_random.h * * Include file for SDL test framework. @@ -67,7 +67,7 @@ extern "C" { /* --- Function prototypes */ -/** +/* * \brief Initialize random number generator with two integers. * * Note: The random sequence of numbers returned by ...Random() is the @@ -81,7 +81,7 @@ extern "C" { void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, unsigned int ci); -/** +/* * \brief Initialize random number generator based on current system time. * * \param rndContext pointer to context structure @@ -90,7 +90,7 @@ extern "C" { void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); -/** +/* * \brief Initialize random number generator based on current system time. * * Note: ...RandomInit() or ...RandomInitTime() must have been called diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 7364f81371120..ac405d85ed538 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,9 +23,9 @@ #define SDL_thread_h_ /** - * \file SDL_thread.h + * # CategoryThread * - * Header for the SDL thread management routines. + * Header for the SDL thread management routines. */ #include "SDL_stdinc.h" @@ -35,7 +35,7 @@ #include "SDL_atomic.h" #include "SDL_mutex.h" -#if defined(__WIN32__) || defined(__GDK__) +#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__) #include /* _beginthreadex() and _endthreadex() */ #endif #if defined(__OS2__) /* for _beginthread() and _endthread() */ @@ -63,16 +63,18 @@ typedef unsigned long SDL_threadID; typedef unsigned int SDL_TLSID; /** - * The SDL thread priority. + * The SDL thread priority. * - * SDL will make system changes as necessary in order to apply the thread priority. - * Code which attempts to control thread state related to priority should be aware - * that calling SDL_SetThreadPriority may alter such state. - * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. + * SDL will make system changes as necessary in order to apply the thread + * priority. Code which attempts to control thread state related to priority + * should be aware that calling SDL_SetThreadPriority may alter such state. + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this + * behavior. * - * \note On many systems you require special privileges to set high or time critical priority. + * On many systems you require special privileges to set high or time critical + * priority. */ -typedef enum { +typedef enum SDL_ThreadPriority { SDL_THREAD_PRIORITY_LOW, SDL_THREAD_PRIORITY_NORMAL, SDL_THREAD_PRIORITY_HIGH, @@ -82,13 +84,13 @@ typedef enum { /** * The function passed to SDL_CreateThread(). * - * \param data what was passed as `data` to SDL_CreateThread() + * \param data what was passed as `data` to SDL_CreateThread(). * \returns a value that can be reported through SDL_WaitThread(). */ typedef int (SDLCALL * SDL_ThreadFunction) (void *data); -#if defined(__WIN32__) || defined(__GDK__) +#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__) /** * \file SDL_thread.h * @@ -142,7 +144,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #endif #elif defined(__OS2__) @@ -175,7 +177,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz #undef SDL_CreateThread #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #undef SDL_CreateThreadWithStackSize -#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #else #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) @@ -192,9 +194,9 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz * SDL_CreateThreadWithStackSize(fn, name, 0, data); * ``` * - * \param fn the SDL_ThreadFunction function to call in the new thread - * \param name the name of the thread - * \param data a pointer that is passed to `fn` + * \param fn the SDL_ThreadFunction function to call in the new thread. + * \param name the name of the thread. + * \param data a pointer that is passed to `fn`. * \returns an opaque pointer to the new thread object on success, NULL if the * new thread could not be created; call SDL_GetError() for more * information. @@ -238,10 +240,10 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); * function, but for backwards compatibility, this is currently a separate * function. * - * \param fn the SDL_ThreadFunction function to call in the new thread - * \param name the name of the thread + * \param fn the SDL_ThreadFunction function to call in the new thread. + * \param name the name of the thread. * \param stacksize the size, in bytes, to allocate for the new thread stack. - * \param data a pointer that is passed to `fn` + * \param data a pointer that is passed to `fn`. * \returns an opaque pointer to the new thread object on success, NULL if the * new thread could not be created; call SDL_GetError() for more * information. @@ -261,7 +263,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz * This is internal memory, not to be freed by the caller, and remains valid * until the specified thread is cleaned up by SDL_WaitThread(). * - * \param thread the thread to query + * \param thread the thread to query. * \returns a pointer to a UTF-8 string that names the specified thread, or * NULL if it doesn't have a name. * @@ -296,7 +298,7 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); * If SDL is running on a platform that does not support threads the return * value will always be zero. * - * \param thread the thread to query + * \param thread the thread to query. * \returns the ID of the specified thread, or the ID of the current thread if * `thread` is NULL. * @@ -313,7 +315,7 @@ extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); * promote the thread to a higher priority) at all, and some require you to be * an administrator account. Be prepared for this to fail. * - * \param priority the SDL_ThreadPriority to set + * \param priority the SDL_ThreadPriority to set. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -344,7 +346,7 @@ extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); * afterward. * * \param thread the SDL_Thread pointer that was returned from the - * SDL_CreateThread() call that started this thread + * SDL_CreateThread() call that started this thread. * \param status pointer to an integer that will receive the value returned * from the thread function by its 'return', or NULL to not * receive such value back. @@ -383,7 +385,7 @@ extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); * It is safe to pass NULL to this function; it is a no-op. * * \param thread the SDL_Thread pointer that was returned from the - * SDL_CreateThread() call that started this thread + * SDL_CreateThread() call that started this thread. * * \since This function is available since SDL 2.0.2. * @@ -410,7 +412,7 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); /** * Get the current thread's value associated with a thread local storage ID. * - * \param id the thread local storage ID + * \param id the thread local storage ID. * \returns the value associated with the ID for the current thread or NULL if * no value has been set; call SDL_GetError() for more information. * @@ -421,6 +423,8 @@ extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); */ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); +typedef void (SDLCALL *SDL_TLSDestructorCallback)(void*); + /** * Set the current thread's value associated with a thread local storage ID. * @@ -432,10 +436,10 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); * * where its parameter `value` is what was passed as `value` to SDL_TLSSet(). * - * \param id the thread local storage ID - * \param value the value to associate with the ID for the current thread + * \param id the thread local storage ID. + * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the - * value + * value. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -444,7 +448,7 @@ extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); * \sa SDL_TLSCreate * \sa SDL_TLSGet */ -extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor); /** * Cleanup all TLS data for this thread. diff --git a/include/SDL_timer.h b/include/SDL_timer.h index 62f81d42db442..60969690b23a7 100644 --- a/include/SDL_timer.h +++ b/include/SDL_timer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,9 +23,9 @@ #define SDL_timer_h_ /** - * \file SDL_timer.h + * # CategoryTimer * - * Header for the SDL time management routines. + * Header for the SDL time management routines. */ #include "SDL_stdinc.h" @@ -89,8 +89,8 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void); * days, but should _not_ be used with SDL_GetTicks64(), which does not have * that problem. * - * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could - * do this: + * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could do + * this: * * ```c * const Uint32 timeout = SDL_GetTicks() + 100; @@ -99,9 +99,9 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void); * } * ``` * - * Note that this does not handle tick differences greater - * than 2^31 so take care when using the above kind of code - * with large timeout delays (tens of days). + * Note that this does not handle tick differences greater than 2^31 so take + * care when using the above kind of code with large timeout delays (tens of + * days). */ #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) @@ -140,7 +140,7 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); * waits at least the specified time, but possibly longer due to OS * scheduling. * - * \param ms the number of milliseconds to delay + * \param ms the number of milliseconds to delay. * * \since This function is available since SDL 2.0.0. */ @@ -149,10 +149,10 @@ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); /** * Function prototype for the timer callback function. * - * The callback function is passed the current timer interval and returns - * the next timer interval. If the returned value is the same as the one - * passed in, the periodic alarm continues, otherwise a new alarm is - * scheduled. If the callback returns 0, the periodic alarm is cancelled. + * The callback function is passed the current timer interval and returns the + * next timer interval. If the returned value is the same as the one passed + * in, the periodic alarm continues, otherwise a new alarm is scheduled. If + * the callback returns 0, the periodic alarm is cancelled. */ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); @@ -182,10 +182,10 @@ typedef int SDL_TimerID; * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your * callback needs to adjust for variances. * - * \param interval the timer delay, in milliseconds, passed to `callback` + * \param interval the timer delay, in milliseconds, passed to `callback`. * \param callback the SDL_TimerCallback function to call when the specified - * `interval` elapses - * \param param a pointer that is passed to `callback` + * `interval` elapses. + * \param param a pointer that is passed to `callback`. * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more * information. * @@ -200,7 +200,7 @@ extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, /** * Remove a timer created with SDL_AddTimer(). * - * \param id the ID of the timer to remove + * \param id the ID of the timer to remove. * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't * found. * diff --git a/include/SDL_touch.h b/include/SDL_touch.h index 95924135e18ee..0244df1c687b2 100644 --- a/include/SDL_touch.h +++ b/include/SDL_touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_touch.h + * # CategoryTouch * - * Include file for SDL touch event handling. + * Include file for SDL touch event handling. */ #ifndef SDL_touch_h_ @@ -85,7 +85,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); /** * Get the touch ID with the given index. * - * \param index the touch device index + * \param index the touch device index. * \returns the touch ID with the given index on success or 0 if the index is * invalid; call SDL_GetError() for more information. * @@ -99,6 +99,10 @@ extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); * Get the touch device name as reported from the driver or NULL if the index * is invalid. * + * \param index the touch device index. + * \returns touch device name, or NULL on failure; call SDL_GetError() for + * more information. + * * \since This function is available since SDL 2.0.22. */ extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index); @@ -106,6 +110,9 @@ extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index); /** * Get the type of the given touch device. * + * \param touchID the ID of a touch device. + * \returns touch device type. + * * \since This function is available since SDL 2.0.10. */ extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); @@ -113,7 +120,7 @@ extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID t /** * Get the number of active fingers for a given touch device. * - * \param touchID the ID of a touch device + * \param touchID the ID of a touch device. * \returns the number of active fingers for a given touch device on success * or 0 on failure; call SDL_GetError() for more information. * @@ -128,8 +135,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); * * The returned resource is owned by SDL and should not be deallocated. * - * \param touchID the ID of the requested touch device - * \param index the index of the requested finger + * \param touchID the ID of the requested touch device. + * \param index the index of the requested finger. * \returns a pointer to the SDL_Finger object or NULL if no object at the * given ID and index could be found. * diff --git a/include/SDL_types.h b/include/SDL_types.h index 355fb501a8dd6..cb3b4a8df1a08 100644 --- a/include/SDL_types.h +++ b/include/SDL_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,11 +19,6 @@ 3. This notice may not be removed or altered from any source distribution. */ -/** - * \file SDL_types.h - * - * \deprecated - */ - /* DEPRECATED */ + #include "SDL_stdinc.h" diff --git a/include/SDL_version.h b/include/SDL_version.h index e85fceb34606b..825d5c8c0a88f 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_version.h + * # CategoryVersion * - * This header defines the current SDL version. + * This header defines the current SDL version. */ #ifndef SDL_version_h_ @@ -40,10 +40,9 @@ extern "C" { * Information about the version of SDL in use. * * Represents the library's version as three levels: major revision - * (increments with massive changes, additions, and enhancements), - * minor revision (increments with backwards-compatible changes to the - * major revision), and patchlevel (increments with fixes to the minor - * revision). + * (increments with massive changes, additions, and enhancements), minor + * revision (increments with backwards-compatible changes to the major + * revision), and patchlevel (increments with fixes to the minor revision). * * \sa SDL_VERSION * \sa SDL_GetVersion @@ -58,18 +57,17 @@ typedef struct SDL_version /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ #define SDL_MAJOR_VERSION 2 -#define SDL_MINOR_VERSION 26 +#define SDL_MINOR_VERSION 33 #define SDL_PATCHLEVEL 0 /** * Macro to determine SDL version program was compiled against. * - * This macro fills in a SDL_version structure with the version of the - * library you compiled against. This is determined by what header the - * compiler uses. Note that if you dynamically linked the library, you might - * have a slightly newer or older version at runtime. That version can be - * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), - * is not a macro. + * This macro fills in a SDL_version structure with the version of the library + * you compiled against. This is determined by what header the compiler uses. + * Note that if you dynamically linked the library, you might have a slightly + * newer or older version at runtime. That version can be determined with + * SDL_GetVersion(), which, unlike SDL_VERSION(), is not a macro. * * \param x A pointer to a SDL_version struct to initialize. * @@ -85,37 +83,40 @@ typedef struct SDL_version /* TODO: Remove this whole block in SDL 3 */ #if SDL_MAJOR_VERSION < 3 + /** - * This macro turns the version numbers into a numeric value: - * \verbatim - (1,2,3) -> (1203) - \endverbatim + * This macro turns the version numbers into a numeric value: + * + * ``` + * (1,2,3) -> (1203) + * ``` + * + * This assumes that there will never be more than 100 patchlevels. * - * This assumes that there will never be more than 100 patchlevels. + * In versions higher than 2.9.0, the minor version overflows into the + * thousands digit: for example, 2.23.0 is encoded as 4300, and 2.255.99 would + * be encoded as 25799. * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300, - * and 2.255.99 would be encoded as 25799. - * This macro will not be available in SDL 3.x. + * This macro will not be available in SDL 3.x. */ #define SDL_VERSIONNUM(X, Y, Z) \ ((X)*1000 + (Y)*100 + (Z)) /** - * This is the version number macro for the current SDL version. + * This is the version number macro for the current SDL version. * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300. - * This macro will not be available in SDL 3.x. + * In versions higher than 2.9.0, the minor version overflows into the + * thousands digit: for example, 2.23.0 is encoded as 4300. This macro will + * not be available in SDL 3.x. * - * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. + * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. */ #define SDL_COMPILEDVERSION \ SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) #endif /* SDL_MAJOR_VERSION < 3 */ /** - * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. */ #define SDL_VERSION_ATLEAST(X, Y, Z) \ ((SDL_MAJOR_VERSION >= X) && \ @@ -132,7 +133,7 @@ typedef struct SDL_version * * This function may be called safely at any time, even before SDL_Init(). * - * \param ver the SDL_version structure that contains the version information + * \param ver the SDL_version structure that contains the version information. * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_video.h b/include/SDL_video.h index b2f1509f73bd5..e1c3c278a6e38 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,9 +20,9 @@ */ /** - * \file SDL_video.h + * # CategoryVideo * - * Header file for SDL video functions. + * Header file for SDL video functions. */ #ifndef SDL_video_h_ @@ -40,17 +40,17 @@ extern "C" { #endif /** - * \brief The structure that defines a display mode + * The structure that defines a display mode * - * \sa SDL_GetNumDisplayModes() - * \sa SDL_GetDisplayMode() - * \sa SDL_GetDesktopDisplayMode() - * \sa SDL_GetCurrentDisplayMode() - * \sa SDL_GetClosestDisplayMode() - * \sa SDL_SetWindowDisplayMode() - * \sa SDL_GetWindowDisplayMode() + * \sa SDL_GetNumDisplayModes + * \sa SDL_GetDisplayMode + * \sa SDL_GetDesktopDisplayMode + * \sa SDL_GetCurrentDisplayMode + * \sa SDL_GetClosestDisplayMode + * \sa SDL_SetWindowDisplayMode + * \sa SDL_GetWindowDisplayMode */ -typedef struct +typedef struct SDL_DisplayMode { Uint32 format; /**< pixel format */ int w; /**< width, in screen coordinates */ @@ -60,46 +60,46 @@ typedef struct } SDL_DisplayMode; /** - * \brief The type used to identify a window - * - * \sa SDL_CreateWindow() - * \sa SDL_CreateWindowFrom() - * \sa SDL_DestroyWindow() - * \sa SDL_FlashWindow() - * \sa SDL_GetWindowData() - * \sa SDL_GetWindowFlags() - * \sa SDL_GetWindowGrab() - * \sa SDL_GetWindowKeyboardGrab() - * \sa SDL_GetWindowMouseGrab() - * \sa SDL_GetWindowPosition() - * \sa SDL_GetWindowSize() - * \sa SDL_GetWindowTitle() - * \sa SDL_HideWindow() - * \sa SDL_MaximizeWindow() - * \sa SDL_MinimizeWindow() - * \sa SDL_RaiseWindow() - * \sa SDL_RestoreWindow() - * \sa SDL_SetWindowData() - * \sa SDL_SetWindowFullscreen() - * \sa SDL_SetWindowGrab() - * \sa SDL_SetWindowKeyboardGrab() - * \sa SDL_SetWindowMouseGrab() - * \sa SDL_SetWindowIcon() - * \sa SDL_SetWindowPosition() - * \sa SDL_SetWindowSize() - * \sa SDL_SetWindowBordered() - * \sa SDL_SetWindowResizable() - * \sa SDL_SetWindowTitle() - * \sa SDL_ShowWindow() + * The opaque type used to identify a window. + * + * \sa SDL_CreateWindow + * \sa SDL_CreateWindowFrom + * \sa SDL_DestroyWindow + * \sa SDL_FlashWindow + * \sa SDL_GetWindowData + * \sa SDL_GetWindowFlags + * \sa SDL_GetWindowGrab + * \sa SDL_GetWindowKeyboardGrab + * \sa SDL_GetWindowMouseGrab + * \sa SDL_GetWindowPosition + * \sa SDL_GetWindowSize + * \sa SDL_GetWindowTitle + * \sa SDL_HideWindow + * \sa SDL_MaximizeWindow + * \sa SDL_MinimizeWindow + * \sa SDL_RaiseWindow + * \sa SDL_RestoreWindow + * \sa SDL_SetWindowData + * \sa SDL_SetWindowFullscreen + * \sa SDL_SetWindowGrab + * \sa SDL_SetWindowKeyboardGrab + * \sa SDL_SetWindowMouseGrab + * \sa SDL_SetWindowIcon + * \sa SDL_SetWindowPosition + * \sa SDL_SetWindowSize + * \sa SDL_SetWindowBordered + * \sa SDL_SetWindowResizable + * \sa SDL_SetWindowTitle + * \sa SDL_ShowWindow */ typedef struct SDL_Window SDL_Window; /** - * \brief The flags on a window + * The flags on a window * - * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowFlags */ -typedef enum +typedef enum SDL_WindowFlags { SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ @@ -131,7 +131,7 @@ typedef enum } SDL_WindowFlags; /** - * \brief Used to indicate that you don't care what the window position is. + * Used to indicate that you don't care what the window position is. */ #define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) @@ -140,7 +140,7 @@ typedef enum (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) /** - * \brief Used to indicate that the window position should be centered. + * Used to indicate that the window position should be centered. */ #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) @@ -149,9 +149,9 @@ typedef enum (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) /** - * \brief Event subtype for window events + * Event subtype for window events */ -typedef enum +typedef enum SDL_WindowEventID { SDL_WINDOWEVENT_NONE, /**< Never used */ SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ @@ -180,20 +180,21 @@ typedef enum } SDL_WindowEventID; /** - * \brief Event subtype for display events + * Event subtype for display events */ -typedef enum +typedef enum SDL_DisplayEventID { SDL_DISPLAYEVENT_NONE, /**< Never used */ SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ - SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */ + SDL_DISPLAYEVENT_DISCONNECTED, /**< Display has been removed from the system */ + SDL_DISPLAYEVENT_MOVED /**< Display has changed position */ } SDL_DisplayEventID; /** - * \brief Display orientation + * Display orientation */ -typedef enum +typedef enum SDL_DisplayOrientation { SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ @@ -203,9 +204,9 @@ typedef enum } SDL_DisplayOrientation; /** - * \brief Window flash operation + * Window flash operation */ -typedef enum +typedef enum SDL_FlashOperation { SDL_FLASH_CANCEL, /**< Cancel any window flash state */ SDL_FLASH_BRIEFLY, /**< Flash the window briefly to get attention */ @@ -213,53 +214,85 @@ typedef enum } SDL_FlashOperation; /** - * \brief An opaque handle to an OpenGL context. + * An opaque handle to an OpenGL context. + * + * \sa SDL_GL_CreateContext */ typedef void *SDL_GLContext; /** - * \brief OpenGL configuration attributes + * OpenGL configuration attributes. + * + * While you can set most OpenGL attributes normally, the attributes listed + * above must be known before SDL creates the window that will be used with + * the OpenGL context. These attributes are set and read with + * SDL_GL_SetAttribute and SDL_GL_GetAttribute. + * + * In some cases, these attributes are minimum requests; the GL does not + * promise to give you exactly what you asked for. It's possible to ask for a + * 16-bit depth buffer and get a 24-bit one instead, for example, or to ask + * for no stencil buffer and still have one available. Context creation should + * fail if the GL can't provide your requested attributes at a minimum, but + * you should check to see exactly what you got. + * + * + * [Multisample anti-aliasing](http://en.wikipedia.org/wiki/Multisample_anti-aliasing) + * is a type of full screen anti-aliasing. Multipsampling defaults to off but + * can be turned on by setting SDL_GL_MULTISAMPLEBUFFERS to 1 and + * SDL_GL_MULTISAMPLESAMPLES to a value greater than 0. Typical values are 2 + * and 4. + * + * SDL_GL_CONTEXT_PROFILE_MASK determines the type of context created, while + * both SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION + * determine which version. All three attributes must be set prior to creating + * the first window, and in general you can't change the value of + * SDL_GL_CONTEXT_PROFILE_MASK without first destroying all windows created + * with the previous setting. + * + * SDL_GL_CONTEXT_RELEASE_BEHAVIOR can be set to + * SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE or + * SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH. */ -typedef enum +typedef enum SDL_GLattr { - SDL_GL_RED_SIZE, - SDL_GL_GREEN_SIZE, - SDL_GL_BLUE_SIZE, - SDL_GL_ALPHA_SIZE, - SDL_GL_BUFFER_SIZE, - SDL_GL_DOUBLEBUFFER, - SDL_GL_DEPTH_SIZE, - SDL_GL_STENCIL_SIZE, - SDL_GL_ACCUM_RED_SIZE, - SDL_GL_ACCUM_GREEN_SIZE, - SDL_GL_ACCUM_BLUE_SIZE, - SDL_GL_ACCUM_ALPHA_SIZE, - SDL_GL_STEREO, - SDL_GL_MULTISAMPLEBUFFERS, - SDL_GL_MULTISAMPLESAMPLES, - SDL_GL_ACCELERATED_VISUAL, - SDL_GL_RETAINED_BACKING, - SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION, - SDL_GL_CONTEXT_EGL, - SDL_GL_CONTEXT_FLAGS, - SDL_GL_CONTEXT_PROFILE_MASK, - SDL_GL_SHARE_WITH_CURRENT_CONTEXT, - SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, - SDL_GL_CONTEXT_RELEASE_BEHAVIOR, + SDL_GL_RED_SIZE, /**< the minimum number of bits for the red channel of the color buffer; defaults to 3. */ + SDL_GL_GREEN_SIZE, /**< the minimum number of bits for the green channel of the color buffer; defaults to 3. */ + SDL_GL_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the color buffer; defaults to 2. */ + SDL_GL_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the color buffer; defaults to 0. */ + SDL_GL_BUFFER_SIZE, /**< the minimum number of bits for frame buffer size; defaults to 0. */ + SDL_GL_DOUBLEBUFFER, /**< whether the output is single or double buffered; defaults to double buffering on. */ + SDL_GL_DEPTH_SIZE, /**< the minimum number of bits in the depth buffer; defaults to 16. */ + SDL_GL_STENCIL_SIZE, /**< the minimum number of bits in the stencil buffer; defaults to 0. */ + SDL_GL_ACCUM_RED_SIZE, /**< the minimum number of bits for the red channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_GREEN_SIZE, /**< the minimum number of bits for the green channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_BLUE_SIZE, /**< the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. */ + SDL_GL_ACCUM_ALPHA_SIZE, /**< the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. */ + SDL_GL_STEREO, /**< whether the output is stereo 3D; defaults to off. */ + SDL_GL_MULTISAMPLEBUFFERS, /**< the number of buffers used for multisample anti-aliasing; defaults to 0. */ + SDL_GL_MULTISAMPLESAMPLES, /**< the number of samples used around the current pixel used for multisample anti-aliasing. */ + SDL_GL_ACCELERATED_VISUAL, /**< set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. */ + SDL_GL_RETAINED_BACKING, /**< not used (deprecated). */ + SDL_GL_CONTEXT_MAJOR_VERSION, /**< OpenGL context major version. */ + SDL_GL_CONTEXT_MINOR_VERSION, /**< OpenGL context minor version. */ + SDL_GL_CONTEXT_EGL, /**< deprecated: set SDL_GL_CONTEXT_PROFILE_MASK to SDL_GL_CONTEXT_PROFILE_ES to enable instead. */ + SDL_GL_CONTEXT_FLAGS, /**< some combination of 0 or more of elements of the SDL_GLcontextFlag enumeration; defaults to 0. */ + SDL_GL_CONTEXT_PROFILE_MASK, /**< type of GL context (Core, Compatibility, ES). See SDL_GLprofile; default value depends on platform. */ + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, /**< OpenGL context sharing; defaults to 0. */ + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, /**< requests sRGB capable visual; defaults to 0. (>= SDL 2.0.1) */ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, /**< sets context the release behavior; defaults to 1. (>= SDL 2.0.4) */ SDL_GL_CONTEXT_RESET_NOTIFICATION, SDL_GL_CONTEXT_NO_ERROR, SDL_GL_FLOATBUFFERS } SDL_GLattr; -typedef enum +typedef enum SDL_GLprofile { SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ } SDL_GLprofile; -typedef enum +typedef enum SDL_GLcontextFlag { SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, @@ -267,13 +300,13 @@ typedef enum SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 } SDL_GLcontextFlag; -typedef enum +typedef enum SDL_GLcontextReleaseFlag { SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 } SDL_GLcontextReleaseFlag; -typedef enum +typedef enum SDL_GLContextResetNotification { SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 @@ -299,7 +332,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); * The video drivers are presented in the order in which they are normally * checked during initialization. * - * \param index the index of a video driver + * \param index the index of a video driver. * \returns the name of the video driver with the given **index**. * * \since This function is available since SDL 2.0.0. @@ -326,7 +359,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); * specific `driver_name`. * * \param driver_name the name of a video driver to initialize, or NULL for - * the default driver + * the default driver. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -379,7 +412,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); * Get the name of a display in UTF-8 encoding. * * \param displayIndex the index of display from which the name should be - * queried + * queried. * \returns the name of a display or NULL for an invalid display index or * failure; call SDL_GetError() for more information. * @@ -394,8 +427,8 @@ extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); * * The primary display (`displayIndex` zero) is always located at 0,0. * - * \param displayIndex the index of the display to query - * \param rect the SDL_Rect structure filled in with the display bounds + * \param displayIndex the index of the display to query. + * \param rect the SDL_Rect structure filled in with the display bounds. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -424,8 +457,8 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * re * range. * * \param displayIndex the index of the display to query the usable bounds - * from - * \param rect the SDL_Rect structure filled in with the display bounds + * from. + * \param rect the SDL_Rect structure filled in with the display bounds. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -455,13 +488,13 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rec * more consistent, reliable, and clear. * * \param displayIndex the index of the display from which DPI information - * should be queried + * should be queried. * \param ddpi a pointer filled in with the diagonal DPI of the display; may - * be NULL + * be NULL. * \param hdpi a pointer filled in with the horizontal DPI of the display; may - * be NULL + * be NULL. * \param vdpi a pointer filled in with the vertical DPI of the display; may - * be NULL + * be NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -474,7 +507,7 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, fl /** * Get the orientation of a display. * - * \param displayIndex the index of the display to query + * \param displayIndex the index of the display to query. * \returns The SDL_DisplayOrientation enum value of the display, or * `SDL_ORIENTATION_UNKNOWN` if it isn't available. * @@ -490,7 +523,7 @@ extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int dis * The `displayIndex` needs to be in the range from 0 to * SDL_GetNumVideoDisplays() - 1. * - * \param displayIndex the index of the display to query + * \param displayIndex the index of the display to query. * \returns a number >= 1 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -512,10 +545,10 @@ extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); * - packed pixel layout -> largest to smallest * - refresh rate -> highest to lowest * - * \param displayIndex the index of the display to query - * \param modeIndex the index of the display mode to query + * \param displayIndex the index of the display to query. + * \param modeIndex the index of the display mode to query. * \param mode an SDL_DisplayMode structure filled in with the mode at - * `modeIndex` + * `modeIndex`. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -534,9 +567,9 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, * function will return the previous native display mode, and not the current * display mode. * - * \param displayIndex the index of the display to query + * \param displayIndex the index of the display to query. * \param mode an SDL_DisplayMode structure filled in with the current display - * mode + * mode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -556,9 +589,9 @@ extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_Disp * function will return the current display mode, and not the previous native * display mode. * - * \param displayIndex the index of the display to query + * \param displayIndex the index of the display to query. * \param mode an SDL_DisplayMode structure filled in with the current display - * mode + * mode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -582,11 +615,11 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_Disp * and finally checking the refresh rate. If all the available modes are too * small, then NULL is returned. * - * \param displayIndex the index of the display to query + * \param displayIndex the index of the display to query. * \param mode an SDL_DisplayMode structure containing the desired display - * mode + * mode. * \param closest an SDL_DisplayMode structure filled in with the closest - * match of the available display modes + * match of the available display modes. * \returns the passed in value `closest` or NULL if no matching video mode * was available; call SDL_GetError() for more information. * @@ -600,7 +633,7 @@ extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayI /** * Get the index of the display containing a point * - * \param point the point to query + * \param point the point to query. * \returns the index of the display containing the point or a negative error * code on failure; call SDL_GetError() for more information. * @@ -614,7 +647,7 @@ extern DECLSPEC int SDLCALL SDL_GetPointDisplayIndex(const SDL_Point * point); /** * Get the index of the display primarily containing a rect * - * \param rect the rect to query + * \param rect the rect to query. * \returns the index of the display entirely containing the rect or closest * to the center of the rect on success or a negative error code on * failure; call SDL_GetError() for more information. @@ -629,7 +662,7 @@ extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect); /** * Get the index of the display associated with a window. * - * \param window the window to query + * \param window the window to query. * \returns the index of the display containing the center of the window on * success or a negative error code on failure; call SDL_GetError() * for more information. @@ -648,10 +681,10 @@ extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); * change the window size when the window is not fullscreen, use * SDL_SetWindowSize(). * - * \param window the window to affect + * \param window the window to affect. * \param mode the SDL_DisplayMode structure representing the mode to use, or * NULL to use the window's dimensions and the desktop's format - * and refresh rate + * and refresh rate. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -666,9 +699,9 @@ extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, /** * Query the display mode to use when a window is visible at fullscreen. * - * \param window the window to query + * \param window the window to query. * \param mode an SDL_DisplayMode structure filled in with the fullscreen - * display mode + * display mode. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -685,8 +718,8 @@ extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, * * Data returned should be freed with SDL_free. * - * \param window the window to query - * \param size the size of the ICC profile + * \param window the window to query. + * \param size the size of the ICC profile. * \returns the raw ICC profile data on success or NULL on failure; call * SDL_GetError() for more information. * @@ -697,7 +730,7 @@ extern DECLSPEC void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_ /** * Get the pixel format associated with the window. * - * \param window the window to query + * \param window the window to query. * \returns the pixel format of the window on success or * SDL_PIXELFORMAT_UNKNOWN on failure; call SDL_GetError() for more * information. @@ -761,15 +794,15 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); * loader or link to a dynamic library version. This limitation may be removed * in a future version of SDL. * - * \param title the title of the window, in UTF-8 encoding + * \param title the title of the window, in UTF-8 encoding. * \param x the x position of the window, `SDL_WINDOWPOS_CENTERED`, or - * `SDL_WINDOWPOS_UNDEFINED` + * `SDL_WINDOWPOS_UNDEFINED`. * \param y the y position of the window, `SDL_WINDOWPOS_CENTERED`, or - * `SDL_WINDOWPOS_UNDEFINED` - * \param w the width of the window, in screen coordinates - * \param h the height of the window, in screen coordinates - * \param flags 0, or one or more SDL_WindowFlags OR'd together - * \returns the window that was created or NULL on failure; call + * `SDL_WINDOWPOS_UNDEFINED`. + * \param w the width of the window, in screen coordinates. + * \param h the height of the window, in screen coordinates. + * \param flags 0, or one or more SDL_WindowFlags OR'd together. + * \returns the `SDL_Window` that was created or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 2.0.0. @@ -789,7 +822,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, * before using SDL_CreateWindowFrom(). * * \param data a pointer to driver-dependent window creation data, typically - * your native window cast to a void* + * your native window cast to a void*. * \returns the window that was created or NULL on failure; call * SDL_GetError() for more information. * @@ -806,7 +839,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); * The numeric ID is what SDL_WindowEvent references, and is necessary to map * these events to specific SDL_Window objects. * - * \param window the window to query + * \param window the window to query. * \returns the ID of the window on success or 0 on failure; call * SDL_GetError() for more information. * @@ -822,7 +855,7 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); * The numeric ID is what SDL_WindowEvent references, and is necessary to map * these events to specific SDL_Window objects. * - * \param id the ID of the window + * \param id the ID of the window. * \returns the window associated with `id` or NULL if it doesn't exist; call * SDL_GetError() for more information. * @@ -835,8 +868,8 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); /** * Get the window flags. * - * \param window the window to query - * \returns a mask of the SDL_WindowFlags associated with `window` + * \param window the window to query. + * \returns a mask of the SDL_WindowFlags associated with `window`. * * \since This function is available since SDL 2.0.0. * @@ -855,8 +888,8 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); * * This string is expected to be in UTF-8 encoding. * - * \param window the window to change - * \param title the desired window title in UTF-8 format + * \param window the window to change. + * \param title the desired window title in UTF-8 format. * * \since This function is available since SDL 2.0.0. * @@ -868,7 +901,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, /** * Get the title of a window. * - * \param window the window to query + * \param window the window to query. * \returns the title of the window in UTF-8 format or "" if there is no * title. * @@ -881,8 +914,8 @@ extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); /** * Set the icon for a window. * - * \param window the window to change - * \param icon an SDL_Surface structure containing the icon for the window + * \param window the window to change. + * \param icon an SDL_Surface structure containing the icon for the window. * * \since This function is available since SDL 2.0.0. */ @@ -894,9 +927,9 @@ extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, * * `name` is case-sensitive. * - * \param window the window to associate with the pointer - * \param name the name of the pointer - * \param userdata the associated pointer + * \param window the window to associate with the pointer. + * \param name the name of the pointer. + * \param userdata the associated pointer. * \returns the previous value associated with `name`. * * \since This function is available since SDL 2.0.0. @@ -910,8 +943,8 @@ extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, /** * Retrieve the data pointer associated with a window. * - * \param window the window to query - * \param name the name of the pointer + * \param window the window to query. + * \param name the name of the pointer. * \returns the value associated with `name`. * * \since This function is available since SDL 2.0.0. @@ -926,11 +959,11 @@ extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, * * The window coordinate origin is the upper left of the display. * - * \param window the window to reposition + * \param window the window to reposition. * \param x the x coordinate of the window in screen coordinates, or - * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` + * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED`. * \param y the y coordinate of the window in screen coordinates, or - * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` + * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED`. * * \since This function is available since SDL 2.0.0. * @@ -945,11 +978,11 @@ extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, * If you do not need the value for one of the positions a NULL may be passed * in the `x` or `y` parameter. * - * \param window the window to query + * \param window the window to query. * \param x a pointer filled in with the x position of the window, in screen - * coordinates, may be NULL + * coordinates, may be NULL. * \param y a pointer filled in with the y position of the window, in screen - * coordinates, may be NULL + * coordinates, may be NULL. * * \since This function is available since SDL 2.0.0. * @@ -969,11 +1002,13 @@ extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, * Fullscreen windows automatically match the size of the display mode, and * you should use SDL_SetWindowDisplayMode() to change their size. * - * \param window the window to change + * \param window the window to change. * \param w the width of the window in pixels, in screen coordinates, must be - * > 0 + * > 0. * \param h the height of the window in pixels, in screen coordinates, must be - * > 0 + * > 0. + * + * \threadsafety This function should only be called on the main thread. * * \since This function is available since SDL 2.0.0. * @@ -995,11 +1030,11 @@ extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to get the * real client area size in pixels. * - * \param window the window to query the width and height from + * \param window the window to query the width and height from. * \param w a pointer filled in with the width of the window, in screen - * coordinates, may be NULL + * coordinates, may be NULL. * \param h a pointer filled in with the height of the window, in screen - * coordinates, may be NULL + * coordinates, may be NULL. * * \since This function is available since SDL 2.0.0. * @@ -1026,15 +1061,15 @@ extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, * This function also returns -1 if getting the information is not supported. * * \param window the window to query the size values of the border - * (decorations) from + * (decorations) from. * \param top pointer to variable for storing the size of the top border; NULL - * is permitted + * is permitted. * \param left pointer to variable for storing the size of the left border; - * NULL is permitted + * NULL is permitted. * \param bottom pointer to variable for storing the size of the bottom - * border; NULL is permitted + * border; NULL is permitted. * \param right pointer to variable for storing the size of the right border; - * NULL is permitted + * NULL is permitted. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1054,10 +1089,11 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, * platform with high-DPI support (Apple calls this "Retina"), and not * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. * - * \param window the window from which the drawable size should be queried - * \param w a pointer to variable for storing the width in pixels, may be NULL + * \param window the window from which the drawable size should be queried. + * \param w a pointer to variable for storing the width in pixels, may be + * NULL. * \param h a pointer to variable for storing the height in pixels, may be - * NULL + * NULL. * * \since This function is available since SDL 2.26.0. * @@ -1070,9 +1106,9 @@ extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window, /** * Set the minimum size of a window's client area. * - * \param window the window to change - * \param min_w the minimum width of the window in pixels - * \param min_h the minimum height of the window in pixels + * \param window the window to change. + * \param min_w the minimum width of the window in pixels. + * \param min_h the minimum height of the window in pixels. * * \since This function is available since SDL 2.0.0. * @@ -1085,11 +1121,11 @@ extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, /** * Get the minimum size of a window's client area. * - * \param window the window to query + * \param window the window to query. * \param w a pointer filled in with the minimum width of the window, may be - * NULL + * NULL. * \param h a pointer filled in with the minimum height of the window, may be - * NULL + * NULL. * * \since This function is available since SDL 2.0.0. * @@ -1102,9 +1138,9 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, /** * Set the maximum size of a window's client area. * - * \param window the window to change - * \param max_w the maximum width of the window in pixels - * \param max_h the maximum height of the window in pixels + * \param window the window to change. + * \param max_w the maximum width of the window in pixels. + * \param max_h the maximum height of the window in pixels. * * \since This function is available since SDL 2.0.0. * @@ -1117,11 +1153,11 @@ extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, /** * Get the maximum size of a window's client area. * - * \param window the window to query + * \param window the window to query. * \param w a pointer filled in with the maximum width of the window, may be - * NULL + * NULL. * \param h a pointer filled in with the maximum height of the window, may be - * NULL + * NULL. * * \since This function is available since SDL 2.0.0. * @@ -1140,8 +1176,8 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, * * You can't change the border state of a fullscreen window. * - * \param window the window of which to change the border state - * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border + * \param window the window of which to change the border state. + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. * * \since This function is available since SDL 2.0.0. * @@ -1159,8 +1195,8 @@ extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, * * You can't change the resizable state of a fullscreen window. * - * \param window the window of which to change the resizable state - * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow + * \param window the window of which to change the resizable state. + * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow. * * \since This function is available since SDL 2.0.5. * @@ -1175,9 +1211,9 @@ extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, * This will add or remove the window's `SDL_WINDOW_ALWAYS_ON_TOP` flag. This * will bring the window to the front and keep the window above the rest. * - * \param window The window of which to change the always on top state + * \param window The window of which to change the always on top state. * \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to - * disable + * disable. * * \since This function is available since SDL 2.0.16. * @@ -1189,7 +1225,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window * window, /** * Show a window. * - * \param window the window to show + * \param window the window to show. * * \since This function is available since SDL 2.0.0. * @@ -1201,7 +1237,7 @@ extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); /** * Hide a window. * - * \param window the window to hide + * \param window the window to hide. * * \since This function is available since SDL 2.0.0. * @@ -1212,7 +1248,7 @@ extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); /** * Raise a window above other windows and set the input focus. * - * \param window the window to raise + * \param window the window to raise. * * \since This function is available since SDL 2.0.0. */ @@ -1221,7 +1257,7 @@ extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); /** * Make a window as large as possible. * - * \param window the window to maximize + * \param window the window to maximize. * * \since This function is available since SDL 2.0.0. * @@ -1233,7 +1269,7 @@ extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); /** * Minimize a window to an iconic representation. * - * \param window the window to minimize + * \param window the window to minimize. * * \since This function is available since SDL 2.0.0. * @@ -1245,7 +1281,7 @@ extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); /** * Restore the size and position of a minimized or maximized window. * - * \param window the window to restore + * \param window the window to restore. * * \since This function is available since SDL 2.0.0. * @@ -1261,8 +1297,12 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); * videomode change; `SDL_WINDOW_FULLSCREEN_DESKTOP` for "fake" fullscreen * that takes the size of the desktop; and 0 for windowed mode. * - * \param window the window to change - * \param flags `SDL_WINDOW_FULLSCREEN`, `SDL_WINDOW_FULLSCREEN_DESKTOP` or 0 + * Note that for some renderers, this function may trigger an + * SDL_RENDER_TARGETS_RESET event. Your application should be prepared to + * handle this event by reuploading textures! + * + * \param window the window to change. + * \param flags `SDL_WINDOW_FULLSCREEN`, `SDL_WINDOW_FULLSCREEN_DESKTOP` or 0. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1274,6 +1314,19 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags); +/** + * Return whether the window has a surface associated with it. + * + * \param window the window to query. + * \returns SDL_TRUE if there is a surface associated with the window, or + * SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasWindowSurface(SDL_Window *window); + /** * Get the SDL surface associated with the window. * @@ -1284,16 +1337,22 @@ extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, * This surface will be invalidated if the window is resized. After resizing a * window this function must be called again to return a valid surface. * + * Note that on some platforms the pixels pointer of the surface may be + * modified after each call to SDL_UpdateWindowSurface(), so that the platform + * code can implement efficient double or triple buffering. + * * You may not combine this with 3D or the rendering API on this window. * * This function is affected by `SDL_HINT_FRAMEBUFFER_ACCELERATION`. * - * \param window the window to query + * \param window the window to query. * \returns the surface associated with the window, or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 2.0.0. * + * \sa SDL_DestroyWindowSurface + * \sa SDL_HasWindowSurface * \sa SDL_UpdateWindowSurface * \sa SDL_UpdateWindowSurfaceRects */ @@ -1307,7 +1366,7 @@ extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); * * This function is equivalent to the SDL 1.2 API SDL_Flip(). * - * \param window the window to update + * \param window the window to update. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1326,10 +1385,15 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); * * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). * - * \param window the window to update + * Note that this function will update _at least_ the rectangles specified, + * but this is only intended as an optimization; in practice, this might + * update more of the screen (or all of the screen!), depending on what method + * SDL uses to send pixels to the system. + * + * \param window the window to update. * \param rects an array of SDL_Rect structures representing areas of the - * surface to copy - * \param numrects the number of rectangles + * surface to copy, in pixels. + * \param numrects the number of rectangles. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1342,6 +1406,20 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, int numrects); +/** + * Destroy the surface associated with the window. + * + * \param window the window to update. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + * \sa SDL_HasWindowSurface + */ +extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window); + /** * Set a window's input grab mode. * @@ -1352,8 +1430,8 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, * If the caller enables a grab while another window is currently grabbed, the * other window loses its grab in favor of the caller's window. * - * \param window the window for which the input grab mode should be set - * \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input + * \param window the window for which the input grab mode should be set. + * \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input. * * \since This function is available since SDL 2.0.0. * @@ -1414,7 +1492,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowMouseGrab(SDL_Window * window, /** * Get a window's input grab mode. * - * \param window the window to query + * \param window the window to query. * \returns SDL_TRUE if input is grabbed, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -1426,7 +1504,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); /** * Get a window's keyboard grab mode. * - * \param window the window to query + * \param window the window to query. * \returns SDL_TRUE if keyboard is grabbed, and SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.16. @@ -1439,7 +1517,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window * window); /** * Get a window's mouse grab mode. * - * \param window the window to query + * \param window the window to query. * \returns SDL_TRUE if mouse is grabbed, and SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.16. @@ -1483,7 +1561,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window * window, const SD /** * Get the mouse confinement rectangle of a window. * - * \param window The window to query + * \param window The window to query. * \returns A pointer to the mouse confinement rectangle of a window, or NULL * if there isn't one. * @@ -1508,9 +1586,9 @@ extern DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * win * something similar. * * \param window the window used to select the display whose brightness will - * be changed + * be changed. * \param brightness the brightness (gamma multiplier) value to set where 0.0 - * is completely dark and 1.0 is normal brightness + * is completely dark and 1.0 is normal brightness. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1530,7 +1608,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float b * this display can be retrieved using SDL_GetWindowDisplayIndex().) * * \param window the window used to select the display whose brightness will - * be queried + * be queried. * \returns the brightness for the display where 0.0 is completely dark and * 1.0 is normal brightness. * @@ -1548,8 +1626,8 @@ extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); * * This function also returns -1 if setting the opacity isn't supported. * - * \param window the window which will be made transparent or opaque - * \param opacity the opacity value (0.0f - transparent, 1.0f - opaque) + * \param window the window which will be made transparent or opaque. + * \param opacity the opacity value (0.0f - transparent, 1.0f - opaque). * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1569,8 +1647,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opac * * This function also returns -1 if an invalid window was provided. * - * \param window the window to get the current opacity value from - * \param out_opacity the float filled in (0.0f - transparent, 1.0f - opaque) + * \param window the window to get the current opacity value from. + * \param out_opacity the float filled in (0.0f - transparent, 1.0f - opaque). * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1583,8 +1661,8 @@ extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * ou /** * Set the window as a modal for another window. * - * \param modal_window the window that should be set modal - * \param parent_window the parent window for the modal window + * \param modal_window the window that should be set modal. + * \param parent_window the parent window for the modal window. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1599,7 +1677,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL * this with caution, as you might give focus to a window that is completely * obscured by other windows. * - * \param window the window that should get the input focus + * \param window the window that should get the input focus. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1625,13 +1703,13 @@ extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); * ramp set will not follow the window if it is moved to another display. * * \param window the window used to select the display whose gamma ramp will - * be changed + * be changed. * \param red a 256 element array of 16-bit quantities representing the - * translation table for the red channel, or NULL + * translation table for the red channel, or NULL. * \param green a 256 element array of 16-bit quantities representing the - * translation table for the green channel, or NULL + * translation table for the green channel, or NULL. * \param blue a 256 element array of 16-bit quantities representing the - * translation table for the blue channel, or NULL + * translation table for the blue channel, or NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1653,13 +1731,13 @@ extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, * this display can be retrieved using SDL_GetWindowDisplayIndex().) * * \param window the window used to select the display whose gamma ramp will - * be queried + * be queried. * \param red a 256 element array of 16-bit quantities filled in with the - * translation table for the red channel, or NULL + * translation table for the red channel, or NULL. * \param green a 256 element array of 16-bit quantities filled in with the - * translation table for the green channel, or NULL + * translation table for the green channel, or NULL. * \param blue a 256 element array of 16-bit quantities filled in with the - * translation table for the blue channel, or NULL + * translation table for the blue channel, or NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1677,7 +1755,7 @@ extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, * * \sa SDL_HitTest */ -typedef enum +typedef enum SDL_HitTestResult { SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ @@ -1694,9 +1772,9 @@ typedef enum /** * Callback used for hit-testing. * - * \param win the SDL_Window where hit-testing was set on - * \param area an SDL_Point which should be hit-tested - * \param data what was passed as `callback_data` to SDL_SetWindowHitTest() + * \param win the SDL_Window where hit-testing was set on. + * \param area an SDL_Point which should be hit-tested. + * \param data what was passed as `callback_data` to SDL_SetWindowHitTest(). * \return an SDL_HitTestResult value. * * \sa SDL_SetWindowHitTest @@ -1737,9 +1815,9 @@ typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, * can fire at any time, you should try to keep your callback efficient, * devoid of allocations, etc. * - * \param window the window to set hit-testing on - * \param callback the function to call when doing a hit-test - * \param callback_data an app-defined void pointer passed to **callback** + * \param window the window to set hit-testing on. + * \param callback the function to call when doing a hit-test. + * \param callback_data an app-defined void pointer passed to **callback**. * \returns 0 on success or -1 on error (including unsupported); call * SDL_GetError() for more information. * @@ -1752,8 +1830,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, /** * Request a window to demand attention from the user. * - * \param window the window to be flashed - * \param operation the flash operation + * \param window the window to be flashed. + * \param operation the flash operation. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1767,7 +1845,7 @@ extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window * window, SDL_FlashOperat * If `window` is NULL, this function will return immediately after setting * the SDL error message to "Invalid window". See SDL_GetError(). * - * \param window the window to destroy + * \param window the window to destroy. * * \since This function is available since SDL 2.0.0. * @@ -1838,7 +1916,7 @@ extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); * program from the dynamic library using SDL_GL_GetProcAddress(). * * \param path the platform dependent OpenGL library name, or NULL to open the - * default OpenGL library + * default OpenGL library. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1890,7 +1968,7 @@ extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); * code. This will ensure the proper calling convention is followed on * platforms where this matters (Win32) thereby avoiding stack corruption. * - * \param proc the name of an OpenGL function + * \param proc the name of an OpenGL function. * \returns a pointer to the named OpenGL function. The returned pointer * should be cast to the appropriate function signature. * @@ -1925,7 +2003,7 @@ extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); * context and save that information somewhere instead of calling the function * every time you need to know. * - * \param extension the name of the extension to check + * \param extension the name of the extension to check. * \returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise. * * \since This function is available since SDL 2.0.0. @@ -1951,8 +2029,9 @@ extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); * SDL_GL_GetAttribute() to check the values after creating the OpenGL * context, since the values obtained can differ from the requested ones. * - * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to set - * \param value the desired value for the attribute + * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to + * set. + * \param value the desired value for the attribute. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1966,8 +2045,9 @@ extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); /** * Get the actual value for an attribute from the current context. * - * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to get - * \param value a pointer filled in with the current value of `attr` + * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to + * get. + * \param value a pointer filled in with the current value of `attr`. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1989,7 +2069,7 @@ extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); * * SDL_GLContext is an alias for `void *`. It's opaque to the application. * - * \param window the window to associate with the context + * \param window the window to associate with the context. * \returns the OpenGL context associated with `window` or NULL on error; call * SDL_GetError() for more details. * @@ -2006,8 +2086,8 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * * * The context must have been created with a compatible window. * - * \param window the window to associate with the context - * \param context the OpenGL context to associate with the window + * \param window the window to associate with the context. + * \param context the OpenGL context to associate with the window. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -2050,10 +2130,11 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); * platform with high-DPI support (Apple calls this "Retina"), and not * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. * - * \param window the window from which the drawable size should be queried - * \param w a pointer to variable for storing the width in pixels, may be NULL + * \param window the window from which the drawable size should be queried. + * \param w a pointer to variable for storing the width in pixels, may be + * NULL. * \param h a pointer to variable for storing the height in pixels, may be - * NULL + * NULL. * * \since This function is available since SDL 2.0.1. * @@ -2082,7 +2163,7 @@ extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, * https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync * * \param interval 0 for immediate updates, 1 for updates synchronized with - * the vertical retrace, -1 for adaptive vsync + * the vertical retrace, -1 for adaptive vsync. * \returns 0 on success or -1 if setting the swap interval is not supported; * call SDL_GetError() for more information. * @@ -2119,7 +2200,7 @@ extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); * glBindFramebuffer(), this is the default and you won't have to do anything * extra. * - * \param window the window to change + * \param window the window to change. * * \since This function is available since SDL 2.0.0. */ @@ -2128,7 +2209,7 @@ extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); /** * Delete an OpenGL context. * - * \param context the OpenGL context to be deleted + * \param context the OpenGL context to be deleted. * * \since This function is available since SDL 2.0.0. * diff --git a/include/SDL_vulkan.h b/include/SDL_vulkan.h index ab86a0b8656a1..e005ed373ba44 100644 --- a/include/SDL_vulkan.h +++ b/include/SDL_vulkan.h @@ -20,9 +20,9 @@ */ /** - * \file SDL_vulkan.h + * # CategoryVulkan * - * Header file for functions to creating Vulkan surfaces on SDL windows. + * Header file for functions to creating Vulkan surfaces on SDL windows. */ #ifndef SDL_vulkan_h_ @@ -52,6 +52,10 @@ extern "C" { VK_DEFINE_HANDLE(VkInstance) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) +/* Make sure to undef to avoid issues in case of later vulkan include */ +#undef VK_DEFINE_HANDLE +#undef VK_DEFINE_NON_DISPATCHABLE_HANDLE + #endif /* !NO_SDL_VULKAN_TYPEDEFS */ typedef VkInstance SDL_vulkanInstance; @@ -97,13 +101,13 @@ typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */ * supported. Either do not link to the Vulkan loader or link to a dynamic * library version. * - * \param path The platform dependent Vulkan loader library name or NULL + * \param path The platform dependent Vulkan loader library name or NULL. * \returns 0 on success or -1 if the library couldn't be loaded; call * SDL_GetError() for more information. * * \since This function is available since SDL 2.0.6. * - * \sa SDL_Vulkan_GetVkInstanceProcAddr + * \sa SDL_Vulkan_GetVkGetInstanceProcAddr * \sa SDL_Vulkan_UnloadLibrary */ extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); @@ -146,11 +150,11 @@ extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * however, this parameter will likely be removed in future releases * * \param window A window for which the required Vulkan instance extensions - * should be retrieved (will be deprecated in a future release) + * should be retrieved (will be deprecated in a future release). * \param pCount A pointer to an unsigned int corresponding to the number of - * extensions to be returned + * extensions to be returned. * \param pNames NULL or a pointer to an array to be filled with required - * Vulkan instance extensions + * Vulkan instance extensions. * \returns SDL_TRUE on success, SDL_FALSE on error. * * \since This function is available since SDL 2.0.6. @@ -168,10 +172,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *wi * `instance` must have been created with extensions returned by * SDL_Vulkan_GetInstanceExtensions() enabled. * - * \param window The window to which to attach the Vulkan surface - * \param instance The Vulkan instance handle + * \param window The window to which to attach the Vulkan surface. + * \param instance The Vulkan instance handle. * \param surface A pointer to a VkSurfaceKHR handle to output the newly - * created surface + * created surface. * \returns SDL_TRUE on success, SDL_FALSE on error. * * \since This function is available since SDL 2.0.6. @@ -191,9 +195,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, * platform with high-DPI support (Apple calls this "Retina"), and not * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. * - * \param window an SDL_Window for which the size is to be queried - * \param w Pointer to the variable to write the width to or NULL - * \param h Pointer to the variable to write the height to or NULL + * \param window an SDL_Window for which the size is to be queried. + * \param w Pointer to the variable to write the width to or NULL. + * \param h Pointer to the variable to write the height to or NULL. * * \since This function is available since SDL 2.0.6. * diff --git a/include/begin_code.h b/include/begin_code.h index b3e69e85c7482..2044e5cb06eb4 100644 --- a/include/begin_code.h +++ b/include/begin_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,23 +19,25 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* WIKI CATEGORY: BeginCode */ + /** - * \file begin_code.h - * - * This file sets things up for C dynamic library function definitions, - * static inlined functions, and structures aligned at 4-byte alignment. - * If you don't like ugly C preprocessor code, don't look at this file. :) + * begin_code.h sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) */ /* This shouldn't be nested -- included it around code only. */ -#ifdef _begin_code_h +#ifdef SDL_begin_code_h #error Nested inclusion of begin_code.h #endif -#define _begin_code_h +#define SDL_begin_code_h #ifndef SDL_DEPRECATED # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ # define SDL_DEPRECATED __attribute__((deprecated)) +# elif defined(_MSC_VER) +# define SDL_DEPRECATED __declspec(deprecated) # else # define SDL_DEPRECATED # endif @@ -170,18 +172,18 @@ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) #define SDL_FALLTHROUGH [[fallthrough]] #else -#if defined(__has_attribute) -#define _HAS_FALLTHROUGH __has_attribute(__fallthrough__) +#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) +#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__) #else -#define _HAS_FALLTHROUGH 0 +#define SDL_HAS_FALLTHROUGH 0 #endif /* __has_attribute */ -#if _HAS_FALLTHROUGH && \ +#if SDL_HAS_FALLTHROUGH && \ ((defined(__GNUC__) && __GNUC__ >= 7) || \ (defined(__clang_major__) && __clang_major__ >= 10)) #define SDL_FALLTHROUGH __attribute__((__fallthrough__)) #else #define SDL_FALLTHROUGH do {} while (0) /* fallthrough */ -#endif /* _HAS_FALLTHROUGH */ -#undef _HAS_FALLTHROUGH +#endif /* SDL_HAS_FALLTHROUGH */ +#undef SDL_HAS_FALLTHROUGH #endif /* C++17 or C2x */ #endif /* SDL_FALLTHROUGH not defined */ diff --git a/include/close_code.h b/include/close_code.h index dc73432f62286..f991f458d5909 100644 --- a/include/close_code.h +++ b/include/close_code.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,10 +26,10 @@ * after you finish any function and structure declarations in your headers */ -#ifndef _begin_code_h +#ifndef SDL_begin_code_h #error close_code.h included without matching begin_code.h #endif -#undef _begin_code_h +#undef SDL_begin_code_h /* Reset structure packing at previous byte alignment */ #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) diff --git a/mingw/pkg-support/INSTALL.txt b/mingw/pkg-support/INSTALL.txt new file mode 100644 index 0000000000000..607dafd0ee0a7 --- /dev/null +++ b/mingw/pkg-support/INSTALL.txt @@ -0,0 +1,18 @@ + +The 32-bit files are in i686-w64-mingw32 +The 64-bit files are in x86_64-w64-mingw32 + +To install SDL for native development: + make native + +To install SDL for cross-compiling development: + make cross + +Look at the example programs in ./test, and check out online documentation: + http://wiki.libsdl.org/ + +Join the SDL developer mailing list if you want to join the community: + http://www.libsdl.org/mailing-list.php + +That's it! +Sam Lantinga diff --git a/mingw/pkg-support/Makefile b/mingw/pkg-support/Makefile new file mode 100644 index 0000000000000..dd01419d17f41 --- /dev/null +++ b/mingw/pkg-support/Makefile @@ -0,0 +1,37 @@ +# +# Makefile for installing the mingw32 version of the SDL library + +CROSS_PATH := /usr/local +ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32 + +all install: + @echo "Type \"$(MAKE) native\" to install 32-bit to /usr" + @echo "Type \"$(MAKE) cross\" to install 32-bit and 64-bit to $(CROSS_PATH)" + +native: + $(MAKE) install-package arch=i686-w64-mingw32 prefix=/usr + +cross: + mkdir -p $(CROSS_PATH)/cmake + cp -rv cmake/* $(CROSS_PATH)/cmake + for arch in $(ARCHITECTURES); do \ + mkdir -p $(CROSS_PATH)/$$arch; \ + $(MAKE) install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \ + done + +install-package: + @if test -d $(arch) && test -d $(prefix); then \ + (cd $(arch) && cp -rv bin include lib share $(prefix)/); \ + sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/bin/sdl2-config >$(prefix)/bin/sdl2-config; \ + chmod 755 $(prefix)/bin/sdl2-config; \ + sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2.la >$(prefix)/lib/libSDL2.la; \ + sed -e "s|^set[(]bindir \".*|set(bindir \"$(prefix)/bin\")|" \ + -e "s|^set[(]includedir \".*|set(includedir \"$(prefix)/include\")|" \ + -e "s|^set[(]libdir \".*|set(libdir \"$(prefix)/lib\")|" <$(arch)/lib/cmake/SDL2/sdl2-config.cmake >$(prefix)/lib/cmake/SDL2/sdl2-config.cmake; \ + sed -e "s|^prefix=.*|prefix=$(prefix)|" \ + -e "s|^includedir=.*|includedir=$(prefix)/include|" \ + -e "s|^libdir=.*|libdir=$(prefix)/lib|" <$(arch)/lib/pkgconfig/sdl2.pc >$(prefix)/lib/pkgconfig/sdl2.pc; \ + else \ + echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \ + exit 1; \ + fi diff --git a/sdl2-config.cmake.in b/sdl2-config.cmake.in index 5d6cf4335f87a..f3fa08c218318 100644 --- a/sdl2-config.cmake.in +++ b/sdl2-config.cmake.in @@ -14,6 +14,7 @@ macro(set_and_check _var _file) endif() endmacro() +get_filename_component(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR} REALPATH) get_filename_component(prefix "${CMAKE_CURRENT_LIST_DIR}/@cmake_prefix_relpath@" ABSOLUTE) set(exec_prefix "@exec_prefix@") @@ -55,16 +56,24 @@ list(APPEND _sdl2_libdirs "${SDL2_LIBDIR}") string(REGEX MATCHALL "(-[lm]([-a-zA-Z0-9._]+))|(-Wl,[^ ]*framework[^ ]*)|(-pthread)" _sdl2_static_private_libs "${_sdl2_static_private_libs_in}") string(REGEX REPLACE "^-l" "" _sdl2_static_private_libs "${_sdl2_static_private_libs}") string(REGEX REPLACE ";-l" ";" _sdl2_static_private_libs "${_sdl2_static_private_libs}") +string(REGEX REPLACE "-Wl,-framework,([a-zA-Z0-9_]+)" "$" _sdl2_static_private_libs "${_sdl2_static_private_libs}") +string(REGEX REPLACE "-Wl,-weak_framework,([a-zA-Z0-9_]+)" "$" _sdl2_static_private_libs "${_sdl2_static_private_libs}") + string(REGEX MATCHALL "-L([-a-zA-Z0-9._/]+)" _sdl2_static_private_libdirs "${_sdl2_static_private_libs_in}") string(REGEX REPLACE "^-L" "" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}") string(REGEX REPLACE ";-L" ";" _sdl2_static_private_libdirs "${_sdl2_static_private_libdirs}") +# Set SDL2_NO_MWINDOWS to a true-ish value to not add the -mwindows link option +if(SDL2_NO_MWINDOWS) + list(REMOVE_ITEM _sdl2_libraries "-mwindows") +endif() + if(_sdl2_libraries MATCHES ".*SDL2main.*") list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main) list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main) endif() -set(_sdl2main_library ${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(_sdl2main_library ${SDL2_LIBDIR}/libSDL2main.a) if(EXISTS "${_sdl2main_library}") set(SDL2MAIN_LIBRARY SDL2::SDL2main) if(NOT TARGET SDL2::SDL2main) @@ -72,6 +81,8 @@ if(EXISTS "${_sdl2main_library}") set_target_properties(SDL2::SDL2main PROPERTIES IMPORTED_LOCATION "${_sdl2main_library}" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) if(WIN32) # INTERFACE_LINK_OPTIONS needs CMake 3.13 @@ -103,8 +114,8 @@ set(_sdl2_link_libraries ${_sdl2_libraries}) list(REMOVE_ITEM _sdl2_link_libraries SDL2 SDL2main mingw32 cygwin) if(WIN32) - set(_sdl2_implib "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(_sdl2_dll "${SDL2_BINDIR}/SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(_sdl2_implib "${SDL2_LIBDIR}/libSDL2.dll.a") + set(_sdl2_dll "${SDL2_BINDIR}/SDL2.dll") if(EXISTS "${_sdl2_implib}" AND EXISTS "${_sdl2_dll}") if(NOT TARGET SDL2::SDL2) add_library(SDL2::SDL2 SHARED IMPORTED) @@ -115,6 +126,8 @@ if(WIN32) IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_IMPLIB "${_sdl2_implib}" IMPORTED_LOCATION "${_sdl2_dll}" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2_FOUND TRUE) @@ -124,7 +137,7 @@ if(WIN32) unset(_sdl2_implib) unset(_sdl2_dll) else() - set(_sdl2_shared "${SDL2_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(_sdl2_shared "${SDL2_LIBDIR}/libSDL2${CMAKE_SHARED_LIBRARY_SUFFIX}") if(EXISTS "${_sdl2_shared}") if(NOT TARGET SDL2::SDL2) add_library(SDL2::SDL2 SHARED IMPORTED) @@ -134,6 +147,8 @@ else() INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${_sdl2_shared}" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2_FOUND TRUE) @@ -143,7 +158,7 @@ else() unset(_sdl2_shared) endif() -set(_sdl2_static "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(_sdl2_static "${SDL2_LIBDIR}/libSDL2.a") if(EXISTS "${_sdl2_static}") if(NOT TARGET SDL2::SDL2-static) add_library(SDL2::SDL2-static STATIC IMPORTED) @@ -154,6 +169,8 @@ if(EXISTS "${_sdl2_static}") INTERFACE_LINK_LIBRARIES "${_sdl2_link_libraries};${_sdl2_static_private_libs}" INTERFACE_LINK_DIRECTORIES "${_sdl2_libdirs};${_sdl2_static_private_libdirs}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2-static_FOUND TRUE) @@ -164,7 +181,7 @@ unset(_sdl2_static) unset(_sdl2_link_libraries) -set(_sdl2test_library "${SDL2_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2_test${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(_sdl2test_library "${SDL2_LIBDIR}/libSDL2_test.a") if(EXISTS "${_sdl2test_library}") if(NOT TARGET SDL2::SDL2test) add_library(SDL2::SDL2test STATIC IMPORTED) @@ -173,6 +190,8 @@ if(EXISTS "${_sdl2test_library}") IMPORTED_LOCATION "${_sdl2test_library}" INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" + COMPATIBLE_INTERFACE_STRING "SDL_VERSION" + INTERFACE_SDL_VERSION "SDL2" ) endif() set(SDL2_SDL2test_FOUND TRUE) diff --git a/sdl2-config.in b/sdl2-config.in index f6eca7668ca43..b41fc1697a8aa 100644 --- a/sdl2-config.in +++ b/sdl2-config.in @@ -1,10 +1,10 @@ #!/bin/sh # Get the canonical path of the folder containing this script -bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") +bindir=`cd -P -- "\`dirname -- "$0"\`" && printf '%s\n' "\`pwd -P\`"` # Calculate the canonical path of the prefix, relative to the folder of this script -prefix=$(cd -P -- "$bindir/@bin_prefix_relpath@" && printf '%s\n' "$(pwd -P)") +prefix=`cd -P -- "$bindir/@bin_prefix_relpath@" && printf '%s\n' "\`pwd -P\`"` exec_prefix=@exec_prefix@ exec_prefix_set=no libdir=@libdir@ diff --git a/sdl2.m4 b/sdl2.m4 index 75b60f6ea9338..ca96369a2e0a6 100644 --- a/sdl2.m4 +++ b/sdl2.m4 @@ -9,8 +9,9 @@ # * also look for SDL2.framework under Mac OS X # * removed HP/UX 9 support. # * updated for newer autoconf. +# * (v3) use $PKG_CONFIG for pkg-config cross-compiling support -# serial 2 +# serial 3 dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS @@ -54,7 +55,7 @@ AC_ARG_VAR(SDL2_FRAMEWORK, [Path to SDL2.framework]) if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL2_CONFIG="$PKG_CONFIG sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then @@ -196,7 +197,7 @@ int main(int argc, char *argv[]) echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** exact error that occurred. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl2-config script: $SDL2_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" diff --git a/sdl2.pc.in b/sdl2.pc.in index ad1a9574fe27d..23a1d69c6bf32 100644 --- a/sdl2.pc.in +++ b/sdl2.pc.in @@ -8,7 +8,7 @@ includedir=@includedir@ Name: sdl2 Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer. Version: @SDL_VERSION@ -Requires: +Requires.private: @PKGCONFIG_DEPENDS@ Conflicts: Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@ Cflags: -I${includedir} -I${includedir}/SDL2 @SDL_CFLAGS@ diff --git a/src/SDL.c b/src/SDL.c index 6297159e4219c..e21b500abb1b6 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,9 +29,6 @@ #endif #if defined(__OS2__) #include "core/os2/SDL_os2.h" -#if SDL_THREAD_OS2 -#include "thread/os2/SDL_systls_c.h" -#endif #endif /* this checks for HAVE_DBUS_DBUS_H internally. */ @@ -52,12 +49,13 @@ #include "haptic/SDL_haptic_c.h" #include "joystick/SDL_joystick_c.h" #include "sensor/SDL_sensor_c.h" +#include "thread/SDL_thread_c.h" /* Initialization/Cleanup routines */ -#if !SDL_TIMERS_DISABLED -# include "timer/SDL_timer_c.h" +#ifndef SDL_TIMERS_DISABLED +#include "timer/SDL_timer_c.h" #endif -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS extern int SDL_HelperWindowCreate(void); extern int SDL_HelperWindowDestroy(void); #endif @@ -98,8 +96,8 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode) ExitProcess here that will never be reached but make MingW happy. */ ExitProcess(exitcode); #elif defined(__EMSCRIPTEN__) - emscripten_cancel_main_loop(); /* this should "kill" the app. */ - emscripten_force_exit(exitcode); /* this should "kill" the app. */ + emscripten_cancel_main_loop(); /* this should "kill" the app. */ + emscripten_force_exit(exitcode); /* this should "kill" the app. */ exit(exitcode); #elif defined(__HAIKU__) /* Haiku has _Exit, but it's not marked noreturn. */ _exit(exitcode); @@ -110,19 +108,18 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode) #endif } - /* The initialized subsystems */ #ifdef SDL_MAIN_NEEDED static SDL_bool SDL_MainIsReady = SDL_FALSE; #else static SDL_bool SDL_MainIsReady = SDL_TRUE; #endif +static SDL_bool SDL_main_thread_initialized = SDL_FALSE; static SDL_bool SDL_bInMainQuit = SDL_FALSE; -static Uint8 SDL_SubsystemRefCount[ 32 ]; +static Uint8 SDL_SubsystemRefCount[32]; /* Private helper to increment a subsystem's ref counter. */ -static void -SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) +static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) { const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255)); @@ -132,8 +129,7 @@ SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem) } /* Private helper to decrement a subsystem's ref counter. */ -static void -SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) +static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) { const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] > 0)) { @@ -142,8 +138,7 @@ SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem) } /* Private helper to check if a system needs init. */ -static SDL_bool -SDL_PrivateShouldInitSubsystem(Uint32 subsystem) +static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem) { const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255)); @@ -151,8 +146,8 @@ SDL_PrivateShouldInitSubsystem(Uint32 subsystem) } /* Private helper to check if a system needs to be quit. */ -static SDL_bool -SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { +static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) +{ const int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); if ((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 0)) { return SDL_FALSE; @@ -164,59 +159,83 @@ SDL_PrivateShouldQuitSubsystem(Uint32 subsystem) { return (((subsystem_index >= 0) && (SDL_SubsystemRefCount[subsystem_index] == 1)) || SDL_bInMainQuit) ? SDL_TRUE : SDL_FALSE; } -void -SDL_SetMainReady(void) +/* Private helper to either increment's existing ref counter, + * or fully init a new subsystem. */ +static SDL_bool SDL_PrivateInitOrIncrSubsystem(Uint32 subsystem) { - SDL_MainIsReady = SDL_TRUE; + int subsystem_index = SDL_MostSignificantBitIndex32(subsystem); + SDL_assert((subsystem_index < 0) || (SDL_SubsystemRefCount[subsystem_index] < 255)); + if (subsystem_index < 0) { + return SDL_FALSE; + } + if (SDL_SubsystemRefCount[subsystem_index] > 0) { + ++SDL_SubsystemRefCount[subsystem_index]; + return SDL_TRUE; + } + return SDL_InitSubSystem(subsystem) == 0; } -int -SDL_InitSubSystem(Uint32 flags) +void SDL_SetMainReady(void) { - Uint32 flags_initialized = 0; + SDL_MainIsReady = SDL_TRUE; +} - if (!SDL_MainIsReady) { - return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); +void SDL_InitMainThread(void) +{ + if (SDL_main_thread_initialized) { + return; } + SDL_InitTLSData(); +#ifndef SDL_TIMERS_DISABLED + SDL_TicksInit(); +#endif SDL_LogInit(); - /* Clear the error message */ - SDL_ClearError(); + SDL_main_thread_initialized = SDL_TRUE; +} -#if SDL_USE_LIBDBUS - SDL_DBus_Init(); +static void SDL_QuitMainThread(void) +{ + if (!SDL_main_thread_initialized) { + return; + } + + SDL_LogQuit(); +#ifndef SDL_TIMERS_DISABLED + SDL_TicksQuit(); #endif + SDL_QuitTLSData(); - if ((flags & SDL_INIT_GAMECONTROLLER)) { - /* game controller implies joystick */ - flags |= SDL_INIT_JOYSTICK; - } + SDL_main_thread_initialized = SDL_FALSE; +} + +int SDL_InitSubSystem(Uint32 flags) +{ + Uint32 flags_initialized = 0; - if ((flags & (SDL_INIT_VIDEO|SDL_INIT_JOYSTICK|SDL_INIT_AUDIO))) { - /* video or joystick or audio implies events */ - flags |= SDL_INIT_EVENTS; + if (!SDL_MainIsReady) { + return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); } -#if SDL_THREAD_OS2 - SDL_OS2TLSAlloc(); /* thread/os2/SDL_systls.c */ + /* Clear the error message */ + SDL_ClearError(); + +#ifdef SDL_USE_LIBDBUS + SDL_DBus_Init(); #endif -#if SDL_VIDEO_DRIVER_WINDOWS - if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) { +#ifdef SDL_VIDEO_DRIVER_WINDOWS + if (flags & (SDL_INIT_HAPTIC | SDL_INIT_JOYSTICK)) { if (SDL_HelperWindowCreate() < 0) { goto quit_and_error; } } #endif -#if !SDL_TIMERS_DISABLED - SDL_TicksInit(); -#endif - /* Initialize the event subsystem */ - if ((flags & SDL_INIT_EVENTS)) { -#if !SDL_EVENTS_DISABLED + if (flags & SDL_INIT_EVENTS) { +#ifndef SDL_EVENTS_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_EVENTS)) { if (SDL_EventsInit() < 0) { goto quit_and_error; @@ -231,8 +250,8 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the timer subsystem */ - if ((flags & SDL_INIT_TIMER)){ -#if !SDL_TIMERS_DISABLED && !SDL_TIMER_DUMMY + if (flags & SDL_INIT_TIMER) { +#if !defined(SDL_TIMERS_DISABLED) && !defined(SDL_TIMER_DUMMY) if (SDL_PrivateShouldInitSubsystem(SDL_INIT_TIMER)) { if (SDL_TimerInit() < 0) { goto quit_and_error; @@ -247,9 +266,14 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the video subsystem */ - if ((flags & SDL_INIT_VIDEO)){ -#if !SDL_VIDEO_DISABLED + if (flags & SDL_INIT_VIDEO) { +#ifndef SDL_VIDEO_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_VIDEO)) { + /* video implies events */ + if (!SDL_PrivateInitOrIncrSubsystem(SDL_INIT_EVENTS)) { + goto quit_and_error; + } + if (SDL_VideoInit(NULL) < 0) { goto quit_and_error; } @@ -263,9 +287,14 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the audio subsystem */ - if ((flags & SDL_INIT_AUDIO)){ -#if !SDL_AUDIO_DISABLED + if (flags & SDL_INIT_AUDIO) { +#ifndef SDL_AUDIO_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_AUDIO)) { + /* audio implies events */ + if (!SDL_PrivateInitOrIncrSubsystem(SDL_INIT_EVENTS)) { + goto quit_and_error; + } + if (SDL_AudioInit(NULL) < 0) { goto quit_and_error; } @@ -279,12 +308,17 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the joystick subsystem */ - if ((flags & SDL_INIT_JOYSTICK)){ -#if !SDL_JOYSTICK_DISABLED + if (flags & SDL_INIT_JOYSTICK) { +#ifndef SDL_JOYSTICK_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_JOYSTICK)) { - if (SDL_JoystickInit() < 0) { - goto quit_and_error; - } + /* joystick implies events */ + if (!SDL_PrivateInitOrIncrSubsystem(SDL_INIT_EVENTS)) { + goto quit_and_error; + } + + if (SDL_JoystickInit() < 0) { + goto quit_and_error; + } } SDL_PrivateSubsystemRefCountIncr(SDL_INIT_JOYSTICK); flags_initialized |= SDL_INIT_JOYSTICK; @@ -294,9 +328,14 @@ SDL_InitSubSystem(Uint32 flags) #endif } - if ((flags & SDL_INIT_GAMECONTROLLER)){ -#if !SDL_JOYSTICK_DISABLED + if (flags & SDL_INIT_GAMECONTROLLER) { +#ifndef SDL_JOYSTICK_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMECONTROLLER)) { + /* game controller implies joystick */ + if (!SDL_PrivateInitOrIncrSubsystem(SDL_INIT_JOYSTICK)) { + goto quit_and_error; + } + if (SDL_GameControllerInit() < 0) { goto quit_and_error; } @@ -310,8 +349,8 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the haptic subsystem */ - if ((flags & SDL_INIT_HAPTIC)){ -#if !SDL_HAPTIC_DISABLED + if (flags & SDL_INIT_HAPTIC) { +#ifndef SDL_HAPTIC_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_HAPTIC)) { if (SDL_HapticInit() < 0) { goto quit_and_error; @@ -326,8 +365,8 @@ SDL_InitSubSystem(Uint32 flags) } /* Initialize the sensor subsystem */ - if ((flags & SDL_INIT_SENSOR)){ -#if !SDL_SENSOR_DISABLED + if (flags & SDL_INIT_SENSOR) { +#ifndef SDL_SENSOR_DISABLED if (SDL_PrivateShouldInitSubsystem(SDL_INIT_SENSOR)) { if (SDL_SensorInit() < 0) { goto quit_and_error; @@ -341,34 +380,29 @@ SDL_InitSubSystem(Uint32 flags) #endif } - (void) flags_initialized; /* make static analysis happy, since this only gets used in error cases. */ + (void)flags_initialized; /* make static analysis happy, since this only gets used in error cases. */ - return (0); + return 0; quit_and_error: SDL_QuitSubSystem(flags_initialized); - return (-1); + return -1; } -int -SDL_Init(Uint32 flags) +int SDL_Init(Uint32 flags) { return SDL_InitSubSystem(flags); } -void -SDL_QuitSubSystem(Uint32 flags) +void SDL_QuitSubSystem(Uint32 flags) { #if defined(__OS2__) -#if SDL_THREAD_OS2 - SDL_OS2TLSFree(); /* thread/os2/SDL_systls.c */ -#endif SDL_OS2Quit(); #endif /* Shut down requested initialized subsystems */ -#if !SDL_SENSOR_DISABLED - if ((flags & SDL_INIT_SENSOR)) { +#ifndef SDL_SENSOR_DISABLED + if (flags & SDL_INIT_SENSOR) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_SENSOR)) { SDL_SensorQuit(); } @@ -376,30 +410,28 @@ SDL_QuitSubSystem(Uint32 flags) } #endif -#if !SDL_JOYSTICK_DISABLED - if ((flags & SDL_INIT_GAMECONTROLLER)) { - /* game controller implies joystick */ - flags |= SDL_INIT_JOYSTICK; - +#ifndef SDL_JOYSTICK_DISABLED + if (flags & SDL_INIT_GAMECONTROLLER) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMECONTROLLER)) { SDL_GameControllerQuit(); + /* game controller implies joystick */ + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMECONTROLLER); } - if ((flags & SDL_INIT_JOYSTICK)) { - /* joystick implies events */ - flags |= SDL_INIT_EVENTS; - + if (flags & SDL_INIT_JOYSTICK) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_JOYSTICK)) { SDL_JoystickQuit(); + /* joystick implies events */ + SDL_QuitSubSystem(SDL_INIT_EVENTS); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_JOYSTICK); } #endif -#if !SDL_HAPTIC_DISABLED - if ((flags & SDL_INIT_HAPTIC)) { +#ifndef SDL_HAPTIC_DISABLED + if (flags & SDL_INIT_HAPTIC) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_HAPTIC)) { SDL_HapticQuit(); } @@ -407,32 +439,30 @@ SDL_QuitSubSystem(Uint32 flags) } #endif -#if !SDL_AUDIO_DISABLED - if ((flags & SDL_INIT_AUDIO)) { - /* audio implies events */ - flags |= SDL_INIT_EVENTS; - +#ifndef SDL_AUDIO_DISABLED + if (flags & SDL_INIT_AUDIO) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_AUDIO)) { SDL_AudioQuit(); + /* audio implies events */ + SDL_QuitSubSystem(SDL_INIT_EVENTS); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_AUDIO); } #endif -#if !SDL_VIDEO_DISABLED - if ((flags & SDL_INIT_VIDEO)) { - /* video implies events */ - flags |= SDL_INIT_EVENTS; - +#ifndef SDL_VIDEO_DISABLED + if (flags & SDL_INIT_VIDEO) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_VIDEO)) { SDL_VideoQuit(); + /* video implies events */ + SDL_QuitSubSystem(SDL_INIT_EVENTS); } SDL_PrivateSubsystemRefCountDecr(SDL_INIT_VIDEO); } #endif -#if !SDL_TIMERS_DISABLED && !SDL_TIMER_DUMMY - if ((flags & SDL_INIT_TIMER)) { +#if !defined(SDL_TIMERS_DISABLED) && !defined(SDL_TIMER_DUMMY) + if (flags & SDL_INIT_TIMER) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_TIMER)) { SDL_TimerQuit(); } @@ -440,8 +470,8 @@ SDL_QuitSubSystem(Uint32 flags) } #endif -#if !SDL_EVENTS_DISABLED - if ((flags & SDL_INIT_EVENTS)) { +#ifndef SDL_EVENTS_DISABLED + if (flags & SDL_INIT_EVENTS) { if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_EVENTS)) { SDL_EventsQuit(); } @@ -450,8 +480,7 @@ SDL_QuitSubSystem(Uint32 flags) #endif } -Uint32 -SDL_WasInit(Uint32 flags) +Uint32 SDL_WasInit(Uint32 flags) { int i; int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount); @@ -481,51 +510,51 @@ SDL_WasInit(Uint32 flags) return initialized; } -void -SDL_Quit(void) +void SDL_Quit(void) { SDL_bInMainQuit = SDL_TRUE; /* Quit all subsystems */ -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS SDL_HelperWindowDestroy(); #endif SDL_QuitSubSystem(SDL_INIT_EVERYTHING); -#if !SDL_TIMERS_DISABLED - SDL_TicksQuit(); +#ifdef SDL_USE_LIBDBUS + SDL_DBus_Quit(); #endif SDL_ClearHints(); SDL_AssertionsQuit(); -#if SDL_USE_LIBDBUS - SDL_DBus_Quit(); -#endif - - SDL_LogQuit(); - /* Now that every subsystem has been quit, we reset the subsystem refcount * and the list of initialized subsystems. */ - SDL_memset( SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount) ); + SDL_memset(SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount)); - SDL_TLSCleanup(); + SDL_QuitMainThread(); SDL_bInMainQuit = SDL_FALSE; } /* Get the library version number */ -void -SDL_GetVersion(SDL_version * ver) +void SDL_GetVersion(SDL_version *ver) { + static SDL_bool check_hint = SDL_TRUE; + static SDL_bool legacy_version = SDL_FALSE; + if (!ver) { return; } SDL_VERSION(ver); - if (SDL_GetHintBoolean("SDL_LEGACY_VERSION", SDL_FALSE)) { + if (check_hint) { + check_hint = SDL_FALSE; + legacy_version = SDL_GetHintBoolean("SDL_LEGACY_VERSION", SDL_FALSE); + } + + if (legacy_version) { /* Prior to SDL 2.24.0, the patch version was incremented with every release */ ver->patch = ver->minor; ver->minor = 0; @@ -533,101 +562,97 @@ SDL_GetVersion(SDL_version * ver) } /* Get the library source revision */ -const char * -SDL_GetRevision(void) +const char *SDL_GetRevision(void) { return SDL_REVISION; } /* Get the library source revision number */ -int -SDL_GetRevisionNumber(void) +int SDL_GetRevisionNumber(void) { return 0; /* doesn't make sense without Mercurial. */ } /* Get the name of the platform */ -const char * -SDL_GetPlatform(void) +const char *SDL_GetPlatform(void) { -#if __AIX__ +#if defined(__AIX__) return "AIX"; -#elif __ANDROID__ +#elif defined(__ANDROID__) return "Android"; -#elif __BSDI__ +#elif defined(__BSDI__) return "BSDI"; -#elif __DREAMCAST__ +#elif defined(__DREAMCAST__) return "Dreamcast"; -#elif __EMSCRIPTEN__ +#elif defined(__EMSCRIPTEN__) return "Emscripten"; -#elif __FREEBSD__ +#elif defined(__FREEBSD__) return "FreeBSD"; -#elif __HAIKU__ +#elif defined(__HAIKU__) return "Haiku"; -#elif __HPUX__ +#elif defined(__HPUX__) return "HP-UX"; -#elif __IRIX__ +#elif defined(__IRIX__) return "Irix"; -#elif __LINUX__ +#elif defined(__LINUX__) return "Linux"; -#elif __MINT__ +#elif defined(__MINT__) return "Atari MiNT"; -#elif __MACOS__ +#elif defined(__MACOS__) return "MacOS Classic"; -#elif __MACOSX__ +#elif defined(__MACOSX__) return "Mac OS X"; -#elif __NACL__ +#elif defined(__NACL__) return "NaCl"; -#elif __NETBSD__ +#elif defined(__NETBSD__) return "NetBSD"; -#elif __OPENBSD__ +#elif defined(__OPENBSD__) return "OpenBSD"; -#elif __OS2__ +#elif defined(__OS2__) return "OS/2"; -#elif __OSF__ +#elif defined(__OSF__) return "OSF/1"; -#elif __QNXNTO__ +#elif defined(__QNXNTO__) return "QNX Neutrino"; -#elif __RISCOS__ +#elif defined(__RISCOS__) return "RISC OS"; -#elif __SOLARIS__ +#elif defined(__SOLARIS__) return "Solaris"; -#elif __WIN32__ +#elif defined(__WIN32__) return "Windows"; -#elif __WINRT__ +#elif defined(__WINRT__) return "WinRT"; -#elif __WINGDK__ +#elif defined(__WINGDK__) return "WinGDK"; -#elif __XBOXONE__ +#elif defined(__XBOXONE__) return "Xbox One"; -#elif __XBOXSERIES__ +#elif defined(__XBOXSERIES__) return "Xbox Series X|S"; -#elif __TVOS__ +#elif defined(__TVOS__) return "tvOS"; -#elif __IPHONEOS__ +#elif defined(__IPHONEOS__) return "iOS"; -#elif __PS2__ +#elif defined(__PS2__) return "PlayStation 2"; -#elif __PSP__ +#elif defined(__PSP__) return "PlayStation Portable"; -#elif __VITA__ +#elif defined(__VITA__) return "PlayStation Vita"; -#elif __NGAGE__ +#elif defined(__NGAGE__) return "Nokia N-Gage"; -#elif __3DS__ +#elif defined(__3DS__) return "Nintendo 3DS"; #else return "Unknown (see SDL_platform.h)"; #endif } -SDL_bool -SDL_IsTablet(void) +SDL_bool SDL_IsTablet(void) { -#if __ANDROID__ +#if defined(__ANDROID__) extern SDL_bool SDL_IsAndroidTablet(void); return SDL_IsAndroidTablet(); -#elif __IPHONEOS__ +#elif defined(__IPHONEOS__) extern SDL_bool SDL_IsIPad(void); return SDL_IsIPad(); #else @@ -638,11 +663,9 @@ SDL_IsTablet(void) #if defined(__WIN32__) #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB) -/* Need to include DllMain() on Watcom C for some reason.. */ +/* FIXME: Still need to include DllMain() on Watcom C ? */ -BOOL APIENTRY -_DllMainCRTStartup(HANDLE hModule, - DWORD ul_reason_for_call, LPVOID lpReserved) +BOOL APIENTRY MINGW32_FORCEALIGN _DllMainCRTStartup(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: diff --git a/src/SDL_assert.c b/src/SDL_assert.c index aa8d2351178b5..99a376e948ca8 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,8 +48,7 @@ /* The size of the stack buffer to use for rendering assert messages. */ #define SDL_MAX_ASSERT_MESSAGE_STACK 256 -static SDL_assert_state SDLCALL -SDL_PromptAssertion(const SDL_assert_data *data, void *userdata); +static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data, void *userdata); /* * We keep all triggered assertions in a singly-linked list so we can @@ -65,12 +64,10 @@ static SDL_AssertionHandler assertion_handler = SDL_PromptAssertion; static void *assertion_userdata = NULL; #ifdef __GNUC__ -static void -debug_print(const char *fmt, ...) __attribute__((format (printf, 1, 2))); +static void debug_print(const char *fmt, ...) __attribute__((format(printf, 1, 2))); #endif -static void -debug_print(const char *fmt, ...) +static void debug_print(const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -78,31 +75,30 @@ debug_print(const char *fmt, ...) va_end(ap); } - static void SDL_AddAssertionToReport(SDL_assert_data *data) { /* (data) is always a static struct defined with the assert macros, so we don't have to worry about copying or allocating them. */ data->trigger_count++; - if (data->trigger_count == 1) { /* not yet added? */ + if (data->trigger_count == 1) { /* not yet added? */ data->next = triggered_assertions; triggered_assertions = data; } } #if defined(__WIN32__) || defined(__GDK__) - #define ENDLINE "\r\n" +#define ENDLINE "\r\n" #else - #define ENDLINE "\n" +#define ENDLINE "\n" #endif -static int SDL_RenderAssertMessage(char *buf, size_t buf_len, const SDL_assert_data *data) { +static int SDL_RenderAssertMessage(char *buf, size_t buf_len, const SDL_assert_data *data) +{ return SDL_snprintf(buf, buf_len, - "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE " '%s'", - data->function, data->filename, data->linenum, - data->trigger_count, (data->trigger_count == 1) ? "time" : "times", - data->condition - ); + "Assertion failure at %s (%s:%d), triggered %u %s:" ENDLINE " '%s'", + data->function, data->filename, data->linenum, + data->trigger_count, (data->trigger_count == 1) ? "time" : "times", + data->condition); } static void SDL_GenerateAssertionReport(void) @@ -110,11 +106,11 @@ static void SDL_GenerateAssertionReport(void) const SDL_assert_data *item = triggered_assertions; /* only do this if the app hasn't assigned an assertion handler. */ - if ((item != NULL) && (assertion_handler != SDL_PromptAssertion)) { + if ((item) && (assertion_handler != SDL_PromptAssertion)) { debug_print("\n\nSDL assertion report.\n"); debug_print("All SDL assertions between last init/quit:\n\n"); - while (item != NULL) { + while (item) { debug_print( "'%s'\n" " * %s (%s:%d)\n" @@ -132,7 +128,6 @@ static void SDL_GenerateAssertionReport(void) } } - /* This is not declared in any header, although it is shared between some parts of SDL, because we don't want anything calling it without an extremely good reason. */ @@ -142,9 +137,8 @@ extern void SDL_ExitProcess(int exitcode); #endif extern SDL_NORETURN void SDL_ExitProcess(int exitcode); - #if defined(__WATCOMC__) -static void SDL_AbortAssertion (void); +static void SDL_AbortAssertion(void); #pragma aux SDL_AbortAssertion aborts; #endif static SDL_NORETURN void SDL_AbortAssertion(void) @@ -153,21 +147,20 @@ static SDL_NORETURN void SDL_AbortAssertion(void) SDL_ExitProcess(42); } -static SDL_assert_state SDLCALL -SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) +static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) { const char *envr; SDL_assert_state state = SDL_ASSERTION_ABORT; SDL_Window *window; SDL_MessageBoxData messagebox; SDL_MessageBoxButtonData buttons[] = { - { 0, SDL_ASSERTION_RETRY, "Retry" }, - { 0, SDL_ASSERTION_BREAK, "Break" }, - { 0, SDL_ASSERTION_ABORT, "Abort" }, - { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, - SDL_ASSERTION_IGNORE, "Ignore" }, - { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, - SDL_ASSERTION_ALWAYS_IGNORE, "Always Ignore" } + { 0, SDL_ASSERTION_RETRY, "Retry" }, + { 0, SDL_ASSERTION_BREAK, "Break" }, + { 0, SDL_ASSERTION_ABORT, "Abort" }, + { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, + SDL_ASSERTION_IGNORE, "Ignore" }, + { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, + SDL_ASSERTION_ALWAYS_IGNORE, "Always Ignore" } }; int selected; @@ -176,7 +169,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) size_t buf_len = sizeof(stack_buf); int len; - (void) userdata; /* unused in default handler. */ + (void)userdata; /* unused in default handler. */ /* Assume the output will fit... */ len = SDL_RenderAssertMessage(message, buf_len, data); @@ -205,7 +198,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) /* let env. variable override, so unit tests won't block in a GUI. */ envr = SDL_getenv("SDL_ASSERT"); - if (envr != NULL) { + if (envr) { if (message != stack_buf) { SDL_free(message); } @@ -221,7 +214,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) } else if (SDL_strcmp(envr, "always_ignore") == 0) { return SDL_ASSERTION_ALWAYS_IGNORE; } else { - return SDL_ASSERTION_ABORT; /* oh well. */ + return SDL_ASSERTION_ABORT; /* oh well. */ } } @@ -252,15 +245,13 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) } else { state = (SDL_assert_state)selected; } - } - - else - { + } else { #if defined(__EMSCRIPTEN__) /* This is nasty, but we can't block on a custom UI. */ - for ( ; ; ) { + for (;;) { SDL_bool okay = SDL_TRUE; - char *buf = (char *) EM_ASM_INT({ + /* *INDENT-OFF* */ /* clang-format off */ + int reply = MAIN_THREAD_EM_ASM_INT({ var str = UTF8ToString($0) + '\n\n' + 'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :'; @@ -268,36 +259,43 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) if (reply === null) { reply = "i"; } - return allocate(intArrayFromString(reply), 'i8', ALLOC_NORMAL); + return reply.length === 1 ? reply.charCodeAt(0) : -1; }, message); + /* *INDENT-ON* */ /* clang-format on */ - if (SDL_strcmp(buf, "a") == 0) { + switch (reply) { + case 'a': state = SDL_ASSERTION_ABORT; - /* (currently) no break functionality on Emscripten - } else if (SDL_strcmp(buf, "b") == 0) { - state = SDL_ASSERTION_BREAK; */ - } else if (SDL_strcmp(buf, "r") == 0) { +#if 0 /* (currently) no break functionality on Emscripten */ + case 'b': + state = SDL_ASSERTION_BREAK; + break; +#endif + case 'r': state = SDL_ASSERTION_RETRY; - } else if (SDL_strcmp(buf, "i") == 0) { + break; + case 'i': state = SDL_ASSERTION_IGNORE; - } else if (SDL_strcmp(buf, "A") == 0) { + break; + case 'A': state = SDL_ASSERTION_ALWAYS_IGNORE; - } else { + break; + default: okay = SDL_FALSE; + break; } - free(buf); if (okay) { break; } } -#elif defined(HAVE_STDIO_H) +#elif defined(HAVE_STDIO_H) && !defined(__3DS__) /* this is a little hacky. */ - for ( ; ; ) { + for (;;) { char buf[32]; - fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : "); - fflush(stderr); - if (fgets(buf, sizeof (buf), stdin) == NULL) { + (void)fprintf(stderr, "Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] : "); + (void)fflush(stderr); + if (fgets(buf, sizeof(buf), stdin) == NULL) { break; } @@ -318,6 +316,8 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) break; } } +#else + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "Assertion Failed", message, window); #endif /* HAVE_STDIO_H */ } @@ -333,10 +333,7 @@ SDL_PromptAssertion(const SDL_assert_data *data, void *userdata) return state; } - -SDL_assert_state -SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, - int line) +SDL_assert_state SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, int line) { SDL_assert_state state = SDL_ASSERTION_IGNORE; static int assertion_running = 0; @@ -344,19 +341,17 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, #ifndef SDL_THREADS_DISABLED static SDL_SpinLock spinlock = 0; SDL_AtomicLock(&spinlock); - if (assertion_mutex == NULL) { /* never called SDL_Init()? */ + if (!assertion_mutex) { /* never called SDL_Init()? */ assertion_mutex = SDL_CreateMutex(); - if (assertion_mutex == NULL) { + if (!assertion_mutex) { SDL_AtomicUnlock(&spinlock); - return SDL_ASSERTION_IGNORE; /* oh well, I guess. */ + return SDL_ASSERTION_IGNORE; /* oh well, I guess. */ } } SDL_AtomicUnlock(&spinlock); - if (SDL_LockMutex(assertion_mutex) < 0) { - return SDL_ASSERTION_IGNORE; /* oh well, I guess. */ - } -#endif + SDL_LockMutex(assertion_mutex); +#endif /* !SDL_THREADS_DISABLED */ /* doing this because Visual C is upset over assigning in the macro. */ if (data->trigger_count == 0) { @@ -368,13 +363,14 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, SDL_AddAssertionToReport(data); assertion_running++; - if (assertion_running > 1) { /* assert during assert! Abort. */ + if (assertion_running > 1) { /* assert during assert! Abort. */ if (assertion_running == 2) { SDL_AbortAssertion(); - } else if (assertion_running == 3) { /* Abort asserted! */ + } else if (assertion_running == 3) { /* Abort asserted! */ SDL_ExitProcess(42); } else { - while (1) { /* do nothing but spin; what else can you do?! */ } + while (1) { /* do nothing but spin; what else can you do?! */ + } } } @@ -382,21 +378,20 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, state = assertion_handler(data, assertion_userdata); } - switch (state) - { - case SDL_ASSERTION_ALWAYS_IGNORE: - state = SDL_ASSERTION_IGNORE; - data->always_ignore = 1; - break; + switch (state) { + case SDL_ASSERTION_ALWAYS_IGNORE: + state = SDL_ASSERTION_IGNORE; + data->always_ignore = 1; + break; - case SDL_ASSERTION_IGNORE: - case SDL_ASSERTION_RETRY: - case SDL_ASSERTION_BREAK: - break; /* macro handles these. */ + case SDL_ASSERTION_IGNORE: + case SDL_ASSERTION_RETRY: + case SDL_ASSERTION_BREAK: + break; /* macro handles these. */ - case SDL_ASSERTION_ABORT: - SDL_AbortAssertion(); - /*break; ...shouldn't return, but oh well. */ + case SDL_ASSERTION_ABORT: + SDL_AbortAssertion(); + /*break; ...shouldn't return, but oh well. */ } assertion_running--; @@ -408,13 +403,12 @@ SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, return state; } - void SDL_AssertionsQuit(void) { #if SDL_ASSERT_LEVEL > 0 SDL_GenerateAssertionReport(); #ifndef SDL_THREADS_DISABLED - if (assertion_mutex != NULL) { + if (assertion_mutex) { SDL_DestroyMutex(assertion_mutex); assertion_mutex = NULL; } @@ -442,8 +436,8 @@ void SDL_ResetAssertionReport(void) { SDL_assert_data *next = NULL; SDL_assert_data *item; - for (item = triggered_assertions; item != NULL; item = next) { - next = (SDL_assert_data *) item->next; + for (item = triggered_assertions; item; item = next) { + next = (SDL_assert_data *)item->next; item->always_ignore = SDL_FALSE; item->trigger_count = 0; item->next = NULL; @@ -459,7 +453,7 @@ SDL_AssertionHandler SDL_GetDefaultAssertionHandler(void) SDL_AssertionHandler SDL_GetAssertionHandler(void **userdata) { - if (userdata != NULL) { + if (userdata) { *userdata = assertion_userdata; } return assertion_handler; diff --git a/src/SDL_assert_c.h b/src/SDL_assert_c.h index ca4d4c3a9a153..69cd9c3e4c003 100644 --- a/src/SDL_assert_c.h +++ b/src/SDL_assert_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/SDL_dataqueue.c b/src/SDL_dataqueue.c index e63fc6dfd85da..0498e1259c0e0 100644 --- a/src/SDL_dataqueue.c +++ b/src/SDL_dataqueue.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,23 +25,23 @@ typedef struct SDL_DataQueuePacket { - size_t datalen; /* bytes currently in use in this packet. */ - size_t startpos; /* bytes currently consumed in this packet. */ - struct SDL_DataQueuePacket *next; /* next item in linked list. */ - Uint8 data[SDL_VARIABLE_LENGTH_ARRAY]; /* packet data */ + size_t datalen; /* bytes currently in use in this packet. */ + size_t startpos; /* bytes currently consumed in this packet. */ + struct SDL_DataQueuePacket *next; /* next item in linked list. */ + Uint8 data[SDL_VARIABLE_LENGTH_ARRAY]; /* packet data */ } SDL_DataQueuePacket; struct SDL_DataQueue { + SDL_mutex *lock; SDL_DataQueuePacket *head; /* device fed from here. */ SDL_DataQueuePacket *tail; /* queue fills to here. */ SDL_DataQueuePacket *pool; /* these are unused packets. */ - size_t packet_size; /* size of new packets */ - size_t queued_bytes; /* number of bytes of data in the queue. */ + size_t packet_size; /* size of new packets */ + size_t queued_bytes; /* number of bytes of data in the queue. */ }; -static void -SDL_FreeDataQueueList(SDL_DataQueuePacket *packet) +static void SDL_FreeDataQueueList(SDL_DataQueuePacket *packet) { while (packet) { SDL_DataQueuePacket *next = packet->next; @@ -50,27 +50,27 @@ SDL_FreeDataQueueList(SDL_DataQueuePacket *packet) } } - -/* this all expects that you managed thread safety elsewhere. */ - -SDL_DataQueue * -SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack) +SDL_DataQueue *SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack) { - SDL_DataQueue *queue = (SDL_DataQueue *) SDL_malloc(sizeof (SDL_DataQueue)); + SDL_DataQueue *queue = (SDL_DataQueue *)SDL_calloc(1, sizeof(SDL_DataQueue)); if (!queue) { SDL_OutOfMemory(); - return NULL; } else { const size_t packetlen = _packetlen ? _packetlen : 1024; const size_t wantpackets = (initialslack + (packetlen - 1)) / packetlen; size_t i; - SDL_zerop(queue); queue->packet_size = packetlen; + queue->lock = SDL_CreateMutex(); + if (!queue->lock) { + SDL_free(queue); + return NULL; + } + for (i = 0; i < wantpackets; i++) { - SDL_DataQueuePacket *packet = (SDL_DataQueuePacket *) SDL_malloc(sizeof (SDL_DataQueuePacket) + packetlen); + SDL_DataQueuePacket *packet = (SDL_DataQueuePacket *)SDL_malloc(sizeof(SDL_DataQueuePacket) + packetlen); if (packet) { /* don't care if this fails, we'll deal later. */ packet->datalen = 0; packet->startpos = 0; @@ -83,21 +83,20 @@ SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack) return queue; } -void -SDL_FreeDataQueue(SDL_DataQueue *queue) +void SDL_FreeDataQueue(SDL_DataQueue *queue) { if (queue) { SDL_FreeDataQueueList(queue->head); SDL_FreeDataQueueList(queue->pool); + SDL_DestroyMutex(queue->lock); SDL_free(queue); } } -void -SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack) +void SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack) { const size_t packet_size = queue ? queue->packet_size : 1; - const size_t slackpackets = (slack + (packet_size-1)) / packet_size; + const size_t slackpackets = (slack + (packet_size - 1)) / packet_size; SDL_DataQueuePacket *packet; SDL_DataQueuePacket *prev = NULL; size_t i; @@ -106,6 +105,8 @@ SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack) return; } + SDL_LockMutex(queue->lock); + packet = queue->head; /* merge the available pool and the current queue into one list. */ @@ -133,24 +134,26 @@ SDL_ClearDataQueue(SDL_DataQueue *queue, const size_t slack) queue->pool = NULL; } - SDL_FreeDataQueueList(packet); /* free extra packets */ + SDL_UnlockMutex(queue->lock); + + SDL_FreeDataQueueList(packet); /* free extra packets */ } -static SDL_DataQueuePacket * -AllocateDataQueuePacket(SDL_DataQueue *queue) +/* You must hold queue->lock before calling this! */ +static SDL_DataQueuePacket *AllocateDataQueuePacket(SDL_DataQueue *queue) { SDL_DataQueuePacket *packet; SDL_assert(queue != NULL); packet = queue->pool; - if (packet != NULL) { + if (packet) { /* we have one available in the pool. */ queue->pool = packet->next; } else { /* Have to allocate a new one! */ - packet = (SDL_DataQueuePacket *) SDL_malloc(sizeof (SDL_DataQueuePacket) + queue->packet_size); - if (packet == NULL) { + packet = (SDL_DataQueuePacket *)SDL_malloc(sizeof(SDL_DataQueuePacket) + queue->packet_size); + if (!packet) { return NULL; } } @@ -158,9 +161,9 @@ AllocateDataQueuePacket(SDL_DataQueue *queue) packet->datalen = 0; packet->startpos = 0; packet->next = NULL; - + SDL_assert((queue->head != NULL) == (queue->queued_bytes != 0)); - if (queue->tail == NULL) { + if (!queue->tail) { queue->head = packet; } else { queue->tail->next = packet; @@ -169,12 +172,10 @@ AllocateDataQueuePacket(SDL_DataQueue *queue) return packet; } - -int -SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _len) +int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _len) { size_t len = _len; - const Uint8 *data = (const Uint8 *) _data; + const Uint8 *data = (const Uint8 *)_data; const size_t packet_size = queue ? queue->packet_size : 0; SDL_DataQueuePacket *orighead; SDL_DataQueuePacket *origtail; @@ -185,22 +186,24 @@ SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _len) return SDL_InvalidParamError("queue"); } + SDL_LockMutex(queue->lock); + orighead = queue->head; origtail = queue->tail; origlen = origtail ? origtail->datalen : 0; while (len > 0) { SDL_DataQueuePacket *packet = queue->tail; - SDL_assert(!packet || (packet->datalen <= packet_size)); + SDL_assert(packet == NULL || (packet->datalen <= packet_size)); if (!packet || (packet->datalen >= packet_size)) { /* tail packet missing or completely full; we need a new packet. */ packet = AllocateDataQueuePacket(queue); if (!packet) { /* uhoh, reset so we've queued nothing new, free what we can. */ if (!origtail) { - packet = queue->head; /* whole queue. */ + packet = queue->head; /* whole queue. */ } else { - packet = origtail->next; /* what we added to existing queue. */ + packet = origtail->next; /* what we added to existing queue. */ origtail->next = NULL; origtail->datalen = origlen; } @@ -208,7 +211,8 @@ SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _len) queue->tail = origtail; queue->pool = NULL; - SDL_FreeDataQueueList(packet); /* give back what we can. */ + SDL_UnlockMutex(queue->lock); + SDL_FreeDataQueueList(packet); /* give back what we can. */ return SDL_OutOfMemory(); } } @@ -221,6 +225,8 @@ SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *_data, const size_t _len) queue->queued_bytes += datalen; } + SDL_UnlockMutex(queue->lock); + return 0; } @@ -228,7 +234,7 @@ size_t SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) { size_t len = _len; - Uint8 *buf = (Uint8 *) _buf; + Uint8 *buf = (Uint8 *)_buf; Uint8 *ptr = buf; SDL_DataQueuePacket *packet; @@ -236,6 +242,8 @@ SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) return 0; } + SDL_LockMutex(queue->lock); + for (packet = queue->head; len && packet; packet = packet->next) { const size_t avail = packet->datalen - packet->startpos; const size_t cpy = SDL_min(len, avail); @@ -246,14 +254,16 @@ SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) len -= cpy; } - return (size_t) (ptr - buf); + SDL_UnlockMutex(queue->lock); + + return (size_t)(ptr - buf); } size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) { size_t len = _len; - Uint8 *buf = (Uint8 *) _buf; + Uint8 *buf = (Uint8 *)_buf; Uint8 *ptr = buf; SDL_DataQueuePacket *packet; @@ -261,6 +271,8 @@ SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) return 0; } + SDL_LockMutex(queue->lock); + while ((len > 0) && ((packet = queue->head) != NULL)) { const size_t avail = packet->datalen - packet->startpos; const size_t cpy = SDL_min(len, avail); @@ -272,7 +284,7 @@ SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) queue->queued_bytes -= cpy; len -= cpy; - if (packet->startpos == packet->datalen) { /* packet is done, put it in the pool. */ + if (packet->startpos == packet->datalen) { /* packet is done, put it in the pool. */ queue->head = packet->next; SDL_assert((packet->next != NULL) || (packet == queue->tail)); packet->next = queue->pool; @@ -282,57 +294,30 @@ SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *_buf, const size_t _len) SDL_assert((queue->head != NULL) == (queue->queued_bytes != 0)); - if (queue->head == NULL) { - queue->tail = NULL; /* in case we drained the queue entirely. */ + if (!queue->head) { + queue->tail = NULL; /* in case we drained the queue entirely. */ } - return (size_t) (ptr - buf); + SDL_UnlockMutex(queue->lock); + + return (size_t)(ptr - buf); } size_t SDL_CountDataQueue(SDL_DataQueue *queue) { - return queue ? queue->queued_bytes : 0; + size_t retval = 0; + if (queue) { + SDL_LockMutex(queue->lock); + retval = queue->queued_bytes; + SDL_UnlockMutex(queue->lock); + } + return retval; } -void * -SDL_ReserveSpaceInDataQueue(SDL_DataQueue *queue, const size_t len) +SDL_mutex *SDL_GetDataQueueMutex(SDL_DataQueue *queue) { - SDL_DataQueuePacket *packet; - - if (!queue) { - SDL_InvalidParamError("queue"); - return NULL; - } else if (len == 0) { - SDL_InvalidParamError("len"); - return NULL; - } else if (len > queue->packet_size) { - SDL_SetError("len is larger than packet size"); - return NULL; - } - - packet = queue->head; - if (packet) { - const size_t avail = queue->packet_size - packet->datalen; - if (len <= avail) { /* we can use the space at end of this packet. */ - void *retval = packet->data + packet->datalen; - packet->datalen += len; - queue->queued_bytes += len; - return retval; - } - } - - /* Need a fresh packet. */ - packet = AllocateDataQueuePacket(queue); - if (!packet) { - SDL_OutOfMemory(); - return NULL; - } - - packet->datalen = len; - queue->queued_bytes += len; - return packet->data; + return queue ? queue->lock : NULL; } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/SDL_dataqueue.h b/src/SDL_dataqueue.h index 46b8ebd70c51a..6c671adadc692 100644 --- a/src/SDL_dataqueue.h +++ b/src/SDL_dataqueue.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,23 +33,8 @@ int SDL_WriteToDataQueue(SDL_DataQueue *queue, const void *data, const size_t le size_t SDL_ReadFromDataQueue(SDL_DataQueue *queue, void *buf, const size_t len); size_t SDL_PeekIntoDataQueue(SDL_DataQueue *queue, void *buf, const size_t len); size_t SDL_CountDataQueue(SDL_DataQueue *queue); - -/* this sets a section of the data queue aside (possibly allocating memory for it) - as if it's been written to, but returns a pointer to that space. You may write - to this space until a read would consume it. Writes (and other calls to this - function) will safely append their data after this reserved space and can - be in flight at the same time. There is no thread safety. - If there isn't an existing block of memory that can contain the reserved - space, one will be allocated for it. You can not (currently) allocate - a space larger than the packetlen requested in SDL_NewDataQueue. - Returned buffer is uninitialized. - This lets you avoid an extra copy in some cases, but it's safer to use - SDL_WriteToDataQueue() unless you know what you're doing. - Returns pointer to buffer of at least (len) bytes, NULL on error. -*/ -void *SDL_ReserveSpaceInDataQueue(SDL_DataQueue *queue, const size_t len); +SDL_mutex *SDL_GetDataQueueMutex(SDL_DataQueue *queue); /* don't destroy this, obviously. */ #endif /* SDL_dataqueue_h_ */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/SDL_error.c b/src/SDL_error.c index 1ca460a690335..db24b3bce6f71 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,16 +25,15 @@ #include "SDL_error.h" #include "SDL_error_c.h" -int -SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { /* Ignore call if invalid format pointer was passed */ - if (fmt != NULL) { + if (fmt) { va_list ap; int result; SDL_error *error = SDL_GetErrBuf(); - error->error = 1; /* mark error as valid */ + error->error = 1; /* mark error as valid */ va_start(ap, fmt); result = SDL_vsnprintf(error->str, error->len, fmt, ap); @@ -47,12 +46,11 @@ SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) error->str = str; error->len = len; va_start(ap, fmt); - SDL_vsnprintf(error->str, error->len, fmt, ap); + (void)SDL_vsnprintf(error->str, error->len, fmt, ap); va_end(ap); } } - if (SDL_LogGetPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) { /* If we are in debug mode, print out the error message */ SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error->str); @@ -63,22 +61,19 @@ SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) } /* Available for backwards compatibility */ -const char * -SDL_GetError(void) +const char *SDL_GetError(void) { const SDL_error *error = SDL_GetErrBuf(); return error->error ? error->str : ""; } -void -SDL_ClearError(void) +void SDL_ClearError(void) { SDL_GetErrBuf()->error = 0; } /* Very common errors go here */ -int -SDL_Error(SDL_errorcode code) +int SDL_Error(SDL_errorcode code) { switch (code) { case SDL_ENOMEM: @@ -97,8 +92,7 @@ SDL_Error(SDL_errorcode code) } #ifdef TEST_ERROR -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { char buffer[BUFSIZ + 1]; @@ -113,9 +107,7 @@ main(int argc, char *argv[]) } #endif - -char * -SDL_GetErrorMsg(char *errstr, int maxlen) +char *SDL_GetErrorMsg(char *errstr, int maxlen) { const SDL_error *error = SDL_GetErrBuf(); diff --git a/src/SDL_error_c.h b/src/SDL_error_c.h index 1ac1f42510634..ae9f5dfed0142 100644 --- a/src/SDL_error_c.h +++ b/src/SDL_error_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/SDL_guid.c b/src/SDL_guid.c index d3529b7280623..0e4c34b1c97d7 100644 --- a/src/SDL_guid.c +++ b/src/SDL_guid.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,11 +29,11 @@ void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID) static const char k_rgchHexToASCII[] = "0123456789abcdef"; int i; - if ((pszGUID == NULL) || (cbGUID <= 0)) { + if ((!pszGUID) || (cbGUID <= 0)) { return; } - for (i = 0; i < sizeof(guid.data) && i < (cbGUID-1)/2; i++) { + for (i = 0; i < sizeof(guid.data) && i < (cbGUID - 1) / 2; i++) { /* each input byte writes 2 ascii chars, and might write a null byte. */ /* If we don't have room for next input byte, stop */ unsigned char c = guid.data[i]; @@ -52,15 +52,15 @@ void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID) static unsigned char nibble(unsigned char c) { if ((c >= '0') && (c <= '9')) { - return (c - '0'); + return c - '0'; } if ((c >= 'A') && (c <= 'F')) { - return (c - 'A' + 0x0a); + return c - 'A' + 0x0a; } if ((c >= 'a') && (c <= 'f')) { - return (c - 'a' + 0x0a); + return c - 'a' + 0x0a; } /* received an invalid character, and no real way to return an error */ @@ -72,7 +72,7 @@ static unsigned char nibble(unsigned char c) SDL_GUID SDL_GUIDFromString(const char *pchGUID) { SDL_GUID guid; - int maxoutputbytes= sizeof(guid); + int maxoutputbytes = sizeof(guid); size_t len = SDL_strlen(pchGUID); Uint8 *p; size_t i; @@ -83,8 +83,8 @@ SDL_GUID SDL_GUIDFromString(const char *pchGUID) SDL_memset(&guid, 0x00, sizeof(guid)); p = (Uint8 *)&guid; - for (i = 0; (i < len) && ((p - (Uint8 *)&guid) < maxoutputbytes); i+=2, p++) { - *p = (nibble((unsigned char)pchGUID[i]) << 4) | nibble((unsigned char)pchGUID[i+1]); + for (i = 0; (i < len) && ((p - (Uint8 *)&guid) < maxoutputbytes); i += 2, p++) { + *p = (nibble((unsigned char)pchGUID[i]) << 4) | nibble((unsigned char)pchGUID[i + 1]); } return guid; diff --git a/src/SDL_hints.c b/src/SDL_hints.c index 4341f8d20336f..f8e9ba4c2a30e 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,17 +24,18 @@ #include "SDL_error.h" #include "SDL_hints_c.h" - /* Assuming there aren't many hints set and they aren't being queried in critical performance paths, we'll just use linked lists here. */ -typedef struct SDL_HintWatch { +typedef struct SDL_HintWatch +{ SDL_HintCallback callback; void *userdata; struct SDL_HintWatch *next; } SDL_HintWatch; -typedef struct SDL_Hint { +typedef struct SDL_Hint +{ char *name; char *value; SDL_HintPriority priority; @@ -44,9 +45,7 @@ typedef struct SDL_Hint { static SDL_Hint *SDL_hints; -SDL_bool -SDL_SetHintWithPriority(const char *name, const char *value, - SDL_HintPriority priority) +SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority) { const char *env; SDL_Hint *hint; @@ -68,7 +67,7 @@ SDL_SetHintWithPriority(const char *name, const char *value, } if (hint->value != value && (!value || !hint->value || SDL_strcmp(hint->value, value) != 0)) { - for (entry = hint->callbacks; entry; ) { + for (entry = hint->callbacks; entry;) { /* Save the next entry in case this one is deleted */ SDL_HintWatch *next = entry->next; entry->callback(entry->userdata, name, hint->value, value); @@ -96,8 +95,7 @@ SDL_SetHintWithPriority(const char *name, const char *value, return SDL_TRUE; } -SDL_bool -SDL_ResetHint(const char *name) +SDL_bool SDL_ResetHint(const char *name) { const char *env; SDL_Hint *hint; @@ -110,10 +108,10 @@ SDL_ResetHint(const char *name) env = SDL_getenv(name); for (hint = SDL_hints; hint; hint = hint->next) { if (SDL_strcmp(name, hint->name) == 0) { - if ((env == NULL && hint->value != NULL) || - (env != NULL && hint->value == NULL) || - (env != NULL && SDL_strcmp(env, hint->value) != 0)) { - for (entry = hint->callbacks; entry; ) { + if ((!env && hint->value) || + (env && !hint->value) || + (env && SDL_strcmp(env, hint->value) != 0)) { + for (entry = hint->callbacks; entry;) { /* Save the next entry in case this one is deleted */ SDL_HintWatch *next = entry->next; entry->callback(entry->userdata, name, hint->value, env); @@ -129,8 +127,7 @@ SDL_ResetHint(const char *name) return SDL_FALSE; } -void -SDL_ResetHints(void) +void SDL_ResetHints(void) { const char *env; SDL_Hint *hint; @@ -138,10 +135,10 @@ SDL_ResetHints(void) for (hint = SDL_hints; hint; hint = hint->next) { env = SDL_getenv(hint->name); - if ((env == NULL && hint->value != NULL) || - (env != NULL && hint->value == NULL) || - (env != NULL && SDL_strcmp(env, hint->value) != 0)) { - for (entry = hint->callbacks; entry; ) { + if ((!env && hint->value) || + (env && !hint->value) || + (env && SDL_strcmp(env, hint->value) != 0)) { + for (entry = hint->callbacks; entry;) { /* Save the next entry in case this one is deleted */ SDL_HintWatch *next = entry->next; entry->callback(entry->userdata, hint->name, hint->value, env); @@ -154,22 +151,24 @@ SDL_ResetHints(void) } } -SDL_bool -SDL_SetHint(const char *name, const char *value) +SDL_bool SDL_SetHint(const char *name, const char *value) { return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL); } -const char * -SDL_GetHint(const char *name) +const char *SDL_GetHint(const char *name) { const char *env; SDL_Hint *hint; + if (!name) { + return NULL; + } + env = SDL_getenv(name); for (hint = SDL_hints; hint; hint = hint->next) { if (SDL_strcmp(name, hint->name) == 0) { - if (env == NULL || hint->priority == SDL_HINT_OVERRIDE) { + if (!env || hint->priority == SDL_HINT_OVERRIDE) { return hint->value; } break; @@ -178,8 +177,7 @@ SDL_GetHint(const char *name) return env; } -SDL_bool -SDL_GetStringBoolean(const char *value, SDL_bool default_value) +SDL_bool SDL_GetStringBoolean(const char *value, SDL_bool default_value) { if (!value || !*value) { return default_value; @@ -190,15 +188,13 @@ SDL_GetStringBoolean(const char *value, SDL_bool default_value) return SDL_TRUE; } -SDL_bool -SDL_GetHintBoolean(const char *name, SDL_bool default_value) +SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value) { const char *hint = SDL_GetHint(name); return SDL_GetStringBoolean(hint, default_value); } -void -SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) +void SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) { SDL_Hint *hint; SDL_HintWatch *entry; @@ -259,8 +255,7 @@ SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) callback(userdata, name, value, value); } -void -SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata) +void SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata) { SDL_Hint *hint; SDL_HintWatch *entry, *prev; @@ -296,7 +291,7 @@ void SDL_ClearHints(void) SDL_free(hint->name); SDL_free(hint->value); - for (entry = hint->callbacks; entry; ) { + for (entry = hint->callbacks; entry;) { SDL_HintWatch *freeable = entry; entry = entry->next; SDL_free(freeable); diff --git a/src/SDL_hints_c.h b/src/SDL_hints_c.h index d046817f68cf8..097a0d9dacbdf 100644 --- a/src/SDL_hints_c.h +++ b/src/SDL_hints_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/SDL_internal.h b/src/SDL_internal.h index 43e407f87af50..aa6391493c773 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,9 +35,14 @@ #define SDL_VARIABLE_LENGTH_ARRAY #endif -#define SDL_MAX_SMALL_ALLOC_STACKSIZE 128 -#define SDL_small_alloc(type, count, pisstack) ( (*(pisstack) = ((sizeof(type)*(count)) < SDL_MAX_SMALL_ALLOC_STACKSIZE)), (*(pisstack) ? SDL_stack_alloc(type, count) : (type*)SDL_malloc(sizeof(type)*(count))) ) -#define SDL_small_free(ptr, isstack) if ((isstack)) { SDL_stack_free(ptr); } else { SDL_free(ptr); } +#define SDL_MAX_SMALL_ALLOC_STACKSIZE 128 +#define SDL_small_alloc(type, count, pisstack) ((*(pisstack) = ((sizeof(type) * (count)) < SDL_MAX_SMALL_ALLOC_STACKSIZE)), (*(pisstack) ? SDL_stack_alloc(type, count) : (type *)SDL_malloc(sizeof(type) * (count)))) +#define SDL_small_free(ptr, isstack) \ + if ((isstack)) { \ + SDL_stack_free(ptr); \ + } else { \ + SDL_free(ptr); \ + } #include "dynapi/SDL_dynapi.h" @@ -52,57 +57,57 @@ /* If you run into a warning that O_CLOEXEC is redefined, update the SDL configuration header for your platform to add HAVE_O_CLOEXEC */ #ifndef HAVE_O_CLOEXEC -#define O_CLOEXEC 0 +#define O_CLOEXEC 0 #endif /* A few #defines to reduce SDL2 footprint. Only effective when library is statically linked. You have to manually edit this file. */ #ifndef SDL_LEAN_AND_MEAN -#define SDL_LEAN_AND_MEAN 0 +#define SDL_LEAN_AND_MEAN 0 #endif /* Optimized functions from 'SDL_blit_0.c' - blit with source BitsPerPixel < 8, palette */ #ifndef SDL_HAVE_BLIT_0 -#define SDL_HAVE_BLIT_0 !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_0 !SDL_LEAN_AND_MEAN #endif /* Optimized functions from 'SDL_blit_1.c' - blit with source BytesPerPixel == 1, palette */ #ifndef SDL_HAVE_BLIT_1 -#define SDL_HAVE_BLIT_1 !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_1 !SDL_LEAN_AND_MEAN #endif /* Optimized functions from 'SDL_blit_A.c' - blit with 'SDL_BLENDMODE_BLEND' blending mode */ #ifndef SDL_HAVE_BLIT_A -#define SDL_HAVE_BLIT_A !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_A !SDL_LEAN_AND_MEAN #endif /* Optimized functions from 'SDL_blit_N.c' - blit with COLORKEY mode, or nothing */ #ifndef SDL_HAVE_BLIT_N -#define SDL_HAVE_BLIT_N !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_N !SDL_LEAN_AND_MEAN #endif /* Optimized functions from 'SDL_blit_N.c' - RGB565 conversion with Lookup tables */ #ifndef SDL_HAVE_BLIT_N_RGB565 -#define SDL_HAVE_BLIT_N_RGB565 !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_N_RGB565 !SDL_LEAN_AND_MEAN #endif /* Optimized functions from 'SDL_blit_AUTO.c' - blit with modulate color, modulate alpha, any blending mode - scaling or not */ #ifndef SDL_HAVE_BLIT_AUTO -#define SDL_HAVE_BLIT_AUTO !SDL_LEAN_AND_MEAN +#define SDL_HAVE_BLIT_AUTO !SDL_LEAN_AND_MEAN #endif /* Run-Length-Encoding - SDL_SetColorKey() called with SDL_RLEACCEL flag */ #ifndef SDL_HAVE_RLE -#define SDL_HAVE_RLE !SDL_LEAN_AND_MEAN +#define SDL_HAVE_RLE !SDL_LEAN_AND_MEAN #endif /* Software SDL_Renderer @@ -110,19 +115,101 @@ - *not* general blitting functions - {blend,draw}{fillrect,line,point} internal functions */ #ifndef SDL_VIDEO_RENDER_SW -#define SDL_VIDEO_RENDER_SW !SDL_LEAN_AND_MEAN +#define SDL_VIDEO_RENDER_SW !SDL_LEAN_AND_MEAN #endif /* YUV formats - handling of YUV surfaces - blitting and conversion functions */ #ifndef SDL_HAVE_YUV -#define SDL_HAVE_YUV !SDL_LEAN_AND_MEAN +#define SDL_HAVE_YUV !SDL_LEAN_AND_MEAN +#endif + +#ifndef SDL_RENDER_DISABLED +/* define the not defined ones as 0 */ +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 0 +#endif +#ifndef SDL_VIDEO_RENDER_D3D11 +#define SDL_VIDEO_RENDER_D3D11 0 +#endif +#ifndef SDL_VIDEO_RENDER_D3D12 +#define SDL_VIDEO_RENDER_D3D12 0 +#endif +#ifndef SDL_VIDEO_RENDER_METAL +#define SDL_VIDEO_RENDER_METAL 0 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 0 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES +#define SDL_VIDEO_RENDER_OGL_ES 0 +#endif +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 0 +#endif +#ifndef SDL_VIDEO_RENDER_DIRECTFB +#define SDL_VIDEO_RENDER_DIRECTFB 0 +#endif +#ifndef SDL_VIDEO_RENDER_PS2 +#define SDL_VIDEO_RENDER_PS2 0 +#endif +#ifndef SDL_VIDEO_RENDER_PSP +#define SDL_VIDEO_RENDER_PSP 0 +#endif +#ifndef SDL_VIDEO_RENDER_VITA_GXM +#define SDL_VIDEO_RENDER_VITA_GXM 0 +#endif +#else /* define all as 0 */ +#undef SDL_VIDEO_RENDER_SW +#define SDL_VIDEO_RENDER_SW 0 +#undef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 0 +#undef SDL_VIDEO_RENDER_D3D11 +#define SDL_VIDEO_RENDER_D3D11 0 +#undef SDL_VIDEO_RENDER_D3D12 +#define SDL_VIDEO_RENDER_D3D12 0 +#undef SDL_VIDEO_RENDER_METAL +#define SDL_VIDEO_RENDER_METAL 0 +#undef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 0 +#undef SDL_VIDEO_RENDER_OGL_ES +#define SDL_VIDEO_RENDER_OGL_ES 0 +#undef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 0 +#undef SDL_VIDEO_RENDER_DIRECTFB +#define SDL_VIDEO_RENDER_DIRECTFB 0 +#undef SDL_VIDEO_RENDER_PS2 +#define SDL_VIDEO_RENDER_PS2 0 +#undef SDL_VIDEO_RENDER_PSP +#define SDL_VIDEO_RENDER_PSP 0 +#undef SDL_VIDEO_RENDER_VITA_GXM +#define SDL_VIDEO_RENDER_VITA_GXM 0 +#endif /* SDL_RENDER_DISABLED */ + +#define SDL_HAS_RENDER_DRIVER \ + (SDL_VIDEO_RENDER_SW | \ + SDL_VIDEO_RENDER_D3D | \ + SDL_VIDEO_RENDER_D3D11 | \ + SDL_VIDEO_RENDER_D3D12 | \ + SDL_VIDEO_RENDER_METAL | \ + SDL_VIDEO_RENDER_OGL | \ + SDL_VIDEO_RENDER_OGL_ES | \ + SDL_VIDEO_RENDER_OGL_ES2 | \ + SDL_VIDEO_RENDER_DIRECTFB | \ + SDL_VIDEO_RENDER_PS2 | \ + SDL_VIDEO_RENDER_PSP | \ + SDL_VIDEO_RENDER_VITA_GXM) + +#if !defined(SDL_RENDER_DISABLED) && !SDL_HAS_RENDER_DRIVER +#error SDL_RENDER enabled without any backend drivers. #endif #include "SDL_assert.h" #include "SDL_log.h" +extern void SDL_InitMainThread(void); + #endif /* SDL_internal_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/SDL_list.c b/src/SDL_list.c index af9f8bf81ba0a..88730029c2b47 100644 --- a/src/SDL_list.c +++ b/src/SDL_list.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,12 +24,11 @@ #include "./SDL_list.h" /* Push */ -int -SDL_ListAdd(SDL_ListNode **head, void *ent) +int SDL_ListAdd(SDL_ListNode **head, void *ent) { - SDL_ListNode *node = SDL_malloc(sizeof (*node)); + SDL_ListNode *node = SDL_malloc(sizeof(*node)); - if (node == NULL) { + if (!node) { return SDL_OutOfMemory(); } @@ -40,13 +39,12 @@ SDL_ListAdd(SDL_ListNode **head, void *ent) } /* Pop from end as a FIFO (if add with SDL_ListAdd) */ -void -SDL_ListPop(SDL_ListNode **head, void **ent) +void SDL_ListPop(SDL_ListNode **head, void **ent) { SDL_ListNode **ptr = head; /* Invalid or empty */ - if (head == NULL || *head == NULL) { + if (!head || !*head) { return; } @@ -55,15 +53,14 @@ SDL_ListPop(SDL_ListNode **head, void **ent) } if (ent) { - *ent = (*ptr)->entry; + *ent = (*ptr)->entry; } SDL_free(*ptr); *ptr = NULL; } -void -SDL_ListRemove(SDL_ListNode **head, void *ent) +void SDL_ListRemove(SDL_ListNode **head, void *ent) { SDL_ListNode **ptr = head; @@ -78,8 +75,7 @@ SDL_ListRemove(SDL_ListNode **head, void *ent) } } -void -SDL_ListClear(SDL_ListNode **head) +void SDL_ListClear(SDL_ListNode **head) { SDL_ListNode *l = *head; *head = NULL; diff --git a/src/SDL_list.h b/src/SDL_list.h index a7ead1dcd068d..16079b84b7dfd 100644 --- a/src/SDL_list.h +++ b/src/SDL_list.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,6 @@ typedef struct SDL_ListNode struct SDL_ListNode *next; } SDL_ListNode; - int SDL_ListAdd(SDL_ListNode **head, void *ent); void SDL_ListPop(SDL_ListNode **head, void **ent); void SDL_ListRemove(SDL_ListNode **head, void *ent); diff --git a/src/SDL_log.c b/src/SDL_log.c index c01e31d8a9174..47f5b7251eac8 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,10 +28,11 @@ #include "SDL_error.h" #include "SDL_log.h" +#include "SDL_hints.h" #include "SDL_mutex.h" #include "SDL_log_c.h" -#if HAVE_STDIO_H +#ifdef HAVE_STDIO_H #include #endif @@ -41,14 +42,10 @@ #include "stdlib/SDL_vacopy.h" - /* The size of the stack buffer to use for rendering log messages. */ #define SDL_MAX_LOG_MESSAGE_STACK 256 -#define DEFAULT_PRIORITY SDL_LOG_PRIORITY_CRITICAL -#define DEFAULT_ASSERT_PRIORITY SDL_LOG_PRIORITY_WARN -#define DEFAULT_APPLICATION_PRIORITY SDL_LOG_PRIORITY_INFO -#define DEFAULT_TEST_PRIORITY SDL_LOG_PRIORITY_VERBOSE +#define DEFAULT_CATEGORY -1 typedef struct SDL_LogLevel { @@ -61,15 +58,14 @@ typedef struct SDL_LogLevel static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message); static SDL_LogLevel *SDL_loglevels; -static SDL_LogPriority SDL_default_priority = DEFAULT_PRIORITY; -static SDL_LogPriority SDL_assert_priority = DEFAULT_ASSERT_PRIORITY; -static SDL_LogPriority SDL_application_priority = DEFAULT_APPLICATION_PRIORITY; -static SDL_LogPriority SDL_test_priority = DEFAULT_TEST_PRIORITY; +static SDL_bool SDL_forced_priority = SDL_FALSE; +static SDL_LogPriority SDL_forced_priority_level; static SDL_LogOutputFunction SDL_log_function = SDL_LogOutput; static void *SDL_log_userdata = NULL; static SDL_mutex *log_function_mutex = NULL; -static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = { +/* If this list changes, update the documentation for SDL_HINT_LOGGING */ +static const char *SDL_priority_prefixes[] = { NULL, "VERBOSE", "DEBUG", @@ -78,8 +74,9 @@ static const char *SDL_priority_prefixes[SDL_NUM_LOG_PRIORITIES] = { "ERROR", "CRITICAL" }; +SDL_COMPILE_TIME_ASSERT(priority_prefixes, SDL_arraysize(SDL_priority_prefixes) == SDL_NUM_LOG_PRIORITIES); -#ifdef __ANDROID__ +/* If this list changes, update the documentation for SDL_HINT_LOGGING */ static const char *SDL_category_prefixes[] = { "APP", "ERROR", @@ -91,9 +88,9 @@ static const char *SDL_category_prefixes[] = { "INPUT", "TEST" }; +SDL_COMPILE_TIME_ASSERT(category_prefixes, SDL_arraysize(SDL_category_prefixes) == SDL_LOG_CATEGORY_RESERVED1); -SDL_COMPILE_TIME_ASSERT(category_prefixes_enum, SDL_TABLESIZE(SDL_category_prefixes) == SDL_LOG_CATEGORY_RESERVED1); - +#ifdef __ANDROID__ static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = { ANDROID_LOG_UNKNOWN, ANDROID_LOG_VERBOSE, @@ -105,8 +102,7 @@ static int SDL_android_priority[SDL_NUM_LOG_PRIORITIES] = { }; #endif /* __ANDROID__ */ -void -SDL_LogInit(void) +void SDL_LogInit(void) { if (!log_function_mutex) { /* if this fails we'll try to continue without it. */ @@ -114,8 +110,7 @@ SDL_LogInit(void) } } -void -SDL_LogQuit(void) +void SDL_LogQuit(void) { SDL_LogResetPriorities(); if (log_function_mutex) { @@ -124,21 +119,19 @@ SDL_LogQuit(void) } } -void -SDL_LogSetAllPriority(SDL_LogPriority priority) +void SDL_LogSetAllPriority(SDL_LogPriority priority) { SDL_LogLevel *entry; for (entry = SDL_loglevels; entry; entry = entry->next) { entry->priority = priority; } - SDL_default_priority = priority; - SDL_assert_priority = priority; - SDL_application_priority = priority; + + SDL_forced_priority = SDL_TRUE; + SDL_forced_priority_level = priority; } -void -SDL_LogSetPriority(int category, SDL_LogPriority priority) +void SDL_LogSetPriority(int category, SDL_LogPriority priority) { SDL_LogLevel *entry; @@ -159,8 +152,123 @@ SDL_LogSetPriority(int category, SDL_LogPriority priority) } } -SDL_LogPriority -SDL_LogGetPriority(int category) +static SDL_bool SDL_ParseLogCategory(const char *string, size_t length, int *category) +{ + int i; + + if (SDL_isdigit(*string)) { + *category = SDL_atoi(string); + return SDL_TRUE; + } + + if (*string == '*') { + *category = DEFAULT_CATEGORY; + return SDL_TRUE; + } + + for (i = 0; i < SDL_arraysize(SDL_category_prefixes); ++i) { + if (SDL_strncasecmp(string, SDL_category_prefixes[i], length) == 0) { + *category = i; + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +static SDL_bool SDL_ParseLogPriority(const char *string, size_t length, SDL_LogPriority *priority) +{ + int i; + + if (SDL_isdigit(*string)) { + i = SDL_atoi(string); + if (i == 0) { + /* 0 has a special meaning of "disable this category" */ + *priority = SDL_NUM_LOG_PRIORITIES; + return SDL_TRUE; + } + if (i >= SDL_LOG_PRIORITY_VERBOSE && i < SDL_NUM_LOG_PRIORITIES) { + *priority = (SDL_LogPriority)i; + return SDL_TRUE; + } + return SDL_FALSE; + } + + if (SDL_strncasecmp(string, "quiet", length) == 0) { + *priority = SDL_NUM_LOG_PRIORITIES; + return SDL_TRUE; + } + + for (i = SDL_LOG_PRIORITY_VERBOSE; i < SDL_NUM_LOG_PRIORITIES; ++i) { + if (SDL_strncasecmp(string, SDL_priority_prefixes[i], length) == 0) { + *priority = (SDL_LogPriority)i; + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +static SDL_bool SDL_ParseLogCategoryPriority(const char *hint, int category, SDL_LogPriority *priority) +{ + const char *name, *next; + int current_category; + + if (category == DEFAULT_CATEGORY && SDL_strchr(hint, '=') == NULL) { + return SDL_ParseLogPriority(hint, SDL_strlen(hint), priority); + } + + for (name = hint; name; name = next) { + const char *sep = SDL_strchr(name, '='); + if (!sep) { + break; + } + next = SDL_strchr(sep, ','); + if (next) { + ++next; + } + + if (SDL_ParseLogCategory(name, (sep - name), ¤t_category)) { + if (current_category == category) { + const char *value = sep + 1; + size_t len; + if (next) { + len = (next - value - 1); + } else { + len = SDL_strlen(value); + } + return SDL_ParseLogPriority(value, len, priority); + } + } + } + return SDL_FALSE; +} + +static SDL_LogPriority SDL_GetDefaultLogPriority(int category) +{ + const char *hint = SDL_GetHint(SDL_HINT_LOGGING); + if (hint) { + SDL_LogPriority priority; + + if (SDL_ParseLogCategoryPriority(hint, category, &priority)) { + return priority; + } + if (SDL_ParseLogCategoryPriority(hint, DEFAULT_CATEGORY, &priority)) { + return priority; + } + } + + switch (category) { + case SDL_LOG_CATEGORY_APPLICATION: + return SDL_LOG_PRIORITY_INFO; + case SDL_LOG_CATEGORY_ASSERT: + return SDL_LOG_PRIORITY_WARN; + case SDL_LOG_CATEGORY_TEST: + return SDL_LOG_PRIORITY_VERBOSE; + default: + return SDL_LOG_PRIORITY_ERROR; + } +} + +SDL_LogPriority SDL_LogGetPriority(int category) { SDL_LogLevel *entry; @@ -170,19 +278,14 @@ SDL_LogGetPriority(int category) } } - if (category == SDL_LOG_CATEGORY_TEST) { - return SDL_test_priority; - } else if (category == SDL_LOG_CATEGORY_APPLICATION) { - return SDL_application_priority; - } else if (category == SDL_LOG_CATEGORY_ASSERT) { - return SDL_assert_priority; - } else { - return SDL_default_priority; + if (SDL_forced_priority) { + return SDL_forced_priority_level; } + + return SDL_GetDefaultLogPriority(category); } -void -SDL_LogResetPriorities(void) +void SDL_LogResetPriorities(void) { SDL_LogLevel *entry; @@ -191,15 +294,10 @@ SDL_LogResetPriorities(void) SDL_loglevels = entry->next; SDL_free(entry); } - - SDL_default_priority = DEFAULT_PRIORITY; - SDL_assert_priority = DEFAULT_ASSERT_PRIORITY; - SDL_application_priority = DEFAULT_APPLICATION_PRIORITY; - SDL_test_priority = DEFAULT_TEST_PRIORITY; + SDL_forced_priority = SDL_FALSE; } -void -SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -208,8 +306,7 @@ SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -218,8 +315,7 @@ SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -228,8 +324,7 @@ SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -238,8 +333,7 @@ SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -248,8 +342,7 @@ SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -258,8 +351,7 @@ SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -268,8 +360,7 @@ SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) va_end(ap); } -void -SDL_LogMessage(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +void SDL_LogMessage(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; @@ -279,8 +370,7 @@ SDL_LogMessage(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING } #ifdef __ANDROID__ -static const char * -GetCategoryPrefix(int category) +static const char *GetCategoryPrefix(int category) { if (category < SDL_LOG_CATEGORY_RESERVED1) { return SDL_category_prefixes[category]; @@ -292,8 +382,7 @@ GetCategoryPrefix(int category) } #endif /* __ANDROID__ */ -void -SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap) +void SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list ap) { char *message = NULL; char stack_buf[SDL_MAX_LOG_MESSAGE_STACK]; @@ -326,15 +415,17 @@ SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list len = SDL_vsnprintf(stack_buf, sizeof(stack_buf), fmt, aq); va_end(aq); - if (len < 0) + if (len < 0) { return; + } /* If message truncated, allocate and re-render */ if (len >= sizeof(stack_buf) && SDL_size_add_overflow(len, 1, &len_plus_term) == 0) { /* Allocate exactly what we need, including the zero-terminator */ message = (char *)SDL_malloc(len_plus_term); - if (!message) + if (!message) { return; + } va_copy(aq, ap); len = SDL_vsnprintf(message, len_plus_term, fmt, aq); va_end(aq); @@ -343,22 +434,16 @@ SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list } /* Chop off final endline. */ - if ((len > 0) && (message[len-1] == '\n')) { + if ((len > 0) && (message[len - 1] == '\n')) { message[--len] = '\0'; - if ((len > 0) && (message[len-1] == '\r')) { /* catch "\r\n", too. */ + if ((len > 0) && (message[len - 1] == '\r')) { /* catch "\r\n", too. */ message[--len] = '\0'; } } - if (log_function_mutex) { - SDL_LockMutex(log_function_mutex); - } - + SDL_LockMutex(log_function_mutex); SDL_log_function(SDL_log_userdata, category, priority, message); - - if (log_function_mutex) { - SDL_UnlockMutex(log_function_mutex); - } + SDL_UnlockMutex(log_function_mutex); /* Free only if dynamically allocated */ if (message != stack_buf) { @@ -374,9 +459,8 @@ static int consoleAttached = 0; static HANDLE stderrHandle = NULL; #endif -static void SDLCALL -SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, - const char *message) +static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, + const char *message) { #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) /* Way too many allocations here, urgh */ @@ -397,57 +481,57 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, if (consoleAttached == 0) { attachResult = AttachConsole(ATTACH_PARENT_PROCESS); if (!attachResult) { - attachError = GetLastError(); - if (attachError == ERROR_INVALID_HANDLE) { - /* This is expected when running from Visual Studio */ - /*OutputDebugString(TEXT("Parent process has no console\r\n"));*/ - consoleAttached = -1; - } else if (attachError == ERROR_GEN_FAILURE) { - OutputDebugString(TEXT("Could not attach to console of parent process\r\n")); - consoleAttached = -1; - } else if (attachError == ERROR_ACCESS_DENIED) { - /* Already attached */ - consoleAttached = 1; - } else { - OutputDebugString(TEXT("Error attaching console\r\n")); - consoleAttached = -1; - } - } else { - /* Newly attached */ + attachError = GetLastError(); + if (attachError == ERROR_INVALID_HANDLE) { + /* This is expected when running from Visual Studio */ + /*OutputDebugString(TEXT("Parent process has no console\r\n"));*/ + consoleAttached = -1; + } else if (attachError == ERROR_GEN_FAILURE) { + OutputDebugString(TEXT("Could not attach to console of parent process\r\n")); + consoleAttached = -1; + } else if (attachError == ERROR_ACCESS_DENIED) { + /* Already attached */ consoleAttached = 1; + } else { + OutputDebugString(TEXT("Error attaching console\r\n")); + consoleAttached = -1; } + } else { + /* Newly attached */ + consoleAttached = 1; + } - if (consoleAttached == 1) { - stderrHandle = GetStdHandle(STD_ERROR_HANDLE); + if (consoleAttached == 1) { + stderrHandle = GetStdHandle(STD_ERROR_HANDLE); - if (GetConsoleMode(stderrHandle, &consoleMode) == 0) { - /* WriteConsole fails if the output is redirected to a file. Must use WriteFile instead. */ - consoleAttached = 2; - } + if (GetConsoleMode(stderrHandle, &consoleMode) == 0) { + /* WriteConsole fails if the output is redirected to a file. Must use WriteFile instead. */ + consoleAttached = 2; } + } } #endif /* !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__) */ length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1 + 1; output = SDL_small_alloc(char, length, &isstack); - SDL_snprintf(output, length, "%s: %s\r\n", SDL_priority_prefixes[priority], message); + (void)SDL_snprintf(output, length, "%s: %s\r\n", SDL_priority_prefixes[priority], message); tstr = WIN_UTF8ToString(output); - + /* Output to debugger */ OutputDebugString(tstr); - + #if !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__) /* Screen output to stderr, if console was attached. */ if (consoleAttached == 1) { - if (!WriteConsole(stderrHandle, tstr, (DWORD) SDL_tcslen(tstr), &charsWritten, NULL)) { - OutputDebugString(TEXT("Error calling WriteConsole\r\n")); - if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { - OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); - } + if (!WriteConsole(stderrHandle, tstr, (DWORD)SDL_tcslen(tstr), &charsWritten, NULL)) { + OutputDebugString(TEXT("Error calling WriteConsole\r\n")); + if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { + OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); } + } } else if (consoleAttached == 2) { - if (!WriteFile(stderrHandle, output, (DWORD) SDL_strlen(output), &charsWritten, NULL)) { + if (!WriteFile(stderrHandle, output, (DWORD)SDL_strlen(output), &charsWritten, NULL)) { OutputDebugString(TEXT("Error calling WriteFile\r\n")); } } @@ -465,7 +549,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, } #elif defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT)) /* Technically we don't need Cocoa/UIKit, but that's where this function is defined for now. - */ + */ extern void SDL_NSLog(const char *prefix, const char *text); { SDL_NSLog(SDL_priority_prefixes[priority], message); @@ -473,37 +557,42 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, } #elif defined(__PSP__) || defined(__PS2__) { - FILE* pFile; - pFile = fopen ("SDL_Log.txt", "a"); - fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); - fclose (pFile); + FILE *pFile; + pFile = fopen("SDL_Log.txt", "a"); + if (pFile) { + (void)fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); + (void)fclose(pFile); + } } #elif defined(__VITA__) { - FILE* pFile; - pFile = fopen ("ux0:/data/SDL_Log.txt", "a"); - fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); - fclose (pFile); + FILE *pFile; + pFile = fopen("ux0:/data/SDL_Log.txt", "a"); + if (pFile) { + (void)fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); + (void)fclose(pFile); + } } #elif defined(__3DS__) { FILE *pFile; pFile = fopen("sdmc:/3ds/SDL_Log.txt", "a"); - fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); - fclose(pFile); + if (pFile) { + (void)fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message); + (void)fclose(pFile); + } } #endif -#if HAVE_STDIO_H && \ +#if defined(HAVE_STDIO_H) && \ !(defined(__APPLE__) && (defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT))) fprintf(stderr, "%s: %s\n", SDL_priority_prefixes[priority], message); -#if __NACL__ +#ifdef __NACL__ fflush(stderr); #endif #endif } -void -SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) +void SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) { if (callback) { *callback = SDL_log_function; @@ -513,8 +602,7 @@ SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata) } } -void -SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata) +void SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata) { SDL_log_function = callback; SDL_log_userdata = userdata; diff --git a/src/SDL_log_c.h b/src/SDL_log_c.h index 4716b7adaf835..7fdd5142ddd22 100644 --- a/src/SDL_log_c.h +++ b/src/SDL_log_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/SDL_utils.c b/src/SDL_utils.c index 99ed1ac861590..f4ebcf9dba877 100644 --- a/src/SDL_utils.c +++ b/src/SDL_utils.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/SDL_utils_c.h b/src/SDL_utils_c.h index 01efddeb48895..eb870c7921457 100644 --- a/src/SDL_utils_c.h +++ b/src/SDL_utils_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ /* Common utility functions that aren't in the public API */ /* Return the smallest power of 2 greater than or equal to 'x' */ -int SDL_powerof2(int x); +extern int SDL_powerof2(int x); #endif /* SDL_utils_h_ */ diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index a89134e1aefe7..ea65796e7fc5d 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,19 +37,20 @@ /* The __atomic_load_n() intrinsic showed up in different times for different compilers. */ #if defined(__clang__) -# if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS) - /* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have. - It might be in a later NDK or we might need an extra library? --ryan. */ -# if !defined(__ANDROID__) -# define HAVE_ATOMIC_LOAD_N 1 -# endif -# endif +#if __has_builtin(__atomic_load_n) || defined(HAVE_GCC_ATOMICS) +/* !!! FIXME: this advertises as available in the NDK but uses an external symbol we don't have. + It might be in a later NDK or we might need an extra library? --ryan. */ +#if !defined(__ANDROID__) +#define HAVE_ATOMIC_LOAD_N 1 +#endif +#endif #elif defined(__GNUC__) -# if (__GNUC__ >= 5) -# define HAVE_ATOMIC_LOAD_N 1 -# endif +#if (__GNUC__ >= 5) +#define HAVE_ATOMIC_LOAD_N 1 +#endif #endif +/* *INDENT-OFF* */ /* clang-format off */ #if defined(__WATCOMC__) && defined(__386__) SDL_COMPILE_TIME_ASSERT(intsize, 4==sizeof(int)); #define HAVE_WATCOM_ATOMICS @@ -74,7 +75,9 @@ extern __inline int _SDL_xadd_watcom(volatile int *a, int v); parm [ecx] [eax] \ value [eax] \ modify exact [eax]; + #endif /* __WATCOMC__ && __386__ */ +/* *INDENT-ON* */ /* clang-format on */ /* If any of the operations are not provided then we must emulate some @@ -100,22 +103,20 @@ extern __inline int _SDL_xadd_watcom(volatile int *a, int v); */ #if !defined(HAVE_MSC_ATOMICS) && !defined(HAVE_GCC_ATOMICS) && !defined(__MACOSX__) && !defined(__SOLARIS__) && !defined(HAVE_WATCOM_ATOMICS) -#define EMULATE_CAS 1 +#define EMULATE_CAS #endif -#if EMULATE_CAS +#ifdef EMULATE_CAS static SDL_SpinLock locks[32]; -static SDL_INLINE void -enterLock(void *a) +static SDL_INLINE void enterLock(void *a) { uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f); SDL_AtomicLock(&locks[index]); } -static SDL_INLINE void -leaveLock(void *a) +static SDL_INLINE void leaveLock(void *a) { uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f); @@ -123,22 +124,20 @@ leaveLock(void *a) } #endif - -SDL_bool -SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) +SDL_bool SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value)); - return (_InterlockedCompareExchange((long*)&a->value, (long)newval, (long)oldval) == (long)oldval); + return _InterlockedCompareExchange((long *)&a->value, (long)newval, (long)oldval) == (long)oldval; #elif defined(HAVE_WATCOM_ATOMICS) - return (SDL_bool) _SDL_cmpxchg_watcom(&a->value, newval, oldval); + return (SDL_bool)_SDL_cmpxchg_watcom(&a->value, newval, oldval); #elif defined(HAVE_GCC_ATOMICS) return (SDL_bool) __sync_bool_compare_and_swap(&a->value, oldval, newval); #elif defined(__MACOSX__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */ return (SDL_bool) OSAtomicCompareAndSwap32Barrier(oldval, newval, &a->value); #elif defined(__SOLARIS__) - return (SDL_bool) ((int) atomic_cas_uint((volatile uint_t*)&a->value, (uint_t)oldval, (uint_t)newval) == oldval); -#elif EMULATE_CAS + return (SDL_bool)((int)atomic_cas_uint((volatile uint_t *)&a->value, (uint_t)oldval, (uint_t)newval) == oldval); +#elif defined(EMULATE_CAS) SDL_bool retval = SDL_FALSE; enterLock(a); @@ -150,17 +149,16 @@ SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval) return retval; #else - #error Please define your platform. +#error Please define your platform. #endif } -SDL_bool -SDL_AtomicCASPtr(void **a, void *oldval, void *newval) +SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval) { #if defined(HAVE_MSC_ATOMICS) - return (_InterlockedCompareExchangePointer(a, newval, oldval) == oldval); + return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval; #elif defined(HAVE_WATCOM_ATOMICS) - return (SDL_bool) _SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval); + return (SDL_bool)_SDL_cmpxchg_watcom((int *)a, (long)newval, (long)oldval); #elif defined(HAVE_GCC_ATOMICS) return __sync_bool_compare_and_swap(a, oldval, newval); #elif defined(__MACOSX__) && defined(__LP64__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */ @@ -168,8 +166,8 @@ SDL_AtomicCASPtr(void **a, void *oldval, void *newval) #elif defined(__MACOSX__) && !defined(__LP64__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */ return (SDL_bool) OSAtomicCompareAndSwap32Barrier((int32_t)oldval, (int32_t)newval, (int32_t*) a); #elif defined(__SOLARIS__) - return (SDL_bool) (atomic_cas_ptr(a, oldval, newval) == oldval); -#elif EMULATE_CAS + return (SDL_bool)(atomic_cas_ptr(a, oldval, newval) == oldval); +#elif defined(EMULATE_CAS) SDL_bool retval = SDL_FALSE; enterLock(a); @@ -181,22 +179,21 @@ SDL_AtomicCASPtr(void **a, void *oldval, void *newval) return retval; #else - #error Please define your platform. +#error Please define your platform. #endif } -int -SDL_AtomicSet(SDL_atomic_t *a, int v) +int SDL_AtomicSet(SDL_atomic_t *a, int v) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_set, sizeof(long) == sizeof(a->value)); - return _InterlockedExchange((long*)&a->value, v); + return _InterlockedExchange((long *)&a->value, v); #elif defined(HAVE_WATCOM_ATOMICS) return _SDL_xchg_watcom(&a->value, v); #elif defined(HAVE_GCC_ATOMICS) return __sync_lock_test_and_set(&a->value, v); #elif defined(__SOLARIS__) - return (int) atomic_swap_uint((volatile uint_t*)&a->value, v); + return (int)atomic_swap_uint((volatile uint_t *)&a->value, v); #else int value; do { @@ -206,13 +203,12 @@ SDL_AtomicSet(SDL_atomic_t *a, int v) #endif } -void* -SDL_AtomicSetPtr(void **a, void *v) +void *SDL_AtomicSetPtr(void **a, void *v) { #if defined(HAVE_MSC_ATOMICS) return _InterlockedExchangePointer(a, v); #elif defined(HAVE_WATCOM_ATOMICS) - return (void *) _SDL_xchg_watcom((int *)a, (long)v); + return (void *)_SDL_xchg_watcom((int *)a, (long)v); #elif defined(HAVE_GCC_ATOMICS) return __sync_lock_test_and_set(a, v); #elif defined(__SOLARIS__) @@ -226,20 +222,19 @@ SDL_AtomicSetPtr(void **a, void *v) #endif } -int -SDL_AtomicAdd(SDL_atomic_t *a, int v) +int SDL_AtomicAdd(SDL_atomic_t *a, int v) { #ifdef HAVE_MSC_ATOMICS SDL_COMPILE_TIME_ASSERT(atomic_add, sizeof(long) == sizeof(a->value)); - return _InterlockedExchangeAdd((long*)&a->value, v); + return _InterlockedExchangeAdd((long *)&a->value, v); #elif defined(HAVE_WATCOM_ATOMICS) return _SDL_xadd_watcom(&a->value, v); #elif defined(HAVE_GCC_ATOMICS) return __sync_fetch_and_add(&a->value, v); #elif defined(__SOLARIS__) - int pv = a->value; - membar_consumer(); - atomic_add_int((volatile uint_t*)&a->value, v); + int pv = a->value; + membar_consumer(); + atomic_add_int((volatile uint_t *)&a->value, v); return pv; #else int value; @@ -250,8 +245,7 @@ SDL_AtomicAdd(SDL_atomic_t *a, int v) #endif } -int -SDL_AtomicGet(SDL_atomic_t *a) +int SDL_AtomicGet(SDL_atomic_t *a) { #ifdef HAVE_ATOMIC_LOAD_N return __atomic_load_n(&a->value, __ATOMIC_SEQ_CST); @@ -265,7 +259,7 @@ SDL_AtomicGet(SDL_atomic_t *a) #elif defined(__MACOSX__) /* this is deprecated in 10.12 sdk; favor gcc atomics. */ return sizeof(a->value) == sizeof(uint32_t) ? OSAtomicOr32Barrier(0, (volatile uint32_t *)&a->value) : OSAtomicAdd64Barrier(0, (volatile int64_t *)&a->value); #elif defined(__SOLARIS__) - return atomic_or_uint((volatile uint_t *)&a->value, 0); + return atomic_or_uint_nv((volatile uint_t *)&a->value, 0); #else int value; do { @@ -275,8 +269,7 @@ SDL_AtomicGet(SDL_atomic_t *a) #endif } -void * -SDL_AtomicGetPtr(void **a) +void *SDL_AtomicGetPtr(void **a) { #ifdef HAVE_ATOMIC_LOAD_N return __atomic_load_n(a, __ATOMIC_SEQ_CST); @@ -299,14 +292,12 @@ SDL_AtomicGetPtr(void **a) #error This file should be built in arm mode so the mcr instruction is available for memory barriers #endif -void -SDL_MemoryBarrierReleaseFunction(void) +void SDL_MemoryBarrierReleaseFunction(void) { SDL_MemoryBarrierRelease(); } -void -SDL_MemoryBarrierAcquireFunction(void) +void SDL_MemoryBarrierAcquireFunction(void) { SDL_MemoryBarrierAcquire(); } diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index 965c021e19a98..bdfa082d0d596 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,6 +48,7 @@ #include #endif +/* *INDENT-OFF* */ /* clang-format off */ #if defined(__WATCOMC__) && defined(__386__) SDL_COMPILE_TIME_ASSERT(locksize, 4==sizeof(SDL_SpinLock)); extern __inline int _SDL_xchg_watcom(volatile int *a, int v); @@ -57,12 +58,12 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v); value [eax] \ modify exact [eax]; #endif /* __WATCOMC__ && __386__ */ +/* *INDENT-ON* */ /* clang-format on */ /* This function is where all the magic happens... */ -SDL_bool -SDL_AtomicTryLock(SDL_SpinLock *lock) +SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock) { -#if SDL_ATOMIC_DISABLED +#ifdef SDL_ATOMIC_DISABLED /* Terrible terrible damage */ static SDL_mutex *_spinlock_mutex; @@ -80,53 +81,61 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) return SDL_FALSE; } -#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET - return (__sync_lock_test_and_set(lock, 1) == 0); +#elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) + return __sync_lock_test_and_set(lock, 1) == 0; #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) - return (_InterlockedExchange_acq(lock, 1) == 0); + return _InterlockedExchange_acq(lock, 1) == 0; #elif defined(_MSC_VER) SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long)); - return (InterlockedExchange((long*)lock, 1) == 0); + return InterlockedExchange((long *)lock, 1) == 0; #elif defined(__WATCOMC__) && defined(__386__) return _SDL_xchg_watcom(lock, 1) == 0; -#elif defined(__GNUC__) && defined(__arm__) && \ - (defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) || \ - defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \ - defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \ - defined(__ARM_ARCH_5TEJ__)) +#elif defined(__GNUC__) && defined(__arm__) && \ + (defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) || \ + defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \ + defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5TE__) || \ + defined(__ARM_ARCH_5TEJ__)) int result; #if defined(__RISCOS__) if (__cpucap_have_rex()) { - __asm__ __volatile__ ( + __asm__ __volatile__( "ldrex %0, [%2]\nteq %0, #0\nstrexeq %0, %1, [%2]" - : "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory"); - return (result == 0); + : "=&r"(result) + : "r"(1), "r"(lock) + : "cc", "memory"); + return result == 0; } #endif - __asm__ __volatile__ ( + __asm__ __volatile__( "swp %0, %1, [%2]\n" - : "=&r,&r" (result) : "r,0" (1), "r,r" (lock) : "memory"); - return (result == 0); + : "=&r,&r"(result) + : "r,0"(1), "r,r"(lock) + : "memory"); + return result == 0; #elif defined(__GNUC__) && defined(__arm__) int result; - __asm__ __volatile__ ( + __asm__ __volatile__( "ldrex %0, [%2]\nteq %0, #0\nstrexeq %0, %1, [%2]" - : "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory"); - return (result == 0); + : "=&r"(result) + : "r"(1), "r"(lock) + : "cc", "memory"); + return result == 0; #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) int result; __asm__ __volatile__( "lock ; xchgl %0, (%1)\n" - : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory"); - return (result == 0); + : "=r"(result) + : "r"(lock), "0"(1) + : "cc", "memory"); + return result == 0; #elif defined(__MACOSX__) || defined(__IPHONEOS__) /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */ @@ -134,11 +143,11 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) #elif defined(__SOLARIS__) && defined(_LP64) /* Used for Solaris with non-gcc compilers. */ - return (SDL_bool) ((int) atomic_cas_64((volatile uint64_t*)lock, 0, 1) == 0); + return (SDL_bool)((int)atomic_cas_64((volatile uint64_t *)lock, 0, 1) == 0); #elif defined(__SOLARIS__) && !defined(_LP64) /* Used for Solaris with non-gcc compilers. */ - return (SDL_bool) ((int) atomic_cas_32((volatile uint32_t*)lock, 0, 1) == 0); + return (SDL_bool)((int)atomic_cas_32((volatile uint32_t *)lock, 0, 1) == 0); #elif defined(PS2) uint32_t oldintr; SDL_bool res = SDL_FALSE; @@ -150,7 +159,9 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) res = SDL_TRUE; } // enable interuption - if(oldintr) { EIntr(); } + if (oldintr) { + EIntr(); + } return res; #else #error Please implement for your platform. @@ -158,8 +169,7 @@ SDL_AtomicTryLock(SDL_SpinLock *lock) #endif } -void -SDL_AtomicLock(SDL_SpinLock *lock) +void SDL_AtomicLock(SDL_SpinLock *lock) { int iterations = 0; /* FIXME: Should we have an eventual timeout? */ @@ -174,10 +184,9 @@ SDL_AtomicLock(SDL_SpinLock *lock) } } -void -SDL_AtomicUnlock(SDL_SpinLock *lock) +void SDL_AtomicUnlock(SDL_SpinLock *lock) { -#if HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET +#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) __sync_lock_release(lock); #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) @@ -188,7 +197,7 @@ SDL_AtomicUnlock(SDL_SpinLock *lock) *lock = 0; #elif defined(__WATCOMC__) && defined(__386__) - SDL_CompilerBarrier (); + SDL_CompilerBarrier(); *lock = 0; #elif defined(__SOLARIS__) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 08888782242f6..75e89797d4b33 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,123 +31,127 @@ #define _THIS SDL_AudioDevice *_this +typedef struct AudioThreadStartupData +{ + SDL_AudioDevice *device; + SDL_sem *startup_semaphore; +} AudioThreadStartupData; + static SDL_AudioDriver current_audio; static SDL_AudioDevice *open_devices[16]; /* Available audio drivers */ static const AudioBootStrap *const bootstrap[] = { -#if SDL_AUDIO_DRIVER_PULSEAUDIO +#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO &PULSEAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_ALSA +#ifdef SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SNDIO +#ifdef SDL_AUDIO_DRIVER_SNDIO &SNDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NETBSD +#ifdef SDL_AUDIO_DRIVER_NETBSD &NETBSDAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_QSA +#ifdef SDL_AUDIO_DRIVER_QSA &QSAAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_SUNAUDIO +#ifdef SDL_AUDIO_DRIVER_SUNAUDIO &SUNAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_ARTS +#ifdef SDL_AUDIO_DRIVER_ARTS &ARTS_bootstrap, #endif -#if SDL_AUDIO_DRIVER_ESD +#ifdef SDL_AUDIO_DRIVER_ESD &ESD_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NACL +#ifdef SDL_AUDIO_DRIVER_NACL &NACLAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_NAS +#ifdef SDL_AUDIO_DRIVER_NAS &NAS_bootstrap, #endif -#if SDL_AUDIO_DRIVER_WASAPI +#ifdef SDL_AUDIO_DRIVER_WASAPI &WASAPI_bootstrap, #endif -#if SDL_AUDIO_DRIVER_DSOUND +#ifdef SDL_AUDIO_DRIVER_DSOUND &DSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_WINMM +#ifdef SDL_AUDIO_DRIVER_WINMM &WINMM_bootstrap, #endif -#if SDL_AUDIO_DRIVER_PAUDIO +#ifdef SDL_AUDIO_DRIVER_PAUDIO &PAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_HAIKU +#ifdef SDL_AUDIO_DRIVER_HAIKU &HAIKUAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_COREAUDIO +#ifdef SDL_AUDIO_DRIVER_COREAUDIO &COREAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_FUSIONSOUND +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND &FUSIONSOUND_bootstrap, #endif -#if SDL_AUDIO_DRIVER_AAUDIO - &aaudio_bootstrap, -#endif -#if SDL_AUDIO_DRIVER_OPENSLES +#ifdef SDL_AUDIO_DRIVER_OPENSLES &openslES_bootstrap, #endif -#if SDL_AUDIO_DRIVER_ANDROID +#ifdef SDL_AUDIO_DRIVER_AAUDIO + &aaudio_bootstrap, +#endif +#ifdef SDL_AUDIO_DRIVER_ANDROID &ANDROIDAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_PS2 +#ifdef SDL_AUDIO_DRIVER_PS2 &PS2AUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_PSP +#ifdef SDL_AUDIO_DRIVER_PSP &PSPAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_VITA +#ifdef SDL_AUDIO_DRIVER_VITA &VITAAUD_bootstrap, #endif -#if SDL_AUDIO_DRIVER_N3DS +#ifdef SDL_AUDIO_DRIVER_N3DS &N3DSAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_EMSCRIPTEN +#ifdef SDL_AUDIO_DRIVER_EMSCRIPTEN &EMSCRIPTENAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_JACK +#ifdef SDL_AUDIO_DRIVER_JACK &JACK_bootstrap, #endif -#if SDL_AUDIO_DRIVER_PIPEWIRE +#ifdef SDL_AUDIO_DRIVER_PIPEWIRE &PIPEWIRE_bootstrap, #endif -#if SDL_AUDIO_DRIVER_OSS +#ifdef SDL_AUDIO_DRIVER_OSS &DSP_bootstrap, #endif -#if SDL_AUDIO_DRIVER_OS2 +#ifdef SDL_AUDIO_DRIVER_OS2 &OS2AUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_DISK +#ifdef SDL_AUDIO_DRIVER_DISK &DISKAUDIO_bootstrap, #endif -#if SDL_AUDIO_DRIVER_DUMMY +#ifdef SDL_AUDIO_DRIVER_DUMMY &DUMMYAUDIO_bootstrap, #endif NULL }; - #ifdef HAVE_LIBSAMPLERATE_H #ifdef SDL_LIBSAMPLERATE_DYNAMIC static void *SRC_lib = NULL; #endif SDL_bool SRC_available = SDL_FALSE; int SRC_converter = 0; -SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error) = NULL; +SRC_STATE *(*SRC_src_new)(int converter_type, int channels, int *error) = NULL; int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data) = NULL; int (*SRC_src_reset)(SRC_STATE *state) = NULL; -SRC_STATE* (*SRC_src_delete)(SRC_STATE *state) = NULL; -const char* (*SRC_src_strerror)(int error) = NULL; +SRC_STATE *(*SRC_src_delete)(SRC_STATE *state) = NULL; +const char *(*SRC_src_strerror)(int error) = NULL; int (*SRC_src_simple)(SRC_DATA *data, int converter_type, int channels) = NULL; -static SDL_bool -LoadLibSampleRate(void) +static SDL_bool LoadLibSampleRate(void) { const char *hint = SDL_GetHint(SDL_HINT_AUDIO_RESAMPLING_MODE); @@ -155,15 +159,17 @@ LoadLibSampleRate(void) SRC_converter = 0; if (!hint || *hint == '0' || SDL_strcasecmp(hint, "default") == 0) { - return SDL_FALSE; /* don't load anything. */ + return SDL_FALSE; /* don't load anything. */ } else if (*hint == '1' || SDL_strcasecmp(hint, "fast") == 0) { SRC_converter = SRC_SINC_FASTEST; } else if (*hint == '2' || SDL_strcasecmp(hint, "medium") == 0) { SRC_converter = SRC_SINC_MEDIUM_QUALITY; } else if (*hint == '3' || SDL_strcasecmp(hint, "best") == 0) { SRC_converter = SRC_SINC_BEST_QUALITY; + } else if (*hint == '4' || SDL_strcasecmp(hint, "linear") == 0) { + SRC_converter = SRC_LINEAR; } else { - return SDL_FALSE; /* treat it like "default", don't load anything. */ + return SDL_FALSE; /* treat it like "default", don't load anything. */ } #ifdef SDL_LIBSAMPLERATE_DYNAMIC @@ -174,12 +180,14 @@ LoadLibSampleRate(void) return SDL_FALSE; } + /* *INDENT-OFF* */ /* clang-format off */ SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new"); SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process"); SRC_src_reset = (int(*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_reset"); SRC_src_delete = (SRC_STATE* (*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_delete"); SRC_src_strerror = (const char* (*)(int error))SDL_LoadFunction(SRC_lib, "src_strerror"); SRC_src_simple = (int(*)(SRC_DATA *data, int converter_type, int channels))SDL_LoadFunction(SRC_lib, "src_simple"); +/* *INDENT-ON* */ /* clang-format on */ if (!SRC_src_new || !SRC_src_process || !SRC_src_reset || !SRC_src_delete || !SRC_src_strerror || !SRC_src_simple) { SDL_UnloadObject(SRC_lib); @@ -199,8 +207,7 @@ LoadLibSampleRate(void) return SDL_TRUE; } -static void -UnloadLibSampleRate(void) +static void UnloadLibSampleRate(void) { #ifdef SDL_LIBSAMPLERATE_DYNAMIC if (SRC_lib != NULL) { @@ -218,8 +225,7 @@ UnloadLibSampleRate(void) } #endif -static SDL_AudioDevice * -get_audio_device(SDL_AudioDeviceID id) +static SDL_AudioDevice *get_audio_device(SDL_AudioDeviceID id) { id--; if ((id >= SDL_arraysize(open_devices)) || (open_devices[id] == NULL)) { @@ -230,82 +236,67 @@ get_audio_device(SDL_AudioDeviceID id) return open_devices[id]; } - /* stubs for audio drivers that don't need a specific entry point... */ -static void -SDL_AudioDetectDevices_Default(void) +static void SDL_AudioDetectDevices_Default(void) { /* you have to write your own implementation if these assertions fail. */ SDL_assert(current_audio.impl.OnlyHasDefaultOutputDevice); SDL_assert(current_audio.impl.OnlyHasDefaultCaptureDevice || !current_audio.impl.HasCaptureSupport); - SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *) ((size_t) 0x1)); + SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *)((size_t)0x1)); if (current_audio.impl.HasCaptureSupport) { - SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) ((size_t) 0x2)); + SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *)((size_t)0x2)); } } -static void -SDL_AudioThreadInit_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioThreadInit_Default(_THIS) +{ /* no-op. */ } -static void -SDL_AudioThreadDeinit_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioThreadDeinit_Default(_THIS) +{ /* no-op. */ } -static void -SDL_AudioWaitDevice_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioWaitDevice_Default(_THIS) +{ /* no-op. */ } -static void -SDL_AudioPlayDevice_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioPlayDevice_Default(_THIS) +{ /* no-op. */ } -static Uint8 * -SDL_AudioGetDeviceBuf_Default(_THIS) +static Uint8 *SDL_AudioGetDeviceBuf_Default(_THIS) { return NULL; } -static int -SDL_AudioCaptureFromDevice_Default(_THIS, void *buffer, int buflen) +static int SDL_AudioCaptureFromDevice_Default(_THIS, void *buffer, int buflen) { - return -1; /* just fail immediately. */ + return -1; /* just fail immediately. */ } -static void -SDL_AudioFlushCapture_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioFlushCapture_Default(_THIS) +{ /* no-op. */ } -static void -SDL_AudioCloseDevice_Default(_THIS) -{ /* no-op. */ +static void SDL_AudioCloseDevice_Default(_THIS) +{ /* no-op. */ } -static void -SDL_AudioDeinitialize_Default(void) -{ /* no-op. */ +static void SDL_AudioDeinitialize_Default(void) +{ /* no-op. */ } -static void -SDL_AudioFreeDeviceHandle_Default(void *handle) -{ /* no-op. */ +static void SDL_AudioFreeDeviceHandle_Default(void *handle) +{ /* no-op. */ } - -static int -SDL_AudioOpenDevice_Default(_THIS, const char *devname) +static int SDL_AudioOpenDevice_Default(_THIS, const char *devname) { return SDL_Unsupported(); } -static SDL_INLINE SDL_bool -is_in_audio_device_thread(SDL_AudioDevice * device) +static SDL_INLINE SDL_bool is_in_audio_device_thread(SDL_AudioDevice *device) { /* The device thread locks the same mutex, but not through the public API. This check is in case the application, in the audio callback, @@ -318,35 +309,31 @@ is_in_audio_device_thread(SDL_AudioDevice * device) return SDL_FALSE; } -static void -SDL_AudioLockDevice_Default(SDL_AudioDevice * device) +static void SDL_AudioLockDevice_Default(SDL_AudioDevice *device) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang assumes recursive locks */ { if (!is_in_audio_device_thread(device)) { SDL_LockMutex(device->mixer_lock); } } -static void -SDL_AudioUnlockDevice_Default(SDL_AudioDevice * device) +static void SDL_AudioUnlockDevice_Default(SDL_AudioDevice *device) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang assumes recursive locks */ { if (!is_in_audio_device_thread(device)) { SDL_UnlockMutex(device->mixer_lock); } } -static void -finish_audio_entry_points_init(void) +static void finish_audio_entry_points_init(void) { /* * Fill in stub functions for unused driver entry points. This lets us * blindly call them without having to check for validity first. */ - -#define FILL_STUB(x) \ - if (current_audio.impl.x == NULL) { \ - current_audio.impl.x = SDL_Audio##x##_Default; \ - } +#define FILL_STUB(x) \ + if (current_audio.impl.x == NULL) { \ + current_audio.impl.x = SDL_Audio##x##_Default; \ + } FILL_STUB(DetectDevices); FILL_STUB(OpenDevice); FILL_STUB(ThreadInit); @@ -364,21 +351,19 @@ finish_audio_entry_points_init(void) #undef FILL_STUB } - /* device hotplug support... */ -static int -add_audio_device(const char *name, SDL_AudioSpec *spec, void *handle, SDL_AudioDeviceItem **devices, int *devCount) +static int add_audio_device(const char *name, SDL_AudioSpec *spec, void *handle, SDL_AudioDeviceItem **devices, int *devCount) { int retval = -1; SDL_AudioDeviceItem *item; const SDL_AudioDeviceItem *i; int dupenum = 0; - SDL_assert(handle != NULL); /* we reserve NULL, audio backends can't use it. */ + SDL_assert(handle != NULL); /* we reserve NULL, audio backends can't use it. */ SDL_assert(name != NULL); - item = (SDL_AudioDeviceItem *) SDL_malloc(sizeof (SDL_AudioDeviceItem)); + item = (SDL_AudioDeviceItem *)SDL_malloc(sizeof(SDL_AudioDeviceItem)); if (!item) { return SDL_OutOfMemory(); } @@ -403,13 +388,13 @@ add_audio_device(const char *name, SDL_AudioSpec *spec, void *handle, SDL_AudioD for (i = *devices; i != NULL; i = i->next) { if (SDL_strcmp(name, i->original_name) == 0) { dupenum = i->dupenum + 1; - break; /* stop at the highest-numbered dupe. */ + break; /* stop at the highest-numbered dupe. */ } } if (dupenum) { const size_t len = SDL_strlen(name) + 16; - char *replacement = (char *) SDL_malloc(len); + char *replacement = (char *)SDL_malloc(len); if (!replacement) { SDL_UnlockMutex(current_audio.detectionLock); SDL_free(item->original_name); @@ -417,35 +402,32 @@ add_audio_device(const char *name, SDL_AudioSpec *spec, void *handle, SDL_AudioD return SDL_OutOfMemory(); } - SDL_snprintf(replacement, len, "%s (%d)", name, dupenum + 1); + (void)SDL_snprintf(replacement, len, "%s (%d)", name, dupenum + 1); item->dupenum = dupenum; item->name = replacement; } item->next = *devices; *devices = item; - retval = (*devCount)++; /* !!! FIXME: this should be an atomic increment */ + retval = (*devCount)++; /* !!! FIXME: this should be an atomic increment */ SDL_UnlockMutex(current_audio.detectionLock); return retval; } -static SDL_INLINE int -add_capture_device(const char *name, SDL_AudioSpec *spec, void *handle) +static SDL_INLINE int add_capture_device(const char *name, SDL_AudioSpec *spec, void *handle) { SDL_assert(current_audio.impl.HasCaptureSupport); return add_audio_device(name, spec, handle, ¤t_audio.inputDevices, ¤t_audio.inputDeviceCount); } -static SDL_INLINE int -add_output_device(const char *name, SDL_AudioSpec *spec, void *handle) +static SDL_INLINE int add_output_device(const char *name, SDL_AudioSpec *spec, void *handle) { return add_audio_device(name, spec, handle, ¤t_audio.outputDevices, ¤t_audio.outputDeviceCount); } -static void -free_device_list(SDL_AudioDeviceItem **devices, int *devCount) +static void free_device_list(SDL_AudioDeviceItem **devices, int *devCount) { SDL_AudioDeviceItem *item, *next; for (item = *devices; item != NULL; item = next) { @@ -464,10 +446,8 @@ free_device_list(SDL_AudioDeviceItem **devices, int *devCount) *devCount = 0; } - /* The audio backends call this when a new device is plugged in. */ -void -SDL_AddAudioDevice(const SDL_bool iscapture, const char *name, SDL_AudioSpec *spec, void *handle) +void SDL_AddAudioDevice(const SDL_bool iscapture, const char *name, SDL_AudioSpec *spec, void *handle) { const int device_index = iscapture ? add_capture_device(name, spec, handle) : add_output_device(name, spec, handle); if (device_index != -1) { @@ -489,11 +469,11 @@ void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device) SDL_assert(get_audio_device(device->id) == device); if (!SDL_AtomicGet(&device->enabled)) { - return; /* don't report disconnects more than once. */ + return; /* don't report disconnects more than once. */ } if (SDL_AtomicGet(&device->shutdown)) { - return; /* don't report disconnect if we're trying to close device. */ + return; /* don't report disconnect if we're trying to close device. */ } /* Ends the audio callback and mark the device as STOPPED, but the @@ -513,8 +493,7 @@ void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device) } } -static void -mark_device_removed(void *handle, SDL_AudioDeviceItem *devices, SDL_bool *removedFlag) +static void mark_device_removed(void *handle, SDL_AudioDeviceItem *devices, SDL_bool *removedFlag) { SDL_AudioDeviceItem *item; SDL_assert(handle != NULL); @@ -528,8 +507,7 @@ mark_device_removed(void *handle, SDL_AudioDeviceItem *devices, SDL_bool *remove } /* The audio backends call this when a device is removed from the system. */ -void -SDL_RemoveAudioDevice(const SDL_bool iscapture, void *handle) +void SDL_RemoveAudioDevice(const SDL_bool iscapture, void *handle) { int device_index; SDL_AudioDevice *device = NULL; @@ -541,11 +519,9 @@ SDL_RemoveAudioDevice(const SDL_bool iscapture, void *handle) } else { mark_device_removed(handle, current_audio.outputDevices, ¤t_audio.outputDevicesRemoved); } - for (device_index = 0; device_index < SDL_arraysize(open_devices); device_index++) - { + for (device_index = 0; device_index < SDL_arraysize(open_devices); device_index++) { device = open_devices[device_index]; - if (device != NULL && device->handle == handle) - { + if (device != NULL && device->handle == handle) { device_was_opened = SDL_TRUE; SDL_OpenedAudioDeviceDisconnected(device); break; @@ -574,40 +550,36 @@ SDL_RemoveAudioDevice(const SDL_bool iscapture, void *handle) current_audio.impl.FreeDeviceHandle(handle); } - - /* buffer queueing support... */ -static void SDLCALL -SDL_BufferQueueDrainCallback(void *userdata, Uint8 *stream, int len) +static void SDLCALL SDL_BufferQueueDrainCallback(void *userdata, Uint8 *stream, int len) { /* this function always holds the mixer lock before being called. */ - SDL_AudioDevice *device = (SDL_AudioDevice *) userdata; + SDL_AudioDevice *device = (SDL_AudioDevice *)userdata; size_t dequeued; - SDL_assert(device != NULL); /* this shouldn't ever happen, right?! */ - SDL_assert(!device->iscapture); /* this shouldn't ever happen, right?! */ - SDL_assert(len >= 0); /* this shouldn't ever happen, right?! */ + SDL_assert(device != NULL); /* this shouldn't ever happen, right?! */ + SDL_assert(!device->iscapture); /* this shouldn't ever happen, right?! */ + SDL_assert(len >= 0); /* this shouldn't ever happen, right?! */ dequeued = SDL_ReadFromDataQueue(device->buffer_queue, stream, len); stream += dequeued; - len -= (int) dequeued; + len -= (int)dequeued; - if (len > 0) { /* fill any remaining space in the stream with silence. */ + if (len > 0) { /* fill any remaining space in the stream with silence. */ SDL_assert(SDL_CountDataQueue(device->buffer_queue) == 0); SDL_memset(stream, device->callbackspec.silence, len); } } -static void SDLCALL -SDL_BufferQueueFillCallback(void *userdata, Uint8 *stream, int len) +static void SDLCALL SDL_BufferQueueFillCallback(void *userdata, Uint8 *stream, int len) { /* this function always holds the mixer lock before being called. */ - SDL_AudioDevice *device = (SDL_AudioDevice *) userdata; + SDL_AudioDevice *device = (SDL_AudioDevice *)userdata; - SDL_assert(device != NULL); /* this shouldn't ever happen, right?! */ - SDL_assert(device->iscapture); /* this shouldn't ever happen, right?! */ - SDL_assert(len >= 0); /* this shouldn't ever happen, right?! */ + SDL_assert(device != NULL); /* this shouldn't ever happen, right?! */ + SDL_assert(device->iscapture); /* this shouldn't ever happen, right?! */ + SDL_assert(len >= 0); /* this shouldn't ever happen, right?! */ /* note that if this needs to allocate more space and run out of memory, we have no choice but to quietly drop the data and hope it works out @@ -615,14 +587,13 @@ SDL_BufferQueueFillCallback(void *userdata, Uint8 *stream, int len) SDL_WriteToDataQueue(device->buffer_queue, stream, len); } -int -SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len) +int SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len) { SDL_AudioDevice *device = get_audio_device(devid); int rc = 0; if (!device) { - return -1; /* get_audio_device() will have set the error state */ + return -1; /* get_audio_device() will have set the error state */ } else if (device->iscapture) { return SDL_SetError("This is a capture device, queueing not allowed"); } else if (device->callbackspec.callback != SDL_BufferQueueDrainCallback) { @@ -638,27 +609,25 @@ SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len) return rc; } -Uint32 -SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len) +Uint32 SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len) { SDL_AudioDevice *device = get_audio_device(devid); Uint32 rc; - if ( (len == 0) || /* nothing to do? */ - (!device) || /* called with bogus device id */ - (!device->iscapture) || /* playback devices can't dequeue */ - (device->callbackspec.callback != SDL_BufferQueueFillCallback) ) { /* not set for queueing */ - return 0; /* just report zero bytes dequeued. */ + if ((len == 0) || /* nothing to do? */ + (!device) || /* called with bogus device id */ + (!device->iscapture) || /* playback devices can't dequeue */ + (device->callbackspec.callback != SDL_BufferQueueFillCallback)) { /* not set for queueing */ + return 0; /* just report zero bytes dequeued. */ } current_audio.impl.LockDevice(device); - rc = (Uint32) SDL_ReadFromDataQueue(device->buffer_queue, data, len); + rc = (Uint32)SDL_ReadFromDataQueue(device->buffer_queue, data, len); current_audio.impl.UnlockDevice(device); return rc; } -Uint32 -SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid) +Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid) { Uint32 retval = 0; SDL_AudioDevice *device = get_audio_device(devid); @@ -669,23 +638,21 @@ SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid) /* Nothing to do unless we're set up for queueing. */ if (device->callbackspec.callback == SDL_BufferQueueDrainCallback || - device->callbackspec.callback == SDL_BufferQueueFillCallback) - { + device->callbackspec.callback == SDL_BufferQueueFillCallback) { current_audio.impl.LockDevice(device); - retval = (Uint32) SDL_CountDataQueue(device->buffer_queue); + retval = (Uint32)SDL_CountDataQueue(device->buffer_queue); current_audio.impl.UnlockDevice(device); } return retval; } -void -SDL_ClearQueuedAudio(SDL_AudioDeviceID devid) +void SDL_ClearQueuedAudio(SDL_AudioDeviceID devid) { SDL_AudioDevice *device = get_audio_device(devid); if (!device) { - return; /* nothing to do. */ + return; /* nothing to do. */ } /* Blank out the device and release the mutex. Free it afterwards. */ @@ -697,23 +664,27 @@ SDL_ClearQueuedAudio(SDL_AudioDeviceID devid) current_audio.impl.UnlockDevice(device); } +#ifdef SDL_AUDIO_DRIVER_ANDROID +extern void Android_JNI_AudioSetThreadPriority(int, int); +#endif /* The general mixing thread function */ -static int SDLCALL -SDL_RunAudio(void *devicep) +static int SDLCALL SDL_RunAudio(void *userdata) { - SDL_AudioDevice *device = (SDL_AudioDevice *) devicep; + const AudioThreadStartupData *startup_data = (const AudioThreadStartupData *) userdata; + SDL_AudioDevice *device = startup_data->device; void *udata = device->callbackspec.userdata; SDL_AudioCallback callback = device->callbackspec.callback; int data_len = 0; Uint8 *data; + Uint8 *device_buf_keepsafe = NULL; + Uint32 delay; SDL_assert(!device->iscapture); -#if SDL_AUDIO_DRIVER_ANDROID +#ifdef SDL_AUDIO_DRIVER_ANDROID { /* Set thread priority to THREAD_PRIORITY_AUDIO */ - extern void Android_JNI_AudioSetThreadPriority(int, int); Android_JNI_AudioSetThreadPriority(device->iscapture, device->id); } #else @@ -723,16 +694,25 @@ SDL_RunAudio(void *devicep) /* Perform any thread setup */ device->threadid = SDL_ThreadID(); + + SDL_SemPost(startup_data->startup_semaphore); /* SDL_OpenAudioDevice may now continue. */ + current_audio.impl.ThreadInit(device); /* Loop, filling the audio buffers */ while (!SDL_AtomicGet(&device->shutdown)) { - data_len = device->callbackspec.size; - /* Fill the current buffer with sound */ if (!device->stream && SDL_AtomicGet(&device->enabled)) { - SDL_assert(data_len == device->spec.size); data = current_audio.impl.GetDeviceBuf(device); + + if (device->stream && SDL_AtomicGet(&device->enabled)) { + /* Oops. Audio device reset and now we suddenly use a stream, */ + /* so save this devicebuf for later, to prevent de-sync */ + if (data != NULL) { + device_buf_keepsafe = data; + } + data = NULL; + } } else { /* if the device isn't enabled, we still write to the work_buffer, so the app's callback will fire with @@ -747,6 +727,8 @@ SDL_RunAudio(void *devicep) data = device->work_buffer; } + data_len = device->callbackspec.size; + /* !!! FIXME: this should be LockDevice. */ SDL_LockMutex(device->mixer_lock); if (SDL_AtomicGet(&device->paused)) { @@ -761,15 +743,27 @@ SDL_RunAudio(void *devicep) /* if this fails...oh well. We'll play silence here. */ SDL_AudioStreamPut(device->stream, data, data_len); - while (SDL_AudioStreamAvailable(device->stream) >= ((int) device->spec.size)) { + while (SDL_AudioStreamAvailable(device->stream) >= ((int)device->spec.size)) { int got; - data = SDL_AtomicGet(&device->enabled) ? current_audio.impl.GetDeviceBuf(device) : NULL; + if (SDL_AtomicGet(&device->enabled)) { + /* if device reset occured - a switch from direct output to streaming */ + /* use the already aquired device buffer */ + if (device_buf_keepsafe) { + data = device_buf_keepsafe; + device_buf_keepsafe = NULL; + } else { + /* else - normal flow, just acquire the device buffer here */ + data = current_audio.impl.GetDeviceBuf(device); + } + } else { + data = NULL; + } got = SDL_AudioStreamGet(device->stream, data ? data : device->work_buffer, device->spec.size); SDL_assert((got <= 0) || (got == device->spec.size)); - if (data == NULL) { /* device is having issues... */ - const Uint32 delay = ((device->spec.samples * 1000) / device->spec.freq); - SDL_Delay(delay); /* wait for as long as this buffer would have played. Maybe device recovers later? */ + if (data == NULL) { /* device is having issues... */ + delay = ((device->spec.samples * 1000) / device->spec.freq); + SDL_Delay(delay); /* wait for as long as this buffer would have played. Maybe device recovers later? */ } else { if (got != device->spec.size) { SDL_memset(data, device->spec.silence, device->spec.size); @@ -778,11 +772,19 @@ SDL_RunAudio(void *devicep) current_audio.impl.WaitDevice(device); } } + + /* it seems resampling was not fast enough, device_buf_keepsafe was not released yet, so play silence here */ + if (device_buf_keepsafe) { + SDL_memset(device_buf_keepsafe, device->spec.silence, device->spec.size); + current_audio.impl.PlayDevice(device); + current_audio.impl.WaitDevice(device); + device_buf_keepsafe = NULL; + } } else if (data == device->work_buffer) { /* nothing to do; pause like we queued a buffer to play. */ - const Uint32 delay = ((device->spec.samples * 1000) / device->spec.freq); + delay = ((device->spec.samples * 1000) / device->spec.freq); SDL_Delay(delay); - } else { /* writing directly to the device. */ + } else { /* writing directly to the device. */ /* queue this buffer and wait for it to finish playing. */ current_audio.impl.PlayDevice(device); current_audio.impl.WaitDevice(device); @@ -790,7 +792,11 @@ SDL_RunAudio(void *devicep) } /* Wait for the audio to drain. */ - SDL_Delay(((device->spec.samples * 1000) / device->spec.freq) * 2); + delay = ((device->spec.samples * 1000) / device->spec.freq) * 2; + if (delay > 100) { + delay = 100; + } + SDL_Delay(delay); current_audio.impl.ThreadDeinit(device); @@ -799,11 +805,11 @@ SDL_RunAudio(void *devicep) /* !!! FIXME: this needs to deal with device spec changes. */ /* The general capture thread function */ -static int SDLCALL -SDL_CaptureAudio(void *devicep) +static int SDLCALL SDL_CaptureAudio(void *userdata) { - SDL_AudioDevice *device = (SDL_AudioDevice *) devicep; - const int silence = (int) device->spec.silence; + const AudioThreadStartupData *startup_data = (const AudioThreadStartupData *) userdata; + SDL_AudioDevice *device = startup_data->device; + const int silence = (int)device->spec.silence; const Uint32 delay = ((device->spec.samples * 1000) / device->spec.freq); const int data_len = device->spec.size; Uint8 *data; @@ -812,10 +818,9 @@ SDL_CaptureAudio(void *devicep) SDL_assert(device->iscapture); -#if SDL_AUDIO_DRIVER_ANDROID +#ifdef SDL_AUDIO_DRIVER_ANDROID { /* Set thread priority to THREAD_PRIORITY_AUDIO */ - extern void Android_JNI_AudioSetThreadPriority(int, int); Android_JNI_AudioSetThreadPriority(device->iscapture, device->id); } #else @@ -825,6 +830,9 @@ SDL_CaptureAudio(void *devicep) /* Perform any thread setup */ device->threadid = SDL_ThreadID(); + + SDL_SemPost(startup_data->startup_semaphore); /* SDL_OpenAudioDevice may now continue. */ + current_audio.impl.ThreadInit(device); /* Loop, filling the audio buffers */ @@ -833,11 +841,11 @@ SDL_CaptureAudio(void *devicep) Uint8 *ptr; if (SDL_AtomicGet(&device->paused)) { - SDL_Delay(delay); /* just so we don't cook the CPU. */ + SDL_Delay(delay); /* just so we don't cook the CPU. */ if (device->stream) { SDL_AudioStreamClear(device->stream); } - current_audio.impl.FlushCapture(device); /* dump anything pending. */ + current_audio.impl.FlushCapture(device); /* dump anything pending. */ continue; } @@ -855,15 +863,15 @@ SDL_CaptureAudio(void *devicep) But we don't process it further or call the app's callback. */ if (!SDL_AtomicGet(&device->enabled)) { - SDL_Delay(delay); /* try to keep callback firing at normal pace. */ + SDL_Delay(delay); /* try to keep callback firing at normal pace. */ } else { while (still_need > 0) { const int rc = current_audio.impl.CaptureFromDevice(device, ptr, still_need); - SDL_assert(rc <= still_need); /* device should not overflow buffer. :) */ + SDL_assert(rc <= still_need); /* device should not overflow buffer. :) */ if (rc > 0) { still_need -= rc; ptr += rc; - } else { /* uhoh, device failed for some reason! */ + } else { /* uhoh, device failed for some reason! */ SDL_OpenedAudioDeviceDisconnected(device); break; } @@ -879,7 +887,7 @@ SDL_CaptureAudio(void *devicep) /* if this fails...oh well. */ SDL_AudioStreamPut(device->stream, data, data_len); - while (SDL_AudioStreamAvailable(device->stream) >= ((int) device->callbackspec.size)) { + while (SDL_AudioStreamAvailable(device->stream) >= ((int)device->callbackspec.size)) { const int got = SDL_AudioStreamGet(device->stream, device->work_buffer, device->callbackspec.size); SDL_assert((got < 0) || (got == device->callbackspec.size)); if (got != device->callbackspec.size) { @@ -893,7 +901,7 @@ SDL_CaptureAudio(void *devicep) } SDL_UnlockMutex(device->mixer_lock); } - } else { /* feeding user callback directly without streaming. */ + } else { /* feeding user callback directly without streaming. */ /* !!! FIXME: this should be LockDevice. */ SDL_LockMutex(device->mixer_lock); if (!SDL_AtomicGet(&device->paused)) { @@ -910,11 +918,11 @@ SDL_CaptureAudio(void *devicep) return 0; } - -static SDL_AudioFormat -SDL_ParseAudioFormat(const char *string) +static SDL_AudioFormat SDL_ParseAudioFormat(const char *string) { -#define CHECK_FMT_STRING(x) if (SDL_strcmp(string, #x) == 0) return AUDIO_##x +#define CHECK_FMT_STRING(x) \ + if (SDL_strcmp(string, #x) == 0) \ + return AUDIO_##x CHECK_FMT_STRING(U8); CHECK_FMT_STRING(S8); CHECK_FMT_STRING(U16LSB); @@ -937,14 +945,12 @@ SDL_ParseAudioFormat(const char *string) return 0; } -int -SDL_GetNumAudioDrivers(void) +int SDL_GetNumAudioDrivers(void) { return SDL_arraysize(bootstrap) - 1; } -const char * -SDL_GetAudioDriver(int index) +const char *SDL_GetAudioDriver(int index) { if (index >= 0 && index < SDL_GetNumAudioDrivers()) { return bootstrap[index]->name; @@ -952,14 +958,13 @@ SDL_GetAudioDriver(int index) return NULL; } -int -SDL_AudioInit(const char *driver_name) +int SDL_AudioInit(const char *driver_name) { int i; SDL_bool initialized = SDL_FALSE, tried_to_init = SDL_FALSE; if (SDL_GetCurrentAudioDriver()) { - SDL_AudioQuit(); /* shutdown driver if already running. */ + SDL_AudioQuit(); /* shutdown driver if already running. */ } SDL_zeroa(open_devices); @@ -975,7 +980,7 @@ SDL_AudioInit(const char *driver_name) const char *driver_attempt_end = SDL_strchr(driver_attempt, ','); size_t driver_attempt_len = (driver_attempt_end != NULL) ? (driver_attempt_end - driver_attempt) : SDL_strlen(driver_attempt); -#if SDL_AUDIO_DRIVER_DSOUND +#ifdef SDL_AUDIO_DRIVER_DSOUND /* SDL 1.2 uses the name "dsound", so we'll support both. */ if (driver_attempt_len == SDL_strlen("dsound") && (SDL_strncasecmp(driver_attempt, "dsound", driver_attempt_len) == 0)) { @@ -984,7 +989,7 @@ SDL_AudioInit(const char *driver_name) } #endif -#if SDL_AUDIO_DRIVER_PULSEAUDIO +#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO /* SDL 1.2 uses the name "pulse", so we'll support both. */ if (driver_attempt_len == SDL_strlen("pulse") && (SDL_strncasecmp(driver_attempt, "pulse", driver_attempt_len) == 0)) { @@ -1005,11 +1010,11 @@ SDL_AudioInit(const char *driver_name) } } - driver_attempt = (driver_attempt_end != NULL) ? (driver_attempt_end + 1) : NULL; + driver_attempt = (driver_attempt_end) ? (driver_attempt_end + 1) : NULL; } } else { for (i = 0; (!initialized) && (bootstrap[i]); ++i) { - if(bootstrap[i]->demand_only) { + if (bootstrap[i]->demand_only) { continue; } @@ -1032,7 +1037,7 @@ SDL_AudioInit(const char *driver_name) } SDL_zero(current_audio); - return -1; /* No driver was available, so fail. */ + return -1; /* No driver was available, so fail. */ } current_audio.detectionLock = SDL_CreateMutex(); @@ -1052,15 +1057,13 @@ SDL_AudioInit(const char *driver_name) /* * Get the current audio driver name */ -const char * -SDL_GetCurrentAudioDriver() +const char *SDL_GetCurrentAudioDriver(void) { return current_audio.name; } /* Clean out devices that we've removed but had to keep around for stability. */ -static void -clean_out_device_list(SDL_AudioDeviceItem **devices, int *devCount, SDL_bool *removedFlag) +static void clean_out_device_list(SDL_AudioDeviceItem **devices, int *devCount, SDL_bool *removedFlag) { SDL_AudioDeviceItem *item = *devices; SDL_AudioDeviceItem *prev = NULL; @@ -1091,9 +1094,7 @@ clean_out_device_list(SDL_AudioDeviceItem **devices, int *devCount, SDL_bool *re *removedFlag = SDL_FALSE; } - -int -SDL_GetNumAudioDevices(int iscapture) +int SDL_GetNumAudioDevices(int iscapture) { int retval = 0; @@ -1116,9 +1117,7 @@ SDL_GetNumAudioDevices(int iscapture) return retval; } - -const char * -SDL_GetAudioDeviceName(int index, int iscapture) +const char *SDL_GetAudioDeviceName(int index, int iscapture) { SDL_AudioDeviceItem *item; int i; @@ -1147,9 +1146,7 @@ SDL_GetAudioDeviceName(int index, int iscapture) return retval; } - -int -SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec) +int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec) { SDL_AudioDeviceItem *item; int i, retval; @@ -1180,9 +1177,7 @@ SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec) return retval; } - -int -SDL_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +int SDL_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { if (spec == NULL) { return SDL_InvalidParamError("spec"); @@ -1198,9 +1193,7 @@ SDL_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) return current_audio.impl.GetDefaultAudioInfo(name, spec, iscapture); } - -static void -close_audio_device(SDL_AudioDevice * device) +static void close_audio_device(SDL_AudioDevice *device) { if (!device) { return; @@ -1241,35 +1234,55 @@ close_audio_device(SDL_AudioDevice * device) SDL_free(device); } +static Uint16 GetDefaultSamplesFromFreq(int freq) +{ + /* Pick a default of ~46 ms at desired frequency */ + /* !!! FIXME: remove this when the non-Po2 resampling is in. */ + const Uint16 max_sample = (freq / 1000) * 46; + Uint16 current_sample = 1; + while (current_sample < max_sample) { + current_sample *= 2; + } + return current_sample; +} /* * Sanity check desired AudioSpec for SDL_OpenAudio() in (orig). * Fills in a sanitized copy in (prepared). * Returns non-zero if okay, zero on fatal parameters in (orig). */ -static int -prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) +static int prepare_audiospec(const SDL_AudioSpec *orig, SDL_AudioSpec *prepared) { SDL_copyp(prepared, orig); if (orig->freq == 0) { + static const int DEFAULT_FREQ = 22050; const char *env = SDL_getenv("SDL_AUDIO_FREQUENCY"); - if ((!env) || ((prepared->freq = SDL_atoi(env)) == 0)) { - prepared->freq = 22050; /* a reasonable default */ + if (env != NULL) { + int freq = SDL_atoi(env); + prepared->freq = freq != 0 ? freq : DEFAULT_FREQ; + } else { + prepared->freq = DEFAULT_FREQ; } } if (orig->format == 0) { const char *env = SDL_getenv("SDL_AUDIO_FORMAT"); - if ((!env) || ((prepared->format = SDL_ParseAudioFormat(env)) == 0)) { - prepared->format = AUDIO_S16; /* a reasonable default */ + if (env != NULL) { + const SDL_AudioFormat format = SDL_ParseAudioFormat(env); + prepared->format = format != 0 ? format : AUDIO_S16; + } else { + prepared->format = AUDIO_S16; } } if (orig->channels == 0) { const char *env = SDL_getenv("SDL_AUDIO_CHANNELS"); - if ((!env) || ((prepared->channels = (Uint8) SDL_atoi(env)) == 0)) { - prepared->channels = 2; /* a reasonable default */ + if (env != NULL) { + Uint8 channels = (Uint8)SDL_atoi(env); + prepared->channels = channels != 0 ? channels : 2; + } else { + prepared->channels = 2; } } else if (orig->channels > 8) { SDL_SetError("Unsupported number of audio channels."); @@ -1278,15 +1291,11 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) if (orig->samples == 0) { const char *env = SDL_getenv("SDL_AUDIO_SAMPLES"); - if ((!env) || ((prepared->samples = (Uint16) SDL_atoi(env)) == 0)) { - /* Pick a default of ~46 ms at desired frequency */ - /* !!! FIXME: remove this when the non-Po2 resampling is in. */ - const int samples = (prepared->freq / 1000) * 46; - int power2 = 1; - while (power2 < samples) { - power2 *= 2; - } - prepared->samples = power2; + if (env != NULL) { + Uint16 samples = (Uint16)SDL_atoi(env); + prepared->samples = samples != 0 ? samples : GetDefaultSamplesFromFreq(prepared->freq); + } else { + prepared->samples = GetDefaultSamplesFromFreq(prepared->freq); } } @@ -1296,12 +1305,10 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) return 1; } -static SDL_AudioDeviceID -open_audio_device(const char *devname, int iscapture, - const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, - int allowed_changes, int min_id) +static SDL_AudioDeviceID open_audio_device(const char *devname, int iscapture, + const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, + int allowed_changes, int min_id) { - const SDL_bool is_internal_thread = (desired->callback == NULL); SDL_AudioDeviceID id = 0; SDL_AudioSpec _obtained; SDL_AudioDevice *device; @@ -1319,25 +1326,10 @@ open_audio_device(const char *devname, int iscapture, return 0; } - SDL_LockMutex(current_audio.detectionLock); - /* Find an available device ID... */ - for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { - if (open_devices[id] == NULL) { - break; - } - } - - if (id == SDL_arraysize(open_devices)) { - SDL_SetError("Too many open audio devices"); - SDL_UnlockMutex(current_audio.detectionLock); - return 0; - } - if (!obtained) { obtained = &_obtained; } if (!prepare_audiospec(desired, obtained)) { - SDL_UnlockMutex(current_audio.detectionLock); return 0; } @@ -1359,11 +1351,11 @@ open_audio_device(const char *devname, int iscapture, if ((iscapture) && (current_audio.impl.OnlyHasDefaultCaptureDevice)) { if ((devname) && (SDL_strcmp(devname, DEFAULT_INPUT_DEVNAME) != 0)) { SDL_SetError("No such device"); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } devname = NULL; + SDL_LockMutex(current_audio.detectionLock); for (i = 0; i < SDL_arraysize(open_devices); i++) { if ((open_devices[i]) && (open_devices[i]->iscapture)) { SDL_SetError("Audio device already open"); @@ -1371,14 +1363,15 @@ open_audio_device(const char *devname, int iscapture, return 0; } } + SDL_UnlockMutex(current_audio.detectionLock); } else if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { if ((devname) && (SDL_strcmp(devname, DEFAULT_OUTPUT_DEVNAME) != 0)) { - SDL_UnlockMutex(current_audio.detectionLock); SDL_SetError("No such device"); return 0; } devname = NULL; + SDL_LockMutex(current_audio.detectionLock); for (i = 0; i < SDL_arraysize(open_devices); i++) { if ((open_devices[i]) && (!open_devices[i]->iscapture)) { SDL_UnlockMutex(current_audio.detectionLock); @@ -1386,6 +1379,7 @@ open_audio_device(const char *devname, int iscapture, return 0; } } + SDL_UnlockMutex(current_audio.detectionLock); } else if (devname != NULL) { /* if the app specifies an exact string, we can pass the backend an actual device handle thingey, which saves them the effort of @@ -1394,35 +1388,34 @@ open_audio_device(const char *devname, int iscapture, It might still need to open a device based on the string for, say, a network audio server, but this optimizes some cases. */ SDL_AudioDeviceItem *item; + SDL_LockMutex(current_audio.detectionLock); for (item = iscapture ? current_audio.inputDevices : current_audio.outputDevices; item; item = item->next) { if ((item->handle != NULL) && (SDL_strcmp(item->name, devname) == 0)) { handle = item->handle; break; } } + SDL_UnlockMutex(current_audio.detectionLock); } if (!current_audio.impl.AllowsArbitraryDeviceNames) { /* has to be in our device list, or the default device. */ if ((handle == NULL) && (devname != NULL)) { SDL_SetError("No such device."); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } } - device = (SDL_AudioDevice *) SDL_calloc(1, sizeof (SDL_AudioDevice)); + device = (SDL_AudioDevice *)SDL_calloc(1, sizeof(SDL_AudioDevice)); if (device == NULL) { SDL_OutOfMemory(); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } - device->id = id + 1; device->spec = *obtained; device->iscapture = iscapture ? SDL_TRUE : SDL_FALSE; device->handle = handle; - SDL_AtomicSet(&device->shutdown, 0); /* just in case. */ + SDL_AtomicSet(&device->shutdown, 0); /* just in case. */ SDL_AtomicSet(&device->paused, 1); SDL_AtomicSet(&device->enabled, 1); @@ -1431,7 +1424,6 @@ open_audio_device(const char *devname, int iscapture, device->mixer_lock = SDL_CreateMutex(); if (device->mixer_lock == NULL) { close_audio_device(device); - SDL_UnlockMutex(current_audio.detectionLock); SDL_SetError("Couldn't create mixer lock"); return 0; } @@ -1446,7 +1438,6 @@ open_audio_device(const char *devname, int iscapture, if (current_audio.impl.OpenDevice(device, devname) < 0) { close_audio_device(device); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } @@ -1485,34 +1476,32 @@ open_audio_device(const char *devname, int iscapture, } } - SDL_CalculateAudioSpec(obtained); /* recalc after possible changes. */ + SDL_CalculateAudioSpec(obtained); /* recalc after possible changes. */ device->callbackspec = *obtained; if (build_stream) { if (iscapture) { device->stream = SDL_NewAudioStream(device->spec.format, - device->spec.channels, device->spec.freq, - obtained->format, obtained->channels, obtained->freq); + device->spec.channels, device->spec.freq, + obtained->format, obtained->channels, obtained->freq); } else { device->stream = SDL_NewAudioStream(obtained->format, obtained->channels, - obtained->freq, device->spec.format, - device->spec.channels, device->spec.freq); + obtained->freq, device->spec.format, + device->spec.channels, device->spec.freq); } if (!device->stream) { close_audio_device(device); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } } - if (device->spec.callback == NULL) { /* use buffer queueing? */ + if (device->spec.callback == NULL) { /* use buffer queueing? */ /* pool a few packets to start. Enough for two callbacks. */ device->buffer_queue = SDL_NewDataQueue(SDL_AUDIOBUFFERQUEUE_PACKETLEN, obtained->size * 2); if (!device->buffer_queue) { close_audio_device(device); - SDL_UnlockMutex(current_audio.detectionLock); SDL_SetError("Couldn't create audio buffer queue"); return 0; } @@ -1527,42 +1516,64 @@ open_audio_device(const char *devname, int iscapture, } SDL_assert(device->work_buffer_len > 0); - device->work_buffer = (Uint8 *) SDL_malloc(device->work_buffer_len); + device->work_buffer = (Uint8 *)SDL_malloc(device->work_buffer_len); if (device->work_buffer == NULL) { close_audio_device(device); - SDL_UnlockMutex(current_audio.detectionLock); SDL_OutOfMemory(); return 0; } - open_devices[id] = device; /* add it to our list of open devices. */ + /* Find an available device ID... */ + SDL_LockMutex(current_audio.detectionLock); + for (id = min_id - 1; id < SDL_arraysize(open_devices); id++) { + if (open_devices[id] == NULL) { + break; + } + } + + if (id == SDL_arraysize(open_devices)) { + close_audio_device(device); + SDL_SetError("Too many open audio devices"); + SDL_UnlockMutex(current_audio.detectionLock); + return 0; + } + + device->id = id + 1; + open_devices[id] = device; /* add it to our list of open devices. */ + SDL_UnlockMutex(current_audio.detectionLock); /* Start the audio thread if necessary */ if (!current_audio.impl.ProvidesOwnCallbackThread) { /* Start the audio thread */ - /* !!! FIXME: we don't force the audio thread stack size here if it calls into user code, but maybe we should? */ - /* buffer queueing callback only needs a few bytes, so make the stack tiny. */ - const size_t stacksize = is_internal_thread ? 64 * 1024 : 0; char threadname[64]; + AudioThreadStartupData startup_data; - SDL_snprintf(threadname, sizeof (threadname), "SDLAudio%c%d", (iscapture) ? 'C' : 'P', (int) device->id); - device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, threadname, stacksize, device); + startup_data.device = device; + startup_data.startup_semaphore = SDL_CreateSemaphore(0); + if (!startup_data.startup_semaphore) { + close_audio_device(device); + SDL_SetError("Couldn't create audio thread startup semaphore"); + return 0; + } + (void)SDL_snprintf(threadname, sizeof(threadname), "SDLAudio%c%" SDL_PRIu32, (iscapture) ? 'C' : 'P', device->id); + + device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, threadname, 0, &startup_data); if (device->thread == NULL) { + SDL_DestroySemaphore(startup_data.startup_semaphore); close_audio_device(device); SDL_SetError("Couldn't create audio thread"); - SDL_UnlockMutex(current_audio.detectionLock); return 0; } + + SDL_SemWait(startup_data.startup_semaphore); + SDL_DestroySemaphore(startup_data.startup_semaphore); } - SDL_UnlockMutex(current_audio.detectionLock); return device->id; } - -int -SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) +int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained) { SDL_AudioDeviceID id = 0; @@ -1596,17 +1607,15 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained) return (id == 0) ? -1 : 0; } -SDL_AudioDeviceID -SDL_OpenAudioDevice(const char *device, int iscapture, - const SDL_AudioSpec * desired, SDL_AudioSpec * obtained, +SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture, + const SDL_AudioSpec *desired, SDL_AudioSpec *obtained, int allowed_changes) { return open_audio_device(device, iscapture, desired, obtained, allowed_changes, 2); } -SDL_AudioStatus -SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) +SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) { SDL_AudioDevice *device = get_audio_device(devid); SDL_AudioStatus status = SDL_AUDIO_STOPPED; @@ -1620,15 +1629,12 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid) return status; } - -SDL_AudioStatus -SDL_GetAudioStatus(void) +SDL_AudioStatus SDL_GetAudioStatus(void) { return SDL_GetAudioDeviceStatus(1); } -void -SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on) +void SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on) { SDL_AudioDevice *device = get_audio_device(devid); if (device) { @@ -1638,15 +1644,12 @@ SDL_PauseAudioDevice(SDL_AudioDeviceID devid, int pause_on) } } -void -SDL_PauseAudio(int pause_on) +void SDL_PauseAudio(int pause_on) { SDL_PauseAudioDevice(1, pause_on); } - -void -SDL_LockAudioDevice(SDL_AudioDeviceID devid) +void SDL_LockAudioDevice(SDL_AudioDeviceID devid) { /* Obtain a lock on the mixing buffers */ SDL_AudioDevice *device = get_audio_device(devid); @@ -1655,14 +1658,12 @@ SDL_LockAudioDevice(SDL_AudioDeviceID devid) } } -void -SDL_LockAudio(void) +void SDL_LockAudio(void) { SDL_LockAudioDevice(1); } -void -SDL_UnlockAudioDevice(SDL_AudioDeviceID devid) +void SDL_UnlockAudioDevice(SDL_AudioDeviceID devid) { /* Obtain a lock on the mixing buffers */ SDL_AudioDevice *device = get_audio_device(devid); @@ -1671,30 +1672,26 @@ SDL_UnlockAudioDevice(SDL_AudioDeviceID devid) } } -void -SDL_UnlockAudio(void) +void SDL_UnlockAudio(void) { SDL_UnlockAudioDevice(1); } -void -SDL_CloseAudioDevice(SDL_AudioDeviceID devid) +void SDL_CloseAudioDevice(SDL_AudioDeviceID devid) { close_audio_device(get_audio_device(devid)); } -void -SDL_CloseAudio(void) +void SDL_CloseAudio(void) { SDL_CloseAudioDevice(1); } -void -SDL_AudioQuit(void) +void SDL_AudioQuit(void) { SDL_AudioDeviceID i; - if (!current_audio.name) { /* not initialized?! */ + if (!current_audio.name) { /* not initialized?! */ return; } @@ -1722,30 +1719,29 @@ SDL_AudioQuit(void) static int format_idx; static int format_idx_sub; static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = { - {AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, - AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, - {AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, - AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB}, - {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB, - AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB, - AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB, - AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB, - AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S16LSB, - AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S16MSB, - AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S16LSB, - AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8}, - {AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_S16MSB, - AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8}, + { AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB }, + { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, + AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB }, + { AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB, + AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB, + AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S16LSB, + AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8 }, + { AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_S16MSB, + AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 }, }; -SDL_AudioFormat -SDL_FirstAudioFormat(SDL_AudioFormat format) +SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format) { for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) { if (format_list[format_idx][0] == format) { @@ -1756,8 +1752,7 @@ SDL_FirstAudioFormat(SDL_AudioFormat format) return SDL_NextAudioFormat(); } -SDL_AudioFormat -SDL_NextAudioFormat(void) +SDL_AudioFormat SDL_NextAudioFormat(void) { if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) { return 0; @@ -1765,26 +1760,25 @@ SDL_NextAudioFormat(void) return format_list[format_idx][format_idx_sub++]; } -Uint8 -SDL_SilenceValueForFormat(const SDL_AudioFormat format) +Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format) { switch (format) { - /* !!! FIXME: 0x80 isn't perfect for U16, but we can't fit 0x8000 in a - !!! FIXME: byte for SDL_memset() use. This is actually 0.1953 percent - !!! FIXME: off from silence. Maybe just don't use U16. */ - case AUDIO_U16LSB: - case AUDIO_U16MSB: - case AUDIO_U8: - return 0x80; + /* !!! FIXME: 0x80 isn't perfect for U16, but we can't fit 0x8000 in a + !!! FIXME: byte for SDL_memset() use. This is actually 0.1953 percent + !!! FIXME: off from silence. Maybe just don't use U16. */ + case AUDIO_U16LSB: + case AUDIO_U16MSB: + case AUDIO_U8: + return 0x80; - default: break; - } + default: + break; + } return 0x00; } -void -SDL_CalculateAudioSpec(SDL_AudioSpec * spec) +void SDL_CalculateAudioSpec(SDL_AudioSpec *spec) { spec->silence = SDL_SilenceValueForFormat(spec->format); spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8; @@ -1792,13 +1786,11 @@ SDL_CalculateAudioSpec(SDL_AudioSpec * spec) spec->size *= spec->samples; } - /* * Moved here from SDL_mixer.c, since it relies on internals of an opened * audio device (and is deprecated, by the way!). */ -void -SDL_MixAudio(Uint8 * dst, const Uint8 * src, Uint32 len, int volume) +void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume) { /* Mix the user-level audio format */ SDL_AudioDevice *device = get_audio_device(1); diff --git a/src/audio/SDL_audio_c.h b/src/audio/SDL_audio_c.h index a976dfd09e615..49019e13d955e 100644 --- a/src/audio/SDL_audio_c.h +++ b/src/audio/SDL_audio_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,11 +40,11 @@ #include "samplerate.h" extern SDL_bool SRC_available; extern int SRC_converter; -extern SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error); +extern SRC_STATE *(*SRC_src_new)(int converter_type, int channels, int *error); extern int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data); extern int (*SRC_src_reset)(SRC_STATE *state); -extern SRC_STATE* (*SRC_src_delete)(SRC_STATE *state); -extern const char* (*SRC_src_strerror)(int error); +extern SRC_STATE *(*SRC_src_delete)(SRC_STATE *state); +extern const char *(*SRC_src_strerror)(int error); extern int (*SRC_src_simple)(SRC_DATA *data, int converter_type, int channels); #endif @@ -54,7 +54,7 @@ extern SDL_AudioFormat SDL_NextAudioFormat(void); /* Function to calculate the size and silence for a SDL_AudioSpec */ extern Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format); -extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec); +extern void SDL_CalculateAudioSpec(SDL_AudioSpec *spec); /* Choose the audio filter functions below */ extern void SDL_ChooseAudioConverters(void); diff --git a/src/audio/SDL_audio_channel_converters.h b/src/audio/SDL_audio_channel_converters.h index fea9ad1e1f8f1..1e6fd6e5f0dcf 100644 --- a/src/audio/SDL_audio_channel_converters.h +++ b/src/audio/SDL_audio_channel_converters.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,18 +21,17 @@ /* DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_channel_conversion.c */ -static void SDLCALL -SDL_ConvertMonoToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 2))) - 2; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 2))) - 2; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "stereo"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 2) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 2) { const float srcFC = src[0]; dst[1] /* FR */ = srcFC; dst[0] /* FL */ = srcFC; @@ -40,22 +39,21 @@ SDL_ConvertMonoToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 3))) - 3; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 3))) - 3; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "2.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 3) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 3) { const float srcFC = src[0]; dst[2] /* LFE */ = 0.0f; dst[1] /* FR */ = srcFC; @@ -64,22 +62,21 @@ SDL_ConvertMonoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 4))) - 4; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 4))) - 4; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "quad"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 4) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 4) { const float srcFC = src[0]; dst[3] /* BR */ = 0.0f; dst[2] /* BL */ = 0.0f; @@ -89,22 +86,21 @@ SDL_ConvertMonoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 5))) - 5; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 5))) - 5; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "4.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 5) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 5) { const float srcFC = src[0]; dst[4] /* BR */ = 0.0f; dst[3] /* BL */ = 0.0f; @@ -115,22 +111,21 @@ SDL_ConvertMonoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 6))) - 6; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 6))) - 6; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "5.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 6) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 6) { const float srcFC = src[0]; dst[5] /* BR */ = 0.0f; dst[4] /* BL */ = 0.0f; @@ -142,22 +137,21 @@ SDL_ConvertMonoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 7) { const float srcFC = src[0]; dst[6] /* SR */ = 0.0f; dst[5] /* SL */ = 0.0f; @@ -170,22 +164,21 @@ SDL_ConvertMonoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertMonoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 1) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 1) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 1; int i; LOG_DEBUG_CONVERT("mono", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 1); i; i--, src -= 1, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 1); i; i--, src -= 1, dst -= 8) { const float srcFC = src[0]; dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; @@ -199,42 +192,40 @@ SDL_ConvertMonoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = cvt->len_cvt * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("stereo", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src += 2, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src += 2, dst += 1) { dst[0] /* FC */ = (src[0] * 0.500000000f) + (src[1] * 0.500000000f); } cvt->len_cvt = cvt->len_cvt / 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 3))) - 3; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 3))) - 3; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "2.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 3) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 3) { dst[2] /* LFE */ = 0.0f; dst[1] /* FR */ = src[1]; dst[0] /* FL */ = src[0]; @@ -242,22 +233,21 @@ SDL_ConvertStereoTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 4))) - 4; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 4))) - 4; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "quad"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 4) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 4) { dst[3] /* BR */ = 0.0f; dst[2] /* BL */ = 0.0f; dst[1] /* FR */ = src[1]; @@ -266,22 +256,21 @@ SDL_ConvertStereoToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 5))) - 5; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 5))) - 5; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "4.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 5) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 5) { dst[4] /* BR */ = 0.0f; dst[3] /* BL */ = 0.0f; dst[2] /* LFE */ = 0.0f; @@ -291,22 +280,21 @@ SDL_ConvertStereoTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 6))) - 6; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 6))) - 6; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "5.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 6) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 6) { dst[5] /* BR */ = 0.0f; dst[4] /* BL */ = 0.0f; dst[3] /* LFE */ = 0.0f; @@ -317,22 +305,21 @@ SDL_ConvertStereoTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 7) { dst[6] /* SR */ = 0.0f; dst[5] /* SL */ = 0.0f; dst[4] /* BC */ = 0.0f; @@ -344,22 +331,21 @@ SDL_ConvertStereoTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertStereoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 2) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 2; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 2) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 2; int i; LOG_DEBUG_CONVERT("stereo", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 2); i; i--, src -= 2, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 2); i; i--, src -= 2, dst -= 8) { dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; dst[5] /* BR */ = 0.0f; @@ -372,41 +358,39 @@ SDL_ConvertStereoTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 2) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("2.1", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src += 3, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src += 3, dst += 1) { dst[0] /* FC */ = (src[0] * 0.333333343f) + (src[1] * 0.333333343f) + (src[2] * 0.333333343f); } cvt->len_cvt = cvt->len_cvt / 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("2.1", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src += 3, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src += 3, dst += 2) { const float srcLFE = src[2]; dst[0] /* FL */ = (src[0] * 0.800000012f) + (srcLFE * 0.200000003f); dst[1] /* FR */ = (src[1] * 0.800000012f) + (srcLFE * 0.200000003f); @@ -414,22 +398,21 @@ SDL_Convert21ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 3) * 4))) - 4; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 3; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 3) * 4))) - 4; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 3; int i; LOG_DEBUG_CONVERT("2.1", "quad"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src -= 3, dst -= 4) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src -= 3, dst -= 4) { const float srcLFE = src[2]; dst[3] /* BR */ = (srcLFE * 0.111111112f); dst[2] /* BL */ = (srcLFE * 0.111111112f); @@ -439,22 +422,21 @@ SDL_Convert21ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 3) * 5))) - 5; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 3; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 3) * 5))) - 5; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 3; int i; LOG_DEBUG_CONVERT("2.1", "4.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src -= 3, dst -= 5) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src -= 3, dst -= 5) { dst[4] /* BR */ = 0.0f; dst[3] /* BL */ = 0.0f; dst[2] /* LFE */ = src[2]; @@ -464,22 +446,21 @@ SDL_Convert21To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 3) * 6))) - 6; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 3; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 3) * 6))) - 6; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 3; int i; LOG_DEBUG_CONVERT("2.1", "5.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src -= 3, dst -= 6) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src -= 3, dst -= 6) { dst[5] /* BR */ = 0.0f; dst[4] /* BL */ = 0.0f; dst[3] /* LFE */ = src[2]; @@ -490,22 +471,21 @@ SDL_Convert21To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 3) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 3; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 3) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 3; int i; LOG_DEBUG_CONVERT("2.1", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src -= 3, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src -= 3, dst -= 7) { dst[6] /* SR */ = 0.0f; dst[5] /* SL */ = 0.0f; dst[4] /* BC */ = 0.0f; @@ -517,22 +497,21 @@ SDL_Convert21To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert21To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert21To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 3) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 3; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 3) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 3; int i; LOG_DEBUG_CONVERT("2.1", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 3); i; i--, src -= 3, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 3); i; i--, src -= 3, dst -= 8) { dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; dst[5] /* BR */ = 0.0f; @@ -545,41 +524,39 @@ SDL_Convert21To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 3) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("quad", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src += 4, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src += 4, dst += 1) { dst[0] /* FC */ = (src[0] * 0.250000000f) + (src[1] * 0.250000000f) + (src[2] * 0.250000000f) + (src[3] * 0.250000000f); } cvt->len_cvt = cvt->len_cvt / 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("quad", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src += 4, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src += 4, dst += 2) { const float srcBL = src[2]; const float srcBR = src[3]; dst[0] /* FL */ = (src[0] * 0.421000004f) + (srcBL * 0.358999997f) + (srcBR * 0.219999999f); @@ -588,21 +565,20 @@ SDL_ConvertQuadToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("quad", "2.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src += 4, dst += 3) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src += 4, dst += 3) { const float srcBL = src[2]; const float srcBR = src[3]; dst[0] /* FL */ = (src[0] * 0.421000004f) + (srcBL * 0.358999997f) + (srcBR * 0.219999999f); @@ -612,22 +588,21 @@ SDL_ConvertQuadTo21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 4) * 5))) - 5; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 4; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 4) * 5))) - 5; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 4; int i; LOG_DEBUG_CONVERT("quad", "4.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src -= 4, dst -= 5) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src -= 4, dst -= 5) { dst[4] /* BR */ = src[3]; dst[3] /* BL */ = src[2]; dst[2] /* LFE */ = 0.0f; @@ -637,22 +612,21 @@ SDL_ConvertQuadTo41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 4) * 6))) - 6; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 4; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 4) * 6))) - 6; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 4; int i; LOG_DEBUG_CONVERT("quad", "5.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src -= 4, dst -= 6) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src -= 4, dst -= 6) { dst[5] /* BR */ = src[3]; dst[4] /* BL */ = src[2]; dst[3] /* LFE */ = 0.0f; @@ -663,22 +637,21 @@ SDL_ConvertQuadTo51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 4) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 4; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 4) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 4; int i; LOG_DEBUG_CONVERT("quad", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src -= 4, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src -= 4, dst -= 7) { const float srcBL = src[2]; const float srcBR = src[3]; dst[6] /* SR */ = (srcBR * 0.796000004f); @@ -692,22 +665,21 @@ SDL_ConvertQuadTo61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_ConvertQuadTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertQuadTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 4) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 4; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 4) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 4; int i; LOG_DEBUG_CONVERT("quad", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 4); i; i--, src -= 4, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 4); i; i--, src -= 4, dst -= 8) { dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; dst[5] /* BR */ = src[3]; @@ -720,41 +692,39 @@ SDL_ConvertQuadTo71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 4) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("4.1", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src += 5, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src += 5, dst += 1) { dst[0] /* FC */ = (src[0] * 0.200000003f) + (src[1] * 0.200000003f) + (src[2] * 0.200000003f) + (src[3] * 0.200000003f) + (src[4] * 0.200000003f); } cvt->len_cvt = cvt->len_cvt / 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("4.1", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src += 5, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src += 5, dst += 2) { const float srcLFE = src[2]; const float srcBL = src[3]; const float srcBR = src[4]; @@ -764,21 +734,20 @@ SDL_Convert41ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("4.1", "2.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src += 5, dst += 3) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src += 5, dst += 3) { const float srcBL = src[3]; const float srcBR = src[4]; dst[0] /* FL */ = (src[0] * 0.421000004f) + (srcBL * 0.358999997f) + (srcBR * 0.219999999f); @@ -788,21 +757,20 @@ SDL_Convert41To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("4.1", "quad"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src += 5, dst += 4) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src += 5, dst += 4) { const float srcLFE = src[2]; dst[0] /* FL */ = (src[0] * 0.941176474f) + (srcLFE * 0.058823530f); dst[1] /* FR */ = (src[1] * 0.941176474f) + (srcLFE * 0.058823530f); @@ -812,22 +780,21 @@ SDL_Convert41ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 5) * 6))) - 6; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 5; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 5) * 6))) - 6; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 5; int i; LOG_DEBUG_CONVERT("4.1", "5.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src -= 5, dst -= 6) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src -= 5, dst -= 6) { dst[5] /* BR */ = src[4]; dst[4] /* BL */ = src[3]; dst[3] /* LFE */ = src[2]; @@ -838,22 +805,21 @@ SDL_Convert41To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 5) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 5; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 5) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 5; int i; LOG_DEBUG_CONVERT("4.1", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src -= 5, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src -= 5, dst -= 7) { const float srcBL = src[3]; const float srcBR = src[4]; dst[6] /* SR */ = (srcBR * 0.796000004f); @@ -867,22 +833,21 @@ SDL_Convert41To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert41To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert41To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 5) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 5; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 5) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 5; int i; LOG_DEBUG_CONVERT("4.1", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 5); i; i--, src -= 5, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 5); i; i--, src -= 5, dst -= 8) { dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; dst[5] /* BR */ = src[4]; @@ -895,41 +860,39 @@ SDL_Convert41To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 5) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("5.1", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src += 6, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src += 6, dst += 1) { dst[0] /* FC */ = (src[0] * 0.166666672f) + (src[1] * 0.166666672f) + (src[2] * 0.166666672f) + (src[3] * 0.166666672f) + (src[4] * 0.166666672f) + (src[5] * 0.166666672f); } cvt->len_cvt = cvt->len_cvt / 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("5.1", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src += 6, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src += 6, dst += 2) { const float srcFC = src[2]; const float srcLFE = src[3]; const float srcBL = src[4]; @@ -940,21 +903,20 @@ SDL_Convert51ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("5.1", "2.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src += 6, dst += 3) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src += 6, dst += 3) { const float srcFC = src[2]; const float srcBL = src[4]; const float srcBR = src[5]; @@ -965,21 +927,20 @@ SDL_Convert51To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("5.1", "quad"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src += 6, dst += 4) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src += 6, dst += 4) { const float srcFC = src[2]; const float srcLFE = src[3]; dst[0] /* FL */ = (src[0] * 0.558095276f) + (srcFC * 0.394285709f) + (srcLFE * 0.047619049f); @@ -990,21 +951,20 @@ SDL_Convert51ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("5.1", "4.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src += 6, dst += 5) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src += 6, dst += 5) { const float srcFC = src[2]; dst[0] /* FL */ = (src[0] * 0.586000025f) + (srcFC * 0.414000005f); dst[1] /* FR */ = (src[1] * 0.586000025f) + (srcFC * 0.414000005f); @@ -1015,22 +975,21 @@ SDL_Convert51To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 6) * 7))) - 7; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 6; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 6) * 7))) - 7; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 6; int i; LOG_DEBUG_CONVERT("5.1", "6.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src -= 6, dst -= 7) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src -= 6, dst -= 7) { const float srcBL = src[4]; const float srcBR = src[5]; dst[6] /* SR */ = (srcBR * 0.796000004f); @@ -1044,22 +1003,21 @@ SDL_Convert51To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert51To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert51To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 6) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 6; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 6) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 6; int i; LOG_DEBUG_CONVERT("5.1", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 6); i; i--, src -= 6, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 6); i; i--, src -= 6, dst -= 8) { dst[7] /* SR */ = 0.0f; dst[6] /* SL */ = 0.0f; dst[5] /* BR */ = src[5]; @@ -1072,41 +1030,39 @@ SDL_Convert51To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 6) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 1) { dst[0] /* FC */ = (src[0] * 0.143142849f) + (src[1] * 0.143142849f) + (src[2] * 0.143142849f) + (src[3] * 0.142857149f) + (src[4] * 0.143142849f) + (src[5] * 0.143142849f) + (src[6] * 0.143142849f); } cvt->len_cvt = cvt->len_cvt / 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 2) { const float srcFC = src[2]; const float srcLFE = src[3]; const float srcBC = src[4]; @@ -1118,21 +1074,20 @@ SDL_Convert61ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "2.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 3) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 3) { const float srcFC = src[2]; const float srcBC = src[4]; const float srcSL = src[5]; @@ -1144,21 +1099,20 @@ SDL_Convert61To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "quad"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 4) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 4) { const float srcFC = src[2]; const float srcLFE = src[3]; const float srcBC = src[4]; @@ -1172,21 +1126,20 @@ SDL_Convert61ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "4.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 5) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 5) { const float srcFC = src[2]; const float srcBC = src[4]; const float srcSL = src[5]; @@ -1200,21 +1153,20 @@ SDL_Convert61To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("6.1", "5.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src += 7, dst += 6) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src += 7, dst += 6) { const float srcBC = src[4]; const float srcSL = src[5]; const float srcSR = src[6]; @@ -1228,22 +1180,21 @@ SDL_Convert61To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert61To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert61To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + ((cvt->len_cvt / 7) * 8))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 7; + float *dst = ((float *)(cvt->buf + ((cvt->len_cvt / 7) * 8))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 7; int i; LOG_DEBUG_CONVERT("6.1", "7.1"); SDL_assert(format == AUDIO_F32SYS); /* convert backwards, since output is growing in-place. */ - for (i = cvt->len_cvt / (sizeof (float) * 7); i; i--, src -= 7, dst -= 8) { + for (i = cvt->len_cvt / (sizeof(float) * 7); i; i--, src -= 7, dst -= 8) { const float srcBC = src[4]; dst[7] /* SR */ = src[6]; dst[6] /* SL */ = src[5]; @@ -1257,41 +1208,39 @@ SDL_Convert61To71(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 7) * 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71ToMono(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "mono"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 1) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 1) { dst[0] /* FC */ = (src[0] * 0.125125006f) + (src[1] * 0.125125006f) + (src[2] * 0.125125006f) + (src[3] * 0.125000000f) + (src[4] * 0.125125006f) + (src[5] * 0.125125006f) + (src[6] * 0.125125006f) + (src[7] * 0.125125006f); } cvt->len_cvt = cvt->len_cvt / 8; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "stereo"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 2) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 2) { const float srcFC = src[2]; const float srcLFE = src[3]; const float srcBL = src[4]; @@ -1304,21 +1253,20 @@ SDL_Convert71ToStereo(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "2.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 3) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 3) { const float srcFC = src[2]; const float srcBL = src[4]; const float srcBR = src[5]; @@ -1331,21 +1279,20 @@ SDL_Convert71To21(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 3; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "quad"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 4) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 4) { const float srcFC = src[2]; const float srcLFE = src[3]; const float srcSL = src[6]; @@ -1358,21 +1305,20 @@ SDL_Convert71ToQuad(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 4; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "4.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 5) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 5) { const float srcFC = src[2]; const float srcSL = src[6]; const float srcSR = src[7]; @@ -1385,21 +1331,20 @@ SDL_Convert71To41(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 5; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "5.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 6) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 6) { const float srcSL = src[6]; const float srcSR = src[7]; dst[0] /* FL */ = (src[0] * 0.518000007f) + (srcSL * 0.188999996f); @@ -1412,21 +1357,20 @@ SDL_Convert71To51(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 6; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static void SDLCALL -SDL_Convert71To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert71To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i; LOG_DEBUG_CONVERT("7.1", "6.1"); SDL_assert(format == AUDIO_F32SYS); - for (i = cvt->len_cvt / (sizeof (float) * 8); i; i--, src += 8, dst += 7) { + for (i = cvt->len_cvt / (sizeof(float) * 8); i; i--, src += 8, dst += 7) { const float srcBL = src[4]; const float srcBR = src[5]; dst[0] /* FL */ = (src[0] * 0.541000009f); @@ -1440,20 +1384,19 @@ SDL_Convert71To61(SDL_AudioCVT *cvt, SDL_AudioFormat format) cvt->len_cvt = (cvt->len_cvt / 8) * 7; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } -static const SDL_AudioFilter channel_converters[8][8] = { /* [from][to] */ - { NULL, SDL_ConvertMonoToStereo, SDL_ConvertMonoTo21, SDL_ConvertMonoToQuad, SDL_ConvertMonoTo41, SDL_ConvertMonoTo51, SDL_ConvertMonoTo61, SDL_ConvertMonoTo71 }, - { SDL_ConvertStereoToMono, NULL, SDL_ConvertStereoTo21, SDL_ConvertStereoToQuad, SDL_ConvertStereoTo41, SDL_ConvertStereoTo51, SDL_ConvertStereoTo61, SDL_ConvertStereoTo71 }, - { SDL_Convert21ToMono, SDL_Convert21ToStereo, NULL, SDL_Convert21ToQuad, SDL_Convert21To41, SDL_Convert21To51, SDL_Convert21To61, SDL_Convert21To71 }, - { SDL_ConvertQuadToMono, SDL_ConvertQuadToStereo, SDL_ConvertQuadTo21, NULL, SDL_ConvertQuadTo41, SDL_ConvertQuadTo51, SDL_ConvertQuadTo61, SDL_ConvertQuadTo71 }, - { SDL_Convert41ToMono, SDL_Convert41ToStereo, SDL_Convert41To21, SDL_Convert41ToQuad, NULL, SDL_Convert41To51, SDL_Convert41To61, SDL_Convert41To71 }, - { SDL_Convert51ToMono, SDL_Convert51ToStereo, SDL_Convert51To21, SDL_Convert51ToQuad, SDL_Convert51To41, NULL, SDL_Convert51To61, SDL_Convert51To71 }, - { SDL_Convert61ToMono, SDL_Convert61ToStereo, SDL_Convert61To21, SDL_Convert61ToQuad, SDL_Convert61To41, SDL_Convert61To51, NULL, SDL_Convert61To71 }, - { SDL_Convert71ToMono, SDL_Convert71ToStereo, SDL_Convert71To21, SDL_Convert71ToQuad, SDL_Convert71To41, SDL_Convert71To51, SDL_Convert71To61, NULL } +static const SDL_AudioFilter channel_converters[8][8] = { /* [from][to] */ + { NULL, SDL_ConvertMonoToStereo, SDL_ConvertMonoTo21, SDL_ConvertMonoToQuad, SDL_ConvertMonoTo41, SDL_ConvertMonoTo51, SDL_ConvertMonoTo61, SDL_ConvertMonoTo71 }, + { SDL_ConvertStereoToMono, NULL, SDL_ConvertStereoTo21, SDL_ConvertStereoToQuad, SDL_ConvertStereoTo41, SDL_ConvertStereoTo51, SDL_ConvertStereoTo61, SDL_ConvertStereoTo71 }, + { SDL_Convert21ToMono, SDL_Convert21ToStereo, NULL, SDL_Convert21ToQuad, SDL_Convert21To41, SDL_Convert21To51, SDL_Convert21To61, SDL_Convert21To71 }, + { SDL_ConvertQuadToMono, SDL_ConvertQuadToStereo, SDL_ConvertQuadTo21, NULL, SDL_ConvertQuadTo41, SDL_ConvertQuadTo51, SDL_ConvertQuadTo61, SDL_ConvertQuadTo71 }, + { SDL_Convert41ToMono, SDL_Convert41ToStereo, SDL_Convert41To21, SDL_Convert41ToQuad, NULL, SDL_Convert41To51, SDL_Convert41To61, SDL_Convert41To71 }, + { SDL_Convert51ToMono, SDL_Convert51ToStereo, SDL_Convert51To21, SDL_Convert51ToQuad, SDL_Convert51To41, NULL, SDL_Convert51To61, SDL_Convert51To71 }, + { SDL_Convert61ToMono, SDL_Convert61ToStereo, SDL_Convert61To21, SDL_Convert61ToQuad, SDL_Convert61To41, SDL_Convert61To51, NULL, SDL_Convert61To71 }, + { SDL_Convert71ToMono, SDL_Convert71ToStereo, SDL_Convert71To21, SDL_Convert71ToQuad, SDL_Convert71To41, SDL_Convert71To51, SDL_Convert71To61, NULL } }; /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/audio/SDL_audio_resampler_filter.h b/src/audio/SDL_audio_resampler_filter.h index 9b4728c3b0907..be728eaf2752a 100644 --- a/src/audio/SDL_audio_resampler_filter.h +++ b/src/audio/SDL_audio_resampler_filter.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,10 +21,10 @@ /* DO NOT EDIT, THIS FILE WAS GENERATED BY build-scripts/gen_audio_resampler_filter.c */ -#define RESAMPLER_ZERO_CROSSINGS 5 -#define RESAMPLER_BITS_PER_SAMPLE 16 +#define RESAMPLER_ZERO_CROSSINGS 5 +#define RESAMPLER_BITS_PER_SAMPLE 16 #define RESAMPLER_SAMPLES_PER_ZERO_CROSSING (1 << ((RESAMPLER_BITS_PER_SAMPLE / 2) + 1)) -#define RESAMPLER_FILTER_SIZE ((RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS) + 1) +#define RESAMPLER_FILTER_SIZE ((RESAMPLER_SAMPLES_PER_ZERO_CROSSING * RESAMPLER_ZERO_CROSSINGS) + 1) static const float ResamplerFilter[RESAMPLER_FILTER_SIZE] = { 1.000000000f, 0.999993682f, 0.999974370f, 0.999941289f, 0.999894559f, @@ -1059,4 +1059,3 @@ static const float ResamplerFilterDifference[RESAMPLER_FILTER_SIZE] = { }; /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 196013e11eace..348ce6b9c50a5 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,16 +48,16 @@ #define HAVE_AVX_INTRINSICS 1 #endif #if defined __clang__ -# if (!__has_attribute(target)) -# undef HAVE_AVX_INTRINSICS -# endif -# if (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX__) -# undef HAVE_AVX_INTRINSICS -# endif +#if (!__has_attribute(target)) +#undef HAVE_AVX_INTRINSICS +#endif +#if (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX__) +#undef HAVE_AVX_INTRINSICS +#endif #elif defined __GNUC__ -# if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) -# undef HAVE_AVX_INTRINSICS -# endif +#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) +#undef HAVE_AVX_INTRINSICS +#endif #endif /* @@ -93,13 +93,12 @@ * 8 channels (7.1) layout: FL+FR+FC+LFE+BL+BR+SL+SR */ -#if HAVE_SSE3_INTRINSICS +#ifdef HAVE_SSE3_INTRINSICS /* Convert from stereo to mono. Average left and right. */ -static void SDLCALL -SDL_ConvertStereoToMono_SSE3(SDL_AudioCVT * cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertStereoToMono_SSE3(SDL_AudioCVT *cvt, SDL_AudioFormat format) { const __m128 divby2 = _mm_set1_ps(0.5f); - float *dst = (float *) cvt->buf; + float *dst = (float *)cvt->buf; const float *src = dst; int i = cvt->len_cvt / 8; @@ -109,32 +108,35 @@ SDL_ConvertStereoToMono_SSE3(SDL_AudioCVT * cvt, SDL_AudioFormat format) /* Do SSE blocks as long as we have 16 bytes available. Just use unaligned load/stores, if the memory at runtime is aligned it'll be just as fast on modern processors */ - while (i >= 4) { /* 4 * float32 */ - _mm_storeu_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_loadu_ps(src), _mm_loadu_ps(src+4)), divby2)); - i -= 4; src += 8; dst += 4; + while (i >= 4) { /* 4 * float32 */ + _mm_storeu_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_loadu_ps(src), _mm_loadu_ps(src + 4)), divby2)); + i -= 4; + src += 8; + dst += 4; } /* Finish off any leftovers with scalar operations. */ while (i) { *dst = (src[0] + src[1]) * 0.5f; - dst++; i--; src += 2; + dst++; + i--; + src += 2; } cvt->len_cvt /= 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } #endif -#if HAVE_SSE_INTRINSICS +#ifdef HAVE_SSE_INTRINSICS /* Convert from mono to stereo. Duplicate to stereo left and right. */ -static void SDLCALL -SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT * cvt, SDL_AudioFormat format) +static void SDLCALL SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - float *dst = ((float *) (cvt->buf + (cvt->len_cvt * 2))) - 8; - const float *src = ((const float *) (cvt->buf + cvt->len_cvt)) - 4; - int i = cvt->len_cvt / sizeof (float); + float *dst = ((float *)(cvt->buf + (cvt->len_cvt * 2))) - 8; + const float *src = ((const float *)(cvt->buf + cvt->len_cvt)) - 4; + int i = cvt->len_cvt / sizeof(float); LOG_DEBUG_CONVERT("mono", "stereo (using SSE)"); SDL_assert(format == AUDIO_F32SYS); @@ -143,124 +145,128 @@ SDL_ConvertMonoToStereo_SSE(SDL_AudioCVT * cvt, SDL_AudioFormat format) Just use unaligned load/stores, if the memory at runtime is aligned it'll be just as fast on modern processors */ /* convert backwards, since output is growing in-place. */ - while (i >= 4) { /* 4 * float32 */ - const __m128 input = _mm_loadu_ps(src); /* A B C D */ - _mm_storeu_ps(dst, _mm_unpacklo_ps(input, input)); /* A A B B */ - _mm_storeu_ps(dst+4, _mm_unpackhi_ps(input, input)); /* C C D D */ - i -= 4; src -= 4; dst -= 8; + while (i >= 4) { /* 4 * float32 */ + const __m128 input = _mm_loadu_ps(src); /* A B C D */ + _mm_storeu_ps(dst, _mm_unpacklo_ps(input, input)); /* A A B B */ + _mm_storeu_ps(dst + 4, _mm_unpackhi_ps(input, input)); /* C C D D */ + i -= 4; + src -= 4; + dst -= 8; } /* Finish off any leftovers with scalar operations. */ - src += 3; dst += 6; /* adjust for smaller buffers. */ - while (i) { /* convert backwards, since output is growing in-place. */ + src += 3; + dst += 6; /* adjust for smaller buffers. */ + while (i) { /* convert backwards, since output is growing in-place. */ const float srcFC = src[0]; dst[1] /* FR */ = srcFC; dst[0] /* FL */ = srcFC; - i--; src--; dst -= 2; + i--; + src--; + dst -= 2; } cvt->len_cvt *= 2; if (cvt->filters[++cvt->filter_index]) { - cvt->filters[cvt->filter_index] (cvt, format); + cvt->filters[cvt->filter_index](cvt, format); } } #endif - /* Include the autogenerated channel converters... */ #include "SDL_audio_channel_converters.h" - - /* SDL's resampler uses a "bandlimited interpolation" algorithm: https://ccrma.stanford.edu/~jos/resample/ */ #include "SDL_audio_resampler_filter.h" -static int -ResamplerPadding(const int inrate, const int outrate) +static Sint32 ResamplerPadding(const Sint32 inrate, const Sint32 outrate) { + /* This function uses integer arithmetics to avoid precision loss caused + * by large floating point numbers. Sint32 is needed for the large number + * multiplication. The integers are assumed to be non-negative so that + * division rounds by truncation. */ if (inrate == outrate) { return 0; } if (inrate > outrate) { - return (int) SDL_ceilf(((float) (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * inrate) / ((float) outrate))); + return (RESAMPLER_SAMPLES_PER_ZERO_CROSSING * inrate + outrate - 1) / outrate; } return RESAMPLER_SAMPLES_PER_ZERO_CROSSING; } -/* lpadding and rpadding are expected to be buffers of (ResamplePadding(inrate, outrate) * chans * sizeof (float)) bytes. */ -static int -SDL_ResampleAudio(const int chans, const int inrate, const int outrate, - const float *lpadding, const float *rpadding, - const float *inbuf, const int inbuflen, - float *outbuf, const int outbuflen) +/* lpadding and rpadding are expected to be buffers of (ResamplePadding(inrate, outrate) * chans * sizeof(float)) bytes. */ +static int SDL_ResampleAudio(const int chans, const int inrate, const int outrate, + const float *lpadding, const float *rpadding, + const float *inbuf, const int inbuflen, + float *outbuf, const int outbuflen) { - /* Note that this used to be double, but it looks like we can get by with float in most cases at - almost twice the speed on Intel processors, and orders of magnitude more - on CPUs that need a software fallback for double calculations. */ - typedef float ResampleFloatType; - - const ResampleFloatType finrate = (ResampleFloatType) inrate; - const ResampleFloatType outtimeincr = ((ResampleFloatType) 1.0f) / ((ResampleFloatType) outrate); - const ResampleFloatType ratio = ((float) outrate) / ((float) inrate); + /* This function uses integer arithmetics to avoid precision loss caused + * by large floating point numbers. For some operations, Sint32 or Sint64 + * are needed for the large number multiplications. The input integers are + * assumed to be non-negative so that division rounds by truncation and + * modulo is always non-negative. Note that the operator order is important + * for these integer divisions. */ const int paddinglen = ResamplerPadding(inrate, outrate); - const int framelen = chans * (int)sizeof (float); + const int framelen = chans * (int)sizeof(float); const int inframes = inbuflen / framelen; - const int wantedoutframes = (int) ((inbuflen / framelen) * ratio); /* outbuflen isn't total to write, it's total available. */ + /* outbuflen isn't total to write, it's total available. */ + const int wantedoutframes = (int)((Sint64)inframes * outrate / inrate); const int maxoutframes = outbuflen / framelen; const int outframes = SDL_min(wantedoutframes, maxoutframes); - ResampleFloatType outtime = 0.0f; float *dst = outbuf; int i, j, chan; for (i = 0; i < outframes; i++) { - const int srcindex = (int) (outtime * inrate); - const ResampleFloatType intime = ((ResampleFloatType) srcindex) / finrate; - const ResampleFloatType innexttime = ((ResampleFloatType) (srcindex + 1)) / finrate; - const ResampleFloatType indeltatime = innexttime - intime; - const ResampleFloatType interpolation1 = (indeltatime == 0.0f) ? 1.0f : (1.0f - ((innexttime - outtime) / indeltatime)); - const int filterindex1 = (int) (interpolation1 * RESAMPLER_SAMPLES_PER_ZERO_CROSSING); - const ResampleFloatType interpolation2 = 1.0f - interpolation1; - const int filterindex2 = (int) (interpolation2 * RESAMPLER_SAMPLES_PER_ZERO_CROSSING); + const int srcindex = (int)((Sint64)i * inrate / outrate); + /* Calculating the following way avoids subtraction or modulo of large + * floats which have low result precision. + * interpolation1 + * = (i / outrate * inrate) - floor(i / outrate * inrate) + * = mod(i / outrate * inrate, 1) + * = mod(i * inrate, outrate) / outrate */ + const int srcfraction = ((Sint64)i) * inrate % outrate; + const float interpolation1 = ((float)srcfraction) / ((float)outrate); + const int filterindex1 = ((Sint32)srcfraction) * RESAMPLER_SAMPLES_PER_ZERO_CROSSING / outrate; + const float interpolation2 = 1.0f - interpolation1; + const int filterindex2 = ((Sint32)(outrate - srcfraction)) * RESAMPLER_SAMPLES_PER_ZERO_CROSSING / outrate; for (chan = 0; chan < chans; chan++) { float outsample = 0.0f; /* do this twice to calculate the sample, once for the "left wing" and then same for the right. */ for (j = 0; (filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) { + const int filt_ind = filterindex1 + j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING; const int srcframe = srcindex - j; /* !!! FIXME: we can bubble this conditional out of here by doing a pre loop. */ const float insample = (srcframe < 0) ? lpadding[((paddinglen + srcframe) * chans) + chan] : inbuf[(srcframe * chans) + chan]; - outsample += (float)(insample * (ResamplerFilter[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)] + (interpolation1 * ResamplerFilterDifference[filterindex1 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)]))); + outsample += (float) (insample * (ResamplerFilter[filt_ind] + (interpolation1 * ResamplerFilterDifference[filt_ind]))); } /* Do the right wing! */ for (j = 0; (filterindex2 + (j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING)) < RESAMPLER_FILTER_SIZE; j++) { - const int jsamples = j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING; + const int filt_ind = filterindex2 + j * RESAMPLER_SAMPLES_PER_ZERO_CROSSING; const int srcframe = srcindex + 1 + j; /* !!! FIXME: we can bubble this conditional out of here by doing a post loop. */ const float insample = (srcframe >= inframes) ? rpadding[((srcframe - inframes) * chans) + chan] : inbuf[(srcframe * chans) + chan]; - outsample += (float)(insample * (ResamplerFilter[filterindex2 + jsamples] + (interpolation2 * ResamplerFilterDifference[filterindex2 + jsamples]))); + outsample += (float) (insample * (ResamplerFilter[filt_ind] + (interpolation2 * ResamplerFilterDifference[filt_ind]))); } *(dst++) = outsample; } - - outtime = outtimeincr * i; } - return outframes * chans * sizeof (float); + return outframes * chans * sizeof(float); } -int -SDL_ConvertAudio(SDL_AudioCVT * cvt) +int SDL_ConvertAudio(SDL_AudioCVT *cvt) { /* !!! FIXME: (cvt) should be const; stack-copy it here. */ /* !!! FIXME: (actually, we can't...len_cvt needs to be updated. Grr.) */ /* Make sure there's data to convert */ - if (cvt->buf == NULL) { + if (!cvt->buf) { return SDL_SetError("No buffer allocated for conversion"); } @@ -272,35 +278,37 @@ SDL_ConvertAudio(SDL_AudioCVT * cvt) /* Set up the conversion and go! */ cvt->filter_index = 0; - cvt->filters[0] (cvt, cvt->src_format); + cvt->filters[0](cvt, cvt->src_format); return 0; } -static void SDLCALL -SDL_Convert_Byteswap(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_Byteswap(SDL_AudioCVT *cvt, SDL_AudioFormat format) { #if DEBUG_CONVERT SDL_Log("SDL_AUDIO_CONVERT: Converting byte order\n"); #endif switch (SDL_AUDIO_BITSIZE(format)) { - #define CASESWAP(b) \ - case b: { \ - Uint##b *ptr = (Uint##b *) cvt->buf; \ - int i; \ - for (i = cvt->len_cvt / sizeof (*ptr); i; --i, ++ptr) { \ - *ptr = SDL_Swap##b(*ptr); \ - } \ - break; \ - } +#define CASESWAP(b) \ + case b: \ + { \ + Uint##b *ptr = (Uint##b *)cvt->buf; \ + int i; \ + for (i = cvt->len_cvt / sizeof(*ptr); i; --i, ++ptr) { \ + *ptr = SDL_Swap##b(*ptr); \ + } \ + break; \ + } CASESWAP(16); CASESWAP(32); CASESWAP(64); - #undef CASESWAP +#undef CASESWAP - default: SDL_assert(!"unhandled byteswap datatype!"); break; + default: + SDL_assert(!"unhandled byteswap datatype!"); + break; } if (cvt->filters[++cvt->filter_index]) { @@ -314,8 +322,7 @@ SDL_Convert_Byteswap(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static int -SDL_AddAudioCVTFilter(SDL_AudioCVT *cvt, const SDL_AudioFilter filter) +static int SDL_AddAudioCVTFilter(SDL_AudioCVT *cvt, SDL_AudioFilter filter) { if (cvt->filter_index >= SDL_AUDIOCVT_MAX_FILTERS) { return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS); @@ -326,16 +333,15 @@ SDL_AddAudioCVTFilter(SDL_AudioCVT *cvt, const SDL_AudioFilter filter) return 0; } -static int -SDL_BuildAudioTypeCVTToFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat src_fmt) +static int SDL_BuildAudioTypeCVTToFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat src_fmt) { - int retval = 0; /* 0 == no conversion necessary. */ + int retval = 0; /* 0 == no conversion necessary. */ if ((SDL_AUDIO_ISBIGENDIAN(src_fmt) != 0) == (SDL_BYTEORDER == SDL_LIL_ENDIAN) && SDL_AUDIO_BITSIZE(src_fmt) > 8) { if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) { return -1; } - retval = 1; /* added a converter. */ + retval = 1; /* added a converter. */ } if (!SDL_AUDIO_ISFLOAT(src_fmt)) { @@ -344,12 +350,24 @@ SDL_BuildAudioTypeCVTToFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat src_fmt) SDL_AudioFilter filter = NULL; switch (src_fmt & ~SDL_AUDIO_MASK_ENDIAN) { - case AUDIO_S8: filter = SDL_Convert_S8_to_F32; break; - case AUDIO_U8: filter = SDL_Convert_U8_to_F32; break; - case AUDIO_S16: filter = SDL_Convert_S16_to_F32; break; - case AUDIO_U16: filter = SDL_Convert_U16_to_F32; break; - case AUDIO_S32: filter = SDL_Convert_S32_to_F32; break; - default: SDL_assert(!"Unexpected audio format!"); break; + case AUDIO_S8: + filter = SDL_Convert_S8_to_F32; + break; + case AUDIO_U8: + filter = SDL_Convert_U8_to_F32; + break; + case AUDIO_S16: + filter = SDL_Convert_S16_to_F32; + break; + case AUDIO_U16: + filter = SDL_Convert_U16_to_F32; + break; + case AUDIO_S32: + filter = SDL_Convert_S32_to_F32; + break; + default: + SDL_assert(!"Unexpected audio format!"); + break; } if (!filter) { @@ -364,31 +382,43 @@ SDL_BuildAudioTypeCVTToFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat src_fmt) cvt->len_mult *= mult; cvt->len_ratio *= mult; } else if (src_bitsize > dst_bitsize) { - cvt->len_ratio /= (src_bitsize / dst_bitsize); + const int div = (src_bitsize / dst_bitsize); + cvt->len_ratio /= div; } - retval = 1; /* added a converter. */ + retval = 1; /* added a converter. */ } return retval; } -static int -SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt) +static int SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt) { - int retval = 0; /* 0 == no conversion necessary. */ + int retval = 0; /* 0 == no conversion necessary. */ if (!SDL_AUDIO_ISFLOAT(dst_fmt)) { const Uint16 dst_bitsize = SDL_AUDIO_BITSIZE(dst_fmt); const Uint16 src_bitsize = 32; SDL_AudioFilter filter = NULL; switch (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN) { - case AUDIO_S8: filter = SDL_Convert_F32_to_S8; break; - case AUDIO_U8: filter = SDL_Convert_F32_to_U8; break; - case AUDIO_S16: filter = SDL_Convert_F32_to_S16; break; - case AUDIO_U16: filter = SDL_Convert_F32_to_U16; break; - case AUDIO_S32: filter = SDL_Convert_F32_to_S32; break; - default: SDL_assert(!"Unexpected audio format!"); break; + case AUDIO_S8: + filter = SDL_Convert_F32_to_S8; + break; + case AUDIO_U8: + filter = SDL_Convert_F32_to_U8; + break; + case AUDIO_S16: + filter = SDL_Convert_F32_to_S16; + break; + case AUDIO_U16: + filter = SDL_Convert_F32_to_U16; + break; + case AUDIO_S32: + filter = SDL_Convert_F32_to_S32; + break; + default: + SDL_assert(!"Unexpected audio format!"); + break; } if (!filter) { @@ -406,14 +436,14 @@ SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt) const int div = (src_bitsize / dst_bitsize); cvt->len_ratio /= div; } - retval = 1; /* added a converter. */ + retval = 1; /* added a converter. */ } if ((SDL_AUDIO_ISBIGENDIAN(dst_fmt) != 0) == (SDL_BYTEORDER == SDL_LIL_ENDIAN) && SDL_AUDIO_BITSIZE(dst_fmt) > 8) { if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) { return -1; } - retval = 1; /* added a converter. */ + retval = 1; /* added a converter. */ } return retval; @@ -421,12 +451,11 @@ SDL_BuildAudioTypeCVTFromFloat(SDL_AudioCVT *cvt, const SDL_AudioFormat dst_fmt) #ifdef HAVE_LIBSAMPLERATE_H -static void -SDL_ResampleCVT_SRC(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format) +static void SDL_ResampleCVT_SRC(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; + const float *src = (const float *)cvt->buf; const int srclen = cvt->len_cvt; - float *dst = (float *) (cvt->buf + srclen); + float *dst = (float *)(cvt->buf + srclen); const int dstlen = (cvt->len * cvt->len_mult) - srclen; const int framelen = sizeof(float) * chans; int result = 0; @@ -443,12 +472,14 @@ SDL_ResampleCVT_SRC(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat fo data.src_ratio = cvt->rate_incr; result = SRC_src_simple(&data, SRC_converter, chans); /* Simple API converts the whole buffer at once. No need for initialization. */ - /* !!! FIXME: Handle library failures? */ - #ifdef DEBUG_CONVERT +/* !!! FIXME: Handle library failures? */ +#if DEBUG_CONVERT if (result != 0) { SDL_Log("src_simple() failed: %s", SRC_src_strerror(result)); } - #endif +#else + (void)result; +#endif cvt->len_cvt = data.output_frames_gen * framelen; @@ -461,20 +492,19 @@ SDL_ResampleCVT_SRC(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat fo #endif /* HAVE_LIBSAMPLERATE_H */ -static void -SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format) +static void SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format) { /* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator). !!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates, !!! FIXME in 2.1: so we steal the ninth and tenth slot. :( */ - const int inrate = (int) (size_t) cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1]; - const int outrate = (int) (size_t) cvt->filters[SDL_AUDIOCVT_MAX_FILTERS]; - const float *src = (const float *) cvt->buf; + const int inrate = (int)(size_t)cvt->filters[SDL_AUDIOCVT_MAX_FILTERS - 1]; + const int outrate = (int)(size_t)cvt->filters[SDL_AUDIOCVT_MAX_FILTERS]; + const float *src = (const float *)cvt->buf; const int srclen = cvt->len_cvt; /*float *dst = (float *) cvt->buf; const int dstlen = (cvt->len * cvt->len_mult);*/ /* !!! FIXME: remove this if we can get the resampler to work in-place again. */ - float *dst = (float *) (cvt->buf + srclen); + float *dst = (float *)(cvt->buf + srclen); const int dstlen = (cvt->len * cvt->len_mult) - srclen; const int requestedpadding = ResamplerPadding(inrate, outrate); int paddingsamples; @@ -488,7 +518,7 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format SDL_assert(format == AUDIO_F32SYS); /* we keep no streaming state here, so pad with silence on both ends. */ - padding = (float *) SDL_calloc(paddingsamples ? paddingsamples : 1, sizeof (float)); + padding = (float *)SDL_calloc(paddingsamples ? paddingsamples : 1, sizeof(float)); if (!padding) { SDL_OutOfMemory(); return; @@ -498,7 +528,7 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format SDL_free(padding); - SDL_memmove(cvt->buf, dst, cvt->len_cvt); /* !!! FIXME: remove this if we can get the resampler to work in-place again. */ + SDL_memmove(cvt->buf, dst, cvt->len_cvt); /* !!! FIXME: remove this if we can get the resampler to work in-place again. */ if (cvt->filters[++cvt->filter_index]) { cvt->filters[cvt->filter_index](cvt, format); @@ -509,10 +539,11 @@ SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format !!! FIXME: store channel info, so we have to have function entry !!! FIXME: points for each supported channel count and multiple !!! FIXME: vs arbitrary. When we rev the ABI, clean this up. */ -#define RESAMPLER_FUNCS(chans) \ - static void SDLCALL \ - SDL_ResampleCVT_c##chans(SDL_AudioCVT *cvt, SDL_AudioFormat format) { \ - SDL_ResampleCVT(cvt, chans, format); \ +#define RESAMPLER_FUNCS(chans) \ + static void SDLCALL \ + SDL_ResampleCVT_c##chans(SDL_AudioCVT *cvt, SDL_AudioFormat format) \ + { \ + SDL_ResampleCVT(cvt, chans, format); \ } RESAMPLER_FUNCS(1) RESAMPLER_FUNCS(2) @@ -522,10 +553,11 @@ RESAMPLER_FUNCS(8) #undef RESAMPLER_FUNCS #ifdef HAVE_LIBSAMPLERATE_H -#define RESAMPLER_FUNCS(chans) \ - static void SDLCALL \ - SDL_ResampleCVT_SRC_c##chans(SDL_AudioCVT *cvt, SDL_AudioFormat format) { \ - SDL_ResampleCVT_SRC(cvt, chans, format); \ +#define RESAMPLER_FUNCS(chans) \ + static void SDLCALL \ + SDL_ResampleCVT_SRC_c##chans(SDL_AudioCVT *cvt, SDL_AudioFormat format) \ + { \ + SDL_ResampleCVT_SRC(cvt, chans, format); \ } RESAMPLER_FUNCS(1) RESAMPLER_FUNCS(2) @@ -535,46 +567,56 @@ RESAMPLER_FUNCS(8) #undef RESAMPLER_FUNCS #endif /* HAVE_LIBSAMPLERATE_H */ -static SDL_AudioFilter -ChooseCVTResampler(const int dst_channels) +static SDL_AudioFilter ChooseCVTResampler(const int dst_channels) { - #ifdef HAVE_LIBSAMPLERATE_H +#ifdef HAVE_LIBSAMPLERATE_H if (SRC_available) { switch (dst_channels) { - case 1: return SDL_ResampleCVT_SRC_c1; - case 2: return SDL_ResampleCVT_SRC_c2; - case 4: return SDL_ResampleCVT_SRC_c4; - case 6: return SDL_ResampleCVT_SRC_c6; - case 8: return SDL_ResampleCVT_SRC_c8; - default: break; + case 1: + return SDL_ResampleCVT_SRC_c1; + case 2: + return SDL_ResampleCVT_SRC_c2; + case 4: + return SDL_ResampleCVT_SRC_c4; + case 6: + return SDL_ResampleCVT_SRC_c6; + case 8: + return SDL_ResampleCVT_SRC_c8; + default: + break; } } - #endif /* HAVE_LIBSAMPLERATE_H */ +#endif /* HAVE_LIBSAMPLERATE_H */ switch (dst_channels) { - case 1: return SDL_ResampleCVT_c1; - case 2: return SDL_ResampleCVT_c2; - case 4: return SDL_ResampleCVT_c4; - case 6: return SDL_ResampleCVT_c6; - case 8: return SDL_ResampleCVT_c8; - default: break; + case 1: + return SDL_ResampleCVT_c1; + case 2: + return SDL_ResampleCVT_c2; + case 4: + return SDL_ResampleCVT_c4; + case 6: + return SDL_ResampleCVT_c6; + case 8: + return SDL_ResampleCVT_c8; + default: + break; } return NULL; } -static int -SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, const int dst_channels, - const int src_rate, const int dst_rate) +static int SDL_BuildAudioResampleCVT(SDL_AudioCVT *cvt, const int dst_channels, + const int src_rate, const int dst_rate) { SDL_AudioFilter filter; if (src_rate == dst_rate) { - return 0; /* no conversion necessary. */ + return 0; /* no conversion necessary. */ } filter = ChooseCVTResampler(dst_channels); - if (filter == NULL) { + if (!filter) { return SDL_SetError("No conversion available for these rates"); } @@ -586,18 +628,18 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, const int dst_channels, /* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator). !!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates, !!! FIXME in 2.1: so we steal the ninth and tenth slot. :( */ - if (cvt->filter_index >= (SDL_AUDIOCVT_MAX_FILTERS-2)) { - return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS-2); + if (cvt->filter_index >= (SDL_AUDIOCVT_MAX_FILTERS - 2)) { + return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS - 2); } - cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1] = (SDL_AudioFilter) (uintptr_t) src_rate; - cvt->filters[SDL_AUDIOCVT_MAX_FILTERS] = (SDL_AudioFilter) (uintptr_t) dst_rate; + cvt->filters[SDL_AUDIOCVT_MAX_FILTERS - 1] = (SDL_AudioFilter)(uintptr_t)src_rate; + cvt->filters[SDL_AUDIOCVT_MAX_FILTERS] = (SDL_AudioFilter)(uintptr_t)dst_rate; if (src_rate < dst_rate) { - const double mult = ((double) dst_rate) / ((double) src_rate); - cvt->len_mult *= (int) SDL_ceil(mult); + const double mult = ((double)dst_rate) / ((double)src_rate); + cvt->len_mult *= (int)SDL_ceil(mult); cvt->len_ratio *= mult; } else { - cvt->len_ratio /= ((double) src_rate) / ((double) dst_rate); + cvt->len_ratio /= ((double)src_rate) / ((double)dst_rate); } /* !!! FIXME: remove this if we can get the resampler to work in-place again. */ @@ -605,63 +647,59 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, const int dst_channels, we need it large enough to hold a separate scratch buffer. */ cvt->len_mult *= 2; - return 1; /* added a converter. */ + return 1; /* added a converter. */ } -static SDL_bool -SDL_SupportedAudioFormat(const SDL_AudioFormat fmt) +static SDL_bool SDL_SupportedAudioFormat(const SDL_AudioFormat fmt) { switch (fmt) { - case AUDIO_U8: - case AUDIO_S8: - case AUDIO_U16LSB: - case AUDIO_S16LSB: - case AUDIO_U16MSB: - case AUDIO_S16MSB: - case AUDIO_S32LSB: - case AUDIO_S32MSB: - case AUDIO_F32LSB: - case AUDIO_F32MSB: - return SDL_TRUE; /* supported. */ - - default: - break; - } - - return SDL_FALSE; /* unsupported. */ + case AUDIO_U8: + case AUDIO_S8: + case AUDIO_U16LSB: + case AUDIO_S16LSB: + case AUDIO_U16MSB: + case AUDIO_S16MSB: + case AUDIO_S32LSB: + case AUDIO_S32MSB: + case AUDIO_F32LSB: + case AUDIO_F32MSB: + return SDL_TRUE; /* supported. */ + + default: + break; + } + + return SDL_FALSE; /* unsupported. */ } -static SDL_bool -SDL_SupportedChannelCount(const int channels) +static SDL_bool SDL_SupportedChannelCount(const int channels) { return ((channels >= 1) && (channels <= 8)) ? SDL_TRUE : SDL_FALSE; } - /* Creates a set of audio filters to convert from one format to another. Returns 0 if no conversion is needed, 1 if the audio filter is set up, or -1 if an error like invalid parameter, unsupported format, etc. occurred. */ -int -SDL_BuildAudioCVT(SDL_AudioCVT * cvt, - SDL_AudioFormat src_fmt, Uint8 src_channels, int src_rate, - SDL_AudioFormat dst_fmt, Uint8 dst_channels, int dst_rate) +int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, + SDL_AudioFormat src_format, Uint8 src_channels, int src_rate, + SDL_AudioFormat dst_format, Uint8 dst_channels, int dst_rate) { SDL_AudioFilter channel_converter = NULL; /* Sanity check target pointer */ - if (cvt == NULL) { + if (!cvt) { return SDL_InvalidParamError("cvt"); } /* Make sure we zero out the audio conversion before error checking */ SDL_zerop(cvt); - if (!SDL_SupportedAudioFormat(src_fmt)) { + if (!SDL_SupportedAudioFormat(src_format)) { return SDL_SetError("Invalid source format"); } - if (!SDL_SupportedAudioFormat(dst_fmt)) { + if (!SDL_SupportedAudioFormat(dst_format)) { return SDL_SetError("Invalid destination format"); } if (!SDL_SupportedChannelCount(src_channels)) { @@ -685,18 +723,18 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, #if DEBUG_CONVERT SDL_Log("SDL_AUDIO_CONVERT: Build format %04x->%04x, channels %u->%u, rate %d->%d\n", - src_fmt, dst_fmt, src_channels, dst_channels, src_rate, dst_rate); + src_format, dst_format, src_channels, dst_channels, src_rate, dst_rate); #endif /* Start off with no conversion necessary */ - cvt->src_format = src_fmt; - cvt->dst_format = dst_fmt; + cvt->src_format = src_format; + cvt->dst_format = dst_format; cvt->needed = 0; cvt->filter_index = 0; SDL_zeroa(cvt->filters); cvt->len_mult = 1; cvt->len_ratio = 1.0; - cvt->rate_incr = ((double) dst_rate) / ((double) src_rate); + cvt->rate_incr = ((double)dst_rate) / ((double)src_rate); /* Make sure we've chosen audio conversion functions (SIMD, scalar, etc.) */ SDL_ChooseAudioConverters(); @@ -717,13 +755,13 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, /* see if we can skip float conversion entirely. */ if (src_rate == dst_rate && src_channels == dst_channels) { - if (src_fmt == dst_fmt) { + if (src_format == dst_format) { return 0; } /* just a byteswap needed? */ - if ((src_fmt & ~SDL_AUDIO_MASK_ENDIAN) == (dst_fmt & ~SDL_AUDIO_MASK_ENDIAN)) { - if (SDL_AUDIO_BITSIZE(dst_fmt) == 8) { + if ((src_format & ~SDL_AUDIO_MASK_ENDIAN) == (dst_format & ~SDL_AUDIO_MASK_ENDIAN)) { + if (SDL_AUDIO_BITSIZE(dst_format) == 8) { return 0; } if (SDL_AddAudioCVTFilter(cvt, SDL_Convert_Byteswap) < 0) { @@ -735,35 +773,42 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, } /* Convert data types, if necessary. Updates (cvt). */ - if (SDL_BuildAudioTypeCVTToFloat(cvt, src_fmt) < 0) { - return -1; /* shouldn't happen, but just in case... */ + if (SDL_BuildAudioTypeCVTToFloat(cvt, src_format) < 0) { + return -1; /* shouldn't happen, but just in case... */ } - /* Channel conversion */ /* SDL_SupportedChannelCount should have caught these asserts, or we added a new format and forgot to update the table. */ SDL_assert(src_channels <= SDL_arraysize(channel_converters)); SDL_assert(dst_channels <= SDL_arraysize(channel_converters[0])); - channel_converter = channel_converters[src_channels-1][dst_channels-1]; - if ((channel_converter == NULL) != (src_channels == dst_channels)) { + channel_converter = channel_converters[src_channels - 1][dst_channels - 1]; + if ((!channel_converter) != (src_channels == dst_channels)) { /* All combinations of supported channel counts should have been handled by now, but let's be defensive */ return SDL_SetError("Invalid channel combination"); } else if (channel_converter != NULL) { /* swap in some SIMD versions for a few of these. */ if (channel_converter == SDL_ConvertStereoToMono) { SDL_AudioFilter filter = NULL; - #if HAVE_SSE3_INTRINSICS - if (!filter && SDL_HasSSE3()) { filter = SDL_ConvertStereoToMono_SSE3; } - #endif - if (filter) { channel_converter = filter; } +#ifdef HAVE_SSE3_INTRINSICS + if (!filter && SDL_HasSSE3()) { + filter = SDL_ConvertStereoToMono_SSE3; + } +#endif + if (filter) { + channel_converter = filter; + } } else if (channel_converter == SDL_ConvertMonoToStereo) { SDL_AudioFilter filter = NULL; - #if HAVE_SSE_INTRINSICS - if (!filter && SDL_HasSSE()) { filter = SDL_ConvertMonoToStereo_SSE; } - #endif - if (filter) { channel_converter = filter; } +#ifdef HAVE_SSE_INTRINSICS + if (!filter && SDL_HasSSE()) { + filter = SDL_ConvertMonoToStereo_SSE; + } +#endif + if (filter) { + channel_converter = filter; + } } if (SDL_AddAudioCVTFilter(cvt, channel_converter) < 0) { @@ -771,7 +816,7 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, } if (src_channels < dst_channels) { - cvt->len_mult = ((cvt->len_mult * dst_channels) + (src_channels-1)) / src_channels; + cvt->len_mult = ((cvt->len_mult * dst_channels) + (src_channels - 1)) / src_channels; } cvt->len_ratio = (cvt->len_ratio * dst_channels) / src_channels; @@ -780,16 +825,16 @@ SDL_BuildAudioCVT(SDL_AudioCVT * cvt, /* Do rate conversion, if necessary. Updates (cvt). */ if (SDL_BuildAudioResampleCVT(cvt, dst_channels, src_rate, dst_rate) < 0) { - return -1; /* shouldn't happen, but just in case... */ + return -1; /* shouldn't happen, but just in case... */ } /* Move to final data type. */ - if (SDL_BuildAudioTypeCVTFromFloat(cvt, dst_fmt) < 0) { - return -1; /* shouldn't happen, but just in case... */ + if (SDL_BuildAudioTypeCVTFromFloat(cvt, dst_format) < 0) { + return -1; /* shouldn't happen, but just in case... */ } cvt->needed = (cvt->filter_index != 0); - return (cvt->needed); + return cvt->needed; } typedef int (*SDL_ResampleAudioStreamFunc)(SDL_AudioStream *stream, const void *inbuf, const int inbuflen, void *outbuf, const int outbuflen); @@ -805,7 +850,7 @@ struct _SDL_AudioStream Uint8 *staging_buffer; int staging_buffer_size; int staging_buffer_filled; - Uint8 *work_buffer_base; /* maybe unaligned pointer from SDL_realloc(). */ + Uint8 *work_buffer_base; /* maybe unaligned pointer from SDL_realloc(). */ int work_buffer_len; int src_sample_frame_size; SDL_AudioFormat src_format; @@ -826,8 +871,7 @@ struct _SDL_AudioStream SDL_CleanupAudioStreamResamplerFunc cleanup_resampler_func; }; -static Uint8 * -EnsureStreamBufferSize(SDL_AudioStream *stream, const int newlen) +static Uint8 *EnsureStreamBufferSize(SDL_AudioStream *stream, int newlen) { Uint8 *ptr; size_t offset; @@ -835,7 +879,7 @@ EnsureStreamBufferSize(SDL_AudioStream *stream, const int newlen) if (stream->work_buffer_len >= newlen) { ptr = stream->work_buffer_base; } else { - ptr = (Uint8 *) SDL_realloc(stream->work_buffer_base, newlen + 32); + ptr = (Uint8 *)SDL_realloc(stream->work_buffer_base, (size_t)newlen + 32); if (!ptr) { SDL_OutOfMemory(); return NULL; @@ -845,22 +889,21 @@ EnsureStreamBufferSize(SDL_AudioStream *stream, const int newlen) stream->work_buffer_len = newlen; } - offset = ((size_t) ptr) & 15; + offset = ((size_t)ptr) & 15; return offset ? ptr + (16 - offset) : ptr; } #ifdef HAVE_LIBSAMPLERATE_H -static int -SDL_ResampleAudioStream_SRC(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen) +static int SDL_ResampleAudioStream_SRC(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen) { - const float *inbuf = (const float *) _inbuf; - float *outbuf = (float *) _outbuf; + const float *inbuf = (const float *)_inbuf; + float *outbuf = (float *)_outbuf; const int framelen = sizeof(float) * stream->pre_resample_channels; SRC_STATE *state = (SRC_STATE *)stream->resampler_state; SRC_DATA data; int result; - SDL_assert(inbuf != ((const float *) outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */ + SDL_assert(inbuf != ((const float *)outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */ data.data_in = (float *)inbuf; /* Older versions of libsamplerate had a non-const pointer, but didn't write to it */ data.input_frames = inbuflen / framelen; @@ -884,14 +927,12 @@ SDL_ResampleAudioStream_SRC(SDL_AudioStream *stream, const void *_inbuf, const i return data.output_frames_gen * (sizeof(float) * stream->pre_resample_channels); } -static void -SDL_ResetAudioStreamResampler_SRC(SDL_AudioStream *stream) +static void SDL_ResetAudioStreamResampler_SRC(SDL_AudioStream *stream) { SRC_src_reset((SRC_STATE *)stream->resampler_state); } -static void -SDL_CleanupAudioStreamResampler_SRC(SDL_AudioStream *stream) +static void SDL_CleanupAudioStreamResampler_SRC(SDL_AudioStream *stream) { SRC_STATE *state = (SRC_STATE *)stream->resampler_state; if (state) { @@ -904,8 +945,7 @@ SDL_CleanupAudioStreamResampler_SRC(SDL_AudioStream *stream) stream->cleanup_resampler_func = NULL; } -static SDL_bool -SetupLibSampleRateResampling(SDL_AudioStream *stream) +static SDL_bool SetupLibSampleRateResampling(SDL_AudioStream *stream) { int result = 0; SRC_STATE *state = NULL; @@ -931,59 +971,64 @@ SetupLibSampleRateResampling(SDL_AudioStream *stream) } #endif /* HAVE_LIBSAMPLERATE_H */ - -static int -SDL_ResampleAudioStream(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen) +static int SDL_ResampleAudioStream(SDL_AudioStream *stream, const void *_inbuf, const int inbuflen, void *_outbuf, const int outbuflen) { - const Uint8 *inbufend = ((const Uint8 *) _inbuf) + inbuflen; - const float *inbuf = (const float *) _inbuf; - float *outbuf = (float *) _outbuf; - const int chans = (int) stream->pre_resample_channels; + const Uint8 *inbufend = ((const Uint8 *)_inbuf) + inbuflen; + const float *inbuf = (const float *)_inbuf; + float *outbuf = (float *)_outbuf; + const int chans = (int)stream->pre_resample_channels; const int inrate = stream->src_rate; const int outrate = stream->dst_rate; const int paddingsamples = stream->resampler_padding_samples; - const int paddingbytes = paddingsamples * sizeof (float); - float *lpadding = (float *) stream->resampler_state; - const float *rpadding = (const float *) inbufend; /* we set this up so there are valid padding samples at the end of the input buffer. */ + const int paddingbytes = paddingsamples * sizeof(float); + float *lpadding = (float *)stream->resampler_state; + const float *rpadding = (const float *)inbufend; /* we set this up so there are valid padding samples at the end of the input buffer. */ const int cpy = SDL_min(inbuflen, paddingbytes); int retval; - SDL_assert(inbuf != ((const float *) outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */ + SDL_assert(inbuf != ((const float *)outbuf)); /* SDL_AudioStreamPut() shouldn't allow in-place resamples. */ retval = SDL_ResampleAudio(chans, inrate, outrate, lpadding, rpadding, inbuf, inbuflen, outbuf, outbuflen); /* update our left padding with end of current input, for next run. */ - SDL_memcpy((lpadding + paddingsamples) - (cpy / sizeof (float)), inbufend - cpy, cpy); + SDL_memcpy((lpadding + paddingsamples) - (cpy / sizeof(float)), inbufend - cpy, cpy); return retval; } -static void -SDL_ResetAudioStreamResampler(SDL_AudioStream *stream) +static void SDL_ResetAudioStreamResampler(SDL_AudioStream *stream) { /* set all the padding to silence. */ const int len = stream->resampler_padding_samples; - SDL_memset(stream->resampler_state, '\0', len * sizeof (float)); + SDL_memset(stream->resampler_state, '\0', len * sizeof(float)); } -static void -SDL_CleanupAudioStreamResampler(SDL_AudioStream *stream) +static void SDL_CleanupAudioStreamResampler(SDL_AudioStream *stream) { SDL_free(stream->resampler_state); } -SDL_AudioStream * -SDL_NewAudioStream(const SDL_AudioFormat src_format, +SDL_AudioStream *SDL_NewAudioStream(const SDL_AudioFormat src_format, const Uint8 src_channels, const int src_rate, const SDL_AudioFormat dst_format, const Uint8 dst_channels, const int dst_rate) { - const int packetlen = 4096; /* !!! FIXME: good enough for now. */ + int packetlen = 4096; /* !!! FIXME: good enough for now. */ Uint8 pre_resample_channels; SDL_AudioStream *retval; - retval = (SDL_AudioStream *) SDL_calloc(1, sizeof (SDL_AudioStream)); + if (src_channels == 0) { + SDL_InvalidParamError("src_channels"); + return NULL; + } + + if (dst_channels == 0) { + SDL_InvalidParamError("dst_channels"); + return NULL; + } + + retval = (SDL_AudioStream *)SDL_calloc(1, sizeof(SDL_AudioStream)); if (!retval) { SDL_OutOfMemory(); return NULL; @@ -1006,11 +1051,11 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, retval->dst_rate = dst_rate; retval->pre_resample_channels = pre_resample_channels; retval->packetlen = packetlen; - retval->rate_incr = ((double) dst_rate) / ((double) src_rate); + retval->rate_incr = ((double)dst_rate) / ((double)src_rate); retval->resampler_padding_samples = ResamplerPadding(retval->src_rate, retval->dst_rate) * pre_resample_channels; - retval->resampler_padding = (float *) SDL_calloc(retval->resampler_padding_samples ? retval->resampler_padding_samples : 1, sizeof (float)); + retval->resampler_padding = (float *)SDL_calloc(retval->resampler_padding_samples ? retval->resampler_padding_samples : 1, sizeof(float)); - if (retval->resampler_padding == NULL) { + if (!retval->resampler_padding) { SDL_FreeAudioStream(retval); SDL_OutOfMemory(); return NULL; @@ -1018,8 +1063,8 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, retval->staging_buffer_size = ((retval->resampler_padding_samples / retval->pre_resample_channels) * retval->src_sample_frame_size); if (retval->staging_buffer_size > 0) { - retval->staging_buffer = (Uint8 *) SDL_malloc(retval->staging_buffer_size); - if (retval->staging_buffer == NULL) { + retval->staging_buffer = (Uint8 *)SDL_malloc(retval->staging_buffer_size); + if (!retval->staging_buffer) { SDL_FreeAudioStream(retval); SDL_OutOfMemory(); return NULL; @@ -1031,14 +1076,14 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, retval->cvt_before_resampling.needed = SDL_FALSE; if (SDL_BuildAudioCVT(&retval->cvt_after_resampling, src_format, src_channels, dst_rate, dst_format, dst_channels, dst_rate) < 0) { SDL_FreeAudioStream(retval); - return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ + return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ } } else { /* Don't resample at first. Just get us to Float32 format. */ /* !!! FIXME: convert to int32 on devices without hardware float. */ if (SDL_BuildAudioCVT(&retval->cvt_before_resampling, src_format, src_channels, src_rate, AUDIO_F32SYS, pre_resample_channels, src_rate) < 0) { SDL_FreeAudioStream(retval); - return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ + return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ } #ifdef HAVE_LIBSAMPLERATE_H @@ -1046,7 +1091,7 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, #endif if (!retval->resampler_func) { - retval->resampler_state = SDL_calloc(retval->resampler_padding_samples, sizeof (float)); + retval->resampler_state = SDL_calloc(retval->resampler_padding_samples, sizeof(float)); if (!retval->resampler_state) { SDL_FreeAudioStream(retval); SDL_OutOfMemory(); @@ -1061,21 +1106,20 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format, /* Convert us to the final format after resampling. */ if (SDL_BuildAudioCVT(&retval->cvt_after_resampling, AUDIO_F32SYS, pre_resample_channels, dst_rate, dst_format, dst_channels, dst_rate) < 0) { SDL_FreeAudioStream(retval); - return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ + return NULL; /* SDL_BuildAudioCVT should have called SDL_SetError. */ } } - retval->queue = SDL_NewDataQueue(packetlen, packetlen * 2); + retval->queue = SDL_NewDataQueue(packetlen, (size_t)packetlen * 2); if (!retval->queue) { SDL_FreeAudioStream(retval); - return NULL; /* SDL_NewDataQueue should have called SDL_SetError. */ + return NULL; /* SDL_NewDataQueue should have called SDL_SetError. */ } return retval; } -static int -SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, int *maxputbytes) +static int SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, int *maxputbytes) { int buflen = len; int workbuflen; @@ -1094,7 +1138,7 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in !!! FIXME: a few samples at the end and convert them separately. */ /* no padding prepended on first run. */ - neededpaddingbytes = stream->resampler_padding_samples * sizeof (float); + neededpaddingbytes = stream->resampler_padding_samples * sizeof(float); paddingbytes = stream->first_run ? 0 : neededpaddingbytes; stream->first_run = SDL_FALSE; @@ -1106,12 +1150,12 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in if (stream->dst_rate != stream->src_rate) { /* resamples can't happen in place, so make space for second buf. */ - const int framesize = stream->pre_resample_channels * sizeof (float); + const int framesize = stream->pre_resample_channels * sizeof(float); const int frames = workbuflen / framesize; - resamplebuflen = ((int) SDL_ceil(frames * stream->rate_incr)) * framesize; - #if DEBUG_AUDIOSTREAM + resamplebuflen = ((int)SDL_ceil(frames * stream->rate_incr)) * framesize; +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: will resample %d bytes to %d (ratio=%.6f)\n", workbuflen, resamplebuflen, stream->rate_incr); - #endif +#endif workbuflen += resamplebuflen; } @@ -1122,16 +1166,16 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in workbuflen += neededpaddingbytes; - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: Putting %d bytes of preconverted audio, need %d byte work buffer\n", buflen, workbuflen); - #endif +#endif workbuf = EnsureStreamBufferSize(stream, workbuflen); if (!workbuf) { - return -1; /* probably out of memory. */ + return -1; /* probably out of memory. */ } - resamplebuf = workbuf; /* default if not resampling. */ + resamplebuf = workbuf; /* default if not resampling. */ SDL_memcpy(workbuf + paddingbytes, buf, buflen); @@ -1139,13 +1183,13 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in stream->cvt_before_resampling.buf = workbuf + paddingbytes; stream->cvt_before_resampling.len = buflen; if (SDL_ConvertAudio(&stream->cvt_before_resampling) == -1) { - return -1; /* uhoh! */ + return -1; /* uhoh! */ } buflen = stream->cvt_before_resampling.len_cvt; - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: After initial conversion we have %d bytes\n", buflen); - #endif +#endif } if (stream->dst_rate != stream->src_rate) { @@ -1162,7 +1206,7 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in /* save off the data at the end for the next run. */ SDL_memcpy(stream->resampler_padding, workbuf + (buflen - neededpaddingbytes), neededpaddingbytes); - resamplebuf = workbuf + buflen; /* skip to second piece of workbuf. */ + resamplebuf = workbuf + buflen; /* skip to second piece of workbuf. */ SDL_assert(buflen >= neededpaddingbytes); if (buflen > neededpaddingbytes) { buflen = stream->resampler_func(stream, workbuf, buflen - neededpaddingbytes, resamplebuf, resamplebuflen); @@ -1170,32 +1214,33 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in buflen = 0; } - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: After resampling we have %d bytes\n", buflen); - #endif +#endif } if (stream->cvt_after_resampling.needed && (buflen > 0)) { stream->cvt_after_resampling.buf = resamplebuf; stream->cvt_after_resampling.len = buflen; if (SDL_ConvertAudio(&stream->cvt_after_resampling) == -1) { - return -1; /* uhoh! */ + return -1; /* uhoh! */ } buflen = stream->cvt_after_resampling.len_cvt; - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: After final conversion we have %d bytes\n", buflen); - #endif +#endif } - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: Final output is %d bytes\n", buflen); - #endif +#endif if (maxputbytes) { const int maxbytes = *maxputbytes; - if (buflen > maxbytes) + if (buflen > maxbytes) { buflen = maxbytes; + } *maxputbytes -= buflen; } @@ -1203,8 +1248,7 @@ SDL_AudioStreamPutInternal(SDL_AudioStream *stream, const void *buf, int len, in return buflen ? SDL_WriteToDataQueue(stream->queue, resamplebuf, buflen) : 0; } -int -SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) +int SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) { /* !!! FIXME: several converters can take advantage of SIMD, but only !!! FIXME: if the data is aligned to 16 bytes. EnsureStreamBufferSize() @@ -1214,9 +1258,9 @@ SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) !!! FIXME: isn't a multiple of 16. In these cases, we should chop off !!! FIXME: a few samples at the end and convert them separately. */ - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: wants to put %d preconverted bytes\n", buflen); - #endif +#endif if (!stream) { return SDL_InvalidParamError("stream"); @@ -1225,7 +1269,7 @@ SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) return SDL_InvalidParamError("buf"); } if (len == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if ((len % stream->src_sample_frame_size) != 0) { return SDL_SetError("Can't add partial sample frames"); @@ -1234,9 +1278,9 @@ SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len) if (!stream->cvt_before_resampling.needed && (stream->dst_rate == stream->src_rate) && !stream->cvt_after_resampling.needed) { - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: no conversion needed at all, queueing %d bytes.\n", len); - #endif +#endif return SDL_WriteToDataQueue(stream->queue, buf, len); } @@ -1277,9 +1321,9 @@ int SDL_AudioStreamFlush(SDL_AudioStream *stream) return SDL_InvalidParamError("stream"); } - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: flushing! staging_buffer_filled=%d bytes\n", stream->staging_buffer_filled); - #endif +#endif /* shouldn't use a staging buffer if we're not resampling. */ SDL_assert((stream->dst_rate != stream->src_rate) || (stream->staging_buffer_filled == 0)); @@ -1291,16 +1335,17 @@ int SDL_AudioStreamFlush(SDL_AudioStream *stream) const SDL_bool first_run = stream->first_run; const int filled = stream->staging_buffer_filled; int actual_input_frames = filled / stream->src_sample_frame_size; - if (!first_run) + if (!first_run) { actual_input_frames += stream->resampler_padding_samples / stream->pre_resample_channels; + } - if (actual_input_frames > 0) { /* don't bother if nothing to flush. */ + if (actual_input_frames > 0) { /* don't bother if nothing to flush. */ /* This is how many bytes we're expecting without silence appended. */ - int flush_remaining = ((int) SDL_ceil(actual_input_frames * stream->rate_incr)) * stream->dst_sample_frame_size; + int flush_remaining = ((int)SDL_ceil(actual_input_frames * stream->rate_incr)) * stream->dst_sample_frame_size; - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: flushing with padding to get max %d bytes!\n", flush_remaining); - #endif +#endif SDL_memset(stream->staging_buffer + filled, '\0', stream->staging_buffer_size - filled); if (SDL_AudioStreamPutInternal(stream, stream->staging_buffer, stream->staging_buffer_size, &flush_remaining) < 0) { @@ -1324,12 +1369,11 @@ int SDL_AudioStreamFlush(SDL_AudioStream *stream) } /* get converted/resampled data from the stream */ -int -SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len) +int SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len) { - #if DEBUG_AUDIOSTREAM +#if DEBUG_AUDIOSTREAM SDL_Log("AUDIOSTREAM: want to get %d converted bytes\n", len); - #endif +#endif if (!stream) { return SDL_InvalidParamError("stream"); @@ -1338,29 +1382,27 @@ SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len) return SDL_InvalidParamError("buf"); } if (len <= 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if ((len % stream->dst_sample_frame_size) != 0) { return SDL_SetError("Can't request partial sample frames"); } - return (int) SDL_ReadFromDataQueue(stream->queue, buf, len); + return (int)SDL_ReadFromDataQueue(stream->queue, buf, len); } /* number of converted/resampled bytes available */ -int -SDL_AudioStreamAvailable(SDL_AudioStream *stream) +int SDL_AudioStreamAvailable(SDL_AudioStream *stream) { - return stream ? (int) SDL_CountDataQueue(stream->queue) : 0; + return stream ? (int)SDL_CountDataQueue(stream->queue) : 0; } -void -SDL_AudioStreamClear(SDL_AudioStream *stream) +void SDL_AudioStreamClear(SDL_AudioStream *stream) { if (!stream) { SDL_InvalidParamError("stream"); } else { - SDL_ClearDataQueue(stream->queue, stream->packetlen * 2); + SDL_ClearDataQueue(stream->queue, (size_t)stream->packetlen * 2); if (stream->reset_resampler_func) { stream->reset_resampler_func(stream); } @@ -1370,8 +1412,7 @@ SDL_AudioStreamClear(SDL_AudioStream *stream) } /* dispose of a stream */ -void -SDL_FreeAudioStream(SDL_AudioStream *stream) +void SDL_FreeAudioStream(SDL_AudioStream *stream) { if (stream) { if (stream->cleanup_resampler_func) { diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index 0d06f65cdc534..3ecaa05ee01b3 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ /* Get the name of the audio device we use for output */ -#if SDL_AUDIO_DRIVER_NETBSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO +#if defined(SDL_AUDIO_DRIVER_NETBSD) || defined(SDL_AUDIO_DRIVER_OSS) || defined(SDL_AUDIO_DRIVER_SUNAUDIO) #include #include @@ -34,9 +34,9 @@ #ifndef _PATH_DEV_DSP #if defined(__NETBSD__) || defined(__OPENBSD__) -#define _PATH_DEV_DSP "/dev/audio" +#define _PATH_DEV_DSP "/dev/audio" #else -#define _PATH_DEV_DSP "/dev/dsp" +#define _PATH_DEV_DSP "/dev/dsp" #endif #endif #ifndef _PATH_DEV_DSP24 @@ -46,8 +46,7 @@ #define _PATH_DEV_AUDIO "/dev/audio" #endif -static void -test_device(const int iscapture, const char *fname, int flags, int (*test) (int fd)) +static void test_device(const int iscapture, const char *fname, int flags, int (*test)(int fd)) { struct stat sb; if ((stat(fname, &sb) == 0) && (S_ISCHR(sb.st_mode))) { @@ -65,40 +64,40 @@ test_device(const int iscapture, const char *fname, int flags, int (*test) (int * information, making this information inaccessible at * enumeration time */ - SDL_AddAudioDevice(iscapture, fname, NULL, (void *) (uintptr_t) dummyhandle); + SDL_AddAudioDevice(iscapture, fname, NULL, (void *)(uintptr_t)dummyhandle); } } } } -static int -test_stub(int fd) +static int test_stub(int fd) { return 1; } -static void -SDL_EnumUnixAudioDevices_Internal(const int iscapture, const int classic, int (*test)(int)) +static void SDL_EnumUnixAudioDevices_Internal(const int iscapture, const int classic, int (*test)(int)) { const int flags = iscapture ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT; const char *audiodev; char audiopath[1024]; - if (test == NULL) + if (!test) { test = test_stub; + } /* Figure out what our audio device is */ - if (((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) && - ((audiodev = SDL_getenv("AUDIODEV")) == NULL)) { + audiodev = SDL_getenv("SDL_PATH_DSP"); + if (!audiodev) { + audiodev = SDL_getenv("AUDIODEV"); + } + if (!audiodev) { if (classic) { audiodev = _PATH_DEV_AUDIO; } else { struct stat sb; /* Added support for /dev/sound/\* in Linux 2.4 */ - if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) - && ((stat(_PATH_DEV_DSP24, &sb) == 0) - && S_ISCHR(sb.st_mode))) { + if (((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) && ((stat(_PATH_DEV_DSP24, &sb) == 0) && S_ISCHR(sb.st_mode))) { audiodev = _PATH_DEV_DSP24; } else { audiodev = _PATH_DEV_DSP; @@ -110,16 +109,15 @@ SDL_EnumUnixAudioDevices_Internal(const int iscapture, const int classic, int (* if (SDL_strlen(audiodev) < (sizeof(audiopath) - 3)) { int instance = 0; while (instance <= 64) { - SDL_snprintf(audiopath, SDL_arraysize(audiopath), - "%s%d", audiodev, instance); + (void)SDL_snprintf(audiopath, SDL_arraysize(audiopath), + "%s%d", audiodev, instance); instance++; test_device(iscapture, audiopath, flags, test); } } } -void -SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)) +void SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)) { SDL_EnumUnixAudioDevices_Internal(SDL_TRUE, classic, test); SDL_EnumUnixAudioDevices_Internal(SDL_FALSE, classic, test); diff --git a/src/audio/SDL_audiodev_c.h b/src/audio/SDL_audiodev_c.h index ff14ba5dc0e10..7aefc0d203e6c 100644 --- a/src/audio/SDL_audiodev_c.h +++ b/src/audio/SDL_audiodev_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,10 +31,10 @@ #ifdef USE_BLOCKING_WRITES #define OPEN_FLAGS_OUTPUT O_WRONLY -#define OPEN_FLAGS_INPUT O_RDONLY +#define OPEN_FLAGS_INPUT O_RDONLY #else -#define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) -#define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) +#define OPEN_FLAGS_OUTPUT (O_WRONLY | O_NONBLOCK) +#define OPEN_FLAGS_INPUT (O_RDONLY | O_NONBLOCK) #endif extern void SDL_EnumUnixAudioDevices(const int classic, int (*test)(int)); diff --git a/src/audio/SDL_audiotypecvt.c b/src/audio/SDL_audiotypecvt.c index e82bee05f8ec2..516be82e4790a 100644 --- a/src/audio/SDL_audiotypecvt.c +++ b/src/audio/SDL_audiotypecvt.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,17 +29,17 @@ #endif #ifdef __SSE2__ -#define HAVE_SSE2_INTRINSICS 1 +#define HAVE_SSE2_INTRINSICS #endif -#if defined(__x86_64__) && HAVE_SSE2_INTRINSICS +#if defined(__x86_64__) && defined(HAVE_SSE2_INTRINSICS) #define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* x86_64 guarantees SSE2. */ -#elif __MACOSX__ && HAVE_SSE2_INTRINSICS +#elif defined(__MACOSX__) && defined(HAVE_SSE2_INTRINSICS) #define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* Mac OS X/Intel guarantees SSE2. */ -#elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) && HAVE_NEON_INTRINSICS -#define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* ARMv8+ promise NEON. */ -#elif defined(__APPLE__) && defined(__ARM_ARCH) && (__ARM_ARCH >= 7) && HAVE_NEON_INTRINSICS -#define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* All Apple ARMv7 chips promise NEON support. */ +#elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) && defined(HAVE_NEON_INTRINSICS) +#define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* ARMv8+ promise NEON. */ +#elif defined(__APPLE__) && defined(__ARM_ARCH) && (__ARM_ARCH >= 7) && defined(HAVE_NEON_INTRINSICS) +#define NEED_SCALAR_CONVERTER_FALLBACKS 0 /* All Apple ARMv7 chips promise NEON support. */ #endif /* Set to zero if platform is guaranteed to use a SIMD codepath here. */ @@ -59,24 +59,39 @@ SDL_AudioFilter SDL_Convert_F32_to_S16 = NULL; SDL_AudioFilter SDL_Convert_F32_to_U16 = NULL; SDL_AudioFilter SDL_Convert_F32_to_S32 = NULL; - -#define DIVBY128 0.0078125f -#define DIVBY32768 0.000030517578125f +#define DIVBY128 0.0078125f +#define DIVBY32768 0.000030517578125f #define DIVBY8388607 0.00000011920930376163766f - +#define DIVBY2147483648 0.0000000004656612873077392578125f /* 0x1p-31f */ #if NEED_SCALAR_CONVERTER_FALLBACKS -static void SDLCALL -SDL_Convert_S8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) + +/* This code requires that floats are in the IEEE-754 binary32 format */ +SDL_COMPILE_TIME_ASSERT(float_bits, sizeof(float) == sizeof(Uint32)); + +union float_bits { + Uint32 u32; + float f32; +}; + +/* Create a bit-mask based on the sign-bit. Should optimize to a single arithmetic-shift-right */ +#define SIGNMASK(x) (Uint32)(0u - ((Uint32)(x) >> 31)) + +static void SDLCALL SDL_Convert_S8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint8 *src = ((const Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + const int num_samples = cvt->len_cvt; + const Sint8 *src = (const Sint8 *)cvt->buf; + float *dst = (float *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_S8", "AUDIO_F32"); - for (i = cvt->len_cvt; i; --i, --src, --dst) { - *dst = ((float) *src) * DIVBY128; + for (i = num_samples - 1; i >= 0; --i) { + /* 1) Construct a float in the range [65536.0, 65538.0) + * 2) Shift the float range to [-1.0, 1.0) */ + union float_bits x; + x.u32 = (Uint8)src[i] ^ 0x47800080u; + dst[i] = x.f32 - 65537.0f; } cvt->len_cvt *= 4; @@ -85,17 +100,21 @@ SDL_Convert_S8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint8 *src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + const int num_samples = cvt->len_cvt; + const Uint8 *src = (const Uint8 *)cvt->buf; + float *dst = (float *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_U8", "AUDIO_F32"); - for (i = cvt->len_cvt; i; --i, --src, --dst) { - *dst = (((float) *src) * DIVBY128) - 1.0f; + for (i = num_samples - 1; i >= 0; --i) { + /* 1) Construct a float in the range [65536.0, 65538.0) + * 2) Shift the float range to [-1.0, 1.0) */ + union float_bits x; + x.u32 = src[i] ^ 0x47800000u; + dst[i] = x.f32 - 65537.0f; } cvt->len_cvt *= 4; @@ -104,17 +123,21 @@ SDL_Convert_U8_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint16 *src = ((const Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + const int num_samples = cvt->len_cvt / sizeof(Sint16); + const Sint16 *src = (const Sint16 *)cvt->buf; + float *dst = (float *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_S16", "AUDIO_F32"); - for (i = cvt->len_cvt / sizeof (Sint16); i; --i, --src, --dst) { - *dst = ((float) *src) * DIVBY32768; + for (i = num_samples - 1; i >= 0; --i) { + /* 1) Construct a float in the range [256.0, 258.0) + * 2) Shift the float range to [-1.0, 1.0) */ + union float_bits x; + x.u32 = (Uint16)src[i] ^ 0x43808000u; + dst[i] = x.f32 - 257.0f; } cvt->len_cvt *= 2; @@ -123,17 +146,16 @@ SDL_Convert_S16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint16 *src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + const Uint16 *src = ((const Uint16 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 2)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_U16", "AUDIO_F32"); - for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) { - *dst = (((float) *src) * DIVBY32768) - 1.0f; + for (i = cvt->len_cvt / sizeof(Uint16); i; --i, --src, --dst) { + *dst = (((float)*src) * DIVBY32768) - 1.0f; } cvt->len_cvt *= 2; @@ -142,17 +164,16 @@ SDL_Convert_U16_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S32_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S32_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint32 *src = (const Sint32 *) cvt->buf; - float *dst = (float *) cvt->buf; + const Sint32 *src = (const Sint32 *)cvt->buf; + float *dst = (float *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_S32", "AUDIO_F32"); - for (i = cvt->len_cvt / sizeof (Sint32); i; --i, ++src, ++dst) { - *dst = ((float) (*src>>8)) * DIVBY8388607; + for (i = cvt->len_cvt / sizeof(Sint32); i; --i, ++src, ++dst) { + *dst = ((float)(*src >> 8)) * DIVBY8388607; } if (cvt->filters[++cvt->filter_index]) { @@ -160,24 +181,28 @@ SDL_Convert_S32_to_F32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint8 *dst = (Sint8 *) cvt->buf; + const int num_samples = cvt->len_cvt / sizeof (float); + const float *src = (const float *)cvt->buf; + Sint8 *dst = (Sint8 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S8"); - for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 127; - } else if (sample <= -1.0f) { - *dst = -128; - } else { - *dst = (Sint8)(sample * 127.0f); - } + for (i = 0; i < num_samples; ++i) { + /* 1) Shift the float range from [-1.0, 1.0] to [98303.0, 98305.0] + * 2) Shift the integer range from [0x47BFFF80, 0x47C00080] to [-128, 128] + * 3) Clamp the value to [-128, 127] */ + union float_bits x; + Uint32 y, z; + x.f32 = src[i] + 98304.0f; + + y = x.u32 - 0x47C00000u; + z = 0x7Fu - (y ^ SIGNMASK(y)); + y = y ^ (z & SIGNMASK(z)); + + dst[i] = (Sint8)(y & 0xFF); } cvt->len_cvt /= 4; @@ -186,24 +211,29 @@ SDL_Convert_F32_to_S8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Uint8 *dst = (Uint8 *) cvt->buf; + const int num_samples = cvt->len_cvt / sizeof (float); + const float *src = (const float *)cvt->buf; + Uint8 *dst = (Uint8 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U8"); - for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 255; - } else if (sample <= -1.0f) { - *dst = 0; - } else { - *dst = (Uint8)((sample + 1.0f) * 127.0f); - } + for (i = 0; i < num_samples; ++i) { + /* 1) Shift the float range from [-1.0, 1.0] to [98303.0, 98305.0] + * 2) Shift the integer range from [0x47BFFF80, 0x47C00080] to [-128, 128] + * 3) Clamp the value to [-128, 127] + * 4) Shift the integer range from [-128, 127] to [0, 255] */ + union float_bits x; + Uint32 y, z; + x.f32 = src[i] + 98304.0f; + + y = x.u32 - 0x47C00000u; + z = 0x7Fu - (y ^ SIGNMASK(y)); + y = (y ^ 0x80u) ^ (z & SIGNMASK(z)); + + dst[i] = (Uint8)(y & 0xFF); } cvt->len_cvt /= 4; @@ -212,24 +242,28 @@ SDL_Convert_F32_to_U8_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint16 *dst = (Sint16 *) cvt->buf; + const int num_samples = cvt->len_cvt / sizeof (float); + const float *src = (const float *)cvt->buf; + Sint16 *dst = (Sint16 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S16"); - for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 32767; - } else if (sample <= -1.0f) { - *dst = -32768; - } else { - *dst = (Sint16)(sample * 32767.0f); - } + for (i = 0; i < num_samples; ++i) { + /* 1) Shift the float range from [-1.0, 1.0] to [383.0, 385.0] + * 2) Shift the integer range from [0x43BF8000, 0x43C08000] to [-32768, 32768] + * 3) Clamp values outside the [-32768, 32767] range */ + union float_bits x; + Uint32 y, z; + x.f32 = src[i] + 384.0f; + + y = x.u32 - 0x43C00000u; + z = 0x7FFFu - (y ^ SIGNMASK(y)); + y = y ^ (z & SIGNMASK(z)); + + dst[i] = (Sint16)(y & 0xFFFF); } cvt->len_cvt /= 2; @@ -238,16 +272,15 @@ SDL_Convert_F32_to_S16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Uint16 *dst = (Uint16 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Uint16 *dst = (Uint16 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U16"); - for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i; --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 65535; @@ -264,24 +297,29 @@ SDL_Convert_F32_to_U16_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint32 *dst = (Sint32 *) cvt->buf; + const int num_samples = cvt->len_cvt / sizeof (float); + const float *src = (const float *)cvt->buf; + Sint32 *dst = (Sint32 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S32"); - for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 2147483647; - } else if (sample <= -1.0f) { - *dst = (Sint32) -2147483648LL; - } else { - *dst = ((Sint32)(sample * 8388607.0f)) << 8; - } + for (i = 0; i < num_samples; ++i) { + /* 1) Shift the float range from [-1.0, 1.0] to [-2147483648.0, 2147483648.0] + * 2) Set values outside the [-2147483648.0, 2147483647.0] range to -2147483648.0 + * 3) Convert the float to an integer, and fixup values outside the valid range */ + union float_bits x; + Uint32 y, z; + x.f32 = src[i]; + + y = x.u32 + 0x0F800000u; + z = y - 0xCF000000u; + z &= SIGNMASK(y ^ z); + x.u32 = y - z; + + dst[i] = (Sint32)x.f32 ^ (Sint32)SIGNMASK(z); } if (cvt->filters[++cvt->filter_index]) { @@ -290,59 +328,48 @@ SDL_Convert_F32_to_S32_Scalar(SDL_AudioCVT *cvt, SDL_AudioFormat format) } #endif - -#if HAVE_SSE2_INTRINSICS -static void SDLCALL -SDL_Convert_S8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +#ifdef HAVE_SSE2_INTRINSICS +static void SDLCALL SDL_Convert_S8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint8 *src = ((const Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; - int i; + const Sint8 *src = (const Sint8 *)cvt->buf; + float *dst = (float *)cvt->buf; + int i = cvt->len_cvt; + + /* 1) Flip the sign bit to convert from S8 to U8 format + * 2) Construct a float in the range [65536.0, 65538.0) + * 3) Shift the float range to [-1.0, 1.0) + * dst[i] = i2f((src[i] ^ 0x80) | 0x47800000) - 65537.0 */ + const __m128i zero = _mm_setzero_si128(); + const __m128i flipper = _mm_set1_epi8(-0x80); + const __m128i caster = _mm_set1_epi16(0x4780 /* 0x47800000 = f2i(65536.0) */); + const __m128 offset = _mm_set1_ps(-65537.0); LOG_DEBUG_CONVERT("AUDIO_S8", "AUDIO_F32 (using SSE2)"); - /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt; i && (((size_t) (dst-15)) & 15); --i, --src, --dst) { - *dst = ((float) *src) * DIVBY128; - } + while (i >= 16) { + i -= 16; - src -= 15; dst -= 15; /* adjust to read SSE blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + { + const __m128i bytes = _mm_xor_si128(_mm_loadu_si128((const __m128i *)&src[i]), flipper); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128i *mmsrc = (const __m128i *) src; - const __m128i zero = _mm_setzero_si128(); - const __m128 divby128 = _mm_set1_ps(DIVBY128); - while (i >= 16) { /* 16 * 8-bit */ - const __m128i bytes = _mm_load_si128(mmsrc); /* get 16 sint8 into an XMM register. */ - /* treat as int16, shift left to clear every other sint16, then back right with sign-extend. Now sint16. */ - const __m128i shorts1 = _mm_srai_epi16(_mm_slli_epi16(bytes, 8), 8); - /* right-shift-sign-extend gets us sint16 with the other set of values. */ - const __m128i shorts2 = _mm_srai_epi16(bytes, 8); - /* unpack against zero to make these int32, shift to make them sign-extend, convert to float, multiply. Whew! */ - const __m128 floats1 = _mm_mul_ps(_mm_cvtepi32_ps(_mm_srai_epi32(_mm_slli_epi32(_mm_unpacklo_epi16(shorts1, zero), 16), 16)), divby128); - const __m128 floats2 = _mm_mul_ps(_mm_cvtepi32_ps(_mm_srai_epi32(_mm_slli_epi32(_mm_unpacklo_epi16(shorts2, zero), 16), 16)), divby128); - const __m128 floats3 = _mm_mul_ps(_mm_cvtepi32_ps(_mm_srai_epi32(_mm_slli_epi32(_mm_unpackhi_epi16(shorts1, zero), 16), 16)), divby128); - const __m128 floats4 = _mm_mul_ps(_mm_cvtepi32_ps(_mm_srai_epi32(_mm_slli_epi32(_mm_unpackhi_epi16(shorts2, zero), 16), 16)), divby128); - /* Interleave back into correct order, store. */ - _mm_store_ps(dst, _mm_unpacklo_ps(floats1, floats2)); - _mm_store_ps(dst+4, _mm_unpackhi_ps(floats1, floats2)); - _mm_store_ps(dst+8, _mm_unpacklo_ps(floats3, floats4)); - _mm_store_ps(dst+12, _mm_unpackhi_ps(floats3, floats4)); - i -= 16; mmsrc--; dst -= 16; - } + const __m128i shorts1 = _mm_unpacklo_epi8(bytes, zero); + const __m128i shorts2 = _mm_unpackhi_epi8(bytes, zero); - src = (const Sint8 *) mmsrc; - } + const __m128 floats1 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts1, caster)), offset); + const __m128 floats2 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts1, caster)), offset); + const __m128 floats3 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts2, caster)), offset); + const __m128 floats4 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts2, caster)), offset); - src += 15; dst += 15; /* adjust for any scalar finishing. */ + _mm_storeu_ps(&dst[i], floats1); + _mm_storeu_ps(&dst[i + 4], floats2); + _mm_storeu_ps(&dst[i + 8], floats3); + _mm_storeu_ps(&dst[i + 12], floats4); + } + } - /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) *src) * DIVBY128; - i--; src--; dst--; + --i; + _mm_store_ss(&dst[i], _mm_add_ss(_mm_castsi128_ps(_mm_cvtsi32_si128((Uint8)src[i] ^ 0x47800080u)), offset)); } cvt->len_cvt *= 4; @@ -351,59 +378,45 @@ SDL_Convert_S8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint8 *src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; - int i; + const Sint8 *src = (const Sint8 *)cvt->buf; + float *dst = (float *)cvt->buf; + int i = cvt->len_cvt; + + /* 1) Construct a float in the range [65536.0, 65538.0) + * 2) Shift the float range to [-1.0, 1.0) + * dst[i] = i2f(src[i] | 0x47800000) - 65537.0 */ + const __m128i zero = _mm_setzero_si128(); + const __m128i caster = _mm_set1_epi16(0x4780 /* 0x47800000 = f2i(65536.0) */); + const __m128 offset = _mm_set1_ps(-65537.0); LOG_DEBUG_CONVERT("AUDIO_U8", "AUDIO_F32 (using SSE2)"); - /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt; i && (((size_t) (dst-15)) & 15); --i, --src, --dst) { - *dst = (((float) *src) * DIVBY128) - 1.0f; - } + while (i >= 16) { + i -= 16; - src -= 15; dst -= 15; /* adjust to read SSE blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + { + const __m128i bytes = _mm_loadu_si128((const __m128i *)&src[i]); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128i *mmsrc = (const __m128i *) src; - const __m128i zero = _mm_setzero_si128(); - const __m128 divby128 = _mm_set1_ps(DIVBY128); - const __m128 minus1 = _mm_set1_ps(-1.0f); - while (i >= 16) { /* 16 * 8-bit */ - const __m128i bytes = _mm_load_si128(mmsrc); /* get 16 uint8 into an XMM register. */ - /* treat as int16, shift left to clear every other sint16, then back right with zero-extend. Now uint16. */ - const __m128i shorts1 = _mm_srli_epi16(_mm_slli_epi16(bytes, 8), 8); - /* right-shift-zero-extend gets us uint16 with the other set of values. */ - const __m128i shorts2 = _mm_srli_epi16(bytes, 8); - /* unpack against zero to make these int32, convert to float, multiply, add. Whew! */ - /* Note that AVX2 can do floating point multiply+add in one instruction, fwiw. SSE2 cannot. */ - const __m128 floats1 = _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpacklo_epi16(shorts1, zero)), divby128), minus1); - const __m128 floats2 = _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpacklo_epi16(shorts2, zero)), divby128), minus1); - const __m128 floats3 = _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpackhi_epi16(shorts1, zero)), divby128), minus1); - const __m128 floats4 = _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpackhi_epi16(shorts2, zero)), divby128), minus1); - /* Interleave back into correct order, store. */ - _mm_store_ps(dst, _mm_unpacklo_ps(floats1, floats2)); - _mm_store_ps(dst+4, _mm_unpackhi_ps(floats1, floats2)); - _mm_store_ps(dst+8, _mm_unpacklo_ps(floats3, floats4)); - _mm_store_ps(dst+12, _mm_unpackhi_ps(floats3, floats4)); - i -= 16; mmsrc--; dst -= 16; - } + const __m128i shorts1 = _mm_unpacklo_epi8(bytes, zero); + const __m128i shorts2 = _mm_unpackhi_epi8(bytes, zero); - src = (const Uint8 *) mmsrc; - } + const __m128 floats1 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts1, caster)), offset); + const __m128 floats2 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts1, caster)), offset); + const __m128 floats3 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts2, caster)), offset); + const __m128 floats4 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts2, caster)), offset); - src += 15; dst += 15; /* adjust for any scalar finishing. */ + _mm_storeu_ps(&dst[i], floats1); + _mm_storeu_ps(&dst[i + 4], floats2); + _mm_storeu_ps(&dst[i + 8], floats3); + _mm_storeu_ps(&dst[i + 12], floats4); + } + } - /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = (((float) *src) * DIVBY128) - 1.0f; - i--; src--; dst--; + --i; + _mm_store_ss(&dst[i], _mm_add_ss(_mm_castsi128_ps(_mm_cvtsi32_si128((Uint8)src[i] ^ 0x47800000u)), offset)); } cvt->len_cvt *= 4; @@ -412,46 +425,44 @@ SDL_Convert_U8_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint16 *src = ((const Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; - int i; + const Sint16 *src = (const Sint16 *)cvt->buf; + float *dst = (float *)cvt->buf; + int i = cvt->len_cvt / 2; + + /* 1) Flip the sign bit to convert from S16 to U16 format + * 2) Construct a float in the range [256.0, 258.0) + * 3) Shift the float range to [-1.0, 1.0) + * dst[i] = i2f((src[i] ^ 0x8000) | 0x43800000) - 257.0 */ + const __m128i flipper = _mm_set1_epi16(-0x8000); + const __m128i caster = _mm_set1_epi16(0x4380 /* 0x43800000 = f2i(256.0) */); + const __m128 offset = _mm_set1_ps(-257.0f); LOG_DEBUG_CONVERT("AUDIO_S16", "AUDIO_F32 (using SSE2)"); - /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt / sizeof (Sint16); i && (((size_t) (dst-7)) & 15); --i, --src, --dst) { - *dst = ((float) *src) * DIVBY32768; - } + while (i >= 16) { + i -= 16; - src -= 7; dst -= 7; /* adjust to read SSE blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + { + const __m128i shorts1 = _mm_xor_si128(_mm_loadu_si128((const __m128i *)&src[i]), flipper); + const __m128i shorts2 = _mm_xor_si128(_mm_loadu_si128((const __m128i *)&src[i + 8]), flipper); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 divby32768 = _mm_set1_ps(DIVBY32768); - while (i >= 8) { /* 8 * 16-bit */ - const __m128i ints = _mm_load_si128((__m128i const *) src); /* get 8 sint16 into an XMM register. */ - /* treat as int32, shift left to clear every other sint16, then back right with sign-extend. Now sint32. */ - const __m128i a = _mm_srai_epi32(_mm_slli_epi32(ints, 16), 16); - /* right-shift-sign-extend gets us sint32 with the other set of values. */ - const __m128i b = _mm_srai_epi32(ints, 16); - /* Interleave these back into the right order, convert to float, multiply, store. */ - _mm_store_ps(dst, _mm_mul_ps(_mm_cvtepi32_ps(_mm_unpacklo_epi32(a, b)), divby32768)); - _mm_store_ps(dst+4, _mm_mul_ps(_mm_cvtepi32_ps(_mm_unpackhi_epi32(a, b)), divby32768)); - i -= 8; src -= 8; dst -= 8; + const __m128 floats1 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts1, caster)), offset); + const __m128 floats2 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts1, caster)), offset); + const __m128 floats3 = _mm_add_ps(_mm_castsi128_ps(_mm_unpacklo_epi16(shorts2, caster)), offset); + const __m128 floats4 = _mm_add_ps(_mm_castsi128_ps(_mm_unpackhi_epi16(shorts2, caster)), offset); + + _mm_storeu_ps(&dst[i], floats1); + _mm_storeu_ps(&dst[i + 4], floats2); + _mm_storeu_ps(&dst[i + 8], floats3); + _mm_storeu_ps(&dst[i + 12], floats4); } } - src += 7; dst += 7; /* adjust for any scalar finishing. */ - - /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) *src) * DIVBY32768; - i--; src--; dst--; + --i; + _mm_store_ss(&dst[i], _mm_add_ss(_mm_castsi128_ps(_mm_cvtsi32_si128((Uint16)src[i] ^ 0x43808000u)), offset)); } cvt->len_cvt *= 2; @@ -460,47 +471,52 @@ SDL_Convert_S16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint16 *src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + const Uint16 *src = ((const Uint16 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 2)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_U16", "AUDIO_F32 (using SSE2)"); /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt / sizeof (Sint16); i && (((size_t) (dst-7)) & 15); --i, --src, --dst) { - *dst = (((float) *src) * DIVBY32768) - 1.0f; + for (i = cvt->len_cvt / sizeof(Sint16); i && (((size_t)(dst - 7)) & 15); --i, --src, --dst) { + *dst = (((float)*src) * DIVBY32768) - 1.0f; } - src -= 7; dst -= 7; /* adjust to read SSE blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + src -= 7; + dst -= 7; /* adjust to read SSE blocks from the start. */ + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ const __m128 divby32768 = _mm_set1_ps(DIVBY32768); const __m128 minus1 = _mm_set1_ps(-1.0f); - while (i >= 8) { /* 8 * 16-bit */ - const __m128i ints = _mm_load_si128((__m128i const *) src); /* get 8 sint16 into an XMM register. */ + while (i >= 8) { /* 8 * 16-bit */ + const __m128i ints = _mm_load_si128((__m128i const *)src); /* get 8 sint16 into an XMM register. */ /* treat as int32, shift left to clear every other sint16, then back right with zero-extend. Now sint32. */ const __m128i a = _mm_srli_epi32(_mm_slli_epi32(ints, 16), 16); /* right-shift-sign-extend gets us sint32 with the other set of values. */ const __m128i b = _mm_srli_epi32(ints, 16); /* Interleave these back into the right order, convert to float, multiply, store. */ _mm_store_ps(dst, _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpacklo_epi32(a, b)), divby32768), minus1)); - _mm_store_ps(dst+4, _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpackhi_epi32(a, b)), divby32768), minus1)); - i -= 8; src -= 8; dst -= 8; + _mm_store_ps(dst + 4, _mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(_mm_unpackhi_epi32(a, b)), divby32768), minus1)); + i -= 8; + src -= 8; + dst -= 8; } } - src += 7; dst += 7; /* adjust for any scalar finishing. */ + src += 7; + dst += 7; /* adjust for any scalar finishing. */ /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = (((float) *src) * DIVBY32768) - 1.0f; - i--; src--; dst--; + *dst = (((float)*src) * DIVBY32768) - 1.0f; + i--; + src--; + dst--; } cvt->len_cvt *= 2; @@ -509,39 +525,41 @@ SDL_Convert_U16_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S32_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S32_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint32 *src = (const Sint32 *) cvt->buf; - float *dst = (float *) cvt->buf; - int i; + const Sint32 *src = (const Sint32 *)cvt->buf; + float *dst = (float *)cvt->buf; + int i = cvt->len_cvt / 4; + + /* dst[i] = f32(src[i]) / f32(0x80000000) */ + const __m128 scaler = _mm_set1_ps(DIVBY2147483648); LOG_DEBUG_CONVERT("AUDIO_S32", "AUDIO_F32 (using SSE2)"); - /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (Sint32); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - *dst = ((float) (*src>>8)) * DIVBY8388607; - } + while (i >= 16) { + i -= 16; - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + { + const __m128i ints1 = _mm_loadu_si128((const __m128i *)&src[i]); + const __m128i ints2 = _mm_loadu_si128((const __m128i *)&src[i + 4]); + const __m128i ints3 = _mm_loadu_si128((const __m128i *)&src[i + 8]); + const __m128i ints4 = _mm_loadu_si128((const __m128i *)&src[i + 12]); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 divby8388607 = _mm_set1_ps(DIVBY8388607); - const __m128i *mmsrc = (const __m128i *) src; - while (i >= 4) { /* 4 * sint32 */ - /* shift out lowest bits so int fits in a float32. Small precision loss, but much faster. */ - _mm_store_ps(dst, _mm_mul_ps(_mm_cvtepi32_ps(_mm_srai_epi32(_mm_load_si128(mmsrc), 8)), divby8388607)); - i -= 4; mmsrc++; dst += 4; + const __m128 floats1 = _mm_mul_ps(_mm_cvtepi32_ps(ints1), scaler); + const __m128 floats2 = _mm_mul_ps(_mm_cvtepi32_ps(ints2), scaler); + const __m128 floats3 = _mm_mul_ps(_mm_cvtepi32_ps(ints3), scaler); + const __m128 floats4 = _mm_mul_ps(_mm_cvtepi32_ps(ints4), scaler); + + _mm_storeu_ps(&dst[i], floats1); + _mm_storeu_ps(&dst[i + 4], floats2); + _mm_storeu_ps(&dst[i + 8], floats3); + _mm_storeu_ps(&dst[i + 12], floats4); } - src = (const Sint32 *) mmsrc; } - /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) (*src>>8)) * DIVBY8388607; - i--; src++; dst++; + --i; + _mm_store_ss(&dst[i], _mm_mul_ss(_mm_cvt_si2ss(_mm_setzero_ps(), src[i]), scaler)); } if (cvt->filters[++cvt->filter_index]) { @@ -549,58 +567,51 @@ SDL_Convert_S32_to_F32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint8 *dst = (Sint8 *) cvt->buf; - int i; + const float *src = (const float *)cvt->buf; + Sint8 *dst = (Sint8 *)cvt->buf; + int i = cvt->len_cvt / 4; + + /* 1) Shift the float range from [-1.0, 1.0] to [98303.0, 98305.0] + * 2) Extract the lowest 16 bits and clamp to [-128, 127] + * Overflow is correctly handled for inputs between roughly [-255.0, 255.0] + * dst[i] = clamp(i16(f2i(src[i] + 98304.0) & 0xFFFF), -128, 127) */ + const __m128 offset = _mm_set1_ps(98304.0f); + const __m128i mask = _mm_set1_epi16(0xFF); LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S8 (using SSE2)"); - /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 127; - } else if (sample <= -1.0f) { - *dst = -128; - } else { - *dst = (Sint8)(sample * 127.0f); - } - } + while (i >= 16) { + const __m128 floats1 = _mm_loadu_ps(&src[0]); + const __m128 floats2 = _mm_loadu_ps(&src[4]); + const __m128 floats3 = _mm_loadu_ps(&src[8]); + const __m128 floats4 = _mm_loadu_ps(&src[12]); - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + const __m128i ints1 = _mm_castps_si128(_mm_add_ps(floats1, offset)); + const __m128i ints2 = _mm_castps_si128(_mm_add_ps(floats2, offset)); + const __m128i ints3 = _mm_castps_si128(_mm_add_ps(floats3, offset)); + const __m128i ints4 = _mm_castps_si128(_mm_add_ps(floats4, offset)); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 one = _mm_set1_ps(1.0f); - const __m128 negone = _mm_set1_ps(-1.0f); - const __m128 mulby127 = _mm_set1_ps(127.0f); - __m128i *mmdst = (__m128i *) dst; - while (i >= 16) { /* 16 * float32 */ - const __m128i ints1 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints2 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+4)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints3 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+8)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints4 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+12)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - _mm_store_si128(mmdst, _mm_packs_epi16(_mm_packs_epi32(ints1, ints2), _mm_packs_epi32(ints3, ints4))); /* pack down, store out. */ - i -= 16; src += 16; mmdst++; - } - dst = (Sint8 *) mmdst; + const __m128i shorts1 = _mm_and_si128(_mm_packs_epi16(ints1, ints2), mask); + const __m128i shorts2 = _mm_and_si128(_mm_packs_epi16(ints3, ints4), mask); + + const __m128i bytes = _mm_packus_epi16(shorts1, shorts2); + + _mm_storeu_si128((__m128i*)dst, bytes); + + i -= 16; + src += 16; + dst += 16; } - /* Finish off any leftovers with scalar operations. */ while (i) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 127; - } else if (sample <= -1.0f) { - *dst = -128; - } else { - *dst = (Sint8)(sample * 127.0f); - } - i--; src++; dst++; + const __m128i ints = _mm_castps_si128(_mm_add_ss(_mm_load_ss(src), offset)); + *dst = (Sint8)(_mm_cvtsi128_si32(_mm_packs_epi16(ints, ints)) & 0xFF); + + --i; + ++src; + ++dst; } cvt->len_cvt /= 4; @@ -609,58 +620,51 @@ SDL_Convert_F32_to_S8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; + const float *src = (const float *)cvt->buf; Uint8 *dst = cvt->buf; - int i; + int i = cvt->len_cvt / 4; + + /* 1) Shift the float range from [-1.0, 1.0] to [98304.0, 98306.0] + * 2) Extract the lowest 16 bits and clamp to [0, 255] + * Overflow is correctly handled for inputs between roughly [-254.0, 254.0] + * dst[i] = clamp(i16(f2i(src[i] + 98305.0) & 0xFFFF), 0, 255) */ + const __m128 offset = _mm_set1_ps(98305.0f); + const __m128i mask = _mm_set1_epi16(0xFF); LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U8 (using SSE2)"); - /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 255; - } else if (sample <= -1.0f) { - *dst = 0; - } else { - *dst = (Uint8)((sample + 1.0f) * 127.0f); - } - } + while (i >= 16) { + const __m128 floats1 = _mm_loadu_ps(&src[0]); + const __m128 floats2 = _mm_loadu_ps(&src[4]); + const __m128 floats3 = _mm_loadu_ps(&src[8]); + const __m128 floats4 = _mm_loadu_ps(&src[12]); - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + const __m128i ints1 = _mm_castps_si128(_mm_add_ps(floats1, offset)); + const __m128i ints2 = _mm_castps_si128(_mm_add_ps(floats2, offset)); + const __m128i ints3 = _mm_castps_si128(_mm_add_ps(floats3, offset)); + const __m128i ints4 = _mm_castps_si128(_mm_add_ps(floats4, offset)); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 one = _mm_set1_ps(1.0f); - const __m128 negone = _mm_set1_ps(-1.0f); - const __m128 mulby127 = _mm_set1_ps(127.0f); - __m128i *mmdst = (__m128i *) dst; - while (i >= 16) { /* 16 * float32 */ - const __m128i ints1 = _mm_cvtps_epi32(_mm_mul_ps(_mm_add_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints2 = _mm_cvtps_epi32(_mm_mul_ps(_mm_add_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+4)), one), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints3 = _mm_cvtps_epi32(_mm_mul_ps(_mm_add_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+8)), one), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints4 = _mm_cvtps_epi32(_mm_mul_ps(_mm_add_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+12)), one), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - _mm_store_si128(mmdst, _mm_packus_epi16(_mm_packs_epi32(ints1, ints2), _mm_packs_epi32(ints3, ints4))); /* pack down, store out. */ - i -= 16; src += 16; mmdst++; - } - dst = (Uint8 *) mmdst; + const __m128i shorts1 = _mm_and_si128(_mm_packus_epi16(ints1, ints2), mask); + const __m128i shorts2 = _mm_and_si128(_mm_packus_epi16(ints3, ints4), mask); + + const __m128i bytes = _mm_packus_epi16(shorts1, shorts2); + + _mm_storeu_si128((__m128i*)dst, bytes); + + i -= 16; + src += 16; + dst += 16; } - /* Finish off any leftovers with scalar operations. */ while (i) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 255; - } else if (sample <= -1.0f) { - *dst = 0; - } else { - *dst = (Uint8)((sample + 1.0f) * 127.0f); - } - i--; src++; dst++; + const __m128i ints = _mm_castps_si128(_mm_add_ss(_mm_load_ss(src), offset)); + *dst = (Uint8)(_mm_cvtsi128_si32(_mm_packus_epi16(ints, ints)) & 0xFF); + + --i; + ++src; + ++dst; } cvt->len_cvt /= 4; @@ -669,56 +673,50 @@ SDL_Convert_F32_to_U8_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint16 *dst = (Sint16 *) cvt->buf; - int i; + const float *src = (const float *)cvt->buf; + Sint16 *dst = (Sint16 *)cvt->buf; + int i = cvt->len_cvt / 4; + + /* 1) Shift the float range from [-1.0, 1.0] to [256.0, 258.0] + * 2) Shift the int range from [0x43800000, 0x43810000] to [-32768,32768] + * 3) Clamp to range [-32768,32767] + * Overflow is correctly handled for inputs between roughly [-257.0, +inf) + * dst[i] = clamp(f2i(src[i] + 257.0) - 0x43808000, -32768, 32767) */ + const __m128 offset = _mm_set1_ps(257.0f); LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S16 (using SSE2)"); - /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 32767; - } else if (sample <= -1.0f) { - *dst = -32768; - } else { - *dst = (Sint16)(sample * 32767.0f); - } - } + while (i >= 16) { + const __m128 floats1 = _mm_loadu_ps(&src[0]); + const __m128 floats2 = _mm_loadu_ps(&src[4]); + const __m128 floats3 = _mm_loadu_ps(&src[8]); + const __m128 floats4 = _mm_loadu_ps(&src[12]); - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + const __m128i ints1 = _mm_sub_epi32(_mm_castps_si128(_mm_add_ps(floats1, offset)), _mm_castps_si128(offset)); + const __m128i ints2 = _mm_sub_epi32(_mm_castps_si128(_mm_add_ps(floats2, offset)), _mm_castps_si128(offset)); + const __m128i ints3 = _mm_sub_epi32(_mm_castps_si128(_mm_add_ps(floats3, offset)), _mm_castps_si128(offset)); + const __m128i ints4 = _mm_sub_epi32(_mm_castps_si128(_mm_add_ps(floats4, offset)), _mm_castps_si128(offset)); - /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 one = _mm_set1_ps(1.0f); - const __m128 negone = _mm_set1_ps(-1.0f); - const __m128 mulby32767 = _mm_set1_ps(32767.0f); - __m128i *mmdst = (__m128i *) dst; - while (i >= 8) { /* 8 * float32 */ - const __m128i ints1 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints2 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+4)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - _mm_store_si128(mmdst, _mm_packs_epi32(ints1, ints2)); /* pack to sint16, store out. */ - i -= 8; src += 8; mmdst++; - } - dst = (Sint16 *) mmdst; + const __m128i shorts1 = _mm_packs_epi32(ints1, ints2); + const __m128i shorts2 = _mm_packs_epi32(ints3, ints4); + + _mm_storeu_si128((__m128i*)&dst[0], shorts1); + _mm_storeu_si128((__m128i*)&dst[8], shorts2); + + i -= 16; + src += 16; + dst += 16; } - /* Finish off any leftovers with scalar operations. */ while (i) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 32767; - } else if (sample <= -1.0f) { - *dst = -32768; - } else { - *dst = (Sint16)(sample * 32767.0f); - } - i--; src++; dst++; + const __m128i ints = _mm_sub_epi32(_mm_castps_si128(_mm_add_ss(_mm_load_ss(src), offset)), _mm_castps_si128(offset)); + *dst = (Sint16)(_mm_cvtsi128_si32(_mm_packs_epi32(ints, ints)) & 0xFFFF); + + --i; + ++src; + ++dst; } cvt->len_cvt /= 2; @@ -727,17 +725,16 @@ SDL_Convert_F32_to_S16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Uint16 *dst = (Uint16 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Uint16 *dst = (Uint16 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U16 (using SSE2)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 65535; @@ -748,10 +745,10 @@ SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ /* This calculates differently than the scalar path because SSE2 can't pack int32 data down to unsigned int16. _mm_packs_epi32 does signed @@ -764,14 +761,16 @@ SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) const __m128i topbit = _mm_set1_epi16(-32768); const __m128 one = _mm_set1_ps(1.0f); const __m128 negone = _mm_set1_ps(-1.0f); - __m128i *mmdst = (__m128i *) dst; - while (i >= 8) { /* 8 * float32 */ - const __m128i ints1 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - const __m128i ints2 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src+4)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - _mm_store_si128(mmdst, _mm_xor_si128(_mm_packs_epi32(ints1, ints2), topbit)); /* pack to sint16, xor top bit, store out. */ - i -= 8; src += 8; mmdst++; + __m128i *mmdst = (__m128i *)dst; + while (i >= 8) { /* 8 * float32 */ + const __m128i ints1 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ + const __m128i ints2 = _mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src + 4)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ + _mm_store_si128(mmdst, _mm_xor_si128(_mm_packs_epi32(ints1, ints2), topbit)); /* pack to sint16, xor top bit, store out. */ + i -= 8; + src += 8; + mmdst++; } - dst = (Uint16 *) mmdst; + dst = (Uint16 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -784,7 +783,9 @@ SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = (Uint16)((sample + 1.0f) * 32767.0f); } - i--; src++; dst++; + i--; + src++; + dst++; } cvt->len_cvt /= 2; @@ -793,54 +794,55 @@ SDL_Convert_F32_to_U16_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint32 *dst = (Sint32 *) cvt->buf; - int i; + const float *src = (const float *)cvt->buf; + Sint32 *dst = (Sint32 *)cvt->buf; + int i = cvt->len_cvt / 4; + + /* 1) Scale the float range from [-1.0, 1.0] to [-2147483648.0, 2147483648.0] + * 2) Convert to integer (values too small/large become 0x80000000 = -2147483648) + * 3) Fixup values which were too large (0x80000000 ^ 0xFFFFFFFF = 2147483647) + * dst[i] = i32(src[i] * 2147483648.0) ^ ((src[i] >= 2147483648.0) ? 0xFFFFFFFF : 0x00000000) */ + const __m128 limit = _mm_set1_ps(2147483648.0f); LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S32 (using SSE2)"); - /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 2147483647; - } else if (sample <= -1.0f) { - *dst = (Sint32) -2147483648LL; - } else { - *dst = ((Sint32)(sample * 8388607.0f)) << 8; - } - } + while (i >= 16) { + const __m128 floats1 = _mm_loadu_ps(&src[0]); + const __m128 floats2 = _mm_loadu_ps(&src[4]); + const __m128 floats3 = _mm_loadu_ps(&src[8]); + const __m128 floats4 = _mm_loadu_ps(&src[12]); - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); - SDL_assert(!i || ((((size_t) src) & 15) == 0)); + const __m128 values1 = _mm_mul_ps(floats1, limit); + const __m128 values2 = _mm_mul_ps(floats2, limit); + const __m128 values3 = _mm_mul_ps(floats3, limit); + const __m128 values4 = _mm_mul_ps(floats4, limit); - { - /* Aligned! Do SSE blocks as long as we have 16 bytes available. */ - const __m128 one = _mm_set1_ps(1.0f); - const __m128 negone = _mm_set1_ps(-1.0f); - const __m128 mulby8388607 = _mm_set1_ps(8388607.0f); - __m128i *mmdst = (__m128i *) dst; - while (i >= 4) { /* 4 * float32 */ - _mm_store_si128(mmdst, _mm_slli_epi32(_mm_cvtps_epi32(_mm_mul_ps(_mm_min_ps(_mm_max_ps(negone, _mm_load_ps(src)), one), mulby8388607)), 8)); /* load 4 floats, clamp, convert to sint32 */ - i -= 4; src += 4; mmdst++; - } - dst = (Sint32 *) mmdst; + const __m128i ints1 = _mm_xor_si128(_mm_cvttps_epi32(values1), _mm_castps_si128(_mm_cmpge_ps(values1, limit))); + const __m128i ints2 = _mm_xor_si128(_mm_cvttps_epi32(values2), _mm_castps_si128(_mm_cmpge_ps(values2, limit))); + const __m128i ints3 = _mm_xor_si128(_mm_cvttps_epi32(values3), _mm_castps_si128(_mm_cmpge_ps(values3, limit))); + const __m128i ints4 = _mm_xor_si128(_mm_cvttps_epi32(values4), _mm_castps_si128(_mm_cmpge_ps(values4, limit))); + + _mm_storeu_si128((__m128i*)&dst[0], ints1); + _mm_storeu_si128((__m128i*)&dst[4], ints2); + _mm_storeu_si128((__m128i*)&dst[8], ints3); + _mm_storeu_si128((__m128i*)&dst[12], ints4); + + i -= 16; + src += 16; + dst += 16; } - /* Finish off any leftovers with scalar operations. */ while (i) { - const float sample = *src; - if (sample >= 1.0f) { - *dst = 2147483647; - } else if (sample <= -1.0f) { - *dst = (Sint32) -2147483648LL; - } else { - *dst = ((Sint32)(sample * 8388607.0f)) << 8; - } - i--; src++; dst++; + const __m128 floats = _mm_load_ss(src); + const __m128 values = _mm_mul_ss(floats, limit); + const __m128i ints = _mm_xor_si128(_mm_cvttps_epi32(values), _mm_castps_si128(_mm_cmpge_ss(values, limit))); + *dst = (Sint32)_mm_cvtsi128_si32(ints); + + --i; + ++src; + ++dst; } if (cvt->filters[++cvt->filter_index]) { @@ -849,51 +851,55 @@ SDL_Convert_F32_to_S32_SSE2(SDL_AudioCVT *cvt, SDL_AudioFormat format) } #endif - -#if HAVE_NEON_INTRINSICS -static void SDLCALL -SDL_Convert_S8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +#ifdef HAVE_NEON_INTRINSICS +static void SDLCALL SDL_Convert_S8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint8 *src = ((const Sint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + const Sint8 *src = ((const Sint8 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 4)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_S8", "AUDIO_F32 (using NEON)"); /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt; i && (((size_t) (dst-15)) & 15); --i, --src, --dst) { - *dst = ((float) *src) * DIVBY128; + for (i = cvt->len_cvt; i && (((size_t)(dst - 15)) & 15); --i, --src, --dst) { + *dst = ((float)*src) * DIVBY128; } - src -= 15; dst -= 15; /* adjust to read NEON blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + src -= 15; + dst -= 15; /* adjust to read NEON blocks from the start. */ + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ - const int8_t *mmsrc = (const int8_t *) src; + const int8_t *mmsrc = (const int8_t *)src; const float32x4_t divby128 = vdupq_n_f32(DIVBY128); - while (i >= 16) { /* 16 * 8-bit */ - const int8x16_t bytes = vld1q_s8(mmsrc); /* get 16 sint8 into a NEON register. */ - const int16x8_t int16hi = vmovl_s8(vget_high_s8(bytes)); /* convert top 8 bytes to 8 int16 */ - const int16x8_t int16lo = vmovl_s8(vget_low_s8(bytes)); /* convert bottom 8 bytes to 8 int16 */ + while (i >= 16) { /* 16 * 8-bit */ + const int8x16_t bytes = vld1q_s8(mmsrc); /* get 16 sint8 into a NEON register. */ + const int16x8_t int16hi = vmovl_s8(vget_high_s8(bytes)); /* convert top 8 bytes to 8 int16 */ + const int16x8_t int16lo = vmovl_s8(vget_low_s8(bytes)); /* convert bottom 8 bytes to 8 int16 */ /* split int16 to two int32, then convert to float, then multiply to normalize, store. */ vst1q_f32(dst, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(int16lo))), divby128)); - vst1q_f32(dst+4, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(int16lo))), divby128)); - vst1q_f32(dst+8, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(int16hi))), divby128)); - vst1q_f32(dst+12, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(int16hi))), divby128)); - i -= 16; mmsrc -= 16; dst -= 16; + vst1q_f32(dst + 4, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(int16lo))), divby128)); + vst1q_f32(dst + 8, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(int16hi))), divby128)); + vst1q_f32(dst + 12, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(int16hi))), divby128)); + i -= 16; + mmsrc -= 16; + dst -= 16; } - src = (const Sint8 *) mmsrc; + src = (const Sint8 *)mmsrc; } - src += 15; dst += 15; /* adjust for any scalar finishing. */ + src += 15; + dst += 15; /* adjust for any scalar finishing. */ /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) *src) * DIVBY128; - i--; src--; dst--; + *dst = ((float)*src) * DIVBY128; + i--; + src--; + dst--; } cvt->len_cvt *= 4; @@ -902,50 +908,55 @@ SDL_Convert_S8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint8 *src = ((const Uint8 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 4)) - 1; + const Uint8 *src = ((const Uint8 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 4)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_U8", "AUDIO_F32 (using NEON)"); /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt; i && (((size_t) (dst-15)) & 15); --i, --src, --dst) { - *dst = (((float) *src) * DIVBY128) - 1.0f; + for (i = cvt->len_cvt; i && (((size_t)(dst - 15)) & 15); --i, --src, --dst) { + *dst = (((float)*src) * DIVBY128) - 1.0f; } - src -= 15; dst -= 15; /* adjust to read NEON blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + src -= 15; + dst -= 15; /* adjust to read NEON blocks from the start. */ + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ - const uint8_t *mmsrc = (const uint8_t *) src; + const uint8_t *mmsrc = (const uint8_t *)src; const float32x4_t divby128 = vdupq_n_f32(DIVBY128); const float32x4_t negone = vdupq_n_f32(-1.0f); - while (i >= 16) { /* 16 * 8-bit */ - const uint8x16_t bytes = vld1q_u8(mmsrc); /* get 16 uint8 into a NEON register. */ - const uint16x8_t uint16hi = vmovl_u8(vget_high_u8(bytes)); /* convert top 8 bytes to 8 uint16 */ - const uint16x8_t uint16lo = vmovl_u8(vget_low_u8(bytes)); /* convert bottom 8 bytes to 8 uint16 */ + while (i >= 16) { /* 16 * 8-bit */ + const uint8x16_t bytes = vld1q_u8(mmsrc); /* get 16 uint8 into a NEON register. */ + const uint16x8_t uint16hi = vmovl_u8(vget_high_u8(bytes)); /* convert top 8 bytes to 8 uint16 */ + const uint16x8_t uint16lo = vmovl_u8(vget_low_u8(bytes)); /* convert bottom 8 bytes to 8 uint16 */ /* split uint16 to two uint32, then convert to float, then multiply to normalize, subtract to adjust for sign, store. */ vst1q_f32(dst, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16lo))), divby128)); - vst1q_f32(dst+4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16lo))), divby128)); - vst1q_f32(dst+8, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16hi))), divby128)); - vst1q_f32(dst+12, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16hi))), divby128)); - i -= 16; mmsrc -= 16; dst -= 16; + vst1q_f32(dst + 4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16lo))), divby128)); + vst1q_f32(dst + 8, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uint16hi))), divby128)); + vst1q_f32(dst + 12, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uint16hi))), divby128)); + i -= 16; + mmsrc -= 16; + dst -= 16; } - src = (const Uint8 *) mmsrc; + src = (const Uint8 *)mmsrc; } - src += 15; dst += 15; /* adjust for any scalar finishing. */ + src += 15; + dst += 15; /* adjust for any scalar finishing. */ /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = (((float) *src) * DIVBY128) - 1.0f; - i--; src--; dst--; + *dst = (((float)*src) * DIVBY128) - 1.0f; + i--; + src--; + dst--; } cvt->len_cvt *= 4; @@ -954,42 +965,47 @@ SDL_Convert_U8_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint16 *src = ((const Sint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + const Sint16 *src = ((const Sint16 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 2)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_S16", "AUDIO_F32 (using NEON)"); /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt / sizeof (Sint16); i && (((size_t) (dst-7)) & 15); --i, --src, --dst) { - *dst = ((float) *src) * DIVBY32768; + for (i = cvt->len_cvt / sizeof(Sint16); i && (((size_t)(dst - 7)) & 15); --i, --src, --dst) { + *dst = ((float)*src) * DIVBY32768; } - src -= 7; dst -= 7; /* adjust to read NEON blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + src -= 7; + dst -= 7; /* adjust to read NEON blocks from the start. */ + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t divby32768 = vdupq_n_f32(DIVBY32768); - while (i >= 8) { /* 8 * 16-bit */ - const int16x8_t ints = vld1q_s16((int16_t const *) src); /* get 8 sint16 into a NEON register. */ + while (i >= 8) { /* 8 * 16-bit */ + const int16x8_t ints = vld1q_s16((int16_t const *)src); /* get 8 sint16 into a NEON register. */ /* split int16 to two int32, then convert to float, then multiply to normalize, store. */ vst1q_f32(dst, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_low_s16(ints))), divby32768)); - vst1q_f32(dst+4, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(ints))), divby32768)); - i -= 8; src -= 8; dst -= 8; + vst1q_f32(dst + 4, vmulq_f32(vcvtq_f32_s32(vmovl_s16(vget_high_s16(ints))), divby32768)); + i -= 8; + src -= 8; + dst -= 8; } } - src += 7; dst += 7; /* adjust for any scalar finishing. */ + src += 7; + dst += 7; /* adjust for any scalar finishing. */ /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) *src) * DIVBY32768; - i--; src--; dst--; + *dst = ((float)*src) * DIVBY32768; + i--; + src--; + dst--; } cvt->len_cvt *= 2; @@ -998,43 +1014,48 @@ SDL_Convert_S16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_U16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_U16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Uint16 *src = ((const Uint16 *) (cvt->buf + cvt->len_cvt)) - 1; - float *dst = ((float *) (cvt->buf + cvt->len_cvt * 2)) - 1; + const Uint16 *src = ((const Uint16 *)(cvt->buf + cvt->len_cvt)) - 1; + float *dst = ((float *)(cvt->buf + cvt->len_cvt * 2)) - 1; int i; LOG_DEBUG_CONVERT("AUDIO_U16", "AUDIO_F32 (using NEON)"); /* Get dst aligned to 16 bytes (since buffer is growing, we don't have to worry about overreading from src) */ - for (i = cvt->len_cvt / sizeof (Sint16); i && (((size_t) (dst-7)) & 15); --i, --src, --dst) { - *dst = (((float) *src) * DIVBY32768) - 1.0f; + for (i = cvt->len_cvt / sizeof(Sint16); i && (((size_t)(dst - 7)) & 15); --i, --src, --dst) { + *dst = (((float)*src) * DIVBY32768) - 1.0f; } - src -= 7; dst -= 7; /* adjust to read NEON blocks from the start. */ - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + src -= 7; + dst -= 7; /* adjust to read NEON blocks from the start. */ + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t divby32768 = vdupq_n_f32(DIVBY32768); const float32x4_t negone = vdupq_n_f32(-1.0f); - while (i >= 8) { /* 8 * 16-bit */ - const uint16x8_t uints = vld1q_u16((uint16_t const *) src); /* get 8 uint16 into a NEON register. */ + while (i >= 8) { /* 8 * 16-bit */ + const uint16x8_t uints = vld1q_u16((uint16_t const *)src); /* get 8 uint16 into a NEON register. */ /* split uint16 to two int32, then convert to float, then multiply to normalize, subtract for sign, store. */ vst1q_f32(dst, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_low_u16(uints))), divby32768)); - vst1q_f32(dst+4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uints))), divby32768)); - i -= 8; src -= 8; dst -= 8; + vst1q_f32(dst + 4, vmlaq_f32(negone, vcvtq_f32_u32(vmovl_u16(vget_high_u16(uints))), divby32768)); + i -= 8; + src -= 8; + dst -= 8; } } - src += 7; dst += 7; /* adjust for any scalar finishing. */ + src += 7; + dst += 7; /* adjust for any scalar finishing. */ /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = (((float) *src) * DIVBY32768) - 1.0f; - i--; src--; dst--; + *dst = (((float)*src) * DIVBY32768) - 1.0f; + i--; + src--; + dst--; } cvt->len_cvt *= 2; @@ -1043,39 +1064,42 @@ SDL_Convert_U16_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_S32_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_S32_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const Sint32 *src = (const Sint32 *) cvt->buf; - float *dst = (float *) cvt->buf; + const Sint32 *src = (const Sint32 *)cvt->buf; + float *dst = (float *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_S32", "AUDIO_F32 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (Sint32); i && (((size_t) dst) & 15); --i, ++src, ++dst) { - *dst = ((float) (*src>>8)) * DIVBY8388607; + for (i = cvt->len_cvt / sizeof(Sint32); i && (((size_t)dst) & 15); --i, ++src, ++dst) { + *dst = ((float)(*src >> 8)) * DIVBY8388607; } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t divby8388607 = vdupq_n_f32(DIVBY8388607); - const int32_t *mmsrc = (const int32_t *) src; - while (i >= 4) { /* 4 * sint32 */ + const int32_t *mmsrc = (const int32_t *)src; + while (i >= 4) { /* 4 * sint32 */ /* shift out lowest bits so int fits in a float32. Small precision loss, but much faster. */ vst1q_f32(dst, vmulq_f32(vcvtq_f32_s32(vshrq_n_s32(vld1q_s32(mmsrc), 8)), divby8388607)); - i -= 4; mmsrc += 4; dst += 4; + i -= 4; + mmsrc += 4; + dst += 4; } - src = (const Sint32 *) mmsrc; + src = (const Sint32 *)mmsrc; } /* Finish off any leftovers with scalar operations. */ while (i) { - *dst = ((float) (*src>>8)) * DIVBY8388607; - i--; src++; dst++; + *dst = ((float)(*src >> 8)) * DIVBY8388607; + i--; + src++; + dst++; } if (cvt->filters[++cvt->filter_index]) { @@ -1083,17 +1107,16 @@ SDL_Convert_S32_to_F32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint8 *dst = (Sint8 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Sint8 *dst = (Sint8 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S8 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 127; @@ -1104,26 +1127,28 @@ SDL_Convert_F32_to_S8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t one = vdupq_n_f32(1.0f); const float32x4_t negone = vdupq_n_f32(-1.0f); const float32x4_t mulby127 = vdupq_n_f32(127.0f); - int8_t *mmdst = (int8_t *) dst; - while (i >= 16) { /* 16 * float32 */ - const int32x4_t ints1 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const int32x4_t ints2 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+4)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const int32x4_t ints3 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+8)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const int32x4_t ints4 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+12)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ - const int8x8_t i8lo = vmovn_s16(vcombine_s16(vmovn_s32(ints1), vmovn_s32(ints2))); /* narrow to sint16, combine, narrow to sint8 */ - const int8x8_t i8hi = vmovn_s16(vcombine_s16(vmovn_s32(ints3), vmovn_s32(ints4))); /* narrow to sint16, combine, narrow to sint8 */ - vst1q_s8(mmdst, vcombine_s8(i8lo, i8hi)); /* combine to int8x16_t, store out */ - i -= 16; src += 16; mmdst += 16; + int8_t *mmdst = (int8_t *)dst; + while (i >= 16) { /* 16 * float32 */ + const int32x4_t ints1 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ + const int32x4_t ints2 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 4)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ + const int32x4_t ints3 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 8)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ + const int32x4_t ints4 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 12)), one), mulby127)); /* load 4 floats, clamp, convert to sint32 */ + const int8x8_t i8lo = vmovn_s16(vcombine_s16(vmovn_s32(ints1), vmovn_s32(ints2))); /* narrow to sint16, combine, narrow to sint8 */ + const int8x8_t i8hi = vmovn_s16(vcombine_s16(vmovn_s32(ints3), vmovn_s32(ints4))); /* narrow to sint16, combine, narrow to sint8 */ + vst1q_s8(mmdst, vcombine_s8(i8lo, i8hi)); /* combine to int8x16_t, store out */ + i -= 16; + src += 16; + mmdst += 16; } - dst = (Sint8 *) mmdst; + dst = (Sint8 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -1136,7 +1161,9 @@ SDL_Convert_F32_to_S8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = (Sint8)(sample * 127.0f); } - i--; src++; dst++; + i--; + src++; + dst++; } cvt->len_cvt /= 4; @@ -1145,17 +1172,16 @@ SDL_Convert_F32_to_S8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Uint8 *dst = (Uint8 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Uint8 *dst = cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U8 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 255; @@ -1166,27 +1192,29 @@ SDL_Convert_F32_to_U8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t one = vdupq_n_f32(1.0f); const float32x4_t negone = vdupq_n_f32(-1.0f); const float32x4_t mulby127 = vdupq_n_f32(127.0f); - uint8_t *mmdst = (uint8_t *) dst; - while (i >= 16) { /* 16 * float32 */ - const uint32x4_t uints1 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ - const uint32x4_t uints2 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+4)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ - const uint32x4_t uints3 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+8)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ - const uint32x4_t uints4 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+12)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ - const uint8x8_t ui8lo = vmovn_u16(vcombine_u16(vmovn_u32(uints1), vmovn_u32(uints2))); /* narrow to uint16, combine, narrow to uint8 */ - const uint8x8_t ui8hi = vmovn_u16(vcombine_u16(vmovn_u32(uints3), vmovn_u32(uints4))); /* narrow to uint16, combine, narrow to uint8 */ - vst1q_u8(mmdst, vcombine_u8(ui8lo, ui8hi)); /* combine to uint8x16_t, store out */ - i -= 16; src += 16; mmdst += 16; + uint8_t *mmdst = (uint8_t *)dst; + while (i >= 16) { /* 16 * float32 */ + const uint32x4_t uints1 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ + const uint32x4_t uints2 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 4)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ + const uint32x4_t uints3 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 8)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ + const uint32x4_t uints4 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 12)), one), one), mulby127)); /* load 4 floats, clamp, convert to uint32 */ + const uint8x8_t ui8lo = vmovn_u16(vcombine_u16(vmovn_u32(uints1), vmovn_u32(uints2))); /* narrow to uint16, combine, narrow to uint8 */ + const uint8x8_t ui8hi = vmovn_u16(vcombine_u16(vmovn_u32(uints3), vmovn_u32(uints4))); /* narrow to uint16, combine, narrow to uint8 */ + vst1q_u8(mmdst, vcombine_u8(ui8lo, ui8hi)); /* combine to uint8x16_t, store out */ + i -= 16; + src += 16; + mmdst += 16; } - dst = (Uint8 *) mmdst; + dst = (Uint8 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -1199,7 +1227,9 @@ SDL_Convert_F32_to_U8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = (Uint8)((sample + 1.0f) * 127.0f); } - i--; src++; dst++; + i--; + src++; + dst++; } cvt->len_cvt /= 4; @@ -1208,17 +1238,16 @@ SDL_Convert_F32_to_U8_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint16 *dst = (Sint16 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Sint16 *dst = (Sint16 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S16 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 32767; @@ -1229,22 +1258,24 @@ SDL_Convert_F32_to_S16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t one = vdupq_n_f32(1.0f); const float32x4_t negone = vdupq_n_f32(-1.0f); const float32x4_t mulby32767 = vdupq_n_f32(32767.0f); - int16_t *mmdst = (int16_t *) dst; - while (i >= 8) { /* 8 * float32 */ - const int32x4_t ints1 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - const int32x4_t ints2 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+4)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ - vst1q_s16(mmdst, vcombine_s16(vmovn_s32(ints1), vmovn_s32(ints2))); /* narrow to sint16, combine, store out. */ - i -= 8; src += 8; mmdst += 8; + int16_t *mmdst = (int16_t *)dst; + while (i >= 8) { /* 8 * float32 */ + const int32x4_t ints1 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ + const int32x4_t ints2 = vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 4)), one), mulby32767)); /* load 4 floats, clamp, convert to sint32 */ + vst1q_s16(mmdst, vcombine_s16(vmovn_s32(ints1), vmovn_s32(ints2))); /* narrow to sint16, combine, store out. */ + i -= 8; + src += 8; + mmdst += 8; } - dst = (Sint16 *) mmdst; + dst = (Sint16 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -1257,7 +1288,9 @@ SDL_Convert_F32_to_S16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = (Sint16)(sample * 32767.0f); } - i--; src++; dst++; + i--; + src++; + dst++; } cvt->len_cvt /= 2; @@ -1266,17 +1299,16 @@ SDL_Convert_F32_to_S16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_U16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_U16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Uint16 *dst = (Uint16 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Uint16 *dst = (Uint16 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_U16 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 65535; @@ -1287,22 +1319,24 @@ SDL_Convert_F32_to_U16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); /* Make sure src is aligned too. */ - if ((((size_t) src) & 15) == 0) { + if (!(((size_t)src) & 15)) { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t one = vdupq_n_f32(1.0f); const float32x4_t negone = vdupq_n_f32(-1.0f); const float32x4_t mulby32767 = vdupq_n_f32(32767.0f); - uint16_t *mmdst = (uint16_t *) dst; - while (i >= 8) { /* 8 * float32 */ - const uint32x4_t uints1 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), one), mulby32767)); /* load 4 floats, clamp, convert to uint32 */ - const uint32x4_t uints2 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src+4)), one), one), mulby32767)); /* load 4 floats, clamp, convert to uint32 */ - vst1q_u16(mmdst, vcombine_u16(vmovn_u32(uints1), vmovn_u32(uints2))); /* narrow to uint16, combine, store out. */ - i -= 8; src += 8; mmdst += 8; + uint16_t *mmdst = (uint16_t *)dst; + while (i >= 8) { /* 8 * float32 */ + const uint32x4_t uints1 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), one), mulby32767)); /* load 4 floats, clamp, convert to uint32 */ + const uint32x4_t uints2 = vcvtq_u32_f32(vmulq_f32(vaddq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src + 4)), one), one), mulby32767)); /* load 4 floats, clamp, convert to uint32 */ + vst1q_u16(mmdst, vcombine_u16(vmovn_u32(uints1), vmovn_u32(uints2))); /* narrow to uint16, combine, store out. */ + i -= 8; + src += 8; + mmdst += 8; } - dst = (Uint16 *) mmdst; + dst = (Uint16 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -1315,7 +1349,9 @@ SDL_Convert_F32_to_U16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = (Uint16)((sample + 1.0f) * 32767.0f); } - i--; src++; dst++; + i--; + src++; + dst++; } cvt->len_cvt /= 2; @@ -1324,17 +1360,16 @@ SDL_Convert_F32_to_U16_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } -static void SDLCALL -SDL_Convert_F32_to_S32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) +static void SDLCALL SDL_Convert_F32_to_S32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) { - const float *src = (const float *) cvt->buf; - Sint32 *dst = (Sint32 *) cvt->buf; + const float *src = (const float *)cvt->buf; + Sint32 *dst = (Sint32 *)cvt->buf; int i; LOG_DEBUG_CONVERT("AUDIO_F32", "AUDIO_S32 (using NEON)"); /* Get dst aligned to 16 bytes */ - for (i = cvt->len_cvt / sizeof (float); i && (((size_t) dst) & 15); --i, ++src, ++dst) { + for (i = cvt->len_cvt / sizeof(float); i && (((size_t)dst) & 15); --i, ++src, ++dst) { const float sample = *src; if (sample >= 1.0f) { *dst = 2147483647; @@ -1345,20 +1380,22 @@ SDL_Convert_F32_to_S32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } } - SDL_assert(!i || ((((size_t) dst) & 15) == 0)); - SDL_assert(!i || ((((size_t) src) & 15) == 0)); + SDL_assert(!i || !(((size_t)dst) & 15)); + SDL_assert(!i || !(((size_t)src) & 15)); { /* Aligned! Do NEON blocks as long as we have 16 bytes available. */ const float32x4_t one = vdupq_n_f32(1.0f); const float32x4_t negone = vdupq_n_f32(-1.0f); const float32x4_t mulby8388607 = vdupq_n_f32(8388607.0f); - int32_t *mmdst = (int32_t *) dst; - while (i >= 4) { /* 4 * float32 */ + int32_t *mmdst = (int32_t *)dst; + while (i >= 4) { /* 4 * float32 */ vst1q_s32(mmdst, vshlq_n_s32(vcvtq_s32_f32(vmulq_f32(vminq_f32(vmaxq_f32(negone, vld1q_f32(src)), one), mulby8388607)), 8)); - i -= 4; src += 4; mmdst += 4; + i -= 4; + src += 4; + mmdst += 4; } - dst = (Sint32 *) mmdst; + dst = (Sint32 *)mmdst; } /* Finish off any leftovers with scalar operations. */ @@ -1371,7 +1408,9 @@ SDL_Convert_F32_to_S32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } else { *dst = ((Sint32)(sample * 8388607.0f)) << 8; } - i--; src++; dst++; + i--; + src++; + dst++; } if (cvt->filters[++cvt->filter_index]) { @@ -1380,8 +1419,6 @@ SDL_Convert_F32_to_S32_NEON(SDL_AudioCVT *cvt, SDL_AudioFormat format) } #endif - - void SDL_ChooseAudioConverters(void) { static SDL_bool converters_chosen = SDL_FALSE; @@ -1390,27 +1427,27 @@ void SDL_ChooseAudioConverters(void) return; } -#define SET_CONVERTER_FUNCS(fntype) \ - SDL_Convert_S8_to_F32 = SDL_Convert_S8_to_F32_##fntype; \ - SDL_Convert_U8_to_F32 = SDL_Convert_U8_to_F32_##fntype; \ - SDL_Convert_S16_to_F32 = SDL_Convert_S16_to_F32_##fntype; \ - SDL_Convert_U16_to_F32 = SDL_Convert_U16_to_F32_##fntype; \ - SDL_Convert_S32_to_F32 = SDL_Convert_S32_to_F32_##fntype; \ - SDL_Convert_F32_to_S8 = SDL_Convert_F32_to_S8_##fntype; \ - SDL_Convert_F32_to_U8 = SDL_Convert_F32_to_U8_##fntype; \ - SDL_Convert_F32_to_S16 = SDL_Convert_F32_to_S16_##fntype; \ - SDL_Convert_F32_to_U16 = SDL_Convert_F32_to_U16_##fntype; \ - SDL_Convert_F32_to_S32 = SDL_Convert_F32_to_S32_##fntype; \ - converters_chosen = SDL_TRUE - -#if HAVE_SSE2_INTRINSICS +#define SET_CONVERTER_FUNCS(fntype) \ + SDL_Convert_S8_to_F32 = SDL_Convert_S8_to_F32_##fntype; \ + SDL_Convert_U8_to_F32 = SDL_Convert_U8_to_F32_##fntype; \ + SDL_Convert_S16_to_F32 = SDL_Convert_S16_to_F32_##fntype; \ + SDL_Convert_U16_to_F32 = SDL_Convert_U16_to_F32_##fntype; \ + SDL_Convert_S32_to_F32 = SDL_Convert_S32_to_F32_##fntype; \ + SDL_Convert_F32_to_S8 = SDL_Convert_F32_to_S8_##fntype; \ + SDL_Convert_F32_to_U8 = SDL_Convert_F32_to_U8_##fntype; \ + SDL_Convert_F32_to_S16 = SDL_Convert_F32_to_S16_##fntype; \ + SDL_Convert_F32_to_U16 = SDL_Convert_F32_to_U16_##fntype; \ + SDL_Convert_F32_to_S32 = SDL_Convert_F32_to_S32_##fntype; \ + converters_chosen = SDL_TRUE + +#ifdef HAVE_SSE2_INTRINSICS if (SDL_HasSSE2()) { SET_CONVERTER_FUNCS(SSE2); return; } #endif -#if HAVE_NEON_INTRINSICS +#ifdef HAVE_NEON_INTRINSICS if (SDL_HasNEON()) { SET_CONVERTER_FUNCS(NEON); return; diff --git a/src/audio/SDL_mixer.c b/src/audio/SDL_mixer.c index 9c9e5df2176ba..bb42fe72748da 100644 --- a/src/audio/SDL_mixer.c +++ b/src/audio/SDL_mixer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -81,14 +81,12 @@ static const Uint8 mix8[] = { }; /* The volume ranges from 0 - 128 */ -#define ADJUST_VOLUME(s, v) (s = (s*v)/SDL_MIX_MAXVOLUME) -#define ADJUST_VOLUME_U8(s, v) (s = (((s-128)*v)/SDL_MIX_MAXVOLUME)+128) -#define ADJUST_VOLUME_U16(s, v) (s = (((s-32768)*v)/SDL_MIX_MAXVOLUME)+32768) +#define ADJUST_VOLUME(s, v) (s = (s * v) / SDL_MIX_MAXVOLUME) +#define ADJUST_VOLUME_U8(s, v) (s = (((s - 128) * v) / SDL_MIX_MAXVOLUME) + 128) +#define ADJUST_VOLUME_U16(s, v) (s = (((s - 32768) * v) / SDL_MIX_MAXVOLUME) + 32768) - -void -SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, - Uint32 len, int volume) +void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, + Uint32 len, int volume) { if (volume == 0) { return; @@ -97,258 +95,248 @@ SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, switch (format) { case AUDIO_U8: - { - Uint8 src_sample; - - while (len--) { - src_sample = *src; - ADJUST_VOLUME_U8(src_sample, volume); - *dst = mix8[*dst + src_sample]; - ++dst; - ++src; - } + { + Uint8 src_sample; + + while (len--) { + src_sample = *src; + ADJUST_VOLUME_U8(src_sample, volume); + *dst = mix8[*dst + src_sample]; + ++dst; + ++src; } - break; + } break; case AUDIO_S8: - { - Sint8 *dst8, *src8; - Sint8 src_sample; - int dst_sample; - const int max_audioval = SDL_MAX_SINT8; - const int min_audioval = SDL_MIN_SINT8; - - src8 = (Sint8 *) src; - dst8 = (Sint8 *) dst; - while (len--) { - src_sample = *src8; - ADJUST_VOLUME(src_sample, volume); - dst_sample = *dst8 + src_sample; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *dst8 = dst_sample; - ++dst8; - ++src8; + { + Sint8 *dst8, *src8; + Sint8 src_sample; + int dst_sample; + const int max_audioval = SDL_MAX_SINT8; + const int min_audioval = SDL_MIN_SINT8; + + src8 = (Sint8 *)src; + dst8 = (Sint8 *)dst; + while (len--) { + src_sample = *src8; + ADJUST_VOLUME(src_sample, volume); + dst_sample = *dst8 + src_sample; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *dst8 = dst_sample; + ++dst8; + ++src8; } - break; + } break; case AUDIO_S16LSB: - { - Sint16 src1, src2; - int dst_sample; - const int max_audioval = SDL_MAX_SINT16; - const int min_audioval = SDL_MIN_SINT16; - - len /= 2; - while (len--) { - src1 = SDL_SwapLE16(*(Sint16 *)src); - ADJUST_VOLUME(src1, volume); - src2 = SDL_SwapLE16(*(Sint16 *)dst); - src += 2; - dst_sample = src1 + src2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(Sint16 *)dst = SDL_SwapLE16(dst_sample); - dst += 2; + { + Sint16 src1, src2; + int dst_sample; + const int max_audioval = SDL_MAX_SINT16; + const int min_audioval = SDL_MIN_SINT16; + + len /= 2; + while (len--) { + src1 = SDL_SwapLE16(*(Sint16 *)src); + ADJUST_VOLUME(src1, volume); + src2 = SDL_SwapLE16(*(Sint16 *)dst); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(Sint16 *)dst = SDL_SwapLE16(dst_sample); + dst += 2; } - break; + } break; case AUDIO_S16MSB: - { - Sint16 src1, src2; - int dst_sample; - const int max_audioval = SDL_MAX_SINT16; - const int min_audioval = SDL_MIN_SINT16; - - len /= 2; - while (len--) { - src1 = SDL_SwapBE16(*(Sint16 *)src); - ADJUST_VOLUME(src1, volume); - src2 = SDL_SwapBE16(*(Sint16 *)dst); - src += 2; - dst_sample = src1 + src2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(Sint16 *)dst = SDL_SwapBE16(dst_sample); - dst += 2; + { + Sint16 src1, src2; + int dst_sample; + const int max_audioval = SDL_MAX_SINT16; + const int min_audioval = SDL_MIN_SINT16; + + len /= 2; + while (len--) { + src1 = SDL_SwapBE16(*(Sint16 *)src); + ADJUST_VOLUME(src1, volume); + src2 = SDL_SwapBE16(*(Sint16 *)dst); + src += 2; + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(Sint16 *)dst = SDL_SwapBE16(dst_sample); + dst += 2; } - break; + } break; case AUDIO_U16LSB: - { - Uint16 src1, src2; - int dst_sample; - const int max_audioval = SDL_MAX_SINT16; - const int min_audioval = SDL_MIN_SINT16; - - len /= 2; - while (len--) { - src1 = SDL_SwapLE16(*(Uint16 *)src); - ADJUST_VOLUME_U16(src1, volume); - src2 = SDL_SwapLE16(*(Uint16 *)dst); - src += 2; - dst_sample = src1 + src2 - 32768 * 2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - dst_sample += 32768; - *(Uint16 *)dst = SDL_SwapLE16(dst_sample); - dst += 2; + { + Uint16 src1, src2; + int dst_sample; + const int max_audioval = SDL_MAX_SINT16; + const int min_audioval = SDL_MIN_SINT16; + + len /= 2; + while (len--) { + src1 = SDL_SwapLE16(*(Uint16 *)src); + ADJUST_VOLUME_U16(src1, volume); + src2 = SDL_SwapLE16(*(Uint16 *)dst); + src += 2; + dst_sample = src1 + src2 - 32768 * 2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + dst_sample += 32768; + *(Uint16 *)dst = SDL_SwapLE16(dst_sample); + dst += 2; } - break; + } break; case AUDIO_U16MSB: - { - Uint16 src1, src2; - int dst_sample; - const int max_audioval = SDL_MAX_SINT16; - const int min_audioval = SDL_MIN_SINT16; - - len /= 2; - while (len--) { - src1 = SDL_SwapBE16(*(Uint16 *)src); - ADJUST_VOLUME_U16(src1, volume); - src2 = SDL_SwapBE16(*(Uint16 *)dst); - src += 2; - dst_sample = src1 + src2 - 32768 * 2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - dst_sample += 32768; - *(Uint16 *)dst = SDL_SwapBE16(dst_sample); - dst += 2; + { + Uint16 src1, src2; + int dst_sample; + const int max_audioval = SDL_MAX_SINT16; + const int min_audioval = SDL_MIN_SINT16; + + len /= 2; + while (len--) { + src1 = SDL_SwapBE16(*(Uint16 *)src); + ADJUST_VOLUME_U16(src1, volume); + src2 = SDL_SwapBE16(*(Uint16 *)dst); + src += 2; + dst_sample = src1 + src2 - 32768 * 2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + dst_sample += 32768; + *(Uint16 *)dst = SDL_SwapBE16(dst_sample); + dst += 2; } - break; + } break; case AUDIO_S32LSB: - { - const Uint32 *src32 = (Uint32 *) src; - Uint32 *dst32 = (Uint32 *) dst; - Sint64 src1, src2; - Sint64 dst_sample; - const Sint64 max_audioval = SDL_MAX_SINT32; - const Sint64 min_audioval = SDL_MIN_SINT32; - - len /= 4; - while (len--) { - src1 = (Sint64) ((Sint32) SDL_SwapLE32(*src32)); - src32++; - ADJUST_VOLUME(src1, volume); - src2 = (Sint64) ((Sint32) SDL_SwapLE32(*dst32)); - dst_sample = src1 + src2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(dst32++) = SDL_SwapLE32((Uint32) ((Sint32) dst_sample)); + { + const Uint32 *src32 = (Uint32 *)src; + Uint32 *dst32 = (Uint32 *)dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = SDL_MAX_SINT32; + const Sint64 min_audioval = SDL_MIN_SINT32; + + len /= 4; + while (len--) { + src1 = (Sint64)((Sint32)SDL_SwapLE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64)((Sint32)SDL_SwapLE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(dst32++) = SDL_SwapLE32((Uint32)((Sint32)dst_sample)); } - break; + } break; case AUDIO_S32MSB: - { - const Uint32 *src32 = (Uint32 *) src; - Uint32 *dst32 = (Uint32 *) dst; - Sint64 src1, src2; - Sint64 dst_sample; - const Sint64 max_audioval = SDL_MAX_SINT32; - const Sint64 min_audioval = SDL_MIN_SINT32; - - len /= 4; - while (len--) { - src1 = (Sint64) ((Sint32) SDL_SwapBE32(*src32)); - src32++; - ADJUST_VOLUME(src1, volume); - src2 = (Sint64) ((Sint32) SDL_SwapBE32(*dst32)); - dst_sample = src1 + src2; - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(dst32++) = SDL_SwapBE32((Uint32) ((Sint32) dst_sample)); + { + const Uint32 *src32 = (Uint32 *)src; + Uint32 *dst32 = (Uint32 *)dst; + Sint64 src1, src2; + Sint64 dst_sample; + const Sint64 max_audioval = SDL_MAX_SINT32; + const Sint64 min_audioval = SDL_MIN_SINT32; + + len /= 4; + while (len--) { + src1 = (Sint64)((Sint32)SDL_SwapBE32(*src32)); + src32++; + ADJUST_VOLUME(src1, volume); + src2 = (Sint64)((Sint32)SDL_SwapBE32(*dst32)); + dst_sample = src1 + src2; + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(dst32++) = SDL_SwapBE32((Uint32)((Sint32)dst_sample)); } - break; + } break; case AUDIO_F32LSB: - { - const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); - const float fvolume = (float) volume; - const float *src32 = (float *) src; - float *dst32 = (float *) dst; - float src1, src2; - double dst_sample; - /* !!! FIXME: are these right? */ - const double max_audioval = 3.402823466e+38F; - const double min_audioval = -3.402823466e+38F; - - len /= 4; - while (len--) { - src1 = ((SDL_SwapFloatLE(*src32) * fvolume) * fmaxvolume); - src2 = SDL_SwapFloatLE(*dst32); - src32++; - - dst_sample = ((double) src1) + ((double) src2); - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(dst32++) = SDL_SwapFloatLE((float) dst_sample); + { + const float fmaxvolume = 1.0f / ((float)SDL_MIX_MAXVOLUME); + const float fvolume = (float)volume; + const float *src32 = (float *)src; + float *dst32 = (float *)dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatLE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatLE(*dst32); + src32++; + + dst_sample = ((double)src1) + ((double)src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(dst32++) = SDL_SwapFloatLE((float)dst_sample); } - break; + } break; case AUDIO_F32MSB: - { - const float fmaxvolume = 1.0f / ((float) SDL_MIX_MAXVOLUME); - const float fvolume = (float) volume; - const float *src32 = (float *) src; - float *dst32 = (float *) dst; - float src1, src2; - double dst_sample; - /* !!! FIXME: are these right? */ - const double max_audioval = 3.402823466e+38F; - const double min_audioval = -3.402823466e+38F; - - len /= 4; - while (len--) { - src1 = ((SDL_SwapFloatBE(*src32) * fvolume) * fmaxvolume); - src2 = SDL_SwapFloatBE(*dst32); - src32++; - - dst_sample = ((double) src1) + ((double) src2); - if (dst_sample > max_audioval) { - dst_sample = max_audioval; - } else if (dst_sample < min_audioval) { - dst_sample = min_audioval; - } - *(dst32++) = SDL_SwapFloatBE((float) dst_sample); + { + const float fmaxvolume = 1.0f / ((float)SDL_MIX_MAXVOLUME); + const float fvolume = (float)volume; + const float *src32 = (float *)src; + float *dst32 = (float *)dst; + float src1, src2; + double dst_sample; + /* !!! FIXME: are these right? */ + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; + + len /= 4; + while (len--) { + src1 = ((SDL_SwapFloatBE(*src32) * fvolume) * fmaxvolume); + src2 = SDL_SwapFloatBE(*dst32); + src32++; + + dst_sample = ((double)src1) + ((double)src2); + if (dst_sample > max_audioval) { + dst_sample = max_audioval; + } else if (dst_sample < min_audioval) { + dst_sample = min_audioval; } + *(dst32++) = SDL_SwapFloatBE((float)dst_sample); } - break; + } break; - default: /* If this happens... FIXME! */ + default: /* If this happens... FIXME! */ SDL_SetError("SDL_MixAudioFormat(): unknown audio format"); return; } diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index a911de041e22e..6e8de52915b13 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,11 +30,11 @@ /* !!! FIXME: These are wordy and unlocalized... */ #define DEFAULT_OUTPUT_DEVNAME "System audio output device" -#define DEFAULT_INPUT_DEVNAME "System audio capture device" +#define DEFAULT_INPUT_DEVNAME "System audio capture device" /* The SDL audio driver */ typedef struct SDL_AudioDevice SDL_AudioDevice; -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this /* Audio targets should call this as devices are added to the system (such as a USB headset being plugged in), and should also be called for @@ -64,21 +64,21 @@ extern void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device); typedef struct SDL_AudioDriverImpl { - void (*DetectDevices) (void); - int (*OpenDevice) (_THIS, const char *devname); - void (*ThreadInit) (_THIS); /* Called by audio thread at start */ - void (*ThreadDeinit) (_THIS); /* Called by audio thread at end */ - void (*WaitDevice) (_THIS); - void (*PlayDevice) (_THIS); - Uint8 *(*GetDeviceBuf) (_THIS); - int (*CaptureFromDevice) (_THIS, void *buffer, int buflen); - void (*FlushCapture) (_THIS); - void (*CloseDevice) (_THIS); - void (*LockDevice) (_THIS); - void (*UnlockDevice) (_THIS); - void (*FreeDeviceHandle) (void *handle); /**< SDL is done with handle from SDL_AddAudioDevice() */ - void (*Deinitialize) (void); - int (*GetDefaultAudioInfo) (char **name, SDL_AudioSpec *spec, int iscapture); + void (*DetectDevices)(void); + int (*OpenDevice)(_THIS, const char *devname); + void (*ThreadInit)(_THIS); /* Called by audio thread at start */ + void (*ThreadDeinit)(_THIS); /* Called by audio thread at end */ + void (*WaitDevice)(_THIS); + void (*PlayDevice)(_THIS); + Uint8 *(*GetDeviceBuf)(_THIS); + int (*CaptureFromDevice)(_THIS, void *buffer, int buflen); + void (*FlushCapture)(_THIS); + void (*CloseDevice)(_THIS); + void (*LockDevice)(_THIS); + void (*UnlockDevice)(_THIS); + void (*FreeDeviceHandle)(void *handle); /**< SDL is done with handle from SDL_AddAudioDevice() */ + void (*Deinitialize)(void); + int (*GetDefaultAudioInfo)(char **name, SDL_AudioSpec *spec, int iscapture); /* !!! FIXME: add pause(), so we can optimize instead of mixing silence. */ @@ -91,7 +91,6 @@ typedef struct SDL_AudioDriverImpl SDL_bool SupportsNonPow2Samples; } SDL_AudioDriverImpl; - typedef struct SDL_AudioDeviceItem { void *handle; @@ -102,7 +101,6 @@ typedef struct SDL_AudioDeviceItem struct SDL_AudioDeviceItem *next; } SDL_AudioDeviceItem; - typedef struct SDL_AudioDriver { /* * * */ @@ -125,7 +123,6 @@ typedef struct SDL_AudioDriver SDL_AudioDeviceItem *inputDevices; } SDL_AudioDriver; - /* Define the SDL audio driver structure */ struct SDL_AudioDevice { @@ -176,8 +173,8 @@ typedef struct AudioBootStrap { const char *name; const char *desc; - SDL_bool (*init) (SDL_AudioDriverImpl * impl); - SDL_bool demand_only; /* 1==request explicitly, or it won't be available. */ + SDL_bool (*init)(SDL_AudioDriverImpl *impl); + SDL_bool demand_only; /* 1==request explicitly, or it won't be available. */ } AudioBootStrap; /* Not all of these are available in a given build. Use #ifdefs, etc. */ diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index e49b5506890e9..e71235e0a95fd 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,8 +43,7 @@ * Returns 0 on success, or -1 if the multiplication overflows, in which case f1 * does not get modified. */ -static int -SafeMult(size_t *f1, size_t f2) +static int SafeMult(size_t *f1, size_t f2) { if (*f1 > 0 && SIZE_MAX / *f1 <= f2) { return -1; @@ -66,21 +65,24 @@ typedef struct ADPCM_DecoderState void *cstate; /* Decoding state for each channel. */ /* ADPCM data. */ - struct { + struct + { Uint8 *data; size_t size; size_t pos; } input; /* Current ADPCM block in the ADPCM data above. */ - struct { + struct + { Uint8 *data; size_t size; size_t pos; } block; /* Decoded 16-bit PCM data. */ - struct { + struct + { Sint16 *data; size_t size; size_t pos; @@ -102,8 +104,7 @@ typedef struct MS_ADPCM_ChannelState } MS_ADPCM_ChannelState; #ifdef SDL_WAVE_DEBUG_LOG_FORMAT -static void -WaveDebugLogFormat(WaveFile *file) +static void WaveDebugLogFormat(WaveFile *file) { WaveFormat *format = &file->format; const char *fmtstr = "WAVE file: %s, %u Hz, %s, %u bits, %u %s/s"; @@ -137,55 +138,60 @@ WaveDebugLogFormat(WaveFile *file) break; } -#define SDL_WAVE_DEBUG_CHANNELCFG(STR, CODE) case CODE: wavechannel = STR; break; -#define SDL_WAVE_DEBUG_CHANNELSTR(STR, CODE) if (format->channelmask & CODE) { \ - SDL_strlcat(channelstr, channelstr[0] ? "-" STR : STR, sizeof(channelstr));} +#define SDL_WAVE_DEBUG_CHANNELCFG(STR, CODE) \ + case CODE: \ + wavechannel = STR; \ + break; +#define SDL_WAVE_DEBUG_CHANNELSTR(STR, CODE) \ + if (format->channelmask & CODE) { \ + SDL_strlcat(channelstr, channelstr[0] ? "-" STR : STR, sizeof(channelstr)); \ + } if (format->formattag == EXTENSIBLE_CODE && format->channelmask > 0) { switch (format->channelmask) { - SDL_WAVE_DEBUG_CHANNELCFG("1.0 Mono", 0x4) - SDL_WAVE_DEBUG_CHANNELCFG("1.1 Mono", 0xc) - SDL_WAVE_DEBUG_CHANNELCFG("2.0 Stereo", 0x3) - SDL_WAVE_DEBUG_CHANNELCFG("2.1 Stereo", 0xb) - SDL_WAVE_DEBUG_CHANNELCFG("3.0 Stereo", 0x7) - SDL_WAVE_DEBUG_CHANNELCFG("3.1 Stereo", 0xf) - SDL_WAVE_DEBUG_CHANNELCFG("3.0 Surround", 0x103) - SDL_WAVE_DEBUG_CHANNELCFG("3.1 Surround", 0x10b) - SDL_WAVE_DEBUG_CHANNELCFG("4.0 Quad", 0x33) - SDL_WAVE_DEBUG_CHANNELCFG("4.1 Quad", 0x3b) - SDL_WAVE_DEBUG_CHANNELCFG("4.0 Surround", 0x107) - SDL_WAVE_DEBUG_CHANNELCFG("4.1 Surround", 0x10f) - SDL_WAVE_DEBUG_CHANNELCFG("5.0", 0x37) - SDL_WAVE_DEBUG_CHANNELCFG("5.1", 0x3f) - SDL_WAVE_DEBUG_CHANNELCFG("5.0 Side", 0x607) - SDL_WAVE_DEBUG_CHANNELCFG("5.1 Side", 0x60f) - SDL_WAVE_DEBUG_CHANNELCFG("6.0", 0x137) - SDL_WAVE_DEBUG_CHANNELCFG("6.1", 0x13f) - SDL_WAVE_DEBUG_CHANNELCFG("6.0 Side", 0x707) - SDL_WAVE_DEBUG_CHANNELCFG("6.1 Side", 0x70f) - SDL_WAVE_DEBUG_CHANNELCFG("7.0", 0xf7) - SDL_WAVE_DEBUG_CHANNELCFG("7.1", 0xff) - SDL_WAVE_DEBUG_CHANNELCFG("7.0 Side", 0x6c7) - SDL_WAVE_DEBUG_CHANNELCFG("7.1 Side", 0x6cf) - SDL_WAVE_DEBUG_CHANNELCFG("7.0 Surround", 0x637) - SDL_WAVE_DEBUG_CHANNELCFG("7.1 Surround", 0x63f) - SDL_WAVE_DEBUG_CHANNELCFG("9.0 Surround", 0x5637) - SDL_WAVE_DEBUG_CHANNELCFG("9.1 Surround", 0x563f) - SDL_WAVE_DEBUG_CHANNELCFG("11.0 Surround", 0x56f7) - SDL_WAVE_DEBUG_CHANNELCFG("11.1 Surround", 0x56ff) + SDL_WAVE_DEBUG_CHANNELCFG("1.0 Mono", 0x4) + SDL_WAVE_DEBUG_CHANNELCFG("1.1 Mono", 0xc) + SDL_WAVE_DEBUG_CHANNELCFG("2.0 Stereo", 0x3) + SDL_WAVE_DEBUG_CHANNELCFG("2.1 Stereo", 0xb) + SDL_WAVE_DEBUG_CHANNELCFG("3.0 Stereo", 0x7) + SDL_WAVE_DEBUG_CHANNELCFG("3.1 Stereo", 0xf) + SDL_WAVE_DEBUG_CHANNELCFG("3.0 Surround", 0x103) + SDL_WAVE_DEBUG_CHANNELCFG("3.1 Surround", 0x10b) + SDL_WAVE_DEBUG_CHANNELCFG("4.0 Quad", 0x33) + SDL_WAVE_DEBUG_CHANNELCFG("4.1 Quad", 0x3b) + SDL_WAVE_DEBUG_CHANNELCFG("4.0 Surround", 0x107) + SDL_WAVE_DEBUG_CHANNELCFG("4.1 Surround", 0x10f) + SDL_WAVE_DEBUG_CHANNELCFG("5.0", 0x37) + SDL_WAVE_DEBUG_CHANNELCFG("5.1", 0x3f) + SDL_WAVE_DEBUG_CHANNELCFG("5.0 Side", 0x607) + SDL_WAVE_DEBUG_CHANNELCFG("5.1 Side", 0x60f) + SDL_WAVE_DEBUG_CHANNELCFG("6.0", 0x137) + SDL_WAVE_DEBUG_CHANNELCFG("6.1", 0x13f) + SDL_WAVE_DEBUG_CHANNELCFG("6.0 Side", 0x707) + SDL_WAVE_DEBUG_CHANNELCFG("6.1 Side", 0x70f) + SDL_WAVE_DEBUG_CHANNELCFG("7.0", 0xf7) + SDL_WAVE_DEBUG_CHANNELCFG("7.1", 0xff) + SDL_WAVE_DEBUG_CHANNELCFG("7.0 Side", 0x6c7) + SDL_WAVE_DEBUG_CHANNELCFG("7.1 Side", 0x6cf) + SDL_WAVE_DEBUG_CHANNELCFG("7.0 Surround", 0x637) + SDL_WAVE_DEBUG_CHANNELCFG("7.1 Surround", 0x63f) + SDL_WAVE_DEBUG_CHANNELCFG("9.0 Surround", 0x5637) + SDL_WAVE_DEBUG_CHANNELCFG("9.1 Surround", 0x563f) + SDL_WAVE_DEBUG_CHANNELCFG("11.0 Surround", 0x56f7) + SDL_WAVE_DEBUG_CHANNELCFG("11.1 Surround", 0x56ff) default: - SDL_WAVE_DEBUG_CHANNELSTR("FL", 0x1) - SDL_WAVE_DEBUG_CHANNELSTR("FR", 0x2) - SDL_WAVE_DEBUG_CHANNELSTR("FC", 0x4) - SDL_WAVE_DEBUG_CHANNELSTR("LF", 0x8) - SDL_WAVE_DEBUG_CHANNELSTR("BL", 0x10) - SDL_WAVE_DEBUG_CHANNELSTR("BR", 0x20) + SDL_WAVE_DEBUG_CHANNELSTR("FL", 0x1) + SDL_WAVE_DEBUG_CHANNELSTR("FR", 0x2) + SDL_WAVE_DEBUG_CHANNELSTR("FC", 0x4) + SDL_WAVE_DEBUG_CHANNELSTR("LF", 0x8) + SDL_WAVE_DEBUG_CHANNELSTR("BL", 0x10) + SDL_WAVE_DEBUG_CHANNELSTR("BR", 0x20) SDL_WAVE_DEBUG_CHANNELSTR("FLC", 0x40) SDL_WAVE_DEBUG_CHANNELSTR("FRC", 0x80) - SDL_WAVE_DEBUG_CHANNELSTR("BC", 0x100) - SDL_WAVE_DEBUG_CHANNELSTR("SL", 0x200) - SDL_WAVE_DEBUG_CHANNELSTR("SR", 0x400) - SDL_WAVE_DEBUG_CHANNELSTR("TC", 0x800) + SDL_WAVE_DEBUG_CHANNELSTR("BC", 0x100) + SDL_WAVE_DEBUG_CHANNELSTR("SL", 0x200) + SDL_WAVE_DEBUG_CHANNELSTR("SR", 0x400) + SDL_WAVE_DEBUG_CHANNELSTR("TC", 0x800) SDL_WAVE_DEBUG_CHANNELSTR("TFL", 0x1000) SDL_WAVE_DEBUG_CHANNELSTR("TFC", 0x2000) SDL_WAVE_DEBUG_CHANNELSTR("TFR", 0x4000) @@ -226,40 +232,39 @@ WaveDebugLogFormat(WaveFile *file) #endif #ifdef SDL_WAVE_DEBUG_DUMP_FORMAT -static void -WaveDebugDumpFormat(WaveFile *file, Uint32 rifflen, Uint32 fmtlen, Uint32 datalen) +static void WaveDebugDumpFormat(WaveFile *file, Uint32 rifflen, Uint32 fmtlen, Uint32 datalen) { WaveFormat *format = &file->format; const char *fmtstr1 = "WAVE chunk dump:\n" - "-------------------------------------------\n" - "RIFF %11u\n" - "-------------------------------------------\n" - " fmt %11u\n" - " wFormatTag 0x%04x\n" - " nChannels %11u\n" - " nSamplesPerSec %11u\n" - " nAvgBytesPerSec %11u\n" - " nBlockAlign %11u\n"; + "-------------------------------------------\n" + "RIFF %11u\n" + "-------------------------------------------\n" + " fmt %11u\n" + " wFormatTag 0x%04x\n" + " nChannels %11u\n" + " nSamplesPerSec %11u\n" + " nAvgBytesPerSec %11u\n" + " nBlockAlign %11u\n"; const char *fmtstr2 = " wBitsPerSample %11u\n"; const char *fmtstr3 = " cbSize %11u\n"; const char *fmtstr4a = " wValidBitsPerSample %11u\n"; const char *fmtstr4b = " wSamplesPerBlock %11u\n"; const char *fmtstr5 = " dwChannelMask 0x%08x\n" - " SubFormat\n" - " %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x\n"; + " SubFormat\n" + " %08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x\n"; const char *fmtstr6 = "-------------------------------------------\n" - " fact\n" - " dwSampleLength %11u\n"; + " fact\n" + " dwSampleLength %11u\n"; const char *fmtstr7 = "-------------------------------------------\n" - " data %11u\n" - "-------------------------------------------\n"; + " data %11u\n" + "-------------------------------------------\n"; char *dumpstr; size_t dumppos = 0; const size_t bufsize = 1024; int res; dumpstr = SDL_malloc(bufsize); - if (dumpstr == NULL) { + if (!dumpstr) { return; } dumpstr[0] = 0; @@ -317,8 +322,7 @@ WaveDebugDumpFormat(WaveFile *file, Uint32 rifflen, Uint32 fmtlen, Uint32 datale } #endif -static Sint64 -WaveAdjustToFactValue(WaveFile *file, Sint64 sampleframes) +static Sint64 WaveAdjustToFactValue(WaveFile *file, Sint64 sampleframes) { if (file->fact.status == 2) { if (file->facthint == FactStrict && sampleframes < file->fact.samplelength) { @@ -331,8 +335,7 @@ WaveAdjustToFactValue(WaveFile *file, Sint64 sampleframes) return sampleframes; } -static int -MS_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) +static int MS_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; const size_t blockheadersize = (size_t)file->format.channels * 7; @@ -371,8 +374,7 @@ MS_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) return 0; } -static int -MS_ADPCM_Init(WaveFile *file, size_t datalength) +static int MS_ADPCM_Init(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; WaveChunk *chunk = &file->chunk; @@ -380,7 +382,7 @@ MS_ADPCM_Init(WaveFile *file, size_t datalength) const size_t blockdatasize = (size_t)format->blockalign - blockheadersize; const size_t blockframebitsize = (size_t)format->bitspersample * format->channels; const size_t blockdatasamples = (blockdatasize * 8) / blockframebitsize; - const Sint16 presetcoeffs[14] = {256, 0, 512, -256, 0, 0, 192, 64, 240, 0, 460, -208, 392, -232}; + const Sint16 presetcoeffs[14] = { 256, 0, 512, -256, 0, 0, 192, 64, 240, 0, 460, -208, 392, -232 }; size_t i, coeffcount; MS_ADPCM_CoeffData *coeffdata; @@ -439,7 +441,7 @@ MS_ADPCM_Init(WaveFile *file, size_t datalength) coeffdata = (MS_ADPCM_CoeffData *)SDL_malloc(sizeof(MS_ADPCM_CoeffData) + coeffcount * 4); file->decoderdata = coeffdata; /* Freed in cleanup. */ - if (coeffdata == NULL) { + if (!coeffdata) { return SDL_OutOfMemory(); } coeffdata->coeff = &coeffdata->aligndummy; @@ -490,8 +492,7 @@ MS_ADPCM_Init(WaveFile *file, size_t datalength) return 0; } -static Sint16 -MS_ADPCM_ProcessNibble(MS_ADPCM_ChannelState *cstate, Sint32 sample1, Sint32 sample2, Uint8 nybble) +static Sint16 MS_ADPCM_ProcessNibble(MS_ADPCM_ChannelState *cstate, Sint32 sample1, Sint32 sample2, Uint8 nybble) { const Sint32 max_audioval = 32767; const Sint32 min_audioval = -32768; @@ -527,8 +528,7 @@ MS_ADPCM_ProcessNibble(MS_ADPCM_ChannelState *cstate, Sint32 sample1, Sint32 sam return (Sint16)new_sample; } -static int -MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) +static int MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) { Uint8 coeffindex; const Uint32 channels = state->channels; @@ -549,20 +549,20 @@ MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) cstate[c].coeff2 = ddata->coeff[coeffindex * 2 + 1]; /* Initial delta value. */ - o = channels + c * 2; + o = (size_t)channels + c * 2; cstate[c].delta = state->block.data[o] | ((Uint16)state->block.data[o + 1] << 8); /* Load the samples from the header. Interestingly, the sample later in * the output stream comes first. */ - o = channels * 3 + c * 2; + o = (size_t)channels * 3 + c * 2; sample = state->block.data[o] | ((Sint32)state->block.data[o + 1] << 8); if (sample >= 0x8000) { sample -= 0x10000; } state->output.data[state->output.pos + channels] = (Sint16)sample; - o = channels * 5 + c * 2; + o = (size_t)channels * 5 + c * 2; sample = state->block.data[o] | ((Sint32)state->block.data[o + 1] << 8); if (sample >= 0x8000) { sample -= 0x10000; @@ -588,8 +588,7 @@ MS_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) * will always contain full sample frames (same sample count for each channel). * Incomplete sample frames are discarded. */ -static int -MS_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) +static int MS_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) { Uint16 nybble = 0; Sint16 sample1, sample2; @@ -636,8 +635,7 @@ MS_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) return 0; } -static int -MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) +static int MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) { int result; size_t bytesleft, outputsize; @@ -686,7 +684,7 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) state.output.pos = 0; state.output.size = outputsize / sizeof(Sint16); state.output.data = (Sint16 *)SDL_calloc(1, outputsize); - if (state.output.data == NULL) { + if (!state.output.data) { return SDL_OutOfMemory(); } @@ -736,8 +734,7 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static int -IMA_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) +static int IMA_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; const size_t blockheadersize = (size_t)format->channels * 4; @@ -790,8 +787,7 @@ IMA_ADPCM_CalculateSampleFrames(WaveFile *file, size_t datalength) return 0; } -static int -IMA_ADPCM_Init(WaveFile *file, size_t datalength) +static int IMA_ADPCM_Init(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; WaveChunk *chunk = &file->chunk; @@ -820,7 +816,7 @@ IMA_ADPCM_Init(WaveFile *file, size_t datalength) /* There's no specification for this, but it's basically the same * format because the extensible header has wSampePerBlocks too. */ - } else { + } else { /* The Standards Update says there 'should' be 2 bytes for wSamplesPerBlock. */ if (chunk->size >= 20 && format->extsize >= 2) { format->samplesperblock = chunk->data[18] | ((Uint16)chunk->data[19] << 8); @@ -856,8 +852,7 @@ IMA_ADPCM_Init(WaveFile *file, size_t datalength) return 0; } -static Sint16 -IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 nybble) +static Sint16 IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 nybble) { const Sint32 max_audioval = 32767; const Sint32 min_audioval = -32768; @@ -901,14 +896,18 @@ IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 nybble) * (nybble & 0x8 ? -1 : 1) * ((nybble & 0x7) * step / 4 + step / 8) */ delta = step >> 3; - if (nybble & 0x04) + if (nybble & 0x04) { delta += step; - if (nybble & 0x02) + } + if (nybble & 0x02) { delta += step >> 1; - if (nybble & 0x01) + } + if (nybble & 0x01) { delta += step >> 2; - if (nybble & 0x08) + } + if (nybble & 0x08) { delta = -delta; + } sample = lastsample + delta; @@ -922,12 +921,11 @@ IMA_ADPCM_ProcessNibble(Sint8 *cindex, Sint16 lastsample, Uint8 nybble) return (Sint16)sample; } -static int -IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) +static int IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) { Sint16 step; Uint32 c; - Uint8 *cstate = (Uint8 *) state->cstate; + Uint8 *cstate = (Uint8 *)state->cstate; for (c = 0; c < state->channels; c++) { size_t o = state->block.pos + c * 4; @@ -945,7 +943,7 @@ IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) /* Reserved byte in block header, should be 0. */ if (state->block.data[o + 3] != 0) { - /* Uh oh, corrupt data? Buggy code? */ ; + /* Uh oh, corrupt data? Buggy code? */; } } @@ -962,13 +960,12 @@ IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state) * contains full sample frames (same sample count for each channel). * Incomplete sample frames are discarded. */ -static int -IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) +static int IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) { size_t i; int retval = 0; const Uint32 channels = state->channels; - const size_t subblockframesize = channels * 4; + const size_t subblockframesize = (size_t)channels * 4; Uint64 bytesrequired; Uint32 c; @@ -1032,8 +1029,7 @@ IMA_ADPCM_DecodeBlockData(ADPCM_DecoderState *state) return retval; } -static int -IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) +static int IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) { int result; size_t bytesleft, outputsize; @@ -1079,12 +1075,12 @@ IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) state.output.pos = 0; state.output.size = outputsize / sizeof(Sint16); state.output.data = (Sint16 *)SDL_malloc(outputsize); - if (state.output.data == NULL) { + if (!state.output.data) { return SDL_OutOfMemory(); } cstate = (Sint8 *)SDL_calloc(state.channels, sizeof(Sint8)); - if (cstate == NULL) { + if (!cstate) { SDL_free(state.output.data); return SDL_OutOfMemory(); } @@ -1136,8 +1132,7 @@ IMA_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static int -LAW_Init(WaveFile *file, size_t datalength) +static int LAW_Init(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; @@ -1165,8 +1160,7 @@ LAW_Init(WaveFile *file, size_t datalength) return 0; } -static int -LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) +static int LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) { #ifdef SDL_WAVE_LAW_LUT const Sint16 alaw_lut[256] = { @@ -1241,7 +1235,7 @@ LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) /* 1 to avoid allocating zero bytes, to keep static analysis happy. */ src = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1); - if (src == NULL) { + if (!src) { return SDL_OutOfMemory(); } chunk->data = NULL; @@ -1308,8 +1302,7 @@ LAW_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static int -PCM_Init(WaveFile *file, size_t datalength) +static int PCM_Init(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; @@ -1352,8 +1345,7 @@ PCM_Init(WaveFile *file, size_t datalength) return 0; } -static int -PCM_ConvertSint24ToSint32(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) +static int PCM_ConvertSint24ToSint32(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) { WaveFormat *format = &file->format; WaveChunk *chunk = &file->chunk; @@ -1374,7 +1366,7 @@ PCM_ConvertSint24ToSint32(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) /* 1 to avoid allocating zero bytes, to keep static analysis happy. */ ptr = (Uint8 *)SDL_realloc(chunk->data, expanded_len ? expanded_len : 1); - if (ptr == NULL) { + if (!ptr) { return SDL_OutOfMemory(); } @@ -1404,8 +1396,7 @@ PCM_ConvertSint24ToSint32(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static int -PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) +static int PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) { WaveFormat *format = &file->format; WaveChunk *chunk = &file->chunk; @@ -1447,12 +1438,11 @@ PCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len) return 0; } -static WaveRiffSizeHint -WaveGetRiffSizeHint() +static WaveRiffSizeHint WaveGetRiffSizeHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_RIFF_CHUNK_SIZE); - if (hint != NULL) { + if (hint) { if (SDL_strcmp(hint, "force") == 0) { return RiffSizeForce; } else if (SDL_strcmp(hint, "ignore") == 0) { @@ -1467,12 +1457,11 @@ WaveGetRiffSizeHint() return RiffSizeNoHint; } -static WaveTruncationHint -WaveGetTruncationHint() +static WaveTruncationHint WaveGetTruncationHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_TRUNCATION); - if (hint != NULL) { + if (hint) { if (SDL_strcmp(hint, "verystrict") == 0) { return TruncVeryStrict; } else if (SDL_strcmp(hint, "strict") == 0) { @@ -1487,12 +1476,11 @@ WaveGetTruncationHint() return TruncNoHint; } -static WaveFactChunkHint -WaveGetFactChunkHint() +static WaveFactChunkHint WaveGetFactChunkHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WAVE_FACT_CHUNK); - if (hint != NULL) { + if (hint) { if (SDL_strcmp(hint, "truncate") == 0) { return FactTruncate; } else if (SDL_strcmp(hint, "strict") == 0) { @@ -1507,18 +1495,16 @@ WaveGetFactChunkHint() return FactNoHint; } -static void -WaveFreeChunkData(WaveChunk *chunk) +static void WaveFreeChunkData(WaveChunk *chunk) { - if (chunk->data != NULL) { + if (chunk->data) { SDL_free(chunk->data); chunk->data = NULL; } chunk->size = 0; } -static int -WaveNextChunk(SDL_RWops *src, WaveChunk *chunk) +static int WaveNextChunk(SDL_RWops *src, WaveChunk *chunk) { Uint32 chunkheader[2]; Sint64 nextposition = chunk->position + chunk->length; @@ -1550,8 +1536,7 @@ WaveNextChunk(SDL_RWops *src, WaveChunk *chunk) return 0; } -static int -WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length) +static int WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length) { WaveFreeChunkData(chunk); @@ -1560,8 +1545,8 @@ WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length) } if (length > 0) { - chunk->data = (Uint8 *) SDL_malloc(length); - if (chunk->data == NULL) { + chunk->data = (Uint8 *)SDL_malloc(length); + if (!chunk->data) { return SDL_OutOfMemory(); } @@ -1579,30 +1564,32 @@ WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length) return 0; } -static int -WaveReadChunkData(SDL_RWops *src, WaveChunk *chunk) +static int WaveReadChunkData(SDL_RWops *src, WaveChunk *chunk) { return WaveReadPartialChunkData(src, chunk, chunk->length); } -typedef struct WaveExtensibleGUID { +typedef struct WaveExtensibleGUID +{ Uint16 encoding; Uint8 guid[16]; } WaveExtensibleGUID; /* Some of the GUIDs that are used by WAVEFORMATEXTENSIBLE. */ -#define WAVE_FORMATTAG_GUID(tag) {(tag) & 0xff, (tag) >> 8, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113} +#define WAVE_FORMATTAG_GUID(tag) \ + { \ + (tag) & 0xff, (tag) >> 8, 0, 0, 0, 0, 16, 0, 128, 0, 0, 170, 0, 56, 155, 113 \ + } static WaveExtensibleGUID extensible_guids[] = { - {PCM_CODE, WAVE_FORMATTAG_GUID(PCM_CODE)}, - {MS_ADPCM_CODE, WAVE_FORMATTAG_GUID(MS_ADPCM_CODE)}, - {IEEE_FLOAT_CODE, WAVE_FORMATTAG_GUID(IEEE_FLOAT_CODE)}, - {ALAW_CODE, WAVE_FORMATTAG_GUID(ALAW_CODE)}, - {MULAW_CODE, WAVE_FORMATTAG_GUID(MULAW_CODE)}, - {IMA_ADPCM_CODE, WAVE_FORMATTAG_GUID(IMA_ADPCM_CODE)} + { PCM_CODE, WAVE_FORMATTAG_GUID(PCM_CODE) }, + { MS_ADPCM_CODE, WAVE_FORMATTAG_GUID(MS_ADPCM_CODE) }, + { IEEE_FLOAT_CODE, WAVE_FORMATTAG_GUID(IEEE_FLOAT_CODE) }, + { ALAW_CODE, WAVE_FORMATTAG_GUID(ALAW_CODE) }, + { MULAW_CODE, WAVE_FORMATTAG_GUID(MULAW_CODE) }, + { IMA_ADPCM_CODE, WAVE_FORMATTAG_GUID(IMA_ADPCM_CODE) } }; -static Uint16 -WaveGetFormatGUIDEncoding(WaveFormat *format) +static Uint16 WaveGetFormatGUIDEncoding(WaveFormat *format) { size_t i; for (i = 0; i < SDL_arraysize(extensible_guids); i++) { @@ -1613,8 +1600,7 @@ WaveGetFormatGUIDEncoding(WaveFormat *format) return UNKNOWN_CODE; } -static int -WaveReadFormat(WaveFile *file) +static int WaveReadFormat(WaveFile *file) { WaveChunk *chunk = &file->chunk; WaveFormat *format = &file->format; @@ -1626,7 +1612,7 @@ WaveReadFormat(WaveFile *file) return SDL_SetError("Data of WAVE fmt chunk too big"); } fmtsrc = SDL_RWFromConstMem(chunk->data, (int)chunk->size); - if (fmtsrc == NULL) { + if (!fmtsrc) { return SDL_OutOfMemory(); } @@ -1675,8 +1661,7 @@ WaveReadFormat(WaveFile *file) return 0; } -static int -WaveCheckFormat(WaveFile *file, size_t datalength) +static int WaveCheckFormat(WaveFile *file, size_t datalength) { WaveFormat *format = &file->format; @@ -1726,7 +1711,7 @@ WaveCheckFormat(WaveFile *file, size_t datalength) /* All supported formats must have a proper block size. */ if (format->blockalign == 0) { - return SDL_SetError("Invalid block alignment"); + format->blockalign = 1; /* force it to 1 if it was unset. */ } /* If the fact chunk is valid and the appropriate hint is set, the @@ -1783,8 +1768,7 @@ WaveCheckFormat(WaveFile *file, size_t datalength) return 0; } -static int -WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +static int WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) { int result; Uint32 chunkcount = 0; @@ -1803,7 +1787,7 @@ WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf, SDL_zero(datachunk); envchunkcountlimit = SDL_getenv("SDL_WAVE_CHUNK_LIMIT"); - if (envchunkcountlimit != NULL) { + if (envchunkcountlimit) { unsigned int count; if (SDL_sscanf(envchunkcountlimit, "%u", &count) == 1) { chunkcountlimit = count <= SDL_MAX_UINT32 ? count : SDL_MAX_UINT32; @@ -2049,7 +2033,7 @@ WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf, SDL_zerop(spec); spec->freq = format->frequency; spec->channels = (Uint8)format->channels; - spec->samples = 4096; /* Good default buffer size */ + spec->samples = 4096; /* Good default buffer size */ switch (format->encoding) { case MS_ADPCM_CODE: @@ -2093,8 +2077,7 @@ WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf, return 0; } -SDL_AudioSpec * -SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) +SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len) { int result; WaveFile file; @@ -2102,16 +2085,16 @@ SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_b SDL_zero(file); /* Make sure we are passed a valid data source */ - if (src == NULL) { + if (!src) { /* Error may come from RWops. */ return NULL; - } else if (spec == NULL) { + } else if (!spec) { SDL_InvalidParamError("spec"); return NULL; - } else if (audio_buf == NULL) { + } else if (!audio_buf) { SDL_InvalidParamError("audio_buf"); return NULL; - } else if (audio_len == NULL) { + } else if (!audio_len) { SDL_InvalidParamError("audio_len"); return NULL; } @@ -2146,8 +2129,7 @@ SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_b /* Since the WAV memory is allocated in the shared library, it must also be freed here. (Necessary under Win32, VC++) */ -void -SDL_FreeWAV(Uint8 *audio_buf) +void SDL_FreeWAV(Uint8 *audio_buf) { SDL_free(audio_buf); } diff --git a/src/audio/SDL_wave.h b/src/audio/SDL_wave.h index c96f957deb6ff..b0e0e68aca459 100644 --- a/src/audio/SDL_wave.h +++ b/src/audio/SDL_wave.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,14 +26,14 @@ /* Define values for Microsoft WAVE format */ /*******************************************/ /* FOURCC */ -#define RIFF 0x46464952 /* "RIFF" */ -#define WAVE 0x45564157 /* "WAVE" */ -#define FACT 0x74636166 /* "fact" */ -#define LIST 0x5453494c /* "LIST" */ -#define BEXT 0x74786562 /* "bext" */ -#define JUNK 0x4B4E554A /* "JUNK" */ -#define FMT 0x20746D66 /* "fmt " */ -#define DATA 0x61746164 /* "data" */ +#define RIFF 0x46464952 /* "RIFF" */ +#define WAVE 0x45564157 /* "WAVE" */ +#define FACT 0x74636166 /* "fact" */ +#define LIST 0x5453494c /* "LIST" */ +#define BEXT 0x74786562 /* "bext" */ +#define JUNK 0x4B4E554A /* "JUNK" */ +#define FMT 0x20746D66 /* "fmt " */ +#define DATA 0x61746164 /* "data" */ /* Format tags */ #define UNKNOWN_CODE 0x0000 #define PCM_CODE 0x0001 @@ -49,13 +49,13 @@ /* Stores the WAVE format information. */ typedef struct WaveFormat { - Uint16 formattag; /* Raw value of the first field in the fmt chunk data. */ - Uint16 encoding; /* Actual encoding, possibly from the extensible header. */ - Uint16 channels; /* Number of channels. */ - Uint32 frequency; /* Sampling rate in Hz. */ - Uint32 byterate; /* Average bytes per second. */ - Uint16 blockalign; /* Bytes per block. */ - Uint16 bitspersample; /* Currently supported are 8, 16, 24, 32, and 4 for ADPCM. */ + Uint16 formattag; /* Raw value of the first field in the fmt chunk data. */ + Uint16 encoding; /* Actual encoding, possibly from the extensible header. */ + Uint16 channels; /* Number of channels. */ + Uint32 frequency; /* Sampling rate in Hz. */ + Uint32 byterate; /* Average bytes per second. */ + Uint16 blockalign; /* Bytes per block. */ + Uint16 bitspersample; /* Currently supported are 8, 16, 24, 32, and 4 for ADPCM. */ /* Extra information size. Number of extra bytes starting at byte 18 in the * fmt chunk data. This is at least 22 for the extensible header. @@ -66,11 +66,12 @@ typedef struct WaveFormat Uint16 validsamplebits; Uint32 samplesperblock; /* For compressed formats. Can be zero. Actually 16 bits in the header. */ Uint32 channelmask; - Uint8 subformat[16]; /* A format GUID. */ + Uint8 subformat[16]; /* A format GUID. */ } WaveFormat; /* Stores information on the fact chunk. */ -typedef struct WaveFact { +typedef struct WaveFact +{ /* Represents the state of the fact chunk in the WAVE file. * Set to -1 if the fact chunk is invalid. * Set to 0 if the fact chunk is not present @@ -101,7 +102,8 @@ typedef struct WaveChunk } WaveChunk; /* Controls how the size of the RIFF chunk affects the loading of a WAVE file. */ -typedef enum WaveRiffSizeHint { +typedef enum WaveRiffSizeHint +{ RiffSizeNoHint, RiffSizeForce, RiffSizeIgnoreZero, @@ -110,7 +112,8 @@ typedef enum WaveRiffSizeHint { } WaveRiffSizeHint; /* Controls how a truncated WAVE file is handled. */ -typedef enum WaveTruncationHint { +typedef enum WaveTruncationHint +{ TruncNoHint, TruncVeryStrict, TruncStrict, @@ -119,7 +122,8 @@ typedef enum WaveTruncationHint { } WaveTruncationHint; /* Controls how the fact chunk affects the loading of a WAVE file. */ -typedef enum WaveFactChunkHint { +typedef enum WaveFactChunkHint +{ FactNoHint, FactTruncate, FactStrict, @@ -139,7 +143,7 @@ typedef struct WaveFile */ Sint64 sampleframes; - void *decoderdata; /* Some decoders require extra data for a state. */ + void *decoderdata; /* Some decoders require extra data for a state. */ WaveRiffSizeHint riffhint; WaveTruncationHint trunchint; diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index 5f318661d0e00..93bcaf3f78cae 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_AAUDIO +#ifdef SDL_AUDIO_DRIVER_AAUDIO #include "SDL_audio.h" #include "SDL_loadso.h" @@ -30,17 +30,17 @@ /* Debug */ #if 0 -# define LOGI(...) SDL_Log(__VA_ARGS__); +#define LOGI(...) SDL_Log(__VA_ARGS__); #else -# define LOGI(...) +#define LOGI(...) #endif typedef struct AAUDIO_Data { AAudioStreamBuilder *builder; void *handle; -#define SDL_PROC(ret,func,params) ret (*func) params; -# include "SDL_aaudiofuncs.h" +#define SDL_PROC(ret, func, params) ret (*func) params; +#include "SDL_aaudiofuncs.h" #undef SDL_PROC } AAUDIO_Data; static AAUDIO_Data ctx; @@ -50,28 +50,27 @@ static SDL_AudioDevice *captureDevice = NULL; static int aaudio_LoadFunctions(AAUDIO_Data *data) { -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_LoadFunction(data->handle, #func); \ - if (! data->func) { \ - return SDL_SetError("Couldn't load AAUDIO function %s: %s", #func, SDL_GetError()); \ - } \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_LoadFunction(data->handle, #func); \ + if (!data->func) { \ + return SDL_SetError("Couldn't load AAUDIO function %s: %s", #func, SDL_GetError()); \ + } \ } while (0); #include "SDL_aaudiofuncs.h" #undef SDL_PROC return 0; } -void aaudio_errorCallback( AAudioStream *stream, void *userData, aaudio_result_t error ); -void aaudio_errorCallback( AAudioStream *stream, void *userData, aaudio_result_t error ) +void aaudio_errorCallback(AAudioStream *stream, void *userData, aaudio_result_t error); +void aaudio_errorCallback(AAudioStream *stream, void *userData, aaudio_result_t error) { - LOGI( "SDL aaudio_errorCallback: %d - %s", error, ctx.AAudio_convertResultToText( error ) ); + LOGI("SDL aaudio_errorCallback: %d - %s", error, ctx.AAudio_convertResultToText(error)); } #define LIB_AAUDIO_SO "libaaudio.so" -static int -aaudio_OpenDevice(_THIS, const char *devname) +static int aaudio_OpenDevice(_THIS, const char *devname) { struct SDL_PrivateAudioData *private; SDL_bool iscapture = this->iscapture; @@ -94,33 +93,33 @@ aaudio_OpenDevice(_THIS, const char *devname) audioDevice = this; } - this->hidden = (struct SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } private = this->hidden; ctx.AAudioStreamBuilder_setSampleRate(ctx.builder, this->spec.freq); ctx.AAudioStreamBuilder_setChannelCount(ctx.builder, this->spec.channels); + if(devname) { + private->devid = SDL_atoi(devname); + LOGI("Opening device id %d", private->devid); + ctx.AAudioStreamBuilder_setDeviceId(ctx.builder, private->devid); + } { - aaudio_direction_t direction = (iscapture ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT); + const aaudio_direction_t direction = (iscapture ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT); ctx.AAudioStreamBuilder_setDirection(ctx.builder, direction); } { - aaudio_format_t format = AAUDIO_FORMAT_PCM_FLOAT; - if (this->spec.format == AUDIO_S16SYS) { - format = AAUDIO_FORMAT_PCM_I16; - } else if (this->spec.format == AUDIO_S16SYS) { - format = AAUDIO_FORMAT_PCM_FLOAT; - } + const aaudio_format_t format = (this->spec.format == AUDIO_S16SYS) ? AAUDIO_FORMAT_PCM_I16 : AAUDIO_FORMAT_PCM_FLOAT; ctx.AAudioStreamBuilder_setFormat(ctx.builder, format); } - ctx.AAudioStreamBuilder_setErrorCallback( ctx.builder, aaudio_errorCallback, private ); + ctx.AAudioStreamBuilder_setErrorCallback(ctx.builder, aaudio_errorCallback, private); LOGI("AAudio Try to open %u hz %u bit chan %u %s samples %u", - this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), - this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); + this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), + this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); res = ctx.AAudioStreamBuilder_openStream(ctx.builder, &private->stream); if (res != AAUDIO_OK) { @@ -140,16 +139,16 @@ aaudio_OpenDevice(_THIS, const char *devname) } LOGI("AAudio Try to open %u hz %u bit chan %u %s samples %u", - this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), - this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); + this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), + this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); SDL_CalculateAudioSpec(&this->spec); /* Allocate mixing buffer */ if (!iscapture) { private->mixlen = this->spec.size; - private->mixbuf = (Uint8 *) SDL_malloc(private->mixlen); - if (private->mixbuf == NULL) { + private->mixbuf = (Uint8 *)SDL_malloc(private->mixlen); + if (!private->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(private->mixbuf, this->spec.silence, this->spec.size); @@ -167,8 +166,7 @@ aaudio_OpenDevice(_THIS, const char *devname) return 0; } -static void -aaudio_CloseDevice(_THIS) +static void aaudio_CloseDevice(_THIS) { struct SDL_PrivateAudioData *private = this->hidden; aaudio_result_t res; @@ -202,22 +200,113 @@ aaudio_CloseDevice(_THIS) SDL_free(this->hidden); } -static Uint8 * -aaudio_GetDeviceBuf(_THIS) +static Uint8 *aaudio_GetDeviceBuf(_THIS) { struct SDL_PrivateAudioData *private = this->hidden; return private->mixbuf; } -static void -aaudio_PlayDevice(_THIS) +/* Try to reestablish an AAudioStream. + + This needs to get a stream with the same format as the previous one, + even if this means AAudio needs to handle a conversion it didn't when + we initially opened the device. If we can't get that, we are forced + to give up here. + + (This is more robust in SDL3, which is designed to handle + abrupt format changes.) +*/ +static int RebuildAAudioStream(SDL_AudioDevice *device) +{ + struct SDL_PrivateAudioData *hidden = device->hidden; + const SDL_bool iscapture = device->iscapture; + aaudio_result_t res; + + ctx.AAudioStreamBuilder_setSampleRate(ctx.builder, device->spec.freq); + ctx.AAudioStreamBuilder_setChannelCount(ctx.builder, device->spec.channels); + if(hidden->devid) { + LOGI("Reopening device id %d", hidden->devid); + ctx.AAudioStreamBuilder_setDeviceId(ctx.builder, hidden->devid); + } + { + const aaudio_direction_t direction = (iscapture ? AAUDIO_DIRECTION_INPUT : AAUDIO_DIRECTION_OUTPUT); + ctx.AAudioStreamBuilder_setDirection(ctx.builder, direction); + } + { + const aaudio_format_t format = (device->spec.format == AUDIO_S16SYS) ? AAUDIO_FORMAT_PCM_I16 : AAUDIO_FORMAT_PCM_FLOAT; + ctx.AAudioStreamBuilder_setFormat(ctx.builder, format); + } + + ctx.AAudioStreamBuilder_setErrorCallback(ctx.builder, aaudio_errorCallback, hidden); + + LOGI("AAudio Try to reopen %u hz %u bit chan %u %s samples %u", + device->spec.freq, SDL_AUDIO_BITSIZE(device->spec.format), + device->spec.channels, (device->spec.format & 0x1000) ? "BE" : "LE", device->spec.samples); + + res = ctx.AAudioStreamBuilder_openStream(ctx.builder, &hidden->stream); + if (res != AAUDIO_OK) { + LOGI("SDL Failed AAudioStreamBuilder_openStream %d", res); + return SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); + } + + { + const aaudio_format_t fmt = ctx.AAudioStream_getFormat(hidden->stream); + SDL_AudioFormat sdlfmt = (SDL_AudioFormat) 0; + if (fmt == AAUDIO_FORMAT_PCM_I16) { + sdlfmt = AUDIO_S16SYS; + } else if (fmt == AAUDIO_FORMAT_PCM_FLOAT) { + sdlfmt = AUDIO_F32SYS; + } + + /* We handle this better in SDL3, but this _needs_ to match the previous stream for SDL2. */ + if ( (device->spec.freq != ctx.AAudioStream_getSampleRate(hidden->stream)) || + (device->spec.channels != ctx.AAudioStream_getChannelCount(hidden->stream)) || + (device->spec.format != sdlfmt) ) { + LOGI("Didn't get an identical spec from AAudioStream during reopen!"); + ctx.AAudioStream_close(hidden->stream); + hidden->stream = NULL; + return SDL_SetError("Didn't get an identical spec from AAudioStream during reopen!"); + } + } + + res = ctx.AAudioStream_requestStart(hidden->stream); + if (res != AAUDIO_OK) { + LOGI("SDL Failed AAudioStream_requestStart %d iscapture:%d", res, iscapture); + return SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); + } + + return 0; +} + +static int RecoverAAudioDevice(SDL_AudioDevice *device) +{ + struct SDL_PrivateAudioData *hidden = device->hidden; + AAudioStream *stream = hidden->stream; + + /* attempt to build a new stream, in case there's a new default device. */ + hidden->stream = NULL; + ctx.AAudioStream_requestStop(stream); + ctx.AAudioStream_close(stream); + + if (RebuildAAudioStream(device) < 0) { + return -1; // oh well, we tried. + } + + return 0; +} + + +static void aaudio_PlayDevice(_THIS) { struct SDL_PrivateAudioData *private = this->hidden; aaudio_result_t res; int64_t timeoutNanoseconds = 1 * 1000 * 1000; /* 8 ms */ - res = ctx.AAudioStream_write(private->stream, private->mixbuf, private->mixlen / private->frame_size, timeoutNanoseconds); + res = ctx.AAudioStream_write(private->stream, private->mixbuf, private->mixlen / private->frame_size, timeoutNanoseconds); if (res < 0) { LOGI("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); + if (RecoverAAudioDevice(this) < 0) { + return; /* oh well, we went down hard. */ + } } else { LOGI("SDL AAudio play: %d frames, wanted:%d frames", (int)res, private->mixlen / private->frame_size); } @@ -235,13 +324,12 @@ aaudio_PlayDevice(_THIS) #endif } -static int -aaudio_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int aaudio_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *private = this->hidden; aaudio_result_t res; int64_t timeoutNanoseconds = 8 * 1000 * 1000; /* 8 ms */ - res = ctx.AAudioStream_read(private->stream, buffer, buflen / private->frame_size, timeoutNanoseconds); + res = ctx.AAudioStream_read(private->stream, buffer, buflen / private->frame_size, timeoutNanoseconds); if (res < 0) { LOGI("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); return -1; @@ -250,8 +338,7 @@ aaudio_CaptureFromDevice(_THIS, void *buffer, int buflen) return res * private->frame_size; } -static void -aaudio_Deinitialize(void) +static void aaudio_Deinitialize(void) { LOGI(__func__); if (ctx.handle) { @@ -269,8 +356,7 @@ aaudio_Deinitialize(void) LOGI("End AAUDIO %s", SDL_GetError()); } -static SDL_bool -aaudio_Init(SDL_AudioDriverImpl *impl) +static SDL_bool aaudio_Init(SDL_AudioDriverImpl *impl) { aaudio_result_t res; LOGI(__func__); @@ -287,7 +373,7 @@ aaudio_Init(SDL_AudioDriverImpl *impl) SDL_zero(ctx); ctx.handle = SDL_LoadObject(LIB_AAUDIO_SO); - if (ctx.handle == NULL) { + if (!ctx.handle) { LOGI("SDL couldn't find " LIB_AAUDIO_SO); goto failure; } @@ -302,22 +388,24 @@ aaudio_Init(SDL_AudioDriverImpl *impl) goto failure; } - if (ctx.builder == NULL) { + if (!ctx.builder) { LOGI("SDL Failed AAudio_createStreamBuilder - builder NULL"); goto failure; } + impl->DetectDevices = Android_DetectDevices; impl->Deinitialize = aaudio_Deinitialize; impl->OpenDevice = aaudio_OpenDevice; impl->CloseDevice = aaudio_CloseDevice; impl->PlayDevice = aaudio_PlayDevice; impl->GetDeviceBuf = aaudio_GetDeviceBuf; impl->CaptureFromDevice = aaudio_CaptureFromDevice; + impl->AllowsArbitraryDeviceNames = SDL_TRUE; /* and the capabilities */ impl->HasCaptureSupport = SDL_TRUE; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; + impl->OnlyHasDefaultOutputDevice = SDL_FALSE; + impl->OnlyHasDefaultCaptureDevice = SDL_FALSE; /* this audio target is available. */ LOGI("SDL aaudio_Init OK"); @@ -344,9 +432,9 @@ void aaudio_PauseDevices(void) { /* TODO: Handle multiple devices? */ struct SDL_PrivateAudioData *private; - if (audioDevice != NULL && audioDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) audioDevice->hidden; - + if (audioDevice && audioDevice->hidden) { + SDL_LockMutex(audioDevice->mixer_lock); + private = (struct SDL_PrivateAudioData *)audioDevice->hidden; if (private->stream) { aaudio_result_t res = ctx.AAudioStream_requestPause(private->stream); if (res != AAUDIO_OK) { @@ -354,20 +442,11 @@ void aaudio_PauseDevices(void) SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); } } - - if (SDL_AtomicGet(&audioDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } else { - SDL_LockMutex(audioDevice->mixer_lock); - SDL_AtomicSet(&audioDevice->paused, 1); - private->resume = SDL_TRUE; - } } - if (captureDevice != NULL && captureDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) captureDevice->hidden; - + if (captureDevice && captureDevice->hidden) { + SDL_LockMutex(captureDevice->mixer_lock); + private = (struct SDL_PrivateAudioData *)captureDevice->hidden; if (private->stream) { /* Pause() isn't implemented for 'capture', use Stop() */ aaudio_result_t res = ctx.AAudioStream_requestStop(private->stream); @@ -376,15 +455,6 @@ void aaudio_PauseDevices(void) SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); } } - - if (SDL_AtomicGet(&captureDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } else { - SDL_LockMutex(captureDevice->mixer_lock); - SDL_AtomicSet(&captureDevice->paused, 1); - private->resume = SDL_TRUE; - } } } @@ -393,15 +463,8 @@ void aaudio_ResumeDevices(void) { /* TODO: Handle multiple devices? */ struct SDL_PrivateAudioData *private; - if (audioDevice != NULL && audioDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) audioDevice->hidden; - - if (private->resume) { - SDL_AtomicSet(&audioDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(audioDevice->mixer_lock); - } - + if (audioDevice && audioDevice->hidden) { + private = (struct SDL_PrivateAudioData *)audioDevice->hidden; if (private->stream) { aaudio_result_t res = ctx.AAudioStream_requestStart(private->stream); if (res != AAUDIO_OK) { @@ -409,17 +472,11 @@ void aaudio_ResumeDevices(void) SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); } } + SDL_UnlockMutex(audioDevice->mixer_lock); } - if (captureDevice != NULL && captureDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) captureDevice->hidden; - - if (private->resume) { - SDL_AtomicSet(&captureDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(captureDevice->mixer_lock); - } - + if (captureDevice && captureDevice->hidden) { + private = (struct SDL_PrivateAudioData *)captureDevice->hidden; if (private->stream) { aaudio_result_t res = ctx.AAudioStream_requestStart(private->stream); if (res != AAUDIO_OK) { @@ -427,6 +484,7 @@ void aaudio_ResumeDevices(void) SDL_SetError("%s : %s", __func__, ctx.AAudio_convertResultToText(res)); } } + SDL_UnlockMutex(captureDevice->mixer_lock); } } @@ -435,24 +493,29 @@ void aaudio_ResumeDevices(void) None of the standard state queries indicate any problem in my testing. And the error callback doesn't actually get called. But, AAudioStream_getTimestamp() does return AAUDIO_ERROR_INVALID_STATE */ -SDL_bool aaudio_DetectBrokenPlayState( void ) +SDL_bool aaudio_DetectBrokenPlayState(void) { + AAudioStream *stream; struct SDL_PrivateAudioData *private; int64_t framePosition, timeNanoseconds; aaudio_result_t res; - if ( !audioDevice || !audioDevice->hidden ) { + if (!audioDevice || !audioDevice->hidden) { return SDL_FALSE; } private = audioDevice->hidden; + stream = private->stream; + if (!stream) { + return SDL_FALSE; + } - res = ctx.AAudioStream_getTimestamp( private->stream, CLOCK_MONOTONIC, &framePosition, &timeNanoseconds ); - if ( res == AAUDIO_ERROR_INVALID_STATE ) { - aaudio_stream_state_t currentState = ctx.AAudioStream_getState( private->stream ); + res = ctx.AAudioStream_getTimestamp(stream, CLOCK_MONOTONIC, &framePosition, &timeNanoseconds); + if (res == AAUDIO_ERROR_INVALID_STATE) { + aaudio_stream_state_t currentState = ctx.AAudioStream_getState(stream); /* AAudioStream_getTimestamp() will also return AAUDIO_ERROR_INVALID_STATE while the stream is still initially starting. But we only care if it silently went invalid while playing. */ - if ( currentState == AAUDIO_STREAM_STATE_STARTED ) { - LOGI( "SDL aaudio_DetectBrokenPlayState: detected invalid audio device state: AAudioStream_getTimestamp result=%d, framePosition=%lld, timeNanoseconds=%lld, getState=%d", (int)res, (long long)framePosition, (long long)timeNanoseconds, (int)currentState ); + if (currentState == AAUDIO_STREAM_STATE_STARTED) { + LOGI("SDL aaudio_DetectBrokenPlayState: detected invalid audio device state: AAudioStream_getTimestamp result=%d, framePosition=%lld, timeNanoseconds=%lld, getState=%d", (int)res, (long long)framePosition, (long long)timeNanoseconds, (int)currentState); return SDL_TRUE; } } diff --git a/src/audio/aaudio/SDL_aaudio.h b/src/audio/aaudio/SDL_aaudio.h index babb68392abd5..b988a5c1ee9a8 100644 --- a/src/audio/aaudio/SDL_aaudio.h +++ b/src/audio/aaudio/SDL_aaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -38,16 +38,13 @@ struct SDL_PrivateAudioData Uint8 *mixbuf; int mixlen; int frame_size; - - /* Resume device if it was paused automatically */ - int resume; + int devid; }; - + void aaudio_ResumeDevices(void); void aaudio_PauseDevices(void); SDL_bool aaudio_DetectBrokenPlayState(void); - #endif /* _SDL_aaudio_h */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/aaudio/SDL_aaudiofuncs.h b/src/audio/aaudio/SDL_aaudiofuncs.h index 54ef65bbcb322..c2fff18300227 100644 --- a/src/audio/aaudio/SDL_aaudiofuncs.h +++ b/src/audio/aaudio/SDL_aaudiofuncs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright , (C) 1997-2022 Sam Lantinga + Copyright , (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,62 +19,61 @@ 3. This notice may not be removed or altered from any source distribution. */ -#define SDL_PROC_UNUSED(ret,func,params) +#define SDL_PROC_UNUSED(ret, func, params) SDL_PROC(const char *, AAudio_convertResultToText, (aaudio_result_t returnCode)) SDL_PROC(const char *, AAudio_convertStreamStateToText, (aaudio_stream_state_t state)) -SDL_PROC(aaudio_result_t, AAudio_createStreamBuilder, (AAudioStreamBuilder** builder)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setDeviceId, (AAudioStreamBuilder* builder, int32_t deviceId)) -SDL_PROC(void, AAudioStreamBuilder_setSampleRate, (AAudioStreamBuilder* builder, int32_t sampleRate)) -SDL_PROC(void, AAudioStreamBuilder_setChannelCount, (AAudioStreamBuilder* builder, int32_t channelCount)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSamplesPerFrame, (AAudioStreamBuilder* builder, int32_t samplesPerFrame)) -SDL_PROC(void, AAudioStreamBuilder_setFormat, (AAudioStreamBuilder* builder, aaudio_format_t format)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSharingMode, (AAudioStreamBuilder* builder, aaudio_sharing_mode_t sharingMode)) -SDL_PROC(void, AAudioStreamBuilder_setDirection, (AAudioStreamBuilder* builder, aaudio_direction_t direction)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setBufferCapacityInFrames, (AAudioStreamBuilder* builder, int32_t numFrames)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setPerformanceMode, (AAudioStreamBuilder* builder, aaudio_performance_mode_t mode)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setUsage, (AAudioStreamBuilder* builder, aaudio_usage_t usage)) /* API 28 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setContentType, (AAudioStreamBuilder* builder, aaudio_content_type_t contentType)) /* API 28 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setInputPreset, (AAudioStreamBuilder* builder, aaudio_input_preset_t inputPreset)) /* API 28 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setAllowedCapturePolicy, (AAudioStreamBuilder* builder, aaudio_allowed_capture_policy_t capturePolicy)) /* API 29 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSessionId, (AAudioStreamBuilder* builder, aaudio_session_id_t sessionId)) /* API 28 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setPrivacySensitive, (AAudioStreamBuilder* builder, bool privacySensitive)) /* API 30 */ -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setDataCallback, (AAudioStreamBuilder* builder, AAudioStream_dataCallback callback, void *userData)) -SDL_PROC_UNUSED(void, AAudioStreamBuilder_setFramesPerDataCallback, (AAudioStreamBuilder* builder, int32_t numFrames)) -SDL_PROC(void, AAudioStreamBuilder_setErrorCallback, (AAudioStreamBuilder* builder, AAudioStream_errorCallback callback, void *userData)) -SDL_PROC(aaudio_result_t , AAudioStreamBuilder_openStream, (AAudioStreamBuilder* builder, AAudioStream** stream)) -SDL_PROC(aaudio_result_t , AAudioStreamBuilder_delete, (AAudioStreamBuilder* builder)) -SDL_PROC_UNUSED(aaudio_result_t , AAudioStream_release, (AAudioStream* stream)) /* API 30 */ -SDL_PROC(aaudio_result_t , AAudioStream_close, (AAudioStream* stream)) -SDL_PROC(aaudio_result_t , AAudioStream_requestStart, (AAudioStream* stream)) -SDL_PROC(aaudio_result_t , AAudioStream_requestPause, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_result_t , AAudioStream_requestFlush, (AAudioStream* stream)) -SDL_PROC(aaudio_result_t , AAudioStream_requestStop, (AAudioStream* stream)) -SDL_PROC(aaudio_stream_state_t, AAudioStream_getState, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_waitForStateChange, (AAudioStream* stream, aaudio_stream_state_t inputState, aaudio_stream_state_t *nextState, int64_t timeoutNanoseconds)) -SDL_PROC(aaudio_result_t, AAudioStream_read, (AAudioStream* stream, void *buffer, int32_t numFrames, int64_t timeoutNanoseconds)) -SDL_PROC(aaudio_result_t, AAudioStream_write, (AAudioStream* stream, const void *buffer, int32_t numFrames, int64_t timeoutNanoseconds)) -SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_setBufferSizeInFrames, (AAudioStream* stream, int32_t numFrames)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getBufferSizeInFrames, (AAudioStream* stream)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getFramesPerBurst, (AAudioStream* stream)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getBufferCapacityInFrames, (AAudioStream* stream)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getFramesPerDataCallback, (AAudioStream* stream)) -SDL_PROC(int32_t, AAudioStream_getXRunCount, (AAudioStream* stream)) -SDL_PROC(int32_t, AAudioStream_getSampleRate, (AAudioStream* stream)) -SDL_PROC(int32_t, AAudioStream_getChannelCount, (AAudioStream* stream)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getSamplesPerFrame, (AAudioStream* stream)) -SDL_PROC_UNUSED(int32_t, AAudioStream_getDeviceId, (AAudioStream* stream)) -SDL_PROC(aaudio_format_t, AAudioStream_getFormat, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_sharing_mode_t, AAudioStream_getSharingMode, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_performance_mode_t, AAudioStream_getPerformanceMode, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_direction_t, AAudioStream_getDirection, (AAudioStream* stream)) -SDL_PROC_UNUSED(int64_t, AAudioStream_getFramesWritten, (AAudioStream* stream)) -SDL_PROC_UNUSED(int64_t, AAudioStream_getFramesRead, (AAudioStream* stream)) -SDL_PROC_UNUSED(aaudio_session_id_t, AAudioStream_getSessionId, (AAudioStream* stream)) /* API 28 */ -SDL_PROC(aaudio_result_t, AAudioStream_getTimestamp, (AAudioStream* stream, clockid_t clockid, int64_t *framePosition, int64_t *timeNanoseconds)) -SDL_PROC_UNUSED(aaudio_usage_t, AAudioStream_getUsage, (AAudioStream* stream)) /* API 28 */ -SDL_PROC_UNUSED(aaudio_content_type_t, AAudioStream_getContentType, (AAudioStream* stream)) /* API 28 */ -SDL_PROC_UNUSED(aaudio_input_preset_t, AAudioStream_getInputPreset, (AAudioStream* stream)) /* API 28 */ -SDL_PROC_UNUSED(aaudio_allowed_capture_policy_t, AAudioStream_getAllowedCapturePolicy, ( AAudioStream* stream)) /* API 29 */ -SDL_PROC_UNUSED(bool, AAudioStream_isPrivacySensitive, (AAudioStream* stream)) /* API 30 */ - +SDL_PROC(aaudio_result_t, AAudio_createStreamBuilder, (AAudioStreamBuilder * *builder)) +SDL_PROC(void, AAudioStreamBuilder_setDeviceId, (AAudioStreamBuilder * builder, int32_t deviceId)) +SDL_PROC(void, AAudioStreamBuilder_setSampleRate, (AAudioStreamBuilder * builder, int32_t sampleRate)) +SDL_PROC(void, AAudioStreamBuilder_setChannelCount, (AAudioStreamBuilder * builder, int32_t channelCount)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSamplesPerFrame, (AAudioStreamBuilder * builder, int32_t samplesPerFrame)) +SDL_PROC(void, AAudioStreamBuilder_setFormat, (AAudioStreamBuilder * builder, aaudio_format_t format)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSharingMode, (AAudioStreamBuilder * builder, aaudio_sharing_mode_t sharingMode)) +SDL_PROC(void, AAudioStreamBuilder_setDirection, (AAudioStreamBuilder * builder, aaudio_direction_t direction)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setBufferCapacityInFrames, (AAudioStreamBuilder * builder, int32_t numFrames)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setPerformanceMode, (AAudioStreamBuilder * builder, aaudio_performance_mode_t mode)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setUsage, (AAudioStreamBuilder * builder, aaudio_usage_t usage)) /* API 28 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setContentType, (AAudioStreamBuilder * builder, aaudio_content_type_t contentType)) /* API 28 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setInputPreset, (AAudioStreamBuilder * builder, aaudio_input_preset_t inputPreset)) /* API 28 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setAllowedCapturePolicy, (AAudioStreamBuilder * builder, aaudio_allowed_capture_policy_t capturePolicy)) /* API 29 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setSessionId, (AAudioStreamBuilder * builder, aaudio_session_id_t sessionId)) /* API 28 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setPrivacySensitive, (AAudioStreamBuilder * builder, bool privacySensitive)) /* API 30 */ +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setDataCallback, (AAudioStreamBuilder * builder, AAudioStream_dataCallback callback, void *userData)) +SDL_PROC_UNUSED(void, AAudioStreamBuilder_setFramesPerDataCallback, (AAudioStreamBuilder * builder, int32_t numFrames)) +SDL_PROC(void, AAudioStreamBuilder_setErrorCallback, (AAudioStreamBuilder * builder, AAudioStream_errorCallback callback, void *userData)) +SDL_PROC(aaudio_result_t, AAudioStreamBuilder_openStream, (AAudioStreamBuilder * builder, AAudioStream **stream)) +SDL_PROC(aaudio_result_t, AAudioStreamBuilder_delete, (AAudioStreamBuilder * builder)) +SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_release, (AAudioStream * stream)) /* API 30 */ +SDL_PROC(aaudio_result_t, AAudioStream_close, (AAudioStream * stream)) +SDL_PROC(aaudio_result_t, AAudioStream_requestStart, (AAudioStream * stream)) +SDL_PROC(aaudio_result_t, AAudioStream_requestPause, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_requestFlush, (AAudioStream * stream)) +SDL_PROC(aaudio_result_t, AAudioStream_requestStop, (AAudioStream * stream)) +SDL_PROC(aaudio_stream_state_t, AAudioStream_getState, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_waitForStateChange, (AAudioStream * stream, aaudio_stream_state_t inputState, aaudio_stream_state_t *nextState, int64_t timeoutNanoseconds)) +SDL_PROC(aaudio_result_t, AAudioStream_read, (AAudioStream * stream, void *buffer, int32_t numFrames, int64_t timeoutNanoseconds)) +SDL_PROC(aaudio_result_t, AAudioStream_write, (AAudioStream * stream, const void *buffer, int32_t numFrames, int64_t timeoutNanoseconds)) +SDL_PROC_UNUSED(aaudio_result_t, AAudioStream_setBufferSizeInFrames, (AAudioStream * stream, int32_t numFrames)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getBufferSizeInFrames, (AAudioStream * stream)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getFramesPerBurst, (AAudioStream * stream)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getBufferCapacityInFrames, (AAudioStream * stream)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getFramesPerDataCallback, (AAudioStream * stream)) +SDL_PROC(int32_t, AAudioStream_getXRunCount, (AAudioStream * stream)) +SDL_PROC(int32_t, AAudioStream_getSampleRate, (AAudioStream * stream)) +SDL_PROC(int32_t, AAudioStream_getChannelCount, (AAudioStream * stream)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getSamplesPerFrame, (AAudioStream * stream)) +SDL_PROC_UNUSED(int32_t, AAudioStream_getDeviceId, (AAudioStream * stream)) +SDL_PROC(aaudio_format_t, AAudioStream_getFormat, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_sharing_mode_t, AAudioStream_getSharingMode, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_performance_mode_t, AAudioStream_getPerformanceMode, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_direction_t, AAudioStream_getDirection, (AAudioStream * stream)) +SDL_PROC_UNUSED(int64_t, AAudioStream_getFramesWritten, (AAudioStream * stream)) +SDL_PROC_UNUSED(int64_t, AAudioStream_getFramesRead, (AAudioStream * stream)) +SDL_PROC_UNUSED(aaudio_session_id_t, AAudioStream_getSessionId, (AAudioStream * stream)) /* API 28 */ +SDL_PROC(aaudio_result_t, AAudioStream_getTimestamp, (AAudioStream * stream, clockid_t clockid, int64_t *framePosition, int64_t *timeNanoseconds)) +SDL_PROC_UNUSED(aaudio_usage_t, AAudioStream_getUsage, (AAudioStream * stream)) /* API 28 */ +SDL_PROC_UNUSED(aaudio_content_type_t, AAudioStream_getContentType, (AAudioStream * stream)) /* API 28 */ +SDL_PROC_UNUSED(aaudio_input_preset_t, AAudioStream_getInputPreset, (AAudioStream * stream)) /* API 28 */ +SDL_PROC_UNUSED(aaudio_allowed_capture_policy_t, AAudioStream_getAllowedCapturePolicy, (AAudioStream * stream)) /* API 29 */ +SDL_PROC_UNUSED(bool, AAudioStream_isPrivacySensitive, (AAudioStream * stream)) /* API 30 */ diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 59de607f8ae73..120244ab0060a 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_ALSA +#ifdef SDL_AUDIO_DRIVER_ALSA #ifndef SDL_ALSA_NON_BLOCKING #define SDL_ALSA_NON_BLOCKING 0 @@ -34,7 +34,7 @@ /* Allow access to a raw mixing buffer */ #include -#include /* For kill() */ +#include /* For kill() */ #include #include "SDL_timer.h" @@ -46,64 +46,53 @@ #include "SDL_loadso.h" #endif -static int (*ALSA_snd_pcm_open) - (snd_pcm_t **, const char *, snd_pcm_stream_t, int); -static int (*ALSA_snd_pcm_close) (snd_pcm_t * pcm); -static snd_pcm_sframes_t (*ALSA_snd_pcm_writei) - (snd_pcm_t *, const void *, snd_pcm_uframes_t); -static snd_pcm_sframes_t (*ALSA_snd_pcm_readi) - (snd_pcm_t *, void *, snd_pcm_uframes_t); -static int (*ALSA_snd_pcm_recover) (snd_pcm_t *, int, int); -static int (*ALSA_snd_pcm_prepare) (snd_pcm_t *); -static int (*ALSA_snd_pcm_drain) (snd_pcm_t *); -static const char *(*ALSA_snd_strerror) (int); -static size_t(*ALSA_snd_pcm_hw_params_sizeof) (void); -static size_t(*ALSA_snd_pcm_sw_params_sizeof) (void); -static void (*ALSA_snd_pcm_hw_params_copy) - (snd_pcm_hw_params_t *, const snd_pcm_hw_params_t *); -static int (*ALSA_snd_pcm_hw_params_any) (snd_pcm_t *, snd_pcm_hw_params_t *); -static int (*ALSA_snd_pcm_hw_params_set_access) - (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t); -static int (*ALSA_snd_pcm_hw_params_set_format) - (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t); -static int (*ALSA_snd_pcm_hw_params_set_channels) - (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int); -static int (*ALSA_snd_pcm_hw_params_get_channels) - (const snd_pcm_hw_params_t *, unsigned int *); -static int (*ALSA_snd_pcm_hw_params_set_rate_near) - (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); -static int (*ALSA_snd_pcm_hw_params_set_period_size_near) - (snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); -static int (*ALSA_snd_pcm_hw_params_get_period_size) - (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); -static int (*ALSA_snd_pcm_hw_params_set_periods_min) - (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); -static int (*ALSA_snd_pcm_hw_params_set_periods_first) - (snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); -static int (*ALSA_snd_pcm_hw_params_get_periods) - (const snd_pcm_hw_params_t *, unsigned int *, int *); -static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near) - (snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *); -static int (*ALSA_snd_pcm_hw_params_get_buffer_size) - (const snd_pcm_hw_params_t *, snd_pcm_uframes_t *); -static int (*ALSA_snd_pcm_hw_params) (snd_pcm_t *, snd_pcm_hw_params_t *); -static int (*ALSA_snd_pcm_sw_params_current) (snd_pcm_t *, - snd_pcm_sw_params_t *); -static int (*ALSA_snd_pcm_sw_params_set_start_threshold) - (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); -static int (*ALSA_snd_pcm_sw_params) (snd_pcm_t *, snd_pcm_sw_params_t *); -static int (*ALSA_snd_pcm_nonblock) (snd_pcm_t *, int); +static int (*ALSA_snd_pcm_open)(snd_pcm_t **, const char *, snd_pcm_stream_t, int); +static int (*ALSA_snd_pcm_close)(snd_pcm_t *pcm); +static snd_pcm_sframes_t (*ALSA_snd_pcm_writei)(snd_pcm_t *, const void *, snd_pcm_uframes_t); +static snd_pcm_sframes_t (*ALSA_snd_pcm_readi)(snd_pcm_t *, void *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_recover)(snd_pcm_t *, int, int); +static int (*ALSA_snd_pcm_prepare)(snd_pcm_t *); +static int (*ALSA_snd_pcm_drain)(snd_pcm_t *); +static const char *(*ALSA_snd_strerror)(int); +static size_t (*ALSA_snd_pcm_hw_params_sizeof)(void); +static size_t (*ALSA_snd_pcm_sw_params_sizeof)(void); +static void (*ALSA_snd_pcm_hw_params_copy)(snd_pcm_hw_params_t *, const snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_any)(snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_hw_params_set_access)(snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_access_t); +static int (*ALSA_snd_pcm_hw_params_set_format)(snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_format_t); +static int (*ALSA_snd_pcm_hw_params_set_channels)(snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int); +static int (*ALSA_snd_pcm_hw_params_get_channels)(const snd_pcm_hw_params_t *, unsigned int *); +static int (*ALSA_snd_pcm_hw_params_get_rate)(const snd_pcm_hw_params_t *, unsigned int*, int*); +static int (*ALSA_snd_pcm_hw_params_set_rate_near)(snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_period_size_near)(snd_pcm_t *, snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); +static int (*ALSA_snd_pcm_hw_params_get_period_size)(const snd_pcm_hw_params_t *, snd_pcm_uframes_t *, int *); +static int (*ALSA_snd_pcm_hw_params_set_periods_min)(snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_periods_first)(snd_pcm_t *, snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_get_periods)(const snd_pcm_hw_params_t *, unsigned int *, int *); +static int (*ALSA_snd_pcm_hw_params_set_buffer_size_near)(snd_pcm_t *pcm, snd_pcm_hw_params_t *, snd_pcm_uframes_t *); +static int (*ALSA_snd_pcm_hw_params_get_buffer_size)(const snd_pcm_hw_params_t *, snd_pcm_uframes_t *); +static int (*ALSA_snd_pcm_hw_params)(snd_pcm_t *, snd_pcm_hw_params_t *); +static int (*ALSA_snd_pcm_sw_params_current)(snd_pcm_t *, + snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_sw_params_set_start_threshold)(snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_sw_params)(snd_pcm_t *, snd_pcm_sw_params_t *); +static int (*ALSA_snd_pcm_nonblock)(snd_pcm_t *, int); static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int); -static int (*ALSA_snd_pcm_sw_params_set_avail_min) - (snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); +static int (*ALSA_snd_pcm_sw_params_set_avail_min)(snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t); static int (*ALSA_snd_pcm_reset)(snd_pcm_t *); -static int (*ALSA_snd_device_name_hint) (int, const char *, void ***); -static char* (*ALSA_snd_device_name_get_hint) (const void *, const char *); -static int (*ALSA_snd_device_name_free_hint) (void **); +static int (*ALSA_snd_device_name_hint)(int, const char *, void ***); +static char *(*ALSA_snd_device_name_get_hint)(const void *, const char *); +static int (*ALSA_snd_device_name_free_hint)(void **); static snd_pcm_sframes_t (*ALSA_snd_pcm_avail)(snd_pcm_t *); +static int (*ALSA_snd_pcm_info)(snd_pcm_t *, snd_pcm_info_t *); +static const char *(*ALSA_snd_pcm_info_get_name)(const snd_pcm_info_t *); +static int (*ALSA_snd_pcm_info_get_card)(const snd_pcm_info_t *); +static int (*ALSA_snd_card_get_name)(int, char **); +static int (*ALSA_snd_pcm_info_malloc)(snd_pcm_info_t **); +static void (*ALSA_snd_pcm_info_free)(snd_pcm_info_t *); #ifdef SND_CHMAP_API_VERSION -static snd_pcm_chmap_t* (*ALSA_snd_pcm_get_chmap) (snd_pcm_t *); -static int (*ALSA_snd_pcm_chmap_print) (const snd_pcm_chmap_t *map, size_t maxlen, char *buf); +static snd_pcm_chmap_t *(*ALSA_snd_pcm_get_chmap)(snd_pcm_t *); +static int (*ALSA_snd_pcm_chmap_print)(const snd_pcm_chmap_t *map, size_t maxlen, char *buf); #endif #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC @@ -113,11 +102,10 @@ static int (*ALSA_snd_pcm_chmap_print) (const snd_pcm_chmap_t *map, size_t maxle static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC; static void *alsa_handle = NULL; -static int -load_alsa_sym(const char *fn, void **addr) +static int load_alsa_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(alsa_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return 0; } @@ -126,14 +114,14 @@ load_alsa_sym(const char *fn, void **addr) } /* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_ALSA_SYM(x) \ - if (!load_alsa_sym(#x, (void **) (char *) &ALSA_##x)) return -1 +#define SDL_ALSA_SYM(x) \ + if (!load_alsa_sym(#x, (void **)(char *)&ALSA_##x)) \ + return -1 #else #define SDL_ALSA_SYM(x) ALSA_##x = x #endif -static int -load_alsa_syms(void) +static int load_alsa_syms(void) { SDL_ALSA_SYM(snd_pcm_open); SDL_ALSA_SYM(snd_pcm_close); @@ -151,6 +139,7 @@ load_alsa_syms(void) SDL_ALSA_SYM(snd_pcm_hw_params_set_format); SDL_ALSA_SYM(snd_pcm_hw_params_set_channels); SDL_ALSA_SYM(snd_pcm_hw_params_get_channels); + SDL_ALSA_SYM(snd_pcm_hw_params_get_rate); SDL_ALSA_SYM(snd_pcm_hw_params_set_rate_near); SDL_ALSA_SYM(snd_pcm_hw_params_set_period_size_near); SDL_ALSA_SYM(snd_pcm_hw_params_get_period_size); @@ -171,6 +160,12 @@ load_alsa_syms(void) SDL_ALSA_SYM(snd_device_name_get_hint); SDL_ALSA_SYM(snd_device_name_free_hint); SDL_ALSA_SYM(snd_pcm_avail); + SDL_ALSA_SYM(snd_pcm_info); + SDL_ALSA_SYM(snd_pcm_info_get_card); + SDL_ALSA_SYM(snd_pcm_info_get_name); + SDL_ALSA_SYM(snd_card_get_name); + SDL_ALSA_SYM(snd_pcm_info_malloc); + SDL_ALSA_SYM(snd_pcm_info_free); #ifdef SND_CHMAP_API_VERSION SDL_ALSA_SYM(snd_pcm_get_chmap); SDL_ALSA_SYM(snd_pcm_chmap_print); @@ -183,22 +178,20 @@ load_alsa_syms(void) #ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC -static void -UnloadALSALibrary(void) +static void UnloadALSALibrary(void) { - if (alsa_handle != NULL) { + if (alsa_handle) { SDL_UnloadObject(alsa_handle); alsa_handle = NULL; } } -static int -LoadALSALibrary(void) +static int LoadALSALibrary(void) { int retval = 0; - if (alsa_handle == NULL) { + if (!alsa_handle) { alsa_handle = SDL_LoadObject(alsa_library); - if (alsa_handle == NULL) { + if (!alsa_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { @@ -213,13 +206,11 @@ LoadALSALibrary(void) #else -static void -UnloadALSALibrary(void) +static void UnloadALSALibrary(void) { } -static int -LoadALSALibrary(void) +static int LoadALSALibrary(void) { load_alsa_syms(); return 0; @@ -227,18 +218,17 @@ LoadALSALibrary(void) #endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */ -static const char * -get_audio_device(void *handle, const int channels) +static const char *get_audio_device(void *handle, const int channels) { const char *device; - if (handle != NULL) { - return (const char *) handle; + if (handle) { + return (const char *)handle; } /* !!! FIXME: we also check "SDL_AUDIO_DEVICE_NAME" at the higher level. */ - device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ - if (device != NULL) { + device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */ + if (device) { return device; } @@ -251,49 +241,50 @@ get_audio_device(void *handle, const int channels) return "default"; } - /* This function waits until it is possible to write a full sound buffer */ -static void -ALSA_WaitDevice(_THIS) +static void ALSA_WaitDevice(_THIS) { #if SDL_ALSA_NON_BLOCKING - const snd_pcm_sframes_t needed = (snd_pcm_sframes_t) this->spec.samples; + const snd_pcm_sframes_t needed = (snd_pcm_sframes_t)this->spec.samples; while (SDL_AtomicGet(&this->enabled)) { const snd_pcm_sframes_t rc = ALSA_snd_pcm_avail(this->hidden->pcm_handle); if ((rc < 0) && (rc != -EAGAIN)) { /* Hmm, not much we can do - abort */ fprintf(stderr, "ALSA snd_pcm_avail failed (unrecoverable): %s\n", - ALSA_snd_strerror(rc)); + ALSA_snd_strerror(rc)); SDL_OpenedAudioDeviceDisconnected(this); return; } else if (rc < needed) { const Uint32 delay = ((needed - (SDL_max(rc, 0))) * 1000) / this->spec.freq; SDL_Delay(SDL_max(delay, 10)); } else { - break; /* ready to go! */ + break; /* ready to go! */ } } #endif } - /* !!! FIXME: is there a channel swizzler in alsalib instead? */ /* * https://bugzilla.libsdl.org/show_bug.cgi?id=110 * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR" */ -#define SWIZ6(T) \ -static void swizzle_alsa_channels_6_##T(void *buffer, const Uint32 bufferlen) { \ - T *ptr = (T *) buffer; \ - Uint32 i; \ - for (i = 0; i < bufferlen; i++, ptr += 6) { \ - T tmp; \ - tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \ - tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \ - } \ -} - +#define SWIZ6(T) \ + static void swizzle_alsa_channels_6_##T(void *buffer, const Uint32 bufferlen) \ + { \ + T *ptr = (T *)buffer; \ + Uint32 i; \ + for (i = 0; i < bufferlen; i++, ptr += 6) { \ + T tmp; \ + tmp = ptr[2]; \ + ptr[2] = ptr[4]; \ + ptr[4] = tmp; \ + tmp = ptr[3]; \ + ptr[3] = ptr[5]; \ + ptr[5] = tmp; \ + } \ + } /* !!! FIXME: is there a channel swizzler in alsalib instead? */ /* !!! FIXME: this screams for a SIMD shuffle operation. */ @@ -302,31 +293,32 @@ static void swizzle_alsa_channels_6_##T(void *buffer, const Uint32 bufferlen) { * For Linux ALSA, this appears to be FL-FR-RL-RR-C-LFE-SL-SR * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-SL-SR-RL-RR" */ -#define SWIZ8(T) \ -static void swizzle_alsa_channels_8_##T(void *buffer, const Uint32 bufferlen) { \ - T *ptr = (T *) buffer; \ - Uint32 i; \ - for (i = 0; i < bufferlen; i++, ptr += 6) { \ - const T center = ptr[2]; \ - const T subwoofer = ptr[3]; \ - const T side_left = ptr[4]; \ - const T side_right = ptr[5]; \ - const T rear_left = ptr[6]; \ - const T rear_right = ptr[7]; \ - ptr[2] = rear_left; \ - ptr[3] = rear_right; \ - ptr[4] = center; \ - ptr[5] = subwoofer; \ - ptr[6] = side_left; \ - ptr[7] = side_right; \ - } \ -} +#define SWIZ8(T) \ + static void swizzle_alsa_channels_8_##T(void *buffer, const Uint32 bufferlen) \ + { \ + T *ptr = (T *)buffer; \ + Uint32 i; \ + for (i = 0; i < bufferlen; i++, ptr += 6) { \ + const T center = ptr[2]; \ + const T subwoofer = ptr[3]; \ + const T side_left = ptr[4]; \ + const T side_right = ptr[5]; \ + const T rear_left = ptr[6]; \ + const T rear_right = ptr[7]; \ + ptr[2] = rear_left; \ + ptr[3] = rear_right; \ + ptr[4] = center; \ + ptr[5] = subwoofer; \ + ptr[6] = side_left; \ + ptr[7] = side_right; \ + } \ + } #define CHANNEL_SWIZZLE(x) \ - x(Uint64) \ - x(Uint32) \ - x(Uint16) \ - x(Uint8) + x(Uint64) \ + x(Uint32) \ + x(Uint16) \ + x(Uint8) CHANNEL_SWIZZLE(SWIZ6) CHANNEL_SWIZZLE(SWIZ8) @@ -335,53 +327,59 @@ CHANNEL_SWIZZLE(SWIZ8) #undef SWIZ6 #undef SWIZ8 - /* * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle * channels from Windows/Mac order to the format alsalib will want. */ -static void -swizzle_alsa_channels(_THIS, void *buffer, Uint32 bufferlen) +static void swizzle_alsa_channels(_THIS, void *buffer, Uint32 bufferlen) { switch (this->spec.channels) { - #define CHANSWIZ(chans) \ - case chans: \ - switch ((this->spec.format & (0xFF))) { \ - case 8: swizzle_alsa_channels_##chans##_Uint8(buffer, bufferlen); break; \ - case 16: swizzle_alsa_channels_##chans##_Uint16(buffer, bufferlen); break; \ - case 32: swizzle_alsa_channels_##chans##_Uint32(buffer, bufferlen); break; \ - case 64: swizzle_alsa_channels_##chans##_Uint64(buffer, bufferlen); break; \ - default: SDL_assert(!"unhandled bitsize"); break; \ - } \ - return; +#define CHANSWIZ(chans) \ + case chans: \ + switch ((this->spec.format & (0xFF))) { \ + case 8: \ + swizzle_alsa_channels_##chans##_Uint8(buffer, bufferlen); \ + break; \ + case 16: \ + swizzle_alsa_channels_##chans##_Uint16(buffer, bufferlen); \ + break; \ + case 32: \ + swizzle_alsa_channels_##chans##_Uint32(buffer, bufferlen); \ + break; \ + case 64: \ + swizzle_alsa_channels_##chans##_Uint64(buffer, bufferlen); \ + break; \ + default: \ + SDL_assert(!"unhandled bitsize"); \ + break; \ + } \ + return; CHANSWIZ(6); CHANSWIZ(8); - #undef CHANSWIZ - default: break; +#undef CHANSWIZ + default: + break; } } #ifdef SND_CHMAP_API_VERSION /* Some devices have the right channel map, no swizzling necessary */ -static void -no_swizzle(_THIS, void *buffer, Uint32 bufferlen) +static void no_swizzle(_THIS, void *buffer, Uint32 bufferlen) { } #endif /* SND_CHMAP_API_VERSION */ - -static void -ALSA_PlayDevice(_THIS) +static void ALSA_PlayDevice(_THIS) { - const Uint8 *sample_buf = (const Uint8 *) this->hidden->mixbuf; + const Uint8 *sample_buf = (const Uint8 *)this->hidden->mixbuf; const int frame_size = ((SDL_AUDIO_BITSIZE(this->spec.format)) / 8) * - this->spec.channels; - snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->spec.samples); + this->spec.channels; + snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t)this->spec.samples); this->hidden->swizzle_func(this, this->hidden->mixbuf, frames_left); - while ( frames_left > 0 && SDL_AtomicGet(&this->enabled) ) { + while (frames_left > 0 && SDL_AtomicGet(&this->enabled)) { int status = ALSA_snd_pcm_writei(this->hidden->pcm_handle, sample_buf, frames_left); @@ -395,14 +393,14 @@ ALSA_PlayDevice(_THIS) status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0); if (status < 0) { /* Hmm, not much we can do - abort */ - fprintf(stderr, "ALSA write failed (unrecoverable): %s\n", - ALSA_snd_strerror(status)); + SDL_LogError(SDL_LOG_CATEGORY_AUDIO, + "ALSA write failed (unrecoverable): %s\n", + ALSA_snd_strerror(status)); SDL_OpenedAudioDeviceDisconnected(this); return; } continue; - } - else if (status == 0) { + } else if (status == 0) { /* No frames were written (no available space in pcm device). Allow other threads to catch up. */ Uint32 delay = (frames_left / 2 * 1000) / this->spec.freq; @@ -414,41 +412,39 @@ ALSA_PlayDevice(_THIS) } } -static Uint8 * -ALSA_GetDeviceBuf(_THIS) +static Uint8 *ALSA_GetDeviceBuf(_THIS) { - return (this->hidden->mixbuf); + return this->hidden->mixbuf; } -static int -ALSA_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int ALSA_CaptureFromDevice(_THIS, void *buffer, int buflen) { - Uint8 *sample_buf = (Uint8 *) buffer; + Uint8 *sample_buf = (Uint8 *)buffer; const int frame_size = ((SDL_AUDIO_BITSIZE(this->spec.format)) / 8) * - this->spec.channels; + this->spec.channels; const int total_frames = buflen / frame_size; snd_pcm_uframes_t frames_left = total_frames; snd_pcm_uframes_t wait_time = frame_size / 2; SDL_assert((buflen % frame_size) == 0); - while ( frames_left > 0 && SDL_AtomicGet(&this->enabled) ) { + while (frames_left > 0 && SDL_AtomicGet(&this->enabled)) { int status; status = ALSA_snd_pcm_readi(this->hidden->pcm_handle, - sample_buf, frames_left); + sample_buf, frames_left); if (status == -EAGAIN) { ALSA_snd_pcm_wait(this->hidden->pcm_handle, wait_time); status = 0; - } - else if (status < 0) { + } else if (status < 0) { /*printf("ALSA: capture error %d\n", status);*/ status = ALSA_snd_pcm_recover(this->hidden->pcm_handle, status, 0); if (status < 0) { /* Hmm, not much we can do - abort */ - fprintf(stderr, "ALSA read failed (unrecoverable): %s\n", - ALSA_snd_strerror(status)); + SDL_LogError(SDL_LOG_CATEGORY_AUDIO, + "ALSA read failed (unrecoverable): %s\n", + ALSA_snd_strerror(status)); return -1; } continue; @@ -464,20 +460,21 @@ ALSA_CaptureFromDevice(_THIS, void *buffer, int buflen) return (total_frames - frames_left) * frame_size; } -static void -ALSA_FlushCapture(_THIS) +static void ALSA_FlushCapture(_THIS) { ALSA_snd_pcm_reset(this->hidden->pcm_handle); } -static void -ALSA_CloseDevice(_THIS) +static void ALSA_CloseDevice(_THIS) { if (this->hidden->pcm_handle) { /* Wait for the submitted audio to drain ALSA_snd_pcm_drop() can hang, so don't use that. */ Uint32 delay = ((this->spec.samples * 1000) / this->spec.freq) * 2; + if (delay > 100) { + delay = 100; + } SDL_Delay(delay); ALSA_snd_pcm_close(this->hidden->pcm_handle); @@ -486,8 +483,59 @@ ALSA_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params) +static int ALSA_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +{ + const char *device = "default"; + snd_pcm_t *pcm_handle; + snd_pcm_info_t *pcm_info; + snd_pcm_stream_t stream; + int card_index; + const char *dev_name; + char *card_name = NULL; + char final_name[256]; + + SDL_zero(final_name); + stream = iscapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK; + + if (ALSA_snd_pcm_open(&pcm_handle, device, stream, SND_PCM_NONBLOCK) < 0) { + return SDL_SetError("ALSA: Couldn't open default device"); + } + + if (ALSA_snd_pcm_info_malloc(&pcm_info) < 0) { + ALSA_snd_pcm_close(pcm_handle); + return SDL_SetError("ALSA: Couldn't allocate pcm_info"); + } + + if (ALSA_snd_pcm_info(pcm_handle, pcm_info) < 0) { + ALSA_snd_pcm_info_free(pcm_info); + ALSA_snd_pcm_close(pcm_handle); + return SDL_SetError("ALSA: Couldn't get PCM info"); + } + + card_index = ALSA_snd_pcm_info_get_card(pcm_info); + dev_name = ALSA_snd_pcm_info_get_name(pcm_info); + + if (card_index >= 0 && ALSA_snd_card_get_name(card_index, &card_name) >= 0) { + SDL_snprintf(final_name, sizeof(final_name), "%s, %s", card_name, dev_name); + *name = SDL_strdup(final_name); + } else { + *name = SDL_strdup(dev_name ? dev_name : "Unknown ALSA Device"); + } + + if (spec) { + SDL_zero(*spec); + spec->freq = 48000; + spec->format = AUDIO_S16SYS; + spec->channels = 2; + spec->samples = 512; + } + + ALSA_snd_pcm_info_free(pcm_info); + ALSA_snd_pcm_close(pcm_handle); + return 0; +} + +static int ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params) { int status; snd_pcm_hw_params_t *hwparams; @@ -501,49 +549,48 @@ ALSA_set_buffer_size(_THIS, snd_pcm_hw_params_t *params) /* Attempt to match the period size to the requested buffer size */ persize = this->spec.samples; status = ALSA_snd_pcm_hw_params_set_period_size_near( - this->hidden->pcm_handle, hwparams, &persize, NULL); - if ( status < 0 ) { - return(-1); + this->hidden->pcm_handle, hwparams, &persize, NULL); + if (status < 0) { + return -1; } /* Need to at least double buffer */ periods = 2; status = ALSA_snd_pcm_hw_params_set_periods_min( - this->hidden->pcm_handle, hwparams, &periods, NULL); - if ( status < 0 ) { - return(-1); + this->hidden->pcm_handle, hwparams, &periods, NULL); + if (status < 0) { + return -1; } status = ALSA_snd_pcm_hw_params_set_periods_first( - this->hidden->pcm_handle, hwparams, &periods, NULL); - if ( status < 0 ) { - return(-1); + this->hidden->pcm_handle, hwparams, &periods, NULL); + if (status < 0) { + return -1; } /* "set" the hardware with the desired parameters */ status = ALSA_snd_pcm_hw_params(this->hidden->pcm_handle, hwparams); - if ( status < 0 ) { - return(-1); + if (status < 0) { + return -1; } this->spec.samples = persize; /* This is useful for debugging */ - if ( SDL_getenv("SDL_AUDIO_ALSA_DEBUG") ) { + if (SDL_getenv("SDL_AUDIO_ALSA_DEBUG")) { snd_pcm_uframes_t bufsize; ALSA_snd_pcm_hw_params_get_buffer_size(hwparams, &bufsize); - fprintf(stderr, - "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", - persize, periods, bufsize); + SDL_LogError(SDL_LOG_CATEGORY_AUDIO, + "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", + persize, periods, bufsize); } - return(0); + return 0; } -static int -ALSA_OpenDevice(_THIS, const char *devname) +static int ALSA_OpenDevice(_THIS, const char *devname) { int status = 0; SDL_bool iscapture = this->iscapture; @@ -560,9 +607,8 @@ ALSA_OpenDevice(_THIS, const char *devname) #endif /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -570,13 +616,12 @@ ALSA_OpenDevice(_THIS, const char *devname) /* Open the audio device */ /* Name of device should depend on # channels in spec */ status = ALSA_snd_pcm_open(&pcm_handle, - get_audio_device(this->handle, this->spec.channels), - iscapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, - SND_PCM_NONBLOCK); + get_audio_device(this->handle, this->spec.channels), + iscapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK, + SND_PCM_NONBLOCK); if (status < 0) { - return SDL_SetError("ALSA: Couldn't open audio device: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't open audio device: %s", ALSA_snd_strerror(status)); } this->hidden->pcm_handle = pcm_handle; @@ -585,16 +630,14 @@ ALSA_OpenDevice(_THIS, const char *devname) snd_pcm_hw_params_alloca(&hwparams); status = ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams); if (status < 0) { - return SDL_SetError("ALSA: Couldn't get hardware config: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't get hardware config: %s", ALSA_snd_strerror(status)); } /* SDL only uses interleaved sample output */ status = ALSA_snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); if (status < 0) { - return SDL_SetError("ALSA: Couldn't set interleaved access: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't set interleaved access: %s", ALSA_snd_strerror(status)); } /* Try for a closest match on audio format */ @@ -676,8 +719,7 @@ ALSA_OpenDevice(_THIS, const char *devname) status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &rate, NULL); if (status < 0) { - return SDL_SetError("ALSA: Couldn't set audio frequency: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't set audio frequency: %s", ALSA_snd_strerror(status)); } this->spec.freq = rate; @@ -691,24 +733,20 @@ ALSA_OpenDevice(_THIS, const char *devname) snd_pcm_sw_params_alloca(&swparams); status = ALSA_snd_pcm_sw_params_current(pcm_handle, swparams); if (status < 0) { - return SDL_SetError("ALSA: Couldn't get software config: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't get software config: %s", ALSA_snd_strerror(status)); } status = ALSA_snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, this->spec.samples); if (status < 0) { - return SDL_SetError("Couldn't set minimum available samples: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("Couldn't set minimum available samples: %s", ALSA_snd_strerror(status)); } status = ALSA_snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1); if (status < 0) { - return SDL_SetError("ALSA: Couldn't set start threshold: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("ALSA: Couldn't set start threshold: %s", ALSA_snd_strerror(status)); } status = ALSA_snd_pcm_sw_params(pcm_handle, swparams); if (status < 0) { - return SDL_SetError("Couldn't set software audio parameters: %s", - ALSA_snd_strerror(status)); + return SDL_SetError("Couldn't set software audio parameters: %s", ALSA_snd_strerror(status)); } /* Calculate the final parameters for this audio specification */ @@ -717,18 +755,18 @@ ALSA_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ if (!iscapture) { this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + this->hidden->mixbuf = (Uint8 *)SDL_malloc(this->hidden->mixlen); + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); } - #if !SDL_ALSA_NON_BLOCKING +#if !SDL_ALSA_NON_BLOCKING if (!iscapture) { ALSA_snd_pcm_nonblock(pcm_handle, 0); } - #endif +#endif /* We're ready to rock and roll. :-) */ return 0; @@ -741,13 +779,22 @@ typedef struct ALSA_Device struct ALSA_Device *next; } ALSA_Device; -static void -add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSeen) +static void add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSeen) { - ALSA_Device *dev = SDL_malloc(sizeof (ALSA_Device)); + ALSA_Device *dev = SDL_malloc(sizeof(ALSA_Device)); char *desc; char *handle = NULL; char *ptr; + snd_pcm_t *pcm_handle; + snd_pcm_stream_t stream; + snd_pcm_hw_params_t *hwparams; + + unsigned int freq = 0; + int dir; + unsigned int channels = 0; + snd_pcm_uframes_t samples = 0; + + SDL_AudioSpec spec; if (!dev) { return; @@ -764,7 +811,7 @@ add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSee return; } } else { - desc = (char *) name; + desc = (char *)name; } SDL_assert(name != NULL); @@ -772,7 +819,8 @@ add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSee /* some strings have newlines, like "HDA NVidia, HDMI 0\nHDMI Audio Output". just chop the extra lines off, this seems to get a reasonable device name without extra details. */ - if ((ptr = SDL_strchr(desc, '\n')) != NULL) { + ptr = SDL_strchr(desc, '\n'); + if (ptr) { *ptr = '\0'; } @@ -786,25 +834,48 @@ add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSee SDL_free(dev); return; } + stream = iscapture ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK; + + if (ALSA_snd_pcm_open(&pcm_handle, handle, stream, SND_PCM_NONBLOCK) < 0) { + SDL_free(dev); + return; + } - /* Note that spec is NULL, because we are required to open the device before - * acquiring the mix format, making this information inaccessible at - * enumeration time - */ - SDL_AddAudioDevice(iscapture, desc, NULL, handle); - if (hint) + snd_pcm_hw_params_alloca(&hwparams); + ALSA_snd_pcm_hw_params_any(pcm_handle, hwparams); + + ALSA_snd_pcm_hw_params_get_rate(hwparams, &freq, &dir); + ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels); + ALSA_snd_pcm_hw_params_get_period_size(hwparams, &samples, &dir); + + ALSA_snd_pcm_close(pcm_handle); + + /* Let's fill the spec */ + + spec.freq = freq; + spec.channels = channels; + spec.samples = samples; + spec.silence = 0; + spec.padding = 0; + /* Can't calculate size yet because this is an exploratory device opening + * so we don't know the sample format. + * Probably AUDIO_S16SYS/SND_PCM_FORMAT_S16_LE would be a good default + * if required.*/ + spec.size = 0; + + SDL_AddAudioDevice(iscapture, desc, &spec, handle); + if (hint) { free(desc); + } dev->name = handle; dev->iscapture = iscapture; dev->next = *pSeen; *pSeen = dev; } - static ALSA_Device *hotplug_devices = NULL; -static void -ALSA_HotplugIteration(void) +static void ALSA_HotplugIteration(void) { void **hints = NULL; ALSA_Device *dev; @@ -819,7 +890,7 @@ ALSA_HotplugIteration(void) int bestmatch = 0xFFFF; size_t match_len = 0; int defaultdev = -1; - static const char * const prefixes[] = { + static const char *const prefixes[] = { "hw:", "sysdefault:", "default:", NULL }; @@ -862,7 +933,7 @@ ALSA_HotplugIteration(void) /* if we didn't find a device name prefix we like at all... */ if ((!match) && (defaultdev != i)) { - continue; /* ...skip anything that isn't the default device. */ + continue; /* ...skip anything that isn't the default device. */ } name = ALSA_snd_device_name_get_hint(hints[i], "NAME"); @@ -873,8 +944,8 @@ ALSA_HotplugIteration(void) /* only want physical hardware interfaces */ if (!match || (SDL_strncmp(name, match, match_len) == 0)) { char *ioid = ALSA_snd_device_name_get_hint(hints[i], "IOID"); - const SDL_bool isoutput = (ioid == NULL) || (SDL_strcmp(ioid, "Output") == 0); - const SDL_bool isinput = (ioid == NULL) || (SDL_strcmp(ioid, "Input") == 0); + const SDL_bool isoutput = (!ioid) || (SDL_strcmp(ioid, "Output") == 0); + const SDL_bool isinput = (!ioid) || (SDL_strcmp(ioid, "Input") == 0); SDL_bool have_output = SDL_FALSE; SDL_bool have_input = SDL_FALSE; @@ -888,7 +959,7 @@ ALSA_HotplugIteration(void) prev = NULL; for (dev = unseen; dev; dev = next) { next = dev->next; - if ( (SDL_strcmp(dev->name, name) == 0) && (((isinput) && dev->iscapture) || ((isoutput) && !dev->iscapture)) ) { + if ((SDL_strcmp(dev->name, name) == 0) && (((isinput) && dev->iscapture) || ((isoutput) && !dev->iscapture))) { if (prev) { prev->next = next; } else { @@ -896,8 +967,12 @@ ALSA_HotplugIteration(void) } dev->next = seen; seen = dev; - if (isinput) have_input = SDL_TRUE; - if (isoutput) have_output = SDL_TRUE; + if (isinput) { + have_input = SDL_TRUE; + } + if (isoutput) { + have_output = SDL_TRUE; + } } else { prev = dev; } @@ -916,7 +991,7 @@ ALSA_HotplugIteration(void) ALSA_snd_device_name_free_hint(hints); - hotplug_devices = seen; /* now we have a known-good list of attached devices. */ + hotplug_devices = seen; /* now we have a known-good list of attached devices. */ /* report anything still in unseen as removed. */ for (dev = unseen; dev; dev = next) { @@ -933,8 +1008,7 @@ ALSA_HotplugIteration(void) static SDL_atomic_t ALSA_hotplug_shutdown; static SDL_Thread *ALSA_hotplug_thread; -static int SDLCALL -ALSA_HotplugThread(void *arg) +static int SDLCALL ALSA_HotplugThread(void *arg) { SDL_SetThreadPriority(SDL_THREAD_PRIORITY_LOW); @@ -945,17 +1019,16 @@ ALSA_HotplugThread(void *arg) SDL_Delay(100); } - ALSA_HotplugIteration(); /* run the check. */ + ALSA_HotplugIteration(); /* run the check. */ } return 0; } #endif -static void -ALSA_DetectDevices(void) +static void ALSA_DetectDevices(void) { - ALSA_HotplugIteration(); /* run once now before a thread continues to check. */ + ALSA_HotplugIteration(); /* run once now before a thread continues to check. */ #if SDL_ALSA_HOTPLUG_THREAD SDL_AtomicSet(&ALSA_hotplug_shutdown, 0); @@ -964,14 +1037,13 @@ ALSA_DetectDevices(void) #endif } -static void -ALSA_Deinitialize(void) +static void ALSA_Deinitialize(void) { ALSA_Device *dev; ALSA_Device *next; #if SDL_ALSA_HOTPLUG_THREAD - if (ALSA_hotplug_thread != NULL) { + if (ALSA_hotplug_thread) { SDL_AtomicSet(&ALSA_hotplug_shutdown, 1); SDL_WaitThread(ALSA_hotplug_thread, NULL); ALSA_hotplug_thread = NULL; @@ -990,8 +1062,7 @@ ALSA_Deinitialize(void) UnloadALSALibrary(); } -static SDL_bool -ALSA_Init(SDL_AudioDriverImpl * impl) +static SDL_bool ALSA_Init(SDL_AudioDriverImpl *impl) { if (LoadALSALibrary() < 0) { return SDL_FALSE; @@ -1007,14 +1078,14 @@ ALSA_Init(SDL_AudioDriverImpl * impl) impl->Deinitialize = ALSA_Deinitialize; impl->CaptureFromDevice = ALSA_CaptureFromDevice; impl->FlushCapture = ALSA_FlushCapture; + impl->GetDefaultAudioInfo = ALSA_GetDefaultAudioInfo; impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } - AudioBootStrap ALSA_bootstrap = { "alsa", "ALSA PCM audio", ALSA_Init, SDL_FALSE }; diff --git a/src/audio/alsa/SDL_alsa_audio.h b/src/audio/alsa/SDL_alsa_audio.h index 5ec339d9119cf..200e8e7bf5a7a 100644 --- a/src/audio/alsa/SDL_alsa_audio.h +++ b/src/audio/alsa/SDL_alsa_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/android/SDL_androidaudio.c b/src/audio/android/SDL_androidaudio.c index aa0d44242871f..c45e031df8208 100644 --- a/src/audio/android/SDL_androidaudio.c +++ b/src/audio/android/SDL_androidaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_ANDROID +#ifdef SDL_AUDIO_DRIVER_ANDROID /* Output audio to Android */ @@ -32,11 +32,11 @@ #include -static SDL_AudioDevice* audioDevice = NULL; -static SDL_AudioDevice* captureDevice = NULL; +static SDL_AudioDevice *audioDevice = NULL; +static SDL_AudioDevice *captureDevice = NULL; -static int -ANDROIDAUDIO_OpenDevice(_THIS, const char *devname) + +static int ANDROIDAUDIO_OpenDevice(_THIS, const char *devname) { SDL_AudioFormat test_format; SDL_bool iscapture = this->iscapture; @@ -50,8 +50,8 @@ ANDROIDAUDIO_OpenDevice(_THIS, const char *devname) audioDevice = this; } - this->hidden = (struct SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } @@ -69,8 +69,14 @@ ANDROIDAUDIO_OpenDevice(_THIS, const char *devname) return SDL_SetError("%s: Unsupported audio format", "android"); } - if (Android_JNI_OpenAudioDevice(iscapture, &this->spec) < 0) { - return -1; + { + int audio_device_id = 0; + if (devname) { + audio_device_id = SDL_atoi(devname); + } + if (Android_JNI_OpenAudioDevice(iscapture, audio_device_id, &this->spec) < 0) { + return -1; + } } SDL_CalculateAudioSpec(&this->spec); @@ -78,32 +84,27 @@ ANDROIDAUDIO_OpenDevice(_THIS, const char *devname) return 0; } -static void -ANDROIDAUDIO_PlayDevice(_THIS) +static void ANDROIDAUDIO_PlayDevice(_THIS) { Android_JNI_WriteAudioBuffer(); } -static Uint8 * -ANDROIDAUDIO_GetDeviceBuf(_THIS) +static Uint8 *ANDROIDAUDIO_GetDeviceBuf(_THIS) { return Android_JNI_GetAudioBuffer(); } -static int -ANDROIDAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int ANDROIDAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { return Android_JNI_CaptureAudioBuffer(buffer, buflen); } -static void -ANDROIDAUDIO_FlushCapture(_THIS) +static void ANDROIDAUDIO_FlushCapture(_THIS) { Android_JNI_FlushCapturedAudio(); } -static void -ANDROIDAUDIO_CloseDevice(_THIS) +static void ANDROIDAUDIO_CloseDevice(_THIS) { /* At this point SDL_CloseAudioDevice via close_audio_device took care of terminating the audio thread so it's safe to terminate the Java side buffer and AudioTrack @@ -119,23 +120,24 @@ ANDROIDAUDIO_CloseDevice(_THIS) SDL_free(this->hidden); } -static SDL_bool -ANDROIDAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool ANDROIDAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ + impl->DetectDevices = Android_DetectDevices; impl->OpenDevice = ANDROIDAUDIO_OpenDevice; impl->PlayDevice = ANDROIDAUDIO_PlayDevice; impl->GetDeviceBuf = ANDROIDAUDIO_GetDeviceBuf; impl->CloseDevice = ANDROIDAUDIO_CloseDevice; impl->CaptureFromDevice = ANDROIDAUDIO_CaptureFromDevice; impl->FlushCapture = ANDROIDAUDIO_FlushCapture; + impl->AllowsArbitraryDeviceNames = SDL_TRUE; /* and the capabilities */ impl->HasCaptureSupport = SDL_TRUE; - impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; + impl->OnlyHasDefaultOutputDevice = SDL_FALSE; + impl->OnlyHasDefaultCaptureDevice = SDL_FALSE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap ANDROIDAUDIO_bootstrap = { @@ -146,31 +148,12 @@ AudioBootStrap ANDROIDAUDIO_bootstrap = { void ANDROIDAUDIO_PauseDevices(void) { /* TODO: Handle multiple devices? */ - struct SDL_PrivateAudioData *private; - if(audioDevice != NULL && audioDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) audioDevice->hidden; - if (SDL_AtomicGet(&audioDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } - else { - SDL_LockMutex(audioDevice->mixer_lock); - SDL_AtomicSet(&audioDevice->paused, 1); - private->resume = SDL_TRUE; - } + if (audioDevice && audioDevice->hidden) { + SDL_LockMutex(audioDevice->mixer_lock); } - if(captureDevice != NULL && captureDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) captureDevice->hidden; - if (SDL_AtomicGet(&captureDevice->paused)) { - /* The device is already paused, leave it alone */ - private->resume = SDL_FALSE; - } - else { - SDL_LockMutex(captureDevice->mixer_lock); - SDL_AtomicSet(&captureDevice->paused, 1); - private->resume = SDL_TRUE; - } + if (captureDevice && captureDevice->hidden) { + SDL_LockMutex(captureDevice->mixer_lock); } } @@ -178,27 +161,16 @@ void ANDROIDAUDIO_PauseDevices(void) void ANDROIDAUDIO_ResumeDevices(void) { /* TODO: Handle multiple devices? */ - struct SDL_PrivateAudioData *private; - if(audioDevice != NULL && audioDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) audioDevice->hidden; - if (private->resume) { - SDL_AtomicSet(&audioDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(audioDevice->mixer_lock); - } + if (audioDevice && audioDevice->hidden) { + SDL_UnlockMutex(audioDevice->mixer_lock); } - if(captureDevice != NULL && captureDevice->hidden != NULL) { - private = (struct SDL_PrivateAudioData *) captureDevice->hidden; - if (private->resume) { - SDL_AtomicSet(&captureDevice->paused, 0); - private->resume = SDL_FALSE; - SDL_UnlockMutex(captureDevice->mixer_lock); - } + if (captureDevice && captureDevice->hidden) { + SDL_UnlockMutex(captureDevice->mixer_lock); } } -#else +#else void ANDROIDAUDIO_ResumeDevices(void) {} void ANDROIDAUDIO_PauseDevices(void) {} @@ -206,4 +178,3 @@ void ANDROIDAUDIO_PauseDevices(void) {} #endif /* SDL_AUDIO_DRIVER_ANDROID */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/audio/android/SDL_androidaudio.h b/src/audio/android/SDL_androidaudio.h index a049758644e10..e9c2ef62beb6a 100644 --- a/src/audio/android/SDL_androidaudio.h +++ b/src/audio/android/SDL_androidaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,12 +26,11 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { - /* Resume device if it was paused automatically */ - int resume; + int unused; }; void ANDROIDAUDIO_ResumeDevices(void); diff --git a/src/audio/arts/SDL_artsaudio.c b/src/audio/arts/SDL_artsaudio.c index 82d84e320dd1c..420588b962e17 100644 --- a/src/audio/arts/SDL_artsaudio.c +++ b/src/audio/arts/SDL_artsaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_ARTS +#ifdef SDL_AUDIO_DRIVER_ARTS /* Allow access to a raw mixing buffer */ @@ -86,23 +86,21 @@ static struct #undef SDL_ARTS_SYM -static void -UnloadARTSLibrary() +static void UnloadARTSLibrary(void) { - if (arts_handle != NULL) { + if (arts_handle) { SDL_UnloadObject(arts_handle); arts_handle = NULL; } } -static int -LoadARTSLibrary(void) +static int LoadARTSLibrary(void) { int i, retval = -1; - if (arts_handle == NULL) { + if (!arts_handle) { arts_handle = SDL_LoadObject(arts_library); - if (arts_handle != NULL) { + if (arts_handle) { retval = 0; for (i = 0; i < SDL_arraysize(arts_functions); ++i) { *arts_functions[i].func = @@ -121,14 +119,12 @@ LoadARTSLibrary(void) #else -static void -UnloadARTSLibrary() +static void UnloadARTSLibrary(void) { return; } -static int -LoadARTSLibrary(void) +static int LoadARTSLibrary(void) { return 0; } @@ -136,8 +132,7 @@ LoadARTSLibrary(void) #endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */ /* This function waits until it is possible to write a full sound buffer */ -static void -ARTS_WaitDevice(_THIS) +static void ARTS_WaitDevice(_THIS) { Sint32 ticks; @@ -163,8 +158,7 @@ ARTS_WaitDevice(_THIS) } } -static void -ARTS_PlayDevice(_THIS) +static void ARTS_PlayDevice(_THIS) { /* Write the audio data */ int written = SDL_NAME(arts_write) (this->hidden->stream, @@ -185,15 +179,13 @@ ARTS_PlayDevice(_THIS) #endif } -static Uint8 * -ARTS_GetDeviceBuf(_THIS) +static Uint8 *ARTS_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } -static void -ARTS_CloseDevice(_THIS) +static void ARTS_CloseDevice(_THIS) { if (this->hidden->stream) { SDL_NAME(arts_close_stream) (this->hidden->stream); @@ -203,8 +195,7 @@ ARTS_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -ARTS_Suspend(void) +static int ARTS_Suspend(void) { const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */ while ( (!SDL_NAME(arts_suspended)()) && !SDL_TICKS_PASSED(SDL_GetTicks(), abortms) ) { @@ -215,17 +206,15 @@ ARTS_Suspend(void) return SDL_NAME(arts_suspended)(); } -static int -ARTS_OpenDevice(_THIS, const char *devname) +static int ARTS_OpenDevice(_THIS, const char *devname) { int rc = 0; int bits, frag_spec = 0; SDL_AudioFormat test_format = 0; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -292,7 +281,7 @@ ARTS_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -305,20 +294,18 @@ ARTS_OpenDevice(_THIS, const char *devname) } -static void -ARTS_Deinitialize(void) +static void ARTS_Deinitialize(void) { UnloadARTSLibrary(); } -static SDL_bool -ARTS_Init(SDL_AudioDriverImpl * impl) +static SDL_bool ARTS_Init(SDL_AudioDriverImpl *impl) { if (LoadARTSLibrary() < 0) { return SDL_FALSE; } else { - if (SDL_NAME(arts_init) () != NULL) { + if (SDL_NAME(arts_init) () != 0) { UnloadARTSLibrary(); SDL_SetError("ARTS: arts_init failed (no audio server?)"); return SDL_FALSE; diff --git a/src/audio/arts/SDL_artsaudio.h b/src/audio/arts/SDL_artsaudio.h index 0f6e1693c02f4..e7f4fc175c1b4 100644 --- a/src/audio/arts/SDL_artsaudio.h +++ b/src/audio/arts/SDL_artsaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/coreaudio/SDL_coreaudio.h b/src/audio/coreaudio/SDL_coreaudio.h index 9353046a4af40..2a9fac2cc328f 100644 --- a/src/audio/coreaudio/SDL_coreaudio.h +++ b/src/audio/coreaudio/SDL_coreaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,10 +26,10 @@ #include "../SDL_sysaudio.h" #if !defined(__IPHONEOS__) -#define MACOSX_COREAUDIO 1 +#define MACOSX_COREAUDIO #endif -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO #include #else #import @@ -40,7 +40,7 @@ #include /* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO #include #ifndef MAC_OS_VERSION_12_0 #define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster @@ -48,7 +48,7 @@ #endif /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -62,7 +62,7 @@ struct SDL_PrivateAudioData AudioStreamBasicDescription strdesc; SDL_sem *ready_semaphore; char *thread_error; -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO AudioDeviceID deviceID; SDL_atomic_t device_change_flag; #else diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index d223359122e92..941a2afe03ca7 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_COREAUDIO +#ifdef SDL_AUDIO_DRIVER_COREAUDIO /* !!! FIXME: clean out some of the macro salsa in here. */ @@ -34,22 +34,21 @@ #define DEBUG_COREAUDIO 0 #if DEBUG_COREAUDIO - #define CHECK_RESULT(msg) \ - if (result != noErr) { \ - printf("COREAUDIO: Got error %d from '%s'!\n", (int) result, msg); \ - SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \ - return 0; \ - } +#define CHECK_RESULT(msg) \ + if (result != noErr) { \ + printf("COREAUDIO: Got error %d from '%s'!\n", (int)result, msg); \ + SDL_SetError("CoreAudio error (%s): %d", msg, (int)result); \ + return 0; \ + } #else - #define CHECK_RESULT(msg) \ - if (result != noErr) { \ - SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \ - return 0; \ - } +#define CHECK_RESULT(msg) \ + if (result != noErr) { \ + SDL_SetError("CoreAudio error (%s): %d", msg, (int)result); \ + return 0; \ + } #endif - -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO static const AudioObjectPropertyAddress devlist_address = { kAudioHardwarePropertyDevices, kAudioObjectPropertyScopeGlobal, @@ -68,10 +67,9 @@ static AudioDeviceList *output_devs = NULL; static AudioDeviceList *capture_devs = NULL; -static SDL_bool -add_to_internal_dev_list(const int iscapture, AudioDeviceID devId) +static SDL_bool add_to_internal_dev_list(const int iscapture, AudioDeviceID devId) { - AudioDeviceList *item = (AudioDeviceList *) SDL_malloc(sizeof (AudioDeviceList)); + AudioDeviceList *item = (AudioDeviceList *)SDL_malloc(sizeof(AudioDeviceList)); if (item == NULL) { return SDL_FALSE; } @@ -87,16 +85,14 @@ return SDL_TRUE; } -static void -addToDevList(const char *name, SDL_AudioSpec *spec, const int iscapture, AudioDeviceID devId, void *data) +static void addToDevList(const char *name, SDL_AudioSpec *spec, const int iscapture, AudioDeviceID devId, void *data) { if (add_to_internal_dev_list(iscapture, devId)) { - SDL_AddAudioDevice(iscapture, name, spec, (void *) ((size_t) devId)); + SDL_AddAudioDevice(iscapture, name, spec, (void *)((size_t)devId)); } } -static void -build_device_list(int iscapture, addDevFn addfn, void *addfndata) +static void build_device_list(int iscapture, addDevFn addfn, void *addfndata) { OSStatus result = noErr; UInt32 size = 0; @@ -106,19 +102,22 @@ result = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &devlist_address, 0, NULL, &size); - if (result != kAudioHardwareNoError) + if (result != kAudioHardwareNoError) { return; + } - devs = (AudioDeviceID *) alloca(size); - if (devs == NULL) + devs = (AudioDeviceID *)alloca(size); + if (devs == NULL) { return; + } result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &devlist_address, 0, NULL, &size, devs); - if (result != kAudioHardwareNoError) + if (result != kAudioHardwareNoError) { return; + } - max = size / sizeof (AudioDeviceID); + max = size / sizeof(AudioDeviceID); for (i = 0; i < max; i++) { CFStringRef cfstr = NULL; char *ptr = NULL; @@ -145,12 +144,14 @@ }; result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size); - if (result != noErr) + if (result != noErr) { continue; + } - buflist = (AudioBufferList *) SDL_malloc(size); - if (buflist == NULL) + buflist = (AudioBufferList *)SDL_malloc(size); + if (buflist == NULL) { continue; + } result = AudioObjectGetPropertyData(dev, &addr, 0, NULL, &size, buflist); @@ -165,27 +166,28 @@ SDL_free(buflist); - if (spec.channels == 0) + if (spec.channels == 0) { continue; + } - size = sizeof (sampleRate); + size = sizeof(sampleRate); result = AudioObjectGetPropertyData(dev, &freqaddr, 0, NULL, &size, &sampleRate); if (result == noErr) { - spec.freq = (int) sampleRate; + spec.freq = (int)sampleRate; } - size = sizeof (CFStringRef); + size = sizeof(CFStringRef); result = AudioObjectGetPropertyData(dev, &nameaddr, 0, NULL, &size, &cfstr); - if (result != kAudioHardwareNoError) + if (result != kAudioHardwareNoError) { continue; + } len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), kCFStringEncodingUTF8); - ptr = (char *) SDL_malloc(len + 1); + ptr = (char *)SDL_malloc(len + 1); usable = ((ptr != NULL) && - (CFStringGetCString - (cfstr, ptr, len + 1, kCFStringEncodingUTF8))); + (CFStringGetCString(cfstr, ptr, len + 1, kCFStringEncodingUTF8))); CFRelease(cfstr); @@ -204,16 +206,15 @@ #if DEBUG_COREAUDIO printf("COREAUDIO: Found %s device #%d: '%s' (devid %d)\n", ((iscapture) ? "capture" : "output"), - (int) i, ptr, (int) dev); + (int)i, ptr, (int)dev); #endif addfn(ptr, &spec, iscapture, dev, addfndata); } - SDL_free(ptr); /* addfn() would have copied the string. */ + SDL_free(ptr); /* addfn() would have copied the string. */ } } -static void -free_audio_device_list(AudioDeviceList **list) +static void free_audio_device_list(AudioDeviceList **list) { AudioDeviceList *item = *list; while (item) { @@ -224,17 +225,15 @@ *list = NULL; } -static void -COREAUDIO_DetectDevices(void) +static void COREAUDIO_DetectDevices(void) { build_device_list(SDL_TRUE, addToDevList, NULL); build_device_list(SDL_FALSE, addToDevList, NULL); } -static void -build_device_change_list(const char *name, SDL_AudioSpec *spec, const int iscapture, AudioDeviceID devId, void *data) +static void build_device_change_list(const char *name, SDL_AudioSpec *spec, const int iscapture, AudioDeviceID devId, void *data) { - AudioDeviceList **list = (AudioDeviceList **) data; + AudioDeviceList **list = (AudioDeviceList **)data; AudioDeviceList *item; for (item = *list; item != NULL; item = item->next) { if (item->devid == devId) { @@ -243,12 +242,11 @@ } } - add_to_internal_dev_list(iscapture, devId); /* new device, add it. */ - SDL_AddAudioDevice(iscapture, name, spec, (void *) ((size_t) devId)); + add_to_internal_dev_list(iscapture, devId); /* new device, add it. */ + SDL_AddAudioDevice(iscapture, name, spec, (void *)((size_t)devId)); } -static void -reprocess_device_list(const int iscapture, AudioDeviceList **list) +static void reprocess_device_list(const int iscapture, AudioDeviceList **list) { AudioDeviceList *item; AudioDeviceList *prev = NULL; @@ -265,7 +263,7 @@ if (item->alive) { prev = item; } else { - SDL_RemoveAudioDevice(iscapture, (void *) ((size_t) item->devid)); + SDL_RemoveAudioDevice(iscapture, (void *)((size_t)item->devid)); if (prev) { prev->next = item->next; } else { @@ -278,8 +276,7 @@ } /* this is called when the system's list of available audio devices changes. */ -static OSStatus -device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) +static OSStatus device_list_changed(AudioObjectID systemObj, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) { reprocess_device_list(SDL_TRUE, &capture_devs); reprocess_device_list(SDL_FALSE, &output_devs); @@ -287,17 +284,16 @@ } #endif - static int open_playback_devices; static int open_capture_devices; static int num_open_devices; static SDL_AudioDevice **open_devices; -#if !MACOSX_COREAUDIO +#ifndef MACOSX_COREAUDIO static BOOL session_active = NO; -static void pause_audio_devices() +static void pause_audio_devices(void) { int i; @@ -313,7 +309,7 @@ static void pause_audio_devices() } } -static void resume_audio_devices() +static void resume_audio_devices(void) { int i; @@ -339,16 +335,14 @@ static void interruption_begin(_THIS) static void interruption_end(_THIS) { - if (this != NULL && this->hidden != NULL && this->hidden->audioQueue != NULL - && this->hidden->interrupted - && AudioQueueStart(this->hidden->audioQueue, NULL) == AVAudioSessionErrorCodeNone) { + if (this != NULL && this->hidden != NULL && this->hidden->audioQueue != NULL && this->hidden->interrupted && AudioQueueStart(this->hidden->audioQueue, NULL) == AVAudioSessionErrorCodeNone) { this->hidden->interrupted = SDL_FALSE; } } @interface SDLInterruptionListener : NSObject -@property (nonatomic, assign) SDL_AudioDevice *device; +@property(nonatomic, assign) SDL_AudioDevice *device; @end @@ -356,7 +350,7 @@ @implementation SDLInterruptionListener - (void)audioSessionInterruption:(NSNotification *)note { - @synchronized (self) { + @synchronized(self) { NSNumber *type = note.userInfo[AVAudioSessionInterruptionTypeKey]; if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan) { interruption_begin(self.device); @@ -368,7 +362,7 @@ - (void)audioSessionInterruption:(NSNotification *)note - (void)applicationBecameActive:(NSNotification *)note { - @synchronized (self) { + @synchronized(self) { interruption_end(self.device); } } @@ -389,7 +383,8 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec hint = SDL_GetHint(SDL_HINT_AUDIO_CATEGORY); if (hint) { - if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0) { + if (SDL_strcasecmp(hint, "AVAudioSessionCategoryAmbient") == 0 || + SDL_strcasecmp(hint, "ambient") == 0) { category = AVAudioSessionCategoryAmbient; } else if (SDL_strcasecmp(hint, "AVAudioSessionCategorySoloAmbient") == 0) { category = AVAudioSessionCategorySoloAmbient; @@ -461,12 +456,13 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec if ((open_playback_devices || open_capture_devices) && !session_active) { if (![session setActive:YES error:&err]) { + NSString *desc; if ([err code] == AVAudioSessionErrorCodeResourceNotAvailable && category == AVAudioSessionCategoryPlayAndRecord) { return update_audio_session(this, open, SDL_FALSE); } - NSString *desc = err.description; + desc = err.description; SDL_SetError("Could not activate Audio Session: %s", desc.UTF8String); return NO; } @@ -504,9 +500,9 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec this->hidden->interruption_listener = CFBridgingRetain(listener); } else { SDLInterruptionListener *listener = nil; - listener = (SDLInterruptionListener *) CFBridgingRelease(this->hidden->interruption_listener); + listener = (SDLInterruptionListener *)CFBridgingRelease(this->hidden->interruption_listener); [center removeObserver:listener]; - @synchronized (listener) { + @synchronized(listener) { listener.device = NULL; } } @@ -516,33 +512,34 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec } #endif - /* The AudioQueue callback */ -static void -outputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) +static void outputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) { - SDL_AudioDevice *this = (SDL_AudioDevice *) inUserData; + SDL_AudioDevice *this = (SDL_AudioDevice *)inUserData; /* This flag is set before this->mixer_lock is destroyed during shutdown, so check it before grabbing the mutex, and then check it again _after_ in case we blocked waiting on the lock. */ if (SDL_AtomicGet(&this->shutdown)) { - return; /* don't do anything, since we don't even want to enqueue this buffer again. */ + return; /* don't do anything, since we don't even want to enqueue this buffer again. */ } SDL_LockMutex(this->mixer_lock); if (SDL_AtomicGet(&this->shutdown)) { SDL_UnlockMutex(this->mixer_lock); - return; /* don't do anything, since we don't even want to enqueue this buffer again. */ + return; /* don't do anything, since we don't even want to enqueue this buffer again. */ } if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) { /* Supply silence if audio is not enabled or paused */ SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity); + if (this->stream) { + SDL_AudioStreamClear(this->stream); + } } else if (this->stream) { UInt32 remaining = inBuffer->mAudioDataBytesCapacity; - Uint8 *ptr = (Uint8 *) inBuffer->mAudioData; + Uint8 *ptr = (Uint8 *)inBuffer->mAudioData; while (remaining > 0) { if (SDL_AudioStreamAvailable(this->stream) == 0) { @@ -555,8 +552,9 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec if (SDL_AudioStreamAvailable(this->stream) > 0) { int got; UInt32 len = SDL_AudioStreamAvailable(this->stream); - if (len > remaining) + if (len > remaining) { len = remaining; + } got = SDL_AudioStreamGet(this->stream, ptr, len); SDL_assert((got < 0) || (got == len)); if (got != len) { @@ -568,14 +566,14 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec } } else { UInt32 remaining = inBuffer->mAudioDataBytesCapacity; - Uint8 *ptr = (Uint8 *) inBuffer->mAudioData; + Uint8 *ptr = (Uint8 *)inBuffer->mAudioData; while (remaining > 0) { UInt32 len; if (this->hidden->bufferOffset >= this->hidden->bufferSize) { /* Generate the data */ (*this->callbackspec.callback)(this->callbackspec.userdata, - this->hidden->buffer, this->hidden->bufferSize); + this->hidden->buffer, this->hidden->bufferSize); this->hidden->bufferOffset = 0; } @@ -583,8 +581,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec if (len > remaining) { len = remaining; } - SDL_memcpy(ptr, (char *)this->hidden->buffer + - this->hidden->bufferOffset, len); + SDL_memcpy(ptr, (char *)this->hidden->buffer + this->hidden->bufferOffset, len); ptr = ptr + len; remaining -= len; this->hidden->bufferOffset += len; @@ -598,20 +595,19 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec SDL_UnlockMutex(this->mixer_lock); } -static void -inputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer, - const AudioTimeStamp *inStartTime, UInt32 inNumberPacketDescriptions, - const AudioStreamPacketDescription *inPacketDescs) +static void inputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer, + const AudioTimeStamp *inStartTime, UInt32 inNumberPacketDescriptions, + const AudioStreamPacketDescription *inPacketDescs) { - SDL_AudioDevice *this = (SDL_AudioDevice *) inUserData; + SDL_AudioDevice *this = (SDL_AudioDevice *)inUserData; if (SDL_AtomicGet(&this->shutdown)) { - return; /* don't do anything. */ + return; /* don't do anything. */ } /* ignore unless we're active. */ if (!SDL_AtomicGet(&this->paused) && SDL_AtomicGet(&this->enabled)) { - const Uint8 *ptr = (const Uint8 *) inBuffer->mAudioData; + const Uint8 *ptr = (const Uint8 *)inBuffer->mAudioData; UInt32 remaining = inBuffer->mAudioDataByteSize; while (remaining > 0) { UInt32 len = this->hidden->bufferSize - this->hidden->bufferOffset; @@ -636,35 +632,32 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec AudioQueueEnqueueBuffer(this->hidden->audioQueue, inBuffer, 0, NULL); } - -#if MACOSX_COREAUDIO -static const AudioObjectPropertyAddress alive_address = -{ +#ifdef MACOSX_COREAUDIO +static const AudioObjectPropertyAddress alive_address = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMain }; -static OSStatus -device_unplugged(AudioObjectID devid, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) +static OSStatus device_unplugged(AudioObjectID devid, UInt32 num_addr, const AudioObjectPropertyAddress *addrs, void *data) { - SDL_AudioDevice *this = (SDL_AudioDevice *) data; + SDL_AudioDevice *this = (SDL_AudioDevice *)data; SDL_bool dead = SDL_FALSE; UInt32 isAlive = 1; - UInt32 size = sizeof (isAlive); + UInt32 size = sizeof(isAlive); OSStatus error; if (!SDL_AtomicGet(&this->enabled)) { - return 0; /* already known to be dead. */ + return 0; /* already known to be dead. */ } error = AudioObjectGetPropertyData(this->hidden->deviceID, &alive_address, 0, NULL, &size, &isAlive); if (error == kAudioHardwareBadDeviceError) { - dead = SDL_TRUE; /* device was unplugged. */ + dead = SDL_TRUE; /* device was unplugged. */ } else if ((error == kAudioHardwareNoError) && (!isAlive)) { - dead = SDL_TRUE; /* device died in some other way. */ + dead = SDL_TRUE; /* device died in some other way. */ } if (dead) { @@ -675,28 +668,40 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec } /* macOS calls this when the default device changed (if we have a default device open). */ -static OSStatus -default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *inUserData) +static OSStatus default_device_changed(AudioObjectID inObjectID, UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses, void *inUserData) { - SDL_AudioDevice *this = (SDL_AudioDevice *) inUserData; - #if DEBUG_COREAUDIO + SDL_AudioDevice *this = (SDL_AudioDevice *)inUserData; +#if DEBUG_COREAUDIO printf("COREAUDIO: default device changed for SDL audio device %p!\n", this); - #endif - SDL_AtomicSet(&this->hidden->device_change_flag, 1); /* let the audioqueue thread pick up on this when safe to do so. */ +#endif + + /* due to a bug (?) in CoreAudio, this seems able to fire for a device pointer that's already closed, so check our list to make sure + the pointer is still valid before touching it. https://github.com/libsdl-org/SDL/issues/10432 */ + if (open_devices) { + int i; + for (i = 0; i < num_open_devices; i++) { + SDL_AudioDevice *device = open_devices[i]; + if (device == this) { + if (this->hidden) { + SDL_AtomicSet(&this->hidden->device_change_flag, 1); /* let the audioqueue thread pick up on this when safe to do so. */ + } + return noErr; + } + } + } return noErr; } #endif -static void -COREAUDIO_CloseDevice(_THIS) +static void COREAUDIO_CloseDevice(_THIS) { const SDL_bool iscapture = this->iscapture; int i; /* !!! FIXME: what does iOS do when a bluetooth audio device vanishes? Headphones unplugged? */ /* !!! FIXME: (we only do a "default" device on iOS right now...can we do more?) */ -#if MACOSX_COREAUDIO - if (this->handle != NULL) { /* we don't register this listener for default devices. */ +#ifdef MACOSX_COREAUDIO + if (this->handle != NULL) { /* we don't register this listener for default devices. */ AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); } #endif @@ -706,11 +711,13 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec /* dispose of the audio queue before waiting on the thread, or it might stall for a long time! */ if (this->hidden->audioQueue) { + AudioQueueFlush(this->hidden->audioQueue); + AudioQueueStop(this->hidden->audioQueue, 0); AudioQueueDispose(this->hidden->audioQueue, 0); } if (this->hidden->thread) { - SDL_assert(SDL_AtomicGet(&this->shutdown) != 0); /* should have been set by SDL_audio.c */ + SDL_assert(SDL_AtomicGet(&this->shutdown) != 0); /* should have been set by SDL_audio.c */ SDL_WaitThread(this->hidden->thread, NULL); } @@ -720,7 +727,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec open_playback_devices--; } -#if !MACOSX_COREAUDIO +#ifndef MACOSX_COREAUDIO update_audio_session(this, SDL_FALSE, SDL_TRUE); #endif @@ -728,7 +735,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec if (open_devices[i] == this) { --num_open_devices; if (i < num_open_devices) { - SDL_memmove(&open_devices[i], &open_devices[i+1], sizeof(open_devices[i])*(num_open_devices - i)); + SDL_memmove(&open_devices[i], &open_devices[i + 1], sizeof(open_devices[i]) * (num_open_devices - i)); } break; } @@ -749,13 +756,12 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec SDL_free(this->hidden); } -#if MACOSX_COREAUDIO -static int -prepare_device(_THIS) +#ifdef MACOSX_COREAUDIO +static int prepare_device(_THIS) { void *handle = this->handle; SDL_bool iscapture = this->iscapture; - AudioDeviceID devid = (AudioDeviceID) ((size_t) handle); + AudioDeviceID devid = (AudioDeviceID)((size_t)handle); OSStatus result = noErr; UInt32 size = 0; UInt32 alive = 0; @@ -768,23 +774,20 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec }; if (handle == NULL) { - size = sizeof (AudioDeviceID); + size = sizeof(AudioDeviceID); addr.mSelector = - ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : - kAudioHardwarePropertyDefaultOutputDevice); + ((iscapture) ? kAudioHardwarePropertyDefaultInputDevice : kAudioHardwarePropertyDefaultOutputDevice); result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0, NULL, &size, &devid); CHECK_RESULT("AudioHardwareGetProperty (default device)"); } addr.mSelector = kAudioDevicePropertyDeviceIsAlive; - addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : - kAudioDevicePropertyScopeOutput; + addr.mScope = iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput; - size = sizeof (alive); + size = sizeof(alive); result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &alive); - CHECK_RESULT - ("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); + CHECK_RESULT("AudioDeviceGetProperty (kAudioDevicePropertyDeviceIsAlive)"); if (!alive) { SDL_SetError("CoreAudio: requested device exists, but isn't alive."); @@ -792,7 +795,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec } addr.mSelector = kAudioDevicePropertyHogMode; - size = sizeof (pid); + size = sizeof(pid); result = AudioObjectGetPropertyData(devid, &addr, 0, NULL, &size, &pid); /* some devices don't support this property, so errors are fine here. */ @@ -805,8 +808,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec return 1; } -static int -assign_device_to_audioqueue(_THIS) +static int assign_device_to_audioqueue(_THIS) { const AudioObjectPropertyAddress prop = { kAudioDevicePropertyDeviceUID, @@ -816,18 +818,17 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec OSStatus result; CFStringRef devuid; - UInt32 devuidsize = sizeof (devuid); + UInt32 devuidsize = sizeof(devuid); result = AudioObjectGetPropertyData(this->hidden->deviceID, &prop, 0, NULL, &devuidsize, &devuid); CHECK_RESULT("AudioObjectGetPropertyData (kAudioDevicePropertyDeviceUID)"); result = AudioQueueSetProperty(this->hidden->audioQueue, kAudioQueueProperty_CurrentDevice, &devuid, devuidsize); + CFRelease(devuid); /* Release devuid; we're done with it and AudioQueueSetProperty should have retained if it wants to keep it. */ CHECK_RESULT("AudioQueueSetProperty (kAudioQueueProperty_CurrentDevice)"); - return 1; } #endif -static int -prepare_audioqueue(_THIS) +static int prepare_audioqueue(_THIS) { const AudioStreamBasicDescription *strdesc = &this->hidden->strdesc; const int iscapture = this->iscapture; @@ -835,7 +836,8 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec int i, numAudioBuffers = 2; AudioChannelLayout layout; double MINIMUM_AUDIO_BUFFER_TIME_MS; - const double msecs = (this->spec.samples / ((double) this->spec.freq)) * 1000.0;; + const double msecs = (this->spec.samples / ((double)this->spec.freq)) * 1000.0; + ; SDL_assert(CFRunLoopGetCurrent() != NULL); @@ -847,7 +849,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec CHECK_RESULT("AudioQueueNewOutput"); } - #if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO if (!assign_device_to_audioqueue(this)) { return 0; } @@ -861,7 +863,7 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec /* If this fails, oh well, we won't notice a device had an extraordinary event take place. */ AudioObjectAddPropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this); } - #endif +#endif /* Calculate the final parameters for this audio specification */ SDL_CalculateAudioSpec(&this->spec); @@ -870,30 +872,50 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec SDL_zero(layout); switch (this->spec.channels) { case 1: + // a standard mono stream layout.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; break; case 2: + // a standard stereo stream (L R) - implied playback layout.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo; break; case 3: + // L R LFE layout.mChannelLayoutTag = kAudioChannelLayoutTag_DVD_4; break; case 4: + // front left, front right, back left, back right layout.mChannelLayoutTag = kAudioChannelLayoutTag_Quadraphonic; break; case 5: - layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_5_0_A; + // L R LFE Ls Rs + layout.mChannelLayoutTag = kAudioChannelLayoutTag_DVD_6; break; case 6: - layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_5_1_A; + // L R C LFE Ls Rs + layout.mChannelLayoutTag = kAudioChannelLayoutTag_DVD_12; break; +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000) || \ + (defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101500) case 7: - /* FIXME: Need to move channel[4] (BC) to channel[6] */ - layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_6_1_A; + // L R C LFE Cs Ls Rs + if (@available(macOS 10.15, iOS 13, *)) { + layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_6_1; + } else { + return SDL_SetError("Unsupported audio channels"); + } break; case 8: - layout.mChannelLayoutTag = kAudioChannelLayoutTag_MPEG_7_1_A; + // L R C LFE Rls Rrs Ls Rs + if (@available(macOS 10.15, iOS 13, *)) { + layout.mChannelLayoutTag = kAudioChannelLayoutTag_WAVE_7_1; + } else { + return SDL_SetError("Unsupported audio channels"); + } break; +#endif + default: + return SDL_SetError("Unsupported audio channels"); } if (layout.mChannelLayoutTag != 0) { result = AudioQueueSetProperty(this->hidden->audioQueue, kAudioQueueProperty_ChannelLayout, &layout, sizeof(layout)); @@ -918,12 +940,12 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec MINIMUM_AUDIO_BUFFER_TIME_MS = 40.0; } #endif - if (msecs < MINIMUM_AUDIO_BUFFER_TIME_MS) { /* use more buffers if we have a VERY small sample set. */ + if (msecs < MINIMUM_AUDIO_BUFFER_TIME_MS) { /* use more buffers if we have a VERY small sample set. */ numAudioBuffers = ((int)SDL_ceil(MINIMUM_AUDIO_BUFFER_TIME_MS / msecs) * 2); } this->hidden->numAudioBuffers = numAudioBuffers; - this->hidden->audioBuffer = SDL_calloc(1, sizeof (AudioQueueBufferRef) * numAudioBuffers); + this->hidden->audioBuffer = SDL_calloc(1, sizeof(AudioQueueBufferRef) * numAudioBuffers); if (this->hidden->audioBuffer == NULL) { SDL_OutOfMemory(); return 0; @@ -950,24 +972,23 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec return 1; } -static int -audioqueue_thread(void *arg) +static int audioqueue_thread(void *arg) { - SDL_AudioDevice *this = (SDL_AudioDevice *) arg; + SDL_AudioDevice *this = (SDL_AudioDevice *)arg; int rc; - #if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO const AudioObjectPropertyAddress default_device_address = { this->iscapture ? kAudioHardwarePropertyDefaultInputDevice : kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMain }; - if (this->handle == NULL) { /* opened the default device? Register to know if the user picks a new default. */ + if (this->handle == NULL) { /* opened the default device? Register to know if the user picks a new default. */ /* we don't care if this fails; we just won't change to new default devices, but we still otherwise function in this case. */ AudioObjectAddPropertyListener(kAudioObjectSystemObject, &default_device_address, default_device_changed, this); } - #endif +#endif rc = prepare_audioqueue(this); if (!rc) { @@ -984,14 +1005,14 @@ static BOOL update_audio_session(_THIS, SDL_bool open, SDL_bool allow_playandrec while (!SDL_AtomicGet(&this->shutdown)) { CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.10, 1); - #if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO if ((this->handle == NULL) && SDL_AtomicGet(&this->hidden->device_change_flag)) { const AudioDeviceID prev_devid = this->hidden->deviceID; SDL_AtomicSet(&this->hidden->device_change_flag, 0); - #if DEBUG_COREAUDIO +#if DEBUG_COREAUDIO printf("COREAUDIO: audioqueue_thread is trying to switch to new default device!\n"); - #endif +#endif /* if any of this fails, there's not much to do but wait to see if the user gives up and quits (flagging the audioqueue for shutdown), or toggles to some other system @@ -1009,26 +1030,25 @@ output device (in which case we'll try again). */ } } } - #endif +#endif } - if (!this->iscapture) { /* Drain off any pending playback. */ - const CFTimeInterval secs = (((this->spec.size / (SDL_AUDIO_BITSIZE(this->spec.format) / 8)) / this->spec.channels) / ((CFTimeInterval) this->spec.freq)) * 2.0; + if (!this->iscapture) { /* Drain off any pending playback. */ + const CFTimeInterval secs = (((this->spec.size / (SDL_AUDIO_BITSIZE(this->spec.format) / 8.0)) / this->spec.channels) / ((CFTimeInterval)this->spec.freq)) * 2.0; CFRunLoopRunInMode(kCFRunLoopDefaultMode, secs, 0); } - #if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO if (this->handle == NULL) { /* we don't care if this fails; we just won't change to new default devices, but we still otherwise function in this case. */ AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &default_device_address, default_device_changed, this); } - #endif +#endif return 0; } -static int -COREAUDIO_OpenDevice(_THIS, const char *devname) +static int COREAUDIO_OpenDevice(_THIS, const char *devname) { AudioStreamBasicDescription *strdesc; SDL_AudioFormat test_format; @@ -1036,8 +1056,7 @@ output device (in which case we'll try again). */ SDL_AudioDevice **new_open_devices; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); if (this->hidden == NULL) { return SDL_OutOfMemory(); } @@ -1057,14 +1076,14 @@ output device (in which case we'll try again). */ open_devices[num_open_devices++] = this; } -#if !MACOSX_COREAUDIO +#ifndef MACOSX_COREAUDIO if (!update_audio_session(this, SDL_TRUE, SDL_TRUE)) { return -1; } /* Stop CoreAudio from doing expensive audio rate conversion */ @autoreleasepool { - AVAudioSession* session = [AVAudioSession sharedInstance]; + AVAudioSession *session = [AVAudioSession sharedInstance]; [session setPreferredSampleRate:this->spec.freq error:nil]; this->spec.freq = (int)session.sampleRate; #if TARGET_OS_TV @@ -1108,23 +1127,25 @@ output device (in which case we'll try again). */ break; } - if (!test_format) { /* shouldn't happen, but just in case... */ + if (!test_format) { /* shouldn't happen, but just in case... */ return SDL_SetError("%s: Unsupported audio format", "coreaudio"); } this->spec.format = test_format; strdesc->mBitsPerChannel = SDL_AUDIO_BITSIZE(test_format); - if (SDL_AUDIO_ISBIGENDIAN(test_format)) + if (SDL_AUDIO_ISBIGENDIAN(test_format)) { strdesc->mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; + } - if (SDL_AUDIO_ISFLOAT(test_format)) + if (SDL_AUDIO_ISFLOAT(test_format)) { strdesc->mFormatFlags |= kLinearPCMFormatFlagIsFloat; - else if (SDL_AUDIO_ISSIGNED(test_format)) + } else if (SDL_AUDIO_ISSIGNED(test_format)) { strdesc->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + } strdesc->mBytesPerFrame = strdesc->mChannelsPerFrame * strdesc->mBitsPerChannel / 8; strdesc->mBytesPerPacket = strdesc->mBytesPerFrame * strdesc->mFramesPerPacket; -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO if (!prepare_device(this)) { return -1; } @@ -1133,7 +1154,7 @@ output device (in which case we'll try again). */ /* This has to init in a new thread so it can get its own CFRunLoop. :/ */ this->hidden->ready_semaphore = SDL_CreateSemaphore(0); if (!this->hidden->ready_semaphore) { - return -1; /* oh well. */ + return -1; /* oh well. */ } this->hidden->thread = SDL_CreateThreadInternal(audioqueue_thread, "AudioQueue thread", 512 * 1024, this); @@ -1152,11 +1173,10 @@ output device (in which case we'll try again). */ return (this->hidden->thread != NULL) ? 0 : -1; } -#if !MACOSX_COREAUDIO -static int -COREAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +#ifndef MACOSX_COREAUDIO +static int COREAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { - AVAudioSession* session = [AVAudioSession sharedInstance]; + AVAudioSession *session = [AVAudioSession sharedInstance]; if (name != NULL) { *name = NULL; @@ -1166,9 +1186,8 @@ output device (in which case we'll try again). */ spec->channels = [session outputNumberOfChannels]; return 0; } -#else /* MACOSX_COREAUDIO */ -static int -COREAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +#else /* MACOSX_COREAUDIO */ +static int COREAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { AudioDeviceID devid; AudioBufferList *buflist; @@ -1207,7 +1226,7 @@ output device (in which case we'll try again). */ /* Get the Device ID */ cfstr = NULL; - size = sizeof (AudioDeviceID); + size = sizeof(AudioDeviceID); result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &addr, 0, NULL, &size, &devid); @@ -1217,7 +1236,7 @@ output device (in which case we'll try again). */ if (name != NULL) { /* Use the Device ID to get the name */ - size = sizeof (CFStringRef); + size = sizeof(CFStringRef); result = AudioObjectGetPropertyData(devid, &nameaddr, 0, NULL, &size, &cfstr); if (result != noErr) { @@ -1225,8 +1244,8 @@ output device (in which case we'll try again). */ } len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(cfstr), - kCFStringEncodingUTF8); - devname = (char *) SDL_malloc(len + 1); + kCFStringEncodingUTF8); + devname = (char *)SDL_malloc(len + 1); usable = ((devname != NULL) && (CFStringGetCString(cfstr, devname, len + 1, kCFStringEncodingUTF8))); CFRelease(cfstr); @@ -1258,15 +1277,17 @@ output device (in which case we'll try again). */ return SDL_SetError("%s: Default Device Sample Rate not found", "coreaudio"); } - spec->freq = (int) sampleRate; + spec->freq = (int)sampleRate; result = AudioObjectGetPropertyDataSize(devid, &bufaddr, 0, NULL, &size); - if (result != noErr) + if (result != noErr) { return SDL_SetError("%s: Default Device Data Size not found", "coreaudio"); + } - buflist = (AudioBufferList *) SDL_malloc(size); - if (buflist == NULL) + buflist = (AudioBufferList *)SDL_malloc(size); + if (buflist == NULL) { return SDL_SetError("%s: Default Device Buffer List not found", "coreaudio"); + } result = AudioObjectGetPropertyData(devid, &bufaddr, 0, NULL, &size, buflist); @@ -1288,18 +1309,16 @@ output device (in which case we'll try again). */ } #endif /* MACOSX_COREAUDIO */ -static void -COREAUDIO_Deinitialize(void) +static void COREAUDIO_Deinitialize(void) { -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO AudioObjectRemovePropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); free_audio_device_list(&capture_devs); free_audio_device_list(&output_devs); #endif } -static SDL_bool -COREAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool COREAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = COREAUDIO_OpenDevice; @@ -1307,7 +1326,7 @@ output device (in which case we'll try again). */ impl->Deinitialize = COREAUDIO_Deinitialize; impl->GetDefaultAudioInfo = COREAUDIO_GetDefaultAudioInfo; -#if MACOSX_COREAUDIO +#ifdef MACOSX_COREAUDIO impl->DetectDevices = COREAUDIO_DetectDevices; AudioObjectAddPropertyListener(kAudioObjectSystemObject, &devlist_address, device_list_changed, NULL); #else @@ -1319,7 +1338,7 @@ output device (in which case we'll try again). */ impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap COREAUDIO_bootstrap = { diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c index 885b5f0d54151..9d52c38399a18 100644 --- a/src/audio/directsound/SDL_directsound.c +++ b/src/audio/directsound/SDL_directsound.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_DSOUND +#ifdef SDL_AUDIO_DRIVER_DSOUND /* Allow access to a raw mixing buffer */ @@ -30,7 +30,7 @@ #include "../SDL_audio_c.h" #include "SDL_directsound.h" #include -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H #include "../../core/windows/SDL_immdevice.h" #endif /* HAVE_MMDEVICEAPI_H */ @@ -39,61 +39,60 @@ #endif /* For Vista+, we can enumerate DSound devices with IMMDevice */ -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H static SDL_bool SupportsIMMDevice = SDL_FALSE; #endif /* HAVE_MMDEVICEAPI_H */ /* DirectX function pointers for audio */ -static void* DSoundDLL = NULL; -typedef HRESULT (WINAPI *fnDirectSoundCreate8)(LPGUID,LPDIRECTSOUND*,LPUNKNOWN); -typedef HRESULT (WINAPI *fnDirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); -typedef HRESULT (WINAPI *fnDirectSoundCaptureCreate8)(LPCGUID,LPDIRECTSOUNDCAPTURE8 *,LPUNKNOWN); -typedef HRESULT (WINAPI *fnDirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW,LPVOID); +static void *DSoundDLL = NULL; +typedef HRESULT(WINAPI *fnDirectSoundCreate8)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); +typedef HRESULT(WINAPI *fnDirectSoundEnumerateW)(LPDSENUMCALLBACKW, LPVOID); +typedef HRESULT(WINAPI *fnDirectSoundCaptureCreate8)(LPCGUID, LPDIRECTSOUNDCAPTURE8 *, LPUNKNOWN); +typedef HRESULT(WINAPI *fnDirectSoundCaptureEnumerateW)(LPDSENUMCALLBACKW, LPVOID); static fnDirectSoundCreate8 pDirectSoundCreate8 = NULL; static fnDirectSoundEnumerateW pDirectSoundEnumerateW = NULL; static fnDirectSoundCaptureCreate8 pDirectSoundCaptureCreate8 = NULL; static fnDirectSoundCaptureEnumerateW pDirectSoundCaptureEnumerateW = NULL; -static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; -static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; +static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; +static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; -static void -DSOUND_Unload(void) +static void DSOUND_Unload(void) { pDirectSoundCreate8 = NULL; pDirectSoundEnumerateW = NULL; pDirectSoundCaptureCreate8 = NULL; pDirectSoundCaptureEnumerateW = NULL; - if (DSoundDLL != NULL) { + if (DSoundDLL) { SDL_UnloadObject(DSoundDLL); DSoundDLL = NULL; } } - -static int -DSOUND_Load(void) +static int DSOUND_Load(void) { int loaded = 0; DSOUND_Unload(); DSoundDLL = SDL_LoadObject("DSOUND.DLL"); - if (DSoundDLL == NULL) { + if (!DSoundDLL) { SDL_SetError("DirectSound: failed to load DSOUND.DLL"); } else { - /* Now make sure we have DirectX 8 or better... */ - #define DSOUNDLOAD(f) { \ - p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \ - if (!p##f) loaded = 0; \ - } - loaded = 1; /* will reset if necessary. */ +/* Now make sure we have DirectX 8 or better... */ +#define DSOUNDLOAD(f) \ + { \ + p##f = (fn##f)SDL_LoadFunction(DSoundDLL, #f); \ + if (!p##f) \ + loaded = 0; \ + } + loaded = 1; /* will reset if necessary. */ DSOUNDLOAD(DirectSoundCreate8); DSOUNDLOAD(DirectSoundEnumerateW); DSOUNDLOAD(DirectSoundCaptureCreate8); DSOUNDLOAD(DirectSoundCaptureEnumerateW); - #undef DSOUNDLOAD +#undef DSOUNDLOAD if (!loaded) { SDL_SetError("DirectSound: System doesn't appear to have DX8."); @@ -107,8 +106,7 @@ DSOUND_Load(void) return loaded; } -static int -SetDSerror(const char *function, int code) +static int SetDSerror(const char *function, int code) { const char *error; @@ -154,16 +152,14 @@ SetDSerror(const char *function, int code) return SDL_SetError("%s: %s (0x%x)", function, error, code); } -static void -DSOUND_FreeDeviceHandle(void *handle) +static void DSOUND_FreeDeviceHandle(void *handle) { SDL_free(handle); } -static int -DSOUND_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +static int DSOUND_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H if (SupportsIMMDevice) { return SDL_IMMDevice_GetDefaultAudioInfo(name, spec, iscapture); } @@ -171,45 +167,41 @@ DSOUND_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) return SDL_Unsupported(); } -static BOOL CALLBACK -FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data) +static BOOL CALLBACK FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data) { - const int iscapture = (int) ((size_t) data); - if (guid != NULL) { /* skip default device */ + const int iscapture = (int)((size_t)data); + if (guid != NULL) { /* skip default device */ char *str = WIN_LookupAudioDeviceName(desc, guid); - if (str != NULL) { - LPGUID cpyguid = (LPGUID) SDL_malloc(sizeof (GUID)); - SDL_memcpy(cpyguid, guid, sizeof (GUID)); + if (str) { + LPGUID cpyguid = (LPGUID)SDL_malloc(sizeof(GUID)); + SDL_memcpy(cpyguid, guid, sizeof(GUID)); /* Note that spec is NULL, because we are required to connect to the * device before getting the channel mask and output format, making * this information inaccessible at enumeration time */ SDL_AddAudioDevice(iscapture, str, NULL, cpyguid); - SDL_free(str); /* addfn() makes a copy of this string. */ + SDL_free(str); /* addfn() makes a copy of this string. */ } } - return TRUE; /* keep enumerating. */ + return TRUE; /* keep enumerating. */ } -static void -DSOUND_DetectDevices(void) +static void DSOUND_DetectDevices(void) { -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H if (SupportsIMMDevice) { SDL_IMMDevice_EnumerateEndpoints(SDL_TRUE); } else { #endif /* HAVE_MMDEVICEAPI_H */ pDirectSoundCaptureEnumerateW(FindAllDevs, (void *)((size_t)1)); pDirectSoundEnumerateW(FindAllDevs, (void *)((size_t)0)); -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H } #endif /* HAVE_MMDEVICEAPI_H*/ } - -static void -DSOUND_WaitDevice(_THIS) +static void DSOUND_WaitDevice(_THIS) { DWORD status = 0; DWORD cursor = 0; @@ -237,10 +229,10 @@ DSOUND_WaitDevice(_THIS) /* Try to restore a lost sound buffer */ IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status); - if ((status & DSBSTATUS_BUFFERLOST)) { + if (status & DSBSTATUS_BUFFERLOST) { IDirectSoundBuffer_Restore(this->hidden->mixbuf); IDirectSoundBuffer_GetStatus(this->hidden->mixbuf, &status); - if ((status & DSBSTATUS_BUFFERLOST)) { + if (status & DSBSTATUS_BUFFERLOST) { break; } } @@ -266,8 +258,7 @@ DSOUND_WaitDevice(_THIS) } } -static void -DSOUND_PlayDevice(_THIS) +static void DSOUND_PlayDevice(_THIS) { /* Unlock the buffer, allowing it to play */ if (this->hidden->locked_buf) { @@ -277,8 +268,7 @@ DSOUND_PlayDevice(_THIS) } } -static Uint8 * -DSOUND_GetDeviceBuf(_THIS) +static Uint8 *DSOUND_GetDeviceBuf(_THIS) { DWORD cursor = 0; DWORD junk = 0; @@ -296,7 +286,7 @@ DSOUND_GetDeviceBuf(_THIS) } if (result != DS_OK) { SetDSerror("DirectSound GetCurrentPosition", result); - return (NULL); + return NULL; } cursor /= this->spec.size; #ifdef DEBUG_SOUND @@ -319,25 +309,23 @@ DSOUND_GetDeviceBuf(_THIS) /* Lock the audio buffer */ result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor, this->spec.size, - (LPVOID *) & this->hidden->locked_buf, + (LPVOID *)&this->hidden->locked_buf, &rawlen, NULL, &junk, 0); if (result == DSERR_BUFFERLOST) { IDirectSoundBuffer_Restore(this->hidden->mixbuf); result = IDirectSoundBuffer_Lock(this->hidden->mixbuf, cursor, this->spec.size, - (LPVOID *) & this-> - hidden->locked_buf, &rawlen, NULL, + (LPVOID *)&this->hidden->locked_buf, &rawlen, NULL, &junk, 0); } if (result != DS_OK) { SetDSerror("DirectSound Lock", result); - return (NULL); + return NULL; } - return (this->hidden->locked_buf); + return this->hidden->locked_buf; } -static int -DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *h = this->hidden; DWORD junk, cursor, ptr1len, ptr2len; @@ -346,7 +334,7 @@ DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) SDL_assert(buflen == this->spec.size); while (SDL_TRUE) { - if (SDL_AtomicGet(&this->shutdown)) { /* in case the buffer froze... */ + if (SDL_AtomicGet(&this->shutdown)) { /* in case the buffer froze... */ SDL_memset(buffer, this->spec.silence, buflen); return buflen; } @@ -355,7 +343,7 @@ DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) return -1; } if ((cursor / this->spec.size) == h->lastchunk) { - SDL_Delay(1); /* FIXME: find out how much time is left and sleep that long */ + SDL_Delay(1); /* FIXME: find out how much time is left and sleep that long */ } else { break; } @@ -380,8 +368,7 @@ DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) return ptr1len; } -static void -DSOUND_FlushCapture(_THIS) +static void DSOUND_FlushCapture(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; DWORD junk, cursor; @@ -390,21 +377,20 @@ DSOUND_FlushCapture(_THIS) } } -static void -DSOUND_CloseDevice(_THIS) +static void DSOUND_CloseDevice(_THIS) { - if (this->hidden->mixbuf != NULL) { + if (this->hidden->mixbuf) { IDirectSoundBuffer_Stop(this->hidden->mixbuf); IDirectSoundBuffer_Release(this->hidden->mixbuf); } - if (this->hidden->sound != NULL) { + if (this->hidden->sound) { IDirectSound_Release(this->hidden->sound); } - if (this->hidden->capturebuf != NULL) { + if (this->hidden->capturebuf) { IDirectSoundCaptureBuffer_Stop(this->hidden->capturebuf); IDirectSoundCaptureBuffer_Release(this->hidden->capturebuf); } - if (this->hidden->capture != NULL) { + if (this->hidden->capture) { IDirectSoundCapture_Release(this->hidden->capture); } SDL_free(this->hidden); @@ -414,8 +400,7 @@ DSOUND_CloseDevice(_THIS) number of audio chunks available in the created buffer. This is for playback devices, not capture. */ -static int -CreateSecondary(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) +static int CreateSecondary(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) { LPDIRECTSOUND sndObj = this->hidden->sound; LPDIRECTSOUNDBUFFER *sndbuf = &this->hidden->mixbuf; @@ -439,14 +424,14 @@ CreateSecondary(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) /* Silence the initial audio buffer */ result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes, - (LPVOID *) & pvAudioPtr1, &dwAudioBytes1, - (LPVOID *) & pvAudioPtr2, &dwAudioBytes2, + (LPVOID *)&pvAudioPtr1, &dwAudioBytes1, + (LPVOID *)&pvAudioPtr2, &dwAudioBytes2, DSBLOCK_ENTIREBUFFER); if (result == DS_OK) { SDL_memset(pvAudioPtr1, this->spec.silence, dwAudioBytes1); IDirectSoundBuffer_Unlock(*sndbuf, - (LPVOID) pvAudioPtr1, dwAudioBytes1, - (LPVOID) pvAudioPtr2, dwAudioBytes2); + (LPVOID)pvAudioPtr1, dwAudioBytes1, + (LPVOID)pvAudioPtr2, dwAudioBytes2); } /* We're ready to go */ @@ -457,8 +442,7 @@ CreateSecondary(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) number of audio chunks available in the created buffer. This is for capture devices, not playback. */ -static int -CreateCaptureBuffer(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) +static int CreateCaptureBuffer(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) { LPDIRECTSOUNDCAPTURE capture = this->hidden->capture; LPDIRECTSOUNDCAPTUREBUFFER *capturebuf = &this->hidden->capturebuf; @@ -466,7 +450,7 @@ CreateCaptureBuffer(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) HRESULT result; SDL_zero(format); - format.dwSize = sizeof (format); + format.dwSize = sizeof(format); format.dwFlags = DSCBCAPS_WAVEMAPPED; format.dwBufferBytes = bufsize; format.lpwfxFormat = wfmt; @@ -497,21 +481,19 @@ CreateCaptureBuffer(_THIS, const DWORD bufsize, WAVEFORMATEX *wfmt) return 0; } -static int -DSOUND_OpenDevice(_THIS, const char *devname) +static int DSOUND_OpenDevice(_THIS, const char *devname) { const DWORD numchunks = 8; HRESULT result; SDL_bool tried_format = SDL_FALSE; SDL_bool iscapture = this->iscapture; SDL_AudioFormat test_format; - LPGUID guid = (LPGUID) this->handle; + LPGUID guid = (LPGUID)this->handle; DWORD bufsize; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -551,8 +533,8 @@ DSOUND_OpenDevice(_THIS, const char *devname) bufsize = numchunks * this->spec.size; if ((bufsize < DSBSIZE_MIN) || (bufsize > DSBSIZE_MAX)) { SDL_SetError("Sound buffer size must be between %d and %d", - (int) ((DSBSIZE_MIN < numchunks) ? 1 : DSBSIZE_MIN / numchunks), - (int) (DSBSIZE_MAX / numchunks)); + (int)((DSBSIZE_MIN < numchunks) ? 1 : DSBSIZE_MIN / numchunks), + (int)(DSBSIZE_MAX / numchunks)); } else { int rc; WAVEFORMATEXTENSIBLE wfmt; @@ -568,8 +550,7 @@ DSOUND_OpenDevice(_THIS, const char *devname) } wfmt.Samples.wValidBitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); - switch (this->spec.channels) - { + switch (this->spec.channels) { case 3: /* 3.0 (or 2.1) */ wfmt.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER; break; @@ -604,7 +585,7 @@ DSOUND_OpenDevice(_THIS, const char *devname) wfmt.Format.nBlockAlign = wfmt.Format.nChannels * (wfmt.Format.wBitsPerSample / 8); wfmt.Format.nAvgBytesPerSec = wfmt.Format.nSamplesPerSec * wfmt.Format.nBlockAlign; - rc = iscapture ? CreateCaptureBuffer(this, bufsize, (WAVEFORMATEX*) &wfmt) : CreateSecondary(this, bufsize, (WAVEFORMATEX*) &wfmt); + rc = iscapture ? CreateCaptureBuffer(this, bufsize, (WAVEFORMATEX *)&wfmt) : CreateSecondary(this, bufsize, (WAVEFORMATEX *)&wfmt); if (rc == 0) { this->hidden->num_buffers = numchunks; break; @@ -619,21 +600,19 @@ DSOUND_OpenDevice(_THIS, const char *devname) if (!test_format) { if (tried_format) { - return -1; /* CreateSecondary() should have called SDL_SetError(). */ + return -1; /* CreateSecondary() should have called SDL_SetError(). */ } return SDL_SetError("%s: Unsupported audio format", "directsound"); } /* Playback buffers will auto-start playing in DSOUND_WaitDevice() */ - return 0; /* good to go. */ + return 0; /* good to go. */ } - -static void -DSOUND_Deinitialize(void) +static void DSOUND_Deinitialize(void) { -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H if (SupportsIMMDevice) { SDL_IMMDevice_Quit(); SupportsIMMDevice = SDL_FALSE; @@ -642,15 +621,13 @@ DSOUND_Deinitialize(void) DSOUND_Unload(); } - -static SDL_bool -DSOUND_Init(SDL_AudioDriverImpl * impl) +static SDL_bool DSOUND_Init(SDL_AudioDriverImpl *impl) { if (!DSOUND_Load()) { return SDL_FALSE; } -#if HAVE_MMDEVICEAPI_H +#ifdef HAVE_MMDEVICEAPI_H SupportsIMMDevice = !(SDL_IMMDevice_Init() < 0); #endif /* HAVE_MMDEVICEAPI_H */ @@ -670,7 +647,7 @@ DSOUND_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap DSOUND_bootstrap = { diff --git a/src/audio/directsound/SDL_directsound.h b/src/audio/directsound/SDL_directsound.h index 365de770c25ae..6de044a2d2706 100644 --- a/src/audio/directsound/SDL_directsound.h +++ b/src/audio/directsound/SDL_directsound.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this /* The DirectSound objects */ struct SDL_PrivateAudioData diff --git a/src/audio/disk/SDL_diskaudio.c b/src/audio/disk/SDL_diskaudio.c index 0a7a395e402ab..49a39f7d340a6 100644 --- a/src/audio/disk/SDL_diskaudio.c +++ b/src/audio/disk/SDL_diskaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,11 +20,11 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_DISK +#ifdef SDL_AUDIO_DRIVER_DISK /* Output raw audio data to a file. */ -#if HAVE_STDIO_H +#ifdef HAVE_STDIO_H #include #endif @@ -36,21 +36,19 @@ /* !!! FIXME: these should be SDL hints, not environment variables. */ /* environment variables and defaults. */ -#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE" -#define DISKDEFAULT_OUTFILE "sdlaudio.raw" -#define DISKENVR_INFILE "SDL_DISKAUDIOFILEIN" -#define DISKDEFAULT_INFILE "sdlaudio-in.raw" -#define DISKENVR_IODELAY "SDL_DISKAUDIODELAY" +#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE" +#define DISKDEFAULT_OUTFILE "sdlaudio.raw" +#define DISKENVR_INFILE "SDL_DISKAUDIOFILEIN" +#define DISKDEFAULT_INFILE "sdlaudio-in.raw" +#define DISKENVR_IODELAY "SDL_DISKAUDIODELAY" /* This function waits until it is possible to write a full sound buffer */ -static void -DISKAUDIO_WaitDevice(_THIS) +static void DISKAUDIO_WaitDevice(_THIS) { SDL_Delay(_this->hidden->io_delay); } -static void -DISKAUDIO_PlayDevice(_THIS) +static void DISKAUDIO_PlayDevice(_THIS) { const size_t written = SDL_RWwrite(_this->hidden->io, _this->hidden->mixbuf, @@ -65,14 +63,12 @@ DISKAUDIO_PlayDevice(_THIS) #endif } -static Uint8 * -DISKAUDIO_GetDeviceBuf(_THIS) +static Uint8 *DISKAUDIO_GetDeviceBuf(_THIS) { - return (_this->hidden->mixbuf); + return _this->hidden->mixbuf; } -static int -DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *h = _this->hidden; const int origbuflen = buflen; @@ -81,9 +77,9 @@ DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) if (h->io) { const size_t br = SDL_RWread(h->io, buffer, 1, buflen); - buflen -= (int) br; - buffer = ((Uint8 *) buffer) + br; - if (buflen > 0) { /* EOF (or error, but whatever). */ + buflen -= (int)br; + buffer = ((Uint8 *)buffer) + br; + if (buflen > 0) { /* EOF (or error, but whatever). */ SDL_RWclose(h->io); h->io = NULL; } @@ -95,38 +91,32 @@ DISKAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) return origbuflen; } -static void -DISKAUDIO_FlushCapture(_THIS) +static void DISKAUDIO_FlushCapture(_THIS) { /* no op...we don't advance the file pointer or anything. */ } - -static void -DISKAUDIO_CloseDevice(_THIS) +static void DISKAUDIO_CloseDevice(_THIS) { - if (_this->hidden->io != NULL) { + if (_this->hidden->io) { SDL_RWclose(_this->hidden->io); } SDL_free(_this->hidden->mixbuf); SDL_free(_this->hidden); } - -static const char * -get_filename(const SDL_bool iscapture, const char *devname) +static const char *get_filename(const SDL_bool iscapture, const char *devname) { - if (devname == NULL) { + if (!devname) { devname = SDL_getenv(iscapture ? DISKENVR_INFILE : DISKENVR_OUTFILE); - if (devname == NULL) { + if (!devname) { devname = iscapture ? DISKDEFAULT_INFILE : DISKDEFAULT_OUTFILE; } } return devname; } -static int -DISKAUDIO_OpenDevice(_THIS, const char *devname) +static int DISKAUDIO_OpenDevice(_THIS, const char *devname) { void *handle = _this->handle; /* handle != NULL means "user specified the placeholder name on the fake detected device list" */ @@ -136,12 +126,12 @@ DISKAUDIO_OpenDevice(_THIS, const char *devname) _this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*_this->hidden)); - if (_this->hidden == NULL) { + if (!_this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(_this->hidden); - if (envr != NULL) { + if (envr) { _this->hidden->io_delay = SDL_atoi(envr); } else { _this->hidden->io_delay = ((_this->spec.samples * 1000) / _this->spec.freq); @@ -149,38 +139,36 @@ DISKAUDIO_OpenDevice(_THIS, const char *devname) /* Open the audio device */ _this->hidden->io = SDL_RWFromFile(fname, iscapture ? "rb" : "wb"); - if (_this->hidden->io == NULL) { + if (!_this->hidden->io) { return -1; } /* Allocate mixing buffer */ if (!iscapture) { - _this->hidden->mixbuf = (Uint8 *) SDL_malloc(_this->spec.size); - if (_this->hidden->mixbuf == NULL) { + _this->hidden->mixbuf = (Uint8 *)SDL_malloc(_this->spec.size); + if (!_this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(_this->hidden->mixbuf, _this->spec.silence, _this->spec.size); } SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, - "You are using the SDL disk i/o audio driver!\n"); + "You are using the SDL disk i/o audio driver!\n"); SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, - " %s file [%s].\n", iscapture ? "Reading from" : "Writing to", - fname); + " %s file [%s].\n", iscapture ? "Reading from" : "Writing to", + fname); /* We're ready to rock and roll. :-) */ return 0; } -static void -DISKAUDIO_DetectDevices(void) +static void DISKAUDIO_DetectDevices(void) { - SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *) 0x1); - SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) 0x2); + SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *)0x1); + SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *)0x2); } -static SDL_bool -DISKAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool DISKAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = DISKAUDIO_OpenDevice; @@ -197,7 +185,7 @@ DISKAUDIO_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap DISKAUDIO_bootstrap = { diff --git a/src/audio/disk/SDL_diskaudio.h b/src/audio/disk/SDL_diskaudio.h index e7739250ab5fe..a7e7e01d92fb4 100644 --- a/src/audio/disk/SDL_diskaudio.h +++ b/src/audio/disk/SDL_diskaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this struct SDL_PrivateAudioData { diff --git a/src/audio/dsp/SDL_dspaudio.c b/src/audio/dsp/SDL_dspaudio.c index 8734f79606054..ffba531aa6499 100644 --- a/src/audio/dsp/SDL_dspaudio.c +++ b/src/audio/dsp/SDL_dspaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,12 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_OSS +#ifdef SDL_AUDIO_DRIVER_OSS /* Allow access to a raw mixing buffer */ -#include /* For perror() */ -#include /* For strerror() */ +#include /* For perror() */ +#include /* For strerror() */ #include #include #include @@ -42,16 +42,12 @@ #include "../SDL_audiodev_c.h" #include "SDL_dspaudio.h" - -static void -DSP_DetectDevices(void) +static void DSP_DetectDevices(void) { SDL_EnumUnixAudioDevices(0, NULL); } - -static void -DSP_CloseDevice(_THIS) +static void DSP_CloseDevice(_THIS) { if (this->hidden->audio_fd >= 0) { close(this->hidden->audio_fd); @@ -60,9 +56,7 @@ DSP_CloseDevice(_THIS) SDL_free(this->hidden); } - -static int -DSP_OpenDevice(_THIS, const char *devname) +static int DSP_OpenDevice(_THIS, const char *devname) { SDL_bool iscapture = this->iscapture; const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT); @@ -73,26 +67,26 @@ DSP_OpenDevice(_THIS, const char *devname) /* We don't care what the devname is...we'll try to open anything. */ /* ...but default to first name in the list... */ - if (devname == NULL) { + if (!devname) { devname = SDL_GetAudioDeviceName(0, iscapture); - if (devname == NULL) { + if (!devname) { return SDL_SetError("No such audio device"); } } /* Make sure fragment size stays a power of 2, or OSS fails. */ /* I don't know which of these are actually legal values, though... */ - if (this->spec.channels > 8) + if (this->spec.channels > 8) { this->spec.channels = 8; - else if (this->spec.channels > 4) + } else if (this->spec.channels > 4) { this->spec.channels = 4; - else if (this->spec.channels > 2) + } else if (this->spec.channels > 2) { this->spec.channels = 2; + } /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -204,11 +198,12 @@ DSP_OpenDevice(_THIS, const char *devname) SDL_CalculateAudioSpec(&this->spec); /* Determine the power of two of the fragment size */ - for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec); + for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec) { + } if ((0x01U << frag_spec) != this->spec.size) { return SDL_SetError("Fragment size must be a power of two"); } - frag_spec |= 0x00020000; /* two fragments, for low latency */ + frag_spec |= 0x00020000; /* two fragments, for low latency */ /* Set the audio buffering parameters */ #ifdef DEBUG_AUDIO @@ -232,8 +227,8 @@ DSP_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ if (!iscapture) { this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + this->hidden->mixbuf = (Uint8 *)SDL_malloc(this->hidden->mixlen); + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -243,9 +238,7 @@ DSP_OpenDevice(_THIS, const char *devname) return 0; } - -static void -DSP_PlayDevice(_THIS) +static void DSP_PlayDevice(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; if (write(h->audio_fd, h->mixbuf, h->mixlen) == -1) { @@ -257,27 +250,24 @@ DSP_PlayDevice(_THIS) #endif } -static Uint8 * -DSP_GetDeviceBuf(_THIS) +static Uint8 *DSP_GetDeviceBuf(_THIS) { - return (this->hidden->mixbuf); + return this->hidden->mixbuf; } -static int -DSP_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int DSP_CaptureFromDevice(_THIS, void *buffer, int buflen) { - return (int) read(this->hidden->audio_fd, buffer, buflen); + return (int)read(this->hidden->audio_fd, buffer, buflen); } -static void -DSP_FlushCapture(_THIS) +static void DSP_FlushCapture(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; audio_buf_info info; if (ioctl(h->audio_fd, SNDCTL_DSP_GETISPACE, &info) == 0) { while (info.bytes > 0) { char buf[512]; - const size_t len = SDL_min(sizeof (buf), info.bytes); + const size_t len = SDL_min(sizeof(buf), info.bytes); const ssize_t br = read(h->audio_fd, buf, len); if (br <= 0) { break; @@ -288,22 +278,20 @@ DSP_FlushCapture(_THIS) } static SDL_bool InitTimeDevicesExist = SDL_FALSE; -static int -look_for_devices_test(int fd) +static int look_for_devices_test(int fd) { - InitTimeDevicesExist = SDL_TRUE; /* note that _something_ exists. */ + InitTimeDevicesExist = SDL_TRUE; /* note that _something_ exists. */ /* Don't add to the device list, we're just seeing if any devices exist. */ return 0; } -static SDL_bool -DSP_Init(SDL_AudioDriverImpl * impl) +static SDL_bool DSP_Init(SDL_AudioDriverImpl *impl) { InitTimeDevicesExist = SDL_FALSE; SDL_EnumUnixAudioDevices(0, look_for_devices_test); if (!InitTimeDevicesExist) { SDL_SetError("dsp: No such audio device"); - return SDL_FALSE; /* maybe try a different backend. */ + return SDL_FALSE; /* maybe try a different backend. */ } /* Set the function pointers */ @@ -318,10 +306,9 @@ DSP_Init(SDL_AudioDriverImpl * impl) impl->AllowsArbitraryDeviceNames = SDL_TRUE; impl->HasCaptureSupport = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } - AudioBootStrap DSP_bootstrap = { "dsp", "OSS /dev/dsp standard audio", DSP_Init, SDL_FALSE }; diff --git a/src/audio/dsp/SDL_dspaudio.h b/src/audio/dsp/SDL_dspaudio.h index b9ce50e2f8149..c710a7ec9b1a7 100644 --- a/src/audio/dsp/SDL_dspaudio.h +++ b/src/audio/dsp/SDL_dspaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -37,7 +37,7 @@ struct SDL_PrivateAudioData Uint8 *mixbuf; int mixlen; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* SDL_dspaudio_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dummy/SDL_dummyaudio.c b/src/audio/dummy/SDL_dummyaudio.c index dab1edb598cad..a9bdd84a5a0eb 100644 --- a/src/audio/dummy/SDL_dummyaudio.c +++ b/src/audio/dummy/SDL_dummyaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#ifdef SDL_AUDIO_DRIVER_DUMMY + /* Output audio to nowhere... */ #include "SDL_timer.h" @@ -27,15 +29,14 @@ #include "../SDL_audio_c.h" #include "SDL_dummyaudio.h" -static int -DUMMYAUDIO_OpenDevice(_THIS, const char *devname) +static int DUMMYAUDIO_OpenDevice(_THIS, const char *devname) { - _this->hidden = (void *) 0x1; /* just something non-NULL */ - return 0; /* always succeeds. */ + _this->hidden = (void *)0x1; /* just something non-NULL */ + + return 0; /* always succeeds. */ } -static int -DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { /* Delay to make this sort of simulate real audio input. */ SDL_Delay((_this->spec.samples * 1000) / _this->spec.freq); @@ -45,8 +46,7 @@ DUMMYAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) return buflen; } -static SDL_bool -DUMMYAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool DUMMYAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = DUMMYAUDIO_OpenDevice; @@ -56,11 +56,13 @@ DUMMYAUDIO_Init(SDL_AudioDriverImpl * impl) impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; impl->HasCaptureSupport = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap DUMMYAUDIO_bootstrap = { "dummy", "SDL dummy audio driver", DUMMYAUDIO_Init, SDL_TRUE }; +#endif + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/dummy/SDL_dummyaudio.h b/src/audio/dummy/SDL_dummyaudio.h index 6ac650d4dd503..e0e77e523ca69 100644 --- a/src/audio/dummy/SDL_dummyaudio.h +++ b/src/audio/dummy/SDL_dummyaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this struct SDL_PrivateAudioData { diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c index bfe42821a48df..304cabd0bf623 100644 --- a/src/audio/emscripten/SDL_emscriptenaudio.c +++ b/src/audio/emscripten/SDL_emscriptenaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_EMSCRIPTEN +#ifdef SDL_AUDIO_DRIVER_EMSCRIPTEN #include "SDL_audio.h" #include "../SDL_audio_c.h" @@ -33,12 +33,18 @@ !!! FIXME: true always once pthread support becomes widespread. Revisit this code !!! FIXME: at some point and see what needs to be done for that! */ -static void -FeedAudioDevice(_THIS, const void *buf, const int buflen) +static void FeedAudioDevice(_THIS, const void *buf, const int buflen) { const int framelen = (SDL_AUDIO_BITSIZE(this->spec.format) / 8) * this->spec.channels; + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM({ var SDL2 = Module['SDL2']; + /* Convert incoming buf pointer to a HEAPF32 offset. */ +#ifdef __wasm64__ + var buf = $0 / 4; +#else + var buf = $0 >>> 2; +#endif var numChannels = SDL2.audio.currentOutputBuffer['numberOfChannels']; for (var c = 0; c < numChannels; ++c) { var channelData = SDL2.audio.currentOutputBuffer['getChannelData'](c); @@ -47,14 +53,14 @@ FeedAudioDevice(_THIS, const void *buf, const int buflen) } for (var j = 0; j < $1; ++j) { - channelData[j] = HEAPF32[$0 + ((j*numChannels + c) << 2) >> 2]; /* !!! FIXME: why are these shifts here? */ + channelData[j] = HEAPF32[buf + (j*numChannels + c)]; } } }, buf, buflen / framelen); +/* *INDENT-ON* */ /* clang-format on */ } -static void -HandleAudioProcess(_THIS) +static void HandleAudioProcess(_THIS) { SDL_AudioCallback callback = this->callbackspec.callback; const int stream_len = this->callbackspec.size; @@ -70,12 +76,12 @@ HandleAudioProcess(_THIS) return; } - if (this->stream == NULL) { /* no conversion necessary. */ + if (!this->stream) { /* no conversion necessary. */ SDL_assert(this->spec.size == stream_len); callback(this->callbackspec.userdata, this->work_buffer, stream_len); - } else { /* streaming/converting */ + } else { /* streaming/converting */ int got; - while (SDL_AudioStreamAvailable(this->stream) < ((int) this->spec.size)) { + while (SDL_AudioStreamAvailable(this->stream) < ((int)this->spec.size)) { callback(this->callbackspec.userdata, this->work_buffer, stream_len); if (SDL_AudioStreamPut(this->stream, this->work_buffer, stream_len) == -1) { SDL_AudioStreamClear(this->stream); @@ -94,8 +100,7 @@ HandleAudioProcess(_THIS) FeedAudioDevice(this, this->work_buffer, this->spec.size); } -static void -HandleCaptureProcess(_THIS) +static void HandleCaptureProcess(_THIS) { SDL_AudioCallback callback = this->callbackspec.callback; const int stream_len = this->callbackspec.size; @@ -106,6 +111,7 @@ HandleCaptureProcess(_THIS) return; } + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM({ var SDL2 = Module['SDL2']; var numChannels = SDL2.capture.currentCaptureBuffer.numberOfChannels; @@ -125,14 +131,15 @@ HandleCaptureProcess(_THIS) } } } - }, this->work_buffer, (this->spec.size / sizeof (float)) / this->spec.channels); + }, this->work_buffer, (this->spec.size / sizeof(float)) / this->spec.channels); +/* *INDENT-ON* */ /* clang-format on */ /* okay, we've got an interleaved float32 array in C now. */ - if (this->stream == NULL) { /* no conversion necessary. */ + if (!this->stream) { /* no conversion necessary. */ SDL_assert(this->spec.size == stream_len); callback(this->callbackspec.userdata, this->work_buffer, stream_len); - } else { /* streaming/converting */ + } else { /* streaming/converting */ if (SDL_AudioStreamPut(this->stream, this->work_buffer, this->spec.size) == -1) { SDL_AtomicSet(&this->enabled, 0); } @@ -143,45 +150,40 @@ HandleCaptureProcess(_THIS) if (got != stream_len) { SDL_memset(this->work_buffer, this->callbackspec.silence, stream_len); } - callback(this->callbackspec.userdata, this->work_buffer, stream_len); /* Send it to the app. */ + callback(this->callbackspec.userdata, this->work_buffer, stream_len); /* Send it to the app. */ } } } - -static void -EMSCRIPTENAUDIO_CloseDevice(_THIS) +static void EMSCRIPTENAUDIO_CloseDevice(_THIS) { + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM({ var SDL2 = Module['SDL2']; if ($0) { if (SDL2.capture.silenceTimer !== undefined) { - clearTimeout(SDL2.capture.silenceTimer); + clearInterval(SDL2.capture.silenceTimer); } if (SDL2.capture.stream !== undefined) { var tracks = SDL2.capture.stream.getAudioTracks(); for (var i = 0; i < tracks.length; i++) { SDL2.capture.stream.removeTrack(tracks[i]); } - SDL2.capture.stream = undefined; } if (SDL2.capture.scriptProcessorNode !== undefined) { SDL2.capture.scriptProcessorNode.onaudioprocess = function(audioProcessingEvent) {}; SDL2.capture.scriptProcessorNode.disconnect(); - SDL2.capture.scriptProcessorNode = undefined; } if (SDL2.capture.mediaStreamNode !== undefined) { SDL2.capture.mediaStreamNode.disconnect(); - SDL2.capture.mediaStreamNode = undefined; - } - if (SDL2.capture.silenceBuffer !== undefined) { - SDL2.capture.silenceBuffer = undefined } SDL2.capture = undefined; } else { if (SDL2.audio.scriptProcessorNode != undefined) { SDL2.audio.scriptProcessorNode.disconnect(); - SDL2.audio.scriptProcessorNode = undefined; + } + if (SDL2.audio.silenceTimer !== undefined) { + clearInterval(SDL2.audio.silenceTimer); } SDL2.audio = undefined; } @@ -190,14 +192,16 @@ EMSCRIPTENAUDIO_CloseDevice(_THIS) SDL2.audioContext = undefined; } }, this->iscapture); +/* *INDENT-ON* */ /* clang-format on */ #if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL2 namespace? --ryan. */ SDL_free(this->hidden); #endif } -static int -EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) +EM_JS_DEPS(sdlaudio, "$autoResumeAudioContext,$dynCall"); + +static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) { SDL_AudioFormat test_format; SDL_bool iscapture = this->iscapture; @@ -205,6 +209,7 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) /* based on parts of library_sdl.js */ + /* *INDENT-OFF* */ /* clang-format off */ /* create context */ result = MAIN_THREAD_EM_ASM_INT({ if(typeof(Module['SDL2']) === 'undefined') { @@ -224,11 +229,15 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) SDL2.audioContext = new webkitAudioContext(); } if (SDL2.audioContext) { - autoResumeAudioContext(SDL2.audioContext); + if ((typeof navigator.userActivation) === 'undefined') { + autoResumeAudioContext(SDL2.audioContext); + } } } return SDL2.audioContext === undefined ? -1 : 0; }, iscapture); +/* *INDENT-ON* */ /* clang-format on */ + if (result < 0) { return SDL_SetError("Web Audio API is not available!"); } @@ -252,7 +261,7 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) /* Initialize all variables that we clean on shutdown */ #if 0 /* !!! FIXME: currently not used. Can we move some stuff off the SDL2 namespace? --ryan. */ this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); + SDL_malloc(sizeof(*this->hidden)); if (this->hidden == NULL) { return SDL_OutOfMemory(); } @@ -261,13 +270,14 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) this->hidden = (struct SDL_PrivateAudioData *)0x1; /* limit to native freq */ - this->spec.freq = EM_ASM_INT_V({ + this->spec.freq = EM_ASM_INT({ var SDL2 = Module['SDL2']; return SDL2.audioContext.sampleRate; }); SDL_CalculateAudioSpec(&this->spec); + /* *INDENT-OFF* */ /* clang-format off */ if (iscapture) { /* The idea is to take the capture media stream, hook it up to an audio graph where we can pass it through a ScriptProcessorNode @@ -290,8 +300,9 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) var have_microphone = function(stream) { //console.log('SDL audio capture: we have a microphone! Replacing silence callback.'); if (SDL2.capture.silenceTimer !== undefined) { - clearTimeout(SDL2.capture.silenceTimer); + clearInterval(SDL2.capture.silenceTimer); SDL2.capture.silenceTimer = undefined; + SDL2.capture.silenceBuffer = undefined } SDL2.capture.mediaStreamNode = SDL2.audioContext.createMediaStreamSource(stream); SDL2.capture.scriptProcessorNode = SDL2.audioContext.createScriptProcessor($1, $0, 1); @@ -299,7 +310,7 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) if ((SDL2 === undefined) || (SDL2.capture === undefined)) { return; } audioProcessingEvent.outputBuffer.getChannelData(0).fill(0.0); SDL2.capture.currentCaptureBuffer = audioProcessingEvent.inputBuffer; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; SDL2.capture.mediaStreamNode.connect(SDL2.capture.scriptProcessorNode); SDL2.capture.scriptProcessorNode.connect(SDL2.audioContext.destination); @@ -315,10 +326,10 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) SDL2.capture.silenceBuffer.getChannelData(0).fill(0.0); var silence_callback = function() { SDL2.capture.currentCaptureBuffer = SDL2.capture.silenceBuffer; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; - SDL2.capture.silenceTimer = setTimeout(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); + SDL2.capture.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); if ((navigator.mediaDevices !== undefined) && (navigator.mediaDevices.getUserMedia !== undefined)) { navigator.mediaDevices.getUserMedia({ audio: true, video: false }).then(have_microphone).catch(no_microphone); @@ -333,23 +344,49 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname) SDL2.audio.scriptProcessorNode = SDL2.audioContext['createScriptProcessor']($1, 0, $0); SDL2.audio.scriptProcessorNode['onaudioprocess'] = function (e) { if ((SDL2 === undefined) || (SDL2.audio === undefined)) { return; } + // if we're actually running the node, we don't need the fake callback anymore, so kill it. + if (SDL2.audio.silenceTimer !== undefined) { + clearInterval(SDL2.audio.silenceTimer); + SDL2.audio.silenceTimer = undefined; + SDL2.audio.silenceBuffer = undefined; + } SDL2.audio.currentOutputBuffer = e['outputBuffer']; - dynCall('vi', $2, [$3]); + dynCall('vp', $2, [$3]); }; + SDL2.audio.scriptProcessorNode['connect'](SDL2.audioContext['destination']); + + if (SDL2.audioContext.state === 'suspended') { // uhoh, autoplay is blocked. + SDL2.audio.silenceBuffer = SDL2.audioContext.createBuffer($0, $1, SDL2.audioContext.sampleRate); + SDL2.audio.silenceBuffer.getChannelData(0).fill(0.0); + var silence_callback = function() { + if ((typeof navigator.userActivation) !== 'undefined') { + if (navigator.userActivation.hasBeenActive) { + SDL2.audioContext.resume(); + } + } + + // the buffer that gets filled here just gets ignored, so the app can make progress + // and/or avoid flooding audio queues until we can actually play audio. + SDL2.audio.currentOutputBuffer = SDL2.audio.silenceBuffer; + dynCall('vp', $2, [$3]); + SDL2.audio.currentOutputBuffer = undefined; + }; + + SDL2.audio.silenceTimer = setInterval(silence_callback, ($1 / SDL2.audioContext.sampleRate) * 1000); + } }, this->spec.channels, this->spec.samples, HandleAudioProcess, this); } +/* *INDENT-ON* */ /* clang-format on */ return 0; } -static void -EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock(SDL_AudioDevice * device) +static void EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock(SDL_AudioDevice *device) { } -static SDL_bool -EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl *impl) { SDL_bool available, capture_available; @@ -363,6 +400,7 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) impl->LockDevice = impl->UnlockDevice = EMSCRIPTENAUDIO_LockOrUnlockDeviceWithNoMixerLock; impl->ProvidesOwnCallbackThread = SDL_TRUE; + /* *INDENT-OFF* */ /* clang-format off */ /* check availability */ available = MAIN_THREAD_EM_ASM_INT({ if (typeof(AudioContext) !== 'undefined') { @@ -372,11 +410,13 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) } return false; }); +/* *INDENT-ON* */ /* clang-format on */ if (!available) { SDL_SetError("No audio context available"); } + /* *INDENT-OFF* */ /* clang-format off */ capture_available = available && MAIN_THREAD_EM_ASM_INT({ if ((typeof(navigator.mediaDevices) !== 'undefined') && (typeof(navigator.mediaDevices.getUserMedia) !== 'undefined')) { return true; @@ -385,6 +425,7 @@ EMSCRIPTENAUDIO_Init(SDL_AudioDriverImpl * impl) } return false; }); +/* *INDENT-ON* */ /* clang-format on */ impl->HasCaptureSupport = capture_available ? SDL_TRUE : SDL_FALSE; impl->OnlyHasDefaultCaptureDevice = capture_available ? SDL_TRUE : SDL_FALSE; diff --git a/src/audio/emscripten/SDL_emscriptenaudio.h b/src/audio/emscripten/SDL_emscriptenaudio.h index f51695a0aaf5d..62631cf9c7473 100644 --- a/src/audio/emscripten/SDL_emscriptenaudio.h +++ b/src/audio/emscripten/SDL_emscriptenaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index ccf07916c76e5..70cdfa2633913 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_ESD +#ifdef SDL_AUDIO_DRIVER_ESD /* Allow access to an ESD network stream mixing buffer */ @@ -64,21 +64,19 @@ static struct #undef SDL_ESD_SYM -static void -UnloadESDLibrary() +static void UnloadESDLibrary(void) { - if (esd_handle != NULL) { + if (esd_handle) { SDL_UnloadObject(esd_handle); esd_handle = NULL; } } -static int -LoadESDLibrary(void) +static int LoadESDLibrary(void) { int i, retval = -1; - if (esd_handle == NULL) { + if (!esd_handle) { esd_handle = SDL_LoadObject(esd_library); if (esd_handle) { retval = 0; @@ -98,14 +96,12 @@ LoadESDLibrary(void) #else -static void -UnloadESDLibrary() +static void UnloadESDLibrary(void) { return; } -static int -LoadESDLibrary(void) +static int LoadESDLibrary(void) { return 0; } @@ -114,8 +110,7 @@ LoadESDLibrary(void) /* This function waits until it is possible to write a full sound buffer */ -static void -ESD_WaitDevice(_THIS) +static void ESD_WaitDevice(_THIS) { Sint32 ticks; @@ -140,8 +135,7 @@ ESD_WaitDevice(_THIS) } } -static void -ESD_PlayDevice(_THIS) +static void ESD_PlayDevice(_THIS) { int written = 0; @@ -164,14 +158,12 @@ ESD_PlayDevice(_THIS) } } -static Uint8 * -ESD_GetDeviceBuf(_THIS) +static Uint8 *ESD_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } -static void -ESD_CloseDevice(_THIS) +static void ESD_CloseDevice(_THIS) { if (this->hidden->audio_fd >= 0) { SDL_NAME(esd_close) (this->hidden->audio_fd); @@ -181,8 +173,7 @@ ESD_CloseDevice(_THIS) } /* Try to get the name of the program */ -static char * -get_progname(void) +static char *get_progname(void) { char *progname = NULL; #ifdef __LINUX__ @@ -194,7 +185,7 @@ get_progname(void) if (fp != NULL) { if (fgets(temp, sizeof(temp) - 1, fp)) { progname = SDL_strrchr(temp, '/'); - if (progname == NULL) { + if (!progname) { progname = temp; } else { progname = progname + 1; @@ -207,17 +198,15 @@ get_progname(void) } -static int -ESD_OpenDevice(_THIS, const char *devname) +static int ESD_OpenDevice(_THIS, const char *devname) { esd_format_t format = (ESD_STREAM | ESD_PLAY); SDL_AudioFormat test_format = 0; int found = 0; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -275,7 +264,7 @@ ESD_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -287,14 +276,12 @@ ESD_OpenDevice(_THIS, const char *devname) return 0; } -static void -ESD_Deinitialize(void) +static void ESD_Deinitialize(void) { UnloadESDLibrary(); } -static SDL_bool -ESD_Init(SDL_AudioDriverImpl * impl) +static SDL_bool ESD_Init(SDL_AudioDriverImpl * impl) { if (LoadESDLibrary() < 0) { return SDL_FALSE; diff --git a/src/audio/esd/SDL_esdaudio.h b/src/audio/esd/SDL_esdaudio.h index 90b780059d8f0..0ec50b06870a1 100644 --- a/src/audio/esd/SDL_esdaudio.h +++ b/src/audio/esd/SDL_esdaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/fusionsound/SDL_fsaudio.c b/src/audio/fusionsound/SDL_fsaudio.c index fbe684de85d33..30a429fbf1d0f 100644 --- a/src/audio/fusionsound/SDL_fsaudio.c +++ b/src/audio/fusionsound/SDL_fsaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_FUSIONSOUND +#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND /* !!! FIXME: why is this is SDL_FS_* instead of FUSIONSOUND_*? */ @@ -77,23 +77,21 @@ static struct #undef SDL_FS_SYM -static void -UnloadFusionSoundLibrary() +static void UnloadFusionSoundLibrary(void) { - if (fs_handle != NULL) { + if (fs_handle) { SDL_UnloadObject(fs_handle); fs_handle = NULL; } } -static int -LoadFusionSoundLibrary(void) +static int LoadFusionSoundLibrary(void) { int i, retval = -1; - if (fs_handle == NULL) { + if (!fs_handle) { fs_handle = SDL_LoadObject(fs_library); - if (fs_handle != NULL) { + if (fs_handle) { retval = 0; for (i = 0; i < SDL_arraysize(fs_functions); ++i) { *fs_functions[i].func = @@ -112,14 +110,12 @@ LoadFusionSoundLibrary(void) #else -static void -UnloadFusionSoundLibrary() +static void UnloadFusionSoundLibrary(void) { return; } -static int -LoadFusionSoundLibrary(void) +static int LoadFusionSoundLibrary(void) { return 0; } @@ -127,15 +123,13 @@ LoadFusionSoundLibrary(void) #endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */ /* This function waits until it is possible to write a full sound buffer */ -static void -SDL_FS_WaitDevice(_THIS) +static void SDL_FS_WaitDevice(_THIS) { this->hidden->stream->Wait(this->hidden->stream, this->hidden->mixsamples); } -static void -SDL_FS_PlayDevice(_THIS) +static void SDL_FS_PlayDevice(_THIS) { DirectResult ret; @@ -152,15 +146,13 @@ SDL_FS_PlayDevice(_THIS) } -static Uint8 * -SDL_FS_GetDeviceBuf(_THIS) +static Uint8 *SDL_FS_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } -static void -SDL_FS_CloseDevice(_THIS) +static void SDL_FS_CloseDevice(_THIS) { if (this->hidden->stream) { this->hidden->stream->Release(this->hidden->stream); @@ -173,8 +165,7 @@ SDL_FS_CloseDevice(_THIS) } -static int -SDL_FS_OpenDevice(_THIS, const char *devname) +static int SDL_FS_OpenDevice(_THIS, const char *devname) { int bytes; SDL_AudioFormat test_format; @@ -183,9 +174,8 @@ SDL_FS_OpenDevice(_THIS, const char *devname) DirectResult ret; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -260,7 +250,7 @@ SDL_FS_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -270,15 +260,13 @@ SDL_FS_OpenDevice(_THIS, const char *devname) } -static void -SDL_FS_Deinitialize(void) +static void SDL_FS_Deinitialize(void) { UnloadFusionSoundLibrary(); } -static SDL_bool -SDL_FS_Init(SDL_AudioDriverImpl * impl) +static SDL_bool SDL_FS_Init(SDL_AudioDriverImpl * impl) { if (LoadFusionSoundLibrary() < 0) { return SDL_FALSE; diff --git a/src/audio/fusionsound/SDL_fsaudio.h b/src/audio/fusionsound/SDL_fsaudio.h index 2e7a59bcff65b..49c2f53469ba0 100644 --- a/src/audio/fusionsound/SDL_fsaudio.h +++ b/src/audio/fusionsound/SDL_fsaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/haiku/SDL_haikuaudio.cc b/src/audio/haiku/SDL_haikuaudio.cc index aec5f4a255195..729c0b0dd3843 100644 --- a/src/audio/haiku/SDL_haikuaudio.cc +++ b/src/audio/haiku/SDL_haikuaudio.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_HAIKU +#ifdef SDL_AUDIO_DRIVER_HAIKU /* Allow access to the audio stream on Haiku */ @@ -42,8 +42,7 @@ extern "C" /* !!! FIXME: have the callback call the higher level to avoid code dupe. */ /* The Haiku callback for handling the audio buffer */ -static void -FillSound(void *device, void *stream, size_t len, +static void FillSound(void *device, void *stream, size_t len, const media_raw_audio_format & format) { SDL_AudioDevice *audio = (SDL_AudioDevice *) device; @@ -60,7 +59,7 @@ FillSound(void *device, void *stream, size_t len, } else { SDL_assert(audio->spec.size == len); - if (audio->stream == NULL) { /* no conversion necessary. */ + if (!audio->stream) { /* no conversion necessary. */ callback(audio->callbackspec.userdata, (Uint8 *) stream, len); } else { /* streaming/converting */ const int stream_len = audio->callbackspec.size; @@ -85,8 +84,7 @@ FillSound(void *device, void *stream, size_t len, SDL_UnlockMutex(audio->mixer_lock); } -static void -HAIKUAUDIO_CloseDevice(_THIS) +static void HAIKUAUDIO_CloseDevice(_THIS) { if (_this->hidden->audio_obj) { _this->hidden->audio_obj->Stop(); @@ -100,8 +98,7 @@ static const int sig_list[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0 }; -static inline void -MaskSignals(sigset_t * omask) +static inline void MaskSignals(sigset_t * omask) { sigset_t mask; int i; @@ -113,15 +110,13 @@ MaskSignals(sigset_t * omask) sigprocmask(SIG_BLOCK, &mask, omask); } -static inline void -UnmaskSignals(sigset_t * omask) +static inline void UnmaskSignals(sigset_t * omask) { sigprocmask(SIG_SETMASK, omask, NULL); } -static int -HAIKUAUDIO_OpenDevice(_THIS, const char *devname) +static int HAIKUAUDIO_OpenDevice(_THIS, const char *devname) { media_raw_audio_format format; SDL_AudioFormat test_format; @@ -208,14 +203,12 @@ HAIKUAUDIO_OpenDevice(_THIS, const char *devname) return 0; } -static void -HAIKUAUDIO_Deinitialize(void) +static void HAIKUAUDIO_Deinitialize(void) { SDL_QuitBeApp(); } -static SDL_bool -HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl) { /* Initialize the Be Application, if it's not already started */ if (SDL_InitBeApp() < 0) { diff --git a/src/audio/haiku/SDL_haikuaudio.h b/src/audio/haiku/SDL_haikuaudio.h index 91cc2843f8b2e..50008de7b8bb5 100644 --- a/src/audio/haiku/SDL_haikuaudio.h +++ b/src/audio/haiku/SDL_haikuaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *_this +#define _THIS SDL_AudioDevice *_this struct SDL_PrivateAudioData { diff --git a/src/audio/jack/SDL_jackaudio.c b/src/audio/jack/SDL_jackaudio.c index f6e7e0cd38a71..697cc0afd7b84 100644 --- a/src/audio/jack/SDL_jackaudio.c +++ b/src/audio/jack/SDL_jackaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_JACK +#ifdef SDL_AUDIO_DRIVER_JACK #include "SDL_timer.h" #include "SDL_audio.h" @@ -29,39 +29,36 @@ #include "SDL_loadso.h" #include "../../thread/SDL_systhread.h" - -static jack_client_t * (*JACK_jack_client_open) (const char *, jack_options_t, jack_status_t *, ...); -static int (*JACK_jack_client_close) (jack_client_t *); -static void (*JACK_jack_on_shutdown) (jack_client_t *, JackShutdownCallback, void *); -static int (*JACK_jack_activate) (jack_client_t *); -static int (*JACK_jack_deactivate) (jack_client_t *); -static void * (*JACK_jack_port_get_buffer) (jack_port_t *, jack_nframes_t); -static int (*JACK_jack_port_unregister) (jack_client_t *, jack_port_t *); -static void (*JACK_jack_free) (void *); -static const char ** (*JACK_jack_get_ports) (jack_client_t *, const char *, const char *, unsigned long); -static jack_nframes_t (*JACK_jack_get_sample_rate) (jack_client_t *); -static jack_nframes_t (*JACK_jack_get_buffer_size) (jack_client_t *); -static jack_port_t * (*JACK_jack_port_register) (jack_client_t *, const char *, const char *, unsigned long, unsigned long); -static jack_port_t * (*JACK_jack_port_by_name) (jack_client_t *, const char *); -static const char * (*JACK_jack_port_name) (const jack_port_t *); -static const char * (*JACK_jack_port_type) (const jack_port_t *); -static int (*JACK_jack_connect) (jack_client_t *, const char *, const char *); -static int (*JACK_jack_set_process_callback) (jack_client_t *, JackProcessCallback, void *); +static jack_client_t *(*JACK_jack_client_open)(const char *, jack_options_t, jack_status_t *, ...); +static int (*JACK_jack_client_close)(jack_client_t *); +static void (*JACK_jack_on_shutdown)(jack_client_t *, JackShutdownCallback, void *); +static int (*JACK_jack_activate)(jack_client_t *); +static int (*JACK_jack_deactivate)(jack_client_t *); +static void *(*JACK_jack_port_get_buffer)(jack_port_t *, jack_nframes_t); +static int (*JACK_jack_port_unregister)(jack_client_t *, jack_port_t *); +static void (*JACK_jack_free)(void *); +static const char **(*JACK_jack_get_ports)(jack_client_t *, const char *, const char *, unsigned long); +static jack_nframes_t (*JACK_jack_get_sample_rate)(jack_client_t *); +static jack_nframes_t (*JACK_jack_get_buffer_size)(jack_client_t *); +static jack_port_t *(*JACK_jack_port_register)(jack_client_t *, const char *, const char *, unsigned long, unsigned long); +static jack_port_t *(*JACK_jack_port_by_name)(jack_client_t *, const char *); +static const char *(*JACK_jack_port_name)(const jack_port_t *); +static const char *(*JACK_jack_port_type)(const jack_port_t *); +static int (*JACK_jack_connect)(jack_client_t *, const char *, const char *); +static int (*JACK_jack_set_process_callback)(jack_client_t *, JackProcessCallback, void *); static int load_jack_syms(void); - #ifdef SDL_AUDIO_DRIVER_JACK_DYNAMIC static const char *jack_library = SDL_AUDIO_DRIVER_JACK_DYNAMIC; static void *jack_handle = NULL; /* !!! FIXME: this is copy/pasted in several places now */ -static int -load_jack_sym(const char *fn, void **addr) +static int load_jack_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(jack_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return 0; } @@ -70,25 +67,24 @@ load_jack_sym(const char *fn, void **addr) } /* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_JACK_SYM(x) \ - if (!load_jack_sym(#x, (void **) (char *) &JACK_##x)) return -1 +#define SDL_JACK_SYM(x) \ + if (!load_jack_sym(#x, (void **)(char *)&JACK_##x)) \ + return -1 -static void -UnloadJackLibrary(void) +static void UnloadJackLibrary(void) { - if (jack_handle != NULL) { + if (jack_handle) { SDL_UnloadObject(jack_handle); jack_handle = NULL; } } -static int -LoadJackLibrary(void) +static int LoadJackLibrary(void) { int retval = 0; - if (jack_handle == NULL) { + if (!jack_handle) { jack_handle = SDL_LoadObject(jack_library); - if (jack_handle == NULL) { + if (!jack_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { @@ -105,13 +101,11 @@ LoadJackLibrary(void) #define SDL_JACK_SYM(x) JACK_##x = x -static void -UnloadJackLibrary(void) +static void UnloadJackLibrary(void) { } -static int -LoadJackLibrary(void) +static int LoadJackLibrary(void) { load_jack_syms(); return 0; @@ -119,9 +113,7 @@ LoadJackLibrary(void) #endif /* SDL_AUDIO_DRIVER_JACK_DYNAMIC */ - -static int -load_jack_syms(void) +static int load_jack_syms(void) { SDL_JACK_SYM(jack_client_open); SDL_JACK_SYM(jack_client_close); @@ -140,26 +132,24 @@ load_jack_syms(void) SDL_JACK_SYM(jack_port_type); SDL_JACK_SYM(jack_connect); SDL_JACK_SYM(jack_set_process_callback); + return 0; } - -static void -jackShutdownCallback(void *arg) /* JACK went away; device is lost. */ +static void jackShutdownCallback(void *arg) /* JACK went away; device is lost. */ { - SDL_AudioDevice *this = (SDL_AudioDevice *) arg; + SDL_AudioDevice *this = (SDL_AudioDevice *)arg; SDL_OpenedAudioDeviceDisconnected(this); - SDL_SemPost(this->hidden->iosem); /* unblock the SDL thread. */ + SDL_SemPost(this->hidden->iosem); /* unblock the SDL thread. */ } // !!! FIXME: implement and register these! -//typedef int(* JackSampleRateCallback)(jack_nframes_t nframes, void *arg) -//typedef int(* JackBufferSizeCallback)(jack_nframes_t nframes, void *arg) +// typedef int(* JackSampleRateCallback)(jack_nframes_t nframes, void *arg) +// typedef int(* JackBufferSizeCallback)(jack_nframes_t nframes, void *arg) -static int -jackProcessPlaybackCallback(jack_nframes_t nframes, void *arg) +static int jackProcessPlaybackCallback(jack_nframes_t nframes, void *arg) { - SDL_AudioDevice *this = (SDL_AudioDevice *) arg; + SDL_AudioDevice *this = (SDL_AudioDevice *)arg; jack_port_t **ports = this->hidden->sdlports; const int total_channels = this->spec.channels; const int total_frames = this->spec.samples; @@ -171,9 +161,9 @@ jackProcessPlaybackCallback(jack_nframes_t nframes, void *arg) } for (channelsi = 0; channelsi < total_channels; channelsi++) { - float *dst = (float *) JACK_jack_port_get_buffer(ports[channelsi], nframes); + float *dst = (float *)JACK_jack_port_get_buffer(ports[channelsi], nframes); if (dst) { - const float *src = ((float *) this->hidden->iobuffer) + channelsi; + const float *src = this->hidden->iobuffer + channelsi; int framesi; for (framesi = 0; framesi < total_frames; framesi++) { *(dst++) = *src; @@ -182,14 +172,12 @@ jackProcessPlaybackCallback(jack_nframes_t nframes, void *arg) } } - SDL_SemPost(this->hidden->iosem); /* tell SDL thread we're done; refill the buffer. */ - return 0; /* success */ + SDL_SemPost(this->hidden->iosem); /* tell SDL thread we're done; refill the buffer. */ + return 0; } - /* This function waits until it is possible to write a full sound buffer */ -static void -JACK_WaitDevice(_THIS) +static void JACK_WaitDevice(_THIS) { if (SDL_AtomicGet(&this->enabled)) { if (SDL_SemWait(this->hidden->iosem) == -1) { @@ -198,27 +186,24 @@ JACK_WaitDevice(_THIS) } } -static Uint8 * -JACK_GetDeviceBuf(_THIS) +static Uint8 *JACK_GetDeviceBuf(_THIS) { - return (Uint8 *) this->hidden->iobuffer; + return (Uint8 *)this->hidden->iobuffer; } - -static int -jackProcessCaptureCallback(jack_nframes_t nframes, void *arg) +static int jackProcessCaptureCallback(jack_nframes_t nframes, void *arg) { - SDL_AudioDevice *this = (SDL_AudioDevice *) arg; + SDL_AudioDevice *this = (SDL_AudioDevice *)arg; if (SDL_AtomicGet(&this->enabled)) { jack_port_t **ports = this->hidden->sdlports; const int total_channels = this->spec.channels; const int total_frames = this->spec.samples; int channelsi; - + for (channelsi = 0; channelsi < total_channels; channelsi++) { - const float *src = (const float *) JACK_jack_port_get_buffer(ports[channelsi], nframes); + const float *src = (const float *)JACK_jack_port_get_buffer(ports[channelsi], nframes); if (src) { - float *dst = ((float *) this->hidden->iobuffer) + channelsi; + float *dst = this->hidden->iobuffer + channelsi; int framesi; for (framesi = 0; framesi < total_frames; framesi++) { *dst = *(src++); @@ -228,14 +213,13 @@ jackProcessCaptureCallback(jack_nframes_t nframes, void *arg) } } - SDL_SemPost(this->hidden->iosem); /* tell SDL thread we're done; new buffer is ready! */ - return 0; /* success */ + SDL_SemPost(this->hidden->iosem); /* tell SDL thread we're done; new buffer is ready! */ + return 0; } -static int -JACK_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int JACK_CaptureFromDevice(_THIS, void *buffer, int buflen) { - SDL_assert(buflen == this->spec.size); /* we always fill a full buffer. */ + SDL_assert(buflen == this->spec.size); /* we always fill a full buffer. */ /* Wait for JACK to fill the iobuffer */ if (SDL_SemWait(this->hidden->iosem) == -1) { @@ -246,15 +230,12 @@ JACK_CaptureFromDevice(_THIS, void *buffer, int buflen) return buflen; } -static void -JACK_FlushCapture(_THIS) +static void JACK_FlushCapture(_THIS) { SDL_SemWait(this->hidden->iosem); } - -static void -JACK_CloseDevice(_THIS) +static void JACK_CloseDevice(_THIS) { if (this->hidden->client) { JACK_jack_deactivate(this->hidden->client); @@ -279,8 +260,7 @@ JACK_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -JACK_OpenDevice(_THIS, const char *devname) +static int JACK_OpenDevice(_THIS, const char *devname) { /* Note that JACK uses "output" for capture devices (they output audio data to us) and "input" for playback (we input audio data to them). @@ -300,7 +280,7 @@ JACK_OpenDevice(_THIS, const char *devname) int i; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) SDL_calloc(1, sizeof (*this->hidden)); + this->hidden = (struct SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*this->hidden)); if (this->hidden == NULL) { return SDL_OutOfMemory(); } @@ -313,7 +293,7 @@ JACK_OpenDevice(_THIS, const char *devname) } devports = JACK_jack_get_ports(client, NULL, NULL, JackPortIsPhysical | sysportflags); - if (!devports || !devports[0]) { + if (devports == NULL || !devports[0]) { return SDL_SetError("No physical JACK ports available"); } @@ -322,21 +302,21 @@ JACK_OpenDevice(_THIS, const char *devname) } /* Filter out non-audio ports */ - audio_ports = SDL_calloc(ports, sizeof *audio_ports); + audio_ports = SDL_calloc(ports, sizeof(*audio_ports)); for (i = 0; i < ports; i++) { const jack_port_t *dport = JACK_jack_port_by_name(client, devports[i]); const char *type = JACK_jack_port_type(dport); const int len = SDL_strlen(type); /* See if type ends with "audio" */ - if (len >= 5 && !SDL_memcmp(type+len-5, "audio", 5)) { + if (len >= 5 && !SDL_memcmp(type + len - 5, "audio", 5)) { audio_ports[channels++] = i; } } if (channels == 0) { + SDL_free(audio_ports); return SDL_SetError("No physical JACK ports available"); } - /* !!! FIXME: docs say about buffer size: "This size may change, clients that depend on it must register a bufsize_callback so they will be notified if it does." */ /* Jack pretty much demands what it wants. */ @@ -349,36 +329,42 @@ JACK_OpenDevice(_THIS, const char *devname) this->hidden->iosem = SDL_CreateSemaphore(0); if (!this->hidden->iosem) { - return -1; /* error was set by SDL_CreateSemaphore */ + SDL_free(audio_ports); + return -1; /* error was set by SDL_CreateSemaphore */ } - this->hidden->iobuffer = (float *) SDL_calloc(1, this->spec.size); + this->hidden->iobuffer = (float *)SDL_calloc(1, this->spec.size); if (!this->hidden->iobuffer) { + SDL_free(audio_ports); return SDL_OutOfMemory(); } /* Build SDL's ports, which we will connect to the device ports. */ - this->hidden->sdlports = (jack_port_t **) SDL_calloc(channels, sizeof (jack_port_t *)); - if (this->hidden->sdlports == NULL) { + this->hidden->sdlports = (jack_port_t **)SDL_calloc(channels, sizeof(jack_port_t *)); + if (!this->hidden->sdlports) { + SDL_free(audio_ports); return SDL_OutOfMemory(); } for (i = 0; i < channels; i++) { char portname[32]; - SDL_snprintf(portname, sizeof (portname), "sdl_jack_%s_%d", sdlportstr, i); + (void)SDL_snprintf(portname, sizeof(portname), "sdl_jack_%s_%d", sdlportstr, i); this->hidden->sdlports[i] = JACK_jack_port_register(client, portname, JACK_DEFAULT_AUDIO_TYPE, sdlportflags, 0); if (this->hidden->sdlports[i] == NULL) { + SDL_free(audio_ports); return SDL_SetError("jack_port_register failed"); } } if (JACK_jack_set_process_callback(client, callback, this) != 0) { + SDL_free(audio_ports); return SDL_SetError("JACK: Couldn't set process callback"); } JACK_jack_on_shutdown(client, jackShutdownCallback, this); if (JACK_jack_activate(client) != 0) { + SDL_free(audio_ports); return SDL_SetError("Failed to activate JACK client"); } @@ -388,6 +374,7 @@ JACK_OpenDevice(_THIS, const char *devname) const char *srcport = iscapture ? devports[audio_ports[i]] : sdlport; const char *dstport = iscapture ? sdlport : devports[audio_ports[i]]; if (JACK_jack_connect(client, srcport, dstport) != 0) { + SDL_free(audio_ports); return SDL_SetError("Couldn't connect JACK ports: %s => %s", srcport, dstport); } } @@ -400,14 +387,12 @@ JACK_OpenDevice(_THIS, const char *devname) return 0; } -static void -JACK_Deinitialize(void) +static void JACK_Deinitialize(void) { UnloadJackLibrary(); } -static SDL_bool -JACK_Init(SDL_AudioDriverImpl * impl) +static SDL_bool JACK_Init(SDL_AudioDriverImpl *impl) { if (LoadJackLibrary() < 0) { return SDL_FALSE; @@ -415,7 +400,7 @@ JACK_Init(SDL_AudioDriverImpl * impl) /* Make sure a JACK server is running and available. */ jack_status_t status; jack_client_t *client = JACK_jack_client_open("SDL", JackNoStartServer, &status, NULL); - if (client == NULL) { + if (!client) { UnloadJackLibrary(); return SDL_FALSE; } @@ -434,7 +419,7 @@ JACK_Init(SDL_AudioDriverImpl * impl) impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; impl->HasCaptureSupport = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap JACK_bootstrap = { diff --git a/src/audio/jack/SDL_jackaudio.h b/src/audio/jack/SDL_jackaudio.h index a552e81998d7b..5fbac2b280173 100644 --- a/src/audio/jack/SDL_jackaudio.h +++ b/src/audio/jack/SDL_jackaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/n3ds/SDL_n3dsaudio.c b/src/audio/n3ds/SDL_n3dsaudio.c index 484bec8ae9e29..c577436028a72 100644 --- a/src/audio/n3ds/SDL_n3dsaudio.c +++ b/src/audio/n3ds/SDL_n3dsaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,32 +38,18 @@ static SDL_AudioDevice *audio_device; static void FreePrivateData(_THIS); static int FindAudioFormat(_THIS); -static SDL_INLINE void -contextLock(_THIS) +/* fully local functions related to the wavebufs / DSP, not the same as the SDL-wide mixer lock */ +static SDL_INLINE void contextLock(_THIS) { LightLock_Lock(&this->hidden->lock); } -static SDL_INLINE void -contextUnlock(_THIS) +static SDL_INLINE void contextUnlock(_THIS) { LightLock_Unlock(&this->hidden->lock); } -static void -N3DSAUD_LockAudio(_THIS) -{ - contextLock(this); -} - -static void -N3DSAUD_UnlockAudio(_THIS) -{ - contextUnlock(this); -} - -static void -N3DSAUD_DspHook(DSP_HookType hook) +static void N3DSAUD_DspHook(DSP_HookType hook) { if (hook == DSPHOOK_ONCANCEL) { contextLock(audio_device); @@ -74,12 +60,11 @@ N3DSAUD_DspHook(DSP_HookType hook) } } -static void -AudioFrameFinished(void *device) +static void AudioFrameFinished(void *device) { bool shouldBroadcast = false; unsigned i; - SDL_AudioDevice *this = (SDL_AudioDevice *) device; + SDL_AudioDevice *this = (SDL_AudioDevice *)device; contextLock(this); @@ -97,15 +82,14 @@ AudioFrameFinished(void *device) contextUnlock(this); } -static int -N3DSAUDIO_OpenDevice(_THIS, const char *devname) +static int N3DSAUDIO_OpenDevice(_THIS, const char *devname) { Result ndsp_init_res; Uint8 *data_vaddr; float mix[12]; - this->hidden = (struct SDL_PrivateAudioData *) SDL_calloc(1, sizeof *this->hidden); + this->hidden = (struct SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*this->hidden)); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } @@ -142,15 +126,15 @@ N3DSAUDIO_OpenDevice(_THIS, const char *devname) } this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->spec.size); - if (this->hidden->mixbuf == NULL) { + this->hidden->mixbuf = (Uint8 *)SDL_malloc(this->spec.size); + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); - data_vaddr = (Uint8 *) linearAlloc(this->hidden->mixlen * NUM_BUFFERS); - if (data_vaddr == NULL) { + data_vaddr = (Uint8 *)linearAlloc(this->hidden->mixlen * NUM_BUFFERS); + if (!data_vaddr) { return SDL_OutOfMemory(); } @@ -188,8 +172,7 @@ N3DSAUDIO_OpenDevice(_THIS, const char *devname) return 0; } -static int -N3DSAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int N3DSAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { /* Delay to make this sort of simulate real audio input. */ SDL_Delay((this->spec.samples * 1000) / this->spec.freq); @@ -199,11 +182,11 @@ N3DSAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) return buflen; } -static void -N3DSAUDIO_PlayDevice(_THIS) +static void N3DSAUDIO_PlayDevice(_THIS) { size_t nextbuf; size_t sampleLen; + contextLock(this); nextbuf = this->hidden->nextbuf; @@ -219,15 +202,14 @@ N3DSAUDIO_PlayDevice(_THIS) contextUnlock(this); - memcpy((void *) this->hidden->waveBuf[nextbuf].data_vaddr, + memcpy((void *)this->hidden->waveBuf[nextbuf].data_vaddr, this->hidden->mixbuf, sampleLen); DSP_FlushDataCache(this->hidden->waveBuf[nextbuf].data_vaddr, sampleLen); ndspChnWaveBufAdd(0, &this->hidden->waveBuf[nextbuf]); } -static void -N3DSAUDIO_WaitDevice(_THIS) +static void N3DSAUDIO_WaitDevice(_THIS) { contextLock(this); while (!this->hidden->isCancelled && @@ -237,14 +219,12 @@ N3DSAUDIO_WaitDevice(_THIS) contextUnlock(this); } -static Uint8 * -N3DSAUDIO_GetDeviceBuf(_THIS) +static Uint8 *N3DSAUDIO_GetDeviceBuf(_THIS) { return this->hidden->mixbuf; } -static void -N3DSAUDIO_CloseDevice(_THIS) +static void N3DSAUDIO_CloseDevice(_THIS) { contextLock(this); @@ -264,10 +244,9 @@ N3DSAUDIO_CloseDevice(_THIS) FreePrivateData(this); } -static void -N3DSAUDIO_ThreadInit(_THIS) +static void N3DSAUDIO_ThreadInit(_THIS) { - s32 current_priority; + s32 current_priority = 0x30; svcGetThreadPriority(¤t_priority, CUR_THREAD_HANDLE); current_priority--; /* 0x18 is reserved for video, 0x30 is the default for main thread */ @@ -275,8 +254,7 @@ N3DSAUDIO_ThreadInit(_THIS) svcSetThreadPriority(CUR_THREAD_HANDLE, current_priority); } -static SDL_bool -N3DSAUDIO_Init(SDL_AudioDriverImpl *impl) +static SDL_bool N3DSAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = N3DSAUDIO_OpenDevice; @@ -285,8 +263,6 @@ N3DSAUDIO_Init(SDL_AudioDriverImpl *impl) impl->GetDeviceBuf = N3DSAUDIO_GetDeviceBuf; impl->CloseDevice = N3DSAUDIO_CloseDevice; impl->ThreadInit = N3DSAUDIO_ThreadInit; - impl->LockDevice = N3DSAUD_LockAudio; - impl->UnlockDevice = N3DSAUD_UnlockAudio; impl->OnlyHasDefaultOutputDevice = SDL_TRUE; /* Should be possible, but micInit would fail */ @@ -306,15 +282,14 @@ AudioBootStrap N3DSAUDIO_bootstrap = { /** * Cleans up all allocated memory, safe to call with null pointers */ -static void -FreePrivateData(_THIS) +static void FreePrivateData(_THIS) { if (!this->hidden) { return; } if (this->hidden->waveBuf[0].data_vaddr) { - linearFree((void *) this->hidden->waveBuf[0].data_vaddr); + linearFree((void *)this->hidden->waveBuf[0].data_vaddr); } if (this->hidden->mixbuf) { @@ -326,8 +301,7 @@ FreePrivateData(_THIS) this->hidden = NULL; } -static int -FindAudioFormat(_THIS) +static int FindAudioFormat(_THIS) { SDL_bool found_valid_format = SDL_FALSE; Uint16 test_format = SDL_FirstAudioFormat(this->spec.format); diff --git a/src/audio/n3ds/SDL_n3dsaudio.h b/src/audio/n3ds/SDL_n3dsaudio.h index d01f17f539a66..dbd9d61b50634 100644 --- a/src/audio/n3ds/SDL_n3dsaudio.h +++ b/src/audio/n3ds/SDL_n3dsaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ /* Hidden "this" pointer for the audio functions */ #define _THIS SDL_AudioDevice *this -#define NUM_BUFFERS 2 /* -- Don't lower this! */ +#define NUM_BUFFERS 3 /* -- Minimum 2! */ struct SDL_PrivateAudioData { diff --git a/src/audio/nacl/SDL_naclaudio.c b/src/audio/nacl/SDL_naclaudio.c index c38070d8d8dbe..c592aaaa6f3ab 100644 --- a/src/audio/nacl/SDL_naclaudio.c +++ b/src/audio/nacl/SDL_naclaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_NACL +#ifdef SDL_AUDIO_DRIVER_NACL #include "SDL_naclaudio.h" @@ -45,7 +45,8 @@ static void nacl_audio_callback(void* samples, uint32_t buffer_size, PP_TimeDelta latency, void* data); /* FIXME: Make use of latency if needed */ -static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta latency, void* data) { +static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta latency, void* data) +{ const int len = (int) buffer_size; SDL_AudioDevice* _this = (SDL_AudioDevice*) data; SDL_AudioCallback callback = _this->callbackspec.callback; @@ -61,7 +62,7 @@ static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta } else { SDL_assert(_this->spec.size == len); - if (_this->stream == NULL) { /* no conversion necessary. */ + if (!_this->stream) { /* no conversion necessary. */ callback(_this->callbackspec.userdata, stream, len); } else { /* streaming/converting */ const int stream_len = _this->callbackspec.size; @@ -85,56 +86,56 @@ static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta SDL_UnlockMutex(_this->mixer_lock); } -static void NACLAUDIO_CloseDevice(SDL_AudioDevice *device) { +static void NACLAUDIO_CloseDevice(SDL_AudioDevice *device) +{ const PPB_Core *core = PSInterfaceCore(); const PPB_Audio *ppb_audio = PSInterfaceAudio(); SDL_PrivateAudioData *hidden = (SDL_PrivateAudioData *) device->hidden; - + ppb_audio->StopPlayback(hidden->audio); core->ReleaseResource(hidden->audio); } -static int -NACLAUDIO_OpenDevice(_THIS, const char *devname) { +static int NACLAUDIO_OpenDevice(_THIS, const char *devname) +{ PP_Instance instance = PSGetInstanceId(); const PPB_Audio *ppb_audio = PSInterfaceAudio(); const PPB_AudioConfig *ppb_audiocfg = PSInterfaceAudioConfig(); - - private = (SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *private)); - if (private == NULL) { + + private = (SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*private)); + if (!private) { return SDL_OutOfMemory(); } - + _this->spec.freq = 44100; _this->spec.format = AUDIO_S16LSB; _this->spec.channels = 2; _this->spec.samples = ppb_audiocfg->RecommendSampleFrameCount( - instance, - PP_AUDIOSAMPLERATE_44100, + instance, + PP_AUDIOSAMPLERATE_44100, SAMPLE_FRAME_COUNT); - + /* Calculate the final parameters for this audio specification */ SDL_CalculateAudioSpec(&_this->spec); - + private->audio = ppb_audio->Create( instance, ppb_audiocfg->CreateStereo16Bit(instance, PP_AUDIOSAMPLERATE_44100, _this->spec.samples), - nacl_audio_callback, + nacl_audio_callback, _this); - + /* Start audio playback while we are still on the main thread. */ ppb_audio->StartPlayback(private->audio); - + return 0; } -static SDL_bool -NACLAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool NACLAUDIO_Init(SDL_AudioDriverImpl * impl) { if (PSGetInstanceId() == 0) { return SDL_FALSE; } - + /* Set the function pointers */ impl->OpenDevice = NACLAUDIO_OpenDevice; impl->CloseDevice = NACLAUDIO_CloseDevice; @@ -146,7 +147,7 @@ NACLAUDIO_Init(SDL_AudioDriverImpl * impl) * impl->PlayDevice = NACLAUDIO_PlayDevice; * impl->Deinitialize = NACLAUDIO_Deinitialize; */ - + return SDL_TRUE; } diff --git a/src/audio/nacl/SDL_naclaudio.h b/src/audio/nacl/SDL_naclaudio.h index 13d8f8ca46973..c47f544d15a32 100644 --- a/src/audio/nacl/SDL_naclaudio.h +++ b/src/audio/nacl/SDL_naclaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/nas/SDL_nasaudio.c b/src/audio/nas/SDL_nasaudio.c index d6d86323291fd..22301e567a65d 100644 --- a/src/audio/nas/SDL_nasaudio.c +++ b/src/audio/nas/SDL_nasaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_NAS +#ifdef SDL_AUDIO_DRIVER_NAS /* Allow access to a raw mixing buffer */ @@ -56,11 +56,10 @@ static AuEventHandlerRec *(*NAS_AuRegisterEventHandler) static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC; static void *nas_handle = NULL; -static int -load_nas_sym(const char *fn, void **addr) +static int load_nas_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(nas_handle, fn); - if (*addr == NULL) { + if (!*addr) { return 0; } return 1; @@ -73,8 +72,7 @@ load_nas_sym(const char *fn, void **addr) #define SDL_NAS_SYM(x) NAS_##x = x #endif -static int -load_nas_syms(void) +static int load_nas_syms(void) { SDL_NAS_SYM(AuCloseServer); SDL_NAS_SYM(AuNextEvent); @@ -94,22 +92,20 @@ load_nas_syms(void) #ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC -static void -UnloadNASLibrary(void) +static void UnloadNASLibrary(void) { - if (nas_handle != NULL) { + if (nas_handle) { SDL_UnloadObject(nas_handle); nas_handle = NULL; } } -static int -LoadNASLibrary(void) +static int LoadNASLibrary(void) { int retval = 0; - if (nas_handle == NULL) { + if (!nas_handle) { nas_handle = SDL_LoadObject(nas_library); - if (nas_handle == NULL) { + if (!nas_handle) { /* Copy error string so we can use it in a new SDL_SetError(). */ const char *origerr = SDL_GetError(); const size_t len = SDL_strlen(origerr) + 1; @@ -130,13 +126,11 @@ LoadNASLibrary(void) #else -static void -UnloadNASLibrary(void) +static void UnloadNASLibrary(void) { } -static int -LoadNASLibrary(void) +static int LoadNASLibrary(void) { load_nas_syms(); return 0; @@ -145,8 +139,7 @@ LoadNASLibrary(void) #endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */ /* This function waits until it is possible to write a full sound buffer */ -static void -NAS_WaitDevice(_THIS) +static void NAS_WaitDevice(_THIS) { while (this->hidden->buf_free < this->hidden->mixlen) { AuEvent ev; @@ -155,8 +148,7 @@ NAS_WaitDevice(_THIS) } } -static void -NAS_PlayDevice(_THIS) +static void NAS_PlayDevice(_THIS) { while (this->hidden->mixlen > this->hidden->buf_free) { /* @@ -182,14 +174,12 @@ NAS_PlayDevice(_THIS) #endif } -static Uint8 * -NAS_GetDeviceBuf(_THIS) +static Uint8 *NAS_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } -static int -NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *h = this->hidden; int retval; @@ -197,7 +187,7 @@ NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) while (SDL_TRUE) { /* just keep the event queue moving and the server chattering. */ NAS_AuHandleEvents(h->aud); - + retval = (int) NAS_AuReadElement(h->aud, h->flow, 1, buflen, buffer, NULL); /*printf("read %d capture bytes\n", (int) retval);*/ if (retval == 0) { @@ -210,8 +200,7 @@ NAS_CaptureFromDevice(_THIS, void *buffer, int buflen) return retval; } -static void -NAS_FlushCapture(_THIS) +static void NAS_FlushCapture(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; AuUint32 total = 0; @@ -221,14 +210,13 @@ NAS_FlushCapture(_THIS) do { /* just keep the event queue moving and the server chattering. */ NAS_AuHandleEvents(h->aud); - br = NAS_AuReadElement(h->aud, h->flow, 1, sizeof (buf), buf, NULL); + br = NAS_AuReadElement(h->aud, h->flow, 1, sizeof(buf), buf, NULL); /*printf("flushed %d capture bytes\n", (int) br);*/ total += br; - } while ((br == sizeof (buf)) && (total < this->spec.size)); + } while ((br == sizeof(buf)) && (total < this->spec.size)); } -static void -NAS_CloseDevice(_THIS) +static void NAS_CloseDevice(_THIS) { if (this->hidden->aud) { NAS_AuCloseServer(this->hidden->aud); @@ -237,8 +225,7 @@ NAS_CloseDevice(_THIS) SDL_free(this->hidden); } -static AuBool -event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) +static AuBool event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) { SDL_AudioDevice *this = (SDL_AudioDevice *) hnd->data; struct SDL_PrivateAudioData *h = this->hidden; @@ -281,8 +268,7 @@ event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd) return AuTrue; } -static AuDeviceID -find_device(_THIS) +static AuDeviceID find_device(_THIS) { /* These "Au" things are all macros, not functions... */ struct SDL_PrivateAudioData *h = this->hidden; @@ -310,8 +296,7 @@ find_device(_THIS) return AuNone; } -static int -NAS_OpenDevice(_THIS, const char *devname) +static int NAS_OpenDevice(_THIS, const char *devname) { AuElement elms[3]; int buffer_size; @@ -319,9 +304,8 @@ NAS_OpenDevice(_THIS, const char *devname) SDL_AudioFormat test_format, format = 0; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -405,7 +389,7 @@ NAS_OpenDevice(_THIS, const char *devname) if (!iscapture) { this->hidden->mixlen = this->spec.size; this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -415,20 +399,18 @@ NAS_OpenDevice(_THIS, const char *devname) return 0; } -static void -NAS_Deinitialize(void) +static void NAS_Deinitialize(void) { UnloadNASLibrary(); } -static SDL_bool -NAS_Init(SDL_AudioDriverImpl * impl) +static SDL_bool NAS_Init(SDL_AudioDriverImpl * impl) { if (LoadNASLibrary() < 0) { return SDL_FALSE; } else { AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL); - if (aud == NULL) { + if (!aud) { SDL_SetError("NAS: AuOpenServer() failed (no audio server?)"); return SDL_FALSE; } diff --git a/src/audio/nas/SDL_nasaudio.h b/src/audio/nas/SDL_nasaudio.h index 7c9506d9176a3..eaa3b3797b01b 100644 --- a/src/audio/nas/SDL_nasaudio.h +++ b/src/audio/nas/SDL_nasaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/netbsd/SDL_netbsdaudio.c b/src/audio/netbsd/SDL_netbsdaudio.c index 5f021ea37848c..0704e328007ae 100644 --- a/src/audio/netbsd/SDL_netbsdaudio.c +++ b/src/audio/netbsd/SDL_netbsdaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_NETBSD +#ifdef SDL_AUDIO_DRIVER_NETBSD /* * Driver for native NetBSD audio(4). @@ -45,15 +45,12 @@ /* #define DEBUG_AUDIO */ -static void -NETBSDAUDIO_DetectDevices(void) +static void NETBSDAUDIO_DetectDevices(void) { SDL_EnumUnixAudioDevices(0, NULL); } - -static void -NETBSDAUDIO_Status(_THIS) +static void NETBSDAUDIO_Status(_THIS) { #ifdef DEBUG_AUDIO /* *INDENT-OFF* */ /* clang-format off */ @@ -119,12 +116,11 @@ NETBSDAUDIO_Status(_THIS) this->spec.format, this->spec.size); /* *INDENT-ON* */ /* clang-format on */ + #endif /* DEBUG_AUDIO */ } - -static void -NETBSDAUDIO_PlayDevice(_THIS) +static void NETBSDAUDIO_PlayDevice(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; int written; @@ -143,17 +139,14 @@ NETBSDAUDIO_PlayDevice(_THIS) #endif } -static Uint8 * -NETBSDAUDIO_GetDeviceBuf(_THIS) +static Uint8 *NETBSDAUDIO_GetDeviceBuf(_THIS) { - return (this->hidden->mixbuf); + return this->hidden->mixbuf; } - -static int -NETBSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) +static int NETBSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) { - Uint8 *buffer = (Uint8 *) _buffer; + Uint8 *buffer = (Uint8 *)_buffer; int br; br = read(this->hidden->audio_fd, buffer, buflen); @@ -169,30 +162,28 @@ NETBSDAUDIO_CaptureFromDevice(_THIS, void *_buffer, int buflen) return 0; } -static void -NETBSDAUDIO_FlushCapture(_THIS) +static void NETBSDAUDIO_FlushCapture(_THIS) { audio_info_t info; size_t remain; Uint8 buf[512]; if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { - return; /* oh well. */ + return; /* oh well. */ } - remain = (size_t) (info.record.samples * (SDL_AUDIO_BITSIZE(this->spec.format) / 8)); + remain = (size_t)(info.record.samples * (SDL_AUDIO_BITSIZE(this->spec.format) / 8)); while (remain > 0) { - const size_t len = SDL_min(sizeof (buf), remain); + const size_t len = SDL_min(sizeof(buf), remain); const int br = read(this->hidden->audio_fd, buf, len); if (br <= 0) { - return; /* oh well. */ + return; /* oh well. */ } remain -= br; } } -static void -NETBSDAUDIO_CloseDevice(_THIS) +static void NETBSDAUDIO_CloseDevice(_THIS) { if (this->hidden->audio_fd >= 0) { close(this->hidden->audio_fd); @@ -201,8 +192,7 @@ NETBSDAUDIO_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -NETBSDAUDIO_OpenDevice(_THIS, const char *devname) +static int NETBSDAUDIO_OpenDevice(_THIS, const char *devname) { SDL_bool iscapture = this->iscapture; SDL_AudioFormat test_format; @@ -212,17 +202,16 @@ NETBSDAUDIO_OpenDevice(_THIS, const char *devname) /* We don't care what the devname is...we'll try to open anything. */ /* ...but default to first name in the list... */ - if (devname == NULL) { + if (!devname) { devname = SDL_GetAudioDeviceName(0, iscapture); - if (devname == NULL) { + if (!devname) { return SDL_SetError("No such audio device"); } } /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -241,8 +230,7 @@ NETBSDAUDIO_OpenDevice(_THIS, const char *devname) * Use the device's native sample rate so the kernel doesn't have to * resample. */ - this->spec.freq = iscapture ? - hwinfo.record.sample_rate : hwinfo.play.sample_rate; + this->spec.freq = iscapture ? hwinfo.record.sample_rate : hwinfo.play.sample_rate; } #endif @@ -307,8 +295,8 @@ NETBSDAUDIO_OpenDevice(_THIS, const char *devname) if (!iscapture) { /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + this->hidden->mixbuf = (Uint8 *)SDL_malloc(this->hidden->mixlen); + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -320,8 +308,7 @@ NETBSDAUDIO_OpenDevice(_THIS, const char *devname) return 0; } -static SDL_bool -NETBSDAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool NETBSDAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->DetectDevices = NETBSDAUDIO_DetectDevices; @@ -335,10 +322,9 @@ NETBSDAUDIO_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->AllowsArbitraryDeviceNames = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } - AudioBootStrap NETBSDAUDIO_bootstrap = { "netbsd", "NetBSD audio", NETBSDAUDIO_Init, SDL_FALSE }; diff --git a/src/audio/netbsd/SDL_netbsdaudio.h b/src/audio/netbsd/SDL_netbsdaudio.h index 862d431b65355..416f9cdceeed2 100644 --- a/src/audio/netbsd/SDL_netbsdaudio.h +++ b/src/audio/netbsd/SDL_netbsdaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "../SDL_sysaudio.h" -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { @@ -41,7 +41,7 @@ struct SDL_PrivateAudioData float next_frame; }; -#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ +#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */ #endif /* SDL_netbsdaudio_h_ */ diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c index 474de3bfe1ece..dce2848215808 100644 --- a/src/audio/openslES/SDL_openslES.c +++ b/src/audio/openslES/SDL_openslES.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_OPENSLES +#ifdef SDL_AUDIO_DRIVER_OPENSLES /* For more discussion of low latency audio on Android, see this: https://googlesamples.github.io/android-audio-high-performance/guides/opensl_es.html @@ -38,9 +38,9 @@ #include #if 0 -#define LOG_TAG "SDL_openslES" -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) -#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOG_TAG "SDL_openslES" +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) //#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__) #define LOGV(...) #else @@ -70,9 +70,9 @@ #define SL_SPEAKER_TOP_BACK_RIGHT ((SLuint32) 0x00020000) */ #define SL_ANDROID_SPEAKER_STEREO (SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT) -#define SL_ANDROID_SPEAKER_QUAD (SL_ANDROID_SPEAKER_STEREO | SL_SPEAKER_BACK_LEFT | SL_SPEAKER_BACK_RIGHT) -#define SL_ANDROID_SPEAKER_5DOT1 (SL_ANDROID_SPEAKER_QUAD | SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY) -#define SL_ANDROID_SPEAKER_7DOT1 (SL_ANDROID_SPEAKER_5DOT1 | SL_SPEAKER_SIDE_LEFT | SL_SPEAKER_SIDE_RIGHT) +#define SL_ANDROID_SPEAKER_QUAD (SL_ANDROID_SPEAKER_STEREO | SL_SPEAKER_BACK_LEFT | SL_SPEAKER_BACK_RIGHT) +#define SL_ANDROID_SPEAKER_5DOT1 (SL_ANDROID_SPEAKER_QUAD | SL_SPEAKER_FRONT_CENTER | SL_SPEAKER_LOW_FREQUENCY) +#define SL_ANDROID_SPEAKER_7DOT1 (SL_ANDROID_SPEAKER_5DOT1 | SL_SPEAKER_SIDE_LEFT | SL_SPEAKER_SIDE_RIGHT) /* engine interfaces */ static SLObjectItf engineObject = NULL; @@ -98,8 +98,8 @@ static SLAndroidSimpleBufferQueueItf recorderBufferQueue = NULL; static const char *sldevaudiorecorderstr = "SLES Audio Recorder"; static const char *sldevaudioplayerstr = "SLES Audio Player"; -#define SLES_DEV_AUDIO_RECORDER sldevaudiorecorderstr -#define SLES_DEV_AUDIO_PLAYER sldevaudioplayerstr +#define SLES_DEV_AUDIO_RECORDER sldevaudiorecorderstr +#define SLES_DEV_AUDIO_PLAYER sldevaudioplayerstr static void openslES_DetectDevices( int iscapture ) { LOGI( "openSLES_DetectDevices()" ); @@ -128,8 +128,7 @@ static void openslES_DestroyEngine(void) } } -static int -openslES_CreateEngine(void) +static int openslES_CreateEngine(void) { const SLInterfaceID ids[1] = { SL_IID_VOLUME }; const SLboolean req[1] = { SL_BOOLEAN_FALSE }; @@ -183,17 +182,15 @@ openslES_CreateEngine(void) } /* this callback handler is called every time a buffer finishes recording */ -static void -bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context) +static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { - struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *) context; + struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *)context; LOGV("SLES: Recording Callback"); SDL_SemPost(audiodata->playsem); } -static void -openslES_DestroyPCMRecorder(_THIS) +static void openslES_DestroyPCMRecorder(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLresult result; @@ -224,8 +221,7 @@ openslES_DestroyPCMRecorder(_THIS) } } -static int -openslES_CreatePCMRecorder(_THIS) +static int openslES_CreatePCMRecorder(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLDataFormat_PCM format_pcm; @@ -252,8 +248,8 @@ openslES_CreatePCMRecorder(_THIS) SDL_CalculateAudioSpec(&this->spec); LOGI("Try to open %u hz %u bit chan %u %s samples %u", - this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), - this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); + this->spec.freq, SDL_AUDIO_BITSIZE(this->spec.format), + this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); /* configure audio source */ loc_dev.locatorType = SL_DATALOCATOR_IODEVICE; @@ -267,13 +263,13 @@ openslES_CreatePCMRecorder(_THIS) loc_bufq.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE; loc_bufq.numBuffers = NUM_BUFFERS; - format_pcm.formatType = SL_DATAFORMAT_PCM; - format_pcm.numChannels = this->spec.channels; - format_pcm.samplesPerSec = this->spec.freq * 1000; /* / kilo Hz to milli Hz */ + format_pcm.formatType = SL_DATAFORMAT_PCM; + format_pcm.numChannels = this->spec.channels; + format_pcm.samplesPerSec = this->spec.freq * 1000; /* / kilo Hz to milli Hz */ format_pcm.bitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); format_pcm.containerSize = SDL_AUDIO_BITSIZE(this->spec.format); - format_pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; - format_pcm.channelMask = SL_SPEAKER_FRONT_CENTER; + format_pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; + format_pcm.channelMask = SL_SPEAKER_FRONT_CENTER; audioSnk.pLocator = &loc_bufq; audioSnk.pFormat = &format_pcm; @@ -323,8 +319,8 @@ openslES_CreatePCMRecorder(_THIS) } /* Create the sound buffers */ - audiodata->mixbuff = (Uint8 *) SDL_malloc(NUM_BUFFERS * this->spec.size); - if (audiodata->mixbuff == NULL) { + audiodata->mixbuff = (Uint8 *)SDL_malloc(NUM_BUFFERS * this->spec.size); + if (!audiodata->mixbuff) { LOGE("mixbuffer allocate - out of memory"); goto failed; } @@ -363,17 +359,15 @@ openslES_CreatePCMRecorder(_THIS) } /* this callback handler is called every time a buffer finishes playing */ -static void -bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) +static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context) { - struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *) context; + struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *)context; LOGV("SLES: Playback Callback"); SDL_SemPost(audiodata->playsem); } -static void -openslES_DestroyPCMPlayer(_THIS) +static void openslES_DestroyPCMPlayer(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLresult result; @@ -405,8 +399,7 @@ openslES_DestroyPCMPlayer(_THIS) } } -static int -openslES_CreatePCMPlayer(_THIS) +static int openslES_CreatePCMPlayer(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLDataLocator_AndroidSimpleBufferQueue loc_bufq; @@ -420,43 +413,48 @@ openslES_CreatePCMPlayer(_THIS) SLresult result; int i; - /* If we want to add floating point audio support (requires API level 21) - it can be done as described here: - https://developer.android.com/ndk/guides/audio/opensl/android-extensions.html#floating-point - */ - if(SDL_GetAndroidSDKVersion() >= 21) { + /* according to https://developer.android.com/ndk/guides/audio/opensl/opensl-for-android, + Android's OpenSL ES only supports Uint8 and _littleendian_ Sint16. + (and float32, with an extension we use, below.) */ + if (SDL_GetAndroidSDKVersion() >= 21) { SDL_AudioFormat test_format; for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format; test_format = SDL_NextAudioFormat()) { - if (SDL_AUDIO_ISSIGNED(test_format)) { + switch (test_format) { + case AUDIO_U8: + case AUDIO_S16LSB: + case AUDIO_F32LSB: break; + default: + continue; } + break; } if (!test_format) { /* Didn't find a compatible format : */ - LOGI( "No compatible audio format, using signed 16-bit audio" ); - test_format = AUDIO_S16SYS; + LOGI("No compatible audio format, using signed 16-bit LE audio"); + test_format = AUDIO_S16LSB; } this->spec.format = test_format; } else { /* Just go with signed 16-bit audio as it's the most compatible */ - this->spec.format = AUDIO_S16SYS; + this->spec.format = AUDIO_S16LSB; } /* Update the fragment size as size in bytes */ SDL_CalculateAudioSpec(&this->spec); LOGI("Try to open %u hz %s %u bit chan %u %s samples %u", - this->spec.freq, SDL_AUDIO_ISFLOAT(this->spec.format) ? "float" : "pcm", SDL_AUDIO_BITSIZE(this->spec.format), - this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); + this->spec.freq, SDL_AUDIO_ISFLOAT(this->spec.format) ? "float" : "pcm", SDL_AUDIO_BITSIZE(this->spec.format), + this->spec.channels, (this->spec.format & 0x1000) ? "BE" : "LE", this->spec.samples); /* configure audio source */ loc_bufq.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE; loc_bufq.numBuffers = NUM_BUFFERS; - format_pcm.formatType = SL_DATAFORMAT_PCM; - format_pcm.numChannels = this->spec.channels; - format_pcm.samplesPerSec = this->spec.freq * 1000; /* / kilo Hz to milli Hz */ + format_pcm.formatType = SL_DATAFORMAT_PCM; + format_pcm.numChannels = this->spec.channels; + format_pcm.samplesPerSec = this->spec.freq * 1000; /* / kilo Hz to milli Hz */ format_pcm.bitsPerSample = SDL_AUDIO_BITSIZE(this->spec.format); format_pcm.containerSize = SDL_AUDIO_BITSIZE(this->spec.format); @@ -466,8 +464,7 @@ openslES_CreatePCMPlayer(_THIS) format_pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; } - switch (this->spec.channels) - { + switch (this->spec.channels) { case 1: format_pcm.channelMask = SL_SPEAKER_FRONT_LEFT; break; @@ -499,7 +496,7 @@ openslES_CreatePCMPlayer(_THIS) break; } - if(SDL_AUDIO_ISFLOAT(this->spec.format)) { + if (SDL_AUDIO_ISFLOAT(this->spec.format)) { /* Copy all setup into PCM EX structure */ format_pcm_ex.formatType = SL_ANDROID_DATAFORMAT_PCM_EX; format_pcm_ex.endianness = format_pcm.endianness; @@ -512,7 +509,7 @@ openslES_CreatePCMPlayer(_THIS) } audioSrc.pLocator = &loc_bufq; - audioSrc.pFormat = SDL_AUDIO_ISFLOAT(this->spec.format) ? (void*)&format_pcm_ex : (void*)&format_pcm; + audioSrc.pFormat = SDL_AUDIO_ISFLOAT(this->spec.format) ? (void *)&format_pcm_ex : (void *)&format_pcm; /* configure audio sink */ loc_outmix.locatorType = SL_DATALOCATOR_OUTPUTMIX; @@ -573,8 +570,8 @@ openslES_CreatePCMPlayer(_THIS) } /* Create the sound buffers */ - audiodata->mixbuff = (Uint8 *) SDL_malloc(NUM_BUFFERS * this->spec.size); - if (audiodata->mixbuff == NULL) { + audiodata->mixbuff = (Uint8 *)SDL_malloc(NUM_BUFFERS * this->spec.size); + if (!audiodata->mixbuff) { LOGE("mixbuffer allocate - out of memory"); goto failed; } @@ -596,11 +593,10 @@ openslES_CreatePCMPlayer(_THIS) return -1; } -static int -openslES_OpenDevice(_THIS, const char *devname) +static int openslES_OpenDevice(_THIS, const char *devname) { - this->hidden = (struct SDL_PrivateAudioData *) SDL_calloc(1, (sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_calloc(1, sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } @@ -625,12 +621,10 @@ openslES_OpenDevice(_THIS, const char *devname) } else { return SDL_SetError("Open device failed!"); } - } } -static void -openslES_WaitDevice(_THIS) +static void openslES_WaitDevice(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; @@ -640,8 +634,7 @@ openslES_WaitDevice(_THIS) SDL_SemWait(audiodata->playsem); } -static void -openslES_PlayDevice(_THIS) +static void openslES_PlayDevice(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLresult result; @@ -675,8 +668,7 @@ openslES_PlayDevice(_THIS) /* */ /* okay.. */ -static Uint8 * -openslES_GetDeviceBuf(_THIS) +static Uint8 *openslES_GetDeviceBuf(_THIS) { struct SDL_PrivateAudioData *audiodata = this->hidden; @@ -684,8 +676,7 @@ openslES_GetDeviceBuf(_THIS) return audiodata->pmixbuff[audiodata->next_buffer]; } -static int -openslES_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int openslES_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *audiodata = this->hidden; SLresult result; @@ -712,8 +703,7 @@ openslES_CaptureFromDevice(_THIS, void *buffer, int buflen) return this->spec.size; } -static void -openslES_CloseDevice(_THIS) +static void openslES_CloseDevice(_THIS) { /* struct SDL_PrivateAudioData *audiodata = this->hidden; */ @@ -728,8 +718,7 @@ openslES_CloseDevice(_THIS) SDL_free(this->hidden); } -static SDL_bool -openslES_Init(SDL_AudioDriverImpl * impl) +static SDL_bool openslES_Init(SDL_AudioDriverImpl *impl) { LOGI("openslES_Init() called"); @@ -741,13 +730,13 @@ openslES_Init(SDL_AudioDriverImpl * impl) /* Set the function pointers */ /* impl->DetectDevices = openslES_DetectDevices; */ - impl->OpenDevice = openslES_OpenDevice; - impl->WaitDevice = openslES_WaitDevice; - impl->PlayDevice = openslES_PlayDevice; - impl->GetDeviceBuf = openslES_GetDeviceBuf; + impl->OpenDevice = openslES_OpenDevice; + impl->WaitDevice = openslES_WaitDevice; + impl->PlayDevice = openslES_PlayDevice; + impl->GetDeviceBuf = openslES_GetDeviceBuf; impl->CaptureFromDevice = openslES_CaptureFromDevice; - impl->CloseDevice = openslES_CloseDevice; - impl->Deinitialize = openslES_DestroyEngine; + impl->CloseDevice = openslES_CloseDevice; + impl->Deinitialize = openslES_DestroyEngine; /* and the capabilities */ impl->HasCaptureSupport = SDL_TRUE; diff --git a/src/audio/openslES/SDL_openslES.h b/src/audio/openslES/SDL_openslES.h index 10ff588a1da48..1f84b84b61c19 100644 --- a/src/audio/openslES/SDL_openslES.h +++ b/src/audio/openslES/SDL_openslES.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,15 +26,15 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this -#define NUM_BUFFERS 2 /* -- Don't lower this! */ +#define NUM_BUFFERS 2 /* -- Don't lower this! */ struct SDL_PrivateAudioData { - Uint8 *mixbuff; - int next_buffer; - Uint8 *pmixbuff[NUM_BUFFERS]; + Uint8 *mixbuff; + int next_buffer; + Uint8 *pmixbuff[NUM_BUFFERS]; SDL_sem *playsem; }; diff --git a/src/audio/os2/SDL_os2audio.c b/src/audio/os2/SDL_os2audio.c index 9ddfb76079329..3657e530bd285 100644 --- a/src/audio/os2/SDL_os2audio.c +++ b/src/audio/os2/SDL_os2audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_OS2 +#ifdef SDL_AUDIO_DRIVER_OS2 /* Allow access to a raw mixing buffer */ @@ -30,17 +30,12 @@ #include "../SDL_audio_c.h" #include "SDL_os2audio.h" -/* -void lockIncr(volatile int *piVal); -#pragma aux lockIncr = \ - "lock add [eax], 1 "\ - parm [eax]; - -void lockDecr(volatile int *piVal); -#pragma aux lockDecr = \ - "lock sub [eax], 1 "\ - parm [eax]; -*/ +static PMCI_MIX_BUFFER _getNextBuffer(SDL_PrivateAudioData *pAData, PMCI_MIX_BUFFER pBuffer) +{ + PMCI_MIX_BUFFER pFirstBuffer = &pAData->aMixBuffers[0]; + PMCI_MIX_BUFFER pLastBuffer = &pAData->aMixBuffers[pAData->cMixBuffers -1]; + return (pBuffer == pLastBuffer ? pFirstBuffer : pBuffer+1); +} static ULONG _getEnvULong(const char *name, ULONG ulMax, ULONG ulDefault) { @@ -48,7 +43,7 @@ static ULONG _getEnvULong(const char *name, ULONG ulMax, ULONG ulDefault) char* end; char* envval = SDL_getenv(name); - if (envval == NULL) + if (!envval) return ulDefault; ulValue = SDL_strtoul(envval, &end, 10); @@ -64,7 +59,7 @@ static int _MCIError(const char *func, ULONG ulResult) static void _mixIOError(const char *function, ULONG ulRC) { - debug_os2("%s() - failed, rc = 0x%X (%s)", + debug_os2("%s() - failed, rc = 0x%lX (%s)", function, ulRC, (ulRC == MCIERR_INVALID_MODE) ? "Mixer mode does not match request" : (ulRC == MCIERR_INVALID_BUFFER) ? "Caller sent an invalid buffer" : "unknown"); @@ -73,18 +68,33 @@ static void _mixIOError(const char *function, ULONG ulRC) static LONG APIENTRY cbAudioWriteEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags) { - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)pBuffer->ulUserParm; + SDL_AudioDevice *_this = (SDL_AudioDevice *)pBuffer->ulUserParm; + SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; ULONG ulRC; + debug_os2("cbAudioWriteEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %#lX",ulStatus,pBuffer,ulFlags); + + if (pAData->ulState == 2) + { + return 0; + } + if (ulFlags != MIX_WRITE_COMPLETE) { - debug_os2("flags = 0x%X", ulFlags); + debug_os2("flags = 0x%lX", ulFlags); + return 0; + } + + pAData->pDrainBuffer = pBuffer; + ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, + pAData->pDrainBuffer, 1); + if (ulRC != MCIERR_SUCCESS) { + _mixIOError("pmixWrite", ulRC); return 0; } - /*lockDecr((int *)&pAData->ulQueuedBuf);*/ ulRC = DosPostEventSem(pAData->hevBuf); if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) { - debug_os2("DosPostEventSem(), rc = %u", ulRC); + debug_os2("DosPostEventSem(), rc = %lu", ulRC); } return 1; /* return value doesn't seem to matter. */ @@ -93,19 +103,36 @@ static LONG APIENTRY cbAudioWriteEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, static LONG APIENTRY cbAudioReadEvent(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags) { - SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)pBuffer->ulUserParm; + SDL_AudioDevice *_this = (SDL_AudioDevice *)pBuffer->ulUserParm; + SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; ULONG ulRC; + debug_os2("cbAudioReadEvent: ulStatus = %lu, pBuffer = %p, ulFlags = %#lX",ulStatus,pBuffer,ulFlags); + + if (pAData->ulState == 2) + { + return 0; + } + if (ulFlags != MIX_READ_COMPLETE) { - debug_os2("flags = 0x%X", ulFlags); + debug_os2("flags = 0x%lX", ulFlags); return 0; } - pAData->stMCIMixSetup.pmixRead(pAData->stMCIMixSetup.ulMixHandle, pBuffer, 1); + pAData->pFillBuffer = pBuffer; + if (pAData->pFillBuffer == pAData->aMixBuffers) + { + ulRC = pAData->stMCIMixSetup.pmixRead(pAData->stMCIMixSetup.ulMixHandle, + pAData->pFillBuffer, pAData->cMixBuffers); + if (ulRC != MCIERR_SUCCESS) { + _mixIOError("pmixRead", ulRC); + return 0; + } + } ulRC = DosPostEventSem(pAData->hevBuf); if (ulRC != NO_ERROR && ulRC != ERROR_ALREADY_POSTED) { - debug_os2("DosPostEventSem(), rc = %u", ulRC); + debug_os2("DosPostEventSem(), rc = %lu", ulRC); } return 1; @@ -120,31 +147,36 @@ static void OS2_DetectDevices(void) MCI_SYSINFO_LOGDEVICE stLogDevice; MCI_SYSINFO_PARMS stSysInfoParams; ULONG ulRC; - ULONG ulHandle = 0; + ULONG ulNumber; + MCI_GETDEVCAPS_PARMS stDevCapsParams; + MCI_OPEN_PARMS stMCIOpen; + MCI_GENERIC_PARMS stMCIGenericParams; + SDL_memset(&stMCISysInfo, 0, sizeof(stMCISysInfo)); acBuf[0] = '\0'; stMCISysInfo.pszReturn = acBuf; stMCISysInfo.ulRetSize = sizeof(acBuf); stMCISysInfo.usDeviceType = MCI_DEVTYPE_AUDIO_AMPMIX; ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_QUANTITY, &stMCISysInfo, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_QUANTITY - failed, rc = 0x%X", ulRC); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_SYSINFO, MCI_SYSINFO_QUANTITY - failed, rc = 0x%hX", LOUSHORT(ulRC)); return; } ulDevicesNum = SDL_strtoul(stMCISysInfo.pszReturn, NULL, 10); - for (stSysInfoParams.ulNumber = 0; stSysInfoParams.ulNumber < ulDevicesNum; - stSysInfoParams.ulNumber++) { + for (ulNumber = 1; ulNumber <= ulDevicesNum; + ulNumber++) { /* Get device install name. */ + stSysInfoParams.ulNumber = ulNumber; stSysInfoParams.pszReturn = acBuf; stSysInfoParams.ulRetSize = sizeof(acBuf); stSysInfoParams.usDeviceType = MCI_DEVTYPE_AUDIO_AMPMIX; ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_INSTALLNAME, &stSysInfoParams, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_INSTALLNAME - failed, rc = 0x%X", ulRC); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_SYSINFO, MCI_SYSINFO_INSTALLNAME - failed, rc = 0x%hX", LOUSHORT(ulRC)); continue; } @@ -154,15 +186,45 @@ static void OS2_DetectDevices(void) SDL_strlcpy(stLogDevice.szInstallName, stSysInfoParams.pszReturn, MAX_DEVICE_NAME); ulRC = mciSendCommand(0, MCI_SYSINFO, MCI_WAIT | MCI_SYSINFO_ITEM, &stSysInfoParams, 0); - if (ulRC != NO_ERROR) { - debug_os2("MCI_SYSINFO, MCI_SYSINFO_ITEM - failed, rc = 0x%X", ulRC); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_SYSINFO, MCI_SYSINFO_ITEM - failed, rc = 0x%hX", LOUSHORT(ulRC)); continue; } - ulHandle++; - SDL_AddAudioDevice(0, stLogDevice.szProductInfo, NULL, (void *)(ulHandle)); - ulHandle++; - SDL_AddAudioDevice(1, stLogDevice.szProductInfo, NULL, (void *)(ulHandle)); + SDL_AddAudioDevice(0, stLogDevice.szProductInfo, NULL, (void *)ulNumber); + + /* Open audio device for querying its capabilities */ + /* at this point we HAVE TO OPEN the waveaudio device and not the ampmix device */ + /* because only the waveaudio device (tied to the ampmix device) supports querying for playback/record capability */ + SDL_memset(&stMCIOpen, 0, sizeof(stMCIOpen)); + stMCIOpen.pszDeviceType = (PSZ)MAKEULONG(MCI_DEVTYPE_WAVEFORM_AUDIO,LOUSHORT(ulNumber)); + ulRC = mciSendCommand(0, MCI_OPEN,MCI_WAIT | MCI_OPEN_TYPE_ID | MCI_OPEN_SHAREABLE,&stMCIOpen, 0); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_OPEN (getDevCaps) - failed"); + continue; + } + + /* check for recording capability */ + SDL_memset(&stDevCapsParams, 0, sizeof(stDevCapsParams)); + stDevCapsParams.ulItem = MCI_GETDEVCAPS_CAN_RECORD; + ulRC = mciSendCommand(stMCIOpen.usDeviceID, MCI_GETDEVCAPS, MCI_WAIT | MCI_GETDEVCAPS_ITEM, + &stDevCapsParams, 0); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_GETDEVCAPS, MCI_GETDEVCAPS_ITEM - failed, rc = 0x%hX", LOUSHORT(ulRC)); + } + else { + if (stDevCapsParams.ulReturn) { + SDL_AddAudioDevice(1, stLogDevice.szProductInfo, NULL, (void *)(ulNumber | 0x80000000)); + } + } + + /* close the audio device, we are done querying its capabilities */ + SDL_memset(&stMCIGenericParams, 0, sizeof(stMCIGenericParams)); + ulRC = mciSendCommand(stMCIOpen.usDeviceID, MCI_CLOSE, MCI_WAIT, + &stMCIGenericParams, 0); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_CLOSE (getDevCaps) - failed"); + } } } @@ -171,52 +233,145 @@ static void OS2_WaitDevice(_THIS) SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; ULONG ulRC; + debug_os2("Enter"); + /* Wait for an audio chunk to finish */ ulRC = DosWaitEventSem(pAData->hevBuf, 5000); if (ulRC != NO_ERROR) { - debug_os2("DosWaitEventSem(), rc = %u", ulRC); + debug_os2("DosWaitEventSem(), rc = %lu", ulRC); } } static Uint8 *OS2_GetDeviceBuf(_THIS) { SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; - return (Uint8 *) pAData->aMixBuffers[pAData->ulNextBuf].pBuffer; + + debug_os2("Enter"); + + return (Uint8 *) pAData->pFillBuffer->pBuffer; } static void OS2_PlayDevice(_THIS) { SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; ULONG ulRC; - PMCI_MIX_BUFFER pMixBuffer = &pAData->aMixBuffers[pAData->ulNextBuf]; + PMCI_MIX_BUFFER pMixBuffer = NULL; + + debug_os2("Enter"); + + pMixBuffer = pAData->pDrainBuffer; + pAData->pFillBuffer = _getNextBuffer(pAData, pAData->pFillBuffer); + if (!pAData->ulState && pAData->pFillBuffer != pMixBuffer) + { + /* + * this buffer was filled but we have not yet filled all buffers + * so just signal event sem so that OS2_WaitDevice does not need + * to block + */ + ulRC = DosPostEventSem(pAData->hevBuf); + } - /* Queue it up */ - /*lockIncr((int *)&pAData->ulQueuedBuf);*/ - ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, - pMixBuffer, 1); - if (ulRC != MCIERR_SUCCESS) { - _mixIOError("pmixWrite", ulRC); - } else { - pAData->ulNextBuf = (pAData->ulNextBuf + 1) % pAData->cMixBuffers; + if (!pAData->ulState && (pAData->pFillBuffer == pMixBuffer) ) + { + debug_os2("!hasStarted"); + pAData->ulState = 1; + + /* Write buffers to kick off the amp mixer */ + ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, + pMixBuffer, pAData->cMixBuffers); + + if (ulRC != MCIERR_SUCCESS) { + _mixIOError("pmixWrite", ulRC); + } } } +static int OS2_CaptureFromDevice(_THIS,void *buffer,int buflen) +{ + SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; + ULONG ulRC; + PMCI_MIX_BUFFER pMixBuffer = NULL; + int len = 0; + + if (!pAData->ulState) + { + pAData->ulState = 1; + ulRC = pAData->stMCIMixSetup.pmixRead(pAData->stMCIMixSetup.ulMixHandle, + pAData->aMixBuffers, pAData->cMixBuffers); + if (ulRC != MCIERR_SUCCESS) { + _mixIOError("pmixRead", ulRC); + return -1; + } + } + + /* Wait for an audio chunk to finish */ + ulRC = DosWaitEventSem(pAData->hevBuf, 5000); + if (ulRC != NO_ERROR) + { + debug_os2("DosWaitEventSem(), rc = %lu", ulRC); + return -1; + } + + pMixBuffer = pAData->pDrainBuffer; + len = SDL_min((int)pMixBuffer->ulBufferLength, buflen); + SDL_memcpy(buffer,pMixBuffer->pBuffer, len); + pAData->pDrainBuffer = _getNextBuffer(pAData, pMixBuffer); + + debug_os2("buflen = %u, ulBufferLength = %lu",buflen,pMixBuffer->ulBufferLength); + + return len; +} + +static void OS2_FlushCapture(_THIS) +{ + SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; + ULONG ulIdx; + + debug_os2("Enter"); + + /* Fill all device buffers with data */ + for (ulIdx = 0; ulIdx < pAData->cMixBuffers; ulIdx++) { + pAData->aMixBuffers[ulIdx].ulFlags = 0; + pAData->aMixBuffers[ulIdx].ulBufferLength = _this->spec.size; + pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)_this; + + SDL_memset(((PMCI_MIX_BUFFER)pAData->aMixBuffers)[ulIdx].pBuffer, + _this->spec.silence, _this->spec.size); + } + pAData->pFillBuffer = pAData->aMixBuffers; + pAData->pDrainBuffer = pAData->aMixBuffers; +} + + static void OS2_CloseDevice(_THIS) { SDL_PrivateAudioData *pAData = (SDL_PrivateAudioData *)_this->hidden; MCI_GENERIC_PARMS sMCIGenericParms; ULONG ulRC; - if (pAData == NULL) + debug_os2("Enter"); + + if (!pAData) return; + pAData->ulState = 2; + /* Close up audio */ if (pAData->usDeviceId != (USHORT)~0) { /* Device is open. */ + SDL_zero(sMCIGenericParms); + + ulRC = mciSendCommand(pAData->usDeviceId, MCI_STOP, + MCI_WAIT, + &sMCIGenericParms, 0); + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + debug_os2("MCI_STOP - failed" ); + } + if (pAData->stMCIMixSetup.ulBitsPerSample != 0) { /* Mixer was initialized. */ ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, MCI_WAIT | MCI_MIXSETUP_DEINIT, &pAData->stMCIMixSetup, 0); - if (ulRC != MCIERR_SUCCESS) { + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { debug_os2("MCI_MIXSETUP, MCI_MIXSETUP_DEINIT - failed"); } } @@ -230,14 +385,14 @@ static void OS2_CloseDevice(_THIS) ulRC = mciSendCommand(pAData->usDeviceId, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &stMCIBuffer, 0); - if (ulRC != MCIERR_SUCCESS) { + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { debug_os2("MCI_BUFFER, MCI_DEALLOCATE_MEMORY - failed"); } } ulRC = mciSendCommand(pAData->usDeviceId, MCI_CLOSE, MCI_WAIT, &sMCIGenericParms, 0); - if (ulRC != MCIERR_SUCCESS) { + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { debug_os2("MCI_CLOSE - failed"); } } @@ -257,6 +412,7 @@ static int OS2_OpenDevice(_THIS, const char *devname) ULONG ulRC; ULONG ulIdx; BOOL new_freq; + ULONG ulHandle = (ULONG)_this->handle; SDL_bool iscapture = _this->iscapture; new_freq = FALSE; @@ -273,26 +429,27 @@ static int OS2_OpenDevice(_THIS, const char *devname) } pAData = (SDL_PrivateAudioData *) SDL_calloc(1, sizeof(struct SDL_PrivateAudioData)); - if (pAData == NULL) + if (!pAData) return SDL_OutOfMemory(); _this->hidden = pAData; ulRC = DosCreateEventSem(NULL, &pAData->hevBuf, DCE_AUTORESET, TRUE); if (ulRC != NO_ERROR) { - debug_os2("DosCreateEventSem() failed, rc = %u", ulRC); + debug_os2("DosCreateEventSem() failed, rc = %lu", ulRC); return -1; } /* Open audio device */ - stMCIAmpOpen.usDeviceID = (_this->handle != NULL) ? ((ULONG)_this->handle - 1) : 0; - stMCIAmpOpen.pszDeviceType = (PSZ)MCI_DEVTYPE_AUDIO_AMPMIX; + stMCIAmpOpen.usDeviceID = 0; + stMCIAmpOpen.pszDeviceType = (PSZ)MAKEULONG(MCI_DEVTYPE_AUDIO_AMPMIX,LOUSHORT(ulHandle)); ulRC = mciSendCommand(0, MCI_OPEN, (_getEnvULong("SDL_AUDIO_SHARE", 1, 0) != 0)? MCI_WAIT | MCI_OPEN_TYPE_ID | MCI_OPEN_SHAREABLE : MCI_WAIT | MCI_OPEN_TYPE_ID, &stMCIAmpOpen, 0); - if (ulRC != MCIERR_SUCCESS) { - stMCIAmpOpen.usDeviceID = (USHORT)~0; + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { + DosCloseEventSem(pAData->hevBuf); + pAData->usDeviceId = (USHORT)~0; return _MCIError("MCI_OPEN", ulRC); } pAData->usDeviceId = stMCIAmpOpen.usDeviceID; @@ -355,7 +512,7 @@ static int OS2_OpenDevice(_THIS, const char *devname) ulRC = mciSendCommand(pAData->usDeviceId, MCI_MIXSETUP, MCI_WAIT | MCI_MIXSETUP_INIT, &pAData->stMCIMixSetup, 0); - if (ulRC != MCIERR_SUCCESS && _this->spec.freq > 44100) { + if (LOUSHORT(ulRC) != MCIERR_SUCCESS && _this->spec.freq > 44100) { new_freq = TRUE; pAData->stMCIMixSetup.ulSamplesPerSec = 44100; _this->spec.freq = 44100; @@ -363,7 +520,7 @@ static int OS2_OpenDevice(_THIS, const char *devname) MCI_WAIT | MCI_MIXSETUP_INIT, &pAData->stMCIMixSetup, 0); } - debug_os2("Setup mixer [BPS: %u, Freq.: %u, Channels: %u]: %s", + debug_os2("Setup mixer [BPS: %lu, Freq.: %lu, Channels: %lu]: %s", pAData->stMCIMixSetup.ulBitsPerSample, pAData->stMCIMixSetup.ulSamplesPerSec, pAData->stMCIMixSetup.ulChannels, @@ -394,29 +551,25 @@ static int OS2_OpenDevice(_THIS, const char *devname) ulRC = mciSendCommand(pAData->usDeviceId, MCI_BUFFER, MCI_WAIT | MCI_ALLOCATE_MEMORY, &stMCIBuffer, 0); - if (ulRC != MCIERR_SUCCESS) { + if (LOUSHORT(ulRC) != MCIERR_SUCCESS) { return _MCIError("MCI_BUFFER", ulRC); } pAData->cMixBuffers = stMCIBuffer.ulNumBuffers; _this->spec.size = stMCIBuffer.ulBufferSize; + debug_os2("%s, number of mix buffers: %lu",iscapture ? "capture": "play",pAData->cMixBuffers); + /* Fill all device buffers with data */ for (ulIdx = 0; ulIdx < stMCIBuffer.ulNumBuffers; ulIdx++) { pAData->aMixBuffers[ulIdx].ulFlags = 0; pAData->aMixBuffers[ulIdx].ulBufferLength = stMCIBuffer.ulBufferSize; - pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)pAData; + pAData->aMixBuffers[ulIdx].ulUserParm = (ULONG)_this; SDL_memset(((PMCI_MIX_BUFFER)stMCIBuffer.pBufList)[ulIdx].pBuffer, _this->spec.silence, stMCIBuffer.ulBufferSize); } - - /* Write buffers to kick off the amp mixer */ - ulRC = pAData->stMCIMixSetup.pmixWrite(pAData->stMCIMixSetup.ulMixHandle, - pAData->aMixBuffers, 1); - if (ulRC != MCIERR_SUCCESS) { - _mixIOError("pmixWrite", ulRC); - return -1; - } + pAData->pFillBuffer = pAData->aMixBuffers; + pAData->pDrainBuffer = pAData->aMixBuffers; return 0; } @@ -431,12 +584,10 @@ static SDL_bool OS2_Init(SDL_AudioDriverImpl * impl) impl->WaitDevice = OS2_WaitDevice; impl->GetDeviceBuf = OS2_GetDeviceBuf; impl->CloseDevice = OS2_CloseDevice; - - /* TODO: IMPLEMENT CAPTURE SUPPORT: - impl->CaptureFromDevice = ; - impl->FlushCapture = ; + impl->CaptureFromDevice = OS2_CaptureFromDevice ; + impl->FlushCapture = OS2_FlushCapture; impl->HasCaptureSupport = SDL_TRUE; - */ + return SDL_TRUE; /* this audio target is available. */ } diff --git a/src/audio/os2/SDL_os2audio.h b/src/audio/os2/SDL_os2audio.h index 07ebbae39967a..7aa8efb8c0010 100644 --- a/src/audio/os2/SDL_os2audio.h +++ b/src/audio/os2/SDL_os2audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,10 +43,11 @@ typedef struct SDL_PrivateAudioData BYTE _pad[2]; MCI_MIXSETUP_PARMS stMCIMixSetup; HEV hevBuf; - ULONG ulNextBuf; + PMCI_MIX_BUFFER pFillBuffer; + PMCI_MIX_BUFFER pDrainBuffer; + ULONG ulState; ULONG cMixBuffers; MCI_MIX_BUFFER aMixBuffers[NUM_BUFFERS]; -/* ULONG ulQueuedBuf;*/ } SDL_PrivateAudioData; #endif /* SDL_os2mm_h_ */ diff --git a/src/audio/paudio/SDL_paudio.c b/src/audio/paudio/SDL_paudio.c index c77db085ab920..1d954dd5133b6 100644 --- a/src/audio/paudio/SDL_paudio.c +++ b/src/audio/paudio/SDL_paudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_PAUDIO +#ifdef SDL_AUDIO_DRIVER_PAUDIO /* Allow access to a raw mixing buffer */ @@ -69,8 +69,7 @@ static char devsettings[][3] = { {'\0', '\0', '\0'} }; -static int -OpenUserDefinedDevice(char *path, int maxlen, int flags) +static int OpenUserDefinedDevice(char *path, int maxlen, int flags) { const char *audiodev; int fd; @@ -79,19 +78,18 @@ OpenUserDefinedDevice(char *path, int maxlen, int flags) if ((audiodev = SDL_getenv("SDL_PATH_DSP")) == NULL) { audiodev = SDL_getenv("AUDIODEV"); } - if (audiodev == NULL) { + if (!audiodev) { return -1; } fd = open(audiodev, flags, 0); - if (path != NULL) { + if (path) { SDL_strlcpy(path, audiodev, maxlen); path[maxlen - 1] = '\0'; } return fd; } -static int -OpenAudioPath(char *path, int maxlen, int flags, int classic) +static int OpenAudioPath(char *path, int maxlen, int flags, int classic) { struct stat sb; int cycle = 0; @@ -112,7 +110,7 @@ OpenAudioPath(char *path, int maxlen, int flags, int classic) if (stat(audiopath, &sb) == 0) { fd = open(audiopath, flags, 0); if (fd >= 0) { - if (path != NULL) { + if (path) { SDL_strlcpy(path, audiopath, maxlen); } return fd; @@ -123,8 +121,7 @@ OpenAudioPath(char *path, int maxlen, int flags, int classic) } /* This function waits until it is possible to write a full sound buffer */ -static void -PAUDIO_WaitDevice(_THIS) +static void PAUDIO_WaitDevice(_THIS) { fd_set fdset; @@ -176,8 +173,7 @@ PAUDIO_WaitDevice(_THIS) } } -static void -PAUDIO_PlayDevice(_THIS) +static void PAUDIO_PlayDevice(_THIS) { int written = 0; const Uint8 *mixbuf = this->hidden->mixbuf; @@ -206,14 +202,12 @@ PAUDIO_PlayDevice(_THIS) #endif } -static Uint8 * -PAUDIO_GetDeviceBuf(_THIS) +static Uint8 *PAUDIO_GetDeviceBuf(_THIS) { return this->hidden->mixbuf; } -static void -PAUDIO_CloseDevice(_THIS) +static void PAUDIO_CloseDevice(_THIS) { if (this->hidden->audio_fd >= 0) { close(this->hidden->audio_fd); @@ -222,8 +216,7 @@ PAUDIO_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -PAUDIO_OpenDevice(_THIS, const char *devname) +static int PAUDIO_OpenDevice(_THIS, const char *devname) { const char *workaround = SDL_getenv("SDL_DSP_NOSELECT"); char audiodev[1024]; @@ -238,9 +231,8 @@ PAUDIO_OpenDevice(_THIS, const char *devname) int fd = -1; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -411,7 +403,7 @@ PAUDIO_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -453,7 +445,7 @@ PAUDIO_OpenDevice(_THIS, const char *devname) } /* Check to see if we need to use SDL_IOReady() workaround */ - if (workaround != NULL) { + if (workaround) { this->hidden->frame_ticks = (float) (this->spec.samples * 1000) / this->spec.freq; this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; @@ -463,8 +455,7 @@ PAUDIO_OpenDevice(_THIS, const char *devname) return 0; } -static SDL_bool -PAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool PAUDIO_Init(SDL_AudioDriverImpl * impl) { /* !!! FIXME: not right for device enum? */ int fd = OpenAudioPath(NULL, 0, OPEN_FLAGS, 0); diff --git a/src/audio/paudio/SDL_paudio.h b/src/audio/paudio/SDL_paudio.h index 1746a88eec57e..d1f8928cfbc88 100644 --- a/src/audio/paudio/SDL_paudio.h +++ b/src/audio/paudio/SDL_paudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c index 2e173ef9afd27..8b0772bc9e77c 100644 --- a/src/audio/pipewire/SDL_pipewire.c +++ b/src/audio/pipewire/SDL_pipewire.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #include "../../SDL_internal.h" #include "SDL_hints.h" -#if SDL_AUDIO_DRIVER_PIPEWIRE +#ifdef SDL_AUDIO_DRIVER_PIPEWIRE #include "SDL_audio.h" #include "SDL_loadso.h" @@ -77,7 +77,7 @@ enum PW_READY_FLAGS { PW_READY_FLAG_BUFFER_ADDED = 0x1, PW_READY_FLAG_STREAM_READY = 0x2, - PW_READY_FLAG_ALL_BITS = 0x3 + PW_READY_FLAG_ALL_BITS = 0x3 }; #define PW_ID_TO_HANDLE(x) (void *)((uintptr_t)x) @@ -117,20 +117,19 @@ static struct pw_properties *(*PIPEWIRE_pw_properties_new)(const char *, ...)SPA static int (*PIPEWIRE_pw_properties_set)(struct pw_properties *, const char *, const char *); static int (*PIPEWIRE_pw_properties_setf)(struct pw_properties *, const char *, const char *, ...) SPA_PRINTF_FUNC(3, 4); -static int pipewire_version_major; -static int pipewire_version_minor; -static int pipewire_version_patch; +static int pipewire_version_major; +static int pipewire_version_minor; +static int pipewire_version_patch; #ifdef SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC static const char *pipewire_library = SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC; -static void *pipewire_handle = NULL; +static void *pipewire_handle = NULL; -static int -pipewire_dlsym(const char *fn, void **addr) +static int pipewire_dlsym(const char *fn, void **addr) { *addr = SDL_LoadFunction(pipewire_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return 0; } @@ -143,18 +142,13 @@ pipewire_dlsym(const char *fn, void **addr) return -1; \ } -static int -load_pipewire_library() +static int load_pipewire_library(void) { - if ((pipewire_handle = SDL_LoadObject(pipewire_library))) { - return 0; - } - - return -1; + pipewire_handle = SDL_LoadObject(pipewire_library); + return pipewire_handle ? 0 : -1; } -static void -unload_pipewire_library() +static void unload_pipewire_library(void) { if (pipewire_handle) { SDL_UnloadObject(pipewire_handle); @@ -166,21 +160,18 @@ unload_pipewire_library() #define SDL_PIPEWIRE_SYM(x) PIPEWIRE_##x = x -static int -load_pipewire_library() +static int load_pipewire_library(void) { return 0; } -static void -unload_pipewire_library() +static void unload_pipewire_library(void) { /* Nothing to do */ } #endif /* SDL_AUDIO_DRIVER_PIPEWIRE_DYNAMIC */ -static int -load_pipewire_syms() +static int load_pipewire_syms(void) { SDL_PIPEWIRE_SYM(pw_get_library_version); SDL_PIPEWIRE_SYM(pw_init); @@ -214,16 +205,14 @@ load_pipewire_syms() return 0; } -SDL_FORCE_INLINE SDL_bool -pipewire_version_at_least(int major, int minor, int patch) +SDL_FORCE_INLINE SDL_bool pipewire_version_at_least(int major, int minor, int patch) { return (pipewire_version_major >= major) && (pipewire_version_major > major || pipewire_version_minor >= minor) && (pipewire_version_major > major || pipewire_version_minor > minor || pipewire_version_patch >= patch); } -static int -init_pipewire_library() +static int init_pipewire_library(void) { if (!load_pipewire_library()) { if (!load_pipewire_syms()) { @@ -245,8 +234,7 @@ init_pipewire_library() return -1; } -static void -deinit_pipewire_library() +static void deinit_pipewire_library(void) { PIPEWIRE_pw_deinit(); unload_pipewire_library(); @@ -257,8 +245,8 @@ struct node_object { struct spa_list link; - Uint32 id; - int seq; + Uint32 id; + int seq; SDL_bool persist; /* @@ -271,8 +259,8 @@ struct node_object void *userdata; struct pw_proxy *proxy; - struct spa_hook node_listener; - struct spa_hook core_listener; + struct spa_hook node_listener; + struct spa_hook core_listener; }; /* A sink/source node used for stream I/O. */ @@ -280,8 +268,8 @@ struct io_node { struct spa_list link; - Uint32 id; - SDL_bool is_capture; + Uint32 id; + SDL_bool is_capture; SDL_AudioSpec spec; const char *name; /* Friendly name */ @@ -292,26 +280,25 @@ struct io_node /* The global hotplug thread and associated objects. */ static struct pw_thread_loop *hotplug_loop; -static struct pw_core *hotplug_core; -static struct pw_context *hotplug_context; -static struct pw_registry *hotplug_registry; -static struct spa_hook hotplug_registry_listener; -static struct spa_hook hotplug_core_listener; -static struct spa_list hotplug_pending_list; -static struct spa_list hotplug_io_list; -static int hotplug_init_seq_val; -static SDL_bool hotplug_init_complete; -static SDL_bool hotplug_events_enabled; - -static char *pipewire_default_sink_id = NULL; +static struct pw_core *hotplug_core; +static struct pw_context *hotplug_context; +static struct pw_registry *hotplug_registry; +static struct spa_hook hotplug_registry_listener; +static struct spa_hook hotplug_core_listener; +static struct spa_list hotplug_pending_list; +static struct spa_list hotplug_io_list; +static int hotplug_init_seq_val; +static SDL_bool hotplug_init_complete; +static SDL_bool hotplug_events_enabled; + +static char *pipewire_default_sink_id = NULL; static char *pipewire_default_source_id = NULL; /* The active node list */ -static SDL_bool -io_list_check_add(struct io_node *node) +static SDL_bool io_list_check_add(struct io_node *node) { struct io_node *n; - SDL_bool ret = SDL_TRUE; + SDL_bool ret = SDL_TRUE; /* See if the node is already in the list */ spa_list_for_each (n, &hotplug_io_list, link) { @@ -333,8 +320,7 @@ io_list_check_add(struct io_node *node) return ret; } -static void -io_list_remove(Uint32 id) +static void io_list_remove(Uint32 id) { struct io_node *n, *temp; @@ -354,18 +340,17 @@ io_list_remove(Uint32 id) } } -static void -io_list_sort() +static void io_list_sort(void) { struct io_node *default_sink = NULL, *default_source = NULL; struct io_node *n, *temp; /* Find and move the default nodes to the beginning of the list */ spa_list_for_each_safe (n, temp, &hotplug_io_list, link) { - if (pipewire_default_sink_id != NULL && SDL_strcmp(n->path, pipewire_default_sink_id) == 0) { + if (pipewire_default_sink_id && SDL_strcmp(n->path, pipewire_default_sink_id) == 0) { default_sink = n; spa_list_remove(&n->link); - } else if (pipewire_default_source_id != NULL && SDL_strcmp(n->path, pipewire_default_source_id) == 0) { + } else if (pipewire_default_source_id && SDL_strcmp(n->path, pipewire_default_source_id) == 0) { default_source = n; spa_list_remove(&n->link); } @@ -380,8 +365,7 @@ io_list_sort() } } -static void -io_list_clear() +static void io_list_clear(void) { struct io_node *n, *temp; @@ -391,8 +375,7 @@ io_list_clear() } } -static struct io_node* -io_list_get_by_id(Uint32 id) +static struct io_node *io_list_get_by_id(Uint32 id) { struct io_node *n, *temp; spa_list_for_each_safe (n, temp, &hotplug_io_list, link) { @@ -403,8 +386,7 @@ io_list_get_by_id(Uint32 id) return NULL; } -static struct io_node* -io_list_get_by_path(char *path) +static struct io_node *io_list_get_by_path(char *path) { struct io_node *n, *temp; spa_list_for_each_safe (n, temp, &hotplug_io_list, link) { @@ -415,10 +397,9 @@ io_list_get_by_path(char *path) return NULL; } -static void -node_object_destroy(struct node_object *node) +static void node_object_destroy(struct node_object *node) { - SDL_assert(node); + SDL_assert(node != NULL); spa_list_remove(&node->link); spa_hook_remove(&node->node_listener); @@ -428,15 +409,13 @@ node_object_destroy(struct node_object *node) } /* The pending node list */ -static void -pending_list_add(struct node_object *node) +static void pending_list_add(struct node_object *node) { - SDL_assert(node); + SDL_assert(node != NULL); spa_list_append(&hotplug_pending_list, &node->link); } -static void -pending_list_remove(Uint32 id) +static void pending_list_remove(Uint32 id) { struct node_object *node, *temp; @@ -447,8 +426,7 @@ pending_list_remove(Uint32 id) } } -static void -pending_list_clear() +static void pending_list_clear(void) { struct node_object *node, *temp; @@ -457,15 +435,14 @@ pending_list_clear() } } -static void * -node_object_new(Uint32 id, const char *type, Uint32 version, const void *funcs, const struct pw_core_events *core_events) +static void *node_object_new(Uint32 id, const char *type, Uint32 version, const void *funcs, const struct pw_core_events *core_events) { - struct pw_proxy *proxy; + struct pw_proxy *proxy; struct node_object *node; /* Create the proxy object */ proxy = pw_registry_bind(hotplug_registry, id, type, version, sizeof(struct node_object)); - if (proxy == NULL) { + if (!proxy) { SDL_SetError("Pipewire: Failed to create proxy object (%i)", errno); return NULL; } @@ -473,7 +450,7 @@ node_object_new(Uint32 id, const char *type, Uint32 version, const void *funcs, node = PIPEWIRE_pw_proxy_get_user_data(proxy); SDL_zerop(node); - node->id = id; + node->id = id; node->proxy = proxy; /* Add the callbacks */ @@ -487,8 +464,7 @@ node_object_new(Uint32 id, const char *type, Uint32 version, const void *funcs, } /* Core sync points */ -static void -core_events_hotplug_init_callback(void *object, uint32_t id, int seq) +static void core_events_hotplug_init_callback(void *object, uint32_t id, int seq) { if (id == PW_ID_CORE && seq == hotplug_init_seq_val) { /* This core listener is no longer needed. */ @@ -500,11 +476,10 @@ core_events_hotplug_init_callback(void *object, uint32_t id, int seq) } } -static void -core_events_interface_callback(void *object, uint32_t id, int seq) +static void core_events_interface_callback(void *object, uint32_t id, int seq) { struct node_object *node = object; - struct io_node *io = node->userdata; + struct io_node *io = node->userdata; if (id == PW_ID_CORE && seq == node->seq) { /* @@ -519,8 +494,7 @@ core_events_interface_callback(void *object, uint32_t id, int seq) } } -static void -core_events_metadata_callback(void *object, uint32_t id, int seq) +static void core_events_metadata_callback(void *object, uint32_t id, int seq) { struct node_object *node = object; @@ -530,11 +504,10 @@ core_events_metadata_callback(void *object, uint32_t id, int seq) } static const struct pw_core_events hotplug_init_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_hotplug_init_callback }; -static const struct pw_core_events interface_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_interface_callback }; -static const struct pw_core_events metadata_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_metadata_callback }; +static const struct pw_core_events interface_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_interface_callback }; +static const struct pw_core_events metadata_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_metadata_callback }; -static void -hotplug_core_sync(struct node_object *node) +static void hotplug_core_sync(struct node_object *node) { /* * Node sync events *must* come before the hotplug init sync events or the initial @@ -550,12 +523,11 @@ hotplug_core_sync(struct node_object *node) } /* Helpers for retrieving values from params */ -static SDL_bool -get_range_param(const struct spa_pod *param, Uint32 key, int *def, int *min, int *max) +static SDL_bool get_range_param(const struct spa_pod *param, Uint32 key, int *def, int *min, int *max) { const struct spa_pod_prop *prop; - struct spa_pod *value; - Uint32 n_values, choice; + struct spa_pod *value; + Uint32 n_values, choice; prop = spa_pod_find_prop(param, NULL, key); @@ -584,11 +556,10 @@ get_range_param(const struct spa_pod *param, Uint32 key, int *def, int *min, int return SDL_FALSE; } -static SDL_bool -get_int_param(const struct spa_pod *param, Uint32 key, int *val) +static SDL_bool get_int_param(const struct spa_pod *param, Uint32 key, int *val) { const struct spa_pod_prop *prop; - Sint32 v; + Sint32 v; prop = spa_pod_find_prop(param, NULL, key); @@ -603,14 +574,32 @@ get_int_param(const struct spa_pod *param, Uint32 key, int *val) return SDL_FALSE; } +static SDL_AudioFormat SPAFormatToSDL(enum spa_audio_format spafmt) +{ + switch (spafmt) { + #define CHECKFMT(spa,sdl) case SPA_AUDIO_FORMAT_##spa: return AUDIO_##sdl + CHECKFMT(U8, U8); + CHECKFMT(S8, S8); + CHECKFMT(S16_LE, S16LSB); + CHECKFMT(S16_BE, S16MSB); + CHECKFMT(S32_LE, S32LSB); + CHECKFMT(S32_BE, S32MSB); + CHECKFMT(F32_LE, F32LSB); + CHECKFMT(F32_BE, F32MSB); + #undef CHECKFMT + default: break; + } + + return 0; +} + /* Interface node callbacks */ -static void -node_event_info(void *object, const struct pw_node_info *info) +static void node_event_info(void *object, const struct pw_node_info *info) { struct node_object *node = object; - struct io_node *io = node->userdata; - const char *prop_val; - Uint32 i; + struct io_node *io = node->userdata; + const char *prop_val; + Uint32 i; if (info) { prop_val = spa_dict_lookup(info->props, PW_KEY_AUDIO_CHANNELS); @@ -620,18 +609,26 @@ node_event_info(void *object, const struct pw_node_info *info) /* Need to parse the parameters to get the sample rate */ for (i = 0; i < info->n_params; ++i) { - pw_node_enum_params(node->proxy, 0, info->params[i].id, 0, 0, NULL); + pw_node_enum_params((struct pw_node*)node->proxy, 0, info->params[i].id, 0, 0, NULL); } hotplug_core_sync(node); } } -static void -node_event_param(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param) +static void node_event_param(void *object, int seq, uint32_t id, uint32_t index, uint32_t next, const struct spa_pod *param) { struct node_object *node = object; - struct io_node *io = node->userdata; + struct io_node *io = node->userdata; + + if ((id == SPA_PARAM_Format) && (io->spec.format == 0)) { + struct spa_audio_info_raw info; + SDL_zero(info); + if (spa_format_audio_raw_parse(param, &info) == 0) { + /*SDL_Log("Sink Format: %d, Rate: %d Hz, Channels: %d", info.format, info.rate, info.channels);*/ + io->spec.format = SPAFormatToSDL(info.format); + } + } /* Get the default frequency */ if (io->spec.freq == 0) { @@ -653,8 +650,7 @@ node_event_param(void *object, int seq, uint32_t id, uint32_t index, uint32_t ne static const struct pw_node_events interface_node_events = { PW_VERSION_NODE_EVENTS, .info = node_event_info, .param = node_event_param }; -static char* -get_name_from_json(const char *json) +static char *get_name_from_json(const char *json) { struct spa_json parser[2]; char key[7]; /* "name" */ @@ -676,20 +672,19 @@ get_name_from_json(const char *json) } /* Metadata node callback */ -static int -metadata_property(void *object, Uint32 subject, const char *key, const char *type, const char *value) +static int metadata_property(void *object, Uint32 subject, const char *key, const char *type, const char *value) { struct node_object *node = object; - if (subject == PW_ID_CORE && key != NULL && value != NULL) { + if (subject == PW_ID_CORE && key && value) { if (!SDL_strcmp(key, "default.audio.sink")) { - if (pipewire_default_sink_id != NULL) { + if (pipewire_default_sink_id) { SDL_free(pipewire_default_sink_id); } pipewire_default_sink_id = get_name_from_json(value); node->persist = SDL_TRUE; } else if (!SDL_strcmp(key, "default.audio.source")) { - if (pipewire_default_source_id != NULL) { + if (pipewire_default_source_id) { SDL_free(pipewire_default_source_id); } pipewire_default_source_id = get_name_from_json(value); @@ -703,9 +698,8 @@ metadata_property(void *object, Uint32 subject, const char *key, const char *typ static const struct pw_metadata_events metadata_node_events = { PW_VERSION_METADATA_EVENTS, .property = metadata_property }; /* Global registry callbacks */ -static void -registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, const char *type, uint32_t version, - const struct spa_dict *props) +static void registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, const char *type, uint32_t version, + const struct spa_dict *props) { struct node_object *node; @@ -714,12 +708,12 @@ registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, const char *media_class = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS); if (media_class) { - const char *node_desc; - const char *node_path; + const char *node_desc; + const char *node_path; struct io_node *io; - SDL_bool is_capture; - int desc_buffer_len; - int path_buffer_len; + SDL_bool is_capture; + int desc_buffer_len; + int path_buffer_len; /* Just want sink and capture */ if (!SDL_strcasecmp(media_class, "Audio/Sink")) { @@ -735,7 +729,7 @@ registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, if (node_desc && node_path) { node = node_object_new(id, type, version, &interface_node_events, &interface_core_events); - if (node == NULL) { + if (!node) { SDL_SetError("Pipewire: Failed to allocate interface node"); return; } @@ -744,18 +738,20 @@ registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, desc_buffer_len = SDL_strlen(node_desc) + 1; path_buffer_len = SDL_strlen(node_path) + 1; node->userdata = io = SDL_calloc(1, sizeof(struct io_node) + desc_buffer_len + path_buffer_len); - if (io == NULL) { + if (!io) { node_object_destroy(node); SDL_OutOfMemory(); return; } /* Begin setting the node properties */ - io->id = id; - io->is_capture = is_capture; - io->spec.format = AUDIO_F32; /* Pipewire uses floats internally, other formats require conversion. */ - io->name = io->buf; - io->path = io->buf + desc_buffer_len; + io->id = id; + io->is_capture = is_capture; + if (io->spec.format == 0) { + io->spec.format = AUDIO_S16; /* we'll go conservative here if for some reason the format isn't known. */ + } + io->name = io->buf; + io->path = io->buf + desc_buffer_len; SDL_strlcpy(io->buf, node_desc, desc_buffer_len); SDL_strlcpy(io->buf + desc_buffer_len, node_path, path_buffer_len); @@ -765,7 +761,7 @@ registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, } } else if (!SDL_strcmp(type, PW_TYPE_INTERFACE_Metadata)) { node = node_object_new(id, type, version, &metadata_node_events, &metadata_core_events); - if (node == NULL) { + if (!node) { SDL_SetError("Pipewire: Failed to allocate metadata node"); return; } @@ -775,8 +771,7 @@ registry_event_global_callback(void *object, uint32_t id, uint32_t permissions, } } -static void -registry_event_remove_callback(void *object, uint32_t id) +static void registry_event_remove_callback(void *object, uint32_t id) { io_list_remove(id); pending_list_remove(id); @@ -786,8 +781,7 @@ static const struct pw_registry_events registry_events = { PW_VERSION_REGISTRY_E .global_remove = registry_event_remove_callback }; /* The hotplug thread */ -static int -hotplug_loop_init() +static int hotplug_loop_init(void) { int res; @@ -795,22 +789,22 @@ hotplug_loop_init() spa_list_init(&hotplug_io_list); hotplug_loop = PIPEWIRE_pw_thread_loop_new("SDLAudioHotplug", NULL); - if (hotplug_loop == NULL) { + if (!hotplug_loop) { return SDL_SetError("Pipewire: Failed to create hotplug detection loop (%i)", errno); } hotplug_context = PIPEWIRE_pw_context_new(PIPEWIRE_pw_thread_loop_get_loop(hotplug_loop), NULL, 0); - if (hotplug_context == NULL) { + if (!hotplug_context) { return SDL_SetError("Pipewire: Failed to create hotplug detection context (%i)", errno); } hotplug_core = PIPEWIRE_pw_context_connect(hotplug_context, NULL, 0); - if (hotplug_core == NULL) { + if (!hotplug_core) { return SDL_SetError("Pipewire: Failed to connect hotplug detection context (%i)", errno); } hotplug_registry = pw_core_get_registry(hotplug_core, PW_VERSION_REGISTRY, 0); - if (hotplug_registry == NULL) { + if (!hotplug_registry) { return SDL_SetError("Pipewire: Failed to acquire hotplug detection registry (%i)", errno); } @@ -830,8 +824,7 @@ hotplug_loop_init() return 0; } -static void -hotplug_loop_destroy() +static void hotplug_loop_destroy(void) { if (hotplug_loop) { PIPEWIRE_pw_thread_loop_stop(hotplug_loop); @@ -840,14 +833,14 @@ hotplug_loop_destroy() pending_list_clear(); io_list_clear(); - hotplug_init_complete = SDL_FALSE; + hotplug_init_complete = SDL_FALSE; hotplug_events_enabled = SDL_FALSE; - if (pipewire_default_sink_id != NULL) { + if (pipewire_default_sink_id) { SDL_free(pipewire_default_sink_id); pipewire_default_sink_id = NULL; } - if (pipewire_default_source_id != NULL) { + if (pipewire_default_source_id) { SDL_free(pipewire_default_source_id); pipewire_default_source_id = NULL; } @@ -873,8 +866,7 @@ hotplug_loop_destroy() } } -static void -PIPEWIRE_DetectDevices() +static void PIPEWIRE_DetectDevices(void) { struct io_node *io; @@ -916,11 +908,10 @@ static const enum spa_audio_channel PIPEWIRE_channel_map_8[] = { SPA_AUDIO_CHANN #define COPY_CHANNEL_MAP(c) SDL_memcpy(info->position, PIPEWIRE_channel_map_##c, sizeof(PIPEWIRE_channel_map_##c)) -static void -initialize_spa_info(const SDL_AudioSpec *spec, struct spa_audio_info_raw *info) +static void initialize_spa_info(const SDL_AudioSpec *spec, struct spa_audio_info_raw *info) { info->channels = spec->channels; - info->rate = spec->freq; + info->rate = spec->freq; switch (spec->channels) { case 1: @@ -984,14 +975,13 @@ initialize_spa_info(const SDL_AudioSpec *spec, struct spa_audio_info_raw *info) } } -static void -output_callback(void *data) +static void output_callback(void *data) { - struct pw_buffer *pw_buf; + struct pw_buffer *pw_buf; struct spa_buffer *spa_buf; - Uint8 *dst; + Uint8 *dst; - _THIS = (SDL_AudioDevice *)data; + _THIS = (SDL_AudioDevice *)data; struct pw_stream *stream = this->hidden->stream; /* Shutting down, don't do anything */ @@ -1000,7 +990,8 @@ output_callback(void *data) } /* See if a buffer is available */ - if ((pw_buf = PIPEWIRE_pw_stream_dequeue_buffer(stream)) == NULL) { + pw_buf = PIPEWIRE_pw_stream_dequeue_buffer(stream); + if (!pw_buf) { return; } @@ -1045,18 +1036,17 @@ output_callback(void *data) spa_buf->datas[0].chunk->offset = 0; spa_buf->datas[0].chunk->stride = this->hidden->stride; - spa_buf->datas[0].chunk->size = this->spec.size; + spa_buf->datas[0].chunk->size = this->spec.size; PIPEWIRE_pw_stream_queue_buffer(stream, pw_buf); } -static void -input_callback(void *data) +static void input_callback(void *data) { - struct pw_buffer *pw_buf; + struct pw_buffer *pw_buf; struct spa_buffer *spa_buf; - Uint8 *src; - _THIS = (SDL_AudioDevice *)data; + Uint8 *src; + _THIS = (SDL_AudioDevice *)data; struct pw_stream *stream = this->hidden->stream; /* Shutting down, don't do anything */ @@ -1070,15 +1060,15 @@ input_callback(void *data) } spa_buf = pw_buf->buffer; - - if ((src = (Uint8 *)spa_buf->datas[0].data) == NULL) { + (src = (Uint8 *)spa_buf->datas[0].data); + if (!src) { return; } if (!SDL_AtomicGet(&this->paused)) { /* Calculate the offset and data size */ const Uint32 offset = SPA_MIN(spa_buf->datas[0].chunk->offset, spa_buf->datas[0].maxsize); - const Uint32 size = SPA_MIN(spa_buf->datas[0].chunk->size, spa_buf->datas[0].maxsize - offset); + const Uint32 size = SPA_MIN(spa_buf->datas[0].chunk->size, spa_buf->datas[0].maxsize - offset); src += offset; @@ -1106,8 +1096,7 @@ input_callback(void *data) PIPEWIRE_pw_stream_queue_buffer(stream, pw_buf); } -static void -stream_add_buffer_callback(void *data, struct pw_buffer *buffer) +static void stream_add_buffer_callback(void *data, struct pw_buffer *buffer) { _THIS = data; @@ -1118,9 +1107,9 @@ stream_add_buffer_callback(void *data, struct pw_buffer *buffer) */ if (this->spec.size > buffer->buffer->datas[0].maxsize) { this->spec.samples = buffer->buffer->datas[0].maxsize / this->hidden->stride; - this->spec.size = buffer->buffer->datas[0].maxsize; + this->spec.size = buffer->buffer->datas[0].maxsize; } - } else if (this->hidden->buffer == NULL) { + } else if (!this->hidden->buffer) { /* * The latency of source nodes can change, so buffering is always required. * @@ -1130,15 +1119,14 @@ stream_add_buffer_callback(void *data, struct pw_buffer *buffer) * A packet size of 2 periods should be more than is ever needed. */ this->hidden->input_buffer_packet_size = SPA_MAX(this->spec.size, buffer->buffer->datas[0].maxsize) * 2; - this->hidden->buffer = SDL_NewDataQueue(this->hidden->input_buffer_packet_size, this->hidden->input_buffer_packet_size); + this->hidden->buffer = SDL_NewDataQueue(this->hidden->input_buffer_packet_size, this->hidden->input_buffer_packet_size); } this->hidden->stream_init_status |= PW_READY_FLAG_BUFFER_ADDED; PIPEWIRE_pw_thread_loop_signal(this->hidden->loop, false); } -static void -stream_state_changed_callback(void *data, enum pw_stream_state old, enum pw_stream_state state, const char *error) +static void stream_state_changed_callback(void *data, enum pw_stream_state old, enum pw_stream_state state, const char *error) { _THIS = data; @@ -1153,15 +1141,14 @@ stream_state_changed_callback(void *data, enum pw_stream_state old, enum pw_stre static const struct pw_stream_events stream_output_events = { PW_VERSION_STREAM_EVENTS, .state_changed = stream_state_changed_callback, - .add_buffer = stream_add_buffer_callback, - .process = output_callback }; -static const struct pw_stream_events stream_input_events = { PW_VERSION_STREAM_EVENTS, - .state_changed = stream_state_changed_callback, - .add_buffer = stream_add_buffer_callback, - .process = input_callback }; - -static int -PIPEWIRE_OpenDevice(_THIS, const char *devname) + .add_buffer = stream_add_buffer_callback, + .process = output_callback }; +static const struct pw_stream_events stream_input_events = { PW_VERSION_STREAM_EVENTS, + .state_changed = stream_state_changed_callback, + .add_buffer = stream_add_buffer_callback, + .process = input_callback }; + +static int PIPEWIRE_OpenDevice(_THIS, const char *devname) { /* * NOTE: The PW_STREAM_FLAG_RT_PROCESS flag can be set to call the stream @@ -1172,17 +1159,17 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) */ static const enum pw_stream_flags STREAM_FLAGS = PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS; - char thread_name[PW_THREAD_NAME_BUFFER_LENGTH]; - Uint8 pod_buffer[PW_POD_BUFFER_LENGTH]; - struct spa_pod_builder b = SPA_POD_BUILDER_INIT(pod_buffer, sizeof(pod_buffer)); - struct spa_audio_info_raw spa_info = { 0 }; - const struct spa_pod *params = NULL; + char thread_name[PW_THREAD_NAME_BUFFER_LENGTH]; + Uint8 pod_buffer[PW_POD_BUFFER_LENGTH]; + struct spa_pod_builder b = SPA_POD_BUILDER_INIT(pod_buffer, sizeof(pod_buffer)); + struct spa_audio_info_raw spa_info = { 0 }; + const struct spa_pod *params = NULL; struct SDL_PrivateAudioData *priv; - struct pw_properties *props; - const char *app_name, *stream_name, *stream_role, *error; - Uint32 node_id = this->handle == NULL ? PW_ID_ANY : PW_HANDLE_TO_ID(this->handle); - SDL_bool iscapture = this->iscapture; - int res; + struct pw_properties *props; + const char *app_name, *stream_name, *stream_role, *error; + Uint32 node_id = !this->handle ? PW_ID_ANY : PW_HANDLE_TO_ID(this->handle); + SDL_bool iscapture = this->iscapture; + int res; /* Clamp the period size to sane values */ const int min_period = PW_MIN_SAMPLES * SPA_MAX(this->spec.freq / PW_BASE_CLOCK_RATE, 1); @@ -1213,11 +1200,13 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) /* Initialize the Pipewire stream info from the SDL audio spec */ initialize_spa_info(&this->spec, &spa_info); params = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &spa_info); - if (params == NULL) { + if (!params) { return SDL_SetError("Pipewire: Failed to set audio format parameters"); } - if ((this->hidden = priv = SDL_calloc(1, sizeof(struct SDL_PrivateAudioData))) == NULL) { + priv = SDL_calloc(1, sizeof(struct SDL_PrivateAudioData)); + this->hidden = priv; + if (!priv) { return SDL_OutOfMemory(); } @@ -1226,28 +1215,28 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) if (this->spec.samples < min_period) { this->spec.samples = min_period; - this->spec.size = this->spec.samples * priv->stride; + this->spec.size = this->spec.samples * priv->stride; } - SDL_snprintf(thread_name, sizeof(thread_name), "SDLAudio%c%ld", (iscapture) ? 'C' : 'P', (long)this->handle); + (void)SDL_snprintf(thread_name, sizeof(thread_name), "SDLAudio%c%ld", (iscapture) ? 'C' : 'P', (long)this->handle); priv->loop = PIPEWIRE_pw_thread_loop_new(thread_name, NULL); - if (priv->loop == NULL) { + if (!priv->loop) { return SDL_SetError("Pipewire: Failed to create stream loop (%i)", errno); } /* Load the realtime module so Pipewire can set the loop thread to the appropriate priority. */ props = PIPEWIRE_pw_properties_new(PW_KEY_CONFIG_NAME, "client-rt.conf", NULL); - if (props == NULL) { + if (!props) { return SDL_SetError("Pipewire: Failed to create stream context properties (%i)", errno); } priv->context = PIPEWIRE_pw_context_new(PIPEWIRE_pw_thread_loop_get_loop(priv->loop), props, 0); - if (priv->context == NULL) { + if (!priv->context) { return SDL_SetError("Pipewire: Failed to create stream context (%i)", errno); } props = PIPEWIRE_pw_properties_new(NULL, NULL); - if (props == NULL) { + if (!props) { return SDL_SetError("Pipewire: Failed to create stream properties (%i)", errno); } @@ -1272,7 +1261,8 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) const struct io_node *node; PIPEWIRE_pw_thread_loop_lock(hotplug_loop); - if ((node = io_list_get_by_id(node_id))) { + node = io_list_get_by_id(node_id); + if (node) { PIPEWIRE_pw_properties_set(props, PW_KEY_TARGET_OBJECT, node->path); } PIPEWIRE_pw_thread_loop_unlock(hotplug_loop); @@ -1284,7 +1274,7 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) /* Create the new stream */ priv->stream = PIPEWIRE_pw_stream_new_simple(PIPEWIRE_pw_thread_loop_get_loop(priv->loop), stream_name, props, iscapture ? &stream_input_events : &stream_output_events, this); - if (priv->stream == NULL) { + if (!priv->stream) { return SDL_SetError("Pipewire: Failed to create stream (%i)", errno); } @@ -1312,7 +1302,7 @@ PIPEWIRE_OpenDevice(_THIS, const char *devname) } /* If this is a capture stream, make sure the intermediate buffer was successfully allocated. */ - if (iscapture && priv->buffer == NULL) { + if (iscapture && !priv->buffer) { return SDL_SetError("Pipewire: Failed to allocate source buffer"); } @@ -1344,8 +1334,7 @@ static void PIPEWIRE_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -PIPEWIRE_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +static int PIPEWIRE_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { struct io_node *node; char *target; @@ -1354,13 +1343,13 @@ PIPEWIRE_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) PIPEWIRE_pw_thread_loop_lock(hotplug_loop); if (iscapture) { - if (pipewire_default_source_id == NULL) { + if (!pipewire_default_source_id) { ret = SDL_SetError("PipeWire could not find a default source"); goto failed; } target = pipewire_default_source_id; } else { - if (pipewire_default_sink_id == NULL) { + if (!pipewire_default_sink_id) { ret = SDL_SetError("PipeWire could not find a default sink"); goto failed; } @@ -1368,12 +1357,12 @@ PIPEWIRE_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) } node = io_list_get_by_path(target); - if (node == NULL) { + if (!node) { ret = SDL_SetError("PipeWire device list is out of sync with defaults"); goto failed; } - if (name != NULL) { + if (name) { *name = SDL_strdup(node->name); } SDL_copyp(spec, &node->spec); @@ -1383,8 +1372,7 @@ PIPEWIRE_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) return ret; } -static void -PIPEWIRE_Deinitialize() +static void PIPEWIRE_Deinitialize(void) { if (pipewire_initialized) { hotplug_loop_destroy(); @@ -1393,8 +1381,7 @@ PIPEWIRE_Deinitialize() } } -static SDL_bool -PIPEWIRE_Init(SDL_AudioDriverImpl *impl) +static SDL_bool PIPEWIRE_Init(SDL_AudioDriverImpl *impl) { if (!pipewire_initialized) { if (init_pipewire_library() < 0) { @@ -1410,15 +1397,15 @@ PIPEWIRE_Init(SDL_AudioDriverImpl *impl) } /* Set the function pointers */ - impl->DetectDevices = PIPEWIRE_DetectDevices; - impl->OpenDevice = PIPEWIRE_OpenDevice; - impl->CloseDevice = PIPEWIRE_CloseDevice; - impl->Deinitialize = PIPEWIRE_Deinitialize; + impl->DetectDevices = PIPEWIRE_DetectDevices; + impl->OpenDevice = PIPEWIRE_OpenDevice; + impl->CloseDevice = PIPEWIRE_CloseDevice; + impl->Deinitialize = PIPEWIRE_Deinitialize; impl->GetDefaultAudioInfo = PIPEWIRE_GetDefaultAudioInfo; - impl->HasCaptureSupport = SDL_TRUE; + impl->HasCaptureSupport = SDL_TRUE; impl->ProvidesOwnCallbackThread = SDL_TRUE; - impl->SupportsNonPow2Samples = SDL_TRUE; + impl->SupportsNonPow2Samples = SDL_TRUE; return SDL_TRUE; } diff --git a/src/audio/pipewire/SDL_pipewire.h b/src/audio/pipewire/SDL_pipewire.h index 767b8f10c69b8..079821d92d210 100644 --- a/src/audio/pipewire/SDL_pipewire.h +++ b/src/audio/pipewire/SDL_pipewire.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,13 +33,13 @@ struct SDL_PrivateAudioData { struct pw_thread_loop *loop; - struct pw_stream *stream; - struct pw_context *context; - struct SDL_DataQueue *buffer; + struct pw_stream *stream; + struct pw_context *context; + struct SDL_DataQueue *buffer; size_t input_buffer_packet_size; Sint32 stride; /* Bytes-per-frame */ - int stream_init_status; + int stream_init_status; }; #endif /* SDL_pipewire_h_ */ diff --git a/src/audio/ps2/SDL_ps2audio.c b/src/audio/ps2/SDL_ps2audio.c index b050984de30bd..0de23722fbf06 100644 --- a/src/audio/ps2/SDL_ps2audio.c +++ b/src/audio/ps2/SDL_ps2audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,36 +33,34 @@ #include /* The tag name used by PS2 audio */ -#define PS2AUDIO_DRIVER_NAME "ps2" +#define PS2AUDIO_DRIVER_NAME "ps2" -static int -PS2AUDIO_OpenDevice(_THIS, const char *devname) +static int PS2AUDIO_OpenDevice(_THIS, const char *devname) { int i, mixlen; struct audsrv_fmt_t format; this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); - /* These are the native supported audio PS2 configs */ switch (this->spec.freq) { - case 11025: - case 12000: - case 22050: - case 24000: - case 32000: - case 44100: - case 48000: - this->spec.freq = this->spec.freq; - break; - default: - this->spec.freq = 48000; - break; + case 11025: + case 12000: + case 22050: + case 24000: + case 32000: + case 44100: + case 48000: + this->spec.freq = this->spec.freq; + break; + default: + this->spec.freq = 48000; + break; } this->spec.samples = 512; @@ -71,8 +69,8 @@ PS2AUDIO_OpenDevice(_THIS, const char *devname) SDL_CalculateAudioSpec(&this->spec); - format.bits = this->spec.format == AUDIO_S8 ? 8 : 16; - format.freq = this->spec.freq; + format.bits = this->spec.format == AUDIO_S8 ? 8 : 16; + format.freq = this->spec.freq; format.channels = this->spec.channels; this->hidden->channel = audsrv_set_format(&format); @@ -91,8 +89,8 @@ PS2AUDIO_OpenDevice(_THIS, const char *devname) be a multiple of 64 bytes. Our sample count is already a multiple of 64, so spec->size should be a multiple of 64 as well. */ mixlen = this->spec.size * NUM_BUFFERS; - this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen); - if (this->hidden->rawbuf == NULL) { + this->hidden->rawbuf = (Uint8 *)memalign(64, mixlen); + if (!this->hidden->rawbuf) { return SDL_SetError("Couldn't allocate mixing buffer"); } @@ -131,7 +129,7 @@ static void PS2AUDIO_CloseDevice(_THIS) this->hidden->channel = -1; } - if (this->hidden->rawbuf != NULL) { + if (this->hidden->rawbuf) { free(this->hidden->rawbuf); this->hidden->rawbuf = NULL; } @@ -154,10 +152,11 @@ static void PS2AUDIO_Deinitialize(void) deinit_audio_driver(); } -static SDL_bool PS2AUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool PS2AUDIO_Init(SDL_AudioDriverImpl *impl) { - if(init_audio_driver() < 0) + if (init_audio_driver() < 0) { return SDL_FALSE; + } /* Set the function pointers */ impl->OpenDevice = PS2AUDIO_OpenDevice; @@ -168,7 +167,7 @@ static SDL_bool PS2AUDIO_Init(SDL_AudioDriverImpl * impl) impl->ThreadInit = PS2AUDIO_ThreadInit; impl->Deinitialize = PS2AUDIO_Deinitialize; impl->OnlyHasDefaultOutputDevice = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap PS2AUDIO_bootstrap = { diff --git a/src/audio/ps2/SDL_ps2audio.h b/src/audio/ps2/SDL_ps2audio.h index 0de2506c2820d..3c76544b58d13 100644 --- a/src/audio/ps2/SDL_ps2audio.h +++ b/src/audio/ps2/SDL_ps2audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,20 +26,20 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this #define NUM_BUFFERS 2 struct SDL_PrivateAudioData { - /* The hardware output channel. */ - int channel; - /* The raw allocated mixing buffer. */ - Uint8 *rawbuf; - /* Individual mixing buffers. */ - Uint8 *mixbufs[NUM_BUFFERS]; - /* Index of the next available mixing buffer. */ - int next_buffer; + /* The hardware output channel. */ + int channel; + /* The raw allocated mixing buffer. */ + Uint8 *rawbuf; + /* Individual mixing buffers. */ + Uint8 *mixbufs[NUM_BUFFERS]; + /* Index of the next available mixing buffer. */ + int next_buffer; }; #endif /* SDL_ps2audio_h_ */ diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c index d908170c69177..e949a7adf178d 100644 --- a/src/audio/psp/SDL_pspaudio.c +++ b/src/audio/psp/SDL_pspaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_PSP +#ifdef SDL_AUDIO_DRIVER_PSP #include #include @@ -39,16 +39,20 @@ #include /* The tag name used by PSP audio */ -#define PSPAUDIO_DRIVER_NAME "psp" +#define PSPAUDIO_DRIVER_NAME "psp" -static int -PSPAUDIO_OpenDevice(_THIS, const char *devname) +static inline SDL_bool isBasicAudioConfig(const SDL_AudioSpec *spec) +{ + return spec->freq == 44100; +} + +static int PSPAUDIO_OpenDevice(_THIS, const char *devname) { int format, mixlen, i; this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -56,26 +60,40 @@ PSPAUDIO_OpenDevice(_THIS, const char *devname) /* device only natively supports S16LSB */ this->spec.format = AUDIO_S16LSB; - /* The sample count must be a multiple of 64. */ - this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples); - - /* Setup the hardware channel. */ - if (this->spec.channels == 1) { - format = PSP_AUDIO_FORMAT_MONO; - } else { - format = PSP_AUDIO_FORMAT_STEREO; - this->spec.channels = 2; /* we're forcing the hardware to stereo. */ - } - /* PSP has some limitations with the Audio. It fully supports 44.1KHz (Mono & Stereo), however with frequencies differents than 44.1KHz, it just supports Stereo, so a resampler must be done for these scenarios */ - if (this->spec.freq == 44100) { + if (isBasicAudioConfig(&this->spec)) { + /* The sample count must be a multiple of 64. */ + this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples); + /* The number of channels (1 or 2). */ + this->spec.channels = this->spec.channels == 1 ? 1 : 2; + format = this->spec.channels == 1 ? PSP_AUDIO_FORMAT_MONO : PSP_AUDIO_FORMAT_STEREO; this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format); } else { + /* 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11050, 8000 */ + switch (this->spec.freq) { + case 8000: + case 11025: + case 12000: + case 16000: + case 22050: + case 24000: + case 32000: + case 44100: + case 48000: + this->spec.freq = this->spec.freq; + break; + default: + this->spec.freq = 48000; + break; + } + /* The number of samples to output in one output call (min 17, max 4111). */ + this->spec.samples = this->spec.samples < 17 ? 17 : (this->spec.samples > 4111 ? 4111 : this->spec.samples); + this->spec.channels = 2; /* we're forcing the hardware to stereo. */ this->hidden->channel = sceAudioSRCChReserve(this->spec.samples, this->spec.freq, 2); } - + if (this->hidden->channel < 0) { free(this->hidden->rawbuf); this->hidden->rawbuf = NULL; @@ -89,8 +107,8 @@ PSPAUDIO_OpenDevice(_THIS, const char *devname) be a multiple of 64 bytes. Our sample count is already a multiple of 64, so spec->size should be a multiple of 64 as well. */ mixlen = this->spec.size * NUM_BUFFERS; - this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen); - if (this->hidden->rawbuf == NULL) { + this->hidden->rawbuf = (Uint8 *)memalign(64, mixlen); + if (!this->hidden->rawbuf) { return SDL_SetError("Couldn't allocate mixing buffer"); } @@ -105,12 +123,11 @@ PSPAUDIO_OpenDevice(_THIS, const char *devname) static void PSPAUDIO_PlayDevice(_THIS) { - if (this->spec.freq != 44100){ - Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; + Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; + if (!isBasicAudioConfig(&this->spec)) { SDL_assert(this->spec.channels == 2); sceAudioSRCOutputBlocking(PSP_AUDIO_VOLUME_MAX, mixbuf); } else { - Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mixbuf); } @@ -131,7 +148,7 @@ static Uint8 *PSPAUDIO_GetDeviceBuf(_THIS) static void PSPAUDIO_CloseDevice(_THIS) { if (this->hidden->channel >= 0) { - if (this->spec.freq != 44100){ + if (!isBasicAudioConfig(&this->spec)) { sceAudioSRCChRelease(); } else { sceAudioChRelease(this->hidden->channel); @@ -139,7 +156,7 @@ static void PSPAUDIO_CloseDevice(_THIS) this->hidden->channel = -1; } - if (this->hidden->rawbuf != NULL) { + if (this->hidden->rawbuf) { free(this->hidden->rawbuf); this->hidden->rawbuf = NULL; } @@ -158,8 +175,7 @@ static void PSPAUDIO_ThreadInit(_THIS) } } -static SDL_bool -PSPAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool PSPAUDIO_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = PSPAUDIO_OpenDevice; @@ -175,7 +191,7 @@ PSPAUDIO_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; */ - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap PSPAUDIO_bootstrap = { diff --git a/src/audio/psp/SDL_pspaudio.h b/src/audio/psp/SDL_pspaudio.h index 0e1af2cda1ee8..7baa93f083de3 100644 --- a/src/audio/psp/SDL_pspaudio.h +++ b/src/audio/psp/SDL_pspaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,19 +25,20 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this #define NUM_BUFFERS 2 -struct SDL_PrivateAudioData { +struct SDL_PrivateAudioData +{ /* The hardware output channel. */ - int channel; + int channel; /* The raw allocated mixing buffer. */ - Uint8 *rawbuf; + Uint8 *rawbuf; /* Individual mixing buffers. */ - Uint8 *mixbufs[NUM_BUFFERS]; + Uint8 *mixbufs[NUM_BUFFERS]; /* Index of the next available mixing buffer. */ - int next_buffer; + int next_buffer; }; #endif /* SDL_pspaudio_h_ */ diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 288c3d98a26f8..49230b7d46a4a 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,16 +19,10 @@ 3. This notice may not be removed or altered from any source distribution. */ -/* - The PulseAudio target for SDL 1.3 is based on the 1.3 arts target, with - the appropriate parts replaced with the 1.2 PulseAudio target code. This - was the cleanest way to move it to 1.3. The 1.2 target was written by - Stéphan Kochen: stephan .a.t. kochen.nl -*/ #include "../../SDL_internal.h" #include "SDL_hints.h" -#if SDL_AUDIO_DRIVER_PULSEAUDIO +#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO /* Allow access to a raw mixing buffer */ @@ -37,7 +31,6 @@ #endif #include #include -#include #include "SDL_timer.h" #include "SDL_audio.h" @@ -49,90 +42,90 @@ /* should we include monitors in the device list? Set at SDL_Init time */ static SDL_bool include_monitors = SDL_FALSE; +static pa_threaded_mainloop *pulseaudio_threaded_mainloop = NULL; +static pa_context *pulseaudio_context = NULL; +static SDL_Thread *pulseaudio_hotplug_thread = NULL; +static SDL_atomic_t pulseaudio_hotplug_thread_active; -#if (PA_API_VERSION < 12) -/** Return non-zero if the passed state is one of the connected states */ -static SDL_INLINE int PA_CONTEXT_IS_GOOD(pa_context_state_t x) { - return - x == PA_CONTEXT_CONNECTING || - x == PA_CONTEXT_AUTHORIZING || - x == PA_CONTEXT_SETTING_NAME || - x == PA_CONTEXT_READY; -} -/** Return non-zero if the passed state is one of the connected states */ -static SDL_INLINE int PA_STREAM_IS_GOOD(pa_stream_state_t x) { - return - x == PA_STREAM_CREATING || - x == PA_STREAM_READY; -} -#endif /* pulseaudio <= 0.9.10 */ +/* These are the OS identifiers (i.e. ALSA strings)... */ +static char *default_sink_path = NULL; +static char *default_source_path = NULL; +/* ... and these are the descriptions we use in GetDefaultAudioInfo. */ +static char *default_sink_name = NULL; +static char *default_source_name = NULL; -static const char *(*PULSEAUDIO_pa_get_library_version) (void); -static pa_channel_map *(*PULSEAUDIO_pa_channel_map_init_auto) ( +static const char *(*PULSEAUDIO_pa_get_library_version)(void); +static pa_channel_map *(*PULSEAUDIO_pa_channel_map_init_auto)( pa_channel_map *, unsigned, pa_channel_map_def_t); -static const char * (*PULSEAUDIO_pa_strerror) (int); -static pa_mainloop * (*PULSEAUDIO_pa_mainloop_new) (void); -static pa_mainloop_api * (*PULSEAUDIO_pa_mainloop_get_api) (pa_mainloop *); -static int (*PULSEAUDIO_pa_mainloop_iterate) (pa_mainloop *, int, int *); -static int (*PULSEAUDIO_pa_mainloop_run) (pa_mainloop *, int *); -static void (*PULSEAUDIO_pa_mainloop_quit) (pa_mainloop *, int); -static void (*PULSEAUDIO_pa_mainloop_free) (pa_mainloop *); - -static pa_operation_state_t (*PULSEAUDIO_pa_operation_get_state) ( +static const char *(*PULSEAUDIO_pa_strerror)(int); + +static pa_threaded_mainloop *(*PULSEAUDIO_pa_threaded_mainloop_new)(void); +static void (*PULSEAUDIO_pa_threaded_mainloop_set_name)(pa_threaded_mainloop *, const char *); +static pa_mainloop_api *(*PULSEAUDIO_pa_threaded_mainloop_get_api)(pa_threaded_mainloop *); +static int (*PULSEAUDIO_pa_threaded_mainloop_start)(pa_threaded_mainloop *); +static void (*PULSEAUDIO_pa_threaded_mainloop_stop)(pa_threaded_mainloop *); +static void (*PULSEAUDIO_pa_threaded_mainloop_lock)(pa_threaded_mainloop *); +static void (*PULSEAUDIO_pa_threaded_mainloop_unlock)(pa_threaded_mainloop *); +static void (*PULSEAUDIO_pa_threaded_mainloop_wait)(pa_threaded_mainloop *); +static void (*PULSEAUDIO_pa_threaded_mainloop_signal)(pa_threaded_mainloop *, int); +static void (*PULSEAUDIO_pa_threaded_mainloop_free)(pa_threaded_mainloop *); + +static pa_operation_state_t (*PULSEAUDIO_pa_operation_get_state)( const pa_operation *); -static void (*PULSEAUDIO_pa_operation_cancel) (pa_operation *); -static void (*PULSEAUDIO_pa_operation_unref) (pa_operation *); - -static pa_context * (*PULSEAUDIO_pa_context_new) (pa_mainloop_api *, - const char *); -static int (*PULSEAUDIO_pa_context_connect) (pa_context *, const char *, - pa_context_flags_t, const pa_spawn_api *); -static pa_operation * (*PULSEAUDIO_pa_context_get_sink_info_list) (pa_context *, pa_sink_info_cb_t, void *); -static pa_operation * (*PULSEAUDIO_pa_context_get_source_info_list) (pa_context *, pa_source_info_cb_t, void *); -static pa_operation * (*PULSEAUDIO_pa_context_get_sink_info_by_index) (pa_context *, uint32_t, pa_sink_info_cb_t, void *); -static pa_operation * (*PULSEAUDIO_pa_context_get_source_info_by_index) (pa_context *, uint32_t, pa_source_info_cb_t, void *); -static pa_context_state_t (*PULSEAUDIO_pa_context_get_state) (const pa_context *); -static pa_operation * (*PULSEAUDIO_pa_context_subscribe) (pa_context *, pa_subscription_mask_t, pa_context_success_cb_t, void *); -static void (*PULSEAUDIO_pa_context_set_subscribe_callback) (pa_context *, pa_context_subscribe_cb_t, void *); -static void (*PULSEAUDIO_pa_context_disconnect) (pa_context *); -static void (*PULSEAUDIO_pa_context_unref) (pa_context *); - -static pa_stream * (*PULSEAUDIO_pa_stream_new) (pa_context *, const char *, - const pa_sample_spec *, const pa_channel_map *); -static int (*PULSEAUDIO_pa_stream_connect_playback) (pa_stream *, const char *, - const pa_buffer_attr *, pa_stream_flags_t, const pa_cvolume *, pa_stream *); -static int (*PULSEAUDIO_pa_stream_connect_record) (pa_stream *, const char *, - const pa_buffer_attr *, pa_stream_flags_t); -static pa_stream_state_t (*PULSEAUDIO_pa_stream_get_state) (const pa_stream *); -static size_t (*PULSEAUDIO_pa_stream_writable_size) (const pa_stream *); -static size_t (*PULSEAUDIO_pa_stream_readable_size) (const pa_stream *); -static int (*PULSEAUDIO_pa_stream_write) (pa_stream *, const void *, size_t, - pa_free_cb_t, int64_t, pa_seek_mode_t); -static pa_operation * (*PULSEAUDIO_pa_stream_drain) (pa_stream *, - pa_stream_success_cb_t, void *); -static int (*PULSEAUDIO_pa_stream_peek) (pa_stream *, const void **, size_t *); -static int (*PULSEAUDIO_pa_stream_drop) (pa_stream *); -static pa_operation * (*PULSEAUDIO_pa_stream_flush) (pa_stream *, - pa_stream_success_cb_t, void *); -static int (*PULSEAUDIO_pa_stream_disconnect) (pa_stream *); -static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *); +static void (*PULSEAUDIO_pa_operation_cancel)(pa_operation *); +static void (*PULSEAUDIO_pa_operation_unref)(pa_operation *); + +static pa_context *(*PULSEAUDIO_pa_context_new)(pa_mainloop_api *, + const char *); +static void (*PULSEAUDIO_pa_context_set_state_callback)(pa_context *, pa_context_notify_cb_t, void *); +static int (*PULSEAUDIO_pa_context_connect)(pa_context *, const char *, + pa_context_flags_t, const pa_spawn_api *); +static pa_operation *(*PULSEAUDIO_pa_context_get_sink_info_list)(pa_context *, pa_sink_info_cb_t, void *); +static pa_operation *(*PULSEAUDIO_pa_context_get_source_info_list)(pa_context *, pa_source_info_cb_t, void *); +static pa_operation *(*PULSEAUDIO_pa_context_get_sink_info_by_index)(pa_context *, uint32_t, pa_sink_info_cb_t, void *); +static pa_operation *(*PULSEAUDIO_pa_context_get_source_info_by_index)(pa_context *, uint32_t, pa_source_info_cb_t, void *); +static pa_context_state_t (*PULSEAUDIO_pa_context_get_state)(const pa_context *); +static pa_operation *(*PULSEAUDIO_pa_context_subscribe)(pa_context *, pa_subscription_mask_t, pa_context_success_cb_t, void *); +static void (*PULSEAUDIO_pa_context_set_subscribe_callback)(pa_context *, pa_context_subscribe_cb_t, void *); +static void (*PULSEAUDIO_pa_context_disconnect)(pa_context *); +static void (*PULSEAUDIO_pa_context_unref)(pa_context *); + +static pa_stream *(*PULSEAUDIO_pa_stream_new)(pa_context *, const char *, + const pa_sample_spec *, const pa_channel_map *); +static void (*PULSEAUDIO_pa_stream_set_state_callback)(pa_stream *, pa_stream_notify_cb_t, void *); +static int (*PULSEAUDIO_pa_stream_connect_playback)(pa_stream *, const char *, + const pa_buffer_attr *, pa_stream_flags_t, const pa_cvolume *, pa_stream *); +static int (*PULSEAUDIO_pa_stream_connect_record)(pa_stream *, const char *, + const pa_buffer_attr *, pa_stream_flags_t); +static pa_stream_state_t (*PULSEAUDIO_pa_stream_get_state)(const pa_stream *); +static size_t (*PULSEAUDIO_pa_stream_writable_size)(const pa_stream *); +static size_t (*PULSEAUDIO_pa_stream_readable_size)(const pa_stream *); +static int (*PULSEAUDIO_pa_stream_write)(pa_stream *, const void *, size_t, + pa_free_cb_t, int64_t, pa_seek_mode_t); +static pa_operation *(*PULSEAUDIO_pa_stream_drain)(pa_stream *, + pa_stream_success_cb_t, void *); +static int (*PULSEAUDIO_pa_stream_peek)(pa_stream *, const void **, size_t *); +static int (*PULSEAUDIO_pa_stream_drop)(pa_stream *); +static pa_operation *(*PULSEAUDIO_pa_stream_flush)(pa_stream *, + pa_stream_success_cb_t, void *); +static int (*PULSEAUDIO_pa_stream_disconnect)(pa_stream *); +static void (*PULSEAUDIO_pa_stream_unref)(pa_stream *); static void (*PULSEAUDIO_pa_stream_set_write_callback)(pa_stream *, pa_stream_request_cb_t, void *); -static pa_operation * (*PULSEAUDIO_pa_context_get_server_info)(pa_context *, pa_server_info_cb_t, void *); +static void (*PULSEAUDIO_pa_stream_set_read_callback)(pa_stream *, pa_stream_request_cb_t, void *); +static pa_operation *(*PULSEAUDIO_pa_context_get_server_info)(pa_context *, pa_server_info_cb_t, void *); static int load_pulseaudio_syms(void); - #ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC; static void *pulseaudio_handle = NULL; -static int -load_pulseaudio_sym(const char *fn, void **addr) +static int load_pulseaudio_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(pulseaudio_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return 0; } @@ -141,25 +134,24 @@ load_pulseaudio_sym(const char *fn, void **addr) } /* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_PULSEAUDIO_SYM(x) \ - if (!load_pulseaudio_sym(#x, (void **) (char *) &PULSEAUDIO_##x)) return -1 +#define SDL_PULSEAUDIO_SYM(x) \ + if (!load_pulseaudio_sym(#x, (void **)(char *)&PULSEAUDIO_##x)) \ + return -1 -static void -UnloadPulseAudioLibrary(void) +static void UnloadPulseAudioLibrary(void) { - if (pulseaudio_handle != NULL) { + if (pulseaudio_handle) { SDL_UnloadObject(pulseaudio_handle); pulseaudio_handle = NULL; } } -static int -LoadPulseAudioLibrary(void) +static int LoadPulseAudioLibrary(void) { int retval = 0; - if (pulseaudio_handle == NULL) { + if (!pulseaudio_handle) { pulseaudio_handle = SDL_LoadObject(pulseaudio_library); - if (pulseaudio_handle == NULL) { + if (!pulseaudio_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { @@ -176,13 +168,11 @@ LoadPulseAudioLibrary(void) #define SDL_PULSEAUDIO_SYM(x) PULSEAUDIO_##x = x -static void -UnloadPulseAudioLibrary(void) +static void UnloadPulseAudioLibrary(void) { } -static int -LoadPulseAudioLibrary(void) +static int LoadPulseAudioLibrary(void) { load_pulseaudio_syms(); return 0; @@ -190,21 +180,23 @@ LoadPulseAudioLibrary(void) #endif /* SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC */ - -static int -load_pulseaudio_syms(void) +static int load_pulseaudio_syms(void) { SDL_PULSEAUDIO_SYM(pa_get_library_version); - SDL_PULSEAUDIO_SYM(pa_mainloop_new); - SDL_PULSEAUDIO_SYM(pa_mainloop_get_api); - SDL_PULSEAUDIO_SYM(pa_mainloop_iterate); - SDL_PULSEAUDIO_SYM(pa_mainloop_run); - SDL_PULSEAUDIO_SYM(pa_mainloop_quit); - SDL_PULSEAUDIO_SYM(pa_mainloop_free); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_new); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_get_api); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_start); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_stop); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_lock); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_unlock); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_wait); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_signal); + SDL_PULSEAUDIO_SYM(pa_threaded_mainloop_free); SDL_PULSEAUDIO_SYM(pa_operation_get_state); SDL_PULSEAUDIO_SYM(pa_operation_cancel); SDL_PULSEAUDIO_SYM(pa_operation_unref); SDL_PULSEAUDIO_SYM(pa_context_new); + SDL_PULSEAUDIO_SYM(pa_context_set_state_callback); SDL_PULSEAUDIO_SYM(pa_context_connect); SDL_PULSEAUDIO_SYM(pa_context_get_sink_info_list); SDL_PULSEAUDIO_SYM(pa_context_get_source_info_list); @@ -216,6 +208,7 @@ load_pulseaudio_syms(void) SDL_PULSEAUDIO_SYM(pa_context_disconnect); SDL_PULSEAUDIO_SYM(pa_context_unref); SDL_PULSEAUDIO_SYM(pa_stream_new); + SDL_PULSEAUDIO_SYM(pa_stream_set_state_callback); SDL_PULSEAUDIO_SYM(pa_stream_connect_playback); SDL_PULSEAUDIO_SYM(pa_stream_connect_record); SDL_PULSEAUDIO_SYM(pa_stream_get_state); @@ -231,19 +224,28 @@ load_pulseaudio_syms(void) SDL_PULSEAUDIO_SYM(pa_channel_map_init_auto); SDL_PULSEAUDIO_SYM(pa_strerror); SDL_PULSEAUDIO_SYM(pa_stream_set_write_callback); + SDL_PULSEAUDIO_SYM(pa_stream_set_read_callback); SDL_PULSEAUDIO_SYM(pa_context_get_server_info); + + /* optional */ +#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC + load_pulseaudio_sym("pa_threaded_mainloop_set_name", (void **)(char *)&PULSEAUDIO_pa_threaded_mainloop_set_name); +#elif (PA_PROTOCOL_VERSION >= 29) + PULSEAUDIO_pa_threaded_mainloop_set_name = pa_threaded_mainloop_set_name; +#else + PULSEAUDIO_pa_threaded_mainloop_set_name = NULL; +#endif + return 0; } -static SDL_INLINE int -squashVersion(const int major, const int minor, const int patch) +static SDL_INLINE int squashVersion(const int major, const int minor, const int patch) { return ((major & 0xFF) << 16) | ((minor & 0xFF) << 8) | (patch & 0xFF); } /* Workaround for older pulse: pa_context_new() must have non-NULL appname */ -static const char * -getAppName(void) +static const char *getAppName(void) { const char *retval = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_APP_NAME); if (retval && *retval) { @@ -254,12 +256,12 @@ getAppName(void) return retval; } else { const char *verstr = PULSEAUDIO_pa_get_library_version(); - retval = "SDL Application"; /* the "oh well" default. */ - if (verstr != NULL) { + retval = "SDL Application"; /* the "oh well" default. */ + if (verstr) { int maj, min, patch; if (SDL_sscanf(verstr, "%d.%d.%d", &maj, &min, &patch) == 3) { if (squashVersion(maj, min, patch) >= squashVersion(0, 9, 15)) { - retval = NULL; /* 0.9.15+ handles NULL correctly. */ + retval = NULL; /* 0.9.15+ handles NULL correctly. */ } } } @@ -267,110 +269,120 @@ getAppName(void) return retval; } -static void -WaitForPulseOperation(pa_mainloop *mainloop, pa_operation *o) +/* This function assume you are holding `mainloop`'s lock and that `o` has a callback that will signal pulseaudio_threaded_mainloop. + The caller may optionally call pa_threaded_mainloop_accept() if the signal is blocking. The operation is + unref'd in here, assuming you did the work in the callback and just want to know it's done, though. */ +static void WaitForPulseOperation(pa_operation *o) { /* This checks for NO errors currently. Either fix that, check results elsewhere, or do things you don't care about. */ - if (mainloop && o) { - SDL_bool okay = SDL_TRUE; - while (okay && (PULSEAUDIO_pa_operation_get_state(o) == PA_OPERATION_RUNNING)) { - okay = (PULSEAUDIO_pa_mainloop_iterate(mainloop, 1, NULL) >= 0); + SDL_assert(pulseaudio_threaded_mainloop != NULL); + if (o) { + while (PULSEAUDIO_pa_operation_get_state(o) == PA_OPERATION_RUNNING) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); /* this releases the lock and blocks on an internal condition variable. */ } PULSEAUDIO_pa_operation_unref(o); } } -static void -DisconnectFromPulseServer(pa_mainloop *mainloop, pa_context *context) +static void DisconnectFromPulseServer(void) { - if (context) { - PULSEAUDIO_pa_context_disconnect(context); - PULSEAUDIO_pa_context_unref(context); + if (pulseaudio_threaded_mainloop) { + PULSEAUDIO_pa_threaded_mainloop_stop(pulseaudio_threaded_mainloop); + } + if (pulseaudio_context) { + PULSEAUDIO_pa_context_disconnect(pulseaudio_context); + PULSEAUDIO_pa_context_unref(pulseaudio_context); + pulseaudio_context = NULL; } - if (mainloop != NULL) { - PULSEAUDIO_pa_mainloop_free(mainloop); + if (pulseaudio_threaded_mainloop) { + PULSEAUDIO_pa_threaded_mainloop_free(pulseaudio_threaded_mainloop); + pulseaudio_threaded_mainloop = NULL; } } -static int -ConnectToPulseServer_Internal(pa_mainloop **_mainloop, pa_context **_context) +static void PulseContextStateChangeCallback(pa_context *context, void *userdata) +{ + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); /* just signal any waiting code, it can look up the details. */ +} + +static int ConnectToPulseServer(void) { - pa_mainloop *mainloop = NULL; - pa_context *context = NULL; pa_mainloop_api *mainloop_api = NULL; int state = 0; - *_mainloop = NULL; - *_context = NULL; + SDL_assert(pulseaudio_threaded_mainloop == NULL); + SDL_assert(pulseaudio_context == NULL); /* Set up a new main loop */ - if (!(mainloop = PULSEAUDIO_pa_mainloop_new())) { - return SDL_SetError("pa_mainloop_new() failed"); + if (!(pulseaudio_threaded_mainloop = PULSEAUDIO_pa_threaded_mainloop_new())) { + return SDL_SetError("pa_threaded_mainloop_new() failed"); } - mainloop_api = PULSEAUDIO_pa_mainloop_get_api(mainloop); - SDL_assert(mainloop_api); /* this never fails, right? */ + if (PULSEAUDIO_pa_threaded_mainloop_set_name) { + PULSEAUDIO_pa_threaded_mainloop_set_name(pulseaudio_threaded_mainloop, "PulseMainloop"); + } - context = PULSEAUDIO_pa_context_new(mainloop_api, getAppName()); - if (!context) { - PULSEAUDIO_pa_mainloop_free(mainloop); - return SDL_SetError("pa_context_new() failed"); + if (PULSEAUDIO_pa_threaded_mainloop_start(pulseaudio_threaded_mainloop) < 0) { + PULSEAUDIO_pa_threaded_mainloop_free(pulseaudio_threaded_mainloop); + pulseaudio_threaded_mainloop = NULL; + return SDL_SetError("pa_threaded_mainloop_start() failed"); } - /* Connect to the PulseAudio server */ - if (PULSEAUDIO_pa_context_connect(context, NULL, 0, NULL) < 0) { - PULSEAUDIO_pa_context_unref(context); - PULSEAUDIO_pa_mainloop_free(mainloop); - return SDL_SetError("Could not setup connection to PulseAudio"); + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + + mainloop_api = PULSEAUDIO_pa_threaded_mainloop_get_api(pulseaudio_threaded_mainloop); + SDL_assert(mainloop_api != NULL); /* this never fails, right? */ + + pulseaudio_context = PULSEAUDIO_pa_context_new(mainloop_api, getAppName()); + if (!pulseaudio_context) { + SDL_SetError("pa_context_new() failed"); + goto failed; } - do { - if (PULSEAUDIO_pa_mainloop_iterate(mainloop, 1, NULL) < 0) { - PULSEAUDIO_pa_context_unref(context); - PULSEAUDIO_pa_mainloop_free(mainloop); - return SDL_SetError("pa_mainloop_iterate() failed"); - } - state = PULSEAUDIO_pa_context_get_state(context); - if (!PA_CONTEXT_IS_GOOD(state)) { - PULSEAUDIO_pa_context_unref(context); - PULSEAUDIO_pa_mainloop_free(mainloop); - return SDL_SetError("Could not connect to PulseAudio"); - } - } while (state != PA_CONTEXT_READY); + PULSEAUDIO_pa_context_set_state_callback(pulseaudio_context, PulseContextStateChangeCallback, NULL); - *_context = context; - *_mainloop = mainloop; + /* Connect to the PulseAudio server */ + if (PULSEAUDIO_pa_context_connect(pulseaudio_context, NULL, 0, NULL) < 0) { + SDL_SetError("Could not setup connection to PulseAudio"); + goto failed; + } - return 0; /* connected and ready! */ -} + state = PULSEAUDIO_pa_context_get_state(pulseaudio_context); + while (PA_CONTEXT_IS_GOOD(state) && (state != PA_CONTEXT_READY)) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + state = PULSEAUDIO_pa_context_get_state(pulseaudio_context); + } -static int -ConnectToPulseServer(pa_mainloop **_mainloop, pa_context **_context) -{ - const int retval = ConnectToPulseServer_Internal(_mainloop, _context); - if (retval < 0) { - DisconnectFromPulseServer(*_mainloop, *_context); + if (state != PA_CONTEXT_READY) { + return SDL_SetError("Could not connect to PulseAudio"); + goto failed; } - return retval; -} + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + + return 0; /* connected and ready! */ + +failed: + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + DisconnectFromPulseServer(); + return -1; +} /* This function waits until it is possible to write a full sound buffer */ -static void -PULSEAUDIO_WaitDevice(_THIS) +static void PULSEAUDIO_WaitDevice(_THIS) { /* this is a no-op; we wait in PULSEAUDIO_PlayDevice now. */ } static void WriteCallback(pa_stream *p, size_t nbytes, void *userdata) { - struct SDL_PrivateAudioData *h = (struct SDL_PrivateAudioData *) userdata; + struct SDL_PrivateAudioData *h = (struct SDL_PrivateAudioData *)userdata; /*printf("PULSEAUDIO WRITE CALLBACK! nbytes=%u\n", (unsigned int) nbytes);*/ h->bytes_requested += nbytes; + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } -static void -PULSEAUDIO_PlayDevice(_THIS) +static void PULSEAUDIO_PlayDevice(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; int available = h->mixlen; @@ -379,12 +391,14 @@ PULSEAUDIO_PlayDevice(_THIS) /*printf("PULSEAUDIO PLAYDEVICE START! mixlen=%d\n", available);*/ + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + while (SDL_AtomicGet(&this->enabled) && (available > 0)) { cpy = SDL_min(h->bytes_requested, available); if (cpy) { if (PULSEAUDIO_pa_stream_write(h->stream, h->mixbuf + written, cpy, NULL, 0LL, PA_SEEK_RELATIVE) < 0) { SDL_OpenedAudioDeviceDisconnected(this); - return; + break; } /*printf("PULSEAUDIO FEED! nbytes=%u\n", (unsigned int) cpy);*/ h->bytes_requested -= cpy; @@ -392,35 +406,46 @@ PULSEAUDIO_PlayDevice(_THIS) available -= cpy; } - /* let WriteCallback fire if necessary. */ - /*printf("PULSEAUDIO ITERATE!\n");*/ - if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || - PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || - PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - return; + if (available > 0) { + /* let WriteCallback fire if necessary. */ + /*printf("PULSEAUDIO WAIT IN PLAYDEVICE!\n");*/ + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + + if ((PULSEAUDIO_pa_context_get_state(pulseaudio_context) != PA_CONTEXT_READY) || (PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY)) { + /*printf("PULSEAUDIO DEVICE FAILURE IN PLAYDEVICE!\n");*/ + SDL_OpenedAudioDeviceDisconnected(this); + break; + } } } + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + /*printf("PULSEAUDIO PLAYDEVICE END! written=%d\n", written);*/ } -static Uint8 * -PULSEAUDIO_GetDeviceBuf(_THIS) +static Uint8 *PULSEAUDIO_GetDeviceBuf(_THIS) { return this->hidden->mixbuf; } +static void ReadCallback(pa_stream *p, size_t nbytes, void *userdata) +{ + /*printf("PULSEAUDIO READ CALLBACK! nbytes=%u\n", (unsigned int) nbytes);*/ + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); /* the capture code queries what it needs, we just need to signal to end any wait */ +} -static int -PULSEAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int PULSEAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { struct SDL_PrivateAudioData *h = this->hidden; const void *data = NULL; size_t nbytes = 0; + int retval = 0; + + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); while (SDL_AtomicGet(&this->enabled)) { - if (h->capturebuf != NULL) { + if (h->capturebuf) { const int cpy = SDL_min(buflen, h->capturelen); SDL_memcpy(buffer, h->capturebuf, cpy); /*printf("PULSEAUDIO: fed %d captured bytes\n", cpy);*/ @@ -428,128 +453,138 @@ PULSEAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) h->capturelen -= cpy; if (h->capturelen == 0) { h->capturebuf = NULL; - PULSEAUDIO_pa_stream_drop(h->stream); /* done with this fragment. */ + PULSEAUDIO_pa_stream_drop(h->stream); /* done with this fragment. */ } - return cpy; /* new data, return it. */ + retval = cpy; /* new data, return it. */ + break; } - if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || - PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || - PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - SDL_OpenedAudioDeviceDisconnected(this); - return -1; /* uhoh, pulse failed! */ + while (SDL_AtomicGet(&this->enabled) && (PULSEAUDIO_pa_stream_readable_size(h->stream) == 0)) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + if ((PULSEAUDIO_pa_context_get_state(pulseaudio_context) != PA_CONTEXT_READY) || (PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY)) { + /*printf("PULSEAUDIO DEVICE FAILURE IN CAPTUREFROMDEVICE!\n");*/ + SDL_OpenedAudioDeviceDisconnected(this); + retval = -1; + break; + } } - if (PULSEAUDIO_pa_stream_readable_size(h->stream) == 0) { - continue; /* no data available yet. */ + if ((retval == -1) || !SDL_AtomicGet(&this->enabled)) { /* in case this happened while we were blocking. */ + retval = -1; + break; } /* a new fragment is available! */ PULSEAUDIO_pa_stream_peek(h->stream, &data, &nbytes); SDL_assert(nbytes > 0); - if (data == NULL) { /* NULL==buffer had a hole. Ignore that. */ - PULSEAUDIO_pa_stream_drop(h->stream); /* drop this fragment. */ + /* If data == NULL, then the buffer had a hole, ignore that */ + if (!data) { + PULSEAUDIO_pa_stream_drop(h->stream); /* drop this fragment. */ } else { /* store this fragment's data, start feeding it to SDL. */ /*printf("PULSEAUDIO: captured %d new bytes\n", (int) nbytes);*/ - h->capturebuf = (const Uint8 *) data; + h->capturebuf = (const Uint8 *)data; h->capturelen = nbytes; } } - return -1; /* not enabled? */ + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + + return retval; } -static void -PULSEAUDIO_FlushCapture(_THIS) +static void PULSEAUDIO_FlushCapture(_THIS) { struct SDL_PrivateAudioData *h = this->hidden; const void *data = NULL; - size_t nbytes = 0; + size_t nbytes = 0, buflen = 0; - if (h->capturebuf != NULL) { + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + + if (h->capturebuf) { PULSEAUDIO_pa_stream_drop(h->stream); h->capturebuf = NULL; h->capturelen = 0; } - while (SDL_AtomicGet(&this->enabled)) { - if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY || - PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY || - PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { + buflen = PULSEAUDIO_pa_stream_readable_size(h->stream); + while (SDL_AtomicGet(&this->enabled) && (buflen > 0)) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + if ((PULSEAUDIO_pa_context_get_state(pulseaudio_context) != PA_CONTEXT_READY) || (PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY)) { + /*printf("PULSEAUDIO DEVICE FAILURE IN FLUSHCAPTURE!\n");*/ SDL_OpenedAudioDeviceDisconnected(this); - return; /* uhoh, pulse failed! */ - } - - if (PULSEAUDIO_pa_stream_readable_size(h->stream) == 0) { - break; /* no data available, so we're done. */ + break; } - - /* a new fragment is available! Just dump it. */ + /* a fragment of audio present before FlushCapture was call is + available! Just drop it. */ PULSEAUDIO_pa_stream_peek(h->stream, &data, &nbytes); - PULSEAUDIO_pa_stream_drop(h->stream); /* drop this fragment. */ + PULSEAUDIO_pa_stream_drop(h->stream); + buflen -= nbytes; } + + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); } -static void -PULSEAUDIO_CloseDevice(_THIS) +static void PULSEAUDIO_CloseDevice(_THIS) { + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + if (this->hidden->stream) { - if (this->hidden->capturebuf != NULL) { + if (this->hidden->capturebuf) { PULSEAUDIO_pa_stream_drop(this->hidden->stream); } PULSEAUDIO_pa_stream_disconnect(this->hidden->stream); PULSEAUDIO_pa_stream_unref(this->hidden->stream); } - DisconnectFromPulseServer(this->hidden->mainloop, this->hidden->context); + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + SDL_free(this->hidden->mixbuf); SDL_free(this->hidden->device_name); SDL_free(this->hidden); } -static void -SinkDeviceNameCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) +static void SinkDeviceNameCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) { if (i) { - char **devname = (char **) data; + char **devname = (char **)data; *devname = SDL_strdup(i->name); } + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } -static void -SourceDeviceNameCallback(pa_context *c, const pa_source_info *i, int is_last, void *data) +static void SourceDeviceNameCallback(pa_context *c, const pa_source_info *i, int is_last, void *data) { if (i) { - char **devname = (char **) data; + char **devname = (char **)data; *devname = SDL_strdup(i->name); } + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } -static SDL_bool -FindDeviceName(struct SDL_PrivateAudioData *h, const SDL_bool iscapture, void *handle) +static SDL_bool FindDeviceName(struct SDL_PrivateAudioData *h, const SDL_bool iscapture, void *handle) { - const uint32_t idx = ((uint32_t) ((intptr_t) handle)) - 1; + const uint32_t idx = ((uint32_t)((intptr_t)handle)) - 1; - if (handle == NULL) { /* NULL == default device. */ + if (!handle) { /* NULL == default device. */ return SDL_TRUE; } if (iscapture) { - WaitForPulseOperation(h->mainloop, - PULSEAUDIO_pa_context_get_source_info_by_index(h->context, idx, - SourceDeviceNameCallback, &h->device_name)); + WaitForPulseOperation(PULSEAUDIO_pa_context_get_source_info_by_index(pulseaudio_context, idx, SourceDeviceNameCallback, &h->device_name)); } else { - WaitForPulseOperation(h->mainloop, - PULSEAUDIO_pa_context_get_sink_info_by_index(h->context, idx, - SinkDeviceNameCallback, &h->device_name)); + WaitForPulseOperation(PULSEAUDIO_pa_context_get_sink_info_by_index(pulseaudio_context, idx, SinkDeviceNameCallback, &h->device_name)); } - return (h->device_name != NULL); + return h->device_name != NULL; +} + +static void PulseStreamStateChangeCallback(pa_stream *stream, void *userdata) +{ + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); /* just signal any waiting code, it can look up the details. */ } -static int -PULSEAUDIO_OpenDevice(_THIS, const char *devname) +static int PULSEAUDIO_OpenDevice(_THIS, const char *devname) { struct SDL_PrivateAudioData *h = NULL; SDL_AudioFormat test_format; @@ -557,15 +592,16 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) pa_buffer_attr paattr; pa_channel_map pacmap; pa_stream_flags_t flags = 0; - const char *name = NULL; SDL_bool iscapture = this->iscapture; - int state = 0, format = PA_SAMPLE_INVALID; - int rc = 0; + int format = PA_SAMPLE_INVALID; + int retval = 0; + + SDL_assert(pulseaudio_threaded_mainloop != NULL); + SDL_assert(pulseaudio_context != NULL); /* Initialize all variables that we clean on shutdown */ - h = this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + h = this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -603,7 +639,7 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) break; } if (!test_format) { - return SDL_SetError("%s: Unsupported audio format", "pulseaudio"); + return SDL_SetError("pulseaudio: Unsupported audio format"); } this->spec.format = test_format; paspec.format = format; @@ -614,8 +650,8 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ if (!iscapture) { h->mixlen = this->spec.size; - h->mixbuf = (Uint8 *) SDL_malloc(h->mixlen); - if (h->mixbuf == NULL) { + h->mixbuf = (Uint8 *)SDL_malloc(h->mixlen); + if (!h->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(h->mixbuf, this->spec.silence, this->spec.size); @@ -632,78 +668,70 @@ PULSEAUDIO_OpenDevice(_THIS, const char *devname) paattr.minreq = -1; flags |= PA_STREAM_ADJUST_LATENCY; - if (ConnectToPulseServer(&h->mainloop, &h->context) < 0) { - return SDL_SetError("Could not connect to PulseAudio server"); - } + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); if (!FindDeviceName(h, iscapture, this->handle)) { - return SDL_SetError("Requested PulseAudio sink/source missing?"); - } - - /* The SDL ALSA output hints us that we use Windows' channel mapping */ - /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */ - PULSEAUDIO_pa_channel_map_init_auto(&pacmap, this->spec.channels, - PA_CHANNEL_MAP_WAVEEX); - - name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME); - - h->stream = PULSEAUDIO_pa_stream_new( - h->context, - (name && *name) ? name : "Audio Stream", /* stream description */ - &paspec, /* sample format spec */ - &pacmap /* channel map */ + retval = SDL_SetError("Requested PulseAudio sink/source missing?"); + } else { + const char *name = SDL_GetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME); + /* The SDL ALSA output hints us that we use Windows' channel mapping */ + /* https://bugzilla.libsdl.org/show_bug.cgi?id=110 */ + PULSEAUDIO_pa_channel_map_init_auto(&pacmap, this->spec.channels, + PA_CHANNEL_MAP_WAVEEX); + + h->stream = PULSEAUDIO_pa_stream_new( + pulseaudio_context, + (name && *name) ? name : "Audio Stream", /* stream description */ + &paspec, /* sample format spec */ + &pacmap /* channel map */ ); - if (h->stream == NULL) { - return SDL_SetError("Could not set up PulseAudio stream"); - } + if (!h->stream) { + retval = SDL_SetError("Could not set up PulseAudio stream"); + } else { + int rc; - /* now that we have multi-device support, don't move a stream from - a device that was unplugged to something else, unless we're default. */ - if (h->device_name != NULL) { - flags |= PA_STREAM_DONT_MOVE; - } + PULSEAUDIO_pa_stream_set_state_callback(h->stream, PulseStreamStateChangeCallback, NULL); + /* now that we have multi-device support, don't move a stream from + a device that was unplugged to something else, unless we're default. */ + if (h->device_name) { + flags |= PA_STREAM_DONT_MOVE; + } - if (iscapture) { - rc = PULSEAUDIO_pa_stream_connect_record(h->stream, h->device_name, &paattr, flags); - } else { - PULSEAUDIO_pa_stream_set_write_callback(h->stream, WriteCallback, h); - rc = PULSEAUDIO_pa_stream_connect_playback(h->stream, h->device_name, &paattr, flags, NULL, NULL); - } + if (iscapture) { + PULSEAUDIO_pa_stream_set_read_callback(h->stream, ReadCallback, h); + rc = PULSEAUDIO_pa_stream_connect_record(h->stream, h->device_name, &paattr, flags); + } else { + PULSEAUDIO_pa_stream_set_write_callback(h->stream, WriteCallback, h); + rc = PULSEAUDIO_pa_stream_connect_playback(h->stream, h->device_name, &paattr, flags, NULL, NULL); + } - if (rc < 0) { - return SDL_SetError("Could not connect PulseAudio stream"); - } + if (rc < 0) { + retval = SDL_SetError("Could not connect PulseAudio stream"); + } else { + int state = PULSEAUDIO_pa_stream_get_state(h->stream); + while (PA_STREAM_IS_GOOD(state) && (state != PA_STREAM_READY)) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + state = PULSEAUDIO_pa_stream_get_state(h->stream); + } - do { - if (PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) { - return SDL_SetError("pa_mainloop_iterate() failed"); - } - state = PULSEAUDIO_pa_stream_get_state(h->stream); - if (!PA_STREAM_IS_GOOD(state)) { - return SDL_SetError("Could not connect PulseAudio stream"); + if (!PA_STREAM_IS_GOOD(state)) { + retval = SDL_SetError("Could not connect PulseAudio stream"); + } + } } - } while (state != PA_STREAM_READY); + } - /* We're ready to rock and roll. :-) */ - return 0; + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + + /* We're (hopefully) ready to rock and roll. :-) */ + return retval; } -static pa_mainloop *hotplug_mainloop = NULL; -static pa_context *hotplug_context = NULL; -static SDL_Thread *hotplug_thread = NULL; - -/* These are the OS identifiers (i.e. ALSA strings)... */ -static char *default_sink_path = NULL; -static char *default_source_path = NULL; -/* ... and these are the descriptions we use in GetDefaultAudioInfo. */ -static char *default_sink_name = NULL; -static char *default_source_name = NULL; /* device handles are device index + 1, cast to void*, so we never pass a NULL. */ -static SDL_AudioFormat -PulseFormatToSDLFormat(pa_sample_format_t format) +static SDL_AudioFormat PulseFormatToSDLFormat(pa_sample_format_t format) { switch (format) { case PA_SAMPLE_U8: @@ -726,11 +754,10 @@ PulseFormatToSDLFormat(pa_sample_format_t format) } /* This is called when PulseAudio adds an output ("sink") device. */ -static void -SinkInfoCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) +static void SinkInfoCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) { SDL_AudioSpec spec; - SDL_bool add = (SDL_bool) ((intptr_t) data); + SDL_bool add = (SDL_bool)((intptr_t)data); if (i) { spec.freq = i->sample_spec.rate; spec.channels = i->sample_spec.channels; @@ -742,24 +769,24 @@ SinkInfoCallback(pa_context *c, const pa_sink_info *i, int is_last, void *data) spec.userdata = NULL; if (add) { - SDL_AddAudioDevice(SDL_FALSE, i->description, &spec, (void *) ((intptr_t) i->index+1)); + SDL_AddAudioDevice(SDL_FALSE, i->description, &spec, (void *)((intptr_t)i->index + 1)); } - if (default_sink_path != NULL && SDL_strcmp(i->name, default_sink_path) == 0) { - if (default_sink_name != NULL) { + if (default_sink_path && SDL_strcmp(i->name, default_sink_path) == 0) { + if (default_sink_name) { SDL_free(default_sink_name); } default_sink_name = SDL_strdup(i->description); } } + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } /* This is called when PulseAudio adds a capture ("source") device. */ -static void -SourceInfoCallback(pa_context *c, const pa_source_info *i, int is_last, void *data) +static void SourceInfoCallback(pa_context *c, const pa_source_info *i, int is_last, void *data) { SDL_AudioSpec spec; - SDL_bool add = (SDL_bool) ((intptr_t) data); + SDL_bool add = (SDL_bool)((intptr_t)data); if (i) { /* Maybe skip "monitor" sources. These are just output from other sinks. */ if (include_monitors || (i->monitor_of_sink == PA_INVALID_INDEX)) { @@ -773,100 +800,125 @@ SourceInfoCallback(pa_context *c, const pa_source_info *i, int is_last, void *da spec.userdata = NULL; if (add) { - SDL_AddAudioDevice(SDL_TRUE, i->description, &spec, (void *) ((intptr_t) i->index+1)); + SDL_AddAudioDevice(SDL_TRUE, i->description, &spec, (void *)((intptr_t)i->index + 1)); } - if (default_source_path != NULL && SDL_strcmp(i->name, default_source_path) == 0) { - if (default_source_name != NULL) { + if (default_source_path && SDL_strcmp(i->name, default_source_path) == 0) { + if (default_source_name) { SDL_free(default_source_name); } default_source_name = SDL_strdup(i->description); } } } + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } -static void -ServerInfoCallback(pa_context *c, const pa_server_info *i, void *data) +static void ServerInfoCallback(pa_context *c, const pa_server_info *i, void *data) { - if (default_sink_path != NULL) { - SDL_free(default_sink_path); - } - if (default_source_path != NULL) { - SDL_free(default_source_path); - } + SDL_free(default_sink_path); + SDL_free(default_source_path); default_sink_path = SDL_strdup(i->default_sink_name); default_source_path = SDL_strdup(i->default_source_name); + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } /* This is called when PulseAudio has a device connected/removed/changed. */ -static void -HotplugCallback(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *data) +static void HotplugCallback(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *data) { const SDL_bool added = ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW); const SDL_bool removed = ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE); const SDL_bool changed = ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_CHANGE); - if (added || removed || changed) { /* we only care about add/remove events. */ + if (added || removed || changed) { /* we only care about add/remove events. */ const SDL_bool sink = ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK); const SDL_bool source = ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE); /* adds need sink details from the PulseAudio server. Another callback... */ + /* (just unref all these operations right away, because we aren't going to wait on them and their callbacks will handle any work, so they can free as soon as that happens.) */ if ((added || changed) && sink) { if (changed) { - PULSEAUDIO_pa_context_get_server_info(hotplug_context, ServerInfoCallback, NULL); + PULSEAUDIO_pa_operation_unref(PULSEAUDIO_pa_context_get_server_info(pulseaudio_context, ServerInfoCallback, NULL)); } - PULSEAUDIO_pa_context_get_sink_info_by_index(hotplug_context, idx, SinkInfoCallback, (void*) ((intptr_t) added)); + PULSEAUDIO_pa_operation_unref(PULSEAUDIO_pa_context_get_sink_info_by_index(pulseaudio_context, idx, SinkInfoCallback, (void *)((intptr_t)added))); } else if ((added || changed) && source) { if (changed) { - PULSEAUDIO_pa_context_get_server_info(hotplug_context, ServerInfoCallback, NULL); + PULSEAUDIO_pa_operation_unref(PULSEAUDIO_pa_context_get_server_info(pulseaudio_context, ServerInfoCallback, NULL)); } - PULSEAUDIO_pa_context_get_source_info_by_index(hotplug_context, idx, SourceInfoCallback, (void*) ((intptr_t) added)); + PULSEAUDIO_pa_operation_unref(PULSEAUDIO_pa_context_get_source_info_by_index(pulseaudio_context, idx, SourceInfoCallback, (void *)((intptr_t)added))); } else if (removed && (sink || source)) { /* removes we can handle just with the device index. */ - SDL_RemoveAudioDevice(source != 0, (void *) ((intptr_t) idx+1)); + SDL_RemoveAudioDevice(source != 0, (void *)((intptr_t)idx + 1)); } } + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); } /* this runs as a thread while the Pulse target is initialized to catch hotplug events. */ -static int SDLCALL -HotplugThread(void *data) +static int SDLCALL HotplugThread(void *data) { - pa_operation *o; + pa_operation *op; + SDL_SetThreadPriority(SDL_THREAD_PRIORITY_LOW); - PULSEAUDIO_pa_context_set_subscribe_callback(hotplug_context, HotplugCallback, NULL); - o = PULSEAUDIO_pa_context_subscribe(hotplug_context, PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE, NULL, NULL); - PULSEAUDIO_pa_operation_unref(o); /* don't wait for it, just do our thing. */ - PULSEAUDIO_pa_mainloop_run(hotplug_mainloop, NULL); + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + PULSEAUDIO_pa_context_set_subscribe_callback(pulseaudio_context, HotplugCallback, NULL); + + /* don't WaitForPulseOperation on the subscription; when it's done we'll be able to get hotplug events, but waiting doesn't changing anything. */ + op = PULSEAUDIO_pa_context_subscribe(pulseaudio_context, PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE, NULL, NULL); + + SDL_SemPost(data); + + while (SDL_AtomicGet(&pulseaudio_hotplug_thread_active)) { + PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop); + if (op && PULSEAUDIO_pa_operation_get_state(op) != PA_OPERATION_RUNNING) { + PULSEAUDIO_pa_operation_unref(op); + op = NULL; + } + } + + if (op) { + PULSEAUDIO_pa_operation_unref(op); + } + + PULSEAUDIO_pa_context_set_subscribe_callback(pulseaudio_context, NULL, NULL); + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); return 0; } -static void -PULSEAUDIO_DetectDevices() +static void PULSEAUDIO_DetectDevices(void) { - WaitForPulseOperation(hotplug_mainloop, PULSEAUDIO_pa_context_get_server_info(hotplug_context, ServerInfoCallback, NULL)); - WaitForPulseOperation(hotplug_mainloop, PULSEAUDIO_pa_context_get_sink_info_list(hotplug_context, SinkInfoCallback, (void*) ((intptr_t) SDL_TRUE))); - WaitForPulseOperation(hotplug_mainloop, PULSEAUDIO_pa_context_get_source_info_list(hotplug_context, SourceInfoCallback, (void*) ((intptr_t) SDL_TRUE))); + SDL_sem *ready_sem = SDL_CreateSemaphore(0); + + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + WaitForPulseOperation(PULSEAUDIO_pa_context_get_server_info(pulseaudio_context, ServerInfoCallback, NULL)); + WaitForPulseOperation(PULSEAUDIO_pa_context_get_sink_info_list(pulseaudio_context, SinkInfoCallback, (void *)((intptr_t)SDL_TRUE))); + WaitForPulseOperation(PULSEAUDIO_pa_context_get_source_info_list(pulseaudio_context, SourceInfoCallback, (void *)((intptr_t)SDL_TRUE))); + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); /* ok, we have a sane list, let's set up hotplug notifications now... */ - hotplug_thread = SDL_CreateThreadInternal(HotplugThread, "PulseHotplug", 256 * 1024, NULL); + SDL_AtomicSet(&pulseaudio_hotplug_thread_active, 1); + pulseaudio_hotplug_thread = SDL_CreateThreadInternal(HotplugThread, "PulseHotplug", 0, ready_sem); + if (pulseaudio_hotplug_thread) { + SDL_SemWait(ready_sem); + } else { + SDL_AtomicSet(&pulseaudio_hotplug_thread_active, 0); // thread failed to start, we'll go on without hotplug. + } + SDL_DestroySemaphore(ready_sem); } -static int -PULSEAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +static int PULSEAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { int i; int numdevices; char *target; if (iscapture) { - if (default_source_name == NULL) { + if (!default_source_name) { return SDL_SetError("PulseAudio could not find a default source"); } target = default_source_name; } else { - if (default_sink_name == NULL) { + if (!default_sink_name) { return SDL_SetError("PulseAudio could not find a default sink"); } target = default_sink_name; @@ -875,7 +927,7 @@ PULSEAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) numdevices = SDL_GetNumAudioDevices(iscapture); for (i = 0; i < numdevices; i += 1) { if (SDL_strcmp(SDL_GetAudioDeviceName(i, iscapture), target) == 0) { - if (name != NULL) { + if (name) { *name = SDL_strdup(target); } SDL_GetAudioDeviceSpec(i, iscapture, spec); @@ -885,47 +937,36 @@ PULSEAUDIO_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) return SDL_SetError("Could not find default PulseAudio device"); } -static void -PULSEAUDIO_Deinitialize(void) +static void PULSEAUDIO_Deinitialize(void) { - if (hotplug_thread) { - PULSEAUDIO_pa_mainloop_quit(hotplug_mainloop, 0); - SDL_WaitThread(hotplug_thread, NULL); - hotplug_thread = NULL; + if (pulseaudio_hotplug_thread) { + PULSEAUDIO_pa_threaded_mainloop_lock(pulseaudio_threaded_mainloop); + SDL_AtomicSet(&pulseaudio_hotplug_thread_active, 0); + PULSEAUDIO_pa_threaded_mainloop_signal(pulseaudio_threaded_mainloop, 0); + PULSEAUDIO_pa_threaded_mainloop_unlock(pulseaudio_threaded_mainloop); + SDL_WaitThread(pulseaudio_hotplug_thread, NULL); + pulseaudio_hotplug_thread = NULL; } - DisconnectFromPulseServer(hotplug_mainloop, hotplug_context); - hotplug_mainloop = NULL; - hotplug_context = NULL; + DisconnectFromPulseServer(); - if (default_sink_path != NULL) { - SDL_free(default_sink_path); - default_sink_path = NULL; - } - if (default_source_path != NULL) { - SDL_free(default_source_path); - default_source_path = NULL; - } - if (default_sink_name != NULL) { - SDL_free(default_sink_name); - default_sink_name = NULL; - } - if (default_source_name != NULL) { - SDL_free(default_source_name); - default_source_name = NULL; - } + SDL_free(default_sink_path); + default_sink_path = NULL; + SDL_free(default_source_path); + default_source_path = NULL; + SDL_free(default_sink_name); + default_sink_name = NULL; + SDL_free(default_source_name); + default_source_name = NULL; UnloadPulseAudioLibrary(); } -static SDL_bool -PULSEAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool PULSEAUDIO_Init(SDL_AudioDriverImpl *impl) { if (LoadPulseAudioLibrary() < 0) { return SDL_FALSE; - } - - if (ConnectToPulseServer(&hotplug_mainloop, &hotplug_context) < 0) { + } else if (ConnectToPulseServer() < 0) { UnloadPulseAudioLibrary(); return SDL_FALSE; } @@ -947,7 +988,7 @@ PULSEAUDIO_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap PULSEAUDIO_bootstrap = { diff --git a/src/audio/pulseaudio/SDL_pulseaudio.h b/src/audio/pulseaudio/SDL_pulseaudio.h index 7ef45fe2538e9..f58d9c0532bde 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.h +++ b/src/audio/pulseaudio/SDL_pulseaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_pulseaudio_h_ #define SDL_pulseaudio_h_ -#include +#include #include "../SDL_sysaudio.h" @@ -35,15 +35,13 @@ struct SDL_PrivateAudioData char *device_name; /* pulseaudio structures */ - pa_mainloop *mainloop; - pa_context *context; pa_stream *stream; /* Raw mixing buffer */ Uint8 *mixbuf; int mixlen; - int bytes_requested; /* bytes of data the hardware wants _now_. */ + int bytes_requested; /* bytes of data the hardware wants _now_. */ const Uint8 *capturebuf; int capturelen; diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c index 7a843f364e32a..c9cc6168ba02e 100644 --- a/src/audio/qsa/SDL_qsa_audio.c +++ b/src/audio/qsa/SDL_qsa_audio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_QSA +#ifdef SDL_AUDIO_DRIVER_QSA #include #include @@ -74,15 +74,13 @@ uint32_t qsa_playback_devices; QSA_Device qsa_capture_device[QSA_MAX_DEVICES]; uint32_t qsa_capture_devices; -static SDL_INLINE int -QSA_SetError(const char *fn, int status) +static int QSA_SetError(const char *fn, int status) { return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status)); } /* !!! FIXME: does this need to be here? Does the SDL version not work? */ -static void -QSA_ThreadInit(_THIS) +static void QSA_ThreadInit(_THIS) { /* Increase default 10 priority to 25 to avoid jerky sound */ struct sched_param param; @@ -93,8 +91,7 @@ QSA_ThreadInit(_THIS) } /* PCM channel parameters initialize function */ -static void -QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) +static void QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) { SDL_zerop(cpars); cpars->channel = SND_PCM_CHANNEL_PLAYBACK; @@ -111,8 +108,7 @@ QSA_InitAudioParams(snd_pcm_channel_params_t * cpars) } /* This function waits until it is possible to write a full sound buffer */ -static void -QSA_WaitDevice(_THIS) +static void QSA_WaitDevice(_THIS) { int result; @@ -137,8 +133,7 @@ QSA_WaitDevice(_THIS) } } -static void -QSA_PlayDevice(_THIS) +static void QSA_PlayDevice(_THIS) { snd_pcm_channel_status_t cstatus; int written; @@ -230,16 +225,15 @@ QSA_PlayDevice(_THIS) } } -static Uint8 * -QSA_GetDeviceBuf(_THIS) +static Uint8 *QSA_GetDeviceBuf(_THIS) { return this->hidden->pcm_buf; } -static void -QSA_CloseDevice(_THIS) +static void QSA_CloseDevice(_THIS) { - if (this->hidden->audio_handle != NULL) { + if (this->hidden->audio_handle) { +#if _NTO_VERSION < 710 if (!this->iscapture) { /* Finish playing available samples */ snd_pcm_plugin_flush(this->hidden->audio_handle, @@ -249,6 +243,7 @@ QSA_CloseDevice(_THIS) snd_pcm_plugin_flush(this->hidden->audio_handle, SND_PCM_CHANNEL_CAPTURE); } +#endif snd_pcm_close(this->hidden->audio_handle); } @@ -256,8 +251,7 @@ QSA_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -QSA_OpenDevice(_THIS, const char *devname) +static int QSA_OpenDevice(_THIS, const char *devname) { const QSA_Device *device = (const QSA_Device *) this->handle; SDL_bool iscapture = this->iscapture; @@ -273,14 +267,14 @@ QSA_OpenDevice(_THIS, const char *devname) (sizeof (struct SDL_PrivateAudioData))); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } /* Initialize channel transfer parameters to default */ QSA_InitAudioParams(&cparams); - if (device != NULL) { + if (device) { /* Open requested audio device */ this->hidden->deviceno = device->deviceno; this->hidden->cardno = device->cardno; @@ -393,7 +387,7 @@ QSA_OpenDevice(_THIS, const char *devname) */ this->hidden->pcm_buf = (Uint8 *) SDL_malloc(this->hidden->pcm_len); - if (this->hidden->pcm_buf == NULL) { + if (!this->hidden->pcm_buf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->pcm_buf, this->spec.silence, @@ -435,8 +429,7 @@ QSA_OpenDevice(_THIS, const char *devname) return 0; } -static void -QSA_DetectDevices(void) +static void QSA_DetectDevices(void) { uint32_t it; uint32_t cards; @@ -581,8 +574,7 @@ QSA_DetectDevices(void) } } -static void -QSA_Deinitialize(void) +static void QSA_Deinitialize(void) { /* Clear devices array on shutdown */ /* !!! FIXME: we zero these on init...any reason to do it here? */ @@ -592,8 +584,7 @@ QSA_Deinitialize(void) qsa_capture_devices = 0; } -static SDL_bool -QSA_Init(SDL_AudioDriverImpl * impl) +static SDL_bool QSA_Init(SDL_AudioDriverImpl * impl) { /* Clear devices array */ SDL_zeroa(qsa_playback_device); diff --git a/src/audio/qsa/SDL_qsa_audio.h b/src/audio/qsa/SDL_qsa_audio.h index e4845c9eb1eca..5140e6dcf0590 100644 --- a/src/audio/qsa/SDL_qsa_audio.h +++ b/src/audio/qsa/SDL_qsa_audio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/sndio/SDL_sndioaudio.c b/src/audio/sndio/SDL_sndioaudio.c index 29e5315b97e50..480afd904c871 100644 --- a/src/audio/sndio/SDL_sndioaudio.c +++ b/src/audio/sndio/SDL_sndioaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,11 +21,11 @@ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_SNDIO +#ifdef SDL_AUDIO_DRIVER_SNDIO /* OpenBSD sndio target */ -#if HAVE_STDIO_H +#ifdef HAVE_STDIO_H #include #endif @@ -52,7 +52,7 @@ #define SIO_DEVANY "default" #endif -static struct sio_hdl * (*SNDIO_sio_open)(const char *, unsigned int, int); +static struct sio_hdl *(*SNDIO_sio_open)(const char *, unsigned int, int); static void (*SNDIO_sio_close)(struct sio_hdl *); static int (*SNDIO_sio_setpar)(struct sio_hdl *, struct sio_par *); static int (*SNDIO_sio_getpar)(struct sio_hdl *, struct sio_par *); @@ -70,11 +70,10 @@ static void (*SNDIO_sio_initpar)(struct sio_par *); static const char *sndio_library = SDL_AUDIO_DRIVER_SNDIO_DYNAMIC; static void *sndio_handle = NULL; -static int -load_sndio_sym(const char *fn, void **addr) +static int load_sndio_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(sndio_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return 0; } @@ -83,14 +82,14 @@ load_sndio_sym(const char *fn, void **addr) } /* cast funcs to char* first, to please GCC's strict aliasing rules. */ -#define SDL_SNDIO_SYM(x) \ - if (!load_sndio_sym(#x, (void **) (char *) &SNDIO_##x)) return -1 +#define SDL_SNDIO_SYM(x) \ + if (!load_sndio_sym(#x, (void **)(char *)&SNDIO_##x)) \ + return -1 #else #define SDL_SNDIO_SYM(x) SNDIO_##x = x #endif -static int -load_sndio_syms(void) +static int load_sndio_syms(void) { SDL_SNDIO_SYM(sio_open); SDL_SNDIO_SYM(sio_close); @@ -112,22 +111,20 @@ load_sndio_syms(void) #ifdef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC -static void -UnloadSNDIOLibrary(void) +static void UnloadSNDIOLibrary(void) { - if (sndio_handle != NULL) { + if (sndio_handle) { SDL_UnloadObject(sndio_handle); sndio_handle = NULL; } } -static int -LoadSNDIOLibrary(void) +static int LoadSNDIOLibrary(void) { int retval = 0; - if (sndio_handle == NULL) { + if (!sndio_handle) { sndio_handle = SDL_LoadObject(sndio_library); - if (sndio_handle == NULL) { + if (!sndio_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { @@ -142,13 +139,11 @@ LoadSNDIOLibrary(void) #else -static void -UnloadSNDIOLibrary(void) +static void UnloadSNDIOLibrary(void) { } -static int -LoadSNDIOLibrary(void) +static int LoadSNDIOLibrary(void) { load_sndio_syms(); return 0; @@ -156,24 +151,19 @@ LoadSNDIOLibrary(void) #endif /* SDL_AUDIO_DRIVER_SNDIO_DYNAMIC */ - - - -static void -SNDIO_WaitDevice(_THIS) +static void SNDIO_WaitDevice(_THIS) { /* no-op; SNDIO_sio_write() blocks if necessary. */ } -static void -SNDIO_PlayDevice(_THIS) +static void SNDIO_PlayDevice(_THIS) { const int written = SNDIO_sio_write(this->hidden->dev, this->hidden->mixbuf, this->hidden->mixlen); /* If we couldn't write, assume fatal error for now */ - if ( written == 0 ) { + if (written == 0) { SDL_OpenedAudioDeviceDisconnected(this); } #ifdef DEBUG_AUDIO @@ -181,8 +171,7 @@ SNDIO_PlayDevice(_THIS) #endif } -static int -SNDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int SNDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) { size_t r; int revents; @@ -191,8 +180,8 @@ SNDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) /* Emulate a blocking read */ r = SNDIO_sio_read(this->hidden->dev, buffer, buflen); while (r == 0 && !SNDIO_sio_eof(this->hidden->dev)) { - if ((nfds = SNDIO_sio_pollfd(this->hidden->dev, this->hidden->pfd, POLLIN)) <= 0 - || poll(this->hidden->pfd, nfds, INFTIM) < 0) { + nfds = SNDIO_sio_pollfd(this->hidden->dev, this->hidden->pfd, POLLIN); + if (nfds <= 0 || poll(this->hidden->pfd, nfds, INFTIM) < 0) { return -1; } revents = SNDIO_sio_revents(this->hidden->dev, this->hidden->pfd); @@ -203,11 +192,10 @@ SNDIO_CaptureFromDevice(_THIS, void *buffer, int buflen) break; } } - return (int) r; + return (int)r; } -static void -SNDIO_FlushCapture(_THIS) +static void SNDIO_FlushCapture(_THIS) { char buf[512]; @@ -216,19 +204,17 @@ SNDIO_FlushCapture(_THIS) } } -static Uint8 * -SNDIO_GetDeviceBuf(_THIS) +static Uint8 *SNDIO_GetDeviceBuf(_THIS) { return this->hidden->mixbuf; } -static void -SNDIO_CloseDevice(_THIS) +static void SNDIO_CloseDevice(_THIS) { - if ( this->hidden->pfd != NULL ) { + if (this->hidden->pfd) { SDL_free(this->hidden->pfd); } - if ( this->hidden->dev != NULL ) { + if (this->hidden->dev) { SNDIO_sio_stop(this->hidden->dev); SNDIO_sio_close(this->hidden->dev); } @@ -236,8 +222,7 @@ SNDIO_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -SNDIO_OpenDevice(_THIS, const char *devname) +static int SNDIO_OpenDevice(_THIS, const char *devname) { SDL_AudioFormat test_format; struct sio_par par; @@ -245,7 +230,7 @@ SNDIO_OpenDevice(_THIS, const char *devname) this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -253,16 +238,18 @@ SNDIO_OpenDevice(_THIS, const char *devname) this->hidden->mixlen = this->spec.size; /* Capture devices must be non-blocking for SNDIO_FlushCapture */ - if ((this->hidden->dev = - SNDIO_sio_open(devname != NULL ? devname : SIO_DEVANY, - iscapture ? SIO_REC : SIO_PLAY, iscapture)) == NULL) { + this->hidden->dev = SNDIO_sio_open(devname ? devname : SIO_DEVANY, + iscapture ? SIO_REC : SIO_PLAY, iscapture); + if (!this->hidden->dev) { return SDL_SetError("sio_open() failed"); } /* Allocate the pollfd array for capture devices */ - if (iscapture && (this->hidden->pfd = - SDL_malloc(sizeof(struct pollfd) * SNDIO_sio_nfds(this->hidden->dev))) == NULL) { - return SDL_OutOfMemory(); + if (iscapture) { + this->hidden->pfd = SDL_malloc(sizeof(struct pollfd) * SNDIO_sio_nfds(this->hidden->dev)); + if (!this->hidden->pfd) { + return SDL_OutOfMemory(); + } } SNDIO_sio_initpar(&par); @@ -298,23 +285,23 @@ SNDIO_OpenDevice(_THIS, const char *devname) return SDL_SetError("%s: Unsupported audio format", "sndio"); } - if ((par.bps == 4) && (par.sig) && (par.le)) + if ((par.bps == 4) && (par.sig) && (par.le)) { this->spec.format = AUDIO_S32LSB; - else if ((par.bps == 4) && (par.sig) && (!par.le)) + } else if ((par.bps == 4) && (par.sig) && (!par.le)) { this->spec.format = AUDIO_S32MSB; - else if ((par.bps == 2) && (par.sig) && (par.le)) + } else if ((par.bps == 2) && (par.sig) && (par.le)) { this->spec.format = AUDIO_S16LSB; - else if ((par.bps == 2) && (par.sig) && (!par.le)) + } else if ((par.bps == 2) && (par.sig) && (!par.le)) { this->spec.format = AUDIO_S16MSB; - else if ((par.bps == 2) && (!par.sig) && (par.le)) + } else if ((par.bps == 2) && (!par.sig) && (par.le)) { this->spec.format = AUDIO_U16LSB; - else if ((par.bps == 2) && (!par.sig) && (!par.le)) + } else if ((par.bps == 2) && (!par.sig) && (!par.le)) { this->spec.format = AUDIO_U16MSB; - else if ((par.bps == 1) && (par.sig)) + } else if ((par.bps == 1) && (par.sig)) { this->spec.format = AUDIO_S8; - else if ((par.bps == 1) && (!par.sig)) + } else if ((par.bps == 1) && (!par.sig)) { this->spec.format = AUDIO_U8; - else { + } else { return SDL_SetError("sndio: Got unsupported hardware audio format."); } @@ -327,8 +314,8 @@ SNDIO_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixlen = this->spec.size; - this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); - if (this->hidden->mixbuf == NULL) { + this->hidden->mixbuf = (Uint8 *)SDL_malloc(this->hidden->mixlen); + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); @@ -341,21 +328,18 @@ SNDIO_OpenDevice(_THIS, const char *devname) return 0; } -static void -SNDIO_Deinitialize(void) +static void SNDIO_Deinitialize(void) { UnloadSNDIOLibrary(); } -static void -SNDIO_DetectDevices(void) +static void SNDIO_DetectDevices(void) { - SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *) 0x1); - SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *) 0x2); + SDL_AddAudioDevice(SDL_FALSE, DEFAULT_OUTPUT_DEVNAME, NULL, (void *)0x1); + SDL_AddAudioDevice(SDL_TRUE, DEFAULT_INPUT_DEVNAME, NULL, (void *)0x2); } -static SDL_bool -SNDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool SNDIO_Init(SDL_AudioDriverImpl *impl) { if (LoadSNDIOLibrary() < 0) { return SDL_FALSE; @@ -375,7 +359,7 @@ SNDIO_Init(SDL_AudioDriverImpl * impl) impl->AllowsArbitraryDeviceNames = SDL_TRUE; impl->HasCaptureSupport = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap SNDIO_bootstrap = { diff --git a/src/audio/sndio/SDL_sndioaudio.h b/src/audio/sndio/SDL_sndioaudio.h index 57db05cb93e88..ecd5c39eddbb4 100644 --- a/src/audio/sndio/SDL_sndioaudio.h +++ b/src/audio/sndio/SDL_sndioaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { diff --git a/src/audio/sun/SDL_sunaudio.c b/src/audio/sun/SDL_sunaudio.c index 59569242321ce..2a046c41d744a 100644 --- a/src/audio/sun/SDL_sunaudio.c +++ b/src/audio/sun/SDL_sunaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,22 +20,16 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_SUNAUDIO +#ifdef SDL_AUDIO_DRIVER_SUNAUDIO /* Allow access to a raw mixing buffer */ +#include #include #include -#ifdef __NETBSD__ #include #include -#endif -#ifdef __SVR4 -#include -#else #include -#include -#endif #include #include "SDL_timer.h" @@ -55,15 +49,13 @@ static Uint8 snd2au(int sample); /* Audio driver bootstrap functions */ -static void -SUNAUDIO_DetectDevices(void) +static void SUNAUDIO_DetectDevices(void) { SDL_EnumUnixAudioDevices(1, (int (*)(int)) NULL); } #ifdef DEBUG_AUDIO -void -CheckUnderflow(_THIS) +void CheckUnderflow(_THIS) { #ifdef AUDIO_GETBUFINFO audio_info_t info; @@ -78,8 +70,7 @@ CheckUnderflow(_THIS) } #endif -static void -SUNAUDIO_WaitDevice(_THIS) +static void SUNAUDIO_WaitDevice(_THIS) { #ifdef AUDIO_GETBUFINFO #define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */ @@ -102,8 +93,7 @@ SUNAUDIO_WaitDevice(_THIS) #endif } -static void -SUNAUDIO_PlayDevice(_THIS) +static void SUNAUDIO_PlayDevice(_THIS) { /* Write the audio data */ if (this->hidden->ulaw_only) { @@ -170,14 +160,12 @@ SUNAUDIO_PlayDevice(_THIS) } } -static Uint8 * -SUNAUDIO_GetDeviceBuf(_THIS) +static Uint8 *SUNAUDIO_GetDeviceBuf(_THIS) { return (this->hidden->mixbuf); } -static void -SUNAUDIO_CloseDevice(_THIS) +static void SUNAUDIO_CloseDevice(_THIS) { SDL_free(this->hidden->ulaw_buf); if (this->hidden->audio_fd >= 0) { @@ -187,8 +175,7 @@ SUNAUDIO_CloseDevice(_THIS) SDL_free(this->hidden); } -static int -SUNAUDIO_OpenDevice(_THIS, const char *devname) +static int SUNAUDIO_OpenDevice(_THIS, const char *devname) { #ifdef AUDIO_SETINFO int enc; @@ -201,17 +188,16 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname) /* We don't care what the devname is...we'll try to open anything. */ /* ...but default to first name in the list... */ - if (devname == NULL) { + if (!devname) { devname = SDL_GetAudioDeviceName(0, iscapture); - if (devname == NULL) { + if (!devname) { return SDL_SetError("No such audio device"); } } /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -289,7 +275,7 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname) break; /* try again */ case AUDIO_ENCODING_LINEAR: - /* linear 16bit didn't work either, resort to -law */ + /* linear 16bit didn't work either, resort to �-law */ enc = AUDIO_ENCODING_ULAW; this->spec.channels = 1; this->spec.freq = 8000; @@ -313,7 +299,7 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname) (this->spec.freq / 8); this->hidden->frequency = 8; this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize); - if (this->hidden->ulaw_buf == NULL) { + if (!this->hidden->ulaw_buf) { return SDL_OutOfMemory(); } this->spec.channels = 1; @@ -333,7 +319,7 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname) /* Allocate mixing buffer */ this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->spec.size); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); @@ -360,8 +346,7 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname) /* provided "as is" without express or implied warranty. */ /************************************************************************/ -static Uint8 -snd2au(int sample) +static Uint8 snd2au(int sample) { int mask; @@ -395,8 +380,7 @@ snd2au(int sample) return (mask & sample); } -static SDL_bool -SUNAUDIO_Init(SDL_AudioDriverImpl * impl) +static SDL_bool SUNAUDIO_Init(SDL_AudioDriverImpl * impl) { /* Set the function pointers */ impl->DetectDevices = SUNAUDIO_DetectDevices; diff --git a/src/audio/sun/SDL_sunaudio.h b/src/audio/sun/SDL_sunaudio.h index 33ee755f6e8ce..976f0fc1fabcb 100644 --- a/src/audio/sun/SDL_sunaudio.h +++ b/src/audio/sun/SDL_sunaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/audio/vita/SDL_vitaaudio.c b/src/audio/vita/SDL_vitaaudio.c index 88f4a3285b3e7..88ce007413a22 100644 --- a/src/audio/vita/SDL_vitaaudio.c +++ b/src/audio/vita/SDL_vitaaudio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_VITA +#ifdef SDL_AUDIO_DRIVER_VITA #include #include @@ -39,11 +39,10 @@ #include #include -#define SCE_AUDIO_SAMPLE_ALIGN(s) (((s) + 63) & ~63) -#define SCE_AUDIO_MAX_VOLUME 0x8000 +#define SCE_AUDIO_SAMPLE_ALIGN(s) (((s) + 63) & ~63) +#define SCE_AUDIO_MAX_VOLUME 0x8000 -static int -VITAAUD_OpenCaptureDevice(_THIS) +static int VITAAUD_OpenCaptureDevice(_THIS) { this->spec.freq = 16000; this->spec.samples = 512; @@ -51,7 +50,7 @@ VITAAUD_OpenCaptureDevice(_THIS) SDL_CalculateAudioSpec(&this->spec); - this->hidden->port = sceAudioInOpenPort(SCE_AUDIO_IN_PORT_TYPE_VOICE , 512, 16000, SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO); + this->hidden->port = sceAudioInOpenPort(SCE_AUDIO_IN_PORT_TYPE_VOICE, 512, 16000, SCE_AUDIO_IN_PARAM_FORMAT_S16_MONO); if (this->hidden->port < 0) { return SDL_SetError("Couldn't open audio in port: %x", this->hidden->port); @@ -60,16 +59,15 @@ VITAAUD_OpenCaptureDevice(_THIS) return 0; } -static int -VITAAUD_OpenDevice(_THIS, const char *devname) +static int VITAAUD_OpenDevice(_THIS, const char *devname) { int format, mixlen, i, port = SCE_AUDIO_OUT_PORT_TYPE_MAIN; - int vols[2] = {SCE_AUDIO_MAX_VOLUME, SCE_AUDIO_MAX_VOLUME}; + int vols[2] = { SCE_AUDIO_MAX_VOLUME, SCE_AUDIO_MAX_VOLUME }; SDL_AudioFormat test_format; this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); - if (this->hidden == NULL) { + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_memset(this->hidden, 0, sizeof(*this->hidden)); @@ -81,7 +79,7 @@ VITAAUD_OpenDevice(_THIS, const char *devname) } } - if(!test_format) { + if (!test_format) { return SDL_SetError("Unsupported audio format"); } @@ -99,8 +97,8 @@ VITAAUD_OpenDevice(_THIS, const char *devname) be a multiple of 64 bytes. Our sample count is already a multiple of 64, so spec->size should be a multiple of 64 as well. */ mixlen = this->spec.size * NUM_BUFFERS; - this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen); - if (this->hidden->rawbuf == NULL) { + this->hidden->rawbuf = (Uint8 *)memalign(64, mixlen); + if (!this->hidden->rawbuf) { return SDL_SetError("Couldn't allocate mixing buffer"); } @@ -111,7 +109,7 @@ VITAAUD_OpenDevice(_THIS, const char *devname) format = SCE_AUDIO_OUT_MODE_STEREO; } - if(this->spec.freq < 48000) { + if (this->spec.freq < 48000) { port = SCE_AUDIO_OUT_PORT_TYPE_BGM; } @@ -122,7 +120,7 @@ VITAAUD_OpenDevice(_THIS, const char *devname) return SDL_SetError("Couldn't open audio out port: %x", this->hidden->port); } - sceAudioOutSetVolume(this->hidden->port, SCE_AUDIO_VOLUME_FLAG_L_CH|SCE_AUDIO_VOLUME_FLAG_R_CH, vols); + sceAudioOutSetVolume(this->hidden->port, SCE_AUDIO_VOLUME_FLAG_L_CH | SCE_AUDIO_VOLUME_FLAG_R_CH, vols); SDL_memset(this->hidden->rawbuf, 0, mixlen); for (i = 0; i < NUM_BUFFERS; i++) { @@ -164,8 +162,8 @@ static void VITAAUD_CloseDevice(_THIS) this->hidden->port = -1; } - if (!this->iscapture && this->hidden->rawbuf != NULL) { - free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */ + if (!this->iscapture && this->hidden->rawbuf) { + free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */ this->hidden->rawbuf = NULL; } } @@ -194,8 +192,7 @@ static void VITAAUD_ThreadInit(_THIS) } } -static SDL_bool -VITAAUD_Init(SDL_AudioDriverImpl * impl) +static SDL_bool VITAAUD_Init(SDL_AudioDriverImpl *impl) { /* Set the function pointers */ impl->OpenDevice = VITAAUD_OpenDevice; @@ -212,7 +209,7 @@ VITAAUD_Init(SDL_AudioDriverImpl * impl) impl->OnlyHasDefaultOutputDevice = SDL_TRUE; impl->OnlyHasDefaultCaptureDevice = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap VITAAUD_bootstrap = { diff --git a/src/audio/vita/SDL_vitaaudio.h b/src/audio/vita/SDL_vitaaudio.h index a5601b28c2fdb..4cde8d8e659c4 100644 --- a/src/audio/vita/SDL_vitaaudio.h +++ b/src/audio/vita/SDL_vitaaudio.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,19 +25,20 @@ #include "../SDL_sysaudio.h" /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this #define NUM_BUFFERS 2 -struct SDL_PrivateAudioData { +struct SDL_PrivateAudioData +{ /* The hardware input/output port. */ - int port; + int port; /* The raw allocated mixing buffer. */ - Uint8 *rawbuf; + Uint8 *rawbuf; /* Individual mixing buffers. */ - Uint8 *mixbufs[NUM_BUFFERS]; + Uint8 *mixbufs[NUM_BUFFERS]; /* Index of the next available mixing buffer. */ - int next_buffer; + int next_buffer; }; #endif /* _SDL_vitaaudio_h */ diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 3a1acfeb08ab9..f516b1e2e7df0 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_WASAPI +#ifdef SDL_AUDIO_DRIVER_WASAPI #include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_immdevice.h" @@ -36,7 +36,7 @@ /* These constants aren't available in older SDKs */ #ifndef AUDCLNT_STREAMFLAGS_RATEADJUST -#define AUDCLNT_STREAMFLAGS_RATEADJUST 0x00100000 +#define AUDCLNT_STREAMFLAGS_RATEADJUST 0x00100000 #endif #ifndef AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY #define AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY 0x08000000 @@ -46,17 +46,16 @@ #endif /* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */ -static const IID SDL_IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483,{ 0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2 } }; -static const IID SDL_IID_IAudioCaptureClient = { 0xc8adbd64, 0xe71e, 0x48a0,{ 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17 } }; +static const IID SDL_IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483, { 0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2 } }; +static const IID SDL_IID_IAudioCaptureClient = { 0xc8adbd64, 0xe71e, 0x48a0, { 0xa4, 0xde, 0x18, 0x5c, 0x39, 0x5c, 0xd3, 0x17 } }; -static void -WASAPI_DetectDevices(void) + +static void WASAPI_DetectDevices(void) { WASAPI_EnumerateEndpoints(); } -static SDL_INLINE SDL_bool -WasapiFailed(_THIS, const HRESULT err) +static SDL_INLINE SDL_bool WasapiFailed(_THIS, const HRESULT err) { if (err == S_OK) { return SDL_FALSE; @@ -73,39 +72,38 @@ WasapiFailed(_THIS, const HRESULT err) return SDL_TRUE; } -static int -UpdateAudioStream(_THIS, const SDL_AudioSpec *oldspec) +static int UpdateAudioStream(_THIS, const SDL_AudioSpec *oldspec) { /* Since WASAPI requires us to handle all audio conversion, and our device format might have changed, we might have to add/remove/change the audio stream that the higher level uses to convert data, so SDL keeps firing the callback as if nothing happened here. */ - if ( (this->callbackspec.channels == this->spec.channels) && - (this->callbackspec.format == this->spec.format) && - (this->callbackspec.freq == this->spec.freq) && - (this->callbackspec.samples == this->spec.samples) ) { + if ((this->callbackspec.channels == this->spec.channels) && + (this->callbackspec.format == this->spec.format) && + (this->callbackspec.freq == this->spec.freq) && + (this->callbackspec.samples == this->spec.samples)) { /* no need to buffer/convert in an AudioStream! */ SDL_FreeAudioStream(this->stream); this->stream = NULL; - } else if ( (oldspec->channels == this->spec.channels) && - (oldspec->format == this->spec.format) && - (oldspec->freq == this->spec.freq) ) { + } else if ((oldspec->channels == this->spec.channels) && + (oldspec->format == this->spec.format) && + (oldspec->freq == this->spec.freq)) { /* The existing audio stream is okay to keep using. */ } else { /* replace the audiostream for new format */ SDL_FreeAudioStream(this->stream); if (this->iscapture) { this->stream = SDL_NewAudioStream(this->spec.format, - this->spec.channels, this->spec.freq, - this->callbackspec.format, - this->callbackspec.channels, - this->callbackspec.freq); + this->spec.channels, this->spec.freq, + this->callbackspec.format, + this->callbackspec.channels, + this->callbackspec.freq); } else { this->stream = SDL_NewAudioStream(this->callbackspec.format, - this->callbackspec.channels, - this->callbackspec.freq, this->spec.format, - this->spec.channels, this->spec.freq); + this->callbackspec.channels, + this->callbackspec.freq, this->spec.format, + this->spec.channels, this->spec.freq); } if (!this->stream) { @@ -113,10 +111,16 @@ UpdateAudioStream(_THIS, const SDL_AudioSpec *oldspec) } } + /* if the device sample size changed, make sure we're asking for enough data. */ + if (this->callbackspec.samples != this->spec.samples) { + this->callbackspec.samples = this->spec.samples; + SDL_CalculateAudioSpec(&this->callbackspec); + } + /* make sure our scratch buffer can cover the new device spec. */ if (this->spec.size > this->work_buffer_len) { - Uint8 *ptr = (Uint8 *) SDL_realloc(this->work_buffer, this->spec.size); - if (ptr == NULL) { + Uint8 *ptr = (Uint8 *)SDL_realloc(this->work_buffer, this->spec.size); + if (!ptr) { return SDL_OutOfMemory(); } this->work_buffer = ptr; @@ -126,16 +130,14 @@ UpdateAudioStream(_THIS, const SDL_AudioSpec *oldspec) return 0; } - static void ReleaseWasapiDevice(_THIS); -static SDL_bool -RecoverWasapiDevice(_THIS) +static SDL_bool RecoverWasapiDevice(_THIS) { - ReleaseWasapiDevice(this); /* dump the lost device's handles. */ + ReleaseWasapiDevice(this); /* dump the lost device's handles. */ if (this->hidden->default_device_generation) { - this->hidden->default_device_generation = SDL_AtomicGet(this->iscapture ? &SDL_IMMDevice_DefaultCaptureGeneration : &SDL_IMMDevice_DefaultPlaybackGeneration); + this->hidden->default_device_generation = SDL_AtomicGet(this->iscapture ? &SDL_IMMDevice_DefaultCaptureGeneration : &SDL_IMMDevice_DefaultPlaybackGeneration); } /* this can fail for lots of reasons, but the most likely is we had a @@ -150,26 +152,25 @@ RecoverWasapiDevice(_THIS) this->hidden->device_lost = SDL_FALSE; - return SDL_TRUE; /* okay, carry on with new device details! */ + return SDL_TRUE; /* okay, carry on with new device details! */ } -static SDL_bool -RecoverWasapiIfLost(_THIS) +static SDL_bool RecoverWasapiIfLost(_THIS) { const int generation = this->hidden->default_device_generation; SDL_bool lost = this->hidden->device_lost; if (!SDL_AtomicGet(&this->enabled)) { - return SDL_FALSE; /* already failed. */ + return SDL_FALSE; /* already failed. */ } if (!this->hidden->client) { - return SDL_TRUE; /* still waiting for activation. */ + return SDL_TRUE; /* still waiting for activation. */ } if (!lost && (generation > 0)) { /* is a default device? */ const int newgen = SDL_AtomicGet(this->iscapture ? &SDL_IMMDevice_DefaultCaptureGeneration : &SDL_IMMDevice_DefaultPlaybackGeneration); - if (generation != newgen) { /* the desired default device was changed, jump over to it. */ + if (generation != newgen) { /* the desired default device was changed, jump over to it. */ lost = SDL_TRUE; } } @@ -177,33 +178,35 @@ RecoverWasapiIfLost(_THIS) return lost ? RecoverWasapiDevice(this) : SDL_TRUE; } -static Uint8 * -WASAPI_GetDeviceBuf(_THIS) +static void WASAPI_WaitDevice(_THIS); + +static Uint8 *WASAPI_GetDeviceBuf(_THIS) { /* get an endpoint buffer from WASAPI. */ BYTE *buffer = NULL; while (RecoverWasapiIfLost(this) && this->hidden->render) { - if (!WasapiFailed(this, IAudioRenderClient_GetBuffer(this->hidden->render, this->spec.samples, &buffer))) { - return (Uint8 *) buffer; + const HRESULT ret = IAudioRenderClient_GetBuffer(this->hidden->render, this->spec.samples, &buffer); + if (ret == AUDCLNT_E_BUFFER_TOO_LARGE) { + WASAPI_WaitDevice(this); /* see if we can wait on the buffer to drain some more first... */ + } else if (!WasapiFailed(this, ret)) { + return (Uint8 *)buffer; } SDL_assert(buffer == NULL); } - return (Uint8 *) buffer; + return (Uint8 *)buffer; } -static void -WASAPI_PlayDevice(_THIS) +static void WASAPI_PlayDevice(_THIS) { - if (this->hidden->render != NULL) { /* definitely activated? */ + if (this->hidden->render) { /* definitely activated? */ /* WasapiFailed() will mark the device for reacquisition or removal elsewhere. */ WasapiFailed(this, IAudioRenderClient_ReleaseBuffer(this->hidden->render, this->spec.samples, 0)); } } -static void -WASAPI_WaitDevice(_THIS) +static void WASAPI_WaitDevice(_THIS) { while (RecoverWasapiIfLost(this) && this->hidden->client && this->hidden->event) { DWORD waitResult = WaitForSingleObjectEx(this->hidden->event, 200, FALSE); @@ -230,8 +233,7 @@ WASAPI_WaitDevice(_THIS) } } -static int -WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen) { SDL_AudioStream *stream = this->hidden->capturestream; const int avail = SDL_AudioStreamAvailable(stream); @@ -263,7 +265,7 @@ WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen) if ((ret == AUDCLNT_S_BUFFER_EMPTY) || !frames) { WASAPI_WaitDevice(this); } else if (ret == S_OK) { - const int total = ((int) frames) * this->hidden->framesize; + const int total = ((int)frames) * this->hidden->framesize; const int cpy = SDL_min(buflen, total); const int leftover = total - cpy; const SDL_bool silent = (flags & AUDCLNT_BUFFERFLAGS_SILENT) ? SDL_TRUE : SDL_FALSE; @@ -273,15 +275,15 @@ WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen) } else { SDL_memcpy(buffer, ptr, cpy); } - + if (leftover > 0) { ptr += cpy; if (silent) { - SDL_memset(ptr, this->spec.silence, leftover); /* I guess this is safe? */ + SDL_memset(ptr, this->spec.silence, leftover); /* I guess this is safe? */ } if (SDL_AudioStreamPut(stream, ptr, leftover) == -1) { - return -1; /* uhoh, out of memory, etc. Kill device. :( */ + return -1; /* uhoh, out of memory, etc. Kill device. :( */ } } @@ -292,36 +294,34 @@ WASAPI_CaptureFromDevice(_THIS, void *buffer, int buflen) } } - return -1; /* unrecoverable error. */ + return -1; /* unrecoverable error. */ } -static void -WASAPI_FlushCapture(_THIS) +static void WASAPI_FlushCapture(_THIS) { BYTE *ptr = NULL; UINT32 frames = 0; DWORD flags = 0; if (!this->hidden->capture) { - return; /* not activated yet? */ + return; /* not activated yet? */ } /* just read until we stop getting packets, throwing them away. */ while (SDL_TRUE) { const HRESULT ret = IAudioCaptureClient_GetBuffer(this->hidden->capture, &ptr, &frames, &flags, NULL, NULL); if (ret == AUDCLNT_S_BUFFER_EMPTY) { - break; /* no more buffered data; we're done. */ + break; /* no more buffered data; we're done. */ } else if (WasapiFailed(this, ret)) { - break; /* failed for some other reason, abort. */ + break; /* failed for some other reason, abort. */ } else if (WasapiFailed(this, IAudioCaptureClient_ReleaseBuffer(this->hidden->capture, frames))) { - break; /* something broke. */ + break; /* something broke. */ } } SDL_AudioStreamClear(this->hidden->capturestream); } -static void -ReleaseWasapiDevice(_THIS) +static void ReleaseWasapiDevice(_THIS) { if (this->hidden->client) { IAudioClient_Stop(this->hidden->client); @@ -360,20 +360,17 @@ ReleaseWasapiDevice(_THIS) } } -static void -WASAPI_CloseDevice(_THIS) +static void WASAPI_CloseDevice(_THIS) { WASAPI_UnrefDevice(this); } -void -WASAPI_RefDevice(_THIS) +void WASAPI_RefDevice(_THIS) { SDL_AtomicIncRef(&this->hidden->refcount); } -void -WASAPI_UnrefDevice(_THIS) +void WASAPI_UnrefDevice(_THIS) { if (!SDL_AtomicDecRef(&this->hidden->refcount)) { return; @@ -385,13 +382,17 @@ WASAPI_UnrefDevice(_THIS) our callback thread. We do that in WASAPI_ThreadDeinit(). (likewise for this->hidden->coinitialized). */ ReleaseWasapiDevice(this); + + if (SDL_ThreadID() == this->hidden->open_threadid) { + WIN_CoUninitialize(); /* if you closed from a different thread than you opened, sorry, it's a leak. We can't help you. */ + } + SDL_free(this->hidden->devid); SDL_free(this->hidden); } /* This is called once a device is activated, possibly asynchronously. */ -int -WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) +int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) { /* !!! FIXME: we could request an exclusive mode stream, which is lower latency; !!! it will write into the kernel's audio buffer directly instead of @@ -406,7 +407,7 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) !!! do in any case. */ const SDL_AudioSpec oldspec = this->spec; const AUDCLNT_SHAREMODE sharemode = AUDCLNT_SHAREMODE_SHARED; - UINT32 bufsize = 0; /* this is in sample frames, not samples, not bytes. */ + UINT32 bufsize = 0; /* this is in sample frames, not samples, not bytes. */ REFERENCE_TIME default_period = 0; IAudioClient *client = this->hidden->client; IAudioRenderClient *render = NULL; @@ -425,7 +426,7 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) this->hidden->event = CreateEventW(NULL, 0, 0, NULL); #endif - if (this->hidden->event == NULL) { + if (!this->hidden->event) { return WIN_SetError("WASAPI can't create an event handle"); } @@ -437,7 +438,7 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) SDL_assert(waveformat != NULL); this->hidden->waveformat = waveformat; - this->spec.channels = (Uint8) waveformat->nChannels; + this->spec.channels = (Uint8)waveformat->nChannels; /* Make sure we have a valid format that we can convert to whatever WASAPI wants. */ wasapi_format = WaveFormatToSDLFormat(waveformat); @@ -496,6 +497,11 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) this->spec.samples = (Uint16)SDL_ceilf(period_frames); } + /* regardless of what we calculated for the period size, clamp it to the expected hardware buffer size. */ + if (this->spec.samples > bufsize) { + this->spec.samples = bufsize; + } + /* Update the fragment size as size in bytes */ SDL_CalculateAudioSpec(&this->spec); @@ -504,10 +510,10 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) if (this->iscapture) { this->hidden->capturestream = SDL_NewAudioStream(this->spec.format, this->spec.channels, this->spec.freq, this->spec.format, this->spec.channels, this->spec.freq); if (!this->hidden->capturestream) { - return -1; /* already set SDL_Error */ + return -1; /* already set SDL_Error */ } - ret = IAudioClient_GetService(client, &SDL_IID_IAudioCaptureClient, (void**) &capture); + ret = IAudioClient_GetService(client, &SDL_IID_IAudioCaptureClient, (void **)&capture); if (FAILED(ret)) { return WIN_SetErrorFromHRESULT("WASAPI can't get capture client service", ret); } @@ -519,9 +525,9 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) return WIN_SetErrorFromHRESULT("WASAPI can't start capture", ret); } - WASAPI_FlushCapture(this); /* MSDN says you should flush capture endpoint right after startup. */ + WASAPI_FlushCapture(this); /* MSDN says you should flush capture endpoint right after startup. */ } else { - ret = IAudioClient_GetService(client, &SDL_IID_IAudioRenderClient, (void**) &render); + ret = IAudioClient_GetService(client, &SDL_IID_IAudioRenderClient, (void **)&render); if (FAILED(ret)) { return WIN_SetErrorFromHRESULT("WASAPI can't get render client service", ret); } @@ -538,26 +544,28 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) return UpdateAudioStream(this, &oldspec); } - return 0; /* good to go. */ + return 0; /* good to go. */ } - -static int -WASAPI_OpenDevice(_THIS, const char *devname) +static int WASAPI_OpenDevice(_THIS, const char *devname) { - LPCWSTR devid = (LPCWSTR) this->handle; + LPCWSTR devid = (LPCWSTR)this->handle; /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); - WASAPI_RefDevice(this); /* so CloseDevice() will unref to zero. */ + WASAPI_RefDevice(this); /* so CloseDevice() will unref to zero. */ + + if (FAILED(WIN_CoInitialize())) { /* WASAPI uses COM, we need to make sure it's initialized. You have to close the device from the same thread!! */ + return SDL_SetError("WIN_CoInitialize failed during WASAPI device open"); + } + this->hidden->open_threadid = SDL_ThreadID(); /* set this _after_ coinitialize so we don't uninit if device fails at the wrong moment. */ - if (!devid) { /* is default device? */ + if (!devid) { /* is default device? */ this->hidden->default_device_generation = SDL_AtomicGet(this->iscapture ? &SDL_IMMDevice_DefaultCaptureGeneration : &SDL_IMMDevice_DefaultPlaybackGeneration); } else { this->hidden->devid = SDL_wcsdup(devid); @@ -567,7 +575,7 @@ WASAPI_OpenDevice(_THIS, const char *devname) } if (WASAPI_ActivateDevice(this, SDL_FALSE) == -1) { - return -1; /* already set error. */ + return -1; /* already set error. */ } /* Ready, but waiting for async device activation. @@ -581,26 +589,22 @@ WASAPI_OpenDevice(_THIS, const char *devname) return 0; } -static void -WASAPI_ThreadInit(_THIS) +static void WASAPI_ThreadInit(_THIS) { WASAPI_PlatformThreadInit(this); } -static void -WASAPI_ThreadDeinit(_THIS) +static void WASAPI_ThreadDeinit(_THIS) { WASAPI_PlatformThreadDeinit(this); } -static void -WASAPI_Deinitialize(void) +static void WASAPI_Deinitialize(void) { WASAPI_PlatformDeinit(); } -static SDL_bool -WASAPI_Init(SDL_AudioDriverImpl * impl) +static SDL_bool WASAPI_Init(SDL_AudioDriverImpl *impl) { if (WASAPI_PlatformInit() == -1) { return SDL_FALSE; @@ -622,13 +626,13 @@ WASAPI_Init(SDL_AudioDriverImpl * impl) impl->HasCaptureSupport = SDL_TRUE; impl->SupportsNonPow2Samples = SDL_TRUE; - return SDL_TRUE; /* this audio target is available. */ + return SDL_TRUE; /* this audio target is available. */ } AudioBootStrap WASAPI_bootstrap = { "wasapi", "WASAPI", WASAPI_Init, SDL_FALSE }; -#endif /* SDL_AUDIO_DRIVER_WASAPI */ +#endif /* SDL_AUDIO_DRIVER_WASAPI */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/wasapi/SDL_wasapi.h b/src/audio/wasapi/SDL_wasapi.h index 69060677d25ff..97865986acf03 100644 --- a/src/audio/wasapi/SDL_wasapi.h +++ b/src/audio/wasapi/SDL_wasapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -47,6 +47,7 @@ struct SDL_PrivateAudioData SDL_AudioStream *capturestream; HANDLE event; HANDLE task; + SDL_threadID open_threadid; SDL_bool coinitialized; int framesize; int default_device_generation; diff --git a/src/audio/wasapi/SDL_wasapi_win32.c b/src/audio/wasapi/SDL_wasapi_win32.c index 13f05b661d207..0c1e8bd3df93b 100644 --- a/src/audio/wasapi/SDL_wasapi_win32.c +++ b/src/audio/wasapi/SDL_wasapi_win32.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ The code in SDL_wasapi.c is used by both standard Windows and WinRT builds to deal with audio and calls into these functions. */ -#if SDL_AUDIO_DRIVER_WASAPI && !defined(__WINRT__) +#if defined(SDL_AUDIO_DRIVER_WASAPI) && !defined(__WINRT__) #include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_immdevice.h" @@ -47,26 +47,24 @@ static pfnAvSetMmThreadCharacteristicsW pAvSetMmThreadCharacteristicsW = NULL; static pfnAvRevertMmThreadCharacteristics pAvRevertMmThreadCharacteristics = NULL; /* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */ -static const IID SDL_IID_IAudioClient = { 0x1cb9ad4c, 0xdbfa, 0x4c32,{ 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2 } }; +static const IID SDL_IID_IAudioClient = { 0x1cb9ad4c, 0xdbfa, 0x4c32, { 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2 } }; -int -WASAPI_PlatformInit(void) +int WASAPI_PlatformInit(void) { if (SDL_IMMDevice_Init() < 0) { return -1; /* This is set by SDL_IMMDevice_Init */ } - libavrt = LoadLibrary(TEXT("avrt.dll")); /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */ + libavrt = LoadLibrary(TEXT("avrt.dll")); /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */ if (libavrt) { - pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW) GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW"); - pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics) GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics"); + pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW)GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW"); + pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics)GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics"); } return 0; } -void -WASAPI_PlatformDeinit(void) +void WASAPI_PlatformDeinit(void) { if (libavrt) { FreeLibrary(libavrt); @@ -79,11 +77,10 @@ WASAPI_PlatformDeinit(void) SDL_IMMDevice_Quit(); } -void -WASAPI_PlatformThreadInit(_THIS) +void WASAPI_PlatformThreadInit(_THIS) { /* this thread uses COM. */ - if (SUCCEEDED(WIN_CoInitialize())) { /* can't report errors, hope it worked! */ + if (SUCCEEDED(WIN_CoInitialize())) { /* can't report errors, hope it worked! */ this->hidden->coinitialized = SDL_TRUE; } @@ -94,8 +91,7 @@ WASAPI_PlatformThreadInit(_THIS) } } -void -WASAPI_PlatformThreadDeinit(_THIS) +void WASAPI_PlatformThreadDeinit(_THIS) { /* Set this thread back to normal priority. */ if (this->hidden->task && pAvRevertMmThreadCharacteristics) { @@ -109,8 +105,7 @@ WASAPI_PlatformThreadDeinit(_THIS) } } -int -WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) +int WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) { IMMDevice *device = NULL; HRESULT ret; @@ -121,7 +116,7 @@ WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) } /* this is not async in standard win32, yay! */ - ret = IMMDevice_Activate(device, &SDL_IID_IAudioClient, CLSCTX_ALL, NULL, (void **) &this->hidden->client); + ret = IMMDevice_Activate(device, &SDL_IID_IAudioClient, CLSCTX_ALL, NULL, (void **)&this->hidden->client); IMMDevice_Release(device); if (FAILED(ret)) { @@ -130,33 +125,29 @@ WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) } SDL_assert(this->hidden->client != NULL); - if (WASAPI_PrepDevice(this, isrecovery) == -1) { /* not async, fire it right away. */ + if (WASAPI_PrepDevice(this, isrecovery) == -1) { /* not async, fire it right away. */ return -1; } - return 0; /* good to go. */ + return 0; /* good to go. */ } -void -WASAPI_EnumerateEndpoints(void) +void WASAPI_EnumerateEndpoints(void) { SDL_IMMDevice_EnumerateEndpoints(SDL_FALSE); } -int -WASAPI_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +int WASAPI_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { return SDL_IMMDevice_GetDefaultAudioInfo(name, spec, iscapture); } -void -WASAPI_PlatformDeleteActivationHandler(void *handler) +void WASAPI_PlatformDeleteActivationHandler(void *handler) { /* not asynchronous. */ SDL_assert(!"This function should have only been called on WinRT."); } -#endif /* SDL_AUDIO_DRIVER_WASAPI && !defined(__WINRT__) */ +#endif /* SDL_AUDIO_DRIVER_WASAPI && !defined(__WINRT__) */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/audio/wasapi/SDL_wasapi_winrt.cpp b/src/audio/wasapi/SDL_wasapi_winrt.cpp index 235ae7d32eb48..6bf862800d8b6 100644 --- a/src/audio/wasapi/SDL_wasapi_winrt.cpp +++ b/src/audio/wasapi/SDL_wasapi_winrt.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ // is in SDL_wasapi_win32.c. The code in SDL_wasapi.c is used by both standard // Windows and WinRT builds to deal with audio and calls into these functions. -#if SDL_AUDIO_DRIVER_WASAPI && defined(__WINRT__) +#if defined(SDL_AUDIO_DRIVER_WASAPI) && defined(__WINRT__) #include #include @@ -53,13 +53,13 @@ using namespace Windows::Media::Devices; using namespace Windows::Foundation; using namespace Microsoft::WRL; -static Platform::String^ SDL_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4e27-bc73-6882a1bb8e4c} 0"; +static Platform::String ^ SDL_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4e27-bc73-6882a1bb8e4c} 0"; static void WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid); static void WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid); extern "C" { - SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration; - SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration; +SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration; +SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration; } /* This is a list of device id strings we have inflight, so we have consistent pointers to the same device. */ @@ -73,20 +73,20 @@ static DevIdList *deviceid_list = NULL; class SDL_WasapiDeviceEventHandler { -public: + public: SDL_WasapiDeviceEventHandler(const SDL_bool _iscapture); ~SDL_WasapiDeviceEventHandler(); - void OnDeviceAdded(DeviceWatcher^ sender, DeviceInformation^ args); - void OnDeviceRemoved(DeviceWatcher^ sender, DeviceInformationUpdate^ args); - void OnDeviceUpdated(DeviceWatcher^ sender, DeviceInformationUpdate^ args); - void OnEnumerationCompleted(DeviceWatcher^ sender, Platform::Object^ args); - void OnDefaultRenderDeviceChanged(Platform::Object^ sender, DefaultAudioRenderDeviceChangedEventArgs^ args); - void OnDefaultCaptureDeviceChanged(Platform::Object^ sender, DefaultAudioCaptureDeviceChangedEventArgs^ args); - SDL_semaphore* completed; - -private: + void OnDeviceAdded(DeviceWatcher ^ sender, DeviceInformation ^ args); + void OnDeviceRemoved(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args); + void OnDeviceUpdated(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args); + void OnEnumerationCompleted(DeviceWatcher ^ sender, Platform::Object ^ args); + void OnDefaultRenderDeviceChanged(Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args); + void OnDefaultCaptureDeviceChanged(Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args); + SDL_semaphore *completed; + + private: const SDL_bool iscapture; - DeviceWatcher^ watcher; + DeviceWatcher ^ watcher; Windows::Foundation::EventRegistrationToken added_handler; Windows::Foundation::EventRegistrationToken removed_handler; Windows::Foundation::EventRegistrationToken updated_handler; @@ -95,29 +95,27 @@ class SDL_WasapiDeviceEventHandler }; SDL_WasapiDeviceEventHandler::SDL_WasapiDeviceEventHandler(const SDL_bool _iscapture) - : iscapture(_iscapture) - , completed(SDL_CreateSemaphore(0)) + : iscapture(_iscapture), completed(SDL_CreateSemaphore(0)) { if (!completed) - return; // uhoh. + return; // uhoh. - Platform::String^ selector = _iscapture ? MediaDevice::GetAudioCaptureSelector() : - MediaDevice::GetAudioRenderSelector(); - Platform::Collections::Vector properties; + Platform::String ^ selector = _iscapture ? MediaDevice::GetAudioCaptureSelector() : MediaDevice::GetAudioRenderSelector(); + Platform::Collections::Vector properties; properties.Append(SDL_PKEY_AudioEngine_DeviceFormat); watcher = DeviceInformation::CreateWatcher(selector, properties.GetView()); if (!watcher) - return; // uhoh. + return; // uhoh. // !!! FIXME: this doesn't need a lambda here, I think, if I make SDL_WasapiDeviceEventHandler a proper C++/CX class. --ryan. - added_handler = watcher->Added += ref new TypedEventHandler([this](DeviceWatcher^ sender, DeviceInformation^ args) { OnDeviceAdded(sender, args); } ); - removed_handler = watcher->Removed += ref new TypedEventHandler([this](DeviceWatcher^ sender, DeviceInformationUpdate^ args) { OnDeviceRemoved(sender, args); } ); - updated_handler = watcher->Updated += ref new TypedEventHandler([this](DeviceWatcher^ sender, DeviceInformationUpdate^ args) { OnDeviceUpdated(sender, args); } ); - completed_handler = watcher->EnumerationCompleted += ref new TypedEventHandler([this](DeviceWatcher^ sender, Platform::Object^ args) { OnEnumerationCompleted(sender, args); } ); + added_handler = watcher->Added += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformation ^ args) { OnDeviceAdded(sender, args); }); + removed_handler = watcher->Removed += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceRemoved(sender, args); }); + updated_handler = watcher->Updated += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceUpdated(sender, args); }); + completed_handler = watcher->EnumerationCompleted += ref new TypedEventHandler([this](DeviceWatcher ^ sender, Platform::Object ^ args) { OnEnumerationCompleted(sender, args); }); if (iscapture) { - default_changed_handler = MediaDevice::DefaultAudioCaptureDeviceChanged += ref new TypedEventHandler([this](Platform::Object^ sender, DefaultAudioCaptureDeviceChangedEventArgs^ args) { OnDefaultCaptureDeviceChanged(sender, args); } ); + default_changed_handler = MediaDevice::DefaultAudioCaptureDeviceChanged += ref new TypedEventHandler([this](Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args) { OnDefaultCaptureDeviceChanged(sender, args); }); } else { - default_changed_handler = MediaDevice::DefaultAudioRenderDeviceChanged += ref new TypedEventHandler([this](Platform::Object^ sender, DefaultAudioRenderDeviceChangedEventArgs^ args) { OnDefaultRenderDeviceChanged(sender, args); } ); + default_changed_handler = MediaDevice::DefaultAudioRenderDeviceChanged += ref new TypedEventHandler([this](Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args) { OnDefaultRenderDeviceChanged(sender, args); }); } watcher->Start(); } @@ -144,17 +142,16 @@ SDL_WasapiDeviceEventHandler::~SDL_WasapiDeviceEventHandler() } } -void -SDL_WasapiDeviceEventHandler::OnDeviceAdded(DeviceWatcher^ sender, DeviceInformation^ info) +void SDL_WasapiDeviceEventHandler::OnDeviceAdded(DeviceWatcher ^ sender, DeviceInformation ^ info) { SDL_assert(sender == this->watcher); - char *utf8dev = WIN_StringToUTF8(info->Name->Data()); + char *utf8dev = WIN_StringToUTF8W(info->Name->Data()); if (utf8dev) { WAVEFORMATEXTENSIBLE fmt; - Platform::Object^ obj = info->Properties->Lookup(SDL_PKEY_AudioEngine_DeviceFormat); + Platform::Object ^ obj = info->Properties->Lookup(SDL_PKEY_AudioEngine_DeviceFormat); if (obj) { - IPropertyValue^ property = (IPropertyValue^) obj; - Platform::Array^ data; + IPropertyValue ^ property = (IPropertyValue ^) obj; + Platform::Array ^ data; property->GetUInt8Array(&data); SDL_memcpy(&fmt, data->Data, SDL_min(data->Length, sizeof(WAVEFORMATEXTENSIBLE))); } else { @@ -166,41 +163,35 @@ SDL_WasapiDeviceEventHandler::OnDeviceAdded(DeviceWatcher^ sender, DeviceInforma } } -void -SDL_WasapiDeviceEventHandler::OnDeviceRemoved(DeviceWatcher^ sender, DeviceInformationUpdate^ info) +void SDL_WasapiDeviceEventHandler::OnDeviceRemoved(DeviceWatcher ^ sender, DeviceInformationUpdate ^ info) { SDL_assert(sender == this->watcher); WASAPI_RemoveDevice(this->iscapture, info->Id->Data()); } -void -SDL_WasapiDeviceEventHandler::OnDeviceUpdated(DeviceWatcher^ sender, DeviceInformationUpdate^ args) +void SDL_WasapiDeviceEventHandler::OnDeviceUpdated(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { SDL_assert(sender == this->watcher); } -void -SDL_WasapiDeviceEventHandler::OnEnumerationCompleted(DeviceWatcher^ sender, Platform::Object^ args) +void SDL_WasapiDeviceEventHandler::OnEnumerationCompleted(DeviceWatcher ^ sender, Platform::Object ^ args) { SDL_assert(sender == this->watcher); SDL_SemPost(this->completed); } -void -SDL_WasapiDeviceEventHandler::OnDefaultRenderDeviceChanged(Platform::Object^ sender, DefaultAudioRenderDeviceChangedEventArgs^ args) +void SDL_WasapiDeviceEventHandler::OnDefaultRenderDeviceChanged(Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args) { - SDL_assert(this->iscapture); + SDL_assert(!this->iscapture); SDL_AtomicAdd(&SDL_IMMDevice_DefaultPlaybackGeneration, 1); } -void -SDL_WasapiDeviceEventHandler::OnDefaultCaptureDeviceChanged(Platform::Object^ sender, DefaultAudioCaptureDeviceChangedEventArgs^ args) +void SDL_WasapiDeviceEventHandler::OnDefaultCaptureDeviceChanged(Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args) { - SDL_assert(!this->iscapture); + SDL_assert(this->iscapture); SDL_AtomicAdd(&SDL_IMMDevice_DefaultCaptureGeneration, 1); } - static SDL_WasapiDeviceEventHandler *playback_device_event_handler; static SDL_WasapiDeviceEventHandler *capture_device_event_handler; @@ -240,10 +231,11 @@ void WASAPI_EnumerateEndpoints(void) SDL_SemWait(capture_device_event_handler->completed); } -struct SDL_WasapiActivationHandler : public RuntimeClass< RuntimeClassFlags< ClassicCom >, FtmBase, IActivateAudioInterfaceCompletionHandler > +struct SDL_WasapiActivationHandler : public RuntimeClass, FtmBase, IActivateAudioInterfaceCompletionHandler> { SDL_WasapiActivationHandler() : device(nullptr) {} - STDMETHOD(ActivateCompleted)(IActivateAudioInterfaceAsyncOperation *operation); + STDMETHOD(ActivateCompleted) + (IActivateAudioInterfaceAsyncOperation *operation); SDL_AudioDevice *device; }; @@ -256,23 +248,20 @@ SDL_WasapiActivationHandler::ActivateCompleted(IActivateAudioInterfaceAsyncOpera return S_OK; } -void -WASAPI_PlatformDeleteActivationHandler(void *handler) +void WASAPI_PlatformDeleteActivationHandler(void *handler) { - ((SDL_WasapiActivationHandler *) handler)->Release(); + ((SDL_WasapiActivationHandler *)handler)->Release(); } -int -WASAPI_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +int WASAPI_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { return SDL_Unsupported(); } -int -WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) +int WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) { LPCWSTR devid = _this->hidden->devid; - Platform::String^ defdevid; + Platform::String ^ defdevid; if (devid == nullptr) { defdevid = _this->iscapture ? MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default) : MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default); @@ -288,11 +277,11 @@ WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) return SDL_SetError("Failed to allocate WASAPI activation handler"); } - handler.Get()->AddRef(); // we hold a reference after ComPtr destructs on return, causing a Release, and Release ourselves in WASAPI_PlatformDeleteActivationHandler(), etc. + handler.Get()->AddRef(); // we hold a reference after ComPtr destructs on return, causing a Release, and Release ourselves in WASAPI_PlatformDeleteActivationHandler(), etc. handler.Get()->device = _this; _this->hidden->activation_handler = handler.Get(); - WASAPI_RefDevice(_this); /* completion handler will unref it. */ + WASAPI_RefDevice(_this); /* completion handler will unref it. */ IActivateAudioInterfaceAsyncOperation *async = nullptr; const HRESULT ret = ActivateAudioInterfaceAsync(devid, __uuidof(IAudioClient), nullptr, handler.Get(), &async); @@ -339,22 +328,20 @@ WASAPI_ActivateDevice(_THIS, const SDL_bool isrecovery) return 0; } -void -WASAPI_PlatformThreadInit(_THIS) +void WASAPI_PlatformThreadInit(_THIS) { // !!! FIXME: set this thread to "Pro Audio" priority. } -void -WASAPI_PlatformThreadDeinit(_THIS) +void WASAPI_PlatformThreadDeinit(_THIS) { // !!! FIXME: set this thread to "Pro Audio" priority. } /* Everything below was copied from SDL_wasapi.c, before it got moved to SDL_immdevice.c! */ -static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; -static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; +static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; +static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; extern "C" SDL_AudioFormat WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) @@ -378,8 +365,7 @@ WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) return 0; } -static void -WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid) +static void WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid) { DevIdList *i; DevIdList *next; @@ -389,8 +375,7 @@ WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid) if (SDL_wcscmp(i->str, devid) == 0) { if (prev) { prev->next = next; - } - else { + } else { deviceid_list = next; } SDL_RemoveAudioDevice(iscapture, i->str); @@ -402,8 +387,7 @@ WASAPI_RemoveDevice(const SDL_bool iscapture, LPCWSTR devid) } } -static void -WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid) +static void WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid) { DevIdList *devidlist; SDL_AudioSpec spec; @@ -413,22 +397,22 @@ WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENS phones and tablets, where you might have an internal speaker and a headphone jack and expect both to be available and switch automatically. (!!! FIXME...?) */ - /* see if we already have this one. */ + /* see if we already have this one. */ for (devidlist = deviceid_list; devidlist; devidlist = devidlist->next) { if (SDL_wcscmp(devidlist->str, devid) == 0) { - return; /* we already have this. */ + return; /* we already have this. */ } } devidlist = (DevIdList *)SDL_malloc(sizeof(*devidlist)); if (!devidlist) { - return; /* oh well. */ + return; /* oh well. */ } devid = SDL_wcsdup(devid); if (!devid) { SDL_free(devidlist); - return; /* oh well. */ + return; /* oh well. */ } devidlist->str = (WCHAR *)devid; @@ -442,6 +426,6 @@ WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENS SDL_AddAudioDevice(iscapture, devname, &spec, (void *)devid); } -#endif // SDL_AUDIO_DRIVER_WASAPI && defined(__WINRT__) +#endif // SDL_AUDIO_DRIVER_WASAPI && defined(__WINRT__) /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c index 444d21576b452..77e177366187c 100644 --- a/src/audio/winmm/SDL_winmm.c +++ b/src/audio/winmm/SDL_winmm.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_AUDIO_DRIVER_WINMM +#ifdef SDL_AUDIO_DRIVER_WINMM /* Allow access to a raw mixing buffer */ @@ -35,7 +35,7 @@ /* MinGW32 mmsystem.h doesn't include these structures */ #if defined(__MINGW32__) && defined(_MMSYSTEM_H) -typedef struct tagWAVEINCAPS2W +typedef struct tagWAVEINCAPS2W { WORD wMid; WORD wPid; @@ -97,16 +97,13 @@ static void DetectWave##typ##Devs(void) { \ DETECT_DEV_IMPL(SDL_FALSE, Out, WAVEOUTCAPS) DETECT_DEV_IMPL(SDL_TRUE, In, WAVEINCAPS) -static void -WINMM_DetectDevices(void) +static void WINMM_DetectDevices(void) { DetectWaveInDevs(); DetectWaveOutDevs(); } -static void CALLBACK -CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, - DWORD_PTR dwParam1, DWORD_PTR dwParam2) +static void CALLBACK CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance; @@ -120,9 +117,7 @@ CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, /* The Win32 callback for filling the WAVE device */ -static void CALLBACK -FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, - DWORD_PTR dwParam1, DWORD_PTR dwParam2) +static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2) { SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance; @@ -134,8 +129,7 @@ FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, ReleaseSemaphore(this->hidden->audio_sem, 1, NULL); } -static int -SetMMerror(const char *function, MMRESULT code) +static int SetMMerror(const char *function, MMRESULT code) { int len; char errbuf[MAXERRORLENGTH]; @@ -151,22 +145,19 @@ SetMMerror(const char *function, MMRESULT code) return SDL_SetError("%s", errbuf); } -static void -WINMM_WaitDevice(_THIS) +static void WINMM_WaitDevice(_THIS) { /* Wait for an audio chunk to finish */ WaitForSingleObject(this->hidden->audio_sem, INFINITE); } -static Uint8 * -WINMM_GetDeviceBuf(_THIS) +static Uint8 *WINMM_GetDeviceBuf(_THIS) { return (Uint8 *) (this->hidden-> wavebuf[this->hidden->next_buffer].lpData); } -static void -WINMM_PlayDevice(_THIS) +static void WINMM_PlayDevice(_THIS) { /* Queue it up */ waveOutWrite(this->hidden->hout, @@ -175,8 +166,7 @@ WINMM_PlayDevice(_THIS) this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS; } -static int -WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen) +static int WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen) { const int nextbuf = this->hidden->next_buffer; MMRESULT result; @@ -192,7 +182,7 @@ WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen) /* requeue the buffer that just finished. */ result = waveInAddBuffer(this->hidden->hin, &this->hidden->wavebuf[nextbuf], - sizeof (this->hidden->wavebuf[nextbuf])); + sizeof(this->hidden->wavebuf[nextbuf])); if (result != MMSYSERR_NOERROR) { return -1; /* uhoh! Disable the device. */ } @@ -202,8 +192,7 @@ WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen) return this->spec.size; } -static void -WINMM_FlushCapture(_THIS) +static void WINMM_FlushCapture(_THIS) { /* Wait for an audio chunk to finish */ if (WaitForSingleObject(this->hidden->audio_sem, 0) == WAIT_OBJECT_0) { @@ -211,13 +200,12 @@ WINMM_FlushCapture(_THIS) /* requeue the buffer that just finished without reading from it. */ waveInAddBuffer(this->hidden->hin, &this->hidden->wavebuf[nextbuf], - sizeof (this->hidden->wavebuf[nextbuf])); + sizeof(this->hidden->wavebuf[nextbuf])); this->hidden->next_buffer = (nextbuf + 1) % NUM_BUFFERS; } } -static void -WINMM_CloseDevice(_THIS) +static void WINMM_CloseDevice(_THIS) { int i; @@ -229,7 +217,7 @@ WINMM_CloseDevice(_THIS) if (this->hidden->wavebuf[i].dwUser != 0xFFFF) { waveOutUnprepareHeader(this->hidden->hout, &this->hidden->wavebuf[i], - sizeof (this->hidden->wavebuf[i])); + sizeof(this->hidden->wavebuf[i])); } } @@ -244,7 +232,7 @@ WINMM_CloseDevice(_THIS) if (this->hidden->wavebuf[i].dwUser != 0xFFFF) { waveInUnprepareHeader(this->hidden->hin, &this->hidden->wavebuf[i], - sizeof (this->hidden->wavebuf[i])); + sizeof(this->hidden->wavebuf[i])); } } waveInClose(this->hidden->hin); @@ -258,8 +246,7 @@ WINMM_CloseDevice(_THIS) SDL_free(this->hidden); } -static SDL_bool -PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture) +static SDL_bool PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture) { SDL_zerop(pfmt); @@ -282,8 +269,7 @@ PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture) } } -static int -WINMM_OpenDevice(_THIS, const char *devname) +static int WINMM_OpenDevice(_THIS, const char *devname) { SDL_AudioFormat test_format; SDL_bool iscapture = this->iscapture; @@ -293,16 +279,15 @@ WINMM_OpenDevice(_THIS, const char *devname) UINT devId = WAVE_MAPPER; /* WAVE_MAPPER == choose system's default */ UINT i; - if (handle != NULL) { /* specific device requested? */ + if (handle) { /* specific device requested? */ /* -1 because we increment the original value to avoid NULL. */ const size_t val = ((size_t) handle) - 1; devId = (UINT) val; } /* Initialize all variables that we clean on shutdown */ - this->hidden = (struct SDL_PrivateAudioData *) - SDL_malloc((sizeof *this->hidden)); - if (this->hidden == NULL) { + this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(*this->hidden)); + if (!this->hidden) { return SDL_OutOfMemory(); } SDL_zerop(this->hidden); @@ -361,7 +346,7 @@ WINMM_OpenDevice(_THIS, const char *devname) if (iscapture) { WAVEINCAPS caps; result = waveInGetDevCaps((UINT) this->hidden->hout, - &caps, sizeof (caps)); + &caps, sizeof(caps)); if (result != MMSYSERR_NOERROR) { return SetMMerror("waveInGetDevCaps()", result); } @@ -380,14 +365,14 @@ WINMM_OpenDevice(_THIS, const char *devname) /* Create the audio buffer semaphore */ this->hidden->audio_sem = CreateSemaphore(NULL, iscapture ? 0 : NUM_BUFFERS - 1, NUM_BUFFERS, NULL); - if (this->hidden->audio_sem == NULL) { + if (!this->hidden->audio_sem) { return SDL_SetError("Couldn't create semaphore"); } /* Create the sound buffers */ this->hidden->mixbuf = (Uint8 *) SDL_malloc(NUM_BUFFERS * this->spec.size); - if (this->hidden->mixbuf == NULL) { + if (!this->hidden->mixbuf) { return SDL_OutOfMemory(); } @@ -432,8 +417,7 @@ WINMM_OpenDevice(_THIS, const char *devname) return 0; /* Ready to go! */ } -static SDL_bool -WINMM_Init(SDL_AudioDriverImpl * impl) +static SDL_bool WINMM_Init(SDL_AudioDriverImpl * impl) { /* Set the function pointers */ impl->DetectDevices = WINMM_DetectDevices; diff --git a/src/audio/winmm/SDL_winmm.h b/src/audio/winmm/SDL_winmm.h index 68baffa9c8569..cebc747e3033b 100644 --- a/src/audio/winmm/SDL_winmm.h +++ b/src/audio/winmm/SDL_winmm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index ebdd1041bf8af..86f272e4037d2 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,231 +50,240 @@ #include #include -#define SDL_JAVA_PREFIX org_libsdl_app -#define CONCAT1(prefix, class, function) CONCAT2(prefix, class, function) -#define CONCAT2(prefix, class, function) Java_ ## prefix ## _ ## class ## _ ## function -#define SDL_JAVA_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLActivity, function) -#define SDL_JAVA_AUDIO_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLAudioManager, function) -#define SDL_JAVA_CONTROLLER_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLControllerManager, function) -#define SDL_JAVA_INTERFACE_INPUT_CONNECTION(function) CONCAT1(SDL_JAVA_PREFIX, SDLInputConnection, function) +#define SDL_JAVA_PREFIX org_libsdl_app +#define CONCAT1(prefix, class, function) CONCAT2(prefix, class, function) +#define CONCAT2(prefix, class, function) Java_##prefix##_##class##_##function +#define SDL_JAVA_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLActivity, function) +#define SDL_JAVA_AUDIO_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLAudioManager, function) +#define SDL_JAVA_CONTROLLER_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, SDLControllerManager, function) +#define SDL_JAVA_INTERFACE_INPUT_CONNECTION(function) CONCAT1(SDL_JAVA_PREFIX, SDLInputConnection, function) /* Audio encoding definitions */ -#define ENCODING_PCM_8BIT 3 -#define ENCODING_PCM_16BIT 2 -#define ENCODING_PCM_FLOAT 4 +#define ENCODING_PCM_8BIT 3 +#define ENCODING_PCM_16BIT 2 +#define ENCODING_PCM_FLOAT 4 /* Java class SDLActivity */ JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetVersion)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)( - JNIEnv *env, jclass cls, - jstring library, jstring function, jobject array); + JNIEnv *env, jclass cls, + jstring library, jstring function, jobject array); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)( - JNIEnv *env, jclass jcls, - jstring filename); + JNIEnv *env, jclass jcls, + jstring filename); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetScreenResolution)( - JNIEnv *env, jclass jcls, - jint surfaceWidth, jint surfaceHeight, - jint deviceWidth, jint deviceHeight, jfloat rate); + JNIEnv *env, jclass jcls, + jint surfaceWidth, jint surfaceHeight, + jint deviceWidth, jint deviceHeight, jfloat rate); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceCreated)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyDown)( - JNIEnv *env, jclass jcls, - jint keycode); + JNIEnv *env, jclass jcls, + jint keycode); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyUp)( - JNIEnv *env, jclass jcls, - jint keycode); + JNIEnv *env, jclass jcls, + jint keycode); JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(onNativeSoftReturnKey)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeTouch)( - JNIEnv *env, jclass jcls, - jint touch_device_id_in, jint pointer_finger_id_in, - jint action, jfloat x, jfloat y, jfloat p); + JNIEnv *env, jclass jcls, + jint touch_device_id_in, jint pointer_finger_id_in, + jint action, jfloat x, jfloat y, jfloat p); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)( - JNIEnv *env, jclass jcls, - jint button, jint action, jfloat x, jfloat y, jboolean relative); + JNIEnv *env, jclass jcls, + jint button, jint action, jfloat x, jfloat y, jboolean relative); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)( - JNIEnv *env, jclass jcls, - jfloat x, jfloat y, jfloat z); + JNIEnv *env, jclass jcls, + jfloat x, jfloat y, jfloat z); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeClipboardChanged)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeLowMemory)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeLocaleChanged)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSendQuit)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)( - JNIEnv *env, jclass cls); + JNIEnv *env, jclass cls); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeFocusChanged)( - JNIEnv *env, jclass cls, jboolean hasFocus); + JNIEnv *env, jclass cls, jboolean hasFocus); JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)( - JNIEnv *env, jclass cls, - jstring name); + JNIEnv *env, jclass cls, + jstring name); JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(nativeGetHintBoolean)( - JNIEnv *env, jclass cls, - jstring name, jboolean default_value); + JNIEnv *env, jclass cls, + jstring name, jboolean default_value); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetenv)( - JNIEnv *env, jclass cls, - jstring name, jstring value); + JNIEnv *env, jclass cls, + jstring name, jstring value); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)( - JNIEnv *env, jclass cls, - jint orientation); + JNIEnv *env, jclass cls, + jint orientation); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeAddTouch)( - JNIEnv* env, jclass cls, - jint touchId, jstring name); + JNIEnv *env, jclass cls, + jint touchId, jstring name); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)( - JNIEnv* env, jclass cls, - jint requestCode, jboolean result); + JNIEnv *env, jclass cls, + jint requestCode, jboolean result); static JNINativeMethod SDLActivity_tab[] = { - { "nativeGetVersion", "()Ljava/lang/String;", SDL_JAVA_INTERFACE(nativeGetVersion) }, - { "nativeSetupJNI", "()I", SDL_JAVA_INTERFACE(nativeSetupJNI) }, - { "nativeRunMain", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)I", SDL_JAVA_INTERFACE(nativeRunMain) }, - { "onNativeDropFile", "(Ljava/lang/String;)V", SDL_JAVA_INTERFACE(onNativeDropFile) }, - { "nativeSetScreenResolution", "(IIIIF)V", SDL_JAVA_INTERFACE(nativeSetScreenResolution) }, - { "onNativeResize", "()V", SDL_JAVA_INTERFACE(onNativeResize) }, - { "onNativeSurfaceCreated", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceCreated) }, - { "onNativeSurfaceChanged", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceChanged) }, - { "onNativeSurfaceDestroyed", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed) }, - { "onNativeKeyDown", "(I)V", SDL_JAVA_INTERFACE(onNativeKeyDown) }, - { "onNativeKeyUp", "(I)V", SDL_JAVA_INTERFACE(onNativeKeyUp) }, - { "onNativeSoftReturnKey", "()Z", SDL_JAVA_INTERFACE(onNativeSoftReturnKey) }, - { "onNativeKeyboardFocusLost", "()V", SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost) }, - { "onNativeTouch", "(IIIFFF)V", SDL_JAVA_INTERFACE(onNativeTouch) }, - { "onNativeMouse", "(IIFFZ)V", SDL_JAVA_INTERFACE(onNativeMouse) }, - { "onNativeAccel", "(FFF)V", SDL_JAVA_INTERFACE(onNativeAccel) }, - { "onNativeClipboardChanged", "()V", SDL_JAVA_INTERFACE(onNativeClipboardChanged) }, - { "nativeLowMemory", "()V", SDL_JAVA_INTERFACE(nativeLowMemory) }, - { "onNativeLocaleChanged", "()V", SDL_JAVA_INTERFACE(onNativeLocaleChanged) }, - { "nativeSendQuit", "()V", SDL_JAVA_INTERFACE(nativeSendQuit) }, - { "nativeQuit", "()V", SDL_JAVA_INTERFACE(nativeQuit) }, - { "nativePause", "()V", SDL_JAVA_INTERFACE(nativePause) }, - { "nativeResume", "()V", SDL_JAVA_INTERFACE(nativeResume) }, - { "nativeFocusChanged", "(Z)V", SDL_JAVA_INTERFACE(nativeFocusChanged) }, - { "nativeGetHint", "(Ljava/lang/String;)Ljava/lang/String;", SDL_JAVA_INTERFACE(nativeGetHint) }, - { "nativeGetHintBoolean", "(Ljava/lang/String;Z)Z", SDL_JAVA_INTERFACE(nativeGetHintBoolean) }, - { "nativeSetenv", "(Ljava/lang/String;Ljava/lang/String;)V", SDL_JAVA_INTERFACE(nativeSetenv) }, + { "nativeGetVersion", "()Ljava/lang/String;", SDL_JAVA_INTERFACE(nativeGetVersion) }, + { "nativeSetupJNI", "()I", SDL_JAVA_INTERFACE(nativeSetupJNI) }, + { "nativeRunMain", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)I", SDL_JAVA_INTERFACE(nativeRunMain) }, + { "onNativeDropFile", "(Ljava/lang/String;)V", SDL_JAVA_INTERFACE(onNativeDropFile) }, + { "nativeSetScreenResolution", "(IIIIF)V", SDL_JAVA_INTERFACE(nativeSetScreenResolution) }, + { "onNativeResize", "()V", SDL_JAVA_INTERFACE(onNativeResize) }, + { "onNativeSurfaceCreated", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceCreated) }, + { "onNativeSurfaceChanged", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceChanged) }, + { "onNativeSurfaceDestroyed", "()V", SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed) }, + { "onNativeKeyDown", "(I)V", SDL_JAVA_INTERFACE(onNativeKeyDown) }, + { "onNativeKeyUp", "(I)V", SDL_JAVA_INTERFACE(onNativeKeyUp) }, + { "onNativeSoftReturnKey", "()Z", SDL_JAVA_INTERFACE(onNativeSoftReturnKey) }, + { "onNativeKeyboardFocusLost", "()V", SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost) }, + { "onNativeTouch", "(IIIFFF)V", SDL_JAVA_INTERFACE(onNativeTouch) }, + { "onNativeMouse", "(IIFFZ)V", SDL_JAVA_INTERFACE(onNativeMouse) }, + { "onNativeAccel", "(FFF)V", SDL_JAVA_INTERFACE(onNativeAccel) }, + { "onNativeClipboardChanged", "()V", SDL_JAVA_INTERFACE(onNativeClipboardChanged) }, + { "nativeLowMemory", "()V", SDL_JAVA_INTERFACE(nativeLowMemory) }, + { "onNativeLocaleChanged", "()V", SDL_JAVA_INTERFACE(onNativeLocaleChanged) }, + { "nativeSendQuit", "()V", SDL_JAVA_INTERFACE(nativeSendQuit) }, + { "nativeQuit", "()V", SDL_JAVA_INTERFACE(nativeQuit) }, + { "nativePause", "()V", SDL_JAVA_INTERFACE(nativePause) }, + { "nativeResume", "()V", SDL_JAVA_INTERFACE(nativeResume) }, + { "nativeFocusChanged", "(Z)V", SDL_JAVA_INTERFACE(nativeFocusChanged) }, + { "nativeGetHint", "(Ljava/lang/String;)Ljava/lang/String;", SDL_JAVA_INTERFACE(nativeGetHint) }, + { "nativeGetHintBoolean", "(Ljava/lang/String;Z)Z", SDL_JAVA_INTERFACE(nativeGetHintBoolean) }, + { "nativeSetenv", "(Ljava/lang/String;Ljava/lang/String;)V", SDL_JAVA_INTERFACE(nativeSetenv) }, { "onNativeOrientationChanged", "(I)V", SDL_JAVA_INTERFACE(onNativeOrientationChanged) }, - { "nativeAddTouch", "(ILjava/lang/String;)V", SDL_JAVA_INTERFACE(nativeAddTouch) }, - { "nativePermissionResult", "(IZ)V", SDL_JAVA_INTERFACE(nativePermissionResult) } + { "nativeAddTouch", "(ILjava/lang/String;)V", SDL_JAVA_INTERFACE(nativeAddTouch) }, + { "nativePermissionResult", "(IZ)V", SDL_JAVA_INTERFACE(nativePermissionResult) } }; /* Java class SDLInputConnection */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)( - JNIEnv *env, jclass cls, - jstring text, jint newCursorPosition); + JNIEnv *env, jclass cls, + jstring text, jint newCursorPosition); JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar)( - JNIEnv *env, jclass cls, - jchar chUnicode); + JNIEnv *env, jclass cls, + jchar chUnicode); static JNINativeMethod SDLInputConnection_tab[] = { - { "nativeCommitText", "(Ljava/lang/String;I)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText) }, - { "nativeGenerateScancodeForUnichar", "(C)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar) } + { "nativeCommitText", "(Ljava/lang/String;I)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText) }, + { "nativeGenerateScancodeForUnichar", "(C)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar) } }; /* Java class SDLAudioManager */ JNIEXPORT void JNICALL SDL_JAVA_AUDIO_INTERFACE(nativeSetupJNI)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); + +JNIEXPORT void JNICALL + SDL_JAVA_AUDIO_INTERFACE(addAudioDevice)(JNIEnv *env, jclass jcls, jboolean is_capture, + jint device_id); + +JNIEXPORT void JNICALL + SDL_JAVA_AUDIO_INTERFACE(removeAudioDevice)(JNIEnv *env, jclass jcls, jboolean is_capture, + jint device_id); static JNINativeMethod SDLAudioManager_tab[] = { - { "nativeSetupJNI", "()I", SDL_JAVA_AUDIO_INTERFACE(nativeSetupJNI) } + { "nativeSetupJNI", "()I", SDL_JAVA_AUDIO_INTERFACE(nativeSetupJNI) }, + { "addAudioDevice", "(ZI)V", SDL_JAVA_AUDIO_INTERFACE(addAudioDevice) }, + { "removeAudioDevice", "(ZI)V", SDL_JAVA_AUDIO_INTERFACE(removeAudioDevice) } }; /* Java class SDLControllerManager */ JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeSetupJNI)( - JNIEnv *env, jclass jcls); + JNIEnv *env, jclass jcls); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativePadDown)( - JNIEnv *env, jclass jcls, - jint device_id, jint keycode); + JNIEnv *env, jclass jcls, + jint device_id, jint keycode); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativePadUp)( - JNIEnv *env, jclass jcls, - jint device_id, jint keycode); + JNIEnv *env, jclass jcls, + jint device_id, jint keycode); JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativeJoy)( - JNIEnv *env, jclass jcls, - jint device_id, jint axis, jfloat value); + JNIEnv *env, jclass jcls, + jint device_id, jint axis, jfloat value); JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativeHat)( - JNIEnv *env, jclass jcls, - jint device_id, jint hat_id, jint x, jint y); + JNIEnv *env, jclass jcls, + jint device_id, jint hat_id, jint x, jint y); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick)( - JNIEnv *env, jclass jcls, - jint device_id, jstring device_name, jstring device_desc, jint vendor_id, jint product_id, - jboolean is_accelerometer, jint button_mask, jint naxes, jint nhats, jint nballs); + JNIEnv *env, jclass jcls, + jint device_id, jstring device_name, jstring device_desc, jint vendor_id, jint product_id, + jboolean is_accelerometer, jint button_mask, jint naxes, jint axis_mask, jint nhats, jint nballs); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveJoystick)( - JNIEnv *env, jclass jcls, - jint device_id); + JNIEnv *env, jclass jcls, + jint device_id); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeAddHaptic)( - JNIEnv *env, jclass jcls, - jint device_id, jstring device_name); + JNIEnv *env, jclass jcls, + jint device_id, jstring device_name); JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveHaptic)( - JNIEnv *env, jclass jcls, - jint device_id); + JNIEnv *env, jclass jcls, + jint device_id); static JNINativeMethod SDLControllerManager_tab[] = { - { "nativeSetupJNI", "()I", SDL_JAVA_CONTROLLER_INTERFACE(nativeSetupJNI) }, - { "onNativePadDown", "(II)I", SDL_JAVA_CONTROLLER_INTERFACE(onNativePadDown) }, - { "onNativePadUp", "(II)I", SDL_JAVA_CONTROLLER_INTERFACE(onNativePadUp) }, - { "onNativeJoy", "(IIF)V", SDL_JAVA_CONTROLLER_INTERFACE(onNativeJoy) }, - { "onNativeHat", "(IIII)V", SDL_JAVA_CONTROLLER_INTERFACE(onNativeHat) }, - { "nativeAddJoystick", "(ILjava/lang/String;Ljava/lang/String;IIZIIII)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick) }, - { "nativeRemoveJoystick", "(I)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveJoystick) }, - { "nativeAddHaptic", "(ILjava/lang/String;)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeAddHaptic) }, - { "nativeRemoveHaptic", "(I)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveHaptic) } + { "nativeSetupJNI", "()I", SDL_JAVA_CONTROLLER_INTERFACE(nativeSetupJNI) }, + { "onNativePadDown", "(II)I", SDL_JAVA_CONTROLLER_INTERFACE(onNativePadDown) }, + { "onNativePadUp", "(II)I", SDL_JAVA_CONTROLLER_INTERFACE(onNativePadUp) }, + { "onNativeJoy", "(IIF)V", SDL_JAVA_CONTROLLER_INTERFACE(onNativeJoy) }, + { "onNativeHat", "(IIII)V", SDL_JAVA_CONTROLLER_INTERFACE(onNativeHat) }, + { "nativeAddJoystick", "(ILjava/lang/String;Ljava/lang/String;IIZIIIII)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick) }, + { "nativeRemoveJoystick", "(I)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveJoystick) }, + { "nativeAddHaptic", "(ILjava/lang/String;)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeAddHaptic) }, + { "nativeRemoveHaptic", "(I)I", SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveHaptic) } }; - /* Uncomment this to log messages entering and exiting methods in this file */ /* #define DEBUG_JNI */ @@ -285,7 +294,6 @@ static void checkJNIReady(void); *******************************************************************************/ #include - /******************************************************************************* Globals *******************************************************************************/ @@ -332,6 +340,8 @@ static jmethodID midSupportsRelativeMouse; static jclass mAudioManagerClass; /* method signatures */ +static jmethodID midGetAudioOutputDevices; +static jmethodID midGetAudioInputDevices; static jmethodID midAudioOpen; static jmethodID midAudioWriteByteBuffer; static jmethodID midAudioWriteShortBuffer; @@ -396,8 +406,8 @@ static jobject javaAssetManagerRef = 0; */ /* Set local storage value */ -static int -Android_JNI_SetEnv(JNIEnv *env) { +static int Android_JNI_SetEnv(JNIEnv *env) +{ int status = pthread_setspecific(mThreadKey, env); if (status < 0) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "Failed pthread_setspecific() in Android_JNI_SetEnv() (err=%d)", status); @@ -406,16 +416,16 @@ Android_JNI_SetEnv(JNIEnv *env) { } /* Get local storage value */ -JNIEnv* Android_JNI_GetEnv(void) +JNIEnv *Android_JNI_GetEnv(void) { /* Get JNIEnv from the Thread local storage */ JNIEnv *env = pthread_getspecific(mThreadKey); - if (env == NULL) { + if (!env) { /* If it fails, try to attach ! (e.g the thread isn't created with SDL_CreateThread() */ int status; /* There should be a JVM */ - if (mJavaVM == NULL) { + if (!mJavaVM) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "Failed, there is no JavaVM"); return NULL; } @@ -444,7 +454,7 @@ int Android_JNI_SetupThread(void) int status; /* There should be a JVM */ - if (mJavaVM == NULL) { + if (!mJavaVM) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "Failed, there is no JavaVM"); return 0; } @@ -466,20 +476,18 @@ int Android_JNI_SetupThread(void) } /* Destructor called for each thread where mThreadKey is not NULL */ -static void -Android_JNI_ThreadDestroyed(void *value) +static void Android_JNI_ThreadDestroyed(void *value) { /* The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required */ - JNIEnv *env = (JNIEnv *) value; - if (env != NULL) { + JNIEnv *env = (JNIEnv *)value; + if (env) { (*mJavaVM)->DetachCurrentThread(mJavaVM); Android_JNI_SetEnv(NULL); } } /* Creation of local storage mThreadKey */ -static void -Android_JNI_CreateKey(void) +static void Android_JNI_CreateKey(void) { int status = pthread_key_create(&mThreadKey, Android_JNI_ThreadDestroyed); if (status < 0) { @@ -487,8 +495,7 @@ Android_JNI_CreateKey(void) } } -static void -Android_JNI_CreateKey_once(void) +static void Android_JNI_CreateKey_once(void) { int status = pthread_once(&key_once, Android_JNI_CreateKey); if (status < 0) { @@ -496,11 +503,10 @@ Android_JNI_CreateKey_once(void) } } -static void -register_methods(JNIEnv *env, const char *classname, JNINativeMethod *methods, int nb) +static void register_methods(JNIEnv *env, const char *classname, JNINativeMethod *methods, int nb) { jclass clazz = (*env)->FindClass(env, classname); - if (clazz == NULL || (*env)->RegisterNatives(env, clazz, methods, nb) < 0) { + if (!clazz || (*env)->RegisterNatives(env, clazz, methods, nb) < 0) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "Failed to register methods of %s", classname); return; } @@ -560,29 +566,28 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl /* Save JNIEnv of SDLActivity */ Android_JNI_SetEnv(env); - if (mJavaVM == NULL) { + if (!mJavaVM) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "failed to found a JavaVM"); } /* Use a mutex to prevent concurrency issues between Java Activity and Native thread code, when using 'Android_Window'. * (Eg. Java sending Touch events, while native code is destroying the main SDL_Window. ) */ - if (Android_ActivityMutex == NULL) { + if (!Android_ActivityMutex) { Android_ActivityMutex = SDL_CreateMutex(); /* Could this be created twice if onCreate() is called a second time ? */ } - if (Android_ActivityMutex == NULL) { + if (!Android_ActivityMutex) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "failed to create Android_ActivityMutex mutex"); } - Android_PauseSem = SDL_CreateSemaphore(0); - if (Android_PauseSem == NULL) { + if (!Android_PauseSem) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "failed to create Android_PauseSem semaphore"); } Android_ResumeSem = SDL_CreateSemaphore(0); - if (Android_ResumeSem == NULL) { + if (!Android_ResumeSem) { __android_log_print(ANDROID_LOG_ERROR, "SDL", "failed to create Android_ResumeSem semaphore"); } @@ -593,30 +598,30 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetupJNI)(JNIEnv *env, jclass cl midClipboardSetText = (*env)->GetStaticMethodID(env, mActivityClass, "clipboardSetText", "(Ljava/lang/String;)V"); midCreateCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "createCustomCursor", "([IIIII)I"); midDestroyCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "destroyCustomCursor", "(I)V"); - midGetContext = (*env)->GetStaticMethodID(env, mActivityClass, "getContext","()Landroid/content/Context;"); + midGetContext = (*env)->GetStaticMethodID(env, mActivityClass, "getContext", "()Landroid/content/Context;"); midGetDisplayDPI = (*env)->GetStaticMethodID(env, mActivityClass, "getDisplayDPI", "()Landroid/util/DisplayMetrics;"); midGetManifestEnvironmentVariables = (*env)->GetStaticMethodID(env, mActivityClass, "getManifestEnvironmentVariables", "()Z"); - midGetNativeSurface = (*env)->GetStaticMethodID(env, mActivityClass, "getNativeSurface","()Landroid/view/Surface;"); + midGetNativeSurface = (*env)->GetStaticMethodID(env, mActivityClass, "getNativeSurface", "()Landroid/view/Surface;"); midInitTouch = (*env)->GetStaticMethodID(env, mActivityClass, "initTouch", "()V"); - midIsAndroidTV = (*env)->GetStaticMethodID(env, mActivityClass, "isAndroidTV","()Z"); + midIsAndroidTV = (*env)->GetStaticMethodID(env, mActivityClass, "isAndroidTV", "()Z"); midIsChromebook = (*env)->GetStaticMethodID(env, mActivityClass, "isChromebook", "()Z"); midIsDeXMode = (*env)->GetStaticMethodID(env, mActivityClass, "isDeXMode", "()Z"); - midIsScreenKeyboardShown = (*env)->GetStaticMethodID(env, mActivityClass, "isScreenKeyboardShown","()Z"); + midIsScreenKeyboardShown = (*env)->GetStaticMethodID(env, mActivityClass, "isScreenKeyboardShown", "()Z"); midIsTablet = (*env)->GetStaticMethodID(env, mActivityClass, "isTablet", "()Z"); midManualBackButton = (*env)->GetStaticMethodID(env, mActivityClass, "manualBackButton", "()V"); - midMinimizeWindow = (*env)->GetStaticMethodID(env, mActivityClass, "minimizeWindow","()V"); + midMinimizeWindow = (*env)->GetStaticMethodID(env, mActivityClass, "minimizeWindow", "()V"); midOpenURL = (*env)->GetStaticMethodID(env, mActivityClass, "openURL", "(Ljava/lang/String;)I"); midRequestPermission = (*env)->GetStaticMethodID(env, mActivityClass, "requestPermission", "(Ljava/lang/String;I)V"); midShowToast = (*env)->GetStaticMethodID(env, mActivityClass, "showToast", "(Ljava/lang/String;IIII)I"); midSendMessage = (*env)->GetStaticMethodID(env, mActivityClass, "sendMessage", "(II)Z"); - midSetActivityTitle = (*env)->GetStaticMethodID(env, mActivityClass, "setActivityTitle","(Ljava/lang/String;)Z"); + midSetActivityTitle = (*env)->GetStaticMethodID(env, mActivityClass, "setActivityTitle", "(Ljava/lang/String;)Z"); midSetCustomCursor = (*env)->GetStaticMethodID(env, mActivityClass, "setCustomCursor", "(I)Z"); - midSetOrientation = (*env)->GetStaticMethodID(env, mActivityClass, "setOrientation","(IIZLjava/lang/String;)V"); + midSetOrientation = (*env)->GetStaticMethodID(env, mActivityClass, "setOrientation", "(IIZLjava/lang/String;)V"); midSetRelativeMouseEnabled = (*env)->GetStaticMethodID(env, mActivityClass, "setRelativeMouseEnabled", "(Z)Z"); midSetSystemCursor = (*env)->GetStaticMethodID(env, mActivityClass, "setSystemCursor", "(I)Z"); - midSetWindowStyle = (*env)->GetStaticMethodID(env, mActivityClass, "setWindowStyle","(Z)V"); - midShouldMinimizeOnFocusLoss = (*env)->GetStaticMethodID(env, mActivityClass, "shouldMinimizeOnFocusLoss","()Z"); - midShowTextInput = (*env)->GetStaticMethodID(env, mActivityClass, "showTextInput", "(IIII)Z"); + midSetWindowStyle = (*env)->GetStaticMethodID(env, mActivityClass, "setWindowStyle", "(Z)V"); + midShouldMinimizeOnFocusLoss = (*env)->GetStaticMethodID(env, mActivityClass, "shouldMinimizeOnFocusLoss", "()Z"); + midShowTextInput = (*env)->GetStaticMethodID(env, mActivityClass, "showTextInput", "(IIII)Z"); midSupportsRelativeMouse = (*env)->GetStaticMethodID(env, mActivityClass, "supportsRelativeMouse", "()Z"); if (!midClipboardGetText || @@ -662,32 +667,42 @@ JNIEXPORT void JNICALL SDL_JAVA_AUDIO_INTERFACE(nativeSetupJNI)(JNIEnv *env, jcl mAudioManagerClass = (jclass)((*env)->NewGlobalRef(env, cls)); + midGetAudioOutputDevices = (*env)->GetStaticMethodID(env, mAudioManagerClass, + "getAudioOutputDevices", + "()[I"); + midGetAudioInputDevices = (*env)->GetStaticMethodID(env, mAudioManagerClass, + "getAudioInputDevices", + "()[I"); midAudioOpen = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioOpen", "(IIII)[I"); + "audioOpen", "(IIIII)[I"); midAudioWriteByteBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioWriteByteBuffer", "([B)V"); + "audioWriteByteBuffer", "([B)V"); midAudioWriteShortBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioWriteShortBuffer", "([S)V"); + "audioWriteShortBuffer", "([S)V"); midAudioWriteFloatBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioWriteFloatBuffer", "([F)V"); + "audioWriteFloatBuffer", "([F)V"); midAudioClose = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioClose", "()V"); + "audioClose", "()V"); midCaptureOpen = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "captureOpen", "(IIII)[I"); + "captureOpen", "(IIIII)[I"); midCaptureReadByteBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "captureReadByteBuffer", "([BZ)I"); + "captureReadByteBuffer", "([BZ)I"); midCaptureReadShortBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "captureReadShortBuffer", "([SZ)I"); + "captureReadShortBuffer", "([SZ)I"); midCaptureReadFloatBuffer = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "captureReadFloatBuffer", "([FZ)I"); + "captureReadFloatBuffer", "([FZ)I"); midCaptureClose = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "captureClose", "()V"); + "captureClose", "()V"); midAudioSetThreadPriority = (*env)->GetStaticMethodID(env, mAudioManagerClass, - "audioSetThreadPriority", "(ZI)V"); + "audioSetThreadPriority", "(ZI)V"); - if (!midAudioOpen || !midAudioWriteByteBuffer || !midAudioWriteShortBuffer || !midAudioWriteFloatBuffer || !midAudioClose || - !midCaptureOpen || !midCaptureReadByteBuffer || !midCaptureReadShortBuffer || !midCaptureReadFloatBuffer || !midCaptureClose || !midAudioSetThreadPriority) { - __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLAudioManager.java?"); + if (!midGetAudioOutputDevices || !midGetAudioInputDevices || !midAudioOpen || + !midAudioWriteByteBuffer || !midAudioWriteShortBuffer || !midAudioWriteFloatBuffer || + !midAudioClose || + !midCaptureOpen || !midCaptureReadByteBuffer || !midCaptureReadShortBuffer || + !midCaptureReadFloatBuffer || !midCaptureClose || !midAudioSetThreadPriority) { + __android_log_print(ANDROID_LOG_WARN, "SDL", + "Missing some Java callbacks, do you have the latest version of SDLAudioManager.java?"); } checkJNIReady(); @@ -701,13 +716,13 @@ JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeSetupJNI)(JNIEnv *env mControllerManagerClass = (jclass)((*env)->NewGlobalRef(env, cls)); midPollInputDevices = (*env)->GetStaticMethodID(env, mControllerManagerClass, - "pollInputDevices", "()V"); + "pollInputDevices", "()V"); midPollHapticDevices = (*env)->GetStaticMethodID(env, mControllerManagerClass, - "pollHapticDevices", "()V"); + "pollHapticDevices", "()V"); midHapticRun = (*env)->GetStaticMethodID(env, mControllerManagerClass, - "hapticRun", "(IFI)V"); + "hapticRun", "(IFI)V"); midHapticStop = (*env)->GetStaticMethodID(env, mControllerManagerClass, - "hapticStop", "(I)V"); + "hapticStop", "(I)V"); if (!midPollInputDevices || !midPollHapticDevices || !midHapticRun || !midHapticStop) { __android_log_print(ANDROID_LOG_WARN, "SDL", "Missing some Java callbacks, do you have the latest version of SDLControllerManager.java?"); @@ -734,7 +749,7 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls, library_file = (*env)->GetStringUTFChars(env, library, NULL); library_handle = dlopen(library_file, RTLD_GLOBAL); - if (!library_handle) { + if (library_handle == NULL) { /* When deploying android app bundle format uncompressed native libs may not extract from apk to filesystem. In this case we should use lib name without path. https://bugzilla.libsdl.org/show_bug.cgi?id=4739 */ const char *library_name = SDL_strrchr(library_file, '/'); @@ -759,7 +774,7 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls, /* Prepare the arguments. */ len = (*env)->GetArrayLength(env, array); - argv = SDL_small_alloc(char *, 1 + len + 1, &isstack); /* !!! FIXME: check for NULL */ + argv = SDL_small_alloc(char *, 1 + len + 1, &isstack); /* !!! FIXME: check for NULL */ argc = 0; /* Use the name "app_process" so PHYSFS_platformCalcBaseDir() works. https://bitbucket.org/MartinFelis/love-android-sdl2/issue/23/release-build-crash-on-start @@ -777,14 +792,13 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls, } (*env)->DeleteLocalRef(env, string); } - if (!arg) { + if (arg == NULL) { arg = SDL_strdup(""); } argv[argc++] = arg; } argv[argc] = NULL; - /* Run the application. */ status = SDL_main(argc, argv); @@ -818,8 +832,8 @@ JNIEXPORT int JNICALL SDL_JAVA_INTERFACE(nativeRunMain)(JNIEnv *env, jclass cls, /* Drop file */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)( - JNIEnv *env, jclass jcls, - jstring filename) + JNIEnv *env, jclass jcls, + jstring filename) { const char *path = (*env)->GetStringUTFChars(env, filename, NULL); SDL_SendDropFile(NULL, path); @@ -828,16 +842,19 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)( } /* Lock / Unlock Mutex */ -void Android_ActivityMutex_Lock() { +void Android_ActivityMutex_Lock(void) +{ SDL_LockMutex(Android_ActivityMutex); } -void Android_ActivityMutex_Unlock() { +void Android_ActivityMutex_Unlock(void) +{ SDL_UnlockMutex(Android_ActivityMutex); } /* Lock the Mutex when the Activity is in its 'Running' state */ -void Android_ActivityMutex_Lock_Running() { +void Android_ActivityMutex_Lock_Running(void) +{ int pauseSignaled = 0; int resumeSignaled = 0; @@ -857,9 +874,9 @@ void Android_ActivityMutex_Lock_Running() { /* Set screen resolution */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetScreenResolution)( - JNIEnv *env, jclass jcls, - jint surfaceWidth, jint surfaceHeight, - jint deviceWidth, jint deviceHeight, jfloat rate) + JNIEnv *env, jclass jcls, + jint surfaceWidth, jint surfaceHeight, + jint deviceWidth, jint deviceHeight, jfloat rate) { SDL_LockMutex(Android_ActivityMutex); @@ -870,12 +887,11 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetScreenResolution)( /* Resize */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)( - JNIEnv *env, jclass jcls) + JNIEnv *env, jclass jcls) { SDL_LockMutex(Android_ActivityMutex); - if (Android_Window) - { + if (Android_Window) { Android_SendResize(Android_Window); } @@ -883,15 +899,14 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)( - JNIEnv *env, jclass jcls, - jint orientation) + JNIEnv *env, jclass jcls, + jint orientation) { SDL_LockMutex(Android_ActivityMutex); displayOrientation = (SDL_DisplayOrientation)orientation; - if (Android_Window) - { + if (Android_Window) { SDL_VideoDisplay *display = SDL_GetDisplay(0); SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation); } @@ -900,68 +915,92 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeAddTouch)( - JNIEnv* env, jclass cls, - jint touchId, jstring name) + JNIEnv *env, jclass cls, + jint touchId, jstring name) { const char *utfname = (*env)->GetStringUTFChars(env, name, NULL); - SDL_AddTouch((SDL_TouchID) touchId, SDL_TOUCH_DEVICE_DIRECT, utfname); + SDL_AddTouch((SDL_TouchID)touchId, SDL_TOUCH_DEVICE_DIRECT, utfname); (*env)->ReleaseStringUTFChars(env, name, utfname); } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)( - JNIEnv* env, jclass cls, - jint requestCode, jboolean result) + JNIEnv *env, jclass cls, + jint requestCode, jboolean result) { bPermissionRequestResult = result; SDL_AtomicSet(&bPermissionRequestPending, SDL_FALSE); } +extern void SDL_AddAudioDevice(const SDL_bool iscapture, const char *name, SDL_AudioSpec *spec, void *handle); +extern void SDL_RemoveAudioDevice(const SDL_bool iscapture, void *handle); + +JNIEXPORT void JNICALL +SDL_JAVA_AUDIO_INTERFACE(addAudioDevice)(JNIEnv *env, jclass jcls, jboolean is_capture, + jint device_id) +{ + if (SDL_GetCurrentAudioDriver() != NULL) { + char device_name[64]; + SDL_snprintf(device_name, sizeof(device_name), "%d", device_id); + SDL_Log("Adding device with name %s, capture %d", device_name, is_capture); + SDL_AddAudioDevice(is_capture, SDL_strdup(device_name), NULL, (void *)((size_t)device_id + 1)); + } +} + +JNIEXPORT void JNICALL +SDL_JAVA_AUDIO_INTERFACE(removeAudioDevice)(JNIEnv *env, jclass jcls, jboolean is_capture, + jint device_id) +{ + if (SDL_GetCurrentAudioDriver() != NULL) { + SDL_Log("Removing device with handle %d, capture %d", device_id + 1, is_capture); + SDL_RemoveAudioDevice(is_capture, (void *)((size_t)device_id + 1)); + } +} + /* Paddown */ JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativePadDown)( - JNIEnv *env, jclass jcls, - jint device_id, jint keycode) + JNIEnv *env, jclass jcls, + jint device_id, jint keycode) { return Android_OnPadDown(device_id, keycode); } /* Padup */ JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativePadUp)( - JNIEnv *env, jclass jcls, - jint device_id, jint keycode) + JNIEnv *env, jclass jcls, + jint device_id, jint keycode) { return Android_OnPadUp(device_id, keycode); } /* Joy */ JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativeJoy)( - JNIEnv *env, jclass jcls, - jint device_id, jint axis, jfloat value) + JNIEnv *env, jclass jcls, + jint device_id, jint axis, jfloat value) { Android_OnJoy(device_id, axis, value); } /* POV Hat */ JNIEXPORT void JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativeHat)( - JNIEnv *env, jclass jcls, - jint device_id, jint hat_id, jint x, jint y) + JNIEnv *env, jclass jcls, + jint device_id, jint hat_id, jint x, jint y) { Android_OnHat(device_id, hat_id, x, y); } - JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick)( - JNIEnv *env, jclass jcls, - jint device_id, jstring device_name, jstring device_desc, - jint vendor_id, jint product_id, jboolean is_accelerometer, - jint button_mask, jint naxes, jint nhats, jint nballs) + JNIEnv *env, jclass jcls, + jint device_id, jstring device_name, jstring device_desc, + jint vendor_id, jint product_id, jboolean is_accelerometer, + jint button_mask, jint naxes, jint axis_mask, jint nhats, jint nballs) { int retval; const char *name = (*env)->GetStringUTFChars(env, device_name, NULL); const char *desc = (*env)->GetStringUTFChars(env, device_desc, NULL); - retval = Android_AddJoystick(device_id, name, desc, vendor_id, product_id, is_accelerometer ? SDL_TRUE : SDL_FALSE, button_mask, naxes, nhats, nballs); + retval = Android_AddJoystick(device_id, name, desc, vendor_id, product_id, is_accelerometer ? SDL_TRUE : SDL_FALSE, button_mask, naxes, axis_mask, nhats, nballs); (*env)->ReleaseStringUTFChars(env, device_name, name); (*env)->ReleaseStringUTFChars(env, device_desc, desc); @@ -970,8 +1009,8 @@ JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeAddJoystick)( } JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(nativeRemoveJoystick)( - JNIEnv *env, jclass jcls, - jint device_id) + JNIEnv *env, jclass jcls, + jint device_id) { return Android_RemoveJoystick(device_id); } @@ -1000,9 +1039,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceCreated)(JNIEnv *env, j { SDL_LockMutex(Android_ActivityMutex); - if (Android_Window) - { - SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata; + if (Android_Window) { + SDL_WindowData *data = (SDL_WindowData *)Android_Window->driverdata; data->native_window = Android_JNI_GetNativeWindow(); if (data->native_window == NULL) { @@ -1018,15 +1056,14 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j { SDL_LockMutex(Android_ActivityMutex); -#if SDL_VIDEO_OPENGL_EGL - if (Android_Window) - { +#ifdef SDL_VIDEO_OPENGL_EGL + if (Android_Window) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); - SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)Android_Window->driverdata; /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */ if (data->egl_surface == EGL_NO_SURFACE) { - data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window); + data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)data->native_window); } /* GL Context handling is done in the event loop because this function is run from the Java thread */ @@ -1045,13 +1082,12 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(JNIEnv *env, SDL_LockMutex(Android_ActivityMutex); - if (Android_Window) - { + if (Android_Window) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); - SDL_WindowData *data = (SDL_WindowData *) Android_Window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)Android_Window->driverdata; /* Wait for Main thread being paused and context un-activated to release 'egl_surface' */ - if (! data->backup_done) { + if (!data->backup_done) { nb_attempt -= 1; if (nb_attempt == 0) { SDL_SetError("Try to release egl_surface with context probably still active"); @@ -1062,7 +1098,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(JNIEnv *env, } } -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); data->egl_surface = EGL_NO_SURFACE; @@ -1082,23 +1118,23 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(JNIEnv *env, /* Keydown */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyDown)( - JNIEnv *env, jclass jcls, - jint keycode) + JNIEnv *env, jclass jcls, + jint keycode) { Android_OnKeyDown(keycode); } /* Keyup */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyUp)( - JNIEnv *env, jclass jcls, - jint keycode) + JNIEnv *env, jclass jcls, + jint keycode) { Android_OnKeyUp(keycode); } /* Virtual keyboard return key might stop text input */ JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(onNativeSoftReturnKey)( - JNIEnv *env, jclass jcls) + JNIEnv *env, jclass jcls) { if (SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE)) { SDL_StopTextInput(); @@ -1109,18 +1145,17 @@ JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(onNativeSoftReturnKey)( /* Keyboard Focus Lost */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost)( - JNIEnv *env, jclass jcls) + JNIEnv *env, jclass jcls) { /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */ SDL_StopTextInput(); } - /* Touch */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeTouch)( - JNIEnv *env, jclass jcls, - jint touch_device_id_in, jint pointer_finger_id_in, - jint action, jfloat x, jfloat y, jfloat p) + JNIEnv *env, jclass jcls, + jint touch_device_id_in, jint pointer_finger_id_in, + jint action, jfloat x, jfloat y, jfloat p) { SDL_LockMutex(Android_ActivityMutex); @@ -1131,8 +1166,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeTouch)( /* Mouse */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)( - JNIEnv *env, jclass jcls, - jint button, jint action, jfloat x, jfloat y, jboolean relative) + JNIEnv *env, jclass jcls, + jint button, jint action, jfloat x, jfloat y, jboolean relative) { SDL_LockMutex(Android_ActivityMutex); @@ -1143,8 +1178,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)( /* Accelerometer */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)( - JNIEnv *env, jclass jcls, - jfloat x, jfloat y, jfloat z) + JNIEnv *env, jclass jcls, + jfloat x, jfloat y, jfloat z) { fLastAccelerometer[0] = x; fLastAccelerometer[1] = y; @@ -1154,14 +1189,14 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)( /* Clipboard */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeClipboardChanged)( - JNIEnv *env, jclass jcls) + JNIEnv *env, jclass jcls) { SDL_SendClipboardUpdate(); } /* Low memory */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeLowMemory)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { SDL_SendAppEvent(SDL_APP_LOWMEMORY); } @@ -1169,15 +1204,14 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeLowMemory)( /* Locale * requires android:configChanges="layoutDirection|locale" in AndroidManifest.xml */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeLocaleChanged)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { SDL_SendAppEvent(SDL_LOCALECHANGED); } - /* Send Quit event to "SDLThread" thread */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSendQuit)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { /* Discard previous events. The user should have handled state storage * in SDL_APP_WILLENTERBACKGROUND. After nativeSendQuit() is called, no @@ -1197,7 +1231,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSendQuit)( /* Activity ends */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { const char *str; @@ -1228,7 +1262,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)( /* Pause */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()"); @@ -1239,7 +1273,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)( /* Resume */ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)( - JNIEnv *env, jclass cls) + JNIEnv *env, jclass cls) { __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()"); @@ -1251,7 +1285,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeFocusChanged)( - JNIEnv *env, jclass cls, jboolean hasFocus) + JNIEnv *env, jclass cls, jboolean hasFocus) { SDL_LockMutex(Android_ActivityMutex); @@ -1264,8 +1298,8 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeFocusChanged)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)( - JNIEnv *env, jclass cls, - jstring text, jint newCursorPosition) + JNIEnv *env, jclass cls, + jstring text, jint newCursorPosition) { const char *utftext = (*env)->GetStringUTFChars(env, text, NULL); @@ -1275,15 +1309,15 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar)( - JNIEnv *env, jclass cls, - jchar chUnicode) + JNIEnv *env, jclass cls, + jchar chUnicode) { SDL_SendKeyboardUnicodeKey(chUnicode); } JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)( - JNIEnv *env, jclass cls, - jstring name) + JNIEnv *env, jclass cls, + jstring name) { const char *utfname = (*env)->GetStringUTFChars(env, name, NULL); const char *hint = SDL_GetHint(utfname); @@ -1295,8 +1329,8 @@ JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)( } JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(nativeGetHintBoolean)( - JNIEnv *env, jclass cls, - jstring name, jboolean default_value) + JNIEnv *env, jclass cls, + jstring name, jboolean default_value) { jboolean result; @@ -1308,8 +1342,8 @@ JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(nativeGetHintBoolean)( } JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetenv)( - JNIEnv *env, jclass cls, - jstring name, jstring value) + JNIEnv *env, jclass cls, + jstring name, jstring value) { const char *utfname = (*env)->GetStringUTFChars(env, name, NULL); const char *utfvalue = (*env)->GetStringUTFChars(env, value, NULL); @@ -1318,7 +1352,6 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSetenv)( (*env)->ReleaseStringUTFChars(env, name, utfname); (*env)->ReleaseStringUTFChars(env, value, utfvalue); - } /******************************************************************************* @@ -1367,7 +1400,7 @@ static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder) } } -ANativeWindow* Android_JNI_GetNativeWindow(void) +ANativeWindow *Android_JNI_GetNativeWindow(void) { ANativeWindow *anw = NULL; jobject s; @@ -1402,17 +1435,17 @@ void Android_JNI_SetOrientation(int w, int h, int resizable, const char *hint) JNIEnv *env = Android_JNI_GetEnv(); jstring jhint = (*env)->NewStringUTF(env, (hint ? hint : "")); - (*env)->CallStaticVoidMethod(env, mActivityClass, midSetOrientation, w, h, (resizable? 1 : 0), jhint); + (*env)->CallStaticVoidMethod(env, mActivityClass, midSetOrientation, w, h, (resizable ? 1 : 0), jhint); (*env)->DeleteLocalRef(env, jhint); } -void Android_JNI_MinizeWindow() +void Android_JNI_MinizeWindow(void) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midMinimizeWindow); } -SDL_bool Android_JNI_ShouldMinimizeOnFocusLoss() +SDL_bool Android_JNI_ShouldMinimizeOnFocusLoss(void) { JNIEnv *env = Android_JNI_GetEnv(); return (*env)->CallStaticBooleanMethod(env, mActivityClass, midShouldMinimizeOnFocusLoss); @@ -1443,7 +1476,57 @@ static void *audioBufferPinned = NULL; static int captureBufferFormat = 0; static jobject captureBuffer = NULL; -int Android_JNI_OpenAudioDevice(int iscapture, SDL_AudioSpec *spec) +static void Android_JNI_GetAudioDevices(int *devices, int *length, int max_len, int is_input) +{ + JNIEnv *env = Android_JNI_GetEnv(); + jintArray result; + + if (is_input) { + result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midGetAudioInputDevices); + } else { + result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midGetAudioOutputDevices); + } + + *length = (*env)->GetArrayLength(env, result); + + *length = SDL_min(*length, max_len); + + (*env)->GetIntArrayRegion(env, result, 0, *length, devices); +} + +void Android_DetectDevices(void) +{ + int inputs[100]; + int outputs[100]; + int inputs_length = 0; + int outputs_length = 0; + + SDL_zeroa(inputs); + + Android_JNI_GetAudioDevices(inputs, &inputs_length, 100, 1 /* input devices */); + + for (int i = 0; i < inputs_length; ++i) { + int device_id = inputs[i]; + char device_name[64]; + SDL_snprintf(device_name, sizeof(device_name), "%d", device_id); + SDL_Log("Adding input device with name %s", device_name); + SDL_AddAudioDevice(SDL_TRUE, SDL_strdup(device_name), NULL, (void *)((size_t)device_id + 1)); + } + + SDL_zeroa(outputs); + + Android_JNI_GetAudioDevices(outputs, &outputs_length, 100, 0 /* output devices */); + + for (int i = 0; i < outputs_length; ++i) { + int device_id = outputs[i]; + char device_name[64]; + SDL_snprintf(device_name, sizeof(device_name), "%d", device_id); + SDL_Log("Adding output device with name %s", device_name); + SDL_AddAudioDevice(SDL_FALSE, SDL_strdup(device_name), NULL, (void *)((size_t)device_id + 1)); + } +} + +int Android_JNI_OpenAudioDevice(int iscapture, int device_id, SDL_AudioSpec *spec) { int audioformat; jobject jbufobj = NULL; @@ -1469,12 +1552,12 @@ int Android_JNI_OpenAudioDevice(int iscapture, SDL_AudioSpec *spec) if (iscapture) { __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device for capture"); - result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midCaptureOpen, spec->freq, audioformat, spec->channels, spec->samples); + result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midCaptureOpen, spec->freq, audioformat, spec->channels, spec->samples, device_id); } else { __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device for output"); - result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midAudioOpen, spec->freq, audioformat, spec->channels, spec->samples); + result = (*env)->CallStaticObjectMethod(env, mAudioManagerClass, midAudioOpen, spec->freq, audioformat, spec->channels, spec->samples, device_id); } - if (result == NULL) { + if (!result) { /* Error during audio initialization, error printed from Java */ return SDL_SetError("Java-side initialization failed"); } @@ -1508,37 +1591,34 @@ int Android_JNI_OpenAudioDevice(int iscapture, SDL_AudioSpec *spec) * Android >= 4.2 due to a "stale global reference" error. So now we allocate this buffer directly from this side. */ switch (audioformat) { case ENCODING_PCM_8BIT: - { - jbyteArray audioBufferLocal = (*env)->NewByteArray(env, spec->samples * spec->channels); - if (audioBufferLocal) { - jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); - (*env)->DeleteLocalRef(env, audioBufferLocal); - } + { + jbyteArray audioBufferLocal = (*env)->NewByteArray(env, spec->samples * spec->channels); + if (audioBufferLocal) { + jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); } - break; + } break; case ENCODING_PCM_16BIT: - { - jshortArray audioBufferLocal = (*env)->NewShortArray(env, spec->samples * spec->channels); - if (audioBufferLocal) { - jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); - (*env)->DeleteLocalRef(env, audioBufferLocal); - } + { + jshortArray audioBufferLocal = (*env)->NewShortArray(env, spec->samples * spec->channels); + if (audioBufferLocal) { + jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); } - break; + } break; case ENCODING_PCM_FLOAT: - { - jfloatArray audioBufferLocal = (*env)->NewFloatArray(env, spec->samples * spec->channels); - if (audioBufferLocal) { - jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); - (*env)->DeleteLocalRef(env, audioBufferLocal); - } + { + jfloatArray audioBufferLocal = (*env)->NewFloatArray(env, spec->samples * spec->channels); + if (audioBufferLocal) { + jbufobj = (*env)->NewGlobalRef(env, audioBufferLocal); + (*env)->DeleteLocalRef(env, audioBufferLocal); } - break; + } break; default: return SDL_SetError("Unexpected audio format from Java: %d\n", audioformat); } - if (jbufobj == NULL) { + if (!jbufobj) { __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: could not allocate an audio buffer"); return SDL_OutOfMemory(); } @@ -1591,7 +1671,6 @@ int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi) float nativeYdpi = (*env)->GetFloatField(env, jDisplayObj, fidYdpi); int nativeDdpi = (*env)->GetIntField(env, jDisplayObj, fidDdpi); - (*env)->DeleteLocalRef(env, jDisplayObj); (*env)->DeleteLocalRef(env, jDisplayClass); @@ -1608,7 +1687,7 @@ int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi) return 0; } -void * Android_JNI_GetAudioBuffer(void) +void *Android_JNI_GetAudioBuffer(void) { return audioBufferPinned; } @@ -1684,7 +1763,7 @@ int Android_JNI_CaptureAudioBuffer(void *buffer, int buflen) void Android_JNI_FlushCapturedAudio(void) { JNIEnv *env = Android_JNI_GetEnv(); -#if 0 /* !!! FIXME: this needs API 23, or it'll do blocking reads and never end. */ +#if 0 /* !!! FIXME: this needs API 23, or it'll do blocking reads and never end. */ switch (captureBufferFormat) { case ENCODING_PCM_8BIT: { @@ -1800,7 +1879,8 @@ static SDL_bool Android_JNI_ExceptionOccurred(SDL_bool silent) return SDL_FALSE; } -static void Internal_Android_Create_AssetManager() { +static void Internal_Android_Create_AssetManager(void) +{ struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); JNIEnv *env = Android_JNI_GetEnv(); @@ -1818,7 +1898,7 @@ static void Internal_Android_Create_AssetManager() { /* javaAssetManager = context.getAssets(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), - "getAssets", "()Landroid/content/res/AssetManager;"); + "getAssets", "()Landroid/content/res/AssetManager;"); javaAssetManager = (*env)->CallObjectMethod(env, context, mid); /** @@ -1830,7 +1910,7 @@ static void Internal_Android_Create_AssetManager() { javaAssetManagerRef = (*env)->NewGlobalRef(env, javaAssetManager); asset_manager = AAssetManager_fromJava(env, javaAssetManagerRef); - if (asset_manager == NULL) { + if (!asset_manager) { (*env)->DeleteGlobalRef(env, javaAssetManagerRef); Android_JNI_ExceptionOccurred(SDL_TRUE); } @@ -1838,7 +1918,8 @@ static void Internal_Android_Create_AssetManager() { LocalReferenceHolder_Cleanup(&refs); } -static void Internal_Android_Destroy_AssetManager() { +static void Internal_Android_Destroy_AssetManager(void) +{ JNIEnv *env = Android_JNI_GetEnv(); if (asset_manager) { @@ -1848,39 +1929,38 @@ static void Internal_Android_Destroy_AssetManager() { } int Android_JNI_FileOpen(SDL_RWops *ctx, - const char *fileName, const char *mode) + const char *fileName, const char *mode) { AAsset *asset = NULL; ctx->hidden.androidio.asset = NULL; - if (asset_manager == NULL) { + if (!asset_manager) { Internal_Android_Create_AssetManager(); } - if (asset_manager == NULL) { - return -1; + if (!asset_manager) { + return SDL_SetError("Couldn't create asset manager"); } asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN); - if (asset == NULL) { - return -1; + if (!asset) { + return SDL_SetError("Couldn't open asset '%s'", fileName); } - - ctx->hidden.androidio.asset = (void*) asset; + ctx->hidden.androidio.asset = (void *)asset; return 0; } -size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, - size_t size, size_t maxnum) +size_t Android_JNI_FileRead(SDL_RWops *ctx, void *buffer, + size_t size, size_t maxnum) { size_t result; - AAsset *asset = (AAsset*) ctx->hidden.androidio.asset; + AAsset *asset = (AAsset *)ctx->hidden.androidio.asset; result = AAsset_read(asset, buffer, size * maxnum); if (result > 0) { /* Number of chuncks */ - return (result / size); + return result / size; } else { /* Error or EOF */ return result; @@ -1888,7 +1968,7 @@ size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer, } size_t Android_JNI_FileWrite(SDL_RWops *ctx, const void *buffer, - size_t size, size_t num) + size_t size, size_t num) { SDL_SetError("Cannot write to Android package filesystem"); return 0; @@ -1897,22 +1977,22 @@ size_t Android_JNI_FileWrite(SDL_RWops *ctx, const void *buffer, Sint64 Android_JNI_FileSize(SDL_RWops *ctx) { off64_t result; - AAsset *asset = (AAsset*) ctx->hidden.androidio.asset; + AAsset *asset = (AAsset *)ctx->hidden.androidio.asset; result = AAsset_getLength64(asset); return result; } -Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence) +Sint64 Android_JNI_FileSeek(SDL_RWops *ctx, Sint64 offset, int whence) { off64_t result; - AAsset *asset = (AAsset*) ctx->hidden.androidio.asset; + AAsset *asset = (AAsset *)ctx->hidden.androidio.asset; result = AAsset_seek64(asset, offset, whence); return result; } int Android_JNI_FileClose(SDL_RWops *ctx) { - AAsset *asset = (AAsset*) ctx->hidden.androidio.asset; + AAsset *asset = (AAsset *)ctx->hidden.androidio.asset; AAsset_close(asset); return 0; } @@ -1926,7 +2006,7 @@ int Android_JNI_SetClipboardText(const char *text) return 0; } -char* Android_JNI_GetClipboardText(void) +char *Android_JNI_GetClipboardText(void) { JNIEnv *env = Android_JNI_GetEnv(); char *text = NULL; @@ -1942,7 +2022,7 @@ char* Android_JNI_GetClipboardText(void) (*env)->DeleteLocalRef(env, string); } - return (text == NULL) ? SDL_strdup("") : text; + return (!text) ? SDL_strdup("") : text; } SDL_bool Android_JNI_HasClipboardText(void) @@ -1975,7 +2055,6 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco return -1; } - /* context = SDLActivity.getContext(); */ context = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetContext); @@ -1998,18 +2077,18 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco imid = (*env)->GetMethodID(env, cls, "getIntExtra", "(Ljava/lang/String;I)I"); /* Watch out for C89 scoping rules because of the macro */ -#define GET_INT_EXTRA(var, key) \ - int var; \ - iname = (*env)->NewStringUTF(env, key); \ +#define GET_INT_EXTRA(var, key) \ + int var; \ + iname = (*env)->NewStringUTF(env, key); \ (var) = (*env)->CallIntMethod(env, intent, imid, iname, -1); \ (*env)->DeleteLocalRef(env, iname); bmid = (*env)->GetMethodID(env, cls, "getBooleanExtra", "(Ljava/lang/String;Z)Z"); /* Watch out for C89 scoping rules because of the macro */ -#define GET_BOOL_EXTRA(var, key) \ - int var; \ - bname = (*env)->NewStringUTF(env, key); \ +#define GET_BOOL_EXTRA(var, key) \ + int var; \ + bname = (*env)->NewStringUTF(env, key); \ (var) = (*env)->CallBooleanMethod(env, intent, bmid, bname, JNI_FALSE); \ (*env)->DeleteLocalRef(env, bname); @@ -2074,8 +2153,9 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco } /* Add all touch devices */ -void Android_JNI_InitTouch() { - JNIEnv *env = Android_JNI_GetEnv(); +void Android_JNI_InitTouch(void) +{ + JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midInitTouch); } @@ -2104,8 +2184,7 @@ void Android_JNI_HapticStop(int device_id) } /* See SDLActivity.java for constants. */ -#define COMMAND_SET_KEEP_SCREEN_ON 5 - +#define COMMAND_SET_KEEP_SCREEN_ON 5 int SDL_AndroidSendMessage(Uint32 command, int param) { @@ -2129,17 +2208,17 @@ void Android_JNI_SuspendScreenSaver(SDL_bool suspend) Android_JNI_SendMessage(COMMAND_SET_KEEP_SCREEN_ON, (suspend == SDL_FALSE) ? 0 : 1); } -void Android_JNI_ShowTextInput(SDL_Rect *inputRect) +void Android_JNI_ShowScreenKeyboard(SDL_Rect *inputRect) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticBooleanMethod(env, mActivityClass, midShowTextInput, - inputRect->x, - inputRect->y, - inputRect->w, - inputRect->h ); + inputRect->x, + inputRect->y, + inputRect->w, + inputRect->h); } -void Android_JNI_HideTextInput(void) +void Android_JNI_HideScreenKeyboard(void) { /* has to match Activity constant */ const int COMMAND_TEXTEDIT_HIDE = 3; @@ -2154,7 +2233,6 @@ SDL_bool Android_JNI_IsScreenKeyboardShown(void) return is_shown; } - int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { JNIEnv *env; @@ -2183,7 +2261,7 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu button_flags = (*env)->NewIntArray(env, messageboxdata->numbuttons); button_ids = (*env)->NewIntArray(env, messageboxdata->numbuttons); button_texts = (*env)->NewObjectArray(env, messageboxdata->numbuttons, - clazz, NULL); + clazz, NULL); for (i = 0; i < messageboxdata->numbuttons; ++i) { const SDL_MessageBoxButtonData *sdlButton; @@ -2223,15 +2301,15 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu clazz = (*env)->GetObjectClass(env, context); mid = (*env)->GetMethodID(env, clazz, - "messageboxShowMessageBox", "(ILjava/lang/String;Ljava/lang/String;[I[I[Ljava/lang/String;[I)I"); + "messageboxShowMessageBox", "(ILjava/lang/String;Ljava/lang/String;[I[I[Ljava/lang/String;[I)I"); *buttonid = (*env)->CallIntMethod(env, context, mid, - messageboxdata->flags, - title, - message, - button_flags, - button_ids, - button_texts, - colors); + messageboxdata->flags, + title, + message, + button_flags, + button_ids, + button_texts, + colors); (*env)->DeleteLocalRef(env, context); (*env)->DeleteLocalRef(env, clazz); @@ -2277,7 +2355,7 @@ int SDL_GetAndroidSDKVersion(void) { static int sdk_version; if (!sdk_version) { - char sdk[PROP_VALUE_MAX] = {0}; + char sdk[PROP_VALUE_MAX] = { 0 }; if (__system_property_get("ro.build.version.sdk", sdk) != 0) { sdk_version = SDL_atoi(sdk); } @@ -2315,7 +2393,7 @@ void SDL_AndroidBackButton(void) (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton); } -const char * SDL_AndroidGetInternalStoragePath(void) +const char *SDL_AndroidGetInternalStoragePath(void) { static char *s_AndroidInternalFilesPath = NULL; @@ -2343,7 +2421,7 @@ const char * SDL_AndroidGetInternalStoragePath(void) /* fileObj = context.getFilesDir(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), - "getFilesDir", "()Ljava/io/File;"); + "getFilesDir", "()Ljava/io/File;"); fileObject = (*env)->CallObjectMethod(env, context, mid); if (!fileObject) { SDL_SetError("Couldn't get internal directory"); @@ -2353,7 +2431,7 @@ const char * SDL_AndroidGetInternalStoragePath(void) /* path = fileObject.getCanonicalPath(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), - "getCanonicalPath", "()Ljava/lang/String;"); + "getCanonicalPath", "()Ljava/lang/String;"); pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); if (Android_JNI_ExceptionOccurred(SDL_FALSE)) { LocalReferenceHolder_Cleanup(&refs); @@ -2386,7 +2464,7 @@ int SDL_AndroidGetExternalStorageState(void) cls = (*env)->FindClass(env, "android/os/Environment"); mid = (*env)->GetStaticMethodID(env, cls, - "getExternalStorageState", "()Ljava/lang/String;"); + "getExternalStorageState", "()Ljava/lang/String;"); stateString = (jstring)(*env)->CallStaticObjectMethod(env, cls, mid); state = (*env)->GetStringUTFChars(env, stateString, NULL); @@ -2408,7 +2486,7 @@ int SDL_AndroidGetExternalStorageState(void) return stateFlags; } -const char * SDL_AndroidGetExternalStoragePath(void) +const char *SDL_AndroidGetExternalStoragePath(void) { static char *s_AndroidExternalFilesPath = NULL; @@ -2431,7 +2509,7 @@ const char * SDL_AndroidGetExternalStoragePath(void) /* fileObj = context.getExternalFilesDir(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), - "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;"); + "getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;"); fileObject = (*env)->CallObjectMethod(env, context, mid, NULL); if (!fileObject) { SDL_SetError("Couldn't get external directory"); @@ -2441,7 +2519,7 @@ const char * SDL_AndroidGetExternalStoragePath(void) /* path = fileObject.getAbsolutePath(); */ mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), - "getAbsolutePath", "()Ljava/lang/String;"); + "getAbsolutePath", "()Ljava/lang/String;"); pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); path = (*env)->GetStringUTFChars(env, pathString, NULL); @@ -2458,7 +2536,7 @@ SDL_bool SDL_AndroidRequestPermission(const char *permission) return Android_JNI_RequestPermission(permission); } -int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xOffset, int yOffset) +int SDL_AndroidShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset) { return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset); } @@ -2499,7 +2577,6 @@ void Android_JNI_DestroyCustomCursor(int cursorID) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midDestroyCustomCursor, cursorID); - return; } SDL_bool Android_JNI_SetCustomCursor(int cursorID) @@ -2550,7 +2627,7 @@ SDL_bool Android_JNI_RequestPermission(const char *permission) } /* Show toast notification */ -int Android_JNI_ShowToast(const char* message, int duration, int gravity, int xOffset, int yOffset) +int Android_JNI_ShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset) { int result = 0; JNIEnv *env = Android_JNI_GetEnv(); @@ -2569,16 +2646,16 @@ int Android_JNI_GetLocale(char *buf, size_t buflen) /* Need to re-create the asset manager if locale has changed (SDL_LOCALECHANGED) */ Internal_Android_Destroy_AssetManager(); - if (asset_manager == NULL) { + if (!asset_manager) { Internal_Android_Create_AssetManager(); } - if (asset_manager == NULL) { + if (!asset_manager) { return -1; } cfg = AConfiguration_new(); - if (cfg == NULL) { + if (!cfg) { return -1; } @@ -2608,7 +2685,7 @@ int Android_JNI_GetLocale(char *buf, size_t buflen) buf[id++] = country[1]; } } - + buf[id++] = '\0'; SDL_assert(id <= buflen); } @@ -2618,8 +2695,7 @@ int Android_JNI_GetLocale(char *buf, size_t buflen) return 0; } -int -Android_JNI_OpenURL(const char *url) +int Android_JNI_OpenURL(const char *url) { JNIEnv *env = Android_JNI_GetEnv(); jstring jurl = (*env)->NewStringUTF(env, url); diff --git a/src/core/android/SDL_android.h b/src/core/android/SDL_android.h index 0df411186f622..650b7947b50c4 100644 --- a/src/core/android/SDL_android.h +++ b/src/core/android/SDL_android.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,17 +43,18 @@ extern void Android_JNI_MinizeWindow(void); extern SDL_bool Android_JNI_ShouldMinimizeOnFocusLoss(void); extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]); -extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect); -extern void Android_JNI_HideTextInput(void); +extern void Android_JNI_ShowScreenKeyboard(SDL_Rect *inputRect); +extern void Android_JNI_HideScreenKeyboard(void); extern SDL_bool Android_JNI_IsScreenKeyboardShown(void); -extern ANativeWindow* Android_JNI_GetNativeWindow(void); +extern ANativeWindow *Android_JNI_GetNativeWindow(void); extern SDL_DisplayOrientation Android_JNI_GetDisplayOrientation(void); extern int Android_JNI_GetDisplayDPI(float *ddpi, float *xdpi, float *ydpi); /* Audio support */ -extern int Android_JNI_OpenAudioDevice(int iscapture, SDL_AudioSpec *spec); -extern void* Android_JNI_GetAudioBuffer(void); +extern void Android_DetectDevices(void); +extern int Android_JNI_OpenAudioDevice(int iscapture, int device_id, SDL_AudioSpec *spec); +extern void *Android_JNI_GetAudioBuffer(void); extern void Android_JNI_WriteAudioBuffer(void); extern int Android_JNI_CaptureAudioBuffer(void *buffer, int buflen); extern void Android_JNI_FlushCapturedAudio(void); @@ -77,12 +78,12 @@ int Android_JNI_FileClose(SDL_RWops* ctx); void Android_JNI_GetManifestEnvironmentVariables(void); /* Clipboard support */ -int Android_JNI_SetClipboardText(const char* text); -char* Android_JNI_GetClipboardText(void); +int Android_JNI_SetClipboardText(const char *text); +char *Android_JNI_GetClipboardText(void); SDL_bool Android_JNI_HasClipboardText(void); /* Power support */ -int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent); +int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seconds, int *percent); /* Joystick support */ void Android_JNI_PollInputDevices(void); @@ -110,7 +111,7 @@ int Android_JNI_GetLocale(char *buf, size_t buflen); int Android_JNI_SendMessage(int command, int param); /* Init */ -JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls); +JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv *mEnv, jclass cls); /* MessageBox */ #include "SDL_messagebox.h" @@ -130,7 +131,7 @@ SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled); SDL_bool Android_JNI_RequestPermission(const char *permission); /* Show toast notification */ -int Android_JNI_ShowToast(const char* message, int duration, int gravity, int xOffset, int yOffset); +int Android_JNI_ShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset); int Android_JNI_OpenURL(const char *url); diff --git a/src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h b/src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h index 909afad88499f..8cb7430aba905 100644 --- a/src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h +++ b/src/core/freebsd/SDL_evdev_kbd_default_keyaccmap.h @@ -1,5 +1,6 @@ #include +/* *INDENT-OFF* */ /* clang-format off */ /* * Automatically generated from /usr/share/vt/keymaps/us.acc.kbd. * DO NOT EDIT! @@ -163,3 +164,4 @@ static accentmap_t accentmap_default_us_acc = { 11, { { 0x00 }, } }; +/* *INDENT-ON* */ /* clang-format on */ diff --git a/src/core/freebsd/SDL_evdev_kbd_freebsd.c b/src/core/freebsd/SDL_evdev_kbd_freebsd.c index c242053acec2b..47e25b510b5a5 100644 --- a/src/core/freebsd/SDL_evdev_kbd_freebsd.c +++ b/src/core/freebsd/SDL_evdev_kbd_freebsd.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,7 +39,7 @@ #include "../../events/SDL_events_c.h" #include "SDL_evdev_kbd_default_keyaccmap.h" -typedef void (fn_handler_fn)(SDL_EVDEV_keyboard_state *kbd); +typedef void(fn_handler_fn)(SDL_EVDEV_keyboard_state *kbd); /* * Keyboard State @@ -51,14 +51,14 @@ struct SDL_EVDEV_keyboard_state int keyboard_fd; unsigned long old_kbd_mode; unsigned short **key_maps; - keymap_t* key_map; - keyboard_info_t* kbInfo; - unsigned char shift_down[4]; /* shift state counters.. */ + keymap_t *key_map; + keyboard_info_t *kbInfo; + unsigned char shift_down[4]; /* shift state counters.. */ SDL_bool dead_key_next; - int npadch; /* -1 or number assembled on pad */ + int npadch; /* -1 or number assembled on pad */ accentmap_t *accents; unsigned int diacr; - SDL_bool rep; /* flag telling character repeat */ + SDL_bool rep; /* flag telling character repeat */ unsigned char lockstate; unsigned char ledflagstate; char shift_state; @@ -68,51 +68,51 @@ struct SDL_EVDEV_keyboard_state static int SDL_EVDEV_kbd_load_keymaps(SDL_EVDEV_keyboard_state *kbd) { - return (ioctl(kbd->keyboard_fd, GIO_KEYMAP, kbd->key_map) >= 0); + return ioctl(kbd->keyboard_fd, GIO_KEYMAP, kbd->key_map) >= 0; } -static SDL_EVDEV_keyboard_state * kbd_cleanup_state = NULL; +static SDL_EVDEV_keyboard_state *kbd_cleanup_state = NULL; static int kbd_cleanup_sigactions_installed = 0; static int kbd_cleanup_atexit_installed = 0; static struct sigaction old_sigaction[NSIG]; -static int fatal_signals[] = -{ +static int fatal_signals[] = { /* Handlers for SIGTERM and SIGINT are installed in SDL_QuitInit. */ - SIGHUP, SIGQUIT, SIGILL, SIGABRT, - SIGFPE, SIGSEGV, SIGPIPE, SIGBUS, + SIGHUP, SIGQUIT, SIGILL, SIGABRT, + SIGFPE, SIGSEGV, SIGPIPE, SIGBUS, SIGSYS }; static void kbd_cleanup(void) { struct mouse_info mData; - SDL_EVDEV_keyboard_state* kbd = kbd_cleanup_state; - if (kbd == NULL) { + SDL_EVDEV_keyboard_state *kbd = kbd_cleanup_state; + if (!kbd) { return; } kbd_cleanup_state = NULL; SDL_zero(mData); mData.operation = MOUSE_SHOW; ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode); - if (kbd->keyboard_fd != kbd->console_fd) close(kbd->keyboard_fd); + if (kbd->keyboard_fd != kbd->console_fd) { + close(kbd->keyboard_fd); + } ioctl(kbd->console_fd, CONS_SETKBD, (unsigned long)(kbd->kbInfo->kb_index)); ioctl(kbd->console_fd, CONS_MOUSECTL, &mData); } -void -SDL_EVDEV_kbd_reraise_signal(int sig) +void SDL_EVDEV_kbd_reraise_signal(int sig) { raise(sig); } -siginfo_t* SDL_EVDEV_kdb_cleanup_siginfo = NULL; -void* SDL_EVDEV_kdb_cleanup_ucontext = NULL; +siginfo_t *SDL_EVDEV_kdb_cleanup_siginfo = NULL; +void *SDL_EVDEV_kdb_cleanup_ucontext = NULL; -static void kbd_cleanup_signal_action(int signum, siginfo_t* info, void* ucontext) +static void kbd_cleanup_signal_action(int signum, siginfo_t *info, void *ucontext) { - struct sigaction* old_action_p = &(old_sigaction[signum]); + struct sigaction *old_action_p = &(old_sigaction[signum]); sigset_t sigset; /* Restore original signal handler before going any further. */ @@ -134,7 +134,7 @@ static void kbd_cleanup_signal_action(int signum, siginfo_t* info, void* ucontex SDL_EVDEV_kbd_reraise_signal(signum); } -static void kbd_unregister_emerg_cleanup() +static void kbd_unregister_emerg_cleanup(void) { int tabidx, signum; @@ -146,19 +146,20 @@ static void kbd_unregister_emerg_cleanup() kbd_cleanup_sigactions_installed = 0; for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) { - struct sigaction* old_action_p; + struct sigaction *old_action_p; struct sigaction cur_action; signum = fatal_signals[tabidx]; old_action_p = &(old_sigaction[signum]); /* Examine current signal action */ - if (sigaction(signum, NULL, &cur_action)) + if (sigaction(signum, NULL, &cur_action)) { continue; + } /* Check if action installed and not modifed */ - if (!(cur_action.sa_flags & SA_SIGINFO) - || cur_action.sa_sigaction != &kbd_cleanup_signal_action) + if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) { continue; + } /* Restore original action */ sigaction(signum, old_action_p, NULL); @@ -174,11 +175,11 @@ static void kbd_cleanup_atexit(void) kbd_unregister_emerg_cleanup(); } -static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) +static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd) { int tabidx, signum; - if (kbd_cleanup_state != NULL) { + if (kbd_cleanup_state) { return; } kbd_cleanup_state = kbd; @@ -198,20 +199,20 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) kbd_cleanup_sigactions_installed = 1; for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) { - struct sigaction* old_action_p; + struct sigaction *old_action_p; struct sigaction new_action; - signum = fatal_signals[tabidx]; + signum = fatal_signals[tabidx]; old_action_p = &(old_sigaction[signum]); - if (sigaction(signum, NULL, old_action_p)) + if (sigaction(signum, NULL, old_action_p)) { continue; + } /* Skip SIGHUP and SIGPIPE if handler is already installed * - assume the handler will do the cleanup */ - if ((signum == SIGHUP || signum == SIGPIPE) - && (old_action_p->sa_handler != SIG_DFL - || (void (*)(int))old_action_p->sa_sigaction != SIG_DFL)) + if ((signum == SIGHUP || signum == SIGPIPE) && (old_action_p->sa_handler != SIG_DFL || (void (*)(int))old_action_p->sa_sigaction != SIG_DFL)) { continue; + } new_action = *old_action_p; new_action.sa_flags |= SA_SIGINFO; @@ -220,13 +221,12 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) } } -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) { SDL_EVDEV_keyboard_state *kbd; struct mouse_info mData; char flag_state; - char* devicePath; + char *devicePath; SDL_zero(mData); mData.operation = MOUSE_HIDE; @@ -244,17 +244,16 @@ SDL_EVDEV_kbd_init(void) kbd->accents = SDL_calloc(sizeof(accentmap_t), 1); kbd->key_map = SDL_calloc(sizeof(keymap_t), 1); - kbd->kbInfo = SDL_calloc(sizeof(keyboard_info_t), 1); + kbd->kbInfo = SDL_calloc(sizeof(keyboard_info_t), 1); ioctl(kbd->console_fd, KDGKBINFO, kbd->kbInfo); ioctl(kbd->console_fd, CONS_MOUSECTL, &mData); - + if (ioctl(kbd->console_fd, KDGKBSTATE, &flag_state) == 0) { kbd->ledflagstate = flag_state; } - - if (ioctl(kbd->console_fd, GIO_DEADKEYMAP, kbd->accents) < 0) - { + + if (ioctl(kbd->console_fd, GIO_DEADKEYMAP, kbd->accents) < 0) { SDL_free(kbd->accents); kbd->accents = &accentmap_default_us_acc; } @@ -262,8 +261,7 @@ SDL_EVDEV_kbd_init(void) if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) { /* Set the keyboard in XLATE mode and load the keymaps */ ioctl(kbd->console_fd, KDSKBMODE, (unsigned long)(K_XLATE)); - if(!SDL_EVDEV_kbd_load_keymaps(kbd)) - { + if (!SDL_EVDEV_kbd_load_keymaps(kbd)) { SDL_free(kbd->key_map); kbd->key_map = &keymap_default_us_acc; } @@ -275,8 +273,7 @@ SDL_EVDEV_kbd_init(void) ioctl(kbd->console_fd, CONS_RELKBD, 1ul); SDL_asprintf(&devicePath, "/dev/kbd%d", kbd->kbInfo->kb_index); kbd->keyboard_fd = open(devicePath, O_WRONLY | O_CLOEXEC); - if (kbd->keyboard_fd == -1) - { + if (kbd->keyboard_fd == -1) { // Give keyboard back. ioctl(kbd->console_fd, CONS_SETKBD, (unsigned long)(kbd->kbInfo->kb_index)); kbd->keyboard_fd = kbd->console_fd; @@ -289,15 +286,14 @@ SDL_EVDEV_kbd_init(void) kbd_register_emerg_cleanup(kbd); } SDL_free(devicePath); - } - else kbd->keyboard_fd = kbd->console_fd; + } else + kbd->keyboard_fd = kbd->console_fd; } return kbd; } -void -SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) +void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) { struct mouse_info mData; @@ -315,8 +311,7 @@ SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) ioctl(kbd->keyboard_fd, KDSKBMODE, kbd->old_kbd_mode); close(kbd->keyboard_fd); - if (kbd->console_fd != kbd->keyboard_fd && kbd->console_fd >= 0) - { + if (kbd->console_fd != kbd->keyboard_fd && kbd->console_fd >= 0) { // Give back keyboard. ioctl(kbd->console_fd, CONS_SETKBD, (unsigned long)(kbd->kbInfo->kb_index)); } @@ -326,13 +321,25 @@ SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) SDL_free(kbd); } +void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted) +{ +} + +void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data) +{ +} + +void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state) +{ +} + /* * Helper Functions. */ static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c) { /* c is already part of a UTF-8 sequence and safe to add as a character */ - if (kbd->text_len < (sizeof(kbd->text)-1)) { + if (kbd->text_len < (sizeof(kbd->text) - 1)) { kbd->text[kbd->text_len++] = (char)c; } } @@ -347,10 +354,12 @@ static void put_utf8(SDL_EVDEV_keyboard_state *kbd, uint c) put_queue(kbd, 0xc0 | (c >> 6)); put_queue(kbd, 0x80 | (c & 0x3f)); } else if (c < 0x10000) { - if (c >= 0xD800 && c < 0xE000) + if (c >= 0xD800 && c < 0xE000) { return; - if (c == 0xFFFF) + } + if (c == 0xFFFF) { return; + } /* 1110**** 10****** 10****** */ put_queue(kbd, 0xe0 | (c >> 12)); put_queue(kbd, 0x80 | ((c >> 6) & 0x3f)); @@ -379,13 +388,14 @@ static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch) kbd->diacr = 0; for (i = 0; i < kbd->accents->n_accs; i++) { - if (kbd->accents->acc[i].accchar == d) - { + if (kbd->accents->acc[i].accchar == d) { for (j = 0; j < NUM_ACCENTCHARS; ++j) { - if (kbd->accents->acc[i].map[j][0] == 0) /* end of table */ - break; - if (kbd->accents->acc[i].map[j][0] == ch) - return kbd->accents->acc[i].map[j][1]; + if (kbd->accents->acc[i].map[j][0] == 0) { /* end of table */ + break; + } + if (kbd->accents->acc[i].map[j][0] == ch) { + return kbd->accents->acc[i].map[j][1]; + } } } } @@ -416,11 +426,13 @@ static void chg_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag) static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned int value, char up_flag) { - if (up_flag) - return; /* no action, if this is a key release */ + if (up_flag) { + return; /* no action, if this is a key release */ + } - if (kbd->diacr) + if (kbd->diacr) { value = handle_diacr(kbd, value); + } if (kbd->dead_key_next) { kbd->dead_key_next = SDL_FALSE; @@ -450,8 +462,9 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ * handle the case that two shift or control * keys are depressed simultaneously */ - if (kbd->shift_down[value]) + if (kbd->shift_down[value]) { kbd->shift_down[value]--; + } } else kbd->shift_down[value]++; @@ -467,20 +480,19 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ } } -void -SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int down) +void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int down) { keymap_t key_map; struct keyent_t keysym; unsigned int final_key_state; unsigned int map_from_key_sym; - key_map = *kbd->key_map; - if (!kbd) { return; } + key_map = *kbd->key_map; + kbd->rep = (down == 2); if (keycode < NUM_KEYS) { @@ -488,10 +500,10 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d /* These constitute unprintable language-related keys, so ignore them. */ return; } - if (keycode > 95) + if (keycode > 95) { keycode -= 7; - if (vc_kbd_led(kbd, ALKED) || (kbd->shift_state & 0x8)) - { + } + if (vc_kbd_led(kbd, ALKED) || (kbd->shift_state & 0x8)) { keycode += ALTGR_OFFSET; } keysym = key_map.key[keycode]; @@ -500,18 +512,21 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d } final_key_state = kbd->shift_state & 0x7; - if ((keysym.flgs & FLAG_LOCK_C) && vc_kbd_led(kbd, LED_CAP)) + if ((keysym.flgs & FLAG_LOCK_C) && vc_kbd_led(kbd, LED_CAP)) { final_key_state ^= 0x1; - if ((keysym.flgs & FLAG_LOCK_N) && vc_kbd_led(kbd, LED_NUM)) + } + if ((keysym.flgs & FLAG_LOCK_N) && vc_kbd_led(kbd, LED_NUM)) { final_key_state ^= 0x1; + } map_from_key_sym = keysym.map[final_key_state]; if ((keysym.spcl & (0x80 >> final_key_state)) || (map_from_key_sym & SPCLKEY)) { /* Special function.*/ if (map_from_key_sym == 0) return; /* Nothing to do. */ - if (map_from_key_sym & SPCLKEY) + if (map_from_key_sym & SPCLKEY) { map_from_key_sym &= ~SPCLKEY; + } if (map_from_key_sym >= F_ACC && map_from_key_sym <= L_ACC) { /* Accent function.*/ unsigned int accent_index = map_from_key_sym - F_ACC; @@ -519,42 +534,56 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d k_deadunicode(kbd, kbd->accents->acc[accent_index].accchar, !down); } } else { - switch(map_from_key_sym) { + switch (map_from_key_sym) { case ASH: /* alt/meta shift */ k_shift(kbd, 3, down == 0); break; case LSHA: /* left shift + alt lock */ case RSHA: /* right shift + alt lock */ - if (down == 0) chg_vc_kbd_led(kbd, ALKED); + if (down == 0) { + chg_vc_kbd_led(kbd, ALKED); + } case LSH: /* left shift */ case RSH: /* right shift */ k_shift(kbd, 0, down == 0); break; case LCTRA: /* left ctrl + alt lock */ case RCTRA: /* right ctrl + alt lock */ - if (down == 0) chg_vc_kbd_led(kbd, ALKED); + if (down == 0) { + chg_vc_kbd_led(kbd, ALKED); + } case LCTR: /* left ctrl */ case RCTR: /* right ctrl */ k_shift(kbd, 1, down == 0); break; case LALTA: /* left alt + alt lock */ case RALTA: /* right alt + alt lock */ - if (down == 0) chg_vc_kbd_led(kbd, ALKED); + if (down == 0) { + chg_vc_kbd_led(kbd, ALKED); + } case LALT: /* left alt */ case RALT: /* right alt */ k_shift(kbd, 2, down == 0); break; case ALK: /* alt lock */ - if (down == 1) chg_vc_kbd_led(kbd, ALKED); + if (down == 1) { + chg_vc_kbd_led(kbd, ALKED); + } break; case CLK: /* caps lock*/ - if (down == 1) chg_vc_kbd_led(kbd, CLKED); + if (down == 1) { + chg_vc_kbd_led(kbd, CLKED); + } break; case NLK: /* num lock */ - if (down == 1) chg_vc_kbd_led(kbd, NLKED); + if (down == 1) { + chg_vc_kbd_led(kbd, NLKED); + } break; case SLK: /* scroll lock */ - if (down == 1) chg_vc_kbd_led(kbd, SLKED); + if (down == 1) { + chg_vc_kbd_led(kbd, SLKED); + } break; default: return; diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp index 5d94c9bda07ec..238375ebc8094 100644 --- a/src/core/gdk/SDL_gdk.cpp +++ b/src/core/gdk/SDL_gdk.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,27 +20,35 @@ */ #include "../../SDL_internal.h" +extern "C" { #include "SDL_system.h" #include "../windows/SDL_windows.h" #include "SDL_messagebox.h" #include "SDL_main.h" +#include "SDL_events.h" +#include "../../events/SDL_events_c.h" +} #include #include #include /* CommandLineToArgvW() */ +#include static XTaskQueueHandle GDK_GlobalTaskQueue; +PAPPSTATE_REGISTRATION hPLM = {}; +PAPPCONSTRAIN_REGISTRATION hCPLM = {}; +HANDLE plmSuspendComplete = nullptr; + extern "C" DECLSPEC int -SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue) +SDL_GDKGetTaskQueue(XTaskQueueHandle *outTaskQueue) { /* If this is the first call, first create the global task queue. */ if (!GDK_GlobalTaskQueue) { HRESULT hr; hr = XTaskQueueCreate(XTaskQueueDispatchMode::ThreadPool, - XTaskQueueDispatchMode::Manual, - &GDK_GlobalTaskQueue - ); + XTaskQueueDispatchMode::Manual, + &GDK_GlobalTaskQueue); if (FAILED(hr)) { return SDL_SetError("[GDK] Could not create global task queue"); } @@ -80,7 +88,7 @@ OutOfMemory(void) /* Gets the arguments with GetCommandLine, converts them to argc and argv and calls SDL_main */ -extern "C" DECLSPEC int +extern "C" DECLSPEC int SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved) { LPWSTR *argvw; @@ -100,18 +108,18 @@ SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved) */ /* Parse it into argv and argc */ - argv = (char **) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); - if (!argv) { + argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); + if (argv == NULL) { return OutOfMemory(); } for (i = 0; i < argc; ++i) { DWORD len; char *arg = WIN_StringToUTF8W(argvw[i]); - if (!arg) { + if (arg == NULL) { return OutOfMemory(); } - len = (DWORD) SDL_strlen(arg); - argv[i] = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 1); + len = (DWORD)SDL_strlen(arg); + argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 1); if (!argv[i]) { return OutOfMemory(); } @@ -144,9 +152,59 @@ SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved) SDL_SetMainReady(); + /* Register suspend/resume handling */ + plmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE); + if (!plmSuspendComplete) { + SDL_SetError("[GDK] Unable to create plmSuspendComplete event"); + return -1; + } + auto rascn = [](BOOLEAN quiesced, PVOID context) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler"); + if (quiesced) { + ResetEvent(plmSuspendComplete); + SDL_SendAppEvent(SDL_APP_DIDENTERBACKGROUND); + + // To defer suspension, we must wait to exit this callback. + // IMPORTANT: The app must call SDL_GDKSuspendComplete() to release this lock. + (void)WaitForSingleObject(plmSuspendComplete, INFINITE); + + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler: plmSuspendComplete event signaled."); + } else { + SDL_SendAppEvent(SDL_APP_WILLENTERFOREGROUND); + } + }; + if (RegisterAppStateChangeNotification(rascn, NULL, &hPLM)) { + SDL_SetError("[GDK] Unable to call RegisterAppStateChangeNotification"); + return -1; + } + + /* Register constrain/unconstrain handling */ + auto raccn = [](BOOLEAN constrained, PVOID context) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler"); + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + if (_this) { + if (constrained) { + SDL_SetKeyboardFocus(NULL); + } else { + SDL_SetKeyboardFocus(_this->windows); + } + } + }; + if (RegisterAppConstrainedChangeNotification(raccn, NULL, &hCPLM)) { + SDL_SetError("[GDK] Unable to call RegisterAppConstrainedChangeNotification"); + return -1; + } + /* Run the application main() code */ result = mainFunction(argc, argv); + /* Unregister suspend/resume handling */ + UnregisterAppStateChangeNotification(hPLM); + CloseHandle(plmSuspendComplete); + + /* Unregister constrain/unconstrain handling */ + UnregisterAppConstrainedChangeNotification(hCPLM); + /* !!! FIXME: This follows the docs exactly, but for some reason still leaks handles on exit? */ /* Terminate the task queue and dispatch any pending tasks */ XTaskQueueTerminate(taskQueue, false, nullptr, nullptr); @@ -173,3 +231,32 @@ SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved) return result; } + +extern "C" DECLSPEC void +SDL_GDKSuspendComplete() +{ + if (plmSuspendComplete) { + SetEvent(plmSuspendComplete); + } +} + +extern "C" DECLSPEC int +SDL_GDKGetDefaultUser(XUserHandle *outUserHandle) +{ + XAsyncBlock block = { 0 }; + HRESULT result; + + if (FAILED(result = XUserAddAsync(XUserAddOptions::AddDefaultUserAllowingUI, &block))) { + return WIN_SetErrorFromHRESULT("XUserAddAsync", result); + } + + do { + result = XUserAddResult(&block, outUserHandle); + } while (result == E_PENDING); + if (FAILED(result)) { + return WIN_SetErrorFromHRESULT("XUserAddResult", result); + } + + return 0; +} + diff --git a/src/core/gdk/SDL_gdk.h b/src/core/gdk/SDL_gdk.h index 628d3e6215fc2..1757c2ff72ae0 100644 --- a/src/core/gdk/SDL_gdk.h +++ b/src/core/gdk/SDL_gdk.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/linux/SDL_dbus.c b/src/core/linux/SDL_dbus.c index 9153e5052e7c9..969c04d8862df 100644 --- a/src/core/linux/SDL_dbus.c +++ b/src/core/linux/SDL_dbus.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "SDL_sandbox.h" #include "../../stdlib/SDL_vacopy.h" -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS /* we never link directly to libdbus. */ #include "SDL_loadso.h" static const char *dbus_library = "libdbus-1.so.3"; @@ -34,14 +34,20 @@ static char *inhibit_handle = NULL; static unsigned int screensaver_cookie = 0; static SDL_DBusContext dbus; -static int -LoadDBUSSyms(void) +static int LoadDBUSSyms(void) { - #define SDL_DBUS_SYM2(x, y) \ - if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) return -1 - - #define SDL_DBUS_SYM(x) \ - SDL_DBUS_SYM2(x, dbus_##x) +#define SDL_DBUS_SYM2_OPTIONAL(x, y) \ + dbus.x = SDL_LoadFunction(dbus_handle, #y) + +#define SDL_DBUS_SYM2(x, y) \ + if (!(dbus.x = SDL_LoadFunction(dbus_handle, #y))) \ + return -1 + +#define SDL_DBUS_SYM(x) \ + SDL_DBUS_SYM2(x, dbus_##x) + +#define SDL_DBUS_SYM_OPTIONAL(x) \ + SDL_DBUS_SYM2_OPTIONAL(x, dbus_##x) SDL_DBUS_SYM(bus_get_private); SDL_DBUS_SYM(bus_register); @@ -54,6 +60,7 @@ LoadDBUSSyms(void) SDL_DBUS_SYM(connection_send); SDL_DBUS_SYM(connection_send_with_reply_and_block); SDL_DBUS_SYM(connection_close); + SDL_DBUS_SYM(connection_ref); SDL_DBUS_SYM(connection_unref); SDL_DBUS_SYM(connection_flush); SDL_DBUS_SYM(connection_read_write); @@ -79,32 +86,31 @@ LoadDBUSSyms(void) SDL_DBUS_SYM(error_is_set); SDL_DBUS_SYM(error_free); SDL_DBUS_SYM(get_local_machine_id); + SDL_DBUS_SYM_OPTIONAL(try_get_local_machine_id); SDL_DBUS_SYM(free); SDL_DBUS_SYM(free_string_array); SDL_DBUS_SYM(shutdown); - #undef SDL_DBUS_SYM - #undef SDL_DBUS_SYM2 +#undef SDL_DBUS_SYM +#undef SDL_DBUS_SYM2 return 0; } -static void -UnloadDBUSLibrary(void) +static void UnloadDBUSLibrary(void) { - if (dbus_handle != NULL) { + if (dbus_handle) { SDL_UnloadObject(dbus_handle); dbus_handle = NULL; } } -static int -LoadDBUSLibrary(void) +static int LoadDBUSLibrary(void) { int retval = 0; - if (dbus_handle == NULL) { + if (!dbus_handle) { dbus_handle = SDL_LoadObject(dbus_library); - if (dbus_handle == NULL) { + if (!dbus_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } else { @@ -118,24 +124,22 @@ LoadDBUSLibrary(void) return retval; } - static SDL_SpinLock spinlock_dbus_init = 0; /* you must hold spinlock_dbus_init before calling this! */ -static void -SDL_DBus_Init_Spinlocked(void) +static void SDL_DBus_Init_Spinlocked(void) { static SDL_bool is_dbus_available = SDL_TRUE; if (!is_dbus_available) { - return; /* don't keep trying if this fails. */ + return; /* don't keep trying if this fails. */ } if (!dbus.session_conn) { DBusError err; if (LoadDBUSLibrary() == -1) { - is_dbus_available = SDL_FALSE; /* can't load at all? Don't keep trying. */ - return; /* oh well */ + is_dbus_available = SDL_FALSE; /* can't load at all? Don't keep trying. */ + return; } if (!dbus.threads_init_default()) { @@ -151,7 +155,7 @@ SDL_DBus_Init_Spinlocked(void) dbus.error_free(&err); SDL_DBus_Quit(); is_dbus_available = SDL_FALSE; - return; /* oh well */ + return; /* oh well */ } dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0); @@ -165,16 +169,14 @@ SDL_DBus_Init_Spinlocked(void) } } -void -SDL_DBus_Init(void) +void SDL_DBus_Init(void) { - SDL_AtomicLock(&spinlock_dbus_init); /* make sure two threads can't init at same time, since this can happen before SDL_Init. */ + SDL_AtomicLock(&spinlock_dbus_init); /* make sure two threads can't init at same time, since this can happen before SDL_Init. */ SDL_DBus_Init_Spinlocked(); SDL_AtomicUnlock(&spinlock_dbus_init); } -void -SDL_DBus_Quit(void) +void SDL_DBus_Quit(void) { if (dbus.system_conn) { dbus.connection_close(dbus.system_conn); @@ -184,32 +186,29 @@ SDL_DBus_Quit(void) dbus.connection_close(dbus.session_conn); dbus.connection_unref(dbus.session_conn); } -/* Don't do this - bug 3950 - dbus_shutdown() is a debug feature which closes all global resources in the dbus library. Calling this should be done by the app, not a library, because if there are multiple users of dbus in the process then SDL could shut it down even though another part is using it. -*/ -#if 0 - if (dbus.shutdown) { - dbus.shutdown(); + + if (SDL_GetHintBoolean(SDL_HINT_SHUTDOWN_DBUS_ON_QUIT, SDL_FALSE)) { + if (dbus.shutdown) { + dbus.shutdown(); + } } -#endif + SDL_zero(dbus); UnloadDBUSLibrary(); SDL_free(inhibit_handle); inhibit_handle = NULL; } -SDL_DBusContext * -SDL_DBus_GetContext(void) +SDL_DBusContext *SDL_DBus_GetContext(void) { if (!dbus_handle || !dbus.session_conn) { SDL_DBus_Init(); } - + return (dbus_handle && dbus.session_conn) ? &dbus : NULL; } -static SDL_bool -SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, va_list ap) +static SDL_bool SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, va_list ap) { SDL_bool retval = SDL_FALSE; @@ -218,7 +217,7 @@ SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *node, const char * if (msg) { int firstarg; va_list ap_reply; - va_copy(ap_reply, ap); /* copy the arg list so we don't compete with D-Bus for it */ + va_copy(ap_reply, ap); /* copy the arg list so we don't compete with D-Bus for it */ firstarg = va_arg(ap, int); if ((firstarg == DBUS_TYPE_INVALID) || dbus.message_append_args_valist(msg, firstarg, ap)) { DBusMessage *reply = dbus.connection_send_with_reply_and_block(conn, msg, 300, NULL); @@ -226,9 +225,15 @@ SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *node, const char * /* skip any input args, get to output args. */ while ((firstarg = va_arg(ap_reply, int)) != DBUS_TYPE_INVALID) { /* we assume D-Bus already validated all this. */ - { void *dumpptr = va_arg(ap_reply, void*); (void) dumpptr; } + { + void *dumpptr = va_arg(ap_reply, void *); + (void)dumpptr; + } if (firstarg == DBUS_TYPE_ARRAY) { - { const int dumpint = va_arg(ap_reply, int); (void) dumpint; } + { + const int dumpint = va_arg(ap_reply, int); + (void)dumpint; + } } } firstarg = va_arg(ap_reply, int); @@ -246,8 +251,7 @@ SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *node, const char * return retval; } -SDL_bool -SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -257,8 +261,7 @@ SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const ch return retval; } -SDL_bool -SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -268,8 +271,7 @@ SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, c return retval; } -static SDL_bool -SDL_DBus_CallVoidMethodInternal(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, va_list ap) +static SDL_bool SDL_DBus_CallVoidMethodInternal(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, va_list ap) { SDL_bool retval = SDL_FALSE; @@ -291,8 +293,7 @@ SDL_DBus_CallVoidMethodInternal(DBusConnection *conn, const char *node, const ch return retval; } -static SDL_bool -SDL_DBus_CallWithBasicReply(DBusConnection *conn, DBusMessage *msg, const int expectedtype, void *result) +static SDL_bool SDL_DBus_CallWithBasicReply(DBusConnection *conn, DBusMessage *msg, const int expectedtype, void *result) { SDL_bool retval = SDL_FALSE; @@ -317,8 +318,7 @@ SDL_DBus_CallWithBasicReply(DBusConnection *conn, DBusMessage *msg, const int ex return retval; } -SDL_bool -SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -328,8 +328,7 @@ SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, cons return retval; } -SDL_bool -SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...) +SDL_bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...) { SDL_bool retval; va_list ap; @@ -339,8 +338,7 @@ SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interfac return retval; } -SDL_bool -SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) +SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) { SDL_bool retval = SDL_FALSE; @@ -357,46 +355,45 @@ SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const return retval; } -SDL_bool -SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) +SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result) { return SDL_DBus_QueryPropertyOnConnection(dbus.session_conn, node, path, interface, property, expectedtype, result); } - -void -SDL_DBus_ScreensaverTickle(void) +void SDL_DBus_ScreensaverTickle(void) { - if (screensaver_cookie == 0 && inhibit_handle == NULL) { /* no need to tickle if we're inhibiting. */ + if (screensaver_cookie == 0 && !inhibit_handle) { /* no need to tickle if we're inhibiting. */ /* org.gnome.ScreenSaver is the legacy interface, but it'll either do nothing or just be a second harmless tickle on newer systems, so we leave it for now. */ SDL_DBus_CallVoidMethod("org.gnome.ScreenSaver", "/org/gnome/ScreenSaver", "org.gnome.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID); SDL_DBus_CallVoidMethod("org.freedesktop.ScreenSaver", "/org/freedesktop/ScreenSaver", "org.freedesktop.ScreenSaver", "SimulateUserActivity", DBUS_TYPE_INVALID); } } -static SDL_bool -SDL_DBus_AppendDictWithKeyValue(DBusMessageIter *iterInit, const char *key, const char *value) +static SDL_bool SDL_DBus_AppendDictWithKeyValue(DBusMessageIter *iterInit, const char *key, const char *value) { DBusMessageIter iterDict, iterEntry, iterValue; - if (!dbus.message_iter_open_container(iterInit, DBUS_TYPE_ARRAY, "{sv}", &iterDict)) + if (!dbus.message_iter_open_container(iterInit, DBUS_TYPE_ARRAY, "{sv}", &iterDict)) { goto failed; + } - if (!dbus.message_iter_open_container(&iterDict, DBUS_TYPE_DICT_ENTRY, NULL, &iterEntry)) + if (!dbus.message_iter_open_container(&iterDict, DBUS_TYPE_DICT_ENTRY, NULL, &iterEntry)) { goto failed; + } - if (!dbus.message_iter_append_basic(&iterEntry, DBUS_TYPE_STRING, &key)) + if (!dbus.message_iter_append_basic(&iterEntry, DBUS_TYPE_STRING, &key)) { goto failed; + } - if (!dbus.message_iter_open_container(&iterEntry, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &iterValue)) + if (!dbus.message_iter_open_container(&iterEntry, DBUS_TYPE_VARIANT, DBUS_TYPE_STRING_AS_STRING, &iterValue)) { goto failed; + } - if (!dbus.message_iter_append_basic(&iterValue, DBUS_TYPE_STRING, &value)) + if (!dbus.message_iter_append_basic(&iterValue, DBUS_TYPE_STRING, &value)) { goto failed; + } - if (!dbus.message_iter_close_container(&iterEntry, &iterValue) - || !dbus.message_iter_close_container(&iterDict, &iterEntry) - || !dbus.message_iter_close_container(iterInit, &iterDict)) { + if (!dbus.message_iter_close_container(&iterEntry, &iterValue) || !dbus.message_iter_close_container(&iterDict, &iterEntry) || !dbus.message_iter_close_container(iterInit, &iterDict)) { goto failed; } @@ -409,13 +406,11 @@ SDL_DBus_AppendDictWithKeyValue(DBusMessageIter *iterInit, const char *key, cons return SDL_FALSE; } -SDL_bool -SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) +SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) { const char *default_inhibit_reason = "Playing a game"; - if ( (inhibit && (screensaver_cookie != 0 || inhibit_handle != NULL)) - || (!inhibit && (screensaver_cookie == 0 && inhibit_handle == NULL)) ) { + if ((inhibit && (screensaver_cookie != 0 || inhibit_handle)) || (!inhibit && (screensaver_cookie == 0 && !inhibit_handle))) { return SDL_TRUE; } @@ -429,7 +424,7 @@ SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) const char *bus_name = "org.freedesktop.portal.Desktop"; const char *path = "/org/freedesktop/portal/desktop"; const char *interface = "org.freedesktop.portal.Inhibit"; - const char *window = ""; /* As a future improvement we could gather the X11 XID or Wayland surface identifier */ + const char *window = ""; /* As a future improvement we could gather the X11 XID or Wayland surface identifier */ static const unsigned int INHIBIT_IDLE = 8; /* Taken from the portal API reference */ DBusMessageIter iterInit; @@ -482,15 +477,15 @@ SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) const char *app = SDL_GetHint(SDL_HINT_APP_NAME); const char *reason = SDL_GetHint(SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME); if (!app || !app[0]) { - app = "My SDL application"; + app = "My SDL application"; } if (!reason || !reason[0]) { reason = default_inhibit_reason; } if (!SDL_DBus_CallMethod(bus_name, path, interface, "Inhibit", - DBUS_TYPE_STRING, &app, DBUS_TYPE_STRING, &reason, DBUS_TYPE_INVALID, - DBUS_TYPE_UINT32, &screensaver_cookie, DBUS_TYPE_INVALID)) { + DBUS_TYPE_STRING, &app, DBUS_TYPE_STRING, &reason, DBUS_TYPE_INVALID, + DBUS_TYPE_UINT32, &screensaver_cookie, DBUS_TYPE_INVALID)) { return SDL_FALSE; } return (screensaver_cookie != 0) ? SDL_TRUE : SDL_FALSE; @@ -504,6 +499,105 @@ SDL_DBus_ScreensaverInhibit(SDL_bool inhibit) return SDL_TRUE; } + +/* + * Get the machine ID if possible. Result must be freed with dbus->free(). + */ +char *SDL_DBus_GetLocalMachineId(void) +{ + DBusError err; + char *result; + + dbus.error_init(&err); + + if (dbus.try_get_local_machine_id) { + /* Available since dbus 1.12.0, has proper error-handling */ + result = dbus.try_get_local_machine_id(&err); + } else { + /* Available since time immemorial, but has no error-handling: + * if the machine ID can't be read, many versions of libdbus will + * treat that as a fatal mis-installation and abort() */ + result = dbus.get_local_machine_id(); + } + + if (result) { + return result; + } + + if (dbus.error_is_set(&err)) { + SDL_SetError("%s: %s", err.name, err.message); + dbus.error_free(&err); + } else { + SDL_SetError("Error getting D-Bus machine ID"); + } + + return NULL; +} + +/* + * Convert file drops with mime type "application/vnd.portal.filetransfer" to file paths + * Result must be freed with dbus->free_string_array(). + * https://flatpak.github.io/xdg-desktop-portal/#gdbus-method-org-freedesktop-portal-FileTransfer.RetrieveFiles + */ +char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *path_count) +{ + DBusError err; + DBusMessageIter iter, iterDict; + char **paths = NULL; + DBusMessage *reply = NULL; + DBusMessage *msg = dbus.message_new_method_call("org.freedesktop.portal.Documents", /* Node */ + "/org/freedesktop/portal/documents", /* Path */ + "org.freedesktop.portal.FileTransfer", /* Interface */ + "RetrieveFiles"); /* Method */ + + /* Make sure we have a connection to the dbus session bus */ + if (!SDL_DBus_GetContext() || !dbus.session_conn) { + /* We either cannot connect to the session bus or were unable to + * load the D-Bus library at all. */ + return NULL; + } + + dbus.error_init(&err); + + /* First argument is a "application/vnd.portal.filetransfer" key from a DnD or clipboard event */ + if (!dbus.message_append_args(msg, DBUS_TYPE_STRING, &key, DBUS_TYPE_INVALID)) { + SDL_OutOfMemory(); + dbus.message_unref(msg); + goto failed; + } + + /* Second argument is a variant dictionary for options. + * The spec doesn't define any entries yet so it's empty. */ + dbus.message_iter_init_append(msg, &iter); + if (!dbus.message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "{sv}", &iterDict) || + !dbus.message_iter_close_container(&iter, &iterDict)) { + SDL_OutOfMemory(); + dbus.message_unref(msg); + goto failed; + } + + reply = dbus.connection_send_with_reply_and_block(dbus.session_conn, msg, DBUS_TIMEOUT_USE_DEFAULT, &err); + dbus.message_unref(msg); + + if (reply) { + dbus.message_get_args(reply, &err, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &paths, path_count, DBUS_TYPE_INVALID); + dbus.message_unref(reply); + } + + if (paths) { + return paths; + } + +failed: + if (dbus.error_is_set(&err)) { + SDL_SetError("%s: %s", err.name, err.message); + dbus.error_free(&err); + } else { + SDL_SetError("Error retrieving paths for documents portal \"%s\"", key); + } + + return NULL; +} #endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_dbus.h b/src/core/linux/SDL_dbus.h index 04ab2a80da24b..5fc118f7a8d2a 100644 --- a/src/core/linux/SDL_dbus.h +++ b/src/core/linux/SDL_dbus.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,28 +29,33 @@ #include "SDL_stdinc.h" #include +#ifndef DBUS_TIMEOUT_USE_DEFAULT +#define DBUS_TIMEOUT_USE_DEFAULT -1 +#endif -typedef struct SDL_DBusContext { +typedef struct SDL_DBusContext +{ DBusConnection *session_conn; DBusConnection *system_conn; DBusConnection *(*bus_get_private)(DBusBusType, DBusError *); dbus_bool_t (*bus_register)(DBusConnection *, DBusError *); void (*bus_add_match)(DBusConnection *, const char *, DBusError *); - DBusConnection * (*connection_open_private)(const char *, DBusError *); + DBusConnection *(*connection_open_private)(const char *, DBusError *); void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t); dbus_bool_t (*connection_get_is_connected)(DBusConnection *); dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction, void *, DBusFreeFunction); dbus_bool_t (*connection_try_register_object_path)(DBusConnection *, const char *, - const DBusObjectPathVTable *, void *, DBusError *); + const DBusObjectPathVTable *, void *, DBusError *); dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *); DBusMessage *(*connection_send_with_reply_and_block)(DBusConnection *, DBusMessage *, int, DBusError *); void (*connection_close)(DBusConnection *); + void (*connection_ref)(DBusConnection *); void (*connection_unref)(DBusConnection *); void (*connection_flush)(DBusConnection *); dbus_bool_t (*connection_read_write)(DBusConnection *, int); DBusDispatchStatus (*connection_dispatch)(DBusConnection *); - dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); + dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); DBusMessage *(*message_new_method_call)(const char *, const char *, const char *, const char *); dbus_bool_t (*message_append_args)(DBusMessage *, int, ...); dbus_bool_t (*message_append_args_valist)(DBusMessage *, int, va_list); @@ -64,13 +69,14 @@ typedef struct SDL_DBusContext { dbus_bool_t (*message_iter_next)(DBusMessageIter *); void (*message_iter_get_basic)(DBusMessageIter *, void *); int (*message_iter_get_arg_type)(DBusMessageIter *); - void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); + void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); void (*message_unref)(DBusMessage *); dbus_bool_t (*threads_init_default)(void); void (*error_init)(DBusError *); dbus_bool_t (*error_is_set)(const DBusError *); void (*error_free)(DBusError *); char *(*get_local_machine_id)(void); + char *(*try_get_local_machine_id)(DBusError *); void (*free)(void *); void (*free_string_array)(char **); void (*shutdown)(void); @@ -79,7 +85,7 @@ typedef struct SDL_DBusContext { extern void SDL_DBus_Init(void); extern void SDL_DBus_Quit(void); -extern SDL_DBusContext * SDL_DBus_GetContext(void); +extern SDL_DBusContext *SDL_DBus_GetContext(void); /* These use the built-in Session connection. */ extern SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...); @@ -94,6 +100,10 @@ extern SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const c extern void SDL_DBus_ScreensaverTickle(void); extern SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit); +extern char *SDL_DBus_GetLocalMachineId(void); + +extern char **SDL_DBus_DocumentsPortalRetrieveFiles(const char *key, int *files_count); + #endif /* HAVE_DBUS_DBUS_H */ #endif /* SDL_dbus_h_ */ diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index f5ab06253e837..de1b758dbef1e 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifdef SDL_INPUT_LINUXEV /* This is based on the linux joystick driver */ -/* References: https://www.kernel.org/doc/Documentation/input/input.txt +/* References: https://www.kernel.org/doc/Documentation/input/input.txt * https://www.kernel.org/doc/Documentation/input/event-codes.txt * /usr/include/linux/input.h * The evtest application is also useful to debug the protocol @@ -51,21 +51,22 @@ #define SYN_DROPPED 3 #endif #ifndef ABS_MT_SLOT -#define ABS_MT_SLOT 0x2f -#define ABS_MT_POSITION_X 0x35 -#define ABS_MT_POSITION_Y 0x36 -#define ABS_MT_TRACKING_ID 0x39 -#define ABS_MT_PRESSURE 0x3a +#define ABS_MT_SLOT 0x2f +#define ABS_MT_POSITION_X 0x35 +#define ABS_MT_POSITION_Y 0x36 +#define ABS_MT_TRACKING_ID 0x39 +#define ABS_MT_PRESSURE 0x3a #endif #ifndef REL_WHEEL_HI_RES -#define REL_WHEEL_HI_RES 0x0b -#define REL_HWHEEL_HI_RES 0x0c +#define REL_WHEEL_HI_RES 0x0b +#define REL_HWHEEL_HI_RES 0x0c #endif typedef struct SDL_evdevlist_item { char *path; int fd; + int udev_class; /* TODO: use this for every device, not just touchscreen */ SDL_bool out_of_sync; @@ -74,8 +75,9 @@ typedef struct SDL_evdevlist_item keyboard, touchpad, etc.). Also there's probably some things in here we can pull out to the SDL_evdevlist_item i.e. name */ SDL_bool is_touchscreen; - struct { - char* name; + struct + { + char *name; int min_x, max_x, range_x; int min_y, max_y, range_y; @@ -83,8 +85,10 @@ typedef struct SDL_evdevlist_item int max_slots; int current_slot; - struct { - enum { + struct + { + enum + { EVDEV_TOUCH_SLOTDELTA_NONE = 0, EVDEV_TOUCH_SLOTDELTA_DOWN, EVDEV_TOUCH_SLOTDELTA_UP, @@ -92,9 +96,9 @@ typedef struct SDL_evdevlist_item } delta; int tracking_id; int x, y, pressure; - } * slots; + } *slots; - } * touchscreen_data; + } *touchscreen_data; /* Mouse state */ SDL_bool high_res_wheel; @@ -102,6 +106,8 @@ typedef struct SDL_evdevlist_item SDL_bool relative_mouse; int mouse_x, mouse_y; int mouse_wheel, mouse_hwheel; + int min_x, max_x, range_x; + int min_y, max_y, range_y; struct SDL_evdevlist_item *next; } SDL_evdevlist_item; @@ -124,40 +130,45 @@ static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item); static int SDL_EVDEV_device_removed(const char *dev_path); static int SDL_EVDEV_device_added(const char *dev_path, int udev_class); -#if SDL_USE_LIBUDEV -static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, - const char *dev_path); +#ifdef SDL_USE_LIBUDEV +static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_class, const char *dev_path); #endif /* SDL_USE_LIBUDEV */ static Uint8 EVDEV_MouseButtons[] = { - SDL_BUTTON_LEFT, /* BTN_LEFT 0x110 */ - SDL_BUTTON_RIGHT, /* BTN_RIGHT 0x111 */ - SDL_BUTTON_MIDDLE, /* BTN_MIDDLE 0x112 */ - SDL_BUTTON_X1, /* BTN_SIDE 0x113 */ - SDL_BUTTON_X2, /* BTN_EXTRA 0x114 */ - SDL_BUTTON_X2 + 1, /* BTN_FORWARD 0x115 */ - SDL_BUTTON_X2 + 2, /* BTN_BACK 0x116 */ - SDL_BUTTON_X2 + 3 /* BTN_TASK 0x117 */ + SDL_BUTTON_LEFT, /* BTN_LEFT 0x110 */ + SDL_BUTTON_RIGHT, /* BTN_RIGHT 0x111 */ + SDL_BUTTON_MIDDLE, /* BTN_MIDDLE 0x112 */ + SDL_BUTTON_X1, /* BTN_SIDE 0x113 */ + SDL_BUTTON_X2, /* BTN_EXTRA 0x114 */ + SDL_BUTTON_X2 + 1, /* BTN_FORWARD 0x115 */ + SDL_BUTTON_X2 + 2, /* BTN_BACK 0x116 */ + SDL_BUTTON_X2 + 3 /* BTN_TASK 0x117 */ }; -static int -SDL_EVDEV_SetRelativeMouseMode(SDL_bool enabled) +static int SDL_EVDEV_SetRelativeMouseMode(SDL_bool enabled) { /* Mice already send relative events through this interface */ return 0; } +static void SDL_EVDEV_UpdateKeyboardMute(void) +{ + if (SDL_EVDEV_GetDeviceCount(SDL_UDEV_DEVICE_KEYBOARD) > 0) { + SDL_EVDEV_kbd_set_muted(_this->kbd, SDL_TRUE); + } else { + SDL_EVDEV_kbd_set_muted(_this->kbd, SDL_FALSE); + } +} -int -SDL_EVDEV_Init(void) +int SDL_EVDEV_Init(void) { - if (_this == NULL) { - _this = (SDL_EVDEV_PrivateData*)SDL_calloc(1, sizeof(*_this)); - if (_this == NULL) { + if (!_this) { + _this = (SDL_EVDEV_PrivateData *)SDL_calloc(1, sizeof(*_this)); + if (!_this) { return SDL_OutOfMemory(); } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV if (SDL_UDEV_Init() < 0) { SDL_free(_this); _this = NULL; @@ -182,26 +193,28 @@ SDL_EVDEV_Init(void) where device class is an integer representing the SDL_UDEV_deviceclass and path is the full path to the event device. */ - const char* devices = SDL_getenv("SDL_EVDEV_DEVICES"); + const char *devices = SDL_getenv("SDL_EVDEV_DEVICES"); if (devices) { /* Assume this is the old use of the env var and it is not in ROM. */ - char* rest = (char*) devices; - char* spec; - while ((spec = strtok_r(rest, ",", &rest))) { - char* endofcls = 0; - long cls = strtol(spec, &endofcls, 0); - if (endofcls) + char *rest = (char *)devices; + char *spec; + while ((spec = SDL_strtokr(rest, ",", &rest))) { + char *endofcls = 0; + long cls = SDL_strtol(spec, &endofcls, 0); + if (endofcls) { SDL_EVDEV_device_added(endofcls + 1, cls); + } } - } - else { + } else { /* TODO: Scan the devices manually, like a caveman */ } } #endif /* SDL_USE_LIBUDEV */ _this->kbd = SDL_EVDEV_kbd_init(); + + SDL_EVDEV_UpdateKeyboardMute(); } SDL_GetMouse()->SetRelativeMouseMode = SDL_EVDEV_SetRelativeMouseMode; @@ -211,28 +224,27 @@ SDL_EVDEV_Init(void) return 0; } -void -SDL_EVDEV_Quit(void) +void SDL_EVDEV_Quit(void) { - if (_this == NULL) { + if (!_this) { return; } _this->ref_count -= 1; if (_this->ref_count < 1) { -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback); SDL_UDEV_Quit(); #endif /* SDL_USE_LIBUDEV */ - SDL_EVDEV_kbd_quit(_this->kbd); - /* Remove existing devices */ - while(_this->first != NULL) { + while (_this->first) { SDL_EVDEV_device_removed(_this->first->path); } + SDL_EVDEV_kbd_quit(_this->kbd); + SDL_assert(_this->first == NULL); SDL_assert(_this->last == NULL); SDL_assert(_this->num_devices == 0); @@ -242,24 +254,26 @@ SDL_EVDEV_Quit(void) } } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_class, - const char* dev_path) + const char *dev_path) { - if (dev_path == NULL) { + if (!dev_path) { return; } - switch(udev_event) { + switch (udev_event) { case SDL_UDEV_DEVICEADDED: - if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE | SDL_UDEV_DEVICE_KEYBOARD | SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD))) + if (!(udev_class & (SDL_UDEV_DEVICE_MOUSE | SDL_UDEV_DEVICE_KEYBOARD | SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD))) { return; + } - if ((udev_class & SDL_UDEV_DEVICE_JOYSTICK)) + if (udev_class & SDL_UDEV_DEVICE_JOYSTICK) { return; + } SDL_EVDEV_device_added(dev_path, udev_class); - break; + break; case SDL_UDEV_DEVICEREMOVED: SDL_EVDEV_device_removed(dev_path); break; @@ -269,8 +283,28 @@ static void SDL_EVDEV_udev_callback(SDL_UDEV_deviceevent udev_event, int udev_cl } #endif /* SDL_USE_LIBUDEV */ -void -SDL_EVDEV_Poll(void) +void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data, + void (*acquire_callback)(void*), void *acquire_callback_data) +{ + SDL_EVDEV_kbd_set_vt_switch_callbacks(_this->kbd, + release_callback, release_callback_data, + acquire_callback, acquire_callback_data); +} + +int SDL_EVDEV_GetDeviceCount(int device_class) +{ + SDL_evdevlist_item *item; + int count = 0; + + for (item = _this->first; item; item = item->next) { + if ((item->udev_class & device_class) == device_class) { + ++count; + } + } + return count; +} + +void SDL_EVDEV_Poll(void) { struct input_event events[32]; int i, j, len; @@ -284,14 +318,16 @@ SDL_EVDEV_Poll(void) return; } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV SDL_UDEV_Poll(); #endif + SDL_EVDEV_kbd_update(_this->kbd); + mouse = SDL_GetMouse(); - for (item = _this->first; item != NULL; item = item->next) { - while ((len = read(item->fd, events, (sizeof events))) > 0) { + for (item = _this->first; item; item = item->next) { + while ((len = read(item->fd, events, sizeof(events))) > 0) { len /= sizeof(events[0]); for (i = 0; i < len; ++i) { /* special handling for touchscreen, that should eventually be @@ -319,10 +355,11 @@ SDL_EVDEV_Poll(void) next finger after earlist is released) */ if (item->is_touchscreen && events[i].code == BTN_TOUCH) { if (item->touchscreen_data->max_slots == 1) { - if (events[i].value) + if (events[i].value) { item->touchscreen_data->slots[0].delta = EVDEV_TOUCH_SLOTDELTA_DOWN; - else + } else { item->touchscreen_data->slots[0].delta = EVDEV_TOUCH_SLOTDELTA_UP; + } } break; } @@ -339,15 +376,17 @@ SDL_EVDEV_Poll(void) SDL_EVDEV_kbd_keycode(_this->kbd, events[i].code, events[i].value); break; case EV_ABS: - switch(events[i].code) { + switch (events[i].code) { case ABS_MT_SLOT: - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } item->touchscreen_data->current_slot = events[i].value; break; case ABS_MT_TRACKING_ID: - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } if (events[i].value >= 0) { item->touchscreen_data->slots[item->touchscreen_data->current_slot].tracking_id = events[i].value; item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta = EVDEV_TOUCH_SLOTDELTA_DOWN; @@ -356,24 +395,27 @@ SDL_EVDEV_Poll(void) } break; case ABS_MT_POSITION_X: - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } item->touchscreen_data->slots[item->touchscreen_data->current_slot].x = events[i].value; if (item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta == EVDEV_TOUCH_SLOTDELTA_NONE) { item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta = EVDEV_TOUCH_SLOTDELTA_MOVE; } break; case ABS_MT_POSITION_Y: - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } item->touchscreen_data->slots[item->touchscreen_data->current_slot].y = events[i].value; if (item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta == EVDEV_TOUCH_SLOTDELTA_NONE) { item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta = EVDEV_TOUCH_SLOTDELTA_MOVE; } break; case ABS_MT_PRESSURE: - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } item->touchscreen_data->slots[item->touchscreen_data->current_slot].pressure = events[i].value; if (item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta == EVDEV_TOUCH_SLOTDELTA_NONE) { item->touchscreen_data->slots[item->touchscreen_data->current_slot].delta = EVDEV_TOUCH_SLOTDELTA_MOVE; @@ -381,21 +423,21 @@ SDL_EVDEV_Poll(void) break; case ABS_X: if (item->is_touchscreen) { - if (item->touchscreen_data->max_slots != 1) + if (item->touchscreen_data->max_slots != 1) { break; + } item->touchscreen_data->slots[0].x = events[i].value; } else if (!item->relative_mouse) { - /* FIXME: Normalize to input device's reported input range (EVIOCGABS) */ item->mouse_x = events[i].value; } break; case ABS_Y: if (item->is_touchscreen) { - if (item->touchscreen_data->max_slots != 1) + if (item->touchscreen_data->max_slots != 1) { break; + } item->touchscreen_data->slots[0].y = events[i].value; } else if (!item->relative_mouse) { - /* FIXME: Normalize to input device's reported input range (EVIOCGABS) */ item->mouse_y = events[i].value; } break; @@ -404,26 +446,30 @@ SDL_EVDEV_Poll(void) } break; case EV_REL: - switch(events[i].code) { + switch (events[i].code) { case REL_X: - if (item->relative_mouse) + if (item->relative_mouse) { item->mouse_x += events[i].value; + } break; case REL_Y: - if (item->relative_mouse) + if (item->relative_mouse) { item->mouse_y += events[i].value; + } break; case REL_WHEEL: - if (!item->high_res_wheel) + if (!item->high_res_wheel) { item->mouse_wheel += events[i].value; + } break; case REL_WHEEL_HI_RES: SDL_assert(item->high_res_wheel); item->mouse_wheel += events[i].value; break; case REL_HWHEEL: - if (!item->high_res_hwheel) + if (!item->high_res_hwheel) { item->mouse_hwheel += events[i].value; + } break; case REL_HWHEEL_HI_RES: SDL_assert(item->high_res_hwheel); @@ -437,10 +483,20 @@ SDL_EVDEV_Poll(void) switch (events[i].code) { case SYN_REPORT: /* Send mouse axis changes together to ensure consistency and reduce event processing overhead */ - if (item->mouse_x != 0 || item->mouse_y != 0) { - SDL_SendMouseMotion(mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, item->mouse_x, item->mouse_y); - item->mouse_x = item->mouse_y = 0; + if (item->relative_mouse) { + if (item->mouse_x != 0 || item->mouse_y != 0) { + SDL_SendMouseMotion(mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, item->mouse_x, item->mouse_y); + item->mouse_x = item->mouse_y = 0; + } + } else if (item->range_x > 0 && item->range_y > 0) { + /* TODO: test with multiple display scenarios */ + SDL_DisplayMode mode; + SDL_GetCurrentDisplayMode(0, &mode); + SDL_SendMouseMotion(mouse->focus, (SDL_MouseID)item->fd, item->relative_mouse, + (item->mouse_x - item->min_x) * mode.w / item->range_x, + (item->mouse_y - item->min_y) * mode.h / item->range_y); } + if (item->mouse_wheel != 0 || item->mouse_hwheel != 0) { SDL_SendMouseWheel(mouse->focus, (SDL_MouseID)item->fd, item->mouse_hwheel / (item->high_res_hwheel ? 120.0f : 1.0f), @@ -449,18 +505,19 @@ SDL_EVDEV_Poll(void) item->mouse_wheel = item->mouse_hwheel = 0; } - if (!item->is_touchscreen) /* FIXME: temp hack */ + if (!item->is_touchscreen) { /* FIXME: temp hack */ break; + } - for(j = 0; j < item->touchscreen_data->max_slots; j++) { + for (j = 0; j < item->touchscreen_data->max_slots; j++) { norm_x = (float)(item->touchscreen_data->slots[j].x - item->touchscreen_data->min_x) / - (float)item->touchscreen_data->range_x; + (float)item->touchscreen_data->range_x; norm_y = (float)(item->touchscreen_data->slots[j].y - item->touchscreen_data->min_y) / - (float)item->touchscreen_data->range_y; + (float)item->touchscreen_data->range_y; if (item->touchscreen_data->range_pressure > 0) { norm_pressure = (float)(item->touchscreen_data->slots[j].pressure - item->touchscreen_data->min_pressure) / - (float)item->touchscreen_data->range_pressure; + (float)item->touchscreen_data->range_pressure; } else { /* This touchscreen does not support pressure */ norm_pressure = 1.0f; @@ -469,7 +526,7 @@ SDL_EVDEV_Poll(void) /* FIXME: the touch's window shouldn't be null, but * the coordinate space of touch positions needs to * be window-relative in that case. */ - switch(item->touchscreen_data->slots[j].delta) { + switch (item->touchscreen_data->slots[j].delta) { case EVDEV_TOUCH_SLOTDELTA_DOWN: SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, NULL, SDL_TRUE, norm_x, norm_y, norm_pressure); item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE; @@ -488,12 +545,14 @@ SDL_EVDEV_Poll(void) } } - if (item->out_of_sync) + if (item->out_of_sync) { item->out_of_sync = SDL_FALSE; + } break; case SYN_DROPPED: - if (item->is_touchscreen) + if (item->is_touchscreen) { item->out_of_sync = SDL_TRUE; + } SDL_EVDEV_sync_device(item); break; default: @@ -502,12 +561,11 @@ SDL_EVDEV_Poll(void) break; } } - } + } } } -static SDL_Scancode -SDL_EVDEV_translate_keycode(int keycode) +static SDL_Scancode SDL_EVDEV_translate_keycode(int keycode) { SDL_Scancode scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, keycode); @@ -519,8 +577,9 @@ SDL_EVDEV_translate_keycode(int keycode) SDL_Log message about an unknown key. */ if (keycode != BTN_TOUCH) { SDL_Log("The key you just pressed is not recognized by SDL. To help " - "get this fixed, please report this to the SDL forums/mailing list " - " EVDEV KeyCode %d", keycode); + "get this fixed, please report this to the SDL forums/mailing list " + " EVDEV KeyCode %d", + keycode); } } #endif /* DEBUG_SCANCODES */ @@ -528,20 +587,47 @@ SDL_EVDEV_translate_keycode(int keycode) return scancode; } -static int -SDL_EVDEV_init_touchscreen(SDL_evdevlist_item* item, int udev_class) +static int SDL_EVDEV_init_mouse(SDL_evdevlist_item *item, int udev_class) +{ + int ret; + struct input_absinfo abs_info; + + ret = ioctl(item->fd, EVIOCGABS(ABS_X), &abs_info); + if (ret < 0) { + // no absolute mode info, continue + return 0; + } + item->min_x = abs_info.minimum; + item->max_x = abs_info.maximum; + item->range_x = abs_info.maximum - abs_info.minimum; + + ret = ioctl(item->fd, EVIOCGABS(ABS_Y), &abs_info); + if (ret < 0) { + // no absolute mode info, continue + return 0; + } + item->min_y = abs_info.minimum; + item->max_y = abs_info.maximum; + item->range_y = abs_info.maximum - abs_info.minimum; + + return 0; +} + +static int SDL_EVDEV_init_touchscreen(SDL_evdevlist_item *item, int udev_class) { int ret, i; unsigned long xreq, yreq; char name[64]; struct input_absinfo abs_info; - if (!item->is_touchscreen) + if (!item->is_touchscreen) { return 0; + } item->touchscreen_data = SDL_calloc(1, sizeof(*item->touchscreen_data)); - if (item->touchscreen_data == NULL) + if (!item->touchscreen_data) { return SDL_OutOfMemory(); + } ret = ioctl(item->fd, EVIOCGNAME(sizeof(name)), name); if (ret < 0) { @@ -550,7 +636,7 @@ SDL_EVDEV_init_touchscreen(SDL_evdevlist_item* item, int udev_class) } item->touchscreen_data->name = SDL_strdup(name); - if (item->touchscreen_data->name == NULL) { + if (!item->touchscreen_data->name) { SDL_free(item->touchscreen_data); return SDL_OutOfMemory(); } @@ -605,19 +691,19 @@ SDL_EVDEV_init_touchscreen(SDL_evdevlist_item* item, int udev_class) item->touchscreen_data->slots = SDL_calloc( item->touchscreen_data->max_slots, sizeof(*item->touchscreen_data->slots)); - if (item->touchscreen_data->slots == NULL) { + if (!item->touchscreen_data->slots) { SDL_free(item->touchscreen_data->name); SDL_free(item->touchscreen_data); return SDL_OutOfMemory(); } - for(i = 0; i < item->touchscreen_data->max_slots; i++) { + for (i = 0; i < item->touchscreen_data->max_slots; i++) { item->touchscreen_data->slots[i].tracking_id = -1; } ret = SDL_AddTouch(item->fd, /* I guess our fd is unique enough */ - (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT, - item->touchscreen_data->name); + (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT, + item->touchscreen_data->name); if (ret < 0) { SDL_free(item->touchscreen_data->slots); SDL_free(item->touchscreen_data->name); @@ -628,10 +714,11 @@ SDL_EVDEV_init_touchscreen(SDL_evdevlist_item* item, int udev_class) return 0; } -static void -SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item* item) { - if (!item->is_touchscreen) +static void SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item *item) +{ + if (!item->is_touchscreen) { return; + } SDL_DelTouch(item->fd); SDL_free(item->touchscreen_data->slots); @@ -639,8 +726,7 @@ SDL_EVDEV_destroy_touchscreen(SDL_evdevlist_item* item) { SDL_free(item->touchscreen_data); } -static void -SDL_EVDEV_sync_device(SDL_evdevlist_item *item) +static void SDL_EVDEV_sync_device(SDL_evdevlist_item *item) { #ifdef EVIOCGMTSLOTS int i, ret; @@ -653,23 +739,24 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) * * this is the structure we're trying to emulate */ - Uint32* mt_req_code; - Sint32* mt_req_values; + Uint32 *mt_req_code; + Sint32 *mt_req_values; size_t mt_req_size; /* TODO: sync devices other than touchscreen */ - if (!item->is_touchscreen) + if (!item->is_touchscreen) { return; + } mt_req_size = sizeof(*mt_req_code) + - sizeof(*mt_req_values) * item->touchscreen_data->max_slots; + sizeof(*mt_req_values) * item->touchscreen_data->max_slots; mt_req_code = SDL_calloc(1, mt_req_size); - if (mt_req_code == NULL) { + if (!mt_req_code) { return; } - mt_req_values = (Sint32*)mt_req_code + 1; + mt_req_values = (Sint32 *)mt_req_code + 1; *mt_req_code = ABS_MT_TRACKING_ID; ret = ioctl(item->fd, EVIOCGMTSLOTS(mt_req_size), mt_req_code); @@ -677,7 +764,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) SDL_free(mt_req_code); return; } - for(i = 0; i < item->touchscreen_data->max_slots; i++) { + for (i = 0; i < item->touchscreen_data->max_slots; i++) { /* * This doesn't account for the very edge case of the user removing their * finger and replacing it on the screen during the time we're out of sync, @@ -692,7 +779,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) item->touchscreen_data->slots[i].tracking_id = mt_req_values[i]; item->touchscreen_data->slots[i].delta = EVDEV_TOUCH_SLOTDELTA_DOWN; } else if (item->touchscreen_data->slots[i].tracking_id >= 0 && - mt_req_values[i] < 0) { + mt_req_values[i] < 0) { item->touchscreen_data->slots[i].tracking_id = -1; item->touchscreen_data->slots[i].delta = EVDEV_TOUCH_SLOTDELTA_UP; } @@ -704,7 +791,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) SDL_free(mt_req_code); return; } - for(i = 0; i < item->touchscreen_data->max_slots; i++) { + for (i = 0; i < item->touchscreen_data->max_slots; i++) { if (item->touchscreen_data->slots[i].tracking_id >= 0 && item->touchscreen_data->slots[i].x != mt_req_values[i]) { item->touchscreen_data->slots[i].x = mt_req_values[i]; @@ -722,7 +809,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) SDL_free(mt_req_code); return; } - for(i = 0; i < item->touchscreen_data->max_slots; i++) { + for (i = 0; i < item->touchscreen_data->max_slots; i++) { if (item->touchscreen_data->slots[i].tracking_id >= 0 && item->touchscreen_data->slots[i].y != mt_req_values[i]) { item->touchscreen_data->slots[i].y = mt_req_values[i]; @@ -740,7 +827,7 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) SDL_free(mt_req_code); return; } - for(i = 0; i < item->touchscreen_data->max_slots; i++) { + for (i = 0; i < item->touchscreen_data->max_slots; i++) { if (item->touchscreen_data->slots[i].tracking_id >= 0 && item->touchscreen_data->slots[i].pressure != mt_req_values[i]) { item->touchscreen_data->slots[i].pressure = mt_req_values[i]; @@ -764,22 +851,21 @@ SDL_EVDEV_sync_device(SDL_evdevlist_item *item) #endif /* EVIOCGMTSLOTS */ } -static int -SDL_EVDEV_device_added(const char *dev_path, int udev_class) +static int SDL_EVDEV_device_added(const char *dev_path, int udev_class) { int ret; SDL_evdevlist_item *item; unsigned long relbit[NBITS(REL_MAX)] = { 0 }; /* Check to make sure it's not already in list. */ - for (item = _this->first; item != NULL; item = item->next) { + for (item = _this->first; item; item = item->next) { if (SDL_strcmp(dev_path, item->path) == 0) { - return -1; /* already have this one */ + return -1; /* already have this one */ } } - item = (SDL_evdevlist_item *) SDL_calloc(1, sizeof (SDL_evdevlist_item)); - if (item == NULL) { + item = (SDL_evdevlist_item *)SDL_calloc(1, sizeof(SDL_evdevlist_item)); + if (!item) { return SDL_OutOfMemory(); } @@ -790,12 +876,14 @@ SDL_EVDEV_device_added(const char *dev_path, int udev_class) } item->path = SDL_strdup(dev_path); - if (item->path == NULL) { + if (!item->path) { close(item->fd); SDL_free(item); return SDL_OutOfMemory(); } + item->udev_class = udev_class; + if (ioctl(item->fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0) { item->relative_mouse = test_bit(REL_X, relbit) && test_bit(REL_Y, relbit); item->high_res_wheel = test_bit(REL_WHEEL_HI_RES, relbit); @@ -805,8 +893,16 @@ SDL_EVDEV_device_added(const char *dev_path, int udev_class) /* For now, we just treat a touchpad like a touchscreen */ if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) { item->is_touchscreen = SDL_TRUE; - - if ((ret = SDL_EVDEV_init_touchscreen(item, udev_class)) < 0) { + ret = SDL_EVDEV_init_touchscreen(item, udev_class); + if (ret < 0) { + close(item->fd); + SDL_free(item->path); + SDL_free(item); + return ret; + } + } else if (udev_class & SDL_UDEV_DEVICE_MOUSE) { + ret = SDL_EVDEV_init_mouse(item, udev_class); + if (ret < 0) { close(item->fd); SDL_free(item->path); SDL_free(item); @@ -814,7 +910,7 @@ SDL_EVDEV_device_added(const char *dev_path, int udev_class) } } - if (_this->last == NULL) { + if (!_this->last) { _this->first = _this->last = item; } else { _this->last->next = item; @@ -823,19 +919,20 @@ SDL_EVDEV_device_added(const char *dev_path, int udev_class) SDL_EVDEV_sync_device(item); + SDL_EVDEV_UpdateKeyboardMute(); + return _this->num_devices++; } -static int -SDL_EVDEV_device_removed(const char *dev_path) +static int SDL_EVDEV_device_removed(const char *dev_path) { SDL_evdevlist_item *item; SDL_evdevlist_item *prev = NULL; - for (item = _this->first; item != NULL; item = item->next) { + for (item = _this->first; item; item = item->next) { /* found it, remove it. */ if (SDL_strcmp(dev_path, item->path) == 0) { - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(_this->first == item); @@ -850,6 +947,7 @@ SDL_EVDEV_device_removed(const char *dev_path) close(item->fd); SDL_free(item->path); SDL_free(item); + SDL_EVDEV_UpdateKeyboardMute(); _this->num_devices--; return 0; } @@ -859,7 +957,6 @@ SDL_EVDEV_device_removed(const char *dev_path) return -1; } - #endif /* SDL_INPUT_LINUXEV */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_evdev.h b/src/core/linux/SDL_evdev.h index c951232fad559..6c4b14f0897ba 100644 --- a/src/core/linux/SDL_evdev.h +++ b/src/core/linux/SDL_evdev.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,6 +30,9 @@ extern int SDL_EVDEV_Init(void); extern void SDL_EVDEV_Quit(void); +extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data, + void (*acquire_callback)(void*), void *acquire_callback_data); +extern int SDL_EVDEV_GetDeviceCount(int device_class); extern void SDL_EVDEV_Poll(void); #endif /* SDL_INPUT_LINUXEV */ diff --git a/src/core/linux/SDL_evdev_capabilities.c b/src/core/linux/SDL_evdev_capabilities.c index e23d49973622a..472cc2fb0686a 100644 --- a/src/core/linux/SDL_evdev_capabilities.c +++ b/src/core/linux/SDL_evdev_capabilities.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2020 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -23,27 +23,27 @@ #include "SDL_evdev_capabilities.h" - -#if HAVE_LINUX_INPUT_H +#ifdef HAVE_LINUX_INPUT_H /* missing defines in older Linux kernel headers */ #ifndef BTN_TRIGGER_HAPPY #define BTN_TRIGGER_HAPPY 0x2c0 #endif #ifndef BTN_DPAD_UP -#define BTN_DPAD_UP 0x220 +#define BTN_DPAD_UP 0x220 #endif #ifndef KEY_ALS_TOGGLE -#define KEY_ALS_TOGGLE 0x230 +#define KEY_ALS_TOGGLE 0x230 #endif extern int -SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], - unsigned long bitmask_abs[NBITS(ABS_MAX)], - unsigned long bitmask_key[NBITS(KEY_MAX)], - unsigned long bitmask_rel[NBITS(REL_MAX)]) +SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_ev[NBITS(EV_MAX)], + const unsigned long bitmask_abs[NBITS(ABS_MAX)], + const unsigned long bitmask_key[NBITS(KEY_MAX)], + const unsigned long bitmask_rel[NBITS(REL_MAX)]) { - struct range { + struct range + { unsigned start; unsigned end; }; @@ -114,7 +114,7 @@ SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], unsigned i; unsigned long found = 0; - for (i = 0; i < BTN_MISC/BITS_PER_LONG; ++i) { + for (i = 0; i < BTN_MISC / BITS_PER_LONG; ++i) { found |= bitmask_key[i]; } /* If there are no keys in the lower block, check the higher blocks */ @@ -138,8 +138,9 @@ SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], /* the first 32 bits are ESC, numbers, and Q to D; if we have any of * those, consider it a keyboard device; do not test KEY_RESERVED, though */ keyboard_mask = 0xFFFFFFFE; - if ((bitmask_key[0] & keyboard_mask) != 0) + if ((bitmask_key[0] & keyboard_mask) != 0) { devclass |= SDL_UDEV_DEVICE_KEYBOARD; /* ID_INPUT_KEYBOARD */ + } return devclass; } diff --git a/src/core/linux/SDL_evdev_capabilities.h b/src/core/linux/SDL_evdev_capabilities.h index 67b7075ccae78..37f9d063a9c46 100644 --- a/src/core/linux/SDL_evdev_capabilities.h +++ b/src/core/linux/SDL_evdev_capabilities.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2020 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -24,33 +24,33 @@ #ifndef SDL_evdev_capabilities_h_ #define SDL_evdev_capabilities_h_ -#if HAVE_LINUX_INPUT_H +#ifdef HAVE_LINUX_INPUT_H #include /* A device can be any combination of these classes */ typedef enum { - SDL_UDEV_DEVICE_UNKNOWN = 0x0000, - SDL_UDEV_DEVICE_MOUSE = 0x0001, - SDL_UDEV_DEVICE_KEYBOARD = 0x0002, - SDL_UDEV_DEVICE_JOYSTICK = 0x0004, - SDL_UDEV_DEVICE_SOUND = 0x0008, + SDL_UDEV_DEVICE_UNKNOWN = 0x0000, + SDL_UDEV_DEVICE_MOUSE = 0x0001, + SDL_UDEV_DEVICE_KEYBOARD = 0x0002, + SDL_UDEV_DEVICE_JOYSTICK = 0x0004, + SDL_UDEV_DEVICE_SOUND = 0x0008, SDL_UDEV_DEVICE_TOUCHSCREEN = 0x0010, SDL_UDEV_DEVICE_ACCELEROMETER = 0x0020, - SDL_UDEV_DEVICE_TOUCHPAD = 0x0040 + SDL_UDEV_DEVICE_TOUCHPAD = 0x0040 } SDL_UDEV_deviceclass; -#define BITS_PER_LONG (sizeof(unsigned long) * 8) -#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) -#define EVDEV_OFF(x) ((x)%BITS_PER_LONG) -#define EVDEV_LONG(x) ((x)/BITS_PER_LONG) -#define test_bit(bit, array) ((array[EVDEV_LONG(bit)] >> EVDEV_OFF(bit)) & 1) +#define BITS_PER_LONG (sizeof(unsigned long) * 8) +#define NBITS(x) ((((x)-1) / BITS_PER_LONG) + 1) +#define EVDEV_OFF(x) ((x) % BITS_PER_LONG) +#define EVDEV_LONG(x) ((x) / BITS_PER_LONG) +#define test_bit(bit, array) ((array[EVDEV_LONG(bit)] >> EVDEV_OFF(bit)) & 1) -extern int SDL_EVDEV_GuessDeviceClass(unsigned long bitmask_ev[NBITS(EV_MAX)], - unsigned long bitmask_abs[NBITS(ABS_MAX)], - unsigned long bitmask_key[NBITS(KEY_MAX)], - unsigned long bitmask_rel[NBITS(REL_MAX)]); +extern int SDL_EVDEV_GuessDeviceClass(const unsigned long bitmask_ev[NBITS(EV_MAX)], + const unsigned long bitmask_abs[NBITS(ABS_MAX)], + const unsigned long bitmask_key[NBITS(KEY_MAX)], + const unsigned long bitmask_rel[NBITS(REL_MAX)]); #endif /* HAVE_LINUX_INPUT_H */ diff --git a/src/core/linux/SDL_evdev_kbd.c b/src/core/linux/SDL_evdev_kbd.c index f090bff4165ea..22a70c3baec9e 100644 --- a/src/core/linux/SDL_evdev_kbd.c +++ b/src/core/linux/SDL_evdev_kbd.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -53,33 +53,31 @@ * Handler Tables. */ -#define K_HANDLERS\ - k_self, k_fn, k_spec, k_pad,\ - k_dead, k_cons, k_cur, k_shift,\ - k_meta, k_ascii, k_lock, k_lowercase,\ - k_slock, k_dead2, k_brl, k_ignore +#define K_HANDLERS \ + k_self, k_fn, k_spec, k_pad, \ + k_dead, k_cons, k_cur, k_shift, \ + k_meta, k_ascii, k_lock, k_lowercase, \ + k_slock, k_dead2, k_brl, k_ignore -typedef void (k_handler_fn)(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag); +typedef void(k_handler_fn)(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag); static k_handler_fn K_HANDLERS; static k_handler_fn *k_handler[16] = { K_HANDLERS }; -typedef void (fn_handler_fn)(SDL_EVDEV_keyboard_state *kbd); +typedef void(fn_handler_fn)(SDL_EVDEV_keyboard_state *kbd); static void fn_enter(SDL_EVDEV_keyboard_state *kbd); static void fn_caps_toggle(SDL_EVDEV_keyboard_state *kbd); static void fn_caps_on(SDL_EVDEV_keyboard_state *kbd); static void fn_num(SDL_EVDEV_keyboard_state *kbd); static void fn_compose(SDL_EVDEV_keyboard_state *kbd); -static fn_handler_fn *fn_handler[] = -{ - NULL, fn_enter, NULL, NULL, - NULL, NULL, NULL, fn_caps_toggle, - fn_num, NULL, NULL, NULL, - NULL, fn_caps_on, fn_compose, NULL, - NULL, NULL, NULL, fn_num +static fn_handler_fn *fn_handler[] = { + NULL, fn_enter, NULL, NULL, + NULL, NULL, NULL, fn_caps_toggle, + fn_num, NULL, NULL, NULL, + NULL, fn_caps_on, fn_compose, NULL, + NULL, NULL, NULL, fn_num }; - /* * Keyboard State */ @@ -87,20 +85,25 @@ static fn_handler_fn *fn_handler[] = struct SDL_EVDEV_keyboard_state { int console_fd; + SDL_bool muted; int old_kbd_mode; unsigned short **key_maps; - unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ + unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ SDL_bool dead_key_next; - int npadch; /* -1 or number assembled on pad */ + int npadch; /* -1 or number assembled on pad */ struct kbdiacrs *accents; unsigned int diacr; - SDL_bool rep; /* flag telling character repeat */ + SDL_bool rep; /* flag telling character repeat */ unsigned char lockstate; unsigned char slockstate; unsigned char ledflagstate; char shift_state; char text[128]; unsigned int text_len; + void (*vt_release_callback)(void *); + void *vt_release_callback_data; + void (*vt_acquire_callback)(void *); + void *vt_acquire_callback_data; }; #ifdef DUMP_ACCENTS @@ -114,7 +117,7 @@ static void SDL_EVDEV_dump_accents(SDL_EVDEV_keyboard_state *kbd) for (i = 0; i < kbd->accents->kb_cnt; ++i) { struct kbdiacr *diacr = &kbd->accents->kbdiacr[i]; printf(" { 0x%.2x, 0x%.2x, 0x%.2x },\n", - diacr->diacr, diacr->base, diacr->result); + diacr->diacr, diacr->base, diacr->result); } while (i < 256) { printf(" { 0x00, 0x00, 0x00 },\n"); @@ -134,7 +137,7 @@ static void SDL_EVDEV_dump_keymap(SDL_EVDEV_keyboard_state *kbd) if (kbd->key_maps[i]) { printf("static unsigned short default_key_map_%d[NR_KEYS] = {", i); for (j = 0; j < NR_KEYS; ++j) { - if ((j%8) == 0) { + if ((j % 8) == 0) { printf("\n "); } printf("0x%.4x, ", kbd->key_maps[i][j]); @@ -155,63 +158,23 @@ static void SDL_EVDEV_dump_keymap(SDL_EVDEV_keyboard_state *kbd) } #endif /* DUMP_KEYMAP */ -static int SDL_EVDEV_kbd_load_keymaps(SDL_EVDEV_keyboard_state *kbd) -{ - int i, j; - - kbd->key_maps = (unsigned short **)SDL_calloc(MAX_NR_KEYMAPS, sizeof(unsigned short *)); - if (!kbd->key_maps) { - return -1; - } - - for (i = 0; i < MAX_NR_KEYMAPS; ++i) { - struct kbentry kbe; - - kbe.kb_table = i; - kbe.kb_index = 0; - if (ioctl(kbd->console_fd, KDGKBENT, &kbe) < 0) { - return -1; - } - - if (kbe.kb_value == K_NOSUCHMAP) { - continue; - } - - kbd->key_maps[i] = (unsigned short *)SDL_malloc(NR_KEYS * sizeof(unsigned short)); - if (!kbd->key_maps[i]) { - return -1; - } - - for (j = 0; j < NR_KEYS; ++j) { - kbe.kb_table = i; - kbe.kb_index = j; - if (ioctl(kbd->console_fd, KDGKBENT, &kbe) < 0) { - return -1; - } - kbd->key_maps[i][j] = (kbe.kb_value ^ 0xf000); - } - } - return 0; -} - -static SDL_EVDEV_keyboard_state * kbd_cleanup_state = NULL; +static SDL_EVDEV_keyboard_state *kbd_cleanup_state = NULL; static int kbd_cleanup_sigactions_installed = 0; static int kbd_cleanup_atexit_installed = 0; static struct sigaction old_sigaction[NSIG]; -static int fatal_signals[] = -{ +static int fatal_signals[] = { /* Handlers for SIGTERM and SIGINT are installed in SDL_QuitInit. */ - SIGHUP, SIGQUIT, SIGILL, SIGABRT, - SIGFPE, SIGSEGV, SIGPIPE, SIGBUS, + SIGHUP, SIGQUIT, SIGILL, SIGABRT, + SIGFPE, SIGSEGV, SIGPIPE, SIGBUS, SIGSYS }; static void kbd_cleanup(void) { - SDL_EVDEV_keyboard_state* kbd = kbd_cleanup_state; - if (kbd == NULL) { + SDL_EVDEV_keyboard_state *kbd = kbd_cleanup_state; + if (!kbd) { return; } kbd_cleanup_state = NULL; @@ -219,18 +182,17 @@ static void kbd_cleanup(void) ioctl(kbd->console_fd, KDSKBMODE, kbd->old_kbd_mode); } -static void -SDL_EVDEV_kbd_reraise_signal(int sig) +static void SDL_EVDEV_kbd_reraise_signal(int sig) { - raise(sig); + (void)raise(sig); } -siginfo_t* SDL_EVDEV_kdb_cleanup_siginfo = NULL; -void* SDL_EVDEV_kdb_cleanup_ucontext = NULL; +siginfo_t *SDL_EVDEV_kdb_cleanup_siginfo = NULL; +void *SDL_EVDEV_kdb_cleanup_ucontext = NULL; -static void kbd_cleanup_signal_action(int signum, siginfo_t* info, void* ucontext) +static void kbd_cleanup_signal_action(int signum, siginfo_t *info, void *ucontext) { - struct sigaction* old_action_p = &(old_sigaction[signum]); + struct sigaction *old_action_p = &(old_sigaction[signum]); sigset_t sigset; /* Restore original signal handler before going any further. */ @@ -252,7 +214,7 @@ static void kbd_cleanup_signal_action(int signum, siginfo_t* info, void* ucontex SDL_EVDEV_kbd_reraise_signal(signum); } -static void kbd_unregister_emerg_cleanup() +static void kbd_unregister_emerg_cleanup(void) { int tabidx, signum; @@ -264,19 +226,20 @@ static void kbd_unregister_emerg_cleanup() kbd_cleanup_sigactions_installed = 0; for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) { - struct sigaction* old_action_p; + struct sigaction *old_action_p; struct sigaction cur_action; signum = fatal_signals[tabidx]; old_action_p = &(old_sigaction[signum]); /* Examine current signal action */ - if (sigaction(signum, NULL, &cur_action)) + if (sigaction(signum, NULL, &cur_action)) { continue; + } /* Check if action installed and not modifed */ - if (!(cur_action.sa_flags & SA_SIGINFO) - || cur_action.sa_sigaction != &kbd_cleanup_signal_action) + if (!(cur_action.sa_flags & SA_SIGINFO) || cur_action.sa_sigaction != &kbd_cleanup_signal_action) { continue; + } /* Restore original action */ sigaction(signum, old_action_p, NULL); @@ -292,11 +255,11 @@ static void kbd_cleanup_atexit(void) kbd_unregister_emerg_cleanup(); } -static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) +static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd) { int tabidx, signum; - if (kbd_cleanup_state != NULL) { + if (kbd_cleanup_state) { return; } kbd_cleanup_state = kbd; @@ -306,7 +269,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) * functions that are called when the shared library is unloaded. * -- man atexit(3) */ - atexit(kbd_cleanup_atexit); + (void)atexit(kbd_cleanup_atexit); kbd_cleanup_atexit_installed = 1; } @@ -316,20 +279,20 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) kbd_cleanup_sigactions_installed = 1; for (tabidx = 0; tabidx < sizeof(fatal_signals) / sizeof(fatal_signals[0]); ++tabidx) { - struct sigaction* old_action_p; + struct sigaction *old_action_p; struct sigaction new_action; - signum = fatal_signals[tabidx]; + signum = fatal_signals[tabidx]; old_action_p = &(old_sigaction[signum]); - if (sigaction(signum, NULL, old_action_p)) + if (sigaction(signum, NULL, old_action_p)) { continue; + } /* Skip SIGHUP and SIGPIPE if handler is already installed * - assume the handler will do the cleanup */ - if ((signum == SIGHUP || signum == SIGPIPE) - && (old_action_p->sa_handler != SIG_DFL - || (void (*)(int))old_action_p->sa_sigaction != SIG_DFL)) + if ((signum == SIGHUP || signum == SIGPIPE) && (old_action_p->sa_handler != SIG_DFL || (void (*)(int))old_action_p->sa_sigaction != SIG_DFL)) { continue; + } new_action = *old_action_p; new_action.sa_flags |= SA_SIGINFO; @@ -338,23 +301,146 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state * kbd) } } -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +enum { + VT_SIGNAL_NONE, + VT_SIGNAL_RELEASE, + VT_SIGNAL_ACQUIRE, +}; +static int vt_release_signal; +static int vt_acquire_signal; +static SDL_atomic_t vt_signal_pending; + +typedef void (*signal_handler)(int signum); + +static void kbd_vt_release_signal_action(int signum) +{ + SDL_AtomicSet(&vt_signal_pending, VT_SIGNAL_RELEASE); +} + +static void kbd_vt_acquire_signal_action(int signum) { - SDL_EVDEV_keyboard_state *kbd; + SDL_AtomicSet(&vt_signal_pending, VT_SIGNAL_ACQUIRE); +} + +static SDL_bool setup_vt_signal(int signum, signal_handler handler) +{ + struct sigaction *old_action_p; + struct sigaction new_action; + old_action_p = &(old_sigaction[signum]); + SDL_zero(new_action); + new_action.sa_handler = handler; + new_action.sa_flags = SA_RESTART; + if (sigaction(signum, &new_action, old_action_p) < 0) { + return SDL_FALSE; + } + if (old_action_p->sa_handler != SIG_DFL) { + /* This signal is already in use */ + sigaction(signum, old_action_p, NULL); + return SDL_FALSE; + } + return SDL_TRUE; +} + +static int find_free_signal(signal_handler handler) +{ +#ifdef SIGRTMIN int i; + + for (i = SIGRTMIN + 2; i <= SIGRTMAX; ++i) { + if (setup_vt_signal(i, handler)) { + return i; + } + } +#endif + if (setup_vt_signal(SIGUSR1, handler)) { + return SIGUSR1; + } + if (setup_vt_signal(SIGUSR2, handler)) { + return SIGUSR2; + } + return 0; +} + +static void kbd_vt_quit(int console_fd) +{ + struct vt_mode mode; + + if (vt_release_signal) { + sigaction(vt_release_signal, &old_sigaction[vt_release_signal], NULL); + vt_release_signal = 0; + } + if (vt_acquire_signal) { + sigaction(vt_acquire_signal, &old_sigaction[vt_acquire_signal], NULL); + vt_acquire_signal = 0; + } + + SDL_zero(mode); + mode.mode = VT_AUTO; + ioctl(console_fd, VT_SETMODE, &mode); +} + +static int kbd_vt_init(int console_fd) +{ + struct vt_mode mode; + + vt_release_signal = find_free_signal(kbd_vt_release_signal_action); + vt_acquire_signal = find_free_signal(kbd_vt_acquire_signal_action); + if (!vt_release_signal || !vt_acquire_signal) { + kbd_vt_quit(console_fd); + return -1; + } + + SDL_zero(mode); + mode.mode = VT_PROCESS; + mode.relsig = vt_release_signal; + mode.acqsig = vt_acquire_signal; + mode.frsig = SIGIO; + if (ioctl(console_fd, VT_SETMODE, &mode) < 0) { + kbd_vt_quit(console_fd); + return -1; + } + return 0; +} + +static void kbd_vt_update(SDL_EVDEV_keyboard_state *state) +{ + int signal_pending = SDL_AtomicGet(&vt_signal_pending); + if (signal_pending != VT_SIGNAL_NONE) { + if (signal_pending == VT_SIGNAL_RELEASE) { + if (state->vt_release_callback) { + state->vt_release_callback(state->vt_release_callback_data); + } + ioctl(state->console_fd, VT_RELDISP, 1); + } else { + if (state->vt_acquire_callback) { + state->vt_acquire_callback(state->vt_acquire_callback_data); + } + ioctl(state->console_fd, VT_RELDISP, VT_ACKACQ); + } + SDL_AtomicCAS(&vt_signal_pending, signal_pending, VT_SIGNAL_NONE); + } +} + +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) +{ + SDL_EVDEV_keyboard_state *kbd; char flag_state; - char shift_state[ sizeof (long) ] = {TIOCL_GETSHIFTSTATE, 0}; + char kbtype; + char shift_state[sizeof(long)] = { TIOCL_GETSHIFTSTATE, 0 }; kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(*kbd)); if (!kbd) { return NULL; } - kbd->npadch = -1; - /* This might fail if we're not connected to a tty (e.g. on the Steam Link) */ kbd->console_fd = open("/dev/tty", O_RDONLY | O_CLOEXEC); + if (!((ioctl(kbd->console_fd, KDGKBTYPE, &kbtype) == 0) && ((kbtype == KB_101) || (kbtype == KB_84)))) { + close(kbd->console_fd); + kbd->console_fd = -1; + } + + kbd->npadch = -1; if (ioctl(kbd->console_fd, TIOCLINUX, shift_state) == 0) { kbd->shift_state = *shift_state; @@ -365,79 +451,99 @@ SDL_EVDEV_kbd_init(void) } kbd->accents = &default_accents; - if (ioctl(kbd->console_fd, KDGKBDIACR, kbd->accents) < 0) { - /* No worries, we'll use the default accent table */ - } - kbd->key_maps = default_key_maps; + if (ioctl(kbd->console_fd, KDGKBMODE, &kbd->old_kbd_mode) == 0) { /* Set the keyboard in UNICODE mode and load the keymaps */ ioctl(kbd->console_fd, KDSKBMODE, K_UNICODE); + } - if (SDL_EVDEV_kbd_load_keymaps(kbd) < 0) { - for (i = 0; i < MAX_NR_KEYMAPS; ++i) { - if (kbd->key_maps[i]) { - SDL_free(kbd->key_maps[i]); - } - } - SDL_free(kbd->key_maps); + kbd_vt_init(kbd->console_fd); - kbd->key_maps = default_key_maps; - } + return kbd; +} + +void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted) +{ + if (!state) { + return; + } + + if (muted == state->muted) { + return; + } + if (muted) { /* Allow inhibiting keyboard mute with env. variable for debugging etc. */ if (SDL_getenv("SDL_INPUT_LINUX_KEEP_KBD") == NULL) { /* Mute the keyboard so keystrokes only generate evdev events * and do not leak through to the console */ - ioctl(kbd->console_fd, KDSKBMODE, K_OFF); + ioctl(state->console_fd, KDSKBMODE, K_OFF); /* Make sure to restore keyboard if application fails to call * SDL_Quit before exit or fatal signal is raised. */ if (!SDL_GetHintBoolean(SDL_HINT_NO_SIGNAL_HANDLERS, SDL_FALSE)) { - kbd_register_emerg_cleanup(kbd); + kbd_register_emerg_cleanup(state); } } + } else { + kbd_unregister_emerg_cleanup(); + + /* Restore the original keyboard mode */ + ioctl(state->console_fd, KDSKBMODE, state->old_kbd_mode); } + state->muted = muted; +} -#ifdef DUMP_ACCENTS - SDL_EVDEV_dump_accents(kbd); -#endif -#ifdef DUMP_KEYMAP - SDL_EVDEV_dump_keymap(kbd); -#endif - return kbd; +void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data) +{ + if (!state) { + return; + } + + state->vt_release_callback = release_callback; + state->vt_release_callback_data = release_callback_data; + state->vt_acquire_callback = acquire_callback; + state->vt_acquire_callback_data = acquire_callback_data; } -void -SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) +void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state) { - if (!kbd) { + if (!state) { return; } - kbd_unregister_emerg_cleanup(); + kbd_vt_update(state); +} - if (kbd->console_fd >= 0) { - /* Restore the original keyboard mode */ - ioctl(kbd->console_fd, KDSKBMODE, kbd->old_kbd_mode); +void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state) +{ + if (!state) { + return; + } - close(kbd->console_fd); - kbd->console_fd = -1; + SDL_EVDEV_kbd_set_muted(state, SDL_FALSE); + + kbd_vt_quit(state->console_fd); + + if (state->console_fd >= 0) { + close(state->console_fd); + state->console_fd = -1; } - if (kbd->key_maps && kbd->key_maps != default_key_maps) { + if (state->key_maps && state->key_maps != default_key_maps) { int i; for (i = 0; i < MAX_NR_KEYMAPS; ++i) { - if (kbd->key_maps[i]) { - SDL_free(kbd->key_maps[i]); + if (state->key_maps[i]) { + SDL_free(state->key_maps[i]); } } - SDL_free(kbd->key_maps); + SDL_free(state->key_maps); } - SDL_free(kbd); + SDL_free(state); } /* @@ -446,25 +552,26 @@ SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *kbd) static void put_queue(SDL_EVDEV_keyboard_state *kbd, uint c) { /* c is already part of a UTF-8 sequence and safe to add as a character */ - if (kbd->text_len < (sizeof(kbd->text)-1)) { + if (kbd->text_len < (sizeof(kbd->text) - 1)) { kbd->text[kbd->text_len++] = (char)c; } } static void put_utf8(SDL_EVDEV_keyboard_state *kbd, uint c) { - if (c < 0x80) - /* 0******* */ - put_queue(kbd, c); - else if (c < 0x800) { + if (c < 0x80) { + put_queue(kbd, c); /* 0******* */ + } else if (c < 0x800) { /* 110***** 10****** */ put_queue(kbd, 0xc0 | (c >> 6)); put_queue(kbd, 0x80 | (c & 0x3f)); } else if (c < 0x10000) { - if (c >= 0xD800 && c < 0xE000) + if (c >= 0xD800 && c < 0xE000) { return; - if (c == 0xFFFF) + } + if (c == 0xFFFF) { return; + } /* 1110**** 10****** 10****** */ put_queue(kbd, 0xe0 | (c >> 12)); put_queue(kbd, 0x80 | ((c >> 6) & 0x3f)); @@ -492,6 +599,11 @@ static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch) kbd->diacr = 0; + if (kbd->console_fd >= 0) + if (ioctl(kbd->console_fd, KDGKBDIACR, kbd->accents) < 0) { + /* No worries, we'll use the default accent table */ + } + for (i = 0; i < kbd->accents->kb_cnt; i++) { if (kbd->accents->kbdiacr[i].diacr == d && kbd->accents->kbdiacr[i].base == ch) { @@ -499,8 +611,9 @@ static unsigned int handle_diacr(SDL_EVDEV_keyboard_state *kbd, unsigned int ch) } } - if (ch == ' ' || ch == d) + if (ch == ' ' || ch == d) { return d; + } put_utf8(kbd, d); @@ -554,24 +667,27 @@ static void fn_enter(SDL_EVDEV_keyboard_state *kbd) static void fn_caps_toggle(SDL_EVDEV_keyboard_state *kbd) { - if (kbd->rep) + if (kbd->rep) { return; + } chg_vc_kbd_led(kbd, K_CAPSLOCK); } static void fn_caps_on(SDL_EVDEV_keyboard_state *kbd) { - if (kbd->rep) + if (kbd->rep) { return; + } set_vc_kbd_led(kbd, K_CAPSLOCK); } static void fn_num(SDL_EVDEV_keyboard_state *kbd) { - if (!kbd->rep) + if (!kbd->rep) { chg_vc_kbd_led(kbd, K_NUMLOCK); + } } static void fn_compose(SDL_EVDEV_keyboard_state *kbd) @@ -589,12 +705,15 @@ static void k_ignore(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up static void k_spec(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) { - if (up_flag) + if (up_flag) { return; - if (value >= SDL_arraysize(fn_handler)) + } + if (value >= SDL_arraysize(fn_handler)) { return; - if (fn_handler[value]) + } + if (fn_handler[value]) { fn_handler[value](kbd); + } } static void k_lowercase(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) @@ -603,11 +722,13 @@ static void k_lowercase(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) { - if (up_flag) - return; /* no action, if this is a key release */ + if (up_flag) { + return; /* no action, if this is a key release */ + } - if (kbd->diacr) + if (kbd->diacr) { value = handle_diacr(kbd, value); + } if (kbd->dead_key_next) { kbd->dead_key_next = SDL_FALSE; @@ -619,15 +740,16 @@ static void k_self(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_f static void k_deadunicode(SDL_EVDEV_keyboard_state *kbd, unsigned int value, char up_flag) { - if (up_flag) + if (up_flag) { return; + } kbd->diacr = (kbd->diacr ? handle_diacr(kbd, value) : value); } static void k_dead(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) { - const unsigned char ret_diacr[NR_DEAD] = {'`', '\'', '^', '~', '"', ',' }; + const unsigned char ret_diacr[NR_DEAD] = { '`', '\'', '^', '~', '"', ',' }; k_deadunicode(kbd, ret_diacr[value], up_flag); } @@ -653,8 +775,9 @@ static void k_pad(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_fl { static const char pad_chars[] = "0123456789+-*/\015,.?()#"; - if (up_flag) - return; /* no action, if this is a key release */ + if (up_flag) { + return; /* no action, if this is a key release */ + } if (!vc_kbd_led(kbd, K_NUMLOCK)) { /* unprintable action */ @@ -668,16 +791,18 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ { int old_state = kbd->shift_state; - if (kbd->rep) + if (kbd->rep) { return; + } /* * Mimic typewriter: * a CapsShift key acts like Shift but undoes CapsLock */ if (value == KVAL(K_CAPSSHIFT)) { value = KVAL(K_SHIFT); - if (!up_flag) + if (!up_flag) { clr_vc_kbd_led(kbd, K_CAPSLOCK); + } } if (up_flag) { @@ -685,15 +810,18 @@ static void k_shift(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ * handle the case that two shift or control * keys are depressed simultaneously */ - if (kbd->shift_down[value]) + if (kbd->shift_down[value]) { kbd->shift_down[value]--; - } else + } + } else { kbd->shift_down[value]++; + } - if (kbd->shift_down[value]) + if (kbd->shift_down[value]) { kbd->shift_state |= (1 << value); - else + } else { kbd->shift_state &= ~(1 << value); + } /* kludge */ if (up_flag && kbd->shift_state != old_state && kbd->npadch != -1) { @@ -710,8 +838,9 @@ static void k_ascii(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ { int base; - if (up_flag) + if (up_flag) { return; + } if (value < 10) { /* decimal input of code, while Alt depressed */ @@ -722,16 +851,18 @@ static void k_ascii(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_ base = 16; } - if (kbd->npadch == -1) + if (kbd->npadch == -1) { kbd->npadch = value; - else + } else { kbd->npadch = kbd->npadch * base + value; + } } static void k_lock(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) { - if (up_flag || kbd->rep) + if (up_flag || kbd->rep) { return; + } chg_vc_kbd_lock(kbd, value); } @@ -739,8 +870,9 @@ static void k_lock(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_f static void k_slock(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_flag) { k_shift(kbd, value, up_flag); - if (up_flag || kbd->rep) + if (up_flag || kbd->rep) { return; + } chg_vc_kbd_slock(kbd, value); /* try to make Alt, oops, AltGr and such work */ @@ -754,32 +886,41 @@ static void k_brl(SDL_EVDEV_keyboard_state *kbd, unsigned char value, char up_fl { } -void -SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int down) +void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down) { unsigned char shift_final; unsigned char type; unsigned short *key_map; unsigned short keysym; - if (!kbd) { + if (!state) { return; } - kbd->rep = (down == 2); + state->rep = (down == 2); - shift_final = (kbd->shift_state | kbd->slockstate) ^ kbd->lockstate; - key_map = kbd->key_maps[shift_final]; + shift_final = (state->shift_state | state->slockstate) ^ state->lockstate; + key_map = state->key_maps[shift_final]; if (!key_map) { /* Unsupported shift state (e.g. ctrl = 4, alt = 8), just reset to the default state */ - kbd->shift_state = 0; - kbd->slockstate = 0; - kbd->lockstate = 0; + state->shift_state = 0; + state->slockstate = 0; + state->lockstate = 0; return; } if (keycode < NR_KEYS) { - keysym = key_map[keycode]; + if (state->console_fd < 0) { + keysym = key_map[keycode]; + } else { + struct kbentry kbe; + kbe.kb_table = shift_final; + kbe.kb_index = keycode; + if (ioctl(state->console_fd, KDGKBENT, &kbe) == 0) + keysym = (kbe.kb_value ^ 0xf000); + else + return; + } } else { return; } @@ -788,7 +929,7 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d if (type < 0xf0) { if (down) { - put_utf8(kbd, keysym); + put_utf8(state, keysym); } } else { type -= 0xf0; @@ -797,43 +938,61 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d if (type == KT_LETTER) { type = KT_LATIN; - if (vc_kbd_led(kbd, K_CAPSLOCK)) { - key_map = kbd->key_maps[shift_final ^ (1 << KG_SHIFT)]; + if (vc_kbd_led(state, K_CAPSLOCK)) { + shift_final = shift_final ^ (1 << KG_SHIFT); + key_map = state->key_maps[shift_final]; if (key_map) { - keysym = key_map[keycode]; + if (state->console_fd < 0) { + keysym = key_map[keycode]; + } else { + struct kbentry kbe; + kbe.kb_table = shift_final; + kbe.kb_index = keycode; + if (ioctl(state->console_fd, KDGKBENT, &kbe) == 0) + keysym = (kbe.kb_value ^ 0xf000); + } } } } - (*k_handler[type])(kbd, keysym & 0xff, !down); + (*k_handler[type])(state, keysym & 0xff, !down); if (type != KT_SLOCK) { - kbd->slockstate = 0; + state->slockstate = 0; } } - if (kbd->text_len > 0) { - kbd->text[kbd->text_len] = '\0'; - SDL_SendKeyboardText(kbd->text); - kbd->text_len = 0; + if (state->text_len > 0) { + state->text[state->text_len] = '\0'; + SDL_SendKeyboardText(state->text); + state->text_len = 0; } } #elif !defined(SDL_INPUT_FBSDKBIO) /* !SDL_INPUT_LINUXKD */ -SDL_EVDEV_keyboard_state * -SDL_EVDEV_kbd_init(void) +SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void) { return NULL; } -void -SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down) +void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted) +{ +} + +void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data) +{ +} + +void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state) +{ +} + +void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down) { } -void -SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state) +void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state) { } diff --git a/src/core/linux/SDL_evdev_kbd.h b/src/core/linux/SDL_evdev_kbd.h index 9511838cc71a6..ffc7a3d9fad7d 100644 --- a/src/core/linux/SDL_evdev_kbd.h +++ b/src/core/linux/SDL_evdev_kbd.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,6 +26,9 @@ struct SDL_EVDEV_keyboard_state; typedef struct SDL_EVDEV_keyboard_state SDL_EVDEV_keyboard_state; extern SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void); +extern void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted); +extern void SDL_EVDEV_kbd_set_vt_switch_callbacks(SDL_EVDEV_keyboard_state *state, void (*release_callback)(void*), void *release_callback_data, void (*acquire_callback)(void*), void *acquire_callback_data); +extern void SDL_EVDEV_kbd_update(SDL_EVDEV_keyboard_state *state); extern void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode, int down); extern void SDL_EVDEV_kbd_quit(SDL_EVDEV_keyboard_state *state); diff --git a/src/core/linux/SDL_evdev_kbd_default_accents.h b/src/core/linux/SDL_evdev_kbd_default_accents.h index 6ac0895062729..fd1fe6f033b95 100644 --- a/src/core/linux/SDL_evdev_kbd_default_accents.h +++ b/src/core/linux/SDL_evdev_kbd_default_accents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/linux/SDL_evdev_kbd_default_keymap.h b/src/core/linux/SDL_evdev_kbd_default_keymap.h index 30affb0b242e3..35f7ebfc9345c 100644 --- a/src/core/linux/SDL_evdev_kbd_default_keymap.h +++ b/src/core/linux/SDL_evdev_kbd_default_keymap.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,6 +19,8 @@ 3. This notice may not be removed or altered from any source distribution. */ +/* *INDENT-OFF* */ /* clang-format off */ + static unsigned short default_key_map_0[NR_KEYS] = { 0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf07f, 0xf009, @@ -4374,6 +4376,8 @@ static unsigned short default_key_map_127[NR_KEYS] = { }; #endif /* INCLUDE_EXTENDED_KEYMAP */ +/* *INDENT-ON* */ /* clang-format on */ + static unsigned short *default_key_maps[MAX_NR_KEYMAPS] = { default_key_map_0, default_key_map_1, @@ -4504,7 +4508,7 @@ static unsigned short *default_key_maps[MAX_NR_KEYMAPS] = { default_key_map_125, default_key_map_126, default_key_map_127, -#else /* !INCLUDE_EXTENDED_KEYMAP */ +#else /* !INCLUDE_EXTENDED_KEYMAP */ NULL, NULL, NULL, diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index f653279d71eb4..23dcc28c43470 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include "../../events/SDL_keyboard_c.h" #include "SDL_dbus.h" #include "SDL_syswm.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 # include "../../video/x11/SDL_x11video.h" #endif #include "SDL_hints.h" @@ -55,8 +55,7 @@ typedef struct _FcitxClient static FcitxClient fcitx_client; -static char* -GetAppName() +static char *GetAppName(void) { #if defined(__LINUX__) || defined(__FREEBSD__) char *spot; @@ -65,9 +64,9 @@ GetAppName() int linksize; #if defined(__LINUX__) - SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/exe", getpid()); + (void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/exe", getpid()); #elif defined(__FREEBSD__) - SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/file", getpid()); + (void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/file", getpid()); #endif linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1); if (linksize > 0) { @@ -84,12 +83,11 @@ GetAppName() return SDL_strdup("SDL_App"); } -static size_t -Fcitx_GetPreeditString(SDL_DBusContext *dbus, - DBusMessage *msg, - char **ret, - Sint32 *start_pos, - Sint32 *end_pos) +static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus, + DBusMessage *msg, + char **ret, + Sint32 *start_pos, + Sint32 *end_pos) { char *text = NULL, *subtext; size_t text_bytes = 0; @@ -141,7 +139,7 @@ Fcitx_GetPreeditString(SDL_DBusContext *dbus, } if (text) { - char* pivot = text; + char *pivot = text; /* Second pass: join all the sub string */ dbus->message_iter_recurse(&iter, &array); while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) { @@ -167,8 +165,7 @@ Fcitx_GetPreeditString(SDL_DBusContext *dbus, return text_bytes; } -static Sint32 -Fcitx_GetPreeditCursorByte(SDL_DBusContext *dbus, DBusMessage *msg) +static Sint32 Fcitx_GetPreeditCursorByte(SDL_DBusContext *dbus, DBusMessage *msg) { Sint32 byte = -1; DBusMessageIter iter; @@ -186,8 +183,7 @@ Fcitx_GetPreeditCursorByte(SDL_DBusContext *dbus, DBusMessage *msg) return byte; } -static DBusHandlerResult -DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) +static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) { SDL_DBusContext *dbus = (SDL_DBusContext *)data; @@ -203,7 +199,7 @@ DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) size_t text_bytes = SDL_strlen(text), i = 0; while (i < text_bytes) { - size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); + size_t sz = SDL_utf8strlcpy(buf, text + i, sizeof(buf)); SDL_SendKeyboardText(buf); i += sz; @@ -250,8 +246,7 @@ DBus_MessageFilter(DBusConnection *conn, DBusMessage *msg, void *data) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -static void -FcitxClientICCallMethod(FcitxClient *client, const char *method) +static void FcitxClientICCallMethod(FcitxClient *client, const char *method) { if (!client->ic_path) { return; @@ -259,11 +254,10 @@ FcitxClientICCallMethod(FcitxClient *client, const char *method) SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, client->ic_path, FCITX_IC_DBUS_INTERFACE, method, DBUS_TYPE_INVALID); } -static void SDLCALL -Fcitx_SetCapabilities(void *data, - const char *name, - const char *old_val, - const char *internal_editing) +static void SDLCALL Fcitx_SetCapabilities(void *data, + const char *name, + const char *old_val, + const char *internal_editing) { FcitxClient *client = (FcitxClient *)data; Uint64 caps = 0; @@ -279,11 +273,12 @@ Fcitx_SetCapabilities(void *data, SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, client->ic_path, FCITX_IC_DBUS_INTERFACE, "SetCapability", DBUS_TYPE_UINT64, &caps, DBUS_TYPE_INVALID); } -static SDL_bool -FcitxCreateInputContext(SDL_DBusContext* dbus, const char *appname, char **ic_path) { +static SDL_bool FcitxCreateInputContext(SDL_DBusContext *dbus, const char *appname, char **ic_path) +{ const char *program = "program"; SDL_bool retval = SDL_FALSE; - if (dbus->session_conn) { + + if (dbus && dbus->session_conn) { DBusMessage *msg = dbus->message_new_method_call(FCITX_DBUS_SERVICE, FCITX_IM_DBUS_PATH, FCITX_IM_DBUS_INTERFACE, "CreateInputContext"); if (msg) { DBusMessage *reply = NULL; @@ -308,8 +303,7 @@ FcitxCreateInputContext(SDL_DBusContext* dbus, const char *appname, char **ic_pa return retval; } -static SDL_bool -FcitxClientCreateIC(FcitxClient *client) +static SDL_bool FcitxClientCreateIC(FcitxClient *client) { char *appname = GetAppName(); char *ic_path = NULL; @@ -317,7 +311,7 @@ FcitxClientCreateIC(FcitxClient *client) /* SDL_DBus_CallMethod cannot handle a(ss) type, call dbus function directly */ if (!FcitxCreateInputContext(dbus, appname, &ic_path)) { - ic_path = NULL; /* just in case. */ + ic_path = NULL; /* just in case. */ } SDL_free(appname); @@ -327,11 +321,11 @@ FcitxClientCreateIC(FcitxClient *client) client->ic_path = SDL_strdup(ic_path); dbus->bus_add_match(dbus->session_conn, - "type='signal', interface='org.fcitx.Fcitx.InputContext1'", - NULL); + "type='signal', interface='org.fcitx.Fcitx.InputContext1'", + NULL); dbus->connection_add_filter(dbus->session_conn, - &DBus_MessageFilter, dbus, - NULL); + &DBus_MessageFilter, dbus, + NULL); dbus->connection_flush(dbus->session_conn); SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, Fcitx_SetCapabilities, client); @@ -341,26 +335,40 @@ FcitxClientCreateIC(FcitxClient *client) return SDL_FALSE; } -static Uint32 -Fcitx_ModState(void) +static Uint32 Fcitx_ModState(void) { Uint32 fcitx_mods = 0; SDL_Keymod sdl_mods = SDL_GetModState(); - if (sdl_mods & KMOD_SHIFT) fcitx_mods |= (1 << 0); - if (sdl_mods & KMOD_CAPS) fcitx_mods |= (1 << 1); - if (sdl_mods & KMOD_CTRL) fcitx_mods |= (1 << 2); - if (sdl_mods & KMOD_ALT) fcitx_mods |= (1 << 3); - if (sdl_mods & KMOD_NUM) fcitx_mods |= (1 << 4); - if (sdl_mods & KMOD_MODE) fcitx_mods |= (1 << 7); - if (sdl_mods & KMOD_LGUI) fcitx_mods |= (1 << 6); - if (sdl_mods & KMOD_RGUI) fcitx_mods |= (1 << 28); + if (sdl_mods & KMOD_SHIFT) { + fcitx_mods |= (1 << 0); + } + if (sdl_mods & KMOD_CAPS) { + fcitx_mods |= (1 << 1); + } + if (sdl_mods & KMOD_CTRL) { + fcitx_mods |= (1 << 2); + } + if (sdl_mods & KMOD_ALT) { + fcitx_mods |= (1 << 3); + } + if (sdl_mods & KMOD_NUM) { + fcitx_mods |= (1 << 4); + } + if (sdl_mods & KMOD_MODE) { + fcitx_mods |= (1 << 7); + } + if (sdl_mods & KMOD_LGUI) { + fcitx_mods |= (1 << 6); + } + if (sdl_mods & KMOD_RGUI) { + fcitx_mods |= (1 << 28); + } return fcitx_mods; } -SDL_bool -SDL_Fcitx_Init() +SDL_bool SDL_Fcitx_Init(void) { fcitx_client.dbus = SDL_DBus_GetContext(); @@ -372,8 +380,7 @@ SDL_Fcitx_Init() return FcitxClientCreateIC(&fcitx_client); } -void -SDL_Fcitx_Quit() +void SDL_Fcitx_Quit(void) { FcitxClientICCallMethod(&fcitx_client, "DestroyIC"); if (fcitx_client.ic_path) { @@ -382,8 +389,7 @@ SDL_Fcitx_Quit() } } -void -SDL_Fcitx_SetFocus(SDL_bool focused) +void SDL_Fcitx_SetFocus(SDL_bool focused) { if (focused) { FcitxClientICCallMethod(&fcitx_client, "FocusIn"); @@ -392,15 +398,12 @@ SDL_Fcitx_SetFocus(SDL_bool focused) } } -void -SDL_Fcitx_Reset(void) +void SDL_Fcitx_Reset(void) { FcitxClientICCallMethod(&fcitx_client, "Reset"); - FcitxClientICCallMethod(&fcitx_client, "CloseIC"); } -SDL_bool -SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) { Uint32 mod_state = Fcitx_ModState(); Uint32 handled = SDL_FALSE; @@ -412,8 +415,8 @@ SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) } if (SDL_DBus_CallMethod(FCITX_DBUS_SERVICE, fcitx_client.ic_path, FCITX_IC_DBUS_INTERFACE, "ProcessKeyEvent", - DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID, - DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) { + DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID, + DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) { if (handled) { SDL_Fcitx_UpdateTextRect(NULL); return SDL_TRUE; @@ -423,8 +426,7 @@ SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) return SDL_FALSE; } -void -SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) +void SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) { SDL_Window *focused_win = NULL; SDL_SysWMinfo info; @@ -437,7 +439,7 @@ SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) focused_win = SDL_GetKeyboardFocus(); if (!focused_win) { - return ; + return; } SDL_VERSION(&info.version); @@ -447,7 +449,7 @@ SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) SDL_GetWindowPosition(focused_win, &x, &y); -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 if (info.subsystem == SDL_SYSWM_X11) { SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata; @@ -471,11 +473,10 @@ SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) y += cursor->y; SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, fcitx_client.ic_path, FCITX_IC_DBUS_INTERFACE, "SetCursorRect", - DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &cursor->w, DBUS_TYPE_INT32, &cursor->h, DBUS_TYPE_INVALID); + DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &cursor->w, DBUS_TYPE_INT32, &cursor->h, DBUS_TYPE_INVALID); } -void -SDL_Fcitx_PumpEvents(void) +void SDL_Fcitx_PumpEvents(void) { SDL_DBusContext *dbus = fcitx_client.dbus; DBusConnection *conn = dbus->session_conn; @@ -484,7 +485,6 @@ SDL_Fcitx_PumpEvents(void) while (dbus->connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS) { /* Do nothing, actual work happens in DBus_MessageFilter */ - usleep(10); } } diff --git a/src/core/linux/SDL_fcitx.h b/src/core/linux/SDL_fcitx.h index 567ddceb550aa..7aaf1f6f6aaa0 100644 --- a/src/core/linux/SDL_fcitx.h +++ b/src/core/linux/SDL_fcitx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 94f7aa626d6d1..83e322747a91f 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ #include "../../video/SDL_sysvideo.h" #include "../../events/SDL_keyboard_c.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "../../video/x11/SDL_x11video.h" #endif @@ -37,14 +37,14 @@ #include #include -static const char IBUS_PATH[] = "/org/freedesktop/IBus"; +static const char IBUS_PATH[] = "/org/freedesktop/IBus"; -static const char IBUS_SERVICE[] = "org.freedesktop.IBus"; -static const char IBUS_INTERFACE[] = "org.freedesktop.IBus"; +static const char IBUS_SERVICE[] = "org.freedesktop.IBus"; +static const char IBUS_INTERFACE[] = "org.freedesktop.IBus"; static const char IBUS_INPUT_INTERFACE[] = "org.freedesktop.IBus.InputContext"; -static const char IBUS_PORTAL_SERVICE[] = "org.freedesktop.portal.IBus"; -static const char IBUS_PORTAL_INTERFACE[] = "org.freedesktop.IBus.Portal"; +static const char IBUS_PORTAL_SERVICE[] = "org.freedesktop.portal.IBus"; +static const char IBUS_PORTAL_INTERFACE[] = "org.freedesktop.IBus.Portal"; static const char IBUS_PORTAL_INPUT_INTERFACE[] = "org.freedesktop.IBus.InputContext"; static const char *ibus_service = NULL; @@ -57,29 +57,42 @@ static SDL_bool ibus_is_portal_interface = SDL_FALSE; static char *ibus_addr_file = NULL; static int inotify_fd = -1, inotify_wd = -1; - -static Uint32 -IBus_ModState(void) +static Uint32 IBus_ModState(void) { Uint32 ibus_mods = 0; SDL_Keymod sdl_mods = SDL_GetModState(); - + /* Not sure about MOD3, MOD4 and HYPER mappings */ - if (sdl_mods & KMOD_LSHIFT) ibus_mods |= IBUS_SHIFT_MASK; - if (sdl_mods & KMOD_CAPS) ibus_mods |= IBUS_LOCK_MASK; - if (sdl_mods & KMOD_LCTRL) ibus_mods |= IBUS_CONTROL_MASK; - if (sdl_mods & KMOD_LALT) ibus_mods |= IBUS_MOD1_MASK; - if (sdl_mods & KMOD_NUM) ibus_mods |= IBUS_MOD2_MASK; - if (sdl_mods & KMOD_MODE) ibus_mods |= IBUS_MOD5_MASK; - if (sdl_mods & KMOD_LGUI) ibus_mods |= IBUS_SUPER_MASK; - if (sdl_mods & KMOD_RGUI) ibus_mods |= IBUS_META_MASK; + if (sdl_mods & KMOD_LSHIFT) { + ibus_mods |= IBUS_SHIFT_MASK; + } + if (sdl_mods & KMOD_CAPS) { + ibus_mods |= IBUS_LOCK_MASK; + } + if (sdl_mods & KMOD_LCTRL) { + ibus_mods |= IBUS_CONTROL_MASK; + } + if (sdl_mods & KMOD_LALT) { + ibus_mods |= IBUS_MOD1_MASK; + } + if (sdl_mods & KMOD_NUM) { + ibus_mods |= IBUS_MOD2_MASK; + } + if (sdl_mods & KMOD_MODE) { + ibus_mods |= IBUS_MOD5_MASK; + } + if (sdl_mods & KMOD_LGUI) { + ibus_mods |= IBUS_SUPER_MASK; + } + if (sdl_mods & KMOD_RGUI) { + ibus_mods |= IBUS_META_MASK; + } return ibus_mods; } -static SDL_bool -IBus_EnterVariant(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, - DBusMessageIter *inside, const char * struct_id, size_t id_size) +static SDL_bool IBus_EnterVariant(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, + DBusMessageIter *inside, const char *struct_id, size_t id_size) { DBusMessageIter sub; if (dbus->message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT) { @@ -105,9 +118,8 @@ IBus_EnterVariant(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext * return SDL_TRUE; } -static SDL_bool -IBus_GetDecorationPosition(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, - Uint32 *start_pos, Uint32 *end_pos) +static SDL_bool IBus_GetDecorationPosition(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, + Uint32 *start_pos, Uint32 *end_pos) { DBusMessageIter sub1, sub2, array; @@ -170,8 +182,7 @@ IBus_GetDecorationPosition(DBusConnection *conn, DBusMessageIter *iter, SDL_DBus return SDL_FALSE; } -static const char * -IBus_GetVariantText(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus) +static const char *IBus_GetVariantText(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus) { /* The text we need is nested weirdly, use dbus-monitor to see the structure better */ const char *text = NULL; @@ -192,9 +203,8 @@ IBus_GetVariantText(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext return text; } -static SDL_bool -IBus_GetVariantCursorPos(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, - Uint32 *pos) +static SDL_bool IBus_GetVariantCursorPos(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusContext *dbus, + Uint32 *pos) { dbus->message_iter_next(iter); @@ -207,8 +217,7 @@ IBus_GetVariantCursorPos(DBusConnection *conn, DBusMessageIter *iter, SDL_DBusCo return SDL_TRUE; } -static DBusHandlerResult -IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) +static DBusHandlerResult IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) { SDL_DBusContext *dbus = (SDL_DBusContext *)user_data; @@ -224,7 +233,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) size_t text_bytes = SDL_strlen(text), i = 0; while (i < text_bytes) { - size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); + size_t sz = SDL_utf8strlcpy(buf, text + i, sizeof(buf)); SDL_SendKeyboardText(buf); i += sz; @@ -249,13 +258,12 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) dbus->message_iter_init(msg, &iter); has_dec_pos = IBus_GetDecorationPosition(conn, &iter, dbus, &start_pos, &end_pos); - if (!has_dec_pos) - { + if (!has_dec_pos) { dbus->message_iter_init(msg, &iter); has_pos = IBus_GetVariantCursorPos(conn, &iter, dbus, &pos); } - if(has_dec_pos) { + if (has_dec_pos) { SDL_SendEditingText(text, start_pos, end_pos - start_pos); } else if (has_pos) { SDL_SendEditingText(text, pos, -1); @@ -268,7 +276,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) size_t cursor = 0; do { - const size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); + const size_t sz = SDL_utf8strlcpy(buf, text + i, sizeof(buf)); const size_t chars = SDL_utf8strlen(buf); SDL_SendEditingText(buf, cursor, chars); @@ -291,8 +299,7 @@ IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } -static char * -IBus_ReadAddressFromFile(const char *file_path) +static char *IBus_ReadAddressFromFile(const char *file_path) { char addr_buf[1024]; SDL_bool success = SDL_FALSE; @@ -304,16 +311,20 @@ IBus_ReadAddressFromFile(const char *file_path) } while (fgets(addr_buf, sizeof(addr_buf), addr_file)) { - if (SDL_strncmp(addr_buf, "IBUS_ADDRESS=", sizeof("IBUS_ADDRESS=")-1) == 0) { + if (SDL_strncmp(addr_buf, "IBUS_ADDRESS=", sizeof("IBUS_ADDRESS=") - 1) == 0) { size_t sz = SDL_strlen(addr_buf); - if (addr_buf[sz-1] == '\n') addr_buf[sz-1] = 0; - if (addr_buf[sz-2] == '\r') addr_buf[sz-2] = 0; + if (addr_buf[sz - 1] == '\n') { + addr_buf[sz - 1] = 0; + } + if (addr_buf[sz - 2] == '\r') { + addr_buf[sz - 2] = 0; + } success = SDL_TRUE; break; } } - fclose(addr_file); + (void)fclose(addr_file); if (success) { return SDL_strdup(addr_buf + (sizeof("IBUS_ADDRESS=") - 1)); @@ -322,8 +333,7 @@ IBus_ReadAddressFromFile(const char *file_path) } } -static char * -IBus_GetDBusAddressFilename(void) +static char *IBus_GetDBusAddressFilename(void) { SDL_DBusContext *dbus; const char *disp_env; @@ -339,18 +349,18 @@ IBus_GetDBusAddressFilename(void) if (ibus_addr_file) { return SDL_strdup(ibus_addr_file); } - + dbus = SDL_DBus_GetContext(); if (!dbus) { return NULL; } - + /* Use this environment variable if it exists. */ addr = SDL_getenv("IBUS_ADDRESS"); if (addr && *addr) { return SDL_strdup(addr); } - + /* Otherwise, we have to get the hostname, display, machine id, config dir and look up the address from a filepath using all those bits, eek. */ disp_env = SDL_getenv("DISPLAY"); @@ -360,34 +370,34 @@ IBus_GetDBusAddressFilename(void) } else { display = SDL_strdup(disp_env); } - + host = display; - disp_num = SDL_strrchr(display, ':'); + disp_num = SDL_strrchr(display, ':'); screen_num = SDL_strrchr(display, '.'); - + if (!disp_num) { SDL_free(display); return NULL; } - + *disp_num = 0; disp_num++; - + if (screen_num) { *screen_num = 0; } - + if (!*host) { const char *session = SDL_getenv("XDG_SESSION_TYPE"); - if (session != NULL && SDL_strcmp(session, "wayland") == 0) { + if (session && SDL_strcmp(session, "wayland") == 0) { host = "unix-wayland"; } else { host = "unix"; } } - + SDL_memset(config_dir, 0, sizeof(config_dir)); - + conf_env = SDL_getenv("XDG_CONFIG_HOME"); if (conf_env && *conf_env) { SDL_strlcpy(config_dir, conf_env, sizeof(config_dir)); @@ -397,28 +407,32 @@ IBus_GetDBusAddressFilename(void) SDL_free(display); return NULL; } - SDL_snprintf(config_dir, sizeof(config_dir), "%s/.config", home_env); + (void)SDL_snprintf(config_dir, sizeof(config_dir), "%s/.config", home_env); + } + + key = SDL_DBus_GetLocalMachineId(); + + if (!key) { + SDL_free(display); + return NULL; } - - key = dbus->get_local_machine_id(); SDL_memset(file_path, 0, sizeof(file_path)); - SDL_snprintf(file_path, sizeof(file_path), "%s/ibus/bus/%s-%s-%s", - config_dir, key, host, disp_num); + (void)SDL_snprintf(file_path, sizeof(file_path), "%s/ibus/bus/%s-%s-%s", + config_dir, key, host, disp_num); dbus->free(key); SDL_free(display); - + return SDL_strdup(file_path); } static SDL_bool IBus_CheckConnection(SDL_DBusContext *dbus); -static void SDLCALL -IBus_SetCapabilities(void *data, const char *name, const char *old_val, - const char *internal_editing) +static void SDLCALL IBus_SetCapabilities(void *data, const char *name, const char *old_val, + const char *internal_editing) { SDL_DBusContext *dbus = SDL_DBus_GetContext(); - + if (IBus_CheckConnection(dbus)) { Uint32 caps = IBUS_CAP_FOCUS; if (!(internal_editing && *internal_editing == '1')) { @@ -426,19 +440,17 @@ IBus_SetCapabilities(void *data, const char *name, const char *old_val, } SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCapabilities", - DBUS_TYPE_UINT32, &caps, DBUS_TYPE_INVALID); + DBUS_TYPE_UINT32, &caps, DBUS_TYPE_INVALID); } } - -static SDL_bool -IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) +static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr) { const char *client_name = "SDL2_Application"; const char *path = NULL; SDL_bool result = SDL_FALSE; DBusObjectPathVTable ibus_vtable; - + SDL_zero(ibus_vtable); ibus_vtable.message_function = &IBus_MessageHandler; @@ -462,26 +474,29 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) ibus_conn = dbus->connection_open_private(addr, NULL); if (!ibus_conn) { - return SDL_FALSE; /* oh well. */ + return SDL_FALSE; /* oh well. */ } dbus->connection_flush(ibus_conn); - + if (!dbus->bus_register(ibus_conn, NULL)) { ibus_conn = NULL; return SDL_FALSE; } - + dbus->connection_flush(ibus_conn); result = SDL_DBus_CallMethodOnConnection(ibus_conn, ibus_service, IBUS_PATH, ibus_interface, "CreateInputContext", DBUS_TYPE_STRING, &client_name, DBUS_TYPE_INVALID, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); + } else { + /* re-using dbus->session_conn */ + dbus->connection_ref(ibus_conn); } if (result) { char matchstr[128]; - SDL_snprintf(matchstr, sizeof (matchstr), "type='signal',interface='%s'", ibus_input_interface); + (void)SDL_snprintf(matchstr, sizeof(matchstr), "type='signal',interface='%s'", ibus_input_interface); SDL_free(input_ctx_path); input_ctx_path = SDL_strdup(path); SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); @@ -492,42 +507,45 @@ IBus_SetupConnection(SDL_DBusContext *dbus, const char* addr) SDL_IBus_SetFocus(SDL_GetKeyboardFocus() != NULL); SDL_IBus_UpdateTextRect(NULL); - + return result; } -static SDL_bool -IBus_CheckConnection(SDL_DBusContext *dbus) +static SDL_bool IBus_CheckConnection(SDL_DBusContext *dbus) { - if (!dbus) return SDL_FALSE; - + if (!dbus) { + return SDL_FALSE; + } + if (ibus_conn && dbus->connection_get_is_connected(ibus_conn)) { return SDL_TRUE; } - + if (inotify_fd > 0 && inotify_wd > 0) { char buf[1024]; ssize_t readsize = read(inotify_fd, buf, sizeof(buf)); if (readsize > 0) { - + char *p; SDL_bool file_updated = SDL_FALSE; - + for (p = buf; p < buf + readsize; /**/) { - struct inotify_event *event = (struct inotify_event*) p; + struct inotify_event *event = (struct inotify_event *)p; if (event->len > 0) { char *addr_file_no_path = SDL_strrchr(ibus_addr_file, '/'); - if (!addr_file_no_path) return SDL_FALSE; - + if (!addr_file_no_path) { + return SDL_FALSE; + } + if (SDL_strcmp(addr_file_no_path + 1, event->name) == 0) { file_updated = SDL_TRUE; break; } } - + p += sizeof(struct inotify_event) + event->len; } - + if (file_updated) { char *addr = IBus_ReadAddressFromFile(ibus_addr_file); if (addr) { @@ -538,16 +556,15 @@ IBus_CheckConnection(SDL_DBusContext *dbus) } } } - + return SDL_FALSE; } -SDL_bool -SDL_IBus_Init(void) +SDL_bool SDL_IBus_Init(void) { SDL_bool result = SDL_FALSE; SDL_DBusContext *dbus = SDL_DBus_GetContext(); - + if (dbus) { char *addr_file = IBus_GetDBusAddressFilename(); char *addr; @@ -556,29 +573,31 @@ SDL_IBus_Init(void) if (!addr_file) { return SDL_FALSE; } - - /* !!! FIXME: if ibus_addr_file != NULL, this will overwrite it and leak (twice!) */ - ibus_addr_file = SDL_strdup(addr_file); - + addr = IBus_ReadAddressFromFile(addr_file); if (!addr) { SDL_free(addr_file); return SDL_FALSE; } - + + if (ibus_addr_file) { + SDL_free(ibus_addr_file); + } + ibus_addr_file = SDL_strdup(addr_file); + if (inotify_fd < 0) { inotify_fd = inotify_init(); fcntl(inotify_fd, F_SETFL, O_NONBLOCK); } - + addr_file_dir = SDL_strrchr(addr_file, '/'); if (addr_file_dir) { *addr_file_dir = 0; } - + inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY); SDL_free(addr_file); - + result = IBus_SetupConnection(dbus, addr); SDL_free(addr); @@ -594,27 +613,26 @@ SDL_IBus_Init(void) } } } - + return result; } -void -SDL_IBus_Quit(void) -{ +void SDL_IBus_Quit(void) +{ SDL_DBusContext *dbus; if (input_ctx_path) { SDL_free(input_ctx_path); input_ctx_path = NULL; } - + if (ibus_addr_file) { SDL_free(ibus_addr_file); ibus_addr_file = NULL; } - + dbus = SDL_DBus_GetContext(); - + /* if using portal, ibus_conn == session_conn; don't release it here. */ if (dbus && ibus_conn && !ibus_is_portal_interface) { dbus->connection_close(ibus_conn); @@ -635,40 +653,35 @@ SDL_IBus_Quit(void) /* !!! FIXME: should we close(inotify_fd) here? */ SDL_DelHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); - + SDL_memset(&ibus_cursor_rect, 0, sizeof(ibus_cursor_rect)); } -static void -IBus_SimpleMessage(const char *method) -{ +static void IBus_SimpleMessage(const char *method) +{ SDL_DBusContext *dbus = SDL_DBus_GetContext(); - - if ((input_ctx_path != NULL) && (IBus_CheckConnection(dbus))) { + + if ((input_ctx_path) && (IBus_CheckConnection(dbus))) { SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, method, DBUS_TYPE_INVALID); } } -void -SDL_IBus_SetFocus(SDL_bool focused) -{ +void SDL_IBus_SetFocus(SDL_bool focused) +{ const char *method = focused ? "FocusIn" : "FocusOut"; IBus_SimpleMessage(method); } -void -SDL_IBus_Reset(void) +void SDL_IBus_Reset(void) { IBus_SimpleMessage("Reset"); } -SDL_bool -SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) -{ +SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +{ Uint32 result = 0; SDL_DBusContext *dbus = SDL_DBus_GetContext(); - if (IBus_CheckConnection(dbus)) { Uint32 mods = IBus_ModState(); Uint32 ibus_keycode = keycode - 8; @@ -676,19 +689,18 @@ SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) mods |= (1 << 30); // IBUS_RELEASE_MASK } if (!SDL_DBus_CallMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "ProcessKeyEvent", - DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &ibus_keycode, DBUS_TYPE_UINT32, &mods, DBUS_TYPE_INVALID, - DBUS_TYPE_BOOLEAN, &result, DBUS_TYPE_INVALID)) { + DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &ibus_keycode, DBUS_TYPE_UINT32, &mods, DBUS_TYPE_INVALID, + DBUS_TYPE_BOOLEAN, &result, DBUS_TYPE_INVALID)) { result = 0; } } - + SDL_IBus_UpdateTextRect(NULL); return result ? SDL_TRUE : SDL_FALSE; } -void -SDL_IBus_UpdateTextRect(const SDL_Rect *rect) +void SDL_IBus_UpdateTextRect(const SDL_Rect *rect) { SDL_Window *focused_win; SDL_SysWMinfo info; @@ -710,39 +722,38 @@ SDL_IBus_UpdateTextRect(const SDL_Rect *rect) } SDL_GetWindowPosition(focused_win, &x, &y); - -#if SDL_VIDEO_DRIVER_X11 + +#ifdef SDL_VIDEO_DRIVER_X11 if (info.subsystem == SDL_SYSWM_X11) { SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata; - + Display *x_disp = info.info.x11.display; Window x_win = info.info.x11.window; int x_screen = displaydata->screen; Window unused; - + X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused); } #endif x += ibus_cursor_rect.x; y += ibus_cursor_rect.y; - + dbus = SDL_DBus_GetContext(); - + if (IBus_CheckConnection(dbus)) { SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCursorLocation", - DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &ibus_cursor_rect.w, DBUS_TYPE_INT32, &ibus_cursor_rect.h, DBUS_TYPE_INVALID); + DBUS_TYPE_INT32, &x, DBUS_TYPE_INT32, &y, DBUS_TYPE_INT32, &ibus_cursor_rect.w, DBUS_TYPE_INT32, &ibus_cursor_rect.h, DBUS_TYPE_INVALID); } } -void -SDL_IBus_PumpEvents(void) +void SDL_IBus_PumpEvents(void) { SDL_DBusContext *dbus = SDL_DBus_GetContext(); - + if (IBus_CheckConnection(dbus)) { dbus->connection_read_write(ibus_conn, 0); - + while (dbus->connection_dispatch(ibus_conn) == DBUS_DISPATCH_DATA_REMAINS) { /* Do nothing, actual work happens in IBus_MessageHandler */ } diff --git a/src/core/linux/SDL_ibus.h b/src/core/linux/SDL_ibus.h index 7c0bd8da77b7e..f6ec1b2f35bd0 100644 --- a/src/core/linux/SDL_ibus.h +++ b/src/core/linux/SDL_ibus.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -43,11 +43,11 @@ extern void SDL_IBus_Reset(void); called some time after this, to receive the TextInput / TextEditing event back. */ extern SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state); -/* Update the position of IBus' candidate list. If rect is NULL then this will +/* Update the position of IBus' candidate list. If rect is NULL then this will just reposition it relative to the focused window's new position. */ extern void SDL_IBus_UpdateTextRect(const SDL_Rect *window_relative_rect); -/* Checks DBus for new IBus events, and calls SDL_SendKeyboardText / +/* Checks DBus for new IBus events, and calls SDL_SendKeyboardText / SDL_SendEditingText for each event it finds */ extern void SDL_IBus_PumpEvents(void); diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c index 3ad4dbf434545..4540621772543 100644 --- a/src/core/linux/SDL_ime.c +++ b/src/core/linux/SDL_ime.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,8 +40,7 @@ static _SDL_IME_ProcessKeyEvent SDL_IME_ProcessKeyEvent_Real = NULL; static _SDL_IME_UpdateTextRect SDL_IME_UpdateTextRect_Real = NULL; static _SDL_IME_PumpEvents SDL_IME_PumpEvents_Real = NULL; -static void -InitIME() +static void InitIME(void) { static SDL_bool inited = SDL_FALSE; #ifdef HAVE_FCITX @@ -49,8 +48,9 @@ InitIME() const char *xmodifiers = SDL_getenv("XMODIFIERS"); #endif - if (inited == SDL_TRUE) + if (inited == SDL_TRUE) { return; + } inited = SDL_TRUE; @@ -83,8 +83,7 @@ InitIME() #endif /* HAVE_IBUS_IBUS_H */ } -SDL_bool -SDL_IME_Init(void) +SDL_bool SDL_IME_Init(void) { InitIME(); @@ -106,48 +105,48 @@ SDL_IME_Init(void) return SDL_FALSE; } -void -SDL_IME_Quit(void) +void SDL_IME_Quit(void) { - if (SDL_IME_Quit_Real) + if (SDL_IME_Quit_Real) { SDL_IME_Quit_Real(); + } } -void -SDL_IME_SetFocus(SDL_bool focused) +void SDL_IME_SetFocus(SDL_bool focused) { - if (SDL_IME_SetFocus_Real) + if (SDL_IME_SetFocus_Real) { SDL_IME_SetFocus_Real(focused); + } } -void -SDL_IME_Reset(void) +void SDL_IME_Reset(void) { - if (SDL_IME_Reset_Real) + if (SDL_IME_Reset_Real) { SDL_IME_Reset_Real(); + } } -SDL_bool -SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) +SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) { - if (SDL_IME_ProcessKeyEvent_Real) + if (SDL_IME_ProcessKeyEvent_Real) { return SDL_IME_ProcessKeyEvent_Real(keysym, keycode, state); + } return SDL_FALSE; } -void -SDL_IME_UpdateTextRect(const SDL_Rect *rect) +void SDL_IME_UpdateTextRect(const SDL_Rect *rect) { - if (SDL_IME_UpdateTextRect_Real) + if (SDL_IME_UpdateTextRect_Real) { SDL_IME_UpdateTextRect_Real(rect); + } } -void -SDL_IME_PumpEvents() +void SDL_IME_PumpEvents(void) { - if (SDL_IME_PumpEvents_Real) + if (SDL_IME_PumpEvents_Real) { SDL_IME_PumpEvents_Real(); + } } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_ime.h b/src/core/linux/SDL_ime.h index 23417f6f30586..0995ce5abe73c 100644 --- a/src/core/linux/SDL_ime.h +++ b/src/core/linux/SDL_ime.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/linux/SDL_sandbox.c b/src/core/linux/SDL_sandbox.c index 3987890ad4690..d4e036099c03a 100644 --- a/src/core/linux/SDL_sandbox.c +++ b/src/core/linux/SDL_sandbox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2022 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -33,13 +33,11 @@ SDL_Sandbox SDL_DetectSandbox(void) /* For Snap, we check multiple variables because they might be set for * unrelated reasons. This is the same thing WebKitGTK does. */ - if (SDL_getenv("SNAP") != NULL - && SDL_getenv("SNAP_NAME") != NULL - && SDL_getenv("SNAP_REVISION") != NULL) { + if (SDL_getenv("SNAP") != NULL && SDL_getenv("SNAP_NAME") != NULL && SDL_getenv("SNAP_REVISION") != NULL) { return SDL_SANDBOX_SNAP; } - if (access("/run/host/container-runtime", F_OK) == 0) { + if (access("/run/host/container-manager", F_OK) == 0) { return SDL_SANDBOX_UNKNOWN_CONTAINER; } diff --git a/src/core/linux/SDL_sandbox.h b/src/core/linux/SDL_sandbox.h index 22be6902579f1..dc2fd478e0e43 100644 --- a/src/core/linux/SDL_sandbox.h +++ b/src/core/linux/SDL_sandbox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2022 Collabora Ltd. This software is provided 'as-is', without any express or implied diff --git a/src/core/linux/SDL_threadprio.c b/src/core/linux/SDL_threadprio.c index 865b89cd9f667..fca203320971c 100644 --- a/src/core/linux/SDL_threadprio.c +++ b/src/core/linux/SDL_threadprio.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "SDL_stdinc.h" #include "SDL_thread.h" -#if !SDL_THREADS_DISABLED +#ifndef SDL_THREADS_DISABLED #include #include #include @@ -44,20 +44,20 @@ #include "SDL_dbus.h" -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS #include /* d-bus queries to org.freedesktop.RealtimeKit1. */ -#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1" -#define RTKIT_DBUS_PATH "/org/freedesktop/RealtimeKit1" +#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1" +#define RTKIT_DBUS_PATH "/org/freedesktop/RealtimeKit1" #define RTKIT_DBUS_INTERFACE "org.freedesktop.RealtimeKit1" /* d-bus queries to the XDG portal interface to RealtimeKit1 */ -#define XDG_PORTAL_DBUS_NODE "org.freedesktop.portal.Desktop" -#define XDG_PORTAL_DBUS_PATH "/org/freedesktop/portal/desktop" +#define XDG_PORTAL_DBUS_NODE "org.freedesktop.portal.Desktop" +#define XDG_PORTAL_DBUS_PATH "/org/freedesktop/portal/desktop" #define XDG_PORTAL_DBUS_INTERFACE "org.freedesktop.portal.Realtime" -static SDL_bool rtkit_use_session_conn; +static SDL_bool rtkit_use_session_conn; static const char *rtkit_dbus_node; static const char *rtkit_dbus_path; static const char *rtkit_dbus_interface; @@ -72,16 +72,14 @@ static Sint64 rtkit_max_rttime_usec = 200000; * - The desktop portal exists and supports the realtime interface. * - The realtime interface is new enough to have the required bug fixes applied. */ -static SDL_bool -realtime_portal_supported(DBusConnection *conn) +static SDL_bool realtime_portal_supported(DBusConnection *conn) { Sint64 res; return SDL_DBus_QueryPropertyOnConnection(conn, XDG_PORTAL_DBUS_NODE, XDG_PORTAL_DBUS_PATH, XDG_PORTAL_DBUS_INTERFACE, "RTTimeUSecMax", DBUS_TYPE_INT64, &res); } -static void -set_rtkit_interface() +static void set_rtkit_interface(void) { SDL_DBusContext *dbus = SDL_DBus_GetContext(); @@ -99,8 +97,7 @@ set_rtkit_interface() } } -static DBusConnection* -get_rtkit_dbus_connection() +static DBusConnection *get_rtkit_dbus_connection() { SDL_DBusContext *dbus = SDL_DBus_GetContext(); @@ -111,8 +108,7 @@ get_rtkit_dbus_connection() return NULL; } -static void -rtkit_initialize() +static void rtkit_initialize(void) { DBusConnection *dbus_conn; @@ -121,25 +117,24 @@ rtkit_initialize() /* Try getting minimum nice level: this is often greater than PRIO_MIN (-20). */ if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MinNiceLevel", - DBUS_TYPE_INT32, &rtkit_min_nice_level)) { + DBUS_TYPE_INT32, &rtkit_min_nice_level)) { rtkit_min_nice_level = -20; } /* Try getting maximum realtime priority: this can be less than the POSIX default (99). */ if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MaxRealtimePriority", - DBUS_TYPE_INT32, &rtkit_max_realtime_priority)) { + DBUS_TYPE_INT32, &rtkit_max_realtime_priority)) { rtkit_max_realtime_priority = 99; } /* Try getting maximum rttime allowed by rtkit: exceeding this value will result in SIGKILL */ if (!dbus_conn || !SDL_DBus_QueryPropertyOnConnection(dbus_conn, rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "RTTimeUSecMax", - DBUS_TYPE_INT64, &rtkit_max_rttime_usec)) { + DBUS_TYPE_INT64, &rtkit_max_rttime_usec)) { rtkit_max_rttime_usec = 200000; } } -static SDL_bool -rtkit_initialize_realtime_thread() +static SDL_bool rtkit_initialize_realtime_thread(void) { // Following is an excerpt from rtkit README that outlines the requirements // a thread must meet before making rtkit requests: @@ -164,7 +159,7 @@ rtkit_initialize_realtime_thread() int err; struct rlimit rlimit; int nLimit = RLIMIT_RTTIME; - pid_t nPid = 0; //self + pid_t nPid = 0; // self int nSchedPolicy = sched_getscheduler(nPid) | SCHED_RESET_ON_FORK; struct sched_param schedParam; @@ -172,8 +167,7 @@ rtkit_initialize_realtime_thread() // Requirement #1: Set RLIMIT_RTTIME err = getrlimit(nLimit, &rlimit); - if (err) - { + if (err) { return SDL_FALSE; } @@ -181,29 +175,25 @@ rtkit_initialize_realtime_thread() rlimit.rlim_max = rtkit_max_rttime_usec; rlimit.rlim_cur = rlimit.rlim_max / 2; err = setrlimit(nLimit, &rlimit); - if (err) - { + if (err) { return SDL_FALSE; } // Requirement #2: Add SCHED_RESET_ON_FORK to the scheduler policy err = sched_getparam(nPid, &schedParam); - if (err) - { + if (err) { return SDL_FALSE; } err = sched_setscheduler(nPid, nSchedPolicy, &schedParam); - if (err) - { + if (err) { return SDL_FALSE; } return SDL_TRUE; } -static SDL_bool -rtkit_setpriority_nice(pid_t thread, int nice_level) +static SDL_bool rtkit_setpriority_nice(pid_t thread, int nice_level) { DBusConnection *dbus_conn; Uint64 pid = (Uint64)getpid(); @@ -213,20 +203,20 @@ rtkit_setpriority_nice(pid_t thread, int nice_level) pthread_once(&rtkit_initialize_once, rtkit_initialize); dbus_conn = get_rtkit_dbus_connection(); - if (nice < rtkit_min_nice_level) + if (nice < rtkit_min_nice_level) { nice = rtkit_min_nice_level; + } if (!dbus_conn || !SDL_DBus_CallMethodOnConnection(dbus_conn, - rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MakeThreadHighPriorityWithPID", - DBUS_TYPE_UINT64, &pid, DBUS_TYPE_UINT64, &tid, DBUS_TYPE_INT32, &nice, DBUS_TYPE_INVALID, - DBUS_TYPE_INVALID)) { + rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MakeThreadHighPriorityWithPID", + DBUS_TYPE_UINT64, &pid, DBUS_TYPE_UINT64, &tid, DBUS_TYPE_INT32, &nice, DBUS_TYPE_INVALID, + DBUS_TYPE_INVALID)) { return SDL_FALSE; } return SDL_TRUE; } -static SDL_bool -rtkit_setpriority_realtime(pid_t thread, int rt_priority) +static SDL_bool rtkit_setpriority_realtime(pid_t thread, int rt_priority) { DBusConnection *dbus_conn; Uint64 pid = (Uint64)getpid(); @@ -236,8 +226,9 @@ rtkit_setpriority_realtime(pid_t thread, int rt_priority) pthread_once(&rtkit_initialize_once, rtkit_initialize); dbus_conn = get_rtkit_dbus_connection(); - if (priority > rtkit_max_realtime_priority) + if (priority > rtkit_max_realtime_priority) { priority = rtkit_max_realtime_priority; + } // We always perform the thread state changes necessary for rtkit. // This wastes some system calls if the state is already set but @@ -248,9 +239,9 @@ rtkit_setpriority_realtime(pid_t thread, int rt_priority) rtkit_initialize_realtime_thread(); if (!dbus_conn || !SDL_DBus_CallMethodOnConnection(dbus_conn, - rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MakeThreadRealtimeWithPID", - DBUS_TYPE_UINT64, &pid, DBUS_TYPE_UINT64, &tid, DBUS_TYPE_UINT32, &priority, DBUS_TYPE_INVALID, - DBUS_TYPE_INVALID)) { + rtkit_dbus_node, rtkit_dbus_path, rtkit_dbus_interface, "MakeThreadRealtimeWithPID", + DBUS_TYPE_UINT64, &pid, DBUS_TYPE_UINT64, &tid, DBUS_TYPE_UINT32, &priority, DBUS_TYPE_INVALID, + DBUS_TYPE_INVALID)) { return SDL_FALSE; } return SDL_TRUE; @@ -263,17 +254,16 @@ rtkit_setpriority_realtime(pid_t thread, int rt_priority) #endif /* threads */ /* this is a public symbol, so it has to exist even if threads are disabled. */ -int -SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) +int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); #else if (setpriority(PRIO_PROCESS, (id_t)threadID, priority) == 0) { return 0; } -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS /* Note that this fails you most likely: * Have your process's scheduler incorrectly configured. See the requirements at: @@ -296,10 +286,9 @@ SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) } /* this is a public symbol, so it has to exist even if threads are disabled. */ -int -SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); #else int osPriority; @@ -330,7 +319,7 @@ SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedP } } -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS /* Note that this fails you most likely: * Have your process's scheduler incorrectly configured. See the requirements at: @@ -358,6 +347,6 @@ SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedP #endif } -#endif /* __LINUX__ */ +#endif /* __LINUX__ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c index 85cde8959607c..6c0fc14da2213 100644 --- a/src/core/linux/SDL_udev.c +++ b/src/core/linux/SDL_udev.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,6 +31,7 @@ #ifdef SDL_USE_LIBUDEV #include +#include #include "SDL_assert.h" #include "SDL_evdev_capabilities.h" @@ -47,13 +48,15 @@ static _THIS = NULL; static SDL_bool SDL_UDEV_load_sym(const char *fn, void **addr); static int SDL_UDEV_load_syms(void); static SDL_bool SDL_UDEV_hotplug_update_available(void); +static void get_caps(struct udev_device *dev, struct udev_device *pdev, const char *attr, unsigned long *bitmask, size_t bitmask_len); +static int guess_device_class(struct udev_device *dev); +static int device_class(struct udev_device *dev); static void device_event(SDL_UDEV_deviceevent type, struct udev_device *dev); -static SDL_bool -SDL_UDEV_load_sym(const char *fn, void **addr) +static SDL_bool SDL_UDEV_load_sym(const char *fn, void **addr) { *addr = SDL_LoadFunction(_this->udev_handle, fn); - if (*addr == NULL) { + if (!*addr) { /* Don't call SDL_SetError(): SDL_LoadFunction already did. */ return SDL_FALSE; } @@ -61,12 +64,12 @@ SDL_UDEV_load_sym(const char *fn, void **addr) return SDL_TRUE; } -static int -SDL_UDEV_load_syms(void) +static int SDL_UDEV_load_syms(void) { - /* cast funcs to char* first, to please GCC's strict aliasing rules. */ - #define SDL_UDEV_SYM(x) \ - if (!SDL_UDEV_load_sym(#x, (void **) (char *) & _this->syms.x)) return -1 +/* cast funcs to char* first, to please GCC's strict aliasing rules. */ +#define SDL_UDEV_SYM(x) \ + if (!SDL_UDEV_load_sym(#x, (void **)(char *)&_this->syms.x)) \ + return -1 SDL_UDEV_SYM(udev_device_get_action); SDL_UDEV_SYM(udev_device_get_devnode); @@ -94,15 +97,14 @@ SDL_UDEV_load_syms(void) SDL_UDEV_SYM(udev_unref); SDL_UDEV_SYM(udev_device_new_from_devnum); SDL_UDEV_SYM(udev_device_get_devnum); - #undef SDL_UDEV_SYM +#undef SDL_UDEV_SYM return 0; } -static SDL_bool -SDL_UDEV_hotplug_update_available(void) +static SDL_bool SDL_UDEV_hotplug_update_available(void) { - if (_this->udev_mon != NULL) { + if (_this->udev_mon) { const int fd = _this->syms.udev_monitor_get_fd(_this->udev_mon); if (SDL_IOReady(fd, SDL_IOR_READ, 0)) { return SDL_TRUE; @@ -111,15 +113,13 @@ SDL_UDEV_hotplug_update_available(void) return SDL_FALSE; } - -int -SDL_UDEV_Init(void) +int SDL_UDEV_Init(void) { int retval = 0; - if (_this == NULL) { - _this = (SDL_UDEV_PrivateData *) SDL_calloc(1, sizeof(*_this)); - if(_this == NULL) { + if (!_this) { + _this = (SDL_UDEV_PrivateData *)SDL_calloc(1, sizeof(*_this)); + if (!_this) { return SDL_OutOfMemory(); } @@ -134,13 +134,13 @@ SDL_UDEV_Init(void) */ _this->udev = _this->syms.udev_new(); - if (_this->udev == NULL) { + if (!_this->udev) { SDL_UDEV_Quit(); return SDL_SetError("udev_new() failed"); } _this->udev_mon = _this->syms.udev_monitor_new_from_netlink(_this->udev, "udev"); - if (_this->udev_mon == NULL) { + if (!_this->udev_mon) { SDL_UDEV_Quit(); return SDL_SetError("udev_monitor_new_from_netlink() failed"); } @@ -151,7 +151,6 @@ SDL_UDEV_Init(void) /* Do an initial scan of existing devices */ SDL_UDEV_Scan(); - } _this->ref_count += 1; @@ -159,12 +158,11 @@ SDL_UDEV_Init(void) return retval; } -void -SDL_UDEV_Quit(void) +void SDL_UDEV_Quit(void) { SDL_UDEV_CallbackList *item; - if (_this == NULL) { + if (!_this) { return; } @@ -172,17 +170,17 @@ SDL_UDEV_Quit(void) if (_this->ref_count < 1) { - if (_this->udev_mon != NULL) { + if (_this->udev_mon) { _this->syms.udev_monitor_unref(_this->udev_mon); _this->udev_mon = NULL; } - if (_this->udev != NULL) { + if (_this->udev) { _this->syms.udev_unref(_this->udev); _this->udev = NULL; } /* Remove existing devices */ - while (_this->first != NULL) { + while (_this->first) { item = _this->first; _this->first = _this->first->next; SDL_free(item); @@ -194,19 +192,18 @@ SDL_UDEV_Quit(void) } } -void -SDL_UDEV_Scan(void) +void SDL_UDEV_Scan(void) { struct udev_enumerate *enumerate = NULL; struct udev_list_entry *devs = NULL; struct udev_list_entry *item = NULL; - if (_this == NULL) { + if (!_this) { return; } enumerate = _this->syms.udev_enumerate_new(_this->udev); - if (enumerate == NULL) { + if (!enumerate) { SDL_UDEV_Quit(); SDL_SetError("udev_enumerate_new() failed"); return; @@ -220,7 +217,7 @@ SDL_UDEV_Scan(void) for (item = devs; item; item = _this->syms.udev_list_entry_get_next(item)) { const char *path = _this->syms.udev_list_entry_get_name(item); struct udev_device *dev = _this->syms.udev_device_new_from_syspath(_this->udev, path); - if (dev != NULL) { + if (dev) { device_event(SDL_UDEV_DEVICEADDED, dev); _this->syms.udev_device_unref(dev); } @@ -229,82 +226,80 @@ SDL_UDEV_Scan(void) _this->syms.udev_enumerate_unref(enumerate); } -SDL_bool -SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version) +SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version, int *class) { - struct udev_enumerate *enumerate = NULL; - struct udev_list_entry *devs = NULL; - struct udev_list_entry *item = NULL; - SDL_bool found = SDL_FALSE; + struct stat statbuf; + char type; + struct udev_device *dev; + const char* val; + int class_temp; - if (_this == NULL) { + if (!_this) { return SDL_FALSE; } - enumerate = _this->syms.udev_enumerate_new(_this->udev); - if (enumerate == NULL) { - SDL_SetError("udev_enumerate_new() failed"); + if (stat(device_path, &statbuf) == -1) { return SDL_FALSE; } - _this->syms.udev_enumerate_scan_devices(enumerate); - devs = _this->syms.udev_enumerate_get_list_entry(enumerate); - for (item = devs; item && !found; item = _this->syms.udev_list_entry_get_next(item)) { - const char *path = _this->syms.udev_list_entry_get_name(item); - struct udev_device *dev = _this->syms.udev_device_new_from_syspath(_this->udev, path); - if (dev != NULL) { - const char *val = NULL; - const char *existing_path; + if (S_ISBLK(statbuf.st_mode)) { + type = 'b'; + } + else if (S_ISCHR(statbuf.st_mode)) { + type = 'c'; + } + else { + return SDL_FALSE; + } - existing_path = _this->syms.udev_device_get_devnode(dev); - if (existing_path && SDL_strcmp(device_path, existing_path) == 0) { - found = SDL_TRUE; + dev = _this->syms.udev_device_new_from_devnum(_this->udev, type, statbuf.st_rdev); - val = _this->syms.udev_device_get_property_value(dev, "ID_VENDOR_ID"); - if (val != NULL) { - *vendor = (Uint16)SDL_strtol(val, NULL, 16); - } + if (!dev) { + return SDL_FALSE; + } - val = _this->syms.udev_device_get_property_value(dev, "ID_MODEL_ID"); - if (val != NULL) { - *product = (Uint16)SDL_strtol(val, NULL, 16); - } + val = _this->syms.udev_device_get_property_value(dev, "ID_VENDOR_ID"); + if (val) { + *vendor = (Uint16)SDL_strtol(val, NULL, 16); + } - val = _this->syms.udev_device_get_property_value(dev, "ID_REVISION"); - if (val != NULL) { - *version = (Uint16)SDL_strtol(val, NULL, 16); - } - } - _this->syms.udev_device_unref(dev); - } + val = _this->syms.udev_device_get_property_value(dev, "ID_MODEL_ID"); + if (val) { + *product = (Uint16)SDL_strtol(val, NULL, 16); } - _this->syms.udev_enumerate_unref(enumerate); - return found; -} + val = _this->syms.udev_device_get_property_value(dev, "ID_REVISION"); + if (val) { + *version = (Uint16)SDL_strtol(val, NULL, 16); + } + class_temp = device_class(dev); + if (class_temp) { + *class = class_temp; + } + _this->syms.udev_device_unref(dev); + return SDL_TRUE; +} -void -SDL_UDEV_UnloadLibrary(void) +void SDL_UDEV_UnloadLibrary(void) { - if (_this == NULL) { + if (!_this) { return; } - if (_this->udev_handle != NULL) { + if (_this->udev_handle) { SDL_UnloadObject(_this->udev_handle); _this->udev_handle = NULL; } } -int -SDL_UDEV_LoadLibrary(void) +int SDL_UDEV_LoadLibrary(void) { int retval = 0, i; - if (_this == NULL) { + if (!_this) { return SDL_SetError("UDEV not initialized"); } @@ -315,9 +310,9 @@ SDL_UDEV_LoadLibrary(void) #ifdef SDL_UDEV_DYNAMIC /* Check for the build environment's libudev first */ - if (_this->udev_handle == NULL) { + if (!_this->udev_handle) { _this->udev_handle = SDL_LoadObject(SDL_UDEV_DYNAMIC); - if (_this->udev_handle != NULL) { + if (_this->udev_handle) { retval = SDL_UDEV_load_syms(); if (retval < 0) { SDL_UDEV_UnloadLibrary(); @@ -326,21 +321,20 @@ SDL_UDEV_LoadLibrary(void) } #endif - if (_this->udev_handle == NULL) { - for( i = 0 ; i < SDL_arraysize(SDL_UDEV_LIBS); i++) { + if (!_this->udev_handle) { + for (i = 0; i < SDL_arraysize(SDL_UDEV_LIBS); i++) { _this->udev_handle = SDL_LoadObject(SDL_UDEV_LIBS[i]); - if (_this->udev_handle != NULL) { + if (_this->udev_handle) { retval = SDL_UDEV_load_syms(); if (retval < 0) { SDL_UDEV_UnloadLibrary(); - } - else { + } else { break; } } } - if (_this->udev_handle == NULL) { + if (!_this->udev_handle) { retval = -1; /* Don't call SDL_SetError(): SDL_LoadObject already did. */ } @@ -357,7 +351,7 @@ static void get_caps(struct udev_device *dev, struct udev_device *pdev, const ch int i; unsigned long v; - SDL_memset(bitmask, 0, bitmask_len*sizeof(*bitmask)); + SDL_memset(bitmask, 0, bitmask_len * sizeof(*bitmask)); value = _this->syms.udev_device_get_sysattr_value(pdev, attr); if (!value) { return; @@ -366,7 +360,7 @@ static void get_caps(struct udev_device *dev, struct udev_device *pdev, const ch SDL_strlcpy(text, value, sizeof(text)); i = 0; while ((word = SDL_strrchr(text, ' ')) != NULL) { - v = SDL_strtoul(word+1, NULL, 16); + v = SDL_strtoul(word + 1, NULL, 16); if (i < bitmask_len) { bitmask[i] = v; } @@ -379,8 +373,7 @@ static void get_caps(struct udev_device *dev, struct udev_device *pdev, const ch } } -static int -guess_device_class(struct udev_device *dev) +static int guess_device_class(struct udev_device *dev) { struct udev_device *pdev; unsigned long bitmask_ev[NBITS(EV_MAX)]; @@ -409,44 +402,43 @@ guess_device_class(struct udev_device *dev) &bitmask_rel[0]); } -static void -device_event(SDL_UDEV_deviceevent type, struct udev_device *dev) +static int device_class(struct udev_device *dev) { const char *subsystem; const char *val = NULL; int devclass = 0; - const char *path; - SDL_UDEV_CallbackList *item; - path = _this->syms.udev_device_get_devnode(dev); - if (path == NULL) { - return; + subsystem = _this->syms.udev_device_get_subsystem(dev); + if (!subsystem) { + return 0; } - subsystem = _this->syms.udev_device_get_subsystem(dev); if (SDL_strcmp(subsystem, "sound") == 0) { devclass = SDL_UDEV_DEVICE_SOUND; } else if (SDL_strcmp(subsystem, "input") == 0) { /* udev rules reference: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-input_id.c */ val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK"); - if (val != NULL && SDL_strcmp(val, "1") == 0 ) { + if (val && SDL_strcmp(val, "1") == 0) { devclass |= SDL_UDEV_DEVICE_JOYSTICK; } val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_ACCELEROMETER"); - if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE) && - val != NULL && SDL_strcmp(val, "1") == 0 ) { - devclass |= SDL_UDEV_DEVICE_JOYSTICK; + if (val && SDL_strcmp(val, "1") == 0) { + if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_FALSE)) { + devclass |= SDL_UDEV_DEVICE_JOYSTICK; + } else { + devclass |= SDL_UDEV_DEVICE_ACCELEROMETER; + } } val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_MOUSE"); - if (val != NULL && SDL_strcmp(val, "1") == 0 ) { + if (val && SDL_strcmp(val, "1") == 0) { devclass |= SDL_UDEV_DEVICE_MOUSE; } val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN"); - if (val != NULL && SDL_strcmp(val, "1") == 0 ) { + if (val && SDL_strcmp(val, "1") == 0) { devclass |= SDL_UDEV_DEVICE_TOUCHSCREEN; } @@ -457,51 +449,65 @@ device_event(SDL_UDEV_deviceevent type, struct udev_device *dev) Ref: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-input_id.c#n183 */ val = _this->syms.udev_device_get_property_value(dev, "ID_INPUT_KEY"); - if (val != NULL && SDL_strcmp(val, "1") == 0 ) { + if (val && SDL_strcmp(val, "1") == 0) { devclass |= SDL_UDEV_DEVICE_KEYBOARD; } if (devclass == 0) { /* Fall back to old style input classes */ val = _this->syms.udev_device_get_property_value(dev, "ID_CLASS"); - if (val != NULL) { + if (val) { if (SDL_strcmp(val, "joystick") == 0) { devclass = SDL_UDEV_DEVICE_JOYSTICK; } else if (SDL_strcmp(val, "mouse") == 0) { devclass = SDL_UDEV_DEVICE_MOUSE; } else if (SDL_strcmp(val, "kbd") == 0) { devclass = SDL_UDEV_DEVICE_KEYBOARD; - } else { - return; } } else { /* We could be linked with libudev on a system that doesn't have udev running */ devclass = guess_device_class(dev); } } - } else { + } + + return devclass; +} + +static void device_event(SDL_UDEV_deviceevent type, struct udev_device *dev) +{ + int devclass = 0; + const char *path; + SDL_UDEV_CallbackList *item; + + path = _this->syms.udev_device_get_devnode(dev); + if (!path) { return; } + devclass = device_class(dev); + if (!devclass) { + return; + } + /* Process callbacks */ - for (item = _this->first; item != NULL; item = item->next) { + for (item = _this->first; item; item = item->next) { item->callback(type, devclass, path); } } -void -SDL_UDEV_Poll(void) +void SDL_UDEV_Poll(void) { struct udev_device *dev = NULL; const char *action = NULL; - if (_this == NULL) { + if (!_this) { return; } while (SDL_UDEV_hotplug_update_available()) { dev = _this->syms.udev_monitor_receive_device(_this->udev_mon); - if (dev == NULL) { + if (!dev) { break; } action = _this->syms.udev_device_get_action(dev); @@ -518,18 +524,17 @@ SDL_UDEV_Poll(void) } } -int -SDL_UDEV_AddCallback(SDL_UDEV_Callback cb) +int SDL_UDEV_AddCallback(SDL_UDEV_Callback cb) { SDL_UDEV_CallbackList *item; - item = (SDL_UDEV_CallbackList *) SDL_calloc(1, sizeof (SDL_UDEV_CallbackList)); - if (item == NULL) { + item = (SDL_UDEV_CallbackList *)SDL_calloc(1, sizeof(SDL_UDEV_CallbackList)); + if (!item) { return SDL_OutOfMemory(); } item->callback = cb; - if (_this->last == NULL) { + if (!_this->last) { _this->first = _this->last = item; } else { _this->last->next = item; @@ -539,20 +544,19 @@ SDL_UDEV_AddCallback(SDL_UDEV_Callback cb) return 1; } -void -SDL_UDEV_DelCallback(SDL_UDEV_Callback cb) +void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb) { SDL_UDEV_CallbackList *item; SDL_UDEV_CallbackList *prev = NULL; - if (_this == NULL) { + if (!_this) { return; } - for (item = _this->first; item != NULL; item = item->next) { + for (item = _this->first; item; item = item->next) { /* found it, remove it. */ if (item->callback == cb) { - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(_this->first == item); @@ -568,8 +572,7 @@ SDL_UDEV_DelCallback(SDL_UDEV_Callback cb) } } -const SDL_UDEV_Symbols * -SDL_UDEV_GetUdevSyms(void) +const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void) { if (SDL_UDEV_Init() < 0) { SDL_SetError("Could not initialize UDEV"); @@ -579,8 +582,7 @@ SDL_UDEV_GetUdevSyms(void) return &_this->syms; } -void -SDL_UDEV_ReleaseUdevSyms(void) +void SDL_UDEV_ReleaseUdevSyms(void) { SDL_UDEV_Quit(); } diff --git a/src/core/linux/SDL_udev.h b/src/core/linux/SDL_udev.h index 8ac6cbe89eaee..85a563cdd7be3 100644 --- a/src/core/linux/SDL_udev.h +++ b/src/core/linux/SDL_udev.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ #ifndef SDL_udev_h_ #define SDL_udev_h_ -#if HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H +#if defined(HAVE_LIBUDEV_H) && defined(HAVE_LINUX_INPUT_H) #ifndef SDL_USE_LIBUDEV #define SDL_USE_LIBUDEV 1 @@ -48,12 +48,14 @@ typedef enum typedef void (*SDL_UDEV_Callback)(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath); -typedef struct SDL_UDEV_CallbackList { +typedef struct SDL_UDEV_CallbackList +{ SDL_UDEV_Callback callback; struct SDL_UDEV_CallbackList *next; } SDL_UDEV_CallbackList; -typedef struct SDL_UDEV_Symbols { +typedef struct SDL_UDEV_Symbols +{ const char *(*udev_device_get_action)(struct udev_device *); const char *(*udev_device_get_devnode)(struct udev_device *); const char *(*udev_device_get_subsystem)(struct udev_device *); @@ -78,8 +80,8 @@ typedef struct SDL_UDEV_Symbols { void (*udev_monitor_unref)(struct udev_monitor *); struct udev *(*udev_new)(void); void (*udev_unref)(struct udev *); - struct udev_device * (*udev_device_new_from_devnum)(struct udev *udev, char type, dev_t devnum); - dev_t (*udev_device_get_devnum) (struct udev_device *udev_device); + struct udev_device *(*udev_device_new_from_devnum)(struct udev *udev, char type, dev_t devnum); + dev_t (*udev_device_get_devnum)(struct udev_device *udev_device); } SDL_UDEV_Symbols; typedef struct SDL_UDEV_PrivateData @@ -90,7 +92,7 @@ typedef struct SDL_UDEV_PrivateData struct udev_monitor *udev_mon; int ref_count; SDL_UDEV_CallbackList *first, *last; - + /* Function pointers */ SDL_UDEV_Symbols syms; } SDL_UDEV_PrivateData; @@ -101,13 +103,12 @@ extern void SDL_UDEV_UnloadLibrary(void); extern int SDL_UDEV_LoadLibrary(void); extern void SDL_UDEV_Poll(void); extern void SDL_UDEV_Scan(void); -extern SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version); +extern SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version, int *class); extern int SDL_UDEV_AddCallback(SDL_UDEV_Callback cb); extern void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb); extern const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void); extern void SDL_UDEV_ReleaseUdevSyms(void); - #endif /* HAVE_LIBUDEV_H && HAVE_LINUX_INPUT_H */ #endif /* SDL_udev_h_ */ diff --git a/src/core/openbsd/SDL_wscons.h b/src/core/openbsd/SDL_wscons.h index 936d343d04598..201aeca799e9d 100644 --- a/src/core/openbsd/SDL_wscons.h +++ b/src/core/openbsd/SDL_wscons.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,9 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ - void SDL_WSCONS_Init(); void SDL_WSCONS_Quit(); void SDL_WSCONS_PumpEvents(); - diff --git a/src/core/openbsd/SDL_wscons_kbd.c b/src/core/openbsd/SDL_wscons_kbd.c index 121867d6a307e..1bee37ef61a0c 100644 --- a/src/core/openbsd/SDL_wscons_kbd.c +++ b/src/core/openbsd/SDL_wscons_kbd.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,349 +39,358 @@ #include "../../events/SDL_events_c.h" #ifdef __NetBSD__ -#define KS_GROUP_Ascii KS_GROUP_Plain +#define KS_GROUP_Ascii KS_GROUP_Plain #define KS_Cmd_ScrollBack KS_Cmd_ScrollFastUp -#define KS_Cmd_ScrollFwd KS_Cmd_ScrollFastDown +#define KS_Cmd_ScrollFwd KS_Cmd_ScrollFastDown #endif -#define RETIFIOCTLERR(x) if (x == -1) { free(input); input = NULL; return NULL;} +#define RETIFIOCTLERR(x) \ + if (x == -1) { \ + free(input); \ + input = NULL; \ + return NULL; \ + } typedef struct SDL_WSCONS_mouse_input_data SDL_WSCONS_mouse_input_data; -extern SDL_WSCONS_mouse_input_data* SDL_WSCONS_Init_Mouse(); -extern void updateMouse(SDL_WSCONS_mouse_input_data* input); -extern void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data* input); +extern SDL_WSCONS_mouse_input_data *SDL_WSCONS_Init_Mouse(); +extern void updateMouse(SDL_WSCONS_mouse_input_data *input); +extern void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data *input); /* Conversion table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c */ static const unsigned char latin1_to_upper[256] = { /* 0 8 1 9 2 a 3 b 4 c 5 d 6 e 7 f */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */ - 0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G', /* 6 */ - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', /* 6 */ - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', /* 7 */ - 'X', 'Y', 'Z', 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */ - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* e */ - 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* e */ - 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, /* f */ - 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 3 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */ + 0x00, 'A', 'B', 'C', 'D', 'E', 'F', 'G', /* 6 */ + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', /* 6 */ + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', /* 7 */ + 'X', 'Y', 'Z', 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */ + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* e */ + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* e */ + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, /* f */ + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* f */ }; /* Compose table courtesy of /usr/src/sys/dev/wscons/wskbdutil.c */ -static struct SDL_wscons_compose_tab_s { +static struct SDL_wscons_compose_tab_s +{ keysym_t elem[2]; keysym_t result; } compose_tab[] = { - { { KS_plus, KS_plus }, KS_numbersign }, - { { KS_a, KS_a }, KS_at }, - { { KS_parenleft, KS_parenleft }, KS_bracketleft }, - { { KS_slash, KS_slash }, KS_backslash }, - { { KS_parenright, KS_parenright }, KS_bracketright }, - { { KS_parenleft, KS_minus }, KS_braceleft }, - { { KS_slash, KS_minus }, KS_bar }, - { { KS_parenright, KS_minus }, KS_braceright }, - { { KS_exclam, KS_exclam }, KS_exclamdown }, - { { KS_c, KS_slash }, KS_cent }, - { { KS_l, KS_minus }, KS_sterling }, - { { KS_y, KS_minus }, KS_yen }, - { { KS_s, KS_o }, KS_section }, - { { KS_x, KS_o }, KS_currency }, - { { KS_c, KS_o }, KS_copyright }, - { { KS_less, KS_less }, KS_guillemotleft }, - { { KS_greater, KS_greater }, KS_guillemotright }, - { { KS_question, KS_question }, KS_questiondown }, - { { KS_dead_acute, KS_space }, KS_apostrophe }, - { { KS_dead_grave, KS_space }, KS_grave }, - { { KS_dead_tilde, KS_space }, KS_asciitilde }, - { { KS_dead_circumflex, KS_space }, KS_asciicircum }, - { { KS_dead_diaeresis, KS_space }, KS_quotedbl }, - { { KS_dead_cedilla, KS_space }, KS_comma }, - { { KS_dead_circumflex, KS_A }, KS_Acircumflex }, - { { KS_dead_diaeresis, KS_A }, KS_Adiaeresis }, - { { KS_dead_grave, KS_A }, KS_Agrave }, - { { KS_dead_abovering, KS_A }, KS_Aring }, - { { KS_dead_tilde, KS_A }, KS_Atilde }, - { { KS_dead_cedilla, KS_C }, KS_Ccedilla }, - { { KS_dead_acute, KS_E }, KS_Eacute }, - { { KS_dead_circumflex, KS_E }, KS_Ecircumflex }, - { { KS_dead_diaeresis, KS_E }, KS_Ediaeresis }, - { { KS_dead_grave, KS_E }, KS_Egrave }, - { { KS_dead_acute, KS_I }, KS_Iacute }, - { { KS_dead_circumflex, KS_I }, KS_Icircumflex }, - { { KS_dead_diaeresis, KS_I }, KS_Idiaeresis }, - { { KS_dead_grave, KS_I }, KS_Igrave }, - { { KS_dead_tilde, KS_N }, KS_Ntilde }, - { { KS_dead_acute, KS_O }, KS_Oacute }, - { { KS_dead_circumflex, KS_O }, KS_Ocircumflex }, - { { KS_dead_diaeresis, KS_O }, KS_Odiaeresis }, - { { KS_dead_grave, KS_O }, KS_Ograve }, - { { KS_dead_tilde, KS_O }, KS_Otilde }, - { { KS_dead_acute, KS_U }, KS_Uacute }, - { { KS_dead_circumflex, KS_U }, KS_Ucircumflex }, - { { KS_dead_diaeresis, KS_U }, KS_Udiaeresis }, - { { KS_dead_grave, KS_U }, KS_Ugrave }, - { { KS_dead_acute, KS_Y }, KS_Yacute }, - { { KS_dead_acute, KS_a }, KS_aacute }, - { { KS_dead_circumflex, KS_a }, KS_acircumflex }, - { { KS_dead_diaeresis, KS_a }, KS_adiaeresis }, - { { KS_dead_grave, KS_a }, KS_agrave }, - { { KS_dead_abovering, KS_a }, KS_aring }, - { { KS_dead_tilde, KS_a }, KS_atilde }, - { { KS_dead_cedilla, KS_c }, KS_ccedilla }, - { { KS_dead_acute, KS_e }, KS_eacute }, - { { KS_dead_circumflex, KS_e }, KS_ecircumflex }, - { { KS_dead_diaeresis, KS_e }, KS_ediaeresis }, - { { KS_dead_grave, KS_e }, KS_egrave }, - { { KS_dead_acute, KS_i }, KS_iacute }, - { { KS_dead_circumflex, KS_i }, KS_icircumflex }, - { { KS_dead_diaeresis, KS_i }, KS_idiaeresis }, - { { KS_dead_grave, KS_i }, KS_igrave }, - { { KS_dead_tilde, KS_n }, KS_ntilde }, - { { KS_dead_acute, KS_o }, KS_oacute }, - { { KS_dead_circumflex, KS_o }, KS_ocircumflex }, - { { KS_dead_diaeresis, KS_o }, KS_odiaeresis }, - { { KS_dead_grave, KS_o }, KS_ograve }, - { { KS_dead_tilde, KS_o }, KS_otilde }, - { { KS_dead_acute, KS_u }, KS_uacute }, - { { KS_dead_circumflex, KS_u }, KS_ucircumflex }, - { { KS_dead_diaeresis, KS_u }, KS_udiaeresis }, - { { KS_dead_grave, KS_u }, KS_ugrave }, - { { KS_dead_acute, KS_y }, KS_yacute }, - { { KS_dead_diaeresis, KS_y }, KS_ydiaeresis }, - { { KS_quotedbl, KS_A }, KS_Adiaeresis }, - { { KS_quotedbl, KS_E }, KS_Ediaeresis }, - { { KS_quotedbl, KS_I }, KS_Idiaeresis }, - { { KS_quotedbl, KS_O }, KS_Odiaeresis }, - { { KS_quotedbl, KS_U }, KS_Udiaeresis }, - { { KS_quotedbl, KS_a }, KS_adiaeresis }, - { { KS_quotedbl, KS_e }, KS_ediaeresis }, - { { KS_quotedbl, KS_i }, KS_idiaeresis }, - { { KS_quotedbl, KS_o }, KS_odiaeresis }, - { { KS_quotedbl, KS_u }, KS_udiaeresis }, - { { KS_quotedbl, KS_y }, KS_ydiaeresis }, - { { KS_acute, KS_A }, KS_Aacute }, - { { KS_asciicircum, KS_A }, KS_Acircumflex }, - { { KS_grave, KS_A }, KS_Agrave }, - { { KS_asterisk, KS_A }, KS_Aring }, - { { KS_asciitilde, KS_A }, KS_Atilde }, - { { KS_cedilla, KS_C }, KS_Ccedilla }, - { { KS_acute, KS_E }, KS_Eacute }, - { { KS_asciicircum, KS_E }, KS_Ecircumflex }, - { { KS_grave, KS_E }, KS_Egrave }, - { { KS_acute, KS_I }, KS_Iacute }, - { { KS_asciicircum, KS_I }, KS_Icircumflex }, - { { KS_grave, KS_I }, KS_Igrave }, - { { KS_asciitilde, KS_N }, KS_Ntilde }, - { { KS_acute, KS_O }, KS_Oacute }, - { { KS_asciicircum, KS_O }, KS_Ocircumflex }, - { { KS_grave, KS_O }, KS_Ograve }, - { { KS_asciitilde, KS_O }, KS_Otilde }, - { { KS_acute, KS_U }, KS_Uacute }, - { { KS_asciicircum, KS_U }, KS_Ucircumflex }, - { { KS_grave, KS_U }, KS_Ugrave }, - { { KS_acute, KS_Y }, KS_Yacute }, - { { KS_acute, KS_a }, KS_aacute }, - { { KS_asciicircum, KS_a }, KS_acircumflex }, - { { KS_grave, KS_a }, KS_agrave }, - { { KS_asterisk, KS_a }, KS_aring }, - { { KS_asciitilde, KS_a }, KS_atilde }, - { { KS_cedilla, KS_c }, KS_ccedilla }, - { { KS_acute, KS_e }, KS_eacute }, - { { KS_asciicircum, KS_e }, KS_ecircumflex }, - { { KS_grave, KS_e }, KS_egrave }, - { { KS_acute, KS_i }, KS_iacute }, - { { KS_asciicircum, KS_i }, KS_icircumflex }, - { { KS_grave, KS_i }, KS_igrave }, - { { KS_asciitilde, KS_n }, KS_ntilde }, - { { KS_acute, KS_o }, KS_oacute }, - { { KS_asciicircum, KS_o }, KS_ocircumflex }, - { { KS_grave, KS_o }, KS_ograve }, - { { KS_asciitilde, KS_o }, KS_otilde }, - { { KS_acute, KS_u }, KS_uacute }, - { { KS_asciicircum, KS_u }, KS_ucircumflex }, - { { KS_grave, KS_u }, KS_ugrave }, - { { KS_acute, KS_y }, KS_yacute }, + { { KS_plus, KS_plus }, KS_numbersign }, + { { KS_a, KS_a }, KS_at }, + { { KS_parenleft, KS_parenleft }, KS_bracketleft }, + { { KS_slash, KS_slash }, KS_backslash }, + { { KS_parenright, KS_parenright }, KS_bracketright }, + { { KS_parenleft, KS_minus }, KS_braceleft }, + { { KS_slash, KS_minus }, KS_bar }, + { { KS_parenright, KS_minus }, KS_braceright }, + { { KS_exclam, KS_exclam }, KS_exclamdown }, + { { KS_c, KS_slash }, KS_cent }, + { { KS_l, KS_minus }, KS_sterling }, + { { KS_y, KS_minus }, KS_yen }, + { { KS_s, KS_o }, KS_section }, + { { KS_x, KS_o }, KS_currency }, + { { KS_c, KS_o }, KS_copyright }, + { { KS_less, KS_less }, KS_guillemotleft }, + { { KS_greater, KS_greater }, KS_guillemotright }, + { { KS_question, KS_question }, KS_questiondown }, + { { KS_dead_acute, KS_space }, KS_apostrophe }, + { { KS_dead_grave, KS_space }, KS_grave }, + { { KS_dead_tilde, KS_space }, KS_asciitilde }, + { { KS_dead_circumflex, KS_space }, KS_asciicircum }, + { { KS_dead_diaeresis, KS_space }, KS_quotedbl }, + { { KS_dead_cedilla, KS_space }, KS_comma }, + { { KS_dead_circumflex, KS_A }, KS_Acircumflex }, + { { KS_dead_diaeresis, KS_A }, KS_Adiaeresis }, + { { KS_dead_grave, KS_A }, KS_Agrave }, + { { KS_dead_abovering, KS_A }, KS_Aring }, + { { KS_dead_tilde, KS_A }, KS_Atilde }, + { { KS_dead_cedilla, KS_C }, KS_Ccedilla }, + { { KS_dead_acute, KS_E }, KS_Eacute }, + { { KS_dead_circumflex, KS_E }, KS_Ecircumflex }, + { { KS_dead_diaeresis, KS_E }, KS_Ediaeresis }, + { { KS_dead_grave, KS_E }, KS_Egrave }, + { { KS_dead_acute, KS_I }, KS_Iacute }, + { { KS_dead_circumflex, KS_I }, KS_Icircumflex }, + { { KS_dead_diaeresis, KS_I }, KS_Idiaeresis }, + { { KS_dead_grave, KS_I }, KS_Igrave }, + { { KS_dead_tilde, KS_N }, KS_Ntilde }, + { { KS_dead_acute, KS_O }, KS_Oacute }, + { { KS_dead_circumflex, KS_O }, KS_Ocircumflex }, + { { KS_dead_diaeresis, KS_O }, KS_Odiaeresis }, + { { KS_dead_grave, KS_O }, KS_Ograve }, + { { KS_dead_tilde, KS_O }, KS_Otilde }, + { { KS_dead_acute, KS_U }, KS_Uacute }, + { { KS_dead_circumflex, KS_U }, KS_Ucircumflex }, + { { KS_dead_diaeresis, KS_U }, KS_Udiaeresis }, + { { KS_dead_grave, KS_U }, KS_Ugrave }, + { { KS_dead_acute, KS_Y }, KS_Yacute }, + { { KS_dead_acute, KS_a }, KS_aacute }, + { { KS_dead_circumflex, KS_a }, KS_acircumflex }, + { { KS_dead_diaeresis, KS_a }, KS_adiaeresis }, + { { KS_dead_grave, KS_a }, KS_agrave }, + { { KS_dead_abovering, KS_a }, KS_aring }, + { { KS_dead_tilde, KS_a }, KS_atilde }, + { { KS_dead_cedilla, KS_c }, KS_ccedilla }, + { { KS_dead_acute, KS_e }, KS_eacute }, + { { KS_dead_circumflex, KS_e }, KS_ecircumflex }, + { { KS_dead_diaeresis, KS_e }, KS_ediaeresis }, + { { KS_dead_grave, KS_e }, KS_egrave }, + { { KS_dead_acute, KS_i }, KS_iacute }, + { { KS_dead_circumflex, KS_i }, KS_icircumflex }, + { { KS_dead_diaeresis, KS_i }, KS_idiaeresis }, + { { KS_dead_grave, KS_i }, KS_igrave }, + { { KS_dead_tilde, KS_n }, KS_ntilde }, + { { KS_dead_acute, KS_o }, KS_oacute }, + { { KS_dead_circumflex, KS_o }, KS_ocircumflex }, + { { KS_dead_diaeresis, KS_o }, KS_odiaeresis }, + { { KS_dead_grave, KS_o }, KS_ograve }, + { { KS_dead_tilde, KS_o }, KS_otilde }, + { { KS_dead_acute, KS_u }, KS_uacute }, + { { KS_dead_circumflex, KS_u }, KS_ucircumflex }, + { { KS_dead_diaeresis, KS_u }, KS_udiaeresis }, + { { KS_dead_grave, KS_u }, KS_ugrave }, + { { KS_dead_acute, KS_y }, KS_yacute }, + { { KS_dead_diaeresis, KS_y }, KS_ydiaeresis }, + { { KS_quotedbl, KS_A }, KS_Adiaeresis }, + { { KS_quotedbl, KS_E }, KS_Ediaeresis }, + { { KS_quotedbl, KS_I }, KS_Idiaeresis }, + { { KS_quotedbl, KS_O }, KS_Odiaeresis }, + { { KS_quotedbl, KS_U }, KS_Udiaeresis }, + { { KS_quotedbl, KS_a }, KS_adiaeresis }, + { { KS_quotedbl, KS_e }, KS_ediaeresis }, + { { KS_quotedbl, KS_i }, KS_idiaeresis }, + { { KS_quotedbl, KS_o }, KS_odiaeresis }, + { { KS_quotedbl, KS_u }, KS_udiaeresis }, + { { KS_quotedbl, KS_y }, KS_ydiaeresis }, + { { KS_acute, KS_A }, KS_Aacute }, + { { KS_asciicircum, KS_A }, KS_Acircumflex }, + { { KS_grave, KS_A }, KS_Agrave }, + { { KS_asterisk, KS_A }, KS_Aring }, + { { KS_asciitilde, KS_A }, KS_Atilde }, + { { KS_cedilla, KS_C }, KS_Ccedilla }, + { { KS_acute, KS_E }, KS_Eacute }, + { { KS_asciicircum, KS_E }, KS_Ecircumflex }, + { { KS_grave, KS_E }, KS_Egrave }, + { { KS_acute, KS_I }, KS_Iacute }, + { { KS_asciicircum, KS_I }, KS_Icircumflex }, + { { KS_grave, KS_I }, KS_Igrave }, + { { KS_asciitilde, KS_N }, KS_Ntilde }, + { { KS_acute, KS_O }, KS_Oacute }, + { { KS_asciicircum, KS_O }, KS_Ocircumflex }, + { { KS_grave, KS_O }, KS_Ograve }, + { { KS_asciitilde, KS_O }, KS_Otilde }, + { { KS_acute, KS_U }, KS_Uacute }, + { { KS_asciicircum, KS_U }, KS_Ucircumflex }, + { { KS_grave, KS_U }, KS_Ugrave }, + { { KS_acute, KS_Y }, KS_Yacute }, + { { KS_acute, KS_a }, KS_aacute }, + { { KS_asciicircum, KS_a }, KS_acircumflex }, + { { KS_grave, KS_a }, KS_agrave }, + { { KS_asterisk, KS_a }, KS_aring }, + { { KS_asciitilde, KS_a }, KS_atilde }, + { { KS_cedilla, KS_c }, KS_ccedilla }, + { { KS_acute, KS_e }, KS_eacute }, + { { KS_asciicircum, KS_e }, KS_ecircumflex }, + { { KS_grave, KS_e }, KS_egrave }, + { { KS_acute, KS_i }, KS_iacute }, + { { KS_asciicircum, KS_i }, KS_icircumflex }, + { { KS_grave, KS_i }, KS_igrave }, + { { KS_asciitilde, KS_n }, KS_ntilde }, + { { KS_acute, KS_o }, KS_oacute }, + { { KS_asciicircum, KS_o }, KS_ocircumflex }, + { { KS_grave, KS_o }, KS_ograve }, + { { KS_asciitilde, KS_o }, KS_otilde }, + { { KS_acute, KS_u }, KS_uacute }, + { { KS_asciicircum, KS_u }, KS_ucircumflex }, + { { KS_grave, KS_u }, KS_ugrave }, + { { KS_acute, KS_y }, KS_yacute }, #ifndef __NetBSD__ - { { KS_dead_caron, KS_space }, KS_L2_caron }, - { { KS_dead_caron, KS_S }, KS_L2_Scaron }, - { { KS_dead_caron, KS_Z }, KS_L2_Zcaron }, - { { KS_dead_caron, KS_s }, KS_L2_scaron }, - { { KS_dead_caron, KS_z }, KS_L2_zcaron } + { { KS_dead_caron, KS_space }, KS_L2_caron }, + { { KS_dead_caron, KS_S }, KS_L2_Scaron }, + { { KS_dead_caron, KS_Z }, KS_L2_Zcaron }, + { { KS_dead_caron, KS_s }, KS_L2_scaron }, + { { KS_dead_caron, KS_z }, KS_L2_zcaron } #endif }; static keysym_t ksym_upcase(keysym_t ksym) { - if (ksym >= KS_f1 && ksym <= KS_f20) - return(KS_F1 - KS_f1 + ksym); + if (ksym >= KS_f1 && ksym <= KS_f20) { + return KS_F1 - KS_f1 + ksym; + } - if (KS_GROUP(ksym) == KS_GROUP_Ascii && ksym <= 0xff && - latin1_to_upper[ksym] != 0x00) - return(latin1_to_upper[ksym]); + if (KS_GROUP(ksym) == KS_GROUP_Ascii && ksym <= 0xff && latin1_to_upper[ksym] != 0x00) { + return latin1_to_upper[ksym]; + } - return(ksym); + return ksym; } -static struct wscons_keycode_to_SDL { +static struct wscons_keycode_to_SDL +{ keysym_t sourcekey; SDL_Scancode targetKey; } conversion_table[] = { - {KS_Menu, SDL_SCANCODE_APPLICATION}, - {KS_Up, SDL_SCANCODE_UP}, - {KS_Down, SDL_SCANCODE_DOWN}, - {KS_Left, SDL_SCANCODE_LEFT}, - {KS_Right, SDL_SCANCODE_RIGHT}, - {KS_Hold_Screen, SDL_SCANCODE_SCROLLLOCK}, - {KS_Num_Lock, SDL_SCANCODE_NUMLOCKCLEAR}, - {KS_Caps_Lock, SDL_SCANCODE_CAPSLOCK}, - {KS_BackSpace, SDL_SCANCODE_BACKSPACE}, - {KS_space, SDL_SCANCODE_SPACE}, - {KS_Delete, SDL_SCANCODE_BACKSPACE}, - {KS_Home, SDL_SCANCODE_HOME}, - {KS_End, SDL_SCANCODE_END}, - {KS_Pause, SDL_SCANCODE_PAUSE}, - {KS_Print_Screen, SDL_SCANCODE_PRINTSCREEN}, - {KS_Insert, SDL_SCANCODE_INSERT}, - {KS_Escape, SDL_SCANCODE_ESCAPE}, - {KS_Return, SDL_SCANCODE_RETURN}, - {KS_Linefeed, SDL_SCANCODE_RETURN}, - {KS_KP_Delete, SDL_SCANCODE_DELETE}, - {KS_KP_Insert, SDL_SCANCODE_INSERT}, - {KS_Control_L, SDL_SCANCODE_LCTRL}, - {KS_Control_R, SDL_SCANCODE_RCTRL}, - {KS_Shift_L, SDL_SCANCODE_LSHIFT}, - {KS_Shift_R, SDL_SCANCODE_RSHIFT}, - {KS_Alt_L, SDL_SCANCODE_LALT}, - {KS_Alt_R, SDL_SCANCODE_RALT}, - {KS_grave, SDL_SCANCODE_GRAVE}, - - {KS_KP_0, SDL_SCANCODE_KP_0}, - {KS_KP_1, SDL_SCANCODE_KP_1}, - {KS_KP_2, SDL_SCANCODE_KP_2}, - {KS_KP_3, SDL_SCANCODE_KP_3}, - {KS_KP_4, SDL_SCANCODE_KP_4}, - {KS_KP_5, SDL_SCANCODE_KP_5}, - {KS_KP_6, SDL_SCANCODE_KP_6}, - {KS_KP_7, SDL_SCANCODE_KP_7}, - {KS_KP_8, SDL_SCANCODE_KP_8}, - {KS_KP_9, SDL_SCANCODE_KP_9}, - {KS_KP_Enter, SDL_SCANCODE_KP_ENTER}, - {KS_KP_Multiply, SDL_SCANCODE_KP_MULTIPLY}, - {KS_KP_Add, SDL_SCANCODE_KP_PLUS}, - {KS_KP_Subtract, SDL_SCANCODE_KP_MINUS}, - {KS_KP_Divide, SDL_SCANCODE_KP_DIVIDE}, - {KS_KP_Up, SDL_SCANCODE_UP}, - {KS_KP_Down, SDL_SCANCODE_DOWN}, - {KS_KP_Left, SDL_SCANCODE_LEFT}, - {KS_KP_Right, SDL_SCANCODE_RIGHT}, - {KS_KP_Equal, SDL_SCANCODE_KP_EQUALS}, - {KS_f1, SDL_SCANCODE_F1}, - {KS_f2, SDL_SCANCODE_F2}, - {KS_f3, SDL_SCANCODE_F3}, - {KS_f4, SDL_SCANCODE_F4}, - {KS_f5, SDL_SCANCODE_F5}, - {KS_f6, SDL_SCANCODE_F6}, - {KS_f7, SDL_SCANCODE_F7}, - {KS_f8, SDL_SCANCODE_F8}, - {KS_f9, SDL_SCANCODE_F9}, - {KS_f10, SDL_SCANCODE_F10}, - {KS_f11, SDL_SCANCODE_F11}, - {KS_f12, SDL_SCANCODE_F12}, - {KS_f13, SDL_SCANCODE_F13}, - {KS_f14, SDL_SCANCODE_F14}, - {KS_f15, SDL_SCANCODE_F15}, - {KS_f16, SDL_SCANCODE_F16}, - {KS_f17, SDL_SCANCODE_F17}, - {KS_f18, SDL_SCANCODE_F18}, - {KS_f19, SDL_SCANCODE_F19}, - {KS_f20, SDL_SCANCODE_F20}, + { KS_Menu, SDL_SCANCODE_APPLICATION }, + { KS_Up, SDL_SCANCODE_UP }, + { KS_Down, SDL_SCANCODE_DOWN }, + { KS_Left, SDL_SCANCODE_LEFT }, + { KS_Right, SDL_SCANCODE_RIGHT }, + { KS_Hold_Screen, SDL_SCANCODE_SCROLLLOCK }, + { KS_Num_Lock, SDL_SCANCODE_NUMLOCKCLEAR }, + { KS_Caps_Lock, SDL_SCANCODE_CAPSLOCK }, + { KS_BackSpace, SDL_SCANCODE_BACKSPACE }, + { KS_space, SDL_SCANCODE_SPACE }, + { KS_Delete, SDL_SCANCODE_BACKSPACE }, + { KS_Home, SDL_SCANCODE_HOME }, + { KS_End, SDL_SCANCODE_END }, + { KS_Pause, SDL_SCANCODE_PAUSE }, + { KS_Print_Screen, SDL_SCANCODE_PRINTSCREEN }, + { KS_Insert, SDL_SCANCODE_INSERT }, + { KS_Escape, SDL_SCANCODE_ESCAPE }, + { KS_Return, SDL_SCANCODE_RETURN }, + { KS_Linefeed, SDL_SCANCODE_RETURN }, + { KS_KP_Delete, SDL_SCANCODE_DELETE }, + { KS_KP_Insert, SDL_SCANCODE_INSERT }, + { KS_Control_L, SDL_SCANCODE_LCTRL }, + { KS_Control_R, SDL_SCANCODE_RCTRL }, + { KS_Shift_L, SDL_SCANCODE_LSHIFT }, + { KS_Shift_R, SDL_SCANCODE_RSHIFT }, + { KS_Alt_L, SDL_SCANCODE_LALT }, + { KS_Alt_R, SDL_SCANCODE_RALT }, + { KS_grave, SDL_SCANCODE_GRAVE }, + + { KS_KP_0, SDL_SCANCODE_KP_0 }, + { KS_KP_1, SDL_SCANCODE_KP_1 }, + { KS_KP_2, SDL_SCANCODE_KP_2 }, + { KS_KP_3, SDL_SCANCODE_KP_3 }, + { KS_KP_4, SDL_SCANCODE_KP_4 }, + { KS_KP_5, SDL_SCANCODE_KP_5 }, + { KS_KP_6, SDL_SCANCODE_KP_6 }, + { KS_KP_7, SDL_SCANCODE_KP_7 }, + { KS_KP_8, SDL_SCANCODE_KP_8 }, + { KS_KP_9, SDL_SCANCODE_KP_9 }, + { KS_KP_Enter, SDL_SCANCODE_KP_ENTER }, + { KS_KP_Multiply, SDL_SCANCODE_KP_MULTIPLY }, + { KS_KP_Add, SDL_SCANCODE_KP_PLUS }, + { KS_KP_Subtract, SDL_SCANCODE_KP_MINUS }, + { KS_KP_Divide, SDL_SCANCODE_KP_DIVIDE }, + { KS_KP_Up, SDL_SCANCODE_UP }, + { KS_KP_Down, SDL_SCANCODE_DOWN }, + { KS_KP_Left, SDL_SCANCODE_LEFT }, + { KS_KP_Right, SDL_SCANCODE_RIGHT }, + { KS_KP_Equal, SDL_SCANCODE_KP_EQUALS }, + { KS_f1, SDL_SCANCODE_F1 }, + { KS_f2, SDL_SCANCODE_F2 }, + { KS_f3, SDL_SCANCODE_F3 }, + { KS_f4, SDL_SCANCODE_F4 }, + { KS_f5, SDL_SCANCODE_F5 }, + { KS_f6, SDL_SCANCODE_F6 }, + { KS_f7, SDL_SCANCODE_F7 }, + { KS_f8, SDL_SCANCODE_F8 }, + { KS_f9, SDL_SCANCODE_F9 }, + { KS_f10, SDL_SCANCODE_F10 }, + { KS_f11, SDL_SCANCODE_F11 }, + { KS_f12, SDL_SCANCODE_F12 }, + { KS_f13, SDL_SCANCODE_F13 }, + { KS_f14, SDL_SCANCODE_F14 }, + { KS_f15, SDL_SCANCODE_F15 }, + { KS_f16, SDL_SCANCODE_F16 }, + { KS_f17, SDL_SCANCODE_F17 }, + { KS_f18, SDL_SCANCODE_F18 }, + { KS_f19, SDL_SCANCODE_F19 }, + { KS_f20, SDL_SCANCODE_F20 }, #if !defined(__NetBSD__) - {KS_f21, SDL_SCANCODE_F21}, - {KS_f22, SDL_SCANCODE_F22}, - {KS_f23, SDL_SCANCODE_F23}, - {KS_f24, SDL_SCANCODE_F24}, + { KS_f21, SDL_SCANCODE_F21 }, + { KS_f22, SDL_SCANCODE_F22 }, + { KS_f23, SDL_SCANCODE_F23 }, + { KS_f24, SDL_SCANCODE_F24 }, #endif - {KS_Meta_L, SDL_SCANCODE_LGUI}, - {KS_Meta_R, SDL_SCANCODE_RGUI}, - {KS_Zenkaku_Hankaku, SDL_SCANCODE_LANG5}, - {KS_Hiragana_Katakana, SDL_SCANCODE_INTERNATIONAL2}, - {KS_yen, SDL_SCANCODE_INTERNATIONAL3}, - {KS_Henkan, SDL_SCANCODE_INTERNATIONAL4}, - {KS_Muhenkan, SDL_SCANCODE_INTERNATIONAL5}, - {KS_KP_Prior, SDL_SCANCODE_PRIOR}, - - {KS_a, SDL_SCANCODE_A}, - {KS_b, SDL_SCANCODE_B}, - {KS_c, SDL_SCANCODE_C}, - {KS_d, SDL_SCANCODE_D}, - {KS_e, SDL_SCANCODE_E}, - {KS_f, SDL_SCANCODE_F}, - {KS_g, SDL_SCANCODE_G}, - {KS_h, SDL_SCANCODE_H}, - {KS_i, SDL_SCANCODE_I}, - {KS_j, SDL_SCANCODE_J}, - {KS_k, SDL_SCANCODE_K}, - {KS_l, SDL_SCANCODE_L}, - {KS_m, SDL_SCANCODE_M}, - {KS_n, SDL_SCANCODE_N}, - {KS_o, SDL_SCANCODE_O}, - {KS_p, SDL_SCANCODE_P}, - {KS_q, SDL_SCANCODE_Q}, - {KS_r, SDL_SCANCODE_R}, - {KS_s, SDL_SCANCODE_S}, - {KS_t, SDL_SCANCODE_T}, - {KS_u, SDL_SCANCODE_U}, - {KS_v, SDL_SCANCODE_V}, - {KS_w, SDL_SCANCODE_W}, - {KS_x, SDL_SCANCODE_X}, - {KS_y, SDL_SCANCODE_Y}, - {KS_z, SDL_SCANCODE_Z}, - - {KS_0, SDL_SCANCODE_0}, - {KS_1, SDL_SCANCODE_1}, - {KS_2, SDL_SCANCODE_2}, - {KS_3, SDL_SCANCODE_3}, - {KS_4, SDL_SCANCODE_4}, - {KS_5, SDL_SCANCODE_5}, - {KS_6, SDL_SCANCODE_6}, - {KS_7, SDL_SCANCODE_7}, - {KS_8, SDL_SCANCODE_8}, - {KS_9, SDL_SCANCODE_9}, - {KS_minus, SDL_SCANCODE_MINUS}, - {KS_equal, SDL_SCANCODE_EQUALS}, - {KS_Tab, SDL_SCANCODE_TAB}, - {KS_KP_Tab, SDL_SCANCODE_KP_TAB}, - {KS_apostrophe, SDL_SCANCODE_APOSTROPHE}, - {KS_bracketleft, SDL_SCANCODE_LEFTBRACKET}, - {KS_bracketright, SDL_SCANCODE_RIGHTBRACKET}, - {KS_semicolon, SDL_SCANCODE_SEMICOLON}, - {KS_comma, SDL_SCANCODE_COMMA}, - {KS_period, SDL_SCANCODE_PERIOD}, - {KS_slash, SDL_SCANCODE_SLASH}, - {KS_backslash, SDL_SCANCODE_BACKSLASH} + { KS_Meta_L, SDL_SCANCODE_LGUI }, + { KS_Meta_R, SDL_SCANCODE_RGUI }, + { KS_Zenkaku_Hankaku, SDL_SCANCODE_LANG5 }, + { KS_Hiragana_Katakana, SDL_SCANCODE_INTERNATIONAL2 }, + { KS_yen, SDL_SCANCODE_INTERNATIONAL3 }, + { KS_Henkan, SDL_SCANCODE_INTERNATIONAL4 }, + { KS_Muhenkan, SDL_SCANCODE_INTERNATIONAL5 }, + { KS_KP_Prior, SDL_SCANCODE_PRIOR }, + + { KS_a, SDL_SCANCODE_A }, + { KS_b, SDL_SCANCODE_B }, + { KS_c, SDL_SCANCODE_C }, + { KS_d, SDL_SCANCODE_D }, + { KS_e, SDL_SCANCODE_E }, + { KS_f, SDL_SCANCODE_F }, + { KS_g, SDL_SCANCODE_G }, + { KS_h, SDL_SCANCODE_H }, + { KS_i, SDL_SCANCODE_I }, + { KS_j, SDL_SCANCODE_J }, + { KS_k, SDL_SCANCODE_K }, + { KS_l, SDL_SCANCODE_L }, + { KS_m, SDL_SCANCODE_M }, + { KS_n, SDL_SCANCODE_N }, + { KS_o, SDL_SCANCODE_O }, + { KS_p, SDL_SCANCODE_P }, + { KS_q, SDL_SCANCODE_Q }, + { KS_r, SDL_SCANCODE_R }, + { KS_s, SDL_SCANCODE_S }, + { KS_t, SDL_SCANCODE_T }, + { KS_u, SDL_SCANCODE_U }, + { KS_v, SDL_SCANCODE_V }, + { KS_w, SDL_SCANCODE_W }, + { KS_x, SDL_SCANCODE_X }, + { KS_y, SDL_SCANCODE_Y }, + { KS_z, SDL_SCANCODE_Z }, + + { KS_0, SDL_SCANCODE_0 }, + { KS_1, SDL_SCANCODE_1 }, + { KS_2, SDL_SCANCODE_2 }, + { KS_3, SDL_SCANCODE_3 }, + { KS_4, SDL_SCANCODE_4 }, + { KS_5, SDL_SCANCODE_5 }, + { KS_6, SDL_SCANCODE_6 }, + { KS_7, SDL_SCANCODE_7 }, + { KS_8, SDL_SCANCODE_8 }, + { KS_9, SDL_SCANCODE_9 }, + { KS_minus, SDL_SCANCODE_MINUS }, + { KS_equal, SDL_SCANCODE_EQUALS }, + { KS_Tab, SDL_SCANCODE_TAB }, + { KS_KP_Tab, SDL_SCANCODE_KP_TAB }, + { KS_apostrophe, SDL_SCANCODE_APOSTROPHE }, + { KS_bracketleft, SDL_SCANCODE_LEFTBRACKET }, + { KS_bracketright, SDL_SCANCODE_RIGHTBRACKET }, + { KS_semicolon, SDL_SCANCODE_SEMICOLON }, + { KS_comma, SDL_SCANCODE_COMMA }, + { KS_period, SDL_SCANCODE_PERIOD }, + { KS_slash, SDL_SCANCODE_SLASH }, + { KS_backslash, SDL_SCANCODE_BACKSLASH } }; -typedef struct { +typedef struct +{ int fd; struct wskbd_map_data keymap; int ledstate; @@ -397,34 +406,34 @@ typedef struct { int type; } SDL_WSCONS_input_data; -static SDL_WSCONS_input_data* inputs[4] = {NULL, NULL, NULL, NULL}; -static SDL_WSCONS_mouse_input_data* mouseInputData = NULL; -#define IS_CONTROL_HELD (input->shiftstate[2] > 0) -#define IS_ALT_HELD (input->shiftstate[1] > 0) -#define IS_SHIFT_HELD ((input->shiftstate[0] > 0) || (input->ledstate & (1 << 5))) +static SDL_WSCONS_input_data *inputs[4] = { NULL, NULL, NULL, NULL }; +static SDL_WSCONS_mouse_input_data *mouseInputData = NULL; +#define IS_CONTROL_HELD (input->shiftstate[2] > 0) +#define IS_ALT_HELD (input->shiftstate[1] > 0) +#define IS_SHIFT_HELD ((input->shiftstate[0] > 0) || (input->ledstate & (1 << 5))) #define IS_ALTGR_MODE ((input->ledstate & (1 << 4)) || (input->shiftstate[3] > 0)) #define IS_NUMLOCK_ON (input->ledstate & LED_NUM) #define IS_SCROLLLOCK_ON (input->ledstate & LED_SCR) #define IS_CAPSLOCK_ON (input->ledstate & LED_CAP) -static SDL_WSCONS_input_data* SDL_WSCONS_Init_Keyboard(const char* dev) +static SDL_WSCONS_input_data *SDL_WSCONS_Init_Keyboard(const char *dev) { #ifdef WSKBDIO_SETVERSION int version = WSKBDIO_EVENT_VERSION; #endif - SDL_WSCONS_input_data* input = (SDL_WSCONS_input_data*)SDL_calloc(1, sizeof(SDL_WSCONS_input_data)); + SDL_WSCONS_input_data *input = (SDL_WSCONS_input_data *)SDL_calloc(1, sizeof(SDL_WSCONS_input_data)); if (!input) { return input; } - input->fd = open(dev,O_RDWR | O_NONBLOCK | O_CLOEXEC); + input->fd = open(dev, O_RDWR | O_NONBLOCK | O_CLOEXEC); if (input->fd == -1) { free(input); input = NULL; return NULL; } input->keymap.map = SDL_calloc(sizeof(struct wscons_keymap), KS_NUMKEYCODES); - if (input->keymap.map == NULL) { + if (!input->keymap.map) { free(input); return NULL; } @@ -440,7 +449,7 @@ static SDL_WSCONS_input_data* SDL_WSCONS_Init_Keyboard(const char* dev) return input; } -void SDL_WSCONS_Init() +void SDL_WSCONS_Init(void) { inputs[0] = SDL_WSCONS_Init_Keyboard("/dev/wskbd0"); inputs[1] = SDL_WSCONS_Init_Keyboard("/dev/wskbd1"); @@ -451,10 +460,10 @@ void SDL_WSCONS_Init() return; } -void SDL_WSCONS_Quit() +void SDL_WSCONS_Quit(void) { int i = 0; - SDL_WSCONS_input_data* input = NULL; + SDL_WSCONS_input_data *input = NULL; SDL_WSCONS_Quit_Mouse(mouseInputData); mouseInputData = NULL; @@ -462,7 +471,7 @@ void SDL_WSCONS_Quit() input = inputs[i]; if (input) { if (input->fd != -1 && input->fd != 0) { - ioctl(input->fd,WSKBDIO_SETLEDS, &input->origledstate); + ioctl(input->fd, WSKBDIO_SETLEDS, &input->origledstate); close(input->fd); input->fd = -1; } @@ -476,12 +485,12 @@ void SDL_WSCONS_Quit() static void put_queue(SDL_WSCONS_input_data *kbd, uint c) { /* c is already part of a UTF-8 sequence and safe to add as a character */ - if (kbd->text_len < (sizeof(kbd->text)-1)) { + if (kbd->text_len < (sizeof(kbd->text) - 1)) { kbd->text[kbd->text_len++] = (char)(c); } } -static void put_utf8(SDL_WSCONS_input_data* input, uint c) +static void put_utf8(SDL_WSCONS_input_data *input, uint c) { if (c < 0x80) /* 0******* */ @@ -491,10 +500,12 @@ static void put_utf8(SDL_WSCONS_input_data* input, uint c) put_queue(input, 0xc0 | (c >> 6)); put_queue(input, 0x80 | (c & 0x3f)); } else if (c < 0x10000) { - if (c >= 0xD800 && c <= 0xF500) + if (c >= 0xD800 && c <= 0xF500) { return; - if (c == 0xFFFF) + } + if (c == 0xFFFF) { return; + } /* 1110**** 10****** 10****** */ put_queue(input, 0xe0 | (c >> 12)); put_queue(input, 0x80 | ((c >> 6) & 0x3f)); @@ -508,12 +519,14 @@ static void put_utf8(SDL_WSCONS_input_data* input, uint c) } } -static void Translate_to_text(SDL_WSCONS_input_data* input, keysym_t ksym) +static void Translate_to_text(SDL_WSCONS_input_data *input, keysym_t ksym) { if (KS_GROUP(ksym) == KS_GROUP_Keypad) { - if (SDL_isprint(ksym & 0xFF)) ksym &= 0xFF; + if (SDL_isprint(ksym & 0xFF)) { + ksym &= 0xFF; + } } - switch(ksym) { + switch (ksym) { case KS_Escape: case KS_Delete: case KS_BackSpace: @@ -534,19 +547,21 @@ static void Translate_to_text(SDL_WSCONS_input_data* input, keysym_t ksym) } } -static void Translate_to_keycode(SDL_WSCONS_input_data* input, int type, keysym_t ksym) +static void Translate_to_keycode(SDL_WSCONS_input_data *input, int type, keysym_t ksym) { struct wscons_keymap keyDesc = input->keymap.map[ksym]; - keysym_t* group = &keyDesc.group1[KS_GROUP(keyDesc.group1[0]) == KS_GROUP_Keypad && IS_NUMLOCK_ON ? !IS_SHIFT_HELD : 0]; + keysym_t *group = &keyDesc.group1[KS_GROUP(keyDesc.group1[0]) == KS_GROUP_Keypad && IS_NUMLOCK_ON ? !IS_SHIFT_HELD : 0]; int i = 0; /* Check command first, then group[0]*/ switch (keyDesc.command) { - case KS_Cmd_ScrollBack: { + case KS_Cmd_ScrollBack: + { SDL_SendKeyboardKey(type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_PAGEUP); return; } - case KS_Cmd_ScrollFwd: { + case KS_Cmd_ScrollFwd: + { SDL_SendKeyboardKey(type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_PAGEDOWN); return; } @@ -558,169 +573,237 @@ static void Translate_to_keycode(SDL_WSCONS_input_data* input, int type, keysym_ } } SDL_SendKeyboardKey(type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_UNKNOWN); - } -static void updateKeyboard(SDL_WSCONS_input_data* input) +static void updateKeyboard(SDL_WSCONS_input_data *input) { struct wscons_event events[64]; int type; - int n,i,gindex,acc_i; + int n, i, gindex, acc_i; keysym_t *group; keysym_t ksym, result; - if (!input) return; + if (!input) { + return; + } if ((n = read(input->fd, events, sizeof(events))) > 0) { n /= sizeof(struct wscons_event); for (i = 0; i < n; i++) { type = events[i].type; - switch(type) { - case WSCONS_EVENT_KEY_DOWN: { + switch (type) { + case WSCONS_EVENT_KEY_DOWN: + { switch (input->keymap.map[events[i].value].group1[0]) { - case KS_Hold_Screen: { - if (input->lockheldstate[0] >= 1) break; + case KS_Hold_Screen: + { + if (input->lockheldstate[0] >= 1) { + break; + } input->ledstate ^= LED_SCR; ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->lockheldstate[0] = 1; break; } - case KS_Num_Lock: { - if (input->lockheldstate[1] >= 1) break; + case KS_Num_Lock: + { + if (input->lockheldstate[1] >= 1) { + break; + } input->ledstate ^= LED_NUM; ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->lockheldstate[1] = 1; break; } - case KS_Caps_Lock: { - if (input->lockheldstate[2] >= 1) break; + case KS_Caps_Lock: + { + if (input->lockheldstate[2] >= 1) { + break; + } input->ledstate ^= LED_CAP; ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->lockheldstate[2] = 1; break; } #ifndef __NetBSD__ - case KS_Mode_Lock: { - if (input->lockheldstate[3] >= 1) break; + case KS_Mode_Lock: + { + if (input->lockheldstate[3] >= 1) { + break; + } input->ledstate ^= 1 << 4; ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->lockheldstate[3] = 1; break; } #endif - case KS_Shift_Lock: { - if (input->lockheldstate[4] >= 1) break; + case KS_Shift_Lock: + { + if (input->lockheldstate[4] >= 1) { + break; + } input->ledstate ^= 1 << 5; ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->lockheldstate[4] = 1; break; } - case KS_Shift_L: { - if (input->shiftheldstate[0]) break; + case KS_Shift_L: + { + if (input->shiftheldstate[0]) { + break; + } input->shiftstate[0]++; input->shiftheldstate[0] = 1; break; } - case KS_Shift_R: { - if (input->shiftheldstate[1]) break; + case KS_Shift_R: + { + if (input->shiftheldstate[1]) { + break; + } input->shiftstate[0]++; input->shiftheldstate[1] = 1; break; } - case KS_Alt_L: { - if (input->shiftheldstate[2]) break; + case KS_Alt_L: + { + if (input->shiftheldstate[2]) { + break; + } input->shiftstate[1]++; input->shiftheldstate[2] = 1; break; } - case KS_Alt_R: { - if (input->shiftheldstate[3]) break; + case KS_Alt_R: + { + if (input->shiftheldstate[3]) { + break; + } input->shiftstate[1]++; input->shiftheldstate[3] = 1; break; } - case KS_Control_L: { - if (input->shiftheldstate[4]) break; + case KS_Control_L: + { + if (input->shiftheldstate[4]) { + break; + } input->shiftstate[2]++; input->shiftheldstate[4] = 1; break; } - case KS_Control_R: { - if (input->shiftheldstate[5]) break; + case KS_Control_R: + { + if (input->shiftheldstate[5]) { + break; + } input->shiftstate[2]++; input->shiftheldstate[5] = 1; break; } - case KS_Mode_switch: { - if (input->shiftheldstate[6]) break; + case KS_Mode_switch: + { + if (input->shiftheldstate[6]) { + break; + } input->shiftstate[3]++; input->shiftheldstate[6] = 1; break; } } - } - break; - case WSCONS_EVENT_KEY_UP: { - switch(input->keymap.map[events[i].value].group1[0]) { - case KS_Hold_Screen: { - if (input->lockheldstate[0]) input->lockheldstate[0] = 0; - } - break; - case KS_Num_Lock: { - if (input->lockheldstate[1]) input->lockheldstate[1] = 0; - } - break; - case KS_Caps_Lock: { - if (input->lockheldstate[2]) input->lockheldstate[2] = 0; - } - break; + } break; + case WSCONS_EVENT_KEY_UP: + { + switch (input->keymap.map[events[i].value].group1[0]) { + case KS_Hold_Screen: + { + if (input->lockheldstate[0]) { + input->lockheldstate[0] = 0; + } + } break; + case KS_Num_Lock: + { + if (input->lockheldstate[1]) { + input->lockheldstate[1] = 0; + } + } break; + case KS_Caps_Lock: + { + if (input->lockheldstate[2]) { + input->lockheldstate[2] = 0; + } + } break; #ifndef __NetBSD__ - case KS_Mode_Lock: { - if (input->lockheldstate[3]) input->lockheldstate[3] = 0; - } - break; + case KS_Mode_Lock: + { + if (input->lockheldstate[3]) { + input->lockheldstate[3] = 0; + } + } break; #endif - case KS_Shift_Lock: { - if (input->lockheldstate[4]) input->lockheldstate[4] = 0; - } - break; - case KS_Shift_L: { + case KS_Shift_Lock: + { + if (input->lockheldstate[4]) { + input->lockheldstate[4] = 0; + } + } break; + case KS_Shift_L: + { input->shiftheldstate[0] = 0; - if (input->shiftstate[0]) input->shiftstate[0]--; + if (input->shiftstate[0]) { + input->shiftstate[0]--; + } break; } - case KS_Shift_R: { + case KS_Shift_R: + { input->shiftheldstate[1] = 0; - if (input->shiftstate[0]) input->shiftstate[0]--; + if (input->shiftstate[0]) { + input->shiftstate[0]--; + } break; } - case KS_Alt_L: { + case KS_Alt_L: + { input->shiftheldstate[2] = 0; - if (input->shiftstate[1]) input->shiftstate[1]--; + if (input->shiftstate[1]) { + input->shiftstate[1]--; + } break; } - case KS_Alt_R: { + case KS_Alt_R: + { input->shiftheldstate[3] = 0; - if (input->shiftstate[1]) input->shiftstate[1]--; + if (input->shiftstate[1]) { + input->shiftstate[1]--; + } break; } - case KS_Control_L: { + case KS_Control_L: + { input->shiftheldstate[4] = 0; - if (input->shiftstate[2]) input->shiftstate[2]--; + if (input->shiftstate[2]) { + input->shiftstate[2]--; + } break; } - case KS_Control_R: { + case KS_Control_R: + { input->shiftheldstate[5] = 0; - if (input->shiftstate[2]) input->shiftstate[2]--; + if (input->shiftstate[2]) { + input->shiftstate[2]--; + } break; } - case KS_Mode_switch: { + case KS_Mode_switch: + { input->shiftheldstate[6] = 0; - if (input->shiftstate[3]) input->shiftstate[3]--; + if (input->shiftstate[3]) { + input->shiftstate[3]--; + } break; } } - } - break; + } break; case WSCONS_EVENT_ALL_KEYS_UP: for (i = 0; i < SDL_NUM_SCANCODES; i++) { SDL_SendKeyboardKey(SDL_RELEASED, i); @@ -730,10 +813,12 @@ static void updateKeyboard(SDL_WSCONS_input_data* input) if (input->type == WSKBD_TYPE_USB && events[i].value <= 0xE7) SDL_SendKeyboardKey(type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)events[i].value); - else + else Translate_to_keycode(input, type, events[i].value); - if (type == WSCONS_EVENT_KEY_UP) continue; + if (type == WSCONS_EVENT_KEY_UP) { + continue; + } if (IS_ALTGR_MODE && !IS_CONTROL_HELD) group = &input->keymap.map[events[i].value].group2[0]; @@ -763,7 +848,7 @@ static void updateKeyboard(SDL_WSCONS_input_data* input) case KS_GROUP_Mod: if (ksym == KS_Multi_key) { input->ledstate |= WSKBD_LED_COMPOSE; - ioctl(input->fd,WSKBDIO_SETLEDS, &input->ledstate); + ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->composelen = 2; input->composebuffer[0] = input->composebuffer[1] = 0; } @@ -771,14 +856,17 @@ static void updateKeyboard(SDL_WSCONS_input_data* input) case KS_GROUP_Dead: if (input->composelen == 0) { input->ledstate |= WSKBD_LED_COMPOSE; - ioctl(input->fd,WSKBDIO_SETLEDS, &input->ledstate); + ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); input->composelen = 1; input->composebuffer[0] = ksym; input->composebuffer[1] = 0; - } else result = ksym; + } else + result = ksym; break; } - if (result == KS_voidSymbol) continue; + if (result == KS_voidSymbol) { + continue; + } if (input->composelen > 0) { if (input->composelen == 2 && group == &input->keymap.map[events[i].value].group2[0]) { @@ -793,49 +881,53 @@ static void updateKeyboard(SDL_WSCONS_input_data* input) if (--input->composelen == 0) { result = KS_voidSymbol; input->ledstate &= ~WSKBD_LED_COMPOSE; - ioctl(input->fd,WSKBDIO_SETLEDS, &input->ledstate); + ioctl(input->fd, WSKBDIO_SETLEDS, &input->ledstate); for (acc_i = 0; acc_i < SDL_arraysize(compose_tab); acc_i++) { - if ((compose_tab[acc_i].elem[0] == input->composebuffer[0] - && compose_tab[acc_i].elem[1] == input->composebuffer[1]) - || (compose_tab[acc_i].elem[0] == input->composebuffer[1] - && compose_tab[acc_i].elem[1] == input->composebuffer[0])) { + if ((compose_tab[acc_i].elem[0] == input->composebuffer[0] && compose_tab[acc_i].elem[1] == input->composebuffer[1]) || (compose_tab[acc_i].elem[0] == input->composebuffer[1] && compose_tab[acc_i].elem[1] == input->composebuffer[0])) { result = compose_tab[acc_i].result; break; } } - } else continue; + } else + continue; } } if (KS_GROUP(result) == KS_GROUP_Ascii) { if (IS_CONTROL_HELD) { - if ((result >= KS_at && result <= KS_z) || result == KS_space) + if ((result >= KS_at && result <= KS_z) || result == KS_space) { result = result & 0x1f; - else if (result == KS_2) + } else if (result == KS_2) { result = 0x00; - else if (result >= KS_3 && result <= KS_7) + } else if (result >= KS_3 && result <= KS_7) { result = KS_Escape + (result - KS_3); - else if (result == KS_8) + } else if (result == KS_8) { result = KS_Delete; + } } if (IS_ALT_HELD) { if (input->encoding & KB_METAESC) { Translate_to_keycode(input, WSCONS_EVENT_KEY_DOWN, KS_Escape); Translate_to_text(input, result); continue; - } else result |= 0x80; + } else { + result |= 0x80; + } } } - Translate_to_text(input,result); + Translate_to_text(input, result); continue; } } } -void SDL_WSCONS_PumpEvents() +void SDL_WSCONS_PumpEvents(void) { int i = 0; - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { updateKeyboard(inputs[i]); - if (mouseInputData != NULL) updateMouse(mouseInputData); + } + if (mouseInputData) { + updateMouse(mouseInputData); + } } diff --git a/src/core/openbsd/SDL_wscons_mouse.c b/src/core/openbsd/SDL_wscons_mouse.c index 42c83cec80b3f..8b04634fbb47b 100644 --- a/src/core/openbsd/SDL_wscons_mouse.c +++ b/src/core/openbsd/SDL_wscons_mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,16 +35,21 @@ typedef struct SDL_WSCONS_mouse_input_data int fd; } SDL_WSCONS_mouse_input_data; -SDL_WSCONS_mouse_input_data* SDL_WSCONS_Init_Mouse() +SDL_WSCONS_mouse_input_data *SDL_WSCONS_Init_Mouse() { #ifdef WSMOUSEIO_SETVERSION int version = WSMOUSE_EVENT_VERSION; #endif - SDL_WSCONS_mouse_input_data* mouseInputData = SDL_calloc(1, sizeof(SDL_WSCONS_mouse_input_data)); + SDL_WSCONS_mouse_input_data *mouseInputData = SDL_calloc(1, sizeof(SDL_WSCONS_mouse_input_data)); - if (!mouseInputData) return NULL; - mouseInputData->fd = open("/dev/wsmouse",O_RDWR | O_NONBLOCK | O_CLOEXEC); - if (mouseInputData->fd == -1) {free(mouseInputData); return NULL; } + if (!mouseInputData) { + return NULL; + } + mouseInputData->fd = open("/dev/wsmouse", O_RDWR | O_NONBLOCK | O_CLOEXEC); + if (mouseInputData->fd == -1) { + free(mouseInputData); + return NULL; + } #ifdef WSMOUSEIO_SETMODE ioctl(mouseInputData->fd, WSMOUSEIO_SETMODE, WSMOUSE_COMPAT); #endif @@ -54,81 +59,76 @@ SDL_WSCONS_mouse_input_data* SDL_WSCONS_Init_Mouse() return mouseInputData; } -void updateMouse(SDL_WSCONS_mouse_input_data* inputData) +void updateMouse(SDL_WSCONS_mouse_input_data *inputData) { struct wscons_event events[64]; int type; - int n,i; - SDL_Mouse* mouse = SDL_GetMouse(); + int n, i; + SDL_Mouse *mouse = SDL_GetMouse(); - if ((n = read(inputData->fd, events, sizeof(events))) > 0) - { + if ((n = read(inputData->fd, events, sizeof(events))) > 0) { n /= sizeof(struct wscons_event); - for (i = 0; i < n; i++) - { + for (i = 0; i < n; i++) { type = events[i].type; - switch(type) - { + switch (type) { case WSCONS_EVENT_MOUSE_DOWN: - { - switch (events[i].value) - { - case 0: /* Left Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_LEFT); - break; - case 1: /* Middle Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_MIDDLE); - break; - case 2: /* Right Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_RIGHT); - break; - } + { + switch (events[i].value) { + case 0: /* Left Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_LEFT); + break; + case 1: /* Middle Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_MIDDLE); + break; + case 2: /* Right Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_PRESSED, SDL_BUTTON_RIGHT); + break; } - break; + } break; case WSCONS_EVENT_MOUSE_UP: - { - switch (events[i].value) - { - case 0: /* Left Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_LEFT); - break; - case 1: /* Middle Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_MIDDLE); - break; - case 2: /* Right Mouse Button. */ - SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_RIGHT); - break; - } - } - break; - case WSCONS_EVENT_MOUSE_DELTA_X: - { - SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, events[i].value, 0); + { + switch (events[i].value) { + case 0: /* Left Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_LEFT); break; - } - case WSCONS_EVENT_MOUSE_DELTA_Y: - { - SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, 0, -events[i].value); + case 1: /* Middle Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_MIDDLE); break; - } - case WSCONS_EVENT_MOUSE_DELTA_W: - { - SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0, SDL_MOUSEWHEEL_NORMAL); + case 2: /* Right Mouse Button. */ + SDL_SendMouseButton(mouse->focus, mouse->mouseID, SDL_RELEASED, SDL_BUTTON_RIGHT); break; } + } break; + case WSCONS_EVENT_MOUSE_DELTA_X: + { + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, events[i].value, 0); + break; + } + case WSCONS_EVENT_MOUSE_DELTA_Y: + { + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, 0, -events[i].value); + break; + } + case WSCONS_EVENT_MOUSE_DELTA_W: + { + SDL_SendMouseWheel(mouse->focus, mouse->mouseID, events[i].value, 0, SDL_MOUSEWHEEL_NORMAL); + break; + } case WSCONS_EVENT_MOUSE_DELTA_Z: - { - SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, -events[i].value, SDL_MOUSEWHEEL_NORMAL); - break; - } + { + SDL_SendMouseWheel(mouse->focus, mouse->mouseID, 0, -events[i].value, SDL_MOUSEWHEEL_NORMAL); + break; + } } } } } -void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data* inputData) +void SDL_WSCONS_Quit_Mouse(SDL_WSCONS_mouse_input_data *inputData) { - if (!inputData) return; + if (!inputData) { + return; + } close(inputData->fd); free(inputData); } diff --git a/src/core/os2/SDL_os2.c b/src/core/os2/SDL_os2.c index 553f88cfd5c89..138652cac038e 100644 --- a/src/core/os2/SDL_os2.c +++ b/src/core/os2/SDL_os2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/os2/SDL_os2.h b/src/core/os2/SDL_os2.h index 84068cc137d5d..4f90d7fc68c43 100644 --- a/src/core/os2/SDL_os2.h +++ b/src/core/os2/SDL_os2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/os2/geniconv/geniconv.c b/src/core/os2/geniconv/geniconv.c index 5976fe79fde26..81ceaec987053 100644 --- a/src/core/os2/geniconv/geniconv.c +++ b/src/core/os2/geniconv/geniconv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/os2/geniconv/geniconv.h b/src/core/os2/geniconv/geniconv.h index 607fe8f8d3966..8483d0fe96fa5 100644 --- a/src/core/os2/geniconv/geniconv.h +++ b/src/core/os2/geniconv/geniconv.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/os2/geniconv/os2cp.c b/src/core/os2/geniconv/os2cp.c index 0a651e17dbb8f..ee321102a014c 100644 --- a/src/core/os2/geniconv/os2cp.c +++ b/src/core/os2/geniconv/os2cp.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -357,7 +357,7 @@ unsigned long os2cpFromName(char *cp) PCHAR pcEnd; CHAR acBuf[64]; - if (cp == NULL) { + if (!cp) { ULONG aulCP[3]; ULONG cCP; return (DosQueryCp(sizeof(aulCP), aulCP, &cCP) != NO_ERROR)? 0 : aulCP[0]; @@ -368,7 +368,7 @@ unsigned long os2cpFromName(char *cp) } pcEnd = SDL_strchr(cp, ' '); - if (pcEnd == NULL) { + if (!pcEnd) { pcEnd = SDL_strchr(cp, '\0'); } ulNext = pcEnd - cp; diff --git a/src/core/os2/geniconv/os2cp.h b/src/core/os2/geniconv/os2cp.h index db3e167ec562c..9ea8b99cba818 100644 --- a/src/core/os2/geniconv/os2cp.h +++ b/src/core/os2/geniconv/os2cp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/os2/geniconv/os2iconv.c b/src/core/os2/geniconv/os2iconv.c index 13ad2cdc60c15..dd9fc5e367355 100644 --- a/src/core/os2/geniconv/os2iconv.c +++ b/src/core/os2/geniconv/os2iconv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -76,7 +76,7 @@ static int _createUconvObj(const char *code, UconvObject *uobj) const unsigned char *ch = (const unsigned char *)code; - if (code == NULL) + if (!code) uc_code[0] = 0; else { for (i = 0; i < MAX_CP_NAME_LEN; i++) { @@ -119,10 +119,10 @@ iconv_t _System os2_iconv_open(const char* tocode, const char* fromcode) int rc; iuconv_obj *iuobj; - if (tocode == NULL) { + if (!tocode) { tocode = ""; } - if (fromcode == NULL) { + if (!fromcode) { fromcode = ""; } @@ -169,7 +169,7 @@ size_t _System os2_iconv(iconv_t cd, int rc; size_t ret = (size_t)(-1); - if (uo_tocode == NULL && uo_fromcode == NULL) { + if (!uo_tocode && !uo_fromcode) { uc_buf_len = SDL_min(*inbytesleft, *outbytesleft); SDL_memcpy(*outbuf, *inbuf, uc_buf_len); *inbytesleft -= uc_buf_len; diff --git a/src/core/os2/geniconv/sys2utf8.c b/src/core/os2/geniconv/sys2utf8.c index 753e9b67fce5f..ec53d9f94adb0 100644 --- a/src/core/os2/geniconv/sys2utf8.c +++ b/src/core/os2/geniconv/sys2utf8.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -95,7 +95,7 @@ char *StrUTF8New(int to_utf8, char *str, int c_str) int c_newstr = (((c_str > 4) ? c_str : 4) + 1) * 2; char * newstr = (char *) SDL_malloc(c_newstr); - if (newstr == NULL) { + if (!newstr) { return NULL; } diff --git a/src/core/os2/geniconv/test.c b/src/core/os2/geniconv/test.c index 25e16228ae05b..251ca92bd2e7b 100644 --- a/src/core/os2/geniconv/test.c +++ b/src/core/os2/geniconv/test.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ int main(void) { char acBuf[128]; - char *inbuf = " - "; /* KOI8-R string */ + char *inbuf = "\xf4\xc5\xd3\xd4\x20\x2d\x20\xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1"; /* KOI8-R encoding of "Тест - проверка" */ size_t inbytesleft = strlen(inbuf); char *outbuf = acBuf; size_t outbytesleft = sizeof(acBuf); diff --git a/src/core/unix/SDL_poll.c b/src/core/unix/SDL_poll.c index f86b3ada6a250..9bcc8f0f8bb99 100644 --- a/src/core/unix/SDL_poll.c +++ b/src/core/unix/SDL_poll.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,17 +32,14 @@ #endif #include - -int -SDL_IOReady(int fd, int flags, int timeoutMS) +int SDL_IOReady(int fd, int flags, int timeoutMS) { int result; SDL_assert(flags & (SDL_IOR_READ | SDL_IOR_WRITE)); /* Note: We don't bother to account for elapsed time if we get EINTR */ - do - { + do { #ifdef HAVE_POLL struct pollfd info; @@ -83,7 +80,7 @@ SDL_IOReady(int fd, int flags, int timeoutMS) result = select(fd + 1, rfdp, wfdp, NULL, tvp); #endif /* HAVE_POLL */ - } while ( result < 0 && errno == EINTR && !(flags & SDL_IOR_NO_RETRY)); + } while (result < 0 && errno == EINTR && !(flags & SDL_IOR_NO_RETRY)); return result; } diff --git a/src/core/unix/SDL_poll.h b/src/core/unix/SDL_poll.h index 02d09c9f977bd..045068efe12cd 100644 --- a/src/core/unix/SDL_poll.h +++ b/src/core/unix/SDL_poll.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/windows/SDL_directx.h b/src/core/windows/SDL_directx.h index bb69c578154eb..128df87ef1b40 100644 --- a/src/core/windows/SDL_directx.h +++ b/src/core/windows/SDL_directx.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ #ifndef WIN32 #define WIN32 #endif -#undef WINNT +#undef WINNT /* Far pointers don't exist in 32-bit code */ #ifndef FAR @@ -39,35 +39,35 @@ /* Error codes not yet included in Win32 API header files */ #ifndef MAKE_HRESULT -#define MAKE_HRESULT(sev,fac,code) \ - ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code)))) +#define MAKE_HRESULT(sev, fac, code) \ + ((HRESULT)(((unsigned long)(sev) << 31) | ((unsigned long)(fac) << 16) | ((unsigned long)(code)))) #endif #ifndef S_OK -#define S_OK (HRESULT)0x00000000L +#define S_OK (HRESULT)0x00000000L #endif #ifndef SUCCEEDED -#define SUCCEEDED(x) ((HRESULT)(x) >= 0) +#define SUCCEEDED(x) ((HRESULT)(x) >= 0) #endif #ifndef FAILED -#define FAILED(x) ((HRESULT)(x)<0) +#define FAILED(x) ((HRESULT)(x) < 0) #endif #ifndef E_FAIL -#define E_FAIL (HRESULT)0x80000008L +#define E_FAIL (HRESULT)0x80000008L #endif #ifndef E_NOINTERFACE -#define E_NOINTERFACE (HRESULT)0x80004002L +#define E_NOINTERFACE (HRESULT)0x80004002L #endif #ifndef E_OUTOFMEMORY -#define E_OUTOFMEMORY (HRESULT)0x8007000EL +#define E_OUTOFMEMORY (HRESULT)0x8007000EL #endif #ifndef E_INVALIDARG -#define E_INVALIDARG (HRESULT)0x80070057L +#define E_INVALIDARG (HRESULT)0x80070057L #endif #ifndef E_NOTIMPL -#define E_NOTIMPL (HRESULT)0x80004001L +#define E_NOTIMPL (HRESULT)0x80004001L #endif #ifndef REGDB_E_CLASSNOTREG #define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L @@ -75,16 +75,16 @@ /* Severity codes */ #ifndef SEVERITY_ERROR -#define SEVERITY_ERROR 1 +#define SEVERITY_ERROR 1 #endif /* Error facility codes */ #ifndef FACILITY_WIN32 -#define FACILITY_WIN32 7 +#define FACILITY_WIN32 7 #endif #ifndef FIELD_OFFSET -#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field)) +#define FIELD_OFFSET(type, field) ((LONG) & (((type *)0)->field)) #endif /* DirectX headers (if it isn't included, I haven't tested it yet) @@ -103,7 +103,10 @@ #ifdef HAVE_DINPUT_H #include #else -typedef struct { int unused; } DIDEVICEINSTANCE; +typedef struct +{ + int unused; +} DIDEVICEINSTANCE; #endif #endif /* SDL_directx_h_ */ diff --git a/src/core/windows/SDL_hid.c b/src/core/windows/SDL_hid.c index d9dd04fbef11c..fddfba2ce8356 100644 --- a/src/core/windows/SDL_hid.c +++ b/src/core/windows/SDL_hid.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,6 @@ #include "SDL_hid.h" - HidD_GetString_t SDL_HidD_GetManufacturerString; HidD_GetString_t SDL_HidD_GetProductString; HidP_GetCaps_t SDL_HidP_GetCaps; @@ -36,14 +35,12 @@ HidP_GetData_t SDL_HidP_GetData; static HMODULE s_pHIDDLL = 0; static int s_HIDDLLRefCount = 0; - -int -WIN_LoadHIDDLL(void) +int WIN_LoadHIDDLL(void) { if (s_pHIDDLL) { SDL_assert(s_HIDDLLRefCount > 0); s_HIDDLLRefCount++; - return 0; /* already loaded */ + return 0; /* already loaded */ } s_pHIDDLL = LoadLibrary(TEXT("hid.dll")); @@ -71,8 +68,7 @@ WIN_LoadHIDDLL(void) return 0; } -void -WIN_UnloadHIDDLL(void) +void WIN_UnloadHIDDLL(void) { if (s_pHIDDLL) { SDL_assert(s_HIDDLLRefCount > 0); diff --git a/src/core/windows/SDL_hid.h b/src/core/windows/SDL_hid.h index 82a001a2e4b5a..869190f917889 100644 --- a/src/core/windows/SDL_hid.h +++ b/src/core/windows/SDL_hid.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,155 +39,166 @@ typedef struct _HIDD_ATTRIBUTES USHORT VersionNumber; } HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES; -typedef enum { +typedef enum +{ HidP_Input = 0, HidP_Output = 1, HidP_Feature = 2 } HIDP_REPORT_TYPE; -typedef struct { - USAGE UsagePage; - UCHAR ReportID; +typedef struct +{ + USAGE UsagePage; + UCHAR ReportID; BOOLEAN IsAlias; - USHORT BitField; - USHORT LinkCollection; - USAGE LinkUsage; - USAGE LinkUsagePage; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; BOOLEAN IsRange; BOOLEAN IsStringRange; BOOLEAN IsDesignatorRange; BOOLEAN IsAbsolute; - ULONG Reserved[ 10 ]; - union { - struct { - USAGE UsageMin; - USAGE UsageMax; - USHORT StringMin; - USHORT StringMax; - USHORT DesignatorMin; - USHORT DesignatorMax; - USHORT DataIndexMin; - USHORT DataIndexMax; + ULONG Reserved[10]; + union + { + struct + { + USAGE UsageMin; + USAGE UsageMax; + USHORT StringMin; + USHORT StringMax; + USHORT DesignatorMin; + USHORT DesignatorMax; + USHORT DataIndexMin; + USHORT DataIndexMax; } Range; - struct { - USAGE Usage; - USAGE Reserved1; - USHORT StringIndex; - USHORT Reserved2; - USHORT DesignatorIndex; - USHORT Reserved3; - USHORT DataIndex; - USHORT Reserved4; + struct + { + USAGE Usage; + USAGE Reserved1; + USHORT StringIndex; + USHORT Reserved2; + USHORT DesignatorIndex; + USHORT Reserved3; + USHORT DataIndex; + USHORT Reserved4; } NotRange; }; } HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS; -typedef struct { - USAGE UsagePage; - UCHAR ReportID; +typedef struct +{ + USAGE UsagePage; + UCHAR ReportID; BOOLEAN IsAlias; - USHORT BitField; - USHORT LinkCollection; - USAGE LinkUsage; - USAGE LinkUsagePage; + USHORT BitField; + USHORT LinkCollection; + USAGE LinkUsage; + USAGE LinkUsagePage; BOOLEAN IsRange; BOOLEAN IsStringRange; BOOLEAN IsDesignatorRange; BOOLEAN IsAbsolute; BOOLEAN HasNull; - UCHAR Reserved; - USHORT BitSize; - USHORT ReportCount; - USHORT Reserved2[ 5 ]; - ULONG UnitsExp; - ULONG Units; - LONG LogicalMin; - LONG LogicalMax; - LONG PhysicalMin; - LONG PhysicalMax; - union { - struct { - USAGE UsageMin; - USAGE UsageMax; - USHORT StringMin; - USHORT StringMax; - USHORT DesignatorMin; - USHORT DesignatorMax; - USHORT DataIndexMin; - USHORT DataIndexMax; + UCHAR Reserved; + USHORT BitSize; + USHORT ReportCount; + USHORT Reserved2[5]; + ULONG UnitsExp; + ULONG Units; + LONG LogicalMin; + LONG LogicalMax; + LONG PhysicalMin; + LONG PhysicalMax; + union + { + struct + { + USAGE UsageMin; + USAGE UsageMax; + USHORT StringMin; + USHORT StringMax; + USHORT DesignatorMin; + USHORT DesignatorMax; + USHORT DataIndexMin; + USHORT DataIndexMax; } Range; - struct { - USAGE Usage; - USAGE Reserved1; - USHORT StringIndex; - USHORT Reserved2; - USHORT DesignatorIndex; - USHORT Reserved3; - USHORT DataIndex; - USHORT Reserved4; + struct + { + USAGE Usage; + USAGE Reserved1; + USHORT StringIndex; + USHORT Reserved2; + USHORT DesignatorIndex; + USHORT Reserved3; + USHORT DataIndex; + USHORT Reserved4; } NotRange; }; } HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS; -typedef struct { - USAGE Usage; - USAGE UsagePage; - USHORT InputReportByteLength; - USHORT OutputReportByteLength; - USHORT FeatureReportByteLength; - USHORT Reserved[ 17 ]; - USHORT NumberLinkCollectionNodes; - USHORT NumberInputButtonCaps; - USHORT NumberInputValueCaps; - USHORT NumberInputDataIndices; - USHORT NumberOutputButtonCaps; - USHORT NumberOutputValueCaps; - USHORT NumberOutputDataIndices; - USHORT NumberFeatureButtonCaps; - USHORT NumberFeatureValueCaps; - USHORT NumberFeatureDataIndices; +typedef struct +{ + USAGE Usage; + USAGE UsagePage; + USHORT InputReportByteLength; + USHORT OutputReportByteLength; + USHORT FeatureReportByteLength; + USHORT Reserved[17]; + USHORT NumberLinkCollectionNodes; + USHORT NumberInputButtonCaps; + USHORT NumberInputValueCaps; + USHORT NumberInputDataIndices; + USHORT NumberOutputButtonCaps; + USHORT NumberOutputValueCaps; + USHORT NumberOutputDataIndices; + USHORT NumberFeatureButtonCaps; + USHORT NumberFeatureValueCaps; + USHORT NumberFeatureDataIndices; } HIDP_CAPS, *PHIDP_CAPS; -typedef struct { - USHORT DataIndex; - USHORT Reserved; - union { - ULONG RawValue; +typedef struct +{ + USHORT DataIndex; + USHORT Reserved; + union + { + ULONG RawValue; BOOLEAN On; }; } HIDP_DATA, *PHIDP_DATA; -#define HIDP_ERROR_CODES( p1, p2 ) ((NTSTATUS)(((p1) << 28) | (0x11 << 16) | (p2))) -#define HIDP_STATUS_SUCCESS HIDP_ERROR_CODES( 0x0, 0x0000 ) -#define HIDP_STATUS_NULL HIDP_ERROR_CODES( 0x8, 0x0001 ) -#define HIDP_STATUS_INVALID_PREPARSED_DATA HIDP_ERROR_CODES( 0xC, 0x0001 ) -#define HIDP_STATUS_INVALID_REPORT_TYPE HIDP_ERROR_CODES( 0xC, 0x0002 ) -#define HIDP_STATUS_INVALID_REPORT_LENGTH HIDP_ERROR_CODES( 0xC, 0x0003 ) -#define HIDP_STATUS_USAGE_NOT_FOUND HIDP_ERROR_CODES( 0xC, 0x0004 ) -#define HIDP_STATUS_VALUE_OUT_OF_RANGE HIDP_ERROR_CODES( 0xC, 0x0005 ) -#define HIDP_STATUS_BAD_LOG_PHY_VALUES HIDP_ERROR_CODES( 0xC, 0x0006 ) -#define HIDP_STATUS_BUFFER_TOO_SMALL HIDP_ERROR_CODES( 0xC, 0x0007 ) -#define HIDP_STATUS_INTERNAL_ERROR HIDP_ERROR_CODES( 0xC, 0x0008 ) -#define HIDP_STATUS_I8042_TRANS_UNKNOWN HIDP_ERROR_CODES( 0xC, 0x0009 ) -#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID HIDP_ERROR_CODES( 0xC, 0x000A ) -#define HIDP_STATUS_NOT_VALUE_ARRAY HIDP_ERROR_CODES( 0xC, 0x000B ) -#define HIDP_STATUS_IS_VALUE_ARRAY HIDP_ERROR_CODES( 0xC, 0x000C ) -#define HIDP_STATUS_DATA_INDEX_NOT_FOUND HIDP_ERROR_CODES( 0xC, 0x000D ) -#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE HIDP_ERROR_CODES( 0xC, 0x000E ) -#define HIDP_STATUS_BUTTON_NOT_PRESSED HIDP_ERROR_CODES( 0xC, 0x000F ) -#define HIDP_STATUS_REPORT_DOES_NOT_EXIST HIDP_ERROR_CODES( 0xC, 0x0010 ) -#define HIDP_STATUS_NOT_IMPLEMENTED HIDP_ERROR_CODES( 0xC, 0x0020 ) - +#define HIDP_ERROR_CODES(p1, p2) ((NTSTATUS)(((p1) << 28) | (0x11 << 16) | (p2))) +#define HIDP_STATUS_SUCCESS HIDP_ERROR_CODES(0x0, 0x0000) +#define HIDP_STATUS_NULL HIDP_ERROR_CODES(0x8, 0x0001) +#define HIDP_STATUS_INVALID_PREPARSED_DATA HIDP_ERROR_CODES(0xC, 0x0001) +#define HIDP_STATUS_INVALID_REPORT_TYPE HIDP_ERROR_CODES(0xC, 0x0002) +#define HIDP_STATUS_INVALID_REPORT_LENGTH HIDP_ERROR_CODES(0xC, 0x0003) +#define HIDP_STATUS_USAGE_NOT_FOUND HIDP_ERROR_CODES(0xC, 0x0004) +#define HIDP_STATUS_VALUE_OUT_OF_RANGE HIDP_ERROR_CODES(0xC, 0x0005) +#define HIDP_STATUS_BAD_LOG_PHY_VALUES HIDP_ERROR_CODES(0xC, 0x0006) +#define HIDP_STATUS_BUFFER_TOO_SMALL HIDP_ERROR_CODES(0xC, 0x0007) +#define HIDP_STATUS_INTERNAL_ERROR HIDP_ERROR_CODES(0xC, 0x0008) +#define HIDP_STATUS_I8042_TRANS_UNKNOWN HIDP_ERROR_CODES(0xC, 0x0009) +#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID HIDP_ERROR_CODES(0xC, 0x000A) +#define HIDP_STATUS_NOT_VALUE_ARRAY HIDP_ERROR_CODES(0xC, 0x000B) +#define HIDP_STATUS_IS_VALUE_ARRAY HIDP_ERROR_CODES(0xC, 0x000C) +#define HIDP_STATUS_DATA_INDEX_NOT_FOUND HIDP_ERROR_CODES(0xC, 0x000D) +#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE HIDP_ERROR_CODES(0xC, 0x000E) +#define HIDP_STATUS_BUTTON_NOT_PRESSED HIDP_ERROR_CODES(0xC, 0x000F) +#define HIDP_STATUS_REPORT_DOES_NOT_EXIST HIDP_ERROR_CODES(0xC, 0x0010) +#define HIDP_STATUS_NOT_IMPLEMENTED HIDP_ERROR_CODES(0xC, 0x0020) extern int WIN_LoadHIDDLL(void); extern void WIN_UnloadHIDDLL(void); -typedef BOOLEAN (WINAPI *HidD_GetString_t)(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); -typedef NTSTATUS (WINAPI *HidP_GetCaps_t)(PHIDP_PREPARSED_DATA PreparsedData, PHIDP_CAPS Capabilities); -typedef NTSTATUS (WINAPI *HidP_GetButtonCaps_t)(HIDP_REPORT_TYPE ReportType, PHIDP_BUTTON_CAPS ButtonCaps, PUSHORT ButtonCapsLength, PHIDP_PREPARSED_DATA PreparsedData); -typedef NTSTATUS (WINAPI *HidP_GetValueCaps_t)(HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, PUSHORT ValueCapsLength, PHIDP_PREPARSED_DATA PreparsedData); -typedef ULONG (WINAPI *HidP_MaxDataListLength_t)(HIDP_REPORT_TYPE ReportType, PHIDP_PREPARSED_DATA PreparsedData); -typedef NTSTATUS (WINAPI *HidP_GetData_t)(HIDP_REPORT_TYPE ReportType, PHIDP_DATA DataList, PULONG DataLength, PHIDP_PREPARSED_DATA PreparsedData, PCHAR Report, ULONG ReportLength); +typedef BOOLEAN(WINAPI *HidD_GetString_t)(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength); +typedef NTSTATUS(WINAPI *HidP_GetCaps_t)(PHIDP_PREPARSED_DATA PreparsedData, PHIDP_CAPS Capabilities); +typedef NTSTATUS(WINAPI *HidP_GetButtonCaps_t)(HIDP_REPORT_TYPE ReportType, PHIDP_BUTTON_CAPS ButtonCaps, PUSHORT ButtonCapsLength, PHIDP_PREPARSED_DATA PreparsedData); +typedef NTSTATUS(WINAPI *HidP_GetValueCaps_t)(HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, PUSHORT ValueCapsLength, PHIDP_PREPARSED_DATA PreparsedData); +typedef ULONG(WINAPI *HidP_MaxDataListLength_t)(HIDP_REPORT_TYPE ReportType, PHIDP_PREPARSED_DATA PreparsedData); +typedef NTSTATUS(WINAPI *HidP_GetData_t)(HIDP_REPORT_TYPE ReportType, PHIDP_DATA DataList, PULONG DataLength, PHIDP_PREPARSED_DATA PreparsedData, PCHAR Report, ULONG ReportLength); extern HidD_GetString_t SDL_HidD_GetManufacturerString; extern HidD_GetString_t SDL_HidD_GetProductString; diff --git a/src/core/windows/SDL_immdevice.c b/src/core/windows/SDL_immdevice.c index 335596d95deee..d08e7b210706e 100644 --- a/src/core/windows/SDL_immdevice.c +++ b/src/core/windows/SDL_immdevice.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,15 @@ */ #include "../../SDL_internal.h" -#if (defined(__WIN32__) || defined(__GDK__)) && HAVE_MMDEVICEAPI_H +#if (defined(__WIN32__) || defined(__GDK__)) && defined(HAVE_MMDEVICEAPI_H) #include "SDL_windows.h" #include "SDL_immdevice.h" +#include "SDL_timer.h" #include "../../audio/SDL_sysaudio.h" #include /* For CLSIDFromString */ -static const ERole SDL_IMMDevice_role = eConsole; /* !!! FIXME: should this be eMultimedia? Should be a hint? */ +static const ERole SDL_IMMDevice_role = eConsole; /* !!! FIXME: should this be eMultimedia? Should be a hint? */ /* This is global to the WASAPI target, to handle hotplug and default device lookup. */ static IMMDeviceEnumerator *enumerator = NULL; @@ -39,6 +40,7 @@ static IMMDeviceEnumerator *enumerator = NULL; #define PropVariantInit(p) SDL_zerop(p) /* Some GUIDs we need to know without linking to libraries that aren't available before Vista. */ +/* *INDENT-OFF* */ /* clang-format off */ static const CLSID SDL_CLSID_MMDeviceEnumerator = { 0xbcde0395, 0xe52f, 0x467c,{ 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e } }; static const IID SDL_IID_IMMDeviceEnumerator = { 0xa95664d2, 0x9614, 0x4f35,{ 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6 } }; static const IID SDL_IID_IMMNotificationClient = { 0x7991eec9, 0x7e89, 0x4d85,{ 0x83, 0x90, 0x6c, 0x70, 0x3c, 0xec, 0x60, 0xc0 } }; @@ -48,13 +50,13 @@ static const PROPERTYKEY SDL_PKEY_AudioEngine_DeviceFormat = { { 0xf19f064d, 0x8 static const PROPERTYKEY SDL_PKEY_AudioEndpoint_GUID = { { 0x1da5d803, 0xd492, 0x4edd,{ 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, } }, 4 }; static const GUID SDL_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; static const GUID SDL_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = { 0x00000003, 0x0000, 0x0010,{ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } }; +/* *INDENT-ON* */ /* clang-format on */ /* these increment as default devices change. Opened default devices pick up changes in their threads. */ SDL_atomic_t SDL_IMMDevice_DefaultPlaybackGeneration; SDL_atomic_t SDL_IMMDevice_DefaultCaptureGeneration; -static void -GetMMDeviceInfo(IMMDevice *device, char **utf8dev, WAVEFORMATEXTENSIBLE *fmt, GUID *guid) +static void GetMMDeviceInfo(IMMDevice *device, char **utf8dev, WAVEFORMATEXTENSIBLE *fmt, GUID *guid) { /* PKEY_Device_FriendlyName gives you "Speakers (SoundBlaster Pro)" which drives me nuts. I'd rather it be "SoundBlaster Pro (Speakers)" but I guess that's developers vs users. Windows uses the FriendlyName in @@ -91,8 +93,7 @@ typedef struct DevIdList static DevIdList *deviceid_list = NULL; -static void -SDL_IMMDevice_Remove(const SDL_bool iscapture, LPCWSTR devid, SDL_bool useguid) +static void SDL_IMMDevice_Remove(const SDL_bool iscapture, LPCWSTR devid, SDL_bool useguid) { DevIdList *i; DevIdList *next; @@ -105,7 +106,7 @@ SDL_IMMDevice_Remove(const SDL_bool iscapture, LPCWSTR devid, SDL_bool useguid) } else { deviceid_list = next; } - SDL_RemoveAudioDevice(iscapture, useguid ? ((void *) i->guid) : ((void *) i->str)); + SDL_RemoveAudioDevice(iscapture, useguid ? ((void *)i->guid) : ((void *)i->str)); SDL_free(i->str); SDL_free(i); } else { @@ -114,8 +115,7 @@ SDL_IMMDevice_Remove(const SDL_bool iscapture, LPCWSTR devid, SDL_bool useguid) } } -static void -SDL_IMMDevice_Add(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid, GUID *dsoundguid, SDL_bool useguid) +static void SDL_IMMDevice_Add(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENSIBLE *fmt, LPCWSTR devid, GUID *dsoundguid, SDL_bool useguid) { DevIdList *devidlist; SDL_AudioSpec spec; @@ -128,22 +128,22 @@ SDL_IMMDevice_Add(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTEN phones and tablets, where you might have an internal speaker and a headphone jack and expect both to be available and switch automatically. (!!! FIXME...?) */ - /* see if we already have this one. */ + /* see if we already have this one. */ for (devidlist = deviceid_list; devidlist; devidlist = devidlist->next) { if (SDL_wcscmp(devidlist->str, devid) == 0) { - return; /* we already have this. */ + return; /* we already have this. */ } } devidlist = (DevIdList *)SDL_malloc(sizeof(*devidlist)); if (!devidlist) { - return; /* oh well. */ + return; /* oh well. */ } devidcopy = SDL_wcsdup(devid); if (!devidcopy) { SDL_free(devidlist); - return; /* oh well. */ + return; /* oh well. */ } if (useguid) { @@ -185,8 +185,7 @@ typedef struct SDLMMNotificationClient SDL_bool useguid; } SDLMMNotificationClient; -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_QueryInterface(IMMNotificationClient *this, REFIID iid, void **ppv) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_QueryInterface(IMMNotificationClient *this, REFIID iid, void **ppv) { if ((WIN_IsEqualIID(iid, &IID_IUnknown)) || (WIN_IsEqualIID(iid, &SDL_IID_IMMNotificationClient))) { *ppv = this; @@ -198,32 +197,29 @@ SDLMMNotificationClient_QueryInterface(IMMNotificationClient *this, REFIID iid, return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE -SDLMMNotificationClient_AddRef(IMMNotificationClient *ithis) +static ULONG STDMETHODCALLTYPE SDLMMNotificationClient_AddRef(IMMNotificationClient *ithis) { SDLMMNotificationClient *this = (SDLMMNotificationClient *)ithis; return (ULONG)(SDL_AtomicIncRef(&this->refcount) + 1); } -static ULONG STDMETHODCALLTYPE -SDLMMNotificationClient_Release(IMMNotificationClient *ithis) +static ULONG STDMETHODCALLTYPE SDLMMNotificationClient_Release(IMMNotificationClient *ithis) { /* this is a static object; we don't ever free it. */ SDLMMNotificationClient *this = (SDLMMNotificationClient *)ithis; const ULONG retval = SDL_AtomicDecRef(&this->refcount); if (retval == 0) { - SDL_AtomicSet(&this->refcount, 0); /* uhh... */ + SDL_AtomicSet(&this->refcount, 0); /* uhh... */ return 0; } return retval - 1; } /* These are the entry points called when WASAPI device endpoints change. */ -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_OnDefaultDeviceChanged(IMMNotificationClient *ithis, EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_OnDefaultDeviceChanged(IMMNotificationClient *ithis, EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId) { if (role != SDL_IMMDevice_role) { - return S_OK; /* ignore it. */ + return S_OK; /* ignore it. */ } /* Increment the "generation," so opened devices will pick this up in their threads. */ @@ -249,8 +245,7 @@ SDLMMNotificationClient_OnDefaultDeviceChanged(IMMNotificationClient *ithis, EDa return S_OK; } -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_OnDeviceAdded(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_OnDeviceAdded(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId) { /* we ignore this; devices added here then progress to ACTIVE, if appropriate, in OnDeviceStateChange, making that a better place to deal with device adds. More @@ -260,15 +255,13 @@ SDLMMNotificationClient_OnDeviceAdded(IMMNotificationClient *ithis, LPCWSTR pwst return S_OK; } -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_OnDeviceRemoved(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_OnDeviceRemoved(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId) { /* See notes in OnDeviceAdded handler about why we ignore this. */ return S_OK; } -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId, DWORD dwNewState) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId, DWORD dwNewState) { IMMDevice *device = NULL; @@ -278,7 +271,7 @@ SDLMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *ithis, LPCWS EDataFlow flow; if (SUCCEEDED(IMMEndpoint_GetDataFlow(endpoint, &flow))) { const SDL_bool iscapture = (flow == eCapture); - const SDLMMNotificationClient *client = (SDLMMNotificationClient*) ithis; + const SDLMMNotificationClient *client = (SDLMMNotificationClient *)ithis; if (dwNewState == DEVICE_STATE_ACTIVE) { char *utf8dev; WAVEFORMATEXTENSIBLE fmt; @@ -300,10 +293,9 @@ SDLMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *ithis, LPCWS return S_OK; } -static HRESULT STDMETHODCALLTYPE -SDLMMNotificationClient_OnPropertyValueChanged(IMMNotificationClient *this, LPCWSTR pwstrDeviceId, const PROPERTYKEY key) +static HRESULT STDMETHODCALLTYPE SDLMMNotificationClient_OnPropertyValueChanged(IMMNotificationClient *this, LPCWSTR pwstrDeviceId, const PROPERTYKEY key) { - return S_OK; /* we don't care about these. */ + return S_OK; /* we don't care about these. */ } static const IMMNotificationClientVtbl notification_client_vtbl = { @@ -319,8 +311,7 @@ static const IMMNotificationClientVtbl notification_client_vtbl = { static SDLMMNotificationClient notification_client = { ¬ification_client_vtbl, { 1 } }; -int -SDL_IMMDevice_Init(void) +int SDL_IMMDevice_Init(void) { HRESULT ret; @@ -344,8 +335,7 @@ SDL_IMMDevice_Init(void) return 0; } -void -SDL_IMMDevice_Quit(void) +void SDL_IMMDevice_Quit(void) { DevIdList *devidlist; DevIdList *next; @@ -366,22 +356,34 @@ SDL_IMMDevice_Quit(void) deviceid_list = NULL; } -int -SDL_IMMDevice_Get(LPCWSTR devid, IMMDevice **device, SDL_bool iscapture) +int SDL_IMMDevice_Get(LPCWSTR devid, IMMDevice **device, SDL_bool iscapture) { + const Uint64 timeout = SDL_GetTicks64() + 8000; /* intel's audio drivers can fail for up to EIGHT SECONDS after a device is connected or we wake from sleep. */ HRESULT ret; SDL_assert(device != NULL); - if (devid == NULL) { - const EDataFlow dataflow = iscapture ? eCapture : eRender; - ret = IMMDeviceEnumerator_GetDefaultAudioEndpoint(enumerator, dataflow, SDL_IMMDevice_role, device); - } else { - ret = IMMDeviceEnumerator_GetDevice(enumerator, devid, device); - } + while (SDL_TRUE) { + if (!devid) { + const EDataFlow dataflow = iscapture ? eCapture : eRender; + ret = IMMDeviceEnumerator_GetDefaultAudioEndpoint(enumerator, dataflow, SDL_IMMDevice_role, device); + } else { + ret = IMMDeviceEnumerator_GetDevice(enumerator, devid, device); + } + + if (SUCCEEDED(ret)) { + break; + } + + if (ret == E_NOTFOUND) { + const Uint64 now = SDL_GetTicks64(); + if (timeout > now) { + const Uint64 ticksleft = timeout - now; + SDL_Delay((Uint32)SDL_min(ticksleft, 300)); /* wait awhile and try again. */ + continue; + } + } - if (FAILED(ret)) { - SDL_assert(*device == NULL); return WIN_SetErrorFromHRESULT("WASAPI can't find requested audio endpoint", ret); } return 0; @@ -422,8 +424,7 @@ static int SDLCALL sort_endpoints(const void *_a, const void *_b) return 0; } -static void -EnumerateEndpointsForFlow(const SDL_bool iscapture) +static void EnumerateEndpointsForFlow(const SDL_bool iscapture) { IMMDeviceCollection *collection = NULL; EndpointItem *items; @@ -443,7 +444,7 @@ EnumerateEndpointsForFlow(const SDL_bool iscapture) items = (EndpointItem *)SDL_calloc(total, sizeof(EndpointItem)); if (!items) { - return; /* oh well. */ + return; /* oh well. */ } for (i = 0; i < total; i++) { @@ -474,20 +475,18 @@ EnumerateEndpointsForFlow(const SDL_bool iscapture) IMMDeviceCollection_Release(collection); } -void -SDL_IMMDevice_EnumerateEndpoints(SDL_bool useguid) +void SDL_IMMDevice_EnumerateEndpoints(SDL_bool useguid) { notification_client.useguid = useguid; - EnumerateEndpointsForFlow(SDL_FALSE); /* playback */ + EnumerateEndpointsForFlow(SDL_FALSE); /* playback */ EnumerateEndpointsForFlow(SDL_TRUE); /* capture */ /* if this fails, we just won't get hotplug events. Carry on anyhow. */ IMMDeviceEnumerator_RegisterEndpointNotificationCallback(enumerator, (IMMNotificationClient *)¬ification_client); } -int -SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) +int SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscapture) { WAVEFORMATEXTENSIBLE fmt; IMMDevice *device = NULL; @@ -501,7 +500,7 @@ SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscaptur return WIN_SetErrorFromHRESULT("WASAPI can't find default audio endpoint", ret); } - if (name == NULL) { + if (!name) { name = &filler; } @@ -516,12 +515,11 @@ SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int iscaptur SDL_zerop(spec); spec->channels = (Uint8)fmt.Format.nChannels; spec->freq = fmt.Format.nSamplesPerSec; - spec->format = WaveFormatToSDLFormat((WAVEFORMATEX *) &fmt); + spec->format = WaveFormatToSDLFormat((WAVEFORMATEX *)&fmt); return 0; } -SDL_AudioFormat -WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) +SDL_AudioFormat WaveFormatToSDLFormat(WAVEFORMATEX *waveformat) { if ((waveformat->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) && (waveformat->wBitsPerSample == 32)) { return AUDIO_F32SYS; diff --git a/src/core/windows/SDL_immdevice.h b/src/core/windows/SDL_immdevice.h index 007775f9e82a0..fc7708da0ef96 100644 --- a/src/core/windows/SDL_immdevice.h +++ b/src/core/windows/SDL_immdevice.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index 4ec9dbb646553..ee730b8c2b4bf 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,41 +24,41 @@ #include "SDL_windows.h" #include "SDL_error.h" +#include "SDL_system.h" -#include /* for CoInitialize/CoUninitialize (Win32 only) */ +#include /* for CoInitialize/CoUninitialize (Win32 only) */ #if defined(HAVE_ROAPI_H) -#include /* For RoInitialize/RoUninitialize (Win32 only) */ +#include /* For RoInitialize/RoUninitialize (Win32 only) */ #else -typedef enum RO_INIT_TYPE { - RO_INIT_SINGLETHREADED = 0, - RO_INIT_MULTITHREADED = 1 +typedef enum RO_INIT_TYPE +{ + RO_INIT_SINGLETHREADED = 0, + RO_INIT_MULTITHREADED = 1 } RO_INIT_TYPE; #endif #ifndef _WIN32_WINNT_VISTA -#define _WIN32_WINNT_VISTA 0x0600 +#define _WIN32_WINNT_VISTA 0x0600 #endif #ifndef _WIN32_WINNT_WIN7 -#define _WIN32_WINNT_WIN7 0x0601 +#define _WIN32_WINNT_WIN7 0x0601 #endif #ifndef _WIN32_WINNT_WIN8 -#define _WIN32_WINNT_WIN8 0x0602 +#define _WIN32_WINNT_WIN8 0x0602 #endif #ifndef LOAD_LIBRARY_SEARCH_SYSTEM32 #define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 #endif - /* Sets an error message based on an HRESULT */ -int -WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr) +int WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr) { TCHAR buffer[1024]; char *message; TCHAR *p = buffer; DWORD c = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0, - buffer, SDL_arraysize(buffer), NULL); + buffer, SDL_arraysize(buffer), NULL); buffer[c] = 0; /* kill CR/LF that FormatMessage() sticks at the end */ while (*p) { @@ -75,8 +75,7 @@ WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr) } /* Sets an error message based on GetLastError() */ -int -WIN_SetError(const char *prefix) +int WIN_SetError(const char *prefix) { return WIN_SetErrorFromHRESULT(prefix, GetLastError()); } @@ -115,8 +114,7 @@ WIN_CoInitialize(void) #endif } -void -WIN_CoUninitialize(void) +void WIN_CoUninitialize(void) { #ifndef __WINRT__ CoUninitialize(); @@ -124,15 +122,14 @@ WIN_CoUninitialize(void) } #ifndef __WINRT__ -void * -WIN_LoadComBaseFunction(const char *name) +void *WIN_LoadComBaseFunction(const char *name) { static SDL_bool s_bLoaded; static HMODULE s_hComBase; - + if (!s_bLoaded) { - s_hComBase = LoadLibraryEx(TEXT("combase.dll"), NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); - s_bLoaded = SDL_TRUE; + s_hComBase = LoadLibraryEx(TEXT("combase.dll"), NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); + s_bLoaded = SDL_TRUE; } if (s_hComBase) { return GetProcAddress(s_hComBase, name); @@ -148,7 +145,7 @@ WIN_RoInitialize(void) #ifdef __WINRT__ return S_OK; #else - typedef HRESULT (WINAPI *RoInitialize_t)(RO_INIT_TYPE initType); + typedef HRESULT(WINAPI * RoInitialize_t)(RO_INIT_TYPE initType); RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize"); if (RoInitializeFunc) { /* RO_INIT_SINGLETHREADED is equivalent to COINIT_APARTMENTTHREADED */ @@ -170,11 +167,10 @@ WIN_RoInitialize(void) #endif } -void -WIN_RoUninitialize(void) +void WIN_RoUninitialize(void) { #ifndef __WINRT__ - typedef void (WINAPI *RoUninitialize_t)(void); + typedef void(WINAPI * RoUninitialize_t)(void); RoUninitialize_t RoUninitializeFunc = (RoUninitialize_t)WIN_LoadComBaseFunction("RoUninitialize"); if (RoUninitializeFunc) { RoUninitializeFunc(); @@ -183,16 +179,15 @@ WIN_RoUninitialize(void) } #if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -static BOOL -IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) +static BOOL IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) { OSVERSIONINFOEXW osvi; DWORDLONG const dwlConditionMask = VerSetConditionMask( VerSetConditionMask( - VerSetConditionMask( - 0, VER_MAJORVERSION, VER_GREATER_EQUAL ), - VER_MINORVERSION, VER_GREATER_EQUAL ), - VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL ); + VerSetConditionMask( + 0, VER_MAJORVERSION, VER_GREATER_EQUAL), + VER_MINORVERSION, VER_GREATER_EQUAL), + VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); SDL_zero(osvi); osvi.dwOSVersionInfoSize = sizeof(osvi); @@ -204,6 +199,24 @@ IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServiceP } #endif +BOOL WIN_IsWine(void) +{ + static SDL_bool checked; + static SDL_bool is_wine; + + if (!checked) { + HMODULE ntdll = LoadLibrary(TEXT("ntdll.dll")); + if (ntdll) { + if (GetProcAddress(ntdll, "wine_get_version") != NULL) { + is_wine = SDL_TRUE; + } + FreeLibrary(ntdll); + } + checked = SDL_TRUE; + } + return is_wine; +} + BOOL WIN_IsWindowsVistaOrGreater(void) { #if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) @@ -252,11 +265,10 @@ has the same problem.) WASAPI doesn't need this. This is just for DirectSound/WinMM. */ -char * -WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) +char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) { #if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) - return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */ + return WIN_StringToUTF8W(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */ #else static const GUID nullguid = { 0 }; const unsigned char *ptr; @@ -268,42 +280,42 @@ WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) char *retval = NULL; if (WIN_IsEqualGUID(guid, &nullguid)) { - return WIN_StringToUTF8(name); /* No GUID, go with what we've got. */ + return WIN_StringToUTF8(name); /* No GUID, go with what we've got. */ } - ptr = (const unsigned char *) guid; - SDL_snprintf(keystr, sizeof (keystr), - "System\\CurrentControlSet\\Control\\MediaCategories\\{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - ptr[3], ptr[2], ptr[1], ptr[0], ptr[5], ptr[4], ptr[7], ptr[6], - ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]); + ptr = (const unsigned char *)guid; + (void)SDL_snprintf(keystr, sizeof(keystr), + "System\\CurrentControlSet\\Control\\MediaCategories\\{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + ptr[3], ptr[2], ptr[1], ptr[0], ptr[5], ptr[4], ptr[7], ptr[6], + ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]); strw = WIN_UTF8ToString(keystr); rc = (RegOpenKeyExW(HKEY_LOCAL_MACHINE, strw, 0, KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS); SDL_free(strw); if (!rc) { - return WIN_StringToUTF8(name); /* oh well. */ + return WIN_StringToUTF8(name); /* oh well. */ } rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, NULL, &len) == ERROR_SUCCESS); if (!rc) { RegCloseKey(hkey); - return WIN_StringToUTF8(name); /* oh well. */ + return WIN_StringToUTF8(name); /* oh well. */ } - strw = (WCHAR *) SDL_malloc(len + sizeof (WCHAR)); + strw = (WCHAR *)SDL_malloc(len + sizeof(WCHAR)); if (!strw) { RegCloseKey(hkey); - return WIN_StringToUTF8(name); /* oh well. */ + return WIN_StringToUTF8(name); /* oh well. */ } - rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, (LPBYTE) strw, &len) == ERROR_SUCCESS); + rc = (RegQueryValueExW(hkey, L"Name", NULL, NULL, (LPBYTE)strw, &len) == ERROR_SUCCESS); RegCloseKey(hkey); if (!rc) { SDL_free(strw); - return WIN_StringToUTF8(name); /* oh well. */ + return WIN_StringToUTF8(name); /* oh well. */ } - strw[len / 2] = 0; /* make sure it's null-terminated. */ + strw[len / 2] = 0; /* make sure it's null-terminated. */ retval = WIN_StringToUTF8(strw); SDL_free(strw); @@ -311,20 +323,17 @@ WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) #endif /* if __WINRT__ / else */ } -BOOL -WIN_IsEqualGUID(const GUID * a, const GUID * b) +BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b) { - return (SDL_memcmp(a, b, sizeof (*a)) == 0); + return SDL_memcmp(a, b, sizeof(*a)) == 0; } -BOOL -WIN_IsEqualIID(REFIID a, REFIID b) +BOOL WIN_IsEqualIID(REFIID a, REFIID b) { - return (SDL_memcmp(a, b, sizeof (*a)) == 0); + return SDL_memcmp(a, b, sizeof(*a)) == 0; } -void -WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect) +void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect) { sdlrect->x = winrect->left; sdlrect->w = (winrect->right - winrect->left) + 1; @@ -332,8 +341,7 @@ WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect) sdlrect->h = (winrect->bottom - winrect->top) + 1; } -void -WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect) +void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect) { winrect->left = sdlrect->x; winrect->right = sdlrect->x + sdlrect->w - 1; @@ -341,6 +349,56 @@ WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect) winrect->bottom = sdlrect->y + sdlrect->h - 1; } +BOOL WIN_IsRectEmpty(const RECT *rect) +{ + /* Calculating this manually because UWP and Xbox do not support Win32 IsRectEmpty. */ + return (rect->right <= rect->left) || (rect->bottom <= rect->top); +} #endif /* defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) */ +/* + * Public APIs + */ +#if !defined(SDL_VIDEO_DRIVER_WINDOWS) + +#if defined(__WIN32__) || defined(__GDK__) +int SDL_RegisterApp(const char *name, Uint32 style, void *hInst) +{ + (void)name; + (void)style; + (void)hInst; + return 0; +} + +void SDL_UnregisterApp(void) +{ +} + +void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) +{ +} +#endif /* __WIN32__ || __GDK__ */ + +#if defined(__WIN32__) || defined(__WINGDK__) +int SDL_Direct3D9GetAdapterIndex(int displayIndex) +{ + (void)displayIndex; + return 0; /* D3DADAPTER_DEFAULT */ +} + +SDL_bool SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) +{ + (void)displayIndex; + if (adapterIndex) { + *adapterIndex = -1; + } + if (outputIndex) { + *outputIndex = -1; + } + return SDL_FALSE; +} +#endif /* __WIN32__ || __WINGDK__ */ + +#endif /* !SDL_VIDEO_DRIVER_WINDOWS */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/core/windows/SDL_windows.h b/src/core/windows/SDL_windows.h index 8b124d797654a..997c0ab4accba 100644 --- a/src/core/windows/SDL_windows.h +++ b/src/core/windows/SDL_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,14 +36,14 @@ #endif #undef WINVER #undef _WIN32_WINNT -#if defined(SDL_VIDEO_RENDER_D3D12) -#define _WIN32_WINNT 0xA00 /* For D3D12, 0xA00 is required */ +#if SDL_VIDEO_RENDER_D3D12 +#define _WIN32_WINNT 0xA00 /* For D3D12, 0xA00 is required */ #elif defined(HAVE_SHELLSCALINGAPI_H) -#define _WIN32_WINNT 0x603 /* For DPI support */ +#define _WIN32_WINNT 0x603 /* For DPI support */ #else -#define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */ +#define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */ #endif -#define WINVER _WIN32_WINNT +#define WINVER _WIN32_WINNT #elif defined(__WINGDK__) #ifndef WIN32_LEAN_AND_MEAN @@ -57,8 +57,8 @@ #endif #undef WINVER #undef _WIN32_WINNT -#define _WIN32_WINNT 0xA00 -#define WINVER _WIN32_WINNT +#define _WIN32_WINNT 0xA00 +#define WINVER _WIN32_WINNT #elif defined(__XBOXONE__) || defined(__XBOXSERIES__) #ifndef WIN32_LEAN_AND_MEAN @@ -76,37 +76,40 @@ #define WINVER _WIN32_WINNT #endif -#include -#include /* for REFIID with broken mingw.org headers */ - -/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ -#if defined(_MSC_VER) && (_MSC_VER <= 1200) -#ifndef DWORD_PTR -#define DWORD_PTR DWORD -#endif -#ifndef LONG_PTR -#define LONG_PTR LONG +/* See https://github.com/libsdl-org/SDL/pull/7607 */ +/* force_align_arg_pointer attribute requires gcc >= 4.2.x. */ +#if defined(__clang__) +#define HAVE_FORCE_ALIGN_ARG_POINTER +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#define HAVE_FORCE_ALIGN_ARG_POINTER #endif +#if defined(__GNUC__) && defined(__i386__) && defined(HAVE_FORCE_ALIGN_ARG_POINTER) +#define MINGW32_FORCEALIGN __attribute__((force_align_arg_pointer)) +#else +#define MINGW32_FORCEALIGN #endif +#include +#include /* for REFIID with broken mingw.org headers */ + #include "SDL_rect.h" /* Routines to convert from UTF8 to native Windows text */ -#define WIN_StringToUTF8W(S) SDL_iconv_string("UTF-8", "UTF-16LE", (const char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR)) -#define WIN_UTF8ToStringW(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (const char *)(S), SDL_strlen(S)+1) +#define WIN_StringToUTF8W(S) SDL_iconv_string("UTF-8", "UTF-16LE", (const char *)(S), (SDL_wcslen(S) + 1) * sizeof(WCHAR)) +#define WIN_UTF8ToStringW(S) (WCHAR *)SDL_iconv_string("UTF-16LE", "UTF-8", (const char *)(S), SDL_strlen(S) + 1) /* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */ -#define WIN_StringToUTF8A(S) SDL_iconv_string("UTF-8", "ASCII", (const char *)(S), (SDL_strlen(S)+1)) -#define WIN_UTF8ToStringA(S) SDL_iconv_string("ASCII", "UTF-8", (const char *)(S), SDL_strlen(S)+1) +#define WIN_StringToUTF8A(S) SDL_iconv_string("UTF-8", "ASCII", (const char *)(S), (SDL_strlen(S) + 1)) +#define WIN_UTF8ToStringA(S) SDL_iconv_string("ASCII", "UTF-8", (const char *)(S), SDL_strlen(S) + 1) #if UNICODE #define WIN_StringToUTF8 WIN_StringToUTF8W #define WIN_UTF8ToString WIN_UTF8ToStringW -#define SDL_tcslen SDL_wcslen -#define SDL_tcsstr SDL_wcsstr +#define SDL_tcslen SDL_wcslen +#define SDL_tcsstr SDL_wcsstr #else #define WIN_StringToUTF8 WIN_StringToUTF8A #define WIN_UTF8ToString WIN_UTF8ToStringA -#define SDL_tcslen SDL_strlen -#define SDL_tcsstr SDL_strstr +#define SDL_tcslen SDL_strlen +#define SDL_tcsstr SDL_strstr #endif /* Set up for C function definitions, even when using C++ */ @@ -133,6 +136,9 @@ extern void WIN_CoUninitialize(void); extern HRESULT WIN_RoInitialize(void); extern void WIN_RoUninitialize(void); +/* Returns true if we're running on Wine */ +extern BOOL WIN_IsWine(void); + /* Returns SDL_TRUE if we're running on Windows Vista and newer */ extern BOOL WIN_IsWindowsVistaOrGreater(void); @@ -146,13 +152,16 @@ extern BOOL WIN_IsWindows8OrGreater(void); extern char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid); /* Checks to see if two GUID are the same. */ -extern BOOL WIN_IsEqualGUID(const GUID * a, const GUID * b); +extern BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b); extern BOOL WIN_IsEqualIID(REFIID a, REFIID b); /* Convert between SDL_rect and RECT */ extern void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect); extern void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect); +/* Returns SDL_TRUE if the rect is empty */ +extern BOOL WIN_IsRectEmpty(const RECT *rect); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/src/core/windows/SDL_xinput.c b/src/core/windows/SDL_xinput.c index 8b9c26ef9212e..0e39ded0ba2a5 100644 --- a/src/core/windows/SDL_xinput.c +++ b/src/core/windows/SDL_xinput.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,17 +30,16 @@ extern "C" { XInputGetState_t SDL_XInputGetState = NULL; XInputSetState_t SDL_XInputSetState = NULL; XInputGetCapabilities_t SDL_XInputGetCapabilities = NULL; +XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx = NULL; XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation = NULL; DWORD SDL_XInputVersion = 0; -static HANDLE s_pXInputDLL = 0; +static HMODULE s_pXInputDLL = NULL; static int s_XInputDLLRefCount = 0; - #if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) -int -WIN_LoadXInputDLL(void) +int WIN_LoadXInputDLL(void) { /* Getting handles to system dlls (via LoadLibrary and its variants) is not * supported on WinRT, thus, pointers to XInput's functions can't be @@ -65,22 +64,20 @@ WIN_LoadXInputDLL(void) return 0; } -void -WIN_UnloadXInputDLL(void) +void WIN_UnloadXInputDLL(void) { } #else /* !(defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)) */ -int -WIN_LoadXInputDLL(void) +int WIN_LoadXInputDLL(void) { DWORD version = 0; if (s_pXInputDLL) { SDL_assert(s_XInputDLLRefCount > 0); s_XInputDLLRefCount++; - return 0; /* already loaded */ + return 0; /* already loaded */ } /* NOTE: Don't load XinputUap.dll @@ -88,10 +85,10 @@ WIN_LoadXInputDLL(void) * limitations of that API (no devices at startup, no background input, etc.) */ version = (1 << 16) | 4; - s_pXInputDLL = LoadLibrary(TEXT("XInput1_4.dll")); /* 1.4 Ships with Windows 8. */ + s_pXInputDLL = LoadLibrary(TEXT("XInput1_4.dll")); /* 1.4 Ships with Windows 8. */ if (!s_pXInputDLL) { version = (1 << 16) | 3; - s_pXInputDLL = LoadLibrary(TEXT("XInput1_3.dll")); /* 1.3 can be installed as a redistributable component. */ + s_pXInputDLL = LoadLibrary(TEXT("XInput1_3.dll")); /* 1.3 can be installed as a redistributable component. */ } if (!s_pXInputDLL) { s_pXInputDLL = LoadLibrary(TEXT("bin\\XInput1_3.dll")); @@ -109,13 +106,15 @@ WIN_LoadXInputDLL(void) s_XInputDLLRefCount = 1; /* 100 is the ordinal for _XInputGetStateEx, which returns the same struct as XinputGetState, but with extra data in wButtons for the guide button, we think... */ - SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, (LPCSTR)100); + SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, (LPCSTR)100); if (!SDL_XInputGetState) { - SDL_XInputGetState = (XInputGetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetState"); + SDL_XInputGetState = (XInputGetState_t)GetProcAddress(s_pXInputDLL, "XInputGetState"); } - SDL_XInputSetState = (XInputSetState_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputSetState"); - SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress((HMODULE)s_pXInputDLL, "XInputGetCapabilities"); - SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress( (HMODULE)s_pXInputDLL, "XInputGetBatteryInformation" ); + SDL_XInputSetState = (XInputSetState_t)GetProcAddress(s_pXInputDLL, "XInputSetState"); + SDL_XInputGetCapabilities = (XInputGetCapabilities_t)GetProcAddress(s_pXInputDLL, "XInputGetCapabilities"); + /* 108 is the ordinal for _XInputGetCapabilitiesEx, which additionally returns VID/PID of the controller. */ + SDL_XInputGetCapabilitiesEx = (XInputGetCapabilitiesEx_t)GetProcAddress(s_pXInputDLL, (LPCSTR)108); + SDL_XInputGetBatteryInformation = (XInputGetBatteryInformation_t)GetProcAddress(s_pXInputDLL, "XInputGetBatteryInformation"); if (!SDL_XInputGetState || !SDL_XInputSetState || !SDL_XInputGetCapabilities) { WIN_UnloadXInputDLL(); return -1; @@ -124,8 +123,7 @@ WIN_LoadXInputDLL(void) return 0; } -void -WIN_UnloadXInputDLL(void) +void WIN_UnloadXInputDLL(void) { if (s_pXInputDLL) { SDL_assert(s_XInputDLLRefCount > 0); diff --git a/src/core/windows/SDL_xinput.h b/src/core/windows/SDL_xinput.h index 5f6d36a989891..0f6ab1dd2488f 100644 --- a/src/core/windows/SDL_xinput.h +++ b/src/core/windows/SDL_xinput.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,6 +28,7 @@ #ifdef HAVE_XINPUT_H #if defined(__XBOXONE__) || defined(__XBOXSERIES__) /* Xbox supports an XInput wrapper which is a C++-only header... */ +#include /* Required to compile with recent MSVC... */ #include using namespace XInputOnGameInput; #else @@ -39,11 +40,14 @@ using namespace XInputOnGameInput; #define XUSER_MAX_COUNT 4 #endif #ifndef XUSER_INDEX_ANY -#define XUSER_INDEX_ANY 0x000000FF +#define XUSER_INDEX_ANY 0x000000FF #endif #ifndef XINPUT_CAPS_FFB_SUPPORTED #define XINPUT_CAPS_FFB_SUPPORTED 0x0001 #endif +#ifndef XINPUT_CAPS_WIRELESS +#define XINPUT_CAPS_WIRELESS 0x0002 +#endif #ifndef XINPUT_DEVSUBTYPE_UNKNOWN #define XINPUT_DEVSUBTYPE_UNKNOWN 0x00 @@ -131,29 +135,29 @@ using namespace XInputOnGameInput; #endif #ifndef BATTERY_DEVTYPE_GAMEPAD -#define BATTERY_DEVTYPE_GAMEPAD 0x00 +#define BATTERY_DEVTYPE_GAMEPAD 0x00 #endif #ifndef BATTERY_TYPE_DISCONNECTED -#define BATTERY_TYPE_DISCONNECTED 0x00 +#define BATTERY_TYPE_DISCONNECTED 0x00 #endif #ifndef BATTERY_TYPE_WIRED -#define BATTERY_TYPE_WIRED 0x01 +#define BATTERY_TYPE_WIRED 0x01 #endif #ifndef BATTERY_TYPE_UNKNOWN -#define BATTERY_TYPE_UNKNOWN 0xFF +#define BATTERY_TYPE_UNKNOWN 0xFF #endif #ifndef BATTERY_LEVEL_EMPTY -#define BATTERY_LEVEL_EMPTY 0x00 +#define BATTERY_LEVEL_EMPTY 0x00 #endif #ifndef BATTERY_LEVEL_LOW -#define BATTERY_LEVEL_LOW 0x01 +#define BATTERY_LEVEL_LOW 0x01 #endif #ifndef BATTERY_LEVEL_MEDIUM -#define BATTERY_LEVEL_MEDIUM 0x02 +#define BATTERY_LEVEL_MEDIUM 0x02 #endif #ifndef BATTERY_LEVEL_FULL -#define BATTERY_LEVEL_FULL 0x03 +#define BATTERY_LEVEL_FULL 0x03 #endif /* Set up for C function definitions, even when using C++ */ @@ -163,28 +167,8 @@ extern "C" { /* typedef's for XInput structs we use */ -#ifndef HAVE_XINPUT_GAMEPAD_EX -typedef struct -{ - WORD wButtons; - BYTE bLeftTrigger; - BYTE bRightTrigger; - SHORT sThumbLX; - SHORT sThumbLY; - SHORT sThumbRX; - SHORT sThumbRY; - DWORD dwPaddingReserved; -} XINPUT_GAMEPAD_EX; -#endif - -#ifndef HAVE_XINPUT_STATE_EX -typedef struct -{ - DWORD dwPacketNumber; - XINPUT_GAMEPAD_EX Gamepad; -} XINPUT_STATE_EX; -#endif +/* This is the same as XINPUT_BATTERY_INFORMATION, but always defined instead of just if WIN32_WINNT >= _WIN32_WINNT_WIN8 */ typedef struct { BYTE BatteryType; @@ -204,6 +188,12 @@ typedef struct SHORT sThumbRY; } XINPUT_GAMEPAD; +typedef struct +{ + DWORD dwPacketNumber; + XINPUT_GAMEPAD Gamepad; +} XINPUT_STATE; + typedef struct { WORD wLeftMotorSpeed; @@ -221,32 +211,46 @@ typedef struct #endif /* HAVE_XINPUT_H */ +/* This struct is not defined in XInput headers. */ +typedef struct +{ + XINPUT_CAPABILITIES Capabilities; + WORD VendorId; + WORD ProductId; + WORD ProductVersion; + WORD unk1; + DWORD unk2; +} SDL_XINPUT_CAPABILITIES_EX; + /* Forward decl's for XInput API's we load dynamically and use if available */ -typedef DWORD (WINAPI *XInputGetState_t) - ( - DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ - XINPUT_STATE_EX* pState /* [out] Receives the current state */ - ); - -typedef DWORD (WINAPI *XInputSetState_t) - ( - DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ - XINPUT_VIBRATION* pVibration /* [in, out] The vibration information to send to the controller */ - ); - -typedef DWORD (WINAPI *XInputGetCapabilities_t) - ( - DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ - DWORD dwFlags, /* [in] Input flags that identify the device type */ - XINPUT_CAPABILITIES* pCapabilities /* [out] Receives the capabilities */ - ); - -typedef DWORD (WINAPI *XInputGetBatteryInformation_t) - ( - DWORD dwUserIndex, - BYTE devType, - XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation - ); +typedef DWORD(WINAPI *XInputGetState_t)( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + XINPUT_STATE *pState /* [out] Receives the current state */ +); + +typedef DWORD(WINAPI *XInputSetState_t)( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + XINPUT_VIBRATION *pVibration /* [in, out] The vibration information to send to the controller */ +); + +typedef DWORD(WINAPI *XInputGetCapabilities_t)( + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + DWORD dwFlags, /* [in] Input flags that identify the device type */ + XINPUT_CAPABILITIES *pCapabilities /* [out] Receives the capabilities */ +); + +/* Only available in XInput 1.4 that is shipped with Windows 8 and newer. */ +typedef DWORD(WINAPI *XInputGetCapabilitiesEx_t)( + DWORD dwReserved, /* [in] Must be 1 */ + DWORD dwUserIndex, /* [in] Index of the gamer associated with the device */ + DWORD dwFlags, /* [in] Input flags that identify the device type */ + SDL_XINPUT_CAPABILITIES_EX *pCapabilitiesEx /* [out] Receives the capabilities */ +); + +typedef DWORD(WINAPI *XInputGetBatteryInformation_t)( + DWORD dwUserIndex, + BYTE devType, + XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation); extern int WIN_LoadXInputDLL(void); extern void WIN_UnloadXInputDLL(void); @@ -254,18 +258,20 @@ extern void WIN_UnloadXInputDLL(void); extern XInputGetState_t SDL_XInputGetState; extern XInputSetState_t SDL_XInputSetState; extern XInputGetCapabilities_t SDL_XInputGetCapabilities; +extern XInputGetCapabilitiesEx_t SDL_XInputGetCapabilitiesEx; extern XInputGetBatteryInformation_t SDL_XInputGetBatteryInformation; -extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */ +extern DWORD SDL_XInputVersion; /* ((major << 16) & 0xFF00) | (minor & 0xFF) */ /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif -#define XINPUTGETSTATE SDL_XInputGetState -#define XINPUTSETSTATE SDL_XInputSetState -#define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities -#define XINPUTGETBATTERYINFORMATION SDL_XInputGetBatteryInformation +#define XINPUTGETSTATE SDL_XInputGetState +#define XINPUTSETSTATE SDL_XInputSetState +#define XINPUTGETCAPABILITIES SDL_XInputGetCapabilities +#define XINPUTGETCAPABILITIESEX SDL_XInputGetCapabilitiesEx +#define XINPUTGETBATTERYINFORMATION SDL_XInputGetBatteryInformation #endif /* SDL_xinput_h_ */ diff --git a/src/core/winrt/SDL_winrtapp_common.cpp b/src/core/winrt/SDL_winrtapp_common.cpp index 6e98a78d9b867..dfd1ac83e1066 100644 --- a/src/core/winrt/SDL_winrtapp_common.cpp +++ b/src/core/winrt/SDL_winrtapp_common.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL; extern "C" DECLSPEC int -SDL_WinRTRunApp(SDL_main_func mainFunction, void * xamlBackgroundPanel) +SDL_WinRTRunApp(SDL_main_func mainFunction, void *xamlBackgroundPanel) { if (xamlBackgroundPanel) { return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel); @@ -42,23 +42,17 @@ SDL_WinRTRunApp(SDL_main_func mainFunction, void * xamlBackgroundPanel) } } - extern "C" DECLSPEC SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily() { -#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */ - Platform::String^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily; +#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */ + Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily; - if (deviceFamily->Equals("Windows.Desktop")) - { + if (deviceFamily->Equals("Windows.Desktop")) { return SDL_WINRT_DEVICEFAMILY_DESKTOP; - } - else if (deviceFamily->Equals("Windows.Mobile")) - { + } else if (deviceFamily->Equals("Windows.Mobile")) { return SDL_WINRT_DEVICEFAMILY_MOBILE; - } - else if (deviceFamily->Equals("Windows.Xbox")) - { + } else if (deviceFamily->Equals("Windows.Xbox")) { return SDL_WINRT_DEVICEFAMILY_XBOX; } #endif diff --git a/src/core/winrt/SDL_winrtapp_common.h b/src/core/winrt/SDL_winrtapp_common.h index 79b1002763012..3789f0784af50 100644 --- a/src/core/winrt/SDL_winrtapp_common.h +++ b/src/core/winrt/SDL_winrtapp_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp index 1f0962fca107e..b251ccb9dc4eb 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,13 +20,8 @@ */ #include "../../SDL_internal.h" -/* Standard C++11 includes */ -#include +/* Standard C++11 includes: */ #include -#include -using namespace std; - - /* Windows includes */ #include "ppltasks.h" using namespace concurrency; @@ -40,20 +35,19 @@ using namespace Windows::System; using namespace Windows::UI::Core; using namespace Windows::UI::Input; -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE using namespace Windows::Phone::UI::Input; #endif - /* SDL includes */ extern "C" { #include "SDL_events.h" #include "SDL_hints.h" #include "SDL_main.h" #include "SDL_stdinc.h" +#include "SDL_system.h" #include "SDL_render.h" #include "../../video/SDL_sysvideo.h" -//#include "../../SDL_hints_c.h" #include "../../events/SDL_events_c.h" #include "../../events/SDL_keyboard_c.h" #include "../../events/SDL_mouse_c.h" @@ -67,20 +61,18 @@ extern "C" { #include "SDL_winrtapp_common.h" #include "SDL_winrtapp_direct3d.h" -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 /* Calling IDXGIDevice3::Trim on the active Direct3D 11.x device is necessary * when Windows 8.1 apps are about to get suspended. */ extern "C" void D3D11_Trim(SDL_Renderer *); #endif - // Compile-time debugging options: // To enable, uncomment; to disable, comment them out. -//#define LOG_POINTER_EVENTS 1 -//#define LOG_WINDOW_EVENTS 1 -//#define LOG_ORIENTATION_EVENTS 1 - +// #define LOG_POINTER_EVENTS 1 +// #define LOG_WINDOW_EVENTS 1 +// #define LOG_ORIENTATION_EVENTS 1 // HACK, DLudwig: record a reference to the global, WinRT 'app'/view. // SDL/WinRT will use this throughout its code. @@ -91,21 +83,74 @@ extern "C" void D3D11_Trim(SDL_Renderer *); // SDL_CreateWindow(). SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr; +// Protocol activation URI storage +static Platform::String^ WINRT_ProtocolActivationURI = nullptr; + +// Store launchOnExit URI separately since WINRT_ProtocolActivationURI gets cleared +static std::wstring WINRT_LaunchOnExitURI; + +// Helper function to extract and store launchOnExit from protocol URI +static void WINRT_ExtractLaunchOnExitURI(Platform::String^ fullUri) +{ + if (fullUri == nullptr) + return; + + std::wstring uri(fullUri->Data()); + + // Look for launchOnExit parameter in the URI + size_t launchPos = uri.find(L"launchOnExit="); + if (launchPos == std::wstring::npos) + return; + + // Extract the launchOnExit URI value + launchPos += 13; // Skip past "launchOnExit=" + size_t endPos = uri.find(L'&', launchPos); + if (endPos == std::wstring::npos) + endPos = uri.length(); + + std::wstring launchUri = uri.substr(launchPos, endPos - launchPos); + + // URL decode the URI (convert %3A to :, etc.) + WINRT_LaunchOnExitURI.clear(); + for (size_t i = 0; i < launchUri.length(); i++) { + if (launchUri[i] == L'%' && i + 2 < launchUri.length()) { + wchar_t hex[3] = { launchUri[i + 1], launchUri[i + 2], 0 }; + WINRT_LaunchOnExitURI += (wchar_t)wcstol(hex, nullptr, 16); + i += 2; + } else { + WINRT_LaunchOnExitURI += launchUri[i]; + } + } +} + +// Helper function to launch URI on exit if protocol activation included launchOnExit parameter +static void WINRT_LaunchExitUriIfSet() +{ + if (!WINRT_LaunchOnExitURI.empty()) { + try { + // Launch the URI + auto uri = ref new Windows::Foundation::Uri(ref new Platform::String(WINRT_LaunchOnExitURI.c_str())); + Windows::System::Launcher::LaunchUriAsync(uri); + } catch (...) { + // Silently ignore errors during termination + } + } +} + ref class SDLApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource { -public: - virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView(); + public: + virtual Windows::ApplicationModel::Core::IFrameworkView ^ CreateView(); }; -IFrameworkView^ SDLApplicationSource::CreateView() +IFrameworkView ^ SDLApplicationSource::CreateView() { // TODO, WinRT: see if this function (CreateView) can ever get called // more than once. For now, just prevent it from ever assigning // SDL_WinRTGlobalApp more than once. SDL_assert(!SDL_WinRTGlobalApp); SDL_WinRTApp ^ app = ref new SDL_WinRTApp(); - if (!SDL_WinRTGlobalApp) - { + if (!SDL_WinRTGlobalApp) { SDL_WinRTGlobalApp = app; } return app; @@ -119,21 +164,36 @@ int SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **)) return 0; } -static void -WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing into WINRT_ProcessWindowSizeChange() +extern "C" char* SDL_WinRTGetProtocolActivationURI(void) +{ + if (WINRT_ProtocolActivationURI == nullptr) + return nullptr; + Platform::String^ uriStr = WINRT_ProtocolActivationURI; + const wchar_t* uriWide = uriStr->Data(); + int uriLen = WideCharToMultiByte(CP_UTF8, 0, uriWide, -1, nullptr, 0, nullptr, nullptr); + char* uriUtf8 = (char*)SDL_malloc(uriLen); + if (uriUtf8) + WideCharToMultiByte(CP_UTF8, 0, uriWide, -1, uriUtf8, uriLen, nullptr, nullptr); + + // Clear after first successful read (only return it once) + WINRT_ProtocolActivationURI = nullptr; + return uriUtf8; +} + +static void WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing into WINRT_ProcessWindowSizeChange() { CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); if (coreWindow) { if (WINRT_GlobalSDLWindow) { - SDL_Window * window = WINRT_GlobalSDLWindow; - SDL_WindowData * data = (SDL_WindowData *) window->driverdata; + SDL_Window *window = WINRT_GlobalSDLWindow; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; int x = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Left); int y = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Top); int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION == NTDDI_WIN8) +#if SDL_WINAPI_FAMILY_PHONE && (NTDDI_VERSION == NTDDI_WIN8) /* WinPhone 8.0 always keeps its native window size in portrait, regardless of orientation. This changes in WinPhone 8.1, in which the native window's size changes along with @@ -145,12 +205,13 @@ WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing in */ const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); switch (currentOrientation) { - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: { - int tmp = w; - w = h; - h = tmp; - } break; + case DisplayOrientations::Landscape: + case DisplayOrientations::LandscapeFlipped: + { + int tmp = w; + w = h; + h = tmp; + } break; } #endif @@ -171,25 +232,30 @@ WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing in } } -SDL_WinRTApp::SDL_WinRTApp() : - m_windowClosed(false), - m_windowVisible(true) +SDL_WinRTApp::SDL_WinRTApp() : m_windowClosed(false), + m_windowVisible(true) { } -void SDL_WinRTApp::Initialize(CoreApplicationView^ applicationView) +SDL_WinRTApp::~SDL_WinRTApp() +{ + // Launch exit URI if set (handles protocol activation returning to caller) + WINRT_LaunchExitUriIfSet(); +} + +void SDL_WinRTApp::Initialize(CoreApplicationView ^ applicationView) { applicationView->Activated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnAppActivated); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnAppActivated); CoreApplication::Suspending += - ref new EventHandler(this, &SDL_WinRTApp::OnSuspending); + ref new EventHandler(this, &SDL_WinRTApp::OnSuspending); CoreApplication::Resuming += - ref new EventHandler(this, &SDL_WinRTApp::OnResuming); + ref new EventHandler(this, &SDL_WinRTApp::OnResuming); CoreApplication::Exiting += - ref new EventHandler(this, &SDL_WinRTApp::OnExiting); + ref new EventHandler(this, &SDL_WinRTApp::OnExiting); #if NTDDI_VERSION >= NTDDI_WIN10 /* HACK ALERT! Xbox One doesn't seem to detect gamepads unless something @@ -198,44 +264,43 @@ void SDL_WinRTApp::Initialize(CoreApplicationView^ applicationView) sure that gamepad detection works later on, if requested. */ Windows::Gaming::Input::Gamepad::GamepadAdded += - ref new Windows::Foundation::EventHandler( - this, &SDL_WinRTApp::OnGamepadAdded - ); + ref new Windows::Foundation::EventHandler( + this, &SDL_WinRTApp::OnGamepadAdded); #endif } #if NTDDI_VERSION > NTDDI_WIN8 -void SDL_WinRTApp::OnOrientationChanged(DisplayInformation^ sender, Object^ args) +void SDL_WinRTApp::OnOrientationChanged(DisplayInformation ^ sender, Object ^ args) #else -void SDL_WinRTApp::OnOrientationChanged(Object^ sender) +void SDL_WinRTApp::OnOrientationChanged(Object ^ sender) #endif { -#if LOG_ORIENTATION_EVENTS==1 +#if LOG_ORIENTATION_EVENTS == 1 { - CoreWindow^ window = CoreWindow::GetForCurrentThread(); + CoreWindow ^ window = CoreWindow::GetForCurrentThread(); if (window) { SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, CoreWindow Bounds={%f,%f,%f,%f}\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - window->Bounds.X, - window->Bounds.Y, - window->Bounds.Width, - window->Bounds.Height); + __FUNCTION__, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), + window->Bounds.X, + window->Bounds.Y, + window->Bounds.Width, + window->Bounds.Height); } else { SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences)); + __FUNCTION__, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences)); } } #endif WINRT_ProcessWindowSizeChange(); -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE // HACK: Make sure that orientation changes // lead to the Direct3D renderer's viewport getting updated: // @@ -245,116 +310,113 @@ void SDL_WinRTApp::OnOrientationChanged(Object^ sender) // I'm not currently sure why this is, but it seems to work fine. -- David L. // // TODO, WinRT: do more extensive research into why orientation changes on Win 8.x don't need D3D changes, or if they might, in some cases - SDL_Window * window = WINRT_GlobalSDLWindow; + SDL_Window *window = WINRT_GlobalSDLWindow; if (window) { - SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_WINDOWEVENT_SIZE_CHANGED, w, h); } #endif - } -void SDL_WinRTApp::SetWindow(CoreWindow^ window) +void SDL_WinRTApp::SetWindow(CoreWindow ^ window) { -#if LOG_WINDOW_EVENTS==1 +#if LOG_WINDOW_EVENTS == 1 SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, window bounds={%f, %f, %f,%f}\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - window->Bounds.X, - window->Bounds.Y, - window->Bounds.Width, - window->Bounds.Height); + __FUNCTION__, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), + window->Bounds.X, + window->Bounds.Y, + window->Bounds.Width, + window->Bounds.Height); #endif - window->SizeChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowSizeChanged); + window->SizeChanged += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowSizeChanged); window->VisibilityChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnVisibilityChanged); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnVisibilityChanged); window->Activated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowActivated); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowActivated); - window->Closed += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowClosed); + window->Closed += + ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowClosed); -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP +#if !SDL_WINAPI_FAMILY_PHONE window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); #endif window->PointerPressed += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerPressed); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerPressed); window->PointerMoved += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerMoved); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerMoved); window->PointerReleased += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerReleased); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerReleased); window->PointerEntered += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerEntered); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerEntered); window->PointerExited += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerExited); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerExited); window->PointerWheelChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerWheelChanged); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerWheelChanged); -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP +#if !SDL_WINAPI_FAMILY_PHONE // Retrieves relative-only mouse movements: Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnMouseMoved); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnMouseMoved); #endif window->KeyDown += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnKeyDown); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnKeyDown); window->KeyUp += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnKeyUp); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnKeyUp); window->CharacterReceived += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnCharacterReceived); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnCharacterReceived); #if NTDDI_VERSION >= NTDDI_WIN10 Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->BackRequested += - ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); -#elif WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP + ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); +#elif SDL_WINAPI_FAMILY_PHONE HardwareButtons::BackPressed += - ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); + ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); #endif #if NTDDI_VERSION > NTDDI_WIN8 DisplayInformation::GetForCurrentView()->OrientationChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnOrientationChanged); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnOrientationChanged); #else DisplayProperties::OrientationChanged += ref new DisplayPropertiesEventHandler(this, &SDL_WinRTApp::OnOrientationChanged); #endif -#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) // Make sure we know when a user has opened the app's settings pane. // This is needed in order to display a privacy policy, which needs // to be done for network-enabled apps, as per Windows Store requirements. using namespace Windows::UI::ApplicationSettings; SettingsPane::GetForCurrentView()->CommandsRequested += - ref new TypedEventHandler - (this, &SDL_WinRTApp::OnSettingsPaneCommandsRequested); + ref new TypedEventHandler(this, &SDL_WinRTApp::OnSettingsPaneCommandsRequested); #endif } -void SDL_WinRTApp::Load(Platform::String^ entryPoint) +void SDL_WinRTApp::Load(Platform::String ^ entryPoint) { } void SDL_WinRTApp::Run() { SDL_SetMainReady(); - if (WINRT_SDLAppEntryPoint) - { + if (WINRT_SDLAppEntryPoint) { // TODO, WinRT: pass the C-style main() a reasonably realistic // representation of command line arguments. int argc = 1; @@ -373,7 +435,7 @@ void SDL_WinRTApp::Run() static bool IsSDLWindowEventPending(SDL_WindowEventID windowEventID) { SDL_Event events[128]; - const int count = SDL_PeepEvents(events, sizeof(events)/sizeof(SDL_Event), SDL_PEEKEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT); + const int count = SDL_PeepEvents(events, sizeof(events) / sizeof(SDL_Event), SDL_PEEKEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT); for (int i = 0; i < count; ++i) { if (events[i].window.event == windowEventID) { return true; @@ -388,7 +450,7 @@ bool SDL_WinRTApp::ShouldWaitForAppResumeEvents() if (m_windowVisible) { return false; } - + /* Don't wait until the window-hide events finish processing. * Do note that if an app-suspend event is sent (as indicated * by SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND @@ -437,17 +499,17 @@ void SDL_WinRTApp::Uninitialize() #if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) void SDL_WinRTApp::OnSettingsPaneCommandsRequested( - Windows::UI::ApplicationSettings::SettingsPane ^p, - Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^args) + Windows::UI::ApplicationSettings::SettingsPane ^ p, + Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^ args) { using namespace Platform; using namespace Windows::UI::ApplicationSettings; using namespace Windows::UI::Popups; - String ^privacyPolicyURL = nullptr; // a URL to an app's Privacy Policy - String ^privacyPolicyLabel = nullptr; // label/link text - const char *tmpHintValue = NULL; // SDL_GetHint-retrieved value, used immediately - wchar_t *tmpStr = NULL; // used for UTF8 to UCS2 conversion + String ^ privacyPolicyURL = nullptr; // a URL to an app's Privacy Policy + String ^ privacyPolicyLabel = nullptr; // label/link text + const char *tmpHintValue = NULL; // SDL_GetHint-retrieved value, used immediately + wchar_t *tmpStr = NULL; // used for UTF8 to UCS2 conversion // Setup a 'Privacy Policy' link, if one is available (via SDL_GetHint): tmpHintValue = SDL_GetHint(SDL_HINT_WINRT_PRIVACY_POLICY_URL); @@ -471,39 +533,39 @@ void SDL_WinRTApp::OnSettingsPaneCommandsRequested( // Register the link, along with a handler to be called if and when it is // clicked: auto cmd = ref new SettingsCommand(L"privacyPolicy", privacyPolicyLabel, - ref new UICommandInvokedHandler([=](IUICommand ^) { - Windows::System::Launcher::LaunchUriAsync(ref new Uri(privacyPolicyURL)); - })); + ref new UICommandInvokedHandler([=](IUICommand ^) { + Windows::System::Launcher::LaunchUriAsync(ref new Uri(privacyPolicyURL)); + })); args->Request->ApplicationCommands->Append(cmd); } } #endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) -void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args) +void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow ^ sender, WindowSizeChangedEventArgs ^ args) { -#if LOG_WINDOW_EVENTS==1 +#if LOG_WINDOW_EVENTS == 1 SDL_Log("%s, size={%f,%f}, bounds={%f,%f,%f,%f}, current orientation=%d, native orientation=%d, auto rot. pref=%d, WINRT_GlobalSDLWindow?=%s\n", - __FUNCTION__, - args->Size.Width, args->Size.Height, - sender->Bounds.X, sender->Bounds.Y, sender->Bounds.Width, sender->Bounds.Height, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - (WINRT_GlobalSDLWindow ? "yes" : "no")); + __FUNCTION__, + args->Size.Width, args->Size.Height, + sender->Bounds.X, sender->Bounds.Y, sender->Bounds.Width, sender->Bounds.Height, + WINRT_DISPLAY_PROPERTY(CurrentOrientation), + WINRT_DISPLAY_PROPERTY(NativeOrientation), + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), + (WINRT_GlobalSDLWindow ? "yes" : "no")); #endif WINRT_ProcessWindowSizeChange(); } -void SDL_WinRTApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args) +void SDL_WinRTApp::OnVisibilityChanged(CoreWindow ^ sender, VisibilityChangedEventArgs ^ args) { -#if LOG_WINDOW_EVENTS==1 +#if LOG_WINDOW_EVENTS == 1 SDL_Log("%s, visible?=%s, bounds={%f,%f,%f,%f}, WINRT_GlobalSDLWindow?=%s\n", - __FUNCTION__, - (args->Visible ? "yes" : "no"), - sender->Bounds.X, sender->Bounds.Y, - sender->Bounds.Width, sender->Bounds.Height, - (WINRT_GlobalSDLWindow ? "yes" : "no")); + __FUNCTION__, + (args->Visible ? "yes" : "no"), + sender->Bounds.X, sender->Bounds.Y, + sender->Bounds.Width, sender->Bounds.Height, + (WINRT_GlobalSDLWindow ? "yes" : "no")); #endif m_windowVisible = args->Visible; @@ -534,12 +596,12 @@ void SDL_WinRTApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEven } } -void SDL_WinRTApp::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArgs^ args) +void SDL_WinRTApp::OnWindowActivated(CoreWindow ^ sender, WindowActivatedEventArgs ^ args) { -#if LOG_WINDOW_EVENTS==1 +#if LOG_WINDOW_EVENTS == 1 SDL_Log("%s, WINRT_GlobalSDLWindow?=%s\n\n", - __FUNCTION__, - (WINRT_GlobalSDLWindow ? "yes" : "no")); + __FUNCTION__, + (WINRT_GlobalSDLWindow ? "yes" : "no")); #endif /* There's no property in Win 8.x to tell whether a window is active or @@ -549,14 +611,14 @@ void SDL_WinRTApp::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArg */ sender->CustomProperties->Insert("SDLHelperWindowActivationState", args->WindowActivationState); - SDL_Window * window = WINRT_GlobalSDLWindow; + SDL_Window *window = WINRT_GlobalSDLWindow; if (window) { if (args->WindowActivationState != CoreWindowActivationState::Deactivated) { SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0); if (SDL_GetKeyboardFocus() != window) { SDL_SetKeyboardFocus(window); } - + /* Send a mouse-motion event as appropriate. This doesn't work when called from OnPointerEntered, at least not in WinRT CoreWindow apps (as OnPointerEntered doesn't @@ -566,19 +628,19 @@ void SDL_WinRTApp::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArg Don't do it on WinPhone 8.0 though, as CoreWindow's 'PointerPosition' property isn't available. */ -#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION >= NTDDI_WINBLUE) +#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION >= NTDDI_WINBLUE) Point cursorPos = WINRT_TransformCursorPosition(window, sender->PointerPosition, TransformToSDLWindowSize); SDL_SendMouseMotion(window, 0, 0, (int)cursorPos.X, (int)cursorPos.Y); #endif /* TODO, WinRT: see if the Win32 bugfix from https://hg.libsdl.org/SDL/rev/d278747da408 needs to be applied (on window activation) */ - //WIN_CheckAsyncMouseRelease(data); + // WIN_CheckAsyncMouseRelease(data); /* TODO, WinRT: implement clipboard support, if possible */ ///* // * FIXME: Update keyboard state // */ - //WIN_CheckClipboardUpdate(data->videodata); + // WIN_CheckClipboardUpdate(data->videodata); // HACK: Resetting the mouse-cursor here seems to fix // https://bugzilla.libsdl.org/show_bug.cgi?id=3217, whereby a @@ -596,21 +658,35 @@ void SDL_WinRTApp::OnWindowActivated(CoreWindow^ sender, WindowActivatedEventArg } } -void SDL_WinRTApp::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args) +void SDL_WinRTApp::OnWindowClosed(CoreWindow ^ sender, CoreWindowEventArgs ^ args) { -#if LOG_WINDOW_EVENTS==1 +#if LOG_WINDOW_EVENTS == 1 SDL_Log("%s\n", __FUNCTION__); #endif m_windowClosed = true; + WINRT_LaunchExitUriIfSet(); } -void SDL_WinRTApp::OnAppActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args) +void SDL_WinRTApp::OnAppActivated(CoreApplicationView ^ applicationView, IActivatedEventArgs ^ args) { + if (args->Kind == Windows::ApplicationModel::Activation::ActivationKind::Protocol) + { + auto protocolArgs = dynamic_cast(args); + if (protocolArgs && protocolArgs->Uri) + { + WINRT_ProtocolActivationURI = protocolArgs->Uri->AbsoluteUri; + // Extract and store launchOnExit URI before main URI gets cleared + WINRT_ExtractLaunchOnExitURI(WINRT_ProtocolActivationURI); + } + } CoreWindow::GetForCurrentThread()->Activate(); } -void SDL_WinRTApp::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args) +void SDL_WinRTApp::OnSuspending(Platform::Object ^ sender, SuspendingEventArgs ^ args) { + // Launch exit URI if set before suspending + WINRT_LaunchExitUriIfSet(); + // Save app state asynchronously after requesting a deferral. Holding a deferral // indicates that the application is busy performing suspending operations. Be // aware that a deferral may not be held indefinitely. After about five seconds, @@ -625,9 +701,8 @@ void SDL_WinRTApp::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ a // this could be important. SDL_SendAppEvent(SDL_APP_WILLENTERBACKGROUND); - SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral(); - create_task([this, deferral]() - { + SuspendingDeferral ^ deferral = args->SuspendingOperation->GetDeferral(); + create_task([this, deferral]() { // Send an app did-enter-background event immediately to observers. // CoreDispatcher::ProcessEvents, which is the backbone on which // SDL_WinRTApp::PumpEvents is built, will not return to its caller @@ -640,9 +715,9 @@ void SDL_WinRTApp::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ a // Let the Direct3D 11 renderer prepare for the app to be backgrounded. // This is necessary for Windows 8.1, possibly elsewhere in the future. // More details at: http://msdn.microsoft.com/en-us/library/windows/apps/Hh994929.aspx -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 if (WINRT_GlobalSDLWindow) { - SDL_Renderer * renderer = SDL_GetRenderer(WINRT_GlobalSDLWindow); + SDL_Renderer *renderer = SDL_GetRenderer(WINRT_GlobalSDLWindow); if (renderer && (SDL_strcmp(renderer->info.name, "direct3d11") == 0)) { D3D11_Trim(renderer); } @@ -653,7 +728,7 @@ void SDL_WinRTApp::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ a }); } -void SDL_WinRTApp::OnResuming(Platform::Object^ sender, Platform::Object^ args) +void SDL_WinRTApp::OnResuming(Platform::Object ^ sender, Platform::Object ^ args) { // Restore any data or state that was unloaded on suspend. By default, data // and state are persisted when resuming from suspend. Note that these events @@ -662,29 +737,29 @@ void SDL_WinRTApp::OnResuming(Platform::Object^ sender, Platform::Object^ args) SDL_SendAppEvent(SDL_APP_DIDENTERFOREGROUND); } -void SDL_WinRTApp::OnExiting(Platform::Object^ sender, Platform::Object^ args) +void SDL_WinRTApp::OnExiting(Platform::Object ^ sender, Platform::Object ^ args) { SDL_SendAppEvent(SDL_APP_TERMINATING); + WINRT_LaunchExitUriIfSet(); } -static void -WINRT_LogPointerEvent(const char * header, Windows::UI::Core::PointerEventArgs ^ args, Windows::Foundation::Point transformedPoint) +static void WINRT_LogPointerEvent(const char *header, Windows::UI::Core::PointerEventArgs ^ args, Windows::Foundation::Point transformedPoint) { Uint8 button, pressed; Windows::UI::Input::PointerPoint ^ pt = args->CurrentPoint; WINRT_GetSDLButtonForPointerPoint(pt, &button, &pressed); SDL_Log("%s: Position={%f,%f}, Transformed Pos={%f, %f}, MouseWheelDelta=%d, FrameId=%d, PointerId=%d, SDL button=%d pressed=%d\n", - header, - pt->Position.X, pt->Position.Y, - transformedPoint.X, transformedPoint.Y, - pt->Properties->MouseWheelDelta, - pt->FrameId, - pt->PointerId, - button, - pressed); + header, + pt->Position.X, pt->Position.Y, + transformedPoint.X, transformedPoint.Y, + pt->Properties->MouseWheelDelta, + pt->FrameId, + pt->PointerId, + button, + pressed); } -void SDL_WinRTApp::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerPressed(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer pressed", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); @@ -693,7 +768,7 @@ void SDL_WinRTApp::OnPointerPressed(CoreWindow^ sender, PointerEventArgs^ args) WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerMoved(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer moved", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); @@ -702,16 +777,16 @@ void SDL_WinRTApp::OnPointerMoved(CoreWindow^ sender, PointerEventArgs^ args) WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnPointerReleased(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerReleased(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer released", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); #endif - + WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnPointerEntered(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerEntered(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer entered", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); @@ -720,7 +795,7 @@ void SDL_WinRTApp::OnPointerEntered(CoreWindow^ sender, PointerEventArgs^ args) WINRT_ProcessPointerEnteredEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnPointerExited(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerExited(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer exited", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); @@ -729,7 +804,7 @@ void SDL_WinRTApp::OnPointerExited(CoreWindow^ sender, PointerEventArgs^ args) WINRT_ProcessPointerExitedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ args) +void SDL_WinRTApp::OnPointerWheelChanged(CoreWindow ^ sender, PointerEventArgs ^ args) { #if LOG_POINTER_EVENTS WINRT_LogPointerEvent("pointer wheel changed", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); @@ -738,22 +813,22 @@ void SDL_WinRTApp::OnPointerWheelChanged(CoreWindow^ sender, PointerEventArgs^ a WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); } -void SDL_WinRTApp::OnMouseMoved(MouseDevice^ mouseDevice, MouseEventArgs^ args) +void SDL_WinRTApp::OnMouseMoved(MouseDevice ^ mouseDevice, MouseEventArgs ^ args) { WINRT_ProcessMouseMovedEvent(WINRT_GlobalSDLWindow, args); } -void SDL_WinRTApp::OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args) +void SDL_WinRTApp::OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) { WINRT_ProcessKeyDownEvent(args); } -void SDL_WinRTApp::OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args) +void SDL_WinRTApp::OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args) { WINRT_ProcessKeyUpEvent(args); } -void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args) +void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CharacterReceivedEventArgs ^ args) { WINRT_ProcessCharacterReceivedEvent(args); } @@ -770,13 +845,13 @@ static void WINRT_OnBackButtonPressed(BackButtonEventArgs ^ args) } #if NTDDI_VERSION >= NTDDI_WIN10 -void SDL_WinRTApp::OnBackButtonPressed(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args) +void SDL_WinRTApp::OnBackButtonPressed(Platform::Object ^ sender, Windows::UI::Core::BackRequestedEventArgs ^ args) { WINRT_OnBackButtonPressed(args); } -#elif WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP -void SDL_WinRTApp::OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args) +#elif SDL_WINAPI_FAMILY_PHONE +void SDL_WinRTApp::OnBackButtonPressed(Platform::Object ^ sender, Windows::Phone::UI::Input::BackPressedEventArgs ^ args) { WINRT_OnBackButtonPressed(args); @@ -784,7 +859,7 @@ void SDL_WinRTApp::OnBackButtonPressed(Platform::Object^ sender, Windows::Phone: #endif #if NTDDI_VERSION >= NTDDI_WIN10 -void SDL_WinRTApp::OnGamepadAdded(Platform::Object ^sender, Windows::Gaming::Input::Gamepad ^gamepad) +void SDL_WinRTApp::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ gamepad) { /* HACK ALERT: Nothing needs to be done here, as this method currently only exists to allow something to be registered with Win10's diff --git a/src/core/winrt/SDL_winrtapp_direct3d.h b/src/core/winrt/SDL_winrtapp_direct3d.h index 1f7c917a6549a..9d2eb76870f15 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.h +++ b/src/core/winrt/SDL_winrtapp_direct3d.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,67 +24,69 @@ extern int SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **)); ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView { -public: + public: SDL_WinRTApp(); - + virtual ~SDL_WinRTApp(); + // IFrameworkView Methods. - virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView); - virtual void SetWindow(Windows::UI::Core::CoreWindow^ window); - virtual void Load(Platform::String^ entryPoint); + virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView ^ applicationView); + virtual void SetWindow(Windows::UI::Core::CoreWindow ^ window); + virtual void Load(Platform::String ^ entryPoint); virtual void Run(); virtual void Uninitialize(); -internal: - // SDL-specific methods - void PumpEvents(); + internal : + // SDL-specific methods + void + PumpEvents(); -protected: + protected: bool ShouldWaitForAppResumeEvents(); // Event Handlers. -#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) +#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) void OnSettingsPaneCommandsRequested( - Windows::UI::ApplicationSettings::SettingsPane ^p, - Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^args); + Windows::UI::ApplicationSettings::SettingsPane ^ p, + Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^ args); #endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) #if NTDDI_VERSION > NTDDI_WIN8 - void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args); + void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation ^ sender, Platform::Object ^ args); #else - void OnOrientationChanged(Platform::Object^ sender); + void OnOrientationChanged(Platform::Object ^ sender); #endif - void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args); - void OnLogicalDpiChanged(Platform::Object^ sender); - void OnAppActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args); - void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); - void OnResuming(Platform::Object^ sender, Platform::Object^ args); - void OnExiting(Platform::Object^ sender, Platform::Object^ args); - void OnWindowActivated(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowActivatedEventArgs^ args); - void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args); - void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerEntered(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnPointerExited(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args); - void OnMouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args); - void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); - void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args); - void OnCharacterReceived(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CharacterReceivedEventArgs^ args); + void OnWindowSizeChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::WindowSizeChangedEventArgs ^ args); + void OnLogicalDpiChanged(Platform::Object ^ sender); + void OnAppActivated(Windows::ApplicationModel::Core::CoreApplicationView ^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args); + void OnSuspending(Platform::Object ^ sender, Windows::ApplicationModel::SuspendingEventArgs ^ args); + void OnResuming(Platform::Object ^ sender, Platform::Object ^ args); + void OnExiting(Platform::Object ^ sender, Platform::Object ^ args); + void OnWindowActivated(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::WindowActivatedEventArgs ^ args); + void OnWindowClosed(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CoreWindowEventArgs ^ args); + void OnVisibilityChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::VisibilityChangedEventArgs ^ args); + void OnPointerPressed(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnPointerReleased(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnPointerWheelChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnPointerEntered(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnPointerExited(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); + void OnMouseMoved(Windows::Devices::Input::MouseDevice ^ mouseDevice, Windows::Devices::Input::MouseEventArgs ^ args); + void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args); + void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args); + void OnCharacterReceived(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CharacterReceivedEventArgs ^ args); #if NTDDI_VERSION >= NTDDI_WIN10 - void OnBackButtonPressed(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args); -#elif WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - void OnBackButtonPressed(Platform::Object^ sender, Windows::Phone::UI::Input::BackPressedEventArgs^ args); + void OnBackButtonPressed(Platform::Object ^ sender, Windows::UI::Core::BackRequestedEventArgs ^ args); +#elif SDL_WINAPI_FAMILY_PHONE + void OnBackButtonPressed(Platform::Object ^ sender, Windows::Phone::UI::Input::BackPressedEventArgs ^ args); #endif #if NTDDI_VERSION >= NTDDI_WIN10 - void OnGamepadAdded(Platform::Object ^sender, Windows::Gaming::Input::Gamepad ^gamepad); + void OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ gamepad); #endif -private: + private: bool m_windowClosed; bool m_windowVisible; }; diff --git a/src/core/winrt/SDL_winrtapp_xaml.cpp b/src/core/winrt/SDL_winrtapp_xaml.cpp index 69716e11d7251..361c8329abdd7 100644 --- a/src/core/winrt/SDL_winrtapp_xaml.cpp +++ b/src/core/winrt/SDL_winrtapp_xaml.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,6 @@ #include #endif - /* SDL includes */ #include "../../SDL_internal.h" #include "SDL.h" @@ -36,72 +35,60 @@ #include "SDL_winrtapp_common.h" #include "SDL_winrtapp_xaml.h" - - /* SDL-internal globals: */ SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE; #if WINAPI_FAMILY == WINAPI_FAMILY_APP -extern "C" -ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL; -static Windows::Foundation::EventRegistrationToken WINRT_XAMLAppEventToken; +extern "C" ISwapChainBackgroundPanelNative *WINRT_GlobalSwapChainBackgroundPanelNative = NULL; +static Windows::Foundation::EventRegistrationToken WINRT_XAMLAppEventToken; #endif - /* * Input event handlers (XAML) */ #if WINAPI_FAMILY == WINAPI_FAMILY_APP -static void -WINRT_OnPointerPressedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args) +static void WINRT_OnPointerPressedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) { WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); } -static void -WINRT_OnPointerMovedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args) +static void WINRT_OnPointerMovedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) { WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); } -static void -WINRT_OnPointerReleasedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args) +static void WINRT_OnPointerReleasedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) { WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); } -static void -WINRT_OnPointerWheelChangedViaXAML(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ args) +static void WINRT_OnPointerWheelChangedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) { WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); } #endif // WINAPI_FAMILY == WINAPI_FAMILY_APP - /* * XAML-to-SDL Rendering Callback */ #if WINAPI_FAMILY == WINAPI_FAMILY_APP -static void -WINRT_OnRenderViaXAML(_In_ Platform::Object^ sender, _In_ Platform::Object^ args) +static void WINRT_OnRenderViaXAML(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args) { WINRT_CycleXAMLThread(); } #endif // WINAPI_FAMILY == WINAPI_FAMILY_APP - /* * SDL + XAML Initialization */ -int -SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAsIInspectable) +int SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void *backgroundPanelAsIInspectable) { -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE return SDL_SetError("XAML support is not yet available in Windows Phone."); #else // Declare C++/CX namespaces: @@ -114,13 +101,13 @@ SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAs using namespace Windows::UI::Xaml::Media; // Make sure we have a valid XAML element (to draw onto): - if ( ! backgroundPanelAsIInspectable) { + if (!backgroundPanelAsIInspectable) { return SDL_InvalidParamError("backgroundPanelAsIInspectable"); } - Platform::Object ^ backgroundPanel = reinterpret_cast((IInspectable *) backgroundPanelAsIInspectable); - SwapChainBackgroundPanel ^swapChainBackgroundPanel = dynamic_cast(backgroundPanel); - if ( ! swapChainBackgroundPanel) { + Platform::Object ^ backgroundPanel = reinterpret_cast((IInspectable *)backgroundPanelAsIInspectable); + SwapChainBackgroundPanel ^ swapChainBackgroundPanel = dynamic_cast(backgroundPanel); + if (!swapChainBackgroundPanel) { return SDL_SetError("An unknown or unsupported type of XAML control was specified."); } @@ -131,10 +118,10 @@ SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAs swapChainBackgroundPanel->PointerMoved += ref new PointerEventHandler(WINRT_OnPointerMovedViaXAML); // Setup for rendering: - IInspectable *panelInspectable = (IInspectable*) reinterpret_cast(swapChainBackgroundPanel); + IInspectable *panelInspectable = (IInspectable *)reinterpret_cast(swapChainBackgroundPanel); panelInspectable->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&WINRT_GlobalSwapChainBackgroundPanelNative); - WINRT_XAMLAppEventToken = CompositionTarget::Rendering::add(ref new EventHandler(WINRT_OnRenderViaXAML)); + WINRT_XAMLAppEventToken = CompositionTarget::Rendering::add(ref new EventHandler(WINRT_OnRenderViaXAML)); // Make sure the app is ready to call the SDL-centric main() function: WINRT_SDLAppEntryPoint = mainFunction; @@ -156,5 +143,5 @@ SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAs // All done, for now. return 0; -#endif // WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP / else +#endif // SDL_WINAPI_FAMILY_PHONE / else } diff --git a/src/core/winrt/SDL_winrtapp_xaml.h b/src/core/winrt/SDL_winrtapp_xaml.h index e26e21884ef11..39e46c9fa2382 100644 --- a/src/core/winrt/SDL_winrtapp_xaml.h +++ b/src/core/winrt/SDL_winrtapp_xaml.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #ifdef __cplusplus extern SDL_bool WINRT_XAMLWasEnabled; -extern int SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void * backgroundPanelAsIInspectable); +extern int SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void *backgroundPanelAsIInspectable); #endif // ifdef __cplusplus #endif // SDL_winrtapp_xaml_h_ diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 540f6a54e5a87..28d1374da4cfc 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,14 +50,13 @@ #endif #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__)) #include /* For AltiVec check */ -#elif defined(__OpenBSD__) && defined(__powerpc__) +#elif defined(__OpenBSD__) && defined(__powerpc__) && !defined(HAVE_ELF_AUX_INFO) #include #include /* For AltiVec check */ #include -#elif defined(__FreeBSD__) && defined(__powerpc__) +#elif defined(__FreeBSD__) && defined(__powerpc__) && defined(HAVE_ELF_AUX_INFO) #include -#include -#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP +#elif defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP) #include #include #endif @@ -85,6 +84,10 @@ #endif #endif +#if defined (__FreeBSD__) +#include +#endif + #if defined(__ANDROID__) && defined(__arm__) && !defined(HAVE_GETAUXVAL) #include #endif @@ -102,41 +105,43 @@ #include #endif -#define CPU_HAS_RDTSC (1 << 0) -#define CPU_HAS_ALTIVEC (1 << 1) -#define CPU_HAS_MMX (1 << 2) -#define CPU_HAS_3DNOW (1 << 3) -#define CPU_HAS_SSE (1 << 4) -#define CPU_HAS_SSE2 (1 << 5) -#define CPU_HAS_SSE3 (1 << 6) -#define CPU_HAS_SSE41 (1 << 7) -#define CPU_HAS_SSE42 (1 << 8) -#define CPU_HAS_AVX (1 << 9) -#define CPU_HAS_AVX2 (1 << 10) -#define CPU_HAS_NEON (1 << 11) -#define CPU_HAS_AVX512F (1 << 12) +#define CPU_HAS_RDTSC (1 << 0) +#define CPU_HAS_ALTIVEC (1 << 1) +#define CPU_HAS_MMX (1 << 2) +#define CPU_HAS_3DNOW (1 << 3) +#define CPU_HAS_SSE (1 << 4) +#define CPU_HAS_SSE2 (1 << 5) +#define CPU_HAS_SSE3 (1 << 6) +#define CPU_HAS_SSE41 (1 << 7) +#define CPU_HAS_SSE42 (1 << 8) +#define CPU_HAS_AVX (1 << 9) +#define CPU_HAS_AVX2 (1 << 10) +#define CPU_HAS_NEON (1 << 11) +#define CPU_HAS_AVX512F (1 << 12) #define CPU_HAS_ARM_SIMD (1 << 13) -#define CPU_HAS_LSX (1 << 14) -#define CPU_HAS_LASX (1 << 15) - -#define CPU_CFG2 0x2 -#define CPU_CFG2_LSX (1 << 6) -#define CPU_CFG2_LASX (1 << 7) - -#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__ && !__OpenBSD__ && !__FreeBSD__ +#define CPU_HAS_LSX (1 << 14) +#define CPU_HAS_LASX (1 << 15) + +#define CPU_CFG2 0x2 +#define CPU_CFG2_LSX (1 << 6) +#define CPU_CFG2_LASX (1 << 7) + +#if !defined(SDL_CPUINFO_DISABLED) && \ + !((defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))) && \ + !(defined(__FreeBSD__) && defined(__powerpc__)) && \ + !(defined(__LINUX__) && defined(__powerpc__) && defined(HAVE_GETAUXVAL)) && \ + defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP) /* This is the brute force way of detecting instruction sets... the idea is borrowed from the libmpeg2 library - thanks! */ static jmp_buf jmpbuf; -static void -illegal_instruction(int sig) +static void illegal_instruction(int sig) { longjmp(jmpbuf, 1); } #endif /* HAVE_SETJMP */ -static int -CPU_haveCPUID(void) +static int CPU_haveCPUID(void) { int has_CPUID = 0; @@ -161,7 +166,7 @@ CPU_haveCPUID(void) : "%eax", "%ecx" ); #elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__) -/* Technically, if this is being compiled under __x86_64__ then it has +/* Technically, if this is being compiled under __x86_64__ then it has CPUid by definition. But it's nice to be able to prove it. :) */ __asm__ ( " pushfq # Get original EFLAGS \n" @@ -234,23 +239,25 @@ CPU_haveCPUID(void) } #if (defined(__GNUC__) || defined(__llvm__)) && defined(__i386__) -#define cpuid(func, a, b, c, d) \ - __asm__ __volatile__ ( \ -" pushl %%ebx \n" \ -" xorl %%ecx,%%ecx \n" \ -" cpuid \n" \ -" movl %%ebx, %%esi \n" \ -" popl %%ebx \n" : \ - "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func)) +#define cpuid(func, a, b, c, d) \ + __asm__ __volatile__( \ + " pushl %%ebx \n" \ + " xorl %%ecx,%%ecx \n" \ + " cpuid \n" \ + " movl %%ebx, %%esi \n" \ + " popl %%ebx \n" \ + : "=a"(a), "=S"(b), "=c"(c), "=d"(d) \ + : "a"(func)) #elif (defined(__GNUC__) || defined(__llvm__)) && defined(__x86_64__) -#define cpuid(func, a, b, c, d) \ - __asm__ __volatile__ ( \ -" pushq %%rbx \n" \ -" xorq %%rcx,%%rcx \n" \ -" cpuid \n" \ -" movq %%rbx, %%rsi \n" \ -" popq %%rbx \n" : \ - "=a" (a), "=S" (b), "=c" (c), "=d" (d) : "a" (func)) +#define cpuid(func, a, b, c, d) \ + __asm__ __volatile__( \ + " pushq %%rbx \n" \ + " xorq %%rcx,%%rcx \n" \ + " cpuid \n" \ + " movq %%rbx, %%rsi \n" \ + " popq %%rbx \n" \ + : "=a"(a), "=S"(b), "=c"(c), "=d"(d) \ + : "a"(func)) #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) #define cpuid(func, a, b, c, d) \ __asm { \ @@ -260,21 +267,28 @@ CPU_haveCPUID(void) __asm mov a, eax \ __asm mov b, ebx \ __asm mov c, ecx \ - __asm mov d, edx \ -} -#elif defined(_MSC_VER) && defined(_M_X64) -#define cpuid(func, a, b, c, d) \ -{ \ - int CPUInfo[4]; \ - __cpuid(CPUInfo, func); \ - a = CPUInfo[0]; \ - b = CPUInfo[1]; \ - c = CPUInfo[2]; \ - d = CPUInfo[3]; \ -} + __asm mov d, edx \ + } +#elif (defined(_MSC_VER) && defined(_M_X64)) +/* Use __cpuidex instead of __cpuid because ICL does not clear ecx register */ +#define cpuid(func, a, b, c, d) \ + { \ + int CPUInfo[4]; \ + __cpuidex(CPUInfo, func, 0); \ + a = CPUInfo[0]; \ + b = CPUInfo[1]; \ + c = CPUInfo[2]; \ + d = CPUInfo[3]; \ + } #else #define cpuid(func, a, b, c, d) \ - do { a = b = c = d = 0; (void) a; (void) b; (void) c; (void) d; } while (0) + do { \ + a = b = c = d = 0; \ + (void)a; \ + (void)b; \ + (void)c; \ + (void)d; \ + } while (0) #endif static int CPU_CPUIDFeatures[4]; @@ -282,8 +296,7 @@ static int CPU_CPUIDMaxFunction = 0; static SDL_bool CPU_OSSavesYMM = SDL_FALSE; static SDL_bool CPU_OSSavesZMM = SDL_FALSE; -static void -CPU_calcCPUIDFeatures(void) +static void CPU_calcCPUIDFeatures(void) { static SDL_bool checked = SDL_FALSE; if (!checked) { @@ -303,16 +316,19 @@ CPU_calcCPUIDFeatures(void) if (c & 0x08000000) { /* Call xgetbv to see if YMM (etc) register state is saved */ #if (defined(__GNUC__) || defined(__llvm__)) && (defined(__i386__) || defined(__x86_64__)) - __asm__(".byte 0x0f, 0x01, 0xd0" : "=a" (a) : "c" (0) : "%edx"); + __asm__(".byte 0x0f, 0x01, 0xd0" + : "=a"(a) + : "c"(0) + : "%edx"); #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) && (_MSC_FULL_VER >= 160040219) /* VS2010 SP1 */ a = (int)_xgetbv(0); #elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) __asm - { + { xor ecx, ecx _asm _emit 0x0f _asm _emit 0x01 _asm _emit 0xd0 mov a, eax - } + } #endif CPU_OSSavesYMM = ((a & 6) == 6) ? SDL_TRUE : SDL_FALSE; CPU_OSSavesZMM = (CPU_OSSavesYMM && ((a & 0xe0) == 0xe0)) ? SDL_TRUE : SDL_FALSE; @@ -322,12 +338,16 @@ CPU_calcCPUIDFeatures(void) } } -static int -CPU_haveAltiVec(void) +static int CPU_haveAltiVec(void) { volatile int altivec = 0; #ifndef SDL_CPUINFO_DISABLED -#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) +#if (defined(__FreeBSD__) || defined(__OpenBSD__)) && defined(__powerpc__) && defined(HAVE_ELF_AUX_INFO) + unsigned long cpufeatures = 0; + elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)); + altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; + return altivec; +#elif (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) #ifdef __OpenBSD__ int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC }; #else @@ -336,18 +356,17 @@ CPU_haveAltiVec(void) int hasVectorUnit = 0; size_t length = sizeof(hasVectorUnit); int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0); - if (0 == error) + if (0 == error) { altivec = (hasVectorUnit != 0); -#elif defined(__FreeBSD__) && defined(__powerpc__) - unsigned long cpufeatures = 0; - elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)); - altivec = cpufeatures & PPC_FEATURE_HAS_ALTIVEC; - return altivec; -#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP - void (*handler) (int sig); + } +#elif defined(__LINUX__) && defined(__powerpc__) && defined(HAVE_GETAUXVAL) + altivec = getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC; +#elif defined(SDL_ALTIVEC_BLITTERS) && defined(HAVE_SETJMP) + void (*handler)(int sig); handler = signal(SIGILL, illegal_instruction); if (setjmp(jmpbuf) == 0) { - asm volatile ("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0"::"r" (-1)); + asm volatile("mtspr 256, %0\n\t" + "vand %%v0, %%v0, %%v0" ::"r"(-1)); altivec = 1; } signal(SIGILL, handler); @@ -357,35 +376,29 @@ CPU_haveAltiVec(void) } #if (defined(__ARM_ARCH) && (__ARM_ARCH >= 6)) || defined(__aarch64__) -static int -CPU_haveARMSIMD(void) +static int CPU_haveARMSIMD(void) { return 1; } #elif !defined(__arm__) -static int -CPU_haveARMSIMD(void) +static int CPU_haveARMSIMD(void) { return 0; } #elif defined(__LINUX__) -static int -CPU_haveARMSIMD(void) +static int CPU_haveARMSIMD(void) { int arm_simd = 0; int fd; fd = open("/proc/self/auxv", O_RDONLY | O_CLOEXEC); - if (fd >= 0) - { + if (fd >= 0) { Elf32_auxv_t aux; - while (read(fd, &aux, sizeof aux) == sizeof aux) - { - if (aux.a_type == AT_PLATFORM) - { - const char *plat = (const char *) aux.a_un.a_val; + while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) { + if (aux.a_type == AT_PLATFORM) { + const char *plat = (const char *)aux.a_un.a_val; if (plat) { arm_simd = SDL_strncmp(plat, "v6l", 3) == 0 || SDL_strncmp(plat, "v7l", 3) == 0; @@ -398,28 +411,29 @@ CPU_haveARMSIMD(void) } #elif defined(__RISCOS__) -static int -CPU_haveARMSIMD(void) +static int CPU_haveARMSIMD(void) { _kernel_swi_regs regs; regs.r[0] = 0; - if (_kernel_swi(OS_PlatformFeatures, ®s, ®s) != NULL) + if (_kernel_swi(OS_PlatformFeatures, ®s, ®s) != NULL) { return 0; + } - if (!(regs.r[0] & (1<<31))) + if (!(regs.r[0] & (1 << 31))) { return 0; + } regs.r[0] = 34; regs.r[1] = 29; - if (_kernel_swi(OS_PlatformFeatures, ®s, ®s) != NULL) + if (_kernel_swi(OS_PlatformFeatures, ®s, ®s) != NULL) { return 0; + } return regs.r[0]; } #else -static int -CPU_haveARMSIMD(void) +static int CPU_haveARMSIMD(void) { #warning SDL_HasARMSIMD is not implemented for this ARM platform. Write me. return 0; @@ -427,17 +441,15 @@ CPU_haveARMSIMD(void) #endif #if defined(__LINUX__) && defined(__arm__) && !defined(HAVE_GETAUXVAL) -static int -readProcAuxvForNeon(void) +static int readProcAuxvForNeon(void) { int neon = 0; int fd; fd = open("/proc/self/auxv", O_RDONLY | O_CLOEXEC); - if (fd >= 0) - { + if (fd >= 0) { Elf32_auxv_t aux; - while (read(fd, &aux, sizeof (aux)) == sizeof (aux)) { + while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) { if (aux.a_type == AT_HWCAP) { neon = (aux.a_un.a_val & HWCAP_NEON) == HWCAP_NEON; break; @@ -449,45 +461,43 @@ readProcAuxvForNeon(void) } #endif -static int -CPU_haveNEON(void) +static int CPU_haveNEON(void) { /* The way you detect NEON is a privileged instruction on ARM, so you have query the OS kernel in a platform-specific way. :/ */ #if defined(SDL_CPUINFO_DISABLED) - return 0; /* disabled */ + return 0; /* disabled */ #elif (defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)) && (defined(_M_ARM) || defined(_M_ARM64)) /* Visual Studio, for ARM, doesn't define __ARM_ARCH. Handle this first. */ /* Seems to have been removed */ -# if !defined(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) -# define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19 -# endif -/* All WinRT ARM devices are required to support NEON, but just in case. */ +#if !defined(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) +#define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19 +#endif + /* All WinRT ARM devices are required to support NEON, but just in case. */ return IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) != 0; #elif (defined(__ARM_ARCH) && (__ARM_ARCH >= 8)) || defined(__aarch64__) - return 1; /* ARMv8 always has non-optional NEON support. */ -#elif __VITA__ + return 1; /* ARMv8 always has non-optional NEON support. */ +#elif defined(__VITA__) return 1; -#elif __3DS__ +#elif defined(__3DS__) return 0; #elif defined(__APPLE__) && defined(__ARM_ARCH) && (__ARM_ARCH >= 7) /* (note that sysctlbyname("hw.optional.neon") doesn't work!) */ - return 1; /* all Apple ARMv7 chips and later have NEON. */ + return 1; /* all Apple ARMv7 chips and later have NEON. */ #elif defined(__APPLE__) - return 0; /* assume anything else from Apple doesn't have NEON. */ + return 0; /* assume anything else from Apple doesn't have NEON. */ #elif !defined(__arm__) - return 0; /* not an ARM CPU at all. */ -#elif defined(__OpenBSD__) - return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */ + return 0; /* not an ARM CPU at all. */ #elif defined(HAVE_ELF_AUX_INFO) unsigned long hasneon = 0; - if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0) + if (elf_aux_info(AT_HWCAP, (void *)&hasneon, (int)sizeof(hasneon)) != 0) { return 0; + } return ((hasneon & HWCAP_NEON) == HWCAP_NEON); #elif defined(__QNXNTO__) return SYSPAGE_ENTRY(cpuinfo)->flags & ARM_CPU_FLAG_NEON; #elif (defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_GETAUXVAL) - return ((getauxval(AT_HWCAP) & HWCAP_NEON) == HWCAP_NEON); + return (getauxval(AT_HWCAP) & HWCAP_NEON) == HWCAP_NEON; #elif defined(__LINUX__) return readProcAuxvForNeon(); #elif defined(__ANDROID__) @@ -496,7 +506,7 @@ CPU_haveNEON(void) AndroidCpuFamily cpu_family = android_getCpuFamily(); if (cpu_family == ANDROID_CPU_FAMILY_ARM) { uint64_t cpu_features = android_getCpuFeatures(); - if ((cpu_features & ANDROID_CPU_ARM_FEATURE_NEON) != 0) { + if (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON) { return 1; } } @@ -514,27 +524,27 @@ CPU_haveNEON(void) } return 0; } +#elif defined(__OpenBSD__) + return 1; /* OpenBSD only supports ARMv7 CPUs that have NEON. */ #else #warning SDL_HasNEON is not implemented for this ARM platform. Write me. return 0; #endif } -static int -CPU_readCPUCFG(void) +static int CPU_readCPUCFG(void) { uint32_t cfg2 = 0; #if defined __loongarch__ __asm__ volatile( "cpucfg %0, %1 \n\t" : "+&r"(cfg2) - : "r"(CPU_CFG2) - ); + : "r"(CPU_CFG2)); #endif return cfg2; } -#define CPU_haveLSX() (CPU_readCPUCFG() & CPU_CFG2_LSX) +#define CPU_haveLSX() (CPU_readCPUCFG() & CPU_CFG2_LSX) #define CPU_haveLASX() (CPU_readCPUCFG() & CPU_CFG2_LASX) #if defined(__e2k__) @@ -548,15 +558,14 @@ CPU_have3DNow(void) #endif } #else -static int -CPU_have3DNow(void) +static int CPU_have3DNow(void) { - if (CPU_CPUIDMaxFunction > 0) { /* that is, do we have CPUID at all? */ + if (CPU_CPUIDMaxFunction > 0) { /* that is, do we have CPUID at all? */ int a, b, c, d; cpuid(0x80000000, a, b, c, d); if (a >= 0x80000001) { cpuid(0x80000001, a, b, c, d); - return (d & 0x80000000); + return d & 0x80000000; } } return 0; @@ -602,13 +611,13 @@ CPU_have3DNow(void) #endif #else #define CPU_haveRDTSC() (CPU_CPUIDFeatures[3] & 0x00000010) -#define CPU_haveMMX() (CPU_CPUIDFeatures[3] & 0x00800000) -#define CPU_haveSSE() (CPU_CPUIDFeatures[3] & 0x02000000) -#define CPU_haveSSE2() (CPU_CPUIDFeatures[3] & 0x04000000) -#define CPU_haveSSE3() (CPU_CPUIDFeatures[2] & 0x00000001) +#define CPU_haveMMX() (CPU_CPUIDFeatures[3] & 0x00800000) +#define CPU_haveSSE() (CPU_CPUIDFeatures[3] & 0x02000000) +#define CPU_haveSSE2() (CPU_CPUIDFeatures[3] & 0x04000000) +#define CPU_haveSSE3() (CPU_CPUIDFeatures[2] & 0x00000001) #define CPU_haveSSE41() (CPU_CPUIDFeatures[2] & 0x00080000) #define CPU_haveSSE42() (CPU_CPUIDFeatures[2] & 0x00100000) -#define CPU_haveAVX() (CPU_OSSavesYMM && (CPU_CPUIDFeatures[2] & 0x10000000)) +#define CPU_haveAVX() (CPU_OSSavesYMM && (CPU_CPUIDFeatures[2] & 0x10000000)) #endif #if defined(__e2k__) @@ -622,14 +631,16 @@ CPU_haveAVX2(void) #endif } #else -static int -CPU_haveAVX2(void) +static int CPU_haveAVX2(void) { if (CPU_OSSavesYMM && (CPU_CPUIDMaxFunction >= 7)) { int a, b, c, d; - (void) a; (void) b; (void) c; (void) d; /* compiler warnings... */ + (void)a; + (void)b; + (void)c; + (void)d; /* compiler warnings... */ cpuid(7, a, b, c, d); - return (b & 0x00000020); + return b & 0x00000020; } return 0; } @@ -642,14 +653,16 @@ CPU_haveAVX512F(void) return 0; } #else -static int -CPU_haveAVX512F(void) +static int CPU_haveAVX512F(void) { if (CPU_OSSavesZMM && (CPU_CPUIDMaxFunction >= 7)) { int a, b, c, d; - (void) a; (void) b; (void) c; (void) d; /* compiler warnings... */ + (void)a; + (void)b; + (void)c; + (void)d; /* compiler warnings... */ cpuid(7, a, b, c, d); - return (b & 0x00010000); + return b & 0x00010000; } return 0; } @@ -657,8 +670,7 @@ CPU_haveAVX512F(void) static int SDL_CPUCount = 0; -int -SDL_GetCPUCount(void) +int SDL_GetCPUCount(void) { if (!SDL_CPUCount) { #ifndef SDL_CPUINFO_DISABLED @@ -707,8 +719,7 @@ SDL_GetCPUType(void) } #else /* Oh, such a sweet sweet trick, just not very useful. :) */ -static const char * -SDL_GetCPUType(void) +static const char *SDL_GetCPUType(void) { static char SDL_CPUType[13]; @@ -716,23 +727,32 @@ SDL_GetCPUType(void) int i = 0; CPU_calcCPUIDFeatures(); - if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */ + if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */ int a, b, c, d; cpuid(0x00000000, a, b, c, d); - (void) a; - SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8; + (void)a; + SDL_CPUType[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUType[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUType[i++] = (char)(b & 0xff); + b >>= 8; SDL_CPUType[i++] = (char)(b & 0xff); - SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUType[i++] = (char)(d & 0xff); + d >>= 8; SDL_CPUType[i++] = (char)(d & 0xff); - SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUType[i++] = (char)(c & 0xff); + c >>= 8; SDL_CPUType[i++] = (char)(c & 0xff); } if (!SDL_CPUType[0]) { @@ -743,8 +763,7 @@ SDL_GetCPUType(void) } #endif - -#ifdef TEST_MAIN /* !!! FIXME: only used for test at the moment. */ +#ifdef TEST_MAIN /* !!! FIXME: only used for test at the moment. */ #if defined(__e2k__) inline const char * SDL_GetCPUName(void) @@ -756,8 +775,7 @@ SDL_GetCPUName(void) return SDL_CPUName; } #else -static const char * -SDL_GetCPUName(void) +static const char *SDL_GetCPUName(void) { static char SDL_CPUName[48]; @@ -766,60 +784,108 @@ SDL_GetCPUName(void) int a, b, c, d; CPU_calcCPUIDFeatures(); - if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */ + if (CPU_CPUIDMaxFunction > 0) { /* do we have CPUID at all? */ cpuid(0x80000000, a, b, c, d); if (a >= 0x80000004) { cpuid(0x80000002, a, b, c, d); - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; cpuid(0x80000003, a, b, c, d); - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; cpuid(0x80000004, a, b, c, d); - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; - SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(a & 0xff); + a >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(b & 0xff); + b >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(c & 0xff); + c >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; + SDL_CPUName[i++] = (char)(d & 0xff); + d >>= 8; } } if (!SDL_CPUName[0]) { @@ -831,34 +897,56 @@ SDL_GetCPUName(void) #endif #endif -int -SDL_GetCPUCacheLineSize(void) +int SDL_GetCPUCacheLineSize(void) { const char *cpuType = SDL_GetCPUType(); + int cacheline_size = SDL_CACHELINE_SIZE; /* initial guess */ int a, b, c, d; - (void) a; (void) b; (void) c; (void) d; - if (SDL_strcmp(cpuType, "GenuineIntel") == 0 || SDL_strcmp(cpuType, "CentaurHauls") == 0 || SDL_strcmp(cpuType, " Shanghai ") == 0) { + (void)a; + (void)b; + (void)c; + (void)d; + if (SDL_strcmp(cpuType, "GenuineIntel") == 0 || SDL_strcmp(cpuType, "CentaurHauls") == 0 || SDL_strcmp(cpuType, " Shanghai ") == 0) { cpuid(0x00000001, a, b, c, d); - return (((b >> 8) & 0xff) * 8); + cacheline_size = ((b >> 8) & 0xff) * 8; } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0 || SDL_strcmp(cpuType, "HygonGenuine") == 0) { cpuid(0x80000005, a, b, c, d); - return (c & 0xff); + cacheline_size = c & 0xff; } else { - /* Just make a guess here... */ - return SDL_CACHELINE_SIZE; +#if defined(HAVE_SYSCONF) && defined(_SC_LEVEL1_DCACHE_LINESIZE) + if ((cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE)) > 0) { + return cacheline_size; + } else { + cacheline_size = SDL_CACHELINE_SIZE; + } +#endif +#if defined(__LINUX__) + { + FILE *f = fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r"); + if (f) { + int size; + if (fscanf(f, "%d", &size) == 1) { + cacheline_size = size; + } + fclose(f); + } + } +#elif defined(__FreeBSD__) && defined(CACHE_LINE_SIZE) + cacheline_size = CACHE_LINE_SIZE; +#endif } + return cacheline_size; } static Uint32 SDL_CPUFeatures = 0xFFFFFFFF; static Uint32 SDL_SIMDAlignment = 0xFFFFFFFF; -static Uint32 -SDL_GetCPUFeatures(void) +static Uint32 SDL_GetCPUFeatures(void) { if (SDL_CPUFeatures == 0xFFFFFFFF) { CPU_calcCPUIDFeatures(); SDL_CPUFeatures = 0; - SDL_SIMDAlignment = sizeof(void *); /* a good safe base value */ + SDL_SIMDAlignment = sizeof(void *); /* a good safe base value */ if (CPU_haveRDTSC()) { SDL_CPUFeatures |= CPU_HAS_RDTSC; } @@ -933,125 +1021,112 @@ SDL_bool SDL_HasRDTSC(void) return CPU_FEATURE_AVAILABLE(CPU_HAS_RDTSC); } -SDL_bool -SDL_HasAltiVec(void) +SDL_bool SDL_HasAltiVec(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC); } -SDL_bool -SDL_HasMMX(void) +SDL_bool SDL_HasMMX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX); } -SDL_bool -SDL_Has3DNow(void) +SDL_bool SDL_Has3DNow(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_3DNOW); } -SDL_bool -SDL_HasSSE(void) +SDL_bool SDL_HasSSE(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE); } -SDL_bool -SDL_HasSSE2(void) +SDL_bool SDL_HasSSE2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2); } -SDL_bool -SDL_HasSSE3(void) +SDL_bool SDL_HasSSE3(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3); } -SDL_bool -SDL_HasSSE41(void) +SDL_bool SDL_HasSSE41(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41); } -SDL_bool -SDL_HasSSE42(void) +SDL_bool SDL_HasSSE42(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42); } -SDL_bool -SDL_HasAVX(void) +SDL_bool SDL_HasAVX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX); } -SDL_bool -SDL_HasAVX2(void) +SDL_bool SDL_HasAVX2(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2); } -SDL_bool -SDL_HasAVX512F(void) +SDL_bool SDL_HasAVX512F(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F); } -SDL_bool -SDL_HasARMSIMD(void) +SDL_bool SDL_HasARMSIMD(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD); } -SDL_bool -SDL_HasNEON(void) +SDL_bool SDL_HasNEON(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON); } -SDL_bool -SDL_HasLSX(void) +SDL_bool SDL_HasLSX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX); } -SDL_bool -SDL_HasLASX(void) +SDL_bool SDL_HasLASX(void) { return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX); } static int SDL_SystemRAM = 0; -int -SDL_GetSystemRAM(void) +int SDL_GetSystemRAM(void) { if (!SDL_SystemRAM) { #ifndef SDL_CPUINFO_DISABLED #if defined(HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) && defined(_SC_PAGESIZE) if (SDL_SystemRAM <= 0) { - SDL_SystemRAM = (int)((Sint64)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / (1024*1024)); + SDL_SystemRAM = (int)((Sint64)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / (1024 * 1024)); } #endif #ifdef HAVE_SYSCTLBYNAME if (SDL_SystemRAM <= 0) { -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__DragonFly__) -#ifdef HW_REALMEM - int mib[2] = {CTL_HW, HW_REALMEM}; -#else - /* might only report up to 2 GiB */ - int mib[2] = {CTL_HW, HW_PHYSMEM}; -#endif /* HW_REALMEM */ +#ifdef HW_PHYSMEM64 + /* (64-bit): NetBSD since 2003, OpenBSD */ + int mib[2] = { CTL_HW, HW_PHYSMEM64 }; +#elif defined(HW_REALMEM) + /* (64-bit): FreeBSD since 2005, DragonFly */ + int mib[2] = { CTL_HW, HW_REALMEM }; +#elif defined(HW_MEMSIZE) + /* (64-bit): Darwin */ + int mib[2] = { CTL_HW, HW_MEMSIZE }; #else - int mib[2] = {CTL_HW, HW_MEMSIZE}; -#endif /* __FreeBSD__ || __FreeBSD_kernel__ */ + /* (32-bit): very old BSD, might only report up to 2 GiB */ + int mib[2] = { CTL_HW, HW_PHYSMEM }; +#endif /* HW_PHYSMEM64 */ Uint64 memsize = 0; size_t len = sizeof(memsize); - + if (sysctl(mib, 2, &memsize, &len, NULL, 0) == 0) { - SDL_SystemRAM = (int)(memsize / (1024*1024)); + SDL_SystemRAM = (int)(memsize / (1024 * 1024)); } } #endif @@ -1098,19 +1173,16 @@ SDL_GetSystemRAM(void) return SDL_SystemRAM; } - -size_t -SDL_SIMDGetAlignment(void) +size_t SDL_SIMDGetAlignment(void) { if (SDL_SIMDAlignment == 0xFFFFFFFF) { - SDL_GetCPUFeatures(); /* make sure this has been calculated */ + SDL_GetCPUFeatures(); /* make sure this has been calculated */ } SDL_assert(SDL_SIMDAlignment != 0); return SDL_SIMDAlignment; } -void * -SDL_SIMDAlloc(const size_t len) +void *SDL_SIMDAlloc(const size_t len) { const size_t alignment = SDL_SIMDGetAlignment(); const size_t padding = (alignment - (len % alignment)) % alignment; @@ -1118,61 +1190,60 @@ SDL_SIMDAlloc(const size_t len) Uint8 *ptr; size_t to_allocate; - /* alignment + padding + sizeof (void *) is bounded (a few hundred + /* alignment + padding + sizeof(void *) is bounded (a few hundred * bytes max), so no need to check for overflow within that argument */ - if (SDL_size_add_overflow(len, alignment + padding + sizeof (void *), &to_allocate)) { + if (SDL_size_add_overflow(len, alignment + padding + sizeof(void *), &to_allocate)) { return NULL; } - ptr = (Uint8 *) SDL_malloc(to_allocate); + ptr = (Uint8 *)SDL_malloc(to_allocate); if (ptr) { /* store the actual allocated pointer right before our aligned pointer. */ - retval = ptr + sizeof (void *); - retval += alignment - (((size_t) retval) % alignment); - *(((void **) retval) - 1) = ptr; + retval = ptr + sizeof(void *); + retval += alignment - (((size_t)retval) % alignment); + *(((void **)retval) - 1) = ptr; } return retval; } -void * -SDL_SIMDRealloc(void *mem, const size_t len) +void *SDL_SIMDRealloc(void *mem, const size_t len) { const size_t alignment = SDL_SIMDGetAlignment(); const size_t padding = (alignment - (len % alignment)) % alignment; - Uint8 *retval = (Uint8*) mem; + Uint8 *retval = (Uint8 *)mem; void *oldmem = mem; size_t memdiff = 0, ptrdiff; Uint8 *ptr; size_t to_allocate; - /* alignment + padding + sizeof (void *) is bounded (a few hundred + /* alignment + padding + sizeof(void *) is bounded (a few hundred * bytes max), so no need to check for overflow within that argument */ - if (SDL_size_add_overflow(len, alignment + padding + sizeof (void *), &to_allocate)) { + if (SDL_size_add_overflow(len, alignment + padding + sizeof(void *), &to_allocate)) { return NULL; } if (mem) { - mem = *(((void **) mem) - 1); + mem = *(((void **)mem) - 1); /* Check the delta between the real pointer and user pointer */ - memdiff = ((size_t) oldmem) - ((size_t) mem); + memdiff = ((size_t)oldmem) - ((size_t)mem); } - ptr = (Uint8 *) SDL_realloc(mem, to_allocate); + ptr = (Uint8 *)SDL_realloc(mem, to_allocate); - if (ptr == NULL) { + if (!ptr) { return NULL; /* Out of memory, bail! */ } /* Store the actual allocated pointer right before our aligned pointer. */ - retval = ptr + sizeof (void *); - retval += alignment - (((size_t) retval) % alignment); + retval = ptr + sizeof(void *); + retval += alignment - (((size_t)retval) % alignment); /* Make sure the delta is the same! */ if (mem) { - ptrdiff = ((size_t) retval) - ((size_t) ptr); + ptrdiff = ((size_t)retval) - ((size_t)ptr); if (memdiff != ptrdiff) { /* Delta has changed, copy to new offset! */ - oldmem = (void*) (((uintptr_t) ptr) + memdiff); + oldmem = (void *)(((uintptr_t)ptr) + memdiff); /* Even though the data past the old `len` is undefined, this is the * only length value we have, and it guarantees that we copy all the @@ -1183,25 +1254,22 @@ SDL_SIMDRealloc(void *mem, const size_t len) } /* Actually store the allocated pointer, finally. */ - *(((void **) retval) - 1) = ptr; + *(((void **)retval) - 1) = ptr; return retval; } -void -SDL_SIMDFree(void *ptr) +void SDL_SIMDFree(void *ptr) { if (ptr) { - SDL_free(*(((void **) ptr) - 1)); + SDL_free(*(((void **)ptr) - 1)); } } - #ifdef TEST_MAIN #include -int -main() +int main(void) { printf("CPU count: %d\n", SDL_GetCPUCount()); printf("CPU type: %s\n", SDL_GetCPUType()); diff --git a/src/dynapi/SDL2.exports b/src/dynapi/SDL2.exports index 5085bffd94515..0461d1daf0e1b 100644 --- a/src/dynapi/SDL2.exports +++ b/src/dynapi/SDL2.exports @@ -867,3 +867,9 @@ ++'_SDL_SensorGetDataWithTimestamp'.'SDL2.dll'.'SDL_SensorGetDataWithTimestamp' ++'_SDL_ResetHints'.'SDL2.dll'.'SDL_ResetHints' ++'_SDL_strcasestr'.'SDL2.dll'.'SDL_strcasestr' +# ++'_SDL_GDKSuspendComplete'.'SDL2.dll'.'SDL_GDKSuspendComplete' +++'_SDL_HasWindowSurface'.'SDL2.dll'.'SDL_HasWindowSurface' +++'_SDL_DestroyWindowSurface'.'SDL2.dll'.'SDL_DestroyWindowSurface' +# ++'_SDL_GDKGetDefaultUser'.'SDL2.dll'.'SDL_GDKGetDefaultUser' +++'_SDL_GameControllerGetSteamHandle'.'SDL2.dll'.'SDL_GameControllerGetSteamHandle' +# ++'_SDL_WinRTGetProtocolActivationURI'.'SDL2.dll'.'SDL_WinRTGetProtocolActivationURI' diff --git a/src/dynapi/SDL_dynapi.c b/src/dynapi/SDL_dynapi.c index 9a7e4c994329b..04adfd2ce77f4 100644 --- a/src/dynapi/SDL_dynapi.c +++ b/src/dynapi/SDL_dynapi.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,8 @@ #if SDL_DYNAMIC_API +#define SDL_DYNAMIC_API_ENVVAR "SDL_DYNAMIC_API" + #if defined(__OS2__) #define INCL_DOS #define INCL_DOSERRORS @@ -40,20 +42,23 @@ /* This is the version of the dynamic API. This doesn't match the SDL version and should not change until there's been a major revamp in API/ABI. So 2.0.5 adds functions over 2.0.4? This number doesn't change; - the sizeof (jump_table) changes instead. But 2.1.0 changes how a function + the sizeof(jump_table) changes instead. But 2.1.0 changes how a function works in an incompatible way or removes a function? This number changes, - since sizeof (jump_table) isn't sufficient anymore. It's likely + since sizeof(jump_table) isn't sufficient anymore. It's likely we'll forget to bump every time we add a function, so this is the failsafe switch for major API change decisions. Respect it and use it sparingly. */ #define SDL_DYNAPI_VERSION 1 +#ifdef __cplusplus +extern "C" { +#endif + static void SDL_InitDynamicAPI(void); /* BE CAREFUL CALLING ANY SDL CODE IN HERE, IT WILL BLOW UP. Even self-contained stuff might call SDL_Error and break everything. */ - /* behold, the macro salsa! */ /* !!! FIXME: ...disabled...until we write it. :) */ @@ -61,112 +66,136 @@ static void SDL_InitDynamicAPI(void); #if DISABLE_JUMP_MAGIC /* Can't use the macro for varargs nonsense. This is atrocious. */ -#define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio) \ - _static void SDLCALL SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - va_list ap; initcall; va_start(ap, fmt); \ - jump_table.SDL_LogMessageV(category, SDL_LOG_PRIORITY_##prio, fmt, ap); \ - va_end(ap); \ +#define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio) \ + _static void SDLCALL SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + jump_table.SDL_LogMessageV(category, SDL_LOG_PRIORITY_##prio, fmt, ap); \ + va_end(ap); \ } -#define SDL_DYNAPI_VARARGS(_static, name, initcall) \ - _static int SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - char buf[128], *str = buf; \ - int result; \ - va_list ap; initcall; \ - va_start(ap, fmt); \ - result = jump_table.SDL_vsnprintf(buf, sizeof(buf), fmt, ap); \ - va_end(ap); \ - if (result >= 0 && (size_t)result >= sizeof(buf)) { \ - size_t len = (size_t)result + 1; \ - str = (char *)jump_table.SDL_malloc(len); \ - if (str) { \ - va_start(ap, fmt); \ - result = jump_table.SDL_vsnprintf(str, len, fmt, ap); \ - va_end(ap); \ - } \ - } \ - if (result >= 0) { \ - result = jump_table.SDL_SetError("%s", str); \ - } \ - if (str != buf) { \ - jump_table.SDL_free(str); \ - } \ - return result; \ - } \ - _static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { \ - int retval; va_list ap; initcall; va_start(ap, fmt); \ - retval = jump_table.SDL_vsscanf(buf, fmt, ap); \ - va_end(ap); \ - return retval; \ - } \ - _static int SDLCALL SDL_snprintf##name(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - int retval; va_list ap; initcall; va_start(ap, fmt); \ - retval = jump_table.SDL_vsnprintf(buf, maxlen, fmt, ap); \ - va_end(ap); \ - return retval; \ - } \ - _static int SDLCALL SDL_asprintf##name(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - int retval; va_list ap; initcall; va_start(ap, fmt); \ - retval = jump_table.SDL_vasprintf(strp, fmt, ap); \ - va_end(ap); \ - return retval; \ - } \ - _static void SDLCALL SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - va_list ap; initcall; va_start(ap, fmt); \ - jump_table.SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \ - va_end(ap); \ - } \ - _static void SDLCALL SDL_LogMessage##name(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \ - va_list ap; initcall; va_start(ap, fmt); \ - jump_table.SDL_LogMessageV(category, priority, fmt, ap); \ - va_end(ap); \ - } \ - SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Verbose, VERBOSE) \ - SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Debug, DEBUG) \ - SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Info, INFO) \ - SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Warn, WARN) \ - SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Error, ERROR) \ +#define SDL_DYNAPI_VARARGS(_static, name, initcall) \ + _static int SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + char buf[128], *str = buf; \ + int result; \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + result = jump_table.SDL_vsnprintf(buf, sizeof(buf), fmt, ap); \ + va_end(ap); \ + if (result >= 0 && (size_t)result >= sizeof(buf)) { \ + size_t len = (size_t)result + 1; \ + str = (char *)jump_table.SDL_malloc(len); \ + if (str) { \ + va_start(ap, fmt); \ + result = jump_table.SDL_vsnprintf(str, len, fmt, ap); \ + va_end(ap); \ + } \ + } \ + if (result >= 0) { \ + result = jump_table.SDL_SetError("%s", str); \ + } \ + if (str != buf) { \ + jump_table.SDL_free(str); \ + } \ + return result; \ + } \ + _static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) \ + { \ + int retval; \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + retval = jump_table.SDL_vsscanf(buf, fmt, ap); \ + va_end(ap); \ + return retval; \ + } \ + _static int SDLCALL SDL_snprintf##name(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + int retval; \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + retval = jump_table.SDL_vsnprintf(buf, maxlen, fmt, ap); \ + va_end(ap); \ + return retval; \ + } \ + _static int SDLCALL SDL_asprintf##name(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + int retval; \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + retval = jump_table.SDL_vasprintf(strp, fmt, ap); \ + va_end(ap); \ + return retval; \ + } \ + _static void SDLCALL SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + jump_table.SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \ + va_end(ap); \ + } \ + _static void SDLCALL SDL_LogMessage##name(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \ + { \ + va_list ap; \ + initcall; \ + va_start(ap, fmt); \ + jump_table.SDL_LogMessageV(category, priority, fmt, ap); \ + va_end(ap); \ + } \ + SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Verbose, VERBOSE) \ + SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Debug, DEBUG) \ + SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Info, INFO) \ + SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Warn, WARN) \ + SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Error, ERROR) \ SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, Critical, CRITICAL) #endif - /* Typedefs for function pointers for jump table, and predeclare funcs */ /* The DEFAULT funcs will init jump table and then call real function. */ /* The REAL funcs are the actual functions, name-mangled to not clash. */ -#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \ - typedef rc (SDLCALL *SDL_DYNAPIFN_##fn) params; \ - static rc SDLCALL fn##_DEFAULT params; \ +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \ + typedef rc (SDLCALL *SDL_DYNAPIFN_##fn) params;\ + static rc SDLCALL fn##_DEFAULT params; \ extern rc SDLCALL fn##_REAL params; #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC /* The jump table! */ -typedef struct { - #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) SDL_DYNAPIFN_##fn fn; - #include "SDL_dynapi_procs.h" - #undef SDL_DYNAPI_PROC +typedef struct +{ +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) SDL_DYNAPIFN_##fn fn; +#include "SDL_dynapi_procs.h" +#undef SDL_DYNAPI_PROC } SDL_DYNAPI_jump_table; /* Predeclare the default functions for initializing the jump table. */ -#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) static rc SDLCALL fn##_DEFAULT params; +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) static rc SDLCALL fn##_DEFAULT params; #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC /* The actual jump table. */ static SDL_DYNAPI_jump_table jump_table = { - #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) fn##_DEFAULT, - #include "SDL_dynapi_procs.h" - #undef SDL_DYNAPI_PROC +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) fn##_DEFAULT, +#include "SDL_dynapi_procs.h" +#undef SDL_DYNAPI_PROC }; /* Default functions init the function table then call right thing. */ #if DISABLE_JUMP_MAGIC -#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \ - static rc SDLCALL fn##_DEFAULT params { \ - SDL_InitDynamicAPI(); \ - ret jump_table.fn args; \ +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \ + static rc SDLCALL fn##_DEFAULT params \ + { \ + SDL_InitDynamicAPI(); \ + ret jump_table.fn args; \ } -#define SDL_DYNAPI_PROC_NO_VARARGS 1 +#define SDL_DYNAPI_PROC_NO_VARARGS #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC #undef SDL_DYNAPI_PROC_NO_VARARGS @@ -178,13 +207,16 @@ SDL_DYNAPI_VARARGS(static, _DEFAULT, SDL_InitDynamicAPI()) /* Public API functions to jump into the jump table. */ #if DISABLE_JUMP_MAGIC -#define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \ - rc SDLCALL fn params { ret jump_table.fn args; } -#define SDL_DYNAPI_PROC_NO_VARARGS 1 +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) \ + rc SDLCALL fn params \ + { \ + ret jump_table.fn args; \ + } +#define SDL_DYNAPI_PROC_NO_VARARGS #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC #undef SDL_DYNAPI_PROC_NO_VARARGS -SDL_DYNAPI_VARARGS(,,) +SDL_DYNAPI_VARARGS(, , ) #else /* !!! FIXME: need the jump magic. */ #error Write me. @@ -192,16 +224,18 @@ SDL_DYNAPI_VARARGS(,,) #define ENABLE_SDL_CALL_LOGGING 0 #if ENABLE_SDL_CALL_LOGGING -static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { - char buf[512]; /* !!! FIXME: dynamic allocation */ \ +static int SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +{ + char buf[512]; /* !!! FIXME: dynamic allocation */ va_list ap; SDL_Log_REAL("SDL2CALL SDL_SetError"); va_start(ap, fmt); - SDL_vsnprintf_REAL(buf, sizeof (buf), fmt, ap); + SDL_vsnprintf_REAL(buf, sizeof(buf), fmt, ap); va_end(ap); return SDL_SetError_REAL("%s", buf); } -static int SDLCALL SDL_sscanf_LOGSDLCALLS(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { +static int SDLCALL SDL_sscanf_LOGSDLCALLS(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) +{ int retval; va_list ap; SDL_Log_REAL("SDL2CALL SDL_sscanf"); @@ -210,7 +244,8 @@ static int SDLCALL SDL_sscanf_LOGSDLCALLS(const char *buf, SDL_SCANF_FORMAT_STRI va_end(ap); return retval; } -static int SDLCALL SDL_snprintf_LOGSDLCALLS(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { +static int SDLCALL SDL_snprintf_LOGSDLCALLS(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +{ int retval; va_list ap; SDL_Log_REAL("SDL2CALL SDL_snprintf"); @@ -219,7 +254,8 @@ static int SDLCALL SDL_snprintf_LOGSDLCALLS(SDL_OUT_Z_CAP(maxlen) char *buf, siz va_end(ap); return retval; } -static int SDLCALL SDL_asprintf_LOGSDLCALLS(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { +static int SDLCALL SDL_asprintf_LOGSDLCALLS(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +{ int retval; va_list ap; SDL_Log_REAL("SDL2CALL SDL_asprintf"); @@ -228,14 +264,16 @@ static int SDLCALL SDL_asprintf_LOGSDLCALLS(char **strp, SDL_PRINTF_FORMAT_STRIN va_end(ap); return retval; } -static void SDLCALL SDL_Log_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { +static void SDLCALL SDL_Log_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +{ va_list ap; SDL_Log_REAL("SDL2CALL SDL_Log"); va_start(ap, fmt); - SDL_LogMessageV_REAL(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \ + SDL_LogMessageV_REAL(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); va_end(ap); } -static void SDLCALL SDL_LogMessage_LOGSDLCALLS(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { +static void SDLCALL SDL_LogMessage_LOGSDLCALLS(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +{ va_list ap; SDL_Log_REAL("SDL2CALL SDL_LogMessage"); va_start(ap, fmt); @@ -257,7 +295,7 @@ SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Error, ERROR) SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Critical, CRITICAL) #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) \ rc SDLCALL fn##_LOGSDLCALLS params { SDL_Log_REAL("SDL2CALL %s", #fn); ret fn##_REAL args; } -#define SDL_DYNAPI_PROC_NO_VARARGS 1 +#define SDL_DYNAPI_PROC_NO_VARARGS #include "SDL_dynapi_procs.h" #undef SDL_DYNAPI_PROC #undef SDL_DYNAPI_PROC_NO_VARARGS @@ -265,38 +303,37 @@ SDL_DYNAPI_VARARGS_LOGFN_LOGSDLCALLS(Critical, CRITICAL) /* we make this a static function so we can call the correct one without the system's dynamic linker resolving to the wrong version of this. */ -static Sint32 -initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize) +static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize) { - SDL_DYNAPI_jump_table *output_jump_table = (SDL_DYNAPI_jump_table *) table; + SDL_DYNAPI_jump_table *output_jump_table = (SDL_DYNAPI_jump_table *)table; if (apiver != SDL_DYNAPI_VERSION) { /* !!! FIXME: can maybe handle older versions? */ - return -1; /* not compatible. */ - } else if (tablesize > sizeof (jump_table)) { - return -1; /* newer version of SDL with functions we can't provide. */ + return -1; /* not compatible. */ + } else if (tablesize > sizeof(jump_table)) { + return -1; /* newer version of SDL with functions we can't provide. */ } - /* Init our jump table first. */ - #if ENABLE_SDL_CALL_LOGGING +/* Init our jump table first. */ +#if ENABLE_SDL_CALL_LOGGING { const char *env = SDL_getenv_REAL("SDL_DYNAPI_LOG_CALLS"); const SDL_bool log_calls = (env && SDL_atoi_REAL(env)); if (log_calls) { - #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) jump_table.fn = fn##_LOGSDLCALLS; - #include "SDL_dynapi_procs.h" - #undef SDL_DYNAPI_PROC +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_LOGSDLCALLS; +#include "SDL_dynapi_procs.h" +#undef SDL_DYNAPI_PROC } else { - #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) jump_table.fn = fn##_REAL; - #include "SDL_dynapi_procs.h" - #undef SDL_DYNAPI_PROC +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_REAL; +#include "SDL_dynapi_procs.h" +#undef SDL_DYNAPI_PROC } } - #else - #define SDL_DYNAPI_PROC(rc,fn,params,args,ret) jump_table.fn = fn##_REAL; - #include "SDL_dynapi_procs.h" - #undef SDL_DYNAPI_PROC - #endif +#else +#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_REAL; +#include "SDL_dynapi_procs.h" +#undef SDL_DYNAPI_PROC +#endif /* Then the external table... */ if (output_jump_table != &jump_table) { @@ -305,21 +342,22 @@ initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize) /* Safe to call SDL functions now; jump table is initialized! */ - return 0; /* success! */ + return 0; /* success! */ } - /* Here's the exported entry point that fills in the jump table. */ /* Use specific types when an "int" might suffice to keep this sane. */ typedef Sint32 (SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize); extern DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32); -Sint32 -SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize) +Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize) { return initialize_jumptable(apiver, table, tablesize); } +#ifdef __cplusplus +} +#endif /* Obviously we can't use SDL_LoadObject() to load SDL. :) */ /* Also obviously, we never close the loaded library. */ @@ -330,11 +368,11 @@ SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize) #include static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { - HANDLE lib = LoadLibraryA(fname); + HMODULE lib = LoadLibraryA(fname); void *retval = NULL; if (lib) { - retval = GetProcAddress(lib, sym); - if (retval == NULL) { + retval = (void *) GetProcAddress(lib, sym); + if (!retval) { FreeLibrary(lib); } } @@ -347,9 +385,9 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) { void *lib = dlopen(fname, RTLD_NOW | RTLD_LOCAL); void *retval = NULL; - if (lib != NULL) { + if (lib) { retval = dlsym(lib, sym); - if (retval == NULL) { + if (!retval) { dlclose(lib); } } @@ -374,56 +412,86 @@ static SDL_INLINE void *get_sdlapi_entry(const char *fname, const char *sym) #error Please define your platform. #endif - static void dynapi_warn(const char *msg) { const char *caption = "SDL Dynamic API Failure!"; - /* SDL_ShowSimpleMessageBox() is a too heavy for here. */ - #if (defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +/* SDL_ShowSimpleMessageBox() is a too heavy for here. */ +#if (defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) MessageBoxA(NULL, msg, caption, MB_OK | MB_ICONERROR); - #elif defined(HAVE_STDIO_H) +#elif defined(HAVE_STDIO_H) fprintf(stderr, "\n\n%s\n%s\n\n", caption, msg); fflush(stderr); - #endif +#endif } /* This is not declared in any header, although it is shared between some parts of SDL, because we don't want anything calling it without an extremely good reason. */ +#ifdef __cplusplus +extern "C" { +#endif +extern SDL_NORETURN void SDL_ExitProcess(int exitcode); #if defined(__WATCOMC__) -void SDL_ExitProcess(int exitcode); #pragma aux SDL_ExitProcess aborts; #endif -SDL_NORETURN void SDL_ExitProcess(int exitcode); - +#ifdef __cplusplus +} +#endif -static void -SDL_InitDynamicAPILocked(void) +static void SDL_InitDynamicAPILocked(void) { - const char *libname = SDL_getenv_REAL("SDL_DYNAMIC_API"); - SDL_DYNAPI_ENTRYFN entry = NULL; /* funcs from here by default. */ + SDL_DYNAPI_ENTRYFN entry = NULL; /* funcs from here by default. */ SDL_bool use_internal = SDL_TRUE; + /* this can't use SDL_getenv_REAL, because it might allocate memory before the app can set their allocator */ +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) + /* We've always used LoadLibraryA for this, so this has never worked with Unicode paths on Windows. Sorry. */ + char envbuf[512]; /* overflows will just report as environment variable being unset, but LoadLibraryA has a MAX_PATH of 260 anyhow, apparently. */ + const DWORD rc = GetEnvironmentVariableA(SDL_DYNAMIC_API_ENVVAR, envbuf, (DWORD) sizeof (envbuf)); + char *libname = ((rc != 0) && (rc < sizeof (envbuf))) ? envbuf : NULL; +#elif defined(__OS2__) + char * libname; + if (DosScanEnv(SDL_DYNAMIC_API_ENVVAR, &libname) != NO_ERROR) { + libname = NULL; + } +#else + char *libname = getenv(SDL_DYNAMIC_API_ENVVAR); +#endif + if (libname) { - entry = (SDL_DYNAPI_ENTRYFN) get_sdlapi_entry(libname, "SDL_DYNAPI_entry"); + while (*libname && !entry) { + char *ptr = libname; + while (SDL_TRUE) { + const char ch = *ptr; + if ((ch == ',') || (ch == '\0')) { + *ptr = '\0'; + entry = (SDL_DYNAPI_ENTRYFN)get_sdlapi_entry(libname, "SDL_DYNAPI_entry"); + *ptr = ch; + libname = (ch == '\0') ? ptr : (ptr + 1); + break; + } else { + ptr++; + } + } + } if (!entry) { - dynapi_warn("Couldn't load overriding SDL library. Please fix or remove the SDL_DYNAMIC_API environment variable. Using the default SDL."); + dynapi_warn("Couldn't load an overriding SDL library. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL."); /* Just fill in the function pointers from this library, later. */ } } if (entry) { - if (entry(SDL_DYNAPI_VERSION, &jump_table, sizeof (jump_table)) < 0) { - dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the SDL_DYNAMIC_API environment variable. Using the default SDL."); + if (entry(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) { + dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL."); /* Just fill in the function pointers from this library, later. */ } else { - use_internal = SDL_FALSE; /* We overrode SDL! Don't use the internal version! */ + use_internal = SDL_FALSE; /* We overrode SDL! Don't use the internal version! */ } } /* Just fill in the function pointers from this library. */ if (use_internal) { - if (initialize_jumptable(SDL_DYNAPI_VERSION, &jump_table, sizeof (jump_table)) < 0) { + if (initialize_jumptable(SDL_DYNAPI_VERSION, &jump_table, sizeof(jump_table)) < 0) { /* Now we're screwed. Should definitely abort now. */ dynapi_warn("Failed to initialize internal SDL dynapi. As this would otherwise crash, we have to abort now."); SDL_ExitProcess(86); @@ -433,8 +501,7 @@ SDL_InitDynamicAPILocked(void) /* we intentionally never close the newly-loaded lib, of course. */ } -static void -SDL_InitDynamicAPI(void) +static void SDL_InitDynamicAPI(void) { /* So the theory is that every function in the jump table defaults to * calling this function, and then replaces itself with a version that @@ -452,7 +519,7 @@ SDL_InitDynamicAPI(void) /* SDL_AtomicLock calls SDL mutex functions to emulate if SDL_ATOMIC_DISABLED, which we can't do here, so in such a configuration, you're on your own. */ - #if !SDL_ATOMIC_DISABLED + #ifndef SDL_ATOMIC_DISABLED static SDL_SpinLock lock = 0; SDL_AtomicLock_REAL(&lock); #endif @@ -462,11 +529,11 @@ SDL_InitDynamicAPI(void) already_initialized = SDL_TRUE; } - #if !SDL_ATOMIC_DISABLED + #ifndef SDL_ATOMIC_DISABLED SDL_AtomicUnlock_REAL(&lock); #endif } -#endif /* SDL_DYNAMIC_API */ +#endif /* SDL_DYNAMIC_API */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/dynapi/SDL_dynapi.h b/src/dynapi/SDL_dynapi.h index d719462137500..b5c9cbbe3388d 100644 --- a/src/dynapi/SDL_dynapi.h +++ b/src/dynapi/SDL_dynapi.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,7 +35,7 @@ updated SDL can transparently take advantage of them, but your program will not without this feature. Think hard before turning it off. */ -#ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */ +#ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */ #error Nope, you have to edit this file to force this off. #endif @@ -43,7 +43,7 @@ #include "TargetConditionals.h" #endif -#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* probably not useful on iOS. */ +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE /* probably not useful on iOS. */ #define SDL_DYNAMIC_API 0 #elif defined(__ANDROID__) /* probably not useful on Android. */ #define SDL_DYNAMIC_API 0 @@ -51,24 +51,24 @@ #define SDL_DYNAMIC_API 0 #elif defined(__EMSCRIPTEN__) && __EMSCRIPTEN__ /* probably not useful on Emscripten. */ #define SDL_DYNAMIC_API 0 -#elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT /* probably not useful on WinRT, given current .dll loading restrictions */ +#elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT /* probably not useful on WinRT, given current .dll loading restrictions */ #define SDL_DYNAMIC_API 0 -#elif defined(__PS2__) && __PS2__ +#elif defined(__PS2__) #define SDL_DYNAMIC_API 0 #elif defined(__PSP__) && __PSP__ #define SDL_DYNAMIC_API 0 #elif defined(__riscos__) && __riscos__ /* probably not useful on RISC OS, since dlopen() can't be used when using static linking. */ #define SDL_DYNAMIC_API 0 -#elif defined(__clang_analyzer__) -#define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */ +#elif defined(__clang_analyzer__) || defined(SDL_THREAD_SAFETY_ANALYSIS) +#define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */ #elif defined(__VITA__) -#define SDL_DYNAMIC_API 0 /* vitasdk doesn't support dynamic linking */ +#define SDL_DYNAMIC_API 0 /* vitasdk doesn't support dynamic linking */ #elif defined(__NGAGE__) -#define SDL_DYNAMIC_API 0 /* The N-Gage doesn't support dynamic linking either */ +#define SDL_DYNAMIC_API 0 /* The N-Gage doesn't support dynamic linking either */ #elif defined(__3DS__) -#define SDL_DYNAMIC_API 0 /* devkitARM doesn't support dynamic linking */ +#define SDL_DYNAMIC_API 0 /* devkitARM doesn't support dynamic linking */ #elif defined(DYNAPI_NEEDS_DLOPEN) && !defined(HAVE_DLOPEN) -#define SDL_DYNAMIC_API 0 /* we need dlopen(), but don't have it.... */ +#define SDL_DYNAMIC_API 0 /* we need dlopen(), but don't have it.... */ #endif /* everyone else. This is where we turn on the API if nothing forced it off. */ diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 586465276208d..e8e0f58b6bd8c 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -893,3 +893,9 @@ #define SDL_SensorGetDataWithTimestamp SDL_SensorGetDataWithTimestamp_REAL #define SDL_ResetHints SDL_ResetHints_REAL #define SDL_strcasestr SDL_strcasestr_REAL +#define SDL_GDKSuspendComplete SDL_GDKSuspendComplete_REAL +#define SDL_HasWindowSurface SDL_HasWindowSurface_REAL +#define SDL_DestroyWindowSurface SDL_DestroyWindowSurface_REAL +#define SDL_GDKGetDefaultUser SDL_GDKGetDefaultUser_REAL +#define SDL_GameControllerGetSteamHandle SDL_GameControllerGetSteamHandle_REAL +#define SDL_WinRTGetProtocolActivationURI SDL_WinRTGetProtocolActivationURI_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 7b3e02da11d98..2f6b729051ffd 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,7 @@ */ /* direct jump magic can use these, the rest needs special code. */ -#if !SDL_DYNAPI_PROC_NO_VARARGS +#ifndef SDL_DYNAPI_PROC_NO_VARARGS SDL_DYNAPI_PROC(int,SDL_SetError,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),return) SDL_DYNAPI_PROC(void,SDL_Log,(SDL_PRINTF_FORMAT_STRING const char *a, ...),(a),) SDL_DYNAPI_PROC(void,SDL_LogVerbose,(int a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),) @@ -73,7 +73,7 @@ SDL_DYNAPI_PROC(IDirect3DDevice9*,SDL_RenderGetD3D9Device,(SDL_Renderer *a),(a), #endif #ifdef __IPHONEOS__ -SDL_DYNAPI_PROC(int,SDL_iPhoneSetAnimationCallback,(SDL_Window *a, int b, void (SDLCALL *c)(void *), void *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_iPhoneSetAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_iPhoneSetEventPump,(SDL_bool a),(a),) #endif @@ -90,9 +90,9 @@ SDL_DYNAPI_PROC(int,SDL_InitSubSystem,(Uint32 a),(a),return) SDL_DYNAPI_PROC(void,SDL_QuitSubSystem,(Uint32 a),(a),) SDL_DYNAPI_PROC(Uint32,SDL_WasInit,(Uint32 a),(a),return) SDL_DYNAPI_PROC(void,SDL_Quit,(void),(),) -SDL_DYNAPI_PROC(SDL_assert_state,SDL_ReportAssertion,(SDL_assert_data *a, const char *b, const char *c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(SDL_AssertState,SDL_ReportAssertion,(SDL_AssertData *a, const char *b, const char *c, int d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),) -SDL_DYNAPI_PROC(const SDL_assert_data*,SDL_GetAssertionReport,(void),(),return) +SDL_DYNAPI_PROC(const SDL_AssertData*,SDL_GetAssertionReport,(void),(),return) SDL_DYNAPI_PROC(void,SDL_ResetAssertionReport,(void),(),) SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicTryLock,(SDL_SpinLock *a),(a),return) SDL_DYNAPI_PROC(void,SDL_AtomicLock,(SDL_SpinLock *a),(a),) @@ -411,7 +411,7 @@ SDL_DYNAPI_PROC(void*,SDL_realloc,(void *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_free,(void *a),(a),) SDL_DYNAPI_PROC(char*,SDL_getenv,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_setenv,(const char *a, const char *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(void,SDL_qsort,(void *a, size_t b, size_t c, int (SDLCALL *d)(const void *, const void *)),(a,b,c,d),) +SDL_DYNAPI_PROC(void,SDL_qsort,(void *a, size_t b, size_t c, SDL_CompareCallback d),(a,b,c,d),) SDL_DYNAPI_PROC(int,SDL_abs,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_isdigit,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_isspace,(int a),(a),return) @@ -511,7 +511,7 @@ SDL_DYNAPI_PROC(void,SDL_WaitThread,(SDL_Thread *a, int *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),) SDL_DYNAPI_PROC(SDL_TLSID,SDL_TLSCreate,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_TLSGet,(SDL_TLSID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_TLSSet,(SDL_TLSID a, const void *b, void (SDLCALL *c)(void*)),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_TLSSet,(SDL_TLSID a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) SDL_DYNAPI_PROC(Uint32,SDL_GetTicks,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceCounter,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceFrequency,(void),(),return) @@ -607,7 +607,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_DXGIGetOutputInfo,(int a,int *b, int *c),(a,b,c),re #endif SDL_DYNAPI_PROC(SDL_bool,SDL_RenderIsClipEnabled,(SDL_Renderer *a),(a),return) #ifdef __WINRT__ -SDL_DYNAPI_PROC(int,SDL_WinRTRunApp,(int a, char **b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_WinRTRunApp,(SDL_main_func a, void *b),(a,b),return) SDL_DYNAPI_PROC(const wchar_t*,SDL_WinRTGetFSPathUNICODE,(SDL_WinRT_Path a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_WinRTGetFSPathUTF8,(SDL_WinRT_Path a),(a),return) #endif @@ -771,7 +771,7 @@ SDL_DYNAPI_PROC(int,SDL_RenderCopyF,(SDL_Renderer *a, SDL_Texture *b, const SDL_ SDL_DYNAPI_PROC(int,SDL_RenderCopyExF,(SDL_Renderer *a, SDL_Texture *b, const SDL_Rect *c, const SDL_FRect *d, const double e, const SDL_FPoint *f, const SDL_RendererFlip g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_TouchDeviceType,SDL_GetTouchDeviceType,(SDL_TouchID a),(a),return) #ifdef __IPHONEOS__ -SDL_DYNAPI_PROC(int,SDL_UIKitRunApp,(int a, char *b, SDL_main_func c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_UIKitRunApp,(int a, char *b[], SDL_main_func c),(a,b,c),return) #endif SDL_DYNAPI_PROC(size_t,SDL_SIMDGetAlignment,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_SIMDAlloc,(const size_t a),(a),return) @@ -888,7 +888,7 @@ SDL_DYNAPI_PROC(void*,SDL_GetTextureUserData,(SDL_Texture *a),(a),return) SDL_DYNAPI_PROC(int,SDL_RenderGeometry,(SDL_Renderer *a, SDL_Texture *b, const SDL_Vertex *c, int d, const int *e, int f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_RenderGeometryRaw,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_Color *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) SDL_DYNAPI_PROC(int,SDL_RenderSetVSync,(SDL_Renderer *a, int b),(a,b),return) -#if !SDL_DYNAPI_PROC_NO_VARARGS +#ifndef SDL_DYNAPI_PROC_NO_VARARGS SDL_DYNAPI_PROC(int,SDL_asprintf,(char **a, SDL_PRINTF_FORMAT_STRING const char *b, ...),(a,b),return) #endif SDL_DYNAPI_PROC(int,SDL_vasprintf,(char **a, const char *b, va_list c),(a,b,c),return) @@ -939,7 +939,7 @@ SDL_DYNAPI_PROC(void,SDL_UnionFRect,(const SDL_FRect *a, const SDL_FRect *b, SDL SDL_DYNAPI_PROC(SDL_bool,SDL_EncloseFPoints,(const SDL_FPoint *a, int b, const SDL_FRect *c, SDL_FRect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IntersectFRectAndLine,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_RenderGetWindow,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(void*,SDL_bsearch,(const void *a, const void *b, size_t c, size_t d, int (SDLCALL *e)(const void *, const void *)),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(void*,SDL_bsearch,(const void *a, const void *b, size_t c, size_t d, SDL_CompareCallback e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GameControllerPathForIndex,(int a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GameControllerPath,(SDL_GameController *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_JoystickPathForIndex,(int a),(a),return) @@ -976,3 +976,15 @@ SDL_DYNAPI_PROC(int,SDL_GameControllerGetSensorDataWithTimestamp,(SDL_GameContro SDL_DYNAPI_PROC(int,SDL_SensorGetDataWithTimestamp,(SDL_Sensor *a, Uint64 *b, float *c, int d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),) SDL_DYNAPI_PROC(char*,SDL_strcasestr,(const char *a, const char *b),(a,b),return) +#if defined(__GDK__) +SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) +#endif +SDL_DYNAPI_PROC(SDL_bool,SDL_HasWindowSurface,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return) +#if defined(__GDK__) +SDL_DYNAPI_PROC(int,SDL_GDKGetDefaultUser,(XUserHandle *a),(a),return) +#endif +SDL_DYNAPI_PROC(Uint64,SDL_GameControllerGetSteamHandle,(SDL_GameController *a),(a),return) +#if defined(__WINRT__) +SDL_DYNAPI_PROC(char*,SDL_WinRTGetProtocolActivationURI,(void),(),return) +#endif diff --git a/src/dynapi/gendynapi.pl b/src/dynapi/gendynapi.pl index a9ff9723be873..14c206fa01d06 100755 --- a/src/dynapi/gendynapi.pl +++ b/src/dynapi/gendynapi.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Simple DirectMedia Layer -# Copyright (C) 1997-2022 Sam Lantinga +# Copyright (C) 1997-2025 Sam Lantinga # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages @@ -50,8 +50,13 @@ open(SDL_DYNAPI_OVERRIDES_H, '>>', $sdl_dynapi_overrides_h) or die("Can't open $sdl_dynapi_overrides_h: $!\n"); open(SDL2_EXPORTS, '>>', $sdl2_exports) or die("Can't open $sdl2_exports: $!\n"); +# Ordered for reproducible builds opendir(HEADERS, 'include') or die("Can't open include dir: $!\n"); -while (my $d = readdir(HEADERS)) { +my @entries = readdir(HEADERS); +closedir(HEADERS); +# Sort the entries +@entries = sort @entries; +foreach my $d (@entries) { next if not $d =~ /\.h\Z/; my $header = "include/$d"; open(HEADER, '<', $header) or die("Can't open $header: $!\n"); @@ -142,7 +147,6 @@ } close(HEADER); } -closedir(HEADERS); close(SDL_DYNAPI_PROCS_H); close(SDL_DYNAPI_OVERRIDES_H); diff --git a/src/events/SDL_clipboardevents.c b/src/events/SDL_clipboardevents.c index a3247dd80bc8d..2789303b6c4a3 100644 --- a/src/events/SDL_clipboardevents.c +++ b/src/events/SDL_clipboardevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,9 +26,7 @@ #include "SDL_events_c.h" #include "SDL_clipboardevents_c.h" - -int -SDL_SendClipboardUpdate(void) +int SDL_SendClipboardUpdate(void) { int posted; @@ -40,7 +38,7 @@ SDL_SendClipboardUpdate(void) posted = (SDL_PushEvent(&event) > 0); } - return (posted); + return posted; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_clipboardevents_c.h b/src/events/SDL_clipboardevents_c.h index 21d5227cb563a..116ba997b68ea 100644 --- a/src/events/SDL_clipboardevents_c.h +++ b/src/events/SDL_clipboardevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/SDL_displayevents.c b/src/events/SDL_displayevents.c index c6a701ab58e13..36bf19fbda9fb 100644 --- a/src/events/SDL_displayevents.c +++ b/src/events/SDL_displayevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,9 +25,7 @@ #include "SDL_events.h" #include "SDL_events_c.h" - -int -SDL_SendDisplayEvent(SDL_VideoDisplay *display, Uint8 displayevent, int data1) +int SDL_SendDisplayEvent(SDL_VideoDisplay *display, Uint8 displayevent, int data1) { int posted; @@ -54,7 +52,7 @@ SDL_SendDisplayEvent(SDL_VideoDisplay *display, Uint8 displayevent, int data1) posted = (SDL_PushEvent(&event) > 0); } - return (posted); + return posted; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_displayevents_c.h b/src/events/SDL_displayevents_c.h index 07be5e0e0efcc..99058c285412a 100644 --- a/src/events/SDL_displayevents_c.h +++ b/src/events/SDL_displayevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/SDL_dropevents.c b/src/events/SDL_dropevents.c index daefeb09b96af..a7a9a981f7284 100644 --- a/src/events/SDL_dropevents.c +++ b/src/events/SDL_dropevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,11 +26,9 @@ #include "SDL_events_c.h" #include "SDL_dropevents_c.h" -#include "../video/SDL_sysvideo.h" /* for SDL_Window internals. */ +#include "../video/SDL_sysvideo.h" /* for SDL_Window internals. */ - -static int -SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *data) +static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *data) { static SDL_bool app_is_dropping = SDL_FALSE; int posted = 0; @@ -76,23 +74,19 @@ SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const char *data) return posted; } -int -SDL_SendDropFile(SDL_Window *window, const char *file) +int SDL_SendDropFile(SDL_Window *window, const char *file) { return SDL_SendDrop(window, SDL_DROPFILE, file); } -int -SDL_SendDropText(SDL_Window *window, const char *text) +int SDL_SendDropText(SDL_Window *window, const char *text) { return SDL_SendDrop(window, SDL_DROPTEXT, text); } -int -SDL_SendDropComplete(SDL_Window *window) +int SDL_SendDropComplete(SDL_Window *window) { return SDL_SendDrop(window, SDL_DROPCOMPLETE, NULL); } - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/SDL_dropevents_c.h b/src/events/SDL_dropevents_c.h index 4f45b78d83a92..5bdd32fd7a773 100644 --- a/src/events/SDL_dropevents_c.h +++ b/src/events/SDL_dropevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 493ae76651a70..271e2504b9491 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,26 +28,23 @@ #include "SDL_events_c.h" #include "../SDL_hints_c.h" #include "../timer/SDL_timer_c.h" -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED #include "../joystick/SDL_joystick_c.h" #endif #include "../video/SDL_sysvideo.h" #include "SDL_syswm.h" -#undef SDL_PRIs64 -#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__CYGWIN__) -#define SDL_PRIs64 "I64d" -#else -#define SDL_PRIs64 "lld" -#endif - /* An arbitrary limit so we don't have unbounded growth */ -#define SDL_MAX_QUEUED_EVENTS 65535 +#define SDL_MAX_QUEUED_EVENTS 65535 -/* Determines how often we wake to call SDL_PumpEvents() in SDL_WaitEventTimeout_Device() */ -#define PERIODIC_POLL_INTERVAL_MS 3000 +/* Determines how often we pump events if joystick or sensor subsystems are active */ +#define ENUMERATION_POLL_INTERVAL_MS 3000 -typedef struct SDL_EventWatcher { +/* Determines how often to pump events if joysticks or sensors are actively being read */ +#define EVENT_POLL_INTERVAL_MS 1 + +typedef struct SDL_EventWatcher +{ SDL_EventFilter callback; void *userdata; SDL_bool removed; @@ -61,7 +58,8 @@ static SDL_bool SDL_event_watchers_dispatching = SDL_FALSE; static SDL_bool SDL_event_watchers_removed = SDL_FALSE; static SDL_atomic_t SDL_sentinel_pending; -typedef struct { +typedef struct +{ Uint32 bits[8]; } SDL_DisabledEventBlock; @@ -96,13 +94,11 @@ static struct SDL_SysWMEntry *wmmsg_free; } SDL_EventQ = { NULL, SDL_FALSE, { 0 }, 0, NULL, NULL, NULL, NULL, NULL }; - -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED static SDL_bool SDL_update_joysticks = SDL_TRUE; -static void -SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value) +static void SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value) { if (hint_value && (!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) { @@ -112,21 +108,18 @@ SDL_CalculateShouldUpdateJoysticks(SDL_bool hint_value) } } -static void SDLCALL -SDL_AutoUpdateJoysticksChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_AutoUpdateJoysticksChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_CalculateShouldUpdateJoysticks(SDL_GetStringBoolean(hint, SDL_TRUE)); } #endif /* !SDL_JOYSTICK_DISABLED */ - -#if !SDL_SENSOR_DISABLED +#ifndef SDL_SENSOR_DISABLED static SDL_bool SDL_update_sensors = SDL_TRUE; -static void -SDL_CalculateShouldUpdateSensors(SDL_bool hint_value) +static void SDL_CalculateShouldUpdateSensors(SDL_bool hint_value) { if (hint_value && !SDL_disabled_events[SDL_SENSORUPDATE >> 8]) { @@ -136,16 +129,14 @@ SDL_CalculateShouldUpdateSensors(SDL_bool hint_value) } } -static void SDLCALL -SDL_AutoUpdateSensorsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_AutoUpdateSensorsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_CalculateShouldUpdateSensors(SDL_GetStringBoolean(hint, SDL_TRUE)); } #endif /* !SDL_SENSOR_DISABLED */ -static void SDLCALL -SDL_PollSentinelChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_PollSentinelChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { (void)SDL_EventState(SDL_POLLSENTINEL, SDL_GetStringBoolean(hint, SDL_TRUE) ? SDL_ENABLE : SDL_DISABLE); } @@ -159,25 +150,23 @@ SDL_PollSentinelChanged(void *userdata, const char *name, const char *oldValue, */ static int SDL_EventLoggingVerbosity = 0; -static void SDLCALL -SDL_EventLoggingChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_EventLoggingChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_EventLoggingVerbosity = (hint && *hint) ? SDL_clamp(SDL_atoi(hint), 0, 3) : 0; } -static void -SDL_LogEvent(const SDL_Event *event) +static void SDL_LogEvent(const SDL_Event *event) { - char name[32]; + char name[64]; char details[128]; /* sensor/mouse/finger motion are spammy, ignore these if they aren't demanded. */ - if ( (SDL_EventLoggingVerbosity < 2) && - ( (event->type == SDL_MOUSEMOTION) || - (event->type == SDL_FINGERMOTION) || - (event->type == SDL_CONTROLLERTOUCHPADMOTION) || - (event->type == SDL_CONTROLLERSENSORUPDATE) || - (event->type == SDL_SENSORUPDATE) ) ) { + if ((SDL_EventLoggingVerbosity < 2) && + ((event->type == SDL_MOUSEMOTION) || + (event->type == SDL_FINGERMOTION) || + (event->type == SDL_CONTROLLERTOUCHPADMOTION) || + (event->type == SDL_CONTROLLERSENSORUPDATE) || + (event->type == SDL_SENSORUPDATE))) { return; } @@ -186,8 +175,8 @@ SDL_LogEvent(const SDL_Event *event) return; } - /* this is to make SDL_snprintf() calls cleaner. */ - #define uint unsigned int +/* this is to make (void)SDL_snprintf() calls cleaner. */ +#define uint unsigned int name[0] = '\0'; details[0] = '\0'; @@ -196,54 +185,86 @@ SDL_LogEvent(const SDL_Event *event) if ((event->type >= SDL_USEREVENT) && (event->type <= SDL_LASTEVENT)) { char plusstr[16]; - SDL_strlcpy(name, "SDL_USEREVENT", sizeof (name)); + SDL_strlcpy(name, "SDL_USEREVENT", sizeof(name)); if (event->type > SDL_USEREVENT) { - SDL_snprintf(plusstr, sizeof (plusstr), "+%u", ((uint) event->type) - SDL_USEREVENT); + (void)SDL_snprintf(plusstr, sizeof(plusstr), "+%u", ((uint)event->type) - SDL_USEREVENT); } else { plusstr[0] = '\0'; } - SDL_snprintf(details, sizeof (details), "%s (timestamp=%u windowid=%u code=%d data1=%p data2=%p)", - plusstr, (uint) event->user.timestamp, (uint) event->user.windowID, - (int) event->user.code, event->user.data1, event->user.data2); + (void)SDL_snprintf(details, sizeof(details), "%s (timestamp=%u windowid=%u code=%d data1=%p data2=%p)", + plusstr, (uint)event->user.timestamp, (uint)event->user.windowID, + (int)event->user.code, event->user.data1, event->user.data2); } switch (event->type) { - #define SDL_EVENT_CASE(x) case x: SDL_strlcpy(name, #x, sizeof (name)); - SDL_EVENT_CASE(SDL_FIRSTEVENT) SDL_strlcpy(details, " (THIS IS PROBABLY A BUG!)", sizeof (details)); break; - SDL_EVENT_CASE(SDL_QUIT) SDL_snprintf(details, sizeof (details), " (timestamp=%u)", (uint) event->quit.timestamp); break; - SDL_EVENT_CASE(SDL_APP_TERMINATING) break; - SDL_EVENT_CASE(SDL_APP_LOWMEMORY) break; - SDL_EVENT_CASE(SDL_APP_WILLENTERBACKGROUND) break; - SDL_EVENT_CASE(SDL_APP_DIDENTERBACKGROUND) break; - SDL_EVENT_CASE(SDL_APP_WILLENTERFOREGROUND) break; - SDL_EVENT_CASE(SDL_APP_DIDENTERFOREGROUND) break; - SDL_EVENT_CASE(SDL_LOCALECHANGED) break; - SDL_EVENT_CASE(SDL_KEYMAPCHANGED) break; - SDL_EVENT_CASE(SDL_CLIPBOARDUPDATE) break; - SDL_EVENT_CASE(SDL_RENDER_TARGETS_RESET) break; - SDL_EVENT_CASE(SDL_RENDER_DEVICE_RESET) break; - - SDL_EVENT_CASE(SDL_DISPLAYEVENT) { +#define SDL_EVENT_CASE(x) \ + case x: \ + SDL_strlcpy(name, #x, sizeof(name)); + SDL_EVENT_CASE(SDL_FIRSTEVENT) + SDL_strlcpy(details, " (THIS IS PROBABLY A BUG!)", sizeof(details)); + break; + SDL_EVENT_CASE(SDL_QUIT) + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u)", (uint)event->quit.timestamp); + break; + SDL_EVENT_CASE(SDL_APP_TERMINATING) + break; + SDL_EVENT_CASE(SDL_APP_LOWMEMORY) + break; + SDL_EVENT_CASE(SDL_APP_WILLENTERBACKGROUND) + break; + SDL_EVENT_CASE(SDL_APP_DIDENTERBACKGROUND) + break; + SDL_EVENT_CASE(SDL_APP_WILLENTERFOREGROUND) + break; + SDL_EVENT_CASE(SDL_APP_DIDENTERFOREGROUND) + break; + SDL_EVENT_CASE(SDL_LOCALECHANGED) + break; + SDL_EVENT_CASE(SDL_KEYMAPCHANGED) + break; + SDL_EVENT_CASE(SDL_CLIPBOARDUPDATE) + break; + SDL_EVENT_CASE(SDL_RENDER_TARGETS_RESET) + break; + SDL_EVENT_CASE(SDL_RENDER_DEVICE_RESET) + break; + + SDL_EVENT_CASE(SDL_DISPLAYEVENT) + { char name2[64]; switch (event->display.event) { - case SDL_DISPLAYEVENT_NONE: SDL_strlcpy(name2, "SDL_DISPLAYEVENT_NONE (THIS IS PROBABLY A BUG!)", sizeof(name2)); break; - #define SDL_DISPLAYEVENT_CASE(x) case x: SDL_strlcpy(name2, #x, sizeof (name2)); break + case SDL_DISPLAYEVENT_NONE: + SDL_strlcpy(name2, "SDL_DISPLAYEVENT_NONE (THIS IS PROBABLY A BUG!)", sizeof(name2)); + break; +#define SDL_DISPLAYEVENT_CASE(x) \ + case x: \ + SDL_strlcpy(name2, #x, sizeof(name2)); \ + break SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_ORIENTATION); SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_CONNECTED); SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_DISCONNECTED); - #undef SDL_DISPLAYEVENT_CASE - default: SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof(name2)); break; + SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_MOVED); +#undef SDL_DISPLAYEVENT_CASE + default: + SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof(name2)); + break; } - SDL_snprintf(details, sizeof (details), " (timestamp=%u display=%u event=%s data1=%d)", - (uint) event->display.timestamp, (uint) event->display.display, name2, (int) event->display.data1); + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u display=%u event=%s data1=%d)", + (uint)event->display.timestamp, (uint)event->display.display, name2, (int)event->display.data1); break; } - SDL_EVENT_CASE(SDL_WINDOWEVENT) { + SDL_EVENT_CASE(SDL_WINDOWEVENT) + { char name2[64]; - switch(event->window.event) { - case SDL_WINDOWEVENT_NONE: SDL_strlcpy(name2, "SDL_WINDOWEVENT_NONE (THIS IS PROBABLY A BUG!)", sizeof (name2)); break; - #define SDL_WINDOWEVENT_CASE(x) case x: SDL_strlcpy(name2, #x, sizeof (name2)); break + switch (event->window.event) { + case SDL_WINDOWEVENT_NONE: + SDL_strlcpy(name2, "SDL_WINDOWEVENT_NONE (THIS IS PROBABLY A BUG!)", sizeof(name2)); + break; +#define SDL_WINDOWEVENT_CASE(x) \ + case x: \ + SDL_strlcpy(name2, #x, sizeof(name2)); \ + break SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_SHOWN); SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_HIDDEN); SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_EXPOSED); @@ -262,217 +283,269 @@ SDL_LogEvent(const SDL_Event *event) SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_HIT_TEST); SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_ICCPROF_CHANGED); SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_DISPLAY_CHANGED); - #undef SDL_WINDOWEVENT_CASE - default: SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof (name2)); break; +#undef SDL_WINDOWEVENT_CASE + default: + SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof(name2)); + break; } - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u event=%s data1=%d data2=%d)", - (uint) event->window.timestamp, (uint) event->window.windowID, name2, (int) event->window.data1, (int) event->window.data2); + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u event=%s data1=%d data2=%d)", + (uint)event->window.timestamp, (uint)event->window.windowID, name2, (int)event->window.data1, (int)event->window.data2); break; } SDL_EVENT_CASE(SDL_SYSWMEVENT) - /* !!! FIXME: we don't delve further at the moment. */ - SDL_snprintf(details, sizeof (details), " (timestamp=%u)", (uint) event->syswm.timestamp); - break; - - #define PRINT_KEY_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u state=%s repeat=%s scancode=%u keycode=%u mod=%u)", \ - (uint) event->key.timestamp, (uint) event->key.windowID, \ - event->key.state == SDL_PRESSED ? "pressed" : "released", \ - event->key.repeat ? "true" : "false", \ - (uint) event->key.keysym.scancode, \ - (uint) event->key.keysym.sym, \ - (uint) event->key.keysym.mod) - SDL_EVENT_CASE(SDL_KEYDOWN) PRINT_KEY_EVENT(event); break; - SDL_EVENT_CASE(SDL_KEYUP) PRINT_KEY_EVENT(event); break; - #undef PRINT_KEY_EVENT + /* !!! FIXME: we don't delve further at the moment. */ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u)", (uint)event->syswm.timestamp); + break; + +#define PRINT_KEY_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u state=%s repeat=%s scancode=%u keycode=%u mod=%u)", \ + (uint)event->key.timestamp, (uint)event->key.windowID, \ + event->key.state == SDL_PRESSED ? "pressed" : "released", \ + event->key.repeat ? "true" : "false", \ + (uint)event->key.keysym.scancode, \ + (uint)event->key.keysym.sym, \ + (uint)event->key.keysym.mod) + SDL_EVENT_CASE(SDL_KEYDOWN) + PRINT_KEY_EVENT(event); + break; + SDL_EVENT_CASE(SDL_KEYUP) + PRINT_KEY_EVENT(event); + break; +#undef PRINT_KEY_EVENT SDL_EVENT_CASE(SDL_TEXTEDITING) - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u text='%s' start=%d length=%d)", - (uint) event->edit.timestamp, (uint) event->edit.windowID, - event->edit.text, (int) event->edit.start, (int) event->edit.length); - break; + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u text='%s' start=%d length=%d)", + (uint)event->edit.timestamp, (uint)event->edit.windowID, + event->edit.text, (int)event->edit.start, (int)event->edit.length); + break; SDL_EVENT_CASE(SDL_TEXTINPUT) - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u text='%s')", (uint) event->text.timestamp, (uint) event->text.windowID, event->text.text); - break; - + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u text='%s')", (uint)event->text.timestamp, (uint)event->text.windowID, event->text.text); + break; SDL_EVENT_CASE(SDL_MOUSEMOTION) - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u which=%u state=%u x=%d y=%d xrel=%d yrel=%d)", - (uint) event->motion.timestamp, (uint) event->motion.windowID, - (uint) event->motion.which, (uint) event->motion.state, - (int) event->motion.x, (int) event->motion.y, - (int) event->motion.xrel, (int) event->motion.yrel); - break; - - #define PRINT_MBUTTON_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u which=%u button=%u state=%s clicks=%u x=%d y=%d)", \ - (uint) event->button.timestamp, (uint) event->button.windowID, \ - (uint) event->button.which, (uint) event->button.button, \ - event->button.state == SDL_PRESSED ? "pressed" : "released", \ - (uint) event->button.clicks, (int) event->button.x, (int) event->button.y) - SDL_EVENT_CASE(SDL_MOUSEBUTTONDOWN) PRINT_MBUTTON_EVENT(event); break; - SDL_EVENT_CASE(SDL_MOUSEBUTTONUP) PRINT_MBUTTON_EVENT(event); break; - #undef PRINT_MBUTTON_EVENT - + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u which=%u state=%u x=%d y=%d xrel=%d yrel=%d)", + (uint)event->motion.timestamp, (uint)event->motion.windowID, + (uint)event->motion.which, (uint)event->motion.state, + (int)event->motion.x, (int)event->motion.y, + (int)event->motion.xrel, (int)event->motion.yrel); + break; + +#define PRINT_MBUTTON_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u which=%u button=%u state=%s clicks=%u x=%d y=%d)", \ + (uint)event->button.timestamp, (uint)event->button.windowID, \ + (uint)event->button.which, (uint)event->button.button, \ + event->button.state == SDL_PRESSED ? "pressed" : "released", \ + (uint)event->button.clicks, (int)event->button.x, (int)event->button.y) + SDL_EVENT_CASE(SDL_MOUSEBUTTONDOWN) + PRINT_MBUTTON_EVENT(event); + break; + SDL_EVENT_CASE(SDL_MOUSEBUTTONUP) + PRINT_MBUTTON_EVENT(event); + break; +#undef PRINT_MBUTTON_EVENT SDL_EVENT_CASE(SDL_MOUSEWHEEL) - SDL_snprintf(details, sizeof (details), " (timestamp=%u windowid=%u which=%u x=%d y=%d preciseX=%f preciseY=%f direction=%s)", - (uint) event->wheel.timestamp, (uint) event->wheel.windowID, - (uint) event->wheel.which, (int) event->wheel.x, (int) event->wheel.y, - event->wheel.preciseX, event->wheel.preciseY, - event->wheel.direction == SDL_MOUSEWHEEL_NORMAL ? "normal" : "flipped"); - break; + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u which=%u x=%d y=%d preciseX=%f preciseY=%f direction=%s)", + (uint)event->wheel.timestamp, (uint)event->wheel.windowID, + (uint)event->wheel.which, (int)event->wheel.x, (int)event->wheel.y, + event->wheel.preciseX, event->wheel.preciseY, + event->wheel.direction == SDL_MOUSEWHEEL_NORMAL ? "normal" : "flipped"); + break; SDL_EVENT_CASE(SDL_JOYAXISMOTION) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d axis=%u value=%d)", - (uint) event->jaxis.timestamp, (int) event->jaxis.which, - (uint) event->jaxis.axis, (int) event->jaxis.value); - break; + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d axis=%u value=%d)", + (uint)event->jaxis.timestamp, (int)event->jaxis.which, + (uint)event->jaxis.axis, (int)event->jaxis.value); + break; SDL_EVENT_CASE(SDL_JOYBALLMOTION) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d ball=%u xrel=%d yrel=%d)", - (uint) event->jball.timestamp, (int) event->jball.which, - (uint) event->jball.ball, (int) event->jball.xrel, (int) event->jball.yrel); - break; + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d ball=%u xrel=%d yrel=%d)", + (uint)event->jball.timestamp, (int)event->jball.which, + (uint)event->jball.ball, (int)event->jball.xrel, (int)event->jball.yrel); + break; SDL_EVENT_CASE(SDL_JOYHATMOTION) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d hat=%u value=%u)", - (uint) event->jhat.timestamp, (int) event->jhat.which, - (uint) event->jhat.hat, (uint) event->jhat.value); - break; - - #define PRINT_JBUTTON_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d button=%u state=%s)", \ - (uint) event->jbutton.timestamp, (int) event->jbutton.which, \ - (uint) event->jbutton.button, event->jbutton.state == SDL_PRESSED ? "pressed" : "released") - SDL_EVENT_CASE(SDL_JOYBUTTONDOWN) PRINT_JBUTTON_EVENT(event); break; - SDL_EVENT_CASE(SDL_JOYBUTTONUP) PRINT_JBUTTON_EVENT(event); break; - #undef PRINT_JBUTTON_EVENT - - #define PRINT_JOYDEV_EVENT(event) SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d)", (uint) event->jdevice.timestamp, (int) event->jdevice.which) - SDL_EVENT_CASE(SDL_JOYDEVICEADDED) PRINT_JOYDEV_EVENT(event); break; - SDL_EVENT_CASE(SDL_JOYDEVICEREMOVED) PRINT_JOYDEV_EVENT(event); break; - #undef PRINT_JOYDEV_EVENT + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d hat=%u value=%u)", + (uint)event->jhat.timestamp, (int)event->jhat.which, + (uint)event->jhat.hat, (uint)event->jhat.value); + break; + +#define PRINT_JBUTTON_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d button=%u state=%s)", \ + (uint)event->jbutton.timestamp, (int)event->jbutton.which, \ + (uint)event->jbutton.button, event->jbutton.state == SDL_PRESSED ? "pressed" : "released") + SDL_EVENT_CASE(SDL_JOYBUTTONDOWN) + PRINT_JBUTTON_EVENT(event); + break; + SDL_EVENT_CASE(SDL_JOYBUTTONUP) + PRINT_JBUTTON_EVENT(event); + break; +#undef PRINT_JBUTTON_EVENT + +#define PRINT_JOYDEV_EVENT(event) (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d)", (uint)event->jdevice.timestamp, (int)event->jdevice.which) + SDL_EVENT_CASE(SDL_JOYDEVICEADDED) + PRINT_JOYDEV_EVENT(event); + break; + SDL_EVENT_CASE(SDL_JOYDEVICEREMOVED) + PRINT_JOYDEV_EVENT(event); + break; +#undef PRINT_JOYDEV_EVENT SDL_EVENT_CASE(SDL_CONTROLLERAXISMOTION) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d axis=%u value=%d)", - (uint) event->caxis.timestamp, (int) event->caxis.which, - (uint) event->caxis.axis, (int) event->caxis.value); - break; - - #define PRINT_CBUTTON_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d button=%u state=%s)", \ - (uint) event->cbutton.timestamp, (int) event->cbutton.which, \ - (uint) event->cbutton.button, event->cbutton.state == SDL_PRESSED ? "pressed" : "released") - SDL_EVENT_CASE(SDL_CONTROLLERBUTTONDOWN) PRINT_CBUTTON_EVENT(event); break; - SDL_EVENT_CASE(SDL_CONTROLLERBUTTONUP) PRINT_CBUTTON_EVENT(event); break; - #undef PRINT_CBUTTON_EVENT - - #define PRINT_CONTROLLERDEV_EVENT(event) SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d)", (uint) event->cdevice.timestamp, (int) event->cdevice.which) - SDL_EVENT_CASE(SDL_CONTROLLERDEVICEADDED) PRINT_CONTROLLERDEV_EVENT(event); break; - SDL_EVENT_CASE(SDL_CONTROLLERDEVICEREMOVED) PRINT_CONTROLLERDEV_EVENT(event); break; - SDL_EVENT_CASE(SDL_CONTROLLERDEVICEREMAPPED) PRINT_CONTROLLERDEV_EVENT(event); break; - #undef PRINT_CONTROLLERDEV_EVENT - - #define PRINT_CTOUCHPAD_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d touchpad=%d finger=%d x=%f y=%f pressure=%f)", \ - (uint) event->ctouchpad.timestamp, (int) event->ctouchpad.which, \ - (int) event->ctouchpad.touchpad, (int) event->ctouchpad.finger, \ - event->ctouchpad.x, event->ctouchpad.y, event->ctouchpad.pressure) - SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADDOWN) PRINT_CTOUCHPAD_EVENT(event); break; - SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADUP) PRINT_CTOUCHPAD_EVENT(event); break; - SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADMOTION) PRINT_CTOUCHPAD_EVENT(event); break; - #undef PRINT_CTOUCHPAD_EVENT - - SDL_EVENT_CASE(SDL_CONTROLLERSENSORUPDATE) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d sensor=%d data[0]=%f data[1]=%f data[2]=%f)", \ - (uint) event->csensor.timestamp, (int) event->csensor.which, (int) event->csensor.sensor, \ - event->csensor.data[0], event->csensor.data[1], event->csensor.data[2]); - break; - - #define PRINT_FINGER_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" fingerid=%"SDL_PRIs64" x=%f y=%f dx=%f dy=%f pressure=%f)", \ - (uint) event->tfinger.timestamp, (long long)event->tfinger.touchId, \ - (long long)event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, \ - event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure) - SDL_EVENT_CASE(SDL_FINGERDOWN) PRINT_FINGER_EVENT(event); break; - SDL_EVENT_CASE(SDL_FINGERUP) PRINT_FINGER_EVENT(event); break; - SDL_EVENT_CASE(SDL_FINGERMOTION) PRINT_FINGER_EVENT(event); break; - #undef PRINT_FINGER_EVENT - - #define PRINT_DOLLAR_EVENT(event) \ - SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" gestureid=%"SDL_PRIs64" numfingers=%u error=%f x=%f y=%f)", \ - (uint) event->dgesture.timestamp, (long long)event->dgesture.touchId, \ - (long long)event->dgesture.gestureId, (uint) event->dgesture.numFingers, \ - event->dgesture.error, event->dgesture.x, event->dgesture.y) - SDL_EVENT_CASE(SDL_DOLLARGESTURE) PRINT_DOLLAR_EVENT(event); break; - SDL_EVENT_CASE(SDL_DOLLARRECORD) PRINT_DOLLAR_EVENT(event); break; - #undef PRINT_DOLLAR_EVENT + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d axis=%u value=%d)", + (uint)event->caxis.timestamp, (int)event->caxis.which, + (uint)event->caxis.axis, (int)event->caxis.value); + break; + +#define PRINT_CBUTTON_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d button=%u state=%s)", \ + (uint)event->cbutton.timestamp, (int)event->cbutton.which, \ + (uint)event->cbutton.button, event->cbutton.state == SDL_PRESSED ? "pressed" : "released") + SDL_EVENT_CASE(SDL_CONTROLLERBUTTONDOWN) + PRINT_CBUTTON_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERBUTTONUP) + PRINT_CBUTTON_EVENT(event); + break; +#undef PRINT_CBUTTON_EVENT + +#define PRINT_CONTROLLERDEV_EVENT(event) (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d)", (uint)event->cdevice.timestamp, (int)event->cdevice.which) + SDL_EVENT_CASE(SDL_CONTROLLERDEVICEADDED) + PRINT_CONTROLLERDEV_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERDEVICEREMOVED) + PRINT_CONTROLLERDEV_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERDEVICEREMAPPED) + PRINT_CONTROLLERDEV_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERSTEAMHANDLEUPDATED) + PRINT_CONTROLLERDEV_EVENT(event); + break; +#undef PRINT_CONTROLLERDEV_EVENT + +#define PRINT_CTOUCHPAD_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d touchpad=%d finger=%d x=%f y=%f pressure=%f)", \ + (uint)event->ctouchpad.timestamp, (int)event->ctouchpad.which, \ + (int)event->ctouchpad.touchpad, (int)event->ctouchpad.finger, \ + event->ctouchpad.x, event->ctouchpad.y, event->ctouchpad.pressure) + SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADDOWN) + PRINT_CTOUCHPAD_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADUP) + PRINT_CTOUCHPAD_EVENT(event); + break; + SDL_EVENT_CASE(SDL_CONTROLLERTOUCHPADMOTION) + PRINT_CTOUCHPAD_EVENT(event); + break; +#undef PRINT_CTOUCHPAD_EVENT + + SDL_EVENT_CASE(SDL_CONTROLLERSENSORUPDATE) + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d sensor=%d data[0]=%f data[1]=%f data[2]=%f)", + (uint)event->csensor.timestamp, (int)event->csensor.which, (int)event->csensor.sensor, + event->csensor.data[0], event->csensor.data[1], event->csensor.data[2]); + break; + +#define PRINT_FINGER_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u touchid=%" SDL_PRIs64 " fingerid=%" SDL_PRIs64 " x=%f y=%f dx=%f dy=%f pressure=%f)", \ + (uint)event->tfinger.timestamp, event->tfinger.touchId, \ + event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, \ + event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure) + SDL_EVENT_CASE(SDL_FINGERDOWN) + PRINT_FINGER_EVENT(event); + break; + SDL_EVENT_CASE(SDL_FINGERUP) + PRINT_FINGER_EVENT(event); + break; + SDL_EVENT_CASE(SDL_FINGERMOTION) + PRINT_FINGER_EVENT(event); + break; +#undef PRINT_FINGER_EVENT + +#define PRINT_DOLLAR_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u touchid=%" SDL_PRIs64 " gestureid=%" SDL_PRIs64 " numfingers=%u error=%f x=%f y=%f)", \ + (uint)event->dgesture.timestamp, event->dgesture.touchId, \ + event->dgesture.gestureId, (uint)event->dgesture.numFingers, \ + event->dgesture.error, event->dgesture.x, event->dgesture.y) + SDL_EVENT_CASE(SDL_DOLLARGESTURE) + PRINT_DOLLAR_EVENT(event); + break; + SDL_EVENT_CASE(SDL_DOLLARRECORD) + PRINT_DOLLAR_EVENT(event); + break; +#undef PRINT_DOLLAR_EVENT SDL_EVENT_CASE(SDL_MULTIGESTURE) - SDL_snprintf(details, sizeof (details), " (timestamp=%u touchid=%"SDL_PRIs64" dtheta=%f ddist=%f x=%f y=%f numfingers=%u)", - (uint) event->mgesture.timestamp, (long long)event->mgesture.touchId, - event->mgesture.dTheta, event->mgesture.dDist, - event->mgesture.x, event->mgesture.y, (uint) event->mgesture.numFingers); - break; - - #define PRINT_DROP_EVENT(event) SDL_snprintf(details, sizeof (details), " (file='%s' timestamp=%u windowid=%u)", event->drop.file, (uint) event->drop.timestamp, (uint) event->drop.windowID) - SDL_EVENT_CASE(SDL_DROPFILE) PRINT_DROP_EVENT(event); break; - SDL_EVENT_CASE(SDL_DROPTEXT) PRINT_DROP_EVENT(event); break; - SDL_EVENT_CASE(SDL_DROPBEGIN) PRINT_DROP_EVENT(event); break; - SDL_EVENT_CASE(SDL_DROPCOMPLETE) PRINT_DROP_EVENT(event); break; - #undef PRINT_DROP_EVENT - - #define PRINT_AUDIODEV_EVENT(event) SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%u iscapture=%s)", (uint) event->adevice.timestamp, (uint) event->adevice.which, event->adevice.iscapture ? "true" : "false") - SDL_EVENT_CASE(SDL_AUDIODEVICEADDED) PRINT_AUDIODEV_EVENT(event); break; - SDL_EVENT_CASE(SDL_AUDIODEVICEREMOVED) PRINT_AUDIODEV_EVENT(event); break; - #undef PRINT_AUDIODEV_EVENT + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u touchid=%" SDL_PRIs64 " dtheta=%f ddist=%f x=%f y=%f numfingers=%u)", + (uint)event->mgesture.timestamp, event->mgesture.touchId, + event->mgesture.dTheta, event->mgesture.dDist, + event->mgesture.x, event->mgesture.y, (uint)event->mgesture.numFingers); + break; + +#define PRINT_DROP_EVENT(event) (void)SDL_snprintf(details, sizeof(details), " (file='%s' timestamp=%u windowid=%u)", event->drop.file, (uint)event->drop.timestamp, (uint)event->drop.windowID) + SDL_EVENT_CASE(SDL_DROPFILE) + PRINT_DROP_EVENT(event); + break; + SDL_EVENT_CASE(SDL_DROPTEXT) + PRINT_DROP_EVENT(event); + break; + SDL_EVENT_CASE(SDL_DROPBEGIN) + PRINT_DROP_EVENT(event); + break; + SDL_EVENT_CASE(SDL_DROPCOMPLETE) + PRINT_DROP_EVENT(event); + break; +#undef PRINT_DROP_EVENT + +#define PRINT_AUDIODEV_EVENT(event) (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%u iscapture=%s)", (uint)event->adevice.timestamp, (uint)event->adevice.which, event->adevice.iscapture ? "true" : "false") + SDL_EVENT_CASE(SDL_AUDIODEVICEADDED) + PRINT_AUDIODEV_EVENT(event); + break; + SDL_EVENT_CASE(SDL_AUDIODEVICEREMOVED) + PRINT_AUDIODEV_EVENT(event); + break; +#undef PRINT_AUDIODEV_EVENT SDL_EVENT_CASE(SDL_SENSORUPDATE) - SDL_snprintf(details, sizeof (details), " (timestamp=%u which=%d data[0]=%f data[1]=%f data[2]=%f data[3]=%f data[4]=%f data[5]=%f)", \ - (uint) event->sensor.timestamp, (int) event->sensor.which, \ - event->sensor.data[0], event->sensor.data[1], event->sensor.data[2], \ - event->sensor.data[3], event->sensor.data[4], event->sensor.data[5]); - break; - - #undef SDL_EVENT_CASE - - case SDL_POLLSENTINEL: - /* No logging necessary for this one */ - break; - - default: - if (!name[0]) { - SDL_strlcpy(name, "UNKNOWN", sizeof (name)); - SDL_snprintf(details, sizeof (details), " #%u! (Bug? FIXME?)", (uint) event->type); - } - break; + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%d data[0]=%f data[1]=%f data[2]=%f data[3]=%f data[4]=%f data[5]=%f)", + (uint)event->sensor.timestamp, (int)event->sensor.which, + event->sensor.data[0], event->sensor.data[1], event->sensor.data[2], + event->sensor.data[3], event->sensor.data[4], event->sensor.data[5]); + break; + +#undef SDL_EVENT_CASE + + case SDL_POLLSENTINEL: + /* No logging necessary for this one */ + break; + + default: + if (!name[0]) { + SDL_strlcpy(name, "UNKNOWN", sizeof(name)); + (void)SDL_snprintf(details, sizeof(details), " #%u! (Bug? FIXME?)", (uint)event->type); + } + break; } if (name[0]) { SDL_Log("SDL EVENT: %s%s", name, details); } - #undef uint +#undef uint } - - /* Public functions */ -void -SDL_StopEventLoop(void) +void SDL_StopEventLoop(void) { const char *report = SDL_GetHint("SDL_EVENT_QUEUE_STATISTICS"); int i; SDL_EventEntry *entry; SDL_SysWMEntry *wmmsg; - if (SDL_EventQ.lock) { - SDL_LockMutex(SDL_EventQ.lock); - } + SDL_LockMutex(SDL_EventQ.lock); SDL_EventQ.active = SDL_FALSE; @@ -482,22 +555,22 @@ SDL_StopEventLoop(void) } /* Clean out EventQ */ - for (entry = SDL_EventQ.head; entry; ) { + for (entry = SDL_EventQ.head; entry;) { SDL_EventEntry *next = entry->next; SDL_free(entry); entry = next; } - for (entry = SDL_EventQ.free; entry; ) { + for (entry = SDL_EventQ.free; entry;) { SDL_EventEntry *next = entry->next; SDL_free(entry); entry = next; } - for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg; ) { + for (wmmsg = SDL_EventQ.wmmsg_used; wmmsg;) { SDL_SysWMEntry *next = wmmsg->next; SDL_free(wmmsg); wmmsg = next; } - for (wmmsg = SDL_EventQ.wmmsg_free; wmmsg; ) { + for (wmmsg = SDL_EventQ.wmmsg_free; wmmsg;) { SDL_SysWMEntry *next = wmmsg->next; SDL_free(wmmsg); wmmsg = next; @@ -529,16 +602,16 @@ SDL_StopEventLoop(void) } SDL_zero(SDL_EventOK); + SDL_UnlockMutex(SDL_EventQ.lock); + if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); SDL_DestroyMutex(SDL_EventQ.lock); SDL_EventQ.lock = NULL; } } /* This function (and associated calls) may be called more than once */ -int -SDL_StartEventLoop(void) +int SDL_StartEventLoop(void) { /* We'll leave the event queue alone, since we might have gotten some important events at launch (like SDL_DROPFILE) @@ -547,7 +620,7 @@ SDL_StartEventLoop(void) */ /* Create the lock and set ourselves active */ -#if !SDL_THREADS_DISABLED +#ifndef SDL_THREADS_DISABLED if (!SDL_EventQ.lock) { SDL_EventQ.lock = SDL_CreateMutex(); if (SDL_EventQ.lock == NULL) { @@ -556,7 +629,7 @@ SDL_StartEventLoop(void) } SDL_LockMutex(SDL_EventQ.lock); - if (!SDL_event_watchers_lock) { + if (SDL_event_watchers_lock == NULL) { SDL_event_watchers_lock = SDL_CreateMutex(); if (SDL_event_watchers_lock == NULL) { SDL_UnlockMutex(SDL_EventQ.lock); @@ -575,16 +648,12 @@ SDL_StartEventLoop(void) #endif SDL_EventQ.active = SDL_TRUE; - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } + SDL_UnlockMutex(SDL_EventQ.lock); return 0; } - /* Add an event to the event queue -- called with the queue locked */ -static int -SDL_AddEvent(SDL_Event * event) +static int SDL_AddEvent(SDL_Event *event) { SDL_EventEntry *entry; const int initial_count = SDL_AtomicGet(&SDL_EventQ.count); @@ -597,7 +666,7 @@ SDL_AddEvent(SDL_Event * event) if (SDL_EventQ.free == NULL) { entry = (SDL_EventEntry *)SDL_malloc(sizeof(*entry)); - if (!entry) { + if (entry == NULL) { return 0; } } else { @@ -639,8 +708,7 @@ SDL_AddEvent(SDL_Event * event) } /* Remove an event from the queue -- called with the queue locked */ -static void -SDL_CutEvent(SDL_EventEntry *entry) +static void SDL_CutEvent(SDL_EventEntry *entry) { if (entry->prev) { entry->prev->next = entry->next; @@ -668,47 +736,42 @@ SDL_CutEvent(SDL_EventEntry *entry) SDL_AtomicAdd(&SDL_EventQ.count, -1); } -static int -SDL_SendWakeupEvent() +static int SDL_SendWakeupEvent(void) { + SDL_Window *wakeup_window; SDL_VideoDevice *_this = SDL_GetVideoDevice(); - if (!_this || !_this->SendWakeupEvent) { + if (_this == NULL || !_this->SendWakeupEvent) { return 0; } - if (!_this->wakeup_lock || SDL_LockMutex(_this->wakeup_lock) == 0) { - if (_this->wakeup_window) { - _this->SendWakeupEvent(_this, _this->wakeup_window); - /* No more wakeup events needed until we enter a new wait */ - _this->wakeup_window = NULL; - } - if (_this->wakeup_lock) { - SDL_UnlockMutex(_this->wakeup_lock); - } + /* We only want to do this once while waiting for an event, so set it to NULL atomically here */ + wakeup_window = (SDL_Window *)SDL_AtomicSetPtr(&_this->wakeup_window, NULL); + if (wakeup_window) { + _this->SendWakeupEvent(_this, wakeup_window); } + return 0; } /* Lock the event queue, take a peep at it, and unlock it */ -static int -SDL_PeepEventsInternal(SDL_Event * events, int numevents, SDL_eventaction action, - Uint32 minType, Uint32 maxType, SDL_bool include_sentinel) +static int SDL_PeepEventsInternal(SDL_Event *events, int numevents, SDL_eventaction action, + Uint32 minType, Uint32 maxType, SDL_bool include_sentinel) { int i, used, sentinels_expected = 0; /* Lock the event queue */ used = 0; - if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) { + + SDL_LockMutex(SDL_EventQ.lock); + { /* Don't look after we've quit */ if (!SDL_EventQ.active) { - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } /* We get a few spurious events at shutdown, so don't warn then */ if (action == SDL_GETEVENT) { SDL_SetError("The event system has been shut down"); } - return (-1); + SDL_UnlockMutex(SDL_EventQ.lock); + return -1; } if (action == SDL_ADDEVENT) { for (i = 0; i < numevents; ++i) { @@ -731,7 +794,7 @@ SDL_PeepEventsInternal(SDL_Event * events, int numevents, SDL_eventaction action SDL_EventQ.wmmsg_used = NULL; } - for (entry = SDL_EventQ.head; entry && (!events || used < numevents); entry = next) { + for (entry = SDL_EventQ.head; entry && (events == NULL || used < numevents); entry = next) { next = entry->next; type = entry->event.type; if (minType <= type && type <= maxType) { @@ -764,7 +827,7 @@ SDL_PeepEventsInternal(SDL_Event * events, int numevents, SDL_eventaction action /* Skip it, we don't want to include it */ continue; } - if (!events || action != SDL_GETEVENT) { + if (events == NULL || action != SDL_GETEVENT) { ++sentinels_expected; } if (SDL_AtomicGet(&SDL_sentinel_pending) > sentinels_expected) { @@ -776,46 +839,37 @@ SDL_PeepEventsInternal(SDL_Event * events, int numevents, SDL_eventaction action } } } - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } - } else { - return SDL_SetError("Couldn't lock event queue"); } + SDL_UnlockMutex(SDL_EventQ.lock); if (used > 0 && action == SDL_ADDEVENT) { SDL_SendWakeupEvent(); } - return (used); + return used; } -int -SDL_PeepEvents(SDL_Event * events, int numevents, SDL_eventaction action, - Uint32 minType, Uint32 maxType) +int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, + Uint32 minType, Uint32 maxType) { return SDL_PeepEventsInternal(events, numevents, action, minType, maxType, SDL_FALSE); } -SDL_bool -SDL_HasEvent(Uint32 type) +SDL_bool SDL_HasEvent(Uint32 type) { - return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0); + return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0; } -SDL_bool -SDL_HasEvents(Uint32 minType, Uint32 maxType) +SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType) { - return (SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0); + return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0; } -void -SDL_FlushEvent(Uint32 type) +void SDL_FlushEvent(Uint32 type) { SDL_FlushEvents(type, type); } -void -SDL_FlushEvents(Uint32 minType, Uint32 maxType) +void SDL_FlushEvents(Uint32 minType, Uint32 maxType) { SDL_EventEntry *entry, *next; Uint32 type; @@ -832,12 +886,11 @@ SDL_FlushEvents(Uint32 minType, Uint32 maxType) #endif /* Lock the event queue */ - if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) { + SDL_LockMutex(SDL_EventQ.lock); + { /* Don't look after we've quit */ if (!SDL_EventQ.active) { - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } + SDL_UnlockMutex(SDL_EventQ.lock); return; } for (entry = SDL_EventQ.head; entry; entry = next) { @@ -847,15 +900,12 @@ SDL_FlushEvents(Uint32 minType, Uint32 maxType) SDL_CutEvent(entry); } } - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } } + SDL_UnlockMutex(SDL_EventQ.lock); } /* Run the system dependent event loops */ -static void -SDL_PumpEventsInternal(SDL_bool push_sentinel) +static void SDL_PumpEventsInternal(SDL_bool push_sentinel) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -867,67 +917,83 @@ SDL_PumpEventsInternal(SDL_bool push_sentinel) _this->PumpEvents(_this); } -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED /* Check for joystick state change */ if (SDL_update_joysticks) { SDL_JoystickUpdate(); } #endif -#if !SDL_SENSOR_DISABLED +#ifndef SDL_SENSOR_DISABLED /* Check for sensor state change */ if (SDL_update_sensors) { SDL_SensorUpdate(); } #endif - SDL_SendPendingSignalEvents(); /* in case we had a signal handler fire, etc. */ + SDL_SendPendingSignalEvents(); /* in case we had a signal handler fire, etc. */ if (push_sentinel && SDL_GetEventState(SDL_POLLSENTINEL) == SDL_ENABLE) { SDL_Event sentinel; + /* Make sure we don't already have a sentinel in the queue, and add one to the end */ + if (SDL_AtomicGet(&SDL_sentinel_pending) > 0) { + SDL_PeepEventsInternal(&sentinel, 1, SDL_GETEVENT, SDL_POLLSENTINEL, SDL_POLLSENTINEL, SDL_TRUE); + } + SDL_zero(sentinel); sentinel.type = SDL_POLLSENTINEL; SDL_PushEvent(&sentinel); } } -void -SDL_PumpEvents() +void SDL_PumpEvents(void) { SDL_PumpEventsInternal(SDL_FALSE); } /* Public functions */ -int -SDL_PollEvent(SDL_Event * event) +int SDL_PollEvent(SDL_Event *event) { return SDL_WaitEventTimeout(event, 0); } -static SDL_bool -SDL_events_need_periodic_poll() { - SDL_bool need_periodic_poll = SDL_FALSE; +static Sint16 SDL_events_get_polling_interval(void) +{ + Sint16 poll_interval = SDL_MAX_SINT16; -#if !SDL_JOYSTICK_DISABLED - need_periodic_poll = - SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_update_joysticks; +#ifndef SDL_JOYSTICK_DISABLED + if (SDL_WasInit(SDL_INIT_JOYSTICK) && SDL_update_joysticks) { + if (SDL_NumJoysticks() > 0) { + /* If we have joysticks open, we need to poll rapidly for events */ + poll_interval = SDL_min(poll_interval, EVENT_POLL_INTERVAL_MS); + } else { + /* If not, just poll every few seconds to enumerate new joysticks */ + poll_interval = SDL_min(poll_interval, ENUMERATION_POLL_INTERVAL_MS); + } + } #endif -#if !SDL_SENSOR_DISABLED - need_periodic_poll = need_periodic_poll || - (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors); +#ifndef SDL_SENSOR_DISABLED + if (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors) { + if (SDL_NumSensors() > 0) { + /* If we have sensors open, we need to poll rapidly for events */ + poll_interval = SDL_min(poll_interval, EVENT_POLL_INTERVAL_MS); + } else { + /* If not, just poll every few seconds to enumerate new sensors */ + poll_interval = SDL_min(poll_interval, ENUMERATION_POLL_INTERVAL_MS); + } + } #endif - return need_periodic_poll; + return poll_interval; } -static int -SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event, Uint32 start, int timeout) +static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event *event, Uint32 start, int timeout) { int loop_timeout = timeout; - SDL_bool need_periodic_poll = SDL_events_need_periodic_poll(); + Sint16 poll_interval = SDL_events_get_polling_interval(); for (;;) { /* Pump events on entry and each time we wake to ensure: @@ -936,86 +1002,53 @@ SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event, c) Periodic processing that takes place in some platform PumpEvents() functions happens d) Signals received in WaitEventTimeout() are turned into SDL events */ - /* We only want a single sentinel in the queue. We could get more than one if event is NULL, - * since the SDL_PeepEvents() call below won't remove it in that case. - */ - SDL_bool add_sentinel = (SDL_AtomicGet(&SDL_sentinel_pending) == 0) ? SDL_TRUE : SDL_FALSE; - SDL_PumpEventsInternal(add_sentinel); - - if (!_this->wakeup_lock || SDL_LockMutex(_this->wakeup_lock) == 0) { - int status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT); - /* If status == 0 we are going to block so wakeup will be needed. */ - if (status == 0) { - _this->wakeup_window = wakeup_window; - } else { - _this->wakeup_window = NULL; - } - if (_this->wakeup_lock) { - SDL_UnlockMutex(_this->wakeup_lock); - } - if (status < 0) { - /* Got an error: return */ - break; - } - if (status > 0) { - /* There is an event, we can return. */ - return 1; - } - /* No events found in the queue, call WaitEventTimeout to wait for an event. */ - if (timeout > 0) { - Uint32 elapsed = SDL_GetTicks() - start; - if (elapsed >= (Uint32)timeout) { - /* Set wakeup_window to NULL without holding the lock. */ - _this->wakeup_window = NULL; - return 0; - } - loop_timeout = (int)((Uint32)timeout - elapsed); - } - if (need_periodic_poll) { - if (loop_timeout >= 0) { - loop_timeout = SDL_min(loop_timeout, PERIODIC_POLL_INTERVAL_MS); - } else { - loop_timeout = PERIODIC_POLL_INTERVAL_MS; - } + int status; + SDL_PumpEventsInternal(SDL_TRUE); + + status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT); + if (status < 0) { + /* Got an error: return */ + break; + } + if (status > 0) { + /* There is an event, we can return. */ + return 1; + } + /* No events found in the queue, call WaitEventTimeout to wait for an event. */ + if (timeout > 0) { + Uint32 elapsed = SDL_GetTicks() - start; + if (elapsed >= (Uint32)timeout) { + return 0; } - status = _this->WaitEventTimeout(_this, loop_timeout); - /* Set wakeup_window to NULL without holding the lock. */ - _this->wakeup_window = NULL; - if (status == 0 && need_periodic_poll && loop_timeout == PERIODIC_POLL_INTERVAL_MS) { - /* We may have woken up to poll. Try again */ - continue; - } else if (status <= 0) { - /* There is either an error or the timeout is elapsed: return */ - return status; + loop_timeout = (int)((Uint32)timeout - elapsed); + } + + /* Adjust the timeout for any polling requirements we currently have. */ + if (poll_interval != SDL_MAX_SINT16) { + if (loop_timeout >= 0) { + loop_timeout = SDL_min(loop_timeout, poll_interval); + } else { + loop_timeout = poll_interval; } - /* An event was found and pumped into the SDL events queue. Continue the loop - to let SDL_PeepEvents pick it up .*/ } + + SDL_AtomicSetPtr(&_this->wakeup_window, wakeup_window); + status = _this->WaitEventTimeout(_this, loop_timeout); + SDL_AtomicSetPtr(&_this->wakeup_window, NULL); + if (status == 0 && poll_interval != SDL_MAX_SINT16 && loop_timeout == poll_interval) { + /* We may have woken up to poll. Try again */ + continue; + } else if (status <= 0) { + /* There is either an error or the timeout is elapsed: return */ + return status; + } + /* An event was found and pumped into the SDL events queue. Continue the loop + to let SDL_PeepEvents pick it up .*/ } return 0; } -static SDL_bool -SDL_events_need_polling() { - SDL_bool need_polling = SDL_FALSE; - -#if !SDL_JOYSTICK_DISABLED - need_polling = - SDL_WasInit(SDL_INIT_JOYSTICK) && - SDL_update_joysticks && - (SDL_NumJoysticks() > 0); -#endif - -#if !SDL_SENSOR_DISABLED - need_polling = need_polling || - (SDL_WasInit(SDL_INIT_SENSOR) && SDL_update_sensors && (SDL_NumSensors() > 0)); -#endif - - return need_polling; -} - -static SDL_Window * -SDL_find_active_window(SDL_VideoDevice * _this) +static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this) { SDL_Window *window; for (window = _this->windows; window; window = window->next) { @@ -1026,14 +1059,12 @@ SDL_find_active_window(SDL_VideoDevice * _this) return NULL; } -int -SDL_WaitEvent(SDL_Event * event) +int SDL_WaitEvent(SDL_Event *event) { return SDL_WaitEventTimeout(event, -1); } -int -SDL_WaitEventTimeout(SDL_Event * event, int timeout) +int SDL_WaitEventTimeout(SDL_Event *event, int timeout) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *wakeup_window; @@ -1089,7 +1120,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout) expiration = 0; } - if (_this && _this->WaitEventTimeout && _this->SendWakeupEvent && !SDL_events_need_polling()) { + if (_this && _this->WaitEventTimeout && _this->SendWakeupEvent) { /* Look if a shown window is available to send the wakeup event. */ wakeup_window = SDL_find_active_window(_this); if (wakeup_window) { @@ -1113,7 +1144,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout) /* Timeout expired and no events */ return 0; } - SDL_Delay(1); + SDL_Delay(EVENT_POLL_INTERVAL_MS); break; default: /* Has events */ @@ -1122,17 +1153,15 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout) } } -int -SDL_PushEvent(SDL_Event * event) +int SDL_PushEvent(SDL_Event *event) { event->common.timestamp = SDL_GetTicks(); if (SDL_EventOK.callback || SDL_event_watchers_count > 0) { - if (!SDL_event_watchers_lock || SDL_LockMutex(SDL_event_watchers_lock) == 0) { + SDL_LockMutex(SDL_event_watchers_lock); + { if (SDL_EventOK.callback && !SDL_EventOK.callback(SDL_EventOK.userdata, event)) { - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } + SDL_UnlockMutex(SDL_event_watchers_lock); return 0; } @@ -1149,22 +1178,19 @@ SDL_PushEvent(SDL_Event * event) SDL_event_watchers_dispatching = SDL_FALSE; if (SDL_event_watchers_removed) { - for (i = SDL_event_watchers_count; i--; ) { + for (i = SDL_event_watchers_count; i--;) { if (SDL_event_watchers[i].removed) { --SDL_event_watchers_count; if (i < SDL_event_watchers_count) { - SDL_memmove(&SDL_event_watchers[i], &SDL_event_watchers[i+1], (SDL_event_watchers_count - i) * sizeof(SDL_event_watchers[i])); + SDL_memmove(&SDL_event_watchers[i], &SDL_event_watchers[i + 1], (SDL_event_watchers_count - i) * sizeof(SDL_event_watchers[i])); } } } SDL_event_watchers_removed = SDL_FALSE; } } - - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } } + SDL_UnlockMutex(SDL_event_watchers_lock); } if (SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0, 0) <= 0) { @@ -1176,35 +1202,27 @@ SDL_PushEvent(SDL_Event * event) return 1; } -void -SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) +void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata) { - if (!SDL_event_watchers_lock || SDL_LockMutex(SDL_event_watchers_lock) == 0) { + SDL_LockMutex(SDL_event_watchers_lock); + { /* Set filter and discard pending events */ SDL_EventOK.callback = filter; SDL_EventOK.userdata = userdata; SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); - - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } } + SDL_UnlockMutex(SDL_event_watchers_lock); } -SDL_bool -SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata) +SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata) { SDL_EventWatcher event_ok; - if (!SDL_event_watchers_lock || SDL_LockMutex(SDL_event_watchers_lock) == 0) { + SDL_LockMutex(SDL_event_watchers_lock); + { event_ok = SDL_EventOK; - - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } - } else { - SDL_zero(event_ok); } + SDL_UnlockMutex(SDL_event_watchers_lock); if (filter) { *filter = event_ok.callback; @@ -1215,10 +1233,10 @@ SDL_GetEventFilter(SDL_EventFilter * filter, void **userdata) return event_ok.callback ? SDL_TRUE : SDL_FALSE; } -void -SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) +void SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) { - if (!SDL_event_watchers_lock || SDL_LockMutex(SDL_event_watchers_lock) == 0) { + SDL_LockMutex(SDL_event_watchers_lock); + { SDL_EventWatcher *event_watchers; event_watchers = SDL_realloc(SDL_event_watchers, (SDL_event_watchers_count + 1) * sizeof(*event_watchers)); @@ -1232,17 +1250,14 @@ SDL_AddEventWatch(SDL_EventFilter filter, void *userdata) watcher->removed = SDL_FALSE; ++SDL_event_watchers_count; } - - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } } + SDL_UnlockMutex(SDL_event_watchers_lock); } -void -SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) +void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) { - if (!SDL_event_watchers_lock || SDL_LockMutex(SDL_event_watchers_lock) == 0) { + SDL_LockMutex(SDL_event_watchers_lock); + { int i; for (i = 0; i < SDL_event_watchers_count; ++i) { @@ -1253,23 +1268,20 @@ SDL_DelEventWatch(SDL_EventFilter filter, void *userdata) } else { --SDL_event_watchers_count; if (i < SDL_event_watchers_count) { - SDL_memmove(&SDL_event_watchers[i], &SDL_event_watchers[i+1], (SDL_event_watchers_count - i) * sizeof(SDL_event_watchers[i])); + SDL_memmove(&SDL_event_watchers[i], &SDL_event_watchers[i + 1], (SDL_event_watchers_count - i) * sizeof(SDL_event_watchers[i])); } } break; } } - - if (SDL_event_watchers_lock) { - SDL_UnlockMutex(SDL_event_watchers_lock); - } } + SDL_UnlockMutex(SDL_event_watchers_lock); } -void -SDL_FilterEvents(SDL_EventFilter filter, void *userdata) +void SDL_FilterEvents(SDL_EventFilter filter, void *userdata) { - if (!SDL_EventQ.lock || SDL_LockMutex(SDL_EventQ.lock) == 0) { + SDL_LockMutex(SDL_EventQ.lock); + { SDL_EventEntry *entry, *next; for (entry = SDL_EventQ.head; entry; entry = next) { next = entry->next; @@ -1277,14 +1289,11 @@ SDL_FilterEvents(SDL_EventFilter filter, void *userdata) SDL_CutEvent(entry); } } - if (SDL_EventQ.lock) { - SDL_UnlockMutex(SDL_EventQ.lock); - } } + SDL_UnlockMutex(SDL_EventQ.lock); } -Uint8 -SDL_EventState(Uint32 type, int state) +Uint8 SDL_EventState(Uint32 type, int state) { const SDL_bool isde = (state == SDL_DISABLE) || (state == SDL_ENABLE); Uint8 current_state; @@ -1292,7 +1301,7 @@ SDL_EventState(Uint32 type, int state) Uint8 lo = (type & 0xff); if (SDL_disabled_events[hi] && - (SDL_disabled_events[hi]->bits[lo/32] & (1 << (lo&31)))) { + (SDL_disabled_events[hi]->bits[lo / 32] & (1U << (lo & 31)))) { current_state = SDL_DISABLE; } else { current_state = SDL_ENABLE; @@ -1302,21 +1311,21 @@ SDL_EventState(Uint32 type, int state) if (state == SDL_DISABLE) { /* Disable this event type and discard pending events */ if (!SDL_disabled_events[hi]) { - SDL_disabled_events[hi] = (SDL_DisabledEventBlock*) SDL_calloc(1, sizeof(SDL_DisabledEventBlock)); + SDL_disabled_events[hi] = (SDL_DisabledEventBlock *)SDL_calloc(1, sizeof(SDL_DisabledEventBlock)); } /* Out of memory, nothing we can do... */ if (SDL_disabled_events[hi]) { - SDL_disabled_events[hi]->bits[lo/32] |= (1 << (lo&31)); + SDL_disabled_events[hi]->bits[lo / 32] |= (1U << (lo & 31)); SDL_FlushEvent(type); } } else { // state == SDL_ENABLE - SDL_disabled_events[hi]->bits[lo/32] &= ~(1 << (lo&31)); + SDL_disabled_events[hi]->bits[lo / 32] &= ~(1U << (lo & 31)); } -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED SDL_CalculateShouldUpdateJoysticks(SDL_GetHintBoolean(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_TRUE)); #endif -#if !SDL_SENSOR_DISABLED +#ifndef SDL_SENSOR_DISABLED SDL_CalculateShouldUpdateSensors(SDL_GetHintBoolean(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_TRUE)); #endif } @@ -1330,12 +1339,11 @@ SDL_EventState(Uint32 type, int state) return current_state; } -Uint32 -SDL_RegisterEvents(int numevents) +Uint32 SDL_RegisterEvents(int numevents) { Uint32 event_base; - if ((numevents > 0) && (SDL_userevents+numevents <= SDL_LASTEVENT)) { + if ((numevents > 0) && (SDL_userevents + numevents <= SDL_LASTEVENT)) { event_base = SDL_userevents; SDL_userevents += numevents; } else { @@ -1344,8 +1352,7 @@ SDL_RegisterEvents(int numevents) return event_base; } -int -SDL_SendAppEvent(SDL_EventType eventType) +int SDL_SendAppEvent(SDL_EventType eventType) { int posted; @@ -1355,11 +1362,10 @@ SDL_SendAppEvent(SDL_EventType eventType) event.type = eventType; posted = (SDL_PushEvent(&event) > 0); } - return (posted); + return posted; } -int -SDL_SendSysWMEvent(SDL_SysWMmsg * message) +int SDL_SendSysWMEvent(SDL_SysWMmsg *message) { int posted; @@ -1372,28 +1378,25 @@ SDL_SendSysWMEvent(SDL_SysWMmsg * message) posted = (SDL_PushEvent(&event) > 0); } /* Update internal event state */ - return (posted); + return posted; } -int -SDL_SendKeymapChangedEvent(void) +int SDL_SendKeymapChangedEvent(void) { return SDL_SendAppEvent(SDL_KEYMAPCHANGED); } -int -SDL_SendLocaleChangedEvent(void) +int SDL_SendLocaleChangedEvent(void) { return SDL_SendAppEvent(SDL_LOCALECHANGED); } -int -SDL_EventsInit(void) +int SDL_EventsInit(void) { -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED SDL_AddHintCallback(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_AutoUpdateJoysticksChanged, NULL); #endif -#if !SDL_SENSOR_DISABLED +#ifndef SDL_SENSOR_DISABLED SDL_AddHintCallback(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_AutoUpdateSensorsChanged, NULL); #endif SDL_AddHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL); @@ -1408,17 +1411,16 @@ SDL_EventsInit(void) return 0; } -void -SDL_EventsQuit(void) +void SDL_EventsQuit(void) { SDL_QuitQuit(); SDL_StopEventLoop(); SDL_DelHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL); SDL_DelHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL); -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED SDL_DelHintCallback(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_AutoUpdateJoysticksChanged, NULL); #endif -#if !SDL_SENSOR_DISABLED +#ifndef SDL_SENSOR_DISABLED SDL_DelHintCallback(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_AutoUpdateSensorsChanged, NULL); #endif } diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index ba52b11553530..572734ecd0864 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -44,7 +44,7 @@ extern void SDL_StopEventLoop(void); extern void SDL_QuitInterrupt(void); extern int SDL_SendAppEvent(SDL_EventType eventType); -extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message); +extern int SDL_SendSysWMEvent(SDL_SysWMmsg *message); extern int SDL_SendKeymapChangedEvent(void); extern int SDL_SendLocaleChangedEvent(void); diff --git a/src/events/SDL_gesture.c b/src/events/SDL_gesture.c index 2cdb0d594b1f0..628743154d973 100644 --- a/src/events/SDL_gesture.c +++ b/src/events/SDL_gesture.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,27 +41,31 @@ #define DOLLARNPOINTS 64 #if defined(ENABLE_DOLLAR) -# define DOLLARSIZE 256 -# define PHI 0.618033989 +#define DOLLARSIZE 256 +#define PHI 0.618033989 #endif -typedef struct { - float x,y; +typedef struct +{ + float x, y; } SDL_FloatPoint; -typedef struct { +typedef struct +{ float length; int numPoints; SDL_FloatPoint p[MAXPATHSIZE]; } SDL_DollarPath; -typedef struct { +typedef struct +{ SDL_FloatPoint path[DOLLARNPOINTS]; - unsigned long hash; + Sint64 hash; } SDL_DollarTemplate; -typedef struct { +typedef struct +{ SDL_TouchID id; SDL_FloatPoint centroid; SDL_DollarPath dollarPath; @@ -92,38 +96,40 @@ static void PrintPath(SDL_FloatPoint *path) int SDL_RecordGesture(SDL_TouchID touchId) { int i; - if (touchId < 0) recordAll = SDL_TRUE; + if (touchId < 0) { + recordAll = SDL_TRUE; + } for (i = 0; i < SDL_numGestureTouches; i++) { if ((touchId < 0) || (SDL_gestureTouch[i].id == touchId)) { SDL_gestureTouch[i].recording = SDL_TRUE; - if (touchId >= 0) + if (touchId >= 0) { return 1; + } } } - return (touchId < 0); + return touchId < 0; } -void SDL_GestureQuit() +void SDL_GestureQuit(void) { SDL_free(SDL_gestureTouch); SDL_gestureTouch = NULL; } -static unsigned long SDL_HashDollar(SDL_FloatPoint* points) +static unsigned long SDL_HashDollar(SDL_FloatPoint *points) { unsigned long hash = 5381; int i; for (i = 0; i < DOLLARNPOINTS; i++) { - hash = ((hash<<5) + hash) + (unsigned long)points[i].x; - hash = ((hash<<5) + hash) + (unsigned long)points[i].y; + hash = ((hash << 5) + hash) + (unsigned long)points[i].x; + hash = ((hash << 5) + hash) + (unsigned long)points[i].y; } return hash; } - static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst) { - if (dst == NULL) { + if (!dst) { return 0; } @@ -132,7 +138,7 @@ static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst) #if SDL_BYTEORDER == SDL_LIL_ENDIAN if (SDL_RWwrite(dst, templ->path, - sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) { + sizeof(templ->path[0]), DOLLARNPOINTS) != DOLLARNPOINTS) { return 0; } #else @@ -146,7 +152,7 @@ static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst) } if (SDL_RWwrite(dst, copy.path, - sizeof(copy.path[0]),DOLLARNPOINTS) != DOLLARNPOINTS) { + sizeof(copy.path[0]), DOLLARNPOINTS) != DOLLARNPOINTS) { return 0; } } @@ -155,12 +161,11 @@ static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops *dst) return 1; } - int SDL_SaveAllDollarTemplates(SDL_RWops *dst) { - int i,j,rtrn = 0; + int i, j, rtrn = 0; for (i = 0; i < SDL_numGestureTouches; i++) { - SDL_GestureTouch* touch = &SDL_gestureTouch[i]; + SDL_GestureTouch *touch = &SDL_gestureTouch[i]; for (j = 0; j < touch->numDollarTemplates; j++) { rtrn += SaveTemplate(&touch->dollarTemplate[j], dst); } @@ -170,9 +175,9 @@ int SDL_SaveAllDollarTemplates(SDL_RWops *dst) int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst) { - int i,j; + int i, j; for (i = 0; i < SDL_numGestureTouches; i++) { - SDL_GestureTouch* touch = &SDL_gestureTouch[i]; + SDL_GestureTouch *touch = &SDL_gestureTouch[i]; for (j = 0; j < touch->numDollarTemplates; j++) { if (touch->dollarTemplate[j].hash == gestureId) { return SaveTemplate(&touch->dollarTemplate[j], dst); @@ -184,9 +189,9 @@ int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *dst) /* path is an already sampled set of points Returns the index of the gesture on success, or -1 */ -static int SDL_AddDollarGesture_one(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) +static int SDL_AddDollarGesture_one(SDL_GestureTouch *inTouch, SDL_FloatPoint *path) { - SDL_DollarTemplate* dollarTemplate; + SDL_DollarTemplate *dollarTemplate; SDL_DollarTemplate *templ; int index; @@ -194,31 +199,34 @@ static int SDL_AddDollarGesture_one(SDL_GestureTouch* inTouch, SDL_FloatPoint* p dollarTemplate = (SDL_DollarTemplate *)SDL_realloc(inTouch->dollarTemplate, (index + 1) * - sizeof(SDL_DollarTemplate)); + sizeof(SDL_DollarTemplate)); if (!dollarTemplate) { return SDL_OutOfMemory(); } inTouch->dollarTemplate = dollarTemplate; templ = &inTouch->dollarTemplate[index]; - SDL_memcpy(templ->path, path, DOLLARNPOINTS*sizeof(SDL_FloatPoint)); + SDL_memcpy(templ->path, path, DOLLARNPOINTS * sizeof(SDL_FloatPoint)); templ->hash = SDL_HashDollar(templ->path); inTouch->numDollarTemplates++; return index; } -static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) +static int SDL_AddDollarGesture(SDL_GestureTouch *inTouch, SDL_FloatPoint *path) { int index = -1; int i = 0; - if (inTouch == NULL) { - if (SDL_numGestureTouches == 0) return SDL_SetError("no gesture touch devices registered"); + if (!inTouch) { + if (SDL_numGestureTouches == 0) { + return SDL_SetError("no gesture touch devices registered"); + } for (i = 0; i < SDL_numGestureTouches; i++) { inTouch = &SDL_gestureTouch[i]; index = SDL_AddDollarGesture_one(inTouch, path); - if (index < 0) + if (index < 0) { return -1; + } } /* Use the index of the last one added. */ return index; @@ -228,16 +236,18 @@ static int SDL_AddDollarGesture(SDL_GestureTouch* inTouch, SDL_FloatPoint* path) int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) { - int i,loaded = 0; + int i, loaded = 0; SDL_GestureTouch *touch = NULL; - if (src == NULL) return 0; + if (!src) { + return 0; + } if (touchId >= 0) { for (i = 0; i < SDL_numGestureTouches; i++) { if (SDL_gestureTouch[i].id == touchId) { touch = &SDL_gestureTouch[i]; } } - if (touch == NULL) { + if (!touch) { return SDL_SetError("given touch id not found"); } } @@ -245,7 +255,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) while (1) { SDL_DollarTemplate templ; - if (SDL_RWread(src,templ.path,sizeof(templ.path[0]),DOLLARNPOINTS) < DOLLARNPOINTS) { + if (SDL_RWread(src, templ.path, sizeof(templ.path[0]), DOLLARNPOINTS) < DOLLARNPOINTS) { if (loaded == 0) { return SDL_SetError("could not read any dollar gesture from rwops"); } @@ -262,16 +272,16 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) if (touchId >= 0) { /* printf("Adding loaded gesture to 1 touch\n"); */ - if (SDL_AddDollarGesture(touch, templ.path) >= 0) + if (SDL_AddDollarGesture(touch, templ.path) >= 0) { loaded++; - } - else { + } + } else { /* printf("Adding to: %i touches\n",SDL_numGestureTouches); */ for (i = 0; i < SDL_numGestureTouches; i++) { touch = &SDL_gestureTouch[i]; /* printf("Adding loaded gesture to + touches\n"); */ /* TODO: What if this fails? */ - SDL_AddDollarGesture(touch,templ.path); + SDL_AddDollarGesture(touch, templ.path); } loaded++; } @@ -280,9 +290,8 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) return loaded; } - #if defined(ENABLE_DOLLAR) -static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) +static float dollarDifference(SDL_FloatPoint *points, SDL_FloatPoint *templ, float ang) { /* SDL_FloatPoint p[DOLLARNPOINTS]; */ float dist = 0; @@ -291,14 +300,13 @@ static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float for (i = 0; i < DOLLARNPOINTS; i++) { p.x = (float)(points[i].x * SDL_cos(ang) - points[i].y * SDL_sin(ang)); p.y = (float)(points[i].x * SDL_sin(ang) + points[i].y * SDL_cos(ang)); - dist += (float)(SDL_sqrt((p.x-templ[i].x)*(p.x-templ[i].x)+ - (p.y-templ[i].y)*(p.y-templ[i].y))); + dist += (float)(SDL_sqrt((p.x - templ[i].x) * (p.x - templ[i].x) + + (p.y - templ[i].y) * (p.y - templ[i].y))); } - return dist/DOLLARNPOINTS; - + return dist / DOLLARNPOINTS; } -static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) +static float bestDollarDifference(SDL_FloatPoint *points, SDL_FloatPoint *templ) { /*------------BEGIN DOLLAR BLACKBOX------------------ -TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT- @@ -316,15 +324,14 @@ static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) tb = x2; x2 = x1; f2 = f1; - x1 = (float)(PHI*ta + (1-PHI)*tb); - f1 = dollarDifference(points,templ,x1); - } - else { + x1 = (float)(PHI * ta + (1 - PHI) * tb); + f1 = dollarDifference(points, templ, x1); + } else { ta = x1; x1 = x2; f1 = f2; - x2 = (float)((1-PHI)*ta + PHI*tb); - f2 = dollarDifference(points,templ,x2); + x2 = (float)((1 - PHI) * ta + PHI * tb); + f2 = dollarDifference(points, templ, x2); } } /* @@ -333,47 +340,48 @@ static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) else if (f1 > f2) printf("Min angle (x2): %f\n",x2); */ - return SDL_min(f1,f2); + return SDL_min(f1, f2); } /* DollarPath contains raw points, plus (possibly) the calculated length */ -static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points, SDL_bool is_recording) +static int dollarNormalize(const SDL_DollarPath *path, SDL_FloatPoint *points, SDL_bool is_recording) { int i; float interval; float dist; int numPoints = 0; SDL_FloatPoint centroid; - float xmin,xmax,ymin,ymax; + float xmin, xmax, ymin, ymax; float ang; - float w,h; + float w, h; float length = path->length; /* Calculate length if it hasn't already been done */ if (length <= 0) { - for (i=1;i < path->numPoints; i++) { - float dx = path->p[i ].x - path->p[i-1].x; - float dy = path->p[i ].y - path->p[i-1].y; - length += (float)(SDL_sqrt(dx*dx+dy*dy)); + for (i = 1; i < path->numPoints; i++) { + float dx = path->p[i].x - path->p[i - 1].x; + float dy = path->p[i].y - path->p[i - 1].y; + length += (float)(SDL_sqrt(dx * dx + dy * dy)); } } /* Resample */ - interval = length/(DOLLARNPOINTS - 1); + interval = length / (DOLLARNPOINTS - 1); dist = interval; - centroid.x = 0;centroid.y = 0; + centroid.x = 0; + centroid.y = 0; /* printf("(%f,%f)\n",path->p[path->numPoints-1].x,path->p[path->numPoints-1].y); */ for (i = 1; i < path->numPoints; i++) { - float d = (float)(SDL_sqrt((path->p[i-1].x-path->p[i].x)*(path->p[i-1].x-path->p[i].x)+ - (path->p[i-1].y-path->p[i].y)*(path->p[i-1].y-path->p[i].y))); + float d = (float)(SDL_sqrt((path->p[i - 1].x - path->p[i].x) * (path->p[i - 1].x - path->p[i].x) + + (path->p[i - 1].y - path->p[i].y) * (path->p[i - 1].y - path->p[i].y))); /* printf("d = %f dist = %f/%f\n",d,dist,interval); */ while (dist + d > interval) { - points[numPoints].x = path->p[i-1].x + - ((interval-dist)/d)*(path->p[i].x-path->p[i-1].x); - points[numPoints].y = path->p[i-1].y + - ((interval-dist)/d)*(path->p[i].y-path->p[i-1].y); + points[numPoints].x = path->p[i - 1].x + + ((interval - dist) / d) * (path->p[i].x - path->p[i - 1].x); + points[numPoints].y = path->p[i - 1].y + + ((interval - dist) / d) * (path->p[i].y - path->p[i - 1].y); centroid.x += points[numPoints].x; centroid.y += points[numPoints].y; numPoints++; @@ -382,14 +390,14 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points, SD } dist += d; } - if (numPoints < DOLLARNPOINTS-1) { + if (numPoints < DOLLARNPOINTS - 1) { if (is_recording) { SDL_SetError("ERROR: NumPoints = %i", numPoints); } return 0; } /* copy the last point */ - points[DOLLARNPOINTS-1] = path->p[path->numPoints-1]; + points[DOLLARNPOINTS - 1] = path->p[path->numPoints - 1]; numPoints = DOLLARNPOINTS; centroid.x /= numPoints; @@ -405,33 +413,40 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points, SD ang = (float)(SDL_atan2(centroid.y - points[0].y, centroid.x - points[0].x)); - for (i = 0; i xmax) xmax = points[i].x; - if (points[i].y < ymin) ymin = points[i].y; - if (points[i].y > ymax) ymax = points[i].y; + if (points[i].x < xmin) { + xmin = points[i].x; + } + if (points[i].x > xmax) { + xmax = points[i].x; + } + if (points[i].y < ymin) { + ymin = points[i].y; + } + if (points[i].y > ymax) { + ymax = points[i].y; + } } /* Scale points to DOLLARSIZE, and translate to the origin */ - w = xmax-xmin; - h = ymax-ymin; + w = xmax - xmin; + h = ymax - ymin; - for (i=0; inumDollarTemplates; i++) { - float diff = bestDollarDifference(points,touch->dollarTemplate[i].path); - if (diff < bestDiff) {bestDiff = diff; *bestTempl = i;} + float diff = bestDollarDifference(points, touch->dollarTemplate[i].path); + if (diff < bestDiff) { + bestDiff = diff; + *bestTempl = i; + } } return bestDiff; } @@ -455,7 +473,7 @@ int SDL_GestureAddTouch(SDL_TouchID touchId) { SDL_GestureTouch *gestureTouch = (SDL_GestureTouch *)SDL_realloc(SDL_gestureTouch, (SDL_numGestureTouches + 1) * - sizeof(SDL_GestureTouch)); + sizeof(SDL_GestureTouch)); if (!gestureTouch) { return SDL_OutOfMemory(); @@ -493,18 +511,19 @@ int SDL_GestureDelTouch(SDL_TouchID touchId) return 0; } -static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) +static SDL_GestureTouch *SDL_GetGestureTouch(SDL_TouchID id) { int i; for (i = 0; i < SDL_numGestureTouches; i++) { /* printf("%i ?= %i\n",SDL_gestureTouch[i].id,id); */ - if (SDL_gestureTouch[i].id == id) + if (SDL_gestureTouch[i].id == id) { return &SDL_gestureTouch[i]; + } } return NULL; } -static void SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) +static void SDL_SendGestureMulti(SDL_GestureTouch *touch, float dTheta, float dDist) { if (SDL_GetEventState(SDL_MULTIGESTURE) == SDL_ENABLE) { SDL_Event event; @@ -520,8 +539,8 @@ static void SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDis } #if defined(ENABLE_DOLLAR) -static void SDL_SendGestureDollar(SDL_GestureTouch* touch, - SDL_GestureID gestureId,float error) +static void SDL_SendGestureDollar(SDL_GestureTouch *touch, + SDL_GestureID gestureId, float error) { if (SDL_GetEventState(SDL_DOLLARGESTURE) == SDL_ENABLE) { SDL_Event event; @@ -537,7 +556,7 @@ static void SDL_SendGestureDollar(SDL_GestureTouch* touch, } } -static void SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) +static void SDL_SendDollarRecord(SDL_GestureTouch *touch, SDL_GestureID gestureId) { if (SDL_GetEventState(SDL_DOLLARRECORD) == SDL_ENABLE) { SDL_Event event; @@ -549,10 +568,9 @@ static void SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId } #endif - -void SDL_GestureProcessEvent(SDL_Event* event) +void SDL_GestureProcessEvent(SDL_Event *event) { - float x,y; + float x, y; #if defined(ENABLE_DOLLAR) int index; int i; @@ -568,10 +586,12 @@ void SDL_GestureProcessEvent(SDL_Event* event) if (event->type == SDL_FINGERMOTION || event->type == SDL_FINGERDOWN || event->type == SDL_FINGERUP) { - SDL_GestureTouch* inTouch = SDL_GetGestureTouch(event->tfinger.touchId); + SDL_GestureTouch *inTouch = SDL_GetGestureTouch(event->tfinger.touchId); /* Shouldn't be possible */ - if (inTouch == NULL) return; + if (!inTouch) { + return; + } x = event->tfinger.x; y = event->tfinger.y; @@ -590,55 +610,54 @@ void SDL_GestureProcessEvent(SDL_Event* event) dollarNormalize(&inTouch->dollarPath, path, SDL_TRUE); /* PrintPath(path); */ if (recordAll) { - index = SDL_AddDollarGesture(NULL,path); - for (i = 0; i < SDL_numGestureTouches; i++) + index = SDL_AddDollarGesture(NULL, path); + for (i = 0; i < SDL_numGestureTouches; i++) { SDL_gestureTouch[i].recording = SDL_FALSE; - } - else { - index = SDL_AddDollarGesture(inTouch,path); + } + } else { + index = SDL_AddDollarGesture(inTouch, path); } if (index >= 0) { - SDL_SendDollarRecord(inTouch,inTouch->dollarTemplate[index].hash); + SDL_SendDollarRecord(inTouch, inTouch->dollarTemplate[index].hash); + } else { + SDL_SendDollarRecord(inTouch, -1); } - else { - SDL_SendDollarRecord(inTouch,-1); - } - } - else { + } else { int bestTempl; float error; error = dollarRecognize(&inTouch->dollarPath, - &bestTempl,inTouch); - if (bestTempl >= 0){ + &bestTempl, inTouch); + if (bestTempl >= 0) { /* Send Event */ - unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash; - SDL_SendGestureDollar(inTouch,gestureId,error); + Sint64 gestureId = inTouch->dollarTemplate[bestTempl].hash; + SDL_SendGestureDollar(inTouch, gestureId, error); /* printf ("%s\n",);("Dollar error: %f\n",error); */ } } #endif /* inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; */ if (inTouch->numDownFingers > 0) { - inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers+1)- - x)/inTouch->numDownFingers; - inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers+1)- - y)/inTouch->numDownFingers; + inTouch->centroid.x = (inTouch->centroid.x * (inTouch->numDownFingers + 1) - + x) / + inTouch->numDownFingers; + inTouch->centroid.y = (inTouch->centroid.y * (inTouch->numDownFingers + 1) - + y) / + inTouch->numDownFingers; } - } - else if (event->type == SDL_FINGERMOTION) { + } else if (event->type == SDL_FINGERMOTION) { float dx = event->tfinger.dx; float dy = event->tfinger.dy; #if defined(ENABLE_DOLLAR) - SDL_DollarPath* path = &inTouch->dollarPath; + SDL_DollarPath *path = &inTouch->dollarPath; if (path->numPoints < MAXPATHSIZE) { path->p[path->numPoints].x = inTouch->centroid.x; path->p[path->numPoints].y = inTouch->centroid.y; pathDx = - (path->p[path->numPoints].x-path->p[path->numPoints-1].x); + (path->p[path->numPoints].x - path->p[path->numPoints - 1].x); pathDy = - (path->p[path->numPoints].y-path->p[path->numPoints-1].y); - path->length += (float)SDL_sqrt(pathDx*pathDx + pathDy*pathDy); + (path->p[path->numPoints].y - path->p[path->numPoints - 1].y); + path->length += (float)SDL_sqrt(pathDx * pathDx + pathDy * pathDy); path->numPoints++; } #endif @@ -646,32 +665,36 @@ void SDL_GestureProcessEvent(SDL_Event* event) lastP.y = y - dy; lastCentroid = inTouch->centroid; - inTouch->centroid.x += dx/inTouch->numDownFingers; - inTouch->centroid.y += dy/inTouch->numDownFingers; + inTouch->centroid.x += dx / inTouch->numDownFingers; + inTouch->centroid.y += dy / inTouch->numDownFingers; /* printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y); */ if (inTouch->numDownFingers > 1) { SDL_FloatPoint lv; /* Vector from centroid to last x,y position */ - SDL_FloatPoint v; /* Vector from centroid to current x,y position */ + SDL_FloatPoint v; /* Vector from centroid to current x,y position */ /* lv = inTouch->gestureLast[j].cv; */ lv.x = lastP.x - lastCentroid.x; lv.y = lastP.y - lastCentroid.y; - lDist = (float)SDL_sqrt(lv.x*lv.x + lv.y*lv.y); + lDist = (float)SDL_sqrt(lv.x * lv.x + lv.y * lv.y); /* printf("lDist = %f\n",lDist); */ v.x = x - inTouch->centroid.x; v.y = y - inTouch->centroid.y; /* inTouch->gestureLast[j].cv = v; */ - Dist = (float)SDL_sqrt(v.x*v.x+v.y*v.y); + Dist = (float)SDL_sqrt(v.x * v.x + v.y * v.y); /* SDL_cos(dTheta) = (v . lv)/(|v| * |lv|) */ /* Normalize Vectors to simplify angle calculation */ - lv.x/=lDist; - lv.y/=lDist; - v.x/=Dist; - v.y/=Dist; - dtheta = (float)SDL_atan2(lv.x*v.y - lv.y*v.x,lv.x*v.x + lv.y*v.y); + lv.x /= lDist; + lv.y /= lDist; + v.x /= Dist; + v.y /= Dist; + dtheta = (float)SDL_atan2(lv.x * v.y - lv.y * v.x, lv.x * v.x + lv.y * v.y); dDist = (Dist - lDist); - if (lDist == 0) {dDist = 0;dtheta = 0;} /* To avoid impossible values */ + if (lDist == 0) { + /* To avoid impossible values */ + dDist = 0; + dtheta = 0; + } /* inTouch->gestureLast[j].dDist = dDist; inTouch->gestureLast[j].dtheta = dtheta; @@ -683,9 +706,8 @@ void SDL_GestureProcessEvent(SDL_Event* event) knob.ang += dtheta; printf("thetaSum = %f, distSum = %f\n",gdtheta,gdDist); printf("id: %i dTheta = %f, dDist = %f\n",j,dtheta,dDist); */ - SDL_SendGestureMulti(inTouch,dtheta,dDist); - } - else { + SDL_SendGestureMulti(inTouch, dtheta, dDist); + } else { /* inTouch->gestureLast[j].dDist = 0; inTouch->gestureLast[j].dtheta = 0; inTouch->gestureLast[j].cv.x = 0; @@ -695,14 +717,15 @@ void SDL_GestureProcessEvent(SDL_Event* event) inTouch->gestureLast[j].f.p.y = y; break; pressure? */ - } - else if (event->type == SDL_FINGERDOWN) { + } else if (event->type == SDL_FINGERDOWN) { inTouch->numDownFingers++; - inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers - 1)+ - x)/inTouch->numDownFingers; - inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers - 1)+ - y)/inTouch->numDownFingers; + inTouch->centroid.x = (inTouch->centroid.x * (inTouch->numDownFingers - 1) + + x) / + inTouch->numDownFingers; + inTouch->centroid.y = (inTouch->centroid.y * (inTouch->numDownFingers - 1) + + y) / + inTouch->numDownFingers; /* printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y, inTouch->centroid.x,inTouch->centroid.y); */ diff --git a/src/events/SDL_gesture_c.h b/src/events/SDL_gesture_c.h index 84855aa88ad6c..b6f450b204925 100644 --- a/src/events/SDL_gesture_c.h +++ b/src/events/SDL_gesture_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ extern int SDL_GestureAddTouch(SDL_TouchID touchId); extern int SDL_GestureDelTouch(SDL_TouchID touchId); -extern void SDL_GestureProcessEvent(SDL_Event* event); +extern void SDL_GestureProcessEvent(SDL_Event *event); extern void SDL_GestureQuit(void); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 30ec14c24333e..6b3e9de6c89c7 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,13 +29,13 @@ #include "../video/SDL_sysvideo.h" #include "scancodes_ascii.h" - /* #define DEBUG_KEYBOARD */ /* Global keyboard information */ -#define KEYBOARD_HARDWARE 0x01 -#define KEYBOARD_AUTORELEASE 0x02 +#define KEYBOARD_HARDWARE 0x01 +#define KEYBOARD_VIRTUAL 0x02 +#define KEYBOARD_AUTORELEASE 0x04 typedef struct SDL_Keyboard SDL_Keyboard; @@ -48,6 +48,7 @@ struct SDL_Keyboard Uint8 keystate[SDL_NUM_SCANCODES]; SDL_Keycode keymap[SDL_NUM_SCANCODES]; SDL_bool autorelease_pending; + Uint32 hardware_timestamp; }; static SDL_Keyboard SDL_keyboard; @@ -641,43 +642,40 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = { }; /* Taken from SDL_iconv() */ -char * -SDL_UCS4ToUTF8(Uint32 ch, char *dst) +char *SDL_UCS4ToUTF8(Uint32 ch, char *dst) { - Uint8 *p = (Uint8 *) dst; + Uint8 *p = (Uint8 *)dst; if (ch <= 0x7F) { - *p = (Uint8) ch; + *p = (Uint8)ch; ++dst; } else if (ch <= 0x7FF) { - p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F); - p[1] = 0x80 | (Uint8) (ch & 0x3F); + p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); + p[1] = 0x80 | (Uint8)(ch & 0x3F); dst += 2; } else if (ch <= 0xFFFF) { - p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F); - p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); - p[2] = 0x80 | (Uint8) (ch & 0x3F); + p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); + p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); + p[2] = 0x80 | (Uint8)(ch & 0x3F); dst += 3; } else { - p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07); - p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); - p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); - p[3] = 0x80 | (Uint8) (ch & 0x3F); + p[0] = 0xF0 | (Uint8)((ch >> 18) & 0x07); + p[1] = 0x80 | (Uint8)((ch >> 12) & 0x3F); + p[2] = 0x80 | (Uint8)((ch >> 6) & 0x3F); + p[3] = 0x80 | (Uint8)(ch & 0x3F); dst += 4; } return dst; } /* Public functions */ -int -SDL_KeyboardInit(void) +int SDL_KeyboardInit(void) { /* Set the default keymap */ SDL_SetKeymap(0, SDL_default_keymap, SDL_NUM_SCANCODES, SDL_FALSE); return 0; } -void -SDL_ResetKeyboard(void) +void SDL_ResetKeyboard(void) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; @@ -685,39 +683,58 @@ SDL_ResetKeyboard(void) #ifdef DEBUG_KEYBOARD printf("Resetting keyboard\n"); #endif - for (scancode = (SDL_Scancode) 0; scancode < SDL_NUM_SCANCODES; ++scancode) { + for (scancode = (SDL_Scancode)0; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keystate[scancode] == SDL_PRESSED) { SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } } -void -SDL_GetDefaultKeymap(SDL_Keycode * keymap) +void SDL_GetDefaultKeymap(SDL_Keycode *keymap) { SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap)); } -void -SDL_SetKeymap(int start, const SDL_Keycode * keys, int length, SDL_bool send_event) +void SDL_SetKeymap(int start, const SDL_Keycode *keys, int length, SDL_bool send_event) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; SDL_Keycode normalized_keymap[SDL_NUM_SCANCODES]; + SDL_bool is_azerty = SDL_FALSE; if (start < 0 || start + length > SDL_NUM_SCANCODES) { return; } + if (start > 0) { + SDL_memcpy(&normalized_keymap[0], &keyboard->keymap[0], sizeof(*keys) * start); + } + SDL_memcpy(&normalized_keymap[start], keys, sizeof(*keys) * length); - /* The number key scancodes always map to the number key keycodes. - * On AZERTY layouts these technically are symbols, but users (and games) - * always think of them and view them in UI as number keys. + if (start + length < SDL_NUM_SCANCODES) { + int offset = start + length; + SDL_memcpy(&normalized_keymap[offset], &keyboard->keymap[offset], sizeof(*keys) * (SDL_NUM_SCANCODES - offset)); + } + + /* On AZERTY layouts the number keys are technically symbols, but users (and games) + * always think of them and view them in UI as number keys, so remap them here. */ - normalized_keymap[SDL_SCANCODE_0] = SDLK_0; - for (scancode = SDL_SCANCODE_1; scancode <= SDL_SCANCODE_9; ++scancode) { - normalized_keymap[scancode] = SDLK_1 + (scancode - SDL_SCANCODE_1); + if (normalized_keymap[SDL_SCANCODE_0] < SDLK_0 || normalized_keymap[SDL_SCANCODE_0] > SDLK_9) { + is_azerty = SDL_TRUE; + for (scancode = SDL_SCANCODE_1; scancode <= SDL_SCANCODE_9; ++scancode) { + if (normalized_keymap[scancode] >= SDLK_0 && normalized_keymap[scancode] <= SDLK_9) { + /* There's a number on this row, it's not AZERTY */ + is_azerty = SDL_FALSE; + break; + } + } + } + if (is_azerty) { + normalized_keymap[SDL_SCANCODE_0] = SDLK_0; + for (scancode = SDL_SCANCODE_1; scancode <= SDL_SCANCODE_9; ++scancode) { + normalized_keymap[scancode] = SDLK_1 + (scancode - SDL_SCANCODE_1); + } } /* If the mapping didn't really change, we're done here */ @@ -732,8 +749,7 @@ SDL_SetKeymap(int start, const SDL_Keycode * keys, int length, SDL_bool send_eve } } -void -SDL_SetScancodeName(SDL_Scancode scancode, const char *name) +void SDL_SetScancodeName(SDL_Scancode scancode, const char *name) { if (scancode >= SDL_NUM_SCANCODES) { return; @@ -741,16 +757,14 @@ SDL_SetScancodeName(SDL_Scancode scancode, const char *name) SDL_scancode_names[scancode] = name; } -SDL_Window * -SDL_GetKeyboardFocus(void) +SDL_Window *SDL_GetKeyboardFocus(void) { SDL_Keyboard *keyboard = &SDL_keyboard; return keyboard->focus; } -void -SDL_SetKeyboardFocus(SDL_Window * window) +void SDL_SetKeyboardFocus(SDL_Window *window) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -763,11 +777,11 @@ SDL_SetKeyboardFocus(SDL_Window * window) if (keyboard->focus && keyboard->focus != window) { /* new window shouldn't think it has mouse captured. */ - SDL_assert(!window || !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)); + SDL_assert(window == NULL || !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)); /* old window must lose an existing mouse capture. */ if (keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE) { - SDL_CaptureMouse(SDL_FALSE); /* drop the capture. */ + SDL_CaptureMouse(SDL_FALSE); /* drop the capture. */ SDL_UpdateMouseCapture(SDL_TRUE); SDL_assert(!(keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE)); } @@ -799,8 +813,7 @@ SDL_SetKeyboardFocus(SDL_Window * window) } } -static int -SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) +static int SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -854,7 +867,9 @@ SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode, SD keycode = keyboard->keymap[scancode]; } - if (source == KEYBOARD_AUTORELEASE) { + if (source == KEYBOARD_HARDWARE) { + keyboard->hardware_timestamp = SDL_GetTicks(); + } else if (source == KEYBOARD_AUTORELEASE) { keyboard->autorelease_pending = SDL_TRUE; } @@ -934,16 +949,15 @@ SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode, SD (keyboard->focus->flags & SDL_WINDOW_KEYBOARD_GRABBED) && (keyboard->focus->flags & SDL_WINDOW_FULLSCREEN) && SDL_GetHintBoolean(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, SDL_TRUE)) { - /* We will temporarily forfeit our grab by minimizing our window, + /* We will temporarily forfeit our grab by minimizing our window, allowing the user to escape the application */ SDL_MinimizeWindow(keyboard->focus); } - return (posted); + return posted; } -int -SDL_SendKeyboardUnicodeKey(Uint32 ch) +int SDL_SendKeyboardUnicodeKey(Uint32 ch) { SDL_Scancode code = SDL_SCANCODE_UNKNOWN; uint16_t mod = 0; @@ -955,40 +969,41 @@ SDL_SendKeyboardUnicodeKey(Uint32 ch) if (mod & KMOD_SHIFT) { /* If the character uses shift, press shift down */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKeyInternal(KEYBOARD_VIRTUAL, SDL_PRESSED, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN); } /* Send a keydown and keyup for the character */ - SDL_SendKeyboardKey(SDL_PRESSED, code); - SDL_SendKeyboardKey(SDL_RELEASED, code); + SDL_SendKeyboardKeyInternal(KEYBOARD_VIRTUAL, SDL_PRESSED, code, SDLK_UNKNOWN); + SDL_SendKeyboardKeyInternal(KEYBOARD_VIRTUAL, SDL_RELEASED, code, SDLK_UNKNOWN); if (mod & KMOD_SHIFT) { /* If the character uses shift, release shift */ - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKeyInternal(KEYBOARD_VIRTUAL, SDL_RELEASED, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN); } return 0; } -int -SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) +int SDL_SendVirtualKeyboardKey(Uint8 state, SDL_Scancode scancode) +{ + return SDL_SendKeyboardKeyInternal(KEYBOARD_VIRTUAL, state, scancode, SDLK_UNKNOWN); +} + +int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode) { return SDL_SendKeyboardKeyInternal(KEYBOARD_HARDWARE, state, scancode, SDLK_UNKNOWN); } -int -SDL_SendKeyboardKeyAndKeycode(Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) +int SDL_SendKeyboardKeyAndKeycode(Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) { return SDL_SendKeyboardKeyInternal(KEYBOARD_HARDWARE, state, scancode, keycode); } -int -SDL_SendKeyboardKeyAutoRelease(SDL_Scancode scancode) +int SDL_SendKeyboardKeyAutoRelease(SDL_Scancode scancode) { return SDL_SendKeyboardKeyInternal(KEYBOARD_AUTORELEASE, SDL_PRESSED, scancode, SDLK_UNKNOWN); } -void -SDL_ReleaseAutoReleaseKeys(void) +void SDL_ReleaseAutoReleaseKeys(void) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; @@ -1001,24 +1016,30 @@ SDL_ReleaseAutoReleaseKeys(void) } keyboard->autorelease_pending = SDL_FALSE; } + + if (keyboard->hardware_timestamp) { + /* Keep hardware keyboard "active" for 250 ms */ + if (SDL_TICKS_PASSED(SDL_GetTicks(), keyboard->hardware_timestamp + 250)) { + keyboard->hardware_timestamp = 0; + } + } } -SDL_bool -SDL_HardwareKeyboardKeyPressed(void) +SDL_bool SDL_HardwareKeyboardKeyPressed(void) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) { - if ((keyboard->keysource[scancode] & KEYBOARD_HARDWARE) != 0) { + if (keyboard->keysource[scancode] & KEYBOARD_HARDWARE) { return SDL_TRUE; } } - return SDL_FALSE; + + return keyboard->hardware_timestamp ? SDL_TRUE : SDL_FALSE; } -int -SDL_SendKeyboardText(const char *text) +int SDL_SendKeyboardText(const char *text) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -1045,11 +1066,10 @@ SDL_SendKeyboardText(const char *text) posted |= (SDL_PushEvent(&event) > 0); } } - return (posted); + return posted; } -int -SDL_SendEditingText(const char *text, int start, int length) +int SDL_SendEditingText(const char *text, int start, int length) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -1076,35 +1096,31 @@ SDL_SendEditingText(const char *text, int start, int length) posted = (SDL_PushEvent(&event) > 0); } - return (posted); + return posted; } -void -SDL_KeyboardQuit(void) +void SDL_KeyboardQuit(void) { } -const Uint8 * -SDL_GetKeyboardState(int *numkeys) +const Uint8 *SDL_GetKeyboardState(int *numkeys) { SDL_Keyboard *keyboard = &SDL_keyboard; - if (numkeys != (int *) 0) { + if (numkeys != (int *)0) { *numkeys = SDL_NUM_SCANCODES; } return keyboard->keystate; } -SDL_Keymod -SDL_GetModState(void) +SDL_Keymod SDL_GetModState(void) { SDL_Keyboard *keyboard = &SDL_keyboard; - return (SDL_Keymod) keyboard->modstate; + return (SDL_Keymod)keyboard->modstate; } -void -SDL_SetModState(SDL_Keymod modstate) +void SDL_SetModState(SDL_Keymod modstate) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -1112,8 +1128,7 @@ SDL_SetModState(SDL_Keymod modstate) } /* Note that SDL_ToggleModState() is not a public API. SDL_SetModState() is. */ -void -SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle) +void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle) { SDL_Keyboard *keyboard = &SDL_keyboard; if (toggle) { @@ -1123,22 +1138,19 @@ SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle) } } - -SDL_Keycode -SDL_GetKeyFromScancode(SDL_Scancode scancode) +SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - SDL_InvalidParamError("scancode"); - return 0; + SDL_InvalidParamError("scancode"); + return 0; } return keyboard->keymap[scancode]; } -SDL_Keycode -SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) +SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) { if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { SDL_InvalidParamError("scancode"); @@ -1148,8 +1160,7 @@ SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) return SDL_default_keymap[scancode]; } -SDL_Scancode -SDL_GetScancodeFromKey(SDL_Keycode key) +SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) { SDL_Keyboard *keyboard = &SDL_keyboard; SDL_Scancode scancode; @@ -1163,20 +1174,20 @@ SDL_GetScancodeFromKey(SDL_Keycode key) return SDL_SCANCODE_UNKNOWN; } -const char * -SDL_GetScancodeName(SDL_Scancode scancode) +const char *SDL_GetScancodeName(SDL_Scancode scancode) { const char *name; if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - SDL_InvalidParamError("scancode"); - return ""; + SDL_InvalidParamError("scancode"); + return ""; } name = SDL_scancode_names[scancode]; - if (name) + if (name) { return name; - else - return ""; + } + + return ""; } SDL_Scancode SDL_GetScancodeFromName(const char *name) @@ -1184,7 +1195,7 @@ SDL_Scancode SDL_GetScancodeFromName(const char *name) int i; if (!name || !*name) { - SDL_InvalidParamError("name"); + SDL_InvalidParamError("name"); return SDL_SCANCODE_UNKNOWN; } @@ -1201,15 +1212,13 @@ SDL_Scancode SDL_GetScancodeFromName(const char *name) return SDL_SCANCODE_UNKNOWN; } -const char * -SDL_GetKeyName(SDL_Keycode key) +const char *SDL_GetKeyName(SDL_Keycode key) { static char name[8]; char *end; if (key & SDLK_SCANCODE_MASK) { - return - SDL_GetScancodeName((SDL_Scancode) (key & ~SDLK_SCANCODE_MASK)); + return SDL_GetScancodeName((SDL_Scancode)(key & ~SDLK_SCANCODE_MASK)); } switch (key) { @@ -1234,19 +1243,18 @@ SDL_GetKeyName(SDL_Keycode key) key -= 32; } - end = SDL_UCS4ToUTF8((Uint32) key, name); + end = SDL_UCS4ToUTF8((Uint32)key, name); *end = '\0'; return name; } } -SDL_Keycode -SDL_GetKeyFromName(const char *name) +SDL_Keycode SDL_GetKeyFromName(const char *name) { SDL_Keycode key; /* Check input */ - if (name == NULL) { + if (!name) { return SDLK_UNKNOWN; } @@ -1255,27 +1263,27 @@ SDL_GetKeyFromName(const char *name) if (key >= 0xF0) { if (SDL_strlen(name) == 4) { int i = 0; - key = (Uint16)(name[i]&0x07) << 18; - key |= (Uint16)(name[++i]&0x3F) << 12; - key |= (Uint16)(name[++i]&0x3F) << 6; - key |= (Uint16)(name[++i]&0x3F); + key = (Uint16)(name[i] & 0x07) << 18; + key |= (Uint16)(name[++i] & 0x3F) << 12; + key |= (Uint16)(name[++i] & 0x3F) << 6; + key |= (Uint16)(name[++i] & 0x3F); return key; } return SDLK_UNKNOWN; } else if (key >= 0xE0) { if (SDL_strlen(name) == 3) { int i = 0; - key = (Uint16)(name[i]&0x0F) << 12; - key |= (Uint16)(name[++i]&0x3F) << 6; - key |= (Uint16)(name[++i]&0x3F); + key = (Uint16)(name[i] & 0x0F) << 12; + key |= (Uint16)(name[++i] & 0x3F) << 6; + key |= (Uint16)(name[++i] & 0x3F); return key; } return SDLK_UNKNOWN; } else if (key >= 0xC0) { if (SDL_strlen(name) == 2) { int i = 0; - key = (Uint16)(name[i]&0x1F) << 6; - key |= (Uint16)(name[++i]&0x3F); + key = (Uint16)(name[i] & 0x1F) << 6; + key |= (Uint16)(name[++i] & 0x3F); return key; } return SDLK_UNKNOWN; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 3ace4af641864..bbad0867632f1 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,13 +30,13 @@ extern int SDL_KeyboardInit(void); /* Get the default keymap */ -extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap); +extern void SDL_GetDefaultKeymap(SDL_Keycode *keymap); /* Get the default key code for a scancode */ extern SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode); /* Set the mapping of scancode to key codes */ -extern void SDL_SetKeymap(int start, const SDL_Keycode * keys, int length, SDL_bool send_event); +extern void SDL_SetKeymap(int start, const SDL_Keycode *keys, int length, SDL_bool send_event); /* Set a platform-dependent key name, overriding the default platform-agnostic name. Encoded as UTF-8. The string is not copied, thus the pointer given to @@ -45,13 +45,16 @@ extern void SDL_SetKeymap(int start, const SDL_Keycode * keys, int length, SDL_b extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name); /* Set the keyboard focus window */ -extern void SDL_SetKeyboardFocus(SDL_Window * window); +extern void SDL_SetKeyboardFocus(SDL_Window *window); /* Send a character from an on-screen keyboard as scancode and modifier key events, currently assuming ASCII characters on a US keyboard layout */ extern int SDL_SendKeyboardUnicodeKey(Uint32 ch); +/* Send a key from a virtual key source, like an on-screen keyboard */ +extern int SDL_SendVirtualKeyboardKey(Uint8 state, SDL_Scancode scancode); + /* Send a keyboard key event */ extern int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode); extern int SDL_SendKeyboardKeyAutoRelease(SDL_Scancode scancode); @@ -70,7 +73,7 @@ extern SDL_bool SDL_HardwareKeyboardKeyPressed(void); extern int SDL_SendKeyboardText(const char *text); /* Send editing text for selected range from start to end */ -extern int SDL_SendEditingText(const char *text, int start, int end); +extern int SDL_SendEditingText(const char *text, int start, int length); /* Shutdown the keyboard subsystem */ extern void SDL_KeyboardQuit(void); diff --git a/src/events/SDL_keysym_to_scancode.c b/src/events/SDL_keysym_to_scancode.c index c1c1ba626d467..7bd91c0b86eb3 100644 --- a/src/events/SDL_keysym_to_scancode.c +++ b/src/events/SDL_keysym_to_scancode.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_X11 +#if defined(SDL_VIDEO_DRIVER_WAYLAND) || defined(SDL_VIDEO_DRIVER_X11) #include "SDL_keyboard_c.h" #include "SDL_scancode_tables_c.h" @@ -238,8 +238,8 @@ static const Uint32 LinuxKeycodeKeysyms[] = { /* 176, 0x0b0 */ 0x0, /* NoSymbol */ /* 177, 0x0b1 */ 0x1008FF78, /* XF86ScrollUp */ /* 178, 0x0b2 */ 0x1008FF79, /* XF86ScrollDown */ - /* 179, 0x0b3 */ 0x28, /* parenleft */ - /* 180, 0x0b4 */ 0x29, /* parenright */ + /* 179, 0x0b3 */ 0x0, /* NoSymbol */ + /* 180, 0x0b4 */ 0x0, /* NoSymbol */ /* 181, 0x0b5 */ 0x1008FF68, /* XF86New */ /* 182, 0x0b6 */ 0xFF66, /* Redo */ /* 183, 0x0b7 */ 0xFFCA, /* F13 */ @@ -316,11 +316,11 @@ function process_line { sym=$(echo "$1" | awk '{print $3}') code=$(echo "$1" | sed 's,.*_EVDEVK(\(0x[0-9A-Fa-f]*\)).*,\1,') - value=$(egrep "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}') + value=$(grep -E "#define ${sym}\s" -R /usr/include/X11 | awk '{print $3}') printf " { 0x%.8X, 0x%.3x }, /* $sym */\n" $value $code } -fgrep "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | fgrep _EVDEVK | while read line; do +grep -F "/* Use: " /usr/include/xkbcommon/xkbcommon-keysyms.h | grep -F _EVDEVK | while read line; do process_line "$line" done #endif @@ -387,8 +387,7 @@ static const struct { }; /* *INDENT-ON* */ /* clang-format on */ -SDL_Scancode -SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode) +SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode) { int i; Uint32 linux_keycode = 0; diff --git a/src/events/SDL_keysym_to_scancode_c.h b/src/events/SDL_keysym_to_scancode_c.h index d2feb8c7fb434..e11dde088551c 100644 --- a/src/events/SDL_keysym_to_scancode_c.h +++ b/src/events/SDL_keysym_to_scancode_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 994b6a6db21c0..3eec659ede5e5 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ #include "../SDL_hints_c.h" #include "../video/SDL_sysvideo.h" #if defined(__WIN32__) || defined(__GDK__) -#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime() +#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime() #endif #if defined(__OS2__) #define INCL_WIN @@ -44,11 +44,9 @@ static SDL_Mouse SDL_mouse; /* for mapping mouse events to touch */ static SDL_bool track_mouse_down = SDL_FALSE; -static int -SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y); +static int SDL_PrivateSendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y); -static void SDLCALL -SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; @@ -65,20 +63,18 @@ SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *ol } } -static void SDLCALL -SDL_MouseDoubleClickRadiusChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseDoubleClickRadiusChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; if (hint && *hint) { mouse->double_click_radius = SDL_atoi(hint); } else { - mouse->double_click_radius = 32; /* 32 pixels seems about right for touch interfaces */ + mouse->double_click_radius = 32; /* 32 pixels seems about right for touch interfaces */ } } -static void SDLCALL -SDL_MouseNormalSpeedScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseNormalSpeedScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; @@ -91,8 +87,7 @@ SDL_MouseNormalSpeedScaleChanged(void *userdata, const char *name, const char *o } } -static void SDLCALL -SDL_MouseRelativeSpeedScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseRelativeSpeedScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; @@ -105,16 +100,14 @@ SDL_MouseRelativeSpeedScaleChanged(void *userdata, const char *name, const char } } -static void SDLCALL -SDL_MouseRelativeSystemScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseRelativeSystemScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; mouse->enable_relative_system_scale = SDL_GetStringBoolean(hint, SDL_FALSE); } -static void SDLCALL -SDL_TouchMouseEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_TouchMouseEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; @@ -122,29 +115,27 @@ SDL_TouchMouseEventsChanged(void *userdata, const char *name, const char *oldVal } #if defined(__vita__) -static void SDLCALL -SDL_VitaTouchMouseDeviceChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_VitaTouchMouseDeviceChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; if (hint) { - switch(*hint) { + switch (*hint) { default: case '0': - mouse->vita_touch_mouse_device = 0; + mouse->vita_touch_mouse_device = 1; break; case '1': - mouse->vita_touch_mouse_device = 1; + mouse->vita_touch_mouse_device = 2; break; case '2': - mouse->vita_touch_mouse_device = 2; + mouse->vita_touch_mouse_device = 3; break; } } } #endif -static void SDLCALL -SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; SDL_bool default_value; @@ -161,8 +152,7 @@ SDL_MouseTouchEventsChanged(void *userdata, const char *name, const char *oldVal } } -static void SDLCALL -SDL_MouseAutoCaptureChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseAutoCaptureChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; SDL_bool auto_capture = SDL_GetStringBoolean(hint, SDL_TRUE); @@ -173,17 +163,22 @@ SDL_MouseAutoCaptureChanged(void *userdata, const char *name, const char *oldVal } } -static void SDLCALL -SDL_MouseRelativeWarpMotionChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_MouseRelativeWarpMotionChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; mouse->relative_mode_warp_motion = SDL_GetStringBoolean(hint, SDL_FALSE); } +static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + SDL_Mouse *mouse = (SDL_Mouse *)userdata; + + mouse->relative_mode_cursor_visible = SDL_GetStringBoolean(hint, SDL_FALSE); +} + /* Public functions */ -int -SDL_MouseInit(void) +int SDL_MousePreInit(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -221,26 +216,78 @@ SDL_MouseInit(void) SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION, SDL_MouseRelativeWarpMotionChanged, mouse); + SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE, + SDL_MouseRelativeCursorVisibleChanged, mouse); + mouse->was_touch_mouse_events = SDL_FALSE; /* no touch to mouse movement event pending */ mouse->cursor_shown = SDL_TRUE; - return (0); + return 0; } -void -SDL_SetDefaultCursor(SDL_Cursor * cursor) +void SDL_MousePostInit(void) { SDL_Mouse *mouse = SDL_GetMouse(); + /* Create a dummy mouse cursor for video backends that don't support true cursors, + * so that mouse grab and focus functionality will work. + */ + if (!mouse->def_cursor) { + SDL_Surface *surface = SDL_CreateRGBSurface(0, 1, 1, 32, 0xFF, 0xFF, 0xFF, 0xFF); + if (surface) { + SDL_memset(surface->pixels, 0, (size_t)surface->h * surface->pitch); + SDL_SetDefaultCursor(SDL_CreateColorCursor(surface, 0, 0)); + SDL_FreeSurface(surface); + } + } +} + +void SDL_SetDefaultCursor(SDL_Cursor *cursor) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (cursor == mouse->def_cursor) { + return; + } + + if (mouse->def_cursor) { + SDL_Cursor *default_cursor = mouse->def_cursor; + SDL_Cursor *prev, *curr; + + if (mouse->cur_cursor == mouse->def_cursor) { + mouse->cur_cursor = NULL; + } + mouse->def_cursor = NULL; + + for (prev = NULL, curr = mouse->cursors; curr; + prev = curr, curr = curr->next) { + if (curr == default_cursor) { + if (prev) { + prev->next = curr->next; + } else { + mouse->cursors = curr->next; + } + + break; + } + } + + if (mouse->FreeCursor && default_cursor->driverdata) { + mouse->FreeCursor(default_cursor); + } else { + SDL_free(default_cursor); + } + } + mouse->def_cursor = cursor; + if (!mouse->cur_cursor) { SDL_SetCursor(cursor); } } -SDL_Mouse * -SDL_GetMouse(void) +SDL_Mouse *SDL_GetMouse(void) { return &SDL_mouse; } @@ -258,8 +305,7 @@ static Uint32 GetButtonState(SDL_Mouse *mouse, SDL_bool include_touch) return buttonstate; } -SDL_Window * -SDL_GetMouseFocus(void) +SDL_Window *SDL_GetMouseFocus(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -274,8 +320,7 @@ SDL_GetMouseFocus(void) * -flibit */ #if 0 -void -SDL_ResetMouse(void) +void SDL_ResetMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); Uint32 buttonState = GetButtonState(mouse, SDL_FALSE); @@ -290,8 +335,7 @@ SDL_ResetMouse(void) } #endif /* 0 */ -void -SDL_SetMouseFocus(SDL_Window * window) +void SDL_SetMouseFocus(SDL_Window *window) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -328,13 +372,12 @@ SDL_SetMouseFocus(SDL_Window * window) } /* Check to see if we need to synthesize focus events */ -static SDL_bool -SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate, SDL_bool send_mouse_motion) +static SDL_bool SDL_UpdateMouseFocus(SDL_Window *window, int x, int y, Uint32 buttonstate, SDL_bool send_mouse_motion) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_bool inWindow = SDL_TRUE; - if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) { + if (window && !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)) { int w, h; SDL_GetWindowSize(window, &w, &h); if (x < 0 || y < 0 || x >= w || y >= h) { @@ -367,8 +410,7 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate, SDL_ return SDL_TRUE; } -int -SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) +int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y) { if (window && !relative) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -380,8 +422,7 @@ SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int return SDL_PrivateSendMouseMotion(window, mouseID, relative, x, y); } -static int -GetScaledMouseDelta(float scale, int value, float *accum) +static int GetScaledMouseDelta(float scale, int value, float *accum) { if (value && scale != 1.0f) { if ((value > 0) != (*accum > 0)) { @@ -398,8 +439,7 @@ GetScaledMouseDelta(float scale, int value, float *accum) return value; } -static float -CalculateSystemScale(SDL_Mouse *mouse, int *x, int *y) +static float CalculateSystemScale(SDL_Mouse *mouse, const int *x, const int *y) { int i; int n = mouse->num_system_scale_values; @@ -430,8 +470,7 @@ CalculateSystemScale(SDL_Mouse *mouse, int *x, int *y) } /* You can set either a single scale, or a set of {speed, scale} values in ascending order */ -int -SDL_SetMouseSystemScale(int num_values, const float *values) +int SDL_SetMouseSystemScale(int num_values, const float *values) { SDL_Mouse *mouse = SDL_GetMouse(); float *v; @@ -472,8 +511,7 @@ SDL_SetMouseSystemScale(int num_values, const float *values) return 0; } -static void -GetScaledMouseDeltas(SDL_Mouse *mouse, int *x, int *y) +static void GetScaledMouseDeltas(SDL_Mouse *mouse, int *x, int *y) { if (mouse->relative_mode) { if (mouse->enable_relative_speed_scale) { @@ -492,8 +530,7 @@ GetScaledMouseDeltas(SDL_Mouse *mouse, int *x, int *y) } } -static int -SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) +static int SDL_PrivateSendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); int posted; @@ -530,7 +567,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ return 0; } } else { - if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS) != 0) { + if (window && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { if (mouse->WarpMouse) { mouse->WarpMouse(window, center_x, center_y); } else { @@ -556,7 +593,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ mouse->x = x; mouse->y = y; mouse->has_position = SDL_TRUE; - } else if (!xrel && !yrel) { /* Drop events that don't change state */ + } else if (!xrel && !yrel) { /* Drop events that don't change state */ #ifdef DEBUG_MOUSE SDL_Log("Mouse event didn't change state - dropped!\n"); #endif @@ -580,7 +617,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ /* make sure that the pointers find themselves inside the windows, unless we have the mouse captured. */ - if (window && ((window->flags & SDL_WINDOW_MOUSE_CAPTURE) == 0)) { + if (window && !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)) { int x_min = 0, x_max = 0; int y_min = 0, y_max = 0; const SDL_Rect *confine = SDL_GetWindowMouseRect(window); @@ -637,7 +674,7 @@ SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relativ event.motion.windowID = mouse->focus ? mouse->focus->id : 0; event.motion.which = mouseID; /* Set us pending (or clear during a normal mouse movement event) as having triggered */ - mouse->was_touch_mouse_events = (mouseID == SDL_TOUCH_MOUSEID)? SDL_TRUE : SDL_FALSE; + mouse->was_touch_mouse_events = (mouseID == SDL_TOUCH_MOUSEID) ? SDL_TRUE : SDL_FALSE; event.motion.state = GetButtonState(mouse, SDL_TRUE); event.motion.x = mouse->x; event.motion.y = mouse->y; @@ -668,7 +705,7 @@ static SDL_MouseInputSource *GetMouseInputSource(SDL_Mouse *mouse, SDL_MouseID m } } - sources = (SDL_MouseInputSource *)SDL_realloc(mouse->sources, (mouse->num_sources + 1)*sizeof(*mouse->sources)); + sources = (SDL_MouseInputSource *)SDL_realloc(mouse->sources, (mouse->num_sources + 1) * sizeof(*mouse->sources)); if (sources) { mouse->sources = sources; ++mouse->num_sources; @@ -698,8 +735,7 @@ static SDL_MouseClickState *GetMouseClickState(SDL_Mouse *mouse, Uint8 button) return &mouse->clickstate[button]; } -static int -SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks) +static int SDL_PrivateSendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks) { SDL_Mouse *mouse = SDL_GetMouse(); int posted; @@ -795,7 +831,7 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state event.button.which = mouseID; event.button.state = state; event.button.button = button; - event.button.clicks = (Uint8) SDL_min(clicks, 255); + event.button.clicks = (Uint8)SDL_min(clicks, 255); event.button.x = mouse->x; event.button.y = mouse->y; posted = (SDL_PushEvent(&event) > 0); @@ -814,21 +850,18 @@ SDL_PrivateSendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state return posted; } -int -SDL_SendMouseButtonClicks(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks) +int SDL_SendMouseButtonClicks(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks) { clicks = SDL_max(clicks, 0); return SDL_PrivateSendMouseButton(window, mouseID, state, button, clicks); } -int -SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button) +int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button) { return SDL_PrivateSendMouseButton(window, mouseID, state, button, -1); } -int -SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction) +int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction) { SDL_Mouse *mouse = SDL_GetMouse(); int posted; @@ -899,8 +932,7 @@ SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, S return posted; } -void -SDL_MouseQuit(void) +void SDL_MouseQuit(void) { SDL_Cursor *cursor, *next; SDL_Mouse *mouse = SDL_GetMouse(); @@ -938,6 +970,12 @@ SDL_MouseQuit(void) } mouse->num_clickstates = 0; + if (mouse->system_scale_values) { + SDL_free(mouse->system_scale_values); + mouse->system_scale_values = NULL; + } + mouse->num_system_scale_values = 0; + SDL_DelHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_TIME, SDL_MouseDoubleClickTimeChanged, mouse); @@ -964,10 +1002,12 @@ SDL_MouseQuit(void) SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION, SDL_MouseRelativeWarpMotionChanged, mouse); + + SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE, + SDL_MouseRelativeCursorVisibleChanged, mouse); } -Uint32 -SDL_GetMouseState(int *x, int *y) +Uint32 SDL_GetMouseState(int *x, int *y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -980,8 +1020,7 @@ SDL_GetMouseState(int *x, int *y) return GetButtonState(mouse, SDL_TRUE); } -Uint32 -SDL_GetRelativeMouseState(int *x, int *y) +Uint32 SDL_GetRelativeMouseState(int *x, int *y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -996,8 +1035,7 @@ SDL_GetRelativeMouseState(int *x, int *y) return GetButtonState(mouse, SDL_TRUE); } -Uint32 -SDL_GetGlobalMouseState(int *x, int *y) +Uint32 SDL_GetGlobalMouseState(int *x, int *y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1020,16 +1058,15 @@ SDL_GetGlobalMouseState(int *x, int *y) } } -void -SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_relative_mode) +void SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_relative_mode) { SDL_Mouse *mouse = SDL_GetMouse(); - if (window == NULL) { + if (!window) { window = mouse->focus; } - if (window == NULL) { + if (!window) { return; } @@ -1066,14 +1103,12 @@ SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_r } } -void -SDL_WarpMouseInWindow(SDL_Window * window, int x, int y) +void SDL_WarpMouseInWindow(SDL_Window *window, int x, int y) { SDL_PerformWarpMouseInWindow(window, x, y, SDL_FALSE); } -int -SDL_WarpMouseGlobal(int x, int y) +int SDL_WarpMouseGlobal(int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1084,9 +1119,17 @@ SDL_WarpMouseGlobal(int x, int y) return SDL_Unsupported(); } -static SDL_bool -ShouldUseRelativeModeWarp(SDL_Mouse *mouse) +static SDL_bool ShouldUseRelativeModeWarp(SDL_Mouse *mouse) { +#ifdef SDL_VIDEO_DRIVER_WAYLAND + SDL_VideoDevice *vid = SDL_GetVideoDevice(); + + /* Wayland can't warp the mouse, but uses this hint internally to deliver accelerated motion */ + if (SDL_strcmp(vid->name, "wayland") == 0) { + return SDL_FALSE; + } +#endif + if (!mouse->WarpMouse) { /* Need this functionality for relative mode warp implementation */ return SDL_FALSE; @@ -1095,8 +1138,7 @@ ShouldUseRelativeModeWarp(SDL_Mouse *mouse) return SDL_GetHintBoolean(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, SDL_FALSE); } -int -SDL_SetRelativeMouseMode(SDL_bool enabled) +int SDL_SetRelativeMouseMode(SDL_bool enabled) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Window *focusWindow = SDL_GetKeyboardFocus(); @@ -1132,7 +1174,7 @@ SDL_SetRelativeMouseMode(SDL_bool enabled) SDL_SetMouseFocus(focusWindow); if (mouse->relative_mode_warp) { - SDL_PerformWarpMouseInWindow(focusWindow, focusWindow->w/2, focusWindow->h/2, SDL_TRUE); + SDL_PerformWarpMouseInWindow(focusWindow, focusWindow->w / 2, focusWindow->h / 2, SDL_TRUE); } } @@ -1158,16 +1200,14 @@ SDL_SetRelativeMouseMode(SDL_bool enabled) return 0; } -SDL_bool -SDL_GetRelativeMouseMode() +SDL_bool SDL_GetRelativeMouseMode(void) { SDL_Mouse *mouse = SDL_GetMouse(); return mouse->relative_mode; } -int -SDL_UpdateMouseCapture(SDL_bool force_release) +int SDL_UpdateMouseCapture(SDL_bool force_release) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Window *capture_window = NULL; @@ -1218,8 +1258,7 @@ SDL_UpdateMouseCapture(SDL_bool force_release) return 0; } -int -SDL_CaptureMouse(SDL_bool enabled) +int SDL_CaptureMouse(SDL_bool enabled) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1246,8 +1285,7 @@ SDL_CaptureMouse(SDL_bool enabled) return SDL_UpdateMouseCapture(SDL_FALSE); } -SDL_Cursor * -SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, +SDL_Cursor *SDL_CreateCursor(const Uint8 *data, const Uint8 *mask, int w, int h, int hot_x, int hot_y) { SDL_Surface *surface; @@ -1272,7 +1310,7 @@ SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, return NULL; } for (y = 0; y < h; ++y) { - pixel = (Uint32 *) ((Uint8 *) surface->pixels + y * surface->pitch); + pixel = (Uint32 *)((Uint8 *)surface->pixels + y * surface->pitch); for (x = 0; x < w; ++x) { if ((x % 8) == 0) { datab = *data++; @@ -1295,8 +1333,7 @@ SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, return cursor; } -SDL_Cursor * -SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) +SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Surface *temp = NULL; @@ -1307,11 +1344,6 @@ SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) return NULL; } - if (!mouse->CreateCursor) { - SDL_SetError("Cursors are not currently supported"); - return NULL; - } - /* Sanity check the hot spot */ if ((hot_x < 0) || (hot_y < 0) || (hot_x >= surface->w) || (hot_y >= surface->h)) { @@ -1327,7 +1359,15 @@ SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) surface = temp; } - cursor = mouse->CreateCursor(surface, hot_x, hot_y); + if (mouse->CreateCursor) { + cursor = mouse->CreateCursor(surface, hot_x, hot_y); + } else { + cursor = SDL_calloc(1, sizeof(*cursor)); + if (!cursor) { + SDL_OutOfMemory(); + } + } + if (cursor) { cursor->next = mouse->cursors; mouse->cursors = cursor; @@ -1338,8 +1378,7 @@ SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) return cursor; } -SDL_Cursor * -SDL_CreateSystemCursor(SDL_SystemCursor id) +SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Cursor *cursor; @@ -1362,11 +1401,15 @@ SDL_CreateSystemCursor(SDL_SystemCursor id) if this is desired for any reason. This is used when setting the video mode and when the SDL window gains the mouse focus. */ -void -SDL_SetCursor(SDL_Cursor * cursor) +void SDL_SetCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); + /* Return immediately if setting the cursor to the currently set one (fixes #7151) */ + if (cursor == mouse->cur_cursor) { + return; + } + /* Set the new cursor */ if (cursor) { /* Make sure the cursor is still valid for this mouse */ @@ -1391,7 +1434,7 @@ SDL_SetCursor(SDL_Cursor * cursor) } } - if (cursor && mouse->cursor_shown && !mouse->relative_mode) { + if (cursor && mouse->cursor_shown && (!mouse->relative_mode || mouse->relative_mode_cursor_visible)) { if (mouse->ShowCursor) { mouse->ShowCursor(cursor); } @@ -1402,8 +1445,7 @@ SDL_SetCursor(SDL_Cursor * cursor) } } -SDL_Cursor * -SDL_GetCursor(void) +SDL_Cursor *SDL_GetCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1413,8 +1455,7 @@ SDL_GetCursor(void) return mouse->cur_cursor; } -SDL_Cursor * -SDL_GetDefaultCursor(void) +SDL_Cursor *SDL_GetDefaultCursor(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -1424,8 +1465,7 @@ SDL_GetDefaultCursor(void) return mouse->def_cursor; } -void -SDL_FreeCursor(SDL_Cursor * cursor) +void SDL_FreeCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_Cursor *curr, *prev; @@ -1452,14 +1492,15 @@ SDL_FreeCursor(SDL_Cursor * cursor) if (mouse->FreeCursor) { mouse->FreeCursor(curr); + } else { + SDL_free(curr); } return; } } } -int -SDL_ShowCursor(int toggle) +int SDL_ShowCursor(int toggle) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_bool shown; diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 6dd023041297d..e71fd8d28a8b6 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,34 +49,34 @@ typedef struct typedef struct { /* Create a cursor from a surface */ - SDL_Cursor *(*CreateCursor) (SDL_Surface * surface, int hot_x, int hot_y); + SDL_Cursor *(*CreateCursor)(SDL_Surface *surface, int hot_x, int hot_y); /* Create a system cursor */ - SDL_Cursor *(*CreateSystemCursor) (SDL_SystemCursor id); + SDL_Cursor *(*CreateSystemCursor)(SDL_SystemCursor id); /* Show the specified cursor, or hide if cursor is NULL */ - int (*ShowCursor) (SDL_Cursor * cursor); + int (*ShowCursor)(SDL_Cursor *cursor); /* This is called when a mouse motion event occurs */ - void (*MoveCursor) (SDL_Cursor * cursor); + void (*MoveCursor)(SDL_Cursor *cursor); /* Free a window manager cursor */ - void (*FreeCursor) (SDL_Cursor * cursor); + void (*FreeCursor)(SDL_Cursor *cursor); /* Warp the mouse to (x,y) within a window */ - void (*WarpMouse) (SDL_Window * window, int x, int y); + void (*WarpMouse)(SDL_Window *window, int x, int y); /* Warp the mouse to (x,y) in screen space */ - int (*WarpMouseGlobal) (int x, int y); + int (*WarpMouseGlobal)(int x, int y); /* Set relative mode */ - int (*SetRelativeMouseMode) (SDL_bool enabled); + int (*SetRelativeMouseMode)(SDL_bool enabled); /* Set mouse capture */ - int (*CaptureMouse) (SDL_Window * window); + int (*CaptureMouse)(SDL_Window *window); /* Get absolute mouse coordinates. (x) and (y) are never NULL and set to zero before call. */ - Uint32 (*GetGlobalMouseState) (int *x, int *y); + Uint32 (*GetGlobalMouseState)(int *x, int *y); /* Data common to all mice */ SDL_MouseID mouseID; @@ -85,13 +85,14 @@ typedef struct int y; int xdelta; int ydelta; - int last_x, last_y; /* the last reported x and y coordinates */ + int last_x, last_y; /* the last reported x and y coordinates */ float accumulated_wheel_x; float accumulated_wheel_y; SDL_bool has_position; SDL_bool relative_mode; SDL_bool relative_mode_warp; SDL_bool relative_mode_warp_motion; + SDL_bool relative_mode_cursor_visible; SDL_bool enable_normal_speed_scale; float normal_speed_scale; SDL_bool enable_relative_speed_scale; @@ -130,18 +131,18 @@ typedef struct void *driverdata; } SDL_Mouse; - /* Initialize the mouse subsystem */ -extern int SDL_MouseInit(void); +extern int SDL_MousePreInit(void); +extern void SDL_MousePostInit(void); /* Get the mouse state structure */ SDL_Mouse *SDL_GetMouse(void); /* Set the default mouse cursor */ -extern void SDL_SetDefaultCursor(SDL_Cursor * cursor); +extern void SDL_SetDefaultCursor(SDL_Cursor *cursor); /* Set the mouse focus window */ -extern void SDL_SetMouseFocus(SDL_Window * window); +extern void SDL_SetMouseFocus(SDL_Window *window); /* Update the mouse capture window */ extern int SDL_UpdateMouseCapture(SDL_bool force_release); @@ -150,16 +151,16 @@ extern int SDL_UpdateMouseCapture(SDL_bool force_release); extern int SDL_SetMouseSystemScale(int num_values, const float *values); /* Send a mouse motion event */ -extern int SDL_SendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y); +extern int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y); /* Send a mouse button event */ -extern int SDL_SendMouseButton(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button); +extern int SDL_SendMouseButton(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button); /* Send a mouse button event with a click count */ -extern int SDL_SendMouseButtonClicks(SDL_Window * window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks); +extern int SDL_SendMouseButtonClicks(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks); /* Send a mouse wheel event */ -extern int SDL_SendMouseWheel(SDL_Window * window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction); +extern int SDL_SendMouseWheel(SDL_Window *window, SDL_MouseID mouseID, float x, float y, SDL_MouseWheelDirection direction); /* Warp the mouse within the window, potentially overriding relative mode */ extern void SDL_PerformWarpMouseInWindow(SDL_Window *window, int x, int y, SDL_bool ignore_relative_mode); diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index ca583ea9c2bc0..b4234fc2185c6 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -47,11 +47,10 @@ static SDL_bool send_backgrounding_pending = SDL_FALSE; static SDL_bool send_foregrounding_pending = SDL_FALSE; #endif -static void -SDL_HandleSIG(int sig) +static void SDL_HandleSIG(int sig) { /* Reset the signal handler */ - signal(sig, SDL_HandleSIG); + (void)signal(sig, SDL_HandleSIG); /* Send a quit event next time the event loop pumps. */ /* We can't send it in signal handler; SDL_malloc() might be interrupted! */ @@ -59,54 +58,52 @@ SDL_HandleSIG(int sig) send_quit_pending = SDL_TRUE; } - #ifdef SDL_BACKGROUNDING_SIGNAL +#ifdef SDL_BACKGROUNDING_SIGNAL else if (sig == SDL_BACKGROUNDING_SIGNAL) { send_backgrounding_pending = SDL_TRUE; } - #endif +#endif - #ifdef SDL_FOREGROUNDING_SIGNAL +#ifdef SDL_FOREGROUNDING_SIGNAL else if (sig == SDL_FOREGROUNDING_SIGNAL) { send_foregrounding_pending = SDL_TRUE; } - #endif +#endif } -static void -SDL_EventSignal_Init(const int sig) +static void SDL_EventSignal_Init(const int sig) { #ifdef HAVE_SIGACTION struct sigaction action; sigaction(sig, NULL, &action); #ifdef HAVE_SA_SIGACTION - if ( action.sa_handler == SIG_DFL && (void (*)(int))action.sa_sigaction == SIG_DFL ) { + if (action.sa_handler == SIG_DFL && (void (*)(int))action.sa_sigaction == SIG_DFL) { #else - if ( action.sa_handler == SIG_DFL ) { + if (action.sa_handler == SIG_DFL) { #endif action.sa_handler = SDL_HandleSIG; sigaction(sig, &action, NULL); } -#elif HAVE_SIGNAL_H - void (*ohandler) (int) = signal(sig, SDL_HandleSIG); +#elif defined(HAVE_SIGNAL_H) + void (*ohandler)(int) = signal(sig, SDL_HandleSIG); if (ohandler != SIG_DFL) { signal(sig, ohandler); } #endif } -static void -SDL_EventSignal_Quit(const int sig) +static void SDL_EventSignal_Quit(const int sig) { #ifdef HAVE_SIGACTION struct sigaction action; sigaction(sig, NULL, &action); - if ( action.sa_handler == SDL_HandleSIG ) { + if (action.sa_handler == SDL_HandleSIG) { action.sa_handler = SIG_DFL; sigaction(sig, &action, NULL); } -#elif HAVE_SIGNAL_H - void (*ohandler) (int) = signal(sig, SIG_DFL); +#elif defined(HAVE_SIGNAL_H) + void (*ohandler)(int) = signal(sig, SIG_DFL); if (ohandler != SDL_HandleSIG) { signal(sig, ohandler); } @@ -114,44 +111,41 @@ SDL_EventSignal_Quit(const int sig) } /* Public functions */ -static int -SDL_QuitInit_Internal(void) +static int SDL_QuitInit_Internal(void) { /* Both SIGINT and SIGTERM are translated into quit interrupts */ /* and SDL can be built to simulate iOS/Android semantics with arbitrary signals. */ SDL_EventSignal_Init(SIGINT); SDL_EventSignal_Init(SIGTERM); - #ifdef SDL_BACKGROUNDING_SIGNAL +#ifdef SDL_BACKGROUNDING_SIGNAL SDL_EventSignal_Init(SDL_BACKGROUNDING_SIGNAL); - #endif +#endif - #ifdef SDL_FOREGROUNDING_SIGNAL +#ifdef SDL_FOREGROUNDING_SIGNAL SDL_EventSignal_Init(SDL_FOREGROUNDING_SIGNAL); - #endif +#endif /* That's it! */ return 0; } -static void -SDL_QuitQuit_Internal(void) +static void SDL_QuitQuit_Internal(void) { SDL_EventSignal_Quit(SIGINT); SDL_EventSignal_Quit(SIGTERM); - #ifdef SDL_BACKGROUNDING_SIGNAL +#ifdef SDL_BACKGROUNDING_SIGNAL SDL_EventSignal_Quit(SDL_BACKGROUNDING_SIGNAL); - #endif +#endif - #ifdef SDL_FOREGROUNDING_SIGNAL +#ifdef SDL_FOREGROUNDING_SIGNAL SDL_EventSignal_Quit(SDL_FOREGROUNDING_SIGNAL); - #endif +#endif } #endif -int -SDL_QuitInit(void) +int SDL_QuitInit(void) { #ifdef HAVE_SIGNAL_SUPPORT if (!SDL_GetHintBoolean(SDL_HINT_NO_SIGNAL_HANDLERS, SDL_FALSE)) { @@ -161,8 +155,7 @@ SDL_QuitInit(void) return 0; } -void -SDL_QuitQuit(void) +void SDL_QuitQuit(void) { #ifdef HAVE_SIGNAL_SUPPORT if (!disable_signals) { @@ -171,8 +164,7 @@ SDL_QuitQuit(void) #endif } -void -SDL_SendPendingSignalEvents(void) +void SDL_SendPendingSignalEvents(void) { #ifdef HAVE_SIGNAL_SUPPORT if (send_quit_pending) { @@ -180,25 +172,24 @@ SDL_SendPendingSignalEvents(void) SDL_assert(!send_quit_pending); } - #ifdef SDL_BACKGROUNDING_SIGNAL +#ifdef SDL_BACKGROUNDING_SIGNAL if (send_backgrounding_pending) { send_backgrounding_pending = SDL_FALSE; SDL_OnApplicationWillResignActive(); } - #endif +#endif - #ifdef SDL_FOREGROUNDING_SIGNAL +#ifdef SDL_FOREGROUNDING_SIGNAL if (send_foregrounding_pending) { send_foregrounding_pending = SDL_FALSE; SDL_OnApplicationDidBecomeActive(); } - #endif +#endif #endif } /* This function returns 1 if it's okay to close the application window */ -int -SDL_SendQuit(void) +int SDL_SendQuit(void) { #ifdef HAVE_SIGNAL_SUPPORT send_quit_pending = SDL_FALSE; diff --git a/src/events/SDL_scancode_tables.c b/src/events/SDL_scancode_tables.c index 9c9a55fe89685..71147a5cae245 100644 --- a/src/events/SDL_scancode_tables.c +++ b/src/events/SDL_scancode_tables.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../SDL_internal.h" -#if SDL_INPUT_LINUXEV || SDL_VIDEO_DRIVER_DIRECTFB || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_X11 +#if defined(SDL_INPUT_LINUXEV) || defined(SDL_VIDEO_DRIVER_DIRECTFB) || defined(SDL_VIDEO_DRIVER_WAYLAND) || defined(SDL_VIDEO_DRIVER_X11) #include "SDL_scancode_tables_c.h" diff --git a/src/events/SDL_scancode_tables_c.h b/src/events/SDL_scancode_tables_c.h index c85b8ddcac40d..153c3c768dd68 100644 --- a/src/events/SDL_scancode_tables_c.h +++ b/src/events/SDL_scancode_tables_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index bc77b7354650f..ea32b086608fc 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,6 @@ #include "SDL_events_c.h" #include "../video/SDL_sysvideo.h" - static int SDL_num_touch = 0; static SDL_Touch **SDL_touchDevices = NULL; @@ -37,24 +36,21 @@ static SDL_Touch **SDL_touchDevices = NULL; #if SYNTHESIZE_TOUCH_TO_MOUSE static SDL_bool finger_touching = SDL_FALSE; static SDL_FingerID track_fingerid; -static SDL_TouchID track_touchid; +static SDL_TouchID track_touchid; #endif /* Public functions */ -int -SDL_TouchInit(void) +int SDL_TouchInit(void) { - return (0); + return 0; } -int -SDL_GetNumTouchDevices(void) +int SDL_GetNumTouchDevices(void) { return SDL_num_touch; } -SDL_TouchID -SDL_GetTouchDevice(int index) +SDL_TouchID SDL_GetTouchDevice(int index) { if (index < 0 || index >= SDL_num_touch) { SDL_SetError("Unknown touch device index %d", index); @@ -63,8 +59,7 @@ SDL_GetTouchDevice(int index) return SDL_touchDevices[index]->id; } -const char* -SDL_GetTouchName(int index) +const char *SDL_GetTouchName(int index) { if (index < 0 || index >= SDL_num_touch) { SDL_SetError("Unknown touch device"); @@ -73,8 +68,7 @@ SDL_GetTouchName(int index) return SDL_touchDevices[index]->name; } -static int -SDL_GetTouchIndex(SDL_TouchID id) +static int SDL_GetTouchIndex(SDL_TouchID id) { int index; SDL_Touch *touch; @@ -88,24 +82,22 @@ SDL_GetTouchIndex(SDL_TouchID id) return -1; } -SDL_Touch * -SDL_GetTouch(SDL_TouchID id) +SDL_Touch *SDL_GetTouch(SDL_TouchID id) { int index = SDL_GetTouchIndex(id); if (index < 0 || index >= SDL_num_touch) { if (SDL_GetVideoDevice()->ResetTouch != NULL) { - SDL_SetError("Unknown touch id %d, resetting", (int) id); + SDL_SetError("Unknown touch id %d, resetting", (int)id); (SDL_GetVideoDevice()->ResetTouch)(SDL_GetVideoDevice()); } else { - SDL_SetError("Unknown touch device id %d, cannot reset", (int) id); + SDL_SetError("Unknown touch device id %d, cannot reset", (int)id); } return NULL; } return SDL_touchDevices[index]; } -SDL_TouchDeviceType -SDL_GetTouchDeviceType(SDL_TouchID id) +SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID id) { SDL_Touch *touch = SDL_GetTouch(id); if (touch) { @@ -114,8 +106,7 @@ SDL_GetTouchDeviceType(SDL_TouchID id) return SDL_TOUCH_DEVICE_INVALID; } -static int -SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid) +static int SDL_GetFingerIndex(const SDL_Touch *touch, SDL_FingerID fingerid) { int index; for (index = 0; index < touch->num_fingers; ++index) { @@ -126,8 +117,7 @@ SDL_GetFingerIndex(const SDL_Touch * touch, SDL_FingerID fingerid) return -1; } -static SDL_Finger * -SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id) +static SDL_Finger *SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id) { int index = SDL_GetFingerIndex(touch, id); if (index < 0 || index >= touch->num_fingers) { @@ -136,8 +126,7 @@ SDL_GetFinger(const SDL_Touch * touch, SDL_FingerID id) return touch->fingers[index]; } -int -SDL_GetNumTouchFingers(SDL_TouchID touchID) +int SDL_GetNumTouchFingers(SDL_TouchID touchID) { SDL_Touch *touch = SDL_GetTouch(touchID); if (touch) { @@ -146,8 +135,7 @@ SDL_GetNumTouchFingers(SDL_TouchID touchID) return 0; } -SDL_Finger * -SDL_GetTouchFinger(SDL_TouchID touchID, int index) +SDL_Finger *SDL_GetTouchFinger(SDL_TouchID touchID, int index) { SDL_Touch *touch = SDL_GetTouch(touchID); if (!touch) { @@ -160,8 +148,7 @@ SDL_GetTouchFinger(SDL_TouchID touchID, int index) return touch->fingers[index]; } -int -SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) +int SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) { SDL_Touch **touchDevices; int index; @@ -172,8 +159,8 @@ SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) } /* Add the touch to the list of touch */ - touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices, - (SDL_num_touch + 1) * sizeof(*touchDevices)); + touchDevices = (SDL_Touch **)SDL_realloc(SDL_touchDevices, + (SDL_num_touch + 1) * sizeof(*touchDevices)); if (!touchDevices) { return SDL_OutOfMemory(); } @@ -181,7 +168,7 @@ SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) SDL_touchDevices = touchDevices; index = SDL_num_touch; - SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index])); + SDL_touchDevices[index] = (SDL_Touch *)SDL_malloc(sizeof(*SDL_touchDevices[index])); if (!SDL_touchDevices[index]) { return SDL_OutOfMemory(); } @@ -204,14 +191,13 @@ SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) return index; } -static int -SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure) +static int SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float pressure) { SDL_Finger *finger; if (touch->num_fingers == touch->max_fingers) { SDL_Finger **new_fingers; - new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers)); + new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers + 1) * sizeof(*touch->fingers)); if (!new_fingers) { return SDL_OutOfMemory(); } @@ -231,8 +217,7 @@ SDL_AddFinger(SDL_Touch *touch, SDL_FingerID fingerid, float x, float y, float p return 0; } -static int -SDL_DelFinger(SDL_Touch* touch, SDL_FingerID fingerid) +static int SDL_DelFinger(SDL_Touch *touch, SDL_FingerID fingerid) { SDL_Finger *temp; @@ -248,15 +233,14 @@ SDL_DelFinger(SDL_Touch* touch, SDL_FingerID fingerid) return 0; } -int -SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, - SDL_bool down, float x, float y, float pressure) +int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, + SDL_bool down, float x, float y, float pressure) { int posted; SDL_Finger *finger; SDL_Mouse *mouse; - SDL_Touch* touch = SDL_GetTouch(id); + SDL_Touch *touch = SDL_GetTouch(id); if (!touch) { return -1; } @@ -268,7 +252,7 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, /* SDL_HINT_VITA_TOUCH_MOUSE_DEVICE: controlling which touchpad should generate synthetic mouse events, PSVita-only */ { #if defined(__vita__) - if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 2)) ) { + if (mouse->touch_mouse_events && ((mouse->vita_touch_mouse_device == id) || (mouse->vita_touch_mouse_device == 3))) { #else if (mouse->touch_mouse_events) { #endif @@ -279,10 +263,18 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, if (finger_touching == SDL_FALSE) { int pos_x = (int)(x * (float)window->w); int pos_y = (int)(y * (float)window->h); - if (pos_x < 0) pos_x = 0; - if (pos_x > window->w - 1) pos_x = window->w - 1; - if (pos_y < 0) pos_y = 0; - if (pos_y > window->h - 1) pos_y = window->h - 1; + if (pos_x < 0) { + pos_x = 0; + } + if (pos_x > window->w - 1) { + pos_x = window->w - 1; + } + if (pos_y < 0) { + pos_y = 0; + } + if (pos_y > window->h - 1) { + pos_y = window->h - 1; + } SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT); } @@ -368,9 +360,8 @@ SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, return posted; } -int -SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, - float x, float y, float pressure) +int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, + float x, float y, float pressure) { SDL_Touch *touch; SDL_Finger *finger; @@ -394,10 +385,18 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) { int pos_x = (int)(x * (float)window->w); int pos_y = (int)(y * (float)window->h); - if (pos_x < 0) pos_x = 0; - if (pos_x > window->w - 1) pos_x = window->w - 1; - if (pos_y < 0) pos_y = 0; - if (pos_y > window->h - 1) pos_y = window->h - 1; + if (pos_x < 0) { + pos_x = 0; + } + if (pos_x > window->w - 1) { + pos_x = window->w - 1; + } + if (pos_y < 0) { + pos_y = 0; + } + if (pos_y > window->h - 1) { + pos_y = window->h - 1; + } SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, pos_x, pos_y); } } @@ -413,7 +412,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, } } - finger = SDL_GetFinger(touch,fingerid); + finger = SDL_GetFinger(touch, fingerid); if (!finger) { return SDL_SendTouch(id, fingerid, window, SDL_TRUE, x, y, pressure); } @@ -453,8 +452,7 @@ SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, return posted; } -void -SDL_DelTouch(SDL_TouchID id) +void SDL_DelTouch(SDL_TouchID id) { int i, index; SDL_Touch *touch; @@ -484,12 +482,11 @@ SDL_DelTouch(SDL_TouchID id) SDL_GestureDelTouch(id); } -void -SDL_TouchQuit(void) +void SDL_TouchQuit(void) { int i; - for (i = SDL_num_touch; i--; ) { + for (i = SDL_num_touch; i--;) { SDL_DelTouch(SDL_touchDevices[i]->id); } SDL_assert(SDL_num_touch == 0); diff --git a/src/events/SDL_touch_c.h b/src/events/SDL_touch_c.h index 4d5caf134b545..290222837c342 100644 --- a/src/events/SDL_touch_c.h +++ b/src/events/SDL_touch_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,11 +30,10 @@ typedef struct SDL_Touch SDL_TouchDeviceType type; int num_fingers; int max_fingers; - SDL_Finger** fingers; + SDL_Finger **fingers; char *name; } SDL_Touch; - /* Initialize the touch subsystem */ extern int SDL_TouchInit(void); @@ -45,11 +44,11 @@ extern int SDL_AddTouch(SDL_TouchID id, SDL_TouchDeviceType type, const char *na extern SDL_Touch *SDL_GetTouch(SDL_TouchID id); /* Send a touch down/up event for a touch */ -extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, +extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, SDL_bool down, float x, float y, float pressure); /* Send a touch motion event for a touch */ -extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window, +extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, float x, float y, float pressure); /* Remove a touch */ diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index 209295afcb48a..9e4f0f363603b 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,10 +33,9 @@ typedef struct RemovePendingSizeChangedAndResizedEvents_Data SDL_bool saw_resized; } RemovePendingSizeChangedAndResizedEvents_Data; -static int SDLCALL -RemovePendingSizeChangedAndResizedEvents(void *_userdata, SDL_Event *event) +static int SDLCALL RemovePendingSizeChangedAndResizedEvents(void *_userdata, SDL_Event *event) { - RemovePendingSizeChangedAndResizedEvents_Data *userdata = (RemovePendingSizeChangedAndResizedEvents_Data *) _userdata; + RemovePendingSizeChangedAndResizedEvents_Data *userdata = (RemovePendingSizeChangedAndResizedEvents_Data *)_userdata; const SDL_Event *new_event = userdata->new_event; if (event->type == SDL_WINDOWEVENT && @@ -54,8 +53,7 @@ RemovePendingSizeChangedAndResizedEvents(void *_userdata, SDL_Event *event) return 1; } -static int SDLCALL -RemovePendingMoveEvents(void * userdata, SDL_Event *event) +static int SDLCALL RemovePendingMoveEvents(void *userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; @@ -68,8 +66,7 @@ RemovePendingMoveEvents(void * userdata, SDL_Event *event) return 1; } -static int SDLCALL -RemovePendingExposedEvents(void * userdata, SDL_Event *event) +static int SDLCALL RemovePendingExposedEvents(void *userdata, SDL_Event *event) { SDL_Event *new_event = (SDL_Event *)userdata; @@ -82,9 +79,8 @@ RemovePendingExposedEvents(void * userdata, SDL_Event *event) return 1; } -int -SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, - int data2) +int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, + int data2) { int posted; @@ -205,12 +201,12 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, userdata.new_event = &event; userdata.saw_resized = SDL_FALSE; SDL_FilterEvents(RemovePendingSizeChangedAndResizedEvents, &userdata); - if (userdata.saw_resized) { /* if there was a pending resize, make sure one at the new dimensions remains. */ + if (userdata.saw_resized) { /* if there was a pending resize, make sure one at the new dimensions remains. */ event.window.event = SDL_WINDOWEVENT_RESIZED; if (SDL_PushEvent(&event) <= 0) { - return 0; /* oh well. */ + return 0; /* oh well. */ } - event.window.event = SDL_WINDOWEVENT_SIZE_CHANGED; /* then push the actual event next. */ + event.window.event = SDL_WINDOWEVENT_SIZE_CHANGED; /* then push the actual event next. */ } } if (windowevent == SDL_WINDOWEVENT_MOVED) { @@ -223,9 +219,9 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1, } if (windowevent == SDL_WINDOWEVENT_CLOSE) { - if ( !window->prev && !window->next ) { + if (!window->prev && !window->next) { if (SDL_GetHintBoolean(SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE, SDL_TRUE)) { - SDL_SendQuit(); /* This is the last window in the list so send the SDL_QUIT event */ + SDL_SendQuit(); /* This is the last window in the list so send the SDL_QUIT event */ } } } diff --git a/src/events/SDL_windowevents_c.h b/src/events/SDL_windowevents_c.h index f8042ee9ee878..3ae1d34c920c7 100644 --- a/src/events/SDL_windowevents_c.h +++ b/src/events/SDL_windowevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_windowevents_c_h_ #define SDL_windowevents_c_h_ -extern int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, +extern int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2); #endif /* SDL_windowevents_c_h_ */ diff --git a/src/events/blank_cursor.h b/src/events/blank_cursor.h index 35b47d3755d03..597d78ee9fa28 100644 --- a/src/events/blank_cursor.h +++ b/src/events/blank_cursor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,10 +22,10 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * A default blank 8x8 cursor */ -#define BLANK_CWIDTH 8 -#define BLANK_CHEIGHT 8 -#define BLANK_CHOTX 0 -#define BLANK_CHOTY 0 +#define BLANK_CWIDTH 8 +#define BLANK_CHEIGHT 8 +#define BLANK_CHOTX 0 +#define BLANK_CHOTY 0 static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; diff --git a/src/events/default_cursor.h b/src/events/default_cursor.h index 949d6e0436cf0..95ea8ec04514f 100644 --- a/src/events/default_cursor.h +++ b/src/events/default_cursor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #define DEFAULT_CHOTX 0 #define DEFAULT_CHOTY 0 -/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrire */ +/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */ #define USE_MACOS_CURSOR #ifdef USE_MACOS_CURSOR diff --git a/src/events/imKStoUCS.c b/src/events/imKStoUCS.c index 4aa85d4239d86..d851dc1b6efb1 100644 --- a/src/events/imKStoUCS.c +++ b/src/events/imKStoUCS.c @@ -26,7 +26,7 @@ DEALINGS IN THE SOFTWARE. #include "../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND +#if defined(SDL_VIDEO_DRIVER_X11) || defined(SDL_VIDEO_DRIVER_WAYLAND) #include "imKStoUCS.h" static unsigned short const keysym_to_unicode_1a1_1ff[] = { diff --git a/src/events/scancodes_ascii.h b/src/events/scancodes_ascii.h index c30cddca08218..0e28b54e4bb7c 100644 --- a/src/events/scancodes_ascii.h +++ b/src/events/scancodes_ascii.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,134 +37,134 @@ typedef struct } ASCIIKeyInfo; static ASCIIKeyInfo SDL_ASCIIKeyInfoTable[] = { -/* 0 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 1 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 2 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 3 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 4 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 5 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 6 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 7 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 8 */ { SDL_SCANCODE_BACKSPACE, 0 }, -/* 9 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 10 */ { SDL_SCANCODE_RETURN, 0 }, -/* 11 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 12 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 13 */ { SDL_SCANCODE_RETURN, 0 }, -/* 14 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 15 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 16 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 17 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 18 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 19 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 20 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 21 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 22 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 23 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 24 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 25 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 26 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 27 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 28 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 29 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 30 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 31 */ { SDL_SCANCODE_UNKNOWN, 0 }, -/* 32 */ { SDL_SCANCODE_SPACE, 0 }, -/* 33 */ { SDL_SCANCODE_1, KMOD_SHIFT }, /* plus shift modifier '!' */ -/* 34 */ { SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT }, /* plus shift modifier '"' */ -/* 35 */ { SDL_SCANCODE_3, KMOD_SHIFT }, /* plus shift modifier '#' */ -/* 36 */ { SDL_SCANCODE_4, KMOD_SHIFT }, /* plus shift modifier '$' */ -/* 37 */ { SDL_SCANCODE_5, KMOD_SHIFT }, /* plus shift modifier '%' */ -/* 38 */ { SDL_SCANCODE_7, KMOD_SHIFT }, /* plus shift modifier '&' */ -/* 39 */ { SDL_SCANCODE_APOSTROPHE, 0 }, /* ''' */ -/* 40 */ { SDL_SCANCODE_9, KMOD_SHIFT }, /* plus shift modifier '(' */ -/* 41 */ { SDL_SCANCODE_0, KMOD_SHIFT }, /* plus shift modifier ')' */ -/* 42 */ { SDL_SCANCODE_8, KMOD_SHIFT }, /* '*' */ -/* 43 */ { SDL_SCANCODE_EQUALS, KMOD_SHIFT }, /* plus shift modifier '+' */ -/* 44 */ { SDL_SCANCODE_COMMA, 0 }, /* ',' */ -/* 45 */ { SDL_SCANCODE_MINUS, 0 }, /* '-' */ -/* 46 */ { SDL_SCANCODE_PERIOD, 0 }, /* '.' */ -/* 47 */ { SDL_SCANCODE_SLASH, 0 }, /* '/' */ -/* 48 */ { SDL_SCANCODE_0, 0 }, -/* 49 */ { SDL_SCANCODE_1, 0 }, -/* 50 */ { SDL_SCANCODE_2, 0 }, -/* 51 */ { SDL_SCANCODE_3, 0 }, -/* 52 */ { SDL_SCANCODE_4, 0 }, -/* 53 */ { SDL_SCANCODE_5, 0 }, -/* 54 */ { SDL_SCANCODE_6, 0 }, -/* 55 */ { SDL_SCANCODE_7, 0 }, -/* 56 */ { SDL_SCANCODE_8, 0 }, -/* 57 */ { SDL_SCANCODE_9, 0 }, -/* 58 */ { SDL_SCANCODE_SEMICOLON, KMOD_SHIFT }, /* plus shift modifier ';' */ -/* 59 */ { SDL_SCANCODE_SEMICOLON, 0 }, -/* 60 */ { SDL_SCANCODE_COMMA, KMOD_SHIFT }, /* plus shift modifier '<' */ -/* 61 */ { SDL_SCANCODE_EQUALS, 0 }, -/* 62 */ { SDL_SCANCODE_PERIOD, KMOD_SHIFT }, /* plus shift modifier '>' */ -/* 63 */ { SDL_SCANCODE_SLASH, KMOD_SHIFT }, /* plus shift modifier '?' */ -/* 64 */ { SDL_SCANCODE_2, KMOD_SHIFT }, /* plus shift modifier '@' */ -/* 65 */ { SDL_SCANCODE_A, KMOD_SHIFT }, /* all the following need shift modifiers */ -/* 66 */ { SDL_SCANCODE_B, KMOD_SHIFT }, -/* 67 */ { SDL_SCANCODE_C, KMOD_SHIFT }, -/* 68 */ { SDL_SCANCODE_D, KMOD_SHIFT }, -/* 69 */ { SDL_SCANCODE_E, KMOD_SHIFT }, -/* 70 */ { SDL_SCANCODE_F, KMOD_SHIFT }, -/* 71 */ { SDL_SCANCODE_G, KMOD_SHIFT }, -/* 72 */ { SDL_SCANCODE_H, KMOD_SHIFT }, -/* 73 */ { SDL_SCANCODE_I, KMOD_SHIFT }, -/* 74 */ { SDL_SCANCODE_J, KMOD_SHIFT }, -/* 75 */ { SDL_SCANCODE_K, KMOD_SHIFT }, -/* 76 */ { SDL_SCANCODE_L, KMOD_SHIFT }, -/* 77 */ { SDL_SCANCODE_M, KMOD_SHIFT }, -/* 78 */ { SDL_SCANCODE_N, KMOD_SHIFT }, -/* 79 */ { SDL_SCANCODE_O, KMOD_SHIFT }, -/* 80 */ { SDL_SCANCODE_P, KMOD_SHIFT }, -/* 81 */ { SDL_SCANCODE_Q, KMOD_SHIFT }, -/* 82 */ { SDL_SCANCODE_R, KMOD_SHIFT }, -/* 83 */ { SDL_SCANCODE_S, KMOD_SHIFT }, -/* 84 */ { SDL_SCANCODE_T, KMOD_SHIFT }, -/* 85 */ { SDL_SCANCODE_U, KMOD_SHIFT }, -/* 86 */ { SDL_SCANCODE_V, KMOD_SHIFT }, -/* 87 */ { SDL_SCANCODE_W, KMOD_SHIFT }, -/* 88 */ { SDL_SCANCODE_X, KMOD_SHIFT }, -/* 89 */ { SDL_SCANCODE_Y, KMOD_SHIFT }, -/* 90 */ { SDL_SCANCODE_Z, KMOD_SHIFT }, -/* 91 */ { SDL_SCANCODE_LEFTBRACKET, 0 }, -/* 92 */ { SDL_SCANCODE_BACKSLASH, 0 }, -/* 93 */ { SDL_SCANCODE_RIGHTBRACKET, 0 }, -/* 94 */ { SDL_SCANCODE_6, KMOD_SHIFT }, /* plus shift modifier '^' */ -/* 95 */ { SDL_SCANCODE_MINUS, KMOD_SHIFT }, /* plus shift modifier '_' */ -/* 96 */ { SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* '`' */ -/* 97 */ { SDL_SCANCODE_A, 0 }, -/* 98 */ { SDL_SCANCODE_B, 0 }, -/* 99 */ { SDL_SCANCODE_C, 0 }, -/* 100 */ { SDL_SCANCODE_D, 0 }, -/* 101 */ { SDL_SCANCODE_E, 0 }, -/* 102 */ { SDL_SCANCODE_F, 0 }, -/* 103 */ { SDL_SCANCODE_G, 0 }, -/* 104 */ { SDL_SCANCODE_H, 0 }, -/* 105 */ { SDL_SCANCODE_I, 0 }, -/* 106 */ { SDL_SCANCODE_J, 0 }, -/* 107 */ { SDL_SCANCODE_K, 0 }, -/* 108 */ { SDL_SCANCODE_L, 0 }, -/* 109 */ { SDL_SCANCODE_M, 0 }, -/* 110 */ { SDL_SCANCODE_N, 0 }, -/* 111 */ { SDL_SCANCODE_O, 0 }, -/* 112 */ { SDL_SCANCODE_P, 0 }, -/* 113 */ { SDL_SCANCODE_Q, 0 }, -/* 114 */ { SDL_SCANCODE_R, 0 }, -/* 115 */ { SDL_SCANCODE_S, 0 }, -/* 116 */ { SDL_SCANCODE_T, 0 }, -/* 117 */ { SDL_SCANCODE_U, 0 }, -/* 118 */ { SDL_SCANCODE_V, 0 }, -/* 119 */ { SDL_SCANCODE_W, 0 }, -/* 120 */ { SDL_SCANCODE_X, 0 }, -/* 121 */ { SDL_SCANCODE_Y, 0 }, -/* 122 */ { SDL_SCANCODE_Z, 0 }, -/* 123 */ { SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT }, /* plus shift modifier '{' */ -/* 124 */ { SDL_SCANCODE_BACKSLASH, KMOD_SHIFT }, /* plus shift modifier '|' */ -/* 125 */ { SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT }, /* plus shift modifier '}' */ -/* 126 */ { SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* plus shift modifier '~' */ -/* 127 */ { SDL_SCANCODE_BACKSPACE, KMOD_SHIFT } + /* 0 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 1 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 2 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 3 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 4 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 5 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 6 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 7 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 8 */ { SDL_SCANCODE_BACKSPACE, 0 }, + /* 9 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 10 */ { SDL_SCANCODE_RETURN, 0 }, + /* 11 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 12 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 13 */ { SDL_SCANCODE_RETURN, 0 }, + /* 14 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 15 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 16 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 17 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 18 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 19 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 20 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 21 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 22 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 23 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 24 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 25 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 26 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 27 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 28 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 29 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 30 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 31 */ { SDL_SCANCODE_UNKNOWN, 0 }, + /* 32 */ { SDL_SCANCODE_SPACE, 0 }, + /* 33 */ { SDL_SCANCODE_1, KMOD_SHIFT }, /* plus shift modifier '!' */ + /* 34 */ { SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT }, /* plus shift modifier '"' */ + /* 35 */ { SDL_SCANCODE_3, KMOD_SHIFT }, /* plus shift modifier '#' */ + /* 36 */ { SDL_SCANCODE_4, KMOD_SHIFT }, /* plus shift modifier '$' */ + /* 37 */ { SDL_SCANCODE_5, KMOD_SHIFT }, /* plus shift modifier '%' */ + /* 38 */ { SDL_SCANCODE_7, KMOD_SHIFT }, /* plus shift modifier '&' */ + /* 39 */ { SDL_SCANCODE_APOSTROPHE, 0 }, /* ''' */ + /* 40 */ { SDL_SCANCODE_9, KMOD_SHIFT }, /* plus shift modifier '(' */ + /* 41 */ { SDL_SCANCODE_0, KMOD_SHIFT }, /* plus shift modifier ')' */ + /* 42 */ { SDL_SCANCODE_8, KMOD_SHIFT }, /* '*' */ + /* 43 */ { SDL_SCANCODE_EQUALS, KMOD_SHIFT }, /* plus shift modifier '+' */ + /* 44 */ { SDL_SCANCODE_COMMA, 0 }, /* ',' */ + /* 45 */ { SDL_SCANCODE_MINUS, 0 }, /* '-' */ + /* 46 */ { SDL_SCANCODE_PERIOD, 0 }, /* '.' */ + /* 47 */ { SDL_SCANCODE_SLASH, 0 }, /* '/' */ + /* 48 */ { SDL_SCANCODE_0, 0 }, + /* 49 */ { SDL_SCANCODE_1, 0 }, + /* 50 */ { SDL_SCANCODE_2, 0 }, + /* 51 */ { SDL_SCANCODE_3, 0 }, + /* 52 */ { SDL_SCANCODE_4, 0 }, + /* 53 */ { SDL_SCANCODE_5, 0 }, + /* 54 */ { SDL_SCANCODE_6, 0 }, + /* 55 */ { SDL_SCANCODE_7, 0 }, + /* 56 */ { SDL_SCANCODE_8, 0 }, + /* 57 */ { SDL_SCANCODE_9, 0 }, + /* 58 */ { SDL_SCANCODE_SEMICOLON, KMOD_SHIFT }, /* plus shift modifier ';' */ + /* 59 */ { SDL_SCANCODE_SEMICOLON, 0 }, + /* 60 */ { SDL_SCANCODE_COMMA, KMOD_SHIFT }, /* plus shift modifier '<' */ + /* 61 */ { SDL_SCANCODE_EQUALS, 0 }, + /* 62 */ { SDL_SCANCODE_PERIOD, KMOD_SHIFT }, /* plus shift modifier '>' */ + /* 63 */ { SDL_SCANCODE_SLASH, KMOD_SHIFT }, /* plus shift modifier '?' */ + /* 64 */ { SDL_SCANCODE_2, KMOD_SHIFT }, /* plus shift modifier '@' */ + /* 65 */ { SDL_SCANCODE_A, KMOD_SHIFT }, /* all the following need shift modifiers */ + /* 66 */ { SDL_SCANCODE_B, KMOD_SHIFT }, + /* 67 */ { SDL_SCANCODE_C, KMOD_SHIFT }, + /* 68 */ { SDL_SCANCODE_D, KMOD_SHIFT }, + /* 69 */ { SDL_SCANCODE_E, KMOD_SHIFT }, + /* 70 */ { SDL_SCANCODE_F, KMOD_SHIFT }, + /* 71 */ { SDL_SCANCODE_G, KMOD_SHIFT }, + /* 72 */ { SDL_SCANCODE_H, KMOD_SHIFT }, + /* 73 */ { SDL_SCANCODE_I, KMOD_SHIFT }, + /* 74 */ { SDL_SCANCODE_J, KMOD_SHIFT }, + /* 75 */ { SDL_SCANCODE_K, KMOD_SHIFT }, + /* 76 */ { SDL_SCANCODE_L, KMOD_SHIFT }, + /* 77 */ { SDL_SCANCODE_M, KMOD_SHIFT }, + /* 78 */ { SDL_SCANCODE_N, KMOD_SHIFT }, + /* 79 */ { SDL_SCANCODE_O, KMOD_SHIFT }, + /* 80 */ { SDL_SCANCODE_P, KMOD_SHIFT }, + /* 81 */ { SDL_SCANCODE_Q, KMOD_SHIFT }, + /* 82 */ { SDL_SCANCODE_R, KMOD_SHIFT }, + /* 83 */ { SDL_SCANCODE_S, KMOD_SHIFT }, + /* 84 */ { SDL_SCANCODE_T, KMOD_SHIFT }, + /* 85 */ { SDL_SCANCODE_U, KMOD_SHIFT }, + /* 86 */ { SDL_SCANCODE_V, KMOD_SHIFT }, + /* 87 */ { SDL_SCANCODE_W, KMOD_SHIFT }, + /* 88 */ { SDL_SCANCODE_X, KMOD_SHIFT }, + /* 89 */ { SDL_SCANCODE_Y, KMOD_SHIFT }, + /* 90 */ { SDL_SCANCODE_Z, KMOD_SHIFT }, + /* 91 */ { SDL_SCANCODE_LEFTBRACKET, 0 }, + /* 92 */ { SDL_SCANCODE_BACKSLASH, 0 }, + /* 93 */ { SDL_SCANCODE_RIGHTBRACKET, 0 }, + /* 94 */ { SDL_SCANCODE_6, KMOD_SHIFT }, /* plus shift modifier '^' */ + /* 95 */ { SDL_SCANCODE_MINUS, KMOD_SHIFT }, /* plus shift modifier '_' */ + /* 96 */ { SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* '`' */ + /* 97 */ { SDL_SCANCODE_A, 0 }, + /* 98 */ { SDL_SCANCODE_B, 0 }, + /* 99 */ { SDL_SCANCODE_C, 0 }, + /* 100 */ { SDL_SCANCODE_D, 0 }, + /* 101 */ { SDL_SCANCODE_E, 0 }, + /* 102 */ { SDL_SCANCODE_F, 0 }, + /* 103 */ { SDL_SCANCODE_G, 0 }, + /* 104 */ { SDL_SCANCODE_H, 0 }, + /* 105 */ { SDL_SCANCODE_I, 0 }, + /* 106 */ { SDL_SCANCODE_J, 0 }, + /* 107 */ { SDL_SCANCODE_K, 0 }, + /* 108 */ { SDL_SCANCODE_L, 0 }, + /* 109 */ { SDL_SCANCODE_M, 0 }, + /* 110 */ { SDL_SCANCODE_N, 0 }, + /* 111 */ { SDL_SCANCODE_O, 0 }, + /* 112 */ { SDL_SCANCODE_P, 0 }, + /* 113 */ { SDL_SCANCODE_Q, 0 }, + /* 114 */ { SDL_SCANCODE_R, 0 }, + /* 115 */ { SDL_SCANCODE_S, 0 }, + /* 116 */ { SDL_SCANCODE_T, 0 }, + /* 117 */ { SDL_SCANCODE_U, 0 }, + /* 118 */ { SDL_SCANCODE_V, 0 }, + /* 119 */ { SDL_SCANCODE_W, 0 }, + /* 120 */ { SDL_SCANCODE_X, 0 }, + /* 121 */ { SDL_SCANCODE_Y, 0 }, + /* 122 */ { SDL_SCANCODE_Z, 0 }, + /* 123 */ { SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT }, /* plus shift modifier '{' */ + /* 124 */ { SDL_SCANCODE_BACKSLASH, KMOD_SHIFT }, /* plus shift modifier '|' */ + /* 125 */ { SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT }, /* plus shift modifier '}' */ + /* 126 */ { SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* plus shift modifier '~' */ + /* 127 */ { SDL_SCANCODE_BACKSPACE, KMOD_SHIFT } }; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/events/scancodes_darwin.h b/src/events/scancodes_darwin.h index 1d0b5c1658ef4..6564bc05c89d1 100644 --- a/src/events/scancodes_darwin.h +++ b/src/events/scancodes_darwin.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/scancodes_linux.h b/src/events/scancodes_linux.h index 3257377463362..f505db12d62ec 100644 --- a/src/events/scancodes_linux.h +++ b/src/events/scancodes_linux.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -804,7 +804,7 @@ static SDL_Scancode const linux_scancode_table[] = { function get_keyname { value=$(echo "$1" | awk '{print $3}') - fgrep KEY_ /usr/include/linux/input-event-codes.h | while read line; do + grep -F KEY_ /usr/include/linux/input-event-codes.h | while read line; do read -ra fields <<<"$line" if [ "${fields[2]}" = "$value" ]; then echo "${fields[1]}" @@ -813,7 +813,7 @@ function get_keyname done } -fgrep SDL_SCANCODE scancodes_linux.h | while read line; do +grep -F SDL_SCANCODE scancodes_linux.h | while read line; do if [ $(echo "$line" | awk '{print NF}') -eq 5 ]; then name=$(get_keyname "$line") if [ "$name" != "" ]; then @@ -832,11 +832,11 @@ function get_comment { name=$(echo "$1" | awk '{print $7}') if [ "$name" != "" ]; then - egrep "$name\s" /usr/include/linux/input-event-codes.h | fgrep "/*" | sed 's,[^/]*/,/,' + grep -E "$name\s" /usr/include/linux/input-event-codes.h | grep -F "/*" | sed 's,[^/]*/,/,' fi } -fgrep SDL_SCANCODE scancodes_linux.h | while read line; do +grep -F SDL_SCANCODE scancodes_linux.h | while read line; do comment=$(get_comment "$line") if [ "$comment" != "" ]; then echo " $line $comment" diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h index fc3e3db668280..84a3713fda1bf 100644 --- a/src/events/scancodes_windows.h +++ b/src/events/scancodes_windows.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index 605a657f12c62..e751cb499a123 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index ead504c10a781..ae20002a7a2b6 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,8 +36,9 @@ #ifdef HAVE_STDIO_H #include +#include +#include #endif - #ifdef HAVE_LIMITS_H #include #endif @@ -62,7 +63,7 @@ #include "SDL_system.h" #endif -#if __NACL__ +#ifdef __NACL__ #include "nacl_io/nacl_io.h" #endif @@ -74,10 +75,9 @@ #define INVALID_SET_FILE_POINTER 0xFFFFFFFF #endif -#define READAHEAD_BUFFER_SIZE 1024 +#define READAHEAD_BUFFER_SIZE 1024 -static int SDLCALL -windows_file_open(SDL_RWops * context, const char *filename, const char *mode) +static int SDLCALL windows_file_open(SDL_RWops *context, const char *filename, const char *mode) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) UINT old_error_mode; @@ -87,10 +87,11 @@ windows_file_open(SDL_RWops * context, const char *filename, const char *mode) DWORD must_exist, truncate; int a_mode; - if (!context) - return -1; /* failed (invalid call) */ + if (!context) { + return -1; /* failed (invalid call) */ + } - context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* mark this as unusable */ + context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* mark this as unusable */ context->hidden.windowsio.buffer.data = NULL; context->hidden.windowsio.buffer.size = 0; context->hidden.windowsio.buffer.left = 0; @@ -104,17 +105,17 @@ windows_file_open(SDL_RWops * context, const char *filename, const char *mode) must_exist = (SDL_strchr(mode, 'r') != NULL) ? OPEN_EXISTING : 0; truncate = (SDL_strchr(mode, 'w') != NULL) ? CREATE_ALWAYS : 0; - r_right = (SDL_strchr(mode, '+') != NULL - || must_exist) ? GENERIC_READ : 0; + r_right = (SDL_strchr(mode, '+') != NULL || must_exist) ? GENERIC_READ : 0; a_mode = (SDL_strchr(mode, 'a') != NULL) ? OPEN_ALWAYS : 0; - w_right = (a_mode || SDL_strchr(mode, '+') - || truncate) ? GENERIC_WRITE : 0; + w_right = (a_mode || SDL_strchr(mode, '+') || truncate) ? GENERIC_WRITE : 0; - if (!r_right && !w_right) /* inconsistent mode */ - return -1; /* failed (invalid call) */ + if (!r_right && !w_right) { + return -1; /* inconsistent mode */ + } + /* failed (invalid call) */ context->hidden.windowsio.buffer.data = - (char *) SDL_malloc(READAHEAD_BUFFER_SIZE); + (char *)SDL_malloc(READAHEAD_BUFFER_SIZE); if (!context->hidden.windowsio.buffer.data) { return SDL_OutOfMemory(); } @@ -142,16 +143,15 @@ windows_file_open(SDL_RWops * context, const char *filename, const char *mode) SDL_free(context->hidden.windowsio.buffer.data); context->hidden.windowsio.buffer.data = NULL; SDL_SetError("Couldn't open %s", filename); - return -2; /* failed (CreateFile) */ + return -2; /* failed (CreateFile) */ } context->hidden.windowsio.h = h; context->hidden.windowsio.append = a_mode ? SDL_TRUE : SDL_FALSE; - return 0; /* ok */ + return 0; /* ok */ } -static Sint64 SDLCALL -windows_file_size(SDL_RWops * context) +static Sint64 SDLCALL windows_file_size(SDL_RWops *context) { LARGE_INTEGER size; @@ -166,8 +166,7 @@ windows_file_size(SDL_RWops * context) return size.QuadPart; } -static Sint64 SDLCALL -windows_file_seek(SDL_RWops * context, Sint64 offset, int whence) +static Sint64 SDLCALL windows_file_seek(SDL_RWops *context, Sint64 offset, int whence) { DWORD windowswhence; LARGE_INTEGER windowsoffset; @@ -204,7 +203,7 @@ windows_file_seek(SDL_RWops * context, Sint64 offset, int whence) } static size_t SDLCALL -windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +windows_file_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) { size_t total_need; size_t total_read = 0; @@ -218,9 +217,9 @@ windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) } if (context->hidden.windowsio.buffer.left > 0) { - void *data = (char *) context->hidden.windowsio.buffer.data + - context->hidden.windowsio.buffer.size - - context->hidden.windowsio.buffer.left; + void *data = (char *)context->hidden.windowsio.buffer.data + + context->hidden.windowsio.buffer.size - + context->hidden.windowsio.buffer.left; read_ahead = SDL_min(total_need, context->hidden.windowsio.buffer.left); SDL_memcpy(ptr, data, read_ahead); @@ -229,37 +228,35 @@ windows_file_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) if (read_ahead == total_need) { return maxnum; } - ptr = (char *) ptr + read_ahead; + ptr = (char *)ptr + read_ahead; total_need -= read_ahead; total_read += read_ahead; } if (total_need < READAHEAD_BUFFER_SIZE) { - if (!ReadFile - (context->hidden.windowsio.h, context->hidden.windowsio.buffer.data, - READAHEAD_BUFFER_SIZE, &byte_read, NULL)) { + if (!ReadFile(context->hidden.windowsio.h, context->hidden.windowsio.buffer.data, + READAHEAD_BUFFER_SIZE, &byte_read, NULL)) { SDL_Error(SDL_EFREAD); return 0; } - read_ahead = SDL_min(total_need, (int) byte_read); + read_ahead = SDL_min(total_need, (int)byte_read); SDL_memcpy(ptr, context->hidden.windowsio.buffer.data, read_ahead); context->hidden.windowsio.buffer.size = byte_read; context->hidden.windowsio.buffer.left = byte_read - read_ahead; total_read += read_ahead; } else { - if (!ReadFile - (context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) { + if (!ReadFile(context->hidden.windowsio.h, ptr, (DWORD)total_need, &byte_read, NULL)) { SDL_Error(SDL_EFREAD); return 0; } total_read += byte_read; } - return (total_read / size); + return total_read / size; } static size_t SDLCALL -windows_file_write(SDL_RWops * context, const void *ptr, size_t size, - size_t num) +windows_file_write(SDL_RWops *context, const void *ptr, size_t size, + size_t num) { size_t total_bytes; @@ -281,15 +278,15 @@ windows_file_write(SDL_RWops * context, const void *ptr, size_t size, /* if in append mode, we must go to the EOF before write */ if (context->hidden.windowsio.append) { - if (SetFilePointer(context->hidden.windowsio.h, 0L, NULL, FILE_END) == - INVALID_SET_FILE_POINTER) { + LARGE_INTEGER windowsoffset; + windowsoffset.QuadPart = 0; + if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, FILE_END)) { SDL_Error(SDL_EFWRITE); return 0; } } - if (!WriteFile - (context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) { + if (!WriteFile(context->hidden.windowsio.h, ptr, (DWORD)total_bytes, &byte_written, NULL)) { SDL_Error(SDL_EFWRITE); return 0; } @@ -298,14 +295,13 @@ windows_file_write(SDL_RWops * context, const void *ptr, size_t size, return nwritten; } -static int SDLCALL -windows_file_close(SDL_RWops * context) +static int SDLCALL windows_file_close(SDL_RWops *context) { if (context) { if (context->hidden.windowsio.h != INVALID_HANDLE_VALUE) { CloseHandle(context->hidden.windowsio.h); - context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* to be sure */ + context->hidden.windowsio.h = INVALID_HANDLE_VALUE; /* to be sure */ } SDL_free(context->hidden.windowsio.buffer.data); context->hidden.windowsio.buffer.data = NULL; @@ -318,12 +314,12 @@ windows_file_close(SDL_RWops * context) #ifdef HAVE_STDIO_H #ifdef HAVE_FOPEN64 -#define fopen fopen64 +#define fopen fopen64 #endif #ifdef HAVE_FSEEKO64 #define fseek_off_t off64_t -#define fseek fseeko64 -#define ftell ftello64 +#define fseek fseeko64 +#define ftell ftello64 #elif defined(HAVE_FSEEKO) #if defined(OFF_MIN) && defined(OFF_MAX) #define FSEEK_OFF_MIN OFF_MIN @@ -336,15 +332,15 @@ windows_file_close(SDL_RWops * context) * and eliminate the dead code if off_t has 64 bits. */ #define FSEEK_OFF_MAX (((((off_t)1 << (sizeof(off_t) * CHAR_BIT - 2)) - 1) << 1) + 1) -#define FSEEK_OFF_MIN (-(FSEEK_OFF_MAX) - 1) +#define FSEEK_OFF_MIN (-(FSEEK_OFF_MAX)-1) #endif #define fseek_off_t off_t -#define fseek fseeko -#define ftell ftello +#define fseek fseeko +#define ftell ftello #elif defined(HAVE__FSEEKI64) #define fseek_off_t __int64 -#define fseek _fseeki64 -#define ftell _ftelli64 +#define fseek _fseeki64 +#define ftell _ftelli64 #else #ifdef HAVE_LIMITS_H #define FSEEK_OFF_MIN LONG_MIN @@ -370,10 +366,10 @@ stdio_size(SDL_RWops * context) return size; } -static Sint64 SDLCALL -stdio_seek(SDL_RWops * context, Sint64 offset, int whence) +static Sint64 SDLCALL stdio_seek(SDL_RWops *context, Sint64 offset, int whence) { int stdiowhence; + SDL_bool is_noop; switch (whence) { case RW_SEEK_SET: @@ -395,7 +391,10 @@ stdio_seek(SDL_RWops * context, Sint64 offset, int whence) } #endif - if (fseek(context->hidden.stdio.fp, (fseek_off_t)offset, stdiowhence) == 0) { + /* don't make a possibly-costly API call for the noop seek from SDL_RWtell */ + is_noop = (whence == RW_SEEK_CUR) && (offset == 0); + + if (is_noop || fseek(context->hidden.stdio.fp, (fseek_off_t)offset, stdiowhence) == 0) { Sint64 pos = ftell(context->hidden.stdio.fp); if (pos < 0) { return SDL_SetError("Couldn't get stream offset"); @@ -406,7 +405,7 @@ stdio_seek(SDL_RWops * context, Sint64 offset, int whence) } static size_t SDLCALL -stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +stdio_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) { size_t nread; @@ -418,7 +417,7 @@ stdio_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) } static size_t SDLCALL -stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) +stdio_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) { size_t nwrote; @@ -429,8 +428,7 @@ stdio_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) return nwrote; } -static int SDLCALL -stdio_close(SDL_RWops * context) +static int SDLCALL stdio_close(SDL_RWops *context) { int status = 0; if (context) { @@ -448,14 +446,12 @@ stdio_close(SDL_RWops * context) /* Functions to read/write memory pointers */ -static Sint64 SDLCALL -mem_size(SDL_RWops * context) +static Sint64 SDLCALL mem_size(SDL_RWops *context) { return (Sint64)(context->hidden.mem.stop - context->hidden.mem.base); } -static Sint64 SDLCALL -mem_seek(SDL_RWops * context, Sint64 offset, int whence) +static Sint64 SDLCALL mem_seek(SDL_RWops *context, Sint64 offset, int whence) { Uint8 *newpos; @@ -483,7 +479,7 @@ mem_seek(SDL_RWops * context, Sint64 offset, int whence) } static size_t SDLCALL -mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) +mem_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum) { size_t total_bytes; size_t mem_available; @@ -501,11 +497,11 @@ mem_read(SDL_RWops * context, void *ptr, size_t size, size_t maxnum) SDL_memcpy(ptr, context->hidden.mem.here, total_bytes); context->hidden.mem.here += total_bytes; - return (total_bytes / size); + return total_bytes / size; } static size_t SDLCALL -mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) +mem_write(SDL_RWops *context, const void *ptr, size_t size, size_t num) { if ((context->hidden.mem.here + (num * size)) > context->hidden.mem.stop) { num = (context->hidden.mem.stop - context->hidden.mem.here) / size; @@ -516,14 +512,13 @@ mem_write(SDL_RWops * context, const void *ptr, size_t size, size_t num) } static size_t SDLCALL -mem_writeconst(SDL_RWops * context, const void *ptr, size_t size, size_t num) +mem_writeconst(SDL_RWops *context, const void *ptr, size_t size, size_t num) { SDL_SetError("Can't write to read-only memory"); return 0; } -static int SDLCALL -mem_close(SDL_RWops * context) +static int SDLCALL mem_close(SDL_RWops *context) { if (context) { SDL_FreeRW(context); @@ -531,11 +526,28 @@ mem_close(SDL_RWops * context) return 0; } - /* Functions to create SDL_RWops structures from various data sources */ -SDL_RWops * -SDL_RWFromFile(const char *file, const char *mode) +#if defined(HAVE_STDIO_H) && !(defined(__WIN32__) || defined(__GDK__)) +static SDL_bool IsRegularFileOrPipe(FILE *f) +{ + #ifdef __WINRT__ + struct __stat64 st; + if (_fstat64(_fileno(f), &st) < 0 || + !((st.st_mode & _S_IFMT) == _S_IFREG || (st.st_mode & _S_IFMT) == _S_IFIFO)) { + return SDL_FALSE; + } + #elif !defined __EMSCRIPTEN__ + struct stat st; + if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) { + return SDL_FALSE; + } + #endif + return SDL_TRUE; +} +#endif + +SDL_RWops *SDL_RWFromFile(const char *file, const char *mode) { SDL_RWops *rwops = NULL; if (!file || !*file || !mode || !*mode) { @@ -548,6 +560,11 @@ SDL_RWFromFile(const char *file, const char *mode) if (*file == '/') { FILE *fp = fopen(file, mode); if (fp) { + if (!IsRegularFileOrPipe(fp)) { + fclose(fp); + SDL_SetError("%s is not a regular file or pipe", file); + return NULL; + } return SDL_RWFromFP(fp, 1); } } else { @@ -563,6 +580,11 @@ SDL_RWFromFile(const char *file, const char *mode) fp = fopen(path, mode); SDL_stack_free(path); if (fp) { + if (!IsRegularFileOrPipe(fp)) { + fclose(fp); + SDL_SetError("%s is not a regular file or pipe", path); + return NULL; + } return SDL_RWFromFP(fp, 1); } } @@ -571,8 +593,10 @@ SDL_RWFromFile(const char *file, const char *mode) /* Try to open the file from the asset system */ rwops = SDL_AllocRW(); - if (!rwops) - return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + if (!rwops) { + return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + } + if (Android_JNI_FileOpen(rwops, file, mode) < 0) { SDL_FreeRW(rwops); return NULL; @@ -586,8 +610,10 @@ SDL_RWFromFile(const char *file, const char *mode) #elif defined(__WIN32__) || defined(__GDK__) rwops = SDL_AllocRW(); - if (!rwops) - return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + if (!rwops) { + return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ + } + if (windows_file_open(rwops, file, mode) < 0) { SDL_FreeRW(rwops); return NULL; @@ -598,20 +624,24 @@ SDL_RWFromFile(const char *file, const char *mode) rwops->write = windows_file_write; rwops->close = windows_file_close; rwops->type = SDL_RWOPS_WINFILE; -#elif HAVE_STDIO_H +#elif defined(HAVE_STDIO_H) { - #if __APPLE__ && !SDL_FILE_DISABLED // TODO: add dummy? +#if defined(__APPLE__) && !defined(SDL_FILE_DISABLED) // TODO: add dummy? FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); - #elif __WINRT__ +#elif defined(__WINRT__) FILE *fp = NULL; fopen_s(&fp, file, mode); - #elif __3DS__ +#elif defined(__3DS__) FILE *fp = N3DS_FileOpen(file, mode); - #else +#else FILE *fp = fopen(file, mode); - #endif - if (fp == NULL) { - SDL_SetError("Couldn't open %s", file); +#endif + if (!fp) { + SDL_SetError("Couldn't open %s: %s", file, strerror(errno)); + } else if (!IsRegularFileOrPipe(fp)) { + fclose(fp); + fp = NULL; + SDL_SetError("%s is not a regular file or pipe", file); } else { rwops = SDL_RWFromFP(fp, SDL_TRUE); } @@ -624,13 +654,12 @@ SDL_RWFromFile(const char *file, const char *mode) } #ifdef HAVE_STDIO_H -SDL_RWops * -SDL_RWFromFP(FILE * fp, SDL_bool autoclose) +SDL_RWops *SDL_RWFromFP(FILE * fp, SDL_bool autoclose) { SDL_RWops *rwops = NULL; rwops = SDL_AllocRW(); - if (rwops != NULL) { + if (rwops) { rwops->size = stdio_size; rwops->seek = stdio_seek; rwops->read = stdio_read; @@ -643,35 +672,33 @@ SDL_RWFromFP(FILE * fp, SDL_bool autoclose) return rwops; } #else -SDL_RWops * -SDL_RWFromFP(void * fp, SDL_bool autoclose) +SDL_RWops *SDL_RWFromFP(void * fp, SDL_bool autoclose) { SDL_SetError("SDL not compiled with stdio support"); return NULL; } #endif /* HAVE_STDIO_H */ -SDL_RWops * -SDL_RWFromMem(void *mem, int size) +SDL_RWops *SDL_RWFromMem(void *mem, int size) { SDL_RWops *rwops = NULL; if (!mem) { - SDL_InvalidParamError("mem"); - return rwops; + SDL_InvalidParamError("mem"); + return rwops; } - if (!size) { - SDL_InvalidParamError("size"); - return rwops; + if (size <= 0) { + SDL_InvalidParamError("size"); + return rwops; } rwops = SDL_AllocRW(); - if (rwops != NULL) { + if (rwops) { rwops->size = mem_size; rwops->seek = mem_seek; rwops->read = mem_read; rwops->write = mem_write; rwops->close = mem_close; - rwops->hidden.mem.base = (Uint8 *) mem; + rwops->hidden.mem.base = (Uint8 *)mem; rwops->hidden.mem.here = rwops->hidden.mem.base; rwops->hidden.mem.stop = rwops->hidden.mem.base + size; rwops->type = SDL_RWOPS_MEMORY; @@ -679,27 +706,26 @@ SDL_RWFromMem(void *mem, int size) return rwops; } -SDL_RWops * -SDL_RWFromConstMem(const void *mem, int size) +SDL_RWops *SDL_RWFromConstMem(const void *mem, int size) { SDL_RWops *rwops = NULL; if (!mem) { - SDL_InvalidParamError("mem"); - return rwops; + SDL_InvalidParamError("mem"); + return rwops; } - if (!size) { - SDL_InvalidParamError("size"); - return rwops; + if (size <= 0) { + SDL_InvalidParamError("size"); + return rwops; } rwops = SDL_AllocRW(); - if (rwops != NULL) { + if (rwops) { rwops->size = mem_size; rwops->seek = mem_seek; rwops->read = mem_read; rwops->write = mem_writeconst; rwops->close = mem_close; - rwops->hidden.mem.base = (Uint8 *) mem; + rwops->hidden.mem.base = (Uint8 *)mem; rwops->hidden.mem.here = rwops->hidden.mem.base; rwops->hidden.mem.stop = rwops->hidden.mem.base + size; rwops->type = SDL_RWOPS_MEMORY_RO; @@ -707,13 +733,12 @@ SDL_RWFromConstMem(const void *mem, int size) return rwops; } -SDL_RWops * -SDL_AllocRW(void) +SDL_RWops *SDL_AllocRW(void) { SDL_RWops *area; - area = (SDL_RWops *) SDL_malloc(sizeof *area); - if (area == NULL) { + area = (SDL_RWops *)SDL_malloc(sizeof(*area)); + if (!area) { SDL_OutOfMemory(); } else { area->type = SDL_RWOPS_UNKNOWN; @@ -721,24 +746,22 @@ SDL_AllocRW(void) return area; } -void -SDL_FreeRW(SDL_RWops * area) +void SDL_FreeRW(SDL_RWops *area) { SDL_free(area); } /* Load all the data from an SDL data stream */ -void * -SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc) +void *SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc) { - const int FILE_CHUNK_SIZE = 1024; + static const Sint64 FILE_CHUNK_SIZE = 1024; Sint64 size; - size_t size_read, size_total; + size_t size_read, size_total = 0; void *data = NULL, *newdata; if (!src) { SDL_InvalidParamError("src"); - return NULL; + goto done; } size = SDL_RWsize(src); @@ -746,8 +769,11 @@ SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc) size = FILE_CHUNK_SIZE; } data = SDL_malloc((size_t)(size + 1)); + if (!data) { + SDL_OutOfMemory(); + goto done; + } - size_total = 0; for (;;) { if ((((Sint64)size_total) + FILE_CHUNK_SIZE) > size) { size = (size_total + FILE_CHUNK_SIZE); @@ -761,45 +787,41 @@ SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc) data = newdata; } - size_read = SDL_RWread(src, (char *)data+size_total, 1, (size_t)(size-size_total)); + size_read = SDL_RWread(src, (char *)data + size_total, 1, (size_t)(size - size_total)); if (size_read == 0) { break; } size_total += size_read; } - if (datasize) { - *datasize = size_total; - } ((char *)data)[size_total] = '\0'; done: + if (datasize) { + *datasize = size_total; + } if (freesrc && src) { SDL_RWclose(src); } return data; } -void * -SDL_LoadFile(const char *file, size_t *datasize) +void *SDL_LoadFile(const char *file, size_t *datasize) { - return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1); + return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1); } -Sint64 -SDL_RWsize(SDL_RWops *context) +Sint64 SDL_RWsize(SDL_RWops *context) { return context->size(context); } -Sint64 -SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence) +Sint64 SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence) { return context->seek(context, offset, whence); } -Sint64 -SDL_RWtell(SDL_RWops *context) +Sint64 SDL_RWtell(SDL_RWops *context) { return context->seek(context, 0, RW_SEEK_CUR); } @@ -816,123 +838,115 @@ SDL_RWwrite(SDL_RWops *context, const void *ptr, size_t size, size_t num) return context->write(context, ptr, size, num); } -int -SDL_RWclose(SDL_RWops *context) +int SDL_RWclose(SDL_RWops *context) { return context->close(context); } /* Functions for dynamically reading and writing endian-specific values */ -Uint8 -SDL_ReadU8(SDL_RWops * src) +Uint8 SDL_ReadU8(SDL_RWops *src) { Uint8 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return value; } -Uint16 -SDL_ReadLE16(SDL_RWops * src) +Uint16 SDL_ReadLE16(SDL_RWops *src) { Uint16 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapLE16(value); } -Uint16 -SDL_ReadBE16(SDL_RWops * src) +Uint16 SDL_ReadBE16(SDL_RWops *src) { Uint16 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapBE16(value); } -Uint32 -SDL_ReadLE32(SDL_RWops * src) +Uint32 SDL_ReadLE32(SDL_RWops *src) { Uint32 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapLE32(value); } -Uint32 -SDL_ReadBE32(SDL_RWops * src) +Uint32 SDL_ReadBE32(SDL_RWops *src) { Uint32 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapBE32(value); } -Uint64 -SDL_ReadLE64(SDL_RWops * src) +Uint64 SDL_ReadLE64(SDL_RWops *src) { Uint64 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapLE64(value); } -Uint64 -SDL_ReadBE64(SDL_RWops * src) +Uint64 SDL_ReadBE64(SDL_RWops *src) { Uint64 value = 0; - SDL_RWread(src, &value, sizeof (value), 1); + SDL_RWread(src, &value, sizeof(value), 1); return SDL_SwapBE64(value); } size_t -SDL_WriteU8(SDL_RWops * dst, Uint8 value) +SDL_WriteU8(SDL_RWops *dst, Uint8 value) { - return SDL_RWwrite(dst, &value, sizeof (value), 1); + return SDL_RWwrite(dst, &value, sizeof(value), 1); } size_t -SDL_WriteLE16(SDL_RWops * dst, Uint16 value) +SDL_WriteLE16(SDL_RWops *dst, Uint16 value) { const Uint16 swapped = SDL_SwapLE16(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } size_t -SDL_WriteBE16(SDL_RWops * dst, Uint16 value) +SDL_WriteBE16(SDL_RWops *dst, Uint16 value) { const Uint16 swapped = SDL_SwapBE16(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } size_t -SDL_WriteLE32(SDL_RWops * dst, Uint32 value) +SDL_WriteLE32(SDL_RWops *dst, Uint32 value) { const Uint32 swapped = SDL_SwapLE32(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } size_t -SDL_WriteBE32(SDL_RWops * dst, Uint32 value) +SDL_WriteBE32(SDL_RWops *dst, Uint32 value) { const Uint32 swapped = SDL_SwapBE32(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } size_t -SDL_WriteLE64(SDL_RWops * dst, Uint64 value) +SDL_WriteLE64(SDL_RWops *dst, Uint64 value) { const Uint64 swapped = SDL_SwapLE64(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } size_t -SDL_WriteBE64(SDL_RWops * dst, Uint64 value) +SDL_WriteBE64(SDL_RWops *dst, Uint64 value) { const Uint64 swapped = SDL_SwapBE64(value); - return SDL_RWwrite(dst, &swapped, sizeof (swapped), 1); + return SDL_RWwrite(dst, &swapped, sizeof(swapped), 1); } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/file/cocoa/SDL_rwopsbundlesupport.h b/src/file/cocoa/SDL_rwopsbundlesupport.h index b77b53e80d823..2cb9331434b6a 100644 --- a/src/file/cocoa/SDL_rwopsbundlesupport.h +++ b/src/file/cocoa/SDL_rwopsbundlesupport.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,6 +25,6 @@ #ifndef SDL_rwopsbundlesupport_h #define SDL_rwopsbundlesupport_h -FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode); +FILE *SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode); #endif #endif diff --git a/src/file/cocoa/SDL_rwopsbundlesupport.m b/src/file/cocoa/SDL_rwopsbundlesupport.m index 55e104a950e07..dbfc5a5b8458a 100644 --- a/src/file/cocoa/SDL_rwopsbundlesupport.m +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,7 @@ #import #include "SDL_rwopsbundlesupport.h" +#include "SDL_hints.h" /* For proper OS X applications, the resources are contained inside the application bundle. So the strategy is to first check the application bundle for the file, then fallback to the current working directory. @@ -32,34 +33,40 @@ but we would somehow need to know what the bundle identifiers we need to search are. Also, note the bundle layouts are different for iPhone and Mac. */ -FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) -{ @autoreleasepool +FILE *SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) { - FILE* fp = NULL; - NSFileManager* file_manager; - NSString* resource_path; - NSString* ns_string_file_component; - NSString* full_path_with_file_to_try; + @autoreleasepool { + FILE *fp = NULL; + NSFileManager *file_manager; + NSString *resource_path; + NSString *ns_string_file_component; + NSString *full_path_with_file_to_try; - /* If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. */ - if(strcmp("r", mode) && strcmp("rb", mode)) { - return fopen(file, mode); - } + /* if the app doesn't want this app bundle behavior, just use the path as-is. */ + if (!SDL_GetHintBoolean(SDL_HINT_APPLE_RWFROMFILE_USE_RESOURCES, SDL_TRUE)) { + return fopen(file, mode); + } - file_manager = [NSFileManager defaultManager]; - resource_path = [[NSBundle mainBundle] resourcePath]; + /* If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. */ + if (SDL_strchr(mode, 'r') == NULL) { + return fopen(file, mode); + } - ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; + file_manager = [NSFileManager defaultManager]; + resource_path = [[NSBundle mainBundle] resourcePath]; - full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; - if([file_manager fileExistsAtPath:full_path_with_file_to_try]) { - fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); - } else { - fp = fopen(file, mode); - } + ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; - return fp; -}} + full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; + if ([file_manager fileExistsAtPath:full_path_with_file_to_try]) { + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); + } else { + fp = fopen(file, mode); + } + + return fp; + } +} #endif /* __APPLE__ */ diff --git a/src/file/n3ds/SDL_rwopsromfs.c b/src/file/n3ds/SDL_rwopsromfs.c index 9d3ec87e9bee7..72ab031fc66db 100644 --- a/src/file/n3ds/SDL_rwopsromfs.c +++ b/src/file/n3ds/SDL_rwopsromfs.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,21 +23,20 @@ #include "SDL_error.h" /* Checks if the mode is a kind of reading */ -SDL_FORCE_INLINE SDL_bool IsReadMode(const char *mode); +static SDL_bool IsReadMode(const char *mode); /* Checks if the file starts with the given prefix */ -SDL_FORCE_INLINE SDL_bool HasPrefix(const char *file, const char *prefix); +static SDL_bool HasPrefix(const char *file, const char *prefix); -SDL_FORCE_INLINE FILE *TryOpenFile(const char *file, const char *mode); -SDL_FORCE_INLINE FILE *TryOpenInRomfs(const char *file, const char *mode); +static FILE *TryOpenFile(const char *file, const char *mode); +static FILE *TryOpenInRomfs(const char *file, const char *mode); /* Nintendo 3DS applications may embed resources in the executable. The resources are stored in a special read-only partition prefixed with 'romfs:/'. As such, when opening a file, we should first try the romfs unless sdmc is specifically mentionned. */ -FILE * -N3DS_FileOpen(const char *file, const char *mode) +FILE *N3DS_FileOpen(const char *file, const char *mode) { /* romfs are read-only */ if (!IsReadMode(mode)) { @@ -52,33 +51,29 @@ N3DS_FileOpen(const char *file, const char *mode) return TryOpenFile(file, mode); } -SDL_FORCE_INLINE SDL_bool -IsReadMode(const char *mode) +static SDL_bool IsReadMode(const char *mode) { return SDL_strchr(mode, 'r') != NULL; } -SDL_FORCE_INLINE SDL_bool -HasPrefix(const char *file, const char *prefix) +static SDL_bool HasPrefix(const char *file, const char *prefix) { return SDL_strncmp(prefix, file, SDL_strlen(prefix)) == 0; } -SDL_FORCE_INLINE FILE * -TryOpenFile(const char *file, const char *mode) +static FILE *TryOpenFile(const char *file, const char *mode) { FILE *fp = NULL; fp = TryOpenInRomfs(file, mode); - if (fp == NULL) { + if (!fp) { fp = fopen(file, mode); } return fp; } -SDL_FORCE_INLINE FILE * -TryOpenInRomfs(const char *file, const char *mode) +static FILE *TryOpenInRomfs(const char *file, const char *mode) { FILE *fp = NULL; char *prefixed_filepath = NULL; diff --git a/src/file/n3ds/SDL_rwopsromfs.h b/src/file/n3ds/SDL_rwopsromfs.h index 9a6a73472525c..7ff212f7113c1 100644 --- a/src/file/n3ds/SDL_rwopsromfs.h +++ b/src/file/n3ds/SDL_rwopsromfs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index 0ffe96b1592c5..a2296a44a6574 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,20 +32,18 @@ #include "SDL_system.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { /* The current working directory is / on Android */ SDL_Unsupported(); return NULL; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *path = SDL_AndroidGetInternalStoragePath(); if (path) { - size_t pathlen = SDL_strlen(path)+2; + size_t pathlen = SDL_strlen(path) + 2; char *fullpath = (char *)SDL_malloc(pathlen); if (!fullpath) { SDL_OutOfMemory(); diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index a1506d3b8afb0..f3fce9c62fabe 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,107 +33,106 @@ #include "SDL_stdinc.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) -{ @autoreleasepool +char *SDL_GetBasePath(void) { - NSBundle *bundle = [NSBundle mainBundle]; - const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String]; - const char *base = NULL; - char *retval = NULL; - - if (baseType == NULL) { - baseType = "resource"; - } - if (SDL_strcasecmp(baseType, "bundle")==0) { - base = [[bundle bundlePath] fileSystemRepresentation]; - } else if (SDL_strcasecmp(baseType, "parent")==0) { - base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation]; - } else { - /* this returns the exedir for non-bundled and the resourceDir for bundled apps */ - base = [[bundle resourcePath] fileSystemRepresentation]; - } - - if (base) { - const size_t len = SDL_strlen(base) + 2; - retval = (char *) SDL_malloc(len); - if (retval == NULL) { - SDL_OutOfMemory(); + @autoreleasepool { + NSBundle *bundle = [NSBundle mainBundle]; + const char *baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String]; + const char *base = NULL; + char *retval = NULL; + + if (baseType == NULL) { + baseType = "resource"; + } + if (SDL_strcasecmp(baseType, "bundle") == 0) { + base = [[bundle bundlePath] fileSystemRepresentation]; + } else if (SDL_strcasecmp(baseType, "parent") == 0) { + base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation]; } else { - SDL_snprintf(retval, len, "%s/", base); + /* this returns the exedir for non-bundled and the resourceDir for bundled apps */ + base = [[bundle resourcePath] fileSystemRepresentation]; + } + + if (base) { + const size_t len = SDL_strlen(base) + 2; + retval = (char *)SDL_malloc(len); + if (retval == NULL) { + SDL_OutOfMemory(); + } else { + SDL_snprintf(retval, len, "%s/", base); + } } - } - return retval; -}} + return retval; + } +} -char * -SDL_GetPrefPath(const char *org, const char *app) -{ @autoreleasepool +char *SDL_GetPrefPath(const char *org, const char *app) { - char *retval = NULL; - NSArray *array; + @autoreleasepool { + char *retval = NULL; + NSArray *array; - if (!app) { - SDL_InvalidParamError("app"); - return NULL; - } - if (!org) { - org = ""; - } + if (!app) { + SDL_InvalidParamError("app"); + return NULL; + } + if (!org) { + org = ""; + } #if !TARGET_OS_TV - array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); + array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); #else - /* tvOS does not have persistent local storage! - * The only place on-device where we can store data is - * a cache directory that the OS can empty at any time. - * - * It's therefore very likely that save data will be erased - * between sessions. If you want your app's save data to - * actually stick around, you'll need to use iCloud storage. - */ - { - static SDL_bool shown = SDL_FALSE; - if (!shown) + /* tvOS does not have persistent local storage! + * The only place on-device where we can store data is + * a cache directory that the OS can empty at any time. + * + * It's therefore very likely that save data will be erased + * between sessions. If you want your app's save data to + * actually stick around, you'll need to use iCloud storage. + */ { - shown = SDL_TRUE; - SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n"); + static SDL_bool shown = SDL_FALSE; + if (!shown) { + shown = SDL_TRUE; + SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n"); + } } - } - array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); #endif /* !TARGET_OS_TV */ - if ([array count] > 0) { /* we only want the first item in the list. */ - NSString *str = [array objectAtIndex:0]; - const char *base = [str fileSystemRepresentation]; - if (base) { - const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; - retval = (char *) SDL_malloc(len); - if (retval == NULL) { - SDL_OutOfMemory(); - } else { - char *ptr; - if (*org) { - SDL_snprintf(retval, len, "%s/%s/%s/", base, org, app); + if ([array count] > 0) { /* we only want the first item in the list. */ + NSString *str = [array objectAtIndex:0]; + const char *base = [str fileSystemRepresentation]; + if (base) { + const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; + retval = (char *)SDL_malloc(len); + if (retval == NULL) { + SDL_OutOfMemory(); } else { - SDL_snprintf(retval, len, "%s/%s/", base, app); - } - for (ptr = retval+1; *ptr; ptr++) { - if (*ptr == '/') { - *ptr = '\0'; - mkdir(retval, 0700); - *ptr = '/'; + char *ptr; + if (*org) { + SDL_snprintf(retval, len, "%s/%s/%s/", base, org, app); + } else { + SDL_snprintf(retval, len, "%s/%s/", base, app); } + for (ptr = retval + 1; *ptr; ptr++) { + if (*ptr == '/') { + *ptr = '\0'; + mkdir(retval, 0700); + *ptr = '/'; + } + } + mkdir(retval, 0700); } - mkdir(retval, 0700); } } - } - return retval; -}} + return retval; + } +} #endif /* SDL_FILESYSTEM_COCOA */ diff --git a/src/filesystem/dummy/SDL_sysfilesystem.c b/src/filesystem/dummy/SDL_sysfilesystem.c index 7f22183f9f5b9..aa09063d0b31b 100644 --- a/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/src/filesystem/dummy/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,15 +28,13 @@ #include "SDL_error.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { SDL_Unsupported(); return NULL; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index f007af6252938..6d40e24d35b3f 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,15 +32,13 @@ #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = "/"; return SDL_strdup(retval); } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *append = "/libsdl/"; char *retval; @@ -56,7 +54,7 @@ SDL_GetPrefPath(const char *org, const char *app) } len = SDL_strlen(append) + SDL_strlen(org) + SDL_strlen(app) + 3; - retval = (char *) SDL_malloc(len); + retval = (char *)SDL_malloc(len); if (!retval) { SDL_OutOfMemory(); return NULL; @@ -68,17 +66,18 @@ SDL_GetPrefPath(const char *org, const char *app) SDL_snprintf(retval, len, "%s%s/", append, app); } - for (ptr = retval+1; *ptr; ptr++) { + for (ptr = retval + 1; *ptr; ptr++) { if (*ptr == '/') { *ptr = '\0'; - if (mkdir(retval, 0700) != 0 && errno != EEXIST) + if (mkdir(retval, 0700) != 0 && errno != EEXIST) { goto error; + } *ptr = '/'; } } if (mkdir(retval, 0700) != 0 && errno != EEXIST) { -error: + error: SDL_SetError("Couldn't create directory '%s': '%s'", retval, strerror(errno)); SDL_free(retval); return NULL; diff --git a/src/filesystem/gdk/SDL_sysfilesystem.cpp b/src/filesystem/gdk/SDL_sysfilesystem.cpp new file mode 100644 index 0000000000000..202f02b28b66d --- /dev/null +++ b/src/filesystem/gdk/SDL_sysfilesystem.cpp @@ -0,0 +1,138 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../SDL_internal.h" + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent filesystem routines */ + +#include "../../core/windows/SDL_windows.h" +#include "SDL_hints.h" +#include "SDL_system.h" +#include "SDL_filesystem.h" +#include + +char * +SDL_GetBasePath(void) +{ + /* NOTE: This function is a UTF8 version of the Win32 SDL_GetBasePath()! + * The GDK actually _recommends_ the 'A' functions over the 'W' functions :o + */ + DWORD buflen = 128; + CHAR *path = NULL; + DWORD len = 0; + int i; + + while (SDL_TRUE) { + void *ptr = SDL_realloc(path, buflen * sizeof(CHAR)); + if (!ptr) { + SDL_free(path); + SDL_OutOfMemory(); + return NULL; + } + + path = (CHAR *)ptr; + + len = GetModuleFileNameA(NULL, path, buflen); + /* if it truncated, then len >= buflen - 1 */ + /* if there was enough room (or failure), len < buflen - 1 */ + if (len < buflen - 1) { + break; + } + + /* buffer too small? Try again. */ + buflen *= 2; + } + + if (len == 0) { + SDL_free(path); + WIN_SetError("Couldn't locate our .exe"); + return NULL; + } + + for (i = len - 1; i > 0; i--) { + if (path[i] == '\\') { + break; + } + } + + SDL_assert(i > 0); /* Should have been an absolute path. */ + path[i + 1] = '\0'; /* chop off filename. */ + + return path; +} + +char * +SDL_GetPrefPath(const char *org, const char *app) +{ + XUserHandle user = NULL; + XAsyncBlock block = { 0 }; + char *folderPath; + HRESULT result; + const char *csid = SDL_GetHint("SDL_GDK_SERVICE_CONFIGURATION_ID"); + + if (!app) { + SDL_InvalidParamError("app"); + return NULL; + } + + /* This should be set before calling SDL_GetPrefPath! */ + if (!csid) { + SDL_LogWarn(SDL_LOG_CATEGORY_SYSTEM, "Set SDL_GDK_SERVICE_CONFIGURATION_ID before calling SDL_GetPrefPath!"); + return SDL_strdup("T:\\"); + } + + if (SDL_GDKGetDefaultUser(&user) < 0) { + /* Error already set, just return */ + return NULL; + } + + if (FAILED(result = XGameSaveFilesGetFolderWithUiAsync(user, csid, &block))) { + WIN_SetErrorFromHRESULT("XGameSaveFilesGetFolderWithUiAsync", result); + return NULL; + } + + folderPath = (char*) SDL_malloc(MAX_PATH); + do { + result = XGameSaveFilesGetFolderWithUiResult(&block, MAX_PATH, folderPath); + } while (result == E_PENDING); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT("XGameSaveFilesGetFolderWithUiResult", result); + SDL_free(folderPath); + return NULL; + } + + /* We aren't using 'app' here because the container rules are a lot more + * strict than the NTFS rules, so it will most likely be invalid :( + */ + SDL_strlcat(folderPath, "\\SDLPrefPath\\", MAX_PATH); + if (CreateDirectoryA(folderPath, NULL) == FALSE) { + if (GetLastError() != ERROR_ALREADY_EXISTS) { + WIN_SetError("CreateDirectoryA"); + SDL_free(folderPath); + return NULL; + } + } + return folderPath; +} + + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/filesystem/haiku/SDL_sysfilesystem.cc b/src/filesystem/haiku/SDL_sysfilesystem.cc index f359f36fe9937..921b33979b0e8 100644 --- a/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,8 +34,7 @@ #include "SDL_stdinc.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { image_info info; int32 cookie = 0; @@ -69,8 +68,7 @@ SDL_GetBasePath(void) } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { // !!! FIXME: is there a better way to do this? const char *home = SDL_getenv("HOME"); diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index 9d0621bd480a3..5fbbd51ff8730 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,24 +35,22 @@ SDL_FORCE_INLINE char *MakePrefPath(const char *app); SDL_FORCE_INLINE int CreatePrefPathDir(const char *pref); -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *base_path = SDL_strdup("romfs:/"); return base_path; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *pref_path = NULL; - if (app == NULL) { + if (!app) { SDL_InvalidParamError("app"); return NULL; } pref_path = MakePrefPath(app); - if (pref_path == NULL) { + if (!pref_path) { return NULL; } diff --git a/src/filesystem/nacl/SDL_sysfilesystem.c b/src/filesystem/nacl/SDL_sysfilesystem.c index b5bbe9841f3a1..8d5faa9b3fce2 100644 --- a/src/filesystem/nacl/SDL_sysfilesystem.c +++ b/src/filesystem/nacl/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,15 +24,13 @@ #ifdef SDL_FILESYSTEM_NACL -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { SDL_Unsupported(); return NULL; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/os2/SDL_sysfilesystem.c b/src/filesystem/os2/SDL_sysfilesystem.c index 3203f0b3ada4b..99fda9e7fce5f 100644 --- a/src/filesystem/os2/SDL_sysfilesystem.c +++ b/src/filesystem/os2/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,8 +36,7 @@ #include -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { PTIB tib; PPIB pib; @@ -71,8 +70,7 @@ SDL_GetBasePath(void) return OS2_SysToUTF8(acBuf); } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { PSZ pszPath; CHAR acBuf[CCHMAXPATH]; diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index 21c24b61b0c25..a71cd553e69d9 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,76 +31,76 @@ #include "SDL_error.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { - char *retval; - size_t len; - char cwd[FILENAME_MAX]; + char *retval = NULL; + size_t len; + char cwd[FILENAME_MAX]; - getcwd(cwd, sizeof(cwd)); - len = SDL_strlen(cwd) + 1; - retval = (char *) SDL_malloc(len); - if (retval) - SDL_memcpy(retval, cwd, len); + getcwd(cwd, sizeof(cwd)); + len = SDL_strlen(cwd) + 2; + retval = (char *)SDL_malloc(len); + SDL_snprintf(retval, len, "%s/", cwd); - return retval; + return retval; } /* Do a recursive mkdir of parents folders */ -static void recursive_mkdir(const char *dir) { - char tmp[FILENAME_MAX]; - char *base = SDL_GetBasePath(); - char *p = NULL; - size_t len; - - snprintf(tmp, sizeof(tmp),"%s",dir); - len = strlen(tmp); - if (tmp[len - 1] == '/') - tmp[len - 1] = 0; - - for (p = tmp + 1; *p; p++) { - if (*p == '/') { - *p = 0; - // Just creating subfolders from current path - if (strstr(tmp, base) != NULL) - mkdir(tmp, S_IRWXU); - - *p = '/'; +static void recursive_mkdir(const char *dir) +{ + char tmp[FILENAME_MAX]; + char *base = SDL_GetBasePath(); + char *p = NULL; + size_t len; + + snprintf(tmp, sizeof(tmp), "%s", dir); + len = strlen(tmp); + if (tmp[len - 1] == '/') { + tmp[len - 1] = 0; + } + + for (p = tmp + 1; *p; p++) { + if (*p == '/') { + *p = 0; + // Just creating subfolders from current path + if (strstr(tmp, base) != NULL) { + mkdir(tmp, S_IRWXU); + } + + *p = '/'; + } } - } - free(base); - mkdir(tmp, S_IRWXU); + free(base); + mkdir(tmp, S_IRWXU); } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { - char *retval = NULL; - size_t len; - char *base = SDL_GetBasePath(); - if (!app) { - SDL_InvalidParamError("app"); - return NULL; - } - if(!org) { - org = ""; - } - - len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; - retval = (char *) SDL_malloc(len); - - if (*org) { - SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); - } else { - SDL_snprintf(retval, len, "%s%s/", base, app); - } - free(base); - - recursive_mkdir(retval); - - return retval; + char *retval = NULL; + size_t len; + char *base = SDL_GetBasePath(); + if (!app) { + SDL_InvalidParamError("app"); + return NULL; + } + if (!org) { + org = ""; + } + + len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; + retval = (char *)SDL_malloc(len); + + if (*org) { + SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); + } else { + SDL_snprintf(retval, len, "%s%s/", base, app); + } + free(base); + + recursive_mkdir(retval); + + return retval; } #endif /* SDL_FILESYSTEM_PS2 */ diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index 4abb90ad73510..392399e3bfb33 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,8 +31,7 @@ #include "SDL_error.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = NULL; size_t len; @@ -40,14 +39,13 @@ SDL_GetBasePath(void) getcwd(cwd, sizeof(cwd)); len = SDL_strlen(cwd) + 2; - retval = (char *) SDL_malloc(len); + retval = (char *)SDL_malloc(len); SDL_snprintf(retval, len, "%s/", cwd); return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; @@ -56,12 +54,12 @@ SDL_GetPrefPath(const char *org, const char *app) SDL_InvalidParamError("app"); return NULL; } - if(!org) { + if (!org) { org = ""; } len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; - retval = (char *) SDL_malloc(len); + retval = (char *)SDL_malloc(len); if (*org) { SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index 58ff9f1611ebe..e0ac0800434b1 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,8 +34,7 @@ #include "SDL_filesystem.h" /* Wrapper around __unixify_std that uses SDL's memory allocators */ -static char * -SDL_unixify_std(const char *ro_path, char *buffer, size_t buf_len, int filetype) +static char *SDL_unixify_std(const char *ro_path, char *buffer, size_t buf_len, int filetype) { const char *const in_buf = buffer; /* = NULL if we allocate the buffer. */ @@ -53,8 +52,9 @@ SDL_unixify_std(const char *ro_path, char *buffer, size_t buf_len, int filetype) } if (!__unixify_std(ro_path, buffer, buf_len, filetype)) { - if (!in_buf) + if (!in_buf) { SDL_free(buffer); + } SDL_SetError("Could not convert '%s' to a Unix-style path", ro_path); return NULL; @@ -72,8 +72,7 @@ SDL_unixify_std(const char *ro_path, char *buffer, size_t buf_len, int filetype) return buffer; } -static char * -canonicalisePath(const char *path, const char *pathVar) +static char *canonicalisePath(const char *path, const char *pathVar) { _kernel_oserror *error; _kernel_swi_regs regs; @@ -108,8 +107,7 @@ canonicalisePath(const char *path, const char *pathVar) return buf; } -static _kernel_oserror * -createDirectoryRecursive(char *path) +static _kernel_oserror *createDirectoryRecursive(char *path) { char *ptr = NULL; _kernel_oserror *error; @@ -118,20 +116,20 @@ createDirectoryRecursive(char *path) regs.r[1] = (int)path; regs.r[2] = 0; - for (ptr = path+1; *ptr; ptr++) { + for (ptr = path + 1; *ptr; ptr++) { if (*ptr == '.') { *ptr = '\0'; error = _kernel_swi(OS_File, ®s, ®s); *ptr = '.'; - if (error != NULL) + if (error) { return error; + } } } return _kernel_swi(OS_File, ®s, ®s); } -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { _kernel_swi_regs regs; _kernel_oserror *error; @@ -149,16 +147,16 @@ SDL_GetBasePath(void) /* chop off filename. */ ptr = SDL_strrchr(canon, '.'); - if (ptr != NULL) + if (ptr) { *ptr = '\0'; + } retval = SDL_unixify_std(canon, NULL, 0, __RISCOSIFY_FILETYPE_NOTSPECIFIED); SDL_free(canon); return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { char *canon, *dir, *retval; size_t len; @@ -178,7 +176,7 @@ SDL_GetPrefPath(const char *org, const char *app) } len = SDL_strlen(canon) + SDL_strlen(org) + SDL_strlen(app) + 4; - dir = (char *) SDL_malloc(len); + dir = (char *)SDL_malloc(len); if (!dir) { SDL_OutOfMemory(); SDL_free(canon); @@ -194,7 +192,7 @@ SDL_GetPrefPath(const char *org, const char *app) SDL_free(canon); error = createDirectoryRecursive(dir); - if (error != NULL) { + if (error) { SDL_SetError("Couldn't create directory: %s", error->errmess); SDL_free(dir); return NULL; diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 416334d1a15f8..3f7533c4163fe 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -45,17 +45,15 @@ /* QNX's /proc/self/exefile is a text file and not a symlink. */ #if !defined(__QNXNTO__) -static char * -readSymLink(const char *path) +static char *readSymLink(const char *path) { char *retval = NULL; ssize_t len = 64; ssize_t rc = -1; - while (1) - { - char *ptr = (char *) SDL_realloc(retval, (size_t) len); - if (ptr == NULL) { + while (1) { + char *ptr = (char *)SDL_realloc(retval, (size_t)len); + if (!ptr) { SDL_OutOfMemory(); break; } @@ -64,13 +62,13 @@ readSymLink(const char *path) rc = readlink(path, retval, len); if (rc == -1) { - break; /* not a symlink, i/o error, etc. */ + break; /* not a symlink, i/o error, etc. */ } else if (rc < len) { - retval[rc] = '\0'; /* readlink doesn't null-terminate. */ - return retval; /* we're good to go. */ + retval[rc] = '\0'; /* readlink doesn't null-terminate. */ + return retval; /* we're good to go. */ } - len *= 2; /* grow buffer, try again. */ + len *= 2; /* grow buffer, try again. */ } SDL_free(retval); @@ -102,10 +100,10 @@ static char *search_path_for_binary(const char *bin) SDL_assert(bin != NULL); alloc_size = SDL_strlen(bin) + SDL_strlen(envr) + 2; - exe = (char *) SDL_malloc(alloc_size); + exe = (char *)SDL_malloc(alloc_size); do { - ptr = SDL_strchr(start, ':'); /* find next $PATH separator. */ + ptr = SDL_strchr(start, ':'); /* find next $PATH separator. */ if (ptr != start) { if (ptr) { *ptr = '\0'; @@ -119,27 +117,24 @@ static char *search_path_for_binary(const char *bin) return exe; } } - start = ptr + 1; /* start points to beginning of next element. */ - } while (ptr != NULL); + start = ptr + 1; /* start points to beginning of next element. */ + } while (ptr); SDL_free(envr); SDL_free(exe); SDL_SetError("Process not found in $PATH"); - return NULL; /* doesn't exist in path. */ + return NULL; /* doesn't exist in path. */ } #endif - - -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { char *retval = NULL; #if defined(__FREEBSD__) char fullpath[PATH_MAX]; - size_t buflen = sizeof (fullpath); + size_t buflen = sizeof(fullpath); const int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; if (sysctl(mib, SDL_arraysize(mib), fullpath, &buflen, NULL, 0) != -1) { retval = SDL_strdup(fullpath); @@ -156,7 +151,7 @@ SDL_GetBasePath(void) const int mib[] = { CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_ARGV }; if (sysctl(mib, 4, NULL, &len, NULL, 0) != -1) { char *exe, *pwddst; - char *realpathbuf = (char *) SDL_malloc(PATH_MAX + 1); + char *realpathbuf = (char *)SDL_malloc(PATH_MAX + 1); if (!realpathbuf) { SDL_OutOfMemory(); return NULL; @@ -173,19 +168,19 @@ SDL_GetBasePath(void) exe = cmdline[0]; pwddst = NULL; - if (SDL_strchr(exe, '/') == NULL) { /* not a relative or absolute path, check $PATH for it */ + if (SDL_strchr(exe, '/') == NULL) { /* not a relative or absolute path, check $PATH for it */ exe = search_path_for_binary(cmdline[0]); } else { if (exe && *exe == '.') { const char *pwd = SDL_getenv("PWD"); if (pwd && *pwd) { - SDL_asprintf(&pwddst, "%s/%s", pwd, exe); + SDL_asprintf(&pwddst, "%s/%s", pwd, exe); } } } if (exe) { - if (pwddst == NULL) { + if (!pwddst) { if (realpath(exe, realpathbuf) != NULL) { retval = realpathbuf; } @@ -208,16 +203,6 @@ SDL_GetBasePath(void) SDL_free(cmdline); } #endif -#if defined(__SOLARIS__) - const char *path = getexecname(); - if ((path != NULL) && (path[0] == '/')) { /* must be absolute path... */ - retval = SDL_strdup(path); - if (!retval) { - SDL_OutOfMemory(); - return NULL; - } - } -#endif /* is a Linux-style /proc filesystem available? */ if (!retval && (access("/proc", F_OK) == 0)) { @@ -228,48 +213,63 @@ SDL_GetBasePath(void) retval = readSymLink("/proc/curproc/file"); #elif defined(__NETBSD__) retval = readSymLink("/proc/curproc/exe"); +#elif defined(__SOLARIS__) + retval = readSymLink("/proc/self/path/a.out"); #elif defined(__QNXNTO__) retval = SDL_LoadFile("/proc/self/exefile", NULL); #else - retval = readSymLink("/proc/self/exe"); /* linux. */ - if (retval == NULL) { + retval = readSymLink("/proc/self/exe"); /* linux. */ + if (!retval) { /* older kernels don't have /proc/self ... try PID version... */ char path[64]; const int rc = SDL_snprintf(path, sizeof(path), - "/proc/%llu/exe", - (unsigned long long) getpid()); - if ( (rc > 0) && (rc < sizeof(path)) ) { + "/proc/%llu/exe", + (unsigned long long)getpid()); + if ((rc > 0) && (rc < sizeof(path))) { retval = readSymLink(path); } } #endif } +#if defined(__SOLARIS__) /* try this as a fallback if /proc didn't pan out */ + if (!retval) { + const char *path = getexecname(); + if ((path != NULL) && (path[0] == '/')) { /* must be absolute path... */ + retval = SDL_strdup(path); + if (!retval) { + SDL_OutOfMemory(); + return NULL; + } + } + } +#endif + /* If we had access to argv[0] here, we could check it for a path, or troll through $PATH looking for it, too. */ - if (retval != NULL) { /* chop off filename. */ + if (retval) { /* chop off filename. */ char *ptr = SDL_strrchr(retval, '/'); - if (ptr != NULL) { - *(ptr+1) = '\0'; - } else { /* shouldn't happen, but just in case... */ + if (ptr) { + *(ptr + 1) = '\0'; + } else { /* shouldn't happen, but just in case... */ SDL_free(retval); retval = NULL; } } - if (retval != NULL) { + if (retval) { /* try to shrink buffer... */ - char *ptr = (char *) SDL_realloc(retval, SDL_strlen(retval) + 1); - if (ptr != NULL) - retval = ptr; /* oh well if it failed. */ + char *ptr = (char *)SDL_realloc(retval, SDL_strlen(retval) + 1); + if (ptr) { + retval = ptr; /* oh well if it failed. */ + } } return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { /* * We use XDG's base directory spec, even if you're not on Linux. @@ -306,32 +306,34 @@ SDL_GetPrefPath(const char *org, const char *app) } len = SDL_strlen(envr); - if (envr[len - 1] == '/') + if (envr[len - 1] == '/') { append += 1; + } len += SDL_strlen(append) + SDL_strlen(org) + SDL_strlen(app) + 3; - retval = (char *) SDL_malloc(len); + retval = (char *)SDL_malloc(len); if (!retval) { SDL_OutOfMemory(); return NULL; } if (*org) { - SDL_snprintf(retval, len, "%s%s%s/%s/", envr, append, org, app); + (void)SDL_snprintf(retval, len, "%s%s%s/%s/", envr, append, org, app); } else { - SDL_snprintf(retval, len, "%s%s%s/", envr, append, app); + (void)SDL_snprintf(retval, len, "%s%s%s/", envr, append, app); } - for (ptr = retval+1; *ptr; ptr++) { + for (ptr = retval + 1; *ptr; ptr++) { if (*ptr == '/') { *ptr = '\0'; - if (mkdir(retval, 0700) != 0 && errno != EEXIST) + if (mkdir(retval, 0700) != 0 && errno != EEXIST) { goto error; + } *ptr = '/'; } } if (mkdir(retval, 0700) != 0 && errno != EEXIST) { -error: + error: SDL_SetError("Couldn't create directory '%s': '%s'", retval, strerror(errno)); SDL_free(retval); return NULL; diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index 1952cadf5c0b1..0ae693ff0bb62 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,16 +39,14 @@ #include "SDL_filesystem.h" #include "SDL_rwops.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { const char *basepath = "app0:/"; char *retval = SDL_strdup(basepath); return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { const char *envr = "ux0:/data/"; char *retval = NULL; @@ -66,7 +64,7 @@ SDL_GetPrefPath(const char *org, const char *app) len = SDL_strlen(envr); len += SDL_strlen(org) + SDL_strlen(app) + 3; - retval = (char *) SDL_malloc(len); + retval = (char *)SDL_malloc(len); if (!retval) { SDL_OutOfMemory(); return NULL; @@ -78,7 +76,7 @@ SDL_GetPrefPath(const char *org, const char *app) SDL_snprintf(retval, len, "%s%s/", envr, app); } - for (ptr = retval+1; *ptr; ptr++) { + for (ptr = retval + 1; *ptr; ptr++) { if (*ptr == '/') { *ptr = '\0'; sceIoMkdir(retval, 0777); diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index 5d3099be67463..c8aea9030101a 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,8 +32,7 @@ #include "SDL_stdinc.h" #include "SDL_filesystem.h" -char * -SDL_GetBasePath(void) +char *SDL_GetBasePath(void) { DWORD buflen = 128; WCHAR *path = NULL; @@ -42,14 +41,14 @@ SDL_GetBasePath(void) int i; while (SDL_TRUE) { - void *ptr = SDL_realloc(path, buflen * sizeof (WCHAR)); + void *ptr = SDL_realloc(path, buflen * sizeof(WCHAR)); if (!ptr) { SDL_free(path); SDL_OutOfMemory(); return NULL; } - path = (WCHAR *) ptr; + path = (WCHAR *)ptr; len = GetModuleFileNameW(NULL, path, buflen); /* if it truncated, then len >= buflen - 1 */ @@ -68,14 +67,14 @@ SDL_GetBasePath(void) return NULL; } - for (i = len-1; i > 0; i--) { + for (i = len - 1; i > 0; i--) { if (path[i] == '\\') { break; } } - SDL_assert(i > 0); /* Should have been an absolute path. */ - path[i+1] = '\0'; /* chop off filename. */ + SDL_assert(i > 0); /* Should have been an absolute path. */ + path[i + 1] = '\0'; /* chop off filename. */ retval = WIN_StringToUTF8W(path); SDL_free(path); @@ -83,8 +82,7 @@ SDL_GetBasePath(void) return retval; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_GetPrefPath(const char *org, const char *app) { /* * Vista and later has a new API for this, but SHGetFolderPath works there, @@ -96,8 +94,8 @@ SDL_GetPrefPath(const char *org, const char *app) WCHAR path[MAX_PATH]; char *retval = NULL; - WCHAR* worg = NULL; - WCHAR* wapp = NULL; + WCHAR *worg = NULL; + WCHAR *wapp = NULL; size_t new_wpath_len = 0; BOOL api_result = FALSE; @@ -115,13 +113,13 @@ SDL_GetPrefPath(const char *org, const char *app) } worg = WIN_UTF8ToStringW(org); - if (worg == NULL) { + if (!worg) { SDL_OutOfMemory(); return NULL; } wapp = WIN_UTF8ToStringW(app); - if (wapp == NULL) { + if (!wapp) { SDL_free(worg); SDL_OutOfMemory(); return NULL; @@ -172,23 +170,4 @@ SDL_GetPrefPath(const char *org, const char *app) #endif /* SDL_FILESYSTEM_WINDOWS */ -#ifdef SDL_FILESYSTEM_XBOX -#include "SDL_filesystem.h" -#include "SDL_error.h" -char * -SDL_GetBasePath(void) -{ - SDL_Unsupported(); - return NULL; -} - -char * -SDL_GetPrefPath(const char *org, const char *app) -{ - SDL_Unsupported(); - return NULL; -} -#endif /* SDL_FILESYSTEM_XBOX */ - - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index 115b45b1a4381..43c3d835419a5 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" /* TODO, WinRT: remove the need to compile this with C++/CX (/ZW) extensions, and if possible, without C++ at all -*/ + */ #ifdef __WINRT__ @@ -44,55 +44,55 @@ extern "C" const wchar_t * SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType) { switch (pathType) { - case SDL_WINRT_PATH_INSTALLED_LOCATION: - { - static wstring path; - if (path.empty()) { + case SDL_WINRT_PATH_INSTALLED_LOCATION: + { + static wstring path; + if (path.empty()) { #if defined(NTDDI_WIN10_19H1) && (NTDDI_VERSION >= NTDDI_WIN10_19H1) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) /* Only PC supports mods */ - /* Windows 1903 supports mods, via the EffectiveLocation API */ - if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) { - path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data(); - } else { - path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); - } -#else + /* Windows 1903 supports mods, via the EffectiveLocation API */ + if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) { + path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data(); + } else { path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); -#endif } - return path.c_str(); +#else + path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); +#endif } + return path.c_str(); + } - case SDL_WINRT_PATH_LOCAL_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->LocalFolder->Path->Data(); - } - return path.c_str(); + case SDL_WINRT_PATH_LOCAL_FOLDER: + { + static wstring path; + if (path.empty()) { + path = ApplicationData::Current->LocalFolder->Path->Data(); } + return path.c_str(); + } -#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) - case SDL_WINRT_PATH_ROAMING_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->RoamingFolder->Path->Data(); - } - return path.c_str(); +#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION > NTDDI_WIN8) + case SDL_WINRT_PATH_ROAMING_FOLDER: + { + static wstring path; + if (path.empty()) { + path = ApplicationData::Current->RoamingFolder->Path->Data(); } + return path.c_str(); + } - case SDL_WINRT_PATH_TEMP_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->TemporaryFolder->Path->Data(); - } - return path.c_str(); + case SDL_WINRT_PATH_TEMP_FOLDER: + { + static wstring path; + if (path.empty()) { + path = ApplicationData::Current->TemporaryFolder->Path->Data(); } + return path.c_str(); + } #endif - default: - break; + default: + break; } SDL_Unsupported(); @@ -110,12 +110,12 @@ SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType) return searchResult->second.c_str(); } - const wchar_t * ucs2Path = SDL_WinRTGetFSPathUNICODE(pathType); + const wchar_t *ucs2Path = SDL_WinRTGetFSPathUNICODE(pathType); if (!ucs2Path) { return NULL; } - char * utf8Path = WIN_StringToUTF8(ucs2Path); + char *utf8Path = WIN_StringToUTF8W(ucs2Path); utf8Paths[pathType] = utf8Path; SDL_free(utf8Path); return utf8Paths[pathType].c_str(); @@ -124,9 +124,9 @@ SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType) extern "C" char * SDL_GetBasePath(void) { - const char * srcPath = SDL_WinRTGetFSPathUTF8(SDL_WINRT_PATH_INSTALLED_LOCATION); + const char *srcPath = SDL_WinRTGetFSPathUTF8(SDL_WINRT_PATH_INSTALLED_LOCATION); size_t destPathLen; - char * destPath = NULL; + char *destPath = NULL; if (!srcPath) { SDL_SetError("Couldn't locate our basepath: %s", SDL_GetError()); @@ -134,7 +134,7 @@ SDL_GetBasePath(void) } destPathLen = SDL_strlen(srcPath) + 2; - destPath = (char *) SDL_malloc(destPathLen); + destPath = (char *)SDL_malloc(destPathLen); if (!destPath) { SDL_OutOfMemory(); return NULL; @@ -153,11 +153,11 @@ SDL_GetPrefPath(const char *org, const char *app) * without violating Microsoft's app-store requirements. */ - const WCHAR * srcPath = NULL; + const WCHAR *srcPath = NULL; WCHAR path[MAX_PATH]; char *retval = NULL; - WCHAR* worg = NULL; - WCHAR* wapp = NULL; + WCHAR *worg = NULL; + WCHAR *wapp = NULL; size_t new_wpath_len = 0; BOOL api_result = FALSE; @@ -170,7 +170,7 @@ SDL_GetPrefPath(const char *org, const char *app) } srcPath = SDL_WinRTGetFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER); - if ( ! srcPath) { + if (!srcPath) { SDL_SetError("Unable to find a source path"); return NULL; } @@ -181,14 +181,14 @@ SDL_GetPrefPath(const char *org, const char *app) } SDL_wcslcpy(path, srcPath, SDL_arraysize(path)); - worg = WIN_UTF8ToString(org); - if (worg == NULL) { + worg = WIN_UTF8ToStringW(org); + if (!worg) { SDL_OutOfMemory(); return NULL; } - wapp = WIN_UTF8ToString(app); - if (wapp == NULL) { + wapp = WIN_UTF8ToStringW(app); + if (!wapp) { SDL_free(worg); SDL_OutOfMemory(); return NULL; @@ -232,7 +232,7 @@ SDL_GetPrefPath(const char *org, const char *app) SDL_wcslcat(path, L"\\", new_wpath_len + 1); - retval = WIN_StringToUTF8(path); + retval = WIN_StringToUTF8W(path); return retval; } diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 3f87143ca6ca0..86510d5085204 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,19 +23,97 @@ #include "SDL_syshaptic.h" #include "SDL_haptic_c.h" #include "../joystick/SDL_joystick_c.h" /* For SDL_PrivateJoystickValid */ +#include "SDL_hints.h" +#include "../SDL_hints_c.h" + +typedef struct SDL_Haptic_VIDPID_Naxes { + Uint16 vid; + Uint16 pid; + Uint16 naxes; +} SDL_Haptic_VIDPID_Naxes; + +static void SDL_HapticLoadAxesList(SDL_Haptic_VIDPID_Naxes **entries, int *num_entries) +{ + SDL_Haptic_VIDPID_Naxes entry; + const char *spot; + int length = 0; + + spot = SDL_GetHint(SDL_HINT_JOYSTICK_HAPTIC_AXES); + if (!spot) + return; + + while (SDL_sscanf(spot, "0x%hx/0x%hx/%hu%n", &entry.vid, &entry.pid, &entry.naxes, &length) == 3) { + SDL_assert(length > 0); + spot += length; + length = 0; + + if ((*num_entries % 8) == 0) { + int new_max = *num_entries + 8; + SDL_Haptic_VIDPID_Naxes *new_entries = + (SDL_Haptic_VIDPID_Naxes *)SDL_realloc(*entries, new_max * sizeof(**entries)); + + // Out of memory, go with what we have already + if (!new_entries) + break; + + *entries = new_entries; + } + (*entries)[(*num_entries)++] = entry; + + if (spot[0] == ',') + spot++; + } +} + +// /* Return -1 if not found */ +static int SDL_HapticNaxesListIndex(struct SDL_Haptic_VIDPID_Naxes *entries, int num_entries, Uint16 vid, Uint16 pid) +{ + int i; + if (!entries) + return -1; + + for (i = 0; i < num_entries; ++i) { + if (entries[i].vid == vid && entries[i].pid == pid) + return i; + } + + return -1; +} + +// Check if device needs a custom number of naxes +static int SDL_HapticGetNaxes(Uint16 vid, Uint16 pid) +{ + int num_entries = 0, index = 0, naxes = -1; + SDL_Haptic_VIDPID_Naxes *naxes_list = NULL; + + SDL_HapticLoadAxesList(&naxes_list, &num_entries); + if (!num_entries || !naxes_list) + return -1; + + // Perform "wildcard" pass + index = SDL_HapticNaxesListIndex(naxes_list, num_entries, 0xffff, 0xffff); + if (index >= 0) + naxes = naxes_list[index].naxes; + + index = SDL_HapticNaxesListIndex(naxes_list, num_entries, vid, pid); + if (index >= 0) + naxes = naxes_list[index].naxes; + + SDL_free(naxes_list); + return naxes; +} /* Global for SDL_windowshaptic.c */ -#if (defined(SDL_HAPTIC_DINPUT) && SDL_HAPTIC_DINPUT) || (defined(SDL_HAPTIC_XINPUT) && SDL_HAPTIC_XINPUT) +#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT) SDL_Haptic *SDL_haptics = NULL; -#else +#else static SDL_Haptic *SDL_haptics = NULL; #endif /* * Initializes the Haptic devices. */ -int -SDL_HapticInit(void) +int SDL_HapticInit(void) { int status; @@ -47,21 +125,18 @@ SDL_HapticInit(void) return status; } - /* * Checks to see if the haptic device is valid */ -static int -ValidHaptic(SDL_Haptic * haptic) +static int ValidHaptic(SDL_Haptic *haptic) { int valid; SDL_Haptic *hapticlist; valid = 0; - if (haptic != NULL) { + if (haptic) { hapticlist = SDL_haptics; - while ( hapticlist ) - { + while (hapticlist) { if (hapticlist == haptic) { valid = 1; break; @@ -78,22 +153,18 @@ ValidHaptic(SDL_Haptic * haptic) return valid; } - /* * Returns the number of available devices. */ -int -SDL_NumHaptics(void) +int SDL_NumHaptics(void) { return SDL_SYS_NumHaptics(); } - /* * Gets the name of a Haptic device by index. */ -const char * -SDL_HapticName(int device_index) +const char *SDL_HapticName(int device_index) { if ((device_index < 0) || (device_index >= SDL_NumHaptics())) { SDL_SetError("Haptic: There are %d haptic devices available", @@ -103,12 +174,10 @@ SDL_HapticName(int device_index) return SDL_SYS_HapticName(device_index); } - /* * Opens a Haptic device. */ -SDL_Haptic * -SDL_HapticOpen(int device_index) +SDL_Haptic *SDL_HapticOpen(int device_index) { SDL_Haptic *haptic; SDL_Haptic *hapticlist; @@ -121,10 +190,9 @@ SDL_HapticOpen(int device_index) hapticlist = SDL_haptics; /* If the haptic is already open, return it - * TODO: Should we create haptic instance IDs like the Joystick API? - */ - while ( hapticlist ) - { + * TODO: Should we create haptic instance IDs like the Joystick API? + */ + while (hapticlist) { if (device_index == hapticlist->index) { haptic = hapticlist; ++haptic->ref_count; @@ -134,14 +202,14 @@ SDL_HapticOpen(int device_index) } /* Create the haptic device */ - haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic)); - if (haptic == NULL) { + haptic = (SDL_Haptic *)SDL_malloc(sizeof(*haptic)); + if (!haptic) { SDL_OutOfMemory(); return NULL; } /* Initialize the haptic device */ - SDL_memset(haptic, 0, (sizeof *haptic)); + SDL_memset(haptic, 0, sizeof(*haptic)); haptic->rumble_id = -1; haptic->index = device_index; if (SDL_SYS_HapticOpen(haptic) < 0) { @@ -156,20 +224,20 @@ SDL_HapticOpen(int device_index) SDL_haptics = haptic; /* Disable autocenter and set gain to max. */ - if (haptic->supported & SDL_HAPTIC_GAIN) + if (haptic->supported & SDL_HAPTIC_GAIN) { SDL_HapticSetGain(haptic, 100); - if (haptic->supported & SDL_HAPTIC_AUTOCENTER) + } + if (haptic->supported & SDL_HAPTIC_AUTOCENTER) { SDL_HapticSetAutocenter(haptic, 0); + } return haptic; } - /* * Returns 1 if the device has been opened. */ -int -SDL_HapticOpened(int device_index) +int SDL_HapticOpened(int device_index) { int opened; SDL_Haptic *hapticlist; @@ -184,9 +252,8 @@ SDL_HapticOpened(int device_index) opened = 0; hapticlist = SDL_haptics; /* TODO Should this use an instance ID? */ - while ( hapticlist ) - { - if (hapticlist->index == (Uint8) device_index) { + while (hapticlist) { + if (hapticlist->index == (Uint8)device_index) { opened = 1; break; } @@ -195,12 +262,10 @@ SDL_HapticOpened(int device_index) return opened; } - /* * Returns the index to a haptic device. */ -int -SDL_HapticIndex(SDL_Haptic * haptic) +int SDL_HapticIndex(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; @@ -209,24 +274,21 @@ SDL_HapticIndex(SDL_Haptic * haptic) return haptic->index; } - /* * Returns SDL_TRUE if mouse is haptic, SDL_FALSE if it isn't. */ -int -SDL_MouseIsHaptic(void) +int SDL_MouseIsHaptic(void) { - if (SDL_SYS_HapticMouse() < 0) + if (SDL_SYS_HapticMouse() < 0) { return SDL_FALSE; + } return SDL_TRUE; } - /* * Returns the haptic device if mouse is haptic or NULL elsewise. */ -SDL_Haptic * -SDL_HapticOpenFromMouse(void) +SDL_Haptic *SDL_HapticOpenFromMouse(void) { int device_index; @@ -240,39 +302,43 @@ SDL_HapticOpenFromMouse(void) return SDL_HapticOpen(device_index); } - /* * Returns SDL_TRUE if joystick has haptic features. */ -int -SDL_JoystickIsHaptic(SDL_Joystick * joystick) +int SDL_JoystickIsHaptic(SDL_Joystick *joystick) { int ret; - /* Must be a valid joystick */ - if (!SDL_PrivateJoystickValid(joystick)) { - return -1; - } + SDL_LockJoysticks(); + { + /* Must be a valid joystick */ + if (!SDL_PrivateJoystickValid(joystick)) { + SDL_UnlockJoysticks(); + return -1; + } - ret = SDL_SYS_JoystickIsHaptic(joystick); + ret = SDL_SYS_JoystickIsHaptic(joystick); + } + SDL_UnlockJoysticks(); - if (ret > 0) + if (ret > 0) { return SDL_TRUE; - else if (ret == 0) + } else if (ret == 0) { return SDL_FALSE; - else - return -1; -} + } + return -1; +} /* * Opens a haptic device from a joystick. */ -SDL_Haptic * -SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) +SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick) { SDL_Haptic *haptic; SDL_Haptic *hapticlist; + int naxes, general_axes; + Uint16 vid, pid; /* Make sure there is room. */ if (SDL_NumHaptics() <= 0) { @@ -281,45 +347,65 @@ SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) return NULL; } - /* Must be a valid joystick */ - if (!SDL_PrivateJoystickValid(joystick)) { - SDL_SetError("Haptic: Joystick isn't valid."); - return NULL; - } + SDL_LockJoysticks(); + { + /* Must be a valid joystick */ + if (!SDL_PrivateJoystickValid(joystick)) { + SDL_SetError("Haptic: Joystick isn't valid."); + SDL_UnlockJoysticks(); + return NULL; + } - /* Joystick must be haptic */ - if (SDL_SYS_JoystickIsHaptic(joystick) <= 0) { - SDL_SetError("Haptic: Joystick isn't a haptic device."); - return NULL; - } + /* Joystick must be haptic */ + if (SDL_SYS_JoystickIsHaptic(joystick) <= 0) { + SDL_SetError("Haptic: Joystick isn't a haptic device."); + SDL_UnlockJoysticks(); + return NULL; + } - hapticlist = SDL_haptics; - /* Check to see if joystick's haptic is already open */ - while ( hapticlist ) - { - if (SDL_SYS_JoystickSameHaptic(hapticlist, joystick)) { - haptic = hapticlist; - ++haptic->ref_count; - return haptic; + hapticlist = SDL_haptics; + /* Check to see if joystick's haptic is already open */ + while (hapticlist) { + if (SDL_SYS_JoystickSameHaptic(hapticlist, joystick)) { + haptic = hapticlist; + ++haptic->ref_count; + SDL_UnlockJoysticks(); + return haptic; + } + hapticlist = hapticlist->next; } - hapticlist = hapticlist->next; - } - /* Create the haptic device */ - haptic = (SDL_Haptic *) SDL_malloc((sizeof *haptic)); - if (haptic == NULL) { - SDL_OutOfMemory(); - return NULL; - } + /* Create the haptic device */ + haptic = (SDL_Haptic *)SDL_malloc(sizeof(*haptic)); + if (!haptic) { + SDL_OutOfMemory(); + SDL_UnlockJoysticks(); + return NULL; + } - /* Initialize the haptic device */ - SDL_memset(haptic, 0, sizeof(SDL_Haptic)); - haptic->rumble_id = -1; - if (SDL_SYS_HapticOpenFromJoystick(haptic, joystick) < 0) { - SDL_SetError("Haptic: SDL_SYS_HapticOpenFromJoystick failed."); - SDL_free(haptic); - return NULL; + /* Initialize the haptic device */ + SDL_memset(haptic, 0, sizeof(SDL_Haptic)); + haptic->rumble_id = -1; + if (SDL_SYS_HapticOpenFromJoystick(haptic, joystick) < 0) { + SDL_SetError("Haptic: SDL_SYS_HapticOpenFromJoystick failed."); + SDL_free(haptic); + SDL_UnlockJoysticks(); + return NULL; + } } + SDL_UnlockJoysticks(); + + vid = SDL_JoystickGetVendor(joystick); + pid = SDL_JoystickGetProduct(joystick); + general_axes = SDL_JoystickNumAxes(joystick); + + naxes = SDL_HapticGetNaxes(vid, pid); + if (naxes > 0) + haptic->naxes = naxes; + + // Limit to the actual number of axes found on the device + if (general_axes >= 0 && naxes > general_axes) + haptic->naxes = general_axes; /* Add haptic to list */ ++haptic->ref_count; @@ -330,12 +416,10 @@ SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) return haptic; } - /* * Closes a SDL_Haptic device. */ -void -SDL_HapticClose(SDL_Haptic * haptic) +void SDL_HapticClose(SDL_Haptic *haptic) { int i; SDL_Haptic *hapticlist; @@ -362,17 +446,12 @@ SDL_HapticClose(SDL_Haptic * haptic) /* Remove from the list */ hapticlist = SDL_haptics; hapticlistprev = NULL; - while ( hapticlist ) - { - if (haptic == hapticlist) - { - if ( hapticlistprev ) - { + while (hapticlist) { + if (haptic == hapticlist) { + if (hapticlistprev) { /* unlink this entry */ hapticlistprev->next = hapticlist->next; - } - else - { + } else { SDL_haptics = haptic->next; } @@ -389,8 +468,7 @@ SDL_HapticClose(SDL_Haptic * haptic) /* * Cleans up after the subsystem. */ -void -SDL_HapticQuit(void) +void SDL_HapticQuit(void) { while (SDL_haptics) { SDL_HapticClose(SDL_haptics); @@ -402,8 +480,7 @@ SDL_HapticQuit(void) /* * Returns the number of effects a haptic device has. */ -int -SDL_HapticNumEffects(SDL_Haptic * haptic) +int SDL_HapticNumEffects(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; @@ -412,12 +489,10 @@ SDL_HapticNumEffects(SDL_Haptic * haptic) return haptic->neffects; } - /* * Returns the number of effects a haptic device can play. */ -int -SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic) +int SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; @@ -426,12 +501,10 @@ SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic) return haptic->nplaying; } - /* * Returns supported effects by the device. */ -unsigned int -SDL_HapticQuery(SDL_Haptic * haptic) +unsigned int SDL_HapticQuery(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return 0; /* same as if no effects were supported */ @@ -440,12 +513,10 @@ SDL_HapticQuery(SDL_Haptic * haptic) return haptic->supported; } - /* * Returns the number of axis on the device. */ -int -SDL_HapticNumAxes(SDL_Haptic * haptic) +int SDL_HapticNumAxes(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; @@ -457,23 +528,22 @@ SDL_HapticNumAxes(SDL_Haptic * haptic) /* * Checks to see if the device can support the effect. */ -int -SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect) +int SDL_HapticEffectSupported(SDL_Haptic *haptic, SDL_HapticEffect *effect) { if (!ValidHaptic(haptic)) { return -1; } - if ((haptic->supported & effect->type) != 0) + if ((haptic->supported & effect->type) != 0) { return SDL_TRUE; + } return SDL_FALSE; } /* * Creates a new haptic effect. */ -int -SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) +int SDL_HapticNewEffect(SDL_Haptic *haptic, SDL_HapticEffect *effect) { int i; @@ -492,9 +562,8 @@ SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) if (haptic->effects[i].hweffect == NULL) { /* Now let the backend create the real effect */ - if (SDL_SYS_HapticNewEffect(haptic, &haptic->effects[i], effect) - != 0) { - return -1; /* Backend failed to create effect */ + if (SDL_SYS_HapticNewEffect(haptic, &haptic->effects[i], effect) != 0) { + return -1; /* Backend failed to create effect */ } SDL_memcpy(&haptic->effects[i].effect, effect, @@ -509,8 +578,7 @@ SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) /* * Checks to see if an effect is valid. */ -static int -ValidEffect(SDL_Haptic * haptic, int effect) +static int ValidEffect(SDL_Haptic *haptic, int effect) { if ((effect < 0) || (effect >= haptic->neffects)) { SDL_SetError("Haptic: Invalid effect identifier."); @@ -522,9 +590,8 @@ ValidEffect(SDL_Haptic * haptic, int effect) /* * Updates an effect. */ -int -SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, - SDL_HapticEffect * data) +int SDL_HapticUpdateEffect(SDL_Haptic *haptic, int effect, + SDL_HapticEffect *data) { if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { return -1; @@ -546,20 +613,17 @@ SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, return 0; } - /* * Runs the haptic effect on the device. */ -int -SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations) +int SDL_HapticRunEffect(SDL_Haptic *haptic, int effect, Uint32 iterations) { if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { return -1; } /* Run the effect */ - if (SDL_SYS_HapticRunEffect(haptic, &haptic->effects[effect], iterations) - < 0) { + if (SDL_SYS_HapticRunEffect(haptic, &haptic->effects[effect], iterations) < 0) { return -1; } @@ -569,8 +633,7 @@ SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations) /* * Stops the haptic effect on the device. */ -int -SDL_HapticStopEffect(SDL_Haptic * haptic, int effect) +int SDL_HapticStopEffect(SDL_Haptic *haptic, int effect) { if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { return -1; @@ -587,8 +650,7 @@ SDL_HapticStopEffect(SDL_Haptic * haptic, int effect) /* * Gets rid of a haptic effect. */ -void -SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) +void SDL_HapticDestroyEffect(SDL_Haptic *haptic, int effect) { if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { return; @@ -605,14 +667,13 @@ SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) /* * Gets the status of a haptic effect. */ -int -SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect) +int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) { if (!ValidHaptic(haptic) || !ValidEffect(haptic, effect)) { return -1; } - if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) { + if (!(haptic->supported & SDL_HAPTIC_STATUS)) { return SDL_SetError("Haptic: Device does not support status queries."); } @@ -622,8 +683,7 @@ SDL_HapticGetEffectStatus(SDL_Haptic * haptic, int effect) /* * Sets the global gain of the device. */ -int -SDL_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_HapticSetGain(SDL_Haptic *haptic, int gain) { const char *env; int real_gain, max_gain; @@ -632,7 +692,7 @@ SDL_HapticSetGain(SDL_Haptic * haptic, int gain) return -1; } - if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) { + if (!(haptic->supported & SDL_HAPTIC_GAIN)) { return SDL_SetError("Haptic: Device does not support setting gain."); } @@ -642,14 +702,15 @@ SDL_HapticSetGain(SDL_Haptic * haptic, int gain) /* We use the envvar to get the maximum gain. */ env = SDL_getenv("SDL_HAPTIC_GAIN_MAX"); - if (env != NULL) { + if (env) { max_gain = SDL_atoi(env); /* Check for sanity. */ - if (max_gain < 0) + if (max_gain < 0) { max_gain = 0; - else if (max_gain > 100) + } else if (max_gain > 100) { max_gain = 100; + } /* We'll scale it linearly with SDL_HAPTIC_GAIN_MAX */ real_gain = (gain * max_gain) / 100; @@ -667,14 +728,13 @@ SDL_HapticSetGain(SDL_Haptic * haptic, int gain) /* * Makes the device autocenter, 0 disables. */ -int -SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { if (!ValidHaptic(haptic)) { return -1; } - if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) { + if (!(haptic->supported & SDL_HAPTIC_AUTOCENTER)) { return SDL_SetError("Haptic: Device does not support setting autocenter."); } @@ -692,14 +752,13 @@ SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) /* * Pauses the haptic device. */ -int -SDL_HapticPause(SDL_Haptic * haptic) +int SDL_HapticPause(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; } - if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { + if (!(haptic->supported & SDL_HAPTIC_PAUSE)) { return SDL_SetError("Haptic: Device does not support setting pausing."); } @@ -709,15 +768,14 @@ SDL_HapticPause(SDL_Haptic * haptic) /* * Unpauses the haptic device. */ -int -SDL_HapticUnpause(SDL_Haptic * haptic) +int SDL_HapticUnpause(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; } - if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) { - return 0; /* Not going to be paused, so we pretend it's unpaused. */ + if (!(haptic->supported & SDL_HAPTIC_PAUSE)) { + return 0; /* Not going to be paused, so we pretend it's unpaused. */ } return SDL_SYS_HapticUnpause(haptic); @@ -726,8 +784,7 @@ SDL_HapticUnpause(SDL_Haptic * haptic) /* * Stops all the currently playing effects. */ -int -SDL_HapticStopAll(SDL_Haptic * haptic) +int SDL_HapticStopAll(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; @@ -739,22 +796,20 @@ SDL_HapticStopAll(SDL_Haptic * haptic) /* * Checks to see if rumble is supported. */ -int -SDL_HapticRumbleSupported(SDL_Haptic * haptic) +int SDL_HapticRumbleSupported(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; } /* Most things can use SINE, but XInput only has LEFTRIGHT. */ - return ((haptic->supported & (SDL_HAPTIC_SINE|SDL_HAPTIC_LEFTRIGHT)) != 0); + return (haptic->supported & (SDL_HAPTIC_SINE | SDL_HAPTIC_LEFTRIGHT)) != 0; } /* * Initializes the haptic device for simple rumble playback. */ -int -SDL_HapticRumbleInit(SDL_Haptic * haptic) +int SDL_HapticRumbleInit(SDL_Haptic *haptic) { SDL_HapticEffect *efx = &haptic->rumble_effect; @@ -776,7 +831,7 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic) efx->periodic.length = 5000; efx->periodic.attack_length = 0; efx->periodic.fade_length = 0; - } else if (haptic->supported & SDL_HAPTIC_LEFTRIGHT) { /* XInput? */ + } else if (haptic->supported & SDL_HAPTIC_LEFTRIGHT) { /* XInput? */ efx->type = SDL_HAPTIC_LEFTRIGHT; efx->leftright.length = 5000; efx->leftright.large_magnitude = 0x4000; @@ -795,8 +850,7 @@ SDL_HapticRumbleInit(SDL_Haptic * haptic) /* * Runs simple rumble on a haptic device */ -int -SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) +int SDL_HapticRumblePlay(SDL_Haptic *haptic, float strength, Uint32 length) { SDL_HapticEffect *efx; Sint16 magnitude; @@ -815,7 +869,7 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) } else if (strength < 0.0f) { strength = 0.0f; } - magnitude = (Sint16)(32767.0f*strength); + magnitude = (Sint16)(32767.0f * strength); efx = &haptic->rumble_effect; if (efx->type == SDL_HAPTIC_SINE) { @@ -838,8 +892,7 @@ SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length) /* * Stops the simple rumble on a haptic device. */ -int -SDL_HapticRumbleStop(SDL_Haptic * haptic) +int SDL_HapticRumbleStop(SDL_Haptic *haptic) { if (!ValidHaptic(haptic)) { return -1; diff --git a/src/haptic/SDL_haptic_c.h b/src/haptic/SDL_haptic_c.h index d834965991710..44107a6538c62 100644 --- a/src/haptic/SDL_haptic_c.h +++ b/src/haptic/SDL_haptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/haptic/SDL_syshaptic.h b/src/haptic/SDL_syshaptic.h index d6ee3e1acf079..8f8abda26a451 100644 --- a/src/haptic/SDL_syshaptic.h +++ b/src/haptic/SDL_syshaptic.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,8 +33,8 @@ extern "C" { struct haptic_effect { - SDL_HapticEffect effect; /* The current event */ - struct haptic_hweffect *hweffect; /* The hardware behind the event */ + SDL_HapticEffect effect; /* The current event */ + struct haptic_hweffect *hweffect; /* The hardware behind the event */ }; /* @@ -42,20 +42,20 @@ struct haptic_effect */ struct _SDL_Haptic { - Uint8 index; /* Stores index it is attached to */ + Uint8 index; /* Stores index it is attached to */ - struct haptic_effect *effects; /* Allocated effects */ - int neffects; /* Maximum amount of effects */ - int nplaying; /* Maximum amount of effects to play at the same time */ - unsigned int supported; /* Supported effects */ - int naxes; /* Number of axes on the device. */ + struct haptic_effect *effects; /* Allocated effects */ + int neffects; /* Maximum amount of effects */ + int nplaying; /* Maximum amount of effects to play at the same time */ + unsigned int supported; /* Supported effects */ + int naxes; /* Number of axes on the device. */ - struct haptic_hwdata *hwdata; /* Driver dependent */ - int ref_count; /* Count for multiple opens */ + struct haptic_hwdata *hwdata; /* Driver dependent */ + int ref_count; /* Count for multiple opens */ - int rumble_id; /* ID of rumble effect for simple rumble API. */ + int rumble_id; /* ID of rumble effect for simple rumble API. */ SDL_HapticEffect rumble_effect; /* Rumble effect. */ - struct _SDL_Haptic *next; /* pointer to next haptic we have allocated */ + struct _SDL_Haptic *next; /* pointer to next haptic we have allocated */ }; /* @@ -79,7 +79,7 @@ extern const char *SDL_SYS_HapticName(int index); * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticOpen(SDL_Haptic * haptic); +extern int SDL_SYS_HapticOpen(SDL_Haptic *haptic); /* * Returns the index of the haptic core pointer or -1 if none is found. @@ -92,7 +92,7 @@ int SDL_SYS_HapticMouse(void); * Returns >0 if haptic capabilities are detected, 0 if haptic * capabilities aren't detected and -1 on error. */ -extern int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick); +extern int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick); /* * Opens the haptic device for usage using the same device as @@ -100,20 +100,20 @@ extern int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick); * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, - SDL_Joystick * joystick); +extern int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, + SDL_Joystick *joystick); /* * Checks to see if haptic device and joystick device are the same. * * Returns 1 if they are the same, 0 if they aren't. */ -extern int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, - SDL_Joystick * joystick); +extern int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, + SDL_Joystick *joystick); /* * Closes a haptic device after usage. */ -extern void SDL_SYS_HapticClose(SDL_Haptic * haptic); +extern void SDL_SYS_HapticClose(SDL_Haptic *haptic); /* * Performs a cleanup on the haptic subsystem. @@ -126,9 +126,9 @@ extern void SDL_SYS_HapticQuit(void); * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, +extern int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, - SDL_HapticEffect * base); + SDL_HapticEffect *base); /* * Updates the haptic effect on the haptic device using data @@ -136,16 +136,16 @@ extern int SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, +extern int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, - SDL_HapticEffect * data); + SDL_HapticEffect *data); /* * Runs the effect on the haptic device. * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, +extern int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations); @@ -154,13 +154,13 @@ extern int SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, +extern int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect); /* * Cleanups up the effect on the haptic device. */ -extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, +extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect); /* @@ -169,7 +169,7 @@ extern void SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, * Returns 0 if device is stopped, >0 if device is playing and * -1 on error. */ -extern int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, +extern int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect); /* @@ -177,35 +177,35 @@ extern int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain); +extern int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain); /* * Sets the autocenter feature of the haptic device. * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); +extern int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter); /* * Pauses the haptic device. * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticPause(SDL_Haptic * haptic); +extern int SDL_SYS_HapticPause(SDL_Haptic *haptic); /* * Unpauses the haptic device. * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticUnpause(SDL_Haptic * haptic); +extern int SDL_SYS_HapticUnpause(SDL_Haptic *haptic); /* * Stops all the currently playing haptic effects on the device. * * Returns 0 on success, -1 on error. */ -extern int SDL_SYS_HapticStopAll(SDL_Haptic * haptic); +extern int SDL_SYS_HapticStopAll(SDL_Haptic *haptic); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/haptic/android/SDL_syshaptic.c b/src/haptic/android/SDL_syshaptic.c index dda5733137129..b3cbf0112bcb5 100644 --- a/src/haptic/android/SDL_syshaptic.c +++ b/src/haptic/android/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -44,9 +44,7 @@ static SDL_hapticlist_item *SDL_hapticlist = NULL; static SDL_hapticlist_item *SDL_hapticlist_tail = NULL; static int numhaptics = 0; - -int -SDL_SYS_HapticInit(void) +int SDL_SYS_HapticInit(void) { /* Support for device connect/disconnect is API >= 16 only, * so we poll every three seconds @@ -57,17 +55,15 @@ SDL_SYS_HapticInit(void) timeout = SDL_GetTicks() + 3000; Android_JNI_PollHapticDevices(); } - return (numhaptics); + return numhaptics; } -int -SDL_SYS_NumHaptics(void) +int SDL_SYS_NumHaptics(void) { - return (numhaptics); + return numhaptics; } -static SDL_hapticlist_item * -HapticByOrder(int index) +static SDL_hapticlist_item *HapticByOrder(int index) { SDL_hapticlist_item *item = SDL_hapticlist; if ((index < 0) || (index >= numhaptics)) { @@ -81,11 +77,10 @@ HapticByOrder(int index) return item; } -static SDL_hapticlist_item * -HapticByDevId (int device_id) +static SDL_hapticlist_item *HapticByDevId(int device_id) { SDL_hapticlist_item *item; - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (device_id == item->device_id) { /*SDL_Log("=+=+=+=+=+= HapticByDevId id [%d]", device_id);*/ return item; @@ -94,26 +89,23 @@ HapticByDevId (int device_id) return NULL; } -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item = HapticByOrder(index); - if (item == NULL ) { + if (!item) { SDL_SetError("No such device"); return NULL; } return item->name; } - -static SDL_hapticlist_item * -OpenHaptic(SDL_Haptic *haptic, SDL_hapticlist_item *item) +static SDL_hapticlist_item *OpenHaptic(SDL_Haptic *haptic, SDL_hapticlist_item *item) { - if (item == NULL ) { + if (!item) { SDL_SetError("No such device"); return NULL; } - if (item->haptic != NULL) { + if (item->haptic) { SDL_SetError("Haptic already opened"); return NULL; } @@ -124,75 +116,59 @@ OpenHaptic(SDL_Haptic *haptic, SDL_hapticlist_item *item) haptic->supported = SDL_HAPTIC_LEFTRIGHT; haptic->neffects = 1; haptic->nplaying = haptic->neffects; - haptic->effects = (struct haptic_effect *)SDL_malloc (sizeof (struct haptic_effect) * haptic->neffects); - if (haptic->effects == NULL) { + haptic->effects = (struct haptic_effect *)SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); + if (!haptic->effects) { SDL_OutOfMemory(); return NULL; } - SDL_memset(haptic->effects, 0, sizeof (struct haptic_effect) * haptic->neffects); + SDL_memset(haptic->effects, 0, sizeof(struct haptic_effect) * haptic->neffects); return item; } -static SDL_hapticlist_item * -OpenHapticByOrder(SDL_Haptic *haptic, int index) +static SDL_hapticlist_item *OpenHapticByOrder(SDL_Haptic *haptic, int index) { - return OpenHaptic (haptic, HapticByOrder(index)); + return OpenHaptic(haptic, HapticByOrder(index)); } -static SDL_hapticlist_item * -OpenHapticByDevId(SDL_Haptic *haptic, int device_id) +static SDL_hapticlist_item *OpenHapticByDevId(SDL_Haptic *haptic, int device_id) { - return OpenHaptic (haptic, HapticByDevId(device_id)); + return OpenHaptic(haptic, HapticByDevId(device_id)); } -int -SDL_SYS_HapticOpen(SDL_Haptic *haptic) +int SDL_SYS_HapticOpen(SDL_Haptic *haptic) { - return (OpenHapticByOrder(haptic, haptic->index) == NULL ? -1 : 0); + return OpenHapticByOrder(haptic, haptic->index) == NULL ? -1 : 0; } - -int -SDL_SYS_HapticMouse(void) +int SDL_SYS_HapticMouse(void) { return -1; } - -int -SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) +int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) { SDL_hapticlist_item *item; item = HapticByDevId(((joystick_hwdata *)joystick->hwdata)->device_id); - return (item != NULL) ? 1 : 0; + return (item) ? 1 : 0; } - -int -SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) +int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { - return (OpenHapticByDevId(haptic, ((joystick_hwdata *)joystick->hwdata)->device_id) == NULL ? -1 : 0); + return OpenHapticByDevId(haptic, ((joystick_hwdata *)joystick->hwdata)->device_id) == NULL ? -1 : 0; } - -int -SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { - return (((SDL_hapticlist_item *)haptic->hwdata)->device_id == ((joystick_hwdata *)joystick->hwdata)->device_id ? 1 : 0); + return ((SDL_hapticlist_item *)haptic->hwdata)->device_id == ((joystick_hwdata *)joystick->hwdata)->device_id ? 1 : 0; } - -void -SDL_SYS_HapticClose(SDL_Haptic * haptic) +void SDL_SYS_HapticClose(SDL_Haptic *haptic) { ((SDL_hapticlist_item *)haptic->hwdata)->haptic = NULL; haptic->hwdata = NULL; - return; } - -void -SDL_SYS_HapticQuit(void) +void SDL_SYS_HapticQuit(void) { /* We don't have any way to scan for joysticks (and their vibrators) at init, so don't wipe the list * of joysticks here in case this is a reinit. @@ -212,111 +188,87 @@ SDL_SYS_HapticQuit(void) #endif } - -int -SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, SDL_HapticEffect *base) { return 0; } - -int -SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, - SDL_HapticEffect * data) +int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, + SDL_HapticEffect *data) { return 0; } - -int -SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - Uint32 iterations) +int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + Uint32 iterations) { float large = effect->effect.leftright.large_magnitude / 32767.0f; float small = effect->effect.leftright.small_magnitude / 32767.0f; float total = (large * 0.6f) + (small * 0.4f); - Android_JNI_HapticRun (((SDL_hapticlist_item *)haptic->hwdata)->device_id, total, effect->effect.leftright.length); + Android_JNI_HapticRun(((SDL_hapticlist_item *)haptic->hwdata)->device_id, total, effect->effect.leftright.length); return 0; } - -int -SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { - Android_JNI_HapticStop (((SDL_hapticlist_item *)haptic->hwdata)->device_id); + Android_JNI_HapticStop(((SDL_hapticlist_item *)haptic->hwdata)->device_id); return 0; } - -void -SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { - return; } - -int -SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, - struct haptic_effect *effect) +int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect) { return 0; } - -int -SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain) { return 0; } - -int -SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { return 0; } -int -SDL_SYS_HapticPause(SDL_Haptic * haptic) +int SDL_SYS_HapticPause(SDL_Haptic *haptic) { return 0; } -int -SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +int SDL_SYS_HapticUnpause(SDL_Haptic *haptic) { return 0; } -int -SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +int SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { return 0; } - - -int -Android_AddHaptic(int device_id, const char *name) +int Android_AddHaptic(int device_id, const char *name) { SDL_hapticlist_item *item; - item = (SDL_hapticlist_item *) SDL_calloc(1, sizeof (SDL_hapticlist_item)); - if (item == NULL) { + item = (SDL_hapticlist_item *)SDL_calloc(1, sizeof(SDL_hapticlist_item)); + if (!item) { return -1; } item->device_id = device_id; - item->name = SDL_strdup (name); - if (item->name == NULL) { - SDL_free (item); + item->name = SDL_strdup(name); + if (!item->name) { + SDL_free(item); return -1; } - if (SDL_hapticlist_tail == NULL) { + if (!SDL_hapticlist_tail) { SDL_hapticlist = SDL_hapticlist_tail = item; } else { SDL_hapticlist_tail->next = item; @@ -327,18 +279,17 @@ Android_AddHaptic(int device_id, const char *name) return numhaptics; } -int -Android_RemoveHaptic(int device_id) +int Android_RemoveHaptic(int device_id) { SDL_hapticlist_item *item; SDL_hapticlist_item *prev = NULL; - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { /* found it, remove it. */ if (device_id == item->device_id) { const int retval = item->haptic ? item->haptic->index : -1; - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_hapticlist == item); @@ -361,7 +312,6 @@ Android_RemoveHaptic(int device_id) return -1; } - #endif /* SDL_HAPTIC_ANDROID */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/haptic/darwin/SDL_syshaptic.c b/src/haptic/darwin/SDL_syshaptic.c index 50905e19c4c27..3ef5666d220f1 100644 --- a/src/haptic/darwin/SDL_syshaptic.c +++ b/src/haptic/darwin/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,7 +37,7 @@ #include #ifndef IO_OBJECT_NULL -#define IO_OBJECT_NULL ((io_service_t)0) +#define IO_OBJECT_NULL ((io_service_t)0) #endif /* @@ -45,10 +45,10 @@ */ typedef struct SDL_hapticlist_item { - char name[256]; /* Name of the device. */ + char name[256]; /* Name of the device. */ - io_service_t dev; /* Node we use to create the device. */ - SDL_Haptic *haptic; /* Haptic currently associated with it. */ + io_service_t dev; /* Node we use to create the device. */ + SDL_Haptic *haptic; /* Haptic currently associated with it. */ /* Usage pages for determining if it's a mouse or not. */ long usage; @@ -57,30 +57,28 @@ typedef struct SDL_hapticlist_item struct SDL_hapticlist_item *next; } SDL_hapticlist_item; - /* * Haptic system hardware data. */ struct haptic_hwdata { - FFDeviceObjectReference device; /* Hardware device. */ + FFDeviceObjectReference device; /* Hardware device. */ UInt8 axes[3]; }; - /* * Haptic system effect data. */ struct haptic_hweffect { - FFEffectObjectReference ref; /* Reference. */ - struct FFEFFECT effect; /* Hardware effect. */ + FFEffectObjectReference ref; /* Reference. */ + struct FFEFFECT effect; /* Hardware effect. */ }; /* * Prototypes. */ -static void SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type); +static void SDL_SYS_HapticFreeFFEFFECT(FFEFFECT *effect, int type); static int HIDGetDeviceProduct(io_service_t dev, char *name); static SDL_hapticlist_item *SDL_hapticlist = NULL; @@ -90,8 +88,7 @@ static int numhaptics = -1; /* * Like strerror but for force feedback errors. */ -static const char * -FFStrError(unsigned int err) +static const char *FFStrError(unsigned int err) { switch (err) { case FFERR_DEVICEFULL: @@ -143,12 +140,10 @@ FFStrError(unsigned int err) } } - /* * Initializes the haptic subsystem. */ -int -SDL_SYS_HapticInit(void) +int SDL_SYS_HapticInit(void) { IOReturn result; io_iterator_t iter; @@ -162,7 +157,7 @@ SDL_SYS_HapticInit(void) /* Get HID devices. */ match = IOServiceMatching(kIOHIDDeviceKey); - if (match == NULL) { + if (!match) { return SDL_SetError("Haptic: Failed to get IOServiceMatching."); } @@ -173,7 +168,7 @@ SDL_SYS_HapticInit(void) } /* IOServiceGetMatchingServices consumes dictionary. */ - if (!IOIteratorIsValid(iter)) { /* No iterator. */ + if (!IOIteratorIsValid(iter)) { /* No iterator. */ return 0; } @@ -187,14 +182,12 @@ SDL_SYS_HapticInit(void) return numhaptics; } -int -SDL_SYS_NumHaptics(void) +int SDL_SYS_NumHaptics(void) { return numhaptics; } -static SDL_hapticlist_item * -HapticByDevIndex(int device_index) +static SDL_hapticlist_item *HapticByDevIndex(int device_index) { SDL_hapticlist_item *item = SDL_hapticlist; @@ -211,8 +204,7 @@ HapticByDevIndex(int device_index) return item; } -int -MacHaptic_MaybeAddDevice( io_object_t device ) +int MacHaptic_MaybeAddDevice(io_object_t device) { IOReturn result; CFMutableDictionaryRef hidProperties; @@ -229,16 +221,15 @@ MacHaptic_MaybeAddDevice( io_object_t device ) } /* Make sure we don't already have it */ - for (item = SDL_hapticlist; item ; item = item->next) - { - if (IOObjectIsEqualTo((io_object_t) item->dev, device)) { + for (item = SDL_hapticlist; item; item = item->next) { + if (IOObjectIsEqualTo((io_object_t)item->dev, device)) { /* Already added */ return -1; } } item = (SDL_hapticlist_item *)SDL_calloc(1, sizeof(SDL_hapticlist_item)); - if (item == NULL) { + if (!item) { return SDL_SetError("Could not allocate haptic storage"); } @@ -274,7 +265,7 @@ MacHaptic_MaybeAddDevice( io_object_t device ) CFRelease(hidProperties); } - if (SDL_hapticlist_tail == NULL) { + if (!SDL_hapticlist_tail) { SDL_hapticlist = SDL_hapticlist_tail = item; } else { SDL_hapticlist_tail->next = item; @@ -287,8 +278,7 @@ MacHaptic_MaybeAddDevice( io_object_t device ) return numhaptics; } -int -MacHaptic_MaybeRemoveDevice( io_object_t device ) +int MacHaptic_MaybeRemoveDevice(io_object_t device) { SDL_hapticlist_item *item; SDL_hapticlist_item *prev = NULL; @@ -297,12 +287,12 @@ MacHaptic_MaybeRemoveDevice( io_object_t device ) return -1; /* not initialized. ignore this. */ } - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { /* found it, remove it. */ - if (IOObjectIsEqualTo((io_object_t) item->dev, device)) { + if (IOObjectIsEqualTo((io_object_t)item->dev, device)) { const int retval = item->haptic ? item->haptic->index : -1; - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_hapticlist == item); @@ -329,8 +319,7 @@ MacHaptic_MaybeRemoveDevice( io_object_t device ) /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item; item = HapticByDevIndex(index); @@ -340,8 +329,7 @@ SDL_SYS_HapticName(int index) /* * Gets the device's product name. */ -static int -HIDGetDeviceProduct(io_service_t dev, char *name) +static int HIDGetDeviceProduct(io_service_t dev, char *name) { CFMutableDictionaryRef hidProperties, usbProperties; io_registry_entry_t parent1, parent2; @@ -359,20 +347,19 @@ HIDGetDeviceProduct(io_service_t dev, char *name) * get dictionary for USB properties: step up two levels and get CF dictionary for USB properties */ if ((KERN_SUCCESS == - IORegistryEntryGetParentEntry(dev, kIOServicePlane, &parent1)) - && (KERN_SUCCESS == - IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2)) - && (KERN_SUCCESS == - IORegistryEntryCreateCFProperties(parent2, &usbProperties, - kCFAllocatorDefault, - kNilOptions))) { + IORegistryEntryGetParentEntry(dev, kIOServicePlane, &parent1)) && + (KERN_SUCCESS == + IORegistryEntryGetParentEntry(parent1, kIOServicePlane, &parent2)) && + (KERN_SUCCESS == + IORegistryEntryCreateCFProperties(parent2, &usbProperties, + kCFAllocatorDefault, + kNilOptions))) { if (usbProperties) { CFTypeRef refCF = 0; /* get device info * try hid dictionary first, if fail then go to USB dictionary */ - /* Get product name */ refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDProductKey)); if (!refCF) { @@ -405,14 +392,13 @@ HIDGetDeviceProduct(io_service_t dev, char *name) return 0; } - -#define FF_TEST(ff, s) \ -if (features.supportedEffects & (ff)) supported |= (s) +#define FF_TEST(ff, s) \ + if (features.supportedEffects & (ff)) \ + supported |= (s) /* * Gets supported features. */ -static unsigned int -GetSupportedFeatures(SDL_Haptic * haptic) +static unsigned int GetSupportedFeatures(SDL_Haptic *haptic) { HRESULT ret; FFDeviceObjectReference device; @@ -464,9 +450,8 @@ GetSupportedFeatures(SDL_Haptic * haptic) if (ret == FF_OK) { supported |= SDL_HAPTIC_AUTOCENTER; } else if (ret != FFERR_UNSUPPORTED) { - return SDL_SetError - ("Haptic: Unable to get if device supports autocenter: %s.", - FFStrError(ret)); + return SDL_SetError("Haptic: Unable to get if device supports autocenter: %s.", + FFStrError(ret)); } /* Check for axes, we have an artificial limit on axes */ @@ -482,12 +467,10 @@ GetSupportedFeatures(SDL_Haptic * haptic) return 0; } - /* * Opens the haptic device from the file descriptor. */ -static int -SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) +static int SDL_SYS_HapticOpenFromService(SDL_Haptic *haptic, io_service_t service) { HRESULT ret; int ret2; @@ -495,7 +478,7 @@ SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) /* Allocate the hwdata */ haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata)); - if (haptic->hwdata == NULL) { + if (!haptic->hwdata) { SDL_OutOfMemory(); goto creat_err; } @@ -515,7 +498,6 @@ SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) goto open_err; } - /* Reset and then enable actuators. */ ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device, FFSFFC_RESET); @@ -531,11 +513,10 @@ SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) goto open_err; } - /* Allocate effects memory. */ haptic->effects = (struct haptic_effect *) SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); - if (haptic->effects == NULL) { + if (!haptic->effects) { SDL_OutOfMemory(); goto open_err; } @@ -546,23 +527,20 @@ SDL_SYS_HapticOpenFromService(SDL_Haptic * haptic, io_service_t service) return 0; /* Error handling */ - open_err: +open_err: FFReleaseDevice(haptic->hwdata->device); - creat_err: - if (haptic->hwdata != NULL) { +creat_err: + if (haptic->hwdata) { SDL_free(haptic->hwdata); haptic->hwdata = NULL; } return -1; - } - /* * Opens a haptic device for usage. */ -int -SDL_SYS_HapticOpen(SDL_Haptic * haptic) +int SDL_SYS_HapticOpen(SDL_Haptic *haptic) { SDL_hapticlist_item *item; item = HapticByDevIndex(haptic->index); @@ -570,12 +548,10 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic) return SDL_SYS_HapticOpenFromService(haptic, item->dev); } - /* * Opens a haptic device from first mouse it finds for usage. */ -int -SDL_SYS_HapticMouse(void) +int SDL_SYS_HapticMouse(void) { int device_index = 0; SDL_hapticlist_item *item; @@ -591,12 +567,10 @@ SDL_SYS_HapticMouse(void) return -1; } - /* * Checks to see if a joystick has haptic features. */ -int -SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_IOKIT if (joystick->driver != &SDL_DARWIN_JoystickDriver) { @@ -609,18 +583,16 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) return SDL_FALSE; } - /* * Checks to see if the haptic device and joystick are in reality the same. */ -int -SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_IOKIT if (joystick->driver != &SDL_DARWIN_JoystickDriver) { return 0; } - if (IOObjectIsEqualTo((io_object_t) ((size_t)haptic->hwdata->device), + if (IOObjectIsEqualTo((io_object_t)((size_t)haptic->hwdata->device), joystick->hwdata->ffservice)) { return 1; } @@ -628,25 +600,23 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) return 0; } - /* * Opens a SDL_Haptic from a SDL_Joystick. */ -int -SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_IOKIT int device_index = 0; SDL_hapticlist_item *item; - + if (joystick->driver != &SDL_DARWIN_JoystickDriver) { return -1; } for (item = SDL_hapticlist; item; item = item->next) { - if (IOObjectIsEqualTo((io_object_t) item->dev, - joystick->hwdata->ffservice)) { - haptic->index = device_index; - break; + if (IOObjectIsEqualTo((io_object_t)item->dev, + joystick->hwdata->ffservice)) { + haptic->index = device_index; + break; } ++device_index; } @@ -657,12 +627,10 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) #endif } - /* * Closes the haptic device. */ -void -SDL_SYS_HapticClose(SDL_Haptic * haptic) +void SDL_SYS_HapticClose(SDL_Haptic *haptic) { if (haptic->hwdata) { @@ -680,12 +648,10 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) } } - /* * Clean up after system specific haptic stuff */ -void -SDL_SYS_HapticQuit(void) +void SDL_SYS_HapticQuit(void) { SDL_hapticlist_item *item; SDL_hapticlist_item *next = NULL; @@ -705,12 +671,10 @@ SDL_SYS_HapticQuit(void) SDL_hapticlist_tail = NULL; } - /* * Converts an SDL trigger button to an FFEFFECT trigger button. */ -static DWORD -FFGetTriggerButton(Uint16 button) +static DWORD FFGetTriggerButton(Uint16 button) { DWORD dwTriggerButton; @@ -723,25 +687,23 @@ FFGetTriggerButton(Uint16 button) return dwTriggerButton; } - /* * Sets the direction. */ -static int -SDL_SYS_SetDirection(FFEFFECT * effect, SDL_HapticDirection * dir, int naxes) +static int SDL_SYS_SetDirection(FFEFFECT *effect, SDL_HapticDirection *dir, int naxes) { LONG *rglDir; /* Handle no axes a part. */ if (naxes == 0) { - effect->dwFlags |= FFEFF_SPHERICAL; /* Set as default. */ + effect->dwFlags |= FFEFF_SPHERICAL; /* Set as default. */ effect->rglDirection = NULL; return 0; } /* Has axes. */ rglDir = SDL_malloc(sizeof(LONG) * naxes); - if (rglDir == NULL) { + if (!rglDir) { return SDL_OutOfMemory(); } SDL_memset(rglDir, 0, sizeof(LONG) * naxes); @@ -782,21 +744,19 @@ SDL_SYS_SetDirection(FFEFFECT * effect, SDL_HapticDirection * dir, int naxes) } } - /* Clamps and converts. */ -#define CCONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) +#define CCONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) /* Just converts. */ -#define CONVERT(x) (((x)*10000) / 0x7FFF) +#define CONVERT(x) (((x)*10000) / 0x7FFF) /* * Creates the FFEFFECT from a SDL_HapticEffect. */ -static int -SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) +static int SDL_SYS_ToFFEFFECT(SDL_Haptic *haptic, FFEFFECT *dest, SDL_HapticEffect *src) { int i; FFCONSTANTFORCE *constant = NULL; FFPERIODIC *periodic = NULL; - FFCONDITION *condition = NULL; /* Actually an array of conditions - one per axis. */ + FFCONDITION *condition = NULL; /* Actually an array of conditions - one per axis. */ FFRAMPFORCE *ramp = NULL; FFCUSTOMFORCE *custom = NULL; FFENVELOPE *envelope = NULL; @@ -809,19 +769,19 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) /* Set global stuff. */ SDL_memset(dest, 0, sizeof(FFEFFECT)); - dest->dwSize = sizeof(FFEFFECT); /* Set the structure size. */ - dest->dwSamplePeriod = 0; /* Not used by us. */ - dest->dwGain = 10000; /* Gain is set globally, not locally. */ - dest->dwFlags = FFEFF_OBJECTOFFSETS; /* Seems obligatory. */ + dest->dwSize = sizeof(FFEFFECT); /* Set the structure size. */ + dest->dwSamplePeriod = 0; /* Not used by us. */ + dest->dwGain = 10000; /* Gain is set globally, not locally. */ + dest->dwFlags = FFEFF_OBJECTOFFSETS; /* Seems obligatory. */ /* Envelope. */ envelope = SDL_malloc(sizeof(FFENVELOPE)); - if (envelope == NULL) { + if (!envelope) { return SDL_OutOfMemory(); } SDL_memset(envelope, 0, sizeof(FFENVELOPE)); dest->lpEnvelope = envelope; - envelope->dwSize = sizeof(FFENVELOPE); /* Always should be this. */ + envelope->dwSize = sizeof(FFENVELOPE); /* Always should be this. */ /* Axes. */ if (src->constant.direction.type == SDL_HAPTIC_STEERING_AXIS) { @@ -831,10 +791,10 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) } if (dest->cAxes > 0) { axes = SDL_malloc(sizeof(DWORD) * dest->cAxes); - if (axes == NULL) { + if (!axes) { return SDL_OutOfMemory(); } - axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ + axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ if (dest->cAxes > 1) { axes[1] = haptic->hwdata->axes[1]; } @@ -844,13 +804,12 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) dest->rgdwAxes = axes; } - /* The big type handling switch, even bigger then Linux's version. */ switch (src->type) { case SDL_HAPTIC_CONSTANT: hap_constant = &src->constant; constant = SDL_malloc(sizeof(FFCONSTANTFORCE)); - if (constant == NULL) { + if (!constant) { return SDL_OutOfMemory(); } SDL_memset(constant, 0, sizeof(FFCONSTANTFORCE)); @@ -864,17 +823,15 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */ dest->dwTriggerButton = FFGetTriggerButton(hap_constant->button); dest->dwTriggerRepeatInterval = hap_constant->interval; - dest->dwStartDelay = hap_constant->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_constant->delay * 1000; /* In microseconds. */ /* Direction. */ - if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes) - < 0) { + if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes) < 0) { return -1; } /* Envelope */ - if ((hap_constant->attack_length == 0) - && (hap_constant->fade_length == 0)) { + if ((hap_constant->attack_length == 0) && (hap_constant->fade_length == 0)) { SDL_free(envelope); dest->lpEnvelope = NULL; } else { @@ -894,7 +851,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) case SDL_HAPTIC_SAWTOOTHDOWN: hap_periodic = &src->periodic; periodic = SDL_malloc(sizeof(FFPERIODIC)); - if (periodic == NULL) { + if (!periodic) { return SDL_OutOfMemory(); } SDL_memset(periodic, 0, sizeof(FFPERIODIC)); @@ -902,8 +859,8 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) /* Specifics */ periodic->dwMagnitude = CONVERT(SDL_abs(hap_periodic->magnitude)); periodic->lOffset = CONVERT(hap_periodic->offset); - periodic->dwPhase = - (hap_periodic->phase + (hap_periodic->magnitude < 0 ? 18000 : 0)) % 36000; + periodic->dwPhase = + (hap_periodic->phase + (hap_periodic->magnitude < 0 ? 18000 : 0)) % 36000; periodic->dwPeriod = hap_periodic->period * 1000; dest->cbTypeSpecificParams = sizeof(FFPERIODIC); dest->lpvTypeSpecificParams = periodic; @@ -912,17 +869,15 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */ dest->dwTriggerButton = FFGetTriggerButton(hap_periodic->button); dest->dwTriggerRepeatInterval = hap_periodic->interval; - dest->dwStartDelay = hap_periodic->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_periodic->delay * 1000; /* In microseconds. */ /* Direction. */ - if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) - < 0) { + if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) < 0) { return -1; } /* Envelope */ - if ((hap_periodic->attack_length == 0) - && (hap_periodic->fade_length == 0)) { + if ((hap_periodic->attack_length == 0) && (hap_periodic->fade_length == 0)) { SDL_free(envelope); dest->lpEnvelope = NULL; } else { @@ -941,7 +896,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) hap_condition = &src->condition; if (dest->cAxes > 0) { condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes); - if (condition == NULL) { + if (!condition) { return SDL_OutOfMemory(); } SDL_memset(condition, 0, sizeof(FFCONDITION)); @@ -965,14 +920,13 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) dest->lpvTypeSpecificParams = condition; /* Generics */ - dest->dwDuration = hap_condition->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_condition->length * 1000; /* In microseconds. */ dest->dwTriggerButton = FFGetTriggerButton(hap_condition->button); dest->dwTriggerRepeatInterval = hap_condition->interval; - dest->dwStartDelay = hap_condition->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_condition->delay * 1000; /* In microseconds. */ /* Direction. */ - if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) - < 0) { + if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) < 0) { return -1; } @@ -985,7 +939,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) case SDL_HAPTIC_RAMP: hap_ramp = &src->ramp; ramp = SDL_malloc(sizeof(FFRAMPFORCE)); - if (ramp == NULL) { + if (!ramp) { return SDL_OutOfMemory(); } SDL_memset(ramp, 0, sizeof(FFRAMPFORCE)); @@ -997,10 +951,10 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) dest->lpvTypeSpecificParams = ramp; /* Generics */ - dest->dwDuration = hap_ramp->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_ramp->length * 1000; /* In microseconds. */ dest->dwTriggerButton = FFGetTriggerButton(hap_ramp->button); dest->dwTriggerRepeatInterval = hap_ramp->interval; - dest->dwStartDelay = hap_ramp->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_ramp->delay * 1000; /* In microseconds. */ /* Direction. */ if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) { @@ -1023,7 +977,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) case SDL_HAPTIC_CUSTOM: hap_custom = &src->custom; custom = SDL_malloc(sizeof(FFCUSTOMFORCE)); - if (custom == NULL) { + if (!custom) { return SDL_OutOfMemory(); } SDL_memset(custom, 0, sizeof(FFCUSTOMFORCE)); @@ -1034,17 +988,17 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) custom->cSamples = hap_custom->samples; custom->rglForceData = SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels); - for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ + for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ custom->rglForceData[i] = CCONVERT(hap_custom->data[i]); } dest->cbTypeSpecificParams = sizeof(FFCUSTOMFORCE); dest->lpvTypeSpecificParams = custom; /* Generics */ - dest->dwDuration = hap_custom->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_custom->length * 1000; /* In microseconds. */ dest->dwTriggerButton = FFGetTriggerButton(hap_custom->button); dest->dwTriggerRepeatInterval = hap_custom->interval; - dest->dwStartDelay = hap_custom->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_custom->delay * 1000; /* In microseconds. */ /* Direction. */ if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) < @@ -1053,8 +1007,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) } /* Envelope */ - if ((hap_custom->attack_length == 0) - && (hap_custom->fade_length == 0)) { + if ((hap_custom->attack_length == 0) && (hap_custom->fade_length == 0)) { SDL_free(envelope); dest->lpEnvelope = NULL; } else { @@ -1066,7 +1019,6 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) break; - default: return SDL_SetError("Haptic: Unknown effect type."); } @@ -1074,12 +1026,10 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest, SDL_HapticEffect * src) return 0; } - /* * Frees an FFEFFECT allocated by SDL_SYS_ToFFEFFECT. */ -static void -SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type) +static void SDL_SYS_HapticFreeFFEFFECT(FFEFFECT *effect, int type) { FFCUSTOMFORCE *custom; @@ -1087,9 +1037,9 @@ SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type) effect->lpEnvelope = NULL; SDL_free(effect->rgdwAxes); effect->rgdwAxes = NULL; - if (effect->lpvTypeSpecificParams != NULL) { - if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ - custom = (FFCUSTOMFORCE *) effect->lpvTypeSpecificParams; + if (effect->lpvTypeSpecificParams) { + if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ + custom = (FFCUSTOMFORCE *)effect->lpvTypeSpecificParams; SDL_free(custom->rglForceData); custom->rglForceData = NULL; } @@ -1100,7 +1050,6 @@ SDL_SYS_HapticFreeFFEFFECT(FFEFFECT * effect, int type) effect->rglDirection = NULL; } - /* * Gets the effect type from the generic SDL haptic effect wrapper. */ @@ -1114,9 +1063,9 @@ SDL_SYS_HapticEffectType(Uint16 type) case SDL_HAPTIC_RAMP: return kFFEffectType_RampForce_ID; - /* !!! FIXME: put this back when we have more bits in 2.1 */ - /* case SDL_HAPTIC_SQUARE: - return kFFEffectType_Square_ID; */ + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /* case SDL_HAPTIC_SQUARE: + return kFFEffectType_Square_ID; */ case SDL_HAPTIC_SINE: return kFFEffectType_Sine_ID; @@ -1151,13 +1100,11 @@ SDL_SYS_HapticEffectType(Uint16 type) } } - /* * Creates a new haptic effect. */ -int -SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - SDL_HapticEffect * base) +int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + SDL_HapticEffect *base) { HRESULT ret; CFUUIDRef type; @@ -1165,14 +1112,14 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, /* Alloc the effect. */ effect->hweffect = (struct haptic_hweffect *) SDL_malloc(sizeof(struct haptic_hweffect)); - if (effect->hweffect == NULL) { + if (!effect->hweffect) { SDL_OutOfMemory(); goto err_hweffect; } /* Get the type. */ type = SDL_SYS_HapticEffectType(base->type); - if (type == NULL) { + if (!type) { goto err_hweffect; } @@ -1192,22 +1139,20 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, return 0; - err_effectdone: +err_effectdone: SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, base->type); - err_hweffect: +err_hweffect: SDL_free(effect->hweffect); effect->hweffect = NULL; return -1; } - /* * Updates an effect. */ -int -SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, - SDL_HapticEffect * data) +int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, + SDL_HapticEffect *data) { HRESULT ret; FFEffectParameterFlag flags; @@ -1222,11 +1167,11 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, /* Set the flags. Might be worthwhile to diff temp with loaded effect and * only change those parameters. */ flags = FFEP_DIRECTION | - FFEP_DURATION | - FFEP_ENVELOPE | - FFEP_STARTDELAY | - FFEP_TRIGGERBUTTON | - FFEP_TRIGGERREPEATINTERVAL | FFEP_TYPESPECIFICPARAMS; + FFEP_DURATION | + FFEP_ENVELOPE | + FFEP_STARTDELAY | + FFEP_TRIGGERBUTTON | + FFEP_TRIGGERREPEATINTERVAL | FFEP_TYPESPECIFICPARAMS; /* Create the actual effect. */ ret = FFEffectSetParameters(effect->hweffect->ref, &temp, flags); @@ -1241,18 +1186,16 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, return 0; - err_update: +err_update: SDL_SYS_HapticFreeFFEFFECT(&temp, data->type); return -1; } - /* * Runs an effect. */ -int -SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - Uint32 iterations) +int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + Uint32 iterations) { HRESULT ret; Uint32 iter; @@ -1260,8 +1203,9 @@ SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, /* Check if it's infinite. */ if (iterations == SDL_HAPTIC_INFINITY) { iter = FF_INFINITE; - } else + } else { iter = iterations; + } /* Run the effect. */ ret = FFEffectStart(effect->hweffect->ref, iter, 0); @@ -1273,12 +1217,10 @@ SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, return 0; } - /* * Stops an effect. */ -int -SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { HRESULT ret; @@ -1291,12 +1233,10 @@ SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) return 0; } - /* * Frees the effect. */ -void -SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { HRESULT ret; @@ -1311,13 +1251,11 @@ SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) effect->hweffect = NULL; } - /* * Gets the status of a haptic effect. */ -int -SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, - struct haptic_effect *effect) +int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, + struct haptic_effect *effect) { HRESULT ret; FFEffectStatusFlag status; @@ -1332,15 +1270,13 @@ SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, if (status == 0) { return SDL_FALSE; } - return SDL_TRUE; /* Assume it's playing or emulated. */ + return SDL_TRUE; /* Assume it's playing or emulated. */ } - /* * Sets the gain. */ -int -SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain) { HRESULT ret; Uint32 val; @@ -1355,12 +1291,10 @@ SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) return 0; } - /* * Sets the autocentering. */ -int -SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { HRESULT ret; Uint32 val; @@ -1382,12 +1316,10 @@ SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) return 0; } - /* * Pauses the device. */ -int -SDL_SYS_HapticPause(SDL_Haptic * haptic) +int SDL_SYS_HapticPause(SDL_Haptic *haptic) { HRESULT ret; @@ -1400,12 +1332,10 @@ SDL_SYS_HapticPause(SDL_Haptic * haptic) return 0; } - /* * Unpauses the device. */ -int -SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +int SDL_SYS_HapticUnpause(SDL_Haptic *haptic) { HRESULT ret; @@ -1418,12 +1348,10 @@ SDL_SYS_HapticUnpause(SDL_Haptic * haptic) return 0; } - /* * Stops all currently playing effects. */ -int -SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +int SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { HRESULT ret; diff --git a/src/haptic/darwin/SDL_syshaptic_c.h b/src/haptic/darwin/SDL_syshaptic_c.h index 8e3a6ca95f028..dfa1f95f631ec 100644 --- a/src/haptic/darwin/SDL_syshaptic_c.h +++ b/src/haptic/darwin/SDL_syshaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,8 +25,7 @@ #define kIOMainPortDefault kIOMasterPortDefault #endif -extern int MacHaptic_MaybeAddDevice( io_object_t device ); -extern int MacHaptic_MaybeRemoveDevice( io_object_t device ); +extern int MacHaptic_MaybeAddDevice(io_object_t device); +extern int MacHaptic_MaybeRemoveDevice(io_object_t device); /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/haptic/dummy/SDL_syshaptic.c b/src/haptic/dummy/SDL_syshaptic.c index f356195b7f4ff..d8cdb0e87c5bd 100644 --- a/src/haptic/dummy/SDL_syshaptic.c +++ b/src/haptic/dummy/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,158 +25,119 @@ #include "SDL_haptic.h" #include "../SDL_syshaptic.h" - -static int -SDL_SYS_LogicError(void) +static int SDL_SYS_LogicError(void) { return SDL_SetError("Logic error: No haptic devices available."); } - -int -SDL_SYS_HapticInit(void) +int SDL_SYS_HapticInit(void) { return 0; } -int -SDL_SYS_NumHaptics(void) +int SDL_SYS_NumHaptics(void) { return 0; } -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_SYS_LogicError(); return NULL; } - -int -SDL_SYS_HapticOpen(SDL_Haptic * haptic) +int SDL_SYS_HapticOpen(SDL_Haptic *haptic) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticMouse(void) +int SDL_SYS_HapticMouse(void) { return -1; } - -int -SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) { return 0; } - -int -SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { return 0; } - -void -SDL_SYS_HapticClose(SDL_Haptic * haptic) +void SDL_SYS_HapticClose(SDL_Haptic *haptic) { return; } - -void -SDL_SYS_HapticQuit(void) +void SDL_SYS_HapticQuit(void) { return; } - -int -SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, SDL_HapticEffect *base) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, - SDL_HapticEffect * data) +int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, + SDL_HapticEffect *data) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - Uint32 iterations) +int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + Uint32 iterations) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_SYS_LogicError(); } - -void -SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { SDL_SYS_LogicError(); return; } - -int -SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, - struct haptic_effect *effect) +int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, + struct haptic_effect *effect) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain) { return SDL_SYS_LogicError(); } - -int -SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { return SDL_SYS_LogicError(); } -int -SDL_SYS_HapticPause(SDL_Haptic * haptic) +int SDL_SYS_HapticPause(SDL_Haptic *haptic) { return SDL_SYS_LogicError(); } -int -SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +int SDL_SYS_HapticUnpause(SDL_Haptic *haptic) { return SDL_SYS_LogicError(); } -int -SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +int SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { return SDL_SYS_LogicError(); } diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index a9be7e0d39a9d..3622e433ad7c6 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,12 +30,12 @@ #include "../../core/linux/SDL_evdev_capabilities.h" #include "../../core/linux/SDL_udev.h" -#include /* close */ -#include /* Force feedback linux stuff. */ -#include /* O_RDWR */ -#include /* INT_MAX */ -#include /* errno, strerror */ -#include /* stat */ +#include /* close */ +#include /* Force feedback linux stuff. */ +#include /* O_RDWR */ +#include /* INT_MAX */ +#include /* errno, strerror */ +#include /* stat */ /* Just in case. */ #ifndef M_PI @@ -46,7 +46,7 @@ #define MAX_HAPTICS 32 /* It's doubtful someone has more then 32 evdev */ static int MaybeAddDevice(const char *path); -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV static int MaybeRemoveDevice(const char *path); static void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath); #endif /* SDL_USE_LIBUDEV */ @@ -56,43 +56,42 @@ static void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, */ typedef struct SDL_hapticlist_item { - char *fname; /* Dev path name (like /dev/input/event1) */ - SDL_Haptic *haptic; /* Associated haptic. */ + char *fname; /* Dev path name (like /dev/input/event1) */ + SDL_Haptic *haptic; /* Associated haptic. */ dev_t dev_num; struct SDL_hapticlist_item *next; } SDL_hapticlist_item; - /* * Haptic system hardware data. */ struct haptic_hwdata { - int fd; /* File descriptor of the device. */ - char *fname; /* Points to the name in SDL_hapticlist. */ + int fd; /* File descriptor of the device. */ + char *fname; /* Points to the name in SDL_hapticlist. */ }; - /* * Haptic system effect data. */ struct haptic_hweffect { - struct ff_effect effect; /* The linux kernel effect structure. */ + struct ff_effect effect; /* The linux kernel effect structure. */ }; static SDL_hapticlist_item *SDL_hapticlist = NULL; static SDL_hapticlist_item *SDL_hapticlist_tail = NULL; static int numhaptics = 0; -#define EV_TEST(ev,f) \ - if (test_bit((ev), features)) ret |= (f); +#define EV_TEST(ev, f) \ + if (test_bit((ev), features)) { \ + ret |= (f); \ + } /* * Test whether a device has haptic properties. * Returns available properties or 0 if there are none. */ -static int -EV_IsHaptic(int fd) +static int EV_IsHaptic(int fd) { unsigned int ret; unsigned long features[1 + FF_MAX / sizeof(unsigned long)]; @@ -126,12 +125,10 @@ EV_IsHaptic(int fd) return ret; } - /* * Tests whether a device is a mouse or not. */ -static int -EV_IsMouse(int fd) +static int EV_IsMouse(int fd) { unsigned long argp[40]; @@ -151,8 +148,7 @@ EV_IsMouse(int fd) /* * Initializes the haptic subsystem by finding available devices. */ -int -SDL_SYS_HapticInit(void) +int SDL_SYS_HapticInit(void) { const char joydev_pattern[] = "/dev/input/event%d"; char path[PATH_MAX]; @@ -164,17 +160,16 @@ SDL_SYS_HapticInit(void) */ i = 0; for (j = 0; j < MAX_HAPTICS; ++j) { - - SDL_snprintf(path, PATH_MAX, joydev_pattern, i++); + (void)SDL_snprintf(path, PATH_MAX, joydev_pattern, i++); MaybeAddDevice(path); } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV if (SDL_UDEV_Init() < 0) { return SDL_SetError("Could not initialize UDEV"); } - if ( SDL_UDEV_AddCallback(haptic_udev_callback) < 0) { + if (SDL_UDEV_AddCallback(haptic_udev_callback) < 0) { SDL_UDEV_Quit(); return SDL_SetError("Could not setup haptic <-> udev callback"); } @@ -186,14 +181,12 @@ SDL_SYS_HapticInit(void) return numhaptics; } -int -SDL_SYS_NumHaptics(void) +int SDL_SYS_NumHaptics(void) { return numhaptics; } -static SDL_hapticlist_item * -HapticByDevIndex(int device_index) +static SDL_hapticlist_item *HapticByDevIndex(int device_index) { SDL_hapticlist_item *item = SDL_hapticlist; @@ -210,39 +203,36 @@ HapticByDevIndex(int device_index) return item; } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV static void haptic_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath) { - if (devpath == NULL || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { + if (!devpath || !(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { return; } - switch( udev_type ) - { - case SDL_UDEV_DEVICEADDED: - MaybeAddDevice(devpath); - break; + switch (udev_type) { + case SDL_UDEV_DEVICEADDED: + MaybeAddDevice(devpath); + break; - case SDL_UDEV_DEVICEREMOVED: - MaybeRemoveDevice(devpath); - break; + case SDL_UDEV_DEVICEREMOVED: + MaybeRemoveDevice(devpath); + break; - default: - break; + default: + break; } - } #endif /* SDL_USE_LIBUDEV */ -static int -MaybeAddDevice(const char *path) +static int MaybeAddDevice(const char *path) { struct stat sb; int fd; int success; SDL_hapticlist_item *item; - if (path == NULL) { + if (!path) { return -1; } @@ -252,9 +242,9 @@ MaybeAddDevice(const char *path) } /* check for duplicates */ - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (item->dev_num == sb.st_rdev) { - return -1; /* duplicate. */ + return -1; /* duplicate. */ } } @@ -275,13 +265,13 @@ MaybeAddDevice(const char *path) return -1; } - item = (SDL_hapticlist_item *) SDL_calloc(1, sizeof (SDL_hapticlist_item)); - if (item == NULL) { + item = (SDL_hapticlist_item *)SDL_calloc(1, sizeof(SDL_hapticlist_item)); + if (!item) { return -1; } item->fname = SDL_strdup(path); - if (item->fname == NULL) { + if (!item->fname) { SDL_free(item); return -1; } @@ -289,7 +279,7 @@ MaybeAddDevice(const char *path) item->dev_num = sb.st_rdev; /* TODO: should we add instance IDs? */ - if (SDL_hapticlist_tail == NULL) { + if (!SDL_hapticlist_tail) { SDL_hapticlist = SDL_hapticlist_tail = item; } else { SDL_hapticlist_tail->next = item; @@ -303,23 +293,22 @@ MaybeAddDevice(const char *path) return numhaptics; } -#if SDL_USE_LIBUDEV -static int -MaybeRemoveDevice(const char* path) +#ifdef SDL_USE_LIBUDEV +static int MaybeRemoveDevice(const char *path) { SDL_hapticlist_item *item; SDL_hapticlist_item *prev = NULL; - if (path == NULL) { + if (!path) { return -1; } - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { /* found it, remove it. */ if (SDL_strcmp(path, item->fname) == 0) { const int retval = item->haptic ? item->haptic->index : -1; - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_hapticlist == item); @@ -347,8 +336,7 @@ MaybeRemoveDevice(const char* path) /* * Gets the name from a file descriptor. */ -static const char * -SDL_SYS_HapticNameFromFD(int fd) +static const char *SDL_SYS_HapticNameFromFD(int fd) { static char namebuf[128]; @@ -360,12 +348,10 @@ SDL_SYS_HapticNameFromFD(int fd) return namebuf; } - /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item; int fd; @@ -379,7 +365,7 @@ SDL_SYS_HapticName(int index) if (fd >= 0) { name = SDL_SYS_HapticNameFromFD(fd); - if (name == NULL) { + if (!name) { /* No name found, return device character device */ name = item->fname; } @@ -389,17 +375,15 @@ SDL_SYS_HapticName(int index) return name; } - /* * Opens the haptic device from the file descriptor. */ -static int -SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) +static int SDL_SYS_HapticOpenFromFD(SDL_Haptic *haptic, int fd) { /* Allocate the hwdata */ haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata)); - if (haptic->hwdata == NULL) { + if (!haptic->hwdata) { SDL_OutOfMemory(); goto open_err; } @@ -408,7 +392,7 @@ SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) /* Set the data. */ haptic->hwdata->fd = fd; haptic->supported = EV_IsHaptic(fd); - haptic->naxes = 2; /* Hardcoded for now, not sure if it's possible to find out. */ + haptic->naxes = 2; /* Hardcoded for now, not sure if it's possible to find out. */ /* Set the effects */ if (ioctl(fd, EVIOCGEFFECTS, &haptic->neffects) < 0) { @@ -416,10 +400,10 @@ SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) strerror(errno)); goto open_err; } - haptic->nplaying = haptic->neffects; /* Linux makes no distinction. */ + haptic->nplaying = haptic->neffects; /* Linux makes no distinction. */ haptic->effects = (struct haptic_effect *) SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); - if (haptic->effects == NULL) { + if (!haptic->effects) { SDL_OutOfMemory(); goto open_err; } @@ -430,21 +414,19 @@ SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) return 0; /* Error handling */ - open_err: +open_err: close(fd); - if (haptic->hwdata != NULL) { + if (haptic->hwdata) { SDL_free(haptic->hwdata); haptic->hwdata = NULL; } return -1; } - /* * Opens a haptic device for usage. */ -int -SDL_SYS_HapticOpen(SDL_Haptic * haptic) +int SDL_SYS_HapticOpen(SDL_Haptic *haptic) { int fd; int ret; @@ -465,16 +447,14 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic) } /* Set the fname. */ - haptic->hwdata->fname = SDL_strdup( item->fname ); + haptic->hwdata->fname = SDL_strdup(item->fname); return 0; } - /* * Opens a haptic device from first mouse it finds for usage. */ -int -SDL_SYS_HapticMouse(void) +int SDL_SYS_HapticMouse(void) { int fd; int device_index = 0; @@ -502,14 +482,14 @@ SDL_SYS_HapticMouse(void) return -1; } - /* * Checks to see if a joystick has haptic features. */ -int -SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_LINUX + SDL_AssertJoysticksLocked(); + if (joystick->driver != &SDL_LINUX_JoystickDriver) { return SDL_FALSE; } @@ -520,14 +500,14 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) return SDL_FALSE; } - /* * Checks to see if the haptic device and joystick are in reality the same. */ -int -SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_LINUX + SDL_AssertJoysticksLocked(); + if (joystick->driver != &SDL_LINUX_JoystickDriver) { return 0; } @@ -540,19 +520,19 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) return 0; } - /* * Opens a SDL_Haptic from a SDL_Joystick. */ -int -SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_LINUX int device_index = 0; int fd; int ret; SDL_hapticlist_item *item; - + + SDL_AssertJoysticksLocked(); + if (joystick->driver != &SDL_LINUX_JoystickDriver) { return -1; } @@ -579,7 +559,7 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) return -1; } - haptic->hwdata->fname = SDL_strdup( joystick->hwdata->fname ); + haptic->hwdata->fname = SDL_strdup(joystick->hwdata->fname); return 0; #else @@ -587,12 +567,10 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) #endif } - /* * Closes the haptic device. */ -void -SDL_SYS_HapticClose(SDL_Haptic * haptic) +void SDL_SYS_HapticClose(SDL_Haptic *haptic) { if (haptic->hwdata) { @@ -614,12 +592,10 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) SDL_memset(haptic, 0, sizeof(SDL_Haptic)); } - /* * Clean up after system specific haptic stuff */ -void -SDL_SYS_HapticQuit(void) +void SDL_SYS_HapticQuit(void) { SDL_hapticlist_item *item = NULL; SDL_hapticlist_item *next = NULL; @@ -632,7 +608,7 @@ SDL_SYS_HapticQuit(void) SDL_free(item); } -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV SDL_UDEV_DelCallback(haptic_udev_callback); SDL_UDEV_Quit(); #endif /* SDL_USE_LIBUDEV */ @@ -642,12 +618,10 @@ SDL_SYS_HapticQuit(void) SDL_hapticlist_tail = NULL; } - /* * Converts an SDL button to a ff_trigger button. */ -static Uint16 -SDL_SYS_ToButton(Uint16 button) +static Uint16 SDL_SYS_ToButton(Uint16 button) { Uint16 ff_button; @@ -664,52 +638,39 @@ SDL_SYS_ToButton(Uint16 button) return ff_button; } - /* * Initializes the ff_effect usable direction from a SDL_HapticDirection. */ -static int -SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) +static int SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection *src) { Uint32 tmp; switch (src->type) { case SDL_HAPTIC_POLAR: - /* Linux directions start from south. - (and range from 0 to 0xFFFF) - Quoting include/linux/input.h, line 926: - Direction of the effect is encoded as follows: - 0 deg -> 0x0000 (down) - 90 deg -> 0x4000 (left) - 180 deg -> 0x8000 (up) - 270 deg -> 0xC000 (right) - The force pulls into the direction specified by Linux directions, - i.e. the opposite convention of SDL directions. - */ tmp = ((src->dir[0] % 36000) * 0x8000) / 18000; /* convert to range [0,0xFFFF] */ - *dest = (Uint16) tmp; + *dest = (Uint16)tmp; break; case SDL_HAPTIC_SPHERICAL: - /* - We convert to polar, because that's the only supported direction on Linux. - The first value of a spherical direction is practically the same as a - Polar direction, except that we have to add 90 degrees. It is the angle - from EAST {1,0} towards SOUTH {0,1}. - --> add 9000 - --> finally convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR. - */ - tmp = ((src->dir[0]) + 9000) % 36000; /* Convert to polars */ - tmp = (tmp * 0x8000) / 18000; /* convert to range [0,0xFFFF] */ - *dest = (Uint16) tmp; + /* + We convert to polar, because that's the only supported direction on Linux. + The first value of a spherical direction is practically the same as a + Polar direction, except that we have to add 90 degrees. It is the angle + from EAST {1,0} towards SOUTH {0,1}. + --> add 9000 + --> finally convert to [0,0xFFFF] as in case SDL_HAPTIC_POLAR. + */ + tmp = ((src->dir[0]) + 9000) % 36000; /* Convert to polars */ + tmp = (tmp * 0x8000) / 18000; /* convert to range [0,0xFFFF] */ + *dest = (Uint16)tmp; break; case SDL_HAPTIC_CARTESIAN: - if (!src->dir[1]) + if (!src->dir[1]) { *dest = (src->dir[0] >= 0 ? 0x4000 : 0xC000); - else if (!src->dir[0]) + } else if (!src->dir[0]) { *dest = (src->dir[1] >= 0 ? 0x8000 : 0); - else { + } else { float f = SDL_atan2(src->dir[1], src->dir[0]); /* Ideally we'd use fixed point math instead of floats... */ /* SDL_atan2 takes the parameters: Y-axis-value and X-axis-value (in that order) @@ -723,7 +684,7 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) */ tmp = (((Sint32) (f * 18000. / M_PI)) + 45000) % 36000; tmp = (tmp * 0x8000) / 18000; /* convert to range [0,0xFFFF] */ - *dest = (Uint16) tmp; + *dest = (Uint16)tmp; } break; case SDL_HAPTIC_STEERING_AXIS: @@ -736,14 +697,12 @@ SDL_SYS_ToDirection(Uint16 *dest, SDL_HapticDirection * src) return 0; } - -#define CLAMP(x) (((x) > 32767) ? 32767 : x) +#define CLAMP(x) (((x) > 32767) ? 32767 : x) /* * Initializes the Linux effect struct from a haptic_effect. * Values above 32767 (for unsigned) are unspecified so we must clamp. */ -static int -SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) +static int SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect *src) { SDL_HapticConstant *constant; SDL_HapticPeriodic *periodic; @@ -760,12 +719,12 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) /* Header */ dest->type = FF_CONSTANT; - if (SDL_SYS_ToDirection(&dest->direction, &constant->direction) == -1) + if (SDL_SYS_ToDirection(&dest->direction, &constant->direction) == -1) { return -1; + } /* Replay */ - dest->replay.length = (constant->length == SDL_HAPTIC_INFINITY) ? - 0 : CLAMP(constant->length); + dest->replay.length = (constant->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(constant->length); dest->replay.delay = CLAMP(constant->delay); /* Trigger */ @@ -795,12 +754,12 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) /* Header */ dest->type = FF_PERIODIC; - if (SDL_SYS_ToDirection(&dest->direction, &periodic->direction) == -1) + if (SDL_SYS_ToDirection(&dest->direction, &periodic->direction) == -1) { return -1; + } /* Replay */ - dest->replay.length = (periodic->length == SDL_HAPTIC_INFINITY) ? - 0 : CLAMP(periodic->length); + dest->replay.length = (periodic->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(periodic->length); dest->replay.delay = CLAMP(periodic->delay); /* Trigger */ @@ -808,17 +767,18 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) dest->trigger.interval = CLAMP(periodic->interval); /* Periodic */ - if (periodic->type == SDL_HAPTIC_SINE) + if (periodic->type == SDL_HAPTIC_SINE) { dest->u.periodic.waveform = FF_SINE; - /* !!! FIXME: put this back when we have more bits in 2.1 */ - /* else if (periodic->type == SDL_HAPTIC_SQUARE) - dest->u.periodic.waveform = FF_SQUARE; */ - else if (periodic->type == SDL_HAPTIC_TRIANGLE) + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /* else if (periodic->type == SDL_HAPTIC_SQUARE) + dest->u.periodic.waveform = FF_SQUARE; */ + } else if (periodic->type == SDL_HAPTIC_TRIANGLE) { dest->u.periodic.waveform = FF_TRIANGLE; - else if (periodic->type == SDL_HAPTIC_SAWTOOTHUP) + } else if (periodic->type == SDL_HAPTIC_SAWTOOTHUP) { dest->u.periodic.waveform = FF_SAW_UP; - else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN) + } else if (periodic->type == SDL_HAPTIC_SAWTOOTHDOWN) { dest->u.periodic.waveform = FF_SAW_DOWN; + } dest->u.periodic.period = CLAMP(periodic->period); dest->u.periodic.magnitude = periodic->magnitude; dest->u.periodic.offset = periodic->offset; @@ -842,19 +802,22 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) condition = &src->condition; /* Header */ - if (condition->type == SDL_HAPTIC_SPRING) + if (condition->type == SDL_HAPTIC_SPRING) { dest->type = FF_SPRING; - else if (condition->type == SDL_HAPTIC_DAMPER) + } else if (condition->type == SDL_HAPTIC_DAMPER) { dest->type = FF_DAMPER; - else if (condition->type == SDL_HAPTIC_INERTIA) + } else if (condition->type == SDL_HAPTIC_INERTIA) { dest->type = FF_INERTIA; - else if (condition->type == SDL_HAPTIC_FRICTION) + } else if (condition->type == SDL_HAPTIC_FRICTION) { dest->type = FF_FRICTION; - dest->direction = 0; /* Handled by the condition-specifics. */ + } + + if (SDL_SYS_ToDirection(&dest->direction, &condition->direction) == -1) { + return -1; + } /* Replay */ - dest->replay.length = (condition->length == SDL_HAPTIC_INFINITY) ? - 0 : CLAMP(condition->length); + dest->replay.length = (condition->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(condition->length); dest->replay.delay = CLAMP(condition->delay); /* Trigger */ @@ -888,12 +851,12 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) /* Header */ dest->type = FF_RAMP; - if (SDL_SYS_ToDirection(&dest->direction, &ramp->direction) == -1) + if (SDL_SYS_ToDirection(&dest->direction, &ramp->direction) == -1) { return -1; + } /* Replay */ - dest->replay.length = (ramp->length == SDL_HAPTIC_INFINITY) ? - 0 : CLAMP(ramp->length); + dest->replay.length = (ramp->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(ramp->length); dest->replay.delay = CLAMP(ramp->delay); /* Trigger */ @@ -917,11 +880,10 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) /* Header */ dest->type = FF_RUMBLE; - dest->direction = 0; + dest->direction = 0x4000; /* Replay */ - dest->replay.length = (leftright->length == SDL_HAPTIC_INFINITY) ? - 0 : CLAMP(leftright->length); + dest->replay.length = (leftright->length == SDL_HAPTIC_INFINITY) ? 0 : CLAMP(leftright->length); /* Trigger */ dest->trigger.button = 0; @@ -933,7 +895,6 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) break; - default: return SDL_SetError("Haptic: Unknown effect type."); } @@ -941,20 +902,18 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src) return 0; } - /* * Creates a new haptic effect. */ -int -SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - SDL_HapticEffect * base) +int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + SDL_HapticEffect *base) { struct ff_effect *linux_effect; /* Allocate the hardware effect */ effect->hweffect = (struct haptic_hweffect *) SDL_malloc(sizeof(struct haptic_hweffect)); - if (effect->hweffect == NULL) { + if (!effect->hweffect) { return SDL_OutOfMemory(); } @@ -963,7 +922,7 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, if (SDL_SYS_ToFFEffect(linux_effect, base) != 0) { goto new_effect_err; } - linux_effect->id = -1; /* Have the kernel give it an id */ + linux_effect->id = -1; /* Have the kernel give it an id */ /* Upload the effect */ if (ioctl(haptic->hwdata->fd, EVIOCSFF, linux_effect) < 0) { @@ -974,23 +933,21 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, return 0; - new_effect_err: +new_effect_err: SDL_free(effect->hweffect); effect->hweffect = NULL; return -1; } - /* * Updates an effect. * * Note: Dynamically updating the direction can in some cases force * the effect to restart and run once. */ -int -SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, - SDL_HapticEffect * data) +int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, + SDL_HapticEffect *data) { struct ff_effect linux_effect; @@ -1013,13 +970,11 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, return effect->hweffect->effect.id; } - /* * Runs an effect. */ -int -SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - Uint32 iterations) +int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + Uint32 iterations) { struct input_event run; @@ -1029,19 +984,17 @@ SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, /* We don't actually have infinity here, so we just do INT_MAX which is pretty damn close. */ run.value = (iterations > INT_MAX) ? INT_MAX : iterations; - if (write(haptic->hwdata->fd, (const void *) &run, sizeof(run)) < 0) { + if (write(haptic->hwdata->fd, (const void *)&run, sizeof(run)) < 0) { return SDL_SetError("Haptic: Unable to run the effect: %s", strerror(errno)); } return 0; } - /* * Stops an effect. */ -int -SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { struct input_event stop; @@ -1049,7 +1002,7 @@ SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) stop.code = effect->hweffect->effect.id; stop.value = 0; - if (write(haptic->hwdata->fd, (const void *) &stop, sizeof(stop)) < 0) { + if (write(haptic->hwdata->fd, (const void *)&stop, sizeof(stop)) < 0) { return SDL_SetError("Haptic: Unable to stop the effect: %s", strerror(errno)); } @@ -1057,12 +1010,10 @@ SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) return 0; } - /* * Frees the effect. */ -void -SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { if (ioctl(haptic->hwdata->fd, EVIOCRMFF, effect->hweffect->effect.id) < 0) { SDL_SetError("Haptic: Error removing the effect from the device: %s", @@ -1072,15 +1023,13 @@ SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) effect->hweffect = NULL; } - /* * Gets the status of a haptic effect. */ -int -SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, - struct haptic_effect *effect) +int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, + struct haptic_effect *effect) { -#if 0 /* Not supported atm. */ +#if 0 /* Not supported atm. */ struct input_event ie; ie.type = EV_FF; @@ -1097,12 +1046,10 @@ SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, return -1; } - /* * Sets the gain. */ -int -SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain) { struct input_event ie; @@ -1117,12 +1064,10 @@ SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) return 0; } - /* * Sets the autocentering. */ -int -SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { struct input_event ie; @@ -1137,32 +1082,26 @@ SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) return 0; } - /* * Pausing is not supported atm by linux. */ -int -SDL_SYS_HapticPause(SDL_Haptic * haptic) +int SDL_SYS_HapticPause(SDL_Haptic *haptic) { return -1; } - /* * Unpausing is not supported atm by linux. */ -int -SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +int SDL_SYS_HapticUnpause(SDL_Haptic *haptic) { return -1; } - /* * Stops all the currently playing effects. */ -int -SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +int SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { int i, ret; @@ -1171,8 +1110,7 @@ SDL_SYS_HapticStopAll(SDL_Haptic * haptic) if (haptic->effects[i].hweffect != NULL) { ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]); if (ret < 0) { - return SDL_SetError - ("Haptic: Error while trying to stop all playing effects."); + return SDL_SetError("Haptic: Error while trying to stop all playing effects."); } } } diff --git a/src/haptic/windows/SDL_dinputhaptic.c b/src/haptic/windows/SDL_dinputhaptic.c index 2229c691665d1..04d91ce057bc0 100644 --- a/src/haptic/windows/SDL_dinputhaptic.c +++ b/src/haptic/windows/SDL_dinputhaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "SDL_haptic.h" #include "../SDL_syshaptic.h" -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT #include "SDL_hints.h" #include "SDL_stdinc.h" @@ -37,8 +37,11 @@ /* * External stuff. */ +#ifdef SDL_VIDEO_DRIVER_WINDOWS extern HWND SDL_HelperWindow; - +#else +static const HWND SDL_HelperWindow = NULL; +#endif /* * Internal stuff. @@ -46,12 +49,10 @@ extern HWND SDL_HelperWindow; static SDL_bool coinitialized = SDL_FALSE; static LPDIRECTINPUT8 dinput = NULL; - /* * Like SDL_SetError but for DX error codes. */ -static int -DI_SetError(const char *str, HRESULT err) +static int DI_SetError(const char *str, HRESULT err) { return SDL_SetError("Haptic error %s", str); } @@ -59,22 +60,20 @@ DI_SetError(const char *str, HRESULT err) /* * Callback to find the haptic devices. */ -static BOOL CALLBACK -EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) +static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE *pdidInstance, VOID *pContext) { - (void) pContext; + (void)pContext; SDL_DINPUT_HapticMaybeAddDevice(pdidInstance); - return DIENUM_CONTINUE; /* continue enumerating */ + return DIENUM_CONTINUE; /* continue enumerating */ } -int -SDL_DINPUT_HapticInit(void) +int SDL_DINPUT_HapticInit(void) { HRESULT ret; HINSTANCE instance; DWORD devClass; - if (dinput != NULL) { /* Already open. */ + if (dinput != NULL) { /* Already open. */ return SDL_SetError("Haptic: SubSystem already open."); } @@ -91,7 +90,7 @@ SDL_DINPUT_HapticInit(void) coinitialized = SDL_TRUE; ret = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, - &IID_IDirectInput8, (LPVOID *) &dinput); + &IID_IDirectInput8, (LPVOID *)&dinput); if (FAILED(ret)) { SDL_SYS_HapticQuit(); return DI_SetError("CoCreateInstance", ret); @@ -99,10 +98,10 @@ SDL_DINPUT_HapticInit(void) /* Because we used CoCreateInstance, we need to Initialize it, first. */ instance = GetModuleHandle(NULL); - if (instance == NULL) { + if (!instance) { SDL_SYS_HapticQuit(); return SDL_SetError("GetModuleHandle() failed with error code %lu.", - GetLastError()); + GetLastError()); } ret = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION); if (FAILED(ret)) { @@ -122,7 +121,7 @@ SDL_DINPUT_HapticInit(void) EnumHapticsCallback, NULL, DIEDFL_FORCEFEEDBACK | - DIEDFL_ATTACHEDONLY); + DIEDFL_ATTACHEDONLY); if (FAILED(ret)) { SDL_SYS_HapticQuit(); return DI_SetError("Enumerating DirectInput devices", ret); @@ -132,8 +131,7 @@ SDL_DINPUT_HapticInit(void) return 0; } -int -SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) +int SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE *pdidInstance) { HRESULT ret; LPDIRECTINPUTDEVICE8 device; @@ -141,14 +139,14 @@ SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) DIDEVCAPS capabilities; SDL_hapticlist_item *item = NULL; - if (dinput == NULL) { - return -1; /* not initialized. We'll pick these up on enumeration if we init later. */ + if (!dinput) { + return -1; /* not initialized. We'll pick these up on enumeration if we init later. */ } /* Make sure we don't already have it */ for (item = SDL_hapticlist; item; item = item->next) { if ((!item->bXInputHaptic) && (SDL_memcmp(&item->instance, pdidInstance, sizeof(*pdidInstance)) == 0)) { - return -1; /* Already added */ + return -1; /* Already added */ } } @@ -170,11 +168,11 @@ SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) } if ((capabilities.dwFlags & needflags) != needflags) { - return -1; /* not a device we can use. */ + return -1; /* not a device we can use. */ } item = (SDL_hapticlist_item *)SDL_calloc(1, sizeof(SDL_hapticlist_item)); - if (item == NULL) { + if (!item) { return SDL_OutOfMemory(); } @@ -191,17 +189,16 @@ SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) return SDL_SYS_AddHapticDevice(item); } -int -SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) +int SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE *pdidInstance) { SDL_hapticlist_item *item; SDL_hapticlist_item *prev = NULL; - if (dinput == NULL) { - return -1; /* not initialized, ignore this. */ + if (!dinput) { + return -1; /* not initialized, ignore this. */ } - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (!item->bXInputHaptic && SDL_memcmp(&item->instance, pdidInstance, sizeof(*pdidInstance)) == 0) { /* found it, remove it. */ return SDL_SYS_RemoveHapticDevice(prev, item); @@ -214,10 +211,9 @@ SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) /* * Callback to get supported axes. */ -static BOOL CALLBACK -DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) +static BOOL CALLBACK DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) { - SDL_Haptic *haptic = (SDL_Haptic *) pvRef; + SDL_Haptic *haptic = (SDL_Haptic *)pvRef; if ((dev->dwType & DIDFT_AXIS) && (dev->dwFlags & DIDOI_FFACTUATOR)) { const GUID *guid = &dev->guidType; @@ -235,7 +231,7 @@ DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) } else if (WIN_IsEqualGUID(guid, &GUID_RzAxis)) { offset = DIJOFS_RZ; } else { - return DIENUM_CONTINUE; /* can't use this, go on. */ + return DIENUM_CONTINUE; /* can't use this, go on. */ } haptic->hwdata->axes[haptic->naxes] = offset; @@ -253,14 +249,13 @@ DI_DeviceObjectCallback(LPCDIDEVICEOBJECTINSTANCE dev, LPVOID pvRef) /* * Callback to get all supported effects. */ -#define EFFECT_TEST(e,s) \ -if (WIN_IsEqualGUID(&pei->guid, &(e))) \ - haptic->supported |= (s) -static BOOL CALLBACK -DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) +#define EFFECT_TEST(e, s) \ + if (WIN_IsEqualGUID(&pei->guid, &(e))) \ + haptic->supported |= (s) +static BOOL CALLBACK DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) { /* Prepare the haptic device. */ - SDL_Haptic *haptic = (SDL_Haptic *) pv; + SDL_Haptic *haptic = (SDL_Haptic *)pv; /* Get supported. */ EFFECT_TEST(GUID_Spring, SDL_HAPTIC_SPRING); @@ -291,15 +286,14 @@ DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv) * - Reset actuators. * - Get supported features. */ -static int -SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device8, SDL_bool is_joystick) +static int SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic *haptic, LPDIRECTINPUTDEVICE8 device8, SDL_bool is_joystick) { HRESULT ret; DIPROPDWORD dipdw; /* Allocate the hwdata */ haptic->hwdata = (struct haptic_hwdata *)SDL_malloc(sizeof(*haptic->hwdata)); - if (haptic->hwdata == NULL) { + if (!haptic->hwdata) { return SDL_OutOfMemory(); } SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata)); @@ -315,12 +309,12 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device !!! FIXME: to work, and that's probably the common case. Still, !!! FIXME: ideally, We need to unify the opening code. */ - if (!is_joystick) { /* if is_joystick, we already set this up elsewhere. */ + if (!is_joystick) { /* if is_joystick, we already set this up elsewhere. */ /* Grab it exclusively to use force feedback stuff. */ ret = IDirectInputDevice8_SetCooperativeLevel(haptic->hwdata->device, SDL_HelperWindow, DISCL_EXCLUSIVE | - DISCL_BACKGROUND); + DISCL_BACKGROUND); if (FAILED(ret)) { DI_SetError("Setting cooperative level to exclusive", ret); goto acquire_err; @@ -334,7 +328,6 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device goto acquire_err; } - /* Acquire the device. */ ret = IDirectInputDevice8_Acquire(haptic->hwdata->device); if (FAILED(ret)) { @@ -376,7 +369,7 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device DI_SetError("Enumerating supported effects", ret); goto acquire_err; } - if (haptic->supported == 0) { /* Error since device supports nothing. */ + if (haptic->supported == 0) { /* Error since device supports nothing. */ SDL_SetError("Haptic: Internal error on finding supported effects."); goto acquire_err; } @@ -389,7 +382,7 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device dipdw.dwData = 10000; ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, DIPROP_FFGAIN, &dipdw.diph); - if (!FAILED(ret)) { /* Gain is supported. */ + if (!FAILED(ret)) { /* Gain is supported. */ haptic->supported |= SDL_HAPTIC_GAIN; } dipdw.diph.dwObj = 0; @@ -397,7 +390,7 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device dipdw.dwData = DIPROPAUTOCENTER_OFF; ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, DIPROP_AUTOCENTER, &dipdw.diph); - if (!FAILED(ret)) { /* Autocenter is supported. */ + if (!FAILED(ret)) { /* Autocenter is supported. */ haptic->supported |= SDL_HAPTIC_AUTOCENTER; } @@ -405,16 +398,16 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device haptic->supported |= SDL_HAPTIC_STATUS | SDL_HAPTIC_PAUSE; /* Check maximum effects. */ - haptic->neffects = 128; /* This is not actually supported as thus under windows, - there is no way to tell the number of EFFECTS that a - device can hold, so we'll just use a "random" number - instead and put warnings in SDL_haptic.h */ - haptic->nplaying = 128; /* Even more impossible to get this then neffects. */ + haptic->neffects = 128; /* This is not actually supported as thus under windows, + there is no way to tell the number of EFFECTS that a + device can hold, so we'll just use a "random" number + instead and put warnings in SDL_haptic.h */ + haptic->nplaying = 128; /* Even more impossible to get this then neffects. */ /* Prepare effects memory. */ haptic->effects = (struct haptic_effect *) SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); - if (haptic->effects == NULL) { + if (!haptic->effects) { SDL_OutOfMemory(); goto acquire_err; } @@ -425,20 +418,19 @@ SDL_DINPUT_HapticOpenFromDevice(SDL_Haptic * haptic, LPDIRECTINPUTDEVICE8 device return 0; /* Error handling */ - acquire_err: +acquire_err: IDirectInputDevice8_Unacquire(haptic->hwdata->device); return -1; } -int -SDL_DINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item) +int SDL_DINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item) { HRESULT ret; LPDIRECTINPUTDEVICE8 device; /* Open the device */ ret = IDirectInput8_CreateDevice(dinput, &item->instance.guidInstance, - &device, NULL); + &device, NULL); if (FAILED(ret)) { DI_SetError("Creating DirectInput device", ret); return -1; @@ -451,8 +443,7 @@ SDL_DINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item) return 0; } -int -SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { HRESULT ret; DIDEVICEINSTANCE hap_instance, joy_instance; @@ -462,12 +453,12 @@ SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) /* Get the device instances. */ ret = IDirectInputDevice8_GetDeviceInfo(haptic->hwdata->device, - &hap_instance); + &hap_instance); if (FAILED(ret)) { return 0; } ret = IDirectInputDevice8_GetDeviceInfo(joystick->hwdata->InputDevice, - &joy_instance); + &joy_instance); if (FAILED(ret)) { return 0; } @@ -475,8 +466,7 @@ SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) return WIN_IsEqualGUID(&hap_instance.guidInstance, &joy_instance.guidInstance); } -int -SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { SDL_hapticlist_item *item; int index = 0; @@ -490,7 +480,7 @@ SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) } /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */ - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (!item->bXInputHaptic && WIN_IsEqualGUID(&item->instance.guidInstance, &joy_instance.guidInstance)) { haptic->index = index; return SDL_DINPUT_HapticOpenFromDevice(haptic, joystick->hwdata->InputDevice, SDL_TRUE); @@ -501,8 +491,7 @@ SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) return SDL_SetError("Couldn't find joystick in haptic device list"); } -void -SDL_DINPUT_HapticClose(SDL_Haptic * haptic) +void SDL_DINPUT_HapticClose(SDL_Haptic *haptic) { IDirectInputDevice8_Unacquire(haptic->hwdata->device); @@ -512,8 +501,7 @@ SDL_DINPUT_HapticClose(SDL_Haptic * haptic) } } -void -SDL_DINPUT_HapticQuit(void) +void SDL_DINPUT_HapticQuit(void) { if (dinput != NULL) { IDirectInput8_Release(dinput); @@ -529,8 +517,7 @@ SDL_DINPUT_HapticQuit(void) /* * Converts an SDL trigger button to an DIEFFECT trigger button. */ -static DWORD -DIGetTriggerButton(Uint16 button) +static DWORD DIGetTriggerButton(Uint16 button) { DWORD dwTriggerButton; @@ -543,25 +530,23 @@ DIGetTriggerButton(Uint16 button) return dwTriggerButton; } - /* * Sets the direction. */ -static int -SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes) +static int SDL_SYS_SetDirection(DIEFFECT *effect, SDL_HapticDirection *dir, int naxes) { LONG *rglDir; /* Handle no axes a part. */ if (naxes == 0) { - effect->dwFlags |= DIEFF_SPHERICAL; /* Set as default. */ + effect->dwFlags |= DIEFF_SPHERICAL; /* Set as default. */ effect->rglDirection = NULL; return 0; } /* Has axes. */ rglDir = SDL_malloc(sizeof(LONG) * naxes); - if (rglDir == NULL) { + if (!rglDir) { return SDL_OutOfMemory(); } SDL_memset(rglDir, 0, sizeof(LONG) * naxes); @@ -575,18 +560,22 @@ SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes) case SDL_HAPTIC_CARTESIAN: effect->dwFlags |= DIEFF_CARTESIAN; rglDir[0] = dir->dir[0]; - if (naxes > 1) + if (naxes > 1) { rglDir[1] = dir->dir[1]; - if (naxes > 2) + } + if (naxes > 2) { rglDir[2] = dir->dir[2]; + } return 0; case SDL_HAPTIC_SPHERICAL: effect->dwFlags |= DIEFF_SPHERICAL; rglDir[0] = dir->dir[0]; - if (naxes > 1) + if (naxes > 1) { rglDir[1] = dir->dir[1]; - if (naxes > 2) + } + if (naxes > 2) { rglDir[2] = dir->dir[2]; + } return 0; case SDL_HAPTIC_STEERING_AXIS: effect->dwFlags |= DIEFF_CARTESIAN; @@ -599,20 +588,19 @@ SDL_SYS_SetDirection(DIEFFECT * effect, SDL_HapticDirection * dir, int naxes) } /* Clamps and converts. */ -#define CCONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) +#define CCONVERT(x) (((x) > 0x7FFF) ? 10000 : ((x)*10000) / 0x7FFF) /* Just converts. */ -#define CONVERT(x) (((x)*10000) / 0x7FFF) +#define CONVERT(x) (((x)*10000) / 0x7FFF) /* * Creates the DIEFFECT from a SDL_HapticEffect. */ -static int -SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, - SDL_HapticEffect * src) +static int SDL_SYS_ToDIEFFECT(SDL_Haptic *haptic, DIEFFECT *dest, + SDL_HapticEffect *src) { int i; DICONSTANTFORCE *constant; DIPERIODIC *periodic; - DICONDITION *condition; /* Actually an array of conditions - one per axis. */ + DICONDITION *condition; /* Actually an array of conditions - one per axis. */ DIRAMPFORCE *ramp; DICUSTOMFORCE *custom; DIENVELOPE *envelope; @@ -625,19 +613,19 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, /* Set global stuff. */ SDL_memset(dest, 0, sizeof(DIEFFECT)); - dest->dwSize = sizeof(DIEFFECT); /* Set the structure size. */ - dest->dwSamplePeriod = 0; /* Not used by us. */ - dest->dwGain = 10000; /* Gain is set globally, not locally. */ - dest->dwFlags = DIEFF_OBJECTOFFSETS; /* Seems obligatory. */ + dest->dwSize = sizeof(DIEFFECT); /* Set the structure size. */ + dest->dwSamplePeriod = 0; /* Not used by us. */ + dest->dwGain = 10000; /* Gain is set globally, not locally. */ + dest->dwFlags = DIEFF_OBJECTOFFSETS; /* Seems obligatory. */ /* Envelope. */ envelope = SDL_malloc(sizeof(DIENVELOPE)); - if (envelope == NULL) { + if (!envelope) { return SDL_OutOfMemory(); } SDL_memset(envelope, 0, sizeof(DIENVELOPE)); dest->lpEnvelope = envelope; - envelope->dwSize = sizeof(DIENVELOPE); /* Always should be this. */ + envelope->dwSize = sizeof(DIENVELOPE); /* Always should be this. */ /* Axes. */ if (src->constant.direction.type == SDL_HAPTIC_STEERING_AXIS) { @@ -647,10 +635,10 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, } if (dest->cAxes > 0) { axes = SDL_malloc(sizeof(DWORD) * dest->cAxes); - if (axes == NULL) { + if (!axes) { return SDL_OutOfMemory(); } - axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ + axes[0] = haptic->hwdata->axes[0]; /* Always at least one axis. */ if (dest->cAxes > 1) { axes[1] = haptic->hwdata->axes[1]; } @@ -665,7 +653,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, case SDL_HAPTIC_CONSTANT: hap_constant = &src->constant; constant = SDL_malloc(sizeof(DICONSTANTFORCE)); - if (constant == NULL) { + if (!constant) { return SDL_OutOfMemory(); } SDL_memset(constant, 0, sizeof(DICONSTANTFORCE)); @@ -676,10 +664,10 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, dest->lpvTypeSpecificParams = constant; /* Generics */ - dest->dwDuration = hap_constant->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_constant->length * 1000UL; /* In microseconds. */ dest->dwTriggerButton = DIGetTriggerButton(hap_constant->button); dest->dwTriggerRepeatInterval = hap_constant->interval; - dest->dwStartDelay = hap_constant->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_constant->delay * 1000UL; /* In microseconds. */ /* Direction. */ if (SDL_SYS_SetDirection(dest, &hap_constant->direction, dest->cAxes) < 0) { @@ -687,15 +675,14 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, } /* Envelope */ - if ((hap_constant->attack_length == 0) - && (hap_constant->fade_length == 0)) { + if ((hap_constant->attack_length == 0) && (hap_constant->fade_length == 0)) { SDL_free(dest->lpEnvelope); dest->lpEnvelope = NULL; } else { envelope->dwAttackLevel = CCONVERT(hap_constant->attack_level); - envelope->dwAttackTime = hap_constant->attack_length * 1000; + envelope->dwAttackTime = hap_constant->attack_length * 1000UL; envelope->dwFadeLevel = CCONVERT(hap_constant->fade_level); - envelope->dwFadeTime = hap_constant->fade_length * 1000; + envelope->dwFadeTime = hap_constant->fade_length * 1000UL; } break; @@ -708,7 +695,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, case SDL_HAPTIC_SAWTOOTHDOWN: hap_periodic = &src->periodic; periodic = SDL_malloc(sizeof(DIPERIODIC)); - if (periodic == NULL) { + if (!periodic) { return SDL_OutOfMemory(); } SDL_memset(periodic, 0, sizeof(DIPERIODIC)); @@ -717,33 +704,31 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, periodic->dwMagnitude = CONVERT(SDL_abs(hap_periodic->magnitude)); periodic->lOffset = CONVERT(hap_periodic->offset); periodic->dwPhase = - (hap_periodic->phase + (hap_periodic->magnitude < 0 ? 18000 : 0)) % 36000; + (hap_periodic->phase + (hap_periodic->magnitude < 0 ? 18000 : 0)) % 36000; periodic->dwPeriod = hap_periodic->period * 1000; dest->cbTypeSpecificParams = sizeof(DIPERIODIC); dest->lpvTypeSpecificParams = periodic; /* Generics */ - dest->dwDuration = hap_periodic->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_periodic->length * 1000UL; /* In microseconds. */ dest->dwTriggerButton = DIGetTriggerButton(hap_periodic->button); dest->dwTriggerRepeatInterval = hap_periodic->interval; - dest->dwStartDelay = hap_periodic->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_periodic->delay * 1000UL; /* In microseconds. */ /* Direction. */ - if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) - < 0) { + if (SDL_SYS_SetDirection(dest, &hap_periodic->direction, dest->cAxes) < 0) { return -1; } /* Envelope */ - if ((hap_periodic->attack_length == 0) - && (hap_periodic->fade_length == 0)) { + if ((hap_periodic->attack_length == 0) && (hap_periodic->fade_length == 0)) { SDL_free(dest->lpEnvelope); dest->lpEnvelope = NULL; } else { envelope->dwAttackLevel = CCONVERT(hap_periodic->attack_level); - envelope->dwAttackTime = hap_periodic->attack_length * 1000; + envelope->dwAttackTime = hap_periodic->attack_length * 1000UL; envelope->dwFadeLevel = CCONVERT(hap_periodic->fade_level); - envelope->dwFadeTime = hap_periodic->fade_length * 1000; + envelope->dwFadeTime = hap_periodic->fade_length * 1000UL; } break; @@ -754,13 +739,13 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, case SDL_HAPTIC_FRICTION: hap_condition = &src->condition; condition = SDL_malloc(sizeof(DICONDITION) * dest->cAxes); - if (condition == NULL) { + if (!condition) { return SDL_OutOfMemory(); } SDL_memset(condition, 0, sizeof(DICONDITION)); /* Specifics */ - for (i = 0; i < (int) dest->cAxes; i++) { + for (i = 0; i < (int)dest->cAxes; i++) { condition[i].lOffset = CONVERT(hap_condition->center[i]); condition[i].lPositiveCoefficient = CONVERT(hap_condition->right_coeff[i]); @@ -776,14 +761,13 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, dest->lpvTypeSpecificParams = condition; /* Generics */ - dest->dwDuration = hap_condition->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_condition->length * 1000UL; /* In microseconds. */ dest->dwTriggerButton = DIGetTriggerButton(hap_condition->button); dest->dwTriggerRepeatInterval = hap_condition->interval; - dest->dwStartDelay = hap_condition->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_condition->delay * 1000UL; /* In microseconds. */ /* Direction. */ - if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) - < 0) { + if (SDL_SYS_SetDirection(dest, &hap_condition->direction, dest->cAxes) < 0) { return -1; } @@ -796,7 +780,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, case SDL_HAPTIC_RAMP: hap_ramp = &src->ramp; ramp = SDL_malloc(sizeof(DIRAMPFORCE)); - if (ramp == NULL) { + if (!ramp) { return SDL_OutOfMemory(); } SDL_memset(ramp, 0, sizeof(DIRAMPFORCE)); @@ -808,10 +792,10 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, dest->lpvTypeSpecificParams = ramp; /* Generics */ - dest->dwDuration = hap_ramp->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_ramp->length * 1000UL; /* In microseconds. */ dest->dwTriggerButton = DIGetTriggerButton(hap_ramp->button); dest->dwTriggerRepeatInterval = hap_ramp->interval; - dest->dwStartDelay = hap_ramp->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_ramp->delay * 1000UL; /* In microseconds. */ /* Direction. */ if (SDL_SYS_SetDirection(dest, &hap_ramp->direction, dest->cAxes) < 0) { @@ -824,9 +808,9 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, dest->lpEnvelope = NULL; } else { envelope->dwAttackLevel = CCONVERT(hap_ramp->attack_level); - envelope->dwAttackTime = hap_ramp->attack_length * 1000; + envelope->dwAttackTime = hap_ramp->attack_length * 1000UL; envelope->dwFadeLevel = CCONVERT(hap_ramp->fade_level); - envelope->dwFadeTime = hap_ramp->fade_length * 1000; + envelope->dwFadeTime = hap_ramp->fade_length * 1000UL; } break; @@ -834,28 +818,28 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, case SDL_HAPTIC_CUSTOM: hap_custom = &src->custom; custom = SDL_malloc(sizeof(DICUSTOMFORCE)); - if (custom == NULL) { + if (!custom) { return SDL_OutOfMemory(); } SDL_memset(custom, 0, sizeof(DICUSTOMFORCE)); /* Specifics */ custom->cChannels = hap_custom->channels; - custom->dwSamplePeriod = hap_custom->period * 1000; + custom->dwSamplePeriod = hap_custom->period * 1000UL; custom->cSamples = hap_custom->samples; custom->rglForceData = SDL_malloc(sizeof(LONG) * custom->cSamples * custom->cChannels); - for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ + for (i = 0; i < hap_custom->samples * hap_custom->channels; i++) { /* Copy data. */ custom->rglForceData[i] = CCONVERT(hap_custom->data[i]); } dest->cbTypeSpecificParams = sizeof(DICUSTOMFORCE); dest->lpvTypeSpecificParams = custom; /* Generics */ - dest->dwDuration = hap_custom->length * 1000; /* In microseconds. */ + dest->dwDuration = hap_custom->length * 1000UL; /* In microseconds. */ dest->dwTriggerButton = DIGetTriggerButton(hap_custom->button); dest->dwTriggerRepeatInterval = hap_custom->interval; - dest->dwStartDelay = hap_custom->delay * 1000; /* In microseconds. */ + dest->dwStartDelay = hap_custom->delay * 1000UL; /* In microseconds. */ /* Direction. */ if (SDL_SYS_SetDirection(dest, &hap_custom->direction, dest->cAxes) < 0) { @@ -863,15 +847,14 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, } /* Envelope */ - if ((hap_custom->attack_length == 0) - && (hap_custom->fade_length == 0)) { + if ((hap_custom->attack_length == 0) && (hap_custom->fade_length == 0)) { SDL_free(dest->lpEnvelope); dest->lpEnvelope = NULL; } else { envelope->dwAttackLevel = CCONVERT(hap_custom->attack_level); - envelope->dwAttackTime = hap_custom->attack_length * 1000; + envelope->dwAttackTime = hap_custom->attack_length * 1000UL; envelope->dwFadeLevel = CCONVERT(hap_custom->fade_level); - envelope->dwFadeTime = hap_custom->fade_length * 1000; + envelope->dwFadeTime = hap_custom->fade_length * 1000UL; } break; @@ -883,12 +866,10 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest, return 0; } - /* * Frees an DIEFFECT allocated by SDL_SYS_ToDIEFFECT. */ -static void -SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type) +static void SDL_SYS_HapticFreeDIEFFECT(DIEFFECT *effect, int type) { DICUSTOMFORCE *custom; @@ -896,9 +877,9 @@ SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type) effect->lpEnvelope = NULL; SDL_free(effect->rgdwAxes); effect->rgdwAxes = NULL; - if (effect->lpvTypeSpecificParams != NULL) { - if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ - custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams; + if (effect->lpvTypeSpecificParams) { + if (type == SDL_HAPTIC_CUSTOM) { /* Must free the custom data. */ + custom = (DICUSTOMFORCE *)effect->lpvTypeSpecificParams; SDL_free(custom->rglForceData); custom->rglForceData = NULL; } @@ -912,8 +893,8 @@ SDL_SYS_HapticFreeDIEFFECT(DIEFFECT * effect, int type) /* * Gets the effect type from the generic SDL haptic effect wrapper. */ -static REFGUID -SDL_SYS_HapticEffectType(SDL_HapticEffect * effect) +/* NOLINTNEXTLINE(readability-const-return-type): Can't fix Windows' headers */ +static REFGUID SDL_SYS_HapticEffectType(SDL_HapticEffect *effect) { switch (effect->type) { case SDL_HAPTIC_CONSTANT: @@ -922,9 +903,9 @@ SDL_SYS_HapticEffectType(SDL_HapticEffect * effect) case SDL_HAPTIC_RAMP: return &GUID_RampForce; - /* !!! FIXME: put this back when we have more bits in 2.1 */ - /* case SDL_HAPTIC_SQUARE: - return &GUID_Square; */ + /* !!! FIXME: put this back when we have more bits in 2.1 */ + /* case SDL_HAPTIC_SQUARE: + return &GUID_Square; */ case SDL_HAPTIC_SINE: return &GUID_Sine; @@ -957,13 +938,12 @@ SDL_SYS_HapticEffectType(SDL_HapticEffect * effect) return NULL; } } -int -SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_DINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base) { HRESULT ret; REFGUID type = SDL_SYS_HapticEffectType(base); - if (type == NULL) { + if (!type) { return SDL_SetError("Haptic: Unknown effect type."); } @@ -974,8 +954,8 @@ SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SD /* Create the actual effect. */ ret = IDirectInputDevice8_CreateEffect(haptic->hwdata->device, type, - &effect->hweffect->effect, - &effect->hweffect->ref, NULL); + &effect->hweffect->effect, + &effect->hweffect->ref, NULL); if (FAILED(ret)) { DI_SetError("Unable to create effect", ret); goto err_effectdone; @@ -988,8 +968,7 @@ SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SD return -1; } -int -SDL_DINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data) +int SDL_DINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data) { HRESULT ret; DWORD flags; @@ -1002,13 +981,13 @@ SDL_DINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, } /* Set the flags. Might be worthwhile to diff temp with loaded effect and - * only change those parameters. */ + * only change those parameters. */ flags = DIEP_DIRECTION | - DIEP_DURATION | - DIEP_ENVELOPE | - DIEP_STARTDELAY | - DIEP_TRIGGERBUTTON | - DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS; + DIEP_DURATION | + DIEP_ENVELOPE | + DIEP_STARTDELAY | + DIEP_TRIGGERBUTTON | + DIEP_TRIGGERREPEATINTERVAL | DIEP_TYPESPECIFICPARAMS; /* Create the actual effect. */ ret = @@ -1042,8 +1021,7 @@ SDL_DINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, return -1; } -int -SDL_DINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations) +int SDL_DINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations) { HRESULT ret; DWORD iter; @@ -1063,8 +1041,7 @@ SDL_DINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Ui return 0; } -int -SDL_DINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_DINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { HRESULT ret; @@ -1075,8 +1052,7 @@ SDL_DINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) return 0; } -void -SDL_DINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_DINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { HRESULT ret; @@ -1087,8 +1063,7 @@ SDL_DINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, effect->effect.type); } -int -SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect) { HRESULT ret; DWORD status; @@ -1098,13 +1073,13 @@ SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effe return DI_SetError("Getting effect status", ret); } - if (status == 0) + if (status == 0) { return SDL_FALSE; + } return SDL_TRUE; } -int -SDL_DINPUT_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_DINPUT_HapticSetGain(SDL_Haptic *haptic, int gain) { HRESULT ret; DIPROPDWORD dipdw; @@ -1114,19 +1089,18 @@ SDL_DINPUT_HapticSetGain(SDL_Haptic * haptic, int gain) dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); dipdw.diph.dwObj = 0; dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = gain * 100; /* 0 to 10,000 */ + dipdw.dwData = (DWORD)gain * 100; /* 0 to 10,000 */ /* Try to set the autocenter. */ ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, - DIPROP_FFGAIN, &dipdw.diph); + DIPROP_FFGAIN, &dipdw.diph); if (FAILED(ret)) { return DI_SetError("Setting gain", ret); } return 0; } -int -SDL_DINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_DINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { HRESULT ret; DIPROPDWORD dipdw; @@ -1136,54 +1110,50 @@ SDL_DINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); dipdw.diph.dwObj = 0; dipdw.diph.dwHow = DIPH_DEVICE; - dipdw.dwData = (autocenter == 0) ? DIPROPAUTOCENTER_OFF : - DIPROPAUTOCENTER_ON; + dipdw.dwData = (autocenter == 0) ? DIPROPAUTOCENTER_OFF : DIPROPAUTOCENTER_ON; /* Try to set the autocenter. */ ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device, - DIPROP_AUTOCENTER, &dipdw.diph); + DIPROP_AUTOCENTER, &dipdw.diph); if (FAILED(ret)) { return DI_SetError("Setting autocenter", ret); } return 0; } -int -SDL_DINPUT_HapticPause(SDL_Haptic * haptic) +int SDL_DINPUT_HapticPause(SDL_Haptic *haptic) { HRESULT ret; /* Pause the device. */ ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, - DISFFC_PAUSE); + DISFFC_PAUSE); if (FAILED(ret)) { return DI_SetError("Pausing the device", ret); } return 0; } -int -SDL_DINPUT_HapticUnpause(SDL_Haptic * haptic) +int SDL_DINPUT_HapticUnpause(SDL_Haptic *haptic) { HRESULT ret; /* Unpause the device. */ ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, - DISFFC_CONTINUE); + DISFFC_CONTINUE); if (FAILED(ret)) { return DI_SetError("Pausing the device", ret); } return 0; } -int -SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic) +int SDL_DINPUT_HapticStopAll(SDL_Haptic *haptic) { HRESULT ret; /* Try to stop the effects. */ ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device, - DISFFC_STOPALL); + DISFFC_STOPALL); if (FAILED(ret)) { return DI_SetError("Stopping the device", ret); } @@ -1195,113 +1165,94 @@ SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic) typedef struct DIDEVICEINSTANCE DIDEVICEINSTANCE; typedef struct SDL_hapticlist_item SDL_hapticlist_item; -int -SDL_DINPUT_HapticInit(void) +int SDL_DINPUT_HapticInit(void) { return 0; } -int -SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) +int SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE *pdidInstance) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) +int SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE *pdidInstance) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item) +int SDL_DINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item) { return SDL_Unsupported(); } -int -SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { return SDL_Unsupported(); } -void -SDL_DINPUT_HapticClose(SDL_Haptic * haptic) +void SDL_DINPUT_HapticClose(SDL_Haptic *haptic) { } -void -SDL_DINPUT_HapticQuit(void) +void SDL_DINPUT_HapticQuit(void) { } -int -SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_DINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data) +int SDL_DINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations) +int SDL_DINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_DINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_Unsupported(); } -void -SDL_DINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_DINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { } -int -SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_DINPUT_HapticSetGain(SDL_Haptic *haptic, int gain) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_DINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticPause(SDL_Haptic * haptic) +int SDL_DINPUT_HapticPause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticUnpause(SDL_Haptic * haptic) +int SDL_DINPUT_HapticUnpause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic) +int SDL_DINPUT_HapticStopAll(SDL_Haptic *haptic) { return SDL_Unsupported(); } diff --git a/src/haptic/windows/SDL_dinputhaptic_c.h b/src/haptic/windows/SDL_dinputhaptic_c.h index 60fa414cd7f90..bdf64f982a45f 100644 --- a/src/haptic/windows/SDL_dinputhaptic_c.h +++ b/src/haptic/windows/SDL_dinputhaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,22 +31,22 @@ extern "C" { extern int SDL_DINPUT_HapticInit(void); extern int SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE *pdidInstance); extern int SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE *pdidInstance); -extern int SDL_DINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item); -extern int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick); -extern int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick); -extern void SDL_DINPUT_HapticClose(SDL_Haptic * haptic); +extern int SDL_DINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item); +extern int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick); +extern int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick); +extern void SDL_DINPUT_HapticClose(SDL_Haptic *haptic); extern void SDL_DINPUT_HapticQuit(void); -extern int SDL_DINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base); -extern int SDL_DINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data); -extern int SDL_DINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations); -extern int SDL_DINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect); -extern void SDL_DINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect); -extern int SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect); -extern int SDL_DINPUT_HapticSetGain(SDL_Haptic * haptic, int gain); -extern int SDL_DINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); -extern int SDL_DINPUT_HapticPause(SDL_Haptic * haptic); -extern int SDL_DINPUT_HapticUnpause(SDL_Haptic * haptic); -extern int SDL_DINPUT_HapticStopAll(SDL_Haptic * haptic); +extern int SDL_DINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base); +extern int SDL_DINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data); +extern int SDL_DINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations); +extern int SDL_DINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect); +extern void SDL_DINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect); +extern int SDL_DINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect); +extern int SDL_DINPUT_HapticSetGain(SDL_Haptic *haptic, int gain); +extern int SDL_DINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter); +extern int SDL_DINPUT_HapticPause(SDL_Haptic *haptic); +extern int SDL_DINPUT_HapticUnpause(SDL_Haptic *haptic); +extern int SDL_DINPUT_HapticStopAll(SDL_Haptic *haptic); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/haptic/windows/SDL_windowshaptic.c b/src/haptic/windows/SDL_windowshaptic.c index 475ae49c6c259..4d7e662cde187 100644 --- a/src/haptic/windows/SDL_windowshaptic.c +++ b/src/haptic/windows/SDL_windowshaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT +#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT) #include "SDL_thread.h" #include "SDL_mutex.h" @@ -49,14 +49,12 @@ SDL_hapticlist_item *SDL_hapticlist = NULL; static SDL_hapticlist_item *SDL_hapticlist_tail = NULL; static int numhaptics = 0; - /* * Initializes the haptic subsystem. */ -int -SDL_SYS_HapticInit(void) +int SDL_SYS_HapticInit(void) { - JoyStick_DeviceData* device; + JoyStick_DeviceData *device; if (SDL_DINPUT_HapticInit() < 0) { return -1; @@ -81,10 +79,9 @@ SDL_SYS_HapticInit(void) return numhaptics; } -int -SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item) +int SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item) { - if (SDL_hapticlist_tail == NULL) { + if (!SDL_hapticlist_tail) { SDL_hapticlist = SDL_hapticlist_tail = item; } else { SDL_hapticlist_tail->next = item; @@ -97,11 +94,10 @@ SDL_SYS_AddHapticDevice(SDL_hapticlist_item *item) return numhaptics; } -int -SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item) +int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item) { const int retval = item->haptic ? item->haptic->index : -1; - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_hapticlist == item); @@ -116,14 +112,12 @@ SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_item *item) return retval; } -int -SDL_SYS_NumHaptics(void) +int SDL_SYS_NumHaptics(void) { return numhaptics; } -static SDL_hapticlist_item * -HapticByDevIndex(int device_index) +static SDL_hapticlist_item *HapticByDevIndex(int device_index) { SDL_hapticlist_item *item = SDL_hapticlist; @@ -142,8 +136,7 @@ HapticByDevIndex(int device_index) /* * Return the name of a haptic device, does not need to be opened. */ -const char * -SDL_SYS_HapticName(int index) +const char *SDL_SYS_HapticName(int index) { SDL_hapticlist_item *item = HapticByDevIndex(index); return item->name; @@ -152,8 +145,7 @@ SDL_SYS_HapticName(int index) /* * Opens a haptic device for usage. */ -int -SDL_SYS_HapticOpen(SDL_Haptic * haptic) +int SDL_SYS_HapticOpen(SDL_Haptic *haptic) { SDL_hapticlist_item *item = HapticByDevIndex(haptic->index); if (item->bXInputHaptic) { @@ -163,19 +155,17 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic) } } - /* * Opens a haptic device from first mouse it finds for usage. */ -int -SDL_SYS_HapticMouse(void) +int SDL_SYS_HapticMouse(void) { -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT SDL_hapticlist_item *item; int index = 0; /* Grab the first mouse haptic device we find. */ - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (item->capabilities.dwDevType == DI8DEVCLASS_POINTER) { return index; } @@ -185,22 +175,20 @@ SDL_SYS_HapticMouse(void) return -1; } - /* * Checks to see if a joystick has haptic features. */ -int -SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) +int SDL_SYS_JoystickIsHaptic(SDL_Joystick *joystick) { if (joystick->driver != &SDL_WINDOWS_JoystickDriver) { return 0; } -#if SDL_HAPTIC_XINPUT +#ifdef SDL_HAPTIC_XINPUT if (joystick->hwdata->bXInputHaptic) { return 1; } #endif -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT if (joystick->hwdata->Capabilities.dwFlags & DIDC_FORCEFEEDBACK) { return 1; } @@ -211,14 +199,13 @@ SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) /* * Checks to see if the haptic device and joystick are in reality the same. */ -int -SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { if (joystick->driver != &SDL_WINDOWS_JoystickDriver) { return 0; } if (joystick->hwdata->bXInputHaptic != haptic->hwdata->bXInputHaptic) { - return 0; /* one is XInput, one is not; not the same device. */ + return 0; /* one is XInput, one is not; not the same device. */ } else if (joystick->hwdata->bXInputHaptic) { return SDL_XINPUT_JoystickSameHaptic(haptic, joystick); } else { @@ -229,8 +216,7 @@ SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) /* * Opens a SDL_Haptic from a SDL_Joystick. */ -int -SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { SDL_assert(joystick->driver == &SDL_WINDOWS_JoystickDriver); @@ -244,8 +230,7 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) /* * Closes the haptic device. */ -void -SDL_SYS_HapticClose(SDL_Haptic * haptic) +void SDL_SYS_HapticClose(SDL_Haptic *haptic) { if (haptic->hwdata) { @@ -270,8 +255,7 @@ SDL_SYS_HapticClose(SDL_Haptic * haptic) /* * Clean up after system specific haptic stuff */ -void -SDL_SYS_HapticQuit(void) +void SDL_SYS_HapticQuit(void) { SDL_hapticlist_item *item; SDL_hapticlist_item *next = NULL; @@ -307,16 +291,15 @@ SDL_SYS_HapticQuit(void) /* * Creates a new haptic effect. */ -int -SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - SDL_HapticEffect * base) +int SDL_SYS_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + SDL_HapticEffect *base) { int result; /* Alloc the effect. */ effect->hweffect = (struct haptic_hweffect *) SDL_malloc(sizeof(struct haptic_hweffect)); - if (effect->hweffect == NULL) { + if (!effect->hweffect) { SDL_OutOfMemory(); return -1; } @@ -337,10 +320,9 @@ SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, /* * Updates an effect. */ -int -SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, - struct haptic_effect *effect, - SDL_HapticEffect * data) +int SDL_SYS_HapticUpdateEffect(SDL_Haptic *haptic, + struct haptic_effect *effect, + SDL_HapticEffect *data) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticUpdateEffect(haptic, effect, data); @@ -352,9 +334,8 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, /* * Runs an effect. */ -int -SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, - Uint32 iterations) +int SDL_SYS_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, + Uint32 iterations) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticRunEffect(haptic, effect, iterations); @@ -366,8 +347,7 @@ SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, /* * Stops an effect. */ -int -SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_SYS_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticStopEffect(haptic, effect); @@ -379,8 +359,7 @@ SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) /* * Frees the effect. */ -void -SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_SYS_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { if (haptic->hwdata->bXInputHaptic) { SDL_XINPUT_HapticDestroyEffect(haptic, effect); @@ -394,9 +373,8 @@ SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) /* * Gets the status of a haptic effect. */ -int -SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, - struct haptic_effect *effect) +int SDL_SYS_HapticGetEffectStatus(SDL_Haptic *haptic, + struct haptic_effect *effect) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticGetEffectStatus(haptic, effect); @@ -408,8 +386,7 @@ SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, /* * Sets the gain. */ -int -SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_SYS_HapticSetGain(SDL_Haptic *haptic, int gain) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticSetGain(haptic, gain); @@ -421,8 +398,7 @@ SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) /* * Sets the autocentering. */ -int -SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_SYS_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticSetAutocenter(haptic, autocenter); @@ -434,8 +410,7 @@ SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) /* * Pauses the device. */ -int -SDL_SYS_HapticPause(SDL_Haptic * haptic) +int SDL_SYS_HapticPause(SDL_Haptic *haptic) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticPause(haptic); @@ -447,8 +422,7 @@ SDL_SYS_HapticPause(SDL_Haptic * haptic) /* * Pauses the device. */ -int -SDL_SYS_HapticUnpause(SDL_Haptic * haptic) +int SDL_SYS_HapticUnpause(SDL_Haptic *haptic) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticUnpause(haptic); @@ -460,8 +434,7 @@ SDL_SYS_HapticUnpause(SDL_Haptic * haptic) /* * Stops all the playing effects on the device. */ -int -SDL_SYS_HapticStopAll(SDL_Haptic * haptic) +int SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { if (haptic->hwdata->bXInputHaptic) { return SDL_XINPUT_HapticStopAll(haptic); diff --git a/src/haptic/windows/SDL_windowshaptic_c.h b/src/haptic/windows/SDL_windowshaptic_c.h index dcfb7022ea592..5217c28240fb5 100644 --- a/src/haptic/windows/SDL_windowshaptic_c.h +++ b/src/haptic/windows/SDL_windowshaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,49 +38,48 @@ extern "C" { */ struct haptic_hwdata { -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT LPDIRECTINPUTDEVICE8 device; #endif - DWORD axes[3]; /* Axes to use. */ - SDL_bool is_joystick; /* Device is loaded as joystick. */ - Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ - Uint8 userid; /* XInput userid index for this joystick */ + DWORD axes[3]; /* Axes to use. */ + SDL_bool is_joystick; /* Device is loaded as joystick. */ + Uint8 bXInputHaptic; /* Supports force feedback via XInput. */ + Uint8 userid; /* XInput userid index for this joystick */ SDL_Thread *thread; SDL_mutex *mutex; Uint32 stopTicks; SDL_atomic_t stopThread; }; - /* * Haptic system effect data. */ -#if SDL_HAPTIC_DINPUT || SDL_HAPTIC_XINPUT +#if defined(SDL_HAPTIC_DINPUT) || defined(SDL_HAPTIC_XINPUT) struct haptic_hweffect { -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT DIEFFECT effect; LPDIRECTINPUTEFFECT ref; #endif -#if SDL_HAPTIC_XINPUT +#ifdef SDL_HAPTIC_XINPUT XINPUT_VIBRATION vibration; #endif }; #endif /* -* List of available haptic devices. -*/ + * List of available haptic devices. + */ typedef struct SDL_hapticlist_item { char *name; SDL_Haptic *haptic; -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT DIDEVICEINSTANCE instance; DIDEVCAPS capabilities; #endif SDL_bool bXInputHaptic; /* Supports force feedback via XInput. */ - Uint8 userid; /* XInput userid index for this joystick */ + Uint8 userid; /* XInput userid index for this joystick */ struct SDL_hapticlist_item *next; } SDL_hapticlist_item; @@ -97,4 +96,3 @@ extern int SDL_SYS_RemoveHapticDevice(SDL_hapticlist_item *prev, SDL_hapticlist_ #endif /* SDL_windowshaptic_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/haptic/windows/SDL_xinputhaptic.c b/src/haptic/windows/SDL_xinputhaptic.c index 2622fb7a712af..0704a088deea1 100644 --- a/src/haptic/windows/SDL_xinputhaptic.c +++ b/src/haptic/windows/SDL_xinputhaptic.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "SDL_haptic.h" #include "../SDL_syshaptic.h" -#if SDL_HAPTIC_XINPUT +#ifdef SDL_HAPTIC_XINPUT #include "SDL_hints.h" #include "SDL_timer.h" @@ -45,9 +45,7 @@ extern "C" { */ static SDL_bool loaded_xinput = SDL_FALSE; - -int -SDL_XINPUT_HapticInit(void) +int SDL_XINPUT_HapticInit(void) { if (SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE)) { loaded_xinput = (WIN_LoadXInputDLL() == 0) ? SDL_TRUE : SDL_FALSE; @@ -63,8 +61,7 @@ SDL_XINPUT_HapticInit(void) return 0; } -int -SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) +int SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) { const Uint8 userid = (Uint8)dwUserid; SDL_hapticlist_item *item; @@ -77,17 +74,17 @@ SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) /* Make sure we don't already have it */ for (item = SDL_hapticlist; item; item = item->next) { if (item->bXInputHaptic && item->userid == userid) { - return -1; /* Already added */ + return -1; /* Already added */ } } SDL_zero(state); if (XINPUTSETSTATE(dwUserid, &state) != ERROR_SUCCESS) { - return -1; /* no force feedback on this device. */ + return -1; /* no force feedback on this device. */ } item = (SDL_hapticlist_item *)SDL_malloc(sizeof(SDL_hapticlist_item)); - if (item == NULL) { + if (!item) { return SDL_OutOfMemory(); } @@ -96,7 +93,7 @@ SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) /* !!! FIXME: I'm not bothering to query for a real name right now (can we even?) */ { char buf[64]; - SDL_snprintf(buf, sizeof(buf), "XInput Controller #%u", (unsigned int)(userid + 1)); + (void)SDL_snprintf(buf, sizeof(buf), "XInput Controller #%u", userid + 1); item->name = SDL_strdup(buf); } @@ -112,8 +109,7 @@ SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) return SDL_SYS_AddHapticDevice(item); } -int -SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) +int SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) { const Uint8 userid = (Uint8)dwUserid; SDL_hapticlist_item *item; @@ -123,7 +119,7 @@ SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) return -1; } - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (item->bXInputHaptic && item->userid == userid) { /* found it, remove it. */ return SDL_SYS_RemoveHapticDevice(prev, item); @@ -147,10 +143,9 @@ SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) * Mostly, this is here to get rumbling to work, and all the other features * are absent in the XInput path for now. :( */ -static int SDLCALL -SDL_RunXInputHaptic(void *arg) +static int SDLCALL SDL_RunXInputHaptic(void *arg) { - struct haptic_hwdata *hwdata = (struct haptic_hwdata *) arg; + struct haptic_hwdata *hwdata = (struct haptic_hwdata *)arg; while (!SDL_AtomicGet(&hwdata->stopThread)) { SDL_Delay(50); @@ -169,11 +164,10 @@ SDL_RunXInputHaptic(void *arg) return 0; } -static int -SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid) +static int SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid) { char threadName[32]; - XINPUT_VIBRATION vibration = { 0, 0 }; /* stop any current vibration */ + XINPUT_VIBRATION vibration = { 0, 0 }; /* stop any current vibration */ XINPUTSETSTATE(userid, &vibration); haptic->supported = SDL_HAPTIC_LEFTRIGHT; @@ -184,15 +178,15 @@ SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid) /* Prepare effects memory. */ haptic->effects = (struct haptic_effect *) SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects); - if (haptic->effects == NULL) { + if (!haptic->effects) { return SDL_OutOfMemory(); } /* Clear the memory */ SDL_memset(haptic->effects, 0, - sizeof(struct haptic_effect) * haptic->neffects); + sizeof(struct haptic_effect) * haptic->neffects); - haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata)); - if (haptic->hwdata == NULL) { + haptic->hwdata = (struct haptic_hwdata *)SDL_malloc(sizeof(*haptic->hwdata)); + if (!haptic->hwdata) { SDL_free(haptic->effects); haptic->effects = NULL; return SDL_OutOfMemory(); @@ -203,17 +197,17 @@ SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid) haptic->hwdata->userid = userid; haptic->hwdata->mutex = SDL_CreateMutex(); - if (haptic->hwdata->mutex == NULL) { + if (!haptic->hwdata->mutex) { SDL_free(haptic->effects); SDL_free(haptic->hwdata); haptic->effects = NULL; return SDL_SetError("Couldn't create XInput haptic mutex"); } - SDL_snprintf(threadName, sizeof(threadName), "SDLXInputDev%d", (int)userid); + (void)SDL_snprintf(threadName, sizeof(threadName), "SDLXInputDev%d", userid); haptic->hwdata->thread = SDL_CreateThreadInternal(SDL_RunXInputHaptic, threadName, 64 * 1024, haptic->hwdata); - if (haptic->hwdata->thread == NULL) { + if (!haptic->hwdata->thread) { SDL_DestroyMutex(haptic->hwdata->mutex); SDL_free(haptic->effects); SDL_free(haptic->hwdata); @@ -224,26 +218,23 @@ SDL_XINPUT_HapticOpenFromUserIndex(SDL_Haptic *haptic, const Uint8 userid) return 0; } -int -SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item) +int SDL_XINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item) { return SDL_XINPUT_HapticOpenFromUserIndex(haptic, item->userid); } -int -SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { - return (haptic->hwdata->userid == joystick->hwdata->userid); + return haptic->hwdata->userid == joystick->hwdata->userid; } -int -SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { SDL_hapticlist_item *item; int index = 0; /* Since it comes from a joystick we have to try to match it with a haptic device on our haptic list. */ - for (item = SDL_hapticlist; item != NULL; item = item->next) { + for (item = SDL_hapticlist; item; item = item->next) { if (item->bXInputHaptic && item->userid == joystick->hwdata->userid) { haptic->index = index; return SDL_XINPUT_HapticOpenFromUserIndex(haptic, joystick->hwdata->userid); @@ -254,16 +245,14 @@ SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) return SDL_SetError("Couldn't find joystick in haptic device list"); } -void -SDL_XINPUT_HapticClose(SDL_Haptic * haptic) +void SDL_XINPUT_HapticClose(SDL_Haptic *haptic) { SDL_AtomicSet(&haptic->hwdata->stopThread, 1); SDL_WaitThread(haptic->hwdata->thread, NULL); SDL_DestroyMutex(haptic->hwdata->mutex); } -void -SDL_XINPUT_HapticQuit(void) +void SDL_XINPUT_HapticQuit(void) { if (loaded_xinput) { WIN_UnloadXInputDLL(); @@ -271,15 +260,13 @@ SDL_XINPUT_HapticQuit(void) } } -int -SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_XINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base) { - SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ + SDL_assert(base->type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ return SDL_XINPUT_HapticUpdateEffect(haptic, effect, base); } -int -SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data) +int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data) { XINPUT_VIBRATION *vib = &effect->hweffect->vibration; SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT); @@ -287,18 +274,17 @@ SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, vib->wLeftMotorSpeed = data->leftright.large_magnitude * 2; vib->wRightMotorSpeed = data->leftright.small_magnitude * 2; SDL_LockMutex(haptic->hwdata->mutex); - if (haptic->hwdata->stopTicks) { /* running right now? Update it. */ + if (haptic->hwdata->stopTicks) { /* running right now? Update it. */ XINPUTSETSTATE(haptic->hwdata->userid, vib); } SDL_UnlockMutex(haptic->hwdata->mutex); return 0; } -int -SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations) +int SDL_XINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations) { XINPUT_VIBRATION *vib = &effect->hweffect->vibration; - SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ + SDL_assert(effect->effect.type == SDL_HAPTIC_LEFTRIGHT); /* should catch this at higher level */ SDL_LockMutex(haptic->hwdata->mutex); if (effect->effect.leftright.length == SDL_HAPTIC_INFINITY || iterations == SDL_HAPTIC_INFINITY) { haptic->hwdata->stopTicks = SDL_HAPTIC_INFINITY; @@ -307,15 +293,14 @@ SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Ui } else { haptic->hwdata->stopTicks = SDL_GetTicks() + (effect->effect.leftright.length * iterations); if ((haptic->hwdata->stopTicks == SDL_HAPTIC_INFINITY) || (haptic->hwdata->stopTicks == 0)) { - haptic->hwdata->stopTicks = 1; /* fix edge cases. */ + haptic->hwdata->stopTicks = 1; /* fix edge cases. */ } } SDL_UnlockMutex(haptic->hwdata->mutex); return (XINPUTSETSTATE(haptic->hwdata->userid, vib) == ERROR_SUCCESS) ? 0 : -1; } -int -SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_XINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { XINPUT_VIBRATION vibration = { 0, 0 }; SDL_LockMutex(haptic->hwdata->mutex); @@ -324,44 +309,37 @@ SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) return (XINPUTSETSTATE(haptic->hwdata->userid, &vibration) == ERROR_SUCCESS) ? 0 : -1; } -void -SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { SDL_XINPUT_HapticStopEffect(haptic, effect); } -int -SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_XINPUT_HapticSetGain(SDL_Haptic *haptic, int gain) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticPause(SDL_Haptic * haptic) +int SDL_XINPUT_HapticPause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic) +int SDL_XINPUT_HapticUnpause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic) +int SDL_XINPUT_HapticStopAll(SDL_Haptic *haptic) { XINPUT_VIBRATION vibration = { 0, 0 }; SDL_LockMutex(haptic->hwdata->mutex); @@ -381,113 +359,94 @@ SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic) typedef struct SDL_hapticlist_item SDL_hapticlist_item; -int -SDL_XINPUT_HapticInit(void) +int SDL_XINPUT_HapticInit(void) { return 0; } -int -SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) +int SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) +int SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item) +int SDL_XINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item) { return SDL_Unsupported(); } -int -SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) +int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick) { return SDL_Unsupported(); } -void -SDL_XINPUT_HapticClose(SDL_Haptic * haptic) +void SDL_XINPUT_HapticClose(SDL_Haptic *haptic) { } -void -SDL_XINPUT_HapticQuit(void) +void SDL_XINPUT_HapticQuit(void) { } -int -SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base) +int SDL_XINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data) +int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations) +int SDL_XINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_XINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_Unsupported(); } -void -SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect) +void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect) { } -int -SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect) +int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain) +int SDL_XINPUT_HapticSetGain(SDL_Haptic *haptic, int gain) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) +int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticPause(SDL_Haptic * haptic) +int SDL_XINPUT_HapticPause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic) +int SDL_XINPUT_HapticUnpause(SDL_Haptic *haptic) { return SDL_Unsupported(); } -int -SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic) +int SDL_XINPUT_HapticStopAll(SDL_Haptic *haptic) { return SDL_Unsupported(); } diff --git a/src/haptic/windows/SDL_xinputhaptic_c.h b/src/haptic/windows/SDL_xinputhaptic_c.h index 2fb5dd86172ab..a011b353a778f 100644 --- a/src/haptic/windows/SDL_xinputhaptic_c.h +++ b/src/haptic/windows/SDL_xinputhaptic_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,22 +31,22 @@ extern "C" { extern int SDL_XINPUT_HapticInit(void); extern int SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid); extern int SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid); -extern int SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item); -extern int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick); -extern int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick); -extern void SDL_XINPUT_HapticClose(SDL_Haptic * haptic); +extern int SDL_XINPUT_HapticOpen(SDL_Haptic *haptic, SDL_hapticlist_item *item); +extern int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic *haptic, SDL_Joystick *joystick); +extern int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic *haptic, SDL_Joystick *joystick); +extern void SDL_XINPUT_HapticClose(SDL_Haptic *haptic); extern void SDL_XINPUT_HapticQuit(void); -extern int SDL_XINPUT_HapticNewEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * base); -extern int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic * haptic, struct haptic_effect *effect, SDL_HapticEffect * data); -extern int SDL_XINPUT_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect *effect, Uint32 iterations); -extern int SDL_XINPUT_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect *effect); -extern void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect *effect); -extern int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect *effect); -extern int SDL_XINPUT_HapticSetGain(SDL_Haptic * haptic, int gain); -extern int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); -extern int SDL_XINPUT_HapticPause(SDL_Haptic * haptic); -extern int SDL_XINPUT_HapticUnpause(SDL_Haptic * haptic); -extern int SDL_XINPUT_HapticStopAll(SDL_Haptic * haptic); +extern int SDL_XINPUT_HapticNewEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *base); +extern int SDL_XINPUT_HapticUpdateEffect(SDL_Haptic *haptic, struct haptic_effect *effect, SDL_HapticEffect *data); +extern int SDL_XINPUT_HapticRunEffect(SDL_Haptic *haptic, struct haptic_effect *effect, Uint32 iterations); +extern int SDL_XINPUT_HapticStopEffect(SDL_Haptic *haptic, struct haptic_effect *effect); +extern void SDL_XINPUT_HapticDestroyEffect(SDL_Haptic *haptic, struct haptic_effect *effect); +extern int SDL_XINPUT_HapticGetEffectStatus(SDL_Haptic *haptic, struct haptic_effect *effect); +extern int SDL_XINPUT_HapticSetGain(SDL_Haptic *haptic, int gain); +extern int SDL_XINPUT_HapticSetAutocenter(SDL_Haptic *haptic, int autocenter); +extern int SDL_XINPUT_HapticPause(SDL_Haptic *haptic); +extern int SDL_XINPUT_HapticUnpause(SDL_Haptic *haptic); +extern int SDL_XINPUT_HapticStopAll(SDL_Haptic *haptic); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c index 47818d4dcbf37..c3b37e526961b 100644 --- a/src/hidapi/SDL_hidapi.c +++ b/src/hidapi/SDL_hidapi.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,25 +29,25 @@ */ #include "../SDL_internal.h" -#include "SDL_loadso.h" #include "SDL_hidapi.h" +#include "SDL_hidapi_c.h" +#include "SDL_loadso.h" #include "SDL_thread.h" #include "SDL_timer.h" -#include "SDL_hidapi_c.h" -#if !SDL_HIDAPI_DISABLED +#ifndef SDL_HIDAPI_DISABLED #if defined(__WIN32__) || defined(__WINGDK__) #include "../core/windows/SDL_windows.h" #endif #if defined(__MACOSX__) +#include #include -#include #include #include #include -#include +#include /* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ #if MAC_OS_X_VERSION_MIN_REQUIRED < 120000 #define kIOMainPortDefault kIOMasterPortDefault @@ -56,17 +56,20 @@ #include "../core/linux/SDL_udev.h" #ifdef SDL_USE_LIBUDEV -#include -#include #include "../core/linux/SDL_sandbox.h" +#include #endif #ifdef HAVE_INOTIFY -#include /* just in case we didn't use that SDL_USE_LIBUDEV block... */ -#include /* errno, strerror */ +#include /* errno, strerror */ #include -#include /* For the definition of NAME_MAX */ +#include /* For the definition of NAME_MAX */ #include +#include /* just in case we didn't use that SDL_USE_LIBUDEV block... */ +#endif + +#if defined(SDL_USE_LIBUDEV) || defined(HAVE_INOTIFY) +#include #endif #if defined(SDL_USE_LIBUDEV) @@ -85,7 +88,7 @@ static int inotify_fd = -1; #endif #if defined(SDL_USE_LIBUDEV) -static const SDL_UDEV_Symbols * usyms = NULL; +static const SDL_UDEV_Symbols *usyms = NULL; #endif static struct @@ -115,32 +118,31 @@ static struct #endif } SDL_HIDAPI_discovery; - #if defined(__WIN32__) || defined(__WINGDK__) struct _DEV_BROADCAST_HDR { - DWORD dbch_size; - DWORD dbch_devicetype; - DWORD dbch_reserved; + DWORD dbch_size; + DWORD dbch_devicetype; + DWORD dbch_reserved; }; typedef struct _DEV_BROADCAST_DEVICEINTERFACE_A { - DWORD dbcc_size; - DWORD dbcc_devicetype; - DWORD dbcc_reserved; - GUID dbcc_classguid; - char dbcc_name[ 1 ]; + DWORD dbcc_size; + DWORD dbcc_devicetype; + DWORD dbcc_reserved; + GUID dbcc_classguid; + char dbcc_name[1]; } DEV_BROADCAST_DEVICEINTERFACE_A, *PDEV_BROADCAST_DEVICEINTERFACE_A; -typedef struct _DEV_BROADCAST_HDR DEV_BROADCAST_HDR; -#define DBT_DEVICEARRIVAL 0x8000 /* system detected a new device */ -#define DBT_DEVICEREMOVECOMPLETE 0x8004 /* device was removed from the system */ -#define DBT_DEVTYP_DEVICEINTERFACE 0x00000005 /* device interface class */ -#define DBT_DEVNODES_CHANGED 0x0007 -#define DBT_CONFIGCHANGED 0x0018 -#define DBT_DEVICETYPESPECIFIC 0x8005 /* type specific event */ -#define DBT_DEVINSTSTARTED 0x8008 /* device installed and started */ +typedef struct _DEV_BROADCAST_HDR DEV_BROADCAST_HDR; +#define DBT_DEVICEARRIVAL 0x8000 /* system detected a new device */ +#define DBT_DEVICEREMOVECOMPLETE 0x8004 /* device was removed from the system */ +#define DBT_DEVTYP_DEVICEINTERFACE 0x00000005 /* device interface class */ +#define DBT_DEVNODES_CHANGED 0x0007 +#define DBT_CONFIGCHANGED 0x0018 +#define DBT_DEVICETYPESPECIFIC 0x8005 /* type specific event */ +#define DBT_DEVINSTSTARTED 0x8008 /* device installed and started */ #include DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); @@ -152,7 +154,7 @@ static LRESULT CALLBACK ControllerWndProc(HWND hwnd, UINT message, WPARAM wParam switch (wParam) { case DBT_DEVICEARRIVAL: case DBT_DEVICEREMOVECOMPLETE: - if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { + if (((DEV_BROADCAST_HDR *)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter; } break; @@ -164,7 +166,6 @@ static LRESULT CALLBACK ControllerWndProc(HWND hwnd, UINT message, WPARAM wParam } #endif /* defined(__WIN32__) || defined(__WINGDK__) */ - #if defined(__MACOSX__) static void CallbackIOServiceFunc(void *context, io_iterator_t portIterator) { @@ -179,27 +180,29 @@ static void CallbackIOServiceFunc(void *context, io_iterator_t portIterator) #ifdef HAVE_INOTIFY #ifdef HAVE_INOTIFY_INIT1 -static int SDL_inotify_init1(void) { +static int SDL_inotify_init1(void) +{ return inotify_init1(IN_NONBLOCK | IN_CLOEXEC); } #else -static int SDL_inotify_init1(void) { +static int SDL_inotify_init1(void) +{ int fd = inotify_init(); - if (fd < 0) return -1; + if (fd < 0) { + return -1; + } fcntl(fd, F_SETFL, O_NONBLOCK); fcntl(fd, F_SETFD, FD_CLOEXEC); return fd; } #endif -static int -StrHasPrefix(const char *string, const char *prefix) +static int StrHasPrefix(const char *string, const char *prefix) { - return (SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0); + return SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0; } -static int -StrIsInteger(const char *string) +static int StrIsInteger(const char *string) { const char *p; @@ -217,8 +220,7 @@ StrIsInteger(const char *string) } #endif /* HAVE_INOTIFY */ -static void -HIDAPI_InitializeDiscovery() +static void HIDAPI_InitializeDiscovery(void) { SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE; SDL_HIDAPI_discovery.m_unDeviceChangeCounter = 1; @@ -231,7 +233,7 @@ HIDAPI_InitializeDiscovery() SDL_zero(SDL_HIDAPI_discovery.m_wndClass); SDL_HIDAPI_discovery.m_wndClass.hInstance = GetModuleHandle(NULL); SDL_HIDAPI_discovery.m_wndClass.lpszClassName = "SDL_HIDAPI_DEVICE_DETECTION"; - SDL_HIDAPI_discovery.m_wndClass.lpfnWndProc = ControllerWndProc; /* This function is called by windows */ + SDL_HIDAPI_discovery.m_wndClass.lpfnWndProc = ControllerWndProc; /* This function is called by windows */ SDL_HIDAPI_discovery.m_wndClass.cbSize = sizeof(WNDCLASSEX); RegisterClassExA(&SDL_HIDAPI_discovery.m_wndClass); @@ -241,7 +243,7 @@ HIDAPI_InitializeDiscovery() DEV_BROADCAST_DEVICEINTERFACE_A devBroadcast; SDL_zero(devBroadcast); - devBroadcast.dbcc_size = sizeof( devBroadcast ); + devBroadcast.dbcc_size = sizeof(devBroadcast); devBroadcast.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; devBroadcast.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; @@ -249,8 +251,8 @@ HIDAPI_InitializeDiscovery() * but that seems to be necessary to get a notice after each individual usb input device actually * installs, rather than just as the composite device is seen. */ - SDL_HIDAPI_discovery.m_hNotify = RegisterDeviceNotification( SDL_HIDAPI_discovery.m_hwndMsg, &devBroadcast, DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES ); - SDL_HIDAPI_discovery.m_bCanGetNotifications = ( SDL_HIDAPI_discovery.m_hNotify != 0 ); + SDL_HIDAPI_discovery.m_hNotify = RegisterDeviceNotification(SDL_HIDAPI_discovery.m_hwndMsg, &devBroadcast, DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES); + SDL_HIDAPI_discovery.m_bCanGetNotifications = (SDL_HIDAPI_discovery.m_hNotify != 0); } #endif /* defined(__WIN32__) || defined(__WINGDK__) */ @@ -313,19 +315,18 @@ HIDAPI_InitializeDiscovery() SDL_HIDAPI_discovery.m_nUdevFd = -1; usyms = SDL_UDEV_GetUdevSyms(); - if (usyms) { + if (usyms != NULL) { SDL_HIDAPI_discovery.m_pUdev = usyms->udev_new(); - } - if (SDL_HIDAPI_discovery.m_pUdev) { - SDL_HIDAPI_discovery.m_pUdevMonitor = usyms->udev_monitor_new_from_netlink(SDL_HIDAPI_discovery.m_pUdev, "udev"); - if (SDL_HIDAPI_discovery.m_pUdevMonitor) { - usyms->udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor); - SDL_HIDAPI_discovery.m_nUdevFd = usyms->udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor); - SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_TRUE; + if (SDL_HIDAPI_discovery.m_pUdev != NULL) { + SDL_HIDAPI_discovery.m_pUdevMonitor = usyms->udev_monitor_new_from_netlink(SDL_HIDAPI_discovery.m_pUdev, "udev"); + if (SDL_HIDAPI_discovery.m_pUdevMonitor != NULL) { + usyms->udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor); + SDL_HIDAPI_discovery.m_nUdevFd = usyms->udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor); + SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_TRUE; + } } } - } - else + } else #endif /* SDL_USE_LIBUDEV */ { #if defined(HAVE_INOTIFY) @@ -349,7 +350,7 @@ HIDAPI_InitializeDiscovery() inotify_fd = -1; SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Unable to add inotify watch, falling back to polling: %s", - strerror (errno)); + strerror(errno)); return; } @@ -358,15 +359,14 @@ HIDAPI_InitializeDiscovery() } } -static void -HIDAPI_UpdateDiscovery() +static void HIDAPI_UpdateDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { HIDAPI_InitializeDiscovery(); } if (!SDL_HIDAPI_discovery.m_bCanGetNotifications) { - const Uint32 SDL_HIDAPI_DETECT_INTERVAL_MS = 3000; /* Update every 3 seconds */ + const Uint32 SDL_HIDAPI_DETECT_INTERVAL_MS = 3000; /* Update every 3 seconds */ Uint32 now = SDL_GetTicks(); if (!SDL_HIDAPI_discovery.m_unLastDetect || SDL_TICKS_PASSED(now, SDL_HIDAPI_discovery.m_unLastDetect + SDL_HIDAPI_DETECT_INTERVAL_MS)) { ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter; @@ -392,7 +392,11 @@ HIDAPI_UpdateDiscovery() #if defined(__MACOSX__) if (SDL_HIDAPI_discovery.m_notificationPort) { - struct { mach_msg_header_t hdr; char payload[ 4096 ]; } msg; + struct + { + mach_msg_header_t hdr; + char payload[4096]; + } msg; while (mach_msg(&msg.hdr, MACH_RCV_MSG | MACH_RCV_TIMEOUT, 0, sizeof(msg), SDL_HIDAPI_discovery.m_notificationMach, 0, MACH_PORT_NULL) == KERN_SUCCESS) { IODispatchCalloutFromMessage(NULL, &msg.hdr, SDL_HIDAPI_discovery.m_notificationPort); } @@ -421,15 +425,14 @@ HIDAPI_UpdateDiscovery() if (pUdevDevice) { const char *action = NULL; action = usyms->udev_device_get_action(pUdevDevice); - if (!action || SDL_strcmp(action, "add") == 0 || SDL_strcmp(action, "remove") == 0) { + if (action == NULL || SDL_strcmp(action, "add") == 0 || SDL_strcmp(action, "remove") == 0) { ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter; } usyms->udev_device_unref(pUdevDevice); } } } - } - else + } else #endif /* SDL_USE_LIBUDEV */ { #if defined(HAVE_INOTIFY) @@ -438,22 +441,22 @@ HIDAPI_UpdateDiscovery() { struct inotify_event event; char storage[4096]; - char enough_for_inotify[sizeof (struct inotify_event) + NAME_MAX + 1]; + char enough_for_inotify[sizeof(struct inotify_event) + NAME_MAX + 1]; } buf; ssize_t bytes; size_t remain = 0; size_t len; - bytes = read(inotify_fd, &buf, sizeof (buf)); + bytes = read(inotify_fd, &buf, sizeof(buf)); if (bytes > 0) { - remain = (size_t) bytes; + remain = (size_t)bytes; } while (remain > 0) { if (buf.event.len > 0) { if (StrHasPrefix(buf.event.name, "hidraw") && - StrIsInteger(buf.event.name + SDL_strlen ("hidraw"))) { + StrIsInteger(buf.event.name + SDL_strlen("hidraw"))) { ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter; /* We found an hidraw change. We still continue to * drain the inotify fd to avoid leaving old @@ -461,7 +464,7 @@ HIDAPI_UpdateDiscovery() } } - len = sizeof (struct inotify_event) + buf.event.len; + len = sizeof(struct inotify_event) + buf.event.len; remain -= len; if (remain != 0) { @@ -473,16 +476,16 @@ HIDAPI_UpdateDiscovery() } } -static void -HIDAPI_ShutdownDiscovery() +static void HIDAPI_ShutdownDiscovery(void) { if (!SDL_HIDAPI_discovery.m_bInitialized) { return; } #if defined(__WIN32__) || defined(__WINGDK__) - if (SDL_HIDAPI_discovery.m_hNotify) + if (SDL_HIDAPI_discovery.m_hNotify) { UnregisterDeviceNotification(SDL_HIDAPI_discovery.m_hNotify); + } if (SDL_HIDAPI_discovery.m_hwndMsg) { DestroyWindow(SDL_HIDAPI_discovery.m_hwndMsg); @@ -509,8 +512,7 @@ HIDAPI_ShutdownDiscovery() SDL_UDEV_ReleaseUdevSyms(); usyms = NULL; } - } - else + } else #endif /* SDL_USE_LIBUDEV */ { #if defined(HAVE_INOTIFY) @@ -526,77 +528,77 @@ HIDAPI_ShutdownDiscovery() /* Platform HIDAPI Implementation */ -#define hid_device PLATFORM_hid_device -#define hid_device_ PLATFORM_hid_device_ -#define hid_init PLATFORM_hid_init -#define hid_exit PLATFORM_hid_exit -#define hid_enumerate PLATFORM_hid_enumerate -#define hid_free_enumeration PLATFORM_hid_free_enumeration -#define hid_open PLATFORM_hid_open -#define hid_open_path PLATFORM_hid_open_path -#define hid_write PLATFORM_hid_write -#define hid_read_timeout PLATFORM_hid_read_timeout -#define hid_read PLATFORM_hid_read -#define hid_set_nonblocking PLATFORM_hid_set_nonblocking -#define hid_send_feature_report PLATFORM_hid_send_feature_report -#define hid_get_feature_report PLATFORM_hid_get_feature_report -#define hid_close PLATFORM_hid_close -#define hid_get_manufacturer_string PLATFORM_hid_get_manufacturer_string -#define hid_get_product_string PLATFORM_hid_get_product_string -#define hid_get_serial_number_string PLATFORM_hid_get_serial_number_string -#define hid_get_indexed_string PLATFORM_hid_get_indexed_string -#define hid_error PLATFORM_hid_error -#define new_hid_device PLATFORM_new_hid_device -#define free_hid_device PLATFORM_free_hid_device -#define input_report PLATFORM_input_report -#define return_data PLATFORM_return_data -#define make_path PLATFORM_make_path -#define read_thread PLATFORM_read_thread +#define hid_device PLATFORM_hid_device +#define hid_device_ PLATFORM_hid_device_ +#define hid_init PLATFORM_hid_init +#define hid_exit PLATFORM_hid_exit +#define hid_enumerate PLATFORM_hid_enumerate +#define hid_free_enumeration PLATFORM_hid_free_enumeration +#define hid_open PLATFORM_hid_open +#define hid_open_path PLATFORM_hid_open_path +#define hid_write PLATFORM_hid_write +#define hid_read_timeout PLATFORM_hid_read_timeout +#define hid_read PLATFORM_hid_read +#define hid_set_nonblocking PLATFORM_hid_set_nonblocking +#define hid_send_feature_report PLATFORM_hid_send_feature_report +#define hid_get_feature_report PLATFORM_hid_get_feature_report +#define hid_close PLATFORM_hid_close +#define hid_get_manufacturer_string PLATFORM_hid_get_manufacturer_string +#define hid_get_product_string PLATFORM_hid_get_product_string +#define hid_get_serial_number_string PLATFORM_hid_get_serial_number_string +#define hid_get_indexed_string PLATFORM_hid_get_indexed_string +#define hid_error PLATFORM_hid_error +#define new_hid_device PLATFORM_new_hid_device +#define free_hid_device PLATFORM_free_hid_device +#define input_report PLATFORM_input_report +#define return_data PLATFORM_return_data +#define make_path PLATFORM_make_path +#define read_thread PLATFORM_read_thread #undef HIDAPI_H__ -#if __LINUX__ +#ifdef __LINUX__ -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV static const SDL_UDEV_Symbols *udev_ctx = NULL; -#define udev_device_get_sysattr_value udev_ctx->udev_device_get_sysattr_value -#define udev_new udev_ctx->udev_new -#define udev_unref udev_ctx->udev_unref -#define udev_device_new_from_devnum udev_ctx->udev_device_new_from_devnum -#define udev_device_get_parent_with_subsystem_devtype udev_ctx->udev_device_get_parent_with_subsystem_devtype -#define udev_device_unref udev_ctx->udev_device_unref -#define udev_enumerate_new udev_ctx->udev_enumerate_new -#define udev_enumerate_add_match_subsystem udev_ctx->udev_enumerate_add_match_subsystem -#define udev_enumerate_scan_devices udev_ctx->udev_enumerate_scan_devices -#define udev_enumerate_get_list_entry udev_ctx->udev_enumerate_get_list_entry -#define udev_list_entry_get_name udev_ctx->udev_list_entry_get_name -#define udev_device_new_from_syspath udev_ctx->udev_device_new_from_syspath -#define udev_device_get_devnode udev_ctx->udev_device_get_devnode -#define udev_list_entry_get_next udev_ctx->udev_list_entry_get_next -#define udev_enumerate_unref udev_ctx->udev_enumerate_unref +#define udev_device_get_sysattr_value udev_ctx->udev_device_get_sysattr_value +#define udev_new udev_ctx->udev_new +#define udev_unref udev_ctx->udev_unref +#define udev_device_new_from_devnum udev_ctx->udev_device_new_from_devnum +#define udev_device_get_parent_with_subsystem_devtype udev_ctx->udev_device_get_parent_with_subsystem_devtype +#define udev_device_unref udev_ctx->udev_device_unref +#define udev_enumerate_new udev_ctx->udev_enumerate_new +#define udev_enumerate_add_match_subsystem udev_ctx->udev_enumerate_add_match_subsystem +#define udev_enumerate_scan_devices udev_ctx->udev_enumerate_scan_devices +#define udev_enumerate_get_list_entry udev_ctx->udev_enumerate_get_list_entry +#define udev_list_entry_get_name udev_ctx->udev_list_entry_get_name +#define udev_device_new_from_syspath udev_ctx->udev_device_new_from_syspath +#define udev_device_get_devnode udev_ctx->udev_device_get_devnode +#define udev_list_entry_get_next udev_ctx->udev_list_entry_get_next +#define udev_enumerate_unref udev_ctx->udev_enumerate_unref #include "linux/hid.c" -#define HAVE_PLATFORM_BACKEND 1 +#define HAVE_PLATFORM_BACKEND #endif /* SDL_USE_LIBUDEV */ -#elif __MACOSX__ +#elif defined(__MACOSX__) #include "mac/hid.c" -#define HAVE_PLATFORM_BACKEND 1 -#define udev_ctx 1 -#elif __WINDOWS__ || __WINGDK__ +#define HAVE_PLATFORM_BACKEND +#define udev_ctx 1 +#elif defined(__WINDOWS__) || defined(__WINGDK__) #include "windows/hid.c" -#define HAVE_PLATFORM_BACKEND 1 -#define udev_ctx 1 -#elif __ANDROID__ +#define HAVE_PLATFORM_BACKEND +#define udev_ctx 1 +#elif defined(__ANDROID__) /* The implementation for Android is in a separate .cpp file */ #include "hidapi/hidapi.h" #define HAVE_PLATFORM_BACKEND 1 -#define udev_ctx 1 -#elif __IPHONEOS__ || __TVOS__ +#define udev_ctx 1 +#elif defined(__IPHONEOS__) || defined(__TVOS__) /* The implementation for iOS and tvOS is in a separate .m file */ #include "hidapi/hidapi.h" #define HAVE_PLATFORM_BACKEND 1 -#define udev_ctx 1 +#define udev_ctx 1 #endif #undef hid_device @@ -634,26 +636,26 @@ static const SDL_UDEV_Symbols *udev_ctx = NULL; /* DRIVER HIDAPI Implementation */ -#define hid_device DRIVER_hid_device -#define hid_device_ DRIVER_hid_device_ -#define hid_init DRIVER_hid_init -#define hid_exit DRIVER_hid_exit -#define hid_enumerate DRIVER_hid_enumerate -#define hid_free_enumeration DRIVER_hid_free_enumeration -#define hid_open DRIVER_hid_open -#define hid_open_path DRIVER_hid_open_path -#define hid_write DRIVER_hid_write -#define hid_read_timeout DRIVER_hid_read_timeout -#define hid_read DRIVER_hid_read -#define hid_set_nonblocking DRIVER_hid_set_nonblocking -#define hid_send_feature_report DRIVER_hid_send_feature_report -#define hid_get_feature_report DRIVER_hid_get_feature_report -#define hid_close DRIVER_hid_close -#define hid_get_manufacturer_string DRIVER_hid_get_manufacturer_string -#define hid_get_product_string DRIVER_hid_get_product_string -#define hid_get_serial_number_string DRIVER_hid_get_serial_number_string -#define hid_get_indexed_string DRIVER_hid_get_indexed_string -#define hid_error DRIVER_hid_error +#define hid_device DRIVER_hid_device +#define hid_device_ DRIVER_hid_device_ +#define hid_init DRIVER_hid_init +#define hid_exit DRIVER_hid_exit +#define hid_enumerate DRIVER_hid_enumerate +#define hid_free_enumeration DRIVER_hid_free_enumeration +#define hid_open DRIVER_hid_open +#define hid_open_path DRIVER_hid_open_path +#define hid_write DRIVER_hid_write +#define hid_read_timeout DRIVER_hid_read_timeout +#define hid_read DRIVER_hid_read +#define hid_set_nonblocking DRIVER_hid_set_nonblocking +#define hid_send_feature_report DRIVER_hid_send_feature_report +#define hid_get_feature_report DRIVER_hid_get_feature_report +#define hid_close DRIVER_hid_close +#define hid_get_manufacturer_string DRIVER_hid_get_manufacturer_string +#define hid_get_product_string DRIVER_hid_get_product_string +#define hid_get_serial_number_string DRIVER_hid_get_serial_number_string +#define hid_get_indexed_string DRIVER_hid_get_indexed_string +#define hid_error DRIVER_hid_error #ifdef SDL_JOYSTICK_HIDAPI_STEAMXBOX #undef HIDAPI_H__ @@ -685,7 +687,6 @@ static const SDL_UDEV_Symbols *udev_ctx = NULL; #endif /* HAVE_DRIVER_BACKEND */ - #ifdef HAVE_LIBUSB /* libusb HIDAPI Implementation */ @@ -694,8 +695,9 @@ static const SDL_UDEV_Symbols *udev_ctx = NULL; static struct { - void* libhandle; + void *libhandle; + /* *INDENT-OFF* */ /* clang-format off */ int (LIBUSB_CALL *init)(libusb_context **ctx); void (LIBUSB_CALL *exit)(libusb_context *ctx); ssize_t (LIBUSB_CALL *get_device_list)(libusb_context *ctx, libusb_device ***list); @@ -743,79 +745,74 @@ static struct int (LIBUSB_CALL *handle_events)(libusb_context *ctx); int (LIBUSB_CALL *handle_events_completed)(libusb_context *ctx, int *completed); const char * (LIBUSB_CALL *error_name)(int errcode); +/* *INDENT-ON* */ /* clang-format on */ + } libusb_ctx; -#define libusb_init libusb_ctx.init -#define libusb_exit libusb_ctx.exit -#define libusb_get_device_list libusb_ctx.get_device_list -#define libusb_free_device_list libusb_ctx.free_device_list -#define libusb_get_device_descriptor libusb_ctx.get_device_descriptor -#define libusb_get_active_config_descriptor libusb_ctx.get_active_config_descriptor -#define libusb_get_config_descriptor libusb_ctx.get_config_descriptor -#define libusb_free_config_descriptor libusb_ctx.free_config_descriptor -#define libusb_get_bus_number libusb_ctx.get_bus_number -#define libusb_get_device_address libusb_ctx.get_device_address -#define libusb_open libusb_ctx.open -#define libusb_close libusb_ctx.close -#define libusb_claim_interface libusb_ctx.claim_interface -#define libusb_release_interface libusb_ctx.release_interface -#define libusb_kernel_driver_active libusb_ctx.kernel_driver_active -#define libusb_detach_kernel_driver libusb_ctx.detach_kernel_driver -#define libusb_attach_kernel_driver libusb_ctx.attach_kernel_driver -#define libusb_set_interface_alt_setting libusb_ctx.set_interface_alt_setting -#define libusb_alloc_transfer libusb_ctx.alloc_transfer -#define libusb_submit_transfer libusb_ctx.submit_transfer -#define libusb_cancel_transfer libusb_ctx.cancel_transfer -#define libusb_free_transfer libusb_ctx.free_transfer -#define libusb_control_transfer libusb_ctx.control_transfer -#define libusb_interrupt_transfer libusb_ctx.interrupt_transfer -#define libusb_handle_events libusb_ctx.handle_events -#define libusb_handle_events_completed libusb_ctx.handle_events_completed -#define libusb_error_name libusb_ctx.error_name - -#define hid_device LIBUSB_hid_device -#define hid_device_ LIBUSB_hid_device_ -#define hid_init LIBUSB_hid_init -#define hid_exit LIBUSB_hid_exit -#define hid_enumerate LIBUSB_hid_enumerate -#define hid_free_enumeration LIBUSB_hid_free_enumeration -#define hid_open LIBUSB_hid_open -#define hid_open_path LIBUSB_hid_open_path -#define hid_write LIBUSB_hid_write -#define hid_read_timeout LIBUSB_hid_read_timeout -#define hid_read LIBUSB_hid_read -#define hid_set_nonblocking LIBUSB_hid_set_nonblocking -#define hid_send_feature_report LIBUSB_hid_send_feature_report -#define hid_get_feature_report LIBUSB_hid_get_feature_report -#define hid_close LIBUSB_hid_close -#define hid_get_manufacturer_string LIBUSB_hid_get_manufacturer_string -#define hid_get_product_string LIBUSB_hid_get_product_string -#define hid_get_serial_number_string LIBUSB_hid_get_serial_number_string -#define hid_get_indexed_string LIBUSB_hid_get_indexed_string -#define hid_error LIBUSB_hid_error -#define new_hid_device LIBUSB_new_hid_device -#define free_hid_device LIBUSB_free_hid_device -#define input_report LIBUSB_input_report -#define return_data LIBUSB_return_data -#define make_path LIBUSB_make_path -#define read_thread LIBUSB_read_thread +#define libusb_init libusb_ctx.init +#define libusb_exit libusb_ctx.exit +#define libusb_get_device_list libusb_ctx.get_device_list +#define libusb_free_device_list libusb_ctx.free_device_list +#define libusb_get_device_descriptor libusb_ctx.get_device_descriptor +#define libusb_get_active_config_descriptor libusb_ctx.get_active_config_descriptor +#define libusb_get_config_descriptor libusb_ctx.get_config_descriptor +#define libusb_free_config_descriptor libusb_ctx.free_config_descriptor +#define libusb_get_bus_number libusb_ctx.get_bus_number +#define libusb_get_device_address libusb_ctx.get_device_address +#define libusb_open libusb_ctx.open +#define libusb_close libusb_ctx.close +#define libusb_claim_interface libusb_ctx.claim_interface +#define libusb_release_interface libusb_ctx.release_interface +#define libusb_kernel_driver_active libusb_ctx.kernel_driver_active +#define libusb_detach_kernel_driver libusb_ctx.detach_kernel_driver +#define libusb_attach_kernel_driver libusb_ctx.attach_kernel_driver +#define libusb_set_interface_alt_setting libusb_ctx.set_interface_alt_setting +#define libusb_alloc_transfer libusb_ctx.alloc_transfer +#define libusb_submit_transfer libusb_ctx.submit_transfer +#define libusb_cancel_transfer libusb_ctx.cancel_transfer +#define libusb_free_transfer libusb_ctx.free_transfer +#define libusb_control_transfer libusb_ctx.control_transfer +#define libusb_interrupt_transfer libusb_ctx.interrupt_transfer +#define libusb_handle_events libusb_ctx.handle_events +#define libusb_handle_events_completed libusb_ctx.handle_events_completed +#define libusb_error_name libusb_ctx.error_name + +#define hid_device LIBUSB_hid_device +#define hid_device_ LIBUSB_hid_device_ +#define hid_init LIBUSB_hid_init +#define hid_exit LIBUSB_hid_exit +#define hid_enumerate LIBUSB_hid_enumerate +#define hid_free_enumeration LIBUSB_hid_free_enumeration +#define hid_open LIBUSB_hid_open +#define hid_open_path LIBUSB_hid_open_path +#define hid_write LIBUSB_hid_write +#define hid_read_timeout LIBUSB_hid_read_timeout +#define hid_read LIBUSB_hid_read +#define hid_set_nonblocking LIBUSB_hid_set_nonblocking +#define hid_send_feature_report LIBUSB_hid_send_feature_report +#define hid_get_feature_report LIBUSB_hid_get_feature_report +#define hid_close LIBUSB_hid_close +#define hid_get_manufacturer_string LIBUSB_hid_get_manufacturer_string +#define hid_get_product_string LIBUSB_hid_get_product_string +#define hid_get_serial_number_string LIBUSB_hid_get_serial_number_string +#define hid_get_indexed_string LIBUSB_hid_get_indexed_string +#define hid_error LIBUSB_hid_error +#define new_hid_device LIBUSB_new_hid_device +#define free_hid_device LIBUSB_free_hid_device +#define input_report LIBUSB_input_report +#define return_data LIBUSB_return_data +#define make_path LIBUSB_make_path +#define read_thread LIBUSB_read_thread #ifndef __FreeBSD__ /* this is awkwardly inlined, so we need to re-implement it here * so we can override the libusb_control_transfer call */ -static int -SDL_libusb_get_string_descriptor(libusb_device_handle *dev, - uint8_t descriptor_index, uint16_t lang_id, - unsigned char *data, int length) +static int SDL_libusb_get_string_descriptor(libusb_device_handle *dev, + uint8_t descriptor_index, uint16_t lang_id, + unsigned char *data, int length) { - return libusb_control_transfer(dev, - LIBUSB_ENDPOINT_IN | 0x0, /* Endpoint 0 IN */ - LIBUSB_REQUEST_GET_DESCRIPTOR, - (LIBUSB_DT_STRING << 8) | descriptor_index, - lang_id, - data, - (uint16_t) length, - 1000); + return libusb_control_transfer(dev, LIBUSB_ENDPOINT_IN | 0x0, LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | descriptor_index, lang_id, + data, (uint16_t)length, 1000); /* Endpoint 0 IN */ } #define libusb_get_string_descriptor SDL_libusb_get_string_descriptor #endif /* __FreeBSD__ */ @@ -878,75 +875,111 @@ SDL_libusb_get_string_descriptor(libusb_device_handle *dev, #undef make_path #undef read_thread +/* If the platform has any backend other than libusb, try to avoid using + * libusb as the main backend for devices, since it detaches drivers and + * therefore makes devices inaccessible to the rest of the OS. + * + * We do this by whitelisting devices we know to be accessible _exclusively_ + * via libusb; these are typically devices that look like HIDs but have a + * quirk that requires direct access to the hardware. + */ +static const struct { + Uint16 vendor; + Uint16 product; +} SDL_libusb_whitelist[] = { + { 0x057e, 0x0337 } /* Nintendo WUP-028, Wii U/Switch GameCube Adapter */ +}; + +static SDL_bool +IsInWhitelist(Uint16 vendor, Uint16 product) +{ + int i; + for (i = 0; i < SDL_arraysize(SDL_libusb_whitelist); i += 1) { + if (vendor == SDL_libusb_whitelist[i].vendor && + product == SDL_libusb_whitelist[i].product) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) + #define use_libusb_whitelist_default SDL_TRUE +#else + #define use_libusb_whitelist_default SDL_FALSE +#endif /* HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND */ +static SDL_bool use_libusb_whitelist = use_libusb_whitelist_default; + #endif /* HAVE_LIBUSB */ #endif /* !SDL_HIDAPI_DISABLED */ /* Shared HIDAPI Implementation */ -struct hidapi_backend { - int (*hid_write)(void* device, const unsigned char* data, size_t length); - int (*hid_read_timeout)(void* device, unsigned char* data, size_t length, int milliseconds); - int (*hid_read)(void* device, unsigned char* data, size_t length); - int (*hid_set_nonblocking)(void* device, int nonblock); - int (*hid_send_feature_report)(void* device, const unsigned char* data, size_t length); - int (*hid_get_feature_report)(void* device, unsigned char* data, size_t length); - void (*hid_close)(void* device); - int (*hid_get_manufacturer_string)(void* device, wchar_t* string, size_t maxlen); - int (*hid_get_product_string)(void* device, wchar_t* string, size_t maxlen); - int (*hid_get_serial_number_string)(void* device, wchar_t* string, size_t maxlen); - int (*hid_get_indexed_string)(void* device, int string_index, wchar_t* string, size_t maxlen); - const wchar_t* (*hid_error)(void* device); +struct hidapi_backend +{ + int (*hid_write)(void *device, const unsigned char *data, size_t length); + int (*hid_read_timeout)(void *device, unsigned char *data, size_t length, int milliseconds); + int (*hid_read)(void *device, unsigned char *data, size_t length); + int (*hid_set_nonblocking)(void *device, int nonblock); + int (*hid_send_feature_report)(void *device, const unsigned char *data, size_t length); + int (*hid_get_feature_report)(void *device, unsigned char *data, size_t length); + void (*hid_close)(void *device); + int (*hid_get_manufacturer_string)(void *device, wchar_t *string, size_t maxlen); + int (*hid_get_product_string)(void *device, wchar_t *string, size_t maxlen); + int (*hid_get_serial_number_string)(void *device, wchar_t *string, size_t maxlen); + int (*hid_get_indexed_string)(void *device, int string_index, wchar_t *string, size_t maxlen); + const wchar_t *(*hid_error)(void *device); }; -#if HAVE_PLATFORM_BACKEND +#ifdef HAVE_PLATFORM_BACKEND static const struct hidapi_backend PLATFORM_Backend = { - (void*)PLATFORM_hid_write, - (void*)PLATFORM_hid_read_timeout, - (void*)PLATFORM_hid_read, - (void*)PLATFORM_hid_set_nonblocking, - (void*)PLATFORM_hid_send_feature_report, - (void*)PLATFORM_hid_get_feature_report, - (void*)PLATFORM_hid_close, - (void*)PLATFORM_hid_get_manufacturer_string, - (void*)PLATFORM_hid_get_product_string, - (void*)PLATFORM_hid_get_serial_number_string, - (void*)PLATFORM_hid_get_indexed_string, - (void*)PLATFORM_hid_error + (void *)PLATFORM_hid_write, + (void *)PLATFORM_hid_read_timeout, + (void *)PLATFORM_hid_read, + (void *)PLATFORM_hid_set_nonblocking, + (void *)PLATFORM_hid_send_feature_report, + (void *)PLATFORM_hid_get_feature_report, + (void *)PLATFORM_hid_close, + (void *)PLATFORM_hid_get_manufacturer_string, + (void *)PLATFORM_hid_get_product_string, + (void *)PLATFORM_hid_get_serial_number_string, + (void *)PLATFORM_hid_get_indexed_string, + (void *)PLATFORM_hid_error }; #endif /* HAVE_PLATFORM_BACKEND */ -#if HAVE_DRIVER_BACKEND +#ifdef HAVE_DRIVER_BACKEND static const struct hidapi_backend DRIVER_Backend = { - (void*)DRIVER_hid_write, - (void*)DRIVER_hid_read_timeout, - (void*)DRIVER_hid_read, - (void*)DRIVER_hid_set_nonblocking, - (void*)DRIVER_hid_send_feature_report, - (void*)DRIVER_hid_get_feature_report, - (void*)DRIVER_hid_close, - (void*)DRIVER_hid_get_manufacturer_string, - (void*)DRIVER_hid_get_product_string, - (void*)DRIVER_hid_get_serial_number_string, - (void*)DRIVER_hid_get_indexed_string, - (void*)DRIVER_hid_error + (void *)DRIVER_hid_write, + (void *)DRIVER_hid_read_timeout, + (void *)DRIVER_hid_read, + (void *)DRIVER_hid_set_nonblocking, + (void *)DRIVER_hid_send_feature_report, + (void *)DRIVER_hid_get_feature_report, + (void *)DRIVER_hid_close, + (void *)DRIVER_hid_get_manufacturer_string, + (void *)DRIVER_hid_get_product_string, + (void *)DRIVER_hid_get_serial_number_string, + (void *)DRIVER_hid_get_indexed_string, + (void *)DRIVER_hid_error }; #endif /* HAVE_DRIVER_BACKEND */ #ifdef HAVE_LIBUSB static const struct hidapi_backend LIBUSB_Backend = { - (void*)LIBUSB_hid_write, - (void*)LIBUSB_hid_read_timeout, - (void*)LIBUSB_hid_read, - (void*)LIBUSB_hid_set_nonblocking, - (void*)LIBUSB_hid_send_feature_report, - (void*)LIBUSB_hid_get_feature_report, - (void*)LIBUSB_hid_close, - (void*)LIBUSB_hid_get_manufacturer_string, - (void*)LIBUSB_hid_get_product_string, - (void*)LIBUSB_hid_get_serial_number_string, - (void*)LIBUSB_hid_get_indexed_string, - (void*)LIBUSB_hid_error + (void *)LIBUSB_hid_write, + (void *)LIBUSB_hid_read_timeout, + (void *)LIBUSB_hid_read, + (void *)LIBUSB_hid_set_nonblocking, + (void *)LIBUSB_hid_send_feature_report, + (void *)LIBUSB_hid_get_feature_report, + (void *)LIBUSB_hid_close, + (void *)LIBUSB_hid_get_manufacturer_string, + (void *)LIBUSB_hid_get_product_string, + (void *)LIBUSB_hid_get_serial_number_string, + (void *)LIBUSB_hid_get_indexed_string, + (void *)LIBUSB_hid_error }; #endif /* HAVE_LIBUSB */ @@ -958,10 +991,9 @@ struct SDL_hid_device_ }; static char device_magic; -#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB) +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) -static SDL_hid_device * -CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend) +static SDL_hid_device *CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend) { SDL_hid_device *wrapper = (SDL_hid_device *)SDL_malloc(sizeof(*wrapper)); wrapper->magic = &device_magic; @@ -972,37 +1004,35 @@ CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend) #endif /* HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || HAVE_LIBUSB */ -static void -DeleteHIDDeviceWrapper(SDL_hid_device *device) +static void DeleteHIDDeviceWrapper(SDL_hid_device *device) { device->magic = NULL; SDL_free(device); } -#define CHECK_DEVICE_MAGIC(device, retval) \ +#define CHECK_DEVICE_MAGIC(device, retval) \ if (!device || device->magic != &device_magic) { \ - SDL_SetError("Invalid device"); \ - return retval; \ + SDL_SetError("Invalid device"); \ + return retval; \ } -#if !SDL_HIDAPI_DISABLED -#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB) +#ifndef SDL_HIDAPI_DISABLED +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) -#define COPY_IF_EXISTS(var) \ - if (pSrc->var != NULL) { \ +#define COPY_IF_EXISTS(var) \ + if (pSrc->var != NULL) { \ pDst->var = SDL_strdup(pSrc->var); \ - } else { \ - pDst->var = NULL; \ + } else { \ + pDst->var = NULL; \ } -#define WCOPY_IF_EXISTS(var) \ - if (pSrc->var != NULL) { \ +#define WCOPY_IF_EXISTS(var) \ + if (pSrc->var != NULL) { \ pDst->var = SDL_wcsdup(pSrc->var); \ - } else { \ - pDst->var = NULL; \ + } else { \ + pDst->var = NULL; \ } -static void -CopyHIDDeviceInfo(struct SDL_hid_device_info *pSrc, struct SDL_hid_device_info *pDst) +static void CopyHIDDeviceInfo(struct SDL_hid_device_info *pSrc, struct SDL_hid_device_info *pDst) { COPY_IF_EXISTS(path) pDst->vendor_id = pSrc->vendor_id; @@ -1028,7 +1058,7 @@ CopyHIDDeviceInfo(struct SDL_hid_device_info *pSrc, struct SDL_hid_device_info * static int SDL_hidapi_refcount = 0; -static void SDL_SetHIDAPIError( const wchar_t *error ) +static void SDL_SetHIDAPIError(const wchar_t *error) { if (error) { char *error_utf8 = SDL_iconv_wchar_utf8(error); @@ -1065,6 +1095,8 @@ int SDL_hid_init(void) #endif #ifdef HAVE_LIBUSB + use_libusb_whitelist = SDL_GetHintBoolean("SDL_HIDAPI_LIBUSB_WHITELIST", + use_libusb_whitelist_default); if (SDL_getenv("SDL_HIDAPI_DISABLE_LIBUSB") != NULL) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "libusb disabled by SDL_HIDAPI_DISABLE_LIBUSB"); @@ -1079,11 +1111,13 @@ int SDL_hid_init(void) if (libusb_ctx.libhandle != NULL) { SDL_bool loaded = SDL_TRUE; #ifdef SDL_LIBUSB_DYNAMIC - #define LOAD_LIBUSB_SYMBOL(func) \ - if (!(libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func))) {loaded = SDL_FALSE;} +#define LOAD_LIBUSB_SYMBOL(func) \ + if (!(libusb_ctx.func = SDL_LoadFunction(libusb_ctx.libhandle, "libusb_" #func))) { \ + loaded = SDL_FALSE; \ + } #else - #define LOAD_LIBUSB_SYMBOL(func) \ - libusb_ctx.func = libusb_##func; +#define LOAD_LIBUSB_SYMBOL(func) \ + libusb_ctx.func = libusb_##func; #endif LOAD_LIBUSB_SYMBOL(init) LOAD_LIBUSB_SYMBOL(exit) @@ -1112,7 +1146,7 @@ int SDL_hid_init(void) LOAD_LIBUSB_SYMBOL(handle_events) LOAD_LIBUSB_SYMBOL(handle_events_completed) LOAD_LIBUSB_SYMBOL(error_name) - #undef LOAD_LIBUSB_SYMBOL +#undef LOAD_LIBUSB_SYMBOL if (!loaded) { #ifdef SDL_LIBUSB_DYNAMIC @@ -1132,9 +1166,9 @@ int SDL_hid_init(void) } #endif /* HAVE_LIBUSB */ -#if HAVE_PLATFORM_BACKEND +#ifdef HAVE_PLATFORM_BACKEND ++attempts; -#if __LINUX__ +#ifdef __LINUX__ udev_ctx = SDL_UDEV_GetUdevSyms(); #endif /* __LINUX __ */ if (udev_ctx && PLATFORM_hid_init() == 0) { @@ -1163,15 +1197,15 @@ int SDL_hid_exit(void) } SDL_hidapi_refcount = 0; -#if !SDL_HIDAPI_DISABLED +#ifndef SDL_HIDAPI_DISABLED HIDAPI_ShutdownDiscovery(); #endif -#if HAVE_PLATFORM_BACKEND +#ifdef HAVE_PLATFORM_BACKEND if (udev_ctx) { result |= PLATFORM_hid_exit(); } -#if __LINUX__ +#ifdef __LINUX__ SDL_UDEV_ReleaseUdevSyms(); #endif /* __LINUX __ */ #endif /* HAVE_PLATFORM_BACKEND */ @@ -1193,7 +1227,7 @@ Uint32 SDL_hid_device_change_count(void) { Uint32 counter = 0; -#if !SDL_HIDAPI_DISABLED +#ifndef SDL_HIDAPI_DISABLED if (SDL_hidapi_refcount == 0 && SDL_hid_init() != 0) { return 0; } @@ -1213,16 +1247,16 @@ Uint32 SDL_hid_device_change_count(void) struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id) { -#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB) +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) #ifdef HAVE_LIBUSB struct SDL_hid_device_info *usb_devs = NULL; struct SDL_hid_device_info *usb_dev; #endif -#if HAVE_DRIVER_BACKEND - struct SDL_hid_device_info* driver_devs = NULL; - struct SDL_hid_device_info* driver_dev; +#ifdef HAVE_DRIVER_BACKEND + struct SDL_hid_device_info *driver_devs = NULL; + struct SDL_hid_device_info *driver_dev; #endif -#if HAVE_PLATFORM_BACKEND +#ifdef HAVE_PLATFORM_BACKEND struct SDL_hid_device_info *raw_devs = NULL; struct SDL_hid_device_info *raw_dev; #endif @@ -1239,8 +1273,18 @@ struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned SDL_Log("libusb devices found:"); #endif for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) { - new_dev = (struct SDL_hid_device_info*) SDL_malloc(sizeof(struct SDL_hid_device_info)); - if (!new_dev) { + if (use_libusb_whitelist) { + if (!IsInWhitelist(usb_dev->vendor_id, usb_dev->product_id)) { +#ifdef DEBUG_HIDAPI + SDL_Log("Device was not in libusb whitelist: %ls %ls 0x%.4hx 0x%.4hx", + usb_dev->manufacturer_string, usb_dev->product_string, + usb_dev->vendor_id, usb_dev->product_id); +#endif /* DEBUG_HIDAPI */ + continue; + } + } + new_dev = (struct SDL_hid_device_info *)SDL_malloc(sizeof(struct SDL_hid_device_info)); + if (new_dev == NULL) { LIBUSB_hid_free_enumeration(usb_devs); SDL_hid_free_enumeration(devs); SDL_OutOfMemory(); @@ -1266,7 +1310,7 @@ struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned #ifdef HAVE_DRIVER_BACKEND driver_devs = DRIVER_hid_enumerate(vendor_id, product_id); for (driver_dev = driver_devs; driver_dev; driver_dev = driver_dev->next) { - new_dev = (struct SDL_hid_device_info*) SDL_malloc(sizeof(struct SDL_hid_device_info)); + new_dev = (struct SDL_hid_device_info *)SDL_malloc(sizeof(struct SDL_hid_device_info)); CopyHIDDeviceInfo(driver_dev, new_dev); if (last != NULL) { @@ -1278,7 +1322,7 @@ struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned } #endif /* HAVE_DRIVER_BACKEND */ -#if HAVE_PLATFORM_BACKEND +#ifdef HAVE_PLATFORM_BACKEND if (udev_ctx) { raw_devs = PLATFORM_hid_enumerate(vendor_id, product_id); #ifdef DEBUG_HIDAPI @@ -1293,6 +1337,11 @@ struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned #endif #ifdef HAVE_LIBUSB for (usb_dev = usb_devs; usb_dev; usb_dev = usb_dev->next) { + if (use_libusb_whitelist) { + if (!IsInWhitelist(usb_dev->vendor_id, usb_dev->product_id)) { + continue; + } + } if (raw_dev->vendor_id == usb_dev->vendor_id && raw_dev->product_id == usb_dev->product_id && (raw_dev->interface_number < 0 || raw_dev->interface_number == usb_dev->interface_number)) { @@ -1312,8 +1361,8 @@ struct SDL_hid_device_info *SDL_hid_enumerate(unsigned short vendor_id, unsigned } #endif if (!bFound) { - new_dev = (struct SDL_hid_device_info*) SDL_malloc(sizeof(struct SDL_hid_device_info)); - if (!new_dev) { + new_dev = (struct SDL_hid_device_info *)SDL_malloc(sizeof(struct SDL_hid_device_info)); + if (new_dev == NULL) { #ifdef HAVE_LIBUSB if (libusb_ctx.libhandle) { LIBUSB_hid_free_enumeration(usb_devs); @@ -1366,30 +1415,35 @@ void SDL_hid_free_enumeration(struct SDL_hid_device_info *devs) SDL_hid_device *SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number) { -#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB) +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) void *pDevice = NULL; if (SDL_hidapi_refcount == 0 && SDL_hid_init() != 0) { return NULL; } -#if HAVE_PLATFORM_BACKEND - if (udev_ctx && - (pDevice = PLATFORM_hid_open(vendor_id, product_id, serial_number)) != NULL) { - return CreateHIDDeviceWrapper(pDevice, &PLATFORM_Backend); +#ifdef HAVE_PLATFORM_BACKEND + if (udev_ctx) { + pDevice = PLATFORM_hid_open(vendor_id, product_id, serial_number); + if (pDevice != NULL) { + return CreateHIDDeviceWrapper(pDevice, &PLATFORM_Backend); + } } #endif /* HAVE_PLATFORM_BACKEND */ -#if HAVE_DRIVER_BACKEND - if ((pDevice = DRIVER_hid_open(vendor_id, product_id, serial_number)) != NULL) { +#ifdef HAVE_DRIVER_BACKEND + pDevice = DRIVER_hid_open(vendor_id, product_id, serial_number); + if (pDevice != NULL) { return CreateHIDDeviceWrapper(pDevice, &DRIVER_Backend); } #endif /* HAVE_DRIVER_BACKEND */ #ifdef HAVE_LIBUSB - if (libusb_ctx.libhandle && - (pDevice = LIBUSB_hid_open(vendor_id, product_id, serial_number)) != NULL) { - return CreateHIDDeviceWrapper(pDevice, &LIBUSB_Backend); + if (libusb_ctx.libhandle != NULL) { + pDevice = LIBUSB_hid_open(vendor_id, product_id, serial_number); + if (pDevice != NULL) { + return CreateHIDDeviceWrapper(pDevice, &LIBUSB_Backend); + } } #endif /* HAVE_LIBUSB */ @@ -1400,30 +1454,35 @@ SDL_hid_device *SDL_hid_open(unsigned short vendor_id, unsigned short product_id SDL_hid_device *SDL_hid_open_path(const char *path, int bExclusive /* = false */) { -#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB) +#if defined(HAVE_PLATFORM_BACKEND) || defined(HAVE_DRIVER_BACKEND) || defined(HAVE_LIBUSB) void *pDevice = NULL; if (SDL_hidapi_refcount == 0 && SDL_hid_init() != 0) { return NULL; } -#if HAVE_PLATFORM_BACKEND - if (udev_ctx && - (pDevice = PLATFORM_hid_open_path(path, bExclusive)) != NULL) { - return CreateHIDDeviceWrapper(pDevice, &PLATFORM_Backend); +#ifdef HAVE_PLATFORM_BACKEND + if (udev_ctx) { + pDevice = PLATFORM_hid_open_path(path, bExclusive); + if (pDevice != NULL) { + return CreateHIDDeviceWrapper(pDevice, &PLATFORM_Backend); + } } #endif /* HAVE_PLATFORM_BACKEND */ -#if HAVE_DRIVER_BACKEND - if ((pDevice = DRIVER_hid_open_path(path, bExclusive)) != NULL) { +#ifdef HAVE_DRIVER_BACKEND + pDevice = DRIVER_hid_open_path(path, bExclusive); + if (pDevice != NULL) { return CreateHIDDeviceWrapper(pDevice, &DRIVER_Backend); } #endif /* HAVE_DRIVER_BACKEND */ #ifdef HAVE_LIBUSB - if (libusb_ctx.libhandle && - (pDevice = LIBUSB_hid_open_path(path, bExclusive)) != NULL) { - return CreateHIDDeviceWrapper(pDevice, &LIBUSB_Backend); + if (libusb_ctx.libhandle != NULL) { + pDevice = LIBUSB_hid_open_path(path, bExclusive); + if (pDevice != NULL) { + return CreateHIDDeviceWrapper(pDevice, &LIBUSB_Backend); + } } #endif /* HAVE_LIBUSB */ @@ -1512,7 +1571,7 @@ int SDL_hid_get_feature_report(SDL_hid_device *device, unsigned char *data, size void SDL_hid_close(SDL_hid_device *device) { - CHECK_DEVICE_MAGIC(device,); + CHECK_DEVICE_MAGIC(device, ); device->backend->hid_close(device->device); DeleteHIDDeviceWrapper(device); @@ -1572,7 +1631,7 @@ int SDL_hid_get_indexed_string(SDL_hid_device *device, int string_index, wchar_t void SDL_hid_ble_scan(SDL_bool active) { -#if !SDL_HIDAPI_DISABLED && (__IPHONEOS__ || __TVOS__) +#if !defined(SDL_HIDAPI_DISABLED) && (defined(__IPHONEOS__) || defined(__TVOS__)) hid_ble_scan(active); #endif } diff --git a/src/hidapi/SDL_hidapi_c.h b/src/hidapi/SDL_hidapi_c.h index c7343b126b08b..06a75d3b82e67 100644 --- a/src/hidapi/SDL_hidapi_c.h +++ b/src/hidapi/SDL_hidapi_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/hidapi/android/hid.cpp b/src/hidapi/android/hid.cpp index 34fda42d3dfbe..3b050a6728e7d 100644 --- a/src/hidapi/android/hid.cpp +++ b/src/hidapi/android/hid.cpp @@ -48,7 +48,7 @@ #define HID_DEVICE_MANAGER_JAVA_INTERFACE(function) CONCAT1(SDL_JAVA_PREFIX, HIDDeviceManager, function) -#if !SDL_HIDAPI_DISABLED +#ifndef SDL_HIDAPI_DISABLED #include "SDL_hints.h" #include "../../core/android/SDL_android.h" @@ -744,7 +744,7 @@ class CHIDDevice env->CallVoidMethod( g_HIDDeviceManagerCallbackHandler, g_midHIDDeviceManagerClose, m_nId ); ExceptionCheck( env, "Close" ); } - + hid_mutex_guard dataLock( &m_dataLock ); m_vecData.clear(); @@ -1139,7 +1139,7 @@ HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path, int bEx hid_mutex_guard l( &g_DevicesMutex ); for ( hid_device_ref pCurr = g_Devices; pCurr; pCurr = pCurr->next ) { - if ( SDL_strcmp( pCurr->GetDeviceInfo()->path, path ) == 0 ) + if ( SDL_strcmp( pCurr->GetDeviceInfo()->path, path ) == 0 ) { hid_device *pValue = pCurr->GetDevice(); if ( pValue ) diff --git a/src/hidapi/hidapi/hidapi.h b/src/hidapi/hidapi/hidapi.h index 3fddfa885eccc..1114aefc9c677 100644 --- a/src/hidapi/hidapi/hidapi.h +++ b/src/hidapi/hidapi/hidapi.h @@ -406,7 +406,7 @@ namespace NAMESPACE { */ HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *dev); -#if __IPHONEOS__ || __TVOS__ +#if defined(__IPHONEOS__) || defined(__TVOS__) HID_API_EXPORT void HID_API_CALL hid_ble_scan(int active); #endif diff --git a/src/hidapi/ios/hid.m b/src/hidapi/ios/hid.m index 55845701a4a90..72879f2b072e1 100644 --- a/src/hidapi/ios/hid.m +++ b/src/hidapi/ios/hid.m @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if !SDL_HIDAPI_DISABLED +#ifndef SDL_HIDAPI_DISABLED #include "SDL_hints.h" @@ -131,7 +131,7 @@ static void RingBuffer_init( RingBuffer *this ) this->_last = 0; pthread_mutex_init( &this->accessLock, 0 ); } - + static bool RingBuffer_write( RingBuffer *this, const uint8_t *src ) { pthread_mutex_lock( &this->accessLock ); @@ -290,7 +290,9 @@ - (int)updateConnectedSteamControllers:(BOOL) bForce { static uint64_t s_unLastUpdateTick = 0; static mach_timebase_info_data_t s_timebase_info; - + uint64_t ticksNow; + NSArray *peripherals; + if ( self.centralManager == nil ) { return 0; @@ -300,11 +302,11 @@ - (int)updateConnectedSteamControllers:(BOOL) bForce { mach_timebase_info( &s_timebase_info ); } - - uint64_t ticksNow = mach_approximate_time(); + + ticksNow = mach_approximate_time(); if ( !bForce && ( ( (ticksNow - s_unLastUpdateTick) * s_timebase_info.numer ) / s_timebase_info.denom ) < (5ull * NSEC_PER_SEC) ) return (int)self.deviceMap.count; - + // we can see previously connected BLE peripherals but can't connect until the CBCentralManager // is fully powered up - only do work when we are in that state if ( self.centralManager.state != CBManagerStatePoweredOn ) @@ -312,24 +314,25 @@ - (int)updateConnectedSteamControllers:(BOOL) bForce // only update our last-check-time if we actually did work, otherwise there can be a long delay during initial power-up s_unLastUpdateTick = mach_approximate_time(); - + // if a pair is in-flight, the central manager may still give it back via retrieveConnected... and // cause the SDL layer to attempt to initialize it while some of its endpoints haven't yet been established if ( self.nPendingPairs > 0 ) return (int)self.deviceMap.count; - NSArray *peripherals = [self.centralManager retrieveConnectedPeripheralsWithServices: @[ [CBUUID UUIDWithString:@"180A"]]]; + peripherals = [self.centralManager retrieveConnectedPeripheralsWithServices: @[ [CBUUID UUIDWithString:@"180A"]]]; for ( CBPeripheral *peripheral in peripherals ) { // we already know this peripheral if ( [self.deviceMap objectForKey: peripheral] != nil ) continue; - + NSLog( @"connected peripheral: %@", peripheral ); if ( [peripheral.name isEqualToString:@"SteamController"] ) { + HIDBLEDevice *steamController; self.nPendingPairs += 1; - HIDBLEDevice *steamController = [[HIDBLEDevice alloc] initWithPeripheral:peripheral]; + steamController = [[HIDBLEDevice alloc] initWithPeripheral:peripheral]; [self.deviceMap setObject:steamController forKey:peripheral]; [self.centralManager connectPeripheral:peripheral options:nil]; } @@ -392,7 +395,7 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central case CBCentralManagerStatePoweredOn: { NSLog( @"CoreBluetooth BLE hardware is powered on and ready" ); - + // at startup, if we have no already attached peripherals, do a 20s scan for new unpaired devices, // otherwise callers should occaisionally do additional scans. we don't want to continuously be // scanning because it drains battery, causes other nearby people to have a hard time pairing their @@ -408,23 +411,23 @@ - (void)centralManagerDidUpdateState:(CBCentralManager *)central } break; } - + case CBCentralManagerStatePoweredOff: NSLog( @"CoreBluetooth BLE hardware is powered off" ); break; - + case CBCentralManagerStateUnauthorized: NSLog( @"CoreBluetooth BLE state is unauthorized" ); break; - + case CBCentralManagerStateUnknown: NSLog( @"CoreBluetooth BLE state is unknown" ); break; - + case CBCentralManagerStateUnsupported: NSLog( @"CoreBluetooth BLE hardware is unsupported on this platform" ); break; - + case CBCentralManagerStateResetting: NSLog( @"CoreBluetooth BLE manager is resetting" ); break; @@ -449,12 +452,13 @@ - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeri { NSString *localName = [advertisementData objectForKey:CBAdvertisementDataLocalNameKey]; NSString *log = [NSString stringWithFormat:@"Found '%@'", localName]; - + if ( [localName isEqualToString:@"SteamController"] ) { + HIDBLEDevice *steamController; NSLog( @"%@ : %@ - %@", log, peripheral, advertisementData ); self.nPendingPairs += 1; - HIDBLEDevice *steamController = [[HIDBLEDevice alloc] initWithPeripheral:peripheral]; + steamController = [[HIDBLEDevice alloc] initWithPeripheral:peripheral]; [self.deviceMap setObject:steamController forKey:peripheral]; [self.centralManager connectPeripheral:peripheral options:nil]; } @@ -475,7 +479,7 @@ - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPe // Core Bluetooth devices calling back on event boundaries of their run-loops. so annoying. -static void process_pending_events() +static void process_pending_events(void) { CFRunLoopRunResult res; do @@ -552,7 +556,7 @@ - (int)send_feature_report:(hidFeatureReport *)report { #if FEATURE_REPORT_LOGGING uint8_t *reportBytes = (uint8_t *)report; - + NSLog( @"HIDBLE:send_feature_report (%02zu/19) [%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x]", GetBluetoothSegmentSize( report->segment ), reportBytes[1], reportBytes[2], reportBytes[3], reportBytes[4], reportBytes[5], reportBytes[6], reportBytes[7], reportBytes[8], reportBytes[9], reportBytes[10], reportBytes[11], reportBytes[12], @@ -568,7 +572,7 @@ - (int)send_feature_report:(hidFeatureReport *)report // fire-and-forget - we are going to not wait for the response here because all Steam Controller BLE send_feature_report's are ignored, // except errors. [_bleSteamController writeValue:[NSData dataWithBytes:&report->segment length:sendSize] forCharacteristic:_bleCharacteristicReport type:CBCharacteristicWriteWithResponse]; - + // pretend we received a result anybody cares about return 19; @@ -578,18 +582,18 @@ - (int)send_feature_report:(hidFeatureReport *)report _waitStateForWriteFeatureReport = BLEDeviceWaitState_Waiting; [_bleSteamController writeValue:[NSData dataWithBytes:&report->segment length:sendSize ] forCharacteristic:_bleCharacteristicReport type:CBCharacteristicWriteWithResponse]; - + while ( _waitStateForWriteFeatureReport == BLEDeviceWaitState_Waiting ) { process_pending_events(); } - + if ( _waitStateForWriteFeatureReport == BLEDeviceWaitState_Error ) { _waitStateForWriteFeatureReport = BLEDeviceWaitState_None; return -1; } - + _waitStateForWriteFeatureReport = BLEDeviceWaitState_None; return 19; #endif @@ -599,20 +603,20 @@ - (int)get_feature_report:(uint8_t)feature into:(uint8_t *)buffer { _waitStateForReadFeatureReport = BLEDeviceWaitState_Waiting; [_bleSteamController readValueForCharacteristic:_bleCharacteristicReport]; - + while ( _waitStateForReadFeatureReport == BLEDeviceWaitState_Waiting ) process_pending_events(); - + if ( _waitStateForReadFeatureReport == BLEDeviceWaitState_Error ) { _waitStateForReadFeatureReport = BLEDeviceWaitState_None; return -1; } - + memcpy( buffer, _featureReport, sizeof(_featureReport) ); - + _waitStateForReadFeatureReport = BLEDeviceWaitState_None; - + #if FEATURE_REPORT_LOGGING NSLog( @"HIDBLE:get_feature_report (19) [%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x]", buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], @@ -657,7 +661,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForServi for (CBCharacteristic *aChar in service.characteristics) { NSLog( @"Found Characteristic %@", aChar ); - + if ( [aChar.UUID isEqual:[CBUUID UUIDWithString:VALVE_INPUT_CHAR]] ) { self.bleCharacteristicInput = aChar; @@ -704,7 +708,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(C else if ( [characteristic.UUID isEqual:_bleCharacteristicReport.UUID] ) { memset( _featureReport, 0, sizeof(_featureReport) ); - + if ( error != nil ) { NSLog( @"HIDBLE: get_feature_report error: %@", error ); @@ -789,13 +793,13 @@ void HID_API_EXPORT HID_API_CALL hid_ble_scan( int bStart ) NSString *nssPath = [NSString stringWithUTF8String:path]; HIDBLEManager *bleManager = HIDBLEManager.sharedInstance; NSEnumerator *devices = [bleManager.deviceMap objectEnumerator]; - + for ( HIDBLEDevice *device in devices ) { // we have the device but it hasn't found its service or characteristics until it is connected if ( !device.ready || !device.connected || !device.bleCharacteristicInput ) continue; - + if ( [device.bleSteamController.identifier.UUIDString isEqualToString:nssPath] ) { result = (hid_device *)malloc( sizeof( hid_device ) ); @@ -829,7 +833,7 @@ int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock) { /* All Nonblocking operation is handled by the library. */ dev->blocking = !nonblock; - + return 0; } @@ -848,14 +852,16 @@ int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock) } } - if ( ( vendor_id == 0 && product_id == 0 ) || - ( vendor_id == VALVE_USB_VID && product_id == D0G_BLE2_PID ) ) + if ( ( vendor_id == 0 || vendor_id == VALVE_USB_VID ) && + ( product_id == 0 || product_id == D0G_BLE2_PID ) ) { + NSEnumerator *devices; HIDBLEManager *bleManager = HIDBLEManager.sharedInstance; [bleManager updateConnectedSteamControllers:false]; - NSEnumerator *devices = [bleManager.deviceMap objectEnumerator]; + devices = [bleManager.deviceMap objectEnumerator]; for ( HIDBLEDevice *device in devices ) { + struct hid_device_info *device_info; // there are several brief windows in connecting to an already paired device and // one long window waiting for users to confirm pairing where we don't want // to consider a device ready - if we hand it back to SDL or another @@ -873,7 +879,7 @@ int HID_API_EXPORT hid_set_nonblocking(hid_device *dev, int nonblock) } continue; } - struct hid_device_info *device_info = (struct hid_device_info *)malloc( sizeof(struct hid_device_info) ); + device_info = (struct hid_device_info *)malloc( sizeof(struct hid_device_info) ); memset( device_info, 0, sizeof(struct hid_device_info) ); device_info->next = root; root = device_info; @@ -947,13 +953,14 @@ int HID_API_EXPORT hid_send_feature_report(hid_device *dev, const unsigned char int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length) { + size_t written; HIDBLEDevice *device_handle = (__bridge HIDBLEDevice *)dev->device_handle; if ( !device_handle.connected ) return -1; - size_t written = [device_handle get_feature_report:data[0] into:data]; - + written = [device_handle get_feature_report:data[0] into:data]; + return written == length-1 ? (int)length : (int)written; } @@ -969,16 +976,17 @@ int HID_API_EXPORT hid_read(hid_device *dev, unsigned char *data, size_t length) int HID_API_EXPORT hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds) { + int result; HIDBLEDevice *device_handle = (__bridge HIDBLEDevice *)dev->device_handle; if ( !device_handle.connected ) return -1; - + if ( milliseconds != 0 ) { NSLog( @"hid_read_timeout with non-zero wait" ); } - int result = (int)[device_handle read_input_report:data]; + result = (int)[device_handle read_input_report:data]; #if FEATURE_REPORT_LOGGING NSLog( @"HIDBLE:hid_read_timeout (%d) [%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x]", result, data[1], data[2], data[3], data[4], data[5], data[6], diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 9e2a435899799..2485bbf9be328 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -519,7 +519,7 @@ static struct usb_string_cache_entry *usb_string_cache = NULL; static size_t usb_string_cache_size = 0; static size_t usb_string_cache_insert_pos = 0; -static int usb_string_cache_grow() +static int usb_string_cache_grow(void) { struct usb_string_cache_entry *new_cache; size_t allocSize; @@ -537,7 +537,7 @@ static int usb_string_cache_grow() return 0; } -static void usb_string_cache_destroy() +static void usb_string_cache_destroy(void) { size_t i; for (i = 0; i < usb_string_cache_insert_pos; i++) { @@ -688,6 +688,8 @@ static int is_xbox360(unsigned short vendor_id, const struct libusb_interface_de 0x20d6, /* PowerA */ 0x24c6, /* PowerA */ 0x2c22, /* Qanba */ + 0x2dc8, /* 8BitDo */ + 0x9886, /* ASTRO Gaming */ }; if (intf_desc->bInterfaceClass == LIBUSB_CLASS_VENDOR_SPEC && @@ -709,15 +711,20 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de static const int XB1_IFACE_SUBCLASS = 71; static const int XB1_IFACE_PROTOCOL = 208; static const int SUPPORTED_VENDORS[] = { + 0x03f0, /* HP */ + 0x044f, /* Thrustmaster */ 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ + 0x0b05, /* ASUS */ 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ + 0x10f5, /* Turtle Beach */ 0x1532, /* Razer Wildcat */ 0x20d6, /* PowerA */ 0x24c6, /* PowerA */ 0x2dc8, /* 8BitDo */ 0x2e24, /* Hyperkin */ + 0x3537, /* GameSir */ }; if (intf_desc->bInterfaceNumber == 0 && diff --git a/src/hidapi/linux/hid.c b/src/hidapi/linux/hid.c index cf857a67593bf..8c3aeaed68092 100644 --- a/src/hidapi/linux/hid.c +++ b/src/hidapi/linux/hid.c @@ -729,6 +729,8 @@ hid_device * hid_open(unsigned short vendor_id, unsigned short product_id, const hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive) { + const int MAX_ATTEMPTS = 10; + int attempt; hid_device *dev = NULL; hid_init(); @@ -736,7 +738,15 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive) dev = new_hid_device(); /* OPEN HERE */ - dev->device_handle = open(path, O_RDWR | O_CLOEXEC); + for (attempt = 1; attempt <= MAX_ATTEMPTS; ++attempt) { + dev->device_handle = open(path, O_RDWR | O_CLOEXEC); + if (dev->device_handle < 0 && errno == EACCES) { + /* udev might be setting up permissions, wait a bit and try again */ + usleep(1 * 1000); + continue; + } + break; + } /* If we have a good handle, return it. */ if (dev->device_handle >= 0) { @@ -874,9 +884,9 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, unsigned char report = data[0]; res = ioctl(dev->device_handle, HIDIOCGFEATURE(length), data); - if (res < 0) - perror("ioctl (GFEATURE)"); - else if (dev->needs_ble_hack) { + if (res < 0) { + /* perror("ioctl (GFEATURE)"); */ + } else if (dev->needs_ble_hack) { /* Versions of BlueZ before 5.56 don't include the report in the data, * and versions of BlueZ >= 5.56 include 2 copies of the report. * We'll fix it so that there is a single copy of the report in both cases diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c index d5dfbc2961b7e..24e0b8ac2a0cc 100644 --- a/src/hidapi/mac/hid.c +++ b/src/hidapi/mac/hid.c @@ -504,7 +504,7 @@ int HID_API_EXPORT hid_exit(void) return 0; } -static void process_pending_events() { +static void process_pending_events(void) { SInt32 res; do { res = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.001, FALSE); @@ -772,7 +772,7 @@ static void *read_thread(void *param) while (!dev->shutdown_thread && !dev->disconnected) { code = CFRunLoopRunInMode(dev->run_loop_mode, 1000/*sec*/, FALSE); /* Return if the device has been disconnected */ - if (code == kCFRunLoopRunFinished) { + if (code == kCFRunLoopRunFinished || code == kCFRunLoopRunStopped) { dev->disconnected = 1; break; } @@ -819,10 +819,12 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive) /* Set up the HID Manager if it hasn't been done */ if (hid_init() < 0) return NULL; - + +#if 0 /* We have a path because the IOHIDManager is already updated */ /* give the IOHIDManager a chance to update itself */ process_pending_events(); - +#endif + device_set = IOHIDManagerCopyDevices(hid_mgr); if (!device_set) return NULL; @@ -853,7 +855,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive) /* Create the Run Loop Mode for this device. printing the reference seems to work. */ - sprintf(str, "HIDAPI_%p", os_dev); + snprintf(str, sizeof(str), "HIDAPI_%p", os_dev); dev->run_loop_mode = CFStringCreateWithCString(NULL, str, kCFStringEncodingASCII); @@ -955,7 +957,9 @@ static int return_data(hid_device *dev, unsigned char *data, size_t length) size_t len = 0; if (rpt != NULL) { len = (length < rpt->len)? length: rpt->len; - memcpy(data, rpt->data, len); + if (data != NULL) { + memcpy(data, rpt->data, len); + } dev->input_reports = rpt->next; free(rpt->data); free(rpt); @@ -1131,11 +1135,14 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, void HID_API_EXPORT hid_close(hid_device *dev) { + int disconnected; + if (!dev) return; /* Disconnect the report callback before close. */ - if (!dev->disconnected) { + disconnected = dev->disconnected; + if (!disconnected) { IOHIDDeviceRegisterInputReportCallback( dev->device_handle, dev->input_report_buf, dev->max_input_report_len, NULL, dev); @@ -1159,7 +1166,7 @@ void HID_API_EXPORT hid_close(hid_device *dev) /* Close the OS handle to the device, but only if it's not been unplugged. If it's been unplugged, then calling IOHIDDeviceClose() will crash. */ - if (!dev->disconnected) { + if (!disconnected) { IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone); } diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c index 27c09e52ef726..54843d4865885 100644 --- a/src/hidapi/windows/hid.c +++ b/src/hidapi/windows/hid.c @@ -264,7 +264,7 @@ static void register_error(hid_device *device, const char *op) } #ifndef HIDAPI_USE_DDK -static int lookup_functions() +static int lookup_functions(void) { lib_handle = LoadLibrary(TEXT("hid.dll")); if (lib_handle) { @@ -346,13 +346,14 @@ int hid_blacklist(unsigned short vendor_id, unsigned short product_id) { 0x1532, 0x010B }, /* Razer Arctosa Gaming keyboard */ { 0x045E, 0x0822 }, /* Microsoft Precision Mouse */ { 0x0D8C, 0x0014 }, /* Sharkoon Skiller SGH2 headset */ + { 0x1CCF, 0x0000 }, /* All Konami Amusement Devices */ /* Turns into an Android controller when enumerated... */ { 0x0738, 0x2217 } /* SPEEDLINK COMPETITION PRO */ }; for (i = 0; i < (sizeof(known_bad)/sizeof(known_bad[0])); i++) { - if ((vendor_id == known_bad[i].vid) && (product_id == known_bad[i].pid)) { + if ((vendor_id == known_bad[i].vid) && (product_id == known_bad[i].pid || known_bad[i].pid == 0x0000)) { return 1; } } diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 26979a2ffbdcf..146dc332b4cc4 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,36 +27,42 @@ #include "SDL_timer.h" #include "SDL_sysjoystick.h" #include "SDL_joystick_c.h" +#include "SDL_steam_virtual_gamepad.h" #include "SDL_gamecontrollerdb.h" #include "controller_type.h" #include "usb_ids.h" #include "hidapi/SDL_hidapi_nintendo.h" -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED #include "../events/SDL_events_c.h" #endif +#if defined(__WIN32__) +#include "../core/windows/SDL_windows.h" +#endif + #if defined(__ANDROID__) #include "SDL_system.h" #endif - /* Many controllers turn the center button into an instantaneous button press */ -#define SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS 250 - -#define SDL_CONTROLLER_CRC_FIELD "crc:" -#define SDL_CONTROLLER_CRC_FIELD_SIZE 4 /* hard-coded for speed */ -#define SDL_CONTROLLER_PLATFORM_FIELD "platform:" -#define SDL_CONTROLLER_PLATFORM_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_PLATFORM_FIELD) -#define SDL_CONTROLLER_HINT_FIELD "hint:" -#define SDL_CONTROLLER_HINT_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_HINT_FIELD) -#define SDL_CONTROLLER_SDKGE_FIELD "sdk>=:" -#define SDL_CONTROLLER_SDKGE_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_SDKGE_FIELD) -#define SDL_CONTROLLER_SDKLE_FIELD "sdk<=:" -#define SDL_CONTROLLER_SDKLE_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_SDKLE_FIELD) +#define SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS 250 + +#define SDL_CONTROLLER_CRC_FIELD "crc:" +#define SDL_CONTROLLER_CRC_FIELD_SIZE 4 /* hard-coded for speed */ +#define SDL_CONTROLLER_TYPE_FIELD "type:" +#define SDL_CONTROLLER_TYPE_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_TYPE_FIELD) +#define SDL_CONTROLLER_PLATFORM_FIELD "platform:" +#define SDL_CONTROLLER_PLATFORM_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_PLATFORM_FIELD) +#define SDL_CONTROLLER_HINT_FIELD "hint:" +#define SDL_CONTROLLER_HINT_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_HINT_FIELD) +#define SDL_CONTROLLER_SDKGE_FIELD "sdk>=:" +#define SDL_CONTROLLER_SDKGE_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_SDKGE_FIELD) +#define SDL_CONTROLLER_SDKLE_FIELD "sdk<=:" +#define SDL_CONTROLLER_SDKLE_FIELD_SIZE SDL_strlen(SDL_CONTROLLER_SDKLE_FIELD) /* a list of currently opened game controllers */ -static SDL_GameController *SDL_gamecontrollers = NULL; +static SDL_GameController *SDL_gamecontrollers SDL_GUARDED_BY(SDL_joystick_lock) = NULL; typedef struct { @@ -65,13 +71,15 @@ typedef struct { int button; - struct { + struct + { int axis; int axis_min; int axis_max; } axis; - struct { + struct + { int hat; int hat_mask; } hat; @@ -83,7 +91,8 @@ typedef struct { SDL_GameControllerButton button; - struct { + struct + { SDL_GameControllerAxis axis; int axis_min; int axis_max; @@ -101,115 +110,69 @@ typedef enum SDL_CONTROLLER_MAPPING_PRIORITY_USER, } SDL_ControllerMappingPriority; +#define _guarded SDL_GUARDED_BY(SDL_joystick_lock) + typedef struct _ControllerMapping_t { - SDL_JoystickGUID guid; - char *name; - char *mapping; - SDL_ControllerMappingPriority priority; - struct _ControllerMapping_t *next; + SDL_JoystickGUID guid _guarded; + char *name _guarded; + char *mapping _guarded; + SDL_ControllerMappingPriority priority _guarded; + struct _ControllerMapping_t *next _guarded; } ControllerMapping_t; +#undef _guarded + static SDL_JoystickGUID s_zeroGUID; -static ControllerMapping_t *s_pSupportedControllers = NULL; -static ControllerMapping_t *s_pDefaultMapping = NULL; -static ControllerMapping_t *s_pXInputMapping = NULL; +static ControllerMapping_t *s_pSupportedControllers SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static ControllerMapping_t *s_pDefaultMapping SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static ControllerMapping_t *s_pXInputMapping SDL_GUARDED_BY(SDL_joystick_lock) = NULL; static char gamecontroller_magic; +#define _guarded SDL_GUARDED_BY(SDL_joystick_lock) + /* The SDL game controller structure */ struct _SDL_GameController { - const void *magic; + const void *magic _guarded; - SDL_Joystick *joystick; /* underlying joystick device */ - int ref_count; + SDL_Joystick *joystick _guarded; /* underlying joystick device */ + int ref_count _guarded; - const char *name; - ControllerMapping_t *mapping; - int num_bindings; - SDL_ExtendedGameControllerBind *bindings; - SDL_ExtendedGameControllerBind **last_match_axis; - Uint8 *last_hat_mask; - Uint32 guide_button_down; + const char *name _guarded; + SDL_GameControllerType type _guarded; + ControllerMapping_t *mapping _guarded; + int num_bindings _guarded; + SDL_ExtendedGameControllerBind *bindings _guarded; + SDL_ExtendedGameControllerBind **last_match_axis _guarded; + Uint8 *last_hat_mask _guarded; + Uint32 guide_button_down _guarded; - struct _SDL_GameController *next; /* pointer to next game controller we have allocated */ + struct _SDL_GameController *next _guarded; /* pointer to next game controller we have allocated */ }; +#undef _guarded -#define CHECK_GAMECONTROLLER_MAGIC(gamecontroller, retval) \ +#define CHECK_GAMECONTROLLER_MAGIC(gamecontroller, retval) \ if (!gamecontroller || gamecontroller->magic != &gamecontroller_magic || \ - !SDL_PrivateJoystickValid(gamecontroller->joystick)) { \ - SDL_InvalidParamError("gamecontroller"); \ - return retval; \ - } - -typedef struct -{ - int num_entries; - int max_entries; - Uint32 *entries; -} SDL_vidpid_list; - -static SDL_vidpid_list SDL_allowed_controllers; -static SDL_vidpid_list SDL_ignored_controllers; - -static void -SDL_LoadVIDPIDListFromHint(const char *hint, SDL_vidpid_list *list) -{ - Uint32 entry; - char *spot; - char *file = NULL; - - list->num_entries = 0; - - if (hint && *hint == '@') { - spot = file = (char *)SDL_LoadFile(hint+1, NULL); - } else { - spot = (char *)hint; - } - - if (!spot) { - return; - } - - while ((spot = SDL_strstr(spot, "0x")) != NULL) { - entry = (Uint16)SDL_strtol(spot, &spot, 0); - entry <<= 16; - spot = SDL_strstr(spot, "0x"); - if (!spot) { - break; - } - entry |= (Uint16)SDL_strtol(spot, &spot, 0); - - if (list->num_entries == list->max_entries) { - int max_entries = list->max_entries + 16; - Uint32 *entries = (Uint32 *)SDL_realloc(list->entries, max_entries*sizeof(*list->entries)); - if (entries == NULL) { - /* Out of memory, go with what we have already */ - break; - } - list->entries = entries; - list->max_entries = max_entries; - } - list->entries[list->num_entries++] = entry; - } - - if (file) { - SDL_free(file); + !SDL_PrivateJoystickValid(gamecontroller->joystick)) { \ + SDL_InvalidParamError("gamecontroller"); \ + SDL_UnlockJoysticks(); \ + return retval; \ } -} -static void SDLCALL -SDL_GameControllerIgnoreDevicesChanged(void *userdata, const char *name, const char *oldValue, const char *hint) -{ - SDL_LoadVIDPIDListFromHint(hint, &SDL_ignored_controllers); -} - -static void SDLCALL -SDL_GameControllerIgnoreDevicesExceptChanged(void *userdata, const char *name, const char *oldValue, const char *hint) -{ - SDL_LoadVIDPIDListFromHint(hint, &SDL_allowed_controllers); -} +static SDL_vidpid_list SDL_allowed_controllers = { + SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT, 0, 0, NULL, + NULL, 0, 0, NULL, + 0, NULL, + SDL_FALSE +}; +static SDL_vidpid_list SDL_ignored_controllers = { + SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES, 0, 0, NULL, + NULL, 0, 0, NULL, + 0, NULL, + SDL_FALSE +}; static ControllerMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_ControllerMappingPriority priority); static int SDL_PrivateGameControllerAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis, Sint16 value); @@ -222,9 +185,9 @@ static SDL_bool HasSameOutput(SDL_ExtendedGameControllerBind *a, SDL_ExtendedGam } if (a->outputType == SDL_CONTROLLER_BINDTYPE_AXIS) { - return (a->output.axis.axis == b->output.axis.axis); + return a->output.axis.axis == b->output.axis.axis; } else { - return (a->output.button == b->output.button); + return a->output.button == b->output.button; } } @@ -243,7 +206,7 @@ static void HandleJoystickAxis(SDL_GameController *gamecontroller, int axis, int SDL_ExtendedGameControllerBind *last_match; SDL_ExtendedGameControllerBind *match = NULL; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); + SDL_AssertJoysticksLocked(); last_match = gamecontroller->last_match_axis[axis]; for (i = 0; i < gamecontroller->num_bindings; ++i) { @@ -296,7 +259,7 @@ static void HandleJoystickButton(SDL_GameController *gamecontroller, int button, { int i; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); + SDL_AssertJoysticksLocked(); for (i = 0; i < gamecontroller->num_bindings; ++i) { SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; @@ -318,7 +281,7 @@ static void HandleJoystickHat(SDL_GameController *gamecontroller, int hat, Uint8 int i; Uint8 last_mask, changed_mask; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); + SDL_AssertJoysticksLocked(); last_mask = gamecontroller->last_hat_mask[hat]; changed_mask = (last_mask ^ value); @@ -341,7 +304,6 @@ static void HandleJoystickHat(SDL_GameController *gamecontroller, int hat, Uint8 gamecontroller->last_hat_mask[hat] = value; } - /* The joystick layer will _also_ send events to recenter before disconnect, but it has to make (sometimes incorrect) guesses at what being "centered" is. The game controller layer, however, can set a definite logical idle @@ -353,96 +315,90 @@ static void RecenterGameController(SDL_GameController *gamecontroller) SDL_GameControllerButton button; SDL_GameControllerAxis axis; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); - - for (button = (SDL_GameControllerButton) 0; button < SDL_CONTROLLER_BUTTON_MAX; button++) { + for (button = (SDL_GameControllerButton)0; button < SDL_CONTROLLER_BUTTON_MAX; button++) { if (SDL_GameControllerGetButton(gamecontroller, button)) { SDL_PrivateGameControllerButton(gamecontroller, button, SDL_RELEASED); } } - for (axis = (SDL_GameControllerAxis) 0; axis < SDL_CONTROLLER_AXIS_MAX; axis++) { + for (axis = (SDL_GameControllerAxis)0; axis < SDL_CONTROLLER_AXIS_MAX; axis++) { if (SDL_GameControllerGetAxis(gamecontroller, axis) != 0) { SDL_PrivateGameControllerAxis(gamecontroller, axis, 0); } } } - /* * Event filter to fire controller events from joystick ones */ -static int SDLCALL SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event) +static int SDLCALL SDL_GameControllerEventWatcher(void *userdata, SDL_Event *event) { - switch(event->type) { + SDL_GameController *controller; + + switch (event->type) { case SDL_JOYAXISMOTION: - { - SDL_GameController *controllerlist = SDL_gamecontrollers; - while (controllerlist) { - if (controllerlist->joystick->instance_id == event->jaxis.which) { - HandleJoystickAxis(controllerlist, event->jaxis.axis, event->jaxis.value); - break; - } - controllerlist = controllerlist->next; + { + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->joystick->instance_id == event->jaxis.which) { + HandleJoystickAxis(controller, event->jaxis.axis, event->jaxis.value); + break; } } - break; + } break; case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: - { - SDL_GameController *controllerlist = SDL_gamecontrollers; - while (controllerlist) { - if (controllerlist->joystick->instance_id == event->jbutton.which) { - HandleJoystickButton(controllerlist, event->jbutton.button, event->jbutton.state); - break; - } - controllerlist = controllerlist->next; + { + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->joystick->instance_id == event->jbutton.which) { + HandleJoystickButton(controller, event->jbutton.button, event->jbutton.state); + break; } } - break; + } break; case SDL_JOYHATMOTION: - { - SDL_GameController *controllerlist = SDL_gamecontrollers; - while (controllerlist) { - if (controllerlist->joystick->instance_id == event->jhat.which) { - HandleJoystickHat(controllerlist, event->jhat.hat, event->jhat.value); - break; - } - controllerlist = controllerlist->next; + { + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->joystick->instance_id == event->jhat.which) { + HandleJoystickHat(controller, event->jhat.hat, event->jhat.value); + break; } } - break; + } break; case SDL_JOYDEVICEADDED: - { - if (SDL_IsGameController(event->jdevice.which)) { - SDL_Event deviceevent; - deviceevent.type = SDL_CONTROLLERDEVICEADDED; - deviceevent.cdevice.which = event->jdevice.which; - SDL_PushEvent(&deviceevent); - } + { + if (SDL_IsGameController(event->jdevice.which)) { + SDL_Event deviceevent; + deviceevent.type = SDL_CONTROLLERDEVICEADDED; + deviceevent.cdevice.which = event->jdevice.which; + SDL_PushEvent(&deviceevent); } - break; + } break; case SDL_JOYDEVICEREMOVED: - { - SDL_GameController *controllerlist = SDL_gamecontrollers; - while (controllerlist) { - if (controllerlist->joystick->instance_id == event->jdevice.which) { - RecenterGameController(controllerlist); - break; - } - controllerlist = controllerlist->next; + { + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->joystick->instance_id == event->jdevice.which) { + RecenterGameController(controller); + break; } + } - /* We don't know if this was a game controller, so go ahead and send an event */ - { - SDL_Event deviceevent; + /* We don't know if this was a game controller, so go ahead and send an event */ + { + SDL_Event deviceevent; - deviceevent.type = SDL_CONTROLLERDEVICEREMOVED; - deviceevent.cdevice.which = event->jdevice.which; - SDL_PushEvent(&deviceevent); - } + deviceevent.type = SDL_CONTROLLERDEVICEREMOVED; + deviceevent.cdevice.which = event->jdevice.which; + SDL_PushEvent(&deviceevent); } - break; + } break; default: break; } @@ -465,8 +421,8 @@ static ControllerMapping_t *SDL_CreateMappingForAndroidController(SDL_JoystickGU int button_mask; int axis_mask; - button_mask = SDL_SwapLE16(*(Uint16*)(&guid.data[sizeof(guid.data)-4])); - axis_mask = SDL_SwapLE16(*(Uint16*)(&guid.data[sizeof(guid.data)-2])); + button_mask = SDL_SwapLE16(*(Uint16 *)(&guid.data[sizeof(guid.data) - 4])); + axis_mask = SDL_SwapLE16(*(Uint16 *)(&guid.data[sizeof(guid.data) - 2])); if (!button_mask && !axis_mask) { /* Accelerometer, shouldn't have a game controller mapping */ return NULL; @@ -549,8 +505,7 @@ static ControllerMapping_t *SDL_CreateMappingForAndroidController(SDL_JoystickGU SDL_strlcat(mapping_string, "righttrigger:a5,", sizeof(mapping_string)); } - return SDL_PrivateAddMappingForGUID(guid, mapping_string, - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } #endif /* __ANDROID__ */ @@ -569,15 +524,30 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); if ((vendor == USB_VENDOR_NINTENDO && product == USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER) || - (vendor == USB_VENDOR_DRAGONRISE && product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER)) { + (vendor == USB_VENDOR_DRAGONRISE && + (product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1 || + product == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2))) { /* GameCube driver has 12 buttons and 6 axes */ - SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3,start:b8,x:b2,y:b3,", sizeof(mapping_string)); + SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b2,y:b3,", sizeof(mapping_string)); } else if (vendor == USB_VENDOR_NINTENDO && - guid.data[15] != k_eSwitchDeviceInfoControllerType_Unknown && - guid.data[15] != k_eSwitchDeviceInfoControllerType_ProController && - guid.data[15] != k_eWiiExtensionControllerType_Gamepad && - guid.data[15] != k_eWiiExtensionControllerType_WiiUPro) { + (guid.data[15] == k_eSwitchDeviceInfoControllerType_HVCLeft || + guid.data[15] == k_eSwitchDeviceInfoControllerType_HVCRight || + guid.data[15] == k_eSwitchDeviceInfoControllerType_NESLeft || + guid.data[15] == k_eSwitchDeviceInfoControllerType_NESRight || + guid.data[15] == k_eSwitchDeviceInfoControllerType_SNES || + guid.data[15] == k_eSwitchDeviceInfoControllerType_N64 || + guid.data[15] == k_eSwitchDeviceInfoControllerType_SEGA_Genesis || + guid.data[15] == k_eWiiExtensionControllerType_None || + guid.data[15] == k_eWiiExtensionControllerType_Nunchuk || + guid.data[15] == k_eSwitchDeviceInfoControllerType_JoyConLeft || + guid.data[15] == k_eSwitchDeviceInfoControllerType_JoyConRight)) { switch (guid.data[15]) { + case k_eSwitchDeviceInfoControllerType_HVCLeft: + SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string)); + break; + case k_eSwitchDeviceInfoControllerType_HVCRight: + SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,", sizeof(mapping_string)); + break; case k_eSwitchDeviceInfoControllerType_NESLeft: case k_eSwitchDeviceInfoControllerType_NESRight: SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,start:b6,", sizeof(mapping_string)); @@ -589,23 +559,22 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b15,", sizeof(mapping_string)); break; case k_eSwitchDeviceInfoControllerType_SEGA_Genesis: - SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,rightshoulder:b10,righttrigger:a5,start:b6,misc1:b15,", sizeof(mapping_string)); + SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b15,", sizeof(mapping_string)); break; case k_eWiiExtensionControllerType_None: SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,start:b6,x:b2,y:b3,", sizeof(mapping_string)); break; case k_eWiiExtensionControllerType_Nunchuk: - { - /* FIXME: Should we map this to the left or right side? */ - const SDL_bool map_nunchuck_left_side = SDL_TRUE; + { + /* FIXME: Should we map this to the left or right side? */ + const SDL_bool map_nunchuck_left_side = SDL_TRUE; - if (map_nunchuck_left_side) { - SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,start:b6,x:b2,y:b3,", sizeof(mapping_string)); - } else { - SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,rightshoulder:b9,righttrigger:a4,rightx:a0,righty:a1,start:b6,x:b2,y:b3,", sizeof(mapping_string)); - } + if (map_nunchuck_left_side) { + SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,start:b6,x:b2,y:b3,", sizeof(mapping_string)); + } else { + SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,rightshoulder:b9,righttrigger:a4,rightx:a0,righty:a1,start:b6,x:b2,y:b3,", sizeof(mapping_string)); } - break; + } break; default: if (SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS, SDL_FALSE)) { /* Vertical mode */ @@ -649,6 +618,10 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI case SDL_CONTROLLER_TYPE_PS5: /* PS5 controllers have a microphone button and an additional touchpad button */ SDL_strlcat(mapping_string, "touchpad:b15,misc1:b16,", sizeof(mapping_string)); + /* DualSense Edge controllers have paddles */ + if (SDL_IsJoystickDualSenseEdge(vendor, product)) { + SDL_strlcat(mapping_string, "paddle1:b20,paddle2:b19,paddle3:b18,paddle4:b17,", sizeof(mapping_string)); + } break; case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO: /* Nintendo Switch Pro controllers have a screenshot button */ @@ -681,8 +654,7 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI } } - return SDL_PrivateAddMappingForGUID(guid, mapping_string, - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } /* @@ -696,8 +668,7 @@ static ControllerMapping_t *SDL_CreateMappingForRAWINPUTController(SDL_JoystickG SDL_strlcpy(mapping_string, "none,*,", sizeof(mapping_string)); SDL_strlcat(mapping_string, "a:b0,b:b1,x:b2,y:b3,back:b6,guide:b10,start:b7,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,", sizeof(mapping_string)); - return SDL_PrivateAddMappingForGUID(guid, mapping_string, - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } /* @@ -715,21 +686,20 @@ static ControllerMapping_t *SDL_CreateMappingForWGIController(SDL_JoystickGUID g SDL_strlcpy(mapping_string, "none,*,", sizeof(mapping_string)); SDL_strlcat(mapping_string, "a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:b10,dpdown:b12,dpleft:b13,dpright:b11,leftx:a1,lefty:a0~,rightx:a3,righty:a2~,lefttrigger:a4,righttrigger:a5,", sizeof(mapping_string)); - return SDL_PrivateAddMappingForGUID(guid, mapping_string, - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } /* * Helper function to scan the mappings database for a controller with the specified GUID */ -static ControllerMapping_t *SDL_PrivateMatchControllerMappingForGUID(SDL_JoystickGUID guid, SDL_bool match_crc, SDL_bool match_version) +static ControllerMapping_t *SDL_PrivateMatchControllerMappingForGUID(SDL_JoystickGUID guid, SDL_bool match_version, SDL_bool exact_match_crc) { - ControllerMapping_t *mapping; + ControllerMapping_t *mapping, *best_match = NULL; Uint16 crc = 0; - if (match_crc) { - SDL_GetJoystickGUIDInfo(guid, NULL, NULL, NULL, &crc); - } + SDL_AssertJoysticksLocked(); + + SDL_GetJoystickGUIDInfo(guid, NULL, NULL, NULL, &crc); /* Clear the CRC from the GUID for matching, the mappings never include it in the GUID */ SDL_SetJoystickGUIDCRC(&guid, 0); @@ -751,82 +721,120 @@ static ControllerMapping_t *SDL_PrivateMatchControllerMappingForGUID(SDL_Joystic } if (SDL_memcmp(&guid, &mapping_guid, sizeof(guid)) == 0) { - Uint16 mapping_crc = 0; const char *crc_string = SDL_strstr(mapping->mapping, SDL_CONTROLLER_CRC_FIELD); if (crc_string) { - mapping_crc = (Uint16)SDL_strtol(crc_string + SDL_CONTROLLER_CRC_FIELD_SIZE, NULL, 16); - } - if (crc == mapping_crc) { + Uint16 mapping_crc = (Uint16)SDL_strtol(crc_string + SDL_CONTROLLER_CRC_FIELD_SIZE, NULL, 16); + + if (mapping_crc != crc) { + /* This mapping specified a CRC and they don't match */ + continue; + } + + /* An exact match, including CRC */ return mapping; + } else if (crc && exact_match_crc) { + return NULL; + } + + if (!best_match) { + best_match = mapping; } } } - return NULL; + return best_match; } /* * Helper function to scan the mappings database for a controller with the specified GUID */ -static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID guid) +static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID guid, SDL_bool adding_mapping) { ControllerMapping_t *mapping; - Uint16 vendor, product, crc; - - SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, &crc); - if (crc) { - /* First check for exact CRC matching */ - mapping = SDL_PrivateMatchControllerMappingForGUID(guid, SDL_TRUE, SDL_TRUE); - if (mapping) { - return mapping; - } - } - /* Now check for a mapping without CRC */ - mapping = SDL_PrivateMatchControllerMappingForGUID(guid, SDL_FALSE, SDL_TRUE); + mapping = SDL_PrivateMatchControllerMappingForGUID(guid, SDL_TRUE, adding_mapping); if (mapping) { return mapping; } - if (vendor && product) { - /* Try again, ignoring the version */ - if (crc) { - mapping = SDL_PrivateMatchControllerMappingForGUID(guid, SDL_TRUE, SDL_FALSE); - if (mapping) { - return mapping; - } - } + if (adding_mapping) { + /* We didn't find an existing mapping */ + return NULL; + } + + /* Try harder to get the best match, or create a mapping */ + if (SDL_JoystickGUIDUsesVersion(guid)) { + /* Try again, ignoring the version */ mapping = SDL_PrivateMatchControllerMappingForGUID(guid, SDL_FALSE, SDL_FALSE); if (mapping) { return mapping; } } -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT if (SDL_IsJoystickXInput(guid)) { /* This is an XInput device */ return s_pXInputMapping; } #endif - if (!mapping) { - if (SDL_IsJoystickHIDAPI(guid)) { - mapping = SDL_CreateMappingForHIDAPIController(guid); - } else if (SDL_IsJoystickRAWINPUT(guid)) { - mapping = SDL_CreateMappingForRAWINPUTController(guid); - } else if (SDL_IsJoystickWGI(guid)) { - mapping = SDL_CreateMappingForWGIController(guid); - } else if (SDL_IsJoystickVirtual(guid)) { - /* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */ + if (SDL_IsJoystickHIDAPI(guid)) { + mapping = SDL_CreateMappingForHIDAPIController(guid); + } else if (SDL_IsJoystickRAWINPUT(guid)) { + mapping = SDL_CreateMappingForRAWINPUTController(guid); + } else if (SDL_IsJoystickWGI(guid)) { + mapping = SDL_CreateMappingForWGIController(guid); + } else if (SDL_IsJoystickVirtual(guid)) { + /* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */ #ifdef __ANDROID__ - } else { - mapping = SDL_CreateMappingForAndroidController(guid); + } else { + mapping = SDL_CreateMappingForAndroidController(guid); #endif - } } return mapping; } -static const char* map_StringForControllerAxis[] = { +static const char *map_StringForGameControllerType[] = { + "unknown", + "xbox360", + "xboxone", + "ps3", + "ps4", + "switchpro", + "virtual", + "ps5", + "amazonluna", + "googlestadia", + "nvidiashield", + "joyconleft", + "joyconright", + "joyconpair" +}; +SDL_COMPILE_TIME_ASSERT(map_StringForGameControllerType, SDL_arraysize(map_StringForGameControllerType) == SDL_CONTROLLER_TYPE_MAX); + +/* + * convert a string to its enum equivalent + */ +SDL_GameControllerType SDL_GetGameControllerTypeFromString(const char *str) +{ + int i; + + if (!str || str[0] == '\0') { + return SDL_CONTROLLER_TYPE_UNKNOWN; + } + + if (*str == '+' || *str == '-') { + ++str; + } + + for (i = 0; i < SDL_arraysize(map_StringForGameControllerType); ++i) { + if (SDL_strcasecmp(str, map_StringForGameControllerType[i]) == 0) { + return (SDL_GameControllerType)i; + } + } + return SDL_CONTROLLER_TYPE_UNKNOWN; +} + +static const char *map_StringForControllerAxis[] = { "leftx", "lefty", "rightx", @@ -839,21 +847,22 @@ static const char* map_StringForControllerAxis[] = { /* * convert a string to its enum equivalent */ -SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString) +SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *str) { int entry; - if (pchString && (*pchString == '+' || *pchString == '-')) { - ++pchString; + if (str == NULL || str[0] == '\0') { + return SDL_CONTROLLER_AXIS_INVALID; } - if (!pchString || !pchString[0]) { - return SDL_CONTROLLER_AXIS_INVALID; + if (*str == '+' || *str == '-') { + ++str; } for (entry = 0; map_StringForControllerAxis[entry]; ++entry) { - if (!SDL_strcasecmp(pchString, map_StringForControllerAxis[entry])) - return (SDL_GameControllerAxis) entry; + if (SDL_strcasecmp(str, map_StringForControllerAxis[entry]) == 0) { + return (SDL_GameControllerAxis)entry; + } } return SDL_CONTROLLER_AXIS_INVALID; } @@ -861,7 +870,7 @@ SDL_GameControllerAxis SDL_GameControllerGetAxisFromString(const char *pchString /* * convert an enum to its string equivalent */ -const char* SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis) +const char *SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis) { if (axis > SDL_CONTROLLER_AXIS_INVALID && axis < SDL_CONTROLLER_AXIS_MAX) { return map_StringForControllerAxis[axis]; @@ -869,7 +878,7 @@ const char* SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis) return NULL; } -static const char* map_StringForControllerButton[] = { +static const char *map_StringForControllerButton[] = { "a", "b", "x", @@ -897,15 +906,17 @@ static const char* map_StringForControllerButton[] = { /* * convert a string to its enum equivalent */ -SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchString) +SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *str) { int entry; - if (!pchString || !pchString[0]) + if (str == NULL || str[0] == '\0') { return SDL_CONTROLLER_BUTTON_INVALID; + } for (entry = 0; map_StringForControllerButton[entry]; ++entry) { - if (SDL_strcasecmp(pchString, map_StringForControllerButton[entry]) == 0) - return (SDL_GameControllerButton) entry; + if (SDL_strcasecmp(str, map_StringForControllerButton[entry]) == 0) { + return (SDL_GameControllerButton)entry; + } } return SDL_CONTROLLER_BUTTON_INVALID; } @@ -913,10 +924,10 @@ SDL_GameControllerButton SDL_GameControllerGetButtonFromString(const char *pchSt /* * convert an enum to its string equivalent */ -const char* SDL_GameControllerGetStringForButton(SDL_GameControllerButton axis) +const char *SDL_GameControllerGetStringForButton(SDL_GameControllerButton button) { - if (axis > SDL_CONTROLLER_BUTTON_INVALID && axis < SDL_CONTROLLER_BUTTON_MAX) { - return map_StringForControllerButton[axis]; + if (button > SDL_CONTROLLER_BUTTON_INVALID && button < SDL_CONTROLLER_BUTTON_MAX) { + return map_StringForControllerButton[button]; } return NULL; } @@ -933,7 +944,7 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro char half_axis_input = 0; char half_axis_output = 0; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); + SDL_AssertJoysticksLocked(); if (*szGameButton == '+' || *szGameButton == '-') { half_axis_output = *szGameButton++; @@ -974,7 +985,7 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro invert_input = SDL_TRUE; } - if (szJoystickButton[0] == 'a' && SDL_isdigit((unsigned char) szJoystickButton[1])) { + if (szJoystickButton[0] == 'a' && SDL_isdigit((unsigned char)szJoystickButton[1])) { bind.inputType = SDL_CONTROLLER_BINDTYPE_AXIS; bind.input.axis.axis = SDL_atoi(&szJoystickButton[1]); if (half_axis_input == '+') { @@ -992,11 +1003,11 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro bind.input.axis.axis_min = bind.input.axis.axis_max; bind.input.axis.axis_max = tmp; } - } else if (szJoystickButton[0] == 'b' && SDL_isdigit((unsigned char) szJoystickButton[1])) { + } else if (szJoystickButton[0] == 'b' && SDL_isdigit((unsigned char)szJoystickButton[1])) { bind.inputType = SDL_CONTROLLER_BINDTYPE_BUTTON; bind.input.button = SDL_atoi(&szJoystickButton[1]); - } else if (szJoystickButton[0] == 'h' && SDL_isdigit((unsigned char) szJoystickButton[1]) && - szJoystickButton[2] == '.' && SDL_isdigit((unsigned char) szJoystickButton[3])) { + } else if (szJoystickButton[0] == 'h' && SDL_isdigit((unsigned char)szJoystickButton[1]) && + szJoystickButton[2] == '.' && SDL_isdigit((unsigned char)szJoystickButton[3])) { int hat = SDL_atoi(&szJoystickButton[1]); int mask = SDL_atoi(&szJoystickButton[3]); bind.inputType = SDL_CONTROLLER_BINDTYPE_HAT; @@ -1017,12 +1028,10 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro gamecontroller->bindings[gamecontroller->num_bindings - 1] = bind; } - /* * given a controller mapping string update our mapping object */ -static void -SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecontroller, const char *pchString) +static void SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecontroller, const char *pchString) { char szGameButton[20]; char szJoystickButton[20]; @@ -1030,8 +1039,6 @@ SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecon int i = 0; const char *pchPos = pchString; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); - SDL_zeroa(szGameButton); SDL_zeroa(szJoystickButton); @@ -1050,6 +1057,7 @@ SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecon } else if (bGameButton) { if (i >= sizeof(szGameButton)) { + szGameButton[sizeof(szGameButton) - 1] = '\0'; SDL_SetError("Button name too large: %s", szGameButton); return; } @@ -1057,6 +1065,7 @@ SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecon i++; } else { if (i >= sizeof(szJoystickButton)) { + szJoystickButton[sizeof(szJoystickButton) - 1] = '\0'; SDL_SetError("Joystick button name too large: %s", szJoystickButton); return; } @@ -1072,6 +1081,31 @@ SDL_PrivateGameControllerParseControllerConfigString(SDL_GameController *gamecon } } +static void SDL_UpdateGameControllerType(SDL_GameController *gamecontroller) +{ + char *type_string, *comma; + + SDL_AssertJoysticksLocked(); + + gamecontroller->type = SDL_CONTROLLER_TYPE_UNKNOWN; + + type_string = SDL_strstr(gamecontroller->mapping->mapping, SDL_CONTROLLER_TYPE_FIELD); + if (type_string) { + type_string += SDL_CONTROLLER_TYPE_FIELD_SIZE; + comma = SDL_strchr(type_string, ','); + if (comma) { + *comma = '\0'; + gamecontroller->type = SDL_GetGameControllerTypeFromString(type_string); + *comma = ','; + } else { + gamecontroller->type = SDL_GetGameControllerTypeFromString(type_string); + } + } + if (gamecontroller->type == SDL_CONTROLLER_TYPE_UNKNOWN) { + gamecontroller->type = SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetGUID(gamecontroller->joystick), SDL_JoystickName(gamecontroller->joystick)); + } +} + /* * Make a new button mapping struct */ @@ -1079,17 +1113,19 @@ static void SDL_PrivateLoadButtonMapping(SDL_GameController *gamecontroller, Con { int i; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, ); + SDL_AssertJoysticksLocked(); gamecontroller->name = pControllerMapping->name; gamecontroller->num_bindings = 0; gamecontroller->mapping = pControllerMapping; - if (gamecontroller->joystick->naxes) { + if (gamecontroller->joystick->naxes != 0 && gamecontroller->last_match_axis) { SDL_memset(gamecontroller->last_match_axis, 0, gamecontroller->joystick->naxes * sizeof(*gamecontroller->last_match_axis)); } SDL_PrivateGameControllerParseControllerConfigString(gamecontroller, pControllerMapping->mapping); + SDL_UpdateGameControllerType(gamecontroller); + /* Set the zero point for triggers */ for (i = 0; i < gamecontroller->num_bindings; ++i) { SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; @@ -1099,13 +1135,12 @@ static void SDL_PrivateLoadButtonMapping(SDL_GameController *gamecontroller, Con binding->output.axis.axis == SDL_CONTROLLER_AXIS_TRIGGERRIGHT)) { if (binding->input.axis.axis < gamecontroller->joystick->naxes) { gamecontroller->joystick->axes[binding->input.axis.axis].value = - gamecontroller->joystick->axes[binding->input.axis.axis].zero = (Sint16)binding->input.axis.axis_min; + gamecontroller->joystick->axes[binding->input.axis.axis].zero = (Sint16)binding->input.axis.axis_min; } } } } - /* * grab the guid string from a mapping string */ @@ -1130,7 +1165,7 @@ static char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping) SDL_memcpy(&pchGUID[8], &pchGUID[0], 4); SDL_memcpy(&pchGUID[0], "03000000", 8); } -#elif __MACOSX__ +#elif defined(__MACOSX__) if (SDL_strlen(pchGUID) == 32 && SDL_memcmp(&pchGUID[4], "000000000000", 12) == 0 && SDL_memcmp(&pchGUID[20], "000000000000", 12) == 0) { @@ -1144,7 +1179,6 @@ static char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping) return NULL; } - /* * grab the name string from a mapping string */ @@ -1154,12 +1188,14 @@ static char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping) char *pchName; pFirstComma = SDL_strchr(pMapping, ','); - if (!pFirstComma) + if (!pFirstComma) { return NULL; + } pSecondComma = SDL_strchr(pFirstComma + 1, ','); - if (!pSecondComma) + if (!pSecondComma) { return NULL; + } pchName = SDL_malloc(pSecondComma - pFirstComma); if (!pchName) { @@ -1171,7 +1207,6 @@ static char *SDL_PrivateGetControllerNameFromMappingString(const char *pMapping) return pchName; } - /* * grab the button mapping string from a mapping string */ @@ -1180,12 +1215,14 @@ static char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMappi const char *pFirstComma, *pSecondComma; pFirstComma = SDL_strchr(pMapping, ','); - if (!pFirstComma) + if (!pFirstComma) { return NULL; + } pSecondComma = SDL_strchr(pFirstComma + 1, ','); - if (!pSecondComma) + if (!pSecondComma) { return NULL; + } return SDL_strdup(pSecondComma + 1); /* mapping is everything after the 3rd comma */ } @@ -1195,35 +1232,36 @@ static char *SDL_PrivateGetControllerMappingFromMappingString(const char *pMappi */ static void SDL_PrivateGameControllerRefreshMapping(ControllerMapping_t *pControllerMapping) { - SDL_GameController *gamecontrollerlist = SDL_gamecontrollers; - while (gamecontrollerlist) { - if (gamecontrollerlist->mapping == pControllerMapping) { - /* Not really threadsafe. Should this lock access within SDL_GameControllerEventWatcher? */ - SDL_PrivateLoadButtonMapping(gamecontrollerlist, pControllerMapping); + SDL_GameController *controller; + + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->mapping == pControllerMapping) { + SDL_PrivateLoadButtonMapping(controller, pControllerMapping); { SDL_Event event; event.type = SDL_CONTROLLERDEVICEREMAPPED; - event.cdevice.which = gamecontrollerlist->joystick->instance_id; + event.cdevice.which = controller->joystick->instance_id; SDL_PushEvent(&event); } } - - gamecontrollerlist = gamecontrollerlist->next; } } /* * Helper function to add a mapping for a guid */ -static ControllerMapping_t * -SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_ControllerMappingPriority priority) +static ControllerMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_ControllerMappingPriority priority) { char *pchName; char *pchMapping; ControllerMapping_t *pControllerMapping; Uint16 crc; + SDL_AssertJoysticksLocked(); + pchName = SDL_PrivateGetControllerNameFromMappingString(mappingString); if (!pchName) { SDL_SetError("Couldn't parse name from %s", mappingString); @@ -1269,7 +1307,7 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, } } - pControllerMapping = SDL_PrivateMatchControllerMappingForGUID(jGUID, SDL_TRUE, SDL_TRUE); + pControllerMapping = SDL_PrivateGetControllerMappingForGUID(jGUID, SDL_TRUE); if (pControllerMapping) { /* Only overwrite the mapping if the priority is the same or higher. */ if (pControllerMapping->priority <= priority) { @@ -1308,9 +1346,9 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, /* Add the mapping to the end of the list */ ControllerMapping_t *pCurrMapping, *pPrevMapping; - for ( pPrevMapping = s_pSupportedControllers, pCurrMapping = pPrevMapping->next; - pCurrMapping; - pPrevMapping = pCurrMapping, pCurrMapping = pCurrMapping->next ) { + for (pPrevMapping = s_pSupportedControllers, pCurrMapping = pPrevMapping->next; + pCurrMapping; + pPrevMapping = pCurrMapping, pCurrMapping = pCurrMapping->next) { /* continue; */ } pPrevMapping->next = pControllerMapping; @@ -1329,24 +1367,21 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForNameAndGUID(const { ControllerMapping_t *mapping; - mapping = SDL_PrivateGetControllerMappingForGUID(guid); + SDL_AssertJoysticksLocked(); + + mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_FALSE); #ifdef __LINUX__ if (!mapping && name) { if (SDL_strstr(name, "Xbox 360 Wireless Receiver")) { /* The Linux driver xpad.c maps the wireless dpad to buttons */ SDL_bool existing; mapping = SDL_PrivateAddMappingForGUID(guid, -"none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); - } else if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) { - mapping = s_pXInputMapping; + "none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } } #endif /* __LINUX__ */ - if (!mapping) { - mapping = s_pDefaultMapping; - } return mapping; } @@ -1363,17 +1398,21 @@ static void SDL_PrivateAppendToMappingString(char *mapping_string, SDL_strlcat(mapping_string, input_name, mapping_string_len); SDL_strlcat(mapping_string, ":", mapping_string_len); switch (mapping->kind) { - case EMappingKind_Button: - SDL_snprintf(buffer, sizeof(buffer), "b%i", mapping->target); - break; - case EMappingKind_Axis: - SDL_snprintf(buffer, sizeof(buffer), "a%i", mapping->target); - break; - case EMappingKind_Hat: - SDL_snprintf(buffer, sizeof(buffer), "h%i.%i", mapping->target >> 4, mapping->target & 0x0F); - break; - default: - SDL_assert(SDL_FALSE); + case EMappingKind_Button: + (void)SDL_snprintf(buffer, sizeof(buffer), "b%i", mapping->target); + break; + case EMappingKind_Axis: + (void)SDL_snprintf(buffer, sizeof(buffer), "%sa%i%s", + mapping->half_axis_positive ? "+" : + mapping->half_axis_negative ? "-" : "", + mapping->target, + mapping->axis_reversed ? "~" : ""); + break; + case EMappingKind_Hat: + (void)SDL_snprintf(buffer, sizeof(buffer), "h%i.%i", mapping->target >> 4, mapping->target & 0x0F); + break; + default: + SDL_assert(SDL_FALSE); } SDL_strlcat(mapping_string, buffer, mapping_string_len); @@ -1398,7 +1437,7 @@ static ControllerMapping_t *SDL_PrivateGenerateAutomaticControllerMapping(const } } } - SDL_snprintf(mapping, sizeof(mapping), "none,%s,", name_string); + (void)SDL_snprintf(mapping, sizeof(mapping), "none,%s,", name_string); SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "a", &raw_map->a); SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "b", &raw_map->b); SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "x", &raw_map->x); @@ -1425,9 +1464,9 @@ static ControllerMapping_t *SDL_PrivateGenerateAutomaticControllerMapping(const SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "righty", &raw_map->righty); SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "lefttrigger", &raw_map->lefttrigger); SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "righttrigger", &raw_map->righttrigger); + SDL_PrivateAppendToMappingString(mapping, sizeof(mapping), "touchpad", &raw_map->touchpad); - return SDL_PrivateAddMappingForGUID(guid, mapping, - &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + return SDL_PrivateAddMappingForGUID(guid, mapping, &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); } static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) @@ -1436,12 +1475,11 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) SDL_JoystickGUID guid; ControllerMapping_t *mapping; - SDL_LockJoysticks(); + SDL_AssertJoysticksLocked(); if ((device_index < 0) || (device_index >= SDL_NumJoysticks())) { SDL_SetError("There are %d joysticks available", SDL_NumJoysticks()); - SDL_UnlockJoysticks(); - return (NULL); + return NULL; } name = SDL_JoystickNameForIndex(device_index); @@ -1456,34 +1494,35 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index) } } - SDL_UnlockJoysticks(); + if (!mapping) { + mapping = s_pDefaultMapping; + } return mapping; } /* * Add or update an entry into the Mappings Database */ -int -SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw) +int SDL_GameControllerAddMappingsFromRW(SDL_RWops *rw, int freerw) { const char *platform = SDL_GetPlatform(); int controllers = 0; char *buf, *line, *line_end, *tmp, *comma, line_platform[64]; size_t db_size, platform_len; - - if (rw == NULL) { + + if (!rw) { return SDL_SetError("Invalid RWops"); } db_size = (size_t)SDL_RWsize(rw); - + buf = (char *)SDL_malloc(db_size + 1); - if (buf == NULL) { + if (!buf) { if (freerw) { SDL_RWclose(rw); } return SDL_SetError("Could not allocate space to read DB into memory"); } - + if (SDL_RWread(rw, buf, db_size, 1) != 1) { if (freerw) { SDL_RWclose(rw); @@ -1491,28 +1530,28 @@ SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw) SDL_free(buf); return SDL_SetError("Could not read DB"); } - + if (freerw) { SDL_RWclose(rw); } - + buf[db_size] = '\0'; line = buf; - + while (line < buf + db_size) { line_end = SDL_strchr(line, '\n'); - if (line_end != NULL) { + if (line_end) { *line_end = '\0'; } else { line_end = buf + db_size; } - + /* Extract and verify the platform */ tmp = SDL_strstr(line, SDL_CONTROLLER_PLATFORM_FIELD); - if (tmp != NULL) { + if (tmp) { tmp += SDL_CONTROLLER_PLATFORM_FIELD_SIZE; comma = SDL_strchr(tmp, ','); - if (comma != NULL) { + if (comma) { platform_len = comma - tmp + 1; if (platform_len + 1 < SDL_arraysize(line_platform)) { SDL_strlcpy(line_platform, tmp, platform_len); @@ -1534,8 +1573,7 @@ SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw) /* * Add or update an entry into the Mappings Database with a priority */ -static int -SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMappingPriority priority) +static int SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMappingPriority priority) { char *pchGUID; SDL_JoystickGUID jGUID; @@ -1544,6 +1582,8 @@ SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMap SDL_bool existing = SDL_FALSE; ControllerMapping_t *pControllerMapping; + SDL_AssertJoysticksLocked(); + if (!mappingString) { return SDL_InvalidParamError("mappingString"); } @@ -1552,7 +1592,7 @@ SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMap const char *tmp; tmp = SDL_strstr(mappingString, SDL_CONTROLLER_HINT_FIELD); - if (tmp != NULL) { + if (tmp) { SDL_bool default_value, value, negate; int len; char hint[128]; @@ -1594,14 +1634,14 @@ SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMap const char *tmp; tmp = SDL_strstr(mappingString, SDL_CONTROLLER_SDKGE_FIELD); - if (tmp != NULL) { + if (tmp) { tmp += SDL_CONTROLLER_SDKGE_FIELD_SIZE; if (!(SDL_GetAndroidSDKVersion() >= SDL_atoi(tmp))) { return SDL_SetError("SDK version %d < minimum version %d", SDL_GetAndroidSDKVersion(), SDL_atoi(tmp)); } } tmp = SDL_strstr(mappingString, SDL_CONTROLLER_SDKLE_FIELD); - if (tmp != NULL) { + if (tmp) { tmp += SDL_CONTROLLER_SDKLE_FIELD_SIZE; if (!(SDL_GetAndroidSDKVersion() <= SDL_atoi(tmp))) { return SDL_SetError("SDK version %d > maximum version %d", SDL_GetAndroidSDKVersion(), SDL_atoi(tmp)); @@ -1642,41 +1682,54 @@ SDL_PrivateGameControllerAddMapping(const char *mappingString, SDL_ControllerMap /* * Add or update an entry into the Mappings Database */ -int -SDL_GameControllerAddMapping(const char *mappingString) +int SDL_GameControllerAddMapping(const char *mappingString) { - return SDL_PrivateGameControllerAddMapping(mappingString, SDL_CONTROLLER_MAPPING_PRIORITY_API); + int retval; + + SDL_LockJoysticks(); + { + retval = SDL_PrivateGameControllerAddMapping(mappingString, SDL_CONTROLLER_MAPPING_PRIORITY_API); + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the number of mappings installed */ -int -SDL_GameControllerNumMappings(void) +int SDL_GameControllerNumMappings(void) { int num_mappings = 0; - ControllerMapping_t *mapping; - for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) { - if (SDL_memcmp(&mapping->guid, &s_zeroGUID, sizeof(mapping->guid)) == 0) { - continue; + SDL_LockJoysticks(); + { + ControllerMapping_t *mapping; + + for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) { + if (SDL_memcmp(&mapping->guid, &s_zeroGUID, sizeof(mapping->guid)) == 0) { + continue; + } + ++num_mappings; } - ++num_mappings; } + SDL_UnlockJoysticks(); + return num_mappings; } /* * Create a mapping string for a mapping */ -static char * -CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID guid) +static char *CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID guid) { char *pMappingString, *pPlatformString; char pchGUID[33]; size_t needed; const char *platform = SDL_GetPlatform(); + SDL_AssertJoysticksLocked(); + SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ @@ -1696,7 +1749,7 @@ CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID guid) return NULL; } - SDL_snprintf(pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); + (void)SDL_snprintf(pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); if (!SDL_strstr(mapping->mapping, SDL_CONTROLLER_PLATFORM_FIELD)) { if (mapping->mapping[SDL_strlen(mapping->mapping) - 1] != ',') { @@ -1720,52 +1773,74 @@ CreateMappingString(ControllerMapping_t *mapping, SDL_JoystickGUID guid) /* * Get the mapping at a particular index. */ -char * -SDL_GameControllerMappingForIndex(int mapping_index) +char *SDL_GameControllerMappingForIndex(int mapping_index) { - ControllerMapping_t *mapping; + char *retval = NULL; - for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) { - if (SDL_memcmp(&mapping->guid, &s_zeroGUID, sizeof(mapping->guid)) == 0) { - continue; - } - if (mapping_index == 0) { - return CreateMappingString(mapping, mapping->guid); + SDL_LockJoysticks(); + { + ControllerMapping_t *mapping; + + for (mapping = s_pSupportedControllers; mapping; mapping = mapping->next) { + if (SDL_memcmp(&mapping->guid, &s_zeroGUID, sizeof(mapping->guid)) == 0) { + continue; + } + if (mapping_index == 0) { + retval = CreateMappingString(mapping, mapping->guid); + break; + } + --mapping_index; } - --mapping_index; } - SDL_SetError("Mapping not available"); - return NULL; + SDL_UnlockJoysticks(); + + if (!retval) { + SDL_SetError("Mapping not available"); + } + return retval; } /* * Get the mapping string for this GUID */ -char * -SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) +char *SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid) { - ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(guid); - if (mapping) { - return CreateMappingString(mapping, guid); - } else { - SDL_SetError("Mapping not available"); + char *retval; + + SDL_LockJoysticks(); + { + ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_FALSE); + if (mapping) { + retval = CreateMappingString(mapping, guid); + } else { + SDL_SetError("Mapping not available"); + retval = NULL; + } } - return NULL; + SDL_UnlockJoysticks(); + + return retval; } /* * Get the mapping string for this device */ -char * -SDL_GameControllerMapping(SDL_GameController *gamecontroller) +char *SDL_GameControllerMapping(SDL_GameController *gamecontroller) { - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + char *retval; + + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); - return CreateMappingString(gamecontroller->mapping, gamecontroller->joystick->guid); + retval = CreateMappingString(gamecontroller->mapping, gamecontroller->joystick->guid); + } + SDL_UnlockJoysticks(); + + return retval; } -static void -SDL_GameControllerLoadHints() +static void SDL_GameControllerLoadHints(void) { const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG); if (hint && hint[0]) { @@ -1778,8 +1853,9 @@ SDL_GameControllerLoadHints() char *pchNewLine = NULL; pchNewLine = SDL_strchr(pUserMappings, '\n'); - if (pchNewLine) + if (pchNewLine) { *pchNewLine = '\0'; + } SDL_PrivateGameControllerAddMapping(pUserMappings, SDL_CONTROLLER_MAPPING_PRIORITY_USER); @@ -1794,7 +1870,7 @@ SDL_GameControllerLoadHints() } /* - * Fill the given buffer with the expected controller mapping filepath. + * Fill the given buffer with the expected controller mapping filepath. * Usually this will just be SDL_HINT_GAMECONTROLLERCONFIG_FILE, but for * Android, we want to get the internal storage path. */ @@ -1815,12 +1891,14 @@ static SDL_bool SDL_GetControllerMappingFilePath(char *path, size_t size) /* * Initialize the game controller system, mostly load our DB of controller config mappings */ -int -SDL_GameControllerInitMappings(void) +int SDL_GameControllerInitMappings(void) { char szControllerMapPath[1024]; int i = 0; const char *pMappingString = NULL; + + SDL_AssertJoysticksLocked(); + pMappingString = s_ControllerMappings[i]; while (pMappingString) { SDL_PrivateGameControllerAddMapping(pMappingString, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); @@ -1830,22 +1908,19 @@ SDL_GameControllerInitMappings(void) } if (SDL_GetControllerMappingFilePath(szControllerMapPath, sizeof(szControllerMapPath))) { - SDL_GameControllerAddMappingsFromFile(szControllerMapPath); + SDL_GameControllerAddMappingsFromFile(szControllerMapPath); } /* load in any user supplied config */ SDL_GameControllerLoadHints(); - SDL_AddHintCallback(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES, - SDL_GameControllerIgnoreDevicesChanged, NULL); - SDL_AddHintCallback(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT, - SDL_GameControllerIgnoreDevicesExceptChanged, NULL); + SDL_LoadVIDPIDList(&SDL_allowed_controllers); + SDL_LoadVIDPIDList(&SDL_ignored_controllers); - return (0); + return 0; } -int -SDL_GameControllerInit(void) +int SDL_GameControllerInit(void) { int i; @@ -1862,110 +1937,150 @@ SDL_GameControllerInit(void) } } - return (0); + return 0; } - /* * Get the implementation dependent name of a controller */ -const char * -SDL_GameControllerNameForIndex(int device_index) +const char *SDL_GameControllerNameForIndex(int joystick_index) { - ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index); - if (pSupportedController) { - if (SDL_strcmp(pSupportedController->name, "*") == 0) { - return SDL_JoystickNameForIndex(device_index); - } else { - return pSupportedController->name; + const char *retval = NULL; + + SDL_LockJoysticks(); + { + ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index); + if (mapping) { + if (SDL_strcmp(mapping->name, "*") == 0) { + retval = SDL_JoystickNameForIndex(joystick_index); + } else { + retval = mapping->name; + } } } - return NULL; -} + SDL_UnlockJoysticks(); + return retval; +} /* * Get the implementation dependent path of a controller */ -const char * -SDL_GameControllerPathForIndex(int device_index) +const char *SDL_GameControllerPathForIndex(int joystick_index) { - ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index); - if (pSupportedController) { - return SDL_JoystickPathForIndex(device_index); + const char *retval = NULL; + + SDL_LockJoysticks(); + { + ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index); + if (mapping) { + retval = SDL_JoystickPathForIndex(joystick_index); + } } - return NULL; -} + SDL_UnlockJoysticks(); + return retval; +} /** * Get the type of a game controller. */ -SDL_GameControllerType -SDL_GameControllerTypeForIndex(int joystick_index) +SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index) { - return SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetDeviceGUID(joystick_index), SDL_JoystickNameForIndex(joystick_index)); + SDL_JoystickGUID joystick_guid = SDL_JoystickGetDeviceGUID(joystick_index); + char *mapping = SDL_GameControllerMappingForGUID(joystick_guid); + char *type_string, *comma; + SDL_GameControllerType type; + if (mapping) { + type_string = SDL_strstr(mapping, SDL_CONTROLLER_TYPE_FIELD); + if (type_string) { + type_string += SDL_CONTROLLER_TYPE_FIELD_SIZE; + comma = SDL_strchr(type_string, ','); + if (comma) { + *comma = '\0'; + type = SDL_GetGameControllerTypeFromString(type_string); + *comma = ','; + } else { + type = SDL_GetGameControllerTypeFromString(type_string); + } + SDL_free(mapping); + return type; + } + SDL_free(mapping); + } + return SDL_GetJoystickGameControllerTypeFromGUID(joystick_guid, SDL_JoystickNameForIndex(joystick_index)); } - /** * Get the mapping of a game controller. * This can be called before any controllers are opened. * If no mapping can be found, this function returns NULL. */ -char * -SDL_GameControllerMappingForDeviceIndex(int joystick_index) +char *SDL_GameControllerMappingForDeviceIndex(int joystick_index) { - char *pMappingString = NULL; - ControllerMapping_t *mapping; + char *retval = NULL; SDL_LockJoysticks(); - mapping = SDL_PrivateGetControllerMapping(joystick_index); - if (mapping) { - SDL_JoystickGUID guid; - char pchGUID[33]; - size_t needed; - guid = SDL_JoystickGetDeviceGUID(joystick_index); - SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); - /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ - needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; - pMappingString = SDL_malloc(needed); - if (!pMappingString) { - SDL_OutOfMemory(); - SDL_UnlockJoysticks(); - return NULL; + { + ControllerMapping_t *mapping = SDL_PrivateGetControllerMapping(joystick_index); + if (mapping) { + SDL_JoystickGUID guid; + char pchGUID[33]; + size_t needed; + guid = SDL_JoystickGetDeviceGUID(joystick_index); + SDL_JoystickGetGUIDString(guid, pchGUID, sizeof(pchGUID)); + /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ + needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; + retval = (char *)SDL_malloc(needed); + if (retval) { + (void)SDL_snprintf(retval, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); + } else { + SDL_OutOfMemory(); + } } - SDL_snprintf(pMappingString, needed, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); } SDL_UnlockJoysticks(); - return pMappingString; + return retval; } - /* * Return 1 if the joystick with this name and GUID is a supported controller */ -SDL_bool -SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid) +SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid) { - ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMappingForNameAndGUID(name, guid); - if (pSupportedController) { - return SDL_TRUE; + SDL_bool retval; + + SDL_LockJoysticks(); + { + if (s_pDefaultMapping || SDL_PrivateGetControllerMappingForNameAndGUID(name, guid) != NULL) { + retval = SDL_TRUE; + } else { + retval = SDL_FALSE; + } } - return SDL_FALSE; + SDL_UnlockJoysticks(); + + return retval; } /* * Return 1 if the joystick at this device index is a supported controller */ -SDL_bool -SDL_IsGameController(int device_index) +SDL_bool SDL_IsGameController(int joystick_index) { - ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index); - if (pSupportedController) { - return SDL_TRUE; + SDL_bool retval; + + SDL_LockJoysticks(); + { + if (SDL_PrivateGetControllerMapping(joystick_index) != NULL) { + retval = SDL_TRUE; + } else { + retval = SDL_FALSE; + } } - return SDL_FALSE; + SDL_UnlockJoysticks(); + + return retval; } #if defined(__LINUX__) @@ -1988,11 +2103,9 @@ static SDL_bool SDL_endswith(const char *string, const char *suffix) */ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) { - int i; Uint16 vendor; Uint16 product; Uint16 version; - Uint32 vidpid; #if defined(__LINUX__) if (SDL_endswith(name, " Motion Sensors")) { @@ -2017,44 +2130,32 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) return SDL_TRUE; } - if (SDL_allowed_controllers.num_entries == 0 && - SDL_ignored_controllers.num_entries == 0) { - return SDL_FALSE; - } - SDL_GetJoystickGUIDInfo(guid, &vendor, &product, &version, NULL); - if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE)) { - /* We shouldn't ignore Steam's virtual gamepad since it's using the hints to filter out the real controllers so it can remap input for the virtual controller */ - /* https://partner.steamgames.com/doc/features/steam_controller/steam_input_gamepad_emulation_bestpractices */ - SDL_bool bSteamVirtualGamepad = SDL_FALSE; -#if defined(__LINUX__) - bSteamVirtualGamepad = (vendor == USB_VENDOR_VALVE && product == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD); -#elif defined(__MACOSX__) - bSteamVirtualGamepad = (vendor == USB_VENDOR_MICROSOFT && product == USB_PRODUCT_XBOX360_WIRED_CONTROLLER && version == 1); -#elif defined(__WIN32__) - /* We can't tell on Windows, but Steam will block others in input hooks */ - bSteamVirtualGamepad = SDL_TRUE; -#endif - if (bSteamVirtualGamepad) { - return SDL_FALSE; - } +#ifdef __WIN32__ + if (SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE) && + WIN_IsWine()) { + /* We are launched by Steam and running under Proton + * We can't tell whether this controller is a Steam Virtual Gamepad, + * so assume that Proton is doing the appropriate filtering of controllers + * and anything we see here is fine to use. + */ + return SDL_FALSE; } +#endif // __WIN32__ - vidpid = MAKE_VIDPID(vendor, product); + if (SDL_IsJoystickSteamVirtualGamepad(vendor, product, version)) { + return !SDL_GetHintBoolean("SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD", SDL_FALSE); + } - if (SDL_allowed_controllers.num_entries > 0) { - for (i = 0; i < SDL_allowed_controllers.num_entries; ++i) { - if (vidpid == SDL_allowed_controllers.entries[i]) { - return SDL_FALSE; - } + if (SDL_allowed_controllers.num_included_entries > 0) { + if (SDL_VIDPIDInList(vendor, product, &SDL_allowed_controllers)) { + return SDL_FALSE; } return SDL_TRUE; } else { - for (i = 0; i < SDL_ignored_controllers.num_entries; ++i) { - if (vidpid == SDL_ignored_controllers.entries[i]) { - return SDL_TRUE; - } + if (SDL_VIDPIDInList(vendor, product, &SDL_ignored_controllers)) { + return SDL_TRUE; } return SDL_FALSE; } @@ -2067,8 +2168,7 @@ SDL_bool SDL_ShouldIgnoreGameController(const char *name, SDL_JoystickGUID guid) * * This function returns a controller identifier, or NULL if an error occurred. */ -SDL_GameController * -SDL_GameControllerOpen(int device_index) +SDL_GameController *SDL_GameControllerOpen(int joystick_index) { SDL_JoystickID instance_id; SDL_GameController *gamecontroller; @@ -2079,35 +2179,35 @@ SDL_GameControllerOpen(int device_index) gamecontrollerlist = SDL_gamecontrollers; /* If the controller is already open, return it */ - instance_id = SDL_JoystickGetDeviceInstanceID(device_index); + instance_id = SDL_JoystickGetDeviceInstanceID(joystick_index); while (gamecontrollerlist) { if (instance_id == gamecontrollerlist->joystick->instance_id) { - gamecontroller = gamecontrollerlist; - ++gamecontroller->ref_count; - SDL_UnlockJoysticks(); - return (gamecontroller); + gamecontroller = gamecontrollerlist; + ++gamecontroller->ref_count; + SDL_UnlockJoysticks(); + return gamecontroller; } gamecontrollerlist = gamecontrollerlist->next; } /* Find a controller mapping */ - pSupportedController = SDL_PrivateGetControllerMapping(device_index); + pSupportedController = SDL_PrivateGetControllerMapping(joystick_index); if (!pSupportedController) { - SDL_SetError("Couldn't find mapping for device (%d)", device_index); + SDL_SetError("Couldn't find mapping for device (%d)", joystick_index); SDL_UnlockJoysticks(); return NULL; } /* Create and initialize the controller */ - gamecontroller = (SDL_GameController *) SDL_calloc(1, sizeof(*gamecontroller)); - if (gamecontroller == NULL) { + gamecontroller = (SDL_GameController *)SDL_calloc(1, sizeof(*gamecontroller)); + if (!gamecontroller) { SDL_OutOfMemory(); SDL_UnlockJoysticks(); return NULL; } gamecontroller->magic = &gamecontroller_magic; - gamecontroller->joystick = SDL_JoystickOpen(device_index); + gamecontroller->joystick = SDL_JoystickOpen(joystick_index); if (!gamecontroller->joystick) { SDL_free(gamecontroller); SDL_UnlockJoysticks(); @@ -2146,14 +2246,13 @@ SDL_GameControllerOpen(int device_index) SDL_UnlockJoysticks(); - return (gamecontroller); + return gamecontroller; } /* * Manually pump for controller updates. */ -void -SDL_GameControllerUpdate(void) +void SDL_GameControllerUpdate(void) { /* Just for API completeness; the joystick API does all the work. */ SDL_JoystickUpdate(); @@ -2162,141 +2261,167 @@ SDL_GameControllerUpdate(void) /** * Return whether a game controller has a given axis */ -SDL_bool -SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) +SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { SDL_GameControllerButtonBind bind; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_FALSE); + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_FALSE); + + bind = SDL_GameControllerGetBindForAxis(gamecontroller, axis); + } + SDL_UnlockJoysticks(); - bind = SDL_GameControllerGetBindForAxis(gamecontroller, axis); return (bind.bindType != SDL_CONTROLLER_BINDTYPE_NONE) ? SDL_TRUE : SDL_FALSE; } /* * Get the current state of an axis control on a controller */ -Sint16 -SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) +Sint16 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { - int i; + Sint16 retval = 0; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + SDL_LockJoysticks(); + { + int i; - for (i = 0; i < gamecontroller->num_bindings; ++i) { - SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; - if (binding->outputType == SDL_CONTROLLER_BINDTYPE_AXIS && binding->output.axis.axis == axis) { - int value = 0; - SDL_bool valid_input_range; - SDL_bool valid_output_range; - - if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { - value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis); - if (binding->input.axis.axis_min < binding->input.axis.axis_max) { - valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max); - } else { - valid_input_range = (value >= binding->input.axis.axis_max && value <= binding->input.axis.axis_min); - } - if (valid_input_range) { - if (binding->input.axis.axis_min != binding->output.axis.axis_min || binding->input.axis.axis_max != binding->output.axis.axis_max) { - float normalized_value = (float)(value - binding->input.axis.axis_min) / (binding->input.axis.axis_max - binding->input.axis.axis_min); - value = binding->output.axis.axis_min + (int)(normalized_value * (binding->output.axis.axis_max - binding->output.axis.axis_min)); + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + + for (i = 0; i < gamecontroller->num_bindings; ++i) { + SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; + if (binding->outputType == SDL_CONTROLLER_BINDTYPE_AXIS && binding->output.axis.axis == axis) { + int value = 0; + SDL_bool valid_input_range; + SDL_bool valid_output_range; + + if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { + value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis); + if (binding->input.axis.axis_min < binding->input.axis.axis_max) { + valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max); + } else { + valid_input_range = (value >= binding->input.axis.axis_max && value <= binding->input.axis.axis_min); + } + if (valid_input_range) { + if (binding->input.axis.axis_min != binding->output.axis.axis_min || binding->input.axis.axis_max != binding->output.axis.axis_max) { + float normalized_value = (float)(value - binding->input.axis.axis_min) / (binding->input.axis.axis_max - binding->input.axis.axis_min); + value = binding->output.axis.axis_min + (int)(normalized_value * (binding->output.axis.axis_max - binding->output.axis.axis_min)); + } + } else { + value = 0; + } + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { + value = SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button); + if (value == SDL_PRESSED) { + value = binding->output.axis.axis_max; + } + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { + int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat); + if (hat_mask & binding->input.hat.hat_mask) { + value = binding->output.axis.axis_max; } - } else { - value = 0; } - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { - value = SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button); - if (value == SDL_PRESSED) { - value = binding->output.axis.axis_max; + + if (binding->output.axis.axis_min < binding->output.axis.axis_max) { + valid_output_range = (value >= binding->output.axis.axis_min && value <= binding->output.axis.axis_max); + } else { + valid_output_range = (value >= binding->output.axis.axis_max && value <= binding->output.axis.axis_min); } - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { - int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat); - if (hat_mask & binding->input.hat.hat_mask) { - value = binding->output.axis.axis_max; + /* If the value is zero, there might be another binding that makes it non-zero */ + if (value != 0 && valid_output_range) { + retval = (Sint16)value; + break; } } - - if (binding->output.axis.axis_min < binding->output.axis.axis_max) { - valid_output_range = (value >= binding->output.axis.axis_min && value <= binding->output.axis.axis_max); - } else { - valid_output_range = (value >= binding->output.axis.axis_max && value <= binding->output.axis.axis_min); - } - /* If the value is zero, there might be another binding that makes it non-zero */ - if (value != 0 && valid_output_range) { - return (Sint16)value; - } } } - return 0; + SDL_UnlockJoysticks(); + + return retval; } /** * Return whether a game controller has a given button */ -SDL_bool -SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +SDL_bool SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) { SDL_GameControllerButtonBind bind; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_FALSE); + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_FALSE); + + bind = SDL_GameControllerGetBindForButton(gamecontroller, button); + } + SDL_UnlockJoysticks(); - bind = SDL_GameControllerGetBindForButton(gamecontroller, button); return (bind.bindType != SDL_CONTROLLER_BINDTYPE_NONE) ? SDL_TRUE : SDL_FALSE; } /* * Get the current state of a button on a controller */ -Uint8 -SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +Uint8 SDL_GameControllerGetButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) { - int i; - - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + Uint8 retval = SDL_RELEASED; - for (i = 0; i < gamecontroller->num_bindings; ++i) { - SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; - if (binding->outputType == SDL_CONTROLLER_BINDTYPE_BUTTON && binding->output.button == button) { - if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { - SDL_bool valid_input_range; - - int value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis); - int threshold = binding->input.axis.axis_min + (binding->input.axis.axis_max - binding->input.axis.axis_min) / 2; - if (binding->input.axis.axis_min < binding->input.axis.axis_max) { - valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max); - if (valid_input_range) { - return (value >= threshold) ? SDL_PRESSED : SDL_RELEASED; - } - } else { - valid_input_range = (value >= binding->input.axis.axis_max && value <= binding->input.axis.axis_min); - if (valid_input_range) { - return (value <= threshold) ? SDL_PRESSED : SDL_RELEASED; + SDL_LockJoysticks(); + { + int i; + + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + + for (i = 0; i < gamecontroller->num_bindings; ++i) { + SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; + if (binding->outputType == SDL_CONTROLLER_BINDTYPE_BUTTON && binding->output.button == button) { + if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { + SDL_bool valid_input_range; + + int value = SDL_JoystickGetAxis(gamecontroller->joystick, binding->input.axis.axis); + int threshold = binding->input.axis.axis_min + (binding->input.axis.axis_max - binding->input.axis.axis_min) / 2; + if (binding->input.axis.axis_min < binding->input.axis.axis_max) { + valid_input_range = (value >= binding->input.axis.axis_min && value <= binding->input.axis.axis_max); + if (valid_input_range) { + retval |= (value >= threshold) ? SDL_PRESSED : SDL_RELEASED; + } + } else { + valid_input_range = (value >= binding->input.axis.axis_max && value <= binding->input.axis.axis_min); + if (valid_input_range) { + retval |= (value <= threshold) ? SDL_PRESSED : SDL_RELEASED; + } } + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { + retval |= SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button); + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { + int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat); + retval |= (hat_mask & binding->input.hat.hat_mask) ? SDL_PRESSED : SDL_RELEASED; } - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { - return SDL_JoystickGetButton(gamecontroller->joystick, binding->input.button); - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { - int hat_mask = SDL_JoystickGetHat(gamecontroller->joystick, binding->input.hat.hat); - return (hat_mask & binding->input.hat.hat_mask) ? SDL_PRESSED : SDL_RELEASED; } } } - return SDL_RELEASED; + SDL_UnlockJoysticks(); + + return retval; } /** * Get the number of touchpads on a game controller. */ -int -SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller) +int SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + int retval = 0; - if (joystick) { - return joystick->ntouchpads; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + retval = joystick->ntouchpads; + } } - return 0; + SDL_UnlockJoysticks(); + + return retval; } /** @@ -2304,69 +2429,89 @@ SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller) */ int SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + int retval = 0; - if (joystick && touchpad >= 0 && touchpad < joystick->ntouchpads) { - return joystick->touchpads[touchpad].nfingers; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + if (touchpad >= 0 && touchpad < joystick->ntouchpads) { + retval = joystick->touchpads[touchpad].nfingers; + } else { + retval = SDL_InvalidParamError("touchpad"); + } + } } - return 0; + SDL_UnlockJoysticks(); + + return retval; } /** * Get the current state of a finger on a touchpad on a game controller. */ -int -SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure) +int SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - - if (joystick ) { - if (touchpad >= 0 && touchpad < joystick->ntouchpads) { - SDL_JoystickTouchpadInfo *touchpad_info = &joystick->touchpads[touchpad]; - if (finger >= 0 && finger < touchpad_info->nfingers) { - SDL_JoystickTouchpadFingerInfo *info = &touchpad_info->fingers[finger]; + int retval = -1; - if (state) { - *state = info->state; - } - if (x) { - *x = info->x; - } - if (y) { - *y = info->y; - } - if (pressure) { - *pressure = info->pressure; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + if (touchpad >= 0 && touchpad < joystick->ntouchpads) { + SDL_JoystickTouchpadInfo *touchpad_info = &joystick->touchpads[touchpad]; + if (finger >= 0 && finger < touchpad_info->nfingers) { + SDL_JoystickTouchpadFingerInfo *info = &touchpad_info->fingers[finger]; + + if (state) { + *state = info->state; + } + if (x) { + *x = info->x; + } + if (y) { + *y = info->y; + } + if (pressure) { + *pressure = info->pressure; + } + retval = 0; + } else { + retval = SDL_InvalidParamError("finger"); } - return 0; } else { - return SDL_InvalidParamError("finger"); + retval = SDL_InvalidParamError("touchpad"); } - } else { - return SDL_InvalidParamError("touchpad"); } - } else { - return SDL_InvalidParamError("gamecontroller"); } + SDL_UnlockJoysticks(); + + return retval; } /** * Return whether a game controller has a particular sensor. */ -SDL_bool -SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type) +SDL_bool SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - int i; + SDL_bool retval = SDL_FALSE; - if (joystick) { - for (i = 0; i < joystick->nsensors; ++i) { - if (joystick->sensors[i].type == type) { - return SDL_TRUE; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + int i; + for (i = 0; i < joystick->nsensors; ++i) { + if (joystick->sensors[i].type == type) { + retval = SDL_TRUE; + break; + } } } } - return SDL_FALSE; + SDL_UnlockJoysticks(); + + return retval; } /* @@ -2374,41 +2519,47 @@ SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType t */ int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - int i; - - if (!joystick) { - return -1; - } - - for (i = 0; i < joystick->nsensors; ++i) { - SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; - - if (sensor->type == type) { - if (sensor->enabled == enabled) { - return 0; - } - - if (enabled) { - if (joystick->nsensors_enabled == 0) { - if (joystick->driver->SetSensorsEnabled(joystick, SDL_TRUE) < 0) { - return -1; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + int i; + for (i = 0; i < joystick->nsensors; ++i) { + SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; + + if (sensor->type == type) { + if (sensor->enabled == enabled) { + SDL_UnlockJoysticks(); + return 0; } - } - ++joystick->nsensors_enabled; - } else { - if (joystick->nsensors_enabled == 1) { - if (joystick->driver->SetSensorsEnabled(joystick, SDL_FALSE) < 0) { - return -1; + + if (enabled) { + if (joystick->nsensors_enabled == 0) { + if (joystick->driver->SetSensorsEnabled(joystick, SDL_TRUE) < 0) { + SDL_UnlockJoysticks(); + return -1; + } + } + ++joystick->nsensors_enabled; + } else { + if (joystick->nsensors_enabled == 1) { + if (joystick->driver->SetSensorsEnabled(joystick, SDL_FALSE) < 0) { + SDL_UnlockJoysticks(); + return -1; + } + } + --joystick->nsensors_enabled; } + + sensor->enabled = enabled; + SDL_UnlockJoysticks(); + return 0; } - --joystick->nsensors_enabled; } - - sensor->enabled = enabled; - return 0; } } + SDL_UnlockJoysticks(); + return SDL_Unsupported(); } @@ -2417,47 +2568,57 @@ int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_S */ SDL_bool SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - int i; + SDL_bool retval = SDL_FALSE; - if (joystick) { - for (i = 0; i < joystick->nsensors; ++i) { - if (joystick->sensors[i].type == type) { - return joystick->sensors[i].enabled; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + int i; + for (i = 0; i < joystick->nsensors; ++i) { + if (joystick->sensors[i].type == type) { + retval = joystick->sensors[i].enabled; + break; + } } } } - return SDL_FALSE; + SDL_UnlockJoysticks(); + + return retval; } /* * Get the data rate of a game controller sensor. */ -float -SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type) +float SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - int i; + float retval = 0.0f; - if (!joystick) { - return 0.0f; - } - - for (i = 0; i < joystick->nsensors; ++i) { - SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; - - if (sensor->type == type) { - return sensor->rate; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + int i; + for (i = 0; i < joystick->nsensors; ++i) { + SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; + + if (sensor->type == type) { + retval = sensor->rate; + break; + } + } } } - return 0.0f; + SDL_UnlockJoysticks(); + + return retval; } /* * Get the current state of a game controller sensor. */ -int -SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values) +int SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values) { return SDL_GameControllerGetSensorDataWithTimestamp(gamecontroller, type, NULL, data, num_values); } @@ -2465,45 +2626,54 @@ SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorTy /* * Get the current state of a game controller sensor. */ -int -SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values) +int SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - int i; - - if (!joystick) { - return -1; - } - - for (i = 0; i < joystick->nsensors; ++i) { - SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; - - if (sensor->type == type) { - num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); - SDL_memcpy(data, sensor->data, num_values*sizeof(*data)); - if (timestamp) { - *timestamp = sensor->timestamp_us; + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + if (joystick) { + int i; + for (i = 0; i < joystick->nsensors; ++i) { + SDL_JoystickSensorInfo *sensor = &joystick->sensors[i]; + + if (sensor->type == type) { + num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); + SDL_memcpy(data, sensor->data, num_values * sizeof(*data)); + if (timestamp) { + *timestamp = sensor->timestamp_us; + } + SDL_UnlockJoysticks(); + return 0; + } } - return 0; } } + SDL_UnlockJoysticks(); + return SDL_Unsupported(); } -const char * -SDL_GameControllerName(SDL_GameController *gamecontroller) +const char *SDL_GameControllerName(SDL_GameController *gamecontroller) { - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + const char *retval = NULL; - if (SDL_strcmp(gamecontroller->name, "*") == 0) { - return SDL_JoystickName(SDL_GameControllerGetJoystick(gamecontroller)); - } else { - return gamecontroller->name; + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + + if (SDL_strcmp(gamecontroller->name, "*") == 0 || + gamecontroller->joystick->steam_handle != 0) { + retval = SDL_JoystickName(gamecontroller->joystick); + } else { + retval = gamecontroller->name; + } } + SDL_UnlockJoysticks(); + + return retval; } -const char * -SDL_GameControllerPath(SDL_GameController *gamecontroller) +const char *SDL_GameControllerPath(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2513,19 +2683,32 @@ SDL_GameControllerPath(SDL_GameController *gamecontroller) return SDL_JoystickPath(joystick); } -SDL_GameControllerType -SDL_GameControllerGetType(SDL_GameController *gamecontroller) +SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller) { - SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); + SDL_GameControllerType type = SDL_CONTROLLER_TYPE_UNKNOWN; + SDL_Joystick *joystick; + const SDL_SteamVirtualGamepadInfo *info; - if (!joystick) { - return SDL_CONTROLLER_TYPE_UNKNOWN; + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_CONTROLLER_TYPE_UNKNOWN); + + joystick = gamecontroller->joystick; + info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + if (info) { + type = info->type; + } else if (gamecontroller->type != SDL_CONTROLLER_TYPE_UNKNOWN) { + type = gamecontroller->type; + } else { + type = SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetGUID(joystick), SDL_JoystickName(joystick)); + } } - return SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGetGUID(joystick), SDL_JoystickName(joystick)); + SDL_UnlockJoysticks(); + + return type; } -int -SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) +int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2538,8 +2721,7 @@ SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) /** * Set the player index of an opened game controller */ -void -SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index) +void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2549,8 +2731,7 @@ SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_ SDL_JoystickSetPlayerIndex(joystick, player_index); } -Uint16 -SDL_GameControllerGetVendor(SDL_GameController *gamecontroller) +Uint16 SDL_GameControllerGetVendor(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2560,8 +2741,7 @@ SDL_GameControllerGetVendor(SDL_GameController *gamecontroller) return SDL_JoystickGetVendor(joystick); } -Uint16 -SDL_GameControllerGetProduct(SDL_GameController *gamecontroller) +Uint16 SDL_GameControllerGetProduct(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2571,8 +2751,7 @@ SDL_GameControllerGetProduct(SDL_GameController *gamecontroller) return SDL_JoystickGetProduct(joystick); } -Uint16 -SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller) +Uint16 SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2582,8 +2761,7 @@ SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller) return SDL_JoystickGetProductVersion(joystick); } -Uint16 -SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller) +Uint16 SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2593,8 +2771,7 @@ SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller) return SDL_JoystickGetFirmwareVersion(joystick); } -const char * -SDL_GameControllerGetSerial(SDL_GameController *gamecontroller) +const char * SDL_GameControllerGetSerial(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2604,35 +2781,57 @@ SDL_GameControllerGetSerial(SDL_GameController *gamecontroller) return SDL_JoystickGetSerial(joystick); } +Uint64 SDL_GameControllerGetSteamHandle(SDL_GameController *gamecontroller) +{ + Uint64 handle = 0; + + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + + handle = gamecontroller->joystick->steam_handle; + } + SDL_UnlockJoysticks(); + + return handle; +} + /* * Return if the controller in question is currently attached to the system, * \return 0 if not plugged in, 1 if still present. */ -SDL_bool -SDL_GameControllerGetAttached(SDL_GameController *gamecontroller) +SDL_bool SDL_GameControllerGetAttached(SDL_GameController *gamecontroller) { - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, SDL_FALSE); + SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); - return SDL_JoystickGetAttached(gamecontroller->joystick); + if (!joystick) { + return SDL_FALSE; + } + return SDL_JoystickGetAttached(joystick); } /* * Get the joystick for this controller */ -SDL_Joystick * -SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller) +SDL_Joystick *SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller) { - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + SDL_Joystick *joystick; - return gamecontroller->joystick; -} + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + joystick = gamecontroller->joystick; + } + SDL_UnlockJoysticks(); + + return joystick; +} /* * Return the SDL_GameController associated with an instance id. */ -SDL_GameController * -SDL_GameControllerFromInstanceID(SDL_JoystickID joyid) +SDL_GameController *SDL_GameControllerFromInstanceID(SDL_JoystickID joyid) { SDL_GameController *gamecontroller; @@ -2649,89 +2848,101 @@ SDL_GameControllerFromInstanceID(SDL_JoystickID joyid) return NULL; } - /** * Return the SDL_GameController associated with a player index. */ SDL_GameController *SDL_GameControllerFromPlayerIndex(int player_index) { - SDL_Joystick *joystick = SDL_JoystickFromPlayerIndex(player_index); - if (joystick) { - return SDL_GameControllerFromInstanceID(joystick->instance_id); + SDL_GameController *retval = NULL; + + SDL_LockJoysticks(); + { + SDL_Joystick *joystick = SDL_JoystickFromPlayerIndex(player_index); + if (joystick) { + retval = SDL_GameControllerFromInstanceID(joystick->instance_id); + } } - return NULL; -} + SDL_UnlockJoysticks(); + return retval; +} /* * Get the SDL joystick layer binding for this controller axis mapping */ SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { - int i; SDL_GameControllerButtonBind bind; - SDL_zero(bind); - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, bind); - - if (axis == SDL_CONTROLLER_AXIS_INVALID) - return bind; + SDL_zero(bind); - for (i = 0; i < gamecontroller->num_bindings; ++i) { - SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; - if (binding->outputType == SDL_CONTROLLER_BINDTYPE_AXIS && binding->output.axis.axis == axis) { - bind.bindType = binding->inputType; - if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { - /* FIXME: There might be multiple axes bound now that we have axis ranges... */ - bind.value.axis = binding->input.axis.axis; - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { - bind.value.button = binding->input.button; - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { - bind.value.hat.hat = binding->input.hat.hat; - bind.value.hat.hat_mask = binding->input.hat.hat_mask; + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, bind); + + if (axis != SDL_CONTROLLER_AXIS_INVALID) { + int i; + for (i = 0; i < gamecontroller->num_bindings; ++i) { + SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; + if (binding->outputType == SDL_CONTROLLER_BINDTYPE_AXIS && binding->output.axis.axis == axis) { + bind.bindType = binding->inputType; + if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { + /* FIXME: There might be multiple axes bound now that we have axis ranges... */ + bind.value.axis = binding->input.axis.axis; + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { + bind.value.button = binding->input.button; + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { + bind.value.hat.hat = binding->input.hat.hat; + bind.value.hat.hat_mask = binding->input.hat.hat_mask; + } + break; + } } - break; } } + SDL_UnlockJoysticks(); + return bind; } - /* * Get the SDL joystick layer binding for this controller button mapping */ SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) { - int i; SDL_GameControllerButtonBind bind; - SDL_zero(bind); - - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, bind); - if (button == SDL_CONTROLLER_BUTTON_INVALID) - return bind; + SDL_zero(bind); - for (i = 0; i < gamecontroller->num_bindings; ++i) { - SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; - if (binding->outputType == SDL_CONTROLLER_BINDTYPE_BUTTON && binding->output.button == button) { - bind.bindType = binding->inputType; - if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { - bind.value.axis = binding->input.axis.axis; - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { - bind.value.button = binding->input.button; - } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { - bind.value.hat.hat = binding->input.hat.hat; - bind.value.hat.hat_mask = binding->input.hat.hat_mask; + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, bind); + + if (button != SDL_CONTROLLER_BUTTON_INVALID) { + int i; + for (i = 0; i < gamecontroller->num_bindings; ++i) { + SDL_ExtendedGameControllerBind *binding = &gamecontroller->bindings[i]; + if (binding->outputType == SDL_CONTROLLER_BINDTYPE_BUTTON && binding->output.button == button) { + bind.bindType = binding->inputType; + if (binding->inputType == SDL_CONTROLLER_BINDTYPE_AXIS) { + bind.value.axis = binding->input.axis.axis; + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_BUTTON) { + bind.value.button = binding->input.button; + } else if (binding->inputType == SDL_CONTROLLER_BINDTYPE_HAT) { + bind.value.hat.hat = binding->input.hat.hat; + bind.value.hat.hat_mask = binding->input.hat.hat_mask; + } + break; + } } - break; } } + SDL_UnlockJoysticks(); + return bind; } - -int -SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2741,8 +2952,7 @@ SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequenc return SDL_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms); } -int -SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) +int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2752,8 +2962,7 @@ SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left return SDL_JoystickRumbleTriggers(joystick, left_rumble, right_rumble, duration_ms); } -SDL_bool -SDL_GameControllerHasLED(SDL_GameController *gamecontroller) +SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2763,8 +2972,7 @@ SDL_GameControllerHasLED(SDL_GameController *gamecontroller) return SDL_JoystickHasLED(joystick); } -SDL_bool -SDL_GameControllerHasRumble(SDL_GameController *gamecontroller) +SDL_bool SDL_GameControllerHasRumble(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2774,8 +2982,7 @@ SDL_GameControllerHasRumble(SDL_GameController *gamecontroller) return SDL_JoystickHasRumble(joystick); } -SDL_bool -SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller) +SDL_bool SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2785,8 +2992,7 @@ SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller) return SDL_JoystickHasRumbleTriggers(joystick); } -int -SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue) +int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2796,8 +3002,7 @@ SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 gr return SDL_JoystickSetLED(joystick, red, green, blue); } -int -SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size) +int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size) { SDL_Joystick *joystick = SDL_GameControllerGetJoystick(gamecontroller); @@ -2807,16 +3012,17 @@ SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *dat return SDL_JoystickSendEffect(joystick, data, size); } -void -SDL_GameControllerClose(SDL_GameController *gamecontroller) +void SDL_GameControllerClose(SDL_GameController *gamecontroller) { SDL_GameController *gamecontrollerlist, *gamecontrollerlistprev; - if (!gamecontroller || gamecontroller->magic != &gamecontroller_magic) - return; - SDL_LockJoysticks(); + if (!gamecontroller || gamecontroller->magic != &gamecontroller_magic) { + SDL_UnlockJoysticks(); + return; + } + /* First decrement ref count */ if (--gamecontroller->ref_count > 0) { SDL_UnlockJoysticks(); @@ -2850,12 +3056,10 @@ SDL_GameControllerClose(SDL_GameController *gamecontroller) SDL_UnlockJoysticks(); } - /* * Quit the controller subsystem */ -void -SDL_GameControllerQuit(void) +void SDL_GameControllerQuit(void) { SDL_LockJoysticks(); while (SDL_gamecontrollers) { @@ -2865,11 +3069,12 @@ SDL_GameControllerQuit(void) SDL_UnlockJoysticks(); } -void -SDL_GameControllerQuitMappings(void) +void SDL_GameControllerQuitMappings(void) { ControllerMapping_t *pControllerMap; + SDL_AssertJoysticksLocked(); + while (s_pSupportedControllers) { pControllerMap = s_pSupportedControllers; s_pSupportedControllers = s_pSupportedControllers->next; @@ -2880,34 +3085,22 @@ SDL_GameControllerQuitMappings(void) SDL_DelEventWatch(SDL_GameControllerEventWatcher, NULL); - SDL_DelHintCallback(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES, - SDL_GameControllerIgnoreDevicesChanged, NULL); - SDL_DelHintCallback(SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT, - SDL_GameControllerIgnoreDevicesExceptChanged, NULL); - - if (SDL_allowed_controllers.entries) { - SDL_free(SDL_allowed_controllers.entries); - SDL_zero(SDL_allowed_controllers); - } - if (SDL_ignored_controllers.entries) { - SDL_free(SDL_ignored_controllers.entries); - SDL_zero(SDL_ignored_controllers); - } + SDL_FreeVIDPIDList(&SDL_allowed_controllers); + SDL_FreeVIDPIDList(&SDL_ignored_controllers); } /* * Event filter to transform joystick events into appropriate game controller ones */ -static int -SDL_PrivateGameControllerAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis, Sint16 value) +static int SDL_PrivateGameControllerAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis, Sint16 value) { int posted; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + SDL_AssertJoysticksLocked(); /* translate the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_CONTROLLERAXISMOTION) == SDL_ENABLE) { SDL_Event event; event.type = SDL_CONTROLLERAXISMOTION; @@ -2917,21 +3110,19 @@ SDL_PrivateGameControllerAxis(SDL_GameController *gamecontroller, SDL_GameContro posted = SDL_PushEvent(&event) == 1; } #endif /* !SDL_EVENTS_DISABLED */ - return (posted); + return posted; } - /* * Event filter to transform joystick events into appropriate game controller ones */ -static int -SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button, Uint8 state) +static int SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button, Uint8 state) { int posted; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_Event event; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, 0); + SDL_AssertJoysticksLocked(); if (button == SDL_CONTROLLER_BUTTON_INVALID) { return 0; @@ -2946,7 +3137,7 @@ SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameCont break; default: /* Invalid state -- bail */ - return (0); + return 0; } #endif /* !SDL_EVENTS_DISABLED */ @@ -2957,12 +3148,12 @@ SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameCont if (gamecontroller->joystick->delayed_guide_button) { /* Skip duplicate press */ - return (0); + return 0; } } else { - if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down+SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS)) { + if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down + SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS)) { gamecontroller->joystick->delayed_guide_button = SDL_TRUE; - return (0); + return 0; } gamecontroller->joystick->delayed_guide_button = SDL_FALSE; } @@ -2970,7 +3161,7 @@ SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameCont /* translate the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(event.type) == SDL_ENABLE) { event.cbutton.which = gamecontroller->joystick->instance_id; event.cbutton.button = button; @@ -2978,22 +3169,28 @@ SDL_PrivateGameControllerButton(SDL_GameController *gamecontroller, SDL_GameCont posted = SDL_PushEvent(&event) == 1; } #endif /* !SDL_EVENTS_DISABLED */ - return (posted); + return posted; } /* * Turn off controller events */ -int -SDL_GameControllerEventState(int state) +int SDL_GameControllerEventState(int state) { -#if SDL_EVENTS_DISABLED +#ifdef SDL_EVENTS_DISABLED return SDL_IGNORE; #else const Uint32 event_list[] = { - SDL_CONTROLLERAXISMOTION, SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP, - SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, - SDL_CONTROLLERTOUCHPADDOWN, SDL_CONTROLLERTOUCHPADMOTION, SDL_CONTROLLERTOUCHPADUP, SDL_CONTROLLERSENSORUPDATE, + SDL_CONTROLLERAXISMOTION, + SDL_CONTROLLERBUTTONDOWN, + SDL_CONTROLLERBUTTONUP, + SDL_CONTROLLERDEVICEADDED, + SDL_CONTROLLERDEVICEREMOVED, + SDL_CONTROLLERDEVICEREMAPPED, + SDL_CONTROLLERTOUCHPADDOWN, + SDL_CONTROLLERTOUCHPADMOTION, + SDL_CONTROLLERTOUCHPADUP, + SDL_CONTROLLERSENSORUPDATE, }; unsigned int i; @@ -3013,49 +3210,64 @@ SDL_GameControllerEventState(int state) } break; } - return (state); + return state; #endif /* SDL_EVENTS_DISABLED */ } -void -SDL_GameControllerHandleDelayedGuideButton(SDL_Joystick *joystick) +void SDL_GameControllerHandleDelayedGuideButton(SDL_Joystick *joystick) { - SDL_GameController *controllerlist = SDL_gamecontrollers; - while (controllerlist) { - if (controllerlist->joystick == joystick) { - SDL_PrivateGameControllerButton(controllerlist, SDL_CONTROLLER_BUTTON_GUIDE, SDL_RELEASED); + SDL_GameController *controller; + + SDL_AssertJoysticksLocked(); + + for (controller = SDL_gamecontrollers; controller; controller = controller->next) { + if (controller->joystick == joystick) { + SDL_PrivateGameControllerButton(controller, SDL_CONTROLLER_BUTTON_GUIDE, SDL_RELEASED); break; } - controllerlist = controllerlist->next; } } -const char * -SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +const char *SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) { #if defined(SDL_JOYSTICK_MFI) - const char *IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button); + const char *IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController * gamecontroller, SDL_GameControllerButton button); + const char *retval; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); - return IOS_GameControllerGetAppleSFSymbolsNameForButton(gamecontroller, button); -#else - return NULL; + retval = IOS_GameControllerGetAppleSFSymbolsNameForButton(gamecontroller, button); + } + SDL_UnlockJoysticks(); + + if (retval && *retval) { + return retval; + } #endif + return NULL; } -const char * -SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) +const char *SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { #if defined(SDL_JOYSTICK_MFI) - const char *IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + const char *IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController * gamecontroller, SDL_GameControllerAxis axis); + const char *retval; - CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); + SDL_LockJoysticks(); + { + CHECK_GAMECONTROLLER_MAGIC(gamecontroller, NULL); - return IOS_GameControllerGetAppleSFSymbolsNameForAxis(gamecontroller, axis); -#else - return NULL; + retval = IOS_GameControllerGetAppleSFSymbolsNameForAxis(gamecontroller, axis); + } + SDL_UnlockJoysticks(); + + if (retval && *retval) { + return retval; + } #endif + return NULL; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h index 32c59c837baaf..1366fb25d7eab 100644 --- a/src/joystick/SDL_gamecontrollerdb.h +++ b/src/joystick/SDL_gamecontrollerdb.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,6 @@ */ #include "../SDL_internal.h" - /* Default mappings we support The easiest way to generate a new mapping is to start Steam in Big Picture @@ -29,12 +28,11 @@ Alternatively, you can use the app located in test/controllermap */ -static const char *s_ControllerMappings [] = -{ -#if SDL_JOYSTICK_XINPUT - "xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", +static const char *s_ControllerMappings[] = { +#ifdef SDL_JOYSTICK_XINPUT + "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", #endif -#if SDL_JOYSTICK_WGI +#ifdef SDL_JOYSTICK_WGI "03000000491900001904000000007700,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,", "03000000d11800000094000000007700,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", "030000007e0500000920000000007701,Nintendo Switch Pro Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -44,7 +42,7 @@ static const char *s_ControllerMappings [] = "0300000032150000000a000000007703,Razer Atrox Arcade Stick,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b11,dpup:b10,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,x:b2,y:b3,", "03000000de280000ff11000000007701,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:b12,dpleft:b13,dpright:b11,dpup:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a4,leftx:a1,lefty:a0~,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a2~,start:b7,x:b2,y:b3,", #endif -#if SDL_JOYSTICK_DINPUT +#ifdef SDL_JOYSTICK_DINPUT "03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,", "03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -86,6 +84,9 @@ static const char *s_ControllerMappings [] = "03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "030000003512000020ab000000000000,8BitDo SNES30 Gamepad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "030000003512000020ab000000000000,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000c82d00001b30000000000000,8BitDo Ultimate 2C Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a2,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a5,start:b11,x:b3,y:b4,", /* Bluetooth */ + "03000000c82d00001130000000000000,8BitDo Ultimate Wired Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", + "03000000c82d00001330000000000000,8BitDo Ultimate Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", "03000000c82d00001890000000000000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00001890000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00003032000000000000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -125,6 +126,7 @@ static const char *s_ControllerMappings [] = "03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,", "03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,", "03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "03000000790000000600000000000000,Defender Joystick Cobra R4,crc:c77a,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2~,righty:a3~,start:b9,x:b3,y:b0,", "03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,", "030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -134,9 +136,6 @@ static const char *s_ControllerMappings [] = "03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,", "03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,", - "03000000151900004000000000000000,Flydigi Vader 2,a:b11,b:b10,back:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,leftstick:b1,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b0,righttrigger:b4,rightx:a3,righty:a4,start:b2,x:b9,y:b8,", - "03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b4,paddle2:b5,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,", - "03000000790000000600000000000000,G-Shark GS-GP702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", "03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", @@ -176,6 +175,7 @@ static const char *s_ControllerMappings [] = "030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", + "030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,", "030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,", "030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,", @@ -279,6 +279,7 @@ static const char *s_ControllerMappings [] = "03000000050b00001c1a000000000000,ROG Chakram X,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,", "03000000050b0000e318000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,", "03000000050b0000e518000000000000,ROG Chakram,a:b1,b:b0,leftx:a0,lefty:a1,x:b2,y:b3,", + "030000000d0f0000ad00000000000000,RX Gamepad,a:b0,b:b4,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b6,start:b9,x:b2,y:b1,", "03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", @@ -294,7 +295,8 @@ static const char *s_ControllerMappings [] = "030000000d0f00005c00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,", "0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,", - "03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,", + "03000000790000001100000000000000,Retrolink SNES Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b0,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "030000006b140000130d000000000000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -302,6 +304,7 @@ static const char *s_ControllerMappings [] = "030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,", "03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "03000000790000000600000000000000,SPEEDLINK STRIKE Gamepad,crc:5811,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,", "03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", "03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,", "03000000457500002211000000000000,SZMY-POWER PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -316,10 +319,12 @@ static const char *s_ControllerMappings [] = "03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,", "03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,", "03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,", + "03000000790000000600000000000000,Sanwa Supply JY-P76USV,crc:20f0,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b2,y:b3,", "0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,", "030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,", "030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", + "030000004c0500006802000000000000,SplitFish Game Controller,crc:5628,a:b0,b:b16,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,leftshoulder:b17,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b10,", "03000000de280000ff11000000000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", "03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,", @@ -351,6 +356,7 @@ static const char *s_ControllerMappings [] = "03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", "03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", "03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,", + "03000000c0160000e105000000000000,Xin-Mo Dual Arcade,crc:2246,a:b1,b:b2,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b8,x:b0,y:b3,", /* Ultimate Atari Fight Stick */ "03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", "03000000120c0000101e000000000000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", @@ -391,6 +397,9 @@ static const char *s_ControllerMappings [] = "03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000c82d00001b30000001000000,8BitDo Ultimate 2C Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Bluetooth */ + "03000000c82d00001130000000020000,8BitDo Ultimate Wired Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", + "03000000c82d00001330000000020000,8BitDo Ultimate Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "03000000c82d00001890000001000000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00003032000000010000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -411,9 +420,6 @@ static const char *s_ControllerMappings [] = "03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,", "030000000d0f00008400000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000000d0f00008500000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", - "03000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", - "03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,paddle1:b4,paddle2:b5,paddle3:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,", - "03000000790000000600000000000000,G-Shark GS-GP702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", "03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", @@ -473,7 +479,8 @@ static const char *s_ControllerMappings [] = "03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", "0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,", "03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,", - "03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,", + "03000000790000001100000006010000,Retrolink SNES Controller,a:b1,b:b2,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b0,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "030000006b140000130d000000010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,", @@ -511,14 +518,14 @@ static const char *s_ControllerMappings [] = "030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,", "030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,", + "03000000c0160000e105000000040000,Xin-Mo Dual Arcade,crc:82d5,a:b2,b:b4,back:b18,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,rightshoulder:b8,righttrigger:b10,start:b16,x:b0,y:b6,", /* Ultimate Atari Fight Stick */ "03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000120c0000101e000000010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000830500006020000000010000,iBuffalo SNES Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000830500006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,", #endif -#if SDL_JOYSTICK_LINUX - "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", +#if defined(SDL_JOYSTICK_LINUX) || defined(__OpenBSD__) "03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d00001038000000010000,8BitDo FC30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -539,6 +546,8 @@ static const char *s_ControllerMappings [] = "05000000203800000900000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d00002038000000010000,8BitDo NES30 Pro,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d00002038000000010000,8BitDo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000c82d00000020000000000000,8BitDo Pro 2 Wired Controller for Xbox,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "06000000c82d00000020000006010000,8BitDo Pro 2 Wired Controller for Xbox,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000c82d00000660000011010000,8BitDo Pro 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00000660000011010000,8BitDo Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d00000660000000010000,8BitDo Pro 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -559,6 +568,9 @@ static const char *s_ControllerMappings [] = "030000003512000020ab000010010000,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000202800000900000000010000,8BitDo SNES30 Gamepad,a:b0,b:b1,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000202800000900000000010000,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "05000000c82d00001b30000001000000,8BitDo Ultimate 2C Wireless,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Bluetooth */ + "03000000c82d00001130000011010000,8BitDo Ultimate Wired Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", + "03000000c82d00001330000011010000,8BitDo Ultimate Wireless Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "03000000c82d00001890000011010000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d00003032000000010000,8BitDo Zero 2,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -588,6 +600,7 @@ static const char *s_ControllerMappings [] = "05000000503200000110000000000000,Atari Classic Controller,a:b0,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,x:b1,", "03000000503200000210000000000000,Atari Game Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a2,righty:a3,start:b8,x:b2,y:b3,", "05000000503200000210000000000000,Atari Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,", + "05000000503200000210000000000000128804098,Atari Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,", "030000005e0400008e02000047010000,Atari Xbox 360 Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000c62400001b89000011010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "03000000d62000002a79000011010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", @@ -597,10 +610,9 @@ static const char *s_ControllerMappings [] = "03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,", "03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,", - "03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,", + "050000004c050000f20d000000010000,DualSense Edge Wireless Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", - "03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "05000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", + "03000000790000001100000010010000,Elecom Gamepad,crc:e86c,a:b2,b:b3,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b0,y:b1,", "0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", "03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,", @@ -614,6 +626,7 @@ static const char *s_ControllerMappings [] = "030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000d11800000094000011010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", + "05000000d11800000094000000010000,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", "03000000280400000140000000010000,Gravis Gamepad Pro USB ,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,", "030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,", "030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,", @@ -647,6 +660,7 @@ static const char *s_ControllerMappings [] = "03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,", "03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", "030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + "030000006d040000d1ca000011010000,Logitech Chillstream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -654,8 +668,6 @@ static const char *s_ControllerMappings [] = "030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", /* Guide button doesn't seem to be sent in DInput mode. */ "030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "030000006d0400004fc2000011010000,Logitech G29 Racing Wheel,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b24,leftshoulder:b5,leftstick:b11,lefttrigger:b7,rightshoulder:b4,rightstick:b10,righttrigger:b6,start:b9,x:b1,y:b3,", - "030000006d04000060c2000010010000,Logitech G29 Racing Wheel,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,", "030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,", "03000000c62400002b89000011010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", @@ -694,7 +706,6 @@ static const char *s_ControllerMappings [] = "03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000790000004318000010010000,Nintendo GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000790000004318000010010000,Nintendo GameCube Controller,a:b1,b:b0,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", - "030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,", "050000007e0500000620000001800000,Nintendo Switch Joy-Con (L),a:b15,b:b16,guide:b4,leftshoulder:b6,leftstick:b12,leftx:a1,lefty:a0~,rightshoulder:b8,start:b9,x:b17,y:b14,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "050000007e0500000620000001800000,Nintendo Switch Joy-Con (L),a:b16,b:b15,guide:b4,leftshoulder:b6,leftstick:b12,leftx:a1,lefty:a0~,rightshoulder:b8,start:b9,x:b14,y:b17,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "060000007e0500000620000000000000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -764,6 +775,8 @@ static const char *s_ControllerMappings [] = "03000000300f00001211000011010000,QanBa Arcade JoyStick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,", "03000000222c00000225000011010000,Qanba Dragon Arcade Joystick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000222c00000025000011010000,Qanba Dragon Arcade Joystick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", + "03000000222c00001220000011010000,Qanba Drone 2 Arcade Joystick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", + "03000000222c00001020000011010000,Qanba Drone 2 Arcade Joystick (PS5),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000222c00000020000011010000,Qanba Drone Arcade Joystick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,", "03000000222c00000223000011010000,Qanba Obsidian Arcade Joystick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", "03000000222c00000023000011010000,Qanba Obsidian Arcade Joystick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", @@ -780,7 +793,8 @@ static const char *s_ControllerMappings [] = "050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", "0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,", - "03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,", + "03000000790000001100000010010000,Retrolink SNES Controller,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b0,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", + "03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "030000006b140000130d000011010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -811,6 +825,8 @@ static const char *s_ControllerMappings [] = "05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,", "05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,", "05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,", + "03000000de2800000512000011010000,Steam Deck,a:b3,b:b4,back:b11,dpdown:b17,dpleft:b18,dpright:b19,dpup:b16,guide:b13,leftshoulder:b7,leftstick:b14,lefttrigger:a9,leftx:a0,lefty:a1,misc1:b2,paddle1:b21,paddle2:b20,paddle3:b23,paddle4:b22,rightshoulder:b8,rightstick:b15,righttrigger:a8,rightx:a2,righty:a3,start:b12,x:b5,y:b6,", + "03000000de2800000512000000016800,Steam Deck,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,", "03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "0500000011010000311400001b010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b32,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "05000000110100001914000009010000,SteelSeries Stratus XL,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b18,leftshoulder:b6,leftstick:b13,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:+a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", @@ -829,7 +845,6 @@ static const char *s_ControllerMappings [] = "03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,", "03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", "03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,", - "03000000790000000600000007010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,", "03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,", "05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,", "030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,", @@ -844,21 +859,13 @@ static const char *s_ControllerMappings [] = "0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", "030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", - "050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "050000005e040000050b000003090000,Xbox One Elite Series 2,a:b0,b:b1,back:b121,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "050000005e040000e302000002090000,Xbox One Elite,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "030000005e040000ea02000000000000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", - "030000005e040000ea02000001030000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "050000005e040000130b000007050000,Xbox Series X Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", - "050000005e040000130b000011050000,Xbox Series X Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", "05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,", - "03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,", + "03000000c0160000e105000010010000,Xin-Mo Dual Arcade,crc:82d5,a:b1,b:b2,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b8,x:b0,y:b3,", /* Ultimate Atari Fight Stick */ "03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,", "03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,", - "030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,", "03000000830500006020000010010000,iBuffalo SNES Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,", @@ -904,25 +911,23 @@ static const char *s_ControllerMappings [] = "05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b0,b:b1,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", - "05000000b404000011240000dfff3f00,Flydigi Vader 2,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,", + "05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,", "0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000005509000014720000df7f3f00,NVIDIA Controller v01.04,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,", + "050000005509000014720000df7f3f80,NVIDIA Controller v01.04,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,", "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,sdk>=:29,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,sdk>=:29,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", - "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,sdk<=:28,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", /* Extremely slow in Bluetooth mode on Android */ + "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,sdk<=:28,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", /* Extremely slow in Bluetooth mode on Android */ "050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b2,y:b17,sdk<=:28,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", /* Extremely slow in Bluetooth mode on Android */ "050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "030000004c050000cc09000000006800,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000004c050000c405000000783f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,", + "050000004c050000c4050000fffe3f80,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a3,rightx:a4,righty:a5,start:b16,x:b0,y:b2,", "050000004c050000c4050000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,", + "050000004c050000cc090000fffe3f80,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a3,rightx:a4,righty:a5,start:b16,x:b0,y:b2,", "050000004c050000cc090000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000004c050000e60c0000fffe3f00,PS5 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,", + "050000004c050000e60c0000fffe3f80,PS5 Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a3,rightx:a4,righty:a5,start:b16,x:b2,y:b17,", "050000004c050000e60c0000ffff3f00,PS5 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "05000000f8270000bf0b0000ffff3f00,Razer Kishi,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", @@ -930,25 +935,28 @@ static const char *s_ControllerMappings [] = "050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,", "050000004f0400000ed00000fffe3f00,ThrustMaster eSwap PRO Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005e0400008e02000000783f00,Xbox 360 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000005e040000000b000000783f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", + "050000005e040000000b000000783f80,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", + "050000005e040000050b0000ffff3f00,Xbox One Elite 2 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005e040000e002000000783f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005e040000ea02000000783f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005e040000fd020000ff7f3f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,", + "050000005e040000e00200000ffe3f80,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a2,righty:a3,start:b10,x:b17,y:b2,", "050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000005e040000120b000000783f00,Xbox Series X Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", + "050000005e040000120b000000783f80,Xbox Series X Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "050000005e040000130b0000ffff3f00,Xbox Series X Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", - "050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,", /* The DPAD doesn't seem to work on this controller on Android TV? */ - "050000001727000044310000ffff3f00,XiaoMi Game Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a5,start:b6,x:b2,y:b3,", + "050000005e04000091020000ff073f80,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", /* The DPAD doesn't seem to work on this controller on Android TV? */ + "050000001727000044310000ffff3f80,XiaoMi Game Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a4,righty:a5,start:b6,x:b2,y:b3,", "0500000083050000602000000ffe0000,iBuffalo SNES Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b15,rightshoulder:b16,start:b10,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "0500000083050000602000000ffe0000,iBuffalo SNES Controller,a:b1,b:b0,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b15,rightshoulder:b16,start:b10,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", #endif -#if SDL_JOYSTICK_MFI +#ifdef SDL_JOYSTICK_MFI "05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,", "05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,", "05000000ac05000001000000df076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,", "05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,", "05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,", + "050000008a35000003010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,", + "050000008a35000004010000ff070000,Backbone One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,", "050000007e050000062000000f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b0,leftshoulder:b4,rightshoulder:b5,x:b3,y:b1,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "050000007e050000062000000f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", "050000007e050000062000004f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b0,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b3,y:b1,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,", @@ -977,19 +985,19 @@ static const char *s_ControllerMappings [] = "050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,", "050000005e040000e0020000ff070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,", #endif -#if SDL_JOYSTICK_EMSCRIPTEN +#ifdef SDL_JOYSTICK_EMSCRIPTEN "default,Standard Gamepad,a:b0,b:b1,back:b8,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b16,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", #endif -#if SDL_JOYSTICK_PS2 +#ifdef SDL_JOYSTICK_PS2 "0000000050533220436f6e74726f6c00,PS2 Controller,crc:ed87,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,", #endif -#if SDL_JOYSTICK_PSP +#ifdef SDL_JOYSTICK_PSP "00000000505350206275696c74696e00,PSP builtin joypad,crc:bb86,a:b2,b:b1,back:b10,dpdown:b6,dpleft:b7,dpright:b9,dpup:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,", #endif -#if SDL_JOYSTICK_VITA +#ifdef SDL_JOYSTICK_VITA "0000000050535669746120436f6e7400,PSVita Controller,crc:d598,a:b2,b:b1,back:b10,dpdown:b6,dpleft:b7,dpright:b9,dpup:b8,leftshoulder:b4,leftstick:b14,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,", #endif -#if SDL_JOYSTICK_N3DS +#ifdef SDL_JOYSTICK_N3DS "000000004e696e74656e646f20334400,Nintendo 3DS,crc:3210,a:b0,b:b1,back:b2,dpdown:b7,dpleft:b5,dpright:b4,dpup:b6,leftshoulder:b9,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b8,righttrigger:b15,rightx:a2,righty:a3,start:b3,x:b10,y:b11,", #endif "hidapi,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 0339296949d21..e968288599582 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,8 +28,9 @@ #include "SDL_sysjoystick.h" #include "SDL_hints.h" #include "../SDL_hints_c.h" +#include "SDL_steam_virtual_gamepad.h" -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED #include "../events/SDL_events_c.h" #endif #include "../video/SDL_sysvideo.h" @@ -42,11 +43,11 @@ /* Needed for checking for input remapping programs */ #include "../core/windows/SDL_windows.h" -#undef UNICODE /* We want ASCII functions */ +#undef UNICODE /* We want ASCII functions */ #include #endif -#if SDL_JOYSTICK_VIRTUAL +#ifdef SDL_JOYSTICK_VIRTUAL #include "./virtual/SDL_virtualjoystick_c.h" #endif @@ -84,7 +85,7 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = { #ifdef SDL_JOYSTICK_HAIKU &SDL_HAIKU_JoystickDriver, #endif -#ifdef SDL_JOYSTICK_USBHID /* !!! FIXME: "USBHID" is a generic name, and doubly-confusing with HIDAPI next to it. This is the *BSD interface, rename this. */ +#ifdef SDL_JOYSTICK_USBHID /* !!! FIXME: "USBHID" is a generic name, and doubly-confusing with HIDAPI next to it. This is the *BSD interface, rename this. */ &SDL_BSD_JoystickDriver, #endif #ifdef SDL_JOYSTICK_OS2 @@ -106,76 +107,377 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = { &SDL_N3DS_JoystickDriver #endif #if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED) - &SDL_DUMMY_JoystickDriver + &SDL_DUMMY_JoystickDriver #endif }; + +#ifndef SDL_THREAD_SAFETY_ANALYSIS +static +#endif +SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */ +static SDL_atomic_t SDL_joystick_lock_pending; +static int SDL_joysticks_locked; static SDL_bool SDL_joysticks_initialized; static SDL_bool SDL_joysticks_quitting = SDL_FALSE; -static SDL_Joystick *SDL_joysticks = NULL; -static SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */ -static int SDL_joysticks_locked; -static SDL_atomic_t SDL_next_joystick_instance_id; -static int SDL_joystick_player_count = 0; -static SDL_JoystickID *SDL_joystick_players = NULL; +static SDL_Joystick *SDL_joysticks SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static SDL_atomic_t SDL_next_joystick_instance_id SDL_GUARDED_BY(SDL_joystick_lock); +static int SDL_joystick_player_count SDL_GUARDED_BY(SDL_joystick_lock) = 0; +static SDL_JoystickID *SDL_joystick_players SDL_GUARDED_BY(SDL_joystick_lock) = NULL; static SDL_bool SDL_joystick_allows_background_events = SDL_FALSE; -static char joystick_magic; +char SDL_joystick_magic; + +static Uint32 initial_arcadestick_devices[] = { + MAKE_VIDPID(0x0079, 0x181a), /* Venom Arcade Stick */ + MAKE_VIDPID(0x0079, 0x181b), /* Venom Arcade Stick */ + MAKE_VIDPID(0x0c12, 0x0ef6), /* Hitbox Arcade Stick */ + MAKE_VIDPID(0x0e6f, 0x0109), /* PDP Versus Fighting Pad */ + MAKE_VIDPID(0x0f0d, 0x0016), /* Hori Real Arcade Pro.EX */ + MAKE_VIDPID(0x0f0d, 0x001b), /* Hori Real Arcade Pro VX */ + MAKE_VIDPID(0x0f0d, 0x0063), /* Hori Real Arcade Pro Hayabusa (USA) Xbox One */ + MAKE_VIDPID(0x0f0d, 0x006a), /* Real Arcade Pro 4 */ + MAKE_VIDPID(0x0f0d, 0x0078), /* Hori Real Arcade Pro V Kai Xbox One */ + MAKE_VIDPID(0x0f0d, 0x008a), /* HORI Real Arcade Pro 4 */ + MAKE_VIDPID(0x0f0d, 0x008c), /* Hori Real Arcade Pro 4 */ + MAKE_VIDPID(0x0f0d, 0x00aa), /* HORI Real Arcade Pro V Hayabusa in Switch Mode */ + MAKE_VIDPID(0x0f0d, 0x00ed), /* Hori Fighting Stick mini 4 kai */ + MAKE_VIDPID(0x0f0d, 0x011c), /* Hori Fighting Stick α in PS4 Mode */ + MAKE_VIDPID(0x0f0d, 0x011e), /* Hori Fighting Stick α in PC Mode */ + MAKE_VIDPID(0x0f0d, 0x0184), /* Hori Fighting Stick α in PS5 Mode */ + MAKE_VIDPID(0x146b, 0x0604), /* NACON Daija Arcade Stick */ + MAKE_VIDPID(0x1532, 0x0a00), /* Razer Atrox Arcade Stick */ + MAKE_VIDPID(0x1bad, 0xf03d), /* Street Fighter IV Arcade Stick TE - Chun Li */ + MAKE_VIDPID(0x1bad, 0xf502), /* Hori Real Arcade Pro.VX SA */ + MAKE_VIDPID(0x1bad, 0xf504), /* Hori Real Arcade Pro. EX */ + MAKE_VIDPID(0x1bad, 0xf506), /* Hori Real Arcade Pro.EX Premium VLX */ + MAKE_VIDPID(0x20d6, 0xa715), /* PowerA Nintendo Switch Fusion Arcade Stick */ + MAKE_VIDPID(0x24c6, 0x5000), /* Razer Atrox Arcade Stick */ + MAKE_VIDPID(0x24c6, 0x5501), /* Hori Real Arcade Pro VX-SA */ + MAKE_VIDPID(0x24c6, 0x550e), /* Hori Real Arcade Pro V Kai 360 */ + MAKE_VIDPID(0x2c22, 0x2300), /* Qanba Obsidian Arcade Joystick in PS4 Mode */ + MAKE_VIDPID(0x2c22, 0x2302), /* Qanba Obsidian Arcade Joystick in PS3 Mode */ + MAKE_VIDPID(0x2c22, 0x2303), /* Qanba Obsidian Arcade Joystick in PC Mode */ + MAKE_VIDPID(0x2c22, 0x2500), /* Qanba Dragon Arcade Joystick in PS4 Mode */ + MAKE_VIDPID(0x2c22, 0x2502), /* Qanba Dragon Arcade Joystick in PS3 Mode */ + MAKE_VIDPID(0x2c22, 0x2503), /* Qanba Dragon Arcade Joystick in PC Mode */ +}; +static SDL_vidpid_list arcadestick_devices = { + SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_arcadestick_devices), initial_arcadestick_devices, + SDL_FALSE +}; + +/* This list is taken from: + https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py + */ +static Uint32 initial_blacklist_devices[] = { + /* Microsoft Microsoft Wireless Optical Desktop 2.10 */ + /* Microsoft Wireless Desktop - Comfort Edition */ + MAKE_VIDPID(0x045e, 0x009d), + + /* Microsoft Microsoft Digital Media Pro Keyboard */ + /* Microsoft Corp. Digital Media Pro Keyboard */ + MAKE_VIDPID(0x045e, 0x00b0), + + /* Microsoft Microsoft Digital Media Keyboard */ + /* Microsoft Corp. Digital Media Keyboard 1.0A */ + MAKE_VIDPID(0x045e, 0x00b4), + + /* Microsoft Microsoft Digital Media Keyboard 3000 */ + MAKE_VIDPID(0x045e, 0x0730), + + /* Microsoft Microsoft 2.4GHz Transceiver v6.0 */ + /* Microsoft Microsoft 2.4GHz Transceiver v8.0 */ + /* Microsoft Corp. Nano Transceiver v1.0 for Bluetooth */ + /* Microsoft Wireless Mobile Mouse 1000 */ + /* Microsoft Wireless Desktop 3000 */ + MAKE_VIDPID(0x045e, 0x0745), + + /* Microsoft SideWinder(TM) 2.4GHz Transceiver */ + MAKE_VIDPID(0x045e, 0x0748), + + /* Microsoft Corp. Wired Keyboard 600 */ + MAKE_VIDPID(0x045e, 0x0750), + + /* Microsoft Corp. Sidewinder X4 keyboard */ + MAKE_VIDPID(0x045e, 0x0768), + + /* Microsoft Corp. Arc Touch Mouse Transceiver */ + MAKE_VIDPID(0x045e, 0x0773), + + /* Microsoft 2.4GHz Transceiver v9.0 */ + /* Microsoft Nano Transceiver v2.1 */ + /* Microsoft Sculpt Ergonomic Keyboard (5KV-00001) */ + MAKE_VIDPID(0x045e, 0x07a5), + + /* Microsoft Nano Transceiver v1.0 */ + /* Microsoft Wireless Keyboard 800 */ + MAKE_VIDPID(0x045e, 0x07b2), + + /* Microsoft Nano Transceiver v2.0 */ + MAKE_VIDPID(0x045e, 0x0800), + + MAKE_VIDPID(0x046d, 0xc30a), /* Logitech, Inc. iTouch Composite keboard */ + + MAKE_VIDPID(0x04d9, 0xa0df), /* Tek Syndicate Mouse (E-Signal USB Gaming Mouse) */ + + /* List of Wacom devices at: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs */ + MAKE_VIDPID(0x056a, 0x0010), /* Wacom ET-0405 Graphire */ + MAKE_VIDPID(0x056a, 0x0011), /* Wacom ET-0405A Graphire2 (4x5) */ + MAKE_VIDPID(0x056a, 0x0012), /* Wacom ET-0507A Graphire2 (5x7) */ + MAKE_VIDPID(0x056a, 0x0013), /* Wacom CTE-430 Graphire3 (4x5) */ + MAKE_VIDPID(0x056a, 0x0014), /* Wacom CTE-630 Graphire3 (6x8) */ + MAKE_VIDPID(0x056a, 0x0015), /* Wacom CTE-440 Graphire4 (4x5) */ + MAKE_VIDPID(0x056a, 0x0016), /* Wacom CTE-640 Graphire4 (6x8) */ + MAKE_VIDPID(0x056a, 0x0017), /* Wacom CTE-450 Bamboo Fun (4x5) */ + MAKE_VIDPID(0x056a, 0x0018), /* Wacom CTE-650 Bamboo Fun 6x8 */ + MAKE_VIDPID(0x056a, 0x0019), /* Wacom CTE-631 Bamboo One */ + MAKE_VIDPID(0x056a, 0x00d1), /* Wacom Bamboo Pen and Touch CTH-460 */ + MAKE_VIDPID(0x056a, 0x030e), /* Wacom Intuos Pen (S) CTL-480 */ + + MAKE_VIDPID(0x09da, 0x054f), /* A4 Tech Co., G7 750 mouse */ + MAKE_VIDPID(0x09da, 0x1410), /* A4 Tech Co., Ltd Bloody AL9 mouse */ + MAKE_VIDPID(0x09da, 0x3043), /* A4 Tech Co., Ltd Bloody R8A Gaming Mouse */ + MAKE_VIDPID(0x09da, 0x31b5), /* A4 Tech Co., Ltd Bloody TL80 Terminator Laser Gaming Mouse */ + MAKE_VIDPID(0x09da, 0x3997), /* A4 Tech Co., Ltd Bloody RT7 Terminator Wireless */ + MAKE_VIDPID(0x09da, 0x3f8b), /* A4 Tech Co., Ltd Bloody V8 mouse */ + MAKE_VIDPID(0x09da, 0x51f4), /* Modecom MC-5006 Keyboard */ + MAKE_VIDPID(0x09da, 0x5589), /* A4 Tech Co., Ltd Terminator TL9 Laser Gaming Mouse */ + MAKE_VIDPID(0x09da, 0x7b22), /* A4 Tech Co., Ltd Bloody V5 */ + MAKE_VIDPID(0x09da, 0x7f2d), /* A4 Tech Co., Ltd Bloody R3 mouse */ + MAKE_VIDPID(0x09da, 0x8090), /* A4 Tech Co., Ltd X-718BK Oscar Optical Gaming Mouse */ + MAKE_VIDPID(0x09da, 0x9033), /* A4 Tech Co., X7 X-705K */ + MAKE_VIDPID(0x09da, 0x9066), /* A4 Tech Co., Sharkoon Fireglider Optical */ + MAKE_VIDPID(0x09da, 0x9090), /* A4 Tech Co., Ltd XL-730K / XL-750BK / XL-755BK Laser Mouse */ + MAKE_VIDPID(0x09da, 0x90c0), /* A4 Tech Co., Ltd X7 G800V keyboard */ + MAKE_VIDPID(0x09da, 0xf012), /* A4 Tech Co., Ltd Bloody V7 mouse */ + MAKE_VIDPID(0x09da, 0xf32a), /* A4 Tech Co., Ltd Bloody B540 keyboard */ + MAKE_VIDPID(0x09da, 0xf613), /* A4 Tech Co., Ltd Bloody V2 mouse */ + MAKE_VIDPID(0x09da, 0xf624), /* A4 Tech Co., Ltd Bloody B120 Keyboard */ + + MAKE_VIDPID(0x1b1c, 0x1b3c), /* Corsair Harpoon RGB gaming mouse */ + + MAKE_VIDPID(0x1d57, 0xad03), /* [T3] 2.4GHz and IR Air Mouse Remote Control */ + + MAKE_VIDPID(0x1e7d, 0x2e4a), /* Roccat Tyon Mouse */ + + MAKE_VIDPID(0x20a0, 0x422d), /* Winkeyless.kr Keyboards */ + + MAKE_VIDPID(0x2516, 0x001f), /* Cooler Master Storm Mizar Mouse */ + MAKE_VIDPID(0x2516, 0x0028), /* Cooler Master Storm Alcor Mouse */ + + /*****************************************************************/ + /* Additional entries */ + /*****************************************************************/ + + MAKE_VIDPID(0x04d9, 0x8008), /* OBINLB USB-HID Keyboard (Anne Pro II) */ + MAKE_VIDPID(0x04d9, 0x8009), /* OBINLB USB-HID Keyboard (Anne Pro II) */ + MAKE_VIDPID(0x04d9, 0xa292), /* OBINLB USB-HID Keyboard (Anne Pro II) */ + MAKE_VIDPID(0x04d9, 0xa293), /* OBINLB USB-HID Keyboard (Anne Pro II) */ + MAKE_VIDPID(0x1532, 0x0266), /* Razer Huntsman V2 Analog, non-functional DInput device */ + MAKE_VIDPID(0x1532, 0x0282), /* Razer Huntsman Mini Analog, non-functional DInput device */ + MAKE_VIDPID(0x26ce, 0x01a2), /* ASRock LED Controller */ + MAKE_VIDPID(0x20d6, 0x0002), /* PowerA Enhanced Wireless Controller for Nintendo Switch (charging port only) */ +}; +static SDL_vidpid_list blacklist_devices = { + SDL_HINT_JOYSTICK_BLACKLIST_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_blacklist_devices), initial_blacklist_devices, + SDL_FALSE +}; + +static Uint32 initial_flightstick_devices[] = { + MAKE_VIDPID(0x044f, 0x0402), /* HOTAS Warthog Joystick */ + MAKE_VIDPID(0x0738, 0x2221), /* Saitek Pro Flight X-56 Rhino Stick */ + MAKE_VIDPID(0x044f, 0xb10a), /* ThrustMaster, Inc. T.16000M Joystick */ + MAKE_VIDPID(0x046d, 0xc215), /* Logitech Extreme 3D */ + MAKE_VIDPID(0x231d, 0x0126), /* Gunfighter Mk.III ‘Space Combat Edition’ (right) */ + MAKE_VIDPID(0x231d, 0x0127), /* Gunfighter Mk.III ‘Space Combat Edition’ (left) */ + MAKE_VIDPID(0x362c, 0x0001), /* Yawman Arrow */ +}; +static SDL_vidpid_list flightstick_devices = { + SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_flightstick_devices), initial_flightstick_devices, + SDL_FALSE +}; + +static Uint32 initial_gamecube_devices[] = { + MAKE_VIDPID(0x0e6f, 0x0185), /* PDP Wired Fight Pad Pro for Nintendo Switch */ + MAKE_VIDPID(0x20d6, 0xa711), /* PowerA Wired Controller Nintendo GameCube Style */ +}; +static SDL_vidpid_list gamecube_devices = { + SDL_HINT_JOYSTICK_GAMECUBE_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_gamecube_devices), initial_gamecube_devices, + SDL_FALSE +}; + +static Uint32 initial_rog_gamepad_mice[] = { + MAKE_VIDPID(0x0b05, 0x1906), /* ROG Pugio II */ + MAKE_VIDPID(0x0b05, 0x1958), /* ROG Chakram Core Mouse */ + MAKE_VIDPID(0x0b05, 0x18e3), /* ROG Chakram (wired) Mouse */ + MAKE_VIDPID(0x0b05, 0x18e5), /* ROG Chakram (wireless) Mouse */ + MAKE_VIDPID(0x0b05, 0x1a18), /* ROG Chakram X (wired) Mouse */ + MAKE_VIDPID(0x0b05, 0x1a1a), /* ROG Chakram X (wireless) Mouse */ + MAKE_VIDPID(0x0b05, 0x1a1c), /* ROG Chakram X (Bluetooth) Mouse */ +}; +static SDL_vidpid_list rog_gamepad_mice = { + SDL_HINT_ROG_GAMEPAD_MICE, 0, 0, NULL, + SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_rog_gamepad_mice), initial_rog_gamepad_mice, + SDL_FALSE +}; + +static Uint32 initial_throttle_devices[] = { + MAKE_VIDPID(0x044f, 0x0404), /* HOTAS Warthog Throttle */ + MAKE_VIDPID(0x0738, 0xa221), /* Saitek Pro Flight X-56 Rhino Throttle */ +}; +static SDL_vidpid_list throttle_devices = { + SDL_HINT_JOYSTICK_THROTTLE_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_throttle_devices), initial_throttle_devices, + SDL_FALSE +}; + +static Uint32 initial_wheel_devices[] = { + MAKE_VIDPID(0x0079, 0x1864), /* DragonRise Inc. Wired Wheel (active mode) (also known as PXN V900 (PS3), Superdrive SV-750, or a Genesis Seaborg 400) */ + MAKE_VIDPID(0x046d, 0xc294), /* Logitech generic wheel */ + MAKE_VIDPID(0x046d, 0xc295), /* Logitech Momo Force */ + MAKE_VIDPID(0x046d, 0xc298), /* Logitech Driving Force Pro */ + MAKE_VIDPID(0x046d, 0xc299), /* Logitech G25 */ + MAKE_VIDPID(0x046d, 0xc29a), /* Logitech Driving Force GT */ + MAKE_VIDPID(0x046d, 0xc29b), /* Logitech G27 */ + MAKE_VIDPID(0x046d, 0xc24f), /* Logitech G29 (PS3) */ + MAKE_VIDPID(0x046d, 0xc260), /* Logitech G29 (PS4) */ + MAKE_VIDPID(0x046d, 0xc261), /* Logitech G920 (initial mode) */ + MAKE_VIDPID(0x046d, 0xc262), /* Logitech G920 (active mode) */ + MAKE_VIDPID(0x046d, 0xc268), /* Logitech PRO Racing Wheel (PC mode) */ + MAKE_VIDPID(0x046d, 0xc269), /* Logitech PRO Racing Wheel (PS4/PS5 mode) */ + MAKE_VIDPID(0x046d, 0xc272), /* Logitech PRO Racing Wheel for Xbox (PC mode) */ + MAKE_VIDPID(0x046d, 0xc26d), /* Logitech G923 (Xbox) */ + MAKE_VIDPID(0x046d, 0xc26e), /* Logitech G923 */ + MAKE_VIDPID(0x046d, 0xc266), /* Logitech G923 for Playstation 4 and PC (PC mode) */ + MAKE_VIDPID(0x046d, 0xc267), /* Logitech G923 for Playstation 4 and PC (PS4 mode)*/ + MAKE_VIDPID(0x046d, 0xca03), /* Logitech Momo Racing */ + MAKE_VIDPID(0x044f, 0xb65d), /* Thrustmaster Wheel FFB */ + MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster Wheel FFB */ + MAKE_VIDPID(0x044f, 0xb677), /* Thrustmaster T150 */ + MAKE_VIDPID(0x044f, 0xb696), /* Thrustmaster T248 */ + MAKE_VIDPID(0x044f, 0xb66e), /* Thrustmaster T300RS (normal mode) */ + MAKE_VIDPID(0x044f, 0xb66f), /* Thrustmaster T300RS (advanced mode) */ + MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster T300RS (PS4 mode) */ + MAKE_VIDPID(0x044f, 0xb65e), /* Thrustmaster T500RS */ + MAKE_VIDPID(0x044f, 0xb664), /* Thrustmaster TX (initial mode) */ + MAKE_VIDPID(0x044f, 0xb669), /* Thrustmaster TX (active mode) */ + MAKE_VIDPID(0x044f, 0xb67f), /* Thrustmaster TMX */ + MAKE_VIDPID(0x044f, 0xb691), /* Thrustmaster TS-XW (initial mode) */ + MAKE_VIDPID(0x044f, 0xb692), /* Thrustmaster TS-XW (active mode) */ + MAKE_VIDPID(0x0483, 0x0522), /* Simagic Wheelbase (including M10, Alpha Mini, Alpha, Alpha U) */ + MAKE_VIDPID(0x0483, 0xa355), /* VRS DirectForce Pro Wheel Base */ + MAKE_VIDPID(0x0eb7, 0x0001), /* Fanatec ClubSport Wheel Base V2 */ + MAKE_VIDPID(0x0eb7, 0x0004), /* Fanatec ClubSport Wheel Base V2.5 */ + MAKE_VIDPID(0x0eb7, 0x0005), /* Fanatec CSL Elite Wheel Base+ (PS4) */ + MAKE_VIDPID(0x0eb7, 0x0006), /* Fanatec Podium Wheel Base DD1 */ + MAKE_VIDPID(0x0eb7, 0x0007), /* Fanatec Podium Wheel Base DD2 */ + MAKE_VIDPID(0x0eb7, 0x0011), /* Fanatec Forza Motorsport (CSR Wheel / CSR Elite Wheel) */ + MAKE_VIDPID(0x0eb7, 0x0020), /* Fanatec generic wheel / CSL DD / GT DD Pro */ + MAKE_VIDPID(0x0eb7, 0x0197), /* Fanatec Porsche Wheel (Turbo / GT3 RS / Turbo S / GT3 V2 / GT2) */ + MAKE_VIDPID(0x0eb7, 0x038e), /* Fanatec ClubSport Wheel Base V1 */ + MAKE_VIDPID(0x0eb7, 0x0e03), /* Fanatec CSL Elite Wheel Base */ + MAKE_VIDPID(0x11ff, 0x0511), /* DragonRise Inc. Wired Wheel (initial mode) (also known as PXN V900 (PS3), Superdrive SV-750, or a Genesis Seaborg 400) */ + MAKE_VIDPID(0x1209, 0xffb0), /* Generic FFBoard OpenFFBoard universal forcefeedback wheel */ + MAKE_VIDPID(0x16d0, 0x0d5a), /* Simucube 1 Wheelbase */ + MAKE_VIDPID(0x16d0, 0x0d5f), /* Simucube 2 Ultimate Wheelbase */ + MAKE_VIDPID(0x16d0, 0x0d60), /* Simucube 2 Pro Wheelbase */ + MAKE_VIDPID(0x16d0, 0x0d61), /* Simucube 2 Sport Wheelbase */ + MAKE_VIDPID(0x2433, 0xf300), /* Asetek SimSports Invicta Wheelbase */ + MAKE_VIDPID(0x2433, 0xf301), /* Asetek SimSports Forte Wheelbase */ + MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */ + MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */ + MAKE_VIDPID(0x3416, 0x0301), /* Cammus C5 Wheelbase */ + MAKE_VIDPID(0x3416, 0x0302), /* Cammus C12 Wheelbase */ + MAKE_VIDPID(0x346e, 0x0000), /* Moza R16/R21 Wheelbase */ + MAKE_VIDPID(0x346e, 0x0002), /* Moza R9 Wheelbase */ + MAKE_VIDPID(0x346e, 0x0004), /* Moza R5 Wheelbase */ + MAKE_VIDPID(0x346e, 0x0005), /* Moza R3 Wheelbase */ + MAKE_VIDPID(0x346e, 0x0006), /* Moza R12 Wheelbase */ +}; +static SDL_vidpid_list wheel_devices = { + SDL_HINT_JOYSTICK_WHEEL_DEVICES, 0, 0, NULL, + SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED, 0, 0, NULL, + SDL_arraysize(initial_wheel_devices), initial_wheel_devices, + SDL_FALSE +}; +static Uint32 initial_zero_centered_devices[] = { + MAKE_VIDPID(0x0e8f, 0x3013), /* HuiJia SNES USB adapter */ + MAKE_VIDPID(0x05a0, 0x3232), /* 8Bitdo Zero Gamepad */ +}; +static SDL_vidpid_list zero_centered_devices = { + SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES, 0, 0, NULL, + NULL, 0, 0, NULL, + SDL_arraysize(initial_zero_centered_devices), initial_zero_centered_devices, + SDL_FALSE +}; -#define CHECK_JOYSTICK_MAGIC(joystick, retval) \ - if (!joystick || joystick->magic != &joystick_magic) { \ - SDL_InvalidParamError("joystick"); \ - return retval; \ +#define CHECK_JOYSTICK_MAGIC(joystick, retval) \ + if (!joystick || joystick->magic != &SDL_joystick_magic) { \ + SDL_InvalidParamError("joystick"); \ + SDL_UnlockJoysticks(); \ + return retval; \ } -SDL_bool -SDL_JoysticksInitialized(void) +SDL_bool SDL_JoysticksInitialized(void) { return SDL_joysticks_initialized; } -SDL_bool -SDL_JoysticksQuitting(void) +SDL_bool SDL_JoysticksQuitting(void) { return SDL_joysticks_quitting; } -void -SDL_LockJoysticks(void) +void SDL_LockJoysticks(void) { - if (SDL_joystick_lock) { - SDL_LockMutex(SDL_joystick_lock); - } + (void)SDL_AtomicIncRef(&SDL_joystick_lock_pending); + SDL_LockMutex(SDL_joystick_lock); + (void)SDL_AtomicDecRef(&SDL_joystick_lock_pending); ++SDL_joysticks_locked; } -void -SDL_UnlockJoysticks(void) +void SDL_UnlockJoysticks(void) { - --SDL_joysticks_locked; + SDL_mutex *joystick_lock = SDL_joystick_lock; + SDL_bool last_unlock = SDL_FALSE; - if (SDL_joystick_lock) { - SDL_UnlockMutex(SDL_joystick_lock); + --SDL_joysticks_locked; - /* The last unlock after joysticks are uninitialized will cleanup the mutex, - * allowing applications to lock joysticks while reinitializing the system. - */ - if (!SDL_joysticks_locked && - !SDL_joysticks_initialized) { - SDL_DestroyMutex(SDL_joystick_lock); + if (!SDL_joysticks_initialized) { + if (!SDL_joysticks_locked && SDL_AtomicGet(&SDL_joystick_lock_pending) == 0) { + /* NOTE: There's a small window here where another thread could lock the mutex */ SDL_joystick_lock = NULL; + last_unlock = SDL_TRUE; } } + + SDL_UnlockMutex(joystick_lock); + + /* The last unlock after joysticks are uninitialized will cleanup the mutex, + * allowing applications to lock joysticks while reinitializing the system. + */ + if (last_unlock) { + SDL_DestroyMutex(joystick_lock); + } } -SDL_bool -SDL_JoysticksLocked(void) +SDL_bool SDL_JoysticksLocked(void) { return (SDL_joysticks_locked > 0) ? SDL_TRUE : SDL_FALSE; } -void -SDL_AssertJoysticksLocked(void) +void SDL_AssertJoysticksLocked(void) { SDL_assert(SDL_JoysticksLocked()); } @@ -184,8 +486,7 @@ SDL_AssertJoysticksLocked(void) * Get the driver and device index for an API device index * This should be called while the joystick lock is held, to prevent another thread from updating the list */ -static SDL_bool -SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriver **driver, int *driver_index) +static SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriver **driver, int *driver_index) { int i, num_joysticks, total_joysticks = 0; @@ -208,8 +509,7 @@ SDL_GetDriverAndJoystickIndex(int device_index, SDL_JoystickDriver **driver, int return SDL_FALSE; } -static int -SDL_FindFreePlayerIndex() +static int SDL_FindFreePlayerIndex(void) { int player_index; @@ -217,14 +517,13 @@ SDL_FindFreePlayerIndex() for (player_index = 0; player_index < SDL_joystick_player_count; ++player_index) { if (SDL_joystick_players[player_index] == -1) { - return player_index; + break; } } return player_index; } -static int -SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id) +static int SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id) { int player_index; @@ -241,8 +540,7 @@ SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id) return player_index; } -static SDL_JoystickID -SDL_GetJoystickIDForPlayerIndex(int player_index) +static SDL_JoystickID SDL_GetJoystickIDForPlayerIndex(int player_index) { SDL_AssertJoysticksLocked(); @@ -252,8 +550,7 @@ SDL_GetJoystickIDForPlayerIndex(int player_index) return SDL_joystick_players[player_index]; } -static SDL_bool -SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) +static SDL_bool SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) { SDL_JoystickID existing_instance = SDL_GetJoystickIDForPlayerIndex(player_index); SDL_JoystickDriver *driver; @@ -263,7 +560,7 @@ SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) SDL_AssertJoysticksLocked(); if (player_index >= SDL_joystick_player_count) { - SDL_JoystickID *new_players = (SDL_JoystickID *)SDL_realloc(SDL_joystick_players, (player_index + 1)*sizeof(*SDL_joystick_players)); + SDL_JoystickID *new_players = (SDL_JoystickID *)SDL_realloc(SDL_joystick_players, (player_index + 1) * sizeof(*SDL_joystick_players)); if (!new_players) { SDL_OutOfMemory(); return SDL_FALSE; @@ -300,8 +597,7 @@ SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID instance_id) return SDL_TRUE; } -static void SDLCALL -SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { if (SDL_GetStringBoolean(hint, SDL_FALSE)) { SDL_joystick_allows_background_events = SDL_TRUE; @@ -310,17 +606,16 @@ SDL_JoystickAllowBackgroundEventsChanged(void *userdata, const char *name, const } } -int -SDL_JoystickInit(void) +int SDL_JoystickInit(void) { int i, status; /* Create the joystick list lock */ - if (!SDL_joystick_lock) { + if (SDL_joystick_lock == NULL) { SDL_joystick_lock = SDL_CreateMutex(); } -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) { return -1; } @@ -332,10 +627,21 @@ SDL_JoystickInit(void) SDL_GameControllerInitMappings(); + SDL_LoadVIDPIDList(&arcadestick_devices); + SDL_LoadVIDPIDList(&blacklist_devices); + SDL_LoadVIDPIDList(&flightstick_devices); + SDL_LoadVIDPIDList(&gamecube_devices); + SDL_LoadVIDPIDList(&rog_gamepad_mice); + SDL_LoadVIDPIDList(&throttle_devices); + SDL_LoadVIDPIDList(&wheel_devices); + SDL_LoadVIDPIDList(&zero_centered_devices); + /* See if we should allow joystick events while in the background */ SDL_AddHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_JoystickAllowBackgroundEventsChanged, NULL); + SDL_InitSteamVirtualGamepadInfo(); + status = -1; for (i = 0; i < SDL_arraysize(SDL_joystick_drivers); ++i) { if (SDL_joystick_drivers[i]->Init() >= 0) { @@ -354,8 +660,7 @@ SDL_JoystickInit(void) /* * Count the number of joysticks attached to the system */ -int -SDL_NumJoysticks(void) +int SDL_NumJoysticks(void) { int i, total_joysticks = 0; SDL_LockJoysticks(); @@ -370,22 +675,38 @@ SDL_NumJoysticks(void) * Return the next available joystick instance ID * This may be called by drivers from multiple threads, unprotected by any locks */ -SDL_JoystickID SDL_GetNextJoystickInstanceID() +SDL_JoystickID SDL_GetNextJoystickInstanceID(void) { return SDL_AtomicIncRef(&SDL_next_joystick_instance_id); } +const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickID instance_id) +{ + SDL_JoystickDriver *driver; + int device_index; + const SDL_SteamVirtualGamepadInfo *info = NULL; + + if (SDL_SteamVirtualGamepadEnabled() && + SDL_GetDriverAndJoystickIndex(SDL_JoystickGetDeviceIndexFromInstanceID(instance_id), &driver, &device_index)) { + info = SDL_GetSteamVirtualGamepadInfo(driver->GetDeviceSteamVirtualGamepadSlot(device_index)); + } + return info; +} + /* * Get the implementation dependent name of a joystick */ -const char * -SDL_JoystickNameForIndex(int device_index) +const char *SDL_JoystickNameForIndex(int device_index) { SDL_JoystickDriver *driver; const char *name = NULL; + const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - if (SDL_GetDriverAndJoystickIndex(device_index, &driver, &device_index)) { + info = SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickGetDeviceInstanceID(device_index)); + if (info) { + name = info->name; + } else if (SDL_GetDriverAndJoystickIndex(device_index, &driver, &device_index)) { name = driver->GetDeviceName(device_index); } SDL_UnlockJoysticks(); @@ -397,8 +718,7 @@ SDL_JoystickNameForIndex(int device_index) /* * Get the implementation dependent path of a joystick */ -const char * -SDL_JoystickPathForIndex(int device_index) +const char *SDL_JoystickPathForIndex(int device_index) { SDL_JoystickDriver *driver; const char *path = NULL; @@ -419,8 +739,7 @@ SDL_JoystickPathForIndex(int device_index) /* * Get the player index of a joystick, or -1 if it's not available */ -int -SDL_JoystickGetDevicePlayerIndex(int device_index) +int SDL_JoystickGetDevicePlayerIndex(int device_index) { int player_index; @@ -436,21 +755,11 @@ SDL_JoystickGetDevicePlayerIndex(int device_index) * This isn't generally needed unless the joystick never generates an initial axis value near zero, * e.g. it's emulating axes with digital buttons */ -static SDL_bool -SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) +static SDL_bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) { #ifdef __WINRT__ return SDL_TRUE; #else - static Uint32 zero_centered_joysticks[] = { - MAKE_VIDPID(0x0e8f, 0x3013), /* HuiJia SNES USB adapter */ - MAKE_VIDPID(0x05a0, 0x3232), /* 8Bitdo Zero Gamepad */ - }; - - int i; - Uint32 id = MAKE_VIDPID(SDL_JoystickGetVendor(joystick), - SDL_JoystickGetProduct(joystick)); - /*printf("JOYSTICK '%s' VID/PID 0x%.4x/0x%.4x AXES: %d\n", joystick->name, vendor, product, joystick->naxes);*/ if (joystick->naxes == 2) { @@ -458,12 +767,7 @@ SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) return SDL_TRUE; } - for (i = 0; i < SDL_arraysize(zero_centered_joysticks); ++i) { - if (id == zero_centered_joysticks[i]) { - return SDL_TRUE; - } - } - return SDL_FALSE; + return SDL_VIDPIDInList(SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick), &zero_centered_devices); #endif /* __WINRT__ */ } @@ -474,8 +778,7 @@ SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) * * This function returns a joystick identifier, or NULL if an error occurred. */ -SDL_Joystick * -SDL_JoystickOpen(int device_index) +SDL_Joystick *SDL_JoystickOpen(int device_index) { SDL_JoystickDriver *driver; SDL_JoystickID instance_id; @@ -484,6 +787,7 @@ SDL_JoystickOpen(int device_index) const char *joystickname = NULL; const char *joystickpath = NULL; SDL_JoystickPowerLevel initial_power_level; + const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); @@ -499,22 +803,22 @@ SDL_JoystickOpen(int device_index) instance_id = driver->GetDeviceInstanceID(device_index); while (joysticklist) { if (instance_id == joysticklist->instance_id) { - joystick = joysticklist; - ++joystick->ref_count; - SDL_UnlockJoysticks(); - return joystick; + joystick = joysticklist; + ++joystick->ref_count; + SDL_UnlockJoysticks(); + return joystick; } joysticklist = joysticklist->next; } /* Create and initialize the joystick */ - joystick = (SDL_Joystick *) SDL_calloc(sizeof(*joystick), 1); - if (joystick == NULL) { + joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1); + if (!joystick) { SDL_OutOfMemory(); SDL_UnlockJoysticks(); return NULL; } - joystick->magic = &joystick_magic; + joystick->magic = &SDL_joystick_magic; joystick->driver = driver; joystick->instance_id = instance_id; joystick->attached = SDL_TRUE; @@ -544,21 +848,18 @@ SDL_JoystickOpen(int device_index) joystick->guid = driver->GetDeviceGUID(device_index); if (joystick->naxes > 0) { - joystick->axes = (SDL_JoystickAxisInfo *) SDL_calloc(joystick->naxes, sizeof(SDL_JoystickAxisInfo)); + joystick->axes = (SDL_JoystickAxisInfo *)SDL_calloc(joystick->naxes, sizeof(SDL_JoystickAxisInfo)); } if (joystick->nhats > 0) { - joystick->hats = (Uint8 *) SDL_calloc(joystick->nhats, sizeof(Uint8)); + joystick->hats = (Uint8 *)SDL_calloc(joystick->nhats, sizeof(Uint8)); } if (joystick->nballs > 0) { - joystick->balls = (struct balldelta *) SDL_calloc(joystick->nballs, sizeof(*joystick->balls)); + joystick->balls = (struct balldelta *)SDL_calloc(joystick->nballs, sizeof(*joystick->balls)); } if (joystick->nbuttons > 0) { - joystick->buttons = (Uint8 *) SDL_calloc(joystick->nbuttons, sizeof(Uint8)); + joystick->buttons = (Uint8 *)SDL_calloc(joystick->nbuttons, sizeof(Uint8)); } - if (((joystick->naxes > 0) && !joystick->axes) - || ((joystick->nhats > 0) && !joystick->hats) - || ((joystick->nballs > 0) && !joystick->balls) - || ((joystick->nbuttons > 0) && !joystick->buttons)) { + if (((joystick->naxes > 0) && !joystick->axes) || ((joystick->nhats > 0) && !joystick->hats) || ((joystick->nballs > 0) && !joystick->balls) || ((joystick->nbuttons > 0) && !joystick->buttons)) { SDL_OutOfMemory(); SDL_JoystickClose(joystick); SDL_UnlockJoysticks(); @@ -576,6 +877,12 @@ SDL_JoystickOpen(int device_index) joystick->is_game_controller = SDL_IsGameController(device_index); + /* Get the Steam Input API handle */ + info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + if (info) { + joystick->steam_handle = info->handle; + } + /* Add joystick to list */ ++joystick->ref_count; /* Link the joystick in the list */ @@ -594,9 +901,7 @@ SDL_JoystickOpen(int device_index) return joystick; } -int -SDL_JoystickAttachVirtual(SDL_JoystickType type, - int naxes, int nbuttons, int nhats) +int SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nbuttons, int nhats) { SDL_VirtualJoystickDesc desc; @@ -609,33 +914,31 @@ SDL_JoystickAttachVirtual(SDL_JoystickType type, return SDL_JoystickAttachVirtualEx(&desc); } -int -SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc) +int SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc) { -#if SDL_JOYSTICK_VIRTUAL - int result; +#ifdef SDL_JOYSTICK_VIRTUAL + int retval; SDL_LockJoysticks(); - result = SDL_JoystickAttachVirtualInner(desc); + retval = SDL_JoystickAttachVirtualInner(desc); SDL_UnlockJoysticks(); - return result; + return retval; #else return SDL_SetError("SDL not built with virtual-joystick support"); #endif } -int -SDL_JoystickDetachVirtual(int device_index) +int SDL_JoystickDetachVirtual(int device_index) { -#if SDL_JOYSTICK_VIRTUAL +#ifdef SDL_JOYSTICK_VIRTUAL SDL_JoystickDriver *driver; SDL_LockJoysticks(); if (SDL_GetDriverAndJoystickIndex(device_index, &driver, &device_index)) { if (driver == &SDL_VIRTUAL_JoystickDriver) { - const int result = SDL_JoystickDetachVirtualInner(device_index); + const int retval = SDL_JoystickDetachVirtualInner(device_index); SDL_UnlockJoysticks(); - return result; + return retval; } } SDL_UnlockJoysticks(); @@ -646,10 +949,9 @@ SDL_JoystickDetachVirtual(int device_index) #endif } -SDL_bool -SDL_JoystickIsVirtual(int device_index) +SDL_bool SDL_JoystickIsVirtual(int device_index) { -#if SDL_JOYSTICK_VIRTUAL +#ifdef SDL_JOYSTICK_VIRTUAL SDL_JoystickDriver *driver; int driver_device_index; SDL_bool is_virtual = SDL_FALSE; @@ -668,54 +970,73 @@ SDL_JoystickIsVirtual(int device_index) #endif } -int -SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value) +int SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; -#if SDL_JOYSTICK_VIRTUAL - return SDL_JoystickSetVirtualAxisInner(joystick, axis, value); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + +#ifdef SDL_JOYSTICK_VIRTUAL + retval = SDL_JoystickSetVirtualAxisInner(joystick, axis, value); #else - return SDL_SetError("SDL not built with virtual-joystick support"); + retval = SDL_SetError("SDL not built with virtual-joystick support"); #endif + } + SDL_UnlockJoysticks(); + + return retval; } -int -SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value) +int SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); -#if SDL_JOYSTICK_VIRTUAL - return SDL_JoystickSetVirtualButtonInner(joystick, button, value); +#ifdef SDL_JOYSTICK_VIRTUAL + retval = SDL_JoystickSetVirtualButtonInner(joystick, button, value); #else - return SDL_SetError("SDL not built with virtual-joystick support"); + retval = SDL_SetError("SDL not built with virtual-joystick support"); #endif + } + SDL_UnlockJoysticks(); + + return retval; } -int -SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) +int SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; -#if SDL_JOYSTICK_VIRTUAL - return SDL_JoystickSetVirtualHatInner(joystick, hat, value); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + +#ifdef SDL_JOYSTICK_VIRTUAL + retval = SDL_JoystickSetVirtualHatInner(joystick, hat, value); #else - return SDL_SetError("SDL not built with virtual-joystick support"); + retval = SDL_SetError("SDL not built with virtual-joystick support"); #endif + } + SDL_UnlockJoysticks(); + + return retval; } /* * Checks to make sure the joystick is valid. */ -SDL_bool -SDL_PrivateJoystickValid(SDL_Joystick *joystick) +SDL_bool SDL_PrivateJoystickValid(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); - return SDL_TRUE; + SDL_AssertJoysticksLocked(); + return (joystick && joystick->magic == &SDL_joystick_magic); } -SDL_bool -SDL_PrivateJoystickGetAutoGamepadMapping(int device_index, SDL_GamepadMapping * out) +SDL_bool SDL_PrivateJoystickGetAutoGamepadMapping(int device_index, SDL_GamepadMapping *out) { SDL_JoystickDriver *driver; SDL_bool is_ok = SDL_FALSE; @@ -732,145 +1053,197 @@ SDL_PrivateJoystickGetAutoGamepadMapping(int device_index, SDL_GamepadMapping * /* * Get the number of multi-dimensional axis controls on a joystick */ -int -SDL_JoystickNumAxes(SDL_Joystick *joystick) +int SDL_JoystickNumAxes(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; - return joystick->naxes; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = joystick->naxes; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the number of hats on a joystick */ -int -SDL_JoystickNumHats(SDL_Joystick *joystick) +int SDL_JoystickNumHats(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; - return joystick->nhats; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = joystick->nhats; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the number of trackballs on a joystick */ -int -SDL_JoystickNumBalls(SDL_Joystick *joystick) +int SDL_JoystickNumBalls(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; - return joystick->nballs; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = joystick->nballs; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the number of buttons on a joystick */ -int -SDL_JoystickNumButtons(SDL_Joystick *joystick) +int SDL_JoystickNumButtons(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; - return joystick->nbuttons; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = joystick->nbuttons; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the current state of an axis control on a joystick */ -Sint16 -SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) +Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis) { Sint16 state; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); - if (axis < joystick->naxes) { - state = joystick->axes[axis].value; - } else { - SDL_SetError("Joystick only has %d axes", joystick->naxes); - state = 0; + if (axis < joystick->naxes) { + state = joystick->axes[axis].value; + } else { + SDL_SetError("Joystick only has %d axes", joystick->naxes); + state = 0; + } } + SDL_UnlockJoysticks(); + return state; } /* * Get the initial state of an axis control on a joystick */ -SDL_bool -SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) +SDL_bool SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state) { - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + SDL_bool retval; - if (axis >= joystick->naxes) { - SDL_SetError("Joystick only has %d axes", joystick->naxes); - return SDL_FALSE; - } - if (state) { - *state = joystick->axes[axis].initial_value; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + + if (axis >= joystick->naxes) { + SDL_SetError("Joystick only has %d axes", joystick->naxes); + retval = SDL_FALSE; + } else { + if (state) { + *state = joystick->axes[axis].initial_value; + } + retval = joystick->axes[axis].has_initial_value; + } } - return joystick->axes[axis].has_initial_value; + SDL_UnlockJoysticks(); + + return retval; } /* * Get the current state of a hat on a joystick */ -Uint8 -SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) +Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) { Uint8 state; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); - if (hat < joystick->nhats) { - state = joystick->hats[hat]; - } else { - SDL_SetError("Joystick only has %d hats", joystick->nhats); - state = 0; + if (hat < joystick->nhats) { + state = joystick->hats[hat]; + } else { + SDL_SetError("Joystick only has %d hats", joystick->nhats); + state = 0; + } } + SDL_UnlockJoysticks(); + return state; } /* * Get the ball axis change since the last poll */ -int -SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) +int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) { int retval; - CHECK_JOYSTICK_MAGIC(joystick, -1); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); - retval = 0; - if (ball < joystick->nballs) { - if (dx) { - *dx = joystick->balls[ball].dx; - } - if (dy) { - *dy = joystick->balls[ball].dy; + if (ball < joystick->nballs) { + if (dx) { + *dx = joystick->balls[ball].dx; + } + if (dy) { + *dy = joystick->balls[ball].dy; + } + joystick->balls[ball].dx = 0; + joystick->balls[ball].dy = 0; + retval = 0; + } else { + retval = SDL_SetError("Joystick only has %d balls", joystick->nballs); } - joystick->balls[ball].dx = 0; - joystick->balls[ball].dy = 0; - } else { - return SDL_SetError("Joystick only has %d balls", joystick->nballs); } + SDL_UnlockJoysticks(); + return retval; } /* * Get the current state of a button on a joystick */ -Uint8 -SDL_JoystickGetButton(SDL_Joystick *joystick, int button) +Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) { Uint8 state; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); - if (button < joystick->nbuttons) { - state = joystick->buttons[button]; - } else { - SDL_SetError("Joystick only has %d buttons", joystick->nbuttons); - state = 0; + if (button < joystick->nbuttons) { + state = joystick->buttons[button]; + } else { + SDL_SetError("Joystick only has %d buttons", joystick->nbuttons); + state = 0; + } } + SDL_UnlockJoysticks(); + return state; } @@ -878,30 +1251,43 @@ SDL_JoystickGetButton(SDL_Joystick *joystick, int button) * Return if the joystick in question is currently attached to the system, * \return SDL_FALSE if not plugged in, SDL_TRUE if still present. */ -SDL_bool -SDL_JoystickGetAttached(SDL_Joystick *joystick) +SDL_bool SDL_JoystickGetAttached(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + SDL_bool retval; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); - return joystick->attached; + retval = joystick->attached; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Get the instance id for this opened joystick */ -SDL_JoystickID -SDL_JoystickInstanceID(SDL_Joystick *joystick) +SDL_JoystickID SDL_JoystickInstanceID(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, -1); + SDL_JoystickID retval; - return joystick->instance_id; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = joystick->instance_id; + } + SDL_UnlockJoysticks(); + + return retval; } /* * Return the SDL_Joystick associated with an instance id. */ -SDL_Joystick * -SDL_JoystickFromInstanceID(SDL_JoystickID instance_id) +SDL_Joystick *SDL_JoystickFromInstanceID(SDL_JoystickID instance_id) { SDL_Joystick *joystick; @@ -918,8 +1304,7 @@ SDL_JoystickFromInstanceID(SDL_JoystickID instance_id) /** * Return the SDL_Joystick associated with a player index. */ -SDL_Joystick * -SDL_JoystickFromPlayerIndex(int player_index) +SDL_Joystick *SDL_JoystickFromPlayerIndex(int player_index) { SDL_JoystickID instance_id; SDL_Joystick *joystick; @@ -938,296 +1323,319 @@ SDL_JoystickFromPlayerIndex(int player_index) /* * Get the friendly name of this joystick */ -const char * -SDL_JoystickName(SDL_Joystick *joystick) +const char *SDL_JoystickName(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, NULL); + const char *retval; + const SDL_SteamVirtualGamepadInfo *info; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, NULL); + + info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + if (info) { + retval = info->name; + } else { + retval = joystick->name; + } + } + SDL_UnlockJoysticks(); - return joystick->name; + /* FIXME: Really we should reference count this name so it doesn't go away after unlock */ + return retval; } /* * Get the implementation dependent path of this joystick */ -const char * -SDL_JoystickPath(SDL_Joystick *joystick) +const char *SDL_JoystickPath(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, NULL); + const char *retval; - if (!joystick->path) { - SDL_Unsupported(); - return NULL; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, NULL); + + if (joystick->path) { + retval = joystick->path; + } else { + SDL_Unsupported(); + retval = NULL; + } } - return joystick->path; + SDL_UnlockJoysticks(); + + return retval; } /** * Get the player index of an opened joystick, or -1 if it's not available */ -int -SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick) +int SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick) { - int player_index; - - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; SDL_LockJoysticks(); - player_index = SDL_GetPlayerIndexForJoystickID(joystick->instance_id); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + retval = SDL_GetPlayerIndexForJoystickID(joystick->instance_id); + } SDL_UnlockJoysticks(); - return player_index; + return retval; } /** * Set the player index of an opened joystick */ -void -SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index) +void SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index) { - CHECK_JOYSTICK_MAGIC(joystick, ); - SDL_LockJoysticks(); - SDL_SetJoystickIDForPlayerIndex(player_index, joystick->instance_id); + { + CHECK_JOYSTICK_MAGIC(joystick, ); + + SDL_SetJoystickIDForPlayerIndex(player_index, joystick->instance_id); + } SDL_UnlockJoysticks(); } -int -SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) { - int result; - - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; SDL_LockJoysticks(); - if (low_frequency_rumble == joystick->low_frequency_rumble && - high_frequency_rumble == joystick->high_frequency_rumble) { - /* Just update the expiration */ - result = 0; - } else { - result = joystick->driver->Rumble(joystick, low_frequency_rumble, high_frequency_rumble); - joystick->rumble_resend = SDL_GetTicks() + SDL_RUMBLE_RESEND_MS; - if (!joystick->rumble_resend) { - joystick->rumble_resend = 1; + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + if (low_frequency_rumble == joystick->low_frequency_rumble && + high_frequency_rumble == joystick->high_frequency_rumble) { + /* Just update the expiration */ + retval = 0; + } else { + retval = joystick->driver->Rumble(joystick, low_frequency_rumble, high_frequency_rumble); + if (retval == 0) { + joystick->rumble_resend = SDL_GetTicks() + SDL_RUMBLE_RESEND_MS; + if (joystick->rumble_resend == 0) { + joystick->rumble_resend = 1; + } + } else { + joystick->rumble_resend = 0; + } } - } - if (result == 0) { - joystick->low_frequency_rumble = low_frequency_rumble; - joystick->high_frequency_rumble = high_frequency_rumble; + if (retval == 0) { + joystick->low_frequency_rumble = low_frequency_rumble; + joystick->high_frequency_rumble = high_frequency_rumble; - if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) { - joystick->rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS); - if (!joystick->rumble_expiration) { - joystick->rumble_expiration = 1; + if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) { + joystick->rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS); + if (!joystick->rumble_expiration) { + joystick->rumble_expiration = 1; + } + } else { + joystick->rumble_expiration = 0; + joystick->rumble_resend = 0; } - } else { - joystick->rumble_expiration = 0; - joystick->rumble_resend = 0; } } SDL_UnlockJoysticks(); - return result; + return retval; } -int -SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) +int SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) { - int result; - - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; SDL_LockJoysticks(); - if (left_rumble == joystick->left_trigger_rumble && right_rumble == joystick->right_trigger_rumble) { - /* Just update the expiration */ - result = 0; - } else { - result = joystick->driver->RumbleTriggers(joystick, left_rumble, right_rumble); - } + { + CHECK_JOYSTICK_MAGIC(joystick, -1); + + if (left_rumble == joystick->left_trigger_rumble && right_rumble == joystick->right_trigger_rumble) { + /* Just update the expiration */ + retval = 0; + } else { + retval = joystick->driver->RumbleTriggers(joystick, left_rumble, right_rumble); + } - if (result == 0) { - joystick->left_trigger_rumble = left_rumble; - joystick->right_trigger_rumble = right_rumble; + if (retval == 0) { + joystick->left_trigger_rumble = left_rumble; + joystick->right_trigger_rumble = right_rumble; - if ((left_rumble || right_rumble) && duration_ms) { - joystick->trigger_rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS); - if (!joystick->trigger_rumble_expiration) { - joystick->trigger_rumble_expiration = 1; + if ((left_rumble || right_rumble) && duration_ms) { + joystick->trigger_rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS); + if (!joystick->trigger_rumble_expiration) { + joystick->trigger_rumble_expiration = 1; + } + } else { + joystick->trigger_rumble_expiration = 0; } - } else { - joystick->trigger_rumble_expiration = 0; } } SDL_UnlockJoysticks(); - return result; + return retval; } -SDL_bool -SDL_JoystickHasLED(SDL_Joystick *joystick) +SDL_bool SDL_JoystickHasLED(SDL_Joystick *joystick) { - SDL_bool result; - - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + SDL_bool retval; SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); - result = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_LED) != 0; - + retval = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_LED) != 0; + } SDL_UnlockJoysticks(); - return result; + return retval; } -SDL_bool -SDL_JoystickHasRumble(SDL_Joystick *joystick) +SDL_bool SDL_JoystickHasRumble(SDL_Joystick *joystick) { - SDL_bool result; - - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + SDL_bool retval; SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); - result = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_RUMBLE) != 0; - + retval = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_RUMBLE) != 0; + } SDL_UnlockJoysticks(); - return result; + return retval; } -SDL_bool -SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick) +SDL_bool SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick) { - SDL_bool result; - - CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); + SDL_bool retval; SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_FALSE); - result = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_RUMBLE_TRIGGERS) != 0; - + retval = (joystick->driver->GetCapabilities(joystick) & SDL_JOYCAP_RUMBLE_TRIGGERS) != 0; + } SDL_UnlockJoysticks(); - return result; + return retval; } -int -SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +int SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { - int result; + int retval; SDL_bool isfreshvalue; - CHECK_JOYSTICK_MAGIC(joystick, -1); - SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); - isfreshvalue = red != joystick->led_red || - green != joystick->led_green || - blue != joystick->led_blue; - - if (isfreshvalue || SDL_TICKS_PASSED(SDL_GetTicks(), joystick->led_expiration)) { - result = joystick->driver->SetLED(joystick, red, green, blue); - joystick->led_expiration = SDL_GetTicks() + SDL_LED_MIN_REPEAT_MS; - } else { - /* Avoid spamming the driver */ - result = 0; - } + isfreshvalue = red != joystick->led_red || + green != joystick->led_green || + blue != joystick->led_blue; - /* Save the LED value regardless of success, so we don't spam the driver */ - joystick->led_red = red; - joystick->led_green = green; - joystick->led_blue = blue; + if (isfreshvalue || SDL_TICKS_PASSED(SDL_GetTicks(), joystick->led_expiration)) { + retval = joystick->driver->SetLED(joystick, red, green, blue); + joystick->led_expiration = SDL_GetTicks() + SDL_LED_MIN_REPEAT_MS; + } else { + /* Avoid spamming the driver */ + retval = 0; + } + /* Save the LED value regardless of success, so we don't spam the driver */ + joystick->led_red = red; + joystick->led_green = green; + joystick->led_blue = blue; + } SDL_UnlockJoysticks(); - return result; + return retval; } -int -SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +int SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { - int result; - - CHECK_JOYSTICK_MAGIC(joystick, -1); + int retval; SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, -1); - result = joystick->driver->SendEffect(joystick, data, size); - + retval = joystick->driver->SendEffect(joystick, data, size); + } SDL_UnlockJoysticks(); - return result; + return retval; } /* * Close a joystick previously opened with SDL_JoystickOpen() */ -void -SDL_JoystickClose(SDL_Joystick *joystick) +void SDL_JoystickClose(SDL_Joystick *joystick) { SDL_Joystick *joysticklist; SDL_Joystick *joysticklistprev; int i; - CHECK_JOYSTICK_MAGIC(joystick, ); - SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, ); - /* First decrement ref count */ - if (--joystick->ref_count > 0) { - SDL_UnlockJoysticks(); - return; - } + /* First decrement ref count */ + if (--joystick->ref_count > 0) { + SDL_UnlockJoysticks(); + return; + } - if (joystick->rumble_expiration) { - SDL_JoystickRumble(joystick, 0, 0, 0); - } - if (joystick->trigger_rumble_expiration) { - SDL_JoystickRumbleTriggers(joystick, 0, 0, 0); - } + if (joystick->rumble_expiration) { + SDL_JoystickRumble(joystick, 0, 0, 0); + } + if (joystick->trigger_rumble_expiration) { + SDL_JoystickRumbleTriggers(joystick, 0, 0, 0); + } - joystick->driver->Close(joystick); - joystick->hwdata = NULL; - joystick->magic = NULL; + joystick->driver->Close(joystick); + joystick->hwdata = NULL; + joystick->magic = NULL; - joysticklist = SDL_joysticks; - joysticklistprev = NULL; - while (joysticklist) { - if (joystick == joysticklist) { - if (joysticklistprev) { - /* unlink this entry */ - joysticklistprev->next = joysticklist->next; - } else { - SDL_joysticks = joystick->next; + joysticklist = SDL_joysticks; + joysticklistprev = NULL; + while (joysticklist) { + if (joystick == joysticklist) { + if (joysticklistprev) { + /* unlink this entry */ + joysticklistprev->next = joysticklist->next; + } else { + SDL_joysticks = joystick->next; + } + break; } - break; + joysticklistprev = joysticklist; + joysticklist = joysticklist->next; } - joysticklistprev = joysticklist; - joysticklist = joysticklist->next; - } - SDL_free(joystick->name); - SDL_free(joystick->path); - SDL_free(joystick->serial); + SDL_free(joystick->name); + SDL_free(joystick->path); + SDL_free(joystick->serial); - /* Free the data associated with this joystick */ - SDL_free(joystick->axes); - SDL_free(joystick->hats); - SDL_free(joystick->balls); - SDL_free(joystick->buttons); - for (i = 0; i < joystick->ntouchpads; i++) { - SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[i]; - SDL_free(touchpad->fingers); + /* Free the data associated with this joystick */ + SDL_free(joystick->axes); + SDL_free(joystick->hats); + SDL_free(joystick->balls); + SDL_free(joystick->buttons); + for (i = 0; i < joystick->ntouchpads; i++) { + SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[i]; + SDL_free(touchpad->fingers); + } + SDL_free(joystick->touchpads); + SDL_free(joystick->sensors); + SDL_free(joystick); } - SDL_free(joystick->touchpads); - SDL_free(joystick->sensors); - SDL_free(joystick); - SDL_UnlockJoysticks(); } -void -SDL_JoystickQuit(void) +void SDL_JoystickQuit(void) { int i; @@ -1243,7 +1651,7 @@ SDL_JoystickQuit(void) /* Quit drivers in reverse order to avoid breaking dependencies between drivers */ for (i = SDL_arraysize(SDL_joystick_drivers) - 1; i >= 0; --i) { - SDL_joystick_drivers[i]->Quit(); + SDL_joystick_drivers[i]->Quit(); } if (SDL_joystick_players) { @@ -1252,13 +1660,24 @@ SDL_JoystickQuit(void) SDL_joystick_player_count = 0; } -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_QuitSubSystem(SDL_INIT_EVENTS); #endif + SDL_QuitSteamVirtualGamepadInfo(); + SDL_DelHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_JoystickAllowBackgroundEventsChanged, NULL); + SDL_FreeVIDPIDList(&arcadestick_devices); + SDL_FreeVIDPIDList(&blacklist_devices); + SDL_FreeVIDPIDList(&flightstick_devices); + SDL_FreeVIDPIDList(&gamecube_devices); + SDL_FreeVIDPIDList(&rog_gamepad_mice); + SDL_FreeVIDPIDList(&throttle_devices); + SDL_FreeVIDPIDList(&wheel_devices); + SDL_FreeVIDPIDList(&zero_centered_devices); + SDL_GameControllerQuitMappings(); SDL_joysticks_quitting = SDL_FALSE; @@ -1267,9 +1686,7 @@ SDL_JoystickQuit(void) SDL_UnlockJoysticks(); } - -static SDL_bool -SDL_PrivateJoystickShouldIgnoreEvent() +static SDL_bool SDL_PrivateJoystickShouldIgnoreEvent(void) { if (SDL_joystick_allows_background_events) { return SDL_FALSE; @@ -1289,7 +1706,7 @@ void SDL_PrivateJoystickAddTouchpad(SDL_Joystick *joystick, int nfingers) int ntouchpads; SDL_JoystickTouchpadInfo *touchpads; - CHECK_JOYSTICK_MAGIC(joystick, ); + SDL_AssertJoysticksLocked(); ntouchpads = joystick->ntouchpads + 1; touchpads = (SDL_JoystickTouchpadInfo *)SDL_realloc(joystick->touchpads, (ntouchpads * sizeof(SDL_JoystickTouchpadInfo))); @@ -1316,7 +1733,7 @@ void SDL_PrivateJoystickAddSensor(SDL_Joystick *joystick, SDL_SensorType type, f int nsensors; SDL_JoystickSensorInfo *sensors; - CHECK_JOYSTICK_MAGIC(joystick, ); + SDL_AssertJoysticksLocked(); nsensors = joystick->nsensors + 1; sensors = (SDL_JoystickSensorInfo *)SDL_realloc(joystick->sensors, (nsensors * sizeof(SDL_JoystickSensorInfo))); @@ -1349,7 +1766,10 @@ void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance) } if (SDL_GetDriverAndJoystickIndex(device_index, &driver, &driver_device_index)) { - player_index = driver->GetDevicePlayerIndex(driver_device_index); + player_index = driver->GetDeviceSteamVirtualGamepadSlot(driver_device_index); + if (player_index < 0) { + player_index = driver->GetDevicePlayerIndex(driver_device_index); + } } if (player_index < 0 && SDL_IsGameController(device_index)) { player_index = SDL_FindFreePlayerIndex(); @@ -1358,7 +1778,7 @@ void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance) SDL_SetJoystickIDForPlayerIndex(player_index, device_instance); } -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED { SDL_Event event; @@ -1372,6 +1792,7 @@ void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance) #endif /* !SDL_EVENTS_DISABLED */ } +#ifndef SDL_EVENTS_DISABLED /* * If there is an existing add event in the queue, it needs to be modified * to have the right value for which, because the number of controllers in @@ -1431,13 +1852,13 @@ static void UpdateEventsForDeviceRemoval(int device_index, Uint32 type) SDL_small_free(events, isstack); } +#endif -void -SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick) +void SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick) { int i, j; - CHECK_JOYSTICK_MAGIC(joystick, ); + SDL_AssertJoysticksLocked(); /* Tell the app that everything is centered/unpressed... */ for (i = 0; i < joystick->naxes; i++) { @@ -1468,7 +1889,7 @@ void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance) SDL_Joystick *joystick = NULL; int player_index; int device_index; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_Event event; #endif @@ -1486,7 +1907,7 @@ void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance) ++device_index; } -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_zero(event); event.type = SDL_JOYDEVICEREMOVED; @@ -1505,16 +1926,13 @@ void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance) } } -int -SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) +int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) { int posted; SDL_JoystickAxisInfo *info; SDL_AssertJoysticksLocked(); - CHECK_JOYSTICK_MAGIC(joystick, 0); - /* Make sure we're not getting garbage or duplicate events */ if (axis >= joystick->naxes) { return 0; @@ -1534,7 +1952,7 @@ SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) } if (!info->sent_initial_value) { /* Make sure we don't send motion until there's real activity on this axis */ - const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */ + const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */ if (SDL_abs(value - info->value) <= MAX_ALLOWED_JITTER && !SDL_IsJoystickVirtual(joystick->guid)) { return 0; @@ -1561,7 +1979,7 @@ SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) { SDL_Event event; event.type = SDL_JOYAXISMOTION; @@ -1574,15 +1992,12 @@ SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value) return posted; } -int -SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) +int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) { int posted; SDL_AssertJoysticksLocked(); - CHECK_JOYSTICK_MAGIC(joystick, 0); - /* Make sure we're not getting garbage or duplicate events */ if (hat >= joystick->nhats) { return 0; @@ -1605,7 +2020,7 @@ SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_JOYHATMOTION) == SDL_ENABLE) { SDL_Event event; event.jhat.type = SDL_JOYHATMOTION; @@ -1618,16 +2033,12 @@ SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value) return posted; } -int -SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, - Sint16 xrel, Sint16 yrel) +int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, Sint16 xrel, Sint16 yrel) { int posted; SDL_AssertJoysticksLocked(); - CHECK_JOYSTICK_MAGIC(joystick, 0); - /* Make sure we're not getting garbage events */ if (ball >= joystick->nballs) { return 0; @@ -1644,7 +2055,7 @@ SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_JOYBALLMOTION) == SDL_ENABLE) { SDL_Event event; event.jball.type = SDL_JOYBALLMOTION; @@ -1658,14 +2069,13 @@ SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball, return posted; } -int -SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) +int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) { int posted; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_Event event; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_AssertJoysticksLocked(); switch (state) { case SDL_PRESSED: @@ -1703,7 +2113,7 @@ SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(event.type) == SDL_ENABLE) { event.jbutton.which = joystick->instance_id; event.jbutton.button = button; @@ -1714,8 +2124,44 @@ SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state) return posted; } -void -SDL_JoystickUpdate(void) +static void SendSteamHandleUpdateEvents(void) +{ + SDL_Joystick *joystick; + const SDL_SteamVirtualGamepadInfo *info; + + /* Check to see if any Steam handles changed */ + for (joystick = SDL_joysticks; joystick; joystick = joystick->next) { + SDL_bool changed = SDL_FALSE; + + if (!joystick->is_game_controller) { + continue; + } + + info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + if (info) { + if (joystick->steam_handle != info->handle) { + joystick->steam_handle = info->handle; + changed = SDL_TRUE; + } + } else { + if (joystick->steam_handle != 0) { + joystick->steam_handle = 0; + changed = SDL_TRUE; + } + } + if (changed) { + SDL_Event event; + + SDL_zero(event); + event.type = SDL_CONTROLLERSTEAMHANDLEUPDATED; + event.common.timestamp = 0; + event.cdevice.which = joystick->instance_id; + SDL_PushEvent(&event); + } + } +} + +void SDL_JoystickUpdate(void) { int i; Uint32 now; @@ -1727,18 +2173,24 @@ SDL_JoystickUpdate(void) SDL_LockJoysticks(); + if (SDL_UpdateSteamVirtualGamepadInfo()) { + SendSteamHandleUpdateEvents(); + } + #ifdef SDL_JOYSTICK_HIDAPI /* Special function for HIDAPI devices, as a single device can provide multiple SDL_Joysticks */ HIDAPI_UpdateDevices(); #endif /* SDL_JOYSTICK_HIDAPI */ for (joystick = SDL_joysticks; joystick; joystick = joystick->next) { - if (joystick->attached) { - joystick->driver->Update(joystick); + if (!joystick->attached) { + continue; + } - if (joystick->delayed_guide_button) { - SDL_GameControllerHandleDelayedGuideButton(joystick); - } + joystick->driver->Update(joystick); + + if (joystick->delayed_guide_button) { + SDL_GameControllerHandleDelayedGuideButton(joystick); } now = SDL_GetTicks(); @@ -1773,11 +2225,10 @@ SDL_JoystickUpdate(void) SDL_UnlockJoysticks(); } -int -SDL_JoystickEventState(int state) +int SDL_JoystickEventState(int state) { -#if SDL_EVENTS_DISABLED - return SDL_DISABLE; +#ifdef SDL_EVENTS_DISABLED + return SDL_IGNORE; #else const Uint32 event_list[] = { SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION, @@ -1811,7 +2262,7 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod Uint16 *guid16 = (Uint16 *)guid.data; Uint16 bus = SDL_SwapLE16(guid16[0]); - if (bus < ' ' && guid16[3] == 0x0000 && guid16[5] == 0x0000) { + if ((bus < ' ' || bus == SDL_HARDWARE_BUS_VIRTUAL) && guid16[3] == 0x0000 && guid16[5] == 0x0000) { /* This GUID fits the standard form: * 16-bit bus * 16-bit CRC16 of the joystick name (can be zero) @@ -1835,7 +2286,7 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod if (crc16) { *crc16 = SDL_SwapLE16(guid16[1]); } - } else if (bus < ' ') { + } else if (bus < ' ' || bus == SDL_HARDWARE_BUS_VIRTUAL) { /* This GUID fits the unknown VID/PID form: * 16-bit bus * 16-bit CRC16 of the joystick name (can be zero) @@ -1869,12 +2320,11 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod } } -static int -PrefixMatch(const char *a, const char *b) +static int PrefixMatch(const char *a, const char *b) { int matchlen = 0; while (*a && *b) { - if (SDL_tolower((unsigned char) *a++) == SDL_tolower((unsigned char) *b++)) { + if (SDL_tolower((unsigned char)*a++) == SDL_tolower((unsigned char)*b++)) { ++matchlen; } else { break; @@ -1883,20 +2333,22 @@ PrefixMatch(const char *a, const char *b) return matchlen; } -char * -SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, const char *product_name) +char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, const char *product_name) { - static struct { + static struct + { const char *prefix; const char *replacement; } replacements[] = { { "ASTRO Gaming", "ASTRO" }, { "Bensussen Deutsch & Associates,Inc.(BDA)", "BDA" }, - { "NVIDIA Corporation ", "" }, - { "Performance Designed Products", "PDP" }, - { "HORI CO.,LTD.", "HORI" }, + { "Guangzhou Chicken Run Network Technology Co., Ltd.", "GameSir" }, { "HORI CO.,LTD", "HORI" }, + { "HORI CO.,LTD.", "HORI" }, { "Mad Catz Inc.", "Mad Catz" }, + { "Nintendo Co., Ltd.", "Nintendo" }, + { "NVIDIA Corporation ", "" }, + { "Performance Designed Products", "PDP" }, { "QANBA USA, LLC", "Qanba" }, { "QANBA USA,LLC", "Qanba" }, { "Unknown ", "" }, @@ -1928,7 +2380,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c len = (SDL_strlen(vendor_name) + 1 + SDL_strlen(product_name) + 1); name = (char *)SDL_malloc(len); if (name) { - SDL_snprintf(name, len, "%s %s", vendor_name, product_name); + (void)SDL_snprintf(name, len, "%s %s", vendor_name, product_name); } } else if (*product_name) { name = SDL_strdup(product_name); @@ -1948,7 +2400,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c name = SDL_strdup("PS4 Controller"); break; case SDL_CONTROLLER_TYPE_PS5: - name = SDL_strdup("PS5 Controller"); + name = SDL_strdup("DualSense Wireless Controller"); break; case SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO: name = SDL_strdup("Nintendo Switch Pro Controller"); @@ -1957,7 +2409,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c len = (6 + 1 + 6 + 1); name = (char *)SDL_malloc(len); if (name) { - SDL_snprintf(name, len, "0x%.4x/0x%.4x", vendor, product); + (void)SDL_snprintf(name, len, "0x%.4x/0x%.4x", vendor, product); } break; } @@ -1976,9 +2428,9 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c name[len] = '\0'; /* Compress duplicate spaces */ - for (i = 0; i < (len - 1); ) { - if (name[i] == ' ' && name[i+1] == ' ') { - SDL_memmove(&name[i], &name[i+1], (len - i)); + for (i = 0; i < (len - 1);) { + if (name[i] == ' ' && name[i + 1] == ' ') { + SDL_memmove(&name[i], &name[i + 1], (len - i)); --len; } else { ++i; @@ -1992,7 +2444,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c size_t replacementlen = SDL_strlen(replacements[i].replacement); if (replacementlen <= prefixlen) { SDL_memcpy(name, replacements[i].replacement, replacementlen); - SDL_memmove(name+replacementlen, name+prefixlen, (len-prefixlen)+1); + SDL_memmove(name + replacementlen, name + prefixlen, (len - prefixlen) + 1); len -= (prefixlen - replacementlen); } else { /* FIXME: Need to handle the expand case by reallocating the string */ @@ -2007,7 +2459,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c for (i = 1; i < (len - 1); ++i) { int matchlen = PrefixMatch(name, &name[i]); while (matchlen > 0) { - if (name[matchlen] == ' ') { + if (name[matchlen] == ' ' || name[matchlen] == '-') { SDL_memmove(name, name + matchlen + 1, len - matchlen); break; } @@ -2022,24 +2474,28 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c return name; } -SDL_JoystickGUID -SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *name, Uint8 driver_signature, Uint8 driver_data) +SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data) { SDL_JoystickGUID guid; Uint16 *guid16 = (Uint16 *)guid.data; + Uint16 crc = 0; SDL_zero(guid); - if (!name) { - name = ""; + if (vendor_name && *vendor_name && product_name && *product_name) { + crc = SDL_crc16(crc, vendor_name, SDL_strlen(vendor_name)); + crc = SDL_crc16(crc, " ", 1); + crc = SDL_crc16(crc, product_name, SDL_strlen(product_name)); + } else if (product_name) { + crc = SDL_crc16(crc, product_name, SDL_strlen(product_name)); } /* We only need 16 bits for each of these; space them out to fill 128. */ /* Byteswap so devices get same GUID on little/big endian platforms. */ *guid16++ = SDL_SwapLE16(bus); - *guid16++ = SDL_SwapLE16(SDL_crc16(0, name, SDL_strlen(name))); + *guid16++ = SDL_SwapLE16(crc); - if (vendor && product) { + if (vendor) { *guid16++ = SDL_SwapLE16(vendor); *guid16++ = 0; *guid16++ = SDL_SwapLE16(product); @@ -2055,15 +2511,16 @@ SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version guid.data[14] = driver_signature; guid.data[15] = driver_data; } - SDL_strlcpy((char*)guid16, name, available_space); + if (product_name) { + SDL_strlcpy((char *)guid16, product_name, available_space); + } } return guid; } -SDL_JoystickGUID -SDL_CreateJoystickGUIDForName(const char *name) +SDL_JoystickGUID SDL_CreateJoystickGUIDForName(const char *name) { - return SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_UNKNOWN, 0, 0, 0, name, 0, 0); + return SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_UNKNOWN, 0, 0, 0, NULL, name, 0, 0); } void SDL_SetJoystickGUIDVendor(SDL_JoystickGUID *guid, Uint16 vendor) @@ -2087,16 +2544,14 @@ void SDL_SetJoystickGUIDVersion(SDL_JoystickGUID *guid, Uint16 version) guid16[6] = SDL_SwapLE16(version); } -void -SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc) +void SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc) { Uint16 *guid16 = (Uint16 *)guid->data; guid16[1] = SDL_SwapLE16(crc); } -SDL_GameControllerType -SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const char *name, SDL_bool forUI) +SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const char *name, SDL_bool forUI) { SDL_GameControllerType type = SDL_CONTROLLER_TYPE_UNKNOWN; @@ -2113,9 +2568,6 @@ SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const } else if (vendor == 0x0001 && product == 0x0001) { type = SDL_CONTROLLER_TYPE_UNKNOWN; - } else if (vendor == USB_VENDOR_MICROSOFT && product == USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER) { - type = SDL_CONTROLLER_TYPE_XBOXONE; - } else if ((vendor == USB_VENDOR_AMAZON && product == USB_PRODUCT_AMAZON_LUNA_CONTROLLER) || (vendor == BLUETOOTH_VENDOR_AMAZON && product == BLUETOOTH_PRODUCT_LUNA_CONTROLLER)) { type = SDL_CONTROLLER_TYPE_AMAZON_LUNA; @@ -2191,8 +2643,7 @@ SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const return type; } -SDL_GameControllerType -SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *name) +SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *name) { SDL_GameControllerType type; Uint16 vendor, product; @@ -2216,28 +2667,42 @@ SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *nam return type; } -SDL_bool -SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_JoystickGUIDUsesVersion(SDL_JoystickGUID guid) +{ + Uint16 vendor, product; + + if (SDL_IsJoystickMFI(guid)) { + /* The version bits are used as button capability mask */ + return SDL_FALSE; + } + + SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); + if (vendor && product) { + return SDL_TRUE; + } + return SDL_FALSE; +} + +SDL_bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_XBoxOneController); + return eType == k_eControllerType_XBoxOneController; } -SDL_bool -SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id) { if (vendor_id == USB_VENDOR_MICROSOFT) { if (product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1 || product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 || - product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH) { + product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH || + product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLE) { return SDL_TRUE; } } return SDL_FALSE; } -SDL_bool -SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id) { if (vendor_id == USB_VENDOR_MICROSOFT) { if (product_id == USB_PRODUCT_XBOX_SERIES_X || @@ -2260,20 +2725,48 @@ SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id) } } if (vendor_id == USB_VENDOR_HORI) { - if (product_id == USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X) { + if (product_id == USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X || + product_id == USB_PRODUCT_HORI_HORIPAD_PRO_SERIES_X) { + return SDL_TRUE; + } + } + if (vendor_id == USB_VENDOR_RAZER) { + if (product_id == USB_PRODUCT_RAZER_WOLVERINE_V2 || + product_id == USB_PRODUCT_RAZER_WOLVERINE_V2_CHROMA) { + return SDL_TRUE; + } + } + if (vendor_id == USB_VENDOR_THRUSTMASTER) { + if (product_id == USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO) { + return SDL_TRUE; + } + } + if (vendor_id == USB_VENDOR_TURTLE_BEACH) { + if (product_id == USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R || + product_id == USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON) { return SDL_TRUE; } } if (vendor_id == USB_VENDOR_8BITDO) { - if (product_id == USB_PRODUCT_8BITDO_XBOX_CONTROLLER) { + if (product_id == USB_PRODUCT_8BITDO_XBOX_CONTROLLER1 || + product_id == USB_PRODUCT_8BITDO_XBOX_CONTROLLER2) { + return SDL_TRUE; + } + } + if (vendor_id == USB_VENDOR_GAMESIR) { + if (product_id == USB_PRODUCT_GAMESIR_G7) { + return SDL_TRUE; + } + } + if (vendor_id == USB_VENDOR_ASUS) { + if (product_id == USB_PRODUCT_ROG_RAIKIRI) { return SDL_TRUE; } } return SDL_FALSE; } -SDL_bool -SDL_IsJoystickBluetoothXboxOne(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickBluetoothXboxOne(Uint16 vendor_id, Uint16 product_id) { if (vendor_id == USB_VENDOR_MICROSOFT) { if (product_id == USB_PRODUCT_XBOX_ONE_ADAPTIVE_BLUETOOTH || @@ -2290,250 +2783,182 @@ SDL_IsJoystickBluetoothXboxOne(Uint16 vendor_id, Uint16 product_id) return SDL_FALSE; } -SDL_bool -SDL_IsJoystickPS4(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickPS4(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_PS4Controller); + return eType == k_eControllerType_PS4Controller; } -SDL_bool -SDL_IsJoystickPS5(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickPS5(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_PS5Controller); + return eType == k_eControllerType_PS5Controller; +} + +SDL_bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id) +{ + if (vendor_id == USB_VENDOR_SONY) { + if (product_id == USB_PRODUCT_SONY_DS5_EDGE) { + return SDL_TRUE; + } + } + return SDL_FALSE; } -SDL_bool -SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SwitchProController || - eType == k_eControllerType_SwitchInputOnlyController); + return eType == k_eControllerType_SwitchProController || eType == k_eControllerType_SwitchInputOnlyController; } -SDL_bool -SDL_IsJoystickNintendoSwitchProInputOnly(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchProInputOnly(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SwitchInputOnlyController); + return eType == k_eControllerType_SwitchInputOnlyController; } -SDL_bool -SDL_IsJoystickNintendoSwitchJoyCon(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchJoyCon(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SwitchJoyConLeft || - eType == k_eControllerType_SwitchJoyConRight); + return eType == k_eControllerType_SwitchJoyConLeft || eType == k_eControllerType_SwitchJoyConRight; } -SDL_bool -SDL_IsJoystickNintendoSwitchJoyConLeft(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchJoyConLeft(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SwitchJoyConLeft); + return eType == k_eControllerType_SwitchJoyConLeft; } -SDL_bool -SDL_IsJoystickNintendoSwitchJoyConRight(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchJoyConRight(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SwitchJoyConRight); + return eType == k_eControllerType_SwitchJoyConRight; +} + +SDL_bool SDL_IsJoystickNintendoSwitchJoyConGrip(Uint16 vendor_id, Uint16 product_id) +{ + return vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP; } -SDL_bool -SDL_IsJoystickNintendoSwitchJoyConGrip(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickNintendoSwitchJoyConPair(Uint16 vendor_id, Uint16 product_id) { - return (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP); + return vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR; +} + +SDL_bool SDL_IsJoystickSteamVirtualGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version) +{ +#ifdef __MACOSX__ + return (vendor_id == USB_VENDOR_MICROSOFT && product_id == USB_PRODUCT_XBOX360_WIRED_CONTROLLER && version == 0); +#else + return (vendor_id == USB_VENDOR_VALVE && product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD); +#endif } -SDL_bool -SDL_IsJoystickNintendoSwitchJoyConPair(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_id) { - return (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR); + EControllerType eType = GuessControllerType(vendor_id, product_id); + return eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2; } -SDL_bool -SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_id) +SDL_bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id) { EControllerType eType = GuessControllerType(vendor_id, product_id); - return (eType == k_eControllerType_SteamController || - eType == k_eControllerType_SteamControllerV2); + return eType == k_eControllerType_SteamDeck; } -SDL_bool -SDL_IsJoystickXInput(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickXInput(SDL_JoystickGUID guid) { return (guid.data[14] == 'x') ? SDL_TRUE : SDL_FALSE; } -SDL_bool -SDL_IsJoystickWGI(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickWGI(SDL_JoystickGUID guid) { return (guid.data[14] == 'w') ? SDL_TRUE : SDL_FALSE; } -SDL_bool -SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid) { return (guid.data[14] == 'h') ? SDL_TRUE : SDL_FALSE; } -SDL_bool -SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickMFI(SDL_JoystickGUID guid) +{ + return (guid.data[14] == 'm') ? SDL_TRUE : SDL_FALSE; +} + +SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid) { return (guid.data[14] == 'r') ? SDL_TRUE : SDL_FALSE; } -SDL_bool -SDL_IsJoystickVirtual(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickVirtual(SDL_JoystickGUID guid) { return (guid.data[14] == 'v') ? SDL_TRUE : SDL_FALSE; } -static SDL_bool SDL_IsJoystickProductWheel(Uint32 vidpid) -{ - static Uint32 wheel_joysticks[] = { - MAKE_VIDPID(0x046d, 0xc294), /* Logitech generic wheel */ - MAKE_VIDPID(0x046d, 0xc295), /* Logitech Momo Force */ - MAKE_VIDPID(0x046d, 0xc298), /* Logitech Driving Force Pro */ - MAKE_VIDPID(0x046d, 0xc299), /* Logitech G25 */ - MAKE_VIDPID(0x046d, 0xc29a), /* Logitech Driving Force GT */ - MAKE_VIDPID(0x046d, 0xc29b), /* Logitech G27 */ - MAKE_VIDPID(0x046d, 0xc24f), /* Logitech G29 (PS3) */ - MAKE_VIDPID(0x046d, 0xc260), /* Logitech G29 (PS4) */ - MAKE_VIDPID(0x046d, 0xc261), /* Logitech G920 (initial mode) */ - MAKE_VIDPID(0x046d, 0xc262), /* Logitech G920 (active mode) */ - MAKE_VIDPID(0x046d, 0xc26e), /* Logitech G923 */ - MAKE_VIDPID(0x046d, 0xca03), /* Logitech Momo Racing */ - MAKE_VIDPID(0x044f, 0xb65d), /* Thrustmaster Wheel FFB */ - MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster Wheel FFB */ - MAKE_VIDPID(0x044f, 0xb677), /* Thrustmaster T150 */ - MAKE_VIDPID(0x044f, 0xb696), /* Thrustmaster T248 */ - MAKE_VIDPID(0x044f, 0xb66e), /* Thrustmaster T300RS (normal mode) */ - MAKE_VIDPID(0x044f, 0xb66f), /* Thrustmaster T300RS (advanced mode) */ - MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster T300RS (PS4 mode) */ - MAKE_VIDPID(0x044f, 0xb65e), /* Thrustmaster T500RS */ - MAKE_VIDPID(0x044f, 0xb664), /* Thrustmaster TX (initial mode) */ - MAKE_VIDPID(0x044f, 0xb669), /* Thrustmaster TX (active mode) */ - }; - int i; - - for (i = 0; i < SDL_arraysize(wheel_joysticks); ++i) { - if (vidpid == wheel_joysticks[i]) { - return SDL_TRUE; - } - } - return SDL_FALSE; +static SDL_bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id) +{ + return SDL_VIDPIDInList(vendor_id, product_id, &wheel_devices); } -static SDL_bool SDL_IsJoystickProductArcadeStick(Uint32 vidpid) -{ - static Uint32 arcadestick_joysticks[] = { - MAKE_VIDPID(0x0079, 0x181a), /* Venom Arcade Stick */ - MAKE_VIDPID(0x0079, 0x181b), /* Venom Arcade Stick */ - MAKE_VIDPID(0x0c12, 0x0ef6), /* Hitbox Arcade Stick */ - MAKE_VIDPID(0x0e6f, 0x0109), /* PDP Versus Fighting Pad */ - MAKE_VIDPID(0x0f0d, 0x0016), /* Hori Real Arcade Pro.EX */ - MAKE_VIDPID(0x0f0d, 0x001b), /* Hori Real Arcade Pro VX */ - MAKE_VIDPID(0x0f0d, 0x0063), /* Hori Real Arcade Pro Hayabusa (USA) Xbox One */ - MAKE_VIDPID(0x0f0d, 0x006a), /* Real Arcade Pro 4 */ - MAKE_VIDPID(0x0f0d, 0x0078), /* Hori Real Arcade Pro V Kai Xbox One */ - MAKE_VIDPID(0x0f0d, 0x008a), /* HORI Real Arcade Pro 4 */ - MAKE_VIDPID(0x0f0d, 0x008c), /* Hori Real Arcade Pro 4 */ - MAKE_VIDPID(0x0f0d, 0x00aa), /* HORI Real Arcade Pro V Hayabusa in Switch Mode */ - MAKE_VIDPID(0x0f0d, 0x00ed), /* Hori Fighting Stick mini 4 kai */ - MAKE_VIDPID(0x0f0d, 0x011c), /* Hori Fighting Stick α in PS4 Mode */ - MAKE_VIDPID(0x0f0d, 0x011e), /* Hori Fighting Stick α in PC Mode */ - MAKE_VIDPID(0x0f0d, 0x0184), /* Hori Fighting Stick α in PS5 Mode */ - MAKE_VIDPID(0x1532, 0x0a00), /* Razer Atrox Arcade Stick */ - MAKE_VIDPID(0x1bad, 0xf03d), /* Street Fighter IV Arcade Stick TE - Chun Li */ - MAKE_VIDPID(0x1bad, 0xf502), /* Hori Real Arcade Pro.VX SA */ - MAKE_VIDPID(0x1bad, 0xf504), /* Hori Real Arcade Pro. EX */ - MAKE_VIDPID(0x1bad, 0xf506), /* Hori Real Arcade Pro.EX Premium VLX */ - MAKE_VIDPID(0x20d6, 0xa715), /* PowerA Nintendo Switch Fusion Arcade Stick */ - MAKE_VIDPID(0x24c6, 0x5000), /* Razer Atrox Arcade Stick */ - MAKE_VIDPID(0x24c6, 0x5501), /* Hori Real Arcade Pro VX-SA */ - MAKE_VIDPID(0x24c6, 0x550e), /* Hori Real Arcade Pro V Kai 360 */ - MAKE_VIDPID(0x2c22, 0x2300), /* Qanba Obsidian Arcade Joystick in PS4 Mode */ - MAKE_VIDPID(0x2c22, 0x2302), /* Qanba Obsidian Arcade Joystick in PS3 Mode */ - MAKE_VIDPID(0x2c22, 0x2303), /* Qanba Obsidian Arcade Joystick in PC Mode */ - MAKE_VIDPID(0x2c22, 0x2500), /* Qanba Dragon Arcade Joystick in PS4 Mode */ - MAKE_VIDPID(0x2c22, 0x2502), /* Qanba Dragon Arcade Joystick in PS3 Mode */ - MAKE_VIDPID(0x2c22, 0x2503), /* Qanba Dragon Arcade Joystick in PC Mode */ - }; - int i; - - for (i = 0; i < SDL_arraysize(arcadestick_joysticks); ++i) { - if (vidpid == arcadestick_joysticks[i]) { - return SDL_TRUE; - } - } - return SDL_FALSE; +static SDL_bool SDL_IsJoystickArcadeStick(Uint16 vendor_id, Uint16 product_id) +{ + return SDL_VIDPIDInList(vendor_id, product_id, &arcadestick_devices); } -static SDL_bool SDL_IsJoystickProductFlightStick(Uint32 vidpid) +static SDL_bool SDL_IsJoystickFlightStick(Uint16 vendor_id, Uint16 product_id) { - static Uint32 flightstick_joysticks[] = { - MAKE_VIDPID(0x044f, 0x0402), /* HOTAS Warthog Joystick */ - MAKE_VIDPID(0x0738, 0x2221), /* Saitek Pro Flight X-56 Rhino Stick */ - MAKE_VIDPID(0x044f, 0xb10a), /* ThrustMaster, Inc. T.16000M Joystick */ - MAKE_VIDPID(0x046d, 0xc215), /* Logitech Extreme 3D */ - MAKE_VIDPID(0x231d, 0x0126), /* Gunfighter Mk.III ‘Space Combat Edition’ (right) */ - MAKE_VIDPID(0x231d, 0x0127), /* Gunfighter Mk.III ‘Space Combat Edition’ (left) */ - }; - int i; - - for (i = 0; i < SDL_arraysize(flightstick_joysticks); ++i) { - if (vidpid == flightstick_joysticks[i]) { - return SDL_TRUE; - } - } - return SDL_FALSE; + return SDL_VIDPIDInList(vendor_id, product_id, &flightstick_devices); } -static SDL_bool SDL_IsJoystickProductThrottle(Uint32 vidpid) +static SDL_bool SDL_IsJoystickThrottle(Uint16 vendor_id, Uint16 product_id) { - static Uint32 throttle_joysticks[] = { - MAKE_VIDPID(0x044f, 0x0404), /* HOTAS Warthog Throttle */ - MAKE_VIDPID(0x0738, 0xa221), /* Saitek Pro Flight X-56 Rhino Throttle */ - }; - int i; - - for (i = 0; i < SDL_arraysize(throttle_joysticks); ++i) { - if (vidpid == throttle_joysticks[i]) { - return SDL_TRUE; - } - } - return SDL_FALSE; + return SDL_VIDPIDInList(vendor_id, product_id, &throttle_devices); } static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid) { Uint16 vendor; Uint16 product; - Uint32 vidpid; + + SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); + + if (SDL_IsJoystickWheel(vendor, product)) { + return SDL_JOYSTICK_TYPE_WHEEL; + } + + if (SDL_IsJoystickArcadeStick(vendor, product)) { + return SDL_JOYSTICK_TYPE_ARCADE_STICK; + } + + if (SDL_IsJoystickFlightStick(vendor, product)) { + return SDL_JOYSTICK_TYPE_FLIGHT_STICK; + } + + if (SDL_IsJoystickThrottle(vendor, product)) { + return SDL_JOYSTICK_TYPE_THROTTLE; + } if (SDL_IsJoystickXInput(guid)) { /* XInput GUID, get the type based on the XInput device subtype */ switch (guid.data[15]) { - case 0x01: /* XINPUT_DEVSUBTYPE_GAMEPAD */ + case 0x01: /* XINPUT_DEVSUBTYPE_GAMEPAD */ return SDL_JOYSTICK_TYPE_GAMECONTROLLER; - case 0x02: /* XINPUT_DEVSUBTYPE_WHEEL */ + case 0x02: /* XINPUT_DEVSUBTYPE_WHEEL */ return SDL_JOYSTICK_TYPE_WHEEL; - case 0x03: /* XINPUT_DEVSUBTYPE_ARCADE_STICK */ + case 0x03: /* XINPUT_DEVSUBTYPE_ARCADE_STICK */ return SDL_JOYSTICK_TYPE_ARCADE_STICK; - case 0x04: /* XINPUT_DEVSUBTYPE_FLIGHT_STICK */ + case 0x04: /* XINPUT_DEVSUBTYPE_FLIGHT_STICK */ return SDL_JOYSTICK_TYPE_FLIGHT_STICK; - case 0x05: /* XINPUT_DEVSUBTYPE_DANCE_PAD */ + case 0x05: /* XINPUT_DEVSUBTYPE_DANCE_PAD */ return SDL_JOYSTICK_TYPE_DANCE_PAD; - case 0x06: /* XINPUT_DEVSUBTYPE_GUITAR */ - case 0x07: /* XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE */ - case 0x0B: /* XINPUT_DEVSUBTYPE_GUITAR_BASS */ + case 0x06: /* XINPUT_DEVSUBTYPE_GUITAR */ + case 0x07: /* XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE */ + case 0x0B: /* XINPUT_DEVSUBTYPE_GUITAR_BASS */ return SDL_JOYSTICK_TYPE_GUITAR; - case 0x08: /* XINPUT_DEVSUBTYPE_DRUM_KIT */ + case 0x08: /* XINPUT_DEVSUBTYPE_DRUM_KIT */ return SDL_JOYSTICK_TYPE_DRUM_KIT; - case 0x13: /* XINPUT_DEVSUBTYPE_ARCADE_PAD */ + case 0x13: /* XINPUT_DEVSUBTYPE_ARCADE_PAD */ return SDL_JOYSTICK_TYPE_ARCADE_PAD; default: return SDL_JOYSTICK_TYPE_UNKNOWN; @@ -2548,25 +2973,6 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid) return (SDL_JoystickType)guid.data[15]; } - SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); - vidpid = MAKE_VIDPID(vendor, product); - - if (SDL_IsJoystickProductWheel(vidpid)) { - return SDL_JOYSTICK_TYPE_WHEEL; - } - - if (SDL_IsJoystickProductArcadeStick(vidpid)) { - return SDL_JOYSTICK_TYPE_ARCADE_STICK; - } - - if (SDL_IsJoystickProductFlightStick(vidpid)) { - return SDL_JOYSTICK_TYPE_FLIGHT_STICK; - } - - if (SDL_IsJoystickProductThrottle(vidpid)) { - return SDL_JOYSTICK_TYPE_THROTTLE; - } - #ifdef SDL_JOYSTICK_HIDAPI if (SDL_IsJoystickHIDAPI(guid)) { return HIDAPI_GetJoystickTypeFromGUID(guid); @@ -2582,147 +2988,18 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid) SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) { - /* This list is taken from: - https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/generate_rules.py - */ - static Uint32 joystick_blacklist[] = { - /* Microsoft Microsoft Wireless Optical Desktop 2.10 */ - /* Microsoft Wireless Desktop - Comfort Edition */ - MAKE_VIDPID(0x045e, 0x009d), - - /* Microsoft Microsoft Digital Media Pro Keyboard */ - /* Microsoft Corp. Digital Media Pro Keyboard */ - MAKE_VIDPID(0x045e, 0x00b0), - - /* Microsoft Microsoft Digital Media Keyboard */ - /* Microsoft Corp. Digital Media Keyboard 1.0A */ - MAKE_VIDPID(0x045e, 0x00b4), - - /* Microsoft Microsoft Digital Media Keyboard 3000 */ - MAKE_VIDPID(0x045e, 0x0730), - - /* Microsoft Microsoft 2.4GHz Transceiver v6.0 */ - /* Microsoft Microsoft 2.4GHz Transceiver v8.0 */ - /* Microsoft Corp. Nano Transceiver v1.0 for Bluetooth */ - /* Microsoft Wireless Mobile Mouse 1000 */ - /* Microsoft Wireless Desktop 3000 */ - MAKE_VIDPID(0x045e, 0x0745), - - /* Microsoft SideWinder(TM) 2.4GHz Transceiver */ - MAKE_VIDPID(0x045e, 0x0748), - - /* Microsoft Corp. Wired Keyboard 600 */ - MAKE_VIDPID(0x045e, 0x0750), - - /* Microsoft Corp. Sidewinder X4 keyboard */ - MAKE_VIDPID(0x045e, 0x0768), - - /* Microsoft Corp. Arc Touch Mouse Transceiver */ - MAKE_VIDPID(0x045e, 0x0773), - - /* Microsoft 2.4GHz Transceiver v9.0 */ - /* Microsoft Nano Transceiver v2.1 */ - /* Microsoft Sculpt Ergonomic Keyboard (5KV-00001) */ - MAKE_VIDPID(0x045e, 0x07a5), - - /* Microsoft Nano Transceiver v1.0 */ - /* Microsoft Wireless Keyboard 800 */ - MAKE_VIDPID(0x045e, 0x07b2), - - /* Microsoft Nano Transceiver v2.0 */ - MAKE_VIDPID(0x045e, 0x0800), - - MAKE_VIDPID(0x046d, 0xc30a), /* Logitech, Inc. iTouch Composite keboard */ - - MAKE_VIDPID(0x04d9, 0xa0df), /* Tek Syndicate Mouse (E-Signal USB Gaming Mouse) */ - - /* List of Wacom devices at: http://linuxwacom.sourceforge.net/wiki/index.php/Device_IDs */ - MAKE_VIDPID(0x056a, 0x0010), /* Wacom ET-0405 Graphire */ - MAKE_VIDPID(0x056a, 0x0011), /* Wacom ET-0405A Graphire2 (4x5) */ - MAKE_VIDPID(0x056a, 0x0012), /* Wacom ET-0507A Graphire2 (5x7) */ - MAKE_VIDPID(0x056a, 0x0013), /* Wacom CTE-430 Graphire3 (4x5) */ - MAKE_VIDPID(0x056a, 0x0014), /* Wacom CTE-630 Graphire3 (6x8) */ - MAKE_VIDPID(0x056a, 0x0015), /* Wacom CTE-440 Graphire4 (4x5) */ - MAKE_VIDPID(0x056a, 0x0016), /* Wacom CTE-640 Graphire4 (6x8) */ - MAKE_VIDPID(0x056a, 0x0017), /* Wacom CTE-450 Bamboo Fun (4x5) */ - MAKE_VIDPID(0x056a, 0x0018), /* Wacom CTE-650 Bamboo Fun 6x8 */ - MAKE_VIDPID(0x056a, 0x0019), /* Wacom CTE-631 Bamboo One */ - MAKE_VIDPID(0x056a, 0x00d1), /* Wacom Bamboo Pen and Touch CTH-460 */ - MAKE_VIDPID(0x056a, 0x030e), /* Wacom Intuos Pen (S) CTL-480 */ - - MAKE_VIDPID(0x09da, 0x054f), /* A4 Tech Co., G7 750 mouse */ - MAKE_VIDPID(0x09da, 0x1410), /* A4 Tech Co., Ltd Bloody AL9 mouse */ - MAKE_VIDPID(0x09da, 0x3043), /* A4 Tech Co., Ltd Bloody R8A Gaming Mouse */ - MAKE_VIDPID(0x09da, 0x31b5), /* A4 Tech Co., Ltd Bloody TL80 Terminator Laser Gaming Mouse */ - MAKE_VIDPID(0x09da, 0x3997), /* A4 Tech Co., Ltd Bloody RT7 Terminator Wireless */ - MAKE_VIDPID(0x09da, 0x3f8b), /* A4 Tech Co., Ltd Bloody V8 mouse */ - MAKE_VIDPID(0x09da, 0x51f4), /* Modecom MC-5006 Keyboard */ - MAKE_VIDPID(0x09da, 0x5589), /* A4 Tech Co., Ltd Terminator TL9 Laser Gaming Mouse */ - MAKE_VIDPID(0x09da, 0x7b22), /* A4 Tech Co., Ltd Bloody V5 */ - MAKE_VIDPID(0x09da, 0x7f2d), /* A4 Tech Co., Ltd Bloody R3 mouse */ - MAKE_VIDPID(0x09da, 0x8090), /* A4 Tech Co., Ltd X-718BK Oscar Optical Gaming Mouse */ - MAKE_VIDPID(0x09da, 0x9033), /* A4 Tech Co., X7 X-705K */ - MAKE_VIDPID(0x09da, 0x9066), /* A4 Tech Co., Sharkoon Fireglider Optical */ - MAKE_VIDPID(0x09da, 0x9090), /* A4 Tech Co., Ltd XL-730K / XL-750BK / XL-755BK Laser Mouse */ - MAKE_VIDPID(0x09da, 0x90c0), /* A4 Tech Co., Ltd X7 G800V keyboard */ - MAKE_VIDPID(0x09da, 0xf012), /* A4 Tech Co., Ltd Bloody V7 mouse */ - MAKE_VIDPID(0x09da, 0xf32a), /* A4 Tech Co., Ltd Bloody B540 keyboard */ - MAKE_VIDPID(0x09da, 0xf613), /* A4 Tech Co., Ltd Bloody V2 mouse */ - MAKE_VIDPID(0x09da, 0xf624), /* A4 Tech Co., Ltd Bloody B120 Keyboard */ - - MAKE_VIDPID(0x1b1c, 0x1b3c), /* Corsair Harpoon RGB gaming mouse */ - - MAKE_VIDPID(0x1d57, 0xad03), /* [T3] 2.4GHz and IR Air Mouse Remote Control */ - - MAKE_VIDPID(0x1e7d, 0x2e4a), /* Roccat Tyon Mouse */ - - MAKE_VIDPID(0x20a0, 0x422d), /* Winkeyless.kr Keyboards */ - - MAKE_VIDPID(0x2516, 0x001f), /* Cooler Master Storm Mizar Mouse */ - MAKE_VIDPID(0x2516, 0x0028), /* Cooler Master Storm Alcor Mouse */ - - /*****************************************************************/ - /* Additional entries */ - /*****************************************************************/ - - MAKE_VIDPID(0x04d9, 0x8008), /* OBINLB USB-HID Keyboard (Anne Pro II) */ - MAKE_VIDPID(0x04d9, 0x8009), /* OBINLB USB-HID Keyboard (Anne Pro II) */ - MAKE_VIDPID(0x04d9, 0xa292), /* OBINLB USB-HID Keyboard (Anne Pro II) */ - MAKE_VIDPID(0x04d9, 0xa293), /* OBINLB USB-HID Keyboard (Anne Pro II) */ - MAKE_VIDPID(0x1532, 0x0266), /* Razer Huntman V2 Analog, non-functional DInput device */ - MAKE_VIDPID(0x1532, 0x0282), /* Razer Huntman Mini Analog, non-functional DInput device */ - MAKE_VIDPID(0x26ce, 0x01a2), /* ASRock LED Controller */ - MAKE_VIDPID(0x20d6, 0x0002), /* PowerA Enhanced Wireless Controller for Nintendo Switch (charging port only) */ - }; - - static Uint32 rog_chakram_list[] = { - MAKE_VIDPID(0x0b05, 0x1958), /* ROG Chakram Core Mouse */ - MAKE_VIDPID(0x0b05, 0x18e3), /* ROG Chakram (wired) Mouse */ - MAKE_VIDPID(0x0b05, 0x18e5), /* ROG Chakram (wireless) Mouse */ - MAKE_VIDPID(0x0b05, 0x1a18), /* ROG Chakram X (wired) Mouse */ - MAKE_VIDPID(0x0b05, 0x1a1a), /* ROG Chakram X (wireless) Mouse */ - MAKE_VIDPID(0x0b05, 0x1a1c), /* ROG Chakram X (Bluetooth) Mouse */ - }; - - unsigned int i; - Uint32 id; Uint16 vendor; Uint16 product; SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); /* Check the joystick blacklist */ - id = MAKE_VIDPID(vendor, product); - for (i = 0; i < SDL_arraysize(joystick_blacklist); ++i) { - if (id == joystick_blacklist[i]) { - return SDL_TRUE; - } + if (SDL_VIDPIDInList(vendor, product, &blacklist_devices)) { + return SDL_TRUE; } if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_ROG_CHAKRAM, SDL_FALSE)) { - for (i = 0; i < SDL_arraysize(rog_chakram_list); ++i) { - if (id == rog_chakram_list[i]) { - return SDL_TRUE; - } + if (SDL_VIDPIDInList(vendor, product, &rog_gamepad_mice)) { + return SDL_TRUE; } } @@ -2753,18 +3030,38 @@ SDL_JoystickGUID SDL_JoystickGetDeviceGUID(int device_index) Uint16 SDL_JoystickGetDeviceVendor(int device_index) { Uint16 vendor; - SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); + const SDL_SteamVirtualGamepadInfo *info; + + SDL_LockJoysticks(); + info = SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickGetDeviceInstanceID(device_index)); + if (info) { + vendor = info->vendor_id; + } else { + SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); + + SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); + } + SDL_UnlockJoysticks(); - SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); return vendor; } Uint16 SDL_JoystickGetDeviceProduct(int device_index) { Uint16 product; - SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); + const SDL_SteamVirtualGamepadInfo *info; + + SDL_LockJoysticks(); + info = SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickGetDeviceInstanceID(device_index)); + if (info) { + product = info->product_id; + } else { + SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(device_index); + + SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); + } + SDL_UnlockJoysticks(); - SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); return product; } @@ -2824,28 +3121,64 @@ int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id) SDL_JoystickGUID SDL_JoystickGetGUID(SDL_Joystick *joystick) { - static SDL_JoystickGUID emptyGUID; + SDL_JoystickGUID retval; - CHECK_JOYSTICK_MAGIC(joystick, emptyGUID); + SDL_LockJoysticks(); + { + static SDL_JoystickGUID emptyGUID; + + CHECK_JOYSTICK_MAGIC(joystick, emptyGUID); + + retval = joystick->guid; + } + SDL_UnlockJoysticks(); - return joystick->guid; + return retval; } Uint16 SDL_JoystickGetVendor(SDL_Joystick *joystick) { Uint16 vendor; - SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); + const SDL_SteamVirtualGamepadInfo *info; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); + + info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + if (info) { + vendor = info->vendor_id; + } else { + SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); + + SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); + } + } + SDL_UnlockJoysticks(); - SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); return vendor; } Uint16 SDL_JoystickGetProduct(SDL_Joystick *joystick) { Uint16 product; - SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); + const SDL_SteamVirtualGamepadInfo *info; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); + + info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + if (info) { + product = info->product_id; + } else { + SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick); + + SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); + } + } + SDL_UnlockJoysticks(); - SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); return product; } @@ -2860,16 +3193,32 @@ Uint16 SDL_JoystickGetProductVersion(SDL_Joystick *joystick) Uint16 SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, 0); + Uint16 retval; - return joystick->firmware_version; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, 0); + + retval = joystick->firmware_version; + } + SDL_UnlockJoysticks(); + + return retval; } const char *SDL_JoystickGetSerial(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, NULL); + const char *retval; - return joystick->serial; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, NULL); + + retval = joystick->serial; + } + SDL_UnlockJoysticks(); + + return retval; } SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick) @@ -2879,9 +3228,15 @@ SDL_JoystickType SDL_JoystickGetType(SDL_Joystick *joystick) type = SDL_GetJoystickGUIDType(guid); if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { - if (joystick && joystick->is_game_controller) { - type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_JOYSTICK_TYPE_UNKNOWN); + + if (joystick->is_game_controller) { + type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; + } } + SDL_UnlockJoysticks(); } return type; } @@ -2901,11 +3256,11 @@ SDL_JoystickGUID SDL_JoystickGetGUIDFromString(const char *pchGUID) /* update the power level for this joystick */ void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLevel ePowerLevel) { - CHECK_JOYSTICK_MAGIC(joystick, ); + SDL_AssertJoysticksLocked(); SDL_assert(joystick->ref_count); /* make sure we are calling this only for update, not for initialization */ if (ePowerLevel != joystick->epowerlevel) { -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_JOYBATTERYUPDATED) == SDL_ENABLE) { SDL_Event event; event.type = SDL_JOYBATTERYUPDATED; @@ -2921,9 +3276,17 @@ void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLe /* return its power level */ SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick) { - CHECK_JOYSTICK_MAGIC(joystick, SDL_JOYSTICK_POWER_UNKNOWN); + SDL_JoystickPowerLevel retval; + + SDL_LockJoysticks(); + { + CHECK_JOYSTICK_MAGIC(joystick, SDL_JOYSTICK_POWER_UNKNOWN); - return joystick->epowerlevel; + retval = joystick->epowerlevel; + } + SDL_UnlockJoysticks(); + + return retval; } int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger, Uint8 state, float x, float y, float pressure) @@ -2933,7 +3296,7 @@ int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger int posted; Uint32 event_type; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_AssertJoysticksLocked(); if (touchpad < 0 || touchpad >= joystick->ntouchpads) { return 0; @@ -3000,7 +3363,7 @@ int SDL_PrivateJoystickTouchpad(SDL_Joystick *joystick, int touchpad, int finger /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(event_type) == SDL_ENABLE) { SDL_Event event; event.type = event_type; @@ -3021,7 +3384,7 @@ int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, SDL_SensorType type, Uint6 int i; int posted = 0; - CHECK_JOYSTICK_MAGIC(joystick, 0); + SDL_AssertJoysticksLocked(); /* We ignore events if we don't have keyboard focus */ if (SDL_PrivateJoystickShouldIgnoreEvent()) { @@ -3036,11 +3399,11 @@ int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, SDL_SensorType type, Uint6 num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); /* Update internal sensor state */ - SDL_memcpy(sensor->data, data, num_values*sizeof(*data)); + SDL_memcpy(sensor->data, data, num_values * sizeof(*data)); sensor->timestamp_us = timestamp_us; /* Post the event, if desired */ -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_CONTROLLERSENSORUPDATE) == SDL_ENABLE) { SDL_Event event; event.type = SDL_CONTROLLERSENSORUPDATE; @@ -3048,7 +3411,7 @@ int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, SDL_SensorType type, Uint6 event.csensor.sensor = type; num_values = SDL_min(num_values, SDL_arraysize(event.csensor.data)); SDL_memset(event.csensor.data, 0, sizeof(event.csensor.data)); - SDL_memcpy(event.csensor.data, data, num_values*sizeof(*data)); + SDL_memcpy(event.csensor.data, data, num_values * sizeof(*data)); event.csensor.timestamp_us = timestamp_us; posted = SDL_PushEvent(&event) == 1; } @@ -3060,4 +3423,174 @@ int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, SDL_SensorType type, Uint6 return posted; } +static void SDL_LoadVIDPIDListFromHint(const char *hint, int *num_entries, int *max_entries, Uint32 **entries) +{ + Uint32 entry; + char *spot; + char *file = NULL; + + if (hint && *hint == '@') { + spot = file = (char *)SDL_LoadFile(hint + 1, NULL); + } else { + spot = (char *)hint; + } + + if (spot == NULL) { + return; + } + + while ((spot = SDL_strstr(spot, "0x")) != NULL) { + entry = (Uint16)SDL_strtol(spot, &spot, 0); + entry <<= 16; + spot = SDL_strstr(spot, "0x"); + if (spot == NULL) { + break; + } + entry |= (Uint16)SDL_strtol(spot, &spot, 0); + + if (*num_entries == *max_entries) { + int new_max_entries = *max_entries + 16; + Uint32 *new_entries = (Uint32 *)SDL_realloc(*entries, new_max_entries * sizeof(**entries)); + if (!new_entries) { + /* Out of memory, go with what we have already */ + break; + } + *entries = new_entries; + *max_entries = new_max_entries; + } + (*entries)[(*num_entries)++] = entry; + } + + if (file) { + SDL_free(file); + } +} + +void SDL_LoadVIDPIDListFromHints(SDL_vidpid_list *list, const char *included_list, const char *excluded_list) +{ + /* Empty the list */ + list->num_included_entries = 0; + list->num_excluded_entries = 0; + + /* Add the initial entries */ + if (list->num_initial_entries > 0) { + if (list->num_included_entries < list->num_initial_entries) { + Uint32 *entries = (Uint32 *)SDL_malloc(list->num_initial_entries * sizeof(*entries)); + if (entries) { + SDL_memcpy(entries, list->initial_entries, list->num_initial_entries * sizeof(*entries)); + list->included_entries = entries; + list->num_included_entries = list->num_initial_entries; + list->max_included_entries = list->num_initial_entries; + } + } + } + + /* Add the included entries from the hint */ + SDL_LoadVIDPIDListFromHint(included_list, &list->num_included_entries, &list->max_included_entries, &list->included_entries); + + /* Add the excluded entries from the hint */ + SDL_LoadVIDPIDListFromHint(excluded_list, &list->num_excluded_entries, &list->max_excluded_entries, &list->excluded_entries); +} + +static void SDLCALL SDL_VIDPIDIncludedHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + SDL_vidpid_list *list = (SDL_vidpid_list *)userdata; + const char *included_list = hint; + const char *excluded_list = NULL; + + if (!list->initialized) { + return; + } + + if (list->excluded_hint_name) { + excluded_list = SDL_GetHint(list->excluded_hint_name); + } + SDL_LoadVIDPIDListFromHints(list, included_list, excluded_list); +} + +static void SDLCALL SDL_VIDPIDExcludedHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + SDL_vidpid_list *list = (SDL_vidpid_list *)userdata; + const char *included_list = NULL; + const char *excluded_list = hint; + + if (!list->initialized) { + return; + } + + if (list->included_hint_name) { + included_list = SDL_GetHint(list->included_hint_name); + } + SDL_LoadVIDPIDListFromHints(list, included_list, excluded_list); +} + +void SDL_LoadVIDPIDList(SDL_vidpid_list *list) +{ + const char *included_list = NULL; + const char *excluded_list = NULL; + + if (list->included_hint_name) { + SDL_AddHintCallback(list->included_hint_name, SDL_VIDPIDIncludedHintChanged, list); + } + + if (list->excluded_hint_name) { + SDL_AddHintCallback(list->excluded_hint_name, SDL_VIDPIDExcludedHintChanged, list); + } + + list->initialized = SDL_TRUE; + + if (list->included_hint_name) { + included_list = SDL_GetHint(list->included_hint_name); + } + if (list->excluded_hint_name) { + excluded_list = SDL_GetHint(list->excluded_hint_name); + } + SDL_LoadVIDPIDListFromHints(list, included_list, excluded_list); +} + +SDL_bool SDL_VIDPIDInList(Uint16 vendor_id, Uint16 product_id, const SDL_vidpid_list *list) +{ + int i; + Uint32 vidpid = MAKE_VIDPID(vendor_id, product_id); + + for (i = 0; i < list->num_excluded_entries; ++i) { + if (vidpid == list->excluded_entries[i]) { + return SDL_FALSE; + } + } + for (i = 0; i < list->num_included_entries; ++i) { + if (vidpid == list->included_entries[i]) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +void SDL_FreeVIDPIDList(SDL_vidpid_list *list) +{ + if (list->included_hint_name) { + SDL_DelHintCallback(list->included_hint_name, SDL_VIDPIDIncludedHintChanged, list); + } + + if (list->excluded_hint_name) { + SDL_DelHintCallback(list->excluded_hint_name, SDL_VIDPIDExcludedHintChanged, list); + } + + if (list->included_entries) { + SDL_free(list->included_entries); + list->included_entries = NULL; + list->num_included_entries = 0; + list->max_included_entries = 0; + } + + if (list->excluded_entries) { + SDL_free(list->excluded_entries); + list->excluded_entries = NULL; + list->num_excluded_entries = 0; + list->max_excluded_entries = 0; + } + + list->initialized = SDL_FALSE; +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index 0f2093cafb802..3107d3fad60e8 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,6 +34,8 @@ extern "C" { #endif struct _SDL_JoystickDriver; +struct SDL_SteamVirtualGamepadInfo; +extern char SDL_joystick_magic; /* Initialization and shutdown functions */ extern int SDL_JoystickInit(void); @@ -49,7 +51,7 @@ extern SDL_bool SDL_JoysticksQuitting(void); extern SDL_bool SDL_JoysticksLocked(void); /* Make sure we currently have the joysticks locked */ -extern void SDL_AssertJoysticksLocked(void); +extern void SDL_AssertJoysticksLocked(void) SDL_ASSERT_CAPABILITY(SDL_joystick_lock); /* Function to get the next available joystick instance ID */ extern SDL_JoystickID SDL_GetNextJoystickInstanceID(void); @@ -69,7 +71,7 @@ extern int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id); extern char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, const char *product_name); /* Function to create a GUID for a joystick based on the VID/PID and name */ -extern SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *name, Uint8 driver_signature, Uint8 driver_data); +extern SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data); /* Function to create a GUID for a joystick based on the name, with no VID/PID information */ extern SDL_JoystickGUID SDL_CreateJoystickGUIDForName(const char *name); @@ -90,6 +92,9 @@ extern void SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc); extern SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromVIDPID(Uint16 vendor, Uint16 product, const char *name, SDL_bool forUI); extern SDL_GameControllerType SDL_GetJoystickGameControllerTypeFromGUID(SDL_JoystickGUID guid, const char *name); +/* Function to return whether a joystick GUID uses the version field */ +extern SDL_bool SDL_JoystickGUIDUsesVersion(SDL_JoystickGUID guid); + /* Function to return whether a joystick is an Xbox One controller */ extern SDL_bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id); @@ -107,6 +112,7 @@ extern SDL_bool SDL_IsJoystickPS4(Uint16 vendor_id, Uint16 product_id); /* Function to return whether a joystick is a PS5 controller */ extern SDL_bool SDL_IsJoystickPS5(Uint16 vendor_id, Uint16 product_id); +extern SDL_bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id); /* Function to return whether a joystick is a Nintendo Switch Pro controller */ extern SDL_bool SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id); @@ -117,9 +123,15 @@ extern SDL_bool SDL_IsJoystickNintendoSwitchJoyConRight(Uint16 vendor_id, Uint16 extern SDL_bool SDL_IsJoystickNintendoSwitchJoyConGrip(Uint16 vendor_id, Uint16 product_id); extern SDL_bool SDL_IsJoystickNintendoSwitchJoyConPair(Uint16 vendor_id, Uint16 product_id); +/* Function to return whether a joystick is a Steam Virtual Gamepad */ +extern SDL_bool SDL_IsJoystickSteamVirtualGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version); + /* Function to return whether a joystick is a Steam Controller */ extern SDL_bool SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_id); +/* Function to return whether a joystick is a Steam Deck */ +extern SDL_bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id); + /* Function to return whether a joystick guid comes from the XInput driver */ extern SDL_bool SDL_IsJoystickXInput(SDL_JoystickGUID guid); @@ -129,6 +141,9 @@ extern SDL_bool SDL_IsJoystickWGI(SDL_JoystickGUID guid); /* Function to return whether a joystick guid comes from the HIDAPI driver */ extern SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid); +/* Function to return whether a joystick guid comes from the MFI driver */ +extern SDL_bool SDL_IsJoystickMFI(SDL_JoystickGUID guid); + /* Function to return whether a joystick guid comes from the RAWINPUT driver */ extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid); @@ -168,21 +183,27 @@ extern int SDL_PrivateJoystickSensor(SDL_Joystick *joystick, extern void SDL_PrivateJoystickBatteryLevel(SDL_Joystick *joystick, SDL_JoystickPowerLevel ePowerLevel); +/* Function to get the Steam virtual gamepad info for a joystick */ +extern const struct SDL_SteamVirtualGamepadInfo *SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickID instance_id); + /* Internal sanity checking functions */ extern SDL_bool SDL_PrivateJoystickValid(SDL_Joystick *joystick); typedef enum { - EMappingKind_None = 0, - EMappingKind_Button = 1, - EMappingKind_Axis = 2, - EMappingKind_Hat = 3 + EMappingKind_None, + EMappingKind_Button, + EMappingKind_Axis, + EMappingKind_Hat, } EMappingKind; typedef struct _SDL_InputMapping { EMappingKind kind; Uint8 target; + SDL_bool axis_reversed; + SDL_bool half_axis_positive; + SDL_bool half_axis_negative; } SDL_InputMapping; typedef struct _SDL_GamepadMapping @@ -213,12 +234,40 @@ typedef struct _SDL_GamepadMapping SDL_InputMapping righty; SDL_InputMapping lefttrigger; SDL_InputMapping righttrigger; + SDL_InputMapping touchpad; } SDL_GamepadMapping; /* Function to get autodetected gamepad controller mapping from the driver */ extern SDL_bool SDL_PrivateJoystickGetAutoGamepadMapping(int device_index, SDL_GamepadMapping *out); + +typedef struct +{ + const char *included_hint_name; + int num_included_entries; + int max_included_entries; + Uint32 *included_entries; + + const char *excluded_hint_name; + int num_excluded_entries; + int max_excluded_entries; + Uint32 *excluded_entries; + + int num_initial_entries; + Uint32 *initial_entries; + + SDL_bool initialized; +} SDL_vidpid_list; + +extern void SDL_LoadVIDPIDList(SDL_vidpid_list *list); +extern void SDL_LoadVIDPIDListFromHints(SDL_vidpid_list *list, const char *included_list, const char *excluded_list); +extern SDL_bool SDL_VIDPIDInList(Uint16 vendor_id, Uint16 product_id, const SDL_vidpid_list *list); +extern void SDL_FreeVIDPIDList(SDL_vidpid_list *list); + +/* This is in SDL_gamecontroller.c */ +extern SDL_GameControllerType SDL_GetGameControllerTypeFromString(const char *str); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/src/joystick/SDL_steam_virtual_gamepad.c b/src/joystick/SDL_steam_virtual_gamepad.c new file mode 100644 index 0000000000000..5d225ebac6a6f --- /dev/null +++ b/src/joystick/SDL_steam_virtual_gamepad.c @@ -0,0 +1,286 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../SDL_internal.h" + +#include "SDL_hints.h" +#include "SDL_timer.h" +#include "SDL_joystick_c.h" +#include "SDL_steam_virtual_gamepad.h" + +#ifdef __WIN32__ +#include "../core/windows/SDL_windows.h" +#else +#include +#include +#endif +#ifdef __LINUX__ +#include +#endif + +#define SDL_HINT_STEAM_VIRTUAL_GAMEPAD_INFO_FILE "SteamVirtualGamepadInfo" + +static char *SDL_steam_virtual_gamepad_info_file SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static Uint64 SDL_steam_virtual_gamepad_info_file_mtime SDL_GUARDED_BY(SDL_joystick_lock) = 0; +static Uint32 SDL_steam_virtual_gamepad_info_check_time SDL_GUARDED_BY(SDL_joystick_lock) = 0; +static SDL_SteamVirtualGamepadInfo **SDL_steam_virtual_gamepad_info SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static int SDL_steam_virtual_gamepad_info_count SDL_GUARDED_BY(SDL_joystick_lock) = 0; + + +static Uint64 GetFileModificationTime(const char *file) +{ + Uint64 modification_time = 0; + +#ifdef __WIN32__ + WCHAR *wFile = WIN_UTF8ToStringW(file); + if (wFile) { + HANDLE hFile = CreateFileW(wFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + if (hFile != INVALID_HANDLE_VALUE) { + FILETIME last_write_time; + if (GetFileTime(hFile, NULL, NULL, &last_write_time)) { + modification_time = last_write_time.dwHighDateTime; + modification_time <<= 32; + modification_time |= last_write_time.dwLowDateTime; + } + CloseHandle(hFile); + } + SDL_free(wFile); + } +#else + struct stat sb; + + if (stat(file, &sb) == 0) { + modification_time = (Uint64)sb.st_mtime; + } +#endif + return modification_time; +} + +static void SDL_FreeSteamVirtualGamepadInfo(void) +{ + int i; + + SDL_AssertJoysticksLocked(); + + for (i = 0; i < SDL_steam_virtual_gamepad_info_count; ++i) { + SDL_SteamVirtualGamepadInfo *entry = SDL_steam_virtual_gamepad_info[i]; + if (entry) { + SDL_free(entry->name); + SDL_free(entry); + } + } + SDL_free(SDL_steam_virtual_gamepad_info); + SDL_steam_virtual_gamepad_info = NULL; + SDL_steam_virtual_gamepad_info_count = 0; +} + +static void AddVirtualGamepadInfo(int slot, SDL_SteamVirtualGamepadInfo *info) +{ + SDL_SteamVirtualGamepadInfo *new_info; + + SDL_AssertJoysticksLocked(); + + if (slot < 0) { + return; + } + + if (slot >= SDL_steam_virtual_gamepad_info_count) { + SDL_SteamVirtualGamepadInfo **slots = (SDL_SteamVirtualGamepadInfo **)SDL_realloc(SDL_steam_virtual_gamepad_info, (slot + 1)*sizeof(*SDL_steam_virtual_gamepad_info)); + if (!slots) { + return; + } + while (SDL_steam_virtual_gamepad_info_count <= slot) { + slots[SDL_steam_virtual_gamepad_info_count++] = NULL; + } + SDL_steam_virtual_gamepad_info = slots; + } + + if (SDL_steam_virtual_gamepad_info[slot]) { + /* We already have this slot info */ + return; + } + + new_info = (SDL_SteamVirtualGamepadInfo *)SDL_malloc(sizeof(*new_info)); + if (!new_info) { + return; + } + SDL_copyp(new_info, info); + SDL_steam_virtual_gamepad_info[slot] = new_info; + SDL_zerop(info); +} + +#ifdef __LINUX__ +static const char *SDL_GetExeName(void) +{ + const char *proc_name = NULL; + static char linkfile[1024]; + int linksize; + const char *proc_path = "/proc/self/exe"; + + linksize = readlink(proc_path, linkfile, sizeof(linkfile) - 1); + if (linksize > 0) { + linkfile[linksize] = '\0'; + proc_name = SDL_strrchr(linkfile, '/'); + if (proc_name) { + ++proc_name; + } else { + proc_name = linkfile; + } + } + return proc_name; +} +#endif /* __LINUX__ */ + +void SDL_InitSteamVirtualGamepadInfo(void) +{ + const char *file; + + SDL_AssertJoysticksLocked(); + + file = SDL_GetHint(SDL_HINT_STEAM_VIRTUAL_GAMEPAD_INFO_FILE); + if (file && *file) { +#ifdef __LINUX__ + /* Older versions of Wine will blacklist the Steam Virtual Gamepad if + * it appears to have the real controller's VID/PID, so ignore this. + */ + const char *exe = SDL_GetExeName(); + if (exe && SDL_strcmp(exe, "wine64-preloader") == 0) { + SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "Wine launched by Steam, ignoring %s", SDL_HINT_STEAM_VIRTUAL_GAMEPAD_INFO_FILE); + return; + } +#endif + SDL_steam_virtual_gamepad_info_file = SDL_strdup(file); + } + SDL_UpdateSteamVirtualGamepadInfo(); +} + +SDL_bool SDL_SteamVirtualGamepadEnabled(void) +{ + SDL_AssertJoysticksLocked(); + + return (SDL_steam_virtual_gamepad_info != NULL); +} + +SDL_bool SDL_UpdateSteamVirtualGamepadInfo(void) +{ + const int UPDATE_CHECK_INTERVAL_MS = 3000; + Uint32 now; + Uint64 mtime; + char *data, *end, *next, *line, *value; + size_t size; + int slot, new_slot; + SDL_SteamVirtualGamepadInfo info; + + SDL_AssertJoysticksLocked(); + + if (!SDL_steam_virtual_gamepad_info_file) { + return SDL_FALSE; + } + + now = SDL_GetTicks(); + if (SDL_steam_virtual_gamepad_info_check_time && + !SDL_TICKS_PASSED(now, (SDL_steam_virtual_gamepad_info_check_time + UPDATE_CHECK_INTERVAL_MS))) { + return SDL_FALSE; + } + SDL_steam_virtual_gamepad_info_check_time = now; + + mtime = GetFileModificationTime(SDL_steam_virtual_gamepad_info_file); + if (mtime == 0 || mtime == SDL_steam_virtual_gamepad_info_file_mtime) { + return SDL_FALSE; + } + + data = (char *)SDL_LoadFile(SDL_steam_virtual_gamepad_info_file, &size); + if (!data) { + return SDL_FALSE; + } + + SDL_FreeSteamVirtualGamepadInfo(); + + slot = -1; + SDL_zero(info); + + for (next = data, end = data + size; next < end; ) { + while (next < end && (*next == '\0' || *next == '\r' || *next == '\n')) { + ++next; + } + + line = next; + + while (next < end && (*next != '\r' && *next != '\n')) { + ++next; + } + *next = '\0'; + + if (SDL_sscanf(line, "[slot %d]", &new_slot) == 1) { + if (slot >= 0) { + AddVirtualGamepadInfo(slot, &info); + } + slot = new_slot; + } else { + value = SDL_strchr(line, '='); + if (value) { + *value++ = '\0'; + + if (SDL_strcmp(line, "name") == 0) { + SDL_free(info.name); + info.name = SDL_strdup(value); + } else if (SDL_strcmp(line, "VID") == 0) { + info.vendor_id = (Uint16)SDL_strtoul(value, NULL, 0); + } else if (SDL_strcmp(line, "PID") == 0) { + info.product_id = (Uint16)SDL_strtoul(value, NULL, 0); + } else if (SDL_strcmp(line, "type") == 0) { + info.type = SDL_GetGameControllerTypeFromString(value); + } else if (SDL_strcmp(line, "handle") == 0) { + info.handle = SDL_strtoull(value, NULL, 0); + } + } + } + } + if (slot >= 0) { + AddVirtualGamepadInfo(slot, &info); + } + SDL_free(info.name); + SDL_free(data); + + SDL_steam_virtual_gamepad_info_file_mtime = mtime; + + return SDL_TRUE; +} + +const SDL_SteamVirtualGamepadInfo *SDL_GetSteamVirtualGamepadInfo(int slot) +{ + SDL_AssertJoysticksLocked(); + + if (slot < 0 || slot >= SDL_steam_virtual_gamepad_info_count) { + return NULL; + } + return SDL_steam_virtual_gamepad_info[slot]; +} + +void SDL_QuitSteamVirtualGamepadInfo(void) +{ + SDL_AssertJoysticksLocked(); + + if (SDL_steam_virtual_gamepad_info_file) { + SDL_FreeSteamVirtualGamepadInfo(); + SDL_free(SDL_steam_virtual_gamepad_info_file); + SDL_steam_virtual_gamepad_info_file = NULL; + } +} diff --git a/src/joystick/SDL_steam_virtual_gamepad.h b/src/joystick/SDL_steam_virtual_gamepad.h new file mode 100644 index 0000000000000..8bdbeff5e806b --- /dev/null +++ b/src/joystick/SDL_steam_virtual_gamepad.h @@ -0,0 +1,36 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../SDL_internal.h" + +typedef struct SDL_SteamVirtualGamepadInfo +{ + Uint64 handle; + char *name; + Uint16 vendor_id; + Uint16 product_id; + SDL_GameControllerType type; +} SDL_SteamVirtualGamepadInfo; + +void SDL_InitSteamVirtualGamepadInfo(void); +SDL_bool SDL_SteamVirtualGamepadEnabled(void); +SDL_bool SDL_UpdateSteamVirtualGamepadInfo(void); +const SDL_SteamVirtualGamepadInfo *SDL_GetSteamVirtualGamepadInfo(int slot); +void SDL_QuitSteamVirtualGamepadInfo(void); diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h index 015007c59e91f..cabb69af551b2 100644 --- a/src/joystick/SDL_sysjoystick.h +++ b/src/joystick/SDL_sysjoystick.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,12 +35,12 @@ extern "C" { /* The SDL joystick structure */ typedef struct _SDL_JoystickAxisInfo { - Sint16 initial_value; /* Initial axis state */ - Sint16 value; /* Current axis state */ - Sint16 zero; /* Zero point on the axis (-32768 for triggers) */ - SDL_bool has_initial_value; /* Whether we've seen a value on the axis yet */ - SDL_bool has_second_value; /* Whether we've seen a second value on the axis yet */ - SDL_bool sent_initial_value; /* Whether we've sent the initial axis value */ + Sint16 initial_value; /* Initial axis state */ + Sint16 value; /* Current axis state */ + Sint16 zero; /* Zero point on the axis (-32768 for triggers) */ + SDL_bool has_initial_value; /* Whether we've seen a value on the axis yet */ + SDL_bool has_second_value; /* Whether we've seen a second value on the axis yet */ + SDL_bool sent_initial_value; /* Whether we've sent the initial axis value */ SDL_bool sending_initial_value; /* Whether we are sending the initial axis value */ } SDL_JoystickAxisInfo; @@ -63,84 +63,90 @@ typedef struct _SDL_JoystickSensorInfo SDL_SensorType type; SDL_bool enabled; float rate; - float data[3]; /* If this needs to expand, update SDL_ControllerSensorEvent */ + float data[3]; /* If this needs to expand, update SDL_ControllerSensorEvent */ Uint64 timestamp_us; } SDL_JoystickSensorInfo; +#define _guarded SDL_GUARDED_BY(SDL_joystick_lock) + struct _SDL_Joystick { - const void *magic; + const void *magic _guarded; - SDL_JoystickID instance_id; /* Device instance, monotonically increasing from 0 */ - char *name; /* Joystick name - system dependent */ - char *path; /* Joystick path - system dependent */ - char *serial; /* Joystick serial */ - SDL_JoystickGUID guid; /* Joystick guid */ - Uint16 firmware_version; /* Firmware version, if available */ + SDL_JoystickID instance_id _guarded; /* Device instance, monotonically increasing from 0 */ + char *name _guarded; /* Joystick name - system dependent */ + char *path _guarded; /* Joystick path - system dependent */ + char *serial _guarded; /* Joystick serial */ + SDL_JoystickGUID guid _guarded; /* Joystick guid */ + Uint16 firmware_version _guarded; /* Firmware version, if available */ + Uint64 steam_handle _guarded; /* Steam controller API handle */ - int naxes; /* Number of axis controls on the joystick */ - SDL_JoystickAxisInfo *axes; + int naxes _guarded; /* Number of axis controls on the joystick */ + SDL_JoystickAxisInfo *axes _guarded; - int nhats; /* Number of hats on the joystick */ - Uint8 *hats; /* Current hat states */ + int nhats _guarded; /* Number of hats on the joystick */ + Uint8 *hats _guarded; /* Current hat states */ - int nballs; /* Number of trackballs on the joystick */ - struct balldelta { + int nballs _guarded; /* Number of trackballs on the joystick */ + struct balldelta + { int dx; int dy; - } *balls; /* Current ball motion deltas */ + } *balls _guarded; /* Current ball motion deltas */ - int nbuttons; /* Number of buttons on the joystick */ - Uint8 *buttons; /* Current button states */ + int nbuttons _guarded; /* Number of buttons on the joystick */ + Uint8 *buttons _guarded; /* Current button states */ - int ntouchpads; /* Number of touchpads on the joystick */ - SDL_JoystickTouchpadInfo *touchpads; /* Current touchpad states */ + int ntouchpads _guarded; /* Number of touchpads on the joystick */ + SDL_JoystickTouchpadInfo *touchpads _guarded; /* Current touchpad states */ - int nsensors; /* Number of sensors on the joystick */ - int nsensors_enabled; - SDL_JoystickSensorInfo *sensors; + int nsensors _guarded; /* Number of sensors on the joystick */ + int nsensors_enabled _guarded; + SDL_JoystickSensorInfo *sensors _guarded; - Uint16 low_frequency_rumble; - Uint16 high_frequency_rumble; - Uint32 rumble_expiration; - Uint32 rumble_resend; + Uint16 low_frequency_rumble _guarded; + Uint16 high_frequency_rumble _guarded; + Uint32 rumble_expiration _guarded; + Uint32 rumble_resend _guarded; - Uint16 left_trigger_rumble; - Uint16 right_trigger_rumble; - Uint32 trigger_rumble_expiration; + Uint16 left_trigger_rumble _guarded; + Uint16 right_trigger_rumble _guarded; + Uint32 trigger_rumble_expiration _guarded; - Uint8 led_red; - Uint8 led_green; - Uint8 led_blue; - Uint32 led_expiration; + Uint8 led_red _guarded; + Uint8 led_green _guarded; + Uint8 led_blue _guarded; + Uint32 led_expiration _guarded; - SDL_bool attached; - SDL_bool is_game_controller; - SDL_bool delayed_guide_button; /* SDL_TRUE if this device has the guide button event delayed */ - SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */ + SDL_bool attached _guarded; + SDL_bool is_game_controller _guarded; + SDL_bool delayed_guide_button _guarded; /* SDL_TRUE if this device has the guide button event delayed */ + SDL_JoystickPowerLevel epowerlevel _guarded; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */ - struct _SDL_JoystickDriver *driver; + struct _SDL_JoystickDriver *driver _guarded; - struct joystick_hwdata *hwdata; /* Driver dependent information */ + struct joystick_hwdata *hwdata _guarded; /* Driver dependent information */ - int ref_count; /* Reference count for multiple opens */ + int ref_count _guarded; /* Reference count for multiple opens */ - struct _SDL_Joystick *next; /* pointer to next joystick we have allocated */ + struct _SDL_Joystick *next _guarded; /* pointer to next joystick we have allocated */ }; +#undef _guarded + /* Device bus definitions */ -#define SDL_HARDWARE_BUS_UNKNOWN 0x00 -#define SDL_HARDWARE_BUS_USB 0x03 -#define SDL_HARDWARE_BUS_BLUETOOTH 0x05 -#define SDL_HARDWARE_BUS_VIRTUAL 0xFF +#define SDL_HARDWARE_BUS_UNKNOWN 0x00 +#define SDL_HARDWARE_BUS_USB 0x03 +#define SDL_HARDWARE_BUS_BLUETOOTH 0x05 +#define SDL_HARDWARE_BUS_VIRTUAL 0xFF /* Joystick capability flags for GetCapabilities() */ -#define SDL_JOYCAP_LED 0x01 -#define SDL_JOYCAP_RUMBLE 0x02 -#define SDL_JOYCAP_RUMBLE_TRIGGERS 0x04 +#define SDL_JOYCAP_LED 0x01 +#define SDL_JOYCAP_RUMBLE 0x02 +#define SDL_JOYCAP_RUMBLE_TRIGGERS 0x04 /* Macro to combine a USB vendor ID and product ID into a single Uint32 value */ -#define MAKE_VIDPID(VID, PID) (((Uint32)(VID))<<16|(PID)) +#define MAKE_VIDPID(VID, PID) (((Uint32)(VID)) << 16 | (PID)) typedef struct _SDL_JoystickDriver { @@ -162,6 +168,9 @@ typedef struct _SDL_JoystickDriver /* Function to get the device-dependent path of a joystick */ const char *(*GetDevicePath)(int device_index); + /* Function to get the Steam virtual gamepad slot of a joystick */ + int (*GetDeviceSteamVirtualGamepadSlot)(int device_index); + /* Function to get the player index of a joystick */ int (*GetDevicePlayerIndex)(int device_index); @@ -211,18 +220,18 @@ typedef struct _SDL_JoystickDriver void (*Quit)(void); /* Function to get the autodetected controller mapping; returns false if there isn't any. */ - SDL_bool (*GetGamepadMapping)(int device_index, SDL_GamepadMapping * out); + SDL_bool (*GetGamepadMapping)(int device_index, SDL_GamepadMapping *out); } SDL_JoystickDriver; /* Windows and Mac OSX has a limit of MAX_DWORD / 1000, Linux kernel has a limit of 0xFFFF */ -#define SDL_MAX_RUMBLE_DURATION_MS 0xFFFF +#define SDL_MAX_RUMBLE_DURATION_MS 0xFFFF -/* Dualshock4 only rumbles for about 5 seconds max, resend rumble command every 2 seconds +/* Dualshock4 only rumbles for about 5 seconds max, resend rumble command every 2 seconds * to make long rumble work. */ -#define SDL_RUMBLE_RESEND_MS 2000 +#define SDL_RUMBLE_RESEND_MS 2000 -#define SDL_LED_MIN_REPEAT_MS 5000 +#define SDL_LED_MIN_REPEAT_MS 5000 /* The available joystick drivers */ extern SDL_JoystickDriver SDL_ANDROID_JoystickDriver; diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c index a1c8b88980db2..e0c228afc3dde 100644 --- a/src/joystick/android/SDL_sysjoystick.c +++ b/src/joystick/android/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,15 +39,15 @@ /* As of platform android-14, android/keycodes.h is missing these defines */ #ifndef AKEYCODE_BUTTON_1 -#define AKEYCODE_BUTTON_1 188 -#define AKEYCODE_BUTTON_2 189 -#define AKEYCODE_BUTTON_3 190 -#define AKEYCODE_BUTTON_4 191 -#define AKEYCODE_BUTTON_5 192 -#define AKEYCODE_BUTTON_6 193 -#define AKEYCODE_BUTTON_7 194 -#define AKEYCODE_BUTTON_8 195 -#define AKEYCODE_BUTTON_9 196 +#define AKEYCODE_BUTTON_1 188 +#define AKEYCODE_BUTTON_2 189 +#define AKEYCODE_BUTTON_3 190 +#define AKEYCODE_BUTTON_4 191 +#define AKEYCODE_BUTTON_5 192 +#define AKEYCODE_BUTTON_6 193 +#define AKEYCODE_BUTTON_7 194 +#define AKEYCODE_BUTTON_8 195 +#define AKEYCODE_BUTTON_9 196 #define AKEYCODE_BUTTON_10 197 #define AKEYCODE_BUTTON_11 198 #define AKEYCODE_BUTTON_12 199 @@ -57,129 +57,126 @@ #define AKEYCODE_BUTTON_16 203 #endif -#define ANDROID_ACCELEROMETER_NAME "Android Accelerometer" +#define ANDROID_ACCELEROMETER_NAME "Android Accelerometer" #define ANDROID_ACCELEROMETER_DEVICE_ID INT_MIN -#define ANDROID_MAX_NBUTTONS 36 +#define ANDROID_MAX_NBUTTONS 36 -static SDL_joylist_item * JoystickByDeviceId(int device_id); +static SDL_joylist_item *JoystickByDeviceId(int device_id); static SDL_joylist_item *SDL_joylist = NULL; static SDL_joylist_item *SDL_joylist_tail = NULL; static int numjoysticks = 0; - /* Function to convert Android keyCodes into SDL ones. * This code manipulation is done to get a sequential list of codes. * FIXME: This is only suited for the case where we use a fixed number of buttons determined by ANDROID_MAX_NBUTTONS */ -static int -keycode_to_SDL(int keycode) +static int keycode_to_SDL(int keycode) { /* FIXME: If this function gets too unwieldy in the future, replace with a lookup table */ int button = 0; switch (keycode) { - /* Some gamepad buttons (API 9) */ - case AKEYCODE_BUTTON_A: - button = SDL_CONTROLLER_BUTTON_A; - break; - case AKEYCODE_BUTTON_B: - button = SDL_CONTROLLER_BUTTON_B; - break; - case AKEYCODE_BUTTON_X: - button = SDL_CONTROLLER_BUTTON_X; - break; - case AKEYCODE_BUTTON_Y: - button = SDL_CONTROLLER_BUTTON_Y; - break; - case AKEYCODE_BUTTON_L1: - button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; - break; - case AKEYCODE_BUTTON_R1: - button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; - break; - case AKEYCODE_BUTTON_THUMBL: - button = SDL_CONTROLLER_BUTTON_LEFTSTICK; - break; - case AKEYCODE_BUTTON_THUMBR: - button = SDL_CONTROLLER_BUTTON_RIGHTSTICK; - break; - case AKEYCODE_MENU: - case AKEYCODE_BUTTON_START: - button = SDL_CONTROLLER_BUTTON_START; - break; - case AKEYCODE_BACK: - case AKEYCODE_BUTTON_SELECT: - button = SDL_CONTROLLER_BUTTON_BACK; - break; - case AKEYCODE_BUTTON_MODE: - button = SDL_CONTROLLER_BUTTON_GUIDE; - break; - case AKEYCODE_BUTTON_L2: - button = 15; - break; - case AKEYCODE_BUTTON_R2: - button = 16; - break; - case AKEYCODE_BUTTON_C: - button = 17; - break; - case AKEYCODE_BUTTON_Z: - button = 18; - break; - - /* D-Pad key codes (API 1) */ - case AKEYCODE_DPAD_UP: - button = SDL_CONTROLLER_BUTTON_DPAD_UP; - break; - case AKEYCODE_DPAD_DOWN: - button = SDL_CONTROLLER_BUTTON_DPAD_DOWN; - break; - case AKEYCODE_DPAD_LEFT: - button = SDL_CONTROLLER_BUTTON_DPAD_LEFT; - break; - case AKEYCODE_DPAD_RIGHT: - button = SDL_CONTROLLER_BUTTON_DPAD_RIGHT; - break; - case AKEYCODE_DPAD_CENTER: - /* This is handled better by applications as the A button */ - /*button = 19;*/ - button = SDL_CONTROLLER_BUTTON_A; - break; - - /* More gamepad buttons (API 12), these get mapped to 20...35*/ - case AKEYCODE_BUTTON_1: - case AKEYCODE_BUTTON_2: - case AKEYCODE_BUTTON_3: - case AKEYCODE_BUTTON_4: - case AKEYCODE_BUTTON_5: - case AKEYCODE_BUTTON_6: - case AKEYCODE_BUTTON_7: - case AKEYCODE_BUTTON_8: - case AKEYCODE_BUTTON_9: - case AKEYCODE_BUTTON_10: - case AKEYCODE_BUTTON_11: - case AKEYCODE_BUTTON_12: - case AKEYCODE_BUTTON_13: - case AKEYCODE_BUTTON_14: - case AKEYCODE_BUTTON_15: - case AKEYCODE_BUTTON_16: - button = 20 + (keycode - AKEYCODE_BUTTON_1); - break; - - default: - return -1; - /* break; -Wunreachable-code-break */ - } - - /* This is here in case future generations, probably with six fingers per hand, - * happily add new cases up above and forget to update the max number of buttons. + /* Some gamepad buttons (API 9) */ + case AKEYCODE_BUTTON_A: + button = SDL_CONTROLLER_BUTTON_A; + break; + case AKEYCODE_BUTTON_B: + button = SDL_CONTROLLER_BUTTON_B; + break; + case AKEYCODE_BUTTON_X: + button = SDL_CONTROLLER_BUTTON_X; + break; + case AKEYCODE_BUTTON_Y: + button = SDL_CONTROLLER_BUTTON_Y; + break; + case AKEYCODE_BUTTON_L1: + button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER; + break; + case AKEYCODE_BUTTON_R1: + button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER; + break; + case AKEYCODE_BUTTON_THUMBL: + button = SDL_CONTROLLER_BUTTON_LEFTSTICK; + break; + case AKEYCODE_BUTTON_THUMBR: + button = SDL_CONTROLLER_BUTTON_RIGHTSTICK; + break; + case AKEYCODE_MENU: + case AKEYCODE_BUTTON_START: + button = SDL_CONTROLLER_BUTTON_START; + break; + case AKEYCODE_BACK: + case AKEYCODE_BUTTON_SELECT: + button = SDL_CONTROLLER_BUTTON_BACK; + break; + case AKEYCODE_BUTTON_MODE: + button = SDL_CONTROLLER_BUTTON_GUIDE; + break; + case AKEYCODE_BUTTON_L2: + button = 15; + break; + case AKEYCODE_BUTTON_R2: + button = 16; + break; + case AKEYCODE_BUTTON_C: + button = 17; + break; + case AKEYCODE_BUTTON_Z: + button = 18; + break; + + /* D-Pad key codes (API 1) */ + case AKEYCODE_DPAD_UP: + button = SDL_CONTROLLER_BUTTON_DPAD_UP; + break; + case AKEYCODE_DPAD_DOWN: + button = SDL_CONTROLLER_BUTTON_DPAD_DOWN; + break; + case AKEYCODE_DPAD_LEFT: + button = SDL_CONTROLLER_BUTTON_DPAD_LEFT; + break; + case AKEYCODE_DPAD_RIGHT: + button = SDL_CONTROLLER_BUTTON_DPAD_RIGHT; + break; + case AKEYCODE_DPAD_CENTER: + /* This is handled better by applications as the A button */ + /*button = 19;*/ + button = SDL_CONTROLLER_BUTTON_A; + break; + + /* More gamepad buttons (API 12), these get mapped to 20...35*/ + case AKEYCODE_BUTTON_1: + case AKEYCODE_BUTTON_2: + case AKEYCODE_BUTTON_3: + case AKEYCODE_BUTTON_4: + case AKEYCODE_BUTTON_5: + case AKEYCODE_BUTTON_6: + case AKEYCODE_BUTTON_7: + case AKEYCODE_BUTTON_8: + case AKEYCODE_BUTTON_9: + case AKEYCODE_BUTTON_10: + case AKEYCODE_BUTTON_11: + case AKEYCODE_BUTTON_12: + case AKEYCODE_BUTTON_13: + case AKEYCODE_BUTTON_14: + case AKEYCODE_BUTTON_15: + case AKEYCODE_BUTTON_16: + button = 20 + (keycode - AKEYCODE_BUTTON_1); + break; + + default: + return -1; + /* break; -Wunreachable-code-break */ + } + + /* This is here in case future generations, probably with six fingers per hand, + * happily add new cases up above and forget to update the max number of buttons. */ SDL_assert(button < ANDROID_MAX_NBUTTONS); return button; } -static SDL_Scancode -button_to_scancode(int button) +static SDL_Scancode button_to_scancode(int button) { switch (button) { case SDL_CONTROLLER_BUTTON_A: @@ -188,6 +185,8 @@ button_to_scancode(int button) return SDL_SCANCODE_ESCAPE; case SDL_CONTROLLER_BUTTON_BACK: return SDL_SCANCODE_ESCAPE; + case SDL_CONTROLLER_BUTTON_START: + return SDL_SCANCODE_MENU; case SDL_CONTROLLER_BUTTON_DPAD_UP: return SDL_SCANCODE_UP; case SDL_CONTROLLER_BUTTON_DPAD_DOWN: @@ -202,8 +201,7 @@ button_to_scancode(int button) return SDL_SCANCODE_UNKNOWN; } -int -Android_OnPadDown(int device_id, int keycode) +int Android_OnPadDown(int device_id, int keycode) { SDL_joylist_item *item; int button = keycode_to_SDL(keycode); @@ -218,12 +216,11 @@ Android_OnPadDown(int device_id, int keycode) SDL_UnlockJoysticks(); return 0; } - + return -1; } -int -Android_OnPadUp(int device_id, int keycode) +int Android_OnPadUp(int device_id, int keycode) { SDL_joylist_item *item; int button = keycode_to_SDL(keycode); @@ -238,12 +235,11 @@ Android_OnPadUp(int device_id, int keycode) SDL_UnlockJoysticks(); return 0; } - + return -1; } -int -Android_OnJoy(int device_id, int axis, float value) +int Android_OnJoy(int device_id, int axis, float value) { /* Android gives joy info normalized as [-1.0, 1.0] or [0.0, 1.0] */ SDL_joylist_item *item; @@ -251,15 +247,14 @@ Android_OnJoy(int device_id, int axis, float value) SDL_LockJoysticks(); item = JoystickByDeviceId(device_id); if (item && item->joystick) { - SDL_PrivateJoystickAxis(item->joystick, axis, (Sint16) (32767.*value)); + SDL_PrivateJoystickAxis(item->joystick, axis, (Sint16)(32767. * value)); } SDL_UnlockJoysticks(); - + return 0; } -int -Android_OnHat(int device_id, int hat_id, int x, int y) +int Android_OnHat(int device_id, int hat_id, int x, int y) { const int DPAD_UP_MASK = (1 << SDL_CONTROLLER_BUTTON_DPAD_UP); const int DPAD_DOWN_MASK = (1 << SDL_CONTROLLER_BUTTON_DPAD_DOWN); @@ -309,14 +304,11 @@ Android_OnHat(int device_id, int hat_id, int x, int y) return -1; } - -int -Android_AddJoystick(int device_id, const char *name, const char *desc, int vendor_id, int product_id, SDL_bool is_accelerometer, int button_mask, int naxes, int nhats, int nballs) +int Android_AddJoystick(int device_id, const char *name, const char *desc, int vendor_id, int product_id, SDL_bool is_accelerometer, int button_mask, int naxes, int axis_mask, int nhats, int nballs) { SDL_joylist_item *item; SDL_JoystickGUID guid; int i; - int axis_mask; int result = -1; SDL_LockJoysticks(); @@ -328,7 +320,7 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo } } - if (JoystickByDeviceId(device_id) != NULL || name == NULL) { + if (JoystickByDeviceId(device_id) != NULL || !name) { goto done; } @@ -343,22 +335,6 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo SDL_Log("Joystick: %s, descriptor %s, vendor = 0x%.4x, product = 0x%.4x, %d axes, %d hats\n", name, desc, vendor_id, product_id, naxes, nhats); #endif - /* Add the available buttons and axes - The axis mask should probably come from Java where there is more information about the axes... - */ - axis_mask = 0; - if (!is_accelerometer) { - if (naxes >= 2) { - axis_mask |= ((1 << SDL_CONTROLLER_AXIS_LEFTX) | (1 << SDL_CONTROLLER_AXIS_LEFTY)); - } - if (naxes >= 4) { - axis_mask |= ((1 << SDL_CONTROLLER_AXIS_RIGHTX) | (1 << SDL_CONTROLLER_AXIS_RIGHTY)); - } - if (naxes >= 6) { - axis_mask |= ((1 << SDL_CONTROLLER_AXIS_TRIGGERLEFT) | (1 << SDL_CONTROLLER_AXIS_TRIGGERRIGHT)); - } - } - if (nhats > 0) { /* Hat is translated into DPAD buttons */ button_mask |= ((1 << SDL_CONTROLLER_BUTTON_DPAD_UP) | @@ -368,7 +344,7 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo nhats = 0; } - guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor_id, product_id, 0, desc, 0, 0); + guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor_id, product_id, 0, NULL, desc, 0, 0); /* Update the GUID with capability bits */ { @@ -377,8 +353,8 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo guid16[7] = SDL_SwapLE16(axis_mask); } - item = (SDL_joylist_item *) SDL_malloc(sizeof (SDL_joylist_item)); - if (item == NULL) { + item = (SDL_joylist_item *)SDL_malloc(sizeof(SDL_joylist_item)); + if (!item) { goto done; } @@ -386,18 +362,18 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo item->guid = guid; item->device_id = device_id; item->name = SDL_CreateJoystickName(vendor_id, product_id, NULL, name); - if (item->name == NULL) { + if (!item->name) { SDL_free(item); goto done; } - + item->is_accelerometer = is_accelerometer; if (button_mask == 0xFFFFFFFF) { item->nbuttons = ANDROID_MAX_NBUTTONS; } else { - for (i = 0; i < sizeof(button_mask)*8; ++i) { + for (i = 0; i < sizeof(button_mask) * 8; ++i) { if (button_mask & (1 << i)) { - item->nbuttons = i+1; + item->nbuttons = i + 1; } } } @@ -405,7 +381,7 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo item->nhats = nhats; item->nballs = nballs; item->device_instance = SDL_GetNextJoystickInstanceID(); - if (SDL_joylist_tail == NULL) { + if (!SDL_joylist_tail) { SDL_joylist = SDL_joylist_tail = item; } else { SDL_joylist_tail->next = item; @@ -429,33 +405,32 @@ Android_AddJoystick(int device_id, const char *name, const char *desc, int vendo return result; } -int -Android_RemoveJoystick(int device_id) +int Android_RemoveJoystick(int device_id) { SDL_joylist_item *item = SDL_joylist; SDL_joylist_item *prev = NULL; int result = -1; - + SDL_LockJoysticks(); /* Don't call JoystickByDeviceId here or there'll be an infinite loop! */ - while (item != NULL) { + while (item) { if (item->device_id == device_id) { break; } prev = item; item = item->next; } - - if (item == NULL) { + + if (!item) { goto done; } if (item->joystick) { item->joystick->hwdata = NULL; } - - if (prev != NULL) { + + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_joylist == item); @@ -485,30 +460,25 @@ Android_RemoveJoystick(int device_id) return result; } - static void ANDROID_JoystickDetect(void); -static int -ANDROID_JoystickInit(void) +static int ANDROID_JoystickInit(void) { ANDROID_JoystickDetect(); - + if (SDL_GetHintBoolean(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_TRUE)) { /* Default behavior, accelerometer as joystick */ - Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, ANDROID_ACCELEROMETER_NAME, 0, 0, SDL_TRUE, 0, 3, 0, 0); + Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, ANDROID_ACCELEROMETER_NAME, 0, 0, SDL_TRUE, 0, 3, 0x0003, 0, 0); } return 0; - } -static int -ANDROID_JoystickGetCount(void) +static int ANDROID_JoystickGetCount(void) { return numjoysticks; } -static void -ANDROID_JoystickDetect(void) +static void ANDROID_JoystickDetect(void) { /* Support for device connect/disconnect is API >= 16 only, * so we poll every three seconds @@ -521,8 +491,7 @@ ANDROID_JoystickDetect(void) } } -static SDL_joylist_item * -JoystickByDevIndex(int device_index) +static SDL_joylist_item *JoystickByDevIndex(int device_index) { SDL_joylist_item *item = SDL_joylist; @@ -539,22 +508,21 @@ JoystickByDevIndex(int device_index) return item; } -static SDL_joylist_item * -JoystickByDeviceId(int device_id) +static SDL_joylist_item *JoystickByDeviceId(int device_id) { SDL_joylist_item *item = SDL_joylist; - while (item != NULL) { + while (item) { if (item->device_id == device_id) { return item; } item = item->next; } - + /* Joystick not found, try adding it */ ANDROID_JoystickDetect(); - - while (item != NULL) { + + while (item) { if (item->device_id == device_id) { return item; } @@ -564,110 +532,101 @@ JoystickByDeviceId(int device_id) return NULL; } -static const char * -ANDROID_JoystickGetDeviceName(int device_index) +static const char *ANDROID_JoystickGetDeviceName(int device_index) { return JoystickByDevIndex(device_index)->name; } -static const char * -ANDROID_JoystickGetDevicePath(int device_index) +static const char *ANDROID_JoystickGetDevicePath(int device_index) { return NULL; } -static int -ANDROID_JoystickGetDevicePlayerIndex(int device_index) +static int ANDROID_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int ANDROID_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -ANDROID_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void ANDROID_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -ANDROID_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID ANDROID_JoystickGetDeviceGUID(int device_index) { return JoystickByDevIndex(device_index)->guid; } -static SDL_JoystickID -ANDROID_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID ANDROID_JoystickGetDeviceInstanceID(int device_index) { return JoystickByDevIndex(device_index)->device_instance; } -static int -ANDROID_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int ANDROID_JoystickOpen(SDL_Joystick *joystick, int device_index) { SDL_joylist_item *item = JoystickByDevIndex(device_index); - if (item == NULL) { + if (!item) { return SDL_SetError("No such device"); } - - if (item->joystick != NULL) { + + if (item->joystick) { return SDL_SetError("Joystick already opened"); } joystick->instance_id = item->device_instance; - joystick->hwdata = (struct joystick_hwdata *) item; + joystick->hwdata = (struct joystick_hwdata *)item; item->joystick = joystick; joystick->nhats = item->nhats; joystick->nballs = item->nballs; joystick->nbuttons = item->nbuttons; joystick->naxes = item->naxes; - return (0); + return 0; } -static int -ANDROID_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int ANDROID_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -ANDROID_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int ANDROID_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -ANDROID_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 ANDROID_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -static int -ANDROID_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int ANDROID_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -ANDROID_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int ANDROID_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -ANDROID_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int ANDROID_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -ANDROID_JoystickUpdate(SDL_Joystick *joystick) +static void ANDROID_JoystickUpdate(SDL_Joystick *joystick) { - SDL_joylist_item *item = (SDL_joylist_item *) joystick->hwdata; + SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata; - if (item == NULL) { + if (!item) { return; } - + if (item->is_accelerometer) { int i; Sint16 value; @@ -688,17 +647,15 @@ ANDROID_JoystickUpdate(SDL_Joystick *joystick) } } -static void -ANDROID_JoystickClose(SDL_Joystick *joystick) +static void ANDROID_JoystickClose(SDL_Joystick *joystick) { - SDL_joylist_item *item = (SDL_joylist_item *) joystick->hwdata; + SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata; if (item) { item->joystick = NULL; } } -static void -ANDROID_JoystickQuit(void) +static void ANDROID_JoystickQuit(void) { /* We don't have any way to scan for joysticks at init, so don't wipe the list * of joysticks here in case this is a reinit. @@ -719,19 +676,18 @@ ANDROID_JoystickQuit(void) #endif /* 0 */ } -static SDL_bool -ANDROID_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool ANDROID_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_ANDROID_JoystickDriver = -{ +SDL_JoystickDriver SDL_ANDROID_JoystickDriver = { ANDROID_JoystickInit, ANDROID_JoystickGetCount, ANDROID_JoystickDetect, ANDROID_JoystickGetDeviceName, ANDROID_JoystickGetDevicePath, + ANDROID_JoystickGetDeviceSteamVirtualGamepadSlot, ANDROID_JoystickGetDevicePlayerIndex, ANDROID_JoystickSetDevicePlayerIndex, ANDROID_JoystickGetDeviceGUID, diff --git a/src/joystick/android/SDL_sysjoystick_c.h b/src/joystick/android/SDL_sysjoystick_c.h index 881c8aa415a11..e1eceabc41ea8 100644 --- a/src/joystick/android/SDL_sysjoystick_c.h +++ b/src/joystick/android/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ extern int Android_OnPadDown(int device_id, int keycode); extern int Android_OnPadUp(int device_id, int keycode); extern int Android_OnJoy(int device_id, int axisnum, float value); extern int Android_OnHat(int device_id, int hat_id, int x, int y); -extern int Android_AddJoystick(int device_id, const char *name, const char *desc, int vendor_id, int product_id, SDL_bool is_accelerometer, int button_mask, int naxes, int nhats, int nballs); +extern int Android_AddJoystick(int device_id, const char *name, const char *desc, int vendor_id, int product_id, SDL_bool is_accelerometer, int button_mask, int naxes, int axis_mask, int nhats, int nballs); extern int Android_RemoveJoystick(int device_id); /* A linked list of available joysticks */ @@ -40,13 +40,13 @@ typedef struct SDL_joylist_item { int device_instance; int device_id; /* Android's device id */ - char *name; /* "SideWinder 3D Pro" or whatever */ + char *name; /* "SideWinder 3D Pro" or whatever */ SDL_JoystickGUID guid; SDL_bool is_accelerometer; SDL_Joystick *joystick; int nbuttons, naxes, nhats, nballs; int dpad_state; - + struct SDL_joylist_item *next; } SDL_joylist_item; diff --git a/src/joystick/bsd/SDL_bsdjoystick.c b/src/joystick/bsd/SDL_bsdjoystick.c index 598505e5ff6ef..8c0260d27e6e3 100644 --- a/src/joystick/bsd/SDL_bsdjoystick.c +++ b/src/joystick/bsd/SDL_bsdjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -69,7 +69,7 @@ #include #endif -#if SDL_HAVE_MACHINE_JOYSTICK_H +#ifdef SDL_HAVE_MACHINE_JOYSTICK_H #include #endif @@ -82,52 +82,22 @@ #define SUPPORT_JOY_GAMEPORT #endif -#define MAX_UHID_JOYS 64 -#define MAX_JOY_JOYS 2 -#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) +#define MAX_UHID_JOYS 64 +#define MAX_JOY_JOYS 2 +#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) #ifdef __OpenBSD__ -#define HUG_DPAD_UP 0x90 -#define HUG_DPAD_DOWN 0x91 -#define HUG_DPAD_RIGHT 0x92 -#define HUG_DPAD_LEFT 0x93 - -#define HAT_CENTERED 0x00 -#define HAT_UP 0x01 -#define HAT_RIGHT 0x02 -#define HAT_DOWN 0x04 -#define HAT_LEFT 0x08 -#define HAT_RIGHTUP (HAT_RIGHT|HAT_UP) -#define HAT_RIGHTDOWN (HAT_RIGHT|HAT_DOWN) -#define HAT_LEFTUP (HAT_LEFT|HAT_UP) -#define HAT_LEFTDOWN (HAT_LEFT|HAT_DOWN) - -/* calculate the value from the state of the dpad */ -int -dpad_to_sdl(Sint32 *dpad) -{ - if (dpad[2]) { - if (dpad[0]) - return HAT_RIGHTUP; - else if (dpad[1]) - return HAT_RIGHTDOWN; - else - return HAT_RIGHT; - } else if (dpad[3]) { - if (dpad[0]) - return HAT_LEFTUP; - else if (dpad[1]) - return HAT_LEFTDOWN; - else - return HAT_LEFT; - } else if (dpad[0]) { - return HAT_UP; - } else if (dpad[1]) { - return HAT_DOWN; - } - return HAT_CENTERED; -} +#define HUG_DPAD_UP 0x90 +#define HUG_DPAD_DOWN 0x91 +#define HUG_DPAD_RIGHT 0x92 +#define HUG_DPAD_LEFT 0x93 + +#define HAT_UP 0x01 +#define HAT_RIGHT 0x02 +#define HAT_DOWN 0x04 +#define HAT_LEFT 0x08 + #endif struct report @@ -140,8 +110,8 @@ struct report #else struct usb_ctl_report *buf; /* Buffer */ #endif - size_t size; /* Buffer size */ - int rid; /* Report ID */ + size_t size; /* Buffer size */ + int rid; /* Report ID */ enum { SREPORT_UNINIT, @@ -156,9 +126,9 @@ static struct hid_kind_t kind; const char *name; } const repinfo[] = { - {UHID_INPUT_REPORT, hid_input, "input"}, - {UHID_OUTPUT_REPORT, hid_output, "output"}, - {UHID_FEATURE_REPORT, hid_feature, "feature"} + { UHID_INPUT_REPORT, hid_input, "input" }, + { UHID_OUTPUT_REPORT, hid_output, "output" }, + { UHID_FEATURE_REPORT, hid_feature, "feature" } }; enum @@ -186,8 +156,8 @@ struct joystick_hwdata int fd; enum { - BSDJOY_UHID, /* uhid(4) */ - BSDJOY_JOY /* joy(4) */ + BSDJOY_UHID, /* uhid(4) */ + BSDJOY_JOY /* joy(4) */ } type; int naxes; @@ -202,8 +172,8 @@ struct joystick_hwdata typedef struct SDL_joylist_item { SDL_JoystickID device_instance; - char *path; /* "/dev/uhid0" or whatever */ - char *name; /* "SideWinder 3D Pro" or whatever */ + char *path; /* "/dev/uhid0" or whatever */ + char *name; /* "SideWinder 3D Pro" or whatever */ SDL_JoystickGUID guid; dev_t devnum; struct SDL_joylist_item *next; @@ -227,9 +197,7 @@ static void report_free(struct report *); #define REP_BUF_DATA(rep) ((rep)->buf->data) #endif - -static int -usage_to_joyaxe(int usage) +static int usage_to_joyaxe(int usage) { int joyaxe; switch (usage) { @@ -263,16 +231,14 @@ usage_to_joyaxe(int usage) return joyaxe; } -static void -FreeJoylistItem(SDL_joylist_item *item) +static void FreeJoylistItem(SDL_joylist_item *item) { SDL_free(item->path); SDL_free(item->name); SDL_free(item); } -static void -FreeHwData(struct joystick_hwdata *hw) +static void FreeHwData(struct joystick_hwdata *hw) { if (hw->type == BSDJOY_UHID) { report_free(&hw->inreport); @@ -303,7 +269,7 @@ CreateHwData(const char *path) hw = (struct joystick_hwdata *) SDL_calloc(1, sizeof(struct joystick_hwdata)); - if (hw == NULL) { + if (!hw) { close(fd); SDL_OutOfMemory(); return NULL; @@ -321,11 +287,12 @@ CreateHwData(const char *path) hw->type = BSDJOY_UHID; { int ax; - for (ax = 0; ax < JOYAXE_count; ax++) + for (ax = 0; ax < JOYAXE_count; ax++) { hw->axis_map[ax] = -1; + } } hw->repdesc = hid_get_report_desc(fd); - if (hw->repdesc == NULL) { + if (!hw->repdesc) { SDL_SetError("%s: USB_GET_REPORT_DESC: %s", path, strerror(errno)); goto usberr; @@ -337,7 +304,7 @@ CreateHwData(const char *path) #else if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) { #endif - rep->rid = -1; /* XXX */ + rep->rid = -1; /* XXX */ } if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { goto usberr; @@ -352,40 +319,40 @@ CreateHwData(const char *path) #else hdata = hid_start_parse(hw->repdesc, 1 << hid_input); #endif - if (hdata == NULL) { + if (!hdata) { SDL_SetError("%s: Cannot start HID parser", path); goto usberr; } - for (i = 0; i < JOYAXE_count; i++) + for (i = 0; i < JOYAXE_count; i++) { hw->axis_map[i] = -1; + } while (hid_get_item(hdata, &hitem) > 0) { switch (hitem.kind) { case hid_input: switch (HID_PAGE(hitem.usage)) { case HUP_GENERIC_DESKTOP: - { - int usage = HID_USAGE(hitem.usage); - int joyaxe = usage_to_joyaxe(usage); - if (joyaxe >= 0) { - hw->axis_map[joyaxe] = 1; - } else if (usage == HUG_HAT_SWITCH + { + int usage = HID_USAGE(hitem.usage); + int joyaxe = usage_to_joyaxe(usage); + if (joyaxe >= 0) { + hw->axis_map[joyaxe] = 1; + } else if (usage == HUG_HAT_SWITCH #ifdef __OpenBSD__ - || usage == HUG_DPAD_UP + || usage == HUG_DPAD_UP #endif - ) { - hw->nhats++; - } - break; + ) { + hw->nhats++; } + break; + } case HUP_BUTTON: - { - int usage = HID_USAGE(hitem.usage); - if (usage > hw->nbuttons) { - hw->nbuttons = usage; - } + { + int usage = HID_USAGE(hitem.usage); + if (usage > hw->nbuttons) { + hw->nbuttons = usage; } - break; + } break; default: break; } @@ -395,9 +362,11 @@ CreateHwData(const char *path) } } hid_end_parse(hdata); - for (i = 0; i < JOYAXE_count; i++) - if (hw->axis_map[i] > 0) + for (i = 0; i < JOYAXE_count; i++) { + if (hw->axis_map[i] > 0) { hw->axis_map[i] = hw->naxes++; + } + } if (hw->naxes == 0 && hw->nbuttons == 0 && hw->nhats == 0) { SDL_SetError("%s: Not a joystick, ignoring", path); @@ -422,8 +391,7 @@ CreateHwData(const char *path) return NULL; } -static int -MaybeAddDevice(const char *path) +static int MaybeAddDevice(const char *path) { struct stat sb; char *name = NULL; @@ -431,7 +399,7 @@ MaybeAddDevice(const char *path) SDL_joylist_item *item; struct joystick_hwdata *hw; - if (path == NULL) { + if (!path) { return -1; } @@ -440,9 +408,9 @@ MaybeAddDevice(const char *path) } /* Check to make sure it's not already in list. */ - for (item = SDL_joylist; item != NULL; item = item->next) { + for (item = SDL_joylist; item; item = item->next) { if (sb.st_rdev == item->devnum) { - return -1; /* already have this one */ + return -1; /* already have this one */ } } @@ -459,7 +427,7 @@ MaybeAddDevice(const char *path) struct usb_device_info di; if (ioctl(hw->fd, USB_GET_DEVICEINFO, &di) != -1) { name = SDL_CreateJoystickName(di.udi_vendorNo, di.udi_productNo, di.udi_vendor, di.udi_product); - guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, di.udi_vendorNo, di.udi_productNo, di.udi_releaseNo, name, 0, 0); + guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, di.udi_vendorNo, di.udi_productNo, di.udi_releaseNo, di.udi_vendor, di.udi_product, 0, 0); #ifdef SDL_JOYSTICK_HIDAPI if (HIDAPI_IsDevicePresent(di.udi_vendorNo, di.udi_productNo, di.udi_releaseNo, name)) { @@ -483,8 +451,8 @@ MaybeAddDevice(const char *path) } FreeHwData(hw); - item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item)); - if (item == NULL) { + item = (SDL_joylist_item *)SDL_calloc(1, sizeof(SDL_joylist_item)); + if (!item) { SDL_free(name); return -1; } @@ -494,13 +462,13 @@ MaybeAddDevice(const char *path) item->name = name; item->guid = guid; - if ((item->path == NULL) || (item->name == NULL)) { - FreeJoylistItem(item); - return -1; + if ((!item->path) || (!item->name)) { + FreeJoylistItem(item); + return -1; } item->device_instance = SDL_GetNextJoystickInstanceID(); - if (SDL_joylist_tail == NULL) { + if (!SDL_joylist_tail) { SDL_joylist = SDL_joylist_tail = item; } else { SDL_joylist_tail->next = item; @@ -515,8 +483,7 @@ MaybeAddDevice(const char *path) return numjoysticks; } -static int -BSD_JoystickInit(void) +static int BSD_JoystickInit(void) { char s[16]; int i; @@ -542,19 +509,16 @@ BSD_JoystickInit(void) return numjoysticks; } -static int -BSD_JoystickGetCount(void) +static int BSD_JoystickGetCount(void) { return numjoysticks; } -static void -BSD_JoystickDetect(void) +static void BSD_JoystickDetect(void) { } -static SDL_joylist_item * -JoystickByDevIndex(int device_index) +static SDL_joylist_item *JoystickByDevIndex(int device_index) { SDL_joylist_item *item = SDL_joylist; @@ -571,44 +535,42 @@ JoystickByDevIndex(int device_index) return item; } -static const char * -BSD_JoystickGetDeviceName(int device_index) +static const char *BSD_JoystickGetDeviceName(int device_index) { return JoystickByDevIndex(device_index)->name; } -static const char * -BSD_JoystickGetDevicePath(int device_index) +static const char *BSD_JoystickGetDevicePath(int device_index) { return JoystickByDevIndex(device_index)->path; } -static int -BSD_JoystickGetDevicePlayerIndex(int device_index) +static int BSD_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int BSD_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -BSD_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void BSD_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -BSD_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID BSD_JoystickGetDeviceGUID(int device_index) { return JoystickByDevIndex(device_index)->guid; } /* Function to perform the mapping from device index to the instance id for this index */ -static SDL_JoystickID -BSD_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID BSD_JoystickGetDeviceInstanceID(int device_index) { return JoystickByDevIndex(device_index)->device_instance; } -static unsigned -hatval_to_sdl(Sint32 hatval) +static unsigned hatval_to_sdl(Sint32 hatval) { static const unsigned hat_dir_map[8] = { SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN, @@ -622,14 +584,12 @@ hatval_to_sdl(Sint32 hatval) return result; } - -static int -BSD_JoystickOpen(SDL_Joystick *joy, int device_index) +static int BSD_JoystickOpen(SDL_Joystick *joy, int device_index) { SDL_joylist_item *item = JoystickByDevIndex(device_index); struct joystick_hwdata *hw; - if (item == NULL) { + if (!item) { return SDL_SetError("No such device"); } @@ -647,8 +607,7 @@ BSD_JoystickOpen(SDL_Joystick *joy, int device_index) return 0; } -static void -BSD_JoystickUpdate(SDL_Joystick *joy) +static void BSD_JoystickUpdate(SDL_Joystick *joy) { struct hid_item hitem; struct hid_data *hdata; @@ -656,7 +615,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) int nbutton, naxe = -1; Sint32 v; #ifdef __OpenBSD__ - Sint32 dpad[4] = {0, 0, 0, 0}; + Sint32 dpad[4] = { 0, 0, 0, 0 }; #endif #ifdef SUPPORT_JOY_GAMEPORT @@ -664,7 +623,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0; if (joy->hwdata->type == BSDJOY_JOY) { - while (read(joy->hwdata->fd, &gameport, sizeof gameport) == sizeof gameport) { + while (read(joy->hwdata->fd, &gameport, sizeof(gameport)) == sizeof(gameport)) { if (SDL_abs(x - gameport.x) > 8) { x = gameport.x; if (x < xmin) { @@ -677,7 +636,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) xmin--; xmax++; } - v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * ((Sint32)x - xmin) ) / (xmax - xmin)) + SDL_JOYSTICK_AXIS_MIN; + v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * ((Sint32)x - xmin)) / (xmax - xmin)) + SDL_JOYSTICK_AXIS_MIN; SDL_PrivateJoystickAxis(joy, 0, v); } if (SDL_abs(y - gameport.y) > 8) { @@ -692,7 +651,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) ymin--; ymax++; } - v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * ((Sint32)y - ymin) ) / (ymax - ymin)) + SDL_JOYSTICK_AXIS_MIN; + v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * ((Sint32)y - ymin)) / (ymax - ymin)) + SDL_JOYSTICK_AXIS_MIN; SDL_PrivateJoystickAxis(joy, 1, v); } SDL_PrivateJoystickButton(joy, 0, gameport.b1); @@ -710,7 +669,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) #else hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); #endif - if (hdata == NULL) { + if (!hdata) { /*fprintf(stderr, "%s: Cannot start HID parser\n", joy->hwdata->path);*/ continue; } @@ -720,44 +679,51 @@ BSD_JoystickUpdate(SDL_Joystick *joy) case hid_input: switch (HID_PAGE(hitem.usage)) { case HUP_GENERIC_DESKTOP: - { - int usage = HID_USAGE(hitem.usage); - int joyaxe = usage_to_joyaxe(usage); - if (joyaxe >= 0) { - naxe = joy->hwdata->axis_map[joyaxe]; - /* scaleaxe */ - v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * (v - hitem.logical_minimum) ) / (hitem.logical_maximum - hitem.logical_minimum)) + SDL_JOYSTICK_AXIS_MIN; - SDL_PrivateJoystickAxis(joy, naxe, v); - } else if (usage == HUG_HAT_SWITCH) { - v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - SDL_PrivateJoystickHat(joy, 0, - hatval_to_sdl(v) - + { + int usage = HID_USAGE(hitem.usage); + int joyaxe = usage_to_joyaxe(usage); + if (joyaxe >= 0) { + naxe = joy->hwdata->axis_map[joyaxe]; + /* scaleaxe */ + v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + v = (((SDL_JOYSTICK_AXIS_MAX - SDL_JOYSTICK_AXIS_MIN) * (v - hitem.logical_minimum)) / (hitem.logical_maximum - hitem.logical_minimum)) + SDL_JOYSTICK_AXIS_MIN; + SDL_PrivateJoystickAxis(joy, naxe, v); + } else if (usage == HUG_HAT_SWITCH) { + v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + SDL_PrivateJoystickHat(joy, 0, + hatval_to_sdl(v) - hitem.logical_minimum); - } + } #ifdef __OpenBSD__ - else if (usage == HUG_DPAD_UP) { - dpad[0] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad)); - } - else if (usage == HUG_DPAD_DOWN) { - dpad[1] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad)); - } - else if (usage == HUG_DPAD_RIGHT) { - dpad[2] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad)); - } - else if (usage == HUG_DPAD_LEFT) { - dpad[3] = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - SDL_PrivateJoystickHat(joy, 0, dpad_to_sdl(dpad)); - } -#endif + /* here D-pad directions are reported like separate buttons. + * calculate the SDL hat value from the 4 separate values. + */ + switch (usage) { + case HUG_DPAD_UP: + dpad[0] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); break; + case HUG_DPAD_DOWN: + dpad[1] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + break; + case HUG_DPAD_RIGHT: + dpad[2] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + break; + case HUG_DPAD_LEFT: + dpad[3] = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + break; + //default: + // no-op } + SDL_PrivateJoystickHat(joy, 0, (dpad[0] * HAT_UP) | + (dpad[1] * HAT_DOWN) | + (dpad[2] * HAT_RIGHT) | + (dpad[3] * HAT_LEFT) ); +#endif + break; + } case HUP_BUTTON: - v = (Sint32) hid_get_data(REP_BUF_DATA(rep), &hitem); - nbutton = HID_USAGE(hitem.usage) - 1; /* SDL buttons are zero-based */ + v = (Sint32)hid_get_data(REP_BUF_DATA(rep), &hitem); + nbutton = HID_USAGE(hitem.usage) - 1; /* SDL buttons are zero-based */ SDL_PrivateJoystickButton(joy, nbutton, v); break; default: @@ -773,8 +739,7 @@ BSD_JoystickUpdate(SDL_Joystick *joy) } /* Function to close a joystick after use */ -static void -BSD_JoystickClose(SDL_Joystick *joy) +static void BSD_JoystickClose(SDL_Joystick *joy) { if (joy->hwdata) { FreeHwData(joy->hwdata); @@ -782,8 +747,7 @@ BSD_JoystickClose(SDL_Joystick *joy) } } -static void -BSD_JoystickQuit(void) +static void BSD_JoystickQuit(void) { SDL_joylist_item *item = NULL; SDL_joylist_item *next = NULL; @@ -798,29 +762,28 @@ BSD_JoystickQuit(void) numjoysticks = 0; } -static int -report_alloc(struct report *r, struct report_desc *rd, int repind) +static int report_alloc(struct report *r, struct report_desc *rd, int repind) { int len; #ifdef __DragonFly__ len = hid_report_size(rd, repinfo[repind].kind, r->rid); -#elif __FREEBSD__ -# if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__) -# if (__FreeBSD_kernel_version <= 500111) +#elif defined(__FREEBSD__) +#if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__) +#if (__FreeBSD_kernel_version <= 500111) len = hid_report_size(rd, r->rid, repinfo[repind].kind); -# else +#else len = hid_report_size(rd, repinfo[repind].kind, r->rid); -# endif -# else +#endif +#else len = hid_report_size(rd, repinfo[repind].kind, &r->rid); -# endif +#endif #else -# ifdef USBHID_NEW +#ifdef USBHID_NEW len = hid_report_size(rd, repinfo[repind].kind, r->rid); -# else +#else len = hid_report_size(rd, repinfo[repind].kind, &r->rid); -# endif +#endif #endif if (len < 0) { @@ -835,7 +798,7 @@ report_alloc(struct report *r, struct report_desc *rd, int repind) r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) + r->size); #endif - if (r->buf == NULL) { + if (!r->buf) { return SDL_OutOfMemory(); } } else { @@ -846,62 +809,54 @@ report_alloc(struct report *r, struct report_desc *rd, int repind) return 0; } -static void -report_free(struct report *r) +static void report_free(struct report *r) { SDL_free(r->buf); r->status = SREPORT_UNINIT; } -static int -BSD_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int BSD_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -BSD_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int BSD_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static SDL_bool -BSD_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool BSD_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -static Uint32 -BSD_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 BSD_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -static int -BSD_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int BSD_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -BSD_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int BSD_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -BSD_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int BSD_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -SDL_JoystickDriver SDL_BSD_JoystickDriver = -{ +SDL_JoystickDriver SDL_BSD_JoystickDriver = { BSD_JoystickInit, BSD_JoystickGetCount, BSD_JoystickDetect, BSD_JoystickGetDeviceName, BSD_JoystickGetDevicePath, + BSD_JoystickGetDeviceSteamVirtualGamepadSlot, BSD_JoystickGetDevicePlayerIndex, BSD_JoystickSetDevicePlayerIndex, BSD_JoystickGetDeviceGUID, diff --git a/src/joystick/check_8bitdo.sh b/src/joystick/check_8bitdo.sh index d65b972a8c0c5..5e172dbfa0106 100755 --- a/src/joystick/check_8bitdo.sh +++ b/src/joystick/check_8bitdo.sh @@ -10,6 +10,6 @@ cat <<__EOF__ __EOF__ echo "Actual output:" -fgrep 8BitDo SDL_gamecontrollerdb.h | fgrep -v hint -egrep "hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | fgrep -i 8bit | fgrep -v x:b2,y:b3 | fgrep -v x:b3,y:b4 -egrep "hint:.SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | fgrep -i 8bit | fgrep -v x:b3,y:b2 | fgrep -v x:b4,y:b3 +${FGREP:-grep -F} 8BitDo SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -v hint +${EGREP:-grep -E} "hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -i 8bit | ${FGREP:-grep -F} -v x:b2,y:b3 | ${FGREP:-grep -F} -v x:b3,y:b4 +${EGREP:-grep -E} "hint:.SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1" SDL_gamecontrollerdb.h | ${FGREP:-grep -F} -i 8bit | ${FGREP:-grep -F} -v x:b3,y:b2 | ${FGREP:-grep -F} -v x:b4,y:b3 diff --git a/src/joystick/controller_list.h b/src/joystick/controller_list.h new file mode 100644 index 0000000000000..79446c5cae7b5 --- /dev/null +++ b/src/joystick/controller_list.h @@ -0,0 +1,603 @@ +/* + Copyright (C) Valve Corporation + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#define MAKE_CONTROLLER_ID( nVID, nPID ) (unsigned int)( (unsigned int)nVID << 16 | (unsigned int)nPID ) + +static const ControllerDescription_t arrControllers[] = { + { MAKE_CONTROLLER_ID( 0x0079, 0x181a ), k_eControllerType_PS3Controller, NULL }, // Venom Arcade Stick + { MAKE_CONTROLLER_ID( 0x0079, 0x1844 ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller, NULL }, // Firestorm Dual Analog 3 + { MAKE_CONTROLLER_ID( 0x044f, 0xd007 ), k_eControllerType_PS3Controller, NULL }, // Thrustmaster wireless 3-1 + { MAKE_CONTROLLER_ID( 0x046d, 0xcad1 ), k_eControllerType_PS3Controller, NULL }, // Logitech Chillstream + //{ MAKE_CONTROLLER_ID( 0x046d, 0xc24f ), k_eControllerType_PS3Controller, NULL }, // Logitech G29 (PS3) + { MAKE_CONTROLLER_ID( 0x054c, 0x0268 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller + { MAKE_CONTROLLER_ID( 0x056e, 0x200f ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x056e, 0x2013 ), k_eControllerType_PS3Controller, NULL }, // JC-U4113SBK + { MAKE_CONTROLLER_ID( 0x05b8, 0x1004 ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x05b8, 0x1006 ), k_eControllerType_PS3Controller, NULL }, // JC-U3412SBK + { MAKE_CONTROLLER_ID( 0x06a3, 0xf622 ), k_eControllerType_PS3Controller, NULL }, // Cyborg V3 + { MAKE_CONTROLLER_ID( 0x0738, 0x3180 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz Alpha PS3 mode + { MAKE_CONTROLLER_ID( 0x0738, 0x3250 ), k_eControllerType_PS3Controller, NULL }, // madcats fightpad pro ps3 + { MAKE_CONTROLLER_ID( 0x0738, 0x3481 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz FightStick TE 2+ PS3 + { MAKE_CONTROLLER_ID( 0x0738, 0x8180 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz Alpha PS4 mode (no touchpad on device) + { MAKE_CONTROLLER_ID( 0x0738, 0x8838 ), k_eControllerType_PS3Controller, NULL }, // Madcatz Fightstick Pro + { MAKE_CONTROLLER_ID( 0x0810, 0x0001 ), k_eControllerType_PS3Controller, NULL }, // actually ps2 - maybe break out later + { MAKE_CONTROLLER_ID( 0x0810, 0x0003 ), k_eControllerType_PS3Controller, NULL }, // actually ps2 - maybe break out later + { MAKE_CONTROLLER_ID( 0x0925, 0x0005 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller + { MAKE_CONTROLLER_ID( 0x0925, 0x8866 ), k_eControllerType_PS3Controller, NULL }, // PS2 maybe break out later + { MAKE_CONTROLLER_ID( 0x0925, 0x8888 ), k_eControllerType_PS3Controller, NULL }, // Actually ps2 -maybe break out later Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0109 ), k_eControllerType_PS3Controller, NULL }, // PDP Versus Fighting Pad + { MAKE_CONTROLLER_ID( 0x0e6f, 0x011e ), k_eControllerType_PS3Controller, NULL }, // Rock Candy PS4 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0128 ), k_eControllerType_PS3Controller, NULL }, // Rock Candy PS3 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0214 ), k_eControllerType_PS3Controller, NULL }, // afterglow ps3 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x1314 ), k_eControllerType_PS3Controller, NULL }, // PDP Afterglow Wireless PS3 controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x6302 ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x0e8f, 0x0008 ), k_eControllerType_PS3Controller, NULL }, // Green Asia + { MAKE_CONTROLLER_ID( 0x0e8f, 0x3075 ), k_eControllerType_PS3Controller, NULL }, // SpeedLink Strike FX + { MAKE_CONTROLLER_ID( 0x0e8f, 0x310d ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0009 ), k_eControllerType_PS3Controller, NULL }, // HORI BDA GP1 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x004d ), k_eControllerType_PS3Controller, NULL }, // Horipad 3 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x005f ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander 4 PS3 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x006a ), k_eControllerType_PS3Controller, NULL }, // Real Arcade Pro 4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x006e ), k_eControllerType_PS3Controller, NULL }, // HORI horipad4 ps3 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0085 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander PS3 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0086 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander PC (Uses the Xbox 360 protocol, but has PS3 buttons) + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0088 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Stick mini 4 + { MAKE_CONTROLLER_ID( 0x0f30, 0x1100 ), k_eControllerType_PS3Controller, NULL }, // Qanba Q1 fight stick + { MAKE_CONTROLLER_ID( 0x11ff, 0x3331 ), k_eControllerType_PS3Controller, NULL }, // SRXJ-PH2400 + { MAKE_CONTROLLER_ID( 0x1345, 0x1000 ), k_eControllerType_PS3Controller, NULL }, // PS2 ACME GA-D5 + { MAKE_CONTROLLER_ID( 0x1345, 0x6005 ), k_eControllerType_PS3Controller, NULL }, // ps2 maybe break out later + { MAKE_CONTROLLER_ID( 0x146b, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x1a34, 0x0836 ), k_eControllerType_PS3Controller, NULL }, // Afterglow PS3 + { MAKE_CONTROLLER_ID( 0x20bc, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // ShanWan PS3 + { MAKE_CONTROLLER_ID( 0x20d6, 0x576d ), k_eControllerType_PS3Controller, NULL }, // Power A PS3 + { MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // From SDL + { MAKE_CONTROLLER_ID( 0x2563, 0x0523 ), k_eControllerType_PS3Controller, NULL }, // Digiflip GP006 + { MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, "Retro-bit Controller" }, // SWITCH CO., LTD. Retro-bit Controller + { MAKE_CONTROLLER_ID( 0x25f0, 0x83c3 ), k_eControllerType_PS3Controller, NULL }, // gioteck vx2 + { MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, // + { MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone + { MAKE_CONTROLLER_ID( 0x2c22, 0x2302 ), k_eControllerType_PS3Controller, NULL }, // Qanba Obsidian + { MAKE_CONTROLLER_ID( 0x2c22, 0x2502 ), k_eControllerType_PS3Controller, NULL }, // Qanba Dragon + { MAKE_CONTROLLER_ID( 0x8380, 0x0003 ), k_eControllerType_PS3Controller, NULL }, // BTP 2163 + { MAKE_CONTROLLER_ID( 0x8888, 0x0308 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller + + { MAKE_CONTROLLER_ID( 0x0079, 0x181b ), k_eControllerType_PS4Controller, NULL }, // Venom Arcade Stick - XXX:this may not work and may need to be called a ps3 controller + //{ MAKE_CONTROLLER_ID( 0x046d, 0xc260 ), k_eControllerType_PS4Controller, NULL }, // Logitech G29 (PS4) + { MAKE_CONTROLLER_ID( 0x044f, 0xd00e ), k_eControllerType_PS4Controller, NULL }, // Thrustmaster Eswap Pro - No gyro and lightbar doesn't change color. Works otherwise + { MAKE_CONTROLLER_ID( 0x054c, 0x05c4 ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Controller + { MAKE_CONTROLLER_ID( 0x054c, 0x05c5 ), k_eControllerType_PS4Controller, NULL }, // STRIKEPAD PS4 Grip Add-on + { MAKE_CONTROLLER_ID( 0x054c, 0x09cc ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Slim Controller + { MAKE_CONTROLLER_ID( 0x054c, 0x0ba0 ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Controller (Wireless dongle) + { MAKE_CONTROLLER_ID( 0x0738, 0x8250 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightPad Pro PS4 + { MAKE_CONTROLLER_ID( 0x0738, 0x8384 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE S+ PS4 + { MAKE_CONTROLLER_ID( 0x0738, 0x8480 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE 2 PS4 + { MAKE_CONTROLLER_ID( 0x0738, 0x8481 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE 2+ PS4 + { MAKE_CONTROLLER_ID( 0x0c12, 0x0e10 ), k_eControllerType_PS4Controller, NULL }, // Armor Armor 3 Pad PS4 + { MAKE_CONTROLLER_ID( 0x0c12, 0x0e13 ), k_eControllerType_PS4Controller, NULL }, // ZEROPLUS P4 Wired Gamepad + { MAKE_CONTROLLER_ID( 0x0c12, 0x0e15 ), k_eControllerType_PS4Controller, NULL }, // Game:Pad 4 + { MAKE_CONTROLLER_ID( 0x0c12, 0x0e20 ), k_eControllerType_PS4Controller, NULL }, // Brook Mars Controller - needs FW update to show up as Ps4 controller on PC. Has Gyro but touchpad is a single button. + { MAKE_CONTROLLER_ID( 0x0c12, 0x0ef6 ), k_eControllerType_PS4Controller, NULL }, // Hitbox Arcade Stick + { MAKE_CONTROLLER_ID( 0x0c12, 0x1cf6 ), k_eControllerType_PS4Controller, NULL }, // EMIO PS4 Elite Controller + { MAKE_CONTROLLER_ID( 0x0c12, 0x1e10 ), k_eControllerType_PS4Controller, NULL }, // P4 Wired Gamepad generic knock off - lightbar but not trackpad or gyro + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0203 ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS (PS4 peripheral but no trackpad/lightbar) + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0207 ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS V2 w/ Touchpad for PS4 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x020a ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS PS4/PS5 (PS4 mode) + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0055 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS + { MAKE_CONTROLLER_ID( 0x0f0d, 0x005e ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander 4 PS4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0066 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS Plus + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0084 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander PS4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0087 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Stick mini 4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x008a ), k_eControllerType_PS4Controller, NULL }, // HORI Real Arcade Pro 4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x009c ), k_eControllerType_PS4Controller, NULL }, // HORI TAC PRO mousething + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00a0 ), k_eControllerType_PS4Controller, NULL }, // HORI TAC4 mousething + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ed ), k_eControllerType_XInputPS4Controller, NULL }, // Hori Fighting Stick mini 4 kai - becomes an Xbox 360 controller on PC + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ee ), k_eControllerType_PS4Controller, NULL }, // Hori mini wired https://www.playstation.com/en-us/explore/accessories/gaming-controllers/mini-wired-gamepad/ + { MAKE_CONTROLLER_ID( 0x0f0d, 0x011c ), k_eControllerType_PS4Controller, NULL }, // Hori Fighting Stick α + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0123 ), k_eControllerType_PS4Controller, NULL }, // HORI Wireless Controller Light (Japan only) - only over bt- over usb is xbox and pid 0x0124 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0162 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander OCTA + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0164 ), k_eControllerType_XInputPS4Controller, NULL }, // HORI Fighting Commander OCTA + { MAKE_CONTROLLER_ID( 0x11c0, 0x4001 ), k_eControllerType_PS4Controller, NULL }, // "PS4 Fun Controller" added from user log + { MAKE_CONTROLLER_ID( 0x146b, 0x0603 ), k_eControllerType_XInputPS4Controller, NULL }, // Nacon PS4 Compact Controller + { MAKE_CONTROLLER_ID( 0x146b, 0x0604 ), k_eControllerType_XInputPS4Controller, NULL }, // NACON Daija Arcade Stick + { MAKE_CONTROLLER_ID( 0x146b, 0x0605 ), k_eControllerType_XInputPS4Controller, NULL }, // NACON PS4 controller in Xbox mode - might also be other bigben brand xbox controllers + { MAKE_CONTROLLER_ID( 0x146b, 0x0606 ), k_eControllerType_XInputPS4Controller, NULL }, // NACON Unknown Controller + { MAKE_CONTROLLER_ID( 0x146b, 0x0609 ), k_eControllerType_XInputPS4Controller, NULL }, // NACON Wireless Controller for PS4 + { MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller - has gyro + { MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller v2 - has gyro + { MAKE_CONTROLLER_ID( 0x146b, 0x0d06 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller Wireless Dongle -- show up as ps4 until you connect controller to it then it reboots into Xbox controller with different vvid/pid + { MAKE_CONTROLLER_ID( 0x146b, 0x0d08 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited Wireless Dongle + { MAKE_CONTROLLER_ID( 0x146b, 0x0d09 ), k_eControllerType_PS4Controller, NULL }, // NACON Daija Fight Stick - touchpad but no gyro/rumble + { MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Infinite - has gyro + { MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited + { MAKE_CONTROLLER_ID( 0x146b, 0x0d13 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Pro Controller 3 + { MAKE_CONTROLLER_ID( 0x146b, 0x1103 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller -- on windows this doesn't enumerate + { MAKE_CONTROLLER_ID( 0x1532, 0X0401 ), k_eControllerType_PS4Controller, NULL }, // Razer Panthera PS4 Controller + { MAKE_CONTROLLER_ID( 0x1532, 0x1000 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju PS4 Controller + { MAKE_CONTROLLER_ID( 0x1532, 0x1004 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Ultimate USB + { MAKE_CONTROLLER_ID( 0x1532, 0x1007 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Tournament edition USB + { MAKE_CONTROLLER_ID( 0x1532, 0x1008 ), k_eControllerType_PS4Controller, NULL }, // Razer Panthera Evo Fightstick + { MAKE_CONTROLLER_ID( 0x1532, 0x1009 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Ultimate BT + { MAKE_CONTROLLER_ID( 0x1532, 0x100A ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Tournament edition BT + { MAKE_CONTROLLER_ID( 0x1532, 0x1100 ), k_eControllerType_PS4Controller, NULL }, // Razer RAION Fightpad - Trackpad, no gyro, lightbar hardcoded to green + { MAKE_CONTROLLER_ID( 0x20d6, 0x792a ), k_eControllerType_PS4Controller, NULL }, // PowerA Fusion Fight Pad + { MAKE_CONTROLLER_ID( 0x2c22, 0x2000 ), k_eControllerType_PS4Controller, NULL }, // Qanba Drone + { MAKE_CONTROLLER_ID( 0x2c22, 0x2300 ), k_eControllerType_PS4Controller, NULL }, // Qanba Obsidian + { MAKE_CONTROLLER_ID( 0x2c22, 0x2303 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Obsidian Arcade Joystick + { MAKE_CONTROLLER_ID( 0x2c22, 0x2500 ), k_eControllerType_PS4Controller, NULL }, // Qanba Dragon + { MAKE_CONTROLLER_ID( 0x2c22, 0x2503 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Dragon Arcade Joystick + { MAKE_CONTROLLER_ID( 0x3285, 0x0d16 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution 5 Pro (PS4 mode with dongle) + { MAKE_CONTROLLER_ID( 0x3285, 0x0d17 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution 5 Pro (PS4 mode wired) + { MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller, NULL }, // Armor 3 or Level Up Cobra - At least one variant has gyro + { MAKE_CONTROLLER_ID (0x9886, 0x0024 ), k_eControllerType_XInputPS4Controller, NULL }, // Astro C40 in Xbox 360 mode + { MAKE_CONTROLLER_ID( 0x9886, 0x0025 ), k_eControllerType_PS4Controller, NULL }, // Astro C40 + // Removing the Giotek because there were a bunch of help tickets from users w/ issues including from non-PS4 controller users. This VID/PID is probably used in different FW's +// { MAKE_CONTROLLER_ID( 0x7545, 0x1122 ), k_eControllerType_PS4Controller, NULL }, // Giotek VX4 - trackpad/gyro don't work. Had to not filter on interface info. Light bar is flaky, but works. + + { MAKE_CONTROLLER_ID( 0x054c, 0x0ce6 ), k_eControllerType_PS5Controller, NULL }, // Sony DualSense Controller + { MAKE_CONTROLLER_ID( 0x054c, 0x0df2 ), k_eControllerType_PS5Controller, NULL }, // Sony DualSense Edge Controller + { MAKE_CONTROLLER_ID( 0x054c, 0x0e5f ), k_eControllerType_PS5Controller, NULL }, // Access Controller for PS5 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0209 ), k_eControllerType_PS5Controller, NULL }, // Victrix Pro FS PS4/PS5 (PS5 mode) + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0163 ), k_eControllerType_PS5Controller, NULL }, // HORI Fighting Commander OCTA + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0184 ), k_eControllerType_PS5Controller, NULL }, // Hori Fighting Stick α + { MAKE_CONTROLLER_ID( 0x1532, 0x100b ), k_eControllerType_PS5Controller, NULL }, // Razer Wolverine V2 Pro (Wired) + { MAKE_CONTROLLER_ID( 0x1532, 0x100c ), k_eControllerType_PS5Controller, NULL }, // Razer Wolverine V2 Pro (Wireless) + { MAKE_CONTROLLER_ID( 0x1532, 0x1012 ), k_eControllerType_PS5Controller, NULL }, // Razer Kitsune + { MAKE_CONTROLLER_ID( 0x3285, 0x0d18 ), k_eControllerType_PS5Controller, NULL }, // NACON Revolution 5 Pro (PS5 mode with dongle) + { MAKE_CONTROLLER_ID( 0x3285, 0x0d19 ), k_eControllerType_PS5Controller, NULL }, // NACON Revolution 5 Pro (PS5 mode wired) + { MAKE_CONTROLLER_ID( 0x358a, 0x0104 ), k_eControllerType_PS5Controller, NULL }, // Backbone One PlayStation Edition for iOS + + { MAKE_CONTROLLER_ID( 0x0079, 0x0006 ), k_eControllerType_UnknownNonSteamController, NULL }, // DragonRise Generic USB PCB, sometimes configured as a PC Twin Shock Controller - looks like a DS3 but the face buttons are 1-4 instead of symbols + + { MAKE_CONTROLLER_ID( 0x0079, 0x18d4 ), k_eControllerType_XBox360Controller, NULL }, // GPD Win 2 X-Box Controller + { MAKE_CONTROLLER_ID( 0x03eb, 0xff02 ), k_eControllerType_XBox360Controller, NULL }, // Wooting Two + { MAKE_CONTROLLER_ID( 0x044f, 0xb326 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster Gamepad GP XID + { MAKE_CONTROLLER_ID( 0x045e, 0x028e ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad + { MAKE_CONTROLLER_ID( 0x045e, 0x028f ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad v2 + { MAKE_CONTROLLER_ID( 0x045e, 0x0291 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (XBOX) + { MAKE_CONTROLLER_ID( 0x045e, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft X-Box 360 Big Button IR + { MAKE_CONTROLLER_ID( 0x045e, 0x02a1 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Controller with XUSB driver on Windows + { MAKE_CONTROLLER_ID( 0x045e, 0x02a9 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (third party knockoff) + { MAKE_CONTROLLER_ID( 0x045e, 0x0719 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver + { MAKE_CONTROLLER_ID( 0x046d, 0xc21d ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F310 + { MAKE_CONTROLLER_ID( 0x046d, 0xc21e ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F510 + { MAKE_CONTROLLER_ID( 0x046d, 0xc21f ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F710 + { MAKE_CONTROLLER_ID( 0x046d, 0xc242 ), k_eControllerType_XBox360Controller, NULL }, // Logitech Chillstream Controller + { MAKE_CONTROLLER_ID( 0x056e, 0x2004 ), k_eControllerType_XBox360Controller, NULL }, // Elecom JC-U3613M +// This isn't actually an Xbox 360 controller, it just looks like one +// { MAKE_CONTROLLER_ID( 0x06a3, 0xf51a ), k_eControllerType_XBox360Controller, NULL }, // Saitek P3600 + { MAKE_CONTROLLER_ID( 0x0738, 0x4716 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller + { MAKE_CONTROLLER_ID( 0x0738, 0x4718 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV FightStick SE + { MAKE_CONTROLLER_ID( 0x0738, 0x4726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller + { MAKE_CONTROLLER_ID( 0x0738, 0x4728 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV FightPad + { MAKE_CONTROLLER_ID( 0x0738, 0x4736 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MicroCon Gamepad + { MAKE_CONTROLLER_ID( 0x0738, 0x4738 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller (SFIV) + { MAKE_CONTROLLER_ID( 0x0738, 0x4740 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Beat Pad + { MAKE_CONTROLLER_ID( 0x0738, 0xb726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox controller - MW2 + { MAKE_CONTROLLER_ID( 0x0738, 0xbeef ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz JOYTECH NEO SE Advanced GamePad + { MAKE_CONTROLLER_ID( 0x0738, 0xcb02 ), k_eControllerType_XBox360Controller, NULL }, // Saitek Cyborg Rumble Pad - PC/Xbox 360 + { MAKE_CONTROLLER_ID( 0x0738, 0xcb03 ), k_eControllerType_XBox360Controller, NULL }, // Saitek P3200 Rumble Pad - PC/Xbox 360 + { MAKE_CONTROLLER_ID( 0x0738, 0xf738 ), k_eControllerType_XBox360Controller, NULL }, // Super SFIV FightStick TE S + { MAKE_CONTROLLER_ID( 0x0955, 0x7210 ), k_eControllerType_XBox360Controller, NULL }, // Nvidia Shield local controller + { MAKE_CONTROLLER_ID( 0x0955, 0xb400 ), k_eControllerType_XBox360Controller, NULL }, // NVIDIA Shield streaming controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0105 ), k_eControllerType_XBox360Controller, NULL }, // HSM3 Xbox360 dancepad + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0113 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x011f ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Rock Candy" }, // PDP Rock Candy Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0125 ), k_eControllerType_XBox360Controller, "PDP INJUSTICE FightStick" }, // PDP INJUSTICE FightStick for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0127 ), k_eControllerType_XBox360Controller, "PDP INJUSTICE FightPad" }, // PDP INJUSTICE FightPad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0131 ), k_eControllerType_XBox360Controller, "PDP EA Soccer Controller" }, // PDP EA Soccer Gamepad + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0133 ), k_eControllerType_XBox360Controller, "PDP Battlefield 4 Controller" }, // PDP Battlefield 4 Gamepad + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0143 ), k_eControllerType_XBox360Controller, "PDP MK X Fight Stick" }, // PDP MK X Fight Stick for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0147 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Marvel Controller" }, // PDP Marvel Controller for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0201 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0213 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x021f ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Rock Candy" }, // PDP Rock Candy Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0301 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0313 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0314 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0401 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0413 ), k_eControllerType_XBox360Controller, NULL }, // PDP Afterglow AX.1 (unlisted) + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0501 ), k_eControllerType_XBox360Controller, NULL }, // PDP Xbox 360 Controller (unlisted) + { MAKE_CONTROLLER_ID( 0x0e6f, 0xf900 ), k_eControllerType_XBox360Controller, NULL }, // PDP Afterglow AX.1 (unlisted) + { MAKE_CONTROLLER_ID( 0x0f0d, 0x000a ), k_eControllerType_XBox360Controller, NULL }, // Hori Co. DOA4 FightStick + { MAKE_CONTROLLER_ID( 0x0f0d, 0x000c ), k_eControllerType_XBox360Controller, NULL }, // Hori PadEX Turbo + { MAKE_CONTROLLER_ID( 0x0f0d, 0x000d ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick EX2 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0016 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.EX + { MAKE_CONTROLLER_ID( 0x0f0d, 0x001b ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro VX + { MAKE_CONTROLLER_ID( 0x0f0d, 0x008c ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro 4 + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00db ), k_eControllerType_XBox360Controller, "HORI Slime Controller" }, // Hori Dragon Quest Slime Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x011e ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick α + { MAKE_CONTROLLER_ID( 0x1038, 0x1430 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" }, // SteelSeries Stratus Duo + { MAKE_CONTROLLER_ID( 0x1038, 0x1431 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" }, // SteelSeries Stratus Duo + { MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_XBox360Controller, NULL }, // SteelSeries Nimbus/Stratus XL + { MAKE_CONTROLLER_ID( 0x11c9, 0x55f0 ), k_eControllerType_XBox360Controller, NULL }, // Nacon GC-100XF + { MAKE_CONTROLLER_ID( 0x12ab, 0x0004 ), k_eControllerType_XBox360Controller, NULL }, // Honey Bee Xbox360 dancepad + { MAKE_CONTROLLER_ID( 0x12ab, 0x0301 ), k_eControllerType_XBox360Controller, NULL }, // PDP AFTERGLOW AX.1 + { MAKE_CONTROLLER_ID( 0x12ab, 0x0303 ), k_eControllerType_XBox360Controller, NULL }, // Mortal Kombat Klassic FightStick + { MAKE_CONTROLLER_ID( 0x1430, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller Adapter + { MAKE_CONTROLLER_ID( 0x1430, 0x4748 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Guitar Hero X-plorer + { MAKE_CONTROLLER_ID( 0x1430, 0xf801 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller + { MAKE_CONTROLLER_ID( 0x146b, 0x0601 ), k_eControllerType_XBox360Controller, NULL }, // BigBen Interactive XBOX 360 Controller +// { MAKE_CONTROLLER_ID( 0x1532, 0x0037 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth + { MAKE_CONTROLLER_ID( 0x15e4, 0x3f00 ), k_eControllerType_XBox360Controller, NULL }, // Power A Mini Pro Elite + { MAKE_CONTROLLER_ID( 0x15e4, 0x3f0a ), k_eControllerType_XBox360Controller, NULL }, // Xbox Airflo wired controller + { MAKE_CONTROLLER_ID( 0x15e4, 0x3f10 ), k_eControllerType_XBox360Controller, NULL }, // Batarang Xbox 360 controller + { MAKE_CONTROLLER_ID( 0x162e, 0xbeef ), k_eControllerType_XBox360Controller, NULL }, // Joytech Neo-Se Take2 + { MAKE_CONTROLLER_ID( 0x1689, 0xfd00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza Tournament Edition + { MAKE_CONTROLLER_ID( 0x1689, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza Classic Edition + { MAKE_CONTROLLER_ID( 0x1689, 0xfe00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth + { MAKE_CONTROLLER_ID( 0x1949, 0x041a ), k_eControllerType_XBox360Controller, "Amazon Luna Controller" }, // Amazon Luna Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0x0002 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Guitar + { MAKE_CONTROLLER_ID( 0x1bad, 0x0003 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Drumkit + { MAKE_CONTROLLER_ID( 0x1bad, 0xf016 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0xf018 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV SE Fighting Stick + { MAKE_CONTROLLER_ID( 0x1bad, 0xf019 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Brawlstick for Xbox 360 + { MAKE_CONTROLLER_ID( 0x1bad, 0xf021 ), k_eControllerType_XBox360Controller, NULL }, // Mad Cats Ghost Recon FS GamePad + { MAKE_CONTROLLER_ID( 0x1bad, 0xf023 ), k_eControllerType_XBox360Controller, NULL }, // MLG Pro Circuit Controller (Xbox) + { MAKE_CONTROLLER_ID( 0x1bad, 0xf025 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Call Of Duty + { MAKE_CONTROLLER_ID( 0x1bad, 0xf027 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FPS Pro + { MAKE_CONTROLLER_ID( 0x1bad, 0xf028 ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV FightPad + { MAKE_CONTROLLER_ID( 0x1bad, 0xf02e ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Fightpad + { MAKE_CONTROLLER_ID( 0x1bad, 0xf036 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MicroCon GamePad Pro + { MAKE_CONTROLLER_ID( 0x1bad, 0xf038 ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV FightStick TE + { MAKE_CONTROLLER_ID( 0x1bad, 0xf039 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MvC2 TE + { MAKE_CONTROLLER_ID( 0x1bad, 0xf03a ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz SFxT Fightstick Pro + { MAKE_CONTROLLER_ID( 0x1bad, 0xf03d ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV Arcade Stick TE - Chun Li + { MAKE_CONTROLLER_ID( 0x1bad, 0xf03e ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MLG FightStick TE + { MAKE_CONTROLLER_ID( 0x1bad, 0xf03f ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick SoulCaliber + { MAKE_CONTROLLER_ID( 0x1bad, 0xf042 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick TES+ + { MAKE_CONTROLLER_ID( 0x1bad, 0xf080 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick TE2 + { MAKE_CONTROLLER_ID( 0x1bad, 0xf501 ), k_eControllerType_XBox360Controller, NULL }, // HoriPad EX2 Turbo + { MAKE_CONTROLLER_ID( 0x1bad, 0xf502 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.VX SA + { MAKE_CONTROLLER_ID( 0x1bad, 0xf503 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick VX + { MAKE_CONTROLLER_ID( 0x1bad, 0xf504 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro. EX + { MAKE_CONTROLLER_ID( 0x1bad, 0xf505 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick EX2B + { MAKE_CONTROLLER_ID( 0x1bad, 0xf506 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.EX Premium VLX + { MAKE_CONTROLLER_ID( 0x1bad, 0xf900 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Xbox 360 Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0xf901 ), k_eControllerType_XBox360Controller, NULL }, // Gamestop Xbox 360 Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0xf902 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Gamepad2 + { MAKE_CONTROLLER_ID( 0x1bad, 0xf903 ), k_eControllerType_XBox360Controller, NULL }, // Tron Xbox 360 controller + { MAKE_CONTROLLER_ID( 0x1bad, 0xf904 ), k_eControllerType_XBox360Controller, NULL }, // PDP Versus Fighting Pad + { MAKE_CONTROLLER_ID( 0x1bad, 0xf906 ), k_eControllerType_XBox360Controller, NULL }, // MortalKombat FightStick + { MAKE_CONTROLLER_ID( 0x1bad, 0xfa01 ), k_eControllerType_XBox360Controller, NULL }, // MadCatz GamePad + { MAKE_CONTROLLER_ID( 0x1bad, 0xfd00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza TE + { MAKE_CONTROLLER_ID( 0x1bad, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza + { MAKE_CONTROLLER_ID( 0x24c6, 0x5000 ), k_eControllerType_XBox360Controller, NULL }, // Razer Atrox Arcade Stick + { MAKE_CONTROLLER_ID( 0x24c6, 0x5300 ), k_eControllerType_XBox360Controller, NULL }, // PowerA MINI PROEX Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x5303 ), k_eControllerType_XBox360Controller, NULL }, // Xbox Airflo wired controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x530a ), k_eControllerType_XBox360Controller, NULL }, // Xbox 360 Pro EX Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x531a ), k_eControllerType_XBox360Controller, NULL }, // PowerA Pro Ex + { MAKE_CONTROLLER_ID( 0x24c6, 0x5397 ), k_eControllerType_XBox360Controller, NULL }, // FUS1ON Tournament Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x5500 ), k_eControllerType_XBox360Controller, NULL }, // Hori XBOX 360 EX 2 with Turbo + { MAKE_CONTROLLER_ID( 0x24c6, 0x5501 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro VX-SA + { MAKE_CONTROLLER_ID( 0x24c6, 0x5502 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick VX Alt + { MAKE_CONTROLLER_ID( 0x24c6, 0x5503 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Edge + { MAKE_CONTROLLER_ID( 0x24c6, 0x5506 ), k_eControllerType_XBox360Controller, NULL }, // Hori SOULCALIBUR V Stick + { MAKE_CONTROLLER_ID( 0x24c6, 0x550d ), k_eControllerType_XBox360Controller, NULL }, // Hori GEM Xbox controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x550e ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro V Kai 360 + { MAKE_CONTROLLER_ID( 0x24c6, 0x5508 ), k_eControllerType_XBox360Controller, NULL }, // Hori PAD A + { MAKE_CONTROLLER_ID( 0x24c6, 0x5510 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Commander ONE + { MAKE_CONTROLLER_ID( 0x24c6, 0x5b00 ), k_eControllerType_XBox360Controller, NULL }, // ThrustMaster Ferrari Italia 458 Racing Wheel + { MAKE_CONTROLLER_ID( 0x24c6, 0x5b02 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster, Inc. GPX Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x5b03 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster Ferrari 458 Racing Wheel + { MAKE_CONTROLLER_ID( 0x24c6, 0x5d04 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth + { MAKE_CONTROLLER_ID( 0x24c6, 0xfafa ), k_eControllerType_XBox360Controller, NULL }, // Aplay Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0xfafb ), k_eControllerType_XBox360Controller, NULL }, // Aplay Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0xfafc ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 1 + { MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3 + { MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360 + + { MAKE_CONTROLLER_ID( 0x03f0, 0x0495 ), k_eControllerType_XBoxOneController, NULL }, // HP HyperX Clutch Gladiate + { MAKE_CONTROLLER_ID( 0x044f, 0xd012 ), k_eControllerType_XBoxOneController, NULL }, // ThrustMaster eSwap PRO Controller Xbox + { MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad + { MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015) + { MAKE_CONTROLLER_ID( 0x045e, 0x02e0 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth) + { MAKE_CONTROLLER_ID( 0x045e, 0x02e3 ), k_eControllerType_XBoxOneController, "Xbox One Elite Controller" }, // Microsoft X-Box One Elite pad + { MAKE_CONTROLLER_ID( 0x045e, 0x02ea ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad + { MAKE_CONTROLLER_ID( 0x045e, 0x02fd ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth) + { MAKE_CONTROLLER_ID( 0x045e, 0x02ff ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One controller with XBOXGIP driver on Windows + { MAKE_CONTROLLER_ID( 0x045e, 0x0b00 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad +// { MAKE_CONTROLLER_ID( 0x045e, 0x0b02 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // The virtual keyboard generated by XboxGip drivers for Xbox One Controllers (see https://github.com/libsdl-org/SDL/pull/5121 for details) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b05 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (Bluetooth) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b0a ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad + { MAKE_CONTROLLER_ID( 0x045e, 0x0b0c ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (Bluetooth) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b12 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad + { MAKE_CONTROLLER_ID( 0x045e, 0x0b13 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad (BLE) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b20 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (BLE) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b21 ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (BLE) + { MAKE_CONTROLLER_ID( 0x045e, 0x0b22 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (BLE) + { MAKE_CONTROLLER_ID( 0x0738, 0x4a01 ), k_eControllerType_XBoxOneController, NULL }, // Mad Catz FightStick TE 2 + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0139 ), k_eControllerType_XBoxOneController, "PDP Xbox One Afterglow" }, // PDP Afterglow Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x013B ), k_eControllerType_XBoxOneController, "PDP Xbox One Face-Off Controller" }, // PDP Face-Off Gamepad for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x013a ), k_eControllerType_XBoxOneController, NULL }, // PDP Xbox One Controller (unlisted) + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0145 ), k_eControllerType_XBoxOneController, "PDP MK X Fight Pad" }, // PDP MK X Fight Pad for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0146 ), k_eControllerType_XBoxOneController, "PDP Xbox One Rock Candy" }, // PDP Rock Candy Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x015b ), k_eControllerType_XBoxOneController, "PDP Fallout 4 Vault Boy Controller" }, // PDP Fallout 4 Vault Boy Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x015c ), k_eControllerType_XBoxOneController, "PDP Xbox One @Play Controller" }, // PDP @Play Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x015d ), k_eControllerType_XBoxOneController, "PDP Mirror's Edge Controller" }, // PDP Mirror's Edge Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x015f ), k_eControllerType_XBoxOneController, "PDP Metallic Controller" }, // PDP Metallic Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0160 ), k_eControllerType_XBoxOneController, "PDP NFL Face-Off Controller" }, // PDP NFL Official Face-Off Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0161 ), k_eControllerType_XBoxOneController, "PDP Xbox One Camo" }, // PDP Camo Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0162 ), k_eControllerType_XBoxOneController, "PDP Xbox One Controller" }, // PDP Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0163 ), k_eControllerType_XBoxOneController, "PDP Deliverer of Truth" }, // PDP Legendary Collection: Deliverer of Truth + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0164 ), k_eControllerType_XBoxOneController, "PDP Battlefield 1 Controller" }, // PDP Battlefield 1 Official Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0165 ), k_eControllerType_XBoxOneController, "PDP Titanfall 2 Controller" }, // PDP Titanfall 2 Official Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0166 ), k_eControllerType_XBoxOneController, "PDP Mass Effect: Andromeda Controller" }, // PDP Mass Effect: Andromeda Official Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0167 ), k_eControllerType_XBoxOneController, "PDP Halo Wars 2 Face-Off Controller" }, // PDP Halo Wars 2 Official Face-Off Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0205 ), k_eControllerType_XBoxOneController, "PDP Victrix Pro Fight Stick" }, // PDP Victrix Pro Fight Stick + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0206 ), k_eControllerType_XBoxOneController, "PDP Mortal Kombat Controller" }, // PDP Mortal Kombat 25 Anniversary Edition Stick (Xbox One) + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0246 ), k_eControllerType_XBoxOneController, "PDP Xbox One Rock Candy" }, // PDP Rock Candy Wired Controller for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0261 ), k_eControllerType_XBoxOneController, "PDP Xbox One Camo" }, // PDP Camo Wired Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0262 ), k_eControllerType_XBoxOneController, "PDP Xbox One Controller" }, // PDP Wired Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Wired Controller for Xbox One - Midnight Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Wired Controller for Xbox One - Verdant Green + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a2 ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Wired Controller for Xbox One - Crimson Red + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a4 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Wired Controller for Xbox One - Stealth Series | Phantom Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Wired Controller for Xbox One - Stealth Series | Ghost White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a6 ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Wired Controller for Xbox One - Stealth Series | Revenant Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a7 ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Wired Controller for Xbox One - Raven Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a8 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a9 ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Wired Controller for Xbox One - Midnight Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02aa ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Wired Controller for Xbox One - Verdant Green + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ab ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Wired Controller for Xbox One - Crimson Red + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ac ), k_eControllerType_XBoxOneController, "PDP Xbox One Ember Orange" }, // PDP Wired Controller for Xbox One - Ember Orange + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ad ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Wired Controller for Xbox One - Stealth Series | Phantom Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ae ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Wired Controller for Xbox One - Stealth Series | Ghost White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02af ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Wired Controller for Xbox One - Stealth Series | Revenant Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Wired Controller for Xbox One - Raven Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Afterglow" }, // PDP Afterglow Prismatic Wired Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b5 ), k_eControllerType_XBoxOneController, "PDP Xbox One GAMEware Controller" }, // PDP GAMEware Wired Controller Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b6 ), k_eControllerType_XBoxOneController, NULL }, // PDP One-Handed Joystick Adaptive Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02bd ), k_eControllerType_XBoxOneController, "PDP Xbox One Royal Purple" }, // PDP Wired Controller for Xbox One - Royal Purple + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02be ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Deluxe Wired Controller for Xbox One - Raven Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02bf ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Deluxe Wired Controller for Xbox One - Midnight Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Phantom Black + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Ghost White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c2 ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Revenant Blue + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Deluxe Wired Controller for Xbox One - Verdant Green + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c4 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ember Orange" }, // PDP Deluxe Wired Controller for Xbox One - Ember Orange + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Royal Purple" }, // PDP Deluxe Wired Controller for Xbox One - Royal Purple + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c6 ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Deluxe Wired Controller for Xbox One - Crimson Red + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c7 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Deluxe Wired Controller for Xbox One - Arctic White + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c8 ), k_eControllerType_XBoxOneController, "PDP Kingdom Hearts Controller" }, // PDP Kingdom Hearts Wired Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c9 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantasm Red" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Phantasm Red + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ca ), k_eControllerType_XBoxOneController, "PDP Xbox One Specter Violet" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Specter Violet + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cb ), k_eControllerType_XBoxOneController, "PDP Xbox One Specter Violet" }, // PDP Wired Controller for Xbox One - Stealth Series | Specter Violet + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cd ), k_eControllerType_XBoxOneController, "PDP Xbox One Blu-merang" }, // PDP Rock Candy Wired Controller for Xbox One - Blu-merang + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ce ), k_eControllerType_XBoxOneController, "PDP Xbox One Cranblast" }, // PDP Rock Candy Wired Controller for Xbox One - Cranblast + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cf ), k_eControllerType_XBoxOneController, "PDP Xbox One Aqualime" }, // PDP Rock Candy Wired Controller for Xbox One - Aqualime + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Red Camo" }, // PDP Wired Controller for Xbox One - Red Camo + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0346 ), k_eControllerType_XBoxOneController, "PDP Xbox One RC Gamepad" }, // PDP RC Gamepad for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0446 ), k_eControllerType_XBoxOneController, "PDP Xbox One RC Gamepad" }, // PDP RC Gamepad for Xbox One + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02da ), k_eControllerType_XBoxOneController, "PDP Xbox Series X Afterglow" }, // PDP Xbox Series X Afterglow + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d6 ), k_eControllerType_XBoxOneController, "Victrix Gambit Tournament Controller" }, // Victrix Gambit Tournament Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d9 ), k_eControllerType_XBoxOneController, "PDP Xbox Series X Midnight Blue" }, // PDP Xbox Series X Midnight Blue + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0063 ), k_eControllerType_XBoxOneController, NULL }, // Hori Real Arcade Pro Hayabusa (USA) Xbox One + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0067 ), k_eControllerType_XBoxOneController, NULL }, // HORIPAD ONE + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0078 ), k_eControllerType_XBoxOneController, NULL }, // Hori Real Arcade Pro V Kai Xbox One + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c5 ), k_eControllerType_XBoxOneController, NULL }, // HORI Fighting Commander + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0150 ), k_eControllerType_XBoxOneController, NULL }, // HORI Fighting Commander OCTA for Xbox Series X + { MAKE_CONTROLLER_ID( 0x10f5, 0x7009 ), k_eControllerType_XBoxOneController, NULL }, // Turtle Beach Recon Controller + { MAKE_CONTROLLER_ID( 0x10f5, 0x7013 ), k_eControllerType_XBoxOneController, NULL }, // Turtle Beach REACT-R + { MAKE_CONTROLLER_ID( 0x1532, 0x0a00 ), k_eControllerType_XBoxOneController, NULL }, // Razer Atrox Arcade Stick + { MAKE_CONTROLLER_ID( 0x1532, 0x0a03 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wildcat + { MAKE_CONTROLLER_ID( 0x1532, 0x0a14 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wolverine Ultimate + { MAKE_CONTROLLER_ID( 0x1532, 0x0a15 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wolverine Tournament Edition + { MAKE_CONTROLLER_ID( 0x20d6, 0x2001 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Black Inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x2002 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Gray/White Inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x2003 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Green Inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x2004 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Pink inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x2005 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Wired Controller Core - Black + { MAKE_CONTROLLER_ID( 0x20d6, 0x2006 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Wired Controller Core - White + { MAKE_CONTROLLER_ID( 0x20d6, 0x2009 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Red inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x200a ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Blue inline + { MAKE_CONTROLLER_ID( 0x20d6, 0x200b ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Camo Metallic Red + { MAKE_CONTROLLER_ID( 0x20d6, 0x200c ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Camo Metallic Blue + { MAKE_CONTROLLER_ID( 0x20d6, 0x200d ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Seafoam Fade + { MAKE_CONTROLLER_ID( 0x20d6, 0x200e ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Midnight Blue + { MAKE_CONTROLLER_ID( 0x20d6, 0x200f ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Soldier Green + { MAKE_CONTROLLER_ID( 0x20d6, 0x2011 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired - Metallic Ice + { MAKE_CONTROLLER_ID( 0x20d6, 0x2012 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Cuphead EnWired Controller - Mugman + { MAKE_CONTROLLER_ID( 0x20d6, 0x2015 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Blue Hint + { MAKE_CONTROLLER_ID( 0x20d6, 0x2016 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Green Hint + { MAKE_CONTROLLER_ID( 0x20d6, 0x2017 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Cntroller - Arctic Camo + { MAKE_CONTROLLER_ID( 0x20d6, 0x2018 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Arc Lightning + { MAKE_CONTROLLER_ID( 0x20d6, 0x2019 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Royal Purple + { MAKE_CONTROLLER_ID( 0x20d6, 0x201a ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Nebula + { MAKE_CONTROLLER_ID( 0x20d6, 0x4001 ), k_eControllerType_XBoxOneController, "PowerA Fusion Pro 2 Controller" }, // PowerA Fusion Pro 2 Wired Controller (Xbox Series X style) + { MAKE_CONTROLLER_ID( 0x20d6, 0x4002 ), k_eControllerType_XBoxOneController, "PowerA Spectra Infinity Controller" }, // PowerA Spectra Infinity Wired Controller (Xbox Series X style) + { MAKE_CONTROLLER_ID( 0x24c6, 0x541a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Xbox One Mini Wired Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x542a ), k_eControllerType_XBoxOneController, NULL }, // Xbox ONE spectra + { MAKE_CONTROLLER_ID( 0x24c6, 0x543a ), k_eControllerType_XBoxOneController, "PowerA Xbox One Controller" }, // PowerA Xbox ONE liquid metal controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x551a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Pro Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x561a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x581a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Classic Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x591a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Pro Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x592a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Spectra Pro + { MAKE_CONTROLLER_ID( 0x24c6, 0x791a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Fusion Fight Pad + { MAKE_CONTROLLER_ID( 0x2dc8, 0x2002 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller for Xbox + { MAKE_CONTROLLER_ID( 0x2e24, 0x0652 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke + { MAKE_CONTROLLER_ID( 0x2e24, 0x1618 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke + { MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin X91 + { MAKE_CONTROLLER_ID( 0x146b, 0x0611 ), k_eControllerType_XBoxOneController, NULL }, // Xbox Controller Mode for NACON Revolution 3 + + // These have been added via Minidump for unrecognized Xinput controller assert + { MAKE_CONTROLLER_ID( 0x0000, 0x0000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x045e, 0x02a2 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - Microsoft VID + { MAKE_CONTROLLER_ID( 0x0e6f, 0x1414 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0159 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0xfaff ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x006d ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00a4 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x1832 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x187f ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x1883 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x03eb, 0xff01 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0c12, 0x0ef8 ), k_eControllerType_XBox360Controller, NULL }, // Homemade fightstick based on brook pcb (with XInput driver??) + { MAKE_CONTROLLER_ID( 0x046d, 0x1000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1345, 0x6006 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + + { MAKE_CONTROLLER_ID( 0x056e, 0x2012 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x146b, 0x0602 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ae ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x046d, 0x0401 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput + { MAKE_CONTROLLER_ID( 0x046d, 0x0301 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput + { MAKE_CONTROLLER_ID( 0x046d, 0xcaa3 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput + { MAKE_CONTROLLER_ID( 0x046d, 0xc261 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput + { MAKE_CONTROLLER_ID( 0x046d, 0x0291 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput + { MAKE_CONTROLLER_ID( 0x0079, 0x18d3 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00b1 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0001, 0x0001 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x188e ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x187c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x189c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x0079, 0x1874 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller + + { MAKE_CONTROLLER_ID( 0x2f24, 0x0050 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0x2e ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0x91 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1430, 0x719 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xf0d, 0xed ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xf0d, 0xc0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x152 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2a7 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x46d, 0x1007 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2b8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2a8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x79, 0x18a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + + /* Added from Minidumps 10-9-19 */ + { MAKE_CONTROLLER_ID( 0x0, 0x6686 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x11ff, 0x511 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x12ab, 0x304 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1430, 0x291 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1430, 0x2a9 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1430, 0x70b ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0x28e ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0x2a0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x1bad, 0x5500 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x20ab, 0x55ef ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x24c6, 0x5509 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2516, 0x69 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x25b1, 0x360 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2c22, 0x2203 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0x11 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0x53 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0xb7 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x46d, 0x0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x46d, 0x1004 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x46d, 0x1008 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x46d, 0xf301 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x738, 0x2a0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x738, 0x7263 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x738, 0xb738 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x738, 0xcb29 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x738, 0xf401 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x79, 0x18c2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x79, 0x18c8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x79, 0x18cf ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xc12, 0xe17 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xc12, 0xe1c ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xc12, 0xe22 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xc12, 0xe30 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xd2d2, 0xd2d2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xd62, 0x9a1a ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xd62, 0x9a1b ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe00, 0xe00 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x12a ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2a2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2a5 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2b2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2bd ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2bf ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2c0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0x2c6 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xf0d, 0x97 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xf0d, 0xba ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xf0d, 0xd8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xfff, 0x2a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x45e, 0x867 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + // Added 12-17-2020 + { MAKE_CONTROLLER_ID( 0x16d0, 0xf3f ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0x2f24, 0x8f ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + { MAKE_CONTROLLER_ID( 0xe6f, 0xf501 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller + + //{ MAKE_CONTROLLER_ID( 0x1949, 0x0402 ), /*android*/, NULL }, // Unknown Controller + + { MAKE_CONTROLLER_ID( 0x05ac, 0x0001 ), k_eControllerType_AppleController, NULL }, // MFI Extended Gamepad (generic entry for iOS/tvOS) + { MAKE_CONTROLLER_ID( 0x05ac, 0x0002 ), k_eControllerType_AppleController, NULL }, // MFI Standard Gamepad (generic entry for iOS/tvOS) + + { MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft, NULL }, // Nintendo Switch Joy-Con (Left) + { MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight, NULL }, // Nintendo Switch Joy-Con (Right) + { MAKE_CONTROLLER_ID( 0x057e, 0x2008 ), k_eControllerType_SwitchJoyConPair, NULL }, // Nintendo Switch Joy-Con (Left+Right Combined) + + // This same controller ID is spoofed by many 3rd-party Switch controllers. + // The ones we currently know of are: + // * Any 8bitdo controller with Switch support + // * ORTZ Gaming Wireless Pro Controller + // * ZhiXu Gamepad Wireless + // * Sunwaytek Wireless Motion Controller for Nintendo Switch + { MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Switch Pro Controller + //{ MAKE_CONTROLLER_ID( 0x057e, 0x2017 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SNES Controller + //{ MAKE_CONTROLLER_ID( 0x057e, 0x2019 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online N64 Controller + //{ MAKE_CONTROLLER_ID( 0x057e, 0x201e ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SEGA Genesis Controller + + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c1 ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORIPAD for Nintendo Switch + { MAKE_CONTROLLER_ID( 0x0f0d, 0x0092 ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Pokken Tournament DX Pro Pad + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00f6 ), k_eControllerType_SwitchProController, NULL }, // HORI Wireless Switch Pad + // The HORIPAD S, which comes in multiple styles: + // - NSW-108, classic GameCube controller + // - NSW-244, Fighting Commander arcade pad + // - NSW-278, Hori Pad Mini gamepad + // - NSW-326, HORIPAD FPS for Nintendo Switch + // + // The first two, at least, shouldn't have their buttons remapped, and since we + // can't tell which model we're actually using, we won't do any button remapping + // for any of them. + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00dc ), k_eControllerType_XInputSwitchController, NULL }, // HORIPAD S - Looks like a Switch controller but uses the Xbox 360 controller protocol + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0180 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Pro Controller for Nintendo Switch + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0181 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Deluxe Wired Pro Controller for Nintendo Switch + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0184 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Deluxe+ Audio Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0185 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Wired Fight Pad Pro for Nintendo Switch + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0186 ), k_eControllerType_SwitchProController, NULL }, // PDP Afterglow Wireless Switch Controller - working gyro. USB is for charging only. Many later "Wireless" line devices w/ gyro also use this vid/pid + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0187 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Rockcandy Wired Controller + { MAKE_CONTROLLER_ID( 0x0e6f, 0x0188 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Afterglow Wired Deluxe+ Audio Controller + { MAKE_CONTROLLER_ID( 0x0f0d, 0x00aa ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Real Arcade Pro V Hayabusa in Switch Mode + { MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Wired Controller Plus/PowerA Wired Controller Nintendo GameCube Style + { MAKE_CONTROLLER_ID( 0x20d6, 0xa712 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Fight Pad + { MAKE_CONTROLLER_ID( 0x20d6, 0xa713 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Super Mario Controller + { MAKE_CONTROLLER_ID( 0x20d6, 0xa714 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Spectra Controller + { MAKE_CONTROLLER_ID( 0x20d6, 0xa715 ), k_eControllerType_SwitchInputOnlyController, NULL }, // Power A Fusion Wireless Arcade Stick (USB Mode) Over BT is shows up as 057e 2009 + { MAKE_CONTROLLER_ID( 0x20d6, 0xa716 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Pro Controller - USB requires toggling switch on back of device + + // Valve products + { MAKE_CONTROLLER_ID( 0x0000, 0x11fb ), k_eControllerType_MobileTouch, NULL }, // Streaming mobile touch virtual controls + { MAKE_CONTROLLER_ID( 0x28de, 0x1101 ), k_eControllerType_SteamController, NULL }, // Valve Legacy Steam Controller (CHELL) + { MAKE_CONTROLLER_ID( 0x28de, 0x1102 ), k_eControllerType_SteamController, NULL }, // Valve wired Steam Controller (D0G) + { MAKE_CONTROLLER_ID( 0x28de, 0x1105 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G) + { MAKE_CONTROLLER_ID( 0x28de, 0x1106 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G) + { MAKE_CONTROLLER_ID( 0x28de, 0x11ff ), k_eControllerType_UnknownNonSteamController, NULL }, // Steam Virtual Gamepad + { MAKE_CONTROLLER_ID( 0x28de, 0x1142 ), k_eControllerType_SteamController, NULL }, // Valve wireless Steam Controller + { MAKE_CONTROLLER_ID( 0x28de, 0x1201 ), k_eControllerType_SteamControllerV2, NULL }, // Valve wired Steam Controller (HEADCRAB) + { MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2, NULL }, // Valve Bluetooth Steam Controller (HEADCRAB) + { MAKE_CONTROLLER_ID( 0x28de, 0x1205 ), k_eControllerType_SteamDeck, NULL }, // Valve Steam Deck Builtin Controller +}; diff --git a/src/joystick/controller_type.c b/src/joystick/controller_type.c index b51f27f6a1443..cda3586a7a4c4 100644 --- a/src/joystick/controller_type.c +++ b/src/joystick/controller_type.c @@ -23,574 +23,9 @@ #include "SDL_gamecontroller.h" #include "controller_type.h" +#include "controller_list.h" -#define MAKE_CONTROLLER_ID( nVID, nPID ) (unsigned int)( (unsigned int)nVID << 16 | (unsigned int)nPID ) - -static const ControllerDescription_t arrControllers[] = { - { MAKE_CONTROLLER_ID( 0x0079, 0x181a ), k_eControllerType_PS3Controller, NULL }, // Venom Arcade Stick - { MAKE_CONTROLLER_ID( 0x0079, 0x1844 ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller, NULL }, // Firestorm Dual Analog 3 - { MAKE_CONTROLLER_ID( 0x044f, 0xd007 ), k_eControllerType_PS3Controller, NULL }, // Thrustmaster wireless 3-1 - { MAKE_CONTROLLER_ID( 0x046d, 0xc24f ), k_eControllerType_PS3Controller, NULL }, // Logitech G29 (PS3) - { MAKE_CONTROLLER_ID( 0x054c, 0x0268 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller - { MAKE_CONTROLLER_ID( 0x056e, 0x200f ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x056e, 0x2013 ), k_eControllerType_PS3Controller, NULL }, // JC-U4113SBK - { MAKE_CONTROLLER_ID( 0x05b8, 0x1004 ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x05b8, 0x1006 ), k_eControllerType_PS3Controller, NULL }, // JC-U3412SBK - { MAKE_CONTROLLER_ID( 0x06a3, 0xf622 ), k_eControllerType_PS3Controller, NULL }, // Cyborg V3 - { MAKE_CONTROLLER_ID( 0x0738, 0x3180 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz Alpha PS3 mode - { MAKE_CONTROLLER_ID( 0x0738, 0x3250 ), k_eControllerType_PS3Controller, NULL }, // madcats fightpad pro ps3 - { MAKE_CONTROLLER_ID( 0x0738, 0x3481 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz FightStick TE 2+ PS3 - { MAKE_CONTROLLER_ID( 0x0738, 0x8180 ), k_eControllerType_PS3Controller, NULL }, // Mad Catz Alpha PS4 mode (no touchpad on device) - { MAKE_CONTROLLER_ID( 0x0738, 0x8838 ), k_eControllerType_PS3Controller, NULL }, // Madcatz Fightstick Pro - { MAKE_CONTROLLER_ID( 0x0810, 0x0001 ), k_eControllerType_PS3Controller, NULL }, // actually ps2 - maybe break out later - { MAKE_CONTROLLER_ID( 0x0810, 0x0003 ), k_eControllerType_PS3Controller, NULL }, // actually ps2 - maybe break out later - { MAKE_CONTROLLER_ID( 0x0925, 0x0005 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller - { MAKE_CONTROLLER_ID( 0x0925, 0x8866 ), k_eControllerType_PS3Controller, NULL }, // PS2 maybe break out later - { MAKE_CONTROLLER_ID( 0x0925, 0x8888 ), k_eControllerType_PS3Controller, NULL }, // Actually ps2 -maybe break out later Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0109 ), k_eControllerType_PS3Controller, NULL }, // PDP Versus Fighting Pad - { MAKE_CONTROLLER_ID( 0x0e6f, 0x011e ), k_eControllerType_PS3Controller, NULL }, // Rock Candy PS4 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0128 ), k_eControllerType_PS3Controller, NULL }, // Rock Candy PS3 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0203 ), k_eControllerType_PS3Controller, NULL }, // Victrix Pro FS (PS4 peripheral but no trackpad/lightbar) - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0214 ), k_eControllerType_PS3Controller, NULL }, // afterglow ps3 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x1314 ), k_eControllerType_PS3Controller, NULL }, // PDP Afterglow Wireless PS3 controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x6302 ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x0e8f, 0x0008 ), k_eControllerType_PS3Controller, NULL }, // Green Asia - { MAKE_CONTROLLER_ID( 0x0e8f, 0x3075 ), k_eControllerType_PS3Controller, NULL }, // SpeedLink Strike FX - { MAKE_CONTROLLER_ID( 0x0e8f, 0x310d ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0009 ), k_eControllerType_PS3Controller, NULL }, // HORI BDA GP1 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x004d ), k_eControllerType_PS3Controller, NULL }, // Horipad 3 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x005f ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander 4 PS3 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x006a ), k_eControllerType_PS3Controller, NULL }, // Real Arcade Pro 4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x006e ), k_eControllerType_PS3Controller, NULL }, // HORI horipad4 ps3 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0085 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander PS3 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0086 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Commander PC (Uses the Xbox 360 protocol, but has PS3 buttons) - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0088 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Stick mini 4 - { MAKE_CONTROLLER_ID( 0x0f30, 0x1100 ), k_eControllerType_PS3Controller, NULL }, // Qanba Q1 fight stick - { MAKE_CONTROLLER_ID( 0x11ff, 0x3331 ), k_eControllerType_PS3Controller, NULL }, // SRXJ-PH2400 - { MAKE_CONTROLLER_ID( 0x1345, 0x1000 ), k_eControllerType_PS3Controller, NULL }, // PS2 ACME GA-D5 - { MAKE_CONTROLLER_ID( 0x1345, 0x6005 ), k_eControllerType_PS3Controller, NULL }, // ps2 maybe break out later - { MAKE_CONTROLLER_ID( 0x146b, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x1a34, 0x0836 ), k_eControllerType_PS3Controller, NULL }, // Afterglow PS3 - { MAKE_CONTROLLER_ID( 0x20bc, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // ShanWan PS3 - { MAKE_CONTROLLER_ID( 0x20d6, 0x576d ), k_eControllerType_PS3Controller, NULL }, // Power A PS3 - { MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x2563, 0x0523 ), k_eControllerType_PS3Controller, NULL }, // Digiflip GP006 - { MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, NULL }, // From SDL - { MAKE_CONTROLLER_ID( 0x25f0, 0x83c3 ), k_eControllerType_PS3Controller, NULL }, // gioteck vx2 - { MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, // - { MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone - { MAKE_CONTROLLER_ID( 0x2c22, 0x2302 ), k_eControllerType_PS3Controller, NULL }, // Qanba Obsidian - { MAKE_CONTROLLER_ID( 0x2c22, 0x2502 ), k_eControllerType_PS3Controller, NULL }, // Qanba Dragon - { MAKE_CONTROLLER_ID( 0x8380, 0x0003 ), k_eControllerType_PS3Controller, NULL }, // BTP 2163 - { MAKE_CONTROLLER_ID( 0x8888, 0x0308 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller - - { MAKE_CONTROLLER_ID( 0x0079, 0x181b ), k_eControllerType_PS4Controller, NULL }, // Venom Arcade Stick - XXX:this may not work and may need to be called a ps3 controller - { MAKE_CONTROLLER_ID( 0x046d, 0xc260 ), k_eControllerType_PS4Controller, NULL }, // Logitech G29 (PS4) - { MAKE_CONTROLLER_ID( 0x054c, 0x05c4 ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Controller - { MAKE_CONTROLLER_ID( 0x054c, 0x05c5 ), k_eControllerType_PS4Controller, NULL }, // STRIKEPAD PS4 Grip Add-on - { MAKE_CONTROLLER_ID( 0x054c, 0x09cc ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Slim Controller - { MAKE_CONTROLLER_ID( 0x054c, 0x0ba0 ), k_eControllerType_PS4Controller, NULL }, // Sony PS4 Controller (Wireless dongle) - { MAKE_CONTROLLER_ID( 0x0738, 0x8250 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightPad Pro PS4 - { MAKE_CONTROLLER_ID( 0x0738, 0x8384 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE S+ PS4 - { MAKE_CONTROLLER_ID( 0x0738, 0x8480 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE 2 PS4 - { MAKE_CONTROLLER_ID( 0x0738, 0x8481 ), k_eControllerType_PS4Controller, NULL }, // Mad Catz FightStick TE 2+ PS4 - { MAKE_CONTROLLER_ID( 0x0C12, 0x0E10 ), k_eControllerType_PS4Controller, NULL }, // Armor Armor 3 Pad PS4 - { MAKE_CONTROLLER_ID( 0x0C12, 0x1CF6 ), k_eControllerType_PS4Controller, NULL }, // EMIO PS4 Elite Controller - { MAKE_CONTROLLER_ID( 0x0c12, 0x0e13 ), k_eControllerType_PS4Controller, NULL }, // ZEROPLUS P4 Wired Gamepad - { MAKE_CONTROLLER_ID( 0x0c12, 0x0e15 ), k_eControllerType_PS4Controller, NULL }, // Game:Pad 4 - { MAKE_CONTROLLER_ID( 0x0c12, 0x0ef6 ), k_eControllerType_PS4Controller, NULL }, // Hitbox Arcade Stick - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0055 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS - { MAKE_CONTROLLER_ID( 0x0f0d, 0x005e ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander 4 PS4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0066 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS Plus - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0084 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander PS4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0087 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Stick mini 4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x008a ), k_eControllerType_PS4Controller, NULL }, // HORI Real Arcade Pro 4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x009c ), k_eControllerType_PS4Controller, NULL }, // HORI TAC PRO mousething - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00a0 ), k_eControllerType_PS4Controller, NULL }, // HORI TAC4 mousething - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ed ), k_eControllerType_XInputPS4Controller, NULL }, // Hori Fighting Stick mini 4 kai - becomes an Xbox 360 controller on PC - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ee ), k_eControllerType_PS4Controller, NULL }, // Hori mini wired https://www.playstation.com/en-us/explore/accessories/gaming-controllers/mini-wired-gamepad/ - { MAKE_CONTROLLER_ID( 0x0f0d, 0x011c ), k_eControllerType_PS4Controller, NULL }, // Hori Fighting Stick α - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0123 ), k_eControllerType_PS4Controller, NULL }, // HORI Wireless Controller Light (Japan only) - only over bt- over usb is xbox and pid 0x0124 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0162 ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander OCTA - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0164 ), k_eControllerType_XInputPS4Controller, NULL }, // HORI Fighting Commander OCTA - { MAKE_CONTROLLER_ID( 0x11c0, 0x4001 ), k_eControllerType_PS4Controller, NULL }, // "PS4 Fun Controller" added from user log - { MAKE_CONTROLLER_ID( 0x146b, 0x0603 ), k_eControllerType_XInputPS4Controller, NULL }, // Nacon PS4 Compact Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller - has gyro - { MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller v2 - has gyro - { MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Infinite - has gyro - { MAKE_CONTROLLER_ID( 0x1532, 0X0401 ), k_eControllerType_PS4Controller, NULL }, // Razer Panthera PS4 Controller - { MAKE_CONTROLLER_ID( 0x1532, 0x1000 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju PS4 Controller - { MAKE_CONTROLLER_ID( 0x1532, 0x1004 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Ultimate USB - { MAKE_CONTROLLER_ID( 0x1532, 0x1007 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Tournament edition USB - { MAKE_CONTROLLER_ID( 0x1532, 0x1008 ), k_eControllerType_PS4Controller, NULL }, // Razer Panthera Evo Fightstick - { MAKE_CONTROLLER_ID( 0x1532, 0x1009 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Ultimate BT - { MAKE_CONTROLLER_ID( 0x1532, 0x100A ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Tournament edition BT - { MAKE_CONTROLLER_ID( 0x1532, 0x1100 ), k_eControllerType_PS4Controller, NULL }, // Razer RAION Fightpad - Trackpad, no gyro, lightbar hardcoded to green - { MAKE_CONTROLLER_ID( 0x20d6, 0x792a ), k_eControllerType_PS4Controller, NULL }, // PowerA Fusion Fight Pad - { MAKE_CONTROLLER_ID( 0x2c22, 0x2000 ), k_eControllerType_PS4Controller, NULL }, // Qanba Drone - { MAKE_CONTROLLER_ID( 0x2c22, 0x2300 ), k_eControllerType_PS4Controller, NULL }, // Qanba Obsidian - { MAKE_CONTROLLER_ID( 0x2c22, 0x2303 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Obsidian Arcade Joystick - { MAKE_CONTROLLER_ID( 0x2c22, 0x2500 ), k_eControllerType_PS4Controller, NULL }, // Qanba Dragon - { MAKE_CONTROLLER_ID( 0x2c22, 0x2503 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Dragon Arcade Joystick - { MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller, NULL }, // Armor 3 or Level Up Cobra - At least one variant has gyro - { MAKE_CONTROLLER_ID( 0x9886, 0x0025 ), k_eControllerType_PS4Controller, NULL }, // Astro C40 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0207 ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro Fightstick w/ Touchpad for PS4 - // Removing the Giotek because there were a bunch of help tickets from users w/ issues including from non-PS4 controller users. This VID/PID is probably used in different FW's -// { MAKE_CONTROLLER_ID( 0x7545, 0x1122 ), k_eControllerType_PS4Controller, NULL }, // Giotek VX4 - trackpad/gyro don't work. Had to not filter on interface info. Light bar is flaky, but works. - { MAKE_CONTROLLER_ID( 0x044f, 0xd00e ), k_eControllerType_PS4Controller, NULL }, // Thrustmast Eswap Pro - No gyro and lightbar doesn't change color. Works otherwise - { MAKE_CONTROLLER_ID( 0x0c12, 0x1e10 ), k_eControllerType_PS4Controller, NULL }, // P4 Wired Gamepad generic knock off - lightbar but not trackpad or gyro - { MAKE_CONTROLLER_ID( 0x146b, 0x0d09 ), k_eControllerType_PS4Controller, NULL }, // NACON Daija Fight Stick - touchpad but no gyro/rumble - { MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited - { MAKE_CONTROLLER_ID( 0x146b, 0x0d08 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited Wireless Dongle - { MAKE_CONTROLLER_ID( 0x146b, 0x0d06 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller Wireless Dongle -- show up as ps4 until you connect controller to it then it reboots into Xbox controller with different vvid/pid - { MAKE_CONTROLLER_ID( 0x146b, 0x1103 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller -- on windows this doesn't enumerate - { MAKE_CONTROLLER_ID( 0x146b, 0x0d13 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution 3 - { MAKE_CONTROLLER_ID( 0x0c12, 0x0e20 ), k_eControllerType_PS4Controller, NULL }, // Brook Mars Controller - needs FW update to show up as Ps4 controller on PC. Has Gyro but touchpad is a single button. - - { MAKE_CONTROLLER_ID( 0x054c, 0x0ce6 ), k_eControllerType_PS5Controller, NULL }, // Sony PS5 Controller - { MAKE_CONTROLLER_ID( 0x054c, 0x0df2 ), k_eControllerType_PS5Controller, NULL }, // Sony DualSense Edge Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0163 ), k_eControllerType_PS5Controller, NULL }, // HORI Fighting Commander OCTA - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0184 ), k_eControllerType_PS5Controller, NULL }, // Hori Fighting Stick α - - { MAKE_CONTROLLER_ID( 0x0079, 0x0006 ), k_eControllerType_UnknownNonSteamController, NULL }, // DragonRise Generic USB PCB, sometimes configured as a PC Twin Shock Controller - looks like a DS3 but the face buttons are 1-4 instead of symbols - - { MAKE_CONTROLLER_ID( 0x0079, 0x18d4 ), k_eControllerType_XBox360Controller, NULL }, // GPD Win 2 X-Box Controller - { MAKE_CONTROLLER_ID( 0x03eb, 0xff02 ), k_eControllerType_XBox360Controller, NULL }, // Wooting Two - { MAKE_CONTROLLER_ID( 0x044f, 0xb326 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster Gamepad GP XID - { MAKE_CONTROLLER_ID( 0x045e, 0x028e ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad - { MAKE_CONTROLLER_ID( 0x045e, 0x028f ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad v2 - { MAKE_CONTROLLER_ID( 0x045e, 0x0291 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (XBOX) - { MAKE_CONTROLLER_ID( 0x045e, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft X-Box 360 Big Button IR - { MAKE_CONTROLLER_ID( 0x045e, 0x02a1 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft X-Box 360 Wireless Controller with XUSB driver on Windows - { MAKE_CONTROLLER_ID( 0x045e, 0x02a9 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (third party knockoff) - { MAKE_CONTROLLER_ID( 0x045e, 0x0719 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver - { MAKE_CONTROLLER_ID( 0x046d, 0xc21d ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F310 - { MAKE_CONTROLLER_ID( 0x046d, 0xc21e ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F510 - { MAKE_CONTROLLER_ID( 0x046d, 0xc21f ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F710 - { MAKE_CONTROLLER_ID( 0x046d, 0xc242 ), k_eControllerType_XBox360Controller, NULL }, // Logitech Chillstream Controller - { MAKE_CONTROLLER_ID( 0x056e, 0x2004 ), k_eControllerType_XBox360Controller, NULL }, // Elecom JC-U3613M - { MAKE_CONTROLLER_ID( 0x06a3, 0xf51a ), k_eControllerType_XBox360Controller, NULL }, // Saitek P3600 - { MAKE_CONTROLLER_ID( 0x0738, 0x4716 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller - { MAKE_CONTROLLER_ID( 0x0738, 0x4718 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV FightStick SE - { MAKE_CONTROLLER_ID( 0x0738, 0x4726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller - { MAKE_CONTROLLER_ID( 0x0738, 0x4728 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV FightPad - { MAKE_CONTROLLER_ID( 0x0738, 0x4736 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MicroCon Gamepad - { MAKE_CONTROLLER_ID( 0x0738, 0x4738 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller (SFIV) - { MAKE_CONTROLLER_ID( 0x0738, 0x4740 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Beat Pad - { MAKE_CONTROLLER_ID( 0x0738, 0xb726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox controller - MW2 - { MAKE_CONTROLLER_ID( 0x0738, 0xbeef ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz JOYTECH NEO SE Advanced GamePad - { MAKE_CONTROLLER_ID( 0x0738, 0xcb02 ), k_eControllerType_XBox360Controller, NULL }, // Saitek Cyborg Rumble Pad - PC/Xbox 360 - { MAKE_CONTROLLER_ID( 0x0738, 0xcb03 ), k_eControllerType_XBox360Controller, NULL }, // Saitek P3200 Rumble Pad - PC/Xbox 360 - { MAKE_CONTROLLER_ID( 0x0738, 0xf738 ), k_eControllerType_XBox360Controller, NULL }, // Super SFIV FightStick TE S - { MAKE_CONTROLLER_ID( 0x0955, 0x7210 ), k_eControllerType_XBox360Controller, NULL }, // Nvidia Shield local controller - { MAKE_CONTROLLER_ID( 0x0955, 0xb400 ), k_eControllerType_XBox360Controller, NULL }, // NVIDIA Shield streaming controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0105 ), k_eControllerType_XBox360Controller, NULL }, // HSM3 Xbox360 dancepad - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0113 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x011f ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Rock Candy" }, // PDP Rock Candy Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0125 ), k_eControllerType_XBox360Controller, "PDP INJUSTICE FightStick" }, // PDP INJUSTICE FightStick for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0127 ), k_eControllerType_XBox360Controller, "PDP INJUSTICE FightPad" }, // PDP INJUSTICE FightPad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0131 ), k_eControllerType_XBox360Controller, "PDP EA Soccer Controller" }, // PDP EA Soccer Gamepad - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0133 ), k_eControllerType_XBox360Controller, "PDP Battlefield 4 Controller" }, // PDP Battlefield 4 Gamepad - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0143 ), k_eControllerType_XBox360Controller, "PDP MK X Fight Stick" }, // PDP MK X Fight Stick for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0147 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Marvel Controller" }, // PDP Marvel Controller for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0201 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0213 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x021f ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Rock Candy" }, // PDP Rock Candy Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0301 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0313 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0314 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0401 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Controller" }, // PDP Gamepad for Xbox 360 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0413 ), k_eControllerType_XBox360Controller, NULL }, // PDP Afterglow AX.1 (unlisted) - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0501 ), k_eControllerType_XBox360Controller, NULL }, // PDP Xbox 360 Controller (unlisted) - { MAKE_CONTROLLER_ID( 0x0e6f, 0xf900 ), k_eControllerType_XBox360Controller, NULL }, // PDP Afterglow AX.1 (unlisted) - { MAKE_CONTROLLER_ID( 0x0f0d, 0x000a ), k_eControllerType_XBox360Controller, NULL }, // Hori Co. DOA4 FightStick - { MAKE_CONTROLLER_ID( 0x0f0d, 0x000c ), k_eControllerType_XBox360Controller, NULL }, // Hori PadEX Turbo - { MAKE_CONTROLLER_ID( 0x0f0d, 0x000d ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick EX2 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0016 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.EX - { MAKE_CONTROLLER_ID( 0x0f0d, 0x001b ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro VX - { MAKE_CONTROLLER_ID( 0x0f0d, 0x008c ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro 4 - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00db ), k_eControllerType_XBox360Controller, "HORI Slime Controller" }, // Hori Dragon Quest Slime Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x011e ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick α - { MAKE_CONTROLLER_ID( 0x1038, 0x1430 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" }, // SteelSeries Stratus Duo - { MAKE_CONTROLLER_ID( 0x1038, 0x1431 ), k_eControllerType_XBox360Controller, "SteelSeries Stratus Duo" }, // SteelSeries Stratus Duo - { MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_XBox360Controller, NULL }, // SteelSeries Nimbus/Stratus XL - { MAKE_CONTROLLER_ID( 0x11c9, 0x55f0 ), k_eControllerType_XBox360Controller, NULL }, // Nacon GC-100XF - { MAKE_CONTROLLER_ID( 0x12ab, 0x0004 ), k_eControllerType_XBox360Controller, NULL }, // Honey Bee Xbox360 dancepad - { MAKE_CONTROLLER_ID( 0x12ab, 0x0301 ), k_eControllerType_XBox360Controller, NULL }, // PDP AFTERGLOW AX.1 - { MAKE_CONTROLLER_ID( 0x12ab, 0x0303 ), k_eControllerType_XBox360Controller, NULL }, // Mortal Kombat Klassic FightStick - { MAKE_CONTROLLER_ID( 0x1430, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller Adapter - { MAKE_CONTROLLER_ID( 0x1430, 0x4748 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Guitar Hero X-plorer - { MAKE_CONTROLLER_ID( 0x1430, 0xf801 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x0601 ), k_eControllerType_XBox360Controller, NULL }, // BigBen Interactive XBOX 360 Controller -// { MAKE_CONTROLLER_ID( 0x1532, 0x0037 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth - { MAKE_CONTROLLER_ID( 0x15e4, 0x3f00 ), k_eControllerType_XBox360Controller, NULL }, // Power A Mini Pro Elite - { MAKE_CONTROLLER_ID( 0x15e4, 0x3f0a ), k_eControllerType_XBox360Controller, NULL }, // Xbox Airflo wired controller - { MAKE_CONTROLLER_ID( 0x15e4, 0x3f10 ), k_eControllerType_XBox360Controller, NULL }, // Batarang Xbox 360 controller - { MAKE_CONTROLLER_ID( 0x162e, 0xbeef ), k_eControllerType_XBox360Controller, NULL }, // Joytech Neo-Se Take2 - { MAKE_CONTROLLER_ID( 0x1689, 0xfd00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza Tournament Edition - { MAKE_CONTROLLER_ID( 0x1689, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza Classic Edition - { MAKE_CONTROLLER_ID( 0x1689, 0xfe00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth - { MAKE_CONTROLLER_ID( 0x1949, 0x041a ), k_eControllerType_XBox360Controller, "Amazon Luna Controller" }, // Amazon Luna Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0x0002 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Guitar - { MAKE_CONTROLLER_ID( 0x1bad, 0x0003 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Drumkit - { MAKE_CONTROLLER_ID( 0x1bad, 0xf016 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0xf018 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV SE Fighting Stick - { MAKE_CONTROLLER_ID( 0x1bad, 0xf019 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Brawlstick for Xbox 360 - { MAKE_CONTROLLER_ID( 0x1bad, 0xf021 ), k_eControllerType_XBox360Controller, NULL }, // Mad Cats Ghost Recon FS GamePad - { MAKE_CONTROLLER_ID( 0x1bad, 0xf023 ), k_eControllerType_XBox360Controller, NULL }, // MLG Pro Circuit Controller (Xbox) - { MAKE_CONTROLLER_ID( 0x1bad, 0xf025 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Call Of Duty - { MAKE_CONTROLLER_ID( 0x1bad, 0xf027 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FPS Pro - { MAKE_CONTROLLER_ID( 0x1bad, 0xf028 ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV FightPad - { MAKE_CONTROLLER_ID( 0x1bad, 0xf02e ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Fightpad - { MAKE_CONTROLLER_ID( 0x1bad, 0xf036 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MicroCon GamePad Pro - { MAKE_CONTROLLER_ID( 0x1bad, 0xf038 ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV FightStick TE - { MAKE_CONTROLLER_ID( 0x1bad, 0xf039 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MvC2 TE - { MAKE_CONTROLLER_ID( 0x1bad, 0xf03a ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz SFxT Fightstick Pro - { MAKE_CONTROLLER_ID( 0x1bad, 0xf03d ), k_eControllerType_XBox360Controller, NULL }, // Street Fighter IV Arcade Stick TE - Chun Li - { MAKE_CONTROLLER_ID( 0x1bad, 0xf03e ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MLG FightStick TE - { MAKE_CONTROLLER_ID( 0x1bad, 0xf03f ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick SoulCaliber - { MAKE_CONTROLLER_ID( 0x1bad, 0xf042 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick TES+ - { MAKE_CONTROLLER_ID( 0x1bad, 0xf080 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz FightStick TE2 - { MAKE_CONTROLLER_ID( 0x1bad, 0xf501 ), k_eControllerType_XBox360Controller, NULL }, // HoriPad EX2 Turbo - { MAKE_CONTROLLER_ID( 0x1bad, 0xf502 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.VX SA - { MAKE_CONTROLLER_ID( 0x1bad, 0xf503 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick VX - { MAKE_CONTROLLER_ID( 0x1bad, 0xf504 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro. EX - { MAKE_CONTROLLER_ID( 0x1bad, 0xf505 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick EX2B - { MAKE_CONTROLLER_ID( 0x1bad, 0xf506 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro.EX Premium VLX - { MAKE_CONTROLLER_ID( 0x1bad, 0xf900 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Xbox 360 Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0xf901 ), k_eControllerType_XBox360Controller, NULL }, // Gamestop Xbox 360 Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0xf902 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Gamepad2 - { MAKE_CONTROLLER_ID( 0x1bad, 0xf903 ), k_eControllerType_XBox360Controller, NULL }, // Tron Xbox 360 controller - { MAKE_CONTROLLER_ID( 0x1bad, 0xf904 ), k_eControllerType_XBox360Controller, NULL }, // PDP Versus Fighting Pad - { MAKE_CONTROLLER_ID( 0x1bad, 0xf906 ), k_eControllerType_XBox360Controller, NULL }, // MortalKombat FightStick - { MAKE_CONTROLLER_ID( 0x1bad, 0xfa01 ), k_eControllerType_XBox360Controller, NULL }, // MadCatz GamePad - { MAKE_CONTROLLER_ID( 0x1bad, 0xfd00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza TE - { MAKE_CONTROLLER_ID( 0x1bad, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza - { MAKE_CONTROLLER_ID( 0x24c6, 0x5000 ), k_eControllerType_XBox360Controller, NULL }, // Razer Atrox Arcade Stick - { MAKE_CONTROLLER_ID( 0x24c6, 0x5300 ), k_eControllerType_XBox360Controller, NULL }, // PowerA MINI PROEX Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x5303 ), k_eControllerType_XBox360Controller, NULL }, // Xbox Airflo wired controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x530a ), k_eControllerType_XBox360Controller, NULL }, // Xbox 360 Pro EX Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x531a ), k_eControllerType_XBox360Controller, NULL }, // PowerA Pro Ex - { MAKE_CONTROLLER_ID( 0x24c6, 0x5397 ), k_eControllerType_XBox360Controller, NULL }, // FUS1ON Tournament Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x5500 ), k_eControllerType_XBox360Controller, NULL }, // Hori XBOX 360 EX 2 with Turbo - { MAKE_CONTROLLER_ID( 0x24c6, 0x5501 ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro VX-SA - { MAKE_CONTROLLER_ID( 0x24c6, 0x5502 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Stick VX Alt - { MAKE_CONTROLLER_ID( 0x24c6, 0x5503 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Edge - { MAKE_CONTROLLER_ID( 0x24c6, 0x5506 ), k_eControllerType_XBox360Controller, NULL }, // Hori SOULCALIBUR V Stick - { MAKE_CONTROLLER_ID( 0x24c6, 0x550d ), k_eControllerType_XBox360Controller, NULL }, // Hori GEM Xbox controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x550e ), k_eControllerType_XBox360Controller, NULL }, // Hori Real Arcade Pro V Kai 360 - { MAKE_CONTROLLER_ID( 0x24c6, 0x5508 ), k_eControllerType_XBox360Controller, NULL }, // Hori PAD A - { MAKE_CONTROLLER_ID( 0x24c6, 0x5510 ), k_eControllerType_XBox360Controller, NULL }, // Hori Fighting Commander ONE - { MAKE_CONTROLLER_ID( 0x24c6, 0x5b00 ), k_eControllerType_XBox360Controller, NULL }, // ThrustMaster Ferrari Italia 458 Racing Wheel - { MAKE_CONTROLLER_ID( 0x24c6, 0x5b02 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster, Inc. GPX Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x5b03 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster Ferrari 458 Racing Wheel - { MAKE_CONTROLLER_ID( 0x24c6, 0x5d04 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth - { MAKE_CONTROLLER_ID( 0x24c6, 0xfafa ), k_eControllerType_XBox360Controller, NULL }, // Aplay Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0xfafb ), k_eControllerType_XBox360Controller, NULL }, // Aplay Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0xfafc ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 1 - { MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3 - { MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360 - - { MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad - { MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015) - { MAKE_CONTROLLER_ID( 0x045e, 0x02e0 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth) - { MAKE_CONTROLLER_ID( 0x045e, 0x02e3 ), k_eControllerType_XBoxOneController, "Xbox One Elite Controller" }, // Microsoft X-Box One Elite pad - { MAKE_CONTROLLER_ID( 0x045e, 0x02ea ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad - { MAKE_CONTROLLER_ID( 0x045e, 0x02fd ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth) - { MAKE_CONTROLLER_ID( 0x045e, 0x02ff ), k_eControllerType_XBoxOneController, NULL }, // Microsoft X-Box One controller with XBOXGIP driver on Windows - { MAKE_CONTROLLER_ID( 0x045e, 0x0b00 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad -// { MAKE_CONTROLLER_ID( 0x045e, 0x0b02 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // The virtual keyboard generated by XboxGip drivers for Xbox One Controllers (see https://github.com/libsdl-org/SDL/pull/5121 for details) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b05 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (Bluetooth) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b0a ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad - { MAKE_CONTROLLER_ID( 0x045e, 0x0b0c ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (Bluetooth) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b12 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad - { MAKE_CONTROLLER_ID( 0x045e, 0x0b13 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad (BLE) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b20 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (BLE) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b21 ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (BLE) - { MAKE_CONTROLLER_ID( 0x045e, 0x0b22 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (BLE) - { MAKE_CONTROLLER_ID( 0x0738, 0x4a01 ), k_eControllerType_XBoxOneController, NULL }, // Mad Catz FightStick TE 2 - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0139 ), k_eControllerType_XBoxOneController, "PDP Xbox One Afterglow" }, // PDP Afterglow Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x013B ), k_eControllerType_XBoxOneController, "PDP Xbox One Face-Off Controller" }, // PDP Face-Off Gamepad for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x013a ), k_eControllerType_XBoxOneController, NULL }, // PDP Xbox One Controller (unlisted) - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0145 ), k_eControllerType_XBoxOneController, "PDP MK X Fight Pad" }, // PDP MK X Fight Pad for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0146 ), k_eControllerType_XBoxOneController, "PDP Xbox One Rock Candy" }, // PDP Rock Candy Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x015b ), k_eControllerType_XBoxOneController, "PDP Fallout 4 Vault Boy Controller" }, // PDP Fallout 4 Vault Boy Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x015c ), k_eControllerType_XBoxOneController, "PDP Xbox One @Play Controller" }, // PDP @Play Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x015d ), k_eControllerType_XBoxOneController, "PDP Mirror's Edge Controller" }, // PDP Mirror's Edge Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x015f ), k_eControllerType_XBoxOneController, "PDP Metallic Controller" }, // PDP Metallic Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0160 ), k_eControllerType_XBoxOneController, "PDP NFL Face-Off Controller" }, // PDP NFL Official Face-Off Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0161 ), k_eControllerType_XBoxOneController, "PDP Xbox One Camo" }, // PDP Camo Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0162 ), k_eControllerType_XBoxOneController, "PDP Xbox One Controller" }, // PDP Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0163 ), k_eControllerType_XBoxOneController, "PDP Deliverer of Truth" }, // PDP Legendary Collection: Deliverer of Truth - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0164 ), k_eControllerType_XBoxOneController, "PDP Battlefield 1 Controller" }, // PDP Battlefield 1 Official Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0165 ), k_eControllerType_XBoxOneController, "PDP Titanfall 2 Controller" }, // PDP Titanfall 2 Official Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0166 ), k_eControllerType_XBoxOneController, "PDP Mass Effect: Andromeda Controller" }, // PDP Mass Effect: Andromeda Official Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0167 ), k_eControllerType_XBoxOneController, "PDP Halo Wars 2 Face-Off Controller" }, // PDP Halo Wars 2 Official Face-Off Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0205 ), k_eControllerType_XBoxOneController, "PDP Victrix Pro Fight Stick" }, // PDP Victrix Pro Fight Stick - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0206 ), k_eControllerType_XBoxOneController, "PDP Mortal Kombat Controller" }, // PDP Mortal Kombat 25 Anniversary Edition Stick (Xbox One) - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0246 ), k_eControllerType_XBoxOneController, "PDP Xbox One Rock Candy" }, // PDP Rock Candy Wired Controller for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0261 ), k_eControllerType_XBoxOneController, "PDP Xbox One Camo" }, // PDP Camo Wired Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0262 ), k_eControllerType_XBoxOneController, "PDP Xbox One Controller" }, // PDP Wired Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Wired Controller for Xbox One - Midnight Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Wired Controller for Xbox One - Verdant Green - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a2 ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Wired Controller for Xbox One - Crimson Red - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a4 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Wired Controller for Xbox One - Stealth Series | Phantom Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Wired Controller for Xbox One - Stealth Series | Ghost White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a6 ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Wired Controller for Xbox One - Stealth Series | Revenant Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a7 ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Wired Controller for Xbox One - Raven Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a8 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02a9 ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Wired Controller for Xbox One - Midnight Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02aa ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Wired Controller for Xbox One - Verdant Green - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ab ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Wired Controller for Xbox One - Crimson Red - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ac ), k_eControllerType_XBoxOneController, "PDP Xbox One Ember Orange" }, // PDP Wired Controller for Xbox One - Ember Orange - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ad ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Wired Controller for Xbox One - Stealth Series | Phantom Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ae ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Wired Controller for Xbox One - Stealth Series | Ghost White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02af ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Wired Controller for Xbox One - Stealth Series | Revenant Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Wired Controller for Xbox One - Raven Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Wired Controller for Xbox One - Arctic White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Afterglow" }, // PDP Afterglow Prismatic Wired Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b5 ), k_eControllerType_XBoxOneController, "PDP Xbox One GAMEware Controller" }, // PDP GAMEware Wired Controller Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02b6 ), k_eControllerType_XBoxOneController, NULL }, // PDP One-Handed Joystick Adaptive Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02bd ), k_eControllerType_XBoxOneController, "PDP Xbox One Royal Purple" }, // PDP Wired Controller for Xbox One - Royal Purple - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02be ), k_eControllerType_XBoxOneController, "PDP Xbox One Raven Black" }, // PDP Deluxe Wired Controller for Xbox One - Raven Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02bf ), k_eControllerType_XBoxOneController, "PDP Xbox One Midnight Blue" }, // PDP Deluxe Wired Controller for Xbox One - Midnight Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c0 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantom Black" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Phantom Black - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c1 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ghost White" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Ghost White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c2 ), k_eControllerType_XBoxOneController, "PDP Xbox One Revenant Blue" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Revenant Blue - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c3 ), k_eControllerType_XBoxOneController, "PDP Xbox One Verdant Green" }, // PDP Deluxe Wired Controller for Xbox One - Verdant Green - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c4 ), k_eControllerType_XBoxOneController, "PDP Xbox One Ember Orange" }, // PDP Deluxe Wired Controller for Xbox One - Ember Orange - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Royal Purple" }, // PDP Deluxe Wired Controller for Xbox One - Royal Purple - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c6 ), k_eControllerType_XBoxOneController, "PDP Xbox One Crimson Red" }, // PDP Deluxe Wired Controller for Xbox One - Crimson Red - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c7 ), k_eControllerType_XBoxOneController, "PDP Xbox One Arctic White" }, // PDP Deluxe Wired Controller for Xbox One - Arctic White - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c8 ), k_eControllerType_XBoxOneController, "PDP Kingdom Hearts Controller" }, // PDP Kingdom Hearts Wired Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02c9 ), k_eControllerType_XBoxOneController, "PDP Xbox One Phantasm Red" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Phantasm Red - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ca ), k_eControllerType_XBoxOneController, "PDP Xbox One Specter Violet" }, // PDP Deluxe Wired Controller for Xbox One - Stealth Series | Specter Violet - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cb ), k_eControllerType_XBoxOneController, "PDP Xbox One Specter Violet" }, // PDP Wired Controller for Xbox One - Stealth Series | Specter Violet - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cd ), k_eControllerType_XBoxOneController, "PDP Xbox One Blu-merang" }, // PDP Rock Candy Wired Controller for Xbox One - Blu-merang - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02ce ), k_eControllerType_XBoxOneController, "PDP Xbox One Cranblast" }, // PDP Rock Candy Wired Controller for Xbox One - Cranblast - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02cf ), k_eControllerType_XBoxOneController, "PDP Xbox One Aqualime" }, // PDP Rock Candy Wired Controller for Xbox One - Aqualime - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d5 ), k_eControllerType_XBoxOneController, "PDP Xbox One Red Camo" }, // PDP Wired Controller for Xbox One - Red Camo - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0346 ), k_eControllerType_XBoxOneController, "PDP Xbox One RC Gamepad" }, // PDP RC Gamepad for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0446 ), k_eControllerType_XBoxOneController, "PDP Xbox One RC Gamepad" }, // PDP RC Gamepad for Xbox One - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02da ), k_eControllerType_XBoxOneController, "PDP Xbox Series X Afterglow" }, // PDP Xbox Series X Afterglow - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d6 ), k_eControllerType_XBoxOneController, "Victrix Gambit Tournament Controller" }, // Victrix Gambit Tournament Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x02d9 ), k_eControllerType_XBoxOneController, "PDP Xbox Series X Midnight Blue" }, // PDP Xbox Series X Midnight Blue - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0063 ), k_eControllerType_XBoxOneController, NULL }, // Hori Real Arcade Pro Hayabusa (USA) Xbox One - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0067 ), k_eControllerType_XBoxOneController, NULL }, // HORIPAD ONE - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0078 ), k_eControllerType_XBoxOneController, NULL }, // Hori Real Arcade Pro V Kai Xbox One - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c5 ), k_eControllerType_XBoxOneController, NULL }, // HORI Fighting Commander - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0150 ), k_eControllerType_XBoxOneController, NULL }, // HORI Fighting Commander OCTA for Xbox Series X - { MAKE_CONTROLLER_ID( 0x1532, 0x0a00 ), k_eControllerType_XBoxOneController, NULL }, // Razer Atrox Arcade Stick - { MAKE_CONTROLLER_ID( 0x1532, 0x0a03 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wildcat - { MAKE_CONTROLLER_ID( 0x1532, 0x0a14 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wolverine Ultimate - { MAKE_CONTROLLER_ID( 0x1532, 0x0a15 ), k_eControllerType_XBoxOneController, NULL }, // Razer Wolverine Tournament Edition - { MAKE_CONTROLLER_ID( 0x20d6, 0x2001 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Black Inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x2002 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Gray/White Inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x2003 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Green Inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x2004 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Pink inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x2005 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Wired Controller Core - Black - { MAKE_CONTROLLER_ID( 0x20d6, 0x2006 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Wired Controller Core - White - { MAKE_CONTROLLER_ID( 0x20d6, 0x2009 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Red inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x200a ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Blue inline - { MAKE_CONTROLLER_ID( 0x20d6, 0x200b ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Camo Metallic Red - { MAKE_CONTROLLER_ID( 0x20d6, 0x200c ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Camo Metallic Blue - { MAKE_CONTROLLER_ID( 0x20d6, 0x200d ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Seafoam Fade - { MAKE_CONTROLLER_ID( 0x20d6, 0x200e ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Midnight Blue - { MAKE_CONTROLLER_ID( 0x20d6, 0x200f ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Soldier Green - { MAKE_CONTROLLER_ID( 0x20d6, 0x2011 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired - Metallic Ice - { MAKE_CONTROLLER_ID( 0x20d6, 0x2012 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Cuphead EnWired Controller - Mugman - { MAKE_CONTROLLER_ID( 0x20d6, 0x2015 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Blue Hint - { MAKE_CONTROLLER_ID( 0x20d6, 0x2016 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Green Hint - { MAKE_CONTROLLER_ID( 0x20d6, 0x2017 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Cntroller - Arctic Camo - { MAKE_CONTROLLER_ID( 0x20d6, 0x2018 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Arc Lightning - { MAKE_CONTROLLER_ID( 0x20d6, 0x2019 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Royal Purple - { MAKE_CONTROLLER_ID( 0x20d6, 0x201a ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Nebula - { MAKE_CONTROLLER_ID( 0x20d6, 0x4001 ), k_eControllerType_XBoxOneController, "PowerA Fusion Pro 2 Controller" }, // PowerA Fusion Pro 2 Wired Controller (Xbox Series X style) - { MAKE_CONTROLLER_ID( 0x20d6, 0x4002 ), k_eControllerType_XBoxOneController, "PowerA Spectra Infinity Controller" }, // PowerA Spectra Infinity Wired Controller (Xbox Series X style) - { MAKE_CONTROLLER_ID( 0x24c6, 0x541a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Xbox One Mini Wired Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x542a ), k_eControllerType_XBoxOneController, NULL }, // Xbox ONE spectra - { MAKE_CONTROLLER_ID( 0x24c6, 0x543a ), k_eControllerType_XBoxOneController, "PowerA Xbox One Controller" }, // PowerA Xbox ONE liquid metal controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x551a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Pro Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x561a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x581a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Classic Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x591a ), k_eControllerType_XBoxOneController, NULL }, // PowerA FUSION Pro Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x592a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Spectra Pro - { MAKE_CONTROLLER_ID( 0x24c6, 0x791a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Fusion Fight Pad - { MAKE_CONTROLLER_ID( 0x2dc8, 0x2002 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller for Xbox - { MAKE_CONTROLLER_ID( 0x2e24, 0x0652 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke - { MAKE_CONTROLLER_ID( 0x2e24, 0x1618 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke - { MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin X91 - { MAKE_CONTROLLER_ID( 0x146b, 0x0611 ), k_eControllerType_XBoxOneController, NULL }, // Xbox Controller Mode for NACON Revolution 3 - - // These have been added via Minidump for unrecognized Xinput controller assert - { MAKE_CONTROLLER_ID( 0x0000, 0x0000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x045e, 0x02a2 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - Microsoft VID - { MAKE_CONTROLLER_ID( 0x0e6f, 0x1414 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0159 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0xfaff ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x006d ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00a4 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x1832 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x187f ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x1883 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x03eb, 0xff01 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0c12, 0x0ef8 ), k_eControllerType_XBox360Controller, NULL }, // Homemade fightstick based on brook pcb (with XInput driver??) - { MAKE_CONTROLLER_ID( 0x046d, 0x1000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1345, 0x6006 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - - { MAKE_CONTROLLER_ID( 0x056e, 0x2012 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x0602 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00ae ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x046d, 0x0401 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput - { MAKE_CONTROLLER_ID( 0x046d, 0x0301 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput - { MAKE_CONTROLLER_ID( 0x046d, 0xcaa3 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput - { MAKE_CONTROLLER_ID( 0x046d, 0xc261 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput - { MAKE_CONTROLLER_ID( 0x046d, 0x0291 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput - { MAKE_CONTROLLER_ID( 0x0079, 0x18d3 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00b1 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0001, 0x0001 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x188e ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x187c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x189c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x0079, 0x1874 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - - { MAKE_CONTROLLER_ID( 0x2f24, 0x0050 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0x2e ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x9886, 0x24 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0x91 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1430, 0x719 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xf0d, 0xed ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xf0d, 0xc0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x152 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2a7 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x46d, 0x1007 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2b8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2a8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x79, 0x18a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - - /* Added from Minidumps 10-9-19 */ - { MAKE_CONTROLLER_ID( 0x0, 0x6686 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x11ff, 0x511 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x12ab, 0x304 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1430, 0x291 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1430, 0x2a9 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1430, 0x70b ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x604 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x605 ), k_eControllerType_XBoxOneController, NULL }, // NACON PS4 controller in Xbox mode - might also be other bigben brand xbox controllers - { MAKE_CONTROLLER_ID( 0x146b, 0x606 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x146b, 0x609 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0x28e ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0x2a0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x1bad, 0x5500 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x20ab, 0x55ef ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x24c6, 0x5509 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2516, 0x69 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x25b1, 0x360 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2c22, 0x2203 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0x11 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0x53 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0xb7 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x46d, 0x0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x46d, 0x1004 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x46d, 0x1008 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x46d, 0xf301 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x738, 0x2a0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x738, 0x7263 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x738, 0xb738 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x738, 0xcb29 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x738, 0xf401 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x79, 0x18c2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x79, 0x18c8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x79, 0x18cf ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xc12, 0xe17 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xc12, 0xe1c ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xc12, 0xe22 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xc12, 0xe30 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xd2d2, 0xd2d2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xd62, 0x9a1a ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xd62, 0x9a1b ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe00, 0xe00 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x12a ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2a2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2a5 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2b2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2bd ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2bf ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2c0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0x2c6 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xf0d, 0x97 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xf0d, 0xba ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xf0d, 0xd8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xfff, 0x2a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x45e, 0x867 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - // Added 12-17-2020 - { MAKE_CONTROLLER_ID( 0x16d0, 0xf3f ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0x2f24, 0x8f ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - { MAKE_CONTROLLER_ID( 0xe6f, 0xf501 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller - - //{ MAKE_CONTROLLER_ID( 0x1949, 0x0402 ), /*android*/, NULL }, // Unknown Controller - - { MAKE_CONTROLLER_ID( 0x05ac, 0x0001 ), k_eControllerType_AppleController, NULL }, // MFI Extended Gamepad (generic entry for iOS/tvOS) - { MAKE_CONTROLLER_ID( 0x05ac, 0x0002 ), k_eControllerType_AppleController, NULL }, // MFI Standard Gamepad (generic entry for iOS/tvOS) - - { MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft, NULL }, // Nintendo Switch Joy-Con (Left) - { MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight, NULL }, // Nintendo Switch Joy-Con (Right) - { MAKE_CONTROLLER_ID( 0x057e, 0x2008 ), k_eControllerType_SwitchJoyConPair, NULL }, // Nintendo Switch Joy-Con (Left+Right Combined) - - // This same controller ID is spoofed by many 3rd-party Switch controllers. - // The ones we currently know of are: - // * Any 8bitdo controller with Switch support - // * ORTZ Gaming Wireless Pro Controller - // * ZhiXu Gamepad Wireless - // * Sunwaytek Wireless Motion Controller for Nintendo Switch - { MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Switch Pro Controller - //{ MAKE_CONTROLLER_ID( 0x057e, 0x2017 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SNES Controller - //{ MAKE_CONTROLLER_ID( 0x057e, 0x2019 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online N64 Controller - //{ MAKE_CONTROLLER_ID( 0x057e, 0x201e ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SEGA Genesis Controller - - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c1 ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORIPAD for Nintendo Switch - { MAKE_CONTROLLER_ID( 0x0f0d, 0x0092 ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Pokken Tournament DX Pro Pad - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00f6 ), k_eControllerType_SwitchProController, NULL }, // HORI Wireless Switch Pad - // The HORIPAD S, which comes in multiple styles: - // - NSW-108, classic GameCube controller - // - NSW-244, Fighting Commander arcade pad - // - NSW-278, Hori Pad Mini gamepad - // - NSW-326, HORIPAD FPS for Nintendo Switch - // - // The first two, at least, shouldn't have their buttons remapped, and since we - // can't tell which model we're actually using, we won't do any button remapping - // for any of them. - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00dc ), k_eControllerType_XInputSwitchController, NULL }, // HORIPAD S - Looks like a Switch controller but uses the Xbox 360 controller protocol - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0180 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Pro Controller for Nintendo Switch - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0181 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Deluxe Wired Pro Controller for Nintendo Switch - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0184 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Deluxe+ Audio Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0185 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Wired Fight Pad Pro for Nintendo Switch - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0186 ), k_eControllerType_SwitchProController, NULL }, // PDP Afterglow Wireless Switch Controller - working gyro. USB is for charging only. Many later "Wireless" line devices w/ gyro also use this vid/pid - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0187 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Rockcandy Wired Controller - { MAKE_CONTROLLER_ID( 0x0e6f, 0x0188 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Afterglow Wired Deluxe+ Audio Controller - { MAKE_CONTROLLER_ID( 0x0f0d, 0x00aa ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Real Arcade Pro V Hayabusa in Switch Mode - { MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Wired Controller Plus/PowerA Wired Controller Nintendo GameCube Style - { MAKE_CONTROLLER_ID( 0x20d6, 0xa712 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Fight Pad - { MAKE_CONTROLLER_ID( 0x20d6, 0xa713 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Super Mario Controller - { MAKE_CONTROLLER_ID( 0x20d6, 0xa714 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Spectra Controller - { MAKE_CONTROLLER_ID( 0x20d6, 0xa715 ), k_eControllerType_SwitchInputOnlyController, NULL }, // Power A Fusion Wireless Arcade Stick (USB Mode) Over BT is shows up as 057e 2009 - { MAKE_CONTROLLER_ID( 0x20d6, 0xa716 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Pro Controller - USB requires toggling switch on back of device - - // Valve products - { MAKE_CONTROLLER_ID( 0x0000, 0x11fb ), k_eControllerType_MobileTouch, NULL }, // Streaming mobile touch virtual controls - { MAKE_CONTROLLER_ID( 0x28de, 0x1101 ), k_eControllerType_SteamController, NULL }, // Valve Legacy Steam Controller (CHELL) - { MAKE_CONTROLLER_ID( 0x28de, 0x1102 ), k_eControllerType_SteamController, NULL }, // Valve wired Steam Controller (D0G) - { MAKE_CONTROLLER_ID( 0x28de, 0x1105 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G) - { MAKE_CONTROLLER_ID( 0x28de, 0x1106 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G) - { MAKE_CONTROLLER_ID( 0x28de, 0x1142 ), k_eControllerType_SteamController, NULL }, // Valve wireless Steam Controller - { MAKE_CONTROLLER_ID( 0x28de, 0x1201 ), k_eControllerType_SteamControllerV2, NULL }, // Valve wired Steam Controller (HEADCRAB) - { MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2, NULL }, // Valve Bluetooth Steam Controller (HEADCRAB) -}; - static const char *GetControllerTypeOverride( int nVID, int nPID ) { const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERTYPE); diff --git a/src/joystick/controller_type.h b/src/joystick/controller_type.h index 9ec6c57ee1500..ead45f109663c 100644 --- a/src/joystick/controller_type.h +++ b/src/joystick/controller_type.h @@ -37,6 +37,7 @@ typedef enum k_eControllerType_UnknownSteamController = 1, k_eControllerType_SteamController = 2, k_eControllerType_SteamControllerV2 = 3, + k_eControllerType_SteamDeck = 4, // Other Controllers k_eControllerType_UnknownNonSteamController = 30, diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c index de43c97f35cfc..8bb8d0097c643 100644 --- a/src/joystick/darwin/SDL_iokitjoystick.c +++ b/src/joystick/darwin/SDL_iokitjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,12 +28,11 @@ #include "../SDL_joystick_c.h" #include "SDL_iokitjoystick_c.h" #include "../hidapi/SDL_hidapijoystick_c.h" -#include "../../haptic/darwin/SDL_syshaptic_c.h" /* For haptic hot plugging */ - +#include "../../haptic/darwin/SDL_syshaptic_c.h" /* For haptic hot plugging */ #define SDL_JOYSTICK_RUNLOOP_MODE CFSTR("SDLJoystick") -#define CONVERT_MAGNITUDE(x) (((x)*10000) / 0x7FFF) +#define CONVERT_MAGNITUDE(x) (((x)*10000) / 0x7FFF) /* The base object of the HID Manager API */ static IOHIDManagerRef hidman = NULL; @@ -101,8 +100,9 @@ static recDevice *GetDeviceForIndex(int device_index) recDevice *device = gpDeviceList; while (device) { if (!device->removed) { - if (device_index == 0) + if (device_index == 0) { break; + } --device_index; } @@ -111,8 +111,7 @@ static recDevice *GetDeviceForIndex(int device_index) return device; } -static void -FreeElementList(recElement *pElement) +static void FreeElementList(recElement *pElement) { while (pElement) { recElement *pElementNext = pElement->pNext; @@ -121,8 +120,7 @@ FreeElementList(recElement *pElement) } } -static recDevice * -FreeDevice(recDevice *removeDevice) +static recDevice *FreeDevice(recDevice *removeDevice) { recDevice *pDeviceNext = NULL; if (removeDevice) { @@ -176,8 +174,7 @@ FreeDevice(recDevice *removeDevice) return pDeviceNext; } -static SDL_bool -GetHIDElementState(recDevice *pDevice, recElement *pElement, SInt32 *pValue) +static SDL_bool GetHIDElementState(recDevice *pDevice, recElement *pElement, SInt32 *pValue) { SInt32 value = 0; int returnValue = SDL_FALSE; @@ -185,7 +182,7 @@ GetHIDElementState(recDevice *pDevice, recElement *pElement, SInt32 *pValue) if (pDevice && pDevice->deviceRef && pElement) { IOHIDValueRef valueRef; if (IOHIDDeviceGetValue(pDevice->deviceRef, pElement->elementRef, &valueRef) == kIOReturnSuccess) { - value = (SInt32) IOHIDValueGetIntegerValue(valueRef); + value = (SInt32)IOHIDValueGetIntegerValue(valueRef); /* record min and max for auto calibration */ if (value < pElement->minReport) { @@ -202,30 +199,25 @@ GetHIDElementState(recDevice *pDevice, recElement *pElement, SInt32 *pValue) return returnValue; } -static SDL_bool -GetHIDScaledCalibratedState(recDevice * pDevice, recElement * pElement, SInt32 min, SInt32 max, SInt32 *pValue) +static SDL_bool GetHIDScaledCalibratedState(recDevice *pDevice, recElement *pElement, SInt32 min, SInt32 max, SInt32 *pValue) { const float deviceScale = max - min; const float readScale = pElement->maxReport - pElement->minReport; int returnValue = SDL_FALSE; - if (GetHIDElementState(pDevice, pElement, pValue)) - { + if (GetHIDElementState(pDevice, pElement, pValue)) { if (readScale == 0) { - returnValue = SDL_TRUE; /* no scaling at all */ - } - else - { + returnValue = SDL_TRUE; /* no scaling at all */ + } else { *pValue = ((*pValue - pElement->minReport) * deviceScale / readScale) + min; returnValue = SDL_TRUE; } - } + } return returnValue; } -static void -JoystickDeviceWasRemovedCallback(void *ctx, IOReturn result, void *sender) +static void JoystickDeviceWasRemovedCallback(void *ctx, IOReturn result, void *sender) { - recDevice *device = (recDevice *) ctx; + recDevice *device = (recDevice *)ctx; device->removed = SDL_TRUE; if (device->deviceRef) { // deviceRef was invalidated due to the remove @@ -245,26 +237,24 @@ JoystickDeviceWasRemovedCallback(void *ctx, IOReturn result, void *sender) device->ffdevice = NULL; device->ff_initialized = SDL_FALSE; } -#if SDL_HAPTIC_IOKIT +#ifdef SDL_HAPTIC_IOKIT MacHaptic_MaybeRemoveDevice(device->ffservice); #endif SDL_PrivateJoystickRemoved(device->instance_id); } - static void AddHIDElement(const void *value, void *parameter); /* Call AddHIDElement() on all elements in an array of IOHIDElementRefs */ -static void -AddHIDElements(CFArrayRef array, recDevice *pDevice) +static void AddHIDElements(CFArrayRef array, recDevice *pDevice) { const CFRange range = { 0, CFArrayGetCount(array) }; CFArrayApplyFunction(array, range, AddHIDElement, pDevice); } -static SDL_bool -ElementAlreadyAdded(const IOHIDElementCookie cookie, const recElement *listitem) { +static SDL_bool ElementAlreadyAdded(const IOHIDElementCookie cookie, const recElement *listitem) +{ while (listitem) { if (listitem->cookie == cookie) { return SDL_TRUE; @@ -275,11 +265,10 @@ ElementAlreadyAdded(const IOHIDElementCookie cookie, const recElement *listitem) } /* See if we care about this HID element, and if so, note it in our recDevice. */ -static void -AddHIDElement(const void *value, void *parameter) +static void AddHIDElement(const void *value, void *parameter) { - recDevice *pDevice = (recDevice *) parameter; - IOHIDElementRef refElement = (IOHIDElementRef) value; + recDevice *pDevice = (recDevice *)parameter; + IOHIDElementRef refElement = (IOHIDElementRef)value; const CFTypeID elementTypeID = refElement ? CFGetTypeID(refElement) : 0; if (refElement && (elementTypeID == IOHIDElementGetTypeID())) { @@ -291,107 +280,107 @@ AddHIDElement(const void *value, void *parameter) /* look at types of interest */ switch (IOHIDElementGetType(refElement)) { - case kIOHIDElementTypeInput_Misc: - case kIOHIDElementTypeInput_Button: - case kIOHIDElementTypeInput_Axis: { - switch (usagePage) { /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */ - case kHIDPage_GenericDesktop: - switch (usage) { - case kHIDUsage_GD_X: - case kHIDUsage_GD_Y: - case kHIDUsage_GD_Z: - case kHIDUsage_GD_Rx: - case kHIDUsage_GD_Ry: - case kHIDUsage_GD_Rz: - case kHIDUsage_GD_Slider: - case kHIDUsage_GD_Dial: - case kHIDUsage_GD_Wheel: - if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) { - element = (recElement *) SDL_calloc(1, sizeof (recElement)); - if (element) { - pDevice->axes++; - headElement = &(pDevice->firstAxis); - } - } - break; - - case kHIDUsage_GD_Hatswitch: - if (!ElementAlreadyAdded(cookie, pDevice->firstHat)) { - element = (recElement *) SDL_calloc(1, sizeof (recElement)); - if (element) { - pDevice->hats++; - headElement = &(pDevice->firstHat); - } - } - break; - case kHIDUsage_GD_DPadUp: - case kHIDUsage_GD_DPadDown: - case kHIDUsage_GD_DPadRight: - case kHIDUsage_GD_DPadLeft: - case kHIDUsage_GD_Start: - case kHIDUsage_GD_Select: - case kHIDUsage_GD_SystemMainMenu: - if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { - element = (recElement *) SDL_calloc(1, sizeof (recElement)); - if (element) { - pDevice->buttons++; - headElement = &(pDevice->firstButton); - } - } - break; + case kIOHIDElementTypeInput_Misc: + case kIOHIDElementTypeInput_Button: + case kIOHIDElementTypeInput_Axis: + { + switch (usagePage) { /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */ + case kHIDPage_GenericDesktop: + switch (usage) { + case kHIDUsage_GD_X: + case kHIDUsage_GD_Y: + case kHIDUsage_GD_Z: + case kHIDUsage_GD_Rx: + case kHIDUsage_GD_Ry: + case kHIDUsage_GD_Rz: + case kHIDUsage_GD_Slider: + case kHIDUsage_GD_Dial: + case kHIDUsage_GD_Wheel: + if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) { + element = (recElement *)SDL_calloc(1, sizeof(recElement)); + if (element) { + pDevice->axes++; + headElement = &(pDevice->firstAxis); + } + } + break; + + case kHIDUsage_GD_Hatswitch: + if (!ElementAlreadyAdded(cookie, pDevice->firstHat)) { + element = (recElement *)SDL_calloc(1, sizeof(recElement)); + if (element) { + pDevice->hats++; + headElement = &(pDevice->firstHat); } - break; - - case kHIDPage_Simulation: - switch (usage) { - case kHIDUsage_Sim_Rudder: - case kHIDUsage_Sim_Throttle: - case kHIDUsage_Sim_Accelerator: - case kHIDUsage_Sim_Brake: - if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) { - element = (recElement *) SDL_calloc(1, sizeof (recElement)); - if (element) { - pDevice->axes++; - headElement = &(pDevice->firstAxis); - } - } - break; - - default: - break; + } + break; + case kHIDUsage_GD_DPadUp: + case kHIDUsage_GD_DPadDown: + case kHIDUsage_GD_DPadRight: + case kHIDUsage_GD_DPadLeft: + case kHIDUsage_GD_Start: + case kHIDUsage_GD_Select: + case kHIDUsage_GD_SystemMainMenu: + if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { + element = (recElement *)SDL_calloc(1, sizeof(recElement)); + if (element) { + pDevice->buttons++; + headElement = &(pDevice->firstButton); } - break; - - case kHIDPage_Button: - case kHIDPage_Consumer: /* e.g. 'pause' button on Steelseries MFi gamepads. */ - if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { - element = (recElement *) SDL_calloc(1, sizeof (recElement)); - if (element) { - pDevice->buttons++; - headElement = &(pDevice->firstButton); - } + } + break; + } + break; + + case kHIDPage_Simulation: + switch (usage) { + case kHIDUsage_Sim_Rudder: + case kHIDUsage_Sim_Throttle: + case kHIDUsage_Sim_Accelerator: + case kHIDUsage_Sim_Brake: + if (!ElementAlreadyAdded(cookie, pDevice->firstAxis)) { + element = (recElement *)SDL_calloc(1, sizeof(recElement)); + if (element) { + pDevice->axes++; + headElement = &(pDevice->firstAxis); } - break; + } + break; - default: - break; + default: + break; } - } - break; + break; - case kIOHIDElementTypeCollection: { - CFArrayRef array = IOHIDElementGetChildren(refElement); - if (array) { - AddHIDElements(array, pDevice); + case kHIDPage_Button: + case kHIDPage_Consumer: /* e.g. 'pause' button on Steelseries MFi gamepads. */ + if (!ElementAlreadyAdded(cookie, pDevice->firstButton)) { + element = (recElement *)SDL_calloc(1, sizeof(recElement)); + if (element) { + pDevice->buttons++; + headElement = &(pDevice->firstButton); + } } - } - break; + break; default: break; + } + } break; + + case kIOHIDElementTypeCollection: + { + CFArrayRef array = IOHIDElementGetChildren(refElement); + if (array) { + AddHIDElements(array, pDevice); + } + } break; + + default: + break; } - if (element && headElement) { /* add to list */ + if (element && headElement) { /* add to list */ recElement *elementPrevious = NULL; recElement *elementCurrent = *headElement; while (elementCurrent && usage >= elementCurrent->usage) { @@ -409,8 +398,8 @@ AddHIDElement(const void *value, void *parameter) element->usage = usage; element->pNext = elementCurrent; - element->minReport = element->min = (SInt32) IOHIDElementGetLogicalMin(refElement); - element->maxReport = element->max = (SInt32) IOHIDElementGetLogicalMax(refElement); + element->minReport = element->min = (SInt32)IOHIDElementGetLogicalMin(refElement); + element->maxReport = element->max = (SInt32)IOHIDElementGetLogicalMax(refElement); element->cookie = IOHIDElementGetCookie(refElement); pDevice->elements++; @@ -418,9 +407,20 @@ AddHIDElement(const void *value, void *parameter) } } +static int GetSteamVirtualGamepadSlot(Uint16 vendor_id, Uint16 product_id, const char *product_string) +{ + int slot = -1; -static SDL_bool -GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) + if (vendor_id == USB_VENDOR_MICROSOFT && product_id == USB_PRODUCT_XBOX360_WIRED_CONTROLLER) { + /* Gamepad name is "GamePad-N", where N is slot + 1 */ + if (SDL_sscanf(product_string, "GamePad-%d", &slot) == 1) { + slot -= 1; + } + } + return slot; +} + +static SDL_bool GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) { Sint32 vendor = 0; Sint32 product = 0; @@ -477,6 +477,11 @@ GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) CFNumberGetValue(refCF, kCFNumberSInt32Type, &version); } + if (SDL_IsJoystickXboxOne(vendor, product)) { + /* We can't actually use this API for Xbox controllers */ + return false; + } + /* get device name */ refCF = IOHIDDeviceGetProperty(hidDevice, CFSTR(kIOHIDManufacturerKey)); if ((!refCF) || (!CFStringGetCString(refCF, manufacturer_string, sizeof(manufacturer_string), kCFStringEncodingUTF8))) { @@ -499,7 +504,8 @@ GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) } #endif - pDevice->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, (Uint16)vendor, (Uint16)product, (Uint16)version, pDevice->product, 0, 0); + pDevice->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, (Uint16)vendor, (Uint16)product, (Uint16)version, manufacturer_string, product_string, 0, 0); + pDevice->steam_virtual_gamepad_slot = GetSteamVirtualGamepadSlot((Uint16)vendor, (Uint16)product, product_string); array = IOHIDDeviceCopyMatchingElements(hidDevice, NULL, kIOHIDOptionsTypeNone); if (array) { @@ -510,8 +516,7 @@ GetDeviceInfo(IOHIDDeviceRef hidDevice, recDevice *pDevice) return SDL_TRUE; } -static SDL_bool -JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject) +static SDL_bool JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject) { recDevice *i; @@ -522,7 +527,7 @@ JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject) } #endif - for (i = gpDeviceList; i != NULL; i = i->pNext) { + for (i = gpDeviceList; i; i = i->pNext) { if (i->deviceRef == ioHIDDeviceObject) { return SDL_TRUE; } @@ -530,12 +535,9 @@ JoystickAlreadyKnown(IOHIDDeviceRef ioHIDDeviceObject) return SDL_FALSE; } - -static void -JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) +static void JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) { recDevice *device; - int device_index = 0; io_service_t ioservice; if (res != kIOReturnSuccess) { @@ -543,10 +545,10 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic } if (JoystickAlreadyKnown(ioHIDDeviceObject)) { - return; /* IOKit sent us a duplicate. */ + return; /* IOKit sent us a duplicate. */ } - device = (recDevice *) SDL_calloc(1, sizeof(recDevice)); + device = (recDevice *)SDL_calloc(1, sizeof(recDevice)); if (!device) { SDL_OutOfMemory(); return; @@ -554,7 +556,7 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic if (!GetDeviceInfo(ioHIDDeviceObject, device)) { FreeDevice(device); - return; /* not a device we care about, probably. */ + return; /* not a device we care about, probably. */ } if (SDL_ShouldIgnoreJoystick(device->product, device->guid)) { @@ -574,31 +576,28 @@ JoystickDeviceWasAddedCallback(void *ctx, IOReturn res, void *sender, IOHIDDevic ioservice = IOHIDDeviceGetService(ioHIDDeviceObject); if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK)) { device->ffservice = ioservice; -#if SDL_HAPTIC_IOKIT +#ifdef SDL_HAPTIC_IOKIT MacHaptic_MaybeAddDevice(ioservice); #endif } /* Add device to the end of the list */ - if ( !gpDeviceList ) { + if (!gpDeviceList) { gpDeviceList = device; } else { recDevice *curdevice; curdevice = gpDeviceList; - while ( curdevice->pNext ) { - ++device_index; + while (curdevice->pNext) { curdevice = curdevice->pNext; } curdevice->pNext = device; - ++device_index; /* bump by one since we counted by pNext. */ } SDL_PrivateJoystickAdded(device->instance_id); } -static SDL_bool -ConfigHIDManager(CFArrayRef matchingArray) +static SDL_bool ConfigHIDManager(CFArrayRef matchingArray) { CFRunLoopRef runloop = CFRunLoopGetCurrent(); @@ -610,24 +609,22 @@ ConfigHIDManager(CFArrayRef matchingArray) IOHIDManagerRegisterDeviceMatchingCallback(hidman, JoystickDeviceWasAddedCallback, NULL); IOHIDManagerScheduleWithRunLoop(hidman, runloop, SDL_JOYSTICK_RUNLOOP_MODE); - while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { + while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE, 0, TRUE) == kCFRunLoopRunHandledSource) { /* no-op. Callback fires once per existing device. */ } /* future hotplug events will come through SDL_JOYSTICK_RUNLOOP_MODE now. */ - return SDL_TRUE; /* good to go. */ + return SDL_TRUE; /* good to go. */ } - -static CFDictionaryRef -CreateHIDDeviceMatchDictionary(const UInt32 page, const UInt32 usage, int *okay) +static CFDictionaryRef CreateHIDDeviceMatchDictionary(const UInt32 page, const UInt32 usage, int *okay) { CFDictionaryRef retval = NULL; CFNumberRef pageNumRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page); CFNumberRef usageNumRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage); - const void *keys[2] = { (void *) CFSTR(kIOHIDDeviceUsagePageKey), (void *) CFSTR(kIOHIDDeviceUsageKey) }; - const void *vals[2] = { (void *) pageNumRef, (void *) usageNumRef }; + const void *keys[2] = { (void *)CFSTR(kIOHIDDeviceUsagePageKey), (void *)CFSTR(kIOHIDDeviceUsageKey) }; + const void *vals[2] = { (void *)pageNumRef, (void *)usageNumRef }; if (pageNumRef && usageNumRef) { retval = CFDictionaryCreate(kCFAllocatorDefault, keys, vals, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); @@ -647,15 +644,14 @@ CreateHIDDeviceMatchDictionary(const UInt32 page, const UInt32 usage, int *okay) return retval; } -static SDL_bool -CreateHIDManager(void) +static SDL_bool CreateHIDManager(void) { SDL_bool retval = SDL_FALSE; int okay = 1; const void *vals[] = { - (void *) CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick, &okay), - (void *) CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad, &okay), - (void *) CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_MultiAxisController, &okay), + (void *)CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick, &okay), + (void *)CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad, &okay), + (void *)CreateHIDDeviceMatchDictionary(kHIDPage_GenericDesktop, kHIDUsage_GD_MultiAxisController, &okay), }; const size_t numElements = SDL_arraysize(vals); CFArrayRef array = okay ? CFArrayCreate(kCFAllocatorDefault, vals, numElements, &kCFTypeArrayCallBacks) : NULL; @@ -663,7 +659,7 @@ CreateHIDManager(void) for (i = 0; i < numElements; i++) { if (vals[i]) { - CFRelease((CFTypeRef) vals[i]); + CFRelease((CFTypeRef)vals[i]); } } @@ -678,12 +674,10 @@ CreateHIDManager(void) return retval; } - -static int -DARWIN_JoystickInit(void) +static int DARWIN_JoystickInit(void) { - if (gpDeviceList) { - return SDL_SetError("Joystick: Device list already inited."); + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_IOKIT, SDL_TRUE)) { + return 0; } if (!CreateHIDManager()) { @@ -693,8 +687,7 @@ DARWIN_JoystickInit(void) return 0; } -static int -DARWIN_JoystickGetCount(void) +static int DARWIN_JoystickGetCount(void) { recDevice *device = gpDeviceList; int nJoySticks = 0; @@ -709,8 +702,7 @@ DARWIN_JoystickGetCount(void) return nJoySticks; } -static void -DARWIN_JoystickDetect(void) +static void DARWIN_JoystickDetect(void) { recDevice *device = gpDeviceList; while (device) { @@ -721,39 +713,42 @@ DARWIN_JoystickDetect(void) } } - /* run this after the checks above so we don't set device->removed and delete the device before - DARWIN_JoystickUpdate can run to clean up the SDL_Joystick object that owns this device */ - while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { - /* no-op. Pending callbacks will fire in CFRunLoopRunInMode(). */ + if (hidman) { + /* run this after the checks above so we don't set device->removed and delete the device before + DARWIN_JoystickUpdate can run to clean up the SDL_Joystick object that owns this device */ + while (CFRunLoopRunInMode(SDL_JOYSTICK_RUNLOOP_MODE, 0, TRUE) == kCFRunLoopRunHandledSource) { + /* no-op. Pending callbacks will fire in CFRunLoopRunInMode(). */ + } } } -const char * -DARWIN_JoystickGetDeviceName(int device_index) +const char *DARWIN_JoystickGetDeviceName(int device_index) { recDevice *device = GetDeviceForIndex(device_index); return device ? device->product : "UNKNOWN"; } -const char * -DARWIN_JoystickGetDevicePath(int device_index) +const char *DARWIN_JoystickGetDevicePath(int device_index) { return NULL; } -static int -DARWIN_JoystickGetDevicePlayerIndex(int device_index) +static int DARWIN_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + recDevice *device = GetDeviceForIndex(device_index); + return device ? device->steam_virtual_gamepad_slot : -1; +} + +static int DARWIN_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -DARWIN_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void DARWIN_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -DARWIN_JoystickGetDeviceGUID( int device_index ) +static SDL_JoystickGUID DARWIN_JoystickGetDeviceGUID(int device_index) { recDevice *device = GetDeviceForIndex(device_index); SDL_JoystickGUID guid; @@ -765,15 +760,13 @@ DARWIN_JoystickGetDeviceGUID( int device_index ) return guid; } -static SDL_JoystickID -DARWIN_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID DARWIN_JoystickGetDeviceInstanceID(int device_index) { recDevice *device = GetDeviceForIndex(device_index); return device ? device->instance_id : 0; } -static int -DARWIN_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int DARWIN_JoystickOpen(SDL_Joystick *joystick, int device_index) { recDevice *device = GetDeviceForIndex(device_index); @@ -792,8 +785,7 @@ DARWIN_JoystickOpen(SDL_Joystick *joystick, int device_index) /* * Like strerror but for force feedback errors. */ -static const char * -FFStrError(unsigned int err) +static const char *FFStrError(unsigned int err) { switch (err) { case FFERR_DEVICEFULL: @@ -845,8 +837,7 @@ FFStrError(unsigned int err) } } -static int -DARWIN_JoystickInitRumble(recDevice *device, Sint16 magnitude) +static int DARWIN_JoystickInitRumble(recDevice *device, Sint16 magnitude) { HRESULT result; @@ -875,22 +866,21 @@ DARWIN_JoystickInitRumble(recDevice *device, Sint16 magnitude) } result = FFDeviceCreateEffect(device->ffdevice, kFFEffectType_Sine_ID, - device->ffeffect, &device->ffeffect_ref); + device->ffeffect, &device->ffeffect_ref); if (result != FF_OK) { return SDL_SetError("Haptic: Unable to create effect: %s", FFStrError(result)); } return 0; } -static int -DARWIN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int DARWIN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { HRESULT result; recDevice *device = joystick->hwdata; /* Scale and average the two rumble strengths */ Sint16 magnitude = (Sint16)(((low_frequency_rumble / 2) + (high_frequency_rumble / 2)) / 2); - + if (!device) { return SDL_SetError("Rumble failed, device disconnected"); } @@ -904,7 +894,7 @@ DARWIN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint1 periodic->dwMagnitude = CONVERT_MAGNITUDE(magnitude); result = FFEffectSetParameters(device->ffeffect_ref, device->ffeffect, - (FFEP_DURATION | FFEP_TYPESPECIFICPARAMS)); + (FFEP_DURATION | FFEP_TYPESPECIFICPARAMS)); if (result != FF_OK) { return SDL_SetError("Unable to update rumble effect: %s", FFStrError(result)); } @@ -922,14 +912,12 @@ DARWIN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint1 return 0; } -static int -DARWIN_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int DARWIN_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -DARWIN_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 DARWIN_JoystickGetCapabilities(SDL_Joystick *joystick) { recDevice *device = joystick->hwdata; Uint32 result = 0; @@ -945,26 +933,22 @@ DARWIN_JoystickGetCapabilities(SDL_Joystick *joystick) return result; } -static int -DARWIN_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int DARWIN_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -DARWIN_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int DARWIN_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -DARWIN_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int DARWIN_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -DARWIN_JoystickUpdate(SDL_Joystick *joystick) +static void DARWIN_JoystickUpdate(SDL_Joystick *joystick) { recDevice *device = joystick->hwdata; recElement *element; @@ -975,7 +959,7 @@ DARWIN_JoystickUpdate(SDL_Joystick *joystick) return; } - if (device->removed) { /* device was unplugged; ignore it. */ + if (device->removed) { /* device was unplugged; ignore it. */ if (joystick->hwdata) { joystick->hwdata = NULL; } @@ -1000,7 +984,7 @@ DARWIN_JoystickUpdate(SDL_Joystick *joystick) while (element) { goodRead = GetHIDElementState(device, element, &value); if (goodRead) { - if (value > 1) { /* handle pressure-sensitive buttons */ + if (value > 1) { /* handle pressure-sensitive buttons */ value = 1; } SDL_PrivateJoystickButton(joystick, i, value); @@ -1012,7 +996,7 @@ DARWIN_JoystickUpdate(SDL_Joystick *joystick) element = device->firstHat; i = 0; - + while (element) { Uint8 pos = 0; @@ -1020,9 +1004,9 @@ DARWIN_JoystickUpdate(SDL_Joystick *joystick) goodRead = GetHIDElementState(device, element, &value); if (goodRead) { value -= element->min; - if (range == 4) { /* 4 position hatswitch - scale up value */ + if (range == 4) { /* 4 position hatswitch - scale up value */ value *= 2; - } else if (range != 8) { /* Neither a 4 nor 8 positions - fall back to default position (centered) */ + } else if (range != 8) { /* Neither a 4 nor 8 positions - fall back to default position (centered) */ value = -1; } switch (value) { @@ -1061,14 +1045,13 @@ DARWIN_JoystickUpdate(SDL_Joystick *joystick) SDL_PrivateJoystickHat(joystick, i, pos); } - + element = element->pNext; ++i; } } -static void -DARWIN_JoystickClose(SDL_Joystick *joystick) +static void DARWIN_JoystickClose(SDL_Joystick *joystick) { recDevice *device = joystick->hwdata; if (device) { @@ -1076,8 +1059,7 @@ DARWIN_JoystickClose(SDL_Joystick *joystick) } } -static void -DARWIN_JoystickQuit(void) +static void DARWIN_JoystickQuit(void) { while (FreeDevice(gpDeviceList)) { /* spin */ @@ -1091,19 +1073,18 @@ DARWIN_JoystickQuit(void) } } -static SDL_bool -DARWIN_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool DARWIN_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_DARWIN_JoystickDriver = -{ +SDL_JoystickDriver SDL_DARWIN_JoystickDriver = { DARWIN_JoystickInit, DARWIN_JoystickGetCount, DARWIN_JoystickDetect, DARWIN_JoystickGetDeviceName, DARWIN_JoystickGetDevicePath, + DARWIN_JoystickGetDeviceSteamVirtualGamepadSlot, DARWIN_JoystickGetDevicePlayerIndex, DARWIN_JoystickSetDevicePlayerIndex, DARWIN_JoystickGetDeviceGUID, diff --git a/src/joystick/darwin/SDL_iokitjoystick_c.h b/src/joystick/darwin/SDL_iokitjoystick_c.h index 369edd130e06b..e7b42aec74e42 100644 --- a/src/joystick/darwin/SDL_iokitjoystick_c.h +++ b/src/joystick/darwin/SDL_iokitjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,35 +31,35 @@ struct recElement { IOHIDElementRef elementRef; IOHIDElementCookie cookie; - uint32_t usagePage, usage; /* HID usage */ - SInt32 min; /* reported min value possible */ - SInt32 max; /* reported max value possible */ + uint32_t usagePage, usage; /* HID usage */ + SInt32 min; /* reported min value possible */ + SInt32 max; /* reported max value possible */ /* runtime variables used for auto-calibration */ - SInt32 minReport; /* min returned value */ - SInt32 maxReport; /* max returned value */ + SInt32 minReport; /* min returned value */ + SInt32 maxReport; /* max returned value */ - struct recElement *pNext; /* next element in list */ + struct recElement *pNext; /* next element in list */ }; typedef struct recElement recElement; struct joystick_hwdata { - IOHIDDeviceRef deviceRef; /* HIDManager device handle */ - io_service_t ffservice; /* Interface for force feedback, 0 = no ff */ + IOHIDDeviceRef deviceRef; /* HIDManager device handle */ + io_service_t ffservice; /* Interface for force feedback, 0 = no ff */ FFDeviceObjectReference ffdevice; FFEFFECT *ffeffect; FFEffectObjectReference ffeffect_ref; SDL_bool ff_initialized; - char product[256]; /* name of product */ - uint32_t usage; /* usage page from IOUSBHID Parser.h which defines general usage */ - uint32_t usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */ + char product[256]; /* name of product */ + uint32_t usage; /* usage page from IOUSBHID Parser.h which defines general usage */ + uint32_t usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */ - int axes; /* number of axis (calculated, not reported by device) */ - int buttons; /* number of buttons (calculated, not reported by device) */ - int hats; /* number of hat switches (calculated, not reported by device) */ - int elements; /* number of total elements (should be total of above) (calculated, not reported by device) */ + int axes; /* number of axis (calculated, not reported by device) */ + int buttons; /* number of buttons (calculated, not reported by device) */ + int hats; /* number of hat switches (calculated, not reported by device) */ + int elements; /* number of total elements (should be total of above) (calculated, not reported by device) */ recElement *firstAxis; recElement *firstButton; @@ -67,12 +67,13 @@ struct joystick_hwdata SDL_bool removed; SDL_Joystick *joystick; - SDL_bool runLoopAttached; /* is 'deviceRef' attached to a CFRunLoop? */ + SDL_bool runLoopAttached; /* is 'deviceRef' attached to a CFRunLoop? */ int instance_id; SDL_JoystickGUID guid; + int steam_virtual_gamepad_slot; - struct joystick_hwdata *pNext; /* next device */ + struct joystick_hwdata *pNext; /* next device */ }; typedef struct joystick_hwdata recDevice; diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c index 3cf8da5f9821c..f2e2fc0653df7 100644 --- a/src/joystick/dummy/SDL_sysjoystick.c +++ b/src/joystick/dummy/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,131 +28,115 @@ #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" - -static int -DUMMY_JoystickInit(void) +static int DUMMY_JoystickInit(void) { return 0; } -static int -DUMMY_JoystickGetCount(void) +static int DUMMY_JoystickGetCount(void) { return 0; } -static void -DUMMY_JoystickDetect(void) +static void DUMMY_JoystickDetect(void) { } -static const char * -DUMMY_JoystickGetDeviceName(int device_index) +static const char *DUMMY_JoystickGetDeviceName(int device_index) { return NULL; } -static const char * -DUMMY_JoystickGetDevicePath(int device_index) +static const char *DUMMY_JoystickGetDevicePath(int device_index) { return NULL; } -static int -DUMMY_JoystickGetDevicePlayerIndex(int device_index) +static int DUMMY_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int DUMMY_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -DUMMY_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void DUMMY_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -DUMMY_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID DUMMY_JoystickGetDeviceGUID(int device_index) { SDL_JoystickGUID guid; SDL_zero(guid); return guid; } -static SDL_JoystickID -DUMMY_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID DUMMY_JoystickGetDeviceInstanceID(int device_index) { return -1; } -static int -DUMMY_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int DUMMY_JoystickOpen(SDL_Joystick *joystick, int device_index) { return SDL_SetError("Logic error: No joysticks available"); } -static int -DUMMY_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int DUMMY_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -DUMMY_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int DUMMY_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -DUMMY_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 DUMMY_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -static int -DUMMY_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int DUMMY_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -DUMMY_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int DUMMY_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -DUMMY_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int DUMMY_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -DUMMY_JoystickUpdate(SDL_Joystick *joystick) +static void DUMMY_JoystickUpdate(SDL_Joystick *joystick) { } -static void -DUMMY_JoystickClose(SDL_Joystick *joystick) +static void DUMMY_JoystickClose(SDL_Joystick *joystick) { } -static void -DUMMY_JoystickQuit(void) +static void DUMMY_JoystickQuit(void) { } -static SDL_bool -DUMMY_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool DUMMY_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_DUMMY_JoystickDriver = -{ +SDL_JoystickDriver SDL_DUMMY_JoystickDriver = { DUMMY_JoystickInit, DUMMY_JoystickGetCount, DUMMY_JoystickDetect, DUMMY_JoystickGetDeviceName, DUMMY_JoystickGetDevicePath, + DUMMY_JoystickGetDeviceSteamVirtualGamepadSlot, DUMMY_JoystickGetDevicePlayerIndex, DUMMY_JoystickSetDevicePlayerIndex, DUMMY_JoystickGetDeviceGUID, diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c index c875e991bce8d..02c450a5e3ad8 100644 --- a/src/joystick/emscripten/SDL_sysjoystick.c +++ b/src/joystick/emscripten/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,26 +32,24 @@ #include "SDL_sysjoystick_c.h" #include "../SDL_joystick_c.h" -static SDL_joylist_item * JoystickByIndex(int index); +static SDL_joylist_item *JoystickByIndex(int index); static SDL_joylist_item *SDL_joylist = NULL; static SDL_joylist_item *SDL_joylist_tail = NULL; static int numjoysticks = 0; -static int instance_counter = 0; -static EM_BOOL -Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData) +static EM_BOOL Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData) { int i; SDL_joylist_item *item; if (JoystickByIndex(gamepadEvent->index) != NULL) { - return 1; + return 1; } - item = (SDL_joylist_item *) SDL_malloc(sizeof (SDL_joylist_item)); - if (item == NULL) { + item = (SDL_joylist_item *)SDL_malloc(sizeof(SDL_joylist_item)); + if (!item) { return 1; } @@ -59,13 +57,13 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa item->index = gamepadEvent->index; item->name = SDL_CreateJoystickName(0, 0, NULL, gamepadEvent->id); - if ( item->name == NULL ) { + if (!item->name) { SDL_free(item); return 1; } item->mapping = SDL_strdup(gamepadEvent->mapping); - if ( item->mapping == NULL ) { + if (!item->mapping) { SDL_free(item->name); SDL_free(item); return 1; @@ -73,20 +71,20 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa item->naxes = gamepadEvent->numAxes; item->nbuttons = gamepadEvent->numButtons; - item->device_instance = instance_counter++; + item->device_instance = SDL_GetNextJoystickInstanceID(); item->timestamp = gamepadEvent->timestamp; - for( i = 0; i < item->naxes; i++) { + for (i = 0; i < item->naxes; i++) { item->axis[i] = gamepadEvent->axis[i]; } - for( i = 0; i < item->nbuttons; i++) { + for (i = 0; i < item->nbuttons; i++) { item->analogButton[i] = gamepadEvent->analogButton[i]; item->digitalButton[i] = gamepadEvent->digitalButton[i]; } - if (SDL_joylist_tail == NULL) { + if (!SDL_joylist_tail) { SDL_joylist = SDL_joylist_tail = item; } else { SDL_joylist_tail->next = item; @@ -108,13 +106,12 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa return 1; } -static EM_BOOL -Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData) +static EM_BOOL Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData) { SDL_joylist_item *item = SDL_joylist; SDL_joylist_item *prev = NULL; - while (item != NULL) { + while (item) { if (item->index == gamepadEvent->index) { break; } @@ -122,7 +119,7 @@ Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gam item = item->next; } - if (item == NULL) { + if (!item) { return 1; } @@ -130,7 +127,7 @@ Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gam item->joystick->hwdata = NULL; } - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_joylist == item); @@ -155,8 +152,7 @@ Emscripten_JoyStickDisconnected(int eventType, const EmscriptenGamepadEvent *gam } /* Function to perform any system-specific joystick related cleanup */ -static void -EMSCRIPTEN_JoystickQuit(void) +static void EMSCRIPTEN_JoystickQuit(void) { SDL_joylist_item *item = NULL; SDL_joylist_item *next = NULL; @@ -171,7 +167,6 @@ EMSCRIPTEN_JoystickQuit(void) SDL_joylist = SDL_joylist_tail = NULL; numjoysticks = 0; - instance_counter = 0; emscripten_set_gamepadconnected_callback(NULL, 0, NULL); emscripten_set_gamepaddisconnected_callback(NULL, 0, NULL); @@ -180,8 +175,7 @@ EMSCRIPTEN_JoystickQuit(void) /* Function to scan the system for joysticks. * It should return 0, or -1 on an unrecoverable fatal error. */ -static int -EMSCRIPTEN_JoystickInit(void) +static int EMSCRIPTEN_JoystickInit(void) { int retval, i, numjs; EmscriptenGamepadEvent gamepadState; @@ -199,7 +193,7 @@ EMSCRIPTEN_JoystickInit(void) /* handle already connected gamepads */ if (numjs > 0) { - for(i = 0; i < numjs; i++) { + for (i = 0; i < numjs; i++) { retval = emscripten_get_gamepad_status(i, &gamepadState); if (retval == EMSCRIPTEN_RESULT_SUCCESS) { Emscripten_JoyStickConnected(EMSCRIPTEN_EVENT_GAMEPADCONNECTED, @@ -213,7 +207,7 @@ EMSCRIPTEN_JoystickInit(void) 0, Emscripten_JoyStickConnected); - if(retval != EMSCRIPTEN_RESULT_SUCCESS) { + if (retval != EMSCRIPTEN_RESULT_SUCCESS) { EMSCRIPTEN_JoystickQuit(); return SDL_SetError("Could not set gamepad connect callback"); } @@ -221,7 +215,7 @@ EMSCRIPTEN_JoystickInit(void) retval = emscripten_set_gamepaddisconnected_callback(NULL, 0, Emscripten_JoyStickDisconnected); - if(retval != EMSCRIPTEN_RESULT_SUCCESS) { + if (retval != EMSCRIPTEN_RESULT_SUCCESS) { EMSCRIPTEN_JoystickQuit(); return SDL_SetError("Could not set gamepad disconnect callback"); } @@ -230,8 +224,7 @@ EMSCRIPTEN_JoystickInit(void) } /* Returns item matching given SDL device index. */ -static SDL_joylist_item * -JoystickByDeviceIndex(int device_index) +static SDL_joylist_item *JoystickByDeviceIndex(int device_index) { SDL_joylist_item *item = SDL_joylist; @@ -244,8 +237,7 @@ JoystickByDeviceIndex(int device_index) } /* Returns item matching given HTML gamepad index. */ -static SDL_joylist_item * -JoystickByIndex(int index) +static SDL_joylist_item *JoystickByIndex(int index) { SDL_joylist_item *item = SDL_joylist; @@ -253,7 +245,7 @@ JoystickByIndex(int index) return NULL; } - while (item != NULL) { + while (item) { if (item->index == index) { break; } @@ -263,42 +255,40 @@ JoystickByIndex(int index) return item; } -static int -EMSCRIPTEN_JoystickGetCount(void) +static int EMSCRIPTEN_JoystickGetCount(void) { return numjoysticks; } -static void -EMSCRIPTEN_JoystickDetect(void) +static void EMSCRIPTEN_JoystickDetect(void) { } -static const char * -EMSCRIPTEN_JoystickGetDeviceName(int device_index) +static const char *EMSCRIPTEN_JoystickGetDeviceName(int device_index) { return JoystickByDeviceIndex(device_index)->name; } -static const char * -EMSCRIPTEN_JoystickGetDevicePath(int device_index) +static const char *EMSCRIPTEN_JoystickGetDevicePath(int device_index) { return NULL; } -static int -EMSCRIPTEN_JoystickGetDevicePlayerIndex(int device_index) +static int EMSCRIPTEN_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int EMSCRIPTEN_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -EMSCRIPTEN_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void EMSCRIPTEN_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickID -EMSCRIPTEN_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID EMSCRIPTEN_JoystickGetDeviceInstanceID(int device_index) { return JoystickByDeviceIndex(device_index)->device_instance; } @@ -308,21 +298,20 @@ EMSCRIPTEN_JoystickGetDeviceInstanceID(int device_index) This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -static int -EMSCRIPTEN_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int EMSCRIPTEN_JoystickOpen(SDL_Joystick *joystick, int device_index) { SDL_joylist_item *item = JoystickByDeviceIndex(device_index); - if (item == NULL ) { + if (!item) { return SDL_SetError("No such device"); } - if (item->joystick != NULL) { + if (item->joystick) { return SDL_SetError("Joystick already opened"); } joystick->instance_id = item->device_instance; - joystick->hwdata = (struct joystick_hwdata *) item; + joystick->hwdata = (struct joystick_hwdata *)item; item->joystick = joystick; /* HTML5 Gamepad API doesn't say anything about these */ @@ -332,7 +321,7 @@ EMSCRIPTEN_JoystickOpen(SDL_Joystick *joystick, int device_index) joystick->nbuttons = item->nbuttons; joystick->naxes = item->naxes; - return (0); + return 0; } /* Function to update the state of a joystick - called as a device poll. @@ -340,22 +329,21 @@ EMSCRIPTEN_JoystickOpen(SDL_Joystick *joystick, int device_index) * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -static void -EMSCRIPTEN_JoystickUpdate(SDL_Joystick *joystick) +static void EMSCRIPTEN_JoystickUpdate(SDL_Joystick *joystick) { EmscriptenGamepadEvent gamepadState; - SDL_joylist_item *item = (SDL_joylist_item *) joystick->hwdata; + SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata; int i, result, buttonState; emscripten_sample_gamepad_data(); if (item) { result = emscripten_get_gamepad_status(item->index, &gamepadState); - if( result == EMSCRIPTEN_RESULT_SUCCESS) { - if(gamepadState.timestamp == 0 || gamepadState.timestamp != item->timestamp) { - for(i = 0; i < item->nbuttons; i++) { - if(item->digitalButton[i] != gamepadState.digitalButton[i]) { - buttonState = gamepadState.digitalButton[i]? SDL_PRESSED: SDL_RELEASED; + if (result == EMSCRIPTEN_RESULT_SUCCESS) { + if (gamepadState.timestamp == 0 || gamepadState.timestamp != item->timestamp) { + for (i = 0; i < item->nbuttons; i++) { + if (item->digitalButton[i] != gamepadState.digitalButton[i]) { + buttonState = gamepadState.digitalButton[i] ? SDL_PRESSED : SDL_RELEASED; SDL_PrivateJoystickButton(item->joystick, i, buttonState); } @@ -364,11 +352,11 @@ EMSCRIPTEN_JoystickUpdate(SDL_Joystick *joystick) item->digitalButton[i] = gamepadState.digitalButton[i]; } - for(i = 0; i < item->naxes; i++) { - if(item->axis[i] != gamepadState.axis[i]) { + for (i = 0; i < item->naxes; i++) { + if (item->axis[i] != gamepadState.axis[i]) { /* do we need to do conversion? */ SDL_PrivateJoystickAxis(item->joystick, i, - (Sint16) (32767.*gamepadState.axis[i])); + (Sint16)(32767. * gamepadState.axis[i])); } /* store to compare in next update */ @@ -382,72 +370,63 @@ EMSCRIPTEN_JoystickUpdate(SDL_Joystick *joystick) } /* Function to close a joystick after use */ -static void -EMSCRIPTEN_JoystickClose(SDL_Joystick *joystick) +static void EMSCRIPTEN_JoystickClose(SDL_Joystick *joystick) { - SDL_joylist_item *item = (SDL_joylist_item *) joystick->hwdata; + SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata; if (item) { item->joystick = NULL; } } -static SDL_JoystickGUID -EMSCRIPTEN_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID EMSCRIPTEN_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = EMSCRIPTEN_JoystickGetDeviceName(device_index); return SDL_CreateJoystickGUIDForName(name); } -static int -EMSCRIPTEN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int EMSCRIPTEN_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -EMSCRIPTEN_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int EMSCRIPTEN_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static SDL_bool -EMSCRIPTEN_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool EMSCRIPTEN_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -static Uint32 -EMSCRIPTEN_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 EMSCRIPTEN_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -static int -EMSCRIPTEN_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int EMSCRIPTEN_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -EMSCRIPTEN_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int EMSCRIPTEN_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -EMSCRIPTEN_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int EMSCRIPTEN_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -SDL_JoystickDriver SDL_EMSCRIPTEN_JoystickDriver = -{ +SDL_JoystickDriver SDL_EMSCRIPTEN_JoystickDriver = { EMSCRIPTEN_JoystickInit, EMSCRIPTEN_JoystickGetCount, EMSCRIPTEN_JoystickDetect, EMSCRIPTEN_JoystickGetDeviceName, EMSCRIPTEN_JoystickGetDevicePath, + EMSCRIPTEN_JoystickGetDeviceSteamVirtualGamepadSlot, EMSCRIPTEN_JoystickGetDevicePlayerIndex, EMSCRIPTEN_JoystickSetDevicePlayerIndex, EMSCRIPTEN_JoystickGetDeviceGUID, diff --git a/src/joystick/emscripten/SDL_sysjoystick_c.h b/src/joystick/emscripten/SDL_sysjoystick_c.h index 815b53aafa11a..10814cf0d982c 100644 --- a/src/joystick/emscripten/SDL_sysjoystick_c.h +++ b/src/joystick/emscripten/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,25 +24,24 @@ #ifdef SDL_JOYSTICK_EMSCRIPTEN #include "../SDL_sysjoystick.h" - #include /* A linked list of available joysticks */ typedef struct SDL_joylist_item { - int index; - char *name; - char *mapping; - SDL_JoystickID device_instance; - SDL_Joystick *joystick; - int nbuttons; - int naxes; - double timestamp; - double axis[64]; - double analogButton[64]; - EM_BOOL digitalButton[64]; - - struct SDL_joylist_item *next; + int index; + char *name; + char *mapping; + SDL_JoystickID device_instance; + SDL_Joystick *joystick; + int nbuttons; + int naxes; + double timestamp; + double axis[64]; + double analogButton[64]; + EM_BOOL digitalButton[64]; + + struct SDL_joylist_item *next; } SDL_joylist_item; typedef SDL_joylist_item joystick_hwdata; diff --git a/src/joystick/haiku/SDL_haikujoystick.cc b/src/joystick/haiku/SDL_haikujoystick.cc index cacaf76638fcb..013bff0bbff5a 100644 --- a/src/joystick/haiku/SDL_haikujoystick.cc +++ b/src/joystick/haiku/SDL_haikujoystick.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -66,10 +66,9 @@ extern "C" /* Search for attached joysticks */ nports = joystick.CountDevices(); numjoysticks = 0; - SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport)); - SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname)); - for (i = 0; (numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i) - { + SDL_memset(SDL_joyport, 0, sizeof(SDL_joyport)); + SDL_memset(SDL_joyname, 0, sizeof(SDL_joyname)); + for (i = 0; (numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i) { if (joystick.GetDeviceName(i, name) == B_OK) { if (joystick.Open(name) != B_ERROR) { BString stick_name; @@ -103,6 +102,11 @@ extern "C" return SDL_joyport[device_index]; } + static int HAIKU_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) + { + return -1; + } + static int HAIKU_JoystickGetDevicePlayerIndex(int device_index) { return -1; @@ -300,6 +304,7 @@ extern "C" HAIKU_JoystickDetect, HAIKU_JoystickGetDeviceName, HAIKU_JoystickGetDevicePath, + HAIKU_JoystickGetDeviceSteamVirtualGamepadSlot, HAIKU_JoystickGetDevicePlayerIndex, HAIKU_JoystickSetDevicePlayerIndex, HAIKU_JoystickGetDeviceGUID, diff --git a/src/joystick/hidapi/SDL_hidapi_combined.c b/src/joystick/hidapi/SDL_hidapi_combined.c index df092404ccb82..25000f6410121 100644 --- a/src/joystick/hidapi/SDL_hidapi_combined.c +++ b/src/joystick/hidapi/SDL_hidapi_combined.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,54 +28,47 @@ #include "SDL_hidapijoystick_c.h" #include "../SDL_sysjoystick.h" - -static void -HIDAPI_DriverCombined_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverCombined_RegisterHints(SDL_HintCallback callback, void *userdata) { } -static void -HIDAPI_DriverCombined_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverCombined_UnregisterHints(SDL_HintCallback callback, void *userdata) { } -static SDL_bool -HIDAPI_DriverCombined_IsEnabled(void) +static SDL_bool HIDAPI_DriverCombined_IsEnabled(void) { return SDL_TRUE; } -static SDL_bool -HIDAPI_DriverCombined_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverCombined_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { /* This is always explicitly created for combined devices */ return SDL_FALSE; } -static SDL_bool -HIDAPI_DriverCombined_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverCombined_InitDevice(SDL_HIDAPI_Device *device) { return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverCombined_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverCombined_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverCombined_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverCombined_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverCombined_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverCombined_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { int i; char *serial = NULL, *new_serial; size_t serial_length = 0, new_length; + SDL_AssertJoysticksLocked(); + for (i = 0; i < device->num_children; ++i) { SDL_HIDAPI_Device *child = device->children[i]; if (!child->driver->OpenJoystick(child, joystick)) { @@ -117,8 +110,7 @@ HIDAPI_DriverCombined_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys return SDL_TRUE; } -static int -HIDAPI_DriverCombined_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverCombined_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { int i; int result = -1; @@ -132,8 +124,7 @@ HIDAPI_DriverCombined_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *jo return result; } -static int -HIDAPI_DriverCombined_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverCombined_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { int i; int result = -1; @@ -147,8 +138,7 @@ HIDAPI_DriverCombined_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joys return result; } -static Uint32 -HIDAPI_DriverCombined_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverCombined_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { int i; Uint32 caps = 0; @@ -160,8 +150,7 @@ HIDAPI_DriverCombined_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joy return caps; } -static int -HIDAPI_DriverCombined_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverCombined_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { int i; int result = -1; @@ -175,14 +164,12 @@ HIDAPI_DriverCombined_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *jo return result; } -static int -HIDAPI_DriverCombined_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverCombined_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverCombined_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverCombined_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { int i; int result = -1; @@ -196,8 +183,7 @@ HIDAPI_DriverCombined_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_J return result; } -static SDL_bool -HIDAPI_DriverCombined_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverCombined_UpdateDevice(SDL_HIDAPI_Device *device) { int i; int result = SDL_TRUE; @@ -211,8 +197,7 @@ HIDAPI_DriverCombined_UpdateDevice(SDL_HIDAPI_Device *device) return result; } -static void -HIDAPI_DriverCombined_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverCombined_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { int i; @@ -222,13 +207,11 @@ HIDAPI_DriverCombined_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joy } } -static void -HIDAPI_DriverCombined_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverCombined_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverCombined = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverCombined = { "SDL_JOYSTICK_HIDAPI_COMBINED", SDL_TRUE, HIDAPI_DriverCombined_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_gamecube.c b/src/joystick/hidapi/SDL_hidapi_gamecube.c index 4e68f47b0fd5d..db64518df2f25 100644 --- a/src/joystick/hidapi/SDL_hidapi_gamecube.c +++ b/src/joystick/hidapi/SDL_hidapi_gamecube.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,6 @@ #include "SDL_hidapi_rumble.h" #include "../../hidapi/SDL_hidapi_c.h" - #ifdef SDL_JOYSTICK_HIDAPI_GAMECUBE /* Define this if you want to log all packets from the controller */ @@ -41,63 +40,61 @@ #define MAX_CONTROLLERS 4 -typedef struct { +typedef struct +{ SDL_bool pc_mode; SDL_JoystickID joysticks[MAX_CONTROLLERS]; Uint8 wireless[MAX_CONTROLLERS]; - Uint8 min_axis[MAX_CONTROLLERS*SDL_CONTROLLER_AXIS_MAX]; - Uint8 max_axis[MAX_CONTROLLERS*SDL_CONTROLLER_AXIS_MAX]; + Uint8 min_axis[MAX_CONTROLLERS * SDL_CONTROLLER_AXIS_MAX]; + Uint8 max_axis[MAX_CONTROLLERS * SDL_CONTROLLER_AXIS_MAX]; Uint8 rumbleAllowed[MAX_CONTROLLERS]; - Uint8 rumble[1+MAX_CONTROLLERS]; + Uint8 rumble[1 + MAX_CONTROLLERS]; /* Without this variable, hid_write starts to lag a TON */ SDL_bool rumbleUpdate; SDL_bool m_bUseButtonLabels; SDL_bool useRumbleBrake; } SDL_DriverGameCube_Context; -static void -HIDAPI_DriverGameCube_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverGameCube_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, callback, userdata); } -static void -HIDAPI_DriverGameCube_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverGameCube_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, callback, userdata); } -static SDL_bool -HIDAPI_DriverGameCube_IsEnabled(void) +static SDL_bool HIDAPI_DriverGameCube_IsEnabled(void) { return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, + SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverGameCube_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverGameCube_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { if (vendor_id == USB_VENDOR_NINTENDO && product_id == USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER) { /* Nintendo Co., Ltd. Wii U GameCube Controller Adapter */ return SDL_TRUE; } - if (vendor_id == USB_VENDOR_DRAGONRISE && product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER) { + if (vendor_id == USB_VENDOR_DRAGONRISE && + (product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1 || + product_id == USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2)) { /* EVORETRO GameCube Controller Adapter */ return SDL_TRUE; } return SDL_FALSE; } -static void -ResetAxisRange(SDL_DriverGameCube_Context *ctx, int joystick_index) +static void ResetAxisRange(SDL_DriverGameCube_Context *ctx, int joystick_index) { - SDL_memset(&ctx->min_axis[joystick_index*SDL_CONTROLLER_AXIS_MAX], 128-88, SDL_CONTROLLER_AXIS_MAX); - SDL_memset(&ctx->max_axis[joystick_index*SDL_CONTROLLER_AXIS_MAX], 128+88, SDL_CONTROLLER_AXIS_MAX); + SDL_memset(&ctx->min_axis[joystick_index * SDL_CONTROLLER_AXIS_MAX], 128 - 88, SDL_CONTROLLER_AXIS_MAX); + SDL_memset(&ctx->max_axis[joystick_index * SDL_CONTROLLER_AXIS_MAX], 128 + 88, SDL_CONTROLLER_AXIS_MAX); /* Trigger axes may have a higher resting value */ - ctx->min_axis[joystick_index*SDL_CONTROLLER_AXIS_MAX+SDL_CONTROLLER_AXIS_TRIGGERLEFT] = 40; - ctx->min_axis[joystick_index*SDL_CONTROLLER_AXIS_MAX+SDL_CONTROLLER_AXIS_TRIGGERRIGHT] = 40; + ctx->min_axis[joystick_index * SDL_CONTROLLER_AXIS_MAX + SDL_CONTROLLER_AXIS_TRIGGERLEFT] = 40; + ctx->min_axis[joystick_index * SDL_CONTROLLER_AXIS_MAX + SDL_CONTROLLER_AXIS_TRIGGERRIGHT] = 40; } static void SDLCALL SDL_GameControllerButtonReportingHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) @@ -130,8 +127,7 @@ static Uint8 RemapButton(SDL_DriverGameCube_Context *ctx, Uint8 button) return button; } -static SDL_bool -HIDAPI_DriverGameCube_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverGameCube_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverGameCube_Context *ctx; Uint8 packet[37]; @@ -194,7 +190,7 @@ HIDAPI_DriverGameCube_InitDevice(SDL_HIDAPI_Device *device) ctx->wireless[i] = (curSlot[0] & 0x20) != 0; /* Only allow rumble if the adapter's second USB cable is connected */ - ctx->rumbleAllowed[i] = (curSlot[0] & 0x04) != 0 && !ctx->wireless[i]; + ctx->rumbleAllowed[i] = (curSlot[0] & 0x04) && !ctx->wireless[i]; if (curSlot[0] & 0x30) { /* 0x10 - Wired, 0x20 - Wireless */ if (ctx->joysticks[i] == -1) { @@ -222,8 +218,7 @@ HIDAPI_DriverGameCube_InitDevice(SDL_HIDAPI_Device *device) return SDL_TRUE; } -static int -HIDAPI_DriverGameCube_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverGameCube_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; Uint8 i; @@ -236,13 +231,11 @@ HIDAPI_DriverGameCube_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joysti return -1; } -static void -HIDAPI_DriverGameCube_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverGameCube_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static void -HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device, SDL_DriverGameCube_Context *ctx, Uint8 *packet, int size) +static void HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device, SDL_DriverGameCube_Context *ctx, const Uint8 *packet, int size) { SDL_Joystick *joystick; Uint8 i, v; @@ -263,12 +256,11 @@ HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device, SDL_Driver return; } - #define READ_BUTTON(off, flag, button) \ - SDL_PrivateJoystickButton( \ - joystick, \ - RemapButton(ctx, button), \ - (packet[off] & flag) ? SDL_PRESSED : SDL_RELEASED \ - ); +#define READ_BUTTON(off, flag, button) \ + SDL_PrivateJoystickButton( \ + joystick, \ + RemapButton(ctx, button), \ + (packet[off] & flag) ? SDL_PRESSED : SDL_RELEASED); READ_BUTTON(1, 0x02, 0) /* A */ READ_BUTTON(1, 0x04, 1) /* B */ READ_BUTTON(1, 0x01, 2) /* X */ @@ -285,28 +277,28 @@ HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device, SDL_Driver */ READ_BUTTON(1, 0x20, 10) /* TRIGGERRIGHT */ READ_BUTTON(1, 0x10, 11) /* TRIGGERLEFT */ - #undef READ_BUTTON - - #define READ_AXIS(off, axis, invert) \ - v = invert ? (0xff - packet[off]) : packet[off]; \ - if (v < ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis]) ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis] = v; \ - if (v > ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis]) ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis] = v; \ - axis_value = (Sint16)HIDAPI_RemapVal(v, ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis], ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis], SDL_MIN_SINT16, SDL_MAX_SINT16); \ - SDL_PrivateJoystickAxis( \ - joystick, \ - axis, axis_value \ - ); +#undef READ_BUTTON + +#define READ_AXIS(off, axis, invert) \ + v = invert ? (0xff - packet[off]) : packet[off]; \ + if (v < ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis]) \ + ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis] = v; \ + if (v > ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis]) \ + ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis] = v; \ + axis_value = (Sint16)HIDAPI_RemapVal(v, ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis], ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis], SDL_MIN_SINT16, SDL_MAX_SINT16); \ + SDL_PrivateJoystickAxis( \ + joystick, \ + axis, axis_value); READ_AXIS(3, SDL_CONTROLLER_AXIS_LEFTX, 0) - READ_AXIS(4, SDL_CONTROLLER_AXIS_LEFTY, 0) - READ_AXIS(6, SDL_CONTROLLER_AXIS_RIGHTX, 1) + READ_AXIS(4, SDL_CONTROLLER_AXIS_LEFTY, 1) + READ_AXIS(6, SDL_CONTROLLER_AXIS_RIGHTX, 0) READ_AXIS(5, SDL_CONTROLLER_AXIS_RIGHTY, 1) READ_AXIS(7, SDL_CONTROLLER_AXIS_TRIGGERLEFT, 0) READ_AXIS(8, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, 0) - #undef READ_AXIS +#undef READ_AXIS } -static void -HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_DriverGameCube_Context *ctx, Uint8 *packet, int size) +static void HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_DriverGameCube_Context *ctx, Uint8 *packet, int size) { SDL_Joystick *joystick; Uint8 *curSlot; @@ -323,7 +315,7 @@ HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_Driver ctx->wireless[i] = (curSlot[0] & 0x20) != 0; /* Only allow rumble if the adapter's second USB cable is connected */ - ctx->rumbleAllowed[i] = (curSlot[0] & 0x04) != 0 && !ctx->wireless[i]; + ctx->rumbleAllowed[i] = (curSlot[0] & 0x04) && !ctx->wireless[i]; if (curSlot[0] & 0x30) { /* 0x10 - Wired, 0x20 - Wireless */ if (ctx->joysticks[i] == -1) { @@ -333,7 +325,7 @@ HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_Driver joystick = SDL_JoystickFromInstanceID(ctx->joysticks[i]); /* Hasn't been opened yet, skip */ - if (joystick == NULL) { + if (!joystick) { continue; } } else { @@ -344,15 +336,14 @@ HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_Driver continue; } - #define READ_BUTTON(off, flag, button) \ - SDL_PrivateJoystickButton( \ - joystick, \ - RemapButton(ctx, button), \ - (curSlot[off] & flag) ? SDL_PRESSED : SDL_RELEASED \ - ); +#define READ_BUTTON(off, flag, button) \ + SDL_PrivateJoystickButton( \ + joystick, \ + RemapButton(ctx, button), \ + (curSlot[off] & flag) ? SDL_PRESSED : SDL_RELEASED); READ_BUTTON(1, 0x01, 0) /* A */ - READ_BUTTON(1, 0x04, 1) /* B */ - READ_BUTTON(1, 0x02, 2) /* X */ + READ_BUTTON(1, 0x02, 1) /* B */ + READ_BUTTON(1, 0x04, 2) /* X */ READ_BUTTON(1, 0x08, 3) /* Y */ READ_BUTTON(1, 0x10, 4) /* DPAD_LEFT */ READ_BUTTON(1, 0x20, 5) /* DPAD_RIGHT */ @@ -366,28 +357,28 @@ HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device, SDL_Driver */ READ_BUTTON(2, 0x04, 10) /* TRIGGERRIGHT */ READ_BUTTON(2, 0x08, 11) /* TRIGGERLEFT */ - #undef READ_BUTTON - - #define READ_AXIS(off, axis) \ - if (curSlot[off] < ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis]) ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis] = curSlot[off]; \ - if (curSlot[off] > ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis]) ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis] = curSlot[off]; \ - axis_value = (Sint16)HIDAPI_RemapVal(curSlot[off], ctx->min_axis[i*SDL_CONTROLLER_AXIS_MAX+axis], ctx->max_axis[i*SDL_CONTROLLER_AXIS_MAX+axis], SDL_MIN_SINT16, SDL_MAX_SINT16); \ - SDL_PrivateJoystickAxis( \ - joystick, \ - axis, axis_value \ - ); +#undef READ_BUTTON + +#define READ_AXIS(off, axis) \ + if (curSlot[off] < ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis]) \ + ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis] = curSlot[off]; \ + if (curSlot[off] > ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis]) \ + ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis] = curSlot[off]; \ + axis_value = (Sint16)HIDAPI_RemapVal(curSlot[off], ctx->min_axis[i * SDL_CONTROLLER_AXIS_MAX + axis], ctx->max_axis[i * SDL_CONTROLLER_AXIS_MAX + axis], SDL_MIN_SINT16, SDL_MAX_SINT16); \ + SDL_PrivateJoystickAxis( \ + joystick, \ + axis, axis_value); READ_AXIS(3, SDL_CONTROLLER_AXIS_LEFTX) READ_AXIS(4, SDL_CONTROLLER_AXIS_LEFTY) READ_AXIS(5, SDL_CONTROLLER_AXIS_RIGHTX) READ_AXIS(6, SDL_CONTROLLER_AXIS_RIGHTY) READ_AXIS(7, SDL_CONTROLLER_AXIS_TRIGGERLEFT) READ_AXIS(8, SDL_CONTROLLER_AXIS_TRIGGERRIGHT) - #undef READ_AXIS +#undef READ_AXIS } } -static SDL_bool -HIDAPI_DriverGameCube_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverGameCube_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; Uint8 packet[USB_PACKET_LENGTH]; @@ -396,7 +387,7 @@ HIDAPI_DriverGameCube_UpdateDevice(SDL_HIDAPI_Device *device) /* Read input packet */ while ((size = SDL_hid_read_timeout(device->dev, packet, sizeof(packet), 0)) > 0) { #ifdef DEBUG_GAMECUBE_PROTOCOL - //HIDAPI_DumpPacket("Nintendo GameCube packet: size = %d", packet, size); + HIDAPI_DumpPacket("Nintendo GameCube packet: size = %d", packet, size); #endif if (ctx->pc_mode) { HIDAPI_DriverGameCube_HandleJoystickPacket(device, ctx, packet, size); @@ -415,11 +406,13 @@ HIDAPI_DriverGameCube_UpdateDevice(SDL_HIDAPI_Device *device) return SDL_TRUE; } -static SDL_bool -HIDAPI_DriverGameCube_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverGameCube_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; Uint8 i; + + SDL_AssertJoysticksLocked(); + for (i = 0; i < MAX_CONTROLLERS; i += 1) { if (joystick->instance_id == ctx->joysticks[i]) { joystick->nbuttons = 12; @@ -431,12 +424,13 @@ HIDAPI_DriverGameCube_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys return SDL_FALSE; /* Should never get here! */ } -static int -HIDAPI_DriverGameCube_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverGameCube_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; Uint8 i, val; + SDL_AssertJoysticksLocked(); + if (ctx->pc_mode) { return SDL_Unsupported(); } @@ -472,18 +466,18 @@ HIDAPI_DriverGameCube_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *jo return SDL_SetError("Couldn't find joystick"); } -static int -HIDAPI_DriverGameCube_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverGameCube_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverGameCube_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverGameCube_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; Uint32 result = 0; + SDL_AssertJoysticksLocked(); + if (!ctx->pc_mode) { Uint8 i; @@ -500,26 +494,22 @@ HIDAPI_DriverGameCube_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joy return result; } -static int -HIDAPI_DriverGameCube_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverGameCube_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverGameCube_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverGameCube_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverGameCube_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverGameCube_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverGameCube_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverGameCube_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; @@ -530,8 +520,7 @@ HIDAPI_DriverGameCube_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joy } } -static void -HIDAPI_DriverGameCube_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverGameCube_FreeDevice(SDL_HIDAPI_Device *device) { SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context; @@ -541,8 +530,7 @@ HIDAPI_DriverGameCube_FreeDevice(SDL_HIDAPI_Device *device) SDL_JoystickGameCubeRumbleBrakeHintChanged, ctx); } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameCube = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameCube = { SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, SDL_TRUE, HIDAPI_DriverGameCube_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_luna.c b/src/joystick/hidapi/SDL_hidapi_luna.c index c9cd2810e768f..811b0a6eadece 100644 --- a/src/joystick/hidapi/SDL_hidapi_luna.c +++ b/src/joystick/hidapi/SDL_hidapi_luna.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,6 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_LUNA /* Define this if you want to log all packets from the controller */ @@ -46,39 +45,32 @@ enum SDL_CONTROLLER_NUM_LUNA_BUTTONS, }; -typedef struct { +typedef struct +{ Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverLuna_Context; - -static void -HIDAPI_DriverLuna_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverLuna_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LUNA, callback, userdata); } -static void -HIDAPI_DriverLuna_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverLuna_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LUNA, callback, userdata); } -static SDL_bool -HIDAPI_DriverLuna_IsEnabled(void) +static SDL_bool HIDAPI_DriverLuna_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_LUNA, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_LUNA, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverLuna_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverLuna_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { return (type == SDL_CONTROLLER_TYPE_AMAZON_LUNA) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverLuna_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverLuna_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverLuna_Context *ctx; @@ -95,22 +87,21 @@ HIDAPI_DriverLuna_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverLuna_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverLuna_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverLuna_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverLuna_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverLuna_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverLuna_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverLuna_Context *ctx = (SDL_DriverLuna_Context *)device->context; + SDL_AssertJoysticksLocked(); + SDL_zeroa(ctx->last_state); /* Initialize the joystick capabilities */ @@ -121,8 +112,7 @@ HIDAPI_DriverLuna_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick return SDL_TRUE; } -static int -HIDAPI_DriverLuna_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverLuna_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { #ifdef ENABLE_LUNA_BLUETOOTH_RUMBLE if (device->product_id == BLUETOOTH_PRODUCT_LUNA_CONTROLLER) { @@ -141,18 +131,16 @@ HIDAPI_DriverLuna_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti } #endif /* ENABLE_LUNA_BLUETOOTH_RUMBLE */ - /* There is currently no rumble packet over USB */ - return SDL_Unsupported(); + /* There is currently no rumble packet over USB */ + return SDL_Unsupported(); } -static int -HIDAPI_DriverLuna_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverLuna_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverLuna_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverLuna_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { Uint32 result = 0; @@ -165,26 +153,22 @@ HIDAPI_DriverLuna_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystic return result; } -static int -HIDAPI_DriverLuna_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverLuna_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverLuna_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverLuna_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverLuna_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverLuna_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverLuna_HandleUSBStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverLuna_HandleUSBStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Context *ctx, Uint8 *data, int size) { if (ctx->last_state[1] != data[1]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); @@ -248,8 +232,7 @@ HIDAPI_DriverLuna_HandleUSBStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Co } #define READ_STICK_AXIS(offset) \ - (data[offset] == 0x7f ? 0 : \ - (Sint16)HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16)) + (data[offset] == 0x7f ? 0 : (Sint16)HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16)) { Sint16 axis = READ_STICK_AXIS(4); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -263,7 +246,7 @@ HIDAPI_DriverLuna_HandleUSBStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Co #undef READ_STICK_AXIS #define READ_TRIGGER_AXIS(offset) \ - (Sint16)HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16) + (Sint16) HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16) { Sint16 axis = READ_TRIGGER_AXIS(8); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); @@ -275,8 +258,7 @@ HIDAPI_DriverLuna_HandleUSBStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Co SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static void -HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverLuna_Context *ctx, Uint8 *data, int size) { if (size >= 2 && data[0] == 0x02) { /* Home button has dedicated report */ @@ -289,14 +271,11 @@ HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverL int level = data[1] * 100 / 0xFF; if (level == 0) { SDL_PrivateJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_EMPTY); - } - else if (level <= 20) { + } else if (level <= 20) { SDL_PrivateJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_LOW); - } - else if (level <= 70) { + } else if (level <= 70) { SDL_PrivateJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_MEDIUM); - } - else { + } else { SDL_PrivateJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_FULL); } @@ -371,8 +350,7 @@ HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverL } #define READ_STICK_AXIS(offset) \ - (data[offset] == 0x7f ? 0 : \ - (Sint16)HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16)) + (data[offset] == 0x7f ? 0 : (Sint16)HIDAPI_RemapVal((float)data[offset], 0x00, 0xff, SDL_MIN_SINT16, SDL_MAX_SINT16)) { Sint16 axis = READ_STICK_AXIS(2); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -386,7 +364,7 @@ HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverL #undef READ_STICK_AXIS #define READ_TRIGGER_AXIS(offset) \ - (Sint16)HIDAPI_RemapVal((float)((int)(((data[offset] | (data[offset + 1] << 8)) & 0x3ff) - 0x200)), 0x00 - 0x200, 0x3ff - 0x200, SDL_MIN_SINT16, SDL_MAX_SINT16) + (Sint16) HIDAPI_RemapVal((float)((int)(((data[offset] | (data[offset + 1] << 8)) & 0x3ff) - 0x200)), 0x00 - 0x200, 0x3ff - 0x200, SDL_MIN_SINT16, SDL_MAX_SINT16) { Sint16 axis = READ_TRIGGER_AXIS(9); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); @@ -398,8 +376,7 @@ HIDAPI_DriverLuna_HandleBluetoothStatePacket(SDL_Joystick *joystick, SDL_DriverL SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverLuna_Context *ctx = (SDL_DriverLuna_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -434,21 +411,18 @@ HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverLuna_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverLuna_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { } -static void -HIDAPI_DriverLuna_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverLuna_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverLuna = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverLuna = { SDL_HINT_JOYSTICK_HIDAPI_LUNA, SDL_TRUE, HIDAPI_DriverLuna_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_nintendo.h b/src/joystick/hidapi/SDL_hidapi_nintendo.h index e95d5b4af1d83..4247828331cec 100644 --- a/src/joystick/hidapi/SDL_hidapi_nintendo.h +++ b/src/joystick/hidapi/SDL_hidapi_nintendo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,25 +22,30 @@ /* These are values used in the controller type byte of the controller GUID */ /* These values come directly out of the hardware, so don't change them */ -typedef enum { - k_eSwitchDeviceInfoControllerType_Unknown = 0, - k_eSwitchDeviceInfoControllerType_JoyConLeft = 1, - k_eSwitchDeviceInfoControllerType_JoyConRight = 2, - k_eSwitchDeviceInfoControllerType_ProController = 3, - k_eSwitchDeviceInfoControllerType_NESLeft = 9, - k_eSwitchDeviceInfoControllerType_NESRight = 10, - k_eSwitchDeviceInfoControllerType_SNES = 11, - k_eSwitchDeviceInfoControllerType_N64 = 12, - k_eSwitchDeviceInfoControllerType_SEGA_Genesis = 13, +typedef enum +{ + k_eSwitchDeviceInfoControllerType_Unknown = 0, + k_eSwitchDeviceInfoControllerType_JoyConLeft = 1, + k_eSwitchDeviceInfoControllerType_JoyConRight = 2, + k_eSwitchDeviceInfoControllerType_ProController = 3, + k_eSwitchDeviceInfoControllerType_LicProController = 6, + k_eSwitchDeviceInfoControllerType_HVCLeft = 7, + k_eSwitchDeviceInfoControllerType_HVCRight = 8, + k_eSwitchDeviceInfoControllerType_NESLeft = 9, + k_eSwitchDeviceInfoControllerType_NESRight = 10, + k_eSwitchDeviceInfoControllerType_SNES = 11, + k_eSwitchDeviceInfoControllerType_N64 = 12, + k_eSwitchDeviceInfoControllerType_SEGA_Genesis = 13, } ESwitchDeviceInfoControllerType; /* These values are used internally but can be updated as needed */ -typedef enum { - k_eWiiExtensionControllerType_Unknown = 0, - k_eWiiExtensionControllerType_None = 128, - k_eWiiExtensionControllerType_Nunchuk = 129, - k_eWiiExtensionControllerType_Gamepad = 130, - k_eWiiExtensionControllerType_WiiUPro = 131, +typedef enum +{ + k_eWiiExtensionControllerType_Unknown = 0, + k_eWiiExtensionControllerType_None = 128, + k_eWiiExtensionControllerType_Nunchuk = 129, + k_eWiiExtensionControllerType_Gamepad = 130, + k_eWiiExtensionControllerType_WiiUPro = 131, } EWiiExtensionControllerType; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/hidapi/SDL_hidapi_ps3.c b/src/joystick/hidapi/SDL_hidapi_ps3.c index 10e3bc548f457..61a242f1eff68 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps3.c +++ b/src/joystick/hidapi/SDL_hidapi_ps3.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,13 +32,12 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_PS3 /* Define this if you want to log all packets from the controller */ /*#define DEBUG_PS3_PROTOCOL*/ -#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) +#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) typedef enum { @@ -46,10 +45,12 @@ typedef enum k_EPS3ReportIdEffects = 1, } EPS3ReportId; -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; SDL_bool is_shanwan; + SDL_bool has_analog_buttons; SDL_bool report_sensors; SDL_bool effects_updated; int player_index; @@ -58,23 +59,19 @@ typedef struct { Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverPS3_Context; - static int HIDAPI_DriverPS3_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size); -static void -HIDAPI_DriverPS3_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS3_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3, callback, userdata); } -static void -HIDAPI_DriverPS3_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS3_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3, callback, userdata); } -static SDL_bool -HIDAPI_DriverPS3_IsEnabled(void) +static SDL_bool HIDAPI_DriverPS3_IsEnabled(void) { SDL_bool default_value; @@ -105,8 +102,7 @@ HIDAPI_DriverPS3_IsEnabled(void) return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, default_value); } -static SDL_bool -HIDAPI_DriverPS3_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverPS3_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { if (vendor_id == USB_VENDOR_SONY && product_id == USB_PRODUCT_SONY_DS3) { return SDL_TRUE; @@ -129,8 +125,7 @@ static int SendFeatureReport(SDL_hid_device *dev, Uint8 *report, size_t length) return SDL_hid_send_feature_report(dev, report, length); } -static SDL_bool -HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS3_Context *ctx; SDL_bool is_shanwan = SDL_FALSE; @@ -151,6 +146,7 @@ HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) } ctx->device = device; ctx->is_shanwan = is_shanwan; + ctx->has_analog_buttons = SDL_TRUE; device->context = ctx; @@ -164,9 +160,9 @@ HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) /* Set the controller into report mode over USB */ { Uint8 data[USB_PACKET_LENGTH]; - int size; - if ((size = ReadFeatureReport(device->dev, 0xf2, data, 17)) < 0) { + int size = ReadFeatureReport(device->dev, 0xf2, data, 17); + if (size < 0) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI_DriverPS3_InitDevice(): Couldn't read feature report 0xf2"); return SDL_FALSE; @@ -174,7 +170,8 @@ HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) #ifdef DEBUG_PS3_PROTOCOL HIDAPI_DumpPacket("PS3 0xF2 packet: size = %d", data, size); #endif - if ((size = ReadFeatureReport(device->dev, 0xf5, data, 8)) < 0) { + size = ReadFeatureReport(device->dev, 0xf5, data, 8); + if (size < 0) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI_DriverPS3_InitDevice(): Couldn't read feature report 0xf5"); return SDL_FALSE; @@ -194,14 +191,12 @@ HIDAPI_DriverPS3_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverPS3_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverPS3_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static int -HIDAPI_DriverPS3_UpdateEffects(SDL_HIDAPI_Device *device) +static int HIDAPI_DriverPS3_UpdateEffects(SDL_HIDAPI_Device *device) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; @@ -218,13 +213,12 @@ HIDAPI_DriverPS3_UpdateEffects(SDL_HIDAPI_Device *device) effects[2] = ctx->rumble_right ? 1 : 0; effects[4] = ctx->rumble_left; - effects[9] = (0x01 << (1+(ctx->player_index % 4))); + effects[9] = (0x01 << (1 + (ctx->player_index % 4))); return HIDAPI_DriverPS3_SendJoystickEffect(device, ctx->joystick, effects, sizeof(effects)); } -static void -HIDAPI_DriverPS3_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverPS3_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; @@ -238,11 +232,12 @@ HIDAPI_DriverPS3_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID HIDAPI_DriverPS3_UpdateEffects(device); } -static SDL_bool -HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->joystick = joystick; ctx->effects_updated = SDL_FALSE; ctx->rumble_left = 0; @@ -254,7 +249,10 @@ HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) /* Initialize the joystick capabilities */ joystick->nbuttons = 15; - joystick->naxes = 16; + joystick->naxes = 6; + if (ctx->has_analog_buttons) { + joystick->naxes += 10; + } joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED; SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 100.0f); @@ -262,8 +260,7 @@ HIDAPI_DriverPS3_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) return SDL_TRUE; } -static int -HIDAPI_DriverPS3_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverPS3_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; @@ -273,26 +270,22 @@ HIDAPI_DriverPS3_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return HIDAPI_DriverPS3_UpdateEffects(device); } -static int -HIDAPI_DriverPS3_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverPS3_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverPS3_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverPS3_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { return SDL_JOYCAP_RUMBLE; } -static int -HIDAPI_DriverPS3_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverPS3_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverPS3_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) +static int HIDAPI_DriverPS3_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) { Uint8 data[49]; int report_size, offset; @@ -310,8 +303,7 @@ HIDAPI_DriverPS3_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy return 0; } -static int -HIDAPI_DriverPS3_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverPS3_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; @@ -320,16 +312,14 @@ HIDAPI_DriverPS3_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joysti return 0; } -static float -HIDAPI_DriverPS3_ScaleAccel(Sint16 value) +static float HIDAPI_DriverPS3_ScaleAccel(Sint16 value) { /* Accelerometer values are in big endian order */ value = SDL_SwapBE16(value); - return (float)(value - 511) / 113.0f; + return ((float)(value - 511) / 113.0f) * SDL_STANDARD_GRAVITY; } -static void -HIDAPI_DriverPS3_HandleMiniStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverPS3_HandleMiniStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) { Sint16 axis; @@ -405,8 +395,7 @@ HIDAPI_DriverPS3_HandleMiniStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Con SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static void -HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) { Sint16 axis; @@ -448,7 +437,7 @@ HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); /* Buttons are mapped as axes in the order they appear in the button enumeration */ - { + if (ctx->has_analog_buttons) { static int button_axis_offsets[] = { 24, /* SDL_CONTROLLER_BUTTON_A */ 23, /* SDL_CONTROLLER_BUTTON_B */ @@ -493,8 +482,7 @@ HIDAPI_DriverPS3_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -553,24 +541,21 @@ HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverPS3_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS3_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; ctx->joystick = NULL; } -static void -HIDAPI_DriverPS3_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS3_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3 = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3 = { SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_TRUE, HIDAPI_DriverPS3_RegisterHints, @@ -592,29 +577,28 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3 = HIDAPI_DriverPS3_FreeDevice, }; - -static SDL_bool -HIDAPI_DriverPS3ThirdParty_IsEnabled(void) +static SDL_bool HIDAPI_DriverPS3ThirdParty_IsEnabled(void) { -#if 1 /* Not enabled by default, we don't know what the L3/R3 buttons are */ - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_FALSE); -#else return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); -#endif + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, + SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverPS3ThirdParty_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverPS3ThirdParty_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { Uint8 data[USB_PACKET_LENGTH]; int size; - if (SONY_THIRDPARTY_VENDOR(vendor_id)) { - if (device) { - if ((size = ReadFeatureReport(device->dev, 0x03, data, sizeof(data))) == 8 && - data[2] == 0x26) { + if (vendor_id == USB_VENDOR_LOGITECH && + product_id == USB_PRODUCT_LOGITECH_CHILLSTREAM) { + return SDL_TRUE; + } + + if ((type == SDL_CONTROLLER_TYPE_PS3 && vendor_id != USB_VENDOR_SONY) || + HIDAPI_SupportsPlaystationDetection(vendor_id, product_id)) { + if (device && device->dev) { + size = ReadFeatureReport(device->dev, 0x03, data, sizeof(data)); + if (size == 8 && data[2] == 0x26) { /* Supported third party controller */ return SDL_TRUE; } else { @@ -628,8 +612,7 @@ HIDAPI_DriverPS3ThirdParty_IsSupportedDevice(SDL_HIDAPI_Device *device, const ch return SDL_FALSE; } -static SDL_bool -HIDAPI_DriverPS3ThirdParty_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS3ThirdParty_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS3_Context *ctx; @@ -639,79 +622,90 @@ HIDAPI_DriverPS3ThirdParty_InitDevice(SDL_HIDAPI_Device *device) return SDL_FALSE; } ctx->device = device; + if (device->vendor_id == USB_VENDOR_SWITCH && device->product_id == USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER) { + ctx->has_analog_buttons = SDL_FALSE; + } else { + ctx->has_analog_buttons = SDL_TRUE; + } device->context = ctx; device->type = SDL_CONTROLLER_TYPE_PS3; + if (device->vendor_id == USB_VENDOR_LOGITECH && + device->product_id == USB_PRODUCT_LOGITECH_CHILLSTREAM) { + HIDAPI_SetDeviceName(device, "Logitech ChillStream"); + } + return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverPS3ThirdParty_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverPS3ThirdParty_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverPS3ThirdParty_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverPS3ThirdParty_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverPS3ThirdParty_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverPS3ThirdParty_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->joystick = joystick; SDL_zeroa(ctx->last_state); /* Initialize the joystick capabilities */ joystick->nbuttons = 15; - joystick->naxes = 16; - joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED; + joystick->naxes = 6; + if (ctx->has_analog_buttons) { + joystick->naxes += 10; + } + + if (device->vendor_id == USB_VENDOR_SWITCH && device->product_id == USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER) { + // This is a wireless controller using a USB dongle + joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN; + } else { + joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED; + } return SDL_TRUE; } -static int -HIDAPI_DriverPS3ThirdParty_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverPS3ThirdParty_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -HIDAPI_DriverPS3ThirdParty_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverPS3ThirdParty_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverPS3ThirdParty_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverPS3ThirdParty_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { return 0; } -static int -HIDAPI_DriverPS3ThirdParty_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverPS3ThirdParty_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverPS3ThirdParty_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) +static int HIDAPI_DriverPS3ThirdParty_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverPS3ThirdParty_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverPS3ThirdParty_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverPS3ThirdParty_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) { Sint16 axis; @@ -725,18 +719,17 @@ HIDAPI_DriverPS3ThirdParty_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverP } if (ctx->last_state[1] != data[1]) { - SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); - SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[1] & 0x02) ? SDL_PRESSED : SDL_RELEASED); - SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data[1] & 0x10) ? SDL_PRESSED : SDL_RELEASED); - } - - if (ctx->last_state[2] != data[2]) { SDL_bool dpad_up = SDL_FALSE; SDL_bool dpad_down = SDL_FALSE; SDL_bool dpad_left = SDL_FALSE; SDL_bool dpad_right = SDL_FALSE; - switch (data[2] & 0x0f) { + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[1] & 0x02) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, (data[1] & 0x04) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSTICK, (data[1] & 0x08) ? SDL_PRESSED : SDL_RELEASED); + + switch (data[1] >> 4) { case 0: dpad_up = SDL_TRUE; break; @@ -774,9 +767,140 @@ HIDAPI_DriverPS3ThirdParty_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverP SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, dpad_left); } + axis = ((int)data[16] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); axis = ((int)data[17] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); + axis = ((int)data[2] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); + axis = ((int)data[3] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis); + axis = ((int)data[4] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis); + axis = ((int)data[5] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); + + /* Buttons are mapped as axes in the order they appear in the button enumeration */ + if (ctx->has_analog_buttons) { + static int button_axis_offsets[] = { + 12, /* SDL_GAMEPAD_BUTTON_A */ + 11, /* SDL_GAMEPAD_BUTTON_B */ + 13, /* SDL_GAMEPAD_BUTTON_X */ + 10, /* SDL_GAMEPAD_BUTTON_Y */ + 0, /* SDL_GAMEPAD_BUTTON_BACK */ + 0, /* SDL_GAMEPAD_BUTTON_GUIDE */ + 0, /* SDL_GAMEPAD_BUTTON_START */ + 0, /* SDL_GAMEPAD_BUTTON_LEFT_STICK */ + 0, /* SDL_GAMEPAD_BUTTON_RIGHT_STICK */ + 14, /* SDL_GAMEPAD_BUTTON_LEFT_SHOULDER */ + 15, /* SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER */ + 8, /* SDL_GAMEPAD_BUTTON_DPAD_UP */ + 9, /* SDL_GAMEPAD_BUTTON_DPAD_DOWN */ + 7, /* SDL_GAMEPAD_BUTTON_DPAD_LEFT */ + 6, /* SDL_GAMEPAD_BUTTON_DPAD_RIGHT */ + }; + int i, axis_index = 6; + + for (i = 0; i < SDL_arraysize(button_axis_offsets); ++i) { + int offset = button_axis_offsets[i]; + if (!offset) { + /* This button doesn't report as an axis */ + continue; + } + + axis = ((int)data[offset] * 257) - 32768; + SDL_PrivateJoystickAxis(joystick, axis_index, axis); + ++axis_index; + } + } + + SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); +} + +static void HIDAPI_DriverPS3ThirdParty_HandleStatePacket19(SDL_Joystick *joystick, SDL_DriverPS3_Context *ctx, Uint8 *data, int size) +{ + Sint16 axis; + + if (ctx->last_state[0] != data[0]) { + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_X, (data[0] & 0x01) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, (data[0] & 0x02) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_B, (data[0] & 0x04) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_Y, (data[0] & 0x08) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, (data[0] & 0x10) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, (data[0] & 0x20) ? SDL_PRESSED : SDL_RELEASED); + } + + if (ctx->last_state[1] != data[1]) { + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[1] & 0x02) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, (data[1] & 0x04) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSTICK, (data[1] & 0x08) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data[1] & 0x10) ? SDL_PRESSED : SDL_RELEASED); + } + + if (ctx->device->vendor_id == USB_VENDOR_SAITEK && ctx->device->product_id == USB_PRODUCT_SAITEK_CYBORG_V3) { + /* Cyborg V.3 Rumble Pad doesn't set the dpad bits as expected, so use the axes instead */ + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_DOWN, data[10] ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_UP, data[9] ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, data[7] ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, data[8] ? SDL_PRESSED : SDL_RELEASED); + } else { + if (ctx->last_state[2] != data[2]) { + SDL_bool dpad_up = SDL_FALSE; + SDL_bool dpad_down = SDL_FALSE; + SDL_bool dpad_left = SDL_FALSE; + SDL_bool dpad_right = SDL_FALSE; + + switch (data[2] & 0x0f) { + case 0: + dpad_up = SDL_TRUE; + break; + case 1: + dpad_up = SDL_TRUE; + dpad_right = SDL_TRUE; + break; + case 2: + dpad_right = SDL_TRUE; + break; + case 3: + dpad_right = SDL_TRUE; + dpad_down = SDL_TRUE; + break; + case 4: + dpad_down = SDL_TRUE; + break; + case 5: + dpad_left = SDL_TRUE; + dpad_down = SDL_TRUE; + break; + case 6: + dpad_left = SDL_TRUE; + break; + case 7: + dpad_up = SDL_TRUE; + dpad_left = SDL_TRUE; + break; + default: + break; + } + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_DOWN, dpad_down); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_UP, dpad_up); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, dpad_right); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, dpad_left); + } + } + + if (data[0] & 0x40) { + axis = 32767; + } else { + axis = ((int)data[17] * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); - axis = ((int)data[18] * 257) - 32768; + if (data[0] & 0x80) { + axis = 32767; + } else { + axis = ((int)data[18] * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); axis = ((int)data[3] * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -788,7 +912,7 @@ HIDAPI_DriverPS3ThirdParty_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverP SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); /* Buttons are mapped as axes in the order they appear in the button enumeration */ - { + if (ctx->has_analog_buttons) { static int button_axis_offsets[] = { 13, /* SDL_CONTROLLER_BUTTON_A */ 12, /* SDL_CONTROLLER_BUTTON_B */ @@ -824,8 +948,7 @@ HIDAPI_DriverPS3ThirdParty_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverP SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -846,8 +969,11 @@ HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device) continue; } - if (size == 27) { - HIDAPI_DriverPS3ThirdParty_HandleStatePacket(joystick, ctx, data, size); + if (size >= 19) { + HIDAPI_DriverPS3ThirdParty_HandleStatePacket19(joystick, ctx, data, size); + } else if (size == 18) { + /* This packet format was seen with the Logitech ChillStream */ + HIDAPI_DriverPS3ThirdParty_HandleStatePacket18(joystick, ctx, data, size); } else { #ifdef DEBUG_JOYSTICK SDL_Log("Unknown PS3 packet, size %d\n", size); @@ -859,24 +985,21 @@ HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverPS3ThirdParty_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS3ThirdParty_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS3_Context *ctx = (SDL_DriverPS3_Context *)device->context; ctx->joystick = NULL; } -static void -HIDAPI_DriverPS3ThirdParty_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS3ThirdParty_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3ThirdParty = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS3ThirdParty = { SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_TRUE, HIDAPI_DriverPS3_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index 63d720df50cea..fd38dc98a2d90 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,7 +34,6 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_PS4 /* Define this if you want to log all packets from the controller */ @@ -43,14 +42,12 @@ /* Define this if you want to log calibration data */ /*#define DEBUG_PS4_CALIBRATION*/ -#define GYRO_RES_PER_DEGREE 1024.0f -#define ACCEL_RES_PER_G 8192.0f #define BLUETOOTH_DISCONNECT_TIMEOUT_MS 500 -#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) -#define LOAD32(A, B, C, D) ((((Uint32)(A)) << 0) | \ - (((Uint32)(B)) << 8) | \ - (((Uint32)(C)) << 16) | \ +#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) +#define LOAD32(A, B, C, D) ((((Uint32)(A)) << 0) | \ + (((Uint32)(B)) << 8) | \ + (((Uint32)(C)) << 16) | \ (((Uint32)(D)) << 24)) typedef enum @@ -70,7 +67,7 @@ typedef enum k_EPS4ReportIdDisconnectMessage = 226, } EPS4ReportId; -typedef enum +typedef enum { k_ePS4FeatureReportIdGyroCalibration_USB = 0x02, k_ePS4FeatureReportIdCapabilities = 0x03, @@ -113,22 +110,25 @@ typedef struct Uint8 ucLedBlue; Uint8 ucLedDelayOn; Uint8 ucLedDelayOff; - Uint8 _rgucPad0[ 8 ]; + Uint8 _rgucPad0[8]; Uint8 ucVolumeLeft; Uint8 ucVolumeRight; Uint8 ucVolumeMic; Uint8 ucVolumeSpeaker; } DS4EffectsState_t; -typedef struct { +typedef struct +{ Sint16 bias; - float sensitivity; + float scale; } IMUCalibrationData; -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; SDL_bool is_dongle; + SDL_bool is_nacon_dongle; SDL_bool official_controller; SDL_bool sensors_supported; SDL_bool lightbar_supported; @@ -148,32 +148,31 @@ typedef struct { Uint8 led_red; Uint8 led_green; Uint8 led_blue; + Uint16 gyro_numerator; + Uint16 gyro_denominator; + Uint16 accel_numerator; + Uint16 accel_denominator; Uint16 last_timestamp; Uint64 timestamp; + Uint16 valid_crc_packets; /* wrapping counter */ PS4StatePacket_t last_state; } SDL_DriverPS4_Context; - static int HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size); -static void -HIDAPI_DriverPS4_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS4_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4, callback, userdata); } -static void -HIDAPI_DriverPS4_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS4_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4, callback, userdata); } -static SDL_bool -HIDAPI_DriverPS4_IsEnabled(void) +static SDL_bool HIDAPI_DriverPS4_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS4, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS4, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } static int ReadFeatureReport(SDL_hid_device *dev, Uint8 report_id, Uint8 *report, size_t length) @@ -183,8 +182,7 @@ static int ReadFeatureReport(SDL_hid_device *dev, Uint8 report_id, Uint8 *report return SDL_hid_get_feature_report(dev, report, length); } -static SDL_bool -HIDAPI_DriverPS4_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverPS4_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { Uint8 data[USB_PACKET_LENGTH]; int size; @@ -193,10 +191,10 @@ HIDAPI_DriverPS4_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, return SDL_TRUE; } - if (SONY_THIRDPARTY_VENDOR(vendor_id)) { + if (HIDAPI_SupportsPlaystationDetection(vendor_id, product_id)) { if (device && device->dev) { - if ((size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 && - data[2] == 0x27) { + size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data)); + if (size == 48 && data[2] == 0x27) { /* Supported third party controller */ return SDL_TRUE; } else { @@ -211,8 +209,7 @@ HIDAPI_DriverPS4_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, return SDL_FALSE; } -static void -SetLedsForPlayerIndex(DS4EffectsState_t *effects, int player_index) +static void SetLedsForPlayerIndex(DS4EffectsState_t *effects, int player_index) { /* This list is the same as what hid-sony.c uses in the Linux kernel. The first 4 values correspond to what the PS4 assigns. @@ -238,8 +235,7 @@ SetLedsForPlayerIndex(DS4EffectsState_t *effects, int player_index) effects->ucLedBlue = colors[player_index][2]; } -static SDL_bool -HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS4_Context *ctx; Uint8 data[USB_PACKET_LENGTH]; @@ -254,6 +250,11 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) } ctx->device = device; + ctx->gyro_numerator = 1; + ctx->gyro_denominator = 16; + ctx->accel_numerator = 1; + ctx->accel_denominator = 8192; + device->context = ctx; if (device->serial && SDL_strlen(device->serial) == 12) { @@ -262,7 +263,7 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) j = -1; for (i = 0; i < 12; i += 2) { j += 1; - SDL_memcpy(&serial[j], &device->serial[i], 2); + SDL_memmove(&serial[j], &device->serial[i], 2); j += 2; serial[j] = '-'; } @@ -276,17 +277,21 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) if (ctx->is_dongle) { size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdSerialNumber, data, sizeof(data)); if (size >= 7 && (data[1] || data[2] || data[3] || data[4] || data[5] || data[6])) { - SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", - data[6], data[5], data[4], data[3], data[2], data[1]); + (void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", + data[6], data[5], data[4], data[3], data[2], data[1]); } device->is_bluetooth = SDL_FALSE; ctx->enhanced_mode = SDL_TRUE; + } else if (device->vendor_id == USB_VENDOR_SONY && device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) { + device->is_bluetooth = SDL_FALSE; + ctx->enhanced_mode = SDL_TRUE; + } else if (device->vendor_id == USB_VENDOR_SONY) { /* This will fail if we're on Bluetooth */ size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdSerialNumber, data, sizeof(data)); if (size >= 7 && (data[1] || data[2] || data[3] || data[4] || data[5] || data[6])) { - SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", - data[6], data[5], data[4], data[3], data[2], data[1]); + (void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", + data[6], data[5], data[4], data[3], data[2], data[1]); device->is_bluetooth = SDL_FALSE; ctx->enhanced_mode = SDL_TRUE; } else { @@ -316,75 +321,105 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) SDL_Log("PS4 dongle = %s, bluetooth = %s\n", ctx->is_dongle ? "TRUE" : "FALSE", device->is_bluetooth ? "TRUE" : "FALSE"); #endif - /* Get the device capabilities */ if (device->vendor_id == USB_VENDOR_SONY) { ctx->official_controller = SDL_TRUE; ctx->sensors_supported = SDL_TRUE; ctx->lightbar_supported = SDL_TRUE; ctx->vibration_supported = SDL_TRUE; ctx->touchpad_supported = SDL_TRUE; - } else if ((size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data))) == 48 && - data[2] == 0x27) { - Uint8 capabilities = data[4]; - Uint8 device_type = data[5]; + } else { + size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdCapabilities, data, sizeof(data)); + /* Get the device capabilities */ + if (size == 48 && data[2] == 0x27) { + Uint8 capabilities = data[4]; + Uint8 device_type = data[5]; + Uint16 gyro_numerator = LOAD16(data[10], data[11]); + Uint16 gyro_denominator = LOAD16(data[12], data[13]); + Uint16 accel_numerator = LOAD16(data[14], data[15]); + Uint16 accel_denominator = LOAD16(data[16], data[17]); #ifdef DEBUG_PS4_PROTOCOL - HIDAPI_DumpPacket("PS4 capabilities: size = %d", data, size); + HIDAPI_DumpPacket("PS4 capabilities: size = %d", data, size); #endif - if ((capabilities & 0x02) != 0) { - ctx->sensors_supported = SDL_TRUE; - } - if ((capabilities & 0x04) != 0) { - ctx->lightbar_supported = SDL_TRUE; - } - if ((capabilities & 0x08) != 0) { + if (capabilities & 0x02) { + ctx->sensors_supported = SDL_TRUE; + } + if (capabilities & 0x04) { + ctx->lightbar_supported = SDL_TRUE; + } + if (capabilities & 0x08) { + ctx->vibration_supported = SDL_TRUE; + } + if (capabilities & 0x40) { + ctx->touchpad_supported = SDL_TRUE; + } + + switch (device_type) { + case 0x00: + joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; + break; + case 0x01: + joystick_type = SDL_JOYSTICK_TYPE_GUITAR; + break; + case 0x02: + joystick_type = SDL_JOYSTICK_TYPE_DRUM_KIT; + break; + case 0x04: + joystick_type = SDL_JOYSTICK_TYPE_DANCE_PAD; + break; + case 0x06: + joystick_type = SDL_JOYSTICK_TYPE_WHEEL; + break; + case 0x07: + joystick_type = SDL_JOYSTICK_TYPE_ARCADE_STICK; + break; + case 0x08: + joystick_type = SDL_JOYSTICK_TYPE_FLIGHT_STICK; + break; + default: + joystick_type = SDL_JOYSTICK_TYPE_UNKNOWN; + break; + } + + if (gyro_numerator && gyro_denominator) { + ctx->gyro_numerator = gyro_numerator; + ctx->gyro_denominator = gyro_denominator; + } + if (accel_numerator && accel_denominator) { + ctx->accel_numerator = accel_numerator; + ctx->accel_denominator = accel_denominator; + } + } else if (device->vendor_id == USB_VENDOR_RAZER) { + /* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */ ctx->vibration_supported = SDL_TRUE; - } - if ((capabilities & 0x40) != 0) { ctx->touchpad_supported = SDL_TRUE; - } - - switch (device_type) { - case 0x00: - joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; - break; - case 0x01: - joystick_type = SDL_JOYSTICK_TYPE_GUITAR; - break; - case 0x02: - joystick_type = SDL_JOYSTICK_TYPE_DRUM_KIT; - break; - case 0x04: - joystick_type = SDL_JOYSTICK_TYPE_DANCE_PAD; - break; - case 0x06: - joystick_type = SDL_JOYSTICK_TYPE_WHEEL; - break; - case 0x07: - joystick_type = SDL_JOYSTICK_TYPE_ARCADE_STICK; - break; - case 0x08: - joystick_type = SDL_JOYSTICK_TYPE_FLIGHT_STICK; - break; - default: - joystick_type = SDL_JOYSTICK_TYPE_UNKNOWN; - break; - } - } else if (device->vendor_id == USB_VENDOR_RAZER) { - /* The Razer Raiju doesn't respond to the detection protocol, but has a touchpad and vibration */ - ctx->vibration_supported = SDL_TRUE; - ctx->touchpad_supported = SDL_TRUE; - if (device->product_id == USB_PRODUCT_RAZER_TOURNAMENT_EDITION_BLUETOOTH || - device->product_id == USB_PRODUCT_RAZER_ULTIMATE_EDITION_BLUETOOTH) { - device->is_bluetooth = SDL_TRUE; + if (device->product_id == USB_PRODUCT_RAZER_TOURNAMENT_EDITION_BLUETOOTH || + device->product_id == USB_PRODUCT_RAZER_ULTIMATE_EDITION_BLUETOOTH) { + device->is_bluetooth = SDL_TRUE; + } } } ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported); + if (device->vendor_id == USB_VENDOR_NACON_ALT && + device->product_id == USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS4_WIRELESS) { + ctx->is_nacon_dongle = SDL_TRUE; + } + + if (device->vendor_id == USB_VENDOR_PDP && + (device->product_id == USB_PRODUCT_VICTRIX_FS_PRO || + device->product_id == USB_PRODUCT_VICTRIX_FS_PRO_V2)) { + /* The Victrix FS Pro V2 reports that it has lightbar support, + * but it doesn't respond to the effects packet, and will hang + * on reboot if we send it. + */ + ctx->effects_supported = SDL_FALSE; + } + device->joystick_type = joystick_type; device->type = SDL_CONTROLLER_TYPE_PS4; - if (device->vendor_id == USB_VENDOR_SONY) { + if (ctx->official_controller) { HIDAPI_SetDeviceName(device, "PS4 Controller"); } HIDAPI_SetDeviceSerial(device, serial); @@ -397,21 +432,19 @@ HIDAPI_DriverPS4_InitDevice(SDL_HIDAPI_Device *device) } else { HIDAPI_DisconnectBluetoothDevice(device->serial); } - if (ctx->is_dongle && serial[0] == '\0') { + if ((ctx->is_dongle || ctx->is_nacon_dongle) && serial[0] == '\0') { /* Not yet connected */ return SDL_TRUE; } return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverPS4_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverPS4_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS4_LoadOfficialCalibrationData(SDL_HIDAPI_Device *device) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; int i, tries, size; @@ -422,17 +455,17 @@ HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) #ifdef DEBUG_PS4_CALIBRATION SDL_Log("Not an official controller, ignoring calibration\n"); #endif - return; + return SDL_FALSE; } - for( tries = 0; tries < 5; ++tries ) { + for (tries = 0; tries < 5; ++tries) { /* For Bluetooth controllers, this report switches them into advanced report mode */ size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdGyroCalibration_USB, data, sizeof(data)); if (size < 35) { #ifdef DEBUG_PS4_CALIBRATION SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size); #endif - return; + return SDL_FALSE; } if (device->is_bluetooth) { @@ -441,7 +474,7 @@ HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) #ifdef DEBUG_PS4_CALIBRATION SDL_Log("Short read of calibration data: %d, ignoring calibration\n", size); #endif - return; + return SDL_FALSE; } } @@ -471,6 +504,7 @@ HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) Sint16 sAccZPlus, sAccZMinus; float flNumerator; + float flDenominator; Sint16 sRange2g; #ifdef DEBUG_PS4_CALIBRATION @@ -507,36 +541,44 @@ HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) sAccZPlus = LOAD16(data[31], data[32]); sAccZMinus = LOAD16(data[33], data[34]); - flNumerator = (sGyroSpeedPlus + sGyroSpeedMinus) * GYRO_RES_PER_DEGREE; - ctx->calibration[0].bias = sGyroPitchBias; - ctx->calibration[0].sensitivity = flNumerator / (sGyroPitchPlus - sGyroPitchMinus); + flNumerator = (float)(sGyroSpeedPlus + sGyroSpeedMinus) * ctx->gyro_denominator / ctx->gyro_numerator; + flDenominator = (float)(SDL_abs(sGyroPitchPlus - sGyroPitchBias) + SDL_abs(sGyroPitchMinus - sGyroPitchBias)); + if (flDenominator != 0.0f) { + ctx->calibration[0].bias = sGyroPitchBias; + ctx->calibration[0].scale = flNumerator / flDenominator; + } - ctx->calibration[1].bias = sGyroYawBias; - ctx->calibration[1].sensitivity = flNumerator / (sGyroYawPlus - sGyroYawMinus); + flDenominator = (float)(SDL_abs(sGyroYawPlus - sGyroYawBias) + SDL_abs(sGyroYawMinus - sGyroYawBias)); + if (flDenominator != 0.0f) { + ctx->calibration[1].bias = sGyroYawBias; + ctx->calibration[1].scale = flNumerator / flDenominator; + } - ctx->calibration[2].bias = sGyroRollBias; - ctx->calibration[2].sensitivity = flNumerator / (sGyroRollPlus - sGyroRollMinus); + flDenominator = (float)(SDL_abs(sGyroRollPlus - sGyroRollBias) + SDL_abs(sGyroRollMinus - sGyroRollBias)); + if (flDenominator != 0.0f) { + ctx->calibration[2].bias = sGyroRollBias; + ctx->calibration[2].scale = flNumerator / flDenominator; + } sRange2g = sAccXPlus - sAccXMinus; ctx->calibration[3].bias = sAccXPlus - sRange2g / 2; - ctx->calibration[3].sensitivity = 2.0f * ACCEL_RES_PER_G / (float)sRange2g; + ctx->calibration[3].scale = (2.0f * ctx->accel_denominator / ctx->accel_numerator) / sRange2g; sRange2g = sAccYPlus - sAccYMinus; ctx->calibration[4].bias = sAccYPlus - sRange2g / 2; - ctx->calibration[4].sensitivity = 2.0f * ACCEL_RES_PER_G / (float)sRange2g; + ctx->calibration[4].scale = (2.0f * ctx->accel_denominator / ctx->accel_numerator) / sRange2g; sRange2g = sAccZPlus - sAccZMinus; ctx->calibration[5].bias = sAccZPlus - sRange2g / 2; - ctx->calibration[5].sensitivity = 2.0f * ACCEL_RES_PER_G / (float)sRange2g; + ctx->calibration[5].scale = (2.0f * ctx->accel_denominator / ctx->accel_numerator) / sRange2g; ctx->hardware_calibration = SDL_TRUE; for (i = 0; i < 6; ++i) { - float divisor = (i < 3 ? 64.0f : 1.0f); #ifdef DEBUG_PS4_CALIBRATION - SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].sensitivity); + SDL_Log("calibration[%d] bias = %d, sensitivity = %f\n", i, ctx->calibration[i].bias, ctx->calibration[i].scale); #endif /* Some controllers have a bad calibration */ - if ((SDL_abs(ctx->calibration[i].bias) > 1024) || (SDL_fabs(1.0f - ctx->calibration[i].sensitivity / divisor) > 0.5f)) { + if (SDL_abs(ctx->calibration[i].bias) > 1024 || SDL_fabs(1.0f - ctx->calibration[i].scale) > 0.5f) { #ifdef DEBUG_PS4_CALIBRATION SDL_Log("invalid calibration, ignoring\n"); #endif @@ -548,34 +590,55 @@ HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) SDL_Log("Calibration data not available\n"); #endif } + return ctx->hardware_calibration; } -static float -HIDAPI_DriverPS4_ApplyCalibrationData(SDL_DriverPS4_Context *ctx, int index, Sint16 value) +static void HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device) { - float result; - - if (ctx->hardware_calibration) { - IMUCalibrationData *calibration = &ctx->calibration[index]; + SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; + int i; - result = (value - calibration->bias) * calibration->sensitivity; - } else if (index < 3) { - result = value * 64.f; - } else { - result = value; + if (!HIDAPI_DriverPS4_LoadOfficialCalibrationData(device)) { + for (i = 0; i < SDL_arraysize(ctx->calibration); ++i) { + ctx->calibration[i].bias = 0; + ctx->calibration[i].scale = 1.0f; + } } - /* Convert the raw data to the units expected by SDL */ - if (index < 3) { - result = (result / GYRO_RES_PER_DEGREE) * (float)M_PI / 180.0f; - } else { - result = (result / ACCEL_RES_PER_G) * SDL_STANDARD_GRAVITY; + /* Scale the raw data to the units expected by SDL */ + for (i = 0; i < SDL_arraysize(ctx->calibration); ++i) { + double scale = ctx->calibration[i].scale; + + if (i < 3) { + scale *= ((double)ctx->gyro_numerator / ctx->gyro_denominator) * M_PI / 180.0; + + if (device->vendor_id == USB_VENDOR_SONY && + device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) { + /* The Armor-X Pro seems to only deliver half the rotation it should */ + scale *= 2.0; + } + } else { + scale *= ((double)ctx->accel_numerator / ctx->accel_denominator) * SDL_STANDARD_GRAVITY; + + if (device->vendor_id == USB_VENDOR_SONY && + device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) { + /* The Armor-X Pro seems to only deliver half the acceleration it should, + * and in the opposite direction on all axes */ + scale *= -2.0; + } + } + ctx->calibration[i].scale = (float)scale; } - return result; } -static int -HIDAPI_DriverPS4_UpdateEffects(SDL_HIDAPI_Device *device) +static float HIDAPI_DriverPS4_ApplyCalibrationData(SDL_DriverPS4_Context *ctx, int index, Sint16 value) +{ + IMUCalibrationData *calibration = &ctx->calibration[index]; + + return ((float)value - calibration->bias) * calibration->scale; +} + +static int HIDAPI_DriverPS4_UpdateEffects(SDL_HIDAPI_Device *device) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; DS4EffectsState_t effects; @@ -604,24 +667,35 @@ HIDAPI_DriverPS4_UpdateEffects(SDL_HIDAPI_Device *device) return HIDAPI_DriverPS4_SendJoystickEffect(device, ctx->joystick, &effects, sizeof(effects)); } -static void -HIDAPI_DriverPS4_TickleBluetooth(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS4_TickleBluetooth(SDL_HIDAPI_Device *device) { - /* This is just a dummy packet that should have no effect, since we don't set the CRC */ - Uint8 data[78]; + SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; - SDL_zeroa(data); + if (ctx->enhanced_mode) { + /* This is just a dummy packet that should have no effect, since we don't set the CRC */ + Uint8 data[78]; - data[0] = k_EPS4ReportIdBluetoothEffects; - data[1] = 0xC0; /* Magic value HID + CRC */ + SDL_zeroa(data); + + data[0] = k_EPS4ReportIdBluetoothEffects; + data[1] = 0xC0; /* Magic value HID + CRC */ - if (SDL_HIDAPI_LockRumble() == 0) { - SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data)); + if (SDL_HIDAPI_LockRumble() == 0) { + SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data)); + } + } else { +#if 0 /* The 8BitDo Zero 2 has perfect emulation of a PS4 controllers, except it + * only sends reports when the state changes, so we can't disconnect here. + */ + /* We can't even send an invalid effects packet, or it will put the controller in enhanced mode */ + if (device->num_joysticks > 0) { + HIDAPI_JoystickDisconnected(device, device->joysticks[0]); + } +#endif } } -static void -HIDAPI_DriverPS4_SetEnhancedMode(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS4_SetEnhancedMode(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -651,8 +725,7 @@ static void SDLCALL SDL_PS4RumbleHintChanged(void *userdata, const char *name, c } } -static void -HIDAPI_DriverPS4_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverPS4_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -666,10 +739,11 @@ HIDAPI_DriverPS4_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID HIDAPI_DriverPS4_UpdateEffects(device); } -static SDL_bool -HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { - SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *) device->context; + SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; + + SDL_AssertJoysticksLocked(); ctx->joystick = joystick; ctx->last_packet = SDL_GetTicks(); @@ -706,8 +780,7 @@ HIDAPI_DriverPS4_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) return SDL_TRUE; } -static int -HIDAPI_DriverPS4_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverPS4_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -721,14 +794,12 @@ HIDAPI_DriverPS4_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return HIDAPI_DriverPS4_UpdateEffects(device); } -static int -HIDAPI_DriverPS4_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverPS4_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverPS4_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverPS4_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; Uint32 result = 0; @@ -745,8 +816,7 @@ HIDAPI_DriverPS4_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick return result; } -static int -HIDAPI_DriverPS4_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverPS4_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -762,8 +832,7 @@ HIDAPI_DriverPS4_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return HIDAPI_DriverPS4_UpdateEffects(device); } -static int -HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) +static int HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; Uint8 data[78]; @@ -781,14 +850,14 @@ HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy if (device->is_bluetooth && ctx->official_controller) { data[0] = k_EPS4ReportIdBluetoothEffects; - data[1] = 0xC0 | 0x04; /* Magic value HID + CRC, also sets interval to 4ms for samples */ - data[3] = 0x03; /* 0x1 is rumble, 0x2 is lightbar, 0x4 is the blink interval */ + data[1] = 0xC0 | 0x04; /* Magic value HID + CRC, also sets interval to 4ms for samples */ + data[3] = 0x03; /* 0x1 is rumble, 0x2 is lightbar, 0x4 is the blink interval */ report_size = 78; offset = 6; } else { data[0] = k_EPS4ReportIdUsbEffects; - data[1] = 0x07; /* Magic value */ + data[1] = 0x07; /* Magic value */ report_size = 32; offset = 4; @@ -811,8 +880,7 @@ HIDAPI_DriverPS4_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy return 0; } -static int -HIDAPI_DriverPS4_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverPS4_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -829,11 +897,10 @@ HIDAPI_DriverPS4_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joysti return 0; } -static void -HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS4_Context *ctx, PS4StatePacket_t *packet) +static void HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS4_Context *ctx, PS4StatePacket_t *packet, int size) { static const float TOUCHPAD_SCALEX = 1.0f / 1920; - static const float TOUCHPAD_SCALEY = 1.0f / 920; /* This is noted as being 944 resolution, but 920 feels better */ + static const float TOUCHPAD_SCALEY = 1.0f / 920; /* This is noted as being 944 resolution, but 920 feels better */ Sint16 axis; Uint8 touchpad_state; int touchpad_x, touchpad_y; @@ -907,7 +974,7 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, /* Some fightsticks, ex: Victrix FS Pro will only this these digital trigger bits and not the analog values so this needs to run whenever the trigger is evaluated */ - if ((packet->rgucButtonsHatAndCounter[1] & 0x0C) != 0) { + if (packet->rgucButtonsHatAndCounter[1] & 0x0C) { Uint8 data = packet->rgucButtonsHatAndCounter[1]; packet->ucTriggerLeft = (data & 0x04) && packet->ucTriggerLeft == 0 ? 255 : packet->ucTriggerLeft; packet->ucTriggerRight = (data & 0x08) && packet->ucTriggerRight == 0 ? 255 : packet->ucTriggerRight; @@ -933,7 +1000,7 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, axis = ((int)packet->ucRightJoystickY * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); - if (ctx->device->is_bluetooth && ctx->official_controller) { + if (size > 9 && ctx->device->is_bluetooth && ctx->official_controller) { if (packet->ucBatteryLevel & 0x10) { SDL_PrivateJoystickBatteryLevel(joystick, SDL_JOYSTICK_POWER_WIRED); } else { @@ -951,19 +1018,19 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, } } - if (ctx->report_touchpad) { - touchpad_state = ((packet->ucTouchpadCounter1 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; + if (size > 9 && ctx->report_touchpad) { + touchpad_state = !(packet->ucTouchpadCounter1 & 0x80) ? SDL_PRESSED : SDL_RELEASED; touchpad_x = packet->rgucTouchpadData1[0] | (((int)packet->rgucTouchpadData1[1] & 0x0F) << 8); touchpad_y = (packet->rgucTouchpadData1[1] >> 4) | ((int)packet->rgucTouchpadData1[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 0, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); - touchpad_state = ((packet->ucTouchpadCounter2 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; + touchpad_state = !(packet->ucTouchpadCounter2 & 0x80) ? SDL_PRESSED : SDL_RELEASED; touchpad_x = packet->rgucTouchpadData2[0] | (((int)packet->rgucTouchpadData2[1] & 0x0F) << 8); touchpad_y = (packet->rgucTouchpadData2[1] >> 4) | ((int)packet->rgucTouchpadData2[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 1, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); } - if (ctx->report_sensors) { + if (size > 9 && ctx->report_sensors) { Uint16 timestamp; Uint64 timestamp_us; float data[3]; @@ -986,7 +1053,6 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, /* Sensor timestamp is in 5.33us units */ timestamp_us = (ctx->timestamp * 16) / 3; - data[0] = HIDAPI_DriverPS4_ApplyCalibrationData(ctx, 0, LOAD16(packet->rgucGyroX[0], packet->rgucGyroX[1])); data[1] = HIDAPI_DriverPS4_ApplyCalibrationData(ctx, 1, LOAD16(packet->rgucGyroY[0], packet->rgucGyroY[1])); data[2] = HIDAPI_DriverPS4_ApplyCalibrationData(ctx, 2, LOAD16(packet->rgucGyroZ[0], packet->rgucGyroZ[1])); @@ -1001,8 +1067,7 @@ HIDAPI_DriverPS4_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_memcpy(&ctx->last_state, packet, sizeof(ctx->last_state)); } -static SDL_bool -VerifyCRC(Uint8 *data, int size) +static SDL_bool VerifyCRC(Uint8 *data, int size) { Uint8 ubHdr = 0xA1; /* hidp header is part of the CRC calculation */ Uint32 unCRC, unPacketCRC; @@ -1017,17 +1082,36 @@ VerifyCRC(Uint8 *data, int size) return (unCRC == unPacketCRC) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverPS4_IsPacketValid(SDL_DriverPS4_Context *ctx, Uint8 *data, int size) +static SDL_bool HIDAPI_DriverPS4_IsPacketValid(SDL_DriverPS4_Context *ctx, Uint8 *data, int size) { switch (data[0]) { case k_EPS4ReportIdUsbState: + if (size == 10) { + /* This is non-enhanced mode, this packet is fine */ + return SDL_TRUE; + } + + if (ctx->is_nacon_dongle && size >= (1 + sizeof(PS4StatePacket_t))) { + /* The report timestamp doesn't change when the controller isn't connected */ + PS4StatePacket_t *packet = (PS4StatePacket_t *)&data[1]; + if (SDL_memcmp(packet->rgucTimestamp, ctx->last_state.rgucTimestamp, sizeof(packet->rgucTimestamp)) == 0) { + return SDL_FALSE; + } + if (ctx->last_state.rgucAccelX[0] == 0 && ctx->last_state.rgucAccelX[1] == 0 && + ctx->last_state.rgucAccelY[0] == 0 && ctx->last_state.rgucAccelY[1] == 0 && + ctx->last_state.rgucAccelZ[0] == 0 && ctx->last_state.rgucAccelZ[1] == 0) { + /* We don't have any state to compare yet, go ahead and copy it */ + SDL_memcpy(&ctx->last_state, &data[1], sizeof(PS4StatePacket_t)); + return SDL_FALSE; + } + } + /* In the case of a DS4 USB dongle, bit[2] of byte 31 indicates if a DS4 is actually connected (indicated by '0'). * For non-dongle, this bit is always 0 (connected). - * This is usually the ID over USB, but the DS4v2 that started shipping with the PS4 Slim will also send this - * packet over BT with a size of 128 + * This is usually the ID over USB, but the DS4v2 that started shipping with the PS4 Slim will also send this + * packet over BT with a size of 128 */ - if (size >= 64 && (data[31] & 0x04) == 0) { + if (size >= 64 && !(data[31] & 0x04)) { return SDL_TRUE; } break; @@ -1041,7 +1125,18 @@ HIDAPI_DriverPS4_IsPacketValid(SDL_DriverPS4_Context *ctx, Uint8 *data, int size case k_EPS4ReportIdBluetoothState8: case k_EPS4ReportIdBluetoothState9: /* Bluetooth state packets have two additional bytes at the beginning, the first notes if HID data is present */ - if (size >= 78 && (data[1] & 0x80) && VerifyCRC(data, 78)) { + if (size >= 78 && (data[1] & 0x80)) { + if (VerifyCRC(data, 78)) { + ++ctx->valid_crc_packets; + } else { + if (ctx->valid_crc_packets > 0) { + --ctx->valid_crc_packets; + } + if (ctx->valid_crc_packets >= 3) { + /* We're generally getting valid CRC, but failed one */ + return SDL_FALSE; + } + } return SDL_TRUE; } break; @@ -1051,12 +1146,11 @@ HIDAPI_DriverPS4_IsPacketValid(SDL_DriverPS4_Context *ctx, Uint8 *data, int size return SDL_FALSE; } -static SDL_bool -HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; SDL_Joystick *joystick = NULL; - Uint8 data[USB_PACKET_LENGTH*2]; + Uint8 data[USB_PACKET_LENGTH * 2]; int size; int packet_count = 0; Uint32 now = SDL_GetTicks(); @@ -1082,7 +1176,7 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) switch (data[0]) { case k_EPS4ReportIdUsbState: - HIDAPI_DriverPS4_HandleStatePacket(joystick, device->dev, ctx, (PS4StatePacket_t *)&data[1]); + HIDAPI_DriverPS4_HandleStatePacket(joystick, device->dev, ctx, (PS4StatePacket_t *)&data[1], size - 1); break; case k_EPS4ReportIdBluetoothState1: case k_EPS4ReportIdBluetoothState2: @@ -1098,7 +1192,7 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) HIDAPI_DriverPS4_SetEnhancedMode(device, joystick); } /* Bluetooth state packets have two additional bytes at the beginning, the first notes if HID is present */ - HIDAPI_DriverPS4_HandleStatePacket(joystick, device->dev, ctx, (PS4StatePacket_t*)&data[3]); + HIDAPI_DriverPS4_HandleStatePacket(joystick, device->dev, ctx, (PS4StatePacket_t *)&data[3], size - 3); break; default: #ifdef DEBUG_JOYSTICK @@ -1114,6 +1208,7 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) if (SDL_TICKS_PASSED(now, ctx->last_packet + BLUETOOTH_DISCONNECT_TIMEOUT_MS)) { /* Send an empty output report to tickle the Bluetooth stack */ HIDAPI_DriverPS4_TickleBluetooth(device); + ctx->last_packet = now; } } else { /* Reconnect the Bluetooth device once the USB device is gone */ @@ -1124,7 +1219,7 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) } } - if (ctx->is_dongle) { + if (ctx->is_dongle || ctx->is_nacon_dongle) { if (packet_count == 0) { if (device->num_joysticks > 0) { /* Check to see if it looks like the device disconnected */ @@ -1137,8 +1232,8 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) char serial[18]; size = ReadFeatureReport(device->dev, k_ePS4FeatureReportIdSerialNumber, data, sizeof(data)); if (size >= 7 && (data[1] || data[2] || data[3] || data[4] || data[5] || data[6])) { - SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", - data[6], data[5], data[4], data[3], data[2], data[1]); + (void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", + data[6], data[5], data[4], data[3], data[2], data[1]); HIDAPI_SetDeviceSerial(device, serial); } HIDAPI_JoystickConnected(device, NULL); @@ -1146,15 +1241,14 @@ HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) } } - if (size < 0 && device->num_joysticks > 0) { + if (packet_count == 0 && size < 0 && device->num_joysticks > 0) { /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverPS4_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS4_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context; @@ -1164,13 +1258,11 @@ HIDAPI_DriverPS4_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick ctx->joystick = NULL; } -static void -HIDAPI_DriverPS4_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS4_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4 = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS4 = { SDL_HINT_JOYSTICK_HIDAPI_PS4, SDL_TRUE, HIDAPI_DriverPS4_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c index 7458adaf4522d..159a0e846bf03 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps5.c +++ b/src/joystick/hidapi/SDL_hidapi_ps5.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,7 +31,6 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_PS5 /* Define this if you want to log all packets from the controller */ @@ -40,16 +39,25 @@ /* Define this if you want to log calibration data */ /*#define DEBUG_PS5_CALIBRATION*/ -#define GYRO_RES_PER_DEGREE 1024.0f -#define ACCEL_RES_PER_G 8192.0f +#define GYRO_RES_PER_DEGREE 1024.0f +#define ACCEL_RES_PER_G 8192.0f #define BLUETOOTH_DISCONNECT_TIMEOUT_MS 500 -#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) -#define LOAD32(A, B, C, D) ((((Uint32)(A)) << 0) | \ - (((Uint32)(B)) << 8) | \ - (((Uint32)(C)) << 16) | \ +#define LOAD16(A, B) (Sint16)((Uint16)(A) | (((Uint16)(B)) << 8)) +#define LOAD32(A, B, C, D) ((((Uint32)(A)) << 0) | \ + (((Uint32)(B)) << 8) | \ + (((Uint32)(C)) << 16) | \ (((Uint32)(D)) << 24)) +enum +{ + SDL_CONTROLLER_BUTTON_PS5_TOUCHPAD = SDL_CONTROLLER_BUTTON_MISC1 + 1, + SDL_CONTROLLER_BUTTON_PS5_LEFT_FUNCTION, + SDL_CONTROLLER_BUTTON_PS5_RIGHT_FUNCTION, + SDL_CONTROLLER_BUTTON_PS5_LEFT_PADDLE, + SDL_CONTROLLER_BUTTON_PS5_RIGHT_PADDLE +}; + typedef enum { k_EPS5ReportIdState = 0x01, @@ -79,130 +87,137 @@ typedef struct typedef struct { - Uint8 ucLeftJoystickX; /* 0 */ - Uint8 ucLeftJoystickY; /* 1 */ - Uint8 ucRightJoystickX; /* 2 */ - Uint8 ucRightJoystickY; /* 3 */ - Uint8 ucTriggerLeft; /* 4 */ - Uint8 ucTriggerRight; /* 5 */ - Uint8 ucCounter; /* 6 */ - Uint8 rgucButtonsAndHat[4]; /* 7 */ - Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ - Uint8 rgucGyroX[2]; /* 15 */ - Uint8 rgucGyroY[2]; /* 17 */ - Uint8 rgucGyroZ[2]; /* 19 */ - Uint8 rgucAccelX[2]; /* 21 */ - Uint8 rgucAccelY[2]; /* 23 */ - Uint8 rgucAccelZ[2]; /* 25 */ - Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */ + Uint8 ucLeftJoystickX; /* 0 */ + Uint8 ucLeftJoystickY; /* 1 */ + Uint8 ucRightJoystickX; /* 2 */ + Uint8 ucRightJoystickY; /* 3 */ + Uint8 ucTriggerLeft; /* 4 */ + Uint8 ucTriggerRight; /* 5 */ + Uint8 ucCounter; /* 6 */ + Uint8 rgucButtonsAndHat[4]; /* 7 */ + Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ + Uint8 rgucGyroX[2]; /* 15 */ + Uint8 rgucGyroY[2]; /* 17 */ + Uint8 rgucGyroZ[2]; /* 19 */ + Uint8 rgucAccelX[2]; /* 21 */ + Uint8 rgucAccelY[2]; /* 23 */ + Uint8 rgucAccelZ[2]; /* 25 */ + Uint8 rgucSensorTimestamp[4]; /* 27 - 16/32 bit little endian */ } PS5StatePacketCommon_t; typedef struct { - Uint8 ucLeftJoystickX; /* 0 */ - Uint8 ucLeftJoystickY; /* 1 */ - Uint8 ucRightJoystickX; /* 2 */ - Uint8 ucRightJoystickY; /* 3 */ - Uint8 ucTriggerLeft; /* 4 */ - Uint8 ucTriggerRight; /* 5 */ - Uint8 ucCounter; /* 6 */ - Uint8 rgucButtonsAndHat[4]; /* 7 */ - Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ - Uint8 rgucGyroX[2]; /* 15 */ - Uint8 rgucGyroY[2]; /* 17 */ - Uint8 rgucGyroZ[2]; /* 19 */ - Uint8 rgucAccelX[2]; /* 21 */ - Uint8 rgucAccelY[2]; /* 23 */ - Uint8 rgucAccelZ[2]; /* 25 */ - Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */ - Uint8 ucSensorTemp; /* 31 */ - Uint8 ucTouchpadCounter1; /* 32 - high bit clear + counter */ - Uint8 rgucTouchpadData1[3]; /* 33 - X/Y, 12 bits per axis */ - Uint8 ucTouchpadCounter2; /* 36 - high bit clear + counter */ - Uint8 rgucTouchpadData2[3]; /* 37 - X/Y, 12 bits per axis */ - Uint8 rgucUnknown1[8]; /* 40 */ - Uint8 rgucTimer2[4]; /* 48 - 32 bit little endian */ - Uint8 ucBatteryLevel; /* 52 */ - Uint8 ucConnectState; /* 53 - 0x08 = USB, 0x01 = headphone */ + Uint8 ucLeftJoystickX; /* 0 */ + Uint8 ucLeftJoystickY; /* 1 */ + Uint8 ucRightJoystickX; /* 2 */ + Uint8 ucRightJoystickY; /* 3 */ + Uint8 ucTriggerLeft; /* 4 */ + Uint8 ucTriggerRight; /* 5 */ + Uint8 ucCounter; /* 6 */ + Uint8 rgucButtonsAndHat[4]; /* 7 */ + Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ + Uint8 rgucGyroX[2]; /* 15 */ + Uint8 rgucGyroY[2]; /* 17 */ + Uint8 rgucGyroZ[2]; /* 19 */ + Uint8 rgucAccelX[2]; /* 21 */ + Uint8 rgucAccelY[2]; /* 23 */ + Uint8 rgucAccelZ[2]; /* 25 */ + Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */ + Uint8 ucSensorTemp; /* 31 */ + Uint8 ucTouchpadCounter1; /* 32 - high bit clear + counter */ + Uint8 rgucTouchpadData1[3]; /* 33 - X/Y, 12 bits per axis */ + Uint8 ucTouchpadCounter2; /* 36 - high bit clear + counter */ + Uint8 rgucTouchpadData2[3]; /* 37 - X/Y, 12 bits per axis */ + Uint8 rgucUnknown1[8]; /* 40 */ + Uint8 rgucTimer2[4]; /* 48 - 32 bit little endian */ + Uint8 ucBatteryLevel; /* 52 */ + Uint8 ucConnectState; /* 53 - 0x08 = USB, 0x01 = headphone */ /* There's more unknown data at the end, and a 32-bit CRC on Bluetooth */ } PS5StatePacket_t; typedef struct { - Uint8 ucLeftJoystickX; /* 0 */ - Uint8 ucLeftJoystickY; /* 1 */ - Uint8 ucRightJoystickX; /* 2 */ - Uint8 ucRightJoystickY; /* 3 */ - Uint8 ucTriggerLeft; /* 4 */ - Uint8 ucTriggerRight; /* 5 */ - Uint8 ucCounter; /* 6 */ - Uint8 rgucButtonsAndHat[4]; /* 7 */ - Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ - Uint8 rgucGyroX[2]; /* 15 */ - Uint8 rgucGyroY[2]; /* 17 */ - Uint8 rgucGyroZ[2]; /* 19 */ - Uint8 rgucAccelX[2]; /* 21 */ - Uint8 rgucAccelY[2]; /* 23 */ - Uint8 rgucAccelZ[2]; /* 25 */ - Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */ - Uint8 ucTouchpadCounter1; /* 31 - high bit clear + counter */ - Uint8 rgucTouchpadData1[3]; /* 32 - X/Y, 12 bits per axis */ - Uint8 ucTouchpadCounter2; /* 35 - high bit clear + counter */ - Uint8 rgucTouchpadData2[3]; /* 36 - X/Y, 12 bits per axis */ + Uint8 ucLeftJoystickX; /* 0 */ + Uint8 ucLeftJoystickY; /* 1 */ + Uint8 ucRightJoystickX; /* 2 */ + Uint8 ucRightJoystickY; /* 3 */ + Uint8 ucTriggerLeft; /* 4 */ + Uint8 ucTriggerRight; /* 5 */ + Uint8 ucCounter; /* 6 */ + Uint8 rgucButtonsAndHat[4]; /* 7 */ + Uint8 rgucPacketSequence[4]; /* 11 - 32 bit little endian */ + Uint8 rgucGyroX[2]; /* 15 */ + Uint8 rgucGyroY[2]; /* 17 */ + Uint8 rgucGyroZ[2]; /* 19 */ + Uint8 rgucAccelX[2]; /* 21 */ + Uint8 rgucAccelY[2]; /* 23 */ + Uint8 rgucAccelZ[2]; /* 25 */ + Uint8 rgucSensorTimestamp[2]; /* 27 - 16 bit little endian */ + Uint8 ucBatteryLevel; /* 29 */ + Uint8 ucUnknown; /* 30 */ + Uint8 ucTouchpadCounter1; /* 31 - high bit clear + counter */ + Uint8 rgucTouchpadData1[3]; /* 32 - X/Y, 12 bits per axis */ + Uint8 ucTouchpadCounter2; /* 35 - high bit clear + counter */ + Uint8 rgucTouchpadData2[3]; /* 36 - X/Y, 12 bits per axis */ /* There's more unknown data at the end, and a 32-bit CRC on Bluetooth */ } PS5StatePacketAlt_t; typedef struct { - Uint8 ucEnableBits1; /* 0 */ - Uint8 ucEnableBits2; /* 1 */ - Uint8 ucRumbleRight; /* 2 */ - Uint8 ucRumbleLeft; /* 3 */ - Uint8 ucHeadphoneVolume; /* 4 */ - Uint8 ucSpeakerVolume; /* 5 */ - Uint8 ucMicrophoneVolume; /* 6 */ - Uint8 ucAudioEnableBits; /* 7 */ - Uint8 ucMicLightMode; /* 8 */ - Uint8 ucAudioMuteBits; /* 9 */ - Uint8 rgucRightTriggerEffect[11]; /* 10 */ - Uint8 rgucLeftTriggerEffect[11]; /* 21 */ - Uint8 rgucUnknown1[6]; /* 32 */ - Uint8 ucEnableBits3; /* 38 */ - Uint8 rgucUnknown2[2]; /* 39 */ - Uint8 ucLedAnim; /* 41 */ - Uint8 ucLedBrightness; /* 42 */ - Uint8 ucPadLights; /* 43 */ - Uint8 ucLedRed; /* 44 */ - Uint8 ucLedGreen; /* 45 */ - Uint8 ucLedBlue; /* 46 */ + Uint8 ucEnableBits1; /* 0 */ + Uint8 ucEnableBits2; /* 1 */ + Uint8 ucRumbleRight; /* 2 */ + Uint8 ucRumbleLeft; /* 3 */ + Uint8 ucHeadphoneVolume; /* 4 */ + Uint8 ucSpeakerVolume; /* 5 */ + Uint8 ucMicrophoneVolume; /* 6 */ + Uint8 ucAudioEnableBits; /* 7 */ + Uint8 ucMicLightMode; /* 8 */ + Uint8 ucAudioMuteBits; /* 9 */ + Uint8 rgucRightTriggerEffect[11]; /* 10 */ + Uint8 rgucLeftTriggerEffect[11]; /* 21 */ + Uint8 rgucUnknown1[6]; /* 32 */ + Uint8 ucEnableBits3; /* 38 */ + Uint8 rgucUnknown2[2]; /* 39 */ + Uint8 ucLedAnim; /* 41 */ + Uint8 ucLedBrightness; /* 42 */ + Uint8 ucPadLights; /* 43 */ + Uint8 ucLedRed; /* 44 */ + Uint8 ucLedGreen; /* 45 */ + Uint8 ucLedBlue; /* 46 */ } DS5EffectsState_t; -typedef enum { - k_EDS5EffectRumbleStart = (1 << 0), - k_EDS5EffectRumble = (1 << 1), - k_EDS5EffectLEDReset = (1 << 2), - k_EDS5EffectLED = (1 << 3), - k_EDS5EffectPadLights = (1 << 4), - k_EDS5EffectMicLight = (1 << 5) +typedef enum +{ + k_EDS5EffectRumbleStart = (1 << 0), + k_EDS5EffectRumble = (1 << 1), + k_EDS5EffectLEDReset = (1 << 2), + k_EDS5EffectLED = (1 << 3), + k_EDS5EffectPadLights = (1 << 4), + k_EDS5EffectMicLight = (1 << 5) } EDS5Effect; -typedef enum { +typedef enum +{ k_EDS5LEDResetStateNone, k_EDS5LEDResetStatePending, k_EDS5LEDResetStateComplete, } EDS5LEDResetState; -typedef struct { +typedef struct +{ Sint16 bias; float sensitivity; } IMUCalibrationData; -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; + SDL_bool is_nacon_dongle; SDL_bool use_alternate_report; SDL_bool sensors_supported; SDL_bool lightbar_supported; @@ -232,6 +247,7 @@ typedef struct { { PS5SimpleStatePacket_t simple; PS5StatePacketCommon_t state; + PS5StatePacketAlt_t alt_state; PS5StatePacket_t full_state; Uint8 data[64]; } last_state; @@ -239,24 +255,19 @@ typedef struct { static int HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size); -static void -HIDAPI_DriverPS5_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS5_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS5, callback, userdata); } -static void -HIDAPI_DriverPS5_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverPS5_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS5, callback, userdata); } -static SDL_bool -HIDAPI_DriverPS5_IsEnabled(void) +static SDL_bool HIDAPI_DriverPS5_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS5, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS5, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } static int ReadFeatureReport(SDL_hid_device *dev, Uint8 report_id, Uint8 *report, size_t length) @@ -266,8 +277,7 @@ static int ReadFeatureReport(SDL_hid_device *dev, Uint8 report_id, Uint8 *report return SDL_hid_get_feature_report(dev, report, length); } -static SDL_bool -HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { Uint8 data[USB_PACKET_LENGTH]; int size; @@ -276,10 +286,10 @@ HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, return SDL_TRUE; } - if (SONY_THIRDPARTY_VENDOR(vendor_id)) { + if (HIDAPI_SupportsPlaystationDetection(vendor_id, product_id)) { if (device && device->dev) { - if ((size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 && - data[2] == 0x28) { + size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data)); + if (size == 48 && data[2] == 0x28) { /* Supported third party controller */ return SDL_TRUE; } else { @@ -293,8 +303,7 @@ HIDAPI_DriverPS5_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, return SDL_FALSE; } -static void -SetLedsForPlayerIndex(DS5EffectsState_t *effects, int player_index) +static void SetLedsForPlayerIndex(DS5EffectsState_t *effects, int player_index) { /* This list is the same as what hid-sony.c uses in the Linux kernel. The first 4 values correspond to what the PS4 assigns. @@ -320,14 +329,14 @@ SetLedsForPlayerIndex(DS5EffectsState_t *effects, int player_index) effects->ucLedBlue = colors[player_index][2]; } -static void -SetLightsForPlayerIndex(DS5EffectsState_t *effects, int player_index) +static void SetLightsForPlayerIndex(DS5EffectsState_t *effects, int player_index) { static const Uint8 lights[] = { 0x04, 0x0A, 0x15, - 0x1B + 0x1B, + 0x1F }; if (player_index >= 0) { @@ -339,11 +348,10 @@ SetLightsForPlayerIndex(DS5EffectsState_t *effects, int player_index) } } -static SDL_bool -HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS5_Context *ctx; - Uint8 data[USB_PACKET_LENGTH*2]; + Uint8 data[USB_PACKET_LENGTH * 2]; int size; char serial[18]; SDL_JoystickType joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; @@ -363,7 +371,7 @@ HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) j = -1; for (i = 0; i < 12; i += 2) { j += 1; - SDL_memcpy(&serial[j], &device->serial[i], 2); + SDL_memmove(&serial[j], &device->serial[i], 2); j += 2; serial[j] = '-'; } @@ -406,8 +414,8 @@ HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) This will also enable enhanced reports over Bluetooth */ if (ReadFeatureReport(device->dev, k_EPS5FeatureReportIdSerialNumber, data, sizeof(data)) >= 7) { - SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", - data[6], data[5], data[4], data[3], data[2], data[1]); + (void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", + data[6], data[5], data[4], data[3], data[2], data[1]); } /* Read the firmware version @@ -425,66 +433,103 @@ HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) ctx->vibration_supported = SDL_TRUE; ctx->playerled_supported = SDL_TRUE; ctx->touchpad_supported = SDL_TRUE; - } else if ((size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data))) == 48 && - data[2] == 0x28) { - Uint8 capabilities = data[4]; - Uint8 capabilities2 = data[20]; - Uint8 device_type = data[5]; + } else { + /* Third party controller capability request */ + size = ReadFeatureReport(device->dev, k_EPS5FeatureReportIdCapabilities, data, sizeof(data)); + if (size == 48 && data[2] == 0x28) { + Uint8 capabilities = data[4]; + Uint8 capabilities2 = data[20]; + Uint8 device_type = data[5]; #ifdef DEBUG_PS5_PROTOCOL - HIDAPI_DumpPacket("PS5 capabilities: size = %d", data, size); + HIDAPI_DumpPacket("PS5 capabilities: size = %d", data, size); #endif - if ((capabilities & 0x02) != 0) { + if (capabilities & 0x02) { + ctx->sensors_supported = SDL_TRUE; + } + if (capabilities & 0x04) { + ctx->lightbar_supported = SDL_TRUE; + } + if (capabilities & 0x08) { + ctx->vibration_supported = SDL_TRUE; + } + if (capabilities & 0x40) { + ctx->touchpad_supported = SDL_TRUE; + } + if (capabilities2 & 0x80) { + ctx->playerled_supported = SDL_TRUE; + } + + switch (device_type) { + case 0x00: + joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; + break; + case 0x01: + joystick_type = SDL_JOYSTICK_TYPE_GUITAR; + break; + case 0x02: + joystick_type = SDL_JOYSTICK_TYPE_DRUM_KIT; + break; + case 0x06: + joystick_type = SDL_JOYSTICK_TYPE_WHEEL; + break; + case 0x07: + joystick_type = SDL_JOYSTICK_TYPE_ARCADE_STICK; + break; + case 0x08: + joystick_type = SDL_JOYSTICK_TYPE_FLIGHT_STICK; + break; + default: + joystick_type = SDL_JOYSTICK_TYPE_UNKNOWN; + break; + } + + ctx->use_alternate_report = SDL_TRUE; + + if (device->vendor_id == USB_VENDOR_NACON_ALT && + (device->product_id == USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRED || + device->product_id == USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRELESS)) { + /* This doesn't report vibration capability, but it can do rumble */ + ctx->vibration_supported = SDL_TRUE; + } + } else if (device->vendor_id == USB_VENDOR_RAZER && + (device->product_id == USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_PS5_WIRED || + device->product_id == USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_PS5_WIRELESS)) { + /* The Razer Wolverine V2 Pro doesn't respond to the detection protocol, but has a touchpad and sensors and no vibration */ ctx->sensors_supported = SDL_TRUE; - } - if ((capabilities & 0x04) != 0) { - ctx->lightbar_supported = SDL_TRUE; - } - if ((capabilities & 0x08) != 0) { - ctx->vibration_supported = SDL_TRUE; - } - if ((capabilities & 0x40) != 0) { ctx->touchpad_supported = SDL_TRUE; - } - if ((capabilities2 & 0x80) != 0) { - ctx->playerled_supported = SDL_TRUE; - } - - switch (device_type) { - case 0x00: - joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; - break; - case 0x01: - joystick_type = SDL_JOYSTICK_TYPE_GUITAR; - break; - case 0x02: - joystick_type = SDL_JOYSTICK_TYPE_DRUM_KIT; - break; - case 0x06: - joystick_type = SDL_JOYSTICK_TYPE_WHEEL; - break; - case 0x07: + ctx->use_alternate_report = SDL_TRUE; + } else if (device->vendor_id == USB_VENDOR_RAZER && + device->product_id == USB_PRODUCT_RAZER_KITSUNE) { + /* The Razer Kitsune doesn't respond to the detection protocol, but has a touchpad */ joystick_type = SDL_JOYSTICK_TYPE_ARCADE_STICK; - break; - case 0x08: - joystick_type = SDL_JOYSTICK_TYPE_FLIGHT_STICK; - break; - default: - joystick_type = SDL_JOYSTICK_TYPE_UNKNOWN; - break; + ctx->touchpad_supported = SDL_TRUE; + ctx->use_alternate_report = SDL_TRUE; } - - ctx->use_alternate_report = SDL_TRUE; } ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported || ctx->playerled_supported); + if (device->vendor_id == USB_VENDOR_NACON_ALT && + device->product_id == USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRELESS) { + ctx->is_nacon_dongle = SDL_TRUE; + } + device->joystick_type = joystick_type; device->type = SDL_CONTROLLER_TYPE_PS5; if (device->vendor_id == USB_VENDOR_SONY) { - HIDAPI_SetDeviceName(device, "PS5 Controller"); + if (SDL_IsJoystickDualSenseEdge(device->vendor_id, device->product_id)) { + HIDAPI_SetDeviceName(device, "DualSense Edge Wireless Controller"); + } else { + HIDAPI_SetDeviceName(device, "DualSense Wireless Controller"); + } } HIDAPI_SetDeviceSerial(device, serial); + if (ctx->is_nacon_dongle) { + /* We don't know if this is connected yet, wait for reports */ + return SDL_TRUE; + } + /* Prefer the USB device over the Bluetooth device */ if (device->is_bluetooth) { if (HIDAPI_HasConnectedUSBDevice(device->serial)) { @@ -496,14 +541,12 @@ HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverPS5_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverPS5_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; int i, size; @@ -595,8 +638,7 @@ HIDAPI_DriverPS5_LoadCalibrationData(SDL_HIDAPI_Device *device) } } -static float -HIDAPI_DriverPS5_ApplyCalibrationData(SDL_DriverPS5_Context *ctx, int index, Sint16 value) +static float HIDAPI_DriverPS5_ApplyCalibrationData(SDL_DriverPS5_Context *ctx, int index, Sint16 value) { float result; @@ -619,8 +661,7 @@ HIDAPI_DriverPS5_ApplyCalibrationData(SDL_DriverPS5_Context *ctx, int index, Sin return result; } -static int -HIDAPI_DriverPS5_UpdateEffects(SDL_HIDAPI_Device *device, int effect_mask) +static int HIDAPI_DriverPS5_UpdateEffects(SDL_HIDAPI_Device *device, int effect_mask) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; DS5EffectsState_t effects; @@ -632,7 +673,7 @@ HIDAPI_DriverPS5_UpdateEffects(SDL_HIDAPI_Device *device, int effect_mask) SDL_zero(effects); /* Make sure the Bluetooth connection sequence has completed before sending LED color change */ - if (device->is_bluetooth && + if (device->is_bluetooth && (effect_mask & (k_EDS5EffectLED | k_EDS5EffectPadLights)) != 0) { if (ctx->led_reset_state != k_EDS5LEDResetStateComplete) { ctx->led_reset_state = k_EDS5LEDResetStatePending; @@ -697,19 +738,18 @@ HIDAPI_DriverPS5_UpdateEffects(SDL_HIDAPI_Device *device, int effect_mask) if ((effect_mask & k_EDS5EffectMicLight) != 0) { effects.ucEnableBits2 |= 0x01; /* Enable microphone light */ - effects.ucMicLightMode = 0; /* Bitmask, 0x00 = off, 0x01 = solid, 0x02 = pulse */ + effects.ucMicLightMode = 0; /* Bitmask, 0x00 = off, 0x01 = solid, 0x02 = pulse */ } return HIDAPI_DriverPS5_SendJoystickEffect(device, ctx->joystick, &effects, sizeof(effects)); } -static void -HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; SDL_bool led_reset_complete = SDL_FALSE; - if (ctx->sensors_supported) { + if (ctx->enhanced_mode && ctx->sensors_supported && !ctx->use_alternate_report) { const PS5StatePacketCommon_t *packet = &ctx->last_state.state; /* Check the timer to make sure the Bluetooth connection LED animation is complete */ @@ -718,7 +758,7 @@ HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device) packet->rgucSensorTimestamp[1], packet->rgucSensorTimestamp[2], packet->rgucSensorTimestamp[3]); - if (SDL_TICKS_PASSED(timestamp, connection_complete)) { + if (timestamp >= connection_complete) { led_reset_complete = SDL_TRUE; } } else { @@ -735,24 +775,31 @@ HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device) } } -static void -HIDAPI_DriverPS5_TickleBluetooth(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS5_TickleBluetooth(SDL_HIDAPI_Device *device) { - /* This is just a dummy packet that should have no effect, since we don't set the CRC */ - Uint8 data[78]; + SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; - SDL_zeroa(data); + if (ctx->enhanced_mode) { + /* This is just a dummy packet that should have no effect, since we don't set the CRC */ + Uint8 data[78]; - data[0] = k_EPS5ReportIdBluetoothEffects; - data[1] = 0x02; /* Magic value */ + SDL_zeroa(data); + + data[0] = k_EPS5ReportIdBluetoothEffects; + data[1] = 0x02; /* Magic value */ - if (SDL_HIDAPI_LockRumble() == 0) { - SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data)); + if (SDL_HIDAPI_LockRumble() == 0) { + SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data)); + } + } else { + /* We can't even send an invalid effects packet, or it will put the controller in enhanced mode */ + if (device->num_joysticks > 0) { + HIDAPI_JoystickDisconnected(device, device->joysticks[0]); + } } } -static void -HIDAPI_DriverPS5_SetEnhancedMode(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS5_SetEnhancedMode(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -804,8 +851,7 @@ static void SDLCALL SDL_PS5PlayerLEDHintChanged(void *userdata, const char *name } } -static void -HIDAPI_DriverPS5_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverPS5_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -819,11 +865,12 @@ HIDAPI_DriverPS5_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID HIDAPI_DriverPS5_UpdateEffects(device, (k_EDS5EffectLED | k_EDS5EffectPadLights)); } -static SDL_bool -HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->joystick = joystick; ctx->last_packet = SDL_GetTicks(); ctx->report_sensors = SDL_FALSE; @@ -839,7 +886,13 @@ HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) ctx->player_lights = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED, SDL_TRUE); /* Initialize the joystick capabilities */ - joystick->nbuttons = ctx->touchpad_supported ? 17 : 15; + if (SDL_IsJoystickDualSenseEdge(device->vendor_id, device->product_id)) { + joystick->nbuttons = 21; + } else if (ctx->touchpad_supported) { + joystick->nbuttons = 17; + } else { + joystick->nbuttons = 15; + } joystick->naxes = SDL_CONTROLLER_AXIS_MAX; joystick->epowerlevel = device->is_bluetooth ? SDL_JOYSTICK_POWER_UNKNOWN : SDL_JOYSTICK_POWER_WIRED; joystick->firmware_version = ctx->firmware_version; @@ -858,8 +911,7 @@ HIDAPI_DriverPS5_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) return SDL_TRUE; } -static int -HIDAPI_DriverPS5_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverPS5_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -877,14 +929,12 @@ HIDAPI_DriverPS5_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return HIDAPI_DriverPS5_UpdateEffects(device, k_EDS5EffectRumble); } -static int -HIDAPI_DriverPS5_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverPS5_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverPS5_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverPS5_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; Uint32 result = 0; @@ -901,8 +951,7 @@ HIDAPI_DriverPS5_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick return result; } -static int -HIDAPI_DriverPS5_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverPS5_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -918,8 +967,7 @@ HIDAPI_DriverPS5_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return HIDAPI_DriverPS5_UpdateEffects(device, k_EDS5EffectLED); } -static int -HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) +static int HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *effect, int size) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; Uint8 data[78]; @@ -940,7 +988,7 @@ HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy if (device->is_bluetooth) { data[0] = k_EPS5ReportIdBluetoothEffects; - data[1] = 0x02; /* Magic value */ + data[1] = 0x02; /* Magic value */ report_size = 78; offset = 2; @@ -962,7 +1010,7 @@ HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy SDL_memcpy(&data[report_size - sizeof(unCRC)], &unCRC, sizeof(unCRC)); } - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return -1; } @@ -987,8 +1035,7 @@ HIDAPI_DriverPS5_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joy return 0; } -static int -HIDAPI_DriverPS5_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverPS5_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -1005,8 +1052,7 @@ HIDAPI_DriverPS5_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joysti return 0; } -static void -HIDAPI_DriverPS5_HandleSimpleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5SimpleStatePacket_t *packet) +static void HIDAPI_DriverPS5_HandleSimpleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5SimpleStatePacket_t *packet) { Sint16 axis; @@ -1080,12 +1126,20 @@ HIDAPI_DriverPS5_HandleSimpleStatePacket(SDL_Joystick *joystick, SDL_hid_device Uint8 data = (packet->rgucButtonsHatAndCounter[2] & 0x03); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data & 0x01) ? SDL_PRESSED : SDL_RELEASED); - SDL_PrivateJoystickButton(joystick, 15, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED); } - axis = ((int)packet->ucTriggerLeft * 257) - 32768; + if (packet->ucTriggerLeft == 0 && (packet->rgucButtonsHatAndCounter[1] & 0x04)) { + axis = SDL_JOYSTICK_AXIS_MAX; + } else { + axis = ((int)packet->ucTriggerLeft * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); - axis = ((int)packet->ucTriggerRight * 257) - 32768; + if (packet->ucTriggerRight == 0 && (packet->rgucButtonsHatAndCounter[1] & 0x08)) { + axis = SDL_JOYSTICK_AXIS_MAX; + } else { + axis = ((int)packet->ucTriggerRight * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); axis = ((int)packet->ucLeftJoystickX * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -1099,8 +1153,7 @@ HIDAPI_DriverPS5_HandleSimpleStatePacket(SDL_Joystick *joystick, SDL_hid_device SDL_memcpy(&ctx->last_state.simple, packet, sizeof(ctx->last_state.simple)); } -static void -HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacketCommon_t *packet) +static void HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacketCommon_t *packet) { Sint16 axis; @@ -1174,13 +1227,25 @@ HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL_hid_device Uint8 data = packet->rgucButtonsAndHat[2]; SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data & 0x01) ? SDL_PRESSED : SDL_RELEASED); - SDL_PrivateJoystickButton(joystick, 15, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED); - SDL_PrivateJoystickButton(joystick, 16, (data & 0x04) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PS5_TOUCHPAD, (data & 0x04) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PS5_LEFT_FUNCTION, (data & 0x10) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PS5_RIGHT_FUNCTION, (data & 0x20) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PS5_LEFT_PADDLE, (data & 0x40) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PS5_RIGHT_PADDLE, (data & 0x80) ? SDL_PRESSED : SDL_RELEASED); } - axis = ((int)packet->ucTriggerLeft * 257) - 32768; + if (packet->ucTriggerLeft == 0 && (packet->rgucButtonsAndHat[1] & 0x04)) { + axis = SDL_JOYSTICK_AXIS_MAX; + } else { + axis = ((int)packet->ucTriggerLeft * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); - axis = ((int)packet->ucTriggerRight * 257) - 32768; + if (packet->ucTriggerRight == 0 && (packet->rgucButtonsAndHat[1] & 0x08)) { + axis = SDL_JOYSTICK_AXIS_MAX; + } else { + axis = ((int)packet->ucTriggerRight * 257) - 32768; + } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); axis = ((int)packet->ucLeftJoystickX * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -1192,30 +1257,56 @@ HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL_hid_device SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); if (ctx->report_sensors) { - Uint32 timestamp; - Uint64 timestamp_us; float data[3]; + Uint64 timestamp_us; + + if (ctx->use_alternate_report) { + /* 16-bit timestamp */ + Uint16 timestamp; - timestamp = LOAD32(packet->rgucSensorTimestamp[0], - packet->rgucSensorTimestamp[1], - packet->rgucSensorTimestamp[2], - packet->rgucSensorTimestamp[3]); - if (ctx->timestamp) { - Uint32 delta; + timestamp = LOAD16(packet->rgucSensorTimestamp[0], + packet->rgucSensorTimestamp[1]); + if (ctx->timestamp) { + Uint16 delta; - if (ctx->last_timestamp > timestamp) { - delta = (SDL_MAX_UINT32 - ctx->last_timestamp + timestamp + 1); + if (ctx->last_timestamp > timestamp) { + delta = (SDL_MAX_UINT16 - ctx->last_timestamp + timestamp + 1); + } else { + delta = (timestamp - ctx->last_timestamp); + } + ctx->timestamp += delta; } else { - delta = (timestamp - ctx->last_timestamp); + ctx->timestamp = timestamp; } - ctx->timestamp += delta; + ctx->last_timestamp = timestamp; + + /* Sensor timestamp is in 1us units */ + timestamp_us = ctx->timestamp; } else { - ctx->timestamp = timestamp; - } - ctx->last_timestamp = timestamp; + /* 32-bit timestamp */ + Uint32 timestamp; + + timestamp = LOAD32(packet->rgucSensorTimestamp[0], + packet->rgucSensorTimestamp[1], + packet->rgucSensorTimestamp[2], + packet->rgucSensorTimestamp[3]); + if (ctx->timestamp) { + Uint32 delta; + + if (ctx->last_timestamp > timestamp) { + delta = (SDL_MAX_UINT32 - ctx->last_timestamp + timestamp + 1); + } else { + delta = (timestamp - ctx->last_timestamp); + } + ctx->timestamp += delta; + } else { + ctx->timestamp = timestamp; + } + ctx->last_timestamp = timestamp; - /* Sensor timestamp is in 0.33us units */ - timestamp_us = ctx->timestamp / 3; + /* Sensor timestamp is in 0.33us units */ + timestamp_us = ctx->timestamp / 3; + } data[0] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 0, LOAD16(packet->rgucGyroX[0], packet->rgucGyroX[1])); data[1] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 1, LOAD16(packet->rgucGyroY[0], packet->rgucGyroY[1])); @@ -1229,8 +1320,7 @@ HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL_hid_device } } -static void -HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacket_t *packet) +static void HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacket_t *packet) { static const float TOUCHPAD_SCALEX = 1.0f / 1920; static const float TOUCHPAD_SCALEY = 1.0f / 1070; @@ -1238,12 +1328,12 @@ HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, int touchpad_x, touchpad_y; if (ctx->report_touchpad) { - touchpad_state = ((packet->ucTouchpadCounter1 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; + touchpad_state = !(packet->ucTouchpadCounter1 & 0x80) ? SDL_PRESSED : SDL_RELEASED; touchpad_x = packet->rgucTouchpadData1[0] | (((int)packet->rgucTouchpadData1[1] & 0x0F) << 8); touchpad_y = (packet->rgucTouchpadData1[1] >> 4) | ((int)packet->rgucTouchpadData1[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 0, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); - touchpad_state = ((packet->ucTouchpadCounter2 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; + touchpad_state = !(packet->ucTouchpadCounter2 & 0x80) ? SDL_PRESSED : SDL_RELEASED; touchpad_x = packet->rgucTouchpadData2[0] | (((int)packet->rgucTouchpadData2[1] & 0x0F) << 8); touchpad_y = (packet->rgucTouchpadData2[1] >> 4) | ((int)packet->rgucTouchpadData2[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 1, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); @@ -1272,8 +1362,7 @@ HIDAPI_DriverPS5_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_memcpy(&ctx->last_state, packet, sizeof(ctx->last_state)); } -static void -HIDAPI_DriverPS5_HandleStatePacketAlt(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacketAlt_t *packet) +static void HIDAPI_DriverPS5_HandleStatePacketAlt(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverPS5_Context *ctx, PS5StatePacketAlt_t *packet) { static const float TOUCHPAD_SCALEX = 1.0f / 1920; static const float TOUCHPAD_SCALEY = 1.0f / 1070; @@ -1281,22 +1370,21 @@ HIDAPI_DriverPS5_HandleStatePacketAlt(SDL_Joystick *joystick, SDL_hid_device *de int touchpad_x, touchpad_y; if (ctx->report_touchpad) { - touchpad_state = ((packet->ucTouchpadCounter1 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; - touchpad_x = packet->rgucTouchpadData1[0] | (((int) packet->rgucTouchpadData1[1] & 0x0F) << 8); - touchpad_y = (packet->rgucTouchpadData1[1] >> 4) | ((int) packet->rgucTouchpadData1[2] << 4); + touchpad_state = !(packet->ucTouchpadCounter1 & 0x80) ? SDL_PRESSED : SDL_RELEASED; + touchpad_x = packet->rgucTouchpadData1[0] | (((int)packet->rgucTouchpadData1[1] & 0x0F) << 8); + touchpad_y = (packet->rgucTouchpadData1[1] >> 4) | ((int)packet->rgucTouchpadData1[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 0, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); - touchpad_state = ((packet->ucTouchpadCounter2 & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; - touchpad_x = packet->rgucTouchpadData2[0] | (((int) packet->rgucTouchpadData2[1] & 0x0F) << 8); - touchpad_y = (packet->rgucTouchpadData2[1] >> 4) | ((int) packet->rgucTouchpadData2[2] << 4); + touchpad_state = !(packet->ucTouchpadCounter2 & 0x80) ? SDL_PRESSED : SDL_RELEASED; + touchpad_x = packet->rgucTouchpadData2[0] | (((int)packet->rgucTouchpadData2[1] & 0x0F) << 8); + touchpad_y = (packet->rgucTouchpadData2[1] >> 4) | ((int)packet->rgucTouchpadData2[2] << 4); SDL_PrivateJoystickTouchpad(joystick, 0, 1, touchpad_state, touchpad_x * TOUCHPAD_SCALEX, touchpad_y * TOUCHPAD_SCALEY, touchpad_state ? 1.0f : 0.0f); } SDL_memcpy(&ctx->last_state, packet, sizeof(ctx->last_state)); } -static SDL_bool -VerifyCRC(Uint8 *data, int size) +static SDL_bool VerifyCRC(Uint8 *data, int size) { Uint8 ubHdr = 0xA1; /* hidp header is part of the CRC calculation */ Uint32 unCRC, unPacketCRC; @@ -1311,11 +1399,24 @@ VerifyCRC(Uint8 *data, int size) return (unCRC == unPacketCRC) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverPS5_IsPacketValid(SDL_DriverPS5_Context *ctx, Uint8 *data, int size) +static SDL_bool HIDAPI_DriverPS5_IsPacketValid(SDL_DriverPS5_Context *ctx, Uint8 *data, int size) { switch (data[0]) { case k_EPS5ReportIdState: + if (ctx->is_nacon_dongle && size >= (1 + sizeof(PS5StatePacketAlt_t))) { + /* The report timestamp doesn't change when the controller isn't connected */ + PS5StatePacketAlt_t *packet = (PS5StatePacketAlt_t *)&data[1]; + if (SDL_memcmp(packet->rgucPacketSequence, ctx->last_state.state.rgucPacketSequence, sizeof(packet->rgucPacketSequence)) == 0) { + return SDL_FALSE; + } + if (ctx->last_state.alt_state.rgucAccelX[0] == 0 && ctx->last_state.alt_state.rgucAccelX[1] == 0 && + ctx->last_state.alt_state.rgucAccelY[0] == 0 && ctx->last_state.alt_state.rgucAccelY[1] == 0 && + ctx->last_state.alt_state.rgucAccelZ[0] == 0 && ctx->last_state.alt_state.rgucAccelZ[1] == 0) { + /* We don't have any state to compare yet, go ahead and copy it */ + SDL_memcpy(&ctx->last_state, &data[1], sizeof(PS5StatePacketAlt_t)); + return SDL_FALSE; + } + } return SDL_TRUE; case k_EPS5ReportIdBluetoothState: @@ -1329,12 +1430,11 @@ HIDAPI_DriverPS5_IsPacketValid(SDL_DriverPS5_Context *ctx, Uint8 *data, int size return SDL_FALSE; } -static SDL_bool -HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; SDL_Joystick *joystick = NULL; - Uint8 data[USB_PACKET_LENGTH*2]; + Uint8 data[USB_PACKET_LENGTH * 2]; int size; int packet_count = 0; Uint32 now = SDL_GetTicks(); @@ -1376,15 +1476,15 @@ HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) /* This is the extended report, we can enable effects now */ HIDAPI_DriverPS5_SetEnhancedMode(device, joystick); } - if (ctx->led_reset_state == k_EDS5LEDResetStatePending) { - HIDAPI_DriverPS5_CheckPendingLEDReset(device); - } HIDAPI_DriverPS5_HandleStatePacketCommon(joystick, device->dev, ctx, (PS5StatePacketCommon_t *)&data[2]); if (ctx->use_alternate_report) { HIDAPI_DriverPS5_HandleStatePacketAlt(joystick, device->dev, ctx, (PS5StatePacketAlt_t *)&data[2]); } else { HIDAPI_DriverPS5_HandleStatePacket(joystick, device->dev, ctx, (PS5StatePacket_t *)&data[2]); } + if (ctx->led_reset_state == k_EDS5LEDResetStatePending) { + HIDAPI_DriverPS5_CheckPendingLEDReset(device); + } break; default: #ifdef DEBUG_JOYSTICK @@ -1400,6 +1500,7 @@ HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) if (SDL_TICKS_PASSED(now, ctx->last_packet + BLUETOOTH_DISCONNECT_TIMEOUT_MS)) { /* Send an empty output report to tickle the Bluetooth stack */ HIDAPI_DriverPS5_TickleBluetooth(device); + ctx->last_packet = now; } } else { /* Reconnect the Bluetooth device once the USB device is gone */ @@ -1410,15 +1511,29 @@ HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) } } - if (size < 0 && device->num_joysticks > 0) { + if (ctx->is_nacon_dongle) { + if (packet_count == 0) { + if (device->num_joysticks > 0) { + /* Check to see if it looks like the device disconnected */ + if (SDL_TICKS_PASSED(now, ctx->last_packet + BLUETOOTH_DISCONNECT_TIMEOUT_MS)) { + HIDAPI_JoystickDisconnected(device, device->joysticks[0]); + } + } + } else { + if (device->num_joysticks == 0) { + HIDAPI_JoystickConnected(device, NULL); + } + } + } + + if (packet_count == 0 && size < 0 && device->num_joysticks > 0) { /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverPS5_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverPS5_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context; @@ -1431,13 +1546,11 @@ HIDAPI_DriverPS5_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick ctx->joystick = NULL; } -static void -HIDAPI_DriverPS5_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverPS5_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5 = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5 = { SDL_HINT_JOYSTICK_HIDAPI_PS5, SDL_TRUE, HIDAPI_DriverPS5_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_rumble.c b/src/joystick/hidapi/SDL_hidapi_rumble.c index e15ecf0524c67..8cacc3362ad68 100644 --- a/src/joystick/hidapi/SDL_hidapi_rumble.c +++ b/src/joystick/hidapi/SDL_hidapi_rumble.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,11 +30,10 @@ #include "SDL_hidapi_rumble.h" #include "../../thread/SDL_systhread.h" - typedef struct SDL_HIDAPI_RumbleRequest { SDL_HIDAPI_Device *device; - Uint8 data[2*USB_PACKET_LENGTH]; /* need enough space for the biggest report: dualshock4 is 78 bytes */ + Uint8 data[2 * USB_PACKET_LENGTH]; /* need enough space for the biggest report: dualshock4 is 78 bytes */ int size; SDL_HIDAPI_RumbleSentCallback callback; void *userdata; @@ -47,13 +46,16 @@ typedef struct SDL_HIDAPI_RumbleContext SDL_atomic_t initialized; SDL_atomic_t running; SDL_Thread *thread; - SDL_mutex *lock; SDL_sem *request_sem; SDL_HIDAPI_RumbleRequest *requests_head; SDL_HIDAPI_RumbleRequest *requests_tail; } SDL_HIDAPI_RumbleContext; -static SDL_HIDAPI_RumbleContext rumble_context; +#ifndef SDL_THREAD_SAFETY_ANALYSIS +static +#endif +SDL_mutex *SDL_HIDAPI_rumble_lock; +static SDL_HIDAPI_RumbleContext rumble_context SDL_GUARDED_BY(SDL_HIDAPI_rumble_lock); static int SDLCALL SDL_HIDAPI_RumbleThread(void *data) { @@ -66,7 +68,7 @@ static int SDLCALL SDL_HIDAPI_RumbleThread(void *data) SDL_SemWait(ctx->request_sem); - SDL_LockMutex(ctx->lock); + SDL_LockMutex(SDL_HIDAPI_rumble_lock); request = ctx->requests_tail; if (request) { if (request == ctx->requests_head) { @@ -74,7 +76,7 @@ static int SDLCALL SDL_HIDAPI_RumbleThread(void *data) } ctx->requests_tail = request->prev; } - SDL_UnlockMutex(ctx->lock); + SDL_UnlockMutex(SDL_HIDAPI_rumble_lock); if (request) { SDL_LockMutex(request->device->dev_lock); @@ -98,8 +100,7 @@ static int SDLCALL SDL_HIDAPI_RumbleThread(void *data) return 0; } -static void -SDL_HIDAPI_StopRumbleThread(SDL_HIDAPI_RumbleContext *ctx) +static void SDL_HIDAPI_StopRumbleThread(SDL_HIDAPI_RumbleContext *ctx) { SDL_HIDAPI_RumbleRequest *request; @@ -113,7 +114,7 @@ SDL_HIDAPI_StopRumbleThread(SDL_HIDAPI_RumbleContext *ctx) ctx->thread = NULL; } - SDL_LockMutex(ctx->lock); + SDL_LockMutex(SDL_HIDAPI_rumble_lock); while (ctx->requests_tail) { request = ctx->requests_tail; if (request == ctx->requests_head) { @@ -127,26 +128,25 @@ SDL_HIDAPI_StopRumbleThread(SDL_HIDAPI_RumbleContext *ctx) (void)SDL_AtomicDecRef(&request->device->rumble_pending); SDL_free(request); } - SDL_UnlockMutex(ctx->lock); + SDL_UnlockMutex(SDL_HIDAPI_rumble_lock); if (ctx->request_sem) { SDL_DestroySemaphore(ctx->request_sem); ctx->request_sem = NULL; } - if (ctx->lock) { - SDL_DestroyMutex(ctx->lock); - ctx->lock = NULL; + if (SDL_HIDAPI_rumble_lock) { + SDL_DestroyMutex(SDL_HIDAPI_rumble_lock); + SDL_HIDAPI_rumble_lock = NULL; } SDL_AtomicSet(&ctx->initialized, SDL_FALSE); } -static int -SDL_HIDAPI_StartRumbleThread(SDL_HIDAPI_RumbleContext *ctx) +static int SDL_HIDAPI_StartRumbleThread(SDL_HIDAPI_RumbleContext *ctx) { - ctx->lock = SDL_CreateMutex(); - if (!ctx->lock) { + SDL_HIDAPI_rumble_lock = SDL_CreateMutex(); + if (!SDL_HIDAPI_rumble_lock) { SDL_HIDAPI_StopRumbleThread(ctx); return -1; } @@ -176,7 +176,8 @@ int SDL_HIDAPI_LockRumble(void) } } - return SDL_LockMutex(ctx->lock); + SDL_LockMutex(SDL_HIDAPI_rumble_lock); + return 0; } SDL_bool SDL_HIDAPI_GetPendingRumbleLocked(SDL_HIDAPI_Device *device, Uint8 **data, int **size, int *maximum_size) @@ -226,7 +227,7 @@ int SDL_HIDAPI_SendRumbleWithCallbackAndUnlock(SDL_HIDAPI_Device *device, const request->userdata = userdata; SDL_AtomicIncRef(&device->rumble_pending); - + if (ctx->requests_head) { ctx->requests_head->prev = request; } else { @@ -244,9 +245,7 @@ int SDL_HIDAPI_SendRumbleWithCallbackAndUnlock(SDL_HIDAPI_Device *device, const void SDL_HIDAPI_UnlockRumble(void) { - SDL_HIDAPI_RumbleContext *ctx = &rumble_context; - - SDL_UnlockMutex(ctx->lock); + SDL_UnlockMutex(SDL_HIDAPI_rumble_lock); } int SDL_HIDAPI_SendRumble(SDL_HIDAPI_Device *device, const Uint8 *data, int size) @@ -259,7 +258,7 @@ int SDL_HIDAPI_SendRumble(SDL_HIDAPI_Device *device, const Uint8 *data, int size return SDL_SetError("Tried to send rumble with invalid size"); } - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return -1; } diff --git a/src/joystick/hidapi/SDL_hidapi_rumble.h b/src/joystick/hidapi/SDL_hidapi_rumble.h index bf9f1adba5839..fa5158ab1b663 100644 --- a/src/joystick/hidapi/SDL_hidapi_rumble.h +++ b/src/joystick/hidapi/SDL_hidapi_rumble.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,12 +25,15 @@ /* Handle rumble on a separate thread so it doesn't block the application */ /* Advanced API */ -int SDL_HIDAPI_LockRumble(void); +#ifdef SDL_THREAD_SAFETY_ANALYSIS +extern SDL_mutex *SDL_HIDAPI_rumble_lock; +#endif +int SDL_HIDAPI_LockRumble(void) SDL_TRY_ACQUIRE(0, SDL_HIDAPI_rumble_lock); SDL_bool SDL_HIDAPI_GetPendingRumbleLocked(SDL_HIDAPI_Device *device, Uint8 **data, int **size, int *maximum_size); -int SDL_HIDAPI_SendRumbleAndUnlock(SDL_HIDAPI_Device *device, const Uint8 *data, int size); +int SDL_HIDAPI_SendRumbleAndUnlock(SDL_HIDAPI_Device *device, const Uint8 *data, int size) SDL_RELEASE(SDL_HIDAPI_rumble_lock); typedef void (*SDL_HIDAPI_RumbleSentCallback)(void *userdata); -int SDL_HIDAPI_SendRumbleWithCallbackAndUnlock(SDL_HIDAPI_Device *device, const Uint8 *data, int size, SDL_HIDAPI_RumbleSentCallback callback, void *userdata); -void SDL_HIDAPI_UnlockRumble(void); +int SDL_HIDAPI_SendRumbleWithCallbackAndUnlock(SDL_HIDAPI_Device *device, const Uint8 *data, int size, SDL_HIDAPI_RumbleSentCallback callback, void *userdata) SDL_RELEASE(SDL_HIDAPI_rumble_lock); +void SDL_HIDAPI_UnlockRumble(void) SDL_RELEASE(SDL_HIDAPI_rumble_lock); /* Simple API, will replace any pending rumble with the new data */ int SDL_HIDAPI_SendRumble(SDL_HIDAPI_Device *device, const Uint8 *data, int size); diff --git a/src/joystick/hidapi/SDL_hidapi_shield.c b/src/joystick/hidapi/SDL_hidapi_shield.c index 4fe00901c3c26..0507ca1693db6 100644 --- a/src/joystick/hidapi/SDL_hidapi_shield.c +++ b/src/joystick/hidapi/SDL_hidapi_shield.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,15 +30,14 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_SHIELD /* Define this if you want to log all packets from the controller */ /*#define DEBUG_SHIELD_PROTOCOL*/ #define CMD_BATTERY_STATE 0x07 -#define CMD_RUMBLE 0x39 -#define CMD_CHARGE_STATE 0x3A +#define CMD_RUMBLE 0x39 +#define CMD_CHARGE_STATE 0x3A /* Milliseconds between polls of battery state */ #define BATTERY_POLL_INTERVAL_MS 60000 @@ -59,7 +58,8 @@ enum SDL_CONTROLLER_NUM_SHIELD_V104_BUTTONS = SDL_CONTROLLER_BUTTON_MISC1 + 1, }; -typedef enum { +typedef enum +{ k_ShieldReportIdControllerState = 0x01, k_ShieldReportIdControllerTouch = 0x02, k_ShieldReportIdCommandResponse = 0x03, @@ -67,7 +67,8 @@ typedef enum { } EShieldReportId; /* This same report structure is used for both requests and responses */ -typedef struct { +typedef struct +{ Uint8 report_id; Uint8 cmd; Uint8 seq_num; @@ -75,7 +76,8 @@ typedef struct { } ShieldCommandReport_t; SDL_COMPILE_TIME_ASSERT(ShieldCommandReport_t, sizeof(ShieldCommandReport_t) == HID_REPORT_SIZE); -typedef struct { +typedef struct +{ Uint8 seq_num; SDL_JoystickPowerLevel battery_level; @@ -91,35 +93,27 @@ typedef struct { Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverShield_Context; - -static void -HIDAPI_DriverShield_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverShield_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_SHIELD, callback, userdata); } -static void -HIDAPI_DriverShield_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverShield_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_SHIELD, callback, userdata); } -static SDL_bool -HIDAPI_DriverShield_IsEnabled(void) +static SDL_bool HIDAPI_DriverShield_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SHIELD, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SHIELD, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverShield_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverShield_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { return (type == SDL_CONTROLLER_TYPE_NVIDIA_SHIELD) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverShield_Context *ctx; @@ -136,19 +130,16 @@ HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverShield_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverShield_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverShield_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverShield_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static int -HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void *data, int size) +static int HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void *data, int size) { SDL_DriverShield_Context *ctx = (SDL_DriverShield_Context *)device->context; ShieldCommandReport_t cmd_pkt; @@ -157,7 +148,7 @@ HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void return SDL_SetError("Command data exceeds HID report size"); } - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return -1; } @@ -173,18 +164,19 @@ HIDAPI_DriverShield_SendCommand(SDL_HIDAPI_Device *device, Uint8 cmd, const void SDL_memset(&cmd_pkt.payload[size], 0, sizeof(cmd_pkt.payload) - size); } - if (SDL_HIDAPI_SendRumbleAndUnlock(device, (Uint8*)&cmd_pkt, sizeof(cmd_pkt)) != sizeof(cmd_pkt)) { + if (SDL_HIDAPI_SendRumbleAndUnlock(device, (Uint8 *)&cmd_pkt, sizeof(cmd_pkt)) != sizeof(cmd_pkt)) { return SDL_SetError("Couldn't send command packet"); } return 0; } -static SDL_bool -HIDAPI_DriverShield_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverShield_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverShield_Context *ctx = (SDL_DriverShield_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->rumble_report_pending = SDL_FALSE; ctx->rumble_update_pending = SDL_FALSE; ctx->left_motor_amplitude = 0; @@ -213,8 +205,7 @@ HIDAPI_DriverShield_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti return SDL_TRUE; } -static int -HIDAPI_DriverShield_SendNextRumble(SDL_HIDAPI_Device *device) +static int HIDAPI_DriverShield_SendNextRumble(SDL_HIDAPI_Device *device) { SDL_DriverShield_Context *ctx = device->context; Uint8 rumble_data[3]; @@ -233,8 +224,7 @@ HIDAPI_DriverShield_SendNextRumble(SDL_HIDAPI_Device *device) return HIDAPI_DriverShield_SendCommand(device, CMD_RUMBLE, rumble_data, sizeof(rumble_data)); } -static int -HIDAPI_DriverShield_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverShield_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { if (device->product_id == USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103) { Uint8 rumble_packet[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -264,26 +254,22 @@ HIDAPI_DriverShield_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys } } -static int -HIDAPI_DriverShield_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverShield_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverShield_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverShield_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { return SDL_JOYCAP_RUMBLE; } -static int -HIDAPI_DriverShield_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverShield_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverShield_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverShield_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { const Uint8 *data_bytes = data; @@ -298,14 +284,12 @@ HIDAPI_DriverShield_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick * } } -static int -HIDAPI_DriverShield_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverShield_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverShield_HandleStatePacketV103(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverShield_HandleStatePacketV103(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, Uint8 *data, int size) { if (ctx->last_state[3] != data[3]) { SDL_bool dpad_up = SDL_FALSE; @@ -371,14 +355,14 @@ HIDAPI_DriverShield_HandleStatePacketV103(SDL_Joystick *joystick, SDL_DriverShie SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data[2] & 0x80) ? SDL_PRESSED : SDL_RELEASED); } - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, SDL_SwapLE16(*(Sint16*)&data[4]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, SDL_SwapLE16(*(Sint16*)&data[6]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, SDL_SwapLE16(*(Sint16 *)&data[4]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, SDL_SwapLE16(*(Sint16 *)&data[6]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, SDL_SwapLE16(*(Sint16*)&data[8]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, SDL_SwapLE16(*(Sint16*)&data[10]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, SDL_SwapLE16(*(Sint16 *)&data[8]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, SDL_SwapLE16(*(Sint16 *)&data[10]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_SwapLE16(*(Sint16*)&data[12]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_SwapLE16(*(Sint16*)&data[14]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_SwapLE16(*(Sint16 *)&data[12]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_SwapLE16(*(Sint16 *)&data[14]) - 0x8000); SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } @@ -386,8 +370,7 @@ HIDAPI_DriverShield_HandleStatePacketV103(SDL_Joystick *joystick, SDL_DriverShie #undef clamp #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val))) -static void -HIDAPI_DriverShield_HandleTouchPacketV103(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverShield_HandleTouchPacketV103(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, const Uint8 *data, int size) { Uint8 touchpad_state; float touchpad_x, touchpad_y; @@ -395,14 +378,13 @@ HIDAPI_DriverShield_HandleTouchPacketV103(SDL_Joystick *joystick, SDL_DriverShie SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_SHIELD_V103_TOUCHPAD, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); /* It's a triangular pad, but just use the center as the usable touch area */ - touchpad_state = ((data[1] & 0x80) == 0) ? SDL_PRESSED : SDL_RELEASED; + touchpad_state = !(data[1] & 0x80) ? SDL_PRESSED : SDL_RELEASED; touchpad_x = clamp((float)(data[2] - 0x70) / 0x50, 0.0f, 1.0f); touchpad_y = clamp((float)(data[4] - 0x40) / 0x15, 0.0f, 1.0f); SDL_PrivateJoystickTouchpad(joystick, 0, 0, touchpad_state, touchpad_x, touchpad_y, touchpad_state ? 1.0f : 0.0f); } -static void -HIDAPI_DriverShield_HandleStatePacketV104(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverShield_HandleStatePacketV104(SDL_Joystick *joystick, SDL_DriverShield_Context *ctx, Uint8 *data, int size) { if (size < 23) { return; @@ -467,14 +449,14 @@ HIDAPI_DriverShield_HandleStatePacketV104(SDL_Joystick *joystick, SDL_DriverShie SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[4] & 0x01) ? SDL_PRESSED : SDL_RELEASED); } - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, SDL_SwapLE16(*(Sint16*)&data[9]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, SDL_SwapLE16(*(Sint16*)&data[11]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, SDL_SwapLE16(*(Sint16 *)&data[9]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, SDL_SwapLE16(*(Sint16 *)&data[11]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, SDL_SwapLE16(*(Sint16*)&data[13]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, SDL_SwapLE16(*(Sint16*)&data[15]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, SDL_SwapLE16(*(Sint16 *)&data[13]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, SDL_SwapLE16(*(Sint16 *)&data[15]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_SwapLE16(*(Sint16*)&data[19]) - 0x8000); - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_SwapLE16(*(Sint16*)&data[21]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, SDL_SwapLE16(*(Sint16 *)&data[19]) - 0x8000); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_SwapLE16(*(Sint16 *)&data[21]) - 0x8000); if (ctx->last_state[17] != data[17]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data[17] & 0x01) ? SDL_PRESSED : SDL_RELEASED); @@ -485,8 +467,7 @@ HIDAPI_DriverShield_HandleStatePacketV104(SDL_Joystick *joystick, SDL_DriverShie SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverShield_Context *ctx = (SDL_DriverShield_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -507,61 +488,61 @@ HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device) /* Byte 0 is HID report ID */ switch (data[0]) { - case k_ShieldReportIdControllerState: - if (!joystick) { - break; - } - if (size == 16) { - HIDAPI_DriverShield_HandleStatePacketV103(joystick, ctx, data, size); - } else { - HIDAPI_DriverShield_HandleStatePacketV104(joystick, ctx, data, size); + case k_ShieldReportIdControllerState: + if (!joystick) { + break; + } + if (size == 16) { + HIDAPI_DriverShield_HandleStatePacketV103(joystick, ctx, data, size); + } else { + HIDAPI_DriverShield_HandleStatePacketV104(joystick, ctx, data, size); + } + break; + case k_ShieldReportIdControllerTouch: + if (!joystick) { + break; + } + HIDAPI_DriverShield_HandleTouchPacketV103(joystick, ctx, data, size); + break; + case k_ShieldReportIdCommandResponse: + cmd_resp_report = (ShieldCommandReport_t *)data; + switch (cmd_resp_report->cmd) { + case CMD_RUMBLE: + ctx->rumble_report_pending = SDL_FALSE; + HIDAPI_DriverShield_SendNextRumble(device); + break; + case CMD_CHARGE_STATE: + ctx->charging = cmd_resp_report->payload[0] != 0; + if (joystick) { + SDL_PrivateJoystickBatteryLevel(joystick, ctx->charging ? SDL_JOYSTICK_POWER_WIRED : ctx->battery_level); } break; - case k_ShieldReportIdControllerTouch: - if (!joystick) { + case CMD_BATTERY_STATE: + switch (cmd_resp_report->payload[2]) { + case 0: + ctx->battery_level = SDL_JOYSTICK_POWER_EMPTY; + break; + case 1: + ctx->battery_level = SDL_JOYSTICK_POWER_LOW; + break; + case 2: /* 40% */ + case 3: /* 60% */ + case 4: /* 80% */ + ctx->battery_level = SDL_JOYSTICK_POWER_MEDIUM; + break; + case 5: + ctx->battery_level = SDL_JOYSTICK_POWER_FULL; + break; + default: + ctx->battery_level = SDL_JOYSTICK_POWER_UNKNOWN; break; } - HIDAPI_DriverShield_HandleTouchPacketV103(joystick, ctx, data, size); - break; - case k_ShieldReportIdCommandResponse: - cmd_resp_report = (ShieldCommandReport_t*)data; - switch (cmd_resp_report->cmd) { - case CMD_RUMBLE: - ctx->rumble_report_pending = SDL_FALSE; - HIDAPI_DriverShield_SendNextRumble(device); - break; - case CMD_CHARGE_STATE: - ctx->charging = cmd_resp_report->payload[0] != 0; - if (joystick) { - SDL_PrivateJoystickBatteryLevel(joystick, ctx->charging ? SDL_JOYSTICK_POWER_WIRED : ctx->battery_level); - } - break; - case CMD_BATTERY_STATE: - switch (cmd_resp_report->payload[2]) { - case 0: - ctx->battery_level = SDL_JOYSTICK_POWER_EMPTY; - break; - case 1: - ctx->battery_level = SDL_JOYSTICK_POWER_LOW; - break; - case 2: /* 40% */ - case 3: /* 60% */ - case 4: /* 80% */ - ctx->battery_level = SDL_JOYSTICK_POWER_MEDIUM; - break; - case 5: - ctx->battery_level = SDL_JOYSTICK_POWER_FULL; - break; - default: - ctx->battery_level = SDL_JOYSTICK_POWER_UNKNOWN; - break; - } - if (joystick) { - SDL_PrivateJoystickBatteryLevel(joystick, ctx->charging ? SDL_JOYSTICK_POWER_WIRED : ctx->battery_level); - } - break; + if (joystick) { + SDL_PrivateJoystickBatteryLevel(joystick, ctx->charging ? SDL_JOYSTICK_POWER_WIRED : ctx->battery_level); } break; + } + break; } } @@ -582,21 +563,18 @@ HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverShield_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverShield_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { } -static void -HIDAPI_DriverShield_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverShield_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverShield = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverShield = { SDL_HINT_JOYSTICK_HIDAPI_SHIELD, SDL_TRUE, HIDAPI_DriverShield_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_stadia.c b/src/joystick/hidapi/SDL_hidapi_stadia.c index a6d54b2a533c0..9c0307e825d71 100644 --- a/src/joystick/hidapi/SDL_hidapi_stadia.c +++ b/src/joystick/hidapi/SDL_hidapi_stadia.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,6 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_STADIA /* Define this if you want to log all packets from the controller */ @@ -42,39 +41,33 @@ enum SDL_CONTROLLER_NUM_STADIA_BUTTONS, }; -typedef struct { +typedef struct +{ + SDL_bool rumble_supported; Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverStadia_Context; - -static void -HIDAPI_DriverStadia_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverStadia_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STADIA, callback, userdata); } -static void -HIDAPI_DriverStadia_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverStadia_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STADIA, callback, userdata); } -static SDL_bool -HIDAPI_DriverStadia_IsEnabled(void) +static SDL_bool HIDAPI_DriverStadia_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_STADIA, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_STADIA, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverStadia_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverStadia_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { return (type == SDL_CONTROLLER_TYPE_GOOGLE_STADIA) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverStadia_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverStadia_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverStadia_Context *ctx; @@ -85,28 +78,36 @@ HIDAPI_DriverStadia_InitDevice(SDL_HIDAPI_Device *device) } device->context = ctx; + /* Check whether rumble is supported */ + { + Uint8 rumble_packet[] = { 0x05, 0x00, 0x00, 0x00, 0x00 }; + + if (SDL_hid_write(device->dev, rumble_packet, sizeof(rumble_packet)) >= 0) { + ctx->rumble_supported = SDL_TRUE; + } + } + device->type = SDL_CONTROLLER_TYPE_GOOGLE_STADIA; HIDAPI_SetDeviceName(device, "Google Stadia Controller"); return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverStadia_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverStadia_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverStadia_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverStadia_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverStadia_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverStadia_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverStadia_Context *ctx = (SDL_DriverStadia_Context *)device->context; + SDL_AssertJoysticksLocked(); + SDL_zeroa(ctx->last_state); /* Initialize the joystick capabilities */ @@ -117,58 +118,64 @@ HIDAPI_DriverStadia_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti return SDL_TRUE; } -static int -HIDAPI_DriverStadia_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverStadia_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { - Uint8 rumble_packet[] = { 0x05, 0x00, 0x00, 0x00, 0x00 }; + SDL_DriverStadia_Context *ctx = (SDL_DriverStadia_Context *)device->context; + + if (ctx->rumble_supported) { + Uint8 rumble_packet[] = { 0x05, 0x00, 0x00, 0x00, 0x00 }; + - rumble_packet[1] = (low_frequency_rumble & 0xFF); - rumble_packet[2] = (low_frequency_rumble >> 8); - rumble_packet[3] = (high_frequency_rumble & 0xFF); - rumble_packet[4] = (high_frequency_rumble >> 8); + rumble_packet[1] = (low_frequency_rumble & 0xFF); + rumble_packet[2] = (low_frequency_rumble >> 8); + rumble_packet[3] = (high_frequency_rumble & 0xFF); + rumble_packet[4] = (high_frequency_rumble >> 8); - if (SDL_HIDAPI_SendRumble(device, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) { - return SDL_SetError("Couldn't send rumble packet"); + if (SDL_HIDAPI_SendRumble(device, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) { + return SDL_SetError("Couldn't send rumble packet"); + } + return 0; + } else { + return SDL_Unsupported(); } - return 0; } -static int -HIDAPI_DriverStadia_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverStadia_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverStadia_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverStadia_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { - return SDL_JOYCAP_RUMBLE; + SDL_DriverStadia_Context *ctx = (SDL_DriverStadia_Context *)device->context; + Uint32 caps = 0; + + if (ctx->rumble_supported) { + caps |= SDL_JOYCAP_RUMBLE; + } + return caps; } -static int -HIDAPI_DriverStadia_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverStadia_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverStadia_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverStadia_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverStadia_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverStadia_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_Context *ctx, Uint8 *data, int size) { Sint16 axis; - // The format is the same but the original FW will send 10 bytes and January '21 FW update will send 11 + // The format is the same but the original FW will send 10 bytes and January '21 FW update will send 11 if (size < 10 || data[0] != 0x03) { /* We don't know how to handle this report */ return; @@ -238,8 +245,7 @@ HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_C } #define READ_STICK_AXIS(offset) \ - (data[offset] == 0x80 ? 0 : \ - (Sint16)HIDAPI_RemapVal((float)((int)data[offset] - 0x80), 0x01 - 0x80, 0xff - 0x80, SDL_MIN_SINT16, SDL_MAX_SINT16)) + (data[offset] == 0x80 ? 0 : (Sint16)HIDAPI_RemapVal((float)((int)data[offset] - 0x80), 0x01 - 0x80, 0xff - 0x80, SDL_MIN_SINT16, SDL_MAX_SINT16)) { axis = READ_STICK_AXIS(4); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); @@ -265,8 +271,7 @@ HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_C SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverStadia_Context *ctx = (SDL_DriverStadia_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -294,21 +299,18 @@ HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverStadia_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverStadia_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { } -static void -HIDAPI_DriverStadia_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverStadia_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverStadia = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverStadia = { SDL_HINT_JOYSTICK_HIDAPI_STADIA, SDL_TRUE, HIDAPI_DriverStadia_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_steam.c b/src/joystick/hidapi/SDL_hidapi_steam.c index 9221d12e887ad..b29589ff031e6 100644 --- a/src/joystick/hidapi/SDL_hidapi_steam.c +++ b/src/joystick/hidapi/SDL_hidapi_steam.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,42 +29,33 @@ #include "../SDL_sysjoystick.h" #include "SDL_hidapijoystick_c.h" - - #ifdef SDL_JOYSTICK_HIDAPI_STEAM /*****************************************************************************************************/ -#include +#define bool SDL_bool +#define true SDL_TRUE +#define false SDL_FALSE -typedef enum -{ - false, - true -} bool; - -typedef uint32_t uint32; -typedef uint64_t uint64; - #include "steam/controller_constants.h" #include "steam/controller_structs.h" typedef struct SteamControllerStateInternal_t { // Controller Type for this Controller State - uint32 eControllerType; + Uint32 eControllerType; - // If packet num matches that on your prior call, then the controller state hasn't been changed since + // If packet num matches that on your prior call, then the controller state hasn't been changed since // your last call and there is no need to process it - uint32 unPacketNum; - + Uint32 unPacketNum; + // bit flags for each of the buttons - uint64 ulButtons; - + Uint64 ulButtons; + // Left pad coordinates short sLeftPadX; short sLeftPadY; - + // Right pad coordinates short sRightPadX; short sRightPadY; @@ -72,7 +63,7 @@ typedef struct SteamControllerStateInternal_t // Center pad coordinates short sCenterPadX; short sCenterPadY; - + // Left analog stick coordinates short sLeftStickX; short sLeftStickY; @@ -80,289 +71,276 @@ typedef struct SteamControllerStateInternal_t // Right analog stick coordinates short sRightStickX; short sRightStickY; - + unsigned short sTriggerL; unsigned short sTriggerR; - + short sAccelX; short sAccelY; short sAccelZ; - + short sGyroX; short sGyroY; short sGyroZ; - + float sGyroQuatW; float sGyroQuatX; float sGyroQuatY; float sGyroQuatZ; - + short sGyroSteeringAngle; - + unsigned short sBatteryLevel; // Pressure sensor data. unsigned short sPressurePadLeft; unsigned short sPressurePadRight; - + unsigned short sPressureBumperLeft; unsigned short sPressureBumperRight; - + // Internal state data short sPrevLeftPad[2]; short sPrevLeftStick[2]; } SteamControllerStateInternal_t; - /* Defines for ulButtons in SteamControllerStateInternal_t */ -#define STEAM_RIGHT_TRIGGER_MASK 0x00000001 -#define STEAM_LEFT_TRIGGER_MASK 0x00000002 -#define STEAM_RIGHT_BUMPER_MASK 0x00000004 -#define STEAM_LEFT_BUMPER_MASK 0x00000008 -#define STEAM_BUTTON_0_MASK 0x00000010 /* Y */ -#define STEAM_BUTTON_1_MASK 0x00000020 /* B */ -#define STEAM_BUTTON_2_MASK 0x00000040 /* X */ -#define STEAM_BUTTON_3_MASK 0x00000080 /* A */ -#define STEAM_TOUCH_0_MASK 0x00000100 /* DPAD UP */ -#define STEAM_TOUCH_1_MASK 0x00000200 /* DPAD RIGHT */ -#define STEAM_TOUCH_2_MASK 0x00000400 /* DPAD LEFT */ -#define STEAM_TOUCH_3_MASK 0x00000800 /* DPAD DOWN */ -#define STEAM_BUTTON_MENU_MASK 0x00001000 /* SELECT */ -#define STEAM_BUTTON_STEAM_MASK 0x00002000 /* GUIDE */ -#define STEAM_BUTTON_ESCAPE_MASK 0x00004000 /* START */ -#define STEAM_BUTTON_BACK_LEFT_MASK 0x00008000 -#define STEAM_BUTTON_BACK_RIGHT_MASK 0x00010000 -#define STEAM_BUTTON_LEFTPAD_CLICKED_MASK 0x00020000 -#define STEAM_BUTTON_RIGHTPAD_CLICKED_MASK 0x00040000 -#define STEAM_LEFTPAD_FINGERDOWN_MASK 0x00080000 -#define STEAM_RIGHTPAD_FINGERDOWN_MASK 0x00100000 -#define STEAM_JOYSTICK_BUTTON_MASK 0x00400000 -#define STEAM_LEFTPAD_AND_JOYSTICK_MASK 0x00800000 - +#define STEAM_RIGHT_TRIGGER_MASK 0x00000001 +#define STEAM_LEFT_TRIGGER_MASK 0x00000002 +#define STEAM_RIGHT_BUMPER_MASK 0x00000004 +#define STEAM_LEFT_BUMPER_MASK 0x00000008 +#define STEAM_BUTTON_0_MASK 0x00000010 /* Y */ +#define STEAM_BUTTON_1_MASK 0x00000020 /* B */ +#define STEAM_BUTTON_2_MASK 0x00000040 /* X */ +#define STEAM_BUTTON_3_MASK 0x00000080 /* A */ +#define STEAM_TOUCH_0_MASK 0x00000100 /* DPAD UP */ +#define STEAM_TOUCH_1_MASK 0x00000200 /* DPAD RIGHT */ +#define STEAM_TOUCH_2_MASK 0x00000400 /* DPAD LEFT */ +#define STEAM_TOUCH_3_MASK 0x00000800 /* DPAD DOWN */ +#define STEAM_BUTTON_MENU_MASK 0x00001000 /* SELECT */ +#define STEAM_BUTTON_STEAM_MASK 0x00002000 /* GUIDE */ +#define STEAM_BUTTON_ESCAPE_MASK 0x00004000 /* START */ +#define STEAM_BUTTON_BACK_LEFT_MASK 0x00008000 +#define STEAM_BUTTON_BACK_RIGHT_MASK 0x00010000 +#define STEAM_BUTTON_LEFTPAD_CLICKED_MASK 0x00020000 +#define STEAM_BUTTON_RIGHTPAD_CLICKED_MASK 0x00040000 +#define STEAM_LEFTPAD_FINGERDOWN_MASK 0x00080000 +#define STEAM_RIGHTPAD_FINGERDOWN_MASK 0x00100000 +#define STEAM_JOYSTICK_BUTTON_MASK 0x00400000 +#define STEAM_LEFTPAD_AND_JOYSTICK_MASK 0x00800000 // Look for report version 0x0001, type WIRELESS (3), length >= 1 byte -#define D0G_IS_VALID_WIRELESS_EVENT(data, len) ((len) >= 5 && (data)[0] == 1 && (data)[1] == 0 && (data)[2] == 3 && (data)[3] >= 1) -#define D0G_GET_WIRELESS_EVENT_TYPE(data) ((data)[4]) -#define D0G_WIRELESS_DISCONNECTED 1 -#define D0G_WIRELESS_ESTABLISHED 2 -#define D0G_WIRELESS_NEWLYPAIRED 3 +#define D0G_IS_VALID_WIRELESS_EVENT(data, len) ((len) >= 5 && (data)[0] == 1 && (data)[1] == 0 && (data)[2] == 3 && (data)[3] >= 1) +#define D0G_GET_WIRELESS_EVENT_TYPE(data) ((data)[4]) +#define D0G_WIRELESS_DISCONNECTED 1 +#define D0G_WIRELESS_ESTABLISHED 2 +#define D0G_WIRELESS_NEWLYPAIRED 3 -#define D0G_IS_WIRELESS_DISCONNECT(data, len) ( D0G_IS_VALID_WIRELESS_EVENT(data,len) && D0G_GET_WIRELESS_EVENT_TYPE(data) == D0G_WIRELESS_DISCONNECTED ) +#define D0G_IS_WIRELESS_DISCONNECT(data, len) (D0G_IS_VALID_WIRELESS_EVENT(data, len) && D0G_GET_WIRELESS_EVENT_TYPE(data) == D0G_WIRELESS_DISCONNECTED) -#define MAX_REPORT_SEGMENT_PAYLOAD_SIZE 18 +#define MAX_REPORT_SEGMENT_PAYLOAD_SIZE 18 /* * SteamControllerPacketAssembler has to be used when reading output repots from controllers. */ typedef struct { - uint8_t uBuffer[ MAX_REPORT_SEGMENT_PAYLOAD_SIZE * 8 + 1 ]; + uint8_t uBuffer[MAX_REPORT_SEGMENT_PAYLOAD_SIZE * 8 + 1]; int nExpectedSegmentNumber; bool bIsBle; } SteamControllerPacketAssembler; - #undef clamp #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val))) #undef offsetof -#define offsetof(s,m) (size_t)&(((s *)0)->m) +#define offsetof(s, m) (size_t) & (((s *)0)->m) #ifdef DEBUG_STEAM_CONTROLLER #define DPRINTF(format, ...) printf(format, ##__VA_ARGS__) -#define HEXDUMP(ptr, len) hexdump(ptr, len) +#define HEXDUMP(ptr, len) hexdump(ptr, len) #else #define DPRINTF(format, ...) #define HEXDUMP(ptr, len) #endif -#define printf SDL_Log +#define printf SDL_Log -#define MAX_REPORT_SEGMENT_SIZE ( MAX_REPORT_SEGMENT_PAYLOAD_SIZE + 2 ) -#define CALC_REPORT_SEGMENT_NUM(index) ( ( index / MAX_REPORT_SEGMENT_PAYLOAD_SIZE ) & 0x07 ) -#define REPORT_SEGMENT_DATA_FLAG 0x80 -#define REPORT_SEGMENT_LAST_FLAG 0x40 -#define BLE_REPORT_NUMBER 0x03 +#define MAX_REPORT_SEGMENT_SIZE (MAX_REPORT_SEGMENT_PAYLOAD_SIZE + 2) +#define CALC_REPORT_SEGMENT_NUM(index) ((index / MAX_REPORT_SEGMENT_PAYLOAD_SIZE) & 0x07) +#define REPORT_SEGMENT_DATA_FLAG 0x80 +#define REPORT_SEGMENT_LAST_FLAG 0x40 +#define BLE_REPORT_NUMBER 0x03 #define STEAMCONTROLLER_TRIGGER_MAX_ANALOG 26000 // Enable mouse mode when using the Steam Controller locally #undef ENABLE_MOUSE_MODE - // Wireless firmware quirk: the firmware intentionally signals "failure" when performing // SET_FEATURE / GET_FEATURE when it actually means "pending radio roundtrip". The only // way to make SET_FEATURE / GET_FEATURE work is to loop several times with a sleep. If // it takes more than 50ms to get the response for SET_FEATURE / GET_FEATURE, we assume // that the controller has failed. -#define RADIO_WORKAROUND_SLEEP_ATTEMPTS 50 +#define RADIO_WORKAROUND_SLEEP_ATTEMPTS 50 #define RADIO_WORKAROUND_SLEEP_DURATION_US 500 // This was defined by experimentation. 2000 seemed to work but to give that extra bit of margin, set to 3ms. #define CONTROLLER_CONFIGURATION_DELAY_US 3000 -static uint8_t GetSegmentHeader( int nSegmentNumber, bool bLastPacket ) +static uint8_t GetSegmentHeader(int nSegmentNumber, bool bLastPacket) { uint8_t header = REPORT_SEGMENT_DATA_FLAG; header |= nSegmentNumber; - if ( bLastPacket ) + if (bLastPacket) { header |= REPORT_SEGMENT_LAST_FLAG; - + } + return header; } -static void hexdump( const uint8_t *ptr, int len ) +static void hexdump(const uint8_t *ptr, int len) { int i; - for ( i = 0; i < len ; ++i ) + for (i = 0; i < len; ++i) { printf("%02x ", ptr[i]); + } printf("\n"); } -static void ResetSteamControllerPacketAssembler( SteamControllerPacketAssembler *pAssembler ) +static void ResetSteamControllerPacketAssembler(SteamControllerPacketAssembler *pAssembler) { - SDL_memset( pAssembler->uBuffer, 0, sizeof( pAssembler->uBuffer ) ); + SDL_memset(pAssembler->uBuffer, 0, sizeof(pAssembler->uBuffer)); pAssembler->nExpectedSegmentNumber = 0; } -static void InitializeSteamControllerPacketAssembler( SteamControllerPacketAssembler *pAssembler ) +static void InitializeSteamControllerPacketAssembler(SteamControllerPacketAssembler *pAssembler) { /* We only support BLE devices right now */ pAssembler->bIsBle = true; - ResetSteamControllerPacketAssembler( pAssembler ); + ResetSteamControllerPacketAssembler(pAssembler); } // Returns: // <0 on error // 0 on not ready // Complete packet size on completion -static int WriteSegmentToSteamControllerPacketAssembler( SteamControllerPacketAssembler *pAssembler, const uint8_t *pSegment, int nSegmentLength ) +static int WriteSegmentToSteamControllerPacketAssembler(SteamControllerPacketAssembler *pAssembler, const uint8_t *pSegment, int nSegmentLength) { - if ( pAssembler->bIsBle ) - { - uint8_t uSegmentHeader = pSegment[ 1 ]; + if (pAssembler->bIsBle) { + uint8_t uSegmentHeader = pSegment[1]; int nSegmentNumber = uSegmentHeader & 0x07; - HEXDUMP( pSegment, nSegmentLength ); + HEXDUMP(pSegment, nSegmentLength); - if ( pSegment[ 0 ] != BLE_REPORT_NUMBER ) - { + if (pSegment[0] != BLE_REPORT_NUMBER) { // We may get keyboard/mouse input events until controller stops sending them return 0; } - - if ( nSegmentLength != MAX_REPORT_SEGMENT_SIZE ) - { - printf( "Bad segment size! %d\n", (int)nSegmentLength ); - hexdump( pSegment, nSegmentLength ); - ResetSteamControllerPacketAssembler( pAssembler ); + + if (nSegmentLength != MAX_REPORT_SEGMENT_SIZE) { + printf("Bad segment size! %d\n", nSegmentLength); + hexdump(pSegment, nSegmentLength); + ResetSteamControllerPacketAssembler(pAssembler); return -1; } - + DPRINTF("GOT PACKET HEADER = 0x%x\n", uSegmentHeader); - - if ( ( uSegmentHeader & REPORT_SEGMENT_DATA_FLAG ) == 0 ) - { + + if (!(uSegmentHeader & REPORT_SEGMENT_DATA_FLAG)) { // We get empty segments, just ignore them return 0; } - - if ( nSegmentNumber != pAssembler->nExpectedSegmentNumber ) - { - ResetSteamControllerPacketAssembler( pAssembler ); - - if ( nSegmentNumber ) - { + + if (nSegmentNumber != pAssembler->nExpectedSegmentNumber) { + ResetSteamControllerPacketAssembler(pAssembler); + + if (nSegmentNumber) { // This happens occasionally DPRINTF("Bad segment number, got %d, expected %d\n", - nSegmentNumber, pAssembler->nExpectedSegmentNumber ); + nSegmentNumber, pAssembler->nExpectedSegmentNumber); return -1; } } - - SDL_memcpy( pAssembler->uBuffer + nSegmentNumber * MAX_REPORT_SEGMENT_PAYLOAD_SIZE, - pSegment + 2, // ignore header and report number - MAX_REPORT_SEGMENT_PAYLOAD_SIZE ); - - if ( uSegmentHeader & REPORT_SEGMENT_LAST_FLAG ) - { + + SDL_memcpy(pAssembler->uBuffer + nSegmentNumber * MAX_REPORT_SEGMENT_PAYLOAD_SIZE, + pSegment + 2, // ignore header and report number + MAX_REPORT_SEGMENT_PAYLOAD_SIZE); + + if (uSegmentHeader & REPORT_SEGMENT_LAST_FLAG) { pAssembler->nExpectedSegmentNumber = 0; - return ( nSegmentNumber + 1 ) * MAX_REPORT_SEGMENT_PAYLOAD_SIZE; + return (nSegmentNumber + 1) * MAX_REPORT_SEGMENT_PAYLOAD_SIZE; } - + pAssembler->nExpectedSegmentNumber++; - } - else - { + } else { // Just pass through - SDL_memcpy( pAssembler->uBuffer, - pSegment, - nSegmentLength ); + SDL_memcpy(pAssembler->uBuffer, + pSegment, + nSegmentLength); return nSegmentLength; } - + return 0; } -#define BLE_MAX_READ_RETRIES 8 +#define BLE_MAX_READ_RETRIES 8 -static int SetFeatureReport( SDL_hid_device *dev, unsigned char uBuffer[65], int nActualDataLen ) +static int SetFeatureReport(SDL_hid_device *dev, unsigned char uBuffer[65], int nActualDataLen) { int nRet = -1; bool bBle = true; // only wireless/BLE for now, though macOS could do wired in the future - + DPRINTF("SetFeatureReport %p %p %d\n", dev, uBuffer, nActualDataLen); - if ( bBle ) - { + if (bBle) { int nSegmentNumber = 0; - uint8_t uPacketBuffer[ MAX_REPORT_SEGMENT_SIZE ]; + uint8_t uPacketBuffer[MAX_REPORT_SEGMENT_SIZE]; unsigned char *pBufferPtr = uBuffer + 1; - if ( nActualDataLen < 1 ) + if (nActualDataLen < 1) { return -1; - + } + // Skip report number in data nActualDataLen--; - - while ( nActualDataLen > 0 ) - { + + while (nActualDataLen > 0) { int nBytesInPacket = nActualDataLen > MAX_REPORT_SEGMENT_PAYLOAD_SIZE ? MAX_REPORT_SEGMENT_PAYLOAD_SIZE : nActualDataLen; - + nActualDataLen -= nBytesInPacket; // Construct packet - SDL_memset( uPacketBuffer, 0, sizeof( uPacketBuffer ) ); - uPacketBuffer[ 0 ] = BLE_REPORT_NUMBER; - uPacketBuffer[ 1 ] = GetSegmentHeader( nSegmentNumber, nActualDataLen == 0 ); - SDL_memcpy( &uPacketBuffer[ 2 ], pBufferPtr, nBytesInPacket ); - + SDL_memset(uPacketBuffer, 0, sizeof(uPacketBuffer)); + uPacketBuffer[0] = BLE_REPORT_NUMBER; + uPacketBuffer[1] = GetSegmentHeader(nSegmentNumber, nActualDataLen == 0); + SDL_memcpy(&uPacketBuffer[2], pBufferPtr, nBytesInPacket); + pBufferPtr += nBytesInPacket; nSegmentNumber++; - - nRet = SDL_hid_send_feature_report( dev, uPacketBuffer, sizeof( uPacketBuffer ) ); + + nRet = SDL_hid_send_feature_report(dev, uPacketBuffer, sizeof(uPacketBuffer)); DPRINTF("SetFeatureReport() ret = %d\n", nRet); } } - + return nRet; } -static int GetFeatureReport( SDL_hid_device *dev, unsigned char uBuffer[65] ) +static int GetFeatureReport(SDL_hid_device *dev, unsigned char uBuffer[65]) { int nRet = -1; bool bBle = true; - DPRINTF("GetFeatureReport( %p %p )\n", dev, uBuffer ); + DPRINTF("GetFeatureReport( %p %p )\n", dev, uBuffer); - if ( bBle ) - { + if (bBle) { int nRetries = 0; - uint8_t uSegmentBuffer[ MAX_REPORT_SEGMENT_SIZE + 1 ]; + uint8_t uSegmentBuffer[MAX_REPORT_SEGMENT_SIZE + 1]; uint8_t ucBytesToRead = MAX_REPORT_SEGMENT_SIZE; uint8_t ucDataStartOffset = 0; SteamControllerPacketAssembler assembler; - InitializeSteamControllerPacketAssembler( &assembler ); - + InitializeSteamControllerPacketAssembler(&assembler); + // On Windows and macOS, BLE devices get 2 copies of the feature report ID, one that is removed by ReadFeatureReport, // and one that's included in the buffer we receive. We pad the bytes to read and skip over the report ID // if necessary. @@ -371,67 +349,65 @@ static int GetFeatureReport( SDL_hid_device *dev, unsigned char uBuffer[65] ) ++ucDataStartOffset; #endif - while( nRetries < BLE_MAX_READ_RETRIES ) - { - SDL_memset( uSegmentBuffer, 0, sizeof( uSegmentBuffer ) ); - uSegmentBuffer[ 0 ] = BLE_REPORT_NUMBER; - nRet = SDL_hid_get_feature_report( dev, uSegmentBuffer, ucBytesToRead ); + while (nRetries < BLE_MAX_READ_RETRIES) { + SDL_memset(uSegmentBuffer, 0, sizeof(uSegmentBuffer)); + uSegmentBuffer[0] = BLE_REPORT_NUMBER; + nRet = SDL_hid_get_feature_report(dev, uSegmentBuffer, ucBytesToRead); + + DPRINTF("GetFeatureReport ble ret=%d\n", nRet); + HEXDUMP(uSegmentBuffer, nRet); - DPRINTF( "GetFeatureReport ble ret=%d\n", nRet ); - HEXDUMP( uSegmentBuffer, nRet ); - // Zero retry counter if we got data - if ( nRet > 2 && ( uSegmentBuffer[ ucDataStartOffset + 1 ] & REPORT_SEGMENT_DATA_FLAG ) ) + if (nRet > 2 && (uSegmentBuffer[ucDataStartOffset + 1] & REPORT_SEGMENT_DATA_FLAG)) { nRetries = 0; - else + } else { nRetries++; + } - if ( nRet > 0 ) - { - int nPacketLength = WriteSegmentToSteamControllerPacketAssembler( &assembler, + if (nRet > 0) { + int nPacketLength = WriteSegmentToSteamControllerPacketAssembler(&assembler, uSegmentBuffer + ucDataStartOffset, - nRet - ucDataStartOffset ); - - if ( nPacketLength > 0 && nPacketLength < 65 ) - { + nRet - ucDataStartOffset); + + if (nPacketLength > 0 && nPacketLength < 65) { // Leave space for "report number" - uBuffer[ 0 ] = 0; - SDL_memcpy( uBuffer + 1, assembler.uBuffer, nPacketLength ); + uBuffer[0] = 0; + SDL_memcpy(uBuffer + 1, assembler.uBuffer, nPacketLength); return nPacketLength; } } - - } - printf("Could not get a full ble packet after %d retries\n", nRetries ); + printf("Could not get a full ble packet after %d retries\n", nRetries); return -1; } - + return nRet; } -static int ReadResponse( SDL_hid_device *dev, uint8_t uBuffer[65], int nExpectedResponse ) +static int ReadResponse(SDL_hid_device *dev, uint8_t uBuffer[65], int nExpectedResponse) { - int nRet = GetFeatureReport( dev, uBuffer ); + int nRet = GetFeatureReport(dev, uBuffer); - DPRINTF("ReadResponse( %p %p %d )\n", dev, uBuffer, nExpectedResponse ); + DPRINTF("ReadResponse( %p %p %d )\n", dev, uBuffer, nExpectedResponse); - if ( nRet < 0 ) + if (nRet < 0) { return nRet; - - DPRINTF("ReadResponse got %d bytes of data: ", nRet ); - HEXDUMP( uBuffer, nRet ); - - if ( uBuffer[1] != nExpectedResponse ) + } + + DPRINTF("ReadResponse got %d bytes of data: ", nRet); + HEXDUMP(uBuffer, nRet); + + if (uBuffer[1] != nExpectedResponse) { return -1; - + } + return nRet; } //--------------------------------------------------------------------------- // Reset steam controller (unmap buttons and pads) and re-fetch capability bits //--------------------------------------------------------------------------- -static bool ResetSteamController( SDL_hid_device *dev, bool bSuppressErrorSpew, uint32_t *punUpdateRateUS ) +static bool ResetSteamController(SDL_hid_device *dev, bool bSuppressErrorSpew, uint32_t *punUpdateRateUS) { // Firmware quirk: Set Feature and Get Feature requests always require a 65-byte buffer. unsigned char buf[65]; @@ -441,46 +417,44 @@ static bool ResetSteamController( SDL_hid_device *dev, bool bSuppressErrorSpew, int nAttributesLength; FeatureReportMsg *msg; uint32_t unUpdateRateUS = 9000; // Good default rate - - DPRINTF( "ResetSteamController hid=%p\n", dev ); + + DPRINTF("ResetSteamController hid=%p\n", dev); buf[0] = 0; buf[1] = ID_GET_ATTRIBUTES_VALUES; - res = SetFeatureReport( dev, buf, 2 ); - if ( res < 0 ) - { - if ( !bSuppressErrorSpew ) - printf( "GET_ATTRIBUTES_VALUES failed for controller %p\n", dev ); + res = SetFeatureReport(dev, buf, 2); + if (res < 0) { + if (!bSuppressErrorSpew) { + printf("GET_ATTRIBUTES_VALUES failed for controller %p\n", dev); + } return false; } - + // Retrieve GET_ATTRIBUTES_VALUES result // Wireless controller endpoints without a connected controller will return nAttrs == 0 - res = ReadResponse( dev, buf, ID_GET_ATTRIBUTES_VALUES ); - if ( res < 0 || buf[1] != ID_GET_ATTRIBUTES_VALUES ) - { + res = ReadResponse(dev, buf, ID_GET_ATTRIBUTES_VALUES); + if (res < 0 || buf[1] != ID_GET_ATTRIBUTES_VALUES) { HEXDUMP(buf, res); - if ( !bSuppressErrorSpew ) - printf( "Bad GET_ATTRIBUTES_VALUES response for controller %p\n", dev ); + if (!bSuppressErrorSpew) { + printf("Bad GET_ATTRIBUTES_VALUES response for controller %p\n", dev); + } return false; } - - nAttributesLength = buf[ 2 ]; - if ( nAttributesLength > res ) - { - if ( !bSuppressErrorSpew ) - printf( "Bad GET_ATTRIBUTES_VALUES response for controller %p\n", dev ); + + nAttributesLength = buf[2]; + if (nAttributesLength > res) { + if (!bSuppressErrorSpew) { + printf("Bad GET_ATTRIBUTES_VALUES response for controller %p\n", dev); + } return false; } msg = (FeatureReportMsg *)&buf[1]; - for ( i = 0; i < (int)msg->header.length / sizeof( ControllerAttribute ); ++i ) - { + for (i = 0; i < (int)msg->header.length / sizeof(ControllerAttribute); ++i) { uint8_t unAttribute = msg->payload.getAttributes.attributes[i].attributeTag; uint32_t unValue = msg->payload.getAttributes.attributes[i].attributeValue; - switch ( unAttribute ) - { + switch (unAttribute) { case ATTRIB_UNIQUE_ID: break; case ATTRIB_PRODUCT_ID: @@ -494,104 +468,98 @@ static bool ResetSteamController( SDL_hid_device *dev, bool bSuppressErrorSpew, break; } } - if ( punUpdateRateUS ) - { + if (punUpdateRateUS) { *punUpdateRateUS = unUpdateRateUS; } // Clear digital button mappings buf[0] = 0; buf[1] = ID_CLEAR_DIGITAL_MAPPINGS; - res = SetFeatureReport( dev, buf, 2 ); - if ( res < 0 ) - { - if ( !bSuppressErrorSpew ) - printf( "CLEAR_DIGITAL_MAPPINGS failed for controller %p\n", dev ); + res = SetFeatureReport(dev, buf, 2); + if (res < 0) { + if (!bSuppressErrorSpew) { + printf("CLEAR_DIGITAL_MAPPINGS failed for controller %p\n", dev); + } return false; } - + // Reset the default settings - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_LOAD_DEFAULT_SETTINGS; buf[2] = 0; - res = SetFeatureReport( dev, buf, 3 ); - if ( res < 0 ) - { - if ( !bSuppressErrorSpew ) - printf( "LOAD_DEFAULT_SETTINGS failed for controller %p\n", dev ); + res = SetFeatureReport(dev, buf, 3); + if (res < 0) { + if (!bSuppressErrorSpew) { + printf("LOAD_DEFAULT_SETTINGS failed for controller %p\n", dev); + } return false; } - + // Apply custom settings - clear trackpad modes (cancel mouse emulation), etc -#define ADD_SETTING(SETTING, VALUE) \ -buf[3+nSettings*3] = SETTING; \ -buf[3+nSettings*3+1] = ((uint16_t)VALUE)&0xFF; \ -buf[3+nSettings*3+2] = ((uint16_t)VALUE)>>8; \ -++nSettings; - - SDL_memset( buf, 0, 65 ); +#define ADD_SETTING(SETTING, VALUE) \ + buf[3 + nSettings * 3] = SETTING; \ + buf[3 + nSettings * 3 + 1] = ((uint16_t)VALUE) & 0xFF; \ + buf[3 + nSettings * 3 + 2] = ((uint16_t)VALUE) >> 8; \ + ++nSettings; + + SDL_memset(buf, 0, 65); buf[1] = ID_SET_SETTINGS_VALUES; - ADD_SETTING( SETTING_WIRELESS_PACKET_VERSION, 2 ); - ADD_SETTING( SETTING_LEFT_TRACKPAD_MODE, TRACKPAD_NONE ); + ADD_SETTING(SETTING_WIRELESS_PACKET_VERSION, 2); + ADD_SETTING(SETTING_LEFT_TRACKPAD_MODE, TRACKPAD_NONE); #ifdef ENABLE_MOUSE_MODE - ADD_SETTING( SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_ABSOLUTE_MOUSE ); - ADD_SETTING( SETTING_SMOOTH_ABSOLUTE_MOUSE, 1 ); - ADD_SETTING( SETTING_MOMENTUM_MAXIMUM_VELOCITY, 20000 ); // [0-20000] default 8000 - ADD_SETTING( SETTING_MOMENTUM_DECAY_AMMOUNT, 50 ); // [0-50] default 5 + ADD_SETTING(SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_ABSOLUTE_MOUSE); + ADD_SETTING(SETTING_SMOOTH_ABSOLUTE_MOUSE, 1); + ADD_SETTING(SETTING_MOMENTUM_MAXIMUM_VELOCITY, 20000); // [0-20000] default 8000 + ADD_SETTING(SETTING_MOMENTUM_DECAY_AMMOUNT, 50); // [0-50] default 5 #else - ADD_SETTING( SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_NONE ); - ADD_SETTING( SETTING_SMOOTH_ABSOLUTE_MOUSE, 0 ); + ADD_SETTING(SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_NONE); + ADD_SETTING(SETTING_SMOOTH_ABSOLUTE_MOUSE, 0); #endif - buf[2] = nSettings*3; - - res = SetFeatureReport( dev, buf, 3+nSettings*3 ); - if ( res < 0 ) - { - if ( !bSuppressErrorSpew ) - printf( "SET_SETTINGS failed for controller %p\n", dev ); + buf[2] = nSettings * 3; + + res = SetFeatureReport(dev, buf, 3 + nSettings * 3); + if (res < 0) { + if (!bSuppressErrorSpew) { + printf("SET_SETTINGS failed for controller %p\n", dev); + } return false; } - + #ifdef ENABLE_MOUSE_MODE // Wait for ID_CLEAR_DIGITAL_MAPPINGS to be processed on the controller bool bMappingsCleared = false; int iRetry; - for ( iRetry = 0; iRetry < 2; ++iRetry ) - { - SDL_memset( buf, 0, 65 ); + for (iRetry = 0; iRetry < 2; ++iRetry) { + SDL_memset(buf, 0, 65); buf[1] = ID_GET_DIGITAL_MAPPINGS; buf[2] = 1; // one byte - requesting from index 0 buf[3] = 0; - res = SetFeatureReport( dev, buf, 4 ); - if ( res < 0 ) - { - printf( "GET_DIGITAL_MAPPINGS failed for controller %p\n", dev ); + res = SetFeatureReport(dev, buf, 4); + if (res < 0) { + printf("GET_DIGITAL_MAPPINGS failed for controller %p\n", dev); return false; } - - res = ReadResponse( dev, buf, ID_GET_DIGITAL_MAPPINGS ); - if ( res < 0 || buf[1] != ID_GET_DIGITAL_MAPPINGS ) - { - printf( "Bad GET_DIGITAL_MAPPINGS response for controller %p\n", dev ); + + res = ReadResponse(dev, buf, ID_GET_DIGITAL_MAPPINGS); + if (res < 0 || buf[1] != ID_GET_DIGITAL_MAPPINGS) { + printf("Bad GET_DIGITAL_MAPPINGS response for controller %p\n", dev); return false; } - + // If the length of the digital mappings result is not 1 (index byte, no mappings) then clearing hasn't executed - if ( buf[2] == 1 && buf[3] == 0xFF ) - { + if (buf[2] == 1 && buf[3] == 0xFF) { bMappingsCleared = true; break; } - usleep( CONTROLLER_CONFIGURATION_DELAY_US ); + usleep(CONTROLLER_CONFIGURATION_DELAY_US); } - - if ( !bMappingsCleared && !bSuppressErrorSpew ) - { - printf( "Warning: CLEAR_DIGITAL_MAPPINGS never completed for controller %p\n", dev ); + + if (!bMappingsCleared && !bSuppressErrorSpew) { + printf("Warning: CLEAR_DIGITAL_MAPPINGS never completed for controller %p\n", dev); } - + // Set our new mappings - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_SET_DIGITAL_MAPPINGS; buf[2] = 6; // 2 settings x 3 bytes buf[3] = IO_DIGITAL_BUTTON_RIGHT_TRIGGER; @@ -600,102 +568,87 @@ buf[3+nSettings*3+2] = ((uint16_t)VALUE)>>8; \ buf[6] = IO_DIGITAL_BUTTON_LEFT_TRIGGER; buf[7] = DEVICE_MOUSE; buf[8] = MOUSE_BTN_RIGHT; - - res = SetFeatureReport( dev, buf, 9 ); - if ( res < 0 ) - { - if ( !bSuppressErrorSpew ) - printf( "SET_DIGITAL_MAPPINGS failed for controller %p\n", dev ); + + res = SetFeatureReport(dev, buf, 9); + if (res < 0) { + if (!bSuppressErrorSpew) { + printf("SET_DIGITAL_MAPPINGS failed for controller %p\n", dev); + } return false; } #endif // ENABLE_MOUSE_MODE - + return true; } - //--------------------------------------------------------------------------- // Read from a Steam Controller //--------------------------------------------------------------------------- -static int ReadSteamController( SDL_hid_device *dev, uint8_t *pData, int nDataSize ) +static int ReadSteamController(SDL_hid_device *dev, uint8_t *pData, int nDataSize) { - SDL_memset( pData, 0, nDataSize ); - pData[ 0 ] = BLE_REPORT_NUMBER; // hid_read will also overwrite this with the same value, 0x03 - return SDL_hid_read( dev, pData, nDataSize ); + SDL_memset(pData, 0, nDataSize); + pData[0] = BLE_REPORT_NUMBER; // hid_read will also overwrite this with the same value, 0x03 + return SDL_hid_read(dev, pData, nDataSize); } - //--------------------------------------------------------------------------- // Close a Steam Controller //--------------------------------------------------------------------------- -static void CloseSteamController( SDL_hid_device *dev ) +static void CloseSteamController(SDL_hid_device *dev) { // Switch the Steam Controller back to lizard mode so it works with the OS unsigned char buf[65]; int nSettings = 0; - + // Reset digital button mappings - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_SET_DEFAULT_DIGITAL_MAPPINGS; - SetFeatureReport( dev, buf, 2 ); + SetFeatureReport(dev, buf, 2); // Reset the default settings - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_LOAD_DEFAULT_SETTINGS; buf[2] = 0; - SetFeatureReport( dev, buf, 3 ); + SetFeatureReport(dev, buf, 3); // Reset mouse mode for lizard mode - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_SET_SETTINGS_VALUES; - ADD_SETTING( SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_ABSOLUTE_MOUSE ); - buf[2] = nSettings*3; - SetFeatureReport( dev, buf, 3+nSettings*3 ); + ADD_SETTING(SETTING_RIGHT_TRACKPAD_MODE, TRACKPAD_ABSOLUTE_MOUSE); + buf[2] = nSettings * 3; + SetFeatureReport(dev, buf, 3 + nSettings * 3); } - //--------------------------------------------------------------------------- // Scale and clamp values to a range //--------------------------------------------------------------------------- -static float RemapValClamped( float val, float A, float B, float C, float D) +static float RemapValClamped(float val, float A, float B, float C, float D) { - if ( A == B ) - { - return ( val - B ) >= 0.0f ? D : C; - } - else - { + if (A == B) { + return (val - B) >= 0.0f ? D : C; + } else { float cVal = (val - A) / (B - A); - cVal = clamp( cVal, 0.0f, 1.0f ); + cVal = clamp(cVal, 0.0f, 1.0f); return C + (D - C) * cVal; } } - //--------------------------------------------------------------------------- // Rotate the pad coordinates //--------------------------------------------------------------------------- -static void RotatePad( int *pX, int *pY, float flAngleInRad ) -{ - short int origX = *pX, origY = *pY; - - *pX = (int)( SDL_cosf( flAngleInRad ) * origX - SDL_sinf( flAngleInRad ) * origY ); - *pY = (int)( SDL_sinf( flAngleInRad ) * origX + SDL_cosf( flAngleInRad ) * origY ); -} -static void RotatePadShort( short *pX, short *pY, float flAngleInRad ) +static void RotatePad(int *pX, int *pY, float flAngleInRad) { short int origX = *pX, origY = *pY; - *pX = (short)( SDL_cosf( flAngleInRad ) * origX - SDL_sinf( flAngleInRad ) * origY ); - *pY = (short)( SDL_sinf( flAngleInRad ) * origX + SDL_cosf( flAngleInRad ) * origY ); + *pX = (int)(SDL_cosf(flAngleInRad) * origX - SDL_sinf(flAngleInRad) * origY); + *pY = (int)(SDL_sinf(flAngleInRad) * origX + SDL_cosf(flAngleInRad) * origY); } - //--------------------------------------------------------------------------- // Format the first part of the state packet //--------------------------------------------------------------------------- -static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, ValveControllerStatePacket_t *pStatePacket ) +static void FormatStatePacketUntilGyro(SteamControllerStateInternal_t *pState, ValveControllerStatePacket_t *pStatePacket) { int nLeftPadX; int nLeftPadY; @@ -708,7 +661,7 @@ static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, SDL_memset(pState, 0, offsetof(SteamControllerStateInternal_t, sBatteryLevel)); - //pState->eControllerType = m_eControllerType; + // pState->eControllerType = m_eControllerType; pState->eControllerType = 2; // k_eControllerType_SteamController; pState->unPacketNum = pStatePacket->unPacketNum; @@ -717,65 +670,52 @@ static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, pState->ulButtons &= ~0xFFFF000000LL; // The firmware uses this bit to tell us what kind of data is packed into the left two axises - if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK) - { + if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK) { // Finger-down bit not set; "left pad" is actually trackpad pState->sLeftPadX = pState->sPrevLeftPad[0] = pStatePacket->sLeftPadX; pState->sLeftPadY = pState->sPrevLeftPad[1] = pStatePacket->sLeftPadY; - if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) - { + if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) { // The controller is interleaving both stick and pad data, both are active pState->sLeftStickX = pState->sPrevLeftStick[0]; pState->sLeftStickY = pState->sPrevLeftStick[1]; - } - else - { + } else { // The stick is not active pState->sPrevLeftStick[0] = 0; pState->sPrevLeftStick[1] = 0; } - } - else - { + } else { // Finger-down bit not set; "left pad" is actually joystick // XXX there's a firmware bug where sometimes padX is 0 and padY is a large number (acutally the battery voltage) // If that happens skip this packet and report last frames stick -/* - if ( m_eControllerType == k_eControllerType_SteamControllerV2 && pStatePacket->sLeftPadY > 900 ) - { - pState->sLeftStickX = pState->sPrevLeftStick[0]; - pState->sLeftStickY = pState->sPrevLeftStick[1]; - } - else -*/ + /* + if ( m_eControllerType == k_eControllerType_SteamControllerV2 && pStatePacket->sLeftPadY > 900 ) { + pState->sLeftStickX = pState->sPrevLeftStick[0]; + pState->sLeftStickY = pState->sPrevLeftStick[1]; + } else + */ { pState->sPrevLeftStick[0] = pState->sLeftStickX = pStatePacket->sLeftPadX; pState->sPrevLeftStick[1] = pState->sLeftStickY = pStatePacket->sLeftPadY; } -/* - if (m_eControllerType == k_eControllerType_SteamControllerV2) - { - UpdateV2JoystickCap(&state); - } -*/ + /* + if (m_eControllerType == k_eControllerType_SteamControllerV2) { + UpdateV2JoystickCap(&state); + } + */ - if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) - { + if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) { // The controller is interleaving both stick and pad data, both are active pState->sLeftPadX = pState->sPrevLeftPad[0]; pState->sLeftPadY = pState->sPrevLeftPad[1]; - } - else - { + } else { // The trackpad is not active pState->sPrevLeftPad[0] = 0; pState->sPrevLeftPad[1] = 0; // Old controllers send trackpad click for joystick button when trackpad is not active - if (pState->ulButtons & STEAM_BUTTON_LEFTPAD_CLICKED_MASK) - { + if (pState->ulButtons & STEAM_BUTTON_LEFTPAD_CLICKED_MASK) { pState->ulButtons &= ~STEAM_BUTTON_LEFTPAD_CLICKED_MASK; pState->ulButtons |= STEAM_JOYSTICK_BUTTON_MASK; } @@ -784,8 +724,9 @@ static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, // Fingerdown bit indicates if the packed left axis data was joystick or pad, // but if we are interleaving both, the left finger is definitely on the pad. - if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) + if (pStatePacket->ButtonTriggerData.ulButtons & STEAM_LEFTPAD_AND_JOYSTICK_MASK) { pState->ulButtons |= STEAM_LEFTPAD_FINGERDOWN_MASK; + } pState->sRightPadX = pStatePacket->sRightPadX; pState->sRightPadY = pStatePacket->sRightPadY; @@ -798,151 +739,150 @@ static void FormatStatePacketUntilGyro( SteamControllerStateInternal_t *pState, RotatePad(&nLeftPadX, &nLeftPadY, -flRotationAngle); RotatePad(&nRightPadX, &nRightPadY, flRotationAngle); - if (pState->ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK) + if (pState->ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK) { nPadOffset = 1000; - else + } else { nPadOffset = 0; + } pState->sLeftPadX = clamp(nLeftPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); pState->sLeftPadY = clamp(nLeftPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); nPadOffset = 0; - if (pState->ulButtons & STEAM_RIGHTPAD_FINGERDOWN_MASK) + if (pState->ulButtons & STEAM_RIGHTPAD_FINGERDOWN_MASK) { nPadOffset = 1000; - else + } else { nPadOffset = 0; + } pState->sRightPadX = clamp(nRightPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); pState->sRightPadY = clamp(nRightPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); - pState->sTriggerL = (unsigned short)RemapValClamped( (float)((pStatePacket->ButtonTriggerData.Triggers.nLeft << 7) | pStatePacket->ButtonTriggerData.Triggers.nLeft), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); - pState->sTriggerR = (unsigned short)RemapValClamped( (float)((pStatePacket->ButtonTriggerData.Triggers.nRight << 7) | pStatePacket->ButtonTriggerData.Triggers.nRight), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerL = (unsigned short)RemapValClamped((float)((pStatePacket->ButtonTriggerData.Triggers.nLeft << 7) | pStatePacket->ButtonTriggerData.Triggers.nLeft), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16); + pState->sTriggerR = (unsigned short)RemapValClamped((float)((pStatePacket->ButtonTriggerData.Triggers.nRight << 7) | pStatePacket->ButtonTriggerData.Triggers.nRight), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16); } - //--------------------------------------------------------------------------- // Update Steam Controller state from a BLE data packet, returns true if it parsed data //--------------------------------------------------------------------------- -static bool UpdateBLESteamControllerState( const uint8_t *pData, int nDataSize, SteamControllerStateInternal_t *pState ) +static bool UpdateBLESteamControllerState(const uint8_t *pData, int nDataSize, SteamControllerStateInternal_t *pState) { - const float flRotationAngle = 0.261799f; + int nLeftPadX; + int nLeftPadY; + int nRightPadX; + int nRightPadY; + int nPadOffset; uint32_t ucOptionDataMask; + // 15 degrees in rad + const float flRotationAngle = 0.261799f; + pState->unPacketNum++; - ucOptionDataMask = ( *pData++ & 0xF0 ); + ucOptionDataMask = (*pData++ & 0xF0); ucOptionDataMask |= (uint32_t)(*pData++) << 8; - if ( ucOptionDataMask & k_EBLEButtonChunk1 ) - { - SDL_memcpy( &pState->ulButtons, pData, 3 ); + if (ucOptionDataMask & k_EBLEButtonChunk1) { + SDL_memcpy(&pState->ulButtons, pData, 3); pData += 3; } - if ( ucOptionDataMask & k_EBLEButtonChunk2 ) - { + if (ucOptionDataMask & k_EBLEButtonChunk2) { // The middle 2 bytes of the button bits over the wire are triggers when over the wire and non-SC buttons in the internal controller state packet - pState->sTriggerL = (unsigned short)RemapValClamped( (float)(( pData[ 0 ] << 7 ) | pData[ 0 ]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); - pState->sTriggerR = (unsigned short)RemapValClamped( (float)(( pData[ 1 ] << 7 ) | pData[ 1 ]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16 ); + pState->sTriggerL = (unsigned short)RemapValClamped((float)((pData[0] << 7) | pData[0]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16); + pState->sTriggerR = (unsigned short)RemapValClamped((float)((pData[1] << 7) | pData[1]), 0, STEAMCONTROLLER_TRIGGER_MAX_ANALOG, 0, SDL_MAX_SINT16); pData += 2; } - if ( ucOptionDataMask & k_EBLEButtonChunk3 ) - { + if (ucOptionDataMask & k_EBLEButtonChunk3) { uint8_t *pButtonByte = (uint8_t *)&pState->ulButtons; - pButtonByte[ 5 ] = *pData++; - pButtonByte[ 6 ] = *pData++; - pButtonByte[ 7 ] = *pData++; + pButtonByte[5] = *pData++; + pButtonByte[6] = *pData++; + pButtonByte[7] = *pData++; } - if ( ucOptionDataMask & k_EBLELeftJoystickChunk ) - { + if (ucOptionDataMask & k_EBLELeftJoystickChunk) { // This doesn't handle any of the special headcrab stuff for raw joystick which is OK for now since that FW doesn't support // this protocol yet either - int nLength = sizeof( pState->sLeftStickX ) + sizeof( pState->sLeftStickY ); - SDL_memcpy( &pState->sLeftStickX, pData, nLength ); + int nLength = sizeof(pState->sLeftStickX) + sizeof(pState->sLeftStickY); + SDL_memcpy(&pState->sLeftStickX, pData, nLength); pData += nLength; } - if ( ucOptionDataMask & k_EBLELeftTrackpadChunk ) - { - int nLength = sizeof( pState->sLeftPadX ) + sizeof( pState->sLeftPadY ); - int nPadOffset; - SDL_memcpy( &pState->sLeftPadX, pData, nLength ); - if ( pState->ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK ) + if (ucOptionDataMask & k_EBLELeftTrackpadChunk) { + int nLength = sizeof(pState->sLeftPadX) + sizeof(pState->sLeftPadY); + SDL_memcpy(&pState->sLeftPadX, pData, nLength); + if (pState->ulButtons & STEAM_LEFTPAD_FINGERDOWN_MASK) { nPadOffset = 1000; - else + } else { nPadOffset = 0; + } - RotatePadShort( &pState->sLeftPadX, &pState->sLeftPadY, -flRotationAngle ); - pState->sLeftPadX = clamp( pState->sLeftPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16 ); - pState->sLeftPadY = clamp( pState->sLeftPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16 ); + nLeftPadX = pState->sLeftPadX; + nLeftPadY = pState->sLeftPadY; + RotatePad(&nLeftPadX, &nLeftPadY, -flRotationAngle); + pState->sLeftPadX = (short)clamp(nLeftPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); + pState->sLeftPadY = (short)clamp(nLeftPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); pData += nLength; } - if ( ucOptionDataMask & k_EBLERightTrackpadChunk ) - { - int nLength = sizeof( pState->sRightPadX ) + sizeof( pState->sRightPadY ); - int nPadOffset = 0; + if (ucOptionDataMask & k_EBLERightTrackpadChunk) { + int nLength = sizeof(pState->sRightPadX) + sizeof(pState->sRightPadY); - SDL_memcpy( &pState->sRightPadX, pData, nLength ); + SDL_memcpy(&pState->sRightPadX, pData, nLength); - if ( pState->ulButtons & STEAM_RIGHTPAD_FINGERDOWN_MASK ) + if (pState->ulButtons & STEAM_RIGHTPAD_FINGERDOWN_MASK) { nPadOffset = 1000; - else + } else { nPadOffset = 0; + } - RotatePadShort( &pState->sRightPadX, &pState->sRightPadY, flRotationAngle ); - pState->sRightPadX = clamp( pState->sRightPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16 ); - pState->sRightPadY = clamp( pState->sRightPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16 ); + nRightPadX = pState->sRightPadX; + nRightPadY = pState->sRightPadY; + RotatePad(&nRightPadX, &nRightPadY, flRotationAngle); + pState->sRightPadX = (short)clamp(nRightPadX + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); + pState->sRightPadY = (short)clamp(nRightPadY + nPadOffset, SDL_MIN_SINT16, SDL_MAX_SINT16); pData += nLength; } - if ( ucOptionDataMask & k_EBLEIMUAccelChunk ) - { - int nLength = sizeof( pState->sAccelX ) + sizeof( pState->sAccelY ) + sizeof( pState->sAccelZ ); - SDL_memcpy( &pState->sAccelX, pData, nLength ); + if (ucOptionDataMask & k_EBLEIMUAccelChunk) { + int nLength = sizeof(pState->sAccelX) + sizeof(pState->sAccelY) + sizeof(pState->sAccelZ); + SDL_memcpy(&pState->sAccelX, pData, nLength); pData += nLength; } - if ( ucOptionDataMask & k_EBLEIMUGyroChunk ) - { - int nLength = sizeof( pState->sAccelX ) + sizeof( pState->sAccelY ) + sizeof( pState->sAccelZ ); - SDL_memcpy( &pState->sGyroX, pData, nLength ); + if (ucOptionDataMask & k_EBLEIMUGyroChunk) { + int nLength = sizeof(pState->sAccelX) + sizeof(pState->sAccelY) + sizeof(pState->sAccelZ); + SDL_memcpy(&pState->sGyroX, pData, nLength); pData += nLength; } - if ( ucOptionDataMask & k_EBLEIMUQuatChunk ) - { - int nLength = sizeof( pState->sGyroQuatW ) + sizeof( pState->sGyroQuatX ) + sizeof( pState->sGyroQuatY ) + sizeof( pState->sGyroQuatZ ); - SDL_memcpy( &pState->sGyroQuatW, pData, nLength ); + if (ucOptionDataMask & k_EBLEIMUQuatChunk) { + int nLength = sizeof(pState->sGyroQuatW) + sizeof(pState->sGyroQuatX) + sizeof(pState->sGyroQuatY) + sizeof(pState->sGyroQuatZ); + SDL_memcpy(&pState->sGyroQuatW, pData, nLength); pData += nLength; } return true; } - //--------------------------------------------------------------------------- // Update Steam Controller state from a data packet, returns true if it parsed data //--------------------------------------------------------------------------- -static bool UpdateSteamControllerState( const uint8_t *pData, int nDataSize, SteamControllerStateInternal_t *pState ) +static bool UpdateSteamControllerState(const uint8_t *pData, int nDataSize, SteamControllerStateInternal_t *pState) { - ValveInReport_t *pInReport = (ValveInReport_t*)pData; + ValveInReport_t *pInReport = (ValveInReport_t *)pData; - if ( pInReport->header.unReportVersion != k_ValveInReportMsgVersion ) - { - if ( ( pData[ 0 ] & 0x0F ) == k_EBLEReportState ) - { - return UpdateBLESteamControllerState( pData, nDataSize, pState ); + if (pInReport->header.unReportVersion != k_ValveInReportMsgVersion) { + if ((pData[0] & 0x0F) == k_EBLEReportState) { + return UpdateBLESteamControllerState(pData, nDataSize, pState); } return false; } - if ( ( pInReport->header.ucType != ID_CONTROLLER_STATE ) && - ( pInReport->header.ucType != ID_CONTROLLER_BLE_STATE ) ) - { + if ((pInReport->header.ucType != ID_CONTROLLER_STATE) && + (pInReport->header.ucType != ID_CONTROLLER_BLE_STATE)) { return false; } - if ( pInReport->header.ucType == ID_CONTROLLER_STATE ) - { + if (pInReport->header.ucType == ID_CONTROLLER_STATE) { ValveControllerStatePacket_t *pStatePacket = &pInReport->payload.controllerState; // No new data to process; indicate that we received a state packet, but otherwise do nothing. - if ( pState->unPacketNum == pStatePacket->unPacketNum ) + if (pState->unPacketNum == pStatePacket->unPacketNum) { return true; + } - FormatStatePacketUntilGyro( pState, pStatePacket ); + FormatStatePacketUntilGyro(pState, pStatePacket); pState->sAccelX = pStatePacket->sAccelX; pState->sAccelY = pStatePacket->sAccelY; @@ -957,25 +897,23 @@ static bool UpdateSteamControllerState( const uint8_t *pData, int nDataSize, Ste pState->sGyroY = pStatePacket->sGyroY; pState->sGyroZ = pStatePacket->sGyroZ; - } - else if ( pInReport->header.ucType == ID_CONTROLLER_BLE_STATE ) - { + } else if (pInReport->header.ucType == ID_CONTROLLER_BLE_STATE) { ValveControllerBLEStatePacket_t *pBLEStatePacket = &pInReport->payload.controllerBLEState; ValveControllerStatePacket_t *pStatePacket = &pInReport->payload.controllerState; // No new data to process; indicate that we received a state packet, but otherwise do nothing. - if ( pState->unPacketNum == pStatePacket->unPacketNum ) + if (pState->unPacketNum == pStatePacket->unPacketNum) { return true; + } - FormatStatePacketUntilGyro( pState, pStatePacket ); + FormatStatePacketUntilGyro(pState, pStatePacket); - switch ( pBLEStatePacket->ucGyroDataType ) - { + switch (pBLEStatePacket->ucGyroDataType) { case 1: - pState->sGyroQuatW = (( float ) pBLEStatePacket->sGyro[0]); - pState->sGyroQuatX = (( float ) pBLEStatePacket->sGyro[1]); - pState->sGyroQuatY = (( float ) pBLEStatePacket->sGyro[2]); - pState->sGyroQuatZ = (( float ) pBLEStatePacket->sGyro[3]); + pState->sGyroQuatW = ((float)pBLEStatePacket->sGyro[0]); + pState->sGyroQuatX = ((float)pBLEStatePacket->sGyro[1]); + pState->sGyroQuatY = ((float)pBLEStatePacket->sGyro[2]); + pState->sGyroQuatZ = ((float)pBLEStatePacket->sGyro[3]); break; case 2: @@ -1000,7 +938,8 @@ static bool UpdateSteamControllerState( const uint8_t *pData, int nDataSize, Ste /*****************************************************************************************************/ -typedef struct { +typedef struct +{ SDL_bool report_sensors; uint32_t update_rate_in_us; Uint32 timestamp_us; @@ -1010,33 +949,27 @@ typedef struct { SteamControllerStateInternal_t m_last_state; } SDL_DriverSteam_Context; - -static void -HIDAPI_DriverSteam_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverSteam_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STEAM, callback, userdata); } -static void -HIDAPI_DriverSteam_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverSteam_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STEAM, callback, userdata); } -static SDL_bool -HIDAPI_DriverSteam_IsEnabled(void) +static SDL_bool HIDAPI_DriverSteam_IsEnabled(void) { return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_STEAM, SDL_FALSE); } -static SDL_bool -HIDAPI_DriverSteam_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverSteam_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { return SDL_IsJoystickSteamController(vendor_id, product_id); } -static SDL_bool -HIDAPI_DriverSteam_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverSteam_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverSteam_Context *ctx; @@ -1060,23 +993,22 @@ HIDAPI_DriverSteam_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverSteam_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverSteam_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverSteam_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverSteam_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverSteam_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverSteam_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverSteam_Context *ctx = (SDL_DriverSteam_Context *)device->context; float update_rate_in_hz = 0.0f; + SDL_AssertJoysticksLocked(); + ctx->report_sensors = SDL_FALSE; SDL_zero(ctx->m_assembler); SDL_zero(ctx->m_state); @@ -1102,55 +1034,49 @@ HIDAPI_DriverSteam_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return SDL_TRUE; } -static int -HIDAPI_DriverSteam_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverSteam_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { /* You should use the full Steam Input API for rumble support */ return SDL_Unsupported(); } -static int -HIDAPI_DriverSteam_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverSteam_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverSteam_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverSteam_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { /* You should use the full Steam Input API for extended capabilities */ return 0; } -static int -HIDAPI_DriverSteam_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverSteam_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { /* You should use the full Steam Input API for LED support */ return SDL_Unsupported(); } -static int -HIDAPI_DriverSteam_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverSteam_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverSteam_SetSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverSteam_SetSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { SDL_DriverSteam_Context *ctx = (SDL_DriverSteam_Context *)device->context; unsigned char buf[65]; int nSettings = 0; - SDL_memset( buf, 0, 65 ); + SDL_memset(buf, 0, 65); buf[1] = ID_SET_SETTINGS_VALUES; if (enabled) { - ADD_SETTING( SETTING_GYRO_MODE, 0x18 /* SETTING_GYRO_SEND_RAW_ACCEL | SETTING_GYRO_MODE_SEND_RAW_GYRO */ ); + ADD_SETTING(SETTING_IMU_MODE, SETTING_GYRO_MODE_SEND_RAW_ACCEL | SETTING_GYRO_MODE_SEND_RAW_GYRO); } else { - ADD_SETTING( SETTING_GYRO_MODE, 0x00 /* SETTING_GYRO_MODE_OFF */ ); + ADD_SETTING(SETTING_IMU_MODE, SETTING_GYRO_MODE_OFF); } - buf[2] = nSettings*3; - if (SetFeatureReport( device->dev, buf, 3+nSettings*3 ) < 0) { + buf[2] = nSettings * 3; + if (SetFeatureReport(device->dev, buf, 3 + nSettings * 3) < 0) { return SDL_SetError("Couldn't write feature report"); } @@ -1159,8 +1085,7 @@ HIDAPI_DriverSteam_SetSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *jo return 0; } -static SDL_bool -HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverSteam_Context *ctx = (SDL_DriverSteam_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -1171,8 +1096,7 @@ HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) return SDL_FALSE; } - for (;;) - { + for (;;) { uint8_t data[128]; int r, nPacketLength; const Uint8 *pPacket; @@ -1196,38 +1120,38 @@ HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) if (nPacketLength > 0 && UpdateSteamControllerState(pPacket, nPacketLength, &ctx->m_state)) { if (ctx->m_state.ulButtons != ctx->m_last_state.ulButtons) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, - (ctx->m_state.ulButtons & STEAM_BUTTON_3_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_3_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_B, - (ctx->m_state.ulButtons & STEAM_BUTTON_1_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_1_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_X, - (ctx->m_state.ulButtons & STEAM_BUTTON_2_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_2_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_Y, - (ctx->m_state.ulButtons & STEAM_BUTTON_0_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_0_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, - (ctx->m_state.ulButtons & STEAM_LEFT_BUMPER_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_LEFT_BUMPER_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, - (ctx->m_state.ulButtons & STEAM_RIGHT_BUMPER_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_RIGHT_BUMPER_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, - (ctx->m_state.ulButtons & STEAM_BUTTON_MENU_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_MENU_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, - (ctx->m_state.ulButtons & STEAM_BUTTON_ESCAPE_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_ESCAPE_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, - (ctx->m_state.ulButtons & STEAM_BUTTON_STEAM_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_STEAM_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, - (ctx->m_state.ulButtons & STEAM_JOYSTICK_BUTTON_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_JOYSTICK_BUTTON_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1 + 0, - (ctx->m_state.ulButtons & STEAM_BUTTON_BACK_LEFT_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_BACK_LEFT_MASK) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1 + 1, - (ctx->m_state.ulButtons & STEAM_BUTTON_BACK_RIGHT_MASK) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.ulButtons & STEAM_BUTTON_BACK_RIGHT_MASK) ? SDL_PRESSED : SDL_RELEASED); } { /* Minimum distance from center of pad to register a direction */ @@ -1235,16 +1159,16 @@ HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) /* Pad coordinates are like math grid coordinates: negative is bottom left */ SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_UP, - (ctx->m_state.sLeftPadY > kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.sLeftPadY > kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_DOWN, - (ctx->m_state.sLeftPadY < -kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.sLeftPadY < -kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, - (ctx->m_state.sLeftPadX < -kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.sLeftPadX < -kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - (ctx->m_state.sLeftPadX > kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); + (ctx->m_state.sLeftPadX > kPadDeadZone) ? SDL_PRESSED : SDL_RELEASED); } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, (int)ctx->m_state.sTriggerL * 2 - 32768); @@ -1283,19 +1207,16 @@ HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) return SDL_TRUE; } -static void -HIDAPI_DriverSteam_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverSteam_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { CloseSteamController(device->dev); } -static void -HIDAPI_DriverSteam_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverSteam_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam = { SDL_HINT_JOYSTICK_HIDAPI_STEAM, SDL_TRUE, HIDAPI_DriverSteam_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_steamdeck.c b/src/joystick/hidapi/SDL_hidapi_steamdeck.c new file mode 100644 index 0000000000000..20554edc605ec --- /dev/null +++ b/src/joystick/hidapi/SDL_hidapi_steamdeck.c @@ -0,0 +1,433 @@ +/* + Simple DirectMedia Layer + Copyright (C) 2023 Max Maisel + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../SDL_internal.h" + +#ifdef SDL_JOYSTICK_HIDAPI + +#include "../SDL_sysjoystick.h" +#include "SDL_events.h" +#include "SDL_hidapijoystick_c.h" + +#ifdef SDL_JOYSTICK_HIDAPI_STEAMDECK + +/*****************************************************************************************************/ + +#include "steam/controller_constants.h" +#include "steam/controller_structs.h" + +typedef enum +{ + STEAMDECK_LBUTTON_R2 = 0x00000001, + STEAMDECK_LBUTTON_L2 = 0x00000002, + STEAMDECK_LBUTTON_R = 0x00000004, + STEAMDECK_LBUTTON_L = 0x00000008, + STEAMDECK_LBUTTON_Y = 0x00000010, + STEAMDECK_LBUTTON_B = 0x00000020, + STEAMDECK_LBUTTON_X = 0x00000040, + STEAMDECK_LBUTTON_A = 0x00000080, + STEAMDECK_LBUTTON_DPAD_UP = 0x00000100, + STEAMDECK_LBUTTON_DPAD_RIGHT = 0x00000200, + STEAMDECK_LBUTTON_DPAD_LEFT = 0x00000400, + STEAMDECK_LBUTTON_DPAD_DOWN = 0x00000800, + STEAMDECK_LBUTTON_VIEW = 0x00001000, + STEAMDECK_LBUTTON_STEAM = 0x00002000, + STEAMDECK_LBUTTON_MENU = 0x00004000, + STEAMDECK_LBUTTON_L5 = 0x00008000, + STEAMDECK_LBUTTON_R5 = 0x00010000, + STEAMDECK_LBUTTON_LEFT_PAD = 0x00020000, + STEAMDECK_LBUTTON_RIGHT_PAD = 0x00040000, + STEAMDECK_LBUTTON_L3 = 0x00400000, + STEAMDECK_LBUTTON_R3 = 0x04000000, + + STEAMDECK_HBUTTON_L4 = 0x00000200, + STEAMDECK_HBUTTON_R4 = 0x00000400, + STEAMDECK_HBUTTON_QAM = 0x00040000, +} SteamDeckButtons; + +typedef struct +{ + Uint32 update_rate_us; + Uint32 sensor_timestamp_us; + Uint64 last_button_state; + Uint8 watchdog_counter; +} SDL_DriverSteamDeck_Context; + +static SDL_bool DisableDeckLizardMode(SDL_hid_device *dev) +{ + int rc; + Uint8 buffer[HID_FEATURE_REPORT_BYTES + 1] = { 0 }; + FeatureReportMsg *msg = (FeatureReportMsg *)(buffer + 1); + + msg->header.type = ID_CLEAR_DIGITAL_MAPPINGS; + + rc = SDL_hid_send_feature_report(dev, buffer, sizeof(buffer)); + if (rc != sizeof(buffer)) + return SDL_FALSE; + + msg->header.type = ID_SET_SETTINGS_VALUES; + msg->header.length = 5 * sizeof(ControllerSetting); + msg->payload.setSettingsValues.settings[0].settingNum = SETTING_SMOOTH_ABSOLUTE_MOUSE; + msg->payload.setSettingsValues.settings[0].settingValue = 0; + msg->payload.setSettingsValues.settings[1].settingNum = SETTING_LEFT_TRACKPAD_MODE; + msg->payload.setSettingsValues.settings[1].settingValue = TRACKPAD_NONE; + msg->payload.setSettingsValues.settings[2].settingNum = SETTING_RIGHT_TRACKPAD_MODE; // disable mouse + msg->payload.setSettingsValues.settings[2].settingValue = TRACKPAD_NONE; + msg->payload.setSettingsValues.settings[3].settingNum = SETTING_LEFT_TRACKPAD_CLICK_PRESSURE; // disable clicky pad + msg->payload.setSettingsValues.settings[3].settingValue = 0xFFFF; + msg->payload.setSettingsValues.settings[4].settingNum = SETTING_RIGHT_TRACKPAD_CLICK_PRESSURE; // disable clicky pad + msg->payload.setSettingsValues.settings[4].settingValue = 0xFFFF; + + rc = SDL_hid_send_feature_report(dev, buffer, sizeof(buffer)); + if (rc != sizeof(buffer)) + return SDL_FALSE; + + // There may be a lingering report read back after changing settings. + // Discard it. + SDL_hid_get_feature_report(dev, buffer, sizeof(buffer)); + + return SDL_TRUE; +} + +static SDL_bool FeedDeckLizardWatchdog(SDL_hid_device *dev) +{ + int rc; + Uint8 buffer[HID_FEATURE_REPORT_BYTES + 1] = { 0 }; + FeatureReportMsg *msg = (FeatureReportMsg *)(buffer + 1); + + msg->header.type = ID_CLEAR_DIGITAL_MAPPINGS; + + rc = SDL_hid_send_feature_report(dev, buffer, sizeof(buffer)); + if (rc != sizeof(buffer)) + return SDL_FALSE; + + msg->header.type = ID_SET_SETTINGS_VALUES; + msg->header.length = 1 * sizeof(ControllerSetting); + msg->payload.setSettingsValues.settings[0].settingNum = SETTING_RIGHT_TRACKPAD_MODE; + msg->payload.setSettingsValues.settings[0].settingValue = TRACKPAD_NONE; + + rc = SDL_hid_send_feature_report(dev, buffer, sizeof(buffer)); + if (rc != sizeof(buffer)) + return SDL_FALSE; + + // There may be a lingering report read back after changing settings. + // Discard it. + SDL_hid_get_feature_report(dev, buffer, sizeof(buffer)); + + return SDL_TRUE; +} + +static void HIDAPI_DriverSteamDeck_HandleState(SDL_HIDAPI_Device *device, + SDL_Joystick *joystick, + ValveInReport_t *pInReport) +{ + float values[3]; + SDL_DriverSteamDeck_Context *ctx = (SDL_DriverSteamDeck_Context *)device->context; + + if (pInReport->payload.deckState.ulButtons != ctx->last_button_state) { + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_A) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_B, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_B) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_X, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_X) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_Y, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_Y) ? SDL_PRESSED : SDL_RELEASED); + + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R) ? SDL_PRESSED : SDL_RELEASED); + + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_VIEW) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_MENU) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_STEAM) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_QAM) ? SDL_PRESSED : SDL_RELEASED); + + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L3) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSTICK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R3) ? SDL_PRESSED : SDL_RELEASED); + + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PADDLE1, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_R4) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PADDLE2, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_L4) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PADDLE3, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R5) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_PADDLE4, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L5) ? SDL_PRESSED : SDL_RELEASED); + + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_UP, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_UP) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_DOWN, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_DOWN) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_LEFT) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_RIGHT) ? SDL_PRESSED : SDL_RELEASED); + ctx->last_button_state = pInReport->payload.deckState.ulButtons; + } + + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, + (int)pInReport->payload.deckState.sTriggerRawL * 2 - 32768); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + (int)pInReport->payload.deckState.sTriggerRawR * 2 - 32768); + + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, + pInReport->payload.deckState.sLeftStickX); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, + -pInReport->payload.deckState.sLeftStickY); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, + pInReport->payload.deckState.sRightStickX); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, + -pInReport->payload.deckState.sRightStickY); + + ctx->sensor_timestamp_us += ctx->update_rate_us; + + values[0] = (pInReport->payload.deckState.sGyroX / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); + values[1] = (pInReport->payload.deckState.sGyroZ / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); + values[2] = (-pInReport->payload.deckState.sGyroY / 32768.0f) * (2000.0f * ((float)M_PI / 180.0f)); + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, ctx->sensor_timestamp_us, values, 3); + + values[0] = (pInReport->payload.deckState.sAccelX / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + values[1] = (pInReport->payload.deckState.sAccelZ / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + values[2] = (-pInReport->payload.deckState.sAccelY / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_ACCEL, ctx->sensor_timestamp_us, values, 3); +} + +/*****************************************************************************************************/ + +static void HIDAPI_DriverSteamDeck_RegisterHints(SDL_HintCallback callback, void *userdata) +{ + SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK, callback, userdata); +} + +static void HIDAPI_DriverSteamDeck_UnregisterHints(SDL_HintCallback callback, void *userdata) +{ + SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK, callback, userdata); +} + +static SDL_bool HIDAPI_DriverSteamDeck_IsEnabled(void) +{ + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK, + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); +} + +static SDL_bool HIDAPI_DriverSteamDeck_IsSupportedDevice( + SDL_HIDAPI_Device *device, + const char *name, + SDL_GameControllerType type, + Uint16 vendor_id, + Uint16 product_id, + Uint16 version, + int interface_number, + int interface_class, + int interface_subclass, + int interface_protocol) +{ + return SDL_IsJoystickSteamDeck(vendor_id, product_id); +} + +static SDL_bool HIDAPI_DriverSteamDeck_InitDevice(SDL_HIDAPI_Device *device) +{ + int size; + Uint8 data[64]; + SDL_DriverSteamDeck_Context *ctx; + + ctx = (SDL_DriverSteamDeck_Context *)SDL_calloc(1, sizeof(*ctx)); + if (ctx == NULL) { + SDL_OutOfMemory(); + return SDL_FALSE; + } + + // Always 1kHz according to USB descriptor, but actually about 4 ms. + ctx->update_rate_us = 4000; + + device->context = ctx; + + // Read a report to see if this is the correct endpoint. + // Mouse, Keyboard and Controller have the same VID/PID but + // only the controller hidraw device receives hid reports. + size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 16); + if (size == 0) + return SDL_FALSE; + + if (!DisableDeckLizardMode(device->dev)) + return SDL_FALSE; + + HIDAPI_SetDeviceName(device, "Steam Deck"); + + return HIDAPI_JoystickConnected(device, NULL); +} + +static int HIDAPI_DriverSteamDeck_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +{ + return -1; +} + +static void HIDAPI_DriverSteamDeck_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +{ +} + +static SDL_bool HIDAPI_DriverSteamDeck_UpdateDevice(SDL_HIDAPI_Device *device) +{ + SDL_DriverSteamDeck_Context *ctx = (SDL_DriverSteamDeck_Context *)device->context; + SDL_Joystick *joystick = NULL; + int r; + uint8_t data[64]; + ValveInReport_t *pInReport = (ValveInReport_t *)data; + + if (device->num_joysticks > 0) { + joystick = SDL_JoystickFromInstanceID(device->joysticks[0]); + if (joystick == NULL) { + return SDL_FALSE; + } + } else { + return SDL_FALSE; + } + + if (ctx->watchdog_counter++ > 200) { + ctx->watchdog_counter = 0; + if (!FeedDeckLizardWatchdog(device->dev)) + return SDL_FALSE; + } + + SDL_memset(data, 0, sizeof(data)); + + do { + r = SDL_hid_read(device->dev, data, sizeof(data)); + + if (r < 0) { + /* Failed to read from controller */ + HIDAPI_JoystickDisconnected(device, device->joysticks[0]); + return SDL_FALSE; + } else if (r == 64 && + pInReport->header.unReportVersion == k_ValveInReportMsgVersion && + pInReport->header.ucType == ID_CONTROLLER_DECK_STATE && + pInReport->header.ucLength == 64) { + HIDAPI_DriverSteamDeck_HandleState(device, joystick, pInReport); + } + } while (r > 0); + + return SDL_TRUE; +} + +static SDL_bool HIDAPI_DriverSteamDeck_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +{ + SDL_DriverSteamDeck_Context *ctx = (SDL_DriverSteamDeck_Context *)device->context; + float update_rate_in_hz = 1.0f / (float)(ctx->update_rate_us) * 1.0e6f; + + SDL_AssertJoysticksLocked(); + + // Initialize the joystick capabilities + joystick->nbuttons = 20; + joystick->naxes = SDL_CONTROLLER_AXIS_MAX; + + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, update_rate_in_hz); + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, update_rate_in_hz); + + return SDL_TRUE; +} + +static int HIDAPI_DriverSteamDeck_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +{ + int rc; + Uint8 buffer[HID_FEATURE_REPORT_BYTES + 1] = { 0 }; + FeatureReportMsg *msg = (FeatureReportMsg *)(buffer + 1); + + msg->header.type = ID_TRIGGER_RUMBLE_CMD; + msg->payload.simpleRumble.unRumbleType = 0; + msg->payload.simpleRumble.unIntensity = HAPTIC_INTENSITY_SYSTEM; + msg->payload.simpleRumble.unLeftMotorSpeed = low_frequency_rumble; + msg->payload.simpleRumble.unRightMotorSpeed = high_frequency_rumble; + msg->payload.simpleRumble.nLeftGain = 2; + msg->payload.simpleRumble.nRightGain = 0; + + rc = SDL_hid_send_feature_report(device->dev, buffer, sizeof(buffer)); + if (rc != sizeof(buffer)) + return -1; + return 0; +} + +static int HIDAPI_DriverSteamDeck_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +{ + return SDL_Unsupported(); +} + +static Uint32 HIDAPI_DriverSteamDeck_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +{ + return SDL_JOYCAP_RUMBLE; +} + +static int HIDAPI_DriverSteamDeck_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +{ + return SDL_Unsupported(); +} + +static int HIDAPI_DriverSteamDeck_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +{ + return SDL_Unsupported(); +} + +static int HIDAPI_DriverSteamDeck_SetSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +{ + // On steam deck, sensors are enabled by default. Nothing to do here. + return 0; +} + +static void HIDAPI_DriverSteamDeck_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +{ + // Lizard mode id automatically re-enabled by watchdog. Nothing to do here. +} + +static void HIDAPI_DriverSteamDeck_FreeDevice(SDL_HIDAPI_Device *device) +{ +} + +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteamDeck = { + SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK, + SDL_TRUE, + HIDAPI_DriverSteamDeck_RegisterHints, + HIDAPI_DriverSteamDeck_UnregisterHints, + HIDAPI_DriverSteamDeck_IsEnabled, + HIDAPI_DriverSteamDeck_IsSupportedDevice, + HIDAPI_DriverSteamDeck_InitDevice, + HIDAPI_DriverSteamDeck_GetDevicePlayerIndex, + HIDAPI_DriverSteamDeck_SetDevicePlayerIndex, + HIDAPI_DriverSteamDeck_UpdateDevice, + HIDAPI_DriverSteamDeck_OpenJoystick, + HIDAPI_DriverSteamDeck_RumbleJoystick, + HIDAPI_DriverSteamDeck_RumbleJoystickTriggers, + HIDAPI_DriverSteamDeck_GetJoystickCapabilities, + HIDAPI_DriverSteamDeck_SetJoystickLED, + HIDAPI_DriverSteamDeck_SendJoystickEffect, + HIDAPI_DriverSteamDeck_SetSensorsEnabled, + HIDAPI_DriverSteamDeck_CloseJoystick, + HIDAPI_DriverSteamDeck_FreeDevice, +}; + +#endif /* SDL_JOYSTICK_HIDAPI_STEAMDECK */ + +#endif /* SDL_JOYSTICK_HIDAPI */ diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index 901761fac679a..ab80858b7eb49 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,7 +35,6 @@ #include "SDL_hidapi_rumble.h" #include "SDL_hidapi_nintendo.h" - #ifdef SDL_JOYSTICK_HIDAPI_SWITCH /* Define this if you want to log all packets from the controller */ @@ -55,52 +54,55 @@ If you send commands more frequently than this, you can turn off the controller in Bluetooth mode, or the motors can miss the command in USB mode. */ -#define RUMBLE_WRITE_FREQUENCY_MS 30 +#define RUMBLE_WRITE_FREQUENCY_MS 30 /* How often you have to refresh a long duration rumble to keep the motors running */ #define RUMBLE_REFRESH_FREQUENCY_MS 50 -#define SWITCH_GYRO_SCALE 14.2842f -#define SWITCH_ACCEL_SCALE 4096.f +#define SWITCH_GYRO_SCALE 14.2842f +#define SWITCH_ACCEL_SCALE 4096.f -#define SWITCH_GYRO_SCALE_OFFSET 13371.0f -#define SWITCH_GYRO_SCALE_MULT 936.0f -#define SWITCH_ACCEL_SCALE_OFFSET 16384.0f -#define SWITCH_ACCEL_SCALE_MULT 4.0f +#define SWITCH_GYRO_SCALE_MULT 936.0f +#define SWITCH_ACCEL_SCALE_MULT 4.0f -typedef enum { - k_eSwitchInputReportIDs_SubcommandReply = 0x21, - k_eSwitchInputReportIDs_FullControllerState = 0x30, +typedef enum +{ + k_eSwitchInputReportIDs_SubcommandReply = 0x21, + k_eSwitchInputReportIDs_FullControllerState = 0x30, + k_eSwitchInputReportIDs_FullControllerAndMcuState = 0x31, k_eSwitchInputReportIDs_SimpleControllerState = 0x3F, - k_eSwitchInputReportIDs_CommandAck = 0x81, + k_eSwitchInputReportIDs_CommandAck = 0x81, } ESwitchInputReportIDs; -typedef enum { +typedef enum +{ k_eSwitchOutputReportIDs_RumbleAndSubcommand = 0x01, - k_eSwitchOutputReportIDs_Rumble = 0x10, - k_eSwitchOutputReportIDs_Proprietary = 0x80, + k_eSwitchOutputReportIDs_Rumble = 0x10, + k_eSwitchOutputReportIDs_Proprietary = 0x80, } ESwitchOutputReportIDs; -typedef enum { +typedef enum +{ k_eSwitchSubcommandIDs_BluetoothManualPair = 0x01, - k_eSwitchSubcommandIDs_RequestDeviceInfo = 0x02, - k_eSwitchSubcommandIDs_SetInputReportMode = 0x03, - k_eSwitchSubcommandIDs_SetHCIState = 0x06, - k_eSwitchSubcommandIDs_SPIFlashRead = 0x10, - k_eSwitchSubcommandIDs_SetPlayerLights = 0x30, - k_eSwitchSubcommandIDs_SetHomeLight = 0x38, - k_eSwitchSubcommandIDs_EnableIMU = 0x40, - k_eSwitchSubcommandIDs_SetIMUSensitivity = 0x41, - k_eSwitchSubcommandIDs_EnableVibration = 0x48, + k_eSwitchSubcommandIDs_RequestDeviceInfo = 0x02, + k_eSwitchSubcommandIDs_SetInputReportMode = 0x03, + k_eSwitchSubcommandIDs_SetHCIState = 0x06, + k_eSwitchSubcommandIDs_SPIFlashRead = 0x10, + k_eSwitchSubcommandIDs_SetPlayerLights = 0x30, + k_eSwitchSubcommandIDs_SetHomeLight = 0x38, + k_eSwitchSubcommandIDs_EnableIMU = 0x40, + k_eSwitchSubcommandIDs_SetIMUSensitivity = 0x41, + k_eSwitchSubcommandIDs_EnableVibration = 0x48, } ESwitchSubcommandIDs; -typedef enum { - k_eSwitchProprietaryCommandIDs_Status = 0x01, +typedef enum +{ + k_eSwitchProprietaryCommandIDs_Status = 0x01, k_eSwitchProprietaryCommandIDs_Handshake = 0x02, k_eSwitchProprietaryCommandIDs_HighSpeed = 0x03, - k_eSwitchProprietaryCommandIDs_ForceUSB = 0x04, - k_eSwitchProprietaryCommandIDs_ClearUSB = 0x05, - k_eSwitchProprietaryCommandIDs_ResetMCU = 0x06, + k_eSwitchProprietaryCommandIDs_ForceUSB = 0x04, + k_eSwitchProprietaryCommandIDs_ClearUSB = 0x05, + k_eSwitchProprietaryCommandIDs_ResetMCU = 0x06, } ESwitchProprietaryCommandIDs; #define k_unSwitchOutputPacketDataLength 49 @@ -108,17 +110,21 @@ typedef enum { #define k_unSwitchBluetoothPacketLength k_unSwitchOutputPacketDataLength #define k_unSwitchUSBPacketLength k_unSwitchMaxOutputPacketLength -#define k_unSPIStickCalibrationStartOffset 0x603D -#define k_unSPIStickCalibrationEndOffset 0x604E -#define k_unSPIStickCalibrationLength (k_unSPIStickCalibrationEndOffset - k_unSPIStickCalibrationStartOffset + 1) +#define k_unSPIStickFactoryCalibrationStartOffset 0x603D +#define k_unSPIStickFactoryCalibrationEndOffset 0x604E +#define k_unSPIStickFactoryCalibrationLength (k_unSPIStickFactoryCalibrationEndOffset - k_unSPIStickFactoryCalibrationStartOffset + 1) + +#define k_unSPIStickUserCalibrationStartOffset 0x8010 +#define k_unSPIStickUserCalibrationEndOffset 0x8025 +#define k_unSPIStickUserCalibrationLength (k_unSPIStickUserCalibrationEndOffset - k_unSPIStickUserCalibrationStartOffset + 1) -#define k_unSPIIMUScaleStartOffset 0x6020 -#define k_unSPIIMUScaleEndOffset 0x6037 -#define k_unSPIIMUScaleLength (k_unSPIIMUScaleEndOffset - k_unSPIIMUScaleStartOffset + 1) +#define k_unSPIIMUScaleStartOffset 0x6020 +#define k_unSPIIMUScaleEndOffset 0x6037 +#define k_unSPIIMUScaleLength (k_unSPIIMUScaleEndOffset - k_unSPIIMUScaleStartOffset + 1) -#define k_unSPIIMUUserScaleStartOffset 0x8026 -#define k_unSPIIMUUserScaleEndOffset 0x8039 -#define k_unSPIIMUUserScaleLength (k_unSPIIMUUserScaleEndOffset - k_unSPIIMUUserScaleStartOffset + 1) +#define k_unSPIIMUUserScaleStartOffset 0x8026 +#define k_unSPIIMUUserScaleEndOffset 0x8039 +#define k_unSPIIMUUserScaleLength (k_unSPIIMUUserScaleEndOffset - k_unSPIIMUUserScaleStartOffset + 1) #pragma pack(1) typedef struct @@ -151,7 +157,8 @@ typedef struct { SwitchControllerStatePacket_t controllerState; - struct { + struct + { Sint16 sAccelX; Sint16 sAccelY; Sint16 sAccelZ; @@ -175,16 +182,19 @@ typedef struct Uint8 ucSubcommandAck; Uint8 ucSubcommandID; - #define k_unSubcommandDataBytes 35 - union { +#define k_unSubcommandDataBytes 35 + union + { Uint8 rgucSubcommandData[k_unSubcommandDataBytes]; - struct { + struct + { SwitchSPIOpData_t opData; Uint8 rgucReadData[k_unSubcommandDataBytes - sizeof(SwitchSPIOpData_t)]; } spiReadData; - struct { + struct + { Uint8 rgucFirmwareVersion[2]; Uint8 ucDeviceType; Uint8 ucFiller1; @@ -192,6 +202,22 @@ typedef struct Uint8 ucFiller2; Uint8 ucColorLocation; } deviceInfo; + + struct + { + SwitchSPIOpData_t opData; + Uint8 rgucLeftCalibration[9]; + Uint8 rgucRightCalibration[9]; + } stickFactoryCalibration; + + struct + { + SwitchSPIOpData_t opData; + Uint8 rgucLeftMagic[2]; + Uint8 rgucLeftCalibration[9]; + Uint8 rgucRightMagic[2]; + Uint8 rgucRightCalibration[9]; + } stickUserCalibration; }; } SwitchSubcommandInputPacket_t; @@ -234,17 +260,20 @@ typedef struct } SwitchProprietaryOutputPacket_t; #pragma pack() -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; SDL_bool m_bInputOnly; SDL_bool m_bIsGameCube; SDL_bool m_bUseButtonLabels; SDL_bool m_bPlayerLights; - int m_nPlayerIndex; + int m_nPlayerIndex; SDL_bool m_bSyncWrite; - int m_nMaxWriteAttempts; + int m_nMaxWriteAttempts; ESwitchDeviceInfoControllerType m_eControllerType; + Uint8 m_nInitialInputMode; + Uint8 m_nCurrentInputMode; Uint8 m_rgucMACAddress[6]; Uint8 m_nCommandNumber; SwitchCommonOutputPacket_t m_RumblePacket; @@ -268,22 +297,27 @@ typedef struct { SwitchSimpleStatePacket_t m_lastSimpleState; SwitchStatePacket_t m_lastFullState; - struct StickCalibrationData { - struct { + struct StickCalibrationData + { + struct + { Sint16 sCenter; Sint16 sMin; Sint16 sMax; } axis[2]; } m_StickCalData[2]; - struct StickExtents { - struct { + struct StickExtents + { + struct + { Sint16 sMin; Sint16 sMax; } axis[2]; } m_StickExtents[2], m_SimpleStickExtents[2]; - struct IMUScaleData { + struct IMUScaleData + { float fAccelScaleX; float fAccelScaleY; float fAccelScaleZ; @@ -294,15 +328,30 @@ typedef struct { } m_IMUScaleData; } SDL_DriverSwitch_Context; - static int ReadInput(SDL_DriverSwitch_Context *ctx) { + int result; + /* Make sure we don't try to read at the same time a write is happening */ if (SDL_AtomicGet(&ctx->device->rumble_pending) > 0) { return 0; } - return SDL_hid_read_timeout(ctx->device->dev, ctx->m_rgucReadBuffer, sizeof(ctx->m_rgucReadBuffer), 0); + result = SDL_hid_read_timeout(ctx->device->dev, ctx->m_rgucReadBuffer, sizeof(ctx->m_rgucReadBuffer), 0); + + /* See if we can guess the initial input mode */ + if (result > 0 && !ctx->m_bInputOnly && !ctx->m_nInitialInputMode) { + switch (ctx->m_rgucReadBuffer[0]) { + case k_eSwitchInputReportIDs_FullControllerState: + case k_eSwitchInputReportIDs_FullControllerAndMcuState: + case k_eSwitchInputReportIDs_SimpleControllerState: + ctx->m_nInitialInputMode = ctx->m_rgucReadBuffer[0]; + break; + default: + break; + } + } + return result; } static int WriteOutput(SDL_DriverSwitch_Context *ctx, const Uint8 *data, int size) @@ -311,7 +360,7 @@ static int WriteOutput(SDL_DriverSwitch_Context *ctx, const Uint8 *data, int siz return SDL_hid_write(ctx->device->dev, data, size); #else /* Use the rumble thread for general asynchronous writes */ - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return -1; } return SDL_HIDAPI_SendRumbleAndUnlock(ctx->device, data, size); @@ -395,14 +444,14 @@ static SDL_bool WritePacket(SDL_DriverSwitch_Context *ctx, void *pBuf, Uint8 ucL if (ucLen < unWriteSize) { SDL_memcpy(rgucBuf, pBuf, ucLen); - SDL_memset(rgucBuf+ucLen, 0, unWriteSize-ucLen); + SDL_memset(rgucBuf + ucLen, 0, unWriteSize - ucLen); pBuf = rgucBuf; ucLen = (Uint8)unWriteSize; } if (ctx->m_bSyncWrite) { - return (SDL_hid_write(ctx->device->dev, (Uint8 *)pBuf, ucLen) >= 0); + return SDL_hid_write(ctx->device->dev, (Uint8 *)pBuf, ucLen) >= 0; } else { - return (WriteOutput(ctx, (Uint8 *)pBuf, ucLen) >= 0); + return WriteOutput(ctx, (Uint8 *)pBuf, ucLen) >= 0; } } @@ -451,35 +500,22 @@ static SDL_bool WriteProprietary(SDL_DriverSwitch_Context *ctx, ESwitchProprieta } if (!waitForReply || ReadProprietaryReply(ctx, ucCommand)) { -//SDL_Log("Succeeded%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries); + // SDL_Log("Succeeded%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries); return SDL_TRUE; } } -//SDL_Log("Failed%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries); + // SDL_Log("Failed%s after %d tries\n", ctx->m_bSyncWrite ? " (sync)" : "", nTries); return SDL_FALSE; } -static Uint8 EncodeRumbleHighAmplitude(Uint16 amplitude) { +static Uint8 EncodeRumbleHighAmplitude(Uint16 amplitude) +{ /* More information about these values can be found here: * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md */ - Uint16 hfa[101][2] = { {0, 0x0},{514, 0x2},{775, 0x4},{921, 0x6},{1096, 0x8},{1303, 0x0a},{1550, 0x0c}, - {1843, 0x0e},{2192, 0x10},{2606, 0x12},{3100, 0x14},{3686, 0x16},{4383, 0x18},{5213, 0x1a}, - {6199, 0x1c},{7372, 0x1e},{7698, 0x20},{8039, 0x22},{8395, 0x24},{8767, 0x26},{9155, 0x28}, - {9560, 0x2a},{9984, 0x2c},{10426, 0x2e},{10887, 0x30},{11369, 0x32},{11873, 0x34},{12398, 0x36}, - {12947, 0x38},{13520, 0x3a},{14119, 0x3c},{14744, 0x3e},{15067, 0x40},{15397, 0x42},{15734, 0x44}, - {16079, 0x46},{16431, 0x48},{16790, 0x4a},{17158, 0x4c},{17534, 0x4e},{17918, 0x50},{18310, 0x52}, - {18711, 0x54},{19121, 0x56},{19540, 0x58},{19967, 0x5a},{20405, 0x5c},{20851, 0x5e},{21308, 0x60}, - {21775, 0x62},{22251, 0x64},{22739, 0x66},{23236, 0x68},{23745, 0x6a},{24265, 0x6c},{24797, 0x6e}, - {25340, 0x70},{25894, 0x72},{26462, 0x74},{27041, 0x76},{27633, 0x78},{28238, 0x7a},{28856, 0x7c}, - {29488, 0x7e},{30134, 0x80},{30794, 0x82},{31468, 0x84},{32157, 0x86},{32861, 0x88},{33581, 0x8a}, - {34316, 0x8c},{35068, 0x8e},{35836, 0x90},{36620, 0x92},{37422, 0x94},{38242, 0x96},{39079, 0x98}, - {39935, 0x9a},{40809, 0x9c},{41703, 0x9e},{42616, 0xa0},{43549, 0xa2},{44503, 0xa4},{45477, 0xa6}, - {46473, 0xa8},{47491, 0xaa},{48531, 0xac},{49593, 0xae},{50679, 0xb0},{51789, 0xb2},{52923, 0xb4}, - {54082, 0xb6},{55266, 0xb8},{56476, 0xba},{57713, 0xbc},{58977, 0xbe},{60268, 0xc0},{61588, 0xc2}, - {62936, 0xc4},{64315, 0xc6},{65535, 0xc8} }; + Uint16 hfa[101][2] = { { 0, 0x0 }, { 514, 0x2 }, { 775, 0x4 }, { 921, 0x6 }, { 1096, 0x8 }, { 1303, 0x0a }, { 1550, 0x0c }, { 1843, 0x0e }, { 2192, 0x10 }, { 2606, 0x12 }, { 3100, 0x14 }, { 3686, 0x16 }, { 4383, 0x18 }, { 5213, 0x1a }, { 6199, 0x1c }, { 7372, 0x1e }, { 7698, 0x20 }, { 8039, 0x22 }, { 8395, 0x24 }, { 8767, 0x26 }, { 9155, 0x28 }, { 9560, 0x2a }, { 9984, 0x2c }, { 10426, 0x2e }, { 10887, 0x30 }, { 11369, 0x32 }, { 11873, 0x34 }, { 12398, 0x36 }, { 12947, 0x38 }, { 13520, 0x3a }, { 14119, 0x3c }, { 14744, 0x3e }, { 15067, 0x40 }, { 15397, 0x42 }, { 15734, 0x44 }, { 16079, 0x46 }, { 16431, 0x48 }, { 16790, 0x4a }, { 17158, 0x4c }, { 17534, 0x4e }, { 17918, 0x50 }, { 18310, 0x52 }, { 18711, 0x54 }, { 19121, 0x56 }, { 19540, 0x58 }, { 19967, 0x5a }, { 20405, 0x5c }, { 20851, 0x5e }, { 21308, 0x60 }, { 21775, 0x62 }, { 22251, 0x64 }, { 22739, 0x66 }, { 23236, 0x68 }, { 23745, 0x6a }, { 24265, 0x6c }, { 24797, 0x6e }, { 25340, 0x70 }, { 25894, 0x72 }, { 26462, 0x74 }, { 27041, 0x76 }, { 27633, 0x78 }, { 28238, 0x7a }, { 28856, 0x7c }, { 29488, 0x7e }, { 30134, 0x80 }, { 30794, 0x82 }, { 31468, 0x84 }, { 32157, 0x86 }, { 32861, 0x88 }, { 33581, 0x8a }, { 34316, 0x8c }, { 35068, 0x8e }, { 35836, 0x90 }, { 36620, 0x92 }, { 37422, 0x94 }, { 38242, 0x96 }, { 39079, 0x98 }, { 39935, 0x9a }, { 40809, 0x9c }, { 41703, 0x9e }, { 42616, 0xa0 }, { 43549, 0xa2 }, { 44503, 0xa4 }, { 45477, 0xa6 }, { 46473, 0xa8 }, { 47491, 0xaa }, { 48531, 0xac }, { 49593, 0xae }, { 50679, 0xb0 }, { 51789, 0xb2 }, { 52923, 0xb4 }, { 54082, 0xb6 }, { 55266, 0xb8 }, { 56476, 0xba }, { 57713, 0xbc }, { 58977, 0xbe }, { 60268, 0xc0 }, { 61588, 0xc2 }, { 62936, 0xc4 }, { 64315, 0xc6 }, { 65535, 0xc8 } }; int index = 0; - for ( ; index < 101; index++) { + for (; index < 101; index++) { if (amplitude <= hfa[index][0]) { return (Uint8)hfa[index][1]; } @@ -487,27 +523,12 @@ static Uint8 EncodeRumbleHighAmplitude(Uint16 amplitude) { return (Uint8)hfa[100][1]; } -static Uint16 EncodeRumbleLowAmplitude(Uint16 amplitude) { +static Uint16 EncodeRumbleLowAmplitude(Uint16 amplitude) +{ /* More information about these values can be found here: * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md */ - Uint16 lfa[101][2] = { {0, 0x0040},{514, 0x8040},{775, 0x0041},{921, 0x8041},{1096, 0x0042}, - {1303, 0x8042},{1550, 0x0043},{1843, 0x8043},{2192, 0x0044},{2606, 0x8044},{3100, 0x0045}, - {3686, 0x8045},{4383, 0x0046},{5213, 0x8046},{6199, 0x0047},{7372, 0x8047},{7698, 0x0048}, - {8039, 0x8048},{8395, 0x0049},{8767, 0x8049},{9155, 0x004a},{9560, 0x804a},{9984, 0x004b}, - {10426, 0x804b},{10887, 0x004c},{11369, 0x804c},{11873, 0x004d},{12398, 0x804d},{12947, 0x004e}, - {13520, 0x804e},{14119, 0x004f},{14744, 0x804f},{15067, 0x0050},{15397, 0x8050},{15734, 0x0051}, - {16079, 0x8051},{16431, 0x0052},{16790, 0x8052},{17158, 0x0053},{17534, 0x8053},{17918, 0x0054}, - {18310, 0x8054},{18711, 0x0055},{19121, 0x8055},{19540, 0x0056},{19967, 0x8056},{20405, 0x0057}, - {20851, 0x8057},{21308, 0x0058},{21775, 0x8058},{22251, 0x0059},{22739, 0x8059},{23236, 0x005a}, - {23745, 0x805a},{24265, 0x005b},{24797, 0x805b},{25340, 0x005c},{25894, 0x805c},{26462, 0x005d}, - {27041, 0x805d},{27633, 0x005e},{28238, 0x805e},{28856, 0x005f},{29488, 0x805f},{30134, 0x0060}, - {30794, 0x8060},{31468, 0x0061},{32157, 0x8061},{32861, 0x0062},{33581, 0x8062},{34316, 0x0063}, - {35068, 0x8063},{35836, 0x0064},{36620, 0x8064},{37422, 0x0065},{38242, 0x8065},{39079, 0x0066}, - {39935, 0x8066},{40809, 0x0067},{41703, 0x8067},{42616, 0x0068},{43549, 0x8068},{44503, 0x0069}, - {45477, 0x8069},{46473, 0x006a},{47491, 0x806a},{48531, 0x006b},{49593, 0x806b},{50679, 0x006c}, - {51789, 0x806c},{52923, 0x006d},{54082, 0x806d},{55266, 0x006e},{56476, 0x806e},{57713, 0x006f}, - {58977, 0x806f},{60268, 0x0070},{61588, 0x8070},{62936, 0x0071},{64315, 0x8071},{65535, 0x0072} }; + Uint16 lfa[101][2] = { { 0, 0x0040 }, { 514, 0x8040 }, { 775, 0x0041 }, { 921, 0x8041 }, { 1096, 0x0042 }, { 1303, 0x8042 }, { 1550, 0x0043 }, { 1843, 0x8043 }, { 2192, 0x0044 }, { 2606, 0x8044 }, { 3100, 0x0045 }, { 3686, 0x8045 }, { 4383, 0x0046 }, { 5213, 0x8046 }, { 6199, 0x0047 }, { 7372, 0x8047 }, { 7698, 0x0048 }, { 8039, 0x8048 }, { 8395, 0x0049 }, { 8767, 0x8049 }, { 9155, 0x004a }, { 9560, 0x804a }, { 9984, 0x004b }, { 10426, 0x804b }, { 10887, 0x004c }, { 11369, 0x804c }, { 11873, 0x004d }, { 12398, 0x804d }, { 12947, 0x004e }, { 13520, 0x804e }, { 14119, 0x004f }, { 14744, 0x804f }, { 15067, 0x0050 }, { 15397, 0x8050 }, { 15734, 0x0051 }, { 16079, 0x8051 }, { 16431, 0x0052 }, { 16790, 0x8052 }, { 17158, 0x0053 }, { 17534, 0x8053 }, { 17918, 0x0054 }, { 18310, 0x8054 }, { 18711, 0x0055 }, { 19121, 0x8055 }, { 19540, 0x0056 }, { 19967, 0x8056 }, { 20405, 0x0057 }, { 20851, 0x8057 }, { 21308, 0x0058 }, { 21775, 0x8058 }, { 22251, 0x0059 }, { 22739, 0x8059 }, { 23236, 0x005a }, { 23745, 0x805a }, { 24265, 0x005b }, { 24797, 0x805b }, { 25340, 0x005c }, { 25894, 0x805c }, { 26462, 0x005d }, { 27041, 0x805d }, { 27633, 0x005e }, { 28238, 0x805e }, { 28856, 0x005f }, { 29488, 0x805f }, { 30134, 0x0060 }, { 30794, 0x8060 }, { 31468, 0x0061 }, { 32157, 0x8061 }, { 32861, 0x0062 }, { 33581, 0x8062 }, { 34316, 0x0063 }, { 35068, 0x8063 }, { 35836, 0x0064 }, { 36620, 0x8064 }, { 37422, 0x0065 }, { 38242, 0x8065 }, { 39079, 0x0066 }, { 39935, 0x8066 }, { 40809, 0x0067 }, { 41703, 0x8067 }, { 42616, 0x0068 }, { 43549, 0x8068 }, { 44503, 0x0069 }, { 45477, 0x8069 }, { 46473, 0x006a }, { 47491, 0x806a }, { 48531, 0x006b }, { 49593, 0x806b }, { 50679, 0x006c }, { 51789, 0x806c }, { 52923, 0x006d }, { 54082, 0x806d }, { 55266, 0x006e }, { 56476, 0x806e }, { 57713, 0x006f }, { 58977, 0x806f }, { 60268, 0x0070 }, { 61588, 0x8070 }, { 62936, 0x0071 }, { 64315, 0x8071 }, { 65535, 0x0072 } }; int index = 0; for (; index < 101; index++) { if (amplitude <= lfa[index][0]) { @@ -533,13 +554,13 @@ static void EncodeRumble(SwitchRumbleData_t *pRumble, Uint16 usHighFreq, Uint8 u pRumble->rgucData[0] = usHighFreq & 0xFF; pRumble->rgucData[1] = ucHighFreqAmp | ((usHighFreq >> 8) & 0x01); - pRumble->rgucData[2] = ucLowFreq | ((usLowFreqAmp >> 8) & 0x80); - pRumble->rgucData[3] = usLowFreqAmp & 0xFF; + pRumble->rgucData[2] = ucLowFreq | ((usLowFreqAmp >> 8) & 0x80); + pRumble->rgucData[3] = usLowFreqAmp & 0xFF; #ifdef DEBUG_RUMBLE SDL_Log("Freq: %.2X %.2X %.2X, Amp: %.2X %.2X %.2X\n", - usHighFreq & 0xFF, ((usHighFreq >> 8) & 0x01), ucLowFreq, - ucHighFreqAmp, ((usLowFreqAmp >> 8) & 0x80), usLowFreqAmp & 0xFF); + usHighFreq & 0xFF, ((usHighFreq >> 8) & 0x01), ucLowFreq, + ucHighFreqAmp, ((usLowFreqAmp >> 8) & 0x80), usLowFreqAmp & 0xFF); #endif } else { SetNeutralRumble(pRumble); @@ -596,8 +617,9 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx) ctx->m_eControllerType = CalculateControllerType(ctx, (ESwitchDeviceInfoControllerType)status->ucDeviceType); - for (i = 0; i < sizeof (ctx->m_rgucMACAddress); ++i) - ctx->m_rgucMACAddress[i] = status->rgucMACAddress[ sizeof(ctx->m_rgucMACAddress) - i - 1 ]; + for (i = 0; i < sizeof(ctx->m_rgucMACAddress); ++i) { + ctx->m_rgucMACAddress[i] = status->rgucMACAddress[sizeof(ctx->m_rgucMACAddress) - i - 1]; + } return SDL_TRUE; } @@ -614,8 +636,6 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx) return SDL_TRUE; } - ctx->device->is_bluetooth = SDL_FALSE; - return SDL_FALSE; } @@ -646,11 +666,16 @@ static SDL_bool BTrySetupUSB(SDL_DriverSwitch_Context *ctx) static SDL_bool SetVibrationEnabled(SDL_DriverSwitch_Context *ctx, Uint8 enabled) { return WriteSubcommand(ctx, k_eSwitchSubcommandIDs_EnableVibration, &enabled, sizeof(enabled), NULL); - } static SDL_bool SetInputMode(SDL_DriverSwitch_Context *ctx, Uint8 input_mode) { - return WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SetInputReportMode, &input_mode, 1, NULL); + if (input_mode == ctx->m_nCurrentInputMode) { + return SDL_TRUE; + } else { + ctx->m_nCurrentInputMode = input_mode; + + return WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SetInputReportMode, &input_mode, sizeof(input_mode), NULL); + } } static SDL_bool SetHomeLED(SDL_DriverSwitch_Context *ctx, Uint8 brightness) @@ -666,10 +691,10 @@ static SDL_bool SetHomeLED(SDL_DriverSwitch_Context *ctx, Uint8 brightness) } } - rgucBuffer[0] = (0x0 << 4) | 0x1; /* 0 mini cycles (besides first), cycle duration 8ms */ - rgucBuffer[1] = ((ucLedIntensity & 0xF) << 4) | 0x0; /* LED start intensity (0x0-0xF), 0 cycles (LED stays on at start intensity after first cycle) */ - rgucBuffer[2] = ((ucLedIntensity & 0xF) << 4) | 0x0; /* First cycle LED intensity, 0x0 intensity for second cycle */ - rgucBuffer[3] = (0x0 << 4) | 0x0; /* 8ms fade transition to first cycle, 8ms first cycle LED duration */ + rgucBuffer[0] = (0x0 << 4) | 0x1; /* 0 mini cycles (besides first), cycle duration 8ms */ + rgucBuffer[1] = ((ucLedIntensity & 0xF) << 4) | 0x0; /* LED start intensity (0x0-0xF), 0 cycles (LED stays on at start intensity after first cycle) */ + rgucBuffer[2] = ((ucLedIntensity & 0xF) << 4) | 0x0; /* First cycle LED intensity, 0x0 intensity for second cycle */ + rgucBuffer[3] = (0x0 << 4) | 0x0; /* 8ms fade transition to first cycle, 8ms first cycle LED duration */ return WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SetHomeLight, rgucBuffer, sizeof(rgucBuffer), NULL); } @@ -696,7 +721,7 @@ static void UpdateSlotLED(SDL_DriverSwitch_Context *ctx) { if (!ctx->m_bInputOnly) { Uint8 led_data = 0; - + if (ctx->m_bPlayerLights && ctx->m_nPlayerIndex >= 0) { led_data = (1 << (ctx->m_nPlayerIndex % 4)); } @@ -716,25 +741,120 @@ static void SDLCALL SDL_PlayerLEDHintChanged(void *userdata, const char *name, c } } -static SDL_bool SetIMUEnabled(SDL_DriverSwitch_Context* ctx, SDL_bool enabled) +static void GetInitialInputMode(SDL_DriverSwitch_Context *ctx) +{ + if (!ctx->m_nInitialInputMode) { + /* This will set the initial input mode if it can */ + ReadInput(ctx); + } +} + +static Uint8 GetDefaultInputMode(SDL_DriverSwitch_Context *ctx) +{ + Uint8 input_mode; + + /* Determine the desired input mode */ + if (ctx->m_nInitialInputMode) { + input_mode = ctx->m_nInitialInputMode; + } else { + if (ctx->device->is_bluetooth) { + input_mode = k_eSwitchInputReportIDs_SimpleControllerState; + } else { + input_mode = k_eSwitchInputReportIDs_FullControllerState; + } + } + + /* The official Nintendo Switch Pro Controller supports FullControllerState over Bluetooth + * just fine. We really should use that, or else the epowerlevel code in HandleFullControllerState + * is completely pointless. We need full state if we want battery level and we only care about + * battery level over Bluetooth anyway. + */ + if (ctx->device->vendor_id == USB_VENDOR_NINTENDO) { + /* However, switching to full controller state breaks DirectInput, so let's not do that */ + #if 0 + input_mode = k_eSwitchInputReportIDs_FullControllerState; + #endif + + /* However, Joy-Con controllers switch their thumbsticks into D-pad mode in simple mode, + * so let's enable full controller state for them. + */ + if (ctx->device->product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT || + ctx->device->product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT) { + input_mode = k_eSwitchInputReportIDs_FullControllerState; + } + } + return input_mode; +} + +static Uint8 GetSensorInputMode(SDL_DriverSwitch_Context *ctx) +{ + Uint8 input_mode; + + /* Determine the desired input mode */ + if (!ctx->m_nInitialInputMode || + ctx->m_nInitialInputMode == k_eSwitchInputReportIDs_SimpleControllerState) { + input_mode = k_eSwitchInputReportIDs_FullControllerState; + } else { + input_mode = ctx->m_nInitialInputMode; + } + return input_mode; +} + +static SDL_bool SetIMUEnabled(SDL_DriverSwitch_Context *ctx, SDL_bool enabled) { Uint8 imu_data = enabled ? 1 : 0; return WriteSubcommand(ctx, k_eSwitchSubcommandIDs_EnableIMU, &imu_data, sizeof(imu_data), NULL); } -static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx, Uint8 input_mode) +static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx) { - Uint8 *pStickCal; + Uint8 *pLeftStickCal; + Uint8 *pRightStickCal; size_t stick, axis; - SwitchSubcommandInputPacket_t *reply = NULL; + SwitchSubcommandInputPacket_t *user_reply = NULL; + SwitchSubcommandInputPacket_t *factory_reply = NULL; + SwitchSPIOpData_t readUserParams; + SwitchSPIOpData_t readFactoryParams; + const int MAX_ATTEMPTS = 3; + int attempt; + + /* Read User Calibration Info */ + readUserParams.unAddress = k_unSPIStickUserCalibrationStartOffset; + readUserParams.ucLength = k_unSPIStickUserCalibrationLength; + + /* This isn't readable on all controllers, so ignore failure */ + WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readUserParams, sizeof(readUserParams), &user_reply); + + /* Read Factory Calibration Info */ + readFactoryParams.unAddress = k_unSPIStickFactoryCalibrationStartOffset; + readFactoryParams.ucLength = k_unSPIStickFactoryCalibrationLength; + + for (attempt = 0; ; ++attempt) { + if (!WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readFactoryParams, sizeof(readFactoryParams), &factory_reply)) { + return SDL_FALSE; + } - /* Read Calibration Info */ - SwitchSPIOpData_t readParams; - readParams.unAddress = k_unSPIStickCalibrationStartOffset; - readParams.ucLength = k_unSPIStickCalibrationLength; + if (factory_reply->stickFactoryCalibration.opData.unAddress == k_unSPIStickFactoryCalibrationStartOffset) { + /* We successfully read the calibration data */ + break; + } - if (!WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readParams, sizeof(readParams), &reply)) { - return SDL_FALSE; + if (attempt == MAX_ATTEMPTS) { + return SDL_FALSE; + } + } + + /* Automatically select the user calibration if magic bytes are set */ + if (user_reply && user_reply->stickUserCalibration.rgucLeftMagic[0] == 0xB2 && user_reply->stickUserCalibration.rgucLeftMagic[1] == 0xA1) { + pLeftStickCal = user_reply->stickUserCalibration.rgucLeftCalibration; + } else { + pLeftStickCal = factory_reply->stickFactoryCalibration.rgucLeftCalibration; + } + + if (user_reply && user_reply->stickUserCalibration.rgucRightMagic[0] == 0xB2 && user_reply->stickUserCalibration.rgucRightMagic[1] == 0xA1) { + pRightStickCal = user_reply->stickUserCalibration.rgucRightCalibration; + } else { + pRightStickCal = factory_reply->stickFactoryCalibration.rgucRightCalibration; } /* Stick calibration values are 12-bits each and are packed by bit @@ -742,23 +862,22 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx, Uint8 input_ * Left: X-Max, Y-Max, X-Center, Y-Center, X-Min, Y-Min * Right: X-Center, Y-Center, X-Min, Y-Min, X-Max, Y-Max */ - pStickCal = reply->spiReadData.rgucReadData; /* Left stick */ - ctx->m_StickCalData[0].axis[0].sMax = ((pStickCal[1] << 8) & 0xF00) | pStickCal[0]; /* X Axis max above center */ - ctx->m_StickCalData[0].axis[1].sMax = (pStickCal[2] << 4) | (pStickCal[1] >> 4); /* Y Axis max above center */ - ctx->m_StickCalData[0].axis[0].sCenter = ((pStickCal[4] << 8) & 0xF00) | pStickCal[3]; /* X Axis center */ - ctx->m_StickCalData[0].axis[1].sCenter = (pStickCal[5] << 4) | (pStickCal[4] >> 4); /* Y Axis center */ - ctx->m_StickCalData[0].axis[0].sMin = ((pStickCal[7] << 8) & 0xF00) | pStickCal[6]; /* X Axis min below center */ - ctx->m_StickCalData[0].axis[1].sMin = (pStickCal[8] << 4) | (pStickCal[7] >> 4); /* Y Axis min below center */ + ctx->m_StickCalData[0].axis[0].sMax = ((pLeftStickCal[1] << 8) & 0xF00) | pLeftStickCal[0]; /* X Axis max above center */ + ctx->m_StickCalData[0].axis[1].sMax = (pLeftStickCal[2] << 4) | (pLeftStickCal[1] >> 4); /* Y Axis max above center */ + ctx->m_StickCalData[0].axis[0].sCenter = ((pLeftStickCal[4] << 8) & 0xF00) | pLeftStickCal[3]; /* X Axis center */ + ctx->m_StickCalData[0].axis[1].sCenter = (pLeftStickCal[5] << 4) | (pLeftStickCal[4] >> 4); /* Y Axis center */ + ctx->m_StickCalData[0].axis[0].sMin = ((pLeftStickCal[7] << 8) & 0xF00) | pLeftStickCal[6]; /* X Axis min below center */ + ctx->m_StickCalData[0].axis[1].sMin = (pLeftStickCal[8] << 4) | (pLeftStickCal[7] >> 4); /* Y Axis min below center */ /* Right stick */ - ctx->m_StickCalData[1].axis[0].sCenter = ((pStickCal[10] << 8) & 0xF00) | pStickCal[9]; /* X Axis center */ - ctx->m_StickCalData[1].axis[1].sCenter = (pStickCal[11] << 4) | (pStickCal[10] >> 4); /* Y Axis center */ - ctx->m_StickCalData[1].axis[0].sMin = ((pStickCal[13] << 8) & 0xF00) | pStickCal[12]; /* X Axis min below center */ - ctx->m_StickCalData[1].axis[1].sMin = (pStickCal[14] << 4) | (pStickCal[13] >> 4); /* Y Axis min below center */ - ctx->m_StickCalData[1].axis[0].sMax = ((pStickCal[16] << 8) & 0xF00) | pStickCal[15]; /* X Axis max above center */ - ctx->m_StickCalData[1].axis[1].sMax = (pStickCal[17] << 4) | (pStickCal[16] >> 4); /* Y Axis max above center */ + ctx->m_StickCalData[1].axis[0].sCenter = ((pRightStickCal[1] << 8) & 0xF00) | pRightStickCal[0]; /* X Axis center */ + ctx->m_StickCalData[1].axis[1].sCenter = (pRightStickCal[2] << 4) | (pRightStickCal[1] >> 4); /* Y Axis center */ + ctx->m_StickCalData[1].axis[0].sMin = ((pRightStickCal[4] << 8) & 0xF00) | pRightStickCal[3]; /* X Axis min below center */ + ctx->m_StickCalData[1].axis[1].sMin = (pRightStickCal[5] << 4) | (pRightStickCal[4] >> 4); /* Y Axis min below center */ + ctx->m_StickCalData[1].axis[0].sMax = ((pRightStickCal[7] << 8) & 0xF00) | pRightStickCal[6]; /* X Axis max above center */ + ctx->m_StickCalData[1].axis[1].sMax = (pRightStickCal[8] << 4) | (pRightStickCal[7] >> 4); /* Y Axis max above center */ /* Filter out any values that were uninitialized (0xFFF) in the SPI read */ for (stick = 0; stick < 2; ++stick) { @@ -776,14 +895,14 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx, Uint8 input_ } for (stick = 0; stick < 2; ++stick) { - for(axis = 0; axis < 2; ++axis) { + for (axis = 0; axis < 2; ++axis) { ctx->m_StickExtents[stick].axis[axis].sMin = -(Sint16)(ctx->m_StickCalData[stick].axis[axis].sMin * 0.7f); ctx->m_StickExtents[stick].axis[axis].sMax = (Sint16)(ctx->m_StickCalData[stick].axis[axis].sMax * 0.7f); } } for (stick = 0; stick < 2; ++stick) { - for(axis = 0; axis < 2; ++axis) { + for (axis = 0; axis < 2; ++axis) { ctx->m_SimpleStickExtents[stick].axis[axis].sMin = (Sint16)(SDL_MIN_SINT16 * 0.5f); ctx->m_SimpleStickExtents[stick].axis[axis].sMax = (Sint16)(SDL_MAX_SINT16 * 0.5f); } @@ -792,84 +911,96 @@ static SDL_bool LoadStickCalibration(SDL_DriverSwitch_Context *ctx, Uint8 input_ return SDL_TRUE; } -static SDL_bool LoadIMUCalibration(SDL_DriverSwitch_Context* ctx) +static SDL_bool LoadIMUCalibration(SDL_DriverSwitch_Context *ctx) { - Uint8* pIMUScale; - SwitchSubcommandInputPacket_t* reply = NULL; - Sint16 sAccelRawX, sAccelRawY, sAccelRawZ, sGyroRawX, sGyroRawY, sGyroRawZ; + SwitchSubcommandInputPacket_t *reply = NULL; /* Read Calibration Info */ SwitchSPIOpData_t readParams; readParams.unAddress = k_unSPIIMUScaleStartOffset; readParams.ucLength = k_unSPIIMUScaleLength; - if (!WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t*)&readParams, sizeof(readParams), &reply)) { - const float accelScale = SDL_STANDARD_GRAVITY / SWITCH_ACCEL_SCALE; - const float gyroScale = (float)M_PI / 180.0f / SWITCH_GYRO_SCALE; + if (WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readParams, sizeof(readParams), &reply)) { + Uint8 *pIMUScale; + Sint16 sAccelRawX, sAccelRawY, sAccelRawZ, sGyroRawX, sGyroRawY, sGyroRawZ; + Sint16 sAccelSensCoeffX, sAccelSensCoeffY, sAccelSensCoeffZ; + Sint16 sGyroSensCoeffX, sGyroSensCoeffY, sGyroSensCoeffZ; - ctx->m_IMUScaleData.fAccelScaleX = accelScale; - ctx->m_IMUScaleData.fAccelScaleY = accelScale; - ctx->m_IMUScaleData.fAccelScaleZ = accelScale; + /* IMU scale gives us multipliers for converting raw values to real world values */ + pIMUScale = reply->spiReadData.rgucReadData; - ctx->m_IMUScaleData.fGyroScaleX = gyroScale; - ctx->m_IMUScaleData.fGyroScaleY = gyroScale; - ctx->m_IMUScaleData.fGyroScaleZ = gyroScale; + sAccelRawX = (pIMUScale[1] << 8) | pIMUScale[0]; + sAccelRawY = (pIMUScale[3] << 8) | pIMUScale[2]; + sAccelRawZ = (pIMUScale[5] << 8) | pIMUScale[4]; - return SDL_FALSE; - } + sAccelSensCoeffX = (pIMUScale[7] << 8) | pIMUScale[6]; + sAccelSensCoeffY = (pIMUScale[9] << 8) | pIMUScale[8]; + sAccelSensCoeffZ = (pIMUScale[11] << 8) | pIMUScale[10]; - /* IMU scale gives us multipliers for converting raw values to real world values */ - pIMUScale = reply->spiReadData.rgucReadData; + sGyroRawX = (pIMUScale[13] << 8) | pIMUScale[12]; + sGyroRawY = (pIMUScale[15] << 8) | pIMUScale[14]; + sGyroRawZ = (pIMUScale[17] << 8) | pIMUScale[16]; - sAccelRawX = (pIMUScale[1] << 8) | pIMUScale[0]; - sAccelRawY = (pIMUScale[3] << 8) | pIMUScale[2]; - sAccelRawZ = (pIMUScale[5] << 8) | pIMUScale[4]; + sGyroSensCoeffX = (pIMUScale[19] << 8) | pIMUScale[18]; + sGyroSensCoeffY = (pIMUScale[21] << 8) | pIMUScale[20]; + sGyroSensCoeffZ = (pIMUScale[23] << 8) | pIMUScale[22]; - sGyroRawX = (pIMUScale[13] << 8) | pIMUScale[12]; - sGyroRawY = (pIMUScale[15] << 8) | pIMUScale[14]; - sGyroRawZ = (pIMUScale[17] << 8) | pIMUScale[16]; + /* Check for user calibration data. If it's present and set, it'll override the factory settings */ + readParams.unAddress = k_unSPIIMUUserScaleStartOffset; + readParams.ucLength = k_unSPIIMUUserScaleLength; + if (WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t *)&readParams, sizeof(readParams), &reply) && (pIMUScale[0] | pIMUScale[1] << 8) == 0xA1B2) { + pIMUScale = reply->spiReadData.rgucReadData; - /* Check for user calibration data. If it's present and set, it'll override the factory settings */ - readParams.unAddress = k_unSPIIMUUserScaleStartOffset; - readParams.ucLength = k_unSPIIMUUserScaleLength; - if (WriteSubcommand(ctx, k_eSwitchSubcommandIDs_SPIFlashRead, (uint8_t*)&readParams, sizeof(readParams), &reply) && (pIMUScale[0] | pIMUScale[1] << 8) == 0xA1B2) { - pIMUScale = reply->spiReadData.rgucReadData; - - sAccelRawX = (pIMUScale[3] << 8) | pIMUScale[2]; - sAccelRawY = (pIMUScale[5] << 8) | pIMUScale[4]; - sAccelRawZ = (pIMUScale[7] << 8) | pIMUScale[6]; + sAccelRawX = (pIMUScale[3] << 8) | pIMUScale[2]; + sAccelRawY = (pIMUScale[5] << 8) | pIMUScale[4]; + sAccelRawZ = (pIMUScale[7] << 8) | pIMUScale[6]; - sGyroRawX = (pIMUScale[15] << 8) | pIMUScale[14]; - sGyroRawY = (pIMUScale[17] << 8) | pIMUScale[16]; - sGyroRawZ = (pIMUScale[19] << 8) | pIMUScale[18]; - } + sGyroRawX = (pIMUScale[15] << 8) | pIMUScale[14]; + sGyroRawY = (pIMUScale[17] << 8) | pIMUScale[16]; + sGyroRawZ = (pIMUScale[19] << 8) | pIMUScale[18]; + } - /* Accelerometer scale */ - ctx->m_IMUScaleData.fAccelScaleX = SWITCH_ACCEL_SCALE_MULT / (float)(SWITCH_ACCEL_SCALE_OFFSET - (float)sAccelRawX) * SDL_STANDARD_GRAVITY; - ctx->m_IMUScaleData.fAccelScaleY = SWITCH_ACCEL_SCALE_MULT / (float)(SWITCH_ACCEL_SCALE_OFFSET - (float)sAccelRawY) * SDL_STANDARD_GRAVITY; - ctx->m_IMUScaleData.fAccelScaleZ = SWITCH_ACCEL_SCALE_MULT / (float)(SWITCH_ACCEL_SCALE_OFFSET - (float)sAccelRawZ) * SDL_STANDARD_GRAVITY; + /* Accelerometer scale */ + ctx->m_IMUScaleData.fAccelScaleX = SWITCH_ACCEL_SCALE_MULT / ((float)sAccelSensCoeffX - (float)sAccelRawX) * SDL_STANDARD_GRAVITY; + ctx->m_IMUScaleData.fAccelScaleY = SWITCH_ACCEL_SCALE_MULT / ((float)sAccelSensCoeffY - (float)sAccelRawY) * SDL_STANDARD_GRAVITY; + ctx->m_IMUScaleData.fAccelScaleZ = SWITCH_ACCEL_SCALE_MULT / ((float)sAccelSensCoeffZ - (float)sAccelRawZ) * SDL_STANDARD_GRAVITY; - /* Gyro scale */ - ctx->m_IMUScaleData.fGyroScaleX = SWITCH_GYRO_SCALE_MULT / (float)(SWITCH_GYRO_SCALE_OFFSET - (float)sGyroRawX) * (float)M_PI / 180.0f; - ctx->m_IMUScaleData.fGyroScaleY = SWITCH_GYRO_SCALE_MULT / (float)(SWITCH_GYRO_SCALE_OFFSET - (float)sGyroRawY) * (float)M_PI / 180.0f; - ctx->m_IMUScaleData.fGyroScaleZ = SWITCH_GYRO_SCALE_MULT / (float)(SWITCH_GYRO_SCALE_OFFSET - (float)sGyroRawZ) * (float)M_PI / 180.0f; + /* Gyro scale */ + ctx->m_IMUScaleData.fGyroScaleX = SWITCH_GYRO_SCALE_MULT / ((float)sGyroSensCoeffX - (float)sGyroRawX) * (float)M_PI / 180.0f; + ctx->m_IMUScaleData.fGyroScaleY = SWITCH_GYRO_SCALE_MULT / ((float)sGyroSensCoeffY - (float)sGyroRawY) * (float)M_PI / 180.0f; + ctx->m_IMUScaleData.fGyroScaleZ = SWITCH_GYRO_SCALE_MULT / ((float)sGyroSensCoeffZ - (float)sGyroRawZ) * (float)M_PI / 180.0f; + } else { + /* Use default values */ + const float accelScale = SDL_STANDARD_GRAVITY / SWITCH_ACCEL_SCALE; + const float gyroScale = (float)M_PI / 180.0f / SWITCH_GYRO_SCALE; + + ctx->m_IMUScaleData.fAccelScaleX = accelScale; + ctx->m_IMUScaleData.fAccelScaleY = accelScale; + ctx->m_IMUScaleData.fAccelScaleZ = accelScale; + + ctx->m_IMUScaleData.fGyroScaleX = gyroScale; + ctx->m_IMUScaleData.fGyroScaleY = gyroScale; + ctx->m_IMUScaleData.fGyroScaleZ = gyroScale; + } return SDL_TRUE; } - static Sint16 ApplyStickCalibration(SDL_DriverSwitch_Context *ctx, int nStick, int nAxis, Sint16 sRawValue) { sRawValue -= ctx->m_StickCalData[nStick].axis[nAxis].sCenter; - if (sRawValue > ctx->m_StickExtents[nStick].axis[nAxis].sMax) { - ctx->m_StickExtents[nStick].axis[nAxis].sMax = sRawValue; - } - if (sRawValue < ctx->m_StickExtents[nStick].axis[nAxis].sMin) { - ctx->m_StickExtents[nStick].axis[nAxis].sMin = sRawValue; + if (sRawValue >= 0) { + if (sRawValue > ctx->m_StickExtents[nStick].axis[nAxis].sMax) { + ctx->m_StickExtents[nStick].axis[nAxis].sMax = sRawValue; + } + return (Sint16)HIDAPI_RemapVal(sRawValue, 0, ctx->m_StickExtents[nStick].axis[nAxis].sMax, 0, SDL_MAX_SINT16); + } else { + if (sRawValue < ctx->m_StickExtents[nStick].axis[nAxis].sMin) { + ctx->m_StickExtents[nStick].axis[nAxis].sMin = sRawValue; + } + return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_StickExtents[nStick].axis[nAxis].sMin, 0, SDL_MIN_SINT16, 0); } - - return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_StickExtents[nStick].axis[nAxis].sMin, ctx->m_StickExtents[nStick].axis[nAxis].sMax, SDL_MIN_SINT16, SDL_MAX_SINT16); } static Sint16 ApplySimpleStickCalibration(SDL_DriverSwitch_Context *ctx, int nStick, int nAxis, Sint16 sRawValue) @@ -879,14 +1010,17 @@ static Sint16 ApplySimpleStickCalibration(SDL_DriverSwitch_Context *ctx, int nSt sRawValue -= usJoystickCenter; - if (sRawValue > ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax) { - ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax = sRawValue; - } - if (sRawValue < ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin) { - ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin = sRawValue; + if (sRawValue >= 0) { + if (sRawValue > ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax) { + ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax = sRawValue; + } + return (Sint16)HIDAPI_RemapVal(sRawValue, 0, ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax, 0, SDL_MAX_SINT16); + } else { + if (sRawValue < ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin) { + ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin = sRawValue; + } + return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin, 0, SDL_MIN_SINT16, 0); } - - return (Sint16)HIDAPI_RemapVal(sRawValue, ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMin, ctx->m_SimpleStickExtents[nStick].axis[nAxis].sMax, SDL_MIN_SINT16, SDL_MAX_SINT16); } static void SDLCALL SDL_GameControllerButtonReportingHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) @@ -925,9 +1059,8 @@ static Uint8 RemapButton(SDL_DriverSwitch_Context *ctx, Uint8 button) } return button; } - -static int -GetMaxWriteAttempts(SDL_HIDAPI_Device *device) + +static int GetMaxWriteAttempts(SDL_HIDAPI_Device *device) { if (device->vendor_id == USB_VENDOR_NINTENDO && device->product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP) { @@ -938,8 +1071,7 @@ GetMaxWriteAttempts(SDL_HIDAPI_Device *device) } } -static ESwitchDeviceInfoControllerType -ReadJoyConControllerType(SDL_HIDAPI_Device *device) +static ESwitchDeviceInfoControllerType ReadJoyConControllerType(SDL_HIDAPI_Device *device) { ESwitchDeviceInfoControllerType eControllerType = k_eSwitchDeviceInfoControllerType_Unknown; const int MAX_ATTEMPTS = 1; /* Don't try too long, in case this is a zombie Bluetooth controller */ @@ -952,7 +1084,9 @@ ReadJoyConControllerType(SDL_HIDAPI_Device *device) ctx->m_bSyncWrite = SDL_TRUE; ctx->m_nMaxWriteAttempts = GetMaxWriteAttempts(device); - for (attempts = 0; attempts < MAX_ATTEMPTS; ++attempts) { + for ( ; ; ) { + ++attempts; + device->is_bluetooth = SDL_FALSE; if (WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_Status, NULL, 0, SDL_TRUE)) { SwitchProprietaryStatusPacket_t *status = (SwitchProprietaryStatusPacket_t *)&ctx->m_rgucReadBuffer[0]; @@ -965,21 +1099,19 @@ ReadJoyConControllerType(SDL_HIDAPI_Device *device) eControllerType = CalculateControllerType(ctx, (ESwitchDeviceInfoControllerType)reply->deviceInfo.ucDeviceType); } } - if (eControllerType == k_eSwitchDeviceInfoControllerType_Unknown) { + if (eControllerType == k_eSwitchDeviceInfoControllerType_Unknown && attempts < MAX_ATTEMPTS) { /* Wait a bit and try again */ SDL_Delay(100); continue; - } else { - break; } + break; } SDL_free(ctx); } return eControllerType; } -static SDL_bool -HasHomeLED(SDL_DriverSwitch_Context *ctx) +static SDL_bool HasHomeLED(SDL_DriverSwitch_Context *ctx) { Uint16 vendor_id = ctx->device->vendor_id; Uint16 product_id = ctx->device->product_id; @@ -994,6 +1126,12 @@ HasHomeLED(SDL_DriverSwitch_Context *ctx) return SDL_FALSE; } + /* Third party controllers don't have a home LED and will shut off if we try to set it */ + if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_Unknown || + ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_LicProController) { + return SDL_FALSE; + } + /* The Nintendo Online classic controllers don't have a Home LED */ if (vendor_id == USB_VENDOR_NINTENDO && ctx->m_eControllerType > k_eSwitchDeviceInfoControllerType_ProController) { @@ -1003,11 +1141,12 @@ HasHomeLED(SDL_DriverSwitch_Context *ctx) return SDL_TRUE; } -static SDL_bool -AlwaysUsesLabels(int vendor_id, int product_id, ESwitchDeviceInfoControllerType eControllerType) +static SDL_bool AlwaysUsesLabels(int vendor_id, int product_id, ESwitchDeviceInfoControllerType eControllerType) { /* These controllers don't have a diamond button configuration, so always use labels */ switch (eControllerType) { + case k_eSwitchDeviceInfoControllerType_HVCLeft: + case k_eSwitchDeviceInfoControllerType_HVCRight: case k_eSwitchDeviceInfoControllerType_NESLeft: case k_eSwitchDeviceInfoControllerType_NESRight: case k_eSwitchDeviceInfoControllerType_N64: @@ -1018,12 +1157,11 @@ AlwaysUsesLabels(int vendor_id, int product_id, ESwitchDeviceInfoControllerType } } -static SDL_bool -IsGameCubeFormFactor(int vendor_id, int product_id) +static SDL_bool IsGameCubeFormFactor(int vendor_id, int product_id) { static Uint32 gamecube_formfactor[] = { - MAKE_VIDPID(0x0e6f, 0x0185), /* PDP Wired Fight Pad Pro for Nintendo Switch */ - MAKE_VIDPID(0x20d6, 0xa711), /* Core (Plus) Wired Controller */ + MAKE_VIDPID(0x0e6f, 0x0185), /* PDP Wired Fight Pad Pro for Nintendo Switch */ + MAKE_VIDPID(0x20d6, 0xa711), /* Core (Plus) Wired Controller */ }; Uint32 id = MAKE_VIDPID(vendor_id, product_id); int i; @@ -1036,32 +1174,27 @@ IsGameCubeFormFactor(int vendor_id, int product_id) return SDL_FALSE; } -static void -HIDAPI_DriverNintendoClassic_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverNintendoClassic_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC, callback, userdata); } -static void -HIDAPI_DriverNintendoClassic_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverNintendoClassic_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC, callback, userdata); } -static SDL_bool -HIDAPI_DriverNintendoClassic_IsEnabled(void) +static SDL_bool HIDAPI_DriverNintendoClassic_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverNintendoClassic_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverNintendoClassic_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { if (vendor_id == USB_VENDOR_NINTENDO) { if (product_id == USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT) { - if (SDL_strncmp(name, "NES Controller", 14) == 0) { + if (SDL_strncmp(name, "NES Controller", 14) == 0 || + SDL_strncmp(name, "HVC Controller", 14) == 0) { return SDL_TRUE; } } @@ -1082,28 +1215,22 @@ HIDAPI_DriverNintendoClassic_IsSupportedDevice(SDL_HIDAPI_Device *device, const return SDL_FALSE; } -static void -HIDAPI_DriverJoyCons_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverJoyCons_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, callback, userdata); } -static void -HIDAPI_DriverJoyCons_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverJoyCons_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, callback, userdata); } -static SDL_bool -HIDAPI_DriverJoyCons_IsEnabled(void) +static SDL_bool HIDAPI_DriverJoyCons_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverJoyCons_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverJoyCons_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { if (vendor_id == USB_VENDOR_NINTENDO) { if (product_id == USB_PRODUCT_NINTENDO_SWITCH_PRO && device && device->dev) { @@ -1124,28 +1251,22 @@ HIDAPI_DriverJoyCons_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *na return SDL_FALSE; } -static void -HIDAPI_DriverSwitch_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverSwitch_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, callback, userdata); } -static void -HIDAPI_DriverSwitch_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverSwitch_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, callback, userdata); } -static SDL_bool -HIDAPI_DriverSwitch_IsEnabled(void) +static SDL_bool HIDAPI_DriverSwitch_IsEnabled(void) { - return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_SWITCH, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)); } -static SDL_bool -HIDAPI_DriverSwitch_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverSwitch_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { /* The HORI Wireless Switch Pad enumerates as a HID device when connected via USB with the same VID/PID as when connected over Bluetooth but doesn't actually @@ -1166,8 +1287,7 @@ HIDAPI_DriverSwitch_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *nam return (type == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO) ? SDL_TRUE : SDL_FALSE; } -static void -UpdateDeviceIdentity(SDL_HIDAPI_Device *device) +static void UpdateDeviceIdentity(SDL_HIDAPI_Device *device) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; char serial[18]; @@ -1175,19 +1295,28 @@ UpdateDeviceIdentity(SDL_HIDAPI_Device *device) switch (ctx->m_eControllerType) { case k_eSwitchDeviceInfoControllerType_JoyConLeft: HIDAPI_SetDeviceName(device, "Nintendo Switch Joy-Con (L)"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT); device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT; break; case k_eSwitchDeviceInfoControllerType_JoyConRight: HIDAPI_SetDeviceName(device, "Nintendo Switch Joy-Con (R)"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT); device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT; break; case k_eSwitchDeviceInfoControllerType_ProController: + case k_eSwitchDeviceInfoControllerType_LicProController: HIDAPI_SetDeviceName(device, "Nintendo Switch Pro Controller"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_SWITCH_PRO); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_PRO); device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO; break; + case k_eSwitchDeviceInfoControllerType_HVCLeft: + HIDAPI_SetDeviceName(device, "Nintendo HVC Controller (1)"); + device->type = SDL_CONTROLLER_TYPE_UNKNOWN; + break; + case k_eSwitchDeviceInfoControllerType_HVCRight: + HIDAPI_SetDeviceName(device, "Nintendo HVC Controller (2)"); + device->type = SDL_CONTROLLER_TYPE_UNKNOWN; + break; case k_eSwitchDeviceInfoControllerType_NESLeft: HIDAPI_SetDeviceName(device, "Nintendo NES Controller (L)"); device->type = SDL_CONTROLLER_TYPE_UNKNOWN; @@ -1198,36 +1327,60 @@ UpdateDeviceIdentity(SDL_HIDAPI_Device *device) break; case k_eSwitchDeviceInfoControllerType_SNES: HIDAPI_SetDeviceName(device, "Nintendo SNES Controller"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_SNES_CONTROLLER); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SNES_CONTROLLER); device->type = SDL_CONTROLLER_TYPE_UNKNOWN; break; case k_eSwitchDeviceInfoControllerType_N64: HIDAPI_SetDeviceName(device, "Nintendo N64 Controller"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_N64_CONTROLLER); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_N64_CONTROLLER); device->type = SDL_CONTROLLER_TYPE_UNKNOWN; break; case k_eSwitchDeviceInfoControllerType_SEGA_Genesis: HIDAPI_SetDeviceName(device, "Nintendo SEGA Genesis Controller"); - HIDAPI_SetDeviceProduct(device, USB_PRODUCT_NINTENDO_SEGA_GENESIS_CONTROLLER); + HIDAPI_SetDeviceProduct(device, USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SEGA_GENESIS_CONTROLLER); device->type = SDL_CONTROLLER_TYPE_UNKNOWN; break; + case k_eSwitchDeviceInfoControllerType_Unknown: + /* We couldn't read the device info for this controller, might not be fully compliant */ + if (device->vendor_id == USB_VENDOR_NINTENDO) { + switch (device->product_id) { + case USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT: + ctx->m_eControllerType = k_eSwitchDeviceInfoControllerType_JoyConLeft; + HIDAPI_SetDeviceName(device, "Nintendo Switch Joy-Con (L)"); + device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT; + break; + case USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT: + ctx->m_eControllerType = k_eSwitchDeviceInfoControllerType_JoyConRight; + HIDAPI_SetDeviceName(device, "Nintendo Switch Joy-Con (R)"); + device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT; + break; + case USB_PRODUCT_NINTENDO_SWITCH_PRO: + ctx->m_eControllerType = k_eSwitchDeviceInfoControllerType_ProController; + HIDAPI_SetDeviceName(device, "Nintendo Switch Pro Controller"); + device->type = SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO; + break; + default: + break; + } + } + return; default: + device->type = SDL_CONTROLLER_TYPE_UNKNOWN; break; } device->guid.data[15] = ctx->m_eControllerType; - SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", - ctx->m_rgucMACAddress[0], - ctx->m_rgucMACAddress[1], - ctx->m_rgucMACAddress[2], - ctx->m_rgucMACAddress[3], - ctx->m_rgucMACAddress[4], - ctx->m_rgucMACAddress[5]); + (void)SDL_snprintf(serial, sizeof(serial), "%.2x-%.2x-%.2x-%.2x-%.2x-%.2x", + ctx->m_rgucMACAddress[0], + ctx->m_rgucMACAddress[1], + ctx->m_rgucMACAddress[2], + ctx->m_rgucMACAddress[3], + ctx->m_rgucMACAddress[4], + ctx->m_rgucMACAddress[5]); HIDAPI_SetDeviceSerial(device, serial); } -static SDL_bool -HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverSwitch_Context *ctx; @@ -1250,12 +1403,11 @@ HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device) /* Find out whether or not we can send output reports */ ctx->m_bInputOnly = SDL_IsJoystickNintendoSwitchProInputOnly(device->vendor_id, device->product_id); if (!ctx->m_bInputOnly) { - if (!BReadDeviceInfo(ctx)) { - SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, - "HIDAPI_DriverSwitch_InitDevice(): Couldn't read device info"); - return SDL_FALSE; - } + /* Initialize rumble data, important for reading device info on the MOBAPAD M073 */ + SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[0]); + SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[1]); + BReadDeviceInfo(ctx); UpdateDeviceIdentity(device); } @@ -1270,14 +1422,12 @@ HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverSwitch_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverSwitch_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverSwitch_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverSwitch_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; @@ -1290,17 +1440,24 @@ HIDAPI_DriverSwitch_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joystick UpdateSlotLED(ctx); } -static SDL_bool -HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; - Uint8 input_mode; + + SDL_AssertJoysticksLocked(); ctx->joystick = joystick; ctx->m_bSyncWrite = SDL_TRUE; if (!ctx->m_bInputOnly) { +#ifdef SDL_PLATFORM_MACOS + // Wait for the OS to finish its handshake with the controller + SDL_Delay(250); +#endif + GetInitialInputMode(ctx); + ctx->m_nCurrentInputMode = ctx->m_nInitialInputMode; + /* Initialize rumble data */ SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[0]); SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[1]); @@ -1312,63 +1469,45 @@ HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti } } - /* Determine the desired input mode (needed before loading stick calibration) */ - if (device->is_bluetooth) { - input_mode = k_eSwitchInputReportIDs_SimpleControllerState; - } else { - input_mode = k_eSwitchInputReportIDs_FullControllerState; + if (!LoadStickCalibration(ctx)) { + SDL_SetError("Couldn't load stick calibration"); + return SDL_FALSE; } - /* The official Nintendo Switch Pro Controller supports FullControllerState over bluetooth - * just fine. We really should use that, or else the epowerlevel code in - * HandleFullControllerState is completely pointless. We need full state if we want battery - * level and we only care about battery level over bluetooth anyway. - */ - if (device->vendor_id == USB_VENDOR_NINTENDO) { - input_mode = k_eSwitchInputReportIDs_FullControllerState; - } - - if (input_mode == k_eSwitchInputReportIDs_FullControllerState && + if (ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_HVCLeft && + ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_HVCRight && ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_NESLeft && ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_NESRight && ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_SNES && ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_N64 && ctx->m_eControllerType != k_eSwitchDeviceInfoControllerType_SEGA_Genesis) { - /* Use the right sensor in the combined Joy-Con pair */ - if (!device->parent || - ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight) { - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 200.0f); - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 200.0f); - } - if (device->parent && - ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft) { - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO_L, 200.0f); - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL_L, 200.0f); - } - if (device->parent && - ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight) { - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO_R, 200.0f); - SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL_R, 200.0f); + if (LoadIMUCalibration(ctx)) { + /* Use the right sensor in the combined Joy-Con pair */ + if (!device->parent || + ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight) { + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 200.0f); + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 200.0f); + } + if (device->parent && + ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft) { + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO_L, 200.0f); + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL_L, 200.0f); + } + if (device->parent && + ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight) { + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO_R, 200.0f); + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL_R, 200.0f); + } } } - if (!LoadStickCalibration(ctx, input_mode)) { - SDL_SetError("Couldn't load stick calibration"); - return SDL_FALSE; - } - - if (!LoadIMUCalibration(ctx)) { - SDL_SetError("Couldn't load sensor calibration"); - return SDL_FALSE; - } - if (!SetVibrationEnabled(ctx, 1)) { SDL_SetError("Couldn't enable vibration"); return SDL_FALSE; } /* Set desired input mode */ - if (!SetInputMode(ctx, input_mode)) { + if (!SetInputMode(ctx, GetDefaultInputMode(ctx))) { SDL_SetError("Couldn't set input mode"); return SDL_FALSE; } @@ -1426,8 +1565,7 @@ HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti return SDL_TRUE; } -static int -HIDAPI_DriverSwitch_ActuallyRumbleJoystick(SDL_DriverSwitch_Context *ctx, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverSwitch_ActuallyRumbleJoystick(SDL_DriverSwitch_Context *ctx, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { /* Experimentally determined rumble values. These will only matter on some controllers as tested ones * seem to disregard these and just use any non-zero rumble values as a binary flag for constant rumble @@ -1436,8 +1574,8 @@ HIDAPI_DriverSwitch_ActuallyRumbleJoystick(SDL_DriverSwitch_Context *ctx, Uint16 * https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md */ const Uint16 k_usHighFreq = 0x0074; - const Uint8 k_ucHighFreqAmp = EncodeRumbleHighAmplitude(high_frequency_rumble); - const Uint8 k_ucLowFreq = 0x3D; + const Uint8 k_ucHighFreqAmp = EncodeRumbleHighAmplitude(high_frequency_rumble); + const Uint8 k_ucLowFreq = 0x3D; const Uint16 k_usLowFreqAmp = EncodeRumbleLowAmplitude(low_frequency_rumble); if (low_frequency_rumble || high_frequency_rumble) { @@ -1456,8 +1594,7 @@ HIDAPI_DriverSwitch_ActuallyRumbleJoystick(SDL_DriverSwitch_Context *ctx, Uint16 return 0; } -static int -HIDAPI_DriverSwitch_SendPendingRumble(SDL_DriverSwitch_Context *ctx) +static int HIDAPI_DriverSwitch_SendPendingRumble(SDL_DriverSwitch_Context *ctx) { if (!SDL_TICKS_PASSED(SDL_GetTicks(), ctx->m_unRumbleSent + RUMBLE_WRITE_FREQUENCY_MS)) { return 0; @@ -1488,8 +1625,7 @@ HIDAPI_DriverSwitch_SendPendingRumble(SDL_DriverSwitch_Context *ctx) return 0; } -static int -HIDAPI_DriverSwitch_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverSwitch_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; @@ -1537,14 +1673,12 @@ HIDAPI_DriverSwitch_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys return HIDAPI_DriverSwitch_ActuallyRumbleJoystick(ctx, low_frequency_rumble, high_frequency_rumble); } -static int -HIDAPI_DriverSwitch_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverSwitch_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverSwitch_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverSwitch_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; Uint32 result = 0; @@ -1552,28 +1686,35 @@ HIDAPI_DriverSwitch_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joyst if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_ProController && !ctx->m_bInputOnly) { /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */ result |= SDL_JOYCAP_RUMBLE; + } else if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft || + ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConRight) { + result |= SDL_JOYCAP_RUMBLE; } - return result; } -static int -HIDAPI_DriverSwitch_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverSwitch_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverSwitch_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverSwitch_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverSwitch_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverSwitch_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { - SDL_DriverSwitch_Context* ctx = (SDL_DriverSwitch_Context*)device->context; - + SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; + Uint8 input_mode; + + if (enabled) { + input_mode = GetSensorInputMode(ctx); + } else { + input_mode = GetDefaultInputMode(ctx); + } + SetInputMode(ctx, input_mode); + SetIMUEnabled(ctx, enabled); ctx->m_bReportSensors = enabled; ctx->m_unIMUSamples = 0; @@ -1768,7 +1909,7 @@ static void HandleSimpleControllerState(SDL_Joystick *joystick, SDL_DriverSwitch ctx->m_lastSimpleState = *packet; } -static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 timestamp_us, Sint16 *values) +static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 timestamp_us, const Sint16 *values) { float data[3]; @@ -1776,7 +1917,7 @@ static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *c * since that's our de facto standard from already supporting those controllers, and * users will want consistent axis mappings across devices. */ - if (type == SDL_SENSOR_GYRO || type == SDL_SENSOR_GYRO_L || type == SDL_SENSOR_GYRO_R ) { + if (type == SDL_SENSOR_GYRO || type == SDL_SENSOR_GYRO_L || type == SDL_SENSOR_GYRO_R) { data[0] = -(ctx->m_IMUScaleData.fGyroScaleY * (float)values[1]); data[1] = ctx->m_IMUScaleData.fGyroScaleZ * (float)values[2]; data[2] = -(ctx->m_IMUScaleData.fGyroScaleX * (float)values[0]); @@ -1941,7 +2082,7 @@ static void HandleMiniControllerStateR(SDL_Joystick *joystick, SDL_DriverSwitch_ SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); } -static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SwitchStatePacket_t *packet) +static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SwitchStatePacket_t *packet) SDL_NO_THREAD_SAFETY_ANALYSIS /* We unlock and lock the device lock to be able to change IMU state */ { if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_JoyConLeft) { if (ctx->device->parent || ctx->m_bVerticalMode) { @@ -2122,8 +2263,7 @@ static void HandleFullControllerState(SDL_Joystick *joystick, SDL_DriverSwitch_C ctx->m_lastFullState = *packet; } -static SDL_bool -HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -2146,14 +2286,21 @@ HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) continue; } + if (ctx->m_rgucReadBuffer[0] == k_eSwitchInputReportIDs_SubcommandReply) { + continue; + } + if (ctx->m_bInputOnly) { HandleInputOnlyControllerState(joystick, ctx, (SwitchInputOnlyControllerStatePacket_t *)&ctx->m_rgucReadBuffer[0]); } else { + ctx->m_nCurrentInputMode = ctx->m_rgucReadBuffer[0]; + switch (ctx->m_rgucReadBuffer[0]) { case k_eSwitchInputReportIDs_SimpleControllerState: HandleSimpleControllerState(joystick, ctx, (SwitchSimpleStatePacket_t *)&ctx->m_rgucReadBuffer[1]); break; case k_eSwitchInputReportIDs_FullControllerState: + case k_eSwitchInputReportIDs_FullControllerAndMcuState: HandleFullControllerState(joystick, ctx, (SwitchStatePacket_t *)&ctx->m_rgucReadBuffer[1]); break; default: @@ -2169,7 +2316,11 @@ HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) const Uint32 INPUT_WAIT_TIMEOUT_MS = 100; if (SDL_TICKS_PASSED(now, ctx->m_unLastInput + INPUT_WAIT_TIMEOUT_MS)) { /* Steam may have put the controller back into non-reporting mode */ + SDL_bool wasSyncWrite = ctx->m_bSyncWrite; + + ctx->m_bSyncWrite = SDL_TRUE; WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_ForceUSB, NULL, 0, SDL_FALSE); + ctx->m_bSyncWrite = wasSyncWrite; } } else if (device->is_bluetooth) { const Uint32 INPUT_WAIT_TIMEOUT_MS = 3000; @@ -2201,17 +2352,19 @@ HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverSwitch_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverSwitch_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverSwitch_Context *ctx = (SDL_DriverSwitch_Context *)device->context; if (!ctx->m_bInputOnly) { /* Restore simple input mode for other applications */ - SetInputMode(ctx, k_eSwitchInputReportIDs_SimpleControllerState); + if (!ctx->m_nInitialInputMode || + ctx->m_nInitialInputMode == k_eSwitchInputReportIDs_SimpleControllerState) { + SetInputMode(ctx, k_eSwitchInputReportIDs_SimpleControllerState); + } } SDL_DelHintCallback(SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS, @@ -2232,13 +2385,11 @@ HIDAPI_DriverSwitch_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joyst ctx->joystick = NULL; } -static void -HIDAPI_DriverSwitch_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverSwitch_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverNintendoClassic = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverNintendoClassic = { SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC, SDL_TRUE, HIDAPI_DriverNintendoClassic_RegisterHints, @@ -2260,8 +2411,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverNintendoClassic = HIDAPI_DriverSwitch_FreeDevice, }; -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverJoyCons = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverJoyCons = { SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, SDL_TRUE, HIDAPI_DriverJoyCons_RegisterHints, @@ -2283,8 +2433,7 @@ SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverJoyCons = HIDAPI_DriverSwitch_FreeDevice, }; -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch = { SDL_HINT_JOYSTICK_HIDAPI_SWITCH, SDL_TRUE, HIDAPI_DriverSwitch_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c index 3b4e7941141e6..f28f2ab032141 100644 --- a/src/joystick/hidapi/SDL_hidapi_wii.c +++ b/src/joystick/hidapi/SDL_hidapi_wii.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2021 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,6 @@ #include "SDL_hidapi_rumble.h" #include "SDL_hidapi_nintendo.h" - #ifdef SDL_JOYSTICK_HIDAPI_WII /* Define this if you want to log all packets from the controller */ @@ -41,27 +40,27 @@ #define ENABLE_CONTINUOUS_REPORTING SDL_TRUE -#define INPUT_WAIT_TIMEOUT_MS (3 * 1000) -#define MOTION_PLUS_UPDATE_TIME_MS (8 * 1000) -#define STATUS_UPDATE_TIME_MS (15 * 60 * 1000) - -#define WII_EXTENSION_NONE 0x2E2E -#define WII_EXTENSION_UNINITIALIZED 0xFFFF -#define WII_EXTENSION_NUNCHUK 0x0000 -#define WII_EXTENSION_GAMEPAD 0x0101 -#define WII_EXTENSION_WIIUPRO 0x0120 -#define WII_EXTENSION_MOTIONPLUS_MASK 0xF0FF -#define WII_EXTENSION_MOTIONPLUS_ID 0x0005 +#define INPUT_WAIT_TIMEOUT_MS (3 * 1000) +#define MOTION_PLUS_UPDATE_TIME_MS (8 * 1000) +#define STATUS_UPDATE_TIME_MS (15 * 60 * 1000) -#define WII_MOTIONPLUS_MODE_NONE 0x00 -#define WII_MOTIONPLUS_MODE_STANDARD 0x04 -#define WII_MOTIONPLUS_MODE_NUNCHUK 0x05 -#define WII_MOTIONPLUS_MODE_GAMEPAD 0x07 +#define WII_EXTENSION_NONE 0x2E2E +#define WII_EXTENSION_UNINITIALIZED 0xFFFF +#define WII_EXTENSION_NUNCHUK 0x0000 +#define WII_EXTENSION_GAMEPAD 0x0101 +#define WII_EXTENSION_WIIUPRO 0x0120 +#define WII_EXTENSION_MOTIONPLUS_MASK 0xF0FF +#define WII_EXTENSION_MOTIONPLUS_ID 0x0005 +#define WII_MOTIONPLUS_MODE_NONE 0x00 +#define WII_MOTIONPLUS_MODE_STANDARD 0x04 +#define WII_MOTIONPLUS_MODE_NUNCHUK 0x05 +#define WII_MOTIONPLUS_MODE_GAMEPAD 0x07 -typedef enum { - k_eWiiInputReportIDs_Status = 0x20, - k_eWiiInputReportIDs_ReadMemory = 0x21, +typedef enum +{ + k_eWiiInputReportIDs_Status = 0x20, + k_eWiiInputReportIDs_ReadMemory = 0x21, k_eWiiInputReportIDs_Acknowledge = 0x22, k_eWiiInputReportIDs_ButtonData0 = 0x30, k_eWiiInputReportIDs_ButtonData1 = 0x31, @@ -76,34 +75,38 @@ typedef enum { k_eWiiInputReportIDs_ButtonDataF = 0x3F, } EWiiInputReportIDs; -typedef enum { - k_eWiiOutputReportIDs_Rumble = 0x10, - k_eWiiOutputReportIDs_LEDs = 0x11, +typedef enum +{ + k_eWiiOutputReportIDs_Rumble = 0x10, + k_eWiiOutputReportIDs_LEDs = 0x11, k_eWiiOutputReportIDs_DataReportingMode = 0x12, - k_eWiiOutputReportIDs_IRCameraEnable = 0x13, - k_eWiiOutputReportIDs_SpeakerEnable = 0x14, - k_eWiiOutputReportIDs_StatusRequest = 0x15, - k_eWiiOutputReportIDs_WriteMemory = 0x16, - k_eWiiOutputReportIDs_ReadMemory = 0x17, - k_eWiiOutputReportIDs_SpeakerData = 0x18, - k_eWiiOutputReportIDs_SpeakerMute = 0x19, - k_eWiiOutputReportIDs_IRCameraEnable2 = 0x1a, + k_eWiiOutputReportIDs_IRCameraEnable = 0x13, + k_eWiiOutputReportIDs_SpeakerEnable = 0x14, + k_eWiiOutputReportIDs_StatusRequest = 0x15, + k_eWiiOutputReportIDs_WriteMemory = 0x16, + k_eWiiOutputReportIDs_ReadMemory = 0x17, + k_eWiiOutputReportIDs_SpeakerData = 0x18, + k_eWiiOutputReportIDs_SpeakerMute = 0x19, + k_eWiiOutputReportIDs_IRCameraEnable2 = 0x1a, } EWiiOutputReportIDs; -typedef enum { +typedef enum +{ k_eWiiPlayerLEDs_P1 = 0x10, k_eWiiPlayerLEDs_P2 = 0x20, k_eWiiPlayerLEDs_P3 = 0x40, k_eWiiPlayerLEDs_P4 = 0x80, } EWiiPlayerLEDs; -typedef enum { +typedef enum +{ k_eWiiCommunicationState_None, /* No special communications happening */ k_eWiiCommunicationState_CheckMotionPlusStage1, /* Sent standard extension identify request */ k_eWiiCommunicationState_CheckMotionPlusStage2, /* Sent Motion Plus extension identify request */ } EWiiCommunicationState; -typedef enum { +typedef enum +{ k_eWiiButtons_A = SDL_CONTROLLER_BUTTON_MISC1, k_eWiiButtons_B, k_eWiiButtons_One, @@ -120,7 +123,8 @@ typedef enum { #define k_unWiiPacketDataLength 22 -typedef struct { +typedef struct +{ Uint8 rgucBaseButtons[2]; Uint8 rgucAccelerometer[3]; Uint8 rgucExtension[21]; @@ -129,7 +133,8 @@ typedef struct { Uint8 ucNExtensionBytes; } WiiButtonData; -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; EWiiCommunicationState m_eCommState; @@ -139,7 +144,7 @@ typedef struct { int m_nPlayerIndex; SDL_bool m_bRumbleActive; SDL_bool m_bMotionPlusPresent; - Uint8 m_ucMotionPlusMode; + Uint8 m_ucMotionPlusMode; SDL_bool m_bReportSensors; Uint8 m_rgucReadBuffer[k_unWiiPacketDataLength]; Uint32 m_unLastInput; @@ -147,7 +152,8 @@ typedef struct { Uint32 m_unNextMotionPlusCheck; SDL_bool m_bDisconnected; - struct StickCalibrationData { + struct StickCalibrationData + { Uint16 min; Uint16 max; Uint16 center; @@ -155,32 +161,28 @@ typedef struct { } m_StickCalibrationData[6]; } SDL_DriverWii_Context; -static void -HIDAPI_DriverWii_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverWii_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_WII, callback, userdata); } -static void -HIDAPI_DriverWii_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverWii_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_WII, callback, userdata); } -static SDL_bool -HIDAPI_DriverWii_IsEnabled(void) +static SDL_bool HIDAPI_DriverWii_IsEnabled(void) { #if 1 /* This doesn't work with the dolphinbar, so don't enable by default right now */ return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_WII, SDL_FALSE); #else return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_WII, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)); + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, + SDL_HIDAPI_DEFAULT)); #endif } -static SDL_bool -HIDAPI_DriverWii_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverWii_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { if (vendor_id == USB_VENDOR_NINTENDO && (product_id == USB_PRODUCT_NINTENDO_WII_REMOTE || @@ -216,17 +218,17 @@ static SDL_bool WriteOutput(SDL_DriverWii_Context *ctx, const Uint8 *data, int s } #endif if (sync) { - return (SDL_hid_write(ctx->device->dev, data, size) >= 0); + return SDL_hid_write(ctx->device->dev, data, size) >= 0; } else { /* Use the rumble thread for general asynchronous writes */ - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return SDL_FALSE; } - return (SDL_HIDAPI_SendRumbleAndUnlock(ctx->device, data, size) >= 0); + return SDL_HIDAPI_SendRumbleAndUnlock(ctx->device, data, size) >= 0; } } -static SDL_bool ReadInputSync(SDL_DriverWii_Context *ctx, EWiiInputReportIDs expectedID, SDL_bool(*isMine)(const Uint8 *)) +static SDL_bool ReadInputSync(SDL_DriverWii_Context *ctx, EWiiInputReportIDs expectedID, SDL_bool (*isMine)(const Uint8 *)) { Uint32 TimeoutMs = 250; /* Seeing successful reads after about 200 ms */ Uint32 startTicks = SDL_GetTicks(); @@ -511,7 +513,7 @@ static void UpdatePowerLevelWii(SDL_Joystick *joystick, Uint8 batteryLevelByte) static void UpdatePowerLevelWiiU(SDL_Joystick *joystick, Uint8 extensionBatteryByte) { - SDL_bool charging = extensionBatteryByte & 0x08 ? SDL_FALSE : SDL_TRUE; + SDL_bool charging = extensionBatteryByte & 0x08 ? SDL_FALSE : SDL_TRUE; SDL_bool pluggedIn = extensionBatteryByte & 0x04 ? SDL_FALSE : SDL_TRUE; Uint8 batteryLevel = extensionBatteryByte >> 4; @@ -580,32 +582,32 @@ static void InitStickCalibrationData(SDL_DriverWii_Context *ctx) { int i; switch (ctx->m_eExtensionControllerType) { - case k_eWiiExtensionControllerType_WiiUPro: - for (i = 0; i < 4; i++) { - ctx->m_StickCalibrationData[i].min = 1000; - ctx->m_StickCalibrationData[i].max = 3000; - ctx->m_StickCalibrationData[i].center = 0; - ctx->m_StickCalibrationData[i].deadzone = 100; - } - break; - case k_eWiiExtensionControllerType_Gamepad: - for (i = 0; i < 4; i++) { - ctx->m_StickCalibrationData[i].min = i < 2 ? 9 : 5; - ctx->m_StickCalibrationData[i].max = i < 2 ? 54 : 26; - ctx->m_StickCalibrationData[i].center = 0; - ctx->m_StickCalibrationData[i].deadzone = i < 2 ? 4 : 2; - } - break; - case k_eWiiExtensionControllerType_Nunchuk: - for (i = 0; i < 2; i++) { - ctx->m_StickCalibrationData[i].min = 40; - ctx->m_StickCalibrationData[i].max = 215; - ctx->m_StickCalibrationData[i].center = 0; - ctx->m_StickCalibrationData[i].deadzone = 10; - } - break; - default: - break; + case k_eWiiExtensionControllerType_WiiUPro: + for (i = 0; i < 4; i++) { + ctx->m_StickCalibrationData[i].min = 1000; + ctx->m_StickCalibrationData[i].max = 3000; + ctx->m_StickCalibrationData[i].center = 0; + ctx->m_StickCalibrationData[i].deadzone = 100; + } + break; + case k_eWiiExtensionControllerType_Gamepad: + for (i = 0; i < 4; i++) { + ctx->m_StickCalibrationData[i].min = i < 2 ? 9 : 5; + ctx->m_StickCalibrationData[i].max = i < 2 ? 54 : 26; + ctx->m_StickCalibrationData[i].center = 0; + ctx->m_StickCalibrationData[i].deadzone = i < 2 ? 4 : 2; + } + break; + case k_eWiiExtensionControllerType_Nunchuk: + for (i = 0; i < 2; i++) { + ctx->m_StickCalibrationData[i].min = 40; + ctx->m_StickCalibrationData[i].max = 215; + ctx->m_StickCalibrationData[i].center = 0; + ctx->m_StickCalibrationData[i].deadzone = 10; + } + break; + default: + break; } } @@ -667,8 +669,7 @@ static void SDLCALL SDL_PlayerLEDHintChanged(void *userdata, const char *name, c } } -static EWiiExtensionControllerType -ReadExtensionControllerType(SDL_HIDAPI_Device *device) +static EWiiExtensionControllerType ReadExtensionControllerType(SDL_HIDAPI_Device *device) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; EWiiExtensionControllerType eExtensionControllerType = k_eWiiExtensionControllerType_Unknown; @@ -703,8 +704,7 @@ ReadExtensionControllerType(SDL_HIDAPI_Device *device) return eExtensionControllerType; } -static void -UpdateDeviceIdentity(SDL_HIDAPI_Device *device) +static void UpdateDeviceIdentity(SDL_HIDAPI_Device *device) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; @@ -728,8 +728,7 @@ UpdateDeviceIdentity(SDL_HIDAPI_Device *device) device->guid.data[15] = ctx->m_eExtensionControllerType; } -static SDL_bool -HIDAPI_DriverWii_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverWii_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverWii_Context *ctx; @@ -749,14 +748,12 @@ HIDAPI_DriverWii_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverWii_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverWii_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverWii_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverWii_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; @@ -769,11 +766,12 @@ HIDAPI_DriverWii_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID UpdateSlotLED(ctx); } -static SDL_bool -HIDAPI_DriverWii_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverWii_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->joystick = joystick; InitializeExtension(ctx); @@ -821,8 +819,7 @@ HIDAPI_DriverWii_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) return SDL_TRUE; } -static int -HIDAPI_DriverWii_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverWii_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; SDL_bool active = (low_frequency_rumble || high_frequency_rumble) ? SDL_TRUE : SDL_FALSE; @@ -839,32 +836,27 @@ HIDAPI_DriverWii_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic return 0; } -static int -HIDAPI_DriverWii_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverWii_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverWii_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverWii_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { return SDL_JOYCAP_RUMBLE; } -static int -HIDAPI_DriverWii_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverWii_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverWii_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverWii_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverWii_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverWii_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; @@ -926,7 +918,7 @@ static void PostStickCalibrated(SDL_Joystick *joystick, struct StickCalibrationD *`on` is the joystick value to be sent if a bit is on *`off` is the joystick value to be sent if a bit is off */ -static void PostPackedButtonData(SDL_Joystick *joystick, const Uint8 defs[][8], const Uint8* data, int size, Uint8 on, Uint8 off) +static void PostPackedButtonData(SDL_Joystick *joystick, const Uint8 defs[][8], const Uint8 *data, int size, Uint8 on, Uint8 off) { int i, j; @@ -943,70 +935,163 @@ static void PostPackedButtonData(SDL_Joystick *joystick, const Uint8 defs[][8], static const Uint8 GAMEPAD_BUTTON_DEFS[3][8] = { { - 0xFF /* Unused */, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_BACK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - }, { - SDL_CONTROLLER_BUTTON_DPAD_UP, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0xFF /* ZR */, SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_B, 0xFF /*ZL*/, - }, { - SDL_CONTROLLER_BUTTON_RIGHTSTICK, SDL_CONTROLLER_BUTTON_LEFTSTICK, 0xFF /* Charging */, 0xFF /* Plugged In */, - 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, + 0xFF /* Unused */, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + }, + { + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + 0xFF /* ZR */, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_B, + 0xFF /*ZL*/, + }, + { + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + 0xFF /* Charging */, + 0xFF /* Plugged In */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, } }; static const Uint8 GAMEPAD_BUTTON_DEFS_POSITIONAL[3][8] = { { - 0xFF /* Unused */, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_BACK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - }, { - SDL_CONTROLLER_BUTTON_DPAD_UP, SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0xFF /* ZR */, SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_A, 0xFF /*ZL*/, - }, { - SDL_CONTROLLER_BUTTON_RIGHTSTICK, SDL_CONTROLLER_BUTTON_LEFTSTICK, 0xFF /* Charging */, 0xFF /* Plugged In */, - 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, + 0xFF /* Unused */, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + }, + { + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + 0xFF /* ZR */, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_A, + 0xFF /*ZL*/, + }, + { + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + 0xFF /* Charging */, + 0xFF /* Plugged In */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, } }; static const Uint8 MP_GAMEPAD_BUTTON_DEFS[3][8] = { { - 0xFF /* Unused */, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_BACK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - }, { - 0xFF /* Motion Plus data */, 0xFF /* Motion Plus data */, 0xFF /* ZR */, SDL_CONTROLLER_BUTTON_X, - SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_B, 0xFF /*ZL*/, - }, { - SDL_CONTROLLER_BUTTON_RIGHTSTICK, SDL_CONTROLLER_BUTTON_LEFTSTICK, 0xFF /* Charging */, 0xFF /* Plugged In */, - 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, + 0xFF /* Unused */, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + }, + { + 0xFF /* Motion Plus data */, + 0xFF /* Motion Plus data */, + 0xFF /* ZR */, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_B, + 0xFF /*ZL*/, + }, + { + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + 0xFF /* Charging */, + 0xFF /* Plugged In */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, } }; static const Uint8 MP_GAMEPAD_BUTTON_DEFS_POSITIONAL[3][8] = { { - 0xFF /* Unused */, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, SDL_CONTROLLER_BUTTON_START, SDL_CONTROLLER_BUTTON_GUIDE, - SDL_CONTROLLER_BUTTON_BACK, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, - }, { - 0xFF /* Motion Plus data */, 0xFF /* Motion Plus data */, 0xFF /* ZR */, SDL_CONTROLLER_BUTTON_Y, - SDL_CONTROLLER_BUTTON_B, SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_A, 0xFF /*ZL*/, - }, { - SDL_CONTROLLER_BUTTON_RIGHTSTICK, SDL_CONTROLLER_BUTTON_LEFTSTICK, 0xFF /* Charging */, 0xFF /* Plugged In */, - 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, + 0xFF /* Unused */, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + }, + { + 0xFF /* Motion Plus data */, + 0xFF /* Motion Plus data */, + 0xFF /* ZR */, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_A, + 0xFF /*ZL*/, + }, + { + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + 0xFF /* Charging */, + 0xFF /* Plugged In */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, } }; static const Uint8 MP_FIXUP_DPAD_BUTTON_DEFS[2][8] = { { - SDL_CONTROLLER_BUTTON_DPAD_UP, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - }, { - SDL_CONTROLLER_BUTTON_DPAD_LEFT, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, + SDL_CONTROLLER_BUTTON_DPAD_UP, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + }, + { + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, } }; static void HandleWiiUProButtonData(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick, const WiiButtonData *data) { static const Uint8 axes[] = { SDL_CONTROLLER_AXIS_LEFTX, SDL_CONTROLLER_AXIS_RIGHTX, SDL_CONTROLLER_AXIS_LEFTY, SDL_CONTROLLER_AXIS_RIGHTY }; - const Uint8 (*buttons)[8] = ctx->m_bUseButtonLabels ? GAMEPAD_BUTTON_DEFS : GAMEPAD_BUTTON_DEFS_POSITIONAL; + const Uint8(*buttons)[8] = ctx->m_bUseButtonLabels ? GAMEPAD_BUTTON_DEFS : GAMEPAD_BUTTON_DEFS_POSITIONAL; Uint8 zl, zr; int i; @@ -1020,7 +1105,7 @@ static void HandleWiiUProButtonData(SDL_DriverWii_Context *ctx, SDL_Joystick *jo /* Triggers */ zl = data->rgucExtension[9] & 0x80; zr = data->rgucExtension[9] & 0x04; - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, zl ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, zl ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, zr ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); /* Sticks */ @@ -1035,9 +1120,7 @@ static void HandleWiiUProButtonData(SDL_DriverWii_Context *ctx, SDL_Joystick *jo static void HandleGamepadControllerButtonData(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick, const WiiButtonData *data) { - const Uint8 (*buttons)[8] = ctx->m_bUseButtonLabels ? - ((ctx->m_ucMotionPlusMode == WII_MOTIONPLUS_MODE_GAMEPAD) ? MP_GAMEPAD_BUTTON_DEFS : GAMEPAD_BUTTON_DEFS) : - ((ctx->m_ucMotionPlusMode == WII_MOTIONPLUS_MODE_GAMEPAD) ? MP_GAMEPAD_BUTTON_DEFS_POSITIONAL : GAMEPAD_BUTTON_DEFS_POSITIONAL); + const Uint8(*buttons)[8] = ctx->m_bUseButtonLabels ? ((ctx->m_ucMotionPlusMode == WII_MOTIONPLUS_MODE_GAMEPAD) ? MP_GAMEPAD_BUTTON_DEFS : GAMEPAD_BUTTON_DEFS) : ((ctx->m_ucMotionPlusMode == WII_MOTIONPLUS_MODE_GAMEPAD) ? MP_GAMEPAD_BUTTON_DEFS_POSITIONAL : GAMEPAD_BUTTON_DEFS_POSITIONAL); Uint8 lx, ly, rx, ry, zl, zr; if (data->ucNExtensionBytes < 6) { @@ -1053,7 +1136,7 @@ static void HandleGamepadControllerButtonData(SDL_DriverWii_Context *ctx, SDL_Jo /* Triggers */ zl = data->rgucExtension[5] & 0x80; zr = data->rgucExtension[5] & 0x04; - SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, zl ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); + SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, zl ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, zr ? SDL_JOYSTICK_AXIS_MIN : SDL_JOYSTICK_AXIS_MAX); /* Sticks */ @@ -1076,11 +1159,24 @@ static void HandleWiiRemoteButtonData(SDL_DriverWii_Context *ctx, SDL_Joystick * { static const Uint8 buttons[2][8] = { { - k_eWiiButtons_DPad_Left, k_eWiiButtons_DPad_Right, k_eWiiButtons_DPad_Down, k_eWiiButtons_DPad_Up, - k_eWiiButtons_Plus, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, - }, { - k_eWiiButtons_Two, k_eWiiButtons_One, k_eWiiButtons_B, k_eWiiButtons_A, - k_eWiiButtons_Minus, 0xFF /* Unused */, 0xFF /* Unused */, k_eWiiButtons_Home, + k_eWiiButtons_DPad_Left, + k_eWiiButtons_DPad_Right, + k_eWiiButtons_DPad_Down, + k_eWiiButtons_DPad_Up, + k_eWiiButtons_Plus, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + }, + { + k_eWiiButtons_Two, + k_eWiiButtons_One, + k_eWiiButtons_B, + k_eWiiButtons_A, + k_eWiiButtons_Minus, + 0xFF /* Unused */, + 0xFF /* Unused */, + k_eWiiButtons_Home, } }; if (data->hasBaseButtons) { @@ -1096,11 +1192,24 @@ static void HandleWiiRemoteButtonDataAsMainController(SDL_DriverWii_Context *ctx */ static const Uint8 buttons[2][8] = { { - SDL_CONTROLLER_BUTTON_DPAD_LEFT, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_DPAD_DOWN, SDL_CONTROLLER_BUTTON_DPAD_UP, - SDL_CONTROLLER_BUTTON_START, 0xFF /* Unused */, 0xFF /* Unused */, 0xFF /* Unused */, - }, { - SDL_CONTROLLER_BUTTON_Y, SDL_CONTROLLER_BUTTON_X, SDL_CONTROLLER_BUTTON_A, SDL_CONTROLLER_BUTTON_B, - SDL_CONTROLLER_BUTTON_BACK, 0xFF /* Unused */, 0xFF /* Unused */, SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_START, + 0xFF /* Unused */, + 0xFF /* Unused */, + 0xFF /* Unused */, + }, + { + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_BACK, + 0xFF /* Unused */, + 0xFF /* Unused */, + SDL_CONTROLLER_BUTTON_GUIDE, } }; if (data->hasBaseButtons) { @@ -1355,38 +1464,37 @@ static void HandleResponse(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick) case k_eWiiCommunicationState_CheckMotionPlusStage1: case k_eWiiCommunicationState_CheckMotionPlusStage2: - { - Uint16 extension = 0; - if (ParseExtensionIdentifyResponse(ctx, &extension)) { - if ((extension & WII_EXTENSION_MOTIONPLUS_MASK) == WII_EXTENSION_MOTIONPLUS_ID) { - /* Motion Plus is currently active */ - SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus CONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2); + { + Uint16 extension = 0; + if (ParseExtensionIdentifyResponse(ctx, &extension)) { + if ((extension & WII_EXTENSION_MOTIONPLUS_MASK) == WII_EXTENSION_MOTIONPLUS_ID) { + /* Motion Plus is currently active */ + SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus CONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2); - if (!ctx->m_bMotionPlusPresent) { - /* Reinitialize to get new sensor availability */ - ctx->m_bDisconnected = SDL_TRUE; - } - ctx->m_eCommState = k_eWiiCommunicationState_None; + if (!ctx->m_bMotionPlusPresent) { + /* Reinitialize to get new sensor availability */ + ctx->m_bDisconnected = SDL_TRUE; + } + ctx->m_eCommState = k_eWiiCommunicationState_None; - } else if (ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1) { - /* Check to see if Motion Plus is present */ - ReadRegister(ctx, 0xA600FE, 2, SDL_FALSE); + } else if (ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1) { + /* Check to see if Motion Plus is present */ + ReadRegister(ctx, 0xA600FE, 2, SDL_FALSE); - ctx->m_eCommState = k_eWiiCommunicationState_CheckMotionPlusStage2; + ctx->m_eCommState = k_eWiiCommunicationState_CheckMotionPlusStage2; - } else { - /* Motion Plus is not present */ - SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus DISCONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2); - - if (ctx->m_bMotionPlusPresent) { - /* Reinitialize to get new sensor availability */ - ctx->m_bDisconnected = SDL_TRUE; - } - ctx->m_eCommState = k_eWiiCommunicationState_None; + } else { + /* Motion Plus is not present */ + SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Motion Plus DISCONNECTED (stage %d)\n", ctx->m_eCommState == k_eWiiCommunicationState_CheckMotionPlusStage1 ? 1 : 2); + + if (ctx->m_bMotionPlusPresent) { + /* Reinitialize to get new sensor availability */ + ctx->m_bDisconnected = SDL_TRUE; } + ctx->m_eCommState = k_eWiiCommunicationState_None; } } - break; + } break; default: /* Should never happen */ break; @@ -1407,43 +1515,43 @@ static void HandleButtonPacket(SDL_DriverWii_Context *ctx, SDL_Joystick *joystic /* IR camera data is not supported */ SDL_zero(data); switch (ctx->m_rgucReadBuffer[0]) { - case k_eWiiInputReportIDs_ButtonData0: /* 30 BB BB */ - GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); - break; - case k_eWiiInputReportIDs_ButtonData1: /* 31 BB BB AA AA AA */ - case k_eWiiInputReportIDs_ButtonData3: /* 33 BB BB AA AA AA II II II II II II II II II II II II */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetAccelerometer(&data, ctx->m_rgucReadBuffer + 3); - break; - case k_eWiiInputReportIDs_ButtonData2: /* 32 BB BB EE EE EE EE EE EE EE EE */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetExtensionData(&data, ctx->m_rgucReadBuffer + 3, 8); - break; - case k_eWiiInputReportIDs_ButtonData4: /* 34 BB BB EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetExtensionData(&data, ctx->m_rgucReadBuffer + 3, 19); - break; - case k_eWiiInputReportIDs_ButtonData5: /* 35 BB BB AA AA AA EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetAccelerometer(&data, ctx->m_rgucReadBuffer + 3); - GetExtensionData(&data, ctx->m_rgucReadBuffer + 6, 16); - break; - case k_eWiiInputReportIDs_ButtonData6: /* 36 BB BB II II II II II II II II II II EE EE EE EE EE EE EE EE EE */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetExtensionData(&data, ctx->m_rgucReadBuffer + 13, 9); - break; - case k_eWiiInputReportIDs_ButtonData7: /* 37 BB BB AA AA AA II II II II II II II II II II EE EE EE EE EE EE */ - GetBaseButtons (&data, ctx->m_rgucReadBuffer + 1); - GetExtensionData(&data, ctx->m_rgucReadBuffer + 16, 6); - break; - case k_eWiiInputReportIDs_ButtonDataD: /* 3d EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ - GetExtensionData(&data, ctx->m_rgucReadBuffer + 1, 21); - break; - case k_eWiiInputReportIDs_ButtonDataE: - case k_eWiiInputReportIDs_ButtonDataF: - default: - SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Unsupported button data type %02x", ctx->m_rgucReadBuffer[0]); - return; + case k_eWiiInputReportIDs_ButtonData0: /* 30 BB BB */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + break; + case k_eWiiInputReportIDs_ButtonData1: /* 31 BB BB AA AA AA */ + case k_eWiiInputReportIDs_ButtonData3: /* 33 BB BB AA AA AA II II II II II II II II II II II II */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetAccelerometer(&data, ctx->m_rgucReadBuffer + 3); + break; + case k_eWiiInputReportIDs_ButtonData2: /* 32 BB BB EE EE EE EE EE EE EE EE */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetExtensionData(&data, ctx->m_rgucReadBuffer + 3, 8); + break; + case k_eWiiInputReportIDs_ButtonData4: /* 34 BB BB EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetExtensionData(&data, ctx->m_rgucReadBuffer + 3, 19); + break; + case k_eWiiInputReportIDs_ButtonData5: /* 35 BB BB AA AA AA EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetAccelerometer(&data, ctx->m_rgucReadBuffer + 3); + GetExtensionData(&data, ctx->m_rgucReadBuffer + 6, 16); + break; + case k_eWiiInputReportIDs_ButtonData6: /* 36 BB BB II II II II II II II II II II EE EE EE EE EE EE EE EE EE */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetExtensionData(&data, ctx->m_rgucReadBuffer + 13, 9); + break; + case k_eWiiInputReportIDs_ButtonData7: /* 37 BB BB AA AA AA II II II II II II II II II II EE EE EE EE EE EE */ + GetBaseButtons(&data, ctx->m_rgucReadBuffer + 1); + GetExtensionData(&data, ctx->m_rgucReadBuffer + 16, 6); + break; + case k_eWiiInputReportIDs_ButtonDataD: /* 3d EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE EE */ + GetExtensionData(&data, ctx->m_rgucReadBuffer + 1, 21); + break; + case k_eWiiInputReportIDs_ButtonDataE: + case k_eWiiInputReportIDs_ButtonDataF: + default: + SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI Wii: Unsupported button data type %02x", ctx->m_rgucReadBuffer[0]); + return; } HandleButtonData(ctx, joystick, &data); } @@ -1462,8 +1570,7 @@ static void HandleInput(SDL_DriverWii_Context *ctx, SDL_Joystick *joystick) } } -static SDL_bool -HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -1529,11 +1636,10 @@ HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverWii_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverWii_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverWii_Context *ctx = (SDL_DriverWii_Context *)device->context; @@ -1546,13 +1652,11 @@ HIDAPI_DriverWii_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick ctx->joystick = NULL; } -static void -HIDAPI_DriverWii_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverWii_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverWii = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverWii = { SDL_HINT_JOYSTICK_HIDAPI_WII, SDL_TRUE, HIDAPI_DriverWii_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index 191ccb97ff1dd..189115e0ad82a 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,14 +31,13 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_XBOX360 /* Define this if you want to log all packets from the controller */ /*#define DEBUG_XBOX_PROTOCOL*/ - -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_Joystick *joystick; int player_index; @@ -46,34 +45,32 @@ typedef struct { Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverXbox360_Context; -static void -HIDAPI_DriverXbox360_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXbox360_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, callback, userdata); } -static void -HIDAPI_DriverXbox360_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXbox360_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, callback, userdata); } -static SDL_bool -HIDAPI_DriverXbox360_IsEnabled(void) +static SDL_bool HIDAPI_DriverXbox360_IsEnabled(void) { return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT))); + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT))); } -static SDL_bool -HIDAPI_DriverXbox360_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverXbox360_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { const int XB360W_IFACE_PROTOCOL = 129; /* Wireless */ + if (vendor_id == USB_VENDOR_ASTRO && product_id == USB_PRODUCT_ASTRO_C40_XBOX360) { + /* This is the ASTRO C40 in Xbox 360 mode */ + return SDL_TRUE; + } if (vendor_id == USB_VENDOR_NVIDIA) { /* This is the NVIDIA Shield controller which doesn't talk Xbox controller protocol */ return SDL_FALSE; @@ -87,23 +84,16 @@ HIDAPI_DriverXbox360_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *na /* This is the chatpad or other input interface, not the Xbox 360 interface */ return SDL_FALSE; } -#if defined(__MACOSX__) || defined(__WIN32__) - if (vendor_id == USB_VENDOR_MICROSOFT && product_id == 0x028e && version == 1) { - /* This is the Steam Virtual Gamepad, which isn't supported by this driver */ - return SDL_FALSE; - } -#endif -#if defined(__MACOSX__) - /* Wired Xbox One controllers are handled by this driver, interfacing with - the 360Controller driver available from: - https://github.com/360Controller/360Controller/releases - - Bluetooth Xbox One controllers are handled by the SDL Xbox One driver - */ - if (SDL_IsJoystickBluetoothXboxOne(vendor_id, product_id)) { +#if defined(__MACOSX__) && defined(SDL_JOYSTICK_MFI) + if (SDL_IsJoystickSteamVirtualGamepad(vendor_id, product_id, version)) { + /* GCController support doesn't work with the Steam Virtual Gamepad */ + return SDL_TRUE; + } else { + /* On macOS you can't write output reports to wired XBox controllers, + so we'll just use the GCController support instead. + */ return SDL_FALSE; } - return (type == SDL_CONTROLLER_TYPE_XBOX360 || type == SDL_CONTROLLER_TYPE_XBOXONE) ? SDL_TRUE : SDL_FALSE; #else return (type == SDL_CONTROLLER_TYPE_XBOX360) ? SDL_TRUE : SDL_FALSE; #endif @@ -143,8 +133,7 @@ static void SDLCALL SDL_PlayerLEDHintChanged(void *userdata, const char *name, c } } -static SDL_bool -HIDAPI_DriverXbox360_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXbox360_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverXbox360_Context *ctx; @@ -159,17 +148,22 @@ HIDAPI_DriverXbox360_InitDevice(SDL_HIDAPI_Device *device) device->type = SDL_CONTROLLER_TYPE_XBOX360; + if (SDL_IsJoystickSteamVirtualGamepad(device->vendor_id, device->product_id, device->version) && + device->product_string && SDL_strncmp(device->product_string, "GamePad-", 8) == 0) { + int slot = 0; + SDL_sscanf(device->product_string, "GamePad-%d", &slot); + device->steam_virtual_gamepad_slot = (slot - 1); + } + return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverXbox360_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverXbox360_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverXbox360_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverXbox360_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)device->context; @@ -182,11 +176,12 @@ HIDAPI_DriverXbox360_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joystic UpdateSlotLED(ctx); } -static SDL_bool -HIDAPI_DriverXbox360_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverXbox360_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->joystick = joystick; SDL_zeroa(ctx->last_state); @@ -206,33 +201,8 @@ HIDAPI_DriverXbox360_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joyst return SDL_TRUE; } -static int -HIDAPI_DriverXbox360_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverXbox360_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { -#ifdef __MACOSX__ - if (SDL_IsJoystickBluetoothXboxOne(device->vendor_id, device->product_id)) { - Uint8 rumble_packet[] = { 0x03, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 }; - - rumble_packet[4] = (low_frequency_rumble >> 8); - rumble_packet[5] = (high_frequency_rumble >> 8); - - if (SDL_HIDAPI_SendRumble(device, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) { - return SDL_SetError("Couldn't send rumble packet"); - } - } else { - /* On Mac OS X the 360Controller driver uses this short report, - and we need to prefix it with a magic token so hidapi passes it through untouched - */ - Uint8 rumble_packet[] = { 'M', 'A', 'G', 'I', 'C', '0', 0x00, 0x04, 0x00, 0x00 }; - - rumble_packet[6+2] = (low_frequency_rumble >> 8); - rumble_packet[6+3] = (high_frequency_rumble >> 8); - - if (SDL_HIDAPI_SendRumble(device, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) { - return SDL_SetError("Couldn't send rumble packet"); - } - } -#else Uint8 rumble_packet[] = { 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; rumble_packet[3] = (low_frequency_rumble >> 8); @@ -241,43 +211,36 @@ HIDAPI_DriverXbox360_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joy if (SDL_HIDAPI_SendRumble(device, rumble_packet, sizeof(rumble_packet)) != sizeof(rumble_packet)) { return SDL_SetError("Couldn't send rumble packet"); } -#endif return 0; } -static int -HIDAPI_DriverXbox360_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverXbox360_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverXbox360_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverXbox360_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */ return SDL_JOYCAP_RUMBLE; } -static int -HIDAPI_DriverXbox360_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverXbox360_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverXbox360_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverXbox360_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverXbox360_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverXbox360_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXbox360_Context *ctx, Uint8 *data, int size) { Sint16 axis; #ifdef __MACOSX__ @@ -311,16 +274,16 @@ HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXbox360 SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); axis = ((int)data[5] * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[6])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[6])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[8])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[8])); if (invert_y_axes) { axis = ~axis; } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[10])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[10])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[12])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[12])); if (invert_y_axes) { axis = ~axis; } @@ -329,8 +292,7 @@ HIDAPI_DriverXbox360_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXbox360 SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -360,11 +322,10 @@ HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverXbox360_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverXbox360_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXbox360_Context *ctx = (SDL_DriverXbox360_Context *)device->context; @@ -374,13 +335,11 @@ HIDAPI_DriverXbox360_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys ctx->joystick = NULL; } -static void -HIDAPI_DriverXbox360_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverXbox360_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 = { SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, SDL_TRUE, HIDAPI_DriverXbox360_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360w.c b/src/joystick/hidapi/SDL_hidapi_xbox360w.c index f0a1d2931b138..19798ab1a9a3a 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360w.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360w.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,14 +31,13 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_XBOX360 /* Define this if you want to log all packets from the controller */ /*#define DEBUG_XBOX_PROTOCOL*/ - -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; SDL_bool connected; int player_index; @@ -46,35 +45,27 @@ typedef struct { Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverXbox360W_Context; - -static void -HIDAPI_DriverXbox360W_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXbox360W_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, callback, userdata); SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS, callback, userdata); } -static void -HIDAPI_DriverXbox360W_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXbox360W_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, callback, userdata); SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS, callback, userdata); } -static SDL_bool -HIDAPI_DriverXbox360W_IsEnabled(void) +static SDL_bool HIDAPI_DriverXbox360W_IsEnabled(void) { return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT)))); + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_360, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT)))); } -static SDL_bool -HIDAPI_DriverXbox360W_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverXbox360W_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { const int XB360W_IFACE_PROTOCOL = 129; /* Wireless */ @@ -119,8 +110,7 @@ static void SDLCALL SDL_PlayerLEDHintChanged(void *userdata, const char *name, c } } -static void -UpdatePowerLevel(SDL_Joystick *joystick, Uint8 level) +static void UpdatePowerLevel(SDL_Joystick *joystick, Uint8 level) { float normalized_level = (float)level / 255.0f; @@ -135,8 +125,7 @@ UpdatePowerLevel(SDL_Joystick *joystick, Uint8 level) } } -static SDL_bool -HIDAPI_DriverXbox360W_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXbox360W_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverXbox360W_Context *ctx; @@ -164,14 +153,12 @@ HIDAPI_DriverXbox360W_InitDevice(SDL_HIDAPI_Device *device) return SDL_TRUE; } -static int -HIDAPI_DriverXbox360W_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverXbox360W_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverXbox360W_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverXbox360W_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { SDL_DriverXbox360W_Context *ctx = (SDL_DriverXbox360W_Context *)device->context; @@ -184,11 +171,12 @@ HIDAPI_DriverXbox360W_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_Joysti UpdateSlotLED(ctx); } -static SDL_bool -HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXbox360W_Context *ctx = (SDL_DriverXbox360W_Context *)device->context; + SDL_AssertJoysticksLocked(); + SDL_zeroa(ctx->last_state); /* Initialize player index (needed for setting LEDs) */ @@ -207,8 +195,7 @@ HIDAPI_DriverXbox360W_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys return SDL_TRUE; } -static int -HIDAPI_DriverXbox360W_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverXbox360W_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { Uint8 rumble_packet[] = { 0x00, 0x01, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -221,39 +208,33 @@ HIDAPI_DriverXbox360W_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *jo return 0; } -static int -HIDAPI_DriverXbox360W_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverXbox360W_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -HIDAPI_DriverXbox360W_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverXbox360W_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { /* Doesn't have an RGB LED, so don't return SDL_JOYCAP_LED here */ return SDL_JOYCAP_RUMBLE; } -static int -HIDAPI_DriverXbox360W_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverXbox360W_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -HIDAPI_DriverXbox360W_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverXbox360W_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverXbox360W_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverXbox360W_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverXbox360W_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverXbox360W_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXbox360W_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device *dev, SDL_DriverXbox360W_Context *ctx, Uint8 *data, int size) { Sint16 axis; const SDL_bool invert_y_axes = SDL_TRUE; @@ -283,16 +264,16 @@ HIDAPI_DriverXbox360W_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device * SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); axis = ((int)data[5] * 257) - 32768; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[6])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[6])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[8])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[8])); if (invert_y_axes) { axis = ~axis; } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[10])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[10])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[12])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[12])); if (invert_y_axes) { axis = ~axis; } @@ -301,8 +282,7 @@ HIDAPI_DriverXbox360W_HandleStatePacket(SDL_Joystick *joystick, SDL_hid_device * SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static SDL_bool -HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverXbox360W_Context *ctx = (SDL_DriverXbox360W_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -351,7 +331,7 @@ HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device) } } else if (size == 29 && data[0] == 0x00 && (data[1] & 0x01) == 0x01) { if (joystick) { - HIDAPI_DriverXbox360W_HandleStatePacket(joystick, device->dev, ctx, data+4, size-4); + HIDAPI_DriverXbox360W_HandleStatePacket(joystick, device->dev, ctx, data + 4, size - 4); } } } @@ -360,11 +340,10 @@ HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverXbox360W_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverXbox360W_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXbox360W_Context *ctx = (SDL_DriverXbox360W_Context *)device->context; @@ -372,13 +351,11 @@ HIDAPI_DriverXbox360W_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joy SDL_PlayerLEDHintChanged, ctx); } -static void -HIDAPI_DriverXbox360W_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverXbox360W_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360W = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360W = { SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS, SDL_TRUE, HIDAPI_DriverXbox360W_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index 1a5798e911c86..9ca02bf0a781e 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,7 +31,6 @@ #include "SDL_hidapijoystick_c.h" #include "SDL_hidapi_rumble.h" - #ifdef SDL_JOYSTICK_HIDAPI_XBOXONE /* Define this if you want verbose logging of the init sequence */ @@ -77,7 +76,8 @@ static const Uint8 security_passed_packet[] = { * sent. The correct sequence number will be added when the * packet is going to be sent. */ -typedef struct { +typedef struct +{ Uint16 vendor_id; Uint16 product_id; Uint16 exclude_vendor_id; @@ -87,7 +87,6 @@ typedef struct { const Uint8 response[2]; } SDL_DriverXboxOne_InitPacket; - static const SDL_DriverXboxOne_InitPacket xboxone_init_packets[] = { { 0x0000, 0x0000, 0x0000, 0x0000, xboxone_init0, sizeof(xboxone_init0), { 0x00, 0x00 } }, { 0x0000, 0x0000, 0x0000, 0x0000, xboxone_init1, sizeof(xboxone_init1), { 0x00, 0x00 } }, @@ -99,20 +98,23 @@ static const SDL_DriverXboxOne_InitPacket xboxone_init_packets[] = { { 0x0000, 0x0000, 0x0000, 0x0000, xboxone_init2, sizeof(xboxone_init2), { 0x00, 0x00 } }, }; -typedef enum { +typedef enum +{ XBOX_ONE_INIT_STATE_START_NEGOTIATING, XBOX_ONE_INIT_STATE_NEGOTIATING, XBOX_ONE_INIT_STATE_PREPARE_INPUT, XBOX_ONE_INIT_STATE_COMPLETE, } SDL_XboxOneInitState; -typedef enum { +typedef enum +{ XBOX_ONE_RUMBLE_STATE_IDLE, XBOX_ONE_RUMBLE_STATE_QUEUED, XBOX_ONE_RUMBLE_STATE_BUSY } SDL_XboxOneRumbleState; -typedef struct { +typedef struct +{ SDL_HIDAPI_Device *device; Uint16 vendor_id; Uint16 product_id; @@ -125,8 +127,10 @@ typedef struct { SDL_bool has_guide_packet; SDL_bool has_color_led; SDL_bool has_paddles; + SDL_bool has_unmapped_state; SDL_bool has_trigger_rumble; SDL_bool has_share_button; + Uint8 last_paddle_state; Uint8 low_frequency_rumble; Uint8 high_frequency_rumble; Uint8 left_trigger_rumble; @@ -137,20 +141,17 @@ typedef struct { Uint8 last_state[USB_PACKET_LENGTH]; } SDL_DriverXboxOne_Context; -static SDL_bool -ControllerHasColorLED(Uint16 vendor_id, Uint16 product_id) +static SDL_bool ControllerHasColorLED(Uint16 vendor_id, Uint16 product_id) { - return (vendor_id == USB_VENDOR_MICROSOFT && product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2); + return vendor_id == USB_VENDOR_MICROSOFT && product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2; } -static SDL_bool -ControllerHasPaddles(Uint16 vendor_id, Uint16 product_id) +static SDL_bool ControllerHasPaddles(Uint16 vendor_id, Uint16 product_id) { return SDL_IsJoystickXboxOneElite(vendor_id, product_id); } -static SDL_bool -ControllerHasTriggerRumble(Uint16 vendor_id, Uint16 product_id) +static SDL_bool ControllerHasTriggerRumble(Uint16 vendor_id, Uint16 product_id) { /* All the Microsoft Xbox One controllers have trigger rumble */ if (vendor_id == USB_VENDOR_MICROSOFT) { @@ -165,8 +166,7 @@ ControllerHasTriggerRumble(Uint16 vendor_id, Uint16 product_id) return SDL_FALSE; } -static SDL_bool -ControllerHasShareButton(Uint16 vendor_id, Uint16 product_id) +static SDL_bool ControllerHasShareButton(Uint16 vendor_id, Uint16 product_id) { return SDL_IsJoystickXboxSeriesX(vendor_id, product_id); } @@ -206,8 +206,7 @@ static void SDLCALL SDL_HomeLEDHintChanged(void *userdata, const char *name, con } } -static void -SetInitState(SDL_DriverXboxOne_Context *ctx, SDL_XboxOneInitState state) +static void SetInitState(SDL_DriverXboxOne_Context *ctx, SDL_XboxOneInitState state) { #ifdef DEBUG_JOYSTICK SDL_Log("Setting init state %d\n", state); @@ -215,8 +214,7 @@ SetInitState(SDL_DriverXboxOne_Context *ctx, SDL_XboxOneInitState state) ctx->init_state = state; } -static void -SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size) +static void SendAckIfNeeded(SDL_HIDAPI_Device *device, const Uint8 *data, int size) { #if defined(__WIN32__) || defined(__WINGDK__) /* The Windows driver is taking care of acks */ @@ -236,7 +234,7 @@ SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size) #ifdef DEBUG_XBOX_PROTOCOL HIDAPI_DumpPacket("Xbox One sending ACK packet: size = %d", ack_packet, sizeof(ack_packet)); #endif - if (SDL_HIDAPI_LockRumble() < 0 || + if (SDL_HIDAPI_LockRumble() != 0 || SDL_HIDAPI_SendRumbleAndUnlock(device, ack_packet, sizeof(ack_packet)) != sizeof(ack_packet)) { SDL_SetError("Couldn't send ack packet"); } @@ -245,8 +243,7 @@ SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size) } #if 0 -static SDL_bool -SendSerialRequest(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) +static SDL_bool SendSerialRequest(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) { Uint8 serial_packet[] = { 0x1E, 0x30, 0x07, 0x01, 0x04 }; @@ -257,7 +254,7 @@ SendSerialRequest(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) * It will cancel the announce packet if sent before that, and will be * ignored if sent during the negotiation. */ - if (SDL_HIDAPI_LockRumble() < 0 || + if (SDL_HIDAPI_LockRumble() != 0 || SDL_HIDAPI_SendRumbleAndUnlock(device, serial_packet, sizeof(serial_packet)) != sizeof(serial_packet)) { SDL_SetError("Couldn't send serial packet"); return SDL_FALSE; @@ -266,8 +263,7 @@ SendSerialRequest(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) } #endif -static SDL_bool -ControllerNeedsNegotiation(SDL_DriverXboxOne_Context *ctx) +static SDL_bool ControllerNeedsNegotiation(SDL_DriverXboxOne_Context *ctx) { if (ctx->vendor_id == USB_VENDOR_PDP && ctx->product_id == 0x0246) { /* The PDP Rock Candy (PID 0x0246) doesn't send the announce packet on Linux for some reason */ @@ -276,14 +272,13 @@ ControllerNeedsNegotiation(SDL_DriverXboxOne_Context *ctx) return SDL_FALSE; } -static SDL_bool -SendControllerInit(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) +static SDL_bool SendControllerInit(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) { Uint16 vendor_id = ctx->vendor_id; Uint16 product_id = ctx->product_id; Uint8 init_packet[USB_PACKET_LENGTH]; - for ( ; ctx->init_packet < SDL_arraysize(xboxone_init_packets); ++ctx->init_packet) { + for (; ctx->init_packet < SDL_arraysize(xboxone_init_packets); ++ctx->init_packet) { const SDL_DriverXboxOne_InitPacket *packet = &xboxone_init_packets[ctx->init_packet]; if (packet->vendor_id && (vendor_id != packet->vendor_id)) { @@ -317,7 +312,7 @@ SendControllerInit(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) #endif ctx->send_time = SDL_GetTicks(); - if (SDL_HIDAPI_LockRumble() < 0 || + if (SDL_HIDAPI_LockRumble() != 0 || SDL_HIDAPI_SendRumbleAndUnlock(device, init_packet, packet->size) != packet->size) { SDL_SetError("Couldn't write Xbox One initialization packet"); return SDL_FALSE; @@ -339,43 +334,39 @@ SendControllerInit(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) return SDL_TRUE; } -static void -HIDAPI_DriverXboxOne_RegisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXboxOne_RegisterHints(SDL_HintCallback callback, void *userdata) { SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_AddHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE, callback, userdata); } -static void -HIDAPI_DriverXboxOne_UnregisterHints(SDL_HintCallback callback, void *userdata) +static void HIDAPI_DriverXboxOne_UnregisterHints(SDL_HintCallback callback, void *userdata) { SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX, callback, userdata); SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE, callback, userdata); } -static SDL_bool -HIDAPI_DriverXboxOne_IsEnabled(void) +static SDL_bool HIDAPI_DriverXboxOne_IsEnabled(void) { return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, - SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, - SDL_HIDAPI_DEFAULT))); + SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_XBOX, SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI, SDL_HIDAPI_DEFAULT))); } -static SDL_bool -HIDAPI_DriverXboxOne_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_bool HIDAPI_DriverXboxOne_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GameControllerType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { -#ifdef __MACOSX__ - /* Wired Xbox One controllers are handled by the 360Controller driver */ +#if defined(__MACOSX__) && defined(SDL_JOYSTICK_MFI) if (!SDL_IsJoystickBluetoothXboxOne(vendor_id, product_id)) { + /* On macOS we get a shortened version of the real report and + you can't write output reports for wired controllers, so + we'll just use the GCController support instead. + */ return SDL_FALSE; } #endif return (type == SDL_CONTROLLER_TYPE_XBOXONE) ? SDL_TRUE : SDL_FALSE; } -static SDL_bool -HIDAPI_DriverXboxOne_InitDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXboxOne_InitDevice(SDL_HIDAPI_Device *device) { SDL_DriverXboxOne_Context *ctx; @@ -414,22 +405,21 @@ HIDAPI_DriverXboxOne_InitDevice(SDL_HIDAPI_Device *device) return HIDAPI_JoystickConnected(device, NULL); } -static int -HIDAPI_DriverXboxOne_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) +static int HIDAPI_DriverXboxOne_GetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id) { return -1; } -static void -HIDAPI_DriverXboxOne_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) +static void HIDAPI_DriverXboxOne_SetDevicePlayerIndex(SDL_HIDAPI_Device *device, SDL_JoystickID instance_id, int player_index) { } -static SDL_bool -HIDAPI_DriverXboxOne_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static SDL_bool HIDAPI_DriverXboxOne_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; + SDL_AssertJoysticksLocked(); + ctx->low_frequency_rumble = 0; ctx->high_frequency_rumble = 0; ctx->left_trigger_rumble = 0; @@ -458,15 +448,13 @@ HIDAPI_DriverXboxOne_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joyst return SDL_TRUE; } -static void -HIDAPI_DriverXboxOne_RumbleSent(void *userdata) +static void HIDAPI_DriverXboxOne_RumbleSent(void *userdata) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)userdata; ctx->rumble_time = SDL_GetTicks(); } -static int -HIDAPI_DriverXboxOne_UpdateRumble(SDL_HIDAPI_Device *device) +static int HIDAPI_DriverXboxOne_UpdateRumble(SDL_HIDAPI_Device *device) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; @@ -495,7 +483,7 @@ HIDAPI_DriverXboxOne_UpdateRumble(SDL_HIDAPI_Device *device) /* We're no longer pending, even if we fail to send the rumble below */ ctx->rumble_pending = SDL_FALSE; - if (SDL_HIDAPI_LockRumble() < 0) { + if (SDL_HIDAPI_LockRumble() != 0) { return -1; } @@ -528,8 +516,7 @@ HIDAPI_DriverXboxOne_UpdateRumble(SDL_HIDAPI_Device *device) return 0; } -static int -HIDAPI_DriverXboxOne_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int HIDAPI_DriverXboxOne_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; @@ -541,8 +528,7 @@ HIDAPI_DriverXboxOne_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joy return HIDAPI_DriverXboxOne_UpdateRumble(device); } -static int -HIDAPI_DriverXboxOne_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_DriverXboxOne_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; @@ -558,8 +544,7 @@ HIDAPI_DriverXboxOne_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joyst return HIDAPI_DriverXboxOne_UpdateRumble(device); } -static Uint32 -HIDAPI_DriverXboxOne_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static Uint32 HIDAPI_DriverXboxOne_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; Uint32 result = 0; @@ -576,8 +561,7 @@ HIDAPI_DriverXboxOne_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joys return result; } -static int -HIDAPI_DriverXboxOne_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_DriverXboxOne_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; @@ -598,23 +582,92 @@ HIDAPI_DriverXboxOne_SetJoystickLED(SDL_HIDAPI_Device *device, SDL_Joystick *joy } } -static int -HIDAPI_DriverXboxOne_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_DriverXboxOne_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -HIDAPI_DriverXboxOne_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_DriverXboxOne_SetJoystickSensorsEnabled(SDL_HIDAPI_Device *device, SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +/* + * The Xbox One Elite controller with 5.13+ firmware sends the unmapped state in a separate packet. + * We can use this to send the paddle state when they aren't mapped + */ +static void HIDAPI_DriverXboxOne_HandleUnmappedStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +{ + Uint8 profile; + int paddle_index; + int button1_bit; + int button2_bit; + int button3_bit; + int button4_bit; + SDL_bool paddles_mapped; + + if (size == 21) { + /* XBox One Elite Series 2 */ + paddle_index = 18; + button1_bit = 0x01; + button2_bit = 0x02; + button3_bit = 0x04; + button4_bit = 0x08; + profile = data[19]; + + if (profile == 0) { + paddles_mapped = SDL_FALSE; + } else if (SDL_memcmp(&data[4], &ctx->last_state[4], 14) == 0) { + /* We're using a profile, but paddles aren't mapped */ + paddles_mapped = SDL_FALSE; + } else { + /* Something is mapped, we can't use the paddles */ + paddles_mapped = SDL_TRUE; + } + + } else { + /* Unknown format */ + return; + } +#ifdef DEBUG_XBOX_PROTOCOL + SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n", + (data[paddle_index] & button1_bit) ? 1 : 0, + (data[paddle_index] & button2_bit) ? 1 : 0, + (data[paddle_index] & button3_bit) ? 1 : 0, + (data[paddle_index] & button4_bit) ? 1 : 0, + paddles_mapped ? "TRUE" : "FALSE"); +#endif + + if (paddles_mapped) { + /* Respect that the paddles are being used for other controls and don't pass them on to the app */ + data[paddle_index] = 0; + } + + if (ctx->last_paddle_state != data[paddle_index]) { + int nButton = SDL_CONTROLLER_BUTTON_MISC1 + ctx->has_share_button; /* Next available button */ + SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button1_bit) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button2_bit) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button3_bit) ? SDL_PRESSED : SDL_RELEASED); + SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button4_bit) ? SDL_PRESSED : SDL_RELEASED); + ctx->last_paddle_state = data[paddle_index]; + } + ctx->has_unmapped_state = SDL_TRUE; +} + +static void HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) { Sint16 axis; + /* Some controllers have larger packets over NDIS, but the real size is in data[3] */ + size = SDL_min(4 + data[3], size); + + /* Enable paddles on the Xbox Elite controller when connected over USB */ + if (ctx->has_paddles && !ctx->has_unmapped_state && size == 50) { + Uint8 packet[] = { 0x4d, 0x00, 0x00, 0x02, 0x07, 0x00 }; + + SDL_HIDAPI_SendRumble(ctx->device, packet, sizeof(packet)); + } + if (ctx->last_state[4] != data[4]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_START, (data[4] & 0x04) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_BACK, (data[4] & 0x08) ? SDL_PRESSED : SDL_RELEASED); @@ -646,6 +699,7 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne * Xbox Series X firmware version 5.1, report is 44 bytes, share button is in byte 18 * Xbox Series X firmware version 5.5, report is 48 bytes, share button is in byte 22 * Victrix Gambit Tournament Controller, report is 50 bytes, share button is in byte 32 + * ThrustMaster eSwap PRO Controller Xbox, report is 64 bytes, share button is in byte 46 */ if (size < 48) { if (ctx->last_state[18] != data[18]) { @@ -659,6 +713,10 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne if (ctx->last_state[32] != data[32]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data[32] & 0x01) ? SDL_PRESSED : SDL_RELEASED); } + } else if (size == 64) { + if (ctx->last_state[46] != data[46]) { + SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_MISC1, (data[46] & 0x01) ? SDL_PRESSED : SDL_RELEASED); + } } } @@ -676,7 +734,7 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne P3: 0x04 (A) P1: 0x01 (B) P4: 0x08 (X) P2: 0x02 (Y) */ - if (ctx->has_paddles && (size == 33 || size == 38 || size == 50)) { + if (ctx->has_paddles && !ctx->has_unmapped_state && (size == 33 || size == 38 || size == 50)) { int paddle_index; int button1_bit; int button2_bit; @@ -704,7 +762,7 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne button4_bit = 0x08; paddles_mapped = (data[19] != 0); - } else /* if (size == 50) */{ + } else /* if (size == 50) */ { /* XBox One Elite Series 2 */ paddle_index = 22; button1_bit = 0x01; @@ -715,12 +773,11 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne } #ifdef DEBUG_XBOX_PROTOCOL SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n", - (data[paddle_index] & button1_bit) ? 1 : 0, - (data[paddle_index] & button2_bit) ? 1 : 0, - (data[paddle_index] & button3_bit) ? 1 : 0, - (data[paddle_index] & button4_bit) ? 1 : 0, - paddles_mapped ? "TRUE" : "FALSE" - ); + (data[paddle_index] & button1_bit) ? 1 : 0, + (data[paddle_index] & button2_bit) ? 1 : 0, + (data[paddle_index] & button3_bit) ? 1 : 0, + (data[paddle_index] & button4_bit) ? 1 : 0, + paddles_mapped ? "TRUE" : "FALSE"); #endif if (paddles_mapped) { @@ -728,26 +785,27 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne data[paddle_index] = 0; } - if (ctx->last_state[paddle_index] != data[paddle_index]) { + if (ctx->last_paddle_state != data[paddle_index]) { int nButton = SDL_CONTROLLER_BUTTON_MISC1 + ctx->has_share_button; /* Next available button */ SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button1_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button2_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button3_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button4_bit) ? SDL_PRESSED : SDL_RELEASED); + ctx->last_paddle_state = data[paddle_index]; } } - axis = ((int)SDL_SwapLE16(*(Sint16*)(&data[6])) * 64) - 32768; + axis = ((int)SDL_SwapLE16(*(Sint16 *)(&data[6])) * 64) - 32768; if (axis == 32704) { axis = 32767; } - if (axis == -32768 && size == 30 && (data[22] & 0x80) != 0) { + if (axis == -32768 && size == 30 && (data[22] & 0x80)) { axis = 32767; } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); - axis = ((int)SDL_SwapLE16(*(Sint16*)(&data[8])) * 64) - 32768; - if (axis == -32768 && size == 30 && (data[22] & 0x40) != 0) { + axis = ((int)SDL_SwapLE16(*(Sint16 *)(&data[8])) * 64) - 32768; + if (axis == -32768 && size == 30 && (data[22] & 0x40)) { axis = 32767; } if (axis == 32704) { @@ -755,28 +813,29 @@ HIDAPI_DriverXboxOne_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[10])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[10])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[12])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[12])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, ~axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[14])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[14])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis); - axis = SDL_SwapLE16(*(Sint16*)(&data[16])); + axis = SDL_SwapLE16(*(Sint16 *)(&data[16])); SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, ~axis); SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); + + /* We don't have the unmapped state for this packet */ + ctx->has_unmapped_state = SDL_FALSE; } -static void -HIDAPI_DriverXboxOne_HandleStatusPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOne_HandleStatusPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) { if (ctx->init_state < XBOX_ONE_INIT_STATE_COMPLETE) { SetInitState(ctx, XBOX_ONE_INIT_STATE_COMPLETE); } } -static void -HIDAPI_DriverXboxOne_HandleModePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOne_HandleModePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, const Uint8 *data, int size) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data[4] & 0x01) ? SDL_PRESSED : SDL_RELEASED); } @@ -784,8 +843,7 @@ HIDAPI_DriverXboxOne_HandleModePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_ /* * Xbox One S with firmware 3.1.1221 uses a 16 byte packet and the GUIDE button in a separate packet */ -static void -HIDAPI_DriverXboxOneBluetooth_HandleButtons16(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOneBluetooth_HandleButtons16(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, const Uint8 *data, int size) { if (ctx->last_state[14] != data[14]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, (data[14] & 0x01) ? SDL_PRESSED : SDL_RELEASED); @@ -802,7 +860,6 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons16(SDL_Joystick *joystick, SDL_Driver SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_LEFTSTICK, (data[15] & 0x01) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_RIGHTSTICK, (data[15] & 0x02) ? SDL_PRESSED : SDL_RELEASED); } - } /* @@ -813,8 +870,7 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons16(SDL_Joystick *joystick, SDL_Driver * Xbox One Elite Series 2 with firmware 5.11.3112 uses a 19 byte packet with BACK and GUIDE buttons in byte 15 * Xbox Series X with firmware 5.5.2641 uses a 17 byte packet with BACK and GUIDE buttons in byte 15, and SHARE button in byte 17 */ -static void -HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) { if (ctx->last_state[14] != data[14]) { SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_A, (data[14] & 0x01) ? SDL_PRESSED : SDL_RELEASED); @@ -846,7 +902,7 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXb P3: 0x04 (A) P1: 0x01 (B) P4: 0x08 (X) P2: 0x02 (Y) */ - if (ctx->has_paddles && (size == 39 || size == 55)) { + if (ctx->has_paddles && (size == 20 || size == 39 || size == 55)) { int paddle_index; int button1_bit; int button2_bit; @@ -862,7 +918,7 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXb button3_bit = 0x04; button4_bit = 0x08; paddles_mapped = (data[35] != 0); - } else /* if (size == 39) */ { + } else if (size == 39) { /* Updated firmware for the Xbox Elite Series 2 controller */ paddle_index = 17; button1_bit = 0x01; @@ -870,16 +926,23 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXb button3_bit = 0x04; button4_bit = 0x08; paddles_mapped = (data[19] != 0); + } else /* if (size == 20) */ { + /* Updated firmware for the Xbox Elite Series 2 controller (5.13+) */ + paddle_index = 19; + button1_bit = 0x01; + button2_bit = 0x02; + button3_bit = 0x04; + button4_bit = 0x08; + paddles_mapped = (data[17] != 0); } #ifdef DEBUG_XBOX_PROTOCOL SDL_Log(">>> Paddles: %d,%d,%d,%d mapped = %s\n", - (data[paddle_index] & button1_bit) ? 1 : 0, - (data[paddle_index] & button2_bit) ? 1 : 0, - (data[paddle_index] & button3_bit) ? 1 : 0, - (data[paddle_index] & button4_bit) ? 1 : 0, - paddles_mapped ? "TRUE" : "FALSE" - ); + (data[paddle_index] & button1_bit) ? 1 : 0, + (data[paddle_index] & button2_bit) ? 1 : 0, + (data[paddle_index] & button3_bit) ? 1 : 0, + (data[paddle_index] & button4_bit) ? 1 : 0, + paddles_mapped ? "TRUE" : "FALSE"); #endif if (paddles_mapped) { @@ -887,18 +950,18 @@ HIDAPI_DriverXboxOneBluetooth_HandleButtons(SDL_Joystick *joystick, SDL_DriverXb data[paddle_index] = 0; } - if (ctx->last_state[paddle_index] != data[paddle_index]) { + if (ctx->last_paddle_state != data[paddle_index]) { int nButton = SDL_CONTROLLER_BUTTON_MISC1; /* Next available button */ SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button1_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button2_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button3_bit) ? SDL_PRESSED : SDL_RELEASED); SDL_PrivateJoystickButton(joystick, nButton++, (data[paddle_index] & button4_bit) ? SDL_PRESSED : SDL_RELEASED); + ctx->last_paddle_state = data[paddle_index]; } } } -static void -HIDAPI_DriverXboxOneBluetooth_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOneBluetooth_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) { Sint16 axis; @@ -958,39 +1021,37 @@ HIDAPI_DriverXboxOneBluetooth_HandleStatePacket(SDL_Joystick *joystick, SDL_Driv SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_DPAD_LEFT, dpad_left); } - axis = ((int)SDL_SwapLE16(*(Sint16*)(&data[9])) * 64) - 32768; + axis = ((int)SDL_SwapLE16(*(Sint16 *)(&data[9])) * 64) - 32768; if (axis == 32704) { axis = 32767; } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERLEFT, axis); - axis = ((int)SDL_SwapLE16(*(Sint16*)(&data[11])) * 64) - 32768; + axis = ((int)SDL_SwapLE16(*(Sint16 *)(&data[11])) * 64) - 32768; if (axis == 32704) { axis = 32767; } SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_TRIGGERRIGHT, axis); - axis = (int)SDL_SwapLE16(*(Uint16*)(&data[1])) - 0x8000; + axis = (int)SDL_SwapLE16(*(Uint16 *)(&data[1])) - 0x8000; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis); - axis = (int)SDL_SwapLE16(*(Uint16*)(&data[3])) - 0x8000; + axis = (int)SDL_SwapLE16(*(Uint16 *)(&data[3])) - 0x8000; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTY, axis); - axis = (int)SDL_SwapLE16(*(Uint16*)(&data[5])) - 0x8000; + axis = (int)SDL_SwapLE16(*(Uint16 *)(&data[5])) - 0x8000; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTX, axis); - axis = (int)SDL_SwapLE16(*(Uint16*)(&data[7])) - 0x8000; + axis = (int)SDL_SwapLE16(*(Uint16 *)(&data[7])) - 0x8000; SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis); SDL_memcpy(ctx->last_state, data, SDL_min(size, sizeof(ctx->last_state))); } -static void -HIDAPI_DriverXboxOneBluetooth_HandleGuidePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOneBluetooth_HandleGuidePacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, const Uint8 *data, int size) { ctx->has_guide_packet = SDL_TRUE; SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data[1] & 0x01) ? SDL_PRESSED : SDL_RELEASED); } -static void -HIDAPI_DriverXboxOneBluetooth_HandleBatteryPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOneBluetooth_HandleBatteryPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, const Uint8 *data, int size) { Uint8 flags = data[1]; SDL_bool on_usb = (((flags & 0x0C) >> 2) == 0); @@ -1014,14 +1075,13 @@ HIDAPI_DriverXboxOneBluetooth_HandleBatteryPacket(SDL_Joystick *joystick, SDL_Dr } #ifdef SET_SERIAL_AFTER_OPEN -static void -HIDAPI_DriverXboxOne_HandleSerialIDPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) +static void HIDAPI_DriverXboxOne_HandleSerialIDPacket(SDL_Joystick *joystick, SDL_DriverXboxOne_Context *ctx, Uint8 *data, int size) { - char serial[ 29 ]; + char serial[29]; int i; for (i = 0; i < 14; ++i) { - SDL_uitoa( data[6 + i], &serial[i * 2], 16 ); + SDL_uitoa(data[6 + i], &serial[i * 2], 16); } serial[i * 2] = '\0'; @@ -1034,12 +1094,10 @@ HIDAPI_DriverXboxOne_HandleSerialIDPacket(SDL_Joystick *joystick, SDL_DriverXbox } #endif /* SET_SERIAL_AFTER_OPEN */ -static SDL_bool -HIDAPI_DriverXboxOne_UpdateInitState(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) +static SDL_bool HIDAPI_DriverXboxOne_UpdateInitState(SDL_HIDAPI_Device *device, SDL_DriverXboxOne_Context *ctx) { SDL_XboxOneInitState prev_state; - do - { + do { prev_state = ctx->init_state; switch (ctx->init_state) { @@ -1084,8 +1142,7 @@ HIDAPI_DriverXboxOne_UpdateInitState(SDL_HIDAPI_Device *device, SDL_DriverXboxOn return SDL_TRUE; } -static SDL_bool -HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; SDL_Joystick *joystick = NULL; @@ -1189,6 +1246,12 @@ HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device) } HIDAPI_DriverXboxOne_HandleModePacket(joystick, ctx, data, size); break; + case 0x0C: + if (!joystick) { + break; + } + HIDAPI_DriverXboxOne_HandleUnmappedStatePacket(joystick, ctx, data, size); + break; case 0x1E: /* If the packet starts with this: 0x1E 0x30 0x07 0x10 0x04 0x00 @@ -1253,11 +1316,10 @@ HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device) /* Read error, device is disconnected */ HIDAPI_JoystickDisconnected(device, device->joysticks[0]); } - return (size >= 0); + return size >= 0; } -static void -HIDAPI_DriverXboxOne_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) +static void HIDAPI_DriverXboxOne_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystick) { SDL_DriverXboxOne_Context *ctx = (SDL_DriverXboxOne_Context *)device->context; @@ -1265,13 +1327,11 @@ HIDAPI_DriverXboxOne_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys SDL_HomeLEDHintChanged, ctx); } -static void -HIDAPI_DriverXboxOne_FreeDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DriverXboxOne_FreeDevice(SDL_HIDAPI_Device *device) { } -SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXboxOne = -{ +SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXboxOne = { SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE, SDL_TRUE, HIDAPI_DriverXboxOne_RegisterHints, diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 2ed4aee863cf7..7bc52305e6a82 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -71,6 +71,9 @@ static SDL_HIDAPI_DeviceDriver *SDL_HIDAPI_drivers[] = { #ifdef SDL_JOYSTICK_HIDAPI_STEAM &SDL_HIDAPI_DriverSteam, #endif +#ifdef SDL_JOYSTICK_HIDAPI_STEAMDECK + &SDL_HIDAPI_DriverSteamDeck, +#endif #ifdef SDL_JOYSTICK_HIDAPI_SWITCH &SDL_HIDAPI_DriverNintendoClassic, &SDL_HIDAPI_DriverJoyCons, @@ -91,35 +94,126 @@ static int SDL_HIDAPI_numdrivers = 0; static SDL_SpinLock SDL_HIDAPI_spinlock; static SDL_bool SDL_HIDAPI_hints_changed = SDL_FALSE; static Uint32 SDL_HIDAPI_change_count = 0; -static SDL_HIDAPI_Device *SDL_HIDAPI_devices; +static SDL_HIDAPI_Device *SDL_HIDAPI_devices SDL_GUARDED_BY(SDL_joystick_lock); +static char SDL_HIDAPI_device_magic; static int SDL_HIDAPI_numjoysticks = 0; static SDL_bool SDL_HIDAPI_combine_joycons = SDL_TRUE; static SDL_bool initialized = SDL_FALSE; static SDL_bool shutting_down = SDL_FALSE; -void -HIDAPI_DumpPacket(const char *prefix, const Uint8 *data, int size) +static char *HIDAPI_ConvertString(const wchar_t *wide_string) +{ + char *string = NULL; + + if (wide_string) { + string = SDL_iconv_string("UTF-8", "WCHAR_T", (char *)wide_string, (SDL_wcslen(wide_string) + 1) * sizeof(wchar_t)); + if (!string) { + switch (sizeof(wchar_t)) { + case 2: + string = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)wide_string, (SDL_wcslen(wide_string) + 1) * sizeof(wchar_t)); + break; + case 4: + string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char *)wide_string, (SDL_wcslen(wide_string) + 1) * sizeof(wchar_t)); + break; + } + } + } + return string; +} + +void HIDAPI_DumpPacket(const char *prefix, const Uint8 *data, int size) { int i; char *buffer; - size_t length = SDL_strlen(prefix) + 11*(USB_PACKET_LENGTH/8) + (5*USB_PACKET_LENGTH*2) + 1 + 1; + size_t length = SDL_strlen(prefix) + 11 * (USB_PACKET_LENGTH / 8) + (5 * USB_PACKET_LENGTH * 2) + 1 + 1; int start = 0, amount = size; + size_t current_len; buffer = (char *)SDL_malloc(length); - SDL_snprintf(buffer, length, prefix, size); - for (i = start; i < start+amount; ++i) { + current_len = SDL_snprintf(buffer, length, prefix, size); + for (i = start; i < start + amount; ++i) { if ((i % 8) == 0) { - SDL_snprintf(&buffer[SDL_strlen(buffer)], length - SDL_strlen(buffer), "\n%.2d: ", i); + current_len += SDL_snprintf(&buffer[current_len], length - current_len, "\n%.2d: ", i); } - SDL_snprintf(&buffer[SDL_strlen(buffer)], length - SDL_strlen(buffer), " 0x%.2x", data[i]); + current_len += SDL_snprintf(&buffer[current_len], length - current_len, " 0x%.2x", data[i]); } SDL_strlcat(buffer, "\n", length); SDL_Log("%s", buffer); SDL_free(buffer); } -float -HIDAPI_RemapVal(float val, float val_min, float val_max, float output_min, float output_max) +SDL_bool HIDAPI_SupportsPlaystationDetection(Uint16 vendor, Uint16 product) +{ + /* If we already know the controller is a different type, don't try to detect it. + * This fixes a hang with the HORIPAD for Nintendo Switch (0x0f0d/0x00c1) + */ + if (SDL_GetJoystickGameControllerTypeFromVIDPID(vendor, product, NULL, SDL_FALSE) != SDL_CONTROLLER_TYPE_UNKNOWN) { + return SDL_FALSE; + } + + switch (vendor) { + case USB_VENDOR_DRAGONRISE: + return SDL_TRUE; + case USB_VENDOR_HORI: + return SDL_TRUE; + case USB_VENDOR_LOGITECH: + /* Most Logitech devices are not PlayStation controllers, and some of them + * lock up or reset when we send them the Sony third-party query feature + * report, so don't include that vendor here. Instead add devices as + * appropriate to controller_list.h + */ + return SDL_FALSE; + case USB_VENDOR_MADCATZ: + if (product == USB_PRODUCT_MADCATZ_SAITEK_SIDE_PANEL_CONTROL_DECK) { + /* This is not a Playstation compatible device */ + return SDL_FALSE; + } + return SDL_TRUE; + case USB_VENDOR_MAYFLASH: + return SDL_TRUE; + case USB_VENDOR_NACON: + case USB_VENDOR_NACON_ALT: + return SDL_TRUE; + case USB_VENDOR_PDP: + return SDL_TRUE; + case USB_VENDOR_POWERA: + return SDL_TRUE; + case USB_VENDOR_POWERA_ALT: + return SDL_TRUE; + case USB_VENDOR_QANBA: + return SDL_TRUE; + case USB_VENDOR_RAZER: + /* Most Razer devices are not PlayStation controllers, and some of them + * lock up or reset when we send them the Sony third-party query feature + * report, so don't include that vendor here. Instead add devices as + * appropriate to controller_list.h + * + * Reference: https://github.com/libsdl-org/SDL/issues/6733 + * https://github.com/libsdl-org/SDL/issues/6799 + */ + return SDL_FALSE; + case USB_VENDOR_SHANWAN: + return SDL_TRUE; + case USB_VENDOR_SHANWAN_ALT: + return SDL_TRUE; + case USB_VENDOR_THRUSTMASTER: + /* Most of these are wheels, don't have the full set of effects, and + * at least in the case of the T248 and T300 RS, the hid-tmff2 driver + * puts them in a non-standard report mode and they can't be read. + * + * If these should use the HIDAPI driver, add them to controller_list.h + */ + return SDL_FALSE; + case USB_VENDOR_ZEROPLUS: + return SDL_TRUE; + case 0x7545 /* SZ-MYPOWER */: + return SDL_TRUE; + default: + return SDL_FALSE; + } +} + +float HIDAPI_RemapVal(float val, float val_min, float val_max, float output_min, float output_max) { return output_min + (output_max - output_min) * (val - val_min) / (val_max - val_min); } @@ -127,12 +221,11 @@ HIDAPI_RemapVal(float val, float val_min, float val_max, float output_min, float static void HIDAPI_UpdateDeviceList(void); static void HIDAPI_JoystickClose(SDL_Joystick *joystick); -static SDL_GameControllerType -SDL_GetJoystickGameControllerProtocol(const char *name, Uint16 vendor, Uint16 product, int interface_number, int interface_class, int interface_subclass, int interface_protocol) +static SDL_GameControllerType SDL_GetJoystickGameControllerProtocol(const char *name, Uint16 vendor, Uint16 product, int interface_number, int interface_class, int interface_subclass, int interface_protocol) { static const int LIBUSB_CLASS_VENDOR_SPEC = 0xFF; static const int XB360_IFACE_SUBCLASS = 93; - static const int XB360_IFACE_PROTOCOL = 1; /* Wired */ + static const int XB360_IFACE_PROTOCOL = 1; /* Wired */ static const int XB360W_IFACE_PROTOCOL = 129; /* Wireless */ static const int XBONE_IFACE_SUBCLASS = 71; static const int XBONE_IFACE_PROTOCOL = 208; @@ -170,6 +263,8 @@ SDL_GetJoystickGameControllerProtocol(const char *name, Uint16 vendor, Uint16 pr 0x20d6, /* PowerA */ 0x24c6, /* PowerA */ 0x2c22, /* Qanba */ + 0x2dc8, /* 8BitDo */ + 0x9886, /* ASTRO Gaming */ }; int i; @@ -187,15 +282,20 @@ SDL_GetJoystickGameControllerProtocol(const char *name, Uint16 vendor, Uint16 pr interface_protocol == XBONE_IFACE_PROTOCOL) { static const int SUPPORTED_VENDORS[] = { + 0x03f0, /* HP */ + 0x044f, /* Thrustmaster */ 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ + 0x0b05, /* ASUS */ 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ + 0x10f5, /* Turtle Beach */ 0x1532, /* Razer */ 0x20d6, /* PowerA */ 0x24c6, /* PowerA */ 0x2dc8, /* 8BitDo */ 0x2e24, /* Hyperkin */ + 0x3537, /* GameSir */ }; int i; @@ -213,8 +313,7 @@ SDL_GetJoystickGameControllerProtocol(const char *name, Uint16 vendor, Uint16 pr return type; } -static SDL_bool -HIDAPI_IsDeviceSupported(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) +static SDL_bool HIDAPI_IsDeviceSupported(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) { int i; SDL_GameControllerType type = SDL_GetJoystickGameControllerProtocol(name, vendor_id, product_id, -1, 0, 0, 0); @@ -228,8 +327,7 @@ HIDAPI_IsDeviceSupported(Uint16 vendor_id, Uint16 product_id, Uint16 version, co return SDL_FALSE; } -static SDL_HIDAPI_DeviceDriver * -HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) +static SDL_HIDAPI_DeviceDriver *HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) { const Uint16 USAGE_PAGE_GENERIC_DESKTOP = 0x0001; const Uint16 USAGE_JOYSTICK = 0x0004; @@ -263,11 +361,12 @@ HIDAPI_GetDeviceDriver(SDL_HIDAPI_Device *device) return NULL; } -static SDL_HIDAPI_Device * -HIDAPI_GetDeviceByIndex(int device_index, SDL_JoystickID *pJoystickID) +static SDL_HIDAPI_Device *HIDAPI_GetDeviceByIndex(int device_index, SDL_JoystickID *pJoystickID) { SDL_HIDAPI_Device *device; + SDL_AssertJoysticksLocked(); + for (device = SDL_HIDAPI_devices; device; device = device->next) { if (device->parent) { continue; @@ -285,11 +384,12 @@ HIDAPI_GetDeviceByIndex(int device_index, SDL_JoystickID *pJoystickID) return NULL; } -static SDL_HIDAPI_Device * -HIDAPI_GetJoystickByInfo(const char *path, Uint16 vendor_id, Uint16 product_id) +static SDL_HIDAPI_Device *HIDAPI_GetJoystickByInfo(const char *path, Uint16 vendor_id, Uint16 product_id) { SDL_HIDAPI_Device *device; + SDL_AssertJoysticksLocked(); + for (device = SDL_HIDAPI_devices; device; device = device->next) { if (device->vendor_id == vendor_id && device->product_id == product_id && SDL_strcmp(device->path, path) == 0) { @@ -299,8 +399,7 @@ HIDAPI_GetJoystickByInfo(const char *path, Uint16 vendor_id, Uint16 product_id) return device; } -static void -HIDAPI_CleanupDeviceDriver(SDL_HIDAPI_Device *device) +static void HIDAPI_CleanupDeviceDriver(SDL_HIDAPI_Device *device) { if (!device->driver) { return; /* Already cleaned up */ @@ -329,8 +428,7 @@ HIDAPI_CleanupDeviceDriver(SDL_HIDAPI_Device *device) SDL_UnlockMutex(device->dev_lock); } -static void -HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, SDL_bool *removed) +static void HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, SDL_bool *removed) SDL_NO_THREAD_SAFETY_ANALYSIS /* We unlock the joystick lock to be able to open the HID device on Android */ { *removed = SDL_FALSE; @@ -362,47 +460,64 @@ HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, SDL_bool *removed) if (HIDAPI_GetDeviceDriver(device)) { /* We might have a device driver for this device, try opening it and see */ if (device->num_children == 0) { + SDL_hid_device *dev; + + /* Wait a little bit for the device to initialize */ + SDL_Delay(10); + +#ifdef __ANDROID__ /* On Android we need to leave joysticks unlocked because it calls * out to the main thread for permissions and the main thread can * be in the process of handling controller input. * * See https://github.com/libsdl-org/SDL/issues/6347 for details */ - int lock_count = 0; - SDL_HIDAPI_Device *curr; - SDL_hid_device *dev; - char *path = SDL_strdup(device->path); - - /* Wait a little bit for the device to initialize */ - SDL_Delay(10); - - SDL_AssertJoysticksLocked(); - while (SDL_JoysticksLocked()) { - ++lock_count; - SDL_UnlockJoysticks(); - } + { + SDL_HIDAPI_Device *curr; + int lock_count = 0; + char *path = SDL_strdup(device->path); + + SDL_AssertJoysticksLocked(); + while (SDL_JoysticksLocked()) { + ++lock_count; + SDL_UnlockJoysticks(); + } - dev = SDL_hid_open_path(path, 0); + dev = SDL_hid_open_path(path, 0); - while (lock_count > 0) { - --lock_count; - SDL_LockJoysticks(); - } - SDL_free(path); + while (lock_count > 0) { + --lock_count; + SDL_LockJoysticks(); + } + SDL_free(path); - /* Make sure the device didn't get removed while opening the HID path */ - for (curr = SDL_HIDAPI_devices; curr && curr != device; curr = curr->next) { - continue; - } - if (!curr) { - *removed = SDL_TRUE; - if (dev) { - SDL_hid_close(dev); + /* Make sure the device didn't get removed while opening the HID path */ + for (curr = SDL_HIDAPI_devices; curr && curr != device; curr = curr->next) { + continue; + } + if (curr == NULL) { + *removed = SDL_TRUE; + if (dev) { + SDL_hid_close(dev); + } + return; } - return; } +#else + /* On other platforms we want to keep the lock so other threads wait for + * us to finish opening the controller before checking to see whether the + * HIDAPI driver is handling the device. + * + * On Windows, for example, the main thread can be enumerating DirectInput + * devices while the Windows.Gaming.Input thread is calling back with a new + * controller available. + * + * See https://github.com/libsdl-org/SDL/issues/7304 for details. + */ + dev = SDL_hid_open_path(device->path, 0); +#endif - if (!dev) { + if (dev == NULL) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, "HIDAPI_SetupDeviceDriver() couldn't open %s: %s\n", device->path, SDL_GetError()); @@ -428,13 +543,14 @@ HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, SDL_bool *removed) } } -static void -SDL_HIDAPI_UpdateDrivers(void) +static void SDL_HIDAPI_UpdateDrivers(void) { int i; SDL_HIDAPI_Device *device; SDL_bool removed; + SDL_AssertJoysticksLocked(); + SDL_HIDAPI_numdrivers = 0; for (i = 0; i < SDL_arraysize(SDL_HIDAPI_drivers); ++i) { SDL_HIDAPI_DeviceDriver *driver = SDL_HIDAPI_drivers[i]; @@ -455,8 +571,7 @@ SDL_HIDAPI_UpdateDrivers(void) } while (removed); } -static void SDLCALL -SDL_HIDAPIDriverHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_HIDAPIDriverHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { if (SDL_strcmp(name, SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS) == 0) { SDL_HIDAPI_combine_joycons = SDL_GetStringBoolean(hint, SDL_TRUE); @@ -465,8 +580,7 @@ SDL_HIDAPIDriverHintChanged(void *userdata, const char *name, const char *oldVal SDL_HIDAPI_change_count = 0; } -static int -HIDAPI_JoystickInit(void) +static int HIDAPI_JoystickInit(void) { int i; @@ -514,10 +628,9 @@ HIDAPI_JoystickInit(void) return 0; } -static SDL_bool -HIDAPI_AddJoystickInstanceToDevice(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) +static SDL_bool HIDAPI_AddJoystickInstanceToDevice(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) { - SDL_JoystickID *joysticks = (SDL_JoystickID *)SDL_realloc(device->joysticks, (device->num_joysticks + 1)*sizeof(*device->joysticks)); + SDL_JoystickID *joysticks = (SDL_JoystickID *)SDL_realloc(device->joysticks, (device->num_joysticks + 1) * sizeof(*device->joysticks)); if (!joysticks) { return SDL_FALSE; } @@ -527,15 +640,14 @@ HIDAPI_AddJoystickInstanceToDevice(SDL_HIDAPI_Device *device, SDL_JoystickID joy return SDL_TRUE; } -static SDL_bool -HIDAPI_DelJoystickInstanceFromDevice(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) +static SDL_bool HIDAPI_DelJoystickInstanceFromDevice(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) { int i, size; for (i = 0; i < device->num_joysticks; ++i) { if (device->joysticks[i] == joystickID) { size = (device->num_joysticks - i - 1) * sizeof(SDL_JoystickID); - SDL_memmove(&device->joysticks[i], &device->joysticks[i+1], size); + SDL_memmove(&device->joysticks[i], &device->joysticks[i + 1], size); --device->num_joysticks; if (device->num_joysticks == 0) { SDL_free(device->joysticks); @@ -547,8 +659,7 @@ HIDAPI_DelJoystickInstanceFromDevice(SDL_HIDAPI_Device *device, SDL_JoystickID j return SDL_FALSE; } -static SDL_bool -HIDAPI_JoystickInstanceIsUnique(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) +static SDL_bool HIDAPI_JoystickInstanceIsUnique(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) { if (device->parent && device->num_joysticks == 1 && device->parent->num_joysticks == 1 && device->joysticks[0] == device->parent->joysticks[0]) { @@ -557,8 +668,7 @@ HIDAPI_JoystickInstanceIsUnique(SDL_HIDAPI_Device *device, SDL_JoystickID joysti return SDL_TRUE; } -void -HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name) +void HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name) { if (name && *name && SDL_strcmp(name, device->name) != 0) { SDL_free(device->name); @@ -567,27 +677,80 @@ HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name) } } -void -HIDAPI_SetDeviceProduct(SDL_HIDAPI_Device *device, Uint16 product_id) +void HIDAPI_SetDeviceProduct(SDL_HIDAPI_Device *device, Uint16 vendor_id, Uint16 product_id) { /* Don't set the device product ID directly, or we'll constantly re-enumerate this device */ - SDL_SetJoystickGUIDProduct(&device->guid, product_id); + device->guid = SDL_CreateJoystickGUID(device->guid.data[0], vendor_id, product_id, device->version, device->manufacturer_string, device->product_string, 'h', 0); +} + +static void HIDAPI_UpdateJoystickSerial(SDL_HIDAPI_Device *device) +{ + int i; + + for (i = 0; i < device->num_joysticks; ++i) { + SDL_Joystick *joystick = SDL_JoystickFromInstanceID(device->joysticks[i]); + if (joystick && device->serial) { + SDL_free(joystick->serial); + joystick->serial = SDL_strdup(device->serial); + } + } } -void -HIDAPI_SetDeviceSerial(SDL_HIDAPI_Device *device, const char *serial) +static SDL_bool HIDAPI_SerialIsEmpty(SDL_HIDAPI_Device *device) +{ + SDL_bool all_zeroes = SDL_TRUE; + + if (device->serial) { + const char *serial = device->serial; + for (serial = device->serial; *serial; ++serial) { + if (*serial != '0') { + all_zeroes = SDL_FALSE; + break; + } + } + } + return all_zeroes; +} + +void HIDAPI_SetDeviceSerial(SDL_HIDAPI_Device *device, const char *serial) { if (serial && *serial && (!device->serial || SDL_strcmp(serial, device->serial) != 0)) { SDL_free(device->serial); device->serial = SDL_strdup(serial); + HIDAPI_UpdateJoystickSerial(device); + } +} + +static int wcstrcmp(const wchar_t *str1, const char *str2) +{ + int result; + + while (1) { + result = (*str1 - *str2); + if (result != 0 || *str1 == 0) { + break; + } + ++str1; + ++str2; + } + return result; +} + +static void HIDAPI_SetDeviceSerialW(SDL_HIDAPI_Device *device, const wchar_t *serial) +{ + if (serial && *serial && (!device->serial || wcstrcmp(serial, device->serial) != 0)) { + SDL_free(device->serial); + device->serial = HIDAPI_ConvertString(serial); + HIDAPI_UpdateJoystickSerial(device); } } -SDL_bool -HIDAPI_HasConnectedUSBDevice(const char *serial) +SDL_bool HIDAPI_HasConnectedUSBDevice(const char *serial) { SDL_HIDAPI_Device *device; + SDL_AssertJoysticksLocked(); + if (!serial) { return SDL_FALSE; } @@ -608,11 +771,12 @@ HIDAPI_HasConnectedUSBDevice(const char *serial) return SDL_FALSE; } -void -HIDAPI_DisconnectBluetoothDevice(const char *serial) +void HIDAPI_DisconnectBluetoothDevice(const char *serial) { SDL_HIDAPI_Device *device; + SDL_AssertJoysticksLocked(); + if (!serial) { return; } @@ -634,15 +798,16 @@ HIDAPI_DisconnectBluetoothDevice(const char *serial) } } -SDL_bool -HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID) +SDL_bool HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID) { int i, j; SDL_JoystickID joystickID; + SDL_AssertJoysticksLocked(); + for (i = 0; i < device->num_children; ++i) { SDL_HIDAPI_Device *child = device->children[i]; - for (j = child->num_joysticks; j--; ) { + for (j = child->num_joysticks; j--;) { HIDAPI_JoystickDisconnected(child, child->joysticks[j]); } } @@ -657,19 +822,19 @@ HIDAPI_JoystickConnected(SDL_HIDAPI_Device *device, SDL_JoystickID *pJoystickID) ++SDL_HIDAPI_numjoysticks; - SDL_PrivateJoystickAdded(joystickID); - if (pJoystickID) { *pJoystickID = joystickID; } + + SDL_PrivateJoystickAdded(joystickID); + return SDL_TRUE; } -void -HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) +void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID) { int i, j; - + SDL_LockJoysticks(); if (!HIDAPI_JoystickInstanceIsUnique(device, joystickID)) { @@ -705,52 +870,29 @@ HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joystickID SDL_UnlockJoysticks(); } -static int -HIDAPI_JoystickGetCount(void) +static int HIDAPI_JoystickGetCount(void) { return SDL_HIDAPI_numjoysticks; } -static char * -HIDAPI_ConvertString(const wchar_t *wide_string) -{ - char *string = NULL; - - if (wide_string) { - string = SDL_iconv_string("UTF-8", "WCHAR_T", (char*)wide_string, (SDL_wcslen(wide_string)+1)*sizeof(wchar_t)); - if (!string) { - switch (sizeof(wchar_t)) { - case 2: - string = SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char*)wide_string, (SDL_wcslen(wide_string)+1)*sizeof(wchar_t)); - break; - case 4: - string = SDL_iconv_string("UTF-8", "UCS-4-INTERNAL", (char*)wide_string, (SDL_wcslen(wide_string)+1)*sizeof(wchar_t)); - break; - } - } - } - return string; -} - -static SDL_HIDAPI_Device * -HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_HIDAPI_Device **children) +static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_HIDAPI_Device **children) { SDL_HIDAPI_Device *device; SDL_HIDAPI_Device *curr, *last = NULL; SDL_bool removed; + SDL_AssertJoysticksLocked(); + for (curr = SDL_HIDAPI_devices, last = NULL; curr; last = curr, curr = curr->next) { - continue; } device = (SDL_HIDAPI_Device *)SDL_calloc(1, sizeof(*device)); if (!device) { return NULL; } - device->path = SDL_strdup(info->path); - if (!device->path) { - SDL_free(device); - return NULL; + device->magic = &SDL_HIDAPI_device_magic; + if (info->path) { + device->path = SDL_strdup(info->path); } device->seen = SDL_TRUE; device->vendor_id = info->vendor_id; @@ -766,18 +908,11 @@ HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_H /* Need the device name before getting the driver to know whether to ignore this device */ { - char *manufacturer_string = HIDAPI_ConvertString(info->manufacturer_string); - char *product_string = HIDAPI_ConvertString(info->product_string); char *serial_number = HIDAPI_ConvertString(info->serial_number); - device->name = SDL_CreateJoystickName(device->vendor_id, device->product_id, manufacturer_string, product_string); - - if (manufacturer_string) { - SDL_free(manufacturer_string); - } - if (product_string) { - SDL_free(product_string); - } + device->manufacturer_string = HIDAPI_ConvertString(info->manufacturer_string); + device->product_string = HIDAPI_ConvertString(info->product_string); + device->name = SDL_CreateJoystickName(device->vendor_id, device->product_id, device->manufacturer_string, device->product_string); if (serial_number && *serial_number) { device->serial = serial_number; @@ -786,6 +921,8 @@ HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_H } if (!device->name) { + SDL_free(device->manufacturer_string); + SDL_free(device->product_string); SDL_free(device->serial); SDL_free(device->path); SDL_free(device); @@ -794,9 +931,10 @@ HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_H } /* FIXME: Is there any way to tell whether this is a Bluetooth device? */ - device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, device->vendor_id, device->product_id, device->version, device->name, 'h', 0); + device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, device->vendor_id, device->product_id, device->version, device->manufacturer_string, device->product_string, 'h', 0); device->joystick_type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; device->type = SDL_GetJoystickGameControllerProtocol(device->name, device->vendor_id, device->product_id, device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol); + device->steam_virtual_gamepad_slot = -1; if (num_children > 0) { int i; @@ -822,21 +960,25 @@ HIDAPI_AddDevice(const struct SDL_hid_device_info *info, int num_children, SDL_H } #ifdef DEBUG_HIDAPI - SDL_Log("Added HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->version, device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage, device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED"); + SDL_Log("Added HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->version, + device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage, + device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED"); #endif return device; } - -static void -HIDAPI_DelDevice(SDL_HIDAPI_Device *device) +static void HIDAPI_DelDevice(SDL_HIDAPI_Device *device) { SDL_HIDAPI_Device *curr, *last; int i; + SDL_AssertJoysticksLocked(); + #ifdef DEBUG_HIDAPI - SDL_Log("Removing HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->version, device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage, device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED"); + SDL_Log("Removing HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->version, + device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage, + device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED"); #endif for (curr = SDL_HIDAPI_devices, last = NULL; curr; last = curr, curr = curr->next) { @@ -858,7 +1000,10 @@ HIDAPI_DelDevice(SDL_HIDAPI_Device *device) device->children[i]->parent = NULL; } + device->magic = NULL; SDL_DestroyMutex(device->dev_lock); + SDL_free(device->manufacturer_string); + SDL_free(device->product_string); SDL_free(device->serial); SDL_free(device->name); SDL_free(device->path); @@ -869,12 +1014,13 @@ HIDAPI_DelDevice(SDL_HIDAPI_Device *device) } } -static SDL_bool -HIDAPI_CreateCombinedJoyCons() +static SDL_bool HIDAPI_CreateCombinedJoyCons(void) { SDL_HIDAPI_Device *device, *combined; SDL_HIDAPI_Device *joycons[2] = { NULL, NULL }; + SDL_AssertJoysticksLocked(); + if (!SDL_HIDAPI_combine_joycons) { return SDL_FALSE; } @@ -940,8 +1086,7 @@ HIDAPI_CreateCombinedJoyCons() return SDL_FALSE; } -static void -HIDAPI_UpdateDeviceList(void) +static void HIDAPI_UpdateDeviceList(void) { SDL_HIDAPI_Device *device; struct SDL_hid_device_info *devs, *info; @@ -969,6 +1114,11 @@ HIDAPI_UpdateDeviceList(void) device = HIDAPI_GetJoystickByInfo(info->path, info->vendor_id, info->product_id); if (device) { device->seen = SDL_TRUE; + + /* Check to see if the serial number is available now */ + if(HIDAPI_SerialIsEmpty(device)) { + HIDAPI_SetDeviceSerialW(device, info->serial_number); + } } else { HIDAPI_AddDevice(info, 0, NULL); } @@ -1011,14 +1161,12 @@ HIDAPI_UpdateDeviceList(void) /* See if we can create any combined Joy-Con controllers */ while (HIDAPI_CreateCombinedJoyCons()) { - continue; } SDL_UnlockJoysticks(); } -static SDL_bool -HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id, SDL_HIDAPI_Device *device) +static SDL_bool HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id, SDL_HIDAPI_Device *device) { if (vendor_id == device->vendor_id && product_id == device->product_id) { return SDL_TRUE; @@ -1037,7 +1185,7 @@ HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id, SDL_HIDAPI_Devi } /* If we're looking for an XInput controller, match it against any other Xbox controller */ - if (product_id == USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER) { + if (product_id == USB_PRODUCT_XBOX360_XUSB_CONTROLLER) { if (device->type == SDL_CONTROLLER_TYPE_XBOX360 || device->type == SDL_CONTROLLER_TYPE_XBOXONE) { return SDL_TRUE; } @@ -1054,8 +1202,7 @@ HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id, SDL_HIDAPI_Devi return SDL_FALSE; } -SDL_bool -HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type) +SDL_bool HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type) { SDL_HIDAPI_Device *device; SDL_bool result = SDL_FALSE; @@ -1085,8 +1232,7 @@ HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type) return result; } -SDL_bool -HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) +SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) { SDL_HIDAPI_Device *device; SDL_bool supported = SDL_FALSE; @@ -1098,8 +1244,8 @@ HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, cons } /* Only update the device list for devices we know might be supported. - If we did this for every device, it would hit the USB driver too hard and potentially - lock up the system. This won't catch devices that we support but can only detect using + If we did this for every device, it would hit the USB driver too hard and potentially + lock up the system. This won't catch devices that we support but can only detect using USB interface details, like Xbox controllers, but hopefully the device list update is responsive enough to catch those. */ @@ -1137,8 +1283,7 @@ HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, cons return result; } -SDL_JoystickType -HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) +SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) { SDL_HIDAPI_Device *device; SDL_JoystickType type = SDL_JOYSTICK_TYPE_UNKNOWN; @@ -1155,8 +1300,7 @@ HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) return type; } -SDL_GameControllerType -HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid) +SDL_GameControllerType HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid) { SDL_HIDAPI_Device *device; SDL_GameControllerType type = SDL_CONTROLLER_TYPE_UNKNOWN; @@ -1173,8 +1317,7 @@ HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid) return type; } -static void -HIDAPI_JoystickDetect(void) +static void HIDAPI_JoystickDetect(void) { if (SDL_AtomicTryLock(&SDL_HIDAPI_spinlock)) { Uint32 count = SDL_hid_device_change_count(); @@ -1186,11 +1329,12 @@ HIDAPI_JoystickDetect(void) } } -void -HIDAPI_UpdateDevices(void) +void HIDAPI_UpdateDevices(void) { SDL_HIDAPI_Device *device; + SDL_AssertJoysticksLocked(); + /* Update the devices, which may change connected joysticks and send events */ /* Prepare the existing device list */ @@ -1212,8 +1356,7 @@ HIDAPI_UpdateDevices(void) } } -static const char * -HIDAPI_JoystickGetDeviceName(int device_index) +static const char *HIDAPI_JoystickGetDeviceName(int device_index) { SDL_HIDAPI_Device *device; const char *name = NULL; @@ -1227,8 +1370,7 @@ HIDAPI_JoystickGetDeviceName(int device_index) return name; } -static const char * -HIDAPI_JoystickGetDevicePath(int device_index) +static const char *HIDAPI_JoystickGetDevicePath(int device_index) { SDL_HIDAPI_Device *device; const char *path = NULL; @@ -1242,8 +1384,18 @@ HIDAPI_JoystickGetDevicePath(int device_index) return path; } -static int -HIDAPI_JoystickGetDevicePlayerIndex(int device_index) +static int HIDAPI_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + SDL_HIDAPI_Device *device; + + device = HIDAPI_GetDeviceByIndex(device_index, NULL); + if (device) { + return device->steam_virtual_gamepad_slot; + } + return -1; +} + +static int HIDAPI_JoystickGetDevicePlayerIndex(int device_index) { SDL_HIDAPI_Device *device; SDL_JoystickID instance_id; @@ -1257,8 +1409,7 @@ HIDAPI_JoystickGetDevicePlayerIndex(int device_index) return player_index; } -static void -HIDAPI_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void HIDAPI_JoystickSetDevicePlayerIndex(int device_index, int player_index) { SDL_HIDAPI_Device *device; SDL_JoystickID instance_id; @@ -1269,8 +1420,7 @@ HIDAPI_JoystickSetDevicePlayerIndex(int device_index, int player_index) } } -static SDL_JoystickGUID -HIDAPI_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID HIDAPI_JoystickGetDeviceGUID(int device_index) { SDL_HIDAPI_Device *device; SDL_JoystickGUID guid; @@ -1285,21 +1435,21 @@ HIDAPI_JoystickGetDeviceGUID(int device_index) return guid; } -static SDL_JoystickID -HIDAPI_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID HIDAPI_JoystickGetDeviceInstanceID(int device_index) { SDL_JoystickID joystickID = -1; HIDAPI_GetDeviceByIndex(device_index, &joystickID); return joystickID; } -static int -HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) { SDL_JoystickID joystickID = -1; SDL_HIDAPI_Device *device = HIDAPI_GetDeviceByIndex(device_index, &joystickID); struct joystick_hwdata *hwdata; + SDL_AssertJoysticksLocked(); + if (!device || !device->driver) { /* This should never happen - validated before being called */ return SDL_SetError("Couldn't find HIDAPI device at index %d\n", device_index); @@ -1318,6 +1468,12 @@ HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) device->updating = SDL_FALSE; SDL_UnlockMutex(device->dev_lock); + /* UpdateDevice() may have called HIDAPI_JoystickDisconnected() if the device went away */ + if (device->num_joysticks == 0) { + SDL_free(hwdata); + return SDL_SetError("HIDAPI device disconnected while opening"); + } + if (!device->driver->OpenJoystick(device, joystick)) { /* The open failed, mark this device as disconnected and update devices */ HIDAPI_JoystickDisconnected(device, joystickID); @@ -1325,7 +1481,7 @@ HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) return -1; } - if (!joystick->serial && device->serial) { + if (device->serial) { joystick->serial = SDL_strdup(device->serial); } @@ -1333,14 +1489,25 @@ HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index) return 0; } -static int -HIDAPI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static SDL_bool HIDAPI_GetJoystickDevice(SDL_Joystick *joystick, SDL_HIDAPI_Device **device) { - int result; + SDL_AssertJoysticksLocked(); - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; + if (joystick && joystick->hwdata) { + *device = joystick->hwdata->device; + if (*device && (*device)->magic == &SDL_HIDAPI_device_magic && (*device)->driver != NULL) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + +static int HIDAPI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +{ + int result; + SDL_HIDAPI_Device *device = NULL; + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->RumbleJoystick(device, joystick, low_frequency_rumble, high_frequency_rumble); } else { result = SDL_SetError("Rumble failed, device disconnected"); @@ -1349,14 +1516,12 @@ HIDAPI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint1 return result; } -static int -HIDAPI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int HIDAPI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { int result; + SDL_HIDAPI_Device *device = NULL; - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; - + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->RumbleJoystickTriggers(device, joystick, left_rumble, right_rumble); } else { result = SDL_SetError("Rumble failed, device disconnected"); @@ -1365,28 +1530,24 @@ HIDAPI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 return result; } -static Uint32 -HIDAPI_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 HIDAPI_JoystickGetCapabilities(SDL_Joystick *joystick) { Uint32 result = 0; + SDL_HIDAPI_Device *device = NULL; - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; - + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->GetJoystickCapabilities(device, joystick); } return result; } -static int -HIDAPI_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int HIDAPI_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { int result; + SDL_HIDAPI_Device *device = NULL; - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; - + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->SetJoystickLED(device, joystick, red, green, blue); } else { result = SDL_SetError("SetLED failed, device disconnected"); @@ -1395,14 +1556,12 @@ HIDAPI_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue return result; } -static int -HIDAPI_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int HIDAPI_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { int result; + SDL_HIDAPI_Device *device = NULL; - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; - + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->SendJoystickEffect(device, joystick, data, size); } else { result = SDL_SetError("SendEffect failed, device disconnected"); @@ -1411,14 +1570,12 @@ HIDAPI_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) return result; } -static int -HIDAPI_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int HIDAPI_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { int result; + SDL_HIDAPI_Device *device = NULL; - if (joystick->hwdata) { - SDL_HIDAPI_Device *device = joystick->hwdata->device; - + if (HIDAPI_GetJoystickDevice(joystick, &device)) { result = device->driver->SetJoystickSensorsEnabled(device, joystick, enabled); } else { result = SDL_SetError("SetSensorsEnabled failed, device disconnected"); @@ -1427,15 +1584,15 @@ HIDAPI_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) return result; } -static void -HIDAPI_JoystickUpdate(SDL_Joystick *joystick) +static void HIDAPI_JoystickUpdate(SDL_Joystick *joystick) { /* This is handled in SDL_HIDAPI_UpdateDevices() */ } -static void -HIDAPI_JoystickClose(SDL_Joystick *joystick) +static void HIDAPI_JoystickClose(SDL_Joystick *joystick) SDL_NO_THREAD_SAFETY_ANALYSIS /* We unlock the device lock so rumble can complete */ { + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { SDL_HIDAPI_Device *device = joystick->hwdata->device; int i; @@ -1462,11 +1619,12 @@ HIDAPI_JoystickClose(SDL_Joystick *joystick) } } -static void -HIDAPI_JoystickQuit(void) +static void HIDAPI_JoystickQuit(void) { int i; + SDL_AssertJoysticksLocked(); + shutting_down = SDL_TRUE; SDL_HIDAPI_QuitRumble(); @@ -1504,19 +1662,18 @@ HIDAPI_JoystickQuit(void) initialized = SDL_FALSE; } -static SDL_bool -HIDAPI_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool HIDAPI_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_HIDAPI_JoystickDriver = -{ +SDL_JoystickDriver SDL_HIDAPI_JoystickDriver = { HIDAPI_JoystickInit, HIDAPI_JoystickGetCount, HIDAPI_JoystickDetect, HIDAPI_JoystickGetDeviceName, HIDAPI_JoystickGetDevicePath, + HIDAPI_JoystickGetDeviceSteamVirtualGamepadSlot, HIDAPI_JoystickGetDevicePlayerIndex, HIDAPI_JoystickSetDevicePlayerIndex, HIDAPI_JoystickGetDeviceGUID, diff --git a/src/joystick/hidapi/SDL_hidapijoystick_c.h b/src/joystick/hidapi/SDL_hidapijoystick_c.h index 4ebadede959f6..a46151594a33c 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick_c.h +++ b/src/joystick/hidapi/SDL_hidapijoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,7 +38,8 @@ #define SDL_JOYSTICK_HIDAPI_PS4 #define SDL_JOYSTICK_HIDAPI_PS5 #define SDL_JOYSTICK_HIDAPI_STADIA -#define SDL_JOYSTICK_HIDAPI_STEAM /* Simple support for BLE Steam Controller, hint is disabled by default */ +#define SDL_JOYSTICK_HIDAPI_STEAM /* Simple support for BLE Steam Controller, hint is disabled by default */ +#define SDL_JOYSTICK_HIDAPI_STEAMDECK #define SDL_JOYSTICK_HIDAPI_SWITCH #define SDL_JOYSTICK_HIDAPI_WII #define SDL_JOYSTICK_HIDAPI_XBOX360 @@ -46,24 +47,34 @@ #define SDL_JOYSTICK_HIDAPI_SHIELD /* Whether HIDAPI is enabled by default */ -#define SDL_HIDAPI_DEFAULT SDL_TRUE +#if defined(__ANDROID__) || \ + defined(__IPHONEOS__) || \ + defined(__TVOS__) +/* On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers, so we'll leave it off by default. */ +#define SDL_HIDAPI_DEFAULT SDL_FALSE +#else +#define SDL_HIDAPI_DEFAULT SDL_TRUE +#endif /* The maximum size of a USB packet for HID devices */ -#define USB_PACKET_LENGTH 64 +#define USB_PACKET_LENGTH 64 /* Forward declaration */ struct _SDL_HIDAPI_DeviceDriver; typedef struct _SDL_HIDAPI_Device { + const void *magic; char *name; + char *manufacturer_string; + char *product_string; char *path; Uint16 vendor_id; Uint16 product_id; Uint16 version; char *serial; SDL_JoystickGUID guid; - int interface_number; /* Available on Windows and Linux */ + int interface_number; /* Available on Windows and Linux */ int interface_class; int interface_subclass; int interface_protocol; @@ -72,6 +83,7 @@ typedef struct _SDL_HIDAPI_Device SDL_bool is_bluetooth; SDL_JoystickType joystick_type; SDL_GameControllerType type; + int steam_virtual_gamepad_slot; struct _SDL_HIDAPI_DeviceDriver *driver; void *context; @@ -118,7 +130,6 @@ typedef struct _SDL_HIDAPI_DeviceDriver } SDL_HIDAPI_DeviceDriver; - /* HIDAPI device support */ extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverCombined; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverGameCube; @@ -132,6 +143,7 @@ extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverPS5; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverShield; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverStadia; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteam; +extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSteamDeck; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverSwitch; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverWii; extern SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360; @@ -152,7 +164,7 @@ extern SDL_GameControllerType HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickG extern void HIDAPI_UpdateDevices(void); extern void HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name); -extern void HIDAPI_SetDeviceProduct(SDL_HIDAPI_Device *device, Uint16 product_id); +extern void HIDAPI_SetDeviceProduct(SDL_HIDAPI_Device *device, Uint16 vendor_id, Uint16 product_id); extern void HIDAPI_SetDeviceSerial(SDL_HIDAPI_Device *device, const char *serial); extern SDL_bool HIDAPI_HasConnectedUSBDevice(const char *serial); extern void HIDAPI_DisconnectBluetoothDevice(const char *serial); @@ -161,6 +173,8 @@ extern void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickI extern void HIDAPI_DumpPacket(const char *prefix, const Uint8 *data, int size); +extern SDL_bool HIDAPI_SupportsPlaystationDetection(Uint16 vendor, Uint16 product); + extern float HIDAPI_RemapVal(float val, float val_min, float val_max, float output_min, float output_max); #endif /* SDL_JOYSTICK_HIDAPI_H */ diff --git a/src/joystick/hidapi/steam/controller_constants.h b/src/joystick/hidapi/steam/controller_constants.h index d0d568851662f..ab4ac2ee15cc8 100644 --- a/src/joystick/hidapi/steam/controller_constants.h +++ b/src/joystick/hidapi/steam/controller_constants.h @@ -47,6 +47,8 @@ enum ValveControllerPID D0G_BLE_PID = 0x1105, D0G_BLE2_PID = 0x1106, D0GGLE_PID = 0x1142, + + JUPITER_PID = 0x1205, }; // This enum contains all of the messages exchanged between the host and the target (only add to this enum and never change the order) @@ -68,10 +70,11 @@ enum FeatureReportMessageIDs ID_SET_CONTROLLER_MODE = 0x8D, ID_LOAD_DEFAULT_SETTINGS = 0x8E, ID_TRIGGER_HAPTIC_PULSE = 0x8F, + ID_TURN_OFF_CONTROLLER = 0x9F, ID_GET_DEVICE_INFO = 0xA1, - + ID_CALIBRATE_TRACKPADS = 0xA7, ID_RESERVED_0 = 0xA8, ID_SET_SERIAL_NUMBER = 0xA9, @@ -99,6 +102,12 @@ enum FeatureReportMessageIDs ID_CHECK_GYRO_FW_LOAD = 0xC2, ID_CALIBRATE_ANALOG = 0xC3, ID_DONGLE_GET_CONNECTED_SLOTS = 0xC4, + + ID_RESET_IMU = 0xCE, + + // Deck only + ID_TRIGGER_HAPTIC_CMD = 0xEA, + ID_TRIGGER_RUMBLE_CMD = 0xEB, }; @@ -215,6 +224,32 @@ typedef enum IO_RAW_JOYSTICK_X, IO_RAW_JOYSTICK_Y, IO_GYRO_TILT_VEC, + IO_PRESSURE_LEFT_PAD, + IO_PRESSURE_RIGHT_PAD, + IO_PRESSURE_LEFT_BUMPER, + IO_PRESSURE_RIGHT_BUMPER, + IO_PRESSURE_LEFT_GRIP, + IO_PRESSURE_RIGHT_GRIP, + IO_ANALOG_LEFT_TRIGGER_THRESHOLD, + IO_ANALOG_RIGHT_TRIGGER_THRESHOLD, + IO_PRESSURE_RIGHT_PAD_THRESHOLD, + IO_PRESSURE_LEFT_PAD_THRESHOLD, + IO_PRESSURE_RIGHT_BUMPER_THRESHOLD, + IO_PRESSURE_LEFT_BUMPER_THRESHOLD, + IO_PRESSURE_RIGHT_GRIP_THRESHOLD, + IO_PRESSURE_LEFT_GRIP_THRESHOLD, + IO_PRESSURE_RIGHT_PAD_RAW, + IO_PRESSURE_LEFT_PAD_RAW, + IO_PRESSURE_RIGHT_BUMPER_RAW, + IO_PRESSURE_LEFT_BUMPER_RAW, + IO_PRESSURE_RIGHT_GRIP_RAW, + IO_PRESSURE_LEFT_GRIP_RAW, + IO_PRESSURE_RIGHT_GRIP2_THRESHOLD, + IO_PRESSURE_LEFT_GRIP2_THRESHOLD, + IO_PRESSURE_LEFT_GRIP2, + IO_PRESSURE_RIGHT_GRIP2, + IO_PRESSURE_RIGHT_GRIP2_RAW, + IO_PRESSURE_LEFT_GRIP2_RAW, IO_ANALOG_COUNT } AnalogIO; @@ -382,13 +417,15 @@ typedef enum SETTING_MOUSE_SENSITIVITY, SETTING_MOUSE_ACCELERATION, SETTING_TRACKBALL_ROTATION_ANGLE, - SETTING_HAPTIC_INTENSITY, + SETTING_HAPTIC_INTENSITY_UNUSED, SETTING_LEFT_GAMEPAD_STICK_ENABLED, SETTING_RIGHT_GAMEPAD_STICK_ENABLED, SETTING_USB_DEBUG_MODE, SETTING_LEFT_TRACKPAD_MODE, SETTING_RIGHT_TRACKPAD_MODE, SETTING_MOUSE_POINTER_ENABLED, + + // 10 SETTING_DPAD_DEADZONE, SETTING_MINIMUM_MOMENTUM_VEL, SETTING_MOMENTUM_DECAY_AMMOUNT, @@ -399,6 +436,8 @@ typedef enum SETTING_MOMENTUM_VERTICAL_DIVISOR, SETTING_MOMENTUM_MAXIMUM_VELOCITY, SETTING_TRACKPAD_Z_ON, + + // 20 SETTING_TRACKPAD_Z_OFF, SETTING_SENSITIVY_SCALE_AMMOUNT, SETTING_LEFT_TRACKPAD_SECONDARY_MODE, @@ -409,6 +448,8 @@ typedef enum SETTING_TRACKPAD_OUTER_RADIUS, SETTING_TRACKPAD_Z_ON_LEFT, SETTING_TRACKPAD_Z_OFF_LEFT, + + // 30 SETTING_TRACKPAD_OUTER_SPIN_VEL, SETTING_TRACKPAD_OUTER_SPIN_RADIUS, SETTING_TRACKPAD_OUTER_SPIN_HORIZONTAL_ONLY, @@ -419,6 +460,8 @@ typedef enum SETTING_TRACKPAD_DOUBLE_TAP_BEEP_PERIOD, SETTING_TRACKPAD_DOUBLE_TAP_BEEP_COUNT, SETTING_TRACKPAD_OUTER_RADIUS_RELEASE_ON_TRANSITION, + + // 40 SETTING_RADIAL_MODE_ANGLE, SETTING_HAPTIC_INTENSITY_MOUSE_MODE, SETTING_LEFT_DPAD_REQUIRES_CLICK, @@ -427,9 +470,48 @@ typedef enum SETTING_LED_USER_BRIGHTNESS, SETTING_ENABLE_RAW_JOYSTICK, SETTING_ENABLE_FAST_SCAN, - SETTING_GYRO_MODE, + SETTING_IMU_MODE, SETTING_WIRELESS_PACKET_VERSION, + + // 50 SETTING_SLEEP_INACTIVITY_TIMEOUT, + SETTING_TRACKPAD_NOISE_THRESHOLD, + SETTING_LEFT_TRACKPAD_CLICK_PRESSURE, + SETTING_RIGHT_TRACKPAD_CLICK_PRESSURE, + SETTING_LEFT_BUMPER_CLICK_PRESSURE, + SETTING_RIGHT_BUMPER_CLICK_PRESSURE, + SETTING_LEFT_GRIP_CLICK_PRESSURE, + SETTING_RIGHT_GRIP_CLICK_PRESSURE, + SETTING_LEFT_GRIP2_CLICK_PRESSURE, + SETTING_RIGHT_GRIP2_CLICK_PRESSURE, + + // 60 + SETTING_PRESSURE_MODE, + SETTING_CONTROLLER_TEST_MODE, + SETTING_TRIGGER_MODE, + SETTING_TRACKPAD_Z_THRESHOLD, + SETTING_FRAME_RATE, + SETTING_TRACKPAD_FILT_CTRL, + SETTING_TRACKPAD_CLIP, + SETTING_DEBUG_OUTPUT_SELECT, + SETTING_TRIGGER_THRESHOLD_PERCENT, + SETTING_TRACKPAD_FREQUENCY_HOPPING, + + // 70 + SETTING_HAPTICS_ENABLED, + SETTING_STEAM_WATCHDOG_ENABLE, + SETTING_TIMP_TOUCH_THRESHOLD_ON, + SETTING_TIMP_TOUCH_THRESHOLD_OFF, + SETTING_FREQ_HOPPING, + SETTING_TEST_CONTROL, + SETTING_HAPTIC_MASTER_GAIN_DB, + SETTING_THUMB_TOUCH_THRESH, + SETTING_DEVICE_POWER_STATUS, + SETTING_HAPTIC_INTENSITY, + + // 80 + SETTING_STABILIZER_ENABLED, + SETTING_TIMP_MODE_MTE, SETTING_COUNT, // This is a special setting value use for callbacks and should not be set/get explicitly. @@ -461,6 +543,7 @@ typedef enum HAPTIC_PULSE_NORMAL = 0x0000, HAPTIC_PULSE_HIGH_PRIORITY = 0x0001, HAPTIC_PULSE_VERY_HIGH_PRIORITY = 0x0002, + HAPTIC_PULSE_IGNORE_USER_PREFS = 0x0003, } SettingHapticPulseFlags; typedef struct diff --git a/src/joystick/hidapi/steam/controller_structs.h b/src/joystick/hidapi/steam/controller_structs.h index c8fd61226e852..1659f74c9090a 100644 --- a/src/joystick/hidapi/steam/controller_structs.h +++ b/src/joystick/hidapi/steam/controller_structs.h @@ -32,6 +32,13 @@ typedef struct unsigned char length; } FeatureReportHeader; +// Generic controller settings structure +typedef struct +{ + unsigned char settingNum; + unsigned short settingValue; +} ControllerSetting; + // Generic controller attribute structure typedef struct { @@ -39,12 +46,89 @@ typedef struct uint32_t attributeValue; } ControllerAttribute; +// Generic controller settings structure +typedef struct +{ + ControllerSetting settings[ ( HID_FEATURE_REPORT_BYTES - sizeof( FeatureReportHeader ) ) / sizeof( ControllerSetting ) ]; +} MsgSetSettingsValues, MsgGetSettingsValues, MsgGetSettingsDefaults, MsgGetSettingsMaxs; + // Generic controller settings structure typedef struct { ControllerAttribute attributes[ ( HID_FEATURE_REPORT_BYTES - sizeof( FeatureReportHeader ) ) / sizeof( ControllerAttribute ) ]; } MsgGetAttributes; +typedef struct +{ + unsigned char attributeTag; + char attributeValue[20]; +} MsgGetStringAttribute; + +typedef struct +{ + unsigned char mode; +} MsgSetControllerMode; + +// Trigger a haptic pulse +typedef struct { + unsigned char which_pad; + unsigned short pulse_duration; + unsigned short pulse_interval; + unsigned short pulse_count; + short dBgain; + unsigned char priority; +} MsgFireHapticPulse; + +typedef struct { + uint8_t mode; +} MsgHapticSetMode; + +typedef enum { + HAPTIC_TYPE_OFF, + HAPTIC_TYPE_TICK, + HAPTIC_TYPE_CLICK, + HAPTIC_TYPE_TONE, + HAPTIC_TYPE_RUMBLE, + HAPTIC_TYPE_NOISE, + HAPTIC_TYPE_SCRIPT, + HAPTIC_TYPE_LOG_SWEEP, +} haptic_type_t; + +typedef enum { + HAPTIC_INTENSITY_SYSTEM, + HAPTIC_INTENSITY_SHORT, + HAPTIC_INTENSITY_MEDIUM, + HAPTIC_INTENSITY_LONG, + HAPTIC_INTENSITY_INSANE, +} haptic_intensity_t; + +typedef struct { + uint8_t side; // 0x01 = L, 0x02 = R, 0x03 = Both + uint8_t cmd; // 0 = Off, 1 = tick, 2 = click, 3 = tone, 4 = rumble, 5 = + // rumble_noise, 6 = script, 7 = sweep, + uint8_t ui_intensity; // 0-4 (0 = default) + int8_t dBgain; // dB Can be positive (reasonable clipping / limiting will apply) + uint16_t freq; // Frequency of tone (if applicable) + int16_t dur_ms; // Duration of tone / rumble (if applicable) (neg = infinite) + + uint16_t noise_intensity; + uint16_t lfo_freq; // Drives both tone and rumble geneators + uint8_t lfo_depth; // percentage, typically 100 + uint8_t rand_tone_gain; // Randomize each LFO cycle's gain + uint8_t script_id; // Used w/ dBgain for scripted haptics + + uint16_t lss_start_freq; // Used w/ Log Sine Sweep + uint16_t lss_end_freq; // Ditto +} MsgTriggerHaptic; + +typedef struct { + uint8_t unRumbleType; + uint16_t unIntensity; + uint16_t unLeftMotorSpeed; + uint16_t unRightMotorSpeed; + int8_t nLeftGain; + int8_t nRightGain; +} MsgSimpleRumbleCmd; // This is the only message struct that application code should use to interact with feature request messages. Any new // messages should be added to the union. The structures defined here should correspond to the ones defined in @@ -55,7 +139,17 @@ typedef struct FeatureReportHeader header; union { - MsgGetAttributes getAttributes; + MsgSetSettingsValues setSettingsValues; + MsgGetSettingsValues getSettingsValues; + MsgGetSettingsMaxs getSettingsMaxs; + MsgGetSettingsDefaults getSettingsDefaults; + MsgGetAttributes getAttributes; + MsgSetControllerMode controllerMode; + MsgFireHapticPulse fireHapticPulse; + MsgGetStringAttribute getStringAttribute; + MsgHapticSetMode hapticMode; + MsgTriggerHaptic triggerHaptic; + MsgSimpleRumbleCmd simpleRumble; } payload; } FeatureReportMsg; @@ -77,6 +171,7 @@ typedef enum ID_CONTROLLER_DEBUG2 = 5, ID_CONTROLLER_SECONDARY_STATE = 6, ID_CONTROLLER_BLE_STATE = 7, + ID_CONTROLLER_DECK_STATE = 9, ID_CONTROLLER_MSG_COUNT } ValveInReportMessageIDs; @@ -94,12 +189,12 @@ typedef struct { // If packet num matches that on your prior call, then the controller state hasn't been changed since // your last call and there is no need to process it - uint32 unPacketNum; + Uint32 unPacketNum; // Button bitmask and trigger data. union { - uint64 ulButtons; + Uint64 ulButtons; struct { unsigned char _pad0[3]; @@ -143,12 +238,12 @@ typedef struct { // If packet num matches that on your prior call, then the controller state hasn't been changed since // your last call and there is no need to process it - uint32 unPacketNum; + Uint32 unPacketNum; // Button bitmask and trigger data. union { - uint64 ulButtons; + Uint64 ulButtons; struct { unsigned char _pad0[3]; @@ -258,6 +353,66 @@ typedef struct unsigned char ucBatteryLevel; } SteamControllerStatusEvent_t; +// Deck State payload +typedef struct +{ + // If packet num matches that on your prior call, then the controller + // state hasn't been changed since your last call and there is no need to + // process it + Uint32 unPacketNum; + + // Button bitmask and trigger data. + union + { + Uint64 ulButtons; + struct + { + Uint32 ulButtonsL; + Uint32 ulButtonsH; + }; + }; + + // Left pad coordinates + short sLeftPadX; + short sLeftPadY; + + // Right pad coordinates + short sRightPadX; + short sRightPadY; + + // Accelerometer values + short sAccelX; + short sAccelY; + short sAccelZ; + + // Gyroscope values + short sGyroX; + short sGyroY; + short sGyroZ; + + // Gyro quaternions + short sGyroQuatW; + short sGyroQuatX; + short sGyroQuatY; + short sGyroQuatZ; + + // Uncalibrated trigger values + unsigned short sTriggerRawL; + unsigned short sTriggerRawR; + + // Left stick values + short sLeftStickX; + short sLeftStickY; + + // Right stick values + short sRightStickX; + short sRightStickY; + + // Touchpad pressures + unsigned short sPressurePadLeft; + unsigned short sPressurePadRight; +} SteamDeckStatePacket_t; + typedef struct { ValveInReportHeader_t header; @@ -271,6 +426,7 @@ typedef struct ValveControllerRawTrackpadImage_t rawPadImage; SteamControllerWirelessEvent_t wirelessEvent; SteamControllerStatusEvent_t statusEvent; + SteamDeckStatePacket_t deckState; } payload; } ValveInReport_t; diff --git a/src/joystick/iphoneos/SDL_mfijoystick.m b/src/joystick/iphoneos/SDL_mfijoystick.m index 8f207afb2efac..6ff8e0e0bd37e 100644 --- a/src/joystick/iphoneos/SDL_mfijoystick.m +++ b/src/joystick/iphoneos/SDL_mfijoystick.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,6 +25,7 @@ #include "SDL_joystick.h" #include "SDL_hints.h" #include "SDL_stdinc.h" +#include "SDL_timer.h" #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" #include "../hidapi/SDL_hidapijoystick_c.h" @@ -32,7 +33,7 @@ #include "SDL_mfijoystick_c.h" -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED #include "../../events/SDL_events_c.h" #endif @@ -54,11 +55,22 @@ static id connectObserver = nil; static id disconnectObserver = nil; -static NSString *GCInputXboxShareButton = @"Button Share"; #include #include +#ifndef __IPHONE_OS_VERSION_MAX_ALLOWED +#define __IPHONE_OS_VERSION_MAX_ALLOWED 0 +#endif + +#ifndef __APPLETV_OS_VERSION_MAX_ALLOWED +#define __APPLETV_OS_VERSION_MAX_ALLOWED 0 +#endif + +#ifndef __MAC_OS_VERSION_MAX_ALLOWED +#define __MAC_OS_VERSION_MAX_ALLOWED 0 +#endif + /* remove compilation warnings for strict builds by defining these selectors, even though * they are only ever used indirectly through objc_msgSend */ @@ -75,20 +87,20 @@ + (BOOL)supportsHIDDevice:(IOHIDDeviceRef)device; @end @interface GCExtendedGamepad (SDL) #if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 121000) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 121000) || (__MAC_OS_VERSION_MAX_ALLOWED >= 1401000)) -@property (nonatomic, readonly, nullable) GCControllerButtonInput *leftThumbstickButton; -@property (nonatomic, readonly, nullable) GCControllerButtonInput *rightThumbstickButton; +@property(nonatomic, readonly, nullable) GCControllerButtonInput *leftThumbstickButton; +@property(nonatomic, readonly, nullable) GCControllerButtonInput *rightThumbstickButton; #endif #if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 130000) || (__MAC_OS_VERSION_MAX_ALLOWED >= 1500000)) -@property (nonatomic, readonly) GCControllerButtonInput *buttonMenu; -@property (nonatomic, readonly, nullable) GCControllerButtonInput *buttonOptions; +@property(nonatomic, readonly) GCControllerButtonInput *buttonMenu; +@property(nonatomic, readonly, nullable) GCControllerButtonInput *buttonOptions; #endif #if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 140000) || (__MAC_OS_VERSION_MAX_ALLOWED > 1500000)) -@property (nonatomic, readonly, nullable) GCControllerButtonInput *buttonHome; +@property(nonatomic, readonly, nullable) GCControllerButtonInput *buttonHome; #endif @end @interface GCMicroGamepad (SDL) #if !((__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000) || (__APPLETV_OS_VERSION_MAX_ALLOWED >= 130000) || (__MAC_OS_VERSION_MAX_ALLOWED >= 1500000)) -@property (nonatomic, readonly) GCControllerButtonInput *buttonMenu; +@property(nonatomic, readonly) GCControllerButtonInput *buttonMenu; #endif @end @@ -117,8 +129,7 @@ @interface GCMicroGamepad (SDL) static int numjoysticks = 0; int SDL_AppleTVRemoteOpenedAsJoystick = 0; -static SDL_JoystickDeviceItem * -GetDeviceForIndex(int device_index) +static SDL_JoystickDeviceItem *GetDeviceForIndex(int device_index) { SDL_JoystickDeviceItem *device = deviceList; int i = 0; @@ -135,50 +146,46 @@ @interface GCMicroGamepad (SDL) } #ifdef SDL_JOYSTICK_MFI -static BOOL -IsControllerPS4(GCController *controller) +static BOOL IsControllerPS4(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"DualShock 4"]) { return TRUE; } } else { - if ([controller.vendorName containsString: @"DUALSHOCK"]) { + if ([controller.vendorName containsString:@"DUALSHOCK"]) { return TRUE; } } return FALSE; } -static BOOL -IsControllerPS5(GCController *controller) +static BOOL IsControllerPS5(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"DualSense"]) { return TRUE; } } else { - if ([controller.vendorName containsString: @"DualSense"]) { + if ([controller.vendorName containsString:@"DualSense"]) { return TRUE; } } return FALSE; } -static BOOL -IsControllerXbox(GCController *controller) +static BOOL IsControllerXbox(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"Xbox One"]) { return TRUE; } } else { - if ([controller.vendorName containsString: @"Xbox"]) { + if ([controller.vendorName containsString:@"Xbox"]) { return TRUE; } } return FALSE; } -static BOOL -IsControllerSwitchPro(GCController *controller) +static BOOL IsControllerSwitchPro(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"Switch Pro Controller"]) { @@ -187,8 +194,7 @@ @interface GCMicroGamepad (SDL) } return FALSE; } -static BOOL -IsControllerSwitchJoyConL(GCController *controller) +static BOOL IsControllerSwitchJoyConL(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"Nintendo Switch Joy-Con (L)"]) { @@ -197,8 +203,7 @@ @interface GCMicroGamepad (SDL) } return FALSE; } -static BOOL -IsControllerSwitchJoyConR(GCController *controller) +static BOOL IsControllerSwitchJoyConR(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"Nintendo Switch Joy-Con (R)"]) { @@ -207,8 +212,7 @@ @interface GCMicroGamepad (SDL) } return FALSE; } -static BOOL -IsControllerSwitchJoyConPair(GCController *controller) +static BOOL IsControllerSwitchJoyConPair(GCController *controller) { if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { if ([controller.productCategory isEqualToString:@"Nintendo Switch Joy-Con (L/R)"]) { @@ -217,12 +221,139 @@ @interface GCMicroGamepad (SDL) } return FALSE; } -static BOOL -IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCController *controller) +static BOOL IsControllerStadia(GCController *controller) +{ + if ([controller.vendorName hasPrefix:@"Stadia"]) { + return TRUE; + } + return FALSE; +} +static BOOL IsControllerBackboneOne(GCController *controller) +{ + if ([controller.vendorName hasPrefix:@"Backbone One"]) { + return TRUE; + } + return FALSE; +} +static void CheckControllerSiriRemote(GCController *controller, int *is_siri_remote) +{ + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + if ([controller.productCategory hasPrefix:@"Siri Remote"]) { + *is_siri_remote = 1; + SDL_sscanf(controller.productCategory.UTF8String, "Siri Remote (%i%*s Generation)", is_siri_remote); + return; + } + } + *is_siri_remote = 0; +} + +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE +static BOOL ElementAlreadyHandled(SDL_JoystickDeviceItem *device, NSString *element, NSDictionary *elements) +{ + if ([element isEqualToString:@"Left Thumbstick Left"] || + [element isEqualToString:@"Left Thumbstick Right"]) { + if (elements[@"Left Thumbstick X Axis"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Left Thumbstick Up"] || + [element isEqualToString:@"Left Thumbstick Down"]) { + if (elements[@"Left Thumbstick Y Axis"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Right Thumbstick Left"] || + [element isEqualToString:@"Right Thumbstick Right"]) { + if (elements[@"Right Thumbstick X Axis"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Right Thumbstick Up"] || + [element isEqualToString:@"Right Thumbstick Down"]) { + if (elements[@"Right Thumbstick Y Axis"]) { + return TRUE; + } + } + if (device->is_siri_remote) { + if ([element isEqualToString:@"Direction Pad Left"] || + [element isEqualToString:@"Direction Pad Right"]) { + if (elements[@"Direction Pad X Axis"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Direction Pad Up"] || + [element isEqualToString:@"Direction Pad Down"]) { + if (elements[@"Direction Pad Y Axis"]) { + return TRUE; + } + } + } else { + if ([element isEqualToString:@"Direction Pad X Axis"]) { + if (elements[@"Direction Pad Left"] && + elements[@"Direction Pad Right"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Direction Pad Y Axis"]) { + if (elements[@"Direction Pad Up"] && + elements[@"Direction Pad Down"]) { + return TRUE; + } + } + } + if ([element isEqualToString:@"Cardinal Direction Pad X Axis"]) { + if (elements[@"Cardinal Direction Pad Left"] && + elements[@"Cardinal Direction Pad Right"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Cardinal Direction Pad Y Axis"]) { + if (elements[@"Cardinal Direction Pad Up"] && + elements[@"Cardinal Direction Pad Down"]) { + return TRUE; + } + } + if ([element isEqualToString:@"Touchpad 1 X Axis"] || + [element isEqualToString:@"Touchpad 1 Y Axis"] || + [element isEqualToString:@"Touchpad 1 Left"] || + [element isEqualToString:@"Touchpad 1 Right"] || + [element isEqualToString:@"Touchpad 1 Up"] || + [element isEqualToString:@"Touchpad 1 Down"] || + [element isEqualToString:@"Touchpad 2 X Axis"] || + [element isEqualToString:@"Touchpad 2 Y Axis"] || + [element isEqualToString:@"Touchpad 2 Left"] || + [element isEqualToString:@"Touchpad 2 Right"] || + [element isEqualToString:@"Touchpad 2 Up"] || + [element isEqualToString:@"Touchpad 2 Down"]) { + /* The touchpad is handled separately */ + return TRUE; + } + if ([element isEqualToString:@"Button Home"]) { + if (device->is_switch_joycon_pair) { + /* The Nintendo Switch JoyCon home button doesn't ever show as being held down */ + return TRUE; + } +#if TARGET_OS_TV + /* The OS uses the home button, it's not available to apps */ + return TRUE; +#endif + } + if ([element isEqualToString:@"Button Share"]) { + if (device->is_backbone_one) { + /* The Backbone app uses share button */ + return TRUE; + } + } + return FALSE; +} +#endif /* ENABLE_PHYSICAL_INPUT_PROFILE */ + +static BOOL IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCController *controller) { Uint16 vendor = 0; Uint16 product = 0; Uint8 subtype = 0; + Uint16 signature = 0; const char *name = NULL; if (@available(macOS 11.3, iOS 14.5, tvOS 14.5, *)) { @@ -233,7 +364,7 @@ @interface GCMicroGamepad (SDL) /* Explicitly retain the controller because SDL_JoystickDeviceItem is a * struct, and ARC doesn't work with structs. */ - device->controller = (__bridge GCController *) CFBridgingRetain(controller); + device->controller = (__bridge GCController *)CFBridgingRetain(controller); if (controller.vendorName) { name = controller.vendorName.UTF8String; @@ -246,191 +377,257 @@ @interface GCMicroGamepad (SDL) device->name = SDL_CreateJoystickName(0, 0, NULL, name); #ifdef DEBUG_CONTROLLER_PROFILE + NSLog(@"Product name: %@\n", controller.vendorName); + NSLog(@"Product category: %@\n", controller.productCategory); + NSLog(@"Elements available:\n"); +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { - if (controller.physicalInputProfile) { - for (id key in controller.physicalInputProfile.buttons) { - NSLog(@"Button %@ available\n", key); - } - for (id key in controller.physicalInputProfile.axes) { - NSLog(@"Axis %@ available\n", key); - } + NSDictionary *elements = controller.physicalInputProfile.elements; + for (id key in controller.physicalInputProfile.buttons) { + NSLog(@"\tButton: %@ (%s)\n", key, elements[key].analog ? "analog" : "digital"); + } + for (id key in controller.physicalInputProfile.axes) { + NSLog(@"\tAxis: %@\n", key); + } + for (id key in controller.physicalInputProfile.dpads) { + NSLog(@"\tHat: %@\n", key); } } +#endif #endif - if (controller.extendedGamepad) { - GCExtendedGamepad *gamepad = controller.extendedGamepad; - BOOL is_xbox = IsControllerXbox(controller); - BOOL is_ps4 = IsControllerPS4(controller); - BOOL is_ps5 = IsControllerPS5(controller); - BOOL is_switch_pro = IsControllerSwitchPro(controller); - BOOL is_switch_joycon_pair = IsControllerSwitchJoyConPair(controller); - int nbuttons = 0; - BOOL has_direct_menu; - + device->is_xbox = IsControllerXbox(controller); + device->is_ps4 = IsControllerPS4(controller); + device->is_ps5 = IsControllerPS5(controller); + device->is_switch_pro = IsControllerSwitchPro(controller); + device->is_switch_joycon_pair = IsControllerSwitchJoyConPair(controller); + device->is_stadia = IsControllerStadia(controller); + device->is_backbone_one = IsControllerBackboneOne(controller); + device->is_switch_joyconL = IsControllerSwitchJoyConL(controller); + device->is_switch_joyconR = IsControllerSwitchJoyConR(controller); #ifdef SDL_JOYSTICK_HIDAPI - if ((is_xbox && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_XBOXONE)) || - (is_ps4 && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_PS4)) || - (is_ps5 && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_PS5)) || - (is_switch_pro && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO))) { - /* The HIDAPI driver is taking care of this device */ - return FALSE; - } + if ((device->is_xbox && (HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_XBOXONE) || + HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_XBOX360))) || + (device->is_ps4 && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_PS4)) || + (device->is_ps5 && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_PS5)) || + (device->is_switch_pro && HIDAPI_IsDeviceTypePresent(SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO)) || + (device->is_switch_joycon_pair && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR, 0, "")) || + (device->is_stadia && HIDAPI_IsDevicePresent(USB_VENDOR_GOOGLE, USB_PRODUCT_GOOGLE_STADIA_CONTROLLER, 0, "")) || + (device->is_switch_joyconL && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT, 0, "")) || + (device->is_switch_joyconR && HIDAPI_IsDevicePresent(USB_VENDOR_NINTENDO, USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT, 0, ""))) { + /* The HIDAPI driver is taking care of this device */ + return FALSE; + } #endif + if (device->is_xbox && SDL_strncmp(name, "GamePad-", 8) == 0) { + /* This is a Steam Virtual Gamepad, which isn't supported by GCController */ + return FALSE; + } + CheckControllerSiriRemote(controller, &device->is_siri_remote); - /* These buttons are part of the original MFi spec */ - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_A); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_B); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_X); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_Y); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_LEFTSHOULDER); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); - nbuttons += 6; + if (device->is_siri_remote && !SDL_GetHintBoolean(SDL_HINT_TV_REMOTE_AS_JOYSTICK, SDL_TRUE)) { + /* Ignore remotes, they'll be handled as keyboard input */ + return SDL_FALSE; + } - /* These buttons are available on some newer controllers */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunguarded-availability-new" - if ([gamepad respondsToSelector:@selector(leftThumbstickButton)] && gamepad.leftThumbstickButton) { - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_LEFTSTICK); - ++nbuttons; - } - if ([gamepad respondsToSelector:@selector(rightThumbstickButton)] && gamepad.rightThumbstickButton) { - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_RIGHTSTICK); - ++nbuttons; +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + if (controller.physicalInputProfile.buttons[GCInputDualShockTouchpadButton] != nil) { + device->has_dualshock_touchpad = TRUE; } - if ([gamepad respondsToSelector:@selector(buttonOptions)] && gamepad.buttonOptions) { - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_BACK); - ++nbuttons; + if (controller.physicalInputProfile.buttons[GCInputXboxPaddleOne] != nil) { + device->has_xbox_paddles = TRUE; } - /* The Nintendo Switch JoyCon home button doesn't ever show as being held down */ - if ([gamepad respondsToSelector:@selector(buttonHome)] && gamepad.buttonHome && !is_switch_joycon_pair) { - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_GUIDE); - ++nbuttons; + if (controller.physicalInputProfile.buttons[@"Button Share"] != nil) { + device->has_xbox_share_button = TRUE; } - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_START); - ++nbuttons; + } +#endif /* ENABLE_PHYSICAL_INPUT_PROFILE */ - has_direct_menu = [gamepad respondsToSelector:@selector(buttonMenu)] && gamepad.buttonMenu; - if (!has_direct_menu) { - device->uses_pause_handler = SDL_TRUE; + if (device->is_backbone_one) { + vendor = USB_VENDOR_BACKBONE; + if (device->is_ps5) { + product = USB_PRODUCT_BACKBONE_ONE_IOS_PS5; + } else { + product = USB_PRODUCT_BACKBONE_ONE_IOS; + } + } else if (device->is_xbox) { + vendor = USB_VENDOR_MICROSOFT; + if (device->has_xbox_paddles) { + /* Assume Xbox One Elite Series 2 Controller unless/until GCController flows VID/PID */ + product = USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH; + } else if (device->has_xbox_share_button) { + /* Assume Xbox Series X Controller unless/until GCController flows VID/PID */ + product = USB_PRODUCT_XBOX_SERIES_X_BLE; + } else { + /* Assume Xbox One S Bluetooth Controller unless/until GCController flows VID/PID */ + product = USB_PRODUCT_XBOX_ONE_S_REV1_BLUETOOTH; + } + } else if (device->is_ps4) { + /* Assume DS4 Slim unless/until GCController flows VID/PID */ + vendor = USB_VENDOR_SONY; + product = USB_PRODUCT_SONY_DS4_SLIM; + if (device->has_dualshock_touchpad) { + subtype = 1; } + } else if (device->is_ps5) { + vendor = USB_VENDOR_SONY; + product = USB_PRODUCT_SONY_DS5; + } else if (device->is_switch_pro) { + vendor = USB_VENDOR_NINTENDO; + product = USB_PRODUCT_NINTENDO_SWITCH_PRO; + } else if (device->is_switch_joycon_pair) { + vendor = USB_VENDOR_NINTENDO; + product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR; + } else if (device->is_switch_joyconL) { + vendor = USB_VENDOR_NINTENDO; + product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT; + } else if (device->is_switch_joyconR) { + vendor = USB_VENDOR_NINTENDO; + product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT; +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE + } else if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + vendor = USB_VENDOR_APPLE; + product = 4; + subtype = 4; +#endif + } else if (controller.extendedGamepad) { + vendor = USB_VENDOR_APPLE; + product = 1; + subtype = 1; + } else if (controller.gamepad) { + vendor = USB_VENDOR_APPLE; + product = 2; + subtype = 2; #if TARGET_OS_TV - /* The single menu button isn't very reliable, at least as of tvOS 16.1 */ - if ((device->button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) == 0) { - device->uses_pause_handler = SDL_TRUE; - } + } else if (controller.microGamepad) { + vendor = USB_VENDOR_APPLE; + product = 3; + subtype = 3; #endif + } else { + /* We don't know how to get input events from this device */ + return SDL_FALSE; + } #ifdef ENABLE_PHYSICAL_INPUT_PROFILE - if ([controller respondsToSelector:@selector(physicalInputProfile)]) { - if (controller.physicalInputProfile.buttons[GCInputDualShockTouchpadButton] != nil) { - device->has_dualshock_touchpad = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_MISC1); - ++nbuttons; + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + NSDictionary *elements = controller.physicalInputProfile.elements; + + /* Provide both axes and analog buttons as SDL axes */ + NSArray *axes = [[[elements allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] + filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *bindings) { + GCControllerElement *element; + + if (ElementAlreadyHandled(device, (NSString *)object, elements)) { + return NO; } - if (controller.physicalInputProfile.buttons[GCInputXboxPaddleOne] != nil) { - device->has_xbox_paddles = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_PADDLE1); - ++nbuttons; + + element = elements[object]; + if (element.analog) { + if ([element isKindOfClass:[GCControllerAxisInput class]] || + [element isKindOfClass:[GCControllerButtonInput class]]) { + return YES; + } } - if (controller.physicalInputProfile.buttons[GCInputXboxPaddleTwo] != nil) { - device->has_xbox_paddles = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_PADDLE2); - ++nbuttons; + return NO; + }]]; + NSArray *buttons = [[[elements allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] + filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id object, NSDictionary *bindings) { + GCControllerElement *element; + + if (ElementAlreadyHandled(device, (NSString *)object, elements)) { + return NO; } - if (controller.physicalInputProfile.buttons[GCInputXboxPaddleThree] != nil) { - device->has_xbox_paddles = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_PADDLE3); - ++nbuttons; + + element = elements[object]; + if ([element isKindOfClass:[GCControllerButtonInput class]]) { + return YES; } - if (controller.physicalInputProfile.buttons[GCInputXboxPaddleFour] != nil) { - device->has_xbox_paddles = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_PADDLE4); + return NO; + }]]; + /* Explicitly retain the arrays because SDL_JoystickDeviceItem is a + * struct, and ARC doesn't work with structs. */ + device->naxes = (int)axes.count; + device->axes = (__bridge NSArray *)CFBridgingRetain(axes); + device->nbuttons = (int)buttons.count; + device->buttons = (__bridge NSArray *)CFBridgingRetain(buttons); + subtype = 4; + +#ifdef DEBUG_CONTROLLER_PROFILE + NSLog(@"Elements used:\n", controller.vendorName); + for (id key in device->buttons) { + NSLog(@"\tButton: %@ (%s)\n", key, elements[key].analog ? "analog" : "digital"); + } + for (id key in device->axes) { + NSLog(@"\tAxis: %@\n", key); + } +#endif /* DEBUG_CONTROLLER_PROFILE */ + +#if TARGET_OS_TV + /* tvOS turns the menu button into a system gesture, so we grab it here instead */ + if (elements[GCInputButtonMenu] && !elements[@"Button Home"]) { + device->pause_button_index = [device->buttons indexOfObject:GCInputButtonMenu]; + } +#endif + } else +#endif + if (controller.extendedGamepad) { + GCExtendedGamepad *gamepad = controller.extendedGamepad; + int nbuttons = 0; + BOOL has_direct_menu = FALSE; + + /* These buttons are part of the original MFi spec */ + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_A); + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_B); + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_X); + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_Y); + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_LEFTSHOULDER); + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); + nbuttons += 6; + + /* These buttons are available on some newer controllers */ + if (@available(macOS 10.14.1, iOS 12.1, tvOS 12.1, *)) { + if (gamepad.leftThumbstickButton) { + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_LEFTSTICK); ++nbuttons; } - if (controller.physicalInputProfile.buttons[GCInputXboxShareButton] != nil) { - device->has_xbox_share_button = SDL_TRUE; - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_MISC1); + if (gamepad.rightThumbstickButton) { + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_RIGHTSTICK); ++nbuttons; } } -#endif -#pragma clang diagnostic pop - - if (is_xbox) { - vendor = USB_VENDOR_MICROSOFT; - if (device->has_xbox_paddles) { - /* Assume Xbox One Elite Series 2 Controller unless/until GCController flows VID/PID */ - product = USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH; - subtype = 1; - } else if (device->has_xbox_share_button) { - /* Assume Xbox Series X Controller unless/until GCController flows VID/PID */ - product = USB_PRODUCT_XBOX_SERIES_X_BLE; - subtype = 1; - } else { - /* Assume Xbox One S Bluetooth Controller unless/until GCController flows VID/PID */ - product = USB_PRODUCT_XBOX_ONE_S_REV1_BLUETOOTH; - subtype = 0; - } - } else if (is_ps4) { - /* Assume DS4 Slim unless/until GCController flows VID/PID */ - vendor = USB_VENDOR_SONY; - product = USB_PRODUCT_SONY_DS4_SLIM; - if (device->has_dualshock_touchpad) { - subtype = 1; - } else { - subtype = 0; + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + if (gamepad.buttonOptions) { + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_BACK); + ++nbuttons; } - } else if (is_ps5) { - vendor = USB_VENDOR_SONY; - product = USB_PRODUCT_SONY_DS5; - subtype = 0; - } else if (is_switch_pro) { - vendor = USB_VENDOR_NINTENDO; - product = USB_PRODUCT_NINTENDO_SWITCH_PRO; - subtype = 0; - } else if (is_switch_joycon_pair) { - vendor = USB_VENDOR_NINTENDO; - product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR; - subtype = 0; - } else { - vendor = USB_VENDOR_APPLE; - product = 1; - subtype = 1; } + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_START); + ++nbuttons; - if (SDL_strcmp(name, "Backbone One") == 0) { - /* The Backbone app uses share button */ - if ((device->button_mask & (1 << SDL_CONTROLLER_BUTTON_MISC1)) != 0) { - device->button_mask &= ~(1 << SDL_CONTROLLER_BUTTON_MISC1); - --nbuttons; - device->has_xbox_share_button = SDL_FALSE; + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + if (gamepad.buttonMenu) { + has_direct_menu = TRUE; } } +#if TARGET_OS_TV + /* The single menu button isn't very reliable, at least as of tvOS 16.1 */ + if ((device->button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) == 0) { + has_direct_menu = FALSE; + } +#endif + if (!has_direct_menu) { + device->pause_button_index = (nbuttons - 1); + } device->naxes = 6; /* 2 thumbsticks and 2 triggers */ device->nhats = 1; /* d-pad */ device->nbuttons = nbuttons; } else if (controller.gamepad) { - BOOL is_switch_joyconL = IsControllerSwitchJoyConL(controller); - BOOL is_switch_joyconR = IsControllerSwitchJoyConR(controller); int nbuttons = 0; - if (is_switch_joyconL) { - vendor = USB_VENDOR_NINTENDO; - product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT; - subtype = 0; - } else if (is_switch_joyconR) { - vendor = USB_VENDOR_NINTENDO; - product = USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT; - subtype = 0; - } else { - vendor = USB_VENDOR_APPLE; - product = 2; - subtype = 2; - } - /* These buttons are part of the original MFi spec */ device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_A); device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_B); @@ -438,14 +635,9 @@ @interface GCMicroGamepad (SDL) device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_Y); device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_LEFTSHOULDER); device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); -#if TARGET_OS_TV - /* The menu button is used by the OS and not available to applications */ - nbuttons += 6; -#else device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_START); nbuttons += 7; - device->uses_pause_handler = SDL_TRUE; -#endif + device->pause_button_index = (nbuttons - 1); device->naxes = 0; /* no traditional analog inputs */ device->nhats = 1; /* d-pad */ @@ -456,35 +648,41 @@ @interface GCMicroGamepad (SDL) int nbuttons = 0; device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_A); - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_B); /* Button X on microGamepad */ - nbuttons += 2; - - device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_START); - ++nbuttons; - device->uses_pause_handler = SDL_TRUE; + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_X); /* Button X on microGamepad */ + device->button_mask |= (1 << SDL_CONTROLLER_BUTTON_B); + nbuttons += 3; + device->pause_button_index = (nbuttons - 1); - vendor = USB_VENDOR_APPLE; - product = 3; - subtype = 3; device->naxes = 2; /* treat the touch surface as two axes */ device->nhats = 0; /* apparently the touch surface-as-dpad is buggy */ device->nbuttons = nbuttons; controller.microGamepad.allowsRotation = SDL_GetHintBoolean(SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION, SDL_FALSE); } -#endif /* TARGET_OS_TV */ +#endif + else { + /* We don't know how to get input events from this device */ + return SDL_FALSE; + } - if (vendor == USB_VENDOR_APPLE) { - /* Note that this is an MFI controller and what subtype it is */ - device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor, product, 0, name, 'm', subtype); + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + signature = 0; + signature = SDL_crc16(signature, device->name, SDL_strlen(device->name)); + for (id key in device->axes) { + const char *string = ((NSString *)key).UTF8String; + signature = SDL_crc16(signature, string, SDL_strlen(string)); + } + for (id key in device->buttons) { + const char *string = ((NSString *)key).UTF8String; + signature = SDL_crc16(signature, string, SDL_strlen(string)); + } } else { - device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor, product, 0, name, 0, subtype); + signature = device->button_mask; } + device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor, product, signature, NULL, name, 'm', subtype); - /* Update the GUID with capability bits */ - { - Uint16 *guid16 = (Uint16 *)device->guid.data; - guid16[6] = SDL_SwapLE16(device->button_mask); + if (SDL_ShouldIgnoreJoystick(name, device->guid)) { + return SDL_FALSE; } /* This will be set when the first button press of the controller is @@ -495,20 +693,10 @@ @interface GCMicroGamepad (SDL) #endif /* SDL_JOYSTICK_MFI */ #if defined(SDL_JOYSTICK_iOS_ACCELEROMETER) || defined(SDL_JOYSTICK_MFI) -static void -IOS_AddJoystickDevice(GCController *controller, SDL_bool accelerometer) +static void IOS_AddJoystickDevice(GCController *controller, SDL_bool accelerometer) { SDL_JoystickDeviceItem *device = deviceList; -#if TARGET_OS_TV - if (!SDL_GetHintBoolean(SDL_HINT_TV_REMOTE_AS_JOYSTICK, SDL_TRUE)) { - /* Ignore devices that aren't actually controllers (e.g. remotes), they'll be handled as keyboard input */ - if (controller && !controller.extendedGamepad && !controller.gamepad && controller.microGamepad) { - return; - } - } -#endif - while (device != NULL) { if (device->controller == controller) { return; @@ -516,13 +704,14 @@ @interface GCMicroGamepad (SDL) device = device->next; } - device = (SDL_JoystickDeviceItem *) SDL_calloc(1, sizeof(SDL_JoystickDeviceItem)); + device = (SDL_JoystickDeviceItem *)SDL_calloc(1, sizeof(SDL_JoystickDeviceItem)); if (device == NULL) { return; } device->accelerometer = accelerometer; device->instance_id = SDL_GetNextJoystickInstanceID(); + device->pause_button_index = -1; if (accelerometer) { #ifdef SDL_JOYSTICK_iOS_ACCELEROMETER @@ -540,6 +729,7 @@ @interface GCMicroGamepad (SDL) } else if (controller) { #ifdef SDL_JOYSTICK_MFI if (!IOS_AddMFIJoystickDevice(device, controller)) { + SDL_free(device->name); SDL_free(device); return; } @@ -565,8 +755,7 @@ @interface GCMicroGamepad (SDL) } #endif /* SDL_JOYSTICK_iOS_ACCELEROMETER || SDL_JOYSTICK_MFI */ -static SDL_JoystickDeviceItem * -IOS_RemoveJoystickDevice(SDL_JoystickDeviceItem *device) +static SDL_JoystickDeviceItem *IOS_RemoveJoystickDevice(SDL_JoystickDeviceItem *device) { SDL_JoystickDeviceItem *prev = NULL; SDL_JoystickDeviceItem *next = NULL; @@ -599,13 +788,20 @@ @interface GCMicroGamepad (SDL) #ifdef SDL_JOYSTICK_MFI @autoreleasepool { + /* These were explicitly retained in the struct, so they should be explicitly released before freeing the struct. */ if (device->controller) { - /* The controller was explicitly retained in the struct, so it - * should be explicitly released before freeing the struct. */ GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller)); controller.controllerPausedHandler = nil; device->controller = nil; } + if (device->axes) { + CFRelease((__bridge CFTypeRef)device->axes); + device->axes = nil; + } + if (device->buttons) { + CFRelease((__bridge CFTypeRef)device->buttons); + device->buttons = nil; + } } #endif /* SDL_JOYSTICK_MFI */ @@ -620,8 +816,7 @@ @interface GCMicroGamepad (SDL) } #if TARGET_OS_TV -static void SDLCALL -SDL_AppleTVRemoteRotationHintChanged(void *udata, const char *name, const char *oldValue, const char *newValue) +static void SDLCALL SDL_AppleTVRemoteRotationHintChanged(void *udata, const char *name, const char *oldValue, const char *newValue) { BOOL allowRotation = newValue != NULL && *newValue != '0'; @@ -635,15 +830,23 @@ @interface GCMicroGamepad (SDL) } #endif /* TARGET_OS_TV */ -static int -IOS_JoystickInit(void) +static int IOS_JoystickInit(void) { + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_MFI, SDL_TRUE)) { + return 0; + } + #if defined(__MACOSX__) +#if _SDL_HAS_BUILTIN(__builtin_available) if (@available(macOS 10.16, *)) { /* Continue with initialization on macOS 11+ */ } else { return 0; } +#else + /* No @available, must be an older macOS version */ + return 0; +#endif #endif @autoreleasepool { @@ -680,26 +883,26 @@ @interface GCMicroGamepad (SDL) object:nil queue:nil usingBlock:^(NSNotification *note) { - GCController *controller = note.object; - SDL_LockJoysticks(); - IOS_AddJoystickDevice(controller, SDL_FALSE); - SDL_UnlockJoysticks(); + GCController *controller = note.object; + SDL_LockJoysticks(); + IOS_AddJoystickDevice(controller, SDL_FALSE); + SDL_UnlockJoysticks(); }]; disconnectObserver = [center addObserverForName:GCControllerDidDisconnectNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - GCController *controller = note.object; - SDL_JoystickDeviceItem *device; - SDL_LockJoysticks(); - for (device = deviceList; device != NULL; device = device->next) { - if (device->controller == controller) { - IOS_RemoveJoystickDevice(device); - break; - } - } - SDL_UnlockJoysticks(); + GCController *controller = note.object; + SDL_JoystickDeviceItem *device; + SDL_LockJoysticks(); + for (device = deviceList; device != NULL; device = device->next) { + if (device->controller == controller) { + IOS_RemoveJoystickDevice(device); + break; + } + } + SDL_UnlockJoysticks(); }]; #endif /* SDL_JOYSTICK_MFI */ } @@ -707,32 +910,32 @@ @interface GCMicroGamepad (SDL) return 0; } -static int -IOS_JoystickGetCount(void) +static int IOS_JoystickGetCount(void) { return numjoysticks; } -static void -IOS_JoystickDetect(void) +static void IOS_JoystickDetect(void) { } -static const char * -IOS_JoystickGetDeviceName(int device_index) +static const char *IOS_JoystickGetDeviceName(int device_index) { SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); return device ? device->name : "Unknown"; } -static const char * -IOS_JoystickGetDevicePath(int device_index) +static const char *IOS_JoystickGetDevicePath(int device_index) { return NULL; } -static int -IOS_JoystickGetDevicePlayerIndex(int device_index) +static int IOS_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int IOS_JoystickGetDevicePlayerIndex(int device_index) { #ifdef SDL_JOYSTICK_MFI SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); @@ -743,8 +946,7 @@ @interface GCMicroGamepad (SDL) return -1; } -static void -IOS_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void IOS_JoystickSetDevicePlayerIndex(int device_index, int player_index) { #ifdef SDL_JOYSTICK_MFI SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); @@ -754,8 +956,7 @@ @interface GCMicroGamepad (SDL) #endif } -static SDL_JoystickGUID -IOS_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID IOS_JoystickGetDeviceGUID(int device_index) { SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); SDL_JoystickGUID guid; @@ -767,15 +968,13 @@ @interface GCMicroGamepad (SDL) return guid; } -static SDL_JoystickID -IOS_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID IOS_JoystickGetDeviceInstanceID(int device_index) { SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); return device ? device->instance_id : -1; } -static int -IOS_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int IOS_JoystickOpen(SDL_Joystick *joystick, int device_index) { SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); if (device == NULL) { @@ -809,12 +1008,12 @@ @interface GCMicroGamepad (SDL) #endif } else { #ifdef SDL_JOYSTICK_MFI - if (device->uses_pause_handler) { + if (device->pause_button_index >= 0) { GCController *controller = device->controller; controller.controllerPausedHandler = ^(GCController *c) { - if (joystick->hwdata) { - ++joystick->hwdata->num_pause_presses; - } + if (joystick->hwdata) { + joystick->hwdata->pause_button_pressed = SDL_GetTicks(); + } }; } @@ -846,15 +1045,14 @@ @interface GCMicroGamepad (SDL) #endif /* SDL_JOYSTICK_MFI */ } } - if (device->remote) { + if (device->is_siri_remote) { ++SDL_AppleTVRemoteOpenedAsJoystick; } return 0; } -static void -IOS_AccelerometerUpdate(SDL_Joystick *joystick) +static void IOS_AccelerometerUpdate(SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_iOS_ACCELEROMETER const float maxgforce = SDL_IPHONE_MAX_GFORCE; @@ -891,15 +1089,14 @@ @interface GCMicroGamepad (SDL) accel.z = SDL_clamp(accel.z, -maxgforce, maxgforce); /* pass in data mapped to range of SInt16 */ - SDL_PrivateJoystickAxis(joystick, 0, (accel.x / maxgforce) * maxsint16); + SDL_PrivateJoystickAxis(joystick, 0, (accel.x / maxgforce) * maxsint16); SDL_PrivateJoystickAxis(joystick, 1, -(accel.y / maxgforce) * maxsint16); - SDL_PrivateJoystickAxis(joystick, 2, (accel.z / maxgforce) * maxsint16); + SDL_PrivateJoystickAxis(joystick, 2, (accel.z / maxgforce) * maxsint16); #endif /* SDL_JOYSTICK_iOS_ACCELEROMETER */ } #ifdef SDL_JOYSTICK_MFI -static Uint8 -IOS_MFIJoystickHatStateForDPad(GCControllerDirectionPad *dpad) +static Uint8 IOS_MFIJoystickHatStateForDPad(GCControllerDirectionPad *dpad) { Uint8 hat = 0; @@ -923,17 +1120,16 @@ @interface GCMicroGamepad (SDL) } #endif -static void -IOS_MFIJoystickUpdate(SDL_Joystick *joystick) +static void IOS_MFIJoystickUpdate(SDL_Joystick *joystick) { -#if SDL_JOYSTICK_MFI +#ifdef SDL_JOYSTICK_MFI @autoreleasepool { - GCController *controller = joystick->hwdata->controller; + SDL_JoystickDeviceItem *device = joystick->hwdata; + GCController *controller = device->controller; Uint8 hatstate = SDL_HAT_CENTERED; int i; - int pause_button_index = 0; -#ifdef DEBUG_CONTROLLER_STATE +#if defined(DEBUG_CONTROLLER_STATE) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { if (controller.physicalInputProfile) { for (id key in controller.physicalInputProfile.buttons) { @@ -944,29 +1140,74 @@ @interface GCMicroGamepad (SDL) for (id key in controller.physicalInputProfile.axes) { GCControllerAxisInput *axis = controller.physicalInputProfile.axes[key]; if (axis.value != 0.0f) - NSLog(@"Axis %@ = %.2f\n", key, axis.value); + NSLog(@"Axis %@ = %g\n", key, axis.value); + } + for (id key in controller.physicalInputProfile.dpads) { + GCControllerDirectionPad *dpad = controller.physicalInputProfile.dpads[key]; + if (dpad.up.isPressed || dpad.down.isPressed || dpad.left.isPressed || dpad.right.isPressed) { + NSLog(@"Hat %@ =%s%s%s%s\n", key, + dpad.up.isPressed ? " UP" : "", + dpad.down.isPressed ? " DOWN" : "", + dpad.left.isPressed ? " LEFT" : "", + dpad.right.isPressed ? " RIGHT" : ""); + } } } } -#endif +#endif /* DEBUG_CONTROLLER_STATE */ + +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + NSDictionary *elements = controller.physicalInputProfile.elements; + NSDictionary *buttons = controller.physicalInputProfile.buttons; + int axis = 0; + int button = 0; + + for (id key in device->axes) { + Sint16 value; + GCControllerElement *element = elements[key]; + if ([element isKindOfClass:[GCControllerAxisInput class]]) { + value = (Sint16)([(GCControllerAxisInput *)element value] * 32767); + } else { + value = (Sint16)([(GCControllerButtonInput *)element value] * 32767); + } + SDL_PrivateJoystickAxis(joystick, axis++, value); + } + for (id key in device->buttons) { + Uint8 value; + if (button == device->pause_button_index) { + value = (device->pause_button_pressed > 0); + } else { + value = buttons[key].isPressed; + } + SDL_PrivateJoystickButton(joystick, button++, value); + } + } else +#endif if (controller.extendedGamepad) { + SDL_bool isstack; GCExtendedGamepad *gamepad = controller.extendedGamepad; /* Axis order matches the XInput Windows mappings. */ Sint16 axes[] = { - (Sint16) (gamepad.leftThumbstick.xAxis.value * 32767), - (Sint16) (gamepad.leftThumbstick.yAxis.value * -32767), - (Sint16) ((gamepad.leftTrigger.value * 65535) - 32768), - (Sint16) (gamepad.rightThumbstick.xAxis.value * 32767), - (Sint16) (gamepad.rightThumbstick.yAxis.value * -32767), - (Sint16) ((gamepad.rightTrigger.value * 65535) - 32768), + (Sint16)(gamepad.leftThumbstick.xAxis.value * 32767), + (Sint16)(gamepad.leftThumbstick.yAxis.value * -32767), + (Sint16)((gamepad.leftTrigger.value * 65535) - 32768), + (Sint16)(gamepad.rightThumbstick.xAxis.value * 32767), + (Sint16)(gamepad.rightThumbstick.yAxis.value * -32767), + (Sint16)((gamepad.rightTrigger.value * 65535) - 32768), }; /* Button order matches the XInput Windows mappings. */ - Uint8 buttons[joystick->nbuttons]; + Uint8 *buttons = SDL_small_alloc(Uint8, joystick->nbuttons, &isstack); int button_count = 0; + if (buttons == NULL) { + SDL_OutOfMemory(); + return; + } + /* These buttons are part of the original MFi spec */ buttons[button_count++] = gamepad.buttonA.isPressed; buttons[button_count++] = gamepad.buttonB.isPressed; @@ -976,78 +1217,29 @@ @interface GCMicroGamepad (SDL) buttons[button_count++] = gamepad.rightShoulder.isPressed; /* These buttons are available on some newer controllers */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunguarded-availability-new" - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_LEFTSTICK)) { - buttons[button_count++] = gamepad.leftThumbstickButton.isPressed; - } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_RIGHTSTICK)) { - buttons[button_count++] = gamepad.rightThumbstickButton.isPressed; - } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) { - buttons[button_count++] = gamepad.buttonOptions.isPressed; - } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_GUIDE)) { - buttons[button_count++] = gamepad.buttonHome.isPressed; - } - /* This must be the last button, so we can optionally handle it with pause_button_index below */ - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { - if (joystick->hwdata->uses_pause_handler) { - pause_button_index = button_count; - buttons[button_count++] = joystick->delayed_guide_button; - } else { - buttons[button_count++] = gamepad.buttonMenu.isPressed; - } - } - -#ifdef ENABLE_PHYSICAL_INPUT_PROFILE - if (joystick->hwdata->has_dualshock_touchpad) { - GCControllerDirectionPad *dpad; - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputDualShockTouchpadButton].isPressed; - - dpad = controller.physicalInputProfile.dpads[GCInputDualShockTouchpadOne]; - if (dpad.xAxis.value || dpad.yAxis.value) { - SDL_PrivateJoystickTouchpad(joystick, 0, 0, SDL_PRESSED, (1.0f + dpad.xAxis.value) * 0.5f, 1.0f - (1.0f + dpad.yAxis.value) * 0.5f, 1.0f); - } else { - SDL_PrivateJoystickTouchpad(joystick, 0, 0, SDL_RELEASED, 0.0f, 0.0f, 1.0f); + if (@available(macOS 10.14.1, iOS 12.1, tvOS 12.1, *)) { + if (device->button_mask & (1 << SDL_CONTROLLER_BUTTON_LEFTSTICK)) { + buttons[button_count++] = gamepad.leftThumbstickButton.isPressed; } - - dpad = controller.physicalInputProfile.dpads[GCInputDualShockTouchpadTwo]; - if (dpad.xAxis.value || dpad.yAxis.value) { - SDL_PrivateJoystickTouchpad(joystick, 0, 1, SDL_PRESSED, (1.0f + dpad.xAxis.value) * 0.5f, 1.0f - (1.0f + dpad.yAxis.value) * 0.5f, 1.0f); - } else { - SDL_PrivateJoystickTouchpad(joystick, 0, 1, SDL_RELEASED, 0.0f, 0.0f, 1.0f); + if (device->button_mask & (1 << SDL_CONTROLLER_BUTTON_RIGHTSTICK)) { + buttons[button_count++] = gamepad.rightThumbstickButton.isPressed; } } - - if (joystick->hwdata->has_xbox_paddles) { - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_PADDLE1)) { - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleOne].isPressed; - } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_PADDLE2)) { - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleTwo].isPressed; - } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_PADDLE3)) { - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleThree].isPressed; + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + if (device->button_mask & (1 << SDL_CONTROLLER_BUTTON_BACK)) { + buttons[button_count++] = gamepad.buttonOptions.isPressed; } - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_PADDLE4)) { - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxPaddleFour].isPressed; - } - - /* - SDL_Log("Paddles: [%d,%d,%d,%d]", - controller.physicalInputProfile.buttons[GCInputXboxPaddleOne].isPressed, - controller.physicalInputProfile.buttons[GCInputXboxPaddleTwo].isPressed, - controller.physicalInputProfile.buttons[GCInputXboxPaddleThree].isPressed, - controller.physicalInputProfile.buttons[GCInputXboxPaddleFour].isPressed); - */ } - - if (joystick->hwdata->has_xbox_share_button) { - buttons[button_count++] = controller.physicalInputProfile.buttons[GCInputXboxShareButton].isPressed; + if (device->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { + if (device->pause_button_index >= 0) { + /* Guaranteed if buttonMenu is not supported on this OS */ + buttons[button_count++] = (device->pause_button_pressed > 0); + } else { + if (@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)) { + buttons[button_count++] = gamepad.buttonMenu.isPressed; + } + } } -#endif -#pragma clang diagnostic pop hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad); @@ -1059,80 +1251,54 @@ @interface GCMicroGamepad (SDL) SDL_PrivateJoystickButton(joystick, i, buttons[i]); } -#ifdef ENABLE_MFI_SENSORS - if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { - GCMotion *motion = controller.motion; - if (motion && motion.sensorsActive) { - float data[3]; - - if (motion.hasRotationRate) { - GCRotationRate rate = motion.rotationRate; - data[0] = rate.x; - data[1] = rate.z; - data[2] = -rate.y; - SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, 0, data, 3); - } - if (motion.hasGravityAndUserAcceleration) { - GCAcceleration accel = motion.acceleration; - data[0] = -accel.x * SDL_STANDARD_GRAVITY; - data[1] = -accel.y * SDL_STANDARD_GRAVITY; - data[2] = -accel.z * SDL_STANDARD_GRAVITY; - SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_ACCEL, 0, data, 3); - } - } - } -#endif /* ENABLE_MFI_SENSORS */ - + SDL_small_free(buttons, isstack); } else if (controller.gamepad) { + SDL_bool isstack; GCGamepad *gamepad = controller.gamepad; /* Button order matches the XInput Windows mappings. */ - Uint8 buttons[joystick->nbuttons]; + Uint8 *buttons = SDL_small_alloc(Uint8, joystick->nbuttons, &isstack); int button_count = 0; + + if (buttons == NULL) { + SDL_OutOfMemory(); + return; + } + buttons[button_count++] = gamepad.buttonA.isPressed; buttons[button_count++] = gamepad.buttonB.isPressed; buttons[button_count++] = gamepad.buttonX.isPressed; buttons[button_count++] = gamepad.buttonY.isPressed; buttons[button_count++] = gamepad.leftShoulder.isPressed; buttons[button_count++] = gamepad.rightShoulder.isPressed; - pause_button_index = button_count; - buttons[button_count++] = joystick->delayed_guide_button; + buttons[button_count++] = (device->pause_button_pressed > 0); hatstate = IOS_MFIJoystickHatStateForDPad(gamepad.dpad); for (i = 0; i < button_count; i++) { SDL_PrivateJoystickButton(joystick, i, buttons[i]); } + + SDL_small_free(buttons, isstack); } #if TARGET_OS_TV else if (controller.microGamepad) { + Uint8 buttons[joystick->nbuttons]; + int button_count = 0; GCMicroGamepad *gamepad = controller.microGamepad; Sint16 axes[] = { - (Sint16) (gamepad.dpad.xAxis.value * 32767), - (Sint16) (gamepad.dpad.yAxis.value * -32767), + (Sint16)(gamepad.dpad.xAxis.value * 32767), + (Sint16)(gamepad.dpad.yAxis.value * -32767), }; for (i = 0; i < SDL_arraysize(axes); i++) { SDL_PrivateJoystickAxis(joystick, i, axes[i]); } - Uint8 buttons[joystick->nbuttons]; - int button_count = 0; buttons[button_count++] = gamepad.buttonA.isPressed; buttons[button_count++] = gamepad.buttonX.isPressed; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunguarded-availability-new" - /* This must be the last button, so we can optionally handle it with pause_button_index below */ - if (joystick->hwdata->button_mask & (1 << SDL_CONTROLLER_BUTTON_START)) { - if (joystick->hwdata->uses_pause_handler) { - pause_button_index = button_count; - buttons[button_count++] = joystick->delayed_guide_button; - } else { - buttons[button_count++] = gamepad.buttonMenu.isPressed; - } - } -#pragma clang diagnostic pop + buttons[button_count++] = (device->pause_button_pressed > 0); for (i = 0; i < button_count; i++) { SDL_PrivateJoystickButton(joystick, i, buttons[i]); @@ -1144,14 +1310,60 @@ @interface GCMicroGamepad (SDL) SDL_PrivateJoystickHat(joystick, 0, hatstate); } - if (joystick->hwdata->uses_pause_handler) { - for (i = 0; i < joystick->hwdata->num_pause_presses; i++) { - SDL_PrivateJoystickButton(joystick, pause_button_index, SDL_PRESSED); - SDL_PrivateJoystickButton(joystick, pause_button_index, SDL_RELEASED); + if (device->pause_button_pressed) { + /* The pause callback is instantaneous, so we extend the duration to allow "holding down" by pressing it repeatedly */ + const int PAUSE_BUTTON_PRESS_DURATION_MS = 250; + if (SDL_TICKS_PASSED(SDL_GetTicks(), device->pause_button_pressed + PAUSE_BUTTON_PRESS_DURATION_MS)) { + device->pause_button_pressed = 0; } - joystick->hwdata->num_pause_presses = 0; } +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + if (device->has_dualshock_touchpad) { + GCControllerDirectionPad *dpad; + + dpad = controller.physicalInputProfile.dpads[GCInputDualShockTouchpadOne]; + if (dpad.xAxis.value || dpad.yAxis.value) { + SDL_PrivateJoystickTouchpad(joystick, 0, 0, SDL_PRESSED, (1.0f + dpad.xAxis.value) * 0.5f, 1.0f - (1.0f + dpad.yAxis.value) * 0.5f, 1.0f); + } else { + SDL_PrivateJoystickTouchpad(joystick, 0, 0, SDL_RELEASED, 0.0f, 0.0f, 1.0f); + } + + dpad = controller.physicalInputProfile.dpads[GCInputDualShockTouchpadTwo]; + if (dpad.xAxis.value || dpad.yAxis.value) { + SDL_PrivateJoystickTouchpad(joystick, 0, 1, SDL_PRESSED, (1.0f + dpad.xAxis.value) * 0.5f, 1.0f - (1.0f + dpad.yAxis.value) * 0.5f, 1.0f); + } else { + SDL_PrivateJoystickTouchpad(joystick, 0, 1, SDL_RELEASED, 0.0f, 0.0f, 1.0f); + } + } + } +#endif /* ENABLE_PHYSICAL_INPUT_PROFILE */ + +#ifdef ENABLE_MFI_SENSORS + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + GCMotion *motion = controller.motion; + if (motion && motion.sensorsActive) { + float data[3]; + + if (motion.hasRotationRate) { + GCRotationRate rate = motion.rotationRate; + data[0] = rate.x; + data[1] = rate.z; + data[2] = -rate.y; + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, 0, data, 3); + } + if (motion.hasGravityAndUserAcceleration) { + GCAcceleration accel = motion.acceleration; + data[0] = -accel.x * SDL_STANDARD_GRAVITY; + data[1] = -accel.y * SDL_STANDARD_GRAVITY; + data[2] = -accel.z * SDL_STANDARD_GRAVITY; + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_ACCEL, 0, data, 3); + } + } + } +#endif /* ENABLE_MFI_SENSORS */ + #ifdef ENABLE_MFI_BATTERY if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { GCDeviceBattery *battery = controller.battery; @@ -1160,19 +1372,18 @@ @interface GCMicroGamepad (SDL) switch (battery.batteryState) { case GCDeviceBatteryStateDischarging: - { - float power_level = battery.batteryLevel; - if (power_level <= 0.05f) { - ePowerLevel = SDL_JOYSTICK_POWER_EMPTY; - } else if (power_level <= 0.20f) { - ePowerLevel = SDL_JOYSTICK_POWER_LOW; - } else if (power_level <= 0.70f) { - ePowerLevel = SDL_JOYSTICK_POWER_MEDIUM; - } else { - ePowerLevel = SDL_JOYSTICK_POWER_FULL; - } + { + float power_level = battery.batteryLevel; + if (power_level <= 0.05f) { + ePowerLevel = SDL_JOYSTICK_POWER_EMPTY; + } else if (power_level <= 0.20f) { + ePowerLevel = SDL_JOYSTICK_POWER_LOW; + } else if (power_level <= 0.70f) { + ePowerLevel = SDL_JOYSTICK_POWER_MEDIUM; + } else { + ePowerLevel = SDL_JOYSTICK_POWER_FULL; } - break; + } break; case GCDeviceBatteryStateCharging: ePowerLevel = SDL_JOYSTICK_POWER_WIRED; break; @@ -1194,15 +1405,16 @@ @interface GCMicroGamepad (SDL) #ifdef ENABLE_MFI_RUMBLE @interface SDL_RumbleMotor : NSObject - @property(nonatomic,strong) CHHapticEngine *engine API_AVAILABLE(macos(10.16), ios(13.0), tvos(14.0)); - @property(nonatomic,strong) id player API_AVAILABLE(macos(10.16), ios(13.0), tvos(14.0)); - @property bool active; +@property(nonatomic, strong) CHHapticEngine *engine API_AVAILABLE(macos(10.16), ios(13.0), tvos(14.0)); +@property(nonatomic, strong) id player API_AVAILABLE(macos(10.16), ios(13.0), tvos(14.0)); +@property bool active; @end -@implementation SDL_RumbleMotor { +@implementation SDL_RumbleMotor +{ } --(void)cleanup +- (void)cleanup { @autoreleasepool { if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { @@ -1218,7 +1430,7 @@ -(void)cleanup } } --(int)setIntensity:(float)intensity +- (int)setIntensity:(float)intensity { @autoreleasepool { if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { @@ -1268,7 +1480,7 @@ -(int)setIntensity:(float)intensity } } --(id) initWithController:(GCController*)controller locality:(GCHapticsLocality)locality API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0)) +- (id)initWithController:(GCController *)controller locality:(GCHapticsLocality)locality API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0)) { @autoreleasepool { NSError *error; @@ -1289,22 +1501,22 @@ -(id) initWithController:(GCController*)controller locality:(GCHapticsLocality)l } self.engine.stoppedHandler = ^(CHHapticEngineStoppedReason stoppedReason) { - SDL_RumbleMotor *_this = weakSelf; - if (_this == nil) { - return; - } + SDL_RumbleMotor *_this = weakSelf; + if (_this == nil) { + return; + } - _this.player = nil; - _this.engine = nil; + _this.player = nil; + _this.engine = nil; }; self.engine.resetHandler = ^{ - SDL_RumbleMotor *_this = weakSelf; - if (_this == nil) { - return; - } + SDL_RumbleMotor *_this = weakSelf; + if (_this == nil) { + return; + } - _this.player = nil; - [_this.engine startAndReturnError:nil]; + _this.player = nil; + [_this.engine startAndReturnError:nil]; }; return self; @@ -1314,54 +1526,55 @@ -(id) initWithController:(GCController*)controller locality:(GCHapticsLocality)l @end @interface SDL_RumbleContext : NSObject - @property(nonatomic,strong) SDL_RumbleMotor *m_low_frequency_motor; - @property(nonatomic,strong) SDL_RumbleMotor *m_high_frequency_motor; - @property(nonatomic,strong) SDL_RumbleMotor *m_left_trigger_motor; - @property(nonatomic,strong) SDL_RumbleMotor *m_right_trigger_motor; +@property(nonatomic, strong) SDL_RumbleMotor *lowFrequencyMotor; +@property(nonatomic, strong) SDL_RumbleMotor *highFrequencyMotor; +@property(nonatomic, strong) SDL_RumbleMotor *leftTriggerMotor; +@property(nonatomic, strong) SDL_RumbleMotor *rightTriggerMotor; @end -@implementation SDL_RumbleContext { +@implementation SDL_RumbleContext +{ } --(id) initWithLowFrequencyMotor:(SDL_RumbleMotor*)low_frequency_motor - HighFrequencyMotor:(SDL_RumbleMotor*)high_frequency_motor - LeftTriggerMotor:(SDL_RumbleMotor*)left_trigger_motor - RightTriggerMotor:(SDL_RumbleMotor*)right_trigger_motor +- (id)initWithLowFrequencyMotor:(SDL_RumbleMotor *)low_frequency_motor + HighFrequencyMotor:(SDL_RumbleMotor *)high_frequency_motor + LeftTriggerMotor:(SDL_RumbleMotor *)left_trigger_motor + RightTriggerMotor:(SDL_RumbleMotor *)right_trigger_motor { self = [super init]; - self.m_low_frequency_motor = low_frequency_motor; - self.m_high_frequency_motor = high_frequency_motor; - self.m_left_trigger_motor = left_trigger_motor; - self.m_right_trigger_motor = right_trigger_motor; + self.lowFrequencyMotor = low_frequency_motor; + self.highFrequencyMotor = high_frequency_motor; + self.leftTriggerMotor = left_trigger_motor; + self.rightTriggerMotor = right_trigger_motor; return self; } --(int) rumbleWithLowFrequency:(Uint16)low_frequency_rumble andHighFrequency:(Uint16)high_frequency_rumble +- (int)rumbleWithLowFrequency:(Uint16)low_frequency_rumble andHighFrequency:(Uint16)high_frequency_rumble { int result = 0; - result += [self.m_low_frequency_motor setIntensity:((float)low_frequency_rumble / 65535.0f)]; - result += [self.m_high_frequency_motor setIntensity:((float)high_frequency_rumble / 65535.0f)]; + result += [self.lowFrequencyMotor setIntensity:((float)low_frequency_rumble / 65535.0f)]; + result += [self.highFrequencyMotor setIntensity:((float)high_frequency_rumble / 65535.0f)]; return ((result < 0) ? -1 : 0); } --(int) rumbleLeftTrigger:(Uint16)left_rumble andRightTrigger:(Uint16)right_rumble +- (int)rumbleLeftTrigger:(Uint16)left_rumble andRightTrigger:(Uint16)right_rumble { int result = 0; - if (self.m_left_trigger_motor && self.m_right_trigger_motor) { - result += [self.m_left_trigger_motor setIntensity:((float)left_rumble / 65535.0f)]; - result += [self.m_right_trigger_motor setIntensity:((float)right_rumble / 65535.0f)]; + if (self.leftTriggerMotor && self.rightTriggerMotor) { + result += [self.leftTriggerMotor setIntensity:((float)left_rumble / 65535.0f)]; + result += [self.rightTriggerMotor setIntensity:((float)right_rumble / 65535.0f)]; } else { result = SDL_Unsupported(); } return ((result < 0) ? -1 : 0); } --(void)cleanup +- (void)cleanup { - [self.m_low_frequency_motor cleanup]; - [self.m_high_frequency_motor cleanup]; + [self.lowFrequencyMotor cleanup]; + [self.highFrequencyMotor cleanup]; } @end @@ -1387,8 +1600,7 @@ -(void)cleanup #endif /* ENABLE_MFI_RUMBLE */ -static int -IOS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int IOS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { #ifdef ENABLE_MFI_RUMBLE SDL_JoystickDeviceItem *device = joystick->hwdata; @@ -1417,8 +1629,7 @@ -(void)cleanup #endif } -static int -IOS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int IOS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { #ifdef ENABLE_MFI_RUMBLE SDL_JoystickDeviceItem *device = joystick->hwdata; @@ -1447,8 +1658,7 @@ -(void)cleanup #endif } -static Uint32 -IOS_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 IOS_JoystickGetCapabilities(SDL_Joystick *joystick) { Uint32 result = 0; @@ -1462,13 +1672,13 @@ -(void)cleanup if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { GCController *controller = device->controller; - #ifdef ENABLE_MFI_LIGHT +#ifdef ENABLE_MFI_LIGHT if (controller.light) { result |= SDL_JOYCAP_LED; } - #endif +#endif - #ifdef ENABLE_MFI_RUMBLE +#ifdef ENABLE_MFI_RUMBLE if (controller.haptics) { for (GCHapticsLocality locality in controller.haptics.supportedLocalities) { if ([locality isEqualToString:GCHapticsLocalityHandles]) { @@ -1478,7 +1688,7 @@ -(void)cleanup } } } - #endif +#endif } } #endif /* ENABLE_MFI_LIGHT || ENABLE_MFI_RUMBLE */ @@ -1486,8 +1696,7 @@ -(void)cleanup return result; } -static int -IOS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int IOS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { #ifdef ENABLE_MFI_LIGHT @autoreleasepool { @@ -1513,14 +1722,12 @@ -(void)cleanup return SDL_Unsupported(); } -static int -IOS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int IOS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -IOS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int IOS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { #ifdef ENABLE_MFI_SENSORS @autoreleasepool { @@ -1544,8 +1751,7 @@ -(void)cleanup return SDL_Unsupported(); } -static void -IOS_JoystickUpdate(SDL_Joystick *joystick) +static void IOS_JoystickUpdate(SDL_Joystick *joystick) { SDL_JoystickDeviceItem *device = joystick->hwdata; @@ -1560,8 +1766,7 @@ -(void)cleanup } } -static void -IOS_JoystickClose(SDL_Joystick *joystick) +static void IOS_JoystickClose(SDL_Joystick *joystick) { SDL_JoystickDeviceItem *device = joystick->hwdata; @@ -1606,13 +1811,12 @@ -(void)cleanup #endif /* SDL_JOYSTICK_MFI */ } } - if (device->remote) { + if (device->is_siri_remote) { --SDL_AppleTVRemoteOpenedAsJoystick; } } -static void -IOS_JoystickQuit(void) +static void IOS_JoystickQuit(void) { @autoreleasepool { #ifdef SDL_JOYSTICK_MFI @@ -1646,41 +1850,155 @@ -(void)cleanup numjoysticks = 0; } -static SDL_bool -IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool IOS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { - return SDL_FALSE; -} +#ifdef ENABLE_PHYSICAL_INPUT_PROFILE + SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); + if (device == NULL) { + return SDL_FALSE; + } + if (device->accelerometer) { + return SDL_FALSE; + } -#if defined(SDL_JOYSTICK_MFI) && defined(__MACOSX__) -SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) -{ - if (@available(macOS 10.16, *)) { - if ([GCController supportsHIDDevice:device]) { - return SDL_TRUE; + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + int axis = 0; + int button = 0; + for (id key in device->axes) { + if ([(NSString *)key isEqualToString:@"Left Thumbstick X Axis"] || + [(NSString *)key isEqualToString:@"Direction Pad X Axis"]) { + out->leftx.kind = EMappingKind_Axis; + out->leftx.target = axis; + } else if ([(NSString *)key isEqualToString:@"Left Thumbstick Y Axis"] || + [(NSString *)key isEqualToString:@"Direction Pad Y Axis"]) { + out->lefty.kind = EMappingKind_Axis; + out->lefty.target = axis; + out->lefty.axis_reversed = SDL_TRUE; + } else if ([(NSString *)key isEqualToString:@"Right Thumbstick X Axis"]) { + out->rightx.kind = EMappingKind_Axis; + out->rightx.target = axis; + } else if ([(NSString *)key isEqualToString:@"Right Thumbstick Y Axis"]) { + out->righty.kind = EMappingKind_Axis; + out->righty.target = axis; + out->righty.axis_reversed = SDL_TRUE; + } else if ([(NSString *)key isEqualToString:GCInputLeftTrigger]) { + out->lefttrigger.kind = EMappingKind_Axis; + out->lefttrigger.target = axis; + out->lefttrigger.half_axis_positive = SDL_TRUE; + } else if ([(NSString *)key isEqualToString:GCInputRightTrigger]) { + out->righttrigger.kind = EMappingKind_Axis; + out->righttrigger.target = axis; + out->righttrigger.half_axis_positive = SDL_TRUE; + } + ++axis; } - /* GCController supportsHIDDevice may return false if the device hasn't been - * seen by the framework yet, so check a few controllers we know are supported. - */ - { - Sint32 vendor = 0; - Sint32 product = 0; - CFTypeRef refCF = NULL; + for (id key in device->buttons) { + SDL_InputMapping *mapping = NULL; - refCF = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)); - if (refCF) { - CFNumberGetValue(refCF, kCFNumberSInt32Type, &vendor); + if ([(NSString *)key isEqualToString:GCInputButtonA]) { + if (device->is_siri_remote > 1) { + /* GCInputButtonA is triggered for any D-Pad press, ignore it in favor of "Button Center" */ + } else { + mapping = &out->a; + } + } else if ([(NSString *)key isEqualToString:GCInputButtonB]) { + if (device->is_switch_joyconL || device->is_switch_joyconR) { + mapping = &out->x; + } else { + mapping = &out->b; + } + } else if ([(NSString *)key isEqualToString:GCInputButtonX]) { + if (device->is_switch_joyconL || device->is_switch_joyconR) { + mapping = &out->b; + } else { + mapping = &out->x; + } + } else if ([(NSString *)key isEqualToString:GCInputButtonY]) { + mapping = &out->y; + } else if ([(NSString *)key isEqualToString:@"Direction Pad Left"]) { + mapping = &out->dpleft; + } else if ([(NSString *)key isEqualToString:@"Direction Pad Right"]) { + mapping = &out->dpright; + } else if ([(NSString *)key isEqualToString:@"Direction Pad Up"]) { + mapping = &out->dpup; + } else if ([(NSString *)key isEqualToString:@"Direction Pad Down"]) { + mapping = &out->dpdown; + } else if ([(NSString *)key isEqualToString:@"Cardinal Direction Pad Left"]) { + mapping = &out->dpleft; + } else if ([(NSString *)key isEqualToString:@"Cardinal Direction Pad Right"]) { + mapping = &out->dpright; + } else if ([(NSString *)key isEqualToString:@"Cardinal Direction Pad Up"]) { + mapping = &out->dpup; + } else if ([(NSString *)key isEqualToString:@"Cardinal Direction Pad Down"]) { + mapping = &out->dpdown; + } else if ([(NSString *)key isEqualToString:GCInputLeftShoulder]) { + mapping = &out->leftshoulder; + } else if ([(NSString *)key isEqualToString:GCInputRightShoulder]) { + mapping = &out->rightshoulder; + } else if ([(NSString *)key isEqualToString:GCInputLeftThumbstickButton]) { + mapping = &out->leftstick; + } else if ([(NSString *)key isEqualToString:GCInputRightThumbstickButton]) { + mapping = &out->rightstick; + } else if ([(NSString *)key isEqualToString:@"Button Home"]) { + mapping = &out->guide; + } else if ([(NSString *)key isEqualToString:GCInputButtonMenu]) { + if (device->is_siri_remote) { + mapping = &out->b; + } else { + mapping = &out->start; + } + } else if ([(NSString *)key isEqualToString:GCInputButtonOptions]) { + mapping = &out->back; + } else if ([(NSString *)key isEqualToString:@"Button Share"]) { + mapping = &out->misc1; + } else if ([(NSString *)key isEqualToString:GCInputXboxPaddleOne]) { + mapping = &out->paddle1; + } else if ([(NSString *)key isEqualToString:GCInputXboxPaddleTwo]) { + mapping = &out->paddle3; + } else if ([(NSString *)key isEqualToString:GCInputXboxPaddleThree]) { + mapping = &out->paddle2; + } else if ([(NSString *)key isEqualToString:GCInputXboxPaddleFour]) { + mapping = &out->paddle4; + } else if ([(NSString *)key isEqualToString:GCInputLeftTrigger]) { + mapping = &out->lefttrigger; + } else if ([(NSString *)key isEqualToString:GCInputRightTrigger]) { + mapping = &out->righttrigger; + } else if ([(NSString *)key isEqualToString:GCInputDualShockTouchpadButton]) { + mapping = &out->touchpad; + } else if ([(NSString *)key isEqualToString:@"Button Center"]) { + mapping = &out->a; } - - refCF = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)); - if (refCF) { - CFNumberGetValue(refCF, kCFNumberSInt32Type, &product); + if (mapping && mapping->kind == EMappingKind_None) { + mapping->kind = EMappingKind_Button; + mapping->target = button; } + ++button; + } + + return SDL_TRUE; + } +#endif /* ENABLE_PHYSICAL_INPUT_PROFILE */ + + return SDL_FALSE; +} - if (vendor == USB_VENDOR_MICROSOFT && SDL_IsJoystickXboxSeriesX(vendor, product)) { +#if defined(SDL_JOYSTICK_MFI) && defined(__MACOSX__) +SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) +{ + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_MFI, SDL_TRUE)) { + return SDL_FALSE; + } + + if (@available(macOS 10.16, *)) { + const int MAX_ATTEMPTS = 3; + for (int attempt = 0; attempt < MAX_ATTEMPTS; ++attempt) { + if ([GCController supportsHIDDevice:device]) { return SDL_TRUE; } + + /* The framework may not have seen the device yet */ + SDL_Delay(10); } } return SDL_FALSE; @@ -1688,19 +2006,22 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) #endif #if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) -static void -GetAppleSFSymbolsNameForElement(GCControllerElement *element, char *name) +/* NOLINTNEXTLINE(readability-non-const-parameter): getCString takes a non-const char* */ +static void GetAppleSFSymbolsNameForElement(GCControllerElement *element, char *name) { if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { if (element) { - [element.sfSymbolsName getCString: name maxLength: 255 encoding: NSASCIIStringEncoding]; + [element.sfSymbolsName getCString:name maxLength:255 encoding:NSASCIIStringEncoding]; } } } -static GCControllerDirectionPad * -GetDirectionalPadForController(GCController *controller) +static GCControllerDirectionPad *GetDirectionalPadForController(GCController *controller) { + if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { + return controller.physicalInputProfile.dpads[GCInputDirectionPad]; + } + if (controller.extendedGamepad) { return controller.extendedGamepad.dpad; } @@ -1719,8 +2040,7 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) static char elementName[256]; -const char * -IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +const char *IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) { elementName[0] = '\0'; #if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) @@ -1728,9 +2048,8 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { GCController *controller = SDL_GameControllerGetJoystick(gamecontroller)->hwdata->controller; if ([controller respondsToSelector:@selector(physicalInputProfile)]) { - NSDictionary *elements = controller.physicalInputProfile.elements; - switch (button) - { + NSDictionary *elements = controller.physicalInputProfile.elements; + switch (button) { case SDL_CONTROLLER_BUTTON_A: GetAppleSFSymbolsNameForElement(elements[GCInputButtonA], elementName); break; @@ -1764,8 +2083,9 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) case SDL_CONTROLLER_BUTTON_RIGHTSHOULDER: GetAppleSFSymbolsNameForElement(elements[GCInputRightShoulder], elementName); break; - case SDL_CONTROLLER_BUTTON_DPAD_UP: { - GCControllerDirectionPad * dpad = GetDirectionalPadForController(controller); + case SDL_CONTROLLER_BUTTON_DPAD_UP: + { + GCControllerDirectionPad *dpad = GetDirectionalPadForController(controller); if (dpad) { GetAppleSFSymbolsNameForElement(dpad.up, elementName); if (SDL_strlen(elementName) == 0) { @@ -1774,8 +2094,9 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) } break; } - case SDL_CONTROLLER_BUTTON_DPAD_DOWN: { - GCControllerDirectionPad * dpad = GetDirectionalPadForController(controller); + case SDL_CONTROLLER_BUTTON_DPAD_DOWN: + { + GCControllerDirectionPad *dpad = GetDirectionalPadForController(controller); if (dpad) { GetAppleSFSymbolsNameForElement(dpad.down, elementName); if (SDL_strlen(elementName) == 0) { @@ -1784,8 +2105,9 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) } break; } - case SDL_CONTROLLER_BUTTON_DPAD_LEFT: { - GCControllerDirectionPad * dpad = GetDirectionalPadForController(controller); + case SDL_CONTROLLER_BUTTON_DPAD_LEFT: + { + GCControllerDirectionPad *dpad = GetDirectionalPadForController(controller); if (dpad) { GetAppleSFSymbolsNameForElement(dpad.left, elementName); if (SDL_strlen(elementName) == 0) { @@ -1794,8 +2116,9 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) } break; } - case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: { - GCControllerDirectionPad * dpad = GetDirectionalPadForController(controller); + case SDL_CONTROLLER_BUTTON_DPAD_RIGHT: + { + GCControllerDirectionPad *dpad = GetDirectionalPadForController(controller); if (dpad) { GetAppleSFSymbolsNameForElement(dpad.right, elementName); if (SDL_strlen(elementName) == 0) { @@ -1832,8 +2155,7 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) return elementName; } -const char * -IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) +const char *IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { elementName[0] = '\0'; #if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE) @@ -1841,9 +2163,8 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) if (@available(macOS 10.16, iOS 14.0, tvOS 14.0, *)) { GCController *controller = SDL_GameControllerGetJoystick(gamecontroller)->hwdata->controller; if ([controller respondsToSelector:@selector(physicalInputProfile)]) { - NSDictionary *elements = controller.physicalInputProfile.elements; - switch (axis) - { + NSDictionary *elements = controller.physicalInputProfile.elements; + switch (axis) { case SDL_CONTROLLER_AXIS_LEFTX: GetAppleSFSymbolsNameForElement(elements[GCInputLeftThumbstick], elementName); break; @@ -1872,14 +2193,13 @@ SDL_bool IOS_SupportedHIDDevice(IOHIDDeviceRef device) return *elementName ? elementName : NULL; } - -SDL_JoystickDriver SDL_IOS_JoystickDriver = -{ +SDL_JoystickDriver SDL_IOS_JoystickDriver = { IOS_JoystickInit, IOS_JoystickGetCount, IOS_JoystickDetect, IOS_JoystickGetDeviceName, IOS_JoystickGetDevicePath, + IOS_JoystickGetDeviceSteamVirtualGamepadSlot, IOS_JoystickGetDevicePlayerIndex, IOS_JoystickSetDevicePlayerIndex, IOS_JoystickGetDeviceGUID, diff --git a/src/joystick/iphoneos/SDL_mfijoystick_c.h b/src/joystick/iphoneos/SDL_mfijoystick_c.h index 157dc829e08d3..8eee5e8142c51 100644 --- a/src/joystick/iphoneos/SDL_mfijoystick_c.h +++ b/src/joystick/iphoneos/SDL_mfijoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,18 +26,19 @@ #include "SDL_stdinc.h" #include "../SDL_sysjoystick.h" +#import +#import + @class GCController; typedef struct joystick_hwdata { SDL_bool accelerometer; - SDL_bool remote; GCController __unsafe_unretained *controller; void *rumble; - SDL_bool uses_pause_handler; - int num_pause_presses; - Uint32 pause_button_down_time; + int pause_button_index; + Uint32 pause_button_pressed; char *name; SDL_Joystick *joystick; @@ -48,6 +49,20 @@ typedef struct joystick_hwdata int nbuttons; int nhats; Uint32 button_mask; + SDL_bool is_xbox; + SDL_bool is_ps4; + SDL_bool is_ps5; + SDL_bool is_switch_pro; + SDL_bool is_switch_joycon_pair; + SDL_bool is_switch_joyconL; + SDL_bool is_switch_joyconR; + SDL_bool is_stadia; + SDL_bool is_backbone_one; + int is_siri_remote; + + NSArray __unsafe_unretained *axes; + NSArray __unsafe_unretained *buttons; + SDL_bool has_dualshock_touchpad; SDL_bool has_xbox_paddles; SDL_bool has_xbox_share_button; @@ -59,5 +74,4 @@ typedef joystick_hwdata SDL_JoystickDeviceItem; #endif /* SDL_JOYSTICK_IOS_H */ - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index 5d3a994f5b164..889d87c2d447a 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,9 +29,9 @@ /* This is the Linux implementation of the SDL joystick API */ #include -#include /* errno, strerror */ +#include /* errno, strerror */ #include -#include /* For the definition of PATH_MAX */ +#include /* For the definition of PATH_MAX */ #ifdef HAVE_INOTIFY #include #endif @@ -53,28 +53,77 @@ #include "../hidapi/SDL_hidapijoystick_c.h" /* This isn't defined in older Linux kernel headers */ +#ifndef MSC_TIMESTAMP +#define MSC_TIMESTAMP 0x05 +#endif + #ifndef SYN_DROPPED #define SYN_DROPPED 3 #endif #ifndef BTN_NORTH -#define BTN_NORTH 0x133 +#define BTN_NORTH 0x133 #endif #ifndef BTN_WEST -#define BTN_WEST 0x134 +#define BTN_WEST 0x134 #endif #ifndef BTN_DPAD_UP -#define BTN_DPAD_UP 0x220 +#define BTN_DPAD_UP 0x220 #endif #ifndef BTN_DPAD_DOWN -#define BTN_DPAD_DOWN 0x221 +#define BTN_DPAD_DOWN 0x221 #endif #ifndef BTN_DPAD_LEFT -#define BTN_DPAD_LEFT 0x222 +#define BTN_DPAD_LEFT 0x222 #endif #ifndef BTN_DPAD_RIGHT -#define BTN_DPAD_RIGHT 0x223 +#define BTN_DPAD_RIGHT 0x223 +#endif + +#ifndef BTN_TRIGGER_HAPPY +#define BTN_TRIGGER_HAPPY 0x2c0 +#define BTN_TRIGGER_HAPPY1 0x2c0 +#define BTN_TRIGGER_HAPPY2 0x2c1 +#define BTN_TRIGGER_HAPPY3 0x2c2 +#define BTN_TRIGGER_HAPPY4 0x2c3 +#define BTN_TRIGGER_HAPPY5 0x2c4 +#define BTN_TRIGGER_HAPPY6 0x2c5 +#define BTN_TRIGGER_HAPPY7 0x2c6 +#define BTN_TRIGGER_HAPPY8 0x2c7 +#define BTN_TRIGGER_HAPPY9 0x2c8 +#define BTN_TRIGGER_HAPPY10 0x2c9 +#define BTN_TRIGGER_HAPPY11 0x2ca +#define BTN_TRIGGER_HAPPY12 0x2cb +#define BTN_TRIGGER_HAPPY13 0x2cc +#define BTN_TRIGGER_HAPPY14 0x2cd +#define BTN_TRIGGER_HAPPY15 0x2ce +#define BTN_TRIGGER_HAPPY16 0x2cf +#define BTN_TRIGGER_HAPPY17 0x2d0 +#define BTN_TRIGGER_HAPPY18 0x2d1 +#define BTN_TRIGGER_HAPPY19 0x2d2 +#define BTN_TRIGGER_HAPPY20 0x2d3 +#define BTN_TRIGGER_HAPPY21 0x2d4 +#define BTN_TRIGGER_HAPPY22 0x2d5 +#define BTN_TRIGGER_HAPPY23 0x2d6 +#define BTN_TRIGGER_HAPPY24 0x2d7 +#define BTN_TRIGGER_HAPPY25 0x2d8 +#define BTN_TRIGGER_HAPPY26 0x2d9 +#define BTN_TRIGGER_HAPPY27 0x2da +#define BTN_TRIGGER_HAPPY28 0x2db +#define BTN_TRIGGER_HAPPY29 0x2dc +#define BTN_TRIGGER_HAPPY30 0x2dd +#define BTN_TRIGGER_HAPPY31 0x2de +#define BTN_TRIGGER_HAPPY32 0x2df +#define BTN_TRIGGER_HAPPY33 0x2e0 +#define BTN_TRIGGER_HAPPY34 0x2e1 +#define BTN_TRIGGER_HAPPY35 0x2e2 +#define BTN_TRIGGER_HAPPY36 0x2e3 +#define BTN_TRIGGER_HAPPY37 0x2e4 +#define BTN_TRIGGER_HAPPY38 0x2e5 +#define BTN_TRIGGER_HAPPY39 0x2e6 +#define BTN_TRIGGER_HAPPY40 0x2e7 #endif + #include "../../core/linux/SDL_evdev_capabilities.h" #include "../../core/linux/SDL_udev.h" #include "../../core/linux/SDL_sandbox.h" @@ -97,17 +146,18 @@ typedef enum static EnumerationMethod enumeration_method = ENUMERATION_UNSET; static SDL_bool IsJoystickJSNode(const char *node); -static int MaybeAddDevice(const char *path); -static int MaybeRemoveDevice(const char *path); +static void MaybeAddDevice(const char *path); +static void MaybeRemoveDevice(const char *path); /* A linked list of available joysticks */ typedef struct SDL_joylist_item { SDL_JoystickID device_instance; - char *path; /* "/dev/input/event2" or whatever */ - char *name; /* "SideWinder 3D Pro" or whatever */ + char *path; /* "/dev/input/event2" or whatever */ + char *name; /* "SideWinder 3D Pro" or whatever */ SDL_JoystickGUID guid; dev_t devnum; + int steam_virtual_gamepad_slot; struct joystick_hwdata *hwdata; struct SDL_joylist_item *next; @@ -118,17 +168,26 @@ typedef struct SDL_joylist_item SDL_GamepadMapping *mapping; } SDL_joylist_item; +/* A linked list of available gamepad sensors */ +typedef struct SDL_sensorlist_item +{ + char *path; /* "/dev/input/event2" or whatever */ + dev_t devnum; + struct joystick_hwdata *hwdata; + struct SDL_sensorlist_item *next; +} SDL_sensorlist_item; + static SDL_bool SDL_classic_joysticks = SDL_FALSE; -static SDL_joylist_item *SDL_joylist = NULL; -static SDL_joylist_item *SDL_joylist_tail = NULL; -static int numjoysticks = 0; +static SDL_joylist_item *SDL_joylist SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static SDL_joylist_item *SDL_joylist_tail SDL_GUARDED_BY(SDL_joystick_lock) = NULL; +static int numjoysticks SDL_GUARDED_BY(SDL_joystick_lock) = 0; +static SDL_sensorlist_item *SDL_sensorlist SDL_GUARDED_BY(SDL_joystick_lock) = NULL; static int inotify_fd = -1; static Uint32 last_joy_detect_time; static time_t last_input_dir_mtime; -static void -FixupDeviceInfoForMapping(int fd, struct input_id *inpid) +static void FixupDeviceInfoForMapping(int fd, struct input_id *inpid) { if (inpid->vendor == 0x045e && inpid->product == 0x0b05 && inpid->version == 0x0903) { /* This is a Microsoft Xbox One Elite Series 2 controller */ @@ -145,15 +204,13 @@ FixupDeviceInfoForMapping(int fd, struct input_id *inpid) /* For Atari vcs modern and classic controllers have the version reflecting * firmware version, but the mapping stays stable so ignore * version information */ - if (inpid->vendor == 0x3250 - && (inpid->product == 0x1001 || inpid->product == 0x1002)) { + if (inpid->vendor == 0x3250 && (inpid->product == 0x1001 || inpid->product == 0x1002)) { inpid->version = 0; } } #ifdef SDL_JOYSTICK_HIDAPI -static SDL_bool -IsVirtualJoystick(Uint16 vendor, Uint16 product, Uint16 version, const char *name) +static SDL_bool IsVirtualJoystick(Uint16 vendor, Uint16 product, Uint16 version, const char *name) { if (vendor == USB_VENDOR_MICROSOFT && product == USB_PRODUCT_XBOX_ONE_S && version == 0 && SDL_strcmp(name, "Xbox One S Controller") == 0) { @@ -164,54 +221,93 @@ IsVirtualJoystick(Uint16 vendor, Uint16 product, Uint16 version, const char *nam } #endif /* SDL_JOYSTICK_HIDAPI */ -static int -GuessIsJoystick(int fd) +static SDL_bool GetSteamVirtualGamepadSlot(int fd, int *slot) +{ + char name[128]; + + if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) > 0) { + const char *digits = SDL_strstr(name, "pad "); + if (digits) { + digits += 4; + if (SDL_isdigit(*digits)) { + *slot = SDL_atoi(digits); + return SDL_TRUE; + } + } + } + return SDL_FALSE; +} + +static int GuessDeviceClass(int fd) { unsigned long evbit[NBITS(EV_MAX)] = { 0 }; unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; unsigned long absbit[NBITS(ABS_MAX)] = { 0 }; unsigned long relbit[NBITS(REL_MAX)] = { 0 }; - int devclass; if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) < 0) || (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) { - return (0); + return 0; } - devclass = SDL_EVDEV_GuessDeviceClass(evbit, absbit, keybit, relbit); + return SDL_EVDEV_GuessDeviceClass(evbit, absbit, keybit, relbit); +} - if (devclass & SDL_UDEV_DEVICE_JOYSTICK) { +static int GuessIsJoystick(int fd) +{ + if (GuessDeviceClass(fd) & SDL_UDEV_DEVICE_JOYSTICK) { + return 1; + } + + return 0; +} + +static int GuessIsSensor(int fd) +{ + if (GuessDeviceClass(fd) & SDL_UDEV_DEVICE_ACCELEROMETER) { return 1; } return 0; } -static int -IsJoystick(const char *path, int fd, char **name_return, SDL_JoystickGUID *guid) +static int IsJoystick(const char *path, int *fd, char **name_return, Uint16 *vendor_return, Uint16 *product_return, SDL_JoystickGUID *guid) { struct input_id inpid; char *name; char product_string[128]; + int class = 0; - if (ioctl(fd, JSIOCGNAME(sizeof(product_string)), product_string) >= 0) { - SDL_zero(inpid); -#if SDL_USE_LIBUDEV - SDL_UDEV_GetProductInfo(path, &inpid.vendor, &inpid.product, &inpid.version); + SDL_zero(inpid); +#ifdef SDL_USE_LIBUDEV + /* Opening input devices can generate synchronous device I/O, so avoid it if we can */ + if (SDL_UDEV_GetProductInfo(path, &inpid.vendor, &inpid.product, &inpid.version, &class) && + !(class & SDL_UDEV_DEVICE_JOYSTICK)) { + return 0; + } #endif - } else { - /* When udev is enabled we only get joystick devices here, so there's no need to test them */ - if (enumeration_method != ENUMERATION_LIBUDEV && !GuessIsJoystick(fd)) { + + if (fd && *fd < 0) { + *fd = open(path, O_RDONLY | O_CLOEXEC, 0); + } + if (!fd || *fd < 0) { + return 0; + } + + if (ioctl(*fd, JSIOCGNAME(sizeof(product_string)), product_string) <= 0) { + /* When udev enumeration or classification, we only got joysticks here, so no need to test */ + if (enumeration_method != ENUMERATION_LIBUDEV && !class && !GuessIsJoystick(*fd)) { return 0; } - if (ioctl(fd, EVIOCGID, &inpid) < 0) { + /* Could have vendor and product already from udev, but should agree with evdev */ + if (ioctl(*fd, EVIOCGID, &inpid) < 0) { return 0; } - if (ioctl(fd, EVIOCGNAME(sizeof(product_string)), product_string) < 0) { + if (ioctl(*fd, EVIOCGNAME(sizeof(product_string)), product_string) < 0) { return 0; } } @@ -230,63 +326,101 @@ IsJoystick(const char *path, int fd, char **name_return, SDL_JoystickGUID *guid) } #endif - FixupDeviceInfoForMapping(fd, &inpid); + FixupDeviceInfoForMapping(*fd, &inpid); #ifdef DEBUG_JOYSTICK SDL_Log("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", name, inpid.bustype, inpid.vendor, inpid.product, inpid.version); #endif - *guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, name, 0, 0); + *guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, NULL, product_string, 0, 0); if (SDL_ShouldIgnoreJoystick(name, *guid)) { SDL_free(name); return 0; } *name_return = name; + *vendor_return = inpid.vendor; + *product_return = inpid.product; return 1; } -#if SDL_USE_LIBUDEV +static int IsSensor(const char *path, int *fd) +{ + struct input_id inpid; + int class = 0; + + SDL_zero(inpid); +#ifdef SDL_USE_LIBUDEV + /* Opening input devices can generate synchronous device I/O, so avoid it if we can */ + if (SDL_UDEV_GetProductInfo(path, &inpid.vendor, &inpid.product, &inpid.version, &class) && + !(class & SDL_UDEV_DEVICE_ACCELEROMETER)) { + return 0; + } +#endif + + if (fd && *fd < 0) { + *fd = open(path, O_RDONLY | O_CLOEXEC, 0); + } + if (!fd || *fd < 0) { + return 0; + } + + if (!class && !GuessIsSensor(*fd)) { + return 0; + } + + if (ioctl(*fd, EVIOCGID, &inpid) < 0) { + return 0; + } + + if (inpid.vendor == USB_VENDOR_NINTENDO && inpid.product == USB_PRODUCT_NINTENDO_WII_REMOTE) { + /* Wii extension controls */ + /* These may create 3 sensor devices but we only support reading from 1: ignore them */ + return 0; + } + + return 1; +} + +#ifdef SDL_USE_LIBUDEV static void joystick_udev_callback(SDL_UDEV_deviceevent udev_type, int udev_class, const char *devpath) { - if (devpath == NULL) { + if (!devpath) { return; } switch (udev_type) { - case SDL_UDEV_DEVICEADDED: - if (!(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { + case SDL_UDEV_DEVICEADDED: + if (!(udev_class & SDL_UDEV_DEVICE_JOYSTICK)) { + return; + } + if (SDL_classic_joysticks) { + if (!IsJoystickJSNode(devpath)) { return; } - if (SDL_classic_joysticks) { - if (!IsJoystickJSNode(devpath)) { - return; - } - } else { - if (IsJoystickJSNode(devpath)) { - return; - } + } else { + if (IsJoystickJSNode(devpath)) { + return; } + } - /* Wait a bit for the hidraw udev node to initialize */ - SDL_Delay(10); + /* Wait a bit for the hidraw udev node to initialize */ + SDL_Delay(10); - MaybeAddDevice(devpath); - break; - - case SDL_UDEV_DEVICEREMOVED: - MaybeRemoveDevice(devpath); - break; - - default: - break; + MaybeAddDevice(devpath); + break; + + case SDL_UDEV_DEVICEREMOVED: + MaybeRemoveDevice(devpath); + break; + + default: + break; } - } #endif /* SDL_USE_LIBUDEV */ -static void -FreeJoylistItem(SDL_joylist_item *item) +static void FreeJoylistItem(SDL_joylist_item *item) { SDL_free(item->mapping); SDL_free(item->path); @@ -294,86 +428,126 @@ FreeJoylistItem(SDL_joylist_item *item) SDL_free(item); } -static int -MaybeAddDevice(const char *path) +static void FreeSensorlistItem(SDL_sensorlist_item *item) +{ + SDL_free(item->path); + SDL_free(item); +} + +static void MaybeAddDevice(const char *path) { struct stat sb; int fd = -1; - int isstick = 0; char *name = NULL; + Uint16 vendor, product; SDL_JoystickGUID guid; SDL_joylist_item *item; + SDL_sensorlist_item *item_sensor; - if (path == NULL) { - return -1; + if (!path) { + return; } if (stat(path, &sb) == -1) { - return -1; + return; } + SDL_LockJoysticks(); + /* Check to make sure it's not already in list. */ - for (item = SDL_joylist; item != NULL; item = item->next) { + for (item = SDL_joylist; item; item = item->next) { if (sb.st_rdev == item->devnum) { - return -1; /* already have this one */ + goto done; /* already have this one */ } } - - fd = open(path, O_RDONLY | O_CLOEXEC, 0); - if (fd < 0) { - return -1; + for (item_sensor = SDL_sensorlist; item_sensor; item_sensor = item_sensor->next) { + if (sb.st_rdev == item_sensor->devnum) { + goto done; /* already have this one */ + } } #ifdef DEBUG_INPUT_EVENTS SDL_Log("Checking %s\n", path); #endif - isstick = IsJoystick(path, fd, &name, &guid); - close(fd); - if (!isstick) { - return -1; - } + if (IsJoystick(path, &fd, &name, &vendor, &product, &guid)) { +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("found joystick: %s\n", path); +#endif + item = (SDL_joylist_item *)SDL_calloc(1, sizeof(SDL_joylist_item)); + if (!item) { + SDL_free(name); + goto done; + } - item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item)); - if (item == NULL) { - SDL_free(name); - return -1; - } + item->devnum = sb.st_rdev; + item->steam_virtual_gamepad_slot = -1; + item->path = SDL_strdup(path); + item->name = name; + item->guid = guid; - item->devnum = sb.st_rdev; - item->path = SDL_strdup(path); - item->name = name; - item->guid = guid; + if (vendor == USB_VENDOR_VALVE && + product == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { + GetSteamVirtualGamepadSlot(fd, &item->steam_virtual_gamepad_slot); + } - if ((item->path == NULL) || (item->name == NULL)) { - FreeJoylistItem(item); - return -1; - } + if ((!item->path) || (!item->name)) { + FreeJoylistItem(item); + goto done; + } - item->device_instance = SDL_GetNextJoystickInstanceID(); - if (SDL_joylist_tail == NULL) { - SDL_joylist = SDL_joylist_tail = item; - } else { - SDL_joylist_tail->next = item; - SDL_joylist_tail = item; + item->device_instance = SDL_GetNextJoystickInstanceID(); + if (!SDL_joylist_tail) { + SDL_joylist = SDL_joylist_tail = item; + } else { + SDL_joylist_tail->next = item; + SDL_joylist_tail = item; + } + + /* Need to increment the joystick count before we post the event */ + ++numjoysticks; + + SDL_PrivateJoystickAdded(item->device_instance); + goto done; } - /* Need to increment the joystick count before we post the event */ - ++numjoysticks; + if (IsSensor(path, &fd)) { +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("found sensor: %s\n", path); +#endif + item_sensor = (SDL_sensorlist_item *)SDL_calloc(1, sizeof(SDL_sensorlist_item)); + if (!item_sensor) { + goto done; + } + item_sensor->devnum = sb.st_rdev; + item_sensor->path = SDL_strdup(path); - SDL_PrivateJoystickAdded(item->device_instance); + if (!item_sensor->path) { + FreeSensorlistItem(item_sensor); + goto done; + } - return numjoysticks; + item_sensor->next = SDL_sensorlist; + SDL_sensorlist = item_sensor; + goto done; + } + +done: + if (fd >= 0) { + close(fd); + } + SDL_UnlockJoysticks(); } -static void -RemoveJoylistItem(SDL_joylist_item *item, SDL_joylist_item *prev) +static void RemoveJoylistItem(SDL_joylist_item *item, SDL_joylist_item *prev) { + SDL_AssertJoysticksLocked(); + if (item->hwdata) { item->hwdata->item = NULL; } - if (prev != NULL) { + if (prev) { prev->next = item->next; } else { SDL_assert(SDL_joylist == item); @@ -391,40 +565,73 @@ RemoveJoylistItem(SDL_joylist_item *item, SDL_joylist_item *prev) FreeJoylistItem(item); } -static int -MaybeRemoveDevice(const char *path) +static void RemoveSensorlistItem(SDL_sensorlist_item *item, SDL_sensorlist_item *prev) +{ + SDL_AssertJoysticksLocked(); + + if (item->hwdata) { + item->hwdata->item_sensor = NULL; + } + + if (prev) { + prev->next = item->next; + } else { + SDL_assert(SDL_sensorlist == item); + SDL_sensorlist = item->next; + } + + /* Do not call SDL_PrivateJoystickRemoved here as RemoveJoylistItem will do it, + * assuming both sensor and joy item are removed at the same time */ + FreeSensorlistItem(item); +} + +static void MaybeRemoveDevice(const char *path) { SDL_joylist_item *item; SDL_joylist_item *prev = NULL; + SDL_sensorlist_item *item_sensor; + SDL_sensorlist_item *prev_sensor = NULL; - if (path == NULL) { - return -1; + if (!path) { + return; } - for (item = SDL_joylist; item != NULL; item = item->next) { + SDL_LockJoysticks(); + for (item = SDL_joylist; item; item = item->next) { /* found it, remove it. */ if (SDL_strcmp(path, item->path) == 0) { - const int retval = item->device_instance; RemoveJoylistItem(item, prev); - return retval; + goto done; } prev = item; } - - return -1; + for (item_sensor = SDL_sensorlist; item_sensor; item_sensor = item_sensor->next) { + /* found it, remove it. */ + if (SDL_strcmp(path, item_sensor->path) == 0) { + RemoveSensorlistItem(item_sensor, prev_sensor); + goto done; + } + prev_sensor = item_sensor; + } +done: + SDL_UnlockJoysticks(); } -static void -HandlePendingRemovals(void) +static void HandlePendingRemovals(void) { SDL_joylist_item *prev = NULL; - SDL_joylist_item *item = SDL_joylist; + SDL_joylist_item *item = NULL; + SDL_sensorlist_item *prev_sensor = NULL; + SDL_sensorlist_item *item_sensor = NULL; + + SDL_AssertJoysticksLocked(); - while (item != NULL) { + item = SDL_joylist; + while (item) { if (item->hwdata && item->hwdata->gone) { RemoveJoylistItem(item, prev); - if (prev != NULL) { + if (prev) { item = prev->next; } else { item = SDL_joylist; @@ -434,14 +641,30 @@ HandlePendingRemovals(void) item = item->next; } } + + item_sensor = SDL_sensorlist; + while (item_sensor) { + if (item_sensor->hwdata && item_sensor->hwdata->sensor_gone) { + RemoveSensorlistItem(item_sensor, prev_sensor); + + if (prev_sensor) { + item_sensor = prev_sensor->next; + } else { + item_sensor = SDL_sensorlist; + } + } else { + prev_sensor = item_sensor; + item_sensor = item_sensor->next; + } + } } static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickGUID guid, int *device_instance) { SDL_joylist_item *item; - item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item)); - if (item == NULL) { + item = (SDL_joylist_item *)SDL_calloc(1, sizeof(SDL_joylist_item)); + if (!item) { return SDL_FALSE; } @@ -450,13 +673,14 @@ static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickG item->guid = guid; item->m_bSteamController = SDL_TRUE; - if ((item->path == NULL) || (item->name == NULL)) { - FreeJoylistItem(item); - return SDL_FALSE; + if ((!item->path) || (!item->name)) { + FreeJoylistItem(item); + return SDL_FALSE; } *device_instance = item->device_instance = SDL_GetNextJoystickInstanceID(); - if (SDL_joylist_tail == NULL) { + SDL_LockJoysticks(); + if (!SDL_joylist_tail) { SDL_joylist = SDL_joylist_tail = item; } else { SDL_joylist_tail->next = item; @@ -467,6 +691,7 @@ static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickG ++numjoysticks; SDL_PrivateJoystickAdded(item->device_instance); + SDL_UnlockJoysticks(); return SDL_TRUE; } @@ -476,24 +701,24 @@ static void SteamControllerDisconnectedCallback(int device_instance) SDL_joylist_item *item; SDL_joylist_item *prev = NULL; - for (item = SDL_joylist; item != NULL; item = item->next) { + SDL_LockJoysticks(); + for (item = SDL_joylist; item; item = item->next) { /* found it, remove it. */ if (item->device_instance == device_instance) { RemoveJoylistItem(item, prev); - return; + break; } prev = item; } + SDL_UnlockJoysticks(); } -static int -StrHasPrefix(const char *string, const char *prefix) +static int StrHasPrefix(const char *string, const char *prefix) { - return (SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0); + return SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0; } -static int -StrIsInteger(const char *string) +static int StrIsInteger(const char *string) { const char *p; @@ -510,28 +735,25 @@ StrIsInteger(const char *string) return 1; } -static SDL_bool -IsJoystickJSNode(const char *node) +static SDL_bool IsJoystickJSNode(const char *node) { const char *last_slash = SDL_strrchr(node, '/'); if (last_slash) { node = last_slash + 1; } - return (StrHasPrefix(node, "js") && StrIsInteger(node + 2)); + return StrHasPrefix(node, "js") && StrIsInteger(node + 2); } -static SDL_bool -IsJoystickEventNode(const char *node) +static SDL_bool IsJoystickEventNode(const char *node) { const char *last_slash = SDL_strrchr(node, '/'); if (last_slash) { node = last_slash + 1; } - return (StrHasPrefix(node, "event") && StrIsInteger(node + 5)); + return StrHasPrefix(node, "event") && StrIsInteger(node + 5); } -static SDL_bool -IsJoystickDeviceNode(const char *node) +static SDL_bool IsJoystickDeviceNode(const char *node) { if (SDL_classic_joysticks) { return IsJoystickJSNode(node); @@ -542,58 +764,60 @@ IsJoystickDeviceNode(const char *node) #ifdef HAVE_INOTIFY #ifdef HAVE_INOTIFY_INIT1 -static int SDL_inotify_init1(void) { +static int SDL_inotify_init1(void) +{ return inotify_init1(IN_NONBLOCK | IN_CLOEXEC); } #else -static int SDL_inotify_init1(void) { +static int SDL_inotify_init1(void) +{ int fd = inotify_init(); - if (fd < 0) return -1; + if (fd < 0) { + return -1; + } fcntl(fd, F_SETFL, O_NONBLOCK); fcntl(fd, F_SETFD, FD_CLOEXEC); return fd; } #endif -static void -LINUX_InotifyJoystickDetect(void) +static void LINUX_InotifyJoystickDetect(void) { union { struct inotify_event event; char storage[4096]; - char enough_for_inotify[sizeof (struct inotify_event) + NAME_MAX + 1]; + char enough_for_inotify[sizeof(struct inotify_event) + NAME_MAX + 1]; } buf; ssize_t bytes; size_t remain = 0; size_t len; char path[PATH_MAX]; - bytes = read(inotify_fd, &buf, sizeof (buf)); + bytes = read(inotify_fd, &buf, sizeof(buf)); if (bytes > 0) { - remain = (size_t) bytes; + remain = (size_t)bytes; } while (remain > 0) { if (buf.event.len > 0) { if (IsJoystickDeviceNode(buf.event.name)) { - SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", buf.event.name); + (void)SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", buf.event.name); if (buf.event.mask & (IN_CREATE | IN_MOVED_TO | IN_ATTRIB)) { MaybeAddDevice(path); - } - else if (buf.event.mask & (IN_DELETE | IN_MOVED_FROM)) { + } else if (buf.event.mask & (IN_DELETE | IN_MOVED_FROM)) { MaybeRemoveDevice(path); } } } - len = sizeof (struct inotify_event) + buf.event.len; + len = sizeof(struct inotify_event) + buf.event.len; remain -= len; if (remain != 0) { - SDL_memmove (&buf.storage[0], &buf.storage[len], remain); + SDL_memmove(&buf.storage[0], &buf.storage[len], remain); } } } @@ -606,11 +830,11 @@ static int get_event_joystick_index(int event) struct dirent **entries = NULL; char path[PATH_MAX]; - SDL_snprintf(path, SDL_arraysize(path), "/sys/class/input/event%d/device", event); + (void)SDL_snprintf(path, SDL_arraysize(path), "/sys/class/input/event%d/device", event); count = scandir(path, &entries, NULL, alphasort); for (i = 0; i < count; ++i) { if (SDL_strncmp(entries[i]->d_name, "js", 2) == 0) { - joystick_index = SDL_atoi(entries[i]->d_name+2); + joystick_index = SDL_atoi(entries[i]->d_name + 2); } free(entries[i]); /* This should NOT be SDL_free() */ } @@ -623,13 +847,11 @@ static int get_event_joystick_index(int event) * have to do this the first time, to detect devices that already existed * before we started; in the non-inotify code path we do this repeatedly * (polling). */ -static int -filter_entries(const struct dirent *entry) +static int filter_entries(const struct dirent *entry) { return IsJoystickDeviceNode(entry->d_name); } -static int -sort_entries(const void *_a, const void *_b) +static int sort_entries(const void *_a, const void *_b) { const struct dirent **a = (const struct dirent **)_a; const struct dirent **b = (const struct dirent **)_b; @@ -638,12 +860,12 @@ sort_entries(const void *_a, const void *_b) if (SDL_classic_joysticks) { offset = 2; /* strlen("js") */ - numA = SDL_atoi((*a)->d_name+offset); - numB = SDL_atoi((*b)->d_name+offset); + numA = SDL_atoi((*a)->d_name + offset); + numB = SDL_atoi((*b)->d_name + offset); } else { offset = 5; /* strlen("event") */ - numA = SDL_atoi((*a)->d_name+offset); - numB = SDL_atoi((*b)->d_name+offset); + numA = SDL_atoi((*a)->d_name + offset); + numB = SDL_atoi((*b)->d_name + offset); /* See if we can get the joystick ordering */ { @@ -659,13 +881,108 @@ sort_entries(const void *_a, const void *_b) } } } - return (numA - numB); + return numA - numB; +} + +typedef struct +{ + char *path; + int slot; +} VirtualGamepadEntry; + +static int SDLCALL sort_virtual_gamepads(const void *_a, const void *_b) +{ + const VirtualGamepadEntry *a = (const VirtualGamepadEntry *)_a; + const VirtualGamepadEntry *b = (const VirtualGamepadEntry *)_b; + return a->slot - b->slot; +} + +static void LINUX_ScanSteamVirtualGamepads(void) +{ + int i, count; + int fd; + struct dirent **entries = NULL; + char path[PATH_MAX]; + struct input_id inpid; + int num_virtual_gamepads = 0; + int virtual_gamepad_slot; + VirtualGamepadEntry *virtual_gamepads = NULL; +#ifdef SDL_USE_LIBUDEV + int class; +#endif + + count = scandir("/dev/input", &entries, filter_entries, NULL); + for (i = 0; i < count; ++i) { + (void)SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", entries[i]->d_name); + +#ifdef SDL_USE_LIBUDEV + /* Opening input devices can generate synchronous device I/O, so avoid it if we can */ + class = 0; + SDL_zero(inpid); + if (SDL_UDEV_GetProductInfo(path, &inpid.vendor, &inpid.product, &inpid.version, &class) && + (inpid.vendor != USB_VENDOR_VALVE || inpid.product != USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD)) { + free(entries[i]); /* This should NOT be SDL_free() */ + continue; + } +#endif + fd = open(path, O_RDONLY | O_CLOEXEC, 0); + if (fd >= 0) { + if (ioctl(fd, EVIOCGID, &inpid) == 0 && + inpid.vendor == USB_VENDOR_VALVE && + inpid.product == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD && + GetSteamVirtualGamepadSlot(fd, &virtual_gamepad_slot)) { + VirtualGamepadEntry *new_virtual_gamepads = (VirtualGamepadEntry *)SDL_realloc(virtual_gamepads, (num_virtual_gamepads + 1) * sizeof(*virtual_gamepads)); + if (new_virtual_gamepads) { + VirtualGamepadEntry *entry = &new_virtual_gamepads[num_virtual_gamepads]; + entry->path = SDL_strdup(path); + entry->slot = virtual_gamepad_slot; + if (entry->path) { + virtual_gamepads = new_virtual_gamepads; + ++num_virtual_gamepads; + } else { + SDL_free(entry->path); + SDL_free(new_virtual_gamepads); + } + } + } + close(fd); + } + free(entries[i]); /* This should NOT be SDL_free() */ + } + free(entries); /* This should NOT be SDL_free() */ + + if (num_virtual_gamepads > 1) { + SDL_qsort(virtual_gamepads, num_virtual_gamepads, sizeof(*virtual_gamepads), sort_virtual_gamepads); + } + for (i = 0; i < num_virtual_gamepads; ++i) { + MaybeAddDevice(virtual_gamepads[i].path); + SDL_free(virtual_gamepads[i].path); + } + SDL_free(virtual_gamepads); } -static void -LINUX_FallbackJoystickDetect(void) +static void LINUX_ScanInputDevices(void) { - const Uint32 SDL_JOY_DETECT_INTERVAL_MS = 3000; /* Update every 3 seconds */ + int i, count; + struct dirent **entries = NULL; + char path[PATH_MAX]; + + count = scandir("/dev/input", &entries, filter_entries, NULL); + if (count > 1) { + SDL_qsort(entries, count, sizeof(*entries), sort_entries); + } + for (i = 0; i < count; ++i) { + (void)SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", entries[i]->d_name); + MaybeAddDevice(path); + + free(entries[i]); /* This should NOT be SDL_free() */ + } + free(entries); /* This should NOT be SDL_free() */ +} + +static void LINUX_FallbackJoystickDetect(void) +{ + const Uint32 SDL_JOY_DETECT_INTERVAL_MS = 3000; /* Update every 3 seconds */ Uint32 now = SDL_GetTicks(); if (!last_joy_detect_time || SDL_TICKS_PASSED(now, last_joy_detect_time + SDL_JOY_DETECT_INTERVAL_MS)) { @@ -673,21 +990,10 @@ LINUX_FallbackJoystickDetect(void) /* Opening input devices can generate synchronous device I/O, so avoid it if we can */ if (stat("/dev/input", &sb) == 0 && sb.st_mtime != last_input_dir_mtime) { - int i, count; - struct dirent **entries = NULL; - char path[PATH_MAX]; + /* Look for Steam virtual gamepads first, and sort by Steam controller slot */ + LINUX_ScanSteamVirtualGamepads(); - count = scandir("/dev/input", &entries, filter_entries, NULL); - if (count > 1) { - qsort(entries, count, sizeof(*entries), sort_entries); - } - for (i = 0; i < count; ++i) { - SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", entries[i]->d_name); - MaybeAddDevice(path); - - free(entries[i]); /* This should NOT be SDL_free() */ - } - free(entries); /* This should NOT be SDL_free() */ + LINUX_ScanInputDevices(); last_input_dir_mtime = sb.st_mtime; } @@ -696,20 +1002,17 @@ LINUX_FallbackJoystickDetect(void) } } -static void -LINUX_JoystickDetect(void) +static void LINUX_JoystickDetect(void) { -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV if (enumeration_method == ENUMERATION_LIBUDEV) { SDL_UDEV_Poll(); - } - else + } else #endif #ifdef HAVE_INOTIFY - if (inotify_fd >= 0 && last_joy_detect_time != 0) { + if (inotify_fd >= 0 && last_joy_detect_time != 0) { LINUX_InotifyJoystickDetect(); - } - else + } else #endif { LINUX_FallbackJoystickDetect(); @@ -720,23 +1023,25 @@ LINUX_JoystickDetect(void) SDL_UpdateSteamControllers(); } -static int -LINUX_JoystickInit(void) +static int LINUX_JoystickInit(void) { const char *devices = SDL_GetHint(SDL_HINT_JOYSTICK_DEVICE); +#ifdef SDL_USE_LIBUDEV + int udev_status = SDL_UDEV_Init(); +#endif SDL_classic_joysticks = SDL_GetHintBoolean(SDL_HINT_LINUX_JOYSTICK_CLASSIC, SDL_FALSE); enumeration_method = ENUMERATION_UNSET; /* First see if the user specified one or more joysticks to use */ - if (devices != NULL) { + if (devices) { char *envcopy, *envpath, *delim; envcopy = SDL_strdup(devices); envpath = envcopy; - while (envpath != NULL) { + while (envpath) { delim = SDL_strchr(envpath, ':'); - if (delim != NULL) { + if (delim) { *delim++ = '\0'; } MaybeAddDevice(envpath); @@ -755,7 +1060,7 @@ LINUX_JoystickInit(void) /* Manually scan first, since we sort by device number and udev doesn't */ LINUX_JoystickDetect(); -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV if (enumeration_method == ENUMERATION_UNSET) { if (SDL_GetHintBoolean("SDL_JOYSTICK_DISABLE_UDEV", SDL_FALSE)) { SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, @@ -774,29 +1079,31 @@ LINUX_JoystickInit(void) } if (enumeration_method == ENUMERATION_LIBUDEV) { - if (SDL_UDEV_Init() < 0) { - return SDL_SetError("Could not initialize UDEV"); - } + if (udev_status == 0) { + /* Set up the udev callback */ + if (SDL_UDEV_AddCallback(joystick_udev_callback) < 0) { + SDL_UDEV_Quit(); + return SDL_SetError("Could not set up joystick <-> udev callback"); + } - /* Set up the udev callback */ - if (SDL_UDEV_AddCallback(joystick_udev_callback) < 0) { - SDL_UDEV_Quit(); - return SDL_SetError("Could not set up joystick <-> udev callback"); + /* Force a scan to build the initial device list */ + SDL_UDEV_Scan(); + } else { + SDL_LogDebug(SDL_LOG_CATEGORY_INPUT, + "udev init failed, disabling udev integration"); + enumeration_method = ENUMERATION_FALLBACK; } - - /* Force a scan to build the initial device list */ - SDL_UDEV_Scan(); } - else #endif - { + + if (enumeration_method != ENUMERATION_LIBUDEV) { #if defined(HAVE_INOTIFY) inotify_fd = SDL_inotify_init1(); if (inotify_fd < 0) { SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Unable to initialize inotify, falling back to polling: %s", - strerror (errno)); + strerror(errno)); } else { /* We need to watch for attribute changes in addition to * creation, because when a device is first created, it has @@ -809,7 +1116,7 @@ LINUX_JoystickInit(void) inotify_fd = -1; SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Unable to add inotify watch, falling back to polling: %s", - strerror (errno)); + strerror(errno)); } } #endif /* HAVE_INOTIFY */ @@ -818,21 +1125,24 @@ LINUX_JoystickInit(void) return 0; } -static int -LINUX_JoystickGetCount(void) +static int LINUX_JoystickGetCount(void) { + SDL_AssertJoysticksLocked(); + return numjoysticks; } -static SDL_joylist_item * -JoystickByDevIndex(int device_index) +static SDL_joylist_item *JoystickByDevIndex(int device_index) { - SDL_joylist_item *item = SDL_joylist; + SDL_joylist_item *item; + + SDL_AssertJoysticksLocked(); if ((device_index < 0) || (device_index >= numjoysticks)) { return NULL; } + item = SDL_joylist; while (device_index > 0) { SDL_assert(item != NULL); device_index--; @@ -842,80 +1152,80 @@ JoystickByDevIndex(int device_index) return item; } -static const char * -LINUX_JoystickGetDeviceName(int device_index) +static const char *LINUX_JoystickGetDeviceName(int device_index) { return JoystickByDevIndex(device_index)->name; } -static const char * -LINUX_JoystickGetDevicePath(int device_index) +static const char *LINUX_JoystickGetDevicePath(int device_index) { return JoystickByDevIndex(device_index)->path; } -static int -LINUX_JoystickGetDevicePlayerIndex(int device_index) +static int LINUX_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return JoystickByDevIndex(device_index)->steam_virtual_gamepad_slot; +} + +static int LINUX_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -LINUX_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void LINUX_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -LINUX_JoystickGetDeviceGUID( int device_index ) +static SDL_JoystickGUID LINUX_JoystickGetDeviceGUID(int device_index) { return JoystickByDevIndex(device_index)->guid; } /* Function to perform the mapping from device index to the instance id for this index */ -static SDL_JoystickID -LINUX_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID LINUX_JoystickGetDeviceInstanceID(int device_index) { return JoystickByDevIndex(device_index)->device_instance; } -static int -allocate_hatdata(SDL_Joystick *joystick) +static int allocate_hatdata(SDL_Joystick *joystick) { int i; + SDL_AssertJoysticksLocked(); + joystick->hwdata->hats = - (struct hwdata_hat *) SDL_malloc(joystick->nhats * - sizeof(struct hwdata_hat)); - if (joystick->hwdata->hats == NULL) { - return (-1); + (struct hwdata_hat *)SDL_malloc(joystick->nhats * + sizeof(struct hwdata_hat)); + if (!joystick->hwdata->hats) { + return -1; } for (i = 0; i < joystick->nhats; ++i) { joystick->hwdata->hats[i].axis[0] = 1; joystick->hwdata->hats[i].axis[1] = 1; } - return (0); + return 0; } -static int -allocate_balldata(SDL_Joystick *joystick) +static int allocate_balldata(SDL_Joystick *joystick) { int i; + SDL_AssertJoysticksLocked(); + joystick->hwdata->balls = - (struct hwdata_ball *) SDL_malloc(joystick->nballs * - sizeof(struct hwdata_ball)); - if (joystick->hwdata->balls == NULL) { - return (-1); + (struct hwdata_ball *)SDL_malloc(joystick->nballs * + sizeof(struct hwdata_ball)); + if (!joystick->hwdata->balls) { + return -1; } for (i = 0; i < joystick->nballs; ++i) { joystick->hwdata->balls[i].axis[0] = 0; joystick->hwdata->balls[i].axis[1] = 0; } - return (0); + return 0; } -static SDL_bool -GuessIfAxesAreDigitalHat(struct input_absinfo *absinfo_x, struct input_absinfo *absinfo_y) +static SDL_bool GuessIfAxesAreDigitalHat(struct input_absinfo *absinfo_x, struct input_absinfo *absinfo_y) { /* A "hat" is assumed to be a digital input with at most 9 possible states * (3 per axis: negative/zero/positive), as opposed to a true "axis" which @@ -924,29 +1234,30 @@ GuessIfAxesAreDigitalHat(struct input_absinfo *absinfo_x, struct input_absinfo * * other continuous analog axis, so we have to guess. */ /* If both axes are missing, they're not anything. */ - if (!absinfo_x && !absinfo_y) + if (!absinfo_x && !absinfo_y) { return SDL_FALSE; + } /* If the hint says so, treat all hats as digital. */ - if (SDL_GetHintBoolean(SDL_HINT_LINUX_DIGITAL_HATS, SDL_FALSE)) + if (SDL_GetHintBoolean(SDL_HINT_LINUX_DIGITAL_HATS, SDL_FALSE)) { return SDL_TRUE; + } /* If both axes have ranges constrained between -1 and 1, they're definitely digital. */ - if ((!absinfo_x || (absinfo_x->minimum == -1 && absinfo_x->maximum == 1)) && - (!absinfo_y || (absinfo_y->minimum == -1 && absinfo_y->maximum == 1))) + if ((!absinfo_x || (absinfo_x->minimum == -1 && absinfo_x->maximum == 1)) && (!absinfo_y || (absinfo_y->minimum == -1 && absinfo_y->maximum == 1))) { return SDL_TRUE; + } /* If both axes lack fuzz, flat, and resolution values, they're probably digital. */ - if ((!absinfo_x || (!absinfo_x->fuzz && !absinfo_x->flat && !absinfo_x->resolution)) && - (!absinfo_y || (!absinfo_y->fuzz && !absinfo_y->flat && !absinfo_y->resolution))) + if ((!absinfo_x || (!absinfo_x->fuzz && !absinfo_x->flat && !absinfo_x->resolution)) && (!absinfo_y || (!absinfo_y->fuzz && !absinfo_y->flat && !absinfo_y->resolution))) { return SDL_TRUE; + } /* Otherwise, treat them as analog. */ return SDL_FALSE; } -static void -ConfigJoystick(SDL_Joystick *joystick, int fd) +static void ConfigJoystick(SDL_Joystick *joystick, int fd, int fd_sensor) { int i, t; unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; @@ -957,6 +1268,8 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) SDL_bool use_deadzones = SDL_GetHintBoolean(SDL_HINT_LINUX_JOYSTICK_DEADZONES, SDL_FALSE); SDL_bool use_hat_deadzones = SDL_GetHintBoolean(SDL_HINT_LINUX_HAT_DEADZONES, SDL_TRUE); + SDL_AssertJoysticksLocked(); + /* See if this device uses the new unified event API */ if ((ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) && (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) && @@ -988,12 +1301,14 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) int hat_y = -1; struct input_absinfo absinfo_x; struct input_absinfo absinfo_y; - if (test_bit(i, absbit)) + if (test_bit(i, absbit)) { hat_x = ioctl(fd, EVIOCGABS(i), &absinfo_x); - if (test_bit(i + 1, absbit)) + } + if (test_bit(i + 1, absbit)) { hat_y = ioctl(fd, EVIOCGABS(i + 1), &absinfo_y); - if (GuessIfAxesAreDigitalHat((hat_x < 0 ? (void*)0 : &absinfo_x), - (hat_y < 0 ? (void*)0 : &absinfo_y))) { + } + if (GuessIfAxesAreDigitalHat((hat_x < 0 ? (void *)0 : &absinfo_x), + (hat_y < 0 ? (void *)0 : &absinfo_y))) { const int hat_index = (i - ABS_HAT0X) / 2; struct hat_axis_correct *correct = &joystick->hwdata->hat_correct[hat_index]; #ifdef DEBUG_INPUT_EVENTS @@ -1013,15 +1328,15 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) joystick->hwdata->has_hat[hat_index] = SDL_TRUE; correct->use_deadzones = use_hat_deadzones; correct->minimum[0] = (hat_x < 0) ? -1 : absinfo_x.minimum; - correct->maximum[0] = (hat_x < 0) ? 1 : absinfo_x.maximum; + correct->maximum[0] = (hat_x < 0) ? 1 : absinfo_x.maximum; correct->minimum[1] = (hat_y < 0) ? -1 : absinfo_y.minimum; - correct->maximum[1] = (hat_y < 0) ? 1 : absinfo_y.maximum; + correct->maximum[1] = (hat_y < 0) ? 1 : absinfo_y.maximum; ++joystick->nhats; } } for (i = 0; i < ABS_MAX; ++i) { /* Skip digital hats */ - if (joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) { + if (i >= ABS_HAT0X && i <= ABS_HAT3Y && joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) { continue; } if (test_bit(i, absbit)) { @@ -1118,9 +1433,9 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) joystick->hwdata->hats_indices[hat_index] = joystick->nhats++; joystick->hwdata->has_hat[hat_index] = SDL_TRUE; joystick->hwdata->hat_correct[hat_index].minimum[0] = -1; - joystick->hwdata->hat_correct[hat_index].maximum[0] = 1; + joystick->hwdata->hat_correct[hat_index].maximum[0] = 1; joystick->hwdata->hat_correct[hat_index].minimum[1] = -1; - joystick->hwdata->hat_correct[hat_index].maximum[1] = 1; + joystick->hwdata->hat_correct[hat_index].maximum[1] = 1; } } else { #ifdef DEBUG_INPUT_EVENTS @@ -1133,6 +1448,45 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) } } + /* Sensors are only available through the new unified event API */ + if (fd_sensor >= 0 && (ioctl(fd_sensor, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0)) { + if (test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) && test_bit(ABS_Z, absbit)) { + joystick->hwdata->has_accelerometer = SDL_TRUE; + for (i = 0; i < 3; ++i) { + struct input_absinfo absinfo; + if (ioctl(fd_sensor, EVIOCGABS(ABS_X + i), &absinfo) < 0) { + joystick->hwdata->has_accelerometer = SDL_FALSE; + break; /* do not report an accelerometer if we can't read all axes */ + } + joystick->hwdata->accelerometer_scale[i] = absinfo.resolution; +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Joystick has accelerometer axis: 0x%.2x\n", ABS_X + i); + SDL_Log("Values = { val:%d, min:%d, max:%d, fuzz:%d, flat:%d, res:%d }\n", + absinfo.value, absinfo.minimum, absinfo.maximum, + absinfo.fuzz, absinfo.flat, absinfo.resolution); +#endif /* DEBUG_INPUT_EVENTS */ + } + } + + if (test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit) && test_bit(ABS_RZ, absbit)) { + joystick->hwdata->has_gyro = SDL_TRUE; + for (i = 0; i < 3; ++i) { + struct input_absinfo absinfo; + if (ioctl(fd_sensor, EVIOCGABS(ABS_RX + i), &absinfo) < 0) { + joystick->hwdata->has_gyro = SDL_FALSE; + break; /* do not report a gyro if we can't read all axes */ + } + joystick->hwdata->gyro_scale[i] = absinfo.resolution; +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Joystick has gyro axis: 0x%.2x\n", ABS_RX + i); + SDL_Log("Values = { val:%d, min:%d, max:%d, fuzz:%d, flat:%d, res:%d }\n", + absinfo.value, absinfo.minimum, absinfo.maximum, + absinfo.fuzz, absinfo.flat, absinfo.resolution); +#endif /* DEBUG_INPUT_EVENTS */ + } + } + } + /* Allocate data to keep track of these thingamajigs */ if (joystick->nhats > 0) { if (allocate_hatdata(joystick) < 0) { @@ -1155,16 +1509,17 @@ ConfigJoystick(SDL_Joystick *joystick, int fd) } } - /* This is used to do the heavy lifting for LINUX_JoystickOpen and also LINUX_JoystickGetGamepadMapping, so we can query the hardware without adding an opened SDL_Joystick object to the system. This expects `joystick->hwdata` to be allocated and will not free it on error. Returns -1 on error, 0 on success. */ -static int -PrepareJoystickHwdata(SDL_Joystick *joystick, SDL_joylist_item *item) +static int PrepareJoystickHwdata(SDL_Joystick *joystick, SDL_joylist_item *item, SDL_sensorlist_item *item_sensor) { + SDL_AssertJoysticksLocked(); + joystick->hwdata->item = item; + joystick->hwdata->item_sensor = item_sensor; joystick->hwdata->guid = item->guid; joystick->hwdata->effect.id = -1; joystick->hwdata->m_bSteamController = item->m_bSteamController; @@ -1173,12 +1528,14 @@ PrepareJoystickHwdata(SDL_Joystick *joystick, SDL_joylist_item *item) if (item->m_bSteamController) { joystick->hwdata->fd = -1; + joystick->hwdata->fd_sensor = -1; SDL_GetSteamControllerInputs(&joystick->nbuttons, &joystick->naxes, &joystick->nhats); } else { + int fd = -1, fd_sensor = -1; /* Try read-write first, so we can do rumble */ - int fd = open(item->path, O_RDWR | O_CLOEXEC, 0); + fd = open(item->path, O_RDWR | O_CLOEXEC, 0); if (fd < 0) { /* Try read-only again, at least we'll get events in this case */ fd = open(item->path, O_RDONLY | O_CLOEXEC, 0); @@ -1186,65 +1543,150 @@ PrepareJoystickHwdata(SDL_Joystick *joystick, SDL_joylist_item *item) if (fd < 0) { return SDL_SetError("Unable to open %s", item->path); } + /* If opening sensor fail, continue with buttons and axes only */ + if (item_sensor) { + fd_sensor = open(item_sensor->path, O_RDONLY | O_CLOEXEC, 0); + } joystick->hwdata->fd = fd; + joystick->hwdata->fd_sensor = fd_sensor; joystick->hwdata->fname = SDL_strdup(item->path); - if (joystick->hwdata->fname == NULL) { + if (!joystick->hwdata->fname) { close(fd); + if (fd_sensor >= 0) { + close(fd_sensor); + } return SDL_OutOfMemory(); } /* Set the joystick to non-blocking read mode */ fcntl(fd, F_SETFL, O_NONBLOCK); + if (fd_sensor >= 0) { + fcntl(fd_sensor, F_SETFL, O_NONBLOCK); + } /* Get the number of buttons and axes on the joystick */ - ConfigJoystick(joystick, fd); + ConfigJoystick(joystick, fd, fd_sensor); } return 0; } +static SDL_sensorlist_item *GetSensor(SDL_joylist_item *item) +{ + SDL_sensorlist_item *item_sensor; + char uniq_item[128]; + int fd_item = -1; + + SDL_AssertJoysticksLocked(); + + if (!item || !SDL_sensorlist) { + return NULL; + } + + SDL_memset(uniq_item, 0, sizeof(uniq_item)); + fd_item = open(item->path, O_RDONLY | O_CLOEXEC, 0); + if (fd_item < 0) { + return NULL; + } + if (ioctl(fd_item, EVIOCGUNIQ(sizeof(uniq_item) - 1), &uniq_item) < 0) { + return NULL; + } + close(fd_item); +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Joystick UNIQ: %s\n", uniq_item); +#endif /* DEBUG_INPUT_EVENTS */ + + for (item_sensor = SDL_sensorlist; item_sensor; item_sensor = item_sensor->next) { + char uniq_sensor[128]; + int fd_sensor = -1; + if (item_sensor->hwdata) { + /* already associated with another joystick */ + continue; + } + + SDL_memset(uniq_sensor, 0, sizeof(uniq_sensor)); + fd_sensor = open(item_sensor->path, O_RDONLY | O_CLOEXEC, 0); + if (fd_sensor < 0) { + continue; + } + if (ioctl(fd_sensor, EVIOCGUNIQ(sizeof(uniq_sensor) - 1), &uniq_sensor) < 0) { + close(fd_sensor); + continue; + } + close(fd_sensor); +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Sensor UNIQ: %s\n", uniq_sensor); +#endif /* DEBUG_INPUT_EVENTS */ + + if (SDL_strcmp(uniq_item, uniq_sensor) == 0) { + return item_sensor; + } + } + return NULL; +} /* Function to open a joystick for use. The joystick to open is specified by the device index. This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -static int -LINUX_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int LINUX_JoystickOpen(SDL_Joystick *joystick, int device_index) { - SDL_joylist_item *item = JoystickByDevIndex(device_index); + SDL_joylist_item *item; + SDL_sensorlist_item *item_sensor; + + SDL_AssertJoysticksLocked(); - if (item == NULL) { + item = JoystickByDevIndex(device_index); + if (!item) { return SDL_SetError("No such device"); } joystick->instance_id = item->device_instance; joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata)); - if (joystick->hwdata == NULL) { + if (!joystick->hwdata) { return SDL_OutOfMemory(); } - if (PrepareJoystickHwdata(joystick, item) == -1) { + item_sensor = GetSensor(item); + if (PrepareJoystickHwdata(joystick, item, item_sensor) == -1) { SDL_free(joystick->hwdata); joystick->hwdata = NULL; - return -1; /* SDL_SetError will already have been called */ + return -1; /* SDL_SetError will already have been called */ } SDL_assert(item->hwdata == NULL); + SDL_assert(!item_sensor || item_sensor->hwdata == NULL); item->hwdata = joystick->hwdata; + if (item_sensor) { + item_sensor->hwdata = joystick->hwdata; + } /* mark joystick as fresh and ready */ joystick->hwdata->fresh = SDL_TRUE; + if (joystick->hwdata->has_gyro) { + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 0.0f); + } + if (joystick->hwdata->has_accelerometer) { + SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 0.0f); + } + if (joystick->hwdata->fd_sensor >= 0) { + /* Don't keep fd_sensor opened while sensor is disabled */ + close(joystick->hwdata->fd_sensor); + joystick->hwdata->fd_sensor = -1; + } + return 0; } -static int -LINUX_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int LINUX_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { struct input_event event; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata->ff_rumble) { struct ff_effect *effect = &joystick->hwdata->effect; @@ -1282,17 +1724,17 @@ LINUX_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 return 0; } -static int -LINUX_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int LINUX_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -LINUX_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 LINUX_JoystickGetCapabilities(SDL_Joystick *joystick) { Uint32 result = 0; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata->ff_rumble || joystick->hwdata->ff_sine) { result |= SDL_JOYCAP_RUMBLE; } @@ -1300,36 +1742,60 @@ LINUX_JoystickGetCapabilities(SDL_Joystick *joystick) return result; } -static int -LINUX_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int LINUX_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -LINUX_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int LINUX_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -LINUX_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int LINUX_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { - return SDL_Unsupported(); + SDL_AssertJoysticksLocked(); + + if (!joystick->hwdata->has_accelerometer && !joystick->hwdata->has_gyro) { + return SDL_Unsupported(); + } + if (enabled == joystick->hwdata->report_sensor) { + return 0; + } + + if (enabled) { + if (!joystick->hwdata->item_sensor) { + return SDL_SetError("Sensors unplugged."); + } + joystick->hwdata->fd_sensor = open(joystick->hwdata->item_sensor->path, O_RDONLY | O_CLOEXEC, 0); + if (joystick->hwdata->fd_sensor < 0) { + return SDL_SetError("Couldn't open sensor file %s.", joystick->hwdata->item_sensor->path); + } + fcntl(joystick->hwdata->fd_sensor, F_SETFL, O_NONBLOCK); + } else { + SDL_assert(joystick->hwdata->fd_sensor >= 0); + close(joystick->hwdata->fd_sensor); + joystick->hwdata->fd_sensor = -1; + } + + joystick->hwdata->report_sensor = enabled; + return 0; } -static void -HandleHat(SDL_Joystick *stick, int hatidx, int axis, int value) +static void HandleHat(SDL_Joystick *stick, int hatidx, int axis, int value) { - const int hatnum = stick->hwdata->hats_indices[hatidx]; + int hatnum; struct hwdata_hat *the_hat; struct hat_axis_correct *correct; const Uint8 position_map[3][3] = { - {SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP}, - {SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT}, - {SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN} + { SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP }, + { SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT }, + { SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN } }; + SDL_AssertJoysticksLocked(); + + hatnum = stick->hwdata->hats_indices[hatidx]; the_hat = &stick->hwdata->hats[hatnum]; correct = &stick->hwdata->hat_correct[hatidx]; /* Hopefully we detected any analog axes and left them as is rather than trying @@ -1365,18 +1831,19 @@ HandleHat(SDL_Joystick *stick, int hatidx, int axis, int value) } } -static void -HandleBall(SDL_Joystick *stick, Uint8 ball, int axis, int value) +static void HandleBall(SDL_Joystick *stick, Uint8 ball, int axis, int value) { + SDL_AssertJoysticksLocked(); + stick->hwdata->balls[ball].axis[axis] += value; } - -static int -AxisCorrect(SDL_Joystick *joystick, int which, int value) +static int AxisCorrect(SDL_Joystick *joystick, int which, int value) { struct axis_correct *correct; + SDL_AssertJoysticksLocked(); + correct = &joystick->hwdata->abs_correct[which]; if (correct->minimum != correct->maximum) { if (correct->use_deadzones) { @@ -1406,13 +1873,14 @@ AxisCorrect(SDL_Joystick *joystick, int which, int value) return value; } -static void -PollAllValues(SDL_Joystick *joystick) +static void PollAllValues(SDL_Joystick *joystick) { struct input_absinfo absinfo; unsigned long keyinfo[NBITS(KEY_MAX)]; int i; + SDL_AssertJoysticksLocked(); + /* Poll all axis */ for (i = ABS_X; i < ABS_MAX; i++) { /* We don't need to test for digital hats here, they won't have has_abs[] set */ @@ -1422,11 +1890,11 @@ PollAllValues(SDL_Joystick *joystick) #ifdef DEBUG_INPUT_EVENTS SDL_Log("Joystick : Re-read Axis %d (%d) val= %d\n", - joystick->hwdata->abs_map[i], i, absinfo.value); + joystick->hwdata->abs_map[i], i, absinfo.value); #endif SDL_PrivateJoystickAxis(joystick, - joystick->hwdata->abs_map[i], - absinfo.value); + joystick->hwdata->abs_map[i], + absinfo.value); } } } @@ -1447,16 +1915,16 @@ PollAllValues(SDL_Joystick *joystick) /* Poll all buttons */ SDL_zeroa(keyinfo); - if (ioctl(joystick->hwdata->fd, EVIOCGKEY(sizeof (keyinfo)), keyinfo) >= 0) { + if (ioctl(joystick->hwdata->fd, EVIOCGKEY(sizeof(keyinfo)), keyinfo) >= 0) { for (i = 0; i < KEY_MAX; i++) { if (joystick->hwdata->has_key[i]) { const Uint8 value = test_bit(i, keyinfo) ? SDL_PRESSED : SDL_RELEASED; #ifdef DEBUG_INPUT_EVENTS SDL_Log("Joystick : Re-read Button %d (%d) val= %d\n", - joystick->hwdata->key_map[i], i, value); + joystick->hwdata->key_map[i], i, value); #endif SDL_PrivateJoystickButton(joystick, - joystick->hwdata->key_map[i], value); + joystick->hwdata->key_map[i], value); } } } @@ -1464,26 +1932,67 @@ PollAllValues(SDL_Joystick *joystick) /* Joyballs are relative input, so there's no poll state. Events only! */ } -static void -HandleInputEvents(SDL_Joystick *joystick) +static void PollAllSensors(SDL_Joystick *joystick) +{ + struct input_absinfo absinfo; + int i; + + SDL_AssertJoysticksLocked(); + + SDL_assert(joystick->hwdata->fd_sensor >= 0); + + if (joystick->hwdata->has_gyro) { + float data[3] = {0.0f, 0.0f, 0.0f}; + for (i = 0; i < 3; i++) { + if (ioctl(joystick->hwdata->fd_sensor, EVIOCGABS(ABS_RX + i), &absinfo) >= 0) { + data[i] = absinfo.value * (M_PI / 180.f) / joystick->hwdata->gyro_scale[i]; +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Joystick : Re-read Gyro (axis %d) val= %f\n", i, data[i]); +#endif + } + } + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, joystick->hwdata->sensor_tick, data, 3); + } + if (joystick->hwdata->has_accelerometer) { + float data[3] = {0.0f, 0.0f, 0.0f}; + for (i = 0; i < 3; i++) { + if (ioctl(joystick->hwdata->fd_sensor, EVIOCGABS(ABS_X + i), &absinfo) >= 0) { + data[i] = absinfo.value * SDL_STANDARD_GRAVITY / joystick->hwdata->accelerometer_scale[i]; +#ifdef DEBUG_INPUT_EVENTS + SDL_Log("Joystick : Re-read Accelerometer (axis %d) val= %f\n", i, data[i]); +#endif + } + } + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_ACCEL, joystick->hwdata->sensor_tick, data, 3); + } +} + +static void HandleInputEvents(SDL_Joystick *joystick) { struct input_event events[32]; int i, len, code, hat_index; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata->fresh) { PollAllValues(joystick); + if (joystick->hwdata->report_sensor) { + PollAllSensors(joystick); + } joystick->hwdata->fresh = SDL_FALSE; } - while ((len = read(joystick->hwdata->fd, events, (sizeof events))) > 0) { + errno = 0; + + while ((len = read(joystick->hwdata->fd, events, sizeof(events))) > 0) { len /= sizeof(events[0]); for (i = 0; i < len; ++i) { code = events[i].code; /* If the kernel sent a SYN_DROPPED, we are supposed to ignore the rest of the packet (the end of it signified by a SYN_REPORT) */ - if ( joystick->hwdata->recovering_from_dropped && - ((events[i].type != EV_SYN) || (code != SYN_REPORT)) ) { + if (joystick->hwdata->recovering_from_dropped && + ((events[i].type != EV_SYN) || (code != SYN_REPORT))) { continue; } @@ -1508,6 +2017,7 @@ HandleInputEvents(SDL_Joystick *joystick) HandleHat(joystick, hat_index, code % 2, events[i].value); break; } + SDL_FALLTHROUGH; default: events[i].value = AxisCorrect(joystick, code, events[i].value); SDL_PrivateJoystickAxis(joystick, @@ -1529,16 +2039,16 @@ HandleInputEvents(SDL_Joystick *joystick) break; case EV_SYN: switch (code) { - case SYN_DROPPED : + case SYN_DROPPED: #ifdef DEBUG_INPUT_EVENTS SDL_Log("Event SYN_DROPPED detected\n"); #endif joystick->hwdata->recovering_from_dropped = SDL_TRUE; break; - case SYN_REPORT : + case SYN_REPORT: if (joystick->hwdata->recovering_from_dropped) { joystick->hwdata->recovering_from_dropped = SDL_FALSE; - PollAllValues(joystick); /* try to sync up to current state now */ + PollAllValues(joystick); /* try to sync up to current state now */ } break; default: @@ -1553,17 +2063,108 @@ HandleInputEvents(SDL_Joystick *joystick) if (errno == ENODEV) { /* We have to wait until the JoystickDetect callback to remove this */ joystick->hwdata->gone = SDL_TRUE; + errno = 0; + } + + if (joystick->hwdata->report_sensor) { + SDL_assert(joystick->hwdata->fd_sensor >= 0); + + while ((len = read(joystick->hwdata->fd_sensor, events, sizeof(events))) > 0) { + len /= sizeof(events[0]); + for (i = 0; i < len; ++i) { + unsigned int j; + struct input_event *event = &events[i]; + + code = event->code; + + /* If the kernel sent a SYN_DROPPED, we are supposed to ignore the + rest of the packet (the end of it signified by a SYN_REPORT) */ + if (joystick->hwdata->recovering_from_dropped_sensor && + ((event->type != EV_SYN) || (code != SYN_REPORT))) { + continue; + } + + switch (event->type) { + case EV_KEY: + SDL_assert(0); + break; + case EV_ABS: + switch (code) { + case ABS_X: + case ABS_Y: + case ABS_Z: + j = code - ABS_X; + joystick->hwdata->accel_data[j] = event->value * SDL_STANDARD_GRAVITY + / joystick->hwdata->accelerometer_scale[j]; + break; + case ABS_RX: + case ABS_RY: + case ABS_RZ: + j = code - ABS_RX; + joystick->hwdata->gyro_data[j] = event->value * (M_PI / 180.f) + / joystick->hwdata->gyro_scale[j]; + break; + } + break; + case EV_MSC: + if (code == MSC_TIMESTAMP) { + Sint32 tick = event->value; + Sint32 delta; + if (joystick->hwdata->last_tick < tick) { + delta = (tick - joystick->hwdata->last_tick); + } else { + delta = (SDL_MAX_SINT32 - joystick->hwdata->last_tick + tick + 1); + } + joystick->hwdata->sensor_tick += delta; + joystick->hwdata->last_tick = tick; + } + break; + case EV_SYN: + switch (code) { + case SYN_DROPPED: + #ifdef DEBUG_INPUT_EVENTS + SDL_Log("Event SYN_DROPPED detected\n"); + #endif + joystick->hwdata->recovering_from_dropped_sensor = SDL_TRUE; + break; + case SYN_REPORT: + if (joystick->hwdata->recovering_from_dropped_sensor) { + joystick->hwdata->recovering_from_dropped_sensor = SDL_FALSE; + PollAllSensors(joystick); /* try to sync up to current state now */ + } else { + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_GYRO, + joystick->hwdata->sensor_tick, + joystick->hwdata->gyro_data, 3); + SDL_PrivateJoystickSensor(joystick, SDL_SENSOR_ACCEL, + joystick->hwdata->sensor_tick, + joystick->hwdata->accel_data, 3); + } + break; + default: + break; + } + default: + break; + } + } + } + } + + if (errno == ENODEV) { + /* We have to wait until the JoystickDetect callback to remove this */ + joystick->hwdata->sensor_gone = SDL_TRUE; } } -static void -HandleClassicEvents(SDL_Joystick *joystick) +static void HandleClassicEvents(SDL_Joystick *joystick) { struct js_event events[32]; int i, len, code, hat_index; + SDL_AssertJoysticksLocked(); + joystick->hwdata->fresh = SDL_FALSE; - while ((len = read(joystick->hwdata->fd, events, (sizeof events))) > 0) { + while ((len = read(joystick->hwdata->fd, events, sizeof(events))) > 0) { len /= sizeof(events[0]); for (i = 0; i < len; ++i) { switch (events[i].type) { @@ -1589,6 +2190,7 @@ HandleClassicEvents(SDL_Joystick *joystick) HandleHat(joystick, hat_index, code % 2, events[i].value); break; } + SDL_FALLTHROUGH; default: SDL_PrivateJoystickAxis(joystick, joystick->hwdata->abs_map[code], @@ -1600,11 +2202,12 @@ HandleClassicEvents(SDL_Joystick *joystick) } } -static void -LINUX_JoystickUpdate(SDL_Joystick *joystick) +static void LINUX_JoystickUpdate(SDL_Joystick *joystick) { int i; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata->m_bSteamController) { SDL_UpdateSteamController(joystick); return; @@ -1625,15 +2228,16 @@ LINUX_JoystickUpdate(SDL_Joystick *joystick) if (xrel || yrel) { joystick->hwdata->balls[i].axis[0] = 0; joystick->hwdata->balls[i].axis[1] = 0; - SDL_PrivateJoystickBall(joystick, (Uint8) i, xrel, yrel); + SDL_PrivateJoystickBall(joystick, (Uint8)i, xrel, yrel); } } } /* Function to close a joystick after use */ -static void -LINUX_JoystickClose(SDL_Joystick *joystick) +static void LINUX_JoystickClose(SDL_Joystick *joystick) { + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { if (joystick->hwdata->effect.id >= 0) { ioctl(joystick->hwdata->fd, EVIOCRMFF, joystick->hwdata->effect.id); @@ -1642,9 +2246,15 @@ LINUX_JoystickClose(SDL_Joystick *joystick) if (joystick->hwdata->fd >= 0) { close(joystick->hwdata->fd); } + if (joystick->hwdata->fd_sensor >= 0) { + close(joystick->hwdata->fd_sensor); + } if (joystick->hwdata->item) { joystick->hwdata->item->hwdata = NULL; } + if (joystick->hwdata->item_sensor) { + joystick->hwdata->item_sensor->hwdata = NULL; + } SDL_free(joystick->hwdata->key_pam); SDL_free(joystick->hwdata->abs_pam); SDL_free(joystick->hwdata->hats); @@ -1655,11 +2265,14 @@ LINUX_JoystickClose(SDL_Joystick *joystick) } /* Function to perform any system-specific joystick related cleanup */ -static void -LINUX_JoystickQuit(void) +static void LINUX_JoystickQuit(void) { SDL_joylist_item *item = NULL; SDL_joylist_item *next = NULL; + SDL_sensorlist_item *item_sensor = NULL; + SDL_sensorlist_item *next_sensor = NULL; + + SDL_AssertJoysticksLocked(); if (inotify_fd >= 0) { close(inotify_fd); @@ -1670,12 +2283,17 @@ LINUX_JoystickQuit(void) next = item->next; FreeJoylistItem(item); } + for (item_sensor = SDL_sensorlist; item_sensor; item_sensor = next_sensor) { + next_sensor = item_sensor->next; + FreeSensorlistItem(item_sensor); + } SDL_joylist = SDL_joylist_tail = NULL; + SDL_sensorlist = NULL; numjoysticks = 0; -#if SDL_USE_LIBUDEV +#ifdef SDL_USE_LIBUDEV if (enumeration_method == ENUMERATION_LIBUDEV) { SDL_UDEV_DelCallback(joystick_udev_callback); SDL_UDEV_Quit(); @@ -1688,14 +2306,28 @@ LINUX_JoystickQuit(void) /* This is based on the Linux Gamepad Specification available at: https://www.kernel.org/doc/html/v4.15/input/gamepad.html + and the Android gamepad documentation, + https://developer.android.com/develop/ui/views/touch-and-input/game-controllers/controller-input */ -static SDL_bool -LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { SDL_Joystick *joystick; SDL_joylist_item *item = JoystickByDevIndex(device_index); + enum { + MAPPED_TRIGGER_LEFT = 0x1, + MAPPED_TRIGGER_RIGHT = 0x2, + MAPPED_TRIGGER_BOTH = 0x3, + + MAPPED_DPAD_UP = 0x1, + MAPPED_DPAD_DOWN = 0x2, + MAPPED_DPAD_LEFT = 0x4, + MAPPED_DPAD_RIGHT = 0x8, + MAPPED_DPAD_ALL = 0xF, + }; unsigned int mapped; + SDL_AssertJoysticksLocked(); + if (item->checked_mapping) { if (item->mapping) { SDL_memcpy(out, item->mapping, sizeof(*out)); @@ -1710,16 +2342,17 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) /* We temporarily open the device to check how it's configured. Make a fake SDL_Joystick object to do so. */ - joystick = (SDL_Joystick *) SDL_calloc(sizeof(*joystick), 1); - if (joystick == NULL) { + joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1); + if (!joystick) { SDL_OutOfMemory(); return SDL_FALSE; } + joystick->magic = &SDL_joystick_magic; SDL_memcpy(&joystick->guid, &item->guid, sizeof(item->guid)); joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata)); - if (joystick->hwdata == NULL) { + if (!joystick->hwdata) { SDL_free(joystick); SDL_OutOfMemory(); return SDL_FALSE; @@ -1727,10 +2360,10 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) item->checked_mapping = SDL_TRUE; - if (PrepareJoystickHwdata(joystick, item) == -1) { + if (PrepareJoystickHwdata(joystick, item, NULL) == -1) { SDL_free(joystick->hwdata); SDL_free(joystick); - return SDL_FALSE; /* SDL_SetError will already have been called */ + return SDL_FALSE; /* SDL_SetError will already have been called */ } /* don't assign `item->hwdata` so it's not in any global state. */ @@ -1746,6 +2379,10 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) /* We have a gamepad, start filling out the mappings */ +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapping %s (VID/PID 0x%.4x/0x%.4x)", item->name, SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick)); +#endif + if (joystick->hwdata->has_key[BTN_A]) { out->a.kind = EMappingKind_Button; out->a.target = joystick->hwdata->key_map[BTN_A]; @@ -1896,63 +2533,94 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) /* Prefer analog triggers, but settle for digital hat or buttons. */ mapped = 0; + /* Unfortunately there are several conventions for how analog triggers + * are represented as absolute axes: + * + * - Linux Gamepad Specification: + * LT = ABS_HAT2Y, RT = ABS_HAT2X + * - Android (and therefore many Bluetooth controllers): + * LT = ABS_BRAKE, RT = ABS_GAS + * - De facto standard for older Xbox and Playstation controllers: + * LT = ABS_Z, RT = ABS_RZ + * + * We try each one in turn. */ if (joystick->hwdata->has_abs[ABS_HAT2Y]) { + /* Linux Gamepad Specification */ out->lefttrigger.kind = EMappingKind_Axis; out->lefttrigger.target = joystick->hwdata->abs_map[ABS_HAT2Y]; - mapped |= 0x1; + mapped |= MAPPED_TRIGGER_LEFT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped LEFTTRIGGER to axis %d (ABS_HAT2Y)", out->lefttrigger.target); +#endif + } else if (joystick->hwdata->has_abs[ABS_BRAKE]) { + /* Android convention */ + out->lefttrigger.kind = EMappingKind_Axis; + out->lefttrigger.target = joystick->hwdata->abs_map[ABS_BRAKE]; + mapped |= MAPPED_TRIGGER_LEFT; +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapped LEFTTRIGGER to axis %d (ABS_BRAKE)", out->lefttrigger.target); #endif } else if (joystick->hwdata->has_abs[ABS_Z]) { + /* De facto standard for Xbox 360 and Playstation gamepads */ out->lefttrigger.kind = EMappingKind_Axis; out->lefttrigger.target = joystick->hwdata->abs_map[ABS_Z]; - mapped |= 0x1; + mapped |= MAPPED_TRIGGER_LEFT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped LEFTTRIGGER to axis %d (ABS_Z)", out->lefttrigger.target); #endif } if (joystick->hwdata->has_abs[ABS_HAT2X]) { + /* Linux Gamepad Specification */ out->righttrigger.kind = EMappingKind_Axis; out->righttrigger.target = joystick->hwdata->abs_map[ABS_HAT2X]; - mapped |= 0x2; + mapped |= MAPPED_TRIGGER_RIGHT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped RIGHTTRIGGER to axis %d (ABS_HAT2X)", out->righttrigger.target); +#endif + } else if (joystick->hwdata->has_abs[ABS_GAS]) { + /* Android convention */ + out->righttrigger.kind = EMappingKind_Axis; + out->righttrigger.target = joystick->hwdata->abs_map[ABS_GAS]; + mapped |= MAPPED_TRIGGER_RIGHT; +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapped RIGHTTRIGGER to axis %d (ABS_GAS)", out->righttrigger.target); #endif } else if (joystick->hwdata->has_abs[ABS_RZ]) { + /* De facto standard for Xbox 360 and Playstation gamepads */ out->righttrigger.kind = EMappingKind_Axis; out->righttrigger.target = joystick->hwdata->abs_map[ABS_RZ]; - mapped |= 0x2; + mapped |= MAPPED_TRIGGER_RIGHT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped RIGHTTRIGGER to axis %d (ABS_RZ)", out->righttrigger.target); #endif } - if (mapped != 0x3 && joystick->hwdata->has_hat[2]) { + if (mapped != MAPPED_TRIGGER_BOTH && joystick->hwdata->has_hat[2]) { int hat = joystick->hwdata->hats_indices[2] << 4; out->lefttrigger.kind = EMappingKind_Hat; out->righttrigger.kind = EMappingKind_Hat; out->lefttrigger.target = hat | 0x4; out->righttrigger.target = hat | 0x2; - mapped |= 0x3; + mapped |= MAPPED_TRIGGER_BOTH; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped LEFT+RIGHTTRIGGER to hat 2 (ABS_HAT2X, ABS_HAT2Y)"); #endif } - if (!(mapped & 0x1) && joystick->hwdata->has_key[BTN_TL2]) { + if (!(mapped & MAPPED_TRIGGER_LEFT) && joystick->hwdata->has_key[BTN_TL2]) { out->lefttrigger.kind = EMappingKind_Button; out->lefttrigger.target = joystick->hwdata->key_map[BTN_TL2]; - mapped |= 0x1; + mapped |= MAPPED_TRIGGER_LEFT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped LEFTTRIGGER to button %d (BTN_TL2)", out->lefttrigger.target); #endif } - if (!(mapped & 0x2) && joystick->hwdata->has_key[BTN_TR2]) { + if (!(mapped & MAPPED_TRIGGER_RIGHT) && joystick->hwdata->has_key[BTN_TR2]) { out->righttrigger.kind = EMappingKind_Button; out->righttrigger.target = joystick->hwdata->key_map[BTN_TR2]; - mapped |= 0x2; + mapped |= MAPPED_TRIGGER_RIGHT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped RIGHTTRIGGER to button %d (BTN_TR2)", out->righttrigger.target); #endif @@ -1964,7 +2632,7 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) if (joystick->hwdata->has_key[BTN_DPAD_UP]) { out->dpup.kind = EMappingKind_Button; out->dpup.target = joystick->hwdata->key_map[BTN_DPAD_UP]; - mapped |= 0x1; + mapped |= MAPPED_DPAD_UP; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped DPUP to button %d (BTN_DPAD_UP)", out->dpup.target); #endif @@ -1973,7 +2641,7 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) if (joystick->hwdata->has_key[BTN_DPAD_DOWN]) { out->dpdown.kind = EMappingKind_Button; out->dpdown.target = joystick->hwdata->key_map[BTN_DPAD_DOWN]; - mapped |= 0x2; + mapped |= MAPPED_DPAD_DOWN; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped DPDOWN to button %d (BTN_DPAD_DOWN)", out->dpdown.target); #endif @@ -1982,7 +2650,7 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) if (joystick->hwdata->has_key[BTN_DPAD_LEFT]) { out->dpleft.kind = EMappingKind_Button; out->dpleft.target = joystick->hwdata->key_map[BTN_DPAD_LEFT]; - mapped |= 0x4; + mapped |= MAPPED_DPAD_LEFT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped DPLEFT to button %d (BTN_DPAD_LEFT)", out->dpleft.target); #endif @@ -1991,13 +2659,13 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) if (joystick->hwdata->has_key[BTN_DPAD_RIGHT]) { out->dpright.kind = EMappingKind_Button; out->dpright.target = joystick->hwdata->key_map[BTN_DPAD_RIGHT]; - mapped |= 0x8; + mapped |= MAPPED_DPAD_RIGHT; #ifdef DEBUG_GAMEPAD_MAPPING SDL_Log("Mapped DPRIGHT to button %d (BTN_DPAD_RIGHT)", out->dpright.target); #endif } - if (mapped != 0xF) { + if (mapped != MAPPED_DPAD_ALL) { if (joystick->hwdata->has_hat[0]) { int hat = joystick->hwdata->hats_indices[0] << 4; out->dpleft.kind = EMappingKind_Hat; @@ -2008,9 +2676,9 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) out->dpright.target = hat | 0x2; out->dpup.target = hat | 0x1; out->dpdown.target = hat | 0x4; - mapped |= 0xF; + mapped |= MAPPED_DPAD_ALL; #ifdef DEBUG_GAMEPAD_MAPPING - SDL_Log("Mapped DPUP+DOWN+LEFT+RIGHT to hat 0 (ABS_HAT0X, ABS_HAT0Y)"); + SDL_Log("Mapped DPUP+DOWN+LEFT+RIGHT to hat 0 (ABS_HAT0X, ABS_HAT0Y)"); #endif } else if (joystick->hwdata->has_abs[ABS_HAT0X] && joystick->hwdata->has_abs[ABS_HAT0Y]) { out->dpleft.kind = EMappingKind_Axis; @@ -2021,10 +2689,10 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) out->dpright.target = joystick->hwdata->abs_map[ABS_HAT0X]; out->dpup.target = joystick->hwdata->abs_map[ABS_HAT0Y]; out->dpdown.target = joystick->hwdata->abs_map[ABS_HAT0Y]; - mapped |= 0xF; + mapped |= MAPPED_DPAD_ALL; #ifdef DEBUG_GAMEPAD_MAPPING - SDL_Log("Mapped DPUP+DOWN to axis %d (ABS_HAT0Y)", out->dpup.target); - SDL_Log("Mapped DPLEFT+RIGHT to axis %d (ABS_HAT0X)", out->dpleft.target); + SDL_Log("Mapped DPUP+DOWN to axis %d (ABS_HAT0Y)", out->dpup.target); + SDL_Log("Mapped DPLEFT+RIGHT to axis %d (ABS_HAT0X)", out->dpleft.target); #endif } } @@ -2040,7 +2708,16 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) #endif } + /* The Linux Gamepad Specification uses the RX and RY axes, + * originally intended to represent X and Y rotation, as a second + * joystick. This is common for USB gamepads, and also many Bluetooth + * gamepads, particularly older ones. + * + * The Android mapping convention used by many Bluetooth controllers + * instead uses the Z axis as a secondary X axis, and the RZ axis as + * a secondary Y axis. */ if (joystick->hwdata->has_abs[ABS_RX] && joystick->hwdata->has_abs[ABS_RY]) { + /* Linux Gamepad Specification, Xbox 360, Playstation etc. */ out->rightx.kind = EMappingKind_Axis; out->righty.kind = EMappingKind_Axis; out->rightx.target = joystick->hwdata->abs_map[ABS_RX]; @@ -2049,6 +2726,48 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) SDL_Log("Mapped RIGHTX to axis %d (ABS_RX)", out->rightx.target); SDL_Log("Mapped RIGHTY to axis %d (ABS_RY)", out->righty.target); #endif + } else if (joystick->hwdata->has_abs[ABS_Z] && joystick->hwdata->has_abs[ABS_RZ]) { + /* Android convention */ + out->rightx.kind = EMappingKind_Axis; + out->righty.kind = EMappingKind_Axis; + out->rightx.target = joystick->hwdata->abs_map[ABS_Z]; + out->righty.target = joystick->hwdata->abs_map[ABS_RZ]; +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapped RIGHTX to axis %d (ABS_Z)", out->rightx.target); + SDL_Log("Mapped RIGHTY to axis %d (ABS_RZ)", out->righty.target); +#endif + } + + if (SDL_JoystickGetVendor(joystick) == USB_VENDOR_MICROSOFT) { + /* The Xbox Elite controllers have the paddles as BTN_TRIGGER_HAPPY5 - BTN_TRIGGER_HAPPY8 */ + if (joystick->hwdata->has_key[BTN_TRIGGER_HAPPY5] && + joystick->hwdata->has_key[BTN_TRIGGER_HAPPY6] && + joystick->hwdata->has_key[BTN_TRIGGER_HAPPY7] && + joystick->hwdata->has_key[BTN_TRIGGER_HAPPY8]) { + out->paddle1.kind = EMappingKind_Button; + out->paddle1.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY5]; + out->paddle2.kind = EMappingKind_Button; + out->paddle2.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY7]; + out->paddle3.kind = EMappingKind_Button; + out->paddle3.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY6]; + out->paddle4.kind = EMappingKind_Button; + out->paddle4.target = joystick->hwdata->key_map[BTN_TRIGGER_HAPPY8]; +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapped PADDLE1 to button %d (BTN_TRIGGER_HAPPY5)", out->paddle1.target); + SDL_Log("Mapped PADDLE2 to button %d (BTN_TRIGGER_HAPPY7)", out->paddle2.target); + SDL_Log("Mapped PADDLE3 to button %d (BTN_TRIGGER_HAPPY6)", out->paddle3.target); + SDL_Log("Mapped PADDLE4 to button %d (BTN_TRIGGER_HAPPY8)", out->paddle4.target); +#endif + } + + /* The Xbox Series X controllers have the Share button as KEY_RECORD */ + if (joystick->hwdata->has_key[KEY_RECORD]) { + out->misc1.kind = EMappingKind_Button; + out->misc1.target = joystick->hwdata->key_map[KEY_RECORD]; +#ifdef DEBUG_GAMEPAD_MAPPING + SDL_Log("Mapped MISC1 to button %d (KEY_RECORD)", out->misc1.target); +#endif + } } LINUX_JoystickClose(joystick); @@ -2066,13 +2785,13 @@ LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) return SDL_TRUE; } -SDL_JoystickDriver SDL_LINUX_JoystickDriver = -{ +SDL_JoystickDriver SDL_LINUX_JoystickDriver = { LINUX_JoystickInit, LINUX_JoystickGetCount, LINUX_JoystickDetect, LINUX_JoystickGetDeviceName, LINUX_JoystickGetDevicePath, + LINUX_JoystickGetDeviceSteamVirtualGamepadSlot, LINUX_JoystickGetDevicePlayerIndex, LINUX_JoystickSetDevicePlayerIndex, LINUX_JoystickGetDeviceGUID, diff --git a/src/joystick/linux/SDL_sysjoystick_c.h b/src/joystick/linux/SDL_sysjoystick_c.h index f0e27b9cad623..8b5c92709b452 100644 --- a/src/joystick/linux/SDL_sysjoystick_c.h +++ b/src/joystick/linux/SDL_sysjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,14 +25,18 @@ #include struct SDL_joylist_item; +struct SDL_sensorlist_item; /* The private structure used to keep track of a joystick */ struct joystick_hwdata { int fd; + /* linux driver creates a separate device for gyro/accelerometer */ + int fd_sensor; struct SDL_joylist_item *item; + struct SDL_sensorlist_item *item_sensor; SDL_JoystickGUID guid; - char *fname; /* Used in haptic subsystem */ + char *fname; /* Used in haptic subsystem */ SDL_bool ff_rumble; SDL_bool ff_sine; @@ -55,6 +59,8 @@ struct joystick_hwdata Uint8 abs_map[ABS_MAX]; SDL_bool has_key[KEY_MAX]; SDL_bool has_abs[ABS_MAX]; + SDL_bool has_accelerometer; + SDL_bool has_gyro; /* Support for the classic joystick interface */ SDL_bool classic; @@ -74,8 +80,20 @@ struct joystick_hwdata float scale; } abs_correct[ABS_MAX]; + float accelerometer_scale[3]; + float gyro_scale[3]; + + /* Each axis is read independently, if we don't get all axis this call to + * LINUX_JoystickUpdateupdate(), store them for the next one */ + float gyro_data[3]; + float accel_data[3]; + Uint64 sensor_tick; + Sint32 last_tick; + + SDL_bool report_sensor; SDL_bool fresh; SDL_bool recovering_from_dropped; + SDL_bool recovering_from_dropped_sensor; /* Steam Controller support */ SDL_bool m_bSteamController; @@ -92,6 +110,7 @@ struct joystick_hwdata /* Set when gamepad is pending removal due to ENODEV read error */ SDL_bool gone; + SDL_bool sensor_gone; }; #endif /* SDL_sysjoystick_c_h_ */ diff --git a/src/joystick/n3ds/SDL_sysjoystick.c b/src/joystick/n3ds/SDL_sysjoystick.c index 933f64ee093bb..274f0c1c48ced 100644 --- a/src/joystick/n3ds/SDL_sysjoystick.c +++ b/src/joystick/n3ds/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,53 +37,57 @@ This correction is applied to axis values so they fit better in SDL's value range. */ -#define CORRECT_AXIS_X(X) ((X * SDL_JOYSTICK_AXIS_MAX) / 160) +static inline int Correct_Axis_X(int X) { + if (X > 160) { + return SDL_JOYSTICK_AXIS_MAX; + } + else if (X < -160) { + return -SDL_JOYSTICK_AXIS_MAX; + } + return (X * SDL_JOYSTICK_AXIS_MAX) / 160; +} /* The Y axis needs to be flipped because SDL's "up" is reversed compared to libctru's "up" */ -#define CORRECT_AXIS_Y(Y) CORRECT_AXIS_X(-Y) +static inline int Correct_Axis_Y(int Y) { + return Correct_Axis_X(-Y); +} SDL_FORCE_INLINE void UpdateN3DSPressedButtons(SDL_Joystick *joystick); SDL_FORCE_INLINE void UpdateN3DSReleasedButtons(SDL_Joystick *joystick); SDL_FORCE_INLINE void UpdateN3DSCircle(SDL_Joystick *joystick); SDL_FORCE_INLINE void UpdateN3DSCStick(SDL_Joystick *joystick); -static int -N3DS_JoystickInit(void) +static int N3DS_JoystickInit(void) { hidInit(); return 0; } -static const char * -N3DS_JoystickGetDeviceName(int device_index) +static const char *N3DS_JoystickGetDeviceName(int device_index) { return "Nintendo 3DS"; } -static int -N3DS_JoystickGetCount(void) +static int N3DS_JoystickGetCount(void) { return 1; } -static SDL_JoystickGUID -N3DS_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID N3DS_JoystickGetDeviceGUID(int device_index) { SDL_JoystickGUID guid = SDL_CreateJoystickGUIDForName("Nintendo 3DS"); return guid; } -static SDL_JoystickID -N3DS_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID N3DS_JoystickGetDeviceInstanceID(int device_index) { return device_index; } -static int -N3DS_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int N3DS_JoystickOpen(SDL_Joystick *joystick, int device_index) { joystick->nbuttons = NB_BUTTONS; joystick->naxes = 4; @@ -93,14 +97,12 @@ N3DS_JoystickOpen(SDL_Joystick *joystick, int device_index) return 0; } -static int -N3DS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int N3DS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -N3DS_JoystickUpdate(SDL_Joystick *joystick) +static void N3DS_JoystickUpdate(SDL_Joystick *joystick) { UpdateN3DSPressedButtons(joystick); UpdateN3DSReleasedButtons(joystick); @@ -151,12 +153,12 @@ UpdateN3DSCircle(SDL_Joystick *joystick) if (previous_state.dx != current_state.dx) { SDL_PrivateJoystickAxis(joystick, 0, - CORRECT_AXIS_X(current_state.dx)); + Correct_Axis_X(current_state.dx)); } if (previous_state.dy != current_state.dy) { SDL_PrivateJoystickAxis(joystick, 1, - CORRECT_AXIS_Y(current_state.dy)); + Correct_Axis_Y(current_state.dy)); } previous_state = current_state; } @@ -170,29 +172,26 @@ UpdateN3DSCStick(SDL_Joystick *joystick) if (previous_state.dx != current_state.dx) { SDL_PrivateJoystickAxis(joystick, 2, - CORRECT_AXIS_X(current_state.dx)); + Correct_Axis_X(current_state.dx)); } if (previous_state.dy != current_state.dy) { SDL_PrivateJoystickAxis(joystick, 3, - CORRECT_AXIS_Y(current_state.dy)); + Correct_Axis_Y(current_state.dy)); } previous_state = current_state; } -static void -N3DS_JoystickClose(SDL_Joystick *joystick) +static void N3DS_JoystickClose(SDL_Joystick *joystick) { } -static void -N3DS_JoystickQuit(void) +static void N3DS_JoystickQuit(void) { hidExit(); } -static SDL_bool -N3DS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool N3DS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { /* There is only one possible mapping. */ *out = (SDL_GamepadMapping){ @@ -226,54 +225,50 @@ N3DS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) return SDL_TRUE; } -static void -N3DS_JoystickDetect(void) +static void N3DS_JoystickDetect(void) { } -static const char * -N3DS_JoystickGetDevicePath(int device_index) +static const char *N3DS_JoystickGetDevicePath(int device_index) { return NULL; } -static int -N3DS_JoystickGetDevicePlayerIndex(int device_index) +static int N3DS_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + +static int N3DS_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -N3DS_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void N3DS_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static Uint32 -N3DS_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 N3DS_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -static int -N3DS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int N3DS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -static int -N3DS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int N3DS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static int -N3DS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int N3DS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -N3DS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int N3DS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } @@ -284,6 +279,7 @@ SDL_JoystickDriver SDL_N3DS_JoystickDriver = { .Detect = N3DS_JoystickDetect, .GetDeviceName = N3DS_JoystickGetDeviceName, .GetDevicePath = N3DS_JoystickGetDevicePath, + .GetDeviceSteamVirtualGamepadSlot = N3DS_JoystickGetDeviceSteamVirtualGamepadSlot, .GetDevicePlayerIndex = N3DS_JoystickGetDevicePlayerIndex, .SetDevicePlayerIndex = N3DS_JoystickSetDevicePlayerIndex, .GetDeviceGUID = N3DS_JoystickGetDeviceGUID, diff --git a/src/joystick/os2/SDL_os2joystick.c b/src/joystick/os2/SDL_os2joystick.c index bf2dc605cadf1..66de5a2daff2c 100644 --- a/src/joystick/os2/SDL_os2joystick.c +++ b/src/joystick/os2/SDL_os2joystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -93,29 +93,29 @@ typedef struct { #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" -static HFILE hJoyPort = NULLHANDLE; /* Joystick GAME$ Port Address */ -#define MAX_JOYSTICKS 2 /* Maximum of two joysticks */ -#define MAX_AXES 4 /* each joystick can have up to 4 axes */ -#define MAX_BUTTONS 8 /* 8 buttons */ -#define MAX_HATS 0 /* 0 hats - OS/2 doesn't support it */ -#define MAX_BALLS 0 /* and 0 balls - OS/2 doesn't support it */ -#define MAX_JOYNAME 128 /* Joystick name may have 128 characters */ +static HFILE hJoyPort = NULLHANDLE; /* Joystick GAME$ Port Address */ +#define MAX_JOYSTICKS 2 /* Maximum of two joysticks */ +#define MAX_AXES 4 /* each joystick can have up to 4 axes */ +#define MAX_BUTTONS 8 /* 8 buttons */ +#define MAX_HATS 0 /* 0 hats - OS/2 doesn't support it */ +#define MAX_BALLS 0 /* and 0 balls - OS/2 doesn't support it */ +#define MAX_JOYNAME 128 /* Joystick name may have 128 characters */ /* Calc Button Flag for buttons A to D */ #define JOY_BUTTON_FLAG(n) (1< MAX_JOYSTICKS) maxdevs = MAX_JOYSTICKS; - - /* Defines min/max axes values (callibration) */ - ulDataLen = sizeof(stGameCalib); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB, - NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(&hJoyPort); - return SDL_SetError("Could not read callibration data."); - } - - /* Determine how many joysticks are active */ - numdevs = 0; /* Points no device */ - ucNewJoystickMask = 0x0F; /* read all 4 joystick axis */ - ulDataLen = sizeof(ucNewJoystickMask); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET, - &ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL); - if (rc == 0) - { - ulDataLen = sizeof(stJoyStatus); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, - NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(&hJoyPort); - return SDL_SetError("Could not call joystick port."); - } - ulLastTick = stJoyStatus.ulJs_Ticks; - while (stJoyStatus.ulJs_Ticks == ulLastTick) - { - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, - NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); - } - if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) numdevs++; - if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) numdevs++; - } - - if (numdevs > maxdevs) numdevs = maxdevs; - - /* If *any* joystick was detected... Let's configure SDL for them */ - if (numdevs > 0) - { - /* Verify if it is a "user defined" joystick */ - if (joyGetEnv(&joycfg)) - { - GAME_3POS_STRUCT * axis[4]; - axis[0] = &stGameCalib.Ax; - axis[1] = &stGameCalib.Ay; - axis[2] = &stGameCalib.Bx; - axis[3] = &stGameCalib.By; - - /* Say it has one device only (user defined is always one device only) */ - numdevs = 1; - - /* Define Device 0 as... */ - SYS_JoyData[0].id = 0; - - /* Define Number of Axes... up to 4 */ - if (joycfg.axes>MAX_AXES) joycfg.axes = MAX_AXES; - SYS_JoyData[0].axes = joycfg.axes; - - /* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */ - maxbut = MAX_BUTTONS; - if (joycfg.axes>2) maxbut -= ((joycfg.axes - 2)<<1); /* MAX_BUTTONS - 2*(axes-2) */ - if (joycfg.buttons > maxbut) joycfg.buttons = maxbut; - SYS_JoyData[0].buttons = joycfg.buttons; - - /* Define number of hats */ - if (joycfg.hats > MAX_HATS) joycfg.hats = MAX_HATS; - SYS_JoyData[0].hats = joycfg.hats; - - /* Define number of balls */ - if (joycfg.balls > MAX_BALLS) joycfg.balls = MAX_BALLS; - SYS_JoyData[0].balls = joycfg.balls; - - /* Initialize Axes Callibration Values */ - for (i=0; ilower; - SYS_JoyData[0].axes_med[i] = axis[i]->centre; - SYS_JoyData[0].axes_max[i] = axis[i]->upper; - } - /* Initialize Buttons 5 to 8 structures */ - if (joycfg.buttons>=5) SYS_JoyData[0].buttoncalc[0] = ((axis[2]->lower+axis[3]->centre)>>1); - if (joycfg.buttons>=6) SYS_JoyData[0].buttoncalc[1] = ((axis[3]->lower+axis[3]->centre)>>1); - if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2] = ((axis[2]->upper+axis[3]->centre)>>1); - if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3] = ((axis[3]->upper+axis[3]->centre)>>1); - /* Intialize Joystick Name */ - SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName)); - } - /* Default Init ... autoconfig */ - else - { - /* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */ - if (numdevs == 2) - { - /* Define Device 0 as 4 axes, 4 buttons */ - SYS_JoyData[0].id=0; - SYS_JoyData[0].axes = 4; - SYS_JoyData[0].buttons = 4; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; - SYS_JoyData[0].axes_min[2] = stGameCalib.Bx.lower; - SYS_JoyData[0].axes_med[2] = stGameCalib.Bx.centre; - SYS_JoyData[0].axes_max[2] = stGameCalib.Bx.upper; - SYS_JoyData[0].axes_min[3] = stGameCalib.By.lower; - SYS_JoyData[0].axes_med[3] = stGameCalib.By.centre; - SYS_JoyData[0].axes_max[3] = stGameCalib.By.upper; - /* Define Device 1 as 2 axes, 2 buttons */ - SYS_JoyData[1].id=1; - SYS_JoyData[1].axes = 2; - SYS_JoyData[1].buttons = 2; - SYS_JoyData[1].hats = 0; - SYS_JoyData[1].balls = 0; - SYS_JoyData[1].axes_min[0] = stGameCalib.Bx.lower; - SYS_JoyData[1].axes_med[0] = stGameCalib.Bx.centre; - SYS_JoyData[1].axes_max[0] = stGameCalib.Bx.upper; - SYS_JoyData[1].axes_min[1] = stGameCalib.By.lower; - SYS_JoyData[1].axes_med[1] = stGameCalib.By.centre; - SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper; - } - /* One joystick only? */ - else - { - /* If it is joystick A... */ - if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) - { - /* Define Device 0 as 2 axes, 4 buttons */ - SYS_JoyData[0].id=0; - SYS_JoyData[0].axes = 2; - SYS_JoyData[0].buttons = 4; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; - } - /* If not, it is joystick B */ - else - { - /* Define Device 1 as 2 axes, 2 buttons */ - SYS_JoyData[0].id=1; - SYS_JoyData[0].axes = 2; - SYS_JoyData[0].buttons = 2; - SYS_JoyData[0].hats = 0; - SYS_JoyData[0].balls = 0; - SYS_JoyData[0].axes_min[0] = stGameCalib.Bx.lower; - SYS_JoyData[0].axes_med[0] = stGameCalib.Bx.centre; - SYS_JoyData[0].axes_max[0] = stGameCalib.Bx.upper; - SYS_JoyData[0].axes_min[1] = stGameCalib.By.lower; - SYS_JoyData[0].axes_med[1] = stGameCalib.By.centre; - SYS_JoyData[0].axes_max[1] = stGameCalib.By.upper; - } - } - - /* Hack to define Joystick Port Names */ - if (numdevs > maxdevs) numdevs = maxdevs; - - for (i = 0; i < numdevs; i++) - { - SDL_snprintf(SYS_JoyData[i].szDeviceName, - SDL_arraysize(SYS_JoyData[i].szDeviceName), - "Default Joystick %c", 'A'+SYS_JoyData[i].id); - } - } - } - /* Return the number of devices found */ - numjoysticks = numdevs; - return numdevs; + APIRET rc; /* Generic OS/2 return code */ + GAME_PORT_STRUCT stJoyStatus; /* Joystick Status Structure */ + GAME_PARM_STRUCT stGameParms; /* Joystick Parameter Structure */ + GAME_CALIB_STRUCT stGameCalib; /* Calibration Struct */ + ULONG ulDataLen; /* Size of data */ + ULONG ulLastTick; /* Tick Counter for timing operations */ + Uint8 maxdevs; /* Maximum number of devices */ + Uint8 numdevs; /* Number of present devices */ + Uint8 maxbut; /* Maximum number of buttons... */ + Uint8 i; /* Temporary Count Vars */ + Uint8 ucNewJoystickMask; /* Mask for Joystick Detection */ + struct _joycfg joycfg; /* Joy Configuration from envvar */ + + /* Open GAME$ port */ + if (joyPortOpen(&hJoyPort) < 0) { + return 0; /* Cannot open... report no joystick */ + } + /* Get Max Number of Devices */ + ulDataLen = sizeof(stGameParms); + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_PARMS, + NULL, 0, NULL, &stGameParms, ulDataLen, &ulDataLen); /* Ask device info */ + if (rc != 0) { + joyPortClose(&hJoyPort); + return SDL_SetError("Could not read joystick port."); + } + maxdevs = 0; + if (stGameParms.useA != 0) { + maxdevs++; + } + if (stGameParms.useB != 0) { + maxdevs++; + } + if (maxdevs > MAX_JOYSTICKS) { + maxdevs = MAX_JOYSTICKS; + } + + /* Defines min/max axes values (callibration) */ + ulDataLen = sizeof(stGameCalib); + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB, + NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen); + if (rc != 0) { + joyPortClose(&hJoyPort); + return SDL_SetError("Could not read callibration data."); + } + + /* Determine how many joysticks are active */ + numdevs = 0; /* Points no device */ + ucNewJoystickMask = 0x0F; /* read all 4 joystick axis */ + ulDataLen = sizeof(ucNewJoystickMask); + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET, + &ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL); + if (rc == 0) { + ulDataLen = sizeof(stJoyStatus); + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, + NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); + if (rc != 0) { + joyPortClose(&hJoyPort); + return SDL_SetError("Could not call joystick port."); + } + ulLastTick = stJoyStatus.ulJs_Ticks; + while (stJoyStatus.ulJs_Ticks == ulLastTick) { + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET, + NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen); + } + if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) { + numdevs++; + } + if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) { + numdevs++; + } + } + + if (numdevs > maxdevs) { + numdevs = maxdevs; + } + + /* If *any* joystick was detected... Let's configure SDL for them */ + if (numdevs > 0) { + /* Verify if it is a "user defined" joystick */ + if (joyGetEnv(&joycfg)) { + GAME_3POS_STRUCT * axis[4]; + axis[0] = &stGameCalib.Ax; + axis[1] = &stGameCalib.Ay; + axis[2] = &stGameCalib.Bx; + axis[3] = &stGameCalib.By; + + /* Say it has one device only (user defined is always one device only) */ + numdevs = 1; + + /* Define Device 0 as... */ + SYS_JoyData[0].id = 0; + + /* Define Number of Axes... up to 4 */ + if (joycfg.axes>MAX_AXES) { + joycfg.axes = MAX_AXES; + } + SYS_JoyData[0].axes = joycfg.axes; + + /* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */ + maxbut = MAX_BUTTONS; + if (joycfg.axes > 2) { + maxbut -= ((joycfg.axes - 2) << 1); /* MAX_BUTTONS - 2*(axes-2) */ + } + if (joycfg.buttons > maxbut) { + joycfg.buttons = maxbut; + } + SYS_JoyData[0].buttons = joycfg.buttons; + + /* Define number of hats */ + if (joycfg.hats > MAX_HATS) { + joycfg.hats = MAX_HATS; + } + SYS_JoyData[0].hats = joycfg.hats; + + /* Define number of balls */ + if (joycfg.balls > MAX_BALLS) { + joycfg.balls = MAX_BALLS; + } + SYS_JoyData[0].balls = joycfg.balls; + + /* Initialize Axes Callibration Values */ + for (i = 0; i < joycfg.axes; i++) { + SYS_JoyData[0].axes_min[i] = axis[i]->lower; + SYS_JoyData[0].axes_med[i] = axis[i]->centre; + SYS_JoyData[0].axes_max[i] = axis[i]->upper; + } + /* Initialize Buttons 5 to 8 structures */ + if (joycfg.buttons >=5 ) { + SYS_JoyData[0].buttoncalc[0] = ((axis[2]->lower + axis[3]->centre) >> 1); + } + if (joycfg.buttons >=6 ) { + SYS_JoyData[0].buttoncalc[1] = ((axis[3]->lower + axis[3]->centre) >> 1); + } + if (joycfg.buttons >=7 ) { + SYS_JoyData[0].buttoncalc[2] = ((axis[2]->upper + axis[3]->centre) >> 1); + } + if (joycfg.buttons >=8 ) { + SYS_JoyData[0].buttoncalc[3] = ((axis[3]->upper + axis[3]->centre) >> 1); + } + /* Intialize Joystick Name */ + SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName)); + } + /* Default Init ... autoconfig */ + else { + /* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */ + if (numdevs == 2) { + /* Define Device 0 as 4 axes, 4 buttons */ + SYS_JoyData[0].id = 0; + SYS_JoyData[0].axes = 4; + SYS_JoyData[0].buttons = 4; + SYS_JoyData[0].hats = 0; + SYS_JoyData[0].balls = 0; + SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; + SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; + SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; + SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; + SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; + SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; + SYS_JoyData[0].axes_min[2] = stGameCalib.Bx.lower; + SYS_JoyData[0].axes_med[2] = stGameCalib.Bx.centre; + SYS_JoyData[0].axes_max[2] = stGameCalib.Bx.upper; + SYS_JoyData[0].axes_min[3] = stGameCalib.By.lower; + SYS_JoyData[0].axes_med[3] = stGameCalib.By.centre; + SYS_JoyData[0].axes_max[3] = stGameCalib.By.upper; + /* Define Device 1 as 2 axes, 2 buttons */ + SYS_JoyData[1].id = 1; + SYS_JoyData[1].axes = 2; + SYS_JoyData[1].buttons = 2; + SYS_JoyData[1].hats = 0; + SYS_JoyData[1].balls = 0; + SYS_JoyData[1].axes_min[0] = stGameCalib.Bx.lower; + SYS_JoyData[1].axes_med[0] = stGameCalib.Bx.centre; + SYS_JoyData[1].axes_max[0] = stGameCalib.Bx.upper; + SYS_JoyData[1].axes_min[1] = stGameCalib.By.lower; + SYS_JoyData[1].axes_med[1] = stGameCalib.By.centre; + SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper; + } + /* One joystick only? */ + else { + /* If it is joystick A... */ + if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) { + /* Define Device 0 as 2 axes, 4 buttons */ + SYS_JoyData[0].id = 0; + SYS_JoyData[0].axes = 2; + SYS_JoyData[0].buttons = 4; + SYS_JoyData[0].hats = 0; + SYS_JoyData[0].balls = 0; + SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower; + SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre; + SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper; + SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower; + SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre; + SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper; + } + /* If not, it is joystick B */ + else { + /* Define Device 1 as 2 axes, 2 buttons */ + SYS_JoyData[0].id = 1; + SYS_JoyData[0].axes = 2; + SYS_JoyData[0].buttons = 2; + SYS_JoyData[0].hats = 0; + SYS_JoyData[0].balls = 0; + SYS_JoyData[0].axes_min[0] = stGameCalib.Bx.lower; + SYS_JoyData[0].axes_med[0] = stGameCalib.Bx.centre; + SYS_JoyData[0].axes_max[0] = stGameCalib.Bx.upper; + SYS_JoyData[0].axes_min[1] = stGameCalib.By.lower; + SYS_JoyData[0].axes_med[1] = stGameCalib.By.centre; + SYS_JoyData[0].axes_max[1] = stGameCalib.By.upper; + } + } + + /* Hack to define Joystick Port Names */ + if (numdevs > maxdevs) { + numdevs = maxdevs; + } + + for (i = 0; i < numdevs; i++) { + SDL_snprintf(SYS_JoyData[i].szDeviceName, SDL_arraysize(SYS_JoyData[i].szDeviceName), + "Default Joystick %c", 'A'+SYS_JoyData[i].id); + } + } + } + + /* Return the number of devices found */ + numjoysticks = numdevs; + return numdevs; } static int OS2_NumJoysticks(void) { - return numjoysticks; + return numjoysticks; } static void OS2_JoystickDetect(void) @@ -379,18 +399,23 @@ static void OS2_JoystickDetect(void) static const char *OS2_JoystickGetDeviceName(int device_index) { - /* No need to verify if device exists, already done in upper layer */ - return SYS_JoyData[device_index].szDeviceName; + /* No need to verify if device exists, already done in upper layer */ + return SYS_JoyData[device_index].szDeviceName; } static const char *OS2_JoystickGetDevicePath(int device_index) { - return NULL; + return NULL; +} + +static int OS2_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; } static int OS2_JoystickGetDevicePlayerIndex(int device_index) { - return -1; + return -1; } static void OS2_JoystickSetDevicePlayerIndex(int device_index, int player_index) @@ -406,80 +431,75 @@ static SDL_JoystickGUID OS2_JoystickGetDeviceGUID(int device_index) static SDL_JoystickID OS2_JoystickGetDeviceInstanceID(int device_index) { - return device_index; + return device_index; } /******************************************************************************/ -/* Function to open a joystick for use. */ -/* The joystick to open is specified by the device index. */ -/* This should fill the nbuttons and naxes fields of the joystick structure. */ -/* It returns 0, or -1 if there is an error. */ +/* Function to open a joystick for use. */ +/* The joystick to open is specified by the device index. */ +/* This should fill the nbuttons and naxes fields of the joystick structure. */ +/* It returns 0, or -1 if there is an error. */ /******************************************************************************/ static int OS2_JoystickOpen(SDL_Joystick *joystick, int device_index) { - int index; /* Index shortcut for index in joystick structure */ - int i; /* Generic Counter */ - - /* allocate memory for system specific hardware data */ - joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata)); - if (!joystick->hwdata) - { - return SDL_OutOfMemory(); - } - - /* ShortCut Pointer */ - index = device_index; - joystick->instance_id = device_index; - - /* Define offsets and scales for all axes */ - joystick->hwdata->id = SYS_JoyData[index].id; - for (i = 0; i < MAX_AXES; ++i) - { - if ((i < 2) || i < SYS_JoyData[index].axes) - { - joystick->hwdata->transaxes[i].offset = ((SDL_JOYSTICK_AXIS_MAX + SDL_JOYSTICK_AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i]; - joystick->hwdata->transaxes[i].scale1 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MIN/SYS_JoyData[index].axes_min[i])); - joystick->hwdata->transaxes[i].scale2 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MAX/SYS_JoyData[index].axes_max[i])); - } - else - { - joystick->hwdata->transaxes[i].offset = 0; - joystick->hwdata->transaxes[i].scale1 = 1.0f; /* Just in case */ - joystick->hwdata->transaxes[i].scale2 = 1.0f; /* Just in case */ - } - } - - /* fill nbuttons, naxes, and nhats fields */ - joystick->nbuttons = SYS_JoyData[index].buttons; - joystick->naxes = SYS_JoyData[index].axes; - - /* joystick->nhats = SYS_JoyData[index].hats; */ - joystick->nhats = 0; /* No support for hats at this time */ - - /* joystick->nballs = SYS_JoyData[index].balls; */ - joystick->nballs = 0; /* No support for balls at this time */ - - return 0; + int index; /* Index shortcut for index in joystick structure */ + int i; /* Generic Counter */ + + /* allocate memory for system specific hardware data */ + joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata)); + if (!joystick->hwdata) { + return SDL_OutOfMemory(); + } + + /* ShortCut Pointer */ + index = device_index; + joystick->instance_id = device_index; + + /* Define offsets and scales for all axes */ + joystick->hwdata->id = SYS_JoyData[index].id; + for (i = 0; i < MAX_AXES; ++i) { + if ((i < 2) || i < SYS_JoyData[index].axes) { + joystick->hwdata->transaxes[i].offset = ((SDL_JOYSTICK_AXIS_MAX + SDL_JOYSTICK_AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i]; + joystick->hwdata->transaxes[i].scale1 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MIN/SYS_JoyData[index].axes_min[i])); + joystick->hwdata->transaxes[i].scale2 = (float)SDL_abs((SDL_JOYSTICK_AXIS_MAX/SYS_JoyData[index].axes_max[i])); + } else { + joystick->hwdata->transaxes[i].offset = 0; + joystick->hwdata->transaxes[i].scale1 = 1.0f; /* Just in case */ + joystick->hwdata->transaxes[i].scale2 = 1.0f; /* Just in case */ + } + } + + /* fill nbuttons, naxes, and nhats fields */ + joystick->nbuttons = SYS_JoyData[index].buttons; + joystick->naxes = SYS_JoyData[index].axes; + + /* joystick->nhats = SYS_JoyData[index].hats; */ + joystick->nhats = 0; /* No support for hats at this time */ + + /* joystick->nballs = SYS_JoyData[index].balls; */ + joystick->nballs = 0; /* No support for balls at this time */ + + return 0; } static int OS2_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { - return SDL_Unsupported(); + return SDL_Unsupported(); } static int OS2_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { - return SDL_Unsupported(); + return SDL_Unsupported(); } static Uint32 OS2_JoystickGetCapabilities(SDL_Joystick *joystick) { - return 0; + return 0; } static int OS2_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { - return SDL_Unsupported(); + return SDL_Unsupported(); } static int OS2_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) @@ -489,133 +509,145 @@ static int OS2_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int static int OS2_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { - return SDL_Unsupported(); + return SDL_Unsupported(); } /***************************************************************************/ -/* Function to update the state of a joystick - called as a device poll. */ -/* This function shouldn't update the joystick structure directly, */ -/* but instead should call SDL_PrivateJoystick*() to deliver events */ -/* and update joystick device state. */ +/* Function to update the state of a joystick - called as a device poll. */ +/* This function shouldn't update the joystick structure directly, */ +/* but instead should call SDL_PrivateJoystick*() to deliver events */ +/* and update joystick device state. */ /***************************************************************************/ static void OS2_JoystickUpdate(SDL_Joystick *joystick) { - APIRET rc; /* Generic OS/2 return code */ - int index; /* index shortcurt to joystick index */ - int i; /* Generic counter */ - int normbut; /* Number of buttons reported by joystick */ - int corr; /* Correction for button names */ - Sint16 value; /* Values used to update axis values */ - struct _transaxes *transaxes; /* Shortcut for Correction structure */ - Uint32 pos[MAX_AXES]; /* Vector to inform the Axis status */ - ULONG ulDataLen; /* Size of data */ - GAME_STATUS_STRUCT stGameStatus; /* Joystick Status Structure */ - - ulDataLen = sizeof(stGameStatus); - rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS, - NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen); - if (rc != 0) - { - SDL_SetError("Could not read joystick status."); - return; /* Could not read data */ - } - - /* Shortcut pointer */ - index = joystick->instance_id; - - /* joystick motion events */ - - if (SYS_JoyData[index].id == 0) - { - pos[0] = stGameStatus.curdata.A.x; - pos[1] = stGameStatus.curdata.A.y; - if (SYS_JoyData[index].axes >= 3) pos[2] = stGameStatus.curdata.B.x; - else pos[2] = 0; - if (SYS_JoyData[index].axes >= 4) pos[3] = stGameStatus.curdata.B.y; - else pos[3] = 0; - /* OS/2 basic drivers do not support more than 4 axes joysticks */ - } - else if (SYS_JoyData[index].id == 1) - { - pos[0] = stGameStatus.curdata.B.x; - pos[1] = stGameStatus.curdata.B.y; - pos[2] = 0; - pos[3] = 0; - } - - /* Corrects the movements using the callibration */ - transaxes = joystick->hwdata->transaxes; - for (i = 0; i < joystick->naxes; i++) - { - value = pos[i] + transaxes[i].offset; - if (value < 0) - { - value *= transaxes[i].scale1; - if (value > 0) value = SDL_JOYSTICK_AXIS_MIN; - } - else - { - value *= transaxes[i].scale2; - if (value < 0) value = SDL_JOYSTICK_AXIS_MAX; - } - SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value); - } - - /* joystick button A to D events */ - if (SYS_JoyData[index].id == 1) corr = 2; - else corr = 0; - normbut = 4; /* Number of normal buttons */ - if (joystick->nbuttons < normbut) normbut = joystick->nbuttons; - for (i = corr; (i-corr) < normbut; ++i) - { - /* - Button A: 1110 0000 - Button B: 1101 0000 - Button C: 1011 0000 - Button D: 0111 0000 - */ - if ((~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i)) - { - SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED); - } - else - { - SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED); - } - } - - /* Joystick button E to H buttons */ - /* - Button E: Axis 2 X Left - Button F: Axis 2 Y Up - Button G: Axis 2 X Right - Button H: Axis 2 Y Down - */ - if (joystick->nbuttons >= 5) - { - if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED); - } - if (joystick->nbuttons >= 6) - { - if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED); - } - if (joystick->nbuttons >= 7) - { - if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED); - } - if (joystick->nbuttons >= 8) - { - if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED); - else SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED); - } - - /* joystick hat events */ - /* Not Supported under OS/2 */ - /* joystick ball events */ - /* Not Supported under OS/2 */ + APIRET rc; /* Generic OS/2 return code */ + int index; /* index shortcurt to joystick index */ + int i; /* Generic counter */ + int normbut; /* Number of buttons reported by joystick */ + int corr; /* Correction for button names */ + Sint16 value; /* Values used to update axis values */ + struct _transaxes *transaxes; /* Shortcut for Correction structure */ + Uint32 pos[MAX_AXES]; /* Vector to inform the Axis status */ + ULONG ulDataLen; /* Size of data */ + GAME_STATUS_STRUCT stGameStatus; /* Joystick Status Structure */ + + ulDataLen = sizeof(stGameStatus); + rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS, + NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen); + if (rc != 0) { + SDL_SetError("Could not read joystick status."); + return; /* Could not read data */ + } + + /* Shortcut pointer */ + index = joystick->instance_id; + + /* joystick motion events */ + + if (SYS_JoyData[index].id == 0) { + pos[0] = stGameStatus.curdata.A.x; + pos[1] = stGameStatus.curdata.A.y; + if (SYS_JoyData[index].axes >= 3) { + pos[2] = stGameStatus.curdata.B.x; + } else { + pos[2] = 0; + } + if (SYS_JoyData[index].axes >= 4) { + pos[3] = stGameStatus.curdata.B.y; + } else { + pos[3] = 0; + } + /* OS/2 basic drivers do not support more than 4 axes joysticks */ + } + else if (SYS_JoyData[index].id == 1) { + pos[0] = stGameStatus.curdata.B.x; + pos[1] = stGameStatus.curdata.B.y; + pos[2] = 0; + pos[3] = 0; + } + + /* Corrects the movements using the callibration */ + transaxes = joystick->hwdata->transaxes; + for (i = 0; i < joystick->naxes; i++) { + value = pos[i] + transaxes[i].offset; + if (value < 0) { + value *= transaxes[i].scale1; + if (value > 0) { + value = SDL_JOYSTICK_AXIS_MIN; + } + } else { + value *= transaxes[i].scale2; + if (value < 0) { + value = SDL_JOYSTICK_AXIS_MAX; + } + } + SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value); + } + + /* joystick button A to D events */ + if (SYS_JoyData[index].id == 1) { + corr = 2; + } else { + corr = 0; + } + normbut = 4; /* Number of normal buttons */ + if (joystick->nbuttons < normbut) { + normbut = joystick->nbuttons; + } + for (i = corr; (i-corr) < normbut; ++i) { + /* + Button A: 1110 0000 + Button B: 1101 0000 + Button C: 1011 0000 + Button D: 0111 0000 + */ + if ((~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i)) { + SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED); + } else { + SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED); + } + } + + /* Joystick button E to H buttons */ + /* + Button E: Axis 2 X Left + Button F: Axis 2 Y Up + Button G: Axis 2 X Right + Button H: Axis 2 Y Down + */ + if (joystick->nbuttons >= 5) { + if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) { + SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED); + } else { + SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED); + } + } + if (joystick->nbuttons >= 6) { + if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) { + SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED); + } else { + SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED); + } + } + if (joystick->nbuttons >= 7) { + if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) { + SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED); + } else { + SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED); + } + } + if (joystick->nbuttons >= 8) { + if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) { + SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED); + } else { + SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED); + } + } + + /* joystick hat events */ + /* Not Supported under OS/2 */ + /* joystick ball events */ + /* Not Supported under OS/2 */ } /******************************************/ @@ -623,8 +655,8 @@ static void OS2_JoystickUpdate(SDL_Joystick *joystick) /******************************************/ static void OS2_JoystickClose(SDL_Joystick *joystick) { - /* free system specific hardware data */ - SDL_free(joystick->hwdata); + /* free system specific hardware data */ + SDL_free(joystick->hwdata); } /********************************************************************/ @@ -632,12 +664,12 @@ static void OS2_JoystickClose(SDL_Joystick *joystick) /********************************************************************/ static void OS2_JoystickQuit(void) { - joyPortClose(&hJoyPort); + joyPortClose(&hJoyPort); } static SDL_bool OS2_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { - return SDL_FALSE; + return SDL_FALSE; } @@ -650,38 +682,38 @@ static SDL_bool OS2_JoystickGetGamepadMapping(int device_index, SDL_GamepadMappi /*****************************************/ static int joyPortOpen(HFILE * hGame) { - APIRET rc; /* Generic Return Code */ - ULONG ulAction; /* ? */ - ULONG ulVersion; /* Version of joystick driver */ - ULONG ulDataLen; /* Size of version data */ - - /* Verifies if joyport is not already open... */ - if (*hGame != NULLHANDLE) return 0; - - /* Open GAME$ for read */ - rc = DosOpen("GAME$ ", hGame, &ulAction, 0, FILE_READONLY, - FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL); - if (rc != 0) - { - return SDL_SetError("Could not open Joystick Port."); - } - - /* Get Joystick Driver Version... must be 2.0 or higher */ - ulVersion = 0; - ulDataLen = sizeof(ulVersion); - rc = DosDevIOCtl(*hGame, IOCTL_CAT_USER, GAME_GET_VERSION, - NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen); - if (rc != 0) - { - joyPortClose(hGame); - return SDL_SetError("Could not get Joystick Driver version."); - } - if (ulVersion < 0x20) - { - joyPortClose(hGame); - return SDL_SetError("Driver too old. At least IBM driver version 2.0 required."); - } - return 0; + APIRET rc; /* Generic Return Code */ + ULONG ulAction; /* ? */ + ULONG ulVersion; /* Version of joystick driver */ + ULONG ulDataLen; /* Size of version data */ + + /* Verifies if joyport is not already open... */ + if (*hGame != NULLHANDLE) { + return 0; + } + + /* Open GAME$ for read */ + rc = DosOpen("GAME$ ", hGame, &ulAction, 0, FILE_READONLY, + FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL); + if (rc != 0) { + return SDL_SetError("Could not open Joystick Port."); + } + + /* Get Joystick Driver Version... must be 2.0 or higher */ + ulVersion = 0; + ulDataLen = sizeof(ulVersion); + rc = DosDevIOCtl(*hGame, IOCTL_CAT_USER, GAME_GET_VERSION, + NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen); + if (rc != 0) { + joyPortClose(hGame); + return SDL_SetError("Could not get Joystick Driver version."); + } + if (ulVersion < 0x20) { + joyPortClose(hGame); + return SDL_SetError("Driver too old. At least IBM driver version 2.0 required."); + } + + return 0; } /****************************/ @@ -689,8 +721,10 @@ static int joyPortOpen(HFILE * hGame) /****************************/ static void joyPortClose(HFILE * hGame) { - if (*hGame != NULLHANDLE) DosClose(*hGame); - *hGame = NULLHANDLE; + if (*hGame != NULLHANDLE) { + DosClose(*hGame); + } + *hGame = NULLHANDLE; } /***************************/ @@ -698,102 +732,112 @@ static void joyPortClose(HFILE * hGame) /***************************/ static int joyGetEnv(struct _joycfg * joydata) { - const char *joyenv; /* Pointer to tested character */ - char tempnumber[5]; /* Temporary place to put numeric texts */ - - joyenv = SDL_getenv("SDL_OS2_JOYSTICK"); - if (joyenv == NULL) return 0; - - /* Joystick Environment is defined! */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - - /* If the string name starts with '... get if fully */ - if (*joyenv == '\'') { - joyenv++; - joyenv += joyGetData(joyenv,joydata->name,'\'',sizeof(joydata->name)); - } - /* If not, get it until the next space */ - else if (*joyenv == '\"') { - joyenv++; - joyenv += joyGetData(joyenv,joydata->name,'\"',sizeof(joydata->name)); - } - else { - joyenv += joyGetData(joyenv,joydata->name, ' ',sizeof(joydata->name)); - } - - /* Now get the number of axes */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->axes = SDL_atoi(tempnumber); - - /* Now get the number of buttons */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->buttons = SDL_atoi(tempnumber); - - /* Now get the number of hats */ - while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->hats = SDL_atoi(tempnumber); - - /* Now get the number of balls */ - while (*joyenv==' ' && *joyenv != 0) joyenv++; /* jump spaces... */ - joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); - joydata->balls = SDL_atoi(tempnumber); - return 1; + const char *joyenv; /* Pointer to tested character */ + char tempnumber[5]; /* Temporary place to put numeric texts */ + + joyenv = SDL_getenv("SDL_OS2_JOYSTICK"); + if (!joyenv) { + return 0; + } + + /* Joystick Environment is defined! */ + while (*joyenv == ' ' && *joyenv != 0) { + joyenv++; /* jump spaces... */ + } + + /* If the string name starts with '... get if fully */ + if (*joyenv == '\'') { + joyenv++; + joyenv += joyGetData(joyenv,joydata->name,'\'',sizeof(joydata->name)); + } + /* If not, get it until the next space */ + else if (*joyenv == '\"') { + joyenv++; + joyenv += joyGetData(joyenv,joydata->name,'\"',sizeof(joydata->name)); + } + else { + joyenv += joyGetData(joyenv,joydata->name, ' ',sizeof(joydata->name)); + } + + /* Now get the number of axes */ + while (*joyenv == ' ' && *joyenv != 0) { + joyenv++; /* jump spaces... */ + } + joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); + joydata->axes = SDL_atoi(tempnumber); + + /* Now get the number of buttons */ + while (*joyenv == ' ' && *joyenv != 0) { + joyenv++; /* jump spaces... */ + } + joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); + joydata->buttons = SDL_atoi(tempnumber); + + /* Now get the number of hats */ + while (*joyenv == ' ' && *joyenv != 0) { + joyenv++; /* jump spaces... */ + } + joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); + joydata->hats = SDL_atoi(tempnumber); + + /* Now get the number of balls */ + while (*joyenv==' ' && *joyenv != 0) { + joyenv++; /* jump spaces... */ + } + joyenv += joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber)); + joydata->balls = SDL_atoi(tempnumber); + + return 1; } /************************************************************************/ -/* Get a text from in the string starting in joyenv until it finds */ -/* the stopchar or maxchars is reached. The result is placed in name. */ +/* Get a text from in the string starting in joyenv until it finds */ +/* the stopchar or maxchars is reached. The result is placed in name. */ /************************************************************************/ static int joyGetData(const char *joyenv, char *name, char stopchar, size_t maxchars) { - char *nameptr; /* Pointer to the selected character */ - int chcnt = 0; /* Count how many characters where copied */ - - nameptr = name; - while (*joyenv!=stopchar && *joyenv!=0) - { - if (nameptr < (name + (maxchars-1))) - { - *nameptr = *joyenv; /* Only copy if smaller than maximum */ - nameptr++; - } - chcnt++; - joyenv++; - } - if (*joyenv == stopchar) - { - joyenv++; /* Jump stopchar */ - chcnt++; - } - *nameptr = 0; /* Mark last byte */ - return chcnt; + char *nameptr; /* Pointer to the selected character */ + int chcnt = 0; /* Count how many characters where copied */ + + nameptr = name; + while (*joyenv!=stopchar && *joyenv != 0) { + if (nameptr < (name + (maxchars-1))) { + *nameptr = *joyenv; /* Only copy if smaller than maximum */ + nameptr++; + } + chcnt++; + joyenv++; + } + if (*joyenv == stopchar) { + joyenv++; /* Jump stopchar */ + chcnt++; + } + *nameptr = 0; /* Mark last byte */ + return chcnt; } -SDL_JoystickDriver SDL_OS2_JoystickDriver = -{ - OS2_JoystickInit, - OS2_NumJoysticks, - OS2_JoystickDetect, - OS2_JoystickGetDeviceName, - OS2_JoystickGetDevicePath, - OS2_JoystickGetDevicePlayerIndex, - OS2_JoystickSetDevicePlayerIndex, - OS2_JoystickGetDeviceGUID, - OS2_JoystickGetDeviceInstanceID, - OS2_JoystickOpen, - OS2_JoystickRumble, - OS2_JoystickRumbleTriggers, - OS2_JoystickGetCapabilities, - OS2_JoystickSetLED, - OS2_JoystickSendEffect, - OS2_JoystickSetSensorsEnabled, - OS2_JoystickUpdate, - OS2_JoystickClose, - OS2_JoystickQuit, - OS2_JoystickGetGamepadMapping +SDL_JoystickDriver SDL_OS2_JoystickDriver = { + OS2_JoystickInit, + OS2_NumJoysticks, + OS2_JoystickDetect, + OS2_JoystickGetDeviceName, + OS2_JoystickGetDevicePath, + OS2_JoystickGetDeviceSteamVirtualGamepadSlot, + OS2_JoystickGetDevicePlayerIndex, + OS2_JoystickSetDevicePlayerIndex, + OS2_JoystickGetDeviceGUID, + OS2_JoystickGetDeviceInstanceID, + OS2_JoystickOpen, + OS2_JoystickRumble, + OS2_JoystickRumbleTriggers, + OS2_JoystickGetCapabilities, + OS2_JoystickSetLED, + OS2_JoystickSendEffect, + OS2_JoystickSetSensorsEnabled, + OS2_JoystickUpdate, + OS2_JoystickClose, + OS2_JoystickQuit, + OS2_JoystickGetGamepadMapping }; #endif /* SDL_JOYSTICK_OS2 */ diff --git a/src/joystick/ps2/SDL_sysjoystick.c b/src/joystick/ps2/SDL_sysjoystick.c index 3847d79c594ec..adc73ca7b0aed 100644 --- a/src/joystick/ps2/SDL_sysjoystick.c +++ b/src/joystick/ps2/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_JOYSTICK_PS2 +#ifdef SDL_JOYSTICK_PS2 /* This is the PS2 implementation of the SDL joystick API */ #include #include #include -#include /* For the definition of NULL */ +#include /* For the definition of NULL */ #include #include @@ -41,11 +41,12 @@ #define PS2_MAX_SLOT 4 /* maximum - 4 slots in one multitap */ #define MAX_CONTROLLERS (PS2_MAX_PORT * PS2_MAX_SLOT) #define PS2_ANALOG_STICKS 2 -#define PS2_ANALOG_AXIS 2 -#define PS2_BUTTONS 16 -#define PS2_TOTAL_AXIS (PS2_ANALOG_STICKS * PS2_ANALOG_AXIS) +#define PS2_ANALOG_AXIS 2 +#define PS2_BUTTONS 16 +#define PS2_TOTAL_AXIS (PS2_ANALOG_STICKS * PS2_ANALOG_AXIS) -struct JoyInfo { +struct JoyInfo +{ uint8_t padBuf[256]; uint16_t btns; uint8_t analog_state[PS2_TOTAL_AXIS]; @@ -53,19 +54,20 @@ struct JoyInfo { uint8_t slot; int8_t rumble_ready; int8_t opened; -} __attribute__ ((aligned (64))); +} __attribute__((aligned(64))); static uint8_t enabled_pads = 0; static struct JoyInfo joyInfo[MAX_CONTROLLERS]; static inline int16_t convert_u8_to_s16(uint8_t val) { - if (val == 0) - return -0x7fff; - return val * 0x0101 - 0x8000; + if (val == 0) { + return -0x7fff; + } + return val * 0x0101 - 0x8000; } -static inline uint8_t rumble_status(uint8_t index) +static inline uint8_t rumble_status(uint8_t index) { char actAlign[6]; int res; @@ -78,7 +80,7 @@ static inline uint8_t rumble_status(uint8_t index) actAlign[3] = 0xff; actAlign[4] = 0xff; actAlign[5] = 0xff; - + res = padSetActAlign(info->port, info->slot, actAlign); info->rumble_ready = res <= 0 ? -1 : 1; } @@ -87,19 +89,21 @@ static inline uint8_t rumble_status(uint8_t index) } /* Function to scan the system for joysticks. -* Joystick 0 should be the system default joystick. -* This function should return 0, or -1 on an unrecoverable error. -*/ + * Joystick 0 should be the system default joystick. + * This function should return 0, or -1 on an unrecoverable error. + */ static int PS2_JoystickInit(void) { uint32_t port = 0; uint32_t slot = 0; - if(init_joystick_driver(true) < 0) + if (init_joystick_driver(true) < 0) { return -1; + } - for (port = 0; port < PS2_MAX_PORT; port++) + for (port = 0; port < PS2_MAX_PORT; port++) { mtapPortOpen(port); + } /* it can fail - we dont care, we will check it more strictly when padPortOpen */ for (slot = 0; slot < PS2_MAX_SLOT; slot++) { @@ -116,7 +120,7 @@ static int PS2_JoystickInit(void) */ struct JoyInfo *info = &joyInfo[enabled_pads]; - if(padPortOpen(port, slot, (void *)info->padBuf) > 0) { + if (padPortOpen(port, slot, (void *)info->padBuf) > 0) { info->port = (uint8_t)port; info->slot = (uint8_t)slot; info->opened = 1; @@ -129,21 +133,22 @@ static int PS2_JoystickInit(void) } /* Function to return the number of joystick devices plugged in right now */ -static int PS2_JoystickGetCount() +static int PS2_JoystickGetCount(void) { return (int)enabled_pads; } /* Function to cause any queued joystick insertions to be processed */ -static void PS2_JoystickDetect() +static void PS2_JoystickDetect(void) { } /* Function to get the device-dependent name of a joystick */ static const char *PS2_JoystickGetDeviceName(int index) { - if (index >= 0 && index < enabled_pads) + if (index >= 0 && index < enabled_pads) { return "PS2 Controller"; + } SDL_SetError("No joystick available with that index"); return NULL; @@ -155,6 +160,12 @@ static const char *PS2_JoystickGetDevicePath(int index) return NULL; } +/* Function to get the Steam virtual gamepad slot of a joystick */ +static int PS2_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + /* Function to get the player index of a joystick */ static int PS2_JoystickGetDevicePlayerIndex(int device_index) { @@ -201,7 +212,7 @@ static int PS2_JoystickOpen(SDL_Joystick *joystick, int device_index) joystick->naxes = PS2_TOTAL_AXIS; joystick->nhats = 0; joystick->instance_id = device_index; - + return 0; } @@ -218,13 +229,13 @@ static int PS2_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl } // Initial value - actAlign[0] = low_frequency_rumble >> 8; // Enable small engine - actAlign[1] = high_frequency_rumble >> 8; // Enable big engine + actAlign[0] = low_frequency_rumble >> 8; // Enable small engine + actAlign[1] = high_frequency_rumble >> 8; // Enable big engine actAlign[2] = 0xff; actAlign[3] = 0xff; actAlign[4] = 0xff; actAlign[5] = 0xff; - + res = padSetActDirect(info->port, info->slot, actAlign); return res == 1 ? 0 : -1; } @@ -238,7 +249,7 @@ static int PS2_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left, Uint1 /* Capability detection */ static Uint32 PS2_JoystickGetCapabilities(SDL_Joystick *joystick) { - return SDL_JOYCAP_RUMBLE; + return SDL_JOYCAP_RUMBLE; } /* LED functionality */ @@ -260,10 +271,10 @@ static int PS2_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enable } /* Function to update the state of a joystick - called as a device poll. -* This function shouldn't update the joystick structure directly, -* but instead should call SDL_PrivateJoystick*() to deliver events -* and update joystick device state. -*/ + * This function shouldn't update the joystick structure directly, + * but instead should call SDL_PrivateJoystick*() to deliver events + * and update joystick device state. + */ static void PS2_JoystickUpdate(SDL_Joystick *joystick) { uint8_t i; @@ -279,14 +290,16 @@ static void PS2_JoystickUpdate(SDL_Joystick *joystick) int ret = padRead(info->port, info->slot, &buttons); /* port, slot, buttons */ if (ret != 0) { /* Buttons */ - int32_t pressed_buttons = 0xffff ^ buttons.btns;; + int32_t pressed_buttons = 0xffff ^ buttons.btns; + ; if (info->btns != pressed_buttons) { for (i = 0; i < PS2_BUTTONS; i++) { mask = (1 << i); previous = info->btns & mask; current = pressed_buttons & mask; - if (previous != current) + if (previous != current) { SDL_PrivateJoystickButton(joystick, i, current ? SDL_PRESSED : SDL_RELEASED); + } } } info->btns = pressed_buttons; @@ -300,9 +313,10 @@ static void PS2_JoystickUpdate(SDL_Joystick *joystick) for (i = 0; i < PS2_TOTAL_AXIS; i++) { previous_axis = info->analog_state[i]; current_axis = all_axis[i]; - if (previous_axis != current_axis) + if (previous_axis != current_axis) { SDL_PrivateJoystickAxis(joystick, i, convert_u8_to_s16(current_axis)); - + } + info->analog_state[i] = current_axis; } } @@ -324,18 +338,18 @@ static void PS2_JoystickQuit(void) deinit_joystick_driver(true); } -static SDL_bool PS2_GetGamepadMapping(int device_index, SDL_GamepadMapping * out) +static SDL_bool PS2_GetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_PS2_JoystickDriver = -{ +SDL_JoystickDriver SDL_PS2_JoystickDriver = { PS2_JoystickInit, PS2_JoystickGetCount, PS2_JoystickDetect, PS2_JoystickGetDeviceName, PS2_JoystickGetDevicePath, + PS2_JoystickGetDeviceSteamVirtualGamepadSlot, PS2_JoystickGetDevicePlayerIndex, PS2_JoystickSetDevicePlayerIndex, PS2_JoystickGetDeviceGUID, diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c index 06c0f285bfd1b..160e3f2d88fa6 100644 --- a/src/joystick/psp/SDL_sysjoystick.c +++ b/src/joystick/psp/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,12 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_JOYSTICK_PSP +#ifdef SDL_JOYSTICK_PSP /* This is the PSP implementation of the SDL joystick API */ #include -#include /* For the definition of NULL */ +#include /* For the definition of NULL */ #include #include "../SDL_sysjoystick.h" @@ -40,38 +40,39 @@ static const enum PspCtrlButtons button_map[] = { PSP_CTRL_TRIANGLE, PSP_CTRL_CIRCLE, PSP_CTRL_CROSS, PSP_CTRL_SQUARE, PSP_CTRL_LTRIGGER, PSP_CTRL_RTRIGGER, PSP_CTRL_DOWN, PSP_CTRL_LEFT, PSP_CTRL_UP, PSP_CTRL_RIGHT, - PSP_CTRL_SELECT, PSP_CTRL_START, PSP_CTRL_HOME, PSP_CTRL_HOLD }; -static int analog_map[256]; /* Map analog inputs to -32768 -> 32767 */ + PSP_CTRL_SELECT, PSP_CTRL_START, PSP_CTRL_HOME, PSP_CTRL_HOLD +}; +static int analog_map[256]; /* Map analog inputs to -32768 -> 32767 */ typedef struct { - int x; - int y; + int x; + int y; } point; /* 4 points define the bezier-curve. */ static point a = { 0, 0 }; -static point b = { 50, 0 }; +static point b = { 50, 0 }; static point c = { 78, 32767 }; static point d = { 128, 32767 }; /* simple linear interpolation between two points */ -static SDL_INLINE void lerp (point *dest, point *pt_a, point *pt_b, float t) +static SDL_INLINE void lerp(point *dest, point *pt_a, point *pt_b, float t) { - dest->x = pt_a->x + (pt_b->x - pt_a->x)*t; - dest->y = pt_a->y + (pt_b->y - pt_a->y)*t; + dest->x = pt_a->x + (pt_b->x - pt_a->x) * t; + dest->y = pt_a->y + (pt_b->y - pt_a->y) * t; } /* evaluate a point on a bezier-curve. t goes from 0 to 1.0 */ static int calc_bezier_y(float t) { point ab, bc, cd, abbc, bccd, dest; - lerp (&ab, &a, &b, t); /* point between a and b */ - lerp (&bc, &b, &c, t); /* point between b and c */ - lerp (&cd, &c, &d, t); /* point between c and d */ - lerp (&abbc, &ab, &bc, t); /* point between ab and bc */ - lerp (&bccd, &bc, &cd, t); /* point between bc and cd */ - lerp (&dest, &abbc, &bccd, t); /* point on the bezier-curve */ + lerp(&ab, &a, &b, t); /* point between a and b */ + lerp(&bc, &b, &c, t); /* point between b and c */ + lerp(&cd, &c, &d, t); /* point between c and d */ + lerp(&abbc, &ab, &bc, t); /* point between ab and bc */ + lerp(&bccd, &bc, &cd, t); /* point between bc and cd */ + lerp(&dest, &abbc, &bccd, t); /* point on the bezier-curve */ return dest.y; } @@ -89,13 +90,15 @@ static int PSP_JoystickInit(void) /* Create an accurate map from analog inputs (0 to 255) to SDL joystick positions (-32768 to 32767) */ - for (i = 0; i < 128; i++) - { - float t = (float)i/127.0f; - analog_map[i+128] = calc_bezier_y(t); - analog_map[127-i] = -1 * analog_map[i+128]; + for (i = 0; i < 128; i++) { + float t = (float)i / 127.0f; + analog_map[i + 128] = calc_bezier_y(t); + analog_map[127 - i] = -1 * analog_map[i + 128]; } + /* Fire off a joystick add event */ + SDL_PrivateJoystickAdded(0); + return 1; } @@ -111,11 +114,12 @@ static void PSP_JoystickDetect(void) /* Function to get the device-dependent name of a joystick */ static const char *PSP_JoystickGetDeviceName(int device_index) { - if (device_index == 0) + if (device_index == 0) { return "PSP builtin joypad"; + } SDL_SetError("No joystick available with that index"); - return(NULL); + return NULL; } static const char *PSP_JoystickGetDevicePath(int index) @@ -123,6 +127,11 @@ static const char *PSP_JoystickGetDevicePath(int index) return NULL; } +static int PSP_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return -1; +} + static int PSP_JoystickGetDevicePlayerIndex(int device_index) { return -1; @@ -204,17 +213,19 @@ static void PSP_JoystickUpdate(SDL_Joystick *joystick) static enum PspCtrlButtons old_buttons = 0; static unsigned char old_x = 0, old_y = 0; - sceCtrlReadBufferPositive(&pad, 1); + if (sceCtrlPeekBufferPositive(&pad, 1) <= 0) { + return; + } buttons = pad.Buttons; x = pad.Lx; y = pad.Ly; /* Axes */ - if(old_x != x) { + if (old_x != x) { SDL_PrivateJoystickAxis(joystick, 0, analog_map[x]); old_x = x; } - if(old_y != y) { + if (old_y != y) { SDL_PrivateJoystickAxis(joystick, 1, analog_map[y]); old_y = y; } @@ -222,13 +233,12 @@ static void PSP_JoystickUpdate(SDL_Joystick *joystick) /* Buttons */ changed = old_buttons ^ buttons; old_buttons = buttons; - if(changed) { + if (changed) { for (i = 0; i < SDL_arraysize(button_map); i++) { if (changed & button_map[i]) { SDL_PrivateJoystickButton( joystick, i, - (buttons & button_map[i]) ? - SDL_PRESSED : SDL_RELEASED); + (buttons & button_map[i]) ? SDL_PRESSED : SDL_RELEASED); } } } @@ -244,19 +254,18 @@ static void PSP_JoystickQuit(void) { } -static SDL_bool -PSP_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool PSP_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_PSP_JoystickDriver = -{ +SDL_JoystickDriver SDL_PSP_JoystickDriver = { PSP_JoystickInit, PSP_JoystickGetCount, PSP_JoystickDetect, PSP_JoystickGetDeviceName, PSP_JoystickGetDevicePath, + PSP_JoystickGetDeviceSteamVirtualGamepadSlot, PSP_JoystickGetDevicePlayerIndex, PSP_JoystickSetDevicePlayerIndex, PSP_JoystickGetDeviceGUID, diff --git a/src/joystick/sort_controllers.py b/src/joystick/sort_controllers.py index f550df2826d38..c97559f553700 100755 --- a/src/joystick/sort_controllers.py +++ b/src/joystick/sort_controllers.py @@ -13,7 +13,18 @@ controller_guids = {} conditionals = [] split_pattern = re.compile(r'([^"]*")([^,]*,)([^,]*,)([^"]*)(".*)') -guid_crc_pattern = re.compile(r'^([0-9a-zA-Z]{4})([0-9a-zA-Z]{2})([0-9a-zA-Z]{2})([0-9a-zA-Z]{24},)$') +# BUS (1) CRC (3,2) VID (5,4) (6) PID (8,7) (9) VERSION (11,10) MISC (12) +standard_guid_pattern = re.compile(r'^([0-9a-fA-F]{4})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})(0000)([0-9a-fA-F]{2})([0-9a-fA-F]{2})(0000)([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{4},)$') + +# These chipsets are used in multiple controllers with different mappings, +# without enough unique information to differentiate them. e.g. +# https://github.com/gabomdq/SDL_GameControllerDB/issues/202 +invalid_controllers = ( + ('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick + ('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick + ('04b4', '2412', 'c529'), # Flydigi Vader 2, Vader 2 Pro, Apex 2, Apex 3 + ('16c0', '05e1', '0000'), # Xinmotek Controller +) def find_element(prefix, bindings): i=0 @@ -23,7 +34,16 @@ def find_element(prefix, bindings): i=(i + 1) return -1 - + +def get_crc_from_entry(entry): + crc = "" + line = "".join(entry) + bindings = line.split(",") + pos = find_element("crc:", bindings) + if pos >= 0: + crc = bindings[pos][4:] + return crc + def save_controller(line): global controllers match = split_pattern.match(line) @@ -32,18 +52,34 @@ def save_controller(line): if (bindings[0] == ""): bindings.pop(0) + name = entry[2].rstrip(',') + crc = "" pos = find_element("crc:", bindings) if pos >= 0: crc = bindings[pos] + "," bindings.pop(pos) - # Look for CRC embedded in the GUID and convert to crc element - crc_match = guid_crc_pattern.match(entry[1]) - if crc_match and crc_match.group(2) != '00' and crc_match.group(3) != '00': - print("Extracting CRC from GUID of " + entry[2]) - entry[1] = crc_match.group(1) + '0000' + crc_match.group(4) - crc = "crc:" + crc_match.group(3) + crc_match.group(2) + "," + guid_match = standard_guid_pattern.match(entry[1]) + if guid_match: + groups = guid_match.groups() + crc_value = groups[2] + groups[1] + vid_value = groups[4] + groups[3] + pid_value = groups[7] + groups[6] + version_value = groups[10] + groups[9] + #print("CRC: %s, VID: %s, PID: %s, VERSION: %s" % (crc_value, vid_value, pid_value, version_value)) + + if crc_value == "0000": + if crc != "": + crc_value = crc[4:-1] + else: + print("Extracting CRC from GUID of " + name) + entry[1] = groups[0] + "0000" + "".join(groups[3:]) + crc = "crc:" + crc_value + "," + + if (vid_value, pid_value, crc_value) in invalid_controllers: + print("Controller '%s' not unique, skipping" % name) + return pos = find_element("sdk", bindings) if pos >= 0: @@ -58,7 +94,7 @@ def save_controller(line): entry.append(match.group(5)) controllers.append(entry) - entry_id = entry[1] + entry[3] + entry_id = entry[1] + get_crc_from_entry(entry) if ',sdk' in line or ',hint:' in line: conditionals.append(entry_id) @@ -67,7 +103,7 @@ def write_controllers(): global controller_guids # Check for duplicates for entry in controllers: - entry_id = entry[1] + entry[3] + entry_id = entry[1] + get_crc_from_entry(entry) if (entry_id in controller_guids and entry_id not in conditionals): current_name = entry[2] existing_name = controller_guids[entry_id][2] @@ -108,7 +144,7 @@ def write_controllers(): else: save_controller(line) else: - if (line.startswith("static const char *s_ControllerMappings")): + if (line.startswith("static const char *")): parsing_controllers = True output.write(line) diff --git a/src/joystick/steam/SDL_steamcontroller.c b/src/joystick/steam/SDL_steamcontroller.c index 52511fbea064a..b80dc866750ab 100644 --- a/src/joystick/steam/SDL_steamcontroller.c +++ b/src/joystick/steam/SDL_steamcontroller.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,6 @@ #include "../SDL_joystick_c.h" #include "SDL_steamcontroller.h" - void SDL_InitSteamControllers(SteamControllerConnectedCallback_t connectedCallback, SteamControllerDisconnectedCallback_t disconnectedCallback) { diff --git a/src/joystick/steam/SDL_steamcontroller.h b/src/joystick/steam/SDL_steamcontroller.h index f740693ff51c8..81131f2d6c518 100644 --- a/src/joystick/steam/SDL_steamcontroller.h +++ b/src/joystick/steam/SDL_steamcontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h index dd390f1d26e40..9484ba50740ac 100644 --- a/src/joystick/usb_ids.h +++ b/src/joystick/usb_ids.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,13 +27,20 @@ #define USB_VENDOR_8BITDO 0x2dc8 #define USB_VENDOR_AMAZON 0x1949 #define USB_VENDOR_APPLE 0x05ac +#define USB_VENDOR_ASTRO 0x9886 +#define USB_VENDOR_ASUS 0x0b05 +#define USB_VENDOR_BACKBONE 0x358a +#define USB_VENDOR_GAMESIR 0x3537 #define USB_VENDOR_DRAGONRISE 0x0079 #define USB_VENDOR_GOOGLE 0x18d1 #define USB_VENDOR_HORI 0x0f0d #define USB_VENDOR_HYPERKIN 0x2e24 +#define USB_VENDOR_LOGITECH 0x046d #define USB_VENDOR_MADCATZ 0x0738 +#define USB_VENDOR_MAYFLASH 0x33df #define USB_VENDOR_MICROSOFT 0x045e #define USB_VENDOR_NACON 0x146b +#define USB_VENDOR_NACON_ALT 0x3285 #define USB_VENDOR_NINTENDO 0x057e #define USB_VENDOR_NVIDIA 0x0955 #define USB_VENDOR_PDP 0x0e6f @@ -41,117 +48,133 @@ #define USB_VENDOR_POWERA_ALT 0x20d6 #define USB_VENDOR_QANBA 0x2c22 #define USB_VENDOR_RAZER 0x1532 +#define USB_VENDOR_SAITEK 0x06a3 #define USB_VENDOR_SHANWAN 0x2563 #define USB_VENDOR_SHANWAN_ALT 0x20bc #define USB_VENDOR_SONY 0x054c #define USB_VENDOR_THRUSTMASTER 0x044f +#define USB_VENDOR_TURTLE_BEACH 0x10f5 +#define USB_VENDOR_SWITCH 0x2563 #define USB_VENDOR_VALVE 0x28de #define USB_VENDOR_ZEROPLUS 0x0c12 -#define SONY_THIRDPARTY_VENDOR(X) \ - (X == USB_VENDOR_DRAGONRISE || \ - X == USB_VENDOR_HORI || \ - X == USB_VENDOR_MADCATZ || \ - X == USB_VENDOR_NACON || \ - X == USB_VENDOR_PDP || \ - X == USB_VENDOR_POWERA || \ - X == USB_VENDOR_POWERA_ALT || \ - X == USB_VENDOR_QANBA || \ - X == USB_VENDOR_RAZER || \ - X == USB_VENDOR_SHANWAN || \ - X == USB_VENDOR_SHANWAN_ALT || \ - X == USB_VENDOR_THRUSTMASTER || \ - X == USB_VENDOR_ZEROPLUS || \ - X == 0x7545 /* SZ-MYPOWER */) - -#define USB_PRODUCT_8BITDO_XBOX_CONTROLLER 0x2002 -#define USB_PRODUCT_AMAZON_LUNA_CONTROLLER 0x0419 -#define USB_PRODUCT_GOOGLE_STADIA_CONTROLLER 0x9400 -#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER 0x1846 -#define USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X 0x0150 -#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS4 0x011c -#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS5 0x0184 -#define USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER 0x0337 -#define USB_PRODUCT_NINTENDO_N64_CONTROLLER 0x2019 -#define USB_PRODUCT_NINTENDO_SEGA_GENESIS_CONTROLLER 0x201e -#define USB_PRODUCT_NINTENDO_SNES_CONTROLLER 0x2017 -#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP 0x200e -#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT 0x2006 -#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR 0x2008 /* Used by joycond */ -#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT 0x2007 -#define USB_PRODUCT_NINTENDO_SWITCH_PRO 0x2009 -#define USB_PRODUCT_NINTENDO_WII_REMOTE 0x0306 -#define USB_PRODUCT_NINTENDO_WII_REMOTE2 0x0330 -#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103 0x7210 -#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104 0x7214 -#define USB_PRODUCT_RAZER_ATROX 0x0a00 -#define USB_PRODUCT_RAZER_PANTHERA 0x0401 -#define USB_PRODUCT_RAZER_PANTHERA_EVO 0x1008 -#define USB_PRODUCT_RAZER_RAIJU 0x1000 -#define USB_PRODUCT_RAZER_TOURNAMENT_EDITION_USB 0x1007 -#define USB_PRODUCT_RAZER_TOURNAMENT_EDITION_BLUETOOTH 0x100a -#define USB_PRODUCT_RAZER_ULTIMATE_EDITION_USB 0x1004 -#define USB_PRODUCT_RAZER_ULTIMATE_EDITION_BLUETOOTH 0x1009 -#define USB_PRODUCT_SHANWAN_DS3 0x0523 -#define USB_PRODUCT_SONY_DS3 0x0268 -#define USB_PRODUCT_SONY_DS4 0x05c4 -#define USB_PRODUCT_SONY_DS4_DONGLE 0x0ba0 -#define USB_PRODUCT_SONY_DS4_SLIM 0x09cc -#define USB_PRODUCT_SONY_DS5 0x0ce6 -#define USB_PRODUCT_VICTRIX_FS_PRO_V2 0x0207 -#define USB_PRODUCT_XBOX360_XUSB_CONTROLLER 0x02a1 /* XUSB driver software PID */ -#define USB_PRODUCT_XBOX360_WIRED_CONTROLLER 0x028e -#define USB_PRODUCT_XBOX360_WIRELESS_RECEIVER 0x0719 -#define USB_PRODUCT_XBOX_ONE_ADAPTIVE 0x0b0a -#define USB_PRODUCT_XBOX_ONE_ADAPTIVE_BLUETOOTH 0x0b0c -#define USB_PRODUCT_XBOX_ONE_ADAPTIVE_BLE 0x0b21 -#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1 0x02e3 -#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 0x0b00 -#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH 0x0b05 -#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLE 0x0b22 -#define USB_PRODUCT_XBOX_ONE_S 0x02ea -#define USB_PRODUCT_XBOX_ONE_S_REV1_BLUETOOTH 0x02e0 -#define USB_PRODUCT_XBOX_ONE_S_REV2_BLUETOOTH 0x02fd -#define USB_PRODUCT_XBOX_ONE_S_REV2_BLE 0x0b20 -#define USB_PRODUCT_XBOX_SERIES_X 0x0b12 -#define USB_PRODUCT_XBOX_SERIES_X_BLE 0x0b13 -#define USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT 0x02d6 -#define USB_PRODUCT_XBOX_SERIES_X_PDP_BLUE 0x02d9 -#define USB_PRODUCT_XBOX_SERIES_X_PDP_AFTERGLOW 0x02da -#define USB_PRODUCT_XBOX_SERIES_X_POWERA_FUSION_PRO2 0x4001 -#define USB_PRODUCT_XBOX_SERIES_X_POWERA_SPECTRA 0x4002 -#define USB_PRODUCT_XBOX_ONE_XBOXGIP_CONTROLLER 0x02ff /* XBOXGIP driver software PID */ -#define USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER 0x02fe /* Made up product ID for XInput */ -#define USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD 0x11ff +#define USB_PRODUCT_8BITDO_XBOX_CONTROLLER1 0x2002 /* Ultimate Wired Controller for Xbox */ +#define USB_PRODUCT_8BITDO_XBOX_CONTROLLER2 0x3106 /* Ultimate Wireless / Pro 2 Wired Controller */ +#define USB_PRODUCT_AMAZON_LUNA_CONTROLLER 0x0419 +#define USB_PRODUCT_ASTRO_C40_XBOX360 0x0024 +#define USB_PRODUCT_BACKBONE_ONE_IOS 0x0103 +#define USB_PRODUCT_BACKBONE_ONE_IOS_PS5 0x0104 +#define USB_PRODUCT_GAMESIR_G7 0x1001 +#define USB_PRODUCT_GOOGLE_STADIA_CONTROLLER 0x9400 +#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER1 0x1843 +#define USB_PRODUCT_EVORETRO_GAMECUBE_ADAPTER2 0x1846 +#define USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X 0x0150 +#define USB_PRODUCT_HORI_HORIPAD_PRO_SERIES_X 0x014f +#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS4 0x011c +#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS5 0x0184 +#define USB_PRODUCT_LOGITECH_F310 0xc216 +#define USB_PRODUCT_LOGITECH_CHILLSTREAM 0xcad1 +#define USB_PRODUCT_MADCATZ_SAITEK_SIDE_PANEL_CONTROL_DECK 0x2218 +#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS4_WIRELESS 0x0d16 +#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS4_WIRED 0x0d17 +#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRELESS 0x0d18 +#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRED 0x0d19 +#define USB_PRODUCT_NINTENDO_GAMECUBE_ADAPTER 0x0337 +#define USB_PRODUCT_NINTENDO_N64_CONTROLLER 0x2019 +#define USB_PRODUCT_NINTENDO_SEGA_GENESIS_CONTROLLER 0x201e +#define USB_PRODUCT_NINTENDO_SNES_CONTROLLER 0x2017 +#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_GRIP 0x200e +#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_LEFT 0x2006 +#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_PAIR 0x2008 /* Used by joycond */ +#define USB_PRODUCT_NINTENDO_SWITCH_JOYCON_RIGHT 0x2007 +#define USB_PRODUCT_NINTENDO_SWITCH_PRO 0x2009 +#define USB_PRODUCT_NINTENDO_WII_REMOTE 0x0306 +#define USB_PRODUCT_NINTENDO_WII_REMOTE2 0x0330 +#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V103 0x7210 +#define USB_PRODUCT_NVIDIA_SHIELD_CONTROLLER_V104 0x7214 +#define USB_PRODUCT_RAZER_ATROX 0x0a00 +#define USB_PRODUCT_RAZER_KITSUNE 0x1012 +#define USB_PRODUCT_RAZER_PANTHERA 0x0401 +#define USB_PRODUCT_RAZER_PANTHERA_EVO 0x1008 +#define USB_PRODUCT_RAZER_RAIJU 0x1000 +#define USB_PRODUCT_RAZER_TOURNAMENT_EDITION_USB 0x1007 +#define USB_PRODUCT_RAZER_TOURNAMENT_EDITION_BLUETOOTH 0x100a +#define USB_PRODUCT_RAZER_ULTIMATE_EDITION_USB 0x1004 +#define USB_PRODUCT_RAZER_ULTIMATE_EDITION_BLUETOOTH 0x1009 +#define USB_PRODUCT_RAZER_WOLVERINE_V2 0x0a29 +#define USB_PRODUCT_RAZER_WOLVERINE_V2_CHROMA 0x0a2e +#define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_PS5_WIRED 0x100b +#define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_PS5_WIRELESS 0x100c +#define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_XBOX_WIRED 0x1010 +#define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_XBOX_WIRELESS 0x1011 +#define USB_PRODUCT_ROG_RAIKIRI 0x1a38 +#define USB_PRODUCT_SAITEK_CYBORG_V3 0xf622 +#define USB_PRODUCT_SHANWAN_DS3 0x0523 +#define USB_PRODUCT_SONY_DS3 0x0268 +#define USB_PRODUCT_SONY_DS4 0x05c4 +#define USB_PRODUCT_SONY_DS4_DONGLE 0x0ba0 +#define USB_PRODUCT_SONY_DS4_SLIM 0x09cc +#define USB_PRODUCT_SONY_DS4_STRIKEPAD 0x05c5 +#define USB_PRODUCT_SONY_DS5 0x0ce6 +#define USB_PRODUCT_SONY_DS5_EDGE 0x0df2 +#define USB_PRODUCT_SWITCH_RETROBIT_CONTROLLER 0x0575 +#define USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO 0xd012 +#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R 0x7013 +#define USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON 0x7009 +#define USB_PRODUCT_VICTRIX_FS_PRO 0x0203 +#define USB_PRODUCT_VICTRIX_FS_PRO_V2 0x0207 +#define USB_PRODUCT_XBOX360_XUSB_CONTROLLER 0x02a1 /* XUSB driver software PID */ +#define USB_PRODUCT_XBOX360_WIRED_CONTROLLER 0x028e +#define USB_PRODUCT_XBOX360_WIRELESS_RECEIVER 0x0719 +#define USB_PRODUCT_XBOX_ONE_ADAPTIVE 0x0b0a +#define USB_PRODUCT_XBOX_ONE_ADAPTIVE_BLUETOOTH 0x0b0c +#define USB_PRODUCT_XBOX_ONE_ADAPTIVE_BLE 0x0b21 +#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1 0x02e3 +#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 0x0b00 +#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH 0x0b05 +#define USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLE 0x0b22 +#define USB_PRODUCT_XBOX_ONE_S 0x02ea +#define USB_PRODUCT_XBOX_ONE_S_REV1_BLUETOOTH 0x02e0 +#define USB_PRODUCT_XBOX_ONE_S_REV2_BLUETOOTH 0x02fd +#define USB_PRODUCT_XBOX_ONE_S_REV2_BLE 0x0b20 +#define USB_PRODUCT_XBOX_SERIES_X 0x0b12 +#define USB_PRODUCT_XBOX_SERIES_X_BLE 0x0b13 +#define USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT 0x02d6 +#define USB_PRODUCT_XBOX_SERIES_X_PDP_BLUE 0x02d9 +#define USB_PRODUCT_XBOX_SERIES_X_PDP_AFTERGLOW 0x02da +#define USB_PRODUCT_XBOX_SERIES_X_POWERA_FUSION_PRO2 0x4001 +#define USB_PRODUCT_XBOX_SERIES_X_POWERA_SPECTRA 0x4002 +#define USB_PRODUCT_XBOX_ONE_XBOXGIP_CONTROLLER 0x02ff /* XBOXGIP driver software PID */ +#define USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD 0x11ff /* USB usage pages */ -#define USB_USAGEPAGE_GENERIC_DESKTOP 0x0001 -#define USB_USAGEPAGE_BUTTON 0x0009 +#define USB_USAGEPAGE_GENERIC_DESKTOP 0x0001 +#define USB_USAGEPAGE_BUTTON 0x0009 /* USB usages for USAGE_PAGE_GENERIC_DESKTOP */ -#define USB_USAGE_GENERIC_POINTER 0x0001 -#define USB_USAGE_GENERIC_MOUSE 0x0002 -#define USB_USAGE_GENERIC_JOYSTICK 0x0004 -#define USB_USAGE_GENERIC_GAMEPAD 0x0005 -#define USB_USAGE_GENERIC_KEYBOARD 0x0006 -#define USB_USAGE_GENERIC_KEYPAD 0x0007 -#define USB_USAGE_GENERIC_MULTIAXISCONTROLLER 0x0008 -#define USB_USAGE_GENERIC_X 0x0030 -#define USB_USAGE_GENERIC_Y 0x0031 -#define USB_USAGE_GENERIC_Z 0x0032 -#define USB_USAGE_GENERIC_RX 0x0033 -#define USB_USAGE_GENERIC_RY 0x0034 -#define USB_USAGE_GENERIC_RZ 0x0035 -#define USB_USAGE_GENERIC_SLIDER 0x0036 -#define USB_USAGE_GENERIC_DIAL 0x0037 -#define USB_USAGE_GENERIC_WHEEL 0x0038 -#define USB_USAGE_GENERIC_HAT 0x0039 +#define USB_USAGE_GENERIC_POINTER 0x0001 +#define USB_USAGE_GENERIC_MOUSE 0x0002 +#define USB_USAGE_GENERIC_JOYSTICK 0x0004 +#define USB_USAGE_GENERIC_GAMEPAD 0x0005 +#define USB_USAGE_GENERIC_KEYBOARD 0x0006 +#define USB_USAGE_GENERIC_KEYPAD 0x0007 +#define USB_USAGE_GENERIC_MULTIAXISCONTROLLER 0x0008 +#define USB_USAGE_GENERIC_X 0x0030 +#define USB_USAGE_GENERIC_Y 0x0031 +#define USB_USAGE_GENERIC_Z 0x0032 +#define USB_USAGE_GENERIC_RX 0x0033 +#define USB_USAGE_GENERIC_RY 0x0034 +#define USB_USAGE_GENERIC_RZ 0x0035 +#define USB_USAGE_GENERIC_SLIDER 0x0036 +#define USB_USAGE_GENERIC_DIAL 0x0037 +#define USB_USAGE_GENERIC_WHEEL 0x0038 +#define USB_USAGE_GENERIC_HAT 0x0039 /* Bluetooth SIG assigned Company Identifiers https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/ */ -#define BLUETOOTH_VENDOR_AMAZON 0x0171 +#define BLUETOOTH_VENDOR_AMAZON 0x0171 -#define BLUETOOTH_PRODUCT_LUNA_CONTROLLER 0x0419 +#define BLUETOOTH_PRODUCT_LUNA_CONTROLLER 0x0419 #endif /* usb_ids_h_ */ diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c index 9a6d9430e50f3..a8859c8803686 100644 --- a/src/joystick/virtual/SDL_virtualjoystick.c +++ b/src/joystick/virtual/SDL_virtualjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if defined(SDL_JOYSTICK_VIRTUAL) +#ifdef SDL_JOYSTICK_VIRTUAL /* This is the virtual implementation of the SDL joystick API */ @@ -29,36 +29,36 @@ #include "../SDL_sysjoystick.h" #include "../SDL_joystick_c.h" +static joystick_hwdata *g_VJoys SDL_GUARDED_BY(SDL_joystick_lock) = NULL; -static joystick_hwdata * g_VJoys = NULL; +static joystick_hwdata *VIRTUAL_HWDataForIndex(int device_index) +{ + joystick_hwdata *vjoy; + SDL_AssertJoysticksLocked(); -static joystick_hwdata * -VIRTUAL_HWDataForIndex(int device_index) -{ - joystick_hwdata *vjoy = g_VJoys; - while (vjoy) { - if (device_index == 0) + for (vjoy = g_VJoys; vjoy; vjoy = vjoy->next) { + if (device_index == 0) { break; + } --device_index; - vjoy = vjoy->next; } return vjoy; } - -static void -VIRTUAL_FreeHWData(joystick_hwdata *hwdata) +static void VIRTUAL_FreeHWData(joystick_hwdata *hwdata) { - joystick_hwdata * cur = g_VJoys; - joystick_hwdata * prev = NULL; - + joystick_hwdata *cur; + joystick_hwdata *prev = NULL; + + SDL_AssertJoysticksLocked(); + if (!hwdata) { return; } /* Remove hwdata from SDL-global list */ - while (cur) { + for (cur = g_VJoys; cur; prev = cur, cur = cur->next) { if (hwdata == cur) { if (prev) { prev->next = cur->next; @@ -67,8 +67,6 @@ VIRTUAL_FreeHWData(joystick_hwdata *hwdata) } break; } - prev = cur; - cur = cur->next; } if (hwdata->joystick) { @@ -94,9 +92,7 @@ VIRTUAL_FreeHWData(joystick_hwdata *hwdata) SDL_free(hwdata); } - -int -SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) +int SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) { joystick_hwdata *hwdata = NULL; int device_index = -1; @@ -104,6 +100,8 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) int axis_triggerleft = -1; int axis_triggerright = -1; + SDL_AssertJoysticksLocked(); + if (!desc) { return SDL_InvalidParamError("desc"); } @@ -161,7 +159,7 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) int i, axis; if (hwdata->desc.button_mask == 0) { - for (i = 0; i < hwdata->desc.nbuttons && i < sizeof(hwdata->desc.button_mask)*8; ++i) { + for (i = 0; i < hwdata->desc.nbuttons && i < sizeof(hwdata->desc.button_mask) * 8; ++i) { hwdata->desc.button_mask |= (1 << i); } } @@ -193,7 +191,7 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) } } - hwdata->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_VIRTUAL, hwdata->desc.vendor_id, hwdata->desc.product_id, 0, name, 'v', (Uint8)hwdata->desc.type); + hwdata->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_VIRTUAL, hwdata->desc.vendor_id, hwdata->desc.product_id, 0, NULL, name, 'v', (Uint8)hwdata->desc.type); /* Allocate fields for different control-types */ if (hwdata->desc.naxes > 0) { @@ -234,7 +232,6 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) joystick_hwdata *last; for (last = g_VJoys; last->next; last = last->next) { - continue; } last->next = hwdata; } else { @@ -247,9 +244,7 @@ SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc) return device_index; } - -int -SDL_JoystickDetachVirtualInner(int device_index) +int SDL_JoystickDetachVirtualInner(int device_index) { SDL_JoystickID instance_id; joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); @@ -262,9 +257,7 @@ SDL_JoystickDetachVirtualInner(int device_index) return 0; } - -int -SDL_JoystickSetVirtualAxisInner(SDL_Joystick *joystick, int axis, Sint16 value) +int SDL_JoystickSetVirtualAxisInner(SDL_Joystick *joystick, int axis, Sint16 value) { joystick_hwdata *hwdata; @@ -287,9 +280,7 @@ SDL_JoystickSetVirtualAxisInner(SDL_Joystick *joystick, int axis, Sint16 value) return 0; } - -int -SDL_JoystickSetVirtualButtonInner(SDL_Joystick *joystick, int button, Uint8 value) +int SDL_JoystickSetVirtualButtonInner(SDL_Joystick *joystick, int button, Uint8 value) { joystick_hwdata *hwdata; @@ -312,9 +303,7 @@ SDL_JoystickSetVirtualButtonInner(SDL_Joystick *joystick, int button, Uint8 valu return 0; } - -int -SDL_JoystickSetVirtualHatInner(SDL_Joystick *joystick, int hat, Uint8 value) +int SDL_JoystickSetVirtualHatInner(SDL_Joystick *joystick, int hat, Uint8 value) { joystick_hwdata *hwdata; @@ -337,35 +326,29 @@ SDL_JoystickSetVirtualHatInner(SDL_Joystick *joystick, int hat, Uint8 value) return 0; } - -static int -VIRTUAL_JoystickInit(void) +static int VIRTUAL_JoystickInit(void) { return 0; } - -static int -VIRTUAL_JoystickGetCount(void) +static int VIRTUAL_JoystickGetCount(void) { + joystick_hwdata *cur; int count = 0; - joystick_hwdata *cur = g_VJoys; - while (cur) { + + SDL_AssertJoysticksLocked(); + + for (cur = g_VJoys; cur; cur = cur->next) { ++count; - cur = cur->next; } return count; } - -static void -VIRTUAL_JoystickDetect(void) +static void VIRTUAL_JoystickDetect(void) { } - -static const char * -VIRTUAL_JoystickGetDeviceName(int device_index) +static const char *VIRTUAL_JoystickGetDeviceName(int device_index) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); if (!hwdata) { @@ -374,23 +357,22 @@ VIRTUAL_JoystickGetDeviceName(int device_index) return hwdata->name; } - -static const char * -VIRTUAL_JoystickGetDevicePath(int device_index) +static const char *VIRTUAL_JoystickGetDevicePath(int device_index) { return NULL; } - -static int -VIRTUAL_JoystickGetDevicePlayerIndex(int device_index) +static int VIRTUAL_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) { return -1; } +static int VIRTUAL_JoystickGetDevicePlayerIndex(int device_index) +{ + return -1; +} -static void -VIRTUAL_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void VIRTUAL_JoystickSetDevicePlayerIndex(int device_index, int player_index) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); @@ -399,9 +381,7 @@ VIRTUAL_JoystickSetDevicePlayerIndex(int device_index, int player_index) } } - -static SDL_JoystickGUID -VIRTUAL_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID VIRTUAL_JoystickGetDeviceGUID(int device_index) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); if (!hwdata) { @@ -412,9 +392,7 @@ VIRTUAL_JoystickGetDeviceGUID(int device_index) return hwdata->guid; } - -static SDL_JoystickID -VIRTUAL_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID VIRTUAL_JoystickGetDeviceInstanceID(int device_index) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); if (!hwdata) { @@ -423,11 +401,13 @@ VIRTUAL_JoystickGetDeviceInstanceID(int device_index) return hwdata->instance_id; } - -static int -VIRTUAL_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int VIRTUAL_JoystickOpen(SDL_Joystick *joystick, int device_index) { - joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); + joystick_hwdata *hwdata; + + SDL_AssertJoysticksLocked(); + + hwdata = VIRTUAL_HWDataForIndex(device_index); if (!hwdata) { return SDL_SetError("No such device"); } @@ -440,12 +420,12 @@ VIRTUAL_JoystickOpen(SDL_Joystick *joystick, int device_index) return 0; } - -static int -VIRTUAL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int VIRTUAL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { int result; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { joystick_hwdata *hwdata = joystick->hwdata; if (hwdata->desc.Rumble) { @@ -460,11 +440,12 @@ VIRTUAL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint return result; } -static int -VIRTUAL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int VIRTUAL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { int result; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { joystick_hwdata *hwdata = joystick->hwdata; if (hwdata->desc.RumbleTriggers) { @@ -479,13 +460,14 @@ VIRTUAL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint1 return result; } - -static Uint32 -VIRTUAL_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 VIRTUAL_JoystickGetCapabilities(SDL_Joystick *joystick) { - joystick_hwdata *hwdata = joystick->hwdata; + joystick_hwdata *hwdata; Uint32 caps = 0; + SDL_AssertJoysticksLocked(); + + hwdata = joystick->hwdata; if (hwdata) { if (hwdata->desc.Rumble) { caps |= SDL_JOYCAP_RUMBLE; @@ -500,12 +482,12 @@ VIRTUAL_JoystickGetCapabilities(SDL_Joystick *joystick) return caps; } - -static int -VIRTUAL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int VIRTUAL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { int result; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { joystick_hwdata *hwdata = joystick->hwdata; if (hwdata->desc.SetLED) { @@ -520,11 +502,12 @@ VIRTUAL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blu return result; } -static int -VIRTUAL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int VIRTUAL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { int result; + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { joystick_hwdata *hwdata = joystick->hwdata; if (hwdata->desc.SendEffect) { @@ -539,19 +522,18 @@ VIRTUAL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) return result; } -static int -VIRTUAL_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int VIRTUAL_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } - -static void -VIRTUAL_JoystickUpdate(SDL_Joystick *joystick) +static void VIRTUAL_JoystickUpdate(SDL_Joystick *joystick) { joystick_hwdata *hwdata; int i; + SDL_AssertJoysticksLocked(); + if (!joystick) { return; } @@ -576,10 +558,10 @@ VIRTUAL_JoystickUpdate(SDL_Joystick *joystick) } } - -static void -VIRTUAL_JoystickClose(SDL_Joystick *joystick) +static void VIRTUAL_JoystickClose(SDL_Joystick *joystick) { + SDL_AssertJoysticksLocked(); + if (joystick->hwdata) { joystick_hwdata *hwdata = joystick->hwdata; hwdata->joystick = NULL; @@ -587,17 +569,16 @@ VIRTUAL_JoystickClose(SDL_Joystick *joystick) } } - -static void -VIRTUAL_JoystickQuit(void) +static void VIRTUAL_JoystickQuit(void) { + SDL_AssertJoysticksLocked(); + while (g_VJoys) { VIRTUAL_FreeHWData(g_VJoys); } } -static SDL_bool -VIRTUAL_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool VIRTUAL_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); int current_button = 0; @@ -740,13 +721,13 @@ VIRTUAL_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) return SDL_TRUE; } -SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver = -{ +SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver = { VIRTUAL_JoystickInit, VIRTUAL_JoystickGetCount, VIRTUAL_JoystickDetect, VIRTUAL_JoystickGetDeviceName, VIRTUAL_JoystickGetDevicePath, + VIRTUAL_JoystickGetDeviceSteamVirtualGamepadSlot, VIRTUAL_JoystickGetDevicePlayerIndex, VIRTUAL_JoystickSetDevicePlayerIndex, VIRTUAL_JoystickGetDeviceGUID, diff --git a/src/joystick/virtual/SDL_virtualjoystick_c.h b/src/joystick/virtual/SDL_virtualjoystick_c.h index 5e15f1dd6ea64..62cc41ec900d8 100644 --- a/src/joystick/virtual/SDL_virtualjoystick_c.h +++ b/src/joystick/virtual/SDL_virtualjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_VIRTUALJOYSTICK_C_H #define SDL_VIRTUALJOYSTICK_C_H -#if SDL_JOYSTICK_VIRTUAL +#ifdef SDL_JOYSTICK_VIRTUAL #include "SDL_joystick.h" @@ -49,12 +49,12 @@ typedef struct joystick_hwdata int SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *desc); int SDL_JoystickDetachVirtualInner(int device_index); -int SDL_JoystickSetVirtualAxisInner(SDL_Joystick * joystick, int axis, Sint16 value); -int SDL_JoystickSetVirtualButtonInner(SDL_Joystick * joystick, int button, Uint8 value); -int SDL_JoystickSetVirtualHatInner(SDL_Joystick * joystick, int hat, Uint8 value); +int SDL_JoystickSetVirtualAxisInner(SDL_Joystick *joystick, int axis, Sint16 value); +int SDL_JoystickSetVirtualButtonInner(SDL_Joystick *joystick, int button, Uint8 value); +int SDL_JoystickSetVirtualHatInner(SDL_Joystick *joystick, int hat, Uint8 value); -#endif /* SDL_JOYSTICK_VIRTUAL */ +#endif /* SDL_JOYSTICK_VIRTUAL */ -#endif /* SDL_VIRTUALJOYSTICK_C_H */ +#endif /* SDL_VIRTUALJOYSTICK_C_H */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/vita/SDL_sysjoystick.c b/src/joystick/vita/SDL_sysjoystick.c index 994655fc63e64..215a0329ed13f 100644 --- a/src/joystick/vita/SDL_sysjoystick.c +++ b/src/joystick/vita/SDL_sysjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_JOYSTICK_VITA +#ifdef SDL_JOYSTICK_VITA /* This is the PSVita implementation of the SDL joystick API */ #include #include #include -#include /* For the definition of NULL */ +#include /* For the definition of NULL */ #include #include "../SDL_sysjoystick.h" @@ -45,7 +45,7 @@ static SceCtrlData pad1 = { .lx = 0, .ly = 0, .rx = 0, .ry = 0, .lt = 0, .rt = 0 static SceCtrlData pad2 = { .lx = 0, .ly = 0, .rx = 0, .ry = 0, .lt = 0, .rt = 0, .buttons = 0 }; static SceCtrlData pad3 = { .lx = 0, .ly = 0, .rx = 0, .ry = 0, .lt = 0, .rt = 0, .buttons = 0 }; -static int ext_port_map[4]= { 1, 2, 3, 4 }; //index: SDL joy number, entry: Vita port number. For external controllers +static int ext_port_map[4] = { 1, 2, 3, 4 }; // index: SDL joy number, entry: Vita port number. For external controllers static int SDL_numjoysticks = 1; @@ -68,23 +68,23 @@ static const unsigned int ext_button_map[] = { SCE_CTRL_R3 }; -static int analog_map[256]; /* Map analog inputs to -32768 -> 32767 */ +static int analog_map[256]; /* Map analog inputs to -32768 -> 32767 */ typedef struct { - int x; - int y; + int x; + int y; } point; /* 4 points define the bezier-curve. */ /* The Vita has a good amount of analog travel, so use a linear curve */ static point a = { 0, 0 }; -static point b = { 0, 0 }; +static point b = { 0, 0 }; static point c = { 128, 32767 }; static point d = { 128, 32767 }; /* simple linear interpolation between two points */ -static SDL_INLINE void lerp (point *dest, point *first, point *second, float t) +static SDL_INLINE void lerp(point *dest, point *first, point *second, float t) { dest->x = first->x + (second->x - first->x) * t; dest->y = first->y + (second->y - first->y) * t; @@ -94,12 +94,12 @@ static SDL_INLINE void lerp (point *dest, point *first, point *second, float t) static int calc_bezier_y(float t) { point ab, bc, cd, abbc, bccd, dest; - lerp (&ab, &a, &b, t); /* point between a and b */ - lerp (&bc, &b, &c, t); /* point between b and c */ - lerp (&cd, &c, &d, t); /* point between c and d */ - lerp (&abbc, &ab, &bc, t); /* point between ab and bc */ - lerp (&bccd, &bc, &cd, t); /* point between bc and cd */ - lerp (&dest, &abbc, &bccd, t); /* point on the bezier-curve */ + lerp(&ab, &a, &b, t); /* point between a and b */ + lerp(&bc, &b, &c, t); /* point between b and c */ + lerp(&cd, &c, &d, t); /* point between c and d */ + lerp(&abbc, &ab, &bc, t); /* point between ab and bc */ + lerp(&bccd, &bc, &cd, t); /* point between bc and cd */ + lerp(&dest, &abbc, &bccd, t); /* point on the bezier-curve */ return dest.y; } @@ -118,11 +118,10 @@ int VITA_JoystickInit(void) /* Create an accurate map from analog inputs (0 to 255) to SDL joystick positions (-32768 to 32767) */ - for (i = 0; i < 128; i++) - { - float t = (float)i/127.0f; - analog_map[i+128] = calc_bezier_y(t); - analog_map[127-i] = -1 * analog_map[i+128]; + for (i = 0; i < 128; i++) { + float t = (float)i / 127.0f; + analog_map[i + 128] = calc_bezier_y(t); + analog_map[127 - i] = -1 * analog_map[i + 128]; } // Assume we have at least one controller, even when nothing is paired @@ -137,10 +136,8 @@ int VITA_JoystickInit(void) // On Vita TV, port 0 and 1 are the same controller // and that is the first one, so start at port 2 - for (i=2; i<=4; i++) - { - if (myPortInfo.port[i]!=SCE_CTRL_TYPE_UNPAIRED) - { + for (i = 2; i <= 4; i++) { + if (myPortInfo.port[i] != SCE_CTRL_TYPE_UNPAIRED) { SDL_PrivateJoystickAdded(SDL_numjoysticks); SDL_numjoysticks++; } @@ -148,12 +145,12 @@ int VITA_JoystickInit(void) return SDL_numjoysticks; } -int VITA_JoystickGetCount() +int VITA_JoystickGetCount(void) { return SDL_numjoysticks; } -void VITA_JoystickDetect() +void VITA_JoystickDetect(void) { } @@ -165,17 +162,21 @@ SDL_JoystickID VITA_JoystickGetDeviceInstanceID(int device_index) const char *VITA_JoystickGetDeviceName(int index) { - if (index == 0) + if (index == 0) { return "PSVita Controller"; + } - if (index == 1) + if (index == 1) { return "PSVita Controller"; + } - if (index == 2) + if (index == 2) { return "PSVita Controller"; + } - if (index == 3) + if (index == 3) { return "PSVita Controller"; + } SDL_SetError("No joystick available with that index"); return NULL; @@ -186,14 +187,17 @@ const char *VITA_JoystickGetDevicePath(int index) return NULL; } -static int -VITA_JoystickGetDevicePlayerIndex(int device_index) +static int VITA_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) { return -1; } -static void -VITA_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static int VITA_JoystickGetDevicePlayerIndex(int device_index) +{ + return -1; +} + +static void VITA_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } @@ -232,13 +236,18 @@ static void VITA_JoystickUpdate(SDL_Joystick *joystick) static unsigned char old_rt[] = { 0, 0, 0, 0 }; SceCtrlData *pad = NULL; - int index = (int) SDL_JoystickInstanceID(joystick); + int index = (int)SDL_JoystickInstanceID(joystick); - if (index == 0) pad = &pad0; - else if (index == 1) pad = &pad1; - else if (index == 2) pad = &pad2; - else if (index == 3) pad = &pad3; - else return; + if (index == 0) + pad = &pad0; + else if (index == 1) + pad = &pad1; + else if (index == 2) + pad = &pad2; + else if (index == 3) + pad = &pad3; + else + return; if (index == 0) { if (sceCtrlPeekBufferPositive2(ext_port_map[index], pad, 1) < 0) { @@ -295,8 +304,7 @@ static void VITA_JoystickUpdate(SDL_Joystick *joystick) if (changed & ext_button_map[i]) { SDL_PrivateJoystickButton( joystick, i, - (buttons & ext_button_map[i]) ? - SDL_PRESSED : SDL_RELEASED); + (buttons & ext_button_map[i]) ? SDL_PRESSED : SDL_RELEASED); } } } @@ -319,10 +327,9 @@ SDL_JoystickGUID VITA_JoystickGetDeviceGUID(int device_index) return SDL_CreateJoystickGUIDForName(name); } -static int -VITA_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int VITA_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { - int index = (int) SDL_JoystickInstanceID(joystick); + int index = (int)SDL_JoystickInstanceID(joystick); SceCtrlActuator act; SDL_zero(act); @@ -334,55 +341,48 @@ VITA_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 return 0; } -static int -VITA_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left, Uint16 right) +static int VITA_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left, Uint16 right) { return SDL_Unsupported(); } -static Uint32 -VITA_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 VITA_JoystickGetCapabilities(SDL_Joystick *joystick) { // always return LED and rumble supported for now return SDL_JOYCAP_LED | SDL_JOYCAP_RUMBLE; } - -static int -VITA_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int VITA_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { - int index = (int) SDL_JoystickInstanceID(joystick); + int index = (int)SDL_JoystickInstanceID(joystick); if (sceCtrlSetLightBar(ext_port_map[index], red, green, blue) < 0) { return SDL_Unsupported(); } return 0; } -static int -VITA_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int VITA_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -VITA_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int VITA_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static SDL_bool -VITA_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool VITA_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_VITA_JoystickDriver = -{ +SDL_JoystickDriver SDL_VITA_JoystickDriver = { VITA_JoystickInit, VITA_JoystickGetCount, VITA_JoystickDetect, VITA_JoystickGetDeviceName, VITA_JoystickGetDevicePath, + VITA_JoystickGetDeviceSteamVirtualGamepadSlot, VITA_JoystickGetDevicePlayerIndex, VITA_JoystickSetDevicePlayerIndex, VITA_JoystickGetDeviceGUID, diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c index 9c5a46bd08d9e..73c26051ec8de 100644 --- a/src/joystick/windows/SDL_dinputjoystick.c +++ b/src/joystick/windows/SDL_dinputjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #include "../SDL_sysjoystick.h" -#if SDL_JOYSTICK_DINPUT +#ifdef SDL_JOYSTICK_DINPUT #include "SDL_hints.h" #include "SDL_timer.h" @@ -33,16 +33,20 @@ #include "../hidapi/SDL_hidapijoystick_c.h" #ifndef DIDFT_OPTIONAL -#define DIDFT_OPTIONAL 0x80000000 +#define DIDFT_OPTIONAL 0x80000000 #endif -#define INPUT_QSIZE 128 /* Buffer up to 128 input messages */ -#define JOY_AXIS_THRESHOLD (((SDL_JOYSTICK_AXIS_MAX)-(SDL_JOYSTICK_AXIS_MIN))/100) /* 1% motion */ +#define INPUT_QSIZE 128 /* Buffer up to 128 input messages */ +#define JOY_AXIS_THRESHOLD (((SDL_JOYSTICK_AXIS_MAX) - (SDL_JOYSTICK_AXIS_MIN)) / 100) /* 1% motion */ -#define CONVERT_MAGNITUDE(x) (((x)*10000) / 0x7FFF) +#define CONVERT_MAGNITUDE(x) (((x)*10000) / 0x7FFF) /* external variables referenced. */ +#ifdef SDL_VIDEO_DRIVER_WINDOWS extern HWND SDL_HelperWindow; +#else +static const HWND SDL_HelperWindow = NULL; +#endif /* local variables */ static SDL_bool coinitialized = SDL_FALSE; @@ -229,16 +233,14 @@ const DIDATAFORMAT SDL_c_dfDIJoystick2 = { }; /* Convert a DirectInput return code to a text message */ -static int -SetDIerror(const char *function, HRESULT code) +static int SetDIerror(const char *function, HRESULT code) { return SDL_SetError("%s() DirectX error 0x%8.8lx", function, code); } -static SDL_bool -SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char* hidPath) +static SDL_bool SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char *hidPath) { -#ifdef SDL_JOYSTICK_XINPUT +#if defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT) SDL_GameControllerType type; /* XInput and RawInput backends will pick up XInput-compatible devices */ @@ -246,7 +248,7 @@ SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char* hidPath) #ifdef SDL_JOYSTICK_RAWINPUT && !RAWINPUT_IsEnabled() #endif - ) { + ) { return SDL_FALSE; } @@ -262,13 +264,12 @@ SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char* hidPath) (vendor_id == USB_VENDOR_VALVE && product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD)) { return SDL_TRUE; } -#endif /* SDL_JOYSTICK_XINPUT */ +#endif /* SDL_JOYSTICK_XINPUT || SDL_JOYSTICK_RAWINPUT */ return SDL_FALSE; } -static SDL_bool -QueryDeviceName(LPDIRECTINPUTDEVICE8 device, char** device_name) +static SDL_bool QueryDeviceName(LPDIRECTINPUTDEVICE8 device, char **device_name) { DIPROPSTRING dipstr; @@ -290,8 +291,7 @@ QueryDeviceName(LPDIRECTINPUTDEVICE8 device, char** device_name) return SDL_TRUE; } -static SDL_bool -QueryDevicePath(LPDIRECTINPUTDEVICE8 device, char** device_path) +static SDL_bool QueryDevicePath(LPDIRECTINPUTDEVICE8 device, char **device_path) { DIPROPGUIDANDPATH dippath; @@ -316,8 +316,7 @@ QueryDevicePath(LPDIRECTINPUTDEVICE8 device, char** device_path) return SDL_TRUE; } -static SDL_bool -QueryDeviceInfo(LPDIRECTINPUTDEVICE8 device, Uint16* vendor_id, Uint16* product_id) +static SDL_bool QueryDeviceInfo(LPDIRECTINPUTDEVICE8 device, Uint16 *vendor_id, Uint16 *product_id) { DIPROPDWORD dipdw; @@ -396,8 +395,7 @@ DIEFFECT *CreateRumbleEffectData(Sint16 magnitude) return effect; } -int -SDL_DINPUT_JoystickInit(void) +int SDL_DINPUT_JoystickInit(void) { HRESULT result; HINSTANCE instance; @@ -416,7 +414,7 @@ SDL_DINPUT_JoystickInit(void) coinitialized = SDL_TRUE; result = CoCreateInstance(&CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, - &IID_IDirectInput8, (LPVOID *)&dinput); + &IID_IDirectInput8, (LPVOID *)&dinput); if (FAILED(result)) { return SetDIerror("CoCreateInstance", result); @@ -424,7 +422,7 @@ SDL_DINPUT_JoystickInit(void) /* Because we used CoCreateInstance, we need to Initialize it, first. */ instance = GetModuleHandle(NULL); - if (instance == NULL) { + if (!instance) { IDirectInput8_Release(dinput); dinput = NULL; return SDL_SetError("GetModuleHandle() failed with error code %lu.", GetLastError()); @@ -439,11 +437,25 @@ SDL_DINPUT_JoystickInit(void) return 0; } +static int GetSteamVirtualGamepadSlot(Uint16 vendor_id, Uint16 product_id, const char *device_path) +{ + int slot = -1; + + if (vendor_id == USB_VENDOR_VALVE && + product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { + (void)SDL_sscanf(device_path, "\\\\?\\HID#VID_28DE&PID_11FF&IG_0%d", &slot); + } + return slot; +} + /* helper function for direct input, gets called for each connected joystick */ -static BOOL CALLBACK -EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) +static BOOL CALLBACK EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) { -#define CHECK(expression) { if(!(expression)) goto err; } +#define CHECK(expression) \ + { \ + if (!(expression)) \ + goto err; \ + } JoyStick_DeviceData *pNewJoystick = NULL; JoyStick_DeviceData *pPrevJoystick = NULL; Uint16 vendor = 0; @@ -454,7 +466,7 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) LPDIRECTINPUTDEVICE8 device = NULL; /* We are only supporting HID devices. */ - CHECK((pDeviceInstance->dwDevType & DIDEVTYPE_HID) != 0); + CHECK(pDeviceInstance->dwDevType & DIDEVTYPE_HID); CHECK(SUCCEEDED(IDirectInput8_CreateDevice(dinput, &pDeviceInstance->guidInstance, &device, NULL))); CHECK(QueryDeviceName(device, &name)); @@ -463,15 +475,14 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) CHECK(!SDL_IsXInputDevice(vendor, product, hidPath)); - pNewJoystick = *(JoyStick_DeviceData**)pContext; + pNewJoystick = *(JoyStick_DeviceData **)pContext; while (pNewJoystick) { /* update GUIDs of joysticks with matching paths, in case they're not open yet */ if (SDL_strcmp(pNewJoystick->path, hidPath) == 0) { /* if we are replacing the front of the list then update it */ - if (pNewJoystick == *(JoyStick_DeviceData**)pContext) { - *(JoyStick_DeviceData**)pContext = pNewJoystick->pNext; - } - else if (pPrevJoystick) { + if (pNewJoystick == *(JoyStick_DeviceData **)pContext) { + *(JoyStick_DeviceData **)pContext = pNewJoystick->pNext; + } else if (pPrevJoystick) { pPrevJoystick->pNext = pNewJoystick->pNext; } @@ -489,10 +500,10 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) pNewJoystick = pNewJoystick->pNext; } - pNewJoystick = (JoyStick_DeviceData *)SDL_malloc(sizeof(JoyStick_DeviceData)); + pNewJoystick = (JoyStick_DeviceData *)SDL_calloc(1, sizeof(JoyStick_DeviceData)); CHECK(pNewJoystick); - SDL_zerop(pNewJoystick); + pNewJoystick->steam_virtual_gamepad_slot = GetSteamVirtualGamepadSlot(vendor, product, hidPath); SDL_strlcpy(pNewJoystick->path, hidPath, SDL_arraysize(pNewJoystick->path)); SDL_memcpy(&pNewJoystick->dxdevice, pDeviceInstance, sizeof(DIDEVICEINSTANCE)); @@ -500,9 +511,9 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) CHECK(pNewJoystick->joystickname); if (vendor && product) { - pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, vendor, product, version, pNewJoystick->joystickname, 0, 0); + pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, vendor, product, version, NULL, name, 0, 0); } else { - pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor, product, version, pNewJoystick->joystickname, 0, 0); + pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_BLUETOOTH, vendor, product, version, NULL, name, 0, 0); } CHECK(!SDL_ShouldIgnoreJoystick(pNewJoystick->joystickname, pNewJoystick->guid)); @@ -535,10 +546,9 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) #undef CHECK } -void -SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext) +void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext) { - if (dinput == NULL) { + if (!dinput) { return; } @@ -553,10 +563,13 @@ typedef struct SDL_bool present; } Joystick_PresentData; -static BOOL CALLBACK -EnumJoystickPresentCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) +static BOOL CALLBACK EnumJoystickPresentCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext) { -#define CHECK(expression) { if(!(expression)) goto err; } +#define CHECK(expression) \ + { \ + if (!(expression)) \ + goto err; \ + } Joystick_PresentData *pData = (Joystick_PresentData *)pContext; Uint16 vendor = 0; Uint16 product = 0; @@ -564,7 +577,7 @@ EnumJoystickPresentCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext BOOL result = DIENUM_CONTINUE; /* We are only supporting HID devices. */ - CHECK((pDeviceInstance->dwDevType & DIDEVTYPE_HID) != 0); + CHECK(pDeviceInstance->dwDevType & DIDEVTYPE_HID); CHECK(SUCCEEDED(IDirectInput8_CreateDevice(dinput, &pDeviceInstance->guidInstance, &device, NULL))); CHECK(QueryDeviceInfo(device, &vendor, &product)); @@ -583,12 +596,11 @@ EnumJoystickPresentCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext #undef CHECK } -SDL_bool -SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number) +SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number) { Joystick_PresentData data; - if (dinput == NULL) { + if (!dinput) { return SDL_FALSE; } @@ -599,8 +611,7 @@ SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_n return data.present; } -static BOOL CALLBACK -EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) +static BOOL CALLBACK EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) { SDL_Joystick *joystick = (SDL_Joystick *)pContext; HRESULT result; @@ -622,19 +633,19 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) in->type = AXIS; in->num = joystick->naxes; - if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_XAxis, sizeof(pDeviceObject->guidType))) + if (SDL_memcmp(&pDeviceObject->guidType, &GUID_XAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_X; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_YAxis, sizeof(pDeviceObject->guidType))) + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_YAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_Y; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_ZAxis, sizeof(pDeviceObject->guidType))) + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_ZAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_Z; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_RxAxis, sizeof(pDeviceObject->guidType))) + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_RxAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_RX; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_RyAxis, sizeof(pDeviceObject->guidType))) + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_RyAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_RY; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_RzAxis, sizeof(pDeviceObject->guidType))) + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_RzAxis, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_RZ; - else if (!SDL_memcmp(&pDeviceObject->guidType, &GUID_Slider, sizeof(pDeviceObject->guidType))) { + } else if (SDL_memcmp(&pDeviceObject->guidType, &GUID_Slider, sizeof(pDeviceObject->guidType)) == 0) { in->ofs = DIJOFS_SLIDER(joystick->hwdata->NumSliders); ++joystick->hwdata->NumSliders; } else { @@ -650,9 +661,9 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) result = IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, - DIPROP_RANGE, &diprg.diph); + DIPROP_RANGE, &diprg.diph); if (FAILED(result)) { - return DIENUM_CONTINUE; /* don't use this axis */ + return DIENUM_CONTINUE; /* don't use this axis */ } /* Set dead zone to 0. */ @@ -663,9 +674,9 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) dilong.dwData = 0; result = IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, - DIPROP_DEADZONE, &dilong.diph); + DIPROP_DEADZONE, &dilong.diph); if (FAILED(result)) { - return DIENUM_CONTINUE; /* don't use this axis */ + return DIENUM_CONTINUE; /* don't use this axis */ } joystick->naxes++; @@ -677,7 +688,7 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) joystick->hwdata->NumInputs++; if (joystick->hwdata->NumInputs == MAX_INPUTS) { - return DIENUM_STOP; /* too many */ + return DIENUM_STOP; /* too many */ } return DIENUM_CONTINUE; @@ -686,22 +697,22 @@ EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE pDeviceObject, LPVOID pContext) /* Sort using the data offset into the DInput struct. * This gives a reasonable ordering for the inputs. */ -static int SDLCALL -SortDevFunc(const void *a, const void *b) +static int SDLCALL SortDevFunc(const void *a, const void *b) { - const input_t *inputA = (const input_t*)a; - const input_t *inputB = (const input_t*)b; + const input_t *inputA = (const input_t *)a; + const input_t *inputB = (const input_t *)b; - if (inputA->ofs < inputB->ofs) + if (inputA->ofs < inputB->ofs) { return -1; - if (inputA->ofs > inputB->ofs) + } + if (inputA->ofs > inputB->ofs) { return 1; + } return 0; } /* Sort the input objects and recalculate the indices for each input. */ -static void -SortDevObjects(SDL_Joystick *joystick) +static void SortDevObjects(SDL_Joystick *joystick) { input_t *inputs = joystick->hwdata->Inputs; int nButtons = 0; @@ -731,8 +742,7 @@ SortDevObjects(SDL_Joystick *joystick) } } -int -SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice) +int SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice) { HRESULT result; DIPROPDWORD dipdw; @@ -746,20 +756,19 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde result = IDirectInput8_CreateDevice(dinput, - &joystickdevice->dxdevice.guidInstance, - &joystick->hwdata->InputDevice, - NULL); + &joystickdevice->dxdevice.guidInstance, + &joystick->hwdata->InputDevice, + NULL); if (FAILED(result)) { return SetDIerror("IDirectInput::CreateDevice", result); } /* Acquire shared access. Exclusive access is required for forces, - * though. */ + * though. */ result = - IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata-> - InputDevice, SDL_HelperWindow, - DISCL_EXCLUSIVE | - DISCL_BACKGROUND); + IDirectInputDevice8_SetCooperativeLevel(joystick->hwdata->InputDevice, SDL_HelperWindow, + DISCL_EXCLUSIVE | + DISCL_BACKGROUND); if (FAILED(result)) { return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result); } @@ -767,7 +776,7 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde /* Use the extended data structure: DIJOYSTATE2. */ result = IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice, - &SDL_c_dfDIJoystick2); + &SDL_c_dfDIJoystick2); if (FAILED(result)) { return SetDIerror("IDirectInputDevice8::SetDataFormat", result); } @@ -775,7 +784,7 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde /* Get device capabilities */ result = IDirectInputDevice8_GetCapabilities(joystick->hwdata->InputDevice, - &joystick->hwdata->Capabilities); + &joystick->hwdata->Capabilities); if (FAILED(result)) { return SetDIerror("IDirectInputDevice8::GetCapabilities", result); } @@ -789,9 +798,8 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde /* reset all actuators. */ result = - IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata-> - InputDevice, - DISFFC_RESET); + IDirectInputDevice8_SendForceFeedbackCommand(joystick->hwdata->InputDevice, + DISFFC_RESET); /* Not necessarily supported, ignore if not supported. if (FAILED(result)) { @@ -806,14 +814,14 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde } /* Turn on auto-centering for a ForceFeedback device (until told - * otherwise). */ + * otherwise). */ dipdw.diph.dwObj = 0; dipdw.diph.dwHow = DIPH_DEVICE; dipdw.dwData = DIPROPAUTOCENTER_ON; result = IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, - DIPROP_AUTOCENTER, &dipdw.diph); + DIPROP_AUTOCENTER, &dipdw.diph); /* Not necessarily supported, ignore if not supported. if (FAILED(result)) { @@ -824,11 +832,11 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde /* What buttons and axes does it have? */ IDirectInputDevice8_EnumObjects(joystick->hwdata->InputDevice, - EnumDevObjectsCallback, joystick, - DIDFT_BUTTON | DIDFT_AXIS | DIDFT_POV); + EnumDevObjectsCallback, joystick, + DIDFT_BUTTON | DIDFT_AXIS | DIDFT_POV); /* Reorder the input objects. Some devices do not report the X axis as - * the first axis, for example. */ + * the first axis, for example. */ SortDevObjects(joystick); dipdw.diph.dwObj = 0; @@ -838,7 +846,7 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde /* Set the buffer size */ result = IDirectInputDevice8_SetProperty(joystick->hwdata->InputDevice, - DIPROP_BUFFERSIZE, &dipdw.diph); + DIPROP_BUFFERSIZE, &dipdw.diph); if (result == DI_POLLEDDEVICE) { /* This device doesn't support buffering, so we're forced @@ -847,6 +855,7 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde } else if (FAILED(result)) { return SetDIerror("IDirectInputDevice8::SetProperty", result); } + joystick->hwdata->first_update = SDL_TRUE; /* Poll and wait for initial device state to be populated */ result = IDirectInputDevice8_Poll(joystick->hwdata->InputDevice); @@ -859,8 +868,7 @@ SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde return 0; } -static int -SDL_DINPUT_JoystickInitRumble(SDL_Joystick * joystick, Sint16 magnitude) +static int SDL_DINPUT_JoystickInitRumble(SDL_Joystick *joystick, Sint16 magnitude) { HRESULT result; @@ -895,8 +903,7 @@ SDL_DINPUT_JoystickInitRumble(SDL_Joystick * joystick, Sint16 magnitude) return 0; } -int -SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { HRESULT result; @@ -941,8 +948,7 @@ SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, return 0; } -Uint32 -SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick) +Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) { Uint32 result = 0; @@ -953,8 +959,7 @@ SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick) return result; } -static Uint8 -TranslatePOV(DWORD value) +static Uint8 TranslatePOV(DWORD value) { const int HAT_VALS[] = { SDL_HAT_UP, @@ -967,16 +972,18 @@ TranslatePOV(DWORD value) SDL_HAT_UP | SDL_HAT_LEFT }; - if (LOWORD(value) == 0xFFFF) + if (LOWORD(value) == 0xFFFF) { return SDL_HAT_CENTERED; + } /* Round the value up: */ value += 4500 / 2; value %= 36000; value /= 4500; - if (value >= 8) - return SDL_HAT_CENTERED; /* shouldn't happen */ + if (value >= 8) { + return SDL_HAT_CENTERED; /* shouldn't happen */ + } return HAT_VALS[value]; } @@ -986,8 +993,7 @@ TranslatePOV(DWORD value) * but instead should call SDL_PrivateJoystick*() to deliver events * and update joystick device state. */ -static void -UpdateDINPUTJoystickState_Polled(SDL_Joystick * joystick) +static void UpdateDINPUTJoystickState_Polled(SDL_Joystick *joystick) { DIJOYSTATE2 state; HRESULT result; @@ -995,12 +1001,12 @@ UpdateDINPUTJoystickState_Polled(SDL_Joystick * joystick) result = IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice, - sizeof(DIJOYSTATE2), &state); + sizeof(DIJOYSTATE2), &state); if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); result = IDirectInputDevice8_GetDeviceState(joystick->hwdata->InputDevice, - sizeof(DIJOYSTATE2), &state); + sizeof(DIJOYSTATE2), &state); } if (result != DI_OK) { @@ -1043,7 +1049,7 @@ UpdateDINPUTJoystickState_Polled(SDL_Joystick * joystick) case BUTTON: SDL_PrivateJoystickButton(joystick, in->num, - (Uint8)(state.rgbButtons[in->ofs - DIJOFS_BUTTON0] ? SDL_PRESSED : SDL_RELEASED)); + (Uint8)(state.rgbButtons[in->ofs - DIJOFS_BUTTON0] ? SDL_PRESSED : SDL_RELEASED)); break; case HAT: { @@ -1055,8 +1061,7 @@ UpdateDINPUTJoystickState_Polled(SDL_Joystick * joystick) } } -static void -UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick) +static void UpdateDINPUTJoystickState_Buffered(SDL_Joystick *joystick) { int i; HRESULT result; @@ -1066,14 +1071,14 @@ UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick) numevents = INPUT_QSIZE; result = IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice, - sizeof(DIDEVICEOBJECTDATA), evtbuf, - &numevents, 0); + sizeof(DIDEVICEOBJECTDATA), evtbuf, + &numevents, 0); if (result == DIERR_INPUTLOST || result == DIERR_NOTACQUIRED) { IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice); result = IDirectInputDevice8_GetDeviceData(joystick->hwdata->InputDevice, - sizeof(DIDEVICEOBJECTDATA), - evtbuf, &numevents, 0); + sizeof(DIDEVICEOBJECTDATA), + evtbuf, &numevents, 0); } /* Handle the events or punt */ @@ -1087,8 +1092,9 @@ UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick) for (j = 0; j < joystick->hwdata->NumInputs; ++j) { const input_t *in = &joystick->hwdata->Inputs[j]; - if (evtbuf[i].dwOfs != in->ofs) + if (evtbuf[i].dwOfs != in->ofs) { continue; + } switch (in->type) { case AXIS: @@ -1096,14 +1102,13 @@ UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick) break; case BUTTON: SDL_PrivateJoystickButton(joystick, in->num, - (Uint8)(evtbuf[i].dwData ? SDL_PRESSED : SDL_RELEASED)); + (Uint8)(evtbuf[i].dwData ? SDL_PRESSED : SDL_RELEASED)); break; case HAT: - { - Uint8 pos = TranslatePOV(evtbuf[i].dwData); - SDL_PrivateJoystickHat(joystick, in->num, pos); - } - break; + { + Uint8 pos = TranslatePOV(evtbuf[i].dwData); + SDL_PrivateJoystickHat(joystick, in->num, pos); + } break; } } } @@ -1116,8 +1121,7 @@ UpdateDINPUTJoystickState_Buffered(SDL_Joystick * joystick) } } -void -SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick) +void SDL_DINPUT_JoystickUpdate(SDL_Joystick *joystick) { HRESULT result; @@ -1127,15 +1131,21 @@ SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick) IDirectInputDevice8_Poll(joystick->hwdata->InputDevice); } - if (joystick->hwdata->buffered) { + if (joystick->hwdata->first_update) { + /* Poll to get the initial state of the joystick */ + UpdateDINPUTJoystickState_Polled(joystick); + joystick->hwdata->first_update = SDL_FALSE; + return; + } + + if (joystick->hwdata->buffered ) { UpdateDINPUTJoystickState_Buffered(joystick); } else { UpdateDINPUTJoystickState_Polled(joystick); } } -void -SDL_DINPUT_JoystickClose(SDL_Joystick * joystick) +void SDL_DINPUT_JoystickClose(SDL_Joystick *joystick) { if (joystick->hwdata->ffeffect_ref) { IDirectInputEffect_Unload(joystick->hwdata->ffeffect_ref); @@ -1150,8 +1160,7 @@ SDL_DINPUT_JoystickClose(SDL_Joystick * joystick) joystick->hwdata->ff_initialized = SDL_FALSE; } -void -SDL_DINPUT_JoystickQuit(void) +void SDL_DINPUT_JoystickQuit(void) { if (dinput != NULL) { IDirectInput8_Release(dinput); @@ -1168,53 +1177,44 @@ SDL_DINPUT_JoystickQuit(void) typedef struct JoyStick_DeviceData JoyStick_DeviceData; -int -SDL_DINPUT_JoystickInit(void) +int SDL_DINPUT_JoystickInit(void) { return 0; } -void -SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext) +void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext) { } -SDL_bool -SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version) +SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version) { return SDL_FALSE; } -int -SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice) +int SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice) { return SDL_Unsupported(); } -int -SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -Uint32 -SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick) +Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -void -SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick) +void SDL_DINPUT_JoystickUpdate(SDL_Joystick *joystick) { } -void -SDL_DINPUT_JoystickClose(SDL_Joystick * joystick) +void SDL_DINPUT_JoystickClose(SDL_Joystick *joystick) { } -void -SDL_DINPUT_JoystickQuit(void) +void SDL_DINPUT_JoystickQuit(void) { } diff --git a/src/joystick/windows/SDL_dinputjoystick_c.h b/src/joystick/windows/SDL_dinputjoystick_c.h index 229569ec12935..79bbd222512d0 100644 --- a/src/joystick/windows/SDL_dinputjoystick_c.h +++ b/src/joystick/windows/SDL_dinputjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,11 +28,11 @@ extern "C" { extern int SDL_DINPUT_JoystickInit(void); extern void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext); extern SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version); -extern int SDL_DINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice); -extern int SDL_DINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); -extern Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick * joystick); -extern void SDL_DINPUT_JoystickUpdate(SDL_Joystick * joystick); -extern void SDL_DINPUT_JoystickClose(SDL_Joystick * joystick); +extern int SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice); +extern int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); +extern Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick); +extern void SDL_DINPUT_JoystickUpdate(SDL_Joystick *joystick); +extern void SDL_DINPUT_JoystickClose(SDL_Joystick *joystick); extern void SDL_DINPUT_JoystickQuit(void); /* Ends C function definitions when using C++ */ diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index fc738b07f3776..6803f7d80c51d 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 2022 Sam Lantinga + Copyright (C) 2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,8 +31,9 @@ */ #include "../../SDL_internal.h" -#if SDL_JOYSTICK_RAWINPUT +#ifdef SDL_JOYSTICK_RAWINPUT +#include "SDL_atomic.h" #include "SDL_endian.h" #include "SDL_events.h" #include "SDL_hints.h" @@ -43,6 +44,10 @@ #include "../../core/windows/SDL_hid.h" #include "../hidapi/SDL_hidapijoystick_c.h" +/* SDL_JOYSTICK_RAWINPUT_XINPUT is disabled because using XInput at the same time as + raw input will turn off the Xbox Series X controller when it is connected via the + Xbox One Wireless Adapter. + */ #ifdef HAVE_XINPUT_H #define SDL_JOYSTICK_RAWINPUT_XINPUT #endif @@ -74,26 +79,31 @@ typedef struct WindowsGamingInputGamepadState WindowsGamingInputGamepadState; #endif #endif -/*#define DEBUG_RAWINPUT*/ +#if 0 +#define DEBUG_RAWINPUT +#endif #ifndef RIDEV_EXINPUTSINK -#define RIDEV_EXINPUTSINK 0x00001000 -#define RIDEV_DEVNOTIFY 0x00002000 +#define RIDEV_EXINPUTSINK 0x00001000 +#define RIDEV_DEVNOTIFY 0x00002000 #endif #ifndef WM_INPUT_DEVICE_CHANGE -#define WM_INPUT_DEVICE_CHANGE 0x00FE +#define WM_INPUT_DEVICE_CHANGE 0x00FE #endif #ifndef WM_INPUT -#define WM_INPUT 0x00FF +#define WM_INPUT 0x00FF #endif #ifndef GIDC_ARRIVAL -#define GIDC_ARRIVAL 1 -#define GIDC_REMOVAL 2 +#define GIDC_ARRIVAL 1 +#define GIDC_REMOVAL 2 #endif +extern void WINDOWS_RAWINPUTEnabledChanged(void); +extern void WINDOWS_JoystickDetect(void); static SDL_bool SDL_RAWINPUT_inited = SDL_FALSE; +static SDL_bool SDL_RAWINPUT_remote_desktop = SDL_FALSE; static int SDL_RAWINPUT_numjoysticks = 0; static void RAWINPUT_JoystickClose(SDL_Joystick *joystick); @@ -109,6 +119,7 @@ typedef struct _SDL_RAWINPUT_Device SDL_JoystickGUID guid; SDL_bool is_xinput; SDL_bool is_xboxone; + int steam_virtual_gamepad_slot; PHIDP_PREPARSED_DATA preparsed_data; HANDLE hDevice; @@ -170,13 +181,15 @@ static const Uint16 subscribed_devices[] = { #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING -static struct { +static struct +{ Uint32 last_state_packet; SDL_Joystick *joystick; SDL_Joystick *last_joystick; } guide_button_candidate; -typedef struct WindowsMatchState { +typedef struct WindowsMatchState +{ #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_AXES SHORT match_axes[SDL_JOYSTICK_RAWINPUT_MATCH_COUNT]; #endif @@ -219,11 +232,11 @@ static void RAWINPUT_FillMatchState(WindowsMatchState *state, Uint64 match_state #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT /* Match axes by checking if the distance between the high 4 bits of axis and the 4 bits from match_state is 1 or less */ -#define XInputAxesMatch(gamepad) (\ - (Uint32)(gamepad.sThumbLX - state->match_axes[0] + 0x1000) <= 0x2fff && \ - (Uint32)(~gamepad.sThumbLY - state->match_axes[1] + 0x1000) <= 0x2fff && \ - (Uint32)(gamepad.sThumbRX - state->match_axes[2] + 0x1000) <= 0x2fff && \ - (Uint32)(~gamepad.sThumbRY - state->match_axes[3] + 0x1000) <= 0x2fff) +#define XInputAxesMatch(gamepad) ( \ + (Uint32)(gamepad.sThumbLX - state->match_axes[0] + 0x1000) <= 0x2fff && \ + (Uint32)(~gamepad.sThumbLY - state->match_axes[1] + 0x1000) <= 0x2fff && \ + (Uint32)(gamepad.sThumbRX - state->match_axes[2] + 0x1000) <= 0x2fff && \ + (Uint32)(~gamepad.sThumbRY - state->match_axes[3] + 0x1000) <= 0x2fff) /* Explicit #define XInputAxesMatch(gamepad) (\ SDL_abs((Sint8)((gamepad.sThumbLX & 0xF000) >> 8) - ((match_state & 0x000F0000) >> 12)) <= 0x10 && \ @@ -232,9 +245,9 @@ static void RAWINPUT_FillMatchState(WindowsMatchState *state, Uint64 match_state SDL_abs((Sint8)((~gamepad.sThumbRY & 0xF000) >> 8) - ((match_state & 0xF0000000) >> 24)) <= 0x10) */ /* Can only match trigger values if a single trigger has a value. */ -#define XInputTriggersMatch(gamepad) ( \ - ((state->match_axes[4] == SDL_MIN_SINT16) && (state->match_axes[5] == SDL_MIN_SINT16)) || \ - ((gamepad.bLeftTrigger != 0) && (gamepad.bRightTrigger != 0)) || \ +#define XInputTriggersMatch(gamepad) ( \ + ((state->match_axes[4] == SDL_MIN_SINT16) && (state->match_axes[5] == SDL_MIN_SINT16)) || \ + ((gamepad.bLeftTrigger != 0) && (gamepad.bRightTrigger != 0)) || \ ((Uint32)((((int)gamepad.bLeftTrigger * 257) - 32768) - state->match_axes[4]) <= 0x2fff) || \ ((Uint32)((((int)gamepad.bRightTrigger * 257) - 32768) - state->match_axes[5]) <= 0x2fff)) @@ -258,21 +271,22 @@ static void RAWINPUT_FillMatchState(WindowsMatchState *state, Uint64 match_state ((match_state & (1<xinput_buttons) + if (state->xinput_buttons) { state->any_data = SDL_TRUE; + } #endif #ifdef SDL_JOYSTICK_RAWINPUT_WGI /* Match axes by checking if the distance between the high 4 bits of axis and the 4 bits from match_state is 1 or less */ -#define WindowsGamingInputAxesMatch(gamepad) (\ - (Uint16)(((Sint16)(gamepad.LeftThumbstickX * SDL_MAX_SINT16) & 0xF000) - state->match_axes[0] + 0x1000) <= 0x2fff && \ +#define WindowsGamingInputAxesMatch(gamepad) ( \ + (Uint16)(((Sint16)(gamepad.LeftThumbstickX * SDL_MAX_SINT16) & 0xF000) - state->match_axes[0] + 0x1000) <= 0x2fff && \ (Uint16)((~(Sint16)(gamepad.LeftThumbstickY * SDL_MAX_SINT16) & 0xF000) - state->match_axes[1] + 0x1000) <= 0x2fff && \ (Uint16)(((Sint16)(gamepad.RightThumbstickX * SDL_MAX_SINT16) & 0xF000) - state->match_axes[2] + 0x1000) <= 0x2fff && \ (Uint16)((~(Sint16)(gamepad.RightThumbstickY * SDL_MAX_SINT16) & 0xF000) - state->match_axes[3] + 0x1000) <= 0x2fff) -#define WindowsGamingInputTriggersMatch(gamepad) ( \ - ((state->match_axes[4] == SDL_MIN_SINT16) && (state->match_axes[5] == SDL_MIN_SINT16)) || \ - ((gamepad.LeftTrigger == 0.0f) && (gamepad.RightTrigger == 0.0f)) || \ +#define WindowsGamingInputTriggersMatch(gamepad) ( \ + ((state->match_axes[4] == SDL_MIN_SINT16) && (state->match_axes[5] == SDL_MIN_SINT16)) || \ + ((gamepad.LeftTrigger == 0.0f) && (gamepad.RightTrigger == 0.0f)) || \ ((Uint16)((((int)(gamepad.LeftTrigger * SDL_MAX_UINT16)) - 32768) - state->match_axes[4]) <= 0x2fff) || \ ((Uint16)((((int)(gamepad.RightTrigger * SDL_MAX_UINT16)) - 32768) - state->match_axes[5]) <= 0x2fff)) @@ -296,28 +310,28 @@ static void RAWINPUT_FillMatchState(WindowsMatchState *state, Uint64 match_state ((match_state & (1<wgi_buttons) + if (state->wgi_buttons) { state->any_data = SDL_TRUE; + } #endif - } #endif /* SDL_JOYSTICK_RAWINPUT_MATCHING */ #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT -static struct { - XINPUT_STATE_EX state; +static struct +{ + XINPUT_STATE state; XINPUT_BATTERY_INFORMATION_EX battery; SDL_bool connected; /* Currently has an active XInput device */ - SDL_bool used; /* Is currently mapped to an SDL device */ + SDL_bool used; /* Is currently mapped to an SDL device */ Uint8 correlation_id; } xinput_state[XUSER_MAX_COUNT]; static SDL_bool xinput_device_change = SDL_TRUE; static SDL_bool xinput_state_dirty = SDL_TRUE; -static void -RAWINPUT_UpdateXInput() +static void RAWINPUT_UpdateXInput(void) { DWORD user_index; if (xinput_device_change) { @@ -344,23 +358,20 @@ RAWINPUT_UpdateXInput() } } -static void -RAWINPUT_MarkXInputSlotUsed(Uint8 xinput_slot) +static void RAWINPUT_MarkXInputSlotUsed(Uint8 xinput_slot) { if (xinput_slot != XUSER_INDEX_ANY) { xinput_state[xinput_slot].used = SDL_TRUE; } } -static void -RAWINPUT_MarkXInputSlotFree(Uint8 xinput_slot) +static void RAWINPUT_MarkXInputSlotFree(Uint8 xinput_slot) { if (xinput_slot != XUSER_INDEX_ANY) { xinput_state[xinput_slot].used = SDL_FALSE; } } -static SDL_bool -RAWINPUT_MissingXInputSlot() +static SDL_bool RAWINPUT_MissingXInputSlot(void) { int ii; for (ii = 0; ii < SDL_arraysize(xinput_state); ii++) { @@ -371,8 +382,7 @@ RAWINPUT_MissingXInputSlot() return SDL_FALSE; } -static SDL_bool -RAWINPUT_XInputSlotMatches(const WindowsMatchState *state, Uint8 slot_idx) +static SDL_bool RAWINPUT_XInputSlotMatches(const WindowsMatchState *state, Uint8 slot_idx) { if (xinput_state[slot_idx].connected) { WORD xinput_buttons = xinput_state[slot_idx].state.Gamepad.wButtons; @@ -383,20 +393,33 @@ RAWINPUT_XInputSlotMatches(const WindowsMatchState *state, Uint8 slot_idx) #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS && XInputTriggersMatch(xinput_state[slot_idx].state.Gamepad) #endif - ) { + ) { return SDL_TRUE; } } return SDL_FALSE; } - -static SDL_bool -RAWINPUT_GuessXInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, Uint8 *slot_idx) +static SDL_bool RAWINPUT_GuessXInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, Uint8 *slot_idx) { int user_index; int match_count; + /* If there is only one available slot, let's use that + * That will be right most of the time, and uncorrelation will fix any bad guesses + */ + match_count = 0; + for (user_index = 0; user_index < XUSER_MAX_COUNT; ++user_index) { + if (xinput_state[user_index].connected && !xinput_state[user_index].used) { + *slot_idx = user_index; + ++match_count; + } + } + if (match_count == 1) { + *correlation_id = ++xinput_state[*slot_idx].correlation_id; + return SDL_TRUE; + } + *slot_idx = 0; match_count = 0; @@ -421,17 +444,19 @@ RAWINPUT_GuessXInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, #ifdef SDL_JOYSTICK_RAWINPUT_WGI -typedef struct WindowsGamingInputGamepadState { +typedef struct WindowsGamingInputGamepadState +{ __x_ABI_CWindows_CGaming_CInput_CIGamepad *gamepad; struct __x_ABI_CWindows_CGaming_CInput_CGamepadReading state; RAWINPUT_DeviceContext *correlated_context; - SDL_bool used; /* Is currently mapped to an SDL device */ + SDL_bool used; /* Is currently mapped to an SDL device */ SDL_bool connected; /* Just used during update to track disconnected */ Uint8 correlation_id; struct __x_ABI_CWindows_CGaming_CInput_CGamepadVibration vibration; } WindowsGamingInputGamepadState; -static struct { +static struct +{ WindowsGamingInputGamepadState **per_gamepad; int per_gamepad_count; SDL_bool initialized; @@ -439,24 +464,99 @@ static struct { SDL_bool need_device_list_update; int ref_count; __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics *gamepad_statics; + EventRegistrationToken gamepad_added_token; + EventRegistrationToken gamepad_removed_token; } wgi_state; -static void -RAWINPUT_MarkWindowsGamingInputSlotUsed(WindowsGamingInputGamepadState *wgi_slot, RAWINPUT_DeviceContext *ctx) +typedef struct GamepadDelegate +{ + __FIEventHandler_1_Windows__CGaming__CInput__CGamepad iface; + SDL_atomic_t refcount; +} GamepadDelegate; + +static const IID IID_IEventHandler_Gamepad = { 0x8a7639ee, 0x624a, 0x501a, { 0xbb, 0x53, 0x56, 0x2d, 0x1e, 0xc1, 0x1b, 0x52 } }; + +static HRESULT STDMETHODCALLTYPE IEventHandler_CGamepadVtbl_QueryInterface(__FIEventHandler_1_Windows__CGaming__CInput__CGamepad *This, REFIID riid, void **ppvObject) +{ + if (!ppvObject) { + return E_INVALIDARG; + } + + *ppvObject = NULL; + if (WIN_IsEqualIID(riid, &IID_IUnknown) || WIN_IsEqualIID(riid, &IID_IAgileObject) || WIN_IsEqualIID(riid, &IID_IEventHandler_Gamepad)) { + *ppvObject = This; + __FIEventHandler_1_Windows__CGaming__CInput__CGamepad_AddRef(This); + return S_OK; + } else if (WIN_IsEqualIID(riid, &IID_IMarshal)) { + /* This seems complicated. Let's hope it doesn't happen. */ + return E_OUTOFMEMORY; + } else { + return E_NOINTERFACE; + } +} + +static ULONG STDMETHODCALLTYPE IEventHandler_CGamepadVtbl_AddRef(__FIEventHandler_1_Windows__CGaming__CInput__CGamepad *This) +{ + GamepadDelegate *self = (GamepadDelegate *)This; + return SDL_AtomicAdd(&self->refcount, 1) + 1UL; +} + +static ULONG STDMETHODCALLTYPE IEventHandler_CGamepadVtbl_Release(__FIEventHandler_1_Windows__CGaming__CInput__CGamepad *This) +{ + GamepadDelegate *self = (GamepadDelegate *)This; + int rc = SDL_AtomicAdd(&self->refcount, -1) - 1; + /* Should never free the static delegate objects */ + SDL_assert(rc > 0); + return rc; +} + +static HRESULT STDMETHODCALLTYPE IEventHandler_CGamepadVtbl_InvokeAdded(__FIEventHandler_1_Windows__CGaming__CInput__CGamepad *This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIGamepad *e) +{ + wgi_state.need_device_list_update = SDL_TRUE; + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE IEventHandler_CGamepadVtbl_InvokeRemoved(__FIEventHandler_1_Windows__CGaming__CInput__CGamepad *This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIGamepad *e) +{ + wgi_state.need_device_list_update = SDL_TRUE; + return S_OK; +} + +static __FIEventHandler_1_Windows__CGaming__CInput__CGamepadVtbl gamepad_added_vtbl = { + IEventHandler_CGamepadVtbl_QueryInterface, + IEventHandler_CGamepadVtbl_AddRef, + IEventHandler_CGamepadVtbl_Release, + IEventHandler_CGamepadVtbl_InvokeAdded +}; +static GamepadDelegate gamepad_added = { + { &gamepad_added_vtbl }, + { 1 } +}; + +static __FIEventHandler_1_Windows__CGaming__CInput__CGamepadVtbl gamepad_removed_vtbl = { + IEventHandler_CGamepadVtbl_QueryInterface, + IEventHandler_CGamepadVtbl_AddRef, + IEventHandler_CGamepadVtbl_Release, + IEventHandler_CGamepadVtbl_InvokeRemoved +}; +static GamepadDelegate gamepad_removed = { + { &gamepad_removed_vtbl }, + { 1 } +}; + +static void RAWINPUT_MarkWindowsGamingInputSlotUsed(WindowsGamingInputGamepadState *wgi_slot, RAWINPUT_DeviceContext *ctx) { wgi_slot->used = SDL_TRUE; wgi_slot->correlated_context = ctx; } -static void -RAWINPUT_MarkWindowsGamingInputSlotFree(WindowsGamingInputGamepadState *wgi_slot) +static void RAWINPUT_MarkWindowsGamingInputSlotFree(WindowsGamingInputGamepadState *wgi_slot) { wgi_slot->used = SDL_FALSE; wgi_slot->correlated_context = NULL; } -static SDL_bool -RAWINPUT_MissingWindowsGamingInputSlot() +static SDL_bool RAWINPUT_MissingWindowsGamingInputSlot(void) { int ii; for (ii = 0; ii < wgi_state.per_gamepad_count; ii++) { @@ -467,15 +567,16 @@ RAWINPUT_MissingWindowsGamingInputSlot() return SDL_FALSE; } -static void -RAWINPUT_UpdateWindowsGamingInput() +static void RAWINPUT_UpdateWindowsGamingInput(void) { int ii; - if (!wgi_state.gamepad_statics) + if (!wgi_state.gamepad_statics) { return; + } - if (!wgi_state.dirty) + if (!wgi_state.dirty) { return; + } wgi_state.dirty = SDL_FALSE; @@ -501,7 +602,7 @@ RAWINPUT_UpdateWindowsGamingInput() if (SUCCEEDED(hr)) { SDL_bool found = SDL_FALSE; int jj; - for (jj = 0; jj < wgi_state.per_gamepad_count ; jj++) { + for (jj = 0; jj < wgi_state.per_gamepad_count; jj++) { if (wgi_state.per_gamepad[jj]->gamepad == gamepad) { found = SDL_TRUE; wgi_state.per_gamepad[jj]->connected = SDL_TRUE; @@ -558,10 +659,12 @@ RAWINPUT_UpdateWindowsGamingInput() } } } -static void -RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) +static void RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) { - wgi_state.need_device_list_update = SDL_TRUE; + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_WGI, SDL_TRUE)) { + return; + } + wgi_state.ref_count++; if (!wgi_state.initialized) { static const IID SDL_IID_IGamepadStatics = { 0x8BBCE529, 0xD49C, 0x39E9, { 0x95, 0x60, 0xE4, 0x7D, 0xDE, 0x96, 0xB7, 0xC8 } }; @@ -574,8 +677,8 @@ RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) wgi_state.dirty = SDL_TRUE; { - typedef HRESULT (WINAPI *WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER *hstringHeader, HSTRING* string); - typedef HRESULT (WINAPI *RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void** factory); + typedef HRESULT(WINAPI * WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER * hstringHeader, HSTRING * string); + typedef HRESULT(WINAPI * RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void **factory); #ifdef __WINRT__ WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = WindowsCreateStringReference; @@ -593,37 +696,66 @@ RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) if (SUCCEEDED(hr)) { RoGetActivationFactoryFunc(hNamespaceString, &SDL_IID_IGamepadStatics, (void **)&wgi_state.gamepad_statics); } + + if (wgi_state.gamepad_statics) { + wgi_state.need_device_list_update = SDL_TRUE; + + hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadAdded(wgi_state.gamepad_statics, &gamepad_added.iface, &wgi_state.gamepad_added_token); + if (!SUCCEEDED(hr)) { + SDL_SetError("add_GamepadAdded() failed: 0x%lx\n", hr); + } + + hr = __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_add_GamepadRemoved(wgi_state.gamepad_statics, &gamepad_removed.iface, &wgi_state.gamepad_removed_token); + if (!SUCCEEDED(hr)) { + SDL_SetError("add_GamepadRemoved() failed: 0x%lx\n", hr); + } + } } } } } -static SDL_bool -RAWINPUT_WindowsGamingInputSlotMatches(const WindowsMatchState *state, WindowsGamingInputGamepadState *slot, SDL_bool xinput_correlated) +static SDL_bool RAWINPUT_WindowsGamingInputSlotMatches(const WindowsMatchState *state, WindowsGamingInputGamepadState *slot, SDL_bool xinput_correlated) { Uint32 wgi_buttons = slot->state.Buttons; if ((wgi_buttons & 0x3FFF) == state->wgi_buttons #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_AXES - && WindowsGamingInputAxesMatch(slot->state) + && WindowsGamingInputAxesMatch(slot->state) #endif #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS - // Don't try to match WGI triggers if getting values from XInput - && (xinput_correlated || WindowsGamingInputTriggersMatch(slot->state)) + // Don't try to match WGI triggers if getting values from XInput + && (xinput_correlated || WindowsGamingInputTriggersMatch(slot->state)) #endif - ) { + ) { return SDL_TRUE; } return SDL_FALSE; } -static SDL_bool -RAWINPUT_GuessWindowsGamingInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, WindowsGamingInputGamepadState **slot, SDL_bool xinput_correlated) +static SDL_bool RAWINPUT_GuessWindowsGamingInputSlot(const WindowsMatchState *state, Uint8 *correlation_id, WindowsGamingInputGamepadState **slot, SDL_bool xinput_correlated) { int match_count, user_index; + WindowsGamingInputGamepadState *gamepad_state = NULL; + /* If there is only one available slot, let's use that + * That will be right most of the time, and uncorrelation will fix any bad guesses + */ match_count = 0; for (user_index = 0; user_index < wgi_state.per_gamepad_count; ++user_index) { - WindowsGamingInputGamepadState *gamepad_state = wgi_state.per_gamepad[user_index]; + gamepad_state = wgi_state.per_gamepad[user_index]; + if (gamepad_state->connected && !gamepad_state->used) { + *slot = gamepad_state; + ++match_count; + } + } + if (match_count == 1) { + *correlation_id = ++gamepad_state->correlation_id; + return SDL_TRUE; + } + + match_count = 0; + for (user_index = 0; user_index < wgi_state.per_gamepad_count; ++user_index) { + gamepad_state = wgi_state.per_gamepad[user_index]; if (RAWINPUT_WindowsGamingInputSlotMatches(state, gamepad_state, xinput_correlated)) { ++match_count; *slot = gamepad_state; @@ -640,10 +772,8 @@ RAWINPUT_GuessWindowsGamingInputSlot(const WindowsMatchState *state, Uint8 *corr return SDL_FALSE; } -static void -RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) +static void RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) { - wgi_state.need_device_list_update = SDL_TRUE; --wgi_state.ref_count; if (!wgi_state.ref_count && wgi_state.initialized) { int ii; @@ -656,6 +786,8 @@ RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) } wgi_state.per_gamepad_count = 0; if (wgi_state.gamepad_statics) { + __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_remove_GamepadAdded(wgi_state.gamepad_statics, wgi_state.gamepad_added_token); + __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_remove_GamepadRemoved(wgi_state.gamepad_statics, wgi_state.gamepad_removed_token); __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_Release(wgi_state.gamepad_statics); wgi_state.gamepad_statics = NULL; } @@ -666,16 +798,13 @@ RAWINPUT_QuitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) #endif /* SDL_JOYSTICK_RAWINPUT_WGI */ - -static SDL_RAWINPUT_Device * -RAWINPUT_AcquireDevice(SDL_RAWINPUT_Device *device) +static SDL_RAWINPUT_Device *RAWINPUT_AcquireDevice(SDL_RAWINPUT_Device *device) { SDL_AtomicIncRef(&device->refcount); return device; } -static void -RAWINPUT_ReleaseDevice(SDL_RAWINPUT_Device *device) +static void RAWINPUT_ReleaseDevice(SDL_RAWINPUT_Device *device) { #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT if (device->joystick) { @@ -696,22 +825,38 @@ RAWINPUT_ReleaseDevice(SDL_RAWINPUT_Device *device) } } -static SDL_RAWINPUT_Device * -RAWINPUT_DeviceFromHandle(HANDLE hDevice) +static SDL_RAWINPUT_Device *RAWINPUT_DeviceFromHandle(HANDLE hDevice) { SDL_RAWINPUT_Device *curr; for (curr = SDL_RAWINPUT_devices; curr; curr = curr->next) { - if (curr->hDevice == hDevice) + if (curr->hDevice == hDevice) { return curr; + } } return NULL; } -static void -RAWINPUT_AddDevice(HANDLE hDevice) +static int GetSteamVirtualGamepadSlot(Uint16 vendor_id, Uint16 product_id, const char *device_path) { -#define CHECK(expression) { if(!(expression)) goto err; } + int slot = -1; + + // The format for the raw input device path is documented here: + // https://partner.steamgames.com/doc/features/steam_controller/steam_input_gamepad_emulation_bestpractices + if (vendor_id == USB_VENDOR_VALVE && + product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { + (void)SDL_sscanf(device_path, "\\\\.\\pipe\\HID#VID_045E&PID_028E&IG_00#%*X&%*X&%*X#%d#%*u", &slot); + } + return slot; +} + +static void RAWINPUT_AddDevice(HANDLE hDevice) +{ +#define CHECK(expression) \ + { \ + if (!(expression)) \ + goto err; \ + } SDL_RAWINPUT_Device *device = NULL; SDL_RAWINPUT_Device *curr, *last; RID_DEVICE_INFO rdi; @@ -738,22 +883,24 @@ RAWINPUT_AddDevice(HANDLE hDevice) /* Don't take devices handled by HIDAPI */ CHECK(!HIDAPI_IsDevicePresent((Uint16)rdi.hid.dwVendorId, (Uint16)rdi.hid.dwProductId, (Uint16)rdi.hid.dwVersionNumber, "")); #endif - - CHECK(device = (SDL_RAWINPUT_Device *)SDL_calloc(1, sizeof(SDL_RAWINPUT_Device))); + device = (SDL_RAWINPUT_Device *)SDL_calloc(1, sizeof(SDL_RAWINPUT_Device)); + CHECK(device); device->hDevice = hDevice; device->vendor_id = (Uint16)rdi.hid.dwVendorId; device->product_id = (Uint16)rdi.hid.dwProductId; device->version = (Uint16)rdi.hid.dwVersionNumber; device->is_xinput = SDL_TRUE; device->is_xboxone = SDL_IsJoystickXboxOne(device->vendor_id, device->product_id); + device->steam_virtual_gamepad_slot = GetSteamVirtualGamepadSlot(device->vendor_id, device->product_id, dev_name); /* Get HID Top-Level Collection Preparsed Data */ size = 0; CHECK(GetRawInputDeviceInfoA(hDevice, RIDI_PREPARSEDDATA, NULL, &size) != (UINT)-1); - CHECK(device->preparsed_data = (PHIDP_PREPARSED_DATA)SDL_calloc(size, sizeof(BYTE))); + device->preparsed_data = (PHIDP_PREPARSED_DATA)SDL_calloc(size, sizeof(BYTE)); + CHECK(device->preparsed_data); CHECK(GetRawInputDeviceInfoA(hDevice, RIDI_PREPARSEDDATA, device->preparsed_data, &size) != (UINT)-1); - hFile = CreateFileA(dev_name, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); + hFile = CreateFileA(dev_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); CHECK(hFile != INVALID_HANDLE_VALUE); { @@ -761,14 +908,17 @@ RAWINPUT_AddDevice(HANDLE hDevice) char *product_string = NULL; WCHAR string[128]; + string[0] = 0; if (SDL_HidD_GetManufacturerString(hFile, string, sizeof(string))) { manufacturer_string = WIN_StringToUTF8W(string); } + string[0] = 0; if (SDL_HidD_GetProductString(hFile, string, sizeof(string))) { product_string = WIN_StringToUTF8W(string); } device->name = SDL_CreateJoystickName(device->vendor_id, device->product_id, manufacturer_string, product_string); + device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, device->vendor_id, device->product_id, device->version, manufacturer_string, product_string, 'r', 0); if (manufacturer_string) { SDL_free(manufacturer_string); @@ -778,8 +928,6 @@ RAWINPUT_AddDevice(HANDLE hDevice) } } - device->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, device->vendor_id, device->product_id, device->version, device->name, 'r', 0); - device->path = SDL_strdup(dev_name); CloseHandle(hFile); @@ -794,7 +942,6 @@ RAWINPUT_AddDevice(HANDLE hDevice) /* Add it to the list */ RAWINPUT_AcquireDevice(device); for (curr = SDL_RAWINPUT_devices, last = NULL; curr; last = curr, curr = curr->next) { - continue; } if (last) { last->next = device; @@ -824,8 +971,7 @@ RAWINPUT_AddDevice(HANDLE hDevice) #undef CHECK } -static void -RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event) +static void RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event) { SDL_RAWINPUT_Device *curr, *last; for (curr = SDL_RAWINPUT_devices, last = NULL; curr; last = curr, curr = curr->next) { @@ -848,35 +994,18 @@ RAWINPUT_DelDevice(SDL_RAWINPUT_Device *device, SDL_bool send_event) } } -static int -RAWINPUT_JoystickInit(void) +static void RAWINPUT_DetectDevices(void) { UINT device_count = 0; - SDL_assert(!SDL_RAWINPUT_inited); - - if (!WIN_IsWindowsVistaOrGreater()) { - /* According to bug 6400, this doesn't work on Windows XP */ - return -1; - } - - if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_TRUE)) { - return -1; - } - - if (WIN_LoadHIDDLL() < 0) { - return -1; - } - - SDL_RAWINPUT_inited = SDL_TRUE; - if ((GetRawInputDeviceList(NULL, &device_count, sizeof(RAWINPUTDEVICELIST)) != -1) && device_count > 0) { PRAWINPUTDEVICELIST devices = NULL; UINT i; devices = (PRAWINPUTDEVICELIST)SDL_malloc(sizeof(RAWINPUTDEVICELIST) * device_count); if (devices) { - if (GetRawInputDeviceList(devices, &device_count, sizeof(RAWINPUTDEVICELIST)) != -1) { + device_count = GetRawInputDeviceList(devices, &device_count, sizeof(RAWINPUTDEVICELIST)); + if (device_count != (UINT)-1) { for (i = 0; i < device_count; ++i) { RAWINPUT_AddDevice(devices[i].hDevice); } @@ -884,24 +1013,51 @@ RAWINPUT_JoystickInit(void) SDL_free(devices); } } +} + +static void RAWINPUT_RemoveDevices(void) +{ + while (SDL_RAWINPUT_devices) { + RAWINPUT_DelDevice(SDL_RAWINPUT_devices, SDL_FALSE); + } + SDL_assert(SDL_RAWINPUT_numjoysticks == 0); +} + +static int RAWINPUT_JoystickInit(void) +{ + SDL_assert(!SDL_RAWINPUT_inited); + + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_FALSE)) { + return 0; + } + + if (!WIN_IsWindowsVistaOrGreater()) { + /* According to bug 6400, this doesn't work on Windows XP */ + return -1; + } + + if (WIN_LoadHIDDLL() < 0) { + return -1; + } + + SDL_RAWINPUT_inited = SDL_TRUE; + + RAWINPUT_DetectDevices(); return 0; } -static int -RAWINPUT_JoystickGetCount(void) +static int RAWINPUT_JoystickGetCount(void) { return SDL_RAWINPUT_numjoysticks; } -SDL_bool -RAWINPUT_IsEnabled() +SDL_bool RAWINPUT_IsEnabled(void) { - return SDL_RAWINPUT_inited; + return SDL_RAWINPUT_inited && !SDL_RAWINPUT_remote_desktop; } -SDL_bool -RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) +SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name) { SDL_RAWINPUT_Device *device; @@ -909,13 +1065,10 @@ RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, co #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT xinput_device_change = SDL_TRUE; #endif -#ifdef SDL_JOYSTICK_RAWINPUT_WGI - wgi_state.need_device_list_update = SDL_TRUE; -#endif device = SDL_RAWINPUT_devices; while (device) { - if (vendor_id == device->vendor_id && product_id == device->product_id ) { + if (vendor_id == device->vendor_id && product_id == device->product_id) { return SDL_TRUE; } @@ -940,8 +1093,7 @@ RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, co return SDL_FALSE; } -static void -RAWINPUT_PostUpdate(void) +static void RAWINPUT_PostUpdate(void) { #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING SDL_bool unmapped_guide_pressed = SDL_FALSE; @@ -999,14 +1151,32 @@ RAWINPUT_PostUpdate(void) #endif /* SDL_JOYSTICK_RAWINPUT_MATCHING */ } -static void -RAWINPUT_JoystickDetect(void) +static void RAWINPUT_JoystickDetect(void) { + SDL_bool remote_desktop; + + if (!SDL_RAWINPUT_inited) { + return; + } + + remote_desktop = GetSystemMetrics(SM_REMOTESESSION) ? SDL_TRUE : SDL_FALSE; + if (remote_desktop != SDL_RAWINPUT_remote_desktop) { + SDL_RAWINPUT_remote_desktop = remote_desktop; + + WINDOWS_RAWINPUTEnabledChanged(); + + if (remote_desktop) { + RAWINPUT_RemoveDevices(); + WINDOWS_JoystickDetect(); + } else { + WINDOWS_JoystickDetect(); + RAWINPUT_DetectDevices(); + } + } RAWINPUT_PostUpdate(); } -static SDL_RAWINPUT_Device * -RAWINPUT_GetDeviceByIndex(int device_index) +static SDL_RAWINPUT_Device *RAWINPUT_GetDeviceByIndex(int device_index) { SDL_RAWINPUT_Device *device = SDL_RAWINPUT_devices; while (device) { @@ -1019,44 +1189,41 @@ RAWINPUT_GetDeviceByIndex(int device_index) return device; } -static const char * -RAWINPUT_JoystickGetDeviceName(int device_index) +static const char *RAWINPUT_JoystickGetDeviceName(int device_index) { return RAWINPUT_GetDeviceByIndex(device_index)->name; } -static const char * -RAWINPUT_JoystickGetDevicePath(int device_index) +static const char *RAWINPUT_JoystickGetDevicePath(int device_index) { return RAWINPUT_GetDeviceByIndex(device_index)->path; } -static int -RAWINPUT_JoystickGetDevicePlayerIndex(int device_index) +static int RAWINPUT_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) { - return -1; + return RAWINPUT_GetDeviceByIndex(device_index)->steam_virtual_gamepad_slot; } -static void -RAWINPUT_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static int RAWINPUT_JoystickGetDevicePlayerIndex(int device_index) { + return -1; } +static void RAWINPUT_JoystickSetDevicePlayerIndex(int device_index, int player_index) +{ +} -static SDL_JoystickGUID -RAWINPUT_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID RAWINPUT_JoystickGetDeviceGUID(int device_index) { return RAWINPUT_GetDeviceByIndex(device_index)->guid; } -static SDL_JoystickID -RAWINPUT_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID RAWINPUT_JoystickGetDeviceInstanceID(int device_index) { return RAWINPUT_GetDeviceByIndex(device_index)->joystick_id; } -static int SDLCALL -RAWINPUT_SortValueCaps(const void *A, const void *B) +static int SDLCALL RAWINPUT_SortValueCaps(const void *A, const void *B) { HIDP_VALUE_CAPS *capsA = (HIDP_VALUE_CAPS *)A; HIDP_VALUE_CAPS *capsB = (HIDP_VALUE_CAPS *)B; @@ -1065,8 +1232,7 @@ RAWINPUT_SortValueCaps(const void *A, const void *B) return (int)capsA->NotRange.Usage - capsB->NotRange.Usage; } -static int -RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) { SDL_RAWINPUT_Device *device = RAWINPUT_GetDeviceByIndex(device_index); RAWINPUT_DeviceContext *ctx; @@ -1101,6 +1267,9 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->is_xinput = device->is_xinput; ctx->is_xboxone = device->is_xboxone; +#ifdef SDL_JOYSTICK_RAWINPUT_MATCHING + ctx->match_state = 0x0000008800000000ULL; /* Trigger axes at rest */ +#endif ctx->preparsed_data = device->preparsed_data; ctx->max_data_length = SDL_HidP_MaxDataListLength(HidP_Input, ctx->preparsed_data); ctx->data = (HIDP_DATA *)SDL_malloc(ctx->max_data_length * sizeof(*ctx->data)); @@ -1123,6 +1292,7 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) value_caps = SDL_stack_alloc(HIDP_VALUE_CAPS, caps.NumberInputValueCaps); if (SDL_HidP_GetValueCaps(HidP_Input, value_caps, &caps.NumberInputValueCaps, ctx->preparsed_data) != HIDP_STATUS_SUCCESS) { RAWINPUT_JoystickClose(joystick); + SDL_stack_free(button_caps); return SDL_SetError("Couldn't get device value capabilities"); } @@ -1151,6 +1321,8 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->button_indices = (USHORT *)SDL_malloc(joystick->nbuttons * sizeof(*ctx->button_indices)); if (!ctx->button_indices) { RAWINPUT_JoystickClose(joystick); + SDL_stack_free(value_caps); + SDL_stack_free(button_caps); return SDL_OutOfMemory(); } @@ -1175,6 +1347,8 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) joystick->nbuttons += 1; } + SDL_stack_free(button_caps); + for (i = 0; i < caps.NumberInputValueCaps; ++i) { HIDP_VALUE_CAPS *cap = &value_caps[i]; @@ -1204,6 +1378,7 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->axis_indices = (USHORT *)SDL_malloc(joystick->naxes * sizeof(*ctx->axis_indices)); if (!ctx->axis_indices) { RAWINPUT_JoystickClose(joystick); + SDL_stack_free(value_caps); return SDL_OutOfMemory(); } @@ -1237,6 +1412,7 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) ctx->hat_indices = (USHORT *)SDL_malloc(joystick->nhats * sizeof(*ctx->hat_indices)); if (!ctx->hat_indices) { RAWINPUT_JoystickClose(joystick); + SDL_stack_free(value_caps); return SDL_OutOfMemory(); } @@ -1255,33 +1431,22 @@ RAWINPUT_JoystickOpen(SDL_Joystick *joystick, int device_index) } } + SDL_stack_free(value_caps); + joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN; return 0; } -static int -RAWINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int RAWINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { #if defined(SDL_JOYSTICK_RAWINPUT_WGI) || defined(SDL_JOYSTICK_RAWINPUT_XINPUT) RAWINPUT_DeviceContext *ctx = joystick->hwdata; #endif SDL_bool rumbled = SDL_FALSE; -#ifdef SDL_JOYSTICK_RAWINPUT_WGI - if (!rumbled && ctx->wgi_correlated) { - WindowsGamingInputGamepadState *gamepad_state = ctx->wgi_slot; - HRESULT hr; - gamepad_state->vibration.LeftMotor = (DOUBLE)low_frequency_rumble / SDL_MAX_UINT16; - gamepad_state->vibration.RightMotor = (DOUBLE)high_frequency_rumble / SDL_MAX_UINT16; - hr = __x_ABI_CWindows_CGaming_CInput_CIGamepad_put_Vibration(gamepad_state->gamepad, gamepad_state->vibration); - if (SUCCEEDED(hr)) { - rumbled = SDL_TRUE; - } - } -#endif - #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT + /* Prefer XInput over WGI because it allows rumble in the background */ if (!rumbled && ctx->xinput_correlated) { XINPUT_VIBRATION XVibration; @@ -1299,6 +1464,19 @@ RAWINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uin } #endif /* SDL_JOYSTICK_RAWINPUT_XINPUT */ +#ifdef SDL_JOYSTICK_RAWINPUT_WGI + if (!rumbled && ctx->wgi_correlated) { + WindowsGamingInputGamepadState *gamepad_state = ctx->wgi_slot; + HRESULT hr; + gamepad_state->vibration.LeftMotor = (DOUBLE)low_frequency_rumble / SDL_MAX_UINT16; + gamepad_state->vibration.RightMotor = (DOUBLE)high_frequency_rumble / SDL_MAX_UINT16; + hr = __x_ABI_CWindows_CGaming_CInput_CIGamepad_put_Vibration(gamepad_state->gamepad, gamepad_state->vibration); + if (SUCCEEDED(hr)) { + rumbled = SDL_TRUE; + } + } +#endif + if (!rumbled) { #if defined(SDL_JOYSTICK_RAWINPUT_WGI) || defined(SDL_JOYSTICK_RAWINPUT_XINPUT) return SDL_SetError("Controller isn't correlated yet, try hitting a button first"); @@ -1309,8 +1487,7 @@ RAWINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uin return 0; } -static int -RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { #if defined(SDL_JOYSTICK_RAWINPUT_WGI) RAWINPUT_DeviceContext *ctx = joystick->hwdata; @@ -1333,8 +1510,7 @@ RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint #endif } -static Uint32 -RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) { Uint32 result = 0; #if defined(SDL_JOYSTICK_RAWINPUT_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT_WGI) @@ -1359,20 +1535,17 @@ RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) return result; } -static int -RAWINPUT_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int RAWINPUT_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -RAWINPUT_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int RAWINPUT_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -RAWINPUT_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int RAWINPUT_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } @@ -1401,8 +1574,7 @@ static HIDP_DATA *GetData(USHORT index, HIDP_DATA *data, ULONG length) We use XInput and Windows.Gaming.Input to make up for these shortcomings. */ -static void -RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) +static void RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) { RAWINPUT_DeviceContext *ctx = joystick->hwdata; #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING @@ -1430,14 +1602,26 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) (1 << SDL_CONTROLLER_BUTTON_DPAD_DOWN) | (1 << SDL_CONTROLLER_BUTTON_DPAD_LEFT), (1 << SDL_CONTROLLER_BUTTON_DPAD_LEFT), (1 << SDL_CONTROLLER_BUTTON_DPAD_UP) | (1 << SDL_CONTROLLER_BUTTON_DPAD_LEFT), + 0, }; Uint64 match_state = ctx->match_state; /* Update match_state with button bit, then fall through */ -#define SDL_PrivateJoystickButton(joystick, button, state) if (button < SDL_arraysize(button_map)) { Uint64 button_bit = 1ull << button_map[button]; match_state = (match_state & ~button_bit) | (button_bit * (state)); } SDL_PrivateJoystickButton(joystick, button, state) +#define SDL_PrivateJoystickButton(joystick, button, state) \ + if (button < SDL_arraysize(button_map)) { \ + Uint64 button_bit = 1ull << button_map[button]; \ + match_state = (match_state & ~button_bit) | (button_bit * (state)); \ + } \ + SDL_PrivateJoystickButton(joystick, button, state) #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_AXES /* Grab high 4 bits of value, then fall through */ -#define AddAxisToMatchState(axis, value) { match_state = (match_state & ~(0xFull << (4 * axis + 16))) | ((value) & 0xF000ull) << (4 * axis + 4); } -#define SDL_PrivateJoystickAxis(joystick, axis, value) if (axis < 4) AddAxisToMatchState(axis, value); SDL_PrivateJoystickAxis(joystick, axis, value) +#define AddAxisToMatchState(axis, value) \ + { \ + match_state = (match_state & ~(0xFull << (4 * axis + 16))) | ((value)&0xF000ull) << (4 * axis + 4); \ + } +#define SDL_PrivateJoystickAxis(joystick, axis, value) \ + if (axis < 4) \ + AddAxisToMatchState(axis, value); \ + SDL_PrivateJoystickAxis(joystick, axis, value) #endif #endif /* SDL_JOYSTICK_RAWINPUT_MATCHING */ @@ -1473,6 +1657,7 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) for (i = 0; i < nhats; ++i) { HIDP_DATA *item = GetData(ctx->hat_indices[i], ctx->data, data_length); if (item) { + Uint8 hat = SDL_HAT_CENTERED; const Uint8 hat_states[] = { SDL_HAT_CENTERED, SDL_HAT_UP, @@ -1483,6 +1668,7 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) SDL_HAT_DOWN | SDL_HAT_LEFT, SDL_HAT_LEFT, SDL_HAT_UP | SDL_HAT_LEFT, + SDL_HAT_CENTERED, }; ULONG state = item->RawValue; @@ -1490,8 +1676,9 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING match_state = (match_state & ~HAT_MASK) | hat_map[state]; #endif - SDL_PrivateJoystickHat(joystick, i, hat_states[state]); + hat = hat_states[state]; } + SDL_PrivateJoystickHat(joystick, i, hat); } } @@ -1503,7 +1690,11 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) #endif #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS -#define AddTriggerToMatchState(axis, value) { int match_axis = axis + SDL_JOYSTICK_RAWINPUT_MATCH_COUNT - joystick->naxes; AddAxisToMatchState(match_axis, value); } +#define AddTriggerToMatchState(axis, value) \ + { \ + int match_axis = axis + SDL_JOYSTICK_RAWINPUT_MATCH_COUNT - joystick->naxes; \ + AddAxisToMatchState(match_axis, value); \ + } #endif /* SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS */ if (ctx->trigger_hack) { @@ -1533,7 +1724,7 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) Sint16 value = (int)(Uint16)item->RawValue - 0x8000; Sint16 left_value = (value > 0) ? (value * 2 - 32767) : SDL_MIN_SINT16; Sint16 right_value = (value < 0) ? (-value * 2 - 32769) : SDL_MIN_SINT16; - + #ifdef SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS AddTriggerToMatchState(left_trigger, left_value); AddTriggerToMatchState(right_trigger, right_value); @@ -1562,8 +1753,7 @@ RAWINPUT_HandleStatePacket(SDL_Joystick *joystick, Uint8 *data, int size) #endif } -static void -RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) +static void RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) { #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING RAWINPUT_DeviceContext *ctx = joystick->hwdata; @@ -1580,11 +1770,11 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) RAWINPUT_FillMatchState(&match_state_xinput, ctx->match_state); #ifdef SDL_JOYSTICK_RAWINPUT_WGI - #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT +#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT xinput_correlated = ctx->xinput_correlated; - #else +#else xinput_correlated = SDL_FALSE; - #endif +#endif /* Parallel logic to WINDOWS_XINPUT below */ RAWINPUT_UpdateWindowsGamingInput(); if (ctx->wgi_correlated && @@ -1618,7 +1808,7 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) if (!ctx->wgi_correlated) { SDL_bool new_correlation_count = 0; if (RAWINPUT_MissingWindowsGamingInputSlot()) { - Uint8 correlation_id; + Uint8 correlation_id = 0; WindowsGamingInputGamepadState *slot_idx = NULL; if (RAWINPUT_GuessWindowsGamingInputSlot(&match_state_xinput, &correlation_id, &slot_idx, xinput_correlated)) { /* we match exactly one WindowsGamingInput device */ @@ -1638,10 +1828,12 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) correlated = SDL_TRUE; RAWINPUT_MarkWindowsGamingInputSlotUsed(ctx->wgi_slot, ctx); /* If the generalized Guide button was using us, it doesn't need to anymore */ - if (guide_button_candidate.joystick == joystick) + if (guide_button_candidate.joystick == joystick) { guide_button_candidate.joystick = NULL; - if (guide_button_candidate.last_joystick == joystick) + } + if (guide_button_candidate.last_joystick == joystick) { guide_button_candidate.last_joystick = NULL; + } } } else { /* someone else also possibly correlated to this device, start over */ @@ -1732,10 +1924,12 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) correlated = SDL_TRUE; RAWINPUT_MarkXInputSlotUsed(ctx->xinput_slot); /* If the generalized Guide button was using us, it doesn't need to anymore */ - if (guide_button_candidate.joystick == joystick) + if (guide_button_candidate.joystick == joystick) { guide_button_candidate.joystick = NULL; - if (guide_button_candidate.last_joystick == joystick) + } + if (guide_button_candidate.last_joystick == joystick) { guide_button_candidate.last_joystick = NULL; + } } } else { /* someone else also possibly correlated to this device, start over */ @@ -1806,7 +2000,7 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) #ifdef SDL_JOYSTICK_RAWINPUT_WGI if (!has_trigger_data && ctx->wgi_correlated) { RAWINPUT_UpdateWindowsGamingInput(); /* May detect disconnect / cause uncorrelation */ - if (ctx->wgi_correlated) { /* Still connected */ + if (ctx->wgi_correlated) { /* Still connected */ struct __x_ABI_CWindows_CGaming_CInput_CGamepadReading *state = &ctx->wgi_slot->state; if (ctx->guide_hack) { @@ -1823,11 +2017,8 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) if (!correlated) { if (!guide_button_candidate.joystick || - (ctx->last_state_packet && ( - !guide_button_candidate.last_state_packet || - SDL_TICKS_PASSED(ctx->last_state_packet, guide_button_candidate.last_state_packet) - )) - ) { + (ctx->last_state_packet && (!guide_button_candidate.last_state_packet || + SDL_TICKS_PASSED(ctx->last_state_packet, guide_button_candidate.last_state_packet)))) { guide_button_candidate.joystick = joystick; guide_button_candidate.last_state_packet = ctx->last_state_packet; } @@ -1835,22 +2026,22 @@ RAWINPUT_UpdateOtherAPIs(SDL_Joystick *joystick) #endif /* SDL_JOYSTICK_RAWINPUT_MATCHING */ } -static void -RAWINPUT_JoystickUpdate(SDL_Joystick *joystick) +static void RAWINPUT_JoystickUpdate(SDL_Joystick *joystick) { RAWINPUT_UpdateOtherAPIs(joystick); } -static void -RAWINPUT_JoystickClose(SDL_Joystick *joystick) +static void RAWINPUT_JoystickClose(SDL_Joystick *joystick) { RAWINPUT_DeviceContext *ctx = joystick->hwdata; #ifdef SDL_JOYSTICK_RAWINPUT_MATCHING - if (guide_button_candidate.joystick == joystick) + if (guide_button_candidate.joystick == joystick) { guide_button_candidate.joystick = NULL; - if (guide_button_candidate.last_joystick == joystick) + } + if (guide_button_candidate.last_joystick == joystick) { guide_button_candidate.last_joystick = NULL; + } #endif if (ctx) { @@ -1885,11 +2076,14 @@ RAWINPUT_JoystickClose(SDL_Joystick *joystick) } } -SDL_bool -RAWINPUT_RegisterNotifications(HWND hWnd) +int RAWINPUT_RegisterNotifications(HWND hWnd) { - RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; int i; + RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; + + if (!SDL_RAWINPUT_inited) { + return 0; + } for (i = 0; i < SDL_arraysize(subscribed_devices); i++) { rid[i].usUsagePage = USB_USAGEPAGE_GENERIC_DESKTOP; @@ -1899,18 +2093,20 @@ RAWINPUT_RegisterNotifications(HWND hWnd) } if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) { - SDL_SetError("Couldn't register for raw input events"); - return SDL_FALSE; + return SDL_SetError("Couldn't register for raw input events"); } - return SDL_TRUE; + return 0; } -void -RAWINPUT_UnregisterNotifications() +int RAWINPUT_UnregisterNotifications(void) { int i; RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; + if (!SDL_RAWINPUT_inited) { + return 0; + } + for (i = 0; i < SDL_arraysize(subscribed_devices); i++) { rid[i].usUsagePage = USB_USAGEPAGE_GENERIC_DESKTOP; rid[i].usUsage = subscribed_devices[i]; @@ -1919,9 +2115,9 @@ RAWINPUT_UnregisterNotifications() } if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) { - SDL_SetError("Couldn't unregister for raw input events"); - return; + return SDL_SetError("Couldn't unregister for raw input events"); } + return 0; } LRESULT CALLBACK @@ -1933,45 +2129,45 @@ RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) SDL_LockJoysticks(); switch (msg) { - case WM_INPUT_DEVICE_CHANGE: + case WM_INPUT_DEVICE_CHANGE: + { + HANDLE hDevice = (HANDLE)lParam; + switch (wParam) { + case GIDC_ARRIVAL: + RAWINPUT_AddDevice(hDevice); + break; + case GIDC_REMOVAL: { - HANDLE hDevice = (HANDLE)lParam; - switch (wParam) { - case GIDC_ARRIVAL: - RAWINPUT_AddDevice(hDevice); - break; - case GIDC_REMOVAL: - { - SDL_RAWINPUT_Device *device; - device = RAWINPUT_DeviceFromHandle(hDevice); - if (device) { - RAWINPUT_DelDevice(device, SDL_TRUE); - } - break; - } - default: - break; + SDL_RAWINPUT_Device *device; + device = RAWINPUT_DeviceFromHandle(hDevice); + if (device) { + RAWINPUT_DelDevice(device, SDL_TRUE); } + break; + } + default: + break; } + } result = 0; break; - case WM_INPUT: - { - Uint8 data[sizeof(RAWINPUTHEADER) + sizeof(RAWHID) + USB_PACKET_LENGTH]; - UINT buffer_size = SDL_arraysize(data); - - if ((int)GetRawInputData((HRAWINPUT)lParam, RID_INPUT, data, &buffer_size, sizeof(RAWINPUTHEADER)) > 0) { - PRAWINPUT raw_input = (PRAWINPUT)data; - SDL_RAWINPUT_Device *device = RAWINPUT_DeviceFromHandle(raw_input->header.hDevice); - if (device) { - SDL_Joystick *joystick = device->joystick; - if (joystick) { - RAWINPUT_HandleStatePacket(joystick, raw_input->data.hid.bRawData, raw_input->data.hid.dwSizeHid); - } + case WM_INPUT: + { + Uint8 data[sizeof(RAWINPUTHEADER) + sizeof(RAWHID) + USB_PACKET_LENGTH]; + UINT buffer_size = SDL_arraysize(data); + + if ((int)GetRawInputData((HRAWINPUT)lParam, RID_INPUT, data, &buffer_size, sizeof(RAWINPUTHEADER)) > 0) { + PRAWINPUT raw_input = (PRAWINPUT)data; + SDL_RAWINPUT_Device *device = RAWINPUT_DeviceFromHandle(raw_input->header.hDevice); + if (device) { + SDL_Joystick *joystick = device->joystick; + if (joystick) { + RAWINPUT_HandleStatePacket(joystick, raw_input->data.hid.bRawData, raw_input->data.hid.dwSizeHid); } } } + } result = 0; break; } @@ -1985,37 +2181,31 @@ RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) return CallWindowProc(DefWindowProc, hWnd, msg, wParam, lParam); } -static void -RAWINPUT_JoystickQuit(void) +static void RAWINPUT_JoystickQuit(void) { if (!SDL_RAWINPUT_inited) { return; } - while (SDL_RAWINPUT_devices) { - RAWINPUT_DelDevice(SDL_RAWINPUT_devices, SDL_FALSE); - } + RAWINPUT_RemoveDevices(); WIN_UnloadHIDDLL(); - SDL_RAWINPUT_numjoysticks = 0; - SDL_RAWINPUT_inited = SDL_FALSE; } -static SDL_bool -RAWINPUT_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool RAWINPUT_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_RAWINPUT_JoystickDriver = -{ +SDL_JoystickDriver SDL_RAWINPUT_JoystickDriver = { RAWINPUT_JoystickInit, RAWINPUT_JoystickGetCount, RAWINPUT_JoystickDetect, RAWINPUT_JoystickGetDeviceName, RAWINPUT_JoystickGetDevicePath, + RAWINPUT_JoystickGetDeviceSteamVirtualGamepadSlot, RAWINPUT_JoystickGetDevicePlayerIndex, RAWINPUT_JoystickSetDevicePlayerIndex, RAWINPUT_JoystickGetDeviceGUID, diff --git a/src/joystick/windows/SDL_rawinputjoystick_c.h b/src/joystick/windows/SDL_rawinputjoystick_c.h index a5d8143e08cd8..75bd5ff5e6ae5 100644 --- a/src/joystick/windows/SDL_rawinputjoystick_c.h +++ b/src/joystick/windows/SDL_rawinputjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,11 +28,10 @@ extern SDL_bool RAWINPUT_IsEnabled(); extern SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name); /* Registers for input events */ -extern SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd); -extern void RAWINPUT_UnregisterNotifications(); +extern int RAWINPUT_RegisterNotifications(HWND hWnd); +extern int RAWINPUT_UnregisterNotifications(); /* Returns 0 if message was handled */ extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index 3a89d1154a260..9299ac528a35e 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,12 +37,11 @@ #include #include - #ifdef ____FIReference_1_INT32_INTERFACE_DEFINED__ /* MinGW-64 uses __FIReference_1_INT32 instead of Microsoft's __FIReference_1_int */ -#define __FIReference_1_int __FIReference_1_INT32 +#define __FIReference_1_int __FIReference_1_INT32 #define __FIReference_1_int_get_Value __FIReference_1_INT32_get_Value -#define __FIReference_1_int_Release __FIReference_1_INT32_Release +#define __FIReference_1_int_Release __FIReference_1_INT32_Release #endif struct joystick_hwdata @@ -55,7 +54,8 @@ struct joystick_hwdata UINT64 timestamp; }; -typedef struct WindowsGamingInputControllerState { +typedef struct WindowsGamingInputControllerState +{ SDL_JoystickID instance_id; __x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller; char *name; @@ -64,9 +64,11 @@ typedef struct WindowsGamingInputControllerState { int naxes; int nhats; int nbuttons; + int steam_virtual_gamepad_slot; } WindowsGamingInputControllerState; -static struct { +static struct +{ __x_ABI_CWindows_CGaming_CInput_CIRawGameControllerStatics *statics; __x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics *arcade_stick_statics; __x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics2 *arcade_stick_statics2; @@ -100,13 +102,17 @@ static const IID IID_IRacingWheelStatics = { 0x3AC12CD5, 0x581B, 0x4936, { 0x9F, static const IID IID_IRacingWheelStatics2 = { 0xE666BCAA, 0xEDFD, 0x4323, { 0xA9, 0xF6, 0x3C, 0x38, 0x40, 0x48, 0xD1, 0xED } }; /*static const IID IID_IRacingWheel = { 0xF546656F, 0xE106, 0x4C82, { 0xA9, 0x0F, 0x55, 0x40, 0x12, 0x90, 0x4B, 0x85 } };*/ +typedef HRESULT(WINAPI *WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER *hstringHeader, HSTRING *string); +typedef HRESULT(WINAPI *RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void **factory); + + extern SDL_bool SDL_XINPUT_Enabled(void); extern SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version); -static SDL_bool -SDL_IsXInputDevice(Uint16 vendor, Uint16 product) + +static SDL_bool SDL_IsXInputDevice(Uint16 vendor, Uint16 product, const char* name) { -#ifdef SDL_JOYSTICK_XINPUT +#if defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT) PRAWINPUTDEVICELIST raw_devices = NULL; UINT i, raw_device_count = 0; LONG vidpid = MAKELONG(vendor, product); @@ -116,25 +122,33 @@ SDL_IsXInputDevice(Uint16 vendor, Uint16 product) #ifdef SDL_JOYSTICK_RAWINPUT && !RAWINPUT_IsEnabled() #endif - ) { + ) { return SDL_FALSE; } + /* Sometimes we'll get a Windows.Gaming.Input callback before the raw input device is even in the list, + * so try to do some checks up front to catch these cases. */ + if (SDL_IsJoystickXboxOne(vendor, product) || + (name && SDL_strncmp(name, "Xbox ", 5) == 0)) { + return SDL_TRUE; + } + /* Go through RAWINPUT (WinXP and later) to find HID devices. */ if ((GetRawInputDeviceList(NULL, &raw_device_count, sizeof(RAWINPUTDEVICELIST)) == -1) || (!raw_device_count)) { - return SDL_FALSE; /* oh well. */ + return SDL_FALSE; /* oh well. */ } raw_devices = (PRAWINPUTDEVICELIST)SDL_malloc(sizeof(RAWINPUTDEVICELIST) * raw_device_count); - if (raw_devices == NULL) { + if (!raw_devices) { SDL_OutOfMemory(); return SDL_FALSE; } - if (GetRawInputDeviceList(raw_devices, &raw_device_count, sizeof(RAWINPUTDEVICELIST)) == -1) { + raw_device_count = GetRawInputDeviceList(raw_devices, &raw_device_count, sizeof(RAWINPUTDEVICELIST)); + if (raw_device_count == (UINT)-1) { SDL_free(raw_devices); raw_devices = NULL; - return SDL_FALSE; /* oh well. */ + return SDL_FALSE; /* oh well. */ } for (i = 0; i < raw_device_count; i++) { @@ -189,7 +203,7 @@ SDL_IsXInputDevice(Uint16 vendor, Uint16 product) continue; } - SDL_snprintf(devVidPidString, sizeof(devVidPidString), "VID_%04X&PID_%04X", vendor, product); + (void)SDL_snprintf(devVidPidString, sizeof(devVidPidString), "VID_%04X&PID_%04X", vendor, product); while (CM_Get_Parent(&devNode, devNode, 0) == CR_SUCCESS) { char deviceId[MAX_DEVICE_ID_LEN]; @@ -204,17 +218,148 @@ SDL_IsXInputDevice(Uint16 vendor, Uint16 product) } SDL_free(raw_devices); -#endif /* SDL_JOYSTICK_XINPUT */ +#endif /* SDL_JOYSTICK_XINPUT || SDL_JOYSTICK_RAWINPUT */ return SDL_FALSE; } -typedef struct RawGameControllerDelegate { +static void WGI_LoadRawGameControllerStatics(void) +{ + WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = NULL; + RoGetActivationFactory_t RoGetActivationFactoryFunc = NULL; + HRESULT hr; + +#ifdef __WINRT__ + WindowsCreateStringReferenceFunc = WindowsCreateStringReference; + RoGetActivationFactoryFunc = RoGetActivationFactory; +#else + { + WindowsCreateStringReferenceFunc = (WindowsCreateStringReference_t)WIN_LoadComBaseFunction("WindowsCreateStringReference"); + RoGetActivationFactoryFunc = (RoGetActivationFactory_t)WIN_LoadComBaseFunction("RoGetActivationFactory"); + } +#endif /* __WINRT__ */ + if (WindowsCreateStringReferenceFunc && RoGetActivationFactoryFunc) { + PCWSTR pNamespace; + HSTRING_HEADER hNamespaceStringHeader; + HSTRING hNamespaceString; + + pNamespace = L"Windows.Gaming.Input.RawGameController"; + hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); + if (SUCCEEDED(hr)) { + hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IRawGameControllerStatics, (void **)&wgi.statics); + if (!SUCCEEDED(hr)) { + SDL_SetError("Couldn't find IRawGameControllerStatics: 0x%lx", hr); + } + } + } +} + +static void WGI_LoadOtherControllerStatics(void) +{ + WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = NULL; + RoGetActivationFactory_t RoGetActivationFactoryFunc = NULL; + HRESULT hr; + +#ifdef __WINRT__ + WindowsCreateStringReferenceFunc = WindowsCreateStringReference; + RoGetActivationFactoryFunc = RoGetActivationFactory; +#else + { + WindowsCreateStringReferenceFunc = (WindowsCreateStringReference_t)WIN_LoadComBaseFunction("WindowsCreateStringReference"); + RoGetActivationFactoryFunc = (RoGetActivationFactory_t)WIN_LoadComBaseFunction("RoGetActivationFactory"); + } +#endif /* __WINRT__ */ + if (WindowsCreateStringReferenceFunc && RoGetActivationFactoryFunc) { + PCWSTR pNamespace; + HSTRING_HEADER hNamespaceStringHeader; + HSTRING hNamespaceString; + + pNamespace = L"Windows.Gaming.Input.ArcadeStick"; + hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); + if (SUCCEEDED(hr)) { + hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IArcadeStickStatics, (void **)&wgi.arcade_stick_statics); + if (SUCCEEDED(hr)) { + __x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics_QueryInterface(wgi.arcade_stick_statics, &IID_IArcadeStickStatics2, (void **)&wgi.arcade_stick_statics2); + } else { + SDL_SetError("Couldn't find IID_IArcadeStickStatics: 0x%lx", hr); + } + } + + pNamespace = L"Windows.Gaming.Input.FlightStick"; + hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); + if (SUCCEEDED(hr)) { + hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IFlightStickStatics, (void **)&wgi.flight_stick_statics); + if (!SUCCEEDED(hr)) { + SDL_SetError("Couldn't find IID_IFlightStickStatics: 0x%lx", hr); + } + } + + pNamespace = L"Windows.Gaming.Input.Gamepad"; + hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); + if (SUCCEEDED(hr)) { + hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IGamepadStatics, (void **)&wgi.gamepad_statics); + if (SUCCEEDED(hr)) { + __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_QueryInterface(wgi.gamepad_statics, &IID_IGamepadStatics2, (void **)&wgi.gamepad_statics2); + } else { + SDL_SetError("Couldn't find IGamepadStatics: 0x%lx", hr); + } + } + + pNamespace = L"Windows.Gaming.Input.RacingWheel"; + hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); + if (SUCCEEDED(hr)) { + hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IRacingWheelStatics, (void **)&wgi.racing_wheel_statics); + if (SUCCEEDED(hr)) { + __x_ABI_CWindows_CGaming_CInput_CIRacingWheelStatics_QueryInterface(wgi.racing_wheel_statics, &IID_IRacingWheelStatics2, (void **)&wgi.racing_wheel_statics2); + } else { + SDL_SetError("Couldn't find IRacingWheelStatics: 0x%lx", hr); + } + } + } +} + +static SDL_JoystickType GetGameControllerType(__x_ABI_CWindows_CGaming_CInput_CIGameController *gamecontroller) +{ + __x_ABI_CWindows_CGaming_CInput_CIArcadeStick *arcade_stick = NULL; + __x_ABI_CWindows_CGaming_CInput_CIFlightStick *flight_stick = NULL; + __x_ABI_CWindows_CGaming_CInput_CIGamepad *gamepad = NULL; + __x_ABI_CWindows_CGaming_CInput_CIRacingWheel *racing_wheel = NULL; + + /* Wait to initialize these interfaces until we need them. + * Initializing the gamepad interface will switch Bluetooth PS4 controllers into enhanced mode, breaking DirectInput + */ + WGI_LoadOtherControllerStatics(); + + if (wgi.gamepad_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2_FromGameController(wgi.gamepad_statics2, gamecontroller, &gamepad)) && gamepad) { + __x_ABI_CWindows_CGaming_CInput_CIGamepad_Release(gamepad); + return SDL_JOYSTICK_TYPE_GAMECONTROLLER; + } + + if (wgi.arcade_stick_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics2_FromGameController(wgi.arcade_stick_statics2, gamecontroller, &arcade_stick)) && arcade_stick) { + __x_ABI_CWindows_CGaming_CInput_CIArcadeStick_Release(arcade_stick); + return SDL_JOYSTICK_TYPE_ARCADE_STICK; + } + + if (wgi.flight_stick_statics && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIFlightStickStatics_FromGameController(wgi.flight_stick_statics, gamecontroller, &flight_stick)) && flight_stick) { + __x_ABI_CWindows_CGaming_CInput_CIFlightStick_Release(flight_stick); + return SDL_JOYSTICK_TYPE_FLIGHT_STICK; + } + + if (wgi.racing_wheel_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIRacingWheelStatics2_FromGameController(wgi.racing_wheel_statics2, gamecontroller, &racing_wheel)) && racing_wheel) { + __x_ABI_CWindows_CGaming_CInput_CIRacingWheel_Release(racing_wheel); + return SDL_JOYSTICK_TYPE_WHEEL; + } + + return SDL_JOYSTICK_TYPE_UNKNOWN; +} + +typedef struct RawGameControllerDelegate +{ __FIEventHandler_1_Windows__CGaming__CInput__CRawGameController iface; SDL_atomic_t refcount; } RawGameControllerDelegate; -static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInterface(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This, REFIID riid, void **ppvObject) +static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInterface(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This, REFIID riid, void **ppvObject) { if (!ppvObject) { return E_INVALIDARG; @@ -223,7 +368,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInter *ppvObject = NULL; if (WIN_IsEqualIID(riid, &IID_IUnknown) || WIN_IsEqualIID(riid, &IID_IAgileObject) || WIN_IsEqualIID(riid, &IID_IEventHandler_RawGameController)) { *ppvObject = This; - __x_ABI_CWindows_CGaming_CInput_CIRawGameControllerStatics_AddRef(This); + __FIEventHandler_1_Windows__CGaming__CInput__CRawGameController_AddRef(This); return S_OK; } else if (WIN_IsEqualIID(riid, &IID_IMarshal)) { /* This seems complicated. Let's hope it doesn't happen. */ @@ -233,13 +378,13 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_QueryInter } } -static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_AddRef(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This) +static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_AddRef(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This) { RawGameControllerDelegate *self = (RawGameControllerDelegate *)This; - return SDL_AtomicAdd(&self->refcount, 1) + 1; + return SDL_AtomicAdd(&self->refcount, 1) + 1UL; } -static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_Release(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This) +static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_Release(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This) { RawGameControllerDelegate *self = (RawGameControllerDelegate *)This; int rc = SDL_AtomicAdd(&self->refcount, -1) - 1; @@ -248,7 +393,51 @@ static ULONG STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_Release(__FI return rc; } -static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdded(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIRawGameController *e) +static int GetSteamVirtualGamepadSlot(__x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller, Uint16 vendor_id, Uint16 product_id) +{ + int slot = -1; + + if (vendor_id == USB_VENDOR_VALVE && + product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { + __x_ABI_CWindows_CGaming_CInput_CIRawGameController2 *controller2 = NULL; + HRESULT hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(controller, &IID_IRawGameController2, (void **)&controller2); + if (SUCCEEDED(hr)) { + HSTRING hString; + hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController2_get_NonRoamableId(controller2, &hString); + if (SUCCEEDED(hr)) { + typedef PCWSTR(WINAPI * WindowsGetStringRawBuffer_t)(HSTRING string, UINT32 * length); + typedef HRESULT(WINAPI * WindowsDeleteString_t)(HSTRING string); + + WindowsGetStringRawBuffer_t WindowsGetStringRawBufferFunc = NULL; + WindowsDeleteString_t WindowsDeleteStringFunc = NULL; +#ifdef __WINRT__ + WindowsGetStringRawBufferFunc = WindowsGetStringRawBuffer; + WindowsDeleteStringFunc = WindowsDeleteString; +#else + { + WindowsGetStringRawBufferFunc = (WindowsGetStringRawBuffer_t)WIN_LoadComBaseFunction("WindowsGetStringRawBuffer"); + WindowsDeleteStringFunc = (WindowsDeleteString_t)WIN_LoadComBaseFunction("WindowsDeleteString"); + } +#endif /* __WINRT__ */ + if (WindowsGetStringRawBufferFunc && WindowsDeleteStringFunc) { + PCWSTR string = WindowsGetStringRawBufferFunc(hString, NULL); + if (string) { + char *id = WIN_StringToUTF8W(string); + if (id) { + (void)SDL_sscanf(id, "{wgi/nrid/:steam-%*X&%*X&%*X#%d#%*u}", &slot); + SDL_free(id); + } + } + WindowsDeleteStringFunc(hString); + } + } + __x_ABI_CWindows_CGaming_CInput_CIRawGameController2_Release(controller2); + } + } + return slot; +} + +static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdded(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIRawGameController *e) { HRESULT hr; __x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller = NULL; @@ -279,8 +468,8 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(controller, &IID_IRawGameController2, (void **)&controller2); if (SUCCEEDED(hr)) { - typedef PCWSTR (WINAPI *WindowsGetStringRawBuffer_t)(HSTRING string, UINT32 *length); - typedef HRESULT (WINAPI *WindowsDeleteString_t)(HSTRING string); + typedef PCWSTR(WINAPI * WindowsGetStringRawBuffer_t)(HSTRING string, UINT32 * length); + typedef HRESULT(WINAPI * WindowsDeleteString_t)(HSTRING string); WindowsGetStringRawBuffer_t WindowsGetStringRawBufferFunc = NULL; WindowsDeleteString_t WindowsDeleteStringFunc = NULL; @@ -310,38 +499,6 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde name = SDL_strdup(""); } - hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(controller, &IID_IGameController, (void **)&gamecontroller); - if (SUCCEEDED(hr)) { - __x_ABI_CWindows_CGaming_CInput_CIArcadeStick *arcade_stick = NULL; - __x_ABI_CWindows_CGaming_CInput_CIFlightStick *flight_stick = NULL; - __x_ABI_CWindows_CGaming_CInput_CIGamepad *gamepad = NULL; - __x_ABI_CWindows_CGaming_CInput_CIRacingWheel *racing_wheel = NULL; - boolean wireless; - - if (wgi.gamepad_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2_FromGameController(wgi.gamepad_statics2, gamecontroller, &gamepad)) && gamepad) { - type = SDL_JOYSTICK_TYPE_GAMECONTROLLER; - __x_ABI_CWindows_CGaming_CInput_CIGamepad_Release(gamepad); - } else if (wgi.arcade_stick_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics2_FromGameController(wgi.arcade_stick_statics2, gamecontroller, &arcade_stick)) && arcade_stick) { - type = SDL_JOYSTICK_TYPE_ARCADE_STICK; - __x_ABI_CWindows_CGaming_CInput_CIArcadeStick_Release(arcade_stick); - } else if (wgi.flight_stick_statics && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIFlightStickStatics_FromGameController(wgi.flight_stick_statics, gamecontroller, &flight_stick)) && flight_stick) { - type = SDL_JOYSTICK_TYPE_FLIGHT_STICK; - __x_ABI_CWindows_CGaming_CInput_CIFlightStick_Release(flight_stick); - } else if (wgi.racing_wheel_statics2 && SUCCEEDED(__x_ABI_CWindows_CGaming_CInput_CIRacingWheelStatics2_FromGameController(wgi.racing_wheel_statics2, gamecontroller, &racing_wheel)) && racing_wheel) { - type = SDL_JOYSTICK_TYPE_WHEEL; - __x_ABI_CWindows_CGaming_CInput_CIRacingWheel_Release(racing_wheel); - } - - hr = __x_ABI_CWindows_CGaming_CInput_CIGameController_get_IsWireless(gamecontroller, &wireless); - if (SUCCEEDED(hr) && wireless) { - bus = SDL_HARDWARE_BUS_BLUETOOTH; - } - - __x_ABI_CWindows_CGaming_CInput_CIGameController_Release(gamecontroller); - } - - guid = SDL_CreateJoystickGUID(bus, vendor, product, version, name, 'w', (Uint8) type); - #ifdef SDL_JOYSTICK_HIDAPI if (!ignore_joystick && HIDAPI_IsDevicePresent(vendor, product, version, name)) { ignore_joystick = SDL_TRUE; @@ -358,17 +515,33 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde ignore_joystick = SDL_TRUE; } - if (!ignore_joystick && SDL_IsXInputDevice(vendor, product)) { + if (!ignore_joystick && SDL_IsXInputDevice(vendor, product, name)) { ignore_joystick = SDL_TRUE; } - if (!ignore_joystick && SDL_ShouldIgnoreJoystick(name, guid)) { - ignore_joystick = SDL_TRUE; + if (!ignore_joystick) { + hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(controller, &IID_IGameController, (void **)&gamecontroller); + if (SUCCEEDED(hr)) { + boolean wireless; + + type = GetGameControllerType(gamecontroller); + + hr = __x_ABI_CWindows_CGaming_CInput_CIGameController_get_IsWireless(gamecontroller, &wireless); + if (SUCCEEDED(hr) && wireless) { + bus = SDL_HARDWARE_BUS_BLUETOOTH; + } + + __x_ABI_CWindows_CGaming_CInput_CIGameController_Release(gamecontroller); + } + + guid = SDL_CreateJoystickGUID(bus, vendor, product, version, NULL, name, 'w', (Uint8)type); + + if (SDL_ShouldIgnoreJoystick(name, guid)) { + ignore_joystick = SDL_TRUE; + } } - if (ignore_joystick) { - SDL_free(name); - } else { + if (!ignore_joystick) { /* New device, add it */ WindowsGamingInputControllerState *controllers = SDL_realloc(wgi.controllers, sizeof(wgi.controllers[0]) * (wgi.controller_count + 1)); if (controllers) { @@ -381,6 +554,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde state->name = name; state->guid = guid; state->type = type; + state->steam_virtual_gamepad_slot = GetSteamVirtualGamepadSlot(controller, vendor, product); __x_ABI_CWindows_CGaming_CInput_CIRawGameController_get_ButtonCount(controller, &state->nbuttons); __x_ABI_CWindows_CGaming_CInput_CIRawGameController_get_AxisCount(controller, &state->naxes); @@ -392,7 +566,11 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde wgi.controllers = controllers; SDL_PrivateJoystickAdded(joystickID); + } else { + SDL_free(name); } + } else { + SDL_free(name); } __x_ABI_CWindows_CGaming_CInput_CIRawGameController_Release(controller); @@ -403,7 +581,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde return S_OK; } -static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeRemoved(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController * This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIRawGameController *e) +static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeRemoved(__FIEventHandler_1_Windows__CGaming__CInput__CRawGameController *This, IInspectable *sender, __x_ABI_CWindows_CGaming_CInput_CIRawGameController *e) { HRESULT hr; __x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller = NULL; @@ -411,7 +589,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeRemo SDL_LockJoysticks(); /* Can we get delayed calls to InvokeRemoved() after WGI_JoystickQuit()? */ - if (SDL_JoysticksQuitting() || !SDL_JoysticksInitialized()) { + if (!SDL_JoysticksInitialized()) { SDL_UnlockJoysticks(); return S_OK; } @@ -420,7 +598,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeRemo if (SUCCEEDED(hr)) { int i; - for (i = 0; i < wgi.controller_count ; i++) { + for (i = 0; i < wgi.controller_count; i++) { if (wgi.controllers[i].controller == controller) { WindowsGamingInputControllerState *state = &wgi.controllers[i]; SDL_JoystickID joystickID = state->instance_id; @@ -469,16 +647,14 @@ static RawGameControllerDelegate controller_removed = { { 1 } }; -static int -WGI_JoystickInit(void) +static int WGI_JoystickInit(void) { - typedef HRESULT (WINAPI *WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER *hstringHeader, HSTRING* string); - typedef HRESULT (WINAPI *RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void** factory); - - WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = NULL; - RoGetActivationFactory_t RoGetActivationFactoryFunc = NULL; HRESULT hr; + if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_WGI, SDL_TRUE)) { + return 0; + } + if (FAILED(WIN_RoInitialize())) { return SDL_SetError("RoInitialize() failed"); } @@ -493,7 +669,7 @@ WGI_JoystickInit(void) */ static PVOID cookie = NULL; if (!cookie) { - typedef HRESULT (WINAPI *CoIncrementMTAUsage_t)(PVOID* pCookie); + typedef HRESULT(WINAPI * CoIncrementMTAUsage_t)(PVOID * pCookie); CoIncrementMTAUsage_t CoIncrementMTAUsageFunc = (CoIncrementMTAUsage_t)WIN_LoadComBaseFunction("CoIncrementMTAUsage"); if (CoIncrementMTAUsageFunc) { if (FAILED(CoIncrementMTAUsageFunc(&cookie))) { @@ -507,71 +683,7 @@ WGI_JoystickInit(void) } #endif -#ifdef __WINRT__ - WindowsCreateStringReferenceFunc = WindowsCreateStringReference; - RoGetActivationFactoryFunc = RoGetActivationFactory; -#else - { - WindowsCreateStringReferenceFunc = (WindowsCreateStringReference_t)WIN_LoadComBaseFunction("WindowsCreateStringReference"); - RoGetActivationFactoryFunc = (RoGetActivationFactory_t)WIN_LoadComBaseFunction("RoGetActivationFactory"); - } -#endif /* __WINRT__ */ - if (WindowsCreateStringReferenceFunc && RoGetActivationFactoryFunc) { - PCWSTR pNamespace; - HSTRING_HEADER hNamespaceStringHeader; - HSTRING hNamespaceString; - - pNamespace = L"Windows.Gaming.Input.RawGameController"; - hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); - if (SUCCEEDED(hr)) { - hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IRawGameControllerStatics, (void **)&wgi.statics); - if (!SUCCEEDED(hr)) { - SDL_SetError("Couldn't find IRawGameControllerStatics: 0x%lx", hr); - } - } - - pNamespace = L"Windows.Gaming.Input.ArcadeStick"; - hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); - if (SUCCEEDED(hr)) { - hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IArcadeStickStatics, (void **)&wgi.arcade_stick_statics); - if (SUCCEEDED(hr)) { - __x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics_QueryInterface(wgi.arcade_stick_statics, &IID_IArcadeStickStatics2, (void **)&wgi.arcade_stick_statics2); - } else { - SDL_SetError("Couldn't find IID_IArcadeStickStatics: 0x%lx", hr); - } - } - - pNamespace = L"Windows.Gaming.Input.FlightStick"; - hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); - if (SUCCEEDED(hr)) { - hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IFlightStickStatics, (void **)&wgi.flight_stick_statics); - if (!SUCCEEDED(hr)) { - SDL_SetError("Couldn't find IID_IFlightStickStatics: 0x%lx", hr); - } - } - - pNamespace = L"Windows.Gaming.Input.Gamepad"; - hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); - if (SUCCEEDED(hr)) { - hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IGamepadStatics, (void **)&wgi.gamepad_statics); - if (SUCCEEDED(hr)) { - __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics_QueryInterface(wgi.gamepad_statics, &IID_IGamepadStatics2, (void **)&wgi.gamepad_statics2); - } else { - SDL_SetError("Couldn't find IGamepadStatics: 0x%lx", hr); - } - } - - pNamespace = L"Windows.Gaming.Input.RacingWheel"; - hr = WindowsCreateStringReferenceFunc(pNamespace, (UINT32)SDL_wcslen(pNamespace), &hNamespaceStringHeader, &hNamespaceString); - if (SUCCEEDED(hr)) { - hr = RoGetActivationFactoryFunc(hNamespaceString, &IID_IRacingWheelStatics, (void **)&wgi.racing_wheel_statics); - if (SUCCEEDED(hr)) { - __x_ABI_CWindows_CGaming_CInput_CIRacingWheelStatics_QueryInterface(wgi.racing_wheel_statics, &IID_IRacingWheelStatics2, (void **)&wgi.racing_wheel_statics2); - } else { - SDL_SetError("Couldn't find IRacingWheelStatics: 0x%lx", hr); - } - } - } + WGI_LoadRawGameControllerStatics(); if (wgi.statics) { __FIVectorView_1_Windows__CGaming__CInput__CRawGameController *controllers; @@ -610,54 +722,50 @@ WGI_JoystickInit(void) return 0; } -static int -WGI_JoystickGetCount(void) +static int WGI_JoystickGetCount(void) { return wgi.controller_count; } -static void -WGI_JoystickDetect(void) +static void WGI_JoystickDetect(void) { } -static const char * -WGI_JoystickGetDeviceName(int device_index) +static const char *WGI_JoystickGetDeviceName(int device_index) { return wgi.controllers[device_index].name; } -static const char * -WGI_JoystickGetDevicePath(int device_index) +static const char *WGI_JoystickGetDevicePath(int device_index) { return NULL; } -static int -WGI_JoystickGetDevicePlayerIndex(int device_index) +static int WGI_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + return wgi.controllers[device_index].steam_virtual_gamepad_slot; +} + +static int WGI_JoystickGetDevicePlayerIndex(int device_index) { return -1; } -static void -WGI_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void WGI_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID -WGI_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID WGI_JoystickGetDeviceGUID(int device_index) { return wgi.controllers[device_index].guid; } -static SDL_JoystickID -WGI_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID WGI_JoystickGetDeviceInstanceID(int device_index) { return wgi.controllers[device_index].instance_id; } -static int -WGI_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int WGI_JoystickOpen(SDL_Joystick *joystick, int device_index) { WindowsGamingInputControllerState *state = &wgi.controllers[device_index]; struct joystick_hwdata *hwdata; @@ -728,8 +836,7 @@ WGI_JoystickOpen(SDL_Joystick *joystick, int device_index) return 0; } -static int -WGI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int WGI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { struct joystick_hwdata *hwdata = joystick->hwdata; @@ -749,8 +856,7 @@ WGI_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 h } } -static int -WGI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int WGI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { struct joystick_hwdata *hwdata = joystick->hwdata; @@ -770,8 +876,7 @@ WGI_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 ri } } -static Uint32 -WGI_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 WGI_JoystickGetCapabilities(SDL_Joystick *joystick) { struct joystick_hwdata *hwdata = joystick->hwdata; @@ -783,26 +888,22 @@ WGI_JoystickGetCapabilities(SDL_Joystick *joystick) } } -static int -WGI_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int WGI_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -WGI_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int WGI_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -WGI_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int WGI_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static Uint8 -ConvertHatValue(__x_ABI_CWindows_CGaming_CInput_CGameControllerSwitchPosition value) +static Uint8 ConvertHatValue(__x_ABI_CWindows_CGaming_CInput_CGameControllerSwitchPosition value) { switch (value) { case GameControllerSwitchPosition_Up: @@ -826,8 +927,7 @@ ConvertHatValue(__x_ABI_CWindows_CGaming_CInput_CGameControllerSwitchPosition va } } -static void -WGI_JoystickUpdate(SDL_Joystick *joystick) +static void WGI_JoystickUpdate(SDL_Joystick *joystick) { struct joystick_hwdata *hwdata = joystick->hwdata; HRESULT hr; @@ -850,28 +950,31 @@ WGI_JoystickUpdate(SDL_Joystick *joystick) } hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_GetCurrentReading(hwdata->controller, nbuttons, buttons, nhats, hats, naxes, axes, ×tamp); - if (SUCCEEDED(hr) && timestamp != hwdata->timestamp) { + if (SUCCEEDED(hr) && (!timestamp || timestamp != hwdata->timestamp)) { UINT32 i; - SDL_bool all_zero = SDL_TRUE; + SDL_bool all_zero = SDL_FALSE; /* The axes are all zero when the application loses focus */ - for (i = 0; i < naxes; ++i) { - if (axes[i] != 0.0f) { - all_zero = SDL_FALSE; - break; + if (naxes > 0) { + all_zero = SDL_TRUE; + for (i = 0; i < naxes; ++i) { + if (axes[i] != 0.0f) { + all_zero = SDL_FALSE; + break; + } } } if (all_zero) { SDL_PrivateJoystickForceRecentering(joystick); } else { for (i = 0; i < nbuttons; ++i) { - SDL_PrivateJoystickButton(joystick, (Uint8) i, buttons[i]); + SDL_PrivateJoystickButton(joystick, (Uint8)i, buttons[i]); } for (i = 0; i < nhats; ++i) { - SDL_PrivateJoystickHat(joystick, (Uint8) i, ConvertHatValue(hats[i])); + SDL_PrivateJoystickHat(joystick, (Uint8)i, ConvertHatValue(hats[i])); } for (i = 0; i < naxes; ++i) { - SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)((int) (axes[i] * 65535) - 32768)); + SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)((int)(axes[i] * 65535) - 32768)); } } hwdata->timestamp = timestamp; @@ -882,8 +985,7 @@ WGI_JoystickUpdate(SDL_Joystick *joystick) SDL_stack_free(axes); } -static void -WGI_JoystickClose(SDL_Joystick *joystick) +static void WGI_JoystickClose(SDL_Joystick *joystick) { struct joystick_hwdata *hwdata = joystick->hwdata; @@ -905,8 +1007,7 @@ WGI_JoystickClose(SDL_Joystick *joystick) joystick->hwdata = NULL; } -static void -WGI_JoystickQuit(void) +static void WGI_JoystickQuit(void) { if (wgi.statics) { while (wgi.controller_count > 0) { @@ -950,19 +1051,18 @@ WGI_JoystickQuit(void) SDL_zero(wgi); } -static SDL_bool -WGI_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool WGI_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_WGI_JoystickDriver = -{ +SDL_JoystickDriver SDL_WGI_JoystickDriver = { WGI_JoystickInit, WGI_JoystickGetCount, WGI_JoystickDetect, WGI_JoystickGetDeviceName, WGI_JoystickGetDevicePath, + WGI_JoystickGetDeviceSteamVirtualGamepadSlot, WGI_JoystickGetDevicePlayerIndex, WGI_JoystickSetDevicePlayerIndex, WGI_JoystickGetDeviceGUID, diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index ccd8f37bb3423..d2ea36d0c8d3d 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_JOYSTICK_DINPUT || SDL_JOYSTICK_XINPUT +#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) /* DirectInput joystick driver; written by Glenn Maynard, based on Andrei de * A. Formiga's WINMM driver. @@ -51,9 +51,8 @@ #include "SDL_xinputjoystick_c.h" #include "SDL_rawinputjoystick_c.h" -#include "../../haptic/windows/SDL_dinputhaptic_c.h" /* For haptic hot plugging */ -#include "../../haptic/windows/SDL_xinputhaptic_c.h" /* For haptic hot plugging */ - +#include "../../haptic/windows/SDL_dinputhaptic_c.h" /* For haptic hot plugging */ +#include "../../haptic/windows/SDL_xinputhaptic_c.h" /* For haptic hot plugging */ #ifndef DEVICE_NOTIFY_WINDOW_HANDLE #define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000 @@ -69,34 +68,42 @@ extern "C" { #endif DECLARE_HANDLE(HCMNOTIFICATION); -typedef HCMNOTIFICATION* PHCMNOTIFICATION; +typedef HCMNOTIFICATION *PHCMNOTIFICATION; -typedef enum _CM_NOTIFY_FILTER_TYPE { +typedef enum _CM_NOTIFY_FILTER_TYPE +{ CM_NOTIFY_FILTER_TYPE_DEVICEINTERFACE = 0, CM_NOTIFY_FILTER_TYPE_DEVICEHANDLE, CM_NOTIFY_FILTER_TYPE_DEVICEINSTANCE, CM_NOTIFY_FILTER_TYPE_MAX -} CM_NOTIFY_FILTER_TYPE, * PCM_NOTIFY_FILTER_TYPE; +} CM_NOTIFY_FILTER_TYPE, + *PCM_NOTIFY_FILTER_TYPE; -typedef struct _CM_NOTIFY_FILTER { +typedef struct _CM_NOTIFY_FILTER +{ DWORD cbSize; DWORD Flags; CM_NOTIFY_FILTER_TYPE FilterType; DWORD Reserved; - union { - struct { + union + { + struct + { GUID ClassGuid; } DeviceInterface; - struct { - HANDLE hTarget; + struct + { + HANDLE hTarget; } DeviceHandle; - struct { + struct + { WCHAR InstanceId[200]; } DeviceInstance; } u; -} CM_NOTIFY_FILTER, * PCM_NOTIFY_FILTER; +} CM_NOTIFY_FILTER, *PCM_NOTIFY_FILTER; -typedef enum _CM_NOTIFY_ACTION { +typedef enum _CM_NOTIFY_ACTION +{ CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL = 0, CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL, CM_NOTIFY_ACTION_DEVICEQUERYREMOVE, @@ -108,32 +115,38 @@ typedef enum _CM_NOTIFY_ACTION { CM_NOTIFY_ACTION_DEVICEINSTANCESTARTED, CM_NOTIFY_ACTION_DEVICEINSTANCEREMOVED, CM_NOTIFY_ACTION_MAX -} CM_NOTIFY_ACTION, * PCM_NOTIFY_ACTION; +} CM_NOTIFY_ACTION, + *PCM_NOTIFY_ACTION; -typedef struct _CM_NOTIFY_EVENT_DATA { +typedef struct _CM_NOTIFY_EVENT_DATA +{ CM_NOTIFY_FILTER_TYPE FilterType; DWORD Reserved; - union { - struct { + union + { + struct + { GUID ClassGuid; WCHAR SymbolicLink[ANYSIZE_ARRAY]; } DeviceInterface; - struct { + struct + { GUID EventGuid; LONG NameOffset; DWORD DataSize; BYTE Data[ANYSIZE_ARRAY]; } DeviceHandle; - struct { + struct + { WCHAR InstanceId[ANYSIZE_ARRAY]; } DeviceInstance; } u; -} CM_NOTIFY_EVENT_DATA, * PCM_NOTIFY_EVENT_DATA; +} CM_NOTIFY_EVENT_DATA, *PCM_NOTIFY_EVENT_DATA; -typedef DWORD (CALLBACK *PCM_NOTIFY_CALLBACK)(HCMNOTIFICATION hNotify, PVOID Context, CM_NOTIFY_ACTION Action, PCM_NOTIFY_EVENT_DATA EventData, DWORD EventDataSize); +typedef DWORD(CALLBACK *PCM_NOTIFY_CALLBACK)(HCMNOTIFICATION hNotify, PVOID Context, CM_NOTIFY_ACTION Action, PCM_NOTIFY_EVENT_DATA EventData, DWORD EventDataSize); -typedef DWORD (WINAPI *CM_Register_NotificationFunc)(PCM_NOTIFY_FILTER pFilter, PVOID pContext, PCM_NOTIFY_CALLBACK pCallback, PHCMNOTIFICATION pNotifyContext); -typedef DWORD (WINAPI *CM_Unregister_NotificationFunc)(HCMNOTIFICATION NotifyContext); +typedef DWORD(WINAPI *CM_Register_NotificationFunc)(PCM_NOTIFY_FILTER pFilter, PVOID pContext, PCM_NOTIFY_CALLBACK pCallback, PHCMNOTIFICATION pNotifyContext); +typedef DWORD(WINAPI *CM_Unregister_NotificationFunc)(HCMNOTIFICATION NotifyContext); /* local variables */ static SDL_bool s_bJoystickThread = SDL_FALSE; @@ -144,7 +157,7 @@ static SDL_Thread *s_joystickThread = NULL; static SDL_bool s_bJoystickThreadQuit = SDL_FALSE; static GUID GUID_DEVINTERFACE_HID = { 0x4D1E55B2L, 0xF16F, 0x11CF, { 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 } }; -JoyStick_DeviceData *SYS_Joystick; /* array to hold joystick ID values */ +JoyStick_DeviceData *SYS_Joystick; /* array to hold joystick ID values */ #if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) static HMODULE cfgmgr32_lib_handle; @@ -152,8 +165,12 @@ static CM_Register_NotificationFunc CM_Register_Notification; static CM_Unregister_NotificationFunc CM_Unregister_Notification; static HCMNOTIFICATION s_DeviceNotificationFuncHandle; -static DWORD CALLBACK -SDL_DeviceNotificationFunc(HCMNOTIFICATION hNotify, PVOID context, CM_NOTIFY_ACTION action, PCM_NOTIFY_EVENT_DATA eventData, DWORD event_data_size) +void WINDOWS_RAWINPUTEnabledChanged(void) +{ + s_bWindowsDeviceChanged = SDL_TRUE; +} + +static DWORD CALLBACK SDL_DeviceNotificationFunc(HCMNOTIFICATION hNotify, PVOID context, CM_NOTIFY_ACTION action, PCM_NOTIFY_EVENT_DATA eventData, DWORD event_data_size) { if (action == CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL || action == CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL) { @@ -162,11 +179,10 @@ SDL_DeviceNotificationFunc(HCMNOTIFICATION hNotify, PVOID context, CM_NOTIFY_ACT return ERROR_SUCCESS; } -static void -SDL_CleanupDeviceNotificationFunc(void) +static void SDL_CleanupDeviceNotificationFunc(void) { if (cfgmgr32_lib_handle) { - if (s_DeviceNotificationFuncHandle) { + if (s_DeviceNotificationFuncHandle != NULL && CM_Unregister_Notification) { CM_Unregister_Notification(s_DeviceNotificationFuncHandle); s_DeviceNotificationFuncHandle = NULL; } @@ -176,8 +192,7 @@ SDL_CleanupDeviceNotificationFunc(void) } } -static SDL_bool -SDL_CreateDeviceNotificationFunc(void) +static SDL_bool SDL_CreateDeviceNotificationFunc(void) { cfgmgr32_lib_handle = LoadLibraryA("cfgmgr32.dll"); if (cfgmgr32_lib_handle) { @@ -212,15 +227,14 @@ typedef struct #define IDT_SDL_DEVICE_CHANGE_TIMER_2 1201 /* windowproc for our joystick detect thread message only window, to detect any USB device addition/removal */ -static LRESULT CALLBACK -SDL_PrivateJoystickDetectProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK SDL_PrivateJoystickDetectProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_DEVICECHANGE: switch (wParam) { case DBT_DEVICEARRIVAL: case DBT_DEVICEREMOVECOMPLETE: - if (((DEV_BROADCAST_HDR*)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { + if (((DEV_BROADCAST_HDR *)lParam)->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { /* notify 300ms and 2 seconds later to ensure all APIs have updated status */ SetTimer(hwnd, IDT_SDL_DEVICE_CHANGE_TIMER_1, 300, NULL); SetTimer(hwnd, IDT_SDL_DEVICE_CHANGE_TIMER_2, 2000, NULL); @@ -238,25 +252,26 @@ SDL_PrivateJoystickDetectProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; } -#if SDL_JOYSTICK_RAWINPUT +#ifdef SDL_JOYSTICK_RAWINPUT return CallWindowProc(RAWINPUT_WindowProc, hwnd, msg, wParam, lParam); #else return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); #endif } -static void -SDL_CleanupDeviceNotification(SDL_DeviceNotificationData *data) +static void SDL_CleanupDeviceNotification(SDL_DeviceNotificationData *data) { -#if SDL_JOYSTICK_RAWINPUT +#ifdef SDL_JOYSTICK_RAWINPUT RAWINPUT_UnregisterNotifications(); #endif - if (data->hNotify) + if (data->hNotify) { UnregisterDeviceNotification(data->hNotify); + } - if (data->messageWindow) + if (data->messageWindow) { DestroyWindow(data->messageWindow); + } UnregisterClass(data->wincl.lpszClassName, data->wincl.hInstance); @@ -265,8 +280,7 @@ SDL_CleanupDeviceNotification(SDL_DeviceNotificationData *data) } } -static int -SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data) +static int SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data) { DEV_BROADCAST_DEVICEINTERFACE dbh; @@ -276,8 +290,8 @@ SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data) data->wincl.hInstance = GetModuleHandle(NULL); data->wincl.lpszClassName = TEXT("Message"); - data->wincl.lpfnWndProc = SDL_PrivateJoystickDetectProc; /* This function is called by windows */ - data->wincl.cbSize = sizeof (WNDCLASSEX); + data->wincl.lpfnWndProc = SDL_PrivateJoystickDetectProc; /* This function is called by windows */ + data->wincl.cbSize = sizeof(WNDCLASSEX); if (!RegisterClassEx(&data->wincl)) { WIN_SetError("Failed to create register class for joystick autodetect"); @@ -285,7 +299,7 @@ SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data) return -1; } - data->messageWindow = (HWND)CreateWindowEx(0, TEXT("Message"), NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); + data->messageWindow = CreateWindowEx(0, TEXT("Message"), NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); if (!data->messageWindow) { WIN_SetError("Failed to create message window for joystick autodetect"); SDL_CleanupDeviceNotification(data); @@ -304,14 +318,13 @@ SDL_CreateDeviceNotification(SDL_DeviceNotificationData *data) return -1; } -#if SDL_JOYSTICK_RAWINPUT +#ifdef SDL_JOYSTICK_RAWINPUT RAWINPUT_RegisterNotifications(data->messageWindow); #endif return 0; } -static SDL_bool -SDL_WaitForDeviceNotification(SDL_DeviceNotificationData *data, SDL_mutex *mutex) +static SDL_bool SDL_WaitForDeviceNotification(SDL_DeviceNotificationData *data, SDL_mutex *mutex) { MSG msg; int lastret = 1; @@ -334,7 +347,6 @@ SDL_WaitForDeviceNotification(SDL_DeviceNotificationData *data, SDL_mutex *mutex #endif /* !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) */ - #if !defined(__WINRT__) #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) @@ -342,10 +354,9 @@ static SDL_DeviceNotificationData s_notification_data; #endif /* Function/thread to scan the system for joysticks. */ -static int SDLCALL -SDL_JoystickThread(void *_data) +static int SDLCALL SDL_JoystickThread(void *_data) { -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT SDL_bool bOpenedXInputDevices[XUSER_MAX_COUNT]; SDL_zeroa(bOpenedXInputDevices); #endif @@ -363,10 +374,10 @@ SDL_JoystickThread(void *_data) #else { #endif -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT /* WM_DEVICECHANGE not working, poll for new XINPUT controllers */ SDL_CondWaitTimeout(s_condJoystickThread, s_mutexJoyStickEnum, 1000); - if (SDL_XINPUT_Enabled() && XINPUTGETCAPABILITIES) { + if (SDL_XINPUT_Enabled()) { /* scan for any change in XInput devices */ Uint8 userId; for (userId = 0; userId < XUSER_MAX_COUNT; userId++) { @@ -396,8 +407,7 @@ SDL_JoystickThread(void *_data) } /* spin up the thread to detect hotplug of devices */ -static int -SDL_StartJoystickThread(void) +static int SDL_StartJoystickThread(void) { s_mutexJoyStickEnum = SDL_CreateMutex(); if (!s_mutexJoyStickEnum) { @@ -417,8 +427,7 @@ SDL_StartJoystickThread(void) return 0; } -static void -SDL_StopJoystickThread(void) +static void SDL_StopJoystickThread(void) { if (!s_joystickThread) { return; @@ -455,22 +464,21 @@ void WINDOWS_AddJoystickDevice(JoyStick_DeviceData *device) SYS_Joystick = device; } -static void WINDOWS_JoystickDetect(void); -static void WINDOWS_JoystickQuit(void); +void WINDOWS_JoystickDetect(void); +void WINDOWS_JoystickQuit(void); /* Function to scan the system for joysticks. * Joystick 0 should be the system default joystick. * It should return 0, or -1 on an unrecoverable fatal error. */ -static int -WINDOWS_JoystickInit(void) +static int WINDOWS_JoystickInit(void) { - if (SDL_DINPUT_JoystickInit() < 0) { + if (SDL_XINPUT_JoystickInit() < 0) { WINDOWS_JoystickQuit(); return -1; } - if (SDL_XINPUT_JoystickInit() < 0) { + if (SDL_DINPUT_JoystickInit() < 0) { WINDOWS_JoystickQuit(); return -1; } @@ -505,8 +513,7 @@ WINDOWS_JoystickInit(void) } /* return the number of joysticks that are connected right now */ -static int -WINDOWS_JoystickGetCount(void) +static int WINDOWS_JoystickGetCount(void) { int nJoysticks = 0; JoyStick_DeviceData *device = SYS_Joystick; @@ -519,14 +526,13 @@ WINDOWS_JoystickGetCount(void) } /* detect any new joysticks being inserted into the system */ -static void -WINDOWS_JoystickDetect(void) +void WINDOWS_JoystickDetect(void) { JoyStick_DeviceData *pCurList = NULL; /* only enum the devices if the joystick thread told us something changed */ if (!s_bWindowsDeviceChanged) { - return; /* thread hasn't signaled, nothing to do right now. */ + return; /* thread hasn't signaled, nothing to do right now. */ } if (s_mutexJoyStickEnum) { @@ -552,11 +558,11 @@ WINDOWS_JoystickDetect(void) JoyStick_DeviceData *pListNext = NULL; if (pCurList->bXInputDevice) { -#if SDL_HAPTIC_XINPUT +#ifdef SDL_HAPTIC_XINPUT SDL_XINPUT_HapticMaybeRemoveDevice(pCurList->XInputUserId); #endif } else { -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT SDL_DINPUT_HapticMaybeRemoveDevice(&pCurList->dxdevice); #endif } @@ -572,11 +578,11 @@ WINDOWS_JoystickDetect(void) for (pCurList = SYS_Joystick; pCurList; pCurList = pCurList->pNext) { if (pCurList->send_add_event) { if (pCurList->bXInputDevice) { -#if SDL_HAPTIC_XINPUT +#ifdef SDL_HAPTIC_XINPUT SDL_XINPUT_HapticMaybeAddDevice(pCurList->XInputUserId); #endif } else { -#if SDL_HAPTIC_DINPUT +#ifdef SDL_HAPTIC_DINPUT SDL_DINPUT_HapticMaybeAddDevice(&pCurList->dxdevice); #endif } @@ -588,69 +594,85 @@ WINDOWS_JoystickDetect(void) } } -static const char * -WINDOWS_JoystickGetDeviceName(int device_index) +static const char *WINDOWS_JoystickGetDeviceName(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } return device->joystickname; } -static const char * -WINDOWS_JoystickGetDevicePath(int device_index) +static const char *WINDOWS_JoystickGetDevicePath(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } return device->path; } -static int -WINDOWS_JoystickGetDevicePlayerIndex(int device_index) +static int WINDOWS_JoystickGetDeviceSteamVirtualGamepadSlot(int device_index) +{ + JoyStick_DeviceData *device = SYS_Joystick; + int index; + + for (index = device_index; index > 0; index--) { + device = device->pNext; + } + + if (device->bXInputDevice) { + /* The slot for XInput devices can change as controllers are seated */ + return SDL_XINPUT_GetSteamVirtualGamepadSlot(device->XInputUserId); + } else { + return device->steam_virtual_gamepad_slot; + } +} + +static int WINDOWS_JoystickGetDevicePlayerIndex(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } return device->bXInputDevice ? (int)device->XInputUserId : -1; } -static void -WINDOWS_JoystickSetDevicePlayerIndex(int device_index, int player_index) +static void WINDOWS_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } /* return the stable device guid for this device index */ -static SDL_JoystickGUID -WINDOWS_JoystickGetDeviceGUID(int device_index) +static SDL_JoystickGUID WINDOWS_JoystickGetDeviceGUID(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } return device->guid; } /* Function to perform the mapping between current device instance and this joysticks instance id */ -static SDL_JoystickID -WINDOWS_JoystickGetDeviceInstanceID(int device_index) +static SDL_JoystickID WINDOWS_JoystickGetDeviceInstanceID(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } return device->nInstanceID; } @@ -660,23 +682,21 @@ WINDOWS_JoystickGetDeviceInstanceID(int device_index) This should fill the nbuttons and naxes fields of the joystick structure. It returns 0, or -1 if there is an error. */ -static int -WINDOWS_JoystickOpen(SDL_Joystick *joystick, int device_index) +static int WINDOWS_JoystickOpen(SDL_Joystick *joystick, int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; - for (index = device_index; index > 0; index--) + for (index = device_index; index > 0; index--) { device = device->pNext; + } /* allocate memory for system specific hardware data */ joystick->instance_id = device->nInstanceID; - joystick->hwdata = - (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata)); - if (joystick->hwdata == NULL) { + joystick->hwdata = (struct joystick_hwdata *)SDL_calloc(1, sizeof(struct joystick_hwdata)); + if (!joystick->hwdata) { return SDL_OutOfMemory(); } - SDL_zerop(joystick->hwdata); joystick->hwdata->guid = device->guid; if (device->bXInputDevice) { @@ -686,8 +706,7 @@ WINDOWS_JoystickOpen(SDL_Joystick *joystick, int device_index) } } -static int -WINDOWS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +static int WINDOWS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { if (joystick->hwdata->bXInputDevice) { return SDL_XINPUT_JoystickRumble(joystick, low_frequency_rumble, high_frequency_rumble); @@ -696,14 +715,12 @@ WINDOWS_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint } } -static int -WINDOWS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) +static int WINDOWS_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble) { return SDL_Unsupported(); } -static Uint32 -WINDOWS_JoystickGetCapabilities(SDL_Joystick *joystick) +static Uint32 WINDOWS_JoystickGetCapabilities(SDL_Joystick *joystick) { if (joystick->hwdata->bXInputDevice) { return SDL_XINPUT_JoystickGetCapabilities(joystick); @@ -712,26 +729,22 @@ WINDOWS_JoystickGetCapabilities(SDL_Joystick *joystick) } } -static int -WINDOWS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) +static int WINDOWS_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { return SDL_Unsupported(); } -static int -WINDOWS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) +static int WINDOWS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size) { return SDL_Unsupported(); } -static int -WINDOWS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) +static int WINDOWS_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled) { return SDL_Unsupported(); } -static void -WINDOWS_JoystickUpdate(SDL_Joystick *joystick) +static void WINDOWS_JoystickUpdate(SDL_Joystick *joystick) { if (!joystick->hwdata) { return; @@ -745,8 +758,7 @@ WINDOWS_JoystickUpdate(SDL_Joystick *joystick) } /* Function to close a joystick after use */ -static void -WINDOWS_JoystickClose(SDL_Joystick *joystick) +static void WINDOWS_JoystickClose(SDL_Joystick *joystick) { if (joystick->hwdata->bXInputDevice) { SDL_XINPUT_JoystickClose(joystick); @@ -758,8 +770,7 @@ WINDOWS_JoystickClose(SDL_Joystick *joystick) } /* Function to perform any system-specific joystick related cleanup */ -static void -WINDOWS_JoystickQuit(void) +void WINDOWS_JoystickQuit(void) { JoyStick_DeviceData *device = SYS_Joystick; @@ -793,19 +804,18 @@ WINDOWS_JoystickQuit(void) s_bWindowsDeviceChanged = SDL_FALSE; } -static SDL_bool -WINDOWS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) +static SDL_bool WINDOWS_JoystickGetGamepadMapping(int device_index, SDL_GamepadMapping *out) { return SDL_FALSE; } -SDL_JoystickDriver SDL_WINDOWS_JoystickDriver = -{ +SDL_JoystickDriver SDL_WINDOWS_JoystickDriver = { WINDOWS_JoystickInit, WINDOWS_JoystickGetCount, WINDOWS_JoystickDetect, WINDOWS_JoystickGetDeviceName, WINDOWS_JoystickGetDevicePath, + WINDOWS_JoystickGetDeviceSteamVirtualGamepadSlot, WINDOWS_JoystickGetDevicePlayerIndex, WINDOWS_JoystickSetDevicePlayerIndex, WINDOWS_JoystickGetDeviceGUID, @@ -830,9 +840,9 @@ SDL_JoystickDriver SDL_WINDOWS_JoystickDriver = #else -#if SDL_JOYSTICK_RAWINPUT +#ifdef SDL_JOYSTICK_RAWINPUT /* The RAWINPUT driver needs the device notification setup above */ -#error SDL_JOYSTICK_RAWINPUT requires SDL_JOYSTICK_DINPUT || SDL_JOYSTICK_XINPUT +#error SDL_JOYSTICK_RAWINPUT requires SDL_JOYSTICK_DINPUT || defined(SDL_JOYSTICK_XINPUT) #endif #endif /* SDL_JOYSTICK_DINPUT || SDL_JOYSTICK_XINPUT */ diff --git a/src/joystick/windows/SDL_windowsjoystick_c.h b/src/joystick/windows/SDL_windowsjoystick_c.h index 00e1cf101c5bb..aeb534e57fb76 100644 --- a/src/joystick/windows/SDL_windowsjoystick_c.h +++ b/src/joystick/windows/SDL_windowsjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_directx.h" -#define MAX_INPUTS 256 /* each joystick can have up to 256 inputs */ +#define MAX_INPUTS 256 /* each joystick can have up to 256 inputs */ /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus @@ -43,10 +43,11 @@ typedef struct JoyStick_DeviceData Uint8 XInputUserId; DIDEVICEINSTANCE dxdevice; char path[MAX_PATH]; + int steam_virtual_gamepad_slot; struct JoyStick_DeviceData *pNext; } JoyStick_DeviceData; -extern JoyStick_DeviceData *SYS_Joystick; /* array to hold joystick ID values */ +extern JoyStick_DeviceData *SYS_Joystick; /* array to hold joystick ID values */ typedef enum Type { @@ -72,10 +73,11 @@ struct joystick_hwdata { SDL_JoystickGUID guid; -#if SDL_JOYSTICK_DINPUT +#ifdef SDL_JOYSTICK_DINPUT LPDIRECTINPUTDEVICE8 InputDevice; DIDEVCAPS Capabilities; SDL_bool buffered; + SDL_bool first_update; input_t Inputs[MAX_INPUTS]; int NumInputs; int NumSliders; @@ -86,11 +88,11 @@ struct joystick_hwdata SDL_bool bXInputDevice; /* SDL_TRUE if this device supports using the xinput API rather than DirectInput */ SDL_bool bXInputHaptic; /* Supports force feedback via XInput. */ - Uint8 userid; /* XInput userid index for this joystick */ + Uint8 userid; /* XInput userid index for this joystick */ DWORD dwPacketNumber; }; -#if SDL_JOYSTICK_DINPUT +#ifdef SDL_JOYSTICK_DINPUT extern const DIDATAFORMAT SDL_c_dfDIJoystick2; #endif diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c index 4fa3555b9bb09..103eb1247b596 100644 --- a/src/joystick/windows/SDL_xinputjoystick.c +++ b/src/joystick/windows/SDL_xinputjoystick.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #include "../SDL_sysjoystick.h" -#if SDL_JOYSTICK_XINPUT +#ifdef SDL_JOYSTICK_XINPUT #include "SDL_hints.h" #include "SDL_timer.h" @@ -39,17 +39,14 @@ extern "C" { /* * Internal stuff. */ -static SDL_bool s_bXInputEnabled = SDL_TRUE; -static char *s_arrXInputDevicePath[XUSER_MAX_COUNT]; +static SDL_bool s_bXInputEnabled = SDL_FALSE; - -static SDL_bool -SDL_XInputUseOldJoystickMapping() +static SDL_bool SDL_XInputUseOldJoystickMapping(void) { #ifdef __WINRT__ /* TODO: remove this __WINRT__ block, but only after integrating with UWP/WinRT's HID API */ /* FIXME: Why are Win8/10 different here? -flibit */ - return (NTDDI_VERSION < NTDDI_WIN10); + return NTDDI_VERSION < NTDDI_WIN10; #elif defined(__XBOXONE__) || defined(__XBOXSERIES__) return SDL_FALSE; #else @@ -57,7 +54,7 @@ SDL_XInputUseOldJoystickMapping() if (s_XInputUseOldJoystickMapping < 0) { s_XInputUseOldJoystickMapping = SDL_GetHintBoolean(SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING, SDL_FALSE); } - return (s_XInputUseOldJoystickMapping > 0); + return s_XInputUseOldJoystickMapping > 0; #endif } @@ -66,193 +63,129 @@ SDL_bool SDL_XINPUT_Enabled(void) return s_bXInputEnabled; } -int -SDL_XINPUT_JoystickInit(void) +int SDL_XINPUT_JoystickInit(void) { - s_bXInputEnabled = SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE); + SDL_bool enabled = SDL_GetHintBoolean(SDL_HINT_XINPUT_ENABLED, SDL_TRUE); -#ifdef SDL_JOYSTICK_RAWINPUT - if (RAWINPUT_IsEnabled()) { - /* The raw input driver handles more than 4 controllers, so prefer that when available */ - s_bXInputEnabled = SDL_FALSE; + if (enabled && WIN_LoadXInputDLL() < 0) { + enabled = SDL_FALSE; /* oh well. */ } -#endif + s_bXInputEnabled = enabled; - if (s_bXInputEnabled && WIN_LoadXInputDLL() < 0) { - s_bXInputEnabled = SDL_FALSE; /* oh well. */ - } return 0; } -static const char * -GetXInputName(const Uint8 userid, BYTE SubType) +static const char *GetXInputName(const Uint8 userid, BYTE SubType) { static char name[32]; if (SDL_XInputUseOldJoystickMapping()) { - SDL_snprintf(name, sizeof(name), "X360 Controller #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "X360 Controller #%u", 1 + userid); } else { switch (SubType) { case XINPUT_DEVSUBTYPE_GAMEPAD: - SDL_snprintf(name, sizeof(name), "XInput Controller #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput Controller #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_WHEEL: - SDL_snprintf(name, sizeof(name), "XInput Wheel #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput Wheel #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_ARCADE_STICK: - SDL_snprintf(name, sizeof(name), "XInput ArcadeStick #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput ArcadeStick #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_FLIGHT_STICK: - SDL_snprintf(name, sizeof(name), "XInput FlightStick #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput FlightStick #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_DANCE_PAD: - SDL_snprintf(name, sizeof(name), "XInput DancePad #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput DancePad #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_GUITAR: case XINPUT_DEVSUBTYPE_GUITAR_ALTERNATE: case XINPUT_DEVSUBTYPE_GUITAR_BASS: - SDL_snprintf(name, sizeof(name), "XInput Guitar #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput Guitar #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_DRUM_KIT: - SDL_snprintf(name, sizeof(name), "XInput DrumKit #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput DrumKit #%u", 1 + userid); break; case XINPUT_DEVSUBTYPE_ARCADE_PAD: - SDL_snprintf(name, sizeof(name), "XInput ArcadePad #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput ArcadePad #%u", 1 + userid); break; default: - SDL_snprintf(name, sizeof(name), "XInput Device #%u", 1 + userid); + (void)SDL_snprintf(name, sizeof(name), "XInput Device #%u", 1 + userid); break; } } return name; } -/* We can't really tell what device is being used for XInput, but we can guess - and we'll be correct for the case where only one device is connected. - */ -static void -GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion) +static SDL_bool GetXInputDeviceInfo(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion) { -#if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* TODO: remove this ifndef __WINRT__ block, but only after integrating with UWP/WinRT's HID API */ - PRAWINPUTDEVICELIST devices = NULL; - UINT i, j, device_count = 0; + SDL_XINPUT_CAPABILITIES_EX capabilities; - if ((GetRawInputDeviceList(NULL, &device_count, sizeof(RAWINPUTDEVICELIST)) == -1) || (!device_count)) { - return; /* oh well. */ + if (!XINPUTGETCAPABILITIESEX || XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) != ERROR_SUCCESS) { + return SDL_FALSE; } - devices = (PRAWINPUTDEVICELIST)SDL_malloc(sizeof(RAWINPUTDEVICELIST) * device_count); - if (devices == NULL) { - return; + /* Fixup for Wireless Xbox 360 Controller */ + if (capabilities.ProductId == 0 && capabilities.Capabilities.Flags & XINPUT_CAPS_WIRELESS) { + capabilities.VendorId = USB_VENDOR_MICROSOFT; + capabilities.ProductId = USB_PRODUCT_XBOX360_XUSB_CONTROLLER; } - if (GetRawInputDeviceList(devices, &device_count, sizeof(RAWINPUTDEVICELIST)) == -1) { - SDL_free(devices); - return; /* oh well. */ - } - - /* First see if we have a cached entry for this index */ - if (s_arrXInputDevicePath[userid]) { - for (i = 0; i < device_count; i++) { - RID_DEVICE_INFO rdi; - char devName[128]; - UINT rdiSize = sizeof(rdi); - UINT nameSize = SDL_arraysize(devName); - - rdi.cbSize = sizeof(rdi); - if (devices[i].dwType == RIM_TYPEHID && - GetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != (UINT)-1 && - GetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != (UINT)-1) { - if (SDL_strcmp(devName, s_arrXInputDevicePath[userid]) == 0) { - *pVID = (Uint16)rdi.hid.dwVendorId; - *pPID = (Uint16)rdi.hid.dwProductId; - *pVersion = (Uint16)rdi.hid.dwVersionNumber; - SDL_free(devices); - return; - } - } - } + if (pVID) { + *pVID = capabilities.VendorId; + } + if (pPID) { + *pPID = capabilities.ProductId; + } + if (pVersion) { + *pVersion = capabilities.ProductVersion; } + return SDL_TRUE; +} - for (i = 0; i < device_count; i++) { - RID_DEVICE_INFO rdi; - char devName[MAX_PATH]; - UINT rdiSize = sizeof(rdi); - UINT nameSize = SDL_arraysize(devName); +int SDL_XINPUT_GetSteamVirtualGamepadSlot(Uint8 userid) +{ + SDL_XINPUT_CAPABILITIES_EX capabilities; - rdi.cbSize = sizeof(rdi); - if (devices[i].dwType == RIM_TYPEHID && - GetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != (UINT)-1 && - GetRawInputDeviceInfoA(devices[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != (UINT)-1) { -#ifdef DEBUG_JOYSTICK - SDL_Log("Raw input device: VID = 0x%x, PID = 0x%x, %s\n", rdi.hid.dwVendorId, rdi.hid.dwProductId, devName); -#endif - if (SDL_strstr(devName, "IG_") != NULL) { - SDL_bool found = SDL_FALSE; - for (j = 0; j < SDL_arraysize(s_arrXInputDevicePath); ++j) { - if (!s_arrXInputDevicePath[j]) { - continue; - } - if (SDL_strcmp(devName, s_arrXInputDevicePath[j]) == 0) { - found = SDL_TRUE; - break; - } - } - if (found) { - /* We already have this device in our XInput device list */ - continue; - } - - /* We don't actually know if this is the right device for this - * userid, but we'll record it so we'll at least be consistent - * when the raw device list changes. - */ - if (rdi.hid.dwVendorId == USB_VENDOR_VALVE && - rdi.hid.dwProductId == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { - /* Steam encodes the real device in the path */ - int realVID = rdi.hid.dwVendorId; - int realPID = rdi.hid.dwProductId; - SDL_sscanf(devName, "\\\\.\\pipe\\HID#VID_045E&PID_028E&IG_00#%x&%x&", &realVID, &realPID); - *pVID = (Uint16)realVID; - *pPID = (Uint16)realPID; - *pVersion = 0; - } else { - *pVID = (Uint16)rdi.hid.dwVendorId; - *pPID = (Uint16)rdi.hid.dwProductId; - *pVersion = (Uint16)rdi.hid.dwVersionNumber; - } - if (s_arrXInputDevicePath[userid]) { - SDL_free(s_arrXInputDevicePath[userid]); - } - s_arrXInputDevicePath[userid] = SDL_strdup(devName); - SDL_free(devices); - return; - } - } + if (XINPUTGETCAPABILITIESEX && + XINPUTGETCAPABILITIESEX(1, userid, 0, &capabilities) == ERROR_SUCCESS && + capabilities.VendorId == USB_VENDOR_VALVE && + capabilities.ProductId == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD) { + return (int)capabilities.unk2; } - SDL_free(devices); -#endif /* !__WINRT__ */ - - /* The device wasn't in the raw HID device list, it's probably Bluetooth */ - *pVID = 0x045e; /* Microsoft */ - *pPID = 0x02fd; /* XBox One S Bluetooth */ - *pVersion = 0; + return -1; } -static void -AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) +static void AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) { + const char *name = NULL; Uint16 vendor = 0; Uint16 product = 0; Uint16 version = 0; JoyStick_DeviceData *pPrevJoystick = NULL; JoyStick_DeviceData *pNewJoystick = *pContext; - if (SDL_XInputUseOldJoystickMapping() && SubType != XINPUT_DEVSUBTYPE_GAMEPAD) +#ifdef SDL_JOYSTICK_RAWINPUT + if (RAWINPUT_IsEnabled()) { + /* The raw input driver handles more than 4 controllers, so prefer that when available */ + /* We do this check here rather than at the top of SDL_XINPUT_JoystickDetect() because + we need to check XInput state before RAWINPUT gets a hold of the device, otherwise + when a controller is connected via the wireless adapter, it will shut down at the + first subsequent XInput call. This seems like a driver stack bug? + + Reference: https://github.com/libsdl-org/SDL/issues/3468 + */ + return; + } +#endif + + if (SDL_XInputUseOldJoystickMapping() && SubType != XINPUT_DEVSUBTYPE_GAMEPAD) { return; + } - if (SubType == XINPUT_DEVSUBTYPE_UNKNOWN) + if (SubType == XINPUT_DEVSUBTYPE_UNKNOWN) { return; + } while (pNewJoystick) { if (pNewJoystick->bXInputDevice && (pNewJoystick->XInputUserId == userid) && (pNewJoystick->SubType == SubType)) { @@ -265,7 +198,7 @@ AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) pNewJoystick->pNext = SYS_Joystick; SYS_Joystick = pNewJoystick; - return; /* already in the list. */ + return; /* already in the list. */ } pPrevJoystick = pNewJoystick; @@ -277,17 +210,17 @@ AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) return; /* better luck next time? */ } + name = GetXInputName(userid, SubType); + GetXInputDeviceInfo(userid, &vendor, &product, &version); pNewJoystick->bXInputDevice = SDL_TRUE; - pNewJoystick->joystickname = SDL_CreateJoystickName(vendor, product, NULL, GetXInputName(userid, SubType)); + pNewJoystick->joystickname = SDL_CreateJoystickName(vendor, product, NULL, name); if (!pNewJoystick->joystickname) { SDL_free(pNewJoystick); return; /* better luck next time? */ } - SDL_snprintf(pNewJoystick->path, sizeof(pNewJoystick->path), "XInput#%d", userid); + (void)SDL_snprintf(pNewJoystick->path, sizeof(pNewJoystick->path), "XInput#%d", userid); if (!SDL_XInputUseOldJoystickMapping()) { - GuessXInputDevice(userid, &vendor, &product, &version); - - pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, vendor, product, version, pNewJoystick->joystickname, 'x', SubType); + pNewJoystick->guid = SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_USB, vendor, product, version, NULL, name, 'x', SubType); } pNewJoystick->SubType = SubType; pNewJoystick->XInputUserId = userid; @@ -299,7 +232,7 @@ AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) #ifdef SDL_JOYSTICK_HIDAPI /* Since we're guessing about the VID/PID, use a hard-coded VID/PID to represent XInput */ - if (HIDAPI_IsDevicePresent(USB_VENDOR_MICROSOFT, USB_PRODUCT_XBOX_ONE_XINPUT_CONTROLLER, version, pNewJoystick->joystickname)) { + if (HIDAPI_IsDevicePresent(USB_VENDOR_MICROSOFT, USB_PRODUCT_XBOX360_XUSB_CONTROLLER, version, pNewJoystick->joystickname)) { /* The HIDAPI driver is taking care of this device */ SDL_free(pNewJoystick); return; @@ -317,17 +250,7 @@ AddXInputDevice(Uint8 userid, BYTE SubType, JoyStick_DeviceData **pContext) WINDOWS_AddJoystickDevice(pNewJoystick); } -static void -DelXInputDevice(Uint8 userid) -{ - if (s_arrXInputDevicePath[userid]) { - SDL_free(s_arrXInputDevicePath[userid]); - s_arrXInputDevicePath[userid] = NULL; - } -} - -void -SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext) +void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext) { int iuserid; @@ -340,27 +263,12 @@ SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext) const Uint8 userid = (Uint8)iuserid; XINPUT_CAPABILITIES capabilities; if (XINPUTGETCAPABILITIES(userid, XINPUT_FLAG_GAMEPAD, &capabilities) == ERROR_SUCCESS) { - /* Adding a new device, must handle all removes first, or GuessXInputDevice goes terribly wrong (returns - a product/vendor ID that is not even attached to the system) when we get a remove and add on the same tick - (e.g. when disconnecting a device and the OS reassigns which userid an already-attached controller is) - */ - int iuserid2; - for (iuserid2 = iuserid - 1; iuserid2 >= 0; iuserid2--) { - const Uint8 userid2 = (Uint8)iuserid2; - XINPUT_CAPABILITIES capabilities2; - if (XINPUTGETCAPABILITIES(userid2, XINPUT_FLAG_GAMEPAD, &capabilities2) != ERROR_SUCCESS) { - DelXInputDevice(userid2); - } - } AddXInputDevice(userid, capabilities.SubType, pContext); - } else { - DelXInputDevice(userid); } } } -int -SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice) +int SDL_XINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice) { const Uint8 userId = joystickdevice->XInputUserId; XINPUT_CAPABILITIES capabilities; @@ -394,8 +302,7 @@ SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickde return 0; } -static void -UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) +static void UpdateXInputJoystickBatteryInformation(SDL_Joystick *joystick, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) { if (pBatteryInformation->BatteryType != BATTERY_TYPE_UNKNOWN) { SDL_JoystickPowerLevel ePowerLevel = SDL_JOYSTICK_POWER_UNKNOWN; @@ -423,8 +330,7 @@ UpdateXInputJoystickBatteryInformation(SDL_Joystick * joystick, XINPUT_BATTERY_I } } -static void -UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) +static void UpdateXInputJoystickState_OLD(SDL_Joystick *joystick, XINPUT_STATE *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) { static WORD s_XInputButtons[] = { XINPUT_GAMEPAD_DPAD_UP, XINPUT_GAMEPAD_DPAD_DOWN, XINPUT_GAMEPAD_DPAD_LEFT, XINPUT_GAMEPAD_DPAD_RIGHT, @@ -443,15 +349,14 @@ UpdateXInputJoystickState_OLD(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputS SDL_PrivateJoystickAxis(joystick, 4, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger * 65535 / 255) - 32768)); SDL_PrivateJoystickAxis(joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger * 65535 / 255) - 32768)); - for (button = 0; button < SDL_arraysize(s_XInputButtons); ++button) { + for (button = 0; button < (Uint8)SDL_arraysize(s_XInputButtons); ++button) { SDL_PrivateJoystickButton(joystick, button, (wButtons & s_XInputButtons[button]) ? SDL_PRESSED : SDL_RELEASED); } UpdateXInputJoystickBatteryInformation(joystick, pBatteryInformation); } -static void -UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) +static void UpdateXInputJoystickState(SDL_Joystick *joystick, XINPUT_STATE *pXInputState, XINPUT_BATTERY_INFORMATION_EX *pBatteryInformation) { static WORD s_XInputButtons[] = { XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y, @@ -470,7 +375,7 @@ UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState SDL_PrivateJoystickAxis(joystick, 4, ~pXInputState->Gamepad.sThumbRY); SDL_PrivateJoystickAxis(joystick, 5, ((int)pXInputState->Gamepad.bRightTrigger * 257) - 32768); - for (button = 0; button < SDL_arraysize(s_XInputButtons); ++button) { + for (button = 0; button < (Uint8)SDL_arraysize(s_XInputButtons); ++button) { SDL_PrivateJoystickButton(joystick, button, (wButtons & s_XInputButtons[button]) ? SDL_PRESSED : SDL_RELEASED); } @@ -491,8 +396,7 @@ UpdateXInputJoystickState(SDL_Joystick * joystick, XINPUT_STATE_EX *pXInputState UpdateXInputJoystickBatteryInformation(joystick, pBatteryInformation); } -int -SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { XINPUT_VIBRATION XVibration; @@ -508,21 +412,20 @@ SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, return 0; } -Uint32 -SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick) +Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) { return SDL_JOYCAP_RUMBLE; } -void -SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick) +void SDL_XINPUT_JoystickUpdate(SDL_Joystick *joystick) { HRESULT result; - XINPUT_STATE_EX XInputState; + XINPUT_STATE XInputState; XINPUT_BATTERY_INFORMATION_EX XBatteryInformation; - if (!XINPUTGETSTATE) + if (!XINPUTGETSTATE) { return; + } result = XINPUTGETSTATE(joystick->hwdata->userid, &XInputState); if (result == ERROR_DEVICE_NOT_CONNECTED) { @@ -550,15 +453,14 @@ SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick) #endif } -void -SDL_XINPUT_JoystickClose(SDL_Joystick * joystick) +void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick) { } -void -SDL_XINPUT_JoystickQuit(void) +void SDL_XINPUT_JoystickQuit(void) { if (s_bXInputEnabled) { + s_bXInputEnabled = SDL_FALSE; WIN_UnloadXInputDLL(); } } @@ -577,47 +479,39 @@ SDL_bool SDL_XINPUT_Enabled(void) return SDL_FALSE; } -int -SDL_XINPUT_JoystickInit(void) +int SDL_XINPUT_JoystickInit(void) { return 0; } -void -SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext) +void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext) { } -int -SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice) +int SDL_XINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice) { return SDL_Unsupported(); } -int -SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) +int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { return SDL_Unsupported(); } -Uint32 -SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick) +Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) { return 0; } -void -SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick) +void SDL_XINPUT_JoystickUpdate(SDL_Joystick *joystick) { } -void -SDL_XINPUT_JoystickClose(SDL_Joystick * joystick) +void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick) { } -void -SDL_XINPUT_JoystickQuit(void) +void SDL_XINPUT_JoystickQuit(void) { } diff --git a/src/joystick/windows/SDL_xinputjoystick_c.h b/src/joystick/windows/SDL_xinputjoystick_c.h index 1a8bfdcfe8119..15094b958906c 100644 --- a/src/joystick/windows/SDL_xinputjoystick_c.h +++ b/src/joystick/windows/SDL_xinputjoystick_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,12 +30,13 @@ extern "C" { extern SDL_bool SDL_XINPUT_Enabled(void); extern int SDL_XINPUT_JoystickInit(void); extern void SDL_XINPUT_JoystickDetect(JoyStick_DeviceData **pContext); -extern int SDL_XINPUT_JoystickOpen(SDL_Joystick * joystick, JoyStick_DeviceData *joystickdevice); -extern int SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); -extern Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick * joystick); -extern void SDL_XINPUT_JoystickUpdate(SDL_Joystick * joystick); -extern void SDL_XINPUT_JoystickClose(SDL_Joystick * joystick); +extern int SDL_XINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystickdevice); +extern int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); +extern Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick); +extern void SDL_XINPUT_JoystickUpdate(SDL_Joystick *joystick); +extern void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick); extern void SDL_XINPUT_JoystickQuit(void); +extern int SDL_XINPUT_GetSteamVirtualGamepadSlot(Uint8 userid); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/libm/math_libm.h b/src/libm/math_libm.h index 0bce44f7375c8..cf06850d687e8 100644 --- a/src/libm/math_libm.h +++ b/src/libm/math_libm.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/loadso/dlopen/SDL_sysloadso.c b/src/loadso/dlopen/SDL_sysloadso.c index 3b55a6e81eaa8..b7f341c7d705f 100644 --- a/src/loadso/dlopen/SDL_sysloadso.c +++ b/src/loadso/dlopen/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,36 +30,34 @@ #include "SDL_loadso.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "../../video/uikit/SDL_uikitvideo.h" #endif -void * -SDL_LoadObject(const char *sofile) +void *SDL_LoadObject(const char *sofile) { void *handle; const char *loaderror; -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT if (!UIKit_IsSystemVersionAtLeast(8.0)) { SDL_SetError("SDL_LoadObject requires iOS 8+"); return NULL; } #endif - handle = dlopen(sofile, RTLD_NOW|RTLD_LOCAL); + handle = dlopen(sofile, RTLD_NOW | RTLD_LOCAL); loaderror = dlerror(); - if (handle == NULL) { + if (!handle) { SDL_SetError("Failed loading %s: %s", sofile, loaderror); } - return (handle); + return handle; } -void * -SDL_LoadFunction(void *handle, const char *name) +void *SDL_LoadFunction(void *handle, const char *name) { void *symbol = dlsym(handle, name); - if (symbol == NULL) { + if (!symbol) { /* prepend an underscore for platforms that need that. */ SDL_bool isstack; size_t len = SDL_strlen(name) + 1; @@ -68,18 +66,17 @@ SDL_LoadFunction(void *handle, const char *name) SDL_memcpy(&_name[1], name, len); symbol = dlsym(handle, _name); SDL_small_free(_name, isstack); - if (symbol == NULL) { + if (!symbol) { SDL_SetError("Failed loading %s: %s", name, - (const char *) dlerror()); + (const char *)dlerror()); } } - return (symbol); + return symbol; } -void -SDL_UnloadObject(void *handle) +void SDL_UnloadObject(void *handle) { - if (handle != NULL) { + if (handle) { dlclose(handle); } } diff --git a/src/loadso/dummy/SDL_sysloadso.c b/src/loadso/dummy/SDL_sysloadso.c index da45a842fa744..a21b15014cd82 100644 --- a/src/loadso/dummy/SDL_sysloadso.c +++ b/src/loadso/dummy/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,24 +27,21 @@ #include "SDL_loadso.h" -void * -SDL_LoadObject(const char *sofile) +void *SDL_LoadObject(const char *sofile) { const char *loaderror = "SDL_LoadObject() not implemented"; SDL_SetError("Failed loading %s: %s", sofile, loaderror); - return (NULL); + return NULL; } -void * -SDL_LoadFunction(void *handle, const char *name) +void *SDL_LoadFunction(void *handle, const char *name) { const char *loaderror = "SDL_LoadFunction() not implemented"; SDL_SetError("Failed loading %s: %s", name, loaderror); - return (NULL); + return NULL; } -void -SDL_UnloadObject(void *handle) +void SDL_UnloadObject(void *handle) { /* no-op. */ } diff --git a/src/loadso/os2/SDL_sysloadso.c b/src/loadso/os2/SDL_sysloadso.c index 292196ecbbb5f..f55631d2e4282 100644 --- a/src/loadso/os2/SDL_sysloadso.c +++ b/src/loadso/os2/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,8 +32,7 @@ #define INCL_DOSERRORS #include -void * -SDL_LoadObject(const char *sofile) +void *SDL_LoadObject(const char *sofile) { ULONG ulRC; HMODULE hModule; @@ -65,8 +64,7 @@ SDL_LoadObject(const char *sofile) return (void *)hModule; } -void * -SDL_LoadFunction(void *handle, const char *name) +void *SDL_LoadFunction(void *handle, const char *name) { ULONG ulRC; PFN pFN; @@ -90,10 +88,9 @@ SDL_LoadFunction(void *handle, const char *name) return (void *)pFN; } -void -SDL_UnloadObject(void *handle) +void SDL_UnloadObject(void *handle) { - if (handle != NULL) { + if (handle) { DosFreeModule((HMODULE)handle); } } diff --git a/src/loadso/windows/SDL_sysloadso.c b/src/loadso/windows/SDL_sysloadso.c index 1157ed3b50174..8ee6ee8f96d61 100644 --- a/src/loadso/windows/SDL_sysloadso.c +++ b/src/loadso/windows/SDL_sysloadso.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,30 +29,29 @@ #include "SDL_loadso.h" -void * -SDL_LoadObject(const char *sofile) +void *SDL_LoadObject(const char *sofile) { void *handle; - LPTSTR tstr; + LPWSTR wstr; if (!sofile) { SDL_InvalidParamError("sofile"); return NULL; } - tstr = WIN_UTF8ToString(sofile); + wstr = WIN_UTF8ToStringW(sofile); #ifdef __WINRT__ /* WinRT only publicly supports LoadPackagedLibrary() for loading .dll files. LoadLibrary() is a private API, and not available for apps (that can be published to MS' Windows Store.) */ - handle = (void *) LoadPackagedLibrary(tstr, 0); + handle = (void *)LoadPackagedLibrary(wstr, 0); #else - handle = (void *) LoadLibrary(tstr); + handle = (void *)LoadLibraryW(wstr); #endif - SDL_free(tstr); + SDL_free(wstr); /* Generate an error message if all loads failed */ - if (handle == NULL) { + if (!handle) { char errbuf[512]; SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf)); SDL_strlcat(errbuf, sofile, SDL_arraysize(errbuf)); @@ -61,11 +60,10 @@ SDL_LoadObject(const char *sofile) return handle; } -void * -SDL_LoadFunction(void *handle, const char *name) +void *SDL_LoadFunction(void *handle, const char *name) { - void *symbol = (void *) GetProcAddress((HMODULE) handle, name); - if (symbol == NULL) { + void *symbol = (void *)GetProcAddress((HMODULE)handle, name); + if (!symbol) { char errbuf[512]; SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf)); SDL_strlcat(errbuf, name, SDL_arraysize(errbuf)); @@ -74,11 +72,10 @@ SDL_LoadFunction(void *handle, const char *name) return symbol; } -void -SDL_UnloadObject(void *handle) +void SDL_UnloadObject(void *handle) { - if (handle != NULL) { - FreeLibrary((HMODULE) handle); + if (handle) { + FreeLibrary((HMODULE)handle); } } diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index 5aaf872846aa8..f80fd63436ad8 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,10 +23,9 @@ #include "SDL_syslocale.h" #include "SDL_hints.h" -static SDL_Locale * -build_locales_from_csv_string(char *csv) +static SDL_Locale *build_locales_from_csv_string(char *csv) { - size_t num_locales = 1; /* at least one */ + size_t num_locales = 1; /* at least one */ size_t slen; size_t alloclen; char *ptr; @@ -34,7 +33,7 @@ build_locales_from_csv_string(char *csv) SDL_Locale *retval; if (!csv || !csv[0]) { - return NULL; /* nothing to report */ + return NULL; /* nothing to report */ } for (ptr = csv; *ptr; ptr++) { @@ -43,21 +42,24 @@ build_locales_from_csv_string(char *csv) } } - num_locales++; /* one more for terminator */ + num_locales++; /* one more for terminator */ - slen = ((size_t) (ptr - csv)) + 1; /* SDL_strlen(csv) + 1 */ - alloclen = slen + (num_locales * sizeof (SDL_Locale)); + slen = ((size_t)(ptr - csv)) + 1; /* SDL_strlen(csv) + 1 */ + alloclen = slen + (num_locales * sizeof(SDL_Locale)); - loc = retval = (SDL_Locale *) SDL_calloc(1, alloclen); + loc = retval = (SDL_Locale *)SDL_calloc(1, alloclen); if (!retval) { SDL_OutOfMemory(); - return NULL; /* oh well */ + return NULL; /* oh well */ } - ptr = (char *) (retval + num_locales); + ptr = (char *)(retval + num_locales); SDL_strlcpy(ptr, csv, slen); - while (SDL_TRUE) { /* parse out the string */ - while (*ptr == ' ') ptr++; /* skip whitespace. */ + while (SDL_TRUE) { /* parse out the string */ + while (*ptr == ' ') { + ptr++; /* skip whitespace. */ + } + if (*ptr == '\0') { break; } @@ -68,7 +70,7 @@ build_locales_from_csv_string(char *csv) *(ptr++) = '\0'; loc->country = ptr; } else if (ch == ' ') { - *(ptr++) = '\0'; /* trim ending whitespace and keep going. */ + *(ptr++) = '\0'; /* trim ending whitespace and keep going. */ } else if (ch == ',') { *(ptr++) = '\0'; loc++; @@ -77,7 +79,7 @@ build_locales_from_csv_string(char *csv) loc++; break; } else { - ptr++; /* just keep going, still a valid string */ + ptr++; /* just keep going, still a valid string */ } } } @@ -85,19 +87,17 @@ build_locales_from_csv_string(char *csv) return retval; } -SDL_Locale * -SDL_GetPreferredLocales(void) +SDL_Locale *SDL_GetPreferredLocales(void) { - char locbuf[128]; /* enough for 21 "xx_YY," language strings. */ + char locbuf[128]; /* enough for 21 "xx_YY," language strings. */ const char *hint = SDL_GetHint(SDL_HINT_PREFERRED_LOCALES); if (hint) { - SDL_strlcpy(locbuf, hint, sizeof (locbuf)); + SDL_strlcpy(locbuf, hint, sizeof(locbuf)); } else { SDL_zeroa(locbuf); - SDL_SYS_GetPreferredLocales(locbuf, sizeof (locbuf)); + SDL_SYS_GetPreferredLocales(locbuf, sizeof(locbuf)); } return build_locales_from_csv_string(locbuf); } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/SDL_syslocale.h b/src/locale/SDL_syslocale.h index 8263139710cd7..fb163ee8b4b97 100644 --- a/src/locale/SDL_syslocale.h +++ b/src/locale/SDL_syslocale.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/locale/android/SDL_syslocale.c b/src/locale/android/SDL_syslocale.c index ed969b8dde01f..5724eb74bfe07 100644 --- a/src/locale/android/SDL_syslocale.c +++ b/src/locale/android/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,11 +23,9 @@ #include "../SDL_syslocale.h" #include "../../core/android/SDL_android.h" -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { Android_JNI_GetLocale(buf, buflen); } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/dummy/SDL_syslocale.c b/src/locale/dummy/SDL_syslocale.c index e5ed1ad13bd3a..d852d8284330c 100644 --- a/src/locale/dummy/SDL_syslocale.c +++ b/src/locale/dummy/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,12 +22,10 @@ #include "../../SDL_internal.h" #include "../SDL_syslocale.h" -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { /* dummy implementation. Caller already zero'd out buffer. */ SDL_Unsupported(); } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/emscripten/SDL_syslocale.c b/src/locale/emscripten/SDL_syslocale.c index 98d3c03533d1a..6972294bbdcce 100644 --- a/src/locale/emscripten/SDL_syslocale.c +++ b/src/locale/emscripten/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,9 @@ #include "../../SDL_internal.h" #include "../SDL_syslocale.h" -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { + /* *INDENT-OFF* */ /* clang-format off */ EM_ASM({ var buf = $0; var buflen = $1; @@ -66,7 +66,7 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) setValue(buf + i, str.charCodeAt(i), "i8"); /* fill in C array. */ } }, buf, buflen); + /* *INDENT-ON* */ /* clang-format on */ } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/haiku/SDL_syslocale.cc b/src/locale/haiku/SDL_syslocale.cc index 1f885b023be07..619a8fb143cfe 100644 --- a/src/locale/haiku/SDL_syslocale.cc +++ b/src/locale/haiku/SDL_syslocale.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,8 +26,7 @@ #include "../../SDL_internal.h" #include "../SDL_syslocale.h" -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { BLocaleRoster *roster = BLocaleRoster::Default(); roster->Refresh(); diff --git a/src/locale/macosx/SDL_syslocale.m b/src/locale/macosx/SDL_syslocale.m index 0e6bd3634c94e..426599a9f5bd6 100644 --- a/src/locale/macosx/SDL_syslocale.m +++ b/src/locale/macosx/SDL_syslocale.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,53 +24,54 @@ #import -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) -{ @autoreleasepool { - NSArray *languages = NSLocale.preferredLanguages; - size_t numlangs = 0; - size_t i; +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +{ + @autoreleasepool { + NSArray *languages = NSLocale.preferredLanguages; + size_t numlangs = 0; + size_t i; - numlangs = (size_t) [languages count]; + numlangs = (size_t)[languages count]; - for (i = 0; i < numlangs; i++) { - NSString *nsstr = [languages objectAtIndex:i]; - size_t len; - char *ptr; + for (i = 0; i < numlangs; i++) { + NSString *nsstr = [languages objectAtIndex:i]; + size_t len; + char *ptr; - if (nsstr == nil) { - break; - } - - [nsstr getCString:buf maxLength:buflen encoding:NSASCIIStringEncoding]; - len = SDL_strlen(buf); + if (nsstr == nil) { + break; + } - // convert '-' to '_'... - // These are always full lang-COUNTRY, so we search from the back, - // so things like zh-Hant-CN find the right '-' to convert. - if ((ptr = SDL_strrchr(buf, '-')) != NULL) { - *ptr = '_'; - } + [nsstr getCString:buf maxLength:buflen encoding:NSASCIIStringEncoding]; + len = SDL_strlen(buf); - if (buflen <= len) { - *buf = '\0'; // drop this one and stop, we can't fit anymore. - break; - } + // convert '-' to '_'... + // These are always full lang-COUNTRY, so we search from the back, + // so things like zh-Hant-CN find the right '-' to convert. + ptr = SDL_strrchr(buf, '-'); + if (ptr != NULL) { + *ptr = '_'; + } - buf += len; - buflen -= len; + if (buflen <= len) { + *buf = '\0'; // drop this one and stop, we can't fit anymore. + break; + } - if (i < (numlangs - 1)) { - if (buflen <= 1) { - break; // out of room, stop looking. + buf += len; + buflen -= len; + + if (i < (numlangs - 1)) { + if (buflen <= 1) { + break; // out of room, stop looking. + } + buf[0] = ','; // add a comma between entries. + buf[1] = '\0'; + buf++; + buflen--; } - buf[0] = ','; // add a comma between entries. - buf[1] = '\0'; - buf++; - buflen--; } } -}} +} /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/n3ds/SDL_syslocale.c b/src/locale/n3ds/SDL_syslocale.c index bcfec8f1d732e..38453447674ab 100644 --- a/src/locale/n3ds/SDL_syslocale.c +++ b/src/locale/n3ds/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,12 +29,11 @@ SDL_FORCE_INLINE u8 GetLocaleIndex(void); -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { /* The 3DS only supports these 12 languages, only one can be active at a time */ static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE", - "it_IT", "es_ES", "zn_CN", "ko_KR", + "it_IT", "es_ES", "zh_CN", "ko_KR", "nl_NL", "pt_PT", "ru_RU", "zh_TW" }; u8 current_locale = GetLocaleIndex(); if (current_locale != BAD_LOCALE) { @@ -46,14 +45,13 @@ SDL_FORCE_INLINE u8 GetLocaleIndex(void) { u8 current_locale; + Result result; if (R_FAILED(cfguInit())) { return BAD_LOCALE; } - if (R_FAILED(CFGU_GetSystemLanguage(¤t_locale))) { - return BAD_LOCALE; - } + result = CFGU_GetSystemLanguage(¤t_locale); cfguExit(); - return current_locale; + return R_SUCCEEDED(result) ? current_locale : BAD_LOCALE; } /* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/src/locale/psp/SDL_syslocale.c b/src/locale/psp/SDL_syslocale.c new file mode 100644 index 0000000000000..983df761d9d8f --- /dev/null +++ b/src/locale/psp/SDL_syslocale.c @@ -0,0 +1,77 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../../SDL_internal.h" +#include "../SDL_syslocale.h" + +#include + +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +{ + int current_locale_int = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH; + + SDL_assert(buflen > 0); + + sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, ¤t_locale_int); + switch(current_locale_int) { + case PSP_SYSTEMPARAM_LANGUAGE_JAPANESE: + SDL_strlcpy(buf, "ja_JP", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_ENGLISH: + SDL_strlcpy(buf, "en_US", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_FRENCH: + SDL_strlcpy(buf, "fr_FR", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_SPANISH: + SDL_strlcpy(buf, "es_ES", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_GERMAN: + SDL_strlcpy(buf, "de_DE", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_ITALIAN: + SDL_strlcpy(buf, "it_IT", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_DUTCH: + SDL_strlcpy(buf, "nl_NL", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE: + SDL_strlcpy(buf, "pt_PT", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN: + SDL_strlcpy(buf, "ru_RU", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_KOREAN: + SDL_strlcpy(buf, "ko_KR", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL: + SDL_strlcpy(buf, "zh_TW", buflen); + break; + case PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED: + SDL_strlcpy(buf, "zh_CN", buflen); + break; + default: + SDL_strlcpy(buf, "en_US", buflen); + break; + } +} + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/locale/unix/SDL_syslocale.c b/src/locale/unix/SDL_syslocale.c index b9a377439478f..146381efcdca7 100644 --- a/src/locale/unix/SDL_syslocale.c +++ b/src/locale/unix/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,18 +22,17 @@ #include "../../SDL_internal.h" #include "../SDL_syslocale.h" -static void -normalize_locale_str(char *dst, char *str, size_t buflen) +static void normalize_locale_str(char *dst, char *str, size_t buflen) { char *ptr; - ptr = SDL_strchr(str, '.'); /* chop off encoding if specified. */ - if (ptr != NULL) { + ptr = SDL_strchr(str, '.'); /* chop off encoding if specified. */ + if (ptr) { *ptr = '\0'; } - ptr = SDL_strchr(str, '@'); /* chop off extra bits if specified. */ - if (ptr != NULL) { + ptr = SDL_strchr(str, '@'); /* chop off extra bits if specified. */ + if (ptr) { *ptr = '\0'; } @@ -44,14 +43,13 @@ normalize_locale_str(char *dst, char *str, size_t buflen) if (*str) { if (*dst) { - SDL_strlcat(dst, ",", buflen); /* SDL has these split by commas */ + SDL_strlcat(dst, ",", buflen); /* SDL has these split by commas */ } SDL_strlcat(dst, str, buflen); } } -static void -normalize_locales(char *dst, char *src, size_t buflen) +static void normalize_locales(char *dst, char *src, size_t buflen) { char *ptr; @@ -64,8 +62,7 @@ normalize_locales(char *dst, char *src, size_t buflen) normalize_locale_str(dst, src, buflen); } -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { /* !!! FIXME: should we be using setlocale()? Or some D-Bus thing? */ SDL_bool isstack; @@ -106,4 +103,3 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/vita/SDL_syslocale.c b/src/locale/vita/SDL_syslocale.c index 0a057cbfacc77..76cba99e4f55a 100644 --- a/src/locale/vita/SDL_syslocale.c +++ b/src/locale/vita/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,8 +25,7 @@ #include #include -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { const char *vita_locales[] = { "ja_JP", @@ -59,8 +58,9 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) sceAppUtilInit(&initParam, &bootParam); sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG, &language); - if (language < 0 || language > SCE_SYSTEM_PARAM_LANG_TURKISH) + if (language < 0 || language > SCE_SYSTEM_PARAM_LANG_TURKISH) { language = SCE_SYSTEM_PARAM_LANG_ENGLISH_US; // default to english + } SDL_strlcpy(buf, vita_locales[language], buflen); @@ -68,4 +68,3 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/windows/SDL_syslocale.c b/src/locale/windows/SDL_syslocale.c index 2d033f476b4c9..52766bd811533 100644 --- a/src/locale/windows/SDL_syslocale.c +++ b/src/locale/windows/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #include "../../core/windows/SDL_windows.h" #include "../SDL_syslocale.h" -typedef BOOL (WINAPI *pfnGetUserPreferredUILanguages)(DWORD,PULONG,WCHAR*,PULONG); +typedef BOOL(WINAPI *pfnGetUserPreferredUILanguages)(DWORD, PULONG, WCHAR *, PULONG); #ifndef MUI_LANGUAGE_NAME #define MUI_LANGUAGE_NAME 0x8 #endif @@ -31,33 +31,30 @@ typedef BOOL (WINAPI *pfnGetUserPreferredUILanguages)(DWORD,PULONG,WCHAR*,PULONG static pfnGetUserPreferredUILanguages pGetUserPreferredUILanguages = NULL; static HMODULE kernel32 = 0; - /* this is the fallback for WinXP...one language, not a list. */ -static void -SDL_SYS_GetPreferredLocales_winxp(char *buf, size_t buflen) +static void SDL_SYS_GetPreferredLocales_winxp(char *buf, size_t buflen) { char lang[16]; char country[16]; const int langrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, - lang, sizeof (lang)); + lang, sizeof(lang)); - const int ctryrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, - LOCALE_SISO3166CTRYNAME, - country, sizeof (country)); + const int ctryrc = GetLocaleInfoA(LOCALE_USER_DEFAULT, + LOCALE_SISO3166CTRYNAME, + country, sizeof(country)); /* Win95 systems will fail, because they don't have LOCALE_SISO*NAME ... */ if (langrc == 0) { SDL_SetError("Couldn't obtain language info"); } else { - SDL_snprintf(buf, buflen, "%s%s%s", lang, ctryrc ? "_" : "", ctryrc ? country : ""); + (void)SDL_snprintf(buf, buflen, "%s%s%s", lang, ctryrc ? "_" : "", ctryrc ? country : ""); } } /* this works on Windows Vista and later. */ -static void -SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen) +static void SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen) { ULONG numlangs = 0; WCHAR *wbuf = NULL; @@ -74,44 +71,42 @@ SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen) } if (!pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, wbuf, &wbuflen)) { - SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* oh well, try the fallback. */ + SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* oh well, try the fallback. */ } else { - const ULONG endidx = (ULONG) SDL_min(buflen, wbuflen - 1); + const ULONG endidx = (ULONG)SDL_min(buflen, wbuflen - 1); ULONG str_start = 0; ULONG i; for (i = 0; i < endidx; i++) { - const char ch = (char) wbuf[i]; /* these should all be low-ASCII, safe to cast */ + const char ch = (char)wbuf[i]; /* these should all be low-ASCII, safe to cast */ if (ch == '\0') { - buf[i] = ','; /* change null separators to commas */ + buf[i] = ','; /* change null separators to commas */ str_start = i; } else if (ch == '-') { - buf[i] = '_'; /* change '-' to '_' */ + buf[i] = '_'; /* change '-' to '_' */ } else { - buf[i] = ch; /* copy through as-is. */ + buf[i] = ch; /* copy through as-is. */ } } - buf[str_start] = '\0'; /* terminate string, chop off final ',' */ + buf[str_start] = '\0'; /* terminate string, chop off final ',' */ } SDL_small_free(wbuf, isstack); } -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { if (!kernel32) { kernel32 = GetModuleHandle(TEXT("kernel32.dll")); if (kernel32) { - pGetUserPreferredUILanguages = (pfnGetUserPreferredUILanguages) GetProcAddress(kernel32, "GetUserPreferredUILanguages"); + pGetUserPreferredUILanguages = (pfnGetUserPreferredUILanguages)GetProcAddress(kernel32, "GetUserPreferredUILanguages"); } } - if (pGetUserPreferredUILanguages == NULL) { - SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* this is always available */ + if (!pGetUserPreferredUILanguages) { + SDL_SYS_GetPreferredLocales_winxp(buf, buflen); /* this is always available */ } else { - SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */ + SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */ } } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/locale/winrt/SDL_syslocale.c b/src/locale/winrt/SDL_syslocale.c index 1af2a95fcb879..3cd7420f5013d 100644 --- a/src/locale/winrt/SDL_syslocale.c +++ b/src/locale/winrt/SDL_syslocale.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,32 +27,29 @@ /*using namespace Windows::Graphics::Display;*/ #include -void -SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) +void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) { WCHAR wbuffer[128] = L""; int ret = 0; /* !!! FIXME: do we not have GetUserPreferredUILanguages on WinPhone or UWP? */ -# if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE ret = GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_SNAME, wbuffer, SDL_arraysize(wbuffer)); -# else +#else ret = GetSystemDefaultLocaleName(wbuffer, SDL_arraysize(wbuffer)); -# endif +#endif - if (ret > 0) - { + if (ret > 0) { /* Need to convert LPWSTR to LPSTR, that is wide char to char. */ int i; - if ( ((size_t) ret) >= (buflen - 1) ) { - ret = (int) (buflen - 1); + if (((size_t)ret) >= (buflen - 1)) { + ret = (int)(buflen - 1); } for (i = 0; i < ret; i++) { - buf[i] = (char) wbuffer[i]; /* assume this was ASCII anyhow. */ + buf[i] = (char)wbuffer[i]; /* assume this was ASCII anyhow. */ } } } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/main/dummy/SDL_dummy_main.c b/src/main/dummy/SDL_dummy_main.c index b78d8db140467..097b210d76647 100644 --- a/src/main/dummy/SDL_dummy_main.c +++ b/src/main/dummy/SDL_dummy_main.c @@ -8,15 +8,13 @@ #ifdef main #undef main -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { - return (SDL_main(argc, argv)); + return SDL_main(argc, argv); } #else /* Nothing to do on this platform */ -int -SDL_main_stub_symbol(void) +int SDL_main_stub_symbol(void) { return 0; } diff --git a/src/main/gdk/SDL_gdk_main.c b/src/main/gdk/SDL_gdk_main.c index 4a25bbb18c5cb..03383b2e5e866 100644 --- a/src/main/gdk/SDL_gdk_main.c +++ b/src/main/gdk/SDL_gdk_main.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include "SDL_main.h" #ifdef main -# undef main +#undef main #endif /* main */ /* This is where execution begins */ diff --git a/src/main/haiku/SDL_BApp.h b/src/main/haiku/SDL_BApp.h index 215f83662a084..60272193faab2 100644 --- a/src/main/haiku/SDL_BApp.h +++ b/src/main/haiku/SDL_BApp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,12 @@ #include #include #include -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL #include #endif #include "../../video/haiku/SDL_bkeyboard.h" - #ifdef __cplusplus extern "C" { #endif @@ -49,28 +48,27 @@ extern "C" { #include - - - /* Forward declarations */ +class SDL_BLooper; class SDL_BWin; /* Message constants */ -enum ToSDL { +enum ToSDL +{ /* Intercepted by BWindow on its way to BView */ BAPP_MOUSE_MOVED, BAPP_MOUSE_BUTTON, BAPP_MOUSE_WHEEL, BAPP_KEY, - BAPP_REPAINT, /* from _UPDATE_ */ + BAPP_REPAINT, /* from _UPDATE_ */ /* From BWindow */ - BAPP_MAXIMIZE, /* from B_ZOOM */ + BAPP_MAXIMIZE, /* from B_ZOOM */ BAPP_MINIMIZE, - BAPP_RESTORE, /* TODO: IMPLEMENT! */ + BAPP_RESTORE, /* TODO: IMPLEMENT! */ BAPP_SHOW, BAPP_HIDE, - BAPP_MOUSE_FOCUS, /* caused by MOUSE_MOVE */ - BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */ + BAPP_MOUSE_FOCUS, /* caused by MOUSE_MOVE */ + BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */ BAPP_WINDOW_CLOSE_REQUESTED, BAPP_WINDOW_MOVED, BAPP_WINDOW_RESIZED, @@ -78,36 +76,29 @@ enum ToSDL { }; +extern "C" SDL_BLooper *SDL_Looper; + -/* Create a descendant of BApplication */ -class SDL_BApp : public BApplication { -public: - SDL_BApp(const char* signature) : - BApplication(signature) { -#if SDL_VIDEO_OPENGL +/* Create a descendant of BLooper */ +class SDL_BLooper : public BLooper +{ + public: + SDL_BLooper(const char* name) : BLooper(name) + { +#ifdef SDL_VIDEO_OPENGL _current_context = NULL; #endif } - - virtual ~SDL_BApp() { + virtual ~SDL_BLooper() + { } - - virtual void RefsReceived(BMessage* message) { - char filePath[512]; - entry_ref entryRef; - for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) { - BPath referencePath = BPath(&entryRef); - SDL_SendDropFile(NULL, referencePath.Path()); - } - return; - } - - /* Event-handling functions */ - virtual void MessageReceived(BMessage* message) { + /* Event-handling functions */ + virtual void MessageReceived(BMessage *message) + { /* Sort out SDL-related messages */ - switch ( message->what ) { + switch (message->what) { case BAPP_MOUSE_MOVED: _HandleMouseMove(message); break; @@ -173,23 +164,24 @@ class SDL_BApp : public BApplication { break; default: - BApplication::MessageReceived(message); - break; + BLooper::MessageReceived(message); + break; } } /* Window creation/destruction methods */ - int32 GetID(SDL_Window *win) { + int32 GetID(SDL_Window *win) + { int32 i; - for(i = 0; i < _GetNumWindowSlots(); ++i) { - if( GetSDLWindow(i) == NULL ) { + for (i = 0; i < _GetNumWindowSlots(); ++i) { + if (GetSDLWindow(i) == NULL) { _SetSDLWindow(win, i); return i; } } /* Expand the vector if all slots are full */ - if( i == _GetNumWindowSlots() ) { + if (i == _GetNumWindowSlots()) { _PushBackWindow(win); return i; } @@ -202,18 +194,20 @@ class SDL_BApp : public BApplication { there another way to do this? */ void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */ - - SDL_Window *GetSDLWindow(int32 winID) { + SDL_Window *GetSDLWindow(int32 winID) + { return _window_map[winID]; } -#if SDL_VIDEO_OPENGL - BGLView *GetCurrentContext() { +#ifdef SDL_VIDEO_OPENGL + BGLView *GetCurrentContext() + { return _current_context; } - - void SetCurrentContext(BGLView *newContext) { - if(_current_context) + + void SetCurrentContext(BGLView *newContext) + { + if (_current_context) _current_context->UnlockGL(); _current_context = newContext; if (_current_context) @@ -221,25 +215,26 @@ class SDL_BApp : public BApplication { } #endif -private: + private: /* Event management */ - void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) { + void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) + { SDL_Window *win; int32 winID; - if( - !_GetWinID(msg, &winID) - ) { + if ( + !_GetWinID(msg, &winID)) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, sdlEventType, 0, 0); } - void _HandleMouseMove(BMessage *msg) { + void _HandleMouseMove(BMessage *msg) + { SDL_Window *win; int32 winID; int32 x = 0, y = 0; - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("x", &x) != B_OK || /* x movement */ msg->FindInt32("y", &y) != B_OK /* y movement */ @@ -266,47 +261,47 @@ class SDL_BApp : public BApplication { } } - void _HandleMouseButton(BMessage *msg) { + void _HandleMouseButton(BMessage *msg) + { SDL_Window *win; int32 winID; - int32 button, state; /* left/middle/right, pressed/released */ - if( + int32 button, state; /* left/middle/right, pressed/released */ + if ( !_GetWinID(msg, &winID) || msg->FindInt32("button-id", &button) != B_OK || - msg->FindInt32("button-state", &state) != B_OK - ) { + msg->FindInt32("button-state", &state) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendMouseButton(win, 0, state, button); } - void _HandleMouseWheel(BMessage *msg) { + void _HandleMouseWheel(BMessage *msg) + { SDL_Window *win; int32 winID; int32 xTicks, yTicks; - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("xticks", &xTicks) != B_OK || - msg->FindInt32("yticks", &yTicks) != B_OK - ) { + msg->FindInt32("yticks", &yTicks) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendMouseWheel(win, 0, xTicks, -yTicks, SDL_MOUSEWHEEL_NORMAL); } - void _HandleKey(BMessage *msg) { - int32 scancode, state; /* scancode, pressed/released */ - if( + void _HandleKey(BMessage *msg) + { + int32 scancode, state; /* scancode, pressed/released */ + if ( msg->FindInt32("key-state", &state) != B_OK || - msg->FindInt32("key-scancode", &scancode) != B_OK - ) { + msg->FindInt32("key-scancode", &scancode) != B_OK) { return; } /* Make sure this isn't a repeated event (key pressed and held) */ - if(state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) { + if (state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) { return; } HAIKU_SetKeyState(scancode, state); @@ -315,7 +310,7 @@ class SDL_BApp : public BApplication { if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { const int8 *keyUtf8; ssize_t count; - if (msg->FindData("key-utf8", B_INT8_TYPE, (const void**)&keyUtf8, &count) == B_OK) { + if (msg->FindData("key-utf8", B_INT8_TYPE, (const void **)&keyUtf8, &count) == B_OK) { char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; SDL_zeroa(text); SDL_memcpy(text, keyUtf8, count); @@ -324,107 +319,108 @@ class SDL_BApp : public BApplication { } } - void _HandleMouseFocus(BMessage *msg) { + void _HandleMouseFocus(BMessage *msg) + { SDL_Window *win; int32 winID; bool bSetFocus; /* If false, lose focus */ - if( + if ( !_GetWinID(msg, &winID) || - msg->FindBool("focusGained", &bSetFocus) != B_OK - ) { + msg->FindBool("focusGained", &bSetFocus) != B_OK) { return; } win = GetSDLWindow(winID); - if(bSetFocus) { + if (bSetFocus) { SDL_SetMouseFocus(win); - } else if(SDL_GetMouseFocus() == win) { + } else if (SDL_GetMouseFocus() == win) { /* Only lose all focus if this window was the current focus */ SDL_SetMouseFocus(NULL); } } - void _HandleKeyboardFocus(BMessage *msg) { + void _HandleKeyboardFocus(BMessage *msg) + { SDL_Window *win; int32 winID; bool bSetFocus; /* If false, lose focus */ - if( + if ( !_GetWinID(msg, &winID) || - msg->FindBool("focusGained", &bSetFocus) != B_OK - ) { + msg->FindBool("focusGained", &bSetFocus) != B_OK) { return; } win = GetSDLWindow(winID); - if(bSetFocus) { + if (bSetFocus) { SDL_SetKeyboardFocus(win); - } else if(SDL_GetKeyboardFocus() == win) { + } else if (SDL_GetKeyboardFocus() == win) { /* Only lose all focus if this window was the current focus */ SDL_SetKeyboardFocus(NULL); } } - void _HandleWindowMoved(BMessage *msg) { + void _HandleWindowMoved(BMessage *msg) + { SDL_Window *win; int32 winID; int32 xPos, yPos; /* Get the window id and new x/y position of the window */ - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("window-x", &xPos) != B_OK || - msg->FindInt32("window-y", &yPos) != B_OK - ) { + msg->FindInt32("window-y", &yPos) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos); } - void _HandleWindowResized(BMessage *msg) { + void _HandleWindowResized(BMessage *msg) + { SDL_Window *win; int32 winID; int32 w, h; /* Get the window id ]and new x/y position of the window */ - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("window-w", &w) != B_OK || - msg->FindInt32("window-h", &h) != B_OK - ) { + msg->FindInt32("window-h", &h) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h); } - bool _GetWinID(BMessage *msg, int32 *winID) { + bool _GetWinID(BMessage *msg, int32 *winID) + { return msg->FindInt32("window-id", winID) == B_OK; } - - /* Vector functions: Wraps vector stuff in case we need to change implementation */ - void _SetSDLWindow(SDL_Window *win, int32 winID) { + void _SetSDLWindow(SDL_Window *win, int32 winID) + { _window_map[winID] = win; } - int32 _GetNumWindowSlots() { + int32 _GetNumWindowSlots() + { return _window_map.size(); } - - void _PopBackWindow() { + void _PopBackWindow() + { _window_map.pop_back(); } - void _PushBackWindow(SDL_Window *win) { + void _PushBackWindow(SDL_Window *win) + { _window_map.push_back(win); } - /* Members */ - std::vector _window_map; /* Keeps track of SDL_Windows by index-id */ + std::vector _window_map; /* Keeps track of SDL_Windows by index-id */ -#if SDL_VIDEO_OPENGL - BGLView *_current_context; +#ifdef SDL_VIDEO_OPENGL + BGLView *_current_context; #endif }; diff --git a/src/main/haiku/SDL_BeApp.cc b/src/main/haiku/SDL_BeApp.cc index a5e1428cc0cca..d2a1e354d7008 100644 --- a/src/main/haiku/SDL_BeApp.cc +++ b/src/main/haiku/SDL_BeApp.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,7 +31,7 @@ #include #include -#include "SDL_BApp.h" /* SDL_BApp class definition */ +#include "SDL_BApp.h" /* SDL_BLooper class definition */ #include "SDL_BeApp.h" #include "SDL_timer.h" #include "SDL_error.h" @@ -44,15 +44,40 @@ extern "C" { #include "../../thread/SDL_systhread.h" -/* Flag to tell whether or not the Be application is active or not */ +/* Flag to tell whether or not the Be application and looper are active or not */ static int SDL_BeAppActive = 0; static SDL_Thread *SDL_AppThread = NULL; +SDL_BLooper *SDL_Looper = NULL; + /* Default application signature */ -const char *signature = "application/x-SDL-executable"; +const char *SDL_signature = "application/x-SDL-executable"; + + +/* Create a descendant of BApplication */ +class SDL_BApp : public BApplication { +public: + SDL_BApp(const char* signature) : + BApplication(signature) { + } + -static int -StartBeApp(void *unused) + virtual ~SDL_BApp() { + } + + + virtual void RefsReceived(BMessage* message) { + entry_ref entryRef; + for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) { + BPath referencePath = BPath(&entryRef); + SDL_SendDropFile(NULL, referencePath.Path()); + } + return; + } +}; + + +static int StartBeApp(void *unused) { BApplication *App; @@ -65,48 +90,65 @@ StartBeApp(void *unused) BAppFileInfo app_info(&f); if (app_info.InitCheck() == B_OK) { char sig[B_MIME_TYPE_LENGTH]; - if (app_info.GetSignature(sig) == B_OK) - signature = strndup(sig, B_MIME_TYPE_LENGTH); + if (app_info.GetSignature(sig) == B_OK) { + SDL_signature = strndup(sig, B_MIME_TYPE_LENGTH); + } } } } - App = new SDL_BApp(signature); + App = new SDL_BApp(SDL_signature); App->Run(); delete App; - return (0); + return 0; } -/* Initialize the Be Application, if it's not already started */ -int -SDL_InitBeApp(void) + +static int StartBeLooper() { - /* Create the BApplication that handles appserver interaction */ - if (SDL_BeAppActive <= 0) { + if (!be_app) { SDL_AppThread = SDL_CreateThreadInternal(StartBeApp, "SDLApplication", 0, NULL); - if (SDL_AppThread == NULL) { + if (!SDL_AppThread) { return SDL_SetError("Couldn't create BApplication thread"); } - /* Change working directory to that of executable */ - app_info info; - if (B_OK == be_app->GetAppInfo(&info)) { - entry_ref ref = info.ref; - BEntry entry; - if (B_OK == entry.SetTo(&ref)) { - BPath path; - if (B_OK == path.SetTo(&entry)) { - if (B_OK == path.GetParent(&path)) { - chdir(path.Path()); - } + do { + SDL_Delay(10); + } while ((!be_app) || be_app->IsLaunching()); + } + + /* If started from the GUI, change working directory to that of executable. + * This matches behavior on other platforms and may be needed by some SDL software. + * Don't do it when started from terminal (TERM environment variable is set), because in that + * case, the current directory may be important, and after this there will be no way to know + * what it was. */ + app_info info; + if (NULL == getenv("TERM") && B_OK == be_app->GetAppInfo(&info)) { + entry_ref ref = info.ref; + BEntry entry; + if (B_OK == entry.SetTo(&ref)) { + BPath path; + if (B_OK == path.SetTo(&entry)) { + if (B_OK == path.GetParent(&path)) { + chdir(path.Path()); } } } + } - do { - SDL_Delay(10); - } while ((be_app == NULL) || be_app->IsLaunching()); + SDL_Looper = new SDL_BLooper("SDLLooper"); + SDL_Looper->Run(); + return (0); +} + + +/* Initialize the Be Application, if it's not already started */ +int SDL_InitBeApp(void) +{ + /* Create the BApplication that handles appserver interaction */ + if (SDL_BeAppActive <= 0) { + StartBeLooper(); /* Mark the application active */ SDL_BeAppActive = 0; @@ -116,19 +158,21 @@ SDL_InitBeApp(void) ++SDL_BeAppActive; /* The app is running, and we're ready to go */ - return (0); + return 0; } /* Quit the Be Application, if there's nothing left to do */ -void -SDL_QuitBeApp(void) +void SDL_QuitBeApp(void) { /* Decrement the application reference count */ --SDL_BeAppActive; /* If the reference count reached zero, clean up the app */ if (SDL_BeAppActive == 0) { - if (SDL_AppThread != NULL) { + SDL_Looper->Lock(); + SDL_Looper->Quit(); + SDL_Looper = NULL; + if (SDL_AppThread) { if (be_app != NULL) { /* Not tested */ be_app->PostMessage(B_QUIT_REQUESTED); } @@ -144,10 +188,10 @@ SDL_QuitBeApp(void) #endif /* SDL_BApp functions */ -void SDL_BApp::ClearID(SDL_BWin *bwin) { +void SDL_BLooper::ClearID(SDL_BWin *bwin) { _SetSDLWindow(NULL, bwin->GetID()); int32 i = _GetNumWindowSlots() - 1; - while(i >= 0 && GetSDLWindow(i) == NULL) { + while (i >= 0 && GetSDLWindow(i) == NULL) { _PopBackWindow(); --i; } diff --git a/src/main/haiku/SDL_BeApp.h b/src/main/haiku/SDL_BeApp.h index 5b74466e0865d..f35b22cec4d54 100644 --- a/src/main/haiku/SDL_BeApp.h +++ b/src/main/haiku/SDL_BeApp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ extern int SDL_InitBeApp(void); extern void SDL_QuitBeApp(void); /* Be Application Signature*/ -extern const char *signature; +extern const char *SDL_signature; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/main/n3ds/SDL_n3ds_main.c b/src/main/n3ds/SDL_n3ds_main.c index 1ccd014803f30..82f7754da98ea 100644 --- a/src/main/n3ds/SDL_n3ds_main.c +++ b/src/main/n3ds/SDL_n3ds_main.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,8 +33,7 @@ SDL_FORCE_INLINE void N3DS_Init(void); SDL_FORCE_INLINE void N3DS_Quit(void); -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int result; N3DS_Init(); diff --git a/src/main/nacl/SDL_nacl_main.c b/src/main/nacl/SDL_nacl_main.c index a0838b184b802..3e55c1a0db1fe 100644 --- a/src/main/nacl/SDL_nacl_main.c +++ b/src/main/nacl/SDL_nacl_main.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL /* Include the SDL main definition header */ #include "SDL_main.h" @@ -33,20 +33,19 @@ extern void NACL_SetScreenResolution(int width, int height, Uint32 format); -int -nacl_main(int argc, char *argv[]) +int nacl_main(int argc, char *argv[]) { int status; PSEvent* ps_event; - PP_Resource event; + PP_Resource event; struct PP_Rect rect; int ready = 0; const PPB_View *ppb_view = PSInterfaceView(); - + /* This is started in a worker thread by ppapi_simple! */ - + /* Wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before starting the app */ - + PSEventSetFilter(PSE_INSTANCE_DIDCHANGEVIEW); while (!ready) { /* Process all waiting events without blocking */ @@ -65,13 +64,13 @@ nacl_main(int argc, char *argv[]) PSEventRelease(ps_event); } } - - /* Do a default httpfs mount on /, - * apps can override this by unmounting / + + /* Do a default httpfs mount on /, + * apps can override this by unmounting / * and remounting with the desired configuration */ nacl_io_init_ppapi(PSGetInstanceId(), PSGetInterface); - + umount("/"); mount( "", /* source */ @@ -79,7 +78,7 @@ nacl_main(int argc, char *argv[]) "httpfs", /* filesystemtype */ 0, /* mountflags */ ""); /* data specific to the html5fs type */ - + /* Everything is ready, start the user main function */ SDL_SetMainReady(); status = SDL_main(argc, argv); diff --git a/src/main/ngage/SDL_ngage_main.cpp b/src/main/ngage/SDL_ngage_main.cpp index 6dbf2f1416861..7439a2fd12a5d 100644 --- a/src/main/ngage/SDL_ngage_main.cpp +++ b/src/main/ngage/SDL_ngage_main.cpp @@ -23,17 +23,17 @@ extern "C" int main(int argc, char *argv[]); TInt E32Main() { /* Get the clean-up stack */ - CTrapCleanup* cleanup = CTrapCleanup::New(); + CTrapCleanup *cleanup = CTrapCleanup::New(); /* Arrange for multi-threaded operation */ SpawnPosixServerThread(); /* Get args and environment */ - int argc = 0; - char** argv = 0; - char** envp = 0; + int argc = 0; + char **argv = 0; + char **envp = 0; - __crt0(argc,argv,envp); + __crt0(argc, argv, envp); /* Start the application! */ @@ -42,29 +42,26 @@ TInt E32Main() /* Set process and thread priority and name */ - RThread currentThread; + RThread currentThread; RProcess thisProcess; - TParse exeName; + TParse exeName; exeName.Set(thisProcess.FileName(), NULL, NULL); currentThread.Rename(exeName.Name()); currentThread.SetProcessPriority(EPriorityLow); currentThread.SetPriority(EPriorityMuchLess); /* Increase heap size */ - RHeap* newHeap = NULL; - RHeap* oldHeap = NULL; - TInt heapSize = 7500000; - int ret; + RHeap *newHeap = NULL; + RHeap *oldHeap = NULL; + TInt heapSize = 7500000; + int ret; newHeap = User::ChunkHeap(NULL, heapSize, heapSize, KMinHeapGrowBy); - if (NULL == newHeap) - { + if (!newHeap) { ret = 3; goto cleanup; - } - else - { + } else { oldHeap = User::SwitchHeap(newHeap); /* Call stdlib main */ SDL_SetMainReady(); diff --git a/src/main/ps2/SDL_ps2_main.c b/src/main/ps2/SDL_ps2_main.c index e9a4b513dd8f8..14fb0d704fc96 100644 --- a/src/main/ps2/SDL_ps2_main.c +++ b/src/main/ps2/SDL_ps2_main.c @@ -1,5 +1,5 @@ /* - SDL_ps2_main.c, fjtrujy@gmail.com + SDL_ps2_main.c, fjtrujy@gmail.com */ #include "SDL_config.h" @@ -17,24 +17,22 @@ #include #include #include -#include -#include -#include +#include #ifdef main - #undef main +#undef main #endif -__attribute__((weak)) -void reset_IOP() { +__attribute__((weak)) void reset_IOP(void) +{ SifInitRpc(0); - while(!SifIopReset(NULL, 0)) { + while (!SifIopReset(NULL, 0)) { } - while(!SifIopSync()){ + while (!SifIopSync()) { } } -static void prepare_IOP() +static void prepare_IOP(void) { reset_IOP(); SifInitRpc(0); @@ -43,29 +41,14 @@ static void prepare_IOP() sbv_patch_fileio(); } -static void init_drivers() { - init_memcard_driver(true); - init_usb_driver(true); -} - -static void deinit_drivers() { - deinit_usb_driver(true); - deinit_memcard_driver(true); +static void init_drivers(void) +{ + init_ps2_filesystem_driver(); } -static void waitUntilDeviceIsReady(char *path) +static void deinit_drivers(void) { - struct stat buffer; - int ret = -1; - int retries = 50; - - while(ret != 0 && retries > 0) { - ret = stat(path, &buffer); - /* Wait until the device is ready */ - nopdelay(); - - retries--; - } + deinit_ps2_filesystem_driver(); } int main(int argc, char *argv[]) @@ -75,14 +58,14 @@ int main(int argc, char *argv[]) prepare_IOP(); init_drivers(); - + getcwd(cwd, sizeof(cwd)); waitUntilDeviceIsReady(cwd); res = SDL_main(argc, argv); - deinit_drivers(); - + deinit_drivers(); + return res; } diff --git a/src/main/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c index 8eb173fb407aa..c3555b3cf083b 100644 --- a/src/main/psp/SDL_psp_main.c +++ b/src/main/psp/SDL_psp_main.c @@ -8,9 +8,10 @@ #include "SDL_main.h" #include #include +#include "../../events/SDL_events_c.h" #ifdef main - #undef main +#undef main #endif /* If application's main() is redefined as SDL_main, and libSDLmain is @@ -28,7 +29,7 @@ PSP_MAIN_THREAD_ATTR(THREAD_ATTR_VFPU | THREAD_ATTR_USER); int sdl_psp_exit_callback(int arg1, int arg2, void *common) { - sceKernelExitGame(); + SDL_SendQuit(); return 0; } @@ -36,7 +37,7 @@ int sdl_psp_callback_thread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback("Exit Callback", - sdl_psp_exit_callback, NULL); + sdl_psp_exit_callback, NULL); sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); return 0; @@ -46,9 +47,10 @@ int sdl_psp_setup_callbacks(void) { int thid; thid = sceKernelCreateThread("update_thread", - sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0); - if(thid >= 0) + sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0); + if (thid >= 0) { sceKernelStartThread(thid, 0, 0); + } return thid; } diff --git a/src/main/uikit/SDL_uikit_main.c b/src/main/uikit/SDL_uikit_main.c index 90c20d1db087c..6ce3492935b79 100644 --- a/src/main/uikit/SDL_uikit_main.c +++ b/src/main/uikit/SDL_uikit_main.c @@ -12,8 +12,7 @@ #undef main #endif -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { return SDL_UIKitRunApp(argc, argv, SDL_main); } diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c index 70fb9b9b7f0a7..bad49b0caf822 100644 --- a/src/main/windows/SDL_windows_main.c +++ b/src/main/windows/SDL_windows_main.c @@ -16,12 +16,11 @@ #include "SDL_main.h" #ifdef main -# undef main +#undef main #endif /* main */ /* Pop up an out of memory message, returns to Windows */ -static BOOL -OutOfMemory(void) +static BOOL OutOfMemory(void) { SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); return FALSE; @@ -29,23 +28,22 @@ OutOfMemory(void) #if defined(_MSC_VER) /* The VC++ compiler needs main/wmain defined */ -# define console_ansi_main main -# if UNICODE -# define console_wmain wmain -# endif +#define console_ansi_main main +#if UNICODE +#define console_wmain wmain +#endif #endif /* Gets the arguments with GetCommandLine, converts them to argc and argv and calls SDL_main */ -static int -main_getcmdline(void) +static int main_getcmdline(void) { LPWSTR *argvw; char **argv; int i, argc, result; argvw = CommandLineToArgvW(GetCommandLineW(), &argc); - if (argvw == NULL) { + if (!argvw) { return OutOfMemory(); } @@ -66,7 +64,7 @@ main_getcmdline(void) return OutOfMemory(); } len = (DWORD)SDL_strlen(arg); - argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 1); + argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (size_t)len + 1); if (!argv[i]) { return OutOfMemory(); } @@ -91,25 +89,22 @@ main_getcmdline(void) } /* This is where execution begins [console apps, ansi] */ -int -console_ansi_main(int argc, char *argv[]) +int console_ansi_main(int argc, char *argv[]) { return main_getcmdline(); } - #if UNICODE /* This is where execution begins [console apps, unicode] */ -int -console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp) +int console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp) { return main_getcmdline(); } #endif /* This is where execution begins [windowed apps] */ -int WINAPI -WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) +int WINAPI MINGW32_FORCEALIGN +WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) /* NOLINT(readability-inconsistent-declaration-parameter-name) */ { return main_getcmdline(); } diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc index fb2c268900148..b61e89a1156f6 100644 --- a/src/main/windows/version.rc +++ b/src/main/windows/version.rc @@ -1,4 +1,4 @@ - +// This file is public domain. Do what you like with it. #include "winresrc.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,26,0,0 - PRODUCTVERSION 2,26,0,0 + FILEVERSION 2,33,0,0 + PRODUCTVERSION 2,33,0,0 FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x40004L @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "SDL\0" - VALUE "FileVersion", "2, 26, 0, 0\0" + VALUE "FileVersion", "2, 33, 0, 0\0" VALUE "InternalName", "SDL\0" - VALUE "LegalCopyright", "Copyright (C) 2022 Sam Lantinga\0" + VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0" VALUE "OriginalFilename", "SDL2.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "2, 26, 0, 0\0" + VALUE "ProductVersion", "2, 33, 0, 0\0" END END BLOCK "VarFileInfo" diff --git a/src/main/winrt/SDL_winrt_main_NonXAML.cpp b/src/main/winrt/SDL_winrt_main_NonXAML.cpp index 19d22504c571b..575a62c181a93 100644 --- a/src/main/winrt/SDL_winrt_main_NonXAML.cpp +++ b/src/main/winrt/SDL_winrt_main_NonXAML.cpp @@ -40,7 +40,7 @@ is compiled with C++/CX enabled (via the /ZW compiler flag). */ #ifdef _MSC_VER -#pragma warning(disable:4447) +#pragma warning(disable : 4447) #endif /* Make sure the function to initialize the Windows Runtime gets linked in. */ diff --git a/src/misc/SDL_sysurl.h b/src/misc/SDL_sysurl.h index 28cc40daffb50..bd28b4d03a8f8 100644 --- a/src/misc/SDL_sysurl.h +++ b/src/misc/SDL_sysurl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/misc/SDL_url.c b/src/misc/SDL_url.c index eb258d96231a5..458c6c18669e0 100644 --- a/src/misc/SDL_url.c +++ b/src/misc/SDL_url.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,10 +21,7 @@ #include "SDL_sysurl.h" -extern int SDL_SYS_OpenURL(const char *url); - -int -SDL_OpenURL(const char *url) +int SDL_OpenURL(const char *url) { if (!url) { return SDL_InvalidParamError("url"); diff --git a/src/misc/android/SDL_sysurl.c b/src/misc/android/SDL_sysurl.c index c17fbca46bb14..09f8d26aac547 100644 --- a/src/misc/android/SDL_sysurl.c +++ b/src/misc/android/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,11 +22,9 @@ #include "../SDL_sysurl.h" #include "../../core/android/SDL_android.h" -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { return Android_JNI_OpenURL(url); } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/dummy/SDL_sysurl.c b/src/misc/dummy/SDL_sysurl.c index d35d016fc089c..be5679d197446 100644 --- a/src/misc/dummy/SDL_sysurl.c +++ b/src/misc/dummy/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,11 +21,9 @@ #include "../SDL_sysurl.h" -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { return SDL_Unsupported(); } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/emscripten/SDL_sysurl.c b/src/misc/emscripten/SDL_sysurl.c index f344232ab9533..8070d0e148264 100644 --- a/src/misc/emscripten/SDL_sysurl.c +++ b/src/misc/emscripten/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,15 +23,12 @@ #include -int -SDL_SYS_OpenURL(const char *url) -{ - EM_ASM({ - window.open(UTF8ToString($0), "_blank"); - }, url); +EM_JS_DEPS(sdlsysurl, "$UTF8ToString"); +int SDL_SYS_OpenURL(const char *url) +{ + EM_ASM(window.open(UTF8ToString($0), "_blank"), url); return 0; } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/haiku/SDL_sysurl.cc b/src/misc/haiku/SDL_sysurl.cc index 01a43f989fef2..5183234c756fe 100644 --- a/src/misc/haiku/SDL_sysurl.cc +++ b/src/misc/haiku/SDL_sysurl.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,8 +22,7 @@ #include "../SDL_sysurl.h" #include -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { BUrl burl(url); const status_t rc = burl.OpenWithPreferredApplication(false); diff --git a/src/misc/ios/SDL_sysurl.m b/src/misc/ios/SDL_sysurl.m index 73d5c73ec4ef3..08722ba9e1bbb 100644 --- a/src/misc/ios/SDL_sysurl.m +++ b/src/misc/ios/SDL_sysurl.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,14 +23,23 @@ #import -int -SDL_SYS_OpenURL(const char *url) -{ @autoreleasepool { - - NSString *nsstr = [NSString stringWithUTF8String:url]; - NSURL *nsurl = [NSURL URLWithString:nsstr]; - return [[UIApplication sharedApplication] openURL:nsurl] ? 0 : -1; -}} +int SDL_SYS_OpenURL(const char *url) +{ + @autoreleasepool { + NSString *nsstr = [NSString stringWithUTF8String:url]; + NSURL *nsurl = [NSURL URLWithString:nsstr]; + if (![[UIApplication sharedApplication] canOpenURL:nsurl]) { + return SDL_SetError("No handler registered for this type of URL"); + } + if (@available(iOS 10.0, tvOS 10.0, *)) { + [[UIApplication sharedApplication] openURL:nsurl options:@{} completionHandler:^(BOOL success) {}]; + } else { + #ifndef SDL_PLATFORM_VISIONOS /* Fallback is never available in any version of VisionOS (but correct API always is). */ + [[UIApplication sharedApplication] openURL:nsurl]; + #endif + } + return 0; + } +} /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/macosx/SDL_sysurl.m b/src/misc/macosx/SDL_sysurl.m index 1b141ee1f926b..f2d445d23d2c8 100644 --- a/src/misc/macosx/SDL_sysurl.m +++ b/src/misc/macosx/SDL_sysurl.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,14 +23,14 @@ #import -int -SDL_SYS_OpenURL(const char *url) -{ @autoreleasepool +int SDL_SYS_OpenURL(const char *url) { - CFURLRef cfurl = CFURLCreateWithBytes(NULL, (const UInt8 *) url, SDL_strlen(url), kCFStringEncodingUTF8, NULL); - OSStatus status = LSOpenCFURLRef(cfurl, NULL); - CFRelease(cfurl); - return status == noErr ? 0 : -1; -}} + @autoreleasepool { + CFURLRef cfurl = CFURLCreateWithBytes(NULL, (const UInt8 *)url, SDL_strlen(url), kCFStringEncodingUTF8, NULL); + OSStatus status = LSOpenCFURLRef(cfurl, NULL); + CFRelease(cfurl); + return status == noErr ? 0 : -1; + } +} /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/misc/riscos/SDL_sysurl.c b/src/misc/riscos/SDL_sysurl.c index 2662c4d68bdbb..28ed4911d44ba 100644 --- a/src/misc/riscos/SDL_sysurl.c +++ b/src/misc/riscos/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,8 +28,7 @@ #define URI_Dispatch 0x4e381 #endif -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { _kernel_swi_regs regs; _kernel_oserror *error; @@ -46,4 +45,3 @@ SDL_SYS_OpenURL(const char *url) } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/unix/SDL_sysurl.c b/src/misc/unix/SDL_sysurl.c index 8d6e0fc91ef59..42218a79fdf92 100644 --- a/src/misc/unix/SDL_sysurl.c +++ b/src/misc/unix/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,39 +28,51 @@ #include #include -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { const pid_t pid1 = fork(); - if (pid1 == 0) { /* child process */ + if (pid1 == 0) { /* child process */ +#ifdef USE_POSIX_SPAWN + pid_t pid2; + const char *args[] = { "xdg-open", url, NULL }; + /* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */ + unsetenv("LD_PRELOAD"); + if (posix_spawnp(&pid2, args[0], NULL, NULL, (char **)args, environ) == 0) { + /* Child process doesn't wait for possibly-blocking grandchild. */ + _exit(EXIT_SUCCESS); + } else { + _exit(EXIT_FAILURE); + } +#else pid_t pid2; /* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */ unsetenv("LD_PRELOAD"); /* Notice this is vfork and not fork! */ pid2 = vfork(); - if (pid2 == 0) { /* Grandchild process will try to launch the url */ + if (pid2 == 0) { /* Grandchild process will try to launch the url */ execlp("xdg-open", "xdg-open", url, NULL); _exit(EXIT_FAILURE); - } else if (pid2 < 0) { /* There was an error forking */ + } else if (pid2 < 0) { /* There was an error forking */ _exit(EXIT_FAILURE); } else { /* Child process doesn't wait for possibly-blocking grandchild. */ _exit(EXIT_SUCCESS); } +#endif /* USE_POSIX_SPAWN */ } else if (pid1 < 0) { return SDL_SetError("fork() failed: %s", strerror(errno)); } else { int status; if (waitpid(pid1, &status, 0) == pid1) { if (WIFEXITED(status)) { - if (WEXITSTATUS(status) == 0) { - return 0; /* success! */ - } else { - return SDL_SetError("xdg-open reported error or failed to launch: %d", WEXITSTATUS(status)); - } - } else { + if (WEXITSTATUS(status) == 0) { + return 0; /* success! */ + } else { + return SDL_SetError("xdg-open reported error or failed to launch: %d", WEXITSTATUS(status)); + } + } else { return SDL_SetError("xdg-open failed for some reason"); - } + } } else { return SDL_SetError("Waiting on xdg-open failed: %s", strerror(errno)); } @@ -68,4 +80,3 @@ SDL_SYS_OpenURL(const char *url) } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/vita/SDL_sysurl.c b/src/misc/vita/SDL_sysurl.c index 1052efb4005be..8530cdefe043a 100644 --- a/src/misc/vita/SDL_sysurl.c +++ b/src/misc/vita/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,8 +24,7 @@ #include #include -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { SceAppUtilInitParam init_param; SceAppUtilBootParam boot_param; @@ -41,4 +40,3 @@ SDL_SYS_OpenURL(const char *url) } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/windows/SDL_sysurl.c b/src/misc/windows/SDL_sysurl.c index 6cfe7de607d06..04c3134f73984 100644 --- a/src/misc/windows/SDL_sysurl.c +++ b/src/misc/windows/SDL_sysurl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,18 +25,16 @@ #include #if defined(__XBOXONE__) || defined(__XBOXSERIES__) -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { /* Not supported */ return SDL_Unsupported(); } #else /* https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx */ -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { - WCHAR* wurl; + WCHAR *wurl; HINSTANCE rc; /* MSDN says for safety's sake, make sure COM is initialized. */ @@ -46,7 +44,7 @@ SDL_SYS_OpenURL(const char *url) } wurl = WIN_UTF8ToStringW(url); - if (wurl == NULL) { + if (!wurl) { WIN_CoUninitialize(); return SDL_OutOfMemory(); } @@ -55,9 +53,8 @@ SDL_SYS_OpenURL(const char *url) rc = ShellExecuteW(NULL, L"open", wurl, NULL, NULL, SW_SHOWNORMAL); SDL_free(wurl); WIN_CoUninitialize(); - return (rc > ((HINSTANCE) 32)) ? 0 : WIN_SetError("Couldn't open given URL."); + return (rc > ((HINSTANCE)32)) ? 0 : WIN_SetError("Couldn't open given URL."); } #endif /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/misc/winrt/SDL_sysurl.cpp b/src/misc/winrt/SDL_sysurl.cpp index 111a144130036..32c412df0bdcb 100644 --- a/src/misc/winrt/SDL_sysurl.cpp +++ b/src/misc/winrt/SDL_sysurl.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,8 +22,7 @@ #include "../SDL_sysurl.h" #include "../../core/windows/SDL_windows.h" -int -SDL_SYS_OpenURL(const char *url) +int SDL_SYS_OpenURL(const char *url) { WCHAR *wurl = WIN_UTF8ToStringW(url); if (!wurl) { @@ -34,8 +33,7 @@ SDL_SYS_OpenURL(const char *url) auto uri = ref new Windows::Foundation::Uri(strurl); Windows::System::Launcher::LaunchUriAsync(uri); - return 0; // oh well, we're not waiting on an async task here. + return 0; // oh well, we're not waiting on an async task here. } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c index fbf8d5a659df5..ab4e4c995b8ce 100644 --- a/src/power/SDL_power.c +++ b/src/power/SDL_power.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,15 +26,13 @@ * Returns SDL_TRUE if we have a definitive answer. * SDL_FALSE to try next implementation. */ -typedef SDL_bool - (*SDL_GetPowerInfo_Impl) (SDL_PowerState * state, int *seconds, - int *percent); +typedef SDL_bool (*SDL_GetPowerInfo_Impl)(SDL_PowerState *state, int *seconds, + int *percent); #ifndef SDL_POWER_DISABLED #ifdef SDL_POWER_HARDWIRED /* This is for things that _never_ have a battery */ -static SDL_bool -SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent) +static SDL_bool SDL_GetPowerInfo_Hardwired(SDL_PowerState *state, int *seconds, int *percent) { *seconds = -1; *percent = -1; @@ -44,40 +42,40 @@ SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent) #endif static SDL_GetPowerInfo_Impl implementations[] = { -#ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */ +#ifdef SDL_POWER_LINUX /* in order of preference. More than could work. */ SDL_GetPowerInfo_Linux_org_freedesktop_upower, SDL_GetPowerInfo_Linux_sys_class_power_supply, SDL_GetPowerInfo_Linux_proc_acpi, SDL_GetPowerInfo_Linux_proc_apm, #endif -#ifdef SDL_POWER_WINDOWS /* handles Win32, Win64, PocketPC. */ +#ifdef SDL_POWER_WINDOWS /* handles Win32, Win64, PocketPC. */ SDL_GetPowerInfo_Windows, #endif -#ifdef SDL_POWER_UIKIT /* handles iPhone/iPad/etc */ +#ifdef SDL_POWER_UIKIT /* handles iPhone/iPad/etc */ SDL_GetPowerInfo_UIKit, #endif #ifdef SDL_POWER_MACOSX /* handles Mac OS X, Darwin. */ SDL_GetPowerInfo_MacOSX, #endif -#ifdef SDL_POWER_HAIKU /* with BeOS euc.jp apm driver. Does this work on Haiku? */ +#ifdef SDL_POWER_HAIKU /* with BeOS euc.jp apm driver. Does this work on Haiku? */ SDL_GetPowerInfo_Haiku, #endif -#ifdef SDL_POWER_ANDROID /* handles Android. */ +#ifdef SDL_POWER_ANDROID /* handles Android. */ SDL_GetPowerInfo_Android, #endif -#ifdef SDL_POWER_PSP /* handles PSP. */ +#ifdef SDL_POWER_PSP /* handles PSP. */ SDL_GetPowerInfo_PSP, #endif -#ifdef SDL_POWER_VITA /* handles PSVita. */ +#ifdef SDL_POWER_VITA /* handles PSVita. */ SDL_GetPowerInfo_VITA, #endif -#ifdef SDL_POWER_N3DS /* handles N3DS. */ +#ifdef SDL_POWER_N3DS /* handles N3DS. */ SDL_GetPowerInfo_N3DS, #endif -#ifdef SDL_POWER_WINRT /* handles WinRT */ +#ifdef SDL_POWER_WINRT /* handles WinRT */ SDL_GetPowerInfo_WinRT, #endif -#ifdef SDL_POWER_EMSCRIPTEN /* handles Emscripten */ +#ifdef SDL_POWER_EMSCRIPTEN /* handles Emscripten */ SDL_GetPowerInfo_Emscripten, #endif @@ -87,8 +85,7 @@ static SDL_GetPowerInfo_Impl implementations[] = { }; #endif -SDL_PowerState -SDL_GetPowerInfo(int *seconds, int *percent) +SDL_PowerState SDL_GetPowerInfo(int *seconds, int *percent) { #ifndef SDL_POWER_DISABLED const int total = sizeof(implementations) / sizeof(implementations[0]); @@ -98,10 +95,10 @@ SDL_GetPowerInfo(int *seconds, int *percent) int _seconds, _percent; /* Make these never NULL for platform-specific implementations. */ - if (seconds == NULL) { + if (!seconds) { seconds = &_seconds; } - if (percent == NULL) { + if (!percent) { percent = &_percent; } diff --git a/src/power/SDL_syspower.h b/src/power/SDL_syspower.h index 2f81756c45f6a..480c39d0b1692 100644 --- a/src/power/SDL_syspower.h +++ b/src/power/SDL_syspower.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/power/android/SDL_syspower.c b/src/power/android/SDL_syspower.c index 4be3b15027290..9bdcdd4bd04e9 100644 --- a/src/power/android/SDL_syspower.c +++ b/src/power/android/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,15 +21,14 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_ANDROID +#ifdef SDL_POWER_ANDROID #include "SDL_power.h" #include "../SDL_syspower.h" #include "../../core/android/SDL_android.h" -SDL_bool -SDL_GetPowerInfo_Android(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *state, int *seconds, int *percent) { int battery; int plugged; diff --git a/src/power/emscripten/SDL_syspower.c b/src/power/emscripten/SDL_syspower.c index 4bac686029210..18a2699615e1a 100644 --- a/src/power/emscripten/SDL_syspower.c +++ b/src/power/emscripten/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,20 +21,20 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_EMSCRIPTEN +#ifdef SDL_POWER_EMSCRIPTEN #include #include "SDL_power.h" -SDL_bool -SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent) { EmscriptenBatteryEvent batteryState; int haveBattery = 0; - if (emscripten_get_battery_status(&batteryState) == EMSCRIPTEN_RESULT_NOT_SUPPORTED) + if (emscripten_get_battery_status(&batteryState) == EMSCRIPTEN_RESULT_NOT_SUPPORTED) { return SDL_FALSE; + } haveBattery = batteryState.level != 1.0 || !batteryState.charging || batteryState.chargingTime != 0.0; diff --git a/src/power/haiku/SDL_syspower.c b/src/power/haiku/SDL_syspower.c index ac1fae917ab18..10b86d976d511 100644 --- a/src/power/haiku/SDL_syspower.c +++ b/src/power/haiku/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ /* !!! FIXME: does this thing even work on Haiku? */ #ifndef SDL_POWER_DISABLED -#if SDL_POWER_HAIKU +#ifdef SDL_POWER_HAIKU #include #include @@ -34,16 +34,15 @@ #include /* These values are from apm.h ... */ -#define APM_DEVICE_PATH "/dev/misc/apm" -#define APM_FUNC_OFFSET 0x5300 +#define APM_DEVICE_PATH "/dev/misc/apm" +#define APM_FUNC_OFFSET 0x5300 #define APM_FUNC_GET_POWER_STATUS 10 #define APM_DEVICE_ALL 1 #define APM_BIOS_CALL (B_DEVICE_OP_CODES_END + 3) #include "SDL_power.h" -SDL_bool -SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *state, int *seconds, int *percent) { const int fd = open("/dev/misc/apm", O_RDONLY | O_CLOEXEC); SDL_bool need_details = SDL_FALSE; @@ -56,7 +55,7 @@ SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent) int rc; if (fd == -1) { - return SDL_FALSE; /* maybe some other method will work? */ + return SDL_FALSE; /* maybe some other method will work? */ } SDL_memset(regs, '\0', sizeof(regs)); @@ -73,10 +72,10 @@ SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent) battery_status = regs[1] & 0xFF; battery_flags = regs[2] >> 8; battery_life = regs[2] & 0xFF; - battery_time = (uint32) regs[3]; + battery_time = (uint32)regs[3]; /* in theory, _something_ should be set in battery_flags, right? */ - if (battery_flags == 0x00) { /* older APM BIOS? Less fields. */ + if (battery_flags == 0x00) { /* older APM BIOS? Less fields. */ battery_time = 0xFFFF; if (battery_status == 0xFF) { battery_flags = 0xFF; @@ -90,36 +89,36 @@ SDL_GetPowerInfo_Haiku(SDL_PowerState * state, int *seconds, int *percent) battery_time = (battery_time & 0x7FFF) * 60; } - if (battery_flags == 0xFF) { /* unknown state */ + if (battery_flags == 0xFF) { /* unknown state */ *state = SDL_POWERSTATE_UNKNOWN; - } else if (battery_flags & (1 << 7)) { /* no battery */ + } else if (battery_flags & (1 << 7)) { /* no battery */ *state = SDL_POWERSTATE_NO_BATTERY; - } else if (battery_flags & (1 << 3)) { /* charging */ + } else if (battery_flags & (1 << 3)) { /* charging */ *state = SDL_POWERSTATE_CHARGING; need_details = SDL_TRUE; } else if (ac_status == 1) { - *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ need_details = SDL_TRUE; } else { - *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ + *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ need_details = SDL_TRUE; } *percent = -1; *seconds = -1; if (need_details) { - const int pct = (int) battery_life; - const int secs = (int) battery_time; + const int pct = (int)battery_life; + const int secs = (int)battery_time; - if (pct != 255) { /* 255 == unknown */ + if (pct != 255) { /* 255 == unknown */ *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ } - if (secs != 0xFFFF) { /* 0xFFFF == unknown */ + if (secs != 0xFFFF) { /* 0xFFFF == unknown */ *seconds = secs; } } - return SDL_TRUE; /* the definitive answer if APM driver replied. */ + return SDL_TRUE; /* the definitive answer if APM driver replied. */ } #endif /* SDL_POWER_HAIKU */ diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c index c33ab5c944733..8e4860b69145a 100644 --- a/src/power/linux/SDL_syspower.c +++ b/src/power/linux/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_LINUX +#ifdef SDL_POWER_LINUX #include #include @@ -41,53 +41,48 @@ static const char *proc_acpi_battery_path = "/proc/acpi/battery"; static const char *proc_acpi_ac_adapter_path = "/proc/acpi/ac_adapter"; static const char *sys_class_power_supply_path = "/sys/class/power_supply"; -static int -open_power_file(const char *base, const char *node, const char *key) +static int open_power_file(const char *base, const char *node, const char *key) { int fd; const size_t pathlen = SDL_strlen(base) + SDL_strlen(node) + SDL_strlen(key) + 3; char *path = SDL_stack_alloc(char, pathlen); - if (path == NULL) { - return -1; /* oh well. */ + if (!path) { + return -1; /* oh well. */ } - SDL_snprintf(path, pathlen, "%s/%s/%s", base, node, key); + (void)SDL_snprintf(path, pathlen, "%s/%s/%s", base, node, key); fd = open(path, O_RDONLY | O_CLOEXEC); SDL_stack_free(path); return fd; } - -static SDL_bool -read_power_file(const char *base, const char *node, const char *key, - char *buf, size_t buflen) +static SDL_bool read_power_file(const char *base, const char *node, const char *key, + char *buf, size_t buflen) { ssize_t br = 0; const int fd = open_power_file(base, node, key); if (fd == -1) { return SDL_FALSE; } - br = read(fd, buf, buflen-1); + br = read(fd, buf, buflen - 1); close(fd); if (br < 0) { return SDL_FALSE; } - buf[br] = '\0'; /* null-terminate the string. */ + buf[br] = '\0'; /* null-terminate the string. */ return SDL_TRUE; } - -static SDL_bool -make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) +static SDL_bool make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) { char *ptr = *_ptr; while (*ptr == ' ') { - ptr++; /* skip whitespace. */ + ptr++; /* skip whitespace. */ } if (*ptr == '\0') { - return SDL_FALSE; /* EOF. */ + return SDL_FALSE; /* EOF. */ } *_key = ptr; @@ -97,17 +92,17 @@ make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) } if (*ptr == '\0') { - return SDL_FALSE; /* (unexpected) EOF. */ + return SDL_FALSE; /* (unexpected) EOF. */ } - *(ptr++) = '\0'; /* terminate the key. */ + *(ptr++) = '\0'; /* terminate the key. */ while (*ptr == ' ') { - ptr++; /* skip whitespace. */ + ptr++; /* skip whitespace. */ } if (*ptr == '\0') { - return SDL_FALSE; /* (unexpected) EOF. */ + return SDL_FALSE; /* (unexpected) EOF. */ } *_val = ptr; @@ -117,16 +112,15 @@ make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) } if (*ptr != '\0') { - *(ptr++) = '\0'; /* terminate the value. */ + *(ptr++) = '\0'; /* terminate the value. */ } - *_ptr = ptr; /* store for next time. */ + *_ptr = ptr; /* store for next time. */ return SDL_TRUE; } -static void -check_proc_acpi_battery(const char * node, SDL_bool * have_battery, - SDL_bool * charging, int *seconds, int *percent) +static void check_proc_acpi_battery(const char *node, SDL_bool *have_battery, + SDL_bool *charging, int *seconds, int *percent) { const char *base = proc_acpi_battery_path; char info[1024]; @@ -141,28 +135,28 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, int secs = -1; int pct = -1; - if (!read_power_file(base, node, "state", state, sizeof (state))) { + if (!read_power_file(base, node, "state", state, sizeof(state))) { return; - } else if (!read_power_file(base, node, "info", info, sizeof (info))) { + } else if (!read_power_file(base, node, "info", info, sizeof(info))) { return; } ptr = &state[0]; while (make_proc_acpi_key_val(&ptr, &key, &val)) { - if (SDL_strcmp(key, "present") == 0) { - if (SDL_strcmp(val, "yes") == 0) { + if (SDL_strcasecmp(key, "present") == 0) { + if (SDL_strcasecmp(val, "yes") == 0) { *have_battery = SDL_TRUE; } - } else if (SDL_strcmp(key, "charging state") == 0) { + } else if (SDL_strcasecmp(key, "charging state") == 0) { /* !!! FIXME: what exactly _does_ charging/discharging mean? */ - if (SDL_strcmp(val, "charging/discharging") == 0) { + if (SDL_strcasecmp(val, "charging/discharging") == 0) { charge = SDL_TRUE; - } else if (SDL_strcmp(val, "charging") == 0) { + } else if (SDL_strcasecmp(val, "charging") == 0) { charge = SDL_TRUE; } - } else if (SDL_strcmp(key, "remaining capacity") == 0) { + } else if (SDL_strcasecmp(key, "remaining capacity") == 0) { char *endptr = NULL; - const int cvt = (int) SDL_strtol(val, &endptr, 10); + const int cvt = (int)SDL_strtol(val, &endptr, 10); if (*endptr == ' ') { remaining = cvt; } @@ -171,9 +165,9 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, ptr = &info[0]; while (make_proc_acpi_key_val(&ptr, &key, &val)) { - if (SDL_strcmp(key, "design capacity") == 0) { + if (SDL_strcasecmp(key, "design capacity") == 0) { char *endptr = NULL; - const int cvt = (int) SDL_strtol(val, &endptr, 10); + const int cvt = (int)SDL_strtol(val, &endptr, 10); if (*endptr == ' ') { maximum = cvt; } @@ -181,7 +175,7 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, } if ((maximum >= 0) && (remaining >= 0)) { - pct = (int) ((((float) remaining) / ((float) maximum)) * 100.0f); + pct = (int)((((float)remaining) / ((float)maximum)) * 100.0f); if (pct < 0) { pct = 0; } else if (pct > 100) { @@ -197,7 +191,7 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, */ if ((secs < 0) && (*seconds < 0)) { if ((pct < 0) && (*percent < 0)) { - choose = SDL_TRUE; /* at least we know there's a battery. */ + choose = SDL_TRUE; /* at least we know there's a battery. */ } if (pct > *percent) { choose = SDL_TRUE; @@ -213,8 +207,7 @@ check_proc_acpi_battery(const char * node, SDL_bool * have_battery, } } -static void -check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac) +static void check_proc_acpi_ac_adapter(const char *node, SDL_bool *have_ac) { const char *base = proc_acpi_ac_adapter_path; char state[256]; @@ -222,24 +215,21 @@ check_proc_acpi_ac_adapter(const char * node, SDL_bool * have_ac) char *key = NULL; char *val = NULL; - if (!read_power_file(base, node, "state", state, sizeof (state))) { + if (!read_power_file(base, node, "state", state, sizeof(state))) { return; } ptr = &state[0]; while (make_proc_acpi_key_val(&ptr, &key, &val)) { - if (SDL_strcmp(key, "state") == 0) { - if (SDL_strcmp(val, "on-line") == 0) { + if (SDL_strcasecmp(key, "state") == 0) { + if (SDL_strcasecmp(val, "on-line") == 0) { *have_ac = SDL_TRUE; } } } } - -SDL_bool -SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state, - int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *state, int *seconds, int *percent) { struct dirent *dent = NULL; DIR *dirp = NULL; @@ -252,8 +242,8 @@ SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state, *state = SDL_POWERSTATE_UNKNOWN; dirp = opendir(proc_acpi_battery_path); - if (dirp == NULL) { - return SDL_FALSE; /* can't use this interface. */ + if (!dirp) { + return SDL_FALSE; /* can't use this interface. */ } else { while ((dent = readdir(dirp)) != NULL) { const char *node = dent->d_name; @@ -264,8 +254,8 @@ SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state, } dirp = opendir(proc_acpi_ac_adapter_path); - if (dirp == NULL) { - return SDL_FALSE; /* can't use this interface. */ + if (!dirp) { + return SDL_FALSE; /* can't use this interface. */ } else { while ((dent = readdir(dirp)) != NULL) { const char *node = dent->d_name; @@ -284,17 +274,15 @@ SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState * state, *state = SDL_POWERSTATE_ON_BATTERY; } - return SDL_TRUE; /* definitive answer. */ + return SDL_TRUE; /* definitive answer. */ } - -static SDL_bool -next_string(char **_ptr, char **_str) +static SDL_bool next_string(char **_ptr, char **_str) { char *ptr = *_ptr; char *str; - while (*ptr == ' ') { /* skip any spaces... */ + while (*ptr == ' ') { /* skip any spaces... */ ptr++; } @@ -303,29 +291,28 @@ next_string(char **_ptr, char **_str) } str = ptr; - while ((*ptr != ' ') && (*ptr != '\n') && (*ptr != '\0')) + while ((*ptr != ' ') && (*ptr != '\n') && (*ptr != '\0')) { ptr++; + } - if (*ptr != '\0') + if (*ptr != '\0') { *(ptr++) = '\0'; + } *_str = str; *_ptr = ptr; return SDL_TRUE; } -static SDL_bool -int_string(char *str, int *val) +static SDL_bool int_string(char *str, int *val) { char *endptr = NULL; - *val = (int) SDL_strtol(str, &endptr, 0); - return ((*str != '\0') && (*endptr == '\0')); + *val = (int)SDL_strtol(str, &endptr, 0); + return (*str != '\0') && (*endptr == '\0'); } /* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */ -SDL_bool -SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, - int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state, int *seconds, int *percent) { SDL_bool need_details = SDL_FALSE; int ac_status = 0; @@ -340,44 +327,44 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, ssize_t br; if (fd == -1) { - return SDL_FALSE; /* can't use this interface. */ + return SDL_FALSE; /* can't use this interface. */ } - br = read(fd, buf, sizeof (buf) - 1); + br = read(fd, buf, sizeof(buf) - 1); close(fd); if (br < 0) { return SDL_FALSE; } - buf[br] = '\0'; /* null-terminate the string. */ - if (!next_string(&ptr, &str)) { /* driver version */ + buf[br] = '\0'; /* null-terminate the string. */ + if (!next_string(&ptr, &str)) { /* driver version */ return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* BIOS version */ + if (!next_string(&ptr, &str)) { /* BIOS version */ return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* APM flags */ + if (!next_string(&ptr, &str)) { /* APM flags */ return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* AC line status */ + if (!next_string(&ptr, &str)) { /* AC line status */ return SDL_FALSE; } else if (!int_string(str, &ac_status)) { return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* battery status */ + if (!next_string(&ptr, &str)) { /* battery status */ return SDL_FALSE; } else if (!int_string(str, &battery_status)) { return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* battery flag */ + if (!next_string(&ptr, &str)) { /* battery flag */ return SDL_FALSE; } else if (!int_string(str, &battery_flag)) { return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* remaining battery life percent */ + if (!next_string(&ptr, &str)) { /* remaining battery life percent */ return SDL_FALSE; } if (str[SDL_strlen(str) - 1] == '%') { @@ -387,27 +374,27 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* remaining battery life time */ + if (!next_string(&ptr, &str)) { /* remaining battery life time */ return SDL_FALSE; } else if (!int_string(str, &battery_time)) { return SDL_FALSE; } - if (!next_string(&ptr, &str)) { /* remaining battery life time units */ + if (!next_string(&ptr, &str)) { /* remaining battery life time units */ return SDL_FALSE; - } else if (SDL_strcmp(str, "min") == 0) { + } else if (SDL_strcasecmp(str, "min") == 0) { battery_time *= 60; } if (battery_flag == 0xFF) { /* unknown state */ *state = SDL_POWERSTATE_UNKNOWN; - } else if (battery_flag & (1 << 7)) { /* no battery */ + } else if (battery_flag & (1 << 7)) { /* no battery */ *state = SDL_POWERSTATE_NO_BATTERY; - } else if (battery_flag & (1 << 3)) { /* charging */ + } else if (battery_flag & (1 << 3)) { /* charging */ *state = SDL_POWERSTATE_CHARGING; need_details = SDL_TRUE; } else if (ac_status == 1) { - *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ need_details = SDL_TRUE; } else { *state = SDL_POWERSTATE_ON_BATTERY; @@ -420,10 +407,10 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, const int pct = battery_percent; const int secs = battery_time; - if (pct >= 0) { /* -1 == unknown */ + if (pct >= 0) { /* -1 == unknown */ *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ } - if (secs >= 0) { /* -1 == unknown */ + if (secs >= 0) { /* -1 == unknown */ *seconds = secs; } } @@ -431,8 +418,7 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState * state, return SDL_TRUE; } -SDL_bool -SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent) { const char *base = sys_class_power_supply_path; struct dirent *dent; @@ -443,7 +429,7 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second return SDL_FALSE; } - *state = SDL_POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ + *state = SDL_POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ *seconds = -1; *percent = -1; @@ -458,52 +444,52 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second int power; if ((SDL_strcmp(name, ".") == 0) || (SDL_strcmp(name, "..") == 0)) { - continue; /* skip these, of course. */ - } else if (!read_power_file(base, name, "type", str, sizeof (str))) { - continue; /* Don't know _what_ we're looking at. Give up on it. */ - } else if (SDL_strcmp(str, "Battery\n") != 0) { - continue; /* we don't care about UPS and such. */ + continue; /* skip these, of course. */ + } else if (!read_power_file(base, name, "type", str, sizeof(str))) { + continue; /* Don't know _what_ we're looking at. Give up on it. */ + } else if (SDL_strcasecmp(str, "Battery\n") != 0) { + continue; /* we don't care about UPS and such. */ } /* if the scope is "device," it might be something like a PS4 controller reporting its own battery, and not something that powers the system. Most system batteries don't list a scope at all; we assume it's a system battery if not specified. */ - if (read_power_file(base, name, "scope", str, sizeof (str))) { - if (SDL_strcmp(str, "device\n") == 0) { - continue; /* skip external devices with their own batteries. */ + if (read_power_file(base, name, "scope", str, sizeof(str))) { + if (SDL_strcasecmp(str, "Device\n") == 0) { + continue; /* skip external devices with their own batteries. */ } } /* some drivers don't offer this, so if it's not explicitly reported assume it's present. */ - if (read_power_file(base, name, "present", str, sizeof (str)) && (SDL_strcmp(str, "0\n") == 0)) { + if (read_power_file(base, name, "present", str, sizeof(str)) && (SDL_strcmp(str, "0\n") == 0)) { st = SDL_POWERSTATE_NO_BATTERY; - } else if (!read_power_file(base, name, "status", str, sizeof (str))) { - st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ - } else if (SDL_strcmp(str, "Charging\n") == 0) { + } else if (!read_power_file(base, name, "status", str, sizeof(str))) { + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + } else if (SDL_strcasecmp(str, "Charging\n") == 0) { st = SDL_POWERSTATE_CHARGING; - } else if (SDL_strcmp(str, "Discharging\n") == 0) { + } else if (SDL_strcasecmp(str, "Discharging\n") == 0) { st = SDL_POWERSTATE_ON_BATTERY; - } else if ((SDL_strcmp(str, "Full\n") == 0) || (SDL_strcmp(str, "Not charging\n") == 0)) { + } else if ((SDL_strcasecmp(str, "Full\n") == 0) || (SDL_strcasecmp(str, "Not charging\n") == 0)) { st = SDL_POWERSTATE_CHARGED; } else { - st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ } - if (!read_power_file(base, name, "capacity", str, sizeof (str))) { + if (!read_power_file(base, name, "capacity", str, sizeof(str))) { pct = -1; } else { pct = SDL_atoi(str); pct = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ } - if (read_power_file(base, name, "time_to_empty_now", str, sizeof (str))) { + if (read_power_file(base, name, "time_to_empty_now", str, sizeof(str))) { secs = SDL_atoi(str); - secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ + secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ } else if (st == SDL_POWERSTATE_ON_BATTERY) { /* energy is Watt*hours and power is Watts */ - energy = (read_power_file(base, name, "energy_now", str, sizeof (str))) ? SDL_atoi(str) : -1; - power = (read_power_file(base, name, "power_now", str, sizeof (str))) ? SDL_atoi(str) : -1; + energy = (read_power_file(base, name, "energy_now", str, sizeof(str))) ? SDL_atoi(str) : -1; + power = (read_power_file(base, name, "power_now", str, sizeof(str))) ? SDL_atoi(str) : -1; secs = (energy >= 0 && power > 0) ? (3600LL * energy) / power : -1; } else { secs = -1; @@ -515,7 +501,7 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second */ if ((secs < 0) && (*seconds < 0)) { if ((pct < 0) && (*percent < 0)) { - choose = SDL_TRUE; /* at least we know there's a battery. */ + choose = SDL_TRUE; /* at least we know there's a battery. */ } else if (pct > *percent) { choose = SDL_TRUE; } @@ -531,19 +517,17 @@ SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *second } closedir(dirp); - return SDL_TRUE; /* don't look any further. */ + return SDL_TRUE; /* don't look any further. */ } - /* d-bus queries to org.freedesktop.UPower. */ -#if SDL_USE_LIBDBUS -#define UPOWER_DBUS_NODE "org.freedesktop.UPower" -#define UPOWER_DBUS_PATH "/org/freedesktop/UPower" -#define UPOWER_DBUS_INTERFACE "org.freedesktop.UPower" +#ifdef SDL_USE_LIBDBUS +#define UPOWER_DBUS_NODE "org.freedesktop.UPower" +#define UPOWER_DBUS_PATH "/org/freedesktop/UPower" +#define UPOWER_DBUS_INTERFACE "org.freedesktop.UPower" #define UPOWER_DEVICE_DBUS_INTERFACE "org.freedesktop.UPower.Device" -static void -check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *state, int *seconds, int *percent) +static void check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *state, int *seconds, int *percent) { SDL_bool choose = SDL_FALSE; SDL_PowerState st; @@ -554,13 +538,13 @@ check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *stat double d = 0.0; if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "Type", DBUS_TYPE_UINT32, &ui32)) { - return; /* Don't know _what_ we're looking at. Give up on it. */ - } else if (ui32 != 2) { /* 2==Battery*/ - return; /* we don't care about UPS and such. */ + return; /* Don't know _what_ we're looking at. Give up on it. */ + } else if (ui32 != 2) { /* 2==Battery*/ + return; /* we don't care about UPS and such. */ } else if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "PowerSupply", DBUS_TYPE_BOOLEAN, &ui32)) { return; } else if (!ui32) { - return; /* we don't care about random devices with batteries, like wireless controllers, etc */ + return; /* we don't care about random devices with batteries, like wireless controllers, etc */ } if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "IsPresent", DBUS_TYPE_BOOLEAN, &ui32)) { @@ -575,30 +559,38 @@ check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *stat SDL_DBus_CallMethodOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "Refresh", DBUS_TYPE_INVALID, DBUS_TYPE_INVALID); if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "State", DBUS_TYPE_UINT32, &ui32)) { - st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ - } else if (ui32 == 1) { /* 1 == charging */ + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + } else if (ui32 == 1) { /* 1 == charging */ st = SDL_POWERSTATE_CHARGING; - } else if ((ui32 == 2) || (ui32 == 3)) { /* 2 == discharging, 3 == empty. */ + } else if ((ui32 == 2) || (ui32 == 3) || (ui32 == 6)) { + /* 2 == discharging; + * 3 == empty; + * 6 == "pending discharge" which GNOME interprets as equivalent + * to discharging */ st = SDL_POWERSTATE_ON_BATTERY; - } else if (ui32 == 4) { /* 4 == full */ + } else if ((ui32 == 4) || (ui32 == 5)) { + /* 4 == full; + * 5 == "pending charge" which GNOME shows as "Not charging", + * used when a battery is configured to stop charging at a + * lower than 100% threshold */ st = SDL_POWERSTATE_CHARGED; } else { - st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ + st = SDL_POWERSTATE_UNKNOWN; /* uh oh */ } } if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "Percentage", DBUS_TYPE_DOUBLE, &d)) { - pct = -1; /* some old/cheap batteries don't set this property. */ + pct = -1; /* some old/cheap batteries don't set this property. */ } else { - pct = (int) d; + pct = (int)d; pct = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ } if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "TimeToEmpty", DBUS_TYPE_INT64, &si64)) { secs = -1; } else { - secs = (int) si64; - secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ + secs = (int)si64; + secs = (secs <= 0) ? -1 : secs; /* 0 == unknown */ } /* @@ -607,7 +599,7 @@ check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *stat */ if ((secs < 0) && (*seconds < 0)) { if ((pct < 0) && (*percent < 0)) { - choose = SDL_TRUE; /* at least we know there's a battery. */ + choose = SDL_TRUE; /* at least we know there's a battery. */ } else if (pct > *percent) { choose = SDL_TRUE; } @@ -623,24 +615,23 @@ check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *stat } #endif -SDL_bool -SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent) { SDL_bool retval = SDL_FALSE; -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS SDL_DBusContext *dbus = SDL_DBus_GetContext(); char **paths = NULL; int i, numpaths = 0; if (!dbus || !SDL_DBus_CallMethodOnConnection(dbus->system_conn, UPOWER_DBUS_NODE, UPOWER_DBUS_PATH, UPOWER_DBUS_INTERFACE, "EnumerateDevices", - DBUS_TYPE_INVALID, - DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &paths, &numpaths, DBUS_TYPE_INVALID)) { - return SDL_FALSE; /* try a different approach than UPower. */ + DBUS_TYPE_INVALID, + DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &paths, &numpaths, DBUS_TYPE_INVALID)) { + return SDL_FALSE; /* try a different approach than UPower. */ } - retval = SDL_TRUE; /* Clearly we can use this interface. */ - *state = SDL_POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ + retval = SDL_TRUE; /* Clearly we can use this interface. */ + *state = SDL_POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */ *seconds = -1; *percent = -1; @@ -649,7 +640,7 @@ SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *second } dbus->free_string_array(paths); -#endif /* SDL_USE_LIBDBUS */ +#endif /* SDL_USE_LIBDBUS */ return retval; } diff --git a/src/power/macosx/SDL_syspower.c b/src/power/macosx/SDL_syspower.c index 8277b347241b0..c01de19d92b6a 100644 --- a/src/power/macosx/SDL_syspower.c +++ b/src/power/macosx/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_MACOSX +#ifdef SDL_POWER_MACOSX #include #include @@ -30,16 +30,15 @@ #include "SDL_power.h" /* CoreFoundation is so verbose... */ -#define STRMATCH(a,b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo) -#define GETVAL(k,v) \ - CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **) v) +#define STRMATCH(a, b) (CFStringCompare(a, b, 0) == kCFCompareEqualTo) +#define GETVAL(k, v) \ + CFDictionaryGetValueIfPresent(dict, CFSTR(k), (const void **)v) /* Note that AC power sources also include a laptop battery it is charging. */ -static void -checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, - SDL_bool * charging, int *seconds, int *percent) +static void checkps(CFDictionaryRef dict, SDL_bool *have_ac, SDL_bool *have_battery, + SDL_bool *charging, int *seconds, int *percent) { - CFStringRef strval; /* don't CFRelease() this. */ + CFStringRef strval; /* don't CFRelease() this. */ CFBooleanRef bval; CFNumberRef numval; SDL_bool charge = SDL_FALSE; @@ -50,7 +49,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, int pct = -1; if ((GETVAL(kIOPSIsPresentKey, &bval)) && (bval == kCFBooleanFalse)) { - return; /* nothing to see here. */ + return; /* nothing to see here. */ } if (!GETVAL(kIOPSPowerSourceStateKey, &strval)) { @@ -60,7 +59,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, if (STRMATCH(strval, CFSTR(kIOPSACPowerValue))) { is_ac = *have_ac = SDL_TRUE; } else if (!STRMATCH(strval, CFSTR(kIOPSBatteryPowerValue))) { - return; /* not a battery? */ + return; /* not a battery? */ } if ((GETVAL(kIOPSIsChargingKey, &bval)) && (bval == kCFBooleanTrue)) { @@ -72,7 +71,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, CFNumberGetValue(numval, kCFNumberSInt32Type, &val); if (val > 0) { *have_battery = SDL_TRUE; - maxpct = (int) val; + maxpct = (int)val; } } @@ -81,7 +80,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, CFNumberGetValue(numval, kCFNumberSInt32Type, &val); if (val > 0) { *have_battery = SDL_TRUE; - maxpct = (int) val; + maxpct = (int)val; } } @@ -91,23 +90,23 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, /* Mac OS X reports 0 minutes until empty if you're plugged in. :( */ if ((val == 0) && (is_ac)) { - val = -1; /* !!! FIXME: calc from timeToFull and capacity? */ + val = -1; /* !!! FIXME: calc from timeToFull and capacity? */ } - secs = (int) val; + secs = (int)val; if (secs > 0) { - secs *= 60; /* value is in minutes, so convert to seconds. */ + secs *= 60; /* value is in minutes, so convert to seconds. */ } } if (GETVAL(kIOPSCurrentCapacityKey, &numval)) { SInt32 val = -1; CFNumberGetValue(numval, kCFNumberSInt32Type, &val); - pct = (int) val; + pct = (int)val; } if ((pct > 0) && (maxpct > 0)) { - pct = (int) ((((double) pct) / ((double) maxpct)) * 100.0); + pct = (int)((((double)pct) / ((double)maxpct)) * 100.0); } if (pct > 100) { @@ -120,7 +119,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, */ if ((secs < 0) && (*seconds < 0)) { if ((pct < 0) && (*percent < 0)) { - choose = SDL_TRUE; /* at least we know there's a battery. */ + choose = SDL_TRUE; /* at least we know there's a battery. */ } if (pct > *percent) { choose = SDL_TRUE; @@ -139,9 +138,7 @@ checkps(CFDictionaryRef dict, SDL_bool * have_ac, SDL_bool * have_battery, #undef GETVAL #undef STRMATCH - -SDL_bool -SDL_GetPowerInfo_MacOSX(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *state, int *seconds, int *percent) { CFTypeRef blob = IOPSCopyPowerSourcesInfo(); @@ -159,7 +156,7 @@ SDL_GetPowerInfo_MacOSX(SDL_PowerState * state, int *seconds, int *percent) const CFIndex total = CFArrayGetCount(list); CFIndex i; for (i = 0; i < total; i++) { - CFTypeRef ps = (CFTypeRef) CFArrayGetValueAtIndex(list, i); + CFTypeRef ps = (CFTypeRef)CFArrayGetValueAtIndex(list, i); CFDictionaryRef dict = IOPSGetPowerSourceDescription(blob, ps); if (dict != NULL) { diff --git a/src/power/n3ds/SDL_syspower.c b/src/power/n3ds/SDL_syspower.c index fe167aff63f44..4c369b236b4f2 100644 --- a/src/power/n3ds/SDL_syspower.c +++ b/src/power/n3ds/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,8 +35,7 @@ SDL_FORCE_INLINE int GetBatteryPercentage(void); #define BATTERY_PERCENT_REG 0xB #define BATTERY_PERCENT_REG_SIZE 2 -SDL_bool -SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) { *state = GetPowerState(); *percent = GetBatteryPercentage(); @@ -45,8 +44,7 @@ SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent) return SDL_TRUE; } -SDL_FORCE_INLINE SDL_PowerState -GetPowerState(void) +static SDL_PowerState GetPowerState(void) { bool is_plugged; u8 is_charging; @@ -66,8 +64,7 @@ GetPowerState(void) return SDL_POWERSTATE_ON_BATTERY; } -SDL_FORCE_INLINE int -ReadStateFromPTMU(bool *is_plugged, u8 *is_charging) +static int ReadStateFromPTMU(bool *is_plugged, u8 *is_charging) { if (R_FAILED(ptmuInit())) { return SDL_SetError("Failed to initialise PTMU service"); @@ -103,7 +100,7 @@ GetBatteryPercentage(void) mcuHwcExit(); - return (int) SDL_round(data[0] + data[1] / 256.0); + return (int)SDL_round(data[0] + data[1] / 256.0); } #endif /* !SDL_POWER_DISABLED && SDL_POWER_N3DS */ diff --git a/src/power/psp/SDL_syspower.c b/src/power/psp/SDL_syspower.c index ca9ba66b7221c..8b8204fe6a8aa 100644 --- a/src/power/psp/SDL_syspower.c +++ b/src/power/psp/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,15 +22,12 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_PSP +#ifdef SDL_POWER_PSP #include "SDL_power.h" #include - -SDL_bool -SDL_GetPowerInfo_PSP(SDL_PowerState * state, int *seconds, - int *percent) +SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *state, int *seconds, int *percent) { int battery = scePowerIsBatteryExist(); int plugged = scePowerIsPowerOnline(); @@ -47,19 +44,18 @@ SDL_GetPowerInfo_PSP(SDL_PowerState * state, int *seconds, } else if (charging) { *state = SDL_POWERSTATE_CHARGING; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } else if (plugged) { *state = SDL_POWERSTATE_CHARGED; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } else { *state = SDL_POWERSTATE_ON_BATTERY; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } - - return SDL_TRUE; /* always the definitive answer on PSP. */ + return SDL_TRUE; /* always the definitive answer on PSP. */ } #endif /* SDL_POWER_PSP */ diff --git a/src/power/uikit/SDL_syspower.h b/src/power/uikit/SDL_syspower.h index a412780b00835..02bd7b2a39741 100644 --- a/src/power/uikit/SDL_syspower.h +++ b/src/power/uikit/SDL_syspower.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,12 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_POWER_UIKIT +#ifdef SDL_POWER_UIKIT #include "SDL_power.h" void SDL_UIKit_UpdateBatteryMonitoring(void); -SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent); +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent); #endif /* SDL_POWER_UIKIT */ diff --git a/src/power/uikit/SDL_syspower.m b/src/power/uikit/SDL_syspower.m index 2a5ec9c6ad2da..26ddf03d61117 100644 --- a/src/power/uikit/SDL_syspower.m +++ b/src/power/uikit/SDL_syspower.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_UIKIT +#ifdef SDL_POWER_UIKIT #import @@ -34,8 +34,7 @@ static const int BATTERY_MONITORING_TIMEOUT = 3000; static Uint32 SDL_UIKitLastPowerInfoQuery = 0; -void -SDL_UIKit_UpdateBatteryMonitoring(void) +void SDL_UIKit_UpdateBatteryMonitoring(void) { if (SDL_UIKitLastPowerInfoQuery) { if (SDL_TICKS_PASSED(SDL_GetTicks(), SDL_UIKitLastPowerInfoQuery + BATTERY_MONITORING_TIMEOUT)) { @@ -47,23 +46,22 @@ } } #else -void -SDL_UIKit_UpdateBatteryMonitoring(void) +void SDL_UIKit_UpdateBatteryMonitoring(void) { /* Do nothing. */ } #endif /* !TARGET_OS_TV */ -SDL_bool -SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent) { #if TARGET_OS_TV *state = SDL_POWERSTATE_NO_BATTERY; *seconds = -1; *percent = -1; -#else /* TARGET_OS_TV */ +#else /* TARGET_OS_TV */ @autoreleasepool { UIDevice *uidev = [UIDevice currentDevice]; + const float level = uidev.batteryLevel; if (!SDL_UIKitLastPowerInfoQuery) { SDL_assert(uidev.isBatteryMonitoringEnabled == NO); @@ -77,7 +75,7 @@ */ SDL_UIKitLastPowerInfoQuery = SDL_GetTicks(); - *seconds = -1; /* no API to estimate this in UIKit. */ + *seconds = -1; /* no API to estimate this in UIKit. */ switch (uidev.batteryState) { case UIDeviceBatteryStateCharging: @@ -98,8 +96,7 @@ break; } - const float level = uidev.batteryLevel; - *percent = ( (level < 0.0f) ? -1 : ((int) ((level * 100) + 0.5f)) ); + *percent = ((level < 0.0f) ? -1 : ((int)((level * 100) + 0.5f))); } #endif /* TARGET_OS_TV */ diff --git a/src/power/vita/SDL_syspower.c b/src/power/vita/SDL_syspower.c index 46eef930eeccc..7d870b2278afa 100644 --- a/src/power/vita/SDL_syspower.c +++ b/src/power/vita/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,15 +22,12 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_VITA +#ifdef SDL_POWER_VITA #include "SDL_power.h" #include - -SDL_bool -SDL_GetPowerInfo_VITA(SDL_PowerState * state, int *seconds, - int *percent) +SDL_bool SDL_GetPowerInfo_VITA(SDL_PowerState *state, int *seconds, int *percent) { int battery = 1; int plugged = scePowerIsPowerOnline(); @@ -47,19 +44,18 @@ SDL_GetPowerInfo_VITA(SDL_PowerState * state, int *seconds, } else if (charging) { *state = SDL_POWERSTATE_CHARGING; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } else if (plugged) { *state = SDL_POWERSTATE_CHARGED; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } else { *state = SDL_POWERSTATE_ON_BATTERY; *percent = scePowerGetBatteryLifePercent(); - *seconds = scePowerGetBatteryLifeTime()*60; + *seconds = scePowerGetBatteryLifeTime() * 60; } - - return SDL_TRUE; /* always the definitive answer on VITA. */ + return SDL_TRUE; /* always the definitive answer on VITA. */ } #endif /* SDL_POWER_VITA */ diff --git a/src/power/windows/SDL_syspower.c b/src/power/windows/SDL_syspower.c index 666b563a7249c..c20e8e05e513e 100644 --- a/src/power/windows/SDL_syspower.c +++ b/src/power/windows/SDL_syspower.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,24 +21,22 @@ #include "../../SDL_internal.h" #ifndef SDL_POWER_DISABLED -#if SDL_POWER_WINDOWS +#ifdef SDL_POWER_WINDOWS #include "../../core/windows/SDL_windows.h" #include "SDL_power.h" -SDL_bool -SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *state, int *seconds, int *percent) { SYSTEM_POWER_STATUS status; SDL_bool need_details = SDL_FALSE; /* This API should exist back to Win95. */ - if (!GetSystemPowerStatus(&status)) - { + if (!GetSystemPowerStatus(&status)) { /* !!! FIXME: push GetLastError() into SDL_GetError() */ *state = SDL_POWERSTATE_UNKNOWN; - } else if (status.BatteryFlag == 0xFF) { /* unknown state */ + } else if (status.BatteryFlag == 0xFF) { /* unknown state */ *state = SDL_POWERSTATE_UNKNOWN; } else if (status.BatteryFlag & (1 << 7)) { /* no battery */ *state = SDL_POWERSTATE_NO_BATTERY; @@ -46,28 +44,28 @@ SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent) *state = SDL_POWERSTATE_CHARGING; need_details = SDL_TRUE; } else if (status.ACLineStatus == 1) { - *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ + *state = SDL_POWERSTATE_CHARGED; /* on AC, not charging. */ need_details = SDL_TRUE; } else { - *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ + *state = SDL_POWERSTATE_ON_BATTERY; /* not on AC. */ need_details = SDL_TRUE; } *percent = -1; *seconds = -1; if (need_details) { - const int pct = (int) status.BatteryLifePercent; - const int secs = (int) status.BatteryLifeTime; + const int pct = (int)status.BatteryLifePercent; + const int secs = (int)status.BatteryLifeTime; - if (pct != 255) { /* 255 == unknown */ + if (pct != 255) { /* 255 == unknown */ *percent = (pct > 100) ? 100 : pct; /* clamp between 0%, 100% */ } - if (secs != 0xFFFFFFFF) { /* ((DWORD)-1) == unknown */ + if (secs != 0xFFFFFFFF) { /* ((DWORD)-1) == unknown */ *seconds = secs; } } - return SDL_TRUE; /* always the definitive answer on Windows. */ + return SDL_TRUE; /* always the definitive answer on Windows. */ } #endif /* SDL_POWER_WINDOWS */ diff --git a/src/power/winrt/SDL_syspower.cpp b/src/power/winrt/SDL_syspower.cpp index 62e7ea6d6d1a9..3e1951c427a73 100644 --- a/src/power/winrt/SDL_syspower.cpp +++ b/src/power/winrt/SDL_syspower.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,8 +26,7 @@ #include "SDL_power.h" extern "C" -SDL_bool -SDL_GetPowerInfo_WinRT(SDL_PowerState * state, int *seconds, int *percent) +SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState * state, int *seconds, int *percent) { /* TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement SDL_GetPowerInfo_WinRT as appropriate. */ /* Notes: diff --git a/src/render/SDL_d3dmath.c b/src/render/SDL_d3dmath.c index fb7de371fa6a3..e348efea2a0e2 100644 --- a/src/render/SDL_d3dmath.c +++ b/src/render/SDL_d3dmath.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../SDL_internal.h" -#if (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED +#if (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) #include "SDL_stdinc.h" #include "SDL_d3dmath.h" @@ -128,9 +128,8 @@ Float4X4 MatrixRotationZ(float r) m.v._33 = 1.0f; m.v._44 = 1.0f; return m; - } -#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED */ +#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_d3dmath.h b/src/render/SDL_d3dmath.h index 6460bf17dc18d..a0e04b2b21a43 100644 --- a/src/render/SDL_d3dmath.h +++ b/src/render/SDL_d3dmath.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../SDL_internal.h" -#if (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED +#if (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus @@ -52,8 +52,10 @@ typedef struct typedef struct { - union { - struct { + union + { + struct + { float _11, _12, _13, _14; float _21, _22, _23, _24; float _31, _32, _33, _34; @@ -63,7 +65,6 @@ typedef struct }; } Float4X4; - Float4X4 MatrixIdentity(); Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2); Float4X4 MatrixScaling(float x, float y, float z); @@ -77,6 +78,6 @@ Float4X4 MatrixRotationZ(float r); } #endif -#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) && !SDL_RENDER_DISABLED */ +#endif /* (SDL_VIDEO_RENDER_D3D || SDL_VIDEO_RENDER_D3D11 || SDL_VIDEO_RENDER_D3D12) */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 5f821b33e95bd..ae435d63a174b 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,14 @@ #include "software/SDL_render_sw_c.h" #include "../video/SDL_pixels_c.h" +#if defined(__loongarch__) +#if SDL_VIDEO_OPENGL +#include "SDL_opengl.h" +#endif /* SDL_VIDEO_OPENGL */ +#endif + #if defined(__ANDROID__) -# include "../core/android/SDL_android.h" +#include "../core/android/SDL_android.h" #endif /* as a courtesy to iOS apps, we don't try to draw when in the background, as @@ -45,51 +51,58 @@ this should probably be removed at some point in the future. --ryan. */ #define DONT_DRAW_WHILE_HIDDEN 0 #endif -#define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" +#define SDL_WINDOWRENDERDATA "_SDL_WindowRenderData" -#define CHECK_RENDERER_MAGIC(renderer, retval) \ +#define CHECK_RENDERER_MAGIC_BUT_NOT_DESTROYED_FLAG(renderer, retval) \ if (!renderer || renderer->magic != &renderer_magic) { \ - SDL_InvalidParamError("renderer"); \ - return retval; \ + SDL_InvalidParamError("renderer"); \ + return retval; \ + } + +#define CHECK_RENDERER_MAGIC(renderer, retval) \ + CHECK_RENDERER_MAGIC_BUT_NOT_DESTROYED_FLAG(renderer, retval); \ + if (renderer->destroyed) { \ + SDL_SetError("Renderer's window has been destroyed, can't use further"); \ + return retval; \ } -#define CHECK_TEXTURE_MAGIC(texture, retval) \ +#define CHECK_TEXTURE_MAGIC(texture, retval) \ if (!texture || texture->magic != &texture_magic) { \ - SDL_InvalidParamError("texture"); \ - return retval; \ + SDL_InvalidParamError("texture"); \ + return retval; \ } /* Predefined blend modes */ #define SDL_COMPOSE_BLENDMODE(srcColorFactor, dstColorFactor, colorOperation, \ srcAlphaFactor, dstAlphaFactor, alphaOperation) \ - (SDL_BlendMode)(((Uint32)colorOperation << 0) | \ - ((Uint32)srcColorFactor << 4) | \ - ((Uint32)dstColorFactor << 8) | \ - ((Uint32)alphaOperation << 16) | \ - ((Uint32)srcAlphaFactor << 20) | \ + (SDL_BlendMode)(((Uint32)colorOperation << 0) | \ + ((Uint32)srcColorFactor << 4) | \ + ((Uint32)dstColorFactor << 8) | \ + ((Uint32)alphaOperation << 16) | \ + ((Uint32)srcAlphaFactor << 20) | \ ((Uint32)dstAlphaFactor << 24)) -#define SDL_BLENDMODE_NONE_FULL \ +#define SDL_BLENDMODE_NONE_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ZERO, SDL_BLENDOPERATION_ADD) -#define SDL_BLENDMODE_BLEND_FULL \ +#define SDL_BLENDMODE_BLEND_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD) -#define SDL_BLENDMODE_ADD_FULL \ +#define SDL_BLENDMODE_ADD_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) -#define SDL_BLENDMODE_MOD_FULL \ +#define SDL_BLENDMODE_MOD_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) -#define SDL_BLENDMODE_MUL_FULL \ +#define SDL_BLENDMODE_MUL_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_DST_COLOR, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \ - SDL_BLENDFACTOR_DST_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD) + SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) -#if !SDL_RENDER_DISABLED +#ifndef SDL_RENDER_DISABLED static const SDL_RenderDriver *render_drivers[] = { #if SDL_VIDEO_RENDER_D3D &D3D_RenderDriver, @@ -115,7 +128,7 @@ static const SDL_RenderDriver *render_drivers[] = { #if SDL_VIDEO_RENDER_DIRECTFB &DirectFB_RenderDriver, #endif -#if SDL_VIDEO_RENDER_PS2 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_PS2 &PS2_RenderDriver, #endif #if SDL_VIDEO_RENDER_PSP @@ -133,8 +146,7 @@ static const SDL_RenderDriver *render_drivers[] = { static char renderer_magic; static char texture_magic; -static SDL_INLINE void -DebugLogRenderCommands(const SDL_RenderCommand *cmd) +static SDL_INLINE void DebugLogRenderCommands(const SDL_RenderCommand *cmd) { #if 0 unsigned int i = 1; @@ -234,14 +246,13 @@ DebugLogRenderCommands(const SDL_RenderCommand *cmd) #endif } -static int -FlushRenderCommands(SDL_Renderer *renderer) +static int FlushRenderCommands(SDL_Renderer *renderer) { int retval; SDL_assert((renderer->render_commands == NULL) == (renderer->render_commands_tail == NULL)); - if (renderer->render_commands == NULL) { /* nothing to do! */ + if (!renderer->render_commands) { /* nothing to do! */ SDL_assert(renderer->vertex_data_used == 0); return 0; } @@ -251,7 +262,7 @@ FlushRenderCommands(SDL_Renderer *renderer) retval = renderer->RunCommandQueue(renderer, renderer->render_commands, renderer->vertex_data, renderer->vertex_data_used); /* Move the whole render command queue to the unused pool so we can reuse them next time. */ - if (renderer->render_commands_tail != NULL) { + if (renderer->render_commands_tail) { renderer->render_commands_tail->next = renderer->render_commands_pool; renderer->render_commands_pool = renderer->render_commands; renderer->render_commands_tail = NULL; @@ -265,8 +276,7 @@ FlushRenderCommands(SDL_Renderer *renderer) return retval; } -static int -FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture) +static int FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture) { SDL_Renderer *renderer = texture->renderer; if (texture->last_command_generation == renderer->render_command_generation) { @@ -276,20 +286,17 @@ FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture) return 0; } -static SDL_INLINE int -FlushRenderCommandsIfNotBatching(SDL_Renderer *renderer) +static SDL_INLINE int FlushRenderCommandsIfNotBatching(SDL_Renderer *renderer) { return renderer->batching ? 0 : FlushRenderCommands(renderer); } -int -SDL_RenderFlush(SDL_Renderer * renderer) +int SDL_RenderFlush(SDL_Renderer *renderer) { return FlushRenderCommands(renderer); } -void * -SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset) +void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset) { const size_t needed = renderer->vertex_data_used + numbytes + alignment; const size_t current_offset = renderer->vertex_data_used; @@ -307,7 +314,7 @@ SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const ptr = SDL_realloc(renderer->vertex_data, newsize); - if (ptr == NULL) { + if (!ptr) { SDL_OutOfMemory(); return NULL; } @@ -321,21 +328,20 @@ SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const renderer->vertex_data_used += aligner + numbytes; - return ((Uint8 *) renderer->vertex_data) + aligned; + return ((Uint8 *)renderer->vertex_data) + aligned; } -static SDL_RenderCommand * -AllocateRenderCommand(SDL_Renderer *renderer) +static SDL_RenderCommand *AllocateRenderCommand(SDL_Renderer *renderer) { SDL_RenderCommand *retval = NULL; /* !!! FIXME: are there threading limitations in SDL's render API? If not, we need to mutex this. */ retval = renderer->render_commands_pool; - if (retval != NULL) { + if (retval) { renderer->render_commands_pool = retval->next; retval->next = NULL; } else { - retval = SDL_calloc(1, sizeof (*retval)); + retval = SDL_calloc(1, sizeof(*retval)); if (!retval) { SDL_OutOfMemory(); return NULL; @@ -343,7 +349,7 @@ AllocateRenderCommand(SDL_Renderer *renderer) } SDL_assert((renderer->render_commands == NULL) == (renderer->render_commands_tail == NULL)); - if (renderer->render_commands_tail != NULL) { + if (renderer->render_commands_tail) { renderer->render_commands_tail->next = retval; } else { renderer->render_commands = retval; @@ -353,16 +359,15 @@ AllocateRenderCommand(SDL_Renderer *renderer) return retval; } -static int -QueueCmdSetViewport(SDL_Renderer *renderer) +static int QueueCmdSetViewport(SDL_Renderer *renderer) { int retval = 0; - if (!renderer->viewport_queued || (SDL_memcmp(&renderer->viewport, &renderer->last_queued_viewport, sizeof (SDL_DRect)) != 0)) { + if (!renderer->viewport_queued || (SDL_memcmp(&renderer->viewport, &renderer->last_queued_viewport, sizeof(SDL_DRect)) != 0)) { SDL_RenderCommand *cmd = AllocateRenderCommand(renderer); retval = -1; - if (cmd != NULL) { + if (cmd) { cmd->command = SDL_RENDERCMD_SETVIEWPORT; - cmd->data.viewport.first = 0; /* render backend will fill this in. */ + cmd->data.viewport.first = 0; /* render backend will fill this in. */ /* Convert SDL_DRect to SDL_Rect */ cmd->data.viewport.rect.x = (int)SDL_floor(renderer->viewport.x); cmd->data.viewport.rect.y = (int)SDL_floor(renderer->viewport.y); @@ -380,15 +385,14 @@ QueueCmdSetViewport(SDL_Renderer *renderer) return retval; } -static int -QueueCmdSetClipRect(SDL_Renderer *renderer) +static int QueueCmdSetClipRect(SDL_Renderer *renderer) { int retval = 0; if ((!renderer->cliprect_queued) || - (renderer->clipping_enabled != renderer->last_queued_cliprect_enabled) || - (SDL_memcmp(&renderer->clip_rect, &renderer->last_queued_cliprect, sizeof (SDL_DRect)) != 0)) { + (renderer->clipping_enabled != renderer->last_queued_cliprect_enabled) || + (SDL_memcmp(&renderer->clip_rect, &renderer->last_queued_cliprect, sizeof(SDL_DRect)) != 0)) { SDL_RenderCommand *cmd = AllocateRenderCommand(renderer); - if (cmd == NULL) { + if (!cmd) { retval = -1; } else { cmd->command = SDL_RENDERCMD_SETCLIPRECT; @@ -406,8 +410,7 @@ QueueCmdSetClipRect(SDL_Renderer *renderer) return retval; } -static int -QueueCmdSetDrawColor(SDL_Renderer *renderer, SDL_Color *col) +static int QueueCmdSetDrawColor(SDL_Renderer *renderer, SDL_Color *col) { const Uint32 color = (((Uint32)col->a << 24) | (col->r << 16) | (col->g << 8) | col->b); int retval = 0; @@ -416,9 +419,9 @@ QueueCmdSetDrawColor(SDL_Renderer *renderer, SDL_Color *col) SDL_RenderCommand *cmd = AllocateRenderCommand(renderer); retval = -1; - if (cmd != NULL) { + if (cmd) { cmd->command = SDL_RENDERCMD_SETDRAWCOLOR; - cmd->data.color.first = 0; /* render backend will fill this in. */ + cmd->data.color.first = 0; /* render backend will fill this in. */ cmd->data.color.r = col->r; cmd->data.color.g = col->g; cmd->data.color.b = col->b; @@ -435,11 +438,10 @@ QueueCmdSetDrawColor(SDL_Renderer *renderer, SDL_Color *col) return retval; } -static int -QueueCmdClear(SDL_Renderer *renderer) +static int QueueCmdClear(SDL_Renderer *renderer) { SDL_RenderCommand *cmd = AllocateRenderCommand(renderer); - if (cmd == NULL) { + if (!cmd) { return -1; } @@ -452,8 +454,7 @@ QueueCmdClear(SDL_Renderer *renderer) return 0; } -static SDL_RenderCommand * -PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype, SDL_Texture *texture) +static SDL_RenderCommand *PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype, SDL_Texture *texture) { SDL_RenderCommand *cmd = NULL; int retval = 0; @@ -484,10 +485,10 @@ PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype, SD if (retval == 0) { cmd = AllocateRenderCommand(renderer); - if (cmd != NULL) { + if (cmd) { cmd->command = cmdtype; - cmd->data.draw.first = 0; /* render backend will fill this in. */ - cmd->data.draw.count = 0; /* render backend will fill this in. */ + cmd->data.draw.first = 0; /* render backend will fill this in. */ + cmd->data.draw.count = 0; /* render backend will fill this in. */ cmd->data.draw.r = color->r; cmd->data.draw.g = color->g; cmd->data.draw.b = color->b; @@ -499,12 +500,11 @@ PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_RenderCommandType cmdtype, SD return cmd; } -static int -QueueCmdDrawPoints(SDL_Renderer *renderer, const SDL_FPoint * points, const int count) +static int QueueCmdDrawPoints(SDL_Renderer *renderer, const SDL_FPoint *points, const int count) { SDL_RenderCommand *cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_DRAW_POINTS, NULL); int retval = -1; - if (cmd != NULL) { + if (cmd) { retval = renderer->QueueDrawPoints(renderer, cmd, points, count); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; @@ -513,12 +513,11 @@ QueueCmdDrawPoints(SDL_Renderer *renderer, const SDL_FPoint * points, const int return retval; } -static int -QueueCmdDrawLines(SDL_Renderer *renderer, const SDL_FPoint * points, const int count) +static int QueueCmdDrawLines(SDL_Renderer *renderer, const SDL_FPoint *points, const int count) { SDL_RenderCommand *cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_DRAW_LINES, NULL); int retval = -1; - if (cmd != NULL) { + if (cmd) { retval = renderer->QueueDrawLines(renderer, cmd, points, count); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; @@ -527,16 +526,15 @@ QueueCmdDrawLines(SDL_Renderer *renderer, const SDL_FPoint * points, const int c return retval; } -static int -QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int count) +static int QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, const int count) { SDL_RenderCommand *cmd; int retval = -1; - const int use_rendergeometry = (renderer->QueueFillRects == NULL); + const int use_rendergeometry = (!renderer->QueueFillRects); cmd = PrepQueueCmdDraw(renderer, (use_rendergeometry ? SDL_RENDERCMD_GEOMETRY : SDL_RENDERCMD_FILL_RECTS), NULL); - if (cmd != NULL) { + if (cmd) { if (use_rendergeometry) { SDL_bool isstack1; SDL_bool isstack2; @@ -547,7 +545,7 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou int i; float *ptr_xy = xy; int *ptr_indices = indices; - const int xy_stride = 2 * sizeof (float); + const int xy_stride = 2 * sizeof(float); const int num_vertices = 4 * count; const int num_indices = 6 * count; const int size_indices = 4; @@ -581,9 +579,9 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou } retval = renderer->QueueGeometry(renderer, cmd, NULL, - xy, xy_stride, &renderer->color, 0 /* color_stride */, NULL, 0, - num_vertices, indices, num_indices, size_indices, - 1.0f, 1.0f); + xy, xy_stride, &renderer->color, 0 /* color_stride */, NULL, 0, + num_vertices, indices, num_indices, size_indices, + 1.0f, 1.0f); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; @@ -591,7 +589,7 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou } SDL_small_free(xy, isstack1); SDL_small_free(indices, isstack2); - + } else { retval = renderer->QueueFillRects(renderer, cmd, rects, count); if (retval < 0) { @@ -602,12 +600,11 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou return retval; } -static int -QueueCmdCopy(SDL_Renderer *renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect) +static int QueueCmdCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect) { SDL_RenderCommand *cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_COPY, texture); int retval = -1; - if (cmd != NULL) { + if (cmd) { retval = renderer->QueueCopy(renderer, cmd, texture, srcrect, dstrect); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; @@ -616,14 +613,13 @@ QueueCmdCopy(SDL_Renderer *renderer, SDL_Texture * texture, const SDL_Rect * src return retval; } -static int -QueueCmdCopyEx(SDL_Renderer *renderer, SDL_Texture * texture, - const SDL_Rect * srcquad, const SDL_FRect * dstrect, - const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) +static int QueueCmdCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *srcquad, const SDL_FRect *dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) { SDL_RenderCommand *cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_COPY_EX, texture); int retval = -1; - if (cmd != NULL) { + if (cmd) { retval = renderer->QueueCopyEx(renderer, cmd, texture, srcquad, dstrect, angle, center, flip, scale_x, scale_y); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; @@ -632,24 +628,23 @@ QueueCmdCopyEx(SDL_Renderer *renderer, SDL_Texture * texture, return retval; } -static int -QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride, - int num_vertices, - const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride, + int num_vertices, + const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { SDL_RenderCommand *cmd; int retval = -1; cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_GEOMETRY, texture); - if (cmd != NULL) { + if (cmd) { retval = renderer->QueueGeometry(renderer, cmd, texture, - xy, xy_stride, - color, color_stride, uv, uv_stride, - num_vertices, indices, num_indices, size_indices, - scale_x, scale_y); + xy, xy_stride, + color, color_stride, uv, uv_stride, + num_vertices, indices, num_indices, size_indices, + scale_x, scale_y); if (retval < 0) { cmd->command = SDL_RENDERCMD_NO_OP; } @@ -659,20 +654,18 @@ QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture, static int UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd); -int -SDL_GetNumRenderDrivers(void) +int SDL_GetNumRenderDrivers(void) { -#if !SDL_RENDER_DISABLED +#ifndef SDL_RENDER_DISABLED return SDL_arraysize(render_drivers); #else return 0; #endif } -int -SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info) +int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info) { -#if !SDL_RENDER_DISABLED +#ifndef SDL_RENDER_DISABLED if (index < 0 || index >= SDL_GetNumRenderDrivers()) { return SDL_SetError("index must be in the range of 0 - %d", SDL_GetNumRenderDrivers() - 1); @@ -694,8 +687,7 @@ static void GetWindowViewportValues(SDL_Renderer *renderer, int *logical_w, int SDL_UnlockMutex(renderer->target_mutex); } -static int SDLCALL -SDL_RendererEventWatch(void *userdata, SDL_Event *event) +static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event) { SDL_Renderer *renderer = (SDL_Renderer *)userdata; @@ -795,13 +787,13 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) float rel = renderer->xrel + event->motion.xrel / (scale.x * renderer->dpi_scale.x); float truncated = SDL_truncf(rel); renderer->xrel = rel - truncated; - event->motion.xrel = (Sint32) truncated; + event->motion.xrel = (Sint32)truncated; } if (event->motion.yrel != 0 && renderer->relative_scaling) { float rel = renderer->yrel + event->motion.yrel / (scale.y * renderer->dpi_scale.y); float truncated = SDL_truncf(rel); renderer->yrel = rel - truncated; - event->motion.yrel = (Sint32) truncated; + event->motion.yrel = (Sint32)truncated; } } } @@ -820,6 +812,20 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) event->button.y = (int)(event->button.y / (scale.y * renderer->dpi_scale.y)); } } + } else if (event->type == SDL_MOUSEWHEEL) { + SDL_Window *window = SDL_GetWindowFromID(event->wheel.windowID); + if (window == renderer->window) { + int logical_w, logical_h; + SDL_DRect viewport; + SDL_FPoint scale; + GetWindowViewportValues(renderer, &logical_w, &logical_h, &viewport, &scale); + if (logical_w) { + event->wheel.mouseX -= (int)(viewport.x * renderer->dpi_scale.x); + event->wheel.mouseY -= (int)(viewport.y * renderer->dpi_scale.y); + event->wheel.mouseX = (int)(event->wheel.mouseX / (scale.x * renderer->dpi_scale.x)); + event->wheel.mouseY = (int)(event->wheel.mouseY / (scale.y * renderer->dpi_scale.y)); + } + } } else if (event->type == SDL_FINGERDOWN || event->type == SDL_FINGERUP || event->type == SDL_FINGERMOTION) { @@ -839,38 +845,38 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) if (renderer->GetOutputSize) { int w, h; renderer->GetOutputSize(renderer, &w, &h); - physical_w = (float) w; - physical_h = (float) h; + physical_w = (float)w; + physical_h = (float)h; } else { int w, h; SDL_GetWindowSize(renderer->window, &w, &h); - physical_w = ((float) w) * renderer->dpi_scale.x; - physical_h = ((float) h) * renderer->dpi_scale.y; + physical_w = ((float)w) * renderer->dpi_scale.x; + physical_h = ((float)h) * renderer->dpi_scale.y; } - if (physical_w == 0.0f) { /* nowhere for the touch to go, avoid division by zero and put it dead center. */ + if (physical_w == 0.0f) { /* nowhere for the touch to go, avoid division by zero and put it dead center. */ event->tfinger.x = 0.5f; } else { - const float normalized_viewport_x = ((float) viewport.x) / physical_w; - const float normalized_viewport_w = ((float) viewport.w) / physical_w; + const float normalized_viewport_x = ((float)viewport.x) / physical_w; + const float normalized_viewport_w = ((float)viewport.w) / physical_w; if (event->tfinger.x <= normalized_viewport_x) { - event->tfinger.x = 0.0f; /* to the left of the viewport, clamp to the edge. */ + event->tfinger.x = 0.0f; /* to the left of the viewport, clamp to the edge. */ } else if (event->tfinger.x >= (normalized_viewport_x + normalized_viewport_w)) { - event->tfinger.x = 1.0f; /* to the right of the viewport, clamp to the edge. */ + event->tfinger.x = 1.0f; /* to the right of the viewport, clamp to the edge. */ } else { event->tfinger.x = (event->tfinger.x - normalized_viewport_x) / normalized_viewport_w; } } - if (physical_h == 0.0f) { /* nowhere for the touch to go, avoid division by zero and put it dead center. */ + if (physical_h == 0.0f) { /* nowhere for the touch to go, avoid division by zero and put it dead center. */ event->tfinger.y = 0.5f; } else { - const float normalized_viewport_y = ((float) viewport.y) / physical_h; - const float normalized_viewport_h = ((float) viewport.h) / physical_h; + const float normalized_viewport_y = ((float)viewport.y) / physical_h; + const float normalized_viewport_h = ((float)viewport.h) / physical_h; if (event->tfinger.y <= normalized_viewport_y) { - event->tfinger.y = 0.0f; /* to the left of the viewport, clamp to the edge. */ + event->tfinger.y = 0.0f; /* to the left of the viewport, clamp to the edge. */ } else if (event->tfinger.y >= (normalized_viewport_y + normalized_viewport_h)) { - event->tfinger.y = 1.0f; /* to the right of the viewport, clamp to the edge. */ + event->tfinger.y = 1.0f; /* to the right of the viewport, clamp to the edge. */ } else { event->tfinger.y = (event->tfinger.y - normalized_viewport_y) / normalized_viewport_h; } @@ -880,13 +886,12 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event) return 0; } -int -SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, - SDL_Window **window, SDL_Renderer **renderer) +int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer) { *window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, - SDL_WINDOWPOS_UNDEFINED, - width, height, window_flags); + SDL_WINDOWPOS_UNDEFINED, + width, height, window_flags); if (!*window) { *renderer = NULL; return -1; @@ -900,9 +905,8 @@ SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, return 0; } -#if !SDL_RENDER_DISABLED -static SDL_INLINE -void VerifyDrawQueueFunctions(const SDL_Renderer *renderer) +#ifndef SDL_RENDER_DISABLED +static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer) { /* all of these functions are required to be implemented, even as no-ops, so we don't have to check that they aren't NULL over and over. */ @@ -915,7 +919,7 @@ void VerifyDrawQueueFunctions(const SDL_Renderer *renderer) SDL_assert(renderer->RunCommandQueue != NULL); } -static SDL_RenderLineMethod SDL_GetRenderLineMethod() +static SDL_RenderLineMethod SDL_GetRenderLineMethod(void) { const char *hint = SDL_GetHint(SDL_HINT_RENDER_LINE_METHOD); @@ -956,29 +960,78 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind } #endif /* !SDL_RENDER_DISABLED */ -SDL_Renderer * -SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) +#if defined(__loongarch__) +static SDL_bool SDL_CheckIntegratedGraphics() { -#if !SDL_RENDER_DISABLED + SDL_Window *window = SDL_CreateWindow("OpenGL test", -32, -32, 32, 32, + SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN); + SDL_bool has_lg100_or_lg110 = SDL_FALSE; + + if (window) { + SDL_GLContext context = SDL_GL_CreateContext(window); + + if (context) { + const GLubyte *(APIENTRY *glGetStringFunc)(GLenum) = + SDL_GL_GetProcAddress("glGetString"); + if (glGetStringFunc) { + const char *renderer = (const char*)glGetStringFunc(GL_RENDERER); + if (renderer && (SDL_strstr(renderer, "LG110") || + SDL_strstr(renderer, "LG100"))) { + has_lg100_or_lg110 = SDL_TRUE; + } + } + SDL_GL_DeleteContext(context); + } + SDL_DestroyWindow(window); + } + return has_lg100_or_lg110; +} +#endif + +SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags) +{ +#ifndef SDL_RENDER_DISABLED SDL_Renderer *renderer = NULL; int n = SDL_GetNumRenderDrivers(); SDL_bool batching = SDL_TRUE; const char *hint; + int rc = -1; #if defined(__ANDROID__) Android_ActivityMutex_Lock_Running(); #endif +/* CPU acceleration runs faster than integrated graphics on Loongson at present. */ +#if defined(__linux__) && defined(__loongarch__) + if (SDL_CheckIntegratedGraphics()) { + SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION, "0"); + flags = SDL_RENDERER_SOFTWARE; + } +#endif + if (!window) { SDL_InvalidParamError("window"); goto error; } + if (SDL_HasWindowSurface(window)) { + SDL_SetError("Surface already associated with window"); + goto error; + } + if (SDL_GetRenderer(window)) { SDL_SetError("Renderer already associated with window"); goto error; } + renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + goto error; + } + + renderer->magic = &renderer_magic; + hint = SDL_GetHint(SDL_HINT_RENDER_VSYNC); if (hint && *hint) { if (SDL_GetHintBoolean(SDL_HINT_RENDER_VSYNC, SDL_TRUE)) { @@ -996,30 +1049,36 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) if (SDL_strcasecmp(hint, driver->info.name) == 0) { /* Create a new renderer instance */ - renderer = driver->CreateRenderer(window, flags); - if (renderer) { + rc = driver->CreateRenderer(renderer, window, flags); + if (rc == 0) { batching = SDL_FALSE; + } else { + SDL_zerop(renderer); /* make sure we don't leave function pointers from a previous CreateRenderer() in this struct. */ + renderer->magic = &renderer_magic; } break; } } } - if (!renderer) { + if (rc == -1) { for (index = 0; index < n; ++index) { const SDL_RenderDriver *driver = render_drivers[index]; if ((driver->info.flags & flags) == flags) { /* Create a new renderer instance */ - renderer = driver->CreateRenderer(window, flags); - if (renderer) { + rc = driver->CreateRenderer(renderer, window, flags); + if (rc == 0) { /* Yay, we got one! */ break; + } else { + SDL_zerop(renderer); /* make sure we don't leave function pointers from a previous CreateRenderer() in this struct. */ + renderer->magic = &renderer_magic; } } } } - if (!renderer) { + if (rc == -1) { SDL_SetError("Couldn't find matching render driver"); goto error; } @@ -1030,17 +1089,17 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) goto error; } /* Create a new renderer instance */ - renderer = render_drivers[index]->CreateRenderer(window, flags); + rc = render_drivers[index]->CreateRenderer(renderer, window, flags); batching = SDL_FALSE; - if (!renderer) { + if (rc == -1) { goto error; } } - if ((flags & SDL_RENDERER_PRESENTVSYNC) != 0) { + if (flags & SDL_RENDERER_PRESENTVSYNC) { renderer->wanted_vsync = SDL_TRUE; - if ((renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) == 0) { + if (!(renderer->info.flags & SDL_RENDERER_PRESENTVSYNC)) { renderer->simulate_vsync = SDL_TRUE; renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } @@ -1092,7 +1151,7 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) renderer->line_method = SDL_GetRenderLineMethod(); - if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN|SDL_WINDOW_MINIMIZED)) { + if (SDL_GetWindowFlags(window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) { renderer->hidden = SDL_TRUE; } else { renderer->hidden = SDL_FALSE; @@ -1113,6 +1172,7 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) return renderer; error: + SDL_free(renderer); #if defined(__ANDROID__) Android_ActivityMutex_Unlock(); @@ -1125,17 +1185,27 @@ SDL_CreateRenderer(SDL_Window * window, int index, Uint32 flags) #endif } -SDL_Renderer * -SDL_CreateSoftwareRenderer(SDL_Surface * surface) +SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) { -#if !SDL_RENDER_DISABLED && SDL_VIDEO_RENDER_SW +#if SDL_VIDEO_RENDER_SW SDL_Renderer *renderer; + int rc; + + renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(*renderer)); + if (!renderer) { + SDL_OutOfMemory(); + return NULL; + } - renderer = SW_CreateRendererForSurface(surface); + renderer->magic = &renderer_magic; + + rc = SW_CreateRendererForSurface(renderer, surface); - if (renderer) { + if (rc == -1) { + SDL_free(renderer); + renderer = NULL; + } else { VerifyDrawQueueFunctions(renderer); - renderer->magic = &renderer_magic; renderer->target_mutex = SDL_CreateMutex(); renderer->scale.x = 1.0f; renderer->scale.y = 1.0f; @@ -1155,21 +1225,18 @@ SDL_CreateSoftwareRenderer(SDL_Surface * surface) #endif /* !SDL_RENDER_DISABLED */ } -SDL_Renderer * -SDL_GetRenderer(SDL_Window * window) +SDL_Renderer *SDL_GetRenderer(SDL_Window *window) { return (SDL_Renderer *)SDL_GetWindowData(window, SDL_WINDOWRENDERDATA); } -SDL_Window * -SDL_RenderGetWindow(SDL_Renderer *renderer) +SDL_Window *SDL_RenderGetWindow(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, NULL); return renderer->window; } -int -SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) +int SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -1177,8 +1244,7 @@ SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info) return 0; } -int -SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h) +int SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -1195,11 +1261,9 @@ SDL_GetRendererOutputSize(SDL_Renderer * renderer, int *w, int *h) } } -static SDL_bool -IsSupportedBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool IsSupportedBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - switch (blendMode) - { + switch (blendMode) { /* These are required to be supported by all renderers */ case SDL_BLENDMODE_NONE: case SDL_BLENDMODE_BLEND: @@ -1213,8 +1277,7 @@ IsSupportedBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) } } -static SDL_bool -IsSupportedFormat(SDL_Renderer * renderer, Uint32 format) +static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, Uint32 format) { Uint32 i; @@ -1226,8 +1289,7 @@ IsSupportedFormat(SDL_Renderer * renderer, Uint32 format) return SDL_FALSE; } -static Uint32 -GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format) +static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, Uint32 format) { Uint32 i; @@ -1252,7 +1314,6 @@ GetClosestSupportedFormat(SDL_Renderer * renderer, Uint32 format) return renderer->info.texture_formats[0]; } - static SDL_ScaleMode SDL_GetScaleMode(void) { const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); @@ -1268,8 +1329,7 @@ static SDL_ScaleMode SDL_GetScaleMode(void) } } -SDL_Texture * -SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int h) +SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h) { SDL_Texture *texture; SDL_bool texture_is_fourcc_and_target; @@ -1298,7 +1358,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int SDL_SetError("Texture dimensions are limited to %dx%d", renderer->info.max_texture_width, renderer->info.max_texture_height); return NULL; } - texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture)); + texture = (SDL_Texture *)SDL_calloc(1, sizeof(*texture)); if (!texture) { SDL_OutOfMemory(); return NULL; @@ -1369,7 +1429,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int } else if (access == SDL_TEXTUREACCESS_STREAMING) { /* The pitch is 4 byte aligned */ texture->pitch = (((w * SDL_BYTESPERPIXEL(format)) + 3) & ~3); - texture->pixels = SDL_calloc(1, texture->pitch * h); + texture->pixels = SDL_calloc(1, (size_t)texture->pitch * h); if (!texture->pixels) { SDL_DestroyTexture(texture); return NULL; @@ -1379,8 +1439,7 @@ SDL_CreateTexture(SDL_Renderer * renderer, Uint32 format, int access, int w, int return texture; } -SDL_Texture * -SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) +SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface) { const SDL_PixelFormat *fmt; SDL_bool needAlpha; @@ -1446,7 +1505,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) format = renderer->info.texture_formats[0]; for (i = 0; i < (int)renderer->info.num_texture_formats; ++i) { if (!SDL_ISPIXELFORMAT_FOURCC(renderer->info.texture_formats[i]) && - SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) { + SDL_ISPIXELFORMAT_ALPHA(renderer->info.texture_formats[i]) == needAlpha) { format = renderer->info.texture_formats[i]; break; } @@ -1461,7 +1520,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) if (format == surface->format->format) { if (surface->format->Amask && SDL_HasColorKey(surface)) { - /* Surface and Renderer formats are identicals. + /* Surface and Renderer formats are identicals. * Intermediate conversion is needed to convert color key to alpha (SDL_ConvertColorkeyToAlpha()). */ direct_update = SDL_FALSE; } else { @@ -1500,8 +1559,8 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) /* Set up a destination surface for the texture update */ dst_fmt = SDL_AllocFormat(format); if (!dst_fmt) { - SDL_DestroyTexture(texture); - return NULL; + SDL_DestroyTexture(texture); + return NULL; } temp = SDL_ConvertSurface(surface, dst_fmt, 0); SDL_FreeFormat(dst_fmt); @@ -1535,9 +1594,8 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface) return texture; } -int -SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, - int *w, int *h) +int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, + int *w, int *h) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1556,8 +1614,7 @@ SDL_QueryTexture(SDL_Texture * texture, Uint32 * format, int *access, return 0; } -int -SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) +int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1575,9 +1632,8 @@ SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) return 0; } -int -SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, - Uint8 * b) +int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, + Uint8 *b) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1593,8 +1649,7 @@ SDL_GetTextureColorMod(SDL_Texture * texture, Uint8 * r, Uint8 * g, return 0; } -int -SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) +int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1610,8 +1665,7 @@ SDL_SetTextureAlphaMod(SDL_Texture * texture, Uint8 alpha) return 0; } -int -SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) +int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1621,8 +1675,7 @@ SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) return 0; } -int -SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) +int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) { SDL_Renderer *renderer; @@ -1639,8 +1692,7 @@ SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) return 0; } -int -SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) +int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1650,8 +1702,7 @@ SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) return 0; } -int -SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode) +int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) { SDL_Renderer *renderer; @@ -1667,8 +1718,7 @@ SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode) return 0; } -int -SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode) +int SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1678,8 +1728,7 @@ SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode) return 0; } -int -SDL_SetTextureUserData(SDL_Texture * texture, void *userdata) +int SDL_SetTextureUserData(SDL_Texture *texture, void *userdata) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -1687,8 +1736,7 @@ SDL_SetTextureUserData(SDL_Texture * texture, void *userdata) return 0; } -void * -SDL_GetTextureUserData(SDL_Texture * texture) +void *SDL_GetTextureUserData(SDL_Texture *texture) { CHECK_TEXTURE_MAGIC(texture, NULL); @@ -1696,9 +1744,8 @@ SDL_GetTextureUserData(SDL_Texture * texture) } #if SDL_HAVE_YUV -static int -SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, - const void *pixels, int pitch) +static int SDL_UpdateTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch) { SDL_Texture *native = texture->native; SDL_Rect full_rect; @@ -1727,7 +1774,7 @@ SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, } else { /* Use a temporary buffer for updating */ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); - const size_t alloclen = rect->h * temp_pitch; + const size_t alloclen = (size_t)rect->h * temp_pitch; if (alloclen > 0) { void *temp_pixels = SDL_malloc(alloclen); if (!temp_pixels) { @@ -1743,14 +1790,13 @@ SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, } #endif /* SDL_HAVE_YUV */ -static int -SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect, - const void *pixels, int pitch) +static int SDL_UpdateTextureNative(SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch) { SDL_Texture *native = texture->native; if (!rect->w || !rect->h) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (texture->access == SDL_TEXTUREACCESS_STREAMING) { @@ -1768,7 +1814,7 @@ SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect, } else { /* Use a temporary buffer for updating */ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); - const size_t alloclen = rect->h * temp_pitch; + const size_t alloclen = (size_t)rect->h * temp_pitch; if (alloclen > 0) { void *temp_pixels = SDL_malloc(alloclen); if (!temp_pixels) { @@ -1784,9 +1830,8 @@ SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect, return 0; } -int -SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, - const void *pixels, int pitch) +int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch) { SDL_Rect real_rect; @@ -1810,7 +1855,7 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, } if (real_rect.w == 0 || real_rect.h == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ #if SDL_HAVE_YUV } else if (texture->yuv) { return SDL_UpdateTextureYUV(texture, &real_rect, pixels, pitch); @@ -1827,11 +1872,10 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect, } #if SDL_HAVE_YUV -static int -SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int SDL_UpdateTextureYUVPlanar(SDL_Texture *texture, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { SDL_Texture *native = texture->native; SDL_Rect full_rect; @@ -1847,7 +1891,7 @@ SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect, rect = &full_rect; if (!rect->w || !rect->h) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (texture->access == SDL_TEXTUREACCESS_STREAMING) { @@ -1864,7 +1908,7 @@ SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect, } else { /* Use a temporary buffer for updating */ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); - const size_t alloclen = rect->h * temp_pitch; + const size_t alloclen = (size_t)rect->h * temp_pitch; if (alloclen > 0) { void *temp_pixels = SDL_malloc(alloclen); if (!temp_pixels) { @@ -1879,10 +1923,9 @@ SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect, return 0; } -static int -SDL_UpdateTextureNVPlanar(SDL_Texture * texture, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int SDL_UpdateTextureNVPlanar(SDL_Texture *texture, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { SDL_Texture *native = texture->native; SDL_Rect full_rect; @@ -1898,7 +1941,7 @@ SDL_UpdateTextureNVPlanar(SDL_Texture * texture, const SDL_Rect * rect, rect = &full_rect; if (!rect->w || !rect->h) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (texture->access == SDL_TEXTUREACCESS_STREAMING) { @@ -1915,7 +1958,7 @@ SDL_UpdateTextureNVPlanar(SDL_Texture * texture, const SDL_Rect * rect, } else { /* Use a temporary buffer for updating */ const int temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3); - const size_t alloclen = rect->h * temp_pitch; + const size_t alloclen = (size_t)rect->h * temp_pitch; if (alloclen > 0) { void *temp_pixels = SDL_malloc(alloclen); if (!temp_pixels) { @@ -1930,10 +1973,9 @@ SDL_UpdateTextureNVPlanar(SDL_Texture * texture, const SDL_Rect * rect, return 0; } - #endif /* SDL_HAVE_YUV */ -int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect, +int SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) @@ -1977,7 +2019,7 @@ int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect, } if (real_rect.w == 0 || real_rect.h == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (texture->yuv) { @@ -2000,9 +2042,9 @@ int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect, #endif } -int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +int SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { #if SDL_HAVE_YUV SDL_Renderer *renderer; @@ -2037,7 +2079,7 @@ int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, } if (real_rect.w == 0 || real_rect.h == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (texture->yuv) { @@ -2060,32 +2102,27 @@ int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, #endif } - - #if SDL_HAVE_YUV -static int -SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect, - void **pixels, int *pitch) +static int SDL_LockTextureYUV(SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch) { return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch); } #endif /* SDL_HAVE_YUV */ -static int -SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect, - void **pixels, int *pitch) +static int SDL_LockTextureNative(SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch) { texture->locked_rect = *rect; - *pixels = (void *) ((Uint8 *) texture->pixels + - rect->y * texture->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pixels = (void *)((Uint8 *)texture->pixels + + rect->y * texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = texture->pitch; return 0; } -int -SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, - void **pixels, int *pitch) +int SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch) { SDL_Rect full_rect; @@ -2111,7 +2148,7 @@ SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, return SDL_LockTextureYUV(texture, rect, pixels, pitch); } else #endif - if (texture->native) { + if (texture->native) { /* Calls a real SDL_LockTexture/SDL_UnlockTexture on unlock, flushing then. */ return SDL_LockTextureNative(texture, rect, pixels, pitch); } else { @@ -2123,16 +2160,15 @@ SDL_LockTexture(SDL_Texture * texture, const SDL_Rect * rect, } } -int -SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, - SDL_Surface **surface) +int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, + SDL_Surface **surface) { SDL_Rect real_rect; void *pixels = NULL; int pitch = 0; /* fix static analysis */ int ret; - if (texture == NULL || surface == NULL) { + if (!texture || !surface) { return -1; } @@ -2150,7 +2186,7 @@ SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, } texture->locked_surface = SDL_CreateRGBSurfaceWithFormatFrom(pixels, real_rect.w, real_rect.h, 0, pitch, texture->format); - if (texture->locked_surface == NULL) { + if (!texture->locked_surface) { SDL_UnlockTexture(texture); return -1; } @@ -2160,8 +2196,7 @@ SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, } #if SDL_HAVE_YUV -static void -SDL_UnlockTextureYUV(SDL_Texture * texture) +static void SDL_UnlockTextureYUV(SDL_Texture *texture) { SDL_Texture *native = texture->native; void *native_pixels = NULL; @@ -2182,16 +2217,15 @@ SDL_UnlockTextureYUV(SDL_Texture * texture) } #endif /* SDL_HAVE_YUV */ -static void -SDL_UnlockTextureNative(SDL_Texture * texture) +static void SDL_UnlockTextureNative(SDL_Texture *texture) { SDL_Texture *native = texture->native; void *native_pixels = NULL; int native_pitch = 0; const SDL_Rect *rect = &texture->locked_rect; - const void* pixels = (void *) ((Uint8 *) texture->pixels + - rect->y * texture->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + const void *pixels = (void *)((Uint8 *)texture->pixels + + rect->y * texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); int pitch = texture->pitch; if (SDL_LockTexture(native, rect, &native_pixels, &native_pitch) < 0) { @@ -2203,8 +2237,7 @@ SDL_UnlockTextureNative(SDL_Texture * texture) SDL_UnlockTexture(native); } -void -SDL_UnlockTexture(SDL_Texture * texture) +void SDL_UnlockTexture(SDL_Texture *texture) { CHECK_TEXTURE_MAGIC(texture, ); @@ -2216,7 +2249,7 @@ SDL_UnlockTexture(SDL_Texture * texture) SDL_UnlockTextureYUV(texture); } else #endif - if (texture->native) { + if (texture->native) { SDL_UnlockTextureNative(texture); } else { SDL_Renderer *renderer = texture->renderer; @@ -2227,8 +2260,7 @@ SDL_UnlockTexture(SDL_Texture * texture) texture->locked_surface = NULL; } -SDL_bool -SDL_RenderTargetSupported(SDL_Renderer *renderer) +SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer) { if (!renderer || !renderer->SetRenderTarget) { return SDL_FALSE; @@ -2236,8 +2268,7 @@ SDL_RenderTargetSupported(SDL_Renderer *renderer) return (renderer->info.flags & SDL_RENDERER_TARGETTEXTURE) != 0; } -int -SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) +int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { if (!SDL_RenderTargetSupported(renderer)) { return SDL_Unsupported(); @@ -2263,7 +2294,7 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } - FlushRenderCommands(renderer); /* time to send everything to the GPU! */ + FlushRenderCommands(renderer); /* time to send everything to the GPU! */ SDL_LockMutex(renderer->target_mutex); @@ -2316,16 +2347,14 @@ SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return FlushRenderCommandsIfNotBatching(renderer); } -SDL_Texture * -SDL_GetRenderTarget(SDL_Renderer *renderer) +SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, NULL); return renderer->target; } -static int -UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) +static int UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) { int w = 1, h = 1; float want_aspect; @@ -2344,7 +2373,7 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) } hint = SDL_GetHint(SDL_HINT_RENDER_LOGICAL_SIZE_MODE); - if (hint && (*hint == '1' || SDL_strcasecmp(hint, "overscan") == 0)) { + if (hint && (*hint == '1' || SDL_strcasecmp(hint, "overscan") == 0)) { #if SDL_VIDEO_RENDER_D3D SDL_bool overscan_supported = SDL_TRUE; /* Unfortunately, Direct3D 9 doesn't support negative viewport numbers @@ -2369,9 +2398,9 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) if (renderer->integer_scale) { if (want_aspect > real_aspect) { - scale = (float)(w / renderer->logical_w); + scale = (float)(w / renderer->logical_w); /* This an integer division! */ } else { - scale = (float)(h / renderer->logical_h); + scale = (float)(h / renderer->logical_h); /* This an integer division! */ } if (scale < 1.0f) { @@ -2382,7 +2411,7 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) viewport.x = (w - viewport.w) / 2; viewport.h = (int)SDL_floor(renderer->logical_h * scale); viewport.y = (h - viewport.h) / 2; - } else if (SDL_fabs(want_aspect-real_aspect) < 0.0001) { + } else if (SDL_fabs(want_aspect - real_aspect) < 0.0001) { /* The aspect ratios are the same, just scale appropriately */ scale = (float)w / renderer->logical_w; @@ -2390,9 +2419,9 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) SDL_GetRendererOutputSize(renderer, &viewport.w, &viewport.h); } else if (want_aspect > real_aspect) { if (scale_policy == 1) { - /* We want a wider aspect ratio than is available - - zoom so logical height matches the real height - and the width will grow off the screen + /* We want a wider aspect ratio than is available - + zoom so logical height matches the real height + and the width will grow off the screen */ scale = (float)h / renderer->logical_h; viewport.y = 0; @@ -2420,11 +2449,11 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) viewport.y = (h - viewport.h) / 2; } else { /* We want a narrower aspect ratio than is available - use side-bars */ - scale = (float)h / renderer->logical_h; - viewport.y = 0; - viewport.h = h; - viewport.w = (int)SDL_floor(renderer->logical_w * scale); - viewport.x = (w - viewport.w) / 2; + scale = (float)h / renderer->logical_h; + viewport.y = 0; + viewport.h = h; + viewport.w = (int)SDL_floor(renderer->logical_w * scale); + viewport.x = (w - viewport.w) / 2; } } @@ -2444,8 +2473,7 @@ UpdateLogicalSize(SDL_Renderer *renderer, SDL_bool flush_viewport_cmd) return 0; } -int -SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h) +int SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2464,8 +2492,7 @@ SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h) return UpdateLogicalSize(renderer, SDL_TRUE); } -void -SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h) +void SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h) { CHECK_RENDERER_MAGIC(renderer, ); @@ -2477,8 +2504,7 @@ SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h) } } -int -SDL_RenderSetIntegerScale(SDL_Renderer * renderer, SDL_bool enable) +int SDL_RenderSetIntegerScale(SDL_Renderer *renderer, SDL_bool enable) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2487,16 +2513,14 @@ SDL_RenderSetIntegerScale(SDL_Renderer * renderer, SDL_bool enable) return UpdateLogicalSize(renderer, SDL_TRUE); } -SDL_bool -SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer) +SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, SDL_FALSE); return renderer->integer_scale; } -int -SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect) +int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect) { int retval; CHECK_RENDERER_MAGIC(renderer, -1); @@ -2511,17 +2535,18 @@ SDL_RenderSetViewport(SDL_Renderer * renderer, const SDL_Rect * rect) if (SDL_GetRendererOutputSize(renderer, &w, &h) < 0) { return -1; } - renderer->viewport.x = (double)0; - renderer->viewport.y = (double)0; + renderer->viewport.x = 0.0; + renderer->viewport.y = 0.0; + /* NOLINTBEGIN(clang-analyzer-core.uninitialized.Assign): SDL_GetRendererOutputSize cannot fail */ renderer->viewport.w = (double)w; renderer->viewport.h = (double)h; + /* NOLINTEND(clang-analyzer-core.uninitialized.Assign) */ } retval = QueueCmdSetViewport(renderer); return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -void -SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect) +void SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect) { CHECK_RENDERER_MAGIC(renderer, ); @@ -2533,8 +2558,7 @@ SDL_RenderGetViewport(SDL_Renderer * renderer, SDL_Rect * rect) } } -static void -RenderGetViewportSize(SDL_Renderer * renderer, SDL_FRect * rect) +static void RenderGetViewportSize(SDL_Renderer *renderer, SDL_FRect *rect) { rect->x = 0.0f; rect->y = 0.0f; @@ -2542,13 +2566,12 @@ RenderGetViewportSize(SDL_Renderer * renderer, SDL_FRect * rect) rect->h = (float)(renderer->viewport.h / renderer->scale.y); } -int -SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect) +int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) { int retval; CHECK_RENDERER_MAGIC(renderer, -1) - if (rect) { + if (rect && rect->w >= 0 && rect->h >= 0) { renderer->clipping_enabled = SDL_TRUE; renderer->clip_rect.x = (double)rect->x * renderer->scale.x; renderer->clip_rect.y = (double)rect->y * renderer->scale.y; @@ -2563,8 +2586,7 @@ SDL_RenderSetClipRect(SDL_Renderer * renderer, const SDL_Rect * rect) return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -void -SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect) +void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect) { CHECK_RENDERER_MAGIC(renderer, ) @@ -2576,15 +2598,13 @@ SDL_RenderGetClipRect(SDL_Renderer * renderer, SDL_Rect * rect) } } -SDL_bool -SDL_RenderIsClipEnabled(SDL_Renderer * renderer) +SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, SDL_FALSE) return renderer->clipping_enabled; } -int -SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY) +int SDL_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2593,8 +2613,7 @@ SDL_RenderSetScale(SDL_Renderer * renderer, float scaleX, float scaleY) return 0; } -void -SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY) +void SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) { CHECK_RENDERER_MAGIC(renderer, ); @@ -2606,15 +2625,14 @@ SDL_RenderGetScale(SDL_Renderer * renderer, float *scaleX, float *scaleY) } } -void -SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, float *logicalX, float *logicalY) +void SDL_RenderWindowToLogical(SDL_Renderer *renderer, int windowX, int windowY, float *logicalX, float *logicalY) { float window_physical_x, window_physical_y; CHECK_RENDERER_MAGIC(renderer, ); - window_physical_x = ((float) windowX) / renderer->dpi_scale.x; - window_physical_y = ((float) windowY) / renderer->dpi_scale.y; + window_physical_x = ((float)windowX) / renderer->dpi_scale.x; + window_physical_y = ((float)windowY) / renderer->dpi_scale.y; if (logicalX) { *logicalX = (float)((window_physical_x - renderer->viewport.x) / renderer->scale.x); @@ -2624,8 +2642,7 @@ SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, flo } } -void -SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logicalY, int *windowX, int *windowY) +void SDL_RenderLogicalToWindow(SDL_Renderer *renderer, float logicalX, float logicalY, int *windowX, int *windowY) { float window_physical_x, window_physical_y; @@ -2642,9 +2659,8 @@ SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logical } } -int -SDL_SetRenderDrawColor(SDL_Renderer * renderer, - Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_SetRenderDrawColor(SDL_Renderer *renderer, + Uint8 r, Uint8 g, Uint8 b, Uint8 a) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2655,9 +2671,8 @@ SDL_SetRenderDrawColor(SDL_Renderer * renderer, return 0; } -int -SDL_GetRenderDrawColor(SDL_Renderer * renderer, - Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) +int SDL_GetRenderDrawColor(SDL_Renderer *renderer, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2676,8 +2691,7 @@ SDL_GetRenderDrawColor(SDL_Renderer * renderer, return 0; } -int -SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2688,8 +2702,7 @@ SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) return 0; } -int -SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode) +int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -2697,8 +2710,7 @@ SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, SDL_BlendMode *blendMode) return 0; } -int -SDL_RenderClear(SDL_Renderer * renderer) +int SDL_RenderClear(SDL_Renderer *renderer) { int retval; CHECK_RENDERER_MAGIC(renderer, -1); @@ -2706,21 +2718,18 @@ SDL_RenderClear(SDL_Renderer * renderer) return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } - /* !!! FIXME: delete all the duplicate code for the integer versions in 2.1, !!! FIXME: making the floating point versions the only available APIs. */ -int -SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y) +int SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y) { SDL_FPoint fpoint; - fpoint.x = (float) x; - fpoint.y = (float) y; + fpoint.x = (float)x; + fpoint.y = (float)y; return SDL_RenderDrawPointsF(renderer, &fpoint, 1); } -int -SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y) +int SDL_RenderDrawPointF(SDL_Renderer *renderer, float x, float y) { SDL_FPoint fpoint; fpoint.x = x; @@ -2728,9 +2737,8 @@ SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y) return SDL_RenderDrawPointsF(renderer, &fpoint, 1); } -static int -RenderDrawPointsWithRects(SDL_Renderer * renderer, - const SDL_Point * points, const int count) +static int RenderDrawPointsWithRects(SDL_Renderer *renderer, + const SDL_Point *points, const int count) { int retval; SDL_bool isstack; @@ -2760,9 +2768,8 @@ RenderDrawPointsWithRects(SDL_Renderer * renderer, return retval; } -int -SDL_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count) +int SDL_RenderDrawPoints(SDL_Renderer *renderer, + const SDL_Point *points, int count) { SDL_FPoint *fpoints; int i; @@ -2793,8 +2800,8 @@ SDL_RenderDrawPoints(SDL_Renderer * renderer, return SDL_OutOfMemory(); } for (i = 0; i < count; ++i) { - fpoints[i].x = (float) points[i].x; - fpoints[i].y = (float) points[i].y; + fpoints[i].x = (float)points[i].x; + fpoints[i].y = (float)points[i].y; } retval = QueueCmdDrawPoints(renderer, fpoints, count); @@ -2804,9 +2811,8 @@ SDL_RenderDrawPoints(SDL_Renderer * renderer, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -static int -RenderDrawPointsWithRectsF(SDL_Renderer * renderer, - const SDL_FPoint * fpoints, const int count) +static int RenderDrawPointsWithRectsF(SDL_Renderer *renderer, + const SDL_FPoint *fpoints, const int count) { int retval; SDL_bool isstack; @@ -2836,9 +2842,8 @@ RenderDrawPointsWithRectsF(SDL_Renderer * renderer, return retval; } -int -SDL_RenderDrawPointsF(SDL_Renderer * renderer, - const SDL_FPoint * points, int count) +int SDL_RenderDrawPointsF(SDL_Renderer *renderer, + const SDL_FPoint *points, int count) { int retval; @@ -2866,19 +2871,17 @@ SDL_RenderDrawPointsF(SDL_Renderer * renderer, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) +int SDL_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2) { SDL_FPoint points[2]; - points[0].x = (float) x1; - points[0].y = (float) y1; - points[1].x = (float) x2; - points[1].y = (float) y2; + points[0].x = (float)x1; + points[0].y = (float)y1; + points[1].x = (float)x2; + points[1].y = (float)y2; return SDL_RenderDrawLinesF(renderer, points, 2); } -int -SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2) +int SDL_RenderDrawLineF(SDL_Renderer *renderer, float x1, float y1, float x2, float y2) { SDL_FPoint points[2]; points[0].x = x1; @@ -2897,6 +2900,18 @@ static int RenderDrawLineBresenham(SDL_Renderer *renderer, int x1, int y1, int x int retval; SDL_bool isstack; SDL_FPoint *points; + SDL_Rect clip_rect; + + /* the backend might clip this further to the clipping rect, but we + just want a basic safety against generating millions of points for + massive lines. */ + clip_rect.x = 0; + clip_rect.y = 0; + clip_rect.w = (int) renderer->viewport.w; + clip_rect.h = (int) renderer->viewport.h; + if (!SDL_IntersectRectAndLine(&clip_rect, &x1, &y1, &x2, &y2)) { + return 0; + } deltax = SDL_abs(x2 - x1); deltay = SDL_abs(y2 - y1); @@ -2967,9 +2982,8 @@ static int RenderDrawLineBresenham(SDL_Renderer *renderer, int x1, int y1, int x return retval; } -static int -RenderDrawLinesWithRectsF(SDL_Renderer * renderer, - const SDL_FPoint * points, const int count) +static int RenderDrawLinesWithRectsF(SDL_Renderer *renderer, + const SDL_FPoint *points, const int count) { const float scale_x = renderer->scale.x; const float scale_y = renderer->scale.y; @@ -2981,17 +2995,17 @@ RenderDrawLinesWithRectsF(SDL_Renderer * renderer, SDL_bool drew_line = SDL_FALSE; SDL_bool draw_last = SDL_FALSE; - frects = SDL_small_alloc(SDL_FRect, count-1, &isstack); + frects = SDL_small_alloc(SDL_FRect, count - 1, &isstack); if (!frects) { return SDL_OutOfMemory(); } - for (i = 0; i < count-1; ++i) { - SDL_bool same_x = (points[i].x == points[i+1].x); - SDL_bool same_y = (points[i].y == points[i+1].y); + for (i = 0; i < count - 1; ++i) { + SDL_bool same_x = (points[i].x == points[i + 1].x); + SDL_bool same_y = (points[i].y == points[i + 1].y); if (i == (count - 2)) { - if (!drew_line || points[i+1].x != points[0].x || points[i+1].y != points[0].y) { + if (!drew_line || points[i + 1].x != points[0].x || points[i + 1].y != points[0].y) { draw_last = SDL_TRUE; } } else { @@ -3000,32 +3014,32 @@ RenderDrawLinesWithRectsF(SDL_Renderer * renderer, } } if (same_x) { - const float minY = SDL_min(points[i].y, points[i+1].y); - const float maxY = SDL_max(points[i].y, points[i+1].y); + const float minY = SDL_min(points[i].y, points[i + 1].y); + const float maxY = SDL_max(points[i].y, points[i + 1].y); frect = &frects[nrects++]; frect->x = points[i].x * scale_x; frect->y = minY * scale_y; frect->w = scale_x; frect->h = (maxY - minY + draw_last) * scale_y; - if (!draw_last && points[i+1].y < points[i].y) { + if (!draw_last && points[i + 1].y < points[i].y) { frect->y += scale_y; } } else if (same_y) { - const float minX = SDL_min(points[i].x, points[i+1].x); - const float maxX = SDL_max(points[i].x, points[i+1].x); + const float minX = SDL_min(points[i].x, points[i + 1].x); + const float maxX = SDL_max(points[i].x, points[i + 1].x); frect = &frects[nrects++]; frect->x = minX * scale_x; frect->y = points[i].y * scale_y; frect->w = (maxX - minX + draw_last) * scale_x; frect->h = scale_y; - if (!draw_last && points[i+1].x < points[i].x) { + if (!draw_last && points[i + 1].x < points[i].x) { frect->x += scale_x; } } else { retval += RenderDrawLineBresenham(renderer, (int)SDL_roundf(points[i].x), (int)SDL_roundf(points[i].y), - (int)SDL_roundf(points[i+1].x), (int)SDL_roundf(points[i+1].y), draw_last); + (int)SDL_roundf(points[i + 1].x), (int)SDL_roundf(points[i + 1].y), draw_last); } drew_line = SDL_TRUE; } @@ -3042,9 +3056,8 @@ RenderDrawLinesWithRectsF(SDL_Renderer * renderer, return retval; } -int -SDL_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count) +int SDL_RenderDrawLines(SDL_Renderer *renderer, + const SDL_Point *points, int count) { SDL_FPoint *fpoints; int i; @@ -3073,8 +3086,8 @@ SDL_RenderDrawLines(SDL_Renderer * renderer, } for (i = 0; i < count; ++i) { - fpoints[i].x = (float) points[i].x; - fpoints[i].y = (float) points[i].y; + fpoints[i].x = (float)points[i].x; + fpoints[i].y = (float)points[i].y; } retval = SDL_RenderDrawLinesF(renderer, fpoints, count); @@ -3084,9 +3097,8 @@ SDL_RenderDrawLines(SDL_Renderer * renderer, return retval; } -int -SDL_RenderDrawLinesF(SDL_Renderer * renderer, - const SDL_FPoint * points, int count) +int SDL_RenderDrawLinesF(SDL_Renderer *renderer, + const SDL_FPoint *points, int count) { int retval = 0; @@ -3115,15 +3127,13 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, const float scale_y = renderer->scale.y; float *xy = SDL_small_alloc(float, 4 * 2 * count, &isstack1); int *indices = SDL_small_alloc(int, - (4) * 3 * (count - 1) - + (2) * 3 * (count) - , &isstack2); + (4) * 3 * (count - 1) + (2) * 3 * (count), &isstack2); if (xy && indices) { int i; float *ptr_xy = xy; int *ptr_indices = indices; - const int xy_stride = 2 * sizeof (float); + const int xy_stride = 2 * sizeof(float); int num_vertices = 4 * count; int num_indices = 0; const int size_indices = 4; @@ -3153,11 +3163,11 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, *ptr_xy++ = q.x; *ptr_xy++ = q.y + scale_y; -#define ADD_TRIANGLE(i1, i2, i3) \ - *ptr_indices++ = cur_index + i1; \ - *ptr_indices++ = cur_index + i2; \ - *ptr_indices++ = cur_index + i3; \ - num_indices += 3; \ +#define ADD_TRIANGLE(i1, i2, i3) \ + *ptr_indices++ = cur_index + i1; \ + *ptr_indices++ = cur_index + i2; \ + *ptr_indices++ = cur_index + i3; \ + num_indices += 3; /* closed polyline, don´t draw twice the point */ if (i || is_looping == 0) { @@ -3222,10 +3232,9 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, } retval = QueueCmdGeometry(renderer, NULL, - xy, xy_stride, &renderer->color, 0 /* color_stride */, NULL, 0, - num_vertices, indices, num_indices, size_indices, - 1.0f, 1.0f); - + xy, xy_stride, &renderer->color, 0 /* color_stride */, NULL, 0, + num_vertices, indices, num_indices, size_indices, + 1.0f, 1.0f); } SDL_small_free(xy, isstack1); @@ -3240,25 +3249,23 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderDrawRect(SDL_Renderer * renderer, const SDL_Rect * rect) +int SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect) { SDL_FRect frect; SDL_FRect *prect = NULL; if (rect) { - frect.x = (float) rect->x; - frect.y = (float) rect->y; - frect.w = (float) rect->w; - frect.h = (float) rect->h; + frect.x = (float)rect->x; + frect.y = (float)rect->y; + frect.w = (float)rect->w; + frect.h = (float)rect->h; prect = &frect; } return SDL_RenderDrawRectF(renderer, prect); } -int -SDL_RenderDrawRectF(SDL_Renderer * renderer, const SDL_FRect * rect) +int SDL_RenderDrawRectF(SDL_Renderer *renderer, const SDL_FRect *rect) { SDL_FRect frect; SDL_FPoint points[5]; @@ -3273,20 +3280,19 @@ SDL_RenderDrawRectF(SDL_Renderer * renderer, const SDL_FRect * rect) points[0].x = rect->x; points[0].y = rect->y; - points[1].x = rect->x+rect->w-1; + points[1].x = rect->x + rect->w - 1; points[1].y = rect->y; - points[2].x = rect->x+rect->w-1; - points[2].y = rect->y+rect->h-1; + points[2].x = rect->x + rect->w - 1; + points[2].y = rect->y + rect->h - 1; points[3].x = rect->x; - points[3].y = rect->y+rect->h-1; + points[3].y = rect->y + rect->h - 1; points[4].x = rect->x; points[4].y = rect->y; return SDL_RenderDrawLinesF(renderer, points, 5); } -int -SDL_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect * rects, int count) +int SDL_RenderDrawRects(SDL_Renderer *renderer, + const SDL_Rect *rects, int count) { int i; @@ -3314,9 +3320,8 @@ SDL_RenderDrawRects(SDL_Renderer * renderer, return 0; } -int -SDL_RenderDrawRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, int count) +int SDL_RenderDrawRectsF(SDL_Renderer *renderer, + const SDL_FRect *rects, int count) { int i; @@ -3344,8 +3349,7 @@ SDL_RenderDrawRectsF(SDL_Renderer * renderer, return 0; } -int -SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) +int SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect) { SDL_FRect frect; @@ -3353,18 +3357,17 @@ SDL_RenderFillRect(SDL_Renderer * renderer, const SDL_Rect * rect) /* If 'rect' == NULL, then outline the whole surface */ if (rect) { - frect.x = (float) rect->x; - frect.y = (float) rect->y; - frect.w = (float) rect->w; - frect.h = (float) rect->h; + frect.x = (float)rect->x; + frect.y = (float)rect->y; + frect.w = (float)rect->w; + frect.h = (float)rect->h; } else { RenderGetViewportSize(renderer, &frect); } return SDL_RenderFillRectsF(renderer, &frect, 1); } -int -SDL_RenderFillRectF(SDL_Renderer * renderer, const SDL_FRect * rect) +int SDL_RenderFillRectF(SDL_Renderer *renderer, const SDL_FRect *rect) { SDL_FRect frect; @@ -3378,9 +3381,8 @@ SDL_RenderFillRectF(SDL_Renderer * renderer, const SDL_FRect * rect) return SDL_RenderFillRectsF(renderer, rect, 1); } -int -SDL_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect * rects, int count) +int SDL_RenderFillRects(SDL_Renderer *renderer, + const SDL_Rect *rects, int count) { SDL_FRect *frects; int i; @@ -3421,9 +3423,8 @@ SDL_RenderFillRects(SDL_Renderer * renderer, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderFillRectsF(SDL_Renderer * renderer, - const SDL_FRect * rects, int count) +int SDL_RenderFillRectsF(SDL_Renderer *renderer, + const SDL_FRect *rects, int count) { SDL_FRect *frects; int i; @@ -3464,32 +3465,29 @@ SDL_RenderFillRectsF(SDL_Renderer * renderer, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect) +int SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_Rect *dstrect) { SDL_FRect dstfrect; SDL_FRect *pdstfrect = NULL; if (dstrect) { - dstfrect.x = (float) dstrect->x; - dstfrect.y = (float) dstrect->y; - dstfrect.w = (float) dstrect->w; - dstfrect.h = (float) dstrect->h; + dstfrect.x = (float)dstrect->x; + dstfrect.y = (float)dstrect->y; + dstfrect.w = (float)dstrect->w; + dstfrect.h = (float)dstrect->h; pdstfrect = &dstfrect; } return SDL_RenderCopyF(renderer, texture, srcrect, pdstfrect); } -int -SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect) +int SDL_RenderCopyF(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect) { SDL_Rect real_srcrect; SDL_FRect real_dstrect; int retval; int use_rendergeometry; - CHECK_RENDERER_MAGIC(renderer, -1); CHECK_TEXTURE_MAGIC(texture, -1); @@ -3504,7 +3502,7 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, } #endif - use_rendergeometry = (renderer->QueueCopy == NULL); + use_rendergeometry = (!renderer->QueueCopy); real_srcrect.x = 0; real_srcrect.y = 0; @@ -3532,9 +3530,9 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, if (use_rendergeometry) { float xy[8]; - const int xy_stride = 2 * sizeof (float); + const int xy_stride = 2 * sizeof(float); float uv[8]; - const int uv_stride = 2 * sizeof (float); + const int uv_stride = 2 * sizeof(float); const int num_vertices = 4; const int *indices = renderer->rect_index_order; const int num_indices = 6; @@ -3542,10 +3540,10 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, float minu, minv, maxu, maxv; float minx, miny, maxx, maxy; - minu = (float) (real_srcrect.x) / (float) texture->w; - minv = (float) (real_srcrect.y) / (float) texture->h; - maxu = (float) (real_srcrect.x + real_srcrect.w) / (float) texture->w; - maxv = (float) (real_srcrect.y + real_srcrect.h) / (float) texture->h; + minu = (float)(real_srcrect.x) / (float)texture->w; + minv = (float)(real_srcrect.y) / (float)texture->h; + maxu = (float)(real_srcrect.x + real_srcrect.w) / (float)texture->w; + maxv = (float)(real_srcrect.y + real_srcrect.h) / (float)texture->h; minx = real_dstrect.x; miny = real_dstrect.y; @@ -3571,10 +3569,10 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, xy[7] = maxy; retval = QueueCmdGeometry(renderer, texture, - xy, xy_stride, &texture->color, 0 /* color_stride */, uv, uv_stride, - num_vertices, - indices, num_indices, size_indices, - renderer->scale.x, renderer->scale.y); + xy, xy_stride, &texture->color, 0 /* color_stride */, uv, uv_stride, + num_vertices, + indices, num_indices, size_indices, + renderer->scale.x, renderer->scale.y); } else { real_dstrect.x *= renderer->scale.x; @@ -3587,10 +3585,9 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect, - const double angle, const SDL_Point *center, const SDL_RendererFlip flip) +int SDL_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_Rect *dstrect, + const double angle, const SDL_Point *center, const SDL_RendererFlip flip) { SDL_FRect dstfrect; SDL_FRect *pdstfrect = NULL; @@ -3598,26 +3595,25 @@ SDL_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture, SDL_FPoint *pfcenter = NULL; if (dstrect) { - dstfrect.x = (float) dstrect->x; - dstfrect.y = (float) dstrect->y; - dstfrect.w = (float) dstrect->w; - dstfrect.h = (float) dstrect->h; + dstfrect.x = (float)dstrect->x; + dstfrect.y = (float)dstrect->y; + dstfrect.w = (float)dstrect->w; + dstfrect.h = (float)dstrect->h; pdstfrect = &dstfrect; } if (center) { - fcenter.x = (float) center->x; - fcenter.y = (float) center->y; + fcenter.x = (float)center->x; + fcenter.y = (float)center->y; pfcenter = &fcenter; } return SDL_RenderCopyExF(renderer, texture, srcrect, pdstfrect, angle, pfcenter, flip); } -int -SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect, - const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) +int SDL_RenderCopyExF(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip) { SDL_Rect real_srcrect; SDL_FRect real_dstrect; @@ -3625,7 +3621,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, int retval; int use_rendergeometry; - if (flip == SDL_FLIP_NONE && (int)(angle/360) == angle/360) { /* fast path when we don't need rotation or flipping */ + if (flip == SDL_FLIP_NONE && (int)(angle / 360) == angle / 360) { /* fast path when we don't need rotation or flipping */ return SDL_RenderCopyF(renderer, texture, srcrect, dstrect); } @@ -3646,7 +3642,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, } #endif - use_rendergeometry = (renderer->QueueCopyEx == NULL); + use_rendergeometry = (!renderer->QueueCopyEx); real_srcrect.x = 0; real_srcrect.y = 0; @@ -3680,9 +3676,9 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, if (use_rendergeometry) { float xy[8]; - const int xy_stride = 2 * sizeof (float); + const int xy_stride = 2 * sizeof(float); float uv[8]; - const int uv_stride = 2 * sizeof (float); + const int uv_stride = 2 * sizeof(float); const int num_vertices = 4; const int *indices = renderer->rect_index_order; const int num_indices = 6; @@ -3698,10 +3694,10 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, const float s = SDL_sinf(radian_angle); const float c = SDL_cosf(radian_angle); - minu = (float) (real_srcrect.x) / (float) texture->w; - minv = (float) (real_srcrect.y) / (float) texture->h; - maxu = (float) (real_srcrect.x + real_srcrect.w) / (float) texture->w; - maxv = (float) (real_srcrect.y + real_srcrect.h) / (float) texture->h; + minu = (float)(real_srcrect.x) / (float)texture->w; + minv = (float)(real_srcrect.y) / (float)texture->h; + maxu = (float)(real_srcrect.x + real_srcrect.w) / (float)texture->w; + maxv = (float)(real_srcrect.y + real_srcrect.h) / (float)texture->h; centerx = real_center.x + real_dstrect.x; centery = real_center.y + real_dstrect.y; @@ -3756,10 +3752,10 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, xy[7] = (s_minx + c_maxy) + centery; retval = QueueCmdGeometry(renderer, texture, - xy, xy_stride, &texture->color, 0 /* color_stride */, uv, uv_stride, - num_vertices, - indices, num_indices, size_indices, - renderer->scale.x, renderer->scale.y); + xy, xy_stride, &texture->color, 0 /* color_stride */, uv, uv_stride, + num_vertices, + indices, num_indices, size_indices, + renderer->scale.x, renderer->scale.y); } else { retval = QueueCmdCopyEx(renderer, texture, &real_srcrect, &real_dstrect, angle, &real_center, flip, renderer->scale.x, renderer->scale.y); @@ -3767,19 +3763,18 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture, return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } -int -SDL_RenderGeometry(SDL_Renderer *renderer, - SDL_Texture *texture, - const SDL_Vertex *vertices, int num_vertices, - const int *indices, int num_indices) +int SDL_RenderGeometry(SDL_Renderer *renderer, + SDL_Texture *texture, + const SDL_Vertex *vertices, int num_vertices, + const int *indices, int num_indices) { if (vertices) { const float *xy = &vertices->position.x; - int xy_stride = sizeof (SDL_Vertex); + int xy_stride = sizeof(SDL_Vertex); const SDL_Color *color = &vertices->color; - int color_stride = sizeof (SDL_Vertex); + int color_stride = sizeof(SDL_Vertex); const float *uv = &vertices->tex_coord.x; - int uv_stride = sizeof (SDL_Vertex); + int uv_stride = sizeof(SDL_Vertex); int size_indices = 4; return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); } else { @@ -3787,19 +3782,18 @@ SDL_RenderGeometry(SDL_Renderer *renderer, } } -static int -remap_one_indice( - int prev, - int k, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride) +static int remap_one_indice( + int prev, + int k, + SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride) { const float *xy0_, *xy1_, *uv0_, *uv1_; int col0_, col1_; - xy0_ = (const float *)((const char*)xy + prev * xy_stride); - xy1_ = (const float *)((const char*)xy + k * xy_stride); + xy0_ = (const float *)((const char *)xy + prev * xy_stride); + xy1_ = (const float *)((const char *)xy + k * xy_stride); if (xy0_[0] != xy1_[0]) { return k; } @@ -3807,8 +3801,8 @@ remap_one_indice( return k; } if (texture) { - uv0_ = (const float *)((const char*)uv + prev * uv_stride); - uv1_ = (const float *)((const char*)uv + k * uv_stride); + uv0_ = (const float *)((const char *)uv + prev * uv_stride); + uv1_ = (const float *)((const char *)uv + k * uv_stride); if (uv0_[0] != uv1_[0]) { return k; } @@ -3816,8 +3810,8 @@ remap_one_indice( return k; } } - col0_ = *(const int *)((const char*)color + prev * color_stride); - col1_ = *(const int *)((const char*)color + k * color_stride); + col0_ = *(const int *)((const char *)color + prev * color_stride); + col1_ = *(const int *)((const char *)color + k * color_stride); if (col0_ != col1_) { return k; @@ -3826,14 +3820,13 @@ remap_one_indice( return prev; } -static int -remap_indices( - int prev[3], - int k, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride) +static int remap_indices( + int prev[3], + int k, + SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride) { int i; if (prev[0] == -1) { @@ -3851,14 +3844,13 @@ remap_indices( #define DEBUG_SW_RENDER_GEOMETRY 0 /* For the software renderer, try to reinterpret triangles as SDL_Rect */ -static int SDLCALL -SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride, - int num_vertices, - const void *indices, int num_indices, int size_indices) +static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, + SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride, + int num_vertices, + const void *indices, int num_indices, int size_indices) { int i; int retval = 0; @@ -3876,7 +3868,9 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, SDL_QueryTexture(texture, NULL, NULL, &texw, &texh); } - prev[0] = -1; prev[1] = -1; prev[2] = -1; + prev[0] = -1; + prev[1] = -1; + prev[2] = -1; size_indices = indices ? size_indices : 0; for (i = 0; i < count; i += 3) { @@ -3936,12 +3930,15 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, const float *xy0_, *xy1_, *xy2_; float x0, x1, x2; float y0, y1, y2; - xy0_ = (const float *)((const char*)xy + k0 * xy_stride); - xy1_ = (const float *)((const char*)xy + k1 * xy_stride); - xy2_ = (const float *)((const char*)xy + k2 * xy_stride); - x0 = xy0_[0]; y0 = xy0_[1]; - x1 = xy1_[0]; y1 = xy1_[1]; - x2 = xy2_[0]; y2 = xy2_[1]; + xy0_ = (const float *)((const char *)xy + k0 * xy_stride); + xy1_ = (const float *)((const char *)xy + k1 * xy_stride); + xy2_ = (const float *)((const char *)xy + k2 * xy_stride); + x0 = xy0_[0]; + y0 = xy0_[1]; + x1 = xy1_[0]; + y1 = xy1_[1]; + x2 = xy2_[0]; + y2 = xy2_[1]; /* Find top-left */ if (x0 <= x1 && y0 <= y1) { @@ -3991,15 +3988,18 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, C2 = prev[2]; } - xy0_ = (const float *)((const char*)xy + A * xy_stride); - xy1_ = (const float *)((const char*)xy + B * xy_stride); - xy2_ = (const float *)((const char*)xy + C * xy_stride); - x0 = xy0_[0]; y0 = xy0_[1]; - x1 = xy1_[0]; y1 = xy1_[1]; - x2 = xy2_[0]; y2 = xy2_[1]; + xy0_ = (const float *)((const char *)xy + A * xy_stride); + xy1_ = (const float *)((const char *)xy + B * xy_stride); + xy2_ = (const float *)((const char *)xy + C * xy_stride); + x0 = xy0_[0]; + y0 = xy0_[1]; + x1 = xy1_[0]; + y1 = xy1_[1]; + x2 = xy2_[0]; + y2 = xy2_[1]; /* Check if triangle A B C is rectangle */ - if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)){ + if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)) { /* ok */ } else { is_quad = 0; @@ -4008,11 +4008,12 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, #endif } - xy2_ = (const float *)((const char*)xy + C2 * xy_stride); - x2 = xy2_[0]; y2 = xy2_[1]; + xy2_ = (const float *)((const char *)xy + C2 * xy_stride); + x2 = xy2_[0]; + y2 = xy2_[1]; /* Check if triangle A B C2 is rectangle */ - if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)){ + if ((x0 == x2 && y1 == y2) || (y0 == y2 && x1 == x2)) { /* ok */ } else { is_quad = 0; @@ -4024,10 +4025,10 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, /* Check if uniformly colored */ if (is_quad) { - const int col0_ = *(const int *)((const char*)color + A * color_stride); - const int col1_ = *(const int *)((const char*)color + B * color_stride); - const int col2_ = *(const int *)((const char*)color + C * color_stride); - const int col3_ = *(const int *)((const char*)color + C2 * color_stride); + const int col0_ = *(const int *)((const char *)color + A * color_stride); + const int col1_ = *(const int *)((const char *)color + B * color_stride); + const int col2_ = *(const int *)((const char *)color + C * color_stride); + const int col3_ = *(const int *)((const char *)color + C2 * color_stride); if (col0_ == col1_ && col0_ == col2_ && col0_ == col3_) { /* ok */ } else { @@ -4043,18 +4044,18 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Rect s; SDL_FRect d; const float *xy0_, *xy1_, *uv0_, *uv1_; - SDL_Color col0_ = *(const SDL_Color *)((const char*)color + k0 * color_stride); + SDL_Color col0_ = *(const SDL_Color *)((const char *)color + k0 * color_stride); - xy0_ = (const float *)((const char*)xy + A * xy_stride); - xy1_ = (const float *)((const char*)xy + B * xy_stride); + xy0_ = (const float *)((const char *)xy + A * xy_stride); + xy1_ = (const float *)((const char *)xy + B * xy_stride); if (texture) { - uv0_ = (const float *)((const char*)uv + A * uv_stride); - uv1_ = (const float *)((const char*)uv + B * uv_stride); - s.x = (int) (uv0_[0] * texw); - s.y = (int) (uv0_[1] * texh); - s.w = (int) (uv1_[0] * texw - s.x); - s.h = (int) (uv1_[1] * texh - s.y); + uv0_ = (const float *)((const char *)uv + A * uv_stride); + uv1_ = (const float *)((const char *)uv + B * uv_stride); + s.x = (int)(uv0_[0] * texw); + s.y = (int)(uv0_[1] * texh); + s.w = (int)(uv1_[0] * texw - s.x); + s.h = (int)(uv1_[1] * texh - s.y); } d.x = xy0_[0]; @@ -4121,7 +4122,7 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, prev[1] = k1; prev[2] = k2; } - } /* End for(), next triangle */ + } /* End for (), next triangle */ if (prev[0] != -1) { /* flush the last triangle */ @@ -4146,14 +4147,13 @@ SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, return retval; } -int -SDL_RenderGeometryRaw(SDL_Renderer *renderer, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride, - int num_vertices, - const void *indices, int num_indices, int size_indices) +int SDL_RenderGeometryRaw(SDL_Renderer *renderer, + SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride, + int num_vertices, + const void *indices, int num_indices, int size_indices) { int i; int retval = 0; @@ -4214,7 +4214,7 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer, if (texture) { for (i = 0; i < num_vertices; ++i) { - const float *uv_ = (const float *)((const char*)uv + i * uv_stride); + const float *uv_ = (const float *)((const char *)uv + i * uv_stride); float u = uv_[0]; float v = uv_[1]; if (u < 0.0f || v < 0.0f || u > 1.0f || v > 1.0f) { @@ -4246,23 +4246,21 @@ SDL_RenderGeometryRaw(SDL_Renderer *renderer, /* For the software renderer, try to reinterpret triangles as SDL_Rect */ if (renderer->info.flags & SDL_RENDERER_SOFTWARE) { return SDL_SW_RenderGeometryRaw(renderer, texture, - xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, - indices, num_indices, size_indices); + xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, + indices, num_indices, size_indices); } retval = QueueCmdGeometry(renderer, texture, - xy, xy_stride, color, color_stride, uv, uv_stride, - num_vertices, - indices, num_indices, size_indices, - renderer->scale.x, renderer->scale.y); + xy, xy_stride, color, color_stride, uv, uv_stride, + num_vertices, + indices, num_indices, size_indices, + renderer->scale.x, renderer->scale.y); return retval < 0 ? retval : FlushRenderCommandsIfNotBatching(renderer); } - -int -SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { SDL_Rect real_rect; @@ -4272,10 +4270,10 @@ SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return SDL_Unsupported(); } - FlushRenderCommands(renderer); /* we need to render before we read the results. */ + FlushRenderCommands(renderer); /* we need to render before we read the results. */ if (!format) { - if (renderer->target == NULL) { + if (!renderer->target) { format = SDL_GetWindowPixelFormat(renderer->window); } else { format = renderer->target->format; @@ -4303,8 +4301,7 @@ SDL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, format, pixels, pitch); } -static void -SDL_RenderSimulateVSync(SDL_Renderer * renderer) +static void SDL_RenderSimulateVSync(SDL_Renderer *renderer) { Uint32 now, elapsed; const Uint32 interval = renderer->simulate_vsync_interval; @@ -4331,14 +4328,13 @@ SDL_RenderSimulateVSync(SDL_Renderer * renderer) } } -void -SDL_RenderPresent(SDL_Renderer * renderer) +void SDL_RenderPresent(SDL_Renderer *renderer) { SDL_bool presented = SDL_TRUE; CHECK_RENDERER_MAGIC(renderer, ); - FlushRenderCommands(renderer); /* time to send everything to the GPU! */ + FlushRenderCommands(renderer); /* time to send everything to the GPU! */ #if DONT_DRAW_WHILE_HIDDEN /* Don't present while we're hidden */ @@ -4346,18 +4342,17 @@ SDL_RenderPresent(SDL_Renderer * renderer) presented = SDL_FALSE; } else #endif - if (renderer->RenderPresent(renderer) < 0) { + if (renderer->RenderPresent(renderer) < 0) { presented = SDL_FALSE; } - if (renderer->simulate_vsync || + if (renderer->simulate_vsync || (!presented && renderer->wanted_vsync)) { SDL_RenderSimulateVSync(renderer); } } -void -SDL_DestroyTexture(SDL_Texture * texture) +void SDL_DestroyTexture(SDL_Texture *texture) { SDL_Renderer *renderer; @@ -4365,7 +4360,7 @@ SDL_DestroyTexture(SDL_Texture * texture) renderer = texture->renderer; if (texture == renderer->target) { - SDL_SetRenderTarget(renderer, NULL); /* implies command queue flush */ + SDL_SetRenderTarget(renderer, NULL); /* implies command queue flush */ } else { FlushRenderCommandsIfTextureNeeded(texture); } @@ -4399,16 +4394,18 @@ SDL_DestroyTexture(SDL_Texture * texture) SDL_free(texture); } -void -SDL_DestroyRenderer(SDL_Renderer * renderer) +void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer) { SDL_RenderCommand *cmd; - CHECK_RENDERER_MAGIC(renderer, ); + SDL_assert(renderer != NULL); + SDL_assert(!renderer->destroyed); + + renderer->destroyed = SDL_TRUE; SDL_DelEventWatch(SDL_RendererEventWatch, renderer); - if (renderer->render_commands_tail != NULL) { + if (renderer->render_commands_tail) { renderer->render_commands_tail->next = renderer->render_commands_pool; cmd = renderer->render_commands; } else { @@ -4419,7 +4416,7 @@ SDL_DestroyRenderer(SDL_Renderer * renderer) renderer->render_commands_tail = NULL; renderer->render_commands = NULL; - while (cmd != NULL) { + while (cmd) { SDL_RenderCommand *next = cmd->next; SDL_free(cmd); cmd = next; @@ -4429,18 +4426,16 @@ SDL_DestroyRenderer(SDL_Renderer * renderer) /* Free existing textures for this renderer */ while (renderer->textures) { - SDL_Texture *tex = renderer->textures; (void) tex; + SDL_Texture *tex = renderer->textures; + (void)tex; SDL_DestroyTexture(renderer->textures); - SDL_assert(tex != renderer->textures); /* satisfy static analysis. */ + SDL_assert(tex != renderer->textures); /* satisfy static analysis. */ } if (renderer->window) { SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL); } - /* It's no longer magical... */ - renderer->magic = NULL; - /* Free the target mutex */ SDL_DestroyMutex(renderer->target_mutex); renderer->target_mutex = NULL; @@ -4449,6 +4444,22 @@ SDL_DestroyRenderer(SDL_Renderer * renderer) renderer->DestroyRenderer(renderer); } +void SDL_DestroyRenderer(SDL_Renderer *renderer) +{ + CHECK_RENDERER_MAGIC_BUT_NOT_DESTROYED_FLAG(renderer,); + + /* if we've already destroyed the renderer through SDL_DestroyWindow, we just need + to free the renderer pointer. This lets apps destroy the window and renderer + in either order. */ + if (!renderer->destroyed) { + SDL_DestroyRendererWithoutFreeing(renderer); + renderer->magic = NULL; // It's no longer magical... + } + + SDL_free(renderer); +} + + int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) { SDL_Renderer *renderer; @@ -4458,7 +4469,7 @@ int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) if (texture->native) { return SDL_GL_BindTexture(texture->native, texw, texh); } else if (renderer && renderer->GL_BindTexture) { - FlushRenderCommandsIfTextureNeeded(texture); /* in case the app is going to mess with it. */ + FlushRenderCommandsIfTextureNeeded(texture); /* in case the app is going to mess with it. */ return renderer->GL_BindTexture(renderer, texture, texw, texh); } else { return SDL_Unsupported(); @@ -4474,39 +4485,36 @@ int SDL_GL_UnbindTexture(SDL_Texture *texture) if (texture->native) { return SDL_GL_UnbindTexture(texture->native); } else if (renderer && renderer->GL_UnbindTexture) { - FlushRenderCommandsIfTextureNeeded(texture); /* in case the app messed with it. */ + FlushRenderCommandsIfTextureNeeded(texture); /* in case the app messed with it. */ return renderer->GL_UnbindTexture(renderer, texture); } return SDL_Unsupported(); } -void * -SDL_RenderGetMetalLayer(SDL_Renderer * renderer) +void *SDL_RenderGetMetalLayer(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, NULL); if (renderer->GetMetalLayer) { - FlushRenderCommands(renderer); /* in case the app is going to mess with it. */ + FlushRenderCommands(renderer); /* in case the app is going to mess with it. */ return renderer->GetMetalLayer(renderer); } return NULL; } -void * -SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer) +void *SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer) { CHECK_RENDERER_MAGIC(renderer, NULL); if (renderer->GetMetalCommandEncoder) { - FlushRenderCommands(renderer); /* in case the app is going to mess with it. */ + FlushRenderCommands(renderer); /* in case the app is going to mess with it. */ return renderer->GetMetalCommandEncoder(renderer); } return NULL; } -static SDL_BlendMode -SDL_GetShortBlendMode(SDL_BlendMode blendMode) +static SDL_BlendMode SDL_GetShortBlendMode(SDL_BlendMode blendMode) { if (blendMode == SDL_BLENDMODE_NONE_FULL) { return SDL_BLENDMODE_NONE; @@ -4526,8 +4534,7 @@ SDL_GetShortBlendMode(SDL_BlendMode blendMode) return blendMode; } -static SDL_BlendMode -SDL_GetLongBlendMode(SDL_BlendMode blendMode) +static SDL_BlendMode SDL_GetLongBlendMode(SDL_BlendMode blendMode) { if (blendMode == SDL_BLENDMODE_NONE) { return SDL_BLENDMODE_NONE_FULL; @@ -4547,8 +4554,7 @@ SDL_GetLongBlendMode(SDL_BlendMode blendMode) return blendMode; } -SDL_BlendMode -SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, +SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation) @@ -4558,50 +4564,43 @@ SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstCo return SDL_GetShortBlendMode(blendMode); } -SDL_BlendFactor -SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode) +SDL_BlendFactor SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendFactor)(((Uint32)blendMode >> 4) & 0xF); } -SDL_BlendFactor -SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode) +SDL_BlendFactor SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendFactor)(((Uint32)blendMode >> 8) & 0xF); } -SDL_BlendOperation -SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode) +SDL_BlendOperation SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendOperation)(((Uint32)blendMode >> 0) & 0xF); } -SDL_BlendFactor -SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode) +SDL_BlendFactor SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendFactor)(((Uint32)blendMode >> 20) & 0xF); } -SDL_BlendFactor -SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode) +SDL_BlendFactor SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendFactor)(((Uint32)blendMode >> 24) & 0xF); } -SDL_BlendOperation -SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode) +SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode) { blendMode = SDL_GetLongBlendMode(blendMode); return (SDL_BlendOperation)(((Uint32)blendMode >> 16) & 0xF); } -int -SDL_RenderSetVSync(SDL_Renderer * renderer, int vsync) +int SDL_RenderSetVSync(SDL_Renderer *renderer, int vsync) { CHECK_RENDERER_MAGIC(renderer, -1); @@ -4612,8 +4611,13 @@ SDL_RenderSetVSync(SDL_Renderer * renderer, int vsync) renderer->wanted_vsync = vsync ? SDL_TRUE : SDL_FALSE; if (!renderer->SetVSync || - renderer->SetVSync(renderer, vsync) < 0) { + renderer->SetVSync(renderer, vsync) != 0) { renderer->simulate_vsync = vsync ? SDL_TRUE : SDL_FALSE; + if (renderer->simulate_vsync) { + renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; + } else { + renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC; + } } else { renderer->simulate_vsync = SDL_FALSE; } diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index d87b2563e6e0e..bab41e7729e1b 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -44,7 +44,6 @@ typedef struct SDL_DRect double h; } SDL_DRect; - /* The SDL 2D rendering system */ typedef struct SDL_RenderDriver SDL_RenderDriver; @@ -53,14 +52,14 @@ typedef struct SDL_RenderDriver SDL_RenderDriver; struct SDL_Texture { const void *magic; - Uint32 format; /**< The pixel format of the texture */ - int access; /**< SDL_TextureAccess */ - int w; /**< The width of the texture */ - int h; /**< The height of the texture */ - int modMode; /**< The texture modulation mode */ - SDL_BlendMode blendMode; /**< The texture blend mode */ - SDL_ScaleMode scaleMode; /**< The texture scale mode */ - SDL_Color color; /**< Texture modulation values */ + Uint32 format; /**< The pixel format of the texture */ + int access; /**< SDL_TextureAccess */ + int w; /**< The width of the texture */ + int h; /**< The height of the texture */ + int modMode; /**< The texture modulation mode */ + SDL_BlendMode blendMode; /**< The texture blend mode */ + SDL_ScaleMode scaleMode; /**< The texture scale mode */ + SDL_Color color; /**< Texture modulation values */ SDL_Renderer *renderer; @@ -70,11 +69,11 @@ struct SDL_Texture void *pixels; int pitch; SDL_Rect locked_rect; - SDL_Surface *locked_surface; /**< Locked region exposed as a SDL surface */ + SDL_Surface *locked_surface; /**< Locked region exposed as a SDL surface */ Uint32 last_command_generation; /* last command queue generation this texture was in. */ - void *driverdata; /**< Driver specific texture representation */ + void *driverdata; /**< Driver specific texture representation */ void *userdata; SDL_Texture *prev; @@ -99,23 +98,28 @@ typedef enum typedef struct SDL_RenderCommand { SDL_RenderCommandType command; - union { - struct { + union + { + struct + { size_t first; SDL_Rect rect; } viewport; - struct { + struct + { SDL_bool enabled; SDL_Rect rect; } cliprect; - struct { + struct + { size_t first; size_t count; Uint8 r, g, b, a; SDL_BlendMode blend; SDL_Texture *texture; } draw; - struct { + struct + { size_t first; Uint8 r, g, b, a; } color; @@ -123,14 +127,12 @@ typedef struct SDL_RenderCommand struct SDL_RenderCommand *next; } SDL_RenderCommand; - typedef struct SDL_VertexSolid { SDL_FPoint position; - SDL_Color color; + SDL_Color color; } SDL_VertexSolid; - typedef enum { SDL_RENDERLINEMETHOD_POINTS, @@ -138,68 +140,67 @@ typedef enum SDL_RENDERLINEMETHOD_GEOMETRY, } SDL_RenderLineMethod; - /* Define the SDL renderer structure */ struct SDL_Renderer { const void *magic; - void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event); - int (*GetOutputSize) (SDL_Renderer * renderer, int *w, int *h); - SDL_bool (*SupportsBlendMode)(SDL_Renderer * renderer, SDL_BlendMode blendMode); - int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); - int (*QueueSetViewport) (SDL_Renderer * renderer, SDL_RenderCommand *cmd); - int (*QueueSetDrawColor) (SDL_Renderer * renderer, SDL_RenderCommand *cmd); - int (*QueueDrawPoints) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, - int count); - int (*QueueDrawLines) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, - int count); - int (*QueueFillRects) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, - int count); - int (*QueueCopy) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect); - int (*QueueCopyEx) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcquad, const SDL_FRect * dstrect, - const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y); - int (*QueueGeometry) (SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y); - - int (*RunCommandQueue) (SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize); - int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, - int pitch); + void (*WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event); + int (*GetOutputSize)(SDL_Renderer *renderer, int *w, int *h); + SDL_bool (*SupportsBlendMode)(SDL_Renderer *renderer, SDL_BlendMode blendMode); + int (*CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture); + int (*QueueSetViewport)(SDL_Renderer *renderer, SDL_RenderCommand *cmd); + int (*QueueSetDrawColor)(SDL_Renderer *renderer, SDL_RenderCommand *cmd); + int (*QueueDrawPoints)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, + int count); + int (*QueueDrawLines)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, + int count); + int (*QueueFillRects)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, + int count); + int (*QueueCopy)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect); + int (*QueueCopyEx)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcquad, const SDL_FRect *dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y); + int (*QueueGeometry)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y); + + int (*RunCommandQueue)(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize); + int (*UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, + int pitch); #if SDL_HAVE_YUV - int (*UpdateTextureYUV) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, + int (*UpdateTextureYUV)(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch); - int (*UpdateTextureNV) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch); + int (*UpdateTextureNV)(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch); #endif - int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch); - void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); - void (*SetTextureScaleMode) (SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode); - int (*SetRenderTarget) (SDL_Renderer * renderer, SDL_Texture * texture); - int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch); - int (*RenderPresent) (SDL_Renderer * renderer); - void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); + int (*LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch); + void (*UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture); + void (*SetTextureScaleMode)(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode); + int (*SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture); + int (*RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch); + int (*RenderPresent)(SDL_Renderer *renderer); + void (*DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture); - void (*DestroyRenderer) (SDL_Renderer * renderer); + void (*DestroyRenderer)(SDL_Renderer *renderer); - int (*SetVSync) (SDL_Renderer * renderer, int vsync); + int (*SetVSync)(SDL_Renderer *renderer, int vsync); - int (*GL_BindTexture) (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); - int (*GL_UnbindTexture) (SDL_Renderer * renderer, SDL_Texture *texture); + int (*GL_BindTexture)(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh); + int (*GL_UnbindTexture)(SDL_Renderer *renderer, SDL_Texture *texture); - void *(*GetMetalLayer) (SDL_Renderer * renderer); - void *(*GetMetalCommandEncoder) (SDL_Renderer * renderer); + void *(*GetMetalLayer)(SDL_Renderer *renderer); + void *(*GetMetalCommandEncoder)(SDL_Renderer *renderer); /* The current renderer info */ SDL_RendererInfo info; @@ -260,8 +261,8 @@ struct SDL_Renderer SDL_Texture *target; SDL_mutex *target_mutex; - SDL_Color color; /**< Color for drawing operations values */ - SDL_BlendMode blendMode; /**< The drawing blend mode */ + SDL_Color color; /**< Color for drawing operations values */ + SDL_BlendMode blendMode; /**< The drawing blend mode */ SDL_bool always_batch; SDL_bool batching; @@ -281,13 +282,15 @@ struct SDL_Renderer size_t vertex_data_used; size_t vertex_data_allocation; + SDL_bool destroyed; /* already destroyed by SDL_DestroyWindow; just free this struct in SDL_DestroyRenderer. */ + void *driverdata; }; /* Define the SDL render driver structure */ struct SDL_RenderDriver { - SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags); + int (*CreateRenderer)(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags); /* Info about the renderer capabilities */ SDL_RendererInfo info; @@ -320,8 +323,11 @@ extern SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode the next call, because it might be in an array that gets realloc()'d. */ extern void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset); -extern int SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, SDL_ScaleMode scaleMode); -extern int SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect, SDL_ScaleMode scaleMode); +extern int SDL_PrivateLowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode); +extern int SDL_PrivateUpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode); + +/* Let the video subsystem destroy a renderer without making its pointer invalid. */ +extern void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c index 10fe54e69bf33..203306f3354ba 100644 --- a/src/render/SDL_yuv_sw.c +++ b/src/render/SDL_yuv_sw.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,11 @@ #if SDL_HAVE_YUV - #include "SDL_yuv_sw_c.h" +#include "../video/SDL_yuv_c.h" #include "SDL_cpuinfo.h" - -SDL_SW_YUVTexture * -SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) { SDL_SW_YUVTexture *swdata; @@ -48,7 +46,7 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) return NULL; } - swdata = (SDL_SW_YUVTexture *) SDL_calloc(1, sizeof(*swdata)); + swdata = (SDL_SW_YUVTexture *)SDL_calloc(1, sizeof(*swdata)); if (!swdata) { SDL_OutOfMemory(); return NULL; @@ -59,33 +57,13 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) swdata->w = w; swdata->h = h; { - const int sz_plane = w * h; - const int sz_plane_chroma = ((w + 1) / 2) * ((h + 1) / 2); - const int sz_plane_packed = ((w + 1) / 2) * h; - int dst_size = 0; - switch(format) - { - case SDL_PIXELFORMAT_YV12: /**< Planar mode: Y + V + U (3 planes) */ - case SDL_PIXELFORMAT_IYUV: /**< Planar mode: Y + U + V (3 planes) */ - dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma; - break; - - case SDL_PIXELFORMAT_YUY2: /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - case SDL_PIXELFORMAT_UYVY: /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - case SDL_PIXELFORMAT_YVYU: /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - dst_size = 4 * sz_plane_packed; - break; - - case SDL_PIXELFORMAT_NV12: /**< Planar mode: Y + U/V interleaved (2 planes) */ - case SDL_PIXELFORMAT_NV21: /**< Planar mode: Y + V/U interleaved (2 planes) */ - dst_size = sz_plane + sz_plane_chroma + sz_plane_chroma; - break; - - default: - SDL_assert(0 && "We should never get here (caught above)"); - break; + size_t dst_size; + if (SDL_CalculateYUVSize(format, w, h, &dst_size, NULL) < 0) { + SDL_SW_DestroyYUVTexture(swdata); + SDL_OutOfMemory(); + return NULL; } - swdata->pixels = (Uint8 *) SDL_SIMDAlloc(dst_size); + swdata->pixels = (Uint8 *)SDL_SIMDAlloc(dst_size); if (!swdata->pixels) { SDL_SW_DestroyYUVTexture(swdata); SDL_OutOfMemory(); @@ -125,36 +103,34 @@ SDL_SW_CreateYUVTexture(Uint32 format, int w, int h) } /* We're all done.. */ - return (swdata); + return swdata; } -int -SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels, - int *pitch) +int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, + int *pitch) { *pixels = swdata->planes[0]; *pitch = swdata->pitches[0]; return 0; } -int -SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, - const void *pixels, int pitch) +int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, + const void *pixels, int pitch) { switch (swdata->format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: if (rect->x == 0 && rect->y == 0 && rect->w == swdata->w && rect->h == swdata->h) { - SDL_memcpy(swdata->pixels, pixels, - (swdata->h * swdata->w) + 2* ((swdata->h + 1) /2) * ((swdata->w + 1) / 2)); + SDL_memcpy(swdata->pixels, pixels, + (size_t)(swdata->h * swdata->w) + 2 * ((swdata->h + 1) / 2) * ((swdata->w + 1) / 2)); } else { Uint8 *src, *dst; int row; size_t length; /* Copy the Y plane */ - src = (Uint8 *) pixels; + src = (Uint8 *)pixels; dst = swdata->pixels + rect->y * swdata->w + rect->x; length = rect->w; for (row = 0; row < rect->h; ++row) { @@ -162,94 +138,92 @@ SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, src += pitch; dst += swdata->w; } - + /* Copy the next plane */ - src = (Uint8 *) pixels + rect->h * pitch; + src = (Uint8 *)pixels + rect->h * pitch; dst = swdata->pixels + swdata->h * swdata->w; - dst += rect->y/2 * ((swdata->w + 1) / 2) + rect->x/2; + dst += rect->y / 2 * ((swdata->w + 1) / 2) + rect->x / 2; length = (rect->w + 1) / 2; - for (row = 0; row < (rect->h + 1)/2; ++row) { + for (row = 0; row < (rect->h + 1) / 2; ++row) { SDL_memcpy(dst, src, length); - src += (pitch + 1)/2; - dst += (swdata->w + 1)/2; + src += (pitch + 1) / 2; + dst += (swdata->w + 1) / 2; } /* Copy the next plane */ - src = (Uint8 *) pixels + rect->h * pitch + ((rect->h + 1) / 2) * ((pitch + 1) / 2); + src = (Uint8 *)pixels + rect->h * pitch + ((rect->h + 1) / 2) * ((pitch + 1) / 2); dst = swdata->pixels + swdata->h * swdata->w + - ((swdata->h + 1)/2) * ((swdata->w+1) / 2); - dst += rect->y/2 * ((swdata->w + 1)/2) + rect->x/2; + ((swdata->h + 1) / 2) * ((swdata->w + 1) / 2); + dst += rect->y / 2 * ((swdata->w + 1) / 2) + rect->x / 2; length = (rect->w + 1) / 2; - for (row = 0; row < (rect->h + 1)/2; ++row) { + for (row = 0; row < (rect->h + 1) / 2; ++row) { SDL_memcpy(dst, src, length); - src += (pitch + 1)/2; - dst += (swdata->w + 1)/2; + src += (pitch + 1) / 2; + dst += (swdata->w + 1) / 2; } } break; case SDL_PIXELFORMAT_YUY2: case SDL_PIXELFORMAT_UYVY: case SDL_PIXELFORMAT_YVYU: - { + { + Uint8 *src, *dst; + int row; + size_t length; + + src = (Uint8 *)pixels; + dst = + swdata->planes[0] + rect->y * swdata->pitches[0] + + rect->x * 2; + length = 4 * (((size_t)rect->w + 1) / 2); + for (row = 0; row < rect->h; ++row) { + SDL_memcpy(dst, src, length); + src += pitch; + dst += swdata->pitches[0]; + } + } break; + case SDL_PIXELFORMAT_NV12: + case SDL_PIXELFORMAT_NV21: + { + if (rect->x == 0 && rect->y == 0 && rect->w == swdata->w && rect->h == swdata->h) { + SDL_memcpy(swdata->pixels, pixels, + (size_t)(swdata->h * swdata->w) + 2 * ((swdata->h + 1) / 2) * ((swdata->w + 1) / 2)); + } else { + Uint8 *src, *dst; int row; size_t length; - src = (Uint8 *) pixels; - dst = - swdata->planes[0] + rect->y * swdata->pitches[0] + - rect->x * 2; - length = 4 * ((rect->w + 1) / 2); + /* Copy the Y plane */ + src = (Uint8 *)pixels; + dst = swdata->pixels + rect->y * swdata->w + rect->x; + length = rect->w; for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, src, length); src += pitch; - dst += swdata->pitches[0]; + dst += swdata->w; } - } - break; - case SDL_PIXELFORMAT_NV12: - case SDL_PIXELFORMAT_NV21: - { - if (rect->x == 0 && rect->y == 0 && rect->w == swdata->w && rect->h == swdata->h) { - SDL_memcpy(swdata->pixels, pixels, - (swdata->h * swdata->w) + 2* ((swdata->h + 1) /2) * ((swdata->w + 1) / 2)); - } else { - - Uint8 *src, *dst; - int row; - size_t length; - - /* Copy the Y plane */ - src = (Uint8 *) pixels; - dst = swdata->pixels + rect->y * swdata->w + rect->x; - length = rect->w; - for (row = 0; row < rect->h; ++row) { - SDL_memcpy(dst, src, length); - src += pitch; - dst += swdata->w; - } - - /* Copy the next plane */ - src = (Uint8 *) pixels + rect->h * pitch; - dst = swdata->pixels + swdata->h * swdata->w; - dst += 2 * ((rect->y + 1)/2) * ((swdata->w + 1) / 2) + 2 * (rect->x/2); - length = 2 * ((rect->w + 1) / 2); - for (row = 0; row < (rect->h + 1)/2; ++row) { - SDL_memcpy(dst, src, length); - src += 2 * ((pitch + 1)/2); - dst += 2 * ((swdata->w + 1)/2); - } + + /* Copy the next plane */ + src = (Uint8 *)pixels + rect->h * pitch; + dst = swdata->pixels + swdata->h * swdata->w; + dst += 2 * ((rect->y + 1) / 2) * ((swdata->w + 1) / 2) + 2 * (rect->x / 2); + length = 2 * (((size_t)rect->w + 1) / 2); + for (row = 0; row < (rect->h + 1) / 2; ++row) { + SDL_memcpy(dst, src, length); + src += 2 * ((pitch + 1) / 2); + dst += 2 * ((swdata->w + 1) / 2); } } } + } return 0; } -int -SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { const Uint8 *src; Uint8 *dst; @@ -274,12 +248,12 @@ SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, dst = swdata->pixels + swdata->h * swdata->w + ((swdata->h + 1) / 2) * ((swdata->w + 1) / 2); } - dst += rect->y/2 * ((swdata->w + 1)/2) + rect->x/2; + dst += rect->y / 2 * ((swdata->w + 1) / 2) + rect->x / 2; length = (rect->w + 1) / 2; - for (row = 0; row < (rect->h + 1)/2; ++row) { + for (row = 0; row < (rect->h + 1) / 2; ++row) { SDL_memcpy(dst, src, length); src += Upitch; - dst += (swdata->w + 1)/2; + dst += (swdata->w + 1) / 2; } /* Copy the V plane */ @@ -290,19 +264,19 @@ SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, dst = swdata->pixels + swdata->h * swdata->w + ((swdata->h + 1) / 2) * ((swdata->w + 1) / 2); } - dst += rect->y/2 * ((swdata->w + 1)/2) + rect->x/2; + dst += rect->y / 2 * ((swdata->w + 1) / 2) + rect->x / 2; length = (rect->w + 1) / 2; - for (row = 0; row < (rect->h + 1)/2; ++row) { + for (row = 0; row < (rect->h + 1) / 2; ++row) { SDL_memcpy(dst, src, length); src += Vpitch; - dst += (swdata->w + 1)/2; + dst += (swdata->w + 1) / 2; } return 0; } -int SDL_SW_UpdateNVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +int SDL_SW_UpdateNVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { const Uint8 *src; Uint8 *dst; @@ -322,32 +296,28 @@ int SDL_SW_UpdateNVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * re /* Copy the UV or VU plane */ src = UVplane; dst = swdata->pixels + swdata->h * swdata->w; - dst += rect->y * ((swdata->w + 1)/2) + rect->x; + dst += rect->y * ((swdata->w + 1) / 2) + rect->x; length = (rect->w + 1) / 2; length *= 2; - for (row = 0; row < (rect->h + 1)/2; ++row) { + for (row = 0; row < (rect->h + 1) / 2; ++row) { SDL_memcpy(dst, src, length); src += UVpitch; - dst += 2 * ((swdata->w + 1)/2); + dst += 2 * ((swdata->w + 1) / 2); } return 0; } -int -SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, - void **pixels, int *pitch) +int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, + void **pixels, int *pitch) { switch (swdata->format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: case SDL_PIXELFORMAT_NV12: case SDL_PIXELFORMAT_NV21: - if (rect - && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w - || rect->h != swdata->h)) { - return SDL_SetError - ("YV12, IYUV, NV12, NV21 textures only support full surface locks"); + if (rect && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w || rect->h != swdata->h)) { + return SDL_SetError("YV12, IYUV, NV12, NV21 textures only support full surface locks"); } break; } @@ -361,15 +331,13 @@ SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, return 0; } -void -SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata) +void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata) { } -int -SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, - Uint32 target_format, int w, int h, void *pixels, - int pitch) +int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, + Uint32 target_format, int w, int h, void *pixels, + int pitch) { int stretch; @@ -407,7 +375,7 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask, Gmask, Bmask, Amask); if (!swdata->display) { - return (-1); + return -1; } } if (!swdata->stretch) { @@ -418,14 +386,14 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, SDL_CreateRGBSurface(0, swdata->w, swdata->h, bpp, Rmask, Gmask, Bmask, Amask); if (!swdata->stretch) { - return (-1); + return -1; } } pixels = swdata->stretch->pixels; pitch = swdata->stretch->pitch; } if (SDL_ConvertPixels(swdata->w, swdata->h, swdata->format, - swdata->planes[0], swdata->pitches[0], + swdata->planes[0], swdata->pitches[0], target_format, pixels, pitch) < 0) { return -1; } @@ -436,8 +404,7 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, return 0; } -void -SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata) +void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata) { if (swdata) { SDL_SIMDFree(swdata->pixels); diff --git a/src/render/SDL_yuv_sw_c.h b/src/render/SDL_yuv_sw_c.h index 8d9dc79cdfcbb..0c35f9d8ef1c2 100644 --- a/src/render/SDL_yuv_sw_c.h +++ b/src/render/SDL_yuv_sw_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -47,24 +47,24 @@ struct SDL_SW_YUVTexture typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture; SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h); -int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture * swdata, void **pixels, +int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, int *pitch); -int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, +int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const void *pixels, int pitch); -int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, +int SDL_SW_UpdateYUVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch); -int SDL_SW_UpdateNVTexturePlanar(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch); -int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect, +int SDL_SW_UpdateNVTexturePlanar(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch); +int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch); -void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture * swdata); -int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect, +void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata); +int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, Uint32 target_format, int w, int h, void *pixels, int pitch); -void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata); +void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata); #endif /* SDL_yuv_sw_c_h_ */ diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index e68e4d86ec24b..3a3367310624d 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #include "SDL_render.h" #include "SDL_system.h" -#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D #include "../../core/windows/SDL_windows.h" @@ -54,12 +54,11 @@ typedef struct LPDIRECT3DPIXELSHADER9 shader; } D3D_DrawStateCache; - /* Direct3D renderer implementation */ typedef struct { - void* d3dDLL; + void *d3dDLL; IDirect3D9 *d3d; IDirect3DDevice9 *device; UINT adapter; @@ -70,7 +69,7 @@ typedef struct D3DTEXTUREFILTERTYPE scaleMode[8]; IDirect3DSurface9 *defaultRenderTarget; IDirect3DSurface9 *currentRenderTarget; - void* d3dxDLL; + void *d3dxDLL; #if SDL_HAVE_YUV LPDIRECT3DPIXELSHADER9 shaders[NUM_SHADERS]; #endif @@ -115,8 +114,7 @@ typedef struct float u, v; } Vertex; -static int -D3D_SetError(const char *prefix, HRESULT result) +static int D3D_SetError(const char *prefix, HRESULT result) { const char *error; @@ -194,8 +192,7 @@ D3D_SetError(const char *prefix, HRESULT result) return SDL_SetError("%s: %s", prefix, error); } -static D3DFORMAT -PixelFormatToD3DFMT(Uint32 format) +static D3DFORMAT PixelFormatToD3DFMT(Uint32 format) { switch (format) { case SDL_PIXELFORMAT_RGB565: @@ -214,8 +211,7 @@ PixelFormatToD3DFMT(Uint32 format) } } -static Uint32 -D3DFMTToPixelFormat(D3DFORMAT format) +static Uint32 D3DFMTToPixelFormat(D3DFORMAT format) { switch (format) { case D3DFMT_R5G6B5: @@ -229,8 +225,7 @@ D3DFMTToPixelFormat(D3DFORMAT format) } } -static void -D3D_InitRenderState(D3D_RenderData *data) +static void D3D_InitRenderState(D3D_RenderData *data) { D3DMATRIX matrix; @@ -288,12 +283,11 @@ D3D_InitRenderState(D3D_RenderData *data) data->beginScene = SDL_TRUE; } -static int D3D_Reset(SDL_Renderer * renderer); +static int D3D_Reset(SDL_Renderer *renderer); -static int -D3D_ActivateRenderer(SDL_Renderer * renderer) +static int D3D_ActivateRenderer(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; HRESULT result; if (data->updateSize) { @@ -337,25 +331,22 @@ D3D_ActivateRenderer(SDL_Renderer * renderer) return 0; } -static void -D3D_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void D3D_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { data->updateSize = SDL_TRUE; } } -static int -D3D_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int D3D_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GetWindowSizeInPixels(renderer->window, w, h); return 0; } -static D3DBLEND -GetBlendFunc(SDL_BlendFactor factor) +static D3DBLEND GetBlendFunc(SDL_BlendFactor factor) { switch (factor) { case SDL_BLENDFACTOR_ZERO: @@ -378,13 +369,13 @@ GetBlendFunc(SDL_BlendFactor factor) return D3DBLEND_DESTALPHA; case SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return D3DBLEND_INVDESTALPHA; - default: break; + default: + break; } - return (D3DBLEND) 0; + return (D3DBLEND)0; } -static D3DBLENDOP -GetBlendEquation(SDL_BlendOperation operation) +static D3DBLENDOP GetBlendEquation(SDL_BlendOperation operation) { switch (operation) { case SDL_BLENDOPERATION_ADD: @@ -397,15 +388,15 @@ GetBlendEquation(SDL_BlendOperation operation) return D3DBLENDOP_MIN; case SDL_BLENDOPERATION_MAXIMUM: return D3DBLENDOP_MAX; - default: break; + default: + break; } - return (D3DBLENDOP) 0; + return (D3DBLENDOP)0; } -static SDL_bool -D3D_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool D3D_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -428,8 +419,7 @@ D3D_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) return SDL_TRUE; } -static int -D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format, D3DFORMAT d3dfmt, int w, int h) +static int D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD usage, Uint32 format, D3DFORMAT d3dfmt, int w, int h) { HRESULT result; @@ -441,23 +431,21 @@ D3D_CreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD us texture->d3dfmt = d3dfmt; result = IDirect3DDevice9_CreateTexture(device, w, h, 1, usage, - PixelFormatToD3DFMT(format), - D3DPOOL_DEFAULT, &texture->texture, NULL); + PixelFormatToD3DFMT(format), + D3DPOOL_DEFAULT, &texture->texture, NULL); if (FAILED(result)) { return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result); } return 0; } - -static int -D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) +static int D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) { HRESULT result; - if (texture->staging == NULL) { + if (!texture->staging) { result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, 0, - texture->d3dfmt, D3DPOOL_SYSTEMMEM, &texture->staging, NULL); + texture->d3dfmt, D3DPOOL_SYSTEMMEM, &texture->staging, NULL); if (FAILED(result)) { return D3D_SetError("CreateTexture(D3DPOOL_SYSTEMMEM)", result); } @@ -465,8 +453,7 @@ D3D_CreateStagingTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) return 0; } -static int -D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture) +static int D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture) { if (texture->texture) { IDirect3DTexture9_Release(texture->texture); @@ -479,8 +466,7 @@ D3D_RecreateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture) return 0; } -static int -D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, int y, int w, int h, const void *pixels, int pitch) +static int D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, int y, int w, int h, const void *pixels, int pitch) { RECT d3drect; D3DLOCKED_RECT locked; @@ -494,10 +480,10 @@ D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, i } d3drect.left = x; - d3drect.right = x + w; + d3drect.right = (LONG)x + w; d3drect.top = y; - d3drect.bottom = y + h; - + d3drect.bottom = (LONG)y + h; + result = IDirect3DTexture9_LockRect(texture->staging, 0, &locked, &d3drect, 0); if (FAILED(result)) { return D3D_SetError("LockRect()", result); @@ -507,7 +493,7 @@ D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, i dst = (Uint8 *)locked.pBits; length = w * SDL_BYTESPERPIXEL(texture->format); if (length == pitch && length == locked.Pitch) { - SDL_memcpy(dst, src, length*h); + SDL_memcpy(dst, src, (size_t)length * h); } else { if (length > pitch) { length = pitch; @@ -530,8 +516,7 @@ D3D_UpdateTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, int x, i return 0; } -static void -D3D_DestroyTextureRep(D3D_TextureRep *texture) +static void D3D_DestroyTextureRep(D3D_TextureRep *texture) { if (texture->texture) { IDirect3DTexture9_Release(texture->texture); @@ -543,14 +528,13 @@ D3D_DestroyTextureRep(D3D_TextureRep *texture) } } -static int -D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3D_TextureData *texturedata; DWORD usage; - texturedata = (D3D_TextureData *) SDL_calloc(1, sizeof(*texturedata)); + texturedata = (D3D_TextureData *)SDL_calloc(1, sizeof(*texturedata)); if (!texturedata) { return SDL_OutOfMemory(); } @@ -584,8 +568,7 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D_RecreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; @@ -611,12 +594,11 @@ D3D_RecreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int D3D_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; if (!texturedata) { return SDL_SetError("Texture is not currently available"); @@ -628,14 +610,14 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, #if SDL_HAVE_YUV if (texturedata->yuv) { /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + pixels = (const void *)((const Uint8 *)pixels + rect->h * pitch); if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->vtexture : &texturedata->utexture, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) { return -1; } /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2)); + pixels = (const void *)((const Uint8 *)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2)); if (D3D_UpdateTextureRep(data->device, texture->format == SDL_PIXELFORMAT_YV12 ? &texturedata->utexture : &texturedata->vtexture, rect->x / 2, (rect->y + 1) / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, pixels, (pitch + 1) / 2) < 0) { return -1; } @@ -645,15 +627,14 @@ D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } #if SDL_HAVE_YUV -static int -D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int D3D_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; if (!texturedata) { return SDL_SetError("Texture is not currently available"); @@ -672,9 +653,8 @@ D3D_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, } #endif -static int -D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int D3D_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; @@ -696,8 +676,8 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, } } *pixels = - (void *) ((Uint8 *) texturedata->pixels + rect->y * texturedata->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(texturedata->pixels + rect->y * texturedata->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = texturedata->pitch; } else #endif @@ -711,9 +691,9 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, } d3drect.left = rect->x; - d3drect.right = rect->x + rect->w; + d3drect.right = (LONG)rect->x + rect->w; d3drect.top = rect->y; - d3drect.bottom = rect->y + rect->h; + d3drect.bottom = (LONG)rect->y + rect->h; result = IDirect3DTexture9_LockRect(texturedata->texture.staging, 0, &locked, &d3drect, 0); if (FAILED(result)) { @@ -725,8 +705,7 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static void -D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void D3D_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; @@ -738,11 +717,10 @@ D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (texturedata->yuv) { const SDL_Rect *rect = &texturedata->locked_rect; void *pixels = - (void *) ((Uint8 *) texturedata->pixels + rect->y * texturedata->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(texturedata->pixels + rect->y * texturedata->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); D3D_UpdateTexture(renderer, texture, rect, pixels, texturedata->pitch); - } - else + } else #endif { IDirect3DTexture9_UnlockRect(texturedata->texture.staging, 0); @@ -756,8 +734,7 @@ D3D_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } -static void -D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void D3D_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; @@ -768,22 +745,21 @@ D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Scal texturedata->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3DTEXF_POINT : D3DTEXF_LINEAR; } -static int -D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3D_TextureData *texturedata; D3D_TextureRep *texturerep; HRESULT result; IDirect3DDevice9 *device = data->device; /* Release the previous render target if it wasn't the default one */ - if (data->currentRenderTarget != NULL) { + if (data->currentRenderTarget) { IDirect3DSurface9_Release(data->currentRenderTarget); data->currentRenderTarget = NULL; } - if (texture == NULL) { + if (!texture) { IDirect3DDevice9_SetRenderTarget(data->device, 0, data->defaultRenderTarget); return 0; } @@ -798,7 +774,7 @@ D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture) if (texturerep->dirty && texturerep->staging) { if (!texturerep->texture) { result = IDirect3DDevice9_CreateTexture(device, texturerep->w, texturerep->h, 1, texturerep->usage, - PixelFormatToD3DFMT(texturerep->format), D3DPOOL_DEFAULT, &texturerep->texture, NULL); + PixelFormatToD3DFMT(texturerep->format), D3DPOOL_DEFAULT, &texturerep->texture, NULL); if (FAILED(result)) { return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result); } @@ -812,19 +788,18 @@ D3D_SetRenderTargetInternal(SDL_Renderer * renderer, SDL_Texture * texture) } result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture.texture, 0, &data->currentRenderTarget); - if(FAILED(result)) { + if (FAILED(result)) { return D3D_SetError("GetSurfaceLevel()", result); } result = IDirect3DDevice9_SetRenderTarget(data->device, 0, data->currentRenderTarget); - if(FAILED(result)) { + if (FAILED(result)) { return D3D_SetError("SetRenderTarget()", result); } return 0; } -static int -D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { if (D3D_ActivateRenderer(renderer) < 0) { return -1; @@ -833,19 +808,16 @@ D3D_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) return D3D_SetRenderTargetInternal(renderer, texture); } - -static int -D3D_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int D3D_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -D3D_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int D3D_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { const DWORD color = D3DCOLOR_ARGB(cmd->data.draw.a, cmd->data.draw.r, cmd->data.draw.g, cmd->data.draw.b); - const size_t vertslen = count * sizeof (Vertex); - Vertex *verts = (Vertex *) SDL_AllocateRenderVertices(renderer, vertslen, 0, &cmd->data.draw.first); + const size_t vertslen = count * sizeof(Vertex); + Vertex *verts = (Vertex *)SDL_AllocateRenderVertices(renderer, vertslen, 0, &cmd->data.draw.first); int i; if (!verts) { @@ -864,15 +836,14 @@ D3D_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F return 0; } -static int -D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; - Vertex *verts = (Vertex *) SDL_AllocateRenderVertices(renderer, count * sizeof (Vertex), 0, &cmd->data.draw.first); + Vertex *verts = (Vertex *)SDL_AllocateRenderVertices(renderer, count * sizeof(Vertex), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -895,8 +866,8 @@ D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); verts->x = xy_[0] * scale_x - 0.5f; verts->y = xy_[1] * scale_y - 0.5f; @@ -904,7 +875,7 @@ D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t verts->color = D3DCOLOR_ARGB(col_.a, col_.r, col_.g, col_.b); if (texture) { - float *uv_ = (float *)((char*)uv + j * uv_stride); + float *uv_ = (float *)((char *)uv + j * uv_stride); verts->u = uv_[0]; verts->v = uv_[1]; } else { @@ -917,14 +888,13 @@ D3D_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t return 0; } -static int -UpdateDirtyTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) +static int UpdateDirtyTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) { if (texture->dirty && texture->staging) { HRESULT result; if (!texture->texture) { result = IDirect3DDevice9_CreateTexture(device, texture->w, texture->h, 1, texture->usage, - PixelFormatToD3DFMT(texture->format), D3DPOOL_DEFAULT, &texture->texture, NULL); + PixelFormatToD3DFMT(texture->format), D3DPOOL_DEFAULT, &texture->texture, NULL); if (FAILED(result)) { return D3D_SetError("CreateTexture(D3DPOOL_DEFAULT)", result); } @@ -939,8 +909,7 @@ UpdateDirtyTexture(IDirect3DDevice9 *device, D3D_TextureRep *texture) return 0; } -static int -BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD sampler) +static int BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD sampler) { HRESULT result; UpdateDirtyTexture(device, texture); @@ -951,8 +920,7 @@ BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWORD sampler) return 0; } -static void -UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index) +static void UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index) { if (texturedata->scaleMode != data->scaleMode[index]) { IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER, @@ -967,8 +935,7 @@ UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsig } } -static int -SetupTextureState(D3D_RenderData *data, SDL_Texture * texture, LPDIRECT3DPIXELSHADER9 *shader) +static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, LPDIRECT3DPIXELSHADER9 *shader) { D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; @@ -1013,21 +980,20 @@ SetupTextureState(D3D_RenderData *data, SDL_Texture * texture, LPDIRECT3DPIXELSH return 0; } -static int -SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) +static int SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; const SDL_BlendMode blend = cmd->data.draw.blend; if (texture != data->drawstate.texture) { #if SDL_HAVE_YUV - D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *) data->drawstate.texture->driverdata : NULL; - D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *) texture->driverdata : NULL; + D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *)data->drawstate.texture->driverdata : NULL; + D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *)texture->driverdata : NULL; #endif LPDIRECT3DPIXELSHADER9 shader = NULL; /* disable any enabled textures we aren't going to use, let SetupTextureState() do the rest. */ - if (texture == NULL) { + if (!texture) { IDirect3DDevice9_SetTexture(data->device, 0, NULL); } #if SDL_HAVE_YUV @@ -1050,7 +1016,7 @@ SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) data->drawstate.texture = texture; } else if (texture) { - D3D_TextureData *texturedata = (D3D_TextureData *) texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; UpdateDirtyTexture(data->device, &texturedata->texture); #if SDL_HAVE_YUV if (texturedata->yuv) { @@ -1120,10 +1086,10 @@ SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) const SDL_Rect *viewport = &data->drawstate.viewport; const SDL_Rect *rect = &data->drawstate.cliprect; RECT d3drect; - d3drect.left = viewport->x + rect->x; - d3drect.top = viewport->y + rect->y; - d3drect.right = viewport->x + rect->x + rect->w; - d3drect.bottom = viewport->y + rect->y + rect->h; + d3drect.left = (LONG)viewport->x + rect->x; + d3drect.top = (LONG)viewport->y + rect->y; + d3drect.right = (LONG)viewport->x + rect->x + rect->w; + d3drect.bottom = (LONG)viewport->y + rect->y + rect->h; IDirect3DDevice9_SetScissorRect(data->device, &d3drect); data->drawstate.cliprect_dirty = SDL_FALSE; } @@ -1131,10 +1097,9 @@ SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) return 0; } -static int -D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; const int vboidx = data->currentVertexBuffer; IDirect3DVertexBuffer9 *vbo = NULL; const SDL_bool istarget = renderer->target != NULL; @@ -1143,7 +1108,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti return -1; } - if (vertices) { + if (vertsize > 0) { /* upload the new VBO data for this set of commands. */ vbo = data->vertexBuffers[vboidx]; if (data->vertexBufferSize[vboidx] < vertsize) { @@ -1153,7 +1118,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti IDirect3DVertexBuffer9_Release(vbo); } - if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, (UINT) vertsize, usage, fvf, D3DPOOL_DEFAULT, &vbo, NULL))) { + if (FAILED(IDirect3DDevice9_CreateVertexBuffer(data->device, (UINT)vertsize, usage, fvf, D3DPOOL_DEFAULT, &vbo, NULL))) { vbo = NULL; } data->vertexBuffers[vboidx] = vbo; @@ -1162,12 +1127,12 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti if (vbo) { void *ptr; - if (FAILED(IDirect3DVertexBuffer9_Lock(vbo, 0, (UINT) vertsize, &ptr, D3DLOCK_DISCARD))) { - vbo = NULL; /* oh well, we'll do immediate mode drawing. :( */ + if (FAILED(IDirect3DVertexBuffer9_Lock(vbo, 0, (UINT)vertsize, &ptr, D3DLOCK_DISCARD))) { + vbo = NULL; /* oh well, we'll do immediate mode drawing. :( */ } else { SDL_memcpy(ptr, vertices, vertsize); if (FAILED(IDirect3DVertexBuffer9_Unlock(vbo))) { - vbo = NULL; /* oh well, we'll do immediate mode drawing. :( */ + vbo = NULL; /* oh well, we'll do immediate mode drawing. :( */ } } } @@ -1187,130 +1152,139 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti } } - IDirect3DDevice9_SetStreamSource(data->device, 0, vbo, 0, sizeof (Vertex)); + IDirect3DDevice9_SetStreamSource(data->device, 0, vbo, 0, sizeof(Vertex)); while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - /* currently this is sent with each vertex, but if we move to - shaders, we can put this in a uniform here and reduce vertex - buffer bandwidth */ - break; - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + /* currently this is sent with each vertex, but if we move to + shaders, we can put this in a uniform here and reduce vertex + buffer bandwidth */ + break; + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &data->drawstate.viewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - data->drawstate.viewport_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { - data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; - } + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + } - if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&data->drawstate.cliprect, rect); - data->drawstate.cliprect_dirty = SDL_TRUE; - } - break; + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_CLEAR: { - const DWORD color = D3DCOLOR_ARGB(cmd->data.color.a, cmd->data.color.r, cmd->data.color.g, cmd->data.color.b); - const SDL_Rect *viewport = &data->drawstate.viewport; - const int backw = istarget ? renderer->target->w : data->pparams.BackBufferWidth; - const int backh = istarget ? renderer->target->h : data->pparams.BackBufferHeight; - const SDL_bool viewport_equal = ((viewport->x == 0) && (viewport->y == 0) && (viewport->w == backw) && (viewport->h == backh)) ? SDL_TRUE : SDL_FALSE; + case SDL_RENDERCMD_CLEAR: + { + const DWORD color = D3DCOLOR_ARGB(cmd->data.color.a, cmd->data.color.r, cmd->data.color.g, cmd->data.color.b); + const SDL_Rect *viewport = &data->drawstate.viewport; + const int backw = istarget ? renderer->target->w : data->pparams.BackBufferWidth; + const int backh = istarget ? renderer->target->h : data->pparams.BackBufferHeight; + const SDL_bool viewport_equal = ((viewport->x == 0) && (viewport->y == 0) && (viewport->w == backw) && (viewport->h == backh)) ? SDL_TRUE : SDL_FALSE; + + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { + IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE); + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; + } - if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { - IDirect3DDevice9_SetRenderState(data->device, D3DRS_SCISSORTESTENABLE, FALSE); - data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; - } + /* Don't reset the viewport if we don't have to! */ + if (!data->drawstate.viewport_dirty && viewport_equal) { + IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); + } else { + /* Clear is defined to clear the entire render target */ + D3DVIEWPORT9 wholeviewport = { 0, 0, 0, 0, 0.0f, 1.0f }; + wholeviewport.Width = backw; + wholeviewport.Height = backh; + IDirect3DDevice9_SetViewport(data->device, &wholeviewport); + data->drawstate.viewport_dirty = SDL_TRUE; /* we still need to (re)set orthographic projection, so always mark it dirty. */ + IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); + } - /* Don't reset the viewport if we don't have to! */ - if (!data->drawstate.viewport_dirty && viewport_equal) { - IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); - } else { - /* Clear is defined to clear the entire render target */ - D3DVIEWPORT9 wholeviewport = { 0, 0, 0, 0, 0.0f, 1.0f }; - wholeviewport.Width = backw; - wholeviewport.Height = backh; - IDirect3DDevice9_SetViewport(data->device, &wholeviewport); - data->drawstate.viewport_dirty = SDL_TRUE; /* we still need to (re)set orthographic projection, so always mark it dirty. */ - IDirect3DDevice9_Clear(data->device, 0, NULL, D3DCLEAR_TARGET, color, 0.0f, 0); - } + break; + } - break; + case SDL_RENDERCMD_DRAW_POINTS: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + SetDrawState(data, cmd); + if (vbo) { + IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT)(first / sizeof(Vertex)), (UINT)count); + } else { + const Vertex *verts = (Vertex *)(((Uint8 *)vertices) + first); + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, (UINT)count, verts, sizeof(Vertex)); } + break; + } - case SDL_RENDERCMD_DRAW_POINTS: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - SetDrawState(data, cmd); - if (vbo) { - IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT) (first / sizeof (Vertex)), (UINT) count); - } else { - const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first); - IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, (UINT) count, verts, sizeof (Vertex)); - } - break; - } + case SDL_RENDERCMD_DRAW_LINES: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const Vertex *verts = (Vertex *)(((Uint8 *)vertices) + first); + + /* DirectX 9 has the same line rasterization semantics as GDI, + so we need to close the endpoint of the line with a second draw call. + NOLINTNEXTLINE(clang-analyzer-core.NullDereference): FIXME: Can verts truly not be NULL ? */ + const SDL_bool close_endpoint = ((count == 2) || (verts[0].x != verts[count - 1].x) || (verts[0].y != verts[count - 1].y)); + + SetDrawState(data, cmd); - case SDL_RENDERCMD_DRAW_LINES: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first); - - /* DirectX 9 has the same line rasterization semantics as GDI, - so we need to close the endpoint of the line with a second draw call. */ - const SDL_bool close_endpoint = ((count == 2) || (verts[0].x != verts[count-1].x) || (verts[0].y != verts[count-1].y)); - - SetDrawState(data, cmd); - - if (vbo) { - IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_LINESTRIP, (UINT) (first / sizeof (Vertex)), (UINT) (count - 1)); - if (close_endpoint) { - IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT) ((first / sizeof (Vertex)) + (count - 1)), 1); - } - } else { - IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, (UINT) (count - 1), verts, sizeof (Vertex)); - if (close_endpoint) { - IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, &verts[count-1], sizeof (Vertex)); - } + if (vbo) { + IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_LINESTRIP, (UINT)(first / sizeof(Vertex)), (UINT)(count - 1)); + if (close_endpoint) { + IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, (UINT)((first / sizeof(Vertex)) + (count - 1)), 1); + } + } else { + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_LINESTRIP, (UINT)(count - 1), verts, sizeof(Vertex)); + if (close_endpoint) { + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, 1, &verts[count - 1], sizeof(Vertex)); } - break; } + break; + } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - case SDL_RENDERCMD_COPY: /* unused */ - break; + case SDL_RENDERCMD_COPY: /* unused */ + break; - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - case SDL_RENDERCMD_GEOMETRY: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - SetDrawState(data, cmd); - if (vbo) { - IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLELIST, (UINT) (first / sizeof (Vertex)), (UINT) count / 3); - } else { - const Vertex* verts = (Vertex*)(((Uint8*)vertices) + first); - IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLELIST, (UINT) count / 3, verts, sizeof(Vertex)); - } - break; + case SDL_RENDERCMD_GEOMETRY: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + SetDrawState(data, cmd); + if (vbo) { + IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLELIST, (UINT)(first / sizeof(Vertex)), (UINT)count / 3); + } else { + const Vertex *verts = (Vertex *)(((Uint8 *)vertices) + first); + IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLELIST, (UINT)count / 3, verts, sizeof(Vertex)); } + break; + } - case SDL_RENDERCMD_NO_OP: - break; + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -1319,12 +1293,10 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti return 0; } - -static int -D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +static int D3D_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; D3DSURFACE_DESC desc; LPDIRECT3DSURFACE9 backBuffer; LPDIRECT3DSURFACE9 surface; @@ -1356,9 +1328,9 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, } d3drect.left = rect->x; - d3drect.right = rect->x + rect->w; + d3drect.right = (LONG)rect->x + rect->w; d3drect.top = rect->y; - d3drect.bottom = rect->y + rect->h; + d3drect.bottom = (LONG)rect->y + rect->h; result = IDirect3DSurface9_LockRect(surface, &locked, &d3drect, D3DLOCK_READONLY); if (FAILED(result)) { @@ -1367,8 +1339,8 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, } status = SDL_ConvertPixels(rect->w, rect->h, - D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch, - format, pixels, pitch); + D3DFMTToPixelFormat(desc.Format), locked.pBits, locked.Pitch, + format, pixels, pitch); IDirect3DSurface9_UnlockRect(surface); @@ -1377,10 +1349,9 @@ D3D_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -D3D_RenderPresent(SDL_Renderer * renderer) +static int D3D_RenderPresent(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; HRESULT result; if (!data->beginScene) { @@ -1403,11 +1374,10 @@ D3D_RenderPresent(SDL_Renderer * renderer) return 0; } -static void -D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void D3D_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata; - D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; + D3D_RenderData *renderdata = (D3D_RenderData *)renderer->driverdata; + D3D_TextureData *data = (D3D_TextureData *)texture->driverdata; if (renderdata->drawstate.texture == texture) { renderdata->drawstate.texture = NULL; @@ -1436,10 +1406,9 @@ D3D_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture->driverdata = NULL; } -static void -D3D_DestroyRenderer(SDL_Renderer * renderer) +static void D3D_DestroyRenderer(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; if (data) { int i; @@ -1449,7 +1418,7 @@ D3D_DestroyRenderer(SDL_Renderer * renderer) IDirect3DSurface9_Release(data->defaultRenderTarget); data->defaultRenderTarget = NULL; } - if (data->currentRenderTarget != NULL) { + if (data->currentRenderTarget) { IDirect3DSurface9_Release(data->currentRenderTarget); data->currentRenderTarget = NULL; } @@ -1478,13 +1447,11 @@ D3D_DestroyRenderer(SDL_Renderer * renderer) } SDL_free(data); } - SDL_free(renderer); } -static int -D3D_Reset(SDL_Renderer * renderer) +static int D3D_Reset(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; const Float4X4 d3dmatrix = MatrixIdentity(); HRESULT result; SDL_Texture *texture; @@ -1501,7 +1468,7 @@ D3D_Reset(SDL_Renderer * renderer) IDirect3DSurface9_Release(data->defaultRenderTarget); data->defaultRenderTarget = NULL; } - if (data->currentRenderTarget != NULL) { + if (data->currentRenderTarget) { IDirect3DSurface9_Release(data->currentRenderTarget); data->currentRenderTarget = NULL; } @@ -1550,7 +1517,7 @@ D3D_Reset(SDL_Renderer * renderer) data->drawstate.texture = NULL; data->drawstate.shader = NULL; data->drawstate.blend = SDL_BLENDMODE_INVALID; - IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&d3dmatrix); + IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX *)&d3dmatrix); /* Let the application know that render targets were reset */ { @@ -1562,8 +1529,7 @@ D3D_Reset(SDL_Renderer * renderer) return 0; } -static int -D3D_SetVSync(SDL_Renderer * renderer, const int vsync) +static int D3D_SetVSync(SDL_Renderer *renderer, const int vsync) { D3D_RenderData *data = renderer->driverdata; if (vsync) { @@ -1580,10 +1546,8 @@ D3D_SetVSync(SDL_Renderer * renderer, const int vsync) return 0; } -SDL_Renderer * -D3D_CreateRenderer(SDL_Window * window, Uint32 flags) +int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; D3D_RenderData *data; SDL_SysWMinfo windowinfo; HRESULT result; @@ -1596,24 +1560,14 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_DisplayMode fullscreen_mode; int displayIndex; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (D3D_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { - SDL_free(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } if (!D3D_LoadDLL(&data->d3dDLL, &data->d3d)) { - SDL_free(renderer); SDL_free(data); - SDL_SetError("Unable to create Direct3D interface"); - return NULL; + return SDL_SetError("Unable to create Direct3D interface"); } renderer->WindowEvent = D3D_WindowEvent; @@ -1629,9 +1583,9 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = D3D_SetTextureScaleMode; renderer->SetRenderTarget = D3D_SetRenderTarget; renderer->QueueSetViewport = D3D_QueueSetViewport; - renderer->QueueSetDrawColor = D3D_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = D3D_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = D3D_QueueDrawPoints; - renderer->QueueDrawLines = D3D_QueueDrawPoints; /* lines and points queue vertices the same way. */ + renderer->QueueDrawLines = D3D_QueueDrawPoints; /* lines and points queue vertices the same way. */ renderer->QueueGeometry = D3D_QueueGeometry; renderer->RunCommandQueue = D3D_RunCommandQueue; renderer->RenderReadPixels = D3D_RenderReadPixels; @@ -1644,7 +1598,11 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->driverdata = data; SDL_VERSION(&windowinfo.version); - SDL_GetWindowWMInfo(window, &windowinfo); + if (!SDL_GetWindowWMInfo(window, &windowinfo) || + windowinfo.subsystem != SDL_SYSWM_WINDOWS) { + SDL_free(data); + return SDL_SetError("Couldn't get window handle"); + } window_flags = SDL_GetWindowFlags(window); SDL_GetWindowSizeInPixels(window, &w, &h); @@ -1696,23 +1654,20 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) &pparams, &data->device); if (FAILED(result)) { D3D_DestroyRenderer(renderer); - D3D_SetError("CreateDevice()", result); - return NULL; + return D3D_SetError("CreateDevice()", result); } /* Get presentation parameters to fill info */ result = IDirect3DDevice9_GetSwapChain(data->device, 0, &chain); if (FAILED(result)) { D3D_DestroyRenderer(renderer); - D3D_SetError("GetSwapChain()", result); - return NULL; + return D3D_SetError("GetSwapChain()", result); } result = IDirect3DSwapChain9_GetPresentParameters(chain, &pparams); if (FAILED(result)) { IDirect3DSwapChain9_Release(chain); D3D_DestroyRenderer(renderer); - D3D_SetError("GetPresentParameters()", result); - return NULL; + return D3D_SetError("GetPresentParameters()", result); } IDirect3DSwapChain9_Release(chain); if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) { @@ -1754,30 +1709,28 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) data->drawstate.cliprect_enabled_dirty = SDL_TRUE; data->drawstate.blend = SDL_BLENDMODE_INVALID; - return renderer; + return 0; } SDL_RenderDriver D3D_RenderDriver = { D3D_CreateRenderer, - { - "direct3d", - (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), - 1, - {SDL_PIXELFORMAT_ARGB8888}, - 0, - 0} + { "direct3d", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 1, + { SDL_PIXELFORMAT_ARGB8888 }, + 0, + 0 } }; -#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D */ #if defined(__WIN32__) || defined(__WINGDK__) /* This function needs to always exist on Windows, for the Dynamic API. */ -IDirect3DDevice9 * -SDL_RenderGetD3D9Device(SDL_Renderer * renderer) +IDirect3DDevice9 *SDL_RenderGetD3D9Device(SDL_Renderer *renderer) { IDirect3DDevice9 *device = NULL; -#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED - D3D_RenderData *data = (D3D_RenderData *) renderer->driverdata; +#if SDL_VIDEO_RENDER_D3D + D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; /* Make sure that this is a D3D renderer */ if (renderer->DestroyRenderer != D3D_DestroyRenderer) { @@ -1789,7 +1742,7 @@ SDL_RenderGetD3D9Device(SDL_Renderer * renderer) if (device) { IDirect3DDevice9_AddRef(device); } -#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D */ return device; } diff --git a/src/render/direct3d/SDL_shaders_d3d.c b/src/render/direct3d/SDL_shaders_d3d.c index d734351c83d43..9c5835adc8e26 100644 --- a/src/render/direct3d/SDL_shaders_d3d.c +++ b/src/render/direct3d/SDL_shaders_d3d.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #include "SDL_render.h" #include "SDL_system.h" -#if SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D #include "../../core/windows/SDL_windows.h" @@ -257,7 +257,6 @@ static const DWORD D3D9_PixelShader_YUV_BT709[] = { 0x90e40000, 0x02000001, 0x800f0800, 0x80e40000, 0x0000ffff }; - static const DWORD *D3D9_shaders[] = { D3D9_PixelShader_YUV_JPEG, D3D9_PixelShader_YUV_BT601, @@ -269,6 +268,6 @@ HRESULT D3D9_CreatePixelShader(IDirect3DDevice9 *d3dDevice, D3D9_Shader shader, return IDirect3DDevice9_CreatePixelShader(d3dDevice, D3D9_shaders[shader], pixelShader); } -#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d/SDL_shaders_d3d.h b/src/render/direct3d/SDL_shaders_d3d.h index b7715cb7506a3..389a1228d1050 100644 --- a/src/render/direct3d/SDL_shaders_d3d.h +++ b/src/render/direct3d/SDL_shaders_d3d.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,8 @@ /* D3D9 shader implementation */ -typedef enum { +typedef enum +{ SHADER_YUV_JPEG, SHADER_YUV_BT601, SHADER_YUV_BT709, diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 8369e54f69125..f5d0d80a3bd2d 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #include "SDL_render.h" #include "SDL_system.h" -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 #define COBJMACROS #include "../../core/windows/SDL_windows.h" @@ -51,11 +51,10 @@ #if WINAPI_FAMILY == WINAPI_FAMILY_APP #include /* TODO, WinRT, XAML: get the ISwapChainBackgroundPanelNative from something other than a global var */ -extern ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative; -#endif /* WINAPI_FAMILY == WINAPI_FAMILY_APP */ - -#endif /* __WINRT__ */ +extern ISwapChainBackgroundPanelNative *WINRT_GlobalSwapChainBackgroundPanelNative; +#endif /* WINAPI_FAMILY == WINAPI_FAMILY_APP */ +#endif /* __WINRT__ */ #if defined(_MSC_VER) && !defined(__clang__) #define SDL_COMPOSE_ERROR(str) __FUNCTION__ ", " str @@ -63,8 +62,11 @@ extern ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNat #define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str #endif -#define SAFE_RELEASE(X) if ((X)) { IUnknown_Release(SDL_static_cast(IUnknown*, X)); X = NULL; } - +#define SAFE_RELEASE(X) \ + if ((X)) { \ + IUnknown_Release(SDL_static_cast(IUnknown *, X)); \ + X = NULL; \ + } /* !!! FIXME: vertex buffer bandwidth could be lower; only use UV coords when !!! FIXME: textures are needed. */ @@ -170,15 +172,14 @@ typedef struct int currentVertexBuffer; } D3D11_RenderData; - /* Define D3D GUIDs here so we don't have to include uuid.lib. -* -* Fix for SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3437: -* The extra 'SDL_' was added to the start of each IID's name, in order -* to prevent build errors on both MinGW-w64 and WinRT/UWP. -* (SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3336 led to -* linker errors in WinRT/UWP builds.) -*/ + * + * Fix for SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3437: + * The extra 'SDL_' was added to the start of each IID's name, in order + * to prevent build errors on both MinGW-w64 and WinRT/UWP. + * (SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3336 led to + * linker errors in WinRT/UWP builds.) + */ #ifdef __GNUC__ #pragma GCC diagnostic push @@ -199,45 +200,40 @@ static const GUID SDL_IID_ID3D11DeviceContext1 = { 0xbb2c6faa, 0xb5fb, 0x4082, { #pragma GCC diagnostic pop #endif - - -Uint32 -D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) +Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { switch (dxgiFormat) { - case DXGI_FORMAT_B8G8R8A8_UNORM: - return SDL_PIXELFORMAT_ARGB8888; - case DXGI_FORMAT_B8G8R8X8_UNORM: - return SDL_PIXELFORMAT_RGB888; - default: - return SDL_PIXELFORMAT_UNKNOWN; + case DXGI_FORMAT_B8G8R8A8_UNORM: + return SDL_PIXELFORMAT_ARGB8888; + case DXGI_FORMAT_B8G8R8X8_UNORM: + return SDL_PIXELFORMAT_RGB888; + default: + return SDL_PIXELFORMAT_UNKNOWN; } } -static DXGI_FORMAT -SDLPixelFormatToDXGIFormat(Uint32 sdlFormat) +static DXGI_FORMAT SDLPixelFormatToDXGIFormat(Uint32 sdlFormat) { switch (sdlFormat) { - case SDL_PIXELFORMAT_ARGB8888: - return DXGI_FORMAT_B8G8R8A8_UNORM; - case SDL_PIXELFORMAT_RGB888: - return DXGI_FORMAT_B8G8R8X8_UNORM; - case SDL_PIXELFORMAT_YV12: - case SDL_PIXELFORMAT_IYUV: - case SDL_PIXELFORMAT_NV12: /* For the Y texture */ - case SDL_PIXELFORMAT_NV21: /* For the Y texture */ - return DXGI_FORMAT_R8_UNORM; - default: - return DXGI_FORMAT_UNKNOWN; + case SDL_PIXELFORMAT_ARGB8888: + return DXGI_FORMAT_B8G8R8A8_UNORM; + case SDL_PIXELFORMAT_RGB888: + return DXGI_FORMAT_B8G8R8X8_UNORM; + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + case SDL_PIXELFORMAT_NV12: /* For the Y texture */ + case SDL_PIXELFORMAT_NV21: /* For the Y texture */ + return DXGI_FORMAT_R8_UNORM; + default: + return DXGI_FORMAT_UNKNOWN; } } -static void D3D11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static void D3D11_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); -static void -D3D11_ReleaseAll(SDL_Renderer * renderer) +static void D3D11_ReleaseAll(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; SDL_Texture *texture = NULL; /* Release all textures */ @@ -278,7 +274,7 @@ D3D11_ReleaseAll(SDL_Renderer * renderer) SAFE_RELEASE(data->clippedRasterizer); SAFE_RELEASE(data->vertexShaderConstants); - data->swapEffect = (DXGI_SWAP_EFFECT) 0; + data->swapEffect = (DXGI_SWAP_EFFECT)0; data->rotation = DXGI_MODE_ROTATION_UNSPECIFIED; data->currentRenderTargetView = NULL; data->currentRasterizerState = NULL; @@ -301,15 +297,13 @@ D3D11_ReleaseAll(SDL_Renderer * renderer) } } -static void -D3D11_DestroyRenderer(SDL_Renderer * renderer) +static void D3D11_DestroyRenderer(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; D3D11_ReleaseAll(renderer); if (data) { SDL_free(data); } - SDL_free(renderer); } static D3D11_BLEND GetBlendFunc(SDL_BlendFactor factor) @@ -358,10 +352,9 @@ static D3D11_BLEND_OP GetBlendEquation(SDL_BlendOperation operation) } } -static ID3D11BlendState * -D3D11_CreateBlendState(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static ID3D11BlendState *D3D11_CreateBlendState(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -405,12 +398,11 @@ D3D11_CreateBlendState(SDL_Renderer * renderer, SDL_BlendMode blendMode) } /* Create resources that depend on the device. */ -static HRESULT -D3D11_CreateDeviceResources(SDL_Renderer * renderer) +static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) { - typedef HRESULT(WINAPI *PFN_CREATE_DXGI_FACTORY)(REFIID riid, void **ppFactory); + typedef HRESULT(WINAPI * PFN_CREATE_DXGI_FACTORY)(REFIID riid, void **ppFactory); PFN_CREATE_DXGI_FACTORY CreateDXGIFactoryFunc; - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; PFN_D3D11_CREATE_DEVICE D3D11CreateDeviceFunc; ID3D11Device *d3dDevice = NULL; ID3D11DeviceContext *d3dContext = NULL; @@ -424,8 +416,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) * Don't forget to declare your application's minimum required feature level in its * description. All applications are assumed to support 9.1 unless otherwise stated. */ - D3D_FEATURE_LEVEL featureLevels[] = - { + D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, @@ -504,11 +495,11 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) creationFlags, /* Set set debug and Direct2D compatibility flags. */ featureLevels, /* List of feature levels this app can support. */ SDL_arraysize(featureLevels), - D3D11_SDK_VERSION, /* Always set this to D3D11_SDK_VERSION for Windows Store apps. */ - &d3dDevice, /* Returns the Direct3D device created. */ + D3D11_SDK_VERSION, /* Always set this to D3D11_SDK_VERSION for Windows Store apps. */ + &d3dDevice, /* Returns the Direct3D device created. */ &data->featureLevel, /* Returns feature level of device created. */ - &d3dContext /* Returns the device immediate context. */ - ); + &d3dContext /* Returns the device immediate context. */ + ); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D11CreateDevice"), result); goto done; @@ -546,29 +537,29 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) * http://msdn.microsoft.com/en-us/library/windows/apps/ff476876.aspx */ switch (data->featureLevel) { - case D3D_FEATURE_LEVEL_11_1: - case D3D_FEATURE_LEVEL_11_0: - renderer->info.max_texture_width = renderer->info.max_texture_height = 16384; - break; + case D3D_FEATURE_LEVEL_11_1: + case D3D_FEATURE_LEVEL_11_0: + renderer->info.max_texture_width = renderer->info.max_texture_height = 16384; + break; - case D3D_FEATURE_LEVEL_10_1: - case D3D_FEATURE_LEVEL_10_0: - renderer->info.max_texture_width = renderer->info.max_texture_height = 8192; - break; + case D3D_FEATURE_LEVEL_10_1: + case D3D_FEATURE_LEVEL_10_0: + renderer->info.max_texture_width = renderer->info.max_texture_height = 8192; + break; - case D3D_FEATURE_LEVEL_9_3: - renderer->info.max_texture_width = renderer->info.max_texture_height = 4096; - break; + case D3D_FEATURE_LEVEL_9_3: + renderer->info.max_texture_width = renderer->info.max_texture_height = 4096; + break; - case D3D_FEATURE_LEVEL_9_2: - case D3D_FEATURE_LEVEL_9_1: - renderer->info.max_texture_width = renderer->info.max_texture_height = 2048; - break; + case D3D_FEATURE_LEVEL_9_2: + case D3D_FEATURE_LEVEL_9_1: + renderer->info.max_texture_width = renderer->info.max_texture_height = 2048; + break; - default: - SDL_SetError("%s, Unexpected feature level: %d", __FUNCTION__, data->featureLevel); - result = E_FAIL; - goto done; + default: + SDL_SetError("%s, Unexpected feature level: %d", __FUNCTION__, data->featureLevel); + result = E_FAIL; + goto done; } if (D3D11_CreateVertexShader(data->d3dDevice, &data->vertexShader, &data->inputLayout) < 0) { @@ -587,10 +578,9 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) constantBufferDesc.Usage = D3D11_USAGE_DEFAULT; constantBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; result = ID3D11Device_CreateBuffer(data->d3dDevice, - &constantBufferDesc, - NULL, - &data->vertexShaderConstants - ); + &constantBufferDesc, + NULL, + &data->vertexShaderConstants); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateBuffer [vertex shader constants]"), result); goto done; @@ -608,9 +598,8 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) samplerDesc.MinLOD = 0.0f; samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; result = ID3D11Device_CreateSamplerState(data->d3dDevice, - &samplerDesc, - &data->nearestPixelSampler - ); + &samplerDesc, + &data->nearestPixelSampler); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateSamplerState [nearest-pixel filter]"), result); goto done; @@ -618,9 +607,8 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; result = ID3D11Device_CreateSamplerState(data->d3dDevice, - &samplerDesc, - &data->linearSampler - ); + &samplerDesc, + &data->linearSampler); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateSamplerState [linear filter]"), result); goto done; @@ -674,8 +662,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer) #if defined(__WIN32__) || defined(__WINGDK__) -static DXGI_MODE_ROTATION -D3D11_GetCurrentRotation() +static DXGI_MODE_ROTATION D3D11_GetCurrentRotation() { /* FIXME */ return DXGI_MODE_ROTATION_IDENTITY; @@ -683,20 +670,18 @@ D3D11_GetCurrentRotation() #endif /* defined(__WIN32__) || defined(__WINGDK__) */ -static BOOL -D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) +static BOOL D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) { switch (rotation) { - case DXGI_MODE_ROTATION_ROTATE90: - case DXGI_MODE_ROTATION_ROTATE270: - return TRUE; - default: - return FALSE; + case DXGI_MODE_ROTATION_ROTATE90: + case DXGI_MODE_ROTATION_ROTATE270: + return TRUE; + default: + return FALSE; } } -static int -D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer) +static int D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; if (data->currentOffscreenRenderTargetView) { @@ -706,57 +691,55 @@ D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer) } } -static int -D3D11_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D11_RECT * outRect, BOOL includeViewportOffset) +static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rect *sdlRect, D3D11_RECT *outRect, BOOL includeViewportOffset) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; const int rotation = D3D11_GetRotationForCurrentRenderTarget(renderer); const SDL_Rect *viewport = &data->currentViewport; switch (rotation) { - case DXGI_MODE_ROTATION_IDENTITY: - outRect->left = sdlRect->x; - outRect->right = sdlRect->x + sdlRect->w; - outRect->top = sdlRect->y; - outRect->bottom = sdlRect->y + sdlRect->h; - if (includeViewportOffset) { - outRect->left += viewport->x; - outRect->right += viewport->x; - outRect->top += viewport->y; - outRect->bottom += viewport->y; - } - break; - case DXGI_MODE_ROTATION_ROTATE270: - outRect->left = sdlRect->y; - outRect->right = sdlRect->y + sdlRect->h; - outRect->top = viewport->w - sdlRect->x - sdlRect->w; - outRect->bottom = viewport->w - sdlRect->x; - break; - case DXGI_MODE_ROTATION_ROTATE180: - outRect->left = viewport->w - sdlRect->x - sdlRect->w; - outRect->right = viewport->w - sdlRect->x; - outRect->top = viewport->h - sdlRect->y - sdlRect->h; - outRect->bottom = viewport->h - sdlRect->y; - break; - case DXGI_MODE_ROTATION_ROTATE90: - outRect->left = viewport->h - sdlRect->y - sdlRect->h; - outRect->right = viewport->h - sdlRect->y; - outRect->top = sdlRect->x; - outRect->bottom = sdlRect->x + sdlRect->h; - break; - default: - return SDL_SetError("The physical display is in an unknown or unsupported rotation"); + case DXGI_MODE_ROTATION_IDENTITY: + outRect->left = sdlRect->x; + outRect->right = (LONG)sdlRect->x + sdlRect->w; + outRect->top = sdlRect->y; + outRect->bottom = (LONG)sdlRect->y + sdlRect->h; + if (includeViewportOffset) { + outRect->left += viewport->x; + outRect->right += viewport->x; + outRect->top += viewport->y; + outRect->bottom += viewport->y; + } + break; + case DXGI_MODE_ROTATION_ROTATE270: + outRect->left = sdlRect->y; + outRect->right = (LONG)sdlRect->y + sdlRect->h; + outRect->top = viewport->w - sdlRect->x - sdlRect->w; + outRect->bottom = viewport->w - sdlRect->x; + break; + case DXGI_MODE_ROTATION_ROTATE180: + outRect->left = viewport->w - sdlRect->x - sdlRect->w; + outRect->right = viewport->w - sdlRect->x; + outRect->top = viewport->h - sdlRect->y - sdlRect->h; + outRect->bottom = viewport->h - sdlRect->y; + break; + case DXGI_MODE_ROTATION_ROTATE90: + outRect->left = viewport->h - sdlRect->y - sdlRect->h; + outRect->right = viewport->h - sdlRect->y; + outRect->top = sdlRect->x; + outRect->bottom = (LONG)sdlRect->x + sdlRect->h; + break; + default: + return SDL_SetError("The physical display is in an unknown or unsupported rotation"); } return 0; } -static HRESULT -D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) +static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; #ifdef __WINRT__ IUnknown *coreWindow = D3D11_GetCoreWindowFromSDLRenderer(renderer); - const BOOL usingXAML = (coreWindow == NULL); + const BOOL usingXAML = (!coreWindow); #else IUnknown *coreWindow = NULL; const BOOL usingXAML = FALSE; @@ -774,8 +757,8 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) swapChainDesc.SampleDesc.Quality = 0; swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.BufferCount = 2; /* Use double-buffering to minimize latency. */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; /* On phone, only stretch and aspect-ratio stretch scaling are allowed. */ +#if SDL_WINAPI_FAMILY_PHONE + swapChainDesc.Scaling = DXGI_SCALING_STRETCH; /* On phone, only stretch and aspect-ratio stretch scaling are allowed. */ swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; /* On phone, no swap effects are supported. */ /* TODO, WinRT: see if Win 8.x DXGI_SWAP_CHAIN_DESC1 settings are available on Windows Phone 8.1, and if there's any advantage to having them on */ #else @@ -794,29 +777,28 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) if (coreWindow) { result = IDXGIFactory2_CreateSwapChainForCoreWindow(data->dxgiFactory, - (IUnknown *)data->d3dDevice, - coreWindow, - &swapChainDesc, - NULL, /* Allow on all displays. */ - &data->swapChain - ); + (IUnknown *)data->d3dDevice, + coreWindow, + &swapChainDesc, + NULL, /* Allow on all displays. */ + &data->swapChain); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForCoreWindow"), result); goto done; } } else if (usingXAML) { result = IDXGIFactory2_CreateSwapChainForComposition(data->dxgiFactory, - (IUnknown *)data->d3dDevice, - &swapChainDesc, - NULL, - &data->swapChain); + (IUnknown *)data->d3dDevice, + &swapChainDesc, + NULL, + &data->swapChain); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForComposition"), result); goto done; } #if WINAPI_FAMILY == WINAPI_FAMILY_APP - result = ISwapChainBackgroundPanelNative_SetSwapChain(WINRT_GlobalSwapChainBackgroundPanelNative, (IDXGISwapChain *) data->swapChain); + result = ISwapChainBackgroundPanelNative_SetSwapChain(WINRT_GlobalSwapChainBackgroundPanelNative, (IDXGISwapChain *)data->swapChain); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ISwapChainBackgroundPanelNative::SetSwapChain"), result); goto done; @@ -830,16 +812,20 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) #if defined(__WIN32__) || defined(__WINGDK__) SDL_SysWMinfo windowinfo; SDL_VERSION(&windowinfo.version); - SDL_GetWindowWMInfo(renderer->window, &windowinfo); + if (!SDL_GetWindowWMInfo(renderer->window, &windowinfo) || + windowinfo.subsystem != SDL_SYSWM_WINDOWS) { + SDL_SetError("Couldn't get window handle"); + result = E_FAIL; + goto done; + } result = IDXGIFactory2_CreateSwapChainForHwnd(data->dxgiFactory, - (IUnknown *)data->d3dDevice, - windowinfo.info.win.window, - &swapChainDesc, - NULL, - NULL, /* Allow on all displays. */ - &data->swapChain - ); + (IUnknown *)data->d3dDevice, + windowinfo.info.win.window, + &swapChainDesc, + NULL, + NULL, /* Allow on all displays. */ + &data->swapChain); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForHwnd"), result); goto done; @@ -847,9 +833,9 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) IDXGIFactory_MakeWindowAssociation(data->dxgiFactory, windowinfo.info.win.window, DXGI_MWA_NO_WINDOW_CHANGES); #else - SDL_SetError(__FUNCTION__", Unable to find something to attach a swap chain to"); + SDL_SetError(__FUNCTION__ ", Unable to find something to attach a swap chain to"); goto done; -#endif /* defined(__WIN32__) || defined(__WINGDK__) / else */ +#endif /* defined(__WIN32__) || defined(__WINGDK__) / else */ } data->swapEffect = swapChainDesc.SwapEffect; @@ -858,19 +844,17 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h) return result; } -static void -D3D11_ReleaseMainRenderTargetView(SDL_Renderer * renderer) +static void D3D11_ReleaseMainRenderTargetView(SDL_Renderer *renderer) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; ID3D11DeviceContext_OMSetRenderTargets(data->d3dContext, 0, NULL, NULL); SAFE_RELEASE(data->mainRenderTargetView); } -static HRESULT D3D11_UpdateForWindowSizeChange(SDL_Renderer * renderer); - +static HRESULT D3D11_UpdateForWindowSizeChange(SDL_Renderer *renderer); HRESULT -D3D11_HandleDeviceLost(SDL_Renderer * renderer) +D3D11_HandleDeviceLost(SDL_Renderer *renderer) { HRESULT result = S_OK; @@ -899,8 +883,7 @@ D3D11_HandleDeviceLost(SDL_Renderer * renderer) } /* Initialize all resources that change when the window's size changes. */ -static HRESULT -D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) +static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; ID3D11Texture2D *backBuffer = NULL; @@ -928,19 +911,18 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) if (data->swapChain) { /* IDXGISwapChain::ResizeBuffers is not available on Windows Phone 8. */ -#if !defined(__WINRT__) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) +#if !defined(__WINRT__) || !SDL_WINAPI_FAMILY_PHONE /* If the swap chain already exists, resize it. */ result = IDXGISwapChain_ResizeBuffers(data->swapChain, - 0, - w, h, - DXGI_FORMAT_UNKNOWN, - 0 - ); + 0, + w, h, + DXGI_FORMAT_UNKNOWN, + 0); if (result == DXGI_ERROR_DEVICE_REMOVED) { /* If the device was removed for any reason, a new device and swap chain will need to be created. */ D3D11_HandleDeviceLost(renderer); - /* Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method + /* Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method * and correctly set up the new device. */ goto done; @@ -951,12 +933,12 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) #endif } else { result = D3D11_CreateSwapChain(renderer, w, h); - if (FAILED(result)) { + if (FAILED(result) || !data->swapChain) { goto done; } } - -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP + +#if !SDL_WINAPI_FAMILY_PHONE /* Set the proper rotation for the swap chain. * * To note, the call for this, IDXGISwapChain1::SetRotation, is not necessary @@ -985,10 +967,9 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) #endif result = IDXGISwapChain_GetBuffer(data->swapChain, - 0, - &SDL_IID_ID3D11Texture2D, - (void **)&backBuffer - ); + 0, + &SDL_IID_ID3D11Texture2D, + (void **)&backBuffer); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::GetBuffer [back-buffer]"), result); goto done; @@ -996,10 +977,9 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) /* Create a render target view of the swap chain back buffer. */ result = ID3D11Device_CreateRenderTargetView(data->d3dDevice, - (ID3D11Resource *)backBuffer, - NULL, - &data->mainRenderTargetView - ); + (ID3D11Resource *)backBuffer, + NULL, + &data->mainRenderTargetView); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device::CreateRenderTargetView"), result); goto done; @@ -1010,10 +990,9 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) * null references in places like ReadPixels! */ ID3D11DeviceContext_OMSetRenderTargets(data->d3dContext, - 1, - &data->mainRenderTargetView, - NULL - ); + 1, + &data->mainRenderTargetView, + NULL); data->viewportDirty = SDL_TRUE; @@ -1023,14 +1002,12 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) } /* This method is called when the window's size changes. */ -static HRESULT -D3D11_UpdateForWindowSizeChange(SDL_Renderer * renderer) +static HRESULT D3D11_UpdateForWindowSizeChange(SDL_Renderer *renderer) { return D3D11_CreateWindowSizeDependentResources(renderer); } -void -D3D11_Trim(SDL_Renderer * renderer) +void D3D11_Trim(SDL_Renderer *renderer) { #ifdef __WINRT__ #if NTDDI_VERSION > NTDDI_WIN8 @@ -1040,7 +1017,7 @@ D3D11_Trim(SDL_Renderer * renderer) result = ID3D11Device_QueryInterface(data->d3dDevice, &SDL_IID_IDXGIDevice3, &dxgiDevice); if (FAILED(result)) { - //WIN_SetErrorFromHRESULT(__FUNCTION__ ", ID3D11Device to IDXGIDevice3", result); + // WIN_SetErrorFromHRESULT(__FUNCTION__ ", ID3D11Device to IDXGIDevice3", result); return; } @@ -1050,8 +1027,7 @@ D3D11_Trim(SDL_Renderer * renderer) #endif } -static void -D3D11_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void D3D11_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { D3D11_UpdateForWindowSizeChange(renderer); @@ -1059,16 +1035,14 @@ D3D11_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } #if !defined(__WINRT__) -static int -D3D11_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int D3D11_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GetWindowSizeInPixels(renderer->window, w, h); return 0; } #endif -static SDL_bool -D3D11_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool D3D11_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -1086,10 +1060,9 @@ D3D11_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) return SDL_TRUE; } -static int -D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; D3D11_TextureData *textureData; HRESULT result; DXGI_FORMAT textureFormat = SDLPixelFormatToDXGIFormat(texture->format); @@ -1098,15 +1071,15 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (textureFormat == DXGI_FORMAT_UNKNOWN) { return SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified", - __FUNCTION__, texture->format); + __FUNCTION__, texture->format); } - textureData = (D3D11_TextureData*) SDL_calloc(1, sizeof(*textureData)); + textureData = (D3D11_TextureData *)SDL_calloc(1, sizeof(*textureData)); if (!textureData) { SDL_OutOfMemory(); return -1; } - textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; + textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; texture->driverdata = textureData; @@ -1135,10 +1108,9 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &textureDesc, - NULL, - &textureData->mainTexture - ); + &textureDesc, + NULL, + &textureData->mainTexture); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); @@ -1152,20 +1124,18 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) textureDesc.Height = (textureDesc.Height + 1) / 2; result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &textureDesc, - NULL, - &textureData->mainTextureU - ); + &textureDesc, + NULL, + &textureData->mainTextureU); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &textureDesc, - NULL, - &textureData->mainTextureV - ); + &textureDesc, + NULL, + &textureData->mainTextureV); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); @@ -1183,10 +1153,9 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) nvTextureDesc.Height = (textureDesc.Height + 1) / 2; result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &nvTextureDesc, - NULL, - &textureData->mainTextureNV - ); + &nvTextureDesc, + NULL, + &textureData->mainTextureNV); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); @@ -1199,10 +1168,9 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) resourceViewDesc.Texture2D.MostDetailedMip = 0; resourceViewDesc.Texture2D.MipLevels = textureDesc.MipLevels; result = ID3D11Device_CreateShaderResourceView(rendererData->d3dDevice, - (ID3D11Resource *)textureData->mainTexture, - &resourceViewDesc, - &textureData->mainTextureResourceView - ); + (ID3D11Resource *)textureData->mainTexture, + &resourceViewDesc, + &textureData->mainTextureResourceView); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateShaderResourceView"), result); @@ -1210,19 +1178,17 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #if SDL_HAVE_YUV if (textureData->yuv) { result = ID3D11Device_CreateShaderResourceView(rendererData->d3dDevice, - (ID3D11Resource *)textureData->mainTextureU, - &resourceViewDesc, - &textureData->mainTextureResourceViewU - ); + (ID3D11Resource *)textureData->mainTextureU, + &resourceViewDesc, + &textureData->mainTextureResourceViewU); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateShaderResourceView"), result); } result = ID3D11Device_CreateShaderResourceView(rendererData->d3dDevice, - (ID3D11Resource *)textureData->mainTextureV, - &resourceViewDesc, - &textureData->mainTextureResourceViewV - ); + (ID3D11Resource *)textureData->mainTextureV, + &resourceViewDesc, + &textureData->mainTextureResourceViewV); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateShaderResourceView"), result); @@ -1235,10 +1201,9 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) nvResourceViewDesc.Format = DXGI_FORMAT_R8G8_UNORM; result = ID3D11Device_CreateShaderResourceView(rendererData->d3dDevice, - (ID3D11Resource *)textureData->mainTextureNV, - &nvResourceViewDesc, - &textureData->mainTextureResourceViewNV - ); + (ID3D11Resource *)textureData->mainTextureNV, + &nvResourceViewDesc, + &textureData->mainTextureResourceViewNV); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateShaderResourceView"), result); @@ -1254,9 +1219,9 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) renderTargetViewDesc.Texture2D.MipSlice = 0; result = ID3D11Device_CreateRenderTargetView(rendererData->d3dDevice, - (ID3D11Resource *)textureData->mainTexture, - &renderTargetViewDesc, - &textureData->mainTextureRenderTargetView); + (ID3D11Resource *)textureData->mainTexture, + &renderTargetViewDesc, + &textureData->mainTextureRenderTargetView); if (FAILED(result)) { D3D11_DestroyTexture(renderer, texture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateRenderTargetView"), result); @@ -1266,9 +1231,8 @@ D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static void -D3D11_DestroyTexture(SDL_Renderer * renderer, - SDL_Texture * texture) +static void D3D11_DestroyTexture(SDL_Renderer *renderer, + SDL_Texture *texture) { D3D11_TextureData *data = (D3D11_TextureData *)texture->driverdata; @@ -1293,8 +1257,7 @@ D3D11_DestroyTexture(SDL_Renderer * renderer, texture->driverdata = NULL; } -static int -D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *texture, int bpp, int x, int y, int w, int h, const void *pixels, int pitch) +static int D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *texture, int bpp, int x, int y, int w, int h, const void *pixels, int pitch) { ID3D11Texture2D *stagingTexture; const Uint8 *src; @@ -1314,21 +1277,20 @@ D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *tex stagingTextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; stagingTextureDesc.Usage = D3D11_USAGE_STAGING; result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &stagingTextureDesc, - NULL, - &stagingTexture); + &stagingTextureDesc, + NULL, + &stagingTexture); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D [create staging texture]"), result); } /* Get a write-only pointer to data in the staging texture: */ result = ID3D11DeviceContext_Map(rendererData->d3dContext, - (ID3D11Resource *)stagingTexture, - 0, - D3D11_MAP_WRITE, - 0, - &textureMemory - ); + (ID3D11Resource *)stagingTexture, + 0, + D3D11_MAP_WRITE, + 0, + &textureMemory); if (FAILED(result)) { SAFE_RELEASE(stagingTexture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11DeviceContext1::Map [map staging texture]"), result); @@ -1338,7 +1300,7 @@ D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *tex dst = textureMemory.pData; length = w * bpp; if (length == pitch && length == textureMemory.RowPitch) { - SDL_memcpy(dst, src, length*h); + SDL_memcpy(dst, src, (size_t)length * h); } else { if (length > (UINT)pitch) { length = pitch; @@ -1355,29 +1317,28 @@ D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *tex /* Commit the pixel buffer's changes back to the staging texture: */ ID3D11DeviceContext_Unmap(rendererData->d3dContext, - (ID3D11Resource *)stagingTexture, - 0); + (ID3D11Resource *)stagingTexture, + 0); /* Copy the staging texture's contents back to the texture: */ ID3D11DeviceContext_CopySubresourceRegion(rendererData->d3dContext, - (ID3D11Resource *)texture, - 0, - x, - y, - 0, - (ID3D11Resource *)stagingTexture, - 0, - NULL); + (ID3D11Resource *)texture, + 0, + x, + y, + 0, + (ID3D11Resource *)stagingTexture, + 0, + NULL); SAFE_RELEASE(stagingTexture); return 0; } -static int -D3D11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void * srcPixels, - int srcPitch) +static int D3D11_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *srcPixels, + int srcPitch) { D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; @@ -1392,14 +1353,14 @@ D3D11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, #if SDL_HAVE_YUV if (textureData->yuv) { /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + rect->h * srcPitch); + srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); if (D3D11_UpdateTextureInternal(rendererData, texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainTextureV : textureData->mainTextureU, SDL_BYTESPERPIXEL(texture->format), rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) / 2) < 0) { return -1; } /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); + srcPixels = (const void *)((const Uint8 *)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); if (D3D11_UpdateTextureInternal(rendererData, texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainTextureU : textureData->mainTextureV, SDL_BYTESPERPIXEL(texture->format), rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) / 2) < 0) { return -1; } @@ -1407,9 +1368,9 @@ D3D11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, if (textureData->nv12) { /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + rect->h * srcPitch); + srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); - if (D3D11_UpdateTextureInternal(rendererData, textureData->mainTextureNV, 2, rect->x / 2, rect->y / 2, ((rect->w + 1) / 2), (rect->h + 1) / 2, srcPixels, 2*((srcPitch + 1) / 2)) < 0) { + if (D3D11_UpdateTextureInternal(rendererData, textureData->mainTextureNV, 2, rect->x / 2, rect->y / 2, ((rect->w + 1) / 2), (rect->h + 1) / 2, srcPixels, 2 * ((srcPitch + 1) / 2)) < 0) { return -1; } } @@ -1418,12 +1379,11 @@ D3D11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } #if SDL_HAVE_YUV -static int -D3D11_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int D3D11_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; @@ -1444,11 +1404,10 @@ D3D11_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static int -D3D11_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int D3D11_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; @@ -1468,12 +1427,11 @@ D3D11_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, } #endif -static int -D3D11_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int D3D11_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; HRESULT result = S_OK; D3D11_TEXTURE2D_DESC stagingTextureDesc; D3D11_MAPPED_SUBRESOURCE textureMemory; @@ -1493,8 +1451,8 @@ D3D11_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, } textureData->locked_rect = *rect; *pixels = - (void *)((Uint8 *)textureData->pixels + rect->y * textureData->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(textureData->pixels + rect->y * textureData->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = textureData->pitch; return 0; } @@ -1502,7 +1460,7 @@ D3D11_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, if (textureData->stagingTexture) { return SDL_SetError("texture is already locked"); } - + /* Create a 'staging' texture, which will be used to write to a portion * of the main texture. This is necessary, as Direct3D 11.1 does not * have the ability to write a CPU-bound pixel buffer to a rectangular @@ -1519,27 +1477,26 @@ D3D11_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, stagingTextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; stagingTextureDesc.Usage = D3D11_USAGE_STAGING; result = ID3D11Device_CreateTexture2D(rendererData->d3dDevice, - &stagingTextureDesc, - NULL, - &textureData->stagingTexture); + &stagingTextureDesc, + NULL, + &textureData->stagingTexture); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D [create staging texture]"), result); } /* Get a write-only pointer to data in the staging texture: */ result = ID3D11DeviceContext_Map(rendererData->d3dContext, - (ID3D11Resource *)textureData->stagingTexture, - 0, - D3D11_MAP_WRITE, - 0, - &textureMemory - ); + (ID3D11Resource *)textureData->stagingTexture, + 0, + D3D11_MAP_WRITE, + 0, + &textureMemory); if (FAILED(result)) { SAFE_RELEASE(textureData->stagingTexture); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11DeviceContext1::Map [map staging texture]"), result); } - /* Make note of where the staging texture will be written to + /* Make note of where the staging texture will be written to * (on a call to SDL_UnlockTexture): */ textureData->lockedTexturePositionX = rect->x; @@ -1553,12 +1510,11 @@ D3D11_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static void -D3D11_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void D3D11_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; - + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + if (!textureData) { return; } @@ -1566,55 +1522,53 @@ D3D11_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (textureData->yuv || textureData->nv12) { const SDL_Rect *rect = &textureData->locked_rect; void *pixels = - (void *) ((Uint8 *) textureData->pixels + rect->y * textureData->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(textureData->pixels + rect->y * textureData->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); D3D11_UpdateTexture(renderer, texture, rect, pixels, textureData->pitch); return; } #endif /* Commit the pixel buffer's changes back to the staging texture: */ ID3D11DeviceContext_Unmap(rendererData->d3dContext, - (ID3D11Resource *)textureData->stagingTexture, - 0); + (ID3D11Resource *)textureData->stagingTexture, + 0); /* Copy the staging texture's contents back to the main texture: */ ID3D11DeviceContext_CopySubresourceRegion(rendererData->d3dContext, - (ID3D11Resource *)textureData->mainTexture, - 0, - textureData->lockedTexturePositionX, - textureData->lockedTexturePositionY, - 0, - (ID3D11Resource *)textureData->stagingTexture, - 0, - NULL); + (ID3D11Resource *)textureData->mainTexture, + 0, + textureData->lockedTexturePositionX, + textureData->lockedTexturePositionY, + 0, + (ID3D11Resource *)textureData->stagingTexture, + 0, + NULL); SAFE_RELEASE(textureData->stagingTexture); } -static void -D3D11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void D3D11_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; - + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + if (!textureData) { return; } - textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; + textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; } -static int -D3D11_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D11_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; D3D11_TextureData *textureData = NULL; - if (texture == NULL) { + if (!texture) { rendererData->currentOffscreenRenderTargetView = NULL; return 0; } - textureData = (D3D11_TextureData *) texture->driverdata; + textureData = (D3D11_TextureData *)texture->driverdata; if (!textureData->mainTextureRenderTargetView) { return SDL_SetError("specified texture is not a render target"); @@ -1625,16 +1579,14 @@ D3D11_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -D3D11_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int D3D11_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -D3D11_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int D3D11_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VertexPositionColor *verts = (VertexPositionColor *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertexPositionColor), 0, &cmd->data.draw.first); + VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); int i; SDL_Color color; color.r = cmd->data.draw.r; @@ -1660,15 +1612,14 @@ D3D11_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL return 0; } -static int -D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; - VertexPositionColor *verts = (VertexPositionColor *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertexPositionColor), 0, &cmd->data.draw.first); + VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -1690,14 +1641,14 @@ D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); + xy_ = (float *)((char *)xy + j * xy_stride); verts->pos.x = xy_[0] * scale_x; verts->pos.y = xy_[1] * scale_y; - verts->color = *(SDL_Color*)((char*)color + j * color_stride); + verts->color = *(SDL_Color *)((char *)color + j * color_stride); if (texture) { - float *uv_ = (float *)((char*)uv + j * uv_stride); + float *uv_ = (float *)((char *)uv + j * uv_stride); verts->tex.x = uv_[0]; verts->tex.y = uv_[1]; } else { @@ -1710,29 +1661,27 @@ D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture return 0; } -static int -D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, - const void * vertexData, size_t dataSizeInBytes) +static int D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, + const void *vertexData, size_t dataSizeInBytes) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; HRESULT result = S_OK; const int vbidx = rendererData->currentVertexBuffer; const UINT stride = sizeof(VertexPositionColor); const UINT offset = 0; if (dataSizeInBytes == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (rendererData->vertexBuffers[vbidx] && rendererData->vertexBufferSizes[vbidx] >= dataSizeInBytes) { D3D11_MAPPED_SUBRESOURCE mappedResource; result = ID3D11DeviceContext_Map(rendererData->d3dContext, - (ID3D11Resource *)rendererData->vertexBuffers[vbidx], - 0, - D3D11_MAP_WRITE_DISCARD, - 0, - &mappedResource - ); + (ID3D11Resource *)rendererData->vertexBuffers[vbidx], + 0, + D3D11_MAP_WRITE_DISCARD, + 0, + &mappedResource); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11DeviceContext1::Map [vertex buffer]"), result); } @@ -1745,7 +1694,7 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, SAFE_RELEASE(rendererData->vertexBuffers[vbidx]); SDL_zero(vertexBufferDesc); - vertexBufferDesc.ByteWidth = (UINT) dataSizeInBytes; + vertexBufferDesc.ByteWidth = (UINT)dataSizeInBytes; vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC; vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; @@ -1756,10 +1705,9 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, vertexBufferData.SysMemSlicePitch = 0; result = ID3D11Device_CreateBuffer(rendererData->d3dDevice, - &vertexBufferDesc, - &vertexBufferData, - &rendererData->vertexBuffers[vbidx] - ); + &vertexBufferDesc, + &vertexBufferData, + &rendererData->vertexBuffers[vbidx]); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateBuffer [vertex buffer]"), result); } @@ -1768,12 +1716,11 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, } ID3D11DeviceContext_IASetVertexBuffers(rendererData->d3dContext, - 0, - 1, - &rendererData->vertexBuffers[vbidx], - &stride, - &offset - ); + 0, + 1, + &rendererData->vertexBuffers[vbidx], + &stride, + &offset); rendererData->currentVertexBuffer++; if (rendererData->currentVertexBuffer >= SDL_arraysize(rendererData->vertexBuffers)) { @@ -1783,10 +1730,9 @@ D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, return 0; } -static int -D3D11_UpdateViewport(SDL_Renderer * renderer) +static int D3D11_UpdateViewport(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; const SDL_Rect *viewport = &data->currentViewport; Float4X4 projection; Float4X4 view; @@ -1840,8 +1786,8 @@ D3D11_UpdateViewport(SDL_Renderer * renderer) * for eventual transfer to the GPU. */ data->vertexShaderConstantsData.projectionAndView = MatrixMultiply( - view, - projection); + view, + projection); /* Update the Direct3D viewport, which seems to be aligned to the * swap buffer's coordinate space, which is always in either @@ -1850,15 +1796,15 @@ D3D11_UpdateViewport(SDL_Renderer * renderer) */ swapDimensions = D3D11_IsDisplayRotated90Degrees(rotation); if (swapDimensions) { - orientationAlignedViewport.x = (float) viewport->y; - orientationAlignedViewport.y = (float) viewport->x; - orientationAlignedViewport.w = (float) viewport->h; - orientationAlignedViewport.h = (float) viewport->w; + orientationAlignedViewport.x = (float)viewport->y; + orientationAlignedViewport.y = (float)viewport->x; + orientationAlignedViewport.w = (float)viewport->h; + orientationAlignedViewport.h = (float)viewport->w; } else { - orientationAlignedViewport.x = (float) viewport->x; - orientationAlignedViewport.y = (float) viewport->y; - orientationAlignedViewport.w = (float) viewport->w; - orientationAlignedViewport.h = (float) viewport->h; + orientationAlignedViewport.x = (float)viewport->x; + orientationAlignedViewport.y = (float)viewport->y; + orientationAlignedViewport.w = (float)viewport->w; + orientationAlignedViewport.h = (float)viewport->h; } /* TODO, WinRT: get custom viewports working with non-Landscape modes (Portrait, PortraitFlipped, and LandscapeFlipped) */ @@ -1876,22 +1822,19 @@ D3D11_UpdateViewport(SDL_Renderer * renderer) return 0; } -static ID3D11RenderTargetView * -D3D11_GetCurrentRenderTargetView(SDL_Renderer * renderer) +static ID3D11RenderTargetView *D3D11_GetCurrentRenderTargetView(SDL_Renderer *renderer) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; if (data->currentOffscreenRenderTargetView) { return data->currentOffscreenRenderTargetView; - } - else { + } else { return data->mainRenderTargetView; } } -static int -D3D11_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, ID3D11PixelShader * shader, - const int numShaderResources, ID3D11ShaderResourceView ** shaderResources, - ID3D11SamplerState * sampler, const Float4X4 *matrix) +static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, ID3D11PixelShader *shader, + const int numShaderResources, ID3D11ShaderResourceView **shaderResources, + ID3D11SamplerState *sampler, const Float4X4 *matrix) { D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; @@ -1903,12 +1846,24 @@ D3D11_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, ID3D11 ID3D11BlendState *blendState = NULL; SDL_bool updateSubresource = SDL_FALSE; + if (numShaderResources > 0) { + shaderResource = shaderResources[0]; + } else { + shaderResource = NULL; + } + + /* Make sure the render target isn't bound to a shader */ + if (shaderResource != rendererData->currentShaderResource) { + ID3D11ShaderResourceView *pNullResource = NULL; + ID3D11DeviceContext_PSSetShaderResources(rendererData->d3dContext, 0, 1, &pNullResource); + rendererData->currentShaderResource = NULL; + } + if (renderTargetView != rendererData->currentRenderTargetView) { ID3D11DeviceContext_OMSetRenderTargets(rendererData->d3dContext, - 1, - &renderTargetView, - NULL - ); + 1, + &renderTargetView, + NULL); rendererData->currentRenderTargetView = renderTargetView; } @@ -1967,11 +1922,6 @@ D3D11_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, ID3D11 ID3D11DeviceContext_PSSetShader(rendererData->d3dContext, shader, NULL, 0); rendererData->currentShader = shader; } - if (numShaderResources > 0) { - shaderResource = shaderResources[0]; - } else { - shaderResource = NULL; - } if (shaderResource != rendererData->currentShaderResource) { ID3D11DeviceContext_PSSetShaderResources(rendererData->d3dContext, 0, numShaderResources, shaderResources); rendererData->currentShaderResource = shaderResource; @@ -1981,27 +1931,25 @@ D3D11_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, ID3D11 rendererData->currentSampler = sampler; } - if (updateSubresource == SDL_TRUE || SDL_memcmp(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof (*newmatrix)) != 0) { + if (updateSubresource == SDL_TRUE || SDL_memcmp(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof(*newmatrix)) != 0) { SDL_copyp(&rendererData->vertexShaderConstantsData.model, newmatrix); ID3D11DeviceContext_UpdateSubresource(rendererData->d3dContext, - (ID3D11Resource *)rendererData->vertexShaderConstants, - 0, - NULL, - &rendererData->vertexShaderConstantsData, - 0, - 0 - ); + (ID3D11Resource *)rendererData->vertexShaderConstants, + 0, + NULL, + &rendererData->vertexShaderConstantsData, + 0, + 0); } return 0; } -static int -D3D11_SetCopyState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) +static int D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) { SDL_Texture *texture = cmd->data.draw.texture; - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; ID3D11SamplerState *textureSampler; switch (textureData->scaleMode) { @@ -2063,25 +2011,22 @@ D3D11_SetCopyState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, const return D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[shader], SDL_arraysize(shaderResources), shaderResources, textureSampler, matrix); - } #endif /* SDL_HAVE_YUV */ return D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_RGB], 1, &textureData->mainTextureResourceView, textureSampler, matrix); } -static void -D3D11_DrawPrimitives(SDL_Renderer * renderer, D3D11_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) +static void D3D11_DrawPrimitives(SDL_Renderer *renderer, D3D11_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; ID3D11DeviceContext_IASetPrimitiveTopology(rendererData->d3dContext, primitiveTopology); - ID3D11DeviceContext_Draw(rendererData->d3dContext, (UINT) vertexCount, (UINT) vertexStart); + ID3D11DeviceContext_Draw(rendererData->d3dContext, (UINT)vertexCount, (UINT)vertexStart); } -static int -D3D11_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; const int viewportRotation = D3D11_GetRotationForCurrentRenderTarget(renderer); if (rendererData->currentViewportRotation != viewportRotation) { @@ -2095,92 +2040,100 @@ D3D11_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; /* this isn't currently used in this render backend. */ - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; /* this isn't currently used in this render backend. */ + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &rendererData->currentViewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - rendererData->viewportDirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &rendererData->currentViewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + rendererData->viewportDirty = SDL_TRUE; + rendererData->cliprectDirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (rendererData->currentCliprectEnabled != cmd->data.cliprect.enabled) { - rendererData->currentCliprectEnabled = cmd->data.cliprect.enabled; - rendererData->cliprectDirty = SDL_TRUE; - } - if (SDL_memcmp(&rendererData->currentCliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&rendererData->currentCliprect, rect); - rendererData->cliprectDirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + if (rendererData->currentCliprectEnabled != cmd->data.cliprect.enabled) { + rendererData->currentCliprectEnabled = cmd->data.cliprect.enabled; + rendererData->cliprectDirty = SDL_TRUE; } - - case SDL_RENDERCMD_CLEAR: { - const float colorRGBA[] = { - (cmd->data.color.r / 255.0f), - (cmd->data.color.g / 255.0f), - (cmd->data.color.b / 255.0f), - (cmd->data.color.a / 255.0f) - }; - ID3D11DeviceContext_ClearRenderTargetView(rendererData->d3dContext, D3D11_GetCurrentRenderTargetView(renderer), colorRGBA); - break; + if (SDL_memcmp(&rendererData->currentCliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&rendererData->currentCliprect, rect); + rendererData->cliprectDirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_DRAW_POINTS: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); - D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); - D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, start, count); - break; - } + case SDL_RENDERCMD_CLEAR: + { + const float colorRGBA[] = { + (cmd->data.color.r / 255.0f), + (cmd->data.color.g / 255.0f), + (cmd->data.color.b / 255.0f), + (cmd->data.color.a / 255.0f) + }; + ID3D11DeviceContext_ClearRenderTargetView(rendererData->d3dContext, D3D11_GetCurrentRenderTargetView(renderer), colorRGBA); + break; + } - case SDL_RENDERCMD_DRAW_LINES: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); - const VertexPositionColor *verts = (VertexPositionColor *) (((Uint8 *) vertices) + first); - D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); - D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count); - if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) { - D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, start + (count-1), 1); - } - break; - } + case SDL_RENDERCMD_DRAW_POINTS: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); + D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); + D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, start, count); + break; + } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + case SDL_RENDERCMD_DRAW_LINES: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); + const VertexPositionColor *verts = (VertexPositionColor *)(((Uint8 *)vertices) + first); + D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); + D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count); + if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) { + D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, start + (count - 1), 1); + } + break; + } - case SDL_RENDERCMD_COPY: /* unused */ - break; + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_COPY: /* unused */ + break; - case SDL_RENDERCMD_GEOMETRY: { - SDL_Texture *texture = cmd->data.draw.texture; - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - if (texture) { - D3D11_SetCopyState(renderer, cmd, NULL); - } else { - D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); - } + case SDL_RENDERCMD_GEOMETRY: + { + SDL_Texture *texture = cmd->data.draw.texture; + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); - D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, start, count); - break; + if (texture) { + D3D11_SetCopyState(renderer, cmd, NULL); + } else { + D3D11_SetDrawState(renderer, cmd, rendererData->pixelShaders[SHADER_SOLID], 0, NULL, NULL, NULL); } - case SDL_RENDERCMD_NO_OP: - break; + D3D11_DrawPrimitives(renderer, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, start, count); + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -2189,29 +2142,28 @@ D3D11_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver return 0; } -static int -D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +static int D3D11_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { - D3D11_RenderData * data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; ID3D11RenderTargetView *renderTargetView = NULL; ID3D11Texture2D *backBuffer = NULL; ID3D11Texture2D *stagingTexture = NULL; HRESULT result; int status = -1; D3D11_TEXTURE2D_DESC stagingTextureDesc; - D3D11_RECT srcRect = {0, 0, 0, 0}; + D3D11_RECT srcRect = { 0, 0, 0, 0 }; D3D11_BOX srcBox; D3D11_MAPPED_SUBRESOURCE textureMemory; - ID3D11DeviceContext_OMGetRenderTargets(data->d3dContext, 1, &renderTargetView, NULL); - if (renderTargetView == NULL) { + renderTargetView = D3D11_GetCurrentRenderTargetView(renderer); + if (!renderTargetView) { SDL_SetError("%s, ID3D11DeviceContext::OMGetRenderTargets failed", __FUNCTION__); goto done; } - ID3D11View_GetResource(renderTargetView, (ID3D11Resource**)&backBuffer); - if (backBuffer == NULL) { + ID3D11View_GetResource(renderTargetView, (ID3D11Resource **)&backBuffer); + if (!backBuffer) { SDL_SetError("%s, ID3D11View::GetResource failed", __FUNCTION__); goto done; } @@ -2225,9 +2177,9 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, stagingTextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; stagingTextureDesc.Usage = D3D11_USAGE_STAGING; result = ID3D11Device_CreateTexture2D(data->d3dDevice, - &stagingTextureDesc, - NULL, - &stagingTexture); + &stagingTextureDesc, + NULL, + &stagingTexture); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D [create staging texture]"), result); goto done; @@ -2246,20 +2198,20 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, srcBox.front = 0; srcBox.back = 1; ID3D11DeviceContext_CopySubresourceRegion(data->d3dContext, - (ID3D11Resource *)stagingTexture, - 0, - 0, 0, 0, - (ID3D11Resource *)backBuffer, - 0, - &srcBox); + (ID3D11Resource *)stagingTexture, + 0, + 0, 0, 0, + (ID3D11Resource *)backBuffer, + 0, + &srcBox); /* Map the staging texture's data to CPU-accessible memory: */ result = ID3D11DeviceContext_Map(data->d3dContext, - (ID3D11Resource *)stagingTexture, - 0, - D3D11_MAP_READ, - 0, - &textureMemory); + (ID3D11Resource *)stagingTexture, + 0, + D3D11_MAP_READ, + 0, + &textureMemory); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11DeviceContext1::Map [map staging texture]"), result); goto done; @@ -2279,8 +2231,8 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, /* Unmap the texture: */ ID3D11DeviceContext_Unmap(data->d3dContext, - (ID3D11Resource *)stagingTexture, - 0); + (ID3D11Resource *)stagingTexture, + 0); done: SAFE_RELEASE(backBuffer); @@ -2288,10 +2240,9 @@ D3D11_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -D3D11_RenderPresent(SDL_Renderer * renderer) +static int D3D11_RenderPresent(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; UINT syncInterval; UINT presentFlags; HRESULT result; @@ -2299,7 +2250,7 @@ D3D11_RenderPresent(SDL_Renderer * renderer) SDL_zero(parameters); -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE syncInterval = 1; presentFlags = 0; result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags); @@ -2323,13 +2274,13 @@ D3D11_RenderPresent(SDL_Renderer * renderer) * This is a valid operation only when the existing contents will be entirely * overwritten. If dirty or scroll rects are used, this call should be removed. */ - ID3D11DeviceContext1_DiscardView(data->d3dContext, (ID3D11View*)data->mainRenderTargetView); + ID3D11DeviceContext1_DiscardView(data->d3dContext, (ID3D11View *)data->mainRenderTargetView); /* When the present flips, it unbinds the current view, so bind it again on the next draw call */ data->currentRenderTargetView = NULL; if (FAILED(result) && result != DXGI_ERROR_WAS_STILL_DRAWING) { - /* If the device was removed either by a disconnect or a driver upgrade, we + /* If the device was removed either by a disconnect or a driver upgrade, we * must recreate all device resources. * * TODO, WinRT: consider throwing an exception if D3D11_RenderPresent fails, especially if there is a way to salvage debug info from users' machines @@ -2347,11 +2298,10 @@ D3D11_RenderPresent(SDL_Renderer * renderer) return 0; } -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP - /* no-op. */ +#if SDL_WINAPI_FAMILY_PHONE +/* no-op. */ #else -static int -D3D11_SetVSync(SDL_Renderer * renderer, const int vsync) +static int D3D11_SetVSync(SDL_Renderer *renderer, const int vsync) { if (vsync) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; @@ -2362,23 +2312,13 @@ D3D11_SetVSync(SDL_Renderer * renderer, const int vsync) } #endif -SDL_Renderer * -D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) +int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; D3D11_RenderData *data; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (D3D11_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (D3D11_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { - SDL_free(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } data->identity = MatrixIdentity(); @@ -2399,9 +2339,9 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = D3D11_SetTextureScaleMode; renderer->SetRenderTarget = D3D11_SetRenderTarget; renderer->QueueSetViewport = D3D11_QueueSetViewport; - renderer->QueueSetDrawColor = D3D11_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = D3D11_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = D3D11_QueueDrawPoints; - renderer->QueueDrawLines = D3D11_QueueDrawPoints; /* lines and points queue vertices the same way. */ + renderer->QueueDrawLines = D3D11_QueueDrawPoints; /* lines and points queue vertices the same way. */ renderer->QueueGeometry = D3D11_QueueGeometry; renderer->RunCommandQueue = D3D11_RunCommandQueue; renderer->RenderReadPixels = D3D11_RenderReadPixels; @@ -2412,7 +2352,7 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); renderer->driverdata = data; -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE /* VSync is required in Windows Phone, at least for Win Phone 8.0 and 8.1. * Failure to use it seems to either result in: * @@ -2421,12 +2361,12 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) * * - with the D3D11 debug runtime turned ON, vsync gets automatically * turned back on, and the following gets output to the debug console: - * - * DXGI ERROR: IDXGISwapChain::Present: Interval 0 is not supported, changed to Interval 1. [ UNKNOWN ERROR #1024: ] + * + * DXGI ERROR: IDXGISwapChain::Present: Interval 0 is not supported, changed to Interval 1. [ UNKNOWN ERROR #1024: ] */ renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; #else - if ((flags & SDL_RENDERER_PRESENTVSYNC)) { + if (flags & SDL_RENDERER_PRESENTVSYNC) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } renderer->SetVSync = D3D11_SetVSync; @@ -2440,14 +2380,14 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) /* Initialize Direct3D resources */ if (FAILED(D3D11_CreateDeviceResources(renderer))) { D3D11_DestroyRenderer(renderer); - return NULL; + return -1; } if (FAILED(D3D11_CreateWindowSizeDependentResources(renderer))) { D3D11_DestroyRenderer(renderer); - return NULL; + return -1; } - return renderer; + return 0; } SDL_RenderDriver D3D11_RenderDriver = { @@ -2457,33 +2397,30 @@ SDL_RenderDriver D3D11_RenderDriver = { ( SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | - SDL_RENDERER_TARGETTEXTURE - ), /* flags. see SDL_RendererFlags */ - 6, /* num_texture_formats */ - { /* texture_formats */ - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_YV12, - SDL_PIXELFORMAT_IYUV, - SDL_PIXELFORMAT_NV12, - SDL_PIXELFORMAT_NV21 - }, - 0, /* max_texture_width: will be filled in later */ - 0 /* max_texture_height: will be filled in later */ + SDL_RENDERER_TARGETTEXTURE), /* flags. see SDL_RendererFlags */ + 6, /* num_texture_formats */ + { /* texture_formats */ + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_YV12, + SDL_PIXELFORMAT_IYUV, + SDL_PIXELFORMAT_NV12, + SDL_PIXELFORMAT_NV21 }, + 0, /* max_texture_width: will be filled in later */ + 0 /* max_texture_height: will be filled in later */ } }; -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D11 */ #if defined(__WIN32__) || defined(__WINGDK__) /* This function needs to always exist on Windows, for the Dynamic API. */ -ID3D11Device * -SDL_RenderGetD3D11Device(SDL_Renderer * renderer) +ID3D11Device *SDL_RenderGetD3D11Device(SDL_Renderer *renderer) { ID3D11Device *device = NULL; -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED - D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata; +#if SDL_VIDEO_RENDER_D3D11 + D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; /* Make sure that this is a D3D renderer */ if (renderer->DestroyRenderer != D3D11_DestroyRenderer) { @@ -2495,7 +2432,7 @@ SDL_RenderGetD3D11Device(SDL_Renderer * renderer) if (device) { ID3D11Device_AddRef(device); } -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D11 */ return device; } diff --git a/src/render/direct3d11/SDL_render_winrt.cpp b/src/render/direct3d11/SDL_render_winrt.cpp index 9784c32c40bee..6ff295c0f9cfb 100644 --- a/src/render/direct3d11/SDL_render_winrt.cpp +++ b/src/render/direct3d11/SDL_render_winrt.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 #include "SDL_syswm.h" #include "../../video/winrt/SDL_winrtvideo_cpp.h" @@ -42,12 +42,11 @@ using namespace Windows::Graphics::Display; #include "SDL_render_winrt.h" - extern "C" void * -D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer) +D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer) { - SDL_Window * sdlWindow = renderer->window; - if ( ! renderer->window ) { + SDL_Window *sdlWindow = renderer->window; + if (!renderer->window) { return NULL; } @@ -84,7 +83,7 @@ D3D11_GetCurrentRotation() switch (currentOrientation) { -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE /* Windows Phone rotations */ case DisplayOrientations::Landscape: return DXGI_MODE_ROTATION_ROTATE90; @@ -104,13 +103,12 @@ D3D11_GetCurrentRotation() return DXGI_MODE_ROTATION_ROTATE180; case DisplayOrientations::PortraitFlipped: return DXGI_MODE_ROTATION_ROTATE90; -#endif /* WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP */ +#endif /* SDL_WINAPI_FAMILY_PHONE */ } return DXGI_MODE_ROTATION_IDENTITY; } - -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D11 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d11/SDL_render_winrt.h b/src/render/direct3d11/SDL_render_winrt.h index 97d27cb276369..a19b9e6f10762 100644 --- a/src/render/direct3d11/SDL_render_winrt.h +++ b/src/render/direct3d11/SDL_render_winrt.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 #include "SDL_render.h" @@ -28,13 +28,13 @@ extern "C" { #endif -void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer); +void *D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer); DXGI_MODE_ROTATION D3D11_GetCurrentRotation(); #ifdef __cplusplus } #endif -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D11 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d11/SDL_shaders_d3d11.c b/src/render/direct3d11/SDL_shaders_d3d11.c index 3a6807b5fbfe7..45c9be85113e9 100644 --- a/src/render/direct3d11/SDL_shaders_d3d11.c +++ b/src/render/direct3d11/SDL_shaders_d3d11.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D11 #include "SDL_stdinc.h" @@ -32,7 +32,6 @@ #define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str - /* Direct3D 11.x shaders SDL's shaders are compiled into SDL itself, to simplify distribution. @@ -52,14 +51,14 @@ - vs_4_0_level_9_1: Vertex shader for Windows 8+, including Windows RT - ps_4_0_level_9_3: Pixel shader for Windows Phone 8 - vs_4_0_level_9_3: Vertex shader for Windows Phone 8 - + Shader object code was converted to a list of DWORDs via the following *nix style command (available separately from Windows + MSVC): hexdump -v -e '6/4 "0x%08.8x, " "\n"' */ -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE #define D3D11_USE_SHADER_MODEL_4_0_level_9_3 #else #define D3D11_USE_SHADER_MODEL_4_0_level_9_1 @@ -1905,8 +1904,7 @@ static struct int D3D11_CreateVertexShader(ID3D11Device1 *d3dDevice, ID3D11VertexShader **vertexShader, ID3D11InputLayout **inputLayout) { /* Declare how the input layout for SDL's vertex shader will be setup: */ - const D3D11_INPUT_ELEMENT_DESC vertexDesc[] = - { + const D3D11_INPUT_ELEMENT_DESC vertexDesc[] = { { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0 }, @@ -1915,23 +1913,21 @@ int D3D11_CreateVertexShader(ID3D11Device1 *d3dDevice, ID3D11VertexShader **vert /* Load in SDL's one and only vertex shader: */ result = ID3D11Device_CreateVertexShader(d3dDevice, - D3D11_VertexShader, - sizeof(D3D11_VertexShader), - NULL, - vertexShader - ); + D3D11_VertexShader, + sizeof(D3D11_VertexShader), + NULL, + vertexShader); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateVertexShader"), result); } /* Create an input layout for SDL's vertex shader: */ result = ID3D11Device_CreateInputLayout(d3dDevice, - vertexDesc, - ARRAYSIZE(vertexDesc), - D3D11_VertexShader, - sizeof(D3D11_VertexShader), - inputLayout - ); + vertexDesc, + ARRAYSIZE(vertexDesc), + D3D11_VertexShader, + sizeof(D3D11_VertexShader), + inputLayout); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateInputLayout"), result); } @@ -1943,17 +1939,16 @@ int D3D11_CreatePixelShader(ID3D11Device1 *d3dDevice, D3D11_Shader shader, ID3D1 HRESULT result; result = ID3D11Device_CreatePixelShader(d3dDevice, - D3D11_shaders[shader].shader_data, - D3D11_shaders[shader].shader_size, - NULL, - pixelShader - ); + D3D11_shaders[shader].shader_data, + D3D11_shaders[shader].shader_size, + NULL, + pixelShader); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreatePixelShader"), result); } return 0; } -#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D11 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d11/SDL_shaders_d3d11.h b/src/render/direct3d11/SDL_shaders_d3d11.h index d877c0906dbcc..597ff9bb7ab42 100644 --- a/src/render/direct3d11/SDL_shaders_d3d11.h +++ b/src/render/direct3d11/SDL_shaders_d3d11.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,8 @@ /* D3D11 shader implementation */ -typedef enum { +typedef enum +{ SHADER_SOLID, SHADER_RGB, #if SDL_HAVE_YUV diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 79cf30ef06e43..e97189a002614 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,11 +23,11 @@ #include "SDL_render.h" #include "SDL_system.h" -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_D3D12 -#define SDL_D3D12_NUM_BUFFERS 2 +#define SDL_D3D12_NUM_BUFFERS 2 #define SDL_D3D12_NUM_VERTEX_BUFFERS 256 -#define SDL_D3D12_MAX_NUM_TEXTURES 16384 +#define SDL_D3D12_MAX_NUM_TEXTURES 16384 #define SDL_D3D12_NUM_UPLOAD_BUFFERS 32 #include "../../core/windows/SDL_windows.h" @@ -48,6 +48,7 @@ #include #include #include +#include #endif #include "SDL_shaders_d3d12.h" @@ -58,16 +59,77 @@ #define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str #endif +/* DXGI_PRESENT flags are removed on Xbox */ +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) +#define DXGI_PRESENT_ALLOW_TEARING 0 +#endif + #ifdef __cplusplus -#define SAFE_RELEASE(X) if (X) { (X)->Release(); X = NULL; } -#define D3D_CALL(THIS, FUNC, ...) (THIS)->FUNC(__VA_ARGS__) +#define SAFE_RELEASE(X) \ + if (X) { \ + (X)->Release(); \ + X = NULL; \ + } +#define D3D_CALL(THIS, FUNC, ...) (THIS)->FUNC(__VA_ARGS__) #define D3D_CALL_RET(THIS, FUNC, RETVAL, ...) *(RETVAL) = (THIS)->FUNC(__VA_ARGS__) -#define D3D_GUID(X) (X) +#define D3D_GUID(X) (X) #else -#define SAFE_RELEASE(X) if (X) { (X)->lpVtbl->Release(X); X = NULL; } -#define D3D_CALL(THIS, FUNC, ...) (THIS)->lpVtbl->FUNC((THIS), ##__VA_ARGS__) +#define SAFE_RELEASE(X) \ + if (X) { \ + (X)->lpVtbl->Release(X); \ + X = NULL; \ + } +#define D3D_CALL(THIS, FUNC, ...) (THIS)->lpVtbl->FUNC((THIS), ##__VA_ARGS__) #define D3D_CALL_RET(THIS, FUNC, ...) (THIS)->lpVtbl->FUNC((THIS), ##__VA_ARGS__) -#define D3D_GUID(X) &(X) +#define D3D_GUID(X) &(X) +#endif + +/* + * Older MS Windows SDK headers declare some d3d12 functions with the wrong function prototype. + * - ID3D12Heap::GetDesc + * - ID3D12Resource::GetDesc + * - ID3D12DescriptorHeap::GetDesc + * (and 9 more)+ + * This is fixed in SDKs since WDK_NTDDI_VERSION >= NTDDI_WIN10_FE (0x0A00000A) + */ + +#if !(defined(__MINGW32__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)) \ + && (WDK_NTDDI_VERSION < 0x0A00000A) + +#define D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(THIS, ...) do { \ + void (STDMETHODCALLTYPE * func)(ID3D12DescriptorHeap * This, D3D12_CPU_DESCRIPTOR_HANDLE * Handle) = \ + (void*)(THIS)->lpVtbl->GetCPUDescriptorHandleForHeapStart; \ + func((THIS), ##__VA_ARGS__); \ + } while (0) + +#define D3D_CALL_RET_ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(THIS, ...) do { \ + void (STDMETHODCALLTYPE * func)(ID3D12DescriptorHeap * This, D3D12_GPU_DESCRIPTOR_HANDLE * Handle) = \ + (void*)(THIS)->lpVtbl->GetGPUDescriptorHandleForHeapStart; \ + func((THIS), ##__VA_ARGS__); \ + } while (0) + +#define D3D_CALL_RET_ID3D12Resource_GetDesc(THIS, ...) do { \ + void (STDMETHODCALLTYPE * func)(ID3D12Resource * This, D3D12_RESOURCE_DESC * Desc) = \ + (void*)(THIS)->lpVtbl->GetDesc; \ + func((THIS), ##__VA_ARGS__); \ + } while (0) + +#else + +/* + * MinGW has correct function prototypes in the vtables, but defines wrong functions + * Xbox just needs these macros defined as used below (because CINTERFACE doesn't exist) + */ + +#define D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(THIS, ...) \ + D3D_CALL_RET(THIS, GetCPUDescriptorHandleForHeapStart, ##__VA_ARGS__); + +#define D3D_CALL_RET_ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(THIS, ...) \ + D3D_CALL_RET(THIS, GetGPUDescriptorHandleForHeapStart, ##__VA_ARGS__); + +#define D3D_CALL_RET_ID3D12Resource_GetDesc(THIS, ...) \ + D3D_CALL_RET(THIS, GetDesc, ##__VA_ARGS__); + #endif /* Set up for C function definitions, even when using C++ */ @@ -141,7 +203,7 @@ typedef struct } D3D12_PipelineState; /* Vertex Buffer */ -typedef struct +typedef struct { ID3D12Resource *resource; D3D12_VERTEX_BUFFER_VIEW view; @@ -176,12 +238,12 @@ typedef struct UINT swapFlags; /* Descriptor heaps */ - ID3D12DescriptorHeap* rtvDescriptorHeap; + ID3D12DescriptorHeap *rtvDescriptorHeap; UINT rtvDescriptorSize; - ID3D12DescriptorHeap* textureRTVDescriptorHeap; - ID3D12DescriptorHeap* srvDescriptorHeap; + ID3D12DescriptorHeap *textureRTVDescriptorHeap; + ID3D12DescriptorHeap *srvDescriptorHeap; UINT srvDescriptorSize; - ID3D12DescriptorHeap* samplerDescriptorHeap; + ID3D12DescriptorHeap *samplerDescriptorHeap; UINT samplerDescriptorSize; /* Data needed per backbuffer */ @@ -189,7 +251,7 @@ typedef struct ID3D12Resource *renderTargets[SDL_D3D12_NUM_BUFFERS]; UINT64 fenceValue; int currentBackBufferIndex; - + /* Fences */ ID3D12Fence *fence; HANDLE fenceEvent; @@ -214,10 +276,10 @@ typedef struct /* Vertex buffer constants */ VertexShaderConstants vertexShaderConstantsData; - + /* Cached renderer properties */ DXGI_MODE_ROTATION rotation; - D3D12_TextureData* textureRenderTarget; + D3D12_TextureData *textureRenderTarget; D3D12_CPU_DESCRIPTOR_HANDLE currentRenderTargetView; D3D12_CPU_DESCRIPTOR_HANDLE currentShaderResource; D3D12_CPU_DESCRIPTOR_HANDLE currentSampler; @@ -232,7 +294,6 @@ typedef struct SDL_bool issueBatch; } D3D12_RenderData; - /* Define D3D GUIDs here so we don't have to include uuid.lib. */ #if defined(__GNUC__) || defined(__clang__) @@ -246,7 +307,7 @@ static const GUID SDL_IID_IDXGIDevice1 = { 0x77db970f, 0x6276, 0x48ba, { 0xba, 0 static const GUID SDL_IID_ID3D12Device1 = { 0x77acce80, 0x638e, 0x4e65, { 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e } }; static const GUID SDL_IID_IDXGISwapChain4 = { 0x3D585D5A, 0xBD4A, 0x489E, { 0xB1, 0xF4, 0x3D, 0xBC, 0xB6, 0x45, 0x2F, 0xFB } }; static const GUID SDL_IID_IDXGIDebug1 = { 0xc5a05f0c, 0x16f2, 0x4adf, { 0x9f, 0x4d, 0xa8, 0xc4, 0xd5, 0x8a, 0xc5, 0x50 } }; -static const GUID SDL_IID_IDXGIInfoQueue = { 0xD67441C7,0x672A,0x476f, { 0x9E,0x82,0xCD,0x55,0xB4,0x49,0x49,0xCE } }; +static const GUID SDL_IID_IDXGIInfoQueue = { 0xD67441C7, 0x672A, 0x476f, { 0x9E, 0x82, 0xCD, 0x55, 0xB4, 0x49, 0x49, 0xCE } }; static const GUID SDL_IID_ID3D12Debug = { 0x344488b7, 0x6846, 0x474b, { 0xb9, 0x89, 0xf0, 0x27, 0x44, 0x82, 0x45, 0xe0 } }; static const GUID SDL_DXGI_DEBUG_ALL = { 0xe48ae283, 0xda80, 0x490b, { 0x87, 0xe6, 0x43, 0xe9, 0xa9, 0xcf, 0xda, 0x8 } }; static const GUID SDL_IID_ID3D12CommandQueue = { 0x0ec870a6, 0x5d7e, 0x4c22, { 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed } }; @@ -264,50 +325,45 @@ static const GUID SDL_IID_ID3D12InfoQueue = { 0x0742a90b, 0xc387, 0x483f, { 0xb9 #pragma GCC diagnostic pop #endif - -UINT -D3D12_Align(UINT location, UINT alignment) +UINT D3D12_Align(UINT location, UINT alignment) { - return ((location + (alignment - 1)) & ~(alignment - 1)); + return (location + (alignment - 1)) & ~(alignment - 1); } -Uint32 -D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) +Uint32 D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { switch (dxgiFormat) { - case DXGI_FORMAT_B8G8R8A8_UNORM: - return SDL_PIXELFORMAT_ARGB8888; - case DXGI_FORMAT_B8G8R8X8_UNORM: - return SDL_PIXELFORMAT_RGB888; - default: - return SDL_PIXELFORMAT_UNKNOWN; + case DXGI_FORMAT_B8G8R8A8_UNORM: + return SDL_PIXELFORMAT_ARGB8888; + case DXGI_FORMAT_B8G8R8X8_UNORM: + return SDL_PIXELFORMAT_RGB888; + default: + return SDL_PIXELFORMAT_UNKNOWN; } } -static DXGI_FORMAT -SDLPixelFormatToDXGIFormat(Uint32 sdlFormat) +static DXGI_FORMAT SDLPixelFormatToDXGIFormat(Uint32 sdlFormat) { switch (sdlFormat) { - case SDL_PIXELFORMAT_ARGB8888: - return DXGI_FORMAT_B8G8R8A8_UNORM; - case SDL_PIXELFORMAT_RGB888: - return DXGI_FORMAT_B8G8R8X8_UNORM; - case SDL_PIXELFORMAT_YV12: - case SDL_PIXELFORMAT_IYUV: - case SDL_PIXELFORMAT_NV12: /* For the Y texture */ - case SDL_PIXELFORMAT_NV21: /* For the Y texture */ - return DXGI_FORMAT_R8_UNORM; - default: - return DXGI_FORMAT_UNKNOWN; + case SDL_PIXELFORMAT_ARGB8888: + return DXGI_FORMAT_B8G8R8A8_UNORM; + case SDL_PIXELFORMAT_RGB888: + return DXGI_FORMAT_B8G8R8X8_UNORM; + case SDL_PIXELFORMAT_YV12: + case SDL_PIXELFORMAT_IYUV: + case SDL_PIXELFORMAT_NV12: /* For the Y texture */ + case SDL_PIXELFORMAT_NV21: /* For the Y texture */ + return DXGI_FORMAT_R8_UNORM; + default: + return DXGI_FORMAT_UNKNOWN; } } -static void D3D12_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture); +static void D3D12_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); -static void -D3D12_ReleaseAll(SDL_Renderer * renderer) +static void D3D12_ReleaseAll(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; SDL_Texture *texture = NULL; /* Release all textures */ @@ -355,8 +411,8 @@ D3D12_ReleaseAll(SDL_Renderer * renderer) SAFE_RELEASE(data->vertexBuffers[i].resource); data->vertexBuffers[i].size = 0; } - - data->swapEffect = (DXGI_SWAP_EFFECT) 0; + + data->swapEffect = (DXGI_SWAP_EFFECT)0; data->swapFlags = 0; data->currentRenderTargetView.ptr = 0; data->currentSampler.ptr = 0; @@ -384,34 +440,30 @@ D3D12_ReleaseAll(SDL_Renderer * renderer) } } -static D3D12_GPU_DESCRIPTOR_HANDLE -D3D12_CPUtoGPUHandle(ID3D12DescriptorHeap * heap, D3D12_CPU_DESCRIPTOR_HANDLE CPUHandle) +static D3D12_GPU_DESCRIPTOR_HANDLE D3D12_CPUtoGPUHandle(ID3D12DescriptorHeap *heap, D3D12_CPU_DESCRIPTOR_HANDLE CPUHandle) { D3D12_CPU_DESCRIPTOR_HANDLE CPUHeapStart; D3D12_GPU_DESCRIPTOR_HANDLE GPUHandle; SIZE_T offset; - + /* Calculate the correct offset into the heap */ - D3D_CALL_RET(heap, GetCPUDescriptorHandleForHeapStart, &CPUHeapStart); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap, &CPUHeapStart); offset = CPUHandle.ptr - CPUHeapStart.ptr; - - D3D_CALL_RET(heap, GetGPUDescriptorHandleForHeapStart, &GPUHandle); + + D3D_CALL_RET_ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap, &GPUHandle); GPUHandle.ptr += offset; return GPUHandle; } -static void -D3D12_WaitForGPU(D3D12_RenderData * data) +static void D3D12_WaitForGPU(D3D12_RenderData *data) { - if (data->commandQueue && data->fence && data->fenceEvent) - { + if (data->commandQueue && data->fence && data->fenceEvent) { D3D_CALL(data->commandQueue, Signal, data->fence, data->fenceValue); if (D3D_CALL(data->fence, GetCompletedValue) < data->fenceValue) { D3D_CALL(data->fence, SetEventOnCompletion, - data->fenceValue, - data->fenceEvent - ); + data->fenceValue, + data->fenceEvent); WaitForSingleObjectEx(data->fenceEvent, INFINITE, FALSE); } @@ -419,10 +471,9 @@ D3D12_WaitForGPU(D3D12_RenderData * data) } } -static D3D12_CPU_DESCRIPTOR_HANDLE -D3D12_GetCurrentRenderTargetView(SDL_Renderer * renderer) +static D3D12_CPU_DESCRIPTOR_HANDLE D3D12_GetCurrentRenderTargetView(SDL_Renderer *renderer) { - D3D12_RenderData* data = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor; if (data->textureRenderTarget) { @@ -430,17 +481,15 @@ D3D12_GetCurrentRenderTargetView(SDL_Renderer * renderer) } SDL_zero(rtvDescriptor); - D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &rtvDescriptor); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(data->rtvDescriptorHeap, &rtvDescriptor); rtvDescriptor.ptr += data->currentBackBufferIndex * data->rtvDescriptorSize; return rtvDescriptor; } -static void -D3D12_TransitionResource(D3D12_RenderData * data, - ID3D12Resource * resource, - D3D12_RESOURCE_STATES beforeState, - D3D12_RESOURCE_STATES afterState -) +static void D3D12_TransitionResource(D3D12_RenderData *data, + ID3D12Resource *resource, + D3D12_RESOURCE_STATES beforeState, + D3D12_RESOURCE_STATES afterState) { D3D12_RESOURCE_BARRIER barrier; @@ -456,8 +505,7 @@ D3D12_TransitionResource(D3D12_RenderData * data, } } -static void -D3D12_ResetCommandList(D3D12_RenderData * data) +static void D3D12_ResetCommandList(D3D12_RenderData *data) { int i; ID3D12DescriptorHeap *rootDescriptorHeaps[] = { data->srvDescriptorHeap, data->samplerDescriptorHeap }; @@ -481,8 +529,7 @@ D3D12_ResetCommandList(D3D12_RenderData * data) D3D_CALL(data->commandList, SetDescriptorHeaps, 2, rootDescriptorHeaps); } -static int -D3D12_IssueBatch(D3D12_RenderData * data) +static int D3D12_IssueBatch(D3D12_RenderData *data) { HRESULT result = S_OK; @@ -492,36 +539,32 @@ D3D12_IssueBatch(D3D12_RenderData * data) WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12_IssueBatch"), result); return result; } - D3D_CALL(data->commandQueue, ExecuteCommandLists, 1, (ID3D12CommandList* const*)&data->commandList); + D3D_CALL(data->commandQueue, ExecuteCommandLists, 1, (ID3D12CommandList *const *)&data->commandList); D3D12_WaitForGPU(data); - + D3D12_ResetCommandList(data); return result; } -static void -D3D12_DestroyRenderer(SDL_Renderer * renderer) +static void D3D12_DestroyRenderer(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; D3D12_WaitForGPU(data); D3D12_ReleaseAll(renderer); if (data) { SDL_free(data); } - SDL_free(renderer); } -static int -D3D12_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) +static int D3D12_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GetWindowSizeInPixels(renderer->window, w, h); return 0; } -static D3D12_BLEND -GetBlendFunc(SDL_BlendFactor factor) +static D3D12_BLEND GetBlendFunc(SDL_BlendFactor factor) { switch (factor) { case SDL_BLENDFACTOR_ZERO: @@ -549,8 +592,7 @@ GetBlendFunc(SDL_BlendFactor factor) } } -static D3D12_BLEND_OP -GetBlendEquation(SDL_BlendOperation operation) +static D3D12_BLEND_OP GetBlendEquation(SDL_BlendOperation operation) { switch (operation) { case SDL_BLENDOPERATION_ADD: @@ -568,8 +610,7 @@ GetBlendEquation(SDL_BlendOperation operation) } } -static void -D3D12_CreateBlendState(SDL_Renderer * renderer, SDL_BlendMode blendMode, D3D12_BLEND_DESC * outBlendDesc) +static void D3D12_CreateBlendState(SDL_Renderer *renderer, SDL_BlendMode blendMode, D3D12_BLEND_DESC *outBlendDesc) { SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -591,23 +632,21 @@ D3D12_CreateBlendState(SDL_Renderer * renderer, SDL_BlendMode blendMode, D3D12_B outBlendDesc->RenderTarget[0].RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL; } -static D3D12_PipelineState * -D3D12_CreatePipelineState(SDL_Renderer * renderer, - D3D12_Shader shader, - SDL_BlendMode blendMode, - D3D12_PRIMITIVE_TOPOLOGY_TYPE topology, - DXGI_FORMAT rtvFormat - ) +static D3D12_PipelineState *D3D12_CreatePipelineState(SDL_Renderer *renderer, + D3D12_Shader shader, + SDL_BlendMode blendMode, + D3D12_PRIMITIVE_TOPOLOGY_TYPE topology, + DXGI_FORMAT rtvFormat) { const D3D12_INPUT_ELEMENT_DESC vertexDesc[] = { { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 16, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, }; - D3D12_RenderData* data = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; D3D12_GRAPHICS_PIPELINE_STATE_DESC pipelineDesc; - ID3D12PipelineState* pipelineState = NULL; - D3D12_PipelineState* pipelineStates; + ID3D12PipelineState *pipelineState = NULL; + D3D12_PipelineState *pipelineStates; HRESULT result = S_OK; SDL_zero(pipelineDesc); @@ -638,16 +677,15 @@ D3D12_CreatePipelineState(SDL_Renderer * renderer, pipelineDesc.SampleDesc.Quality = 0; result = D3D_CALL(data->d3dDevice, CreateGraphicsPipelineState, - &pipelineDesc, - D3D_GUID(SDL_IID_ID3D12PipelineState), - (void **)&pipelineState - ); + &pipelineDesc, + D3D_GUID(SDL_IID_ID3D12PipelineState), + (void **)&pipelineState); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateGraphicsPipelineState"), result); return NULL; } - pipelineStates = (D3D12_PipelineState*)SDL_realloc(data->pipelineStates, (data->pipelineStateCount + 1) * sizeof(*pipelineStates)); + pipelineStates = (D3D12_PipelineState *)SDL_realloc(data->pipelineStates, (data->pipelineStateCount + 1) * sizeof(*pipelineStates)); if (!pipelineStates) { SAFE_RELEASE(pipelineState); SDL_OutOfMemory(); @@ -665,8 +703,7 @@ D3D12_CreatePipelineState(SDL_Renderer * renderer, return &pipelineStates[data->pipelineStateCount - 1]; } -static HRESULT -D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, size_t size) +static HRESULT D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, size_t size) { D3D12_HEAP_PROPERTIES vbufferHeapProps; D3D12_RESOURCE_DESC vbufferDesc; @@ -693,14 +730,13 @@ D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, size_t size) vbufferDesc.Flags = D3D12_RESOURCE_FLAG_NONE; result = D3D_CALL(data->d3dDevice, CreateCommittedResource, - &vbufferHeapProps, - D3D12_HEAP_FLAG_NONE, - &vbufferDesc, - D3D12_RESOURCE_STATE_GENERIC_READ, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **) &data->vertexBuffers[vbidx].resource - ); + &vbufferHeapProps, + D3D12_HEAP_FLAG_NONE, + &vbufferDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&data->vertexBuffers[vbidx].resource); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreatePlacedResource [vertex buffer]"), result); @@ -715,19 +751,18 @@ D3D12_CreateVertexBuffer(D3D12_RenderData *data, size_t vbidx, size_t size) } /* Create resources that depend on the device. */ -static HRESULT -D3D12_CreateDeviceResources(SDL_Renderer* renderer) +static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - typedef HRESULT(WINAPI* PFN_CREATE_DXGI_FACTORY)(UINT flags, REFIID riid, void** ppFactory); + typedef HRESULT(WINAPI * PFN_CREATE_DXGI_FACTORY)(UINT flags, REFIID riid, void **ppFactory); PFN_CREATE_DXGI_FACTORY CreateDXGIFactoryFunc; PFN_D3D12_CREATE_DEVICE D3D12CreateDeviceFunc; #endif - typedef HANDLE(WINAPI* PFN_CREATE_EVENT_EX)(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess); + typedef HANDLE(WINAPI * PFN_CREATE_EVENT_EX)(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess); PFN_CREATE_EVENT_EX CreateEventExFunc; - D3D12_RenderData* data = (D3D12_RenderData*)renderer->driverdata; - ID3D12Device* d3dDevice = NULL; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + ID3D12Device *d3dDevice = NULL; HRESULT result = S_OK; UINT creationFlags = 0; int i, j, k, l; @@ -762,7 +797,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); CreateEventExFunc = NULL; if (kernel32) { - CreateEventExFunc = (PFN_CREATE_EVENT_EX) GetProcAddress(kernel32, "CreateEventExW"); + CreateEventExFunc = (PFN_CREATE_EVENT_EX)GetProcAddress(kernel32, "CreateEventExW"); } } #endif @@ -804,7 +839,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) result = E_FAIL; goto done; } - D3D12GetDebugInterfaceFunc(D3D_GUID(SDL_IID_ID3D12Debug), (void**)&data->debugInterface); + D3D12GetDebugInterfaceFunc(D3D_GUID(SDL_IID_ID3D12Debug), (void **)&data->debugInterface); D3D_CALL(data->debugInterface, EnableDebugLayer); } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ @@ -847,7 +882,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) creationFlags = DXGI_CREATE_FACTORY_DEBUG; } - result = CreateDXGIFactoryFunc(creationFlags, D3D_GUID(SDL_IID_IDXGIFactory6), (void**)&data->dxgiFactory); + result = CreateDXGIFactoryFunc(creationFlags, D3D_GUID(SDL_IID_IDXGIFactory6), (void **)&data->dxgiFactory); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("CreateDXGIFactory"), result); goto done; @@ -855,21 +890,19 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* Prefer a high performance adapter if there are multiple choices */ result = D3D_CALL(data->dxgiFactory, EnumAdapterByGpuPreference, - 0, - DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, - D3D_GUID(SDL_IID_IDXGIAdapter4), - (void **)&data->dxgiAdapter - ); + 0, + DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, + D3D_GUID(SDL_IID_IDXGIAdapter4), + (void **)&data->dxgiAdapter); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12CreateDevice"), result); goto done; } - + result = D3D12CreateDeviceFunc((IUnknown *)data->dxgiAdapter, - D3D_FEATURE_LEVEL_11_0, /* Request minimum feature level 11.0 for maximum compatibility */ - D3D_GUID(SDL_IID_ID3D12Device1), - (void **)&d3dDevice - ); + D3D_FEATURE_LEVEL_11_0, /* Request minimum feature level 11.0 for maximum compatibility */ + D3D_GUID(SDL_IID_ID3D12Device1), + (void **)&d3dDevice); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12CreateDevice"), result); goto done; @@ -911,10 +944,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT; result = D3D_CALL(data->d3dDevice, CreateCommandQueue, - &queueDesc, - D3D_GUID(SDL_IID_ID3D12CommandQueue), - (void **)&data->commandQueue - ); + &queueDesc, + D3D_GUID(SDL_IID_ID3D12CommandQueue), + (void **)&data->commandQueue); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandQueue"), result); goto done; @@ -925,10 +957,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) descriptorHeapDesc.NumDescriptors = SDL_D3D12_NUM_BUFFERS; descriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV; result = D3D_CALL(data->d3dDevice, CreateDescriptorHeap, - &descriptorHeapDesc, - D3D_GUID(SDL_IID_ID3D12DescriptorHeap), - (void **)&data->rtvDescriptorHeap - ); + &descriptorHeapDesc, + D3D_GUID(SDL_IID_ID3D12DescriptorHeap), + (void **)&data->rtvDescriptorHeap); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [rtv]"), result); goto done; @@ -937,10 +968,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) descriptorHeapDesc.NumDescriptors = SDL_D3D12_MAX_NUM_TEXTURES; result = D3D_CALL(data->d3dDevice, CreateDescriptorHeap, - &descriptorHeapDesc, - D3D_GUID(SDL_IID_ID3D12DescriptorHeap), - (void **)&data->textureRTVDescriptorHeap - ); + &descriptorHeapDesc, + D3D_GUID(SDL_IID_ID3D12DescriptorHeap), + (void **)&data->textureRTVDescriptorHeap); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [texture rtv]"), result); goto done; @@ -951,10 +981,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) descriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; descriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; result = D3D_CALL(data->d3dDevice, CreateDescriptorHeap, - &descriptorHeapDesc, - D3D_GUID(SDL_IID_ID3D12DescriptorHeap), - (void **)&data->srvDescriptorHeap - ); + &descriptorHeapDesc, + D3D_GUID(SDL_IID_ID3D12DescriptorHeap), + (void **)&data->srvDescriptorHeap); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [srv]"), result); goto done; @@ -967,10 +996,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) descriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER; descriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; result = D3D_CALL(data->d3dDevice, CreateDescriptorHeap, - &descriptorHeapDesc, - D3D_GUID(SDL_IID_ID3D12DescriptorHeap), - (void **)&data->samplerDescriptorHeap - ); + &descriptorHeapDesc, + D3D_GUID(SDL_IID_ID3D12DescriptorHeap), + (void **)&data->samplerDescriptorHeap); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateDescriptorHeap [sampler]"), result); goto done; @@ -981,10 +1009,9 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* Create a command allocator for each back buffer */ for (i = 0; i < SDL_D3D12_NUM_BUFFERS; ++i) { result = D3D_CALL(data->d3dDevice, CreateCommandAllocator, - D3D12_COMMAND_LIST_TYPE_DIRECT, - D3D_GUID(SDL_IID_ID3D12CommandAllocator), - (void **)&data->commandAllocators[i] - ); + D3D12_COMMAND_LIST_TYPE_DIRECT, + D3D_GUID(SDL_IID_ID3D12CommandAllocator), + (void **)&data->commandAllocators[i]); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandAllocator"), result); goto done; @@ -993,13 +1020,12 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* Create the command list */ result = D3D_CALL(data->d3dDevice, CreateCommandList, - 0, - D3D12_COMMAND_LIST_TYPE_DIRECT, - data->commandAllocators[0], - NULL, - D3D_GUID(SDL_IID_ID3D12GraphicsCommandList2), - (void **)&data->commandList - ); + 0, + D3D12_COMMAND_LIST_TYPE_DIRECT, + data->commandAllocators[0], + NULL, + D3D_GUID(SDL_IID_ID3D12GraphicsCommandList2), + (void **)&data->commandList); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommandList"), result); goto done; @@ -1010,11 +1036,10 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* Create the fence and fence event */ result = D3D_CALL(data->d3dDevice, CreateFence, - data->fenceValue, - D3D12_FENCE_FLAG_NONE, - D3D_GUID(SDL_IID_ID3D12Fence), - (void **)&data->fence - ); + data->fenceValue, + D3D12_FENCE_FLAG_NONE, + D3D_GUID(SDL_IID_ID3D12Fence), + (void **)&data->fence); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateFence"), result); goto done; @@ -1031,14 +1056,13 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* Create all the root signatures */ for (i = 0; i < NUM_ROOTSIGS; ++i) { D3D12_SHADER_BYTECODE rootSigData; - D3D12_GetRootSignatureData((D3D12_RootSignature) i, &rootSigData); + D3D12_GetRootSignatureData((D3D12_RootSignature)i, &rootSigData); result = D3D_CALL(data->d3dDevice, CreateRootSignature, - 0, - rootSigData.pShaderBytecode, - rootSigData.BytecodeLength, - D3D_GUID(SDL_IID_ID3D12RootSignature), - (void **)&data->rootSignatures[i] - ); + 0, + rootSigData.pShaderBytecode, + rootSigData.BytecodeLength, + D3D_GUID(SDL_IID_ID3D12RootSignature), + (void **)&data->rootSignatures[i]); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateRootSignature"), result); goto done; @@ -1051,7 +1075,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) for (j = 0; j < SDL_arraysize(defaultBlendModes); ++j) { for (k = D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT; k < D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH; ++k) { for (l = 0; l < SDL_arraysize(defaultRTVFormats); ++l) { - if (!D3D12_CreatePipelineState(renderer, (D3D12_Shader) i, defaultBlendModes[j], (D3D12_PRIMITIVE_TOPOLOGY_TYPE) k, defaultRTVFormats[l])) { + if (!D3D12_CreatePipelineState(renderer, (D3D12_Shader)i, defaultBlendModes[j], (D3D12_PRIMITIVE_TOPOLOGY_TYPE)k, defaultRTVFormats[l])) { /* D3D12_CreatePipelineState will set the SDL error, if it fails */ goto done; } @@ -1076,7 +1100,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) samplerDesc.ComparisonFunc = D3D12_COMPARISON_FUNC_ALWAYS; samplerDesc.MinLOD = 0.0f; samplerDesc.MaxLOD = D3D12_FLOAT32_MAX; - D3D_CALL_RET(data->samplerDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &data->nearestPixelSampler); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(data->samplerDescriptorHeap, &data->nearestPixelSampler); D3D_CALL(data->d3dDevice, CreateSampler, &samplerDesc, data->nearestPixelSampler); samplerDesc.Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR; @@ -1096,27 +1120,24 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) return result; } -static DXGI_MODE_ROTATION -D3D12_GetCurrentRotation() +static DXGI_MODE_ROTATION D3D12_GetCurrentRotation() { /* FIXME */ return DXGI_MODE_ROTATION_IDENTITY; } -static BOOL -D3D12_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) +static BOOL D3D12_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) { switch (rotation) { - case DXGI_MODE_ROTATION_ROTATE90: - case DXGI_MODE_ROTATION_ROTATE270: - return TRUE; - default: - return FALSE; + case DXGI_MODE_ROTATION_ROTATE90: + case DXGI_MODE_ROTATION_ROTATE270: + return TRUE; + default: + return FALSE; } } -static int -D3D12_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer) +static int D3D12_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) { D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; if (data->textureRenderTarget) { @@ -1126,56 +1147,54 @@ D3D12_GetRotationForCurrentRenderTarget(SDL_Renderer * renderer) } } -static int -D3D12_GetViewportAlignedD3DRect(SDL_Renderer * renderer, const SDL_Rect * sdlRect, D3D12_RECT * outRect, BOOL includeViewportOffset) +static int D3D12_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rect *sdlRect, D3D12_RECT *outRect, BOOL includeViewportOffset) { - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; const int rotation = D3D12_GetRotationForCurrentRenderTarget(renderer); const SDL_Rect *viewport = &data->currentViewport; switch (rotation) { - case DXGI_MODE_ROTATION_IDENTITY: - outRect->left = sdlRect->x; - outRect->right = sdlRect->x + sdlRect->w; - outRect->top = sdlRect->y; - outRect->bottom = sdlRect->y + sdlRect->h; - if (includeViewportOffset) { - outRect->left += viewport->x; - outRect->right += viewport->x; - outRect->top += viewport->y; - outRect->bottom += viewport->y; - } - break; - case DXGI_MODE_ROTATION_ROTATE270: - outRect->left = sdlRect->y; - outRect->right = sdlRect->y + sdlRect->h; - outRect->top = viewport->w - sdlRect->x - sdlRect->w; - outRect->bottom = viewport->w - sdlRect->x; - break; - case DXGI_MODE_ROTATION_ROTATE180: - outRect->left = viewport->w - sdlRect->x - sdlRect->w; - outRect->right = viewport->w - sdlRect->x; - outRect->top = viewport->h - sdlRect->y - sdlRect->h; - outRect->bottom = viewport->h - sdlRect->y; - break; - case DXGI_MODE_ROTATION_ROTATE90: - outRect->left = viewport->h - sdlRect->y - sdlRect->h; - outRect->right = viewport->h - sdlRect->y; - outRect->top = sdlRect->x; - outRect->bottom = sdlRect->x + sdlRect->h; - break; - default: - return SDL_SetError("The physical display is in an unknown or unsupported rotation"); + case DXGI_MODE_ROTATION_IDENTITY: + outRect->left = sdlRect->x; + outRect->right = (LONG)sdlRect->x + sdlRect->w; + outRect->top = sdlRect->y; + outRect->bottom = (LONG)sdlRect->y + sdlRect->h; + if (includeViewportOffset) { + outRect->left += viewport->x; + outRect->right += viewport->x; + outRect->top += viewport->y; + outRect->bottom += viewport->y; + } + break; + case DXGI_MODE_ROTATION_ROTATE270: + outRect->left = sdlRect->y; + outRect->right = (LONG)sdlRect->y + sdlRect->h; + outRect->top = viewport->w - sdlRect->x - sdlRect->w; + outRect->bottom = viewport->w - sdlRect->x; + break; + case DXGI_MODE_ROTATION_ROTATE180: + outRect->left = viewport->w - sdlRect->x - sdlRect->w; + outRect->right = viewport->w - sdlRect->x; + outRect->top = viewport->h - sdlRect->y - sdlRect->h; + outRect->bottom = viewport->h - sdlRect->y; + break; + case DXGI_MODE_ROTATION_ROTATE90: + outRect->left = viewport->h - sdlRect->y - sdlRect->h; + outRect->right = viewport->h - sdlRect->y; + outRect->top = sdlRect->x; + outRect->bottom = (LONG)sdlRect->x + sdlRect->h; + break; + default: + return SDL_SetError("The physical display is in an unknown or unsupported rotation"); } return 0; } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -static HRESULT -D3D12_CreateSwapChain(SDL_Renderer * renderer, int w, int h) +static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; - IDXGISwapChain1* swapChain; + IDXGISwapChain1* swapChain = NULL; HRESULT result = S_OK; SDL_SysWMinfo windowinfo; @@ -1195,21 +1214,26 @@ D3D12_CreateSwapChain(SDL_Renderer * renderer, int w, int h) } else { swapChainDesc.Scaling = DXGI_SCALING_STRETCH; } - swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; /* All Windows Store apps must use this SwapEffect. */ + swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; /* All Windows Store apps must use this SwapEffect. */ swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT | /* To support SetMaximumFrameLatency */ - DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */ + DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */ SDL_VERSION(&windowinfo.version); - SDL_GetWindowWMInfo(renderer->window, &windowinfo); + if (!SDL_GetWindowWMInfo(renderer->window, &windowinfo) || + windowinfo.subsystem != SDL_SYSWM_WINDOWS) + { + SDL_SetError("Couldn't get window handle"); + result = E_FAIL; + goto done; + } result = D3D_CALL(data->dxgiFactory, CreateSwapChainForHwnd, - (IUnknown *)data->commandQueue, - windowinfo.info.win.window, - &swapChainDesc, - NULL, - NULL, /* Allow on all displays. */ - &swapChain - ); + (IUnknown *)data->commandQueue, + windowinfo.info.win.window, + &swapChainDesc, + NULL, + NULL, /* Allow on all displays. */ + &swapChain); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForHwnd"), result); goto done; @@ -1241,11 +1265,10 @@ D3D12_CreateSwapChain(SDL_Renderer * renderer, int w, int h) } #endif -static HRESULT D3D12_UpdateForWindowSizeChange(SDL_Renderer * renderer); - +static HRESULT D3D12_UpdateForWindowSizeChange(SDL_Renderer *renderer); HRESULT -D3D12_HandleDeviceLost(SDL_Renderer * renderer) +D3D12_HandleDeviceLost(SDL_Renderer *renderer) { HRESULT result = S_OK; @@ -1274,8 +1297,7 @@ D3D12_HandleDeviceLost(SDL_Renderer * renderer) } /* Initialize all resources that change when the window's size changes. */ -static HRESULT -D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) +static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer) { D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; HRESULT result = S_OK; @@ -1308,16 +1330,15 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) if (data->swapChain) { /* If the swap chain already exists, resize it. */ result = D3D_CALL(data->swapChain, ResizeBuffers, - 0, - w, h, - DXGI_FORMAT_UNKNOWN, - data->swapFlags - ); + 0, + w, h, + DXGI_FORMAT_UNKNOWN, + data->swapFlags); if (result == DXGI_ERROR_DEVICE_REMOVED) { /* If the device was removed for any reason, a new device and swap chain will need to be created. */ D3D12_HandleDeviceLost(renderer); - /* Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method + /* Everything is set up now. Do not continue execution of this method. HandleDeviceLost will reenter this method * and correctly set up the new device. */ goto done; @@ -1331,11 +1352,11 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) goto done; } } - + /* Set the proper rotation for the swap chain. */ if (WIN_IsWindows8OrGreater()) { if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) { - result = D3D_CALL(data->swapChain, SetRotation, data->rotation); + result = D3D_CALL(data->swapChain, SetRotation, data->rotation); /* NOLINT(clang-analyzer-core.NullDereference) */ if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain4::SetRotation"), result); goto done; @@ -1347,17 +1368,16 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) /* Get each back buffer render target and create render target views */ for (i = 0; i < SDL_D3D12_NUM_BUFFERS; ++i) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) - result = D3D12_XBOX_CreateBackBufferTarget(data->d3dDevice, renderer->window->w, renderer->window->h, (void **) &data->renderTargets[i]); + result = D3D12_XBOX_CreateBackBufferTarget(data->d3dDevice, renderer->window->w, renderer->window->h, (void **)&data->renderTargets[i]); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12_XBOX_CreateBackBufferTarget"), result); goto done; } #else - result = D3D_CALL(data->swapChain, GetBuffer, - i, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **) &data->renderTargets[i] - ); + result = D3D_CALL(data->swapChain, GetBuffer, /* NOLINT(clang-analyzer-core.NullDereference) */ + i, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&data->renderTargets[i]); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain4::GetBuffer"), result); goto done; @@ -1369,7 +1389,7 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D; SDL_zero(rtvDescriptor); - D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &rtvDescriptor); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(data->rtvDescriptorHeap, &rtvDescriptor); rtvDescriptor.ptr += i * data->rtvDescriptorSize; D3D_CALL(data->d3dDevice, CreateRenderTargetView, data->renderTargets[i], &rtvDesc, rtvDescriptor); } @@ -1388,10 +1408,9 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) data->currentRenderTargetView = D3D12_GetCurrentRenderTargetView(renderer); D3D_CALL(data->commandList, OMSetRenderTargets, 1, &data->currentRenderTargetView, FALSE, NULL); D3D12_TransitionResource(data, - data->renderTargets[data->currentBackBufferIndex], - D3D12_RESOURCE_STATE_PRESENT, - D3D12_RESOURCE_STATE_RENDER_TARGET - ); + data->renderTargets[data->currentBackBufferIndex], + D3D12_RESOURCE_STATE_PRESENT, + D3D12_RESOURCE_STATE_RENDER_TARGET); data->viewportDirty = SDL_TRUE; @@ -1404,25 +1423,22 @@ D3D12_CreateWindowSizeDependentResources(SDL_Renderer * renderer) } /* This method is called when the window's size changes. */ -static HRESULT -D3D12_UpdateForWindowSizeChange(SDL_Renderer * renderer) +static HRESULT D3D12_UpdateForWindowSizeChange(SDL_Renderer *renderer) { - D3D12_RenderData* data = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; /* If the GPU has previous work, wait for it to be done first */ D3D12_WaitForGPU(data); return D3D12_CreateWindowSizeDependentResources(renderer); } -static void -D3D12_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void D3D12_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { D3D12_UpdateForWindowSizeChange(renderer); } } -static SDL_bool -D3D12_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool D3D12_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -1440,13 +1456,12 @@ D3D12_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) return SDL_TRUE; } -static SIZE_T -D3D12_GetAvailableSRVIndex(SDL_Renderer * renderer) +static SIZE_T D3D12_GetAvailableSRVIndex(SDL_Renderer *renderer) { - D3D12_RenderData* rendererData = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; if (rendererData->srvPoolHead) { SIZE_T index = rendererData->srvPoolHead->index; - rendererData->srvPoolHead = (D3D12_SRVPoolNode*)(rendererData->srvPoolHead->next); + rendererData->srvPoolHead = (D3D12_SRVPoolNode *)(rendererData->srvPoolHead->next); return index; } else { SDL_SetError("[d3d12] Cannot allocate more than %d textures!", SDL_D3D12_MAX_NUM_TEXTURES); @@ -1454,18 +1469,16 @@ D3D12_GetAvailableSRVIndex(SDL_Renderer * renderer) } } -static void -D3D12_FreeSRVIndex(SDL_Renderer * renderer, SIZE_T index) +static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index) { - D3D12_RenderData* rendererData = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; rendererData->srvPoolNodes[index].next = rendererData->srvPoolHead; rendererData->srvPoolHead = &rendererData->srvPoolNodes[index]; } -static int -D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData; HRESULT result; DXGI_FORMAT textureFormat = SDLPixelFormatToDXGIFormat(texture->format); @@ -1474,16 +1487,15 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) D3D12_SHADER_RESOURCE_VIEW_DESC resourceViewDesc; if (textureFormat == DXGI_FORMAT_UNKNOWN) { - return SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified", - __FUNCTION__, texture->format); + return SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified", __FUNCTION__, texture->format); } - textureData = (D3D12_TextureData*) SDL_calloc(1, sizeof(*textureData)); + textureData = (D3D12_TextureData *)SDL_calloc(1, sizeof(*textureData)); if (!textureData) { SDL_OutOfMemory(); return -1; } - textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR; + textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR; texture->driverdata = textureData; textureData->mainTextureFormat = textureFormat; @@ -1509,14 +1521,13 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) heapProps.VisibleNodeMask = 1; result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &textureDesc, - D3D12_RESOURCE_STATE_COPY_DEST, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&textureData->mainTexture - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &textureDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&textureData->mainTexture); textureData->mainResourceState = D3D12_RESOURCE_STATE_COPY_DEST; if (FAILED(result)) { D3D12_DestroyTexture(renderer, texture); @@ -1531,14 +1542,13 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) textureDesc.Height = (textureDesc.Height + 1) / 2; result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &textureDesc, - D3D12_RESOURCE_STATE_COPY_DEST, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&textureData->mainTextureU - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &textureDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&textureData->mainTextureU); textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST; if (FAILED(result)) { D3D12_DestroyTexture(renderer, texture); @@ -1546,14 +1556,13 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &textureDesc, - D3D12_RESOURCE_STATE_COPY_DEST, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&textureData->mainTextureV - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &textureDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&textureData->mainTextureV); textureData->mainResourceStateV = D3D12_RESOURCE_STATE_COPY_DEST; if (FAILED(result)) { D3D12_DestroyTexture(renderer, texture); @@ -1572,14 +1581,13 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) nvTextureDesc.Height = (textureDesc.Height + 1) / 2; result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &nvTextureDesc, - D3D12_RESOURCE_STATE_COPY_DEST, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&textureData->mainTextureNV - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &nvTextureDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&textureData->mainTextureNV); textureData->mainResourceStateNV = D3D12_RESOURCE_STATE_COPY_DEST; if (FAILED(result)) { D3D12_DestroyTexture(renderer, texture); @@ -1595,33 +1603,30 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) resourceViewDesc.Texture2D.MipLevels = textureDesc.MipLevels; textureData->mainSRVIndex = D3D12_GetAvailableSRVIndex(renderer); - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceView); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rendererData->srvDescriptorHeap, &textureData->mainTextureResourceView); textureData->mainTextureResourceView.ptr += textureData->mainSRVIndex * rendererData->srvDescriptorSize; D3D_CALL(rendererData->d3dDevice, CreateShaderResourceView, - textureData->mainTexture, - &resourceViewDesc, - textureData->mainTextureResourceView - ); + textureData->mainTexture, + &resourceViewDesc, + textureData->mainTextureResourceView); #if SDL_HAVE_YUV if (textureData->yuv) { - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewU); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rendererData->srvDescriptorHeap, &textureData->mainTextureResourceViewU); textureData->mainSRVIndexU = D3D12_GetAvailableSRVIndex(renderer); textureData->mainTextureResourceViewU.ptr += textureData->mainSRVIndexU * rendererData->srvDescriptorSize; D3D_CALL(rendererData->d3dDevice, CreateShaderResourceView, - textureData->mainTextureU, - &resourceViewDesc, - textureData->mainTextureResourceViewU - ); + textureData->mainTextureU, + &resourceViewDesc, + textureData->mainTextureResourceViewU); - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewV); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rendererData->srvDescriptorHeap, &textureData->mainTextureResourceViewV); textureData->mainSRVIndexV = D3D12_GetAvailableSRVIndex(renderer); textureData->mainTextureResourceViewV.ptr += textureData->mainSRVIndexV * rendererData->srvDescriptorSize; D3D_CALL(rendererData->d3dDevice, CreateShaderResourceView, - textureData->mainTextureV, - &resourceViewDesc, - textureData->mainTextureResourceViewV - ); + textureData->mainTextureV, + &resourceViewDesc, + textureData->mainTextureResourceViewV); } if (textureData->nv12) { @@ -1629,14 +1634,13 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) nvResourceViewDesc.Format = DXGI_FORMAT_R8G8_UNORM; - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewNV); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rendererData->srvDescriptorHeap, &textureData->mainTextureResourceViewNV); textureData->mainSRVIndexNV = D3D12_GetAvailableSRVIndex(renderer); textureData->mainTextureResourceViewNV.ptr += textureData->mainSRVIndexNV * rendererData->srvDescriptorSize; D3D_CALL(rendererData->d3dDevice, CreateShaderResourceView, - textureData->mainTextureNV, - &nvResourceViewDesc, - textureData->mainTextureResourceViewNV - ); + textureData->mainTextureNV, + &nvResourceViewDesc, + textureData->mainTextureResourceViewNV); } #endif /* SDL_HAVE_YUV */ @@ -1647,23 +1651,22 @@ D3D12_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) renderTargetViewDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D; renderTargetViewDesc.Texture2D.MipSlice = 0; - D3D_CALL_RET(rendererData->textureRTVDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureRenderTargetView); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rendererData->textureRTVDescriptorHeap, &textureData->mainTextureRenderTargetView); textureData->mainTextureRenderTargetView.ptr += textureData->mainSRVIndex * rendererData->rtvDescriptorSize; D3D_CALL(rendererData->d3dDevice, CreateRenderTargetView, - (ID3D12Resource*)textureData->mainTexture, - &renderTargetViewDesc, - textureData->mainTextureRenderTargetView); + (ID3D12Resource *)textureData->mainTexture, + &renderTargetViewDesc, + textureData->mainTextureRenderTargetView); } return 0; } -static void -D3D12_DestroyTexture(SDL_Renderer * renderer, - SDL_Texture * texture) +static void D3D12_DestroyTexture(SDL_Renderer *renderer, + SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData*)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; if (!textureData) { @@ -1694,8 +1697,7 @@ D3D12_DestroyTexture(SDL_Renderer * renderer, texture->driverdata = NULL; } -static int -D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * texture, int bpp, int x, int y, int w, int h, const void *pixels, int pitch, D3D12_RESOURCE_STATES *resourceState) +static int D3D12_UpdateTextureInternal(D3D12_RenderData *rendererData, ID3D12Resource *texture, int bpp, int x, int y, int w, int h, const void *pixels, int pitch, D3D12_RESOURCE_STATES *resourceState) { const Uint8 *src; Uint8 *dst; @@ -1714,7 +1716,7 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te /* Create an upload buffer, which will be used to write to the main texture. */ SDL_zero(textureDesc); - D3D_CALL_RET(texture, GetDesc, &textureDesc); + D3D_CALL_RET_ID3D12Resource_GetDesc(texture, &textureDesc); textureDesc.Width = w; textureDesc.Height = h; @@ -1732,15 +1734,14 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te /* Figure out how much we need to allocate for the upload buffer */ D3D_CALL(rendererData->d3dDevice, GetCopyableFootprints, - &textureDesc, - 0, - 1, - 0, - NULL, - NULL, - NULL, - &uploadDesc.Width - ); + &textureDesc, + 0, + 1, + 0, + NULL, + NULL, + NULL, + &uploadDesc.Width); SDL_zero(heapProps); heapProps.Type = D3D12_HEAP_TYPE_UPLOAD; @@ -1749,14 +1750,13 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te /* Create the upload buffer */ result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &uploadDesc, - D3D12_RESOURCE_STATE_GENERIC_READ, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&rendererData->uploadBuffers[rendererData->currentUploadBuffer] - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &uploadDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&rendererData->uploadBuffers[rendererData->currentUploadBuffer]); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [create upload buffer]"), result); } @@ -1764,10 +1764,9 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te /* Get a write-only pointer to data in the upload buffer: */ uploadBuffer = rendererData->uploadBuffers[rendererData->currentUploadBuffer]; result = D3D_CALL(uploadBuffer, Map, - 0, - NULL, - (void **)&textureMemory - ); + 0, + NULL, + (void **)&textureMemory); if (FAILED(result)) { SAFE_RELEASE(rendererData->uploadBuffers[rendererData->currentUploadBuffer]); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result); @@ -1788,7 +1787,7 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te dst = textureMemory; length = w * bpp; if (length == pitch && length == pitchedDesc.RowPitch) { - SDL_memcpy(dst, src, length*h); + SDL_memcpy(dst, src, (size_t)length * h); } else { if (length > (UINT)pitch) { length = pitch; @@ -1821,18 +1820,17 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te srcLocation.PlacedFootprint = placedTextureDesc; D3D_CALL(rendererData->commandList, CopyTextureRegion, - &dstLocation, - x, - y, - 0, - &srcLocation, - NULL - ); + &dstLocation, + x, + y, + 0, + &srcLocation, + NULL); /* Transition the texture to be shader accessible */ D3D12_TransitionResource(rendererData, texture, *resourceState, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); *resourceState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; - + rendererData->currentUploadBuffer++; /* If we've used up all the upload buffers, we need to issue the batch */ if (rendererData->currentUploadBuffer == SDL_D3D12_NUM_UPLOAD_BUFFERS) { @@ -1842,10 +1840,9 @@ D3D12_UpdateTextureInternal(D3D12_RenderData * rendererData, ID3D12Resource * te return 0; } -static int -D3D12_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void * srcPixels, - int srcPitch) +static int D3D12_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *srcPixels, + int srcPitch) { D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; @@ -1860,14 +1857,14 @@ D3D12_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, #if SDL_HAVE_YUV if (textureData->yuv) { /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + rect->h * srcPitch); + srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); if (D3D12_UpdateTextureInternal(rendererData, texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainTextureV : textureData->mainTextureU, SDL_BYTESPERPIXEL(texture->format), rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) / 2, texture->format == SDL_PIXELFORMAT_YV12 ? &textureData->mainResourceStateV : &textureData->mainResourceStateU) < 0) { return -1; } /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); + srcPixels = (const void *)((const Uint8 *)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); if (D3D12_UpdateTextureInternal(rendererData, texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainTextureU : textureData->mainTextureV, SDL_BYTESPERPIXEL(texture->format), rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) / 2, texture->format == SDL_PIXELFORMAT_YV12 ? &textureData->mainResourceStateU : &textureData->mainResourceStateV) < 0) { return -1; } @@ -1875,9 +1872,9 @@ D3D12_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, if (textureData->nv12) { /* Skip to the correct offset into the next texture */ - srcPixels = (const void*)((const Uint8*)srcPixels + rect->h * srcPitch); + srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); - if (D3D12_UpdateTextureInternal(rendererData, textureData->mainTextureNV, 2, rect->x / 2, rect->y / 2, ((rect->w + 1) / 2), (rect->h + 1) / 2, srcPixels, 2*((srcPitch + 1) / 2), &textureData->mainResourceStateNV) < 0) { + if (D3D12_UpdateTextureInternal(rendererData, textureData->mainTextureNV, 2, rect->x / 2, rect->y / 2, ((rect->w + 1) / 2), (rect->h + 1) / 2, srcPixels, 2 * ((srcPitch + 1) / 2), &textureData->mainResourceStateNV) < 0) { return -1; } } @@ -1886,12 +1883,11 @@ D3D12_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } #if SDL_HAVE_YUV -static int -D3D12_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int D3D12_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; @@ -1912,11 +1908,10 @@ D3D12_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static int -D3D12_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int D3D12_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; @@ -1936,12 +1931,11 @@ D3D12_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, } #endif -static int -D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int D3D12_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *) texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; HRESULT result = S_OK; D3D12_RESOURCE_DESC textureDesc; @@ -1966,8 +1960,8 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, } textureData->lockedRect = *rect; *pixels = - (void *)((Uint8 *)textureData->pixels + rect->y * textureData->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(textureData->pixels + rect->y * textureData->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = textureData->pitch; return 0; } @@ -1975,10 +1969,10 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, if (textureData->stagingBuffer) { return SDL_SetError("texture is already locked"); } - + /* Create an upload buffer, which will be used to write to the main texture. */ SDL_zero(textureDesc); - D3D_CALL_RET(textureData->mainTexture, GetDesc, &textureDesc); + D3D_CALL_RET_ID3D12Resource_GetDesc(textureData->mainTexture, &textureDesc); textureDesc.Width = rect->w; textureDesc.Height = rect->h; @@ -1996,15 +1990,14 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, /* Figure out how much we need to allocate for the upload buffer */ D3D_CALL(rendererData->d3dDevice, GetCopyableFootprints, - &textureDesc, - 0, - 1, - 0, - NULL, - NULL, - NULL, - &uploadDesc.Width - ); + &textureDesc, + 0, + 1, + 0, + NULL, + NULL, + NULL, + &uploadDesc.Width); SDL_zero(heapProps); heapProps.Type = D3D12_HEAP_TYPE_UPLOAD; @@ -2013,24 +2006,22 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, /* Create the upload buffer */ result = D3D_CALL(rendererData->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &uploadDesc, - D3D12_RESOURCE_STATE_GENERIC_READ, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&textureData->stagingBuffer - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &uploadDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&textureData->stagingBuffer); if (FAILED(result)) { return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateCommittedResource [create upload buffer]"), result); } /* Get a write-only pointer to data in the upload buffer: */ result = D3D_CALL(textureData->stagingBuffer, Map, - 0, - NULL, - (void **)&textureMemory - ); + 0, + NULL, + (void **)&textureMemory); if (FAILED(result)) { SAFE_RELEASE(rendererData->uploadBuffers[rendererData->currentUploadBuffer]); return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result); @@ -2043,13 +2034,12 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, pitchedDesc.Depth = 1; if (pitchedDesc.Format == DXGI_FORMAT_R8_UNORM) { bpp = 1; - } - else { + } else { bpp = 4; } pitchedDesc.RowPitch = D3D12_Align(rect->w * bpp, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); - /* Make note of where the staging texture will be written to + /* Make note of where the staging texture will be written to * (on a call to SDL_UnlockTexture): */ textureData->lockedRect = *rect; @@ -2062,11 +2052,10 @@ D3D12_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static void -D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void D3D12_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *) texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; D3D12_RESOURCE_DESC textureDesc; D3D12_SUBRESOURCE_FOOTPRINT pitchedDesc; @@ -2074,7 +2063,7 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) D3D12_TEXTURE_COPY_LOCATION srcLocation; D3D12_TEXTURE_COPY_LOCATION dstLocation; int bpp; - + if (!textureData) { return; } @@ -2082,8 +2071,8 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (textureData->yuv || textureData->nv12) { const SDL_Rect *rect = &textureData->lockedRect; void *pixels = - (void *) ((Uint8 *) textureData->pixels + rect->y * textureData->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)(textureData->pixels + rect->y * textureData->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); D3D12_UpdateTexture(renderer, texture, rect, pixels, textureData->pitch); return; } @@ -2092,7 +2081,7 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) D3D_CALL(textureData->stagingBuffer, Unmap, 0, NULL); SDL_zero(textureDesc); - D3D_CALL_RET(textureData->mainTexture, GetDesc, &textureDesc); + D3D_CALL_RET_ID3D12Resource_GetDesc(textureData->mainTexture, &textureDesc); textureDesc.Width = textureData->lockedRect.w; textureDesc.Height = textureData->lockedRect.h; @@ -2103,8 +2092,7 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) pitchedDesc.Depth = 1; if (pitchedDesc.Format == DXGI_FORMAT_R8_UNORM) { bpp = 1; - } - else { + } else { bpp = 4; } pitchedDesc.RowPitch = D3D12_Align(textureData->lockedRect.w * bpp, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); @@ -2127,13 +2115,12 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) srcLocation.PlacedFootprint = placedTextureDesc; D3D_CALL(rendererData->commandList, CopyTextureRegion, - &dstLocation, - textureData->lockedRect.x, - textureData->lockedRect.y, - 0, - &srcLocation, - NULL - ); + &dstLocation, + textureData->lockedRect.x, + textureData->lockedRect.y, + 0, + &srcLocation, + NULL); /* Transition the texture to be shader accessible */ D3D12_TransitionResource(rendererData, textureData->mainTexture, textureData->mainResourceState, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); @@ -2144,38 +2131,35 @@ D3D12_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) SAFE_RELEASE(textureData->stagingBuffer); } -static void -D3D12_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void D3D12_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - D3D12_TextureData *textureData = (D3D12_TextureData *) texture->driverdata; - + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + if (!textureData) { return; } - textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR; + textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR; } -static int -D3D12_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int D3D12_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; D3D12_TextureData *textureData = NULL; - if (texture == NULL) { + if (!texture) { if (rendererData->textureRenderTarget) { D3D12_TransitionResource(rendererData, - rendererData->textureRenderTarget->mainTexture, - rendererData->textureRenderTarget->mainResourceState, - D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE - ); + rendererData->textureRenderTarget->mainTexture, + rendererData->textureRenderTarget->mainResourceState, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); rendererData->textureRenderTarget->mainResourceState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; } rendererData->textureRenderTarget = NULL; return 0; } - textureData = (D3D12_TextureData *) texture->driverdata; + textureData = (D3D12_TextureData *)texture->driverdata; if (!textureData->mainTextureRenderTargetView.ptr) { return SDL_SetError("specified texture is not a render target"); @@ -2183,26 +2167,22 @@ D3D12_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) rendererData->textureRenderTarget = textureData; D3D12_TransitionResource(rendererData, - rendererData->textureRenderTarget->mainTexture, - rendererData->textureRenderTarget->mainResourceState, - D3D12_RESOURCE_STATE_RENDER_TARGET - ); + rendererData->textureRenderTarget->mainTexture, + rendererData->textureRenderTarget->mainResourceState, + D3D12_RESOURCE_STATE_RENDER_TARGET); rendererData->textureRenderTarget->mainResourceState = D3D12_RESOURCE_STATE_RENDER_TARGET; - return 0; } -static int -D3D12_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int D3D12_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -D3D12_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int D3D12_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VertexPositionColor *verts = (VertexPositionColor *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertexPositionColor), 0, &cmd->data.draw.first); + VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); int i; SDL_Color color; color.r = cmd->data.draw.r; @@ -2228,15 +2208,14 @@ D3D12_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL return 0; } -static int -D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; - VertexPositionColor *verts = (VertexPositionColor *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertexPositionColor), 0, &cmd->data.draw.first); + VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -2258,14 +2237,14 @@ D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); + xy_ = (float *)((char *)xy + j * xy_stride); verts->pos.x = xy_[0] * scale_x; verts->pos.y = xy_[1] * scale_y; - verts->color = *(SDL_Color*)((char*)color + j * color_stride); + verts->color = *(SDL_Color *)((char *)color + j * color_stride); if (texture) { - float *uv_ = (float *)((char*)uv + j * uv_stride); + float *uv_ = (float *)((char *)uv + j * uv_stride); verts->tex.x = uv_[0]; verts->tex.y = uv_[1]; } else { @@ -2275,25 +2254,24 @@ D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture verts += 1; } - return 0; + return 0; } -static int -D3D12_UpdateVertexBuffer(SDL_Renderer *renderer, - const void * vertexData, size_t dataSizeInBytes) +static int D3D12_UpdateVertexBuffer(SDL_Renderer *renderer, + const void *vertexData, size_t dataSizeInBytes) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; HRESULT result = S_OK; const int vbidx = rendererData->currentVertexBuffer; - UINT8* vertexBufferData = NULL; + UINT8 *vertexBufferData = NULL; D3D12_RANGE range; ID3D12Resource *vertexBuffer; range.Begin = 0; range.End = 0; - + if (dataSizeInBytes == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } if (rendererData->issueBatch) { @@ -2329,10 +2307,9 @@ D3D12_UpdateVertexBuffer(SDL_Renderer *renderer, return S_OK; } -static int -D3D12_UpdateViewport(SDL_Renderer * renderer) +static int D3D12_UpdateViewport(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; const SDL_Rect *viewport = &data->currentViewport; Float4X4 projection; Float4X4 view; @@ -2386,25 +2363,25 @@ D3D12_UpdateViewport(SDL_Renderer * renderer) * for eventual transfer to the GPU. */ data->vertexShaderConstantsData.projectionAndView = MatrixMultiply( - view, - projection); + view, + projection); /* Update the Direct3D viewport, which seems to be aligned to the * swap buffer's coordinate space, which is always in either * a landscape mode, for all Windows 8/RT devices, or a portrait mode, * for Windows Phone devices. */ - swapDimensions = D3D12_IsDisplayRotated90Degrees((DXGI_MODE_ROTATION) rotation); + swapDimensions = D3D12_IsDisplayRotated90Degrees((DXGI_MODE_ROTATION)rotation); if (swapDimensions) { - orientationAlignedViewport.x = (float) viewport->y; - orientationAlignedViewport.y = (float) viewport->x; - orientationAlignedViewport.w = (float) viewport->h; - orientationAlignedViewport.h = (float) viewport->w; + orientationAlignedViewport.x = (float)viewport->y; + orientationAlignedViewport.y = (float)viewport->x; + orientationAlignedViewport.w = (float)viewport->h; + orientationAlignedViewport.h = (float)viewport->w; } else { - orientationAlignedViewport.x = (float) viewport->x; - orientationAlignedViewport.y = (float) viewport->y; - orientationAlignedViewport.w = (float) viewport->w; - orientationAlignedViewport.h = (float) viewport->h; + orientationAlignedViewport.x = (float)viewport->x; + orientationAlignedViewport.y = (float)viewport->y; + orientationAlignedViewport.w = (float)viewport->w; + orientationAlignedViewport.h = (float)viewport->h; } d3dviewport.TopLeftX = orientationAlignedViewport.x; @@ -2421,11 +2398,10 @@ D3D12_UpdateViewport(SDL_Renderer * renderer) return 0; } -static int -D3D12_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, D3D12_Shader shader, - D3D12_PRIMITIVE_TOPOLOGY_TYPE topology, - const int numShaderResources, D3D12_CPU_DESCRIPTOR_HANDLE * shaderResources, - D3D12_CPU_DESCRIPTOR_HANDLE * sampler, const Float4X4 *matrix) +static int D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, D3D12_Shader shader, + D3D12_PRIMITIVE_TOPOLOGY_TYPE topology, + const int numShaderResources, D3D12_CPU_DESCRIPTOR_HANDLE *shaderResources, + D3D12_CPU_DESCRIPTOR_HANDLE *sampler, const Float4X4 *matrix) { D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; @@ -2447,7 +2423,7 @@ D3D12_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, D3D12_ rendererData->currentPipelineState->blendMode != blendMode || rendererData->currentPipelineState->topology != topology || rendererData->currentPipelineState->rtvFormat != rtvFormat) { - + /* Find the matching pipeline. NOTE: Although it may seem inefficient to linearly search through ~450 pipelines to find the correct one, in profiling this doesn't come up at all. @@ -2456,7 +2432,7 @@ D3D12_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, D3D12_ */ rendererData->currentPipelineState = NULL; for (i = 0; i < rendererData->pipelineStateCount; ++i) { - D3D12_PipelineState* candidatePiplineState = &rendererData->pipelineStates[i]; + D3D12_PipelineState *candidatePiplineState = &rendererData->pipelineStates[i]; if (candidatePiplineState->shader == shader && candidatePiplineState->blendMode == blendMode && candidatePiplineState->topology == topology && @@ -2477,7 +2453,7 @@ D3D12_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, D3D12_ D3D_CALL(rendererData->commandList, SetPipelineState, rendererData->currentPipelineState->pipelineState); D3D_CALL(rendererData->commandList, SetGraphicsRootSignature, - rendererData->rootSignatures[D3D12_GetRootSignatureType(rendererData->currentPipelineState->shader)]); + rendererData->rootSignatures[D3D12_GetRootSignatureType(rendererData->currentPipelineState->shader)]); /* When we change these we will need to re-upload the constant buffer and reset any descriptors */ updateSubresource = SDL_TRUE; rendererData->currentSampler.ptr = 0; @@ -2525,52 +2501,50 @@ D3D12_SetDrawState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, D3D12_ /* Figure out the correct sampler descriptor table index based on the type of shader */ switch (shader) { - case SHADER_RGB: - tableIndex = 2; - break; + case SHADER_RGB: + tableIndex = 2; + break; #if SDL_HAVE_YUV - case SHADER_YUV_JPEG: - case SHADER_YUV_BT601: - case SHADER_YUV_BT709: - tableIndex = 4; - break; - case SHADER_NV12_JPEG: - case SHADER_NV12_BT601: - case SHADER_NV12_BT709: - case SHADER_NV21_JPEG: - case SHADER_NV21_BT601: - case SHADER_NV21_BT709: - tableIndex = 3; - break; + case SHADER_YUV_JPEG: + case SHADER_YUV_BT601: + case SHADER_YUV_BT709: + tableIndex = 4; + break; + case SHADER_NV12_JPEG: + case SHADER_NV12_BT601: + case SHADER_NV12_BT709: + case SHADER_NV21_JPEG: + case SHADER_NV21_BT601: + case SHADER_NV21_BT709: + tableIndex = 3; + break; #endif - default: - return SDL_SetError("[direct3d12] Trying to set a sampler for a shader which doesn't have one"); - break; + default: + return SDL_SetError("[direct3d12] Trying to set a sampler for a shader which doesn't have one"); + break; } D3D_CALL(rendererData->commandList, SetGraphicsRootDescriptorTable, tableIndex, GPUHandle); rendererData->currentSampler = *sampler; } - if (updateSubresource == SDL_TRUE || SDL_memcmp(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof (*newmatrix)) != 0) { - SDL_memcpy(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof (*newmatrix)); + if (updateSubresource == SDL_TRUE || SDL_memcmp(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof(*newmatrix)) != 0) { + SDL_memcpy(&rendererData->vertexShaderConstantsData.model, newmatrix, sizeof(*newmatrix)); D3D_CALL(rendererData->commandList, SetGraphicsRoot32BitConstants, - 0, - 32, - &rendererData->vertexShaderConstantsData, - 0 - ); + 0, + 32, + &rendererData->vertexShaderConstantsData, + 0); } return 0; } -static int -D3D12_SetCopyState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) +static int D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) { SDL_Texture *texture = cmd->data.draw.texture; - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *) texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; D3D12_CPU_DESCRIPTOR_HANDLE *textureSampler; switch (textureData->scaleMode) { @@ -2614,8 +2588,8 @@ D3D12_SetCopyState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, const D3D12_TransitionResource(rendererData, textureData->mainTextureV, textureData->mainResourceStateV, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); textureData->mainResourceStateV = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; - return D3D12_SetDrawState(renderer, cmd, shader, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, - SDL_arraysize(shaderResources), shaderResources, textureSampler, matrix); + return D3D12_SetDrawState(renderer, cmd, shader, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, SDL_arraysize(shaderResources), shaderResources, + textureSampler, matrix); } else if (textureData->nv12) { D3D12_CPU_DESCRIPTOR_HANDLE shaderResources[] = { textureData->mainTextureResourceView, @@ -2643,28 +2617,26 @@ D3D12_SetCopyState(SDL_Renderer * renderer, const SDL_RenderCommand *cmd, const D3D12_TransitionResource(rendererData, textureData->mainTextureNV, textureData->mainResourceStateNV, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); textureData->mainResourceStateNV = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; - return D3D12_SetDrawState(renderer, cmd, shader, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, - SDL_arraysize(shaderResources), shaderResources, textureSampler, matrix); + return D3D12_SetDrawState(renderer, cmd, shader, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, SDL_arraysize(shaderResources), shaderResources, + textureSampler, matrix); } #endif /* SDL_HAVE_YUV */ D3D12_TransitionResource(rendererData, textureData->mainTexture, textureData->mainResourceState, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); textureData->mainResourceState = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; - return D3D12_SetDrawState(renderer, cmd, SHADER_RGB, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, - 1, &textureData->mainTextureResourceView, textureSampler, matrix); + return D3D12_SetDrawState(renderer, cmd, SHADER_RGB, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, 1, &textureData->mainTextureResourceView, + textureSampler, matrix); } -static void -D3D12_DrawPrimitives(SDL_Renderer * renderer, D3D12_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) +static void D3D12_DrawPrimitives(SDL_Renderer *renderer, D3D12_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; - D3D_CALL(rendererData->commandList, IASetPrimitiveTopology, primitiveTopology); - D3D_CALL(rendererData->commandList, DrawInstanced, (UINT)vertexCount, 1, (UINT)vertexStart, 0); + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D_CALL(rendererData->commandList, IASetPrimitiveTopology, primitiveTopology); + D3D_CALL(rendererData->commandList, DrawInstanced, (UINT)vertexCount, 1, (UINT)vertexStart, 0); } -static int -D3D12_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D12_RenderData *rendererData = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; const int viewportRotation = D3D12_GetRotationForCurrentRenderTarget(renderer); if (rendererData->currentViewportRotation != viewportRotation) { @@ -2678,99 +2650,112 @@ D3D12_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; /* this isn't currently used in this render backend. */ - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; /* this isn't currently used in this render backend. */ + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &rendererData->currentViewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - rendererData->viewportDirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &rendererData->currentViewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + rendererData->viewportDirty = SDL_TRUE; + rendererData->cliprectDirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (rendererData->currentCliprectEnabled != cmd->data.cliprect.enabled) { - rendererData->currentCliprectEnabled = cmd->data.cliprect.enabled; - rendererData->cliprectDirty = SDL_TRUE; - } - if (!rendererData->currentCliprectEnabled) { - /* If the clip rect is disabled, then the scissor rect should be the whole viewport, - since direct3d12 doesn't allow disabling the scissor rectangle */ - rect = &rendererData->currentViewport; - } - if (SDL_memcmp(&rendererData->currentCliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&rendererData->currentCliprect, rect); - rendererData->cliprectDirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + SDL_Rect viewport_cliprect; + if (rendererData->currentCliprectEnabled != cmd->data.cliprect.enabled) { + rendererData->currentCliprectEnabled = cmd->data.cliprect.enabled; + rendererData->cliprectDirty = SDL_TRUE; } - - case SDL_RENDERCMD_CLEAR: { - const float colorRGBA[] = { - (cmd->data.color.r / 255.0f), - (cmd->data.color.g / 255.0f), - (cmd->data.color.b / 255.0f), - (cmd->data.color.a / 255.0f) - }; - - D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor = D3D12_GetCurrentRenderTargetView(renderer); - D3D_CALL(rendererData->commandList, ClearRenderTargetView, rtvDescriptor, colorRGBA, 0, NULL); - break; + if (!rendererData->currentCliprectEnabled) { + /* If the clip rect is disabled, then the scissor rect should be the whole viewport, + since direct3d12 doesn't allow disabling the scissor rectangle */ + viewport_cliprect.x = 0; + viewport_cliprect.y = 0; + viewport_cliprect.w = rendererData->currentViewport.w; + viewport_cliprect.h = rendererData->currentViewport.h; + rect = &viewport_cliprect; } - - case SDL_RENDERCMD_DRAW_POINTS: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); - D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 0, NULL, NULL, NULL); - D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_POINTLIST, start, count); - break; + if (SDL_memcmp(&rendererData->currentCliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&rendererData->currentCliprect, rect); + rendererData->cliprectDirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_DRAW_LINES: { - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); - const VertexPositionColor *verts = (VertexPositionColor *) (((Uint8 *) vertices) + first); - D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, 0, NULL, NULL, NULL); - D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count); - if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) { - D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_POINTLIST, start + (count-1), 1); - } - break; - } + case SDL_RENDERCMD_CLEAR: + { + const float colorRGBA[] = { + (cmd->data.color.r / 255.0f), + (cmd->data.color.g / 255.0f), + (cmd->data.color.b / 255.0f), + (cmd->data.color.a / 255.0f) + }; + + D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor = D3D12_GetCurrentRenderTargetView(renderer); + D3D_CALL(rendererData->commandList, ClearRenderTargetView, rtvDescriptor, colorRGBA, 0, NULL); + break; + } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + case SDL_RENDERCMD_DRAW_POINTS: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); + D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, 0, NULL, NULL, NULL); + D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_POINTLIST, start, count); + break; + } - case SDL_RENDERCMD_COPY: /* unused */ - break; + case SDL_RENDERCMD_DRAW_LINES: + { + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); + const VertexPositionColor *verts = (VertexPositionColor *)(((Uint8 *)vertices) + first); + D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, 0, NULL, NULL, NULL); + D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, start, count); + if (verts[0].pos.x != verts[count - 1].pos.x || verts[0].pos.y != verts[count - 1].pos.y) { + D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_POINTLIST, start + (count - 1), 1); + } + break; + } - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - case SDL_RENDERCMD_GEOMETRY: { - SDL_Texture *texture = cmd->data.draw.texture; - const size_t count = cmd->data.draw.count; - const size_t first = cmd->data.draw.first; - const size_t start = first / sizeof (VertexPositionColor); + case SDL_RENDERCMD_COPY: /* unused */ + break; - if (texture) { - D3D12_SetCopyState(renderer, cmd, NULL); - } else { - D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, 0, NULL, NULL, NULL); - } + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, start, count); - break; + case SDL_RENDERCMD_GEOMETRY: + { + SDL_Texture *texture = cmd->data.draw.texture; + const size_t count = cmd->data.draw.count; + const size_t first = cmd->data.draw.first; + const size_t start = first / sizeof(VertexPositionColor); + + if (texture) { + D3D12_SetCopyState(renderer, cmd, NULL); + } else { + D3D12_SetDrawState(renderer, cmd, SHADER_SOLID, D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, 0, NULL, NULL, NULL); } - case SDL_RENDERCMD_NO_OP: - break; + D3D12_DrawPrimitives(renderer, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, start, count); + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -2779,11 +2764,10 @@ D3D12_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver return 0; } -static int -D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +static int D3D12_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { - D3D12_RenderData * data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; ID3D12Resource *backBuffer = NULL; ID3D12Resource *readbackBuffer = NULL; HRESULT result; @@ -2791,7 +2775,7 @@ D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, D3D12_RESOURCE_DESC textureDesc; D3D12_RESOURCE_DESC readbackDesc; D3D12_HEAP_PROPERTIES heapProps; - D3D12_RECT srcRect = {0, 0, 0, 0}; + D3D12_RECT srcRect = { 0, 0, 0, 0 }; D3D12_BOX srcBox; D3D12_TEXTURE_COPY_LOCATION dstLocation; D3D12_TEXTURE_COPY_LOCATION srcLocation; @@ -2808,7 +2792,7 @@ D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, /* Create a staging texture to copy the screen's data to: */ SDL_zero(textureDesc); - D3D_CALL_RET(backBuffer, GetDesc, &textureDesc); + D3D_CALL_RET_ID3D12Resource_GetDesc(backBuffer, &textureDesc); textureDesc.Width = rect->w; textureDesc.Height = rect->h; @@ -2826,30 +2810,28 @@ D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, /* Figure out how much we need to allocate for the upload buffer */ D3D_CALL(data->d3dDevice, GetCopyableFootprints, - &textureDesc, - 0, - 1, - 0, - NULL, - NULL, - NULL, - &readbackDesc.Width - ); - + &textureDesc, + 0, + 1, + 0, + NULL, + NULL, + NULL, + &readbackDesc.Width); + SDL_zero(heapProps); heapProps.Type = D3D12_HEAP_TYPE_READBACK; heapProps.CreationNodeMask = 1; heapProps.VisibleNodeMask = 1; result = D3D_CALL(data->d3dDevice, CreateCommittedResource, - &heapProps, - D3D12_HEAP_FLAG_NONE, - &readbackDesc, - D3D12_RESOURCE_STATE_COPY_DEST, - NULL, - D3D_GUID(SDL_IID_ID3D12Resource), - (void **)&readbackBuffer - ); + &heapProps, + D3D12_HEAP_FLAG_NONE, + &readbackDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + D3D_GUID(SDL_IID_ID3D12Resource), + (void **)&readbackBuffer); if (FAILED(result)) { WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Device::CreateTexture2D [create staging texture]"), result); goto done; @@ -2898,27 +2880,25 @@ D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, srcLocation.SubresourceIndex = 0; D3D_CALL(data->commandList, CopyTextureRegion, - &dstLocation, - 0, 0, 0, - &srcLocation, - &srcBox - ); + &dstLocation, + 0, 0, 0, + &srcLocation, + &srcBox); /* We need to issue the command list for the copy to finish */ D3D12_IssueBatch(data); /* Transition the render target back to a render target */ - D3D12_TransitionResource(data, backBuffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET ); + D3D12_TransitionResource(data, backBuffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); /* Map the staging texture's data to CPU-accessible memory: */ result = D3D_CALL(readbackBuffer, Map, - 0, - NULL, - (void **)&textureMemory - ); + 0, + NULL, + (void **)&textureMemory); if (FAILED(result)) { - SAFE_RELEASE(readbackBuffer); - return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result); + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D12Resource::Map [map staging texture]"), result); + goto done; } /* Copy the data into the desired buffer, converting pixels to the @@ -2941,10 +2921,9 @@ D3D12_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -D3D12_RenderPresent(SDL_Renderer * renderer) +static int D3D12_RenderPresent(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) UINT syncInterval; UINT presentFlags; @@ -2953,14 +2932,13 @@ D3D12_RenderPresent(SDL_Renderer * renderer) /* Transition the render target to present state */ D3D12_TransitionResource(data, - data->renderTargets[data->currentBackBufferIndex], - D3D12_RESOURCE_STATE_RENDER_TARGET, - D3D12_RESOURCE_STATE_PRESENT - ); + data->renderTargets[data->currentBackBufferIndex], + D3D12_RESOURCE_STATE_RENDER_TARGET, + D3D12_RESOURCE_STATE_PRESENT); /* Issue the command list */ result = D3D_CALL(data->commandList, Close); - D3D_CALL(data->commandQueue, ExecuteCommandLists, 1, (ID3D12CommandList * const *)&data->commandList); + D3D_CALL(data->commandQueue, ExecuteCommandLists, 1, (ID3D12CommandList *const *)&data->commandList); #if defined(__XBOXONE__) || defined(__XBOXSERIES__) result = D3D12_XBOX_PresentFrame(data->commandQueue, data->frameToken, data->renderTargets[data->currentBackBufferIndex]); @@ -2980,10 +2958,10 @@ D3D12_RenderPresent(SDL_Renderer * renderer) #endif if (FAILED(result) && result != DXGI_ERROR_WAS_STILL_DRAWING) { - /* If the device was removed either by a disconnect or a driver upgrade, we + /* If the device was removed either by a disconnect or a driver upgrade, we * must recreate all device resources. */ - if ( result == DXGI_ERROR_DEVICE_REMOVED ) { + if (result == DXGI_ERROR_DEVICE_REMOVED) { D3D12_HandleDeviceLost(renderer); } else if (result == DXGI_ERROR_INVALID_CALL) { /* We probably went through a fullscreen <-> windowed transition */ @@ -2998,9 +2976,8 @@ D3D12_RenderPresent(SDL_Renderer * renderer) if (D3D_CALL(data->fence, GetCompletedValue) < data->fenceValue) { result = D3D_CALL(data->fence, SetEventOnCompletion, - data->fenceValue, - data->fenceEvent - ); + data->fenceValue, + data->fenceEvent); WaitForSingleObjectEx(data->fenceEvent, INFINITE, FALSE); } @@ -3015,10 +2992,9 @@ D3D12_RenderPresent(SDL_Renderer * renderer) /* Reset the command allocator and command list, and transition back to render target */ D3D12_ResetCommandList(data); D3D12_TransitionResource(data, - data->renderTargets[data->currentBackBufferIndex], - D3D12_RESOURCE_STATE_PRESENT, - D3D12_RESOURCE_STATE_RENDER_TARGET - ); + data->renderTargets[data->currentBackBufferIndex], + D3D12_RESOURCE_STATE_PRESENT, + D3D12_RESOURCE_STATE_RENDER_TARGET); #if defined(__XBOXONE__) || defined(__XBOXSERIES__) D3D12_XBOX_StartFrame(data->d3dDevice, &data->frameToken); @@ -3027,8 +3003,7 @@ D3D12_RenderPresent(SDL_Renderer * renderer) } } -static int -D3D12_SetVSync(SDL_Renderer * renderer, const int vsync) +static int D3D12_SetVSync(SDL_Renderer *renderer, const int vsync) { if (vsync) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; @@ -3038,23 +3013,13 @@ D3D12_SetVSync(SDL_Renderer * renderer, const int vsync) return 0; } -SDL_Renderer * -D3D12_CreateRenderer(SDL_Window * window, Uint32 flags) +int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; D3D12_RenderData *data; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (D3D12_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (D3D12_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { - SDL_free(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } data->identity = MatrixIdentity(); @@ -3073,9 +3038,9 @@ D3D12_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = D3D12_SetTextureScaleMode; renderer->SetRenderTarget = D3D12_SetRenderTarget; renderer->QueueSetViewport = D3D12_QueueSetViewport; - renderer->QueueSetDrawColor = D3D12_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = D3D12_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = D3D12_QueueDrawPoints; - renderer->QueueDrawLines = D3D12_QueueDrawPoints; /* lines and points queue vertices the same way. */ + renderer->QueueDrawLines = D3D12_QueueDrawPoints; /* lines and points queue vertices the same way. */ renderer->QueueGeometry = D3D12_QueueGeometry; renderer->RunCommandQueue = D3D12_RunCommandQueue; renderer->RenderReadPixels = D3D12_RenderReadPixels; @@ -3086,7 +3051,7 @@ D3D12_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); renderer->driverdata = data; - if ((flags & SDL_RENDERER_PRESENTVSYNC)) { + if (flags & SDL_RENDERER_PRESENTVSYNC) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } renderer->SetVSync = D3D12_SetVSync; @@ -3099,14 +3064,14 @@ D3D12_CreateRenderer(SDL_Window * window, Uint32 flags) /* Initialize Direct3D resources */ if (FAILED(D3D12_CreateDeviceResources(renderer))) { D3D12_DestroyRenderer(renderer); - return NULL; + return -1; } if (FAILED(D3D12_CreateWindowSizeDependentResources(renderer))) { D3D12_DestroyRenderer(renderer); - return NULL; + return -1; } - return renderer; + return 0; } SDL_RenderDriver D3D12_RenderDriver = { @@ -3116,19 +3081,17 @@ SDL_RenderDriver D3D12_RenderDriver = { ( SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | - SDL_RENDERER_TARGETTEXTURE - ), /* flags. see SDL_RendererFlags */ - 6, /* num_texture_formats */ - { /* texture_formats */ - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_YV12, - SDL_PIXELFORMAT_IYUV, - SDL_PIXELFORMAT_NV12, - SDL_PIXELFORMAT_NV21 - }, - 16384, /* max_texture_width */ - 16384 /* max_texture_height */ + SDL_RENDERER_TARGETTEXTURE), /* flags. see SDL_RendererFlags */ + 6, /* num_texture_formats */ + { /* texture_formats */ + SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_YV12, + SDL_PIXELFORMAT_IYUV, + SDL_PIXELFORMAT_NV12, + SDL_PIXELFORMAT_NV21 }, + 16384, /* max_texture_width */ + 16384 /* max_texture_height */ } }; @@ -3137,20 +3100,20 @@ SDL_RenderDriver D3D12_RenderDriver = { } #endif -#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D12 */ #if defined(__WIN32__) || defined(__GDK__) #ifdef __cplusplus extern "C" #endif -/* This function needs to always exist on Windows, for the Dynamic API. */ -ID3D12Device * -SDL_RenderGetD3D12Device(SDL_Renderer * renderer) + /* This function needs to always exist on Windows, for the Dynamic API. */ + ID3D12Device * + SDL_RenderGetD3D12Device(SDL_Renderer *renderer) { ID3D12Device *device = NULL; -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED - D3D12_RenderData *data = (D3D12_RenderData *) renderer->driverdata; +#if SDL_VIDEO_RENDER_D3D12 + D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; /* Make sure that this is a D3D renderer */ if (renderer->DestroyRenderer != D3D12_DestroyRenderer) { @@ -3162,7 +3125,7 @@ SDL_RenderGetD3D12Device(SDL_Renderer * renderer) if (device) { D3D_CALL(device, AddRef); } -#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_D3D12 */ return device; } diff --git a/src/render/direct3d12/SDL_render_d3d12_xbox.cpp b/src/render/direct3d12/SDL_render_d3d12_xbox.cpp index db71ebca243f1..4abb1dc23e188 100644 --- a/src/render/direct3d12/SDL_render_d3d12_xbox.cpp +++ b/src/render/direct3d12/SDL_render_d3d12_xbox.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,155 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && (defined(__XBOXONE__) || defined(__XBOXSERIES__)) +#if SDL_VIDEO_RENDER_D3D12 && (defined(__XBOXONE__) || defined(__XBOXSERIES__)) #include "SDL_render_d3d12_xbox.h" +#include "../../core/windows/SDL_windows.h" +#include + +#if defined(_MSC_VER) && !defined(__clang__) +#define SDL_COMPOSE_ERROR(str) __FUNCTION__ ", " str +#else +#define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str +#endif + +static const GUID SDL_IID_ID3D12Device1 = { 0x77acce80, 0x638e, 0x4e65, { 0x88, 0x95, 0xc1, 0xf2, 0x33, 0x86, 0x86, 0x3e } }; +static const GUID SDL_IID_ID3D12Resource = { 0x696442be, 0xa72e, 0x4059, { 0xbc, 0x79, 0x5b, 0x5c, 0x98, 0x04, 0x0f, 0xad } }; +static const GUID SDL_IID_IDXGIDevice1 = { 0x77db970f, 0x6276, 0x48ba, { 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c } }; + +extern "C" HRESULT +D3D12_XBOX_CreateDevice(ID3D12Device **device, SDL_bool createDebug) +{ + HRESULT result; + D3D12XBOX_CREATE_DEVICE_PARAMETERS params; + IDXGIDevice1 *dxgiDevice; + IDXGIAdapter *dxgiAdapter; + IDXGIOutput *dxgiOutput; + SDL_zero(params); + + params.Version = D3D12_SDK_VERSION; + params.ProcessDebugFlags = createDebug ? D3D12_PROCESS_DEBUG_FLAG_DEBUG_LAYER_ENABLED : D3D12XBOX_PROCESS_DEBUG_FLAG_NONE; + params.GraphicsCommandQueueRingSizeBytes = D3D12XBOX_DEFAULT_SIZE_BYTES; + params.GraphicsScratchMemorySizeBytes = D3D12XBOX_DEFAULT_SIZE_BYTES; + params.ComputeScratchMemorySizeBytes = D3D12XBOX_DEFAULT_SIZE_BYTES; + + result = D3D12XboxCreateDevice(NULL, ¶ms, SDL_IID_ID3D12Device1, (void **) device); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] D3D12XboxCreateDevice"), result); + goto done; + } + + result = (*device)->QueryInterface(SDL_IID_IDXGIDevice1, (void **) &dxgiDevice); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] ID3D12Device to IDXGIDevice1"), result); + goto done; + } + + result = dxgiDevice->GetAdapter(&dxgiAdapter); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] dxgiDevice->GetAdapter"), result); + goto done; + } + + result = dxgiAdapter->EnumOutputs(0, &dxgiOutput); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] dxgiAdapter->EnumOutputs"), result); + goto done; + } + + /* Set frame interval */ + result = (*device)->SetFrameIntervalX(dxgiOutput, D3D12XBOX_FRAME_INTERVAL_60_HZ, 1, D3D12XBOX_FRAME_INTERVAL_FLAG_NONE); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] SetFrameIntervalX"), result); + goto done; + } + + result = (*device)->ScheduleFrameEventX(D3D12XBOX_FRAME_EVENT_ORIGIN, 0, NULL, D3D12XBOX_SCHEDULE_FRAME_EVENT_FLAG_NONE); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("[xbox] ScheduleFrameEventX"), result); + goto done; + } + +done: + return result; +} + +extern "C" HRESULT +D3D12_XBOX_CreateBackBufferTarget(ID3D12Device1 *device, int width, int height, void **resource) +{ + + D3D12_HEAP_PROPERTIES heapProps; + D3D12_RESOURCE_DESC resourceDesc; + + SDL_zero(heapProps); + heapProps.Type = D3D12_HEAP_TYPE_DEFAULT; + heapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + heapProps.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + heapProps.CreationNodeMask = 1; + heapProps.VisibleNodeMask = 1; + + SDL_zero(resourceDesc); + resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; + resourceDesc.Alignment = 0; + resourceDesc.Width = width; + resourceDesc.Height = height; + resourceDesc.DepthOrArraySize = 1; + resourceDesc.MipLevels = 1; + resourceDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + resourceDesc.SampleDesc.Count = 1; + resourceDesc.SampleDesc.Quality = 0; + resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; + resourceDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET; + + return device->CreateCommittedResource(&heapProps, + D3D12_HEAP_FLAG_ALLOW_DISPLAY, + &resourceDesc, + D3D12_RESOURCE_STATE_PRESENT, + NULL, + SDL_IID_ID3D12Resource, + resource + ); +} + +extern "C" HRESULT +D3D12_XBOX_StartFrame(ID3D12Device1 *device, UINT64 *outToken) +{ + *outToken = D3D12XBOX_FRAME_PIPELINE_TOKEN_NULL; + return device->WaitFrameEventX(D3D12XBOX_FRAME_EVENT_ORIGIN, INFINITE, NULL, D3D12XBOX_WAIT_FRAME_EVENT_FLAG_NONE, outToken); +} + +extern "C" HRESULT +D3D12_XBOX_PresentFrame(ID3D12CommandQueue *commandQueue, UINT64 token, ID3D12Resource *renderTarget) +{ + D3D12XBOX_PRESENT_PLANE_PARAMETERS planeParameters; + SDL_zero(planeParameters); + planeParameters.Token = token; + planeParameters.ResourceCount = 1; + planeParameters.ppResources = &renderTarget; + return commandQueue->PresentX(1, &planeParameters, NULL); +} + +extern "C" void +D3D12_XBOX_GetResolution(Uint32 *width, Uint32 *height) +{ + switch (XSystemGetDeviceType()) { + case XSystemDeviceType::XboxScarlettLockhart: + *width = 2560; + *height = 1440; + break; + + case XSystemDeviceType::XboxOneX: + case XSystemDeviceType::XboxScarlettAnaconda: + case XSystemDeviceType::XboxOneXDevkit: + case XSystemDeviceType::XboxScarlettDevkit: + *width = 3840; + *height = 2160; + break; + + default: + *width = 1920; + *height = 1080; + break; + } +} -#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info." #endif diff --git a/src/render/direct3d12/SDL_render_d3d12_xbox.h b/src/render/direct3d12/SDL_render_d3d12_xbox.h index 7afec9e48911d..16d22cdc4ad1a 100644 --- a/src/render/direct3d12/SDL_render_d3d12_xbox.h +++ b/src/render/direct3d12/SDL_render_d3d12_xbox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,4 +19,31 @@ 3. This notice may not be removed or altered from any source distribution. */ -#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info." +#ifndef SDL_render_d3d12_xbox_h_ +#define SDL_render_d3d12_xbox_h_ + +#include "../../SDL_internal.h" + +#if defined(__XBOXONE__) +#include +#else /* __XBOXSERIES__ */ +#include +#endif + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +extern HRESULT D3D12_XBOX_CreateDevice(ID3D12Device **device, SDL_bool createDebug); +extern HRESULT D3D12_XBOX_CreateBackBufferTarget(ID3D12Device1 *device, int width, int height, void **resource); +extern HRESULT D3D12_XBOX_StartFrame(ID3D12Device1 *device, UINT64 *outToken); +extern HRESULT D3D12_XBOX_PresentFrame(ID3D12CommandQueue *commandQueue, UINT64 token, ID3D12Resource *renderTarget); +extern void D3D12_XBOX_GetResolution(Uint32 *width, Uint32 *height); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/render/direct3d12/SDL_shaders_d3d12.c b/src/render/direct3d12/SDL_shaders_d3d12.c index 2bb56d5d5932c..20c3167aa6417 100644 --- a/src/render/direct3d12/SDL_shaders_d3d12.c +++ b/src/render/direct3d12/SDL_shaders_d3d12.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if SDL_VIDEO_RENDER_D3D12 && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_stdinc.h" @@ -31,7 +31,6 @@ #define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str - /* Direct3D 12 shaders SDL's shaders are compiled into SDL itself, to simplify distribution. @@ -51,7 +50,7 @@ Shader types: - ps_6_0: Pixel shader - vs_6_0: Vertex shader - + Shader object code was converted to unsigned chars via the following *nix style command (available separately from Windows + MSVC): @@ -1729,7 +1728,7 @@ static unsigned char D3D12_PixelShader_YUV_BT601[] = { float2 tex : TEXCOORD0; float4 color : COLOR0; }; - + #define YUVRS \ "RootFlags ( ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT |" \ " DENY_DOMAIN_SHADER_ROOT_ACCESS |" \ @@ -6770,7 +6769,7 @@ static unsigned char D3D12_VertexShader_NV[] = { /* Root signature blobs extracted from Vertex Shader dxc command line is: dxc -E -T rootsig_1_1 -rootsig-define -Fo D3D12_VertexShader.hlsl - + Variables: - : the root signature define - : the output file name. @@ -6858,78 +6857,57 @@ static struct { const void *ps_shader_data; SIZE_T ps_shader_size; - const void* vs_shader_data; + const void *vs_shader_data; SIZE_T vs_shader_size; D3D12_RootSignature root_sig; } D3D12_shaders[NUM_SHADERS] = { - { - D3D12_PixelShader_Colors, sizeof(D3D12_PixelShader_Colors), - D3D12_VertexShader_Colors, sizeof(D3D12_VertexShader_Colors), - ROOTSIG_COLOR - }, - { - D3D12_PixelShader_Textures, sizeof(D3D12_PixelShader_Textures), - D3D12_VertexShader_Textures, sizeof(D3D12_VertexShader_Textures), - ROOTSIG_TEXTURE - }, + { D3D12_PixelShader_Colors, sizeof(D3D12_PixelShader_Colors), + D3D12_VertexShader_Colors, sizeof(D3D12_VertexShader_Colors), + ROOTSIG_COLOR }, + { D3D12_PixelShader_Textures, sizeof(D3D12_PixelShader_Textures), + D3D12_VertexShader_Textures, sizeof(D3D12_VertexShader_Textures), + ROOTSIG_TEXTURE }, #if SDL_HAVE_YUV - { - D3D12_PixelShader_YUV_JPEG, sizeof(D3D12_PixelShader_YUV_JPEG), - D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), - ROOTSIG_YUV - }, - { - D3D12_PixelShader_YUV_BT601, sizeof(D3D12_PixelShader_YUV_BT601), - D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), - ROOTSIG_YUV - }, - { - D3D12_PixelShader_YUV_BT709, sizeof(D3D12_PixelShader_YUV_BT709), - D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), - ROOTSIG_YUV - }, - { - D3D12_PixelShader_NV12_JPEG, sizeof(D3D12_PixelShader_NV12_JPEG), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, - { - D3D12_PixelShader_NV12_BT601, sizeof(D3D12_PixelShader_NV12_BT601), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, - { - D3D12_PixelShader_NV12_BT709, sizeof(D3D12_PixelShader_NV12_BT709), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, - { - D3D12_PixelShader_NV21_JPEG, sizeof(D3D12_PixelShader_NV21_JPEG), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, - { - D3D12_PixelShader_NV21_BT601, sizeof(D3D12_PixelShader_NV21_BT601), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, - { - D3D12_PixelShader_NV21_BT709, sizeof(D3D12_PixelShader_NV21_BT709), - D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), - ROOTSIG_NV - }, + { D3D12_PixelShader_YUV_JPEG, sizeof(D3D12_PixelShader_YUV_JPEG), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT601, sizeof(D3D12_PixelShader_YUV_BT601), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT709, sizeof(D3D12_PixelShader_YUV_BT709), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_NV12_JPEG, sizeof(D3D12_PixelShader_NV12_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT601, sizeof(D3D12_PixelShader_NV12_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT709, sizeof(D3D12_PixelShader_NV12_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_JPEG, sizeof(D3D12_PixelShader_NV21_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT601, sizeof(D3D12_PixelShader_NV21_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT709, sizeof(D3D12_PixelShader_NV21_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, #endif }; -static struct { - const void* rs_shader_data; +static struct +{ + const void *rs_shader_data; SIZE_T rs_shader_size; } D3D12_rootsigs[NUM_ROOTSIGS] = { - {D3D12_RootSig_Color, sizeof(D3D12_RootSig_Color)}, - {D3D12_RootSig_Texture, sizeof(D3D12_RootSig_Texture)}, + { D3D12_RootSig_Color, sizeof(D3D12_RootSig_Color) }, + { D3D12_RootSig_Texture, sizeof(D3D12_RootSig_Texture) }, #if SDL_HAVE_YUV - {D3D12_RootSig_YUV, sizeof(D3D12_RootSig_YUV)}, - {D3D12_RootSig_NV, sizeof(D3D12_RootSig_NV)}, + { D3D12_RootSig_YUV, sizeof(D3D12_RootSig_YUV) }, + { D3D12_RootSig_NV, sizeof(D3D12_RootSig_NV) }, #endif }; @@ -6956,6 +6934,6 @@ void D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECO outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size; } -#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) */ +#endif /* SDL_VIDEO_RENDER_D3D12 && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d12/SDL_shaders_d3d12.h b/src/render/direct3d12/SDL_shaders_d3d12.h index e56c5ccf2e205..50920b137fa1c 100644 --- a/src/render/direct3d12/SDL_shaders_d3d12.h +++ b/src/render/direct3d12/SDL_shaders_d3d12.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,8 @@ extern "C" { #endif -typedef enum { +typedef enum +{ SHADER_SOLID, SHADER_RGB, #if SDL_HAVE_YUV @@ -44,7 +45,8 @@ typedef enum { NUM_SHADERS } D3D12_Shader; -typedef enum { +typedef enum +{ ROOTSIG_COLOR, ROOTSIG_TEXTURE, #if SDL_HAVE_YUV @@ -57,7 +59,7 @@ typedef enum { extern void D3D12_GetVertexShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode); extern void D3D12_GetPixelShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode); extern D3D12_RootSignature D3D12_GetRootSignatureType(D3D12_Shader shader); -extern void D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE* outBytecode); +extern void D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE *outBytecode); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp b/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp index 8af238ebfa878..ac90574cf6dd0 100644 --- a/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp +++ b/src/render/direct3d12/SDL_shaders_d3d12_xboxone.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,10 +20,125 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(__XBOXONE__) +#if SDL_VIDEO_RENDER_D3D12 && defined(__XBOXONE__) -#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info." +#include -#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(__XBOXONE__) */ +#include "../../core/windows/SDL_windows.h" +#include + +#include "SDL_shaders_d3d12.h" + +#define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str + +/* Shader blob headers are generated with a pre-build step using buildshaders.bat */ +#include "../VisualC-GDK/shaders/D3D12_PixelShader_Colors_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_Textures_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709_One.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG_One.h" + +#include "../VisualC-GDK/shaders/D3D12_VertexShader_Color_One.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_NV_One.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_Texture_One.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_YUV_One.h" + +#include "../VisualC-GDK/shaders/D3D12_RootSig_Color_One.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_NV_One.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_Texture_One.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_YUV_One.h" + +static struct +{ + const void *ps_shader_data; + SIZE_T ps_shader_size; + const void *vs_shader_data; + SIZE_T vs_shader_size; + D3D12_RootSignature root_sig; +} D3D12_shaders[NUM_SHADERS] = { + { D3D12_PixelShader_Colors, sizeof(D3D12_PixelShader_Colors), + D3D12_VertexShader_Color, sizeof(D3D12_VertexShader_Color), + ROOTSIG_COLOR }, + { D3D12_PixelShader_Textures, sizeof(D3D12_PixelShader_Textures), + D3D12_VertexShader_Texture, sizeof(D3D12_VertexShader_Texture), + ROOTSIG_TEXTURE }, +#if SDL_HAVE_YUV + { D3D12_PixelShader_YUV_JPEG, sizeof(D3D12_PixelShader_YUV_JPEG), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT601, sizeof(D3D12_PixelShader_YUV_BT601), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT709, sizeof(D3D12_PixelShader_YUV_BT709), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_NV12_JPEG, sizeof(D3D12_PixelShader_NV12_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT601, sizeof(D3D12_PixelShader_NV12_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT709, sizeof(D3D12_PixelShader_NV12_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_JPEG, sizeof(D3D12_PixelShader_NV21_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT601, sizeof(D3D12_PixelShader_NV21_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT709, sizeof(D3D12_PixelShader_NV21_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, +#endif +}; + +static struct +{ + const void *rs_shader_data; + SIZE_T rs_shader_size; +} D3D12_rootsigs[NUM_ROOTSIGS] = { + { D3D12_RootSig_Color, sizeof(D3D12_RootSig_Color) }, + { D3D12_RootSig_Texture, sizeof(D3D12_RootSig_Texture) }, +#if SDL_HAVE_YUV + { D3D12_RootSig_YUV, sizeof(D3D12_RootSig_YUV) }, + { D3D12_RootSig_NV, sizeof(D3D12_RootSig_NV) }, +#endif +}; + +extern "C" void +D3D12_GetVertexShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_shaders[shader].vs_shader_data; + outBytecode->BytecodeLength = D3D12_shaders[shader].vs_shader_size; +} + +extern "C" void +D3D12_GetPixelShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_shaders[shader].ps_shader_data; + outBytecode->BytecodeLength = D3D12_shaders[shader].ps_shader_size; +} + +extern "C" D3D12_RootSignature +D3D12_GetRootSignatureType(D3D12_Shader shader) +{ + return D3D12_shaders[shader].root_sig; +} + +extern "C" void +D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_rootsigs[rootSig].rs_shader_data; + outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size; +} + +#endif /* SDL_VIDEO_RENDER_D3D12 && defined(__XBOXONE__) */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/direct3d12/SDL_shaders_d3d12_xboxseries.cpp b/src/render/direct3d12/SDL_shaders_d3d12_xboxseries.cpp index 768ff6bec7fad..b48ae188bc0e8 100644 --- a/src/render/direct3d12/SDL_shaders_d3d12_xboxseries.cpp +++ b/src/render/direct3d12/SDL_shaders_d3d12_xboxseries.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,10 +20,125 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(__XBOXSERIES__) +#if SDL_VIDEO_RENDER_D3D12 && defined(__XBOXSERIES__) -#error "This is a placeholder Xbox file, as the real one is under NDA. See README-gdk.md for more info." +#include -#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(__XBOXSERIES__) */ +#include "../../core/windows/SDL_windows.h" +#include + +#include "SDL_shaders_d3d12.h" + +#define SDL_COMPOSE_ERROR(str) SDL_STRINGIFY_ARG(__FUNCTION__) ", " str + +/* Shader blob headers are generated with a pre-build step using buildshaders.bat */ +#include "../VisualC-GDK/shaders/D3D12_PixelShader_Colors_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_Textures_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT601_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_BT709_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV12_JPEG_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT601_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_BT709_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_NV21_JPEG_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT601_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_BT709_Series.h" +#include "../VisualC-GDK/shaders/D3D12_PixelShader_YUV_JPEG_Series.h" + +#include "../VisualC-GDK/shaders/D3D12_VertexShader_Color_Series.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_Texture_Series.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_NV_Series.h" +#include "../VisualC-GDK/shaders/D3D12_VertexShader_YUV_Series.h" + +#include "../VisualC-GDK/shaders/D3D12_RootSig_Color_Series.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_Texture_Series.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_YUV_Series.h" +#include "../VisualC-GDK/shaders/D3D12_RootSig_NV_Series.h" + +static struct +{ + const void *ps_shader_data; + SIZE_T ps_shader_size; + const void *vs_shader_data; + SIZE_T vs_shader_size; + D3D12_RootSignature root_sig; +} D3D12_shaders[NUM_SHADERS] = { + { D3D12_PixelShader_Colors, sizeof(D3D12_PixelShader_Colors), + D3D12_VertexShader_Color, sizeof(D3D12_VertexShader_Color), + ROOTSIG_COLOR }, + { D3D12_PixelShader_Textures, sizeof(D3D12_PixelShader_Textures), + D3D12_VertexShader_Texture, sizeof(D3D12_VertexShader_Texture), + ROOTSIG_TEXTURE }, +#if SDL_HAVE_YUV + { D3D12_PixelShader_YUV_JPEG, sizeof(D3D12_PixelShader_YUV_JPEG), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT601, sizeof(D3D12_PixelShader_YUV_BT601), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_YUV_BT709, sizeof(D3D12_PixelShader_YUV_BT709), + D3D12_VertexShader_YUV, sizeof(D3D12_VertexShader_YUV), + ROOTSIG_YUV }, + { D3D12_PixelShader_NV12_JPEG, sizeof(D3D12_PixelShader_NV12_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT601, sizeof(D3D12_PixelShader_NV12_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV12_BT709, sizeof(D3D12_PixelShader_NV12_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_JPEG, sizeof(D3D12_PixelShader_NV21_JPEG), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT601, sizeof(D3D12_PixelShader_NV21_BT601), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, + { D3D12_PixelShader_NV21_BT709, sizeof(D3D12_PixelShader_NV21_BT709), + D3D12_VertexShader_NV, sizeof(D3D12_VertexShader_NV), + ROOTSIG_NV }, +#endif +}; + +static struct +{ + const void *rs_shader_data; + SIZE_T rs_shader_size; +} D3D12_rootsigs[NUM_ROOTSIGS] = { + { D3D12_RootSig_Color, sizeof(D3D12_RootSig_Color) }, + { D3D12_RootSig_Texture, sizeof(D3D12_RootSig_Texture) }, +#if SDL_HAVE_YUV + { D3D12_RootSig_YUV, sizeof(D3D12_RootSig_YUV) }, + { D3D12_RootSig_NV, sizeof(D3D12_RootSig_NV) }, +#endif +}; + +extern "C" void +D3D12_GetVertexShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_shaders[shader].vs_shader_data; + outBytecode->BytecodeLength = D3D12_shaders[shader].vs_shader_size; +} + +extern "C" void +D3D12_GetPixelShader(D3D12_Shader shader, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_shaders[shader].ps_shader_data; + outBytecode->BytecodeLength = D3D12_shaders[shader].ps_shader_size; +} + +extern "C" D3D12_RootSignature +D3D12_GetRootSignatureType(D3D12_Shader shader) +{ + return D3D12_shaders[shader].root_sig; +} + +extern "C" void +D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE *outBytecode) +{ + outBytecode->pShaderBytecode = D3D12_rootsigs[rootSig].rs_shader_data; + outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size; +} + +#endif /* SDL_VIDEO_RENDER_D3D12 && defined(__XBOXSERIES__) */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 80fd96f075429..246af41bde55b 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_METAL && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_METAL #include "SDL_hints.h" #include "SDL_syswm.h" @@ -159,8 +159,7 @@ @interface METAL_TextureData : NSObject @implementation METAL_TextureData @end -static int -IsMetalAvailable(const SDL_SysWMinfo *syswm) +static int IsMetalAvailable(const SDL_SysWMinfo *syswm) { if (syswm->subsystem != SDL_SYSWM_COCOA && syswm->subsystem != SDL_SYSWM_UIKIT) { return SDL_SetError("Metal render target only supports Cocoa and UIKit video targets at the moment."); @@ -179,8 +178,7 @@ @implementation METAL_TextureData static const MTLBlendOperation invalidBlendOperation = (MTLBlendOperation)0xFFFFFFFF; static const MTLBlendFactor invalidBlendFactor = (MTLBlendFactor)0xFFFFFFFF; -static MTLBlendOperation -GetBlendOperation(SDL_BlendOperation operation) +static MTLBlendOperation GetBlendOperation(SDL_BlendOperation operation) { switch (operation) { case SDL_BLENDOPERATION_ADD: return MTLBlendOperationAdd; @@ -192,8 +190,7 @@ @implementation METAL_TextureData } } -static MTLBlendFactor -GetBlendFactor(SDL_BlendFactor factor) +static MTLBlendFactor GetBlendFactor(SDL_BlendFactor factor) { switch (factor) { case SDL_BLENDFACTOR_ZERO: return MTLBlendFactorZero; @@ -210,8 +207,7 @@ @implementation METAL_TextureData } } -static NSString * -GetVertexFunctionName(SDL_MetalVertexFunction function) +static NSString *GetVertexFunctionName(SDL_MetalVertexFunction function) { switch (function) { case SDL_METAL_VERTEX_SOLID: return @"SDL_Solid_vertex"; @@ -220,8 +216,7 @@ @implementation METAL_TextureData } } -static NSString * -GetFragmentFunctionName(SDL_MetalFragmentFunction function) +static NSString *GetFragmentFunctionName(SDL_MetalFragmentFunction function) { switch (function) { case SDL_METAL_FRAGMENT_SOLID: return @"SDL_Solid_fragment"; @@ -233,9 +228,7 @@ @implementation METAL_TextureData } } -static id -MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache, - NSString *blendlabel, SDL_BlendMode blendmode) +static id MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache, NSString *blendlabel, SDL_BlendMode blendmode) { MTLRenderPipelineDescriptor *mtlpipedesc; MTLVertexDescriptor *vertdesc; @@ -259,7 +252,7 @@ @implementation METAL_TextureData switch (cache->vertexFunction) { case SDL_METAL_VERTEX_SOLID: /* position (float2), color (uchar4normalized) */ - vertdesc.layouts[0].stride = sizeof(float) * 2 + sizeof (int); + vertdesc.layouts[0].stride = sizeof(float) * 2 + sizeof(int); vertdesc.layouts[0].stepFunction = MTLVertexStepFunctionPerVertex; vertdesc.attributes[0].format = MTLVertexFormatFloat2; @@ -267,13 +260,13 @@ @implementation METAL_TextureData vertdesc.attributes[0].bufferIndex = 0; vertdesc.attributes[1].format = MTLVertexFormatUChar4Normalized; - vertdesc.attributes[1].offset = sizeof (float) * 2; + vertdesc.attributes[1].offset = sizeof(float) * 2; vertdesc.attributes[1].bufferIndex = 0; break; case SDL_METAL_VERTEX_COPY: /* position (float2), color (uchar4normalized), texcoord (float2) */ - vertdesc.layouts[0].stride = sizeof(float) * 2 + sizeof (int) + sizeof (float) * 2; + vertdesc.layouts[0].stride = sizeof(float) * 2 + sizeof(int) + sizeof(float) * 2; vertdesc.layouts[0].stepFunction = MTLVertexStepFunctionPerVertex; vertdesc.attributes[0].format = MTLVertexFormatFloat2; @@ -281,11 +274,11 @@ @implementation METAL_TextureData vertdesc.attributes[0].bufferIndex = 0; vertdesc.attributes[1].format = MTLVertexFormatUChar4Normalized; - vertdesc.attributes[1].offset = sizeof (float) * 2; + vertdesc.attributes[1].offset = sizeof(float) * 2; vertdesc.attributes[1].bufferIndex = 0; vertdesc.attributes[2].format = MTLVertexFormatFloat2; - vertdesc.attributes[2].offset = sizeof(float) * 2 + sizeof (int); + vertdesc.attributes[2].offset = sizeof(float) * 2 + sizeof(int); vertdesc.attributes[2].bufferIndex = 0; break; } @@ -328,8 +321,7 @@ @implementation METAL_TextureData } } -static void -MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char *label, +static void MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char *label, MTLPixelFormat rtformat, SDL_MetalVertexFunction vertfn, SDL_MetalFragmentFunction fragfn) { SDL_zerop(cache); @@ -348,8 +340,7 @@ @implementation METAL_TextureData MakePipelineState(data, cache, @" (blend=mul)", SDL_BLENDMODE_MUL); } -static void -DestroyPipelineCache(METAL_PipelineCache *cache) +static void DestroyPipelineCache(METAL_PipelineCache *cache) { if (cache != NULL) { for (int i = 0; i < cache->count; i++) { @@ -360,8 +351,7 @@ @implementation METAL_TextureData } } -void -MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MTLPixelFormat rtformat) +static void MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MTLPixelFormat rtformat) { SDL_zerop(pipelines); @@ -374,8 +364,7 @@ @implementation METAL_TextureData MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_NV21], "SDL NV21 pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_NV21); } -static METAL_ShaderPipelines * -ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat) +static METAL_ShaderPipelines *ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat) { METAL_ShaderPipelines *allpipelines = data.allpipelines; int count = data.pipelinescount; @@ -401,8 +390,7 @@ @implementation METAL_TextureData return &data.allpipelines[count]; } -static void -DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count) +static void DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count) { if (allpipelines != NULL) { for (int i = 0; i < count; i++) { @@ -415,8 +403,7 @@ @implementation METAL_TextureData } } -static inline id -ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SDL_MetalFragmentFunction fragfn, SDL_BlendMode blendmode) +static inline id ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SDL_MetalFragmentFunction fragfn, SDL_BlendMode blendmode) { METAL_PipelineCache *cache = &pipelines->caches[fragfn]; @@ -429,8 +416,7 @@ @implementation METAL_TextureData return MakePipelineState(data, cache, [NSString stringWithFormat:@" (blend=custom 0x%x)", blendmode], blendmode); } -static SDL_bool -METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load, MTLClearColor *clear_color, id vertex_buffer) +static SDL_bool METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load, MTLClearColor *clear_color, id vertex_buffer) { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -497,13 +483,11 @@ @implementation METAL_TextureData return SDL_TRUE; } -static void -METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) { } -static int -METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; if (w) { @@ -515,8 +499,7 @@ @implementation METAL_TextureData return 0; }} -static SDL_bool -METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) { SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -536,8 +519,7 @@ @implementation METAL_TextureData return SDL_TRUE; } -static int -METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; MTLPixelFormat pixfmt; @@ -645,8 +627,7 @@ @implementation METAL_TextureData return 0; }} -static void -METAL_UploadTextureData(id texture, SDL_Rect rect, int slice, +static void METAL_UploadTextureData(id texture, SDL_Rect rect, int slice, const void * pixels, int pitch) { [texture replaceRegion:MTLRegionMake2D(rect.x, rect.y, rect.w, rect.h) @@ -657,8 +638,7 @@ @implementation METAL_TextureData bytesPerImage:0]; } -static MTLStorageMode -METAL_GetStorageMode(id resource) +static MTLStorageMode METAL_GetStorageMode(id resource) { /* iOS 8 does not have this method. */ if ([resource respondsToSelector:@selector(storageMode)]) { @@ -667,8 +647,7 @@ @implementation METAL_TextureData return MTLStorageModeShared; } -static int -METAL_UpdateTextureInternal(SDL_Renderer * renderer, METAL_TextureData *texturedata, +static int METAL_UpdateTextureInternal(SDL_Renderer * renderer, METAL_TextureData *texturedata, id texture, SDL_Rect rect, int slice, const void * pixels, int pitch) { @@ -736,8 +715,7 @@ @implementation METAL_TextureData return 0; } -static int -METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, +static int METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) { @autoreleasepool { METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; @@ -782,8 +760,7 @@ @implementation METAL_TextureData }} #if SDL_HAVE_YUV -static int -METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, +static int METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, @@ -814,8 +791,7 @@ @implementation METAL_TextureData return 0; }} -static int -METAL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, +static int METAL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) @@ -842,8 +818,7 @@ @implementation METAL_TextureData }} #endif -static int -METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, +static int METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, void **pixels, int *pitch) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -877,8 +852,7 @@ @implementation METAL_TextureData return 0; }} -static void -METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; @@ -961,8 +935,7 @@ @implementation METAL_TextureData texturedata.hasdata = YES; }} -static void -METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; @@ -974,8 +947,7 @@ @implementation METAL_TextureData } }} -static int -METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -996,13 +968,12 @@ @implementation METAL_TextureData }} -static int -METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) { float projection[4][4]; /* Prepare an orthographic projection */ const int w = cmd->data.viewport.rect.w; const int h = cmd->data.viewport.rect.h; - const size_t matrixlen = sizeof (projection); + const size_t matrixlen = sizeof(projection); float *matrix = (float *) SDL_AllocateRenderVertices(renderer, matrixlen, CONSTANT_ALIGN(16), &cmd->data.viewport.first); if (!matrix) { return -1; @@ -1021,16 +992,15 @@ @implementation METAL_TextureData return 0; } -static int -METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - const size_t vertlen = sizeof (float) * 4; + const size_t vertlen = sizeof(float) * 4; float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(16), &cmd->data.color.first); if (!verts) { return -1; } /* - * FIXME: not needed anymore, some cleanup to do + * FIXME: not needed anymore, some cleanup to do * *(verts++) = ((float)cmd->data.color.r) / 255.0f; *(verts++) = ((float)cmd->data.color.g) / 255.0f; @@ -1040,8 +1010,7 @@ @implementation METAL_TextureData return 0; } -static int -METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) { const SDL_Color color = { cmd->data.draw.r, @@ -1050,7 +1019,7 @@ @implementation METAL_TextureData cmd->data.draw.a }; - const size_t vertlen = (2 * sizeof (float) + sizeof (SDL_Color)) * count; + const size_t vertlen = (2 * sizeof(float) + sizeof(SDL_Color)) * count; float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(8), &cmd->data.draw.first); if (!verts) { return -1; @@ -1065,8 +1034,7 @@ @implementation METAL_TextureData return 0; } -static int -METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) { const SDL_Color color = { cmd->data.draw.r, @@ -1079,7 +1047,7 @@ @implementation METAL_TextureData SDL_assert(count >= 2); /* should have been checked at the higher level. */ - vertlen = (2 * sizeof (float) + sizeof (SDL_Color)) * count; + vertlen = (2 * sizeof(float) + sizeof(SDL_Color)) * count; verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(8), &cmd->data.draw.first); if (!verts) { return -1; @@ -1119,14 +1087,13 @@ @implementation METAL_TextureData return 0; } -static int -METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, +static int METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices, float scale_x, float scale_y) { int count = indices ? num_indices : num_vertices; - const size_t vertlen = (2 * sizeof (float) + sizeof (int) + (texture ? 2 : 0) * sizeof (float)) * count; + const size_t vertlen = (2 * sizeof(float) + sizeof(int) + (texture ? 2 : 0) * sizeof(float)) * count; float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(8), &cmd->data.draw.first); if (!verts) { return -1; @@ -1181,8 +1148,7 @@ @implementation METAL_TextureData size_t color_offset; } METAL_DrawStateCache; -static SDL_bool -SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_MetalFragmentFunction shader, +static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_MetalFragmentFunction shader, const size_t constants_offset, id mtlbufvertex, METAL_DrawStateCache *statecache) { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -1262,8 +1228,7 @@ @implementation METAL_TextureData return SDL_TRUE; } -static SDL_bool -SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t constants_offset, +static SDL_bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t constants_offset, id mtlbufvertex, METAL_DrawStateCache *statecache) { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -1295,8 +1260,7 @@ @implementation METAL_TextureData return SDL_TRUE; } -static int -METAL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int METAL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; id mtlbufvertex = nil; @@ -1338,7 +1302,7 @@ @implementation METAL_TextureData while (cmd) { switch (cmd->command) { case SDL_RENDERCMD_SETVIEWPORT: { - SDL_memcpy(&statecache.viewport, &cmd->data.viewport.rect, sizeof (statecache.viewport)); + SDL_memcpy(&statecache.viewport, &cmd->data.viewport.rect, sizeof(statecache.viewport)); statecache.projection_offset = cmd->data.viewport.first; statecache.viewport_dirty = SDL_TRUE; statecache.cliprect_dirty = SDL_TRUE; @@ -1346,7 +1310,7 @@ @implementation METAL_TextureData } case SDL_RENDERCMD_SETCLIPRECT: { - SDL_memcpy(&statecache.cliprect, &cmd->data.cliprect.rect, sizeof (statecache.cliprect)); + SDL_memcpy(&statecache.cliprect, &cmd->data.cliprect.rect, sizeof(statecache.cliprect)); statecache.cliprect_enabled = cmd->data.cliprect.enabled; statecache.cliprect_dirty = SDL_TRUE; break; @@ -1437,8 +1401,7 @@ @implementation METAL_TextureData return 0; }} -static int -METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, +static int METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 pixel_format, void * pixels, int pitch) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; @@ -1490,8 +1453,7 @@ @implementation METAL_TextureData return status; }} -static int -METAL_RenderPresent(SDL_Renderer * renderer) +static int METAL_RenderPresent(SDL_Renderer * renderer) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; SDL_bool ready = SDL_TRUE; @@ -1528,15 +1490,13 @@ @implementation METAL_TextureData return 0; }} -static void -METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { @autoreleasepool { CFBridgingRelease(texture->driverdata); texture->driverdata = NULL; }} -static void -METAL_DestroyRenderer(SDL_Renderer * renderer) +static void METAL_DestroyRenderer(SDL_Renderer * renderer) { @autoreleasepool { if (renderer->driverdata) { METAL_RenderData *data = CFBridgingRelease(renderer->driverdata); @@ -1553,19 +1513,15 @@ in case we want to use it later (recreating the renderer) /* SDL_Metal_DestroyView(data.mtlview); */ CFBridgingRelease(data.mtlview); } - - SDL_free(renderer); }} -static void * -METAL_GetMetalLayer(SDL_Renderer * renderer) +static void *METAL_GetMetalLayer(SDL_Renderer * renderer) { @autoreleasepool { METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata; return (__bridge void*)data.mtllayer; }} -static void * -METAL_GetMetalCommandEncoder(SDL_Renderer * renderer) +static void *METAL_GetMetalCommandEncoder(SDL_Renderer * renderer) { @autoreleasepool { // note that data.mtlcmdencoder can be nil if METAL_ActivateRenderCommandEncoder fails. // Before SDL 2.0.18, it might have returned a non-nil encoding that might not have been @@ -1576,8 +1532,7 @@ in case we want to use it later (recreating the renderer) return (__bridge void*)data.mtlcmdencoder; }} -static int -METAL_SetVSync(SDL_Renderer * renderer, const int vsync) +static int METAL_SetVSync(SDL_Renderer * renderer, const int vsync) { #if (defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13)) || TARGET_OS_MACCATALYST if (@available(macOS 10.13, *)) { @@ -1623,10 +1578,8 @@ static SDL_MetalView GetWindowView(SDL_Window *window) return nil; } -static SDL_Renderer * -METAL_CreateRenderer(SDL_Window * window, Uint32 flags) +static int METAL_CreateRenderer(SDL_Renderer *renderer, SDL_Window * window, Uint32 flags) { @autoreleasepool { - SDL_Renderer *renderer = NULL; METAL_RenderData *data = NULL; id mtldevice = nil; SDL_MetalView view = NULL; @@ -1685,26 +1638,32 @@ static SDL_MetalView GetWindowView(SDL_Window *window) SDL_VERSION(&syswm.version); if (!SDL_GetWindowWMInfo(window, &syswm)) { - return NULL; + return -1; } if (IsMetalAvailable(&syswm) == -1) { - return NULL; + return -1; } - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; +#ifdef __MACOSX__ + if (SDL_GetHintBoolean(SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE, SDL_TRUE)) { + NSArray> *devices = MTLCopyAllDevices(); + + for (id device in devices) { + if (device.isLowPower) { + mtldevice = device; + break; + } + } } +#endif - // !!! FIXME: MTLCopyAllDevices() can find other GPUs on macOS... - mtldevice = MTLCreateSystemDefaultDevice(); + if (mtldevice == nil) { + mtldevice = MTLCreateSystemDefaultDevice(); + } if (mtldevice == nil) { - SDL_free(renderer); - SDL_SetError("Failed to obtain Metal device"); - return NULL; + return SDL_SetError("Failed to obtain Metal device"); } view = GetWindowView(window); @@ -1713,8 +1672,7 @@ static SDL_MetalView GetWindowView(SDL_Window *window) } if (view == NULL) { - SDL_free(renderer); - return NULL; + return -1; } // !!! FIXME: error checking on all of this. @@ -1726,8 +1684,7 @@ in case we want to use it later (recreating the renderer) */ /* SDL_Metal_DestroyView(view); */ CFBridgingRelease(view); - SDL_free(renderer); - return NULL; + return -1; } renderer->driverdata = (void*)CFBridgingRetain(data); @@ -1905,7 +1862,7 @@ in case we want to use it later (recreating the renderer) renderer->info.max_texture_width = maxtexsize; renderer->info.max_texture_height = maxtexsize; - return renderer; + return 0; }} SDL_RenderDriver METAL_RenderDriver = { @@ -1926,6 +1883,6 @@ in case we want to use it later (recreating the renderer) } }; -#endif /* SDL_VIDEO_RENDER_METAL && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_METAL */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_glfuncs.h b/src/render/opengl/SDL_glfuncs.h index acdcf8803e1f7..273d84d4d883a 100644 --- a/src/render/opengl/SDL_glfuncs.h +++ b/src/render/opengl/SDL_glfuncs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ If you need to use a GL function from the SDL video subsystem, change its entry from SDL_PROC_UNUSED to SDL_PROC and rebuild. */ -#define SDL_PROC_UNUSED(ret,func,params) +#define SDL_PROC_UNUSED(ret, func, params) SDL_PROC_UNUSED(void, glAccum, (GLenum, GLfloat)) SDL_PROC_UNUSED(void, glAlphaFunc, (GLenum, GLclampf)) @@ -74,21 +74,21 @@ SDL_PROC_UNUSED(void, glColor4iv, (const GLint *)) SDL_PROC_UNUSED(void, glColor4s, (GLshort, GLshort, GLshort, GLshort)) SDL_PROC_UNUSED(void, glColor4sv, (const GLshort *)) SDL_PROC(void, glColor4ub, - (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) -SDL_PROC_UNUSED(void, glColor4ubv, (const GLubyte * v)) + (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)) +SDL_PROC_UNUSED(void, glColor4ubv, (const GLubyte *v)) SDL_PROC_UNUSED(void, glColor4ui, (GLuint red, GLuint green, GLuint blue, GLuint alpha)) -SDL_PROC_UNUSED(void, glColor4uiv, (const GLuint * v)) +SDL_PROC_UNUSED(void, glColor4uiv, (const GLuint *v)) SDL_PROC_UNUSED(void, glColor4us, (GLushort red, GLushort green, GLushort blue, GLushort alpha)) -SDL_PROC_UNUSED(void, glColor4usv, (const GLushort * v)) +SDL_PROC_UNUSED(void, glColor4usv, (const GLushort *v)) SDL_PROC_UNUSED(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)) SDL_PROC_UNUSED(void, glColorMaterial, (GLenum face, GLenum mode)) SDL_PROC(void, glColorPointer, - (GLint size, GLenum type, GLsizei stride, - const GLvoid * pointer)) + (GLint size, GLenum type, GLsizei stride, + const GLvoid *pointer)) SDL_PROC_UNUSED(void, glCopyPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)) @@ -106,7 +106,7 @@ SDL_PROC_UNUSED(void, glCopyTexSubImage2D, GLint x, GLint y, GLsizei width, GLsizei height)) SDL_PROC_UNUSED(void, glCullFace, (GLenum mode)) SDL_PROC_UNUSED(void, glDeleteLists, (GLuint list, GLsizei range)) -SDL_PROC(void, glDeleteTextures, (GLsizei n, const GLuint * textures)) +SDL_PROC(void, glDeleteTextures, (GLsizei n, const GLuint *textures)) SDL_PROC(void, glDepthFunc, (GLenum func)) SDL_PROC_UNUSED(void, glDepthMask, (GLboolean flag)) SDL_PROC_UNUSED(void, glDepthRange, (GLclampd zNear, GLclampd zFar)) @@ -116,141 +116,141 @@ SDL_PROC(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count)) SDL_PROC_UNUSED(void, glDrawBuffer, (GLenum mode)) SDL_PROC_UNUSED(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices)) + const GLvoid *indices)) SDL_PROC(void, glDrawPixels, (GLsizei width, GLsizei height, GLenum format, GLenum type, - const GLvoid * pixels)) + const GLvoid *pixels)) SDL_PROC_UNUSED(void, glEdgeFlag, (GLboolean flag)) SDL_PROC_UNUSED(void, glEdgeFlagPointer, - (GLsizei stride, const GLvoid * pointer)) -SDL_PROC_UNUSED(void, glEdgeFlagv, (const GLboolean * flag)) + (GLsizei stride, const GLvoid *pointer)) +SDL_PROC_UNUSED(void, glEdgeFlagv, (const GLboolean *flag)) SDL_PROC(void, glEnable, (GLenum cap)) SDL_PROC(void, glEnableClientState, (GLenum array)) SDL_PROC(void, glEnd, (void)) SDL_PROC_UNUSED(void, glEndList, (void)) SDL_PROC_UNUSED(void, glEvalCoord1d, (GLdouble u)) -SDL_PROC_UNUSED(void, glEvalCoord1dv, (const GLdouble * u)) +SDL_PROC_UNUSED(void, glEvalCoord1dv, (const GLdouble *u)) SDL_PROC_UNUSED(void, glEvalCoord1f, (GLfloat u)) -SDL_PROC_UNUSED(void, glEvalCoord1fv, (const GLfloat * u)) +SDL_PROC_UNUSED(void, glEvalCoord1fv, (const GLfloat *u)) SDL_PROC_UNUSED(void, glEvalCoord2d, (GLdouble u, GLdouble v)) -SDL_PROC_UNUSED(void, glEvalCoord2dv, (const GLdouble * u)) +SDL_PROC_UNUSED(void, glEvalCoord2dv, (const GLdouble *u)) SDL_PROC_UNUSED(void, glEvalCoord2f, (GLfloat u, GLfloat v)) -SDL_PROC_UNUSED(void, glEvalCoord2fv, (const GLfloat * u)) +SDL_PROC_UNUSED(void, glEvalCoord2fv, (const GLfloat *u)) SDL_PROC_UNUSED(void, glEvalMesh1, (GLenum mode, GLint i1, GLint i2)) SDL_PROC_UNUSED(void, glEvalMesh2, (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)) SDL_PROC_UNUSED(void, glEvalPoint1, (GLint i)) SDL_PROC_UNUSED(void, glEvalPoint2, (GLint i, GLint j)) SDL_PROC_UNUSED(void, glFeedbackBuffer, - (GLsizei size, GLenum type, GLfloat * buffer)) + (GLsizei size, GLenum type, GLfloat *buffer)) SDL_PROC_UNUSED(void, glFinish, (void)) SDL_PROC_UNUSED(void, glFlush, (void)) SDL_PROC_UNUSED(void, glFogf, (GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glFogfv, (GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glFogi, (GLenum pname, GLint param)) -SDL_PROC_UNUSED(void, glFogiv, (GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glFogiv, (GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glFrontFace, (GLenum mode)) SDL_PROC_UNUSED(void, glFrustum, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) SDL_PROC_UNUSED(GLuint, glGenLists, (GLsizei range)) -SDL_PROC(void, glGenTextures, (GLsizei n, GLuint * textures)) -SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean * params)) -SDL_PROC_UNUSED(void, glGetClipPlane, (GLenum plane, GLdouble * equation)) -SDL_PROC_UNUSED(void, glGetDoublev, (GLenum pname, GLdouble * params)) +SDL_PROC(void, glGenTextures, (GLsizei n, GLuint *textures)) +SDL_PROC_UNUSED(void, glGetBooleanv, (GLenum pname, GLboolean *params)) +SDL_PROC_UNUSED(void, glGetClipPlane, (GLenum plane, GLdouble *equation)) +SDL_PROC_UNUSED(void, glGetDoublev, (GLenum pname, GLdouble *params)) SDL_PROC(GLenum, glGetError, (void)) -SDL_PROC(void, glGetFloatv, (GLenum pname, GLfloat * params)) -SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint * params)) +SDL_PROC(void, glGetFloatv, (GLenum pname, GLfloat *params)) +SDL_PROC(void, glGetIntegerv, (GLenum pname, GLint *params)) SDL_PROC_UNUSED(void, glGetLightfv, - (GLenum light, GLenum pname, GLfloat * params)) + (GLenum light, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetLightiv, - (GLenum light, GLenum pname, GLint * params)) -SDL_PROC_UNUSED(void, glGetMapdv, (GLenum target, GLenum query, GLdouble * v)) -SDL_PROC_UNUSED(void, glGetMapfv, (GLenum target, GLenum query, GLfloat * v)) -SDL_PROC_UNUSED(void, glGetMapiv, (GLenum target, GLenum query, GLint * v)) + (GLenum light, GLenum pname, GLint *params)) +SDL_PROC_UNUSED(void, glGetMapdv, (GLenum target, GLenum query, GLdouble *v)) +SDL_PROC_UNUSED(void, glGetMapfv, (GLenum target, GLenum query, GLfloat *v)) +SDL_PROC_UNUSED(void, glGetMapiv, (GLenum target, GLenum query, GLint *v)) SDL_PROC_UNUSED(void, glGetMaterialfv, - (GLenum face, GLenum pname, GLfloat * params)) + (GLenum face, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetMaterialiv, - (GLenum face, GLenum pname, GLint * params)) -SDL_PROC_UNUSED(void, glGetPixelMapfv, (GLenum map, GLfloat * values)) -SDL_PROC_UNUSED(void, glGetPixelMapuiv, (GLenum map, GLuint * values)) -SDL_PROC_UNUSED(void, glGetPixelMapusv, (GLenum map, GLushort * values)) -SDL_PROC(void, glGetPointerv, (GLenum pname, GLvoid * *params)) + (GLenum face, GLenum pname, GLint *params)) +SDL_PROC_UNUSED(void, glGetPixelMapfv, (GLenum map, GLfloat *values)) +SDL_PROC_UNUSED(void, glGetPixelMapuiv, (GLenum map, GLuint *values)) +SDL_PROC_UNUSED(void, glGetPixelMapusv, (GLenum map, GLushort *values)) +SDL_PROC(void, glGetPointerv, (GLenum pname, GLvoid **params)) SDL_PROC_UNUSED(void, glGetPolygonStipple, (GLubyte * mask)) SDL_PROC(const GLubyte *, glGetString, (GLenum name)) SDL_PROC_UNUSED(void, glGetTexEnvfv, - (GLenum target, GLenum pname, GLfloat * params)) + (GLenum target, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetTexEnviv, - (GLenum target, GLenum pname, GLint * params)) + (GLenum target, GLenum pname, GLint *params)) SDL_PROC_UNUSED(void, glGetTexGendv, - (GLenum coord, GLenum pname, GLdouble * params)) + (GLenum coord, GLenum pname, GLdouble *params)) SDL_PROC_UNUSED(void, glGetTexGenfv, - (GLenum coord, GLenum pname, GLfloat * params)) + (GLenum coord, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetTexGeniv, - (GLenum coord, GLenum pname, GLint * params)) + (GLenum coord, GLenum pname, GLint *params)) SDL_PROC_UNUSED(void, glGetTexImage, (GLenum target, GLint level, GLenum format, GLenum type, - GLvoid * pixels)) + GLvoid *pixels)) SDL_PROC_UNUSED(void, glGetTexLevelParameterfv, - (GLenum target, GLint level, GLenum pname, GLfloat * params)) + (GLenum target, GLint level, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetTexLevelParameteriv, - (GLenum target, GLint level, GLenum pname, GLint * params)) + (GLenum target, GLint level, GLenum pname, GLint *params)) SDL_PROC_UNUSED(void, glGetTexParameterfv, - (GLenum target, GLenum pname, GLfloat * params)) + (GLenum target, GLenum pname, GLfloat *params)) SDL_PROC_UNUSED(void, glGetTexParameteriv, - (GLenum target, GLenum pname, GLint * params)) + (GLenum target, GLenum pname, GLint *params)) SDL_PROC_UNUSED(void, glHint, (GLenum target, GLenum mode)) SDL_PROC_UNUSED(void, glIndexMask, (GLuint mask)) SDL_PROC_UNUSED(void, glIndexPointer, - (GLenum type, GLsizei stride, const GLvoid * pointer)) + (GLenum type, GLsizei stride, const GLvoid *pointer)) SDL_PROC_UNUSED(void, glIndexd, (GLdouble c)) -SDL_PROC_UNUSED(void, glIndexdv, (const GLdouble * c)) +SDL_PROC_UNUSED(void, glIndexdv, (const GLdouble *c)) SDL_PROC_UNUSED(void, glIndexf, (GLfloat c)) -SDL_PROC_UNUSED(void, glIndexfv, (const GLfloat * c)) +SDL_PROC_UNUSED(void, glIndexfv, (const GLfloat *c)) SDL_PROC_UNUSED(void, glIndexi, (GLint c)) -SDL_PROC_UNUSED(void, glIndexiv, (const GLint * c)) +SDL_PROC_UNUSED(void, glIndexiv, (const GLint *c)) SDL_PROC_UNUSED(void, glIndexs, (GLshort c)) -SDL_PROC_UNUSED(void, glIndexsv, (const GLshort * c)) +SDL_PROC_UNUSED(void, glIndexsv, (const GLshort *c)) SDL_PROC_UNUSED(void, glIndexub, (GLubyte c)) -SDL_PROC_UNUSED(void, glIndexubv, (const GLubyte * c)) +SDL_PROC_UNUSED(void, glIndexubv, (const GLubyte *c)) SDL_PROC_UNUSED(void, glInitNames, (void)) SDL_PROC_UNUSED(void, glInterleavedArrays, - (GLenum format, GLsizei stride, const GLvoid * pointer)) + (GLenum format, GLsizei stride, const GLvoid *pointer)) SDL_PROC_UNUSED(GLboolean, glIsEnabled, (GLenum cap)) SDL_PROC_UNUSED(GLboolean, glIsList, (GLuint list)) SDL_PROC_UNUSED(GLboolean, glIsTexture, (GLuint texture)) SDL_PROC_UNUSED(void, glLightModelf, (GLenum pname, GLfloat param)) -SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat * params)) +SDL_PROC_UNUSED(void, glLightModelfv, (GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glLightModeli, (GLenum pname, GLint param)) -SDL_PROC_UNUSED(void, glLightModeliv, (GLenum pname, const GLint * params)) +SDL_PROC_UNUSED(void, glLightModeliv, (GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glLightf, (GLenum light, GLenum pname, GLfloat param)) SDL_PROC_UNUSED(void, glLightfv, - (GLenum light, GLenum pname, const GLfloat * params)) + (GLenum light, GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glLighti, (GLenum light, GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glLightiv, - (GLenum light, GLenum pname, const GLint * params)) + (GLenum light, GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glLineStipple, (GLint factor, GLushort pattern)) SDL_PROC(void, glLineWidth, (GLfloat width)) SDL_PROC_UNUSED(void, glListBase, (GLuint base)) SDL_PROC(void, glLoadIdentity, (void)) -SDL_PROC_UNUSED(void, glLoadMatrixd, (const GLdouble * m)) -SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat * m)) +SDL_PROC_UNUSED(void, glLoadMatrixd, (const GLdouble *m)) +SDL_PROC_UNUSED(void, glLoadMatrixf, (const GLfloat *m)) SDL_PROC_UNUSED(void, glLoadName, (GLuint name)) SDL_PROC_UNUSED(void, glLogicOp, (GLenum opcode)) SDL_PROC_UNUSED(void, glMap1d, (GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble * points)) + GLint order, const GLdouble *points)) SDL_PROC_UNUSED(void, glMap1f, (GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat * points)) + GLint order, const GLfloat *points)) SDL_PROC_UNUSED(void, glMap2d, (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, - GLint vorder, const GLdouble * points)) + GLint vorder, const GLdouble *points)) SDL_PROC_UNUSED(void, glMap2f, (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, - GLint vorder, const GLfloat * points)) + GLint vorder, const GLfloat *points)) SDL_PROC_UNUSED(void, glMapGrid1d, (GLint un, GLdouble u1, GLdouble u2)) SDL_PROC_UNUSED(void, glMapGrid1f, (GLint un, GLfloat u1, GLfloat u2)) SDL_PROC_UNUSED(void, glMapGrid2d, @@ -261,36 +261,36 @@ SDL_PROC_UNUSED(void, glMapGrid2f, GLfloat v2)) SDL_PROC_UNUSED(void, glMaterialf, (GLenum face, GLenum pname, GLfloat param)) SDL_PROC_UNUSED(void, glMaterialfv, - (GLenum face, GLenum pname, const GLfloat * params)) + (GLenum face, GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glMateriali, (GLenum face, GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glMaterialiv, - (GLenum face, GLenum pname, const GLint * params)) + (GLenum face, GLenum pname, const GLint *params)) SDL_PROC(void, glMatrixMode, (GLenum mode)) -SDL_PROC_UNUSED(void, glMultMatrixd, (const GLdouble * m)) -SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat * m)) +SDL_PROC_UNUSED(void, glMultMatrixd, (const GLdouble *m)) +SDL_PROC_UNUSED(void, glMultMatrixf, (const GLfloat *m)) SDL_PROC_UNUSED(void, glNewList, (GLuint list, GLenum mode)) SDL_PROC_UNUSED(void, glNormal3b, (GLbyte nx, GLbyte ny, GLbyte nz)) -SDL_PROC_UNUSED(void, glNormal3bv, (const GLbyte * v)) +SDL_PROC_UNUSED(void, glNormal3bv, (const GLbyte *v)) SDL_PROC_UNUSED(void, glNormal3d, (GLdouble nx, GLdouble ny, GLdouble nz)) -SDL_PROC_UNUSED(void, glNormal3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glNormal3dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glNormal3f, (GLfloat nx, GLfloat ny, GLfloat nz)) -SDL_PROC_UNUSED(void, glNormal3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glNormal3fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glNormal3i, (GLint nx, GLint ny, GLint nz)) -SDL_PROC_UNUSED(void, glNormal3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glNormal3iv, (const GLint *v)) SDL_PROC_UNUSED(void, glNormal3s, (GLshort nx, GLshort ny, GLshort nz)) -SDL_PROC_UNUSED(void, glNormal3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glNormal3sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glNormalPointer, - (GLenum type, GLsizei stride, const GLvoid * pointer)) + (GLenum type, GLsizei stride, const GLvoid *pointer)) SDL_PROC(void, glOrtho, (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) SDL_PROC_UNUSED(void, glPassThrough, (GLfloat token)) SDL_PROC_UNUSED(void, glPixelMapfv, - (GLenum map, GLsizei mapsize, const GLfloat * values)) + (GLenum map, GLsizei mapsize, const GLfloat *values)) SDL_PROC_UNUSED(void, glPixelMapuiv, - (GLenum map, GLsizei mapsize, const GLuint * values)) + (GLenum map, GLsizei mapsize, const GLuint *values)) SDL_PROC_UNUSED(void, glPixelMapusv, - (GLenum map, GLsizei mapsize, const GLushort * values)) + (GLenum map, GLsizei mapsize, const GLushort *values)) SDL_PROC_UNUSED(void, glPixelStoref, (GLenum pname, GLfloat param)) SDL_PROC(void, glPixelStorei, (GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glPixelTransferf, (GLenum pname, GLfloat param)) @@ -299,180 +299,180 @@ SDL_PROC_UNUSED(void, glPixelZoom, (GLfloat xfactor, GLfloat yfactor)) SDL_PROC(void, glPointSize, (GLfloat size)) SDL_PROC_UNUSED(void, glPolygonMode, (GLenum face, GLenum mode)) SDL_PROC_UNUSED(void, glPolygonOffset, (GLfloat factor, GLfloat units)) -SDL_PROC_UNUSED(void, glPolygonStipple, (const GLubyte * mask)) +SDL_PROC_UNUSED(void, glPolygonStipple, (const GLubyte *mask)) SDL_PROC_UNUSED(void, glPopAttrib, (void)) SDL_PROC_UNUSED(void, glPopClientAttrib, (void)) SDL_PROC_UNUSED(void, glPopMatrix, (void)) SDL_PROC_UNUSED(void, glPopName, (void)) SDL_PROC_UNUSED(void, glPrioritizeTextures, - (GLsizei n, const GLuint * textures, - const GLclampf * priorities)) + (GLsizei n, const GLuint *textures, + const GLclampf *priorities)) SDL_PROC_UNUSED(void, glPushAttrib, (GLbitfield mask)) SDL_PROC_UNUSED(void, glPushClientAttrib, (GLbitfield mask)) SDL_PROC_UNUSED(void, glPushMatrix, (void)) SDL_PROC_UNUSED(void, glPushName, (GLuint name)) SDL_PROC_UNUSED(void, glRasterPos2d, (GLdouble x, GLdouble y)) -SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glRasterPos2f, (GLfloat x, GLfloat y)) -SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat *v)) SDL_PROC(void, glRasterPos2i, (GLint x, GLint y)) -SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint *v)) SDL_PROC_UNUSED(void, glRasterPos2s, (GLshort x, GLshort y)) -SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glRasterPos3d, (GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void, glRasterPos3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos3dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glRasterPos3f, (GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC_UNUSED(void, glRasterPos3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glRasterPos3fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glRasterPos3i, (GLint x, GLint y, GLint z)) -SDL_PROC_UNUSED(void, glRasterPos3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos3iv, (const GLint *v)) SDL_PROC_UNUSED(void, glRasterPos3s, (GLshort x, GLshort y, GLshort z)) -SDL_PROC_UNUSED(void, glRasterPos3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glRasterPos3sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glRasterPos4d, (GLdouble x, GLdouble y, GLdouble z, GLdouble w)) -SDL_PROC_UNUSED(void, glRasterPos4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glRasterPos4dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glRasterPos4f, (GLfloat x, GLfloat y, GLfloat z, GLfloat w)) -SDL_PROC_UNUSED(void, glRasterPos4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glRasterPos4fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glRasterPos4i, (GLint x, GLint y, GLint z, GLint w)) -SDL_PROC_UNUSED(void, glRasterPos4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glRasterPos4iv, (const GLint *v)) SDL_PROC_UNUSED(void, glRasterPos4s, (GLshort x, GLshort y, GLshort z, GLshort w)) -SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glRasterPos4sv, (const GLshort *v)) SDL_PROC(void, glReadBuffer, (GLenum mode)) SDL_PROC(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid * pixels)) + GLenum format, GLenum type, GLvoid *pixels)) SDL_PROC_UNUSED(void, glRectd, (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)) -SDL_PROC_UNUSED(void, glRectdv, (const GLdouble * v1, const GLdouble * v2)) +SDL_PROC_UNUSED(void, glRectdv, (const GLdouble *v1, const GLdouble *v2)) SDL_PROC(void, glRectf, - (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) -SDL_PROC_UNUSED(void, glRectfv, (const GLfloat * v1, const GLfloat * v2)) + (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)) +SDL_PROC_UNUSED(void, glRectfv, (const GLfloat *v1, const GLfloat *v2)) SDL_PROC_UNUSED(void, glRecti, (GLint x1, GLint y1, GLint x2, GLint y2)) -SDL_PROC_UNUSED(void, glRectiv, (const GLint * v1, const GLint * v2)) +SDL_PROC_UNUSED(void, glRectiv, (const GLint *v1, const GLint *v2)) SDL_PROC_UNUSED(void, glRects, (GLshort x1, GLshort y1, GLshort x2, GLshort y2)) -SDL_PROC_UNUSED(void, glRectsv, (const GLshort * v1, const GLshort * v2)) +SDL_PROC_UNUSED(void, glRectsv, (const GLshort *v1, const GLshort *v2)) SDL_PROC_UNUSED(GLint, glRenderMode, (GLenum mode)) SDL_PROC_UNUSED(void, glRotated, (GLdouble angle, GLdouble x, GLdouble y, GLdouble z)) SDL_PROC(void, glRotatef, - (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) + (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)) SDL_PROC_UNUSED(void, glScaled, (GLdouble x, GLdouble y, GLdouble z)) SDL_PROC_UNUSED(void, glScalef, (GLfloat x, GLfloat y, GLfloat z)) SDL_PROC(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height)) -SDL_PROC_UNUSED(void, glSelectBuffer, (GLsizei size, GLuint * buffer)) +SDL_PROC_UNUSED(void, glSelectBuffer, (GLsizei size, GLuint *buffer)) SDL_PROC(void, glShadeModel, (GLenum mode)) SDL_PROC_UNUSED(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask)) SDL_PROC_UNUSED(void, glStencilMask, (GLuint mask)) SDL_PROC_UNUSED(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass)) SDL_PROC_UNUSED(void, glTexCoord1d, (GLdouble s)) -SDL_PROC_UNUSED(void, glTexCoord1dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord1dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glTexCoord1f, (GLfloat s)) -SDL_PROC_UNUSED(void, glTexCoord1fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord1fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glTexCoord1i, (GLint s)) -SDL_PROC_UNUSED(void, glTexCoord1iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord1iv, (const GLint *v)) SDL_PROC_UNUSED(void, glTexCoord1s, (GLshort s)) -SDL_PROC_UNUSED(void, glTexCoord1sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord1sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glTexCoord2d, (GLdouble s, GLdouble t)) -SDL_PROC_UNUSED(void, glTexCoord2dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord2dv, (const GLdouble *v)) SDL_PROC(void, glTexCoord2f, (GLfloat s, GLfloat t)) -SDL_PROC_UNUSED(void, glTexCoord2fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord2fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glTexCoord2i, (GLint s, GLint t)) -SDL_PROC_UNUSED(void, glTexCoord2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord2iv, (const GLint *v)) SDL_PROC_UNUSED(void, glTexCoord2s, (GLshort s, GLshort t)) -SDL_PROC_UNUSED(void, glTexCoord2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord2sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glTexCoord3d, (GLdouble s, GLdouble t, GLdouble r)) -SDL_PROC_UNUSED(void, glTexCoord3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord3dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glTexCoord3f, (GLfloat s, GLfloat t, GLfloat r)) -SDL_PROC_UNUSED(void, glTexCoord3fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord3fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glTexCoord3i, (GLint s, GLint t, GLint r)) -SDL_PROC_UNUSED(void, glTexCoord3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord3iv, (const GLint *v)) SDL_PROC_UNUSED(void, glTexCoord3s, (GLshort s, GLshort t, GLshort r)) -SDL_PROC_UNUSED(void, glTexCoord3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord3sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glTexCoord4d, (GLdouble s, GLdouble t, GLdouble r, GLdouble q)) -SDL_PROC_UNUSED(void, glTexCoord4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glTexCoord4dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glTexCoord4f, (GLfloat s, GLfloat t, GLfloat r, GLfloat q)) -SDL_PROC_UNUSED(void, glTexCoord4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glTexCoord4fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glTexCoord4i, (GLint s, GLint t, GLint r, GLint q)) -SDL_PROC_UNUSED(void, glTexCoord4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glTexCoord4iv, (const GLint *v)) SDL_PROC_UNUSED(void, glTexCoord4s, (GLshort s, GLshort t, GLshort r, GLshort q)) -SDL_PROC_UNUSED(void, glTexCoord4sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glTexCoord4sv, (const GLshort *v)) SDL_PROC(void, glTexCoordPointer, - (GLint size, GLenum type, GLsizei stride, - const GLvoid * pointer)) + (GLint size, GLenum type, GLsizei stride, + const GLvoid *pointer)) SDL_PROC(void, glTexEnvf, (GLenum target, GLenum pname, GLfloat param)) SDL_PROC_UNUSED(void, glTexEnvfv, - (GLenum target, GLenum pname, const GLfloat * params)) + (GLenum target, GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glTexEnvi, (GLenum target, GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glTexEnviv, - (GLenum target, GLenum pname, const GLint * params)) + (GLenum target, GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glTexGend, (GLenum coord, GLenum pname, GLdouble param)) SDL_PROC_UNUSED(void, glTexGendv, - (GLenum coord, GLenum pname, const GLdouble * params)) + (GLenum coord, GLenum pname, const GLdouble *params)) SDL_PROC_UNUSED(void, glTexGenf, (GLenum coord, GLenum pname, GLfloat param)) SDL_PROC_UNUSED(void, glTexGenfv, - (GLenum coord, GLenum pname, const GLfloat * params)) + (GLenum coord, GLenum pname, const GLfloat *params)) SDL_PROC_UNUSED(void, glTexGeni, (GLenum coord, GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glTexGeniv, - (GLenum coord, GLenum pname, const GLint * params)) + (GLenum coord, GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glTexImage1D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, - const GLvoid * pixels)) + const GLvoid *pixels)) SDL_PROC(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, - const GLvoid * pixels)) + const GLvoid *pixels)) SDL_PROC_UNUSED(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param)) SDL_PROC_UNUSED(void, glTexParameterfv, - (GLenum target, GLenum pname, const GLfloat * params)) + (GLenum target, GLenum pname, const GLfloat *params)) SDL_PROC(void, glTexParameteri, (GLenum target, GLenum pname, GLint param)) SDL_PROC_UNUSED(void, glTexParameteriv, - (GLenum target, GLenum pname, const GLint * params)) + (GLenum target, GLenum pname, const GLint *params)) SDL_PROC_UNUSED(void, glTexSubImage1D, (GLenum target, GLint level, GLint xoffset, GLsizei width, - GLenum format, GLenum type, const GLvoid * pixels)) + GLenum format, GLenum type, const GLvoid *pixels)) SDL_PROC(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, - const GLvoid * pixels)) + const GLvoid *pixels)) SDL_PROC_UNUSED(void, glTranslated, (GLdouble x, GLdouble y, GLdouble z)) SDL_PROC_UNUSED(void, glTranslatef, (GLfloat x, GLfloat y, GLfloat z)) SDL_PROC_UNUSED(void, glVertex2d, (GLdouble x, GLdouble y)) -SDL_PROC_UNUSED(void, glVertex2dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glVertex2dv, (const GLdouble *v)) SDL_PROC(void, glVertex2f, (GLfloat x, GLfloat y)) -SDL_PROC_UNUSED(void, glVertex2fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glVertex2fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glVertex2i, (GLint x, GLint y)) -SDL_PROC_UNUSED(void, glVertex2iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex2iv, (const GLint *v)) SDL_PROC_UNUSED(void, glVertex2s, (GLshort x, GLshort y)) -SDL_PROC_UNUSED(void, glVertex2sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertex2sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glVertex3d, (GLdouble x, GLdouble y, GLdouble z)) -SDL_PROC_UNUSED(void, glVertex3dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glVertex3dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glVertex3f, (GLfloat x, GLfloat y, GLfloat z)) -SDL_PROC(void, glVertex3fv, (const GLfloat * v)) +SDL_PROC(void, glVertex3fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glVertex3i, (GLint x, GLint y, GLint z)) -SDL_PROC_UNUSED(void, glVertex3iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex3iv, (const GLint *v)) SDL_PROC_UNUSED(void, glVertex3s, (GLshort x, GLshort y, GLshort z)) -SDL_PROC_UNUSED(void, glVertex3sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertex3sv, (const GLshort *v)) SDL_PROC_UNUSED(void, glVertex4d, (GLdouble x, GLdouble y, GLdouble z, GLdouble w)) -SDL_PROC_UNUSED(void, glVertex4dv, (const GLdouble * v)) +SDL_PROC_UNUSED(void, glVertex4dv, (const GLdouble *v)) SDL_PROC_UNUSED(void, glVertex4f, (GLfloat x, GLfloat y, GLfloat z, GLfloat w)) -SDL_PROC_UNUSED(void, glVertex4fv, (const GLfloat * v)) +SDL_PROC_UNUSED(void, glVertex4fv, (const GLfloat *v)) SDL_PROC_UNUSED(void, glVertex4i, (GLint x, GLint y, GLint z, GLint w)) -SDL_PROC_UNUSED(void, glVertex4iv, (const GLint * v)) +SDL_PROC_UNUSED(void, glVertex4iv, (const GLint *v)) SDL_PROC_UNUSED(void, glVertex4s, (GLshort x, GLshort y, GLshort z, GLshort w)) -SDL_PROC_UNUSED(void, glVertex4sv, (const GLshort * v)) +SDL_PROC_UNUSED(void, glVertex4sv, (const GLshort *v)) SDL_PROC(void, glVertexPointer, - (GLint size, GLenum type, GLsizei stride, - const GLvoid * pointer)) + (GLint size, GLenum type, GLsizei stride, + const GLvoid *pointer)) SDL_PROC(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height)) /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 4f6f1e5d5b62e..ea3fe1074104e 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_OGL #include "SDL_hints.h" #include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */ #include "SDL_opengl.h" @@ -37,8 +37,8 @@ #include #endif -/* To prevent unnecessary window recreation, - * these should match the defaults selected in SDL_GL_ResetAttributes +/* To prevent unnecessary window recreation, + * these should match the defaults selected in SDL_GL_ResetAttributes */ #define RENDERER_CONTEXT_MAJOR 2 @@ -50,9 +50,6 @@ http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/opengl_texturedata.html */ -/* Used to re-create the window with OpenGL capability */ -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); - static const float inv255f = 1.0f / 255.0f; typedef struct GL_FBOList GL_FBOList; @@ -105,7 +102,7 @@ typedef struct GL_FBOList *framebuffers; /* OpenGL functions */ -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; #include "SDL_glfuncs.h" #undef SDL_PROC @@ -149,32 +146,33 @@ typedef struct GL_FBOList *fbo; } GL_TextureData; -SDL_FORCE_INLINE const char* -GL_TranslateError (GLenum error) +SDL_FORCE_INLINE const char * +GL_TranslateError(GLenum error) { -#define GL_ERROR_TRANSLATE(e) case e: return #e; +#define GL_ERROR_TRANSLATE(e) \ + case e: \ + return #e; switch (error) { - GL_ERROR_TRANSLATE(GL_INVALID_ENUM) - GL_ERROR_TRANSLATE(GL_INVALID_VALUE) - GL_ERROR_TRANSLATE(GL_INVALID_OPERATION) - GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY) - GL_ERROR_TRANSLATE(GL_NO_ERROR) - GL_ERROR_TRANSLATE(GL_STACK_OVERFLOW) - GL_ERROR_TRANSLATE(GL_STACK_UNDERFLOW) - GL_ERROR_TRANSLATE(GL_TABLE_TOO_LARGE) + GL_ERROR_TRANSLATE(GL_INVALID_ENUM) + GL_ERROR_TRANSLATE(GL_INVALID_VALUE) + GL_ERROR_TRANSLATE(GL_INVALID_OPERATION) + GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY) + GL_ERROR_TRANSLATE(GL_NO_ERROR) + GL_ERROR_TRANSLATE(GL_STACK_OVERFLOW) + GL_ERROR_TRANSLATE(GL_STACK_UNDERFLOW) + GL_ERROR_TRANSLATE(GL_TABLE_TOO_LARGE) default: return "UNKNOWN"; -} + } #undef GL_ERROR_TRANSLATE } SDL_FORCE_INLINE void GL_ClearErrors(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; - if (!data->debug_enabled) - { + if (!data->debug_enabled) { return; } if (data->GL_ARB_debug_output_supported) { @@ -188,7 +186,7 @@ GL_ClearErrors(SDL_Renderer *renderer) data->errors = 0; data->error_messages = NULL; } - } else if (data->glGetError != NULL) { + } else if (data->glGetError) { while (data->glGetError() != GL_NO_ERROR) { /* continue; */ } @@ -196,13 +194,12 @@ GL_ClearErrors(SDL_Renderer *renderer) } SDL_FORCE_INLINE int -GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) +GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; int ret = 0; - if (!data->debug_enabled) - { + if (!data->debug_enabled) { return 0; } if (data->GL_ARB_debug_output_supported) { @@ -238,20 +235,19 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, #define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION) #endif -static int -GL_LoadFunctions(GL_RenderData * data) +static int GL_LoadFunctions(GL_RenderData *data) { #ifdef __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; #else int retval = 0; -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ retval = SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); + } \ + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "SDL_glfuncs.h" @@ -259,10 +255,9 @@ GL_LoadFunctions(GL_RenderData * data) return retval; } -static int -GL_ActivateRenderer(SDL_Renderer * renderer) +static int GL_ActivateRenderer(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; if (SDL_GL_GetCurrentContext() != data->context) { if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { @@ -275,11 +270,10 @@ GL_ActivateRenderer(SDL_Renderer * renderer) return 0; } -static void APIENTRY -GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, const void *userParam) +static void APIENTRY GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, const void *userParam) { - SDL_Renderer *renderer = (SDL_Renderer *) userParam; - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + SDL_Renderer *renderer = (SDL_Renderer *)userParam; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; if (type == GL_DEBUG_TYPE_ERROR_ARB) { /* Record this error */ @@ -288,7 +282,7 @@ GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GL if (error_messages) { data->errors = errors; data->error_messages = error_messages; - data->error_messages[data->errors-1] = SDL_strdup(message); + data->error_messages[data->errors - 1] = SDL_strdup(message); } } @@ -304,8 +298,7 @@ GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GL } } -static GL_FBOList * -GL_GetFBO(GL_RenderData *data, Uint32 w, Uint32 h) +static GL_FBOList *GL_GetFBO(GL_RenderData *data, Uint32 w, Uint32 h) { GL_FBOList *result = data->framebuffers; @@ -326,8 +319,7 @@ GL_GetFBO(GL_RenderData *data, Uint32 w, Uint32 h) return result; } -static void -GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void GL_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { /* If the window x/y/w/h changed at all, assume the viewport has been * changed behind our backs. x/y changes might seem weird but viewport @@ -335,13 +327,12 @@ GL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) */ if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED || event->event == SDL_WINDOWEVENT_MOVED) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; data->drawstate.viewport_dirty = SDL_TRUE; } } -static int -GL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int GL_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GL_GetDrawableSize(renderer->window, w, h); return 0; @@ -384,13 +375,16 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation) return GL_FUNC_SUBTRACT; case SDL_BLENDOPERATION_REV_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT; + case SDL_BLENDOPERATION_MINIMUM: + return GL_MIN; + case SDL_BLENDOPERATION_MAXIMUM: + return GL_MAX; default: return GL_INVALID_ENUM; } } -static SDL_bool -GL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool GL_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -415,7 +409,7 @@ GL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) SDL_FORCE_INLINE SDL_bool convert_format(GL_RenderData *renderdata, Uint32 pixel_format, - GLint* internalFormat, GLenum* format, GLenum* type) + GLint *internalFormat, GLenum *format, GLenum *type) { switch (pixel_format) { case SDL_PIXELFORMAT_ARGB8888: @@ -451,10 +445,9 @@ convert_format(GL_RenderData *renderdata, Uint32 pixel_format, return SDL_TRUE; } -static int -GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; const GLenum textype = renderdata->textype; GL_TextureData *data; GLint internalFormat; @@ -464,7 +457,8 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GL_ActivateRenderer(renderer); - renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texturing = SDL_FALSE; /* we trash this state. */ if (texture->access == SDL_TEXTUREACCESS_TARGET && !renderdata->GL_EXT_framebuffer_object_supported) { @@ -477,7 +471,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_GetPixelFormatName(texture->format)); } - data = (GL_TextureData *) SDL_calloc(1, sizeof(*data)); + data = (GL_TextureData *)SDL_calloc(1, sizeof(*data)); if (!data) { return SDL_OutOfMemory(); } @@ -485,7 +479,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (texture->access == SDL_TEXTUREACCESS_STREAMING) { size_t size; data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); - size = texture->h * data->pitch; + size = (size_t)texture->h * data->pitch; if (texture->format == SDL_PIXELFORMAT_YV12 || texture->format == SDL_PIXELFORMAT_IYUV) { /* Need to add size for the U and V planes */ @@ -528,13 +522,13 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } else if (renderdata->GL_ARB_texture_rectangle_supported) { texture_w = texture->w; texture_h = texture->h; - data->texw = (GLfloat) texture_w; - data->texh = (GLfloat) texture_h; + data->texw = (GLfloat)texture_w; + data->texh = (GLfloat)texture_h; } else { texture_w = SDL_powerof2(texture->w); texture_h = SDL_powerof2(texture->h); - data->texw = (GLfloat) (texture->w) / texture_w; - data->texh = (GLfloat) texture->h / texture_h; + data->texw = (GLfloat)(texture->w) / texture_w; + data->texh = (GLfloat)texture->h / texture_h; } data->format = format; @@ -555,13 +549,13 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } #ifdef __MACOSX__ #ifndef GL_TEXTURE_STORAGE_HINT_APPLE -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC #endif #ifndef STORAGE_CACHED_APPLE -#define STORAGE_CACHED_APPLE 0x85BE +#define STORAGE_CACHED_APPLE 0x85BE #endif #ifndef STORAGE_SHARED_APPLE -#define STORAGE_SHARED_APPLE 0x85BF +#define STORAGE_SHARED_APPLE 0x85BF #endif if (texture->access == SDL_TEXTUREACCESS_STREAMING) { renderdata->glTexParameteri(textype, GL_TEXTURE_STORAGE_HINT_APPLE, @@ -570,18 +564,15 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) renderdata->glTexParameteri(textype, GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_CACHED_APPLE); } - if (texture->access == SDL_TEXTUREACCESS_STREAMING - && texture->format == SDL_PIXELFORMAT_ARGB8888 - && (texture->w % 8) == 0) { + if (texture->access == SDL_TEXTUREACCESS_STREAMING && texture->format == SDL_PIXELFORMAT_ARGB8888 && (texture->w % 8) == 0) { renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, - (data->pitch / SDL_BYTESPERPIXEL(texture->format))); + (data->pitch / SDL_BYTESPERPIXEL(texture->format))); renderdata->glTexImage2D(textype, 0, internalFormat, texture_w, texture_h, 0, format, type, data->pixels); renderdata->glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE); - } - else + } else #endif { renderdata->glTexImage2D(textype, 0, internalFormat, texture_w, @@ -609,8 +600,8 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GL_CLAMP_TO_EDGE); renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w+1)/2, - (texture_h+1)/2, 0, format, type, NULL); + renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w + 1) / 2, + (texture_h + 1) / 2, 0, format, type, NULL); renderdata->glBindTexture(textype, data->vtexture); renderdata->glTexParameteri(textype, GL_TEXTURE_MIN_FILTER, @@ -621,8 +612,8 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GL_CLAMP_TO_EDGE); renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w+1)/2, - (texture_h+1)/2, 0, format, type, NULL); + renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w + 1) / 2, + (texture_h + 1) / 2, 0, format, type, NULL); } if (texture->format == SDL_PIXELFORMAT_NV12 || @@ -639,8 +630,8 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GL_CLAMP_TO_EDGE); renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - renderdata->glTexImage2D(textype, 0, GL_LUMINANCE_ALPHA, (texture_w+1)/2, - (texture_h+1)/2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); + renderdata->glTexImage2D(textype, 0, GL_LUMINANCE_ALPHA, (texture_w + 1) / 2, + (texture_h + 1) / 2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); } #endif @@ -653,44 +644,44 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #if SDL_HAVE_YUV if (data->yuv || data->nv12) { switch (SDL_GetYUVConversionModeForResolution(texture->w, texture->h)) { - case SDL_YUV_CONVERSION_JPEG: - if (data->yuv) { - data->shader = SHADER_YUV_JPEG; - } else if (texture->format == SDL_PIXELFORMAT_NV12) { - data->shader = SHADER_NV12_JPEG; - } else { - data->shader = SHADER_NV21_JPEG; - } - break; - case SDL_YUV_CONVERSION_BT601: - if (data->yuv) { - data->shader = SHADER_YUV_BT601; - } else if (texture->format == SDL_PIXELFORMAT_NV12) { - if (SDL_GetHintBoolean("SDL_RENDER_OPENGL_NV12_RG_SHADER", SDL_FALSE)) { - data->shader = SHADER_NV12_RG_BT601; - } else { - data->shader = SHADER_NV12_RA_BT601; - } + case SDL_YUV_CONVERSION_JPEG: + if (data->yuv) { + data->shader = SHADER_YUV_JPEG; + } else if (texture->format == SDL_PIXELFORMAT_NV12) { + data->shader = SHADER_NV12_JPEG; + } else { + data->shader = SHADER_NV21_JPEG; + } + break; + case SDL_YUV_CONVERSION_BT601: + if (data->yuv) { + data->shader = SHADER_YUV_BT601; + } else if (texture->format == SDL_PIXELFORMAT_NV12) { + if (SDL_GetHintBoolean("SDL_RENDER_OPENGL_NV12_RG_SHADER", SDL_FALSE)) { + data->shader = SHADER_NV12_RG_BT601; } else { - data->shader = SHADER_NV21_BT601; + data->shader = SHADER_NV12_RA_BT601; } - break; - case SDL_YUV_CONVERSION_BT709: - if (data->yuv) { - data->shader = SHADER_YUV_BT709; - } else if (texture->format == SDL_PIXELFORMAT_NV12) { - if (SDL_GetHintBoolean("SDL_RENDER_OPENGL_NV12_RG_SHADER", SDL_FALSE)) { - data->shader = SHADER_NV12_RG_BT709; - } else { - data->shader = SHADER_NV12_RA_BT709; - } + } else { + data->shader = SHADER_NV21_BT601; + } + break; + case SDL_YUV_CONVERSION_BT709: + if (data->yuv) { + data->shader = SHADER_YUV_BT709; + } else if (texture->format == SDL_PIXELFORMAT_NV12) { + if (SDL_GetHintBoolean("SDL_RENDER_OPENGL_NV12_RG_SHADER", SDL_FALSE)) { + data->shader = SHADER_NV12_RG_BT709; } else { - data->shader = SHADER_NV21_BT709; + data->shader = SHADER_NV12_RA_BT709; } - break; - default: - SDL_assert(!"unsupported YUV conversion mode"); - break; + } else { + data->shader = SHADER_NV21_BT709; + } + break; + default: + SDL_assert(!"unsupported YUV conversion mode"); + break; } } #endif /* SDL_HAVE_YUV */ @@ -698,20 +689,19 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return GL_CheckError("", renderer); } -static int -GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int GL_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; const int texturebpp = SDL_BYTESPERPIXEL(texture->format); - SDL_assert(texturebpp != 0); /* otherwise, division by zero later. */ + SDL_assert_release(texturebpp != 0); /* otherwise, division by zero later. */ GL_ActivateRenderer(renderer); - renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texture = NULL; /* we trash this state. */ renderdata->glBindTexture(textype, data->texture); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -724,25 +714,25 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, ((pitch + 1) / 2)); /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + pixels = (const void *)((const Uint8 *)pixels + rect->h * pitch); if (texture->format == SDL_PIXELFORMAT_YV12) { renderdata->glBindTexture(textype, data->vtexture); } else { renderdata->glBindTexture(textype, data->utexture); } - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w+1)/2, (rect->h+1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, data->format, data->formattype, pixels); /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2)); + pixels = (const void *)((const Uint8 *)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2)); if (texture->format == SDL_PIXELFORMAT_YV12) { renderdata->glBindTexture(textype, data->utexture); } else { renderdata->glBindTexture(textype, data->vtexture); } - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w+1)/2, (rect->h+1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, data->format, data->formattype, pixels); } @@ -750,10 +740,10 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, ((pitch + 1) / 2)); /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + pixels = (const void *)((const Uint8 *)pixels + rect->h * pitch); renderdata->glBindTexture(textype, data->utexture); - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w + 1)/2, (rect->h + 1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, pixels); } #endif @@ -761,20 +751,19 @@ GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } #if SDL_HAVE_YUV -static int -GL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int GL_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; GL_ActivateRenderer(renderer); - renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texture = NULL; /* we trash this state. */ renderdata->glBindTexture(textype, data->texture); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -785,32 +774,31 @@ GL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, Upitch); renderdata->glBindTexture(textype, data->utexture); - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w + 1)/2, (rect->h + 1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, data->format, data->formattype, Uplane); renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, Vpitch); renderdata->glBindTexture(textype, data->vtexture); - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w + 1)/2, (rect->h + 1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, data->format, data->formattype, Vplane); return GL_CheckError("glTexSubImage2D()", renderer); } -static int -GL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int GL_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; GL_ActivateRenderer(renderer); - renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texture = NULL; /* we trash this state. */ renderdata->glBindTexture(textype, data->texture); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -819,51 +807,47 @@ GL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, rect->h, data->format, data->formattype, Yplane); - renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, UVpitch / 2); renderdata->glBindTexture(textype, data->utexture); - renderdata->glTexSubImage2D(textype, 0, rect->x/2, rect->y/2, - (rect->w + 1)/2, (rect->h + 1)/2, + renderdata->glTexSubImage2D(textype, 0, rect->x / 2, rect->y / 2, + (rect->w + 1) / 2, (rect->h + 1) / 2, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, UVplane); return GL_CheckError("glTexSubImage2D()", renderer); } #endif -static int -GL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int GL_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; data->locked_rect = *rect; *pixels = - (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = data->pitch; return 0; } -static void -GL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void GL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; const SDL_Rect *rect; void *pixels; rect = &data->locked_rect; pixels = - (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); GL_UpdateTexture(renderer, texture, rect, pixels, data->pitch); } -static void -GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void GL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; GLenum glScaleMode = (scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR; renderdata->glBindTexture(textype, data->texture); @@ -891,10 +875,9 @@ GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Scale #endif } -static int -GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int GL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; GL_TextureData *texturedata; GLenum status; @@ -906,12 +889,12 @@ GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) data->drawstate.viewport_dirty = SDL_TRUE; - if (texture == NULL) { + if (!texture) { data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); return 0; } - texturedata = (GL_TextureData *) texture->driverdata; + texturedata = (GL_TextureData *)texture->driverdata; data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, texturedata->fbo->FBO); /* TODO: check if texture pixel format allows this operation */ data->glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, data->textype, texturedata->texture, 0); @@ -926,16 +909,14 @@ GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) /* !!! FIXME: all these Queue* calls set up the vertex buffer the way the immediate mode !!! FIXME: renderer wants it, but this might want to operate differently if we move to !!! FIXME: VBOs at some point. */ -static int -GL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int GL_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -GL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GL_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (GLfloat), 0, &cmd->data.draw.first); + GLfloat *verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, count * 2 * sizeof(GLfloat), 0, &cmd->data.draw.first); int i; if (!verts) { @@ -951,13 +932,12 @@ GL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FP return 0; } -static int -GL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GL_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { int i; GLfloat prevx, prevy; - const size_t vertlen = (sizeof (GLfloat) * 2) * count; - GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, vertlen, 0, &cmd->data.draw.first); + const size_t vertlen = (sizeof(GLfloat) * 2) * count; + GLfloat *verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, vertlen, 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -977,7 +957,7 @@ GL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPo for (i = 1; i < count; i++) { const GLfloat xstart = prevx; const GLfloat ystart = prevy; - const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ + const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ const GLfloat yend = points[i].y + 0.5f; /* bump a little in the direction we are moving in. */ const GLfloat deltax = xend - xstart; @@ -992,11 +972,10 @@ GL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPo return 0; } -static int -GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { GL_TextureData *texturedata = NULL; int i; @@ -1004,13 +983,13 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te GLfloat *verts; size_t sz = 2 * sizeof(GLfloat) + 4 * sizeof(Uint8) + (texture ? 2 : 0) * sizeof(GLfloat); - verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, count * sz, 0, &cmd->data.draw.first); + verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, count * sz, 0, &cmd->data.draw.first); if (!verts) { return -1; } if (texture) { - texturedata = (GL_TextureData *) texture->driverdata; + texturedata = (GL_TextureData *)texture->driverdata; } cmd->data.draw.count = count; @@ -1029,18 +1008,18 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); + xy_ = (float *)((char *)xy + j * xy_stride); *(verts++) = xy_[0] * scale_x; *(verts++) = xy_[1] * scale_y; /* Not really a float, but it is still 4 bytes and will be cast to the right type in the graphics driver. */ - SDL_memcpy(verts, ((char*)color + j * color_stride), sizeof(*color)); + SDL_memcpy(verts, ((char *)color + j * color_stride), sizeof(*color)); ++verts; if (texture) { - float *uv_ = (float *)((char*)uv + j * uv_stride); + float *uv_ = (float *)((char *)uv + j * uv_stride); *(verts++) = uv_[0] * texturedata->texw; *(verts++) = uv_[1] * texturedata->texh; } @@ -1048,8 +1027,7 @@ GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te return 0; } -static int -SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader shader) +static int SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader shader) { const SDL_BlendMode blend = cmd->data.draw.blend; SDL_bool vertex_array; @@ -1065,9 +1043,9 @@ SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader istarget ? viewport->y : (data->drawstate.drawableh - viewport->y - viewport->h), viewport->w, viewport->h); if (viewport->w && viewport->h) { - data->glOrtho((GLdouble) 0, (GLdouble) viewport->w, - (GLdouble) istarget ? 0 : viewport->h, - (GLdouble) istarget ? viewport->h : 0, + data->glOrtho((GLdouble)0, (GLdouble)viewport->w, + (GLdouble)istarget ? 0 : viewport->h, + (GLdouble)istarget ? viewport->h : 0, 0.0, 1.0); } data->glMatrixMode(GL_MODELVIEW); @@ -1112,7 +1090,7 @@ SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader } if ((cmd->data.draw.texture != NULL) != data->drawstate.texturing) { - if (cmd->data.draw.texture == NULL) { + if (!cmd->data.draw.texture) { data->glDisable(data->textype); data->drawstate.texturing = SDL_FALSE; } else { @@ -1121,9 +1099,7 @@ SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader } } - vertex_array = cmd->command == SDL_RENDERCMD_DRAW_POINTS - || cmd->command == SDL_RENDERCMD_DRAW_LINES - || cmd->command == SDL_RENDERCMD_GEOMETRY; + vertex_array = cmd->command == SDL_RENDERCMD_DRAW_POINTS || cmd->command == SDL_RENDERCMD_DRAW_LINES || cmd->command == SDL_RENDERCMD_GEOMETRY; color_array = cmd->command == SDL_RENDERCMD_GEOMETRY; texture_array = cmd->data.draw.texture != NULL; @@ -1159,11 +1135,10 @@ SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const GL_Shader return 0; } -static int -SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) +static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; - const GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + const GL_TextureData *texturedata = (GL_TextureData *)texture->driverdata; SetDrawState(data, cmd, texturedata->shader); @@ -1199,11 +1174,10 @@ SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) return 0; } -static int -GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int GL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { /* !!! FIXME: it'd be nice to use a vertex buffer instead of immediate mode... */ - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; if (GL_ActivateRenderer(renderer) < 0) { return -1; @@ -1214,7 +1188,7 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic int w, h; SDL_GL_GetDrawableSize(renderer->window, &w, &h); if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { - data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. + data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. data->drawstate.cliprect_dirty = SDL_TRUE; data->drawstate.drawablew = w; data->drawstate.drawableh = h; @@ -1230,185 +1204,192 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - const Uint8 r = cmd->data.color.r; - const Uint8 g = cmd->data.color.g; - const Uint8 b = cmd->data.color.b; - const Uint8 a = cmd->data.color.a; - const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); - if (color != data->drawstate.color) { - data->glColor4ub((GLubyte) r, (GLubyte) g, (GLubyte) b, (GLubyte) a); - data->drawstate.color = color; - } - break; + case SDL_RENDERCMD_SETDRAWCOLOR: + { + const Uint8 r = cmd->data.color.r; + const Uint8 g = cmd->data.color.g; + const Uint8 b = cmd->data.color.b; + const Uint8 a = cmd->data.color.a; + const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); + if (color != data->drawstate.color) { + data->glColor4ub((GLubyte)r, (GLubyte)g, (GLubyte)b, (GLubyte)a); + data->drawstate.color = color; } + break; + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &data->drawstate.viewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - data->drawstate.viewport_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { - data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; - } - - if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&data->drawstate.cliprect, rect); - data->drawstate.cliprect_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; } - case SDL_RENDERCMD_CLEAR: { - const Uint8 r = cmd->data.color.r; - const Uint8 g = cmd->data.color.g; - const Uint8 b = cmd->data.color.b; - const Uint8 a = cmd->data.color.a; - const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); - if (color != data->drawstate.clear_color) { - const GLfloat fr = ((GLfloat) r) * inv255f; - const GLfloat fg = ((GLfloat) g) * inv255f; - const GLfloat fb = ((GLfloat) b) * inv255f; - const GLfloat fa = ((GLfloat) a) * inv255f; - data->glClearColor(fr, fg, fb, fa); - data->drawstate.clear_color = color; - } + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; + } + break; + } - if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { - data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; - } + case SDL_RENDERCMD_CLEAR: + { + const Uint8 r = cmd->data.color.r; + const Uint8 g = cmd->data.color.g; + const Uint8 b = cmd->data.color.b; + const Uint8 a = cmd->data.color.a; + const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); + if (color != data->drawstate.clear_color) { + const GLfloat fr = ((GLfloat)r) * inv255f; + const GLfloat fg = ((GLfloat)g) * inv255f; + const GLfloat fb = ((GLfloat)b) * inv255f; + const GLfloat fa = ((GLfloat)a) * inv255f; + data->glClearColor(fr, fg, fb, fa); + data->drawstate.clear_color = color; + } - data->glClear(GL_COLOR_BUFFER_BIT); - break; + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { + data->glDisable(GL_SCISSOR_TEST); + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + data->glClear(GL_COLOR_BUFFER_BIT); + break; + } - case SDL_RENDERCMD_COPY: /* unused */ - break; + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_COPY: /* unused */ + break; - case SDL_RENDERCMD_DRAW_LINES: { - if (SetDrawState(data, cmd, SHADER_SOLID) == 0) { - size_t count = cmd->data.draw.count; - const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first); + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - /* SetDrawState handles glEnableClientState. */ - data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 2, verts); + case SDL_RENDERCMD_DRAW_LINES: + { + if (SetDrawState(data, cmd, SHADER_SOLID) == 0) { + size_t count = cmd->data.draw.count; + const GLfloat *verts = (GLfloat *)(((Uint8 *)vertices) + cmd->data.draw.first); - if (count > 2) { - /* joined lines cannot be grouped */ - data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)count); - } else { - /* let's group non joined lines */ - SDL_RenderCommand *finalcmd = cmd; - SDL_RenderCommand *nextcmd = cmd->next; - SDL_BlendMode thisblend = cmd->data.draw.blend; - - while (nextcmd != NULL) { - const SDL_RenderCommandType nextcmdtype = nextcmd->command; - if (nextcmdtype != SDL_RENDERCMD_DRAW_LINES) { - break; /* can't go any further on this draw call, different render command up next. */ - } else if (nextcmd->data.draw.count != 2) { - break; /* can't go any further on this draw call, those are joined lines */ - } else if (nextcmd->data.draw.blend != thisblend) { - break; /* can't go any further on this draw call, different blendmode copy up next. */ - } else { - finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += nextcmd->data.draw.count; - } - nextcmd = nextcmd->next; - } + /* SetDrawState handles glEnableClientState. */ + data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 2, verts); - data->glDrawArrays(GL_LINES, 0, (GLsizei)count); - cmd = finalcmd; /* skip any copy commands we just combined in here. */ + if (count > 2) { + /* joined lines cannot be grouped */ + data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)count); + } else { + /* let's group non joined lines */ + SDL_RenderCommand *finalcmd = cmd; + SDL_RenderCommand *nextcmd = cmd->next; + SDL_BlendMode thisblend = cmd->data.draw.blend; + + while (nextcmd) { + const SDL_RenderCommandType nextcmdtype = nextcmd->command; + if (nextcmdtype != SDL_RENDERCMD_DRAW_LINES) { + break; /* can't go any further on this draw call, different render command up next. */ + } else if (nextcmd->data.draw.count != 2) { + break; /* can't go any further on this draw call, those are joined lines */ + } else if (nextcmd->data.draw.blend != thisblend) { + break; /* can't go any further on this draw call, different blendmode copy up next. */ + } else { + finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ + count += nextcmd->data.draw.count; + } + nextcmd = nextcmd->next; } - } - break; - } - case SDL_RENDERCMD_DRAW_POINTS: - case SDL_RENDERCMD_GEOMETRY: { - /* as long as we have the same copy command in a row, with the - same texture, we can combine them all into a single draw call. */ - SDL_Texture *thistexture = cmd->data.draw.texture; - SDL_BlendMode thisblend = cmd->data.draw.blend; - const SDL_RenderCommandType thiscmdtype = cmd->command; - SDL_RenderCommand *finalcmd = cmd; - SDL_RenderCommand *nextcmd = cmd->next; - size_t count = cmd->data.draw.count; - int ret; - while (nextcmd != NULL) { - const SDL_RenderCommandType nextcmdtype = nextcmd->command; - if (nextcmdtype != thiscmdtype) { - break; /* can't go any further on this draw call, different render command up next. */ - } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { - break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ - } else { - finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += nextcmd->data.draw.count; - } - nextcmd = nextcmd->next; + data->glDrawArrays(GL_LINES, 0, (GLsizei)count); + cmd = finalcmd; /* skip any copy commands we just combined in here. */ } + } + break; + } - if (thistexture) { - ret = SetCopyState(data, cmd); + case SDL_RENDERCMD_DRAW_POINTS: + case SDL_RENDERCMD_GEOMETRY: + { + /* as long as we have the same copy command in a row, with the + same texture, we can combine them all into a single draw call. */ + SDL_Texture *thistexture = cmd->data.draw.texture; + SDL_BlendMode thisblend = cmd->data.draw.blend; + const SDL_RenderCommandType thiscmdtype = cmd->command; + SDL_RenderCommand *finalcmd = cmd; + SDL_RenderCommand *nextcmd = cmd->next; + size_t count = cmd->data.draw.count; + int ret; + while (nextcmd) { + const SDL_RenderCommandType nextcmdtype = nextcmd->command; + if (nextcmdtype != thiscmdtype) { + break; /* can't go any further on this draw call, different render command up next. */ + } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { + break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ } else { - ret = SetDrawState(data, cmd, SHADER_SOLID); + finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ + count += nextcmd->data.draw.count; } + nextcmd = nextcmd->next; + } - if (ret == 0) { - const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first); - int op = GL_TRIANGLES; /* SDL_RENDERCMD_GEOMETRY */ - if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { - op = GL_POINTS; - } + if (thistexture) { + ret = SetCopyState(data, cmd); + } else { + ret = SetDrawState(data, cmd, SHADER_SOLID); + } - if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { - /* SetDrawState handles glEnableClientState. */ - data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 2, verts); + if (ret == 0) { + const GLfloat *verts = (GLfloat *)(((Uint8 *)vertices) + cmd->data.draw.first); + int op = GL_TRIANGLES; /* SDL_RENDERCMD_GEOMETRY */ + if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { + op = GL_POINTS; + } + + if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { + /* SetDrawState handles glEnableClientState. */ + data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 2, verts); + } else { + /* SetDrawState handles glEnableClientState. */ + if (thistexture) { + data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 5, verts + 0); + data->glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(float) * 5, verts + 2); + data->glTexCoordPointer(2, GL_FLOAT, sizeof(float) * 5, verts + 3); } else { - /* SetDrawState handles glEnableClientState. */ - if (thistexture) { - data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 5, verts + 0); - data->glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(float) * 5, verts + 2); - data->glTexCoordPointer(2, GL_FLOAT, sizeof(float) * 5, verts + 3); - } else { - data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 3, verts + 0); - data->glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(float) * 3, verts + 2); - } + data->glVertexPointer(2, GL_FLOAT, sizeof(float) * 3, verts + 0); + data->glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(float) * 3, verts + 2); } + } - data->glDrawArrays(op, 0, (GLsizei) count); + data->glDrawArrays(op, 0, (GLsizei)count); - /* Restore previously set color when we're done. */ - if (thiscmdtype != SDL_RENDERCMD_DRAW_POINTS) { - Uint32 color = data->drawstate.color; - GLubyte a = (GLubyte)((color >> 24) & 0xFF); - GLubyte r = (GLubyte)((color >> 16) & 0xFF); - GLubyte g = (GLubyte)((color >> 8) & 0xFF); - GLubyte b = (GLubyte)((color >> 0) & 0xFF); - data->glColor4ub(r, g, b, a); - } + /* Restore previously set color when we're done. */ + if (thiscmdtype != SDL_RENDERCMD_DRAW_POINTS) { + Uint32 color = data->drawstate.color; + GLubyte a = (GLubyte)((color >> 24) & 0xFF); + GLubyte r = (GLubyte)((color >> 16) & 0xFF); + GLubyte g = (GLubyte)((color >> 8) & 0xFF); + GLubyte b = (GLubyte)((color >> 0) & 0xFF); + data->glColor4ub(r, g, b, a); } - - cmd = finalcmd; /* skip any copy commands we just combined in here. */ - break; } - case SDL_RENDERCMD_NO_OP: - break; + cmd = finalcmd; /* skip any copy commands we just combined in here. */ + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -1432,11 +1413,10 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic return GL_CheckError("", renderer); } -static int -GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 pixel_format, void * pixels, int pitch) +static int GL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 pixel_format, void *pixels, int pitch) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ARGB8888; void *temp_pixels; int temp_pitch; @@ -1453,12 +1433,12 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, SDL_GetPixelFormatName(temp_format)); } - if (!rect->w || !rect->h) { - return 0; /* nothing to do. */ + if (rect->w == 0 || rect->h == 0) { + return 0; /* nothing to do. */ } temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); - temp_pixels = SDL_malloc(rect->h * temp_pitch); + temp_pixels = SDL_malloc((size_t)rect->h * temp_pitch); if (!temp_pixels) { return SDL_OutOfMemory(); } @@ -1469,7 +1449,7 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, data->glPixelStorei(GL_PACK_ROW_LENGTH, (temp_pitch / SDL_BYTESPERPIXEL(temp_format))); - data->glReadPixels(rect->x, renderer->target ? rect->y : (h-rect->y)-rect->h, + data->glReadPixels(rect->x, renderer->target ? rect->y : (h - rect->y) - rect->h, rect->w, rect->h, format, type, temp_pixels); if (GL_CheckError("glReadPixels()", renderer) < 0) { @@ -1481,8 +1461,8 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, if (!renderer->target) { SDL_bool isstack; length = rect->w * SDL_BYTESPERPIXEL(temp_format); - src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; - dst = (Uint8*)temp_pixels; + src = (Uint8 *)temp_pixels + (rect->h - 1) * temp_pitch; + dst = (Uint8 *)temp_pixels; tmp = SDL_small_alloc(Uint8, length, &isstack); rows = rect->h / 2; while (rows--) { @@ -1503,19 +1483,17 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -GL_RenderPresent(SDL_Renderer * renderer) +static int GL_RenderPresent(SDL_Renderer *renderer) { GL_ActivateRenderer(renderer); return SDL_GL_SwapWindowWithResult(renderer->window); } -static void -GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void GL_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->driverdata; GL_ActivateRenderer(renderer); @@ -1543,20 +1521,19 @@ GL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture->driverdata = NULL; } -static void -GL_DestroyRenderer(SDL_Renderer * renderer) +static void GL_DestroyRenderer(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; if (data) { - if (data->context != NULL) { + if (data->context) { /* make sure we delete the right resources! */ GL_ActivateRenderer(renderer); } GL_ClearErrors(renderer); if (data->GL_ARB_debug_output_supported) { - PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); + PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC)SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); /* Uh oh, we don't have a safe way of removing ourselves from the callback chain, if it changed after we set our callback. */ /* For now, just always replace the callback with the original one */ @@ -1578,14 +1555,12 @@ GL_DestroyRenderer(SDL_Renderer * renderer) } SDL_free(data); } - SDL_free(renderer); } -static int -GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) +static int GL_BindTexture(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *)texture->driverdata; const GLenum textype = data->textype; GL_ActivateRenderer(renderer); @@ -1632,11 +1607,10 @@ GL_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, floa return 0; } -static int -GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) +static int GL_UnbindTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - GL_TextureData *texturedata = (GL_TextureData *) texture->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_TextureData *texturedata = (GL_TextureData *)texture->driverdata; const GLenum textype = data->textype; GL_ActivateRenderer(renderer); @@ -1680,8 +1654,7 @@ GL_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) return 0; } -static int -GL_SetVSync(SDL_Renderer * renderer, const int vsync) +static int GL_SetVSync(SDL_Renderer *renderer, const int vsync) { int retval; if (vsync) { @@ -1692,7 +1665,7 @@ GL_SetVSync(SDL_Renderer * renderer, const int vsync) if (retval != 0) { return retval; } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } else { renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC; @@ -1700,26 +1673,25 @@ GL_SetVSync(SDL_Renderer * renderer, const int vsync) return retval; } -static SDL_bool -GL_IsProbablyAccelerated(const GL_RenderData *data) +static SDL_bool GL_IsProbablyAccelerated(const GL_RenderData *data) { /*const char *vendor = (const char *) data->glGetString(GL_VENDOR);*/ - const char *renderer = (const char *) data->glGetString(GL_RENDERER); + const char *renderer = (const char *)data->glGetString(GL_RENDERER); #if defined(__WINDOWS__) || defined(__WINGDK__) if (SDL_strcmp(renderer, "GDI Generic") == 0) { - return SDL_FALSE; /* Microsoft's fallback software renderer. Fix your system! */ + return SDL_FALSE; /* Microsoft's fallback software renderer. Fix your system! */ } #endif #ifdef __APPLE__ if (SDL_strcmp(renderer, "Apple Software Renderer") == 0) { - return SDL_FALSE; /* (a probably very old) Apple software-based OpenGL. */ + return SDL_FALSE; /* (a probably very old) Apple software-based OpenGL. */ } #endif - if (SDL_strcmp(renderer, "Software Rasterizer") == 0) { - return SDL_FALSE; /* (a probably very old) Software Mesa, or some other generic thing. */ + if (SDL_strcmp(renderer, "Software Rasterizer") == 0) { + return SDL_FALSE; /* (a probably very old) Software Mesa, or some other generic thing. */ } /* !!! FIXME: swrast? llvmpipe? softpipe? */ @@ -1727,10 +1699,8 @@ GL_IsProbablyAccelerated(const GL_RenderData *data) return SDL_TRUE; } -static SDL_Renderer * -GL_CreateRenderer(SDL_Window * window, Uint32 flags) +static int GL_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; GL_RenderData *data; GLint value; Uint32 window_flags; @@ -1759,15 +1729,8 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) } #endif - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - goto error; - } - - data = (GL_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (GL_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { - SDL_free(renderer); SDL_OutOfMemory(); goto error; } @@ -1786,7 +1749,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = GL_SetTextureScaleMode; renderer->SetRenderTarget = GL_SetRenderTarget; renderer->QueueSetViewport = GL_QueueSetViewport; - renderer->QueueSetDrawColor = GL_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = GL_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = GL_QueueDrawPoints; renderer->QueueDrawLines = GL_QueueDrawLines; renderer->QueueGeometry = GL_QueueGeometry; @@ -1799,26 +1762,23 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->GL_BindTexture = GL_BindTexture; renderer->GL_UnbindTexture = GL_UnbindTexture; renderer->info = GL_RenderDriver.info; - renderer->info.flags = 0; /* will set some flags below. */ + renderer->info.flags = 0; /* will set some flags below. */ renderer->driverdata = data; renderer->window = window; data->context = SDL_GL_CreateContext(window); if (!data->context) { - SDL_free(renderer); SDL_free(data); goto error; } if (SDL_GL_MakeCurrent(window, data->context) < 0) { SDL_GL_DeleteContext(data->context); - SDL_free(renderer); SDL_free(data); goto error; } if (GL_LoadFunctions(data) < 0) { SDL_GL_DeleteContext(data->context); - SDL_free(renderer); SDL_free(data); goto error; } @@ -1839,7 +1799,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) } else { SDL_GL_SetSwapInterval(0); } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } @@ -1849,7 +1809,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) data->debug_enabled = SDL_TRUE; } if (data->debug_enabled && SDL_GL_ExtensionSupported("GL_ARB_debug_output")) { - PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC) SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); + PFNGLDEBUGMESSAGECALLBACKARBPROC glDebugMessageCallbackARBFunc = (PFNGLDEBUGMESSAGECALLBACKARBPROC)SDL_GL_GetProcAddress("glDebugMessageCallbackARB"); data->GL_ARB_debug_output_supported = SDL_TRUE; data->glGetPointerv(GL_DEBUG_CALLBACK_FUNCTION_ARB, (GLvoid **)(char *)&data->next_error_callback); @@ -1867,7 +1827,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) if (verstr) { char verbuf[16]; char *ptr; - SDL_strlcpy(verbuf, verstr, sizeof (verbuf)); + SDL_strlcpy(verbuf, verstr, sizeof(verbuf)); ptr = SDL_strchr(verbuf, '.'); if (ptr) { *ptr = '\0'; @@ -1902,7 +1862,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) /* Check for multitexture support */ if (SDL_GL_ExtensionSupported("GL_ARB_multitexture")) { - data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB"); + data->glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)SDL_GL_GetProcAddress("glActiveTextureARB"); if (data->glActiveTextureARB) { data->GL_ARB_multitexture_supported = SDL_TRUE; data->glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &data->num_texture_units); @@ -1972,7 +1932,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) data->drawstate.color = 0xFFFFFFFF; data->drawstate.clear_color = 0xFFFFFFFF; - return renderer; + return 0; error: if (changed_window) { @@ -1982,27 +1942,22 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor); SDL_RecreateWindow(window, window_flags); } - return NULL; + return -1; } - SDL_RenderDriver GL_RenderDriver = { GL_CreateRenderer, - { - "opengl", - (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), - 4, - { - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_BGR888 - }, - 0, - 0} + { "opengl", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 4, + { SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_RGB888, + SDL_PIXELFORMAT_BGR888 }, + 0, + 0 } }; - -#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_OGL */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_shaders_gl.c b/src/render/opengl/SDL_shaders_gl.c index 4db0835555f26..c7bb6b07bc11f 100644 --- a/src/render/opengl/SDL_shaders_gl.c +++ b/src/render/opengl/SDL_shaders_gl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_OGL #include "SDL_stdinc.h" #include "SDL_opengl.h" @@ -61,6 +61,8 @@ struct GL_ShaderContext GL_ShaderData shaders[NUM_SHADERS]; }; +/* *INDENT-OFF* */ /* clang-format off */ + #define COLOR_VERTEX_SHADER \ "varying vec4 v_color;\n" \ "\n" \ @@ -235,8 +237,7 @@ struct GL_ShaderContext * NOTE: Always use sampler2D, etc here. We'll #define them to the * texture_rectangle versions if we choose to use that extension. */ -static const char *shader_source[NUM_SHADERS][2] = -{ +static const char *shader_source[NUM_SHADERS][2] = { /* SHADER_NONE */ { NULL, NULL }, @@ -387,8 +388,9 @@ static const char *shader_source[NUM_SHADERS][2] = #endif /* SDL_HAVE_YUV */ }; -static SDL_bool -CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, const char *source) +/* *INDENT-ON* */ /* clang-format on */ + +static SDL_bool CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, const char *source) { GLint status; const char *sources[2]; @@ -405,13 +407,13 @@ CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, co char *info; ctx->glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); - info = SDL_small_alloc(char, length+1, &isstack); + info = SDL_small_alloc(char, length + 1, &isstack); ctx->glGetInfoLogARB(shader, length, NULL, info); SDL_LogError(SDL_LOG_CATEGORY_RENDER, - "Failed to compile shader:\n%s%s\n%s", defines, source, info); + "Failed to compile shader:\n%s%s\n%s", defines, source, info); #ifdef DEBUG_SHADERS fprintf(stderr, - "Failed to compile shader:\n%s%s\n%s", defines, source, info); + "Failed to compile shader:\n%s%s\n%s", defines, source, info); #endif SDL_small_free(info, isstack); @@ -421,8 +423,7 @@ CompileShader(GL_ShaderContext *ctx, GLhandleARB shader, const char *defines, co } } -static SDL_bool -CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) +static SDL_bool CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) { const int num_tmus_bound = 4; const char *vert_defines = ""; @@ -439,12 +440,12 @@ CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) /* Make sure we use the correct sampler type for our texture type */ if (ctx->GL_ARB_texture_rectangle_supported) { frag_defines = -"#define sampler2D sampler2DRect\n" -"#define texture2D texture2DRect\n" -"#define UVCoordScale 0.5\n"; + "#define sampler2D sampler2DRect\n" + "#define texture2D texture2DRect\n" + "#define UVCoordScale 0.5\n"; } else { - frag_defines = -"#define UVCoordScale 1.0\n"; + frag_defines = + "#define UVCoordScale 1.0\n"; } /* Create one program object to rule them all */ @@ -471,7 +472,7 @@ CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) ctx->glUseProgramObjectARB(data->program); for (i = 0; i < num_tmus_bound; ++i) { char tex_name[10]; - SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); + (void)SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); location = ctx->glGetUniformLocationARB(data->program, tex_name); if (location >= 0) { ctx->glUniform1iARB(location, i); @@ -479,19 +480,17 @@ CompileShaderProgram(GL_ShaderContext *ctx, int index, GL_ShaderData *data) } ctx->glUseProgramObjectARB(0); - return (ctx->glGetError() == GL_NO_ERROR); + return ctx->glGetError() == GL_NO_ERROR; } -static void -DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data) +static void DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data) { ctx->glDeleteObjectARB(data->vert_shader); ctx->glDeleteObjectARB(data->frag_shader); ctx->glDeleteObjectARB(data->program); } -GL_ShaderContext * -GL_CreateShaderContext(void) +GL_ShaderContext *GL_CreateShaderContext(void) { GL_ShaderContext *ctx; SDL_bool shaders_supported; @@ -514,20 +513,20 @@ GL_CreateShaderContext(void) SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") && SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") && SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) { - ctx->glGetError = (GLenum (*)(void)) SDL_GL_GetProcAddress("glGetError"); - ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB"); - ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB"); - ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB"); - ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB"); - ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB"); - ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB"); - ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB"); - ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB"); - ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB"); - ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB"); - ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB"); - ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC) SDL_GL_GetProcAddress("glUniform1fARB"); - ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB"); + ctx->glGetError = (GLenum(*)(void))SDL_GL_GetProcAddress("glGetError"); + ctx->glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)SDL_GL_GetProcAddress("glAttachObjectARB"); + ctx->glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)SDL_GL_GetProcAddress("glCompileShaderARB"); + ctx->glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glCreateProgramObjectARB"); + ctx->glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"); + ctx->glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)SDL_GL_GetProcAddress("glDeleteObjectARB"); + ctx->glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)SDL_GL_GetProcAddress("glGetInfoLogARB"); + ctx->glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)SDL_GL_GetProcAddress("glGetObjectParameterivARB"); + ctx->glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)SDL_GL_GetProcAddress("glGetUniformLocationARB"); + ctx->glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)SDL_GL_GetProcAddress("glLinkProgramARB"); + ctx->glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)SDL_GL_GetProcAddress("glShaderSourceARB"); + ctx->glUniform1iARB = (PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); + ctx->glUniform1fARB = (PFNGLUNIFORM1FARBPROC)SDL_GL_GetProcAddress("glUniform1fARB"); + ctx->glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glUseProgramObjectARB"); if (ctx->glGetError && ctx->glAttachObjectARB && ctx->glCompileShaderARB && @@ -563,14 +562,12 @@ GL_CreateShaderContext(void) return ctx; } -void -GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader) +void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader) { ctx->glUseProgramObjectARB(ctx->shaders[shader].program); } -void -GL_DestroyShaderContext(GL_ShaderContext *ctx) +void GL_DestroyShaderContext(GL_ShaderContext *ctx) { int i; @@ -580,6 +577,6 @@ GL_DestroyShaderContext(GL_ShaderContext *ctx) SDL_free(ctx); } -#endif /* SDL_VIDEO_RENDER_OGL && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_OGL */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengl/SDL_shaders_gl.h b/src/render/opengl/SDL_shaders_gl.h index d3e6c398a06c5..18fb84b777ac3 100644 --- a/src/render/opengl/SDL_shaders_gl.h +++ b/src/render/opengl/SDL_shaders_gl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,8 @@ /* OpenGL shader implementation */ -typedef enum { +typedef enum +{ SHADER_INVALID = -1, SHADER_NONE, SHADER_SOLID, @@ -50,7 +51,7 @@ typedef enum { typedef struct GL_ShaderContext GL_ShaderContext; -extern GL_ShaderContext * GL_CreateShaderContext(void); +extern GL_ShaderContext *GL_CreateShaderContext(void); extern void GL_SelectShader(GL_ShaderContext *ctx, GL_Shader shader); extern void GL_DestroyShaderContext(GL_ShaderContext *ctx); diff --git a/src/render/opengles/SDL_glesfuncs.h b/src/render/opengles/SDL_glesfuncs.h index 40a6564554608..6a59fc4e50822 100644 --- a/src/render/opengles/SDL_glesfuncs.h +++ b/src/render/opengles/SDL_glesfuncs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -44,7 +44,7 @@ SDL_PROC(void, glLoadIdentity, (void)) SDL_PROC(void, glMatrixMode, (GLenum)) SDL_PROC(void, glOrthof, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat)) SDL_PROC(void, glPixelStorei, (GLenum, GLint)) -SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*)) +SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *)) SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei)) SDL_PROC(void, glTexCoordPointer, (GLint, GLenum, GLsizei, const GLvoid *)) SDL_PROC(void, glTexEnvf, (GLenum, GLenum, GLfloat)) @@ -57,6 +57,6 @@ SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei)) SDL_PROC_OES(void, glBindFramebufferOES, (GLenum, GLuint)) SDL_PROC_OES(void, glFramebufferTexture2DOES, (GLenum, GLenum, GLenum, GLuint, GLint)) SDL_PROC_OES(GLenum, glCheckFramebufferStatusOES, (GLenum)) -SDL_PROC_OES(void, glDeleteFramebuffersOES, (GLsizei, const GLuint*)) +SDL_PROC_OES(void, glDeleteFramebuffersOES, (GLsizei, const GLuint *)) /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index ba08a46e28055..4f1a9401e971c 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_OGL_ES #include "SDL_hints.h" #include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */ @@ -50,7 +50,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ /* Used to re-create the window with OpenGL ES capability */ -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); +extern int SDL_RecreateWindow(SDL_Window *window, Uint32 flags); static const float inv255f = 1.0f / 255.0f; @@ -58,9 +58,9 @@ typedef struct GLES_FBOList GLES_FBOList; struct GLES_FBOList { - Uint32 w, h; - GLuint FBO; - GLES_FBOList *next; + Uint32 w, h; + GLuint FBO; + GLES_FBOList *next; }; typedef struct @@ -85,8 +85,8 @@ typedef struct { SDL_GLContext context; -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; -#define SDL_PROC_OES SDL_PROC +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; +#define SDL_PROC_OES SDL_PROC #include "SDL_glesfuncs.h" #undef SDL_PROC #undef SDL_PROC_OES @@ -97,6 +97,7 @@ typedef struct SDL_bool GL_OES_blend_func_separate_supported; SDL_bool GL_OES_blend_equation_separate_supported; SDL_bool GL_OES_blend_subtract_supported; + SDL_bool GL_EXT_blend_minmax_supported; GLES_DrawStateCache drawstate; } GLES_RenderData; @@ -114,8 +115,7 @@ typedef struct GLES_FBOList *fbo; } GLES_TextureData; -static int -GLES_SetError(const char *prefix, GLenum result) +static int GLES_SetError(const char *prefix, GLenum result) { const char *error; @@ -148,31 +148,31 @@ GLES_SetError(const char *prefix, GLenum result) return SDL_SetError("%s: %s", prefix, error); } -static int GLES_LoadFunctions(GLES_RenderData * data) +static int GLES_LoadFunctions(GLES_RenderData *data) { -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_ANDROID +#elif defined(SDL_VIDEO_DRIVER_ANDROID) #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA +#elif defined(SDL_VIDEO_DRIVER_PANDORA) #define __SDL_NOGETPROCADDR__ #endif #ifdef __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; -#define SDL_PROC_OES(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; +#define SDL_PROC_OES(ret, func, params) data->func = func; #else -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ return SDL_SetError("Couldn't load GLES function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); -#define SDL_PROC_OES(ret,func,params) \ - do { \ + } \ + } while (0); +#define SDL_PROC_OES(ret, func, params) \ + do { \ data->func = SDL_GL_GetProcAddress(#func); \ - } while ( 0 ); + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "SDL_glesfuncs.h" @@ -181,29 +181,26 @@ static int GLES_LoadFunctions(GLES_RenderData * data) return 0; } -static GLES_FBOList * -GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h) +static GLES_FBOList *GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h) { - GLES_FBOList *result = data->framebuffers; - while ((result) && ((result->w != w) || (result->h != h)) ) { - result = result->next; - } - if (result == NULL) { - result = SDL_malloc(sizeof(GLES_FBOList)); - result->w = w; - result->h = h; - data->glGenFramebuffersOES(1, &result->FBO); - result->next = data->framebuffers; - data->framebuffers = result; - } - return result; + GLES_FBOList *result = data->framebuffers; + while ((result) && ((result->w != w) || (result->h != h))) { + result = result->next; + } + if (!result) { + result = SDL_malloc(sizeof(GLES_FBOList)); + result->w = w; + result->h = h; + data->glGenFramebuffersOES(1, &result->FBO); + result->next = data->framebuffers; + data->framebuffers = result; + } + return result; } - -static int -GLES_ActivateRenderer(SDL_Renderer * renderer) +static int GLES_ActivateRenderer(SDL_Renderer *renderer) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; if (SDL_GL_GetCurrentContext() != data->context) { if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { @@ -214,10 +211,9 @@ GLES_ActivateRenderer(SDL_Renderer * renderer) return 0; } -static void -GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void GLES_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; if (event->event == SDL_WINDOWEVENT_MINIMIZED) { /* According to Apple documentation, we need to finish drawing NOW! */ @@ -225,8 +221,7 @@ GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } -static int -GLES_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int GLES_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GL_GetDrawableSize(renderer->window, w, h); return 0; @@ -269,15 +264,18 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation) return GL_FUNC_SUBTRACT_OES; case SDL_BLENDOPERATION_REV_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT_OES; + case SDL_BLENDOPERATION_MINIMUM: + return GL_MIN_EXT; + case SDL_BLENDOPERATION_MAXIMUM: + return GL_MAX_EXT; default: return GL_INVALID_ENUM; } } -static SDL_bool -GLES_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool GLES_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -302,13 +300,18 @@ GLES_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) if (colorOperation != SDL_BLENDOPERATION_ADD && !data->GL_OES_blend_subtract_supported) { return SDL_FALSE; } + if (colorOperation == SDL_BLENDOPERATION_MINIMUM && !data->GL_EXT_blend_minmax_supported) { + return SDL_FALSE; + } + if (colorOperation == SDL_BLENDOPERATION_MAXIMUM && !data->GL_EXT_blend_minmax_supported) { + return SDL_FALSE; + } return SDL_TRUE; } -static int -GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int GLES_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *renderdata = (GLES_RenderData *)renderer->driverdata; GLES_TextureData *data; GLint internalFormat; GLenum format, type; @@ -319,7 +322,7 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GLES_ActivateRenderer(renderer); switch (texture->format) { - case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_RGBA32: internalFormat = GL_RGBA; format = GL_RGBA; type = GL_UNSIGNED_BYTE; @@ -328,7 +331,7 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return SDL_SetError("Texture format not supported"); } - data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data)); + data = (GLES_TextureData *)SDL_calloc(1, sizeof(*data)); if (!data) { return SDL_OutOfMemory(); } @@ -342,7 +345,6 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } - if (texture->access == SDL_TEXTUREACCESS_TARGET) { if (!renderdata->GL_OES_framebuffer_object_supported) { SDL_free(data); @@ -353,7 +355,6 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) data->fbo = NULL; } - renderdata->glGetError(); renderdata->glEnable(GL_TEXTURE_2D); renderdata->glGenTextures(1, &data->texture); @@ -370,8 +371,8 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) /* no NPOV textures allowed in OpenGL ES (yet) */ texture_w = SDL_powerof2(texture->w); texture_h = SDL_powerof2(texture->h); - data->texw = (GLfloat) texture->w / texture_w; - data->texh = (GLfloat) texture->h / texture_h; + data->texw = (GLfloat)texture->w / texture_w; + data->texh = (GLfloat)texture->h / texture_h; data->format = format; data->formattype = type; @@ -401,12 +402,11 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int GLES_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; - GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + GLES_RenderData *renderdata = (GLES_RenderData *)renderer->driverdata; + GLES_TextureData *data = (GLES_TextureData *)texture->driverdata; Uint8 *blob = NULL; Uint8 *src; int srcPitch; @@ -442,14 +442,14 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, renderdata->glBindTexture(data->type, data->texture); renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); renderdata->glTexSubImage2D(data->type, - 0, - rect->x, - rect->y, - rect->w, - rect->h, - data->format, - data->formattype, - src); + 0, + rect->x, + rect->y, + rect->w, + rect->h, + data->format, + data->formattype, + src); renderdata->glDisable(data->type); SDL_free(blob); @@ -462,23 +462,21 @@ GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static int -GLES_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int GLES_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + GLES_TextureData *data = (GLES_TextureData *)texture->driverdata; *pixels = - (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)data->pixels + rect->y * data->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = data->pitch; return 0; } -static void -GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void GLES_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + GLES_TextureData *data = (GLES_TextureData *)texture->driverdata; SDL_Rect rect; /* We do whole texture updates, at least for now */ @@ -489,11 +487,10 @@ GLES_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) GLES_UpdateTexture(renderer, texture, &rect, data->pixels, data->pitch); } -static void -GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void GLES_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; - GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + GLES_RenderData *renderdata = (GLES_RenderData *)renderer->driverdata; + GLES_TextureData *data = (GLES_TextureData *)texture->driverdata; GLenum glScaleMode = (scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR; renderdata->glBindTexture(data->type, data->texture); @@ -501,10 +498,9 @@ GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Sca renderdata->glTexParameteri(data->type, GL_TEXTURE_MAG_FILTER, glScaleMode); } -static int -GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int GLES_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; GLES_TextureData *texturedata = NULL; GLenum status; @@ -514,12 +510,12 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) data->drawstate.viewport_dirty = SDL_TRUE; - if (texture == NULL) { + if (!texture) { data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, data->window_framebuffer); return 0; } - texturedata = (GLES_TextureData *) texture->driverdata; + texturedata = (GLES_TextureData *)texture->driverdata; data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, texturedata->fbo->FBO); /* TODO: check if texture pixel format allows this operation */ data->glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, texturedata->type, texturedata->texture, 0); @@ -531,17 +527,14 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } - -static int -GLES_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int GLES_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -GLES_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GLES_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (GLfloat), 0, &cmd->data.draw.first); + GLfloat *verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, count * 2 * sizeof(GLfloat), 0, &cmd->data.draw.first); int i; if (!verts) { @@ -557,13 +550,12 @@ GLES_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_ return 0; } -static int -GLES_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GLES_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { int i; GLfloat prevx, prevy; - const size_t vertlen = (sizeof (GLfloat) * 2) * count; - GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, vertlen, 0, &cmd->data.draw.first); + const size_t vertlen = (sizeof(GLfloat) * 2) * count; + GLfloat *verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, vertlen, 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -583,7 +575,7 @@ GLES_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F for (i = 1; i < count; i++) { const GLfloat xstart = prevx; const GLfloat ystart = prevy; - const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ + const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ const GLfloat yend = points[i].y + 0.5f; /* bump a little in the direction we are moving in. */ const GLfloat deltax = xend - xstart; @@ -598,11 +590,10 @@ GLES_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F return 0; } -static int -GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { GLES_TextureData *texturedata = NULL; int i; @@ -610,13 +601,13 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture * GLfloat *verts; int sz = 2 + 4 + (texture ? 2 : 0); - verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, count * sz * sizeof (GLfloat), 0, &cmd->data.draw.first); + verts = (GLfloat *)SDL_AllocateRenderVertices(renderer, count * sz * sizeof(GLfloat), 0, &cmd->data.draw.first); if (!verts) { return -1; } if (texture) { - texturedata = (GLES_TextureData *) texture->driverdata; + texturedata = (GLES_TextureData *)texture->driverdata; } cmd->data.draw.count = count; @@ -636,8 +627,8 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture * j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); *(verts++) = xy_[0] * scale_x; *(verts++) = xy_[1] * scale_y; @@ -648,7 +639,7 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture * *(verts++) = col_.a * inv255f; if (texture) { - float *uv_ = (float *)((char*)uv + j * uv_stride); + float *uv_ = (float *)((char *)uv + j * uv_stride); *(verts++) = uv_[0] * texturedata->texw; *(verts++) = uv_[1] * texturedata->texh; } @@ -656,8 +647,7 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture * return 0; } -static void -SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd) +static void SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd) { const SDL_BlendMode blend = cmd->data.draw.blend; const Uint8 r = cmd->data.draw.r; @@ -667,10 +657,10 @@ SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd) const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); if (color != data->drawstate.color) { - const GLfloat fr = ((GLfloat) r) * inv255f; - const GLfloat fg = ((GLfloat) g) * inv255f; - const GLfloat fb = ((GLfloat) b) * inv255f; - const GLfloat fa = ((GLfloat) a) * inv255f; + const GLfloat fr = ((GLfloat)r) * inv255f; + const GLfloat fg = ((GLfloat)g) * inv255f; + const GLfloat fb = ((GLfloat)b) * inv255f; + const GLfloat fa = ((GLfloat)a) * inv255f; data->glColor4f(fr, fg, fb, fa); data->drawstate.color = color; } @@ -684,9 +674,9 @@ SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd) istarget ? viewport->y : (data->drawstate.drawableh - viewport->y - viewport->h), viewport->w, viewport->h); if (viewport->w && viewport->h) { - data->glOrthof((GLfloat) 0, (GLfloat) viewport->w, - (GLfloat) (istarget ? 0 : viewport->h), - (GLfloat) (istarget ? viewport->h : 0), + data->glOrthof((GLfloat)0, (GLfloat)viewport->w, + (GLfloat)(istarget ? 0 : viewport->h), + (GLfloat)(istarget ? viewport->h : 0), 0.0, 1.0); } data->glMatrixMode(GL_MODELVIEW); @@ -749,23 +739,21 @@ SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd) } } -static void -SetCopyState(GLES_RenderData *data, const SDL_RenderCommand *cmd) +static void SetCopyState(GLES_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; SetDrawState(data, cmd); if (texture != data->drawstate.texture) { - GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *)texture->driverdata; data->glBindTexture(GL_TEXTURE_2D, texturedata->texture); data->drawstate.texture = texture; } } -static int -GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int GLES_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; if (GLES_ActivateRenderer(renderer) < 0) { return -1; @@ -777,123 +765,129 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert int w, h; SDL_GL_GetDrawableSize(renderer->window, &w, &h); if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { - data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. + data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. data->drawstate.cliprect_dirty = SDL_TRUE; data->drawstate.drawablew = w; data->drawstate.drawableh = h; } - } while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; /* not used in this render backend. */ - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; /* not used in this render backend. */ + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &data->drawstate.viewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - data->drawstate.viewport_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { - data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; - } - if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&data->drawstate.cliprect, rect); - data->drawstate.cliprect_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; } - - case SDL_RENDERCMD_CLEAR: { - const Uint8 r = cmd->data.color.r; - const Uint8 g = cmd->data.color.g; - const Uint8 b = cmd->data.color.b; - const Uint8 a = cmd->data.color.a; - const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); - if (color != data->drawstate.clear_color) { - const GLfloat fr = ((GLfloat) r) * inv255f; - const GLfloat fg = ((GLfloat) g) * inv255f; - const GLfloat fb = ((GLfloat) b) * inv255f; - const GLfloat fa = ((GLfloat) a) * inv255f; - data->glClearColor(fr, fg, fb, fa); - data->drawstate.clear_color = color; - } - - if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { - data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; - } - - data->glClear(GL_COLOR_BUFFER_BIT); - - break; + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_DRAW_POINTS: { - const size_t count = cmd->data.draw.count; - const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first); - SetDrawState(data, cmd); - data->glVertexPointer(2, GL_FLOAT, 0, verts); - data->glDrawArrays(GL_POINTS, 0, (GLsizei) count); - break; + case SDL_RENDERCMD_CLEAR: + { + const Uint8 r = cmd->data.color.r; + const Uint8 g = cmd->data.color.g; + const Uint8 b = cmd->data.color.b; + const Uint8 a = cmd->data.color.a; + const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); + if (color != data->drawstate.clear_color) { + const GLfloat fr = ((GLfloat)r) * inv255f; + const GLfloat fg = ((GLfloat)g) * inv255f; + const GLfloat fb = ((GLfloat)b) * inv255f; + const GLfloat fa = ((GLfloat)a) * inv255f; + data->glClearColor(fr, fg, fb, fa); + data->drawstate.clear_color = color; } - case SDL_RENDERCMD_DRAW_LINES: { - const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first); - const size_t count = cmd->data.draw.count; - SDL_assert(count >= 2); - SetDrawState(data, cmd); - data->glVertexPointer(2, GL_FLOAT, 0, verts); - data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) count); - break; + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { + data->glDisable(GL_SCISSOR_TEST); + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + data->glClear(GL_COLOR_BUFFER_BIT); + + break; + } - case SDL_RENDERCMD_COPY: /* unused */ - break; + case SDL_RENDERCMD_DRAW_POINTS: + { + const size_t count = cmd->data.draw.count; + const GLfloat *verts = (GLfloat *)(((Uint8 *)vertices) + cmd->data.draw.first); + SetDrawState(data, cmd); + data->glVertexPointer(2, GL_FLOAT, 0, verts); + data->glDrawArrays(GL_POINTS, 0, (GLsizei)count); + break; + } - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_DRAW_LINES: + { + const GLfloat *verts = (GLfloat *)(((Uint8 *)vertices) + cmd->data.draw.first); + const size_t count = cmd->data.draw.count; + SDL_assert(count >= 2); + SetDrawState(data, cmd); + data->glVertexPointer(2, GL_FLOAT, 0, verts); + data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)count); + break; + } - case SDL_RENDERCMD_GEOMETRY: { - const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first); - SDL_Texture *texture = cmd->data.draw.texture; - const size_t count = cmd->data.draw.count; - int stride = (2 + 4 + (texture ? 2 : 0)) * sizeof (float); + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - if (texture) { - SetCopyState(data, cmd); - } else { - SetDrawState(data, cmd); - } + case SDL_RENDERCMD_COPY: /* unused */ + break; - data->glEnableClientState(GL_COLOR_ARRAY); + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - data->glVertexPointer(2, GL_FLOAT, stride, verts); - data->glColorPointer(4, GL_FLOAT, stride, verts + 2); - if (texture) { - data->glTexCoordPointer(2, GL_FLOAT, stride, verts + 2 + 4); - } + case SDL_RENDERCMD_GEOMETRY: + { + const GLfloat *verts = (GLfloat *)(((Uint8 *)vertices) + cmd->data.draw.first); + SDL_Texture *texture = cmd->data.draw.texture; + const size_t count = cmd->data.draw.count; + int stride = (2 + 4 + (texture ? 2 : 0)) * sizeof(float); - data->glDrawArrays(GL_TRIANGLES, 0, (GLsizei) count); + if (texture) { + SetCopyState(data, cmd); + } else { + SetDrawState(data, cmd); + } + + data->glEnableClientState(GL_COLOR_ARRAY); - data->glDisableClientState(GL_COLOR_ARRAY); - break; + data->glVertexPointer(2, GL_FLOAT, stride, verts); + data->glColorPointer(4, GL_FLOAT, stride, verts + 2); + if (texture) { + data->glTexCoordPointer(2, GL_FLOAT, stride, verts + 2 + 4); } - case SDL_RENDERCMD_NO_OP: - break; + data->glDrawArrays(GL_TRIANGLES, 0, (GLsizei)count); + + data->glDisableClientState(GL_COLOR_ARRAY); + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -902,12 +896,11 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert return 0; } -static int -GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 pixel_format, void * pixels, int pitch) +static int GLES_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 pixel_format, void *pixels, int pitch) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; - Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ABGR8888; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; + Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_RGBA32; void *temp_pixels; int temp_pitch; Uint8 *src, *dst, *tmp; @@ -926,15 +919,15 @@ GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, data->glPixelStorei(GL_PACK_ALIGNMENT, 1); - data->glReadPixels(rect->x, renderer->target ? rect->y : (h-rect->y)-rect->h, + data->glReadPixels(rect->x, renderer->target ? rect->y : (h - rect->y) - rect->h, rect->w, rect->h, GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels); /* Flip the rows to be top-down if necessary */ if (!renderer->target) { SDL_bool isstack; length = rect->w * SDL_BYTESPERPIXEL(temp_format); - src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; - dst = (Uint8*)temp_pixels; + src = (Uint8 *)temp_pixels + (rect->h - 1) * temp_pitch; + dst = (Uint8 *)temp_pixels; tmp = SDL_small_alloc(Uint8, length, &isstack); rows = rect->h / 2; while (rows--) { @@ -955,20 +948,18 @@ GLES_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -GLES_RenderPresent(SDL_Renderer * renderer) +static int GLES_RenderPresent(SDL_Renderer *renderer) { GLES_ActivateRenderer(renderer); return SDL_GL_SwapWindowWithResult(renderer->window); } -static void -GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void GLES_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *renderdata = (GLES_RenderData *)renderer->driverdata; - GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; + GLES_TextureData *data = (GLES_TextureData *)texture->driverdata; GLES_ActivateRenderer(renderer); @@ -990,30 +981,28 @@ GLES_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture->driverdata = NULL; } -static void -GLES_DestroyRenderer(SDL_Renderer * renderer) +static void GLES_DestroyRenderer(SDL_Renderer *renderer) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; if (data) { if (data->context) { while (data->framebuffers) { - GLES_FBOList *nextnode = data->framebuffers->next; - data->glDeleteFramebuffersOES(1, &data->framebuffers->FBO); - SDL_free(data->framebuffers); - data->framebuffers = nextnode; + GLES_FBOList *nextnode = data->framebuffers->next; + data->glDeleteFramebuffersOES(1, &data->framebuffers->FBO); + SDL_free(data->framebuffers); + data->framebuffers = nextnode; } SDL_GL_DeleteContext(data->context); } SDL_free(data); } - SDL_free(renderer); } -static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) +static int GLES_BindTexture(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; - GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *)texture->driverdata; GLES_ActivateRenderer(renderer); data->glEnable(GL_TEXTURE_2D); @@ -1032,10 +1021,10 @@ static int GLES_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, floa return 0; } -static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) +static int GLES_UnbindTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; - GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata; + GLES_RenderData *data = (GLES_RenderData *)renderer->driverdata; + GLES_TextureData *texturedata = (GLES_TextureData *)texture->driverdata; GLES_ActivateRenderer(renderer); data->glDisable(texturedata->type); @@ -1045,8 +1034,7 @@ static int GLES_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) return 0; } -static int -GLES_SetVSync(SDL_Renderer * renderer, const int vsync) +static int GLES_SetVSync(SDL_Renderer *renderer, const int vsync) { int retval; if (vsync) { @@ -1057,7 +1045,7 @@ GLES_SetVSync(SDL_Renderer * renderer, const int vsync) if (retval != 0) { return retval; } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } else { renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC; @@ -1065,12 +1053,9 @@ GLES_SetVSync(SDL_Renderer * renderer, const int vsync) return retval; } - -static SDL_Renderer * -GLES_CreateRenderer(SDL_Window * window, Uint32 flags) +static int GLES_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; - GLES_RenderData *data; + GLES_RenderData *data = NULL; GLint value; Uint32 window_flags; int profile_mask = 0, major = 0, minor = 0; @@ -1094,13 +1079,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) } } - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - goto error; - } - - data = (GLES_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (GLES_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { GLES_DestroyRenderer(renderer); SDL_OutOfMemory(); @@ -1117,7 +1096,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = GLES_SetTextureScaleMode; renderer->SetRenderTarget = GLES_SetRenderTarget; renderer->QueueSetViewport = GLES_QueueSetViewport; - renderer->QueueSetDrawColor = GLES_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = GLES_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = GLES_QueueDrawPoints; renderer->QueueDrawLines = GLES_QueueDrawLines; renderer->QueueGeometry = GLES_QueueGeometry; @@ -1154,7 +1133,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) } else { SDL_GL_SetSwapInterval(0); } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } @@ -1185,6 +1164,9 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) if (SDL_GL_ExtensionSupported("GL_OES_blend_subtract")) { data->GL_OES_blend_subtract_supported = SDL_TRUE; } + if (SDL_GL_ExtensionSupported("GL_EXT_blend_minmax")) { + data->GL_EXT_blend_minmax_supported = SDL_TRUE; + } /* Set up parameters for rendering */ data->glDisable(GL_DEPTH_TEST); @@ -1202,7 +1184,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) data->drawstate.color = 0xFFFFFFFF; data->drawstate.clear_color = 0xFFFFFFFF; - return renderer; + return 0; error: if (changed_window) { @@ -1212,21 +1194,19 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor); SDL_RecreateWindow(window, window_flags); } - return NULL; + return -1; } SDL_RenderDriver GLES_RenderDriver = { GLES_CreateRenderer, - { - "opengles", - (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC), - 1, - {SDL_PIXELFORMAT_ABGR8888}, - 0, - 0 - } + { "opengles", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC), + 1, + { SDL_PIXELFORMAT_RGBA32 }, + 0, + 0 } }; -#endif /* SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_OGL_ES */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/opengles2/SDL_gles2funcs.h b/src/render/opengles2/SDL_gles2funcs.h index ab8bf85bb9b7c..f6c8124fa9959 100644 --- a/src/render/opengles2/SDL_gles2funcs.h +++ b/src/render/opengles2/SDL_gles2funcs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -50,10 +50,10 @@ SDL_PROC(void, glGetShaderiv, (GLuint, GLenum, GLint *)) SDL_PROC(GLint, glGetUniformLocation, (GLuint, const char *)) SDL_PROC(void, glLinkProgram, (GLuint)) SDL_PROC(void, glPixelStorei, (GLenum, GLint)) -SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*)) +SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *)) SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei)) SDL_PROC(void, glShaderBinary, (GLsizei, const GLuint *, GLenum, const void *, GLsizei)) -#if __NACL__ +#ifdef __NACL__ SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const GLchar **, const GLint *)) #else SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const GLchar* const*, const GLint *)) @@ -72,7 +72,7 @@ SDL_PROC(void, glFramebufferTexture2D, (GLenum, GLenum, GLenum, GLuint, GLint)) SDL_PROC(GLenum, glCheckFramebufferStatus, (GLenum)) SDL_PROC(void, glDeleteFramebuffers, (GLsizei, const GLuint *)) SDL_PROC(GLint, glGetAttribLocation, (GLuint, const GLchar *)) -SDL_PROC(void, glGetProgramInfoLog, (GLuint, GLsizei, GLsizei*, GLchar*)) +SDL_PROC(void, glGetProgramInfoLog, (GLuint, GLsizei, GLsizei *, GLchar *)) SDL_PROC(void, glGenBuffers, (GLsizei, GLuint *)) SDL_PROC(void, glDeleteBuffers, (GLsizei, const GLuint *)) SDL_PROC(void, glBindBuffer, (GLenum, GLuint)) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 41bf300f4b56e..be182a8500715 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_OGL_ES2 #include "SDL_hints.h" #include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */ @@ -46,9 +46,6 @@ #define RENDERER_CONTEXT_MAJOR 2 #define RENDERER_CONTEXT_MINOR 0 -/* Used to re-create the window with OpenGL ES capability */ -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); - /************************************************************************************************* * Context structures * *************************************************************************************************/ @@ -57,9 +54,9 @@ typedef struct GLES2_FBOList GLES2_FBOList; struct GLES2_FBOList { - Uint32 w, h; - GLuint FBO; - GLES2_FBOList *next; + Uint32 w, h; + GLuint FBO; + GLES2_FBOList *next; }; typedef struct GLES2_TextureData @@ -152,7 +149,9 @@ typedef struct GLES2_RenderData SDL_bool debug_enabled; -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; + SDL_bool GL_EXT_blend_minmax_supported; + +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; #include "SDL_gles2funcs.h" #undef SDL_PROC GLES2_FBOList *framebuffers; @@ -177,27 +176,28 @@ typedef struct GLES2_RenderData static const float inv255f = 1.0f / 255.0f; - -SDL_FORCE_INLINE const char* -GL_TranslateError (GLenum error) +SDL_FORCE_INLINE const char * +GL_TranslateError(GLenum error) { -#define GL_ERROR_TRANSLATE(e) case e: return #e; +#define GL_ERROR_TRANSLATE(e) \ + case e: \ + return #e; switch (error) { - GL_ERROR_TRANSLATE(GL_INVALID_ENUM) - GL_ERROR_TRANSLATE(GL_INVALID_VALUE) - GL_ERROR_TRANSLATE(GL_INVALID_OPERATION) - GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY) - GL_ERROR_TRANSLATE(GL_NO_ERROR) + GL_ERROR_TRANSLATE(GL_INVALID_ENUM) + GL_ERROR_TRANSLATE(GL_INVALID_VALUE) + GL_ERROR_TRANSLATE(GL_INVALID_OPERATION) + GL_ERROR_TRANSLATE(GL_OUT_OF_MEMORY) + GL_ERROR_TRANSLATE(GL_NO_ERROR) default: return "UNKNOWN"; -} + } #undef GL_ERROR_TRANSLATE } SDL_FORCE_INLINE void GL_ClearErrors(SDL_Renderer *renderer) { - GLES2_RenderData *data = (GLES2_RenderData *) renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; if (!data->debug_enabled) { return; @@ -208,9 +208,9 @@ GL_ClearErrors(SDL_Renderer *renderer) } SDL_FORCE_INLINE int -GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) +GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { - GLES2_RenderData *data = (GLES2_RenderData *) renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; int ret = 0; if (!data->debug_enabled) { @@ -220,7 +220,7 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, for (;;) { GLenum error = data->glGetError(); if (error != GL_NO_ERROR) { - if (prefix == NULL || prefix[0] == '\0') { + if (!prefix || prefix[0] == '\0') { prefix = "generic"; } SDL_SetError("%s: %s (%d): %s %s (0x%X)", prefix, file, line, function, GL_TranslateError(error), error); @@ -238,31 +238,30 @@ GL_CheckAllErrors (const char *prefix, SDL_Renderer *renderer, const char *file, #define GL_CheckError(prefix, renderer) GL_CheckAllErrors(prefix, renderer, SDL_FILE, SDL_LINE, SDL_FUNCTION) #endif - /************************************************************************************************* * Renderer state APIs * *************************************************************************************************/ -static int GLES2_LoadFunctions(GLES2_RenderData * data) +static int GLES2_LoadFunctions(GLES2_RenderData *data) { -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_ANDROID +#elif defined(SDL_VIDEO_DRIVER_ANDROID) #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA +#elif defined(SDL_VIDEO_DRIVER_PANDORA) #define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; #else -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); + } \ + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "SDL_gles2funcs.h" @@ -270,26 +269,24 @@ static int GLES2_LoadFunctions(GLES2_RenderData * data) return 0; } -static GLES2_FBOList * -GLES2_GetFBO(GLES2_RenderData *data, Uint32 w, Uint32 h) +static GLES2_FBOList *GLES2_GetFBO(GLES2_RenderData *data, Uint32 w, Uint32 h) { - GLES2_FBOList *result = data->framebuffers; - while ((result) && ((result->w != w) || (result->h != h)) ) { - result = result->next; - } - if (result == NULL) { - result = SDL_malloc(sizeof(GLES2_FBOList)); - result->w = w; - result->h = h; - data->glGenFramebuffers(1, &result->FBO); - result->next = data->framebuffers; - data->framebuffers = result; - } - return result; + GLES2_FBOList *result = data->framebuffers; + while ((result) && ((result->w != w) || (result->h != h))) { + result = result->next; + } + if (!result) { + result = SDL_malloc(sizeof(GLES2_FBOList)); + result->w = w; + result->h = h; + data->glGenFramebuffers(1, &result->FBO); + result->next = data->framebuffers; + data->framebuffers = result; + } + return result; } -static int -GLES2_ActivateRenderer(SDL_Renderer * renderer) +static int GLES2_ActivateRenderer(SDL_Renderer *renderer) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; @@ -307,8 +304,7 @@ GLES2_ActivateRenderer(SDL_Renderer * renderer) return 0; } -static void -GLES2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void GLES2_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; @@ -318,8 +314,7 @@ GLES2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } -static int -GLES2_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int GLES2_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { SDL_GL_GetDrawableSize(renderer->window, w, h); return 0; @@ -362,14 +357,19 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation) return GL_FUNC_SUBTRACT; case SDL_BLENDOPERATION_REV_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT; + case SDL_BLENDOPERATION_MINIMUM: + return GL_MIN_EXT; + case SDL_BLENDOPERATION_MAXIMUM: + return GL_MAX_EXT; default: return GL_INVALID_ENUM; } } -static SDL_bool -GLES2_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool GLES2_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -385,12 +385,18 @@ GLES2_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) GetBlendEquation(alphaOperation) == GL_INVALID_ENUM) { return SDL_FALSE; } + + if (colorOperation == SDL_BLENDOPERATION_MINIMUM && !data->GL_EXT_blend_minmax_supported) { + return SDL_FALSE; + } + if (colorOperation == SDL_BLENDOPERATION_MAXIMUM && !data->GL_EXT_blend_minmax_supported) { + return SDL_FALSE; + } + return SDL_TRUE; } - -static GLES2_ProgramCacheEntry * -GLES2_CacheProgram(GLES2_RenderData *data, GLuint vertex, GLuint fragment) +static GLES2_ProgramCacheEntry *GLES2_CacheProgram(GLES2_RenderData *data, GLuint vertex, GLuint fragment) { GLES2_ProgramCacheEntry *entry; GLint linkSuccessful; @@ -456,13 +462,13 @@ GLES2_CacheProgram(GLES2_RenderData *data, GLuint vertex, GLuint fragment) data->glUseProgram(entry->id); if (entry->uniform_locations[GLES2_UNIFORM_TEXTURE_V] != -1) { - data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE_V], 2); /* always texture unit 2. */ + data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE_V], 2); /* always texture unit 2. */ } if (entry->uniform_locations[GLES2_UNIFORM_TEXTURE_U] != -1) { - data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE_U], 1); /* always texture unit 1. */ + data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE_U], 1); /* always texture unit 1. */ } if (entry->uniform_locations[GLES2_UNIFORM_TEXTURE] != -1) { - data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE], 0); /* always texture unit 0. */ + data->glUniform1i(entry->uniform_locations[GLES2_UNIFORM_TEXTURE], 0); /* always texture unit 0. */ } if (entry->uniform_locations[GLES2_UNIFORM_PROJECTION] != -1) { data->glUniformMatrix4fv(entry->uniform_locations[GLES2_UNIFORM_PROJECTION], 1, GL_FALSE, (GLfloat *)entry->projection); @@ -482,7 +488,7 @@ GLES2_CacheProgram(GLES2_RenderData *data, GLuint vertex, GLuint fragment) if (data->program_cache.count > GLES2_MAX_CACHED_PROGRAMS) { data->glDeleteProgram(data->program_cache.tail->id); data->program_cache.tail = data->program_cache.tail->prev; - if (data->program_cache.tail != NULL) { + if (data->program_cache.tail) { SDL_free(data->program_cache.tail->next); data->program_cache.tail->next = NULL; } @@ -491,8 +497,7 @@ GLES2_CacheProgram(GLES2_RenderData *data, GLuint vertex, GLuint fragment) return entry; } -static GLuint -GLES2_CacheShader(GLES2_RenderData *data, GLES2_ShaderType type, GLenum shader_type) +static GLuint GLES2_CacheShader(GLES2_RenderData *data, GLES2_ShaderType type, GLenum shader_type) { GLuint id = 0; GLint compileSuccessful = GL_FALSE; @@ -573,7 +578,7 @@ GLES2_CacheShader(GLES2_RenderData *data, GLES2_ShaderType type, GLenum shader_t return id; } -static int GLES2_CacheShaders(GLES2_RenderData * data) +static int GLES2_CacheShaders(GLES2_RenderData *data) { int shader; @@ -587,15 +592,14 @@ static int GLES2_CacheShaders(GLES2_RenderData * data) } else { shader_type = GL_FRAGMENT_SHADER; } - if (!GLES2_CacheShader(data, (GLES2_ShaderType) shader, shader_type)) { + if (!GLES2_CacheShader(data, (GLES2_ShaderType)shader, shader_type)) { return -1; } } return 0; } -static int -GLES2_SelectProgram(GLES2_RenderData *data, GLES2_ImageSource source, int w, int h) +static int GLES2_SelectProgram(GLES2_RenderData *data, GLES2_ImageSource source, int w, int h) { GLuint vertex; GLuint fragment; @@ -728,17 +732,15 @@ GLES2_SelectProgram(GLES2_RenderData *data, GLES2_ImageSource source, int w, int return -1; } -static int -GLES2_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int GLES2_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -GLES2_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GLES2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888)); - SDL_VertexSolid *verts = (SDL_VertexSolid *) SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); + const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_BGRA32 || renderer->target->format == SDL_PIXELFORMAT_BGRX32)); + SDL_VertexSolid *verts = (SDL_VertexSolid *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); int i; SDL_Color color; color.r = cmd->data.draw.r; @@ -767,13 +769,12 @@ GLES2_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL return 0; } -static int -GLES2_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int GLES2_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888)); + const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_BGRA32 || renderer->target->format == SDL_PIXELFORMAT_BGRX32)); int i; GLfloat prevx, prevy; - SDL_VertexSolid *verts = (SDL_VertexSolid *) SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); + SDL_VertexSolid *verts = (SDL_VertexSolid *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); SDL_Color color; color.r = cmd->data.draw.r; color.g = cmd->data.draw.g; @@ -807,7 +808,7 @@ GLES2_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_ for (i = 1; i < count; i++) { const GLfloat xstart = prevx; const GLfloat ystart = prevy; - const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ + const GLfloat xend = points[i].x + 0.5f; /* 0.5f to hit pixel center. */ const GLfloat yend = points[i].y + 0.5f; /* bump a little in the direction we are moving in. */ const GLfloat deltax = xend - xstart; @@ -824,21 +825,20 @@ GLES2_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_ return 0; } -static int -GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; - const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888)); + const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_BGRA32 || renderer->target->format == SDL_PIXELFORMAT_BGRX32)); int count = indices ? num_indices : num_vertices; cmd->data.draw.count = count; size_indices = indices ? size_indices : 0; if (texture) { - SDL_Vertex *verts = (SDL_Vertex *) SDL_AllocateRenderVertices(renderer, count * sizeof (*verts), 0, &cmd->data.draw.first); + SDL_Vertex *verts = (SDL_Vertex *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); if (!verts) { return -1; } @@ -858,9 +858,9 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); - uv_ = (float *)((char*)uv + j * uv_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); + uv_ = (float *)((char *)uv + j * uv_stride); verts->position.x = xy_[0] * scale_x; verts->position.y = xy_[1] * scale_y; @@ -878,7 +878,7 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture } } else { - SDL_VertexSolid *verts = (SDL_VertexSolid *) SDL_AllocateRenderVertices(renderer, count * sizeof (*verts), 0, &cmd->data.draw.first); + SDL_VertexSolid *verts = (SDL_VertexSolid *)SDL_AllocateRenderVertices(renderer, count * sizeof(*verts), 0, &cmd->data.draw.first); if (!verts) { return -1; } @@ -898,8 +898,8 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); verts->position.x = xy_[0] * scale_x; verts->position.y = xy_[1] * scale_y; @@ -918,8 +918,7 @@ GLES2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture return 0; } -static int -SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_ImageSource imgsrc, void *vertices) +static int SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_ImageSource imgsrc, void *vertices) { SDL_Texture *texture = cmd->data.draw.texture; const SDL_BlendMode blend = cmd->data.draw.blend; @@ -960,11 +959,11 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I } if ((texture != NULL) != data->drawstate.texturing) { - if (texture == NULL) { - data->glDisableVertexAttribArray((GLenum) GLES2_ATTRIBUTE_TEXCOORD); + if (!texture) { + data->glDisableVertexAttribArray((GLenum)GLES2_ATTRIBUTE_TEXCOORD); data->drawstate.texturing = SDL_FALSE; } else { - data->glEnableVertexAttribArray((GLenum) GLES2_ATTRIBUTE_TEXCOORD); + data->glEnableVertexAttribArray((GLenum)GLES2_ATTRIBUTE_TEXCOORD); data->drawstate.texturing = SDL_TRUE; } } @@ -976,8 +975,8 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I } if (texture) { - SDL_Vertex *verts = (SDL_Vertex *) (((Uint8 *) vertices) + cmd->data.draw.first); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)&verts->tex_coord); + uintptr_t base = (uintptr_t)vertices + cmd->data.draw.first; // address of first vertex, or base offset when using VBOs. + data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)(base + offsetof(SDL_Vertex, tex_coord))); } if (GLES2_SelectProgram(data, imgsrc, texture ? texture->w : 0, texture ? texture->h : 0) < 0) { @@ -987,9 +986,9 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I program = data->drawstate.program; if (program->uniform_locations[GLES2_UNIFORM_PROJECTION] != -1) { - if (SDL_memcmp(program->projection, data->drawstate.projection, sizeof (data->drawstate.projection)) != 0) { + if (SDL_memcmp(program->projection, data->drawstate.projection, sizeof(data->drawstate.projection)) != 0) { data->glUniformMatrix4fv(program->uniform_locations[GLES2_UNIFORM_PROJECTION], 1, GL_FALSE, (GLfloat *)data->drawstate.projection); - SDL_memcpy(program->projection, data->drawstate.projection, sizeof (data->drawstate.projection)); + SDL_memcpy(program->projection, data->drawstate.projection, sizeof(data->drawstate.projection)); } } @@ -1010,18 +1009,17 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I /* all drawing commands use this */ { - SDL_VertexSolid *verts = (SDL_VertexSolid *) (((Uint8 *) vertices) + cmd->data.draw.first); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *) &verts->position); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE /* Normalized */, stride, (const GLvoid *) &verts->color); + uintptr_t base = (uintptr_t)vertices + cmd->data.draw.first; // address of first vertex, or base offset when using VBOs. + data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, stride, (const GLvoid *)(base + offsetof(SDL_VertexSolid, position))); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE /* Normalized */, stride, (const GLvoid *)(base + offsetof(SDL_VertexSolid, color))); } return 0; } -static int -SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertices) +static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertices) { - GLES2_RenderData *data = (GLES2_RenderData *) renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_ImageSource sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; SDL_Texture *texture = cmd->data.draw.texture; int ret; @@ -1031,50 +1029,50 @@ SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertice /* Check if we need to do color mapping between the source and render target textures */ if (renderer->target->format != texture->format) { switch (texture->format) { - case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_BGRA32: switch (renderer->target->format) { - case SDL_PIXELFORMAT_ABGR8888: - case SDL_PIXELFORMAT_BGR888: + case SDL_PIXELFORMAT_RGBA32: + case SDL_PIXELFORMAT_RGBX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; - case SDL_PIXELFORMAT_RGB888: + case SDL_PIXELFORMAT_BGRX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; break; } break; - case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_RGBA32: switch (renderer->target->format) { - case SDL_PIXELFORMAT_ARGB8888: - case SDL_PIXELFORMAT_RGB888: + case SDL_PIXELFORMAT_BGRA32: + case SDL_PIXELFORMAT_BGRX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; - case SDL_PIXELFORMAT_BGR888: + case SDL_PIXELFORMAT_RGBX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; break; } break; - case SDL_PIXELFORMAT_RGB888: + case SDL_PIXELFORMAT_BGRX32: switch (renderer->target->format) { - case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_RGBA32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; - case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_BGRA32: sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; break; - case SDL_PIXELFORMAT_BGR888: + case SDL_PIXELFORMAT_RGBX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; } break; - case SDL_PIXELFORMAT_BGR888: + case SDL_PIXELFORMAT_RGBX32: switch (renderer->target->format) { - case SDL_PIXELFORMAT_ABGR8888: + case SDL_PIXELFORMAT_RGBA32: sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; break; - case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_BGRA32: sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; break; - case SDL_PIXELFORMAT_RGB888: + case SDL_PIXELFORMAT_BGRX32: sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; break; } @@ -1098,46 +1096,46 @@ SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertice return SDL_SetError("Unsupported texture format"); } } else { - sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; /* Texture formats match, use the non color mapping shader (even if the formats are not ABGR) */ } } else { switch (texture->format) { - case SDL_PIXELFORMAT_ARGB8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; - break; - case SDL_PIXELFORMAT_ABGR8888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; - break; - case SDL_PIXELFORMAT_RGB888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; - break; - case SDL_PIXELFORMAT_BGR888: - sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; - break; + case SDL_PIXELFORMAT_BGRA32: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ARGB; + break; + case SDL_PIXELFORMAT_RGBA32: + sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; + break; + case SDL_PIXELFORMAT_BGRX32: + sourceType = GLES2_IMAGESOURCE_TEXTURE_RGB; + break; + case SDL_PIXELFORMAT_RGBX32: + sourceType = GLES2_IMAGESOURCE_TEXTURE_BGR; + break; #if SDL_HAVE_YUV - case SDL_PIXELFORMAT_IYUV: - case SDL_PIXELFORMAT_YV12: - sourceType = GLES2_IMAGESOURCE_TEXTURE_YUV; - break; - case SDL_PIXELFORMAT_NV12: - sourceType = GLES2_IMAGESOURCE_TEXTURE_NV12; - break; - case SDL_PIXELFORMAT_NV21: - sourceType = GLES2_IMAGESOURCE_TEXTURE_NV21; - break; + case SDL_PIXELFORMAT_IYUV: + case SDL_PIXELFORMAT_YV12: + sourceType = GLES2_IMAGESOURCE_TEXTURE_YUV; + break; + case SDL_PIXELFORMAT_NV12: + sourceType = GLES2_IMAGESOURCE_TEXTURE_NV12; + break; + case SDL_PIXELFORMAT_NV21: + sourceType = GLES2_IMAGESOURCE_TEXTURE_NV21; + break; #endif - case SDL_PIXELFORMAT_EXTERNAL_OES: - sourceType = GLES2_IMAGESOURCE_TEXTURE_EXTERNAL_OES; - break; - default: - return SDL_SetError("Unsupported texture format"); + case SDL_PIXELFORMAT_EXTERNAL_OES: + sourceType = GLES2_IMAGESOURCE_TEXTURE_EXTERNAL_OES; + break; + default: + return SDL_SetError("Unsupported texture format"); } } ret = SetDrawState(data, cmd, sourceType, vertices); if (texture != data->drawstate.texture) { - GLES2_TextureData *tdata = (GLES2_TextureData *) texture->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; #if SDL_HAVE_YUV if (tdata->yuv) { data->glActiveTexture(GL_TEXTURE2); @@ -1161,11 +1159,10 @@ SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertice return ret; } -static int -GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int GLES2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - GLES2_RenderData *data = (GLES2_RenderData *) renderer->driverdata; - const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_ARGB8888 || renderer->target->format == SDL_PIXELFORMAT_RGB888)); + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_BGRA32 || renderer->target->format == SDL_PIXELFORMAT_BGRX32)); #if USE_VERTEX_BUFFER_OBJECTS const int vboidx = data->current_vertex_buffer; @@ -1181,7 +1178,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver int w, h; SDL_GL_GetDrawableSize(renderer->window, &w, &h); if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { - data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. + data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. data->drawstate.cliprect_dirty = SDL_TRUE; data->drawstate.drawablew = w; data->drawstate.drawableh = h; @@ -1203,149 +1200,157 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver if (data->current_vertex_buffer >= SDL_arraysize(data->vertex_buffers)) { data->current_vertex_buffer = 0; } - vertices = NULL; /* attrib pointers will be offsets into the VBO. */ + // attrib pointers will be offsets into the VBO. + vertices = (void *)(uintptr_t)0; // must be the exact value 0, not NULL (the representation of NULL is not guaranteed to be 0). #endif while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &data->drawstate.viewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - data->drawstate.viewport_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { - data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; - } - - if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&data->drawstate.cliprect, rect); - data->drawstate.cliprect_dirty = SDL_TRUE; - } - break; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; } - case SDL_RENDERCMD_CLEAR: { - const Uint8 r = colorswap ? cmd->data.color.b : cmd->data.color.r; - const Uint8 g = cmd->data.color.g; - const Uint8 b = colorswap ? cmd->data.color.r : cmd->data.color.b; - const Uint8 a = cmd->data.color.a; - const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); - if (color != data->drawstate.clear_color) { - const GLfloat fr = ((GLfloat) r) * inv255f; - const GLfloat fg = ((GLfloat) g) * inv255f; - const GLfloat fb = ((GLfloat) b) * inv255f; - const GLfloat fa = ((GLfloat) a) * inv255f; - data->glClearColor(fr, fg, fb, fa); - data->drawstate.clear_color = color; - } - - if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { - data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; - } + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; + } + break; + } - data->glClear(GL_COLOR_BUFFER_BIT); - break; + case SDL_RENDERCMD_CLEAR: + { + const Uint8 r = colorswap ? cmd->data.color.b : cmd->data.color.r; + const Uint8 g = cmd->data.color.g; + const Uint8 b = colorswap ? cmd->data.color.r : cmd->data.color.b; + const Uint8 a = cmd->data.color.a; + const Uint32 color = (((Uint32)a << 24) | (r << 16) | (g << 8) | b); + if (color != data->drawstate.clear_color) { + const GLfloat fr = ((GLfloat)r) * inv255f; + const GLfloat fg = ((GLfloat)g) * inv255f; + const GLfloat fb = ((GLfloat)b) * inv255f; + const GLfloat fa = ((GLfloat)a) * inv255f; + data->glClearColor(fr, fg, fb, fa); + data->drawstate.clear_color = color; } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { + data->glDisable(GL_SCISSOR_TEST); + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; + } - case SDL_RENDERCMD_COPY: /* unused */ - break; + data->glClear(GL_COLOR_BUFFER_BIT); + break; + } - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - case SDL_RENDERCMD_DRAW_LINES: { - if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID, vertices) == 0) { - size_t count = cmd->data.draw.count; - if (count > 2) { - /* joined lines cannot be grouped */ - data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)count); - } else { - /* let's group non joined lines */ - SDL_RenderCommand *finalcmd = cmd; - SDL_RenderCommand *nextcmd = cmd->next; - SDL_BlendMode thisblend = cmd->data.draw.blend; - - while (nextcmd != NULL) { - const SDL_RenderCommandType nextcmdtype = nextcmd->command; - if (nextcmdtype != SDL_RENDERCMD_DRAW_LINES) { - break; /* can't go any further on this draw call, different render command up next. */ - } else if (nextcmd->data.draw.count != 2) { - break; /* can't go any further on this draw call, those are joined lines */ - } else if (nextcmd->data.draw.blend != thisblend) { - break; /* can't go any further on this draw call, different blendmode copy up next. */ - } else { - finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += nextcmd->data.draw.count; - } - nextcmd = nextcmd->next; - } + case SDL_RENDERCMD_COPY: /* unused */ + break; - data->glDrawArrays(GL_LINES, 0, (GLsizei)count); - cmd = finalcmd; /* skip any copy commands we just combined in here. */ - } - } - break; - } + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; - case SDL_RENDERCMD_DRAW_POINTS: - case SDL_RENDERCMD_GEOMETRY: { - /* as long as we have the same copy command in a row, with the - same texture, we can combine them all into a single draw call. */ - SDL_Texture *thistexture = cmd->data.draw.texture; - SDL_BlendMode thisblend = cmd->data.draw.blend; - const SDL_RenderCommandType thiscmdtype = cmd->command; - SDL_RenderCommand *finalcmd = cmd; - SDL_RenderCommand *nextcmd = cmd->next; + case SDL_RENDERCMD_DRAW_LINES: + { + if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID, vertices) == 0) { size_t count = cmd->data.draw.count; - int ret; - while (nextcmd != NULL) { - const SDL_RenderCommandType nextcmdtype = nextcmd->command; - if (nextcmdtype != thiscmdtype) { - break; /* can't go any further on this draw call, different render command up next. */ - } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { - break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ - } else { - finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += nextcmd->data.draw.count; + if (count > 2) { + /* joined lines cannot be grouped */ + data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)count); + } else { + /* let's group non joined lines */ + SDL_RenderCommand *finalcmd = cmd; + SDL_RenderCommand *nextcmd = cmd->next; + SDL_BlendMode thisblend = cmd->data.draw.blend; + + while (nextcmd) { + const SDL_RenderCommandType nextcmdtype = nextcmd->command; + if (nextcmdtype != SDL_RENDERCMD_DRAW_LINES) { + break; /* can't go any further on this draw call, different render command up next. */ + } else if (nextcmd->data.draw.count != 2) { + break; /* can't go any further on this draw call, those are joined lines */ + } else if (nextcmd->data.draw.blend != thisblend) { + break; /* can't go any further on this draw call, different blendmode copy up next. */ + } else { + finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ + count += nextcmd->data.draw.count; + } + nextcmd = nextcmd->next; } - nextcmd = nextcmd->next; + + data->glDrawArrays(GL_LINES, 0, (GLsizei)count); + cmd = finalcmd; /* skip any copy commands we just combined in here. */ } + } + break; + } - if (thistexture) { - ret = SetCopyState(renderer, cmd, vertices); + case SDL_RENDERCMD_DRAW_POINTS: + case SDL_RENDERCMD_GEOMETRY: + { + /* as long as we have the same copy command in a row, with the + same texture, we can combine them all into a single draw call. */ + SDL_Texture *thistexture = cmd->data.draw.texture; + SDL_BlendMode thisblend = cmd->data.draw.blend; + const SDL_RenderCommandType thiscmdtype = cmd->command; + SDL_RenderCommand *finalcmd = cmd; + SDL_RenderCommand *nextcmd = cmd->next; + size_t count = cmd->data.draw.count; + int ret; + while (nextcmd) { + const SDL_RenderCommandType nextcmdtype = nextcmd->command; + if (nextcmdtype != thiscmdtype) { + break; /* can't go any further on this draw call, different render command up next. */ + } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { + break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ } else { - ret = SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID, vertices); + finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ + count += nextcmd->data.draw.count; } + nextcmd = nextcmd->next; + } - if (ret == 0) { - int op = GL_TRIANGLES; /* SDL_RENDERCMD_GEOMETRY */ - if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { - op = GL_POINTS; - } - data->glDrawArrays(op, 0, (GLsizei) count); - } + if (thistexture) { + ret = SetCopyState(renderer, cmd, vertices); + } else { + ret = SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID, vertices); + } - cmd = finalcmd; /* skip any copy commands we just combined in here. */ - break; + if (ret == 0) { + int op = GL_TRIANGLES; /* SDL_RENDERCMD_GEOMETRY */ + if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { + op = GL_POINTS; + } + data->glDrawArrays(op, 0, (GLsizei)count); } - case SDL_RENDERCMD_NO_OP: - break; + cmd = finalcmd; /* skip any copy commands we just combined in here. */ + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -1354,8 +1359,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver return GL_CheckError("", renderer); } -static void -GLES2_DestroyRenderer(SDL_Renderer *renderer) +static void GLES2_DestroyRenderer(SDL_Renderer *renderer) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; @@ -1403,11 +1407,9 @@ GLES2_DestroyRenderer(SDL_Renderer *renderer) SDL_free(data); } - SDL_free(renderer); } -static int -GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *data; @@ -1417,15 +1419,14 @@ GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) GLES2_ActivateRenderer(renderer); - renderdata->drawstate.texture = NULL; /* we trash this state. */ + renderdata->drawstate.texture = NULL; /* we trash this state. */ /* Determine the corresponding GLES texture format params */ - switch (texture->format) - { - case SDL_PIXELFORMAT_ARGB8888: - case SDL_PIXELFORMAT_ABGR8888: - case SDL_PIXELFORMAT_RGB888: - case SDL_PIXELFORMAT_BGR888: + switch (texture->format) { + case SDL_PIXELFORMAT_BGRA32: + case SDL_PIXELFORMAT_RGBA32: + case SDL_PIXELFORMAT_BGRX32: + case SDL_PIXELFORMAT_RGBX32: format = GL_RGBA; type = GL_UNSIGNED_BYTE; break; @@ -1478,7 +1479,7 @@ GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) if (texture->access == SDL_TEXTUREACCESS_STREAMING) { size_t size; data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); - size = texture->h * data->pitch; + size = (size_t)texture->h * data->pitch; #if SDL_HAVE_YUV if (data->yuv) { /* Need to add size for the U and V planes */ @@ -1563,31 +1564,27 @@ GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) } if (texture->access == SDL_TEXTUREACCESS_TARGET) { - data->fbo = GLES2_GetFBO(renderer->driverdata, texture->w, texture->h); + data->fbo = GLES2_GetFBO(renderer->driverdata, texture->w, texture->h); } else { - data->fbo = NULL; + data->fbo = NULL; } return GL_CheckError("", renderer); } -static int -GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, GLint pitch, GLint bpp) +static int GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels, GLint pitch, GLint bpp) { Uint8 *blob = NULL; -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - Uint32 *blob2 = NULL; -#endif Uint8 *src; - int src_pitch; + size_t src_pitch; int y; if ((width == 0) || (height == 0) || (bpp == 0)) { - return 0; /* nothing to do */ + return 0; /* nothing to do */ } /* Reformat the texture data into a tightly packed array */ - src_pitch = width * bpp; + src_pitch = (size_t)width * bpp; src = (Uint8 *)pixels; if (pitch != src_pitch) { blob = (Uint8 *)SDL_malloc(src_pitch * height); @@ -1595,8 +1592,7 @@ GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoffset, GLint return SDL_OutOfMemory(); } src = blob; - for (y = 0; y < height; ++y) - { + for (y = 0; y < height; ++y) { SDL_memcpy(src, pixels, src_pitch); src += src_pitch; pixels = (Uint8 *)pixels + pitch; @@ -1604,39 +1600,15 @@ GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoffset, GLint src = blob; } -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - if (format == GL_RGBA) { - int i; - Uint32 *src32 = (Uint32 *)src; - blob2 = (Uint32 *)SDL_malloc(src_pitch * height); - if (!blob2) { - if (blob) { - SDL_free(blob); - } - return SDL_OutOfMemory(); - } - for (i = 0; i < (src_pitch * height) / 4; i++) { - blob2[i] = SDL_Swap32(src32[i]); - } - src = (Uint8 *) blob2; - } -#endif - data->glTexSubImage2D(target, 0, xoffset, yoffset, width, height, format, type, src); if (blob) { SDL_free(blob); } -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - if (blob2) { - SDL_free(blob2); - } -#endif return 0; } -static int -GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, - const void *pixels, int pitch) +static int GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + const void *pixels, int pitch) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; @@ -1648,65 +1620,64 @@ GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect return 0; } - data->drawstate.texture = NULL; /* we trash this state. */ + data->drawstate.texture = NULL; /* we trash this state. */ /* Create a texture subimage with the supplied data */ data->glBindTexture(tdata->texture_type, tdata->texture); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x, - rect->y, - rect->w, - rect->h, - tdata->pixel_format, - tdata->pixel_type, - pixels, pitch, SDL_BYTESPERPIXEL(texture->format)); + rect->x, + rect->y, + rect->w, + rect->h, + tdata->pixel_format, + tdata->pixel_type, + pixels, pitch, SDL_BYTESPERPIXEL(texture->format)); #if SDL_HAVE_YUV if (tdata->yuv) { /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + pixels = (const void *)((const Uint8 *)pixels + rect->h * pitch); if (texture->format == SDL_PIXELFORMAT_YV12) { data->glBindTexture(tdata->texture_type, tdata->texture_v); } else { data->glBindTexture(tdata->texture_type, tdata->texture_u); } GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - tdata->pixel_format, - tdata->pixel_type, - pixels, (pitch + 1) / 2, 1); - + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + tdata->pixel_format, + tdata->pixel_type, + pixels, (pitch + 1) / 2, 1); /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + ((rect->h + 1) / 2) * ((pitch + 1)/2)); + pixels = (const void *)((const Uint8 *)pixels + ((rect->h + 1) / 2) * ((pitch + 1) / 2)); if (texture->format == SDL_PIXELFORMAT_YV12) { data->glBindTexture(tdata->texture_type, tdata->texture_u); } else { data->glBindTexture(tdata->texture_type, tdata->texture_v); } GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - tdata->pixel_format, - tdata->pixel_type, - pixels, (pitch + 1) / 2, 1); + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + tdata->pixel_format, + tdata->pixel_type, + pixels, (pitch + 1) / 2, 1); } else if (tdata->nv12) { /* Skip to the correct offset into the next texture */ - pixels = (const void*)((const Uint8*)pixels + rect->h * pitch); + pixels = (const void *)((const Uint8 *)pixels + rect->h * pitch); data->glBindTexture(tdata->texture_type, tdata->texture_u); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - GL_LUMINANCE_ALPHA, - GL_UNSIGNED_BYTE, - pixels, 2 * ((pitch + 1) / 2), 2); + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_BYTE, + pixels, 2 * ((pitch + 1) / 2), 2); } #endif @@ -1714,12 +1685,11 @@ GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect } #if SDL_HAVE_YUV -static int -GLES2_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int GLES2_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; @@ -1731,46 +1701,45 @@ GLES2_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } - data->drawstate.texture = NULL; /* we trash this state. */ + data->drawstate.texture = NULL; /* we trash this state. */ data->glBindTexture(tdata->texture_type, tdata->texture_v); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - tdata->pixel_format, - tdata->pixel_type, - Vplane, Vpitch, 1); + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + tdata->pixel_format, + tdata->pixel_type, + Vplane, Vpitch, 1); data->glBindTexture(tdata->texture_type, tdata->texture_u); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - tdata->pixel_format, - tdata->pixel_type, - Uplane, Upitch, 1); + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + tdata->pixel_format, + tdata->pixel_type, + Uplane, Upitch, 1); data->glBindTexture(tdata->texture_type, tdata->texture); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x, - rect->y, - rect->w, - rect->h, - tdata->pixel_format, - tdata->pixel_type, - Yplane, Ypitch, 1); + rect->x, + rect->y, + rect->w, + rect->h, + tdata->pixel_format, + tdata->pixel_type, + Yplane, Ypitch, 1); return GL_CheckError("glTexSubImage2D()", renderer); } -static int -GLES2_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int GLES2_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; @@ -1782,35 +1751,34 @@ GLES2_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } - data->drawstate.texture = NULL; /* we trash this state. */ + data->drawstate.texture = NULL; /* we trash this state. */ data->glBindTexture(tdata->texture_type, tdata->texture_u); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - GL_LUMINANCE_ALPHA, - GL_UNSIGNED_BYTE, - UVplane, UVpitch, 2); + rect->x / 2, + rect->y / 2, + (rect->w + 1) / 2, + (rect->h + 1) / 2, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_BYTE, + UVplane, UVpitch, 2); data->glBindTexture(tdata->texture_type, tdata->texture); GLES2_TexSubImage2D(data, tdata->texture_type, - rect->x, - rect->y, - rect->w, - rect->h, - tdata->pixel_format, - tdata->pixel_type, - Yplane, Ypitch, 1); + rect->x, + rect->y, + rect->w, + rect->h, + tdata->pixel_format, + tdata->pixel_type, + Yplane, Ypitch, 1); return GL_CheckError("glTexSubImage2D()", renderer); } #endif -static int -GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, - void **pixels, int *pitch) +static int GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, + void **pixels, int *pitch) { GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; @@ -1823,8 +1791,7 @@ GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect * return 0; } -static void -GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; SDL_Rect rect; @@ -1837,11 +1804,10 @@ GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) GLES2_UpdateTexture(renderer, texture, &rect, tdata->pixel_data, tdata->pitch); } -static void -GLES2_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void GLES2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GLES2_RenderData *renderdata = (GLES2_RenderData *) renderer->driverdata; - GLES2_TextureData *data = (GLES2_TextureData *) texture->driverdata; + GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->driverdata; + GLES2_TextureData *data = (GLES2_TextureData *)texture->driverdata; GLenum glScaleMode = (scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR; #if SDL_HAVE_YUV @@ -1869,19 +1835,18 @@ GLES2_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Sc renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, glScaleMode); } -static int -GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int GLES2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES2_RenderData *data = (GLES2_RenderData *) renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *texturedata = NULL; GLenum status; data->drawstate.viewport_dirty = SDL_TRUE; - if (texture == NULL) { + if (!texture) { data->glBindFramebuffer(GL_FRAMEBUFFER, data->window_framebuffer); } else { - texturedata = (GLES2_TextureData *) texture->driverdata; + texturedata = (GLES2_TextureData *)texture->driverdata; data->glBindFramebuffer(GL_FRAMEBUFFER, texturedata->fbo->FBO); /* TODO: check if texture pixel format allows this operation */ data->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texturedata->texture_type, texturedata->texture, 0); @@ -1894,8 +1859,7 @@ GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static void -GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; @@ -1926,12 +1890,11 @@ GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) } } -static int -GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 pixel_format, void * pixels, int pitch) +static int GLES2_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 pixel_format, void *pixels, int pitch) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ABGR8888; + Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_RGBA32; size_t buflen; void *temp_pixels; int temp_pitch; @@ -1940,9 +1903,9 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, int status; temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); - buflen = rect->h * temp_pitch; + buflen = (size_t)rect->h * temp_pitch; if (buflen == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } temp_pixels = SDL_malloc(buflen); @@ -1952,7 +1915,7 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, SDL_GetRendererOutputSize(renderer, &w, &h); - data->glReadPixels(rect->x, renderer->target ? rect->y : (h-rect->y)-rect->h, + data->glReadPixels(rect->x, renderer->target ? rect->y : (h - rect->y) - rect->h, rect->w, rect->h, GL_RGBA, GL_UNSIGNED_BYTE, temp_pixels); if (GL_CheckError("glReadPixels()", renderer) < 0) { return -1; @@ -1962,8 +1925,8 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, if (!renderer->target) { SDL_bool isstack; length = rect->w * SDL_BYTESPERPIXEL(temp_format); - src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; - dst = (Uint8*)temp_pixels; + src = (Uint8 *)temp_pixels + (rect->h - 1) * temp_pitch; + dst = (Uint8 *)temp_pixels; tmp = SDL_small_alloc(Uint8, length, &isstack); rows = rect->h / 2; while (rows--) { @@ -1984,15 +1947,13 @@ GLES2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, return status; } -static int -GLES2_RenderPresent(SDL_Renderer *renderer) +static int GLES2_RenderPresent(SDL_Renderer *renderer) { /* Tell the video driver to swap buffers */ return SDL_GL_SwapWindowWithResult(renderer->window); } -static int -GLES2_SetVSync(SDL_Renderer * renderer, const int vsync) +static int GLES2_SetVSync(SDL_Renderer *renderer, const int vsync) { int retval; if (vsync) { @@ -2003,7 +1964,7 @@ GLES2_SetVSync(SDL_Renderer * renderer, const int vsync) if (retval != 0) { return retval; } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } else { renderer->info.flags &= ~SDL_RENDERER_PRESENTVSYNC; @@ -2011,14 +1972,13 @@ GLES2_SetVSync(SDL_Renderer * renderer, const int vsync) return retval; } - /************************************************************************************************* * Bind/unbinding of textures *************************************************************************************************/ -static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh); -static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture); +static int GLES2_BindTexture(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh); +static int GLES2_UnbindTexture(SDL_Renderer *renderer, SDL_Texture *texture); -static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh) +static int GLES2_BindTexture(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata; @@ -2054,7 +2014,7 @@ static int GLES2_BindTexture (SDL_Renderer * renderer, SDL_Texture *texture, flo return 0; } -static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) +static int GLES2_UnbindTexture(SDL_Renderer *renderer, SDL_Texture *texture) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata; @@ -2066,16 +2026,13 @@ static int GLES2_UnbindTexture (SDL_Renderer * renderer, SDL_Texture *texture) return 0; } - /************************************************************************************************* * Renderer instantiation * *************************************************************************************************/ -static SDL_Renderer * -GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) +static int GLES2_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; - GLES2_RenderData *data; + GLES2_RenderData *data = NULL; Uint32 window_flags = 0; /* -Wconditional-uninitialized */ GLint window_framebuffer; GLint value; @@ -2108,16 +2065,8 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) } } - /* Create the renderer struct */ - renderer = (SDL_Renderer *)SDL_calloc(1, sizeof(SDL_Renderer)); - if (!renderer) { - SDL_OutOfMemory(); - goto error; - } - data = (GLES2_RenderData *)SDL_calloc(1, sizeof(GLES2_RenderData)); if (!data) { - SDL_free(renderer); SDL_OutOfMemory(); goto error; } @@ -2129,32 +2078,24 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) /* Create an OpenGL ES 2.0 context */ data->context = SDL_GL_CreateContext(window); if (!data->context) { - SDL_free(renderer); - SDL_free(data); goto error; } if (SDL_GL_MakeCurrent(window, data->context) < 0) { SDL_GL_DeleteContext(data->context); - SDL_free(renderer); - SDL_free(data); goto error; } if (GLES2_LoadFunctions(data) < 0) { SDL_GL_DeleteContext(data->context); - SDL_free(renderer); - SDL_free(data); goto error; } if (GLES2_CacheShaders(data) < 0) { SDL_GL_DeleteContext(data->context); - SDL_free(renderer); - SDL_free(data); goto error; } -#if __WINRT__ +#ifdef __WINRT__ /* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync * is turned on. Not doing so will freeze the screen's contents to that * of the first drawn frame. @@ -2167,7 +2108,7 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) } else { SDL_GL_SetSwapInterval(0); } - if (SDL_GL_GetSwapInterval() > 0) { + if (SDL_GL_GetSwapInterval() != 0) { renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } @@ -2194,32 +2135,32 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) data->window_framebuffer = (GLuint)window_framebuffer; /* Populate the function pointers for the module */ - renderer->WindowEvent = GLES2_WindowEvent; - renderer->GetOutputSize = GLES2_GetOutputSize; - renderer->SupportsBlendMode = GLES2_SupportsBlendMode; - renderer->CreateTexture = GLES2_CreateTexture; - renderer->UpdateTexture = GLES2_UpdateTexture; + renderer->WindowEvent = GLES2_WindowEvent; + renderer->GetOutputSize = GLES2_GetOutputSize; + renderer->SupportsBlendMode = GLES2_SupportsBlendMode; + renderer->CreateTexture = GLES2_CreateTexture; + renderer->UpdateTexture = GLES2_UpdateTexture; #if SDL_HAVE_YUV - renderer->UpdateTextureYUV = GLES2_UpdateTextureYUV; - renderer->UpdateTextureNV = GLES2_UpdateTextureNV; + renderer->UpdateTextureYUV = GLES2_UpdateTextureYUV; + renderer->UpdateTextureNV = GLES2_UpdateTextureNV; #endif - renderer->LockTexture = GLES2_LockTexture; - renderer->UnlockTexture = GLES2_UnlockTexture; + renderer->LockTexture = GLES2_LockTexture; + renderer->UnlockTexture = GLES2_UnlockTexture; renderer->SetTextureScaleMode = GLES2_SetTextureScaleMode; - renderer->SetRenderTarget = GLES2_SetRenderTarget; - renderer->QueueSetViewport = GLES2_QueueSetViewport; - renderer->QueueSetDrawColor = GLES2_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ - renderer->QueueDrawPoints = GLES2_QueueDrawPoints; - renderer->QueueDrawLines = GLES2_QueueDrawLines; - renderer->QueueGeometry = GLES2_QueueGeometry; - renderer->RunCommandQueue = GLES2_RunCommandQueue; - renderer->RenderReadPixels = GLES2_RenderReadPixels; - renderer->RenderPresent = GLES2_RenderPresent; - renderer->DestroyTexture = GLES2_DestroyTexture; - renderer->DestroyRenderer = GLES2_DestroyRenderer; - renderer->SetVSync = GLES2_SetVSync; - renderer->GL_BindTexture = GLES2_BindTexture; - renderer->GL_UnbindTexture = GLES2_UnbindTexture; + renderer->SetRenderTarget = GLES2_SetRenderTarget; + renderer->QueueSetViewport = GLES2_QueueSetViewport; + renderer->QueueSetDrawColor = GLES2_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueDrawPoints = GLES2_QueueDrawPoints; + renderer->QueueDrawLines = GLES2_QueueDrawLines; + renderer->QueueGeometry = GLES2_QueueGeometry; + renderer->RunCommandQueue = GLES2_RunCommandQueue; + renderer->RenderReadPixels = GLES2_RenderReadPixels; + renderer->RenderPresent = GLES2_RenderPresent; + renderer->DestroyTexture = GLES2_DestroyTexture; + renderer->DestroyRenderer = GLES2_DestroyRenderer; + renderer->SetVSync = GLES2_SetVSync; + renderer->GL_BindTexture = GLES2_BindTexture; + renderer->GL_UnbindTexture = GLES2_UnbindTexture; #if SDL_HAVE_YUV renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_YV12; renderer->info.texture_formats[renderer->info.num_texture_formats++] = SDL_PIXELFORMAT_IYUV; @@ -2239,6 +2180,10 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) renderer->rect_index_order[4] = 3; renderer->rect_index_order[5] = 2; + if (SDL_GL_ExtensionSupported("GL_EXT_blend_minmax")) { + data->GL_EXT_blend_minmax_supported = SDL_TRUE; + } + /* Set up parameters for rendering */ data->glActiveTexture(GL_TEXTURE0); data->glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -2257,9 +2202,10 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) GL_CheckError("", renderer); - return renderer; + return 0; error: + SDL_free(data); if (changed_window) { /* Uh oh, better try to put it back... */ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, profile_mask); @@ -2267,27 +2213,22 @@ GLES2_CreateRenderer(SDL_Window *window, Uint32 flags) SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor); SDL_RecreateWindow(window, window_flags); } - return NULL; + return -1; } SDL_RenderDriver GLES2_RenderDriver = { GLES2_CreateRenderer, - { - "opengles2", - (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), - 4, - { - SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGB888, - SDL_PIXELFORMAT_BGR888 - }, - 0, - 0 - } + { "opengles2", + (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE), + 4, + { SDL_PIXELFORMAT_RGBA32, + SDL_PIXELFORMAT_BGRA32, + SDL_PIXELFORMAT_BGRX32, + SDL_PIXELFORMAT_RGBX32 }, + 0, + 0 } }; -#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_OGL_ES2 */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/render/opengles2/SDL_shaders_gles2.c b/src/render/opengles2/SDL_shaders_gles2.c index cd7f6f12a7bc5..ff455227cb12d 100644 --- a/src/render/opengles2/SDL_shaders_gles2.c +++ b/src/render/opengles2/SDL_shaders_gles2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_OGL_ES2 #include "SDL_hints.h" #include "SDL_video.h" @@ -28,6 +28,8 @@ #include "SDL_shaders_gles2.h" #include "SDL_stdinc.h" +/* *INDENT-OFF* */ /* clang-format off */ + /************************************************************************************************* * Vertex/fragment shader source * *************************************************************************************************/ @@ -346,6 +348,7 @@ static const char GLES2_Fragment_TextureExternalOES[] = \ "}\n" \ ; +/* *INDENT-ON* */ /* clang-format on */ /************************************************************************************************* * Shader selector * @@ -377,17 +380,20 @@ const char *GLES2_GetShaderInclude(GLES2_ShaderIncludeType type) } } -GLES2_ShaderIncludeType GLES2_GetTexCoordPrecisionEnumFromHint() +GLES2_ShaderIncludeType GLES2_GetTexCoordPrecisionEnumFromHint(void) { const char *texcoord_hint = SDL_GetHint("SDL_RENDER_OPENGLES2_TEXCOORD_PRECISION"); GLES2_ShaderIncludeType value = GLES2_SHADER_FRAGMENT_INCLUDE_BEST_TEXCOORD_PRECISION; if (texcoord_hint) { - if (SDL_strcmp(texcoord_hint, "undefined") == 0) + if (SDL_strcmp(texcoord_hint, "undefined") == 0) { return GLES2_SHADER_FRAGMENT_INCLUDE_UNDEF_PRECISION; - if (SDL_strcmp(texcoord_hint, "high") == 0) + } + if (SDL_strcmp(texcoord_hint, "high") == 0) { return GLES2_SHADER_FRAGMENT_INCLUDE_HIGH_TEXCOORD_PRECISION; - if (SDL_strcmp(texcoord_hint, "medium") == 0) + } + if (SDL_strcmp(texcoord_hint, "medium") == 0) { return GLES2_SHADER_FRAGMENT_INCLUDE_MEDIUM_TEXCOORD_PRECISION; + } } return value; } @@ -438,7 +444,6 @@ const char *GLES2_GetShader(GLES2_ShaderType type) } } -#endif /* SDL_VIDEO_RENDER_OGL_ES2 && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_OGL_ES2 */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/render/opengles2/SDL_shaders_gles2.h b/src/render/opengles2/SDL_shaders_gles2.h index 20cd6b07d9fe7..f57e9287e2fde 100644 --- a/src/render/opengles2/SDL_shaders_gles2.h +++ b/src/render/opengles2/SDL_shaders_gles2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index f385f53543b0b..4861572322fac 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -47,47 +47,45 @@ typedef struct { GSGLOBAL *gsGlobal; uint64_t drawColor; + SDL_Rect *viewport; int32_t vsync_callback_id; uint8_t vsync; /* 0 (Disabled), 1 (Enabled), 2 (Dynamic) */ } PS2_RenderData; - static int vsync_sema_id = 0; /* PRIVATE METHODS */ -static int vsync_handler() +static int vsync_handler(int reason) { - iSignalSema(vsync_sema_id); + iSignalSema(vsync_sema_id); - ExitHandler(); - return 0; + ExitHandler(); + return 0; } /* Copy of gsKit_sync_flip, but without the 'flip' */ static void gsKit_sync(GSGLOBAL *gsGlobal) { - if (!gsGlobal->FirstFrame) WaitSema(vsync_sema_id); - while (PollSema(vsync_sema_id) >= 0) - ; + if (!gsGlobal->FirstFrame) { + WaitSema(vsync_sema_id); + } + while (PollSema(vsync_sema_id) >= 0) + ; } /* Copy of gsKit_sync_flip, but without the 'sync' */ static void gsKit_flip(GSGLOBAL *gsGlobal) { - if (!gsGlobal->FirstFrame) - { - if (gsGlobal->DoubleBuffering == GS_SETTING_ON) - { - GS_SET_DISPFB2( gsGlobal->ScreenBuffer[ - gsGlobal->ActiveBuffer & 1] / 8192, - gsGlobal->Width / 64, gsGlobal->PSM, 0, 0 ); - - gsGlobal->ActiveBuffer ^= 1; - } + if (!gsGlobal->FirstFrame) { + if (gsGlobal->DoubleBuffering == GS_SETTING_ON) { + GS_SET_DISPFB2(gsGlobal->ScreenBuffer[gsGlobal->ActiveBuffer & 1] / 8192, + gsGlobal->Width / 64, gsGlobal->PSM, 0, 0); - } + gsGlobal->ActiveBuffer ^= 1; + } + } - gsKit_setactive(gsGlobal); + gsKit_setactive(gsGlobal); } static int PixelFormatToPS2PSM(Uint32 format) @@ -100,27 +98,24 @@ static int PixelFormatToPS2PSM(Uint32 format) } } -static void -PS2_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void PS2_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - } -static int -PS2_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int PS2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GSTEXTURE* ps2_tex = (GSTEXTURE*) SDL_calloc(1, sizeof(GSTEXTURE)); + GSTEXTURE *ps2_tex = (GSTEXTURE *)SDL_calloc(1, sizeof(GSTEXTURE)); - if (!ps2_tex) + if (!ps2_tex) { return SDL_OutOfMemory(); + } ps2_tex->Width = texture->w; ps2_tex->Height = texture->h; ps2_tex->PSM = PixelFormatToPS2PSM(texture->format); ps2_tex->Mem = memalign(128, gsKit_texture_size_ee(ps2_tex->Width, ps2_tex->Height, ps2_tex->PSM)); - if (!ps2_tex->Mem) - { + if (!ps2_tex->Mem) { SDL_free(ps2_tex); return SDL_OutOfMemory(); } @@ -130,41 +125,38 @@ PS2_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -PS2_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int PS2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; *pixels = - (void *) ((Uint8 *) ps2_texture->Mem + rect->y * ps2_texture->Width * SDL_BYTESPERPIXEL(texture->format) + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)ps2_texture->Mem + rect->y * ps2_texture->Width * SDL_BYTESPERPIXEL(texture->format) + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = ps2_texture->Width * SDL_BYTESPERPIXEL(texture->format); return 0; } -static void -PS2_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void PS2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata; - PS2_RenderData *data = (PS2_RenderData *) renderer->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; gsKit_TexManager_invalidate(data->gsGlobal, ps2_texture); } -static int -PS2_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int PS2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { const Uint8 *src; Uint8 *dst; - int row, length,dpitch; + int row, length, dpitch; src = pixels; PS2_LockTexture(renderer, texture, rect, (void **)&dst, &dpitch); length = rect->w * SDL_BYTESPERPIXEL(texture->format); if (length == pitch && length == dpitch) { - SDL_memcpy(dst, src, length*rect->h); + SDL_memcpy(dst, src, length * rect->h); } else { for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, src, length); @@ -178,10 +170,9 @@ PS2_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static void -PS2_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void PS2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; /* set texture filtering according to scaleMode suported hint values are nearest (0, default) or linear (1) @@ -189,28 +180,38 @@ PS2_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Scal or GS_FILTER_LINEAR (good for scaling) */ uint32_t gsKitScaleMode = (scaleMode == SDL_ScaleModeNearest - ? GS_FILTER_NEAREST - : GS_FILTER_LINEAR); + ? GS_FILTER_NEAREST + : GS_FILTER_LINEAR); ps2_texture->Filter = gsKitScaleMode; } -static int -PS2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int PS2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { return 0; } -static int -PS2_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int PS2_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + const SDL_Rect *viewport = &cmd->data.viewport.rect; + data->viewport = (SDL_Rect *)viewport; + + data->gsGlobal->OffsetX = (int)((2048.0f + (float)viewport->x) * 16.0f); + data->gsGlobal->OffsetY = (int)((2048.0f + (float)viewport->y) * 16.0f); + gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->x + viewport->w, viewport->y, viewport->y + viewport->h)); + + return 0; +} + +static int PS2_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +{ + return 0; /* nothing to do in this backend. */ } -static int -PS2_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int PS2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - PS2_RenderData *data = (PS2_RenderData *) renderer->driverdata; - GSPRIMPOINT *vertices = (GSPRIMPOINT *) SDL_AllocateRenderVertices(renderer, count * sizeof (GSPRIMPOINT), 4, &cmd->data.draw.first); + PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + GSPRIMPOINT *vertices = (GSPRIMPOINT *)SDL_AllocateRenderVertices(renderer, count * sizeof(GSPRIMPOINT), 4, &cmd->data.draw.first); uint8_t colorR, colorG, colorB, colorA; gs_rgbaq rgbaq; int i; @@ -221,10 +222,10 @@ PS2_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F cmd->data.draw.count = count; - colorR = cmd->data.draw.r >> 1; - colorG = cmd->data.draw.g >> 1; - colorB = cmd->data.draw.b >> 1; - colorA = cmd->data.draw.a >> 1; + colorR = cmd->data.draw.r; + colorG = cmd->data.draw.g; + colorB = cmd->data.draw.b; + colorA = cmd->data.draw.a; rgbaq = color_to_RGBAQ(colorR, colorG, colorB, colorA, 0.0f); for (i = 0; i < count; i++, vertices++, points++) { @@ -234,11 +235,10 @@ PS2_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F return 0; } -static int -PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; @@ -248,8 +248,9 @@ PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t size_indices = indices ? size_indices : 0; if (texture) { - GSPRIMSTQPOINT *vertices = (GSPRIMSTQPOINT *) SDL_AllocateRenderVertices(renderer, count * sizeof (GSPRIMSTQPOINT), 4, &cmd->data.draw.first); - + GSPRIMUVPOINT *vertices = (GSPRIMUVPOINT *) SDL_AllocateRenderVertices(renderer, count * sizeof(GSPRIMUVPOINT), 4, &cmd->data.draw.first); + GSTEXTURE *ps2_tex = (GSTEXTURE *) texture->driverdata; + if (!vertices) { return -1; } @@ -269,19 +270,19 @@ PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); - uv_ = (float *)((char*)uv + j * uv_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); + uv_ = (float *)((char *)uv + j * uv_stride); vertices->xyz2 = vertex_to_XYZ2(data->gsGlobal, xy_[0] * scale_x, xy_[1] * scale_y, 0); - vertices->stq = vertex_to_STQ(uv_[0], uv_[1]); - vertices->rgbaq = color_to_RGBAQ(col_.r >> 1, col_.g >> 1, col_.b >> 1, col_.a >> 1, 1.0f); + vertices->rgbaq = color_to_RGBAQ(col_.r, col_.g, col_.b, col_.a, 0); + vertices->uv = vertex_to_UV(ps2_tex, uv_[0] * ps2_tex->Width, uv_[1] * ps2_tex->Height); vertices++; } - + } else { - GSPRIMPOINT *vertices = (GSPRIMPOINT *) SDL_AllocateRenderVertices(renderer, count * sizeof (GSPRIMPOINT), 4, &cmd->data.draw.first); + GSPRIMPOINT *vertices = (GSPRIMPOINT *)SDL_AllocateRenderVertices(renderer, count * sizeof(GSPRIMPOINT), 4, &cmd->data.draw.first); if (!vertices) { return -1; @@ -301,11 +302,11 @@ PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); vertices->xyz2 = vertex_to_XYZ2(data->gsGlobal, xy_[0] * scale_x, xy_[1] * scale_y, 0); - vertices->rgbaq = color_to_RGBAQ(col_.r >> 1, col_.g >> 1, col_.b >> 1, col_.a >> 1, 0.0f); + vertices->rgbaq = color_to_RGBAQ(col_.r, col_.g, col_.b, col_.a, 0.0f); vertices++; } @@ -314,104 +315,115 @@ PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t return 0; } -static int -PS2_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int PS2_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; - const SDL_Rect *viewport = &cmd->data.viewport.rect; - - gsKit_set_display_offset(data->gsGlobal, viewport->x, viewport->y); - gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->y, viewport->w, viewport->h)); - - return 0; + return 0; /* nothing to do in this backend. */ } -static int -PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + SDL_Rect *viewport = data->viewport; const SDL_Rect *rect = &cmd->data.cliprect.rect; - if(cmd->data.cliprect.enabled){ - gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(rect->x, rect->y, rect->w, rect->h)); - } else { - gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET); + if (cmd->data.cliprect.enabled) { + /* We need to do it relative to saved viewport */ + viewport->x += rect->x; + viewport->y += rect->y; + viewport->w = SDL_min(viewport->w, rect->w); + viewport->h = SDL_min(viewport->h, rect->h); } + gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->x + viewport->w, viewport->y, viewport->y + viewport->h)); return 0; } - -static int -PS2_RenderSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int PS2_RenderSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { int colorR, colorG, colorB, colorA; PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; - - colorR = (cmd->data.color.r) >> 1; - colorG = (cmd->data.color.g) >> 1; - colorB = (cmd->data.color.b) >> 1; - colorA = (cmd->data.color.a) >> 1; + + colorR = (cmd->data.color.r); + colorG = (cmd->data.color.g); + colorB = (cmd->data.color.b); + colorA = (cmd->data.color.a); data->drawColor = GS_SETREG_RGBAQ(colorR, colorG, colorB, colorA, 0x00); return 0; } -static int -PS2_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int PS2_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - int colorR, colorG, colorB, colorA; + int colorR, colorG, colorB, colorA, offsetX, offsetY; + SDL_Rect *viewport; PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; - - colorR = (cmd->data.color.r) >> 1; - colorG = (cmd->data.color.g) >> 1; - colorB = (cmd->data.color.b) >> 1; - colorA = (cmd->data.color.a) >> 1; + + colorR = (cmd->data.color.r); + colorG = (cmd->data.color.g); + colorB = (cmd->data.color.b); + colorA = (cmd->data.color.a); + + /* Clear the screen, so let's put default viewport */ + gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET); + /* Put back original offset */ + offsetX = data->gsGlobal->OffsetX; + offsetY = data->gsGlobal->OffsetY; + data->gsGlobal->OffsetX = (int)(2048.0f * 16.0f); + data->gsGlobal->OffsetY = (int)(2048.0f * 16.0f); gsKit_clear(data->gsGlobal, GS_SETREG_RGBAQ(colorR, colorG, colorB, colorA, 0x00)); + + /* Put back original offset */ + data->gsGlobal->OffsetX = offsetX; + data->gsGlobal->OffsetY = offsetY; + + // /* Put back view port */ + viewport = data->viewport; + gsKit_set_scissor(data->gsGlobal, GS_SETREG_SCISSOR(viewport->x, viewport->x + viewport->w, viewport->y, viewport->y + viewport->h)); return 0; } -static void -PS2_SetBlendMode(PS2_RenderData *data, int blendMode) +static void PS2_SetBlendMode(PS2_RenderData *data, int blendMode) { - #define A_COLOR_SOURCE 0 - #define A_COLOR_DEST 1 - #define A_COLOR_NULL 2 - #define A_ALPHA_SOURCE 0 - #define A_ALPHA_DEST 1 - #define A_ALPHA_FIX 2 - - switch (blendMode) +#define A_COLOR_SOURCE 0 +#define A_COLOR_DEST 1 +#define A_COLOR_NULL 2 +#define A_ALPHA_SOURCE 0 +#define A_ALPHA_DEST 1 +#define A_ALPHA_FIX 2 + + switch (blendMode) { + case SDL_BLENDMODE_NONE: { - case SDL_BLENDMODE_NONE: { - data->gsGlobal->PrimAlphaEnable = GS_SETTING_OFF; - break; - } - case SDL_BLENDMODE_BLEND:{ - gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_DEST, A_ALPHA_SOURCE, A_COLOR_DEST, 0), 0); - data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; - break; - } - case SDL_BLENDMODE_ADD: { - gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_NULL, A_ALPHA_FIX, A_COLOR_DEST, 0x80), 0); - data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; - break; - } - case SDL_BLENDMODE_MUL: - case SDL_BLENDMODE_MOD: { - /* We don't fully support MOD and MUL, however this is the best we can do */ - gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_DEST, A_COLOR_NULL, A_ALPHA_SOURCE, A_COLOR_SOURCE, 0x80), 0); - data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; - break; - } + data->gsGlobal->PrimAlphaEnable = GS_SETTING_OFF; + break; + } + case SDL_BLENDMODE_BLEND: + { + gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_DEST, A_ALPHA_SOURCE, A_COLOR_DEST, 0), 0); + data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + break; + } + case SDL_BLENDMODE_ADD: + { + gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_NULL, A_ALPHA_FIX, A_COLOR_DEST, 0x80), 0); + data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + break; + } + case SDL_BLENDMODE_MUL: + case SDL_BLENDMODE_MOD: + { + /* We don't fully support MOD and MUL, however this is the best we can do */ + gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_DEST, A_COLOR_NULL, A_ALPHA_SOURCE, A_COLOR_SOURCE, 0x80), 0); + data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + break; + } } } -static int -PS2_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) +static int PS2_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; const size_t count = cmd->data.draw.count; @@ -419,26 +431,24 @@ PS2_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cm PS2_SetBlendMode(data, cmd->data.draw.blend); if (cmd->data.draw.texture) { - const GSPRIMSTQPOINT *verts = (GSPRIMSTQPOINT *) (vertices + cmd->data.draw.first); - GSTEXTURE *ps2_tex = (GSTEXTURE *) cmd->data.draw.texture->driverdata; + const GSPRIMUVPOINT *verts = (GSPRIMUVPOINT *) (vertices + cmd->data.draw.first); + GSTEXTURE *ps2_tex = (GSTEXTURE *)cmd->data.draw.texture->driverdata; gsKit_TexManager_bind(data->gsGlobal, ps2_tex); - gsKit_prim_list_triangle_goraud_texture_stq_3d(data->gsGlobal, ps2_tex, count, verts); + gsKit_prim_list_triangle_goraud_texture_uv_3d(data->gsGlobal, ps2_tex, count, verts); } else { - const GSPRIMPOINT *verts = (GSPRIMPOINT *) (vertices + cmd->data.draw.first); + const GSPRIMPOINT *verts = (GSPRIMPOINT *)(vertices + cmd->data.draw.first); gsKit_prim_list_triangle_gouraud_3d(data->gsGlobal, count, verts); - } - + } + return 0; } - -int -PS2_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand * cmd) +int PS2_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; const size_t count = cmd->data.draw.count; - const GSPRIMPOINT *verts = (GSPRIMPOINT *) (vertices + cmd->data.draw.first); + const GSPRIMPOINT *verts = (GSPRIMPOINT *)(vertices + cmd->data.draw.first); PS2_SetBlendMode(data, cmd->data.draw.blend); gsKit_prim_list_line_goraud_3d(data->gsGlobal, count, verts); @@ -447,12 +457,11 @@ PS2_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand * cmd) return 0; } -int -PS2_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand * cmd) +int PS2_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; const size_t count = cmd->data.draw.count; - const GSPRIMPOINT *verts = (GSPRIMPOINT *) (vertices + cmd->data.draw.first); + const GSPRIMPOINT *verts = (GSPRIMPOINT *)(vertices + cmd->data.draw.first); PS2_SetBlendMode(data, cmd->data.draw.blend); gsKit_prim_list_points(data->gsGlobal, count, verts); @@ -461,107 +470,114 @@ PS2_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand * cmd return 0; } -static int -PS2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int PS2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETVIEWPORT: { - PS2_RenderSetViewPort(renderer, cmd); - break; - } - case SDL_RENDERCMD_SETCLIPRECT: { - PS2_RenderSetClipRect(renderer, cmd); - break; - } - case SDL_RENDERCMD_SETDRAWCOLOR: { - PS2_RenderSetDrawColor(renderer, cmd); - break; - } - case SDL_RENDERCMD_CLEAR: { - PS2_RenderClear(renderer, cmd); - break; - } - case SDL_RENDERCMD_DRAW_POINTS: { - PS2_RenderPoints(renderer, vertices, cmd); - break; - } - case SDL_RENDERCMD_DRAW_LINES: { - PS2_RenderLines(renderer, vertices, cmd); - break; - } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; - case SDL_RENDERCMD_COPY: /* unused */ - break; - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; - case SDL_RENDERCMD_GEOMETRY: { - PS2_RenderGeometry(renderer, vertices, cmd); - break; - } - case SDL_RENDERCMD_NO_OP: - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + PS2_RenderSetViewPort(renderer, cmd); + /* FIXME: We need to update the clip rect too, see https://github.com/libsdl-org/SDL/issues/9094 */ + break; + } + case SDL_RENDERCMD_SETCLIPRECT: + { + PS2_RenderSetClipRect(renderer, cmd); + break; + } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + PS2_RenderSetDrawColor(renderer, cmd); + break; + } + case SDL_RENDERCMD_CLEAR: + { + PS2_RenderClear(renderer, cmd); + break; + } + case SDL_RENDERCMD_DRAW_POINTS: + { + PS2_RenderPoints(renderer, vertices, cmd); + break; + } + case SDL_RENDERCMD_DRAW_LINES: + { + PS2_RenderLines(renderer, vertices, cmd); + break; + } + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; + case SDL_RENDERCMD_COPY: /* unused */ + break; + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; + case SDL_RENDERCMD_GEOMETRY: + { + PS2_RenderGeometry(renderer, vertices, cmd); + break; + } + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; } return 0; } -static int -PS2_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +static int PS2_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { return SDL_Unsupported(); } -static int -PS2_RenderPresent(SDL_Renderer * renderer) +static int PS2_RenderPresent(SDL_Renderer *renderer) { - PS2_RenderData *data = (PS2_RenderData *) renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; if (data->gsGlobal->DoubleBuffering == GS_SETTING_OFF) { - if (data->vsync == 2) // Dynamic + if (data->vsync == 2) { // Dynamic gsKit_sync(data->gsGlobal); - else if (data->vsync == 1) + } else if (data->vsync == 1) { gsKit_vsync_wait(); - gsKit_queue_exec(data->gsGlobal); + } + gsKit_queue_exec(data->gsGlobal); } else { - gsKit_queue_exec(data->gsGlobal); - gsKit_finish(); - if (data->vsync == 2) // Dynamic + gsKit_queue_exec(data->gsGlobal); + gsKit_finish(); + if (data->vsync == 2) { // Dynamic gsKit_sync(data->gsGlobal); - else if (data->vsync == 1) + } else if (data->vsync == 1) { gsKit_vsync_wait(); - gsKit_flip(data->gsGlobal); - } - gsKit_TexManager_nextFrame(data->gsGlobal); + } + gsKit_flip(data->gsGlobal); + } + gsKit_TexManager_nextFrame(data->gsGlobal); gsKit_clear(data->gsGlobal, GS_BLACK); return 0; } -static void -PS2_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void PS2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GSTEXTURE *ps2_texture = (GSTEXTURE *) texture->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; - if (data == NULL) + if (!data) { return; + } - if(ps2_texture == NULL) + if (!ps2_texture) { return; + } // Free from vram gsKit_TexManager_free(data->gsGlobal, ps2_texture); - + SDL_free(ps2_texture->Mem); SDL_free(ps2_texture); texture->driverdata = NULL; } -static void -PS2_DestroyRenderer(SDL_Renderer * renderer) +static void PS2_DestroyRenderer(SDL_Renderer *renderer) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; @@ -574,14 +590,12 @@ PS2_DestroyRenderer(SDL_Renderer * renderer) SDL_free(data); } - if (vsync_sema_id >= 0) + if (vsync_sema_id >= 0) { DeleteSema(vsync_sema_id); - - SDL_free(renderer); + } } -static int -PS2_SetVSync(SDL_Renderer * renderer, const int vsync) +static int PS2_SetVSync(SDL_Renderer *renderer, const int vsync) { PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; SDL_bool dynamicVsync = SDL_GetHintBoolean(SDL_HINT_PS2_DYNAMIC_VSYNC, SDL_FALSE); @@ -589,26 +603,17 @@ PS2_SetVSync(SDL_Renderer * renderer, const int vsync) return 0; } -static SDL_Renderer * -PS2_CreateRenderer(SDL_Window * window, Uint32 flags) +static int PS2_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; PS2_RenderData *data; GSGLOBAL *gsGlobal; ee_sema_t sema; SDL_bool dynamicVsync; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (PS2_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (PS2_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { PS2_DestroyRenderer(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } /* Specific gsKit init */ @@ -616,35 +621,69 @@ PS2_CreateRenderer(SDL_Window * window, Uint32 flags) sema.max_count = 1; sema.option = 0; vsync_sema_id = CreateSema(&sema); - + gsGlobal = gsKit_init_global_custom(RENDER_QUEUE_OS_POOLSIZE, RENDER_QUEUE_PER_POOLSIZE); - gsGlobal->Mode = GS_MODE_NTSC; - gsGlobal->Height = 448; + // GS interlaced/progressive + if (SDL_GetHintBoolean(SDL_HINT_PS2_GS_PROGRESSIVE, false)) { + gsGlobal->Interlace = GS_NONINTERLACED; + } else { + gsGlobal->Interlace = GS_INTERLACED; + } + + // GS width/height + gsGlobal->Width = 0; + gsGlobal->Height = 0; + const char *hint = SDL_GetHint(SDL_HINT_PS2_GS_WIDTH); + if (hint) { + gsGlobal->Width = SDL_atoi(hint); + } + hint = SDL_GetHint(SDL_HINT_PS2_GS_HEIGHT); + if (hint) { + gsGlobal->Height = SDL_atoi(hint); + } + if (gsGlobal->Width <= 0) { + gsGlobal->Width = 640; + } + if (gsGlobal->Height <= 0) { + gsGlobal->Height = 448; + } - gsGlobal->PSM = GS_PSM_CT24; - gsGlobal->PSMZ = GS_PSMZ_16S; - gsGlobal->ZBuffering = GS_SETTING_OFF; - gsGlobal->DoubleBuffering = GS_SETTING_ON; - gsGlobal->PrimAlphaEnable = GS_SETTING_ON; - gsGlobal->Dithering = GS_SETTING_OFF; + // GS region + hint = SDL_GetHint(SDL_HINT_PS2_GS_MODE); + if (hint) { + if (SDL_strcasecmp(SDL_GetHint(SDL_HINT_PS2_GS_MODE), "NTSC") == 0) { + gsGlobal->Mode = GS_MODE_NTSC; + } + + if (SDL_strcasecmp(SDL_GetHint(SDL_HINT_PS2_GS_MODE), "PAL") == 0) { + gsGlobal->Mode = GS_MODE_PAL; + } + } + + gsGlobal->PSM = GS_PSM_CT24; + gsGlobal->PSMZ = GS_PSMZ_16S; + gsGlobal->ZBuffering = GS_SETTING_OFF; + gsGlobal->DoubleBuffering = GS_SETTING_ON; + gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + gsGlobal->Dithering = GS_SETTING_OFF; - gsKit_set_primalpha(gsGlobal, GS_SETREG_ALPHA(0, 1, 0, 1, 0), 0); + gsKit_set_primalpha(gsGlobal, GS_SETREG_ALPHA(0, 1, 0, 1, 0), 0); - dmaKit_init(D_CTRL_RELE_OFF, D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC, D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF); - dmaKit_chan_init(DMA_CHANNEL_GIF); + dmaKit_init(D_CTRL_RELE_OFF, D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC, D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF); + dmaKit_chan_init(DMA_CHANNEL_GIF); - gsKit_set_clamp(gsGlobal, GS_CMODE_REPEAT); + gsKit_set_clamp(gsGlobal, GS_CMODE_REPEAT); - gsKit_vram_clear(gsGlobal); + gsKit_vram_clear(gsGlobal); - gsKit_init_screen(gsGlobal); + gsKit_init_screen(gsGlobal); - gsKit_TexManager_init(gsGlobal); + gsKit_TexManager_init(gsGlobal); - data->vsync_callback_id = gsKit_add_vsync_handler(vsync_handler); + data->vsync_callback_id = gsKit_add_vsync_handler(vsync_handler); - gsKit_mode_switch(gsGlobal, GS_ONESHOT); + gsKit_mode_switch(gsGlobal, GS_ONESHOT); gsKit_clear(gsGlobal, GS_BLACK); @@ -660,7 +699,7 @@ PS2_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = PS2_SetTextureScaleMode; renderer->SetRenderTarget = PS2_SetRenderTarget; renderer->QueueSetViewport = PS2_QueueSetViewport; - renderer->QueueSetDrawColor = PS2_QueueSetViewport; + renderer->QueueSetDrawColor = PS2_QueueSetDrawColor; renderer->QueueDrawPoints = PS2_QueueDrawPoints; renderer->QueueDrawLines = PS2_QueueDrawPoints; renderer->QueueGeometry = PS2_QueueGeometry; @@ -674,7 +713,7 @@ PS2_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->driverdata = data; renderer->window = window; - return renderer; + return 0; } SDL_RenderDriver PS2_RenderDriver = { @@ -683,7 +722,7 @@ SDL_RenderDriver PS2_RenderDriver = { .name = "PS2 gsKit", .flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE, .num_texture_formats = 2, - .texture_formats = { + .texture_formats = { [0] = SDL_PIXELFORMAT_ABGR1555, [1] = SDL_PIXELFORMAT_ABGR8888, }, diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 9a4e5c7bbdb35..49dd150982327 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,25 +36,15 @@ #include #include #include - - - +#include "SDL_render_psp.h" /* PSP renderer implementation, based on the PGE */ - -#define PSP_SCREEN_WIDTH 480 -#define PSP_SCREEN_HEIGHT 272 - -#define PSP_FRAME_BUFFER_WIDTH 512 -#define PSP_FRAME_BUFFER_SIZE (PSP_FRAME_BUFFER_WIDTH*PSP_SCREEN_HEIGHT) - static unsigned int __attribute__((aligned(16))) DisplayList[262144]; - -#define COL5650(r,g,b,a) ((r>>3) | ((g>>2)<<5) | ((b>>3)<<11)) -#define COL5551(r,g,b,a) ((r>>3) | ((g>>3)<<5) | ((b>>3)<<10) | (a>0?0x7000:0)) -#define COL4444(r,g,b,a) ((r>>4) | ((g>>4)<<4) | ((b>>4)<<8) | ((a>>4)<<12)) -#define COL8888(r,g,b,a) ((r) | ((g)<<8) | ((b)<<16) | ((a)<<24)) +#define COL5650(r, g, b, a) ((r >> 3) | ((g >> 2) << 5) | ((b >> 3) << 11)) +#define COL5551(r, g, b, a) ((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | (a > 0 ? 0x7000 : 0)) +#define COL4444(r, g, b, a) ((r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12)) +#define COL8888(r, g, b, a) ((r) | ((g) << 8) | ((b) << 16) | ((a) << 24)) /** * Holds psp specific texture data @@ -64,18 +54,18 @@ static unsigned int __attribute__((aligned(16))) DisplayList[262144]; */ typedef struct PSP_TextureData { - void *data; /**< Image data. */ - unsigned int size; /**< Size of data in bytes. */ - unsigned int width; /**< Image width. */ - unsigned int height; /**< Image height. */ - unsigned int textureWidth; /**< Texture width (power of two). */ - unsigned int textureHeight; /**< Texture height (power of two). */ - unsigned int bits; /**< Image bits per pixel. */ - unsigned int format; /**< Image format - one of ::pgePixelFormat. */ - unsigned int pitch; - SDL_bool swizzled; /**< Is image swizzled. */ - struct PSP_TextureData* prevhotw; /**< More recently used render target */ - struct PSP_TextureData* nexthotw; /**< Less recently used render target */ + void *data; /**< Image data. */ + unsigned int size; /**< Size of data in bytes. */ + unsigned int width; /**< Image width. */ + unsigned int height; /**< Image height. */ + unsigned int textureWidth; /**< Texture width (power of two). */ + unsigned int textureHeight; /**< Texture height (power of two). */ + unsigned int bits; /**< Image bits per pixel. */ + unsigned int format; /**< Image format - one of ::pgePixelFormat. */ + unsigned int pitch; + SDL_bool swizzled; /**< Is image swizzled. */ + struct PSP_TextureData *prevhotw; /**< More recently used render target */ + struct PSP_TextureData *nexthotw; /**< Less recently used render target */ } PSP_TextureData; typedef struct @@ -83,123 +73,155 @@ typedef struct SDL_BlendMode mode; unsigned int color; int shadeModel; - SDL_Texture* texture; + SDL_Texture *texture; } PSP_BlendState; typedef struct { - void* frontbuffer; /**< main screen buffer */ - void* backbuffer; /**< buffer presented to display */ - SDL_Texture* boundTarget; /**< currently bound rendertarget */ - SDL_bool initialized; /**< is driver initialized */ - SDL_bool displayListAvail; /**< is the display list already initialized for this frame */ - unsigned int psm; /**< format of the display buffers */ - unsigned int bpp; /**< bits per pixel of the main display */ - - SDL_bool vsync; /**< whether we do vsync */ - PSP_BlendState blendState; /**< current blend mode */ - PSP_TextureData* most_recent_target; /**< start of render target LRU double linked list */ - PSP_TextureData* least_recent_target; /**< end of the LRU list */ - - SDL_bool vblank_not_reached; /**< whether vblank wasn't reached */ -} PSP_RenderData; + SDL_Rect viewport; + SDL_bool viewport_dirty; + SDL_bool viewport_is_set; + + SDL_bool cliprect_enabled_dirty; + SDL_bool cliprect_enabled; + SDL_bool cliprect_dirty; + SDL_Rect cliprect; + + float draw_offset_x; + float draw_offset_y; + int drawablew; + int drawableh; +} PSP_DrawstateCache; typedef struct { - float x, y, z; -} VertV; + void *frontbuffer; /**< main screen buffer */ + void *backbuffer; /**< buffer presented to display */ + SDL_Texture *boundTarget; /**< currently bound rendertarget */ + SDL_bool initialized; /**< is driver initialized */ + SDL_bool displayListAvail; /**< is the display list already initialized for this frame */ + unsigned int psm; /**< format of the display buffers */ + unsigned int bpp; /**< bits per pixel of the main display */ + + SDL_bool vsync; /**< whether we do vsync */ + PSP_BlendState blendState; /**< current blend mode */ + PSP_TextureData *most_recent_target; /**< start of render target LRU double linked list */ + PSP_TextureData *least_recent_target; /**< end of the LRU list */ + + PSP_DrawstateCache drawstate; + SDL_bool vblank_not_reached; /**< whether vblank wasn't reached */ +} PSP_RenderData; +typedef struct +{ + float x, y, z; +} VertV; typedef struct { - float u, v; - float x, y, z; + float u, v; + float x, y, z; } VertTV; typedef struct { SDL_Color col; - float x, y, z; + float x, y, z; } VertCV; - typedef struct { - float u, v; + float u, v; SDL_Color col; - float x, y, z; + float x, y, z; } VertTCV; -#define PI 3.14159265358979f +int SDL_PSP_RenderGetProp(SDL_Renderer *r, enum SDL_PSP_RenderProps which, void** out) +{ + PSP_RenderData *rd; + if (r == NULL) { + return -1; + } + rd = r->driverdata; + switch (which) { + case SDL_PSP_RENDERPROPS_FRONTBUFFER: + *out = rd->frontbuffer; + return 0; + case SDL_PSP_RENDERPROPS_BACKBUFFER: + *out = rd->backbuffer; + return 0; + } + return -1; +} + +#define PI 3.14159265358979f -#define radToDeg(x) ((x)*180.f/PI) -#define degToRad(x) ((x)*PI/180.f) +#define radToDeg(x) ((x)*180.f / PI) +#define degToRad(x) ((x)*PI / 180.f) -static float -MathAbs(float x) +static float MathAbs(float x) { float result; - __asm__ volatile ( + __asm__ volatile( "mtv %1, S000\n" "vabs.s S000, S000\n" "mfv %0, S000\n" - : "=r"(result) : "r"(x)); + : "=r"(result) + : "r"(x)); return result; } -static void -MathSincos(float r, float *s, float *c) +static void MathSincos(float r, float *s, float *c) { - __asm__ volatile ( + __asm__ volatile( "mtv %2, S002\n" "vcst.s S003, VFPU_2_PI\n" "vmul.s S002, S002, S003\n" "vrot.p C000, S002, [s, c]\n" "mfv %0, S000\n" "mfv %1, S001\n" - : "=r"(*s), "=r"(*c): "r"(r)); + : "=r"(*s), "=r"(*c) + : "r"(r)); } -static void -Swap(float *a, float *b) +static void Swap(float *a, float *b) { - float n=*a; + float n = *a; *a = *b; *b = n; } -static inline int -InVram(void* data) +static inline int InVram(void *data) { - return data < (void*)0x04200000; + return data < (void *)0x04200000; } /* Return next power of 2 */ -static int -TextureNextPow2(unsigned int w) +static int TextureNextPow2(unsigned int w) { unsigned int n = 2; - if(w == 0) + if (w == 0) { return 0; + } - while(w > n) + while (w > n) { n <<= 1; + } return n; } static void psp_on_vblank(u32 sub, PSP_RenderData *data) { - if (data) - data->vblank_not_reached = SDL_FALSE; + if (data) { + data->vblank_not_reached = SDL_FALSE; + } } - -static int -PixelFormatToPSPFMT(Uint32 format) +static int PixelFormatToPSPFMT(Uint32 format) { switch (format) { case SDL_PIXELFORMAT_BGR565: @@ -215,62 +237,61 @@ PixelFormatToPSPFMT(Uint32 format) } } -///SECTION render target LRU management -static void -LRUTargetRelink(PSP_TextureData* psp_texture) { - if(psp_texture->prevhotw) { +/// SECTION render target LRU management +static void LRUTargetRelink(PSP_TextureData *psp_texture) +{ + if (psp_texture->prevhotw) { psp_texture->prevhotw->nexthotw = psp_texture->nexthotw; } - if(psp_texture->nexthotw) { + if (psp_texture->nexthotw) { psp_texture->nexthotw->prevhotw = psp_texture->prevhotw; } } -static void -LRUTargetPushFront(PSP_RenderData* data, PSP_TextureData* psp_texture) { +static void LRUTargetPushFront(PSP_RenderData *data, PSP_TextureData *psp_texture) +{ psp_texture->nexthotw = data->most_recent_target; - if(data->most_recent_target) { + if (data->most_recent_target) { data->most_recent_target->prevhotw = psp_texture; } data->most_recent_target = psp_texture; - if(!data->least_recent_target) { + if (!data->least_recent_target) { data->least_recent_target = psp_texture; } } -static void -LRUTargetRemove(PSP_RenderData* data, PSP_TextureData* psp_texture) { +static void LRUTargetRemove(PSP_RenderData *data, PSP_TextureData *psp_texture) +{ LRUTargetRelink(psp_texture); - if(data->most_recent_target == psp_texture) { + if (data->most_recent_target == psp_texture) { data->most_recent_target = psp_texture->nexthotw; } - if(data->least_recent_target == psp_texture) { + if (data->least_recent_target == psp_texture) { data->least_recent_target = psp_texture->prevhotw; } psp_texture->prevhotw = NULL; psp_texture->nexthotw = NULL; } -static void -LRUTargetBringFront(PSP_RenderData* data, PSP_TextureData* psp_texture) { - if(data->most_recent_target == psp_texture) { - return; //nothing to do +static void LRUTargetBringFront(PSP_RenderData *data, PSP_TextureData *psp_texture) +{ + if (data->most_recent_target == psp_texture) { + return; // nothing to do } LRUTargetRemove(data, psp_texture); LRUTargetPushFront(data, psp_texture); } -static void -TextureStorageFree(void* storage) { - if(InVram(storage)) { +static void TextureStorageFree(void *storage) +{ + if (InVram(storage)) { vfree(storage); } else { SDL_free(storage); } } -static int -TextureSwizzle(PSP_TextureData *psp_texture, void* dst) +static int TextureSwizzle(PSP_TextureData *psp_texture, void *dst) { int bytewidth, height; int rowblocks, rowblocksadd; @@ -279,34 +300,33 @@ TextureSwizzle(PSP_TextureData *psp_texture, void* dst) unsigned int *src = NULL; unsigned char *data = NULL; - if(psp_texture->swizzled) + if (psp_texture->swizzled) { return 1; + } - bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + bytewidth = psp_texture->textureWidth * (psp_texture->bits >> 3); height = psp_texture->size / bytewidth; - rowblocks = (bytewidth>>4); - rowblocksadd = (rowblocks-1)<<7; + rowblocks = (bytewidth >> 4); + rowblocksadd = (rowblocks - 1) << 7; - src = (unsigned int*) psp_texture->data; + src = (unsigned int *)psp_texture->data; data = dst; - if(!data) { + if (!data) { data = SDL_malloc(psp_texture->size); } - if(!data) { + if (!data) { return SDL_OutOfMemory(); } - for(j = 0; j < height; j++, blockaddress += 16) - { + for (j = 0; j < height; j++, blockaddress += 16) { unsigned int *block; - block = (unsigned int*)&data[blockaddress]; + block = (unsigned int *)&data[blockaddress]; - for(i = 0; i < rowblocks; i++) - { + for (i = 0; i < rowblocks; i++) { *block++ = *src++; *block++ = *src++; *block++ = *src++; @@ -314,8 +334,9 @@ TextureSwizzle(PSP_TextureData *psp_texture, void* dst) block += 28; } - if((j & 0x7) == 0x7) + if ((j & 0x7) == 0x7) { blockaddress += rowblocksadd; + } } TextureStorageFree(psp_texture->data); @@ -326,8 +347,7 @@ TextureSwizzle(PSP_TextureData *psp_texture, void* dst) return 1; } -static int -TextureUnswizzle(PSP_TextureData *psp_texture, void* dst) +static int TextureUnswizzle(PSP_TextureData *psp_texture, void *dst) { int bytewidth, height; int widthblocks, heightblocks; @@ -338,43 +358,42 @@ TextureUnswizzle(PSP_TextureData *psp_texture, void* dst) unsigned char *data = NULL; unsigned char *ydst = NULL; - if(!psp_texture->swizzled) + if (!psp_texture->swizzled) { return 1; + } - bytewidth = psp_texture->textureWidth*(psp_texture->bits>>3); + bytewidth = psp_texture->textureWidth * (psp_texture->bits >> 3); height = psp_texture->size / bytewidth; - widthblocks = bytewidth/16; - heightblocks = height/8; + widthblocks = bytewidth / 16; + heightblocks = height / 8; - dstpitch = (bytewidth - 16)/4; + dstpitch = (bytewidth - 16) / 4; dstrow = bytewidth * 8; - src = (unsigned int*) psp_texture->data; + src = (unsigned int *)psp_texture->data; data = dst; - if(!data) { + if (!data) { data = SDL_malloc(psp_texture->size); } - if(!data) + if (!data) { return SDL_OutOfMemory(); + } ydst = (unsigned char *)data; - for(blocky = 0; blocky < heightblocks; ++blocky) - { + for (blocky = 0; blocky < heightblocks; ++blocky) { unsigned char *xdst = ydst; - for(blockx = 0; blockx < widthblocks; ++blockx) - { + for (blockx = 0; blockx < widthblocks; ++blockx) { unsigned int *block; - block = (unsigned int*)xdst; + block = (unsigned int *)xdst; - for(j = 0; j < 8; ++j) - { + for (j = 0; j < 8; ++j) { *(block++) = *(src++); *(block++) = *(src++); *(block++) = *(src++); @@ -398,14 +417,13 @@ TextureUnswizzle(PSP_TextureData *psp_texture, void* dst) return 1; } -static int -TextureSpillToSram(PSP_RenderData* data, PSP_TextureData* psp_texture) +static int TextureSpillToSram(PSP_RenderData *data, PSP_TextureData *psp_texture) { // Assumes the texture is in VRAM - if(psp_texture->swizzled) { - //Texture was swizzled in vram, just copy to system memory - void* sdata = SDL_malloc(psp_texture->size); - if(!sdata) { + if (psp_texture->swizzled) { + // Texture was swizzled in vram, just copy to system memory + void *sdata = SDL_malloc(psp_texture->size); + if (!sdata) { return SDL_OutOfMemory(); } @@ -414,16 +432,15 @@ TextureSpillToSram(PSP_RenderData* data, PSP_TextureData* psp_texture) psp_texture->data = sdata; return 0; } else { - return TextureSwizzle(psp_texture, NULL); //Will realloc in sysram + return TextureSwizzle(psp_texture, NULL); // Will realloc in sysram } } -static int -TexturePromoteToVram(PSP_RenderData* data, PSP_TextureData* psp_texture, SDL_bool target) +static int TexturePromoteToVram(PSP_RenderData *data, PSP_TextureData *psp_texture, SDL_bool target) { // Assumes texture in sram and a large enough continuous block in vram - void* tdata = vramalloc(psp_texture->size); - if(psp_texture->swizzled && target) { + void *tdata = vramalloc(psp_texture->size); + if (psp_texture->swizzled && target) { return TextureUnswizzle(psp_texture, tdata); } else { SDL_memcpy(tdata, psp_texture->data, psp_texture->size); @@ -433,42 +450,41 @@ TexturePromoteToVram(PSP_RenderData* data, PSP_TextureData* psp_texture, SDL_boo } } -static int -TextureSpillLRU(PSP_RenderData* data, size_t wanted) { - PSP_TextureData* lru = data->least_recent_target; - if(lru) { - if(TextureSpillToSram(data, lru) < 0) { +static int TextureSpillLRU(PSP_RenderData *data, size_t wanted) +{ + PSP_TextureData *lru = data->least_recent_target; + if (lru) { + if (TextureSpillToSram(data, lru) < 0) { return -1; } LRUTargetRemove(data, lru); } else { // Asked to spill but there nothing to spill - return SDL_SetError("Could not spill more VRAM to system memory. VRAM : %dKB,(%dKB), wanted %dKB", vmemavail()/1024, vlargestblock()/1024, wanted/1024); + return SDL_SetError("Could not spill more VRAM to system memory. VRAM : %dKB,(%dKB), wanted %dKB", vmemavail() / 1024, vlargestblock() / 1024, wanted / 1024); } return 0; } -static int -TextureSpillTargetsForSpace(PSP_RenderData* data, size_t size) +static int TextureSpillTargetsForSpace(PSP_RenderData *data, size_t size) { - while(vlargestblock() < size) { - if(TextureSpillLRU(data, size) < 0) { + while (vlargestblock() < size) { + if (TextureSpillLRU(data, size) < 0) { return -1; } } return 0; } -static int -TextureBindAsTarget(PSP_RenderData* data, PSP_TextureData* psp_texture) { +static int TextureBindAsTarget(PSP_RenderData *data, PSP_TextureData *psp_texture) +{ unsigned int dstFormat; - if(!InVram(psp_texture->data)) { + if (!InVram(psp_texture->data)) { // Bring back the texture in vram - if(TextureSpillTargetsForSpace(data, psp_texture->size) < 0) { + if (TextureSpillTargetsForSpace(data, psp_texture->size) < 0) { return -1; } - if(TexturePromoteToVram(data, psp_texture, SDL_TRUE) < 0) { + if (TexturePromoteToVram(data, psp_texture, SDL_TRUE) < 0) { return -1; } } @@ -477,7 +493,7 @@ TextureBindAsTarget(PSP_RenderData* data, PSP_TextureData* psp_texture) { // Stencil alpha dst hack dstFormat = psp_texture->format; - if(dstFormat == GU_PSM_5551) { + if (dstFormat == GU_PSM_5551) { sceGuEnable(GU_STENCIL_TEST); sceGuStencilOp(GU_REPLACE, GU_REPLACE, GU_REPLACE); sceGuStencilFunc(GU_GEQUAL, 0xff, 0xff); @@ -490,20 +506,18 @@ TextureBindAsTarget(PSP_RenderData* data, PSP_TextureData* psp_texture) { return 0; } -static void -PSP_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void PSP_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { } - -static int -PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int PSP_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { PSP_RenderData *data = renderer->driverdata; - PSP_TextureData* psp_texture = (PSP_TextureData*) SDL_calloc(1, sizeof(*psp_texture)); + PSP_TextureData *psp_texture = (PSP_TextureData *)SDL_calloc(1, sizeof(*psp_texture)); - if(!psp_texture) + if (!psp_texture) { return SDL_OutOfMemory(); + } psp_texture->swizzled = SDL_FALSE; psp_texture->width = texture->w; @@ -512,40 +526,38 @@ PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) psp_texture->textureWidth = TextureNextPow2(texture->w); psp_texture->format = PixelFormatToPSPFMT(texture->format); - switch(psp_texture->format) - { - case GU_PSM_5650: - case GU_PSM_5551: - case GU_PSM_4444: - psp_texture->bits = 16; - break; + switch (psp_texture->format) { + case GU_PSM_5650: + case GU_PSM_5551: + case GU_PSM_4444: + psp_texture->bits = 16; + break; - case GU_PSM_8888: - psp_texture->bits = 32; - break; + case GU_PSM_8888: + psp_texture->bits = 32; + break; - default: - SDL_free(psp_texture); - return -1; + default: + SDL_free(psp_texture); + return -1; } psp_texture->pitch = psp_texture->textureWidth * SDL_BYTESPERPIXEL(texture->format); - psp_texture->size = psp_texture->textureHeight*psp_texture->pitch; - if(texture->access & SDL_TEXTUREACCESS_TARGET) { - if(TextureSpillTargetsForSpace(renderer->driverdata, psp_texture->size) < 0){ + psp_texture->size = psp_texture->textureHeight * psp_texture->pitch; + if (texture->access & SDL_TEXTUREACCESS_TARGET) { + if (TextureSpillTargetsForSpace(renderer->driverdata, psp_texture->size) < 0) { SDL_free(psp_texture); return -1; } psp_texture->data = vramalloc(psp_texture->size); - if(psp_texture->data) { + if (psp_texture->data) { LRUTargetPushFront(data, psp_texture); } } else { psp_texture->data = SDL_calloc(1, psp_texture->size); } - if(!psp_texture->data) - { + if (!psp_texture->data) { SDL_free(psp_texture); return SDL_OutOfMemory(); } @@ -554,51 +566,44 @@ PSP_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -TextureShouldSwizzle(PSP_TextureData* psp_texture, SDL_Texture *texture) +static int TextureShouldSwizzle(PSP_TextureData *psp_texture, SDL_Texture *texture) { - return !((texture->access == SDL_TEXTUREACCESS_TARGET) && InVram(psp_texture->data)) - && texture->access != SDL_TEXTUREACCESS_STREAMING - && (texture->w >= 16 || texture->h >= 16); + return !((texture->access == SDL_TEXTUREACCESS_TARGET) && InVram(psp_texture->data)) && texture->access != SDL_TEXTUREACCESS_STREAMING && (texture->w >= 16 || texture->h >= 16); } -static void -TextureActivate(SDL_Texture * texture) +static void TextureActivate(SDL_Texture *texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; int scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GU_NEAREST : GU_LINEAR; /* Swizzling is useless with small textures. */ - if (TextureShouldSwizzle(psp_texture, texture)) - { + if (TextureShouldSwizzle(psp_texture, texture)) { TextureSwizzle(psp_texture, NULL); } sceGuTexWrap(GU_REPEAT, GU_REPEAT); sceGuTexMode(psp_texture->format, 0, 0, psp_texture->swizzled); sceGuTexFilter(scaleMode, scaleMode); /* GU_NEAREST good for tile-map */ - /* GU_LINEAR good for scaling */ + /* GU_LINEAR good for scaling */ sceGuTexImage(0, psp_texture->textureWidth, psp_texture->textureHeight, psp_texture->textureWidth, psp_texture->data); } -static int -PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch); +static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch); -static int -PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int PSP_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { -/* PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; */ + /* PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; */ const Uint8 *src; Uint8 *dst; - int row, length,dpitch; + int row, length, dpitch; src = pixels; - PSP_LockTexture(renderer, texture,rect,(void **)&dst, &dpitch); + PSP_LockTexture(renderer, texture, rect, (void **)&dst, &dpitch); length = rect->w * SDL_BYTESPERPIXEL(texture->format); if (length == pitch && length == dpitch) { - SDL_memcpy(dst, src, length*rect->h); + SDL_memcpy(dst, src, length * rect->h); } else { for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, src, length); @@ -611,23 +616,21 @@ PSP_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, return 0; } -static int -PSP_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; *pixels = - (void *) ((Uint8 *) psp_texture->data + rect->y * psp_texture->pitch + - rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)psp_texture->data + rect->y * psp_texture->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = psp_texture->pitch; return 0; } -static void -PSP_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void PSP_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; SDL_Rect rect; /* We do whole texture updates, at least for now */ @@ -638,28 +641,24 @@ PSP_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) PSP_UpdateTexture(renderer, texture, &rect, psp_texture->data, psp_texture->pitch); } -static void -PSP_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void PSP_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { /* Nothing to do because TextureActivate takes care of it */ } -static int -PSP_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int PSP_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { return 0; } -static int -PSP_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int PSP_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -PSP_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int PSP_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VertV *verts = (VertV *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertV), 4, &cmd->data.draw.first); + VertV *verts = (VertV *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertV), 4, &cmd->data.draw.first); int i; if (!verts) { @@ -677,11 +676,10 @@ PSP_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F return 0; } -static int -PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; @@ -689,9 +687,9 @@ PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t cmd->data.draw.count = count; size_indices = indices ? size_indices : 0; - if (texture == NULL) { + if (!texture) { VertCV *verts; - verts = (VertCV *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertCV), 4, &cmd->data.draw.first); + verts = (VertCV *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertCV), 4, &cmd->data.draw.first); if (!verts) { return -1; } @@ -710,8 +708,8 @@ PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); verts->x = xy_[0] * scale_x; verts->y = xy_[1] * scale_y; @@ -722,9 +720,9 @@ PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t verts++; } } else { - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; VertTCV *verts; - verts = (VertTCV *) SDL_AllocateRenderVertices(renderer, count * sizeof (VertTCV), 4, &cmd->data.draw.first); + verts = (VertTCV *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertTCV), 4, &cmd->data.draw.first); if (!verts) { return -1; } @@ -745,9 +743,9 @@ PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); - uv_ = (float *)((char*)uv + j * uv_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); + uv_ = (float *)((char *)uv + j * uv_stride); verts->x = xy_[0] * scale_x; verts->y = xy_[1] * scale_y; @@ -765,10 +763,9 @@ PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *t return 0; } -static int -PSP_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count) +static int PSP_QueueFillRects(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count) { - VertV *verts = (VertV *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (VertV), 4, &cmd->data.draw.first); + VertV *verts = (VertV *)SDL_AllocateRenderVertices(renderer, count * 2 * sizeof(VertV), 4, &cmd->data.draw.first); int i; if (!verts) { @@ -791,9 +788,8 @@ PSP_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FR return 0; } -static int -PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect) +static int PSP_QueueCopy(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect) { VertTV *verts; const float x = dstrect->x; @@ -806,9 +802,8 @@ PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * tex const float u1 = srcrect->x + srcrect->w; const float v1 = srcrect->y + srcrect->h; - if((MathAbs(u1) - MathAbs(u0)) < 64.0f) - { - verts = (VertTV *) SDL_AllocateRenderVertices(renderer, 2 * sizeof (VertTV), 4, &cmd->data.draw.first); + if ((MathAbs(u1) - MathAbs(u0)) < 64.0f) { + verts = (VertTV *)SDL_AllocateRenderVertices(renderer, 2 * sizeof(VertTV), 4, &cmd->data.draw.first); if (!verts) { return -1; } @@ -828,9 +823,7 @@ PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * tex verts->y = y + height; verts->z = 0; verts++; - } - else - { + } else { float start, end; float curU = u0; float curX = x; @@ -838,21 +831,20 @@ PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * tex const float slice = 64.0f; const size_t count = SDL_ceilf(width / slice); size_t i; - float ustep = (u1 - u0)/width * slice; + float ustep = (u1 - u0) / width * slice; - if(ustep < 0.0f) + if (ustep < 0.0f) { ustep = -ustep; + } cmd->data.draw.count = count; - verts = (VertTV *) SDL_AllocateRenderVertices(renderer, count * 2 * sizeof (VertTV), 4, &cmd->data.draw.first); + verts = (VertTV *)SDL_AllocateRenderVertices(renderer, count * 2 * sizeof(VertTV), 4, &cmd->data.draw.first); if (!verts) { return -1; } - - for(i = 0, start = 0, end = width; i < count; i++, start += slice) - { + for (i = 0, start = 0, end = width; i < count; i++, start += slice) { const float polyWidth = ((curX + slice) > endX) ? (endX - curX) : slice; const float sourceWidth = ((curU + ustep) > u1) ? (u1 - curU) : ustep; @@ -880,12 +872,11 @@ PSP_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * tex return 0; } -static int -PSP_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect, - const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) +static int PSP_QueueCopyEx(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) { - VertTV *verts = (VertTV *) SDL_AllocateRenderVertices(renderer, 4 * sizeof (VertTV), 4, &cmd->data.draw.first); + VertTV *verts = (VertTV *)SDL_AllocateRenderVertices(renderer, 4 * sizeof(VertTV), 4, &cmd->data.draw.first); const float centerx = center->x; const float centery = center->y; const float x = dstrect->x + centerx; @@ -906,7 +897,7 @@ PSP_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * t cmd->data.draw.count = 1; - MathSincos(degToRad(360-angle), &s, &c); + MathSincos(degToRad(360 - angle), &s, &c); cw1 = c * -centerx; sw1 = s * -centerx; @@ -969,8 +960,8 @@ PSP_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * t return 0; } -static void -ResetBlendState(PSP_BlendState* state) { +static void ResetBlendState(PSP_BlendState *state) +{ sceGuColor(0xffffffff); state->color = 0xffffffff; state->mode = SDL_BLENDMODE_INVALID; @@ -980,23 +971,22 @@ ResetBlendState(PSP_BlendState* state) { state->shadeModel = GU_SMOOTH; } -static void -StartDrawing(SDL_Renderer * renderer) +static void StartDrawing(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; // Check if we need to start GU displaylist - if(!data->displayListAvail) { + if (!data->displayListAvail) { sceGuStart(GU_DIRECT, DisplayList); data->displayListAvail = SDL_TRUE; - //ResetBlendState(&data->blendState); + // ResetBlendState(&data->blendState); } // Check if we need a draw buffer change - if(renderer->target != data->boundTarget) { - SDL_Texture* texture = renderer->target; - if(texture) { - PSP_TextureData* psp_texture = (PSP_TextureData*) texture->driverdata; + if (renderer->target != data->boundTarget) { + SDL_Texture *texture = renderer->target; + if (texture) { + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; // Set target, registering LRU TextureBindAsTarget(data, psp_texture); } else { @@ -1007,11 +997,9 @@ StartDrawing(SDL_Renderer * renderer) } } - -static void -PSP_SetBlendState(PSP_RenderData* data, PSP_BlendState* state) +static void PSP_SetBlendState(PSP_RenderData *data, PSP_BlendState *state) { - PSP_BlendState* current = &data->blendState; + PSP_BlendState *current = &data->blendState; if (state->mode != current->mode) { switch (state->mode) { @@ -1021,21 +1009,22 @@ PSP_SetBlendState(PSP_RenderData* data, PSP_BlendState* state) break; case SDL_BLENDMODE_BLEND: sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); - sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0 ); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); sceGuEnable(GU_BLEND); break; case SDL_BLENDMODE_ADD: - sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); - sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0x00FFFFFF ); + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); + sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0x00FFFFFF); sceGuEnable(GU_BLEND); break; case SDL_BLENDMODE_MOD: - sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); sceGuBlendFunc(GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0); sceGuEnable(GU_BLEND); break; case SDL_BLENDMODE_MUL: - sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); + /* FIXME SDL_BLENDMODE_MUL is simplified, and dstA is in fact un-changed.*/ sceGuBlendFunc(GU_ADD, GU_DST_COLOR, GU_ONE_MINUS_SRC_ALPHA, 0, 0); sceGuEnable(GU_BLEND); break; @@ -1044,16 +1033,16 @@ PSP_SetBlendState(PSP_RenderData* data, PSP_BlendState* state) } } - if(state->color != current->color) { + if (state->color != current->color) { sceGuColor(state->color); } - if(state->shadeModel != current->shadeModel) { + if (state->shadeModel != current->shadeModel) { sceGuShadeModel(state->shadeModel); } - if(state->texture != current->texture) { - if(state->texture != NULL) { + if (state->texture != current->texture) { + if (state->texture) { TextureActivate(state->texture); sceGuEnable(GU_TEXTURE_2D); } else { @@ -1064,11 +1053,105 @@ PSP_SetBlendState(PSP_RenderData* data, PSP_BlendState* state) *current = *state; } -static int -PSP_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static void ClampCliprectToViewport(SDL_Rect *clip, const SDL_Rect *viewport) { - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + int max_x_v, max_y_v, max_x_c, max_y_c; + + if (clip->x < 0) { + clip->w += clip->x; + clip->x = 0; + } + + if (clip->y < 0) { + clip->h += clip->y; + clip->y = 0; + } + + max_x_c = clip->x + clip->w; + max_y_c = clip->y + clip->h; + + max_x_v = viewport->x + viewport->w; + max_y_v = viewport->y + viewport->h; + + if (max_x_c > max_x_v) { + clip->w -= (max_x_v - max_x_c); + } + + if (max_y_c > max_y_v) { + clip->h -= (max_y_v - max_y_c); + } +} + +static void SetDrawState(PSP_RenderData *data) +{ + if (data->drawstate.viewport_dirty) { + SDL_Rect *viewport = &data->drawstate.viewport; + /* FIXME: Find a genuine way to make viewport work (right now calling these functions here give no effect) */ + /* + sceGuOffset(2048 - (480 >> 1) + viewport->x, 2048 - (272 >> 1) + viewport->y); + sceGuViewport(2048, 2048, viewport->w, viewport->h); + */ + data->drawstate.draw_offset_x = viewport->x; + data->drawstate.draw_offset_y = viewport->y; + data->drawstate.viewport_dirty = SDL_FALSE; + } + + if (data->drawstate.cliprect_enabled_dirty) { + if (!data->drawstate.cliprect_enabled && !data->drawstate.viewport_is_set) { + sceGuScissor(0, 0, data->drawstate.drawablew, data->drawstate.drawableh); + sceGuEnable(GU_SCISSOR_TEST); + } + data->drawstate.cliprect_enabled_dirty = SDL_FALSE; + } + + if ((data->drawstate.cliprect_enabled || data->drawstate.viewport_is_set) && data->drawstate.cliprect_dirty) { + SDL_Rect rect; + SDL_Rect *viewport = &data->drawstate.viewport; + SDL_copyp(&rect, &data->drawstate.cliprect); + if (data->drawstate.viewport_is_set) { + ClampCliprectToViewport(&rect, viewport); + rect.x += viewport->x; + rect.y += viewport->y; + } + sceGuEnable(GU_SCISSOR_TEST); + sceGuScissor(rect.x, rect.y, rect.w, rect.h); + data->drawstate.cliprect_dirty = SDL_FALSE; + } +} + +#define PSP_VERTICES_FUNK(FunkName, Type) \ +static const Type *FunkName(const PSP_DrawstateCache *drawstate, Uint8 *gpumem, SDL_RenderCommand *cmd, size_t count) \ +{ \ + size_t i; \ + float off_x, off_y; \ + Type *verts = (Type *)(gpumem + cmd->data.draw.first); \ +\ + if (!drawstate->viewport_is_set) { \ + return verts; \ + } \ + \ + off_x = drawstate->draw_offset_x; \ + off_y = drawstate->draw_offset_y; \ + \ + for (i = 0; i < count; ++i) { \ + verts[i].x += off_x; \ + verts[i].y += off_y; \ + } \ +\ + return verts;\ +} + +PSP_VERTICES_FUNK(PSP_GetVertV, VertV) +PSP_VERTICES_FUNK(PSP_GetVertTV, VertTV) +PSP_VERTICES_FUNK(PSP_GetVertCV, VertCV) +PSP_VERTICES_FUNK(PSP_GetVertTCV, VertTCV) + +static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +{ + PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; Uint8 *gpumem = NULL; + int w = 0, h = 0; + StartDrawing(renderer); /* note that before the renderer interface change, this would do extrememly small @@ -1077,166 +1160,225 @@ PSP_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti I don't know what the limits on PSP hardware are. It might be useful to have rendering backends report a reasonable maximum, so the higher level can flush if we appear to be exceeding that. */ - gpumem = (Uint8 *) sceGuGetMemory(vertsize); + gpumem = (Uint8 *)sceGuGetMemory(vertsize); if (!gpumem) { - return SDL_SetError("Couldn't obtain a %d-byte vertex buffer!", (int) vertsize); + return SDL_SetError("Couldn't obtain a %d-byte vertex buffer!", (int)vertsize); } SDL_memcpy(gpumem, vertices, vertsize); + if (!data->boundTarget) { + SDL_GL_GetDrawableSize(renderer->window, &w, &h); + } else { + PSP_TextureData *psp_texture = (PSP_TextureData *)data->boundTarget->driverdata; + w = psp_texture->width; + h = psp_texture->height; + } + + if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { + data->drawstate.viewport_dirty = SDL_TRUE; /* if the window dimensions changed, invalidate the current viewport, etc. */ + data->drawstate.cliprect_dirty = SDL_TRUE; + data->drawstate.drawablew = w; + data->drawstate.drawableh = h; + } + while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; /* !!! FIXME: we could cache drawstate like color */ - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; /* !!! FIXME: we could cache drawstate like color */ + } - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &cmd->data.viewport.rect; - sceGuOffset(2048 - (viewport->w >> 1), 2048 - (viewport->h >> 1)); - sceGuViewport(2048, 2048, viewport->w, viewport->h); - sceGuScissor(viewport->x, viewport->y, viewport->w, viewport->h); - break; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; + data->drawstate.cliprect_dirty = SDL_TRUE; + data->drawstate.viewport_is_set = viewport->x != 0 || viewport->y != 0 || viewport->w != data->drawstate.drawablew || viewport->h != data->drawstate.drawableh; + if (!data->drawstate.cliprect_enabled) { + if (data->drawstate.viewport_is_set) { + SDL_copyp(&data->drawstate.cliprect, viewport); + data->drawstate.cliprect.x = 0; + data->drawstate.cliprect.y = 0; + } else { + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + } + } } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if(cmd->data.cliprect.enabled){ - sceGuEnable(GU_SCISSOR_TEST); - sceGuScissor(rect->x, rect->y, rect->w, rect->h); - } else { - sceGuDisable(GU_SCISSOR_TEST); + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + const SDL_Rect *viewport = &data->drawstate.viewport; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + if (!data->drawstate.cliprect_enabled && data->drawstate.viewport_is_set) { + SDL_copyp(&data->drawstate.cliprect, viewport); + data->drawstate.cliprect.x = 0; + data->drawstate.cliprect.y = 0; } - break; } - case SDL_RENDERCMD_CLEAR: { - const Uint8 r = cmd->data.color.r; - const Uint8 g = cmd->data.color.g; - const Uint8 b = cmd->data.color.b; - const Uint8 a = cmd->data.color.a; - sceGuClearColor(GU_RGBA(r,g,b,a)); - sceGuClearStencil(a); - sceGuClear(GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT); - break; + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_DRAW_POINTS: { - const size_t count = cmd->data.draw.count; - const VertV *verts = (VertV *) (gpumem + cmd->data.draw.first); - const Uint8 r = cmd->data.draw.r; - const Uint8 g = cmd->data.draw.g; - const Uint8 b = cmd->data.draw.b; - const Uint8 a = cmd->data.draw.a; - PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = NULL, - .mode = cmd->data.draw.blend, - .shadeModel = GU_FLAT - }; - PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_POINTS, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, verts); - break; - } + case SDL_RENDERCMD_CLEAR: + { + const Uint8 r = cmd->data.color.r; + const Uint8 g = cmd->data.color.g; + const Uint8 b = cmd->data.color.b; + const Uint8 a = cmd->data.color.a; + SetDrawState(data); + sceGuClearColor(GU_RGBA(r, g, b, a)); + sceGuClearStencil(a); + sceGuClear(GU_COLOR_BUFFER_BIT | GU_STENCIL_BUFFER_BIT); + break; + } - case SDL_RENDERCMD_DRAW_LINES: { - const size_t count = cmd->data.draw.count; - const VertV *verts = (VertV *) (gpumem + cmd->data.draw.first); - const Uint8 r = cmd->data.draw.r; - const Uint8 g = cmd->data.draw.g; - const Uint8 b = cmd->data.draw.b; - const Uint8 a = cmd->data.draw.a; - PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = NULL, - .mode = cmd->data.draw.blend, - .shadeModel = GU_FLAT - }; - PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_LINE_STRIP, GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, verts); - break; - } + case SDL_RENDERCMD_DRAW_POINTS: + { + const size_t count = cmd->data.draw.count; + const VertV *verts; /* = (VertV *)(gpumem + cmd->data.draw.first);*/ + const Uint8 r = cmd->data.draw.r; + const Uint8 g = cmd->data.draw.g; + const Uint8 b = cmd->data.draw.b; + const Uint8 a = cmd->data.draw.a; + PSP_BlendState state = { + .color = GU_RGBA(r, g, b, a), + .texture = NULL, + .mode = cmd->data.draw.blend, + .shadeModel = GU_FLAT + }; + SetDrawState(data); + verts = PSP_GetVertV(&data->drawstate, gpumem, cmd, count); + PSP_SetBlendState(data, &state); + sceGuDrawArray(GU_POINTS, GU_VERTEX_32BITF | GU_TRANSFORM_2D, count, 0, verts); + break; + } - case SDL_RENDERCMD_FILL_RECTS: { - const size_t count = cmd->data.draw.count; - const VertV *verts = (VertV *) (gpumem + cmd->data.draw.first); - const Uint8 r = cmd->data.draw.r; - const Uint8 g = cmd->data.draw.g; - const Uint8 b = cmd->data.draw.b; - const Uint8 a = cmd->data.draw.a; - PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = NULL, - .mode = cmd->data.draw.blend, - .shadeModel = GU_FLAT - }; - PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_SPRITES, GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2 * count, 0, verts); - break; - } + case SDL_RENDERCMD_DRAW_LINES: + { + const size_t count = cmd->data.draw.count; + const VertV *verts; /* = (VertV *)(gpumem + cmd->data.draw.first);*/ + const Uint8 r = cmd->data.draw.r; + const Uint8 g = cmd->data.draw.g; + const Uint8 b = cmd->data.draw.b; + const Uint8 a = cmd->data.draw.a; + PSP_BlendState state = { + .color = GU_RGBA(r, g, b, a), + .texture = NULL, + .mode = cmd->data.draw.blend, + .shadeModel = GU_FLAT + }; + SetDrawState(data); + verts = PSP_GetVertV(&data->drawstate, gpumem, cmd, count); + PSP_SetBlendState(data, &state); + sceGuDrawArray(GU_LINE_STRIP, GU_VERTEX_32BITF | GU_TRANSFORM_2D, count, 0, verts); + break; + } - case SDL_RENDERCMD_COPY: { - const size_t count = cmd->data.draw.count; - const VertTV *verts = (VertTV *) (gpumem + cmd->data.draw.first); - const Uint8 a = cmd->data.draw.a; - const Uint8 r = cmd->data.draw.r; - const Uint8 g = cmd->data.draw.g; - const Uint8 b = cmd->data.draw.b; - PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = cmd->data.draw.texture, - .mode = cmd->data.draw.blend, - .shadeModel = GU_SMOOTH - }; - PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 2 * count, 0, verts); - break; - } + case SDL_RENDERCMD_FILL_RECTS: + { + const size_t count = cmd->data.draw.count; + const VertV *verts; /* = (VertV *)(gpumem + cmd->data.draw.first);*/ + const Uint8 r = cmd->data.draw.r; + const Uint8 g = cmd->data.draw.g; + const Uint8 b = cmd->data.draw.b; + const Uint8 a = cmd->data.draw.a; + PSP_BlendState state = { + .color = GU_RGBA(r, g, b, a), + .texture = NULL, + .mode = cmd->data.draw.blend, + .shadeModel = GU_FLAT + }; + SetDrawState(data); + verts = PSP_GetVertV(&data->drawstate, gpumem, cmd, 2 * count); + PSP_SetBlendState(data, &state); + sceGuDrawArray(GU_SPRITES, GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2 * count, 0, verts); + break; + } - case SDL_RENDERCMD_COPY_EX: { - const VertTV *verts = (VertTV *) (gpumem + cmd->data.draw.first); + case SDL_RENDERCMD_COPY: + { + const size_t count = cmd->data.draw.count; + const VertTV *verts; /*= (VertTV *)(gpumem + cmd->data.draw.first);*/ + const Uint8 a = cmd->data.draw.a; + const Uint8 r = cmd->data.draw.r; + const Uint8 g = cmd->data.draw.g; + const Uint8 b = cmd->data.draw.b; + PSP_BlendState state = { + .color = GU_RGBA(r, g, b, a), + .texture = cmd->data.draw.texture, + .mode = cmd->data.draw.blend, + .shadeModel = GU_SMOOTH + }; + SetDrawState(data); + verts = PSP_GetVertTV(&data->drawstate, gpumem, cmd, 2 * count); + PSP_SetBlendState(data, &state); + sceGuDrawArray(GU_SPRITES, GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_2D, 2 * count, 0, verts); + break; + } + + case SDL_RENDERCMD_COPY_EX: + { + const VertTV *verts = (VertTV *)(gpumem + cmd->data.draw.first); + const Uint8 a = cmd->data.draw.a; + const Uint8 r = cmd->data.draw.r; + const Uint8 g = cmd->data.draw.g; + const Uint8 b = cmd->data.draw.b; + PSP_BlendState state = { + .color = GU_RGBA(r, g, b, a), + .texture = cmd->data.draw.texture, + .mode = cmd->data.draw.blend, + .shadeModel = GU_SMOOTH + }; + SetDrawState(data); + verts = PSP_GetVertTV(&data->drawstate, gpumem, cmd, 4); + PSP_SetBlendState(data, &state); + sceGuDrawArray(GU_TRIANGLE_FAN, GU_TEXTURE_32BITF | GU_VERTEX_32BITF | GU_TRANSFORM_2D, 4, 0, verts); + break; + } + + case SDL_RENDERCMD_GEOMETRY: + { + const size_t count = cmd->data.draw.count; + SetDrawState(data); + if (!cmd->data.draw.texture) { + const VertCV *verts = PSP_GetVertCV(&data->drawstate, gpumem, cmd, count); + sceGuDisable(GU_TEXTURE_2D); + /* In GU_SMOOTH mode */ + sceGuDrawArray(GU_TRIANGLES, GU_COLOR_8888 | GU_VERTEX_32BITF | GU_TRANSFORM_2D, count, 0, verts); + sceGuEnable(GU_TEXTURE_2D); + } else { + const VertTCV *verts; /*= (VertTCV *)(gpumem + cmd->data.draw.first);*/ const Uint8 a = cmd->data.draw.a; const Uint8 r = cmd->data.draw.r; const Uint8 g = cmd->data.draw.g; const Uint8 b = cmd->data.draw.b; PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = cmd->data.draw.texture, + .color = GU_RGBA(r, g, b, a), + .texture = NULL, .mode = cmd->data.draw.blend, - .shadeModel = GU_SMOOTH + .shadeModel = GU_FLAT }; + verts = PSP_GetVertTCV(&data->drawstate, gpumem, cmd, count); + TextureActivate(cmd->data.draw.texture); PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_TRIANGLE_FAN, GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_TRANSFORM_2D, 4, 0, verts); - break; - } - - case SDL_RENDERCMD_GEOMETRY: { - const size_t count = cmd->data.draw.count; - if (cmd->data.draw.texture == NULL) { - const VertCV *verts = (VertCV *) (gpumem + cmd->data.draw.first); - sceGuDisable(GU_TEXTURE_2D); - /* In GU_SMOOTH mode */ - sceGuDrawArray(GU_TRIANGLES, GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, verts); - sceGuEnable(GU_TEXTURE_2D); - } else { - const VertTCV *verts = (VertTCV *) (gpumem + cmd->data.draw.first); - const Uint8 a = cmd->data.draw.a; - const Uint8 r = cmd->data.draw.r; - const Uint8 g = cmd->data.draw.g; - const Uint8 b = cmd->data.draw.b; - PSP_BlendState state = { - .color = GU_RGBA(r,g,b,a), - .texture = NULL, - .mode = cmd->data.draw.blend, - .shadeModel = GU_FLAT - }; - TextureActivate(cmd->data.draw.texture); - PSP_SetBlendState(data, &state); - sceGuDrawArray(GU_TRIANGLES, GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_2D, count, 0, verts); - } - break; + sceGuDrawArray(GU_TRIANGLES, GU_TEXTURE_32BITF | GU_COLOR_8888 | GU_VERTEX_32BITF | GU_TRANSFORM_2D, count, 0, verts); } + break; + } - case SDL_RENDERCMD_NO_OP: - break; + case SDL_RENDERCMD_NO_OP: + break; } cmd = cmd->next; @@ -1245,27 +1387,26 @@ PSP_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti return 0; } -static int -PSP_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 pixel_format, void * pixels, int pitch) +static int PSP_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 pixel_format, void *pixels, int pitch) { return SDL_Unsupported(); } -static int -PSP_RenderPresent(SDL_Renderer * renderer) +static int PSP_RenderPresent(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; if (!data->displayListAvail) { return -1; } data->displayListAvail = SDL_FALSE; sceGuFinish(); - sceGuSync(0,0); + sceGuSync(0, 0); - if ((data->vsync) && (data->vblank_not_reached)) + if ((data->vsync) && (data->vblank_not_reached)) { sceDisplayWaitVblankStart(); + } data->vblank_not_reached = SDL_TRUE; data->backbuffer = data->frontbuffer; @@ -1274,17 +1415,18 @@ PSP_RenderPresent(SDL_Renderer * renderer) return 0; } -static void -PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void PSP_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - PSP_RenderData *renderdata = (PSP_RenderData *) renderer->driverdata; - PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; + PSP_RenderData *renderdata = (PSP_RenderData *)renderer->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; - if (renderdata == NULL) + if (!renderdata) { return; + } - if(psp_texture == NULL) + if (!psp_texture) { return; + } LRUTargetRemove(renderdata, psp_texture); TextureStorageFree(psp_texture->data); @@ -1292,18 +1434,16 @@ PSP_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture->driverdata = NULL; } -static void -PSP_DestroyRenderer(SDL_Renderer * renderer) +static void PSP_DestroyRenderer(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *) renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; if (data) { - if (!data->initialized) + if (!data->initialized) { return; - - StartDrawing(renderer); + } sceKernelDisableSubIntr(PSP_VBLANK_INT, 0); - sceKernelReleaseSubIntrHandler(PSP_VBLANK_INT,0); + sceKernelReleaseSubIntrHandler(PSP_VBLANK_INT, 0); sceDisplayWaitVblankStart(); sceGuDisplay(GU_FALSE); sceGuTerm(); @@ -1314,40 +1454,27 @@ PSP_DestroyRenderer(SDL_Renderer * renderer) data->displayListAvail = SDL_FALSE; SDL_free(data); } - SDL_free(renderer); } -static int -PSP_SetVSync(SDL_Renderer * renderer, const int vsync) +static int PSP_SetVSync(SDL_Renderer *renderer, const int vsync) { PSP_RenderData *data = renderer->driverdata; data->vsync = vsync; return 0; } -SDL_Renderer * -PSP_CreateRenderer(SDL_Window * window, Uint32 flags) +int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - - SDL_Renderer *renderer; PSP_RenderData *data; int pixelformat; - void* doublebuffer = NULL; + void *doublebuffer = NULL; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (PSP_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (PSP_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { PSP_DestroyRenderer(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } - renderer->WindowEvent = PSP_WindowEvent; renderer->CreateTexture = PSP_CreateTexture; renderer->UpdateTexture = PSP_UpdateTexture; @@ -1356,9 +1483,9 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->SetTextureScaleMode = PSP_SetTextureScaleMode; renderer->SetRenderTarget = PSP_SetRenderTarget; renderer->QueueSetViewport = PSP_QueueSetViewport; - renderer->QueueSetDrawColor = PSP_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = PSP_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = PSP_QueueDrawPoints; - renderer->QueueDrawLines = PSP_QueueDrawPoints; /* lines and points queue vertices the same way. */ + renderer->QueueDrawLines = PSP_QueueDrawPoints; /* lines and points queue vertices the same way. */ renderer->QueueGeometry = PSP_QueueGeometry; renderer->QueueFillRects = PSP_QueueFillRects; renderer->QueueCopy = PSP_QueueCopy; @@ -1384,24 +1511,23 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) data->vsync = SDL_FALSE; } - pixelformat=PixelFormatToPSPFMT(SDL_GetWindowPixelFormat(window)); - switch(pixelformat) - { - case GU_PSM_4444: - case GU_PSM_5650: - case GU_PSM_5551: - data->bpp = 2; - data->psm = pixelformat; - break; - default: - data->bpp = 4; - data->psm = GU_PSM_8888; - break; + pixelformat = PixelFormatToPSPFMT(SDL_GetWindowPixelFormat(window)); + switch (pixelformat) { + case GU_PSM_4444: + case GU_PSM_5650: + case GU_PSM_5551: + data->bpp = 2; + data->psm = pixelformat; + break; + default: + data->bpp = 4; + data->psm = GU_PSM_8888; + break; } - doublebuffer = vramalloc(PSP_FRAME_BUFFER_SIZE*data->bpp*2); + doublebuffer = vramalloc(PSP_FRAME_BUFFER_SIZE * data->bpp * 2); data->backbuffer = doublebuffer; - data->frontbuffer = ((uint8_t*)doublebuffer)+PSP_FRAME_BUFFER_SIZE*data->bpp; + data->frontbuffer = ((uint8_t *)doublebuffer) + PSP_FRAME_BUFFER_SIZE * data->bpp; sceGuInit(); /* setup GU */ @@ -1409,11 +1535,9 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) sceGuDrawBuffer(data->psm, vrelptr(data->frontbuffer), PSP_FRAME_BUFFER_WIDTH); sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, vrelptr(data->backbuffer), PSP_FRAME_BUFFER_WIDTH); - - sceGuOffset(2048 - (PSP_SCREEN_WIDTH>>1), 2048 - (PSP_SCREEN_HEIGHT>>1)); + sceGuOffset(2048 - (PSP_SCREEN_WIDTH >> 1), 2048 - (PSP_SCREEN_HEIGHT >> 1)); sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); - sceGuDisable(GU_DEPTH_TEST); /* Scissoring */ @@ -1427,11 +1551,11 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) sceGuEnable(GU_CULL_FACE); */ - //Setup initial blend state + // Setup initial blend state ResetBlendState(&data->blendState); sceGuFinish(); - sceGuSync(0,0); + sceGuSync(0, 0); sceDisplayWaitVblankStartCB(); sceGuDisplay(GU_TRUE); @@ -1440,7 +1564,7 @@ PSP_CreateRenderer(SDL_Window * window, Uint32 flags) sceKernelRegisterSubIntrHandler(PSP_VBLANK_INT, 0, psp_on_vblank, data); sceKernelEnableSubIntr(PSP_VBLANK_INT, 0); - return renderer; + return 0; } SDL_RenderDriver PSP_RenderDriver = { @@ -1449,17 +1573,17 @@ SDL_RenderDriver PSP_RenderDriver = { .name = "PSP", .flags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE, .num_texture_formats = 4, - .texture_formats = { [0] = SDL_PIXELFORMAT_BGR565, - [1] = SDL_PIXELFORMAT_ABGR1555, - [2] = SDL_PIXELFORMAT_ABGR4444, - [3] = SDL_PIXELFORMAT_ABGR8888, + .texture_formats = { + [0] = SDL_PIXELFORMAT_BGR565, + [1] = SDL_PIXELFORMAT_ABGR1555, + [2] = SDL_PIXELFORMAT_ABGR4444, + [3] = SDL_PIXELFORMAT_ABGR8888, }, .max_texture_width = 512, .max_texture_height = 512, - } + } }; #endif /* SDL_VIDEO_RENDER_PSP */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/render/psp/SDL_render_psp.h b/src/render/psp/SDL_render_psp.h new file mode 100644 index 0000000000000..74a964fcc3d1b --- /dev/null +++ b/src/render/psp/SDL_render_psp.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* this header is meant to be included after the other related internal SDL + headers. it's the interface between psp renderer and video driver code. */ + +#define PSP_SCREEN_WIDTH 480 +#define PSP_SCREEN_HEIGHT 272 + +#define PSP_FRAME_BUFFER_WIDTH 512 +#define PSP_FRAME_BUFFER_SIZE (PSP_FRAME_BUFFER_WIDTH * PSP_SCREEN_HEIGHT) + +enum SDL_PSP_RenderProps +{ + SDL_PSP_RENDERPROPS_FRONTBUFFER, + SDL_PSP_RENDERPROPS_BACKBUFFER, +}; + +int SDL_PSP_RenderGetProp(SDL_Renderer *r, enum SDL_PSP_RenderProps which, void** out); + diff --git a/src/render/software/SDL_blendfillrect.c b/src/render/software/SDL_blendfillrect.c index 569c15058b672..ac2136654bead 100644 --- a/src/render/software/SDL_blendfillrect.c +++ b/src/render/software/SDL_blendfillrect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "SDL_draw.h" #include "SDL_blendfillrect.h" - -static int -SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_RGB555(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -52,9 +50,8 @@ SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect, return 0; } -static int -SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_RGB565(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -78,9 +75,8 @@ SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect, return 0; } -static int -SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_RGB888(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -104,9 +100,8 @@ SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect, return 0; } -static int -SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_ARGB8888(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -130,9 +125,8 @@ SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect, return 0; } -static int -SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_RGB(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -181,9 +175,8 @@ SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect, } } -static int -SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendFillRect_RGBA(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -213,9 +206,8 @@ SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect, } } -int -SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_Rect clipped; @@ -280,13 +272,12 @@ SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, } } -int -SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_Rect rect; int i; - int (*func)(SDL_Surface * dst, const SDL_Rect * rect, + int (*func)(SDL_Surface * dst, const SDL_Rect *rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; int status = 0; @@ -352,6 +343,6 @@ SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, return status; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendfillrect.h b/src/render/software/SDL_blendfillrect.h index 8ee62b198d57c..df66e641f30de 100644 --- a/src/render/software/SDL_blendfillrect.h +++ b/src/render/software/SDL_blendfillrect.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,8 @@ #include "../../SDL_internal.h" - -extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); #endif /* SDL_blendfillrect_h_ */ diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c index 4921bf1010ed3..0844e7ff1dbff 100644 --- a/src/render/software/SDL_blendline.c +++ b/src/render/software/SDL_blendline.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,17 +20,15 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "SDL_draw.h" #include "SDL_blendline.h" #include "SDL_blendpoint.h" - -static void -SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; @@ -133,10 +131,9 @@ SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { unsigned r, g, b, a, inva; @@ -238,10 +235,9 @@ SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { unsigned r, g, b, a, inva; @@ -343,10 +339,9 @@ SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; @@ -449,10 +444,9 @@ SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; unsigned r, g, b, a, inva; @@ -555,10 +549,9 @@ SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_RGB888(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { unsigned r, g, b, a, inva; @@ -660,10 +653,9 @@ SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -static void -SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, - SDL_bool draw_end) +static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, + SDL_bool draw_end) { unsigned r, g, b, a, inva; @@ -765,14 +757,13 @@ SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2, } } -typedef void (*BlendLineFunc) (SDL_Surface * dst, - int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, - Uint8 r, Uint8 g, Uint8 b, Uint8 a, - SDL_bool draw_end); +typedef void (*BlendLineFunc)(SDL_Surface *dst, + int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, + Uint8 r, Uint8 g, Uint8 b, Uint8 a, + SDL_bool draw_end); -static BlendLineFunc -SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt) +static BlendLineFunc SDL_CalculateBlendLineFunc(const SDL_PixelFormat *fmt) { switch (fmt->BytesPerPixel) { case 2: @@ -802,9 +793,8 @@ SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt) return NULL; } -int -SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { BlendLineFunc func; @@ -827,9 +817,8 @@ SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, return 0; } -int -SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { int i; int x1, y1; @@ -847,8 +836,8 @@ SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, } for (i = 1; i < count; ++i) { - x1 = points[i-1].x; - y1 = points[i-1].y; + x1 = points[i - 1].x; + y1 = points[i - 1].y; x2 = points[i].x; y2 = points[i].y; @@ -863,13 +852,13 @@ SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, func(dst, x1, y1, x2, y2, blendMode, r, g, b, a, draw_end); } - if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) { - SDL_BlendPoint(dst, points[count-1].x, points[count-1].y, + if (points[0].x != points[count - 1].x || points[0].y != points[count - 1].y) { + SDL_BlendPoint(dst, points[count - 1].x, points[count - 1].y, blendMode, r, g, b, a); } return 0; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendline.h b/src/render/software/SDL_blendline.h index a844110c40840..4612afdb1627d 100644 --- a/src/render/software/SDL_blendline.h +++ b/src/render/software/SDL_blendline.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,8 @@ #include "../../SDL_internal.h" - -extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); #endif /* SDL_blendline_h_ */ diff --git a/src/render/software/SDL_blendpoint.c b/src/render/software/SDL_blendpoint.c index 613169b7bacdc..ecdea30b1f8d2 100644 --- a/src/render/software/SDL_blendpoint.c +++ b/src/render/software/SDL_blendpoint.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "SDL_draw.h" #include "SDL_blendpoint.h" - -static int -SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_RGB555(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -52,9 +50,8 @@ SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, return 0; } -static int -SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_RGB565(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -78,9 +75,8 @@ SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, return 0; } -static int -SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_RGB888(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -104,9 +100,8 @@ SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, return 0; } -static int -SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, - Uint8 r, Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_ARGB8888(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, + Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -130,9 +125,8 @@ SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode return 0; } -static int -SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_RGB(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -181,9 +175,8 @@ SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uin } } -static int -SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +static int SDL_BlendPoint_RGBA(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -213,9 +206,8 @@ SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Ui } } -int -SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, - Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, + Uint8 g, Uint8 b, Uint8 a) { if (!dst) { return SDL_InvalidParamError("SDL_BlendPoint(): dst"); @@ -274,9 +266,8 @@ SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r } } -int -SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, - SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { int minx, miny; int maxx, maxy; @@ -357,6 +348,6 @@ SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, return status; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_blendpoint.h b/src/render/software/SDL_blendpoint.h index bf6ddec0727bf..23a67a3a84b40 100644 --- a/src/render/software/SDL_blendpoint.h +++ b/src/render/software/SDL_blendpoint.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,8 @@ #include "../../SDL_internal.h" - -extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); #endif /* SDL_blendpoint_h_ */ diff --git a/src/render/software/SDL_draw.h b/src/render/software/SDL_draw.h index 2acb3d3a1bbf0..f9e5ad393237c 100644 --- a/src/render/software/SDL_draw.h +++ b/src/render/software/SDL_draw.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,77 +26,90 @@ * and in the blend and add case, the RGB values are premultiplied by a. */ -#define DRAW_MUL(_a, _b) (((unsigned)(_a)*(_b))/255) +#define DRAW_MUL(_a, _b) (((unsigned)(_a) * (_b)) / 255) #define DRAW_FASTSETPIXEL(type) \ - *pixel = (type) color + *pixel = (type)color #define DRAW_FASTSETPIXEL1 DRAW_FASTSETPIXEL(Uint8) #define DRAW_FASTSETPIXEL2 DRAW_FASTSETPIXEL(Uint16) #define DRAW_FASTSETPIXEL4 DRAW_FASTSETPIXEL(Uint32) #define DRAW_FASTSETPIXELXY(x, y, type, bpp, color) \ - *(type *)((Uint8 *)dst->pixels + (y) * dst->pitch \ - + (x) * bpp) = (type) color + *(type *)((Uint8 *)dst->pixels + (y)*dst->pitch + (x)*bpp) = (type)color #define DRAW_FASTSETPIXELXY1(x, y) DRAW_FASTSETPIXELXY(x, y, Uint8, 1, color) #define DRAW_FASTSETPIXELXY2(x, y) DRAW_FASTSETPIXELXY(x, y, Uint16, 2, color) #define DRAW_FASTSETPIXELXY4(x, y) DRAW_FASTSETPIXELXY(x, y, Uint32, 4, color) -#define DRAW_SETPIXEL(setpixel) \ -do { \ - unsigned sr = r, sg = g, sb = b, sa = a; (void) sa; \ - setpixel; \ -} while (0) +#define DRAW_SETPIXEL(setpixel) \ + do { \ + unsigned sr = r, sg = g, sb = b, sa = a; \ + (void)sa; \ + setpixel; \ + } while (0) #define DRAW_SETPIXEL_BLEND(getpixel, setpixel) \ -do { \ - unsigned sr, sg, sb, sa = 0xFF; \ - getpixel; \ - sr = DRAW_MUL(inva, sr) + r; \ - sg = DRAW_MUL(inva, sg) + g; \ - sb = DRAW_MUL(inva, sb) + b; \ - sa = DRAW_MUL(inva, sa) + a; \ - setpixel; \ -} while (0) + do { \ + unsigned sr, sg, sb, sa = 0xFF; \ + getpixel; \ + sr = DRAW_MUL(inva, sr) + r; \ + sg = DRAW_MUL(inva, sg) + g; \ + sb = DRAW_MUL(inva, sb) + b; \ + sa = DRAW_MUL(inva, sa) + a; \ + setpixel; \ + } while (0) #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \ -do { \ - unsigned sr, sg, sb, sa; (void) sa; \ - getpixel; \ - sr += r; if (sr > 0xff) sr = 0xff; \ - sg += g; if (sg > 0xff) sg = 0xff; \ - sb += b; if (sb > 0xff) sb = 0xff; \ - setpixel; \ -} while (0) + do { \ + unsigned sr, sg, sb, sa; \ + (void)sa; \ + getpixel; \ + sr += r; \ + if (sr > 0xff) \ + sr = 0xff; \ + sg += g; \ + if (sg > 0xff) \ + sg = 0xff; \ + sb += b; \ + if (sb > 0xff) \ + sb = 0xff; \ + setpixel; \ + } while (0) #define DRAW_SETPIXEL_MOD(getpixel, setpixel) \ -do { \ - unsigned sr, sg, sb, sa; (void) sa; \ - getpixel; \ - sr = DRAW_MUL(sr, r); \ - sg = DRAW_MUL(sg, g); \ - sb = DRAW_MUL(sb, b); \ - setpixel; \ -} while (0) - -#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \ -do { \ - unsigned sr, sg, sb, sa; sa = 0xFF; \ - getpixel; \ - sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); if (sr > 0xff) sr = 0xff; \ - sg = DRAW_MUL(sg, g) + DRAW_MUL(inva, sg); if (sg > 0xff) sg = 0xff; \ - sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); if (sb > 0xff) sb = 0xff; \ - sa = DRAW_MUL(sa, a) + DRAW_MUL(inva, sa); if (sa > 0xff) sa = 0xff; \ - setpixel; \ -} while (0) - -#define DRAW_SETPIXELXY(x, y, type, bpp, op) \ -do { \ - type *pixel = (type *)((Uint8 *)dst->pixels + (y) * dst->pitch \ - + (x) * bpp); \ - op; \ -} while (0) + do { \ + unsigned sr, sg, sb, sa; \ + (void)sa; \ + getpixel; \ + sr = DRAW_MUL(sr, r); \ + sg = DRAW_MUL(sg, g); \ + sb = DRAW_MUL(sb, b); \ + setpixel; \ + } while (0) + +#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \ + do { \ + unsigned sr, sg, sb, sa; \ + (void)sa; \ + getpixel; \ + sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); \ + if (sr > 0xff) \ + sr = 0xff; \ + sg = DRAW_MUL(sg, g) + DRAW_MUL(inva, sg); \ + if (sg > 0xff) \ + sg = 0xff; \ + sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); \ + if (sb > 0xff) \ + sb = 0xff; \ + setpixel; \ + } while (0) + +#define DRAW_SETPIXELXY(x, y, type, bpp, op) \ + do { \ + type *pixel = (type *)((Uint8 *)dst->pixels + (y)*dst->pitch + (x)*bpp); \ + op; \ + } while (0) /* * Define draw operators for RGB555 @@ -105,19 +118,19 @@ do { \ #define DRAW_SETPIXEL_RGB555 \ DRAW_SETPIXEL(RGB555_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_BLEND_RGB555 \ +#define DRAW_SETPIXEL_BLEND_RGB555 \ DRAW_SETPIXEL_BLEND(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_ADD_RGB555 \ +#define DRAW_SETPIXEL_ADD_RGB555 \ DRAW_SETPIXEL_ADD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB555 \ +#define DRAW_SETPIXEL_MOD_RGB555 \ DRAW_SETPIXEL_MOD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MUL_RGB555 \ +#define DRAW_SETPIXEL_MUL_RGB555 \ DRAW_SETPIXEL_MUL(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) @@ -143,19 +156,19 @@ do { \ #define DRAW_SETPIXEL_RGB565 \ DRAW_SETPIXEL(RGB565_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_BLEND_RGB565 \ +#define DRAW_SETPIXEL_BLEND_RGB565 \ DRAW_SETPIXEL_BLEND(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_ADD_RGB565 \ +#define DRAW_SETPIXEL_ADD_RGB565 \ DRAW_SETPIXEL_ADD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB565 \ +#define DRAW_SETPIXEL_MOD_RGB565 \ DRAW_SETPIXEL_MOD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MUL_RGB565 \ +#define DRAW_SETPIXEL_MUL_RGB565 \ DRAW_SETPIXEL_MUL(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) @@ -181,19 +194,19 @@ do { \ #define DRAW_SETPIXEL_RGB888 \ DRAW_SETPIXEL(RGB888_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_BLEND_RGB888 \ +#define DRAW_SETPIXEL_BLEND_RGB888 \ DRAW_SETPIXEL_BLEND(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ RGB888_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_ADD_RGB888 \ +#define DRAW_SETPIXEL_ADD_RGB888 \ DRAW_SETPIXEL_ADD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ RGB888_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB888 \ +#define DRAW_SETPIXEL_MOD_RGB888 \ DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ RGB888_FROM_RGB(*pixel, sr, sg, sb)) -#define DRAW_SETPIXEL_MUL_RGB888 \ +#define DRAW_SETPIXEL_MUL_RGB888 \ DRAW_SETPIXEL_MUL(RGB_FROM_RGB888(*pixel, sr, sg, sb), \ RGB888_FROM_RGB(*pixel, sr, sg, sb)) @@ -219,19 +232,19 @@ do { \ #define DRAW_SETPIXEL_ARGB8888 \ DRAW_SETPIXEL(ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_BLEND_ARGB8888 \ +#define DRAW_SETPIXEL_BLEND_ARGB8888 \ DRAW_SETPIXEL_BLEND(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_ADD_ARGB8888 \ +#define DRAW_SETPIXEL_ADD_ARGB8888 \ DRAW_SETPIXEL_ADD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MOD_ARGB8888 \ +#define DRAW_SETPIXEL_MOD_ARGB8888 \ DRAW_SETPIXEL_MOD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MUL_ARGB8888 \ +#define DRAW_SETPIXEL_MUL_ARGB8888 \ DRAW_SETPIXEL_MUL(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) @@ -257,19 +270,19 @@ do { \ #define DRAW_SETPIXEL_RGB \ DRAW_SETPIXEL(PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) -#define DRAW_SETPIXEL_BLEND_RGB \ +#define DRAW_SETPIXEL_BLEND_RGB \ DRAW_SETPIXEL_BLEND(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) -#define DRAW_SETPIXEL_ADD_RGB \ +#define DRAW_SETPIXEL_ADD_RGB \ DRAW_SETPIXEL_ADD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) -#define DRAW_SETPIXEL_MOD_RGB \ +#define DRAW_SETPIXEL_MOD_RGB \ DRAW_SETPIXEL_MOD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) -#define DRAW_SETPIXEL_MUL_RGB \ +#define DRAW_SETPIXEL_MUL_RGB \ DRAW_SETPIXEL_MUL(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) @@ -303,7 +316,6 @@ do { \ #define DRAW_SETPIXELXY4_MUL_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_RGB) - /* * Define draw operators for general RGBA */ @@ -311,19 +323,19 @@ do { \ #define DRAW_SETPIXEL_RGBA \ DRAW_SETPIXEL(PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_BLEND_RGBA \ +#define DRAW_SETPIXEL_BLEND_RGBA \ DRAW_SETPIXEL_BLEND(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_ADD_RGBA \ +#define DRAW_SETPIXEL_ADD_RGBA \ DRAW_SETPIXEL_ADD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MOD_RGBA \ +#define DRAW_SETPIXEL_MOD_RGBA \ DRAW_SETPIXEL_MOD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) -#define DRAW_SETPIXEL_MUL_RGBA \ +#define DRAW_SETPIXEL_MUL_RGBA \ DRAW_SETPIXEL_MUL(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) @@ -349,284 +361,301 @@ do { \ #define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) /* Horizontal line */ -#define HLINE(type, op, draw_end) \ -{ \ - int length; \ - int pitch = (dst->pitch / dst->format->BytesPerPixel); \ - type *pixel; \ - if (x1 <= x2) { \ - pixel = (type *)dst->pixels + y1 * pitch + x1; \ - length = draw_end ? (x2-x1+1) : (x2-x1); \ - } else { \ - pixel = (type *)dst->pixels + y1 * pitch + x2; \ - if (!draw_end) { \ - ++pixel; \ - } \ - length = draw_end ? (x1-x2+1) : (x1-x2); \ - } \ - while (length--) { \ - op; \ - ++pixel; \ - } \ -} +#define HLINE(type, op, draw_end) \ + { \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (x1 <= x2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + length = draw_end ? (x2 - x1 + 1) : (x2 - x1); \ + } else { \ + pixel = (type *)dst->pixels + y1 * pitch + x2; \ + if (!draw_end) { \ + ++pixel; \ + } \ + length = draw_end ? (x1 - x2 + 1) : (x1 - x2); \ + } \ + while (length--) { \ + op; \ + ++pixel; \ + } \ + } /* Vertical line */ -#define VLINE(type, op, draw_end) \ -{ \ - int length; \ - int pitch = (dst->pitch / dst->format->BytesPerPixel); \ - type *pixel; \ - if (y1 <= y2) { \ - pixel = (type *)dst->pixels + y1 * pitch + x1; \ - length = draw_end ? (y2-y1+1) : (y2-y1); \ - } else { \ - pixel = (type *)dst->pixels + y2 * pitch + x1; \ - if (!draw_end) { \ - pixel += pitch; \ - } \ - length = draw_end ? (y1-y2+1) : (y1-y2); \ - } \ - while (length--) { \ - op; \ - pixel += pitch; \ - } \ -} +#define VLINE(type, op, draw_end) \ + { \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (y1 <= y2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + length = draw_end ? (y2 - y1 + 1) : (y2 - y1); \ + } else { \ + pixel = (type *)dst->pixels + y2 * pitch + x1; \ + if (!draw_end) { \ + pixel += pitch; \ + } \ + length = draw_end ? (y1 - y2 + 1) : (y1 - y2); \ + } \ + while (length--) { \ + op; \ + pixel += pitch; \ + } \ + } /* Diagonal line */ -#define DLINE(type, op, draw_end) \ -{ \ - int length; \ - int pitch = (dst->pitch / dst->format->BytesPerPixel); \ - type *pixel; \ - if (y1 <= y2) { \ - pixel = (type *)dst->pixels + y1 * pitch + x1; \ - if (x1 <= x2) { \ - ++pitch; \ - } else { \ - --pitch; \ - } \ - length = (y2-y1); \ - } else { \ - pixel = (type *)dst->pixels + y2 * pitch + x2; \ - if (x2 <= x1) { \ - ++pitch; \ - } else { \ - --pitch; \ - } \ - if (!draw_end) { \ - pixel += pitch; \ - } \ - length = (y1-y2); \ - } \ - if (draw_end) { \ - ++length; \ - } \ - while (length--) { \ - op; \ - pixel += pitch; \ - } \ -} +#define DLINE(type, op, draw_end) \ + { \ + int length; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + type *pixel; \ + if (y1 <= y2) { \ + pixel = (type *)dst->pixels + y1 * pitch + x1; \ + if (x1 <= x2) { \ + ++pitch; \ + } else { \ + --pitch; \ + } \ + length = (y2 - y1); \ + } else { \ + pixel = (type *)dst->pixels + y2 * pitch + x2; \ + if (x2 <= x1) { \ + ++pitch; \ + } else { \ + --pitch; \ + } \ + if (!draw_end) { \ + pixel += pitch; \ + } \ + length = (y1 - y2); \ + } \ + if (draw_end) { \ + ++length; \ + } \ + while (length--) { \ + op; \ + pixel += pitch; \ + } \ + } /* Bresenham's line algorithm */ #define BLINE(x1, y1, x2, y2, op, draw_end) \ -{ \ - int i, deltax, deltay, numpixels; \ - int d, dinc1, dinc2; \ - int x, xinc1, xinc2; \ - int y, yinc1, yinc2; \ - \ - deltax = ABS(x2 - x1); \ - deltay = ABS(y2 - y1); \ - \ - if (deltax >= deltay) { \ - numpixels = deltax + 1; \ - d = (2 * deltay) - deltax; \ - dinc1 = deltay * 2; \ - dinc2 = (deltay - deltax) * 2; \ - xinc1 = 1; \ - xinc2 = 1; \ - yinc1 = 0; \ - yinc2 = 1; \ - } else { \ - numpixels = deltay + 1; \ - d = (2 * deltax) - deltay; \ - dinc1 = deltax * 2; \ - dinc2 = (deltax - deltay) * 2; \ - xinc1 = 0; \ - xinc2 = 1; \ - yinc1 = 1; \ - yinc2 = 1; \ - } \ - \ - if (x1 > x2) { \ - xinc1 = -xinc1; \ - xinc2 = -xinc2; \ - } \ - if (y1 > y2) { \ - yinc1 = -yinc1; \ - yinc2 = -yinc2; \ - } \ - \ - x = x1; \ - y = y1; \ - \ - if (!draw_end) { \ - --numpixels; \ - } \ - for (i = 0; i < numpixels; ++i) { \ - op(x, y); \ - if (d < 0) { \ - d += dinc1; \ - x += xinc1; \ - y += yinc1; \ - } else { \ - d += dinc2; \ - x += xinc2; \ - y += yinc2; \ - } \ - } \ -} + { \ + int i, deltax, deltay, numpixels; \ + int d, dinc1, dinc2; \ + int x, xinc1, xinc2; \ + int y, yinc1, yinc2; \ + \ + deltax = ABS(x2 - x1); \ + deltay = ABS(y2 - y1); \ + \ + if (deltax >= deltay) { \ + numpixels = deltax + 1; \ + d = (2 * deltay) - deltax; \ + dinc1 = deltay * 2; \ + dinc2 = (deltay - deltax) * 2; \ + xinc1 = 1; \ + xinc2 = 1; \ + yinc1 = 0; \ + yinc2 = 1; \ + } else { \ + numpixels = deltay + 1; \ + d = (2 * deltax) - deltay; \ + dinc1 = deltax * 2; \ + dinc2 = (deltax - deltay) * 2; \ + xinc1 = 0; \ + xinc2 = 1; \ + yinc1 = 1; \ + yinc2 = 1; \ + } \ + \ + if (x1 > x2) { \ + xinc1 = -xinc1; \ + xinc2 = -xinc2; \ + } \ + if (y1 > y2) { \ + yinc1 = -yinc1; \ + yinc2 = -yinc2; \ + } \ + \ + x = x1; \ + y = y1; \ + \ + if (!draw_end) { \ + --numpixels; \ + } \ + for (i = 0; i < numpixels; ++i) { \ + op(x, y); \ + if (d < 0) { \ + d += dinc1; \ + x += xinc1; \ + y += yinc1; \ + } else { \ + d += dinc2; \ + x += xinc2; \ + y += yinc2; \ + } \ + } \ + } /* Xiaolin Wu's line algorithm, based on Michael Abrash's implementation */ -#define WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ -{ \ - Uint16 ErrorAdj, ErrorAcc; \ - Uint16 ErrorAccTemp, Weighting; \ - int DeltaX, DeltaY, Temp, XDir; \ - unsigned r, g, b, a, inva; \ - \ - /* Draw the initial pixel, which is always exactly intersected by \ - the line and so needs no weighting */ \ - opaque_op(x1, y1); \ - \ - /* Draw the final pixel, which is always exactly intersected by the line \ - and so needs no weighting */ \ - if (draw_end) { \ - opaque_op(x2, y2); \ - } \ - \ - /* Make sure the line runs top to bottom */ \ - if (y1 > y2) { \ - Temp = y1; y1 = y2; y2 = Temp; \ - Temp = x1; x1 = x2; x2 = Temp; \ - } \ - DeltaY = y2 - y1; \ - \ - if ((DeltaX = x2 - x1) >= 0) { \ - XDir = 1; \ - } else { \ - XDir = -1; \ - DeltaX = -DeltaX; /* make DeltaX positive */ \ - } \ - \ - /* line is not horizontal, diagonal, or vertical */ \ - ErrorAcc = 0; /* initialize the line error accumulator to 0 */ \ - \ - /* Is this an X-major or Y-major line? */ \ - if (DeltaY > DeltaX) { \ - /* Y-major line; calculate 16-bit fixed-point fractional part of a \ - pixel that X advances each time Y advances 1 pixel, truncating the \ - result so that we won't overrun the endpoint along the X axis */ \ - ErrorAdj = ((unsigned long) DeltaX << 16) / (unsigned long) DeltaY; \ - /* Draw all pixels other than the first and last */ \ - while (--DeltaY) { \ - ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ - ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ - if (ErrorAcc <= ErrorAccTemp) { \ - /* The error accumulator turned over, so advance the X coord */ \ - x1 += XDir; \ - } \ - y1++; /* Y-major, so always advance Y */ \ - /* The IntensityBits most significant bits of ErrorAcc give us the \ - intensity weighting for this pixel, and the complement of the \ - weighting for the paired pixel */ \ - Weighting = ErrorAcc >> 8; \ - { \ - a = DRAW_MUL(_a, (Weighting ^ 255)); \ - r = DRAW_MUL(_r, a); \ - g = DRAW_MUL(_g, a); \ - b = DRAW_MUL(_b, a); \ - inva = (a ^ 0xFF); \ - blend_op(x1, y1); \ - } \ - { \ - a = DRAW_MUL(_a, Weighting); \ - r = DRAW_MUL(_r, a); \ - g = DRAW_MUL(_g, a); \ - b = DRAW_MUL(_b, a); \ - inva = (a ^ 0xFF); \ - blend_op(x1 + XDir, y1); \ - } \ - } \ - } else { \ - /* X-major line; calculate 16-bit fixed-point fractional part of a \ - pixel that Y advances each time X advances 1 pixel, truncating the \ - result to avoid overrunning the endpoint along the X axis */ \ - ErrorAdj = ((unsigned long) DeltaY << 16) / (unsigned long) DeltaX; \ - /* Draw all pixels other than the first and last */ \ - while (--DeltaX) { \ - ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ - ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ - if (ErrorAcc <= ErrorAccTemp) { \ - /* The error accumulator turned over, so advance the Y coord */ \ - y1++; \ - } \ - x1 += XDir; /* X-major, so always advance X */ \ - /* The IntensityBits most significant bits of ErrorAcc give us the \ - intensity weighting for this pixel, and the complement of the \ - weighting for the paired pixel */ \ - Weighting = ErrorAcc >> 8; \ - { \ - a = DRAW_MUL(_a, (Weighting ^ 255)); \ - r = DRAW_MUL(_r, a); \ - g = DRAW_MUL(_g, a); \ - b = DRAW_MUL(_b, a); \ - inva = (a ^ 0xFF); \ - blend_op(x1, y1); \ - } \ - { \ - a = DRAW_MUL(_a, Weighting); \ - r = DRAW_MUL(_r, a); \ - g = DRAW_MUL(_g, a); \ - b = DRAW_MUL(_b, a); \ - inva = (a ^ 0xFF); \ - blend_op(x1, y1 + 1); \ - } \ - } \ - } \ -} +#define WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ + { \ + Uint16 ErrorAdj, ErrorAcc; \ + Uint16 ErrorAccTemp, Weighting; \ + int DeltaX, DeltaY, Temp, XDir; \ + unsigned r, g, b, a, inva; \ + \ + /* Draw the initial pixel, which is always exactly intersected by \ + the line and so needs no weighting */ \ + opaque_op(x1, y1); \ + \ + /* Draw the final pixel, which is always exactly intersected by the line \ + and so needs no weighting */ \ + if (draw_end) { \ + opaque_op(x2, y2); \ + } \ + \ + /* Make sure the line runs top to bottom */ \ + if (y1 > y2) { \ + Temp = y1; \ + y1 = y2; \ + y2 = Temp; \ + Temp = x1; \ + x1 = x2; \ + x2 = Temp; \ + } \ + DeltaY = y2 - y1; \ + \ + if ((DeltaX = x2 - x1) >= 0) { \ + XDir = 1; \ + } else { \ + XDir = -1; \ + DeltaX = -DeltaX; /* make DeltaX positive */ \ + } \ + \ + /* line is not horizontal, diagonal, or vertical */ \ + ErrorAcc = 0; /* initialize the line error accumulator to 0 */ \ + \ + /* Is this an X-major or Y-major line? */ \ + if (DeltaY > DeltaX) { \ + /* Y-major line; calculate 16-bit fixed-point fractional part of a \ + pixel that X advances each time Y advances 1 pixel, truncating the \ + result so that we won't overrun the endpoint along the X axis */ \ + ErrorAdj = ((unsigned long)DeltaX << 16) / (unsigned long)DeltaY; \ + /* Draw all pixels other than the first and last */ \ + while (--DeltaY) { \ + ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ + ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ + if (ErrorAcc <= ErrorAccTemp) { \ + /* The error accumulator turned over, so advance the X coord */ \ + x1 += XDir; \ + } \ + y1++; /* Y-major, so always advance Y */ \ + /* The IntensityBits most significant bits of ErrorAcc give us the \ + intensity weighting for this pixel, and the complement of the \ + weighting for the paired pixel */ \ + Weighting = ErrorAcc >> 8; \ + { \ + a = DRAW_MUL(_a, (Weighting ^ 255)); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1); \ + } \ + { \ + a = DRAW_MUL(_a, Weighting); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1 + XDir, y1); \ + } \ + } \ + } else { \ + /* X-major line; calculate 16-bit fixed-point fractional part of a \ + pixel that Y advances each time X advances 1 pixel, truncating the \ + result to avoid overrunning the endpoint along the X axis */ \ + ErrorAdj = ((unsigned long)DeltaY << 16) / (unsigned long)DeltaX; \ + /* Draw all pixels other than the first and last */ \ + while (--DeltaX) { \ + ErrorAccTemp = ErrorAcc; /* remember currrent accumulated error */ \ + ErrorAcc += ErrorAdj; /* calculate error for next pixel */ \ + if (ErrorAcc <= ErrorAccTemp) { \ + /* The error accumulator turned over, so advance the Y coord */ \ + y1++; \ + } \ + x1 += XDir; /* X-major, so always advance X */ \ + /* The IntensityBits most significant bits of ErrorAcc give us the \ + intensity weighting for this pixel, and the complement of the \ + weighting for the paired pixel */ \ + Weighting = ErrorAcc >> 8; \ + { \ + a = DRAW_MUL(_a, (Weighting ^ 255)); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1); \ + } \ + { \ + a = DRAW_MUL(_a, Weighting); \ + r = DRAW_MUL(_r, a); \ + g = DRAW_MUL(_g, a); \ + b = DRAW_MUL(_b, a); \ + inva = (a ^ 0xFF); \ + blend_op(x1, y1 + 1); \ + } \ + } \ + } \ + } #ifdef AA_LINES #define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ - WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) + WULINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) #else #define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end) \ - BLINE(x1, y1, x2, y2, opaque_op, draw_end) + BLINE(x1, y1, x2, y2, opaque_op, draw_end) #endif /* * Define fill rect macro */ -#define FILLRECT(type, op) \ -do { \ - int width = rect->w; \ - int height = rect->h; \ - int pitch = (dst->pitch / dst->format->BytesPerPixel); \ - int skip = pitch - width; \ - type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \ - while (height--) { \ - { int n = (width+3)/4; \ - switch (width & 3) { \ - case 0: do { op; pixel++; SDL_FALLTHROUGH; \ - case 3: op; pixel++; SDL_FALLTHROUGH; \ - case 2: op; pixel++; SDL_FALLTHROUGH; \ - case 1: op; pixel++; \ - } while ( --n > 0 ); \ - } \ - } \ - pixel += skip; \ - } \ -} while (0) +#define FILLRECT(type, op) \ + do { \ + int width = rect->w; \ + int height = rect->h; \ + int pitch = (dst->pitch / dst->format->BytesPerPixel); \ + int skip = pitch - width; \ + type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \ + while (height--) { \ + { \ + int n = (width + 3) / 4; \ + switch (width & 3) { \ + case 0: \ + do { \ + op; \ + pixel++; \ + SDL_FALLTHROUGH; \ + case 3: \ + op; \ + pixel++; \ + SDL_FALLTHROUGH; \ + case 2: \ + op; \ + pixel++; \ + SDL_FALLTHROUGH; \ + case 1: \ + op; \ + pixel++; \ + } while (--n > 0); \ + } \ + } \ + pixel += skip; \ + } \ + } while (0) /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawline.c b/src/render/software/SDL_drawline.c index e309f16195732..8b6bc3d722f30 100644 --- a/src/render/software/SDL_drawline.c +++ b/src/render/software/SDL_drawline.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,16 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "SDL_draw.h" #include "SDL_drawline.h" #include "SDL_drawpoint.h" - -static void -SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, - SDL_bool draw_end) +static void SDL_DrawLine1(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) { if (y1 == y2) { int length; @@ -37,13 +35,13 @@ SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, Uint8 *pixel; if (x1 <= x2) { pixel = (Uint8 *)dst->pixels + y1 * pitch + x1; - length = draw_end ? (x2-x1+1) : (x2-x1); + length = draw_end ? (x2 - x1 + 1) : (x2 - x1); } else { pixel = (Uint8 *)dst->pixels + y1 * pitch + x2; if (!draw_end) { ++pixel; } - length = draw_end ? (x1-x2+1) : (x1-x2); + length = draw_end ? (x1 - x2 + 1) : (x1 - x2); } SDL_memset(pixel, color, length); } else if (x1 == x2) { @@ -55,9 +53,8 @@ SDL_DrawLine1(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, } } -static void -SDL_DrawLine2(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, - SDL_bool draw_end) +static void SDL_DrawLine2(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) { if (y1 == y2) { HLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); @@ -67,7 +64,7 @@ SDL_DrawLine2(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, DLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); } else { Uint8 _r, _g, _b, _a; - const SDL_PixelFormat * fmt = dst->format; + const SDL_PixelFormat *fmt = dst->format; SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); if (fmt->Rmask == 0x7C00) { AALINE(x1, y1, x2, y2, @@ -85,9 +82,8 @@ SDL_DrawLine2(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, } } -static void -SDL_DrawLine4(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, - SDL_bool draw_end) +static void SDL_DrawLine4(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, + SDL_bool draw_end) { if (y1 == y2) { HLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); @@ -97,7 +93,7 @@ SDL_DrawLine4(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, DLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); } else { Uint8 _r, _g, _b, _a; - const SDL_PixelFormat * fmt = dst->format; + const SDL_PixelFormat *fmt = dst->format; SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); if (fmt->Rmask == 0x00FF0000) { if (!fmt->Amask) { @@ -117,12 +113,11 @@ SDL_DrawLine4(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color, } } -typedef void (*DrawLineFunc) (SDL_Surface * dst, - int x1, int y1, int x2, int y2, - Uint32 color, SDL_bool draw_end); +typedef void (*DrawLineFunc)(SDL_Surface *dst, + int x1, int y1, int x2, int y2, + Uint32 color, SDL_bool draw_end); -static DrawLineFunc -SDL_CalculateDrawLineFunc(const SDL_PixelFormat * fmt) +static DrawLineFunc SDL_CalculateDrawLineFunc(const SDL_PixelFormat *fmt) { switch (fmt->BytesPerPixel) { case 1: @@ -138,8 +133,7 @@ SDL_CalculateDrawLineFunc(const SDL_PixelFormat * fmt) return NULL; } -int -SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color) +int SDL_DrawLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color) { DrawLineFunc func; @@ -162,9 +156,8 @@ SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color) return 0; } -int -SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, - Uint32 color) +int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, + Uint32 color) { int i; int x1, y1; @@ -182,8 +175,8 @@ SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, } for (i = 1; i < count; ++i) { - x1 = points[i-1].x; - y1 = points[i-1].y; + x1 = points[i - 1].x; + y1 = points[i - 1].y; x2 = points[i].x; y2 = points[i].y; @@ -198,12 +191,12 @@ SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, func(dst, x1, y1, x2, y2, color, draw_end); } - if (points[0].x != points[count-1].x || points[0].y != points[count-1].y) { - SDL_DrawPoint(dst, points[count-1].x, points[count-1].y, color); + if (points[0].x != points[count - 1].x || points[0].y != points[count - 1].y) { + SDL_DrawPoint(dst, points[count - 1].x, points[count - 1].y, color); } return 0; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawline.h b/src/render/software/SDL_drawline.h index 186119e8e0986..1472f744a1980 100644 --- a/src/render/software/SDL_drawline.h +++ b/src/render/software/SDL_drawline.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,8 @@ #include "../../SDL_internal.h" - -extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color); -extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); +extern int SDL_DrawLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color); +extern int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, Uint32 color); #endif /* SDL_drawline_h_ */ diff --git a/src/render/software/SDL_drawpoint.c b/src/render/software/SDL_drawpoint.c index b99838ac621cb..9e095a319c59a 100644 --- a/src/render/software/SDL_drawpoint.c +++ b/src/render/software/SDL_drawpoint.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "SDL_draw.h" #include "SDL_drawpoint.h" - -int -SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color) +int SDL_DrawPoint(SDL_Surface *dst, int x, int y, Uint32 color) { if (!dst) { return SDL_InvalidParamError("SDL_DrawPoint(): dst"); @@ -61,9 +59,8 @@ SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color) return 0; } -int -SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, - Uint32 color) +int SDL_DrawPoints(SDL_Surface *dst, const SDL_Point *points, int count, + Uint32 color) { int minx, miny; int maxx, maxy; @@ -109,6 +106,6 @@ SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, return 0; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_drawpoint.h b/src/render/software/SDL_drawpoint.h index 4c019e014e45f..994c529a87742 100644 --- a/src/render/software/SDL_drawpoint.h +++ b/src/render/software/SDL_drawpoint.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,8 @@ #include "../../SDL_internal.h" - -extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color); -extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); +extern int SDL_DrawPoint(SDL_Surface *dst, int x, int y, Uint32 color); +extern int SDL_DrawPoints(SDL_Surface *dst, const SDL_Point *points, int count, Uint32 color); #endif /* SDL_drawpoint_h_ */ diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 6ba77d46e5d57..8abf428704543 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #include "../SDL_sysrender.h" #include "SDL_render_sw_c.h" @@ -50,11 +50,9 @@ typedef struct SDL_Surface *window; } SW_RenderData; - -static SDL_Surface * -SW_ActivateRenderer(SDL_Renderer * renderer) +static SDL_Surface *SW_ActivateRenderer(SDL_Renderer *renderer) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->driverdata; if (!data->surface) { data->surface = data->window; @@ -68,10 +66,9 @@ SW_ActivateRenderer(SDL_Renderer * renderer) return data->surface; } -static void -SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void SW_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->driverdata; if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) { data->surface = NULL; @@ -79,10 +76,9 @@ SW_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } -static int -SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) +static int SW_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->driverdata; if (data->surface) { if (w) { @@ -95,21 +91,19 @@ SW_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) } if (renderer->window) { - SDL_GetWindowSize(renderer->window, w, h); + SDL_GetWindowSizeInPixels(renderer->window, w, h); return 0; } return SDL_SetError("Software renderer doesn't have an output surface"); } -static int -SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { int bpp; Uint32 Rmask, Gmask, Bmask, Amask; - if (!SDL_PixelFormatEnumToMasks - (texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + if (!SDL_PixelFormatEnumToMasks(texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { return SDL_SetError("Unknown texture format"); } @@ -133,78 +127,73 @@ SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } -static int -SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, const void *pixels, int pitch) +static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->driverdata; Uint8 *src, *dst; int row; size_t length; - if(SDL_MUSTLOCK(surface)) + if (SDL_MUSTLOCK(surface)) { SDL_LockSurface(surface); - src = (Uint8 *) pixels; - dst = (Uint8 *) surface->pixels + - rect->y * surface->pitch + - rect->x * surface->format->BytesPerPixel; - length = rect->w * surface->format->BytesPerPixel; + } + src = (Uint8 *)pixels; + dst = (Uint8 *)surface->pixels + + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel; + length = (size_t)rect->w * surface->format->BytesPerPixel; for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, src, length); src += pitch; dst += surface->pitch; } - if(SDL_MUSTLOCK(surface)) + if (SDL_MUSTLOCK(surface)) { SDL_UnlockSurface(surface); + } return 0; } -static int -SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, void **pixels, int *pitch) +static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->driverdata; *pixels = - (void *) ((Uint8 *) surface->pixels + rect->y * surface->pitch + - rect->x * surface->format->BytesPerPixel); + (void *)((Uint8 *)surface->pixels + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel); *pitch = surface->pitch; return 0; } -static void -SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void SW_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { } -static void -SW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void SW_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { } -static int -SW_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) +static int SW_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->driverdata; if (texture) { - data->surface = (SDL_Surface *) texture->driverdata; + data->surface = (SDL_Surface *)texture->driverdata; } else { data->surface = data->window; } return 0; } -static int -SW_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int SW_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - return 0; /* nothing to do in this backend. */ + return 0; /* nothing to do in this backend. */ } -static int -SW_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int SW_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - SDL_Point *verts = (SDL_Point *) SDL_AllocateRenderVertices(renderer, count * sizeof (SDL_Point), 0, &cmd->data.draw.first); + SDL_Point *verts = (SDL_Point *)SDL_AllocateRenderVertices(renderer, count * sizeof(SDL_Point), 0, &cmd->data.draw.first); int i; if (!verts) { @@ -221,10 +210,9 @@ SW_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FP return 0; } -static int -SW_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count) +static int SW_QueueFillRects(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FRect *rects, int count) { - SDL_Rect *verts = (SDL_Rect *) SDL_AllocateRenderVertices(renderer, count * sizeof (SDL_Rect), 0, &cmd->data.draw.first); + SDL_Rect *verts = (SDL_Rect *)SDL_AllocateRenderVertices(renderer, count * sizeof(SDL_Rect), 0, &cmd->data.draw.first); int i; if (!verts) { @@ -243,11 +231,10 @@ SW_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRe return 0; } -static int -SW_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect) +static int SW_QueueCopy(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect) { - SDL_Rect *verts = (SDL_Rect *) SDL_AllocateRenderVertices(renderer, 2 * sizeof (SDL_Rect), 0, &cmd->data.draw.first); + SDL_Rect *verts = (SDL_Rect *)SDL_AllocateRenderVertices(renderer, 2 * sizeof(SDL_Rect), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -277,12 +264,11 @@ typedef struct CopyExData float scale_y; } CopyExData; -static int -SW_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_FRect * dstrect, - const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) +static int SW_QueueCopyEx(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_FRect *dstrect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) { - CopyExData *verts = (CopyExData *) SDL_AllocateRenderVertices(renderer, sizeof (CopyExData), 0, &cmd->data.draw.first); + CopyExData *verts = (CopyExData *)SDL_AllocateRenderVertices(renderer, sizeof(CopyExData), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -305,18 +291,17 @@ SW_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * te return 0; } -static int -Blit_to_Screen(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *surface, SDL_Rect *dstrect, - float scale_x, float scale_y, SDL_ScaleMode scaleMode) +static int Blit_to_Screen(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *surface, SDL_Rect *dstrect, + float scale_x, float scale_y, SDL_ScaleMode scaleMode) { int retval; /* Renderer scaling, if needed */ if (scale_x != 1.0f || scale_y != 1.0f) { SDL_Rect r; - r.x = (int)((float) dstrect->x * scale_x); - r.y = (int)((float) dstrect->y * scale_y); - r.w = (int)((float) dstrect->w * scale_x); - r.h = (int)((float) dstrect->h * scale_y); + r.x = (int)((float)dstrect->x * scale_x); + r.y = (int)((float)dstrect->y * scale_y); + r.w = (int)((float)dstrect->w * scale_x); + r.h = (int)((float)dstrect->h * scale_y); retval = SDL_PrivateUpperBlitScaled(src, srcrect, surface, &r, scaleMode); } else { retval = SDL_BlitSurface(src, srcrect, surface, dstrect); @@ -324,12 +309,11 @@ Blit_to_Screen(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *surface, SDL_Re return retval; } -static int -SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * final_rect, - const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip, float scale_x, float scale_y) +static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Texture *texture, + const SDL_Rect *srcrect, const SDL_Rect *final_rect, + const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip, float scale_x, float scale_y) { - SDL_Surface *src = (SDL_Surface *) texture->driverdata; + SDL_Surface *src = (SDL_Surface *)texture->driverdata; SDL_Rect tmp_rect; SDL_Surface *src_clone, *src_rotated, *src_scaled; SDL_Surface *mask = NULL, *mask_rotated = NULL; @@ -362,7 +346,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex src_clone = SDL_CreateRGBSurfaceFrom(src->pixels, src->w, src->h, src->format->BitsPerPixel, src->pitch, src->format->Rmask, src->format->Gmask, src->format->Bmask, src->format->Amask); - if (src_clone == NULL) { + if (!src_clone) { if (SDL_MUSTLOCK(src)) { SDL_UnlockSurface(src); } @@ -406,7 +390,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex if (blendmode == SDL_BLENDMODE_NONE && !isOpaque) { mask = SDL_CreateRGBSurface(0, final_rect->w, final_rect->h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); - if (mask == NULL) { + if (!mask) { retval = -1; } else { SDL_SetSurfaceBlendMode(mask, SDL_BLENDMODE_MOD); @@ -420,7 +404,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex SDL_Rect scale_rect = tmp_rect; src_scaled = SDL_CreateRGBSurface(0, final_rect->w, final_rect->h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); - if (src_scaled == NULL) { + if (!src_scaled) { retval = -1; } else { SDL_SetSurfaceBlendMode(src_clone, SDL_BLENDMODE_NONE); @@ -439,19 +423,19 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex double cangle, sangle; SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, angle, center, - &rect_dest, &cangle, &sangle); + &rect_dest, &cangle, &sangle); src_rotated = SDLgfx_rotateSurface(src_clone, angle, - (texture->scaleMode == SDL_ScaleModeNearest) ? 0 : 1, flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, - &rect_dest, cangle, sangle, center); - if (src_rotated == NULL) { + (texture->scaleMode == SDL_ScaleModeNearest) ? 0 : 1, flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, + &rect_dest, cangle, sangle, center); + if (!src_rotated) { retval = -1; } - if (!retval && mask != NULL) { + if (!retval && mask) { /* The mask needed for the NONE blend mode gets rotated with the same parameters. */ mask_rotated = SDLgfx_rotateSurface(mask, angle, - SDL_FALSE, 0, 0, - &rect_dest, cangle, sangle, center); - if (mask_rotated == NULL) { + SDL_FALSE, 0, 0, + &rect_dest, cangle, sangle, center); + if (!mask_rotated) { retval = -1; } } @@ -503,7 +487,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex src_rotated->format->BitsPerPixel, src_rotated->pitch, src_rotated->format->Rmask, src_rotated->format->Gmask, src_rotated->format->Bmask, 0); - if (src_rotated_rgb == NULL) { + if (!src_rotated_rgb) { retval = -1; } else { SDL_SetSurfaceBlendMode(src_rotated_rgb, SDL_BLENDMODE_ADD); @@ -515,7 +499,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex } SDL_FreeSurface(mask_rotated); } - if (src_rotated != NULL) { + if (src_rotated) { SDL_FreeSurface(src_rotated); } } @@ -524,16 +508,15 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex if (SDL_MUSTLOCK(src)) { SDL_UnlockSurface(src); } - if (mask != NULL) { + if (mask) { SDL_FreeSurface(mask); } - if (src_clone != NULL) { + if (src_clone) { SDL_FreeSurface(src_clone); } return retval; } - typedef struct GeometryFillData { SDL_Point dst; @@ -547,18 +530,17 @@ typedef struct GeometryCopyData SDL_Color color; } GeometryCopyData; -static int -SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { int i; int count = indices ? num_indices : num_vertices; void *verts; - int sz = texture ? sizeof (GeometryCopyData) : sizeof (GeometryFillData); + size_t sz = texture ? sizeof(GeometryCopyData) : sizeof(GeometryFillData); - verts = (void *) SDL_AllocateRenderVertices(renderer, count * sz, 0, &cmd->data.draw.first); + verts = SDL_AllocateRenderVertices(renderer, count * sz, 0, &cmd->data.draw.first); if (!verts) { return -1; } @@ -567,7 +549,7 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te size_indices = indices ? size_indices : 0; if (texture) { - GeometryCopyData *ptr = (GeometryCopyData *) verts; + GeometryCopyData *ptr = (GeometryCopyData *)verts; for (i = 0; i < count; i++) { int j; float *xy_; @@ -583,10 +565,10 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); - uv_ = (float *)((char*)uv + j * uv_stride); + uv_ = (float *)((char *)uv + j * uv_stride); ptr->src.x = (int)(uv_[0] * texture->w); ptr->src.y = (int)(uv_[1] * texture->h); @@ -598,9 +580,9 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te ptr->color = col_; ptr++; - } + } } else { - GeometryFillData *ptr = (GeometryFillData *) verts; + GeometryFillData *ptr = (GeometryFillData *)verts; for (i = 0; i < count; i++) { int j; @@ -616,8 +598,8 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); ptr->dst.x = (int)(xy_[0] * scale_x); ptr->dst.y = (int)(xy_[1] * scale_y); @@ -626,13 +608,12 @@ SW_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *te ptr->color = col_; ptr++; - } + } } return 0; } -static void -PrepTextureForCopy(const SDL_RenderCommand *cmd) +static void PrepTextureForCopy(const SDL_RenderCommand *cmd) { const Uint8 r = cmd->data.draw.r; const Uint8 g = cmd->data.draw.g; @@ -640,7 +621,7 @@ PrepTextureForCopy(const SDL_RenderCommand *cmd) const Uint8 a = cmd->data.draw.a; const SDL_BlendMode blend = cmd->data.draw.blend; SDL_Texture *texture = cmd->data.draw.texture; - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->driverdata; const SDL_bool colormod = ((r & g & b) != 0xFF); const SDL_bool alphamod = (a != 0xFF); const SDL_bool blending = ((blend == SDL_BLENDMODE_ADD) || (blend == SDL_BLENDMODE_MOD) || (blend == SDL_BLENDMODE_MUL)); @@ -655,15 +636,14 @@ PrepTextureForCopy(const SDL_RenderCommand *cmd) SDL_SetSurfaceBlendMode(surface, blend); } -static void -SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate) +static void SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate) { if (drawstate->surface_cliprect_dirty) { const SDL_Rect *viewport = drawstate->viewport; const SDL_Rect *cliprect = drawstate->cliprect; - SDL_assert(viewport != NULL); /* the higher level should have forced a SDL_RENDERCMD_SETVIEWPORT */ + SDL_assert_release(viewport != NULL); /* the higher level should have forced a SDL_RENDERCMD_SETVIEWPORT */ - if (cliprect != NULL) { + if (cliprect) { SDL_Rect clip_rect; clip_rect.x = cliprect->x + viewport->x; clip_rect.y = cliprect->y + viewport->y; @@ -678,8 +658,7 @@ SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate) } } -static int -SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { SDL_Surface *surface = SW_ActivateRenderer(renderer); SW_DrawStateCache drawstate; @@ -733,7 +712,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -760,7 +739,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -787,7 +766,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic SetDrawState(surface, &drawstate); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { int i; for (i = 0; i < count; i++) { verts[i].x += drawstate.viewport->x; @@ -815,7 +794,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { dstrect->x += drawstate.viewport->x; dstrect->y += drawstate.viewport->y; } @@ -873,7 +852,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { copydata->dstrect.x += drawstate.viewport->x; copydata->dstrect.y += drawstate.viewport->y; } @@ -901,7 +880,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic PrepTextureForCopy(cmd); /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { SDL_Point vp; vp.x = drawstate.viewport->x; vp.y = drawstate.viewport->y; @@ -924,7 +903,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic GeometryFillData *ptr = (GeometryFillData *) verts; /* Apply viewport */ - if (drawstate.viewport != NULL && (drawstate.viewport->x || drawstate.viewport->y)) { + if (drawstate.viewport && (drawstate.viewport->x || drawstate.viewport->y)) { SDL_Point vp; vp.x = drawstate.viewport->x; vp.y = drawstate.viewport->y; @@ -952,9 +931,8 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic return 0; } -static int -SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, - Uint32 format, void * pixels, int pitch) +static int SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 format, void *pixels, int pitch) { SDL_Surface *surface = SW_ActivateRenderer(renderer); Uint32 src_format; @@ -968,23 +946,22 @@ SW_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, * SDL_RenderReadPixels. */ - if (rect->x < 0 || rect->x+rect->w > surface->w || - rect->y < 0 || rect->y+rect->h > surface->h) { + if (rect->x < 0 || rect->x + rect->w > surface->w || + rect->y < 0 || rect->y + rect->h > surface->h) { return SDL_SetError("Tried to read outside of surface bounds"); } src_format = surface->format->format; - src_pixels = (void*)((Uint8 *) surface->pixels + - rect->y * surface->pitch + - rect->x * surface->format->BytesPerPixel); + src_pixels = (void *)((Uint8 *)surface->pixels + + rect->y * surface->pitch + + rect->x * surface->format->BytesPerPixel); return SDL_ConvertPixels(rect->w, rect->h, src_format, src_pixels, surface->pitch, format, pixels, pitch); } -static int -SW_RenderPresent(SDL_Renderer * renderer) +static int SW_RenderPresent(SDL_Renderer *renderer) { SDL_Window *window = renderer->window; @@ -994,45 +971,36 @@ SW_RenderPresent(SDL_Renderer * renderer) return SDL_UpdateWindowSurface(window); } -static void -SW_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->driverdata; SDL_FreeSurface(surface); } -static void -SW_DestroyRenderer(SDL_Renderer * renderer) +static void SW_DestroyRenderer(SDL_Renderer *renderer) { - SW_RenderData *data = (SW_RenderData *) renderer->driverdata; + SDL_Window *window = renderer->window; + SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + if (window) { + SDL_DestroyWindowSurface(window); + } SDL_free(data); - SDL_free(renderer); } -SDL_Renderer * -SW_CreateRendererForSurface(SDL_Surface * surface) +int SW_CreateRendererForSurface(SDL_Renderer *renderer, SDL_Surface *surface) { - SDL_Renderer *renderer; SW_RenderData *data; if (!surface) { - SDL_InvalidParamError("surface"); - return NULL; - } - - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; + return SDL_InvalidParamError("surface"); } - data = (SW_RenderData *) SDL_calloc(1, sizeof(*data)); + data = (SW_RenderData *)SDL_calloc(1, sizeof(*data)); if (!data) { SW_DestroyRenderer(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } data->surface = surface; data->window = surface; @@ -1046,9 +1014,9 @@ SW_CreateRendererForSurface(SDL_Surface * surface) renderer->SetTextureScaleMode = SW_SetTextureScaleMode; renderer->SetRenderTarget = SW_SetRenderTarget; renderer->QueueSetViewport = SW_QueueSetViewport; - renderer->QueueSetDrawColor = SW_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ + renderer->QueueSetDrawColor = SW_QueueSetViewport; /* SetViewport and SetDrawColor are (currently) no-ops. */ renderer->QueueDrawPoints = SW_QueueDrawPoints; - renderer->QueueDrawLines = SW_QueueDrawPoints; /* lines and points queue vertices the same way. */ + renderer->QueueDrawLines = SW_QueueDrawPoints; /* lines and points queue vertices the same way. */ renderer->QueueFillRects = SW_QueueFillRects; renderer->QueueCopy = SW_QueueCopy; renderer->QueueCopyEx = SW_QueueCopyEx; @@ -1061,13 +1029,10 @@ SW_CreateRendererForSurface(SDL_Surface * surface) renderer->info = SW_RenderDriver.info; renderer->driverdata = data; - SW_ActivateRenderer(renderer); - - return renderer; + return 0; } -static SDL_Renderer * -SW_CreateRenderer(SDL_Window * window, Uint32 flags) +static int SW_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { const char *hint; SDL_Surface *surface; @@ -1093,9 +1058,9 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags) } if (!surface) { - return NULL; + return -1; } - return SW_CreateRendererForSurface(surface); + return SW_CreateRendererForSurface(renderer, surface); } SDL_RenderDriver SW_RenderDriver = { @@ -1118,6 +1083,6 @@ SDL_RenderDriver SW_RenderDriver = { 0} }; -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_render_sw_c.h b/src/render/software/SDL_render_sw_c.h index 4962ea6c0bead..d59a85fdb9e7a 100644 --- a/src/render/software/SDL_render_sw_c.h +++ b/src/render/software/SDL_render_sw_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_render_sw_c_h_ #define SDL_render_sw_c_h_ -extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface); +extern int SW_CreateRendererForSurface(SDL_Renderer *renderer, SDL_Surface *surface); #endif /* SDL_render_sw_c_h_ */ diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index ade0872656f82..d29b92d68b196 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -30,7 +30,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW #if defined(__WIN32__) || defined(__GDK__) #include "../../core/windows/SDL_windows.h" @@ -47,7 +47,8 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net /* ! \brief A 32 bit RGBA pixel. */ -typedef struct tColorRGBA { +typedef struct tColorRGBA +{ Uint8 r; Uint8 g; Uint8 b; @@ -57,7 +58,8 @@ typedef struct tColorRGBA { /* ! \brief A 8bit Y/palette pixel. */ -typedef struct tColorY { +typedef struct tColorY +{ Uint8 y; } tColorY; @@ -76,8 +78,7 @@ to a situation where the program can segfault. /* ! \brief Returns colorkey info for a surface */ -static Uint32 -get_colorkey(SDL_Surface *src) +static Uint32 get_colorkey(SDL_Surface *src) { Uint32 key = 0; if (SDL_HasColorKey(src)) { @@ -87,8 +88,8 @@ get_colorkey(SDL_Surface *src) } /* rotate (sx, sy) by (angle, center) into (dx, dy) */ -static void -rotate(double sx, double sy, double sinangle, double cosangle, const SDL_FPoint *center, double *dx, double *dy) { +static void rotate(double sx, double sy, double sinangle, double cosangle, const SDL_FPoint *center, double *dx, double *dy) +{ sx -= center->x; sy -= center->y; @@ -111,9 +112,8 @@ rotate(double sx, double sy, double sinangle, double cosangle, const SDL_FPoint \param sangle The cosine of the angle */ -void -SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FPoint *center, - SDL_Rect *rect_dest, double *cangle, double *sangle) +void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FPoint *center, + SDL_Rect *rect_dest, double *cangle, double *sangle) { int minx, maxx, miny, maxy; double radangle; @@ -129,16 +129,16 @@ SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FP /* * Determine destination width and height by rotating a source box, at pixel center */ - rotate(0.5, 0.5, sinangle, cosangle, center, &x0, &y0); - rotate(width - 0.5, 0.5, sinangle, cosangle, center, &x1, &y1); - rotate(0.5, height - 0.5, sinangle, cosangle, center, &x2, &y2); + rotate(0.5, 0.5, sinangle, cosangle, center, &x0, &y0); + rotate(width - 0.5, 0.5, sinangle, cosangle, center, &x1, &y1); + rotate(0.5, height - 0.5, sinangle, cosangle, center, &x2, &y2); rotate(width - 0.5, height - 0.5, sinangle, cosangle, center, &x3, &y3); - minx = (int)SDL_floor( SDL_min( SDL_min(x0, x1), SDL_min(x2, x3) ) ); - maxx = (int)SDL_ceil( SDL_max( SDL_max(x0, x1), SDL_max(x2, x3) ) ); + minx = (int)SDL_floor(SDL_min(SDL_min(x0, x1), SDL_min(x2, x3))); + maxx = (int)SDL_ceil(SDL_max(SDL_max(x0, x1), SDL_max(x2, x3))); - miny = (int)SDL_floor( SDL_min( SDL_min(y0, y1), SDL_min(y2, y3) ) ); - maxy = (int)SDL_ceil( SDL_max( SDL_max(y0, y1), SDL_max(y2, y3) ) ); + miny = (int)SDL_floor(SDL_min(SDL_min(y0, y1), SDL_min(y2, y3))); + maxy = (int)SDL_ceil(SDL_max(SDL_max(y0, y1), SDL_max(y2, y3))); rect_dest->w = maxx - minx; rect_dest->h = maxy - miny; @@ -151,17 +151,20 @@ SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FP { /* The trig code below gets the wrong size (due to FP inaccuracy?) when angle is a multiple of 90 degrees */ - int angle90 = (int)(angle/90); - if(angle90 == angle/90) { /* if the angle is a multiple of 90 degrees */ + int angle90 = (int)(angle / 90); + if (angle90 == angle / 90) { /* if the angle is a multiple of 90 degrees */ angle90 %= 4; - if(angle90 < 0) angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */ - if(angle90 & 1) { - rect_dest->w = height; + if (angle90 < 0) { + angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */ + } + + if (angle90 & 1) { + rect_dest->w = height; rect_dest->h = width; *cangle = 0; *sangle = angle90 == 1 ? -1 : 1; /* reversed because our rotations are clockwise */ } else { - rect_dest->w = width; + rect_dest->w = width; rect_dest->h = height; *cangle = angle90 == 0 ? 1 : -1; *sangle = 0; @@ -171,19 +174,37 @@ SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FP } /* Computes source pointer X/Y increments for a rotation that's a multiple of 90 degrees. */ -static void -computeSourceIncrements90(SDL_Surface * src, int bpp, int angle, int flipx, int flipy, - int *sincx, int *sincy, int *signx, int *signy) +static void computeSourceIncrements90(SDL_Surface *src, int bpp, int angle, int flipx, int flipy, + int *sincx, int *sincy, int *signx, int *signy) { int pitch = flipy ? -src->pitch : src->pitch; if (flipx) { bpp = -bpp; } switch (angle) { /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */ - case 0: *sincx = bpp; *sincy = pitch - src->w * *sincx; *signx = *signy = 1; break; - case 1: *sincx = -pitch; *sincy = bpp - *sincx * src->h; *signx = 1; *signy = -1; break; - case 2: *sincx = -bpp; *sincy = -src->w * *sincx - pitch; *signx = *signy = -1; break; - case 3: default: *sincx = pitch; *sincy = -*sincx * src->h - bpp; *signx = -1; *signy = 1; break; + case 0: + *sincx = bpp; + *sincy = pitch - src->w * *sincx; + *signx = *signy = 1; + break; + case 1: + *sincx = -pitch; + *sincy = bpp - *sincx * src->h; + *signx = 1; + *signy = -1; + break; + case 2: + *sincx = -bpp; + *sincy = -src->w * *sincx - pitch; + *signx = *signy = -1; + break; + case 3: + default: + *sincx = pitch; + *sincy = -*sincx * src->h - bpp; + *signx = -1; + *signy = 1; + break; } if (flipx) { *signx = -*signx; @@ -194,34 +215,34 @@ computeSourceIncrements90(SDL_Surface * src, int bpp, int angle, int flipx, int } /* Performs a relatively fast rotation/flip when the angle is a multiple of 90 degrees. */ -#define TRANSFORM_SURFACE_90(pixelType) \ - int dy, dincy = dst->pitch - dst->w*sizeof(pixelType), sincx, sincy, signx, signy; \ - Uint8 *sp = (Uint8*)src->pixels, *dp = (Uint8*)dst->pixels, *de; \ +#define TRANSFORM_SURFACE_90(pixelType) \ + int dy, dincy = dst->pitch - dst->w * sizeof(pixelType), sincx, sincy, signx, signy; \ + Uint8 *sp = (Uint8 *)src->pixels, *dp = (Uint8 *)dst->pixels, *de; \ \ computeSourceIncrements90(src, sizeof(pixelType), angle, flipx, flipy, &sincx, &sincy, &signx, &signy); \ - if (signx < 0) sp += (src->w-1)*sizeof(pixelType); \ - if (signy < 0) sp += (src->h-1)*src->pitch; \ + if (signx < 0) \ + sp += (src->w - 1) * sizeof(pixelType); \ + if (signy < 0) \ + sp += (src->h - 1) * src->pitch; \ \ for (dy = 0; dy < dst->h; sp += sincy, dp += dincy, dy++) { \ if (sincx == sizeof(pixelType)) { /* if advancing src and dest equally, use SDL_memcpy */ \ - SDL_memcpy(dp, sp, dst->w*sizeof(pixelType)); \ - sp += dst->w*sizeof(pixelType); \ - dp += dst->w*sizeof(pixelType); \ + SDL_memcpy(dp, sp, dst->w * sizeof(pixelType)); \ + sp += dst->w * sizeof(pixelType); \ + dp += dst->w * sizeof(pixelType); \ } else { \ - for (de = dp + dst->w*sizeof(pixelType); dp != de; sp += sincx, dp += sizeof(pixelType)) { \ - *(pixelType*)dp = *(pixelType*)sp; \ + for (de = dp + dst->w * sizeof(pixelType); dp != de; sp += sincx, dp += sizeof(pixelType)) { \ + *(pixelType *)dp = *(pixelType *)sp; \ } \ } \ } -static void -transformSurfaceRGBA90(SDL_Surface * src, SDL_Surface * dst, int angle, int flipx, int flipy) +static void transformSurfaceRGBA90(SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy) { TRANSFORM_SURFACE_90(tColorRGBA); } -static void -transformSurfaceY90(SDL_Surface * src, SDL_Surface * dst, int angle, int flipx, int flipy) +static void transformSurfaceY90(SDL_Surface *src, SDL_Surface *dst, int angle, int flipx, int flipy) { TRANSFORM_SURFACE_90(tColorY); } @@ -247,32 +268,31 @@ Assumes dst surface was allocated with the correct dimensions. \param dst_rect destination coordinates \param center true center. */ -static void -transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, - int flipx, int flipy, int smooth, - const SDL_Rect *rect_dest, - const SDL_FPoint *center) +static void transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int isin, int icos, + int flipx, int flipy, int smooth, + const SDL_Rect *rect_dest, + const SDL_FPoint *center) { int sw, sh; int cx, cy; tColorRGBA c00, c01, c10, c11, cswap; tColorRGBA *pc, *sp; int gap; - const int fp_half = (1<<15); + const int fp_half = (1 << 15); /* - * Variable setup - */ + * Variable setup + */ sw = src->w - 1; sh = src->h - 1; - pc = (tColorRGBA*) dst->pixels; + pc = (tColorRGBA *)dst->pixels; gap = dst->pitch - dst->w * 4; cx = (int)(center->x * 65536.0); cy = (int)(center->y * 65536.0); /* - * Switch between interpolating and non-interpolating code - */ + * Switch between interpolating and non-interpolating code + */ if (smooth) { int y; for (y = 0; y < dst->h; y++) { @@ -284,30 +304,42 @@ transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, for (x = 0; x < dst->w; x++) { int dx = (sdx >> 16); int dy = (sdy >> 16); - if (flipx) dx = sw - dx; - if (flipy) dy = sh - dy; - if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) { + if (flipx) { + dx = sw - dx; + } + if (flipy) { + dy = sh - dy; + } + if ((dx > -1) && (dy > -1) && (dx < (src->w - 1)) && (dy < (src->h - 1))) { int ex, ey; int t1, t2; - sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy) + dx; + sp = (tColorRGBA *)((Uint8 *)src->pixels + src->pitch * dy) + dx; c00 = *sp; sp += 1; c01 = *sp; - sp += (src->pitch/4); + sp += (src->pitch / 4); c11 = *sp; sp -= 1; c10 = *sp; if (flipx) { - cswap = c00; c00=c01; c01=cswap; - cswap = c10; c10=c11; c11=cswap; + cswap = c00; + c00 = c01; + c01 = cswap; + cswap = c10; + c10 = c11; + c11 = cswap; } if (flipy) { - cswap = c00; c00=c10; c10=cswap; - cswap = c01; c01=c11; c11=cswap; + cswap = c00; + c00 = c10; + c10 = cswap; + cswap = c01; + c01 = c11; + c11 = cswap; } /* - * Interpolate colors - */ + * Interpolate colors + */ ex = (sdx & 0xffff); ey = (sdy & 0xffff); t1 = ((((c01.r - c00.r) * ex) >> 16) + c00.r) & 0xff; @@ -327,7 +359,7 @@ transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, sdy += isin; pc++; } - pc = (tColorRGBA *) ((Uint8 *) pc + gap); + pc = (tColorRGBA *)((Uint8 *)pc + gap); } } else { int y; @@ -341,15 +373,19 @@ transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, int dx = (sdx >> 16); int dy = (sdy >> 16); if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) { - if(flipx) dx = sw - dx; - if(flipy) dy = sh - dy; + if (flipx) { + dx = sw - dx; + } + if (flipy) { + dy = sh - dy; + } *pc = *((tColorRGBA *)((Uint8 *)src->pixels + src->pitch * dy) + dx); } sdx += icos; sdy += isin; pc++; } - pc = (tColorRGBA *) ((Uint8 *) pc + gap); + pc = (tColorRGBA *)((Uint8 *)pc + gap); } } } @@ -372,35 +408,34 @@ Assumes dst surface was allocated with the correct dimensions. \param dst_rect destination coordinates \param center true center. */ -static void -transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, int flipx, int flipy, - const SDL_Rect *rect_dest, - const SDL_FPoint *center) +static void transformSurfaceY(SDL_Surface *src, SDL_Surface *dst, int isin, int icos, int flipx, int flipy, + const SDL_Rect *rect_dest, + const SDL_FPoint *center) { int sw, sh; int cx, cy; tColorY *pc; int gap; - const int fp_half = (1<<15); + const int fp_half = (1 << 15); int y; /* - * Variable setup - */ + * Variable setup + */ sw = src->w - 1; sh = src->h - 1; - pc = (tColorY*) dst->pixels; + pc = (tColorY *)dst->pixels; gap = dst->pitch - dst->w; cx = (int)(center->x * 65536.0); cy = (int)(center->y * 65536.0); /* - * Clear surface to colorkey - */ - SDL_memset(pc, (int)(get_colorkey(src) & 0xff), dst->pitch * dst->h); + * Clear surface to colorkey + */ + SDL_memset(pc, (int)(get_colorkey(src) & 0xff), (size_t)dst->pitch * dst->h); /* - * Iterate through destination surface - */ + * Iterate through destination surface + */ for (y = 0; y < dst->h; y++) { int x; double src_x = (rect_dest->x + 0 + 0.5 - center->x); @@ -411,8 +446,12 @@ transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, int int dx = (sdx >> 16); int dy = (sdy >> 16); if ((unsigned)dx < (unsigned)src->w && (unsigned)dy < (unsigned)src->h) { - if (flipx) dx = sw - dx; - if (flipy) dy = sh- dy; + if (flipx) { + dx = sw - dx; + } + if (flipy) { + dy = sh - dy; + } *pc = *((tColorY *)src->pixels + src->pitch * dy + dx); } sdx += icos; @@ -423,7 +462,6 @@ transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int isin, int icos, int } } - /* ! \brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. @@ -450,9 +488,8 @@ When using the NONE and MOD modes, color and alpha modulation must be applied be */ -SDL_Surface * -SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int flipy, - const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center) +SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy, + const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center) { SDL_Surface *rz_dst; int is8bit, angle90; @@ -463,8 +500,9 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int double sangleinv, cangleinv; /* Sanity check */ - if (src == NULL) + if (!src) { return NULL; + } if (SDL_HasColorKey(src)) { if (SDL_GetColorKey(src, &colorkey) == 0) { @@ -473,19 +511,20 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int } /* This function requires a 32-bit surface or 8-bit surface with a colorkey */ is8bit = src->format->BitsPerPixel == 8 && colorKeyAvailable; - if (!(is8bit || (src->format->BitsPerPixel == 32 && src->format->Amask))) + if (!(is8bit || (src->format->BitsPerPixel == 32 && src->format->Amask))) { return NULL; + } /* Calculate target factors from sine/cosine and zoom */ - sangleinv = sangle*65536.0; - cangleinv = cangle*65536.0; + sangleinv = sangle * 65536.0; + cangleinv = cangle * 65536.0; /* Alloc space to completely contain the rotated surface */ rz_dst = NULL; if (is8bit) { /* Target surface is 8 bit */ rz_dst = SDL_CreateRGBSurfaceWithFormat(0, rect_dest->w, rect_dest->h + GUARD_ROWS, 8, src->format->format); - if (rz_dst != NULL) { + if (rz_dst) { if (src->format->palette) { for (i = 0; i < src->format->palette->ncolors; i++) { rz_dst->format->palette->colors[i] = src->format->palette->colors[i]; @@ -501,8 +540,9 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int } /* Check target */ - if (rz_dst == NULL) + if (!rz_dst) { return NULL; + } /* Adjust for guard rows */ rz_dst->h = rect_dest->h; @@ -539,17 +579,20 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int * the off-by-one problem in transformSurfaceRGBA that expresses itself when the rotation is near * multiples of 90 degrees. */ - angle90 = (int)(angle/90); - if (angle90 == angle/90) { + angle90 = (int)(angle / 90); + if (angle90 == angle / 90) { angle90 %= 4; - if (angle90 < 0) angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */ + if (angle90 < 0) { + angle90 += 4; /* 0:0 deg, 1:90 deg, 2:180 deg, 3:270 deg */ + } + } else { angle90 = -1; } if (is8bit) { /* Call the 8-bit transformation routine to do the rotation */ - if(angle90 >= 0) { + if (angle90 >= 0) { transformSurfaceY90(src, rz_dst, angle90, flipx, flipy); } else { transformSurfaceY(src, rz_dst, (int)sangleinv, (int)cangleinv, @@ -561,7 +604,7 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int transformSurfaceRGBA90(src, rz_dst, angle90, flipx, flipy); } else { transformSurfaceRGBA(src, rz_dst, (int)sangleinv, (int)cangleinv, - flipx, flipy, smooth, rect_dest, center); + flipx, flipy, smooth, rect_dest, center); } } @@ -574,4 +617,4 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int return rz_dst; } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ diff --git a/src/render/software/SDL_rotate.h b/src/render/software/SDL_rotate.h index 8d7ec9d285fb3..256853137a693 100644 --- a/src/render/software/SDL_rotate.h +++ b/src/render/software/SDL_rotate.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,9 +22,9 @@ #ifndef SDL_rotate_h_ #define SDL_rotate_h_ -extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int flipy, - const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center); +extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy, + const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center); extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FPoint *center, - SDL_Rect *rect_dest, double *cangle, double *sangle); + SDL_Rect *rect_dest, double *cangle, double *sangle); #endif /* SDL_rotate_h_ */ diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index f70c079338407..db8aaf5d99702 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,9 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED +#if SDL_VIDEO_RENDER_SW + +#include #include "SDL_surface.h" #include "SDL_triangle.h" @@ -33,16 +35,15 @@ * But, if increased too much, it overflows (srcx, srcy) coordinates used for filling with texture. * (which could be turned to int64). */ -#define FP_BITS 1 - +#define FP_BITS 1 -#define COLOR_EQ(c1, c2) ((c1).r == (c2).r && (c1).g == (c2).g && (c1).b == (c2).b && (c1).a == (c2).a) +#define COLOR_EQ(c1, c2) ((c1).r == (c2).r && (c1).g == (c2).g && (c1).b == (c2).b && (c1).a == (c2).a) -static void SDL_BlitTriangle_Slow(SDL_BlitInfo * info, - SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, - int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, - int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, - SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform); +static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info, + SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, + int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, + int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, + SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform); #if 0 int SDL_BlitTriangle(SDL_Surface *src, const SDL_Point srcpoints[3], SDL_Surface *dst, const SDL_Point dstpoints[3]) @@ -88,9 +89,9 @@ int SDL_FillTriangle(SDL_Surface *dst, const SDL_Point points[3], Uint32 color) #endif /* cross product AB x AC */ -static int cross_product(const SDL_Point *a, const SDL_Point *b, int c_x, int c_y) +static Sint64 cross_product(const SDL_Point *a, const SDL_Point *b, int c_x, int c_y) { - return (b->x - a->x) * (c_y - a->y) - (b->y - a->y) * (c_x - a->x); + return ((Sint64)(b->x - a->x)) * ((Sint64)(c_y - a->y)) - ((Sint64)(b->y - a->y)) * ((Sint64)(c_x - a->x)); } /* check for top left rules */ @@ -114,9 +115,23 @@ static int is_top_left(const SDL_Point *a, const SDL_Point *b, int is_clockwise) return 0; } -void trianglepoint_2_fixedpoint(SDL_Point *a) { - a->x <<= FP_BITS; - a->y <<= FP_BITS; +/* x = (y << FP_BITS) */ +/* prevent runtime error: left shift of negative value */ +#define PRECOMP(x, y) \ + val = y; \ + if (val >= 0) { \ + x = val << FP_BITS; \ + } else { \ + val *= -1; \ + x = val << FP_BITS; \ + x *= -1; \ + } + +void trianglepoint_2_fixedpoint(SDL_Point *a) +{ + int val; + PRECOMP(a->x, a->x); + PRECOMP(a->y, a->y); } /* bounding rect of three points (in fixed point) */ @@ -146,7 +161,6 @@ static void bounding_rect(const SDL_Point *a, const SDL_Point *b, const SDL_Poin r->h = (max_y - min_y); } - /* Triangle rendering, using Barycentric coordinates (w0, w1, w2) * * The cross product isn't computed from scratch at each iteration, @@ -154,53 +168,51 @@ static void bounding_rect(const SDL_Point *a, const SDL_Point *b, const SDL_Poin * */ -#define TRIANGLE_BEGIN_LOOP \ - { \ - int x, y; \ - for (y = 0; y < dstrect.h; y++) { \ - /* y start */ \ - int w0 = w0_row; \ - int w1 = w1_row; \ - int w2 = w2_row; \ - for (x = 0; x < dstrect.w; x++) { \ - /* In triangle */ \ - if (w0 + bias_w0 >= 0 && w1 + bias_w1 >= 0 && w2 + bias_w2 >= 0) { \ - Uint8 *dptr = (Uint8 *) dst_ptr + x * dstbpp; \ - +#define TRIANGLE_BEGIN_LOOP \ + { \ + int x, y; \ + for (y = 0; y < dstrect.h; y++) { \ + /* y start */ \ + Sint64 w0 = w0_row; \ + Sint64 w1 = w1_row; \ + Sint64 w2 = w2_row; \ + for (x = 0; x < dstrect.w; x++) { \ + /* In triangle */ \ + if (w0 + bias_w0 >= 0 && w1 + bias_w1 >= 0 && w2 + bias_w2 >= 0) { \ + Uint8 *dptr = (Uint8 *)dst_ptr + x * dstbpp; /* Use 64 bits precision to prevent overflow when interpolating color / texture with wide triangles */ -#define TRIANGLE_GET_TEXTCOORD \ - int srcx = (int)(((Sint64)w0 * s2s0_x + (Sint64)w1 * s2s1_x + s2_x_area.x) / area); \ - int srcy = (int)(((Sint64)w0 * s2s0_y + (Sint64)w1 * s2s1_y + s2_x_area.y) / area); \ - -#define TRIANGLE_GET_MAPPED_COLOR \ - int r = (int)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ - int g = (int)(((Sint64)w0 * c0.g + (Sint64)w1 * c1.g + (Sint64)w2 * c2.g) / area); \ - int b = (int)(((Sint64)w0 * c0.b + (Sint64)w1 * c1.b + (Sint64)w2 * c2.b) / area); \ - int a = (int)(((Sint64)w0 * c0.a + (Sint64)w1 * c1.a + (Sint64)w2 * c2.a) / area); \ - int color = SDL_MapRGBA(format, r, g, b, a); \ - -#define TRIANGLE_GET_COLOR \ - int r = (int)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ - int g = (int)(((Sint64)w0 * c0.g + (Sint64)w1 * c1.g + (Sint64)w2 * c2.g) / area); \ - int b = (int)(((Sint64)w0 * c0.b + (Sint64)w1 * c1.b + (Sint64)w2 * c2.b) / area); \ - int a = (int)(((Sint64)w0 * c0.a + (Sint64)w1 * c1.a + (Sint64)w2 * c2.a) / area); \ - - -#define TRIANGLE_END_LOOP \ - } \ - /* x += 1 */ \ - w0 += d2d1_y; \ - w1 += d0d2_y; \ - w2 += d1d0_y; \ - } \ - /* y += 1 */ \ - w0_row += d1d2_x; \ - w1_row += d2d0_x; \ - w2_row += d0d1_x; \ - dst_ptr += dst_pitch; \ - } \ - } \ +#define TRIANGLE_GET_TEXTCOORD \ + int srcx = (int)(((Sint64)w0 * s2s0_x + (Sint64)w1 * s2s1_x + s2_x_area.x) / area); \ + int srcy = (int)(((Sint64)w0 * s2s0_y + (Sint64)w1 * s2s1_y + s2_x_area.y) / area); + +#define TRIANGLE_GET_MAPPED_COLOR \ + int r = (int)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ + int g = (int)(((Sint64)w0 * c0.g + (Sint64)w1 * c1.g + (Sint64)w2 * c2.g) / area); \ + int b = (int)(((Sint64)w0 * c0.b + (Sint64)w1 * c1.b + (Sint64)w2 * c2.b) / area); \ + int a = (int)(((Sint64)w0 * c0.a + (Sint64)w1 * c1.a + (Sint64)w2 * c2.a) / area); \ + int color = SDL_MapRGBA(format, r, g, b, a); + +#define TRIANGLE_GET_COLOR \ + int r = (int)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ + int g = (int)(((Sint64)w0 * c0.g + (Sint64)w1 * c1.g + (Sint64)w2 * c2.g) / area); \ + int b = (int)(((Sint64)w0 * c0.b + (Sint64)w1 * c1.b + (Sint64)w2 * c2.b) / area); \ + int a = (int)(((Sint64)w0 * c0.a + (Sint64)w1 * c1.a + (Sint64)w2 * c2.a) / area); + +#define TRIANGLE_END_LOOP \ + } \ + /* x += 1 */ \ + w0 += d2d1_y; \ + w1 += d0d2_y; \ + w2 += d1d0_y; \ + } \ + /* y += 1 */ \ + w0_row += d1d2_x; \ + w1_row += d2d0_x; \ + w2_row += d0d1_x; \ + dst_ptr += dst_pitch; \ + } \ + } int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, SDL_BlendMode blend, SDL_Color c0, SDL_Color c1, SDL_Color c2) { @@ -213,17 +225,18 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin Uint8 *dst_ptr; int dst_pitch; - int area, is_clockwise; + Sint64 area; + int is_clockwise; int d2d1_y, d1d2_x, d0d2_y, d2d0_x, d1d0_y, d0d1_x; - int w0_row, w1_row, w2_row; + Sint64 w0_row, w1_row, w2_row; int bias_w0, bias_w1, bias_w2; int is_uniform; SDL_Surface *tmp = NULL; - if (dst == NULL) { + if (!dst) { return -1; } @@ -265,18 +278,17 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin SDL_IntersectRect(&dstrect, &rect, &dstrect); } - if (blend != SDL_BLENDMODE_NONE) { int format = dst->format->format; /* need an alpha format */ - if (! dst->format->Amask) { + if (!dst->format->Amask) { format = SDL_PIXELFORMAT_ARGB8888; } /* Use an intermediate surface */ tmp = SDL_CreateRGBSurfaceWithFormat(0, dstrect.w, dstrect.h, 0, format); - if (tmp == NULL) { + if (!tmp) { ret = -1; goto end; } @@ -300,14 +312,19 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin } is_clockwise = area > 0; - area = SDL_abs(area); + if (area < 0) { + area = -area; + } - d2d1_y = (d1->y - d2->y) << FP_BITS; - d0d2_y = (d2->y - d0->y) << FP_BITS; - d1d0_y = (d0->y - d1->y) << FP_BITS; - d1d2_x = (d2->x - d1->x) << FP_BITS; - d2d0_x = (d0->x - d2->x) << FP_BITS; - d0d1_x = (d1->x - d0->x) << FP_BITS; + { + int val; + PRECOMP(d2d1_y, d1->y - d2->y) + PRECOMP(d0d2_y, d2->y - d0->y) + PRECOMP(d1d0_y, d0->y - d1->y) + PRECOMP(d1d2_x, d2->x - d1->x) + PRECOMP(d2d0_x, d0->x - d2->x) + PRECOMP(d0d1_x, d1->x - d0->x) + } /* Starting point for rendering, at the middle of a pixel */ { @@ -323,7 +340,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin } /* Handle anti-clockwise triangles */ - if (! is_clockwise) { + if (!is_clockwise) { d2d1_y *= -1; d0d2_y *= -1; d1d0_y *= -1; @@ -343,12 +360,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin if (is_uniform) { Uint32 color; if (tmp) { - if (dst->format->Amask) { - color = SDL_MapRGBA(tmp->format, c0.r, c0.g, c0.b, c0.a); - } else { - //color = SDL_MapRGB(tmp->format, c0.r, c0.g, c0.b); - color = SDL_MapRGBA(tmp->format, c0.r, c0.g, c0.b, c0.a); - } + color = SDL_MapRGBA(tmp->format, c0.r, c0.g, c0.b, c0.a); } else { color = SDL_MapRGBA(dst->format, c0.r, c0.g, c0.b, c0.a); } @@ -362,7 +374,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin } else if (dstbpp == 3) { TRIANGLE_BEGIN_LOOP { - Uint8 *s = (Uint8*)&color; + Uint8 *s = (Uint8 *)&color; dptr[0] = s[0]; dptr[1] = s[1]; dptr[2] = s[2]; @@ -397,7 +409,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin TRIANGLE_BEGIN_LOOP { TRIANGLE_GET_MAPPED_COLOR - Uint8 *s = (Uint8*)&color; + Uint8 *s = (Uint8 *)&color; dptr[0] = s[0]; dptr[1] = s[1]; dptr[2] = s[2]; @@ -433,18 +445,12 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin return ret; } - - - - - - int SDL_SW_BlitTriangle( - SDL_Surface *src, - SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, - SDL_Surface *dst, - SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, - SDL_Color c0, SDL_Color c1, SDL_Color c2) + SDL_Surface *src, + SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, + SDL_Surface *dst, + SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, + SDL_Color c0, SDL_Color c1, SDL_Color c2) { int ret = 0; int src_locked = 0; @@ -463,20 +469,24 @@ int SDL_SW_BlitTriangle( int *src_ptr; int src_pitch; - int area, is_clockwise; + Sint64 area, tmp64; + int is_clockwise; int d2d1_y, d1d2_x, d0d2_y, d2d0_x, d1d0_y, d0d1_x; int s2s0_x, s2s1_x, s2s0_y, s2s1_y; - int w0_row, w1_row, w2_row; + Sint64 w0_row, w1_row, w2_row; int bias_w0, bias_w1, bias_w2; int is_uniform; int has_modulation; - if (src == NULL || dst == NULL) { - return -1; + if (!src) { + return SDL_InvalidParamError("src"); + } + if (!src) { + return SDL_InvalidParamError("dst"); } area = cross_product(d0, d1, d2->x, d2->y); @@ -520,14 +530,26 @@ int SDL_SW_BlitTriangle( maxx = srcrect.x + srcrect.w; maxy = srcrect.y + srcrect.h; if (srcrect.w > 0) { - if (s0->x == maxx) s0->x--; - if (s1->x == maxx) s1->x--; - if (s2->x == maxx) s2->x--; + if (s0->x == maxx) { + s0->x--; + } + if (s1->x == maxx) { + s1->x--; + } + if (s2->x == maxx) { + s2->x--; + } } if (srcrect.h > 0) { - if (s0->y == maxy) s0->y--; - if (s1->y == maxy) s1->y--; - if (s2->y == maxy) s2->y--; + if (s0->y == maxy) { + s0->y--; + } + if (s1->y == maxy) { + s1->y--; + } + if (s2->y == maxy) { + s2->y--; + } } } @@ -566,16 +588,19 @@ int SDL_SW_BlitTriangle( src_pitch = src->pitch; is_clockwise = area > 0; - area = SDL_abs(area); - - d2d1_y = (d1->y - d2->y) << FP_BITS; - d0d2_y = (d2->y - d0->y) << FP_BITS; - d1d0_y = (d0->y - d1->y) << FP_BITS; - + if (area < 0) { + area = -area; + } - d1d2_x = (d2->x - d1->x) << FP_BITS; - d2d0_x = (d0->x - d2->x) << FP_BITS; - d0d1_x = (d1->x - d0->x) << FP_BITS; + { + int val; + PRECOMP(d2d1_y, d1->y - d2->y) + PRECOMP(d0d2_y, d2->y - d0->y) + PRECOMP(d1d0_y, d0->y - d1->y) + PRECOMP(d1d2_x, d2->x - d1->x) + PRECOMP(d2d0_x, d0->x - d2->x) + PRECOMP(d0d1_x, d1->x - d0->x) + } s2s0_x = s0->x - s2->x; s2s1_x = s1->x - s2->x; @@ -596,7 +621,7 @@ int SDL_SW_BlitTriangle( } /* Handle anti-clockwise triangles */ - if (! is_clockwise) { + if (!is_clockwise) { d2d1_y *= -1; d0d2_y *= -1; d1d0_y *= -1; @@ -614,10 +639,22 @@ int SDL_SW_BlitTriangle( bias_w2 = (is_top_left(d0, d1, is_clockwise) ? 0 : -1); /* precompute constant 's2->x * area' used in TRIANGLE_GET_TEXTCOORD */ - s2_x_area.x = s2->x * area; - s2_x_area.y = s2->y * area; + tmp64 = s2->x * area; + if (tmp64 >= INT_MIN && tmp64 <= INT_MAX) { + s2_x_area.x = (int)tmp64; + } else { + ret = SDL_SetError("triangle area overflow"); + goto end; + } + tmp64 = s2->y * area; + if (tmp64 >= INT_MIN && tmp64 <= INT_MAX) { + s2_x_area.y = (int)tmp64; + } else { + ret = SDL_SetError("triangle area overflow"); + goto end; + } - if (blend != SDL_BLENDMODE_NONE || src->format->format != dst->format->format || has_modulation || ! is_uniform) { + if (blend != SDL_BLENDMODE_NONE || src->format->format != dst->format->format || has_modulation || !is_uniform) { /* Use SDL_BlitTriangle_Slow */ SDL_BlitInfo *info = &src->map->info; @@ -639,12 +676,11 @@ int SDL_SW_BlitTriangle( tmp_info.b = c0.b; tmp_info.a = c0.a; - tmp_info.flags &= ~(SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA); - if (c0.r != 255 || c1.r != 255 || c2.r != 255 || - c0.g != 255 || c1.g != 255 || c2.g != 255 || - c0.b != 255 || c1.b != 255 || c2.b != 255) { + if (c0.r != 255 || c1.r != 255 || c2.r != 255 || + c0.g != 255 || c1.g != 255 || c2.g != 255 || + c0.b != 255 || c1.b != 255 || c2.b != 255) { tmp_info.flags |= SDL_COPY_MODULATE_COLOR; } @@ -655,17 +691,26 @@ int SDL_SW_BlitTriangle( tmp_info.colorkey = info->colorkey; /* src */ - tmp_info.src = (Uint8 *) src_ptr; + tmp_info.src = (Uint8 *)src_ptr; tmp_info.src_pitch = src_pitch; /* dst */ - tmp_info.dst = (Uint8 *) dst_ptr; + tmp_info.dst = dst_ptr; tmp_info.dst_pitch = dst_pitch; - SDL_BlitTriangle_Slow(&tmp_info, s2_x_area, dstrect, area, bias_w0, bias_w1, bias_w2, - d2d1_y, d1d2_x, d0d2_y, d2d0_x, d1d0_y, d0d1_x, - s2s0_x, s2s1_x, s2s0_y, s2s1_y, w0_row, w1_row, w2_row, - c0, c1, c2, is_uniform); +#define CHECK_INT_RANGE(X) \ + if ((X) < INT_MIN || (X) > INT_MAX) { \ + ret = SDL_SetError("integer overflow (%s = %" SDL_PRIs64 ")", #X, X); \ + goto end; \ + } + CHECK_INT_RANGE(area); + CHECK_INT_RANGE(w0_row); + CHECK_INT_RANGE(w1_row); + CHECK_INT_RANGE(w2_row); + SDL_BlitTriangle_Slow(&tmp_info, s2_x_area, dstrect, (int)area, bias_w0, bias_w1, bias_w2, + d2d1_y, d1d2_x, d0d2_y, d2d0_x, d1d0_y, d0d1_x, + s2s0_x, s2s1_x, s2s0_y, s2s1_y, (int)w0_row, (int)w1_row, (int)w2_row, + c0, c1, c2, is_uniform); goto end; } @@ -674,7 +719,7 @@ int SDL_SW_BlitTriangle( TRIANGLE_BEGIN_LOOP { TRIANGLE_GET_TEXTCOORD - Uint32 *sptr = (Uint32 *)((Uint8 *) src_ptr + srcy * src_pitch); + Uint32 *sptr = (Uint32 *)((Uint8 *)src_ptr + srcy * src_pitch); *(Uint32 *)dptr = sptr[srcx]; } TRIANGLE_END_LOOP @@ -682,7 +727,7 @@ int SDL_SW_BlitTriangle( TRIANGLE_BEGIN_LOOP { TRIANGLE_GET_TEXTCOORD - Uint8 *sptr = (Uint8 *)((Uint8 *) src_ptr + srcy * src_pitch); + Uint8 *sptr = (Uint8 *)src_ptr + srcy * src_pitch; dptr[0] = sptr[3 * srcx]; dptr[1] = sptr[3 * srcx + 1]; dptr[2] = sptr[3 * srcx + 2]; @@ -692,7 +737,7 @@ int SDL_SW_BlitTriangle( TRIANGLE_BEGIN_LOOP { TRIANGLE_GET_TEXTCOORD - Uint16 *sptr = (Uint16 *)((Uint8 *) src_ptr + srcy * src_pitch); + Uint16 *sptr = (Uint16 *)((Uint8 *)src_ptr + srcy * src_pitch); *(Uint16 *)dptr = sptr[srcx]; } TRIANGLE_END_LOOP @@ -700,7 +745,7 @@ int SDL_SW_BlitTriangle( TRIANGLE_BEGIN_LOOP { TRIANGLE_GET_TEXTCOORD - Uint8 *sptr = (Uint8 *)((Uint8 *) src_ptr + srcy * src_pitch); + Uint8 *sptr = (Uint8 *)src_ptr + srcy * src_pitch; *dptr = sptr[srcx]; } TRIANGLE_END_LOOP @@ -717,13 +762,13 @@ int SDL_SW_BlitTriangle( return ret; } - -#define FORMAT_ALPHA 0 -#define FORMAT_NO_ALPHA -1 -#define FORMAT_2101010 1 -#define FORMAT_HAS_ALPHA(format) format == 0 -#define FORMAT_HAS_NO_ALPHA(format) format < 0 -static int SDL_INLINE detect_format(SDL_PixelFormat *pf) { +#define FORMAT_ALPHA 0 +#define FORMAT_NO_ALPHA -1 +#define FORMAT_2101010 1 +#define FORMAT_HAS_ALPHA(format) format == 0 +#define FORMAT_HAS_NO_ALPHA(format) format < 0 +static int SDL_INLINE detect_format(SDL_PixelFormat *pf) +{ if (pf->format == SDL_PIXELFORMAT_ARGB2101010) { return FORMAT_2101010; } else if (pf->Amask) { @@ -733,12 +778,11 @@ static int SDL_INLINE detect_format(SDL_PixelFormat *pf) { } } -static void -SDL_BlitTriangle_Slow(SDL_BlitInfo *info, - SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, - int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, - int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, - SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform) +static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info, + SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, + int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, + int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, + SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform) { const int flags = info->flags; Uint32 modulateR = info->r; @@ -784,24 +828,29 @@ SDL_BlitTriangle_Slow(SDL_BlitInfo *info, /* srcpixel isn't set for 24 bpp */ if (srcbpp == 3) { srcpixel = (srcR << src_fmt->Rshift) | - (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift); + (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift); } if ((srcpixel & rgbmask) == ckey) { continue; } } - if (FORMAT_HAS_ALPHA(dstfmt_val)) { - DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA); - } else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) { - DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); - dstA = 0xFF; + if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) { + if (FORMAT_HAS_ALPHA(dstfmt_val)) { + DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA); + } else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) { + DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); + dstA = 0xFF; + } else { + /* SDL_PIXELFORMAT_ARGB2101010 */ + dstpixel = *((Uint32 *) (dst)); + RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA); + } } else { - /* SDL_PIXELFORMAT_ARGB2101010 */ - dstpixel = *((Uint32 *)(dst)); - RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA); + /* don't care */ + dstR = dstG = dstB = dstA = 0; } - if (! is_uniform) { + if (!is_uniform) { TRIANGLE_GET_COLOR modulateR = r; modulateG = g; @@ -840,14 +889,17 @@ SDL_BlitTriangle_Slow(SDL_BlitInfo *info, break; case SDL_COPY_ADD: dstR = srcR + dstR; - if (dstR > 255) + if (dstR > 255) { dstR = 255; + } dstG = srcG + dstG; - if (dstG > 255) + if (dstG > 255) { dstG = 255; + } dstB = srcB + dstB; - if (dstB > 255) + if (dstB > 255) { dstB = 255; + } break; case SDL_COPY_MOD: dstR = (srcR * dstR) / 255; @@ -856,17 +908,17 @@ SDL_BlitTriangle_Slow(SDL_BlitInfo *info, break; case SDL_COPY_MUL: dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; - if (dstR > 255) + if (dstR > 255) { dstR = 255; + } dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; - if (dstG > 255) + if (dstG > 255) { dstG = 255; + } dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; - if (dstB > 255) + if (dstB > 255) { dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; - if (dstA > 255) - dstA = 255; + } break; } if (FORMAT_HAS_ALPHA(dstfmt_val)) { @@ -883,6 +935,6 @@ SDL_BlitTriangle_Slow(SDL_BlitInfo *info, TRIANGLE_END_LOOP } -#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */ +#endif /* SDL_VIDEO_RENDER_SW */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/render/software/SDL_triangle.h b/src/render/software/SDL_triangle.h index c120b39cf4f91..05b1790580371 100644 --- a/src/render/software/SDL_triangle.h +++ b/src/render/software/SDL_triangle.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,15 +25,15 @@ #include "../../SDL_internal.h" extern int SDL_SW_FillTriangle(SDL_Surface *dst, - SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, - SDL_BlendMode blend, SDL_Color c0, SDL_Color c1, SDL_Color c2); + SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, + SDL_BlendMode blend, SDL_Color c0, SDL_Color c1, SDL_Color c2); extern int SDL_SW_BlitTriangle( - SDL_Surface *src, - SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, - SDL_Surface *dst, - SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, - SDL_Color c0, SDL_Color c1, SDL_Color c2); + SDL_Surface *src, + SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, + SDL_Surface *dst, + SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, + SDL_Color c0, SDL_Color c1, SDL_Color c2); extern void trianglepoint_2_fixedpoint(SDL_Point *a); diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 1391b19a4dd1b..ee3586ca05a2c 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,71 +40,66 @@ /* #define DEBUG_RAZOR */ -#if DEBUG_RAZOR +#ifdef DEBUG_RAZOR #include #endif -static SDL_Renderer *VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags); +static int VITA_GXM_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags); static void VITA_GXM_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event); -static SDL_bool VITA_GXM_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode); +static SDL_bool VITA_GXM_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode); static int VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture); static int VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, - const SDL_Rect *rect, const void *pixels, int pitch); + const SDL_Rect *rect, const void *pixels, int pitch); -static int VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch); +static int VITA_GXM_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); -static int VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch); +static int VITA_GXM_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch); static int VITA_GXM_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, - const SDL_Rect *rect, void **pixels, int *pitch); + const SDL_Rect *rect, void **pixels, int *pitch); static void VITA_GXM_UnlockTexture(SDL_Renderer *renderer, - SDL_Texture *texture); + SDL_Texture *texture); -static void VITA_GXM_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode); +static void VITA_GXM_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode); static int VITA_GXM_SetRenderTarget(SDL_Renderer *renderer, - SDL_Texture *texture); + SDL_Texture *texture); +static int VITA_GXM_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd); -static int VITA_GXM_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd); +static int VITA_GXM_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd); -static int VITA_GXM_QueueSetDrawColor(SDL_Renderer * renderer, SDL_RenderCommand *cmd); +static int VITA_GXM_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count); +static int VITA_GXM_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count); - -static int VITA_GXM_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count); -static int VITA_GXM_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count); - -static int -VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y); +static int VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y); static int VITA_GXM_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd); -static int VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize); +static int VITA_GXM_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize); static int VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, - Uint32 pixel_format, void *pixels, int pitch); - + Uint32 pixel_format, void *pixels, int pitch); static int VITA_GXM_RenderPresent(SDL_Renderer *renderer); static void VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); static void VITA_GXM_DestroyRenderer(SDL_Renderer *renderer); - SDL_RenderDriver VITA_GXM_RenderDriver = { .CreateRenderer = VITA_GXM_CreateRenderer, .info = { @@ -123,11 +118,10 @@ SDL_RenderDriver VITA_GXM_RenderDriver = { }, .max_texture_width = 4096, .max_texture_height = 4096, - } + } }; -static int -PixelFormatToVITAFMT(Uint32 format) +static int PixelFormatToVITAFMT(Uint32 format) { switch (format) { case SDL_PIXELFORMAT_ARGB8888: @@ -156,10 +150,9 @@ PixelFormatToVITAFMT(Uint32 format) } } -void -StartDrawing(SDL_Renderer *renderer) +void StartDrawing(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; if (data->drawing) { return; } @@ -171,12 +164,12 @@ StartDrawing(SDL_Renderer *renderer) data->drawstate.viewport_dirty = SDL_TRUE; // reset blend mode -// data->currentBlendMode = SDL_BLENDMODE_BLEND; -// fragment_programs *in = &data->blendFragmentPrograms.blend_mode_blend; -// data->colorFragmentProgram = in->color; -// data->textureFragmentProgram = in->texture; + // data->currentBlendMode = SDL_BLENDMODE_BLEND; + // fragment_programs *in = &data->blendFragmentPrograms.blend_mode_blend; + // data->colorFragmentProgram = in->color; + // data->textureFragmentProgram = in->texture; - if (renderer->target == NULL) { + if (!renderer->target) { sceGxmBeginScene( data->gxm_context, 0, @@ -185,10 +178,9 @@ StartDrawing(SDL_Renderer *renderer) NULL, data->displayBufferSync[data->backBufferIndex], &data->displaySurface[data->backBufferIndex], - &data->depthSurface - ); + &data->depthSurface); } else { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) renderer->target->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)renderer->target->driverdata; sceGxmBeginScene( data->gxm_context, @@ -198,17 +190,15 @@ StartDrawing(SDL_Renderer *renderer) NULL, NULL, &vita_texture->tex->gxm_colorsurface, - &vita_texture->tex->gxm_depthstencil - ); + &vita_texture->tex->gxm_depthstencil); } -// unset_clip_rectangle(data); + // unset_clip_rectangle(data); data->drawing = SDL_TRUE; } -static int -VITA_GXM_SetVSync(SDL_Renderer * renderer, const int vsync) +static int VITA_GXM_SetVSync(SDL_Renderer *renderer, const int vsync) { VITA_GXM_RenderData *data = renderer->driverdata; if (vsync) { @@ -221,23 +211,13 @@ VITA_GXM_SetVSync(SDL_Renderer * renderer, const int vsync) return 0; } -SDL_Renderer * -VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) +int VITA_GXM_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags) { - SDL_Renderer *renderer; VITA_GXM_RenderData *data; - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; - } - - data = (VITA_GXM_RenderData *) SDL_calloc(1, sizeof(VITA_GXM_RenderData)); + data = (VITA_GXM_RenderData *)SDL_calloc(1, sizeof(VITA_GXM_RenderData)); if (!data) { - SDL_free(renderer); - SDL_OutOfMemory(); - return NULL; + return SDL_OutOfMemory(); } renderer->WindowEvent = VITA_GXM_WindowEvent; @@ -277,38 +257,33 @@ VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags) data->displayData.wait_vblank = SDL_FALSE; } -#if DEBUG_RAZOR - sceSysmoduleLoadModule( SCE_SYSMODULE_RAZOR_HUD ); - sceSysmoduleLoadModule( SCE_SYSMODULE_RAZOR_CAPTURE ); +#ifdef DEBUG_RAZOR + sceSysmoduleLoadModule(SCE_SYSMODULE_RAZOR_HUD); + sceSysmoduleLoadModule(SCE_SYSMODULE_RAZOR_CAPTURE); #endif - if (gxm_init(renderer) != 0) - { + if (gxm_init(renderer) != 0) { SDL_free(data); - SDL_free(renderer); - return NULL; + return -1; } - return renderer; + return 0; } -static void -VITA_GXM_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) +static void VITA_GXM_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { } -static SDL_bool -VITA_GXM_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) +static SDL_bool VITA_GXM_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { // only for custom modes. we build all modes on init, so no custom modes, sorry return SDL_FALSE; } -static int -VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static int VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; - VITA_GXM_TextureData* vita_texture = (VITA_GXM_TextureData*) SDL_calloc(1, sizeof(VITA_GXM_TextureData)); + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)SDL_calloc(1, sizeof(VITA_GXM_TextureData)); if (!vita_texture) { return SDL_OutOfMemory(); @@ -323,8 +298,7 @@ VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) &(vita_texture->w), &(vita_texture->h), &(vita_texture->pitch), - &(vita_texture->wscale) - ); + &(vita_texture->wscale)); if (!vita_texture->tex) { SDL_free(vita_texture); @@ -343,9 +317,9 @@ VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } -static void VITA_GXM_SetYUVProfile(SDL_Renderer * renderer, SDL_Texture *texture) +static void VITA_GXM_SetYUVProfile(SDL_Renderer *renderer, SDL_Texture *texture) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; int ret = 0; switch (SDL_GetYUVConversionModeForResolution(texture->w, texture->h)) { case SDL_YUV_CONVERSION_BT601: @@ -358,18 +332,17 @@ static void VITA_GXM_SetYUVProfile(SDL_Renderer * renderer, SDL_Texture *texture default: SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Unsupported YUV profile: %d\n", SDL_GetYUVConversionModeForResolution(texture->w, texture->h)); break; - } + } - if (ret < 0) { - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Setting YUV profile failed: %x\n", ret); - } + if (ret < 0) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Setting YUV profile failed: %x\n", ret); + } } -static int -VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, - const SDL_Rect *rect, const void *pixels, int pitch) +static int VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, const void *pixels, int pitch) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; Uint8 *dst; int row, length, dpitch; @@ -382,7 +355,8 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, VITA_GXM_LockTexture(renderer, texture, rect, (void **)&dst, &dpitch); length = rect->w * SDL_BYTESPERPIXEL(texture->format); if (length == pitch && length == dpitch) { - SDL_memcpy(dst, pixels, length*rect->h); + SDL_memcpy(dst, pixels, length * rect->h); + pixels += pitch * rect->h; } else { for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, pixels, length); @@ -395,9 +369,9 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, if (vita_texture->yuv) { void *Udst; void *Vdst; - int uv_pitch = (dpitch+1) / 2; - int uv_src_pitch = (pitch+1) / 2; - SDL_Rect UVrect = {rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2}; + int uv_pitch = (dpitch + 1) / 2; + int uv_src_pitch = (pitch + 1) / 2; + SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; // skip Y plane Uint8 *Dpixels = gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h); @@ -409,7 +383,8 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, // U plane if (length == uv_src_pitch && length == uv_pitch) { - SDL_memcpy(Udst, pixels, length*UVrect.h); + SDL_memcpy(Udst, pixels, length * UVrect.h); + pixels += uv_src_pitch * UVrect.h; } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(Udst, pixels, length); @@ -420,7 +395,7 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, // V plane if (length == uv_src_pitch && length == uv_pitch) { - SDL_memcpy(Vdst, pixels, length*UVrect.h); + SDL_memcpy(Vdst, pixels, length * UVrect.h); } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(Vdst, pixels, length); @@ -431,19 +406,19 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, } else if (vita_texture->nv12) { void *UVdst; - int uv_pitch = 2 * ((dpitch+1) / 2); - int uv_src_pitch = 2 * ((pitch+1) / 2); - SDL_Rect UVrect = {rect->x / 2, rect->y / 2, (rect->w + 1) / 2 , (rect->h + 1) / 2}; + int uv_pitch = 2 * ((dpitch + 1) / 2); + int uv_src_pitch = 2 * ((pitch + 1) / 2); + SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; // skip Y plane - void *Dpixels = (void *) ((Uint8 *) gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); + void *Dpixels = (void *)((Uint8 *)gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); UVdst = Dpixels + (UVrect.y * uv_pitch) + UVrect.x; - length = UVrect.w*2; + length = UVrect.w * 2; // UV plane if (length == uv_src_pitch && length == uv_pitch) { - SDL_memcpy(UVdst, pixels, length*UVrect.h); + SDL_memcpy(UVdst, pixels, length * UVrect.h); } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(UVdst, pixels, length); @@ -458,16 +433,15 @@ VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, } #if SDL_HAVE_YUV -static int -VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *Uplane, int Upitch, - const Uint8 *Vplane, int Vpitch) +static int VITA_GXM_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch) { Uint8 *dst; int row, length, dpitch; - SDL_Rect UVrect = {rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2}; + SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; VITA_GXM_SetYUVProfile(renderer, texture); @@ -478,7 +452,7 @@ VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, length = rect->w; if (length == Ypitch && length == dpitch) { - SDL_memcpy(dst, Yplane, length*rect->h); + SDL_memcpy(dst, Yplane, length * rect->h); } else { for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, Yplane, length); @@ -491,11 +465,11 @@ VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, { void *Udst; void *Vdst; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; - int uv_pitch = (dpitch+1) / 2; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + int uv_pitch = (dpitch + 1) / 2; // skip Y plane - void *pixels = (void *) ((Uint8 *) gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); + void *pixels = (void *)((Uint8 *)gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); if (texture->format == SDL_PIXELFORMAT_YV12) { // YVU Vdst = pixels + (UVrect.y * uv_pitch) + UVrect.x; @@ -509,7 +483,7 @@ VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, // U plane if (length == Upitch && length == uv_pitch) { - SDL_memcpy(Udst, Uplane, length*UVrect.h); + SDL_memcpy(Udst, Uplane, length * UVrect.h); } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(Udst, Uplane, length); @@ -520,7 +494,7 @@ VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, // V plane if (length == Vpitch && length == uv_pitch) { - SDL_memcpy(Vdst, Vplane, length*UVrect.h); + SDL_memcpy(Vdst, Vplane, length * UVrect.h); } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(Vdst, Vplane, length); @@ -528,22 +502,20 @@ VITA_GXM_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, Vdst += uv_pitch; } } - } return 0; } -static int -VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * rect, - const Uint8 *Yplane, int Ypitch, - const Uint8 *UVplane, int UVpitch) +static int VITA_GXM_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch) { Uint8 *dst; int row, length, dpitch; - SDL_Rect UVrect = {rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2}; + SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; VITA_GXM_SetYUVProfile(renderer, texture); @@ -553,10 +525,10 @@ VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, length = rect->w * SDL_BYTESPERPIXEL(texture->format); if (length == Ypitch && length == dpitch) { - SDL_memcpy(dst, Yplane, length*rect->h); + SDL_memcpy(dst, Yplane, length * rect->h); } else { for (row = 0; row < rect->h; ++row) { - SDL_memcpy(dst, Yplane, length); + SDL_memcpy(dst, Yplane, length); Yplane += Ypitch; dst += dpitch; } @@ -565,11 +537,11 @@ VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, // UV plane { void *UVdst; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; - int uv_pitch = 2 * ((dpitch+1) / 2); + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + int uv_pitch = 2 * ((dpitch + 1) / 2); // skip Y plane - void *pixels = (void *) ((Uint8 *) gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); + void *pixels = (void *)((Uint8 *)gxm_texture_get_datap(vita_texture->tex) + (vita_texture->pitch * vita_texture->h)); UVdst = pixels + (UVrect.y * uv_pitch) + UVrect.x; @@ -577,7 +549,7 @@ VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, // UV plane if (length == UVpitch && length == uv_pitch) { - SDL_memcpy(UVdst, UVplane, length*UVrect.h); + SDL_memcpy(UVdst, UVplane, length * UVrect.h); } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(UVdst, UVplane, length); @@ -592,38 +564,34 @@ VITA_GXM_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture, #endif -static int -VITA_GXM_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, - const SDL_Rect *rect, void **pixels, int *pitch) +static int VITA_GXM_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, + const SDL_Rect *rect, void **pixels, int *pitch) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; *pixels = - (void *) ((Uint8 *) gxm_texture_get_datap(vita_texture->tex) - + (rect->y * vita_texture->pitch) + rect->x * SDL_BYTESPERPIXEL(texture->format)); + (void *)((Uint8 *)gxm_texture_get_datap(vita_texture->tex) + (rect->y * vita_texture->pitch) + rect->x * SDL_BYTESPERPIXEL(texture->format)); *pitch = vita_texture->pitch; // make sure that rendering is finished on render target textures - if (vita_texture->tex->gxm_rendertarget != NULL) { + if (vita_texture->tex->gxm_rendertarget) { sceGxmFinish(data->gxm_context); } return 0; } -static void -VITA_GXM_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static void VITA_GXM_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { // No need to update texture data on ps vita. // VITA_GXM_LockTexture already returns a pointer to the texture pixels buffer. // This really improves framerate when using lock/unlock. } -static void -VITA_GXM_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) +static void VITA_GXM_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; /* set texture filtering according to scaleMode @@ -633,43 +601,39 @@ VITA_GXM_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL */ int vitaScaleMode = (scaleMode == SDL_ScaleModeNearest - ? SCE_GXM_TEXTURE_FILTER_POINT - : SCE_GXM_TEXTURE_FILTER_LINEAR); + ? SCE_GXM_TEXTURE_FILTER_POINT + : SCE_GXM_TEXTURE_FILTER_LINEAR); gxm_texture_set_filters(vita_texture->tex, vitaScaleMode, vitaScaleMode); return; } -static int -VITA_GXM_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) +static int VITA_GXM_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { return 0; } -static void -VITA_GXM_SetBlendMode(VITA_GXM_RenderData *data, int blendMode) +static void VITA_GXM_SetBlendMode(VITA_GXM_RenderData *data, int blendMode) { - if (blendMode != data->currentBlendMode) - { + if (blendMode != data->currentBlendMode) { fragment_programs *in = &data->blendFragmentPrograms.blend_mode_blend; - switch (blendMode) - { - case SDL_BLENDMODE_NONE: - in = &data->blendFragmentPrograms.blend_mode_none; - break; - case SDL_BLENDMODE_BLEND: - in = &data->blendFragmentPrograms.blend_mode_blend; - break; - case SDL_BLENDMODE_ADD: - in = &data->blendFragmentPrograms.blend_mode_add; - break; - case SDL_BLENDMODE_MOD: - in = &data->blendFragmentPrograms.blend_mode_mod; - break; - case SDL_BLENDMODE_MUL: - in = &data->blendFragmentPrograms.blend_mode_mul; - break; + switch (blendMode) { + case SDL_BLENDMODE_NONE: + in = &data->blendFragmentPrograms.blend_mode_none; + break; + case SDL_BLENDMODE_BLEND: + in = &data->blendFragmentPrograms.blend_mode_blend; + break; + case SDL_BLENDMODE_ADD: + in = &data->blendFragmentPrograms.blend_mode_add; + break; + case SDL_BLENDMODE_MOD: + in = &data->blendFragmentPrograms.blend_mode_mod; + break; + case SDL_BLENDMODE_MUL: + in = &data->blendFragmentPrograms.blend_mode_mul; + break; } data->colorFragmentProgram = in->color; data->textureFragmentProgram = in->texture; @@ -677,16 +641,14 @@ VITA_GXM_SetBlendMode(VITA_GXM_RenderData *data, int blendMode) } } -static int -VITA_GXM_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int VITA_GXM_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { return 0; } -static int -VITA_GXM_QueueSetDrawColor(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int VITA_GXM_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; data->drawstate.color.r = cmd->data.color.r; data->drawstate.color.g = cmd->data.color.g; @@ -696,23 +658,20 @@ VITA_GXM_QueueSetDrawColor(SDL_Renderer * renderer, SDL_RenderCommand *cmd) return 0; } -static int -VITA_GXM_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int VITA_GXM_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; SDL_Color color = data->drawstate.color; color_vertex *vertex = (color_vertex *)pool_malloc( data, - count * sizeof(color_vertex) - ); + count * sizeof(color_vertex)); cmd->data.draw.first = (size_t)vertex; cmd->data.draw.count = count; - for (int i = 0; i < count; i++) - { + for (int i = 0; i < count; i++) { vertex[i].x = points[i].x; vertex[i].y = points[i].y; vertex[i].color = color; @@ -721,41 +680,37 @@ VITA_GXM_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const return 0; } -static int -VITA_GXM_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count) +static int VITA_GXM_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; SDL_Color color = data->drawstate.color; color_vertex *vertex = (color_vertex *)pool_malloc( data, - (count-1) * 2 * sizeof(color_vertex) - ); + (count - 1) * 2 * sizeof(color_vertex)); cmd->data.draw.first = (size_t)vertex; - cmd->data.draw.count = (count-1) * 2; + cmd->data.draw.count = (count - 1) * 2; - for (int i = 0; i < count - 1; i++) - { - vertex[i*2].x = points[i].x; - vertex[i*2].y = points[i].y; - vertex[i*2].color = color; + for (int i = 0; i < count - 1; i++) { + vertex[i * 2].x = points[i].x; + vertex[i * 2].y = points[i].y; + vertex[i * 2].color = color; - vertex[i*2+1].x = points[i+1].x; - vertex[i*2+1].y = points[i+1].y; - vertex[i*2+1].color = color; + vertex[i * 2 + 1].x = points[i + 1].x; + vertex[i * 2 + 1].y = points[i + 1].y; + vertex[i * 2 + 1].color = color; } return 0; } -static int -VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, - const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, - int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) +static int VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, + const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, + int num_vertices, const void *indices, int num_indices, int size_indices, + float scale_x, float scale_y) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; int i; int count = indices ? num_indices : num_vertices; @@ -763,18 +718,17 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu size_indices = indices ? size_indices : 0; if (texture) { - VITA_GXM_TextureData* vita_texture = (VITA_GXM_TextureData*) texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; texture_vertex *vertices; vertices = (texture_vertex *)pool_malloc( - data, - count * sizeof(texture_vertex)); + data, + count * sizeof(texture_vertex)); if (!vertices) { return -1; } - for (i = 0; i < count; i++) { int j; float *xy_; @@ -790,9 +744,9 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); - uv_ = (float *)((char*)uv + j * uv_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); + uv_ = (float *)((char *)uv + j * uv_stride); vertices[i].x = xy_[0] * scale_x; vertices[i].y = xy_[1] * scale_y; @@ -807,14 +761,13 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu color_vertex *vertices; vertices = (color_vertex *)pool_malloc( - data, - count * sizeof(color_vertex)); + data, + count * sizeof(color_vertex)); if (!vertices) { return -1; } - for (i = 0; i < count; i++) { int j; float *xy_; @@ -829,8 +782,8 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu j = i; } - xy_ = (float *)((char*)xy + j * xy_stride); - col_ = *(SDL_Color *)((char*)color + j * color_stride); + xy_ = (float *)((char *)xy + j * xy_stride); + col_ = *(SDL_Color *)((char *)color + j * color_stride); vertices[i].x = xy_[0] * scale_x; vertices[i].y = xy_[1] * scale_y; @@ -839,23 +792,21 @@ VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu cmd->data.draw.first = (size_t)vertices; } - return 0; } -static int -VITA_GXM_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) +static int VITA_GXM_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { void *color_buffer; float clear_color[4]; - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; unset_clip_rectangle(data); - clear_color[0] = (cmd->data.color.r)/255.0f; - clear_color[1] = (cmd->data.color.g)/255.0f; - clear_color[2] = (cmd->data.color.b)/255.0f; - clear_color[3] = (cmd->data.color.a)/255.0f; + clear_color[0] = (cmd->data.color.r) / 255.0f; + clear_color[1] = (cmd->data.color.g) / 255.0f; + clear_color[2] = (cmd->data.color.b) / 255.0f; + clear_color[3] = (cmd->data.color.a) / 255.0f; // set clear shaders data->drawstate.fragment_program = data->clearFragmentProgram; @@ -875,9 +826,36 @@ VITA_GXM_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) return 0; } +static void ClampCliprectToViewport(SDL_Rect *clip, const SDL_Rect *viewport) +{ + int max_x_v, max_y_v, max_x_c, max_y_c; + + if (clip->x < 0) { + clip->w += clip->x; + clip->x = 0; + } + + if (clip->y < 0) { + clip->h += clip->y; + clip->y = 0; + } + + max_x_c = clip->x + clip->w; + max_y_c = clip->y + clip->h; -static int -SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) + max_x_v = viewport->x + viewport->w; + max_y_v = viewport->y + viewport->h; + + if (max_x_c > max_x_v) { + clip->w -= (max_x_v - max_x_c); + } + + if (max_y_c > max_y_v) { + clip->h -= (max_y_v - max_y_c); + } +} + +static int SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; const SDL_BlendMode blend = cmd->data.draw.blend; @@ -889,8 +867,7 @@ SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) if (data->drawstate.viewport_dirty) { const SDL_Rect *viewport = &data->drawstate.viewport; - - float sw = viewport->w / 2.; + float sw = viewport->w / 2.; float sh = viewport->h / 2.; float x_scale = sw; @@ -902,11 +879,11 @@ SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) if (viewport->w && viewport->h) { init_orthographic_matrix(data->ortho_matrix, - (float) 0, - (float) viewport->w, - (float) viewport->h, - (float) 0, - 0.0f, 1.0f); + (float)0, + (float)viewport->w, + (float)viewport->h, + (float)0, + 0.0f, 1.0f); matrix_updated = SDL_TRUE; } @@ -920,9 +897,13 @@ SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) data->drawstate.cliprect_enabled_dirty = SDL_FALSE; } - if (data->drawstate.cliprect_enabled && data->drawstate.cliprect_dirty) { - const SDL_Rect *rect = &data->drawstate.cliprect; - set_clip_rectangle(data, rect->x, rect->y, rect->x + rect->w, rect->y + rect->h); + if ((data->drawstate.cliprect_enabled || data->drawstate.viewport_is_set) && data->drawstate.cliprect_dirty) { + SDL_Rect rect; + SDL_copyp(&rect, &data->drawstate.cliprect); + if (data->drawstate.viewport_is_set) { + ClampCliprectToViewport(&rect, &data->drawstate.viewport); + } + set_clip_rectangle(data, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h); data->drawstate.cliprect_dirty = SDL_FALSE; } @@ -948,7 +929,6 @@ SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) program_updated = SDL_TRUE; } - if (program_updated || matrix_updated) { if (data->drawstate.fragment_program == data->textureFragmentProgram) { void *vertex_wvp_buffer; @@ -963,131 +943,157 @@ SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) if (texture != data->drawstate.texture) { if (texture) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) cmd->data.draw.texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)cmd->data.draw.texture->driverdata; sceGxmSetFragmentTexture(data->gxm_context, 0, &vita_texture->tex->gxm_tex); } data->drawstate.texture = texture; } /* all drawing commands use this */ - sceGxmSetVertexStream(data->gxm_context, 0, (const void*)cmd->data.draw.first); + sceGxmSetVertexStream(data->gxm_context, 0, (const void *)cmd->data.draw.first); return 0; } -static int -VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int VITA_GXM_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + int w, h; + StartDrawing(renderer); data->drawstate.target = renderer->target; if (!data->drawstate.target) { - int w, h; SDL_GL_GetDrawableSize(renderer->window, &w, &h); - if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { - data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. - data->drawstate.cliprect_dirty = SDL_TRUE; - data->drawstate.drawablew = w; - data->drawstate.drawableh = h; + } else { + if (SDL_QueryTexture(renderer->target, NULL, NULL, &w, &h) < 0) { + w = data->drawstate.drawablew; + h = data->drawstate.drawableh; } + } + if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) { + data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc. + data->drawstate.cliprect_dirty = SDL_TRUE; + data->drawstate.drawablew = w; + data->drawstate.drawableh = h; } while (cmd) { switch (cmd->command) { - case SDL_RENDERCMD_SETVIEWPORT: { - SDL_Rect *viewport = &data->drawstate.viewport; - if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { - SDL_copyp(viewport, &cmd->data.viewport.rect); - data->drawstate.viewport_dirty = SDL_TRUE; + case SDL_RENDERCMD_SETVIEWPORT: + { + SDL_Rect *viewport = &data->drawstate.viewport; + if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) { + SDL_copyp(viewport, &cmd->data.viewport.rect); + data->drawstate.viewport_dirty = SDL_TRUE; + data->drawstate.cliprect_dirty = SDL_TRUE; + data->drawstate.viewport_is_set = viewport->x != 0 || viewport->y != 0 || viewport->w != data->drawstate.drawablew || viewport->h != data->drawstate.drawableh; + if (!data->drawstate.cliprect_enabled) { + if (data->drawstate.viewport_is_set) { + SDL_copyp(&data->drawstate.cliprect, viewport); + data->drawstate.cliprect.x = 0; + data->drawstate.cliprect.y = 0; + } else { + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + } } - break; } + break; + } - case SDL_RENDERCMD_SETCLIPRECT: { - const SDL_Rect *rect = &cmd->data.cliprect.rect; - if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { - data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; - } - - if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { - SDL_copyp(&data->drawstate.cliprect, rect); - data->drawstate.cliprect_dirty = SDL_TRUE; + case SDL_RENDERCMD_SETCLIPRECT: + { + const SDL_Rect *rect = &cmd->data.cliprect.rect; + const SDL_Rect *viewport = &data->drawstate.viewport; + if (data->drawstate.cliprect_enabled != cmd->data.cliprect.enabled) { + data->drawstate.cliprect_enabled = cmd->data.cliprect.enabled; + data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + if (!data->drawstate.cliprect_enabled && data->drawstate.viewport_is_set) { + SDL_copyp(&data->drawstate.cliprect, viewport); + data->drawstate.cliprect.x = 0; + data->drawstate.cliprect.y = 0; } - break; } - case SDL_RENDERCMD_SETDRAWCOLOR: { - break; + if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) { + SDL_copyp(&data->drawstate.cliprect, rect); + data->drawstate.cliprect_dirty = SDL_TRUE; } + break; + } - case SDL_RENDERCMD_CLEAR: { - VITA_GXM_RenderClear(renderer, cmd); - break; - } + case SDL_RENDERCMD_SETDRAWCOLOR: + { + break; + } - case SDL_RENDERCMD_FILL_RECTS: /* unused */ - break; - - case SDL_RENDERCMD_COPY: /* unused */ - break; - - case SDL_RENDERCMD_COPY_EX: /* unused */ - break; - - case SDL_RENDERCMD_DRAW_POINTS: - case SDL_RENDERCMD_DRAW_LINES: - case SDL_RENDERCMD_GEOMETRY: { - SDL_Texture *thistexture = cmd->data.draw.texture; - SDL_BlendMode thisblend = cmd->data.draw.blend; - const SDL_RenderCommandType thiscmdtype = cmd->command; - SDL_RenderCommand *finalcmd = cmd; - SDL_RenderCommand *nextcmd = cmd->next; - size_t count = cmd->data.draw.count; - int ret; - while (nextcmd != NULL) { - const SDL_RenderCommandType nextcmdtype = nextcmd->command; - if (nextcmdtype != thiscmdtype) { - break; /* can't go any further on this draw call, different render command up next. */ - } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { - break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ - } else { - finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ - count += nextcmd->data.draw.count; - } - nextcmd = nextcmd->next; - } + case SDL_RENDERCMD_CLEAR: + { + VITA_GXM_RenderClear(renderer, cmd); + break; + } - ret = SetDrawState(data, cmd); + case SDL_RENDERCMD_FILL_RECTS: /* unused */ + break; - if (ret == 0) { - int op = SCE_GXM_PRIMITIVE_TRIANGLES; + case SDL_RENDERCMD_COPY: /* unused */ + break; - if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { - sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_POINT); - op = SCE_GXM_PRIMITIVE_POINTS; - } else if (thiscmdtype == SDL_RENDERCMD_DRAW_LINES) { - sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_LINE); - op = SCE_GXM_PRIMITIVE_LINES; - } + case SDL_RENDERCMD_COPY_EX: /* unused */ + break; + + case SDL_RENDERCMD_DRAW_POINTS: + case SDL_RENDERCMD_DRAW_LINES: + case SDL_RENDERCMD_GEOMETRY: + { + SDL_Texture *thistexture = cmd->data.draw.texture; + SDL_BlendMode thisblend = cmd->data.draw.blend; + const SDL_RenderCommandType thiscmdtype = cmd->command; + SDL_RenderCommand *finalcmd = cmd; + SDL_RenderCommand *nextcmd = cmd->next; + size_t count = cmd->data.draw.count; + int ret; + while (nextcmd) { + const SDL_RenderCommandType nextcmdtype = nextcmd->command; + if (nextcmdtype != thiscmdtype) { + break; /* can't go any further on this draw call, different render command up next. */ + } else if (nextcmd->data.draw.texture != thistexture || nextcmd->data.draw.blend != thisblend) { + break; /* can't go any further on this draw call, different texture/blendmode copy up next. */ + } else { + finalcmd = nextcmd; /* we can combine copy operations here. Mark this one as the furthest okay command. */ + count += nextcmd->data.draw.count; + } + nextcmd = nextcmd->next; + } - sceGxmDraw(data->gxm_context, op, SCE_GXM_INDEX_FORMAT_U16, data->linearIndices, count); + ret = SetDrawState(data, cmd); - if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS || thiscmdtype == SDL_RENDERCMD_DRAW_LINES) { - sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_TRIANGLE_FILL); - } + if (ret == 0) { + int op = SCE_GXM_PRIMITIVE_TRIANGLES; + if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS) { + sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_POINT); + op = SCE_GXM_PRIMITIVE_POINTS; + } else if (thiscmdtype == SDL_RENDERCMD_DRAW_LINES) { + sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_LINE); + op = SCE_GXM_PRIMITIVE_LINES; } - cmd = finalcmd; /* skip any copy commands we just combined in here. */ - break; + sceGxmDraw(data->gxm_context, op, SCE_GXM_INDEX_FORMAT_U16, data->linearIndices, count); + + if (thiscmdtype == SDL_RENDERCMD_DRAW_POINTS || thiscmdtype == SDL_RENDERCMD_DRAW_LINES) { + sceGxmSetFrontPolygonMode(data->gxm_context, SCE_GXM_POLYGON_MODE_TRIANGLE_FILL); + } } - case SDL_RENDERCMD_NO_OP: - break; + cmd = finalcmd; /* skip any copy commands we just combined in here. */ + break; + } + + case SDL_RENDERCMD_NO_OP: + break; } data->drawstate.last_command = cmd->command; cmd = cmd->next; @@ -1099,7 +1105,8 @@ VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void * return 0; } -void read_pixels(int x, int y, size_t width, size_t height, void *data) { +void read_pixels(int x, int y, size_t width, size_t height, void *data) +{ SceDisplayFrameBuf pParam; int i, j; Uint32 *out32; @@ -1122,10 +1129,8 @@ void read_pixels(int x, int y, size_t width, size_t height, void *data) { } } - -static int -VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, - Uint32 pixel_format, void *pixels, int pitch) +static int VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, + Uint32 pixel_format, void *pixels, int pitch) { Uint32 temp_format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ABGR8888; size_t buflen; @@ -1140,11 +1145,10 @@ VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, return SDL_Unsupported(); } - temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format); buflen = rect->h * temp_pitch; if (buflen == 0) { - return 0; /* nothing to do. */ + return 0; /* nothing to do. */ } temp_pixels = SDL_malloc(buflen); @@ -1154,16 +1158,16 @@ VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, SDL_GetRendererOutputSize(renderer, &w, &h); - read_pixels(rect->x, renderer->target ? rect->y : (h-rect->y)-rect->h, - rect->w, rect->h, temp_pixels); + read_pixels(rect->x, renderer->target ? rect->y : (h - rect->y) - rect->h, + rect->w, rect->h, temp_pixels); /* Flip the rows to be top-down if necessary */ if (!renderer->target) { SDL_bool isstack; length = rect->w * SDL_BYTESPERPIXEL(temp_format); - src = (Uint8*)temp_pixels + (rect->h-1)*temp_pitch; - dst = (Uint8*)temp_pixels; + src = (Uint8 *)temp_pixels + (rect->h - 1) * temp_pitch; + dst = (Uint8 *)temp_pixels; tmp = SDL_small_alloc(Uint8, length, &isstack); rows = rect->h / 2; while (rows--) { @@ -1184,21 +1188,19 @@ VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, return status; } - -static int -VITA_GXM_RenderPresent(SDL_Renderer *renderer) +static int VITA_GXM_RenderPresent(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; SceCommonDialogUpdateParam updateParam; data->displayData.address = data->displayBufferData[data->backBufferIndex]; SDL_memset(&updateParam, 0, sizeof(updateParam)); - updateParam.renderTarget.colorFormat = VITA_GXM_COLOR_FORMAT; - updateParam.renderTarget.surfaceType = SCE_GXM_COLOR_SURFACE_LINEAR; - updateParam.renderTarget.width = VITA_GXM_SCREEN_WIDTH; - updateParam.renderTarget.height = VITA_GXM_SCREEN_HEIGHT; + updateParam.renderTarget.colorFormat = VITA_GXM_COLOR_FORMAT; + updateParam.renderTarget.surfaceType = SCE_GXM_COLOR_SURFACE_LINEAR; + updateParam.renderTarget.width = VITA_GXM_SCREEN_WIDTH; + updateParam.renderTarget.height = VITA_GXM_SCREEN_HEIGHT; updateParam.renderTarget.strideInPixels = VITA_GXM_SCREEN_STRIDE; updateParam.renderTarget.colorSurfaceData = data->displayBufferData[data->backBufferIndex]; @@ -1208,18 +1210,16 @@ VITA_GXM_RenderPresent(SDL_Renderer *renderer) sceCommonDialogUpdate(&updateParam); -#if DEBUG_RAZOR +#ifdef DEBUG_RAZOR sceGxmPadHeartbeat( (const SceGxmColorSurface *)&data->displaySurface[data->backBufferIndex], - (SceGxmSyncObject *)data->displayBufferSync[data->backBufferIndex] - ); + (SceGxmSyncObject *)data->displayBufferSync[data->backBufferIndex]); #endif sceGxmDisplayQueueAddEntry( - data->displayBufferSync[data->frontBufferIndex], // OLD fb - data->displayBufferSync[data->backBufferIndex], // NEW fb - &data->displayData - ); + data->displayBufferSync[data->frontBufferIndex], // OLD fb + data->displayBufferSync[data->backBufferIndex], // NEW fb + &data->displayData); // update buffer indices data->frontBufferIndex = data->backBufferIndex; @@ -1230,20 +1230,22 @@ VITA_GXM_RenderPresent(SDL_Renderer *renderer) return 0; } -static void -VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) +static void VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *) texture->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; - if (data == NULL) + if (!data) { return; + } - if(vita_texture == NULL) + if (!vita_texture) { return; + } - if(vita_texture->tex == NULL) + if (!vita_texture->tex) { return; + } sceGxmFinish(data->gxm_context); @@ -1254,13 +1256,13 @@ VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) texture->driverdata = NULL; } -static void -VITA_GXM_DestroyRenderer(SDL_Renderer *renderer) +static void VITA_GXM_DestroyRenderer(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; if (data) { - if (!data->initialized) + if (!data->initialized) { return; + } gxm_finish(renderer); @@ -1268,7 +1270,6 @@ VITA_GXM_DestroyRenderer(SDL_Renderer *renderer) data->drawing = SDL_FALSE; SDL_free(data); } - SDL_free(renderer); } #endif /* SDL_VIDEO_RENDER_VITA_GXM */ diff --git a/src/render/vitagxm/SDL_render_vita_gxm_memory.c b/src/render/vitagxm/SDL_render_vita_gxm_memory.c index 85d682ad73cba..b8e5ea7ba1b71 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_memory.c +++ b/src/render/vitagxm/SDL_render_vita_gxm_memory.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,56 +25,59 @@ #include "SDL_render_vita_gxm_memory.h" -void * -vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid) +void *vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid) { void *mem; if (type == SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW) { - size = ALIGN(size, 256*1024); + size = ALIGN(size, 256 * 1024); + } else if (type == SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW) { + size = ALIGN(size, 1024 * 1024); } else { - size = ALIGN(size, 4*1024); + size = ALIGN(size, 4 * 1024); } *uid = sceKernelAllocMemBlock("gpu_mem", type, size, NULL); - if (*uid < 0) + if (*uid < 0) { return NULL; + } - if (sceKernelGetMemBlockBase(*uid, &mem) < 0) + if (sceKernelGetMemBlockBase(*uid, &mem) < 0) { return NULL; + } - if (sceGxmMapMemory(mem, size, attribs) < 0) + if (sceGxmMapMemory(mem, size, attribs) < 0) { return NULL; + } return mem; } -void -vita_mem_free(SceUID uid) +void vita_mem_free(SceUID uid) { void *mem = NULL; - if (sceKernelGetMemBlockBase(uid, &mem) < 0) + if (sceKernelGetMemBlockBase(uid, &mem) < 0) { return; + } sceGxmUnmapMemory(mem); sceKernelFreeMemBlock(uid); } -void * -vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size) +void *vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size) { void *mem; - if (data->texturePool == NULL) { + if (!data->texturePool) { int poolsize; int ret; SceKernelFreeMemorySizeInfo info; info.size = sizeof(SceKernelFreeMemorySizeInfo); sceKernelGetFreeMemorySize(&info); - poolsize = ALIGN(info.size_cdram, 256*1024); + poolsize = ALIGN(info.size_cdram, 256 * 1024); if (poolsize > info.size_cdram) { - poolsize = ALIGN(info.size_cdram - 256*1024, 256*1024); + poolsize = ALIGN(info.size_cdram - 256 * 1024, 256 * 1024); } data->texturePoolUID = sceKernelAllocMemBlock("gpu_texture_pool", SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW, poolsize, NULL); if (data->texturePoolUID < 0) { @@ -82,96 +85,93 @@ vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size) } ret = sceKernelGetMemBlockBase(data->texturePoolUID, &mem); - if ( ret < 0) - { + if (ret < 0) { return NULL; } data->texturePool = sceClibMspaceCreate(mem, poolsize); - if (data->texturePool == NULL) { + if (!data->texturePool) { return NULL; } ret = sceGxmMapMemory(mem, poolsize, SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE); - if (ret < 0) - { + if (ret < 0) { return NULL; } } return sceClibMspaceMemalign(data->texturePool, SCE_GXM_TEXTURE_ALIGNMENT, size); } -void -vita_gpu_mem_free(VITA_GXM_RenderData *data, void* ptr) +void vita_gpu_mem_free(VITA_GXM_RenderData *data, void *ptr) { - if (data->texturePool != NULL) - { + if (data->texturePool) { sceClibMspaceFree(data->texturePool, ptr); } } -void -vita_gpu_mem_destroy(VITA_GXM_RenderData *data) +void vita_gpu_mem_destroy(VITA_GXM_RenderData *data) { void *mem = NULL; - if (data->texturePool != NULL) - { + if (data->texturePool) { sceClibMspaceDestroy(data->texturePool); data->texturePool = NULL; - if (sceKernelGetMemBlockBase(data->texturePoolUID, &mem) < 0) + if (sceKernelGetMemBlockBase(data->texturePoolUID, &mem) < 0) { return; + } sceGxmUnmapMemory(mem); sceKernelFreeMemBlock(data->texturePoolUID); } } -void * -vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset) +void *vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset) { void *mem = NULL; size = ALIGN(size, 4096); *uid = sceKernelAllocMemBlock("vertex_usse", SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, size, NULL); - if (sceKernelGetMemBlockBase(*uid, &mem) < 0) + if (sceKernelGetMemBlockBase(*uid, &mem) < 0) { return NULL; - if (sceGxmMapVertexUsseMemory(mem, size, usse_offset) < 0) + } + if (sceGxmMapVertexUsseMemory(mem, size, usse_offset) < 0) { return NULL; + } return mem; } -void -vita_mem_vertex_usse_free(SceUID uid) +void vita_mem_vertex_usse_free(SceUID uid) { void *mem = NULL; - if (sceKernelGetMemBlockBase(uid, &mem) < 0) + if (sceKernelGetMemBlockBase(uid, &mem) < 0) { return; + } sceGxmUnmapVertexUsseMemory(mem); sceKernelFreeMemBlock(uid); } -void * -vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset) +void *vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset) { void *mem = NULL; size = ALIGN(size, 4096); *uid = sceKernelAllocMemBlock("fragment_usse", SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, size, NULL); - if (sceKernelGetMemBlockBase(*uid, &mem) < 0) + if (sceKernelGetMemBlockBase(*uid, &mem) < 0) { return NULL; - if (sceGxmMapFragmentUsseMemory(mem, size, usse_offset) < 0) + } + if (sceGxmMapFragmentUsseMemory(mem, size, usse_offset) < 0) { return NULL; + } return mem; } -void -vita_mem_fragment_usse_free(SceUID uid) +void vita_mem_fragment_usse_free(SceUID uid) { void *mem = NULL; - if (sceKernelGetMemBlockBase(uid, &mem) < 0) + if (sceKernelGetMemBlockBase(uid, &mem) < 0) { return; + } sceGxmUnmapFragmentUsseMemory(mem); sceKernelFreeMemBlock(uid); } diff --git a/src/render/vitagxm/SDL_render_vita_gxm_memory.h b/src/render/vitagxm/SDL_render_vita_gxm_memory.h index 93b9f3498b328..1c10955261001 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_memory.h +++ b/src/render/vitagxm/SDL_render_vita_gxm_memory.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,12 +27,12 @@ #include #include "SDL_render_vita_gxm_types.h" -#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) +#define ALIGN(x, a) (((x) + ((a)-1)) & ~((a)-1)) void *vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid); void vita_mem_free(SceUID uid); void *vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size); -void vita_gpu_mem_free(VITA_GXM_RenderData *data, void* ptr); +void vita_gpu_mem_free(VITA_GXM_RenderData *data, void *ptr); void vita_gpu_mem_destroy(VITA_GXM_RenderData *data); void *vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset); void vita_mem_vertex_usse_free(SceUID uid); diff --git a/src/render/vitagxm/SDL_render_vita_gxm_shaders.h b/src/render/vitagxm/SDL_render_vita_gxm_shaders.h index f60ad1d5578d5..26ac57ccbcf79 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_shaders.h +++ b/src/render/vitagxm/SDL_render_vita_gxm_shaders.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,8 @@ #include +/* *INDENT-OFF* */ /* clang-format off */ + #define gxm_shader_clear_f_size 232 static const unsigned char gxm_shader_clear_f[gxm_shader_clear_f_size] = { 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x50, 0x03, @@ -268,12 +270,14 @@ static const unsigned char gxm_shader_texture_v[gxm_shader_texture_v_size] = { 0x6f, 0x72, 0x00, 0x77, 0x76, 0x70, 0x00, 0x00, }; -static const SceGxmProgram *const clearVertexProgramGxp = (const SceGxmProgram *)gxm_shader_clear_v; -static const SceGxmProgram *const clearFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_clear_f; -static const SceGxmProgram *const colorVertexProgramGxp = (const SceGxmProgram *)gxm_shader_color_v; -static const SceGxmProgram *const colorFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_color_f; -static const SceGxmProgram *const textureVertexProgramGxp = (const SceGxmProgram *)gxm_shader_texture_v; -static const SceGxmProgram *const textureFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_texture_f; +/* *INDENT-ON* */ /* clang-format on */ + +static const SceGxmProgram *const clearVertexProgramGxp = (const SceGxmProgram *)gxm_shader_clear_v; +static const SceGxmProgram *const clearFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_clear_f; +static const SceGxmProgram *const colorVertexProgramGxp = (const SceGxmProgram *)gxm_shader_color_v; +static const SceGxmProgram *const colorFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_color_f; +static const SceGxmProgram *const textureVertexProgramGxp = (const SceGxmProgram *)gxm_shader_texture_v; +static const SceGxmProgram *const textureFragmentProgramGxp = (const SceGxmProgram *)gxm_shader_texture_f; #endif // SDL_RENDER_VITA_GXM_SHADERS_H diff --git a/src/render/vitagxm/SDL_render_vita_gxm_tools.c b/src/render/vitagxm/SDL_render_vita_gxm_tools.c index 10deb556a8aed..31a321a3b7463 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_tools.c +++ b/src/render/vitagxm/SDL_render_vita_gxm_tools.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -45,23 +45,22 @@ #include "SDL_render_vita_gxm_memory.h" #include "SDL_render_vita_gxm_shaders.h" -void -init_orthographic_matrix(float *m, float left, float right, float bottom, float top, float near, float far) +void init_orthographic_matrix(float *m, float left, float right, float bottom, float top, float near, float far) { - m[0x0] = 2.0f/(right-left); + m[0x0] = 2.0f / (right - left); m[0x4] = 0.0f; m[0x8] = 0.0f; - m[0xC] = -(right+left)/(right-left); + m[0xC] = -(right + left) / (right - left); m[0x1] = 0.0f; - m[0x5] = 2.0f/(top-bottom); + m[0x5] = 2.0f / (top - bottom); m[0x9] = 0.0f; - m[0xD] = -(top+bottom)/(top-bottom); + m[0xD] = -(top + bottom) / (top - bottom); m[0x2] = 0.0f; m[0x6] = 0.0f; - m[0xA] = -2.0f/(far-near); - m[0xE] = (far+near)/(far-near); + m[0xA] = -2.0f / (far - near); + m[0xE] = (far + near) / (far - near); m[0x3] = 0.0f; m[0x7] = 0.0f; @@ -69,23 +68,20 @@ init_orthographic_matrix(float *m, float left, float right, float bottom, float m[0xF] = 1.0f; } -static void * -patcher_host_alloc(void *user_data, unsigned int size) +static void *patcher_host_alloc(void *user_data, unsigned int size) { void *mem = SDL_malloc(size); (void)user_data; return mem; } -static void -patcher_host_free(void *user_data, void *mem) +static void patcher_host_free(void *user_data, void *mem) { (void)user_data; SDL_free(mem); } -void * -pool_malloc(VITA_GXM_RenderData *data, unsigned int size) +void *pool_malloc(VITA_GXM_RenderData *data, unsigned int size) { if ((data->pool_index + size) < VITA_GXM_POOL_SIZE) { @@ -97,8 +93,7 @@ pool_malloc(VITA_GXM_RenderData *data, unsigned int size) return NULL; } -void * -pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment) +void *pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment) { unsigned int new_index = (data->pool_index + alignment - 1) & ~(alignment - 1); if ((new_index + size) < VITA_GXM_POOL_SIZE) { @@ -110,8 +105,7 @@ pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignme return NULL; } -static int -tex_format_to_bytespp(SceGxmTextureFormat format) +static int tex_format_to_bytespp(SceGxmTextureFormat format) { switch (format & 0x9f000000U) { case SCE_GXM_TEXTURE_BASE_FORMAT_U8: @@ -141,19 +135,18 @@ tex_format_to_bytespp(SceGxmTextureFormat format) } } -static void -display_callback(const void *callback_data) +static void display_callback(const void *callback_data) { SceDisplayFrameBuf framebuf; const VITA_GXM_DisplayData *display_data = (const VITA_GXM_DisplayData *)callback_data; SDL_memset(&framebuf, 0x00, sizeof(SceDisplayFrameBuf)); - framebuf.size = sizeof(SceDisplayFrameBuf); - framebuf.base = display_data->address; - framebuf.pitch = VITA_GXM_SCREEN_STRIDE; + framebuf.size = sizeof(SceDisplayFrameBuf); + framebuf.base = display_data->address; + framebuf.pitch = VITA_GXM_SCREEN_STRIDE; framebuf.pixelformat = VITA_GXM_PIXEL_FORMAT; - framebuf.width = VITA_GXM_SCREEN_WIDTH; - framebuf.height = VITA_GXM_SCREEN_HEIGHT; + framebuf.width = VITA_GXM_SCREEN_WIDTH; + framebuf.height = VITA_GXM_SCREEN_HEIGHT; sceDisplaySetFrameBuf(&framebuf, SCE_DISPLAY_SETBUF_NEXTFRAME); if (display_data->wait_vblank) { @@ -161,16 +154,14 @@ display_callback(const void *callback_data) } } -static void -free_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out) +static void free_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out) { sceGxmShaderPatcherReleaseFragmentProgram(data->shaderPatcher, out->color); sceGxmShaderPatcherReleaseFragmentProgram(data->shaderPatcher, out->texture); } -static void -make_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out, - const SceGxmBlendInfo *blend_info) +static void make_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out, + const SceGxmBlendInfo *blend_info) { int err; @@ -181,8 +172,7 @@ make_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out, 0, blend_info, colorVertexProgramGxp, - &out->color - ); + &out->color); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Patcher create fragment failed: %d\n", err); @@ -196,8 +186,7 @@ make_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out, 0, blend_info, textureVertexProgramGxp, - &out->texture - ); + &out->texture); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Patcher create fragment failed: %d\n", err); @@ -205,16 +194,13 @@ make_fragment_programs(VITA_GXM_RenderData *data, fragment_programs *out, } } - -static void -set_stencil_mask(VITA_GXM_RenderData *data, float x, float y, float w, float h) +static void set_stencil_mask(VITA_GXM_RenderData *data, float x, float y, float w, float h) { void *vertexDefaultBuffer; color_vertex *vertices = (color_vertex *)pool_memalign( data, 4 * sizeof(color_vertex), // 4 vertices - sizeof(color_vertex) - ); + sizeof(color_vertex)); vertices[0].x = x; vertices[0].y = y; @@ -256,11 +242,9 @@ set_stencil_mask(VITA_GXM_RenderData *data, float x, float y, float w, float h) sceGxmDraw(data->gxm_context, SCE_GXM_PRIMITIVE_TRIANGLE_STRIP, SCE_GXM_INDEX_FORMAT_U16, data->linearIndices, 4); } - -void -set_clip_rectangle(VITA_GXM_RenderData *data, int x_min, int y_min, int x_max, int y_max) +void set_clip_rectangle(VITA_GXM_RenderData *data, int x_min, int y_min, int x_max, int y_max) { - if(data->drawing) { + if (data->drawing) { // clear the stencil buffer to 0 sceGxmSetFrontStencilFunc( data->gxm_context, @@ -269,8 +253,7 @@ set_clip_rectangle(VITA_GXM_RenderData *data, int x_min, int y_min, int x_max, i SCE_GXM_STENCIL_OP_ZERO, SCE_GXM_STENCIL_OP_ZERO, 0xFF, - 0xFF - ); + 0xFF); set_stencil_mask(data, 0, 0, VITA_GXM_SCREEN_WIDTH, VITA_GXM_SCREEN_HEIGHT); @@ -282,8 +265,7 @@ set_clip_rectangle(VITA_GXM_RenderData *data, int x_min, int y_min, int x_max, i SCE_GXM_STENCIL_OP_REPLACE, SCE_GXM_STENCIL_OP_REPLACE, 0xFF, - 0xFF - ); + 0xFF); set_stencil_mask(data, x_min, y_min, x_max - x_min, y_max - y_min); @@ -295,13 +277,11 @@ set_clip_rectangle(VITA_GXM_RenderData *data, int x_min, int y_min, int x_max, i SCE_GXM_STENCIL_OP_KEEP, SCE_GXM_STENCIL_OP_KEEP, 0xFF, - 0xFF - ); + 0xFF); } } -void -unset_clip_rectangle(VITA_GXM_RenderData *data) +void unset_clip_rectangle(VITA_GXM_RenderData *data) { sceGxmSetFrontStencilFunc( data->gxm_context, @@ -310,12 +290,10 @@ unset_clip_rectangle(VITA_GXM_RenderData *data) SCE_GXM_STENCIL_OP_KEEP, SCE_GXM_STENCIL_OP_KEEP, 0xFF, - 0xFF - ); + 0xFF); } -int -gxm_init(SDL_Renderer *renderer) +int gxm_init(SDL_Renderer *renderer) { unsigned int i, x, y; int err; @@ -341,38 +319,38 @@ gxm_init(SDL_Renderer *renderer) unsigned int depthStrideInSamples = alignedWidth; // set buffer sizes for this sample - const unsigned int patcherBufferSize = 64*1024; - const unsigned int patcherVertexUsseSize = 64*1024; - const unsigned int patcherFragmentUsseSize = 64*1024; + const unsigned int patcherBufferSize = 64 * 1024; + const unsigned int patcherVertexUsseSize = 64 * 1024; + const unsigned int patcherFragmentUsseSize = 64 * 1024; // Fill SceGxmBlendInfo static const SceGxmBlendInfo blend_info_none = { .colorFunc = SCE_GXM_BLEND_FUNC_NONE, .alphaFunc = SCE_GXM_BLEND_FUNC_NONE, - .colorSrc = SCE_GXM_BLEND_FACTOR_ZERO, - .colorDst = SCE_GXM_BLEND_FACTOR_ZERO, - .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, - .alphaDst = SCE_GXM_BLEND_FACTOR_ZERO, + .colorSrc = SCE_GXM_BLEND_FACTOR_ZERO, + .colorDst = SCE_GXM_BLEND_FACTOR_ZERO, + .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, + .alphaDst = SCE_GXM_BLEND_FACTOR_ZERO, .colorMask = SCE_GXM_COLOR_MASK_ALL }; static const SceGxmBlendInfo blend_info_blend = { .colorFunc = SCE_GXM_BLEND_FUNC_ADD, .alphaFunc = SCE_GXM_BLEND_FUNC_ADD, - .colorSrc = SCE_GXM_BLEND_FACTOR_SRC_ALPHA, - .colorDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - .alphaSrc = SCE_GXM_BLEND_FACTOR_ONE, - .alphaDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + .colorSrc = SCE_GXM_BLEND_FACTOR_SRC_ALPHA, + .colorDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + .alphaSrc = SCE_GXM_BLEND_FACTOR_ONE, + .alphaDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, .colorMask = SCE_GXM_COLOR_MASK_ALL }; static const SceGxmBlendInfo blend_info_add = { .colorFunc = SCE_GXM_BLEND_FUNC_ADD, .alphaFunc = SCE_GXM_BLEND_FUNC_ADD, - .colorSrc = SCE_GXM_BLEND_FACTOR_SRC_ALPHA, - .colorDst = SCE_GXM_BLEND_FACTOR_ONE, - .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, - .alphaDst = SCE_GXM_BLEND_FACTOR_ONE, + .colorSrc = SCE_GXM_BLEND_FACTOR_SRC_ALPHA, + .colorDst = SCE_GXM_BLEND_FACTOR_ONE, + .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, + .alphaDst = SCE_GXM_BLEND_FACTOR_ONE, .colorMask = SCE_GXM_COLOR_MASK_ALL }; @@ -380,33 +358,33 @@ gxm_init(SDL_Renderer *renderer) .colorFunc = SCE_GXM_BLEND_FUNC_ADD, .alphaFunc = SCE_GXM_BLEND_FUNC_ADD, - .colorSrc = SCE_GXM_BLEND_FACTOR_ZERO, - .colorDst = SCE_GXM_BLEND_FACTOR_SRC_COLOR, + .colorSrc = SCE_GXM_BLEND_FACTOR_ZERO, + .colorDst = SCE_GXM_BLEND_FACTOR_SRC_COLOR, - .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, - .alphaDst = SCE_GXM_BLEND_FACTOR_ONE, + .alphaSrc = SCE_GXM_BLEND_FACTOR_ZERO, + .alphaDst = SCE_GXM_BLEND_FACTOR_ONE, .colorMask = SCE_GXM_COLOR_MASK_ALL }; static const SceGxmBlendInfo blend_info_mul = { .colorFunc = SCE_GXM_BLEND_FUNC_ADD, .alphaFunc = SCE_GXM_BLEND_FUNC_ADD, - .colorSrc = SCE_GXM_BLEND_FACTOR_DST_COLOR, - .colorDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - .alphaSrc = SCE_GXM_BLEND_FACTOR_DST_ALPHA, - .alphaDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + .colorSrc = SCE_GXM_BLEND_FACTOR_DST_COLOR, + .colorDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + .alphaSrc = SCE_GXM_BLEND_FACTOR_DST_ALPHA, + .alphaDst = SCE_GXM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, .colorMask = SCE_GXM_COLOR_MASK_ALL }; - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; SceGxmInitializeParams initializeParams; SDL_memset(&initializeParams, 0, sizeof(SceGxmInitializeParams)); - initializeParams.flags = 0; - initializeParams.displayQueueMaxPendingCount = VITA_GXM_PENDING_SWAPS; - initializeParams.displayQueueCallback = display_callback; - initializeParams.displayQueueCallbackDataSize = sizeof(VITA_GXM_DisplayData); - initializeParams.parameterBufferSize = SCE_GXM_DEFAULT_PARAMETER_BUFFER_SIZE; + initializeParams.flags = 0; + initializeParams.displayQueueMaxPendingCount = VITA_GXM_PENDING_SWAPS; + initializeParams.displayQueueCallback = display_callback; + initializeParams.displayQueueCallbackDataSize = sizeof(VITA_GXM_DisplayData); + initializeParams.parameterBufferSize = SCE_GXM_DEFAULT_PARAMETER_BUFFER_SIZE; err = sceGxmInitialize(&initializeParams); @@ -443,17 +421,17 @@ gxm_init(SDL_Renderer *renderer) &fragmentUsseRingBufferOffset); SDL_memset(&data->contextParams, 0, sizeof(SceGxmContextParams)); - data->contextParams.hostMem = SDL_malloc(SCE_GXM_MINIMUM_CONTEXT_HOST_MEM_SIZE); - data->contextParams.hostMemSize = SCE_GXM_MINIMUM_CONTEXT_HOST_MEM_SIZE; - data->contextParams.vdmRingBufferMem = vdmRingBuffer; - data->contextParams.vdmRingBufferMemSize = SCE_GXM_DEFAULT_VDM_RING_BUFFER_SIZE; - data->contextParams.vertexRingBufferMem = vertexRingBuffer; - data->contextParams.vertexRingBufferMemSize = SCE_GXM_DEFAULT_VERTEX_RING_BUFFER_SIZE; - data->contextParams.fragmentRingBufferMem = fragmentRingBuffer; - data->contextParams.fragmentRingBufferMemSize = SCE_GXM_DEFAULT_FRAGMENT_RING_BUFFER_SIZE; - data->contextParams.fragmentUsseRingBufferMem = fragmentUsseRingBuffer; + data->contextParams.hostMem = SDL_malloc(SCE_GXM_MINIMUM_CONTEXT_HOST_MEM_SIZE); + data->contextParams.hostMemSize = SCE_GXM_MINIMUM_CONTEXT_HOST_MEM_SIZE; + data->contextParams.vdmRingBufferMem = vdmRingBuffer; + data->contextParams.vdmRingBufferMemSize = SCE_GXM_DEFAULT_VDM_RING_BUFFER_SIZE; + data->contextParams.vertexRingBufferMem = vertexRingBuffer; + data->contextParams.vertexRingBufferMemSize = SCE_GXM_DEFAULT_VERTEX_RING_BUFFER_SIZE; + data->contextParams.fragmentRingBufferMem = fragmentRingBuffer; + data->contextParams.fragmentRingBufferMemSize = SCE_GXM_DEFAULT_FRAGMENT_RING_BUFFER_SIZE; + data->contextParams.fragmentUsseRingBufferMem = fragmentUsseRingBuffer; data->contextParams.fragmentUsseRingBufferMemSize = SCE_GXM_DEFAULT_FRAGMENT_USSE_RING_BUFFER_SIZE; - data->contextParams.fragmentUsseRingBufferOffset = fragmentUsseRingBufferOffset; + data->contextParams.fragmentUsseRingBufferOffset = fragmentUsseRingBufferOffset; err = sceGxmCreateContext(&data->contextParams, &data->gxm_context); if (err != 0) { @@ -463,13 +441,13 @@ gxm_init(SDL_Renderer *renderer) // set up parameters SDL_memset(&renderTargetParams, 0, sizeof(SceGxmRenderTargetParams)); - renderTargetParams.flags = 0; - renderTargetParams.width = VITA_GXM_SCREEN_WIDTH; - renderTargetParams.height = VITA_GXM_SCREEN_HEIGHT; - renderTargetParams.scenesPerFrame = 1; - renderTargetParams.multisampleMode = 0; + renderTargetParams.flags = 0; + renderTargetParams.width = VITA_GXM_SCREEN_WIDTH; + renderTargetParams.height = VITA_GXM_SCREEN_HEIGHT; + renderTargetParams.scenesPerFrame = 1; + renderTargetParams.multisampleMode = 0; renderTargetParams.multisampleLocations = 0; - renderTargetParams.driverMemBlock = -1; // Invalid UID + renderTargetParams.driverMemBlock = -1; // Invalid UID // create the render target err = sceGxmCreateRenderTarget(&renderTargetParams, &data->renderTarget); @@ -507,25 +485,21 @@ gxm_init(SDL_Renderer *renderer) VITA_GXM_SCREEN_WIDTH, VITA_GXM_SCREEN_HEIGHT, VITA_GXM_SCREEN_STRIDE, - data->displayBufferData[i] - ); + data->displayBufferData[i]); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "color surface init failed: %d\n", err); return err; } - // create a sync object that we will associate with this buffer err = sceGxmSyncObjectCreate(&data->displayBufferSync[i]); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "sync object creation failed: %d\n", err); return err; } - } - // allocate the depth buffer data->depthBufferData = vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, @@ -554,7 +528,6 @@ gxm_init(SDL_Renderer *renderer) // set the stencil test reference (this is currently assumed to always remain 1 after here for region clipping) sceGxmSetFrontStencilRef(data->gxm_context, 1); - // set the stencil function (this wouldn't actually be needed, as the set clip rectangle function has to call this at the begginning of every scene) sceGxmSetFrontStencilFunc( data->gxm_context, @@ -565,7 +538,6 @@ gxm_init(SDL_Renderer *renderer) 0xFF, 0xFF); - // allocate memory for buffers and USSE code patcherBuffer = vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, @@ -586,23 +558,23 @@ gxm_init(SDL_Renderer *renderer) // create a shader patcher SDL_memset(&patcherParams, 0, sizeof(SceGxmShaderPatcherParams)); - patcherParams.userData = NULL; - patcherParams.hostAllocCallback = &patcher_host_alloc; - patcherParams.hostFreeCallback = &patcher_host_free; - patcherParams.bufferAllocCallback = NULL; - patcherParams.bufferFreeCallback = NULL; - patcherParams.bufferMem = patcherBuffer; - patcherParams.bufferMemSize = patcherBufferSize; - patcherParams.vertexUsseAllocCallback = NULL; - patcherParams.vertexUsseFreeCallback = NULL; - patcherParams.vertexUsseMem = patcherVertexUsse; - patcherParams.vertexUsseMemSize = patcherVertexUsseSize; - patcherParams.vertexUsseOffset = patcherVertexUsseOffset; + patcherParams.userData = NULL; + patcherParams.hostAllocCallback = &patcher_host_alloc; + patcherParams.hostFreeCallback = &patcher_host_free; + patcherParams.bufferAllocCallback = NULL; + patcherParams.bufferFreeCallback = NULL; + patcherParams.bufferMem = patcherBuffer; + patcherParams.bufferMemSize = patcherBufferSize; + patcherParams.vertexUsseAllocCallback = NULL; + patcherParams.vertexUsseFreeCallback = NULL; + patcherParams.vertexUsseMem = patcherVertexUsse; + patcherParams.vertexUsseMemSize = patcherVertexUsseSize; + patcherParams.vertexUsseOffset = patcherVertexUsseOffset; patcherParams.fragmentUsseAllocCallback = NULL; - patcherParams.fragmentUsseFreeCallback = NULL; - patcherParams.fragmentUsseMem = patcherFragmentUsse; - patcherParams.fragmentUsseMemSize = patcherFragmentUsseSize; - patcherParams.fragmentUsseOffset = patcherFragmentUsseOffset; + patcherParams.fragmentUsseFreeCallback = NULL; + patcherParams.fragmentUsseMem = patcherFragmentUsse; + patcherParams.fragmentUsseMemSize = patcherFragmentUsseSize; + patcherParams.fragmentUsseOffset = patcherFragmentUsseOffset; err = sceGxmShaderPatcherCreate(&patcherParams, &data->shaderPatcher); if (err != 0) { @@ -610,7 +582,6 @@ gxm_init(SDL_Renderer *renderer) return err; } - // check the shaders err = sceGxmProgramCheck(clearVertexProgramGxp); if (err != 0) { @@ -692,13 +663,13 @@ gxm_init(SDL_Renderer *renderer) // create clear vertex format SceGxmVertexAttribute clearVertexAttributes[1]; SceGxmVertexStream clearVertexStreams[1]; - clearVertexAttributes[0].streamIndex = 0; - clearVertexAttributes[0].offset = 0; - clearVertexAttributes[0].format = SCE_GXM_ATTRIBUTE_FORMAT_F32; + clearVertexAttributes[0].streamIndex = 0; + clearVertexAttributes[0].offset = 0; + clearVertexAttributes[0].format = SCE_GXM_ATTRIBUTE_FORMAT_F32; clearVertexAttributes[0].componentCount = 2; - clearVertexAttributes[0].regIndex = sceGxmProgramParameterGetResourceIndex(paramClearPositionAttribute); - clearVertexStreams[0].stride = sizeof(clear_vertex); - clearVertexStreams[0].indexSource = SCE_GXM_INDEX_SOURCE_INDEX_16BIT; + clearVertexAttributes[0].regIndex = sceGxmProgramParameterGetResourceIndex(paramClearPositionAttribute); + clearVertexStreams[0].stride = sizeof(clear_vertex); + clearVertexStreams[0].indexSource = SCE_GXM_INDEX_SOURCE_INDEX_16BIT; // create clear programs err = sceGxmShaderPatcherCreateVertexProgram( @@ -708,8 +679,7 @@ gxm_init(SDL_Renderer *renderer) 1, clearVertexStreams, 1, - &data->clearVertexProgram - ); + &data->clearVertexProgram); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "create program (clear vertex) failed: %d\n", err); return err; @@ -722,8 +692,7 @@ gxm_init(SDL_Renderer *renderer) 0, NULL, clearVertexProgramGxp, - &data->clearFragmentProgram - ); + &data->clearFragmentProgram); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "create program (clear fragment) failed: %d\n", err); return err; @@ -732,11 +701,10 @@ gxm_init(SDL_Renderer *renderer) // create the clear triangle vertex/index data data->clearVertices = (clear_vertex *)vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, - 3*sizeof(clear_vertex), + 3 * sizeof(clear_vertex), 4, SCE_GXM_MEMORY_ATTRIB_READ, - &data->clearVerticesUid - ); + &data->clearVerticesUid); } // Allocate a 64k * 2 bytes = 128 KiB buffer and store all possible @@ -744,23 +712,21 @@ gxm_init(SDL_Renderer *renderer) // all drawing operations where we don't want to use indexing. data->linearIndices = (uint16_t *)vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, - UINT16_MAX*sizeof(uint16_t), + UINT16_MAX * sizeof(uint16_t), sizeof(uint16_t), SCE_GXM_MEMORY_ATTRIB_READ, - &data->linearIndicesUid - ); + &data->linearIndicesUid); - for (i = 0; i <= UINT16_MAX; ++i) - { + for (i = 0; i <= UINT16_MAX; ++i) { data->linearIndices[i] = i; } data->clearVertices[0].x = -1.0f; data->clearVertices[0].y = -1.0f; - data->clearVertices[1].x = 3.0f; + data->clearVertices[1].x = 3.0f; data->clearVertices[1].y = -1.0f; data->clearVertices[2].x = -1.0f; - data->clearVertices[2].y = 3.0f; + data->clearVertices[2].y = 3.0f; { const SceGxmProgramParameter *paramColorPositionAttribute = sceGxmProgramFindParameterByName(colorVertexProgramGxp, "aPosition"); @@ -794,16 +760,13 @@ gxm_init(SDL_Renderer *renderer) 2, colorVertexStreams, 1, - &data->colorVertexProgram - ); + &data->colorVertexProgram); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "create program (color vertex) failed: %d\n", err); return err; } - } - { const SceGxmProgramParameter *paramTexturePositionAttribute = sceGxmProgramFindParameterByName(textureVertexProgramGxp, "aPosition"); const SceGxmProgramParameter *paramTextureTexcoordAttribute = sceGxmProgramFindParameterByName(textureVertexProgramGxp, "aTexcoord"); @@ -842,13 +805,11 @@ gxm_init(SDL_Renderer *renderer) 3, textureVertexStreams, 1, - &data->textureVertexProgram - ); + &data->textureVertexProgram); if (err != 0) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "create program (texture vertex) failed: %x\n", err); return err; } - } // Create variations of the fragment program based on blending mode @@ -864,7 +825,6 @@ gxm_init(SDL_Renderer *renderer) data->colorFragmentProgram = in->color; data->textureFragmentProgram = in->texture; - } // find vertex uniforms by name and cache parameter information @@ -878,16 +838,14 @@ gxm_init(SDL_Renderer *renderer) VITA_GXM_POOL_SIZE, sizeof(void *), SCE_GXM_MEMORY_ATTRIB_READ, - &data->poolUid[0] - ); + &data->poolUid[0]); data->pool_addr[1] = vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW, VITA_GXM_POOL_SIZE, sizeof(void *), SCE_GXM_MEMORY_ATTRIB_READ, - &data->poolUid[1] - ); + &data->poolUid[1]); init_orthographic_matrix(data->ortho_matrix, 0.0f, VITA_GXM_SCREEN_WIDTH, VITA_GXM_SCREEN_HEIGHT, 0.0f, 0.0f, 1.0f); @@ -902,7 +860,7 @@ gxm_init(SDL_Renderer *renderer) void gxm_finish(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *) renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; // wait until rendering is done sceGxmFinish(data->gxm_context); @@ -913,7 +871,6 @@ void gxm_finish(SDL_Renderer *renderer) sceGxmShaderPatcherReleaseVertexProgram(data->shaderPatcher, data->colorVertexProgram); sceGxmShaderPatcherReleaseVertexProgram(data->shaderPatcher, data->textureVertexProgram); - free_fragment_programs(data, &data->blendFragmentPrograms.blend_mode_none); free_fragment_programs(data, &data->blendFragmentPrograms.blend_mode_blend); free_fragment_programs(data, &data->blendFragmentPrograms.blend_mode_add); @@ -929,8 +886,7 @@ void gxm_finish(SDL_Renderer *renderer) // clean up display queue vita_mem_free(data->depthBufferUid); - for (size_t i = 0; i < VITA_GXM_BUFFERS; i++) - { + for (size_t i = 0; i < VITA_GXM_BUFFERS; i++) { // clear the buffer then deallocate SDL_memset(data->displayBufferData[i], 0, VITA_GXM_SCREEN_HEIGHT * VITA_GXM_SCREEN_STRIDE * 4); vita_mem_free(data->displayBufferUid[i]); @@ -977,8 +933,7 @@ void gxm_finish(SDL_Renderer *renderer) // textures -void -free_gxm_texture(VITA_GXM_RenderData *data, gxm_texture *texture) +void free_gxm_texture(VITA_GXM_RenderData *data, gxm_texture *texture) { if (texture) { if (texture->gxm_rendertarget) { @@ -1002,8 +957,7 @@ gxm_texture_get_format(const gxm_texture *texture) return sceGxmTextureGetFormat(&texture->gxm_tex); } -void * -gxm_texture_get_datap(const gxm_texture *texture) +void *gxm_texture_get_datap(const gxm_texture *texture) { return sceGxmTextureGetData(&texture->gxm_tex); } @@ -1028,30 +982,30 @@ static SceGxmColorFormat tex_format_to_color_format(SceGxmTextureFormat format) } } -gxm_texture * -create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale) +gxm_texture *create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale) { gxm_texture *texture = SDL_calloc(1, sizeof(gxm_texture)); int aligned_w = ALIGN(w, 8); int texture_w = w; - int tex_size = aligned_w * h * tex_format_to_bytespp(format); + int tex_size = aligned_w * h * tex_format_to_bytespp(format); void *texture_data; int ret; *return_wscale = 1.0f; // SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3/P2 based formats require width aligned to 16 - if ( (format & 0x9f000000U) == SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 || (format & 0x9f000000U) == SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2) { + if ((format & 0x9f000000U) == SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P3 || (format & 0x9f000000U) == SCE_GXM_TEXTURE_BASE_FORMAT_YUV420P2) { aligned_w = ALIGN(w, 16); texture_w = aligned_w; - tex_size = aligned_w * h * tex_format_to_bytespp(format); - *return_wscale = (float) (w) / texture_w; + tex_size = aligned_w * h * tex_format_to_bytespp(format); + *return_wscale = (float)(w) / texture_w; // add storage for UV planes tex_size += (((aligned_w + 1) / 2) * ((h + 1) / 2)) * 2; } - if (!texture) + if (!texture) { return NULL; + } *return_w = w; *return_h = h; @@ -1060,8 +1014,7 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc /* Allocate a GPU buffer for the texture */ texture_data = vita_gpu_mem_alloc( data, - tex_size - ); + tex_size); /* Try SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE in case we're out of VRAM */ if (!texture_data) { @@ -1071,8 +1024,7 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc tex_size, SCE_GXM_TEXTURE_ALIGNMENT, SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE, - &texture->data_UID - ); + &texture->data_UID); texture->cdram = 0; } else { texture->cdram = 1; @@ -1087,22 +1039,21 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc SDL_memset(texture_data, 0, tex_size); /* Create the gxm texture */ - ret = sceGxmTextureInitLinear( &texture->gxm_tex, texture_data, format, texture_w, h, 0); + ret = sceGxmTextureInitLinear(&texture->gxm_tex, texture_data, format, texture_w, h, 0); if (ret < 0) { - free_gxm_texture(data, texture); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "texture init failed: %x\n", ret); - return NULL; + free_gxm_texture(data, texture); + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "texture init failed: %x\n", ret); + return NULL; } if (isRenderTarget) { void *depthBufferData; const uint32_t alignedWidth = ALIGN(w, SCE_GXM_TILE_SIZEX); const uint32_t alignedHeight = ALIGN(h, SCE_GXM_TILE_SIZEY); - uint32_t sampleCount = alignedWidth*alignedHeight; + uint32_t sampleCount = alignedWidth * alignedHeight; uint32_t depthStrideInSamples = alignedWidth; const uint32_t alignedColorSurfaceStride = ALIGN(w, 8); - int err = sceGxmColorSurfaceInit( &texture->gxm_colorsurface, tex_format_to_color_format(format), @@ -1112,8 +1063,7 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc w, h, alignedColorSurfaceStride, - texture_data - ); + texture_data); if (err < 0) { free_gxm_texture(data, texture); @@ -1124,7 +1074,7 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc // allocate it depthBufferData = vita_mem_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, - 4*sampleCount, + 4 * sampleCount, SCE_GXM_DEPTHSTENCIL_SURFACE_ALIGNMENT, SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE, &texture->depth_UID); @@ -1169,14 +1119,12 @@ create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, Sc return NULL; } } - } return texture; } -void -gxm_texture_set_filters(gxm_texture *texture, SceGxmTextureFilter min_filter, SceGxmTextureFilter mag_filter) +void gxm_texture_set_filters(gxm_texture *texture, SceGxmTextureFilter min_filter, SceGxmTextureFilter mag_filter) { sceGxmTextureSetMinFilter(&texture->gxm_tex, min_filter); sceGxmTextureSetMagFilter(&texture->gxm_tex, mag_filter); @@ -1187,7 +1135,7 @@ static unsigned int front_buffer_index_for_common_dialog = 0; struct { VITA_GXM_DisplayData displayData; - SceGxmSyncObject* sync; + SceGxmSyncObject *sync; SceGxmColorSurface surf; SceUID uid; } buffer_for_common_dialog[VITA_GXM_BUFFERS]; @@ -1196,11 +1144,11 @@ void gxm_minimal_init_for_common_dialog(void) { SceGxmInitializeParams initializeParams; SDL_zero(initializeParams); - initializeParams.flags = 0; - initializeParams.displayQueueMaxPendingCount = VITA_GXM_PENDING_SWAPS; - initializeParams.displayQueueCallback = display_callback; - initializeParams.displayQueueCallbackDataSize = sizeof(VITA_GXM_DisplayData); - initializeParams.parameterBufferSize = SCE_GXM_DEFAULT_PARAMETER_BUFFER_SIZE; + initializeParams.flags = 0; + initializeParams.displayQueueMaxPendingCount = VITA_GXM_PENDING_SWAPS; + initializeParams.displayQueueCallback = display_callback; + initializeParams.displayQueueCallbackDataSize = sizeof(VITA_GXM_DisplayData); + initializeParams.parameterBufferSize = SCE_GXM_DEFAULT_PARAMETER_BUFFER_SIZE; sceGxmInitialize(&initializeParams); } @@ -1211,11 +1159,10 @@ void gxm_minimal_term_for_common_dialog(void) void gxm_init_for_common_dialog(void) { - for (int i = 0; i < VITA_GXM_BUFFERS; i += 1) - { + for (int i = 0; i < VITA_GXM_BUFFERS; i += 1) { buffer_for_common_dialog[i].displayData.wait_vblank = SDL_TRUE; buffer_for_common_dialog[i].displayData.address = vita_mem_alloc( - SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW, + SCE_KERNEL_MEMBLOCK_TYPE_USER_MAIN_PHYCONT_NC_RW, 4 * VITA_GXM_SCREEN_STRIDE * VITA_GXM_SCREEN_HEIGHT, SCE_GXM_COLOR_SURFACE_ALIGNMENT, SCE_GXM_MEMORY_ATTRIB_READ | SCE_GXM_MEMORY_ATTRIB_WRITE, @@ -1229,8 +1176,7 @@ void gxm_init_for_common_dialog(void) VITA_GXM_SCREEN_WIDTH, VITA_GXM_SCREEN_HEIGHT, VITA_GXM_SCREEN_STRIDE, - buffer_for_common_dialog[i].displayData.address - ); + buffer_for_common_dialog[i].displayData.address); sceGxmSyncObjectCreate(&buffer_for_common_dialog[i].sync); } sceGxmDisplayQueueFinish(); @@ -1240,10 +1186,10 @@ void gxm_swap_for_common_dialog(void) { SceCommonDialogUpdateParam updateParam; SDL_zero(updateParam); - updateParam.renderTarget.colorFormat = VITA_GXM_PIXEL_FORMAT; - updateParam.renderTarget.surfaceType = SCE_GXM_COLOR_SURFACE_LINEAR; - updateParam.renderTarget.width = VITA_GXM_SCREEN_WIDTH; - updateParam.renderTarget.height = VITA_GXM_SCREEN_HEIGHT; + updateParam.renderTarget.colorFormat = VITA_GXM_PIXEL_FORMAT; + updateParam.renderTarget.surfaceType = SCE_GXM_COLOR_SURFACE_LINEAR; + updateParam.renderTarget.width = VITA_GXM_SCREEN_WIDTH; + updateParam.renderTarget.height = VITA_GXM_SCREEN_HEIGHT; updateParam.renderTarget.strideInPixels = VITA_GXM_SCREEN_STRIDE; updateParam.renderTarget.colorSurfaceData = buffer_for_common_dialog[back_buffer_index_for_common_dialog].displayData.address; @@ -1260,8 +1206,7 @@ void gxm_swap_for_common_dialog(void) void gxm_term_for_common_dialog(void) { sceGxmDisplayQueueFinish(); - for (int i = 0; i < VITA_GXM_BUFFERS; i += 1) - { + for (int i = 0; i < VITA_GXM_BUFFERS; i += 1) { vita_mem_free(buffer_for_common_dialog[i].uid); sceGxmSyncObjectDestroy(buffer_for_common_dialog[i].sync); } diff --git a/src/render/vitagxm/SDL_render_vita_gxm_tools.h b/src/render/vitagxm/SDL_render_vita_gxm_tools.h index 67659889dcf3c..6ee781e6522fd 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_tools.h +++ b/src/render/vitagxm/SDL_render_vita_gxm_tools.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,8 +36,7 @@ #include "SDL_render_vita_gxm_types.h" -void -init_orthographic_matrix(float *m, float left, float right, float bottom, float top, float near, float far); +void init_orthographic_matrix(float *m, float left, float right, float bottom, float top, float near, float far); void *pool_malloc(VITA_GXM_RenderData *data, unsigned int size); void *pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment); diff --git a/src/render/vitagxm/SDL_render_vita_gxm_types.h b/src/render/vitagxm/SDL_render_vita_gxm_types.h index c5cbf5898b66f..d796403752716 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_types.h +++ b/src/render/vitagxm/SDL_render_vita_gxm_types.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,35 +37,38 @@ #include -#define VITA_GXM_SCREEN_WIDTH 960 -#define VITA_GXM_SCREEN_HEIGHT 544 -#define VITA_GXM_SCREEN_STRIDE 960 +#define VITA_GXM_SCREEN_WIDTH 960 +#define VITA_GXM_SCREEN_HEIGHT 544 +#define VITA_GXM_SCREEN_STRIDE 960 -#define VITA_GXM_COLOR_FORMAT SCE_GXM_COLOR_FORMAT_A8B8G8R8 -#define VITA_GXM_PIXEL_FORMAT SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 +#define VITA_GXM_COLOR_FORMAT SCE_GXM_COLOR_FORMAT_A8B8G8R8 +#define VITA_GXM_PIXEL_FORMAT SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 -#define VITA_GXM_BUFFERS 3 -#define VITA_GXM_PENDING_SWAPS 2 -#define VITA_GXM_POOL_SIZE 2 * 1024 * 1024 +#define VITA_GXM_BUFFERS 3 +#define VITA_GXM_PENDING_SWAPS 2 +#define VITA_GXM_POOL_SIZE 2 * 1024 * 1024 typedef struct { - void *address; - Uint8 wait_vblank; + void *address; + Uint8 wait_vblank; } VITA_GXM_DisplayData; -typedef struct clear_vertex { +typedef struct clear_vertex +{ float x; float y; } clear_vertex; -typedef struct color_vertex { +typedef struct color_vertex +{ float x; float y; SDL_Color color; } color_vertex; -typedef struct texture_vertex { +typedef struct texture_vertex +{ float x; float y; float u; @@ -73,7 +76,8 @@ typedef struct texture_vertex { SDL_Color color; } texture_vertex; -typedef struct gxm_texture { +typedef struct gxm_texture +{ SceGxmTexture gxm_tex; SceUID data_UID; SceGxmRenderTarget *gxm_rendertarget; @@ -83,12 +87,14 @@ typedef struct gxm_texture { SDL_bool cdram; } gxm_texture; -typedef struct fragment_programs { +typedef struct fragment_programs +{ SceGxmFragmentProgram *color; SceGxmFragmentProgram *texture; } fragment_programs; -typedef struct blend_fragment_programs { +typedef struct blend_fragment_programs +{ fragment_programs blend_mode_none; fragment_programs blend_mode_blend; fragment_programs blend_mode_add; @@ -100,6 +106,7 @@ typedef struct { SDL_Rect viewport; SDL_bool viewport_dirty; + SDL_bool viewport_is_set; SDL_Texture *texture; SDL_Texture *target; SDL_Color color; @@ -119,13 +126,13 @@ typedef struct typedef struct { - SDL_bool initialized; - SDL_bool drawing; + SDL_bool initialized; + SDL_bool drawing; - unsigned int psm; - unsigned int bpp; + unsigned int psm; + unsigned int bpp; - int currentBlendMode; + int currentBlendMode; VITA_GXM_DisplayData displayData; @@ -150,12 +157,12 @@ typedef struct unsigned int backBufferIndex; unsigned int frontBufferIndex; - void* pool_addr[2]; + void *pool_addr[2]; SceUID poolUid[2]; unsigned int pool_index; unsigned int current_pool; - float ortho_matrix[4*4]; + float ortho_matrix[4 * 4]; SceGxmVertexProgram *colorVertexProgram; SceGxmFragmentProgram *colorFragmentProgram; @@ -194,13 +201,13 @@ typedef struct typedef struct { - gxm_texture *tex; + gxm_texture *tex; unsigned int pitch; unsigned int w; unsigned int h; float wscale; - SDL_bool yuv; - SDL_bool nv12; + SDL_bool yuv; + SDL_bool nv12; } VITA_GXM_TextureData; #endif /* SDL_RENDER_VITA_GXM_TYPES_H */ diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index 6db4c633f8ef4..ced1904b7d220 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "SDL_events.h" #include "SDL_syssensor.h" -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED #include "../events/SDL_events_c.h" #endif @@ -51,39 +51,31 @@ static SDL_SensorDriver *SDL_sensor_drivers[] = { &SDL_DUMMY_SensorDriver #endif }; -static SDL_Sensor *SDL_sensors = NULL; -static SDL_bool SDL_updating_sensor = SDL_FALSE; static SDL_mutex *SDL_sensor_lock = NULL; /* This needs to support recursive locks */ -static SDL_atomic_t SDL_next_sensor_instance_id; +static SDL_Sensor *SDL_sensors SDL_GUARDED_BY(SDL_sensor_lock) = NULL; +static SDL_atomic_t SDL_next_sensor_instance_id SDL_GUARDED_BY(SDL_sensor_lock); +static SDL_bool SDL_updating_sensor SDL_GUARDED_BY(SDL_sensor_lock) = SDL_FALSE; -void -SDL_LockSensors(void) +void SDL_LockSensors(void) SDL_ACQUIRE(SDL_sensor_lock) { - if (SDL_sensor_lock) { - SDL_LockMutex(SDL_sensor_lock); - } + SDL_LockMutex(SDL_sensor_lock); } -void -SDL_UnlockSensors(void) +void SDL_UnlockSensors(void) SDL_RELEASE(SDL_sensor_lock) { - if (SDL_sensor_lock) { - SDL_UnlockMutex(SDL_sensor_lock); - } + SDL_UnlockMutex(SDL_sensor_lock); } - -int -SDL_SensorInit(void) +int SDL_SensorInit(void) { int i, status; /* Create the sensor list lock */ - if (!SDL_sensor_lock) { + if (SDL_sensor_lock == NULL) { SDL_sensor_lock = SDL_CreateMutex(); } -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_InitSubSystem(SDL_INIT_EVENTS) < 0) { return -1; } @@ -101,8 +93,7 @@ SDL_SensorInit(void) /* * Count the number of sensors attached to the system */ -int -SDL_NumSensors(void) +int SDL_NumSensors(void) { int i, total_sensors = 0; SDL_LockSensors(); @@ -117,7 +108,7 @@ SDL_NumSensors(void) * Return the next available sensor instance ID * This may be called by drivers from multiple threads, unprotected by any locks */ -SDL_SensorID SDL_GetNextSensorInstanceID() +SDL_SensorID SDL_GetNextSensorInstanceID(void) { return SDL_AtomicIncRef(&SDL_next_sensor_instance_id); } @@ -126,8 +117,7 @@ SDL_SensorID SDL_GetNextSensorInstanceID() * Get the driver and device index for an API device index * This should be called while the sensor lock is held, to prevent another thread from updating the list */ -static SDL_bool -SDL_GetDriverAndSensorIndex(int device_index, SDL_SensorDriver **driver, int *driver_index) +static SDL_bool SDL_GetDriverAndSensorIndex(int device_index, SDL_SensorDriver **driver, int *driver_index) { int i, num_sensors, total_sensors = 0; @@ -151,8 +141,7 @@ SDL_GetDriverAndSensorIndex(int device_index, SDL_SensorDriver **driver, int *dr /* * Get the implementation dependent name of a sensor */ -const char * -SDL_SensorGetDeviceName(int device_index) +const char *SDL_SensorGetDeviceName(int device_index) { SDL_SensorDriver *driver; const char *name = NULL; @@ -167,8 +156,7 @@ SDL_SensorGetDeviceName(int device_index) return name; } -SDL_SensorType -SDL_SensorGetDeviceType(int device_index) +SDL_SensorType SDL_SensorGetDeviceType(int device_index) { SDL_SensorDriver *driver; SDL_SensorType type = SDL_SENSOR_INVALID; @@ -182,8 +170,7 @@ SDL_SensorGetDeviceType(int device_index) return type; } -int -SDL_SensorGetDeviceNonPortableType(int device_index) +int SDL_SensorGetDeviceNonPortableType(int device_index) { SDL_SensorDriver *driver; int type = -1; @@ -197,8 +184,7 @@ SDL_SensorGetDeviceNonPortableType(int device_index) return type; } -SDL_SensorID -SDL_SensorGetDeviceInstanceID(int device_index) +SDL_SensorID SDL_SensorGetDeviceInstanceID(int device_index) { SDL_SensorDriver *driver; SDL_SensorID instance_id = -1; @@ -219,8 +205,7 @@ SDL_SensorGetDeviceInstanceID(int device_index) * * This function returns a sensor identifier, or NULL if an error occurred. */ -SDL_Sensor * -SDL_SensorOpen(int device_index) +SDL_Sensor *SDL_SensorOpen(int device_index) { SDL_SensorDriver *driver; SDL_SensorID instance_id; @@ -242,17 +227,17 @@ SDL_SensorOpen(int device_index) instance_id = driver->GetDeviceInstanceID(device_index); while (sensorlist) { if (instance_id == sensorlist->instance_id) { - sensor = sensorlist; - ++sensor->ref_count; - SDL_UnlockSensors(); - return sensor; + sensor = sensorlist; + ++sensor->ref_count; + SDL_UnlockSensors(); + return sensor; } sensorlist = sensorlist->next; } /* Create and initialize the sensor */ - sensor = (SDL_Sensor *) SDL_calloc(sizeof(*sensor), 1); - if (sensor == NULL) { + sensor = (SDL_Sensor *)SDL_calloc(sizeof(*sensor), 1); + if (!sensor) { SDL_OutOfMemory(); SDL_UnlockSensors(); return NULL; @@ -291,8 +276,7 @@ SDL_SensorOpen(int device_index) /* * Find the SDL_Sensor that owns this instance id */ -SDL_Sensor * -SDL_SensorFromInstanceID(SDL_SensorID instance_id) +SDL_Sensor *SDL_SensorFromInstanceID(SDL_SensorID instance_id) { SDL_Sensor *sensor; @@ -309,12 +293,11 @@ SDL_SensorFromInstanceID(SDL_SensorID instance_id) /* * Checks to make sure the sensor is valid. */ -static int -SDL_PrivateSensorValid(SDL_Sensor *sensor) +static int SDL_PrivateSensorValid(SDL_Sensor *sensor) { int valid; - if (sensor == NULL) { + if (!sensor) { SDL_SetError("Sensor hasn't been opened yet"); valid = 0; } else { @@ -327,8 +310,7 @@ SDL_PrivateSensorValid(SDL_Sensor *sensor) /* * Get the friendly name of this sensor */ -const char * -SDL_SensorGetName(SDL_Sensor *sensor) +const char *SDL_SensorGetName(SDL_Sensor *sensor) { if (!SDL_PrivateSensorValid(sensor)) { return NULL; @@ -340,8 +322,7 @@ SDL_SensorGetName(SDL_Sensor *sensor) /* * Get the type of this sensor */ -SDL_SensorType -SDL_SensorGetType(SDL_Sensor *sensor) +SDL_SensorType SDL_SensorGetType(SDL_Sensor *sensor) { if (!SDL_PrivateSensorValid(sensor)) { return SDL_SENSOR_INVALID; @@ -353,8 +334,7 @@ SDL_SensorGetType(SDL_Sensor *sensor) /* * Get the platform dependent type of this sensor */ -int -SDL_SensorGetNonPortableType(SDL_Sensor *sensor) +int SDL_SensorGetNonPortableType(SDL_Sensor *sensor) { if (!SDL_PrivateSensorValid(sensor)) { return -1; @@ -366,8 +346,7 @@ SDL_SensorGetNonPortableType(SDL_Sensor *sensor) /* * Get the instance id for this opened sensor */ -SDL_SensorID -SDL_SensorGetInstanceID(SDL_Sensor *sensor) +SDL_SensorID SDL_SensorGetInstanceID(SDL_Sensor *sensor) { if (!SDL_PrivateSensorValid(sensor)) { return -1; @@ -379,8 +358,7 @@ SDL_SensorGetInstanceID(SDL_Sensor *sensor) /* * Get the current state of this sensor */ -int -SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values) +int SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values) { return SDL_SensorGetDataWithTimestamp(sensor, NULL, data, num_values); } @@ -388,15 +366,14 @@ SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values) /* * Get the current state of this sensor */ -int -SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values) +int SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values) { if (!SDL_PrivateSensorValid(sensor)) { return -1; } num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); - SDL_memcpy(data, sensor->data, num_values*sizeof(*data)); + SDL_memcpy(data, sensor->data, num_values * sizeof(*data)); if (timestamp) { *timestamp = sensor->timestamp_us; } @@ -406,8 +383,7 @@ SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *dat /* * Close a sensor previously opened with SDL_SensorOpen() */ -void -SDL_SensorClose(SDL_Sensor *sensor) +void SDL_SensorClose(SDL_Sensor *sensor) { SDL_Sensor *sensorlist; SDL_Sensor *sensorlistprev; @@ -456,16 +432,15 @@ SDL_SensorClose(SDL_Sensor *sensor) SDL_UnlockSensors(); } -void -SDL_SensorQuit(void) +void SDL_SensorQuit(void) { int i; + SDL_LockSensors(); + /* Make sure we're not getting called in the middle of updating sensors */ SDL_assert(!SDL_updating_sensor); - SDL_LockSensors(); - /* Stop the event polling */ while (SDL_sensors) { SDL_sensors->ref_count = 1; @@ -474,12 +449,12 @@ SDL_SensorQuit(void) /* Quit the sensor setup */ for (i = 0; i < SDL_arraysize(SDL_sensor_drivers); ++i) { - SDL_sensor_drivers[i]->Quit(); + SDL_sensor_drivers[i]->Quit(); } SDL_UnlockSensors(); -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED SDL_QuitSubSystem(SDL_INIT_EVENTS); #endif @@ -489,11 +464,9 @@ SDL_SensorQuit(void) } } - /* These are global for SDL_syssensor.c and SDL_events.c */ -int -SDL_PrivateSensorUpdate(SDL_Sensor *sensor, Uint64 timestamp_us, float *data, int num_values) +int SDL_PrivateSensorUpdate(SDL_Sensor *sensor, Uint64 timestamp_us, float *data, int num_values) { int posted; @@ -501,19 +474,19 @@ SDL_PrivateSensorUpdate(SDL_Sensor *sensor, Uint64 timestamp_us, float *data, in /* Update internal sensor state */ num_values = SDL_min(num_values, SDL_arraysize(sensor->data)); - SDL_memcpy(sensor->data, data, num_values*sizeof(*data)); + SDL_memcpy(sensor->data, data, num_values * sizeof(*data)); sensor->timestamp_us = timestamp_us; /* Post the event, if desired */ posted = 0; -#if !SDL_EVENTS_DISABLED +#ifndef SDL_EVENTS_DISABLED if (SDL_GetEventState(SDL_SENSORUPDATE) == SDL_ENABLE) { SDL_Event event; event.type = SDL_SENSORUPDATE; event.sensor.which = sensor->instance_id; num_values = SDL_min(num_values, SDL_arraysize(event.sensor.data)); SDL_memset(event.sensor.data, 0, sizeof(event.sensor.data)); - SDL_memcpy(event.sensor.data, data, num_values*sizeof(*data)); + SDL_memcpy(event.sensor.data, data, num_values * sizeof(*data)); event.sensor.timestamp_us = timestamp_us; posted = SDL_PushEvent(&event) == 1; } @@ -521,8 +494,7 @@ SDL_PrivateSensorUpdate(SDL_Sensor *sensor, Uint64 timestamp_us, float *data, in return posted; } -void -SDL_SensorUpdate(void) +void SDL_SensorUpdate(void) { int i; SDL_Sensor *sensor, *next; @@ -541,15 +513,10 @@ SDL_SensorUpdate(void) SDL_updating_sensor = SDL_TRUE; - /* Make sure the list is unlocked while dispatching events to prevent application deadlocks */ - SDL_UnlockSensors(); - for (sensor = SDL_sensors; sensor; sensor = sensor->next) { sensor->driver->Update(sensor); } - SDL_LockSensors(); - SDL_updating_sensor = SDL_FALSE; /* If any sensors were closed while updating, free them here */ diff --git a/src/sensor/SDL_sensor_c.h b/src/sensor/SDL_sensor_c.h index 92b93fe811998..8d049efea930a 100644 --- a/src/sensor/SDL_sensor_c.h +++ b/src/sensor/SDL_sensor_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/sensor/SDL_syssensor.h b/src/sensor/SDL_syssensor.h index 30d44009ab0b2..67012abb7e72c 100644 --- a/src/sensor/SDL_syssensor.h +++ b/src/sensor/SDL_syssensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,21 +32,21 @@ /* The SDL sensor structure */ struct _SDL_Sensor { - SDL_SensorID instance_id; /* Device instance, monotonically increasing from 0 */ - char *name; /* Sensor name - system dependent */ - SDL_SensorType type; /* Type of the sensor */ - int non_portable_type; /* Platform dependent type of the sensor */ + SDL_SensorID instance_id; /* Device instance, monotonically increasing from 0 */ + char *name; /* Sensor name - system dependent */ + SDL_SensorType type; /* Type of the sensor */ + int non_portable_type; /* Platform dependent type of the sensor */ - Uint64 timestamp_us; /* The timestamp of the last sensor update */ - float data[16]; /* The current state of the sensor */ + Uint64 timestamp_us; /* The timestamp of the last sensor update */ + float data[16]; /* The current state of the sensor */ struct _SDL_SensorDriver *driver; - struct sensor_hwdata *hwdata; /* Driver dependent information */ + struct sensor_hwdata *hwdata; /* Driver dependent information */ - int ref_count; /* Reference count for multiple opens */ + int ref_count; /* Reference count for multiple opens */ - struct _SDL_Sensor *next; /* pointer to next sensor we have allocated */ + struct _SDL_Sensor *next; /* pointer to next sensor we have allocated */ }; typedef struct _SDL_SensorDriver @@ -79,17 +79,17 @@ typedef struct _SDL_SensorDriver The sensor to open is specified by the device index. It returns 0, or -1 if there is an error. */ - int (*Open)(SDL_Sensor * sensor, int device_index); + int (*Open)(SDL_Sensor *sensor, int device_index); /* Function to update the state of a sensor - called as a device poll. * This function shouldn't update the sensor structure directly, * but instead should call SDL_PrivateSensorUpdate() to deliver events * and update sensor device state. */ - void (*Update)(SDL_Sensor * sensor); + void (*Update)(SDL_Sensor *sensor); /* Function to close a sensor after use */ - void (*Close)(SDL_Sensor * sensor); + void (*Close)(SDL_Sensor *sensor); /* Function to perform any system-specific sensor related cleanup */ void (*Quit)(void); diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c index 27fb04cdfa0cc..ce69c110ffc13 100644 --- a/src/sensor/android/SDL_androidsensor.c +++ b/src/sensor/android/SDL_androidsensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,10 +32,9 @@ #include "SDL_androidsensor.h" #include "../SDL_syssensor.h" #include "../SDL_sensor_c.h" -//#include "../../core/android/SDL_android.h" #ifndef LOOPER_ID_USER -#define LOOPER_ID_USER 3 +#define LOOPER_ID_USER 3 #endif typedef struct @@ -44,13 +43,12 @@ typedef struct SDL_SensorID instance_id; } SDL_AndroidSensor; -static ASensorManager* SDL_sensor_manager; -static ALooper* SDL_sensor_looper; +static ASensorManager *SDL_sensor_manager; +static ALooper *SDL_sensor_looper; static SDL_AndroidSensor *SDL_sensors; static int SDL_sensors_count; -static int -SDL_ANDROID_SensorInit(void) +static int SDL_ANDROID_SensorInit(void) { int i, sensors_count; ASensorList sensors; @@ -85,25 +83,21 @@ SDL_ANDROID_SensorInit(void) return 0; } -static int -SDL_ANDROID_SensorGetCount(void) +static int SDL_ANDROID_SensorGetCount(void) { return SDL_sensors_count; } -static void -SDL_ANDROID_SensorDetect(void) +static void SDL_ANDROID_SensorDetect(void) { } -static const char * -SDL_ANDROID_SensorGetDeviceName(int device_index) +static const char *SDL_ANDROID_SensorGetDeviceName(int device_index) { return ASensor_getName(SDL_sensors[device_index].asensor); } -static SDL_SensorType -SDL_ANDROID_SensorGetDeviceType(int device_index) +static SDL_SensorType SDL_ANDROID_SensorGetDeviceType(int device_index) { switch (ASensor_getType(SDL_sensors[device_index].asensor)) { case 0x00000001: @@ -115,26 +109,23 @@ SDL_ANDROID_SensorGetDeviceType(int device_index) } } -static int -SDL_ANDROID_SensorGetDeviceNonPortableType(int device_index) +static int SDL_ANDROID_SensorGetDeviceNonPortableType(int device_index) { return ASensor_getType(SDL_sensors[device_index].asensor); } -static SDL_SensorID -SDL_ANDROID_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID SDL_ANDROID_SensorGetDeviceInstanceID(int device_index) { return SDL_sensors[device_index].instance_id; } -static int -SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index) +static int SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index) { struct sensor_hwdata *hwdata; int delay_us, min_delay_us; hwdata = (struct sensor_hwdata *)SDL_calloc(1, sizeof(*hwdata)); - if (hwdata == NULL) { + if (!hwdata) { return SDL_OutOfMemory(); } @@ -163,15 +154,14 @@ SDL_ANDROID_SensorOpen(SDL_Sensor *sensor, int device_index) sensor->hwdata = hwdata; return 0; } - -static void -SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor) + +static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor) { int events; ASensorEvent event; - struct android_poll_source* source; + struct android_poll_source *source; - if (ALooper_pollAll(0, NULL, &events, (void**)&source) == LOOPER_ID_USER) { + if (ALooper_pollOnce(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) { SDL_zero(event); while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) { SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data)); @@ -179,8 +169,7 @@ SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor) } } -static void -SDL_ANDROID_SensorClose(SDL_Sensor *sensor) +static void SDL_ANDROID_SensorClose(SDL_Sensor *sensor) { if (sensor->hwdata) { ASensorEventQueue_disableSensor(sensor->hwdata->eventqueue, sensor->hwdata->asensor); @@ -190,8 +179,7 @@ SDL_ANDROID_SensorClose(SDL_Sensor *sensor) } } -static void -SDL_ANDROID_SensorQuit(void) +static void SDL_ANDROID_SensorQuit(void) { if (SDL_sensors) { SDL_free(SDL_sensors); @@ -200,8 +188,7 @@ SDL_ANDROID_SensorQuit(void) } } -SDL_SensorDriver SDL_ANDROID_SensorDriver = -{ +SDL_SensorDriver SDL_ANDROID_SensorDriver = { SDL_ANDROID_SensorInit, SDL_ANDROID_SensorGetCount, SDL_ANDROID_SensorDetect, diff --git a/src/sensor/android/SDL_androidsensor.h b/src/sensor/android/SDL_androidsensor.h index 4fc5e6526859a..08eb077372ca5 100644 --- a/src/sensor/android/SDL_androidsensor.h +++ b/src/sensor/android/SDL_androidsensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,5 +27,4 @@ struct sensor_hwdata ASensorEventQueue *eventqueue; }; - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/sensor/coremotion/SDL_coremotionsensor.h b/src/sensor/coremotion/SDL_coremotionsensor.h index 664bf3bf19027..3cfad6413b0fa 100644 --- a/src/sensor/coremotion/SDL_coremotionsensor.h +++ b/src/sensor/coremotion/SDL_coremotionsensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,5 +26,4 @@ struct sensor_hwdata float data[3]; }; - /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/sensor/coremotion/SDL_coremotionsensor.m b/src/sensor/coremotion/SDL_coremotionsensor.m index 735ecf54dc455..f4983b90be1df 100644 --- a/src/sensor/coremotion/SDL_coremotionsensor.m +++ b/src/sensor/coremotion/SDL_coremotionsensor.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,8 +42,7 @@ static SDL_CoreMotionSensor *SDL_sensors; static int SDL_sensors_count; -static int -SDL_COREMOTION_SensorInit(void) +static int SDL_COREMOTION_SensorInit(void) { int i, sensors_count = 0; @@ -80,19 +79,16 @@ return 0; } -static int -SDL_COREMOTION_SensorGetCount(void) +static int SDL_COREMOTION_SensorGetCount(void) { return SDL_sensors_count; } -static void -SDL_COREMOTION_SensorDetect(void) +static void SDL_COREMOTION_SensorDetect(void) { } -static const char * -SDL_COREMOTION_SensorGetDeviceName(int device_index) +static const char *SDL_COREMOTION_SensorGetDeviceName(int device_index) { switch (SDL_sensors[device_index].type) { case SDL_SENSOR_ACCEL: @@ -104,26 +100,22 @@ } } -static SDL_SensorType -SDL_COREMOTION_SensorGetDeviceType(int device_index) +static SDL_SensorType SDL_COREMOTION_SensorGetDeviceType(int device_index) { return SDL_sensors[device_index].type; } -static int -SDL_COREMOTION_SensorGetDeviceNonPortableType(int device_index) +static int SDL_COREMOTION_SensorGetDeviceNonPortableType(int device_index) { return SDL_sensors[device_index].type; } -static SDL_SensorID -SDL_COREMOTION_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID SDL_COREMOTION_SensorGetDeviceInstanceID(int device_index) { return SDL_sensors[device_index].instance_id; } -static int -SDL_COREMOTION_SensorOpen(SDL_Sensor *sensor, int device_index) +static int SDL_COREMOTION_SensorOpen(SDL_Sensor *sensor, int device_index) { struct sensor_hwdata *hwdata; @@ -133,8 +125,7 @@ } sensor->hwdata = hwdata; - switch (sensor->type) - { + switch (sensor->type) { case SDL_SENSOR_ACCEL: [SDL_motion_manager startAccelerometerUpdates]; break; @@ -146,55 +137,49 @@ } return 0; } - -static void -SDL_COREMOTION_SensorUpdate(SDL_Sensor *sensor) + +static void SDL_COREMOTION_SensorUpdate(SDL_Sensor *sensor) { - switch (sensor->type) - { + switch (sensor->type) { case SDL_SENSOR_ACCEL: - { - CMAccelerometerData *accelerometerData = SDL_motion_manager.accelerometerData; - if (accelerometerData) { - CMAcceleration acceleration = accelerometerData.acceleration; - float data[3]; - data[0] = -acceleration.x * SDL_STANDARD_GRAVITY; - data[1] = -acceleration.y * SDL_STANDARD_GRAVITY; - data[2] = -acceleration.z * SDL_STANDARD_GRAVITY; - if (SDL_memcmp(data, sensor->hwdata->data, sizeof(data)) != 0) { - SDL_PrivateSensorUpdate(sensor, 0, data, SDL_arraysize(data)); - SDL_memcpy(sensor->hwdata->data, data, sizeof(data)); - } + { + CMAccelerometerData *accelerometerData = SDL_motion_manager.accelerometerData; + if (accelerometerData) { + CMAcceleration acceleration = accelerometerData.acceleration; + float data[3]; + data[0] = -acceleration.x * SDL_STANDARD_GRAVITY; + data[1] = -acceleration.y * SDL_STANDARD_GRAVITY; + data[2] = -acceleration.z * SDL_STANDARD_GRAVITY; + if (SDL_memcmp(data, sensor->hwdata->data, sizeof(data)) != 0) { + SDL_PrivateSensorUpdate(sensor, 0, data, SDL_arraysize(data)); + SDL_memcpy(sensor->hwdata->data, data, sizeof(data)); } } - break; + } break; case SDL_SENSOR_GYRO: - { - CMGyroData *gyroData = SDL_motion_manager.gyroData; - if (gyroData) { - CMRotationRate rotationRate = gyroData.rotationRate; - float data[3]; - data[0] = rotationRate.x; - data[1] = rotationRate.y; - data[2] = rotationRate.z; - if (SDL_memcmp(data, sensor->hwdata->data, sizeof(data)) != 0) { - SDL_PrivateSensorUpdate(sensor, 0, data, SDL_arraysize(data)); - SDL_memcpy(sensor->hwdata->data, data, sizeof(data)); - } + { + CMGyroData *gyroData = SDL_motion_manager.gyroData; + if (gyroData) { + CMRotationRate rotationRate = gyroData.rotationRate; + float data[3]; + data[0] = rotationRate.x; + data[1] = rotationRate.y; + data[2] = rotationRate.z; + if (SDL_memcmp(data, sensor->hwdata->data, sizeof(data)) != 0) { + SDL_PrivateSensorUpdate(sensor, 0, data, SDL_arraysize(data)); + SDL_memcpy(sensor->hwdata->data, data, sizeof(data)); } } - break; + } break; default: break; } } -static void -SDL_COREMOTION_SensorClose(SDL_Sensor *sensor) +static void SDL_COREMOTION_SensorClose(SDL_Sensor *sensor) { if (sensor->hwdata) { - switch (sensor->type) - { + switch (sensor->type) { case SDL_SENSOR_ACCEL: [SDL_motion_manager stopAccelerometerUpdates]; break; @@ -209,13 +194,11 @@ } } -static void -SDL_COREMOTION_SensorQuit(void) +static void SDL_COREMOTION_SensorQuit(void) { } -SDL_SensorDriver SDL_COREMOTION_SensorDriver = -{ +SDL_SensorDriver SDL_COREMOTION_SensorDriver = { SDL_COREMOTION_SensorInit, SDL_COREMOTION_SensorGetCount, SDL_COREMOTION_SensorDetect, diff --git a/src/sensor/dummy/SDL_dummysensor.c b/src/sensor/dummy/SDL_dummysensor.c index 469d35dc11a3a..d4b13fd1fe59b 100644 --- a/src/sensor/dummy/SDL_dummysensor.c +++ b/src/sensor/dummy/SDL_dummysensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,70 +29,58 @@ #include "SDL_dummysensor.h" #include "../SDL_syssensor.h" -static int -SDL_DUMMY_SensorInit(void) +static int SDL_DUMMY_SensorInit(void) { return 0; } -static int -SDL_DUMMY_SensorGetCount(void) +static int SDL_DUMMY_SensorGetCount(void) { return 0; } -static void -SDL_DUMMY_SensorDetect(void) +static void SDL_DUMMY_SensorDetect(void) { } -static const char * -SDL_DUMMY_SensorGetDeviceName(int device_index) +static const char *SDL_DUMMY_SensorGetDeviceName(int device_index) { return NULL; } -static SDL_SensorType -SDL_DUMMY_SensorGetDeviceType(int device_index) +static SDL_SensorType SDL_DUMMY_SensorGetDeviceType(int device_index) { return SDL_SENSOR_INVALID; } -static int -SDL_DUMMY_SensorGetDeviceNonPortableType(int device_index) +static int SDL_DUMMY_SensorGetDeviceNonPortableType(int device_index) { return -1; } -static SDL_SensorID -SDL_DUMMY_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID SDL_DUMMY_SensorGetDeviceInstanceID(int device_index) { return -1; } -static int -SDL_DUMMY_SensorOpen(SDL_Sensor *sensor, int device_index) +static int SDL_DUMMY_SensorOpen(SDL_Sensor *sensor, int device_index) { return SDL_Unsupported(); } - -static void -SDL_DUMMY_SensorUpdate(SDL_Sensor *sensor) + +static void SDL_DUMMY_SensorUpdate(SDL_Sensor *sensor) { } -static void -SDL_DUMMY_SensorClose(SDL_Sensor *sensor) +static void SDL_DUMMY_SensorClose(SDL_Sensor *sensor) { } -static void -SDL_DUMMY_SensorQuit(void) +static void SDL_DUMMY_SensorQuit(void) { } -SDL_SensorDriver SDL_DUMMY_SensorDriver = -{ +SDL_SensorDriver SDL_DUMMY_SensorDriver = { SDL_DUMMY_SensorInit, SDL_DUMMY_SensorGetCount, SDL_DUMMY_SensorDetect, diff --git a/src/sensor/dummy/SDL_dummysensor.h b/src/sensor/dummy/SDL_dummysensor.h index 1f35136293bd5..a255a53fc18d4 100644 --- a/src/sensor/dummy/SDL_dummysensor.h +++ b/src/sensor/dummy/SDL_dummysensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/sensor/n3ds/SDL_n3dssensor.c b/src/sensor/n3ds/SDL_n3dssensor.c index ea22ef247f1b7..08af044d8db48 100644 --- a/src/sensor/n3ds/SDL_n3dssensor.c +++ b/src/sensor/n3ds/SDL_n3dssensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -48,8 +48,7 @@ IsDeviceIndexValid(int device_index) return device_index >= 0 && device_index < N3DS_SENSOR_COUNT; } -static int -N3DS_SensorInit(void) +static int N3DS_SensorInit(void) { if (InitN3DSServices() < 0) { return SDL_SetError("Failed to initialise N3DS services"); @@ -79,19 +78,16 @@ InitN3DSServices(void) return 0; } -static int -N3DS_SensorGetCount(void) +static int N3DS_SensorGetCount(void) { return N3DS_SENSOR_COUNT; } -static void -N3DS_SensorDetect(void) +static void N3DS_SensorDetect(void) { } -static const char * -N3DS_SensorGetDeviceName(int device_index) +static const char *N3DS_SensorGetDeviceName(int device_index) { if (IsDeviceIndexValid(device_index)) { switch (N3DS_sensors[device_index].type) { @@ -107,8 +103,7 @@ N3DS_SensorGetDeviceName(int device_index) return NULL; } -static SDL_SensorType -N3DS_SensorGetDeviceType(int device_index) +static SDL_SensorType N3DS_SensorGetDeviceType(int device_index) { if (IsDeviceIndexValid(device_index)) { return N3DS_sensors[device_index].type; @@ -116,14 +111,12 @@ N3DS_SensorGetDeviceType(int device_index) return SDL_SENSOR_INVALID; } -static int -N3DS_SensorGetDeviceNonPortableType(int device_index) +static int N3DS_SensorGetDeviceNonPortableType(int device_index) { - return (int) N3DS_SensorGetDeviceType(device_index); + return (int)N3DS_SensorGetDeviceType(device_index); } -static SDL_SensorID -N3DS_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID N3DS_SensorGetDeviceInstanceID(int device_index) { if (IsDeviceIndexValid(device_index)) { return N3DS_sensors[device_index].instance_id; @@ -131,14 +124,12 @@ N3DS_SensorGetDeviceInstanceID(int device_index) return -1; } -static int -N3DS_SensorOpen(SDL_Sensor *sensor, int device_index) +static int N3DS_SensorOpen(SDL_Sensor *sensor, int device_index) { return 0; } -static void -N3DS_SensorUpdate(SDL_Sensor *sensor) +static void N3DS_SensorUpdate(SDL_Sensor *sensor) { switch (sensor->type) { case SDL_SENSOR_ACCEL: @@ -162,10 +153,10 @@ UpdateN3DSAccelerometer(SDL_Sensor *sensor) hidAccelRead(¤t_state); if (SDL_memcmp(&previous_state, ¤t_state, sizeof(accelVector)) != 0) { SDL_memcpy(&previous_state, ¤t_state, sizeof(accelVector)); - data[0] = (float) current_state.x * SDL_STANDARD_GRAVITY; - data[1] = (float) current_state.y * SDL_STANDARD_GRAVITY; - data[2] = (float) current_state.z * SDL_STANDARD_GRAVITY; - SDL_PrivateSensorUpdate(sensor, 0, data, sizeof data); + data[0] = (float)current_state.x * SDL_STANDARD_GRAVITY; + data[1] = (float)current_state.y * SDL_STANDARD_GRAVITY; + data[2] = (float)current_state.z * SDL_STANDARD_GRAVITY; + SDL_PrivateSensorUpdate(sensor, 0, data, sizeof(data)); } } @@ -179,20 +170,18 @@ UpdateN3DSGyroscope(SDL_Sensor *sensor) hidGyroRead(¤t_state); if (SDL_memcmp(&previous_state, ¤t_state, sizeof(angularRate)) != 0) { SDL_memcpy(&previous_state, ¤t_state, sizeof(angularRate)); - data[0] = (float) current_state.x; - data[1] = (float) current_state.y; - data[2] = (float) current_state.z; - SDL_PrivateSensorUpdate(sensor, 0, data, sizeof data); + data[0] = (float)current_state.x; + data[1] = (float)current_state.y; + data[2] = (float)current_state.z; + SDL_PrivateSensorUpdate(sensor, 0, data, sizeof(data)); } } -static void -N3DS_SensorClose(SDL_Sensor *sensor) +static void N3DS_SensorClose(SDL_Sensor *sensor) { } -static void -N3DS_SensorQuit(void) +static void N3DS_SensorQuit(void) { HIDUSER_DisableGyroscope(); HIDUSER_DisableAccelerometer(); diff --git a/src/sensor/vita/SDL_vitasensor.c b/src/sensor/vita/SDL_vitasensor.c index 3123f1623d1b8..a80c0c235eeb9 100644 --- a/src/sensor/vita/SDL_vitasensor.c +++ b/src/sensor/vita/SDL_vitasensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,8 +42,7 @@ typedef struct static SDL_VitaSensor *SDL_sensors; static int SDL_sensors_count; -static int -SDL_VITA_SensorInit(void) +static int SDL_VITA_SensorInit(void) { sceMotionReset(); sceMotionStartSampling(); @@ -67,36 +66,32 @@ SDL_VITA_SensorInit(void) return 0; } -static int -SDL_VITA_SensorGetCount(void) +static int SDL_VITA_SensorGetCount(void) { return SDL_sensors_count; } -static void -SDL_VITA_SensorDetect(void) +static void SDL_VITA_SensorDetect(void) { } -static const char * -SDL_VITA_SensorGetDeviceName(int device_index) +static const char *SDL_VITA_SensorGetDeviceName(int device_index) { if (device_index < SDL_sensors_count) { switch (SDL_sensors[device_index].type) { - case SDL_SENSOR_ACCEL: - return "Accelerometer"; - case SDL_SENSOR_GYRO: - return "Gyro"; - default: - return "Unknown"; + case SDL_SENSOR_ACCEL: + return "Accelerometer"; + case SDL_SENSOR_GYRO: + return "Gyro"; + default: + return "Unknown"; } } return NULL; } -static SDL_SensorType -SDL_VITA_SensorGetDeviceType(int device_index) +static SDL_SensorType SDL_VITA_SensorGetDeviceType(int device_index) { if (device_index < SDL_sensors_count) { return SDL_sensors[device_index].type; @@ -105,8 +100,7 @@ SDL_VITA_SensorGetDeviceType(int device_index) return SDL_SENSOR_INVALID; } -static int -SDL_VITA_SensorGetDeviceNonPortableType(int device_index) +static int SDL_VITA_SensorGetDeviceNonPortableType(int device_index) { if (device_index < SDL_sensors_count) { return SDL_sensors[device_index].type; @@ -114,8 +108,7 @@ SDL_VITA_SensorGetDeviceNonPortableType(int device_index) return -1; } -static SDL_SensorID -SDL_VITA_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID SDL_VITA_SensorGetDeviceInstanceID(int device_index) { if (device_index < SDL_sensors_count) { return SDL_sensors[device_index].instance_id; @@ -123,13 +116,12 @@ SDL_VITA_SensorGetDeviceInstanceID(int device_index) return -1; } -static int -SDL_VITA_SensorOpen(SDL_Sensor *sensor, int device_index) +static int SDL_VITA_SensorOpen(SDL_Sensor *sensor, int device_index) { struct sensor_hwdata *hwdata; hwdata = (struct sensor_hwdata *)SDL_calloc(1, sizeof(*hwdata)); - if (hwdata == NULL) { + if (!hwdata) { return SDL_OutOfMemory(); } sensor->hwdata = hwdata; @@ -137,23 +129,19 @@ SDL_VITA_SensorOpen(SDL_Sensor *sensor, int device_index) return 0; } -static void -SDL_VITA_SensorUpdate(SDL_Sensor *sensor) +static void SDL_VITA_SensorUpdate(SDL_Sensor *sensor) { int err = 0; SceMotionSensorState motionState[SCE_MOTION_MAX_NUM_STATES]; SDL_memset(motionState, 0, sizeof(motionState)); err = sceMotionGetSensorState(motionState, SCE_MOTION_MAX_NUM_STATES); - if (err != 0) - { + if (err != 0) { return; } - for (int i = 0; i < SCE_MOTION_MAX_NUM_STATES; i++) - { - if (sensor->hwdata->counter < motionState[i].counter) - { + for (int i = 0; i < SCE_MOTION_MAX_NUM_STATES; i++) { + if (sensor->hwdata->counter < motionState[i].counter) { unsigned int timestamp = motionState[i].timestamp; sensor->hwdata->counter = motionState[i].counter; @@ -172,46 +160,40 @@ SDL_VITA_SensorUpdate(SDL_Sensor *sensor) } sensor->hwdata->last_timestamp = timestamp; - switch (sensor->type) + switch (sensor->type) { + case SDL_SENSOR_ACCEL: { - case SDL_SENSOR_ACCEL: - { - float data[3]; - data[0] = motionState[i].accelerometer.x * SDL_STANDARD_GRAVITY; - data[1] = motionState[i].accelerometer.y * SDL_STANDARD_GRAVITY; - data[2] = motionState[i].accelerometer.z * SDL_STANDARD_GRAVITY; - SDL_PrivateSensorUpdate(sensor, sensor->hwdata->timestamp_us, data, SDL_arraysize(data)); - } - break; - case SDL_SENSOR_GYRO: - { - float data[3]; - data[0] = motionState[i].gyro.x; - data[1] = motionState[i].gyro.y; - data[2] = motionState[i].gyro.z; - SDL_PrivateSensorUpdate(sensor, sensor->hwdata->timestamp_us, data, SDL_arraysize(data)); - } - break; - default: + float data[3]; + data[0] = motionState[i].accelerometer.x * SDL_STANDARD_GRAVITY; + data[1] = motionState[i].accelerometer.y * SDL_STANDARD_GRAVITY; + data[2] = motionState[i].accelerometer.z * SDL_STANDARD_GRAVITY; + SDL_PrivateSensorUpdate(sensor, sensor->hwdata->timestamp_us, data, SDL_arraysize(data)); + } break; + case SDL_SENSOR_GYRO: + { + float data[3]; + data[0] = motionState[i].gyro.x; + data[1] = motionState[i].gyro.y; + data[2] = motionState[i].gyro.z; + SDL_PrivateSensorUpdate(sensor, sensor->hwdata->timestamp_us, data, SDL_arraysize(data)); + } break; + default: break; } } } } -static void -SDL_VITA_SensorClose(SDL_Sensor *sensor) +static void SDL_VITA_SensorClose(SDL_Sensor *sensor) { } -static void -SDL_VITA_SensorQuit(void) +static void SDL_VITA_SensorQuit(void) { sceMotionStopSampling(); } -SDL_SensorDriver SDL_VITA_SensorDriver = -{ +SDL_SensorDriver SDL_VITA_SensorDriver = { SDL_VITA_SensorInit, SDL_VITA_SensorGetCount, SDL_VITA_SensorDetect, diff --git a/src/sensor/vita/SDL_vitasensor.h b/src/sensor/vita/SDL_vitasensor.h index a7d6d295e73a6..794cc0cbbadea 100644 --- a/src/sensor/vita/SDL_vitasensor.h +++ b/src/sensor/vita/SDL_vitasensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/sensor/windows/SDL_windowssensor.c b/src/sensor/windows/SDL_windowssensor.c index b2edffce096f2..3c15dd349781e 100644 --- a/src/sensor/windows/SDL_windowssensor.c +++ b/src/sensor/windows/SDL_windowssensor.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -65,7 +65,7 @@ static SDL_Windows_Sensor *SDL_sensors; static int ConnectSensor(ISensor *sensor); static int DisconnectSensor(ISensor *sensor); -static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_QueryInterface(ISensorManagerEvents * This, REFIID riid, void **ppvObject) +static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_QueryInterface(ISensorManagerEvents *This, REFIID riid, void **ppvObject) { if (!ppvObject) { return E_INVALIDARG; @@ -79,17 +79,17 @@ static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_QueryInterface(ISensor return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE ISensorManagerEventsVtbl_AddRef(ISensorManagerEvents * This) +static ULONG STDMETHODCALLTYPE ISensorManagerEventsVtbl_AddRef(ISensorManagerEvents *This) { return 1; } -static ULONG STDMETHODCALLTYPE ISensorManagerEventsVtbl_Release(ISensorManagerEvents * This) +static ULONG STDMETHODCALLTYPE ISensorManagerEventsVtbl_Release(ISensorManagerEvents *This) { return 1; } -static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_OnSensorEnter(ISensorManagerEvents * This, ISensor *pSensor, SensorState state) +static HRESULT STDMETHODCALLTYPE ISensorManagerEventsVtbl_OnSensorEnter(ISensorManagerEvents *This, ISensor *pSensor, SensorState state) { ConnectSensor(pSensor); return S_OK; @@ -105,7 +105,7 @@ static ISensorManagerEvents sensor_manager_events = { &sensor_manager_events_vtbl }; -static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_QueryInterface(ISensorEvents * This, REFIID riid, void **ppvObject) +static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_QueryInterface(ISensorEvents *This, REFIID riid, void **ppvObject) { if (!ppvObject) { return E_INVALIDARG; @@ -119,17 +119,17 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_QueryInterface(ISensorEvents return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE ISensorEventsVtbl_AddRef(ISensorEvents * This) +static ULONG STDMETHODCALLTYPE ISensorEventsVtbl_AddRef(ISensorEvents *This) { return 1; } -static ULONG STDMETHODCALLTYPE ISensorEventsVtbl_Release(ISensorEvents * This) +static ULONG STDMETHODCALLTYPE ISensorEventsVtbl_Release(ISensorEvents *This) { return 1; } -static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnStateChanged(ISensorEvents * This, ISensor *pSensor, SensorState state) +static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnStateChanged(ISensorEvents *This, ISensor *pSensor, SensorState state) { #ifdef DEBUG_SENSORS int i; @@ -145,7 +145,7 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnStateChanged(ISensorEvents return S_OK; } -static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents * This, ISensor *pSensor, ISensorDataReport *pNewData) +static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents *This, ISensor *pSensor, ISensorDataReport *pNewData) { int i; @@ -202,7 +202,7 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnDataUpdated(ISensorEvents * return S_OK; } -static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnEvent(ISensorEvents * This, ISensor *pSensor, REFGUID eventID, IPortableDeviceValues *pEventData) +static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnEvent(ISensorEvents *This, ISensor *pSensor, REFGUID eventID, IPortableDeviceValues *pEventData) { #ifdef DEBUG_SENSORS int i; @@ -218,7 +218,7 @@ static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnEvent(ISensorEvents * This, return S_OK; } -static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnLeave(ISensorEvents * This, REFSENSOR_ID ID) +static HRESULT STDMETHODCALLTYPE ISensorEventsVtbl_OnLeave(ISensorEvents *This, REFSENSOR_ID ID) { int i; @@ -292,7 +292,7 @@ static int ConnectSensor(ISensor *sensor) SDL_LockSensors(); new_sensors = (SDL_Windows_Sensor *)SDL_realloc(SDL_sensors, (SDL_num_sensors + 1) * sizeof(SDL_Windows_Sensor)); - if (new_sensors == NULL) { + if (!new_sensors) { SDL_UnlockSensors(); SDL_free(name); return SDL_OutOfMemory(); @@ -343,8 +343,7 @@ static int DisconnectSensor(ISensor *sensor) return 0; } -static int -SDL_WINDOWS_SensorInit(void) +static int SDL_WINDOWS_SensorInit(void) { HRESULT hr; ISensorCollection *sensor_collection = NULL; @@ -353,7 +352,7 @@ SDL_WINDOWS_SensorInit(void) SDL_windowscoinit = SDL_TRUE; } - hr = CoCreateInstance(&SDL_CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, &SDL_IID_SensorManager, (LPVOID *) &SDL_sensor_manager); + hr = CoCreateInstance(&SDL_CLSID_SensorManager, NULL, CLSCTX_INPROC_SERVER, &SDL_IID_SensorManager, (LPVOID *)&SDL_sensor_manager); if (FAILED(hr)) { /* If we can't create a sensor manager (i.e. on Wine), we won't have any sensors, but don't fail the init */ return 0; /* WIN_SetErrorFromHRESULT("Couldn't create the sensor manager", hr); */ @@ -392,55 +391,46 @@ SDL_WINDOWS_SensorInit(void) return 0; } -static int -SDL_WINDOWS_SensorGetCount(void) +static int SDL_WINDOWS_SensorGetCount(void) { return SDL_num_sensors; } -static void -SDL_WINDOWS_SensorDetect(void) +static void SDL_WINDOWS_SensorDetect(void) { } -static const char * -SDL_WINDOWS_SensorGetDeviceName(int device_index) +static const char *SDL_WINDOWS_SensorGetDeviceName(int device_index) { return SDL_sensors[device_index].name; } -static SDL_SensorType -SDL_WINDOWS_SensorGetDeviceType(int device_index) +static SDL_SensorType SDL_WINDOWS_SensorGetDeviceType(int device_index) { return SDL_sensors[device_index].type; } -static int -SDL_WINDOWS_SensorGetDeviceNonPortableType(int device_index) +static int SDL_WINDOWS_SensorGetDeviceNonPortableType(int device_index) { return -1; } -static SDL_SensorID -SDL_WINDOWS_SensorGetDeviceInstanceID(int device_index) +static SDL_SensorID SDL_WINDOWS_SensorGetDeviceInstanceID(int device_index) { return SDL_sensors[device_index].id; } -static int -SDL_WINDOWS_SensorOpen(SDL_Sensor *sensor, int device_index) +static int SDL_WINDOWS_SensorOpen(SDL_Sensor *sensor, int device_index) { SDL_sensors[device_index].sensor_opened = sensor; return 0; } -static void -SDL_WINDOWS_SensorUpdate(SDL_Sensor *sensor) +static void SDL_WINDOWS_SensorUpdate(SDL_Sensor *sensor) { } -static void -SDL_WINDOWS_SensorClose(SDL_Sensor *sensor) +static void SDL_WINDOWS_SensorClose(SDL_Sensor *sensor) { int i; @@ -452,8 +442,7 @@ SDL_WINDOWS_SensorClose(SDL_Sensor *sensor) } } -static void -SDL_WINDOWS_SensorQuit(void) +static void SDL_WINDOWS_SensorQuit(void) { while (SDL_num_sensors > 0) { DisconnectSensor(SDL_sensors[0].sensor); @@ -470,8 +459,7 @@ SDL_WINDOWS_SensorQuit(void) } } -SDL_SensorDriver SDL_WINDOWS_SensorDriver = -{ +SDL_SensorDriver SDL_WINDOWS_SensorDriver = { SDL_WINDOWS_SensorInit, SDL_WINDOWS_SensorGetCount, SDL_WINDOWS_SensorDetect, diff --git a/src/sensor/windows/SDL_windowssensor.h b/src/sensor/windows/SDL_windowssensor.h index 1f35136293bd5..a255a53fc18d4 100644 --- a/src/sensor/windows/SDL_windowssensor.h +++ b/src/sensor/windows/SDL_windowssensor.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/stdlib/SDL_crc16.c b/src/stdlib/SDL_crc16.c index 0008b2e3eea3d..98fdb413c759d 100644 --- a/src/stdlib/SDL_crc16.c +++ b/src/stdlib/SDL_crc16.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,7 +38,7 @@ static Uint16 crc16_for_byte(Uint8 r) Uint16 crc = 0; int i; for (i = 0; i < 8; ++i) { - crc = ((crc ^ r) & 1? 0xA001 : 0) ^ crc >> 1; + crc = ((crc ^ r) & 1 ? 0xA001 : 0) ^ crc >> 1; r >>= 1; } return crc; @@ -48,8 +48,8 @@ Uint16 SDL_crc16(Uint16 crc, const void *data, size_t len) { /* As an optimization we can precalculate a 256 entry table for each byte */ size_t i; - for(i = 0; i < len; ++i) { - crc = crc16_for_byte((Uint8)crc ^ ((const Uint8*)data)[i]) ^ crc >> 8; + for (i = 0; i < len; ++i) { + crc = crc16_for_byte((Uint8)crc ^ ((const Uint8 *)data)[i]) ^ crc >> 8; } return crc; } diff --git a/src/stdlib/SDL_crc32.c b/src/stdlib/SDL_crc32.c index cd7229c968222..9f2b567ebb962 100644 --- a/src/stdlib/SDL_crc32.c +++ b/src/stdlib/SDL_crc32.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,7 +37,7 @@ static Uint32 crc32_for_byte(Uint32 r) { int i; for (i = 0; i < 8; ++i) { - r = (r & 1? 0: (Uint32)0xEDB88320L) ^ r >> 1; + r = (r & 1 ? 0 : (Uint32)0xEDB88320L) ^ r >> 1; } return r ^ (Uint32)0xFF000000L; } @@ -46,8 +46,8 @@ Uint32 SDL_crc32(Uint32 crc, const void *data, size_t len) { /* As an optimization we can precalculate a 256 entry table for each byte */ size_t i; - for(i = 0; i < len; ++i) { - crc = crc32_for_byte((Uint8)crc ^ ((const Uint8*)data)[i]) ^ crc >> 8; + for (i = 0; i < len; ++i) { + crc = crc32_for_byte((Uint8)crc ^ ((const Uint8 *)data)[i]) ^ crc >> 8; } return crc; } diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index b74974c344753..2421f51962cb3 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -44,28 +44,26 @@ static size_t SDL_envmemlen = 0; /* Put a variable into the environment */ /* Note: Name may not contain a '=' character. (Reference: http://www.unix.com/man-page/Linux/3/setenv/) */ #if defined(HAVE_SETENV) -int -SDL_setenv(const char *name, const char *value, int overwrite) +int SDL_setenv(const char *name, const char *value, int overwrite) { /* Input validation */ if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) { - return (-1); + return -1; } - + return setenv(name, value, overwrite); } #elif defined(__WIN32__) || defined(__WINGDK__) -int -SDL_setenv(const char *name, const char *value, int overwrite) +int SDL_setenv(const char *name, const char *value, int overwrite) { /* Input validation */ if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) { - return (-1); + return -1; } - + if (!overwrite) { if (GetEnvironmentVariableA(name, NULL, 0) > 0) { - return 0; /* asked not to overwrite existing value. */ + return 0; /* asked not to overwrite existing value. */ } } if (!SetEnvironmentVariableA(name, *value ? value : NULL)) { @@ -75,39 +73,37 @@ SDL_setenv(const char *name, const char *value, int overwrite) } /* We have a real environment table, but no real setenv? Fake it w/ putenv. */ #elif (defined(HAVE_GETENV) && defined(HAVE_PUTENV) && !defined(HAVE_SETENV)) -int -SDL_setenv(const char *name, const char *value, int overwrite) +int SDL_setenv(const char *name, const char *value, int overwrite) { size_t len; char *new_variable; /* Input validation */ if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) { - return (-1); + return -1; } - + if (getenv(name) != NULL) { if (overwrite) { unsetenv(name); } else { - return 0; /* leave the existing one there. */ + return 0; /* leave the existing one there. */ } } /* This leaks. Sorry. Get a better OS so we don't have to do this. */ len = SDL_strlen(name) + SDL_strlen(value) + 2; - new_variable = (char *) SDL_malloc(len); + new_variable = (char *)SDL_malloc(len); if (!new_variable) { - return (-1); + return -1; } SDL_snprintf(new_variable, len, "%s=%s", name, value); return putenv(new_variable); } #else /* roll our own */ -static char **SDL_env = (char **) 0; -int -SDL_setenv(const char *name, const char *value, int overwrite) +static char **SDL_env = (char **)0; +int SDL_setenv(const char *name, const char *value, int overwrite) { int added; size_t len, i; @@ -116,7 +112,7 @@ SDL_setenv(const char *name, const char *value, int overwrite) /* Input validation */ if (!name || *name == '\0' || SDL_strchr(name, '=') != NULL || !value) { - return (-1); + return -1; } /* See if it already exists */ @@ -126,9 +122,9 @@ SDL_setenv(const char *name, const char *value, int overwrite) /* Allocate memory for the variable */ len = SDL_strlen(name) + SDL_strlen(value) + 2; - new_variable = (char *) SDL_malloc(len); + new_variable = (char *)SDL_malloc(len); if (!new_variable) { - return (-1); + return -1; } SDL_snprintf(new_variable, len, "%s=%s", name, value); @@ -160,20 +156,19 @@ SDL_setenv(const char *name, const char *value, int overwrite) if (new_env) { SDL_env = new_env; SDL_env[i++] = new_variable; - SDL_env[i++] = (char *) 0; + SDL_env[i++] = (char *)0; added = 1; } else { SDL_free(new_variable); } } - return (added ? 0 : -1); + return added ? 0 : -1; } #endif /* Retrieve a variable named "name" from the environment */ #if defined(HAVE_GETENV) -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { #if defined(__ANDROID__) /* Make sure variables from the application manifest are available */ @@ -188,8 +183,7 @@ SDL_getenv(const char *name) return getenv(name); } #elif defined(__WIN32__) || defined(__WINGDK__) -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { size_t bufferlen; @@ -197,26 +191,25 @@ SDL_getenv(const char *name) if (!name || *name == '\0') { return NULL; } - + bufferlen = - GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen); + GetEnvironmentVariableA(name, SDL_envmem, (DWORD)SDL_envmemlen); if (bufferlen == 0) { return NULL; } if (bufferlen > SDL_envmemlen) { - char *newmem = (char *) SDL_realloc(SDL_envmem, bufferlen); - if (newmem == NULL) { + char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen); + if (!newmem) { return NULL; } SDL_envmem = newmem; SDL_envmemlen = bufferlen; - GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen); + GetEnvironmentVariableA(name, SDL_envmem, (DWORD)SDL_envmemlen); } return SDL_envmem; } #else -char * -SDL_getenv(const char *name) +char *SDL_getenv(const char *name) { size_t len, i; char *value; @@ -225,8 +218,8 @@ SDL_getenv(const char *name) if (!name || *name == '\0') { return NULL; } - - value = (char *) 0; + + value = (char *)0; if (SDL_env) { len = SDL_strlen(name); for (i = 0; SDL_env[i] && !value; ++i) { @@ -240,12 +233,10 @@ SDL_getenv(const char *name) } #endif - #ifdef TEST_MAIN #include -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { char *value; @@ -308,7 +299,7 @@ main(int argc, char *argv[]) } else { printf("failed\n"); } - return (0); + return 0; } #endif /* TEST_MAIN */ diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index bee60d50690b9..3a54be068a9aa 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,36 +31,33 @@ #include "SDL_endian.h" #if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) -#ifdef __FreeBSD__ +#ifndef SDL_USE_LIBICONV /* Define LIBICONV_PLUG to use iconv from the base instead of ports and avoid linker errors. */ #define LIBICONV_PLUG 1 #endif #include #include -SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof (iconv_t) <= sizeof (SDL_iconv_t)); +SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof(iconv_t) <= sizeof(SDL_iconv_t)); -SDL_iconv_t -SDL_iconv_open(const char *tocode, const char *fromcode) +SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) { - return (SDL_iconv_t) ((uintptr_t) iconv_open(tocode, fromcode)); + return (SDL_iconv_t)((uintptr_t)iconv_open(tocode, fromcode)); } -int -SDL_iconv_close(SDL_iconv_t cd) +int SDL_iconv_close(SDL_iconv_t cd) { - return iconv_close((iconv_t) ((uintptr_t) cd)); + return iconv_close((iconv_t)((uintptr_t)cd)); } -size_t -SDL_iconv(SDL_iconv_t cd, - const char **inbuf, size_t * inbytesleft, - char **outbuf, size_t * outbytesleft) +size_t SDL_iconv(SDL_iconv_t cd, + const char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) { /* iconv's second parameter may or may not be `const char const *` depending on the C runtime's whims. Casting to void * seems to make everyone happy, though. */ - const size_t retCode = iconv((iconv_t) ((uintptr_t) cd), (void *) inbuf, inbytesleft, outbuf, outbytesleft); - if (retCode == (size_t) - 1) { + const size_t retCode = iconv((iconv_t)((uintptr_t)cd), (void *)inbuf, inbytesleft, outbuf, outbytesleft); + if (retCode == (size_t)-1) { switch (errno) { case E2BIG: return SDL_ICONV_E2BIG; @@ -81,10 +78,10 @@ SDL_iconv(SDL_iconv_t cd, http://www.cl.cam.ac.uk/~mgk25/unicode.html */ -#define UNICODE_BOM 0xFEFF +#define UNICODE_BOM 0xFEFF -#define UNKNOWN_ASCII '?' -#define UNKNOWN_UNICODE 0xFFFD +#define UNKNOWN_ASCII '?' +#define UNKNOWN_UNICODE 0xFFFD enum { @@ -92,10 +89,10 @@ enum ENCODING_ASCII, ENCODING_LATIN1, ENCODING_UTF8, - ENCODING_UTF16, /* Needs byte order marker */ + ENCODING_UTF16, /* Needs byte order marker */ ENCODING_UTF16BE, ENCODING_UTF16LE, - ENCODING_UTF32, /* Needs byte order marker */ + ENCODING_UTF32, /* Needs byte order marker */ ENCODING_UTF32BE, ENCODING_UTF32LE, ENCODING_UCS2BE, @@ -104,15 +101,15 @@ enum ENCODING_UCS4LE, }; #if SDL_BYTEORDER == SDL_BIG_ENDIAN -#define ENCODING_UTF16NATIVE ENCODING_UTF16BE -#define ENCODING_UTF32NATIVE ENCODING_UTF32BE -#define ENCODING_UCS2NATIVE ENCODING_UCS2BE -#define ENCODING_UCS4NATIVE ENCODING_UCS4BE +#define ENCODING_UTF16NATIVE ENCODING_UTF16BE +#define ENCODING_UTF32NATIVE ENCODING_UTF32BE +#define ENCODING_UCS2NATIVE ENCODING_UCS2BE +#define ENCODING_UCS4NATIVE ENCODING_UCS4BE #else -#define ENCODING_UTF16NATIVE ENCODING_UTF16LE -#define ENCODING_UTF32NATIVE ENCODING_UTF32LE -#define ENCODING_UCS2NATIVE ENCODING_UCS2LE -#define ENCODING_UCS4NATIVE ENCODING_UCS4LE +#define ENCODING_UTF16NATIVE ENCODING_UTF16LE +#define ENCODING_UTF32NATIVE ENCODING_UTF32LE +#define ENCODING_UCS2NATIVE ENCODING_UCS2LE +#define ENCODING_UCS4NATIVE ENCODING_UCS4LE #endif struct _SDL_iconv_t @@ -126,7 +123,7 @@ static struct const char *name; int format; } encodings[] = { -/* *INDENT-OFF* */ /* clang-format off */ + /* *INDENT-OFF* */ /* clang-format off */ { "ASCII", ENCODING_ASCII }, { "US-ASCII", ENCODING_ASCII }, { "8859-1", ENCODING_LATIN1 }, @@ -163,8 +160,7 @@ static struct /* *INDENT-ON* */ /* clang-format on */ }; -static const char * -getlocale(char *buffer, size_t bufsize) +static const char *getlocale(char *buffer, size_t bufsize) { const char *lang; char *ptr; @@ -185,21 +181,20 @@ getlocale(char *buffer, size_t bufsize) /* We need to trim down strings like "en_US.UTF-8@blah" to "UTF-8" */ ptr = SDL_strchr(lang, '.'); - if (ptr != NULL) { + if (ptr) { lang = ptr + 1; } SDL_strlcpy(buffer, lang, bufsize); ptr = SDL_strchr(buffer, '@'); - if (ptr != NULL) { - *ptr = '\0'; /* chop end of string. */ + if (ptr) { + *ptr = '\0'; /* chop end of string. */ } return buffer; } -SDL_iconv_t -SDL_iconv_open(const char *tocode, const char *fromcode) +SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) { int src_fmt = ENCODING_UNKNOWN; int dst_fmt = ENCODING_UNKNOWN; @@ -228,20 +223,20 @@ SDL_iconv_open(const char *tocode, const char *fromcode) } } if (src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN) { - SDL_iconv_t cd = (SDL_iconv_t) SDL_malloc(sizeof(*cd)); + SDL_iconv_t cd = (SDL_iconv_t)SDL_malloc(sizeof(*cd)); if (cd) { cd->src_fmt = src_fmt; cd->dst_fmt = dst_fmt; return cd; } } - return (SDL_iconv_t) - 1; + return (SDL_iconv_t)-1; } size_t SDL_iconv(SDL_iconv_t cd, - const char **inbuf, size_t * inbytesleft, - char **outbuf, size_t * outbytesleft) + const char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) { /* For simplicity, we'll convert everything to and from UCS-4 */ const char *src; @@ -266,7 +261,7 @@ SDL_iconv(SDL_iconv_t cd, case ENCODING_UTF16: /* Scan for a byte order marker */ { - Uint8 *p = (Uint8 *) src; + Uint8 *p = (Uint8 *)src; size_t n = srclen / 2; while (n) { if (p[0] == 0xFF && p[1] == 0xFE) { @@ -288,7 +283,7 @@ SDL_iconv(SDL_iconv_t cd, case ENCODING_UTF32: /* Scan for a byte order marker */ { - Uint8 *p = (Uint8 *) src; + Uint8 *p = (Uint8 *)src; size_t n = srclen / 4; while (n) { if (p[0] == 0xFF && p[1] == 0xFE && @@ -317,7 +312,7 @@ SDL_iconv(SDL_iconv_t cd, if (dstlen < 2) { return SDL_ICONV_E2BIG; } - *(Uint16 *) dst = UNICODE_BOM; + *(Uint16 *)dst = UNICODE_BOM; dst += 2; dstlen -= 2; cd->dst_fmt = ENCODING_UTF16NATIVE; @@ -327,7 +322,7 @@ SDL_iconv(SDL_iconv_t cd, if (dstlen < 4) { return SDL_ICONV_E2BIG; } - *(Uint32 *) dst = UNICODE_BOM; + *(Uint32 *)dst = UNICODE_BOM; dst += 4; dstlen -= 4; cd->dst_fmt = ENCODING_UTF32NATIVE; @@ -339,406 +334,392 @@ SDL_iconv(SDL_iconv_t cd, /* Decode a character */ switch (cd->src_fmt) { case ENCODING_ASCII: - { - Uint8 *p = (Uint8 *) src; - ch = (Uint32) (p[0] & 0x7F); - ++src; - --srclen; - } - break; + { + Uint8 *p = (Uint8 *)src; + ch = (Uint32)(p[0] & 0x7F); + ++src; + --srclen; + } break; case ENCODING_LATIN1: - { - Uint8 *p = (Uint8 *) src; - ch = (Uint32) p[0]; - ++src; - --srclen; - } - break; - case ENCODING_UTF8: /* RFC 3629 */ - { - Uint8 *p = (Uint8 *) src; - size_t left = 0; - SDL_bool overlong = SDL_FALSE; - if (p[0] >= 0xF0) { - if ((p[0] & 0xF8) != 0xF0) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) { - overlong = SDL_TRUE; - } - ch = (Uint32) (p[0] & 0x07); - left = 3; - } - } else if (p[0] >= 0xE0) { - if ((p[0] & 0xF0) != 0xE0) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) { - overlong = SDL_TRUE; - } - ch = (Uint32) (p[0] & 0x0F); - left = 2; - } - } else if (p[0] >= 0xC0) { - if ((p[0] & 0xE0) != 0xC0) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - if ((p[0] & 0xDE) == 0xC0) { - overlong = SDL_TRUE; - } - ch = (Uint32) (p[0] & 0x1F); - left = 1; - } - } else { - if ((p[0] & 0x80) != 0x00) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } else { - ch = (Uint32) p[0]; - } - } - ++src; - --srclen; - if (srclen < left) { - return SDL_ICONV_EINVAL; - } - while (left--) { - ++p; - if ((p[0] & 0xC0) != 0x80) { - /* Skip illegal sequences - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - break; - } - ch <<= 6; - ch |= (p[0] & 0x3F); - ++src; - --srclen; - } - if (overlong) { - /* Potential security risk - return SDL_ICONV_EILSEQ; - */ - ch = UNKNOWN_UNICODE; - } - if ((ch >= 0xD800 && ch <= 0xDFFF) || - (ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) { + { + Uint8 *p = (Uint8 *)src; + ch = (Uint32)p[0]; + ++src; + --srclen; + } break; + case ENCODING_UTF8: /* RFC 3629 */ + { + Uint8 *p = (Uint8 *)src; + size_t left = 0; + SDL_bool overlong = SDL_FALSE; + if (p[0] >= 0xF0) { + if ((p[0] & 0xF8) != 0xF0) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; + } else { + if (p[0] == 0xF0 && srclen > 1 && (p[1] & 0xF0) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32)(p[0] & 0x07); + left = 3; } - } - break; - case ENCODING_UTF16BE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *) src; - Uint16 W1, W2; - if (srclen < 2) { - return SDL_ICONV_EINVAL; - } - W1 = ((Uint16) p[0] << 8) | (Uint16) p[1]; - src += 2; - srclen -= 2; - if (W1 < 0xD800 || W1 > 0xDFFF) { - ch = (Uint32) W1; - break; - } - if (W1 > 0xDBFF) { + } else if (p[0] >= 0xE0) { + if ((p[0] & 0xF0) != 0xE0) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; - break; - } - if (srclen < 2) { - return SDL_ICONV_EINVAL; + } else { + if (p[0] == 0xE0 && srclen > 1 && (p[1] & 0xE0) == 0x80) { + overlong = SDL_TRUE; + } + ch = (Uint32)(p[0] & 0x0F); + left = 2; } - p = (Uint8 *) src; - W2 = ((Uint16) p[0] << 8) | (Uint16) p[1]; - src += 2; - srclen -= 2; - if (W2 < 0xDC00 || W2 > 0xDFFF) { + } else if (p[0] >= 0xC0) { + if ((p[0] & 0xE0) != 0xC0) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; - break; - } - ch = (((Uint32) (W1 & 0x3FF) << 10) | - (Uint32) (W2 & 0x3FF)) + 0x10000; - } - break; - case ENCODING_UTF16LE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *) src; - Uint16 W1, W2; - if (srclen < 2) { - return SDL_ICONV_EINVAL; - } - W1 = ((Uint16) p[1] << 8) | (Uint16) p[0]; - src += 2; - srclen -= 2; - if (W1 < 0xD800 || W1 > 0xDFFF) { - ch = (Uint32) W1; - break; + } else { + if ((p[0] & 0xDE) == 0xC0) { + overlong = SDL_TRUE; + } + ch = (Uint32)(p[0] & 0x1F); + left = 1; } - if (W1 > 0xDBFF) { + } else { + if (p[0] & 0x80) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; - break; - } - if (srclen < 2) { - return SDL_ICONV_EINVAL; + } else { + ch = (Uint32)p[0]; } - p = (Uint8 *) src; - W2 = ((Uint16) p[1] << 8) | (Uint16) p[0]; - src += 2; - srclen -= 2; - if (W2 < 0xDC00 || W2 > 0xDFFF) { + } + ++src; + --srclen; + if (srclen < left) { + return SDL_ICONV_EINVAL; + } + while (left--) { + ++p; + if ((p[0] & 0xC0) != 0x80) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; break; } - ch = (((Uint32) (W1 & 0x3FF) << 10) | - (Uint32) (W2 & 0x3FF)) + 0x10000; + ch <<= 6; + ch |= (p[0] & 0x3F); + ++src; + --srclen; } - break; + if (overlong) { + /* Potential security risk + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } + if ((ch >= 0xD800 && ch <= 0xDFFF) || + (ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + } + } break; + case ENCODING_UTF16BE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *)src; + Uint16 W1, W2; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + W1 = ((Uint16)p[0] << 8) | (Uint16)p[1]; + src += 2; + srclen -= 2; + if (W1 < 0xD800 || W1 > 0xDFFF) { + ch = (Uint32)W1; + break; + } + if (W1 > 0xDBFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + p = (Uint8 *)src; + W2 = ((Uint16)p[0] << 8) | (Uint16)p[1]; + src += 2; + srclen -= 2; + if (W2 < 0xDC00 || W2 > 0xDFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + ch = (((Uint32)(W1 & 0x3FF) << 10) | + (Uint32)(W2 & 0x3FF)) + + 0x10000; + } break; + case ENCODING_UTF16LE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *)src; + Uint16 W1, W2; + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + W1 = ((Uint16)p[1] << 8) | (Uint16)p[0]; + src += 2; + srclen -= 2; + if (W1 < 0xD800 || W1 > 0xDFFF) { + ch = (Uint32)W1; + break; + } + if (W1 > 0xDBFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + if (srclen < 2) { + return SDL_ICONV_EINVAL; + } + p = (Uint8 *)src; + W2 = ((Uint16)p[1] << 8) | (Uint16)p[0]; + src += 2; + srclen -= 2; + if (W2 < 0xDC00 || W2 > 0xDFFF) { + /* Skip illegal sequences + return SDL_ICONV_EILSEQ; + */ + ch = UNKNOWN_UNICODE; + break; + } + ch = (((Uint32)(W1 & 0x3FF) << 10) | + (Uint32)(W2 & 0x3FF)) + + 0x10000; + } break; case ENCODING_UCS2LE: - { - Uint8 *p = (Uint8 *) src; - if (srclen < 2) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32) p[1] << 8) | (Uint32) p[0]; - src += 2; - srclen -= 2; + { + Uint8 *p = (Uint8 *)src; + if (srclen < 2) { + return SDL_ICONV_EINVAL; } - break; + ch = ((Uint32)p[1] << 8) | (Uint32)p[0]; + src += 2; + srclen -= 2; + } break; case ENCODING_UCS2BE: - { - Uint8 *p = (Uint8 *) src; - if (srclen < 2) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32) p[0] << 8) | (Uint32) p[1]; - src += 2; - srclen -= 2; + { + Uint8 *p = (Uint8 *)src; + if (srclen < 2) { + return SDL_ICONV_EINVAL; } - break; + ch = ((Uint32)p[0] << 8) | (Uint32)p[1]; + src += 2; + srclen -= 2; + } break; case ENCODING_UCS4BE: case ENCODING_UTF32BE: - { - Uint8 *p = (Uint8 *) src; - if (srclen < 4) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32) p[0] << 24) | - ((Uint32) p[1] << 16) | - ((Uint32) p[2] << 8) | (Uint32) p[3]; - src += 4; - srclen -= 4; + { + Uint8 *p = (Uint8 *)src; + if (srclen < 4) { + return SDL_ICONV_EINVAL; } - break; + ch = ((Uint32)p[0] << 24) | + ((Uint32)p[1] << 16) | + ((Uint32)p[2] << 8) | (Uint32)p[3]; + src += 4; + srclen -= 4; + } break; case ENCODING_UCS4LE: case ENCODING_UTF32LE: - { - Uint8 *p = (Uint8 *) src; - if (srclen < 4) { - return SDL_ICONV_EINVAL; - } - ch = ((Uint32) p[3] << 24) | - ((Uint32) p[2] << 16) | - ((Uint32) p[1] << 8) | (Uint32) p[0]; - src += 4; - srclen -= 4; + { + Uint8 *p = (Uint8 *)src; + if (srclen < 4) { + return SDL_ICONV_EINVAL; } - break; + ch = ((Uint32)p[3] << 24) | + ((Uint32)p[2] << 16) | + ((Uint32)p[1] << 8) | (Uint32)p[0]; + src += 4; + srclen -= 4; + } break; } /* Encode a character */ switch (cd->dst_fmt) { case ENCODING_ASCII: - { - Uint8 *p = (Uint8 *) dst; - if (dstlen < 1) { - return SDL_ICONV_E2BIG; - } - if (ch > 0x7F) { - *p = UNKNOWN_ASCII; - } else { - *p = (Uint8) ch; - } - ++dst; - --dstlen; + { + Uint8 *p = (Uint8 *)dst; + if (dstlen < 1) { + return SDL_ICONV_E2BIG; } - break; + if (ch > 0x7F) { + *p = UNKNOWN_ASCII; + } else { + *p = (Uint8)ch; + } + ++dst; + --dstlen; + } break; case ENCODING_LATIN1: - { - Uint8 *p = (Uint8 *) dst; + { + Uint8 *p = (Uint8 *)dst; + if (dstlen < 1) { + return SDL_ICONV_E2BIG; + } + if (ch > 0xFF) { + *p = UNKNOWN_ASCII; + } else { + *p = (Uint8)ch; + } + ++dst; + --dstlen; + } break; + case ENCODING_UTF8: /* RFC 3629 */ + { + Uint8 *p = (Uint8 *)dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + if (ch <= 0x7F) { if (dstlen < 1) { return SDL_ICONV_E2BIG; } - if (ch > 0xFF) { - *p = UNKNOWN_ASCII; - } else { - *p = (Uint8) ch; - } + *p = (Uint8)ch; ++dst; --dstlen; - } - break; - case ENCODING_UTF8: /* RFC 3629 */ - { - Uint8 *p = (Uint8 *) dst; - if (ch > 0x10FFFF) { - ch = UNKNOWN_UNICODE; - } - if (ch <= 0x7F) { - if (dstlen < 1) { - return SDL_ICONV_E2BIG; - } - *p = (Uint8) ch; - ++dst; - --dstlen; - } else if (ch <= 0x7FF) { - if (dstlen < 2) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xC0 | (Uint8) ((ch >> 6) & 0x1F); - p[1] = 0x80 | (Uint8) (ch & 0x3F); - dst += 2; - dstlen -= 2; - } else if (ch <= 0xFFFF) { - if (dstlen < 3) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xE0 | (Uint8) ((ch >> 12) & 0x0F); - p[1] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); - p[2] = 0x80 | (Uint8) (ch & 0x3F); - dst += 3; - dstlen -= 3; - } else { - if (dstlen < 4) { - return SDL_ICONV_E2BIG; - } - p[0] = 0xF0 | (Uint8) ((ch >> 18) & 0x07); - p[1] = 0x80 | (Uint8) ((ch >> 12) & 0x3F); - p[2] = 0x80 | (Uint8) ((ch >> 6) & 0x3F); - p[3] = 0x80 | (Uint8) (ch & 0x3F); - dst += 4; - dstlen -= 4; + } else if (ch <= 0x7FF) { + if (dstlen < 2) { + return SDL_ICONV_E2BIG; } - } - break; - case ENCODING_UTF16BE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *) dst; - if (ch > 0x10FFFF) { - ch = UNKNOWN_UNICODE; + p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); + p[1] = 0x80 | (Uint8)(ch & 0x3F); + dst += 2; + dstlen -= 2; + } else if (ch <= 0xFFFF) { + if (dstlen < 3) { + return SDL_ICONV_E2BIG; } - if (ch < 0x10000) { - if (dstlen < 2) { - return SDL_ICONV_E2BIG; - } - p[0] = (Uint8) (ch >> 8); - p[1] = (Uint8) ch; - dst += 2; - dstlen -= 2; - } else { - Uint16 W1, W2; - if (dstlen < 4) { - return SDL_ICONV_E2BIG; - } - ch = ch - 0x10000; - W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF); - W2 = 0xDC00 | (Uint16) (ch & 0x3FF); - p[0] = (Uint8) (W1 >> 8); - p[1] = (Uint8) W1; - p[2] = (Uint8) (W2 >> 8); - p[3] = (Uint8) W2; - dst += 4; - dstlen -= 4; + p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); + p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); + p[2] = 0x80 | (Uint8)(ch & 0x3F); + dst += 3; + dstlen -= 3; + } else { + if (dstlen < 4) { + return SDL_ICONV_E2BIG; } + p[0] = 0xF0 | (Uint8)((ch >> 18) & 0x07); + p[1] = 0x80 | (Uint8)((ch >> 12) & 0x3F); + p[2] = 0x80 | (Uint8)((ch >> 6) & 0x3F); + p[3] = 0x80 | (Uint8)(ch & 0x3F); + dst += 4; + dstlen -= 4; } - break; - case ENCODING_UTF16LE: /* RFC 2781 */ - { - Uint8 *p = (Uint8 *) dst; - if (ch > 0x10FFFF) { - ch = UNKNOWN_UNICODE; - } - if (ch < 0x10000) { - if (dstlen < 2) { - return SDL_ICONV_E2BIG; - } - p[1] = (Uint8) (ch >> 8); - p[0] = (Uint8) ch; - dst += 2; - dstlen -= 2; - } else { - Uint16 W1, W2; - if (dstlen < 4) { - return SDL_ICONV_E2BIG; - } - ch = ch - 0x10000; - W1 = 0xD800 | (Uint16) ((ch >> 10) & 0x3FF); - W2 = 0xDC00 | (Uint16) (ch & 0x3FF); - p[1] = (Uint8) (W1 >> 8); - p[0] = (Uint8) W1; - p[3] = (Uint8) (W2 >> 8); - p[2] = (Uint8) W2; - dst += 4; - dstlen -= 4; - } + } break; + case ENCODING_UTF16BE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *)dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; } - break; - case ENCODING_UCS2BE: - { - Uint8 *p = (Uint8 *) dst; - if (ch > 0xFFFF) { - ch = UNKNOWN_UNICODE; - } + if (ch < 0x10000) { if (dstlen < 2) { return SDL_ICONV_E2BIG; } - p[0] = (Uint8) (ch >> 8); - p[1] = (Uint8) ch; + p[0] = (Uint8)(ch >> 8); + p[1] = (Uint8)ch; dst += 2; dstlen -= 2; - } - break; - case ENCODING_UCS2LE: - { - Uint8 *p = (Uint8 *) dst; - if (ch > 0xFFFF) { - ch = UNKNOWN_UNICODE; + } else { + Uint16 W1, W2; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; } + ch = ch - 0x10000; + W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF); + W2 = 0xDC00 | (Uint16)(ch & 0x3FF); + p[0] = (Uint8)(W1 >> 8); + p[1] = (Uint8)W1; + p[2] = (Uint8)(W2 >> 8); + p[3] = (Uint8)W2; + dst += 4; + dstlen -= 4; + } + } break; + case ENCODING_UTF16LE: /* RFC 2781 */ + { + Uint8 *p = (Uint8 *)dst; + if (ch > 0x10FFFF) { + ch = UNKNOWN_UNICODE; + } + if (ch < 0x10000) { if (dstlen < 2) { return SDL_ICONV_E2BIG; } - p[1] = (Uint8) (ch >> 8); - p[0] = (Uint8) ch; + p[1] = (Uint8)(ch >> 8); + p[0] = (Uint8)ch; dst += 2; dstlen -= 2; + } else { + Uint16 W1, W2; + if (dstlen < 4) { + return SDL_ICONV_E2BIG; + } + ch = ch - 0x10000; + W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF); + W2 = 0xDC00 | (Uint16)(ch & 0x3FF); + p[1] = (Uint8)(W1 >> 8); + p[0] = (Uint8)W1; + p[3] = (Uint8)(W2 >> 8); + p[2] = (Uint8)W2; + dst += 4; + dstlen -= 4; } - break; + } break; + case ENCODING_UCS2BE: + { + Uint8 *p = (Uint8 *)dst; + if (ch > 0xFFFF) { + ch = UNKNOWN_UNICODE; + } + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[0] = (Uint8)(ch >> 8); + p[1] = (Uint8)ch; + dst += 2; + dstlen -= 2; + } break; + case ENCODING_UCS2LE: + { + Uint8 *p = (Uint8 *)dst; + if (ch > 0xFFFF) { + ch = UNKNOWN_UNICODE; + } + if (dstlen < 2) { + return SDL_ICONV_E2BIG; + } + p[1] = (Uint8)(ch >> 8); + p[0] = (Uint8)ch; + dst += 2; + dstlen -= 2; + } break; case ENCODING_UTF32BE: if (ch > 0x10FFFF) { ch = UNKNOWN_UNICODE; @@ -749,14 +730,14 @@ SDL_iconv(SDL_iconv_t cd, ch = UNKNOWN_UNICODE; } { - Uint8 *p = (Uint8 *) dst; + Uint8 *p = (Uint8 *)dst; if (dstlen < 4) { return SDL_ICONV_E2BIG; } - p[0] = (Uint8) (ch >> 24); - p[1] = (Uint8) (ch >> 16); - p[2] = (Uint8) (ch >> 8); - p[3] = (Uint8) ch; + p[0] = (Uint8)(ch >> 24); + p[1] = (Uint8)(ch >> 16); + p[2] = (Uint8)(ch >> 8); + p[3] = (Uint8)ch; dst += 4; dstlen -= 4; } @@ -771,14 +752,14 @@ SDL_iconv(SDL_iconv_t cd, ch = UNKNOWN_UNICODE; } { - Uint8 *p = (Uint8 *) dst; + Uint8 *p = (Uint8 *)dst; if (dstlen < 4) { return SDL_ICONV_E2BIG; } - p[3] = (Uint8) (ch >> 24); - p[2] = (Uint8) (ch >> 16); - p[1] = (Uint8) (ch >> 8); - p[0] = (Uint8) ch; + p[3] = (Uint8)(ch >> 24); + p[2] = (Uint8)(ch >> 16); + p[1] = (Uint8)(ch >> 8); + p[0] = (Uint8)ch; dst += 4; dstlen -= 4; } @@ -795,8 +776,7 @@ SDL_iconv(SDL_iconv_t cd, return total; } -int -SDL_iconv_close(SDL_iconv_t cd) +int SDL_iconv_close(SDL_iconv_t cd) { if (cd != (SDL_iconv_t)-1) { SDL_free(cd); @@ -806,9 +786,7 @@ SDL_iconv_close(SDL_iconv_t cd) #endif /* !HAVE_ICONV */ -char * -SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, - size_t inbytesleft) +char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft) { SDL_iconv_t cd; char *string; @@ -817,50 +795,47 @@ SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t outbytesleft; size_t retCode = 0; - cd = SDL_iconv_open(tocode, fromcode); - if (cd == (SDL_iconv_t) - 1) { - /* See if we can recover here (fixes iconv on Solaris 11) */ - if (!tocode || !*tocode) { - tocode = "UTF-8"; - } - if (!fromcode || !*fromcode) { - fromcode = "UTF-8"; - } - cd = SDL_iconv_open(tocode, fromcode); + if (!tocode || !*tocode) { + tocode = "UTF-8"; + } + if (!fromcode || !*fromcode) { + fromcode = "UTF-8"; } - if (cd == (SDL_iconv_t) - 1) { + cd = SDL_iconv_open(tocode, fromcode); + if (cd == (SDL_iconv_t)-1) { return NULL; } - stringsize = inbytesleft > 4 ? inbytesleft : 4; - string = (char *) SDL_malloc(stringsize); + stringsize = inbytesleft; + string = (char *)SDL_malloc(stringsize + sizeof(Uint32)); if (!string) { SDL_iconv_close(cd); return NULL; } outbuf = string; outbytesleft = stringsize; - SDL_memset(outbuf, 0, 4); + SDL_memset(outbuf, 0, sizeof(Uint32)); while (inbytesleft > 0) { const size_t oldinbytesleft = inbytesleft; retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); switch (retCode) { case SDL_ICONV_E2BIG: - { - char *oldstring = string; - stringsize *= 2; - string = (char *) SDL_realloc(string, stringsize); - if (!string) { - SDL_free(oldstring); - SDL_iconv_close(cd); - return NULL; - } - outbuf = string + (outbuf - oldstring); - outbytesleft = stringsize - (outbuf - string); - SDL_memset(outbuf, 0, 4); + { + const ptrdiff_t diff = (ptrdiff_t) (outbuf - string); + char *oldstring = string; + stringsize *= 2; + string = (char *)SDL_realloc(string, stringsize + sizeof(Uint32)); + if (!string) { + SDL_free(oldstring); + SDL_iconv_close(cd); + return NULL; } - break; + outbuf = string + diff; + outbytesleft = stringsize - diff; + SDL_memset(outbuf, 0, sizeof(Uint32)); + continue; + } case SDL_ICONV_EILSEQ: /* Try skipping some input data - not perfect, but... */ ++inbuf; @@ -877,6 +852,7 @@ SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, break; } } + SDL_memset(outbuf, 0, sizeof(Uint32)); SDL_iconv_close(cd); return string; diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index de02b5eefd6cd..a045a6aadeff2 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -483,9 +483,8 @@ DEFAULT_MMAP_THRESHOLD default: 256K #ifndef WIN32 #ifdef _WIN32 #define WIN32 1 -#endif /* _WIN32 */ -#endif /* WIN32 */ - +#endif /* _WIN32 */ +#endif /* WIN32 */ #ifdef WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -502,8 +501,8 @@ DEFAULT_MMAP_THRESHOLD default: 256K #define LACKS_ERRNO_H #define LACKS_FCNTL_H #define MALLOC_FAILURE_ACTION -#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ -#endif /* WIN32 */ +#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */ +#endif /* WIN32 */ #ifdef __OS2__ #define INCL_DOS @@ -518,113 +517,113 @@ DEFAULT_MMAP_THRESHOLD default: 256K #ifndef HAVE_MORECORE #define HAVE_MORECORE 0 #define HAVE_MMAP 1 -#endif /* HAVE_MORECORE */ -#endif /* DARWIN */ +#endif /* HAVE_MORECORE */ +#endif /* DARWIN */ #ifndef LACKS_SYS_TYPES_H -#include /* For size_t */ -#endif /* LACKS_SYS_TYPES_H */ +#include /* For size_t */ +#endif /* LACKS_SYS_TYPES_H */ /* The maximum possible size_t value has all bits set */ #define MAX_SIZE_T (~(size_t)0) #ifndef ONLY_MSPACES #define ONLY_MSPACES 0 -#endif /* ONLY_MSPACES */ +#endif /* ONLY_MSPACES */ #ifndef MSPACES #if ONLY_MSPACES #define MSPACES 1 -#else /* ONLY_MSPACES */ +#else /* ONLY_MSPACES */ #define MSPACES 0 -#endif /* ONLY_MSPACES */ -#endif /* MSPACES */ +#endif /* ONLY_MSPACES */ +#endif /* MSPACES */ #ifndef MALLOC_ALIGNMENT #define MALLOC_ALIGNMENT ((size_t)8U) -#endif /* MALLOC_ALIGNMENT */ +#endif /* MALLOC_ALIGNMENT */ #ifndef FOOTERS #define FOOTERS 0 -#endif /* FOOTERS */ +#endif /* FOOTERS */ #ifndef ABORT #define ABORT abort() -#endif /* ABORT */ +#endif /* ABORT */ #ifndef ABORT_ON_ASSERT_FAILURE #define ABORT_ON_ASSERT_FAILURE 1 -#endif /* ABORT_ON_ASSERT_FAILURE */ +#endif /* ABORT_ON_ASSERT_FAILURE */ #ifndef PROCEED_ON_ERROR #define PROCEED_ON_ERROR 0 -#endif /* PROCEED_ON_ERROR */ +#endif /* PROCEED_ON_ERROR */ #ifndef USE_LOCKS #define USE_LOCKS 0 -#endif /* USE_LOCKS */ +#endif /* USE_LOCKS */ #ifndef INSECURE #define INSECURE 0 -#endif /* INSECURE */ +#endif /* INSECURE */ #ifndef HAVE_MMAP #define HAVE_MMAP 1 -#endif /* HAVE_MMAP */ +#endif /* HAVE_MMAP */ #ifndef MMAP_CLEARS #define MMAP_CLEARS 1 -#endif /* MMAP_CLEARS */ +#endif /* MMAP_CLEARS */ #ifndef HAVE_MREMAP #ifdef linux #define HAVE_MREMAP 1 -#else /* linux */ +#else /* linux */ #define HAVE_MREMAP 0 -#endif /* linux */ -#endif /* HAVE_MREMAP */ +#endif /* linux */ +#endif /* HAVE_MREMAP */ #ifndef MALLOC_FAILURE_ACTION #define MALLOC_FAILURE_ACTION errno = ENOMEM; -#endif /* MALLOC_FAILURE_ACTION */ +#endif /* MALLOC_FAILURE_ACTION */ #ifndef HAVE_MORECORE #if ONLY_MSPACES #define HAVE_MORECORE 0 -#else /* ONLY_MSPACES */ +#else /* ONLY_MSPACES */ #define HAVE_MORECORE 1 -#endif /* ONLY_MSPACES */ -#endif /* HAVE_MORECORE */ +#endif /* ONLY_MSPACES */ +#endif /* HAVE_MORECORE */ #if !HAVE_MORECORE #define MORECORE_CONTIGUOUS 0 -#else /* !HAVE_MORECORE */ +#else /* !HAVE_MORECORE */ #ifndef MORECORE #define MORECORE sbrk -#endif /* MORECORE */ +#endif /* MORECORE */ #ifndef MORECORE_CONTIGUOUS #define MORECORE_CONTIGUOUS 1 -#endif /* MORECORE_CONTIGUOUS */ -#endif /* HAVE_MORECORE */ +#endif /* MORECORE_CONTIGUOUS */ +#endif /* HAVE_MORECORE */ #ifndef DEFAULT_GRANULARITY #if MORECORE_CONTIGUOUS -#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ -#else /* MORECORE_CONTIGUOUS */ +#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */ +#else /* MORECORE_CONTIGUOUS */ #define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) -#endif /* MORECORE_CONTIGUOUS */ -#endif /* DEFAULT_GRANULARITY */ +#endif /* MORECORE_CONTIGUOUS */ +#endif /* DEFAULT_GRANULARITY */ #ifndef DEFAULT_TRIM_THRESHOLD #ifndef MORECORE_CANNOT_TRIM #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) -#else /* MORECORE_CANNOT_TRIM */ +#else /* MORECORE_CANNOT_TRIM */ #define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T -#endif /* MORECORE_CANNOT_TRIM */ -#endif /* DEFAULT_TRIM_THRESHOLD */ +#endif /* MORECORE_CANNOT_TRIM */ +#endif /* DEFAULT_TRIM_THRESHOLD */ #ifndef DEFAULT_MMAP_THRESHOLD #if HAVE_MMAP #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) -#else /* HAVE_MMAP */ +#else /* HAVE_MMAP */ #define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T -#endif /* HAVE_MMAP */ -#endif /* DEFAULT_MMAP_THRESHOLD */ +#endif /* HAVE_MMAP */ +#endif /* DEFAULT_MMAP_THRESHOLD */ #ifndef USE_BUILTIN_FFS #define USE_BUILTIN_FFS 0 -#endif /* USE_BUILTIN_FFS */ +#endif /* USE_BUILTIN_FFS */ #ifndef USE_DEV_RANDOM #define USE_DEV_RANDOM 0 -#endif /* USE_DEV_RANDOM */ +#endif /* USE_DEV_RANDOM */ #ifndef NO_MALLINFO #define NO_MALLINFO 0 -#endif /* NO_MALLINFO */ +#endif /* NO_MALLINFO */ #ifndef MALLINFO_FIELD_TYPE #define MALLINFO_FIELD_TYPE size_t -#endif /* MALLINFO_FIELD_TYPE */ +#endif /* MALLINFO_FIELD_TYPE */ #ifndef memset #define memset SDL_memset @@ -675,27 +674,25 @@ DEFAULT_MMAP_THRESHOLD default: 256K #include "/usr/include/malloc.h" #else /* HAVE_USR_INCLUDE_MALLOC_H */ -struct mallinfo -{ - MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ - MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ - MALLINFO_FIELD_TYPE smblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblks; /* always 0 */ - MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ - MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ - MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ - MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ - MALLINFO_FIELD_TYPE fordblks; /* total free space */ - MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ +struct mallinfo { + MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */ + MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */ + MALLINFO_FIELD_TYPE smblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblks; /* always 0 */ + MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */ + MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */ + MALLINFO_FIELD_TYPE fsmblks; /* always 0 */ + MALLINFO_FIELD_TYPE uordblks; /* total allocated space */ + MALLINFO_FIELD_TYPE fordblks; /* total free space */ + MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */ }; #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ #ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ +extern "C" { +#endif /* __cplusplus */ #if !ONLY_MSPACES @@ -718,7 +715,7 @@ extern "C" #define dlmalloc_max_footprint malloc_max_footprint #define dlindependent_calloc independent_calloc #define dlindependent_comalloc independent_comalloc -#endif /* USE_DL_PREFIX */ +#endif /* USE_DL_PREFIX */ /* @@ -735,7 +732,7 @@ extern "C" maximum supported value of n differs across systems, but is in all cases less than the maximum representable value of a size_t. */ - void * SDLCALL dlmalloc(size_t); +void* SDLCALL dlmalloc(size_t); /* free(void* p) @@ -744,14 +741,14 @@ extern "C" It has no effect if p is null. If p was not malloced or already freed, free(p) will by default cause the current program to abort. */ - void SDLCALL dlfree(void *); +void SDLCALL dlfree(void*); /* calloc(size_t n_elements, size_t element_size); Returns a pointer to n_elements * element_size bytes, with all locations set to zero. */ - void * SDLCALL dlcalloc(size_t, size_t); +void* SDLCALL dlcalloc(size_t, size_t); /* realloc(void* p, size_t n) @@ -776,7 +773,7 @@ extern "C" to be used as an argument to realloc is not supported. */ - void * SDLCALL dlrealloc(void *, size_t); +void* SDLCALL dlrealloc(void*, size_t); /* memalign(size_t alignment, size_t n); @@ -790,14 +787,14 @@ extern "C" Overreliance on memalign is a sure way to fragment space. */ - void *dlmemalign(size_t, size_t); +void* dlmemalign(size_t, size_t); /* valloc(size_t n); Equivalent to memalign(pagesize, n), where pagesize is the page size of the system. If the pagesize is unknown, 4096 is used. */ - void *dlvalloc(size_t); +void* dlvalloc(size_t); /* mallopt(int parameter_number, int parameter_value) @@ -817,7 +814,7 @@ extern "C" M_GRANULARITY -2 page size any power of 2 >= page size M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support) */ - int dlmallopt(int, int); +int dlmallopt(int, int); /* malloc_footprint(); @@ -828,7 +825,7 @@ extern "C" Even if locks are otherwise defined, this function does not use them, so results might not be up to date. */ - size_t dlmalloc_footprint(void); +size_t dlmalloc_footprint(void); /* malloc_max_footprint(); @@ -841,7 +838,7 @@ extern "C" otherwise defined, this function does not use them, so results might not be up to date. */ - size_t dlmalloc_max_footprint(void); +size_t dlmalloc_max_footprint(void); #if !NO_MALLINFO /* @@ -866,8 +863,8 @@ extern "C" be kept as longs, the reported values may wrap around zero and thus be inaccurate. */ - struct mallinfo dlmallinfo(void); -#endif /* NO_MALLINFO */ +struct mallinfo dlmallinfo(void); +#endif /* NO_MALLINFO */ /* independent_calloc(size_t n_elements, size_t element_size, void* chunks[]); @@ -921,7 +918,7 @@ extern "C" return first; } */ - void **dlindependent_calloc(size_t, size_t, void **); +void** dlindependent_calloc(size_t, size_t, void**); /* independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]); @@ -982,7 +979,7 @@ extern "C" since it cannot reuse existing noncontiguous small chunks that might be available for some of the elements. */ - void **dlindependent_comalloc(size_t, size_t *, void **); +void** dlindependent_comalloc(size_t, size_t*, void**); /* @@ -990,7 +987,7 @@ extern "C" Equivalent to valloc(minimum-page-that-holds(n)), that is, round up n to nearest pagesize. */ - void *dlpvalloc(size_t); +void* dlpvalloc(size_t); /* malloc_trim(size_t pad); @@ -1013,7 +1010,7 @@ extern "C" Malloc_trim returns 1 if it actually released any memory, else 0. */ - int dlmalloc_trim(size_t); +int dlmalloc_trim(size_t); /* malloc_usable_size(void* p); @@ -1029,7 +1026,7 @@ extern "C" p = malloc(n); assert(malloc_usable_size(p) >= 256); */ - size_t dlmalloc_usable_size(void *); +size_t dlmalloc_usable_size(void*); /* malloc_stats(); @@ -1050,9 +1047,9 @@ extern "C" malloc_stats prints only the most commonly interesting statistics. More information can be obtained by calling mallinfo. */ - void dlmalloc_stats(void); +void dlmalloc_stats(void); -#endif /* ONLY_MSPACES */ +#endif /* ONLY_MSPACES */ #if MSPACES @@ -1060,7 +1057,7 @@ extern "C" mspace is an opaque type representing an independent region of space that supports mspace_malloc, etc. */ - typedef void *mspace; +typedef void* mspace; /* create_mspace creates and returns a new independent space with the @@ -1073,7 +1070,7 @@ extern "C" compiling with a different DEFAULT_GRANULARITY or dynamically setting with mallopt(M_GRANULARITY, value). */ - mspace create_mspace(size_t capacity, int locked); +mspace create_mspace(size_t capacity, int locked); /* destroy_mspace destroys the given space, and attempts to return all @@ -1081,7 +1078,7 @@ extern "C" bytes freed. After destruction, the results of access to all memory used by the space become undefined. */ - size_t destroy_mspace(mspace msp); +size_t destroy_mspace(mspace msp); /* create_mspace_with_base uses the memory supplied as the initial base @@ -1092,13 +1089,13 @@ extern "C" Destroying this space will deallocate all additionally allocated space (if possible) but not the initial base. */ - mspace create_mspace_with_base(void *base, size_t capacity, int locked); +mspace create_mspace_with_base(void* base, size_t capacity, int locked); /* mspace_malloc behaves as malloc, but operates within the given space. */ - void *mspace_malloc(mspace msp, size_t bytes); +void* mspace_malloc(mspace msp, size_t bytes); /* mspace_free behaves as free, but operates within @@ -1108,7 +1105,7 @@ extern "C" free may be called instead of mspace_free because freed chunks from any space are handled by their originating spaces. */ - void mspace_free(mspace msp, void *mem); +void mspace_free(mspace msp, void* mem); /* mspace_realloc behaves as realloc, but operates within @@ -1119,45 +1116,45 @@ extern "C" realloced chunks from any space are handled by their originating spaces. */ - void *mspace_realloc(mspace msp, void *mem, size_t newsize); +void* mspace_realloc(mspace msp, void* mem, size_t newsize); /* mspace_calloc behaves as calloc, but operates within the given space. */ - void *mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); +void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size); /* mspace_memalign behaves as memalign, but operates within the given space. */ - void *mspace_memalign(mspace msp, size_t alignment, size_t bytes); +void* mspace_memalign(mspace msp, size_t alignment, size_t bytes); /* mspace_independent_calloc behaves as independent_calloc, but operates within the given space. */ - void **mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void *chunks[]); +void** mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void* chunks[]); /* mspace_independent_comalloc behaves as independent_comalloc, but operates within the given space. */ - void **mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void *chunks[]); +void** mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void* chunks[]); /* mspace_footprint() returns the number of bytes obtained from the system for this space. */ - size_t mspace_footprint(mspace msp); +size_t mspace_footprint(mspace msp); /* mspace_max_footprint() returns the peak number of bytes obtained from the system for this space. */ - size_t mspace_max_footprint(mspace msp); +size_t mspace_max_footprint(mspace msp); #if !NO_MALLINFO @@ -1165,30 +1162,30 @@ extern "C" mspace_mallinfo behaves as mallinfo, but reports properties of the given space. */ - struct mallinfo mspace_mallinfo(mspace msp); -#endif /* NO_MALLINFO */ +struct mallinfo mspace_mallinfo(mspace msp); +#endif /* NO_MALLINFO */ /* mspace_malloc_stats behaves as malloc_stats, but reports properties of the given space. */ - void mspace_malloc_stats(mspace msp); +void mspace_malloc_stats(mspace msp); /* mspace_trim behaves as malloc_trim, but operates within the given space. */ - int mspace_trim(mspace msp, size_t pad); +int mspace_trim(mspace msp, size_t pad); /* An alias for mallopt. */ - int mspace_mallopt(int, int); +int mspace_mallopt(int, int); -#endif /* MSPACES */ +#endif /* MSPACES */ #ifdef __cplusplus -}; /* end of extern "C" */ +}; /* end of extern "C" */ #endif /* __cplusplus */ /* @@ -1204,21 +1201,21 @@ extern "C" /*------------------------------ internal #includes ---------------------- */ #ifdef _MSC_VER -#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ +#pragma warning( disable : 4146 ) /* no "unsigned" warnings */ #endif /* _MSC_VER */ #ifndef LACKS_STDIO_H -#include /* for printing in malloc_stats */ +#include /* for printing in malloc_stats */ #endif #ifndef LACKS_ERRNO_H -#include /* for MALLOC_FAILURE_ACTION */ +#include /* for MALLOC_FAILURE_ACTION */ #endif /* LACKS_ERRNO_H */ #if FOOTERS -#include /* for magic initialization */ +#include /* for magic initialization */ #endif /* FOOTERS */ #ifndef LACKS_STDLIB_H -#include /* for abort() */ +#include /* for abort() */ #endif /* LACKS_STDLIB_H */ #ifdef DEBUG #if ABORT_ON_ASSERT_FAILURE @@ -1226,20 +1223,20 @@ extern "C" #else /* ABORT_ON_ASSERT_FAILURE */ #include #endif /* ABORT_ON_ASSERT_FAILURE */ -#else /* DEBUG */ +#else /* DEBUG */ #define assert(x) #endif /* DEBUG */ #ifndef LACKS_STRING_H -#include /* for memset etc */ -#endif /* LACKS_STRING_H */ +#include /* for memset etc */ +#endif /* LACKS_STRING_H */ #if USE_BUILTIN_FFS #ifndef LACKS_STRINGS_H -#include /* for ffs */ +#include /* for ffs */ #endif /* LACKS_STRINGS_H */ #endif /* USE_BUILTIN_FFS */ #if HAVE_MMAP #ifndef LACKS_SYS_MMAN_H -#include /* for mmap */ +#include /* for mmap */ #endif /* LACKS_SYS_MMAN_H */ #ifndef LACKS_FCNTL_H #include @@ -1247,17 +1244,17 @@ extern "C" #endif /* HAVE_MMAP */ #if HAVE_MORECORE #ifndef LACKS_UNISTD_H -#include /* for sbrk */ +#include /* for sbrk */ #else /* LACKS_UNISTD_H */ #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) -extern void *sbrk(ptrdiff_t); +extern void* sbrk(ptrdiff_t); #endif /* FreeBSD etc */ #endif /* LACKS_UNISTD_H */ #endif /* HAVE_MMAP */ #ifndef WIN32 #ifndef malloc_getpagesize -# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ +# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */ # ifndef _SC_PAGE_SIZE # define _SC_PAGE_SIZE _SC_PAGESIZE # endif @@ -1266,10 +1263,10 @@ extern void *sbrk(ptrdiff_t); # define malloc_getpagesize sysconf(_SC_PAGE_SIZE) # else # if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE) -extern size_t getpagesize(); + extern size_t getpagesize(); # define malloc_getpagesize getpagesize() # else -# ifdef WIN32 /* use supplied emulation of getpagesize */ +# ifdef WIN32 /* use supplied emulation of getpagesize */ # define malloc_getpagesize getpagesize() # else # ifndef LACKS_SYS_PARAM_H @@ -1340,7 +1337,7 @@ extern size_t getpagesize(); /* MORECORE and MMAP must return MFAIL on failure */ #define MFAIL ((void*)(MAX_SIZE_T)) -#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ +#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */ #if !HAVE_MMAP #define IS_MMAPPED_BIT (SIZE_T_ZERO) @@ -1353,7 +1350,7 @@ extern size_t getpagesize(); #define IS_MMAPPED_BIT (SIZE_T_ONE) #define USE_MMAP_BIT (SIZE_T_ONE) -#if !defined(WIN32) && !defined (__OS2__) +#if !defined(WIN32) && !defined(__OS2__) #define CALL_MUNMAP(a, s) munmap((a), (s)) #define MMAP_PROT (PROT_READ|PROT_WRITE) #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) @@ -1368,7 +1365,7 @@ extern size_t getpagesize(); is unlikely to be needed, but is supplied just in case. */ #define MMAP_FLAGS (MAP_PRIVATE) -static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ +static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #define CALL_MMAP(s) ((dev_zero_fd < 0) ? \ (dev_zero_fd = open("/dev/zero", O_RDWR), \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ @@ -1415,41 +1412,34 @@ static int os2munmap(void* ptr, size_t size) { #else /* WIN32 */ /* Win32 MMAP via VirtualAlloc */ -static void * -win32mmap(size_t size) -{ - void *ptr = - VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - return (ptr != 0) ? ptr : MFAIL; +static void* win32mmap(size_t size) { + void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE); + return (ptr != 0)? ptr: MFAIL; } /* For direct MMAP, use MEM_TOP_DOWN to minimize interference */ -static void * -win32direct_mmap(size_t size) -{ - void *ptr = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT | MEM_TOP_DOWN, - PAGE_READWRITE); - return (ptr != 0) ? ptr : MFAIL; +static void* win32direct_mmap(size_t size) { + void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, + PAGE_READWRITE); + return (ptr != 0)? ptr: MFAIL; } /* This function supports releasing coalesed segments */ -static int -win32munmap(void *ptr, size_t size) -{ - MEMORY_BASIC_INFORMATION minfo; - char *cptr = ptr; - while (size) { - if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) - return -1; - if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || - minfo.State != MEM_COMMIT || minfo.RegionSize > size) - return -1; - if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) - return -1; - cptr += minfo.RegionSize; - size -= minfo.RegionSize; - } - return 0; +static int win32munmap(void* ptr, size_t size) { + MEMORY_BASIC_INFORMATION minfo; + char* cptr = ptr; + while (size) { + if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0) + return -1; + if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr || + minfo.State != MEM_COMMIT || minfo.RegionSize > size) + return -1; + if (VirtualFree(cptr, 0, MEM_RELEASE) == 0) + return -1; + cptr += minfo.RegionSize; + size -= minfo.RegionSize; + } + return 0; } #define CALL_MMAP(s) win32mmap(s) @@ -1460,13 +1450,13 @@ win32munmap(void *ptr, size_t size) #if HAVE_MMAP && HAVE_MREMAP #define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv)) -#else /* HAVE_MMAP && HAVE_MREMAP */ +#else /* HAVE_MMAP && HAVE_MREMAP */ #define CALL_MREMAP(addr, osz, nsz, mv) MFAIL #endif /* HAVE_MMAP && HAVE_MREMAP */ #if HAVE_MORECORE #define CALL_MORECORE(S) MORECORE(S) -#else /* HAVE_MORECORE */ +#else /* HAVE_MORECORE */ #define CALL_MORECORE(S) MFAIL #endif /* HAVE_MORECORE */ @@ -1526,25 +1516,21 @@ static MLOCK_T magic_init_mutex; */ #define MLOCK_T long -static int -win32_acquire_lock(MLOCK_T * sl) -{ - for (;;) { +static int win32_acquire_lock (MLOCK_T *sl) { + for (;;) { #ifdef InterlockedCompareExchangePointer - if (!InterlockedCompareExchange(sl, 1, 0)) - return 0; -#else /* Use older void* version */ - if (!InterlockedCompareExchange((void **) sl, (void *) 1, (void *) 0)) - return 0; + if (!InterlockedCompareExchange(sl, 1, 0)) + return 0; +#else /* Use older void* version */ + if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0)) + return 0; #endif /* InterlockedCompareExchangePointer */ - Sleep(0); - } + Sleep (0); + } } -static void -win32_release_lock(MLOCK_T * sl) -{ - InterlockedExchange(sl, 0); +static void win32_release_lock (MLOCK_T *sl) { + InterlockedExchange (sl, 0); } #define INITIAL_LOCK(l) *(l)=0 @@ -1557,7 +1543,7 @@ static MLOCK_T magic_init_mutex; #endif /* WIN32 */ #define USE_LOCK_BIT (2U) -#else /* USE_LOCKS */ +#else /* USE_LOCKS */ #define USE_LOCK_BIT (0U) #define INITIAL_LOCK(l) #endif /* USE_LOCKS */ @@ -1573,7 +1559,7 @@ static MLOCK_T magic_init_mutex; #if USE_LOCKS #define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex); #define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex); -#else /* USE_LOCKS */ +#else /* USE_LOCKS */ #define ACQUIRE_MAGIC_INIT_LOCK() #define RELEASE_MAGIC_INIT_LOCK() #endif /* USE_LOCKS */ @@ -1716,20 +1702,19 @@ static MLOCK_T magic_init_mutex; */ -struct malloc_chunk -{ - size_t prev_foot; /* Size of previous chunk (if free). */ - size_t head; /* Size and inuse bits. */ - struct malloc_chunk *fd; /* double links -- used only if free. */ - struct malloc_chunk *bk; +struct malloc_chunk { + size_t prev_foot; /* Size of previous chunk (if free). */ + size_t head; /* Size and inuse bits. */ + struct malloc_chunk* fd; /* double links -- used only if free. */ + struct malloc_chunk* bk; }; -typedef struct malloc_chunk mchunk; -typedef struct malloc_chunk *mchunkptr; -typedef struct malloc_chunk *sbinptr; /* The type of bins of chunks */ -typedef size_t bindex_t; /* Described below */ -typedef unsigned int binmap_t; /* Described below */ -typedef unsigned int flag_t; /* The type of various bit flag sets */ +typedef struct malloc_chunk mchunk; +typedef struct malloc_chunk* mchunkptr; +typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ +typedef size_t bindex_t; /* Described below */ +typedef unsigned int binmap_t; /* Described below */ +typedef unsigned int flag_t; /* The type of various bit flag sets */ /* ------------------- Chunks sizes and alignments ----------------------- */ @@ -1922,22 +1907,21 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ is of course much better. */ -struct malloc_tree_chunk -{ - /* The first four fields must be compatible with malloc_chunk */ - size_t prev_foot; - size_t head; - struct malloc_tree_chunk *fd; - struct malloc_tree_chunk *bk; - - struct malloc_tree_chunk *child[2]; - struct malloc_tree_chunk *parent; - bindex_t index; +struct malloc_tree_chunk { + /* The first four fields must be compatible with malloc_chunk */ + size_t prev_foot; + size_t head; + struct malloc_tree_chunk* fd; + struct malloc_tree_chunk* bk; + + struct malloc_tree_chunk* child[2]; + struct malloc_tree_chunk* parent; + bindex_t index; }; -typedef struct malloc_tree_chunk tchunk; -typedef struct malloc_tree_chunk *tchunkptr; -typedef struct malloc_tree_chunk *tbinptr; /* The type of bins of trees */ +typedef struct malloc_tree_chunk tchunk; +typedef struct malloc_tree_chunk* tchunkptr; +typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */ /* A little helper macro for trees */ #define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1]) @@ -1999,19 +1983,18 @@ typedef struct malloc_tree_chunk *tbinptr; /* The type of bins of trees */ and deallocated/trimmed using MORECORE with negative arguments. */ -struct malloc_segment -{ - char *base; /* base address */ - size_t size; /* allocated size */ - struct malloc_segment *next; /* ptr to next segment */ - flag_t sflags; /* mmap and extern flag */ +struct malloc_segment { + char* base; /* base address */ + size_t size; /* allocated size */ + struct malloc_segment* next; /* ptr to next segment */ + flag_t sflags; /* mmap and extern flag */ }; #define is_mmapped_segment(S) ((S)->sflags & IS_MMAPPED_BIT) #define is_extern_segment(S) ((S)->sflags & EXTERN_BIT) -typedef struct malloc_segment msegment; -typedef struct malloc_segment *msegmentptr; +typedef struct malloc_segment msegment; +typedef struct malloc_segment* msegmentptr; /* ---------------------------- malloc_state ----------------------------- */ @@ -2098,29 +2081,28 @@ typedef struct malloc_segment *msegmentptr; #define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE) #define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD) -struct malloc_state -{ - binmap_t smallmap; - binmap_t treemap; - size_t dvsize; - size_t topsize; - char *least_addr; - mchunkptr dv; - mchunkptr top; - size_t trim_check; - size_t magic; - mchunkptr smallbins[(NSMALLBINS + 1) * 2]; - tbinptr treebins[NTREEBINS]; - size_t footprint; - size_t max_footprint; - flag_t mflags; +struct malloc_state { + binmap_t smallmap; + binmap_t treemap; + size_t dvsize; + size_t topsize; + char* least_addr; + mchunkptr dv; + mchunkptr top; + size_t trim_check; + size_t magic; + mchunkptr smallbins[(NSMALLBINS+1)*2]; + tbinptr treebins[NTREEBINS]; + size_t footprint; + size_t max_footprint; + flag_t mflags; #if USE_LOCKS - MLOCK_T mutex; /* locate lock among fields that rarely change */ -#endif /* USE_LOCKS */ - msegment seg; + MLOCK_T mutex; /* locate lock among fields that rarely change */ +#endif /* USE_LOCKS */ + msegment seg; }; -typedef struct malloc_state *mstate; +typedef struct malloc_state* mstate; /* ------------- Global malloc_state and malloc_params ------------------- */ @@ -2130,14 +2112,13 @@ typedef struct malloc_state *mstate; initialized in init_mparams. */ -struct malloc_params -{ - size_t magic; - size_t page_size; - size_t granularity; - size_t mmap_threshold; - size_t trim_threshold; - flag_t default_mflags; +struct malloc_params { + size_t magic; + size_t page_size; + size_t granularity; + size_t mmap_threshold; + size_t trim_threshold; + flag_t default_mflags; }; static struct malloc_params mparams; @@ -2186,34 +2167,30 @@ static struct malloc_state _gm_; ((char*)(A) >= S->base && (char*)(A) < S->base + S->size) /* Return segment holding given address */ -static msegmentptr -segment_holding(mstate m, char *addr) -{ - msegmentptr sp = &m->seg; - for (;;) { - if (addr >= sp->base && addr < sp->base + sp->size) - return sp; - if ((sp = sp->next) == 0) - return 0; - } +static msegmentptr segment_holding(mstate m, char* addr) { + msegmentptr sp = &m->seg; + for (;;) { + if (addr >= sp->base && addr < sp->base + sp->size) + return sp; + if ((sp = sp->next) == 0) + return 0; + } } /* Return true if segment contains a segment link */ -static int -has_segment_link(mstate m, msegmentptr ss) -{ - msegmentptr sp = &m->seg; - for (;;) { - if ((char *) sp >= ss->base && (char *) sp < ss->base + ss->size) - return 1; - if ((sp = sp->next) == 0) - return 0; - } +static int has_segment_link(mstate m, msegmentptr ss) { + msegmentptr sp = &m->seg; + for (;;) { + if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size) + return 1; + if ((sp = sp->next) == 0) + return 0; + } } #ifndef MORECORE_CANNOT_TRIM #define should_trim(M,s) ((s) > (M)->trim_check) -#else /* MORECORE_CANNOT_TRIM */ +#else /* MORECORE_CANNOT_TRIM */ #define should_trim(M,s) (0) #endif /* MORECORE_CANNOT_TRIM */ @@ -2245,11 +2222,11 @@ has_segment_link(mstate m, msegmentptr ss) #ifndef PREACTION #define PREACTION(M) (0) -#endif /* PREACTION */ +#endif /* PREACTION */ #ifndef POSTACTION #define POSTACTION(M) -#endif /* POSTACTION */ +#endif /* POSTACTION */ #endif /* USE_LOCKS */ @@ -2286,7 +2263,7 @@ static void reset_on_error(mstate m); /* -------------------------- Debugging setup ---------------------------- */ -#if ! DEBUG +#ifndef DEBUG #define check_free_chunk(M,P) #define check_inuse_chunk(M,P) @@ -2303,17 +2280,17 @@ static void reset_on_error(mstate m); #define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P) #define check_malloc_state(M) do_check_malloc_state(M) -static void do_check_any_chunk(mstate m, mchunkptr p); -static void do_check_top_chunk(mstate m, mchunkptr p); -static void do_check_mmapped_chunk(mstate m, mchunkptr p); -static void do_check_inuse_chunk(mstate m, mchunkptr p); -static void do_check_free_chunk(mstate m, mchunkptr p); -static void do_check_malloced_chunk(mstate m, void *mem, size_t s); -static void do_check_tree(mstate m, tchunkptr t); -static void do_check_treebin(mstate m, bindex_t i); -static void do_check_smallbin(mstate m, bindex_t i); -static void do_check_malloc_state(mstate m); -static int bin_find(mstate m, mchunkptr x); +static void do_check_any_chunk(mstate m, mchunkptr p); +static void do_check_top_chunk(mstate m, mchunkptr p); +static void do_check_mmapped_chunk(mstate m, mchunkptr p); +static void do_check_inuse_chunk(mstate m, mchunkptr p); +static void do_check_free_chunk(mstate m, mchunkptr p); +static void do_check_malloced_chunk(mstate m, void* mem, size_t s); +static void do_check_tree(mstate m, tchunkptr t); +static void do_check_treebin(mstate m, bindex_t i); +static void do_check_smallbin(mstate m, bindex_t i); +static void do_check_malloc_state(mstate m); +static int bin_find(mstate m, mchunkptr x); static size_t traverse_and_check(mstate m); #endif /* DEBUG */ @@ -2479,7 +2456,7 @@ static size_t traverse_and_check(mstate m); #if (FOOTERS && !INSECURE) /* Check if (alleged) mstate m has expected magic field */ #define ok_magic(M) ((M)->magic == mparams.magic) -#else /* (FOOTERS && !INSECURE) */ +#else /* (FOOTERS && !INSECURE) */ #define ok_magic(M) (1) #endif /* (FOOTERS && !INSECURE) */ @@ -2544,485 +2521,460 @@ static size_t traverse_and_check(mstate m); /* ---------------------------- setting mparams -------------------------- */ /* Initialize mparams */ -static int -init_mparams(void) -{ - if (mparams.page_size == 0) { - size_t s; +static int init_mparams(void) { + if (mparams.page_size == 0) { + size_t s; - mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; - mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; + mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD; + mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD; #if MORECORE_CONTIGUOUS - mparams.default_mflags = USE_LOCK_BIT | USE_MMAP_BIT; -#else /* MORECORE_CONTIGUOUS */ - mparams.default_mflags = - USE_LOCK_BIT | USE_MMAP_BIT | USE_NONCONTIGUOUS_BIT; + mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT; +#else /* MORECORE_CONTIGUOUS */ + mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT; #endif /* MORECORE_CONTIGUOUS */ #if (FOOTERS && !INSECURE) - { + { #if USE_DEV_RANDOM - int fd; - unsigned char buf[sizeof(size_t)]; - /* Try to use /dev/urandom, else fall back on using time */ - if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 && - read(fd, buf, sizeof(buf)) == sizeof(buf)) { - s = *((size_t *) buf); - close(fd); - } else + int fd; + unsigned char buf[sizeof(size_t)]; + /* Try to use /dev/urandom, else fall back on using time */ + if ((fd = open("/dev/urandom", O_RDONLY)) < 0) { + s = 0; + } else { + s = read(fd, buf, sizeof(buf)); + close(fd); + } + if (s == sizeof(buf)) + s = *((size_t *)buf); + else #endif /* USE_DEV_RANDOM */ - s = (size_t) (time(0) ^ (size_t) 0x55555555U); + s = (size_t)(time(0) ^ (size_t)0x55555555U); - s |= (size_t) 8U; /* ensure nonzero */ - s &= ~(size_t) 7U; /* improve chances of fault for bad values */ + s |= (size_t)8U; /* ensure nonzero */ + s &= ~(size_t)7U; /* improve chances of fault for bad values */ - } + } #else /* (FOOTERS && !INSECURE) */ - s = (size_t) 0x58585858U; + s = (size_t)0x58585858U; #endif /* (FOOTERS && !INSECURE) */ - (void)ACQUIRE_MAGIC_INIT_LOCK(); - if (mparams.magic == 0) { - mparams.magic = s; - /* Set up lock for main malloc area */ - INITIAL_LOCK(&gm->mutex); - gm->mflags = mparams.default_mflags; - } - RELEASE_MAGIC_INIT_LOCK(); + (void)ACQUIRE_MAGIC_INIT_LOCK(); + if (mparams.magic == 0) { + mparams.magic = s; + /* Set up lock for main malloc area */ + INITIAL_LOCK(&gm->mutex); + gm->mflags = mparams.default_mflags; + } + RELEASE_MAGIC_INIT_LOCK(); #if !defined(WIN32) && !defined(__OS2__) - mparams.page_size = malloc_getpagesize; - mparams.granularity = ((DEFAULT_GRANULARITY != 0) ? - DEFAULT_GRANULARITY : mparams.page_size); + mparams.page_size = malloc_getpagesize; + mparams.granularity = ((DEFAULT_GRANULARITY != 0)? + DEFAULT_GRANULARITY : mparams.page_size); #elif defined (__OS2__) - /* if low-memory is used, os2munmap() would break - if it were anything other than 64k */ - mparams.page_size = 4096u; - mparams.granularity = 65536u; + /* if low-memory is used, os2munmap() would break + if it were anything other than 64k */ + mparams.page_size = 4096u; + mparams.granularity = 65536u; #else /* WIN32 */ - { - SYSTEM_INFO system_info; - GetSystemInfo(&system_info); - mparams.page_size = system_info.dwPageSize; - mparams.granularity = system_info.dwAllocationGranularity; - } + { + SYSTEM_INFO system_info; + GetSystemInfo(&system_info); + mparams.page_size = system_info.dwPageSize; + mparams.granularity = system_info.dwAllocationGranularity; + } #endif /* WIN32 */ - /* Sanity-check configuration: - size_t must be unsigned and as wide as pointer type. - ints must be at least 4 bytes. - alignment must be at least 8. - Alignment, min chunk size, and page size must all be powers of 2. - */ - if ((sizeof(size_t) != sizeof(char *)) || - (MAX_SIZE_T < MIN_CHUNK_SIZE) || - (sizeof(int) < 4) || - (MALLOC_ALIGNMENT < (size_t) 8U) || - ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT - SIZE_T_ONE)) != 0) || - ((MCHUNK_SIZE & (MCHUNK_SIZE - SIZE_T_ONE)) != 0) || - ((mparams.granularity & (mparams.granularity - SIZE_T_ONE)) != 0) - || ((mparams.page_size & (mparams.page_size - SIZE_T_ONE)) != 0)) - ABORT; - } - return 0; + /* Sanity-check configuration: + size_t must be unsigned and as wide as pointer type. + ints must be at least 4 bytes. + alignment must be at least 8. + Alignment, min chunk size, and page size must all be powers of 2. + */ + if ((sizeof(size_t) != sizeof(char*)) || + (MAX_SIZE_T < MIN_CHUNK_SIZE) || + (sizeof(int) < 4) || + (MALLOC_ALIGNMENT < (size_t)8U) || + ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) || + ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) || + ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) || + ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0)) + ABORT; + } + return 0; } /* support for mallopt */ -static int -change_mparam(int param_number, int value) -{ - size_t val = (size_t) value; - init_mparams(); - switch (param_number) { - case M_TRIM_THRESHOLD: - mparams.trim_threshold = val; - return 1; - case M_GRANULARITY: - if (val >= mparams.page_size && ((val & (val - 1)) == 0)) { - mparams.granularity = val; - return 1; - } else - return 0; - case M_MMAP_THRESHOLD: - mparams.mmap_threshold = val; - return 1; - default: - return 0; +static int change_mparam(int param_number, int value) { + size_t val = (size_t)value; + init_mparams(); + switch(param_number) { + case M_TRIM_THRESHOLD: + mparams.trim_threshold = val; + return 1; + case M_GRANULARITY: + if (val >= mparams.page_size && ((val & (val-1)) == 0)) { + mparams.granularity = val; + return 1; } + else + return 0; + case M_MMAP_THRESHOLD: + mparams.mmap_threshold = val; + return 1; + default: + return 0; + } } -#if DEBUG +#ifdef DEBUG /* ------------------------- Debugging Support --------------------------- */ /* Check properties of any chunk, whether free, inuse, mmapped etc */ -static void -do_check_any_chunk(mstate m, mchunkptr p) -{ - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); +static void do_check_any_chunk(mstate m, mchunkptr p) { + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); } /* Check properties of top chunk */ -static void -do_check_top_chunk(mstate m, mchunkptr p) -{ - msegmentptr sp = segment_holding(m, (char *) p); - size_t sz = chunksize(p); - assert(sp != 0); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(sz == m->topsize); - assert(sz > 0); - assert(sz == ((sp->base + sp->size) - (char *) p) - TOP_FOOT_SIZE); - assert(pinuse(p)); - assert(!next_pinuse(p)); +static void do_check_top_chunk(mstate m, mchunkptr p) { + msegmentptr sp = segment_holding(m, (char*)p); + size_t sz = chunksize(p); + assert(sp != 0); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(sz == m->topsize); + assert(sz > 0); + assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE); + assert(pinuse(p)); + assert(!next_pinuse(p)); } /* Check properties of (inuse) mmapped chunks */ -static void -do_check_mmapped_chunk(mstate m, mchunkptr p) -{ - size_t sz = chunksize(p); - size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); - assert(is_mmapped(p)); - assert(use_mmap(m)); - assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); - assert(ok_address(m, p)); - assert(!is_small(sz)); - assert((len & (mparams.page_size - SIZE_T_ONE)) == 0); - assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); - assert(chunk_plus_offset(p, sz + SIZE_T_SIZE)->head == 0); +static void do_check_mmapped_chunk(mstate m, mchunkptr p) { + size_t sz = chunksize(p); + size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD); + assert(is_mmapped(p)); + assert(use_mmap(m)); + assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD)); + assert(ok_address(m, p)); + assert(!is_small(sz)); + assert((len & (mparams.page_size-SIZE_T_ONE)) == 0); + assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD); + assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0); } /* Check properties of inuse chunks */ -static void -do_check_inuse_chunk(mstate m, mchunkptr p) -{ - do_check_any_chunk(m, p); - assert(cinuse(p)); - assert(next_pinuse(p)); - /* If not pinuse and not mmapped, previous chunk has OK offset */ - assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); - if (is_mmapped(p)) - do_check_mmapped_chunk(m, p); +static void do_check_inuse_chunk(mstate m, mchunkptr p) { + do_check_any_chunk(m, p); + assert(cinuse(p)); + assert(next_pinuse(p)); + /* If not pinuse and not mmapped, previous chunk has OK offset */ + assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p); + if (is_mmapped(p)) + do_check_mmapped_chunk(m, p); } /* Check properties of free chunks */ -static void -do_check_free_chunk(mstate m, mchunkptr p) -{ - size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT); - mchunkptr next = chunk_plus_offset(p, sz); - do_check_any_chunk(m, p); - assert(!cinuse(p)); - assert(!next_pinuse(p)); - assert(!is_mmapped(p)); - if (p != m->dv && p != m->top) { - if (sz >= MIN_CHUNK_SIZE) { - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(is_aligned(chunk2mem(p))); - assert(next->prev_foot == sz); - assert(pinuse(p)); - assert(next == m->top || cinuse(next)); - assert(p->fd->bk == p); - assert(p->bk->fd == p); - } else /* markers are always of size SIZE_T_SIZE */ - assert(sz == SIZE_T_SIZE); +static void do_check_free_chunk(mstate m, mchunkptr p) { + size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); + mchunkptr next = chunk_plus_offset(p, sz); + do_check_any_chunk(m, p); + assert(!cinuse(p)); + assert(!next_pinuse(p)); + assert (!is_mmapped(p)); + if (p != m->dv && p != m->top) { + if (sz >= MIN_CHUNK_SIZE) { + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(is_aligned(chunk2mem(p))); + assert(next->prev_foot == sz); + assert(pinuse(p)); + assert (next == m->top || cinuse(next)); + assert(p->fd->bk == p); + assert(p->bk->fd == p); } + else /* markers are always of size SIZE_T_SIZE */ + assert(sz == SIZE_T_SIZE); + } } /* Check properties of malloced chunks at the point they are malloced */ -static void -do_check_malloced_chunk(mstate m, void *mem, size_t s) -{ - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - size_t sz = p->head & ~(PINUSE_BIT | CINUSE_BIT); - do_check_inuse_chunk(m, p); - assert((sz & CHUNK_ALIGN_MASK) == 0); - assert(sz >= MIN_CHUNK_SIZE); - assert(sz >= s); - /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ - assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); - } +static void do_check_malloced_chunk(mstate m, void* mem, size_t s) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT); + do_check_inuse_chunk(m, p); + assert((sz & CHUNK_ALIGN_MASK) == 0); + assert(sz >= MIN_CHUNK_SIZE); + assert(sz >= s); + /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */ + assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE)); + } } /* Check a tree and its subtrees. */ -static void -do_check_tree(mstate m, tchunkptr t) -{ - tchunkptr head = 0; - tchunkptr u = t; - bindex_t tindex = t->index; - size_t tsize = chunksize(t); - bindex_t idx; - compute_tree_index(tsize, idx); - assert(tindex == idx); - assert(tsize >= MIN_LARGE_SIZE); - assert(tsize >= minsize_for_tree_index(idx)); - assert((idx == NTREEBINS - 1) - || (tsize < minsize_for_tree_index((idx + 1)))); - - do { /* traverse through chain of same-sized nodes */ - do_check_any_chunk(m, ((mchunkptr) u)); - assert(u->index == tindex); - assert(chunksize(u) == tsize); - assert(!cinuse(u)); - assert(!next_pinuse(u)); - assert(u->fd->bk == u); - assert(u->bk->fd == u); - if (u->parent == 0) { - assert(u->child[0] == 0); - assert(u->child[1] == 0); - } else { - assert(head == 0); /* only one node on chain has parent */ - head = u; - assert(u->parent != u); - assert(u->parent->child[0] == u || - u->parent->child[1] == u || - *((tbinptr *) (u->parent)) == u); - if (u->child[0] != 0) { - assert(u->child[0]->parent == u); - assert(u->child[0] != u); - do_check_tree(m, u->child[0]); - } - if (u->child[1] != 0) { - assert(u->child[1]->parent == u); - assert(u->child[1] != u); - do_check_tree(m, u->child[1]); - } - if (u->child[0] != 0 && u->child[1] != 0) { - assert(chunksize(u->child[0]) < chunksize(u->child[1])); - } - } - u = u->fd; - } while (u != t); - assert(head != 0); +static void do_check_tree(mstate m, tchunkptr t) { + tchunkptr head = 0; + tchunkptr u = t; + bindex_t tindex = t->index; + size_t tsize = chunksize(t); + bindex_t idx; + compute_tree_index(tsize, idx); + assert(tindex == idx); + assert(tsize >= MIN_LARGE_SIZE); + assert(tsize >= minsize_for_tree_index(idx)); + assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1)))); + + do { /* traverse through chain of same-sized nodes */ + do_check_any_chunk(m, ((mchunkptr)u)); + assert(u->index == tindex); + assert(chunksize(u) == tsize); + assert(!cinuse(u)); + assert(!next_pinuse(u)); + assert(u->fd->bk == u); + assert(u->bk->fd == u); + if (u->parent == 0) { + assert(u->child[0] == 0); + assert(u->child[1] == 0); + } + else { + assert(head == 0); /* only one node on chain has parent */ + head = u; + assert(u->parent != u); + assert (u->parent->child[0] == u || + u->parent->child[1] == u || + *((tbinptr*)(u->parent)) == u); + if (u->child[0] != 0) { + assert(u->child[0]->parent == u); + assert(u->child[0] != u); + do_check_tree(m, u->child[0]); + } + if (u->child[1] != 0) { + assert(u->child[1]->parent == u); + assert(u->child[1] != u); + do_check_tree(m, u->child[1]); + } + if (u->child[0] != 0 && u->child[1] != 0) { + assert(chunksize(u->child[0]) < chunksize(u->child[1])); + } + } + u = u->fd; + } while (u != t); + assert(head != 0); } /* Check all the chunks in a treebin. */ -static void -do_check_treebin(mstate m, bindex_t i) -{ - tbinptr *tb = treebin_at(m, i); - tchunkptr t = *tb; - int empty = (m->treemap & (1U << i)) == 0; - if (t == 0) - assert(empty); - if (!empty) - do_check_tree(m, t); +static void do_check_treebin(mstate m, bindex_t i) { + tbinptr* tb = treebin_at(m, i); + tchunkptr t = *tb; + int empty = (m->treemap & (1U << i)) == 0; + if (t == 0) + assert(empty); + if (!empty) + do_check_tree(m, t); } /* Check all the chunks in a smallbin. */ -static void -do_check_smallbin(mstate m, bindex_t i) -{ - sbinptr b = smallbin_at(m, i); - mchunkptr p = b->bk; - unsigned int empty = (m->smallmap & (1U << i)) == 0; - if (p == b) - assert(empty); - if (!empty) { - for (; p != b; p = p->bk) { - size_t size = chunksize(p); - mchunkptr q; - /* each chunk claims to be free */ - do_check_free_chunk(m, p); - /* chunk belongs in bin */ - assert(small_index(size) == i); - assert(p->bk == b || chunksize(p->bk) == chunksize(p)); - /* chunk is followed by an inuse chunk */ - q = next_chunk(p); - if (q->head != FENCEPOST_HEAD) - do_check_inuse_chunk(m, q); - } +static void do_check_smallbin(mstate m, bindex_t i) { + sbinptr b = smallbin_at(m, i); + mchunkptr p = b->bk; + unsigned int empty = (m->smallmap & (1U << i)) == 0; + if (p == b) + assert(empty); + if (!empty) { + for (; p != b; p = p->bk) { + size_t size = chunksize(p); + mchunkptr q; + /* each chunk claims to be free */ + do_check_free_chunk(m, p); + /* chunk belongs in bin */ + assert(small_index(size) == i); + assert(p->bk == b || chunksize(p->bk) == chunksize(p)); + /* chunk is followed by an inuse chunk */ + q = next_chunk(p); + if (q->head != FENCEPOST_HEAD) + do_check_inuse_chunk(m, q); } + } } /* Find x in a bin. Used in other check functions. */ -static int -bin_find(mstate m, mchunkptr x) -{ - size_t size = chunksize(x); - if (is_small(size)) { - bindex_t sidx = small_index(size); - sbinptr b = smallbin_at(m, sidx); - if (smallmap_is_marked(m, sidx)) { - mchunkptr p = b; - do { - if (p == x) - return 1; - } while ((p = p->fd) != b); - } - } else { - bindex_t tidx; - compute_tree_index(size, tidx); - if (treemap_is_marked(m, tidx)) { - tchunkptr t = *treebin_at(m, tidx); - size_t sizebits = size << leftshift_for_tree_index(tidx); - while (t != 0 && chunksize(t) != size) { - t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1]; - sizebits <<= 1; - } - if (t != 0) { - tchunkptr u = t; - do { - if (u == (tchunkptr) x) - return 1; - } while ((u = u->fd) != t); - } - } +static int bin_find(mstate m, mchunkptr x) { + size_t size = chunksize(x); + if (is_small(size)) { + bindex_t sidx = small_index(size); + sbinptr b = smallbin_at(m, sidx); + if (smallmap_is_marked(m, sidx)) { + mchunkptr p = b; + do { + if (p == x) + return 1; + } while ((p = p->fd) != b); } - return 0; + } + else { + bindex_t tidx; + compute_tree_index(size, tidx); + if (treemap_is_marked(m, tidx)) { + tchunkptr t = *treebin_at(m, tidx); + size_t sizebits = size << leftshift_for_tree_index(tidx); + while (t != 0 && chunksize(t) != size) { + t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; + sizebits <<= 1; + } + if (t != 0) { + tchunkptr u = t; + do { + if (u == (tchunkptr)x) + return 1; + } while ((u = u->fd) != t); + } + } + } + return 0; } /* Traverse each chunk and check it; return total */ -static size_t -traverse_and_check(mstate m) -{ - size_t sum = 0; - if (is_initialized(m)) { - msegmentptr s = &m->seg; - sum += m->topsize + TOP_FOOT_SIZE; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - mchunkptr lastq = 0; - assert(pinuse(q)); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - sum += chunksize(q); - if (cinuse(q)) { - assert(!bin_find(m, q)); - do_check_inuse_chunk(m, q); - } else { - assert(q == m->dv || bin_find(m, q)); - assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ - do_check_free_chunk(m, q); - } - lastq = q; - q = next_chunk(q); - } - s = s->next; +static size_t traverse_and_check(mstate m) { + size_t sum = 0; + if (is_initialized(m)) { + msegmentptr s = &m->seg; + sum += m->topsize + TOP_FOOT_SIZE; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + mchunkptr lastq = 0; + assert(pinuse(q)); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + sum += chunksize(q); + if (cinuse(q)) { + assert(!bin_find(m, q)); + do_check_inuse_chunk(m, q); + } + else { + assert(q == m->dv || bin_find(m, q)); + assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */ + do_check_free_chunk(m, q); } + lastq = q; + q = next_chunk(q); + } + s = s->next; } - return sum; + } + return sum; } /* Check all properties of malloc_state. */ -static void -do_check_malloc_state(mstate m) -{ - bindex_t i; - size_t total; - /* check bins */ - for (i = 0; i < NSMALLBINS; ++i) - do_check_smallbin(m, i); - for (i = 0; i < NTREEBINS; ++i) - do_check_treebin(m, i); - - if (m->dvsize != 0) { /* check dv chunk */ - do_check_any_chunk(m, m->dv); - assert(m->dvsize == chunksize(m->dv)); - assert(m->dvsize >= MIN_CHUNK_SIZE); - assert(bin_find(m, m->dv) == 0); - } +static void do_check_malloc_state(mstate m) { + bindex_t i; + size_t total; + /* check bins */ + for (i = 0; i < NSMALLBINS; ++i) + do_check_smallbin(m, i); + for (i = 0; i < NTREEBINS; ++i) + do_check_treebin(m, i); + + if (m->dvsize != 0) { /* check dv chunk */ + do_check_any_chunk(m, m->dv); + assert(m->dvsize == chunksize(m->dv)); + assert(m->dvsize >= MIN_CHUNK_SIZE); + assert(bin_find(m, m->dv) == 0); + } - if (m->top != 0) { /* check top chunk */ - do_check_top_chunk(m, m->top); - assert(m->topsize == chunksize(m->top)); - assert(m->topsize > 0); - assert(bin_find(m, m->top) == 0); - } + if (m->top != 0) { /* check top chunk */ + do_check_top_chunk(m, m->top); + assert(m->topsize == chunksize(m->top)); + assert(m->topsize > 0); + assert(bin_find(m, m->top) == 0); + } - total = traverse_and_check(m); - assert(total <= m->footprint); - assert(m->footprint <= m->max_footprint); + total = traverse_and_check(m); + assert(total <= m->footprint); + assert(m->footprint <= m->max_footprint); } #endif /* DEBUG */ /* ----------------------------- statistics ------------------------------ */ #if !NO_MALLINFO -static struct mallinfo -internal_mallinfo(mstate m) -{ - struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - if (!PREACTION(m)) { - check_malloc_state(m); - if (is_initialized(m)) { - size_t nfree = SIZE_T_ONE; /* top always free */ - size_t mfree = m->topsize + TOP_FOOT_SIZE; - size_t sum = mfree; - msegmentptr s = &m->seg; - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - size_t sz = chunksize(q); - sum += sz; - if (!cinuse(q)) { - mfree += sz; - ++nfree; - } - q = next_chunk(q); - } - s = s->next; - } - - nm.arena = sum; - nm.ordblks = nfree; - nm.hblkhd = m->footprint - sum; - nm.usmblks = m->max_footprint; - nm.uordblks = m->footprint - mfree; - nm.fordblks = mfree; - nm.keepcost = m->topsize; +static struct mallinfo internal_mallinfo(mstate m) { + struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + if (!PREACTION(m)) { + check_malloc_state(m); + if (is_initialized(m)) { + size_t nfree = SIZE_T_ONE; /* top always free */ + size_t mfree = m->topsize + TOP_FOOT_SIZE; + size_t sum = mfree; + msegmentptr s = &m->seg; + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + size_t sz = chunksize(q); + sum += sz; + if (!cinuse(q)) { + mfree += sz; + ++nfree; + } + q = next_chunk(q); } + s = s->next; + } - POSTACTION(m); + nm.arena = sum; + nm.ordblks = nfree; + nm.hblkhd = m->footprint - sum; + nm.usmblks = m->max_footprint; + nm.uordblks = m->footprint - mfree; + nm.fordblks = mfree; + nm.keepcost = m->topsize; } - return nm; + + POSTACTION(m); + } + return nm; } #endif /* !NO_MALLINFO */ -static void -internal_malloc_stats(mstate m) -{ - if (!PREACTION(m)) { +static void internal_malloc_stats(mstate m) { + if (!PREACTION(m)) { #ifndef LACKS_STDIO_H - size_t maxfp = 0; + size_t maxfp = 0; #endif - size_t fp = 0; - size_t used = 0; - check_malloc_state(m); - if (is_initialized(m)) { - msegmentptr s = &m->seg; + size_t fp = 0; + size_t used = 0; + check_malloc_state(m); + if (is_initialized(m)) { + msegmentptr s = &m->seg; #ifndef LACKS_STDIO_H - maxfp = m->max_footprint; + maxfp = m->max_footprint; #endif - fp = m->footprint; - used = fp - (m->topsize + TOP_FOOT_SIZE); - - while (s != 0) { - mchunkptr q = align_as_chunk(s->base); - while (segment_holds(s, q) && - q != m->top && q->head != FENCEPOST_HEAD) { - if (!cinuse(q)) - used -= chunksize(q); - q = next_chunk(q); - } - s = s->next; - } + fp = m->footprint; + used = fp - (m->topsize + TOP_FOOT_SIZE); + + while (s != 0) { + mchunkptr q = align_as_chunk(s->base); + while (segment_holds(s, q) && + q != m->top && q->head != FENCEPOST_HEAD) { + if (!cinuse(q)) + used -= chunksize(q); + q = next_chunk(q); } + s = s->next; + } + } + #ifndef LACKS_STDIO_H - fprintf(stderr, "max system bytes = %10lu\n", - (unsigned long) (maxfp)); - fprintf(stderr, "system bytes = %10lu\n", (unsigned long) (fp)); - fprintf(stderr, "in use bytes = %10lu\n", (unsigned long) (used)); + fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp)); + fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp)); + fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used)); #else - (void)used; + (void)used; #endif - POSTACTION(m); - } + POSTACTION(m); + } } /* ----------------------- Operations on smallbins ----------------------- */ @@ -3286,933 +3238,911 @@ internal_malloc_stats(mstate m) */ /* Malloc using mmap */ -static void * -mmap_alloc(mstate m, size_t nb) -{ - size_t mmsize = - granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - if (mmsize > nb) { /* Check for wrap around 0 */ - char *mm = (char *) (DIRECT_MMAP(mmsize)); - if (mm != CMFAIL) { - size_t offset = align_offset(chunk2mem(mm)); - size_t psize = mmsize - offset - MMAP_FOOT_PAD; - mchunkptr p = (mchunkptr) (mm + offset); - p->prev_foot = offset | IS_MMAPPED_BIT; - (p)->head = (psize | CINUSE_BIT); - mark_inuse_foot(m, p, psize); - chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(p, psize + SIZE_T_SIZE)->head = 0; - - if (mm < m->least_addr) - m->least_addr = mm; - if ((m->footprint += mmsize) > m->max_footprint) - m->max_footprint = m->footprint; - assert(is_aligned(chunk2mem(p))); - check_mmapped_chunk(m, p); - return chunk2mem(p); - } +static void* mmap_alloc(mstate m, size_t nb) { + size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + if (mmsize > nb) { /* Check for wrap around 0 */ + char* mm = (char*)(DIRECT_MMAP(mmsize)); + if (mm != CMFAIL) { + size_t offset = align_offset(chunk2mem(mm)); + size_t psize = mmsize - offset - MMAP_FOOT_PAD; + mchunkptr p = (mchunkptr)(mm + offset); + p->prev_foot = offset | IS_MMAPPED_BIT; + (p)->head = (psize|CINUSE_BIT); + mark_inuse_foot(m, p, psize); + chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0; + + if (mm < m->least_addr) + m->least_addr = mm; + if ((m->footprint += mmsize) > m->max_footprint) + m->max_footprint = m->footprint; + assert(is_aligned(chunk2mem(p))); + check_mmapped_chunk(m, p); + return chunk2mem(p); } - return 0; + } + return 0; } /* Realloc using mmap */ -static mchunkptr -mmap_resize(mstate m, mchunkptr oldp, size_t nb) -{ - size_t oldsize = chunksize(oldp); - if (is_small(nb)) /* Can't shrink mmap regions below small size */ - return 0; - /* Keep old chunk if big enough but not too big */ - if (oldsize >= nb + SIZE_T_SIZE && - (oldsize - nb) <= (mparams.granularity << 1)) - return oldp; - else { - size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; - size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; - size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + - CHUNK_ALIGN_MASK); - char *cp = (char *) CALL_MREMAP((char *) oldp - offset, - oldmmsize, newmmsize, 1); - if (cp != CMFAIL) { - mchunkptr newp = (mchunkptr) (cp + offset); - size_t psize = newmmsize - offset - MMAP_FOOT_PAD; - newp->head = (psize | CINUSE_BIT); - mark_inuse_foot(m, newp, psize); - chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; - chunk_plus_offset(newp, psize + SIZE_T_SIZE)->head = 0; - - if (cp < m->least_addr) - m->least_addr = cp; - if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) - m->max_footprint = m->footprint; - check_mmapped_chunk(m, newp); - return newp; - } - } +static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) { + size_t oldsize = chunksize(oldp); + if (is_small(nb)) /* Can't shrink mmap regions below small size */ return 0; + /* Keep old chunk if big enough but not too big */ + if (oldsize >= nb + SIZE_T_SIZE && + (oldsize - nb) <= (mparams.granularity << 1)) + return oldp; + else { + size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT; + size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD; + size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES + + CHUNK_ALIGN_MASK); + char* cp = (char*)CALL_MREMAP((char*)oldp - offset, + oldmmsize, newmmsize, 1); + if (cp != CMFAIL) { + mchunkptr newp = (mchunkptr)(cp + offset); + size_t psize = newmmsize - offset - MMAP_FOOT_PAD; + newp->head = (psize|CINUSE_BIT); + mark_inuse_foot(m, newp, psize); + chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD; + chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0; + + if (cp < m->least_addr) + m->least_addr = cp; + if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint) + m->max_footprint = m->footprint; + check_mmapped_chunk(m, newp); + return newp; + } + } + return 0; } /* -------------------------- mspace management -------------------------- */ /* Initialize top chunk and its size */ -static void -init_top(mstate m, mchunkptr p, size_t psize) -{ - /* Ensure alignment */ - size_t offset = align_offset(chunk2mem(p)); - p = (mchunkptr) ((char *) p + offset); - psize -= offset; - - m->top = p; - m->topsize = psize; - p->head = psize | PINUSE_BIT; - /* set size of fake trailing chunk holding overhead space only once */ - chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; - m->trim_check = mparams.trim_threshold; /* reset on each update */ +static void init_top(mstate m, mchunkptr p, size_t psize) { + /* Ensure alignment */ + size_t offset = align_offset(chunk2mem(p)); + p = (mchunkptr)((char*)p + offset); + psize -= offset; + + m->top = p; + m->topsize = psize; + p->head = psize | PINUSE_BIT; + /* set size of fake trailing chunk holding overhead space only once */ + chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE; + m->trim_check = mparams.trim_threshold; /* reset on each update */ } /* Initialize bins for a new mstate that is otherwise zeroed out */ -static void -init_bins(mstate m) -{ - /* Establish circular links for smallbins */ - bindex_t i; - for (i = 0; i < NSMALLBINS; ++i) { - sbinptr bin = smallbin_at(m, i); - bin->fd = bin->bk = bin; - } +static void init_bins(mstate m) { + /* Establish circular links for smallbins */ + bindex_t i; + for (i = 0; i < NSMALLBINS; ++i) { + sbinptr bin = smallbin_at(m,i); + bin->fd = bin->bk = bin; + } } #if PROCEED_ON_ERROR /* default corruption action */ -static void -reset_on_error(mstate m) -{ - int i; - ++malloc_corruption_error_count; - /* Reinitialize fields to forget about all memory */ - m->smallbins = m->treebins = 0; - m->dvsize = m->topsize = 0; - m->seg.base = 0; - m->seg.size = 0; - m->seg.next = 0; - m->top = m->dv = 0; - for (i = 0; i < NTREEBINS; ++i) - *treebin_at(m, i) = 0; - init_bins(m); +static void reset_on_error(mstate m) { + int i; + ++malloc_corruption_error_count; + /* Reinitialize fields to forget about all memory */ + m->smallbins = m->treebins = 0; + m->dvsize = m->topsize = 0; + m->seg.base = 0; + m->seg.size = 0; + m->seg.next = 0; + m->top = m->dv = 0; + for (i = 0; i < NTREEBINS; ++i) + *treebin_at(m, i) = 0; + init_bins(m); } #endif /* PROCEED_ON_ERROR */ /* Allocate chunk and prepend remainder with chunk in successor base. */ -static void * -prepend_alloc(mstate m, char *newbase, char *oldbase, size_t nb) -{ - mchunkptr p = align_as_chunk(newbase); - mchunkptr oldfirst = align_as_chunk(oldbase); - size_t psize = (char *) oldfirst - (char *) p; - mchunkptr q = chunk_plus_offset(p, nb); - size_t qsize = psize - nb; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - - assert((char *) oldfirst > (char *) q); - assert(pinuse(oldfirst)); - assert(qsize >= MIN_CHUNK_SIZE); - - /* consolidate remainder with first chunk of old base */ - if (oldfirst == m->top) { - size_t tsize = m->topsize += qsize; - m->top = q; - q->head = tsize | PINUSE_BIT; - check_top_chunk(m, q); - } else if (oldfirst == m->dv) { - size_t dsize = m->dvsize += qsize; - m->dv = q; - set_size_and_pinuse_of_free_chunk(q, dsize); - } else { - if (!cinuse(oldfirst)) { - size_t nsize = chunksize(oldfirst); - unlink_chunk(m, oldfirst, nsize); - oldfirst = chunk_plus_offset(oldfirst, nsize); - qsize += nsize; - } - set_free_with_pinuse(q, qsize, oldfirst); - insert_chunk(m, q, qsize); - check_free_chunk(m, q); +static void* prepend_alloc(mstate m, char* newbase, char* oldbase, + size_t nb) { + mchunkptr p = align_as_chunk(newbase); + mchunkptr oldfirst = align_as_chunk(oldbase); + size_t psize = (char*)oldfirst - (char*)p; + mchunkptr q = chunk_plus_offset(p, nb); + size_t qsize = psize - nb; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + + assert((char*)oldfirst > (char*)q); + assert(pinuse(oldfirst)); + assert(qsize >= MIN_CHUNK_SIZE); + + /* consolidate remainder with first chunk of old base */ + if (oldfirst == m->top) { + size_t tsize = m->topsize += qsize; + m->top = q; + q->head = tsize | PINUSE_BIT; + check_top_chunk(m, q); + } + else if (oldfirst == m->dv) { + size_t dsize = m->dvsize += qsize; + m->dv = q; + set_size_and_pinuse_of_free_chunk(q, dsize); + } + else { + if (!cinuse(oldfirst)) { + size_t nsize = chunksize(oldfirst); + unlink_chunk(m, oldfirst, nsize); + oldfirst = chunk_plus_offset(oldfirst, nsize); + qsize += nsize; } + set_free_with_pinuse(q, qsize, oldfirst); + insert_chunk(m, q, qsize); + check_free_chunk(m, q); + } - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); } /* Add a segment to hold a new noncontiguous region */ -static void -add_segment(mstate m, char *tbase, size_t tsize, flag_t mmapped) -{ - /* Determine locations and sizes of segment, fenceposts, old top */ - char *old_top = (char *) m->top; - msegmentptr oldsp = segment_holding(m, old_top); - char *old_end = oldsp->base + oldsp->size; - size_t ssize = pad_request(sizeof(struct malloc_segment)); - char *rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); - size_t offset = align_offset(chunk2mem(rawsp)); - char *asp = rawsp + offset; - char *csp = (asp < (old_top + MIN_CHUNK_SIZE)) ? old_top : asp; - mchunkptr sp = (mchunkptr) csp; - msegmentptr ss = (msegmentptr) (chunk2mem(sp)); - mchunkptr tnext = chunk_plus_offset(sp, ssize); - mchunkptr p = tnext; +static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) { + /* Determine locations and sizes of segment, fenceposts, old top */ + char* old_top = (char*)m->top; + msegmentptr oldsp = segment_holding(m, old_top); + char* old_end = oldsp->base + oldsp->size; + size_t ssize = pad_request(sizeof(struct malloc_segment)); + char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK); + size_t offset = align_offset(chunk2mem(rawsp)); + char* asp = rawsp + offset; + char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp; + mchunkptr sp = (mchunkptr)csp; + msegmentptr ss = (msegmentptr)(chunk2mem(sp)); + mchunkptr tnext = chunk_plus_offset(sp, ssize); + mchunkptr p = tnext; #ifdef DEBUG - int nfences = 0; + int nfences = 0; #endif - /* reset top to new space */ - init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); - - /* Set up segment record */ - assert(is_aligned(ss)); - set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); - *ss = m->seg; /* Push current record */ - m->seg.base = tbase; - m->seg.size = tsize; - m->seg.sflags = mmapped; - m->seg.next = ss; - - /* Insert trailing fenceposts */ - for (;;) { - mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); - p->head = FENCEPOST_HEAD; + /* reset top to new space */ + init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); + + /* Set up segment record */ + assert(is_aligned(ss)); + set_size_and_pinuse_of_inuse_chunk(m, sp, ssize); + *ss = m->seg; /* Push current record */ + m->seg.base = tbase; + m->seg.size = tsize; + m->seg.sflags = mmapped; + m->seg.next = ss; + + /* Insert trailing fenceposts */ + for (;;) { + mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE); + p->head = FENCEPOST_HEAD; #ifdef DEBUG - ++nfences; + ++nfences; #endif - if ((char *) (&(nextp->head)) < old_end) - p = nextp; - else - break; - } + if ((char*)(&(nextp->head)) < old_end) + p = nextp; + else + break; + } #ifdef DEBUG - assert(nfences >= 2); + assert(nfences >= 2); #endif - /* Insert the rest of old top into a bin as an ordinary free chunk */ - if (csp != old_top) { - mchunkptr q = (mchunkptr) old_top; - size_t psize = csp - old_top; - mchunkptr tn = chunk_plus_offset(q, psize); - set_free_with_pinuse(q, psize, tn); - insert_chunk(m, q, psize); - } + /* Insert the rest of old top into a bin as an ordinary free chunk */ + if (csp != old_top) { + mchunkptr q = (mchunkptr)old_top; + size_t psize = csp - old_top; + mchunkptr tn = chunk_plus_offset(q, psize); + set_free_with_pinuse(q, psize, tn); + insert_chunk(m, q, psize); + } - check_top_chunk(m, m->top); + check_top_chunk(m, m->top); } /* -------------------------- System allocation -------------------------- */ /* Get memory from system using MORECORE or MMAP */ -static void * -sys_alloc(mstate m, size_t nb) -{ - char *tbase = CMFAIL; - size_t tsize = 0; - flag_t mmap_flag = 0; - - init_mparams(); - - /* Directly map large chunks */ - if (use_mmap(m) && nb >= mparams.mmap_threshold) { - void *mem = mmap_alloc(m, nb); - if (mem != 0) - return mem; - } +static void* sys_alloc(mstate m, size_t nb) { + char* tbase = CMFAIL; + size_t tsize = 0; + flag_t mmap_flag = 0; + + init_mparams(); + + /* Directly map large chunks */ + if (use_mmap(m) && nb >= mparams.mmap_threshold) { + void* mem = mmap_alloc(m, nb); + if (mem != 0) + return mem; + } - /* - Try getting memory in any of three ways (in most-preferred to - least-preferred order): - 1. A call to MORECORE that can normally contiguously extend memory. + /* + Try getting memory in any of three ways (in most-preferred to + least-preferred order): + 1. A call to MORECORE that can normally contiguously extend memory. (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or or main space is mmapped or a previous contiguous call failed) - 2. A call to MMAP new space (disabled if not HAVE_MMAP). + 2. A call to MMAP new space (disabled if not HAVE_MMAP). Note that under the default settings, if MORECORE is unable to fulfill a request, and HAVE_MMAP is true, then mmap is used as a noncontiguous system allocator. This is a useful backup strategy for systems with holes in address spaces -- in this case sbrk cannot contiguously expand the heap, but mmap may be able to find space. - 3. A call to MORECORE that cannot usually contiguously extend memory. + 3. A call to MORECORE that cannot usually contiguously extend memory. (disabled if not HAVE_MORECORE) - */ - - if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { - char *br = CMFAIL; - msegmentptr ss = - (m->top == 0) ? 0 : segment_holding(m, (char *) m->top); - size_t asize = 0; - ACQUIRE_MORECORE_LOCK(); - - if (ss == 0) { /* First time through or recovery */ - char *base = (char *) CALL_MORECORE(0); - if (base != CMFAIL) { - asize = - granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + - SIZE_T_ONE); - /* Adjust to end on a page boundary */ - if (!is_page_aligned(base)) - asize += (page_align((size_t) base) - (size_t) base); - /* Can't call MORECORE if size is negative when treated as signed */ - if (asize < HALF_MAX_SIZE_T && - (br = (char *) (CALL_MORECORE(asize))) == base) { - tbase = base; - tsize = asize; - } - } - } else { - /* Subtract out existing available top space from MORECORE request. */ - asize = - granularity_align(nb - m->topsize + TOP_FOOT_SIZE + - MALLOC_ALIGNMENT + SIZE_T_ONE); - /* Use mem here only if it did continuously extend old space */ - if (asize < HALF_MAX_SIZE_T && - (br = - (char *) (CALL_MORECORE(asize))) == ss->base + ss->size) { - tbase = br; - tsize = asize; - } + */ + + if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) { + char* br = CMFAIL; + msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top); + size_t asize = 0; + ACQUIRE_MORECORE_LOCK(); + + if (ss == 0) { /* First time through or recovery */ + char* base = (char*)CALL_MORECORE(0); + if (base != CMFAIL) { + asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); + /* Adjust to end on a page boundary */ + if (!is_page_aligned(base)) + asize += (page_align((size_t)base) - (size_t)base); + /* Can't call MORECORE if size is negative when treated as signed */ + if (asize < HALF_MAX_SIZE_T && + (br = (char*)(CALL_MORECORE(asize))) == base) { + tbase = base; + tsize = asize; } + } + } + else { + /* Subtract out existing available top space from MORECORE request. */ + asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); + /* Use mem here only if it did continuously extend old space */ + if (asize < HALF_MAX_SIZE_T && + (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) { + tbase = br; + tsize = asize; + } + } - if (tbase == CMFAIL) { /* Cope with partial failure */ - if (br != CMFAIL) { /* Try to use/extend the space we did get */ - if (asize < HALF_MAX_SIZE_T && - asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { - size_t esize = - granularity_align(nb + TOP_FOOT_SIZE + - MALLOC_ALIGNMENT + SIZE_T_ONE - - asize); - if (esize < HALF_MAX_SIZE_T) { - char *end = (char *) CALL_MORECORE(esize); - if (end != CMFAIL) - asize += esize; - else { /* Can't use; try to release */ - end = (char *) CALL_MORECORE(-asize); - br = CMFAIL; - } - } - } + if (tbase == CMFAIL) { /* Cope with partial failure */ + if (br != CMFAIL) { /* Try to use/extend the space we did get */ + if (asize < HALF_MAX_SIZE_T && + asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) { + size_t esize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE - asize); + if (esize < HALF_MAX_SIZE_T) { + char* end = (char*)CALL_MORECORE(esize); + if (end != CMFAIL) + asize += esize; + else { /* Can't use; try to release */ + end = (char*)CALL_MORECORE(-asize); + br = CMFAIL; } - if (br != CMFAIL) { /* Use the space we did get */ - tbase = br; - tsize = asize; - } else - disable_contiguous(m); /* Don't try contiguous path in the future */ + } } - - RELEASE_MORECORE_LOCK(); + } + if (br != CMFAIL) { /* Use the space we did get */ + tbase = br; + tsize = asize; + } + else + disable_contiguous(m); /* Don't try contiguous path in the future */ } - if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ - size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE; - size_t rsize = granularity_align(req); - if (rsize > nb) { /* Fail if wraps around zero */ - char *mp = (char *) (CALL_MMAP(rsize)); - if (mp != CMFAIL) { - tbase = mp; - tsize = rsize; - mmap_flag = IS_MMAPPED_BIT; - } - } + RELEASE_MORECORE_LOCK(); + } + + if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */ + size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE; + size_t rsize = granularity_align(req); + if (rsize > nb) { /* Fail if wraps around zero */ + char* mp = (char*)(CALL_MMAP(rsize)); + if (mp != CMFAIL) { + tbase = mp; + tsize = rsize; + mmap_flag = IS_MMAPPED_BIT; + } } + } - if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ - size_t asize = - granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + - SIZE_T_ONE); - if (asize < HALF_MAX_SIZE_T) { - char *br = CMFAIL; - char *end = CMFAIL; - ACQUIRE_MORECORE_LOCK(); - br = (char *) (CALL_MORECORE(asize)); - end = (char *) (CALL_MORECORE(0)); - RELEASE_MORECORE_LOCK(); - if (br != CMFAIL && end != CMFAIL && br < end) { - size_t ssize = end - br; - if (ssize > nb + TOP_FOOT_SIZE) { - tbase = br; - tsize = ssize; - } - } + if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */ + size_t asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE); + if (asize < HALF_MAX_SIZE_T) { + char* br = CMFAIL; + char* end = CMFAIL; + ACQUIRE_MORECORE_LOCK(); + br = (char*)(CALL_MORECORE(asize)); + end = (char*)(CALL_MORECORE(0)); + RELEASE_MORECORE_LOCK(); + if (br != CMFAIL && end != CMFAIL && br < end) { + size_t ssize = end - br; + if (ssize > nb + TOP_FOOT_SIZE) { + tbase = br; + tsize = ssize; } + } } + } - if (tbase != CMFAIL) { - - if ((m->footprint += tsize) > m->max_footprint) - m->max_footprint = m->footprint; - - if (!is_initialized(m)) { /* first-time initialization */ - m->seg.base = m->least_addr = tbase; - m->seg.size = tsize; - m->seg.sflags = mmap_flag; - m->magic = mparams.magic; - init_bins(m); - if (is_global(m)) - init_top(m, (mchunkptr) tbase, tsize - TOP_FOOT_SIZE); - else { - /* Offset top by embedded malloc_state */ - mchunkptr mn = next_chunk(mem2chunk(m)); - init_top(m, mn, - (size_t) ((tbase + tsize) - (char *) mn) - - TOP_FOOT_SIZE); - } - } + if (tbase != CMFAIL) { + + if ((m->footprint += tsize) > m->max_footprint) + m->max_footprint = m->footprint; + + if (!is_initialized(m)) { /* first-time initialization */ + m->seg.base = m->least_addr = tbase; + m->seg.size = tsize; + m->seg.sflags = mmap_flag; + m->magic = mparams.magic; + init_bins(m); + if (is_global(m)) + init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); + else { + /* Offset top by embedded malloc_state */ + mchunkptr mn = next_chunk(mem2chunk(m)); + init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE); + } + } - else { - /* Try to merge with an existing segment */ - msegmentptr sp = &m->seg; - while (sp != 0 && tbase != sp->base + sp->size) - sp = sp->next; - if (sp != 0 && !is_extern_segment(sp) && (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && segment_holds(sp, m->top)) { /* append */ - sp->size += tsize; - init_top(m, m->top, m->topsize + tsize); - } else { - if (tbase < m->least_addr) - m->least_addr = tbase; - sp = &m->seg; - while (sp != 0 && sp->base != tbase + tsize) - sp = sp->next; - if (sp != 0 && - !is_extern_segment(sp) && - (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) { - char *oldbase = sp->base; - sp->base = tbase; - sp->size += tsize; - return prepend_alloc(m, tbase, oldbase, nb); - } else - add_segment(m, tbase, tsize, mmap_flag); - } + else { + /* Try to merge with an existing segment */ + msegmentptr sp = &m->seg; + while (sp != 0 && tbase != sp->base + sp->size) + sp = sp->next; + if (sp != 0 && + !is_extern_segment(sp) && + (sp->sflags & IS_MMAPPED_BIT) == mmap_flag && + segment_holds(sp, m->top)) { /* append */ + sp->size += tsize; + init_top(m, m->top, m->topsize + tsize); + } + else { + if (tbase < m->least_addr) + m->least_addr = tbase; + sp = &m->seg; + while (sp != 0 && sp->base != tbase + tsize) + sp = sp->next; + if (sp != 0 && + !is_extern_segment(sp) && + (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) { + char* oldbase = sp->base; + sp->base = tbase; + sp->size += tsize; + return prepend_alloc(m, tbase, oldbase, nb); } + else + add_segment(m, tbase, tsize, mmap_flag); + } + } - if (nb < m->topsize) { /* Allocate from new or extended top space */ - size_t rsize = m->topsize -= nb; - mchunkptr p = m->top; - mchunkptr r = m->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(m, p, nb); - check_top_chunk(m, m->top); - check_malloced_chunk(m, chunk2mem(p), nb); - return chunk2mem(p); - } + if (nb < m->topsize) { /* Allocate from new or extended top space */ + size_t rsize = m->topsize -= nb; + mchunkptr p = m->top; + mchunkptr r = m->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(m, p, nb); + check_top_chunk(m, m->top); + check_malloced_chunk(m, chunk2mem(p), nb); + return chunk2mem(p); } + } - MALLOC_FAILURE_ACTION; - return 0; + MALLOC_FAILURE_ACTION; + return 0; } /* ----------------------- system deallocation -------------------------- */ /* Unmap and unlink any mmapped segments that don't contain used chunks */ -static size_t -release_unused_segments(mstate m) -{ - size_t released = 0; - msegmentptr pred = &m->seg; - msegmentptr sp = pred->next; - while (sp != 0) { - char *base = sp->base; - size_t size = sp->size; - msegmentptr next = sp->next; - if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { - mchunkptr p = align_as_chunk(base); - size_t psize = chunksize(p); - /* Can unmap if first chunk holds entire segment and not pinned */ - if (!cinuse(p) - && (char *) p + psize >= base + size - TOP_FOOT_SIZE) { - tchunkptr tp = (tchunkptr) p; - assert(segment_holds(sp, (char *) sp)); - if (p == m->dv) { - m->dv = 0; - m->dvsize = 0; - } else { - unlink_large_chunk(m, tp); - } - if (CALL_MUNMAP(base, size) == 0) { - released += size; - m->footprint -= size; - /* unlink obsoleted record */ - sp = pred; - sp->next = next; - } else { /* back out if cannot unmap */ - insert_large_chunk(m, tp, psize); - } - } +static size_t release_unused_segments(mstate m) { + size_t released = 0; + msegmentptr pred = &m->seg; + msegmentptr sp = pred->next; + while (sp != 0) { + char* base = sp->base; + size_t size = sp->size; + msegmentptr next = sp->next; + if (is_mmapped_segment(sp) && !is_extern_segment(sp)) { + mchunkptr p = align_as_chunk(base); + size_t psize = chunksize(p); + /* Can unmap if first chunk holds entire segment and not pinned */ + if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) { + tchunkptr tp = (tchunkptr)p; + assert(segment_holds(sp, (char*)sp)); + if (p == m->dv) { + m->dv = 0; + m->dvsize = 0; + } + else { + unlink_large_chunk(m, tp); + } + if (CALL_MUNMAP(base, size) == 0) { + released += size; + m->footprint -= size; + /* unlink obsoleted record */ + sp = pred; + sp->next = next; + } + else { /* back out if cannot unmap */ + insert_large_chunk(m, tp, psize); } - pred = sp; - sp = next; + } } - return released; + pred = sp; + sp = next; + } + return released; } -static int -sys_trim(mstate m, size_t pad) -{ - size_t released = 0; - if (pad < MAX_REQUEST && is_initialized(m)) { - pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ - - if (m->topsize > pad) { - /* Shrink top space in granularity-size units, keeping at least one */ - size_t unit = mparams.granularity; - size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - - SIZE_T_ONE) * unit; - msegmentptr sp = segment_holding(m, (char *) m->top); - - if (!is_extern_segment(sp)) { - if (is_mmapped_segment(sp)) { - if (HAVE_MMAP && sp->size >= extra && !has_segment_link(m, sp)) { /* can't shrink if pinned */ - size_t newsize = sp->size - extra; - /* Prefer mremap, fall back to munmap */ - if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != - MFAIL) - || (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { - released = extra; - } - } - } else if (HAVE_MORECORE) { - if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ - extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; - ACQUIRE_MORECORE_LOCK(); - { - /* Make sure end of memory is where we last set it. */ - char *old_br = (char *) (CALL_MORECORE(0)); - if (old_br == sp->base + sp->size) { - char *rel_br = (char *) (CALL_MORECORE(-extra)); - char *new_br = (char *) (CALL_MORECORE(0)); - if (rel_br != CMFAIL && new_br < old_br) - released = old_br - new_br; - } - } - RELEASE_MORECORE_LOCK(); - } +static int sys_trim(mstate m, size_t pad) { + size_t released = 0; + if (pad < MAX_REQUEST && is_initialized(m)) { + pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */ + + if (m->topsize > pad) { + /* Shrink top space in granularity-size units, keeping at least one */ + size_t unit = mparams.granularity; + size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit - + SIZE_T_ONE) * unit; + msegmentptr sp = segment_holding(m, (char*)m->top); + + if (!is_extern_segment(sp)) { + if (is_mmapped_segment(sp)) { + if (HAVE_MMAP && + sp->size >= extra && + !has_segment_link(m, sp)) { /* can't shrink if pinned */ + size_t newsize = sp->size - extra; + /* Prefer mremap, fall back to munmap */ + if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) || + (CALL_MUNMAP(sp->base + newsize, extra) == 0)) { + released = extra; } - - if (released != 0) { - sp->size -= released; - m->footprint -= released; - init_top(m, m->top, m->topsize - released); - check_top_chunk(m, m->top); + } + } + else if (HAVE_MORECORE) { + if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */ + extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit; + ACQUIRE_MORECORE_LOCK(); + { + /* Make sure end of memory is where we last set it. */ + char* old_br = (char*)(CALL_MORECORE(0)); + if (old_br == sp->base + sp->size) { + char* rel_br = (char*)(CALL_MORECORE(-extra)); + char* new_br = (char*)(CALL_MORECORE(0)); + if (rel_br != CMFAIL && new_br < old_br) + released = old_br - new_br; } + } + RELEASE_MORECORE_LOCK(); } + } - /* Unmap any unused mmapped segments */ - if (HAVE_MMAP) - released += release_unused_segments(m); - - /* On failure, disable autotrim to avoid repeated failed future calls */ - if (released == 0) - m->trim_check = MAX_SIZE_T; + if (released != 0) { + sp->size -= released; + m->footprint -= released; + init_top(m, m->top, m->topsize - released); + check_top_chunk(m, m->top); + } } - return (released != 0) ? 1 : 0; + /* Unmap any unused mmapped segments */ + if (HAVE_MMAP) + released += release_unused_segments(m); + + /* On failure, disable autotrim to avoid repeated failed future calls */ + if (released == 0) + m->trim_check = MAX_SIZE_T; + } + + return (released != 0)? 1 : 0; } /* ---------------------------- malloc support --------------------------- */ /* allocate a large request from the best fitting chunk in a treebin */ -static void * -tmalloc_large(mstate m, size_t nb) -{ - tchunkptr v = 0; - size_t rsize = -nb; /* Unsigned negation */ - tchunkptr t; - bindex_t idx; - compute_tree_index(nb, idx); - - if ((t = *treebin_at(m, idx)) != 0) { - /* Traverse tree for this bin looking for node with size == nb */ - size_t sizebits = nb << leftshift_for_tree_index(idx); - tchunkptr rst = 0; /* The deepest untaken right subtree */ - for (;;) { - tchunkptr rt; - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - v = t; - if ((rsize = trem) == 0) - break; - } - rt = t->child[1]; - t = t->child[(sizebits >> (SIZE_T_BITSIZE - SIZE_T_ONE)) & 1]; - if (rt != 0 && rt != t) - rst = rt; - if (t == 0) { - t = rst; /* set t to least subtree holding sizes > nb */ - break; - } - sizebits <<= 1; - } - } +static void* tmalloc_large(mstate m, size_t nb) { + tchunkptr v = 0; + size_t rsize = -nb; /* Unsigned negation */ + tchunkptr t; + bindex_t idx; + compute_tree_index(nb, idx); + + if ((t = *treebin_at(m, idx)) != 0) { + /* Traverse tree for this bin looking for node with size == nb */ + size_t sizebits = nb << leftshift_for_tree_index(idx); + tchunkptr rst = 0; /* The deepest untaken right subtree */ + for (;;) { + tchunkptr rt; + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + v = t; + if ((rsize = trem) == 0) + break; + } + rt = t->child[1]; + t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]; + if (rt != 0 && rt != t) + rst = rt; + if (t == 0) { + t = rst; /* set t to least subtree holding sizes > nb */ + break; + } + sizebits <<= 1; + } + } - if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ - binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; - if (leftbits != 0) { - bindex_t i; - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - t = *treebin_at(m, i); - } + if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */ + binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap; + if (leftbits != 0) { + bindex_t i; + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + t = *treebin_at(m, i); } + } - while (t != 0) { /* find smallest of tree or subtree */ - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } - t = leftmost_child(t); + while (t != 0) { /* find smallest of tree or subtree */ + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; } + t = leftmost_child(t); + } - /* If dv is a better fit, return 0 so malloc will use it */ - if (v != 0 && rsize < (size_t) (m->dvsize - nb)) { - if (RTCHECK(ok_address(m, v))) { /* split */ - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - insert_chunk(m, r, rsize); - } - return chunk2mem(v); - } + /* If dv is a better fit, return 0 so malloc will use it */ + if (v != 0 && rsize < (size_t)(m->dvsize - nb)) { + if (RTCHECK(ok_address(m, v))) { /* split */ + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + insert_chunk(m, r, rsize); } - CORRUPTION_ERROR_ACTION(m); + return chunk2mem(v); + } } - return 0; + CORRUPTION_ERROR_ACTION(m); + } + return 0; } /* allocate a small request from the best fitting chunk in a treebin */ -static void * -tmalloc_small(mstate m, size_t nb) -{ - tchunkptr t, v; - size_t rsize; - bindex_t i; - binmap_t leastbit = least_bit(m->treemap); - compute_bit2idx(leastbit, i); - - v = t = *treebin_at(m, i); - rsize = chunksize(t) - nb; - - while ((t = leftmost_child(t)) != 0) { - size_t trem = chunksize(t) - nb; - if (trem < rsize) { - rsize = trem; - v = t; - } +static void* tmalloc_small(mstate m, size_t nb) { + tchunkptr t, v; + size_t rsize; + bindex_t i; + binmap_t leastbit = least_bit(m->treemap); + compute_bit2idx(leastbit, i); + + v = t = *treebin_at(m, i); + rsize = chunksize(t) - nb; + + while ((t = leftmost_child(t)) != 0) { + size_t trem = chunksize(t) - nb; + if (trem < rsize) { + rsize = trem; + v = t; } + } - if (RTCHECK(ok_address(m, v))) { - mchunkptr r = chunk_plus_offset(v, nb); - assert(chunksize(v) == rsize + nb); - if (RTCHECK(ok_next(v, r))) { - unlink_large_chunk(m, v); - if (rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(m, v, (rsize + nb)); - else { - set_size_and_pinuse_of_inuse_chunk(m, v, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(m, r, rsize); - } - return chunk2mem(v); - } + if (RTCHECK(ok_address(m, v))) { + mchunkptr r = chunk_plus_offset(v, nb); + assert(chunksize(v) == rsize + nb); + if (RTCHECK(ok_next(v, r))) { + unlink_large_chunk(m, v); + if (rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(m, v, (rsize + nb)); + else { + set_size_and_pinuse_of_inuse_chunk(m, v, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(m, r, rsize); + } + return chunk2mem(v); } + } - CORRUPTION_ERROR_ACTION(m); - return 0; + CORRUPTION_ERROR_ACTION(m); + return 0; } /* --------------------------- realloc support --------------------------- */ -static void * -internal_realloc(mstate m, void *oldmem, size_t bytes) -{ - if (bytes >= MAX_REQUEST) { - MALLOC_FAILURE_ACTION; - return 0; - } - if (!PREACTION(m)) { - mchunkptr oldp = mem2chunk(oldmem); - size_t oldsize = chunksize(oldp); - mchunkptr next = chunk_plus_offset(oldp, oldsize); - mchunkptr newp = 0; - void *extra = 0; - - /* Try to either shrink or extend into top. Else malloc-copy-free */ - - if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && - ok_next(oldp, next) && ok_pinuse(next))) { - size_t nb = request2size(bytes); - if (is_mmapped(oldp)) - newp = mmap_resize(m, oldp, nb); - else if (oldsize >= nb) { /* already big enough */ - size_t rsize = oldsize - nb; - newp = oldp; - if (rsize >= MIN_CHUNK_SIZE) { - mchunkptr remainder = chunk_plus_offset(newp, nb); - set_inuse(m, newp, nb); - set_inuse(m, remainder, rsize); - extra = chunk2mem(remainder); - } - } else if (next == m->top && oldsize + m->topsize > nb) { - /* Expand into top */ - size_t newsize = oldsize + m->topsize; - size_t newtopsize = newsize - nb; - mchunkptr newtop = chunk_plus_offset(oldp, nb); - set_inuse(m, oldp, nb); - newtop->head = newtopsize | PINUSE_BIT; - m->top = newtop; - m->topsize = newtopsize; - newp = oldp; - } - } else { - USAGE_ERROR_ACTION(m, oldmem); - POSTACTION(m); - return 0; +static void* internal_realloc(mstate m, void* oldmem, size_t bytes) { + if (bytes >= MAX_REQUEST) { + MALLOC_FAILURE_ACTION; + return 0; + } + if (!PREACTION(m)) { + mchunkptr oldp = mem2chunk(oldmem); + size_t oldsize = chunksize(oldp); + mchunkptr next = chunk_plus_offset(oldp, oldsize); + mchunkptr newp = 0; + void* extra = 0; + + /* Try to either shrink or extend into top. Else malloc-copy-free */ + + if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) && + ok_next(oldp, next) && ok_pinuse(next))) { + size_t nb = request2size(bytes); + if (is_mmapped(oldp)) + newp = mmap_resize(m, oldp, nb); + else if (oldsize >= nb) { /* already big enough */ + size_t rsize = oldsize - nb; + newp = oldp; + if (rsize >= MIN_CHUNK_SIZE) { + mchunkptr remainder = chunk_plus_offset(newp, nb); + set_inuse(m, newp, nb); + set_inuse(m, remainder, rsize); + extra = chunk2mem(remainder); } + } + else if (next == m->top && oldsize + m->topsize > nb) { + /* Expand into top */ + size_t newsize = oldsize + m->topsize; + size_t newtopsize = newsize - nb; + mchunkptr newtop = chunk_plus_offset(oldp, nb); + set_inuse(m, oldp, nb); + newtop->head = newtopsize |PINUSE_BIT; + m->top = newtop; + m->topsize = newtopsize; + newp = oldp; + } + } + else { + USAGE_ERROR_ACTION(m, oldmem); + POSTACTION(m); + return 0; + } - POSTACTION(m); + POSTACTION(m); - if (newp != 0) { - if (extra != 0) { - internal_free(m, extra); - } - check_inuse_chunk(m, newp); - return chunk2mem(newp); - } else { - void *newmem = internal_malloc(m, bytes); - if (newmem != 0) { - size_t oc = oldsize - overhead_for(oldp); - memcpy(newmem, oldmem, (oc < bytes) ? oc : bytes); - internal_free(m, oldmem); - } - return newmem; - } + if (newp != 0) { + if (extra != 0) { + internal_free(m, extra); + } + check_inuse_chunk(m, newp); + return chunk2mem(newp); } - return 0; + else { + void* newmem = internal_malloc(m, bytes); + if (newmem != 0) { + size_t oc = oldsize - overhead_for(oldp); + memcpy(newmem, oldmem, (oc < bytes)? oc : bytes); + internal_free(m, oldmem); + } + return newmem; + } + } + return 0; } /* --------------------------- memalign support -------------------------- */ -static void * -internal_memalign(mstate m, size_t alignment, size_t bytes) -{ - if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ - return internal_malloc(m, bytes); - if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ - alignment = MIN_CHUNK_SIZE; - if ((alignment & (alignment - SIZE_T_ONE)) != 0) { /* Ensure a power of 2 */ - size_t a = MALLOC_ALIGNMENT << 1; - while (a < alignment) - a <<= 1; - alignment = a; - } +static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { + if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */ + return internal_malloc(m, bytes); + if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ + alignment = MIN_CHUNK_SIZE; + if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */ + size_t a = MALLOC_ALIGNMENT << 1; + while (a < alignment) a <<= 1; + alignment = a; + } - if (bytes >= MAX_REQUEST - alignment) { - if (m != 0) { /* Test isn't needed but avoids compiler warning */ - MALLOC_FAILURE_ACTION; + if (bytes >= MAX_REQUEST - alignment) { + if (m != 0) { /* Test isn't needed but avoids compiler warning */ + MALLOC_FAILURE_ACTION; + } + } + else { + size_t nb = request2size(bytes); + size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; + char* mem = (char*)internal_malloc(m, req); + if (mem != 0) { + void* leader = 0; + void* trailer = 0; + mchunkptr p = mem2chunk(mem); + + if (PREACTION(m)) return 0; + if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */ + /* + Find an aligned spot inside chunk. Since we need to give + back leading space in a chunk of at least MIN_CHUNK_SIZE, if + the first calculation places us at a spot with less than + MIN_CHUNK_SIZE leader, we can move to the next aligned spot. + We've allocated enough total room so that this is always + possible. + */ + char* br = (char*)mem2chunk((size_t)(((size_t)(mem + + alignment - + SIZE_T_ONE)) & + -alignment)); + char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)? + br : br+alignment; + mchunkptr newp = (mchunkptr)pos; + size_t leadsize = pos - (char*)(p); + size_t newsize = chunksize(p) - leadsize; + + if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ + newp->prev_foot = p->prev_foot + leadsize; + newp->head = (newsize|CINUSE_BIT); } - } else { - size_t nb = request2size(bytes); - size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD; - char *mem = (char *) internal_malloc(m, req); - if (mem != 0) { - void *leader = 0; - void *trailer = 0; - mchunkptr p = mem2chunk(mem); - - if (PREACTION(m)) - return 0; - if ((((size_t) (mem)) % alignment) != 0) { /* misaligned */ - /* - Find an aligned spot inside chunk. Since we need to give - back leading space in a chunk of at least MIN_CHUNK_SIZE, if - the first calculation places us at a spot with less than - MIN_CHUNK_SIZE leader, we can move to the next aligned spot. - We've allocated enough total room so that this is always - possible. - */ - char *br = (char *) mem2chunk((size_t) (((size_t) (mem + - alignment - - SIZE_T_ONE)) - & -alignment)); - char *pos = - ((size_t) (br - (char *) (p)) >= - MIN_CHUNK_SIZE) ? br : br + alignment; - mchunkptr newp = (mchunkptr) pos; - size_t leadsize = pos - (char *) (p); - size_t newsize = chunksize(p) - leadsize; - - if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */ - newp->prev_foot = p->prev_foot + leadsize; - newp->head = (newsize | CINUSE_BIT); - } else { /* Otherwise, give back leader, use the rest */ - set_inuse(m, newp, newsize); - set_inuse(m, p, leadsize); - leader = chunk2mem(p); - } - p = newp; - } - - /* Give back spare room at the end */ - if (!is_mmapped(p)) { - size_t size = chunksize(p); - if (size > nb + MIN_CHUNK_SIZE) { - size_t remainder_size = size - nb; - mchunkptr remainder = chunk_plus_offset(p, nb); - set_inuse(m, p, nb); - set_inuse(m, remainder, remainder_size); - trailer = chunk2mem(remainder); - } - } + else { /* Otherwise, give back leader, use the rest */ + set_inuse(m, newp, newsize); + set_inuse(m, p, leadsize); + leader = chunk2mem(p); + } + p = newp; + } - assert(chunksize(p) >= nb); - assert((((size_t) (chunk2mem(p))) % alignment) == 0); - check_inuse_chunk(m, p); - POSTACTION(m); - if (leader != 0) { - internal_free(m, leader); - } - if (trailer != 0) { - internal_free(m, trailer); - } - return chunk2mem(p); + /* Give back spare room at the end */ + if (!is_mmapped(p)) { + size_t size = chunksize(p); + if (size > nb + MIN_CHUNK_SIZE) { + size_t remainder_size = size - nb; + mchunkptr remainder = chunk_plus_offset(p, nb); + set_inuse(m, p, nb); + set_inuse(m, remainder, remainder_size); + trailer = chunk2mem(remainder); } + } + + assert (chunksize(p) >= nb); + assert((((size_t)(chunk2mem(p))) % alignment) == 0); + check_inuse_chunk(m, p); + POSTACTION(m); + if (leader != 0) { + internal_free(m, leader); + } + if (trailer != 0) { + internal_free(m, trailer); + } + return chunk2mem(p); } - return 0; + } + return 0; } /* ------------------------ comalloc/coalloc support --------------------- */ -static void ** -ialloc(mstate m, size_t n_elements, size_t * sizes, int opts, void *chunks[]) -{ - /* - This provides common support for independent_X routines, handling - all of the combinations that can result. - - The opts arg has: - bit 0 set if all elements are same size (using sizes[0]) - bit 1 set if elements should be zeroed - */ - - size_t element_size; /* chunksize of each element, if all same */ - size_t contents_size; /* total size of elements */ - size_t array_size; /* request size of pointer array */ - void *mem; /* malloced aggregate space */ - mchunkptr p; /* corresponding chunk */ - size_t remainder_size; /* remaining bytes while splitting */ - void **marray; /* either "chunks" or malloced ptr array */ - mchunkptr array_chunk; /* chunk for malloced ptr array */ - flag_t was_enabled; /* to disable mmap */ - size_t size; - size_t i; - - /* compute array length, if needed */ - if (chunks != 0) { - if (n_elements == 0) - return chunks; /* nothing to do */ - marray = chunks; - array_size = 0; - } else { - /* if empty req, must still return chunk representing empty array */ - if (n_elements == 0) - return (void **) internal_malloc(m, 0); - marray = 0; - array_size = request2size(n_elements * (sizeof(void *))); - } +static void** ialloc(mstate m, + size_t n_elements, + size_t* sizes, + int opts, + void* chunks[]) { + /* + This provides common support for independent_X routines, handling + all of the combinations that can result. + + The opts arg has: + bit 0 set if all elements are same size (using sizes[0]) + bit 1 set if elements should be zeroed + */ + + size_t element_size; /* chunksize of each element, if all same */ + size_t contents_size; /* total size of elements */ + size_t array_size; /* request size of pointer array */ + void* mem; /* malloced aggregate space */ + mchunkptr p; /* corresponding chunk */ + size_t remainder_size; /* remaining bytes while splitting */ + void** marray; /* either "chunks" or malloced ptr array */ + mchunkptr array_chunk; /* chunk for malloced ptr array */ + flag_t was_enabled; /* to disable mmap */ + size_t size; + size_t i; + + /* compute array length, if needed */ + if (chunks != 0) { + if (n_elements == 0) + return chunks; /* nothing to do */ + marray = chunks; + array_size = 0; + } + else { + /* if empty req, must still return chunk representing empty array */ + if (n_elements == 0) + return (void**)internal_malloc(m, 0); + marray = 0; + array_size = request2size(n_elements * (sizeof(void*))); + } - /* compute total element size */ - if (opts & 0x1) { /* all-same-size */ - element_size = request2size(*sizes); - contents_size = n_elements * element_size; - } else { /* add up all the sizes */ - element_size = 0; - contents_size = 0; - for (i = 0; i != n_elements; ++i) - contents_size += request2size(sizes[i]); - } + /* compute total element size */ + if (opts & 0x1) { /* all-same-size */ + element_size = request2size(*sizes); + contents_size = n_elements * element_size; + } + else { /* add up all the sizes */ + element_size = 0; + contents_size = 0; + for (i = 0; i != n_elements; ++i) + contents_size += request2size(sizes[i]); + } - size = contents_size + array_size; - - /* - Allocate the aggregate chunk. First disable direct-mmapping so - malloc won't use it, since we would not be able to later - free/realloc space internal to a segregated mmap region. - */ - was_enabled = use_mmap(m); - disable_mmap(m); - mem = internal_malloc(m, size - CHUNK_OVERHEAD); - if (was_enabled) - enable_mmap(m); - if (mem == 0) - return 0; - - if (PREACTION(m)) - return 0; - p = mem2chunk(mem); - remainder_size = chunksize(p); - - assert(!is_mmapped(p)); - - if (opts & 0x2) { /* optionally clear the elements */ - memset((size_t *) mem, 0, remainder_size - SIZE_T_SIZE - array_size); - } + size = contents_size + array_size; + + /* + Allocate the aggregate chunk. First disable direct-mmapping so + malloc won't use it, since we would not be able to later + free/realloc space internal to a segregated mmap region. + */ + was_enabled = use_mmap(m); + disable_mmap(m); + mem = internal_malloc(m, size - CHUNK_OVERHEAD); + if (was_enabled) + enable_mmap(m); + if (mem == 0) + return 0; - /* If not provided, allocate the pointer array as final part of chunk */ - if (marray == 0) { - size_t array_chunk_size; - array_chunk = chunk_plus_offset(p, contents_size); - array_chunk_size = remainder_size - contents_size; - marray = (void **) (chunk2mem(array_chunk)); - set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); - remainder_size = contents_size; - } + if (PREACTION(m)) return 0; + p = mem2chunk(mem); + remainder_size = chunksize(p); - /* split out elements */ - for (i = 0;; ++i) { - marray[i] = chunk2mem(p); - if (i != n_elements - 1) { - if (element_size != 0) - size = element_size; - else - size = request2size(sizes[i]); - remainder_size -= size; - set_size_and_pinuse_of_inuse_chunk(m, p, size); - p = chunk_plus_offset(p, size); - } else { /* the final element absorbs any overallocation slop */ - set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); - break; - } + assert(!is_mmapped(p)); + + if (opts & 0x2) { /* optionally clear the elements */ + memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size); + } + + /* If not provided, allocate the pointer array as final part of chunk */ + if (marray == 0) { + size_t array_chunk_size; + array_chunk = chunk_plus_offset(p, contents_size); + array_chunk_size = remainder_size - contents_size; + marray = (void**) (chunk2mem(array_chunk)); + set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size); + remainder_size = contents_size; + } + + /* split out elements */ + for (i = 0; ; ++i) { + marray[i] = chunk2mem(p); + if (i != n_elements-1) { + if (element_size != 0) + size = element_size; + else + size = request2size(sizes[i]); + remainder_size -= size; + set_size_and_pinuse_of_inuse_chunk(m, p, size); + p = chunk_plus_offset(p, size); + } + else { /* the final element absorbs any overallocation slop */ + set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size); + break; } + } -#if DEBUG - if (marray != chunks) { - /* final element must have exactly exhausted chunk */ - if (element_size != 0) { - assert(remainder_size == element_size); - } else { - assert(remainder_size == request2size(sizes[i])); - } - check_inuse_chunk(m, mem2chunk(marray)); +#ifdef DEBUG + if (marray != chunks) { + /* final element must have exactly exhausted chunk */ + if (element_size != 0) { + assert(remainder_size == element_size); } - for (i = 0; i != n_elements; ++i) - check_inuse_chunk(m, mem2chunk(marray[i])); + else { + assert(remainder_size == request2size(sizes[i])); + } + check_inuse_chunk(m, mem2chunk(marray)); + } + for (i = 0; i != n_elements; ++i) + check_inuse_chunk(m, mem2chunk(marray[i])); #endif /* DEBUG */ - POSTACTION(m); - return marray; + POSTACTION(m); + return marray; } @@ -4220,369 +4150,343 @@ ialloc(mstate m, size_t n_elements, size_t * sizes, int opts, void *chunks[]) #if !ONLY_MSPACES -void * -dlmalloc(size_t bytes) -{ - /* - Basic algorithm: - If a small request (< 256 bytes minus per-chunk overhead): +void* dlmalloc(size_t bytes) { + /* + Basic algorithm: + If a small request (< 256 bytes minus per-chunk overhead): 1. If one exists, use a remainderless chunk in associated smallbin. - (Remainderless means that there are too few excess bytes to - represent as a chunk.) + (Remainderless means that there are too few excess bytes to + represent as a chunk.) 2. If it is big enough, use the dv chunk, which is normally the - chunk adjacent to the one used for the most recent small request. + chunk adjacent to the one used for the most recent small request. 3. If one exists, split the smallest available chunk in a bin, - saving remainder in dv. + saving remainder in dv. 4. If it is big enough, use the top chunk. 5. If available, get memory from system and use it - Otherwise, for a large request: + Otherwise, for a large request: 1. Find the smallest available binned chunk that fits, and use it - if it is better fitting than dv chunk, splitting if necessary. + if it is better fitting than dv chunk, splitting if necessary. 2. If better fitting than any binned chunk, use the dv chunk. 3. If it is big enough, use the top chunk. 4. If request size >= mmap threshold, try to directly mmap this chunk. 5. If available, get memory from system and use it - The ugly goto's here ensure that postaction occurs along all paths. - */ - - if (!PREACTION(gm)) { - void *mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = gm->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(gm, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(gm, b, p, idx); - set_inuse_and_pinuse(gm, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (nb > gm->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = - (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(gm, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(gm, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(gm, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(gm, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - - else if (gm->treemap != 0 - && (mem = tmalloc_small(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - } - } else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { - check_malloced_chunk(gm, mem, nb); - goto postaction; - } - } + The ugly goto's here ensure that postaction occurs along all paths. + */ + + if (!PREACTION(gm)) { + void* mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = gm->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(gm, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(gm, b, p, idx); + set_inuse_and_pinuse(gm, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } - if (nb <= gm->dvsize) { - size_t rsize = gm->dvsize - nb; - mchunkptr p = gm->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = gm->dv = chunk_plus_offset(p, nb); - gm->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - } else { /* exhaust dv */ - size_t dvs = gm->dvsize; - gm->dvsize = 0; - gm->dv = 0; - set_inuse_and_pinuse(gm, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(gm, mem, nb); - goto postaction; + else if (nb > gm->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(gm, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(gm, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(gm, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(gm, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; } - else if (nb < gm->topsize) { /* Split top */ - size_t rsize = gm->topsize -= nb; - mchunkptr p = gm->top; - mchunkptr r = gm->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(gm, p, nb); - mem = chunk2mem(p); - check_top_chunk(gm, gm->top); - check_malloced_chunk(gm, mem, nb); - goto postaction; + else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; } + } + } + else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) { + check_malloced_chunk(gm, mem, nb); + goto postaction; + } + } - mem = sys_alloc(gm, nb); + if (nb <= gm->dvsize) { + size_t rsize = gm->dvsize - nb; + mchunkptr p = gm->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = gm->dv = chunk_plus_offset(p, nb); + gm->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + } + else { /* exhaust dv */ + size_t dvs = gm->dvsize; + gm->dvsize = 0; + gm->dv = 0; + set_inuse_and_pinuse(gm, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(gm, mem, nb); + goto postaction; + } - postaction: - POSTACTION(gm); - return mem; + else if (nb < gm->topsize) { /* Split top */ + size_t rsize = gm->topsize -= nb; + mchunkptr p = gm->top; + mchunkptr r = gm->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(gm, p, nb); + mem = chunk2mem(p); + check_top_chunk(gm, gm->top); + check_malloced_chunk(gm, mem, nb); + goto postaction; } - return 0; + mem = sys_alloc(gm, nb); + + postaction: + POSTACTION(gm); + return mem; + } + + return 0; } -void -dlfree(void *mem) -{ - /* - Consolidate freed chunks with preceeding or succeeding bordering - free chunks, if they exist, and then place in a bin. Intermixed - with special cases for top, dv, mmapped chunks, and usage errors. - */ +void dlfree(void* mem) { + /* + Consolidate freed chunks with preceeding or succeeding bordering + free chunks, if they exist, and then place in a bin. Intermixed + with special cases for top, dv, mmapped chunks, and usage errors. + */ - if (mem != 0) { - mchunkptr p = mem2chunk(mem); + if (mem != 0) { + mchunkptr p = mem2chunk(mem); #if FOOTERS - mstate fm = get_mstate_for(p); - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; - } + mstate fm = get_mstate_for(p); + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; + } #else /* FOOTERS */ #define fm gm #endif /* FOOTERS */ - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char *) p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } else if ((next->head & INUSE_BITS) == - INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } else - goto erroraction; - } - } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; - } else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; - } + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } + else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } + else if ((next->head & INUSE_BITS) == INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } + else + goto erroraction; + } + } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); + else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } + else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } + } + } + else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; } + } + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); } + } #if !FOOTERS #undef fm #endif /* FOOTERS */ } -void * -dlcalloc(size_t n_elements, size_t elem_size) -{ - void *mem; - size_t req = 0; - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t) 0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = dlmalloc(req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; +void* dlcalloc(size_t n_elements, size_t elem_size) { + void* mem; + size_t req = 0; + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t)0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = dlmalloc(req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; } -void * -dlrealloc(void *oldmem, size_t bytes) -{ - if (oldmem == 0) - return dlmalloc(bytes); +void* dlrealloc(void* oldmem, size_t bytes) { + if (oldmem == 0) + return dlmalloc(bytes); #ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - dlfree(oldmem); - return 0; - } + if (bytes == 0) { + dlfree(oldmem); + return 0; + } #endif /* REALLOC_ZERO_BYTES_FREES */ - else { + else { #if ! FOOTERS - mstate m = gm; + mstate m = gm; #else /* FOOTERS */ - mstate m = get_mstate_for(mem2chunk(oldmem)); - if (!ok_magic(m)) { - USAGE_ERROR_ACTION(m, oldmem); - return 0; - } -#endif /* FOOTERS */ - return internal_realloc(m, oldmem, bytes); + mstate m = get_mstate_for(mem2chunk(oldmem)); + if (!ok_magic(m)) { + USAGE_ERROR_ACTION(m, oldmem); + return 0; } +#endif /* FOOTERS */ + return internal_realloc(m, oldmem, bytes); + } } -void * -dlmemalign(size_t alignment, size_t bytes) -{ - return internal_memalign(gm, alignment, bytes); +void* dlmemalign(size_t alignment, size_t bytes) { + return internal_memalign(gm, alignment, bytes); } -void ** -dlindependent_calloc(size_t n_elements, size_t elem_size, void *chunks[]) -{ - size_t sz = elem_size; /* serves as 1-element array */ - return ialloc(gm, n_elements, &sz, 3, chunks); +void** dlindependent_calloc(size_t n_elements, size_t elem_size, + void* chunks[]) { + size_t sz = elem_size; /* serves as 1-element array */ + return ialloc(gm, n_elements, &sz, 3, chunks); } -void ** -dlindependent_comalloc(size_t n_elements, size_t sizes[], void *chunks[]) -{ - return ialloc(gm, n_elements, sizes, 0, chunks); +void** dlindependent_comalloc(size_t n_elements, size_t sizes[], + void* chunks[]) { + return ialloc(gm, n_elements, sizes, 0, chunks); } -void * -dlvalloc(size_t bytes) -{ - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, bytes); +void* dlvalloc(size_t bytes) { + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, bytes); } -void * -dlpvalloc(size_t bytes) -{ - size_t pagesz; - init_mparams(); - pagesz = mparams.page_size; - return dlmemalign(pagesz, - (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); +void* dlpvalloc(size_t bytes) { + size_t pagesz; + init_mparams(); + pagesz = mparams.page_size; + return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE)); } -int -dlmalloc_trim(size_t pad) -{ - int result = 0; - if (!PREACTION(gm)) { - result = sys_trim(gm, pad); - POSTACTION(gm); - } - return result; +int dlmalloc_trim(size_t pad) { + int result = 0; + if (!PREACTION(gm)) { + result = sys_trim(gm, pad); + POSTACTION(gm); + } + return result; } -size_t -dlmalloc_footprint(void) -{ - return gm->footprint; +size_t dlmalloc_footprint(void) { + return gm->footprint; } -size_t -dlmalloc_max_footprint(void) -{ - return gm->max_footprint; +size_t dlmalloc_max_footprint(void) { + return gm->max_footprint; } #if !NO_MALLINFO -struct mallinfo -dlmallinfo(void) -{ - return internal_mallinfo(gm); +struct mallinfo dlmallinfo(void) { + return internal_mallinfo(gm); } #endif /* NO_MALLINFO */ -void -dlmalloc_stats() -{ - internal_malloc_stats(gm); +void dlmalloc_stats(void) { + internal_malloc_stats(gm); } -size_t -dlmalloc_usable_size(void *mem) -{ - if (mem != 0) { - mchunkptr p = mem2chunk(mem); - if (cinuse(p)) - return chunksize(p) - overhead_for(p); - } - return 0; +size_t dlmalloc_usable_size(void* mem) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); + if (cinuse(p)) + return chunksize(p) - overhead_for(p); + } + return 0; } -int -dlmallopt(int param_number, int value) -{ - return change_mparam(param_number, value); +int dlmallopt(int param_number, int value) { + return change_mparam(param_number, value); } #endif /* !ONLY_MSPACES */ @@ -4591,85 +4495,78 @@ dlmallopt(int param_number, int value) #if MSPACES -static mstate -init_user_mstate(char *tbase, size_t tsize) -{ - size_t msize = pad_request(sizeof(struct malloc_state)); - mchunkptr mn; - mchunkptr msp = align_as_chunk(tbase); - mstate m = (mstate) (chunk2mem(msp)); - memset(m, 0, msize); - INITIAL_LOCK(&m->mutex); - msp->head = (msize | PINUSE_BIT | CINUSE_BIT); - m->seg.base = m->least_addr = tbase; - m->seg.size = m->footprint = m->max_footprint = tsize; - m->magic = mparams.magic; - m->mflags = mparams.default_mflags; - disable_contiguous(m); - init_bins(m); - mn = next_chunk(mem2chunk(m)); - init_top(m, mn, (size_t) ((tbase + tsize) - (char *) mn) - TOP_FOOT_SIZE); - check_top_chunk(m, m->top); - return m; +static mstate init_user_mstate(char* tbase, size_t tsize) { + size_t msize = pad_request(sizeof(struct malloc_state)); + mchunkptr mn; + mchunkptr msp = align_as_chunk(tbase); + mstate m = (mstate)(chunk2mem(msp)); + memset(m, 0, msize); + INITIAL_LOCK(&m->mutex); + msp->head = (msize|PINUSE_BIT|CINUSE_BIT); + m->seg.base = m->least_addr = tbase; + m->seg.size = m->footprint = m->max_footprint = tsize; + m->magic = mparams.magic; + m->mflags = mparams.default_mflags; + disable_contiguous(m); + init_bins(m); + mn = next_chunk(mem2chunk(m)); + init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE); + check_top_chunk(m, m->top); + return m; } -mspace -create_mspace(size_t capacity, int locked) -{ - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) { - size_t rs = ((capacity == 0) ? mparams.granularity : - (capacity + TOP_FOOT_SIZE + msize)); - size_t tsize = granularity_align(rs); - char *tbase = (char *) (CALL_MMAP(tsize)); - if (tbase != CMFAIL) { - m = init_user_mstate(tbase, tsize); - m->seg.sflags = IS_MMAPPED_BIT; - set_lock(m, locked); - } +mspace create_mspace(size_t capacity, int locked) { + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + size_t rs = ((capacity == 0)? mparams.granularity : + (capacity + TOP_FOOT_SIZE + msize)); + size_t tsize = granularity_align(rs); + char* tbase = (char*)(CALL_MMAP(tsize)); + if (tbase != CMFAIL) { + m = init_user_mstate(tbase, tsize); + m->seg.sflags = IS_MMAPPED_BIT; + set_lock(m, locked); } - return (mspace) m; + } + return (mspace)m; } -mspace -create_mspace_with_base(void *base, size_t capacity, int locked) -{ - mstate m = 0; - size_t msize = pad_request(sizeof(struct malloc_state)); - init_mparams(); /* Ensure pagesize etc initialized */ - - if (capacity > msize + TOP_FOOT_SIZE && - capacity < (size_t) - (msize + TOP_FOOT_SIZE + mparams.page_size)) { - m = init_user_mstate((char *) base, capacity); - m->seg.sflags = EXTERN_BIT; - set_lock(m, locked); - } - return (mspace) m; +mspace create_mspace_with_base(void* base, size_t capacity, int locked) { + mstate m = 0; + size_t msize = pad_request(sizeof(struct malloc_state)); + init_mparams(); /* Ensure pagesize etc initialized */ + + if (capacity > msize + TOP_FOOT_SIZE && + capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + m = init_user_mstate((char*)base, capacity); + m->seg.sflags = EXTERN_BIT; + set_lock(m, locked); + } + return (mspace)m; } -size_t -destroy_mspace(mspace msp) -{ - size_t freed = 0; - mstate ms = (mstate) msp; - if (ok_magic(ms)) { - msegmentptr sp = &ms->seg; - while (sp != 0) { - char *base = sp->base; - size_t size = sp->size; - flag_t flag = sp->sflags; - sp = sp->next; - if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && - CALL_MUNMAP(base, size) == 0) - freed += size; - } - } else { - USAGE_ERROR_ACTION(ms, ms); +size_t destroy_mspace(mspace msp) { + size_t freed = 0; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + msegmentptr sp = &ms->seg; + while (sp != 0) { + char* base = sp->base; + size_t size = sp->size; + flag_t flag = sp->sflags; + sp = sp->next; + if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) && + CALL_MUNMAP(base, size) == 0) + freed += size; } - return freed; + } + else { + USAGE_ERROR_ACTION(ms,ms); + } + return freed; } /* @@ -4678,363 +4575,344 @@ destroy_mspace(mspace msp) */ -void * -mspace_malloc(mspace msp, size_t bytes) -{ - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - if (!PREACTION(ms)) { - void *mem; - size_t nb; - if (bytes <= MAX_SMALL_REQUEST) { - bindex_t idx; - binmap_t smallbits; - nb = (bytes < MIN_REQUEST) ? MIN_CHUNK_SIZE : pad_request(bytes); - idx = small_index(nb); - smallbits = ms->smallmap >> idx; - - if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ - mchunkptr b, p; - idx += ~smallbits & 1; /* Uses next bin if idx empty */ - b = smallbin_at(ms, idx); - p = b->fd; - assert(chunksize(p) == small_index2size(idx)); - unlink_first_small_chunk(ms, b, p, idx); - set_inuse_and_pinuse(ms, p, small_index2size(idx)); - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - else if (nb > ms->dvsize) { - if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ - mchunkptr b, p, r; - size_t rsize; - bindex_t i; - binmap_t leftbits = - (smallbits << idx) & left_bits(idx2bit(idx)); - binmap_t leastbit = least_bit(leftbits); - compute_bit2idx(leastbit, i); - b = smallbin_at(ms, i); - p = b->fd; - assert(chunksize(p) == small_index2size(i)); - unlink_first_small_chunk(ms, b, p, i); - rsize = small_index2size(i) - nb; - /* Fit here cannot be remainderless if 4byte sizes */ - if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) - set_inuse_and_pinuse(ms, p, small_index2size(i)); - else { - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - r = chunk_plus_offset(p, nb); - set_size_and_pinuse_of_free_chunk(r, rsize); - replace_dv(ms, r, rsize); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - - else if (ms->treemap != 0 - && (mem = tmalloc_small(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - } - } else if (bytes >= MAX_REQUEST) - nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ - else { - nb = pad_request(bytes); - if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { - check_malloced_chunk(ms, mem, nb); - goto postaction; - } - } +void* mspace_malloc(mspace msp, size_t bytes) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + if (!PREACTION(ms)) { + void* mem; + size_t nb; + if (bytes <= MAX_SMALL_REQUEST) { + bindex_t idx; + binmap_t smallbits; + nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes); + idx = small_index(nb); + smallbits = ms->smallmap >> idx; + + if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */ + mchunkptr b, p; + idx += ~smallbits & 1; /* Uses next bin if idx empty */ + b = smallbin_at(ms, idx); + p = b->fd; + assert(chunksize(p) == small_index2size(idx)); + unlink_first_small_chunk(ms, b, p, idx); + set_inuse_and_pinuse(ms, p, small_index2size(idx)); + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } - if (nb <= ms->dvsize) { - size_t rsize = ms->dvsize - nb; - mchunkptr p = ms->dv; - if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ - mchunkptr r = ms->dv = chunk_plus_offset(p, nb); - ms->dvsize = rsize; - set_size_and_pinuse_of_free_chunk(r, rsize); - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - } else { /* exhaust dv */ - size_t dvs = ms->dvsize; - ms->dvsize = 0; - ms->dv = 0; - set_inuse_and_pinuse(ms, p, dvs); - } - mem = chunk2mem(p); - check_malloced_chunk(ms, mem, nb); - goto postaction; + else if (nb > ms->dvsize) { + if (smallbits != 0) { /* Use chunk in next nonempty smallbin */ + mchunkptr b, p, r; + size_t rsize; + bindex_t i; + binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx)); + binmap_t leastbit = least_bit(leftbits); + compute_bit2idx(leastbit, i); + b = smallbin_at(ms, i); + p = b->fd; + assert(chunksize(p) == small_index2size(i)); + unlink_first_small_chunk(ms, b, p, i); + rsize = small_index2size(i) - nb; + /* Fit here cannot be remainderless if 4byte sizes */ + if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) + set_inuse_and_pinuse(ms, p, small_index2size(i)); + else { + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + r = chunk_plus_offset(p, nb); + set_size_and_pinuse_of_free_chunk(r, rsize); + replace_dv(ms, r, rsize); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; } - else if (nb < ms->topsize) { /* Split top */ - size_t rsize = ms->topsize -= nb; - mchunkptr p = ms->top; - mchunkptr r = ms->top = chunk_plus_offset(p, nb); - r->head = rsize | PINUSE_BIT; - set_size_and_pinuse_of_inuse_chunk(ms, p, nb); - mem = chunk2mem(p); - check_top_chunk(ms, ms->top); - check_malloced_chunk(ms, mem, nb); - goto postaction; + else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; } + } + } + else if (bytes >= MAX_REQUEST) + nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */ + else { + nb = pad_request(bytes); + if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) { + check_malloced_chunk(ms, mem, nb); + goto postaction; + } + } - mem = sys_alloc(ms, nb); + if (nb <= ms->dvsize) { + size_t rsize = ms->dvsize - nb; + mchunkptr p = ms->dv; + if (rsize >= MIN_CHUNK_SIZE) { /* split dv */ + mchunkptr r = ms->dv = chunk_plus_offset(p, nb); + ms->dvsize = rsize; + set_size_and_pinuse_of_free_chunk(r, rsize); + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + } + else { /* exhaust dv */ + size_t dvs = ms->dvsize; + ms->dvsize = 0; + ms->dv = 0; + set_inuse_and_pinuse(ms, p, dvs); + } + mem = chunk2mem(p); + check_malloced_chunk(ms, mem, nb); + goto postaction; + } - postaction: - POSTACTION(ms); - return mem; + else if (nb < ms->topsize) { /* Split top */ + size_t rsize = ms->topsize -= nb; + mchunkptr p = ms->top; + mchunkptr r = ms->top = chunk_plus_offset(p, nb); + r->head = rsize | PINUSE_BIT; + set_size_and_pinuse_of_inuse_chunk(ms, p, nb); + mem = chunk2mem(p); + check_top_chunk(ms, ms->top); + check_malloced_chunk(ms, mem, nb); + goto postaction; } - return 0; + mem = sys_alloc(ms, nb); + + postaction: + POSTACTION(ms); + return mem; + } + + return 0; } -void -mspace_free(mspace msp, void *mem) -{ - if (mem != 0) { - mchunkptr p = mem2chunk(mem); +void mspace_free(mspace msp, void* mem) { + if (mem != 0) { + mchunkptr p = mem2chunk(mem); #if FOOTERS - mstate fm = get_mstate_for(p); + mstate fm = get_mstate_for(p); #else /* FOOTERS */ - mstate fm = (mstate) msp; + mstate fm = (mstate)msp; #endif /* FOOTERS */ - if (!ok_magic(fm)) { - USAGE_ERROR_ACTION(fm, p); - return; + if (!ok_magic(fm)) { + USAGE_ERROR_ACTION(fm, p); + return; + } + if (!PREACTION(fm)) { + check_inuse_chunk(fm, p); + if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { + size_t psize = chunksize(p); + mchunkptr next = chunk_plus_offset(p, psize); + if (!pinuse(p)) { + size_t prevsize = p->prev_foot; + if ((prevsize & IS_MMAPPED_BIT) != 0) { + prevsize &= ~IS_MMAPPED_BIT; + psize += prevsize + MMAP_FOOT_PAD; + if (CALL_MUNMAP((char*)p - prevsize, psize) == 0) + fm->footprint -= psize; + goto postaction; + } + else { + mchunkptr prev = chunk_minus_offset(p, prevsize); + psize += prevsize; + p = prev; + if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ + if (p != fm->dv) { + unlink_chunk(fm, p, prevsize); + } + else if ((next->head & INUSE_BITS) == INUSE_BITS) { + fm->dvsize = psize; + set_free_with_pinuse(p, psize, next); + goto postaction; + } + } + else + goto erroraction; + } } - if (!PREACTION(fm)) { - check_inuse_chunk(fm, p); - if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) { - size_t psize = chunksize(p); - mchunkptr next = chunk_plus_offset(p, psize); - if (!pinuse(p)) { - size_t prevsize = p->prev_foot; - if ((prevsize & IS_MMAPPED_BIT) != 0) { - prevsize &= ~IS_MMAPPED_BIT; - psize += prevsize + MMAP_FOOT_PAD; - if (CALL_MUNMAP((char *) p - prevsize, psize) == 0) - fm->footprint -= psize; - goto postaction; - } else { - mchunkptr prev = chunk_minus_offset(p, prevsize); - psize += prevsize; - p = prev; - if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */ - if (p != fm->dv) { - unlink_chunk(fm, p, prevsize); - } else if ((next->head & INUSE_BITS) == - INUSE_BITS) { - fm->dvsize = psize; - set_free_with_pinuse(p, psize, next); - goto postaction; - } - } else - goto erroraction; - } - } - - if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { - if (!cinuse(next)) { /* consolidate forward */ - if (next == fm->top) { - size_t tsize = fm->topsize += psize; - fm->top = p; - p->head = tsize | PINUSE_BIT; - if (p == fm->dv) { - fm->dv = 0; - fm->dvsize = 0; - } - if (should_trim(fm, tsize)) - sys_trim(fm, 0); - goto postaction; - } else if (next == fm->dv) { - size_t dsize = fm->dvsize += psize; - fm->dv = p; - set_size_and_pinuse_of_free_chunk(p, dsize); - goto postaction; - } else { - size_t nsize = chunksize(next); - psize += nsize; - unlink_chunk(fm, next, nsize); - set_size_and_pinuse_of_free_chunk(p, psize); - if (p == fm->dv) { - fm->dvsize = psize; - goto postaction; - } - } - } else - set_free_with_pinuse(p, psize, next); - insert_chunk(fm, p, psize); - check_free_chunk(fm, p); - goto postaction; - } + + if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) { + if (!cinuse(next)) { /* consolidate forward */ + if (next == fm->top) { + size_t tsize = fm->topsize += psize; + fm->top = p; + p->head = tsize | PINUSE_BIT; + if (p == fm->dv) { + fm->dv = 0; + fm->dvsize = 0; + } + if (should_trim(fm, tsize)) + sys_trim(fm, 0); + goto postaction; + } + else if (next == fm->dv) { + size_t dsize = fm->dvsize += psize; + fm->dv = p; + set_size_and_pinuse_of_free_chunk(p, dsize); + goto postaction; + } + else { + size_t nsize = chunksize(next); + psize += nsize; + unlink_chunk(fm, next, nsize); + set_size_and_pinuse_of_free_chunk(p, psize); + if (p == fm->dv) { + fm->dvsize = psize; + goto postaction; + } } - erroraction: - USAGE_ERROR_ACTION(fm, p); - postaction: - POSTACTION(fm); + } + else + set_free_with_pinuse(p, psize, next); + insert_chunk(fm, p, psize); + check_free_chunk(fm, p); + goto postaction; } + } + erroraction: + USAGE_ERROR_ACTION(fm, p); + postaction: + POSTACTION(fm); } + } } -void * -mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) -{ - void *mem; - size_t req = 0; - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - if (n_elements != 0) { - req = n_elements * elem_size; - if (((n_elements | elem_size) & ~(size_t) 0xffff) && - (req / n_elements != elem_size)) - req = MAX_SIZE_T; /* force downstream failure on overflow */ - } - mem = internal_malloc(ms, req); - if (mem != 0 && calloc_must_clear(mem2chunk(mem))) - memset(mem, 0, req); - return mem; +void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) { + void* mem; + size_t req = 0; + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + if (n_elements != 0) { + req = n_elements * elem_size; + if (((n_elements | elem_size) & ~(size_t)0xffff) && + (req / n_elements != elem_size)) + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = internal_malloc(ms, req); + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; } -void * -mspace_realloc(mspace msp, void *oldmem, size_t bytes) -{ - if (oldmem == 0) - return mspace_malloc(msp, bytes); +void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) { + if (oldmem == 0) + return mspace_malloc(msp, bytes); #ifdef REALLOC_ZERO_BYTES_FREES - if (bytes == 0) { - mspace_free(msp, oldmem); - return 0; - } + if (bytes == 0) { + mspace_free(msp, oldmem); + return 0; + } #endif /* REALLOC_ZERO_BYTES_FREES */ - else { + else { #if FOOTERS - mchunkptr p = mem2chunk(oldmem); - mstate ms = get_mstate_for(p); + mchunkptr p = mem2chunk(oldmem); + mstate ms = get_mstate_for(p); #else /* FOOTERS */ - mstate ms = (mstate) msp; + mstate ms = (mstate)msp; #endif /* FOOTERS */ - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - return internal_realloc(ms, oldmem, bytes); + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; } + return internal_realloc(ms, oldmem, bytes); + } } -void * -mspace_memalign(mspace msp, size_t alignment, size_t bytes) -{ - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - return internal_memalign(ms, alignment, bytes); +void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return internal_memalign(ms, alignment, bytes); } -void ** -mspace_independent_calloc(mspace msp, size_t n_elements, - size_t elem_size, void *chunks[]) -{ - size_t sz = elem_size; /* serves as 1-element array */ - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - return ialloc(ms, n_elements, &sz, 3, chunks); +void** mspace_independent_calloc(mspace msp, size_t n_elements, + size_t elem_size, void* chunks[]) { + size_t sz = elem_size; /* serves as 1-element array */ + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return ialloc(ms, n_elements, &sz, 3, chunks); } -void ** -mspace_independent_comalloc(mspace msp, size_t n_elements, - size_t sizes[], void *chunks[]) -{ - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - return 0; - } - return ialloc(ms, n_elements, sizes, 0, chunks); +void** mspace_independent_comalloc(mspace msp, size_t n_elements, + size_t sizes[], void* chunks[]) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + return 0; + } + return ialloc(ms, n_elements, sizes, 0, chunks); } -int -mspace_trim(mspace msp, size_t pad) -{ - int result = 0; - mstate ms = (mstate) msp; - if (ok_magic(ms)) { - if (!PREACTION(ms)) { - result = sys_trim(ms, pad); - POSTACTION(ms); - } - } else { - USAGE_ERROR_ACTION(ms, ms); +int mspace_trim(mspace msp, size_t pad) { + int result = 0; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + if (!PREACTION(ms)) { + result = sys_trim(ms, pad); + POSTACTION(ms); } - return result; + } + else { + USAGE_ERROR_ACTION(ms,ms); + } + return result; } -void -mspace_malloc_stats(mspace msp) -{ - mstate ms = (mstate) msp; - if (ok_magic(ms)) { - internal_malloc_stats(ms); - } else { - USAGE_ERROR_ACTION(ms, ms); - } +void mspace_malloc_stats(mspace msp) { + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + internal_malloc_stats(ms); + } + else { + USAGE_ERROR_ACTION(ms,ms); + } } -size_t -mspace_footprint(mspace msp) -{ - size_t result; - mstate ms = (mstate) msp; - if (ok_magic(ms)) { - result = ms->footprint; - } - USAGE_ERROR_ACTION(ms, ms); - return result; +size_t mspace_footprint(mspace msp) { + size_t result; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + result = ms->footprint; + } + USAGE_ERROR_ACTION(ms,ms); + return result; } -size_t -mspace_max_footprint(mspace msp) -{ - size_t result; - mstate ms = (mstate) msp; - if (ok_magic(ms)) { - result = ms->max_footprint; - } - USAGE_ERROR_ACTION(ms, ms); - return result; +size_t mspace_max_footprint(mspace msp) { + size_t result; + mstate ms = (mstate)msp; + if (ok_magic(ms)) { + result = ms->max_footprint; + } + USAGE_ERROR_ACTION(ms,ms); + return result; } #if !NO_MALLINFO -struct mallinfo -mspace_mallinfo(mspace msp) -{ - mstate ms = (mstate) msp; - if (!ok_magic(ms)) { - USAGE_ERROR_ACTION(ms, ms); - } - return internal_mallinfo(ms); +struct mallinfo mspace_mallinfo(mspace msp) { + mstate ms = (mstate)msp; + if (!ok_magic(ms)) { + USAGE_ERROR_ACTION(ms,ms); + } + return internal_mallinfo(ms); } #endif /* NO_MALLINFO */ -int -mspace_mallopt(int param_number, int value) -{ - return change_mparam(param_number, value); +int mspace_mallopt(int param_number, int value) { + return change_mparam(param_number, value); } #endif /* MSPACES */ diff --git a/src/stdlib/SDL_mslibc.c b/src/stdlib/SDL_mslibc.c index 8f92463b13049..c5661f8dd5b60 100644 --- a/src/stdlib/SDL_mslibc.c +++ b/src/stdlib/SDL_mslibc.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,26 +41,28 @@ __declspec(selectany) int _fltused = 1; /* The optimizer on Visual Studio 2005 and later generates memcpy() and memset() calls. Always provide it for the SDL2 DLL, but skip it when building static lib w/ static runtime. */ #if (_MSC_VER >= 1400) && (!defined(_MT) || defined(DLL_EXPORT)) -extern void *memcpy(void* dst, const void* src, size_t len); +/* NOLINTNEXTLINE(readability-redundant-declaration) */ +extern void *memcpy(void *dst, const void *src, size_t len); #pragma intrinsic(memcpy) #if !defined(__clang__) #pragma function(memcpy) #endif -void * -memcpy(void *dst, const void *src, size_t len) +/* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */ +void *memcpy(void *dst, const void *src, size_t len) { return SDL_memcpy(dst, src, len); } -extern void *memset(void* dst, int c, size_t len); +/* NOLINTNEXTLINE(readability-redundant-declaration) */ +extern void *memset(void *dst, int c, size_t len); #pragma intrinsic(memset) #if !defined(__clang__) #pragma function(memset) #endif -void * -memset(void *dst, int c, size_t len) +/* NOLINTNEXTLINE(readability-inconsistent-declaration-parameter-name) */ +void *memset(void *dst, int c, size_t len) { return SDL_memset(dst, c, len); } @@ -69,9 +71,7 @@ memset(void *dst, int c, size_t len) #ifdef _M_IX86 /* Float to long */ -void -__declspec(naked) -_ftol() +void __declspec(naked) _ftol() { /* *INDENT-OFF* */ __asm { @@ -120,22 +120,18 @@ _ftol() /* *INDENT-ON* */ } -void -_ftol2_sse() +void _ftol2_sse() { _ftol(); } -void -_ftol2() +void _ftol2() { _ftol(); } /* 64-bit math operators for 32-bit systems */ -void -__declspec(naked) -_allmul() +void __declspec(naked) _allmul() { /* *INDENT-OFF* */ __asm { @@ -163,9 +159,7 @@ _allmul() /* *INDENT-ON* */ } -void -__declspec(naked) -_alldiv() +void __declspec(naked) _alldiv() { /* *INDENT-OFF* */ __asm { @@ -251,9 +245,7 @@ _alldiv() /* *INDENT-ON* */ } -void -__declspec(naked) -_aulldiv() +void __declspec(naked) _aulldiv() { /* *INDENT-OFF* */ __asm { @@ -309,9 +301,7 @@ _aulldiv() /* *INDENT-ON* */ } -void -__declspec(naked) -_allrem() +void __declspec(naked) _allrem() { /* *INDENT-OFF* */ __asm { @@ -396,9 +386,7 @@ _allrem() /* *INDENT-ON* */ } -void -__declspec(naked) -_aullrem() +void __declspec(naked) _aullrem() { /* *INDENT-OFF* */ __asm { @@ -455,9 +443,7 @@ _aullrem() /* *INDENT-ON* */ } -void -__declspec(naked) -_alldvrm() +void __declspec(naked) _alldvrm() { /* *INDENT-OFF* */ __asm { @@ -565,9 +551,7 @@ _alldvrm() /* *INDENT-ON* */ } -void -__declspec(naked) -_aulldvrm() +void __declspec(naked) _aulldvrm() { /* *INDENT-OFF* */ __asm { @@ -638,9 +622,7 @@ _aulldvrm() /* *INDENT-ON* */ } -void -__declspec(naked) -_allshl() +void __declspec(naked) _allshl() { /* *INDENT-OFF* */ __asm { @@ -665,9 +647,7 @@ _allshl() /* *INDENT-ON* */ } -void -__declspec(naked) -_allshr() +void __declspec(naked) _allshr() { /* *INDENT-OFF* */ __asm { @@ -692,9 +672,7 @@ _allshr() /* *INDENT-ON* */ } -void -__declspec(naked) -_aullshr() +void __declspec(naked) _aullshr() { /* *INDENT-OFF* */ __asm { @@ -723,6 +701,19 @@ _aullshr() #endif /* MSC_VER */ +#if defined(__ICL) +/* The classic Intel compiler generates calls to _intel_fast_memcpy + * and _intel_fast_memset when building an optimized SDL library */ +void *_intel_fast_memcpy(void *dst, const void *src, size_t len) +{ + return SDL_memcpy(dst, src, len); +} +void *_intel_fast_memset(void *dst, int c, size_t len) +{ + return SDL_memset(dst, c, len); +} +#endif + #endif /* !HAVE_LIBC && !SDL_STATIC_LIB */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c index d17b6a31c6930..63995594e67e9 100644 --- a/src/stdlib/SDL_qsort.c +++ b/src/stdlib/SDL_qsort.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,9 +28,11 @@ #include "SDL_stdinc.h" #if defined(HAVE_QSORT) -void -SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) +void SDL_qsort(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare) { + if (!base) { + return; + } qsort(base, nmemb, size, compare); } @@ -63,7 +65,7 @@ SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, c /* This code came from Gareth McCaughan, under the zlib license. -Specifically this: https://www.mccaughan.org.uk/software/qsort.c-1.15 +Specifically this: https://www.mccaughan.org.uk/software/qsort.c-1.16 Everything below this comment until the HAVE_QSORT #endif was from Gareth (any minor changes will be noted inline). @@ -110,7 +112,7 @@ benefit! * Gareth McCaughan */ -/* Copyright (c) 1998-2016 Gareth McCaughan +/* Copyright (c) 1998-2021 Gareth McCaughan * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any @@ -146,17 +148,23 @@ benefit! * (pre-insertion-sort messed up). * Disable DEBUG_QSORT by default. * Tweak comments very slightly. + * 2021-02-20 v1.16 Fix bug kindly reported by Ray Gardner + * (error in recursion leading to possible + * stack overflow). + * When checking alignment, avoid casting + * pointer to possibly-smaller integer. */ /* BEGIN SDL CHANGE ... commented this out with an #if 0 block. --ryan. */ #if 0 #include +#include #include #include #undef DEBUG_QSORT -static char _ID[]=""; +static char _ID[]=""; #endif /* END SDL CHANGE ... commented this out with an #if 0 block. --ryan. */ @@ -166,7 +174,8 @@ static char _ID[]=""; #define WORD_BYTES sizeof(int) /* How big does our stack need to be? Answer: one entry per - * bit in a |size_t|. + * bit in a |size_t|. (Actually, a bit less because we don't + * recurse all the way down to size-1 subarrays.) */ #define STACK_SIZE (8*sizeof(size_t)) @@ -205,11 +214,12 @@ typedef struct { char * first; char * last; } stack_entry; * on large datasets for locality-of-reference reasons, * but it makes the code much nastier and increases * bookkeeping overhead. - * 2. We always save the shorter and get to work on the - * longer. This guarantees that every time we push - * an item onto the stack its size is <= 1/2 of that - * of its parent; so the stack can't need more than - * log_2(max-array-size) entries. + * 2. We always save the longer and get to work on the + * shorter. This guarantees that whenever we push + * a k'th entry onto the stack we are about to get + * working on something of size <= N/2^k where N is + * the original array size; so the stack can't need + * more than log_2(max-array-size) entries. * 3. We choose a pivot by looking at the first, last * and middle elements. We arrange them into order * because it's easy to do that in conjunction with @@ -271,8 +281,8 @@ typedef struct { char * first; char * last; } stack_entry; if (r>=Trunc) doRight \ else pop \ } \ - else if (l<=r) { pushLeft; doRight } \ - else if (r>=Trunc) { pushRight; doLeft }\ + else if (l<=r) { pushRight; doLeft } \ + else if (r>=Trunc) { pushLeft; doRight }\ else doLeft \ } @@ -366,7 +376,7 @@ typedef struct { char * first; char * last; } stack_entry; /* ---------------------------------------------------------------------- */ static char * pivot_big(char *first, char *mid, char *last, size_t size, - int compare(const void *, const void *)) { + int (SDLCALL * compare)(const void *, const void *)) { size_t d=(((last-first)/size)>>3)*size; #ifdef DEBUG_QSORT fprintf(stderr, "pivot_big: first=%p last=%p size=%lu n=%lu\n", first, (unsigned long)last, size, (unsigned long)((last-first+1)/size)); @@ -407,7 +417,7 @@ fprintf(stderr,"-> %d %d %d @ %p %p %p\n",*(int*)m1,*(int*)m2,*(int*)m3, m1,m2,m /* ---------------------------------------------------------------------- */ static void qsort_nonaligned(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { + int (SDLCALL * compare)(const void *, const void *)) { stack_entry stack[STACK_SIZE]; int stacktop=0; @@ -438,7 +448,7 @@ static void qsort_nonaligned(void *base, size_t nmemb, size_t size, } static void qsort_aligned(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { + int (SDLCALL * compare)(const void *, const void *)) { stack_entry stack[STACK_SIZE]; int stacktop=0; @@ -469,7 +479,7 @@ static void qsort_aligned(void *base, size_t nmemb, size_t size, } static void qsort_words(void *base, size_t nmemb, - int (*compare)(const void *, const void *)) { + int (SDLCALL * compare)(const void *, const void *)) { stack_entry stack[STACK_SIZE]; int stacktop=0; @@ -520,11 +530,10 @@ fprintf(stderr, "after partitioning first=#%lu last=#%lu\n", (first-(char*)base) /* ---------------------------------------------------------------------- */ -extern void qsortG(void *base, size_t nmemb, size_t size, - int (*compare)(const void *, const void *)) { +extern void qsortG(void *base, size_t nmemb, size_t size, SDL_CompareCallback compare) { if (nmemb<=1) return; - if (((size_t)base|size)&(WORD_BYTES-1)) + if (((uintptr_t)base|size)&(WORD_BYTES-1)) qsort_nonaligned(base,nmemb,size,compare); else if (size!=WORD_BYTES) qsort_aligned(base,nmemb,size,compare); @@ -534,8 +543,7 @@ extern void qsortG(void *base, size_t nmemb, size_t size, #endif /* HAVE_QSORT */ -void * -SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compare)(const void *, const void *)) +void *SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, SDL_CompareCallback compare) { #if defined(HAVE_BSEARCH) return bsearch(key, base, nmemb, size, compare); @@ -568,4 +576,3 @@ SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (* } /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index 2af18b1f05e1f..2a930da2f5e77 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,6 @@ #include "SDL_stdinc.h" #include "../libm/math_libm.h" - double SDL_atan(double x) { @@ -41,8 +40,7 @@ SDL_atan(double x) #endif } -float -SDL_atanf(float x) +float SDL_atanf(float x) { #if defined(HAVE_ATANF) return atanf(x); @@ -61,8 +59,7 @@ SDL_atan2(double y, double x) #endif } -float -SDL_atan2f(float y, float x) +float SDL_atan2f(float y, float x) { #if defined(HAVE_ATAN2F) return atan2f(y, x); @@ -91,8 +88,7 @@ SDL_acos(double val) #endif } -float -SDL_acosf(float val) +float SDL_acosf(float val) { #if defined(HAVE_ACOSF) return acosf(val); @@ -117,8 +113,7 @@ SDL_asin(double val) #endif } -float -SDL_asinf(float val) +float SDL_asinf(float val) { #if defined(HAVE_ASINF) return asinf(val); @@ -142,8 +137,7 @@ SDL_ceil(double x) #endif /* HAVE_CEIL */ } -float -SDL_ceilf(float x) +float SDL_ceilf(float x) { #if defined(HAVE_CEILF) return ceilf(x); @@ -161,8 +155,8 @@ SDL_copysign(double x, double y) return _copysign(x, y); #elif defined(__WATCOMC__) && defined(__386__) /* this is nasty as hell, but it works.. */ - unsigned int *xi = (unsigned int *) &x, - *yi = (unsigned int *) &y; + unsigned int *xi = (unsigned int *)&x, + *yi = (unsigned int *)&y; xi[1] = (yi[1] & 0x80000000) | (xi[1] & 0x7fffffff); return x; #else @@ -170,8 +164,7 @@ SDL_copysign(double x, double y) #endif /* HAVE_COPYSIGN */ } -float -SDL_copysignf(float x, float y) +float SDL_copysignf(float x, float y) { #if defined(HAVE_COPYSIGNF) return copysignf(x, y); @@ -190,8 +183,7 @@ SDL_cos(double x) #endif } -float -SDL_cosf(float x) +float SDL_cosf(float x) { #if defined(HAVE_COSF) return cosf(x); @@ -210,8 +202,7 @@ SDL_exp(double x) #endif } -float -SDL_expf(float x) +float SDL_expf(float x) { #if defined(HAVE_EXPF) return expf(x); @@ -230,8 +221,7 @@ SDL_fabs(double x) #endif } -float -SDL_fabsf(float x) +float SDL_fabsf(float x) { #if defined(HAVE_FABSF) return fabsf(x); @@ -250,8 +240,7 @@ SDL_floor(double x) #endif } -float -SDL_floorf(float x) +float SDL_floorf(float x) { #if defined(HAVE_FLOORF) return floorf(x); @@ -274,8 +263,7 @@ SDL_trunc(double x) #endif } -float -SDL_truncf(float x) +float SDL_truncf(float x) { #if defined(HAVE_TRUNCF) return truncf(x); @@ -294,8 +282,7 @@ SDL_fmod(double x, double y) #endif } -float -SDL_fmodf(float x, float y) +float SDL_fmodf(float x, float y) { #if defined(HAVE_FMODF) return fmodf(x, y); @@ -314,8 +301,7 @@ SDL_log(double x) #endif } -float -SDL_logf(float x) +float SDL_logf(float x) { #if defined(HAVE_LOGF) return logf(x); @@ -334,8 +320,7 @@ SDL_log10(double x) #endif } -float -SDL_log10f(float x) +float SDL_log10f(float x) { #if defined(HAVE_LOG10F) return log10f(x); @@ -354,8 +339,7 @@ SDL_pow(double x, double y) #endif } -float -SDL_powf(float x, float y) +float SDL_powf(float x, float y) { #if defined(HAVE_POWF) return powf(x, y); @@ -378,8 +362,7 @@ SDL_round(double arg) #endif } -float -SDL_roundf(float arg) +float SDL_roundf(float arg) { #if defined HAVE_ROUNDF return roundf(arg); @@ -388,8 +371,7 @@ SDL_roundf(float arg) #endif } -long -SDL_lround(double arg) +long SDL_lround(double arg) { #if defined HAVE_LROUND return lround(arg); @@ -398,8 +380,7 @@ SDL_lround(double arg) #endif } -long -SDL_lroundf(float arg) +long SDL_lroundf(float arg) { #if defined HAVE_LROUNDF return lroundf(arg); @@ -416,16 +397,15 @@ SDL_scalbn(double x, int n) #elif defined(HAVE__SCALB) return _scalb(x, n); #elif defined(HAVE_LIBC) && defined(HAVE_FLOAT_H) && (FLT_RADIX == 2) -/* from scalbn(3): If FLT_RADIX equals 2 (which is - * usual), then scalbn() is equivalent to ldexp(3). */ + /* from scalbn(3): If FLT_RADIX equals 2 (which is + * usual), then scalbn() is equivalent to ldexp(3). */ return ldexp(x, n); #else return SDL_uclibc_scalbn(x, n); #endif } -float -SDL_scalbnf(float x, int n) +float SDL_scalbnf(float x, int n) { #if defined(HAVE_SCALBNF) return scalbnf(x, n); @@ -444,8 +424,7 @@ SDL_sin(double x) #endif } -float -SDL_sinf(float x) +float SDL_sinf(float x) { #if defined(HAVE_SINF) return sinf(x); @@ -464,8 +443,7 @@ SDL_sqrt(double x) #endif } -float -SDL_sqrtf(float x) +float SDL_sqrtf(float x) { #if defined(HAVE_SQRTF) return sqrtf(x); @@ -484,8 +462,7 @@ SDL_tan(double x) #endif } -float -SDL_tanf(float x) +float SDL_tanf(float x) { #if defined(HAVE_TANF) return tanf(x); @@ -504,7 +481,10 @@ int SDL_abs(int x) } #if defined(HAVE_CTYPE_H) -int SDL_isalpha(int x) { return isalpha(x); } +int SDL_isalpha(int x) +{ + return isalpha(x); +} int SDL_isalnum(int x) { return isalnum(x); } int SDL_isdigit(int x) { return isdigit(x); } int SDL_isxdigit(int x) { return isxdigit(x); } @@ -518,7 +498,10 @@ int SDL_iscntrl(int x) { return iscntrl(x); } int SDL_toupper(int x) { return toupper(x); } int SDL_tolower(int x) { return tolower(x); } #else -int SDL_isalpha(int x) { return (SDL_isupper(x)) || (SDL_islower(x)); } +int SDL_isalpha(int x) +{ + return (SDL_isupper(x)) || (SDL_islower(x)); +} int SDL_isalnum(int x) { return (SDL_isalpha(x)) || (SDL_isdigit(x)); } int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); } int SDL_isxdigit(int x) { return (((x) >= 'A') && ((x) <= 'F')) || (((x) >= 'a') && ((x) <= 'f')) || (SDL_isdigit(x)); } @@ -529,14 +512,13 @@ int SDL_islower(int x) { return ((x) >= 'a') && ((x) <= 'z'); } int SDL_isprint(int x) { return ((x) >= ' ') && ((x) < '\x7f'); } int SDL_isgraph(int x) { return (SDL_isprint(x)) && ((x) != ' '); } int SDL_iscntrl(int x) { return (((x) >= '\0') && ((x) <= '\x1f')) || ((x) == '\x7f'); } -int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); } -int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); } +int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A' + ((x) - 'a')) : (x); } +int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a' + ((x) - 'A')) : (x); } #endif /* This file contains a portable memcpy manipulation function for SDL */ -void * -SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len) +void *SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len) { #ifdef __GNUC__ /* Presumably this is well tuned for speed. @@ -566,15 +548,15 @@ SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, Uint32 *srcp4, *dstp4; Uint8 *srcp1, *dstp1; - srcp4 = (Uint32 *) src; - dstp4 = (Uint32 *) dst; + srcp4 = (Uint32 *)src; + dstp4 = (Uint32 *)dst; len /= 4; while (len--) { *dstp4++ = *srcp4++; } - srcp1 = (Uint8 *) srcp4; - dstp1 = (Uint8 *) dstp4; + srcp1 = (Uint8 *)srcp4; + dstp1 = (Uint8 *)dstp4; switch (left) { case 3: *dstp1++ = *srcp1++; @@ -588,15 +570,14 @@ SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, #endif /* __GNUC__ */ } -void * -SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len) +void *SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len) { #if defined(HAVE_MEMSET) return memset(dst, c, len); #else size_t left; Uint32 *dstp4; - Uint8 *dstp1 = (Uint8 *) dst; + Uint8 *dstp1 = (Uint8 *)dst; Uint8 value1; Uint32 value4; @@ -616,14 +597,14 @@ SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len) } value4 = ((Uint32)c | ((Uint32)c << 8) | ((Uint32)c << 16) | ((Uint32)c << 24)); - dstp4 = (Uint32 *) dstp1; + dstp4 = (Uint32 *)dstp1; left = (len % 4); len /= 4; while (len--) { *dstp4++ = value4; } - dstp1 = (Uint8 *) dstp4; + dstp1 = (Uint8 *)dstp4; switch (left) { case 3: *dstp1++ = value1; @@ -638,9 +619,15 @@ SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len) } #if defined(HAVE_CTYPE_H) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -int SDL_isblank(int x) { return isblank(x); } +int SDL_isblank(int x) +{ + return isblank(x); +} #else -int SDL_isblank(int x) { return ((x) == ' ') || ((x) == '\t'); } +int SDL_isblank(int x) +{ + return ((x) == ' ') || ((x) == '\t'); +} #endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index ec632b7a6b28a..38b5201c624a0 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,271 +34,266 @@ #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL) -#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F')) -#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f')) +#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F')) +#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f')) #endif -#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4) +#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4) #define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF) -static unsigned UTF8_TrailingBytes(unsigned char c) +static size_t UTF8_TrailingBytes(unsigned char c) { - if (c >= 0xC0 && c <= 0xDF) + if (c >= 0xC0 && c <= 0xDF) { return 1; - else if (c >= 0xE0 && c <= 0xEF) + } else if (c >= 0xE0 && c <= 0xEF) { return 2; - else if (c >= 0xF0 && c <= 0xF4) + } else if (c >= 0xF0 && c <= 0xF4) { return 3; - else - return 0; + } + + return 0; } #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOL) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanLong(const char *text, int count, int radix, long *valuep) -{ - const char *textstart = text; - long value = 0; +/** + * Parses an unsigned long long and returns the unsigned value and sign bit. + * + * Positive values are clamped to ULLONG_MAX. + * The result `value == 0 && negative` indicates negative overflow + * and might need to be handled differently depending on whether a + * signed or unsigned integer is being parsed. + */ +static size_t SDL_ScanUnsignedLongLongInternal(const char *text, int count, int radix, unsigned long long *valuep, SDL_bool *negativep) +{ + const unsigned long long ullong_max = ~0ULL; + + const char *text_start = text; + const char *number_start = text_start; + unsigned long long value = 0; SDL_bool negative = SDL_FALSE; + SDL_bool overflow = SDL_FALSE; - if (*text == '-') { - negative = SDL_TRUE; - ++text; + if (radix == 0 || (radix >= 2 && radix <= 36)) { + while (SDL_isspace(*text)) { + ++text; + } + if (*text == '-' || *text == '+') { + negative = *text == '-'; + ++text; + } + if ((radix == 0 || radix == 16) && *text == '0' && (text[1] == 'x' || text[1] == 'X')) { + text += 2; + radix = 16; + } else if (radix == 0 && *text == '0' && (text[1] >= '0' && text[1] <= '9')) { + ++text; + radix = 8; + } else if (radix == 0) { + radix = 10; + } + number_start = text; + do { + unsigned long long digit; + if (*text >= '0' && *text <= '9') { + digit = *text - '0'; + } else if (radix > 10) { + if (*text >= 'A' && *text < 'A' + (radix - 10)) { + digit = 10 + (*text - 'A'); + } else if (*text >= 'a' && *text < 'a' + (radix - 10)) { + digit = 10 + (*text - 'a'); + } else { + break; + } + } else { + break; + } + if (value != 0 && radix > ullong_max / value) { + overflow = SDL_TRUE; + } else { + value *= radix; + if (digit > ullong_max - value) { + overflow = SDL_TRUE; + } else { + value += digit; + } + } + ++text; + } while (count == 0 || (text - text_start) != count); } - if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { - text += 2; - } - for (;;) { - int v; - if (SDL_isdigit((unsigned char) *text)) { - v = *text - '0'; - } else if (radix == 16 && SDL_isupperhex(*text)) { - v = 10 + (*text - 'A'); - } else if (radix == 16 && SDL_islowerhex(*text)) { - v = 10 + (*text - 'a'); + if (text == number_start) { + if (radix == 16 && text > text_start && (*(text - 1) == 'x' || *(text - 1) == 'X')) { + // the string was "0x"; consume the '0' but not the 'x' + --text; } else { - break; - } - value *= radix; - value += v; - ++text; - - if (count > 0 && (text - textstart) == count) { - break; + // no number was parsed, and thus no characters were consumed + text = text_start; } } - if (valuep && text > textstart) { - if (negative && value) { - *valuep = -value; + if (overflow) { + if (negative) { + value = 0; } else { - *valuep = value; + value = ullong_max; } + } else if (value == 0) { + negative = SDL_FALSE; } - return (text - textstart); + *valuep = value; + *negativep = negative; + return text - text_start; } -#endif -#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanUnsignedLong(const char *text, int count, int radix, unsigned long *valuep) +static size_t SDL_ScanLong(const char *text, int count, int radix, long *valuep) { - const char *textstart = text; - unsigned long value = 0; - - if (*text == '-') { - return SDL_ScanLong(text, count, radix, (long *)valuep); - } - - if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { - text += 2; - } - for (;;) { - int v; - if (SDL_isdigit((unsigned char) *text)) { - v = *text - '0'; - } else if (radix == 16 && SDL_isupperhex(*text)) { - v = 10 + (*text - 'A'); - } else if (radix == 16 && SDL_islowerhex(*text)) { - v = 10 + (*text - 'a'); + const unsigned long long_max = (~0UL) >> 1; + unsigned long long value; + SDL_bool negative; + size_t len = SDL_ScanUnsignedLongLongInternal(text, count, radix, &value, &negative); + if (negative) { + const unsigned long abs_long_min = long_max + 1; + if (value == 0 || value > abs_long_min) { + value = 0ULL - abs_long_min; } else { - break; + value = 0ULL - value; } - value *= radix; - value += v; - ++text; + } else if (value > long_max) { + value = long_max; + } + *valuep = (long)value; + return len; +} +#endif - if (count > 0 && (text - textstart) == count) { - break; +#if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD) +static size_t SDL_ScanUnsignedLong(const char *text, int count, int radix, unsigned long *valuep) +{ + const unsigned long ulong_max = ~0UL; + unsigned long long value; + SDL_bool negative; + size_t len = SDL_ScanUnsignedLongLongInternal(text, count, radix, &value, &negative); + if (negative) { + if (value == 0 || value > ulong_max) { + value = ulong_max; + } else if (value == ulong_max) { + value = 1; + } else { + value = 0ULL - value; } + } else if (value > ulong_max) { + value = ulong_max; } - if (valuep && text > textstart) { - *valuep = value; - } - return (text - textstart); + *valuep = (unsigned long)value; + return len; } #endif #ifndef HAVE_VSSCANF -static size_t -SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep) -{ - const char *textstart = text; - uintptr_t value = 0; - - if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { - text += 2; - } - for (;;) { - int v; - if (SDL_isdigit((unsigned char) *text)) { - v = *text - '0'; - } else if (radix == 16 && SDL_isupperhex(*text)) { - v = 10 + (*text - 'A'); - } else if (radix == 16 && SDL_islowerhex(*text)) { - v = 10 + (*text - 'a'); +static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep) +{ + const uintptr_t uintptr_max = ~(uintptr_t)0; + unsigned long long value; + SDL_bool negative; + size_t len = SDL_ScanUnsignedLongLongInternal(text, 0, 16, &value, &negative); + if (negative) { + if (value == 0 || value > uintptr_max) { + value = uintptr_max; + } else if (value == uintptr_max) { + value = 1; } else { - break; + value = 0ULL - value; } - value *= radix; - value += v; - ++text; + } else if (value > uintptr_max) { + value = uintptr_max; } - if (valuep && text > textstart) { - *valuep = value; - } - return (text - textstart); + *valuep = (uintptr_t)value; + return len; } #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOLL) || !defined(HAVE_STRTOULL) -static size_t -SDL_ScanLongLong(const char *text, int count, int radix, Sint64 * valuep) -{ - const char *textstart = text; - Sint64 value = 0; - SDL_bool negative = SDL_FALSE; - - if (*text == '-') { - negative = SDL_TRUE; - ++text; - } - if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { - text += 2; - } - for (;;) { - int v; - if (SDL_isdigit((unsigned char) *text)) { - v = *text - '0'; - } else if (radix == 16 && SDL_isupperhex(*text)) { - v = 10 + (*text - 'A'); - } else if (radix == 16 && SDL_islowerhex(*text)) { - v = 10 + (*text - 'a'); - } else { - break; - } - value *= radix; - value += v; - ++text; - - if (count > 0 && (text - textstart) == count) { - break; - } - } - if (valuep && text > textstart) { - if (negative && value) { - *valuep = -value; +static size_t SDL_ScanLongLong(const char *text, int count, int radix, Sint64 *valuep) +{ + const unsigned long long llong_max = (~0ULL) >> 1; + unsigned long long value; + SDL_bool negative; + size_t len = SDL_ScanUnsignedLongLongInternal(text, count, radix, &value, &negative); + if (negative) { + const unsigned long long abs_llong_min = llong_max + 1; + if (value == 0 || value > abs_llong_min) { + value = 0ULL - abs_llong_min; } else { - *valuep = value; + value = 0ULL - value; } + } else if (value > llong_max) { + value = llong_max; } - return (text - textstart); + *valuep = value; + return len; } #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOULL) -static size_t -SDL_ScanUnsignedLongLong(const char *text, int count, int radix, Uint64 * valuep) -{ - const char *textstart = text; - Uint64 value = 0; - - if (*text == '-') { - return SDL_ScanLongLong(text, count, radix, (Sint64 *)valuep); - } - - if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) { - text += 2; - } - for (;;) { - int v; - if (SDL_isdigit((unsigned char) *text)) { - v = *text - '0'; - } else if (radix == 16 && SDL_isupperhex(*text)) { - v = 10 + (*text - 'A'); - } else if (radix == 16 && SDL_islowerhex(*text)) { - v = 10 + (*text - 'a'); +static size_t SDL_ScanUnsignedLongLong(const char *text, int count, int radix, Uint64 *valuep) +{ + const unsigned long long ullong_max = ~0ULL; + SDL_bool negative; + size_t len = SDL_ScanUnsignedLongLongInternal(text, count, radix, valuep, &negative); + if (negative) { + if (*valuep == 0) { + *valuep = ullong_max; } else { - break; + *valuep = 0ULL - *valuep; } - value *= radix; - value += v; - ++text; - - if (count > 0 && (text - textstart) == count) { - break; - } - } - if (valuep && text > textstart) { - *valuep = value; } - return (text - textstart); + return len; } #endif #if !defined(HAVE_VSSCANF) || !defined(HAVE_STRTOD) -static size_t -SDL_ScanFloat(const char *text, double *valuep) +static size_t SDL_ScanFloat(const char *text, double *valuep) { - const char *textstart = text; - unsigned long lvalue = 0; + const char *text_start = text; + const char *number_start = text_start; double value = 0.0; SDL_bool negative = SDL_FALSE; - if (*text == '-') { - negative = SDL_TRUE; + while (SDL_isspace(*text)) { ++text; } - text += SDL_ScanUnsignedLong(text, 0, 10, &lvalue); - value += lvalue; - if (*text == '.') { - int mult = 10; + if (*text == '-' || *text == '+') { + negative = *text == '-'; ++text; - while (SDL_isdigit((unsigned char) *text)) { - lvalue = *text - '0'; - value += (double) lvalue / mult; - mult *= 10; + } + number_start = text; + if (SDL_isdigit(*text)) { + value += SDL_strtoull(text, (char **)(&text), 10); + if (*text == '.') { + double denom = 10; ++text; + while (SDL_isdigit(*text)) { + value += (double)(*text - '0') / denom; + denom *= 10; + ++text; + } } } - if (valuep && text > textstart) { - if (negative && value) { - *valuep = -value; - } else { - *valuep = value; - } + if (text == number_start) { + // no number was parsed, and thus no characters were consumed + text = text_start; + } else if (negative) { + value = -value; } - return (text - textstart); + *valuep = value; + return text - text_start; } #endif -void * -SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len) +void *SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len) { #if defined(HAVE_MEMMOVE) return memmove(dst, src, len); #else - char *srcp = (char *) src; - char *dstp = (char *) dst; + char *srcp = (char *)src; + char *dstp = (char *)dst; if (src < dst) { srcp += len - 1; @@ -315,8 +310,7 @@ SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, #endif /* HAVE_MEMMOVE */ } -int -SDL_memcmp(const void *s1, const void *s2, size_t len) +int SDL_memcmp(const void *s1, const void *s2, size_t len) { #if defined(__vita__) /* @@ -332,11 +326,11 @@ SDL_memcmp(const void *s1, const void *s2, size_t len) #elif defined(HAVE_MEMCMP) return memcmp(s1, s2, len); #else - char *s1p = (char *) s1; - char *s2p = (char *) s2; + char *s1p = (char *)s1; + char *s2p = (char *)s2; while (len--) { if (*s1p != *s2p) { - return (*s1p - *s2p); + return *s1p - *s2p; } ++s1p; ++s2p; @@ -360,7 +354,7 @@ SDL_strlen(const char *string) } size_t -SDL_wcslen(const wchar_t * string) +SDL_wcslen(const wchar_t *string) { #if defined(HAVE_WCSLEN) return wcslen(string); @@ -404,8 +398,7 @@ SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t max #endif /* HAVE_WCSLCAT */ } -wchar_t * -SDL_wcsdup(const wchar_t *string) +wchar_t *SDL_wcsdup(const wchar_t *string) { size_t len = ((SDL_wcslen(string) + 1) * sizeof(wchar_t)); wchar_t *newstr = (wchar_t *)SDL_malloc(len); @@ -415,11 +408,10 @@ SDL_wcsdup(const wchar_t *string) return newstr; } -wchar_t * -SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle) +wchar_t *SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle) { #if defined(HAVE_WCSSTR) - return SDL_const_cast(wchar_t*,wcsstr(haystack, needle)); + return SDL_const_cast(wchar_t *, wcsstr(haystack, needle)); #else size_t length = SDL_wcslen(needle); while (*haystack) { @@ -432,31 +424,31 @@ SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle) #endif /* HAVE_WCSSTR */ } -int -SDL_wcscmp(const wchar_t *str1, const wchar_t *str2) +int SDL_wcscmp(const wchar_t *str1, const wchar_t *str2) { #if defined(HAVE_WCSCMP) return wcscmp(str1, str2); #else while (*str1 && *str2) { - if (*str1 != *str2) + if (*str1 != *str2) { break; + } ++str1; ++str2; } - return (int)(*str1 - *str2); + return *str1 - *str2; #endif /* HAVE_WCSCMP */ } -int -SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) +int SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) { #if defined(HAVE_WCSNCMP) return wcsncmp(str1, str2, maxlen); #else while (*str1 && *str2 && maxlen) { - if (*str1 != *str2) + if (*str1 != *str2) { break; + } ++str1; ++str2; --maxlen; @@ -464,13 +456,12 @@ SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) if (!maxlen) { return 0; } - return (int) (*str1 - *str2); + return *str1 - *str2; #endif /* HAVE_WCSNCMP */ } -int -SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2) +int SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2) { #if defined(HAVE_WCSCASECMP) return wcscasecmp(str1, str2); @@ -485,11 +476,12 @@ SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2) a = *str1; b = *str2; } else { - a = SDL_toupper((unsigned char) *str1); - b = SDL_toupper((unsigned char) *str2); + a = SDL_toupper((unsigned char)*str1); + b = SDL_toupper((unsigned char)*str2); } - if (a != b) + if (a != b) { break; + } ++str1; ++str2; } @@ -499,15 +491,14 @@ SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2) a = *str1; b = *str2; } else { - a = SDL_toupper((unsigned char) *str1); - b = SDL_toupper((unsigned char) *str2); + a = SDL_toupper((unsigned char)*str1); + b = SDL_toupper((unsigned char)*str2); } - return (int) ((unsigned int) a - (unsigned int) b); + return (int)((unsigned int)a - (unsigned int)b); #endif /* HAVE__WCSICMP */ } -int -SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) +int SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) { #if defined(HAVE_WCSNCASECMP) return wcsncasecmp(str1, str2, maxlen); @@ -522,11 +513,12 @@ SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) a = *str1; b = *str2; } else { - a = SDL_toupper((unsigned char) *str1); - b = SDL_toupper((unsigned char) *str2); + a = SDL_toupper((unsigned char)*str1); + b = SDL_toupper((unsigned char)*str2); } - if (a != b) + if (a != b) { break; + } ++str1; ++str2; --maxlen; @@ -540,10 +532,10 @@ SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen) a = *str1; b = *str2; } else { - a = SDL_toupper((unsigned char) *str1); - b = SDL_toupper((unsigned char) *str2); + a = SDL_toupper((unsigned char)*str1); + b = SDL_toupper((unsigned char)*str2); } - return (int) ((unsigned int) a - (unsigned int) b); + return (int)((unsigned int)a - (unsigned int)b); } #endif /* HAVE__WCSNICMP */ } @@ -570,7 +562,7 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_ size_t src_bytes = SDL_strlen(src); size_t bytes = SDL_min(src_bytes, dst_bytes - 1); size_t i = 0; - unsigned char trailing_bytes = 0; + size_t trailing_bytes = 0; if (bytes) { unsigned char c = (unsigned char)src[bytes - 1]; @@ -581,8 +573,9 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_ c = (unsigned char)src[i]; trailing_bytes = UTF8_TrailingBytes(c); if (trailing_bytes) { - if (bytes - i != trailing_bytes + 1) + if (bytes - i != trailing_bytes + 1) { bytes = i; + } break; } @@ -608,7 +601,7 @@ SDL_utf8strlen(const char *str) retval++; } } - + return retval; } @@ -644,8 +637,7 @@ SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) #endif /* HAVE_STRLCAT */ } -char * -SDL_strdup(const char *string) +char *SDL_strdup(const char *string) { size_t len = SDL_strlen(string) + 1; char *newstr = (char *)SDL_malloc(len); @@ -655,8 +647,7 @@ SDL_strdup(const char *string) return newstr; } -char * -SDL_strrev(char *string) +char *SDL_strrev(char *string) { #if defined(HAVE__STRREV) return _strrev(string); @@ -666,7 +657,7 @@ SDL_strrev(char *string) char *b = &string[len - 1]; len /= 2; while (len--) { - char c = *a; + char c = *a; /* NOLINT(clang-analyzer-core.uninitialized.Assign) */ *a++ = *b; *b-- = c; } @@ -674,69 +665,65 @@ SDL_strrev(char *string) #endif /* HAVE__STRREV */ } -char * -SDL_strupr(char *string) +char *SDL_strupr(char *string) { #if defined(HAVE__STRUPR) return _strupr(string); #else char *bufp = string; while (*bufp) { - *bufp = SDL_toupper((unsigned char) *bufp); + *bufp = SDL_toupper((unsigned char)*bufp); ++bufp; } return string; #endif /* HAVE__STRUPR */ } -char * -SDL_strlwr(char *string) +char *SDL_strlwr(char *string) { #if defined(HAVE__STRLWR) return _strlwr(string); #else char *bufp = string; while (*bufp) { - *bufp = SDL_tolower((unsigned char) *bufp); + *bufp = SDL_tolower((unsigned char)*bufp); ++bufp; } return string; #endif /* HAVE__STRLWR */ } -char * -SDL_strchr(const char *string, int c) +char *SDL_strchr(const char *string, int c) { #ifdef HAVE_STRCHR - return SDL_const_cast(char*,strchr(string, c)); + return SDL_const_cast(char *, strchr(string, c)); #elif defined(HAVE_INDEX) - return SDL_const_cast(char*,index(string, c)); + return SDL_const_cast(char *, index(string, c)); #else while (*string) { if (*string == c) { - return (char *) string; + return (char *)string; } ++string; } if (c == '\0') { - return (char *) string; + return (char *)string; } return NULL; #endif /* HAVE_STRCHR */ } -char * -SDL_strrchr(const char *string, int c) +char *SDL_strrchr(const char *string, int c) { #ifdef HAVE_STRRCHR - return SDL_const_cast(char*,strrchr(string, c)); + return SDL_const_cast(char *, strrchr(string, c)); #elif defined(HAVE_RINDEX) - return SDL_const_cast(char*,rindex(string, c)); + return SDL_const_cast(char *, rindex(string, c)); #else const char *bufp = string + SDL_strlen(string); while (bufp >= string) { if (*bufp == c) { - return (char *) bufp; + return (char *)bufp; } --bufp; } @@ -744,16 +731,15 @@ SDL_strrchr(const char *string, int c) #endif /* HAVE_STRRCHR */ } -char * -SDL_strstr(const char *haystack, const char *needle) +char *SDL_strstr(const char *haystack, const char *needle) { #if defined(HAVE_STRSTR) - return SDL_const_cast(char*,strstr(haystack, needle)); + return SDL_const_cast(char *, strstr(haystack, needle)); #else size_t length = SDL_strlen(needle); while (*haystack) { if (SDL_strncmp(haystack, needle, length) == 0) { - return (char *) haystack; + return (char *)haystack; } ++haystack; } @@ -761,16 +747,15 @@ SDL_strstr(const char *haystack, const char *needle) #endif /* HAVE_STRSTR */ } -char * -SDL_strcasestr(const char *haystack, const char *needle) +char *SDL_strcasestr(const char *haystack, const char *needle) { #if defined(HAVE_STRCASESTR) - return SDL_const_cast(char*,strcasestr(haystack, needle)); + return SDL_const_cast(char *, strcasestr(haystack, needle)); #else size_t length = SDL_strlen(needle); while (*haystack) { if (SDL_strncasecmp(haystack, needle, length) == 0) { - return (char *) haystack; + return (char *)haystack; } ++haystack; } @@ -788,8 +773,7 @@ static const char ntoa_table[] = { }; #endif /* ntoa() conversion table */ -char * -SDL_itoa(int value, char *string, int radix) +char *SDL_itoa(int value, char *string, int radix) { #ifdef HAVE_ITOA return itoa(value, string, radix); @@ -798,8 +782,7 @@ SDL_itoa(int value, char *string, int radix) #endif /* HAVE_ITOA */ } -char * -SDL_uitoa(unsigned int value, char *string, int radix) +char *SDL_uitoa(unsigned int value, char *string, int radix) { #ifdef HAVE__UITOA return _uitoa(value, string, radix); @@ -808,8 +791,7 @@ SDL_uitoa(unsigned int value, char *string, int radix) #endif /* HAVE__UITOA */ } -char * -SDL_ltoa(long value, char *string, int radix) +char *SDL_ltoa(long value, char *string, int radix) { #if defined(HAVE__LTOA) return _ltoa(value, string, radix); @@ -827,8 +809,7 @@ SDL_ltoa(long value, char *string, int radix) #endif /* HAVE__LTOA */ } -char * -SDL_ultoa(unsigned long value, char *string, int radix) +char *SDL_ultoa(unsigned long value, char *string, int radix) { #if defined(HAVE__ULTOA) return _ultoa(value, string, radix); @@ -852,8 +833,7 @@ SDL_ultoa(unsigned long value, char *string, int radix) #endif /* HAVE__ULTOA */ } -char * -SDL_lltoa(Sint64 value, char *string, int radix) +char *SDL_lltoa(Sint64 value, char *string, int radix) { #if defined(HAVE__I64TOA) return _i64toa(value, string, radix); @@ -871,8 +851,7 @@ SDL_lltoa(Sint64 value, char *string, int radix) #endif /* HAVE__I64TOA */ } -char * -SDL_ulltoa(Uint64 value, char *string, int radix) +char *SDL_ulltoa(Uint64 value, char *string, int radix) { #if defined(HAVE__UI64TOA) return _ui64toa(value, string, radix); @@ -914,26 +893,15 @@ double SDL_atof(const char *string) #endif /* HAVE_ATOF */ } -long -SDL_strtol(const char *string, char **endp, int base) +long SDL_strtol(const char *string, char **endp, int base) { #if defined(HAVE_STRTOL) return strtol(string, endp, base); #else - size_t len; long value = 0; - - if (!base) { - if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanLong(string, 0, base, &value); + size_t len = SDL_ScanLong(string, 0, base, &value); if (endp) { - *endp = (char *) string + len; + *endp = (char *)string + len; } return value; #endif /* HAVE_STRTOL */ @@ -945,70 +913,38 @@ SDL_strtoul(const char *string, char **endp, int base) #if defined(HAVE_STRTOUL) return strtoul(string, endp, base); #else - size_t len; unsigned long value = 0; - - if (!base) { - if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanUnsignedLong(string, 0, base, &value); + size_t len = SDL_ScanUnsignedLong(string, 0, base, &value); if (endp) { - *endp = (char *) string + len; + *endp = (char *)string + len; } return value; #endif /* HAVE_STRTOUL */ } -Sint64 -SDL_strtoll(const char *string, char **endp, int base) +Sint64 SDL_strtoll(const char *string, char **endp, int base) { #if defined(HAVE_STRTOLL) return strtoll(string, endp, base); #else - size_t len; - Sint64 value = 0; - - if (!base) { - if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanLongLong(string, 0, base, &value); + long long value = 0; + size_t len = SDL_ScanLongLong(string, 0, base, &value); if (endp) { - *endp = (char *) string + len; + *endp = (char *)string + len; } return value; #endif /* HAVE_STRTOLL */ } -Uint64 -SDL_strtoull(const char *string, char **endp, int base) +Uint64 SDL_strtoull(const char *string, char **endp, int base) { #if defined(HAVE_STRTOULL) return strtoull(string, endp, base); #else - size_t len; - Uint64 value = 0; - - if (!base) { - if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) { - base = 16; - } else { - base = 10; - } - } - - len = SDL_ScanUnsignedLongLong(string, 0, base, &value); + unsigned long long value = 0; + size_t len = SDL_ScanUnsignedLongLong(string, 0, base, &value); if (endp) { - *endp = (char *) string + len; + *endp = (char *)string + len; } return value; #endif /* HAVE_STRTOULL */ @@ -1025,24 +961,24 @@ SDL_strtod(const char *string, char **endp) len = SDL_ScanFloat(string, &value); if (endp) { - *endp = (char *) string + len; + *endp = (char *)string + len; } return value; #endif /* HAVE_STRTOD */ } -int -SDL_strcmp(const char *str1, const char *str2) +int SDL_strcmp(const char *str1, const char *str2) { #if defined(HAVE_STRCMP) return strcmp(str1, str2); #else int result; - while(1) { - result = (int)((unsigned char) *str1 - (unsigned char) *str2); - if (result != 0 || (*str1 == '\0'/* && *str2 == '\0'*/)) + while (1) { + result = ((unsigned char)*str1 - (unsigned char)*str2); + if (result != 0 || (*str1 == '\0' /* && *str2 == '\0'*/)) { break; + } ++str1; ++str2; } @@ -1050,8 +986,7 @@ SDL_strcmp(const char *str1, const char *str2) #endif /* HAVE_STRCMP */ } -int -SDL_strncmp(const char *str1, const char *str2, size_t maxlen) +int SDL_strncmp(const char *str1, const char *str2, size_t maxlen) { #if defined(HAVE_STRNCMP) return strncmp(str1, str2, maxlen); @@ -1059,9 +994,10 @@ SDL_strncmp(const char *str1, const char *str2, size_t maxlen) int result; while (maxlen) { - result = (int) (unsigned char) *str1 - (unsigned char) *str2; - if (result != 0 || *str1 == '\0'/* && *str2 == '\0'*/) + result = (int)(unsigned char)*str1 - (unsigned char)*str2; + if (result != 0 || *str1 == '\0' /* && *str2 == '\0'*/) { break; + } ++str1; ++str2; --maxlen; @@ -1073,8 +1009,7 @@ SDL_strncmp(const char *str1, const char *str2, size_t maxlen) #endif /* HAVE_STRNCMP */ } -int -SDL_strcasecmp(const char *str1, const char *str2) +int SDL_strcasecmp(const char *str1, const char *str2) { #ifdef HAVE_STRCASECMP return strcasecmp(str1, str2); @@ -1084,11 +1019,12 @@ SDL_strcasecmp(const char *str1, const char *str2) int a, b, result; while (1) { - a = SDL_toupper((unsigned char) *str1); - b = SDL_toupper((unsigned char) *str2); + a = SDL_toupper((unsigned char)*str1); + b = SDL_toupper((unsigned char)*str2); result = a - b; - if (result != 0 || a == 0 /*&& b == 0*/) + if (result != 0 || a == 0 /*&& b == 0*/) { break; + } ++str1; ++str2; } @@ -1096,8 +1032,7 @@ SDL_strcasecmp(const char *str1, const char *str2) #endif /* HAVE_STRCASECMP */ } -int -SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) +int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) { #ifdef HAVE_STRNCASECMP return strncasecmp(str1, str2, maxlen); @@ -1107,23 +1042,24 @@ SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) int a, b, result; while (maxlen) { - a = SDL_tolower((unsigned char) *str1); - b = SDL_tolower((unsigned char) *str2); + a = SDL_tolower((unsigned char)*str1); + b = SDL_tolower((unsigned char)*str2); result = a - b; - if (result != 0 || a == 0 /*&& b == 0*/) + if (result != 0 || a == 0 /*&& b == 0*/) { break; + } ++str1; ++str2; --maxlen; } - if (maxlen == 0) + if (maxlen == 0) { result = 0; + } return result; #endif /* HAVE_STRNCASECMP */ } -int -SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) +int SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { int rc; va_list ap; @@ -1134,15 +1070,48 @@ SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) } #ifdef HAVE_VSSCANF -int -SDL_vsscanf(const char *text, const char *fmt, va_list ap) +int SDL_vsscanf(const char *text, const char *fmt, va_list ap) { return vsscanf(text, fmt, ap); } #else -int -SDL_vsscanf(const char *text, const char *fmt, va_list ap) +static SDL_bool CharacterMatchesSet(char c, const char *set, size_t set_len) +{ + SDL_bool invert = SDL_FALSE; + SDL_bool result = SDL_FALSE; + + if (*set == '^') { + invert = SDL_TRUE; + ++set; + --set_len; + } + while (set_len > 0 && !result) { + if (set_len >= 3 && set[1] == '-') { + char low_char = SDL_min(set[0], set[2]); + char high_char = SDL_max(set[0], set[2]); + if (c >= low_char && c <= high_char) { + result = SDL_TRUE; + } + set += 3; + set_len -= 3; + } else { + if (c == *set) { + result = SDL_TRUE; + } + ++set; + --set_len; + } + } + if (invert) { + result = result ? SDL_FALSE : SDL_TRUE; + } + return result; +} + +/* NOLINTNEXTLINE(readability-non-const-parameter) */ +int SDL_vsscanf(const char *text, const char *fmt, va_list ap) { + const char *start = text; int retval = 0; if (!text || !*text) { @@ -1151,7 +1120,7 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) while (*fmt) { if (*fmt == ' ') { - while (SDL_isspace((unsigned char) *text)) { + while (SDL_isspace((unsigned char)*text)) { ++text; } ++fmt; @@ -1205,7 +1174,7 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) continue; } - while (SDL_isspace((unsigned char) *text)) { + while (SDL_isspace((unsigned char)*text)) { ++text; } @@ -1216,7 +1185,9 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) suppress = SDL_TRUE; break; case 'h': - if (inttype > DO_SHORT) { + if (inttype == DO_INT) { + inttype = DO_SHORT; + } else if (inttype > DO_SHORT) { ++inttype; } break; @@ -1235,19 +1206,19 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) inttype = DO_SIZE_T; break; case 'i': - { - int index = 0; - if (text[index] == '-') { - ++index; - } - if (text[index] == '0') { - if (SDL_tolower((unsigned char) text[index + 1]) == 'x') { - radix = 16; - } else { - radix = 8; - } + { + int index = 0; + if (text[index] == '-') { + ++index; + } + if (text[index] == '0') { + if (SDL_tolower((unsigned char)text[index + 1]) == 'x') { + radix = 16; + } else { + radix = 8; } } + } SDL_FALLTHROUGH; case 'd': if (inttype == DO_LONGLONG) { @@ -1275,23 +1246,20 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) if (advance && !suppress) { switch (inttype) { case DO_SHORT: - { - short *valuep = va_arg(ap, short *); - *valuep = (short) value; - } - break; + { + short *valuep = va_arg(ap, short *); + *valuep = (short)value; + } break; case DO_INT: - { - int *valuep = va_arg(ap, int *); - *valuep = (int) value; - } - break; + { + int *valuep = va_arg(ap, int *); + *valuep = (int)value; + } break; case DO_LONG: - { - long *valuep = va_arg(ap, long *); - *valuep = value; - } - break; + { + long *valuep = va_arg(ap, long *); + *valuep = value; + } break; case DO_LONGLONG: case DO_SIZE_T: /* Handled above */ @@ -1339,23 +1307,20 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) if (advance && !suppress) { switch (inttype) { case DO_SHORT: - { - short *valuep = va_arg(ap, short *); - *valuep = (short) value; - } - break; + { + short *valuep = va_arg(ap, short *); + *valuep = (short)value; + } break; case DO_INT: - { - int *valuep = va_arg(ap, int *); - *valuep = (int) value; - } - break; + { + int *valuep = va_arg(ap, int *); + *valuep = (int)value; + } break; case DO_LONG: - { - long *valuep = va_arg(ap, long *); - *valuep = value; - } - break; + { + long *valuep = va_arg(ap, long *); + *valuep = value; + } break; case DO_LONGLONG: case DO_SIZE_T: /* Handled above */ @@ -1367,34 +1332,34 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) done = SDL_TRUE; break; case 'p': - { - uintptr_t value = 0; - advance = SDL_ScanUintPtrT(text, 16, &value); - text += advance; - if (advance && !suppress) { - void **valuep = va_arg(ap, void **); - *valuep = (void *) value; - ++retval; - } + { + uintptr_t value = 0; + advance = SDL_ScanUintPtrT(text, 16, &value); + text += advance; + if (advance && !suppress) { + void **valuep = va_arg(ap, void **); + *valuep = (void *)value; + ++retval; } + } done = SDL_TRUE; break; case 'f': - { - double value = 0.0; - advance = SDL_ScanFloat(text, &value); - text += advance; - if (advance && !suppress) { - float *valuep = va_arg(ap, float *); - *valuep = (float) value; - ++retval; - } + { + double value = 0.0; + advance = SDL_ScanFloat(text, &value); + text += advance; + if (advance && !suppress) { + float *valuep = va_arg(ap, float *); + *valuep = (float)value; + ++retval; } + } done = SDL_TRUE; break; case 's': if (suppress) { - while (!SDL_isspace((unsigned char) *text)) { + while (!SDL_isspace((unsigned char)*text)) { ++text; if (count) { if (--count == 0) { @@ -1404,7 +1369,7 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) } } else { char *valuep = va_arg(ap, char *); - while (!SDL_isspace((unsigned char) *text)) { + while (!SDL_isspace((unsigned char)*text)) { *valuep++ = *text++; if (count) { if (--count == 0) { @@ -1417,6 +1382,74 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) } done = SDL_TRUE; break; + case 'n': + switch (inttype) { + case DO_SHORT: + { + short *valuep = va_arg(ap, short *); + *valuep = (short)(text - start); + } break; + case DO_INT: + { + int *valuep = va_arg(ap, int *); + *valuep = (int)(text - start); + } break; + case DO_LONG: + { + long *valuep = va_arg(ap, long *); + *valuep = (long)(text - start); + } break; + case DO_LONGLONG: + { + long long *valuep = va_arg(ap, long long *); + *valuep = (long long)(text - start); + } break; + case DO_SIZE_T: + { + size_t *valuep = va_arg(ap, size_t *); + *valuep = (size_t)(text - start); + } break; + } + done = SDL_TRUE; + break; + case '[': + { + const char *set = fmt + 1; + while (*fmt && *fmt != ']') { + ++fmt; + } + if (*fmt) { + size_t set_len = (fmt - set); + if (suppress) { + while (CharacterMatchesSet(*text, set, set_len)) { + ++text; + if (count) { + if (--count == 0) { + break; + } + } + } + } else { + SDL_bool had_match = SDL_FALSE; + char *valuep = va_arg(ap, char *); + while (CharacterMatchesSet(*text, set, set_len)) { + had_match = SDL_TRUE; + *valuep++ = *text++; + if (count) { + if (--count == 0) { + break; + } + } + } + *valuep = '\0'; + if (had_match) { + ++retval; + } + } + } + } + done = SDL_TRUE; + break; default: done = SDL_TRUE; break; @@ -1438,8 +1471,7 @@ SDL_vsscanf(const char *text, const char *fmt, va_list ap) } #endif /* HAVE_VSSCANF */ -int -SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +int SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; int retval; @@ -1456,10 +1488,16 @@ SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_ int SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap) { int retval; - if (!fmt) fmt = ""; + if (!fmt) { + fmt = ""; + } retval = _vsnprintf(text, maxlen, fmt, ap); - if (maxlen > 0) text[maxlen-1] = '\0'; - if (retval < 0) retval = (int) maxlen; + if (maxlen > 0) { + text[maxlen - 1] = '\0'; + } + if (retval < 0) { + retval = (int)maxlen; + } return retval; } #elif defined(HAVE_VSNPRINTF) @@ -1471,9 +1509,9 @@ int SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *f return vsnprintf(text, maxlen, fmt, ap); } #else -#define TEXT_AND_LEN_ARGS (length < maxlen) ? &text[length] : NULL, (length < maxlen) ? (maxlen - length) : 0 +#define TEXT_AND_LEN_ARGS (length < maxlen) ? &text[length] : NULL, (length < maxlen) ? (maxlen - length) : 0 - /* FIXME: implement more of the format specifiers */ +/* FIXME: implement more of the format specifiers */ typedef enum { SDL_CASE_NOCHANGE, @@ -1483,9 +1521,9 @@ typedef enum typedef struct { - SDL_bool left_justify; /* for now: ignored. */ + SDL_bool left_justify; SDL_bool force_sign; - SDL_bool force_type; /* for now: used only by float printer, ignored otherwise. */ + SDL_bool force_type; /* for now: used only by float printer, ignored otherwise. */ SDL_bool pad_zeroes; SDL_letter_case force_case; int width; @@ -1493,35 +1531,43 @@ typedef struct int precision; } SDL_FormatInfo; -static size_t -SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string) +static size_t SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *string) { + const char fill = (info && info->pad_zeroes) ? '0' : ' '; + size_t width = 0; + size_t filllen = 0; size_t length = 0; size_t slen, sz; - if (string == NULL) { + if (!string) { string = "(null)"; } sz = SDL_strlen(string); if (info && info->width > 0 && (size_t)info->width > sz) { - const char fill = info->pad_zeroes ? '0' : ' '; - size_t width = info->width - sz; - size_t filllen; - - if (info->precision >= 0 && (size_t)info->precision < sz) + width = info->width - sz; + if (info->precision >= 0 && (size_t)info->precision < sz) { width += sz - (size_t)info->precision; + } filllen = SDL_min(width, maxlen); - SDL_memset(text, fill, filllen); - text += filllen; - maxlen -= filllen; - length += width; + if (!info->left_justify) { + SDL_memset(text, fill, filllen); + text += filllen; + maxlen -= filllen; + length += width; + filllen = 0; + } } SDL_strlcpy(text, string, maxlen); length += sz; + if (filllen > 0) { + SDL_memset(text + sz, fill, filllen); + length += width; + } + if (info) { if (info->precision >= 0 && (size_t)info->precision < sz) { slen = (size_t)info->precision; @@ -1541,13 +1587,26 @@ SDL_PrintString(char *text, size_t maxlen, SDL_FormatInfo *info, const char *str return length; } -static void -SDL_IntPrecisionAdjust(char *num, size_t maxlen, SDL_FormatInfo *info) -{/* left-pad num with zeroes. */ +static size_t SDL_PrintStringW(char *text, size_t maxlen, SDL_FormatInfo *info, const wchar_t *wide_string) +{ + size_t length = 0; + if (wide_string) { + char *string = SDL_iconv_string("UTF-8", "WCHAR_T", (char *)(wide_string), (SDL_wcslen(wide_string) + 1) * sizeof(*wide_string)); + length = SDL_PrintString(TEXT_AND_LEN_ARGS, info, string); + SDL_free(string); + } else { + length = SDL_PrintString(TEXT_AND_LEN_ARGS, info, NULL); + } + return length; +} + +static void SDL_IntPrecisionAdjust(char *num, size_t maxlen, SDL_FormatInfo *info) +{ /* left-pad num with zeroes. */ size_t sz, pad, have_sign; - if (!info) + if (!info) { return; + } have_sign = 0; if (*num == '-' || *num == '+') { @@ -1563,12 +1622,12 @@ SDL_IntPrecisionAdjust(char *num, size_t maxlen, SDL_FormatInfo *info) SDL_memset(num, '0', pad); } } - info->precision = -1;/* so that SDL_PrintString() doesn't make a mess. */ + info->precision = -1; /* so that SDL_PrintString() doesn't make a mess. */ if (info->pad_zeroes && info->width > 0 && (size_t)info->width > sz + have_sign) { - /* handle here: spaces are added before the sign - but zeroes must be placed _after_ the sign. */ - /* sz hasn't changed: we ignore pad_zeroes if a precision is given. */ + /* handle here: spaces are added before the sign + but zeroes must be placed _after_ the sign. */ + /* sz hasn't changed: we ignore pad_zeroes if a precision is given. */ pad = (size_t)info->width - sz - have_sign; if (pad + sz + 1 <= maxlen) { SDL_memmove(num + pad, num, sz + 1); @@ -1578,8 +1637,7 @@ SDL_IntPrecisionAdjust(char *num, size_t maxlen, SDL_FormatInfo *info) } } -static size_t -SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) +static size_t SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) { char num[130], *p = num; @@ -1592,8 +1650,7 @@ SDL_PrintLong(char *text, size_t maxlen, SDL_FormatInfo *info, long value) return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value) +static size_t SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned long value) { char num[130]; @@ -1602,8 +1659,7 @@ SDL_PrintUnsignedLong(char *text, size_t maxlen, SDL_FormatInfo *info, unsigned return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) +static size_t SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) { char num[130], *p = num; @@ -1616,8 +1672,7 @@ SDL_PrintLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Sint64 value) return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value) +static size_t SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint64 value) { char num[130]; @@ -1626,8 +1681,7 @@ SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint6 return SDL_PrintString(text, maxlen, info, num); } -static size_t -SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) +static size_t SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) { size_t length = 0; @@ -1646,7 +1700,7 @@ SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) } ++length; } - value = (unsigned long) arg; + value = (unsigned long)arg; length += SDL_PrintUnsignedLong(TEXT_AND_LEN_ARGS, NULL, value); arg -= value; if (info->precision < 0) { @@ -1659,9 +1713,9 @@ SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) } ++length; while (info->precision-- > 0) { - value = (unsigned long) (arg * mult); + value = (unsigned long)(arg * mult); length += SDL_PrintUnsignedLong(TEXT_AND_LEN_ARGS, NULL, value); - arg -= (double) value / mult; + arg -= (double)value / mult; mult *= 10; } } @@ -1681,8 +1735,22 @@ SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg) return length; } -int -SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap) +static size_t SDL_PrintPointer(char *text, size_t maxlen, SDL_FormatInfo *info, const void *value) +{ + char num[130]; + size_t length; + + if (!value) { + return SDL_PrintString(text, maxlen, info, NULL); + } + + SDL_ulltoa((unsigned long long)(uintptr_t)value, num, 16); + length = SDL_PrintString(text, maxlen, info, "0x"); + return length + SDL_PrintString(TEXT_AND_LEN_ARGS, info, num); +} + +/* NOLINTNEXTLINE(readability-non-const-parameter) */ +int SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap) { size_t length = 0; @@ -1733,8 +1801,7 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, if (*fmt >= '0' && *fmt <= '9') { info.width = SDL_strtol(fmt, (char **)&fmt, 0); - } - else if (*fmt == '*') { + } else if (*fmt == '*') { ++fmt; info.width = va_arg(ap, int); } @@ -1766,7 +1833,7 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, case 'c': /* char is promoted to int when passed through (...) */ if (length < maxlen) { - text[length] = (char) va_arg(ap, int); + text[length] = (char)va_arg(ap, int); } ++length; done = SDL_TRUE; @@ -1796,15 +1863,15 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, switch (inttype) { case DO_INT: length += SDL_PrintLong(TEXT_AND_LEN_ARGS, &info, - (long) va_arg(ap, int)); + (long)va_arg(ap, int)); break; case DO_LONG: length += SDL_PrintLong(TEXT_AND_LEN_ARGS, &info, - va_arg(ap, long)); + va_arg(ap, long)); break; case DO_LONGLONG: length += SDL_PrintLongLong(TEXT_AND_LEN_ARGS, &info, - va_arg(ap, Sint64)); + va_arg(ap, Sint64)); break; case DO_SIZE_T: length += SDL_PrintLongLong(TEXT_AND_LEN_ARGS, &info, @@ -1814,6 +1881,10 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, done = SDL_TRUE; break; case 'p': + info.force_case = SDL_CASE_LOWER; + length += SDL_PrintPointer(TEXT_AND_LEN_ARGS, &info, va_arg(ap, void *)); + done = SDL_TRUE; + break; case 'x': info.force_case = SDL_CASE_LOWER; SDL_FALLTHROUGH; @@ -1824,9 +1895,6 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, if (info.radix == 10) { info.radix = 16; } - if (*fmt == 'p') { - inttype = DO_LONG; - } SDL_FALLTHROUGH; case 'o': if (info.radix == 10) { @@ -1841,16 +1909,16 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, switch (inttype) { case DO_INT: length += SDL_PrintUnsignedLong(TEXT_AND_LEN_ARGS, &info, - (unsigned long) - va_arg(ap, unsigned int)); + (unsigned long) + va_arg(ap, unsigned int)); break; case DO_LONG: length += SDL_PrintUnsignedLong(TEXT_AND_LEN_ARGS, &info, - va_arg(ap, unsigned long)); + va_arg(ap, unsigned long)); break; case DO_LONGLONG: length += SDL_PrintUnsignedLongLong(TEXT_AND_LEN_ARGS, &info, - va_arg(ap, Uint64)); + va_arg(ap, Uint64)); break; case DO_SIZE_T: length += SDL_PrintUnsignedLongLong(TEXT_AND_LEN_ARGS, &info, @@ -1864,24 +1932,17 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, done = SDL_TRUE; break; case 'S': - { - /* In practice this is used on Windows for WCHAR strings */ - wchar_t *wide_arg = va_arg(ap, wchar_t *); - if (wide_arg) { - char *arg = SDL_iconv_string("UTF-8", "UTF-16LE", (char *)(wide_arg), (SDL_wcslen(wide_arg)+1)*sizeof(*wide_arg)); - info.pad_zeroes = SDL_FALSE; - length += SDL_PrintString(TEXT_AND_LEN_ARGS, &info, arg); - SDL_free(arg); - } else { - info.pad_zeroes = SDL_FALSE; - length += SDL_PrintString(TEXT_AND_LEN_ARGS, &info, NULL); - } - done = SDL_TRUE; - } + info.pad_zeroes = SDL_FALSE; + length += SDL_PrintStringW(TEXT_AND_LEN_ARGS, &info, va_arg(ap, wchar_t *)); + done = SDL_TRUE; break; case 's': info.pad_zeroes = SDL_FALSE; - length += SDL_PrintString(TEXT_AND_LEN_ARGS, &info, va_arg(ap, char *)); + if (inttype > DO_INT) { + length += SDL_PrintStringW(TEXT_AND_LEN_ARGS, &info, va_arg(ap, wchar_t *)); + } else { + length += SDL_PrintString(TEXT_AND_LEN_ARGS, &info, va_arg(ap, char *)); + } done = SDL_TRUE; break; default: @@ -1904,14 +1965,12 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, text[maxlen - 1] = '\0'; } return (int)length; - } #undef TEXT_AND_LEN_ARGS #endif /* HAVE_VSNPRINTF */ -int -SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) +int SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { va_list ap; int retval; @@ -1923,19 +1982,19 @@ SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) return retval; } -int -SDL_vasprintf(char **strp, const char *fmt, va_list ap) +int SDL_vasprintf(char **strp, const char *fmt, va_list ap) { int retval; - int size = 100; /* Guess we need no more than 100 bytes */ + int size = 100; /* Guess we need no more than 100 bytes */ char *p, *np; va_list aq; *strp = NULL; p = (char *)SDL_malloc(size); - if (p == NULL) + if (!p) { return -1; + } while (1) { /* Try to print in the allocated space */ @@ -1944,8 +2003,10 @@ SDL_vasprintf(char **strp, const char *fmt, va_list ap) va_end(aq); /* Check error code */ - if (retval < 0) + if (retval < 0) { + SDL_free(p); return retval; + } /* If that worked, return the string */ if (retval < size) { @@ -1954,10 +2015,10 @@ SDL_vasprintf(char **strp, const char *fmt, va_list ap) } /* Else try again with more space */ - size = retval + 1; /* Precisely what is needed */ + size = retval + 1; /* Precisely what is needed */ np = (char *)SDL_realloc(p, size); - if (np == NULL) { + if (!np) { SDL_free(p); return -1; } else { @@ -1965,5 +2026,3 @@ SDL_vasprintf(char **strp, const char *fmt, va_list ap) } } } - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/stdlib/SDL_strtokr.c b/src/stdlib/SDL_strtokr.c index 4b624d3fd543f..7d8cd0d7f6261 100644 --- a/src/stdlib/SDL_strtokr.c +++ b/src/stdlib/SDL_strtokr.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/stdlib/SDL_vacopy.h b/src/stdlib/SDL_vacopy.h index ab60046951bb8..d8ae331aba307 100644 --- a/src/stdlib/SDL_vacopy.h +++ b/src/stdlib/SDL_vacopy.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,15 +22,15 @@ /* Do our best to make sure va_copy is working */ #if defined(__NGAGE__) #undef va_copy -#define va_copy(dst, src) dst = src +#define va_copy(dst, src) dst = src #elif defined(_MSC_VER) && _MSC_VER <= 1800 /* Visual Studio 2013 tries to link with _vacopy in the C runtime. Newer versions do an inline assignment */ #undef va_copy -#define va_copy(dst, src) dst = src +#define va_copy(dst, src) dst = src #elif defined(__GNUC__) && (__GNUC__ < 3) -#define va_copy(dst, src) __va_copy(dst, src) +#define va_copy(dst, src) __va_copy(dst, src) #endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_assert.c b/src/test/SDL_test_assert.c index 148564ec13495..0082e374cce98 100644 --- a/src/test/SDL_test_assert.c +++ b/src/test/SDL_test_assert.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -52,7 +52,7 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as /* Print assert description into a buffer */ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); va_start(list, assertDescription); - SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); va_end(list); /* Log, then assert and break on failure */ @@ -70,17 +70,14 @@ int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char /* Print assert description into a buffer */ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); va_start(list, assertDescription); - SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); va_end(list); /* Log pass or fail message */ - if (assertCondition == ASSERT_FAIL) - { + if (assertCondition == ASSERT_FAIL) { SDLTest_AssertsFailed++; SDLTest_LogError(SDLTEST_ASSERT_CHECK_FORMAT, logMessage, "Failed"); - } - else - { + } else { SDLTest_AssertsPassed++; SDLTest_Log(SDLTEST_ASSERT_CHECK_FORMAT, logMessage, "Passed"); } @@ -99,10 +96,10 @@ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, /* Print assert description into a buffer */ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); va_start(list, assertDescription); - SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); + (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, assertDescription, list); va_end(list); - /* Log pass message */ + /* Log pass message */ SDLTest_AssertsPassed++; SDLTest_Log(SDLTEST_ASSERT_CHECK_FORMAT, logMessage, "Passed"); } @@ -110,7 +107,7 @@ void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, /* * Resets the assert summary counters to zero. */ -void SDLTest_ResetAssertSummary() +void SDLTest_ResetAssertSummary(void) { SDLTest_AssertsPassed = 0; SDLTest_AssertsFailed = 0; @@ -120,15 +117,12 @@ void SDLTest_ResetAssertSummary() * Logs summary of all assertions (total, pass, fail) since last reset * as INFO (failed==0) or ERROR (failed > 0). */ -void SDLTest_LogAssertSummary() +void SDLTest_LogAssertSummary(void) { int totalAsserts = SDLTest_AssertsPassed + SDLTest_AssertsFailed; - if (SDLTest_AssertsFailed == 0) - { + if (SDLTest_AssertsFailed == 0) { SDLTest_Log(SDLTEST_ASSERT_SUMMARY_FORMAT, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed); - } - else - { + } else { SDLTest_LogError(SDLTEST_ASSERT_SUMMARY_FORMAT, totalAsserts, SDLTest_AssertsPassed, SDLTest_AssertsFailed); } } @@ -136,7 +130,7 @@ void SDLTest_LogAssertSummary() /* * Converts the current assert state into a test result */ -int SDLTest_AssertSummaryToTestResult() +int SDLTest_AssertSummaryToTestResult(void) { if (SDLTest_AssertsFailed > 0) { return TEST_RESULT_FAILED; diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 1dc97937ae2d4..8181ce33db638 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -46,7 +46,7 @@ static const char *audio_usage[] = { "[--channels N]", "[--samples N]" }; -static void SDL_snprintfcat(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) +static void SDL_snprintfcat(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { size_t length = SDL_strlen(text); va_list ap; @@ -54,12 +54,11 @@ static void SDL_snprintfcat(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL va_start(ap, fmt); text += length; maxlen -= length; - SDL_vsnprintf(text, maxlen, fmt, ap); + (void)SDL_vsnprintf(text, maxlen, fmt, ap); va_end(ap); } -SDLTest_CommonState * -SDLTest_CommonCreateState(char **argv, Uint32 flags) +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags) { int i; SDLTest_CommonState *state; @@ -116,8 +115,16 @@ SDLTest_CommonCreateState(char **argv, Uint32 flags) return state; } -int -SDLTest_CommonArg(SDLTest_CommonState * state, int index) +#define SEARCHARG(dim) \ + while (*dim && *dim != ',') { \ + ++dim; \ + } \ + if (!*dim) { \ + return -1; \ + } \ + *dim++ = '\0'; + +int SDLTest_CommonArg(SDLTest_CommonState *state, int index) { char **argv = state->argv; @@ -127,6 +134,7 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) return -1; } state->videodriver = argv[index]; + SDL_SetHint(SDL_HINT_VIDEODRIVER, state->videodriver); return 2; } if (SDL_strcasecmp(argv[index], "--renderer") == 0) { @@ -253,7 +261,7 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) } if (SDL_strcasecmp(argv[index], "--windows") == 0) { ++index; - if (!argv[index] || !SDL_isdigit((unsigned char) *argv[index])) { + if (!argv[index] || !SDL_isdigit((unsigned char)*argv[index])) { return -1; } if (!(state->window_flags & SDL_WINDOW_FULLSCREEN)) { @@ -309,20 +317,11 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) } x = argv[index]; y = argv[index]; - #define SEARCHARG(dim) \ - while (*dim && *dim != ',') { \ - ++dim; \ - } \ - if (!*dim) { \ - return -1; \ - } \ - *dim++ = '\0'; SEARCHARG(y) w = y; SEARCHARG(w) h = w; SEARCHARG(h) - #undef SEARCHARG state->confine.x = SDL_atoi(x); state->confine.y = SDL_atoi(y); state->confine.w = SDL_atoi(w); @@ -538,7 +537,7 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) if (!argv[index]) { return -1; } - state->audiospec.channels = (Uint8) SDL_atoi(argv[index]); + state->audiospec.channels = (Uint8)SDL_atoi(argv[index]); return 2; } if (SDL_strcasecmp(argv[index], "--samples") == 0) { @@ -546,27 +545,25 @@ SDLTest_CommonArg(SDLTest_CommonState * state, int index) if (!argv[index]) { return -1; } - state->audiospec.samples = (Uint16) SDL_atoi(argv[index]); + state->audiospec.samples = (Uint16)SDL_atoi(argv[index]); return 2; } if (SDL_strcasecmp(argv[index], "--trackmem") == 0) { /* Already handled in SDLTest_CommonCreateState() */ return 1; } - if ((SDL_strcasecmp(argv[index], "-h") == 0) - || (SDL_strcasecmp(argv[index], "--help") == 0)) { + if ((SDL_strcasecmp(argv[index], "-h") == 0) || (SDL_strcasecmp(argv[index], "--help") == 0)) { /* Print the usage message */ return -1; } if (SDL_strcmp(argv[index], "-NSDocumentRevisionsDebugMode") == 0) { - /* Debug flag sent by Xcode */ + /* Debug flag sent by Xcode */ return 2; } return 0; } -void -SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options) +void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const char **options) { int i; @@ -592,8 +589,7 @@ SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const cha } } -static const char * -BuildCommonUsageString(char **pstr, const char **strlist, const int numitems, const char **strlist2, const int numitems2) +static const char *BuildCommonUsageString(char **pstr, const char **strlist, const int numitems, const char **strlist2, const int numitems2) { char *str = *pstr; if (!str) { @@ -607,19 +603,19 @@ BuildCommonUsageString(char **pstr, const char **strlist, const int numitems, co len += SDL_strlen(strlist2[i]) + 1; } } - str = (char *) SDL_calloc(1, len); + str = (char *)SDL_calloc(1, len); if (!str) { - return ""; /* oh well. */ + return ""; /* oh well. */ } SDL_strlcat(str, "[--trackmem] ", len); - for (i = 0; i < numitems-1; i++) { + for (i = 0; i < numitems - 1; i++) { SDL_strlcat(str, strlist[i], len); SDL_strlcat(str, " ", len); } SDL_strlcat(str, strlist[i], len); if (strlist2) { SDL_strlcat(str, " ", len); - for (i = 0; i < numitems2-1; i++) { + for (i = 0; i < numitems2 - 1; i++) { SDL_strlcat(str, strlist2[i], len); SDL_strlcat(str, " ", len); } @@ -634,25 +630,22 @@ static char *common_usage_video = NULL; static char *common_usage_audio = NULL; static char *common_usage_videoaudio = NULL; -const char * -SDLTest_CommonUsage(SDLTest_CommonState * state) +const char *SDLTest_CommonUsage(SDLTest_CommonState *state) { switch (state->flags & (SDL_INIT_VIDEO | SDL_INIT_AUDIO)) { - case SDL_INIT_VIDEO: - return BuildCommonUsageString(&common_usage_video, video_usage, SDL_arraysize(video_usage), NULL, 0); - case SDL_INIT_AUDIO: - return BuildCommonUsageString(&common_usage_audio, audio_usage, SDL_arraysize(audio_usage), NULL, 0); - case (SDL_INIT_VIDEO | SDL_INIT_AUDIO): - return BuildCommonUsageString(&common_usage_videoaudio, video_usage, SDL_arraysize(video_usage), audio_usage, SDL_arraysize(audio_usage)); - default: - return "[--trackmem]"; + case SDL_INIT_VIDEO: + return BuildCommonUsageString(&common_usage_video, video_usage, SDL_arraysize(video_usage), NULL, 0); + case SDL_INIT_AUDIO: + return BuildCommonUsageString(&common_usage_audio, audio_usage, SDL_arraysize(audio_usage), NULL, 0); + case (SDL_INIT_VIDEO | SDL_INIT_AUDIO): + return BuildCommonUsageString(&common_usage_videoaudio, video_usage, SDL_arraysize(video_usage), audio_usage, SDL_arraysize(audio_usage)); + default: + return "[--trackmem]"; } } - -SDL_bool -SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) +SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv) { int i = 1; while (i < argc) { @@ -666,8 +659,7 @@ SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **arg return SDL_TRUE; } -static void -SDLTest_PrintDisplayOrientation(char* text, size_t maxlen, SDL_DisplayOrientation orientation) +static void SDLTest_PrintDisplayOrientation(char *text, size_t maxlen, SDL_DisplayOrientation orientation) { switch (orientation) { case SDL_ORIENTATION_UNKNOWN: @@ -691,8 +683,7 @@ SDLTest_PrintDisplayOrientation(char* text, size_t maxlen, SDL_DisplayOrientatio } } -static void -SDLTest_PrintWindowFlag(char* text, size_t maxlen, Uint32 flag) +static void SDLTest_PrintWindowFlag(char *text, size_t maxlen, Uint32 flag) { switch (flag) { case SDL_WINDOW_FULLSCREEN: @@ -770,8 +761,7 @@ SDLTest_PrintWindowFlag(char* text, size_t maxlen, Uint32 flag) } } -static void -SDLTest_PrintWindowFlags(char* text, size_t maxlen, Uint32 flags) +static void SDLTest_PrintWindowFlags(char *text, size_t maxlen, Uint32 flags) { const Uint32 window_flags[] = { SDL_WINDOW_FULLSCREEN, @@ -813,8 +803,83 @@ SDLTest_PrintWindowFlags(char* text, size_t maxlen, Uint32 flags) } } -static void -SDLTest_PrintButtonMask(char* text, size_t maxlen, Uint32 flags) +static void SDLTest_PrintModStateFlag(char *text, size_t maxlen, SDL_Keymod flag) +{ + switch (flag) { + case KMOD_LSHIFT: + SDL_snprintfcat(text, maxlen, "LSHIFT"); + break; + case KMOD_RSHIFT: + SDL_snprintfcat(text, maxlen, "RSHIFT"); + break; + case KMOD_LCTRL: + SDL_snprintfcat(text, maxlen, "LCTRL"); + break; + case KMOD_RCTRL: + SDL_snprintfcat(text, maxlen, "RCTRL"); + break; + case KMOD_LALT: + SDL_snprintfcat(text, maxlen, "LALT"); + break; + case KMOD_RALT: + SDL_snprintfcat(text, maxlen, "RALT"); + break; + case KMOD_LGUI: + SDL_snprintfcat(text, maxlen, "LGUI"); + break; + case KMOD_RGUI: + SDL_snprintfcat(text, maxlen, "RGUI"); + break; + case KMOD_NUM: + SDL_snprintfcat(text, maxlen, "NUM"); + break; + case KMOD_CAPS: + SDL_snprintfcat(text, maxlen, "CAPS"); + break; + case KMOD_MODE: + SDL_snprintfcat(text, maxlen, "MODE"); + break; + case KMOD_SCROLL: + SDL_snprintfcat(text, maxlen, "SCROLL"); + break; + default: + SDL_snprintfcat(text, maxlen, "0x%8.8x", (unsigned int) flag); + break; + } +} + +static void SDLTest_PrintModState(char *text, size_t maxlen, SDL_Keymod keymod) +{ + const SDL_Keymod kmod_flags[] = { + KMOD_LSHIFT, + KMOD_RSHIFT, + KMOD_LCTRL, + KMOD_RCTRL, + KMOD_LALT, + KMOD_RALT, + KMOD_LGUI, + KMOD_RGUI, + KMOD_NUM, + KMOD_CAPS, + KMOD_MODE, + KMOD_SCROLL + }; + + int i; + int count = 0; + for (i = 0; i < SDL_arraysize(kmod_flags); ++i) { + const SDL_Keymod flag = kmod_flags[i]; + if ((keymod & flag) == flag) { + if (count > 0) { + SDL_snprintfcat(text, maxlen, " | "); + } + SDLTest_PrintModStateFlag(text, maxlen, flag); + ++count; + } + } +} + +static void SDLTest_PrintButtonMask(char *text, size_t maxlen, Uint32 flags) { int i; int count = 0; @@ -830,8 +895,7 @@ SDLTest_PrintButtonMask(char* text, size_t maxlen, Uint32 flags) } } -static void -SDLTest_PrintRendererFlag(char *text, size_t maxlen, Uint32 flag) +static void SDLTest_PrintRendererFlag(char *text, size_t maxlen, Uint32 flag) { switch (flag) { case SDL_RENDERER_SOFTWARE: @@ -852,8 +916,7 @@ SDLTest_PrintRendererFlag(char *text, size_t maxlen, Uint32 flag) } } -static void -SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format) +static void SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format) { switch (format) { case SDL_PIXELFORMAT_UNKNOWN: @@ -865,6 +928,12 @@ SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format) case SDL_PIXELFORMAT_INDEX1MSB: SDL_snprintfcat(text, maxlen, "Index1MSB"); break; + case SDL_PIXELFORMAT_INDEX2LSB: + SDL_snprintfcat(text, maxlen, "Index2LSB"); + break; + case SDL_PIXELFORMAT_INDEX2MSB: + SDL_snprintfcat(text, maxlen, "Index2MSB"); + break; case SDL_PIXELFORMAT_INDEX4LSB: SDL_snprintfcat(text, maxlen, "Index4LSB"); break; @@ -961,18 +1030,17 @@ SDLTest_PrintPixelFormat(char *text, size_t maxlen, Uint32 format) } } -static void -SDLTest_PrintRenderer(SDL_RendererInfo * info) +static void SDLTest_PrintRenderer(SDL_RendererInfo *info) { int i, count; char text[1024]; SDL_Log(" Renderer %s:\n", info->name); - SDL_snprintf(text, sizeof(text), " Flags: 0x%8.8" SDL_PRIX32, info->flags); + (void)SDL_snprintf(text, sizeof(text), " Flags: 0x%8.8" SDL_PRIX32, info->flags); SDL_snprintfcat(text, sizeof(text), " ("); count = 0; - for (i = 0; i < sizeof(info->flags) * 8; ++i) { + for (i = 0; i < 8 * sizeof(info->flags); ++i) { Uint32 flag = (1 << i); if (info->flags & flag) { if (count > 0) { @@ -985,8 +1053,8 @@ SDLTest_PrintRenderer(SDL_RendererInfo * info) SDL_snprintfcat(text, sizeof(text), ")"); SDL_Log("%s\n", text); - SDL_snprintf(text, sizeof(text), " Texture formats (%" SDL_PRIu32 "): ", info->num_texture_formats); - for (i = 0; i < (int) info->num_texture_formats; ++i) { + (void)SDL_snprintf(text, sizeof(text), " Texture formats (%" SDL_PRIu32 "): ", info->num_texture_formats); + for (i = 0; i < (int)info->num_texture_formats; ++i) { if (i > 0) { SDL_snprintfcat(text, sizeof(text), ", "); } @@ -1000,28 +1068,26 @@ SDLTest_PrintRenderer(SDL_RendererInfo * info) } } -static SDL_Surface * -SDLTest_LoadIcon(const char *file) +static SDL_Surface *SDLTest_LoadIcon(const char *file) { SDL_Surface *icon; /* Load the icon surface */ icon = SDL_LoadBMP(file); - if (icon == NULL) { + if (!icon) { SDL_Log("Couldn't load %s: %s\n", file, SDL_GetError()); - return (NULL); + return NULL; } if (icon->format->palette) { /* Set the colorkey */ - SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels)); + SDL_SetColorKey(icon, 1, *((Uint8 *)icon->pixels)); } - return (icon); + return icon; } -static SDL_HitTestResult SDLCALL -SDLTest_ExampleHitTestCallback(SDL_Window *win, const SDL_Point *area, void *data) +static SDL_HitTestResult SDLCALL SDLTest_ExampleHitTestCallback(SDL_Window *win, const SDL_Point *area, void *data) { int w, h; const int RESIZE_BORDER = 8; @@ -1035,25 +1101,25 @@ SDLTest_ExampleHitTestCallback(SDL_Window *win, const SDL_Point *area, void *dat if (area->y < RESIZE_BORDER) { SDL_Log("SDL_HITTEST_RESIZE_TOPLEFT\n"); return SDL_HITTEST_RESIZE_TOPLEFT; - } else if (area->y >= (h-RESIZE_BORDER)) { + } else if (area->y >= (h - RESIZE_BORDER)) { SDL_Log("SDL_HITTEST_RESIZE_BOTTOMLEFT\n"); return SDL_HITTEST_RESIZE_BOTTOMLEFT; } else { SDL_Log("SDL_HITTEST_RESIZE_LEFT\n"); return SDL_HITTEST_RESIZE_LEFT; } - } else if (area->x >= (w-RESIZE_BORDER)) { + } else if (area->x >= (w - RESIZE_BORDER)) { if (area->y < RESIZE_BORDER) { SDL_Log("SDL_HITTEST_RESIZE_TOPRIGHT\n"); return SDL_HITTEST_RESIZE_TOPRIGHT; - } else if (area->y >= (h-RESIZE_BORDER)) { + } else if (area->y >= (h - RESIZE_BORDER)) { SDL_Log("SDL_HITTEST_RESIZE_BOTTOMRIGHT\n"); return SDL_HITTEST_RESIZE_BOTTOMRIGHT; } else { SDL_Log("SDL_HITTEST_RESIZE_RIGHT\n"); return SDL_HITTEST_RESIZE_RIGHT; } - } else if (area->y >= (h-RESIZE_BORDER)) { + } else if (area->y >= (h - RESIZE_BORDER)) { SDL_Log("SDL_HITTEST_RESIZE_BOTTOM\n"); return SDL_HITTEST_RESIZE_BOTTOM; } else if (area->y < RESIZE_BORDER) { @@ -1066,8 +1132,7 @@ SDLTest_ExampleHitTestCallback(SDL_Window *win, const SDL_Point *area, void *dat return SDL_HITTEST_NORMAL; } -SDL_bool -SDLTest_CommonInit(SDLTest_CommonState * state) +SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) { int i, j, m, n, w, h; SDL_DisplayMode fullscreen_mode; @@ -1079,7 +1144,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state) if (n == 0) { SDL_Log("No built-in video drivers\n"); } else { - SDL_snprintf(text, sizeof(text), "Built-in video drivers:"); + (void)SDL_snprintf(text, sizeof(text), "Built-in video drivers:"); for (i = 0; i < n; ++i) { if (i > 0) { SDL_snprintfcat(text, sizeof(text), ","); @@ -1138,7 +1203,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state) SDL_DisplayMode mode; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS int adapterIndex = 0; int outputIndex = 0; #endif @@ -1169,8 +1234,9 @@ SDLTest_CommonInit(SDLTest_CommonState * state) SDL_Log(" Red Mask = 0x%.8" SDL_PRIx32 "\n", Rmask); SDL_Log(" Green Mask = 0x%.8" SDL_PRIx32 "\n", Gmask); SDL_Log(" Blue Mask = 0x%.8" SDL_PRIx32 "\n", Bmask); - if (Amask) + if (Amask) { SDL_Log(" Alpha Mask = 0x%.8" SDL_PRIx32 "\n", Amask); + } } /* Print available fullscreen video modes */ @@ -1193,16 +1259,16 @@ SDLTest_CommonInit(SDLTest_CommonState * state) Gmask); SDL_Log(" Blue Mask = 0x%.8" SDL_PRIx32 "\n", Bmask); - if (Amask) - SDL_Log(" Alpha Mask = 0x%.8" SDL_PRIx32 "\n", - Amask); + if (Amask) { + SDL_Log(" Alpha Mask = 0x%.8" SDL_PRIx32 "\n", Amask); + } } } } -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* Print the D3D9 adapter index */ - adapterIndex = SDL_Direct3D9GetAdapterIndex( i ); + adapterIndex = SDL_Direct3D9GetAdapterIndex(i); SDL_Log("D3D9 Adapter Index: %d", adapterIndex); /* Print the DXGI adapter and output indices */ @@ -1248,14 +1314,14 @@ SDLTest_CommonInit(SDLTest_CommonState * state) fullscreen_mode.refresh_rate = state->refresh_rate; state->windows = - (SDL_Window **) SDL_calloc(state->num_windows, - sizeof(*state->windows)); + (SDL_Window **)SDL_calloc(state->num_windows, + sizeof(*state->windows)); state->renderers = - (SDL_Renderer **) SDL_calloc(state->num_windows, + (SDL_Renderer **)SDL_calloc(state->num_windows, sizeof(*state->renderers)); state->targets = - (SDL_Texture **) SDL_calloc(state->num_windows, - sizeof(*state->targets)); + (SDL_Texture **)SDL_calloc(state->num_windows, + sizeof(*state->targets)); if (!state->windows || !state->renderers) { SDL_Log("Out of memory!\n"); return SDL_FALSE; @@ -1275,8 +1341,8 @@ SDLTest_CommonInit(SDLTest_CommonState * state) } if (state->num_windows > 1) { - SDL_snprintf(title, SDL_arraysize(title), "%s %d", - state->window_title, i + 1); + (void)SDL_snprintf(title, SDL_arraysize(title), "%s %d", + state->window_title, i + 1); } else { SDL_strlcpy(title, state->window_title, SDL_arraysize(title)); } @@ -1300,6 +1366,8 @@ SDLTest_CommonInit(SDLTest_CommonState * state) state->window_w = w; state->window_h = h; } + fullscreen_mode.w = state->window_w; + fullscreen_mode.h = state->window_h; if (SDL_SetWindowDisplayMode(state->windows[i], &fullscreen_mode) < 0) { SDL_Log("Can't set up fullscreen display mode: %s\n", SDL_GetError()); @@ -1307,8 +1375,8 @@ SDLTest_CommonInit(SDLTest_CommonState * state) } /* Add resize/drag areas for windows that are borderless and resizable */ - if ((state->window_flags & (SDL_WINDOW_RESIZABLE|SDL_WINDOW_BORDERLESS)) == - (SDL_WINDOW_RESIZABLE|SDL_WINDOW_BORDERLESS)) { + if ((state->window_flags & (SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS)) == + (SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS)) { SDL_SetWindowHitTest(state->windows[i], SDLTest_ExampleHitTestCallback, NULL); } @@ -1326,9 +1394,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state) SDL_SetWindowMouseRect(state->windows[i], &state->confine); } - if (!state->skip_renderer - && (state->renderdriver - || !(state->window_flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)))) { + if (!state->skip_renderer && (state->renderdriver || !(state->window_flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_VULKAN | SDL_WINDOW_METAL)))) { m = -1; if (state->renderdriver) { SDL_RendererInfo info; @@ -1347,7 +1413,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state) } } state->renderers[i] = SDL_CreateRenderer(state->windows[i], - m, state->render_flags); + m, state->render_flags); if (!state->renderers[i]) { SDL_Log("Couldn't create renderer: %s\n", SDL_GetError()); @@ -1375,7 +1441,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state) if (n == 0) { SDL_Log("No built-in audio drivers\n"); } else { - SDL_snprintf(text, sizeof(text), "Built-in audio drivers:"); + (void)SDL_snprintf(text, sizeof(text), "Built-in audio drivers:"); for (i = 0; i < n; ++i) { if (i > 0) { SDL_snprintfcat(text, sizeof(text), ","); @@ -1404,28 +1470,29 @@ SDLTest_CommonInit(SDLTest_CommonState * state) return SDL_TRUE; } -static const char * -DisplayOrientationName(int orientation) +static const char *DisplayOrientationName(int orientation) { - switch (orientation) - { -#define CASE(X) case SDL_ORIENTATION_##X: return #X + switch (orientation) { +#define CASE(X) \ + case SDL_ORIENTATION_##X: \ + return #X CASE(UNKNOWN); CASE(LANDSCAPE); CASE(LANDSCAPE_FLIPPED); CASE(PORTRAIT); CASE(PORTRAIT_FLIPPED); #undef CASE -default: return "???"; + default: + return "???"; } } -static const char * -ControllerAxisName(const SDL_GameControllerAxis axis) +static const char *ControllerAxisName(const SDL_GameControllerAxis axis) { - switch (axis) - { -#define AXIS_CASE(ax) case SDL_CONTROLLER_AXIS_##ax: return #ax + switch (axis) { +#define AXIS_CASE(ax) \ + case SDL_CONTROLLER_AXIS_##ax: \ + return #ax AXIS_CASE(INVALID); AXIS_CASE(LEFTX); AXIS_CASE(LEFTY); @@ -1434,16 +1501,17 @@ ControllerAxisName(const SDL_GameControllerAxis axis) AXIS_CASE(TRIGGERLEFT); AXIS_CASE(TRIGGERRIGHT); #undef AXIS_CASE -default: return "???"; + default: + return "???"; } } -static const char * -ControllerButtonName(const SDL_GameControllerButton button) +static const char *ControllerButtonName(const SDL_GameControllerButton button) { - switch (button) - { -#define BUTTON_CASE(btn) case SDL_CONTROLLER_BUTTON_##btn: return #btn + switch (button) { +#define BUTTON_CASE(btn) \ + case SDL_CONTROLLER_BUTTON_##btn: \ + return #btn BUTTON_CASE(INVALID); BUTTON_CASE(A); BUTTON_CASE(B); @@ -1461,12 +1529,12 @@ ControllerButtonName(const SDL_GameControllerButton button) BUTTON_CASE(DPAD_LEFT); BUTTON_CASE(DPAD_RIGHT); #undef BUTTON_CASE -default: return "???"; + default: + return "???"; } } -static void -SDLTest_PrintEvent(SDL_Event * event) +static void SDLTest_PrintEvent(SDL_Event *event) { switch (event->type) { case SDL_DISPLAYEVENT: @@ -1475,6 +1543,10 @@ SDLTest_PrintEvent(SDL_Event * event) SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " connected", event->display.display); break; + case SDL_DISPLAYEVENT_MOVED: + SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed position", + event->display.display); + break; case SDL_DISPLAYEVENT_ORIENTATION: SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed orientation to %s", event->display.display, DisplayOrientationName(event->display.data1)); @@ -1522,11 +1594,10 @@ SDLTest_PrintEvent(SDL_Event * event) SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " restored", event->window.windowID); break; case SDL_WINDOWEVENT_ENTER: - SDL_Log("SDL EVENT: Mouse entered window %" SDL_PRIu32 "", - event->window.windowID); + SDL_Log("SDL EVENT: Mouse entered window %" SDL_PRIu32, event->window.windowID); break; case SDL_WINDOWEVENT_LEAVE: - SDL_Log("SDL EVENT: Mouse left window %" SDL_PRIu32 "", event->window.windowID); + SDL_Log("SDL EVENT: Mouse left window %" SDL_PRIu32, event->window.windowID); break; case SDL_WINDOWEVENT_FOCUS_GAINED: SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " gained keyboard focus", @@ -1545,6 +1616,12 @@ SDLTest_PrintEvent(SDL_Event * event) case SDL_WINDOWEVENT_HIT_TEST: SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " hit test", event->window.windowID); break; + case SDL_WINDOWEVENT_ICCPROF_CHANGED: + SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " ICC profile changed", event->window.windowID); + break; + case SDL_WINDOWEVENT_DISPLAY_CHANGED: + SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " display changed to %" SDL_PRIs32, event->window.windowID, event->window.data1); + break; default: SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " got unknown event 0x%4.4x", event->window.windowID, event->window.event); @@ -1552,19 +1629,23 @@ SDLTest_PrintEvent(SDL_Event * event) } break; case SDL_KEYDOWN: - SDL_Log("SDL EVENT: Keyboard: key pressed in window %" SDL_PRIu32 ": scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s", - event->key.windowID, - event->key.keysym.scancode, - SDL_GetScancodeName(event->key.keysym.scancode), - event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); - break; - case SDL_KEYUP: - SDL_Log("SDL EVENT: Keyboard: key released in window %" SDL_PRIu32 ": scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s", + case SDL_KEYUP: { + char modstr[64]; + if (event->key.keysym.mod) { + modstr[0] = '\0'; + SDLTest_PrintModState(modstr, sizeof (modstr), event->key.keysym.mod); + } else { + SDL_strlcpy(modstr, "NONE", sizeof (modstr)); + } + SDL_Log("SDL EVENT: Keyboard: key %s in window %" SDL_PRIu32 ": scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s, mods = %s", + (event->type == SDL_KEYDOWN) ? "pressed" : "released", event->key.windowID, event->key.keysym.scancode, SDL_GetScancodeName(event->key.keysym.scancode), - event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym)); + event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym), + modstr); break; + } case SDL_TEXTEDITING: SDL_Log("SDL EVENT: Keyboard: text editing \"%s\" in window %" SDL_PRIu32, event->edit.text, event->edit.windowID); @@ -1598,11 +1679,11 @@ SDLTest_PrintEvent(SDL_Event * event) break; case SDL_JOYDEVICEADDED: SDL_Log("SDL EVENT: Joystick index %" SDL_PRIs32 " attached", - event->jdevice.which); + event->jdevice.which); break; case SDL_JOYDEVICEREMOVED: SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 " removed", - event->jdevice.which); + event->jdevice.which); break; case SDL_JOYBALLMOTION: SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 ": ball %d moved by %d,%d", @@ -1610,41 +1691,40 @@ SDLTest_PrintEvent(SDL_Event * event) event->jball.yrel); break; case SDL_JOYHATMOTION: - { - const char *position = "UNKNOWN"; - switch (event->jhat.value) { - case SDL_HAT_CENTERED: - position = "CENTER"; - break; - case SDL_HAT_UP: - position = "UP"; - break; - case SDL_HAT_RIGHTUP: - position = "RIGHTUP"; - break; - case SDL_HAT_RIGHT: - position = "RIGHT"; - break; - case SDL_HAT_RIGHTDOWN: - position = "RIGHTDOWN"; - break; - case SDL_HAT_DOWN: - position = "DOWN"; - break; - case SDL_HAT_LEFTDOWN: - position = "LEFTDOWN"; - break; - case SDL_HAT_LEFT: - position = "LEFT"; - break; - case SDL_HAT_LEFTUP: - position = "LEFTUP"; - break; - } - SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 ": hat %d moved to %s", - event->jhat.which, event->jhat.hat, position); + { + const char *position = "UNKNOWN"; + switch (event->jhat.value) { + case SDL_HAT_CENTERED: + position = "CENTER"; + break; + case SDL_HAT_UP: + position = "UP"; + break; + case SDL_HAT_RIGHTUP: + position = "RIGHTUP"; + break; + case SDL_HAT_RIGHT: + position = "RIGHT"; + break; + case SDL_HAT_RIGHTDOWN: + position = "RIGHTDOWN"; + break; + case SDL_HAT_DOWN: + position = "DOWN"; + break; + case SDL_HAT_LEFTDOWN: + position = "LEFTDOWN"; + break; + case SDL_HAT_LEFT: + position = "LEFT"; + break; + case SDL_HAT_LEFTUP: + position = "LEFTUP"; + break; } - break; + SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 ": hat %d moved to %s", + event->jhat.which, event->jhat.hat, position); + } break; case SDL_JOYBUTTONDOWN: SDL_Log("SDL EVENT: Joystick %" SDL_PRIs32 ": button %d pressed", event->jbutton.which, event->jbutton.button); @@ -1655,28 +1735,28 @@ SDLTest_PrintEvent(SDL_Event * event) break; case SDL_CONTROLLERDEVICEADDED: SDL_Log("SDL EVENT: Controller index %" SDL_PRIs32 " attached", - event->cdevice.which); + event->cdevice.which); break; case SDL_CONTROLLERDEVICEREMOVED: SDL_Log("SDL EVENT: Controller %" SDL_PRIs32 " removed", - event->cdevice.which); + event->cdevice.which); break; case SDL_CONTROLLERAXISMOTION: SDL_Log("SDL EVENT: Controller %" SDL_PRIs32 " axis %d ('%s') value: %d", - event->caxis.which, - event->caxis.axis, - ControllerAxisName((SDL_GameControllerAxis)event->caxis.axis), - event->caxis.value); + event->caxis.which, + event->caxis.axis, + ControllerAxisName((SDL_GameControllerAxis)event->caxis.axis), + event->caxis.value); break; case SDL_CONTROLLERBUTTONDOWN: SDL_Log("SDL EVENT: Controller %" SDL_PRIs32 "button %d ('%s') down", - event->cbutton.which, event->cbutton.button, - ControllerButtonName((SDL_GameControllerButton)event->cbutton.button)); + event->cbutton.which, event->cbutton.button, + ControllerButtonName((SDL_GameControllerButton)event->cbutton.button)); break; case SDL_CONTROLLERBUTTONUP: SDL_Log("SDL EVENT: Controller %" SDL_PRIs32 " button %d ('%s') up", - event->cbutton.which, event->cbutton.button, - ControllerButtonName((SDL_GameControllerButton)event->cbutton.button)); + event->cbutton.which, event->cbutton.button, + ControllerButtonName((SDL_GameControllerButton)event->cbutton.button)); break; case SDL_CLIPBOARDUPDATE: SDL_Log("SDL EVENT: Clipboard updated"); @@ -1684,8 +1764,8 @@ SDLTest_PrintEvent(SDL_Event * event) case SDL_FINGERMOTION: SDL_Log("SDL EVENT: Finger: motion touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f", - (long) event->tfinger.touchId, - (long) event->tfinger.fingerId, + (long)event->tfinger.touchId, + (long)event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure); break; @@ -1693,16 +1773,16 @@ SDLTest_PrintEvent(SDL_Event * event) case SDL_FINGERUP: SDL_Log("SDL EVENT: Finger: %s touch=%ld, finger=%ld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f", (event->type == SDL_FINGERDOWN) ? "down" : "up", - (long) event->tfinger.touchId, - (long) event->tfinger.fingerId, + (long)event->tfinger.touchId, + (long)event->tfinger.fingerId, event->tfinger.x, event->tfinger.y, event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure); break; case SDL_DOLLARGESTURE: - SDL_Log("SDL_EVENT: Dollar gesture detect: %ld", (long) event->dgesture.gestureId); + SDL_Log("SDL_EVENT: Dollar gesture detect: %ld", (long)event->dgesture.gestureId); break; case SDL_DOLLARRECORD: - SDL_Log("SDL_EVENT: Dollar gesture record: %ld", (long) event->dgesture.gestureId); + SDL_Log("SDL_EVENT: Dollar gesture record: %ld", (long)event->dgesture.gestureId); break; case SDL_MULTIGESTURE: SDL_Log("SDL_EVENT: Multi gesture fingers: %d", event->mgesture.numFingers); @@ -1757,8 +1837,7 @@ SDLTest_PrintEvent(SDL_Event * event) } } -static void -SDLTest_ScreenShot(SDL_Renderer *renderer) +static void SDLTest_ScreenShot(SDL_Renderer *renderer) { SDL_Rect viewport; SDL_Surface *surface; @@ -1770,11 +1849,11 @@ SDLTest_ScreenShot(SDL_Renderer *renderer) SDL_RenderGetViewport(renderer, &viewport); surface = SDL_CreateRGBSurface(0, viewport.w, viewport.h, 24, #if SDL_BYTEORDER == SDL_LIL_ENDIAN - 0x00FF0000, 0x0000FF00, 0x000000FF, + 0x00FF0000, 0x0000FF00, 0x000000FF, #else - 0x000000FF, 0x0000FF00, 0x00FF0000, + 0x000000FF, 0x0000FF00, 0x00FF0000, #endif - 0x00000000); + 0x00000000); if (!surface) { SDL_Log("Couldn't create surface: %s\n", SDL_GetError()); return; @@ -1794,8 +1873,7 @@ SDLTest_ScreenShot(SDL_Renderer *renderer) } } -static void -FullscreenTo(int index, int windowId) +static void FullscreenTo(int index, int windowId) { Uint32 flags; struct SDL_Rect rect = { 0, 0, 0, 0 }; @@ -1804,20 +1882,19 @@ FullscreenTo(int index, int windowId) return; } - SDL_GetDisplayBounds( index, &rect ); + SDL_GetDisplayBounds(index, &rect); flags = SDL_GetWindowFlags(window); if (flags & SDL_WINDOW_FULLSCREEN) { - SDL_SetWindowFullscreen( window, 0); - SDL_Delay( 15 ); + SDL_SetWindowFullscreen(window, 0); + SDL_Delay(15); } - SDL_SetWindowPosition( window, rect.x, rect.y ); - SDL_SetWindowFullscreen( window, SDL_WINDOW_FULLSCREEN ); + SDL_SetWindowPosition(window, rect.x, rect.y); + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN); } -void -SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) +void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done) { int i; static SDL_MouseMotionEvent lastEvent; @@ -1834,27 +1911,26 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) case SDL_WINDOWEVENT: switch (event->window.event) { case SDL_WINDOWEVENT_CLOSE: - { - SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); - if (window) { - for (i = 0; i < state->num_windows; ++i) { - if (window == state->windows[i]) { - if (state->targets[i]) { - SDL_DestroyTexture(state->targets[i]); - state->targets[i] = NULL; - } - if (state->renderers[i]) { - SDL_DestroyRenderer(state->renderers[i]); - state->renderers[i] = NULL; - } - SDL_DestroyWindow(state->windows[i]); - state->windows[i] = NULL; - break; + { + SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); + if (window) { + for (i = 0; i < state->num_windows; ++i) { + if (window == state->windows[i]) { + if (state->targets[i]) { + SDL_DestroyTexture(state->targets[i]); + state->targets[i] = NULL; + } + if (state->renderers[i]) { + SDL_DestroyRenderer(state->renderers[i]); + state->renderers[i] = NULL; } + SDL_DestroyWindow(state->windows[i]); + state->windows[i] = NULL; + break; } } } - break; + } break; case SDL_WINDOWEVENT_FOCUS_LOST: if (state->flash_on_focus_loss) { SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); @@ -1867,24 +1943,25 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) break; } break; - case SDL_KEYDOWN: { + case SDL_KEYDOWN: + { SDL_bool withControl = !!(event->key.keysym.mod & KMOD_CTRL); SDL_bool withShift = !!(event->key.keysym.mod & KMOD_SHIFT); SDL_bool withAlt = !!(event->key.keysym.mod & KMOD_ALT); switch (event->key.keysym.sym) { /* Add hotkeys here */ - case SDLK_PRINTSCREEN: { - SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); - if (window) { - for (i = 0; i < state->num_windows; ++i) { - if (window == state->windows[i]) { - SDLTest_ScreenShot(state->renderers[i]); - } + case SDLK_PRINTSCREEN: + { + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); + if (window) { + for (i = 0; i < state->num_windows; ++i) { + if (window == state->windows[i]) { + SDLTest_ScreenShot(state->renderers[i]); } } } - break; + } break; case SDLK_EQUALS: if (withControl) { /* Ctrl-+ double the size of the window */ @@ -1892,7 +1969,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) if (window) { int w, h; SDL_GetWindowSize(window, &w, &h); - SDL_SetWindowSize(window, w*2, h*2); + SDL_SetWindowSize(window, w * 2, h * 2); } } break; @@ -1903,7 +1980,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) if (window) { int w, h; SDL_GetWindowSize(window, &w, &h); - SDL_SetWindowSize(window, w/2, h/2); + SDL_SetWindowSize(window, w / 2, h / 2); } } break; @@ -1927,8 +2004,8 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) } SDL_Log("Centering on display %d\n", dest); SDL_SetWindowPosition(window, - SDL_WINDOWPOS_CENTERED_DISPLAY(dest), - SDL_WINDOWPOS_CENTERED_DISPLAY(dest)); + SDL_WINDOWPOS_CENTERED_DISPLAY(dest), + SDL_WINDOWPOS_CENTERED_DISPLAY(dest)); } } } @@ -1940,10 +2017,18 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) int x, y; SDL_GetWindowPosition(window, &x, &y); - if (event->key.keysym.sym == SDLK_UP) y -= delta; - if (event->key.keysym.sym == SDLK_DOWN) y += delta; - if (event->key.keysym.sym == SDLK_LEFT) x -= delta; - if (event->key.keysym.sym == SDLK_RIGHT) x += delta; + if (event->key.keysym.sym == SDLK_UP) { + y -= delta; + } + if (event->key.keysym.sym == SDLK_DOWN) { + y += delta; + } + if (event->key.keysym.sym == SDLK_LEFT) { + x -= delta; + } + if (event->key.keysym.sym == SDLK_RIGHT) { + x += delta; + } SDL_Log("Setting position to (%d, %d)\n", x, y); SDL_SetWindowPosition(window, x, y); @@ -1983,10 +2068,10 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) SDL_GetWindowSize(state->windows[i], &w, &h); SDL_RenderGetClipRect(state->renderers[i], &clip); if (SDL_RectEmpty(&clip)) { - clip.x = w/4; - clip.y = h/4; - clip.w = w/2; - clip.h = h/2; + clip.x = w / 4; + clip.y = h / 4; + clip.w = w / 2; + clip.h = h / 2; SDL_RenderSetClipRect(state->renderers[i], &clip); } else { SDL_RenderSetClipRect(state->renderers[i], NULL); @@ -2036,7 +2121,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) case SDLK_k: if (withControl) { /* Ctrl-K toggle keyboard grab */ - SDL_Window* window = SDL_GetWindowFromID(event->key.windowID); + SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { SDL_SetWindowKeyboardGrab(window, !SDL_GetWindowKeyboardGrab(window) ? SDL_TRUE : SDL_FALSE); } @@ -2128,7 +2213,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { const Uint32 flags = SDL_GetWindowFlags(window); - const SDL_bool b = ((flags & SDL_WINDOW_BORDERLESS) != 0) ? SDL_TRUE : SDL_FALSE; + const SDL_bool b = (flags & SDL_WINDOW_BORDERLESS) ? SDL_TRUE : SDL_FALSE; SDL_SetWindowBordered(window, b); } } @@ -2170,8 +2255,8 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) char message[256]; SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); - SDL_snprintf(message, sizeof(message), "(%" SDL_PRIs32 ", %" SDL_PRIs32 "), rel (%" SDL_PRIs32 ", %" SDL_PRIs32 ")\n", - lastEvent.x, lastEvent.y, lastEvent.xrel, lastEvent.yrel); + (void)SDL_snprintf(message, sizeof(message), "(%" SDL_PRIs32 ", %" SDL_PRIs32 "), rel (%" SDL_PRIs32 ", %" SDL_PRIs32 ")\n", + lastEvent.x, lastEvent.y, lastEvent.xrel, lastEvent.yrel); SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Last mouse position", message, window); break; } @@ -2194,8 +2279,7 @@ SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done) } } -void -SDLTest_CommonQuit(SDLTest_CommonState * state) +void SDLTest_CommonQuit(SDLTest_CommonState *state) { int i; @@ -2234,8 +2318,7 @@ SDLTest_CommonQuit(SDLTest_CommonState * state) SDLTest_LogAllocations(); } -void -SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * usedHeight) +void SDLTest_CommonDrawWindowInfo(SDL_Renderer *renderer, SDL_Window *window, int *usedHeight) { char text[1024]; int textY = 0; @@ -2257,7 +2340,7 @@ SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); - SDL_snprintf(text, sizeof(text), "SDL_GetCurrentVideoDriver: %s", SDL_GetCurrentVideoDriver()); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetCurrentVideoDriver: %s", SDL_GetCurrentVideoDriver()); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; @@ -2270,31 +2353,31 @@ SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); if (0 == SDL_GetRendererInfo(renderer, &info)) { - SDL_snprintf(text, sizeof(text), "SDL_GetRendererInfo: name: %s", info.name); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetRendererInfo: name: %s", info.name); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } if (0 == SDL_GetRendererOutputSize(renderer, &w, &h)) { - SDL_snprintf(text, sizeof(text), "SDL_GetRendererOutputSize: %dx%d", w, h); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetRendererOutputSize: %dx%d", w, h); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } SDL_RenderGetViewport(renderer, &rect); - SDL_snprintf(text, sizeof(text), "SDL_RenderGetViewport: %d,%d, %dx%d", - rect.x, rect.y, rect.w, rect.h); + (void)SDL_snprintf(text, sizeof(text), "SDL_RenderGetViewport: %d,%d, %dx%d", + rect.x, rect.y, rect.w, rect.h); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; SDL_RenderGetScale(renderer, &scaleX, &scaleY); - SDL_snprintf(text, sizeof(text), "SDL_RenderGetScale: %f,%f", - scaleX, scaleY); + (void)SDL_snprintf(text, sizeof(text), "SDL_RenderGetScale: %f,%f", + scaleX, scaleY); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; SDL_RenderGetLogicalSize(renderer, &w, &h); - SDL_snprintf(text, sizeof(text), "SDL_RenderGetLogicalSize: %dx%d", w, h); + (void)SDL_snprintf(text, sizeof(text), "SDL_RenderGetLogicalSize: %dx%d", w, h); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; @@ -2307,23 +2390,23 @@ SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); SDL_GetWindowPosition(window, &x, &y); - SDL_snprintf(text, sizeof(text), "SDL_GetWindowPosition: %d,%d", x, y); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetWindowPosition: %d,%d", x, y); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; SDL_GetWindowSize(window, &w, &h); - SDL_snprintf(text, sizeof(text), "SDL_GetWindowSize: %dx%d", w, h); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetWindowSize: %dx%d", w, h); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; - SDL_snprintf(text, sizeof(text), "SDL_GetWindowFlags: "); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetWindowFlags: "); SDLTest_PrintWindowFlags(text, sizeof(text), SDL_GetWindowFlags(window)); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; if (0 == SDL_GetWindowDisplayMode(window, &mode)) { - SDL_snprintf(text, sizeof(text), "SDL_GetWindowDisplayMode: %dx%d@%dHz (%s)", - mode.w, mode.h, mode.refresh_rate, SDL_GetPixelFormatName(mode.format)); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetWindowDisplayMode: %dx%d@%dHz (%s)", + mode.w, mode.h, mode.refresh_rate, SDL_GetPixelFormatName(mode.format)); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } @@ -2336,43 +2419,43 @@ SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); - SDL_snprintf(text, sizeof(text), "SDL_GetWindowDisplayIndex: %d", windowDisplayIndex); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetWindowDisplayIndex: %d", windowDisplayIndex); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; - SDL_snprintf(text, sizeof(text), "SDL_GetDisplayName: %s", SDL_GetDisplayName(windowDisplayIndex)); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayName: %s", SDL_GetDisplayName(windowDisplayIndex)); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; if (0 == SDL_GetDisplayBounds(windowDisplayIndex, &rect)) { - SDL_snprintf(text, sizeof(text), "SDL_GetDisplayBounds: %d,%d, %dx%d", - rect.x, rect.y, rect.w, rect.h); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayBounds: %d,%d, %dx%d", + rect.x, rect.y, rect.w, rect.h); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } if (0 == SDL_GetCurrentDisplayMode(windowDisplayIndex, &mode)) { - SDL_snprintf(text, sizeof(text), "SDL_GetCurrentDisplayMode: %dx%d@%d", - mode.w, mode.h, mode.refresh_rate); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetCurrentDisplayMode: %dx%d@%d", + mode.w, mode.h, mode.refresh_rate); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } if (0 == SDL_GetDesktopDisplayMode(windowDisplayIndex, &mode)) { - SDL_snprintf(text, sizeof(text), "SDL_GetDesktopDisplayMode: %dx%d@%d", - mode.w, mode.h, mode.refresh_rate); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetDesktopDisplayMode: %dx%d@%d", + mode.w, mode.h, mode.refresh_rate); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } if (0 == SDL_GetDisplayDPI(windowDisplayIndex, &ddpi, &hdpi, &vdpi)) { - SDL_snprintf(text, sizeof(text), "SDL_GetDisplayDPI: ddpi: %f, hdpi: %f, vdpi: %f", - ddpi, hdpi, vdpi); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayDPI: ddpi: %f, hdpi: %f, vdpi: %f", + ddpi, hdpi, vdpi); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; } - SDL_snprintf(text, sizeof(text), "SDL_GetDisplayOrientation: "); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetDisplayOrientation: "); SDLTest_PrintDisplayOrientation(text, sizeof(text), SDL_GetDisplayOrientation(windowDisplayIndex)); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; @@ -2386,17 +2469,30 @@ SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); flags = SDL_GetMouseState(&x, &y); - SDL_snprintf(text, sizeof(text), "SDL_GetMouseState: %d,%d ", x, y); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetMouseState: %d,%d ", x, y); SDLTest_PrintButtonMask(text, sizeof(text), flags); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; flags = SDL_GetGlobalMouseState(&x, &y); - SDL_snprintf(text, sizeof(text), "SDL_GetGlobalMouseState: %d,%d ", x, y); + (void)SDL_snprintf(text, sizeof(text), "SDL_GetGlobalMouseState: %d,%d ", x, y); SDLTest_PrintButtonMask(text, sizeof(text), flags); SDLTest_DrawString(renderer, 0, textY, text); textY += lineHeight; + /* Keyboard */ + + SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); + SDLTest_DrawString(renderer, 0, textY, "-- Keyboard --"); + textY += lineHeight; + + SDL_SetRenderDrawColor(renderer, 170, 170, 170, 255); + + (void)SDL_snprintf(text, sizeof(text), "SDL_GetModState: "); + SDLTest_PrintModState(text, sizeof(text), SDL_GetModState()); + SDLTest_DrawString(renderer, 0, textY, text); + textY += lineHeight; + if (usedHeight) { *usedHeight = textY; } diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c index 157bd2ff8d3d2..de3e94c9e8f59 100644 --- a/src/test/SDL_test_compare.c +++ b/src/test/SDL_test_compare.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,87 +31,110 @@ #include "SDL_test.h" +#define FILENAME_SIZE 128 /* Counter for _CompareSurface calls; used for filename creation when comparisons fail */ static int _CompareSurfaceCount = 0; +static Uint32 +GetPixel(Uint8 *p, size_t bytes_per_pixel) +{ + Uint32 ret = 0; + + SDL_assert(bytes_per_pixel <= sizeof(ret)); + + /* Fill the appropriate number of least-significant bytes of ret, + * leaving the most-significant bytes set to zero, so that ret can + * be decoded with SDL_GetRGBA afterwards. */ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + SDL_memcpy(((Uint8 *) &ret) + (sizeof(ret) - bytes_per_pixel), p, bytes_per_pixel); +#else + SDL_memcpy(&ret, p, bytes_per_pixel); +#endif + + return ret; +} + /* Compare surfaces */ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error) { - int ret; - int i,j; - int bpp, bpp_reference; - Uint8 *p, *p_reference; - int dist; - int sampleErrorX = 0, sampleErrorY = 0, sampleDist = 0; - Uint8 R, G, B, A; - Uint8 Rd, Gd, Bd, Ad; - char imageFilename[128]; - char referenceFilename[128]; - - /* Validate input surfaces */ - if (surface == NULL || referenceSurface == NULL) { - return -1; - } - - /* Make sure surface size is the same. */ - if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h)) { - return -2; - } - - /* Sanitize input value */ - if (allowable_error<0) { - allowable_error = 0; - } - - SDL_LockSurface( surface ); - SDL_LockSurface( referenceSurface ); - - ret = 0; - bpp = surface->format->BytesPerPixel; - bpp_reference = referenceSurface->format->BytesPerPixel; - /* Compare image - should be same format. */ - for (j=0; jh; j++) { - for (i=0; iw; i++) { - p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp; - p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference; - - SDL_GetRGBA(*(Uint32*)p, surface->format, &R, &G, &B, &A); - SDL_GetRGBA(*(Uint32*)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad); - - dist = 0; - dist += (R-Rd)*(R-Rd); - dist += (G-Gd)*(G-Gd); - dist += (B-Bd)*(B-Bd); - - /* Allow some difference in blending accuracy */ - if (dist > allowable_error) { - ret++; - if (ret == 1) { - sampleErrorX = i; - sampleErrorY = j; - sampleDist = dist; + int ret; + int i, j; + int bpp, bpp_reference; + Uint8 *p, *p_reference; + int dist; + int sampleErrorX = 0, sampleErrorY = 0, sampleDist = 0; + Uint8 R, G, B, A; + Uint8 Rd, Gd, Bd, Ad; + char imageFilename[FILENAME_SIZE]; + char referenceFilename[FILENAME_SIZE]; + + /* Validate input surfaces */ + if (!surface || !referenceSurface) { + return -1; + } + + /* Make sure surface size is the same. */ + if ((surface->w != referenceSurface->w) || (surface->h != referenceSurface->h)) { + return -2; + } + + /* Sanitize input value */ + if (allowable_error < 0) { + allowable_error = 0; + } + + SDL_LockSurface(surface); + SDL_LockSurface(referenceSurface); + + ret = 0; + bpp = surface->format->BytesPerPixel; + bpp_reference = referenceSurface->format->BytesPerPixel; + /* Compare image - should be same format. */ + for (j = 0; j < surface->h; j++) { + for (i = 0; i < surface->w; i++) { + Uint32 pixel; + p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp; + p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference; + + pixel = GetPixel(p, bpp); + SDL_GetRGBA(pixel, surface->format, &R, &G, &B, &A); + pixel = GetPixel(p_reference, bpp_reference); + SDL_GetRGBA(pixel, referenceSurface->format, &Rd, &Gd, &Bd, &Ad); + + dist = 0; + dist += (R - Rd) * (R - Rd); + dist += (G - Gd) * (G - Gd); + dist += (B - Bd) * (B - Bd); + + /* Allow some difference in blending accuracy */ + if (dist > allowable_error) { + ret++; + if (ret == 1) { + sampleErrorX = i; + sampleErrorY = j; + sampleDist = dist; + } } - } - } - } - - SDL_UnlockSurface( surface ); - SDL_UnlockSurface( referenceSurface ); - - /* Save test image and reference for analysis on failures */ - _CompareSurfaceCount++; - if (ret != 0) { - SDLTest_LogError("Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret); - SDLTest_LogError("First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist); - SDL_snprintf(imageFilename, 127, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount); - SDL_SaveBMP(surface, imageFilename); - SDL_snprintf(referenceFilename, 127, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount); - SDL_SaveBMP(referenceSurface, referenceFilename); - SDLTest_LogError("Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename); - } - - return ret; + } + } + + SDL_UnlockSurface(surface); + SDL_UnlockSurface(referenceSurface); + + /* Save test image and reference for analysis on failures */ + _CompareSurfaceCount++; + if (ret != 0) { + SDLTest_LogError("Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret); + SDLTest_LogError("First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist); + (void)SDL_snprintf(imageFilename, FILENAME_SIZE - 1, "CompareSurfaces%04d_TestOutput.bmp", _CompareSurfaceCount); + SDL_SaveBMP(surface, imageFilename); + (void)SDL_snprintf(referenceFilename, FILENAME_SIZE - 1, "CompareSurfaces%04d_Reference.bmp", _CompareSurfaceCount); + SDL_SaveBMP(referenceSurface, referenceFilename); + SDLTest_LogError("Surfaces from failed comparison saved as '%s' and '%s'", imageFilename, referenceFilename); + } + + return ret; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_crc32.c b/src/test/SDL_test_crc32.c index cfc5a641cb192..6de871422237e 100644 --- a/src/test/SDL_test_crc32.c +++ b/src/test/SDL_test_crc32.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,137 +30,136 @@ #include "SDL_test.h" - int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext) { - int i,j; - CrcUint32 c; + int i, j; + CrcUint32 c; - /* Sanity check context pointer */ - if (crcContext==NULL) { - return -1; - } + /* Sanity check context pointer */ + if (!crcContext) { + return -1; + } - /* - * Build auxiliary table for parallel byte-at-a-time CRC-32 - */ + /* + * Build auxiliary table for parallel byte-at-a-time CRC-32 + */ #ifdef ORIGINAL_METHOD - for (i = 0; i < 256; ++i) { - for (c = i << 24, j = 8; j > 0; --j) { - c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1); + for (i = 0; i < 256; ++i) { + for (c = i << 24, j = 8; j > 0; --j) { + c = c & 0x80000000 ? (c << 1) ^ CRC32_POLY : (c << 1); + } + crcContext->crc32_table[i] = c; } - crcContext->crc32_table[i] = c; - } #else - for (i=0; i<256; i++) { - c = i; - for (j=8; j>0; j--) { - if (c & 1) { - c = (c >> 1) ^ CRC32_POLY; - } else { - c >>= 1; + for (i = 0; i < 256; i++) { + c = i; + for (j = 8; j > 0; j--) { + if (c & 1) { + c = (c >> 1) ^ CRC32_POLY; + } else { + c >>= 1; + } + } + crcContext->crc32_table[i] = c; } - } - crcContext->crc32_table[i] = c; - } #endif - return 0; + return 0; } /* Complete CRC32 calculation on a memory block */ -int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +int SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) { - if (SDLTest_Crc32CalcStart(crcContext,crc32)) { - return -1; - } + if (SDLTest_Crc32CalcStart(crcContext, crc32)) { + return -1; + } - if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) { - return -1; - } + if (SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) { + return -1; + } - if (SDLTest_Crc32CalcEnd(crcContext, crc32)) { - return -1; - } + if (SDLTest_Crc32CalcEnd(crcContext, crc32)) { + return -1; + } - return 0; + return 0; } /* Start crc calculation */ -int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) { - /* Sanity check pointers */ - if (crcContext==NULL) { - *crc32=0; - return -1; - } - - /* - * Preload shift register, per CRC-32 spec - */ - *crc32 = 0xffffffff; - - return 0; + /* Sanity check pointers */ + if (!crcContext) { + *crc32 = 0; + return -1; + } + + /* + * Preload shift register, per CRC-32 spec + */ + *crc32 = 0xffffffff; + + return 0; } /* Finish crc calculation */ -int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32) +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32) { - /* Sanity check pointers */ - if (crcContext==NULL) { - *crc32=0; - return -1; - } - - /* - * Return complement, per CRC-32 spec - */ - *crc32 = (~(*crc32)); - - return 0; + /* Sanity check pointers */ + if (!crcContext) { + *crc32 = 0; + return -1; + } + + /* + * Return complement, per CRC-32 spec + */ + *crc32 = (~(*crc32)); + + return 0; } /* Include memory block in crc */ -int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32) { - CrcUint8 *p; - register CrcUint32 crc; - - if (crcContext==NULL) { - *crc32=0; - return -1; - } - - if (inBuf==NULL) { - return -1; - } - - /* - * Calculate CRC from data - */ - crc = *crc32; - for (p = inBuf; inLen > 0; ++p, --inLen) { + CrcUint8 *p; + register CrcUint32 crc; + + if (!crcContext) { + *crc32 = 0; + return -1; + } + + if (!inBuf) { + return -1; + } + + /* + * Calculate CRC from data + */ + crc = *crc32; + for (p = inBuf; inLen > 0; ++p, --inLen) { #ifdef ORIGINAL_METHOD - crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p]; + crc = (crc << 8) ^ crcContext->crc32_table[(crc >> 24) ^ *p]; #else - crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[ (crc ^ *p) & 0xFF ]; + crc = ((crc >> 8) & 0x00FFFFFF) ^ crcContext->crc32_table[(crc ^ *p) & 0xFF]; #endif - } - *crc32 = crc; + } + *crc32 = crc; - return 0; + return 0; } -int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext) +int SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext) { - if (crcContext==NULL) { - return -1; - } + if (!crcContext) { + return -1; + } - return 0; + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_font.c b/src/test/SDL_test_font.c index 3bfcf49700c7e..d7267b47f347d 100644 --- a/src/test/SDL_test_font.c +++ b/src/test/SDL_test_font.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,3085 +42,3085 @@ static unsigned char SDLTest_FontData[] = { /* * 0 0x00 '^@' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 1 0x01 '^A' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 2 0x02 '^B' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 3 0x03 '^C' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 4 0x04 '^D' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 5 0x05 '^E' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 6 0x06 '^F' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 7 0x07 '^G' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 8 0x08 '^H' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 9 0x09 '^I' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 10 0x0a '^J' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 11 0x0b '^K' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 12 0x0c '^L' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 13 0x0d '^M' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 14 0x0e '^N' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 15 0x0f '^O' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 16 0x10 '^P' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 17 0x11 '^Q' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 18 0x12 '^R' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 19 0x13 '^S' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 20 0x14 '^T' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 21 0x15 '^U' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 22 0x16 '^V' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 23 0x17 '^W' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 24 0x18 '^X' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 25 0x19 '^Y' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 26 0x1a '^Z' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 27 0x1b '^[' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 28 0x1c '^\' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 29 0x1d '^]' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 30 0x1e '^^' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 31 0x1f '^_' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 32 0x20 ' ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 33 0x21 '!' */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 34 0x22 '"' */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 35 0x23 '#' */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x7f, /* 11111110 */ - 0x36, /* 01101100 */ - 0x7f, /* 11111110 */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x7f, /* 11111110 */ + 0x36, /* 01101100 */ + 0x7f, /* 11111110 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ /* * 36 0x24 '$' */ - 0x0c, /* 00110000 */ - 0x3e, /* 01111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x3e, /* 01111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 37 0x25 '%' */ - 0x00, /* 00000000 */ - 0x63, /* 11000110 */ - 0x33, /* 11001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x66, /* 01100110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x33, /* 11001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x66, /* 01100110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 38 0x26 '&' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x33, /* 11001100 */ - 0x6e, /* 01110110 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x33, /* 11001100 */ + 0x6e, /* 01110110 */ + 0x00, /* 00000000 */ /* * 39 0x27 ''' */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 40 0x28 '(' */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 41 0x29 ')' */ - 0x06, /* 01100000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x00, /* 00000000 */ + 0x06, /* 01100000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x00, /* 00000000 */ /* * 42 0x2a '*' */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0xff, /* 11111111 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0xff, /* 11111111 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 43 0x2b '+' */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x3f, /* 11111100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x3f, /* 11111100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 44 0x2c ',' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ /* * 45 0x2d '-' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 46 0x2e '.' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 47 0x2f '/' */ - 0x60, /* 00000110 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ - 0x01, /* 10000000 */ - 0x00, /* 00000000 */ + 0x60, /* 00000110 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ + 0x01, /* 10000000 */ + 0x00, /* 00000000 */ /* * 48 0x30 '0' */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x73, /* 11001110 */ - 0x7b, /* 11011110 */ - 0x6f, /* 11110110 */ - 0x67, /* 11100110 */ - 0x3e, /* 01111100 */ - 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x73, /* 11001110 */ + 0x7b, /* 11011110 */ + 0x6f, /* 11110110 */ + 0x67, /* 11100110 */ + 0x3e, /* 01111100 */ + 0x00, /* 00000000 */ /* * 49 0x31 '1' */ - 0x0c, /* 00110000 */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 50 0x32 '2' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x30, /* 00001100 */ - 0x1c, /* 00111000 */ - 0x06, /* 01100000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x30, /* 00001100 */ + 0x1c, /* 00111000 */ + 0x06, /* 01100000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 51 0x33 '3' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x30, /* 00001100 */ - 0x1c, /* 00111000 */ - 0x30, /* 00001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x30, /* 00001100 */ + 0x1c, /* 00111000 */ + 0x30, /* 00001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 52 0x34 '4' */ - 0x38, /* 00011100 */ - 0x3c, /* 00111100 */ - 0x36, /* 01101100 */ - 0x33, /* 11001100 */ - 0x7f, /* 11111110 */ - 0x30, /* 00001100 */ - 0x78, /* 00011110 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x3c, /* 00111100 */ + 0x36, /* 01101100 */ + 0x33, /* 11001100 */ + 0x7f, /* 11111110 */ + 0x30, /* 00001100 */ + 0x78, /* 00011110 */ + 0x00, /* 00000000 */ /* * 53 0x35 '5' */ - 0x3f, /* 11111100 */ - 0x03, /* 11000000 */ - 0x1f, /* 11111000 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x03, /* 11000000 */ + 0x1f, /* 11111000 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 54 0x36 '6' */ - 0x1c, /* 00111000 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ - 0x1f, /* 11111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ + 0x1f, /* 11111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 55 0x37 '7' */ - 0x3f, /* 11111100 */ - 0x33, /* 11001100 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x33, /* 11001100 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 56 0x38 '8' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 57 0x39 '9' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0e, /* 01110000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0e, /* 01110000 */ + 0x00, /* 00000000 */ /* * 58 0x3a ':' */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 59 0x3b ';' */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ /* * 60 0x3c '<' */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ - 0x06, /* 01100000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ + 0x06, /* 01100000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 61 0x3d '=' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 62 0x3e '>' */ - 0x06, /* 01100000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x00, /* 00000000 */ + 0x06, /* 01100000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x00, /* 00000000 */ /* * 63 0x3f '?' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 64 0x40 '@' */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x7b, /* 11011110 */ - 0x7b, /* 11011110 */ - 0x7b, /* 11011110 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x7b, /* 11011110 */ + 0x7b, /* 11011110 */ + 0x7b, /* 11011110 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 65 0x41 'A' */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 66 0x42 'B' */ - 0x3f, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 67 0x43 'C' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 68 0x44 'D' */ - 0x1f, /* 11111000 */ - 0x36, /* 01101100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x36, /* 01101100 */ - 0x1f, /* 11111000 */ - 0x00, /* 00000000 */ + 0x1f, /* 11111000 */ + 0x36, /* 01101100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x36, /* 01101100 */ + 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ /* * 69 0x45 'E' */ - 0x7f, /* 11111110 */ - 0x46, /* 01100010 */ - 0x16, /* 01101000 */ - 0x1e, /* 01111000 */ - 0x16, /* 01101000 */ - 0x46, /* 01100010 */ - 0x7f, /* 11111110 */ - 0x00, /* 00000000 */ + 0x7f, /* 11111110 */ + 0x46, /* 01100010 */ + 0x16, /* 01101000 */ + 0x1e, /* 01111000 */ + 0x16, /* 01101000 */ + 0x46, /* 01100010 */ + 0x7f, /* 11111110 */ + 0x00, /* 00000000 */ /* * 70 0x46 'F' */ - 0x7f, /* 11111110 */ - 0x46, /* 01100010 */ - 0x16, /* 01101000 */ - 0x1e, /* 01111000 */ - 0x16, /* 01101000 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ - 0x00, /* 00000000 */ + 0x7f, /* 11111110 */ + 0x46, /* 01100010 */ + 0x16, /* 01101000 */ + 0x1e, /* 01111000 */ + 0x16, /* 01101000 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ + 0x00, /* 00000000 */ /* * 71 0x47 'G' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ - 0x73, /* 11001110 */ - 0x66, /* 01100110 */ - 0x7c, /* 00111110 */ - 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ + 0x73, /* 11001110 */ + 0x66, /* 01100110 */ + 0x7c, /* 00111110 */ + 0x00, /* 00000000 */ /* * 72 0x48 'H' */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 73 0x49 'I' */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 74 0x4a 'J' */ - 0x78, /* 00011110 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x78, /* 00011110 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 75 0x4b 'K' */ - 0x67, /* 11100110 */ - 0x66, /* 01100110 */ - 0x36, /* 01101100 */ - 0x1e, /* 01111000 */ - 0x36, /* 01101100 */ - 0x66, /* 01100110 */ - 0x67, /* 11100110 */ - 0x00, /* 00000000 */ + 0x67, /* 11100110 */ + 0x66, /* 01100110 */ + 0x36, /* 01101100 */ + 0x1e, /* 01111000 */ + 0x36, /* 01101100 */ + 0x66, /* 01100110 */ + 0x67, /* 11100110 */ + 0x00, /* 00000000 */ /* * 76 0x4c 'L' */ - 0x0f, /* 11110000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x46, /* 01100010 */ - 0x66, /* 01100110 */ - 0x7f, /* 11111110 */ - 0x00, /* 00000000 */ + 0x0f, /* 11110000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x46, /* 01100010 */ + 0x66, /* 01100110 */ + 0x7f, /* 11111110 */ + 0x00, /* 00000000 */ /* * 77 0x4d 'M' */ - 0x63, /* 11000110 */ - 0x77, /* 11101110 */ - 0x7f, /* 11111110 */ - 0x7f, /* 11111110 */ - 0x6b, /* 11010110 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x77, /* 11101110 */ + 0x7f, /* 11111110 */ + 0x7f, /* 11111110 */ + 0x6b, /* 11010110 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 78 0x4e 'N' */ - 0x63, /* 11000110 */ - 0x67, /* 11100110 */ - 0x6f, /* 11110110 */ - 0x7b, /* 11011110 */ - 0x73, /* 11001110 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x67, /* 11100110 */ + 0x6f, /* 11110110 */ + 0x7b, /* 11011110 */ + 0x73, /* 11001110 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 79 0x4f 'O' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ /* * 80 0x50 'P' */ - 0x3f, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ + 0x00, /* 00000000 */ /* * 81 0x51 'Q' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3b, /* 11011100 */ - 0x1e, /* 01111000 */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3b, /* 11011100 */ + 0x1e, /* 01111000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ /* * 82 0x52 'R' */ - 0x3f, /* 11111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x36, /* 01101100 */ - 0x66, /* 01100110 */ - 0x67, /* 11100110 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x36, /* 01101100 */ + 0x66, /* 01100110 */ + 0x67, /* 11100110 */ + 0x00, /* 00000000 */ /* * 83 0x53 'S' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x07, /* 11100000 */ - 0x0e, /* 01110000 */ - 0x38, /* 00011100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x07, /* 11100000 */ + 0x0e, /* 01110000 */ + 0x38, /* 00011100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 84 0x54 'T' */ - 0x3f, /* 11111100 */ - 0x2d, /* 10110100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x2d, /* 10110100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 85 0x55 'U' */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 86 0x56 'V' */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 87 0x57 'W' */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x6b, /* 11010110 */ - 0x7f, /* 11111110 */ - 0x77, /* 11101110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x6b, /* 11010110 */ + 0x7f, /* 11111110 */ + 0x77, /* 11101110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 88 0x58 'X' */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 89 0x59 'Y' */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 90 0x5a 'Z' */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x31, /* 10001100 */ - 0x18, /* 00011000 */ - 0x4c, /* 00110010 */ - 0x66, /* 01100110 */ - 0x7f, /* 11111110 */ - 0x00, /* 00000000 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x31, /* 10001100 */ + 0x18, /* 00011000 */ + 0x4c, /* 00110010 */ + 0x66, /* 01100110 */ + 0x7f, /* 11111110 */ + 0x00, /* 00000000 */ /* * 91 0x5b '[' */ - 0x1e, /* 01111000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 92 0x5c '\' */ - 0x03, /* 11000000 */ - 0x06, /* 01100000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x30, /* 00001100 */ - 0x60, /* 00000110 */ - 0x40, /* 00000010 */ - 0x00, /* 00000000 */ + 0x03, /* 11000000 */ + 0x06, /* 01100000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x30, /* 00001100 */ + 0x60, /* 00000110 */ + 0x40, /* 00000010 */ + 0x00, /* 00000000 */ /* * 93 0x5d ']' */ - 0x1e, /* 01111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 94 0x5e '^' */ - 0x08, /* 00010000 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x08, /* 00010000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 95 0x5f '_' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xff, /* 11111111 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xff, /* 11111111 */ /* * 96 0x60 '`' */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 97 0x61 'a' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x6e, /* 01110110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x6e, /* 01110110 */ + 0x00, /* 00000000 */ /* * 98 0x62 'b' */ - 0x07, /* 11100000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x3e, /* 01111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3b, /* 11011100 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x3e, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3b, /* 11011100 */ + 0x00, /* 00000000 */ /* * 99 0x63 'c' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x03, /* 11000000 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x03, /* 11000000 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 100 0x64 'd' */ - 0x38, /* 00011100 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x6e, /* 01110110 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x6e, /* 01110110 */ + 0x00, /* 00000000 */ /* * 101 0x65 'e' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 102 0x66 'f' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ - 0x06, /* 01100000 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ + 0x06, /* 01100000 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ + 0x00, /* 00000000 */ /* * 103 0x67 'g' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x6e, /* 01110110 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ /* * 104 0x68 'h' */ - 0x07, /* 11100000 */ - 0x06, /* 01100000 */ - 0x36, /* 01101100 */ - 0x6e, /* 01110110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x67, /* 11100110 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x06, /* 01100000 */ + 0x36, /* 01101100 */ + 0x6e, /* 01110110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x67, /* 11100110 */ + 0x00, /* 00000000 */ /* * 105 0x69 'i' */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 106 0x6a 'j' */ - 0x30, /* 00001100 */ - 0x00, /* 00000000 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x00, /* 00000000 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ /* * 107 0x6b 'k' */ - 0x07, /* 11100000 */ - 0x06, /* 01100000 */ - 0x66, /* 01100110 */ - 0x36, /* 01101100 */ - 0x1e, /* 01111000 */ - 0x36, /* 01101100 */ - 0x67, /* 11100110 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x06, /* 01100000 */ + 0x66, /* 01100110 */ + 0x36, /* 01101100 */ + 0x1e, /* 01111000 */ + 0x36, /* 01101100 */ + 0x67, /* 11100110 */ + 0x00, /* 00000000 */ /* * 108 0x6c 'l' */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 109 0x6d 'm' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x7f, /* 11111110 */ - 0x7f, /* 11111110 */ - 0x6b, /* 11010110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x7f, /* 11111110 */ + 0x7f, /* 11111110 */ + 0x6b, /* 11010110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 110 0x6e 'n' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1f, /* 11111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 11111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 111 0x6f 'o' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 112 0x70 'p' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3b, /* 11011100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3b, /* 11011100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ /* * 113 0x71 'q' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x6e, /* 01110110 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x78, /* 00011110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x78, /* 00011110 */ /* * 114 0x72 'r' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3b, /* 11011100 */ - 0x6e, /* 01110110 */ - 0x66, /* 01100110 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3b, /* 11011100 */ + 0x6e, /* 01110110 */ + 0x66, /* 01100110 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ + 0x00, /* 00000000 */ /* * 115 0x73 's' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3e, /* 01111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ /* * 116 0x74 't' */ - 0x08, /* 00010000 */ - 0x0c, /* 00110000 */ - 0x3e, /* 01111100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x2c, /* 00110100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x08, /* 00010000 */ + 0x0c, /* 00110000 */ + 0x3e, /* 01111100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x2c, /* 00110100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 117 0x75 'u' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x6e, /* 01110110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x6e, /* 01110110 */ + 0x00, /* 00000000 */ /* * 118 0x76 'v' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ /* * 119 0x77 'w' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x63, /* 11000110 */ - 0x6b, /* 11010110 */ - 0x7f, /* 11111110 */ - 0x7f, /* 11111110 */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x6b, /* 11010110 */ + 0x7f, /* 11111110 */ + 0x7f, /* 11111110 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ /* * 120 0x78 'x' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x63, /* 11000110 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 121 0x79 'y' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ /* * 122 0x7a 'z' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x19, /* 10011000 */ - 0x0c, /* 00110000 */ - 0x26, /* 01100100 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x19, /* 10011000 */ + 0x0c, /* 00110000 */ + 0x26, /* 01100100 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 123 0x7b '{' */ - 0x38, /* 00011100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x07, /* 11100000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x07, /* 11100000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ /* * 124 0x7c '|' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 125 0x7d '}' */ - 0x07, /* 11100000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x38, /* 00011100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x38, /* 00011100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ /* * 126 0x7e '~' */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 127 0x7f '^?' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 128 0x80 '€' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 129 0x81 '' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 130 0x82 '‚' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 131 0x83 'ƒ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 132 0x84 '„' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 133 0x85 ' ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 134 0x86 '†' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 135 0x87 '‡' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 136 0x88 'ˆ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 137 0x89 '‰' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 138 0x8a 'Š' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 139 0x8b '‹' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 140 0x8c 'Œ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 141 0x8d '' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 142 0x8e 'Ž' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 143 0x8f '' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 144 0x90 '' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 145 0x91 '‘' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 146 0x92 '’' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 147 0x93 '“' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 148 0x94 '”' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 149 0x95 '•' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 150 0x96 '–' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 151 0x97 '—' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 152 0x98 '˜' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 153 0x99 '™' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 154 0x9a 'š' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 155 0x9b '›' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 156 0x9c 'œ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 157 0x9d '' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 158 0x9e 'ž' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 159 0x9f 'Ÿ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 160 0xa0 ' ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 161 0xa1 '¡' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 162 0xa2 '¢' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ /* * 163 0xa3 '£' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x26, /* 01100100 */ - 0x0f, /* 11110000 */ - 0x06, /* 01100000 */ - 0x67, /* 11100110 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x26, /* 01100100 */ + 0x0f, /* 11110000 */ + 0x06, /* 01100000 */ + 0x67, /* 11100110 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 164 0xa4 '¤' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x63, /* 11000110 */ - 0x3e, /* 01111100 */ - 0x36, /* 01101100 */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x3e, /* 01111100 */ + 0x36, /* 01101100 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 165 0xa5 '¥' */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x3f, /* 11111100 */ - 0x0c, /* 00110000 */ - 0x3f, /* 11111100 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x3f, /* 11111100 */ + 0x0c, /* 00110000 */ + 0x3f, /* 11111100 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ /* * 166 0xa6 '¦' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 167 0xa7 '§' */ - 0x7c, /* 00111110 */ - 0xc6, /* 01100011 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ + 0x7c, /* 00111110 */ + 0xc6, /* 01100011 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ /* * 168 0xa8 '¨' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 169 0xa9 '©' */ - 0x3c, /* 00111100 */ - 0x42, /* 01000010 */ - 0x99, /* 10011001 */ - 0x85, /* 10100001 */ - 0x85, /* 10100001 */ - 0x99, /* 10011001 */ - 0x42, /* 01000010 */ - 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x42, /* 01000010 */ + 0x99, /* 10011001 */ + 0x85, /* 10100001 */ + 0x85, /* 10100001 */ + 0x99, /* 10011001 */ + 0x42, /* 01000010 */ + 0x3c, /* 00111100 */ /* * 170 0xaa 'ª' */ - 0x3c, /* 00111100 */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x7c, /* 00111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x7c, /* 00111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 171 0xab '«' */ - 0x00, /* 00000000 */ - 0xcc, /* 00110011 */ - 0x66, /* 01100110 */ - 0x33, /* 11001100 */ - 0x66, /* 01100110 */ - 0xcc, /* 00110011 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xcc, /* 00110011 */ + 0x66, /* 01100110 */ + 0x33, /* 11001100 */ + 0x66, /* 01100110 */ + 0xcc, /* 00110011 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 172 0xac '¬' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x30, /* 00001100 */ - 0x30, /* 00001100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x30, /* 00001100 */ + 0x30, /* 00001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 173 0xad '­' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 174 0xae '®' */ - 0x3c, /* 00111100 */ - 0x42, /* 01000010 */ - 0x9d, /* 10111001 */ - 0xa5, /* 10100101 */ - 0x9d, /* 10111001 */ - 0xa5, /* 10100101 */ - 0x42, /* 01000010 */ - 0x3c, /* 00111100 */ + 0x3c, /* 00111100 */ + 0x42, /* 01000010 */ + 0x9d, /* 10111001 */ + 0xa5, /* 10100101 */ + 0x9d, /* 10111001 */ + 0xa5, /* 10100101 */ + 0x42, /* 01000010 */ + 0x3c, /* 00111100 */ /* * 175 0xaf '¯' */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 176 0xb0 '°' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 177 0xb1 '±' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x7e, /* 01111110 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x7e, /* 01111110 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 178 0xb2 '²' */ - 0x1c, /* 00111000 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 179 0xb3 '³' */ - 0x1c, /* 00111000 */ - 0x30, /* 00001100 */ - 0x18, /* 00011000 */ - 0x30, /* 00001100 */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x30, /* 00001100 */ + 0x18, /* 00011000 */ + 0x30, /* 00001100 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 180 0xb4 '´' */ - 0x18, /* 00011000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 181 0xb5 'µ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ /* * 182 0xb6 '¶' */ - 0xfe, /* 01111111 */ - 0xdb, /* 11011011 */ - 0xdb, /* 11011011 */ - 0xde, /* 01111011 */ - 0xd8, /* 00011011 */ - 0xd8, /* 00011011 */ - 0xd8, /* 00011011 */ - 0x00, /* 00000000 */ + 0xfe, /* 01111111 */ + 0xdb, /* 11011011 */ + 0xdb, /* 11011011 */ + 0xde, /* 01111011 */ + 0xd8, /* 00011011 */ + 0xd8, /* 00011011 */ + 0xd8, /* 00011011 */ + 0x00, /* 00000000 */ /* * 183 0xb7 '·' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 184 0xb8 '¸' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x30, /* 00001100 */ - 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x30, /* 00001100 */ + 0x1e, /* 01111000 */ /* * 185 0xb9 '¹' */ - 0x08, /* 00010000 */ - 0x0c, /* 00110000 */ - 0x08, /* 00010000 */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x08, /* 00010000 */ + 0x0c, /* 00110000 */ + 0x08, /* 00010000 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 186 0xba 'º' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 187 0xbb '»' */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x66, /* 01100110 */ - 0xcc, /* 00110011 */ - 0x66, /* 01100110 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x66, /* 01100110 */ + 0xcc, /* 00110011 */ + 0x66, /* 01100110 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 188 0xbc '¼' */ - 0xc3, /* 11000011 */ - 0x63, /* 11000110 */ - 0x33, /* 11001100 */ - 0xbd, /* 10111101 */ - 0xec, /* 00110111 */ - 0xf6, /* 01101111 */ - 0xf3, /* 11001111 */ - 0x03, /* 11000000 */ + 0xc3, /* 11000011 */ + 0x63, /* 11000110 */ + 0x33, /* 11001100 */ + 0xbd, /* 10111101 */ + 0xec, /* 00110111 */ + 0xf6, /* 01101111 */ + 0xf3, /* 11001111 */ + 0x03, /* 11000000 */ /* * 189 0xbd '½' */ - 0xc3, /* 11000011 */ - 0x63, /* 11000110 */ - 0x33, /* 11001100 */ - 0x7b, /* 11011110 */ - 0xcc, /* 00110011 */ - 0x66, /* 01100110 */ - 0x33, /* 11001100 */ - 0xf0, /* 00001111 */ + 0xc3, /* 11000011 */ + 0x63, /* 11000110 */ + 0x33, /* 11001100 */ + 0x7b, /* 11011110 */ + 0xcc, /* 00110011 */ + 0x66, /* 01100110 */ + 0x33, /* 11001100 */ + 0xf0, /* 00001111 */ /* * 190 0xbe '¾' */ - 0x03, /* 11000000 */ - 0xc4, /* 00100011 */ - 0x63, /* 11000110 */ - 0xb4, /* 00101101 */ - 0xdb, /* 11011011 */ - 0xac, /* 00110101 */ - 0xe6, /* 01100111 */ - 0x80, /* 00000001 */ + 0x03, /* 11000000 */ + 0xc4, /* 00100011 */ + 0x63, /* 11000110 */ + 0xb4, /* 00101101 */ + 0xdb, /* 11011011 */ + 0xac, /* 00110101 */ + 0xe6, /* 01100111 */ + 0x80, /* 00000001 */ /* * 191 0xbf '¿' */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x0c, /* 00110000 */ - 0x06, /* 01100000 */ - 0x03, /* 11000000 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x06, /* 01100000 */ + 0x03, /* 11000000 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 192 0xc0 'À' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 193 0xc1 'Á' */ - 0x70, /* 00001110 */ - 0x00, /* 00000000 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x70, /* 00001110 */ + 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 194 0xc2 'Â' */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 195 0xc3 'Ã' */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x00, /* 00000000 */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 196 0xc4 'Ä' */ - 0x63, /* 11000110 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x63, /* 11000110 */ - 0x7f, /* 11111110 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x00, /* 00000000 */ + 0x63, /* 11000110 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x63, /* 11000110 */ + 0x7f, /* 11111110 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x00, /* 00000000 */ /* * 197 0xc5 'Å' */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 198 0xc6 'Æ' */ - 0x7c, /* 00111110 */ - 0x36, /* 01101100 */ - 0x33, /* 11001100 */ - 0x7f, /* 11111110 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x73, /* 11001110 */ - 0x00, /* 00000000 */ + 0x7c, /* 00111110 */ + 0x36, /* 01101100 */ + 0x33, /* 11001100 */ + 0x7f, /* 11111110 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x73, /* 11001110 */ + 0x00, /* 00000000 */ /* * 199 0xc7 'Ç' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x03, /* 11000000 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x18, /* 00011000 */ - 0x30, /* 00001100 */ - 0x1e, /* 01111000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x03, /* 11000000 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x18, /* 00011000 */ + 0x30, /* 00001100 */ + 0x1e, /* 01111000 */ /* * 200 0xc8 'È' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x06, /* 01100000 */ - 0x1e, /* 01111000 */ - 0x06, /* 01100000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x06, /* 01100000 */ + 0x1e, /* 01111000 */ + 0x06, /* 01100000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 201 0xc9 'É' */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x06, /* 01100000 */ - 0x1e, /* 01111000 */ - 0x06, /* 01100000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x06, /* 01100000 */ + 0x1e, /* 01111000 */ + 0x06, /* 01100000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 202 0xca 'Ê' */ - 0x0c, /* 00110000 */ - 0x12, /* 01001000 */ - 0x3f, /* 11111100 */ - 0x06, /* 01100000 */ - 0x1e, /* 01111000 */ - 0x06, /* 01100000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x12, /* 01001000 */ + 0x3f, /* 11111100 */ + 0x06, /* 01100000 */ + 0x1e, /* 01111000 */ + 0x06, /* 01100000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 203 0xcb 'Ë' */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ - 0x3f, /* 11111100 */ - 0x06, /* 01100000 */ - 0x1e, /* 01111000 */ - 0x06, /* 01100000 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x06, /* 01100000 */ + 0x1e, /* 01111000 */ + 0x06, /* 01100000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 204 0xcc 'Ì' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 205 0xcd 'Í' */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 206 0xce 'Î' */ - 0x0c, /* 00110000 */ - 0x12, /* 01001000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x12, /* 01001000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 207 0xcf 'Ï' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 208 0xd0 'Ð' */ - 0x3f, /* 11111100 */ - 0x66, /* 01100110 */ - 0x6f, /* 11110110 */ - 0x6f, /* 11110110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x66, /* 01100110 */ + 0x6f, /* 11110110 */ + 0x6f, /* 11110110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ /* * 209 0xd1 'Ñ' */ - 0x3f, /* 11111100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x37, /* 11101100 */ - 0x3f, /* 11111100 */ - 0x3b, /* 11011100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x3f, /* 11111100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x37, /* 11101100 */ + 0x3f, /* 11111100 */ + 0x3b, /* 11011100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 210 0xd2 'Ò' */ - 0x0e, /* 01110000 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 211 0xd3 'Ó' */ - 0x70, /* 00001110 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x70, /* 00001110 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 212 0xd4 'Ô' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 213 0xd5 'Õ' */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x00, /* 00000000 */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x63, /* 11000110 */ - 0x3e, /* 01111100 */ - 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x63, /* 11000110 */ + 0x3e, /* 01111100 */ + 0x00, /* 00000000 */ /* * 214 0xd6 'Ö' */ - 0xc3, /* 11000011 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0xc3, /* 11000011 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 215 0xd7 '×' */ - 0x00, /* 00000000 */ - 0x36, /* 01101100 */ - 0x1c, /* 00111000 */ - 0x08, /* 00010000 */ - 0x1c, /* 00111000 */ - 0x36, /* 01101100 */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x36, /* 01101100 */ + 0x1c, /* 00111000 */ + 0x08, /* 00010000 */ + 0x1c, /* 00111000 */ + 0x36, /* 01101100 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ /* * 216 0xd8 'Ø' */ - 0x5c, /* 00111010 */ - 0x36, /* 01101100 */ - 0x73, /* 11001110 */ - 0x7b, /* 11011110 */ - 0x6f, /* 11110110 */ - 0x36, /* 01101100 */ - 0x1d, /* 10111000 */ - 0x00, /* 00000000 */ + 0x5c, /* 00111010 */ + 0x36, /* 01101100 */ + 0x73, /* 11001110 */ + 0x7b, /* 11011110 */ + 0x6f, /* 11110110 */ + 0x36, /* 01101100 */ + 0x1d, /* 10111000 */ + 0x00, /* 00000000 */ /* * 217 0xd9 'Ù' */ - 0x0e, /* 01110000 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 218 0xda 'Ú' */ - 0x70, /* 00001110 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x70, /* 00001110 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 219 0xdb 'Û' */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 220 0xdc 'Ü' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 221 0xdd 'Ý' */ - 0x70, /* 00001110 */ - 0x00, /* 00000000 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3c, /* 00111100 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x70, /* 00001110 */ + 0x00, /* 00000000 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3c, /* 00111100 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 222 0xde 'Þ' */ - 0x0f, /* 11110000 */ - 0x06, /* 01100000 */ - 0x3e, /* 01111100 */ - 0x66, /* 01100110 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x06, /* 01100000 */ - 0x0f, /* 11110000 */ + 0x0f, /* 11110000 */ + 0x06, /* 01100000 */ + 0x3e, /* 01111100 */ + 0x66, /* 01100110 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x06, /* 01100000 */ + 0x0f, /* 11110000 */ /* * 223 0xdf 'ß' */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x1f, /* 11111000 */ - 0x33, /* 11001100 */ - 0x1f, /* 11111000 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x1f, /* 11111000 */ + 0x33, /* 11001100 */ + 0x1f, /* 11111000 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ /* * 224 0xe0 'à' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 225 0xe1 'á' */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 226 0xe2 'â' */ - 0x7e, /* 01111110 */ - 0xc3, /* 11000011 */ - 0x3c, /* 00111100 */ - 0x60, /* 00000110 */ - 0x7c, /* 00111110 */ - 0x66, /* 01100110 */ - 0xfc, /* 00111111 */ - 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc3, /* 11000011 */ + 0x3c, /* 00111100 */ + 0x60, /* 00000110 */ + 0x7c, /* 00111110 */ + 0x66, /* 01100110 */ + 0xfc, /* 00111111 */ + 0x00, /* 00000000 */ /* * 227 0xe3 'ã' */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 228 0xe4 'ä' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 229 0xe5 'å' */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 230 0xe6 'æ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0xfe, /* 01111111 */ - 0x30, /* 00001100 */ - 0xfe, /* 01111111 */ - 0x33, /* 11001100 */ - 0xfe, /* 01111111 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0xfe, /* 01111111 */ + 0x30, /* 00001100 */ + 0xfe, /* 01111111 */ + 0x33, /* 11001100 */ + 0xfe, /* 01111111 */ + 0x00, /* 00000000 */ /* * 231 0xe7 'ç' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x03, /* 11000000 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x30, /* 00001100 */ - 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x03, /* 11000000 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x30, /* 00001100 */ + 0x1c, /* 00111000 */ /* * 232 0xe8 'è' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 233 0xe9 'é' */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 234 0xea 'ê' */ - 0x7e, /* 01111110 */ - 0xc3, /* 11000011 */ - 0x3c, /* 00111100 */ - 0x66, /* 01100110 */ - 0x7e, /* 01111110 */ - 0x06, /* 01100000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0xc3, /* 11000011 */ + 0x3c, /* 00111100 */ + 0x66, /* 01100110 */ + 0x7e, /* 01111110 */ + 0x06, /* 01100000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 235 0xeb 'ë' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x3f, /* 11111100 */ - 0x03, /* 11000000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x3f, /* 11111100 */ + 0x03, /* 11000000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 236 0xec 'ì' */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 237 0xed 'í' */ - 0x1c, /* 00111000 */ - 0x00, /* 00000000 */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1c, /* 00111000 */ + 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 238 0xee 'î' */ - 0x3e, /* 01111100 */ - 0x63, /* 11000110 */ - 0x1c, /* 00111000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x3c, /* 00111100 */ - 0x00, /* 00000000 */ + 0x3e, /* 01111100 */ + 0x63, /* 11000110 */ + 0x1c, /* 00111000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x3c, /* 00111100 */ + 0x00, /* 00000000 */ /* * 239 0xef 'ï' */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x0e, /* 01110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x0c, /* 00110000 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x0e, /* 01110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x0c, /* 00110000 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 240 0xf0 'ð' */ - 0x1b, /* 11011000 */ - 0x0e, /* 01110000 */ - 0x1b, /* 11011000 */ - 0x30, /* 00001100 */ - 0x3e, /* 01111100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1b, /* 11011000 */ + 0x0e, /* 01110000 */ + 0x1b, /* 11011000 */ + 0x30, /* 00001100 */ + 0x3e, /* 01111100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 241 0xf1 'ñ' */ - 0x00, /* 00000000 */ - 0x1f, /* 11111000 */ - 0x00, /* 00000000 */ - 0x1f, /* 11111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ + 0x1f, /* 11111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ /* * 242 0xf2 'ò' */ - 0x00, /* 00000000 */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 243 0xf3 'ó' */ - 0x00, /* 00000000 */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 244 0xf4 'ô' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 245 0xf5 'õ' */ - 0x6e, /* 01110110 */ - 0x3b, /* 11011100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x6e, /* 01110110 */ + 0x3b, /* 11011100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 246 0xf6 'ö' */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x1e, /* 01111000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x1e, /* 01111000 */ + 0x00, /* 00000000 */ /* * 247 0xf7 '÷' */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ - 0x18, /* 00011000 */ - 0x18, /* 00011000 */ - 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ + 0x18, /* 00011000 */ + 0x18, /* 00011000 */ + 0x00, /* 00000000 */ /* * 248 0xf8 'ø' */ - 0x00, /* 00000000 */ - 0x60, /* 00000110 */ - 0x3c, /* 00111100 */ - 0x76, /* 01101110 */ - 0x7e, /* 01111110 */ - 0x6e, /* 01110110 */ - 0x3c, /* 00111100 */ - 0x06, /* 01100000 */ + 0x00, /* 00000000 */ + 0x60, /* 00000110 */ + 0x3c, /* 00111100 */ + 0x76, /* 01101110 */ + 0x7e, /* 01111110 */ + 0x6e, /* 01110110 */ + 0x3c, /* 00111100 */ + 0x06, /* 01100000 */ /* * 249 0xf9 'ù' */ - 0x00, /* 00000000 */ - 0x07, /* 11100000 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x07, /* 11100000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 250 0xfa 'ú' */ - 0x00, /* 00000000 */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 251 0xfb 'û' */ - 0x1e, /* 01111000 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x1e, /* 01111000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 252 0xfc 'ü' */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x7e, /* 01111110 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x7e, /* 01111110 */ + 0x00, /* 00000000 */ /* * 253 0xfd 'ý' */ - 0x00, /* 00000000 */ - 0x38, /* 00011100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ + 0x38, /* 00011100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ /* * 254 0xfe 'þ' */ - 0x00, /* 00000000 */ - 0x00, /* 00000000 */ - 0x06, /* 01100000 */ - 0x3e, /* 01111100 */ - 0x66, /* 01100110 */ - 0x3e, /* 01111100 */ - 0x06, /* 01100000 */ - 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x00, /* 00000000 */ + 0x06, /* 01100000 */ + 0x3e, /* 01111100 */ + 0x66, /* 01100110 */ + 0x3e, /* 01111100 */ + 0x06, /* 01100000 */ + 0x00, /* 00000000 */ /* * 255 0xff 'ÿ' */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x00, /* 00000000 */ - 0x33, /* 11001100 */ - 0x33, /* 11001100 */ - 0x3e, /* 01111100 */ - 0x30, /* 00001100 */ - 0x1f, /* 11111000 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x00, /* 00000000 */ + 0x33, /* 11001100 */ + 0x33, /* 11001100 */ + 0x3e, /* 01111100 */ + 0x30, /* 00001100 */ + 0x1f, /* 11111000 */ }; - /* ---- Character */ -struct SDLTest_CharTextureCache { - SDL_Renderer* renderer; - SDL_Texture* charTextureCache[256]; - struct SDLTest_CharTextureCache* next; +struct SDLTest_CharTextureCache +{ + SDL_Renderer *renderer; + SDL_Texture *charTextureCache[256]; + struct SDLTest_CharTextureCache *next; }; /*! @@ -3166,15 +3166,15 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c) ci = c; /* Search for this renderer's cache */ - for (cache = SDLTest_CharTextureCacheList; cache != NULL; cache = cache->next) { + for (cache = SDLTest_CharTextureCacheList; cache; cache = cache->next) { if (cache->renderer == renderer) { break; } } /* Allocate a new cache for this renderer if needed */ - if (cache == NULL) { - cache = (struct SDLTest_CharTextureCache*)SDL_calloc(1, sizeof(struct SDLTest_CharTextureCache)); + if (!cache) { + cache = (struct SDLTest_CharTextureCache *)SDL_calloc(1, sizeof(struct SDLTest_CharTextureCache)); cache->renderer = renderer; cache->next = SDLTest_CharTextureCacheList; SDLTest_CharTextureCacheList = cache; @@ -3190,8 +3190,8 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c) character = SDL_CreateRGBSurface(SDL_SWSURFACE, charWidth, charHeight, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); - if (character == NULL) { - return (-1); + if (!character) { + return -1; } charpos = SDLTest_FontData + ci * charSize; @@ -3215,7 +3215,6 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c) ++charpos; } - /* Convert temp surface into texture */ cache->charTextureCache[ci] = SDL_CreateTextureFromSurface(renderer, character); SDL_FreeSurface(character); @@ -3224,7 +3223,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c) * Check pointer */ if (cache->charTextureCache[ci] == NULL) { - return (-1); + return -1; } } @@ -3241,7 +3240,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c) */ result |= SDL_RenderCopy(renderer, cache->charTextureCache[ci], &srect, &drect); - return (result); + return result; } /* Gets a unicode value from a UTF-8 encoded string @@ -3264,7 +3263,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if (p[0] == 0xFC && (p[1] & 0xFC) == 0x80) { overlong = SDL_TRUE; } - ch = (Uint32) (p[0] & 0x01); + ch = (Uint32)(p[0] & 0x01); left = 5; } } else if (p[0] >= 0xF8) { @@ -3272,7 +3271,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if (p[0] == 0xF8 && (p[1] & 0xF8) == 0x80) { overlong = SDL_TRUE; } - ch = (Uint32) (p[0] & 0x03); + ch = (Uint32)(p[0] & 0x03); left = 4; } } else if (p[0] >= 0xF0) { @@ -3280,7 +3279,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if (p[0] == 0xF0 && (p[1] & 0xF0) == 0x80) { overlong = SDL_TRUE; } - ch = (Uint32) (p[0] & 0x07); + ch = (Uint32)(p[0] & 0x07); left = 3; } } else if (p[0] >= 0xE0) { @@ -3288,7 +3287,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if (p[0] == 0xE0 && (p[1] & 0xE0) == 0x80) { overlong = SDL_TRUE; } - ch = (Uint32) (p[0] & 0x0F); + ch = (Uint32)(p[0] & 0x0F); left = 2; } } else if (p[0] >= 0xC0) { @@ -3296,12 +3295,12 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) if ((p[0] & 0xDE) == 0xC0) { overlong = SDL_TRUE; } - ch = (Uint32) (p[0] & 0x1F); + ch = (Uint32)(p[0] & 0x1F); left = 1; } } else { - if ((p[0] & 0x80) == 0x00) { - ch = (Uint32) p[0]; + if (!(p[0] & 0x80)) { + ch = (Uint32)p[0]; } } --srclen; @@ -3333,7 +3332,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc) #define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF) -int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s) +int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s) { const Uint32 charWidth = FONT_CHARACTER_SIZE; int result = 0; @@ -3352,14 +3351,14 @@ int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s) len -= advance; } - return (result); + return result; } SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h) { SDLTest_TextWindow *textwin = (SDLTest_TextWindow *)SDL_malloc(sizeof(*textwin)); - if ( !textwin ) { + if (!textwin) { return NULL; } @@ -3370,7 +3369,7 @@ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h) textwin->current = 0; textwin->numlines = (h / FONT_LINE_HEIGHT); textwin->lines = (char **)SDL_calloc(textwin->numlines, sizeof(*textwin->lines)); - if ( !textwin->lines ) { + if (!textwin->lines) { SDL_free(textwin); return NULL; } @@ -3381,8 +3380,8 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render { int i, y; - for ( y = textwin->rect.y, i = 0; i < textwin->numlines; ++i, y += FONT_LINE_HEIGHT ) { - if ( textwin->lines[i] ) { + for (y = textwin->rect.y, i = 0; i < textwin->numlines; ++i, y += FONT_LINE_HEIGHT) { + if (textwin->lines[i]) { SDLTest_DrawString(renderer, textwin->rect.x, y, textwin->lines[i]); } } @@ -3390,12 +3389,12 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, const char *fmt, ...) { - char text[1024]; - va_list ap; + char text[1024]; + va_list ap; - va_start(ap, fmt); - SDL_vsnprintf(text, sizeof(text), fmt, ap); - va_end(ap); + va_start(ap, fmt); + (void)SDL_vsnprintf(text, sizeof(text), fmt, ap); + va_end(ap); SDLTest_TextWindowAddTextWithLength(textwin, text, SDL_strlen(text)); } @@ -3406,19 +3405,19 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char SDL_bool newline = SDL_FALSE; char *line; - if ( len > 0 && text[len - 1] == '\n' ) { + if (len > 0 && text[len - 1] == '\n') { --len; newline = SDL_TRUE; } - if ( textwin->lines[textwin->current] ) { + if (textwin->lines[textwin->current]) { existing = SDL_strlen(textwin->lines[textwin->current]); } else { existing = 0; } - if ( *text == '\b' ) { - if ( existing ) { + if (*text == '\b') { + if (existing) { while (existing > 1 && UTF8_IsTrailingByte((Uint8)textwin->lines[textwin->current][existing - 1])) { --existing; } @@ -3433,14 +3432,14 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char } line = (char *)SDL_realloc(textwin->lines[textwin->current], existing + len + 1); - if ( line ) { + if (line) { SDL_memcpy(&line[existing], text, len); line[existing + len] = '\0'; textwin->lines[textwin->current] = line; - if ( newline ) { + if (newline) { if (textwin->current == textwin->numlines - 1) { SDL_free(textwin->lines[0]); - SDL_memcpy(&textwin->lines[0], &textwin->lines[1], (textwin->numlines-1) * sizeof(textwin->lines[1])); + SDL_memcpy(&textwin->lines[0], &textwin->lines[1], (textwin->numlines - 1) * sizeof(textwin->lines[1])); textwin->lines[textwin->current] = NULL; } else { ++textwin->current; @@ -3453,9 +3452,8 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin) { int i; - for ( i = 0; i < textwin->numlines; ++i ) - { - if ( textwin->lines[i] ) { + for (i = 0; i < textwin->numlines; ++i) { + if (textwin->lines[i]) { SDL_free(textwin->lines[i]); textwin->lines[i] = NULL; } @@ -3465,7 +3463,7 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin) void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin) { - if ( textwin ) { + if (textwin) { SDLTest_TextWindowClear(textwin); SDL_free(textwin->lines); SDL_free(textwin); @@ -3475,7 +3473,7 @@ void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin) void SDLTest_CleanupTextDrawing(void) { unsigned int i; - struct SDLTest_CharTextureCache* cache, *next; + struct SDLTest_CharTextureCache *cache, *next; cache = SDLTest_CharTextureCacheList; while (cache) { diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 98fb09df6333f..15bef31c88dc8 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -59,8 +59,7 @@ static SDLTest_RandomContext rndContext; * Note: doxygen documentation markup for functions is in the header file. */ -void -SDLTest_FuzzerInit(Uint64 execKey) +void SDLTest_FuzzerInit(Uint64 execKey) { Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF; Uint32 b = execKey & 0x00000000FFFFFFFF; @@ -69,64 +68,57 @@ SDLTest_FuzzerInit(Uint64 execKey) fuzzerInvocationCounter = 0; } -int -SDLTest_GetFuzzerInvocationCount() +int SDLTest_GetFuzzerInvocationCount(void) { return fuzzerInvocationCounter; } -Uint8 -SDLTest_RandomUint8() +Uint8 SDLTest_RandomUint8(void) { fuzzerInvocationCounter++; - return (Uint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Uint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; } -Sint8 -SDLTest_RandomSint8() +Sint8 SDLTest_RandomSint8(void) { fuzzerInvocationCounter++; - return (Sint8) SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; } -Uint16 -SDLTest_RandomUint16() +Uint16 SDLTest_RandomUint16(void) { fuzzerInvocationCounter++; - return (Uint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; } -Sint16 -SDLTest_RandomSint16() +Sint16 SDLTest_RandomSint16(void) { fuzzerInvocationCounter++; - return (Sint16) SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; } -Sint32 -SDLTest_RandomSint32() +Sint32 SDLTest_RandomSint32(void) { fuzzerInvocationCounter++; - return (Sint32) SDLTest_RandomInt(&rndContext); + return (Sint32)SDLTest_RandomInt(&rndContext); } -Uint32 -SDLTest_RandomUint32() +Uint32 SDLTest_RandomUint32(void) { fuzzerInvocationCounter++; - return (Uint32) SDLTest_RandomInt(&rndContext); + return (Uint32)SDLTest_RandomInt(&rndContext); } -Uint64 -SDLTest_RandomUint64() +Uint64 SDLTest_RandomUint64(void) { - union { + union + { Uint64 v64; Uint32 v32[2]; } value; @@ -140,10 +132,10 @@ SDLTest_RandomUint64() return value.v64; } -Sint64 -SDLTest_RandomSint64() +Sint64 SDLTest_RandomSint64(void) { - union { + union + { Uint64 v64; Uint32 v32[2]; } value; @@ -157,28 +149,26 @@ SDLTest_RandomSint64() return (Sint64)value.v64; } - - -Sint32 -SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) +Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) { Sint64 min = pMin; Sint64 max = pMax; - Sint64 temp; - Sint64 number; - - if(pMin > pMax) { - temp = min; - min = max; - max = temp; - } else if(pMin == pMax) { + Uint64 range; + + if (pMin > pMax) { + min = pMax; + max = pMin; + } else if (pMin == pMax) { return (Sint32)min; } - number = SDLTest_RandomUint32(); - /* invocation count increment in preceeding call */ - - return (Sint32)((number % ((max + 1) - min)) + min); + range = (Sint64)max - (Sint64)min; + if (range < SDL_MAX_SINT32) { + return (Sint32) (min + (Sint32) (SDLTest_RandomUint32() % (range + 1))); + } else { + const Uint64 add = SDLTest_RandomUint32() | SDLTest_RandomUint32(); + return (Sint32) (min + (Sint64) (add % (range + 1))); + } } /* ! @@ -204,48 +194,47 @@ SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) * * \returns Returns a random boundary value for the domain or 0 in case of error */ -static Uint64 -SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) { - Uint64 b1, b2; + Uint64 b1, b2; Uint64 delta; Uint64 tempBuf[4]; Uint8 index; - /* Maybe swap */ + /* Maybe swap */ if (boundary1 > boundary2) { b1 = boundary2; b2 = boundary1; } else { b1 = boundary1; b2 = boundary2; - } + } index = 0; if (validDomain == SDL_TRUE) { - if (b1 == b2) { - return b1; - } - - /* Generate up to 4 values within bounds */ - delta = b2 - b1; - if (delta < 4) { - do { + if (b1 == b2) { + return b1; + } + + /* Generate up to 4 values within bounds */ + delta = b2 - b1; + if (delta < 4) { + do { tempBuf[index] = b1 + index; index++; - } while (index < delta); - } else { - tempBuf[index] = b1; - index++; - tempBuf[index] = b1 + 1; - index++; - tempBuf[index] = b2 - 1; - index++; - tempBuf[index] = b2; - index++; - } + } while (index < delta); } else { - /* Generate up to 2 values outside of bounds */ + tempBuf[index] = b1; + index++; + tempBuf[index] = b1 + 1; + index++; + tempBuf[index] = b2 - 1; + index++; + tempBuf[index] = b2; + index++; + } + } else { + /* Generate up to 2 values outside of bounds */ if (b1 > 0) { tempBuf[index] = b1 - 1; index++; @@ -266,49 +255,44 @@ SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, return tempBuf[SDLTest_RandomUint8() % index]; } - -Uint8 -SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain) +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain) { /* max value for Uint8 */ const Uint64 maxValue = UCHAR_MAX; return (Uint8)SDLTest_GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain); + (Uint64)boundary1, (Uint64)boundary2, + validDomain); } -Uint16 -SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain) +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain) { /* max value for Uint16 */ const Uint64 maxValue = USHRT_MAX; return (Uint16)SDLTest_GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain); + (Uint64)boundary1, (Uint64)boundary2, + validDomain); } -Uint32 -SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain) +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain) { - /* max value for Uint32 */ - #if ((ULONG_MAX) == (UINT_MAX)) - const Uint64 maxValue = ULONG_MAX; - #else - const Uint64 maxValue = UINT_MAX; - #endif +/* max value for Uint32 */ +#if ((ULONG_MAX) == (UINT_MAX)) + const Uint64 maxValue = ULONG_MAX; +#else + const Uint64 maxValue = UINT_MAX; +#endif return (Uint32)SDLTest_GenerateUnsignedBoundaryValues(maxValue, - (Uint64) boundary1, (Uint64) boundary2, - validDomain); + (Uint64)boundary1, (Uint64)boundary2, + validDomain); } -Uint64 -SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain) { /* max value for Uint64 */ const Uint64 maxValue = UINT64_MAX; return SDLTest_GenerateUnsignedBoundaryValues(maxValue, - boundary1, boundary2, - validDomain); + boundary1, boundary2, + validDomain); } /* ! @@ -336,48 +320,47 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v * * \returns Returns a random boundary value for the domain or 0 in case of error */ -static Sint64 -SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) { - Sint64 b1, b2; + Sint64 b1, b2; Sint64 delta; Sint64 tempBuf[4]; Uint8 index; - /* Maybe swap */ + /* Maybe swap */ if (boundary1 > boundary2) { b1 = boundary2; b2 = boundary1; } else { b1 = boundary1; b2 = boundary2; - } + } index = 0; if (validDomain == SDL_TRUE) { - if (b1 == b2) { - return b1; - } - - /* Generate up to 4 values within bounds */ - delta = b2 - b1; - if (delta < 4) { - do { + if (b1 == b2) { + return b1; + } + + /* Generate up to 4 values within bounds */ + delta = b2 - b1; + if (delta < 4) { + do { tempBuf[index] = b1 + index; index++; - } while (index < delta); - } else { - tempBuf[index] = b1; - index++; - tempBuf[index] = b1 + 1; - index++; - tempBuf[index] = b2 - 1; - index++; - tempBuf[index] = b2; - index++; - } + } while (index < delta); } else { - /* Generate up to 2 values outside of bounds */ + tempBuf[index] = b1; + index++; + tempBuf[index] = b1 + 1; + index++; + tempBuf[index] = b2 - 1; + index++; + tempBuf[index] = b2; + index++; + } + } else { + /* Generate up to 2 values outside of bounds */ if (b1 > minValue) { tempBuf[index] = b1 - 1; index++; @@ -398,82 +381,75 @@ SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValu return tempBuf[SDLTest_RandomUint8() % index]; } - -Sint8 -SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain) +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain) { /* min & max values for Sint8 */ const Sint64 maxValue = SCHAR_MAX; const Sint64 minValue = SCHAR_MIN; return (Sint8)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain); + (Sint64)boundary1, (Sint64)boundary2, + validDomain); } -Sint16 -SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain) +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain) { /* min & max values for Sint16 */ const Sint64 maxValue = SHRT_MAX; const Sint64 minValue = SHRT_MIN; return (Sint16)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain); + (Sint64)boundary1, (Sint64)boundary2, + validDomain); } -Sint32 -SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain) +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain) { - /* min & max values for Sint32 */ - #if ((ULONG_MAX) == (UINT_MAX)) - const Sint64 maxValue = LONG_MAX; - const Sint64 minValue = LONG_MIN; - #else - const Sint64 maxValue = INT_MAX; - const Sint64 minValue = INT_MIN; - #endif +/* min & max values for Sint32 */ +#if ((ULONG_MAX) == (UINT_MAX)) + const Sint64 maxValue = LONG_MAX; + const Sint64 minValue = LONG_MIN; +#else + const Sint64 maxValue = INT_MAX; + const Sint64 minValue = INT_MIN; +#endif return (Sint32)SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, - (Sint64) boundary1, (Sint64) boundary2, - validDomain); + (Sint64)boundary1, (Sint64)boundary2, + validDomain); } -Sint64 -SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain) { /* min & max values for Sint64 */ const Sint64 maxValue = INT64_MAX; const Sint64 minValue = INT64_MIN; return SDLTest_GenerateSignedBoundaryValues(minValue, maxValue, - boundary1, boundary2, - validDomain); + boundary1, boundary2, + validDomain); } -float -SDLTest_RandomUnitFloat() +float SDLTest_RandomUnitFloat(void) { - return SDLTest_RandomUint32() / (float) UINT_MAX; + return SDLTest_RandomUint32() / (float)UINT_MAX; } -float -SDLTest_RandomFloat() +float SDLTest_RandomFloat(void) { - return (float) (SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX)); + return (float)(SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX)); } double -SDLTest_RandomUnitDouble() +SDLTest_RandomUnitDouble(void) { - return (double) (SDLTest_RandomUint64() >> 11) * (1.0/9007199254740992.0); + return (double)(SDLTest_RandomUint64() >> 11) * (1.0 / 9007199254740992.0); } double -SDLTest_RandomDouble() +SDLTest_RandomDouble(void) { double r = 0.0; double s = 1.0; do { - s /= UINT_MAX + 1.0; - r += (double)SDLTest_RandomInt(&rndContext) * s; + s /= UINT_MAX + 1.0; + r += (double)SDLTest_RandomInt(&rndContext) * s; } while (s > DBL_EPSILON); fuzzerInvocationCounter++; @@ -481,46 +457,43 @@ SDLTest_RandomDouble() return r; } - -char * -SDLTest_RandomAsciiString() +char *SDLTest_RandomAsciiString(void) { return SDLTest_RandomAsciiStringWithMaximumLength(255); } -char * -SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) +char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength) { int size; - if(maxLength < 1) { - SDL_InvalidParamError("maxLength"); + if (maxLength < 1) { + SDL_InvalidParamError("maxLength"); return NULL; } size = (SDLTest_RandomUint32() % (maxLength + 1)); - + if (size == 0) { + size = 1; + } return SDLTest_RandomAsciiStringOfSize(size); } -char * -SDLTest_RandomAsciiStringOfSize(int size) +char *SDLTest_RandomAsciiStringOfSize(int size) { char *string; int counter; - - if(size < 1) { - SDL_InvalidParamError("size"); + if (size < 1) { + SDL_InvalidParamError("size"); return NULL; } string = (char *)SDL_malloc((size + 1) * sizeof(char)); - if (string==NULL) { - return NULL; - } + if (!string) { + return NULL; + } - for(counter = 0; counter < size; ++counter) { + for (counter = 0; counter < size; ++counter) { string[counter] = (char)SDLTest_RandomIntegerInRange(32, 126); } diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index db3836b7411de..ae6d11caa537f 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,17 +41,16 @@ static Uint32 SDLTest_TestCaseTimeout = 3600; /** -* Generates a random run seed string for the harness. The generated seed -* will contain alphanumeric characters (0-9A-Z). -* -* Note: The returned string needs to be deallocated by the caller. -* -* \param length The length of the seed string to generate -* -* \returns The generated seed string -*/ -char * -SDLTest_GenerateRunSeed(const int length) + * Generates a random run seed string for the harness. The generated seed + * will contain alphanumeric characters (0-9A-Z). + * + * Note: The returned string needs to be deallocated by the caller. + * + * \param length The length of the seed string to generate + * + * \returns The generated seed string + */ +char *SDLTest_GenerateRunSeed(const int length) { char *seed = NULL; SDLTest_RandomContext randomContext; @@ -65,7 +64,7 @@ SDLTest_GenerateRunSeed(const int length) /* Allocate output buffer */ seed = (char *)SDL_malloc((length + 1) * sizeof(char)); - if (seed == NULL) { + if (!seed) { SDLTest_LogError("SDL_malloc for run seed output buffer failed."); SDL_Error(SDL_ENOMEM); return NULL; @@ -75,7 +74,7 @@ SDLTest_GenerateRunSeed(const int length) SDLTest_RandomInitTime(&randomContext); for (counter = 0; counter < length; counter++) { unsigned int number = SDLTest_Random(&randomContext); - char ch = (char) (number % (91 - 48)) + 48; + char ch = (char)(number % (91 - 48)) + 48; if (ch >= 58 && ch <= 64) { ch = 65; } @@ -87,18 +86,17 @@ SDLTest_GenerateRunSeed(const int length) } /** -* Generates an execution key for the fuzzer. -* -* \param runSeed The run seed to use -* \param suiteName The name of the test suite -* \param testName The name of the test -* \param iteration The iteration count -* -* \returns The generated execution key to initialize the fuzzer with. -* -*/ -static Uint64 -SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName, const char *testName, int iteration) + * Generates an execution key for the fuzzer. + * + * \param runSeed The run seed to use + * \param suiteName The name of the test suite + * \param testName The name of the test + * \param iteration The iteration count + * + * \returns The generated execution key to initialize the fuzzer with. + * + */ +static Uint64 SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName, const char *testName, int iteration) { SDLTest_Md5Context md5Context; Uint64 *keys; @@ -110,17 +108,17 @@ SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName, const char * size_t entireStringLength; char *buffer; - if (runSeed == NULL || runSeed[0] == '\0') { + if (!runSeed || runSeed[0] == '\0') { SDLTest_LogError("Invalid runSeed string."); return -1; } - if (suiteName == NULL || suiteName[0] == '\0') { + if (!suiteName || suiteName[0] == '\0') { SDLTest_LogError("Invalid suiteName string."); return -1; } - if (testName == NULL || testName[0] == '\0') { + if (!testName || testName[0] == '\0') { SDLTest_LogError("Invalid testName string."); return -1; } @@ -132,25 +130,25 @@ SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName, const char * /* Convert iteration number into a string */ SDL_memset(iterationString, 0, sizeof(iterationString)); - SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration); + (void)SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration); /* Combine the parameters into single string */ runSeedLength = SDL_strlen(runSeed); suiteNameLength = SDL_strlen(suiteName); testNameLength = SDL_strlen(testName); iterationStringLength = SDL_strlen(iterationString); - entireStringLength = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1; + entireStringLength = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1; buffer = (char *)SDL_malloc(entireStringLength); - if (buffer == NULL) { + if (!buffer) { SDLTest_LogError("Failed to allocate buffer for execKey generation."); SDL_Error(SDL_ENOMEM); return 0; } - SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration); + (void)SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration); /* Hash string and use half of the digest as 64bit exec key */ SDLTest_Md5Init(&md5Context); - SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, (unsigned int) entireStringLength); + SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, (unsigned int)entireStringLength); SDLTest_Md5Final(&md5Context); SDL_free(buffer); keys = (Uint64 *)md5Context.digest; @@ -159,22 +157,21 @@ SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName, const char * } /** -* \brief Set timeout handler for test. -* -* Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before. -* -* \param timeout Timeout interval in seconds. -* \param callback Function that will be called after timeout has elapsed. -* -* \return Timer id or -1 on failure. -*/ -static SDL_TimerID -SDLTest_SetTestTimeout(int timeout, void (SDLCALL *callback)(void)) + * \brief Set timeout handler for test. + * + * Note: SDL_Init(SDL_INIT_TIMER) will be called if it wasn't done so before. + * + * \param timeout Timeout interval in seconds. + * \param callback Function that will be called after timeout has elapsed. + * + * \return Timer id or -1 on failure. + */ +static SDL_TimerID SDLTest_SetTestTimeout(int timeout, void(SDLCALL *callback)(void)) { Uint32 timeoutInMilliseconds; SDL_TimerID timerID; - if (callback == NULL) { + if (!callback) { SDLTest_LogError("Timeout callback can't be NULL"); return -1; } @@ -204,44 +201,40 @@ SDLTest_SetTestTimeout(int timeout, void (SDLCALL *callback)(void)) } /** -* \brief Timeout handler. Aborts test run and exits harness process. -*/ + * \brief Timeout handler. Aborts test run and exits harness process. + */ #if defined(__WATCOMC__) #pragma aux SDLTest_BailOut aborts; #endif -static SDL_NORETURN void SDLCALL -SDLTest_BailOut(void) +static SDL_NORETURN void SDLCALL SDLTest_BailOut(void) { SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run."); exit(TEST_ABORTED); /* bail out from the test */ } /** -* \brief Execute a test using the given execution key. -* -* \param testSuite Suite containing the test case. -* \param testCase Case to execute. -* \param execKey Execution key for the fuzzer. -* \param forceTestRun Force test to run even if test was disabled in suite. -* -* \returns Test case result. -*/ -static int -SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun) + * \brief Execute a test using the given execution key. + * + * \param testSuite Suite containing the test case. + * \param testCase Case to execute. + * \param execKey Execution key for the fuzzer. + * \param forceTestRun Force test to run even if test was disabled in suite. + * + * \returns Test case result. + */ +static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun) { SDL_TimerID timer = 0; int testCaseResult = 0; int testResult = 0; int fuzzerCount; - if (testSuite==NULL || testCase==NULL || testSuite->name==NULL || testCase->name==NULL) - { + if (!testSuite || !testCase || !testSuite->name || !testCase->name) { SDLTest_LogError("Setup failure: testSuite or testCase references NULL"); return TEST_RESULT_SETUP_FAILURE; } - if (!testCase->enabled && forceTestRun == SDL_FALSE) - { + if (!testCase->enabled && forceTestRun == SDL_FALSE) { SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Test", testCase->name, "Skipped (Disabled)"); return TEST_RESULT_SKIPPED; } @@ -326,7 +319,7 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites) /* Loop over all suites */ suiteCounter = 0; - while(&testSuites[suiteCounter]) { + while (&testSuites[suiteCounter]) { testSuite=&testSuites[suiteCounter]; suiteCounter++; SDLTest_Log("Test Suite %i - %s\n", suiteCounter, @@ -334,8 +327,7 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites) /* Loop over all test cases */ testCounter = 0; - while(testSuite->testCases[testCounter]) - { + while (testSuite->testCases[testCounter]) { testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter]; testCounter++; SDLTest_Log(" Test Case %i - %s: %s", testCounter, @@ -347,26 +339,26 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites) #endif /* Gets a timer value in seconds */ -static float GetClock() +static float GetClock(void) { - float currentClock = SDL_GetPerformanceCounter() / (float) SDL_GetPerformanceFrequency(); + float currentClock = SDL_GetPerformanceCounter() / (float)SDL_GetPerformanceFrequency(); return currentClock; } /** -* \brief Execute a test suite using the given run seed and execution key. -* -* The filter string is matched to the suite name (full comparison) to select a single suite, -* or if no suite matches, it is matched to the test names (full comparison) to select a single test. -* -* \param testSuites Suites containing the test case. -* \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. -* \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. -* \param filter Filter specification. NULL disables. Case sensitive. -* \param testIterations Number of iterations to run each test case. -* -* \returns Test run result; 0 when all tests passed, 1 if any tests failed. -*/ + * \brief Execute a test suite using the given run seed and execution key. + * + * The filter string is matched to the suite name (full comparison) to select a single suite, + * or if no suite matches, it is matched to the test names (full comparison) to select a single test. + * + * \param testSuites Suites containing the test case. + * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. + * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. + * \param filter Filter specification. NULL disables. Case sensitive. + * \param testIterations Number of iterations to run each test case. + * + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. + */ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations) { int totalNumberOfTests = 0; @@ -402,6 +394,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user int testSkippedCount = 0; int countSum = 0; const SDLTest_TestCaseReference **failedTests; + char generatedSeed[16 + 1]; /* Sanitize test iterations */ if (testIterations < 1) { @@ -409,12 +402,15 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user } /* Generate run see if we don't have one already */ - if (userRunSeed == NULL || userRunSeed[0] == '\0') { - runSeed = SDLTest_GenerateRunSeed(16); - if (runSeed == NULL) { + if (!userRunSeed || userRunSeed[0] == '\0') { + char *tmp = SDLTest_GenerateRunSeed(16); + if (!tmp) { SDLTest_LogError("Generating a random seed failed"); return 2; } + SDL_memcpy(generatedSeed, tmp, 16 + 1); + SDL_free(tmp); + runSeed = generatedSeed; } else { runSeed = userRunSeed; } @@ -436,8 +432,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user testSuite = testSuites[suiteCounter]; suiteCounter++; testCounter = 0; - while (testSuite->testCases[testCounter]) - { + while (testSuite->testCases[testCounter]) { testCounter++; totalNumberOfTests++; } @@ -450,20 +445,20 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user /* Pre-allocate an array for tracking failed tests (potentially all test cases) */ failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *)); - if (failedTests == NULL) { - SDLTest_LogError("Unable to allocate cache for failed tests"); - SDL_Error(SDL_ENOMEM); - return -1; + if (!failedTests) { + SDLTest_LogError("Unable to allocate cache for failed tests"); + SDL_Error(SDL_ENOMEM); + return -1; } /* Initialize filtering */ - if (filter != NULL && filter[0] != '\0') { + if (filter && filter[0] != '\0') { /* Loop over all suites to check if we have a filter match */ suiteCounter = 0; while (testSuites[suiteCounter] && suiteFilter == 0) { testSuite = testSuites[suiteCounter]; suiteCounter++; - if (testSuite->name != NULL && SDL_strcasecmp(filter, testSuite->name) == 0) { + if (testSuite->name && SDL_strcasecmp(filter, testSuite->name) == 0) { /* Matched a suite name */ suiteFilter = 1; suiteFilterName = testSuite->name; @@ -476,7 +471,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user while (testSuite->testCases[testCounter] && testFilter == 0) { testCase = testSuite->testCases[testCounter]; testCounter++; - if (testCase->name != NULL && SDL_strcasecmp(filter, testCase->name) == 0) { + if (testCase->name && SDL_strcasecmp(filter, testCase->name) == 0) { /* Matched a test name */ suiteFilter = 1; suiteFilterName = testSuite->name; @@ -492,36 +487,36 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter); for (suiteCounter = 0; testSuites[suiteCounter]; ++suiteCounter) { testSuite = testSuites[suiteCounter]; - if (testSuite->name != NULL) { + if (testSuite->name) { SDLTest_Log("Test suite: %s", testSuite->name); } /* Within each suite, loop over all test cases to check if we have a filter match */ for (testCounter = 0; testSuite->testCases[testCounter]; ++testCounter) { testCase = testSuite->testCases[testCounter]; - SDLTest_Log(" test: %s", testCase->name); + SDLTest_Log(" test: %s%s", testCase->name, testCase->enabled ? "" : " (disabled)"); } } SDLTest_Log("Exit code: 2"); - SDL_free((void *) failedTests); + SDL_free((void *)failedTests); return 2; } } /* Loop over all suites */ suiteCounter = 0; - while(testSuites[suiteCounter]) { + while (testSuites[suiteCounter]) { testSuite = testSuites[suiteCounter]; currentSuiteName = (testSuite->name ? testSuite->name : SDLTEST_INVALID_NAME_FORMAT); suiteCounter++; /* Filter suite if flag set and we have a name */ - if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL && + if (suiteFilter == 1 && suiteFilterName && testSuite->name && SDL_strcasecmp(suiteFilterName, testSuite->name) != 0) { - /* Skip suite */ - SDLTest_Log("===== Test Suite %i: '%s' skipped\n", - suiteCounter, - currentSuiteName); + /* Skip suite */ + SDLTest_Log("===== Test Suite %i: '%s' skipped\n", + suiteCounter, + currentSuiteName); } else { /* Reset per-suite counters */ @@ -534,25 +529,24 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user /* Log suite started */ SDLTest_Log("===== Test Suite %i: '%s' started\n", - suiteCounter, - currentSuiteName); + suiteCounter, + currentSuiteName); /* Loop over all test cases */ testCounter = 0; - while(testSuite->testCases[testCounter]) - { + while (testSuite->testCases[testCounter]) { testCase = testSuite->testCases[testCounter]; currentTestName = (testCase->name ? testCase->name : SDLTEST_INVALID_NAME_FORMAT); testCounter++; /* Filter tests if flag set and we have a name */ - if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL && + if (testFilter == 1 && testFilterName && testCase->name && SDL_strcasecmp(testFilterName, testCase->name) != 0) { - /* Skip test */ - SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", - suiteCounter, - testCounter, - currentTestName); + /* Skip test */ + SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", + suiteCounter, + testCounter, + currentTestName); } else { /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */ if (testFilter == 1 && !testCase->enabled) { @@ -565,18 +559,17 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user /* Log test started */ SDLTest_Log("----- Test Case %i.%i: '%s' started", - suiteCounter, - testCounter, - currentTestName); - if (testCase->description != NULL && testCase->description[0] != '\0') { + suiteCounter, + testCounter, + currentTestName); + if (testCase->description && testCase->description[0] != '\0') { SDLTest_Log("Test Description: '%s'", - (testCase->description) ? testCase->description : SDLTEST_INVALID_NAME_FORMAT); + (testCase->description) ? testCase->description : SDLTEST_INVALID_NAME_FORMAT); } /* Loop over all iterations */ iterationCounter = 0; - while(iterationCounter < testIterations) - { + while (iterationCounter < testIterations) { iterationCounter++; if (userExecKey != 0) { @@ -603,7 +596,9 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user /* Take time - test end */ testEndSeconds = GetClock(); runtime = testEndSeconds - testStartSeconds; - if (runtime < 0.0f) runtime = 0.0f; + if (runtime < 0.0f) { + runtime = 0.0f; + } if (testIterations > 1) { /* Log test runtime */ @@ -623,7 +618,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user SDLTest_LogError(SDLTEST_FINAL_RESULT_FORMAT, "Test", currentTestName, "Failed"); break; case TEST_RESULT_NO_ASSERT: - SDLTest_LogError(SDLTEST_FINAL_RESULT_FORMAT,"Test", currentTestName, "No Asserts"); + SDLTest_LogError(SDLTEST_FINAL_RESULT_FORMAT, "Test", currentTestName, "No Asserts"); break; } @@ -638,45 +633,42 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user /* Take time - suite end */ suiteEndSeconds = GetClock(); runtime = suiteEndSeconds - suiteStartSeconds; - if (runtime < 0.0f) runtime = 0.0f; + if (runtime < 0.0f) { + runtime = 0.0f; + } /* Log suite runtime */ SDLTest_Log("Total Suite runtime: %.1f sec", runtime); /* Log summary and final Suite result */ countSum = testPassedCount + testFailedCount + testSkippedCount; - if (testFailedCount == 0) - { + if (testFailedCount == 0) { SDLTest_Log(SDLTEST_LOG_SUMMARY_FORMAT, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount); SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Suite", currentSuiteName, "Passed"); - } - else - { + } else { SDLTest_LogError(SDLTEST_LOG_SUMMARY_FORMAT, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount); SDLTest_LogError(SDLTEST_FINAL_RESULT_FORMAT, "Suite", currentSuiteName, "Failed"); } - } } /* Take time - run end */ runEndSeconds = GetClock(); runtime = runEndSeconds - runStartSeconds; - if (runtime < 0.0f) runtime = 0.0f; + if (runtime < 0.0f) { + runtime = 0.0f; + } /* Log total runtime */ SDLTest_Log("Total Run runtime: %.1f sec", runtime); /* Log summary and final run result */ countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount; - if (totalTestFailedCount == 0) - { + if (totalTestFailedCount == 0) { runResult = 0; SDLTest_Log(SDLTEST_LOG_SUMMARY_FORMAT, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount); SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Run /w seed", runSeed, "Passed"); - } - else - { + } else { runResult = 1; SDLTest_LogError(SDLTEST_LOG_SUMMARY_FORMAT, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount); SDLTest_LogError(SDLTEST_FINAL_RESULT_FORMAT, "Run /w seed", runSeed, "Failed"); @@ -686,10 +678,10 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user if (failedNumberOfTests > 0) { SDLTest_Log("Harness input to repro failures:"); for (testCounter = 0; testCounter < failedNumberOfTests; testCounter++) { - SDLTest_Log(" --seed %s --filter %s", runSeed, failedTests[testCounter]->name); + SDLTest_Log(" --seed %s --filter %s", runSeed, failedTests[testCounter]->name); } } - SDL_free((void *) failedTests); + SDL_free((void *)failedTests); SDLTest_Log("Exit code: %d", runResult); return runResult; diff --git a/src/test/SDL_test_imageBlit.c b/src/test/SDL_test_imageBlit.c index 7a45127a2eaf9..f084db5230168 100644 --- a/src/test/SDL_test_imageBlit.c +++ b/src/test/SDL_test_imageBlit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,1535 +25,1642 @@ /* GIMP RGB C-Source image dump (blit.c) */ static const SDLTest_SurfaceImage_t SDLTest_imageBlit = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" - "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0" - "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" - "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" - "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" - "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" - "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" - "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0", }; /** * \brief Returns the Blit test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlit() +SDL_Surface *SDLTest_ImageBlit(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlit.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlit.pixel_data, SDLTest_imageBlit.width, SDLTest_imageBlit.height, SDLTest_imageBlit.bytes_per_pixel * 8, SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\0\0\0\0" - "\0\0(\0\0(\0\0\0\0\0\0\0\0<\0\0<\0\0\0\0\0\0\0\0P\0\0P\0\0\0\0\0\0\0\0d\0" - "\0d\0\0\0\0\0\0\0\0x\0\0x\0\0\0\0\0\0\0\0\214\0\0\214\0\0\0\0\0\0\0\0\240" - "\0\0\240\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0\310\0\0\310\0\0\0\0" - "\0\0\0\0\334\0\0\334\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360" - "\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0\0\0(\0\0" - "(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0d\0\0d\0\0" - "\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0\0\240\0\0" - "\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310\0\0\0\0" - "\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" - "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0" - "\0\0(\0\0(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0" - "d\0\0d\0\0\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0" - "\0\240\0\0\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310" - "\0\0\0\0\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0" - "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0\0\0\0$\24\0" - "$\24\0\0\0\0\0\0\0$(\0$(\0\0\0\0\0\0\0$<\0$<\0\0\0\0\0\0\0$P\0$P\0\0\0\0" - "\0\0\0$d\0$d\0\0\0\0\0\0\0$x\0$x\0\0\0\0\0\0\0$\214\0$\214\0\0\0\0\0\0\0" - "$\240\0$\240\0\0\0\0\0\0\0$\264\0$\264\0\0\0\0\0\0\0$\310\0$\310\0\0\0\0" - "\0\0\0$\334\0$\334\0\0\0\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360" - "\0$\360\0$\360\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0" - "$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0" - "$\214\0$\214\0$\214\0\0\0\0$\240\0$\240\0$\240\0\0\0\0$\264\0$\264\0$\264" - "\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334\0$\334\0$\334\0\0\0\0$\360\0$\360" - "\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0" - "\0\0\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0" - "$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0" - "$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0$\214\0$\214\0$\214\0\0\0\0$\240\0$\240" - "\0$\240\0\0\0\0$\264\0$\264\0$\264\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334" - "\0$\334\0$\334\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$" - "\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0" - "\0\0\0\0H\0\0H\0\0\0\0\0\0\0\0H\24\0H\24\0\0\0\0\0\0\0H(\0H(\0\0\0\0\0\0" - "\0H<\0H<\0\0\0\0\0\0\0HP\0HP\0\0\0\0\0\0\0Hd\0Hd\0\0\0\0\0\0\0Hx\0Hx\0\0" - "\0\0\0\0\0H\214\0H\214\0\0\0\0\0\0\0H\240\0H\240\0\0\0\0\0\0\0H\264\0H\264" - "\0\0\0\0\0\0\0H\310\0H\310\0\0\0\0\0\0\0H\334\0H\334\0\0\0\0\0\0\0H\360\0" - "H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0\0\0\0\0\0\0$\360\0$\360" - "\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0H\24\0H\24\0H\24" - "\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd" - "\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0H\214\0\0\0\0H\240\0H\240\0H\240" - "\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310\0H\310\0H\310\0\0\0\0H\334\0H\334" - "\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H" - "\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0" - "H\0\0H\0\0\0\0\0H\24\0H\24\0H\24\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0" - "\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0" - "H\214\0\0\0\0H\240\0H\240\0H\240\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310" - "\0H\310\0H\310\0\0\0\0H\334\0H\334\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360" - "\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0" - "\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0H\0\0H\0\0H\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\0\0\0l\24\0l\24\0\0\0\0\0\0" - "\0l(\0l(\0\0\0\0\0\0\0l<\0l<\0\0\0\0\0\0\0lP\0lP\0\0\0\0\0\0\0ld\0ld\0\0" - "\0\0\0\0\0lx\0lx\0\0\0\0\0\0\0l\214\0l\214\0\0\0\0\0\0\0l\240\0l\240\0\0" - "\0\0\0\0\0l\264\0l\264\0\0\0\0\0\0\0l\310\0l\310\0\0\0\0\0\0\0l\334\0l\334" - "\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0" - "\0\0\0\0\0H\360\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0" - "\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0\0\0l<\0l<\0l<\0\0\0\0lP\0lP" - "\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0\0\0l\214\0l\214\0l\214\0\0\0" - "\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0l\264\0\0\0\0l\310\0l\310\0l\310" - "\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360" - "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0" - "\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0" - "\0\0l<\0l<\0l<\0\0\0\0lP\0lP\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0" - "\0\0l\214\0l\214\0l\214\0\0\0\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0" - "l\264\0\0\0\0l\310\0l\310\0l\310\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360" - "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0" - "l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360" - "\0\0\0\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\0\0" - "\0\220\24\0\220\24\0\0\0\0\0\0\0\220(\0\220(\0\0\0\0\0\0\0\220<\0\220<\0" - "\0\0\0\0\0\0\220P\0\220P\0\0\0\0\0\0\0\220d\0\220d\0\0\0\0\0\0\0\220x\0\220" - "x\0\0\0\0\0\0\0\220\214\0\220\214\0\0\0\0\0\0\0\220\240\0\220\240\0\0\0\0" - "\0\0\0\220\264\0\220\264\0\0\0\0\0\0\0\220\310\0\220\310\0\0\0\0\0\0\0\220" - "\334\0\220\334\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\220" - "\360\0\220\360\0\220\360\0\220\360\0\0\0\0\0\0\0l\360\0l\360\0l\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\220\24\0\220\24\0" - "\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220<\0\220<\0\220<\0\0\0\0\220" - "P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0\0\0\220x\0\220x\0\220x\0\0" - "\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240\0\220\240\0\220\240\0\0" - "\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310\0\220\310\0\220\310\0\0" - "\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360\0\220\360\0\220\360\0\220" - "\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360" - "\0\220\360\0\0\0\0l\360\0l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220" - "\0\0\0\0\0\220\24\0\220\24\0\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220" - "<\0\220<\0\220<\0\0\0\0\220P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0" - "\0\0\220x\0\220x\0\220x\0\0\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240" - "\0\220\240\0\220\240\0\0\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310" - "\0\220\310\0\220\310\0\0\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360" - "\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0" - "\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360\0" - "l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0" - "\264\24\0\264\24\0\0\0\0\0\0\0\264(\0\264(\0\0\0\0\0\0\0\264<\0\264<\0\0" - "\0\0\0\0\0\264P\0\264P\0\0\0\0\0\0\0\264d\0\264d\0\0\0\0\0\0\0\264x\0\264" - "x\0\0\0\0\0\0\0\264\214\0\264\214\0\0\0\0\0\0\0\264\240\0\264\240\0\0\0\0" - "\0\0\0\264\264\0\264\264\0\0\0\0\0\0\0\264\310\0\264\310\0\0\0\0\0\0\0\264" - "\334\0\264\334\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264" - "\360\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\220\360\0\220\360\0\220" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264" - "\24\0\264\24\0\264\24\0\0\0\0\264(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264" - "<\0\0\0\0\264P\0\264P\0\264P\0\0\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264" - "x\0\264x\0\0\0\0\264\214\0\264\214\0\264\214\0\0\0\0\264\240\0\264\240\0" - "\264\240\0\0\0\0\264\264\0\264\264\0\264\264\0\0\0\0\264\310\0\264\310\0" - "\264\310\0\0\0\0\264\334\0\264\334\0\264\334\0\0\0\0\264\360\0\264\360\0" - "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" - "\360\0\264\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\220\0" - "\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264\24\0\264\24\0\264\24\0\0\0\0\264" - "(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264<\0\0\0\0\264P\0\264P\0\264P\0\0" - "\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264x\0\264x\0\0\0\0\264\214\0\264" - "\214\0\264\214\0\0\0\0\264\240\0\264\240\0\264\240\0\0\0\0\264\264\0\264" - "\264\0\264\264\0\0\0\0\264\310\0\264\310\0\264\310\0\0\0\0\264\334\0\264" - "\334\0\264\334\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0" - "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" - "\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\0\0\0\264\0\0\264\0\0" - "\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0" - "\264\360\0\264\360\0\264\360\0\0\0\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\264" - "\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\0\0\0\330\24\0\330\24\0\0\0\0\0\0" - "\0\330(\0\330(\0\0\0\0\0\0\0\330<\0\330<\0\0\0\0\0\0\0\330P\0\330P\0\0\0" - "\0\0\0\0\330d\0\330d\0\0\0\0\0\0\0\330x\0\330x\0\0\0\0\0\0\0\330\214\0\330" - "\214\0\0\0\0\0\0\0\330\240\0\330\240\0\0\0\0\0\0\0\330\264\0\330\264\0\0" - "\0\0\0\0\0\330\310\0\330\310\0\0\0\0\0\0\0\330\334\0\330\334\0\0\0\0\0\0" - "\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0" - "\330\360\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0" - "\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0" - "\0\0\330(\0\330(\0\330(\0\0\0\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0" - "\330P\0\0\0\0\330d\0\330d\0\330d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214" - "\0\330\214\0\330\214\0\0\0\0\330\240\0\330\240\0\330\240\0\0\0\0\330\264" - "\0\330\264\0\330\264\0\0\0\0\330\310\0\330\310\0\330\310\0\0\0\0\330\334" - "\0\330\334\0\330\334\0\0\0\0\330\360\0\330\360\0\330\360\0\330\360\0\330" - "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360" - "\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\330\0\0\330\0\0" - "\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0\0\0\330(\0\330(\0\330(\0\0\0" - "\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0\330P\0\0\0\0\330d\0\330d\0\330" - "d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214\0\330\214\0\330\214\0\0\0\0" - "\330\240\0\330\240\0\330\240\0\0\0\0\330\264\0\330\264\0\330\264\0\0\0\0" - "\330\310\0\330\310\0\330\310\0\0\0\0\330\334\0\330\334\0\330\334\0\0\0\0" - "\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330" - "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\0\0\0" - "\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" - "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\374\0\0" - "\374\0\0\0\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0" - "\0\0\374<\0\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0" - "\0\0\0\0\0\374x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374" - "\240\0\374\240\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374" - "\310\0\0\0\0\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330" - "\360\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374" - "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" - "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" - "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" - "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" - "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" - "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0" - "\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0" - "\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x" - "\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374" - "\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374" - "\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330" - "\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0" - "\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374" - "P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0" - "\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0" - "\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0" - "\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" - "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" - "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" - "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" - "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" - "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" - "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" - "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" - "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" - "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" - "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" - "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" - "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" - "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" - "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" - "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" - "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334" - "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334\0\0" - "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0" - "\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374" - "<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374" - "x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374" - "\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374" - "\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374" - "(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0" - "\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374" - "\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374" - "\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374" - "\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0" - "\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0" - "\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214" - "\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264" - "\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334" - "\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" - "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" - "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" - "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" - "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" - "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" - "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" - "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" - "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" - "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" - "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" - "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" - "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" - "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" - "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" - "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" - "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" - "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" - "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" - "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" - "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" - "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24" - "\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0" - "\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0" - "\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0" - "\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334" - "\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" - "\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0" - "\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0" - "\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374" - "x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240" - "\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0" - "\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24\0" - "\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0\0" - "\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0\0" - "\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0\374" - "\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334\0\374" - "\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0" - "\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P" - "\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374" - "\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374" - "\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374" - "\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0" - "\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0" - "\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374" - "x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0" - "\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374" - "\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\0\0\0\0" + "\0\0(\0\0(\0\0\0\0\0\0\0\0<\0\0<\0\0\0\0\0\0\0\0P\0\0P\0\0\0\0\0\0\0\0d\0" + "\0d\0\0\0\0\0\0\0\0x\0\0x\0\0\0\0\0\0\0\0\214\0\0\214\0\0\0\0\0\0\0\0\240" + "\0\0\240\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0\310\0\0\310\0\0\0\0" + "\0\0\0\0\334\0\0\334\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360" + "\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0\0\0(\0\0" + "(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0d\0\0d\0\0" + "\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0\0\240\0\0" + "\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310\0\0\0\0" + "\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\0\0\24\0\0\24\0\0\0" + "\0\0(\0\0(\0\0(\0\0\0\0\0<\0\0<\0\0<\0\0\0\0\0P\0\0P\0\0P\0\0\0\0\0d\0\0" + "d\0\0d\0\0\0\0\0x\0\0x\0\0x\0\0\0\0\0\214\0\0\214\0\0\214\0\0\0\0\0\240\0" + "\0\240\0\0\240\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\310\0\0\310\0\0\310" + "\0\0\0\0\0\334\0\0\334\0\0\334\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0\360\0\0" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0\0\0\0$\24\0" + "$\24\0\0\0\0\0\0\0$(\0$(\0\0\0\0\0\0\0$<\0$<\0\0\0\0\0\0\0$P\0$P\0\0\0\0" + "\0\0\0$d\0$d\0\0\0\0\0\0\0$x\0$x\0\0\0\0\0\0\0$\214\0$\214\0\0\0\0\0\0\0" + "$\240\0$\240\0\0\0\0\0\0\0$\264\0$\264\0\0\0\0\0\0\0$\310\0$\310\0\0\0\0" + "\0\0\0$\334\0$\334\0\0\0\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360" + "\0$\360\0$\360\0\0\0\0\0\0\0\0\360\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0" + "$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0" + "$\214\0$\214\0$\214\0\0\0\0$\240\0$\240\0$\240\0\0\0\0$\264\0$\264\0$\264" + "\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334\0$\334\0$\334\0\0\0\0$\360\0$\360" + "\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0" + "\0\0\0\0\360\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0$\24\0" + "$\24\0$\24\0\0\0\0$(\0$(\0$(\0\0\0\0$<\0$<\0$<\0\0\0\0$P\0$P\0$P\0\0\0\0" + "$d\0$d\0$d\0\0\0\0$x\0$x\0$x\0\0\0\0$\214\0$\214\0$\214\0\0\0\0$\240\0$\240" + "\0$\240\0\0\0\0$\264\0$\264\0$\264\0\0\0\0$\310\0$\310\0$\310\0\0\0\0$\334" + "\0$\334\0$\334\0\0\0\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$" + "\360\0$\360\0$\360\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0$\0\0$\0\0$\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0$\360\0$\360\0$\360\0$\360\0\0\0\0\0\360\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0$\0\0\0\0" + "\0\0\0\0H\0\0H\0\0\0\0\0\0\0\0H\24\0H\24\0\0\0\0\0\0\0H(\0H(\0\0\0\0\0\0" + "\0H<\0H<\0\0\0\0\0\0\0HP\0HP\0\0\0\0\0\0\0Hd\0Hd\0\0\0\0\0\0\0Hx\0Hx\0\0" + "\0\0\0\0\0H\214\0H\214\0\0\0\0\0\0\0H\240\0H\240\0\0\0\0\0\0\0H\264\0H\264" + "\0\0\0\0\0\0\0H\310\0H\310\0\0\0\0\0\0\0H\334\0H\334\0\0\0\0\0\0\0H\360\0" + "H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0\0\0\0\0\0\0$\360\0$\360" + "\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0H\24\0H\24\0H\24" + "\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd" + "\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0H\214\0\0\0\0H\240\0H\240\0H\240" + "\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310\0H\310\0H\310\0\0\0\0H\334\0H\334" + "\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H" + "\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0$\0\0$\0\0\0\0\0H\0\0" + "H\0\0H\0\0\0\0\0H\24\0H\24\0H\24\0\0\0\0H(\0H(\0H(\0\0\0\0H<\0H<\0H<\0\0" + "\0\0HP\0HP\0HP\0\0\0\0Hd\0Hd\0Hd\0\0\0\0Hx\0Hx\0Hx\0\0\0\0H\214\0H\214\0" + "H\214\0\0\0\0H\240\0H\240\0H\240\0\0\0\0H\264\0H\264\0H\264\0\0\0\0H\310" + "\0H\310\0H\310\0\0\0\0H\334\0H\334\0H\334\0\0\0\0H\360\0H\360\0H\360\0H\360" + "\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0H\360\0" + "\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0$\0\0\0\0\0H\0\0H\0\0H\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0H\0\0H\0\0H\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\0\0\0l\24\0l\24\0\0\0\0\0\0" + "\0l(\0l(\0\0\0\0\0\0\0l<\0l<\0\0\0\0\0\0\0lP\0lP\0\0\0\0\0\0\0ld\0ld\0\0" + "\0\0\0\0\0lx\0lx\0\0\0\0\0\0\0l\214\0l\214\0\0\0\0\0\0\0l\240\0l\240\0\0" + "\0\0\0\0\0l\264\0l\264\0\0\0\0\0\0\0l\310\0l\310\0\0\0\0\0\0\0l\334\0l\334" + "\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0" + "\0\0\0\0\0H\360\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0" + "\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0\0\0l<\0l<\0l<\0\0\0\0lP\0lP" + "\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0\0\0l\214\0l\214\0l\214\0\0\0" + "\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0l\264\0\0\0\0l\310\0l\310\0l\310" + "\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360" + "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0" + "\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0l\24\0l\24\0l\24\0\0\0\0l(\0l(\0l(\0\0" + "\0\0l<\0l<\0l<\0\0\0\0lP\0lP\0lP\0\0\0\0ld\0ld\0ld\0\0\0\0lx\0lx\0lx\0\0" + "\0\0l\214\0l\214\0l\214\0\0\0\0l\240\0l\240\0l\240\0\0\0\0l\264\0l\264\0" + "l\264\0\0\0\0l\310\0l\310\0l\310\0\0\0\0l\334\0l\334\0l\334\0\0\0\0l\360" + "\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0l\360\0" + "l\360\0l\360\0l\360\0\0\0\0H\360\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0H\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\360\0l\360\0l\360\0l\360" + "\0\0\0\0H\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0l\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\0\0" + "\0\220\24\0\220\24\0\0\0\0\0\0\0\220(\0\220(\0\0\0\0\0\0\0\220<\0\220<\0" + "\0\0\0\0\0\0\220P\0\220P\0\0\0\0\0\0\0\220d\0\220d\0\0\0\0\0\0\0\220x\0\220" + "x\0\0\0\0\0\0\0\220\214\0\220\214\0\0\0\0\0\0\0\220\240\0\220\240\0\0\0\0" + "\0\0\0\220\264\0\220\264\0\0\0\0\0\0\0\220\310\0\220\310\0\0\0\0\0\0\0\220" + "\334\0\220\334\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\220" + "\360\0\220\360\0\220\360\0\220\360\0\0\0\0\0\0\0l\360\0l\360\0l\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\220\24\0\220\24\0" + "\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220<\0\220<\0\220<\0\0\0\0\220" + "P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0\0\0\220x\0\220x\0\220x\0\0" + "\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240\0\220\240\0\220\240\0\0" + "\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310\0\220\310\0\220\310\0\0" + "\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360\0\220\360\0\220\360\0\220" + "\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360" + "\0\220\360\0\0\0\0l\360\0l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0l\0\0l\0\0\0\0\0\220\0\0\220\0\0\220" + "\0\0\0\0\0\220\24\0\220\24\0\220\24\0\0\0\0\220(\0\220(\0\220(\0\0\0\0\220" + "<\0\220<\0\220<\0\0\0\0\220P\0\220P\0\220P\0\0\0\0\220d\0\220d\0\220d\0\0" + "\0\0\220x\0\220x\0\220x\0\0\0\0\220\214\0\220\214\0\220\214\0\0\0\0\220\240" + "\0\220\240\0\220\240\0\0\0\0\220\264\0\220\264\0\220\264\0\0\0\0\220\310" + "\0\220\310\0\220\310\0\0\0\0\220\334\0\220\334\0\220\334\0\0\0\0\220\360" + "\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0" + "\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360\0" + "l\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0l\0\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\220\360\0\220\360\0\220\360\0\220\360\0\0\0\0l\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\220\0\0\220\0\0\220\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\0\0\0" + "\264\24\0\264\24\0\0\0\0\0\0\0\264(\0\264(\0\0\0\0\0\0\0\264<\0\264<\0\0" + "\0\0\0\0\0\264P\0\264P\0\0\0\0\0\0\0\264d\0\264d\0\0\0\0\0\0\0\264x\0\264" + "x\0\0\0\0\0\0\0\264\214\0\264\214\0\0\0\0\0\0\0\264\240\0\264\240\0\0\0\0" + "\0\0\0\264\264\0\264\264\0\0\0\0\0\0\0\264\310\0\264\310\0\0\0\0\0\0\0\264" + "\334\0\264\334\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\220\360\0\220\360\0\220" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\220\0\0\220\0\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264" + "\24\0\264\24\0\264\24\0\0\0\0\264(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264" + "<\0\0\0\0\264P\0\264P\0\264P\0\0\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264" + "x\0\264x\0\0\0\0\264\214\0\264\214\0\264\214\0\0\0\0\264\240\0\264\240\0" + "\264\240\0\0\0\0\264\264\0\264\264\0\264\264\0\0\0\0\264\310\0\264\310\0" + "\264\310\0\0\0\0\264\334\0\264\334\0\264\334\0\0\0\0\264\360\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\220\0" + "\0\0\0\0\264\0\0\264\0\0\264\0\0\0\0\0\264\24\0\264\24\0\264\24\0\0\0\0\264" + "(\0\264(\0\264(\0\0\0\0\264<\0\264<\0\264<\0\0\0\0\264P\0\264P\0\264P\0\0" + "\0\0\264d\0\264d\0\264d\0\0\0\0\264x\0\264x\0\264x\0\0\0\0\264\214\0\264" + "\214\0\264\214\0\0\0\0\264\240\0\264\240\0\264\240\0\0\0\0\264\264\0\264" + "\264\0\264\264\0\0\0\0\264\310\0\264\310\0\264\310\0\0\0\0\264\334\0\264" + "\334\0\264\334\0\0\0\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264\360\0\264" + "\360\0\264\360\0\0\0\0\220\360\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\0\0\0\0\0\264\0\0\264\0\0" + "\264\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0" + "\264\360\0\264\360\0\264\360\0\0\0\0\220\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\264" + "\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\0\0\0\330\24\0\330\24\0\0\0\0\0\0" + "\0\330(\0\330(\0\0\0\0\0\0\0\330<\0\330<\0\0\0\0\0\0\0\330P\0\330P\0\0\0" + "\0\0\0\0\330d\0\330d\0\0\0\0\0\0\0\330x\0\330x\0\0\0\0\0\0\0\330\214\0\330" + "\214\0\0\0\0\0\0\0\330\240\0\330\240\0\0\0\0\0\0\0\330\264\0\330\264\0\0" + "\0\0\0\0\0\330\310\0\330\310\0\0\0\0\0\0\0\330\334\0\330\334\0\0\0\0\0\0" + "\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0" + "\330\360\0\0\0\0\0\0\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0" + "\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0" + "\0\0\330(\0\330(\0\330(\0\0\0\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0" + "\330P\0\0\0\0\330d\0\330d\0\330d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214" + "\0\330\214\0\330\214\0\0\0\0\330\240\0\330\240\0\330\240\0\0\0\0\330\264" + "\0\330\264\0\330\264\0\0\0\0\330\310\0\330\310\0\330\310\0\0\0\0\330\334" + "\0\330\334\0\330\334\0\0\0\0\330\360\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360" + "\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\0\0\264\0\0\0\0\0\330\0\0\330\0\0" + "\330\0\0\0\0\0\330\24\0\330\24\0\330\24\0\0\0\0\330(\0\330(\0\330(\0\0\0" + "\0\330<\0\330<\0\330<\0\0\0\0\330P\0\330P\0\330P\0\0\0\0\330d\0\330d\0\330" + "d\0\0\0\0\330x\0\330x\0\330x\0\0\0\0\330\214\0\330\214\0\330\214\0\0\0\0" + "\330\240\0\330\240\0\330\240\0\0\0\0\330\264\0\330\264\0\330\264\0\0\0\0" + "\330\310\0\330\310\0\330\310\0\0\0\0\330\334\0\330\334\0\330\334\0\0\0\0" + "\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\330\360\0\0\0\0" + "\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\264\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\330\0\0\0\0\0\0\0\0\374\0\0" + "\374\0\0\0\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0" + "\0\0\374<\0\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0" + "\0\0\0\0\0\374x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374" + "\240\0\374\240\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374" + "\310\0\0\0\0\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330" + "\360\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\330\0\0\330\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0" + "\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0" + "\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x" + "\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374" + "\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374" + "\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330" + "\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0" + "\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374" + "P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0" + "\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0" + "\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0" + "\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" + "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" + "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" + "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" + "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" + "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334" + "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\334\0\0" + "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0" + "\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374" + "<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374" + "x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374" + "\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374" + "\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374" + "(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0" + "\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374" + "\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374" + "\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374" + "\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0" + "\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0" + "\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214" + "\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264" + "\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334" + "\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374" + "(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374" + "d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374" + "\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374" + "\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374" + "\334\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374" + "\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0" + "\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d" + "\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0" + "\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0" + "\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0" + "\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374" + "\0\0\0\0\0\374\24\0\374\24\0\374\24\0\0\0\0\374(\0\374(\0\374(\0\0\0\0\374" + "<\0\374<\0\374<\0\0\0\0\374P\0\374P\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0" + "\0\0\374x\0\374x\0\374x\0\0\0\0\374\214\0\374\214\0\374\214\0\0\0\0\374\240" + "\0\374\240\0\374\240\0\0\0\0\374\264\0\374\264\0\374\264\0\0\0\0\374\310" + "\0\374\310\0\374\310\0\0\0\0\374\334\0\374\334\0\374\334\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24" + "\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0" + "\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0" + "\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0" + "\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334" + "\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0" + "\0\0\0\0\0\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0" + "\374<\0\0\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374" + "x\0\374x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240" + "\0\0\0\0\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0" + "\0\0\0\374\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0\374\24\0" + "\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0\0\0\0\0\0" + "\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374x\0\0\0\0" + "\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0\0\0\0\374" + "\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374\334\0\374" + "\334\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\374\0\0\374\0\0\374\0\0\0\0\0\374\24\0\374\24\0\374\24\0" + "\0\0\0\374(\0\374(\0\374(\0\0\0\0\374<\0\374<\0\374<\0\0\0\0\374P\0\374P" + "\0\374P\0\0\0\0\374d\0\374d\0\374d\0\0\0\0\374x\0\374x\0\374x\0\0\0\0\374" + "\214\0\374\214\0\374\214\0\0\0\0\374\240\0\374\240\0\374\240\0\0\0\0\374" + "\264\0\374\264\0\374\264\0\0\0\0\374\310\0\374\310\0\374\310\0\0\0\0\374" + "\334\0\374\334\0\374\334\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\0\0\374\0\0\0\0\0\0\0\0" + "\374\24\0\374\24\0\0\0\0\0\0\0\374(\0\374(\0\0\0\0\0\0\0\374<\0\374<\0\0" + "\0\0\0\0\0\374P\0\374P\0\0\0\0\0\0\0\374d\0\374d\0\0\0\0\0\0\0\374x\0\374" + "x\0\0\0\0\0\0\0\374\214\0\374\214\0\0\0\0\0\0\0\374\240\0\374\240\0\0\0\0" + "\0\0\0\374\264\0\374\264\0\0\0\0\0\0\0\374\310\0\374\310\0\0\0\0\0\0\0\374" + "\334\0\374\334\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitColor test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitColor() +SDL_Surface *SDLTest_ImageBlitColor(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitColor.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitColor.pixel_data, SDLTest_imageBlitColor.width, SDLTest_imageBlitColor.height, SDLTest_imageBlitColor.bytes_per_pixel * 8, SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\20\20\0" - "\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0II\0\224\224\0\224" - "\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302\302\0HH\0HH\0\324" - "\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00\0\356\356\0\356\356" - "\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16\0\374\374\0\374\374" - "\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0""88\0""88\0**\0ff\0ff\0ff\0FF\0" - "\215\215\0\215\215\0\215\215\0UU\0\255\255\0\255\255\0\255\255\0[[\0\306" - "\306\0\306\306\0\306\306\0YY\0\331\331\0\331\331\0\331\331\0PP\0\350\350" - "\0\350\350\0\350\350\0DD\0\362\362\0\362\362\0\362\362\0""44\0\370\370\0" - "\370\370\0\370\370\0\"\"\0\374\374\0\374\374\0\374\374\0\16\16\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\374\374\0" - "\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\20\20\0""88\0" - """88\0""88\0**\0ff\0ff\0ff\0FF\0\226\226\0\226\226\0\215\215\0UU\0\271\271" - "\0\271\271\0\255\255\0[[\0\323\323\0\323\323\0\306\306\0YY\0\345\345\0\345" - "\345\0\331\331\0PP\0\360\360\0\360\360\0\350\350\0DD\0\370\370\0\370\370" - "\0\362\362\0""44\0\374\374\0\374\374\0\370\370\0\"\"\0\376\376\0\376\376" - "\0\374\374\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" - "\0\24\24\0\24\24\0\20\20\0""33\0""33\0""33\0&&\0OO\0OO\0OO\0""55\0``\0``" - "\0``\0::\0``\0``\0``\0""22\0WW\0WW\0WW\0''\0II\0II\0II\0\33\33\0""99\0""9" - "9\0""99\0\20\20\0))\0))\0))\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17" - "\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0" - "\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\360\360\0\360\360\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\16\16" - "\0""33\0GG\0GG\0""00\0``\0\210\210\0\210\210\0TT\0\204\204\0\263\263\0\263" - "\263\0ee\0\222\222\0\315\315\0\312\312\0gg\0\216\216\0\331\331\0\327\327" - "\0cc\0\202\202\0\340\340\0\337\337\0YY\0qq\0\345\345\0\344\344\0NN\0^^\0" - "\352\352\0\352\352\0@@\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364" - "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" - "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" - "\16\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24" - "\24\0\24\24\0\22\22\0\24\24\0""88\0""88\0//\0BB\0pp\0pp\0UU\0ss\0\242\242" - "\0\242\242\0oo\0\230\230\0\306\306\0\306\306\0ww\0\265\265\0\335\335\0\335" - "\335\0ss\0\313\313\0\353\353\0\353\353\0ii\0\333\333\0\364\364\0\364\364" - "\0ZZ\0\351\351\0\371\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""6" - "6\0\370\370\0\376\376\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16" - "\16\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376" - "\0\376\376\0\360\360\0\360\360\0\360\360\0\360\360\0\16\16\0\360\360\0\360" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\22\22\0\"\"\0""88\0" - """88\0//\0OO\0pp\0pp\0WW\0\203\203\0\242\242\0\242\242\0qq\0\256\256\0\312" - "\312\0\301\301\0||\0\313\313\0\342\342\0\325\325\0yy\0\336\336\0\360\360" - "\0\342\342\0mm\0\353\353\0\367\367\0\354\354\0\\\\\0\363\363\0\373\373\0" - "\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373" - "\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375" - "\0\360\360\0\374\374\0\360\360\0\376\376\0\16\16\0\360\360\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\22\22\0&&\0\"\"\0""88\0//\0PP\0HH\0gg\0NN" - "\0pp\0ee\0}}\0VV\0{{\0oo\0\202\202\0NN\0qq\0jj\0vv\0>>\0``\0\\\\\0cc\0,," - "\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0" - "\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7" - "\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360" - "\360\0\376\376\0\376\376\0\16\16\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" - "\0&&\0&&\0\"\"\0""66\0[[\0oo\0ee\0``\0\220\220\0\270\270\0\250\250\0xx\0" - "\250\250\0\327\327\0\311\311\0zz\0\246\246\0\341\341\0\325\325\0rr\0\230" - "\230\0\343\343\0\334\334\0gg\0\205\205\0\344\344\0\340\340\0[[\0rr\0\346" - "\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" - """11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16" - "\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362\0\376" - "\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\22\22\0&&\0&&\0\37\37\0;;\0``\0``\0HH\0qq\0\237\237" - "\0\237\237\0nn\0\227\227\0\306\306\0\306\306\0}}\0\254\254\0\334\334\0\334" - "\334\0}}\0\275\275\0\347\347\0\347\347\0vv\0\316\316\0\357\357\0\357\357" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0&&\0##\0--\0``\0``\0TT\0cc\0\237\237\0\231\231\0||\0\223\223\0\306\306" - "\0\301\301\0\217\217\0\267\267\0\336\336\0\322\322\0\220\220\0\317\317\0" - "\352\352\0\334\334\0\202\202\0\337\337\0\362\362\0\345\345\0qq\0\353\353" - "\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371\371\0\375" - "\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376\376\0\376" - "\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0\376\376\0" - "\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0##\0""77\0--\0``\0PP\0nn\0[[\0\222\222\0kk\0\211\211\0qq\0\231\231\0" - "ff\0\210\210\0uu\0\217\217\0UU\0vv\0ll\0zz\0@@\0aa\0]]\0dd\0,,\0MM\0KK\0" - "OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0\33\33\0\33" - "\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2" - "\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\376" - "\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0##\0""77\0""77" - "\0--\0UU\0zz\0\216\216\0ww\0}}\0\254\254\0\324\324\0\264\264\0\207\207\0" - "\266\266\0\345\345\0\316\316\0\177\177\0\254\254\0\346\346\0\326\326\0rr" - "\0\231\231\0\344\344\0\334\334\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr" - "\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357" - "\357\0""11\0""66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0" - "\16\16\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362" - "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0--\0CC\0~~\0~~\0\\\\\0||\0" - "\274\274\0\274\274\0||\0\235\235\0\325\325\0\325\325\0\204\204\0\256\256" - "\0\340\340\0\340\340\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316" - "\0\360\360\0\360\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371" - "\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376" - "\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0" - "\360\360\0\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0pp\0gg\0\243\243\0\255\255" - "\0\225\225\0\231\231\0\311\311\0\314\314\0\235\235\0\271\271\0\337\337\0" - "\326\326\0\224\224\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362" - "\362\0\345\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373" - "\0\362\362\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0" - "\373\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0" - "\375\375\0\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376" - "\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222" - "\222\0kk\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm" - "\0zz\0@@\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0" - "))\0**\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0" - "\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16" - "\0\16\16\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203" - "\203\0\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317" - "\0\200\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334" - "\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0" - "\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364" - "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" - "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" - "\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" - "\0""77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302" - "\302\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341" - "\341\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360" - "\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371" - "\0II\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0" - "\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0" - "\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235" - "\0\234\234\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0" - "\225\225\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345" - "\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362" - "\0JJ\0\371\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0" - "\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0" - "\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk" - "\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@" - "\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0" - "\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7" - "\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16" - "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0" - "\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200" - "\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg" - "\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352" - "\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364" - "\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0" - "\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16" - "\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - """77\0""77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302" - "\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341" - "\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" - "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" - "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" - "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" - "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" - "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" - "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" - "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" - "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" - "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40" - "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" - "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" - "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0" - """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" - "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" - "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" - "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" - "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0""99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" - "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" - "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" - "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0##\0""77\0""77\0""99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" - "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" - "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" - "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" - "\352\0AA\0JJ\0\357\357\0\357\357\0""11\0""66\0\364\364\0\364\364\0\40\40" - "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" - "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" - "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0" - """77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" - "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" - "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0""66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0""77\0""22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0""66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0""99\0``\0PP\0\213\213\0mm\0\237\237\0uu\0\275\275" - "\0\232\232\0\306\306\0\204\204\0\331\331\0\272\272\0\336\336\0\205\205\0" - "\345\345\0\320\320\0\352\352\0{{\0\355\355\0\337\337\0\362\362\0mm\0\363" - "\363\0\353\353\0\370\370\0\\\\\0\367\367\0\363\363\0\373\373\0II\0\373\373" - "\0\371\371\0\375\375\0""66\0\375\375\0\374\374\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\375\375\0\375\375" - "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0##\0""77\0""77\0""99\0gg\0\205\205\0\205\205\0ww\0\224\224\0" - "\310\310\0\310\310\0\247\247\0\240\240\0\354\354\0\354\354\0\306\306\0\227" - "\227\0\372\372\0\372\372\0\325\325\0\205\205\0\375\375\0\375\375\0\342\342" - "\0rr\0\376\376\0\376\376\0\354\354\0^^\0\376\376\0\376\376\0\363\363\0JJ" - "\0\376\376\0\376\376\0\370\370\0""66\0\376\376\0\376\376\0\374\374\0\"\"" - "\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375" - "\0\376\376\0\376\376\0\376\376\0\362\362\0\376\376\0\376\376\0\376\376\0" - "\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0""77\0""77\0""11\0>>\0~~\0~~\0bb" - "\0__\0\261\261\0\261\261\0\212\212\0``\0\277\277\0\277\277\0\230\230\0SS" - "\0\275\275\0\275\275\0\233\233\0@@\0\273\273\0\273\273\0\240\240\0//\0\274" - "\274\0\274\274\0\252\252\0!!\0\301\301\0\301\301\0\266\266\0\25\25\0\311" - "\311\0\311\311\0\303\303\0\14\14\0\324\324\0\324\324\0\322\322\0\6\6\0\342" - "\342\0\342\342\0\341\341\0\1\1\0\361\361\0\361\361\0\361\361\0\15\15\0\15" - "\15\0\15\15\0\15\15\0\362\362\0\362\362\0\362\362\0\360\360\0\16\16\0\16" - "\16\0\16\16\0\2\2\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0&&\0""77\0""77\0\34\34\0SS\0kk\0\206\206\0BB\0\214\214\0\232\232" - "\0\302\302\0YY\0\250\250\0\255\255\0\340\340\0XX\0\264\264\0\264\264\0\355" - "\355\0SS\0\265\265\0\266\266\0\364\364\0JJ\0\270\270\0\272\272\0\371\371" - "\0AA\0\277\277\0\300\300\0\374\374\0""66\0\310\310\0\311\311\0\375\375\0" - "**\0\324\324\0\324\324\0\376\376\0\34\34\0\341\341\0\342\342\0\376\376\0" - "\15\15\0\361\361\0\361\361\0\376\376\0\361\361\0\15\15\0\15\15\0\376\376" - "\0\15\15\0\361\361\0\361\361\0\373\373\0\362\362\0\15\15\0\16\16\0\376\376" - "\0\16\16\0\361\361\0\376\376\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0&&\0&&\0""77\0))\0SS\0SS\0kk\0DD\0\205\205\0}}\0\222\222\0WW\0\241\241" - "\0\230\230\0\245\245\0XX\0\261\261\0\252\252\0\261\261\0SS\0\264\264\0\263" - "\263\0\265\265\0JJ\0\270\270\0\271\271\0\272\272\0AA\0\276\276\0\300\300" - "\0\300\300\0""66\0\310\310\0\311\311\0\311\311\0**\0\324\324\0\324\324\0" - "\324\324\0\34\34\0\341\341\0\342\342\0\342\342\0\15\15\0\361\361\0\361\361" - "\0\361\361\0\361\361\0\15\15\0\15\15\0\15\15\0\15\15\0\361\361\0\361\361" - "\0\361\361\0\362\362\0\15\15\0\16\16\0\16\16\0\16\16\0\361\361\0\376\376" - "\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0&&\0&&\0))\0pp\0cc\0cc" - "\0QQ\0\261\261\0\244\244\0\244\244\0ll\0\335\335\0\323\323\0\323\323\0ww" - "\0\364\364\0\356\356\0\356\356\0ss\0\370\370\0\371\371\0\371\371\0ii\0\372" - "\372\0\375\375\0\375\375\0YY\0\374\374\0\376\376\0\376\376\0HH\0\375\375" - "\0\376\376\0\376\376\0""66\0\376\376\0\376\376\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" - "\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\40\40\0QQ\0pp\0pp\0KK" - "\0\215\215\0\261\261\0\261\261\0pp\0\274\274\0\337\337\0\337\337\0\200\200" - "\0\332\332\0\364\364\0\364\364\0}}\0\350\350\0\373\373\0\373\373\0oo\0\361" - "\361\0\375\375\0\375\375\0]]\0\367\367\0\376\376\0\376\376\0JJ\0\373\373" - "\0\376\376\0\376\376\0""66\0\375\375\0\376\376\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" - "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\20\20\0""88\0WW\0pp\0" - "==\0ss\0\212\212\0\252\252\0dd\0\250\250\0\264\264\0\312\312\0rr\0\313\313" - "\0\315\315\0\331\331\0rr\0\340\340\0\331\331\0\340\340\0hh\0\355\355\0\341" - "\341\0\345\345\0YY\0\366\366\0\350\350\0\352\352\0HH\0\372\372\0\356\356" - "\0\357\357\0""66\0\375\375\0\364\364\0\364\364\0\"\"\0\376\376\0\371\371" - "\0\371\371\0\16\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361" - "\361\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\375\375\0" - "\376\376\0\375\375\0\374\374\0\360\360\0\376\376\0\376\376\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0&&\0\40\40\0""88\0""88\0WW\0BB\0ff" - "\0ZZ\0}}\0^^\0\226\226\0\201\201\0\241\241\0nn\0\301\301\0\246\246\0\277" - "\277\0rr\0\333\333\0\301\301\0\321\321\0ii\0\353\353\0\323\323\0\335\335" - "\0[[\0\365\365\0\341\341\0\346\346\0II\0\372\372\0\353\353\0\356\356\0""6" - "6\0\375\375\0\363\363\0\364\364\0\"\"\0\376\376\0\371\371\0\371\371\0\16" - "\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361\361\0\361\361" - "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\374\374\0\375\375\0\374" - "\374\0\374\374\0\361\361\0\376\376\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0""88\0""88\0BB\0~~\0ff\0ff\0" - "^^\0\256\256\0\226\226\0\226\226\0qq\0\325\325\0\277\277\0\277\277\0ss\0" - "\350\350\0\331\331\0\331\331\0jj\0\363\363\0\353\353\0\353\353\0[[\0\371" - "\371\0\365\365\0\365\365\0II\0\374\374\0\372\372\0\372\372\0""66\0\375\375" - "\0\375\375\0\375\375\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" - "\376\376\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\376" - "\376\0\361\361\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0HH\0""88\0BB\0~~\0~~\0ff\0^^\0\263" - "\263\0\263\263\0\231\231\0nn\0\330\330\0\330\330\0\274\274\0pp\0\353\353" - "\0\353\353\0\324\324\0hh\0\365\365\0\365\365\0\345\345\0ZZ\0\373\373\0\373" - "\373\0\361\361\0II\0\375\375\0\375\375\0\370\370\0""66\0\376\376\0\376\376" - "\0\374\374\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" - "\376\376\0\374\374\0\374\374\0\376\376\0\376\376\0\361\361\0\360\360\0\360" - "\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0" - "\0\0\0\0((\0HH\0\40\40\0\25\25\0QQ\0\207\207\0KK\0--\0}}\0\262\262\0bb\0" - """44\0\235\235\0\320\320\0ff\0""00\0\257\257\0\341\341\0cc\0))\0\272\272" - "\0\354\354\0ZZ\0\37\37\0\303\303\0\363\363\0OO\0\26\26\0\314\314\0\370\370" - "\0AA\0\15\15\0\326\326\0\373\373\0""22\0\6\6\0\343\343\0\375\375\0!!\0\1" - "\1\0\362\362\0\376\376\0\16\16\0\16\16\0\16\16\0\375\375\0\375\375\0\375" - "\375\0\376\376\0\362\362\0\360\360\0\361\361\0\376\376\0\14\14\0\0\0\0\0" - "\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" - "\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0PP\0PP\0\10" - "\10\0\4\4\0dd\0dd\0\14\14\0\6\6\0xx\0xx\0\14\14\0\5\5\0\214\214\0\214\214" - "\0\13\13\0\4\4\0\240\240\0\240\240\0\10\10\0\2\2\0\264\264\0\264\264\0\5" - "\5\0\1\1\0\310\310\0\310\310\0\3\3\0\0\0\0\334\334\0\334\334\0\1\1\0\0\0" - "\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\0\0\0\0\0\14" - "\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0" - "\0<<\0<<\0\0\0\0\0\0\0XX\0XX\0\0\0\0\0\0\0pp\0pp\0\0\0\0\0\0\0\204\204\0" - "\204\204\0\0\0\0\0\0\0\227\227\0\227\227\0\0\0\0\0\0\0\250\250\0\250\250" - "\0\0\0\0\0\0\0\271\271\0\271\271\0\0\0\0\0\0\0\313\313\0\313\313\0\0\0\0" - "\0\0\0\335\335\0\335\335\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\1" - "\1\0\1\1\0\0\0\0\0\0\0\14\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" - "\24\24\0\24\24\0\0\0\0((\0((\0((\0\0\0\0<<\0HH\0HH\0\10\10\0PP\0dd\0dd\0" - "\14\14\0dd\0||\0||\0\14\14\0xx\0\221\221\0\221\221\0\13\13\0\214\214\0\243" - "\243\0\243\243\0\10\10\0\240\240\0\264\264\0\264\264\0\5\5\0\264\264\0\303" - "\303\0\303\303\0\3\3\0\310\310\0\322\322\0\322\322\0\1\1\0\334\334\0\341" - "\341\0\341\341\0\0\0\0\360\360\0\361\361\0\361\361\0\1\1\0\0\0\0\14\14\0" - "\14\14\0\14\14\0\0\0\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" - "\24\24\0\20\20\0\20\20\0""88\0""88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0" - "II\0\224\224\0\224\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302" - "\302\0HH\0HH\0\324\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0""00\0""00" - "\0\356\356\0\356\356\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16" - "\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0" - "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\20\20\0" + "\20\20\0" + "88\0" + "88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0II\0\224\224\0\224" + "\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302\302\0HH\0HH\0\324" + "\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0" + "00\0" + "00\0\356\356\0\356\356" + "\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16\0\374\374\0\374\374" + "\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\24\24\0\24\24\0\24\24\0\20\20\0" + "88\0" + "88\0" + "88\0**\0ff\0ff\0ff\0FF\0" + "\215\215\0\215\215\0\215\215\0UU\0\255\255\0\255\255\0\255\255\0[[\0\306" + "\306\0\306\306\0\306\306\0YY\0\331\331\0\331\331\0\331\331\0PP\0\350\350" + "\0\350\350\0\350\350\0DD\0\362\362\0\362\362\0\362\362\0" + "44\0\370\370\0" + "\370\370\0\370\370\0\"\"\0\374\374\0\374\374\0\374\374\0\16\16\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\374\374\0" + "\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\20\20\0" + "88\0" + "" + "88\0" + "88\0**\0ff\0ff\0ff\0FF\0\226\226\0\226\226\0\215\215\0UU\0\271\271" + "\0\271\271\0\255\255\0[[\0\323\323\0\323\323\0\306\306\0YY\0\345\345\0\345" + "\345\0\331\331\0PP\0\360\360\0\360\360\0\350\350\0DD\0\370\370\0\370\370" + "\0\362\362\0" + "44\0\374\374\0\374\374\0\370\370\0\"\"\0\376\376\0\376\376" + "\0\374\374\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" + "\0\24\24\0\24\24\0\20\20\0" + "33\0" + "33\0" + "33\0&&\0OO\0OO\0OO\0" + "55\0``\0``" + "\0``\0::\0``\0``\0``\0" + "22\0WW\0WW\0WW\0''\0II\0II\0II\0\33\33\0" + "99\0" + "9" + "9\0" + "99\0\20\20\0))\0))\0))\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17" + "\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0" + "\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\360\360\0\360\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\16\16" + "\0" + "33\0GG\0GG\0" + "00\0``\0\210\210\0\210\210\0TT\0\204\204\0\263\263\0\263" + "\263\0ee\0\222\222\0\315\315\0\312\312\0gg\0\216\216\0\331\331\0\327\327" + "\0cc\0\202\202\0\340\340\0\337\337\0YY\0qq\0\345\345\0\344\344\0NN\0^^\0" + "\352\352\0\352\352\0@@\0JJ\0\357\357\0\357\357\0" + "11\0" + "66\0\364\364\0\364" + "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" + "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" + "\16\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24" + "\24\0\24\24\0\22\22\0\24\24\0" + "88\0" + "88\0//\0BB\0pp\0pp\0UU\0ss\0\242\242" + "\0\242\242\0oo\0\230\230\0\306\306\0\306\306\0ww\0\265\265\0\335\335\0\335" + "\335\0ss\0\313\313\0\353\353\0\353\353\0ii\0\333\333\0\364\364\0\364\364" + "\0ZZ\0\351\351\0\371\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0" + "6" + "6\0\370\370\0\376\376\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16" + "\16\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376" + "\0\376\376\0\360\360\0\360\360\0\360\360\0\360\360\0\16\16\0\360\360\0\360" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\22\22\0\"\"\0" + "88\0" + "" + "88\0//\0OO\0pp\0pp\0WW\0\203\203\0\242\242\0\242\242\0qq\0\256\256\0\312" + "\312\0\301\301\0||\0\313\313\0\342\342\0\325\325\0yy\0\336\336\0\360\360" + "\0\342\342\0mm\0\353\353\0\367\367\0\354\354\0\\\\\0\363\363\0\373\373\0" + "\362\362\0JJ\0\371\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373" + "\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375" + "\0\360\360\0\374\374\0\360\360\0\376\376\0\16\16\0\360\360\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\22\22\0&&\0\"\"\0" + "88\0//\0PP\0HH\0gg\0NN" + "\0pp\0ee\0}}\0VV\0{{\0oo\0\202\202\0NN\0qq\0jj\0vv\0>>\0``\0\\\\\0cc\0,," + "\0MM\0KK\0OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0" + "\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7" + "\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360" + "\360\0\376\376\0\376\376\0\16\16\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" + "\0&&\0&&\0\"\"\0" + "66\0[[\0oo\0ee\0``\0\220\220\0\270\270\0\250\250\0xx\0" + "\250\250\0\327\327\0\311\311\0zz\0\246\246\0\341\341\0\325\325\0rr\0\230" + "\230\0\343\343\0\334\334\0gg\0\205\205\0\344\344\0\340\340\0[[\0rr\0\346" + "\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" + "" + "11\0" + "66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16" + "\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362\0\376" + "\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\22\22\0&&\0&&\0\37\37\0;;\0``\0``\0HH\0qq\0\237\237" + "\0\237\237\0nn\0\227\227\0\306\306\0\306\306\0}}\0\254\254\0\334\334\0\334" + "\334\0}}\0\275\275\0\347\347\0\347\347\0vv\0\316\316\0\357\357\0\357\357" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0&&\0##\0--\0``\0``\0TT\0cc\0\237\237\0\231\231\0||\0\223\223\0\306\306" + "\0\301\301\0\217\217\0\267\267\0\336\336\0\322\322\0\220\220\0\317\317\0" + "\352\352\0\334\334\0\202\202\0\337\337\0\362\362\0\345\345\0qq\0\353\353" + "\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371\371\0\375" + "\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376\376\0\376" + "\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0\376\376\0" + "\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0##\0" + "77\0--\0``\0PP\0nn\0[[\0\222\222\0kk\0\211\211\0qq\0\231\231\0" + "ff\0\210\210\0uu\0\217\217\0UU\0vv\0ll\0zz\0@@\0aa\0]]\0dd\0,,\0MM\0KK\0" + "OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0\33\33\0\33" + "\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2" + "\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\376" + "\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0##\0" + "77\0" + "77" + "\0--\0UU\0zz\0\216\216\0ww\0}}\0\254\254\0\324\324\0\264\264\0\207\207\0" + "\266\266\0\345\345\0\316\316\0\177\177\0\254\254\0\346\346\0\326\326\0rr" + "\0\231\231\0\344\344\0\334\334\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr" + "\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357" + "\357\0" + "11\0" + "66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0" + "\16\16\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362" + "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + "77\0" + "77\0--\0CC\0~~\0~~\0\\\\\0||\0" + "\274\274\0\274\274\0||\0\235\235\0\325\325\0\325\325\0\204\204\0\256\256" + "\0\340\340\0\340\340\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316" + "\0\360\360\0\360\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371" + "\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376" + "\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0" + "\360\360\0\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0&&\0" + "77\0" + "22\0--\0``\0vv\0pp\0gg\0\243\243\0\255\255" + "\0\225\225\0\231\231\0\311\311\0\314\314\0\235\235\0\271\271\0\337\337\0" + "\326\326\0\224\224\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362" + "\362\0\345\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373" + "\0\362\362\0JJ\0\371\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0" + "\373\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0" + "\375\375\0\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376" + "\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0" + "99\0``\0PP\0\200\200\0dd\0\222" + "\222\0kk\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm" + "\0zz\0@@\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0" + "))\0**\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0" + "\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16" + "\0\16\16\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0##\0" + "77\0" + "77\0" + "99\0^^\0zz\0\216\216\0\201\201\0\203" + "\203\0\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317" + "\0\200\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334" + "\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0" + "\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" + "11\0" + "66\0\364\364\0\364" + "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" + "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" + "\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" + "\0" + "77\0" + "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302" + "\302\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341" + "\341\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360" + "\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371" + "\0II\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376\0\376\376\0" + "\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0" + "\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0&&\0" + "77\0" + "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235" + "\0\234\234\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0" + "\225\225\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345" + "\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362" + "\0JJ\0\371\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373\373\0" + "\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0" + "\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0" + "99\0``\0PP\0\200\200\0dd\0\222\222\0kk" + "\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@" + "\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0))\0**\0" + "\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7" + "\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16" + "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0##\0" + "77\0" + "77\0" + "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0" + "\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200" + "\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg" + "\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352" + "\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" + "11\0" + "66\0\364\364\0\364\364" + "\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0" + "\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16" + "\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + "" + "77\0" + "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302" + "\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341" + "\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0" + "77\0" + "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0" + "99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" + "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" + "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" + "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" + "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" + "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0##\0" + "77\0" + "77\0" + "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" + "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" + "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" + "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" + "\352\0AA\0JJ\0\357\357\0\357\357\0" + "11\0" + "66\0\364\364\0\364\364\0\40\40" + "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" + "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" + "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + "77\0" + "" + "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" + "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" + "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0" + "77\0" + "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0" + "99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" + "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" + "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" + "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" + "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" + "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" + "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0##\0" + "77\0" + "77\0" + "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" + "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" + "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" + "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" + "\352\0AA\0JJ\0\357\357\0\357\357\0" + "11\0" + "66\0\364\364\0\364\364\0\40\40" + "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" + "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" + "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + "77\0" + "" + "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" + "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" + "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" + "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" + "\0\362\362\0\374\374\0\374\374\0" + "66\0\370\370\0\376\376\0\376\376\0\"\"" + "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" + "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "&&\0" + "77\0" + "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" + "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" + "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" + "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" + "\371\0\375\375\0\367\367\0" + "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" + "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" + "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0&&\0##\0FF\0" + "99\0``\0PP\0\213\213\0mm\0\237\237\0uu\0\275\275" + "\0\232\232\0\306\306\0\204\204\0\331\331\0\272\272\0\336\336\0\205\205\0" + "\345\345\0\320\320\0\352\352\0{{\0\355\355\0\337\337\0\362\362\0mm\0\363" + "\363\0\353\353\0\370\370\0\\\\\0\367\367\0\363\363\0\373\373\0II\0\373\373" + "\0\371\371\0\375\375\0" + "66\0\375\375\0\374\374\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\375\375\0\375\375" + "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0##\0" + "77\0" + "77\0" + "99\0gg\0\205\205\0\205\205\0ww\0\224\224\0" + "\310\310\0\310\310\0\247\247\0\240\240\0\354\354\0\354\354\0\306\306\0\227" + "\227\0\372\372\0\372\372\0\325\325\0\205\205\0\375\375\0\375\375\0\342\342" + "\0rr\0\376\376\0\376\376\0\354\354\0^^\0\376\376\0\376\376\0\363\363\0JJ" + "\0\376\376\0\376\376\0\370\370\0" + "66\0\376\376\0\376\376\0\374\374\0\"\"" + "\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375" + "\0\376\376\0\376\376\0\376\376\0\362\362\0\376\376\0\376\376\0\376\376\0" + "\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" + "77\0" + "77\0" + "11\0>>\0~~\0~~\0bb" + "\0__\0\261\261\0\261\261\0\212\212\0``\0\277\277\0\277\277\0\230\230\0SS" + "\0\275\275\0\275\275\0\233\233\0@@\0\273\273\0\273\273\0\240\240\0//\0\274" + "\274\0\274\274\0\252\252\0!!\0\301\301\0\301\301\0\266\266\0\25\25\0\311" + "\311\0\311\311\0\303\303\0\14\14\0\324\324\0\324\324\0\322\322\0\6\6\0\342" + "\342\0\342\342\0\341\341\0\1\1\0\361\361\0\361\361\0\361\361\0\15\15\0\15" + "\15\0\15\15\0\15\15\0\362\362\0\362\362\0\362\362\0\360\360\0\16\16\0\16" + "\16\0\16\16\0\2\2\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0&&\0" + "77\0" + "77\0\34\34\0SS\0kk\0\206\206\0BB\0\214\214\0\232\232" + "\0\302\302\0YY\0\250\250\0\255\255\0\340\340\0XX\0\264\264\0\264\264\0\355" + "\355\0SS\0\265\265\0\266\266\0\364\364\0JJ\0\270\270\0\272\272\0\371\371" + "\0AA\0\277\277\0\300\300\0\374\374\0" + "66\0\310\310\0\311\311\0\375\375\0" + "**\0\324\324\0\324\324\0\376\376\0\34\34\0\341\341\0\342\342\0\376\376\0" + "\15\15\0\361\361\0\361\361\0\376\376\0\361\361\0\15\15\0\15\15\0\376\376" + "\0\15\15\0\361\361\0\361\361\0\373\373\0\362\362\0\15\15\0\16\16\0\376\376" + "\0\16\16\0\361\361\0\376\376\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0&&\0&&\0" + "77\0))\0SS\0SS\0kk\0DD\0\205\205\0}}\0\222\222\0WW\0\241\241" + "\0\230\230\0\245\245\0XX\0\261\261\0\252\252\0\261\261\0SS\0\264\264\0\263" + "\263\0\265\265\0JJ\0\270\270\0\271\271\0\272\272\0AA\0\276\276\0\300\300" + "\0\300\300\0" + "66\0\310\310\0\311\311\0\311\311\0**\0\324\324\0\324\324\0" + "\324\324\0\34\34\0\341\341\0\342\342\0\342\342\0\15\15\0\361\361\0\361\361" + "\0\361\361\0\361\361\0\15\15\0\15\15\0\15\15\0\15\15\0\361\361\0\361\361" + "\0\361\361\0\362\362\0\15\15\0\16\16\0\16\16\0\16\16\0\361\361\0\376\376" + "\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0&&\0&&\0))\0pp\0cc\0cc" + "\0QQ\0\261\261\0\244\244\0\244\244\0ll\0\335\335\0\323\323\0\323\323\0ww" + "\0\364\364\0\356\356\0\356\356\0ss\0\370\370\0\371\371\0\371\371\0ii\0\372" + "\372\0\375\375\0\375\375\0YY\0\374\374\0\376\376\0\376\376\0HH\0\375\375" + "\0\376\376\0\376\376\0" + "66\0\376\376\0\376\376\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" + "\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\40\40\0QQ\0pp\0pp\0KK" + "\0\215\215\0\261\261\0\261\261\0pp\0\274\274\0\337\337\0\337\337\0\200\200" + "\0\332\332\0\364\364\0\364\364\0}}\0\350\350\0\373\373\0\373\373\0oo\0\361" + "\361\0\375\375\0\375\375\0]]\0\367\367\0\376\376\0\376\376\0JJ\0\373\373" + "\0\376\376\0\376\376\0" + "66\0\375\375\0\376\376\0\376\376\0\"\"\0\376\376" + "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" + "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" + "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" + "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\20\20\0" + "88\0WW\0pp\0" + "==\0ss\0\212\212\0\252\252\0dd\0\250\250\0\264\264\0\312\312\0rr\0\313\313" + "\0\315\315\0\331\331\0rr\0\340\340\0\331\331\0\340\340\0hh\0\355\355\0\341" + "\341\0\345\345\0YY\0\366\366\0\350\350\0\352\352\0HH\0\372\372\0\356\356" + "\0\357\357\0" + "66\0\375\375\0\364\364\0\364\364\0\"\"\0\376\376\0\371\371" + "\0\371\371\0\16\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361" + "\361\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\375\375\0" + "\376\376\0\375\375\0\374\374\0\360\360\0\376\376\0\376\376\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0&&\0\40\40\0" + "88\0" + "88\0WW\0BB\0ff" + "\0ZZ\0}}\0^^\0\226\226\0\201\201\0\241\241\0nn\0\301\301\0\246\246\0\277" + "\277\0rr\0\333\333\0\301\301\0\321\321\0ii\0\353\353\0\323\323\0\335\335" + "\0[[\0\365\365\0\341\341\0\346\346\0II\0\372\372\0\353\353\0\356\356\0" + "6" + "6\0\375\375\0\363\363\0\364\364\0\"\"\0\376\376\0\371\371\0\371\371\0\16" + "\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361\361\0\361\361" + "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\374\374\0\375\375\0\374" + "\374\0\374\374\0\361\361\0\376\376\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0" + "88\0" + "88\0BB\0~~\0ff\0ff\0" + "^^\0\256\256\0\226\226\0\226\226\0qq\0\325\325\0\277\277\0\277\277\0ss\0" + "\350\350\0\331\331\0\331\331\0jj\0\363\363\0\353\353\0\353\353\0[[\0\371" + "\371\0\365\365\0\365\365\0II\0\374\374\0\372\372\0\372\372\0" + "66\0\375\375" + "\0\375\375\0\375\375\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" + "\376\376\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\376" + "\376\0\361\361\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0HH\0" + "88\0BB\0~~\0~~\0ff\0^^\0\263" + "\263\0\263\263\0\231\231\0nn\0\330\330\0\330\330\0\274\274\0pp\0\353\353" + "\0\353\353\0\324\324\0hh\0\365\365\0\365\365\0\345\345\0ZZ\0\373\373\0\373" + "\373\0\361\361\0II\0\375\375\0\375\375\0\370\370\0" + "66\0\376\376\0\376\376" + "\0\374\374\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" + "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" + "\376\376\0\374\374\0\374\374\0\376\376\0\376\376\0\361\361\0\360\360\0\360" + "\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0" + "\0\0\0\0((\0HH\0\40\40\0\25\25\0QQ\0\207\207\0KK\0--\0}}\0\262\262\0bb\0" + "" + "44\0\235\235\0\320\320\0ff\0" + "00\0\257\257\0\341\341\0cc\0))\0\272\272" + "\0\354\354\0ZZ\0\37\37\0\303\303\0\363\363\0OO\0\26\26\0\314\314\0\370\370" + "\0AA\0\15\15\0\326\326\0\373\373\0" + "22\0\6\6\0\343\343\0\375\375\0!!\0\1" + "\1\0\362\362\0\376\376\0\16\16\0\16\16\0\16\16\0\375\375\0\375\375\0\375" + "\375\0\376\376\0\362\362\0\360\360\0\361\361\0\376\376\0\14\14\0\0\0\0\0" + "\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" + "\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0PP\0PP\0\10" + "\10\0\4\4\0dd\0dd\0\14\14\0\6\6\0xx\0xx\0\14\14\0\5\5\0\214\214\0\214\214" + "\0\13\13\0\4\4\0\240\240\0\240\240\0\10\10\0\2\2\0\264\264\0\264\264\0\5" + "\5\0\1\1\0\310\310\0\310\310\0\3\3\0\0\0\0\334\334\0\334\334\0\1\1\0\0\0" + "\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\0\0\0\0\0\14" + "\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0" + "\0<<\0<<\0\0\0\0\0\0\0XX\0XX\0\0\0\0\0\0\0pp\0pp\0\0\0\0\0\0\0\204\204\0" + "\204\204\0\0\0\0\0\0\0\227\227\0\227\227\0\0\0\0\0\0\0\250\250\0\250\250" + "\0\0\0\0\0\0\0\271\271\0\271\271\0\0\0\0\0\0\0\313\313\0\313\313\0\0\0\0" + "\0\0\0\335\335\0\335\335\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\1" + "\1\0\1\1\0\0\0\0\0\0\0\14\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" + "\24\24\0\24\24\0\0\0\0((\0((\0((\0\0\0\0<<\0HH\0HH\0\10\10\0PP\0dd\0dd\0" + "\14\14\0dd\0||\0||\0\14\14\0xx\0\221\221\0\221\221\0\13\13\0\214\214\0\243" + "\243\0\243\243\0\10\10\0\240\240\0\264\264\0\264\264\0\5\5\0\264\264\0\303" + "\303\0\303\303\0\3\3\0\310\310\0\322\322\0\322\322\0\1\1\0\334\334\0\341" + "\341\0\341\341\0\0\0\0\360\360\0\361\361\0\361\361\0\1\1\0\0\0\0\14\14\0" + "\14\14\0\14\14\0\0\0\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" + "\24\24\0\20\20\0\20\20\0" + "88\0" + "88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0" + "II\0\224\224\0\224\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302" + "\302\0HH\0HH\0\324\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0" + "00\0" + "00" + "\0\356\356\0\356\356\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16" + "\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0" + "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitAlpha test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitAlpha() +SDL_Surface *SDLTest_ImageBlitAlpha(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitAlpha.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitAlpha.pixel_data, SDLTest_imageBlitAlpha.width, SDLTest_imageBlitAlpha.height, SDLTest_imageBlitAlpha.bytes_per_pixel * 8, SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_imageBlitBlend.c b/src/test/SDL_test_imageBlitBlend.c index d57899edb7ade..946bf586a0602 100644 --- a/src/test/SDL_test_imageBlitBlend.c +++ b/src/test/SDL_test_imageBlitBlend.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,2821 +25,2923 @@ /* GIMP RGB C-Source image dump (alpha.c) */ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" - "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" - "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" - "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" - "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" - "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" - "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" - "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" - "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" - "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" - "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" - "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" - "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" - "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" + "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" + "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" + "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" + "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" + "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" + "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" + "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" + "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" + "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" + "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" + "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" + "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" + "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitBlendAdd test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlendAdd() +SDL_Surface *SDLTest_ImageBlitBlendAdd(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitBlendAdd.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitBlendAdd.pixel_data, SDLTest_imageBlitBlendAdd.width, SDLTest_imageBlitBlendAdd.height, SDLTest_imageBlitBlendAdd.bytes_per_pixel * 8, SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" - "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" - "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" - "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" - "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" - "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" - "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" - "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" - "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" - "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" - "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" - "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" - "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" - "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" - "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0""00\0PP" - "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP" - "\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP\0PP\0PP\0""00\0PP" - "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0" - "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324" - "\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0" - "\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225" - "\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177" - "\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0" - "\177\177\0\225\225\0\324\324\0\321\321\0\222\222\0\222\222\0\321\321\0\314" - "\314\0\351\351\0\351\351\0\254\254\0\236\236\0\305\305\0\305\305\0aa\0<<" - "\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0dd\0\240\240\0\240\240\0aa\0\255\255" - "\0\322\322\0\322\322\0\177\177\0\315\315\0\343\343\0\343\343\0\211\211\0" - "\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211" - "\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346" - "\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0" - "\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346" - "\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\320\320" - "\0\327\327\0\327\327\0\322\322\0\276\276\0\322\322\0\322\322\0\305\305\0" - "yy\0\210\210\0\210\210\0dd\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0\210\210\0\240" - "\240\0\240\240\0aa\0\266\266\0\322\322\0\322\322\0\205\205\0\327\327\0\343" - "\343\0\343\343\0\215\215\0\346\346\0\357\357\0\331\331\0\222\222\0\347\347" - "\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0" - "\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222" - "\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331" - "\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0" - "\331\331\0\222\222\0\357\357\0\346\346\0\320\320\0\351\351\0\327\327\0\343" - "\343\0\276\276\0\333\333\0\322\322\0\266\266\0yy\0\240\240\0\210\210\0\240" - "\240\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0<<\0\240\240\0\210\210\0\240\240\0aa\0ww\0nn\0\177" - "\177\0MM\0SS\0OO\0SS\0""22\0WW\0TT\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0" - "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0" - "XX\0""55\0UU\0UU\0XX\0""55\0UU\0UU\0XX\0""55\0UU\0XX\0TT\0TT\0LL\0OO\0SS" - "\0SS\0ss\0\177\177\0nn\0nn\0yy\0\210\210\0\240\240\0\240\240\0<<\0dd\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<" - "\0\240\240\0\240\240\0\210\210\0HH\0\205\205\0\351\351\0\333\333\0pp\0\225" - "\225\0\371\371\0\363\363\0\202\202\0\231\231\0\330\330\0\325\325\0\203\203" - "\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0" - "\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324" - "\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331" - "\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0" - "\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\325\325\0\231\231\0\231" - "\231\0\330\330\0\323\323\0\371\371\0\371\371\0\274\274\0\257\257\0\351\351" - "\0\351\351\0\205\205\0``\0\240\240\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\240\240" - "\0\240\240\0RR\0\207\207\0\304\304\0\304\304\0nn\0\275\275\0\343\343\0\343" - "\343\0\205\205\0\324\324\0\352\352\0\352\352\0\214\214\0\316\316\0\352\352" - "\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0" - "\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316" - "\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213" - "\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0" - "\213\213\0\316\316\0\352\352\0\352\352\0\214\214\0\324\324\0\336\336\0\336" - "\336\0\331\331\0\310\310\0\343\343\0\343\343\0\325\325\0\217\217\0\254\254" - "\0\254\254\0\207\207\0aa\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0aa" - "\0\225\225\0\304\304\0\304\304\0\205\205\0\276\276\0\343\343\0\340\340\0" - "\222\222\0\333\333\0\352\352\0\351\351\0\226\226\0\347\347\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\366\366\0\336\336\0\351\351\0\304\304\0\351\351\0\343\343\0\304\304\0\217" - "\217\0\333\333\0\254\254\0\266\266\0aa\0\240\240\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\305\305\0\225\225\0\304\304\0ww\0\205\205\0ss\0\211\211\0RR\0VV\0PP\0" - "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0||\0\217\217\0\254\254\0\266\266\0\305\305\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\225\225\0UU\0\222\222\0\366\366\0\340\340\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0mm\0\266\266\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\214\214\0\321\321\0\321\321\0rr\0\277\277\0\346\346\0\346" - "\346\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\331\331\0\312\312\0\346\346\0\346\346\0\330\330\0\224\224\0\271\271" - "\0\271\271\0\217\217\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\222\222\0\277\277\0\343\343\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\336\336\0\352\352\0\306\306\0\354\354\0\344\344\0\305\305\0\227" - "\227\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0""33\0XX\0UU\0YY\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0XX\0""66\0UU\0UU\0" - "XX\0""66\0UU\0UU\0XX\0""66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\340\340\0\300\300\0\343\343\0\210\210" - "\0\354\354\0\333\333\0\352\352\0\215\215\0\361\361\0\350\350\0\362\362\0" - "\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361" - "\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351" - "\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0" - "\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351" - "\351\0\351\351\0\361\361\0\223\223\0\351\351\0\362\362\0\351\351\0\351\351" - "\0\323\323\0\336\336\0\351\351\0\351\351\0\304\304\0\343\343\0\305\305\0" - "\317\317\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0\222\222\0\361\361\0\361\361\0\316\316\0\230\230" - "\0\373\373\0\373\373\0\344\344\0\231\231\0\375\375\0\375\375\0\357\357\0" - "\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347" - "\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375" - "\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0" - "\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375" - "\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\360\360\0\373\373" - "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0" - "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" - "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" - "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" - "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" - "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" - "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" - "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" - "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" - "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" - "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" - "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" - "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" - "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" - "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" - "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" - "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" - "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" - "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" - "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" - "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" - "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" - "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" - "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" - "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" - "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" - "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" - "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" - "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" - "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" - "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" - "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" - "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" - "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" - "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" - "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" - "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" - "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" - "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" - "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" - "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" - "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" - "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" - "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" - "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" - "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" - "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" - "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" - "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" - "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" - "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" - "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" - "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" - "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" - "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" - "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" - "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" - "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" - "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" - "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" - "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" - "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" - "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" - "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" - "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" - "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" - "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" - "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" - "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" - "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" - "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" - "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" - "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" - "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" - "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" - "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" - "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" - "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" - "\0""11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" - "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" - "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" - "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" - "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" - "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" - "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" - "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" - "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" - "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" - "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" - "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" - "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" - "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" - "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" - "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" - "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" + "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" + "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" + "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" + "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" + "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" + "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" + "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" + "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" + "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" + "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" + "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" + "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" + "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" + "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0" + "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324" + "\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0" + "\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225" + "\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177" + "\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0" + "\177\177\0\225\225\0\324\324\0\321\321\0\222\222\0\222\222\0\321\321\0\314" + "\314\0\351\351\0\351\351\0\254\254\0\236\236\0\305\305\0\305\305\0aa\0<<" + "\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0dd\0\240\240\0\240\240\0aa\0\255\255" + "\0\322\322\0\322\322\0\177\177\0\315\315\0\343\343\0\343\343\0\211\211\0" + "\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211" + "\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346" + "\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0" + "\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346" + "\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\320\320" + "\0\327\327\0\327\327\0\322\322\0\276\276\0\322\322\0\322\322\0\305\305\0" + "yy\0\210\210\0\210\210\0dd\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0\210\210\0\240" + "\240\0\240\240\0aa\0\266\266\0\322\322\0\322\322\0\205\205\0\327\327\0\343" + "\343\0\343\343\0\215\215\0\346\346\0\357\357\0\331\331\0\222\222\0\347\347" + "\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0" + "\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222" + "\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331" + "\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0" + "\331\331\0\222\222\0\357\357\0\346\346\0\320\320\0\351\351\0\327\327\0\343" + "\343\0\276\276\0\333\333\0\322\322\0\266\266\0yy\0\240\240\0\210\210\0\240" + "\240\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0<<\0\240\240\0\210\210\0\240\240\0aa\0ww\0nn\0\177" + "\177\0MM\0SS\0OO\0SS\0" + "22\0WW\0TT\0XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0UU\0" + "XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0UU\0" + "XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0UU\0XX\0" + "55\0UU\0XX\0TT\0TT\0LL\0OO\0SS" + "\0SS\0ss\0\177\177\0nn\0nn\0yy\0\210\210\0\240\240\0\240\240\0<<\0dd\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<" + "\0\240\240\0\240\240\0\210\210\0HH\0\205\205\0\351\351\0\333\333\0pp\0\225" + "\225\0\371\371\0\363\363\0\202\202\0\231\231\0\330\330\0\325\325\0\203\203" + "\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0" + "\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324" + "\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331" + "\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0" + "\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\325\325\0\231\231\0\231" + "\231\0\330\330\0\323\323\0\371\371\0\371\371\0\274\274\0\257\257\0\351\351" + "\0\351\351\0\205\205\0``\0\240\240\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\240\240" + "\0\240\240\0RR\0\207\207\0\304\304\0\304\304\0nn\0\275\275\0\343\343\0\343" + "\343\0\205\205\0\324\324\0\352\352\0\352\352\0\214\214\0\316\316\0\352\352" + "\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0" + "\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316" + "\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213" + "\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0" + "\213\213\0\316\316\0\352\352\0\352\352\0\214\214\0\324\324\0\336\336\0\336" + "\336\0\331\331\0\310\310\0\343\343\0\343\343\0\325\325\0\217\217\0\254\254" + "\0\254\254\0\207\207\0aa\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0aa" + "\0\225\225\0\304\304\0\304\304\0\205\205\0\276\276\0\343\343\0\340\340\0" + "\222\222\0\333\333\0\352\352\0\351\351\0\226\226\0\347\347\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\366\366\0\336\336\0\351\351\0\304\304\0\351\351\0\343\343\0\304\304\0\217" + "\217\0\333\333\0\254\254\0\266\266\0aa\0\240\240\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\305\305\0\225\225\0\304\304\0ww\0\205\205\0ss\0\211\211\0RR\0VV\0PP\0" + "VV\0" + "33\0XX\0UU\0YY\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0||\0\217\217\0\254\254\0\266\266\0\305\305\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\225\225\0UU\0\222\222\0\366\366\0\340\340\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0mm\0\266\266\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\214\214\0\321\321\0\321\321\0rr\0\277\277\0\346\346\0\346" + "\346\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\331\331\0\312\312\0\346\346\0\346\346\0\330\330\0\224\224\0\271\271" + "\0\271\271\0\217\217\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\222\222\0\277\277\0\343\343\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\336\336\0\352\352\0\306\306\0\354\354\0\344\344\0\305\305\0\227" + "\227\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0" + "33\0XX\0UU\0YY\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0" + "33\0XX\0UU\0YY\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0" + "33\0XX\0UU\0YY\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" + "VV\0" + "33\0XX\0UU\0YY\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0UU\0" + "XX\0" + "66\0UU\0UU\0XX\0" + "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" + "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" + "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" + "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" + "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" + "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" + "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" + "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" + "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" + "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" + "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" + "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" + "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" + "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" + "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" + "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" + "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" + "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" + "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" + "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" + "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" + "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" + "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" + "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" + "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" + "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" + "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" + "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" + "\0\333\333\0\236\236\0\304\304\0ww\0\340\340\0\300\300\0\343\343\0\210\210" + "\0\354\354\0\333\333\0\352\352\0\215\215\0\361\361\0\350\350\0\362\362\0" + "\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361" + "\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351" + "\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0" + "\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351" + "\351\0\351\351\0\361\361\0\223\223\0\351\351\0\362\362\0\351\351\0\351\351" + "\0\323\323\0\336\336\0\351\351\0\351\351\0\304\304\0\343\343\0\305\305\0" + "\317\317\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" + "\305\0\305\305\0\236\236\0\222\222\0\361\361\0\361\361\0\316\316\0\230\230" + "\0\373\373\0\373\373\0\344\344\0\231\231\0\375\375\0\375\375\0\357\357\0" + "\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347" + "\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375" + "\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0" + "\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375" + "\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\360\360\0\373\373" + "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0" + "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" + "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" + "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" + "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" + "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" + "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" + "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" + "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" + "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" + "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" + "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" + "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" + "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" + "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" + "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" + "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" + "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" + "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" + "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" + "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" + "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" + "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" + "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" + "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" + "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" + "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" + "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" + "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" + "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" + "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" + "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" + "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" + "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" + "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" + "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" + "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" + "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" + "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" + "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" + "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" + "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" + "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" + "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" + "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" + "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" + "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" + "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" + "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" + "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" + "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" + "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" + "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" + "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" + "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" + "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" + "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" + "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" + "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" + "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" + "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" + "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" + "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" + "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" + "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" + "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" + "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" + "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" + "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" + "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" + "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" + "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" + "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" + "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" + "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" + "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" + "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" + "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" + "\0" + "11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" + "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" + "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" + "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" + "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" + "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" + "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" + "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" + "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" + "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" + "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" + "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" + "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" + "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" + "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" + "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" + "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitBlend test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlend() +SDL_Surface *SDLTest_ImageBlitBlend(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitBlend.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitBlend.pixel_data, SDLTest_imageBlitBlend.width, SDLTest_imageBlitBlend.height, SDLTest_imageBlitBlend.bytes_per_pixel * 8, SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitBlendMod test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlendMod() +SDL_Surface *SDLTest_ImageBlitBlendMod(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitBlendMod.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitBlendMod.pixel_data, SDLTest_imageBlitBlendMod.width, SDLTest_imageBlitBlendMod.height, SDLTest_imageBlitBlendMod.bytes_per_pixel * 8, SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { - 80, 60, 3, - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0" - "\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377", + 80, + 60, + 3, + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377", }; /** * \brief Returns the BlitBlendNone test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlendNone() +SDL_Surface *SDLTest_ImageBlitBlendNone(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitBlendNone.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitBlendNone.pixel_data, SDLTest_imageBlitBlendNone.width, SDLTest_imageBlitBlendNone.height, SDLTest_imageBlitBlendNone.bytes_per_pixel * 8, SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\0\0\0\0\0" - "\0\11\0\0\11\0\0\0\0\0\0\0\0\16\0\0\16\0\0\0\0\0\0\0\0\11\0\0\11\0\0\0\0" - "\0\0\0\0\14\0\0\14\0\0\0\0\0\0\0\0\17\0\0\17\0\0\0\0\0\0\0\0\21\0\0\21\0" - "\0\0\0\0\0\0\0K\0\0K\0\0\0\0\0\0\0\0T\0\0T\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0" - "\0\0\0\0g\0\0g\0\0\0\0\0\0\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11" - "\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\11\0\0\0\0\0\14\0\0\14" - "\0\0\14\0\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24" - "\0\0\24\0\0K\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0" - "\0g\0\0\0\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11\0\0\0\0\0" - "\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\22\0\0\0\0\0\14\0\0\14\0\0\14\0" - "\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24\0\0\24" - "\0\0\24\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0\0g\0" - "\0\0\0\0q\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\10\0\0\10\0\0\10\0\0\0\0\0\15" - "\0\0\15\0\0\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0J\0\0J\0\0J\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1" - "\0\0\4\0\0\4\0\0\0\0\0\0\0\0\7\0\0\7\0\0\0\0\0\0\0\0&\0\0&\0\0\32\0\0\32" - "\0\0&\0\0&\0\0&\0\0&\0\0C\0\0C\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0\0\0\0\17\251" - "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\0\0\0\0" - "\0\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\6\2\0\6\2\0\0\1\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0" - "\17\0\0\0\0\0\4\0\0\11\0\0\11\0\0\0\0\6+\0\6+\0\0&\0\0\32\0\0&\0\0&\0\0&" - "\0\0&\0\0""5\0\0""5\0\2\210\0\0\0\0\0C\0\0|\0\0|\0\0\0\0\17\251\0\17\251" - "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251" - "\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" - "\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\6\2\0\6\2\0\6\2\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1" - "\0\0\1\0\0\0\0\0\17\0\0\17\0\0\4\0\0\0\0\6+\0\6+\0\6+\0\0\32\0\0&\0\0&\0" - "\0&\0\0&\0\0""5\0\0""5\0\0""5\0\0\0\0\2\210\0\2\210\0\0C\0\0\0\0\17\251\0" - "\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0" - "\17\251\0\17\251\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "$\360\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0" - "\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\1\0\14\1\0\14\1" - "\0\14\1\0\15\1\0\15\1\0\0\0\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16" - "\2\0\0\0\0\0\0\0\14!\0\14!\0\14!\0\14!\0\17(\0\17(\0\0\0\0\0\0\0\14+\0\14" - "+\0\14+\0\14+\0\20""9\0\20""9\0\0\0\0\0\0\0\36\215\0\36\215\0\36\215\0\36" - "\215\0(\264\0(\264\0\0\0\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251" - "\0\36\251\0\36\251\0\36\251\0\0\0\0\0\0\0$\360\0$\360\0$\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3" - "\0\36\3\0\14\1\0\14\1\0\15\1\0\15\1\0\15\1\0\0\0\0\14\2\0\14\2\0\14\2\0\14" - "\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14\3\0\14!\0\14!\0\17(\0\17(\0\17" - "(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0\20""9\0\20""9\0\0\0\0\14""7\0\14" - """7\0\36\215\0\36\215\0(\264\0(\264\0(\264\0\0\0\0\36\251\0\36\251\0\36\251" - "\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0H\360\0" - "H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3\0\36\3\0\36\3\0\14\1\0\15\1\0\15\1\0\15\1" - "\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14" - "\3\0\14\3\0\14!\0\17(\0\17(\0\17(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20""9\0" - "\20""9\0\20""9\0\0\0\0\14""7\0\14""7\0\14""7\0\36\215\0(\264\0(\264\0(\264" - "\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36" - "\251\0\36\251\0\36\251\0\36\251\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\1\0\13\1\0\13\1\0\13\1\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11!\0" - "\11!\0\11!\0\11!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\23n\0\23n\0\23n\0\23n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\1\0\1\1\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\0\25\0\0\25\0\0\27\0" - "\0\13\0\0\13\0\0\1\0\0\11\0\0\4\0\0\4\0\0\0\0\0\0\0\0\25\3\0\25\3\0\0\0\0" - "\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\3\1\0\3\1\0\2\1\0\7\5\0\7\3\0\7\3\0\0" - "\0\0\0\0\0\25""4\0\25""4\0\0\0\0\0\0\0\25""4\0\25""4\0\25""4\0\25""4\0\20" - "\35\0\20\35\0\11\22\0\23F\0\34""6\0\34""6\0\0\0\0\0\0\0L\317\0L\317\0L\317" - "\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0\0\0\0""2\317\0""2\317\0""2\317" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0\0\0\0\0\0\0\0\0\25\0\0\25" - "\0\0\25\0\0\4\0\0\5\0\0\2\0\0\1\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7\0\37\7" - "\0\25\3\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\15\4\0\11\3\0\7" - "\3\0\14\10\0\14\10\0\0\0\0\25\16\0\25\16\0\25""4\0\0\0\0\25""4\0\25""4\0" - "\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0\34""6\0&j\0&j\0\0\0\0""5q\0""5q\0L\317" - "\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0""2" - "\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\1\0\0\0\0\0\0\0\25\0" - "\0\25\0\0\25\0\0\31\1\0\5\0\0\5\0\0\2\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7" - "\0\37\7\0\37\7\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\37\6\0\11" - "\3\0\16\6\0\16\6\0\7\3\0\0\0\0\25\16\0\25\16\0\25\16\0\0\0\0\25""4\0\25""4" - "\0\25""4\0\25""4\0&Q\0&Q\0&Q\0\31""5\0+X\0+X\0\34""6\0\0\0\0""5q\0""5q\0" - """5q\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317" - "\0L\317\0\0\0\0""2\317\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0" - "\0\0\0\0\25\0\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0L\317\0L\317\0L\317\0L\317" - "\0\0\0\0""2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0e\4\0e\4\0\0\0\0\0\0\0e\11\0e\11\0\0\0\0\0\0\0e\16\0e\16\0\0\0\0\0\0" - "\0G\11\0G\11\0\0\0\0\0\0\0G\14\0G\14\0\0\0\0\0\0\0G\17\0G\17\0\0\0\0\0\0" - "\0G\21\0G\21\0\0\0\0\0\0\0GK\0GK\0\0\0\0\0\0\0GT\0GT\0\0\0\0\0\0\0G^\0G^" - "\0\0\0\0\0\0\0Gg\0Gg\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" - "\0e\317\0e\317\0\0\0\0\0\0\0L\317\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0e\4\0e\4\0e\4\0\0\0\0e\11\0e\11\0e\11\0\0\0" - "\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0G\11\0\0\0\0G\14\0G\14\0G\14\0\0\0" - "\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0\0G\24\0G\24\0GK\0\0\0\0" - "GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg\0\0\0\0Gq\0Gq\0e\317\0e\317" - "\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0\0\0\0L\317\0L" - "\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0e\4\0e\4\0e\4\0\0\0" - "\0e\11\0e\11\0e\11\0\0\0\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0e\22\0\0\0" - "\0G\14\0G\14\0G\14\0\0\0\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0" - "\0G\24\0G\24\0G\24\0\0\0\0GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg" - "\0\0\0\0Gq\0Gq\0Gq\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" - "\0e\317\0e\317\0e\317\0\0\0\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0e\4\0e\4\0e\4\0\0\0\0b\10\0b\10\0b\10\0\0\0\0b\15\0b\15\0b\15\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0<\16\0<\16\0<\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0""2J\0""2J\0""2J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e" - "\317\0\0\0\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0c\0\0c\0\0\0\0\0" - "`\0\0c\0\0c\0\0\2\0\0c\1\0i\0\0i\0\0\0\0\0\0\0\0e\0\0e\0\0\0\0\0\0\0\0{\1" - "\0{\1\0f\0\0f\0\0z\1\0z\1\0z\1\0z\1\0)\4\0)\4\0\0\0\0\0\0\0Q\7\0Q\7\0\0\0" - "\0\0\0\0{&\0{&\0W\32\0W\32\0z&\0z&\0z&\0z&\0IC\0IC\0\0\0\0\0\0\0X^\0X^\0" - "\0\0\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0" - "\261\251\0\261\251\0\0\0\0\0\0\0e\317\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\216\1\0c\0\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0k\1\0i\0\0" - "\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0{\1\0f\0\0z\1\0z\1\0z\1\0z\1" - "\0\221\1\0\221\1\0\221\17\0\0\0\0)\4\0c\11\0c\11\0\0\0\0\256+\0\256+\0{&" - "\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\243\210\0\0\0\0IC\0{|\0{|\0\0\0\0" - "\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261" - "\251\0\261\251\0\261\251\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0" - "k\1\0k\1\0\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0\256\2\0f\0\0z\1\0" - "z\1\0z\1\0z\1\0\221\1\0\221\1\0\221\1\0\0\0\0\221\17\0\221\17\0)\4\0\0\0" - "\0\256+\0\256+\0\256+\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\2415\0\0\0\0" - "\243\210\0\243\210\0IC\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261" - "\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\264\360" - "\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1" - "\0\211\1\0c\0\0\2\0\0c\0\0c\0\0k\0\0\12\0\0k\1\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0\264\360" - "\0\264\360\0\264\360\0\0\0\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216\1" - "\0c\0\0\2\0\0c\0\0k\0\0q\0\0\20\0\0\0\0\0\0\0\0\322\1\0\322\1\0\322\1\0\322" - "\1\0\346\1\0\346\1\0\0\0\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0" - "\363\2\0\0\0\0\0\0\0\322!\0\322!\0\322!\0\322!\0\371(\0\371(\0\0\0\0\0\0" - "\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\0\0\0\0\0\0\325\215\0\325\215" - "\0\325\215\0\325\215\0\374\264\0\374\264\0\0\0\0\0\0\0\325\251\0\325\251" - "\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\0\0\0\0\0" - "\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216" - "\1\0c\0\0\2\0\0f\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\322\1\0\322\1\0\346" - "\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0\363\2" - "\0\363\2\0\0\0\0\322\3\0\322\3\0\322!\0\322!\0\371(\0\371(\0\371(\0\0\0\0" - "\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\3227\0\3227\0\325" - "\215\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0\325\251\0" - "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" - "\251\0\330\360\0\330\360\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\216\1\0\216\1\0c\0\0\10\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\325" - "\3\0\322\1\0\346\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2" - "\0\363\2\0\363\2\0\363\2\0\0\0\0\322\3\0\322\3\0\322\3\0\322!\0\371(\0\371" - "(\0\371(\0\0\0\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\322" - "7\0\3227\0\3227\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0" - "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" - "\251\0\325\251\0\325\251\0\330\360\0\330\360\0\330\360\0\0\0\0\264\360\0" - "\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0i\0\0\10\0\0m\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\275\1\0\275\1\0\275\1\0" - "\275\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\244!\0\244!\0\244!\0\244!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213n\0\213n\0\213n\0\213n\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" - "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\224\1\0i\0\0\10\0" - "\0\0\0\0\0\0\0\325\3\0\325\3\0\325\3\0\351\3\0\365\1\0\365\1\0\14\0\0\313" - "\2\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0\304-\0Y!\0Y!\0\0\0\0\0\0\0\371p\0" - "\371p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0\247\227\0\211" - "s\0\211s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\224\1\0i\0\0\0\0\0\0\0\0\325\3\0\325" - "\3\0\325\3\0\17\2\0\"\2\0!\0\0\35\0\0#\2\0\342\4\0\342\4\0\0\0\0\371\37\0" - "\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775" - "\0\374%\0\304\34\0Y!\0\373C\0\373C\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371" - "p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\211s\0\375" - "\342\0\375\342\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" - "\0\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\224\1\0\0\0" - "\0\0\0\0\325\3\0\325\3\0\325\3\0\344\5\0\"\2\0\"\2\0\200\0\0#\2\0\342\4\0" - "\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\371\37\0\3775\0\3775\0\3775\0\304\34\0\3732\0\3732\0Y!\0\0\0\0\371p\0" - "\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377" - "\256\0\247q\0\375\274\0\375\274\0\211s\0\0\0\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\12\0\0\0\0\0i\0\0\0\0\0\325\3\0\325\3\0\344\5\0\344\5" - "\0\"\2\0\36\1\0""4\2\0#\2\0\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0" - "\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\3732\0" - "\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371" - "p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0" - "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0" - "\10\0\0\0\0\0\325\3\0\344\5\0\344\5\0\344\5\0\340\4\0\367\11\0\364\3\0#\2" - "\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371" - "\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\3732\0\3732\0\0\0\0\371p\0\371p" - "\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0" - "\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\10\0\0\0\0\0\0\0\0\17\2\0\17" - "\2\0\17\2\0\323\2\0\352\7\0\347\2\0\26\1\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0\0\0\0""7\36\0""6\25\0" - """6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0" - "O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\12\0" - "\0\10\0\0\0\0\0\17\2\0\17\2\0\344\5\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0" - "\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\362\4\0\0\0\0/\26\0/\26\0" - "\3775\0$\21\0""7\36\0""7\36\0\3672\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0" - "\0\0\0\0\370A\0\0\0\0O>\0O>\0\377\256\0""3(\0VK\0VK\0\372\264\0\0\0\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\341\271\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\343\350\0\0\0\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\10\0\0\0\0" - "\0\17\2\0\17\2\0\17\2\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0\0\371\37\0\371" - "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0$\21\0""7\36" - "\0""7\36\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0O>\0O>\0O>\0""3(\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\5\0\0\5\0\0\5\0\0\0\0\0\344\5\0\344\5\0\344\5\0\316\4\0\367" - "\11\0\367\11\0\364\3\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371" - "\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0" - "\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377" - "\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" - "\0\0\5\0\0\5\0\0\17\2\0\344\5\0\344\5\0\316\4\0\345\11\0\367\11\0\364\3\0" - "\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37" - "\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371" - "p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q" - "\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\0\0\0\17\2" - "\0\344\5\0\344\5\0\15\1\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37\0\371\37\0" - "\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0\307)\0\376" - "G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0" - "\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0" - "\5\0\0\17\2\0\17\2\0\344\5\0\316\4\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0" - "\307)\0\376G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" - "p\0\371p\0\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\5\0\0\24\2\0\17\2\0\17\2\0\316\4\0\345\11\0$\6\0#\2\0\0\0\0\371" - "\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0" - "\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0" - "\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274" - "\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\24\2\0\24" - "\2\0\17\2\0\316\4\0\345\11\0\342\3\0#\2\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0" - "\376G\0\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" - "p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274" - "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\24\2\0\5\0\0\0\0\0\27\5\0\342\3\0\313" - "\1\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\371\37\0\0\0\0\0\0\0/\26\0" - "\3775\0\371\37\0\302\30\0\3716\0Y!\0#\14\0\0\0\0\371p\0\371p\0\0\0\0\0\0" - "\0\0\0\0\371p\0\0\0\0\0\0\0O>\0\377\256\0\371p\0\243I\0\371\224\0\211s\0" - """3(\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0\0\371" - "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0\0\0\0" - "\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374" - "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0" - "\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0" - "\0\0\0\0""6\25\0""6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\16\0\0\0\0\0\26\1\0\26\1\0\26" - "\1\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0" - "/\26\0.\17\0\0\0\0""6\25\0""6\25\0""6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360" - "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\14\0\0\14" - "\0\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0#\14\0Y!\0Y!\0\0\0\0\0\0\0\371p\0\371" - "p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0""3(\0""3(\0\211s\0\211" - "s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\0\0\0\0\0" + "\0\11\0\0\11\0\0\0\0\0\0\0\0\16\0\0\16\0\0\0\0\0\0\0\0\11\0\0\11\0\0\0\0" + "\0\0\0\0\14\0\0\14\0\0\0\0\0\0\0\0\17\0\0\17\0\0\0\0\0\0\0\0\21\0\0\21\0" + "\0\0\0\0\0\0\0K\0\0K\0\0\0\0\0\0\0\0T\0\0T\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0" + "\0\0\0\0g\0\0g\0\0\0\0\0\0\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11" + "\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\11\0\0\0\0\0\14\0\0\14" + "\0\0\14\0\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24" + "\0\0\24\0\0K\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0" + "\0g\0\0\0\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11\0\0\0\0\0" + "\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\22\0\0\0\0\0\14\0\0\14\0\0\14\0" + "\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24\0\0\24" + "\0\0\24\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0\0g\0" + "\0\0\0\0q\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\10\0\0\10\0\0\10\0\0\0\0\0\15" + "\0\0\15\0\0\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0J\0\0J\0\0J\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\317" + "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1" + "\0\0\4\0\0\4\0\0\0\0\0\0\0\0\7\0\0\7\0\0\0\0\0\0\0\0&\0\0&\0\0\32\0\0\32" + "\0\0&\0\0&\0\0&\0\0&\0\0C\0\0C\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0\0\0\0\17\251" + "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\0\0\0\0" + "\0\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\6\2\0\6\2\0\0\1\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0" + "\17\0\0\0\0\0\4\0\0\11\0\0\11\0\0\0\0\6+\0\6+\0\0&\0\0\32\0\0&\0\0&\0\0&" + "\0\0&\0\0" + "5\0\0" + "5\0\2\210\0\0\0\0\0C\0\0|\0\0|\0\0\0\0\17\251\0\17\251" + "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251" + "\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" + "\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\6\2\0\6\2\0\6\2\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1" + "\0\0\1\0\0\0\0\0\17\0\0\17\0\0\4\0\0\0\0\6+\0\6+\0\6+\0\0\32\0\0&\0\0&\0" + "\0&\0\0&\0\0" + "5\0\0" + "5\0\0" + "5\0\0\0\0\2\210\0\2\210\0\0C\0\0\0\0\17\251\0" + "\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0" + "\17\251\0\17\251\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "$\360\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0" + "\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\1\0\14\1\0\14\1" + "\0\14\1\0\15\1\0\15\1\0\0\0\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16" + "\2\0\0\0\0\0\0\0\14!\0\14!\0\14!\0\14!\0\17(\0\17(\0\0\0\0\0\0\0\14+\0\14" + "+\0\14+\0\14+\0\20" + "9\0\20" + "9\0\0\0\0\0\0\0\36\215\0\36\215\0\36\215\0\36" + "\215\0(\264\0(\264\0\0\0\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251" + "\0\36\251\0\36\251\0\36\251\0\0\0\0\0\0\0$\360\0$\360\0$\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3" + "\0\36\3\0\14\1\0\14\1\0\15\1\0\15\1\0\15\1\0\0\0\0\14\2\0\14\2\0\14\2\0\14" + "\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14\3\0\14!\0\14!\0\17(\0\17(\0\17" + "(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20" + "9\0\20" + "9\0\20" + "9\0\0\0\0\14" + "7\0\14" + "" + "7\0\36\215\0\36\215\0(\264\0(\264\0(\264\0\0\0\0\36\251\0\36\251\0\36\251" + "\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0H\360\0" + "H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3\0\36\3\0\36\3\0\14\1\0\15\1\0\15\1\0\15\1" + "\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14" + "\3\0\14\3\0\14!\0\17(\0\17(\0\17(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20" + "9\0" + "\20" + "9\0\20" + "9\0\0\0\0\14" + "7\0\14" + "7\0\14" + "7\0\36\215\0(\264\0(\264\0(\264" + "\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36" + "\251\0\36\251\0\36\251\0\36\251\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\1\0\13\1\0\13\1\0\13\1\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11!\0" + "\11!\0\11!\0\11!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\23n\0\23n\0\23n\0\23n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\1\0\1\1\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\0\25\0\0\25\0\0\27\0" + "\0\13\0\0\13\0\0\1\0\0\11\0\0\4\0\0\4\0\0\0\0\0\0\0\0\25\3\0\25\3\0\0\0\0" + "\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\3\1\0\3\1\0\2\1\0\7\5\0\7\3\0\7\3\0\0" + "\0\0\0\0\0\25" + "4\0\25" + "4\0\0\0\0\0\0\0\25" + "4\0\25" + "4\0\25" + "4\0\25" + "4\0\20" + "\35\0\20\35\0\11\22\0\23F\0\34" + "6\0\34" + "6\0\0\0\0\0\0\0L\317\0L\317\0L\317" + "\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0\0\0\0" + "2\317\0" + "2\317\0" + "2\317" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0\0\0\0\0\0\0\0\0\25\0\0\25" + "\0\0\25\0\0\4\0\0\5\0\0\2\0\0\1\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7\0\37\7" + "\0\25\3\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\15\4\0\11\3\0\7" + "\3\0\14\10\0\14\10\0\0\0\0\25\16\0\25\16\0\25" + "4\0\0\0\0\25" + "4\0\25" + "4\0" + "\25" + "4\0\25" + "4\0&Q\0&Q\0&Q\0\31" + "5\0\34" + "6\0&j\0&j\0\0\0\0" + "5q\0" + "5q\0L\317" + "\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0" + "2" + "\317\0" + "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\1\0\0\0\0\0\0\0\25\0" + "\0\25\0\0\25\0\0\31\1\0\5\0\0\5\0\0\2\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7" + "\0\37\7\0\37\7\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\37\6\0\11" + "\3\0\16\6\0\16\6\0\7\3\0\0\0\0\25\16\0\25\16\0\25\16\0\0\0\0\25" + "4\0\25" + "4" + "\0\25" + "4\0\25" + "4\0&Q\0&Q\0&Q\0\31" + "5\0+X\0+X\0\34" + "6\0\0\0\0" + "5q\0" + "5q\0" + "" + "5q\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317" + "\0L\317\0\0\0\0" + "2\317\0" + "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0" + "\0\0\0\0\25\0\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0L\317\0L\317\0L\317\0L\317" + "\0\0\0\0" + "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0e\4\0e\4\0\0\0\0\0\0\0e\11\0e\11\0\0\0\0\0\0\0e\16\0e\16\0\0\0\0\0\0" + "\0G\11\0G\11\0\0\0\0\0\0\0G\14\0G\14\0\0\0\0\0\0\0G\17\0G\17\0\0\0\0\0\0" + "\0G\21\0G\21\0\0\0\0\0\0\0GK\0GK\0\0\0\0\0\0\0GT\0GT\0\0\0\0\0\0\0G^\0G^" + "\0\0\0\0\0\0\0Gg\0Gg\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" + "\0e\317\0e\317\0\0\0\0\0\0\0L\317\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0e\4\0e\4\0e\4\0\0\0\0e\11\0e\11\0e\11\0\0\0" + "\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0G\11\0\0\0\0G\14\0G\14\0G\14\0\0\0" + "\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0\0G\24\0G\24\0GK\0\0\0\0" + "GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg\0\0\0\0Gq\0Gq\0e\317\0e\317" + "\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0\0\0\0L\317\0L" + "\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0e\4\0e\4\0e\4\0\0\0" + "\0e\11\0e\11\0e\11\0\0\0\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0e\22\0\0\0" + "\0G\14\0G\14\0G\14\0\0\0\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0" + "\0G\24\0G\24\0G\24\0\0\0\0GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg" + "\0\0\0\0Gq\0Gq\0Gq\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" + "\0e\317\0e\317\0e\317\0\0\0\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0e\4\0e\4\0e\4\0\0\0\0b\10\0b\10\0b\10\0\0\0\0b\15\0b\15\0b\15\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0<\16\0<\16\0<\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0" + "2J\0" + "2J\0" + "2J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e" + "\317\0\0\0\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0c\0\0c\0\0\0\0\0" + "`\0\0c\0\0c\0\0\2\0\0c\1\0i\0\0i\0\0\0\0\0\0\0\0e\0\0e\0\0\0\0\0\0\0\0{\1" + "\0{\1\0f\0\0f\0\0z\1\0z\1\0z\1\0z\1\0)\4\0)\4\0\0\0\0\0\0\0Q\7\0Q\7\0\0\0" + "\0\0\0\0{&\0{&\0W\32\0W\32\0z&\0z&\0z&\0z&\0IC\0IC\0\0\0\0\0\0\0X^\0X^\0" + "\0\0\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0" + "\261\251\0\261\251\0\0\0\0\0\0\0e\317\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\216\1\0c\0\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0k\1\0i\0\0" + "\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0{\1\0f\0\0z\1\0z\1\0z\1\0z\1" + "\0\221\1\0\221\1\0\221\17\0\0\0\0)\4\0c\11\0c\11\0\0\0\0\256+\0\256+\0{&" + "\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\243\210\0\0\0\0IC\0{|\0{|\0\0\0\0" + "\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261" + "\251\0\261\251\0\261\251\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0" + "k\1\0k\1\0\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0\256\2\0f\0\0z\1\0" + "z\1\0z\1\0z\1\0\221\1\0\221\1\0\221\1\0\0\0\0\221\17\0\221\17\0)\4\0\0\0" + "\0\256+\0\256+\0\256+\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\2415\0\0\0\0" + "\243\210\0\243\210\0IC\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261" + "\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\264\360" + "\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1" + "\0\211\1\0c\0\0\2\0\0c\0\0c\0\0k\0\0\12\0\0k\1\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0\264\360" + "\0\264\360\0\264\360\0\0\0\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216\1" + "\0c\0\0\2\0\0c\0\0k\0\0q\0\0\20\0\0\0\0\0\0\0\0\322\1\0\322\1\0\322\1\0\322" + "\1\0\346\1\0\346\1\0\0\0\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0" + "\363\2\0\0\0\0\0\0\0\322!\0\322!\0\322!\0\322!\0\371(\0\371(\0\0\0\0\0\0" + "\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\0\0\0\0\0\0\325\215\0\325\215" + "\0\325\215\0\325\215\0\374\264\0\374\264\0\0\0\0\0\0\0\325\251\0\325\251" + "\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\0\0\0\0\0" + "\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216" + "\1\0c\0\0\2\0\0f\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\322\1\0\322\1\0\346" + "\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0\363\2" + "\0\363\2\0\0\0\0\322\3\0\322\3\0\322!\0\322!\0\371(\0\371(\0\371(\0\0\0\0" + "\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\3227\0\3227\0\325" + "\215\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0\325\251\0" + "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" + "\251\0\330\360\0\330\360\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\216\1\0\216\1\0c\0\0\10\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\325" + "\3\0\322\1\0\346\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2" + "\0\363\2\0\363\2\0\363\2\0\0\0\0\322\3\0\322\3\0\322\3\0\322!\0\371(\0\371" + "(\0\371(\0\0\0\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\322" + "7\0\3227\0\3227\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0" + "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" + "\251\0\325\251\0\325\251\0\330\360\0\330\360\0\330\360\0\0\0\0\264\360\0" + "\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0i\0\0\10\0\0m\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\275\1\0\275\1\0\275\1\0" + "\275\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\244!\0\244!\0\244!\0\244!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213n\0\213n\0\213n\0\213n\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" + "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\224\1\0i\0\0\10\0" + "\0\0\0\0\0\0\0\325\3\0\325\3\0\325\3\0\351\3\0\365\1\0\365\1\0\14\0\0\313" + "\2\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0\304-\0Y!\0Y!\0\0\0\0\0\0\0\371p\0" + "\371p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0" + "3(\0\247\227\0\211" + "s\0\211s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\224\1\0i\0\0\0\0\0\0\0\0\325\3\0\325" + "\3\0\325\3\0\17\2\0\"\2\0!\0\0\35\0\0#\2\0\342\4\0\342\4\0\0\0\0\371\37\0" + "\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775" + "\0\374%\0\304\34\0Y!\0\373C\0\373C\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371" + "p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\211s\0\375" + "\342\0\375\342\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\224\1\0\0\0" + "\0\0\0\0\325\3\0\325\3\0\325\3\0\344\5\0\"\2\0\"\2\0\200\0\0#\2\0\342\4\0" + "\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\371\37\0\3775\0\3775\0\3775\0\304\34\0\3732\0\3732\0Y!\0\0\0\0\371p\0" + "\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377" + "\256\0\247q\0\375\274\0\375\274\0\211s\0\0\0\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\12\0\0\0\0\0i\0\0\0\0\0\325\3\0\325\3\0\344\5\0\344\5" + "\0\"\2\0\36\1\0" + "4\2\0#\2\0\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0" + "\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\3732\0" + "\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371" + "p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0" + "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0" + "\10\0\0\0\0\0\325\3\0\344\5\0\344\5\0\344\5\0\340\4\0\367\11\0\364\3\0#\2" + "\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371" + "\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\3732\0\3732\0\0\0\0\371p\0\371p" + "\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0" + "\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\10\0\0\0\0\0\0\0\0\17\2\0\17" + "\2\0\17\2\0\323\2\0\352\7\0\347\2\0\26\1\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0\0\0\0" + "7\36\0" + "6\25\0" + "" + "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0" + "O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\12\0" + "\0\10\0\0\0\0\0\17\2\0\17\2\0\344\5\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0" + "\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\362\4\0\0\0\0/\26\0/\26\0" + "\3775\0$\21\0" + "7\36\0" + "7\36\0\3672\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0" + "\0\0\0\0\370A\0\0\0\0O>\0O>\0\377\256\0" + "3(\0VK\0VK\0\372\264\0\0\0\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\341\271\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\343\350\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\10\0\0\0\0" + "\0\17\2\0\17\2\0\17\2\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0\0\371\37\0\371" + "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0$\21\0" + "7\36" + "\0" + "7\36\0" + "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0O>\0O>\0O>\0" + "3(\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\5\0\0\5\0\0\5\0\0\0\0\0\344\5\0\344\5\0\344\5\0\316\4\0\367" + "\11\0\367\11\0\364\3\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371" + "\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0" + "\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377" + "\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" + "\0\0\5\0\0\5\0\0\17\2\0\344\5\0\344\5\0\316\4\0\345\11\0\367\11\0\364\3\0" + "\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37" + "\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371" + "p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q" + "\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\0\0\0\17\2" + "\0\344\5\0\344\5\0\15\1\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37\0\371\37\0" + "\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0\307)\0\376" + "G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0" + "\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0" + "\5\0\0\17\2\0\17\2\0\344\5\0\316\4\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0" + "\307)\0\376G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" + "p\0\371p\0\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\5\0\0\24\2\0\17\2\0\17\2\0\316\4\0\345\11\0$\6\0#\2\0\0\0\0\371" + "\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0" + "\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0" + "\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274" + "\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\24\2\0\24" + "\2\0\17\2\0\316\4\0\345\11\0\342\3\0#\2\0\0\0\0\371\37\0\371\37\0\371\37" + "\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0" + "\376G\0\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" + "p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274" + "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\24\2\0\5\0\0\0\0\0\27\5\0\342\3\0\313" + "\1\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\371\37\0\0\0\0\0\0\0/\26\0" + "\3775\0\371\37\0\302\30\0\3716\0Y!\0#\14\0\0\0\0\371p\0\371p\0\0\0\0\0\0" + "\0\0\0\0\371p\0\0\0\0\0\0\0O>\0\377\256\0\371p\0\243I\0\371\224\0\211s\0" + "" + "3(\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" + "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0\0\371" + "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0\0\0\0" + "\0" + "6\25\0" + "6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374" + "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0" + "\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0" + "\0\0\0\0" + "6\25\0" + "6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0" + "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\16\0\0\0\0\0\26\1\0\26\1\0\26" + "\1\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0" + "/\26\0.\17\0\0\0\0" + "6\25\0" + "6\25\0" + "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0" + "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360" + "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\14\0\0\14" + "\0\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" + "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0#\14\0Y!\0Y!\0\0\0\0\0\0\0\371p\0\371" + "p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0" + "3(\0" + "3(\0\211s\0\211" + "s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" + "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** * \brief Returns the BlitBlendAll test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlendAll() +SDL_Surface *SDLTest_ImageBlitBlendAll(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageBlitBlendAll.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageBlitBlendAll.pixel_data, SDLTest_imageBlitBlendAll.width, SDLTest_imageBlitBlendAll.height, SDLTest_imageBlitBlendAll.bytes_per_pixel * 8, SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_imageFace.c b/src/test/SDL_test_imageFace.c index 27f8c846343bf..a30b668894496 100644 --- a/src/test/SDL_test_imageFace.c +++ b/src/test/SDL_test_imageFace.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,223 +25,214 @@ /* GIMP RGBA C-Source image dump (face.c) */ static const SDLTest_SurfaceImage_t SDLTest_imageFace = { - 32, 32, 4, - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0" - "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0" - "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" - "\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0" - "\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" - "\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" - "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0" - "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" - "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0" - "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377" - "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" - "\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" - "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" - "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0" - "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0" - "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" - "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" - "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" - "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" - "\377\377\0\377\377\377\0", + 32, + 32, + 4, + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0" + "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" + "\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0" + "\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0" + "\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377" + "\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377" + "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" + "\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377" + "\377\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0" + "\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\0\0\0" + "\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\0\0\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\0\0\0\377\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0" + "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377" + "\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377" + "\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0" + "\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377" + "\377\377\0\377\377\377\0", }; /** * \brief Returns the Face test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageFace() +SDL_Surface *SDLTest_ImageFace(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imageFace.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imageFace.pixel_data, SDLTest_imageFace.width, SDLTest_imageFace.height, SDLTest_imageFace.bytes_per_pixel * 8, SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGBA32); + return surface; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_imagePrimitives.c b/src/test/SDL_test_imagePrimitives.c index 20e95d662c1b1..8e6585fd1364f 100644 --- a/src/test/SDL_test_imagePrimitives.c +++ b/src/test/SDL_test_imagePrimitives.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,490 +25,495 @@ /* GIMP RGB C-Source image dump (primitives.c) */ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = { - 80, 60, 3, - "\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15" - "I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310" - "\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0" - "\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0" - "\0\5ii\0\0\0\5ii\0\0\0\3\1\1\0\0\0\5\2\1\0\0\0\7\3\2\0\0\0\11\4\3\0\0\0\13" - "\5\3\0\0\0\15\6\4\0\0\0\17\7\5\0\0\0\21\10\5\0\0\0\23\11\6\0\0\0\25\12\7" - "\0\0\0\27\13\7\0\0\0\31\14\10\0\0\0\33\15\11\0\0\0\35\16\11\0\0\0\37\17\12" - "\0\0\0!\20\13\0\0\0#\21\13\0\0\0%\22\14\0\0\0'\23\15\15I\310)\24\15\15I\310" - "+\25\16\15I\310-\26\17\15I\310/\27\17\15I\3101\30\20\15I\3103\31\21\15I\310" - "5\32\21\15I\3107\33\22\15I\3109\34\23\15I\310;\35\23\15I\310=\36\24\15I\310" - "?\37\25\15I\310A\40\25\15I\310C!\26\15I\310E\"\27\15I\310G#\27\15I\310I$" - "\30\15I\310K%\31\15I\310M&\31\5iiO'\32\0\0\0\0\0\0\5ii\0\0\0\10\4\2\0\0\0" - "\14\6\4\0\0\0\20\10\5\0\0\0\24\12\6\0\0\0\30\14\10\0\0\0\34\16\11\0\0\0\40" - "\20\12\0\0\0$\22\14\0\0\0(\24\15\0\0\0,\26\16\0\0\0""0\30\20\0\0\0""4\32" - "\21\0\0\0""8\34\22\0\0\0<\36\24\0\0\0@\40\25\0\0\0D\"\26\0\0\0H$\30\0\0\0" - "L&\31\0\0\0P(\32\15I\310T*\34\15I\310X,\35\15I\310\\.\36\15I\310`0\40\15" - "I\310d2!\15I\310h4\"\15I\310l6$\15I\310p8%\15I\310t:&\15I\310x<(\15I\310" - "|>)\15I\310\200@*\15I\310\204B,\15I\310\210D-\15I\310\214F.\15I\310\220H" - "0\15I\310\224J1\15I\310\230L2\5ii\234N4\15I\310\0\0\0\0\0\0\0\0\0\5ii\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" - "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" - "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d" - "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d" - "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d" - "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" - "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" - "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" - "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" - "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" - "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" - "\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377\0\0\377\0\0\377" - "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0""77\5\0\377\0\0\377\0\0\377\0" - "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377" - "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" - "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" - "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" - "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" - "\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5i" - "i\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" - "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\5ii\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" - "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" - "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d7" - "7\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" - "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" - "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310" - "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" - "ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" - "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\0\0\0\0" - "\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\5ii\15I\310\15I\310\15I\310\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" - "\15I\310\15I\310\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\5ii\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0""77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" - "\310\15I\310\15I\310\15I\310\15I\310\5ii", + 80, + 60, + 3, + "\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15" + "I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310" + "\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0" + "\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0\0\15I\310\0\0" + "\0\5ii\0\0\0\5ii\0\0\0\3\1\1\0\0\0\5\2\1\0\0\0\7\3\2\0\0\0\11\4\3\0\0\0\13" + "\5\3\0\0\0\15\6\4\0\0\0\17\7\5\0\0\0\21\10\5\0\0\0\23\11\6\0\0\0\25\12\7" + "\0\0\0\27\13\7\0\0\0\31\14\10\0\0\0\33\15\11\0\0\0\35\16\11\0\0\0\37\17\12" + "\0\0\0!\20\13\0\0\0#\21\13\0\0\0%\22\14\0\0\0'\23\15\15I\310)\24\15\15I\310" + "+\25\16\15I\310-\26\17\15I\310/\27\17\15I\3101\30\20\15I\3103\31\21\15I\310" + "5\32\21\15I\3107\33\22\15I\3109\34\23\15I\310;\35\23\15I\310=\36\24\15I\310" + "?\37\25\15I\310A\40\25\15I\310C!\26\15I\310E\"\27\15I\310G#\27\15I\310I$" + "\30\15I\310K%\31\15I\310M&\31\5iiO'\32\0\0\0\0\0\0\5ii\0\0\0\10\4\2\0\0\0" + "\14\6\4\0\0\0\20\10\5\0\0\0\24\12\6\0\0\0\30\14\10\0\0\0\34\16\11\0\0\0\40" + "\20\12\0\0\0$\22\14\0\0\0(\24\15\0\0\0,\26\16\0\0\0" + "0\30\20\0\0\0" + "4\32" + "\21\0\0\0" + "8\34\22\0\0\0<\36\24\0\0\0@\40\25\0\0\0D\"\26\0\0\0H$\30\0\0\0" + "L&\31\0\0\0P(\32\15I\310T*\34\15I\310X,\35\15I\310\\.\36\15I\310`0\40\15" + "I\310d2!\15I\310h4\"\15I\310l6$\15I\310p8%\15I\310t:&\15I\310x<(\15I\310" + "|>)\15I\310\200@*\15I\310\204B,\15I\310\210D-\15I\310\214F.\15I\310\220H" + "0\15I\310\224J1\15I\310\230L2\5ii\234N4\15I\310\0\0\0\0\0\0\0\0\0\5ii\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d" + "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" + "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0" + "77\5\0\377\0\0\377\0\0\377\0" + "\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\5ii\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377" + "\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5" + "ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d" + "\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5i" + "i\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310" + "\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310" + "\0d\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\310\0d\310\0d\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d77\5\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\5ii\310\0d\310\0d\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\0d\5ii\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d77\5\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\5ii\310\0d\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15" + "I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\5ii\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d7" + "7\5\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0" + "d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310" + "\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\310\0d\5ii\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\5ii\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310" + "\15I\310\15I\310\15I\310\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" + "ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310" + "\15I\310\15I\310\0\0\0\0\0\0\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\5ii\15I\310\15I\310\15I\310\15I\310\0\0\0\0" + "\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\5ii\15I\310\15I\310\15I\310\0\0\0\0\0\0\5ii\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii" + "\15I\310\15I\310\0\0\0\5ii\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\5ii\15I\310\5ii\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0" + "77\5\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I\310\15I" + "\310\15I\310\15I\310\15I\310\15I\310\5ii", }; /** * \brief Returns the Primitives test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImagePrimitives() +SDL_Surface *SDLTest_ImagePrimitives(void) { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( - (void*)SDLTest_imagePrimitives.pixel_data, + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( + (void *)SDLTest_imagePrimitives.pixel_data, SDLTest_imagePrimitives.width, SDLTest_imagePrimitives.height, SDLTest_imagePrimitives.bytes_per_pixel * 8, SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); - return surface; + SDL_PIXELFORMAT_RGB24); + return surface; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_imagePrimitivesBlend.c b/src/test/SDL_test_imagePrimitivesBlend.c index 5997f9c355171..a6372f56a669e 100644 --- a/src/test/SDL_test_imagePrimitivesBlend.c +++ b/src/test/SDL_test_imagePrimitivesBlend.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,672 +25,668 @@ /* GIMP RGB C-Source image dump (alpha.c) */ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { - 80, 60, 3, - "\260e\15\222\356/\37\313\15\36\330\17K\3745D\3471\0\20\0D\3502D\3502<\321" - ",\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0-\0\377\377" - "\377\377\377\377\311\324\311\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\0H\0\377\377\377\377\377\377\256\307\256\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0c\0\377\377\377\377\377\377" - "\223\300\223\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\0~\0\377\377\377\377\377\377x\277x\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\0\231\0\377\377\377\377\377\377]\303]\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0\264\0\377\377\377\377\377" - "\377B\316B\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0" - "\317\0\377\377\377\377\377\377'\335'\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\352\0\377\377\377#\262\6\260d\15\260e\15\224\357" - "/&\262\6\34\300\5.\314\22\40\315\12[\3747M\332/\27\331\12\27\331\12K\374" - "5K\3745K\3745D\3471D\3471D\3471D\3471D\3471D\3502D\3502D\3502D\3502D\350" - "2D\3502D\3502D\3502D\3502D\3502\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377,\372\27\273\3465\327" - "Q.\260d\15\213\213\40\241\3601\200\366*=\265\13?\301\25s\375\265\14\177\252+\201\210\16\245\204" - "*\377\314U\312\\,\224'\11\260i\17\244\210\40\232\2211\331\353J\215\2351\377" - "\377\276\200\2521\200\2542\375\377\310u\2661t\2702t\2702\367\377\324\325" - "\355\305h\3021h\3042h\3042\377\377\377\377\377\377\364\377\336\335\364\323" - "\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346" - "\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377" - "\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\3342\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\27\331\12Y\316-h\3021\243\370Cg\230\15\230\224\"\245" - "\204*\377\314U\310J\21\327Q.\260b\21\245\2041\370\343N\230\2242\331\353J" - "\214\2402\377\377\276\200\2521\200\2542\375\377\310\317\344\266u\2661t\270" - "2\377\377\377\367\377\324\325\355\305h\3021h\3042h\3042h\3042\377\377\377" - "\377\377\377\364\377\336\335\364\323\335\364\323\335\364\323\335\364\323" - "\\\3202\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371" - "\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377\377" - "\377\377\377\377\377\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\334" - "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377K\3745!\315\13d\304,p\270)\177\252+\23\13\6\232\2211\245\204" - "1\347\270O\377\277Y\324<\22\265V\24\377\330Q\244\210\40#(\13\230\224\"\331" - "\353Ju\211.\377\377\276\200\2521\210\273:\200\2542\375\377\310\20""3\6u\266" - "1t\2702\271\307\271\367\377\324\325\355\305\341\377\321h\3021h\3042\16L\7" - "h\3042\377\377\377\242\300\242\377\377\377\335\364\323\355\377\343\335\364" - "\323\335\364\323\14f\7\\\3202\\\3202>\250*\\\3202\377\377\377\377\377\377" - "\377\377\377\377\377\377$\231$\377\377\377\377\377\377s\303s\377\377\377" - "\346\371\342\376\377\372\346\371\342\346\371\342\40\257\37\346\371\342\346" - "\371\342\\\316\\\377\377\377\377\377\377\377\377\377\377\377\377P\3342\13" - "\262\7P\3342P\3342*\327%P\3342P\3342o\377Q\377\377\377\377\377\377$\352$" - "\377\377\377\377\377\377K\3745]\3749s\375<\212\373@\243\370C\274\363G\331" - "\353J\370\343N\377\330Q\377\314U\377\277Y\377\260\\\224(\11\260|\36\245\204" - "1\377\377\250\232\2211\230\224\"\215\2351\214\2402\377\377\276\312\332\250" - "\200\2521\200\2542\377\377\377\317\344\266u\2661t\2702t\2702\377\377\377" - "\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\3042h\3042\377\377" - "\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364" - "\323\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342" - "\346\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377P\3342P\3342" - "P\3342P\3342\377\377\377K\3745O\3321\\\3161h\3021t\2702~\254'\214\240%\377" - "\377\262\370\343N\377\330Q\262x1\277l1\312`1\327R.\260X\23\377\330Q\244\210" - "2\377\377\250\230\2242\377\377\262\215\2351\214\2402\377\377\377\312\332" - "\250\200\2521\200\2542\377\377\377\375\377\310\317\344\266u\2661t\2702t\270" - "2\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\304" - "2h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\\\3202\\\320" - "2\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346\371\342\346" - "\371\342\346\371\342\346\371\342\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3471O\3321\21\7\11c\304+\367\377\324o\2520\200\252" - "1\214\2402\235\226'\377\377\250\377\330Q!\20\11\277l1\310d2\266?\33\224(" - "\11\260|\36\257\217;\377\377\250\232\2211\34$\11\377\377\262\215\2351q\206" - "0\377\377\377\312\332\250\217\303@\200\2542\200\25420Z0\317\344\266\317\344" - "\266X\2260t\2702t\2702\377\377\377\377\377\377\325\355\305(l%\325\355\305" - "\325\355\305K\2410h\3042h\3042\377\377\377\377\377\377\377\377\3770\2200" - "\377\377\377\377\377\377t\274p\335\364\323\335\364\323\373\377\361\377\377" - "\377\377\377\377\21\213\11\\\3202\\\3202<\274/\\\3202\377\377\377\377\377" - "\377\377\377\377\377\377\3770\3060\377\377\377\377\377\377V\330V\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\3770\3410\346\371\342\346" - "\371\342>\352>\346\371\342\377\377\377D\3471P\3342\364\377\352s\375\3369\\\3202\377\377\377\377\377\377\377\377\377\377\377\377D\3502\371\377" - "\364O\3321\\\3202\364\377\336h\3042\367\377\324u\2661\200\2542\377\377\276" - "\215\2351\230\2242\307\300\213\244\2102\377\377\234\262x1\274p2\377\337\207" - "\312`1\324E\30\327T1\260|2\377\377\234\245\2041\244\2102\377\377\250\232" - "\2211\230\2242\377\377\377\310\316\231\215\2351\214\2402\377\377\377\377" - "\377\377\312\332\250\312\332\250\200\2542\200\2542\377\377\377\377\377\377" - "\317\344\266\317\344\266\317\344\266t\2702t\2702t\2702\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355" - "\305\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\377\377" - "\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\377\377\377D\3502\371\377" - "\364O\3321\377\377\377\\\3161h\3042\367\377\324t\2702\375\377\310\200\252" - "1\377\377\377\215\2351\230\2242\377\377\250\244\2102\377\377\234\262x1\274" - "p2\316\214_\310d2\377\310|\327T1\227/\14\377\377\377\307\260|\244\2102\377" - "\377\377\307\300\213\230\2242\230\2242\377\377\377\310\316\231\214\2402\214" - "\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\2542\377" - "\377\377\377\377\377\377\377\377\317\344\266\317\344\266\317\344\266t\270" - "2t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377h\3042h\3042" - "h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364" - "\323\335\364\323\335\364\323\377\377\377\377\377\377\377\377\377\377\377" - "\377D\3502\371\377\364R\3344\364\377\352\\\3161H\22Hh\3021\377\377\377o\244" - "2\200\2542\312\332\250\226\245<\377\377\262\230\2242H-/\245\2041\377\377" - "\377\233i5\274p2\277l1\331sC\377\310|\324X2*\15\3\260|2\377\377\234\206s" - "7\244\2102\377\377\250\340\337\244\230\2242\377\377\377Hc2\310\316\231\214" - "\2402n\211:\377\377\377\377\377\377\353\377\311\312\332\250\200\2542$T\16" - "\377\377\377\377\377\377\236\277\236\377\377\377\317\344\266\367\377\336" - "\377\377\377t\2702\40n\16t\2702\377\377\377\212\303\212\377\377\377\377\377" - "\377\377\377\377\325\355\305\325\355\305<\2477\377\377\377\377\377\377O\276" - "Ah\3042h\3042\237\377i\377\377\377\377\377\377H\317H\377\377\377\377\377" - "\377c\335c\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323>\337" - ";\335\364\323\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\364" - "\377\336h\3042\367\377\324t\2702\375\377\310\200\2542\377\377\276\214\240" - "2\377\377\262\232\2211\377\377\377\245\2041\377\377\377\262x1\377\377\377" - "\277l1\310d2\312`1\324X2\327T1\260|2\377\377\377\307\260|\244\2102\377\377" - "\377\307\300\213\232\2211\230\2242\377\377\377\377\377\262\310\316\231\214" - "\2402\214\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200" - "\2542\200\2542\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266" - "\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\325\355" - "\305\377\377\377\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\335" - "\364\323h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377" - "\377\215\2351\377\377\377\232\2211\377\377\377\245\2041\377\377\377\262x" - "1\377\377\377\277l1\377\377\377\312`1\377\310|\327T1\227/\14\377\377\377" - "\307\260|\244\2102\244\2102\377\377\377\307\300\213\230\2242\230\2242\377" - "\377\377\310\316\231\310\316\231\214\2402\214\2402\377\377\377\377\377\377" - "\312\332\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377" - "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" - "\377t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377" - "\377\377\377\377\377\377\377h\3042h\3042h\3042\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360" - "T\11TO\3321\377\377\377Z\3002\377\377\377h\3042\377\377\334t\2702\375\377" - "\310*\30\20\312\332\250\214\2402\262\260\214\230\2242\307\300\213\377\377" - "\377\245\2041\377\377\377:\35\20\377\377\377\277l1\316\264w\310d2\377\310" - "|\356qL\227/\14\260|2TZ3\307\260|\244\2102\274\302\274\307\300\213\307\300" - "\213\273\301U\377\377\377\377\377\377A^2\310\316\231\214\2402o\216B\377\377" - "\377\377\377\377\366\377\324\312\332\250\312\332\250*a\20\200\2542\377\377" - "\377\230\301\230\377\377\377\377\377\377\377\377\353\317\344\266\317\344" - "\266T\253Tt\2702t\2702]\265I\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377T\306T\377\377\377\325\355\305l\324i\325\355\305\377\377" - "\377\377\377\377\377\377\377h\3042\"\254\20h\3042h\3042b\353b\377\377\377" - "\377\377\377D\3502\362\375\360\377\377\377O\3321\377\377\377\\\3202\364\377" - "\336h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377\377" - "\214\2402\377\377\262\230\2242\307\300\213\244\2102\307\260|\377\377\377" - "\262x1\377\377\377\274p2\377\337\207\310d2\377\310|\324X2\333bB\260|2\377" - "\377\377\307\260|\244\2102\244\2102\377\377\377\307\300\213\232\2211\230" - "\2242\377\377\377\377\377\377\310\316\231\310\316\231\214\2402\214\2402\377" - "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\254" - "2\200\2542\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" - "\344\266\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\325\355\305" - "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377\377\377\377" - "h\3042h\3042\377\377\377\377\377\377D\3471\377\377\377P\3342\364\377\352" - "\\\3202\335\364\323\377\377\377h\3021\377\377\377t\2702\375\377\310\200\254" - "2\312\332\250\377\377\377\215\2351\377\377\377\230\2242\377\377\250\244\210" - "2\307\260|\377\377\377\262x1\377\377\377\274p2\377\337\207\310d2\323xQ\324" - "X2\327T1\227/\14\260|2\377\377\234\307\260|\244\2102\377\377\377\377\377" - "\377\307\300\213\230\2242\230\2242\377\377\377\377\377\377\310\316\231\310" - "\316\231\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250" - "\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" - "\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325" - "\355\305\377\377\377\377\377\377`\0`\377\377\377D\3471\371\366\371P\3342" - "\346\371\342\377\377\377\\\3161\377\377\377'\24\22\325\355\305t\2702\276" - "\310\251\377\377\377\200\2542\377\377\316\214\2402\310\316\231`6`\230\224" - "2\377\377\250\222u<\307\260|\377\377\377\315\214L\377\377\377\274p2M,#\310" - "d2\312`1\306\304\306\324X2\333bB\325\242W\377\377\377\307\260|=9\22\244\210" - "2\377\377\377\227\234w\307\300\213\230\2242\307\322a\377\377\377\377\377" - "\377Km9\310\316\231\214\2402r\226K\377\377\377\377\377\377\377\377\377\312" - "\332\250\312\332\250`\242`\200\2542\200\2542\224\306\224\377\377\377\377" - "\377\377\377\377\377\377\377\377\317\344\266M\250D\317\344\266\377\377\377" - "\203\322\203t\2702t\2702\301\377\177\377\377\377\377\377\377`\330`\377\377" - "\377\377\377\377r\344r\377\377\377\377\377\377\377\377\377\325\355\305\377" - "\377\377\377\377\377D\3502\371\377\364P\3342\346\371\342\377\377\377\\\320" - "2\364\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\200\2542\312" - "\332\250\377\377\377\214\2402\310\316\231\230\2242\307\300\213\377\377\377" - "\244\2102\307\260|\377\377\377\200U0\220^\377\7\4/\227U[\246]\377\255Q1\377" - "\242y\10\3/\306M@\6\4/{^\377mVvmVv\6\5/h\\\377h\\\377\\U\204\12\12\360\5" - "\5/VX\377VX\377\12\12\360LR\221\12\12\360\5\6/\214\2402\377\377\377\377\377" - "\377\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200" - "\2542\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344" - "\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371" - "\342\377\377\377\\\3202\335\364\323\377\377\377h\3042\367\377\324t\2702\317" - "\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402\377\377\262" - "\230\2242\307\300\213\377\377\377\244\2102\307\260|{^\377\200U0\220^\377" - "\7\4/\227U[\246]\377\7\3/\377\242y\236\37""2\306M0\210%\14T-2{^\377mVv\6" - "\5/\6\5/h\\\377\\U\204\\U\204\5\5/\5\5/VX\377VX\377LR\221LR\221\377\377\377" - "\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250\312\332" - "\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266\377" - "\377\377\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\365\375\363\377\377" - "\377O\3321l\22l\\\3202\335\364\323\357\346\357h\3042\325\355\305\377\377" - "\377t\2702\317\344\266l-l\200\2521\377\377\377\204\211=\310\316\231\377\377" - "\377\262\243L\307\300\213\377\377\377E&\25mVv{^\377ySB\220^\377\7\4/\275" - "t\201\246]\377\7\3/I\37!\277Z\377\10\3/\237YQ\6\4/{^\377\236\213\247mVv\6" - "\5/,-lh\\\377\\U\204dow\5\5/\5\5/\222\251\377VX\377\310\316\231T{@\377\377" - "\377\214\2402w\240V\377\377\377\377\377\377\377\377\377\377\377\377\312\332" - "\250U\231G\377\377\377\200\2542q\270\\\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377l\317l\317\344\266\317\344\266z\330v\377\377\377" - "\377\377\377\323\377\221t\2702t\2702l\352l\377\377\377\377\377\377\377\377" - "\377D\3502\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\364" - "\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200" - "\2542\312\332\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\307" - "\300\213\377\377\377\6\5/mVv{^\377\200U0\220^\377\7\4/\227U[\246]\377\7\3" - "/\255RN\277Z\377\10\3/\306M@\6\4/{^\377{^\377mVv\6\5/\6\5/h\\\377h\\\377" - "\\U\204\12\12\360\5\5/\12\12\360\377\377\377\377\377\377\310\316\231\310" - "\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377" - "\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200\254" - "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\317\344\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702" - "\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\3342\346\371\342" - "\377\377\377\\\3202\335\364\323\377\377\377h\3042\325\355\305\377\377\377" - "t\2702\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402" - "\310\316\231\377\377\377\230\2242\307\300\213h\\\377\6\5/mVv{^\377\200U0" - "\220^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{" - "^\377mVvmVv\6\5/\12\12\360h\\\377\\U\204\\U\204\5\5/\230\2242\377\377\377" - "\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214" - "\2402\377\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332" - "\250\377\377\377\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" - "\344\266\377\377\377\377\377\377\377\377\377\377\377\377D\3502q\10p\377\377" - "\377P\3342\335\350\332\377\377\377\\\3202\351\366\337\377\377\377h\3042d" - "!\\\377\377\377t\2702\277\302\252\377\377\377\200\2542\343\345\301\377\377" - "\377\214\2402^2H\377\377\377\230\2242\257\235\204h\\\377\6\5/\223o\234{^" - "\377\6\4/<\36""1\377\252\215j)2\211XK\377\250\203\202$2\337~c\377\242y\236" - "\37""2]#\26\306M@\6\4/ym\274{^\377mVvELn\6\5/h\\\37703x\\U\204\307\300\213" - "\204\226\\\230\2242\377\377\377\377\377\377\377\377\377\310\316\231^\212" - "H\377\377\377\214\2402}\256b\377\377\377\377\377\377\377\377\377\377\377" - "\377\312\332\250_\251O\377\377\377\377\377\377y\310j\200\2542\377\377\377" - "\377\377\377\377\377\377\377\377\377x\341x\377\377\377\377\377\377\177\350" - "|\317\344\266\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\334" - "2\346\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\304" - "2\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200\2542\312\332" - "\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\\U\204h\\\377" - "\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\255" - "RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377mVvmVv\6\5/\12\12\360h\\\377" - "\377\377\377\307\300\213\377\377\377\230\2242\230\2242\377\377\377\377\377" - "\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214\2402\377" - "\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\312" - "\332\250\377\377\377\200\2542\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\350" - "2\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377\377\377\\\320" - "2\335\364\323\377\377\377h\3042\325\355\305\377\377\377t\2702\317\344\266" - "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\214\2402\310\316" - "\231\377\377\377\5\5/\\U\204h\\\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220" - "^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{^\377" - "\12\12\360mVv\6\5/\6\5/\377\377\377\377\377\377\307\300\213\307\300\213\377" - "\377\377\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" - "\231\310\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377" - "\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377\377\377\377\377" - "\204\0\204\377\377\377D\3502\355\364\353\377\377\377\377\377\377Y\335;\346" - "\371\342\377\377\377/\26\31\335\364\323\377\377\377k\255<\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\2046\204\200\2542\312\332\250\340" - "\317\340\214\2402\310\316\231\377\377\377VX\377\5\5//\33Dh\\\377\6\5/tVz" - "{^\377\6\4/=0\377\201Vi\220^\377\3\1\30\227U[\246]\377?6U\255RN\277Z\377" - "\337]s\306M0\306M@\3\2\30{^\377{^\377yv}mVv\244\2102\377\377\377\377\377" - "\377\377\377\377gyG\307\300\213\230\2242\212\242h\377\377\377\377\377\377" - "\377\377\377\377\377\377\310\316\231g\230O\377\377\377\214\2402\205\274q" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377h\270V\312\332" - "\250\377\377\377\222\344\222\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346" - "\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\3042\325" - "\355\305\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" - "\332\250\377\377\377\214\2402\310\316\231VX\377\12\12\360\5\5/\\U\204h\\" - "\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3" - "/\255RN\255RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377\12\12\360\307\260" - "|\244\2102\244\2102\377\377\377\377\377\377\377\377\377\307\300\213\377\377" - "\377\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310" - "\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377" - "\377\377\377\200\2542\200\2542\377\377\377\377\377\377D\3502\377\377\377" - "\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\377\377\377" - "\335\364\323\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702" - "\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\377\377\377\214" - "\2402LR\221VX\377\5\5/\\U\204\12\12\360h\\\377\6\5/mVv{^\377\6\4/\12\12\360" - "\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\7\3/\255RN\277Z\377\10\3/\306M@" - "\6\4/\6\4/{^\377\377\377\377\307\260|\377\377\377\244\2102\377\377\377\377" - "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\377\377" - "\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231\377\377" - "\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377\377-\17\34\346" - "\371\342\377\377\377\363\346\363\\\3202\335\364\323\377\377\377h\3042\377" - "\377\377x)o\377\377\377t\2702\301\276\255\377\377\377\377\377\377\243\273" - "U\312\332\250\377\377\377O-\34\12\12\360LR\221gU\333\5\5/\\U\204<)\377h\\" - "\377\6\5/=!B{^\377\6\4/A2\306\201Vi\220^\377I9q\227U[\246]\377]-\220\7\3" - "/\255RN\245q\304\10\3/\306M0\377\236\221\6\4/\377\377\377\220\231\220\307" - "\260|\307\260|\226\227m\244\2102\377\377\377\377\377\377\377\377\377\307" - "\300\213p\207N\230\2242\230\2242\254\316\254\377\377\377\377\377\377\377" - "\377\377\310\316\231\310\316\231\220\317\220\377\377\377\214\2402\216\316" - "\200\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377r\310^\312" - "\332\250\377\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377" - "P\3342\377\377\377\346\371\342\377\377\377\\\3202\335\364\323\377\377\377" - "\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702\317\344\266" - "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\5\6/LR\221\12\12" - "\360VX\377\5\5/\\U\204h\\\377\12\12\360\6\5/mVv{^\377\6\4/\12\12\360\201" - "Vi\220^\377\7\4/\227U[\12\12\360\246]\377\7\3/\255RN\277Z\377\277Z\377\10" - "\3/\306M@\260|2\260|2\377\377\377\377\377\377\307\260|\377\377\377\244\210" - "2\377\377\377\377\377\377\377\377\377\377\377\377\307\300\213\377\377\377" - "\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" - "\231\310\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377D\3502\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377" - "\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" - "\332\250\377\377\377\12\12\360\5\6/LR\221VX\377\12\12\360\5\5/\\U\204h\\" - "\377\6\5/\12\12\360mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\227" - "U[\246]\377\7\3/\255RN\12\12\360\277Z\377\10\3/\333bB\377\377\377\260|2\377" - "\377\377\377\377\377\307\260|\307\260|\244\2102\244\2102\377\377\377\377" - "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\230\224" - "2\377\377\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231" - "\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377)\10\36\362\375\360\377\377\377\370" - "\356\370P\3342\346\371\342\377\377\377\377\377\377\\\3202\207\"\201\377\377" - "\377\377\377\377p\250D\325\355\305\377\377\377\377\377\377t\2702\317\344" - "\266\234?\234\200\2542\377\377\377\274\260\244FS\377\5\6/;#\377LR\221VX\377" - "\3\1\34\12\12\360\\U\204{^\330\6\5/\12\12\360\257\203\270{^\377\6\4/\6\4" - "\222\201Vi\220^\377P@d\12\12\360\227U[\370\244\377\7\3/\255RNi./\277Z\377" - "\324X2\264\202w\333bB\260|2\377\377\377\377\377\377\377\377\377yvK\377\377" - "\377\244\2102\236\247|\377\377\377\377\377\377\377\377\377\307\300\213\307" - "\300\213\234\306\234\230\2242\377\377\377\256\330\256\377\377\377\377\377" - "\377\377\377\377\310\316\231\310\316\231\234\341\234\377\377\377\214\240" - "2\232\343\223\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375" - "\360\377\377\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\" - "\3202\335\364\323\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377" - "\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312\332\250\12" - "\12\360FS\377\5\6/LR\221\12\12\360RW\255\3\5\35\6\11\224ZT\\d[\261\3\4\35" - "\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270\4\3\35\6\11\224\226UG\242" - "\\\274\4\3\35\4\3\35\254R@\377\377\311\203U\36\203U\36\323a:my\36my\36\377" - "\377\276\377\377\276\243\255X\243\255X\236\371\236e\204\36\236\371\236\374" - "\377\273\236\371\236\236\371\236\234\275`\236\371\236^\220\36^\220\36\236" - "\371\236\352\377\267\352\377\267\236\371\236\236\371\236\310\316\231\310" - "\316\231\377\377\377\377\377\377\214\2402\377\377\377\377\377\377\377\377" - "\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346\371\342\377\377" - "\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\377\377" - "\377\325\355\305\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377" - "\377\377\200\2542\346\3\4\35lVT\4\4hw]\264\4\4\35aK\244\200VN\214]\270kZ\371\4\3\35" - "\270\212Io\225o\377\377\306{a\36\253\300\253\304wB\377\377\311\377\377\377" - "\203U\36\323a:\224D(my\36\236\371\236\307\316\266\377\377\276\236\371\236" - "\377\377\343\236\371\236e\204\36Gk\25\236\371\236\374\377\273\260\334\260" - "\236\371\236\234\275`\377\377\377\377\377\377\230\2242k\207#\377\377\377" - "\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377" - "\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\\3202\377\377" - "\377\335\364\323\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\377\377\3778L\377\12\12\360\5\6/<" - "L\237\12\12\360BR\252\3\5\35\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\\6\11\224" - "d[\261\6\11\224\3\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6" - "\11\224tm\36\270\212I\270\212I\377\377\306{a\36{a\36\304wB\236\371\236\377" - "\377\311\203U\36\236\371\236\323a:my\36my\36\236\371\236\377\377\276\236" - "\371\236\243\255X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374" - "\377\273\236\371\236\307\300\213\307\300\213\377\377\377\377\377\377\230" - "\2242\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377" - "\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377\377\377" - "\\\3202\335\364\323\377\377\377\377\377\377\377\377\377h\3042\325\355\305" - "\377\377\377\377\377\377t\2702\377\377\377\317\344\2668L\377\12\12\360\5" - "\6/\12\12\360\265\14\177\252+\201\210\16\245\204" + "*\377\314U\312\\,\224'\11\260i\17\244\210\40\232\2211\331\353J\215\2351\377" + "\377\276\200\2521\200\2542\375\377\310u\2661t\2702t\2702\367\377\324\325" + "\355\305h\3021h\3042h\3042\377\377\377\377\377\377\364\377\336\335\364\323" + "\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346" + "\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377" + "\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\3342\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\27\331\12Y\316-h\3021\243\370Cg\230\15\230\224\"\245" + "\204*\377\314U\310J\21\327Q.\260b\21\245\2041\370\343N\230\2242\331\353J" + "\214\2402\377\377\276\200\2521\200\2542\375\377\310\317\344\266u\2661t\270" + "2\377\377\377\367\377\324\325\355\305h\3021h\3042h\3042h\3042\377\377\377" + "\377\377\377\364\377\336\335\364\323\335\364\323\335\364\323\335\364\323" + "\\\3202\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371" + "\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377\377" + "\377\377\377\377\377\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\334" + "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377K\3745!\315\13d\304,p\270)\177\252+\23\13\6\232\2211\245\204" + "1\347\270O\377\277Y\324<\22\265V\24\377\330Q\244\210\40#(\13\230\224\"\331" + "\353Ju\211.\377\377\276\200\2521\210\273:\200\2542\375\377\310\20" + "3\6u\266" + "1t\2702\271\307\271\367\377\324\325\355\305\341\377\321h\3021h\3042\16L\7" + "h\3042\377\377\377\242\300\242\377\377\377\335\364\323\355\377\343\335\364" + "\323\335\364\323\14f\7\\\3202\\\3202>\250*\\\3202\377\377\377\377\377\377" + "\377\377\377\377\377\377$\231$\377\377\377\377\377\377s\303s\377\377\377" + "\346\371\342\376\377\372\346\371\342\346\371\342\40\257\37\346\371\342\346" + "\371\342\\\316\\\377\377\377\377\377\377\377\377\377\377\377\377P\3342\13" + "\262\7P\3342P\3342*\327%P\3342P\3342o\377Q\377\377\377\377\377\377$\352$" + "\377\377\377\377\377\377K\3745]\3749s\375<\212\373@\243\370C\274\363G\331" + "\353J\370\343N\377\330Q\377\314U\377\277Y\377\260\\\224(\11\260|\36\245\204" + "1\377\377\250\232\2211\230\224\"\215\2351\214\2402\377\377\276\312\332\250" + "\200\2521\200\2542\377\377\377\317\344\266u\2661t\2702t\2702\377\377\377" + "\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\3042h\3042\377\377" + "\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364" + "\323\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342" + "\346\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377P\3342P\3342" + "P\3342P\3342\377\377\377K\3745O\3321\\\3161h\3021t\2702~\254'\214\240%\377" + "\377\262\370\343N\377\330Q\262x1\277l1\312`1\327R.\260X\23\377\330Q\244\210" + "2\377\377\250\230\2242\377\377\262\215\2351\214\2402\377\377\377\312\332" + "\250\200\2521\200\2542\377\377\377\375\377\310\317\344\266u\2661t\2702t\270" + "2\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\304" + "2h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\\\3202\\\320" + "2\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346\371\342\346" + "\371\342\346\371\342\346\371\342\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3471O\3321\21\7\11c\304+\367\377\324o\2520\200\252" + "1\214\2402\235\226'\377\377\250\377\330Q!\20\11\277l1\310d2\266?\33\224(" + "\11\260|\36\257\217;\377\377\250\232\2211\34$\11\377\377\262\215\2351q\206" + "0\377\377\377\312\332\250\217\303@\200\2542\200\25420Z0\317\344\266\317\344" + "\266X\2260t\2702t\2702\377\377\377\377\377\377\325\355\305(l%\325\355\305" + "\325\355\305K\2410h\3042h\3042\377\377\377\377\377\377\377\377\3770\2200" + "\377\377\377\377\377\377t\274p\335\364\323\335\364\323\373\377\361\377\377" + "\377\377\377\377\21\213\11\\\3202\\\3202<\274/\\\3202\377\377\377\377\377" + "\377\377\377\377\377\377\3770\3060\377\377\377\377\377\377V\330V\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\3770\3410\346\371\342\346" + "\371\342>\352>\346\371\342\377\377\377D\3471P\3342\364\377\352s\375\3369\\\3202\377\377\377\377\377\377\377\377\377\377\377\377D\3502\371\377" + "\364O\3321\\\3202\364\377\336h\3042\367\377\324u\2661\200\2542\377\377\276" + "\215\2351\230\2242\307\300\213\244\2102\377\377\234\262x1\274p2\377\337\207" + "\312`1\324E\30\327T1\260|2\377\377\234\245\2041\244\2102\377\377\250\232" + "\2211\230\2242\377\377\377\310\316\231\215\2351\214\2402\377\377\377\377" + "\377\377\312\332\250\312\332\250\200\2542\200\2542\377\377\377\377\377\377" + "\317\344\266\317\344\266\317\344\266t\2702t\2702t\2702\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355" + "\305\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\377\377" + "\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\377\377\377D\3502\371\377" + "\364O\3321\377\377\377\\\3161h\3042\367\377\324t\2702\375\377\310\200\252" + "1\377\377\377\215\2351\230\2242\377\377\250\244\2102\377\377\234\262x1\274" + "p2\316\214_\310d2\377\310|\327T1\227/\14\377\377\377\307\260|\244\2102\377" + "\377\377\307\300\213\230\2242\230\2242\377\377\377\310\316\231\214\2402\214" + "\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\2542\377" + "\377\377\377\377\377\377\377\377\317\344\266\317\344\266\317\344\266t\270" + "2t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377h\3042h\3042" + "h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364" + "\323\335\364\323\335\364\323\377\377\377\377\377\377\377\377\377\377\377" + "\377D\3502\371\377\364R\3344\364\377\352\\\3161H\22Hh\3021\377\377\377o\244" + "2\200\2542\312\332\250\226\245<\377\377\262\230\2242H-/\245\2041\377\377" + "\377\233i5\274p2\277l1\331sC\377\310|\324X2*\15\3\260|2\377\377\234\206s" + "7\244\2102\377\377\250\340\337\244\230\2242\377\377\377Hc2\310\316\231\214" + "\2402n\211:\377\377\377\377\377\377\353\377\311\312\332\250\200\2542$T\16" + "\377\377\377\377\377\377\236\277\236\377\377\377\317\344\266\367\377\336" + "\377\377\377t\2702\40n\16t\2702\377\377\377\212\303\212\377\377\377\377\377" + "\377\377\377\377\325\355\305\325\355\305<\2477\377\377\377\377\377\377O\276" + "Ah\3042h\3042\237\377i\377\377\377\377\377\377H\317H\377\377\377\377\377" + "\377c\335c\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323>\337" + ";\335\364\323\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\364" + "\377\336h\3042\367\377\324t\2702\375\377\310\200\2542\377\377\276\214\240" + "2\377\377\262\232\2211\377\377\377\245\2041\377\377\377\262x1\377\377\377" + "\277l1\310d2\312`1\324X2\327T1\260|2\377\377\377\307\260|\244\2102\377\377" + "\377\307\300\213\232\2211\230\2242\377\377\377\377\377\262\310\316\231\214" + "\2402\214\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200" + "\2542\200\2542\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266" + "\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\325\355" + "\305\377\377\377\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\335" + "\364\323h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377" + "\377\215\2351\377\377\377\232\2211\377\377\377\245\2041\377\377\377\262x" + "1\377\377\377\277l1\377\377\377\312`1\377\310|\327T1\227/\14\377\377\377" + "\307\260|\244\2102\244\2102\377\377\377\307\300\213\230\2242\230\2242\377" + "\377\377\310\316\231\310\316\231\214\2402\214\2402\377\377\377\377\377\377" + "\312\332\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377" + "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" + "\377t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377" + "\377\377\377\377\377\377\377h\3042h\3042h\3042\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360" + "T\11TO\3321\377\377\377Z\3002\377\377\377h\3042\377\377\334t\2702\375\377" + "\310*\30\20\312\332\250\214\2402\262\260\214\230\2242\307\300\213\377\377" + "\377\245\2041\377\377\377:\35\20\377\377\377\277l1\316\264w\310d2\377\310" + "|\356qL\227/\14\260|2TZ3\307\260|\244\2102\274\302\274\307\300\213\307\300" + "\213\273\301U\377\377\377\377\377\377A^2\310\316\231\214\2402o\216B\377\377" + "\377\377\377\377\366\377\324\312\332\250\312\332\250*a\20\200\2542\377\377" + "\377\230\301\230\377\377\377\377\377\377\377\377\353\317\344\266\317\344" + "\266T\253Tt\2702t\2702]\265I\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377T\306T\377\377\377\325\355\305l\324i\325\355\305\377\377" + "\377\377\377\377\377\377\377h\3042\"\254\20h\3042h\3042b\353b\377\377\377" + "\377\377\377D\3502\362\375\360\377\377\377O\3321\377\377\377\\\3202\364\377" + "\336h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377\377" + "\214\2402\377\377\262\230\2242\307\300\213\244\2102\307\260|\377\377\377" + "\262x1\377\377\377\274p2\377\337\207\310d2\377\310|\324X2\333bB\260|2\377" + "\377\377\307\260|\244\2102\244\2102\377\377\377\307\300\213\232\2211\230" + "\2242\377\377\377\377\377\377\310\316\231\310\316\231\214\2402\214\2402\377" + "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\254" + "2\200\2542\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" + "\344\266\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\325\355\305" + "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377\377\377\377" + "h\3042h\3042\377\377\377\377\377\377D\3471\377\377\377P\3342\364\377\352" + "\\\3202\335\364\323\377\377\377h\3021\377\377\377t\2702\375\377\310\200\254" + "2\312\332\250\377\377\377\215\2351\377\377\377\230\2242\377\377\250\244\210" + "2\307\260|\377\377\377\262x1\377\377\377\274p2\377\337\207\310d2\323xQ\324" + "X2\327T1\227/\14\260|2\377\377\234\307\260|\244\2102\377\377\377\377\377" + "\377\307\300\213\230\2242\230\2242\377\377\377\377\377\377\310\316\231\310" + "\316\231\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250" + "\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" + "\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325" + "\355\305\377\377\377\377\377\377`\0`\377\377\377D\3471\371\366\371P\3342" + "\346\371\342\377\377\377\\\3161\377\377\377'\24\22\325\355\305t\2702\276" + "\310\251\377\377\377\200\2542\377\377\316\214\2402\310\316\231`6`\230\224" + "2\377\377\250\222u<\307\260|\377\377\377\315\214L\377\377\377\274p2M,#\310" + "d2\312`1\306\304\306\324X2\333bB\325\242W\377\377\377\307\260|=9\22\244\210" + "2\377\377\377\227\234w\307\300\213\230\2242\307\322a\377\377\377\377\377" + "\377Km9\310\316\231\214\2402r\226K\377\377\377\377\377\377\377\377\377\312" + "\332\250\312\332\250`\242`\200\2542\200\2542\224\306\224\377\377\377\377" + "\377\377\377\377\377\377\377\377\317\344\266M\250D\317\344\266\377\377\377" + "\203\322\203t\2702t\2702\301\377\177\377\377\377\377\377\377`\330`\377\377" + "\377\377\377\377r\344r\377\377\377\377\377\377\377\377\377\325\355\305\377" + "\377\377\377\377\377D\3502\371\377\364P\3342\346\371\342\377\377\377\\\320" + "2\364\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\200\2542\312" + "\332\250\377\377\377\214\2402\310\316\231\230\2242\307\300\213\377\377\377" + "\244\2102\307\260|\377\377\377\200U0\220^\377\7\4/\227U[\246]\377\255Q1\377" + "\242y\10\3/\306M@\6\4/{^\377mVvmVv\6\5/h\\\377h\\\377\\U\204\12\12\360\5" + "\5/VX\377VX\377\12\12\360LR\221\12\12\360\5\6/\214\2402\377\377\377\377\377" + "\377\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200" + "\2542\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344" + "\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371" + "\342\377\377\377\\\3202\335\364\323\377\377\377h\3042\367\377\324t\2702\317" + "\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402\377\377\262" + "\230\2242\307\300\213\377\377\377\244\2102\307\260|{^\377\200U0\220^\377" + "\7\4/\227U[\246]\377\7\3/\377\242y\236\37" + "2\306M0\210%\14T-2{^\377mVv\6" + "\5/\6\5/h\\\377\\U\204\\U\204\5\5/\5\5/VX\377VX\377LR\221LR\221\377\377\377" + "\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250\312\332" + "\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266\377" + "\377\377\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\365\375\363\377\377" + "\377O\3321l\22l\\\3202\335\364\323\357\346\357h\3042\325\355\305\377\377" + "\377t\2702\317\344\266l-l\200\2521\377\377\377\204\211=\310\316\231\377\377" + "\377\262\243L\307\300\213\377\377\377E&\25mVv{^\377ySB\220^\377\7\4/\275" + "t\201\246]\377\7\3/I\37!\277Z\377\10\3/\237YQ\6\4/{^\377\236\213\247mVv\6" + "\5/,-lh\\\377\\U\204dow\5\5/\5\5/\222\251\377VX\377\310\316\231T{@\377\377" + "\377\214\2402w\240V\377\377\377\377\377\377\377\377\377\377\377\377\312\332" + "\250U\231G\377\377\377\200\2542q\270\\\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377l\317l\317\344\266\317\344\266z\330v\377\377\377" + "\377\377\377\323\377\221t\2702t\2702l\352l\377\377\377\377\377\377\377\377" + "\377D\3502\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\364" + "\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200" + "\2542\312\332\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\307" + "\300\213\377\377\377\6\5/mVv{^\377\200U0\220^\377\7\4/\227U[\246]\377\7\3" + "/\255RN\277Z\377\10\3/\306M@\6\4/{^\377{^\377mVv\6\5/\6\5/h\\\377h\\\377" + "\\U\204\12\12\360\5\5/\12\12\360\377\377\377\377\377\377\310\316\231\310" + "\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377" + "\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200\254" + "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\317\344\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702" + "\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\3342\346\371\342" + "\377\377\377\\\3202\335\364\323\377\377\377h\3042\325\355\305\377\377\377" + "t\2702\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402" + "\310\316\231\377\377\377\230\2242\307\300\213h\\\377\6\5/mVv{^\377\200U0" + "\220^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{" + "^\377mVvmVv\6\5/\12\12\360h\\\377\\U\204\\U\204\5\5/\230\2242\377\377\377" + "\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214" + "\2402\377\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332" + "\250\377\377\377\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" + "\344\266\377\377\377\377\377\377\377\377\377\377\377\377D\3502q\10p\377\377" + "\377P\3342\335\350\332\377\377\377\\\3202\351\366\337\377\377\377h\3042d" + "!\\\377\377\377t\2702\277\302\252\377\377\377\200\2542\343\345\301\377\377" + "\377\214\2402^2H\377\377\377\230\2242\257\235\204h\\\377\6\5/\223o\234{^" + "\377\6\4/<\36" + "1\377\252\215j)2\211XK\377\250\203\202$2\337~c\377\242y\236" + "\37" + "2]#\26\306M@\6\4/ym\274{^\377mVvELn\6\5/h\\\37703x\\U\204\307\300\213" + "\204\226\\\230\2242\377\377\377\377\377\377\377\377\377\310\316\231^\212" + "H\377\377\377\214\2402}\256b\377\377\377\377\377\377\377\377\377\377\377" + "\377\312\332\250_\251O\377\377\377\377\377\377y\310j\200\2542\377\377\377" + "\377\377\377\377\377\377\377\377\377x\341x\377\377\377\377\377\377\177\350" + "|\317\344\266\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\334" + "2\346\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\304" + "2\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200\2542\312\332" + "\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\\U\204h\\\377" + "\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\255" + "RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377mVvmVv\6\5/\12\12\360h\\\377" + "\377\377\377\307\300\213\377\377\377\230\2242\230\2242\377\377\377\377\377" + "\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214\2402\377" + "\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\312" + "\332\250\377\377\377\200\2542\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\350" + "2\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377\377\377\\\320" + "2\335\364\323\377\377\377h\3042\325\355\305\377\377\377t\2702\317\344\266" + "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\214\2402\310\316" + "\231\377\377\377\5\5/\\U\204h\\\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220" + "^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{^\377" + "\12\12\360mVv\6\5/\6\5/\377\377\377\377\377\377\307\300\213\307\300\213\377" + "\377\377\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" + "\231\310\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377" + "\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377\377\377\377\377" + "\204\0\204\377\377\377D\3502\355\364\353\377\377\377\377\377\377Y\335;\346" + "\371\342\377\377\377/\26\31\335\364\323\377\377\377k\255<\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\2046\204\200\2542\312\332\250\340" + "\317\340\214\2402\310\316\231\377\377\377VX\377\5\5//\33Dh\\\377\6\5/tVz" + "{^\377\6\4/=0\377\201Vi\220^\377\3\1\30\227U[\246]\377?6U\255RN\277Z\377" + "\337]s\306M0\306M@\3\2\30{^\377{^\377yv}mVv\244\2102\377\377\377\377\377" + "\377\377\377\377gyG\307\300\213\230\2242\212\242h\377\377\377\377\377\377" + "\377\377\377\377\377\377\310\316\231g\230O\377\377\377\214\2402\205\274q" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377h\270V\312\332" + "\250\377\377\377\222\344\222\200\2542\200\2542\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346" + "\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\3042\325" + "\355\305\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" + "\332\250\377\377\377\214\2402\310\316\231VX\377\12\12\360\5\5/\\U\204h\\" + "\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3" + "/\255RN\255RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377\12\12\360\307\260" + "|\244\2102\244\2102\377\377\377\377\377\377\377\377\377\307\300\213\377\377" + "\377\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310" + "\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377" + "\377\377\377\200\2542\200\2542\377\377\377\377\377\377D\3502\377\377\377" + "\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\377\377\377" + "\335\364\323\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702" + "\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\377\377\377\214" + "\2402LR\221VX\377\5\5/\\U\204\12\12\360h\\\377\6\5/mVv{^\377\6\4/\12\12\360" + "\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\7\3/\255RN\277Z\377\10\3/\306M@" + "\6\4/\6\4/{^\377\377\377\377\307\260|\377\377\377\244\2102\377\377\377\377" + "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\377\377" + "\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231\377\377" + "\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377\377\377\377" + "\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377\377-\17\34\346" + "\371\342\377\377\377\363\346\363\\\3202\335\364\323\377\377\377h\3042\377" + "\377\377x)o\377\377\377t\2702\301\276\255\377\377\377\377\377\377\243\273" + "U\312\332\250\377\377\377O-\34\12\12\360LR\221gU\333\5\5/\\U\204<)\377h\\" + "\377\6\5/=!B{^\377\6\4/A2\306\201Vi\220^\377I9q\227U[\246]\377]-\220\7\3" + "/\255RN\245q\304\10\3/\306M0\377\236\221\6\4/\377\377\377\220\231\220\307" + "\260|\307\260|\226\227m\244\2102\377\377\377\377\377\377\377\377\377\307" + "\300\213p\207N\230\2242\230\2242\254\316\254\377\377\377\377\377\377\377" + "\377\377\310\316\231\310\316\231\220\317\220\377\377\377\214\2402\216\316" + "\200\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377r\310^\312" + "\332\250\377\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377" + "P\3342\377\377\377\346\371\342\377\377\377\\\3202\335\364\323\377\377\377" + "\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702\317\344\266" + "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\5\6/LR\221\12\12" + "\360VX\377\5\5/\\U\204h\\\377\12\12\360\6\5/mVv{^\377\6\4/\12\12\360\201" + "Vi\220^\377\7\4/\227U[\12\12\360\246]\377\7\3/\255RN\277Z\377\277Z\377\10" + "\3/\306M@\260|2\260|2\377\377\377\377\377\377\307\260|\377\377\377\244\210" + "2\377\377\377\377\377\377\377\377\377\377\377\377\307\300\213\377\377\377" + "\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" + "\231\310\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" + "\377\377D\3502\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377" + "\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" + "\332\250\377\377\377\12\12\360\5\6/LR\221VX\377\12\12\360\5\5/\\U\204h\\" + "\377\6\5/\12\12\360mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\227" + "U[\246]\377\7\3/\255RN\12\12\360\277Z\377\10\3/\333bB\377\377\377\260|2\377" + "\377\377\377\377\377\307\260|\307\260|\244\2102\244\2102\377\377\377\377" + "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\230\224" + "2\377\377\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231" + "\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377" + "\377\377\377\377\377\377\377\377\377\377)\10\36\362\375\360\377\377\377\370" + "\356\370P\3342\346\371\342\377\377\377\377\377\377\\\3202\207\"\201\377\377" + "\377\377\377\377p\250D\325\355\305\377\377\377\377\377\377t\2702\317\344" + "\266\234?\234\200\2542\377\377\377\274\260\244FS\377\5\6/;#\377LR\221VX\377" + "\3\1\34\12\12\360\\U\204{^\330\6\5/\12\12\360\257\203\270{^\377\6\4/\6\4" + "\222\201Vi\220^\377P@d\12\12\360\227U[\370\244\377\7\3/\255RNi./\277Z\377" + "\324X2\264\202w\333bB\260|2\377\377\377\377\377\377\377\377\377yvK\377\377" + "\377\244\2102\236\247|\377\377\377\377\377\377\377\377\377\307\300\213\307" + "\300\213\234\306\234\230\2242\377\377\377\256\330\256\377\377\377\377\377" + "\377\377\377\377\310\316\231\310\316\231\234\341\234\377\377\377\214\240" + "2\232\343\223\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375" + "\360\377\377\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\" + "\3202\335\364\323\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377" + "\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312\332\250\12" + "\12\360FS\377\5\6/LR\221\12\12\360RW\255\3\5\35\6\11\224ZT\\d[\261\3\4\35" + "\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270\4\3\35\6\11\224\226UG\242" + "\\\274\4\3\35\4\3\35\254R@\377\377\311\203U\36\203U\36\323a:my\36my\36\377" + "\377\276\377\377\276\243\255X\243\255X\236\371\236e\204\36\236\371\236\374" + "\377\273\236\371\236\236\371\236\234\275`\236\371\236^\220\36^\220\36\236" + "\371\236\352\377\267\352\377\267\236\371\236\236\371\236\310\316\231\310" + "\316\231\377\377\377\377\377\377\214\2402\377\377\377\377\377\377\377\377" + "\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346\371\342\377\377" + "\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\377\377" + "\377\325\355\305\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377" + "\377\377\200\2542\346\3\4\35lVT\4\4hw]\264\4\4\35aK\244\200VN\214]\270kZ\371\4\3\35" + "\270\212Io\225o\377\377\306{a\36\253\300\253\304wB\377\377\311\377\377\377" + "\203U\36\323a:\224D(my\36\236\371\236\307\316\266\377\377\276\236\371\236" + "\377\377\343\236\371\236e\204\36Gk\25\236\371\236\374\377\273\260\334\260" + "\236\371\236\234\275`\377\377\377\377\377\377\230\2242k\207#\377\377\377" + "\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377" + "\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\\3202\377\377" + "\377\335\364\323\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377" + "\377\377\377\377\377t\2702\317\344\266\377\377\3778L\377\12\12\360\5\6/<" + "L\237\12\12\360BR\252\3\5\35\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\\6\11\224" + "d[\261\6\11\224\3\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6" + "\11\224tm\36\270\212I\270\212I\377\377\306{a\36{a\36\304wB\236\371\236\377" + "\377\311\203U\36\236\371\236\323a:my\36my\36\236\371\236\377\377\276\236" + "\371\236\243\255X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374" + "\377\273\236\371\236\307\300\213\307\300\213\377\377\377\377\377\377\230" + "\2242\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377" + "\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377\377\377" + "\\\3202\335\364\323\377\377\377\377\377\377\377\377\377h\3042\325\355\305" + "\377\377\377\377\377\377t\2702\377\377\377\317\344\2668L\377\12\12\360\5" + "\6/\12\12\360 + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ /* quiet windows compiler warnings */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -# define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS #endif #include "SDL_config.h" @@ -43,8 +43,7 @@ /* work around compiler warning on older GCCs. */ #if (defined(__GNUC__) && (__GNUC__ <= 2)) -static size_t -strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm *tm) +static size_t strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm *tm) { return strftime(s, max, fmt, tm); } @@ -65,16 +64,21 @@ strftime_gcc2_workaround(char *s, size_t max, const char *fmt, const struct tm * * * \return Ascii representation of the timestamp in localtime in the format '08/23/01 14:55:02' */ -static char *SDLTest_TimestampToString(const time_t timestamp) +static const char * +SDLTest_TimestampToString(const time_t timestamp) { time_t copy; static char buffer[64]; struct tm *local; + size_t result = 0; SDL_memset(buffer, 0, sizeof(buffer)); copy = timestamp; local = localtime(©); - strftime(buffer, sizeof(buffer), "%x %X", local); + result = strftime(buffer, sizeof(buffer), "%x %X", local); + if (result == 0) { + return ""; + } return buffer; } @@ -90,7 +94,7 @@ void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) /* Print log message into a buffer */ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); va_start(list, fmt); - SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); + (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); va_end(list); /* Log with timestamp and newline */ @@ -108,7 +112,7 @@ void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) /* Print log message into a buffer */ SDL_memset(logMessage, 0, SDLTEST_MAX_LOGMESSAGE_LENGTH); va_start(list, fmt); - SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); + (void)SDL_vsnprintf(logMessage, SDLTEST_MAX_LOGMESSAGE_LENGTH - 1, fmt, list); va_end(list); /* Log with timestamp and newline */ diff --git a/src/test/SDL_test_md5.c b/src/test/SDL_test_md5.c index 662e2fa0c2285..fe9f938500599 100644 --- a/src/test/SDL_test_md5.c +++ b/src/test/SDL_test_md5.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -56,17 +56,17 @@ #include "SDL_test.h" /* Forward declaration of static helper function */ -static void SDLTest_Md5Transform(MD5UINT4 * buf, const MD5UINT4 * in); +static void SDLTest_Md5Transform(MD5UINT4 *buf, const MD5UINT4 *in); static unsigned char MD5PADDING[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* F, G, H and I are basic MD5 functions */ @@ -76,50 +76,56 @@ static unsigned char MD5PADDING[64] = { #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ /* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s, ac) \ - {(a) += F ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) \ - {(a) += G ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) \ - {(a) += H ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) \ - {(a) += I ((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } +#define FF(a, b, c, d, x, s, ac) \ + { \ + (a) += F((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) \ + { \ + (a) += G((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) \ + { \ + (a) += H((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) \ + { \ + (a) += I((b), (c), (d)) + (x) + (MD5UINT4)(ac); \ + (a) = ROTATE_LEFT((a), (s)); \ + (a) += (b); \ + } /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. */ -void SDLTest_Md5Init(SDLTest_Md5Context * mdContext) +void SDLTest_Md5Init(SDLTest_Md5Context *mdContext) { - if (mdContext==NULL) return; + if (!mdContext) { + return; + } - mdContext->i[0] = mdContext->i[1] = (MD5UINT4) 0; + mdContext->i[0] = mdContext->i[1] = (MD5UINT4)0; - /* - * Load magic initialization constants. - */ - mdContext->buf[0] = (MD5UINT4) 0x67452301; - mdContext->buf[1] = (MD5UINT4) 0xefcdab89; - mdContext->buf[2] = (MD5UINT4) 0x98badcfe; - mdContext->buf[3] = (MD5UINT4) 0x10325476; + /* + * Load magic initialization constants. + */ + mdContext->buf[0] = (MD5UINT4)0x67452301; + mdContext->buf[1] = (MD5UINT4)0xefcdab89; + mdContext->buf[2] = (MD5UINT4)0x98badcfe; + mdContext->buf[3] = (MD5UINT4)0x10325476; } /* @@ -128,48 +134,51 @@ void SDLTest_Md5Init(SDLTest_Md5Context * mdContext) in the message whose digest is being computed. */ -void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, - unsigned int inLen) +void SDLTest_Md5Update(SDLTest_Md5Context *mdContext, unsigned char *inBuf, + unsigned int inLen) { - MD5UINT4 in[16]; - int mdi; - unsigned int i, ii; - - if (mdContext == NULL) return; - if (inBuf == NULL || inLen < 1) return; - - /* - * compute number of bytes mod 64 - */ - mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); - - /* - * update number of bits - */ - if ((mdContext->i[0] + ((MD5UINT4) inLen << 3)) < mdContext->i[0]) - mdContext->i[1]++; - mdContext->i[0] += ((MD5UINT4) inLen << 3); - mdContext->i[1] += ((MD5UINT4) inLen >> 29); - - while (inLen--) { + MD5UINT4 in[16]; + int mdi; + unsigned int i, ii; + + if (!mdContext) { + return; + } + if (!inBuf || inLen < 1) { + return; + } + /* - * add new character to buffer, increment mdi + * compute number of bytes mod 64 */ - mdContext->in[mdi++] = *inBuf++; + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); /* - * transform if necessary + * update number of bits */ - if (mdi == 0x40) { - for (i = 0, ii = 0; i < 16; i++, ii += 4) - in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) | - (((MD5UINT4) mdContext->in[ii + 2]) << 16) | - (((MD5UINT4) mdContext->in[ii + 1]) << 8) | - ((MD5UINT4) mdContext->in[ii]); - SDLTest_Md5Transform(mdContext->buf, in); - mdi = 0; + if ((mdContext->i[0] + ((MD5UINT4)inLen << 3)) < mdContext->i[0]) { + mdContext->i[1]++; + } + mdContext->i[0] += ((MD5UINT4)inLen << 3); + mdContext->i[1] += ((MD5UINT4)inLen >> 29); + + while (inLen--) { + /* + * add new character to buffer, increment mdi + */ + mdContext->in[mdi++] = *inBuf++; + + /* + * transform if necessary + */ + if (mdi == 0x40) { + for (i = 0, ii = 0; i < 16; i++, ii += 4) { + in[i] = (((MD5UINT4)mdContext->in[ii + 3]) << 24) | (((MD5UINT4)mdContext->in[ii + 2]) << 16) | (((MD5UINT4)mdContext->in[ii + 1]) << 8) | ((MD5UINT4)mdContext->in[ii]); + } + SDLTest_Md5Transform(mdContext->buf, in); + mdi = 0; + } } - } } /* @@ -177,162 +186,162 @@ void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, ends with the desired message digest in mdContext->digest[0...15]. */ -void SDLTest_Md5Final(SDLTest_Md5Context * mdContext) +void SDLTest_Md5Final(SDLTest_Md5Context *mdContext) { - MD5UINT4 in[16]; - int mdi; - unsigned int i, ii; - unsigned int padLen; - - if (mdContext == NULL) return; - - /* - * save number of bits - */ - in[14] = mdContext->i[0]; - in[15] = mdContext->i[1]; - - /* - * compute number of bytes mod 64 - */ - mdi = (int) ((mdContext->i[0] >> 3) & 0x3F); - - /* - * pad out to 56 mod 64 - */ - padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - SDLTest_Md5Update(mdContext, MD5PADDING, padLen); - - /* - * append length in bits and transform - */ - for (i = 0, ii = 0; i < 14; i++, ii += 4) - in[i] = (((MD5UINT4) mdContext->in[ii + 3]) << 24) | - (((MD5UINT4) mdContext->in[ii + 2]) << 16) | - (((MD5UINT4) mdContext->in[ii + 1]) << 8) | - ((MD5UINT4) mdContext->in[ii]); - SDLTest_Md5Transform(mdContext->buf, in); - - /* - * store buffer in digest - */ - for (i = 0, ii = 0; i < 4; i++, ii += 4) { - mdContext->digest[ii] = (unsigned char) (mdContext->buf[i] & 0xFF); - mdContext->digest[ii + 1] = - (unsigned char) ((mdContext->buf[i] >> 8) & 0xFF); - mdContext->digest[ii + 2] = - (unsigned char) ((mdContext->buf[i] >> 16) & 0xFF); - mdContext->digest[ii + 3] = - (unsigned char) ((mdContext->buf[i] >> 24) & 0xFF); - } + MD5UINT4 in[16]; + int mdi; + unsigned int i, ii; + unsigned int padLen; + + if (!mdContext) { + return; + } + + /* + * save number of bits + */ + in[14] = mdContext->i[0]; + in[15] = mdContext->i[1]; + + /* + * compute number of bytes mod 64 + */ + mdi = (int)((mdContext->i[0] >> 3) & 0x3F); + + /* + * pad out to 56 mod 64 + */ + padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); + SDLTest_Md5Update(mdContext, MD5PADDING, padLen); + + /* + * append length in bits and transform + */ + for (i = 0, ii = 0; i < 14; i++, ii += 4) { + in[i] = (((MD5UINT4)mdContext->in[ii + 3]) << 24) | (((MD5UINT4)mdContext->in[ii + 2]) << 16) | (((MD5UINT4)mdContext->in[ii + 1]) << 8) | ((MD5UINT4)mdContext->in[ii]); + } + SDLTest_Md5Transform(mdContext->buf, in); + + /* + * store buffer in digest + */ + for (i = 0, ii = 0; i < 4; i++, ii += 4) { + mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF); + mdContext->digest[ii + 1] = + (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); + mdContext->digest[ii + 2] = + (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); + mdContext->digest[ii + 3] = + (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); + } } /* Basic MD5 step. Transforms buf based on in. */ -static void SDLTest_Md5Transform(MD5UINT4 * buf, const MD5UINT4 * in) +static void SDLTest_Md5Transform(MD5UINT4 *buf, const MD5UINT4 *in) { - MD5UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; + MD5UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; - /* - * Round 1 - */ + /* + * Round 1 + */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 - FF(a, b, c, d, in[0], S11, 3614090360u); /* 1 */ - FF(d, a, b, c, in[1], S12, 3905402710u); /* 2 */ - FF(c, d, a, b, in[2], S13, 606105819u); /* 3 */ - FF(b, c, d, a, in[3], S14, 3250441966u); /* 4 */ - FF(a, b, c, d, in[4], S11, 4118548399u); /* 5 */ - FF(d, a, b, c, in[5], S12, 1200080426u); /* 6 */ - FF(c, d, a, b, in[6], S13, 2821735955u); /* 7 */ - FF(b, c, d, a, in[7], S14, 4249261313u); /* 8 */ - FF(a, b, c, d, in[8], S11, 1770035416u); /* 9 */ - FF(d, a, b, c, in[9], S12, 2336552879u); /* 10 */ - FF(c, d, a, b, in[10], S13, 4294925233u); /* 11 */ - FF(b, c, d, a, in[11], S14, 2304563134u); /* 12 */ - FF(a, b, c, d, in[12], S11, 1804603682u); /* 13 */ - FF(d, a, b, c, in[13], S12, 4254626195u); /* 14 */ - FF(c, d, a, b, in[14], S13, 2792965006u); /* 15 */ - FF(b, c, d, a, in[15], S14, 1236535329u); /* 16 */ - - /* - * Round 2 - */ + FF(a, b, c, d, in[0], S11, 3614090360u); /* 1 */ + FF(d, a, b, c, in[1], S12, 3905402710u); /* 2 */ + FF(c, d, a, b, in[2], S13, 606105819u); /* 3 */ + FF(b, c, d, a, in[3], S14, 3250441966u); /* 4 */ + FF(a, b, c, d, in[4], S11, 4118548399u); /* 5 */ + FF(d, a, b, c, in[5], S12, 1200080426u); /* 6 */ + FF(c, d, a, b, in[6], S13, 2821735955u); /* 7 */ + FF(b, c, d, a, in[7], S14, 4249261313u); /* 8 */ + FF(a, b, c, d, in[8], S11, 1770035416u); /* 9 */ + FF(d, a, b, c, in[9], S12, 2336552879u); /* 10 */ + FF(c, d, a, b, in[10], S13, 4294925233u); /* 11 */ + FF(b, c, d, a, in[11], S14, 2304563134u); /* 12 */ + FF(a, b, c, d, in[12], S11, 1804603682u); /* 13 */ + FF(d, a, b, c, in[13], S12, 4254626195u); /* 14 */ + FF(c, d, a, b, in[14], S13, 2792965006u); /* 15 */ + FF(b, c, d, a, in[15], S14, 1236535329u); /* 16 */ + + /* + * Round 2 + */ #define S21 5 #define S22 9 #define S23 14 #define S24 20 - GG(a, b, c, d, in[1], S21, 4129170786u); /* 17 */ - GG(d, a, b, c, in[6], S22, 3225465664u); /* 18 */ - GG(c, d, a, b, in[11], S23, 643717713u); /* 19 */ - GG(b, c, d, a, in[0], S24, 3921069994u); /* 20 */ - GG(a, b, c, d, in[5], S21, 3593408605u); /* 21 */ - GG(d, a, b, c, in[10], S22, 38016083u); /* 22 */ - GG(c, d, a, b, in[15], S23, 3634488961u); /* 23 */ - GG(b, c, d, a, in[4], S24, 3889429448u); /* 24 */ - GG(a, b, c, d, in[9], S21, 568446438u); /* 25 */ - GG(d, a, b, c, in[14], S22, 3275163606u); /* 26 */ - GG(c, d, a, b, in[3], S23, 4107603335u); /* 27 */ - GG(b, c, d, a, in[8], S24, 1163531501u); /* 28 */ - GG(a, b, c, d, in[13], S21, 2850285829u); /* 29 */ - GG(d, a, b, c, in[2], S22, 4243563512u); /* 30 */ - GG(c, d, a, b, in[7], S23, 1735328473u); /* 31 */ - GG(b, c, d, a, in[12], S24, 2368359562u); /* 32 */ - - /* - * Round 3 - */ + GG(a, b, c, d, in[1], S21, 4129170786u); /* 17 */ + GG(d, a, b, c, in[6], S22, 3225465664u); /* 18 */ + GG(c, d, a, b, in[11], S23, 643717713u); /* 19 */ + GG(b, c, d, a, in[0], S24, 3921069994u); /* 20 */ + GG(a, b, c, d, in[5], S21, 3593408605u); /* 21 */ + GG(d, a, b, c, in[10], S22, 38016083u); /* 22 */ + GG(c, d, a, b, in[15], S23, 3634488961u); /* 23 */ + GG(b, c, d, a, in[4], S24, 3889429448u); /* 24 */ + GG(a, b, c, d, in[9], S21, 568446438u); /* 25 */ + GG(d, a, b, c, in[14], S22, 3275163606u); /* 26 */ + GG(c, d, a, b, in[3], S23, 4107603335u); /* 27 */ + GG(b, c, d, a, in[8], S24, 1163531501u); /* 28 */ + GG(a, b, c, d, in[13], S21, 2850285829u); /* 29 */ + GG(d, a, b, c, in[2], S22, 4243563512u); /* 30 */ + GG(c, d, a, b, in[7], S23, 1735328473u); /* 31 */ + GG(b, c, d, a, in[12], S24, 2368359562u); /* 32 */ + + /* + * Round 3 + */ #define S31 4 #define S32 11 #define S33 16 #define S34 23 - HH(a, b, c, d, in[5], S31, 4294588738u); /* 33 */ - HH(d, a, b, c, in[8], S32, 2272392833u); /* 34 */ - HH(c, d, a, b, in[11], S33, 1839030562u); /* 35 */ - HH(b, c, d, a, in[14], S34, 4259657740u); /* 36 */ - HH(a, b, c, d, in[1], S31, 2763975236u); /* 37 */ - HH(d, a, b, c, in[4], S32, 1272893353u); /* 38 */ - HH(c, d, a, b, in[7], S33, 4139469664u); /* 39 */ - HH(b, c, d, a, in[10], S34, 3200236656u); /* 40 */ - HH(a, b, c, d, in[13], S31, 681279174u); /* 41 */ - HH(d, a, b, c, in[0], S32, 3936430074u); /* 42 */ - HH(c, d, a, b, in[3], S33, 3572445317u); /* 43 */ - HH(b, c, d, a, in[6], S34, 76029189u); /* 44 */ - HH(a, b, c, d, in[9], S31, 3654602809u); /* 45 */ - HH(d, a, b, c, in[12], S32, 3873151461u); /* 46 */ - HH(c, d, a, b, in[15], S33, 530742520u); /* 47 */ - HH(b, c, d, a, in[2], S34, 3299628645u); /* 48 */ - - /* - * Round 4 - */ + HH(a, b, c, d, in[5], S31, 4294588738u); /* 33 */ + HH(d, a, b, c, in[8], S32, 2272392833u); /* 34 */ + HH(c, d, a, b, in[11], S33, 1839030562u); /* 35 */ + HH(b, c, d, a, in[14], S34, 4259657740u); /* 36 */ + HH(a, b, c, d, in[1], S31, 2763975236u); /* 37 */ + HH(d, a, b, c, in[4], S32, 1272893353u); /* 38 */ + HH(c, d, a, b, in[7], S33, 4139469664u); /* 39 */ + HH(b, c, d, a, in[10], S34, 3200236656u); /* 40 */ + HH(a, b, c, d, in[13], S31, 681279174u); /* 41 */ + HH(d, a, b, c, in[0], S32, 3936430074u); /* 42 */ + HH(c, d, a, b, in[3], S33, 3572445317u); /* 43 */ + HH(b, c, d, a, in[6], S34, 76029189u); /* 44 */ + HH(a, b, c, d, in[9], S31, 3654602809u); /* 45 */ + HH(d, a, b, c, in[12], S32, 3873151461u); /* 46 */ + HH(c, d, a, b, in[15], S33, 530742520u); /* 47 */ + HH(b, c, d, a, in[2], S34, 3299628645u); /* 48 */ + + /* + * Round 4 + */ #define S41 6 #define S42 10 #define S43 15 #define S44 21 - II(a, b, c, d, in[0], S41, 4096336452u); /* 49 */ - II(d, a, b, c, in[7], S42, 1126891415u); /* 50 */ - II(c, d, a, b, in[14], S43, 2878612391u); /* 51 */ - II(b, c, d, a, in[5], S44, 4237533241u); /* 52 */ - II(a, b, c, d, in[12], S41, 1700485571u); /* 53 */ - II(d, a, b, c, in[3], S42, 2399980690u); /* 54 */ - II(c, d, a, b, in[10], S43, 4293915773u); /* 55 */ - II(b, c, d, a, in[1], S44, 2240044497u); /* 56 */ - II(a, b, c, d, in[8], S41, 1873313359u); /* 57 */ - II(d, a, b, c, in[15], S42, 4264355552u); /* 58 */ - II(c, d, a, b, in[6], S43, 2734768916u); /* 59 */ - II(b, c, d, a, in[13], S44, 1309151649u); /* 60 */ - II(a, b, c, d, in[4], S41, 4149444226u); /* 61 */ - II(d, a, b, c, in[11], S42, 3174756917u); /* 62 */ - II(c, d, a, b, in[2], S43, 718787259u); /* 63 */ - II(b, c, d, a, in[9], S44, 3951481745u); /* 64 */ - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; + II(a, b, c, d, in[0], S41, 4096336452u); /* 49 */ + II(d, a, b, c, in[7], S42, 1126891415u); /* 50 */ + II(c, d, a, b, in[14], S43, 2878612391u); /* 51 */ + II(b, c, d, a, in[5], S44, 4237533241u); /* 52 */ + II(a, b, c, d, in[12], S41, 1700485571u); /* 53 */ + II(d, a, b, c, in[3], S42, 2399980690u); /* 54 */ + II(c, d, a, b, in[10], S43, 4293915773u); /* 55 */ + II(b, c, d, a, in[1], S44, 2240044497u); /* 56 */ + II(a, b, c, d, in[8], S41, 1873313359u); /* 57 */ + II(d, a, b, c, in[15], S42, 4264355552u); /* 58 */ + II(c, d, a, b, in[6], S43, 2734768916u); /* 59 */ + II(b, c, d, a, in[13], S44, 1309151649u); /* 60 */ + II(a, b, c, d, in[4], S41, 4149444226u); /* 61 */ + II(d, a, b, c, in[11], S42, 3174756917u); /* 62 */ + II(c, d, a, b, in[2], S43, 718787259u); /* 63 */ + II(b, c, d, a, in[9], S44, 3951481745u); /* 64 */ + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index 067b7a5b3039f..066c64f666f87 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,6 +20,8 @@ */ #include "SDL_config.h" #include "SDL_assert.h" +#include "SDL_atomic.h" +#include "SDL_loadso.h" #include "SDL_stdinc.h" #include "SDL_log.h" #include "SDL_test_crc32.h" @@ -28,6 +30,31 @@ #ifdef HAVE_LIBUNWIND_H #define UNW_LOCAL_ONLY #include +#ifndef unw_get_proc_name_by_ip +#define SDLTEST_UNWIND_NO_PROC_NAME_BY_IP +static SDL_bool s_unwind_symbol_names = SDL_TRUE; +#endif +#endif + +#if defined(__WIN32__) && !defined(__WATCOMC__) +#define WIN32_WITH_DBGHELP +#endif + +#ifdef WIN32_WITH_DBGHELP +#include +#include + +static struct { + HMODULE module; + BOOL (WINAPI *pSymInitialize)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess); + BOOL (WINAPI *pSymFromAddr)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol); + BOOL (WINAPI *pSymGetLineFromAddr64)(HANDLE hProcess, DWORD64 qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line); +} dyn_dbghelp; + +/* older SDKs might not have this: */ +__declspec(dllimport) USHORT WINAPI RtlCaptureStackBackTrace(ULONG FramesToSkip, ULONG FramesToCapture, PVOID* BackTrace, PULONG BackTraceHash); +#define CaptureStackBackTrace RtlCaptureStackBackTrace + #endif /* This is a simple tracking allocator to demonstrate the use of SDL's @@ -37,13 +64,17 @@ for production code. */ +#define MAXIMUM_TRACKED_STACK_DEPTH 16 + typedef struct SDL_tracked_allocation { void *mem; size_t size; - Uint64 stack[10]; - char stack_names[10][256]; + Uint64 stack[MAXIMUM_TRACKED_STACK_DEPTH]; struct SDL_tracked_allocation *next; +#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP + char stack_names[MAXIMUM_TRACKED_STACK_DEPTH][256]; +#endif } SDL_tracked_allocation; static SDLTest_Crc32Context s_crc32_context; @@ -53,6 +84,16 @@ static SDL_realloc_func SDL_realloc_orig = NULL; static SDL_free_func SDL_free_orig = NULL; static int s_previous_allocations = 0; static SDL_tracked_allocation *s_tracked_allocations[256]; +static SDL_atomic_t s_lock; + +#define LOCK_ALLOCATOR() \ + do { \ + if (SDL_AtomicCAS(&s_lock, 0, 1)) { \ + break; \ + } \ + SDL_CPUPauseInstruction(); \ + } while (SDL_TRUE) +#define UNLOCK_ALLOCATOR() do { SDL_AtomicSet(&s_lock, 0); } while (0) static unsigned int get_allocation_bucket(void *mem) { @@ -62,16 +103,21 @@ static unsigned int get_allocation_bucket(void *mem) index = (crc_value & (SDL_arraysize(s_tracked_allocations) - 1)); return index; } - + static SDL_bool SDL_IsAllocationTracked(void *mem) { SDL_tracked_allocation *entry; - int index = get_allocation_bucket(mem); + int index; + + LOCK_ALLOCATOR(); + index = get_allocation_bucket(mem); for (entry = s_tracked_allocations[index]; entry; entry = entry->next) { if (mem == entry->mem) { + UNLOCK_ALLOCATOR(); return SDL_TRUE; } } + UNLOCK_ALLOCATOR(); return SDL_FALSE; } @@ -83,8 +129,10 @@ static void SDL_TrackAllocation(void *mem, size_t size) if (SDL_IsAllocationTracked(mem)) { return; } + LOCK_ALLOCATOR(); entry = (SDL_tracked_allocation *)SDL_malloc_orig(sizeof(*entry)); if (!entry) { + UNLOCK_ALLOCATOR(); return; } entry->mem = mem; @@ -103,15 +151,20 @@ static void SDL_TrackAllocation(void *mem, size_t size) stack_index = 0; while (unw_step(&cursor) > 0) { - unw_word_t offset, pc; + unw_word_t pc; +#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP + unw_word_t offset; char sym[236]; +#endif unw_get_reg(&cursor, UNW_REG_IP, &pc); entry->stack[stack_index] = pc; - if (unw_get_proc_name(&cursor, sym, sizeof(sym), &offset) == 0) { +#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP + if (s_unwind_symbol_names && unw_get_proc_name(&cursor, sym, sizeof(sym), &offset) == 0) { SDL_snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset); } +#endif ++stack_index; if (stack_index == SDL_arraysize(entry->stack)) { @@ -119,10 +172,24 @@ static void SDL_TrackAllocation(void *mem, size_t size) } } } +#elif defined(WIN32_WITH_DBGHELP) + { + Uint32 count; + PVOID frames[63]; + Uint32 i; + + count = CaptureStackBackTrace(1, SDL_arraysize(frames), frames, NULL); + + count = SDL_min(count, MAXIMUM_TRACKED_STACK_DEPTH); + for (i = 0; i < count; i++) { + entry->stack[i] = (Uint64)(uintptr_t)frames[i]; + } + } #endif /* HAVE_LIBUNWIND_H */ entry->next = s_tracked_allocations[index]; s_tracked_allocations[index] = entry; + UNLOCK_ALLOCATOR(); } static void SDL_UntrackAllocation(void *mem) @@ -130,6 +197,7 @@ static void SDL_UntrackAllocation(void *mem) SDL_tracked_allocation *entry, *prev; int index = get_allocation_bucket(mem); + LOCK_ALLOCATOR(); prev = NULL; for (entry = s_tracked_allocations[index]; entry; entry = entry->next) { if (mem == entry->mem) { @@ -139,13 +207,15 @@ static void SDL_UntrackAllocation(void *mem) s_tracked_allocations[index] = entry->next; } SDL_free_orig(entry); + UNLOCK_ALLOCATOR(); return; } prev = entry; } + UNLOCK_ALLOCATOR(); } -static void * SDLCALL SDLTest_TrackedMalloc(size_t size) +static void *SDLCALL SDLTest_TrackedMalloc(size_t size) { void *mem; @@ -156,7 +226,7 @@ static void * SDLCALL SDLTest_TrackedMalloc(size_t size) return mem; } -static void * SDLCALL SDLTest_TrackedCalloc(size_t nmemb, size_t size) +static void *SDLCALL SDLTest_TrackedCalloc(size_t nmemb, size_t size) { void *mem; @@ -167,11 +237,11 @@ static void * SDLCALL SDLTest_TrackedCalloc(size_t nmemb, size_t size) return mem; } -static void * SDLCALL SDLTest_TrackedRealloc(void *ptr, size_t size) +static void *SDLCALL SDLTest_TrackedRealloc(void *ptr, size_t size) { void *mem; - SDL_assert(!ptr || SDL_IsAllocationTracked(ptr)); + SDL_assert(ptr == NULL || SDL_IsAllocationTracked(ptr)); mem = SDL_realloc_orig(ptr, size); if (mem && mem != ptr) { if (ptr) { @@ -195,7 +265,7 @@ static void SDLCALL SDLTest_TrackedFree(void *ptr) SDL_free_orig(ptr); } -int SDLTest_TrackAllocations() +int SDLTest_TrackAllocations(void) { if (SDL_malloc_orig) { return 0; @@ -207,6 +277,41 @@ int SDLTest_TrackAllocations() if (s_previous_allocations != 0) { SDL_Log("SDLTest_TrackAllocations(): There are %d previous allocations, disabling free() validation", s_previous_allocations); } +#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP + do { + /* Don't use SDL_GetHint: SDL_malloc is off limits. */ + const char *env_trackmem = SDL_getenv("SDL_TRACKMEM_SYMBOL_NAMES"); + if (env_trackmem) { + if (SDL_strcasecmp(env_trackmem, "1") == 0 || SDL_strcasecmp(env_trackmem, "yes") == 0 || SDL_strcasecmp(env_trackmem, "true") == 0) { + s_unwind_symbol_names = SDL_TRUE; + } else if (SDL_strcasecmp(env_trackmem, "0") == 0 || SDL_strcasecmp(env_trackmem, "no") == 0 || SDL_strcasecmp(env_trackmem, "false") == 0) { + s_unwind_symbol_names = SDL_FALSE; + } + } + } while (0); +#elif defined(WIN32_WITH_DBGHELP) + do { + dyn_dbghelp.module = SDL_LoadObject("dbghelp.dll"); + if (!dyn_dbghelp.module) { + goto dbghelp_failed; + } + dyn_dbghelp.pSymInitialize = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymInitialize"); + dyn_dbghelp.pSymFromAddr = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymFromAddr"); + dyn_dbghelp.pSymGetLineFromAddr64 = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymGetLineFromAddr64"); + if (!dyn_dbghelp.pSymInitialize || !dyn_dbghelp.pSymFromAddr || !dyn_dbghelp.pSymGetLineFromAddr64) { + goto dbghelp_failed; + } + if (!dyn_dbghelp.pSymInitialize(GetCurrentProcess(), NULL, TRUE)) { + goto dbghelp_failed; + } + break; + dbghelp_failed: + if (dyn_dbghelp.module) { + SDL_UnloadObject(dyn_dbghelp.module); + dyn_dbghelp.module = NULL; + } + } while (0); +#endif SDL_GetMemoryFunctions(&SDL_malloc_orig, &SDL_calloc_orig, @@ -220,11 +325,11 @@ int SDLTest_TrackAllocations() return 0; } -void SDLTest_LogAllocations() +void SDLTest_LogAllocations(void) { char *message = NULL; size_t message_size = 0; - char line[128], *tmp; + char line[256], *tmp; SDL_tracked_allocation *entry; int index, count, stack_index; Uint64 total_allocated; @@ -233,13 +338,19 @@ void SDLTest_LogAllocations() return; } -#define ADD_LINE() \ - message_size += (SDL_strlen(line) + 1); \ + message = SDL_realloc_orig(NULL, 1); + if (!message) { + return; + } + *message = 0; + +#define ADD_LINE() \ + message_size += (SDL_strlen(line) + 1); \ tmp = (char *)SDL_realloc_orig(message, message_size); \ - if (!tmp) { \ - return; \ - } \ - message = tmp; \ + if (!tmp) { \ + return; \ + } \ + message = tmp; \ SDL_strlcat(message, line, message_size) SDL_strlcpy(line, "Memory allocations:\n", sizeof(line)); @@ -251,21 +362,59 @@ void SDLTest_LogAllocations() total_allocated = 0; for (index = 0; index < SDL_arraysize(s_tracked_allocations); ++index) { for (entry = s_tracked_allocations[index]; entry; entry = entry->next) { - SDL_snprintf(line, sizeof(line), "Allocation %d: %d bytes\n", count, (int)entry->size); + (void)SDL_snprintf(line, sizeof(line), "Allocation %d: %d bytes\n", count, (int)entry->size); ADD_LINE(); /* Start at stack index 1 to skip our tracking functions */ for (stack_index = 1; stack_index < SDL_arraysize(entry->stack); ++stack_index) { + char stack_entry_description[256] = "???"; if (!entry->stack[stack_index]) { break; } - SDL_snprintf(line, sizeof(line), "\t0x%"SDL_PRIx64": %s\n", entry->stack[stack_index], entry->stack_names[stack_index]); +#ifdef HAVE_LIBUNWIND_H + { +#ifdef SDLTEST_UNWIND_NO_PROC_NAME_BY_IP + if (s_unwind_symbol_names) { + (void)SDL_snprintf(stack_entry_description, sizeof(stack_entry_description), "%s", entry->stack_names[stack_index]); + } +#else + char name[256] = "???"; + unw_word_t offset = 0; + unw_get_proc_name_by_ip(unw_local_addr_space, entry->stack[stack_index], name, sizeof(name), &offset, NULL); + (void)SDL_snprintf(stack_entry_description, sizeof(stack_entry_description), "%s+0x%llx", name, (long long unsigned int)offset); +#endif + } +#elif defined(WIN32_WITH_DBGHELP) + { + DWORD64 dwDisplacement = 0; + IMAGEHLP_LINE64 dbg_line; + char symbol_buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(TCHAR)]; + PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbol_buffer; + DWORD lineColumn = 0; + pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); + pSymbol->MaxNameLen = MAX_SYM_NAME; + dbg_line.SizeOfStruct = sizeof(dbg_line); + dbg_line.FileName = ""; + dbg_line.LineNumber = 0; + + if (dyn_dbghelp.module) { + if (!dyn_dbghelp.pSymFromAddr(GetCurrentProcess(), entry->stack[stack_index], &dwDisplacement, pSymbol)) { + SDL_strlcpy(pSymbol->Name, "???", MAX_SYM_NAME); + dwDisplacement = 0; + } + dyn_dbghelp.pSymGetLineFromAddr64(GetCurrentProcess(), (DWORD64)entry->stack[stack_index], &lineColumn, &dbg_line); + } + SDL_snprintf(stack_entry_description, sizeof(stack_entry_description), "%s+0x%I64x %s:%u", pSymbol->Name, dwDisplacement, dbg_line.FileName, (Uint32)dbg_line.LineNumber); + } +#endif + (void)SDL_snprintf(line, sizeof(line), "\t0x%" SDL_PRIx64 ": %s\n", entry->stack[stack_index], stack_entry_description); + ADD_LINE(); } total_allocated += entry->size; ++count; } } - SDL_snprintf(line, sizeof(line), "Total: %.2f Kb in %d allocations\n", (float)total_allocated / 1024, count); + (void)SDL_snprintf(line, sizeof(line), "Total: %.2f Kb in %d allocations\n", total_allocated / 1024.0, count); ADD_LINE(); #undef ADD_LINE diff --git a/src/test/SDL_test_random.c b/src/test/SDL_test_random.c index b2babf18c8c88..4d87e5b583e26 100644 --- a/src/test/SDL_test_random.c +++ b/src/test/SDL_test_random.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,60 +38,67 @@ /* Initialize random number generator with two integer variables */ -void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, unsigned int ci) +void SDLTest_RandomInit(SDLTest_RandomContext *rndContext, unsigned int xi, unsigned int ci) { - if (rndContext==NULL) return; - - /* - * Choose a value for 'a' from this list - * 1791398085 1929682203 1683268614 1965537969 1675393560 - * 1967773755 1517746329 1447497129 1655692410 1606218150 - * 2051013963 1075433238 1557985959 1781943330 1893513180 - * 1631296680 2131995753 2083801278 1873196400 1554115554 - */ - rndContext->a = 1655692410; - rndContext->x = 30903; - rndContext->c = 0; - if (xi != 0) { - rndContext->x = xi; - } - rndContext->c = ci; - rndContext->ah = rndContext->a >> 16; - rndContext->al = rndContext->a & 65535; + if (!rndContext) { + return; + } + + /* + * Choose a value for 'a' from this list + * 1791398085 1929682203 1683268614 1965537969 1675393560 + * 1967773755 1517746329 1447497129 1655692410 1606218150 + * 2051013963 1075433238 1557985959 1781943330 1893513180 + * 1631296680 2131995753 2083801278 1873196400 1554115554 + */ + rndContext->a = 1655692410; + rndContext->x = 30903; + rndContext->c = 0; + if (xi != 0) { + rndContext->x = xi; + } + rndContext->c = ci; + rndContext->ah = rndContext->a >> 16; + rndContext->al = rndContext->a & 65535; } /* Initialize random number generator from system time */ -void SDLTest_RandomInitTime(SDLTest_RandomContext * rndContext) +void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext) { - int a, b; + int a, b; - if (rndContext==NULL) return; + if (!rndContext) { + return; + } - srand((unsigned int)time(NULL)); - a=rand(); - srand((unsigned int)SDL_GetPerformanceCounter()); - b=rand(); - SDLTest_RandomInit(rndContext, a, b); + srand((unsigned int)time(NULL)); + a = rand(); + srand((unsigned int)SDL_GetPerformanceCounter()); + b = rand(); + SDLTest_RandomInit(rndContext, a, b); } /* Returns random numbers */ -unsigned int SDLTest_Random(SDLTest_RandomContext * rndContext) +unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext) { - unsigned int xh, xl; - - if (rndContext==NULL) return -1; - - xh = rndContext->x >> 16; - xl = rndContext->x & 65535; - rndContext->x = rndContext->x * rndContext->a + rndContext->c; - rndContext->c = - xh * rndContext->ah + ((xh * rndContext->al) >> 16) + - ((xl * rndContext->ah) >> 16); - if (xl * rndContext->al >= (~rndContext->c + 1)) - rndContext->c++; - return (rndContext->x); + unsigned int xh, xl; + + if (!rndContext) { + return -1; + } + + xh = rndContext->x >> 16; + xl = rndContext->x & 65535; + rndContext->x = rndContext->x * rndContext->a + rndContext->c; + rndContext->c = + xh * rndContext->ah + ((xh * rndContext->al) >> 16) + + ((xl * rndContext->ah) >> 16); + if (xl * rndContext->al >= (~rndContext->c + 1)) { + rndContext->c++; + } + return rndContext->x; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h index ab6872c023c6e..a58e14bec078d 100644 --- a/src/thread/SDL_systhread.h +++ b/src/thread/SDL_systhread.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,11 +38,11 @@ extern "C" { on success. */ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -extern int SDL_SYS_CreateThread(SDL_Thread * thread, +extern int SDL_SYS_CreateThread(SDL_Thread *thread, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); #else -extern int SDL_SYS_CreateThread(SDL_Thread * thread); +extern int SDL_SYS_CreateThread(SDL_Thread *thread); #endif /* This function does any necessary setup in the child thread */ @@ -54,10 +54,13 @@ extern int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority); /* This function waits for the thread to finish and frees any data allocated by SDL_SYS_CreateThread() */ -extern void SDL_SYS_WaitThread(SDL_Thread * thread); +extern void SDL_SYS_WaitThread(SDL_Thread *thread); /* Mark thread as cleaned up as soon as it exits, without joining. */ -extern void SDL_SYS_DetachThread(SDL_Thread * thread); +extern void SDL_SYS_DetachThread(SDL_Thread *thread); + +/* Initialize the global TLS data */ +extern void SDL_SYS_InitTLSData(void); /* Get the thread local storage for this thread */ extern SDL_TLSData *SDL_SYS_GetTLSData(void); @@ -65,9 +68,12 @@ extern SDL_TLSData *SDL_SYS_GetTLSData(void); /* Set the thread local storage for this thread */ extern int SDL_SYS_SetTLSData(SDL_TLSData *data); +/* Quit the global TLS data */ +extern void SDL_SYS_QuitTLSData(void); + /* This is for internal SDL use, so we don't need #ifdefs everywhere. */ extern SDL_Thread * -SDL_CreateThreadInternal(int (SDLCALL * fn) (void *), const char *name, +SDL_CreateThreadInternal(int(SDLCALL *fn)(void *), const char *name, const size_t stacksize, void *data); /* Ends C function definitions when using C++ */ diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 4e51be68babd6..8ff094072a63e 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,16 +28,22 @@ #include "SDL_hints.h" #include "../SDL_error_c.h" +/* The storage is local to the thread, but the IDs are global for the process */ -SDL_TLSID -SDL_TLSCreate() +static SDL_atomic_t SDL_tls_allocated; + +void SDL_InitTLSData(void) +{ + SDL_SYS_InitTLSData(); +} + +SDL_TLSID SDL_TLSCreate(void) { static SDL_atomic_t SDL_tls_id; - return SDL_AtomicIncRef(&SDL_tls_id)+1; + return SDL_AtomicIncRef(&SDL_tls_id) + 1; } -void * -SDL_TLSGet(SDL_TLSID id) +void *SDL_TLSGet(SDL_TLSID id) { SDL_TLSData *storage; @@ -45,11 +51,10 @@ SDL_TLSGet(SDL_TLSID id) if (!storage || id == 0 || id > storage->limit) { return NULL; } - return storage->array[id-1].data; + return storage->array[id - 1].data; } -int -SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void *)) +int SDL_TLSSet(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor) { SDL_TLSData *storage; @@ -57,13 +62,20 @@ SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void *)) return SDL_InvalidParamError("id"); } + /* Make sure TLS is initialized. + * There's a race condition here if you are calling this from non-SDL threads + * and haven't called SDL_Init() on your main thread, but such is life. + */ + SDL_InitTLSData(); + + /* Get the storage for the current thread */ storage = SDL_SYS_GetTLSData(); if (!storage || (id > storage->limit)) { unsigned int i, oldlimit, newlimit; oldlimit = storage ? storage->limit : 0; newlimit = (id + TLS_ALLOC_CHUNKSIZE); - storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage)+(newlimit-1)*sizeof(storage->array[0])); + storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage) + (newlimit - 1) * sizeof(storage->array[0])); if (!storage) { return SDL_OutOfMemory(); } @@ -73,20 +85,22 @@ SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void *)) storage->array[i].destructor = NULL; } if (SDL_SYS_SetTLSData(storage) != 0) { + SDL_free(storage); return -1; } + SDL_AtomicIncRef(&SDL_tls_allocated); } - storage->array[id-1].data = SDL_const_cast(void*, value); - storage->array[id-1].destructor = destructor; + storage->array[id - 1].data = SDL_const_cast(void *, value); + storage->array[id - 1].destructor = destructor; return 0; } -void -SDL_TLSCleanup() +void SDL_TLSCleanup(void) { SDL_TLSData *storage; + /* Cleanup the storage for the current thread */ storage = SDL_SYS_GetTLSData(); if (storage) { unsigned int i; @@ -97,9 +111,20 @@ SDL_TLSCleanup() } SDL_SYS_SetTLSData(NULL); SDL_free(storage); + (void)SDL_AtomicDecRef(&SDL_tls_allocated); } } +void SDL_QuitTLSData(void) +{ + SDL_TLSCleanup(); + + if (SDL_AtomicGet(&SDL_tls_allocated) == 0) { + SDL_SYS_QuitTLSData(); + } else { + /* Some thread hasn't called SDL_CleanupTLS() */ + } +} /* This is a generic implementation of thread-local storage which doesn't require additional OS support. @@ -109,7 +134,8 @@ SDL_TLSCleanup() storage this implementation should be improved to be production quality. */ -typedef struct SDL_TLSEntry { +typedef struct SDL_TLSEntry +{ SDL_threadID thread; SDL_TLSData *storage; struct SDL_TLSEntry *next; @@ -118,59 +144,43 @@ typedef struct SDL_TLSEntry { static SDL_mutex *SDL_generic_TLS_mutex; static SDL_TLSEntry *SDL_generic_TLS; +void SDL_Generic_InitTLSData(void) +{ + if (!SDL_generic_TLS_mutex) { + SDL_generic_TLS_mutex = SDL_CreateMutex(); + } +} -SDL_TLSData * -SDL_Generic_GetTLSData(void) +SDL_TLSData *SDL_Generic_GetTLSData(void) { SDL_threadID thread = SDL_ThreadID(); SDL_TLSEntry *entry; SDL_TLSData *storage = NULL; -#if !SDL_THREADS_DISABLED - if (!SDL_generic_TLS_mutex) { - static SDL_SpinLock tls_lock; - SDL_AtomicLock(&tls_lock); - if (!SDL_generic_TLS_mutex) { - SDL_mutex *mutex = SDL_CreateMutex(); - SDL_MemoryBarrierRelease(); - SDL_generic_TLS_mutex = mutex; - if (!SDL_generic_TLS_mutex) { - SDL_AtomicUnlock(&tls_lock); - return NULL; - } - } - SDL_AtomicUnlock(&tls_lock); - } - SDL_MemoryBarrierAcquire(); SDL_LockMutex(SDL_generic_TLS_mutex); -#endif /* SDL_THREADS_DISABLED */ - for (entry = SDL_generic_TLS; entry; entry = entry->next) { if (entry->thread == thread) { storage = entry->storage; break; } } -#if !SDL_THREADS_DISABLED SDL_UnlockMutex(SDL_generic_TLS_mutex); -#endif return storage; } -int -SDL_Generic_SetTLSData(SDL_TLSData *storage) +int SDL_Generic_SetTLSData(SDL_TLSData *data) { SDL_threadID thread = SDL_ThreadID(); SDL_TLSEntry *prev, *entry; + int retval = 0; - /* SDL_Generic_GetTLSData() is always called first, so we can assume SDL_generic_TLS_mutex */ SDL_LockMutex(SDL_generic_TLS_mutex); prev = NULL; for (entry = SDL_generic_TLS; entry; entry = entry->next) { if (entry->thread == thread) { - if (storage) { - entry->storage = storage; + if (data) { + entry->storage = data; } else { if (prev) { prev->next = entry->next; @@ -183,26 +193,48 @@ SDL_Generic_SetTLSData(SDL_TLSData *storage) } prev = entry; } - if (!entry) { + if (!entry && data) { entry = (SDL_TLSEntry *)SDL_malloc(sizeof(*entry)); if (entry) { entry->thread = thread; - entry->storage = storage; + entry->storage = data; entry->next = SDL_generic_TLS; SDL_generic_TLS = entry; + } else { + retval = SDL_OutOfMemory(); } } SDL_UnlockMutex(SDL_generic_TLS_mutex); - if (!entry) { - return SDL_OutOfMemory(); + return retval; +} + +void SDL_Generic_QuitTLSData(void) +{ + SDL_TLSEntry *entry; + + /* This should have been cleaned up by the time we get here */ + SDL_assert(!SDL_generic_TLS); + if (SDL_generic_TLS) { + SDL_LockMutex(SDL_generic_TLS_mutex); + for (entry = SDL_generic_TLS; entry; ) { + SDL_TLSEntry *next = entry->next; + SDL_free(entry->storage); + SDL_free(entry); + entry = next; + } + SDL_generic_TLS = NULL; + SDL_UnlockMutex(SDL_generic_TLS_mutex); + } + + if (SDL_generic_TLS_mutex) { + SDL_DestroyMutex(SDL_generic_TLS_mutex); + SDL_generic_TLS_mutex = NULL; } - return 0; } /* Non-thread-safe global error variable */ -static SDL_error * -SDL_GetStaticErrBuf() +static SDL_error *SDL_GetStaticErrBuf(void) { static SDL_error SDL_global_error; static char SDL_global_error_str[128]; @@ -211,9 +243,8 @@ SDL_GetStaticErrBuf() return &SDL_global_error; } -#if !SDL_THREADS_DISABLED -static void SDLCALL -SDL_FreeErrBuf(void *data) +#ifndef SDL_THREADS_DISABLED +static void SDLCALL SDL_FreeErrBuf(void *data) { SDL_error *errbuf = (SDL_error *)data; @@ -225,10 +256,9 @@ SDL_FreeErrBuf(void *data) #endif /* Routine to get the thread-specific error variable */ -SDL_error * -SDL_GetErrBuf(void) +SDL_error *SDL_GetErrBuf(void) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return SDL_GetStaticErrBuf(); #else static SDL_SpinLock tls_lock; @@ -286,12 +316,10 @@ SDL_GetErrBuf(void) #endif /* SDL_THREADS_DISABLED */ } - -void -SDL_RunThread(SDL_Thread *thread) +void SDL_RunThread(SDL_Thread *thread) { void *userdata = thread->userdata; - int (SDLCALL * userfunc) (void *) = thread->userfunc; + int(SDLCALL * userfunc)(void *) = thread->userfunc; int *statusloc = &thread->status; @@ -324,28 +352,28 @@ SDL_RunThread(SDL_Thread *thread) #undef SDL_CreateThreadWithStackSize #endif #if SDL_DYNAMIC_API -#define SDL_CreateThread SDL_CreateThread_REAL +#define SDL_CreateThread SDL_CreateThread_REAL #define SDL_CreateThreadWithStackSize SDL_CreateThreadWithStackSize_REAL #endif #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -SDL_Thread * -SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), - const char *name, const size_t stacksize, void *data, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread) +SDL_Thread *SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), + const char *name, const size_t stacksize, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) #else -SDL_Thread * -SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), - const char *name, const size_t stacksize, void *data) +SDL_Thread *SDL_CreateThreadWithStackSize(int(SDLCALL *fn)(void *), + const char *name, const size_t stacksize, void *data) #endif { SDL_Thread *thread; int ret; + SDL_InitMainThread(); + /* Allocate memory for the thread info structure */ - thread = (SDL_Thread *) SDL_calloc(1, sizeof(*thread)); - if (thread == NULL) { + thread = (SDL_Thread *)SDL_calloc(1, sizeof(*thread)); + if (!thread) { SDL_OutOfMemory(); return NULL; } @@ -353,9 +381,9 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), SDL_AtomicSet(&thread->state, SDL_THREAD_STATE_ALIVE); /* Set up the arguments for the thread */ - if (name != NULL) { + if (name) { thread->name = SDL_strdup(name); - if (thread->name == NULL) { + if (!thread->name) { SDL_OutOfMemory(); SDL_free(thread); return NULL; @@ -384,14 +412,12 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *), } #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int (SDLCALL * fn) (void *), +DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *), const char *name, void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) #else -DECLSPEC SDL_Thread *SDLCALL -SDL_CreateThread(int (SDLCALL * fn) (void *), +DECLSPEC SDL_Thread *SDLCALL SDL_CreateThread(int(SDLCALL *fn)(void *), const char *name, void *data) #endif { @@ -400,12 +426,12 @@ SDL_CreateThread(int (SDLCALL * fn) (void *), size_t stacksize = 0; /* If the SDL_HINT_THREAD_STACK_SIZE exists, use it */ - if (stackhint != NULL) { + if (stackhint) { char *endp = NULL; const Sint64 hintval = SDL_strtoll(stackhint, &endp, 10); - if ((*stackhint != '\0') && (*endp == '\0')) { /* a valid number? */ - if (hintval > 0) { /* reject bogus values. */ - stacksize = (size_t) hintval; + if ((*stackhint != '\0') && (*endp == '\0')) { /* a valid number? */ + if (hintval > 0) { /* reject bogus values. */ + stacksize = (size_t)hintval; } } } @@ -417,9 +443,9 @@ SDL_CreateThread(int (SDLCALL * fn) (void *), #endif } -SDL_Thread * -SDL_CreateThreadInternal(int (SDLCALL * fn) (void *), const char *name, - const size_t stacksize, void *data) { +SDL_Thread *SDL_CreateThreadInternal(int(SDLCALL *fn)(void *), const char *name, + const size_t stacksize, void *data) +{ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD return SDL_CreateThreadWithStackSize(fn, name, stacksize, data, NULL, NULL); #else @@ -427,8 +453,7 @@ SDL_CreateThreadInternal(int (SDLCALL * fn) (void *), const char *name, #endif } -SDL_threadID -SDL_GetThreadID(SDL_Thread * thread) +SDL_threadID SDL_GetThreadID(SDL_Thread *thread) { SDL_threadID id; @@ -440,8 +465,7 @@ SDL_GetThreadID(SDL_Thread * thread) return id; } -const char * -SDL_GetThreadName(SDL_Thread * thread) +const char *SDL_GetThreadName(SDL_Thread *thread) { if (thread) { return thread->name; @@ -450,14 +474,12 @@ SDL_GetThreadName(SDL_Thread * thread) } } -int -SDL_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SetThreadPriority(SDL_ThreadPriority priority) { return SDL_SYS_SetThreadPriority(priority); } -void -SDL_WaitThread(SDL_Thread * thread, int *status) +void SDL_WaitThread(SDL_Thread *thread, int *status) { if (thread) { SDL_SYS_WaitThread(thread); @@ -471,8 +493,7 @@ SDL_WaitThread(SDL_Thread * thread, int *status) } } -void -SDL_DetachThread(SDL_Thread * thread) +void SDL_DetachThread(SDL_Thread *thread) { if (!thread) { return; @@ -485,9 +506,9 @@ SDL_DetachThread(SDL_Thread * thread) /* all other states are pretty final, see where we landed. */ const int thread_state = SDL_AtomicGet(&thread->state); if ((thread_state == SDL_THREAD_STATE_DETACHED) || (thread_state == SDL_THREAD_STATE_CLEANED)) { - return; /* already detached (you shouldn't call this twice!) */ + return; /* already detached (you shouldn't call this twice!) */ } else if (thread_state == SDL_THREAD_STATE_ZOMBIE) { - SDL_WaitThread(thread, NULL); /* already done, clean it up. */ + SDL_WaitThread(thread, NULL); /* already done, clean it up. */ } else { SDL_assert(0 && "Unexpected thread state"); } diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index f3348eaa980e8..d173f1f880f54 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,25 +26,25 @@ #include "SDL_thread.h" /* Need the definitions of SYS_ThreadHandle */ -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED #include "generic/SDL_systhread_c.h" -#elif SDL_THREAD_PTHREAD +#elif defined(SDL_THREAD_PTHREAD) #include "pthread/SDL_systhread_c.h" -#elif SDL_THREAD_WINDOWS +#elif defined(SDL_THREAD_WINDOWS) #include "windows/SDL_systhread_c.h" -#elif SDL_THREAD_PS2 +#elif defined(SDL_THREAD_PS2) #include "ps2/SDL_systhread_c.h" -#elif SDL_THREAD_PSP +#elif defined(SDL_THREAD_PSP) #include "psp/SDL_systhread_c.h" -#elif SDL_THREAD_VITA +#elif defined(SDL_THREAD_VITA) #include "vita/SDL_systhread_c.h" -#elif SDL_THREAD_N3DS +#elif defined(SDL_THREAD_N3DS) #include "n3ds/SDL_systhread_c.h" -#elif SDL_THREAD_STDCPP +#elif defined(SDL_THREAD_STDCPP) #include "stdcpp/SDL_systhread_c.h" -#elif SDL_THREAD_OS2 +#elif defined(SDL_THREAD_OS2) #include "os2/SDL_systhread_c.h" -#elif SDL_THREAD_NGAGE +#elif defined(SDL_THREAD_NGAGE) #include "ngage/SDL_systhread_c.h" #else #error Need thread implementation for this platform @@ -66,42 +66,44 @@ struct SDL_Thread SDL_threadID threadid; SYS_ThreadHandle handle; int status; - SDL_atomic_t state; /* SDL_THREAD_STATE_* */ + SDL_atomic_t state; /* SDL_THREAD_STATE_* */ SDL_error errbuf; char *name; - size_t stacksize; /* 0 for default, >0 for user-specified stack size. */ - int (SDLCALL * userfunc) (void *); + size_t stacksize; /* 0 for default, >0 for user-specified stack size. */ + int(SDLCALL *userfunc)(void *); void *userdata; void *data; - void *endfunc; /* only used on some platforms. */ + void *endfunc; /* only used on some platforms. */ }; /* This is the function called to run a thread */ extern void SDL_RunThread(SDL_Thread *thread); /* This is the system-independent thread local storage structure */ -typedef struct { +typedef struct +{ unsigned int limit; - struct { + struct + { void *data; - void (SDLCALL *destructor)(void*); + void(SDLCALL *destructor)(void *); } array[1]; } SDL_TLSData; /* This is how many TLS entries we allocate at once */ #define TLS_ALLOC_CHUNKSIZE 4 -/* Get cross-platform, slow, thread local storage for this thread. - This is only intended as a fallback if getting real thread-local - storage fails or isn't supported on this platform. - */ -extern SDL_TLSData *SDL_Generic_GetTLSData(void); +extern void SDL_InitTLSData(void); +extern void SDL_QuitTLSData(void); -/* Set cross-platform, slow, thread local storage for this thread. +/* Generic TLS support. This is only intended as a fallback if getting real thread-local storage fails or isn't supported on this platform. */ +extern void SDL_Generic_InitTLSData(void); +extern SDL_TLSData *SDL_Generic_GetTLSData(void); extern int SDL_Generic_SetTLSData(SDL_TLSData *data); +extern void SDL_Generic_QuitTLSData(void); #endif /* SDL_thread_c_h_ */ diff --git a/src/thread/generic/SDL_syscond.c b/src/thread/generic/SDL_syscond.c index 59e8ce0760d5c..8345e4da225a8 100644 --- a/src/thread/generic/SDL_syscond.c +++ b/src/thread/generic/SDL_syscond.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,7 +34,7 @@ * will be chosen at runtime), the function names need to be * suffixed */ -#if !SDL_THREAD_GENERIC_COND_SUFFIX +#ifndef SDL_THREAD_GENERIC_COND_SUFFIX #define SDL_CreateCond_generic SDL_CreateCond #define SDL_DestroyCond_generic SDL_DestroyCond #define SDL_CondSignal_generic SDL_CondSignal @@ -53,12 +53,11 @@ typedef struct SDL_cond_generic } SDL_cond_generic; /* Create a condition variable */ -SDL_cond * -SDL_CreateCond_generic(void) +SDL_cond *SDL_CreateCond_generic(void) { SDL_cond_generic *cond; - cond = (SDL_cond_generic *) SDL_malloc(sizeof(SDL_cond_generic)); + cond = (SDL_cond_generic *)SDL_malloc(sizeof(SDL_cond_generic)); if (cond) { cond->lock = SDL_CreateMutex(); cond->wait_sem = SDL_CreateSemaphore(0); @@ -75,8 +74,7 @@ SDL_CreateCond_generic(void) } /* Destroy a condition variable */ -void -SDL_DestroyCond_generic(SDL_cond * _cond) +void SDL_DestroyCond_generic(SDL_cond *_cond) { SDL_cond_generic *cond = (SDL_cond_generic *)_cond; if (cond) { @@ -94,8 +92,7 @@ SDL_DestroyCond_generic(SDL_cond * _cond) } /* Restart one of the threads that are waiting on the condition variable */ -int -SDL_CondSignal_generic(SDL_cond * _cond) +int SDL_CondSignal_generic(SDL_cond *_cond) { SDL_cond_generic *cond = (SDL_cond_generic *)_cond; if (!cond) { @@ -119,8 +116,7 @@ SDL_CondSignal_generic(SDL_cond * _cond) } /* Restart all threads that are waiting on the condition variable */ -int -SDL_CondBroadcast_generic(SDL_cond * _cond) +int SDL_CondBroadcast_generic(SDL_cond *_cond) { SDL_cond_generic *cond = (SDL_cond_generic *)_cond; if (!cond) { @@ -174,8 +170,7 @@ Thread B: SDL_CondSignal(cond); SDL_UnlockMutex(lock); */ -int -SDL_CondWaitTimeout_generic(SDL_cond * _cond, SDL_mutex * mutex, Uint32 ms) +int SDL_CondWaitTimeout_generic(SDL_cond *_cond, SDL_mutex *mutex, Uint32 ms) { SDL_cond_generic *cond = (SDL_cond_generic *)_cond; int retval; @@ -230,8 +225,7 @@ SDL_CondWaitTimeout_generic(SDL_cond * _cond, SDL_mutex * mutex, Uint32 ms) } /* Wait on the condition variable forever */ -int -SDL_CondWait_generic(SDL_cond * cond, SDL_mutex * mutex) +int SDL_CondWait_generic(SDL_cond *cond, SDL_mutex *mutex) { return SDL_CondWaitTimeout_generic(cond, mutex, SDL_MUTEX_MAXWAIT); } diff --git a/src/thread/generic/SDL_syscond_c.h b/src/thread/generic/SDL_syscond_c.h index b7dadc7816fc0..c05437876784a 100644 --- a/src/thread/generic/SDL_syscond_c.h +++ b/src/thread/generic/SDL_syscond_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,15 +25,15 @@ #ifndef SDL_syscond_generic_h_ #define SDL_syscond_generic_h_ -#if SDL_THREAD_GENERIC_COND_SUFFIX +#ifdef SDL_THREAD_GENERIC_COND_SUFFIX -SDL_cond * SDL_CreateCond_generic(void); -void SDL_DestroyCond_generic(SDL_cond * cond); -int SDL_CondSignal_generic(SDL_cond * cond); -int SDL_CondBroadcast_generic(SDL_cond * cond); -int SDL_CondWait_generic(SDL_cond * cond, SDL_mutex * mutex); -int SDL_CondWaitTimeout_generic(SDL_cond * cond, - SDL_mutex * mutex, Uint32 ms); +SDL_cond *SDL_CreateCond_generic(void); +void SDL_DestroyCond_generic(SDL_cond *cond); +int SDL_CondSignal_generic(SDL_cond *cond); +int SDL_CondBroadcast_generic(SDL_cond *cond); +int SDL_CondWait_generic(SDL_cond *cond, SDL_mutex *mutex); +int SDL_CondWaitTimeout_generic(SDL_cond *cond, + SDL_mutex *mutex, Uint32 ms); #endif /* SDL_THREAD_GENERIC_COND_SUFFIX */ diff --git a/src/thread/generic/SDL_sysmutex.c b/src/thread/generic/SDL_sysmutex.c index 12cc580411d5a..385ed5e328f64 100644 --- a/src/thread/generic/SDL_sysmutex.c +++ b/src/thread/generic/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,6 @@ #include "SDL_thread.h" #include "SDL_systhread_c.h" - struct SDL_mutex { int recursive; @@ -34,15 +33,14 @@ struct SDL_mutex }; /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { SDL_mutex *mutex; /* Allocate mutex memory */ - mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex)); + mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); -#if !SDL_THREADS_DISABLED +#ifndef SDL_THREADS_DISABLED if (mutex) { /* Create the mutex semaphore, with initial value 1 */ mutex->sem = SDL_CreateSemaphore(1); @@ -61,8 +59,7 @@ SDL_CreateMutex(void) } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { if (mutex->sem) { @@ -73,16 +70,15 @@ SDL_DestroyMutex(SDL_mutex * mutex) } /* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex * mutex) +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SDL_threadID this_thread; if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } this_thread = SDL_ThreadID(); @@ -103,17 +99,16 @@ SDL_LockMutex(SDL_mutex * mutex) } /* try Lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) +int SDL_TryLockMutex(SDL_mutex *mutex) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else int retval = 0; SDL_threadID this_thread; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + if (!mutex) { + return 0; } this_thread = SDL_ThreadID(); @@ -136,14 +131,13 @@ SDL_TryLockMutex(SDL_mutex * mutex) } /* Unlock the mutex */ -int -SDL_mutexV(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } /* If we don't own the mutex, we can't unlock it */ diff --git a/src/thread/generic/SDL_sysmutex_c.h b/src/thread/generic/SDL_sysmutex_c.h index 074071a4bf20f..6d24bf7827de4 100644 --- a/src/thread/generic/SDL_sysmutex_c.h +++ b/src/thread/generic/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/generic/SDL_syssem.c b/src/thread/generic/SDL_syssem.c index c21ff196ad075..0adc26c424f6e 100644 --- a/src/thread/generic/SDL_syssem.c +++ b/src/thread/generic/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,47 +26,39 @@ #include "SDL_thread.h" #include "SDL_systhread_c.h" +#ifdef SDL_THREADS_DISABLED -#if SDL_THREADS_DISABLED - -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_SetError("SDL not built with thread support"); - return (SDL_sem *) 0; + return (SDL_sem *)0; } -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem *sem) { } -int -SDL_SemTryWait(SDL_sem * sem) +int SDL_SemTryWait(SDL_sem *sem) { return SDL_SetError("SDL not built with thread support"); } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { return SDL_SetError("SDL not built with thread support"); } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem *sem) { return SDL_SetError("SDL not built with thread support"); } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem *sem) { return 0; } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem *sem) { return SDL_SetError("SDL not built with thread support"); } @@ -81,12 +73,11 @@ struct SDL_semaphore SDL_cond *count_nonzero; }; -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; - sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); + sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); if (!sem) { SDL_OutOfMemory(); return NULL; @@ -107,8 +98,7 @@ SDL_CreateSemaphore(Uint32 initial_value) /* WARNING: You cannot call this function when another thread is using the semaphore. */ -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem *sem) { if (sem) { sem->count = 0xFFFFFFFF; @@ -126,8 +116,7 @@ SDL_DestroySemaphore(SDL_sem * sem) } } -int -SDL_SemTryWait(SDL_sem * sem) +int SDL_SemTryWait(SDL_sem *sem) { int retval; @@ -146,8 +135,7 @@ SDL_SemTryWait(SDL_sem * sem) return retval; } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { int retval; @@ -176,14 +164,12 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) return retval; } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem *sem) { return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem *sem) { Uint32 value; @@ -196,8 +182,7 @@ SDL_SemValue(SDL_sem * sem) return value; } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem *sem) { if (!sem) { return SDL_InvalidParamError("sem"); diff --git a/src/thread/generic/SDL_systhread.c b/src/thread/generic/SDL_systhread.c index e36bf4c1c1c90..61861cd952a62 100644 --- a/src/thread/generic/SDL_systhread.c +++ b/src/thread/generic/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,44 +26,37 @@ #include "../SDL_systhread.h" #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -int -SDL_SYS_CreateThread(SDL_Thread * thread, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread) +int SDL_SYS_CreateThread(SDL_Thread *thread, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) #else -int -SDL_SYS_CreateThread(SDL_Thread * thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ { return SDL_SetError("Threads are not supported on this platform"); } -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { - return (0); + return 0; } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { - return (0); + return 0; } -void -SDL_SYS_WaitThread(SDL_Thread * thread) +void SDL_SYS_WaitThread(SDL_Thread *thread) { return; } -void -SDL_SYS_DetachThread(SDL_Thread * thread) +void SDL_SYS_DetachThread(SDL_Thread *thread) { return; } diff --git a/src/thread/generic/SDL_systhread_c.h b/src/thread/generic/SDL_systhread_c.h index bdca9a4085bb7..0795900c93e52 100644 --- a/src/thread/generic/SDL_systhread_c.h +++ b/src/thread/generic/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/generic/SDL_systls.c b/src/thread/generic/SDL_systls.c index d4c371c394790..d5cf231b00e4a 100644 --- a/src/thread/generic/SDL_systls.c +++ b/src/thread/generic/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,17 +22,24 @@ #include "../../SDL_internal.h" #include "../SDL_thread_c.h" +void SDL_SYS_InitTLSData(void) +{ + SDL_Generic_InitTLSData(); +} -SDL_TLSData * -SDL_SYS_GetTLSData(void) +SDL_TLSData *SDL_SYS_GetTLSData(void) { return SDL_Generic_GetTLSData(); } -int -SDL_SYS_SetTLSData(SDL_TLSData *data) +int SDL_SYS_SetTLSData(SDL_TLSData *data) { return SDL_Generic_SetTLSData(data); } +void SDL_SYS_QuitTLSData(void) +{ + SDL_Generic_QuitTLSData(); +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/n3ds/SDL_syscond.c b/src/thread/n3ds/SDL_syscond.c deleted file mode 100644 index 9c671f554e704..0000000000000 --- a/src/thread/n3ds/SDL_syscond.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#ifdef SDL_THREAD_N3DS - -/* An implementation of condition variables using libctru's CondVar */ - -#include "SDL_sysmutex_c.h" - -struct SDL_cond -{ - CondVar cond_variable; -}; - -/* Create a condition variable */ -SDL_cond * -SDL_CreateCond(void) -{ - SDL_cond *cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if (cond) { - CondVar_Init(&cond->cond_variable); - } else { - SDL_OutOfMemory(); - } - return cond; -} - -/* Destroy a condition variable */ -void -SDL_DestroyCond(SDL_cond *cond) -{ - if (cond) { - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int -SDL_CondSignal(SDL_cond *cond) -{ - if (!cond) { - return SDL_SetError("Passed a NULL condition variable"); - } - - CondVar_Signal(&cond->cond_variable); - return 0; -} - -/* Restart all threads that are waiting on the condition variable */ -int -SDL_CondBroadcast(SDL_cond *cond) -{ - if (!cond) { - return SDL_SetError("Passed a NULL condition variable"); - } - - CondVar_Broadcast(&cond->cond_variable); - return 0; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond, lock); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_CondSignal(cond); - SDL_UnlockMutex(lock); - */ -int -SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) -{ - Result res; - - if (!cond) { - return SDL_SetError("Passed a NULL condition variable"); - } - if (!mutex) { - return SDL_SetError("Passed a NULL mutex"); - } - - res = 0; - if (ms == SDL_MUTEX_MAXWAIT) { - CondVar_Wait(&cond->cond_variable, &mutex->lock.lock); - } else { - res = CondVar_WaitTimeout(&cond->cond_variable, &mutex->lock.lock, - (s64) ms * 1000000LL); - } - - return R_SUCCEEDED(res) ? 0 : SDL_MUTEX_TIMEDOUT; -} - -/* Wait on the condition variable forever */ -int -SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) -{ - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); -} - -#endif /* SDL_THREAD_N3DS */ - -/* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/src/thread/n3ds/SDL_sysmutex.c b/src/thread/n3ds/SDL_sysmutex.c index 59fa8a801a016..ce0c03c5afb58 100644 --- a/src/thread/n3ds/SDL_sysmutex.c +++ b/src/thread/n3ds/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,13 +27,12 @@ #include "SDL_sysmutex_c.h" /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { SDL_mutex *mutex; /* Allocate mutex memory */ - mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); if (mutex) { RecursiveLock_Init(&mutex->lock); } else { @@ -43,8 +42,7 @@ SDL_CreateMutex(void) } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex *mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { SDL_free(mutex); @@ -52,11 +50,10 @@ SDL_DestroyMutex(SDL_mutex *mutex) } /* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex *mutex) +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { if (mutex == NULL) { - return SDL_SetError("Passed a NULL mutex"); + return 0; } RecursiveLock_Lock(&mutex->lock); @@ -65,22 +62,20 @@ SDL_LockMutex(SDL_mutex *mutex) } /* try Lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex *mutex) +int SDL_TryLockMutex(SDL_mutex *mutex) { - if (mutex == NULL) { - return SDL_SetError("Passed a NULL mutex"); + if (!mutex) { + return 0; } return RecursiveLock_TryLock(&mutex->lock); } /* Unlock the mutex */ -int -SDL_mutexV(SDL_mutex *mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { if (mutex == NULL) { - return SDL_SetError("Passed a NULL mutex"); + return 0; } RecursiveLock_Unlock(&mutex->lock); diff --git a/src/thread/n3ds/SDL_sysmutex_c.h b/src/thread/n3ds/SDL_sysmutex_c.h index d7658e1fd19c4..192d4e12806c3 100644 --- a/src/thread/n3ds/SDL_sysmutex_c.h +++ b/src/thread/n3ds/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/n3ds/SDL_syssem.c b/src/thread/n3ds/SDL_syssem.c index 08fbb6f42ef40..744eeb7b37f71 100644 --- a/src/thread/n3ds/SDL_syssem.c +++ b/src/thread/n3ds/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,14 +27,16 @@ #include <3ds.h> #include "SDL_thread.h" +#include "SDL_timer.h" + +int WaitOnSemaphoreFor(SDL_sem *sem, Uint32 timeout); struct SDL_semaphore { LightSemaphore semaphore; }; -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; @@ -43,7 +45,7 @@ SDL_CreateSemaphore(Uint32 initial_value) return NULL; } - sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); + sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); if (!sem) { SDL_OutOfMemory(); return NULL; @@ -57,73 +59,80 @@ SDL_CreateSemaphore(Uint32 initial_value) /* WARNING: You cannot call this function when another thread is using the semaphore. */ -void -SDL_DestroySemaphore(SDL_sem *sem) +void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem) { - SDL_free(sem); - } + SDL_free(sem); } -int -SDL_SemTryWait(SDL_sem *sem) +int SDL_SemTryWait(SDL_sem *sem) { if (!sem) { - return SDL_SetError("Passed a NULL semaphore"); + return SDL_InvalidParamError("sem"); + } + + if (LightSemaphore_TryAcquire(&sem->semaphore, 1) != 0) { + /* If we failed, yield to avoid starvation on busy waits */ + svcSleepThread(1); + return SDL_MUTEX_TIMEDOUT; } - return SDL_SemWaitTimeout(sem, 0); + return 0; } -int -SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - int retval; - if (!sem) { - return SDL_SetError("Passed a NULL semaphore"); + return SDL_InvalidParamError("sem"); } if (timeout == SDL_MUTEX_MAXWAIT) { LightSemaphore_Acquire(&sem->semaphore, 1); - retval = 0; - } else { - int return_code = LightSemaphore_TryAcquire(&sem->semaphore, 1); - if (return_code != 0) { - for (u32 i = 0; i < timeout; i++) { - svcSleepThread(1000000LL); - return_code = LightSemaphore_TryAcquire(&sem->semaphore, 1); - if (return_code == 0) { - break; - } - } + return 0; + } + + if (LightSemaphore_TryAcquire(&sem->semaphore, 1) != 0) { + return WaitOnSemaphoreFor(sem, timeout); + } + + return 0; +} + +int WaitOnSemaphoreFor(SDL_sem *sem, Uint32 timeout) +{ + Uint64 stop_time = SDL_GetTicks64() + timeout; + Uint64 current_time = SDL_GetTicks64(); + while (current_time < stop_time) { + if (LightSemaphore_TryAcquire(&sem->semaphore, 1) == 0) { + return 0; } - retval = return_code != 0 ? SDL_MUTEX_TIMEDOUT : 0; + /* 100 microseconds seems to be the sweet spot */ + svcSleepThread(100000LL); + current_time = SDL_GetTicks64(); } - return retval; + /* If we failed, yield to avoid starvation on busy waits */ + svcSleepThread(1); + return SDL_MUTEX_TIMEDOUT; } -int -SDL_SemWait(SDL_sem *sem) +int SDL_SemWait(SDL_sem *sem) { return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } -Uint32 -SDL_SemValue(SDL_sem *sem) +Uint32 SDL_SemValue(SDL_sem *sem) { if (!sem) { - return SDL_SetError("Passed a NULL semaphore"); + SDL_InvalidParamError("sem"); + return 0; } return sem->semaphore.current_count; } -int -SDL_SemPost(SDL_sem *sem) +int SDL_SemPost(SDL_sem *sem) { if (!sem) { - return SDL_SetError("Passed a NULL semaphore"); + return SDL_InvalidParamError("sem"); } LightSemaphore_Release(&sem->semaphore, 1); return 0; diff --git a/src/thread/n3ds/SDL_systhread.c b/src/thread/n3ds/SDL_systhread.c index a588400adc9c6..a202a7dc3d709 100644 --- a/src/thread/n3ds/SDL_systhread.c +++ b/src/thread/n3ds/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,9 +26,8 @@ #include "../SDL_systhread.h" -/* N3DS has very limited RAM (128MB), so we put a limit on thread stack size. */ -#define N3DS_THREAD_STACK_SIZE_MAX (16 * 1024) -#define N3DS_THREAD_STACK_SIZE_DEFAULT (4 * 1024) +/* N3DS has very limited RAM (128MB), so we set a low default thread stack size. */ +#define N3DS_THREAD_STACK_SIZE_DEFAULT (80 * 1024) #define N3DS_THREAD_PRIORITY_LOW 0x3F /**< Minimum priority */ #define N3DS_THREAD_PRIORITY_MEDIUM 0x2F /**< Slightly higher than main thread (0x30) */ @@ -37,10 +36,9 @@ static size_t GetStackSize(size_t requested_size); -static void -ThreadEntry(void *arg) +static void ThreadEntry(void *arg) { - SDL_RunThread((SDL_Thread *) arg); + SDL_RunThread((SDL_Thread *)arg); threadExit(0); } @@ -48,60 +46,55 @@ ThreadEntry(void *arg) #error "SDL_PASSED_BEGINTHREAD_ENDTHREAD is not supported on N3DS" #endif -int -SDL_SYS_CreateThread(SDL_Thread *thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) { - s32 priority = N3DS_THREAD_PRIORITY_MEDIUM; + s32 priority = 0x30; + int cpu = -1; size_t stack_size = GetStackSize(thread->stacksize); + svcGetThreadPriority(&priority, CUR_THREAD_HANDLE); + + /* prefer putting audio thread on system core */ + if (thread->name && (SDL_strncmp(thread->name, "SDLAudioP", 9) == 0) && R_SUCCEEDED(APT_SetAppCpuTimeLimit(30))) { + cpu = 1; + } + thread->handle = threadCreate(ThreadEntry, thread, stack_size, priority, - -1, + cpu, false); - if (thread->handle == NULL) { + if (!thread->handle) { return SDL_SetError("Couldn't create thread"); } return 0; } -static size_t -GetStackSize(size_t requested_size) +static size_t GetStackSize(size_t requested_size) { if (requested_size == 0) { return N3DS_THREAD_STACK_SIZE_DEFAULT; } - if (requested_size > N3DS_THREAD_STACK_SIZE_MAX) { - SDL_LogWarn(SDL_LOG_CATEGORY_SYSTEM, - "Requested a thread size of %zu," - " falling back to the maximum supported of %zu\n", - requested_size, - N3DS_THREAD_STACK_SIZE_MAX); - requested_size = N3DS_THREAD_STACK_SIZE_MAX; - } return requested_size; } -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { u32 thread_ID = 0; svcGetThreadId(&thread_ID, CUR_THREAD_HANDLE); - return (SDL_threadID) thread_ID; + return (SDL_threadID)thread_ID; } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority sdl_priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority sdl_priority) { s32 svc_priority; switch (sdl_priority) { @@ -120,11 +113,10 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority sdl_priority) default: svc_priority = N3DS_THREAD_PRIORITY_MEDIUM; } - return (int) svcSetThreadPriority(CUR_THREAD_HANDLE, svc_priority); + return (int)svcSetThreadPriority(CUR_THREAD_HANDLE, svc_priority); } -void -SDL_SYS_WaitThread(SDL_Thread *thread) +void SDL_SYS_WaitThread(SDL_Thread *thread) { Result res = threadJoin(thread->handle, U64_MAX); @@ -137,8 +129,7 @@ SDL_SYS_WaitThread(SDL_Thread *thread) } } -void -SDL_SYS_DetachThread(SDL_Thread *thread) +void SDL_SYS_DetachThread(SDL_Thread *thread) { threadDetach(thread->handle); } diff --git a/src/thread/n3ds/SDL_systhread_c.h b/src/thread/n3ds/SDL_systhread_c.h index 71b9a27eb8022..d7c43010876fb 100644 --- a/src/thread/n3ds/SDL_systhread_c.h +++ b/src/thread/n3ds/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/ngage/SDL_sysmutex.cpp b/src/thread/ngage/SDL_sysmutex.cpp index 6893fc6283a7e..357dd3ba6ab30 100644 --- a/src/thread/ngage/SDL_sysmutex.cpp +++ b/src/thread/ngage/SDL_sysmutex.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,90 +32,81 @@ struct SDL_mutex TInt handle; }; -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*); +extern TInt CreateUnique(TInt (*aFunc)(const TDesC &aName, TAny *, TAny *), TAny *, TAny *); -static TInt NewMutex(const TDesC& aName, TAny* aPtr1, TAny*) +static TInt NewMutex(const TDesC &aName, TAny *aPtr1, TAny *) { - return ((RMutex*)aPtr1)->CreateGlobal(aName); + return ((RMutex *)aPtr1)->CreateGlobal(aName); } /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { RMutex rmutex; TInt status = CreateUnique(NewMutex, &rmutex, NULL); - if(status != KErrNone) - { + if (status != KErrNone) { SDL_SetError("Couldn't create mutex."); + return NULL; } - SDL_mutex* mutex = new /*(ELeave)*/ SDL_mutex; + SDL_mutex *mutex = new /*(ELeave)*/ SDL_mutex; mutex->handle = rmutex.Handle(); - return(mutex); + return mutex; } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { - if (mutex) - { + if (mutex) { RMutex rmutex; rmutex.SetHandle(mutex->handle); rmutex.Signal(); rmutex.Close(); - delete(mutex); + delete (mutex); mutex = NULL; } } -/* Try to lock the mutex */ -#if 0 -int -SDL_TryLockMutex(SDL_mutex * mutex) +/* Lock the mutex */ +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { - if (mutex == NULL) - { - SDL_SetError("Passed a NULL mutex."); - return -1; + if (mutex == NULL) { + return 0; } - // Not yet implemented. + RMutex rmutex; + rmutex.SetHandle(mutex->handle); + rmutex.Wait(); + return 0; } -#endif -/* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex * mutex) +/* Try to lock the mutex */ +#if 0 +int SDL_TryLockMutex(SDL_mutex *mutex) { if (mutex == NULL) { - return SDL_SetError("Passed a NULL mutex."); + return 0; } - RMutex rmutex; - rmutex.SetHandle(mutex->handle); - rmutex.Wait(); - - return(0); + // Not yet implemented. + return 0; } +#endif /* Unlock the mutex */ -int -SDL_UnlockMutex(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { - if ( mutex == NULL ) - { - return SDL_SetError("Passed a NULL mutex."); + if (mutex == NULL) { + return 0; } RMutex rmutex; rmutex.SetHandle(mutex->handle); rmutex.Signal(); - return(0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/ngage/SDL_syssem.cpp b/src/thread/ngage/SDL_syssem.cpp index 622d6239a0d34..6d2d5c232286d 100644 --- a/src/thread/ngage/SDL_syssem.cpp +++ b/src/thread/ngage/SDL_syssem.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,18 +37,17 @@ struct SDL_semaphore struct TInfo { - TInfo(TInt aTime, TInt aHandle) : - iTime(aTime), iHandle(aHandle), iVal(0) {} + TInfo(TInt aTime, TInt aHandle) : iTime(aTime), iHandle(aHandle), iVal(0) {} TInt iTime; TInt iHandle; TInt iVal; }; -extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*); +extern TInt CreateUnique(TInt (*aFunc)(const TDesC &aName, TAny *, TAny *), TAny *, TAny *); -static TBool RunThread(TAny* aInfo) +static TBool RunThread(TAny *aInfo) { - TInfo* info = STATIC_CAST(TInfo*, aInfo); + TInfo *info = STATIC_CAST(TInfo *, aInfo); User::After(info->iTime); RSemaphore sema; sema.SetHandle(info->iHandle); @@ -57,21 +56,15 @@ static TBool RunThread(TAny* aInfo) return 0; } -static TInt -NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) +static TInt NewThread(const TDesC &aName, TAny *aPtr1, TAny *aPtr2) { - return ((RThread*)(aPtr1))->Create - (aName, - RunThread, - KDefaultStackSize, - NULL, - aPtr2); + return ((RThread *)(aPtr1))->Create(aName, RunThread, KDefaultStackSize, NULL, aPtr2); } -static TInt NewSema(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) +static TInt NewSema(const TDesC &aName, TAny *aPtr1, TAny *aPtr2) { - TInt value = *((TInt*) aPtr2); - return ((RSemaphore*)aPtr1)->CreateGlobal(aName, value); + TInt value = *((TInt *)aPtr2); + return ((RSemaphore *)aPtr1)->CreateGlobal(aName, value); } static void WaitAll(SDL_sem *sem) @@ -79,32 +72,27 @@ static void WaitAll(SDL_sem *sem) RSemaphore sema; sema.SetHandle(sem->handle); sema.Wait(); - while(sem->count < 0) - { + while (sem->count < 0) { sema.Wait(); } } -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { RSemaphore s; TInt status = CreateUnique(NewSema, &s, &initial_value); - if(status != KErrNone) - { + if (status != KErrNone) { SDL_SetError("Couldn't create semaphore"); } - SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore; + SDL_semaphore *sem = new /*(ELeave)*/ SDL_semaphore; sem->handle = s.Handle(); sem->count = initial_value; - return(sem); + return sem; } -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem) - { + if (sem) { RSemaphore sema; sema.SetHandle(sem->handle); sema.Signal(sema.Count()); @@ -114,34 +102,29 @@ SDL_DestroySemaphore(SDL_sem * sem) } } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - if (! sem) - { - return SDL_SetError("Passed a NULL sem"); + if (!sem) { + return SDL_InvalidParamError("sem"); } - if (timeout == SDL_MUTEX_MAXWAIT) - { + if (timeout == SDL_MUTEX_MAXWAIT) { WaitAll(sem); return SDL_MUTEX_MAXWAIT; } RThread thread; - TInfo* info = new (ELeave)TInfo(timeout, sem->handle); - TInt status = CreateUnique(NewThread, &thread, info); + TInfo *info = new (ELeave) TInfo(timeout, sem->handle); + TInt status = CreateUnique(NewThread, &thread, info); - if(status != KErrNone) - { + if (status != KErrNone) { return status; } thread.Resume(); WaitAll(sem); - if(thread.ExitType() == EExitPending) - { + if (thread.ExitType() == EExitPending) { thread.Kill(SDL_MUTEX_TIMEOUT); } @@ -149,39 +132,36 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) return info->iVal; } -int -SDL_SemTryWait(SDL_sem *sem) +int SDL_SemTryWait(SDL_sem *sem) { - if(sem->count > 0) - { + if (!sem) { + return SDL_InvalidParamError("sem"); + } + + if (sem->count > 0) { sem->count--; } return SDL_MUTEX_TIMEOUT; } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem *sem) { return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem *sem) { - if (! sem) - { - SDL_SetError("Passed a NULL sem."); + if (!sem) { + SDL_InvalidParamError("sem"); return 0; } return sem->count; } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem *sem) { - if (! sem) - { - return SDL_SetError("Passed a NULL sem."); + if (!sem) { + return SDL_InvalidParamError("sem"); } sem->count++; RSemaphore sema; diff --git a/src/thread/ngage/SDL_systhread.cpp b/src/thread/ngage/SDL_systhread.cpp index f2c30f7b6288a..674b3bf860d30 100644 --- a/src/thread/ngage/SDL_systhread.cpp +++ b/src/thread/ngage/SDL_systhread.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_NGAGE +#ifdef SDL_THREAD_NGAGE /* N-Gage thread management routines for SDL */ @@ -36,85 +36,67 @@ extern "C" { static int object_count; -static int -RunThread(TAny* data) +static int RunThread(TAny *data) { - SDL_RunThread((SDL_Thread*)data); - return(0); + SDL_RunThread((SDL_Thread *)data); + return 0; } -static TInt -NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2) +static TInt NewThread(const TDesC &aName, TAny *aPtr1, TAny *aPtr2) { - return ((RThread*)(aPtr1))->Create - (aName, - RunThread, - KDefaultStackSize, - NULL, - aPtr2); + return ((RThread *)(aPtr1))->Create(aName, RunThread, KDefaultStackSize, NULL, aPtr2); } -int -CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny* aPtr1, TAny* aPtr2) +int CreateUnique(TInt (*aFunc)(const TDesC &aName, TAny *, TAny *), TAny *aPtr1, TAny *aPtr2) { TBuf<16> name; - TInt status = KErrNone; - do - { + TInt status = KErrNone; + do { object_count++; name.Format(_L("SDL_%x"), object_count); status = aFunc(name, aPtr1, aPtr2); - } - while(status == KErrAlreadyExists); + } while (status == KErrAlreadyExists); return status; } -int -SDL_SYS_CreateThread(SDL_Thread *thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) { RThread rthread; TInt status = CreateUnique(NewThread, &rthread, thread); - if (status != KErrNone) - { - delete(((RThread*)(thread->handle))); + if (status != KErrNone) { + delete (RThread *)thread->handle; thread->handle = NULL; - SDL_SetError("Not enough resources to create thread"); - return(-1); + return SDL_SetError("Not enough resources to create thread"); } rthread.Resume(); thread->handle = rthread.Handle(); - return(0); + return 0; } -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { return; } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { - RThread current; + RThread current; TThreadId id = current.Id(); return id; } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { - return (0); + return 0; } -void -SDL_SYS_WaitThread(SDL_Thread * thread) +void SDL_SYS_WaitThread(SDL_Thread *thread) { RThread t; t.Open(thread->threadid); - if(t.ExitReason() == EExitPending) - { + if (t.ExitReason() == EExitPending) { TRequestStatus status; t.Logon(status); User::WaitForRequest(status); @@ -122,8 +104,7 @@ SDL_SYS_WaitThread(SDL_Thread * thread) t.Close(); } -void -SDL_SYS_DetachThread(SDL_Thread * thread) +void SDL_SYS_DetachThread(SDL_Thread *thread) { return; } diff --git a/src/thread/ngage/SDL_systhread_c.h b/src/thread/ngage/SDL_systhread_c.h index dedceb3965a19..2e744d8a3381f 100644 --- a/src/thread/ngage/SDL_systhread_c.h +++ b/src/thread/ngage/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/os2/SDL_sysmutex.c b/src/thread/os2/SDL_sysmutex.c index d3fc7a3bd3347..32354e144f2ba 100644 --- a/src/thread/os2/SDL_sysmutex.c +++ b/src/thread/os2/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_OS2 +#ifdef SDL_THREAD_OS2 /* An implementation of mutexes for OS/2 */ @@ -37,8 +37,7 @@ struct SDL_mutex { }; /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { ULONG ulRC; HMTX hMtx; @@ -53,8 +52,7 @@ SDL_CreateMutex(void) } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex * mutex) { HMTX hMtx = (HMTX)mutex; if (hMtx != NULLHANDLE) { @@ -66,14 +64,13 @@ SDL_DestroyMutex(SDL_mutex * mutex) } /* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex * mutex) +int SDL_LockMutex(SDL_mutex * mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { ULONG ulRC; HMTX hMtx = (HMTX)mutex; if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); + return 0; ulRC = DosRequestMutexSem(hMtx, SEM_INDEFINITE_WAIT); if (ulRC != NO_ERROR) { @@ -85,14 +82,13 @@ SDL_LockMutex(SDL_mutex * mutex) } /* try Lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) +int SDL_TryLockMutex(SDL_mutex * mutex) { ULONG ulRC; HMTX hMtx = (HMTX)mutex; if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); + return 0; ulRC = DosRequestMutexSem(hMtx, SEM_IMMEDIATE_RETURN); @@ -108,14 +104,13 @@ SDL_TryLockMutex(SDL_mutex * mutex) } /* Unlock the mutex */ -int -SDL_UnlockMutex(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex * mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { ULONG ulRC; HMTX hMtx = (HMTX)mutex; if (hMtx == NULLHANDLE) - return SDL_InvalidParamError("mutex"); + return 0; ulRC = DosReleaseMutexSem(hMtx); if (ulRC != NO_ERROR) diff --git a/src/thread/os2/SDL_syssem.c b/src/thread/os2/SDL_syssem.c index 79bf0673f3950..aca5245079c99 100644 --- a/src/thread/os2/SDL_syssem.c +++ b/src/thread/os2/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_OS2 +#ifdef SDL_THREAD_OS2 /* An implementation of semaphores for OS/2 */ @@ -39,13 +39,12 @@ struct SDL_semaphore { }; -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { ULONG ulRC; SDL_sem *pSDLSem = SDL_malloc(sizeof(SDL_sem)); - if (pSDLSem == NULL) { + if (!pSDLSem) { SDL_OutOfMemory(); return NULL; } @@ -70,8 +69,7 @@ SDL_CreateSemaphore(Uint32 initial_value) return pSDLSem; } -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem * sem) { if (!sem) return; @@ -80,15 +78,14 @@ SDL_DestroySemaphore(SDL_sem * sem) SDL_free(sem); } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) { ULONG ulRC; ULONG ulStartTime, ulCurTime; ULONG ulTimeout; ULONG cPost; - if (sem == NULL) + if (!sem) return SDL_InvalidParamError("sem"); if (timeout != SEM_INDEFINITE_WAIT) @@ -129,24 +126,21 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) return 0; } -int -SDL_SemTryWait(SDL_sem * sem) +int SDL_SemTryWait(SDL_sem * sem) { return SDL_SemWaitTimeout(sem, 0); } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem * sem) { return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT); } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem * sem) { ULONG ulRC; - if (sem == NULL) { + if (!sem) { SDL_InvalidParamError("sem"); return 0; } @@ -161,12 +155,11 @@ SDL_SemValue(SDL_sem * sem) return ulRC; } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem * sem) { ULONG ulRC; - if (sem == NULL) + if (!sem) return SDL_InvalidParamError("sem"); ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT); diff --git a/src/thread/os2/SDL_systhread.c b/src/thread/os2/SDL_systhread.c index 8c64e9c32880c..120ee8931dadf 100644 --- a/src/thread/os2/SDL_systhread.c +++ b/src/thread/os2/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_OS2 +#ifdef SDL_THREAD_OS2 /* Thread management routines for SDL */ @@ -45,7 +45,7 @@ static void RunThread(void *data) SDL_Thread *thread = (SDL_Thread *) data; pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread) thread->endfunc; - if (ppSDLTLSData != NULL) + if (ppSDLTLSData) *ppSDLTLSData = NULL; SDL_RunThread(thread); @@ -54,8 +54,7 @@ static void RunThread(void *data) pfnEndThread(); } -int -SDL_SYS_CreateThread(SDL_Thread * thread, +int SDL_SYS_CreateThread(SDL_Thread * thread, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread) { @@ -80,14 +79,12 @@ SDL_SYS_CreateThread(SDL_Thread * thread, return 0; } -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { /* nothing. */ } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { PTIB tib; PPIB pib; @@ -96,8 +93,7 @@ SDL_ThreadID(void) return tib->tib_ptib2->tib2_ultid; } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { ULONG ulRC; @@ -112,8 +108,7 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) return 0; } -void -SDL_SYS_WaitThread(SDL_Thread * thread) +void SDL_SYS_WaitThread(SDL_Thread * thread) { ULONG ulRC = DosWaitThread((PTID)&thread->handle, DCWW_WAIT); @@ -122,8 +117,7 @@ SDL_SYS_WaitThread(SDL_Thread * thread) } } -void -SDL_SYS_DetachThread(SDL_Thread * thread) +void SDL_SYS_DetachThread(SDL_Thread * thread) { /* nothing. */ } diff --git a/src/thread/os2/SDL_systhread_c.h b/src/thread/os2/SDL_systhread_c.h index dedceb3965a19..2e744d8a3381f 100644 --- a/src/thread/os2/SDL_systhread_c.h +++ b/src/thread/os2/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/os2/SDL_systls.c b/src/thread/os2/SDL_systls.c index b48a4bd39d724..e0a17b0a053eb 100644 --- a/src/thread/os2/SDL_systls.c +++ b/src/thread/os2/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_THREAD_OS2 +#ifdef SDL_THREAD_OS2 #include "../../core/os2/SDL_os2.h" @@ -34,45 +34,22 @@ SDL_TLSData **ppSDLTLSData = NULL; -static ULONG cTLSAlloc = 0; - -/* SDL_OS2TLSAlloc() called from SDL_InitSubSystem() */ -void SDL_OS2TLSAlloc(void) +void SDL_SYS_InitTLSData(void) { ULONG ulRC; - if (cTLSAlloc == 0 || ppSDLTLSData == NULL) { - /* First call - allocate the thread local memory (1 DWORD) */ + if (!ppSDLTLSData) { + /* Allocate the thread local memory (1 DWORD) */ ulRC = DosAllocThreadLocalMemory(1, (PULONG *)&ppSDLTLSData); if (ulRC != NO_ERROR) { debug_os2("DosAllocThreadLocalMemory() failed, rc = %u", ulRC); } } - cTLSAlloc++; -} - -/* SDL_OS2TLSFree() called from SDL_QuitSubSystem() */ -void SDL_OS2TLSFree(void) -{ - ULONG ulRC; - - if (cTLSAlloc != 0) - cTLSAlloc--; - - if (cTLSAlloc == 0 && ppSDLTLSData != NULL) { - /* Last call - free the thread local memory */ - ulRC = DosFreeThreadLocalMemory((PULONG)ppSDLTLSData); - if (ulRC != NO_ERROR) { - debug_os2("DosFreeThreadLocalMemory() failed, rc = %u", ulRC); - } else { - ppSDLTLSData = NULL; - } - } } SDL_TLSData *SDL_SYS_GetTLSData(void) { - return (ppSDLTLSData == NULL)? NULL : *ppSDLTLSData; + return ppSDLTLSData ? *ppSDLTLSData : NULL; } int SDL_SYS_SetTLSData(SDL_TLSData *data) @@ -84,6 +61,21 @@ int SDL_SYS_SetTLSData(SDL_TLSData *data) return 0; } +void SDL_SYS_QuitTLSData(void) +{ + ULONG ulRC; + + if (ppSDLTLSData) { + /* Free the thread local memory */ + ulRC = DosFreeThreadLocalMemory((PULONG)ppSDLTLSData); + if (ulRC != NO_ERROR) { + debug_os2("DosFreeThreadLocalMemory() failed, rc = %u", ulRC); + } else { + ppSDLTLSData = NULL; + } + } +} + #endif /* SDL_THREAD_OS2 */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/os2/SDL_systls_c.h b/src/thread/os2/SDL_systls_c.h index e40d5ddcf6b0d..6070433a42dbd 100644 --- a/src/thread/os2/SDL_systls_c.h +++ b/src/thread/os2/SDL_systls_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,18 +21,10 @@ #include "../../SDL_internal.h" -#if SDL_THREAD_OS2 +#ifdef SDL_THREAD_OS2 #include "../SDL_thread_c.h" extern SDL_TLSData **ppSDLTLSData; -/* SDL_OS2TLSAlloc() called from SDL_InitSubSystem() */ -void SDL_OS2TLSAlloc(void); - -/* SDL_OS2TLSFree() called from SDL_QuitSubSystem() */ -void SDL_OS2TLSFree(void); - #endif /* SDL_THREAD_OS2 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/ps2/SDL_syssem.c b/src/thread/ps2/SDL_syssem.c index e6b0aee255848..d1f97f2fe980f 100644 --- a/src/thread/ps2/SDL_syssem.c +++ b/src/thread/ps2/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,39 +20,36 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_PS2 +#ifdef SDL_THREAD_PS2 /* Semaphore functions for the PS2. */ #include #include -#include +#include #include "SDL_error.h" #include "SDL_thread.h" #include -struct SDL_semaphore { - s32 semid; +struct SDL_semaphore +{ + s32 semid; }; -static void usercb(struct timer_alarm_t *alarm, void *arg) { - iReleaseWaitThread((int)arg); -} - /* Create a semaphore */ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; ee_sema_t sema; - sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); - if (sem != NULL) { + sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); + if (sem) { /* TODO: Figure out the limit on the maximum value. */ sema.init_count = initial_value; - sema.max_count = 255; - sema.option = 0; + sema.max_count = 255; + sema.option = 0; sem->semid = CreateSema(&sema); if (sem->semid < 0) { @@ -70,7 +67,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) /* Free the semaphore */ void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem != NULL) { + if (sem) { if (sem->semid > 0) { DeleteSema(sem->semid); sem->semid = 0; @@ -83,12 +80,11 @@ void SDL_DestroySemaphore(SDL_sem *sem) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { int ret; - struct timer_alarm_t alarm; - InitializeTimerAlarm(&alarm); - - if (sem == NULL) { - SDL_InvalidParamError("sem"); - return 0; + u64 timeout_usec; + u64 *timeout_ptr; + + if (!sem) { + return SDL_InvalidParamError("sem"); } if (timeout == 0) { @@ -98,16 +94,19 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) return 0; } + timeout_ptr = NULL; + if (timeout != SDL_MUTEX_MAXWAIT) { - SetTimerAlarm(&alarm, MSec2TimerBusClock(timeout), &usercb, (void *)GetThreadId()); + timeout_usec = timeout * 1000; + timeout_ptr = &timeout_usec; } - ret = WaitSema(sem->semid); - StopTimerAlarm(&alarm); + ret = WaitSemaEx(sem->semid, 1, timeout_ptr); - if (ret < 0) + if (ret < 0) { return SDL_MUTEX_TIMEDOUT; - return 0; //Wait condition satisfied. + } + return 0; // Wait condition satisfied. } int SDL_SemTryWait(SDL_sem *sem) @@ -125,7 +124,7 @@ Uint32 SDL_SemValue(SDL_sem *sem) { ee_sema_t info; - if (sem == NULL) { + if (!sem) { SDL_InvalidParamError("sem"); return 0; } @@ -141,7 +140,7 @@ int SDL_SemPost(SDL_sem *sem) { int res; - if (sem == NULL) { + if (!sem) { return SDL_InvalidParamError("sem"); } diff --git a/src/thread/ps2/SDL_systhread.c b/src/thread/ps2/SDL_systhread.c index 4df65abf1d101..4a51aa4c37975 100644 --- a/src/thread/ps2/SDL_systhread.c +++ b/src/thread/ps2/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_PS2 +#ifdef SDL_THREAD_PS2 /* PS2 thread management routines for SDL */ @@ -33,7 +33,8 @@ #include "../SDL_thread_c.h" #include -static void FinishThread(SDL_Thread *thread) { +static void FinishThread(SDL_Thread *thread) +{ ee_thread_status_t info; int res; @@ -69,18 +70,17 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) priority = status.current_priority; } - stack_size = thread->stacksize ? ((int) thread->stacksize) : 0x1800; - + stack_size = thread->stacksize ? ((int)thread->stacksize) : 0x1800; /* Create EE Thread */ - eethread.attr = 0; - eethread.option = 0; - eethread.func = &childThread; - eethread.stack = SDL_malloc(stack_size); - eethread.stack_size = stack_size; - eethread.gp_reg = &_gp; - eethread.initial_priority = priority; - thread->handle = CreateThread(&eethread); + eethread.attr = 0; + eethread.option = 0; + eethread.func = &childThread; + eethread.stack = SDL_malloc(stack_size); + eethread.stack_size = stack_size; + eethread.gp_reg = &_gp; + eethread.initial_priority = priority; + thread->handle = CreateThread(&eethread); if (thread->handle < 0) { return SDL_SetError("CreateThread() failed"); @@ -88,8 +88,8 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) // Prepare el semaphore for the ending function sema.init_count = 0; - sema.max_count = 1; - sema.option = 0; + sema.max_count = 1; + sema.option = 0; thread->endfunc = (void *)CreateSema(&sema); return StartThread(thread->handle, thread); @@ -102,7 +102,7 @@ void SDL_SYS_SetupThread(const char *name) SDL_threadID SDL_ThreadID(void) { - return (SDL_threadID) GetThreadId(); + return (SDL_threadID)GetThreadId(); } void SDL_SYS_WaitThread(SDL_Thread *thread) @@ -131,7 +131,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) value = 50; } - return ChangeThreadPriority(GetThreadId(),value); + return ChangeThreadPriority(GetThreadId(), value); } #endif /* SDL_THREAD_PS2 */ diff --git a/src/thread/ps2/SDL_systhread_c.h b/src/thread/ps2/SDL_systhread_c.h index ffeca76d62f09..c6f30dde752fa 100644 --- a/src/thread/ps2/SDL_systhread_c.h +++ b/src/thread/ps2/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/psp/SDL_syscond.c b/src/thread/psp/SDL_syscond.c deleted file mode 100644 index 02307ed9c2da8..0000000000000 --- a/src/thread/psp/SDL_syscond.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_THREAD_PSP - -/* An implementation of condition variables using semaphores and mutexes */ -/* - This implementation borrows heavily from the BeOS condition variable - implementation, written by Christopher Tate and Owen Smith. Thanks! - */ - -#include "SDL_thread.h" - -struct SDL_cond -{ - SDL_mutex *lock; - int waiting; - int signals; - SDL_sem *wait_sem; - SDL_sem *wait_done; -}; - -/* Create a condition variable */ -SDL_cond * -SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if (cond) { - cond->lock = SDL_CreateMutex(); - cond->wait_sem = SDL_CreateSemaphore(0); - cond->wait_done = SDL_CreateSemaphore(0); - cond->waiting = cond->signals = 0; - if (!cond->lock || !cond->wait_sem || !cond->wait_done) { - SDL_DestroyCond(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return (cond); -} - -/* Destroy a condition variable */ -void -SDL_DestroyCond(SDL_cond * cond) -{ - if (cond) { - if (cond->wait_sem) { - SDL_DestroySemaphore(cond->wait_sem); - } - if (cond->wait_done) { - SDL_DestroySemaphore(cond->wait_done); - } - if (cond->lock) { - SDL_DestroyMutex(cond->lock); - } - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int -SDL_CondSignal(SDL_cond * cond) -{ - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if (cond->waiting > cond->signals) { - ++cond->signals; - SDL_SemPost(cond->wait_sem); - SDL_UnlockMutex(cond->lock); - SDL_SemWait(cond->wait_done); - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Restart all threads that are waiting on the condition variable */ -int -SDL_CondBroadcast(SDL_cond * cond) -{ - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if (cond->waiting > cond->signals) { - int i, num_waiting; - - num_waiting = (cond->waiting - cond->signals); - cond->signals = cond->waiting; - for (i = 0; i < num_waiting; ++i) { - SDL_SemPost(cond->wait_sem); - } - /* Now all released threads are blocked here, waiting for us. - Collect them all (and win fabulous prizes!) :-) - */ - SDL_UnlockMutex(cond->lock); - for (i = 0; i < num_waiting; ++i) { - SDL_SemWait(cond->wait_done); - } - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond, lock); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_CondSignal(cond); - SDL_UnlockMutex(lock); - */ -int -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) -{ - int retval; - - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* Obtain the protection mutex, and increment the number of waiters. - This allows the signal mechanism to only perform a signal if there - are waiting threads. - */ - SDL_LockMutex(cond->lock); - ++cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Unlock the mutex, as is required by condition variable semantics */ - SDL_UnlockMutex(mutex); - - /* Wait for a signal */ - if (ms == SDL_MUTEX_MAXWAIT) { - retval = SDL_SemWait(cond->wait_sem); - } else { - retval = SDL_SemWaitTimeout(cond->wait_sem, ms); - } - - /* Let the signaler know we have completed the wait, otherwise - the signaler can race ahead and get the condition semaphore - if we are stopped between the mutex unlock and semaphore wait, - giving a deadlock. See the following URL for details: - http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html - */ - SDL_LockMutex(cond->lock); - if (cond->signals > 0) { - /* If we timed out, we need to eat a condition signal */ - if (retval > 0) { - SDL_SemWait(cond->wait_sem); - } - /* We always notify the signal thread that we are done */ - SDL_SemPost(cond->wait_done); - - /* Signal handshake complete */ - --cond->signals; - } - --cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Lock the mutex, as is required by condition variable semantics */ - SDL_LockMutex(mutex); - - return retval; -} - -/* Wait on the condition variable forever */ -int -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) -{ - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); -} - -#endif /* SDL_THREAD_PSP */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_sysmutex.c b/src/thread/psp/SDL_sysmutex.c index d672ec51699f4..50c69914c747b 100644 --- a/src/thread/psp/SDL_sysmutex.c +++ b/src/thread/psp/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_PSP +#ifdef SDL_THREAD_PSP /* An implementation of mutexes using semaphores */ @@ -38,14 +38,13 @@ struct SDL_mutex }; /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { SDL_mutex *mutex = NULL; SceInt32 res = 0; /* Allocate mutex memory */ - mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); if (mutex) { res = sceKernelCreateLwMutex( @@ -53,8 +52,7 @@ SDL_CreateMutex(void) "SDL mutex", SCE_KERNEL_MUTEX_ATTR_RECURSIVE, 0, - NULL - ); + NULL); if (res < 0) { SDL_SetError("Error trying to create mutex: %lx", res); @@ -66,8 +64,7 @@ SDL_CreateMutex(void) } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { sceKernelDeleteLwMutex(&mutex->lock); @@ -75,68 +72,66 @@ SDL_DestroyMutex(SDL_mutex * mutex) } } -/* Try to lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) +/* Lock the mutex */ +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; + if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } - res = sceKernelTryLockLwMutex(&mutex->lock, 1); - switch (res) { - case SCE_KERNEL_ERROR_OK: - return 0; - break; - case SCE_KERNEL_ERROR_WAIT_TIMEOUT: - return SDL_MUTEX_TIMEDOUT; - break; - default: - return SDL_SetError("Error trying to lock mutex: %lx", res); - break; + res = sceKernelLockLwMutex(&mutex->lock, 1, NULL); + if (res != SCE_KERNEL_ERROR_OK) { + return SDL_SetError("Error trying to lock mutex: %lx", res); } - return -1; + return 0; #endif /* SDL_THREADS_DISABLED */ } - -/* Lock the mutex */ -int -SDL_mutexP(SDL_mutex * mutex) +/* Try to lock the mutex */ +int SDL_TryLockMutex(SDL_mutex *mutex) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + + if (!mutex) { + return 0; } - res = sceKernelLockLwMutex(&mutex->lock, 1, NULL); - if (res != SCE_KERNEL_ERROR_OK) { + res = sceKernelTryLockLwMutex(&mutex->lock, 1); + switch (res) { + case SCE_KERNEL_ERROR_OK: + return 0; + break; + case SCE_KERNEL_ERROR_WAIT_TIMEOUT: + return SDL_MUTEX_TIMEDOUT; + break; + default: return SDL_SetError("Error trying to lock mutex: %lx", res); + break; } - return 0; + return -1; #endif /* SDL_THREADS_DISABLED */ } /* Unlock the mutex */ -int -SDL_mutexV(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } res = sceKernelUnlockLwMutex(&mutex->lock, 1); @@ -147,6 +142,7 @@ SDL_mutexV(SDL_mutex * mutex) return 0; #endif /* SDL_THREADS_DISABLED */ } + #endif /* SDL_THREAD_PSP */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_sysmutex_c.h b/src/thread/psp/SDL_sysmutex_c.h index 074071a4bf20f..6d24bf7827de4 100644 --- a/src/thread/psp/SDL_sysmutex_c.h +++ b/src/thread/psp/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c index 293354e08a8cc..a96193e526145 100644 --- a/src/thread/psp/SDL_syssem.c +++ b/src/thread/psp/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_PSP +#ifdef SDL_THREAD_PSP /* Semaphore functions for the PSP. */ @@ -33,18 +33,18 @@ #include #include -struct SDL_semaphore { - SceUID semid; +struct SDL_semaphore +{ + SceUID semid; }; - /* Create a semaphore */ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; - sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); - if (sem != NULL) { + sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); + if (sem) { /* TODO: Figure out the limit on the maximum value. */ sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL); if (sem->semid < 0) { @@ -62,7 +62,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) /* Free the semaphore */ void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem != NULL) { + if (sem) { if (sem->semid > 0) { sceKernelDeleteSema(sem->semid); sem->semid = 0; @@ -81,9 +81,8 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) Uint32 *pTimeout; int res; - if (sem == NULL) { - SDL_InvalidParamError("sem"); - return 0; + if (!sem) { + return SDL_InvalidParamError("sem"); } if (timeout == 0) { @@ -97,18 +96,18 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) if (timeout == SDL_MUTEX_MAXWAIT) { pTimeout = NULL; } else { - timeout *= 1000; /* Convert to microseconds. */ + timeout *= 1000; /* Convert to microseconds. */ pTimeout = &timeout; } - res = sceKernelWaitSema(sem->semid, 1, (SceUInt *) pTimeout); - switch (res) { - case SCE_KERNEL_ERROR_OK: - return 0; - case SCE_KERNEL_ERROR_WAIT_TIMEOUT: - return SDL_MUTEX_TIMEDOUT; - default: - return SDL_SetError("sceKernelWaitSema() failed"); + res = sceKernelWaitSema(sem->semid, 1, (SceUInt *)pTimeout); + switch (res) { + case SCE_KERNEL_ERROR_OK: + return 0; + case SCE_KERNEL_ERROR_WAIT_TIMEOUT: + return SDL_MUTEX_TIMEDOUT; + default: + return SDL_SetError("sceKernelWaitSema() failed"); } } @@ -127,7 +126,7 @@ Uint32 SDL_SemValue(SDL_sem *sem) { SceKernelSemaInfo info; - if (sem == NULL) { + if (!sem) { SDL_InvalidParamError("sem"); return 0; } @@ -143,7 +142,7 @@ int SDL_SemPost(SDL_sem *sem) { int res; - if (sem == NULL) { + if (!sem) { return SDL_InvalidParamError("sem"); } diff --git a/src/thread/psp/SDL_systhread.c b/src/thread/psp/SDL_systhread.c index 50417cb24a7f0..b38bb73e5cf1d 100644 --- a/src/thread/psp/SDL_systhread.c +++ b/src/thread/psp/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_PSP +#ifdef SDL_THREAD_PSP /* PSP thread management routines for SDL */ @@ -34,10 +34,11 @@ #include #include +#define PSP_THREAD_NAME_MAX 32 static int ThreadEntry(SceSize args, void *argp) { - SDL_RunThread(*(SDL_Thread **) argp); + SDL_RunThread(*(SDL_Thread **)argp); return 0; } @@ -45,6 +46,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) { SceKernelThreadInfo status; int priority = 32; + char thread_name[PSP_THREAD_NAME_MAX]; /* Set priority of new thread to the same as the current thread */ status.size = sizeof(SceKernelThreadInfo); @@ -52,9 +54,14 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) priority = status.currentPriority; } - thread->handle = sceKernelCreateThread(thread->name, ThreadEntry, - priority, thread->stacksize ? ((int) thread->stacksize) : 0x8000, - PSP_THREAD_ATTR_VFPU, NULL); + SDL_strlcpy(thread_name, "SDL thread", PSP_THREAD_NAME_MAX); + if (thread->name) { + SDL_strlcpy(thread_name, thread->name, PSP_THREAD_NAME_MAX); + } + + thread->handle = sceKernelCreateThread(thread_name, ThreadEntry, + priority, thread->stacksize ? ((int)thread->stacksize) : 0x8000, + PSP_THREAD_ATTR_VFPU, NULL); if (thread->handle < 0) { return SDL_SetError("sceKernelCreateThread() failed"); } @@ -70,7 +77,7 @@ void SDL_SYS_SetupThread(const char *name) SDL_threadID SDL_ThreadID(void) { - return (SDL_threadID) sceKernelGetThreadId(); + return (SDL_threadID)sceKernelGetThreadId(); } void SDL_SYS_WaitThread(SDL_Thread *thread) @@ -104,8 +111,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) value = 50; } - return sceKernelChangeThreadPriority(sceKernelGetThreadId(),value); - + return sceKernelChangeThreadPriority(sceKernelGetThreadId(), value); } #endif /* SDL_THREAD_PSP */ diff --git a/src/thread/psp/SDL_systhread_c.h b/src/thread/psp/SDL_systhread_c.h index 3209a90b9bb40..9e951ecb6f9b4 100644 --- a/src/thread/psp/SDL_systhread_c.h +++ b/src/thread/psp/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index c84ec7adae825..485bdbcade2ef 100644 --- a/src/thread/pthread/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,12 +35,11 @@ struct SDL_cond }; /* Create a condition variable */ -SDL_cond * -SDL_CreateCond(void) +SDL_cond *SDL_CreateCond(void) { SDL_cond *cond; - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); + cond = (SDL_cond *)SDL_malloc(sizeof(SDL_cond)); if (cond) { if (pthread_cond_init(&cond->cond, NULL) != 0) { SDL_SetError("pthread_cond_init() failed"); @@ -48,12 +47,11 @@ SDL_CreateCond(void) cond = NULL; } } - return (cond); + return cond; } /* Destroy a condition variable */ -void -SDL_DestroyCond(SDL_cond * cond) +void SDL_DestroyCond(SDL_cond *cond) { if (cond) { pthread_cond_destroy(&cond->cond); @@ -62,8 +60,7 @@ SDL_DestroyCond(SDL_cond * cond) } /* Restart one of the threads that are waiting on the condition variable */ -int -SDL_CondSignal(SDL_cond * cond) +int SDL_CondSignal(SDL_cond *cond) { int retval; @@ -79,8 +76,7 @@ SDL_CondSignal(SDL_cond * cond) } /* Restart all threads that are waiting on the condition variable */ -int -SDL_CondBroadcast(SDL_cond * cond) +int SDL_CondBroadcast(SDL_cond *cond) { int retval; @@ -95,8 +91,7 @@ SDL_CondBroadcast(SDL_cond * cond) return retval; } -int -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) +int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) { int retval; #ifndef HAVE_CLOCK_GETTIME @@ -117,14 +112,14 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) gettimeofday(&delta, NULL); abstime.tv_sec = delta.tv_sec + (ms / 1000); - abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000; + abstime.tv_nsec = (long)(delta.tv_usec + (ms % 1000) * 1000) * 1000; #endif - if (abstime.tv_nsec > 1000000000) { + if (abstime.tv_nsec >= 1000000000) { abstime.tv_sec += 1; abstime.tv_nsec -= 1000000000; } - tryagain: +tryagain: retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime); switch (retval) { case EINTR: @@ -144,8 +139,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) /* Wait on the condition variable, unlocking the provided mutex. The mutex must be locked before entering this function! */ -int -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) +int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) { if (!cond) { return SDL_InvalidParamError("cond"); diff --git a/src/thread/pthread/SDL_sysmutex.c b/src/thread/pthread/SDL_sysmutex.c index c26982aed9aa5..ee356d9d1b49f 100644 --- a/src/thread/pthread/SDL_sysmutex.c +++ b/src/thread/pthread/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,33 +25,32 @@ #include "SDL_thread.h" -#if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \ - !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP -#define FAKE_RECURSIVE_MUTEX 1 +#if !(defined(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX) || \ + defined(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)) +#define FAKE_RECURSIVE_MUTEX #endif struct SDL_mutex { pthread_mutex_t id; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX int recursive; pthread_t owner; #endif }; -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { SDL_mutex *mutex; pthread_mutexattr_t attr; /* Allocate the structure */ - mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex)); + mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex)); if (mutex) { pthread_mutexattr_init(&attr); -#if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#ifdef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); -#elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#elif defined(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP) pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); #else /* No extra attributes necessary */ @@ -64,11 +63,10 @@ SDL_CreateMutex(void) } else { SDL_OutOfMemory(); } - return (mutex); + return mutex; } -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { pthread_mutex_destroy(&mutex->id); @@ -77,18 +75,17 @@ SDL_DestroyMutex(SDL_mutex * mutex) } /* Lock the mutex */ -int -SDL_LockMutex(SDL_mutex * mutex) +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX pthread_t this_thread; #endif if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX this_thread = pthread_self(); if (mutex->owner == this_thread) { ++mutex->recursive; @@ -112,21 +109,20 @@ SDL_LockMutex(SDL_mutex * mutex) return 0; } -int -SDL_TryLockMutex(SDL_mutex * mutex) +int SDL_TryLockMutex(SDL_mutex *mutex) { int retval; int result; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX pthread_t this_thread; #endif - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + if (!mutex) { + return 0; } retval = 0; -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX this_thread = pthread_self(); if (mutex->owner == this_thread) { ++mutex->recursive; @@ -158,14 +154,13 @@ SDL_TryLockMutex(SDL_mutex * mutex) return retval; } -int -SDL_UnlockMutex(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } -#if FAKE_RECURSIVE_MUTEX +#ifdef FAKE_RECURSIVE_MUTEX /* We can only unlock the mutex if we own it */ if (pthread_self() == mutex->owner) { if (mutex->recursive) { diff --git a/src/thread/pthread/SDL_sysmutex_c.h b/src/thread/pthread/SDL_sysmutex_c.h index 722ed4a186ce3..78395222631fa 100644 --- a/src/thread/pthread/SDL_sysmutex_c.h +++ b/src/thread/pthread/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index 9a0c888224a06..80fc5fa79d61f 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,10 +42,9 @@ struct SDL_semaphore }; /* Create a semaphore, initialized with value */ -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { - SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); + SDL_sem *sem = (SDL_sem *)SDL_malloc(sizeof(SDL_sem)); if (sem) { if (sem_init(&sem->sem, 0, initial_value) < 0) { SDL_SetError("sem_init() failed"); @@ -58,8 +57,7 @@ SDL_CreateSemaphore(Uint32 initial_value) return sem; } -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem *sem) { if (sem) { sem_destroy(&sem->sem); @@ -67,8 +65,7 @@ SDL_DestroySemaphore(SDL_sem * sem) } } -int -SDL_SemTryWait(SDL_sem * sem) +int SDL_SemTryWait(SDL_sem *sem) { int retval; @@ -82,8 +79,7 @@ SDL_SemTryWait(SDL_sem * sem) return retval; } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem *sem) { int retval; @@ -101,10 +97,9 @@ SDL_SemWait(SDL_sem * sem) return retval; } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - int retval; + int retval = 0; #ifdef HAVE_SEM_TIMEDWAIT #ifndef HAVE_CLOCK_GETTIME struct timeval now; @@ -128,9 +123,9 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) #ifdef HAVE_SEM_TIMEDWAIT /* Setup the timeout. sem_timedwait doesn't wait for - * a lapse of time, but until we reach a certain time. - * This time is now plus the timeout. - */ + * a lapse of time, but until we reach a certain time. + * This time is now plus the timeout. + */ #ifdef HAVE_CLOCK_GETTIME clock_gettime(CLOCK_REALTIME, &ts_timeout); @@ -146,7 +141,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) #endif /* Wrap the second if needed */ - if (ts_timeout.tv_nsec > 1000000000) { + if (ts_timeout.tv_nsec >= 1000000000) { ts_timeout.tv_sec += 1; ts_timeout.tv_nsec -= 1000000000; } @@ -176,21 +171,23 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) return retval; } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem *sem) { int ret = 0; - if (sem) { - sem_getvalue(&sem->sem, &ret); - if (ret < 0) { - ret = 0; - } + + if (!sem) { + SDL_InvalidParamError("sem"); + return 0; + } + + sem_getvalue(&sem->sem, &ret); + if (ret < 0) { + ret = 0; } - return (Uint32) ret; + return (Uint32)ret; } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem *sem) { int retval; diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 3b3f40fa1823a..2105673464e36 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include -#if HAVE_PTHREAD_NP_H +#ifdef HAVE_PTHREAD_NP_H #include #endif @@ -41,7 +41,7 @@ #include "../../core/linux/SDL_dbus.h" #endif /* __LINUX__ */ -#if (defined(__LINUX__) || defined(__MACOSX__) || defined(__IPHONEOS__)) && defined(HAVE_DLOPEN) +#if (defined(__LINUX__) || defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__ANDROID__)) && defined(HAVE_DLOPEN) #include #ifndef RTLD_DEFAULT #define RTLD_DEFAULT NULL @@ -68,35 +68,33 @@ static const int sig_list[] = { }; #endif -static void * -RunThread(void *data) +static void *RunThread(void *data) { #ifdef __ANDROID__ Android_JNI_SetupThread(); #endif - SDL_RunThread((SDL_Thread *) data); + SDL_RunThread((SDL_Thread *)data); return NULL; } #if (defined(__MACOSX__) || defined(__IPHONEOS__)) && defined(HAVE_DLOPEN) static SDL_bool checked_setname = SDL_FALSE; -static int (*ppthread_setname_np)(const char*) = NULL; -#elif defined(__LINUX__) && defined(HAVE_DLOPEN) +static int (*ppthread_setname_np)(const char *) = NULL; +#elif (defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_DLOPEN) static SDL_bool checked_setname = SDL_FALSE; -static int (*ppthread_setname_np)(pthread_t, const char*) = NULL; +static int (*ppthread_setname_np)(pthread_t, const char *) = NULL; #endif -int -SDL_SYS_CreateThread(SDL_Thread * thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) { pthread_attr_t type; /* do this here before any threads exist, so there's no race condition. */ - #if (defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)) && defined(HAVE_DLOPEN) + #if (defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_DLOPEN) if (!checked_setname) { void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np"); #if defined(__MACOSX__) || defined(__IPHONEOS__) ppthread_setname_np = (int(*)(const char*)) fn; - #elif defined(__LINUX__) + #elif defined(__LINUX__) || defined(__ANDROID__) ppthread_setname_np = (int(*)(pthread_t, const char*)) fn; #endif checked_setname = SDL_TRUE; @@ -108,7 +106,7 @@ SDL_SYS_CreateThread(SDL_Thread * thread) return SDL_SetError("Couldn't initialize pthread attributes"); } pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE); - + /* Set caller-requested stack size. Otherwise: use the system default. */ if (thread->stacksize) { pthread_attr_setstacksize(&type, thread->stacksize); @@ -122,46 +120,45 @@ SDL_SYS_CreateThread(SDL_Thread * thread) return 0; } -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { #if !defined(__NACL__) int i; sigset_t mask; #endif /* !__NACL__ */ - if (name != NULL) { - #if (defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)) && defined(HAVE_DLOPEN) + if (name) { +#if (defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__) || defined(__ANDROID__)) && defined(HAVE_DLOPEN) SDL_assert(checked_setname); - if (ppthread_setname_np != NULL) { - #if defined(__MACOSX__) || defined(__IPHONEOS__) + if (ppthread_setname_np) { +#if defined(__MACOSX__) || defined(__IPHONEOS__) ppthread_setname_np(name); - #elif defined(__LINUX__) +#elif defined(__LINUX__) || defined(__ANDROID__) if (ppthread_setname_np(pthread_self(), name) == ERANGE) { char namebuf[16]; /* Limited to 16 char */ - SDL_strlcpy(namebuf, name, sizeof (namebuf)); + SDL_strlcpy(namebuf, name, sizeof(namebuf)); ppthread_setname_np(pthread_self(), namebuf); } - #endif +#endif } - #elif HAVE_PTHREAD_SETNAME_NP - #if defined(__NETBSD__) - pthread_setname_np(pthread_self(), "%s", name); - #else - if (pthread_setname_np(pthread_self(), name) == ERANGE) { - char namebuf[16]; /* Limited to 16 char */ - SDL_strlcpy(namebuf, name, sizeof (namebuf)); - pthread_setname_np(pthread_self(), namebuf); - } - #endif - #elif HAVE_PTHREAD_SET_NAME_NP - pthread_set_name_np(pthread_self(), name); - #elif defined(__HAIKU__) - /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */ - char namebuf[B_OS_NAME_LENGTH]; - SDL_strlcpy(namebuf, name, sizeof (namebuf)); - rename_thread(find_thread(NULL), namebuf); - #endif +#elif defined(HAVE_PTHREAD_SETNAME_NP) +#if defined(__NETBSD__) + pthread_setname_np(pthread_self(), "%s", name); +#else + if (pthread_setname_np(pthread_self(), name) == ERANGE) { + char namebuf[16]; /* Limited to 16 char */ + SDL_strlcpy(namebuf, name, sizeof(namebuf)); + pthread_setname_np(pthread_self(), namebuf); + } +#endif +#elif defined(HAVE_PTHREAD_SET_NAME_NP) + pthread_set_name_np(pthread_self(), name); +#elif defined(__HAIKU__) + /* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */ + char namebuf[B_OS_NAME_LENGTH]; + SDL_strlcpy(namebuf, name, sizeof(namebuf)); + rename_thread(find_thread(NULL), namebuf); +#endif } /* NativeClient does not yet support signals.*/ @@ -184,16 +181,14 @@ SDL_SYS_SetupThread(const char *name) #endif } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { - return ((SDL_threadID) pthread_self()); + return (SDL_threadID)pthread_self(); } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { -#if __NACL__ || __RISCOS__ || __OS2__ +#if defined(__NACL__) || defined(__RISCOS__) || defined(__OS2__) /* FIXME: Setting thread priority does not seem to be supported in NACL */ return 0; #else @@ -251,7 +246,7 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) policy = pri_policy; } -#if __LINUX__ +#ifdef __LINUX__ { pid_t linuxTid = syscall(SYS_gettid); return SDL_LinuxSetThreadPriorityAndPolicy(linuxTid, priority, policy); @@ -290,14 +285,12 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) #endif /* #if __NACL__ || __RISCOS__ */ } -void -SDL_SYS_WaitThread(SDL_Thread * thread) +void SDL_SYS_WaitThread(SDL_Thread *thread) { pthread_join(thread->handle, 0); } -void -SDL_SYS_DetachThread(SDL_Thread * thread) +void SDL_SYS_DetachThread(SDL_Thread *thread) { pthread_detach(thread->handle); } diff --git a/src/thread/pthread/SDL_systhread_c.h b/src/thread/pthread/SDL_systhread_c.h index fc24425f8b7fc..7a26f0f4536a7 100644 --- a/src/thread/pthread/SDL_systhread_c.h +++ b/src/thread/pthread/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c index c55c69720d514..e625a75dc4d43 100644 --- a/src/thread/pthread/SDL_systls.c +++ b/src/thread/pthread/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,46 +25,57 @@ #include - #define INVALID_PTHREAD_KEY ((pthread_key_t)-1) static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData * -SDL_SYS_GetTLSData(void) +void SDL_SYS_InitTLSData(void) { if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { - static SDL_SpinLock lock; - SDL_AtomicLock(&lock); - if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { - pthread_key_t storage; - if (pthread_key_create(&storage, NULL) == 0) { - SDL_MemoryBarrierRelease(); - thread_local_storage = storage; - } else { - generic_local_storage = SDL_TRUE; - } + if (pthread_key_create(&thread_local_storage, NULL) != 0) { + thread_local_storage = INVALID_PTHREAD_KEY; + SDL_Generic_InitTLSData(); + generic_local_storage = SDL_TRUE; } - SDL_AtomicUnlock(&lock); } +} + +SDL_TLSData *SDL_SYS_GetTLSData(void) +{ if (generic_local_storage) { return SDL_Generic_GetTLSData(); } - SDL_MemoryBarrierAcquire(); - return (SDL_TLSData *)pthread_getspecific(thread_local_storage); + + if (thread_local_storage != INVALID_PTHREAD_KEY) { + return (SDL_TLSData *)pthread_getspecific(thread_local_storage); + } + return NULL; } -int -SDL_SYS_SetTLSData(SDL_TLSData *data) +int SDL_SYS_SetTLSData(SDL_TLSData *data) { if (generic_local_storage) { return SDL_Generic_SetTLSData(data); } + if (pthread_setspecific(thread_local_storage, data) != 0) { return SDL_SetError("pthread_setspecific() failed"); } return 0; } +void SDL_SYS_QuitTLSData(void) +{ + if (generic_local_storage) { + SDL_Generic_QuitTLSData(); + generic_local_storage = SDL_FALSE; + } else { + if (thread_local_storage != INVALID_PTHREAD_KEY) { + pthread_key_delete(thread_local_storage); + thread_local_storage = INVALID_PTHREAD_KEY; + } + } +} + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/stdcpp/SDL_syscond.cpp b/src/thread/stdcpp/SDL_syscond.cpp index 90c38adba332c..ea46973add4cd 100644 --- a/src/thread/stdcpp/SDL_syscond.cpp +++ b/src/thread/stdcpp/SDL_syscond.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,15 +37,14 @@ struct SDL_cond }; /* Create a condition variable */ -extern "C" -SDL_cond * +extern "C" SDL_cond * SDL_CreateCond(void) { /* Allocate and initialize the condition variable */ try { - SDL_cond * cond = new SDL_cond; + SDL_cond *cond = new SDL_cond; return cond; - } catch (std::system_error & ex) { + } catch (std::system_error &ex) { SDL_SetError("unable to create a C++ condition variable: code=%d; %s", ex.code(), ex.what()); return NULL; } catch (std::bad_alloc &) { @@ -55,9 +54,8 @@ SDL_CreateCond(void) } /* Destroy a condition variable */ -extern "C" -void -SDL_DestroyCond(SDL_cond * cond) +extern "C" void +SDL_DestroyCond(SDL_cond *cond) { if (cond) { delete cond; @@ -65,9 +63,8 @@ SDL_DestroyCond(SDL_cond * cond) } /* Restart one of the threads that are waiting on the condition variable */ -extern "C" -int -SDL_CondSignal(SDL_cond * cond) +extern "C" int +SDL_CondSignal(SDL_cond *cond) { if (!cond) { return SDL_InvalidParamError("cond"); @@ -78,9 +75,8 @@ SDL_CondSignal(SDL_cond * cond) } /* Restart all threads that are waiting on the condition variable */ -extern "C" -int -SDL_CondBroadcast(SDL_cond * cond) +extern "C" int +SDL_CondBroadcast(SDL_cond *cond) { if (!cond) { return SDL_InvalidParamError("cond"); @@ -111,15 +107,14 @@ Thread B: SDL_CondSignal(cond); SDL_UnlockMutex(lock); */ -extern "C" -int -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) +extern "C" int +SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) { - if (!cond) { + if (cond == NULL) { return SDL_InvalidParamError("cond"); } - if (!mutex) { + if (mutex == NULL) { return SDL_InvalidParamError("mutex"); } @@ -127,15 +122,13 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) std::unique_lock cpp_lock(mutex->cpp_mutex, std::adopt_lock_t()); if (ms == SDL_MUTEX_MAXWAIT) { cond->cpp_cond.wait( - cpp_lock - ); + cpp_lock); cpp_lock.release(); return 0; } else { auto wait_result = cond->cpp_cond.wait_for( cpp_lock, - std::chrono::duration(ms) - ); + std::chrono::duration(ms)); cpp_lock.release(); if (wait_result == std::cv_status::timeout) { return SDL_MUTEX_TIMEDOUT; @@ -143,15 +136,14 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) return 0; } } - } catch (std::system_error & ex) { + } catch (std::system_error &ex) { return SDL_SetError("unable to wait on a C++ condition variable: code=%d; %s", ex.code(), ex.what()); } } /* Wait on the condition variable forever */ -extern "C" -int -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) +extern "C" int +SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) { return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); } diff --git a/src/thread/stdcpp/SDL_sysmutex.cpp b/src/thread/stdcpp/SDL_sysmutex.cpp index 8288010463b90..49f087fa77db0 100644 --- a/src/thread/stdcpp/SDL_sysmutex.cpp +++ b/src/thread/stdcpp/SDL_sysmutex.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,17 +30,15 @@ extern "C" { #include "SDL_sysmutex_c.h" #include - /* Create a mutex */ -extern "C" -SDL_mutex * +extern "C" SDL_mutex * SDL_CreateMutex(void) { /* Allocate and initialize the mutex */ try { - SDL_mutex * mutex = new SDL_mutex; + SDL_mutex *mutex = new SDL_mutex; return mutex; - } catch (std::system_error & ex) { + } catch (std::system_error &ex) { SDL_SetError("unable to create a C++ mutex: code=%d; %s", ex.code(), ex.what()); return NULL; } catch (std::bad_alloc &) { @@ -50,39 +48,37 @@ SDL_CreateMutex(void) } /* Free the mutex */ -extern "C" -void -SDL_DestroyMutex(SDL_mutex * mutex) +extern "C" void +SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { delete mutex; } } -/* Lock the semaphore */ -extern "C" -int -SDL_mutexP(SDL_mutex * mutex) +/* Lock the mutex */ +extern "C" int +SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } try { mutex->cpp_mutex.lock(); return 0; - } catch (std::system_error & ex) { + } catch (std::system_error &ex) { return SDL_SetError("unable to lock a C++ mutex: code=%d; %s", ex.code(), ex.what()); } } /* TryLock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) +int SDL_TryLockMutex(SDL_mutex *mutex) { int retval = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + + if (!mutex) { + return 0; } if (mutex->cpp_mutex.try_lock() == false) { @@ -92,12 +88,11 @@ SDL_TryLockMutex(SDL_mutex * mutex) } /* Unlock the mutex */ -extern "C" -int -SDL_mutexV(SDL_mutex * mutex) +extern "C" int +SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } mutex->cpp_mutex.unlock(); diff --git a/src/thread/stdcpp/SDL_sysmutex_c.h b/src/thread/stdcpp/SDL_sysmutex_c.h index d80897e253e8e..759852fcdad78 100644 --- a/src/thread/stdcpp/SDL_sysmutex_c.h +++ b/src/thread/stdcpp/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/stdcpp/SDL_systhread.cpp b/src/thread/stdcpp/SDL_systhread.cpp index 3d818ac560c23..0b360bdc0d45e 100644 --- a/src/thread/stdcpp/SDL_systhread.cpp +++ b/src/thread/stdcpp/SDL_systhread.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,30 +36,27 @@ extern "C" { #include #endif -static void -RunThread(void *args) +static void RunThread(void *args) { - SDL_RunThread((SDL_Thread *) args); + SDL_RunThread((SDL_Thread *)args); } -extern "C" -int -SDL_SYS_CreateThread(SDL_Thread * thread) +extern "C" int +SDL_SYS_CreateThread(SDL_Thread *thread) { try { // !!! FIXME: no way to set a thread stack size here. std::thread cpp_thread(RunThread, thread); - thread->handle = (void *) new std::thread(std::move(cpp_thread)); + thread->handle = (void *)new std::thread(std::move(cpp_thread)); return 0; - } catch (std::system_error & ex) { + } catch (std::system_error &ex) { return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what()); } catch (std::bad_alloc &) { return SDL_OutOfMemory(); } } -extern "C" -void +extern "C" void SDL_SYS_SetupThread(const char *name) { // Make sure a thread ID gets assigned ASAP, for debugging purposes: @@ -67,8 +64,7 @@ SDL_SYS_SetupThread(const char *name) return; } -extern "C" -SDL_threadID +extern "C" SDL_threadID SDL_ThreadID(void) { #ifdef __WINRT__ @@ -89,8 +85,7 @@ SDL_ThreadID(void) #endif } -extern "C" -int +extern "C" int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { #ifdef __WINRT__ @@ -98,16 +93,13 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) if (priority == SDL_THREAD_PRIORITY_LOW) { value = THREAD_PRIORITY_LOWEST; - } - else if (priority == SDL_THREAD_PRIORITY_HIGH) { + } else if (priority == SDL_THREAD_PRIORITY_HIGH) { value = THREAD_PRIORITY_HIGHEST; - } - else if (priority == SDL_THREAD_PRIORITY_TIME_CRITICAL) { + } else if (priority == SDL_THREAD_PRIORITY_TIME_CRITICAL) { // FIXME: WinRT does not support TIME_CRITICAL! -flibit SDL_LogWarn(SDL_LOG_CATEGORY_SYSTEM, "TIME_CRITICAL unsupported, falling back to HIGHEST"); value = THREAD_PRIORITY_HIGHEST; - } - else { + } else { value = THREAD_PRIORITY_NORMAL; } if (!SetThreadPriority(GetCurrentThread(), value)) { @@ -119,18 +111,21 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) #endif } -extern "C" -void -SDL_SYS_WaitThread(SDL_Thread * thread) +extern "C" void +SDL_SYS_WaitThread(SDL_Thread *thread) { - if ( ! thread) { + if (!thread) { return; } try { - std::thread * cpp_thread = (std::thread *) thread->handle; - if (cpp_thread->joinable()) { - cpp_thread->join(); + std::thread *cpp_thread = (std::thread *)thread->handle; + if (cpp_thread) { + if (cpp_thread->joinable()) { + cpp_thread->join(); + } + delete cpp_thread; + thread->handle = nullptr; } } catch (std::system_error &) { // An error occurred when joining the thread. SDL_WaitThread does not, @@ -139,18 +134,21 @@ SDL_SYS_WaitThread(SDL_Thread * thread) } } -extern "C" -void -SDL_SYS_DetachThread(SDL_Thread * thread) +extern "C" void +SDL_SYS_DetachThread(SDL_Thread *thread) { - if ( ! thread) { + if (!thread) { return; } try { - std::thread * cpp_thread = (std::thread *) thread->handle; - if (cpp_thread->joinable()) { - cpp_thread->detach(); + std::thread *cpp_thread = (std::thread *)thread->handle; + if (cpp_thread) { + if (cpp_thread->joinable()) { + cpp_thread->detach(); + } + delete cpp_thread; + thread->handle = nullptr; } } catch (std::system_error &) { // An error occurred when detaching the thread. SDL_DetachThread does not, @@ -159,18 +157,29 @@ SDL_SYS_DetachThread(SDL_Thread * thread) } } +static thread_local SDL_TLSData *thread_local_storage; + extern "C" -SDL_TLSData * -SDL_SYS_GetTLSData(void) +void SDL_SYS_InitTLSData(void) { - return SDL_Generic_GetTLSData(); } extern "C" -int -SDL_SYS_SetTLSData(SDL_TLSData *data) +SDL_TLSData * SDL_SYS_GetTLSData(void) +{ + return thread_local_storage; +} + +extern "C" +int SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + thread_local_storage = data; + return 0; +} + +extern "C" +void SDL_SYS_QuitTLSData(void) { - return SDL_Generic_SetTLSData(data); } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/stdcpp/SDL_systhread_c.h b/src/thread/stdcpp/SDL_systhread_c.h index 57c660a85140d..b479a5c827853 100644 --- a/src/thread/stdcpp/SDL_systhread_c.h +++ b/src/thread/stdcpp/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,6 +21,6 @@ #include "SDL_config.h" /* For a thread handle, use a void pointer to a std::thread */ -typedef void * SYS_ThreadHandle; +typedef void *SYS_ThreadHandle; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/vita/SDL_syscond.c b/src/thread/vita/SDL_syscond.c deleted file mode 100644 index c6e46c4754b1f..0000000000000 --- a/src/thread/vita/SDL_syscond.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "../../SDL_internal.h" - -#if SDL_THREAD_VITA - -/* An implementation of condition variables using semaphores and mutexes */ -/* - This implementation borrows heavily from the BeOS condition variable - implementation, written by Christopher Tate and Owen Smith. Thanks! - */ - -#include "SDL_thread.h" - -struct SDL_cond -{ - SDL_mutex *lock; - int waiting; - int signals; - SDL_sem *wait_sem; - SDL_sem *wait_done; -}; - -/* Create a condition variable */ -SDL_cond * -SDL_CreateCond(void) -{ - SDL_cond *cond; - - cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond)); - if (cond) { - cond->lock = SDL_CreateMutex(); - cond->wait_sem = SDL_CreateSemaphore(0); - cond->wait_done = SDL_CreateSemaphore(0); - cond->waiting = cond->signals = 0; - if (!cond->lock || !cond->wait_sem || !cond->wait_done) { - SDL_DestroyCond(cond); - cond = NULL; - } - } else { - SDL_OutOfMemory(); - } - return (cond); -} - -/* Destroy a condition variable */ -void -SDL_DestroyCond(SDL_cond * cond) -{ - if (cond) { - if (cond->wait_sem) { - SDL_DestroySemaphore(cond->wait_sem); - } - if (cond->wait_done) { - SDL_DestroySemaphore(cond->wait_done); - } - if (cond->lock) { - SDL_DestroyMutex(cond->lock); - } - SDL_free(cond); - } -} - -/* Restart one of the threads that are waiting on the condition variable */ -int -SDL_CondSignal(SDL_cond * cond) -{ - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if (cond->waiting > cond->signals) { - ++cond->signals; - SDL_SemPost(cond->wait_sem); - SDL_UnlockMutex(cond->lock); - SDL_SemWait(cond->wait_done); - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Restart all threads that are waiting on the condition variable */ -int -SDL_CondBroadcast(SDL_cond * cond) -{ - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* If there are waiting threads not already signalled, then - signal the condition and wait for the thread to respond. - */ - SDL_LockMutex(cond->lock); - if (cond->waiting > cond->signals) { - int i, num_waiting; - - num_waiting = (cond->waiting - cond->signals); - cond->signals = cond->waiting; - for (i = 0; i < num_waiting; ++i) { - SDL_SemPost(cond->wait_sem); - } - /* Now all released threads are blocked here, waiting for us. - Collect them all (and win fabulous prizes!) :-) - */ - SDL_UnlockMutex(cond->lock); - for (i = 0; i < num_waiting; ++i) { - SDL_SemWait(cond->wait_done); - } - } else { - SDL_UnlockMutex(cond->lock); - } - - return 0; -} - -/* Wait on the condition variable for at most 'ms' milliseconds. - The mutex must be locked before entering this function! - The mutex is unlocked during the wait, and locked again after the wait. - -Typical use: - -Thread A: - SDL_LockMutex(lock); - while ( ! condition ) { - SDL_CondWait(cond, lock); - } - SDL_UnlockMutex(lock); - -Thread B: - SDL_LockMutex(lock); - ... - condition = true; - ... - SDL_CondSignal(cond); - SDL_UnlockMutex(lock); - */ -int -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) -{ - int retval; - - if (!cond) { - return SDL_InvalidParamError("cond"); - } - - /* Obtain the protection mutex, and increment the number of waiters. - This allows the signal mechanism to only perform a signal if there - are waiting threads. - */ - SDL_LockMutex(cond->lock); - ++cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Unlock the mutex, as is required by condition variable semantics */ - SDL_UnlockMutex(mutex); - - /* Wait for a signal */ - if (ms == SDL_MUTEX_MAXWAIT) { - retval = SDL_SemWait(cond->wait_sem); - } else { - retval = SDL_SemWaitTimeout(cond->wait_sem, ms); - } - - /* Let the signaler know we have completed the wait, otherwise - the signaler can race ahead and get the condition semaphore - if we are stopped between the mutex unlock and semaphore wait, - giving a deadlock. See the following URL for details: - http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html - */ - SDL_LockMutex(cond->lock); - if (cond->signals > 0) { - /* If we timed out, we need to eat a condition signal */ - if (retval > 0) { - SDL_SemWait(cond->wait_sem); - } - /* We always notify the signal thread that we are done */ - SDL_SemPost(cond->wait_done); - - /* Signal handshake complete */ - --cond->signals; - } - --cond->waiting; - SDL_UnlockMutex(cond->lock); - - /* Lock the mutex, as is required by condition variable semantics */ - SDL_LockMutex(mutex); - - return retval; -} - -/* Wait on the condition variable forever */ -int -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) -{ - return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); -} - -#endif /* SDL_THREAD_VITA */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/vita/SDL_sysmutex.c b/src/thread/vita/SDL_sysmutex.c index 6327182cce8b0..7c3f21d30e98c 100644 --- a/src/thread/vita/SDL_sysmutex.c +++ b/src/thread/vita/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_VITA +#ifdef SDL_THREAD_VITA #include "SDL_thread.h" #include "SDL_systhread_c.h" @@ -34,14 +34,13 @@ struct SDL_mutex }; /* Create a mutex */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { SDL_mutex *mutex = NULL; SceInt32 res = 0; /* Allocate mutex memory */ - mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex)); + mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex)); if (mutex) { res = sceKernelCreateLwMutex( @@ -49,8 +48,7 @@ SDL_CreateMutex(void) "SDL mutex", SCE_KERNEL_MUTEX_ATTR_RECURSIVE, 0, - NULL - ); + NULL); if (res < 0) { SDL_SetError("Error trying to create mutex: %x", res); @@ -62,8 +60,7 @@ SDL_CreateMutex(void) } /* Free the mutex */ -void -SDL_DestroyMutex(SDL_mutex * mutex) +void SDL_DestroyMutex(SDL_mutex *mutex) { if (mutex) { sceKernelDeleteLwMutex(&mutex->lock); @@ -71,68 +68,66 @@ SDL_DestroyMutex(SDL_mutex * mutex) } } -/* Try to lock the mutex */ -int -SDL_TryLockMutex(SDL_mutex * mutex) +/* Lock the mutex */ +int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + + if (!mutex) { + return 0; } - res = sceKernelTryLockLwMutex(&mutex->lock, 1); - switch (res) { - case SCE_KERNEL_OK: - return 0; - break; - case SCE_KERNEL_ERROR_MUTEX_FAILED_TO_OWN: - return SDL_MUTEX_TIMEDOUT; - break; - default: - return SDL_SetError("Error trying to lock mutex: %x", res); - break; + res = sceKernelLockLwMutex(&mutex->lock, 1, NULL); + if (res != SCE_KERNEL_OK) { + return SDL_SetError("Error trying to lock mutex: %x", res); } - return -1; + return 0; #endif /* SDL_THREADS_DISABLED */ } - -/* Lock the mutex */ -int -SDL_mutexP(SDL_mutex * mutex) +/* Try to lock the mutex */ +int SDL_TryLockMutex(SDL_mutex *mutex) { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + + if (!mutex) { + return 0; } - res = sceKernelLockLwMutex(&mutex->lock, 1, NULL); - if (res != SCE_KERNEL_OK) { + res = sceKernelTryLockLwMutex(&mutex->lock, 1); + switch (res) { + case SCE_KERNEL_OK: + return 0; + break; + case SCE_KERNEL_ERROR_MUTEX_FAILED_TO_OWN: + return SDL_MUTEX_TIMEDOUT; + break; + default: return SDL_SetError("Error trying to lock mutex: %x", res); + break; } - return 0; + return -1; #endif /* SDL_THREADS_DISABLED */ } /* Unlock the mutex */ -int -SDL_mutexV(SDL_mutex * mutex) +int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED return 0; #else SceInt32 res = 0; if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); + return 0; } res = sceKernelUnlockLwMutex(&mutex->lock, 1); diff --git a/src/thread/vita/SDL_sysmutex_c.h b/src/thread/vita/SDL_sysmutex_c.h index 057bcc4bc167d..075ded25ec554 100644 --- a/src/thread/vita/SDL_sysmutex_c.h +++ b/src/thread/vita/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c index 7fecd6ca2ffcd..da1da65e21d08 100644 --- a/src/thread/vita/SDL_syssem.c +++ b/src/thread/vita/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_VITA +#ifdef SDL_THREAD_VITA /* Semaphore functions for the VITA. */ @@ -34,18 +34,18 @@ #include #include -struct SDL_semaphore { - SceUID semid; +struct SDL_semaphore +{ + SceUID semid; }; - /* Create a semaphore */ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { SDL_sem *sem; - sem = (SDL_sem *) SDL_malloc(sizeof(*sem)); - if (sem != NULL) { + sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); + if (sem) { /* TODO: Figure out the limit on the maximum value. */ sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL); if (sem->semid < 0) { @@ -63,7 +63,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) /* Free the semaphore */ void SDL_DestroySemaphore(SDL_sem *sem) { - if (sem != NULL) { + if (sem) { if (sem->semid > 0) { sceKernelDeleteSema(sem->semid); sem->semid = 0; @@ -80,11 +80,10 @@ void SDL_DestroySemaphore(SDL_sem *sem) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { Uint32 *pTimeout; - unsigned int res; + int res; - if (sem == NULL) { - SDL_InvalidParamError("sem"); - return 0; + if (!sem) { + return SDL_InvalidParamError("sem"); } if (timeout == 0) { @@ -98,18 +97,18 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) if (timeout == SDL_MUTEX_MAXWAIT) { pTimeout = NULL; } else { - timeout *= 1000; /* Convert to microseconds. */ + timeout *= 1000; /* Convert to microseconds. */ pTimeout = &timeout; } res = sceKernelWaitSema(sem->semid, 1, pTimeout); - switch (res) { - case SCE_KERNEL_OK: - return 0; - case SCE_KERNEL_ERROR_WAIT_TIMEOUT: - return SDL_MUTEX_TIMEDOUT; - default: - return SDL_SetError("WaitForSingleObject() failed"); + switch (res) { + case SCE_KERNEL_OK: + return 0; + case SCE_KERNEL_ERROR_WAIT_TIMEOUT: + return SDL_MUTEX_TIMEDOUT; + default: + return SDL_SetError("WaitForSingleObject() failed"); } } @@ -129,7 +128,7 @@ Uint32 SDL_SemValue(SDL_sem *sem) SceKernelSemaInfo info; info.size = sizeof(info); - if (sem == NULL) { + if (!sem) { SDL_InvalidParamError("sem"); return 0; } @@ -145,7 +144,7 @@ int SDL_SemPost(SDL_sem *sem) { int res; - if (sem == NULL) { + if (!sem) { return SDL_InvalidParamError("sem"); } diff --git a/src/thread/vita/SDL_systhread.c b/src/thread/vita/SDL_systhread.c index 91ae062567fb5..d3cb1b5393ed5 100644 --- a/src/thread/vita/SDL_systhread.c +++ b/src/thread/vita/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_VITA +#ifdef SDL_THREAD_VITA /* VITA thread management routines for SDL */ @@ -34,19 +34,19 @@ #include #include -#define VITA_THREAD_STACK_SIZE_MIN 0x1000 // 4KiB -#define VITA_THREAD_STACK_SIZE_MAX 0x2000000 // 32MiB -#define VITA_THREAD_STACK_SIZE_DEFAULT 0x10000 // 64KiB -#define VITA_THREAD_NAME_MAX 32 +#define VITA_THREAD_STACK_SIZE_MIN 0x1000 // 4KiB +#define VITA_THREAD_STACK_SIZE_MAX 0x2000000 // 32MiB +#define VITA_THREAD_STACK_SIZE_DEFAULT 0x10000 // 64KiB +#define VITA_THREAD_NAME_MAX 32 -#define VITA_THREAD_PRIORITY_LOW 191 -#define VITA_THREAD_PRIORITY_NORMAL 160 -#define VITA_THREAD_PRIORITY_HIGH 112 +#define VITA_THREAD_PRIORITY_LOW 191 +#define VITA_THREAD_PRIORITY_NORMAL 160 +#define VITA_THREAD_PRIORITY_HIGH 112 #define VITA_THREAD_PRIORITY_TIME_CRITICAL 64 static int ThreadEntry(SceSize args, void *argp) { - SDL_RunThread(*(SDL_Thread **) argp); + SDL_RunThread(*(SDL_Thread **)argp); return 0; } @@ -74,11 +74,11 @@ int SDL_SYS_CreateThread(SDL_Thread *thread) thread->handle = sceKernelCreateThread( thread_name, // name ThreadEntry, // function to run - 0, // priority. 0 means priority of calling thread - stack_size, // stack size - 0, // attibutes. always 0 - 0, // cpu affinity mask. 0 = all CPUs - NULL // opt. always NULL + 0, // priority. 0 means priority of calling thread + stack_size, // stack size + 0, // attibutes. always 0 + 0, // cpu affinity mask. 0 = all CPUs + NULL // opt. always NULL ); if (thread->handle < 0) { @@ -96,7 +96,7 @@ void SDL_SYS_SetupThread(const char *name) SDL_threadID SDL_ThreadID(void) { - return (SDL_threadID) sceKernelGetThreadId(); + return (SDL_threadID)sceKernelGetThreadId(); } void SDL_SYS_WaitThread(SDL_Thread *thread) @@ -114,23 +114,22 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { int value = VITA_THREAD_PRIORITY_NORMAL; - switch(priority) { - case SDL_THREAD_PRIORITY_LOW: - value = VITA_THREAD_PRIORITY_LOW; - break; - case SDL_THREAD_PRIORITY_NORMAL: - value = VITA_THREAD_PRIORITY_NORMAL; - break; - case SDL_THREAD_PRIORITY_HIGH: - value = VITA_THREAD_PRIORITY_HIGH; - break; - case SDL_THREAD_PRIORITY_TIME_CRITICAL: - value = VITA_THREAD_PRIORITY_TIME_CRITICAL; - break; + switch (priority) { + case SDL_THREAD_PRIORITY_LOW: + value = VITA_THREAD_PRIORITY_LOW; + break; + case SDL_THREAD_PRIORITY_NORMAL: + value = VITA_THREAD_PRIORITY_NORMAL; + break; + case SDL_THREAD_PRIORITY_HIGH: + value = VITA_THREAD_PRIORITY_HIGH; + break; + case SDL_THREAD_PRIORITY_TIME_CRITICAL: + value = VITA_THREAD_PRIORITY_TIME_CRITICAL; + break; } return sceKernelChangeThreadPriority(0, value); - } #endif /* SDL_THREAD_VITA */ diff --git a/src/thread/vita/SDL_systhread_c.h b/src/thread/vita/SDL_systhread_c.h index f5f7074647a0b..646f43e6cc5a6 100644 --- a/src/thread/vita/SDL_systhread_c.h +++ b/src/thread/vita/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/windows/SDL_syscond_cv.c b/src/thread/windows/SDL_syscond_cv.c index 9c0ceb3a84639..cb1bed3877c30 100644 --- a/src/thread/windows/SDL_syscond_cv.c +++ b/src/thread/windows/SDL_syscond_cv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../generic/SDL_syscond_c.h" #include "SDL_sysmutex_c.h" -typedef SDL_cond * (*pfnSDL_CreateCond)(void); +typedef SDL_cond *(*pfnSDL_CreateCond)(void); typedef void (*pfnSDL_DestroyCond)(SDL_cond *); typedef int (*pfnSDL_CondSignal)(SDL_cond *); typedef int (*pfnSDL_CondBroadcast)(SDL_cond *); @@ -35,39 +35,42 @@ typedef int (*pfnSDL_CondWaitTimeout)(SDL_cond *, SDL_mutex *, Uint32); typedef struct SDL_cond_impl_t { - pfnSDL_CreateCond Create; - pfnSDL_DestroyCond Destroy; - pfnSDL_CondSignal Signal; - pfnSDL_CondBroadcast Broadcast; - pfnSDL_CondWait Wait; - pfnSDL_CondWaitTimeout WaitTimeout; + pfnSDL_CreateCond Create; + pfnSDL_DestroyCond Destroy; + pfnSDL_CondSignal Signal; + pfnSDL_CondBroadcast Broadcast; + pfnSDL_CondWait Wait; + pfnSDL_CondWaitTimeout WaitTimeout; } SDL_cond_impl_t; /* Implementation will be chosen at runtime based on available Kernel features */ -static SDL_cond_impl_t SDL_cond_impl_active = {0}; - +static SDL_cond_impl_t SDL_cond_impl_active = { 0 }; /** * Native Windows Condition Variable (SRW Locks) */ #ifndef CONDITION_VARIABLE_INIT -#define CONDITION_VARIABLE_INIT {0} -typedef struct CONDITION_VARIABLE { +#define CONDITION_VARIABLE_INIT \ + { \ + 0 \ + } +typedef struct CONDITION_VARIABLE +{ PVOID Ptr; } CONDITION_VARIABLE, *PCONDITION_VARIABLE; #endif -#if __WINRT__ -#define pWakeConditionVariable WakeConditionVariable -#define pWakeAllConditionVariable WakeAllConditionVariable +#ifdef __WINRT__ +#define pWakeConditionVariable WakeConditionVariable +#define pWakeAllConditionVariable WakeAllConditionVariable #define pSleepConditionVariableSRW SleepConditionVariableSRW -#define pSleepConditionVariableCS SleepConditionVariableCS +#define pSleepConditionVariableCS SleepConditionVariableCS #else typedef VOID(WINAPI *pfnWakeConditionVariable)(PCONDITION_VARIABLE); typedef VOID(WINAPI *pfnWakeAllConditionVariable)(PCONDITION_VARIABLE); typedef BOOL(WINAPI *pfnSleepConditionVariableSRW)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG); -typedef BOOL(WINAPI* pfnSleepConditionVariableCS)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD); +typedef BOOL(WINAPI *pfnSleepConditionVariableCS)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD); static pfnWakeConditionVariable pWakeConditionVariable = NULL; static pfnWakeAllConditionVariable pWakeAllConditionVariable = NULL; @@ -80,14 +83,12 @@ typedef struct SDL_cond_cv CONDITION_VARIABLE cond; } SDL_cond_cv; - -static SDL_cond * -SDL_CreateCond_cv(void) +static SDL_cond *SDL_CreateCond_cv(void) { SDL_cond_cv *cond; /* Relies on CONDITION_VARIABLE_INIT == 0. */ - cond = (SDL_cond_cv *) SDL_calloc(1, sizeof(*cond)); + cond = (SDL_cond_cv *)SDL_calloc(1, sizeof(*cond)); if (!cond) { SDL_OutOfMemory(); } @@ -95,8 +96,7 @@ SDL_CreateCond_cv(void) return (SDL_cond *)cond; } -static void -SDL_DestroyCond_cv(SDL_cond * cond) +static void SDL_DestroyCond_cv(SDL_cond *cond) { if (cond) { /* There are no kernel allocated resources */ @@ -104,8 +104,7 @@ SDL_DestroyCond_cv(SDL_cond * cond) } } -static int -SDL_CondSignal_cv(SDL_cond * _cond) +static int SDL_CondSignal_cv(SDL_cond *_cond) { SDL_cond_cv *cond = (SDL_cond_cv *)_cond; if (!cond) { @@ -117,8 +116,7 @@ SDL_CondSignal_cv(SDL_cond * _cond) return 0; } -static int -SDL_CondBroadcast_cv(SDL_cond * _cond) +static int SDL_CondBroadcast_cv(SDL_cond *_cond) { SDL_cond_cv *cond = (SDL_cond_cv *)_cond; if (!cond) { @@ -130,8 +128,7 @@ SDL_CondBroadcast_cv(SDL_cond * _cond) return 0; } -static int -SDL_CondWaitTimeout_cv(SDL_cond * _cond, SDL_mutex * _mutex, Uint32 ms) +static int SDL_CondWaitTimeout_cv(SDL_cond *_cond, SDL_mutex *_mutex, Uint32 ms) { SDL_cond_cv *cond = (SDL_cond_cv *)_cond; DWORD timeout; @@ -147,7 +144,7 @@ SDL_CondWaitTimeout_cv(SDL_cond * _cond, SDL_mutex * _mutex, Uint32 ms) if (ms == SDL_MUTEX_MAXWAIT) { timeout = INFINITE; } else { - timeout = (DWORD) ms; + timeout = (DWORD)ms; } if (SDL_mutex_impl_active.Type == SDL_MUTEX_SRW) { @@ -194,13 +191,12 @@ SDL_CondWaitTimeout_cv(SDL_cond * _cond, SDL_mutex * _mutex, Uint32 ms) return ret; } -static int -SDL_CondWait_cv(SDL_cond * cond, SDL_mutex * mutex) { +static int SDL_CondWait_cv(SDL_cond *cond, SDL_mutex *mutex) +{ return SDL_CondWaitTimeout_cv(cond, mutex, SDL_MUTEX_MAXWAIT); } -static const SDL_cond_impl_t SDL_cond_impl_cv = -{ +static const SDL_cond_impl_t SDL_cond_impl_cv = { &SDL_CreateCond_cv, &SDL_DestroyCond_cv, &SDL_CondSignal_cv, @@ -213,8 +209,7 @@ static const SDL_cond_impl_t SDL_cond_impl_cv = * Generic Condition Variable implementation using SDL_mutex and SDL_sem */ -static const SDL_cond_impl_t SDL_cond_impl_generic = -{ +static const SDL_cond_impl_t SDL_cond_impl_generic = { &SDL_CreateCond_generic, &SDL_DestroyCond_generic, &SDL_CondSignal_generic, @@ -223,13 +218,11 @@ static const SDL_cond_impl_t SDL_cond_impl_generic = &SDL_CondWaitTimeout_generic, }; - -SDL_cond * -SDL_CreateCond(void) +SDL_cond *SDL_CreateCond(void) { - if (SDL_cond_impl_active.Create == NULL) { + if (!SDL_cond_impl_active.Create) { /* Default to generic implementation, works with all mutex implementations */ - const SDL_cond_impl_t * impl = &SDL_cond_impl_generic; + const SDL_cond_impl_t *impl = &SDL_cond_impl_generic; if (SDL_mutex_impl_active.Type == SDL_MUTEX_INVALID) { /* The mutex implementation isn't decided yet, trigger it */ @@ -242,17 +235,17 @@ SDL_CreateCond(void) SDL_assert(SDL_mutex_impl_active.Type != SDL_MUTEX_INVALID); } -#if __WINRT__ +#ifdef __WINRT__ /* Link statically on this platform */ impl = &SDL_cond_impl_cv; #else { HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); if (kernel32) { - pWakeConditionVariable = (pfnWakeConditionVariable) GetProcAddress(kernel32, "WakeConditionVariable"); - pWakeAllConditionVariable = (pfnWakeAllConditionVariable) GetProcAddress(kernel32, "WakeAllConditionVariable"); - pSleepConditionVariableSRW = (pfnSleepConditionVariableSRW) GetProcAddress(kernel32, "SleepConditionVariableSRW"); - pSleepConditionVariableCS = (pfnSleepConditionVariableCS) GetProcAddress(kernel32, "SleepConditionVariableCS"); + pWakeConditionVariable = (pfnWakeConditionVariable)GetProcAddress(kernel32, "WakeConditionVariable"); + pWakeAllConditionVariable = (pfnWakeAllConditionVariable)GetProcAddress(kernel32, "WakeAllConditionVariable"); + pSleepConditionVariableSRW = (pfnSleepConditionVariableSRW)GetProcAddress(kernel32, "SleepConditionVariableSRW"); + pSleepConditionVariableCS = (pfnSleepConditionVariableCS)GetProcAddress(kernel32, "SleepConditionVariableCS"); if (pWakeConditionVariable && pWakeAllConditionVariable && pSleepConditionVariableSRW && pSleepConditionVariableCS) { /* Use the Windows provided API */ impl = &SDL_cond_impl_cv; @@ -266,32 +259,27 @@ SDL_CreateCond(void) return SDL_cond_impl_active.Create(); } -void -SDL_DestroyCond(SDL_cond * cond) +void SDL_DestroyCond(SDL_cond *cond) { SDL_cond_impl_active.Destroy(cond); } -int -SDL_CondSignal(SDL_cond * cond) +int SDL_CondSignal(SDL_cond *cond) { return SDL_cond_impl_active.Signal(cond); } -int -SDL_CondBroadcast(SDL_cond * cond) +int SDL_CondBroadcast(SDL_cond *cond) { return SDL_cond_impl_active.Broadcast(cond); } -int -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms) +int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms) { return SDL_cond_impl_active.WaitTimeout(cond, mutex, ms); } -int -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) +int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex) { return SDL_cond_impl_active.Wait(cond, mutex); } diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c index 3974b33626fb3..ab4734df074ae 100644 --- a/src/thread/windows/SDL_sysmutex.c +++ b/src/thread/windows/SDL_sysmutex.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_WINDOWS +#ifdef SDL_THREAD_WINDOWS /** * Mutex functions using the Win32 API @@ -35,19 +35,17 @@ #include "SDL_sysmutex_c.h" - /* Implementation will be chosen at runtime based on available Kernel features */ -SDL_mutex_impl_t SDL_mutex_impl_active = {0}; - +SDL_mutex_impl_t SDL_mutex_impl_active = { 0 }; /** * Implementation based on Slim Reader/Writer (SRW) Locks for Win 7 and newer. */ -#if __WINRT__ +#ifdef __WINRT__ /* Functions are guaranteed to be available */ -#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive -#define pAcquireSRWLockExclusive AcquireSRWLockExclusive +#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive +#define pAcquireSRWLockExclusive AcquireSRWLockExclusive #define pTryAcquireSRWLockExclusive TryAcquireSRWLockExclusive #else typedef VOID(WINAPI *pfnReleaseSRWLockExclusive)(PSRWLOCK); @@ -58,13 +56,12 @@ static pfnAcquireSRWLockExclusive pAcquireSRWLockExclusive = NULL; static pfnTryAcquireSRWLockExclusive pTryAcquireSRWLockExclusive = NULL; #endif -static SDL_mutex * -SDL_CreateMutex_srw(void) +static SDL_mutex *SDL_CreateMutex_srw(void) { SDL_mutex_srw *mutex; /* Relies on SRWLOCK_INIT == 0. */ - mutex = (SDL_mutex_srw *) SDL_calloc(1, sizeof(*mutex)); + mutex = (SDL_mutex_srw *)SDL_calloc(1, sizeof(*mutex)); if (!mutex) { SDL_OutOfMemory(); } @@ -72,25 +69,17 @@ SDL_CreateMutex_srw(void) return (SDL_mutex *)mutex; } -static void -SDL_DestroyMutex_srw(SDL_mutex * mutex) +static void SDL_DestroyMutex_srw(SDL_mutex *mutex) { - if (mutex) { - /* There are no kernel allocated resources */ - SDL_free(mutex); - } + /* There are no kernel allocated resources */ + SDL_free(mutex); } -static int -SDL_LockMutex_srw(SDL_mutex * _mutex) +static int SDL_LockMutex_srw(SDL_mutex *_mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { SDL_mutex_srw *mutex = (SDL_mutex_srw *)_mutex; DWORD this_thread; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } - this_thread = GetCurrentThreadId(); if (mutex->owner == this_thread) { ++mutex->count; @@ -107,17 +96,12 @@ SDL_LockMutex_srw(SDL_mutex * _mutex) return 0; } -static int -SDL_TryLockMutex_srw(SDL_mutex * _mutex) +static int SDL_TryLockMutex_srw(SDL_mutex *_mutex) { SDL_mutex_srw *mutex = (SDL_mutex_srw *)_mutex; DWORD this_thread; int retval = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } - this_thread = GetCurrentThreadId(); if (mutex->owner == this_thread) { ++mutex->count; @@ -133,15 +117,10 @@ SDL_TryLockMutex_srw(SDL_mutex * _mutex) return retval; } -static int -SDL_UnlockMutex_srw(SDL_mutex * _mutex) +static int SDL_UnlockMutex_srw(SDL_mutex *_mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { SDL_mutex_srw *mutex = (SDL_mutex_srw *)_mutex; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } - if (mutex->owner == GetCurrentThreadId()) { if (--mutex->count == 0) { mutex->owner = 0; @@ -154,8 +133,7 @@ SDL_UnlockMutex_srw(SDL_mutex * _mutex) return 0; } -static const SDL_mutex_impl_t SDL_mutex_impl_srw = -{ +static const SDL_mutex_impl_t SDL_mutex_impl_srw = { &SDL_CreateMutex_srw, &SDL_DestroyMutex_srw, &SDL_LockMutex_srw, @@ -164,23 +142,21 @@ static const SDL_mutex_impl_t SDL_mutex_impl_srw = SDL_MUTEX_SRW, }; - /** * Fallback Mutex implementation using Critical Sections (before Win 7) */ /* Create a mutex */ -static SDL_mutex * -SDL_CreateMutex_cs(void) +static SDL_mutex *SDL_CreateMutex_cs(void) { SDL_mutex_cs *mutex; /* Allocate mutex memory */ - mutex = (SDL_mutex_cs *) SDL_malloc(sizeof(*mutex)); + mutex = (SDL_mutex_cs *)SDL_malloc(sizeof(*mutex)); if (mutex) { /* Initialize */ /* On SMP systems, a non-zero spin count generally helps performance */ -#if __WINRT__ +#ifdef __WINRT__ InitializeCriticalSectionEx(&mutex->cs, 2000, 0); #else InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); @@ -192,38 +168,28 @@ SDL_CreateMutex_cs(void) } /* Free the mutex */ -static void -SDL_DestroyMutex_cs(SDL_mutex * mutex_) +static void SDL_DestroyMutex_cs(SDL_mutex *mutex_) { SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_; - if (mutex) { - DeleteCriticalSection(&mutex->cs); - SDL_free(mutex); - } + + DeleteCriticalSection(&mutex->cs); + SDL_free(mutex); } /* Lock the mutex */ -static int -SDL_LockMutex_cs(SDL_mutex * mutex_) +static int SDL_LockMutex_cs(SDL_mutex *mutex_) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } EnterCriticalSection(&mutex->cs); return 0; } /* TryLock the mutex */ -static int -SDL_TryLockMutex_cs(SDL_mutex * mutex_) +static int SDL_TryLockMutex_cs(SDL_mutex *mutex_) { SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_; int retval = 0; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } if (TryEnterCriticalSection(&mutex->cs) == 0) { retval = SDL_MUTEX_TIMEDOUT; @@ -232,20 +198,15 @@ SDL_TryLockMutex_cs(SDL_mutex * mutex_) } /* Unlock the mutex */ -static int -SDL_UnlockMutex_cs(SDL_mutex * mutex_) +static int SDL_UnlockMutex_cs(SDL_mutex *mutex_) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */ { SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_; - if (mutex == NULL) { - return SDL_InvalidParamError("mutex"); - } LeaveCriticalSection(&mutex->cs); return 0; } -static const SDL_mutex_impl_t SDL_mutex_impl_cs = -{ +static const SDL_mutex_impl_t SDL_mutex_impl_cs = { &SDL_CreateMutex_cs, &SDL_DestroyMutex_cs, &SDL_LockMutex_cs, @@ -254,20 +215,18 @@ static const SDL_mutex_impl_t SDL_mutex_impl_cs = SDL_MUTEX_CS, }; - /** * Runtime selection and redirection */ -SDL_mutex * -SDL_CreateMutex(void) +SDL_mutex *SDL_CreateMutex(void) { - if (SDL_mutex_impl_active.Create == NULL) { + if (!SDL_mutex_impl_active.Create) { /* Default to fallback implementation */ - const SDL_mutex_impl_t * impl = &SDL_mutex_impl_cs; + const SDL_mutex_impl_t *impl = &SDL_mutex_impl_cs; if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, SDL_FALSE)) { -#if __WINRT__ +#ifdef __WINRT__ /* Link statically on this platform */ impl = &SDL_mutex_impl_srw; #else @@ -275,10 +234,10 @@ SDL_CreateMutex(void) HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); if (kernel32) { /* Requires Vista: */ - pReleaseSRWLockExclusive = (pfnReleaseSRWLockExclusive) GetProcAddress(kernel32, "ReleaseSRWLockExclusive"); - pAcquireSRWLockExclusive = (pfnAcquireSRWLockExclusive) GetProcAddress(kernel32, "AcquireSRWLockExclusive"); + pReleaseSRWLockExclusive = (pfnReleaseSRWLockExclusive)GetProcAddress(kernel32, "ReleaseSRWLockExclusive"); + pAcquireSRWLockExclusive = (pfnAcquireSRWLockExclusive)GetProcAddress(kernel32, "AcquireSRWLockExclusive"); /* Requires 7: */ - pTryAcquireSRWLockExclusive = (pfnTryAcquireSRWLockExclusive) GetProcAddress(kernel32, "TryAcquireSRWLockExclusive"); + pTryAcquireSRWLockExclusive = (pfnTryAcquireSRWLockExclusive)GetProcAddress(kernel32, "TryAcquireSRWLockExclusive"); if (pReleaseSRWLockExclusive && pAcquireSRWLockExclusive && pTryAcquireSRWLockExclusive) { impl = &SDL_mutex_impl_srw; } @@ -292,23 +251,37 @@ SDL_CreateMutex(void) return SDL_mutex_impl_active.Create(); } -void -SDL_DestroyMutex(SDL_mutex * mutex) { - SDL_mutex_impl_active.Destroy(mutex); +void SDL_DestroyMutex(SDL_mutex *mutex) +{ + if (mutex) { + SDL_mutex_impl_active.Destroy(mutex); + } } -int -SDL_LockMutex(SDL_mutex * mutex) { +int SDL_LockMutex(SDL_mutex *mutex) +{ + if (!mutex) { + return 0; + } + return SDL_mutex_impl_active.Lock(mutex); } -int -SDL_TryLockMutex(SDL_mutex * mutex) { +int SDL_TryLockMutex(SDL_mutex *mutex) +{ + if (!mutex) { + return 0; + } + return SDL_mutex_impl_active.TryLock(mutex); } -int -SDL_UnlockMutex(SDL_mutex * mutex) { +int SDL_UnlockMutex(SDL_mutex *mutex) +{ + if (!mutex) { + return 0; + } + return SDL_mutex_impl_active.Unlock(mutex); } diff --git a/src/thread/windows/SDL_sysmutex_c.h b/src/thread/windows/SDL_sysmutex_c.h index a97c5293db56b..e74497bc7813b 100644 --- a/src/thread/windows/SDL_sysmutex_c.h +++ b/src/thread/windows/SDL_sysmutex_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,21 +39,24 @@ typedef enum typedef struct SDL_mutex_impl_t { - pfnSDL_CreateMutex Create; + pfnSDL_CreateMutex Create; pfnSDL_DestroyMutex Destroy; - pfnSDL_LockMutex Lock; + pfnSDL_LockMutex Lock; pfnSDL_TryLockMutex TryLock; - pfnSDL_UnlockMutex Unlock; + pfnSDL_UnlockMutex Unlock; /* Needed by SDL_cond: */ - SDL_MutexType Type; + SDL_MutexType Type; } SDL_mutex_impl_t; extern SDL_mutex_impl_t SDL_mutex_impl_active; - #ifndef SRWLOCK_INIT -#define SRWLOCK_INIT {0} -typedef struct _SRWLOCK { +#define SRWLOCK_INIT \ + { \ + 0 \ + } +typedef struct _SRWLOCK +{ PVOID Ptr; } SRWLOCK, *PSRWLOCK; #endif diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c index 629f2a9cc5b34..4a96fef6885ca 100644 --- a/src/thread/windows/SDL_syssem.c +++ b/src/thread/windows/SDL_syssem.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_WINDOWS +#ifdef SDL_THREAD_WINDOWS /** * Semaphore functions using the Win32 API @@ -31,7 +31,7 @@ * Faster due to significantly less context switches. * Requires Windows 8 or newer. * which are chosen at runtime. -*/ + */ #include "../../core/windows/SDL_windows.h" @@ -49,18 +49,17 @@ typedef int (*pfnSDL_SemPost)(SDL_sem *); typedef struct SDL_semaphore_impl_t { - pfnSDL_CreateSemaphore Create; + pfnSDL_CreateSemaphore Create; pfnSDL_DestroySemaphore Destroy; - pfnSDL_SemWaitTimeout WaitTimeout; - pfnSDL_SemTryWait TryWait; - pfnSDL_SemWait Wait; - pfnSDL_SemValue Value; - pfnSDL_SemPost Post; + pfnSDL_SemWaitTimeout WaitTimeout; + pfnSDL_SemTryWait TryWait; + pfnSDL_SemWait Wait; + pfnSDL_SemValue Value; + pfnSDL_SemPost Post; } SDL_sem_impl_t; /* Implementation will be chosen at runtime based on available Kernel features */ -static SDL_sem_impl_t SDL_sem_impl_active = {0}; - +static SDL_sem_impl_t SDL_sem_impl_active = { 0 }; /** * Atomic + WaitOnAddress implementation @@ -69,19 +68,13 @@ static SDL_sem_impl_t SDL_sem_impl_active = {0}; /* APIs not available on WinPhone 8.1 */ /* https://www.microsoft.com/en-us/download/details.aspx?id=47328 */ -#if (HAVE_WINAPIFAMILY_H) && defined(WINAPI_FAMILY_PHONE_APP) -#define SDL_WINAPI_FAMILY_PHONE (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) -#else -#define SDL_WINAPI_FAMILY_PHONE 0 -#endif - #if !SDL_WINAPI_FAMILY_PHONE -#if __WINRT__ +#ifdef __WINRT__ /* Functions are guaranteed to be available */ -#define pWaitOnAddress WaitOnAddress +#define pWaitOnAddress WaitOnAddress #define pWakeByAddressSingle WakeByAddressSingle #else -typedef BOOL(WINAPI *pfnWaitOnAddress)(volatile VOID*, PVOID, SIZE_T, DWORD); +typedef BOOL(WINAPI *pfnWaitOnAddress)(volatile VOID *, PVOID, SIZE_T, DWORD); typedef VOID(WINAPI *pfnWakeByAddressSingle)(PVOID); static pfnWaitOnAddress pWaitOnAddress = NULL; @@ -93,12 +86,11 @@ typedef struct SDL_semaphore_atom LONG count; } SDL_sem_atom; -static SDL_sem * -SDL_CreateSemaphore_atom(Uint32 initial_value) +static SDL_sem *SDL_CreateSemaphore_atom(Uint32 initial_value) { SDL_sem_atom *sem; - sem = (SDL_sem_atom *) SDL_malloc(sizeof(*sem)); + sem = (SDL_sem_atom *)SDL_malloc(sizeof(*sem)); if (sem) { sem->count = initial_value; } else { @@ -107,16 +99,14 @@ SDL_CreateSemaphore_atom(Uint32 initial_value) return (SDL_sem *)sem; } -static void -SDL_DestroySemaphore_atom(SDL_sem * sem) +static void SDL_DestroySemaphore_atom(SDL_sem *sem) { if (sem) { SDL_free(sem); } } -static int -SDL_SemTryWait_atom(SDL_sem * _sem) +static int SDL_SemTryWait_atom(SDL_sem *_sem) { SDL_sem_atom *sem = (SDL_sem_atom *)_sem; LONG count; @@ -137,8 +127,7 @@ SDL_SemTryWait_atom(SDL_sem * _sem) return SDL_MUTEX_TIMEDOUT; } -static int -SDL_SemWait_atom(SDL_sem * _sem) +static int SDL_SemWait_atom(SDL_sem *_sem) { SDL_sem_atom *sem = (SDL_sem_atom *)_sem; LONG count; @@ -162,8 +151,7 @@ SDL_SemWait_atom(SDL_sem * _sem) } } -static int -SDL_SemWaitTimeout_atom(SDL_sem * _sem, Uint32 timeout) +static int SDL_SemWaitTimeout_atom(SDL_sem *_sem, Uint32 timeout) { SDL_sem_atom *sem = (SDL_sem_atom *)_sem; LONG count; @@ -184,7 +172,7 @@ SDL_SemWaitTimeout_atom(SDL_sem * _sem, Uint32 timeout) * need to recalculate the effective timeout before every wait */ now = SDL_GetTicks(); - deadline = now + (DWORD) timeout; + deadline = now + (DWORD)timeout; for (;;) { count = sem->count; @@ -213,8 +201,7 @@ SDL_SemWaitTimeout_atom(SDL_sem * _sem, Uint32 timeout) } } -static Uint32 -SDL_SemValue_atom(SDL_sem * _sem) +static Uint32 SDL_SemValue_atom(SDL_sem *_sem) { SDL_sem_atom *sem = (SDL_sem_atom *)_sem; @@ -226,8 +213,7 @@ SDL_SemValue_atom(SDL_sem * _sem) return (Uint32)sem->count; } -static int -SDL_SemPost_atom(SDL_sem * _sem) +static int SDL_SemPost_atom(SDL_sem *_sem) { SDL_sem_atom *sem = (SDL_sem_atom *)_sem; @@ -241,8 +227,7 @@ SDL_SemPost_atom(SDL_sem * _sem) return 0; } -static const SDL_sem_impl_t SDL_sem_impl_atom = -{ +static const SDL_sem_impl_t SDL_sem_impl_atom = { &SDL_CreateSemaphore_atom, &SDL_DestroySemaphore_atom, &SDL_SemWaitTimeout_atom, @@ -253,7 +238,6 @@ static const SDL_sem_impl_t SDL_sem_impl_atom = }; #endif /* !SDL_WINAPI_FAMILY_PHONE */ - /** * Fallback Semaphore implementation using Kernel Semaphores */ @@ -265,16 +249,15 @@ typedef struct SDL_semaphore_kern } SDL_sem_kern; /* Create a semaphore */ -static SDL_sem * -SDL_CreateSemaphore_kern(Uint32 initial_value) +static SDL_sem *SDL_CreateSemaphore_kern(Uint32 initial_value) { SDL_sem_kern *sem; /* Allocate sem memory */ - sem = (SDL_sem_kern *) SDL_malloc(sizeof(*sem)); + sem = (SDL_sem_kern *)SDL_malloc(sizeof(*sem)); if (sem) { /* Create the semaphore, with max value 32K */ -#if __WINRT__ +#ifdef __WINRT__ sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS); #else sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL); @@ -292,8 +275,7 @@ SDL_CreateSemaphore_kern(Uint32 initial_value) } /* Free the semaphore */ -static void -SDL_DestroySemaphore_kern(SDL_sem * _sem) +static void SDL_DestroySemaphore_kern(SDL_sem *_sem) { SDL_sem_kern *sem = (SDL_sem_kern *)_sem; if (sem) { @@ -305,8 +287,7 @@ SDL_DestroySemaphore_kern(SDL_sem * _sem) } } -static int -SDL_SemWaitTimeout_kern(SDL_sem * _sem, Uint32 timeout) +static int SDL_SemWaitTimeout_kern(SDL_sem *_sem, Uint32 timeout) { SDL_sem_kern *sem = (SDL_sem_kern *)_sem; int retval; @@ -319,7 +300,7 @@ SDL_SemWaitTimeout_kern(SDL_sem * _sem, Uint32 timeout) if (timeout == SDL_MUTEX_MAXWAIT) { dwMilliseconds = INFINITE; } else { - dwMilliseconds = (DWORD) timeout; + dwMilliseconds = (DWORD)timeout; } switch (WaitForSingleObjectEx(sem->id, dwMilliseconds, FALSE)) { case WAIT_OBJECT_0: @@ -336,21 +317,18 @@ SDL_SemWaitTimeout_kern(SDL_sem * _sem, Uint32 timeout) return retval; } -static int -SDL_SemTryWait_kern(SDL_sem * sem) +static int SDL_SemTryWait_kern(SDL_sem *sem) { return SDL_SemWaitTimeout_kern(sem, 0); } -static int -SDL_SemWait_kern(SDL_sem * sem) +static int SDL_SemWait_kern(SDL_sem *sem) { return SDL_SemWaitTimeout_kern(sem, SDL_MUTEX_MAXWAIT); } /* Returns the current count of the semaphore */ -static Uint32 -SDL_SemValue_kern(SDL_sem * _sem) +static Uint32 SDL_SemValue_kern(SDL_sem *_sem) { SDL_sem_kern *sem = (SDL_sem_kern *)_sem; if (!sem) { @@ -360,8 +338,7 @@ SDL_SemValue_kern(SDL_sem * _sem) return (Uint32)sem->count; } -static int -SDL_SemPost_kern(SDL_sem * _sem) +static int SDL_SemPost_kern(SDL_sem *_sem) { SDL_sem_kern *sem = (SDL_sem_kern *)_sem; if (!sem) { @@ -374,14 +351,13 @@ SDL_SemPost_kern(SDL_sem * _sem) */ InterlockedIncrement(&sem->count); if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) { - InterlockedDecrement(&sem->count); /* restore */ + InterlockedDecrement(&sem->count); /* restore */ return SDL_SetError("ReleaseSemaphore() failed"); } return 0; } -static const SDL_sem_impl_t SDL_sem_impl_kern = -{ +static const SDL_sem_impl_t SDL_sem_impl_kern = { &SDL_CreateSemaphore_kern, &SDL_DestroySemaphore_kern, &SDL_SemWaitTimeout_kern, @@ -391,21 +367,19 @@ static const SDL_sem_impl_t SDL_sem_impl_kern = &SDL_SemPost_kern, }; - /** * Runtime selection and redirection */ -SDL_sem * -SDL_CreateSemaphore(Uint32 initial_value) +SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { - if (SDL_sem_impl_active.Create == NULL) { + if (!SDL_sem_impl_active.Create) { /* Default to fallback implementation */ - const SDL_sem_impl_t * impl = &SDL_sem_impl_kern; + const SDL_sem_impl_t *impl = &SDL_sem_impl_kern; #if !SDL_WINAPI_FAMILY_PHONE if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL, SDL_FALSE)) { -#if __WINRT__ +#ifdef __WINRT__ /* Link statically on this platform */ impl = &SDL_sem_impl_atom; #else @@ -418,10 +392,10 @@ SDL_CreateSemaphore(Uint32 initial_value) HMODULE synch120 = GetModuleHandle(TEXT("api-ms-win-core-synch-l1-2-0.dll")); if (synch120) { /* Try to load required functions provided by Win 8 or newer */ - pWaitOnAddress = (pfnWaitOnAddress) GetProcAddress(synch120, "WaitOnAddress"); - pWakeByAddressSingle = (pfnWakeByAddressSingle) GetProcAddress(synch120, "WakeByAddressSingle"); + pWaitOnAddress = (pfnWaitOnAddress)GetProcAddress(synch120, "WaitOnAddress"); + pWakeByAddressSingle = (pfnWakeByAddressSingle)GetProcAddress(synch120, "WakeByAddressSingle"); - if(pWaitOnAddress && pWakeByAddressSingle) { + if (pWaitOnAddress && pWakeByAddressSingle) { impl = &SDL_sem_impl_atom; } } @@ -435,38 +409,32 @@ SDL_CreateSemaphore(Uint32 initial_value) return SDL_sem_impl_active.Create(initial_value); } -void -SDL_DestroySemaphore(SDL_sem * sem) +void SDL_DestroySemaphore(SDL_sem *sem) { SDL_sem_impl_active.Destroy(sem); } -int -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout) +int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { return SDL_sem_impl_active.WaitTimeout(sem, timeout); } -int -SDL_SemTryWait(SDL_sem * sem) +int SDL_SemTryWait(SDL_sem *sem) { return SDL_sem_impl_active.TryWait(sem); } -int -SDL_SemWait(SDL_sem * sem) +int SDL_SemWait(SDL_sem *sem) { return SDL_sem_impl_active.Wait(sem); } -Uint32 -SDL_SemValue(SDL_sem * sem) +Uint32 SDL_SemValue(SDL_sem *sem) { return SDL_sem_impl_active.Value(sem); } -int -SDL_SemPost(SDL_sem * sem) +int SDL_SemPost(SDL_sem *sem) { return SDL_sem_impl_active.Post(sem); } diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 8f44e473c3364..37653f96318be 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_THREAD_WINDOWS +#ifdef SDL_THREAD_WINDOWS /* Win32 thread management routines for SDL */ @@ -30,89 +30,53 @@ #include "../SDL_systhread.h" #include "SDL_systhread_c.h" -#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD -/* We'll use the C library from this DLL */ -#include - #ifndef STACK_SIZE_PARAM_IS_A_RESERVATION #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 #endif -/* Cygwin gcc-3 ... MingW64 (even with a i386 host) does this like MSVC. */ -#if (defined(__MINGW32__) && (__GNUC__ < 4)) -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); - -#elif defined(__WATCOMC__) -/* This is for Watcom targets except OS2 */ -#if __WATCOMC__ < 1240 -#define __watcall -#endif -typedef unsigned long (__watcall * pfnSDL_CurrentBeginThread) (void *, - unsigned, - unsigned - (__stdcall * - func) (void - *), - void *arg, - unsigned, - unsigned - *threadID); -typedef void (__watcall * pfnSDL_CurrentEndThread) (unsigned code); - -#else -typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); -typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); -#endif +#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD +/* We'll use the C library from this DLL */ +#include +typedef uintptr_t(__cdecl *pfnSDL_CurrentBeginThread)(void *, unsigned, + unsigned(__stdcall *func)(void*), + void *arg, unsigned, + unsigned *threadID); +typedef void(__cdecl *pfnSDL_CurrentEndThread)(unsigned code); #endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */ - -static DWORD -RunThread(void *data) +static DWORD RunThread(void *data) { - SDL_Thread *thread = (SDL_Thread *) data; - pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread) thread->endfunc; + SDL_Thread *thread = (SDL_Thread *)data; + pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread)thread->endfunc; SDL_RunThread(thread); - if (pfnEndThread != NULL) { + if (pfnEndThread) { pfnEndThread(0); } return 0; } -static DWORD WINAPI -RunThreadViaCreateThread(LPVOID data) +static DWORD WINAPI MINGW32_FORCEALIGN RunThreadViaCreateThread(LPVOID data) { - return RunThread(data); + return RunThread(data); } -static unsigned __stdcall -RunThreadViaBeginThreadEx(void *data) +static unsigned __stdcall MINGW32_FORCEALIGN RunThreadViaBeginThreadEx(void *data) { - return (unsigned) RunThread(data); + return (unsigned)RunThread(data); } #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD -int -SDL_SYS_CreateThread(SDL_Thread * thread, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread) +int SDL_SYS_CreateThread(SDL_Thread *thread, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) { #elif defined(__CYGWIN__) || defined(__WINRT__) -int -SDL_SYS_CreateThread(SDL_Thread * thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) { pfnSDL_CurrentBeginThread pfnBeginThread = NULL; pfnSDL_CurrentEndThread pfnEndThread = NULL; #else -int -SDL_SYS_CreateThread(SDL_Thread * thread) +int SDL_SYS_CreateThread(SDL_Thread *thread) { pfnSDL_CurrentBeginThread pfnBeginThread = (pfnSDL_CurrentBeginThread)_beginthreadex; pfnSDL_CurrentEndThread pfnEndThread = (pfnSDL_CurrentEndThread)_endthreadex; @@ -125,58 +89,55 @@ SDL_SYS_CreateThread(SDL_Thread * thread) /* thread->stacksize == 0 means "system default", same as win32 expects */ if (pfnBeginThread) { unsigned threadid = 0; - thread->handle = (SYS_ThreadHandle) - ((size_t) pfnBeginThread(NULL, (unsigned int) thread->stacksize, - RunThreadViaBeginThreadEx, - thread, flags, &threadid)); + thread->handle = (SYS_ThreadHandle)((size_t)pfnBeginThread(NULL, (unsigned int)thread->stacksize, + RunThreadViaBeginThreadEx, + thread, flags, &threadid)); } else { DWORD threadid = 0; thread->handle = CreateThread(NULL, thread->stacksize, RunThreadViaCreateThread, thread, flags, &threadid); } - if (thread->handle == NULL) { + if (!thread->handle) { return SDL_SetError("Not enough resources to create thread"); } return 0; } -#pragma pack(push,8) +#pragma pack(push, 8) typedef struct tagTHREADNAME_INFO { - DWORD dwType; /* must be 0x1000 */ - LPCSTR szName; /* pointer to name (in user addr space) */ + DWORD dwType; /* must be 0x1000 */ + LPCSTR szName; /* pointer to name (in user addr space) */ DWORD dwThreadID; /* thread ID (-1=caller thread) */ - DWORD dwFlags; /* reserved for future use, must be zero */ + DWORD dwFlags; /* reserved for future use, must be zero */ } THREADNAME_INFO; #pragma pack(pop) +typedef HRESULT(WINAPI *pfnSetThreadDescription)(HANDLE, PCWSTR); -typedef HRESULT (WINAPI *pfnSetThreadDescription)(HANDLE, PCWSTR); - -void -SDL_SYS_SetupThread(const char *name) +void SDL_SYS_SetupThread(const char *name) { - if (name != NULL) { - #ifndef __WINRT__ /* !!! FIXME: There's no LoadLibrary() in WinRT; don't know if SetThreadDescription is available there at all at the moment. */ + if (name) { +#ifndef __WINRT__ /* !!! FIXME: There's no LoadLibrary() in WinRT; don't know if SetThreadDescription is available there at all at the moment. */ static pfnSetThreadDescription pSetThreadDescription = NULL; - static HMODULE kernel32 = 0; + static HMODULE kernel32 = NULL; if (!kernel32) { kernel32 = GetModuleHandle(TEXT("kernel32.dll")); if (kernel32) { - pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription"); + pSetThreadDescription = (pfnSetThreadDescription)GetProcAddress(kernel32, "SetThreadDescription"); } } - if (pSetThreadDescription != NULL) { + if (pSetThreadDescription) { WCHAR *strw = WIN_UTF8ToStringW(name); if (strw) { pSetThreadDescription(GetCurrentThread(), strw); SDL_free(strw); } } - #endif +#endif /* Presumably some version of Visual Studio will understand SetThreadDescription(), but we still need to deal with older OSes and debuggers. Set it with the arcane @@ -194,23 +155,21 @@ SDL_SYS_SetupThread(const char *name) SDL_zero(inf); inf.dwType = 0x1000; inf.szName = name; - inf.dwThreadID = (DWORD) -1; + inf.dwThreadID = (DWORD)-1; inf.dwFlags = 0; /* The debugger catches this, renames the thread, continues on. */ - RaiseException(0x406D1388, 0, sizeof(inf) / sizeof(ULONG), (const ULONG_PTR*) &inf); + RaiseException(0x406D1388, 0, sizeof(inf) / sizeof(ULONG_PTR), (const ULONG_PTR *)&inf); } } } -SDL_threadID -SDL_ThreadID(void) +SDL_threadID SDL_ThreadID(void) { - return ((SDL_threadID) GetCurrentThreadId()); + return (SDL_threadID)GetCurrentThreadId(); } -int -SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) +int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { int value; @@ -229,15 +188,13 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) return 0; } -void -SDL_SYS_WaitThread(SDL_Thread * thread) +void SDL_SYS_WaitThread(SDL_Thread *thread) { WaitForSingleObjectEx(thread->handle, INFINITE, FALSE); CloseHandle(thread->handle); } -void -SDL_SYS_DetachThread(SDL_Thread * thread) +void SDL_SYS_DetachThread(SDL_Thread *thread) { CloseHandle(thread->handle); } diff --git a/src/thread/windows/SDL_systhread_c.h b/src/thread/windows/SDL_systhread_c.h index debb19d7e6f02..80edc26df03dd 100644 --- a/src/thread/windows/SDL_systhread_c.h +++ b/src/thread/windows/SDL_systhread_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c index 22e507a7a7d9f..dd0a711cdf8b7 100644 --- a/src/thread/windows/SDL_systls.c +++ b/src/thread/windows/SDL_systls.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_THREAD_WINDOWS +#ifdef SDL_THREAD_WINDOWS #include "../../core/windows/SDL_windows.h" @@ -32,7 +32,7 @@ #include #ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES FLS_OUT_OF_INDEXES +#define TLS_OUT_OF_INDEXES FLS_OUT_OF_INDEXES #endif #define TlsAlloc() FlsAlloc(NULL) @@ -43,42 +43,54 @@ static DWORD thread_local_storage = TLS_OUT_OF_INDEXES; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData * -SDL_SYS_GetTLSData(void) +void SDL_SYS_InitTLSData(void) { if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { - static SDL_SpinLock lock; - SDL_AtomicLock(&lock); - if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { - DWORD storage = TlsAlloc(); - if (storage != TLS_OUT_OF_INDEXES) { - SDL_MemoryBarrierRelease(); - thread_local_storage = storage; - } else { - generic_local_storage = SDL_TRUE; - } + thread_local_storage = TlsAlloc(); + if (thread_local_storage == TLS_OUT_OF_INDEXES) { + SDL_Generic_InitTLSData(); + generic_local_storage = SDL_TRUE; } - SDL_AtomicUnlock(&lock); } +} + +SDL_TLSData *SDL_SYS_GetTLSData(void) +{ if (generic_local_storage) { return SDL_Generic_GetTLSData(); } - SDL_MemoryBarrierAcquire(); - return (SDL_TLSData *)TlsGetValue(thread_local_storage); + + if (thread_local_storage != TLS_OUT_OF_INDEXES) { + return (SDL_TLSData *)TlsGetValue(thread_local_storage); + } + return NULL; } -int -SDL_SYS_SetTLSData(SDL_TLSData *data) +int SDL_SYS_SetTLSData(SDL_TLSData *data) { if (generic_local_storage) { return SDL_Generic_SetTLSData(data); } + if (!TlsSetValue(thread_local_storage, data)) { - return SDL_SetError("TlsSetValue() failed"); + return WIN_SetError("TlsSetValue()"); } return 0; } +void SDL_SYS_QuitTLSData(void) +{ + if (generic_local_storage) { + SDL_Generic_QuitTLSData(); + generic_local_storage = SDL_FALSE; + } else { + if (thread_local_storage != TLS_OUT_OF_INDEXES) { + TlsFree(thread_local_storage); + thread_local_storage = TLS_OUT_OF_INDEXES; + } + } +} + #endif /* SDL_THREAD_WINDOWS */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 6741e97cb52d2..a050290171dc5 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ /* #define DEBUG_TIMERS */ -#if !defined(__EMSCRIPTEN__) || !SDL_THREADS_DISABLED +#if !defined(__EMSCRIPTEN__) || !defined(SDL_THREADS_DISABLED) typedef struct _SDL_Timer { @@ -49,7 +49,8 @@ typedef struct _SDL_TimerMap } SDL_TimerMap; /* The timers are kept in a sorted list */ -typedef struct { +typedef struct +{ /* Data used by the main thread */ SDL_Thread *thread; SDL_atomic_t nextID; @@ -78,14 +79,13 @@ static SDL_TimerData SDL_timer_data; * Timers are removed by simply setting a canceled flag */ -static void -SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer) +static void SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer) { SDL_Timer *prev, *curr; prev = NULL; for (curr = data->timers; curr; prev = curr, curr = curr->next) { - if ((Sint32)(timer->scheduled-curr->scheduled) < 0) { + if ((Sint32)(timer->scheduled - curr->scheduled) < 0) { break; } } @@ -99,8 +99,7 @@ SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer) timer->next = curr; } -static int SDLCALL -SDL_TimerThread(void *_data) +static int SDLCALL SDL_TimerThread(void *_data) { SDL_TimerData *data = (SDL_TimerData *)_data; SDL_Timer *pending; @@ -114,7 +113,7 @@ SDL_TimerThread(void *_data) * 2. Handle any timers that should dispatch this cycle * 3. Wait until next dispatch time or new timer arrives */ - for ( ; ; ) { + for (;;) { /* Pending and freelist maintenance */ SDL_AtomicLock(&data->lock); { @@ -153,7 +152,7 @@ SDL_TimerThread(void *_data) while (data->timers) { current = data->timers; - if ((Sint32)(tick-current->scheduled) < 0) { + if ((Sint32)(tick - current->scheduled) < 0) { /* Scheduled for the future, wait a bit */ delay = (current->scheduled - tick); break; @@ -205,8 +204,7 @@ SDL_TimerThread(void *_data) return 0; } -int -SDL_TimerInit(void) +int SDL_TimerInit(void) { SDL_TimerData *data = &SDL_timer_data; @@ -237,14 +235,13 @@ SDL_TimerInit(void) return 0; } -void -SDL_TimerQuit(void) +void SDL_TimerQuit(void) { SDL_TimerData *data = &SDL_timer_data; SDL_Timer *timer; SDL_TimerMap *entry; - if (SDL_AtomicCAS(&data->active, 1, 0)) { /* active? Move to inactive. */ + if (SDL_AtomicCAS(&data->active, 1, 0)) { /* active? Move to inactive. */ /* Shutdown the timer thread */ if (data->thread) { SDL_SemPost(data->sem); @@ -277,8 +274,7 @@ SDL_TimerQuit(void) } } -SDL_TimerID -SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) +SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) { SDL_TimerData *data = &SDL_timer_data; SDL_Timer *timer; @@ -340,8 +336,7 @@ SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) return entry->timerID; } -SDL_bool -SDL_RemoveTimer(SDL_TimerID id) +SDL_bool SDL_RemoveTimer(SDL_TimerID id) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *prev, *entry; @@ -387,17 +382,17 @@ typedef struct _SDL_TimerMap struct _SDL_TimerMap *next; } SDL_TimerMap; -typedef struct { +typedef struct +{ int nextID; SDL_TimerMap *timermap; } SDL_TimerData; static SDL_TimerData SDL_timer_data; -static void -SDL_Emscripten_TimerHelper(void *userdata) +static void SDL_Emscripten_TimerHelper(void *userdata) { - SDL_TimerMap *entry = (SDL_TimerMap*)userdata; + SDL_TimerMap *entry = (SDL_TimerMap *)userdata; entry->interval = entry->callback(entry->interval, entry->param); if (entry->interval > 0) { entry->timeoutID = emscripten_set_timeout(&SDL_Emscripten_TimerHelper, @@ -406,14 +401,12 @@ SDL_Emscripten_TimerHelper(void *userdata) } } -int -SDL_TimerInit(void) +int SDL_TimerInit(void) { return 0; } -void -SDL_TimerQuit(void) +void SDL_TimerQuit(void) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *entry; @@ -425,8 +418,7 @@ SDL_TimerQuit(void) } } -SDL_TimerID -SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) +SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *entry; @@ -451,8 +443,7 @@ SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param) return entry->timerID; } -SDL_bool -SDL_RemoveTimer(SDL_TimerID id) +SDL_bool SDL_RemoveTimer(SDL_TimerID id) { SDL_TimerData *data = &SDL_timer_data; SDL_TimerMap *prev, *entry; @@ -485,10 +476,9 @@ SDL_RemoveTimer(SDL_TimerID id) which wraps back to zero every ~49 days. The newer SDL_GetTicks64() doesn't have this problem, so we just wrap that function and clamp to the low 32-bits for binary compatibility. */ -Uint32 -SDL_GetTicks(void) +Uint32 SDL_GetTicks(void) { - return (Uint32) (SDL_GetTicks64() & 0xFFFFFFFF); + return (Uint32)(SDL_GetTicks64() & 0xFFFFFFFF); } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/SDL_timer_c.h b/src/timer/SDL_timer_c.h index 555913e4d13f2..2f7de5f6c8168 100644 --- a/src/timer/SDL_timer_c.h +++ b/src/timer/SDL_timer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #include "SDL_timer.h" #define ROUND_RESOLUTION(X) \ - (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) + (((X + TIMER_RESOLUTION - 1) / TIMER_RESOLUTION) * TIMER_RESOLUTION) extern void SDL_TicksInit(void); extern void SDL_TicksQuit(void); diff --git a/src/timer/dummy/SDL_systimer.c b/src/timer/dummy/SDL_systimer.c index 8e34959f0fe93..b9eb0cecaae69 100644 --- a/src/timer/dummy/SDL_systimer.c +++ b/src/timer/dummy/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,8 +26,7 @@ static SDL_bool ticks_started = SDL_FALSE; -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -35,14 +34,12 @@ SDL_TicksInit(void) ticks_started = SDL_TRUE; } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { if (!ticks_started) { SDL_TicksInit(); @@ -52,20 +49,17 @@ SDL_GetTicks64(void) return 0; } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return SDL_GetTicks(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return 1000; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { SDL_Unsupported(); } diff --git a/src/timer/haiku/SDL_systimer.c b/src/timer/haiku/SDL_systimer.c index fb358b9d203a6..6e7d6bee32cd5 100644 --- a/src/timer/haiku/SDL_systimer.c +++ b/src/timer/haiku/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,7 @@ static bigtime_t start; static SDL_bool ticks_started = SDL_FALSE; -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -41,36 +40,31 @@ SDL_TicksInit(void) start = system_time(); } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { if (!ticks_started) { SDL_TicksInit(); } - return (Uint64) ((system_time() - start) / 1000); + return (Uint64)((system_time() - start) / 1000); } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return system_time(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return 1000000; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { snooze(ms * 1000); } diff --git a/src/timer/n3ds/SDL_systimer.c b/src/timer/n3ds/SDL_systimer.c index 6a4d29b0480c5..bc31eb80ff66c 100644 --- a/src/timer/n3ds/SDL_systimer.c +++ b/src/timer/n3ds/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,7 @@ static u64 start_tick; #define NSEC_PER_MSEC 1000000ULL -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -40,14 +39,12 @@ SDL_TicksInit(void) start_tick = svcGetSystemTick(); } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { u64 elapsed; if (!ticks_started) { @@ -58,20 +55,17 @@ SDL_GetTicks64(void) return elapsed / CPU_TICKS_PER_MSEC; } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return svcGetSystemTick(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return SYSCLOCK_ARM11; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { svcSleepThread(ms * NSEC_PER_MSEC); } diff --git a/src/timer/ngage/SDL_systimer.cpp b/src/timer/ngage/SDL_systimer.cpp index 543d8494d756f..85d3dc87bc391 100644 --- a/src/timer/ngage/SDL_systimer.cpp +++ b/src/timer/ngage/SDL_systimer.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,42 +28,37 @@ #include "SDL_timer.h" static SDL_bool ticks_started = SDL_FALSE; -static TUint start = 0; -static TInt tickPeriodMilliSeconds; +static TUint start = 0; +static TInt tickPeriodMilliSeconds; #ifdef __cplusplus extern "C" { #endif -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { - if (ticks_started) - { + if (ticks_started) { return; } ticks_started = SDL_TRUE; - start = User::TickCount(); + start = User::TickCount(); TTimeIntervalMicroSeconds32 period; - TInt tmp = UserHal::TickPeriod(period); + TInt tmp = UserHal::TickPeriod(period); (void)tmp; /* Suppress redundant warning. */ tickPeriodMilliSeconds = period.Int() / 1000; } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { - if (! ticks_started) - { + if (!ticks_started) { SDL_TicksInit(); } @@ -73,20 +68,17 @@ SDL_GetTicks64(void) return (Uint64)(deltaTics * tickPeriodMilliSeconds); } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return (Uint64)User::TickCount(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return 1000000; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { User::After(TTimeIntervalMicroSeconds32(ms * 1000)); } diff --git a/src/timer/os2/SDL_systimer.c b/src/timer/os2/SDL_systimer.c index 8a8425d29af44..e268d592b8638 100644 --- a/src/timer/os2/SDL_systimer.c +++ b/src/timer/os2/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_TIMER_OS2 +#ifdef SDL_TIMER_OS2 #include "SDL_timer.h" #include "../../core/os2/SDL_os2.h" @@ -43,8 +43,7 @@ static SDL_bool ticks_started = SDL_FALSE; static ULONG ulTmrFreq = 0; static ULLONG ullTmrStart = 0; -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { ULONG ulTmrStart; /* for 32-bit fallback. */ ULONG ulRC; @@ -66,18 +65,16 @@ SDL_TicksInit(void) } ulTmrFreq = 0; /* Error - use DosQuerySysInfo() for timer. */ - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrStart, sizeof (ULONG)); + DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrStart, sizeof(ULONG)); ullTmrStart = (ULLONG) ulTmrStart; } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { Uint64 ui64Result; ULLONG ullTmrNow; @@ -92,15 +89,14 @@ SDL_GetTicks64(void) } else { /* note that this counter rolls over to 0 every ~49 days. Fix your system so DosTmrQueryTime works if you need to avoid this. */ ULONG ulTmrNow; - DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrNow, sizeof (ULONG)); + DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulTmrNow, sizeof(ULONG)); ui64Result = (((Uint64) ulTmrNow) - ullTmrStart); } return ui64Result; } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { QWORD qwTmrNow; @@ -110,14 +106,12 @@ SDL_GetPerformanceCounter(void) return *((Uint64 *)&qwTmrNow); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return (ulTmrFreq == 0)? 1000 : (Uint64)ulTmrFreq; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { HTIMER hTimer = NULLHANDLE; ULONG ulRC; diff --git a/src/timer/ps2/SDL_systimer.c b/src/timer/ps2/SDL_systimer.c index 42d296803eaf7..0b0cf1a904c31 100644 --- a/src/timer/ps2/SDL_systimer.c +++ b/src/timer/ps2/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,8 +34,9 @@ static uint64_t start; static SDL_bool ticks_started = SDL_FALSE; -void -SDL_TicksInit(void) +static Uint64 BUSCLK_MS = (kBUSCLK / 1000); + +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -45,14 +46,12 @@ SDL_TicksInit(void) start = GetTimerSystemTime(); } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { uint64_t now; @@ -61,26 +60,24 @@ SDL_GetTicks64(void) } now = GetTimerSystemTime(); - return (Uint64)((now - start) / (kBUSCLK / CLOCKS_PER_SEC)); + return (Uint64)((now - start) / BUSCLK_MS); } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return SDL_GetTicks64(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return 1000; } void SDL_Delay(Uint32 ms) { - struct timespec tv = {0}; - tv.tv_sec = ms / 1000; - tv.tv_nsec = (ms % 1000) * 1000000; + struct timespec tv = { 0 }; + tv.tv_sec = ms / 1000; + tv.tv_nsec = (ms % 1000) * 1000000; nanosleep(&tv, NULL); } diff --git a/src/timer/psp/SDL_systimer.c b/src/timer/psp/SDL_systimer.c index df6225fa3d082..def21f8b565d5 100644 --- a/src/timer/psp/SDL_systimer.c +++ b/src/timer/psp/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,57 +30,50 @@ #include #include #include +#include -static struct timeval start; -static SDL_bool ticks_started = SDL_FALSE; +static Uint64 start_tick; -void -SDL_TicksInit(void) +static Uint64 PSP_Ticks(void) { - if (ticks_started) { - return; - } - ticks_started = SDL_TRUE; - - gettimeofday(&start, NULL); + Uint64 ticks; + sceRtcGetCurrentTick(&ticks); + return ticks; } -void -SDL_TicksQuit(void) +void SDL_TicksInit(void) { - ticks_started = SDL_FALSE; + if (start_tick == 0) { + start_tick = PSP_Ticks(); + } } -Uint64 -SDL_GetTicks64(void) +void SDL_TicksQuit(void) { - struct timeval now; - - if (!ticks_started) { - SDL_TicksInit(); - } +} - gettimeofday(&now, NULL); - return (Uint64)(((Sint64)(now.tv_sec - start.tv_sec) * 1000) + ((now.tv_usec - start.tv_usec) / 1000)); +/* return ticks as milliseconds */ +Uint64 SDL_GetTicks64(void) +{ + return (PSP_Ticks() - start_tick) / 1000ULL; } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { - return SDL_GetTicks64(); + return PSP_Ticks(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { - return 1000; + return sceRtcGetTickResolution(); } void SDL_Delay(Uint32 ms) { const Uint32 max_delay = 0xffffffffUL / 1000; - if(ms > max_delay) + if (ms > max_delay) { ms = max_delay; + } sceKernelDelayThreadCB(ms * 1000); } diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 406bd48c5532e..7cc5dee88c69a 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -46,7 +46,7 @@ Also added OS X Monotonic clock support Based on work in https://github.com/ThomasHabets/monotonic_clock */ -#if HAVE_NANOSLEEP || HAVE_CLOCK_GETTIME +#if defined(HAVE_NANOSLEEP) || defined(HAVE_CLOCK_GETTIME) #include #endif #ifdef __APPLE__ @@ -54,7 +54,7 @@ #endif /* Use CLOCK_MONOTONIC_RAW, if available, which is not subject to adjustment by NTP */ -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME #ifdef CLOCK_MONOTONIC_RAW #define SDL_MONOTONIC_CLOCK CLOCK_MONOTONIC_RAW #else @@ -63,7 +63,7 @@ #endif /* The first ticks value of the application */ -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME static struct timespec start_ts; #elif defined(__APPLE__) static uint64_t start_mach; @@ -73,8 +73,7 @@ static SDL_bool has_monotonic_time = SDL_FALSE; static struct timeval start_tv; static SDL_bool ticks_started = SDL_FALSE; -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -82,7 +81,7 @@ SDL_TicksInit(void) ticks_started = SDL_TRUE; /* Set first ticks value */ -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME if (clock_gettime(SDL_MONOTONIC_CLOCK, &start_ts) == 0) { has_monotonic_time = SDL_TRUE; } else @@ -97,27 +96,25 @@ SDL_TicksInit(void) } } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { if (!ticks_started) { SDL_TicksInit(); } if (has_monotonic_time) { -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME struct timespec now; clock_gettime(SDL_MONOTONIC_CLOCK, &now); return (Uint64)(((Sint64)(now.tv_sec - start_ts.tv_sec) * 1000) + ((now.tv_nsec - start_ts.tv_nsec) / 1000000)); #elif defined(__APPLE__) const uint64_t now = mach_absolute_time(); - return ((((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000); + return (((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000; #else SDL_assert(SDL_FALSE); return 0; @@ -129,8 +126,7 @@ SDL_GetTicks64(void) } } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { Uint64 ticks; if (!ticks_started) { @@ -138,7 +134,7 @@ SDL_GetPerformanceCounter(void) } if (has_monotonic_time) { -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME struct timespec now; clock_gettime(SDL_MONOTONIC_CLOCK, &now); @@ -159,18 +155,17 @@ SDL_GetPerformanceCounter(void) ticks *= 1000000; ticks += now.tv_usec; } - return (ticks); + return ticks; } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { if (!ticks_started) { SDL_TicksInit(); } if (has_monotonic_time) { -#if HAVE_CLOCK_GETTIME +#ifdef HAVE_CLOCK_GETTIME return 1000000000; #elif defined(__APPLE__) Uint64 freq = mach_base_info.denom; @@ -178,17 +173,16 @@ SDL_GetPerformanceFrequency(void) freq /= mach_base_info.numer; return freq; #endif - } - + } + return 1000000; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { int was_error; -#if HAVE_NANOSLEEP +#ifdef HAVE_NANOSLEEP struct timespec elapsed, tv; #else struct timeval tv; @@ -204,7 +198,7 @@ SDL_Delay(Uint32 ms) #endif /* Set the timeout interval */ -#if HAVE_NANOSLEEP +#ifdef HAVE_NANOSLEEP elapsed.tv_sec = ms / 1000; elapsed.tv_nsec = (ms % 1000) * 1000000; #else @@ -213,7 +207,7 @@ SDL_Delay(Uint32 ms) do { errno = 0; -#if HAVE_NANOSLEEP +#ifdef HAVE_NANOSLEEP tv.tv_sec = elapsed.tv_sec; tv.tv_nsec = elapsed.tv_nsec; was_error = nanosleep(&tv, &elapsed); diff --git a/src/timer/vita/SDL_systimer.c b/src/timer/vita/SDL_systimer.c index db382378ed000..8aa994ddb1daa 100644 --- a/src/timer/vita/SDL_systimer.c +++ b/src/timer/vita/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,8 +34,7 @@ static uint64_t start; static SDL_bool ticks_started = SDL_FALSE; -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { if (ticks_started) { return; @@ -45,14 +44,12 @@ SDL_TicksInit(void) start = sceKernelGetProcessTimeWide(); } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { uint64_t now; @@ -61,17 +58,15 @@ SDL_GetTicks64(void) } now = sceKernelGetProcessTimeWide(); - return (Uint64) ((now - start) / 1000); + return (Uint64)((now - start) / 1000); } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { return sceKernelGetProcessTimeWide(); } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { return 1000000; } @@ -79,8 +74,9 @@ SDL_GetPerformanceFrequency(void) void SDL_Delay(Uint32 ms) { const Uint32 max_delay = 0xffffffffUL / 1000; - if(ms > max_delay) + if (ms > max_delay) { ms = max_delay; + } sceKernelDelayThreadCB(ms * 1000); } diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index 52dea837fdd64..b23390d1f07f6 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,15 +31,14 @@ /* The first (low-resolution) ticks value of the application */ static DWORD start = 0; -static BOOL ticks_started = FALSE; +static BOOL ticks_started = FALSE; /* The first high-resolution ticks value of the application */ static LARGE_INTEGER start_ticks; /* The number of ticks per second of the high-resolution performance counter */ static LARGE_INTEGER ticks_per_second; -static void -SDL_SetSystemTimerResolution(const UINT uPeriod) +static void SDL_SetSystemTimerResolution(const UINT uPeriod) { #if !defined(__WINRT__) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) static UINT timer_period = 0; @@ -58,8 +57,7 @@ SDL_SetSystemTimerResolution(const UINT uPeriod) #endif } -static void SDLCALL -SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { UINT uPeriod; @@ -74,8 +72,7 @@ SDL_TimerResolutionChanged(void *userdata, const char *name, const char *oldValu } } -void -SDL_TicksInit(void) +void SDL_TicksInit(void) { BOOL rc; @@ -94,24 +91,22 @@ SDL_TicksInit(void) so we'll rely on it here. */ rc = QueryPerformanceFrequency(&ticks_per_second); - SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ + SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ QueryPerformanceCounter(&start_ticks); } -void -SDL_TicksQuit(void) +void SDL_TicksQuit(void) { SDL_DelHintCallback(SDL_HINT_TIMER_RESOLUTION, SDL_TimerResolutionChanged, NULL); - SDL_SetSystemTimerResolution(0); /* always release our timer resolution request. */ + SDL_SetSystemTimerResolution(0); /* always release our timer resolution request. */ start = 0; ticks_started = SDL_FALSE; } -Uint64 -SDL_GetTicks64(void) +Uint64 SDL_GetTicks64(void) { LARGE_INTEGER now; BOOL rc; @@ -121,30 +116,27 @@ SDL_GetTicks64(void) } rc = QueryPerformanceCounter(&now); - SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ - return (Uint64) (((now.QuadPart - start_ticks.QuadPart) * 1000) / ticks_per_second.QuadPart); + SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ + return (Uint64)(((now.QuadPart - start_ticks.QuadPart) * 1000) / ticks_per_second.QuadPart); } -Uint64 -SDL_GetPerformanceCounter(void) +Uint64 SDL_GetPerformanceCounter(void) { LARGE_INTEGER counter; const BOOL rc = QueryPerformanceCounter(&counter); - SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ - return (Uint64) counter.QuadPart; + SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ + return (Uint64)counter.QuadPart; } -Uint64 -SDL_GetPerformanceFrequency(void) +Uint64 SDL_GetPerformanceFrequency(void) { LARGE_INTEGER frequency; const BOOL rc = QueryPerformanceFrequency(&frequency); - SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ - return (Uint64) frequency.QuadPart; + SDL_assert(rc != 0); /* this should _never_ fail if you're on XP or later. */ + return (Uint64)frequency.QuadPart; } -void -SDL_Delay(Uint32 ms) +void SDL_Delay(Uint32 ms) { /* Sleep() is not publicly available to apps in early versions of WinRT. * diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index b67b765e9dc8e..ee7e8fcc61f13 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -92,14 +92,14 @@ #include "SDL_blit.h" #include "SDL_RLEaccel_c.h" -#define PIXEL_COPY(to, from, len, bpp) \ +#define PIXEL_COPY(to, from, len, bpp) \ SDL_memcpy(to, from, (size_t)(len) * (bpp)) /* * Various colorkey blit methods, for opaque and per-surface alpha */ -#define OPAQUE_BLIT(to, from, length, bpp, alpha) \ +#define OPAQUE_BLIT(to, from, length, bpp, alpha) \ PIXEL_COPY(to, from, length, bpp) /* @@ -109,22 +109,22 @@ * of each component, so the bits from the multiplication don't collide. * This can be used for any RGB permutation of course. */ -#define ALPHA_BLIT32_888(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint32 *src = (Uint32 *)(from); \ - Uint32 *dst = (Uint32 *)(to); \ - for (i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - Uint32 s1 = s & 0xff00ff; \ - Uint32 d1 = d & 0xff00ff; \ +#define ALPHA_BLIT32_888(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint32 *src = (Uint32 *)(from); \ + Uint32 *dst = (Uint32 *)(to); \ + for (i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + Uint32 s1 = s & 0xff00ff; \ + Uint32 d1 = d & 0xff00ff; \ d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - *dst++ = d1 | d; \ - } \ + s &= 0xff00; \ + d &= 0xff00; \ + d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ + *dst++ = d1 | d; \ + } \ } while (0) /* @@ -133,99 +133,99 @@ * components at the same time. Since the smallest gap is here just * 5 bits, we have to scale alpha down to 5 bits as well. */ -#define ALPHA_BLIT16_565(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - Uint32 ALPHA = alpha >> 3; \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - s = (s | s << 16) & 0x07e0f81f; \ - d = (d | d << 16) & 0x07e0f81f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x07e0f81f; \ - *dst++ = (Uint16)(d | d >> 16); \ - } \ - } while(0) - -#define ALPHA_BLIT16_555(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - Uint32 ALPHA = alpha >> 3; \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - s = (s | s << 16) & 0x03e07c1f; \ - d = (d | d << 16) & 0x03e07c1f; \ - d += (s - d) * ALPHA >> 5; \ - d &= 0x03e07c1f; \ - *dst++ = (Uint16)(d | d >> 16); \ - } \ - } while(0) +#define ALPHA_BLIT16_565(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + Uint32 ALPHA = alpha >> 3; \ + for (i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + s = (s | s << 16) & 0x07e0f81f; \ + d = (d | d << 16) & 0x07e0f81f; \ + d += (s - d) * ALPHA >> 5; \ + d &= 0x07e0f81f; \ + *dst++ = (Uint16)(d | d >> 16); \ + } \ + } while (0) + +#define ALPHA_BLIT16_555(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + Uint32 ALPHA = alpha >> 3; \ + for (i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + s = (s | s << 16) & 0x03e07c1f; \ + d = (d | d << 16) & 0x03e07c1f; \ + d += (s - d) * ALPHA >> 5; \ + d &= 0x03e07c1f; \ + *dst++ = (Uint16)(d | d >> 16); \ + } \ + } while (0) /* * The general slow catch-all function, for remaining depths and formats */ -#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint8 *src = from; \ - Uint8 *dst = to; \ - for (i = 0; i < (int)(length); i++) { \ - Uint32 s, d; \ - unsigned rs, gs, bs, rd, gd, bd; \ - switch (bpp) { \ - case 2: \ - s = *(Uint16 *)src; \ - d = *(Uint16 *)dst; \ - break; \ - case 3: \ - if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ +#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint8 *src = from; \ + Uint8 *dst = to; \ + for (i = 0; i < (int)(length); i++) { \ + Uint32 s, d; \ + unsigned rs, gs, bs, rd, gd, bd; \ + switch (bpp) { \ + case 2: \ + s = *(Uint16 *)src; \ + d = *(Uint16 *)dst; \ + break; \ + case 3: \ + if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ s = (src[0] << 16) | (src[1] << 8) | src[2]; \ d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \ - } else { \ + } else { \ s = (src[2] << 16) | (src[1] << 8) | src[0]; \ d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \ - } \ - break; \ - case 4: \ - s = *(Uint32 *)src; \ - d = *(Uint32 *)dst; \ - break; \ - } \ - RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \ - RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \ - rd += (rs - rd) * alpha >> 8; \ - gd += (gs - gd) * alpha >> 8; \ - bd += (bs - bd) * alpha >> 8; \ - PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ - switch (bpp) { \ - case 2: \ - *(Uint16 *)dst = (Uint16)d; \ - break; \ - case 3: \ - if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ - dst[0] = (Uint8)(d >> 16); \ - dst[1] = (Uint8)(d >> 8); \ - dst[2] = (Uint8)(d); \ - } else { \ - dst[0] = (Uint8)d; \ - dst[1] = (Uint8)(d >> 8); \ - dst[2] = (Uint8)(d >> 16); \ - } \ - break; \ - case 4: \ - *(Uint32 *)dst = d; \ - break; \ - } \ - src += bpp; \ - dst += bpp; \ - } \ - } while(0) + } \ + break; \ + case 4: \ + s = *(Uint32 *)src; \ + d = *(Uint32 *)dst; \ + break; \ + } \ + RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \ + RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \ + rd += (rs - rd) * alpha >> 8; \ + gd += (gs - gd) * alpha >> 8; \ + bd += (bs - bd) * alpha >> 8; \ + PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \ + switch (bpp) { \ + case 2: \ + *(Uint16 *)dst = (Uint16)d; \ + break; \ + case 3: \ + if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { \ + dst[0] = (Uint8)(d >> 16); \ + dst[1] = (Uint8)(d >> 8); \ + dst[2] = (Uint8)(d); \ + } else { \ + dst[0] = (Uint8)d; \ + dst[1] = (Uint8)(d >> 8); \ + dst[2] = (Uint8)(d >> 16); \ + } \ + break; \ + case 4: \ + *(Uint32 *)dst = d; \ + break; \ + } \ + src += bpp; \ + dst += bpp; \ + } \ + } while (0) /* * Special case: 50% alpha (alpha=128) @@ -235,18 +235,17 @@ * First zero the lowest bit of each component, which gives us room to * add them. Then shift right and add the sum of the lowest bits. */ -#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha) \ - do { \ - int i; \ - Uint32 *src = (Uint32 *)(from); \ - Uint32 *dst = (Uint32 *)(to); \ - for(i = 0; i < (int)(length); i++) { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - *dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \ - + (s & d & 0x00010101); \ - } \ - } while(0) +#define ALPHA_BLIT32_888_50(to, from, length, bpp, alpha) \ + do { \ + int i; \ + Uint32 *src = (Uint32 *)(from); \ + Uint32 *dst = (Uint32 *)(to); \ + for (i = 0; i < (int)(length); i++) { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + *dst++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) + (s & d & 0x00010101); \ + } \ + } while (0) /* * For 16bpp, we can actually blend two pixels in parallel, if we take @@ -254,198 +253,198 @@ */ /* helper: blend a single 16 bit pixel at 50% */ -#define BLEND16_50(dst, src, mask) \ - do { \ - Uint32 s = *src++; \ - Uint32 d = *dst; \ - *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) + \ - (s & d & (~mask & 0xffff))); \ - } while(0) +#define BLEND16_50(dst, src, mask) \ + do { \ + Uint32 s = *src++; \ + Uint32 d = *dst; \ + *dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) + \ + (s & d & (~mask & 0xffff))); \ + } while (0) /* basic 16bpp blender. mask is the pixels to keep when adding. */ -#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask) \ - do { \ - unsigned n = (length); \ - Uint16 *src = (Uint16 *)(from); \ - Uint16 *dst = (Uint16 *)(to); \ - if (((uintptr_t)src ^ (uintptr_t)dst) & 3) { \ - /* source and destination not in phase, blit one by one */ \ - while (n--) \ - BLEND16_50(dst, src, mask); \ - } else { \ - if ((uintptr_t)src & 3) { \ - /* first odd pixel */ \ - BLEND16_50(dst, src, mask); \ - n--; \ - } \ - for (; n > 1; n -= 2) { \ - Uint32 s = *(Uint32 *)src; \ - Uint32 d = *(Uint32 *)dst; \ - *(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1) \ - + ((d & (mask | mask << 16)) >> 1) \ - + (s & d & (~(mask | mask << 16))); \ - src += 2; \ - dst += 2; \ - } \ - if (n) \ - BLEND16_50(dst, src, mask); /* last odd pixel */ \ - } \ - } while(0) - -#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha) \ +#define ALPHA_BLIT16_50(to, from, length, bpp, alpha, mask) \ + do { \ + unsigned n = (length); \ + Uint16 *src = (Uint16 *)(from); \ + Uint16 *dst = (Uint16 *)(to); \ + if (((uintptr_t)src ^ (uintptr_t)dst) & 3) { \ + /* source and destination not in phase, blit one by one */ \ + while (n--) \ + BLEND16_50(dst, src, mask); \ + } else { \ + if ((uintptr_t)src & 3) { \ + /* first odd pixel */ \ + BLEND16_50(dst, src, mask); \ + n--; \ + } \ + for (; n > 1; n -= 2) { \ + Uint32 s = *(Uint32 *)src; \ + Uint32 d = *(Uint32 *)dst; \ + *(Uint32 *)dst = ((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) + (s & d & (~(mask | mask << 16))); \ + src += 2; \ + dst += 2; \ + } \ + if (n) \ + BLEND16_50(dst, src, mask); /* last odd pixel */ \ + } \ + } while (0) + +#define ALPHA_BLIT16_565_50(to, from, length, bpp, alpha) \ ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xf7deU) -#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ +#define ALPHA_BLIT16_555_50(to, from, length, bpp, alpha) \ ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbdeU) -#define CHOOSE_BLIT(blitter, alpha, fmt) \ - do { \ - if (alpha == 255) { \ - switch (fmt->BytesPerPixel) { \ - case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \ - case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \ - case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \ - case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \ - } \ - } else { \ - switch (fmt->BytesPerPixel) { \ - case 1: \ - /* No 8bpp alpha blitting */ \ - break; \ - \ - case 2: \ - switch (fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ - case 0xffff: \ - if (fmt->Gmask == 0x07e0 \ - || fmt->Rmask == 0x07e0 \ - || fmt->Bmask == 0x07e0) { \ - if (alpha == 128) { \ - blitter(2, Uint8, ALPHA_BLIT16_565_50); \ - } else { \ - blitter(2, Uint8, ALPHA_BLIT16_565); \ - } \ - } else \ - goto general16; \ - break; \ - \ - case 0x7fff: \ - if (fmt->Gmask == 0x03e0 \ - || fmt->Rmask == 0x03e0 \ - || fmt->Bmask == 0x03e0) { \ - if (alpha == 128) { \ - blitter(2, Uint8, ALPHA_BLIT16_555_50); \ - } else { \ - blitter(2, Uint8, ALPHA_BLIT16_555); \ - } \ - break; \ - } else \ - goto general16; \ - break; \ - \ - default: \ - general16: \ - blitter(2, Uint8, ALPHA_BLIT_ANY); \ - } \ - break; \ - \ - case 3: \ - blitter(3, Uint8, ALPHA_BLIT_ANY); \ - break; \ - \ - case 4: \ - if ((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ - && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ - || fmt->Bmask == 0xff00)) { \ - if (alpha == 128) { \ - blitter(4, Uint16, ALPHA_BLIT32_888_50); \ - } else { \ - blitter(4, Uint16, ALPHA_BLIT32_888); \ - } \ - } else \ - blitter(4, Uint16, ALPHA_BLIT_ANY); \ - break; \ - } \ - } \ - } while(0) +#define CHOOSE_BLIT(blitter, alpha, fmt) \ + do { \ + if (alpha == 255) { \ + switch (fmt->BytesPerPixel) { \ + case 1: \ + blitter(1, Uint8, OPAQUE_BLIT); \ + break; \ + case 2: \ + blitter(2, Uint8, OPAQUE_BLIT); \ + break; \ + case 3: \ + blitter(3, Uint8, OPAQUE_BLIT); \ + break; \ + case 4: \ + blitter(4, Uint16, OPAQUE_BLIT); \ + break; \ + } \ + } else { \ + switch (fmt->BytesPerPixel) { \ + case 1: \ + /* No 8bpp alpha blitting */ \ + break; \ + \ + case 2: \ + switch (fmt->Rmask | fmt->Gmask | fmt->Bmask) { \ + case 0xffff: \ + if (fmt->Gmask == 0x07e0 || fmt->Rmask == 0x07e0 || fmt->Bmask == 0x07e0) { \ + if (alpha == 128) { \ + blitter(2, Uint8, ALPHA_BLIT16_565_50); \ + } else { \ + blitter(2, Uint8, ALPHA_BLIT16_565); \ + } \ + } else { \ + goto general16; \ + } \ + break; \ + \ + case 0x7fff: \ + if (fmt->Gmask == 0x03e0 || fmt->Rmask == 0x03e0 || fmt->Bmask == 0x03e0) { \ + if (alpha == 128) { \ + blitter(2, Uint8, ALPHA_BLIT16_555_50); \ + } else { \ + blitter(2, Uint8, ALPHA_BLIT16_555); \ + } \ + break; \ + } else { \ + goto general16; \ + } \ + break; \ + \ + default: \ + general16: \ + blitter(2, Uint8, ALPHA_BLIT_ANY); \ + } \ + break; \ + \ + case 3: \ + blitter(3, Uint8, ALPHA_BLIT_ANY); \ + break; \ + \ + case 4: \ + if ((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 || fmt->Bmask == 0xff00)) { \ + if (alpha == 128) { \ + blitter(4, Uint16, ALPHA_BLIT32_888_50); \ + } else { \ + blitter(4, Uint16, ALPHA_BLIT32_888); \ + } \ + } else { \ + blitter(4, Uint16, ALPHA_BLIT_ANY); \ + } \ + break; \ + } \ + } \ + } while (0) /* * Set a pixel value using the given format, except that the alpha value is * placed in the top byte. This is the format used for RLE with alpha. */ -#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - (a<<24); \ -} +#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ + { \ + Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ + ((g >> fmt->Gloss) << fmt->Gshift) | \ + ((b >> fmt->Bloss) << fmt->Bshift) | \ + (a << 24); \ + } /* * This takes care of the case when the surface is clipped on the left and/or * right. Top clipping has already been taken care of. */ -static void -RLEClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst, - Uint8 * dstbuf, SDL_Rect * srcrect, unsigned alpha) +#define RLECLIPBLIT(bpp, Type, do_blit) \ + do { \ + int linecount = srcrect->h; \ + int ofs = 0; \ + int left = srcrect->x; \ + int right = left + srcrect->w; \ + dstbuf -= left * bpp; \ + for (;;) { \ + int run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Type); \ + if (run) { \ + /* clip to left and right borders */ \ + if (ofs < right) { \ + int start = 0; \ + int len = run; \ + int startcol; \ + if (left - ofs > 0) { \ + start = left - ofs; \ + len -= start; \ + if (len <= 0) \ + goto nocopy##bpp##do_blit; \ + } \ + startcol = ofs + start; \ + if (len > right - startcol) \ + len = right - startcol; \ + do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \ + len, bpp, alpha); \ + } \ + nocopy##bpp##do_blit : srcbuf += run * bpp; \ + ofs += run; \ + } else if (!ofs) { \ + break; \ + } \ + \ + if (ofs == w) { \ + ofs = 0; \ + dstbuf += surf_dst->pitch; \ + if (!--linecount) { \ + break; \ + } \ + } \ + } \ + } while (0) + +static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *surf_dst, + Uint8 *dstbuf, SDL_Rect *srcrect, unsigned alpha) { SDL_PixelFormat *fmt = surf_dst->format; -#define RLECLIPBLIT(bpp, Type, do_blit) \ - do { \ - int linecount = srcrect->h; \ - int ofs = 0; \ - int left = srcrect->x; \ - int right = left + srcrect->w; \ - dstbuf -= left * bpp; \ - for (;;) { \ - int run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Type); \ - if (run) { \ - /* clip to left and right borders */ \ - if (ofs < right) { \ - int start = 0; \ - int len = run; \ - int startcol; \ - if (left - ofs > 0) { \ - start = left - ofs; \ - len -= start; \ - if (len <= 0) \ - goto nocopy ## bpp ## do_blit; \ - } \ - startcol = ofs + start; \ - if (len > right - startcol) \ - len = right - startcol; \ - do_blit(dstbuf + startcol * bpp, srcbuf + start * bpp, \ - len, bpp, alpha); \ - } \ - nocopy ## bpp ## do_blit: \ - srcbuf += run * bpp; \ - ofs += run; \ - } else if (!ofs) \ - break; \ - \ - if (ofs == w) { \ - ofs = 0; \ - dstbuf += surf_dst->pitch; \ - if (!--linecount) \ - break; \ - } \ - } \ - } while(0) - CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt); - -#undef RLECLIPBLIT - } +#undef RLECLIPBLIT /* blit a colorkeyed RLE surface */ -static int SDLCALL -SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, - SDL_Surface * surf_dst, SDL_Rect * dstrect) +static int SDLCALL SDL_RLEBlit(SDL_Surface *surf_src, SDL_Rect *srcrect, + SDL_Surface *surf_dst, SDL_Rect *dstrect) { Uint8 *dstbuf; Uint8 *srcbuf; @@ -456,16 +455,15 @@ SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, /* Lock the destination if necessary */ if (SDL_MUSTLOCK(surf_dst)) { if (SDL_LockSurface(surf_dst) < 0) { - return (-1); + return -1; } } /* Set up the source and destination pointers */ x = dstrect->x; y = dstrect->y; - dstbuf = (Uint8 *) surf_dst->pixels - + y * surf_dst->pitch + x * surf_src->format->BytesPerPixel; - srcbuf = (Uint8 *) surf_src->map->data; + dstbuf = (Uint8 *)surf_dst->pixels + y * surf_dst->pitch + x * surf_src->format->BytesPerPixel; + srcbuf = (Uint8 *)surf_src->map->data; { /* skip lines at the top if necessary */ @@ -474,22 +472,22 @@ SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, if (vskip) { #define RLESKIP(bpp, Type) \ - for(;;) { \ - int run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += sizeof(Type) * 2; \ - if(run) { \ + for (;;) { \ + int run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += sizeof(Type) * 2; \ + if (run) { \ srcbuf += run * bpp; \ - ofs += run; \ - } else if(!ofs) \ - goto done; \ - if(ofs == w) { \ - ofs = 0; \ - if(!--vskip) \ - break; \ - } \ - } + ofs += run; \ + } else if (!ofs) \ + goto done; \ + if (ofs == w) { \ + ofs = 0; \ + if (!--vskip) \ + break; \ + } \ + } switch (surf_src->format->BytesPerPixel) { case 1: @@ -507,7 +505,6 @@ SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, } #undef RLESKIP - } } @@ -518,41 +515,41 @@ SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, } else { SDL_PixelFormat *fmt = surf_src->format; -#define RLEBLIT(bpp, Type, do_blit) \ - do { \ - int linecount = srcrect->h; \ - int ofs = 0; \ - for(;;) { \ - unsigned run; \ - ofs += *(Type *)srcbuf; \ - run = ((Type *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Type); \ - if(run) { \ - do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ - srcbuf += run * bpp; \ - ofs += run; \ - } else if(!ofs) \ - break; \ - if(ofs == w) { \ - ofs = 0; \ - dstbuf += surf_dst->pitch; \ - if(!--linecount) \ - break; \ - } \ - } \ - } while(0) +#define RLEBLIT(bpp, Type, do_blit) \ + do { \ + int linecount = srcrect->h; \ + int ofs = 0; \ + for (;;) { \ + unsigned run; \ + ofs += *(Type *)srcbuf; \ + run = ((Type *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Type); \ + if (run) { \ + do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \ + srcbuf += run * bpp; \ + ofs += run; \ + } else if (!ofs) \ + break; \ + if (ofs == w) { \ + ofs = 0; \ + dstbuf += surf_dst->pitch; \ + if (!--linecount) \ + break; \ + } \ + } \ + } while (0) CHOOSE_BLIT(RLEBLIT, alpha, fmt); #undef RLEBLIT } - done: +done: /* Unlock the destination if necessary */ if (SDL_MUSTLOCK(surf_dst)) { SDL_UnlockSurface(surf_dst); } - return (0); + return 0; } #undef OPAQUE_BLIT @@ -566,47 +563,47 @@ SDL_RLEBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, * For 32bpp pixels, we have made sure the alpha is stored in the top * 8 bits, so proceed as usual */ -#define BLIT_TRANSL_888(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = s >> 24; \ - Uint32 s1 = s & 0xff00ff; \ - Uint32 d1 = d & 0xff00ff; \ - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ - s &= 0xff00; \ - d &= 0xff00; \ - d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ - dst = d1 | d | 0xff000000; \ - } while(0) +#define BLIT_TRANSL_888(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = s >> 24; \ + Uint32 s1 = s & 0xff00ff; \ + Uint32 d1 = d & 0xff00ff; \ + d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \ + s &= 0xff00; \ + d &= 0xff00; \ + d = (d + ((s - d) * alpha >> 8)) & 0xff00; \ + dst = d1 | d | 0xff000000; \ + } while (0) /* * For 16bpp pixels, we have stored the 5 most significant alpha bits in * bits 5-10. As before, we can process all 3 RGB components at the same time. */ -#define BLIT_TRANSL_565(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = (s & 0x3e0) >> 5; \ - s &= 0x07e0f81f; \ - d = (d | d << 16) & 0x07e0f81f; \ - d += (s - d) * alpha >> 5; \ - d &= 0x07e0f81f; \ - dst = (Uint16)(d | d >> 16); \ - } while(0) - -#define BLIT_TRANSL_555(src, dst) \ - do { \ - Uint32 s = src; \ - Uint32 d = dst; \ - unsigned alpha = (s & 0x3e0) >> 5; \ - s &= 0x03e07c1f; \ - d = (d | d << 16) & 0x03e07c1f; \ - d += (s - d) * alpha >> 5; \ - d &= 0x03e07c1f; \ - dst = (Uint16)(d | d >> 16); \ - } while(0) +#define BLIT_TRANSL_565(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = (s & 0x3e0) >> 5; \ + s &= 0x07e0f81f; \ + d = (d | d << 16) & 0x07e0f81f; \ + d += (s - d) * alpha >> 5; \ + d &= 0x07e0f81f; \ + dst = (Uint16)(d | d >> 16); \ + } while (0) + +#define BLIT_TRANSL_555(src, dst) \ + do { \ + Uint32 s = src; \ + Uint32 d = dst; \ + unsigned alpha = (s & 0x3e0) >> 5; \ + s &= 0x03e07c1f; \ + d = (d | d << 16) & 0x03e07c1f; \ + d += (s - d) * alpha >> 5; \ + d &= 0x03e07c1f; \ + dst = (Uint16)(d | d >> 16); \ + } while (0) /* used to save the destination format in the encoding. Designed to be macro-compatible with SDL_PixelFormat but without the unneeded fields */ @@ -629,9 +626,8 @@ typedef struct } RLEDestFormat; /* blit a pixel-alpha RLE surface clipped at the right and/or left edges */ -static void -RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst, - Uint8 * dstbuf, SDL_Rect * srcrect) +static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *surf_dst, + Uint8 *dstbuf, SDL_Rect *srcrect) { SDL_PixelFormat *df = surf_dst->format; /* @@ -639,80 +635,81 @@ RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst, * Ctype the translucent count type, and do_blend the macro * to blend one pixel. */ -#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend) \ - do { \ - int linecount = srcrect->h; \ - int left = srcrect->x; \ - int right = left + srcrect->w; \ - dstbuf -= left * sizeof(Ptype); \ - do { \ - int ofs = 0; \ - /* blit opaque pixels on one line */ \ - do { \ - unsigned run; \ - ofs += ((Ctype *)srcbuf)[0]; \ - run = ((Ctype *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Ctype); \ - if(run) { \ - /* clip to left and right borders */ \ - int cofs = ofs; \ - int crun = run; \ - if(left - cofs > 0) { \ - crun -= left - cofs; \ - cofs = left; \ - } \ - if(crun > right - cofs) \ - crun = right - cofs; \ - if(crun > 0) \ - PIXEL_COPY(dstbuf + cofs * sizeof(Ptype), \ - srcbuf + (cofs - ofs) * sizeof(Ptype), \ - (unsigned)crun, sizeof(Ptype)); \ - srcbuf += run * sizeof(Ptype); \ - ofs += run; \ - } else if(!ofs) \ - return; \ - } while(ofs < w); \ - /* skip padding if necessary */ \ - if(sizeof(Ptype) == 2) \ - srcbuf += (uintptr_t)srcbuf & 2; \ - /* blit translucent pixels on the same line */ \ - ofs = 0; \ - do { \ - unsigned run; \ - ofs += ((Uint16 *)srcbuf)[0]; \ - run = ((Uint16 *)srcbuf)[1]; \ - srcbuf += 4; \ - if(run) { \ - /* clip to left and right borders */ \ - int cofs = ofs; \ - int crun = run; \ - if(left - cofs > 0) { \ - crun -= left - cofs; \ - cofs = left; \ - } \ - if(crun > right - cofs) \ - crun = right - cofs; \ - if(crun > 0) { \ - Ptype *dst = (Ptype *)dstbuf + cofs; \ - Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs); \ - int i; \ - for(i = 0; i < crun; i++) \ - do_blend(src[i], dst[i]); \ - } \ - srcbuf += run * 4; \ - ofs += run; \ - } \ - } while(ofs < w); \ - dstbuf += surf_dst->pitch; \ - } while(--linecount); \ - } while(0) +#define RLEALPHACLIPBLIT(Ptype, Ctype, do_blend) \ + do { \ + int linecount = srcrect->h; \ + int left = srcrect->x; \ + int right = left + srcrect->w; \ + dstbuf -= left * sizeof(Ptype); \ + do { \ + int ofs = 0; \ + /* blit opaque pixels on one line */ \ + do { \ + unsigned run; \ + ofs += ((Ctype *)srcbuf)[0]; \ + run = ((Ctype *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Ctype); \ + if (run) { \ + /* clip to left and right borders */ \ + int cofs = ofs; \ + int crun = run; \ + if (left - cofs > 0) { \ + crun -= left - cofs; \ + cofs = left; \ + } \ + if (crun > right - cofs) \ + crun = right - cofs; \ + if (crun > 0) \ + PIXEL_COPY(dstbuf + cofs * sizeof(Ptype), \ + srcbuf + (cofs - ofs) * sizeof(Ptype), \ + (unsigned)crun, sizeof(Ptype)); \ + srcbuf += run * sizeof(Ptype); \ + ofs += run; \ + } else if (!ofs) \ + return; \ + } while (ofs < w); \ + /* skip padding if necessary */ \ + if (sizeof(Ptype) == 2) \ + srcbuf += (uintptr_t)srcbuf & 2; \ + /* blit translucent pixels on the same line */ \ + ofs = 0; \ + do { \ + unsigned run; \ + ofs += ((Uint16 *)srcbuf)[0]; \ + run = ((Uint16 *)srcbuf)[1]; \ + srcbuf += 4; \ + if (run) { \ + /* clip to left and right borders */ \ + int cofs = ofs; \ + int crun = run; \ + if (left - cofs > 0) { \ + crun -= left - cofs; \ + cofs = left; \ + } \ + if (crun > right - cofs) \ + crun = right - cofs; \ + if (crun > 0) { \ + Ptype *dst = (Ptype *)dstbuf + cofs; \ + Uint32 *src = (Uint32 *)srcbuf + (cofs - ofs); \ + int i; \ + for (i = 0; i < crun; i++) \ + do_blend(src[i], dst[i]); \ + } \ + srcbuf += run * 4; \ + ofs += run; \ + } \ + } while (ofs < w); \ + dstbuf += surf_dst->pitch; \ + } while (--linecount); \ + } while (0) switch (df->BytesPerPixel) { case 2: - if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) + if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565); - else + } else { RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555); + } break; case 4: RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888); @@ -721,9 +718,8 @@ RLEAlphaClipBlit(int w, Uint8 * srcbuf, SDL_Surface * surf_dst, } /* blit a pixel-alpha RLE surface */ -static int SDLCALL -SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, - SDL_Surface * surf_dst, SDL_Rect * dstrect) +static int SDLCALL SDL_RLEAlphaBlit(SDL_Surface *surf_src, SDL_Rect *srcrect, + SDL_Surface *surf_dst, SDL_Rect *dstrect) { int x, y; int w = surf_src->w; @@ -739,8 +735,8 @@ SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, x = dstrect->x; y = dstrect->y; - dstbuf = (Uint8 *) surf_dst->pixels + y * surf_dst->pitch + x * df->BytesPerPixel; - srcbuf = (Uint8 *) surf_src->map->data + sizeof(RLEDestFormat); + dstbuf = (Uint8 *)surf_dst->pixels + y * surf_dst->pitch + x * df->BytesPerPixel; + srcbuf = (Uint8 *)surf_src->map->data + sizeof(RLEDestFormat); { /* skip lines at the top if necessary */ @@ -760,38 +756,40 @@ SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, if (run) { srcbuf += 2 * run; ofs += run; - } else if (!ofs) + } else if (ofs == 0) { goto done; + } } while (ofs < w); /* skip padding */ - srcbuf += (uintptr_t) srcbuf & 2; + srcbuf += (uintptr_t)srcbuf & 2; /* skip translucent line */ ofs = 0; do { int run; - ofs += ((Uint16 *) srcbuf)[0]; - run = ((Uint16 *) srcbuf)[1]; + ofs += ((Uint16 *)srcbuf)[0]; + run = ((Uint16 *)srcbuf)[1]; srcbuf += 4 * (run + 1); ofs += run; } while (ofs < w); } while (--vskip); } else { /* the 32/32 interleaved format */ - vskip <<= 1; /* opaque and translucent have same format */ + vskip <<= 1; /* opaque and translucent have same format */ do { ofs = 0; do { int run; - ofs += ((Uint16 *) srcbuf)[0]; - run = ((Uint16 *) srcbuf)[1]; + ofs += ((Uint16 *)srcbuf)[0]; + run = ((Uint16 *)srcbuf)[1]; srcbuf += 4; if (run) { srcbuf += 4 * run; ofs += run; - } else if (!ofs) + } else if (ofs == 0) { goto done; + } } while (ofs < w); } while (--vskip); } @@ -808,58 +806,58 @@ SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, * Ctype the translucent count type, and do_blend the * macro to blend one pixel. */ -#define RLEALPHABLIT(Ptype, Ctype, do_blend) \ - do { \ - int linecount = srcrect->h; \ - do { \ - int ofs = 0; \ - /* blit opaque pixels on one line */ \ - do { \ - unsigned run; \ - ofs += ((Ctype *)srcbuf)[0]; \ - run = ((Ctype *)srcbuf)[1]; \ - srcbuf += 2 * sizeof(Ctype); \ - if(run) { \ - PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \ - run, sizeof(Ptype)); \ - srcbuf += run * sizeof(Ptype); \ - ofs += run; \ - } else if(!ofs) \ - goto done; \ - } while(ofs < w); \ - /* skip padding if necessary */ \ - if(sizeof(Ptype) == 2) \ - srcbuf += (uintptr_t)srcbuf & 2; \ - /* blit translucent pixels on the same line */ \ - ofs = 0; \ - do { \ - unsigned run; \ - ofs += ((Uint16 *)srcbuf)[0]; \ - run = ((Uint16 *)srcbuf)[1]; \ - srcbuf += 4; \ - if(run) { \ - Ptype *dst = (Ptype *)dstbuf + ofs; \ - unsigned i; \ - for(i = 0; i < run; i++) { \ - Uint32 src = *(Uint32 *)srcbuf; \ - do_blend(src, *dst); \ - srcbuf += 4; \ - dst++; \ - } \ - ofs += run; \ - } \ - } while(ofs < w); \ - dstbuf += surf_dst->pitch; \ - } while(--linecount); \ - } while(0) +#define RLEALPHABLIT(Ptype, Ctype, do_blend) \ + do { \ + int linecount = srcrect->h; \ + do { \ + int ofs = 0; \ + /* blit opaque pixels on one line */ \ + do { \ + unsigned run; \ + ofs += ((Ctype *)srcbuf)[0]; \ + run = ((Ctype *)srcbuf)[1]; \ + srcbuf += 2 * sizeof(Ctype); \ + if (run) { \ + PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \ + run, sizeof(Ptype)); \ + srcbuf += run * sizeof(Ptype); \ + ofs += run; \ + } else if (!ofs) \ + goto done; \ + } while (ofs < w); \ + /* skip padding if necessary */ \ + if (sizeof(Ptype) == 2) \ + srcbuf += (uintptr_t)srcbuf & 2; \ + /* blit translucent pixels on the same line */ \ + ofs = 0; \ + do { \ + unsigned run; \ + ofs += ((Uint16 *)srcbuf)[0]; \ + run = ((Uint16 *)srcbuf)[1]; \ + srcbuf += 4; \ + if (run) { \ + Ptype *dst = (Ptype *)dstbuf + ofs; \ + unsigned i; \ + for (i = 0; i < run; i++) { \ + Uint32 src = *(Uint32 *)srcbuf; \ + do_blend(src, *dst); \ + srcbuf += 4; \ + dst++; \ + } \ + ofs += run; \ + } \ + } while (ofs < w); \ + dstbuf += surf_dst->pitch; \ + } while (--linecount); \ + } while (0) switch (df->BytesPerPixel) { case 2: - if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 - || df->Bmask == 0x07e0) + if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565); - else + } else { RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555); + } break; case 4: RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888); @@ -867,7 +865,7 @@ SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, } } - done: +done: /* Unlock the destination if necessary */ if (SDL_MUSTLOCK(surf_dst)) { SDL_UnlockSurface(surf_dst); @@ -886,9 +884,8 @@ SDL_RLEAlphaBlit(SDL_Surface * surf_src, SDL_Rect * srcrect, */ /* encode 32bpp rgb + a into 16bpp rgb, losing alpha */ -static int -copy_opaque_16(void *dst, Uint32 * src, int n, - SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) +static int copy_opaque_16(void *dst, Uint32 *src, int n, + SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint16 *d = dst; @@ -903,9 +900,8 @@ copy_opaque_16(void *dst, Uint32 * src, int n, } /* decode opaque pixels from 16bpp to 32bpp rgb + a */ -static int -uncopy_opaque_16(Uint32 * dst, void *src, int n, - RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) +static int uncopy_opaque_16(Uint32 *dst, void *src, int n, + RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint16 *s = src; @@ -920,12 +916,9 @@ uncopy_opaque_16(Uint32 * dst, void *src, int n, return n * 2; } - - /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */ -static int -copy_transl_565(void *dst, Uint32 * src, int n, - SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) +static int copy_transl_565(void *dst, Uint32 *src, int n, + SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint32 *d = dst; @@ -942,9 +935,8 @@ copy_transl_565(void *dst, Uint32 * src, int n, } /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */ -static int -copy_transl_555(void *dst, Uint32 * src, int n, - SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) +static int copy_transl_555(void *dst, Uint32 *src, int n, + SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint32 *d = dst; @@ -961,9 +953,8 @@ copy_transl_555(void *dst, Uint32 * src, int n, } /* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */ -static int -uncopy_transl_16(Uint32 * dst, void *src, int n, - RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) +static int uncopy_transl_16(Uint32 *dst, void *src, int n, + RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint32 *s = src; @@ -980,9 +971,8 @@ uncopy_transl_16(Uint32 * dst, void *src, int n, } /* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ -static int -copy_32(void *dst, Uint32 * src, int n, - SDL_PixelFormat * sfmt, SDL_PixelFormat * dfmt) +static int copy_32(void *dst, Uint32 *src, int n, + SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint32 *d = dst; @@ -997,9 +987,8 @@ copy_32(void *dst, Uint32 * src, int n, } /* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ -static int -uncopy_32(Uint32 * dst, void *src, int n, - RLEDestFormat * sfmt, SDL_PixelFormat * dfmt) +static int uncopy_32(Uint32 *dst, void *src, int n, + RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) { int i; Uint32 *s = src; @@ -1014,14 +1003,13 @@ uncopy_32(Uint32 * dst, void *src, int n, return n * 4; } -#define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255) +#define ISOPAQUE(pixel, fmt) ((((pixel)&fmt->Amask) >> fmt->Ashift) == 255) -#define ISTRANSL(pixel, fmt) \ - ((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U) +#define ISTRANSL(pixel, fmt) \ + ((unsigned)((((pixel)&fmt->Amask) >> fmt->Ashift) - 1U) < 254U) /* convert surface to be quickly alpha-blittable onto dest, if possible */ -static int -RLEAlphaSurface(SDL_Surface * surface) +static int RLEAlphaSurface(SDL_Surface *surface) { SDL_Surface *dest; SDL_PixelFormat *df; @@ -1030,17 +1018,19 @@ RLEAlphaSurface(SDL_Surface * surface) int max_transl_run = 65535; unsigned masksum; Uint8 *rlebuf, *dst; - int (*copy_opaque) (void *, Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); - int (*copy_transl) (void *, Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); + int (*copy_opaque)(void *, Uint32 *, int, + SDL_PixelFormat *, SDL_PixelFormat *); + int (*copy_transl)(void *, Uint32 *, int, + SDL_PixelFormat *, SDL_PixelFormat *); dest = surface->map->dst; - if (!dest) + if (!dest) { return -1; + } df = dest->format; - if (surface->format->BitsPerPixel != 32) - return -1; /* only 32bpp source supported */ + if (surface->format->BitsPerPixel != 32) { + return -1; /* only 32bpp source supported */ + } /* find out whether the destination is one we support, and determine the max size of the encoded result */ @@ -1050,52 +1040,53 @@ RLEAlphaSurface(SDL_Surface * surface) /* 16bpp: only support 565 and 555 formats */ switch (masksum) { case 0xffff: - if (df->Gmask == 0x07e0 - || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { + if (df->Gmask == 0x07e0 || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) { copy_opaque = copy_opaque_16; copy_transl = copy_transl_565; - } else + } else { return -1; + } break; case 0x7fff: - if (df->Gmask == 0x03e0 - || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) { + if (df->Gmask == 0x03e0 || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) { copy_opaque = copy_opaque_16; copy_transl = copy_transl_555; - } else + } else { return -1; + } break; default: return -1; } - max_opaque_run = 255; /* runs stored as bytes */ + max_opaque_run = 255; /* runs stored as bytes */ /* worst case is alternating opaque and translucent pixels, with room for alignment padding between lines */ maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2; break; case 4: - if (masksum != 0x00ffffff) - return -1; /* requires unused high byte */ + if (masksum != 0x00ffffff) { + return -1; /* requires unused high byte */ + } copy_opaque = copy_32; copy_transl = copy_32; - max_opaque_run = 255; /* runs stored as short ints */ + max_opaque_run = 255; /* runs stored as short ints */ /* worst case is alternating opaque and translucent pixels */ maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4; break; default: - return -1; /* anything else unsupported right now */ + return -1; /* anything else unsupported right now */ } maxsize += sizeof(RLEDestFormat); - rlebuf = (Uint8 *) SDL_malloc(maxsize); + rlebuf = (Uint8 *)SDL_malloc(maxsize); if (!rlebuf) { return SDL_OutOfMemory(); } { /* save the destination format so we can undo the encoding later */ - RLEDestFormat *r = (RLEDestFormat *) rlebuf; + RLEDestFormat *r = (RLEDestFormat *)rlebuf; r->BytesPerPixel = df->BytesPerPixel; r->Rmask = df->Rmask; r->Gmask = df->Gmask; @@ -1117,23 +1108,23 @@ RLEAlphaSurface(SDL_Surface * surface) int x, y; int h = surface->h, w = surface->w; SDL_PixelFormat *sf = surface->format; - Uint32 *src = (Uint32 *) surface->pixels; - Uint8 *lastline = dst; /* end of last non-blank line */ + Uint32 *src = (Uint32 *)surface->pixels; + Uint8 *lastline = dst; /* end of last non-blank line */ /* opaque counts are 8 or 16 bits, depending on target depth */ -#define ADD_OPAQUE_COUNTS(n, m) \ - if(df->BytesPerPixel == 4) { \ - ((Uint16 *)dst)[0] = n; \ - ((Uint16 *)dst)[1] = m; \ - dst += 4; \ - } else { \ - dst[0] = n; \ - dst[1] = m; \ - dst += 2; \ +#define ADD_OPAQUE_COUNTS(n, m) \ + if (df->BytesPerPixel == 4) { \ + ((Uint16 *)dst)[0] = n; \ + ((Uint16 *)dst)[1] = m; \ + dst += 4; \ + } else { \ + dst[0] = n; \ + dst[1] = m; \ + dst += 2; \ } /* translucent counts are always 16 bit */ -#define ADD_TRANSL_COUNTS(n, m) \ +#define ADD_TRANSL_COUNTS(n, m) \ (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4) for (y = 0; y < h; y++) { @@ -1144,14 +1135,17 @@ RLEAlphaSurface(SDL_Surface * surface) do { int run, skip, len; skipstart = x; - while (x < w && !ISOPAQUE(src[x], sf)) + while (x < w && !ISOPAQUE(src[x], sf)) { x++; + } runstart = x; - while (x < w && ISOPAQUE(src[x], sf)) + while (x < w && ISOPAQUE(src[x], sf)) { x++; + } skip = runstart - skipstart; - if (skip == w) + if (skip == w) { blankline = 1; + } run = x - runstart; while (skip > max_opaque_run) { ADD_OPAQUE_COUNTS(max_opaque_run, 0); @@ -1172,18 +1166,20 @@ RLEAlphaSurface(SDL_Surface * surface) } while (x < w); /* Make sure the next output address is 32-bit aligned */ - dst += (uintptr_t) dst & 2; + dst += (uintptr_t)dst & 2; /* Next, encode all translucent pixels of the same scan line */ x = 0; do { int run, skip, len; skipstart = x; - while (x < w && !ISTRANSL(src[x], sf)) + while (x < w && !ISTRANSL(src[x], sf)) { x++; + } runstart = x; - while (x < w && ISTRANSL(src[x], sf)) + while (x < w && ISTRANSL(src[x], sf)) { x++; + } skip = runstart - skipstart; blankline &= (skip == w); run = x - runstart; @@ -1203,13 +1199,14 @@ RLEAlphaSurface(SDL_Surface * surface) runstart += len; run -= len; } - if (!blankline) + if (!blankline) { lastline = dst; + } } while (x < w); src += surface->pitch >> 2; } - dst = lastline; /* back up past trailing blank lines */ + dst = lastline; /* back up past trailing blank lines */ ADD_OPAQUE_COUNTS(0, 0); } @@ -1230,28 +1227,26 @@ RLEAlphaSurface(SDL_Surface * surface) /* reallocate the buffer to release unused memory */ { Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); - if (!p) + if (!p) { p = rlebuf; + } surface->map->data = p; } return 0; } -static Uint32 -getpix_8(const Uint8 * srcbuf) +static Uint32 getpix_8(const Uint8 *srcbuf) { return *srcbuf; } -static Uint32 -getpix_16(const Uint8 * srcbuf) +static Uint32 getpix_16(const Uint8 *srcbuf) { - return *(const Uint16 *) srcbuf; + return *(const Uint16 *)srcbuf; } -static Uint32 -getpix_24(const Uint8 * srcbuf) +static Uint32 getpix_24(const Uint8 *srcbuf) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16); @@ -1260,20 +1255,18 @@ getpix_24(const Uint8 * srcbuf) #endif } -static Uint32 -getpix_32(const Uint8 * srcbuf) +static Uint32 getpix_32(const Uint8 *srcbuf) { - return *(const Uint32 *) srcbuf; + return *(const Uint32 *)srcbuf; } -typedef Uint32(*getpix_func) (const Uint8 *); +typedef Uint32 (*getpix_func)(const Uint8 *); static const getpix_func getpixes[4] = { getpix_8, getpix_16, getpix_24, getpix_32 }; -static int -RLEColorkeySurface(SDL_Surface * surface) +static int RLEColorkeySurface(SDL_Surface *surface) { Uint8 *rlebuf, *dst; int maxn; @@ -1295,26 +1288,24 @@ RLEColorkeySurface(SDL_Surface * surface) case 2: case 3: /* worst case is solid runs, at most 255 pixels wide */ - maxsize = surface->h * (2 * (surface->w / 255 + 1) - + surface->w * bpp) + 2; + maxsize = surface->h * (2 * (surface->w / 255 + 1) + surface->w * bpp) + 2; break; case 4: /* worst case is solid runs, at most 65535 pixels wide */ - maxsize = surface->h * (4 * (surface->w / 65535 + 1) - + surface->w * 4) + 4; + maxsize = surface->h * (4 * (surface->w / 65535 + 1) + surface->w * 4) + 4; break; default: return -1; } - rlebuf = (Uint8 *) SDL_malloc(maxsize); - if (rlebuf == NULL) { + rlebuf = (Uint8 *)SDL_malloc(maxsize); + if (!rlebuf) { return SDL_OutOfMemory(); } /* Set up the conversion */ - srcbuf = (Uint8 *) surface->pixels; + srcbuf = (Uint8 *)surface->pixels; maxn = bpp == 4 ? 65535 : 255; dst = rlebuf; rgbmask = ~surface->format->Amask; @@ -1324,12 +1315,12 @@ RLEColorkeySurface(SDL_Surface * surface) w = surface->w; h = surface->h; -#define ADD_COUNTS(n, m) \ - if(bpp == 4) { \ - ((Uint16 *)dst)[0] = n; \ - ((Uint16 *)dst)[1] = m; \ +#define ADD_COUNTS(n, m) \ + if (bpp == 4) { \ + ((Uint16 *)dst)[0] = n; \ + ((Uint16 *)dst)[1] = m; \ dst += 4; \ - } else { \ + } else { \ dst[0] = n; \ dst[1] = m; \ dst += 2; \ @@ -1339,19 +1330,23 @@ RLEColorkeySurface(SDL_Surface * surface) int x = 0; int blankline = 0; do { - int run, skip, len; + int run, skip; + int len; int runstart; int skipstart = x; /* find run of transparent, then opaque pixels */ - while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey) + while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey) { x++; + } runstart = x; - while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey) + while (x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey) { x++; + } skip = runstart - skipstart; - if (skip == w) + if (skip == w) { blankline = 1; + } run = x - runstart; /* encode segment */ @@ -1361,25 +1356,26 @@ RLEColorkeySurface(SDL_Surface * surface) } len = SDL_min(run, maxn); ADD_COUNTS(skip, len); - SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); + SDL_memcpy(dst, srcbuf + runstart * bpp, (size_t)len * bpp); dst += len * bpp; run -= len; runstart += len; while (run) { len = SDL_min(run, maxn); ADD_COUNTS(0, len); - SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp); + SDL_memcpy(dst, srcbuf + runstart * bpp, (size_t)len * bpp); dst += len * bpp; runstart += len; run -= len; } - if (!blankline) + if (!blankline) { lastline = dst; + } } while (x < w); srcbuf += surface->pitch; } - dst = lastline; /* back up bast trailing blank lines */ + dst = lastline; /* back up bast trailing blank lines */ ADD_COUNTS(0, 0); #undef ADD_COUNTS @@ -1399,16 +1395,16 @@ RLEColorkeySurface(SDL_Surface * surface) { /* If SDL_realloc returns NULL, the original block is left intact */ Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf); - if (!p) + if (!p) { p = rlebuf; + } surface->map->data = p; } return 0; } -int -SDL_RLESurface(SDL_Surface * surface) +int SDL_RLESurface(SDL_Surface *surface) { int flags; @@ -1466,7 +1462,7 @@ SDL_RLESurface(SDL_Surface * surface) /* The surface is now accelerated */ surface->flags |= SDL_RLEACCEL; - return (0); + return 0; } /* @@ -1475,17 +1471,16 @@ SDL_RLESurface(SDL_Surface * surface) * completely transparent pixels will be lost, and color and alpha depth * may have been reduced (when encoding for 16bpp targets). */ -static SDL_bool -UnRLEAlpha(SDL_Surface * surface) +static SDL_bool UnRLEAlpha(SDL_Surface *surface) { Uint8 *srcbuf; Uint32 *dst; SDL_PixelFormat *sf = surface->format; RLEDestFormat *df = surface->map->data; - int (*uncopy_opaque) (Uint32 *, void *, int, - RLEDestFormat *, SDL_PixelFormat *); - int (*uncopy_transl) (Uint32 *, void *, int, - RLEDestFormat *, SDL_PixelFormat *); + int (*uncopy_opaque)(Uint32 *, void *, int, + RLEDestFormat *, SDL_PixelFormat *); + int (*uncopy_transl)(Uint32 *, void *, int, + RLEDestFormat *, SDL_PixelFormat *); int w = surface->w; int bpp = df->BytesPerPixel; @@ -1496,16 +1491,16 @@ UnRLEAlpha(SDL_Surface * surface) uncopy_opaque = uncopy_transl = uncopy_32; } - surface->pixels = SDL_SIMDAlloc(surface->h * surface->pitch); + surface->pixels = SDL_SIMDAlloc((size_t)surface->h * surface->pitch); if (!surface->pixels) { - return (SDL_FALSE); + return SDL_FALSE; } surface->flags |= SDL_SIMD_ALIGNED; /* fill background with transparent pixels */ - SDL_memset(surface->pixels, 0, surface->h * surface->pitch); + SDL_memset(surface->pixels, 0, (size_t)surface->h * surface->pitch); dst = surface->pixels; - srcbuf = (Uint8 *) (df + 1); + srcbuf = (Uint8 *)(df + 1); for (;;) { /* copy opaque pixels */ int ofs = 0; @@ -1516,8 +1511,8 @@ UnRLEAlpha(SDL_Surface * surface) run = srcbuf[1]; srcbuf += 2; } else { - ofs += ((Uint16 *) srcbuf)[0]; - run = ((Uint16 *) srcbuf)[1]; + ofs += ((Uint16 *)srcbuf)[0]; + run = ((Uint16 *)srcbuf)[1]; srcbuf += 4; } if (run) { @@ -1529,15 +1524,16 @@ UnRLEAlpha(SDL_Surface * surface) } while (ofs < w); /* skip padding if needed */ - if (bpp == 2) - srcbuf += (uintptr_t) srcbuf & 2; + if (bpp == 2) { + srcbuf += (uintptr_t)srcbuf & 2; + } /* copy translucent pixels */ ofs = 0; do { unsigned run; - ofs += ((Uint16 *) srcbuf)[0]; - run = ((Uint16 *) srcbuf)[1]; + ofs += ((Uint16 *)srcbuf)[0]; + run = ((Uint16 *)srcbuf)[1]; srcbuf += 4; if (run) { srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf); @@ -1548,11 +1544,10 @@ UnRLEAlpha(SDL_Surface * surface) } end_function: - return (SDL_TRUE); + return SDL_TRUE; } -void -SDL_UnRLESurface(SDL_Surface * surface, int recode) +void SDL_UnRLESurface(SDL_Surface *surface, int recode) { if (surface->flags & SDL_RLEACCEL) { surface->flags &= ~SDL_RLEACCEL; @@ -1562,7 +1557,7 @@ SDL_UnRLESurface(SDL_Surface * surface, int recode) SDL_Rect full; /* re-create the original surface */ - surface->pixels = SDL_SIMDAlloc(surface->h * surface->pitch); + surface->pixels = SDL_SIMDAlloc((size_t)surface->h * surface->pitch); if (!surface->pixels) { /* Oh crap... */ surface->flags |= SDL_RLEACCEL; diff --git a/src/video/SDL_RLEaccel_c.h b/src/video/SDL_RLEaccel_c.h index 6f0d95f91b452..88e4bf56d5ba6 100644 --- a/src/video/SDL_RLEaccel_c.h +++ b/src/video/SDL_RLEaccel_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,8 +26,8 @@ /* Useful functions and variables from SDL_RLEaccel.c */ -extern int SDL_RLESurface(SDL_Surface * surface); -extern void SDL_UnRLESurface(SDL_Surface * surface, int recode); +extern int SDL_RLESurface(SDL_Surface *surface); +extern void SDL_UnRLESurface(SDL_Surface *surface, int recode); #endif /* SDL_RLEaccel_c_h_ */ diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index fa6492f515f03..9575875811509 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,9 +30,8 @@ #include "SDL_pixels_c.h" /* The general purpose software blit routine */ -static int SDLCALL -SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect) +static int SDLCALL SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) { int okay; int src_locked; @@ -66,23 +65,23 @@ SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, SDL_BlitInfo *info = &src->map->info; /* Set up the blit information */ - info->src = (Uint8 *) src->pixels + - (Uint16) srcrect->y * src->pitch + - (Uint16) srcrect->x * info->src_fmt->BytesPerPixel; + info->src = (Uint8 *)src->pixels + + (Uint16)srcrect->y * src->pitch + + (Uint16)srcrect->x * info->src_fmt->BytesPerPixel; info->src_w = srcrect->w; info->src_h = srcrect->h; info->src_pitch = src->pitch; info->src_skip = info->src_pitch - info->src_w * info->src_fmt->BytesPerPixel; info->dst = - (Uint8 *) dst->pixels + (Uint16) dstrect->y * dst->pitch + - (Uint16) dstrect->x * info->dst_fmt->BytesPerPixel; + (Uint8 *)dst->pixels + (Uint16)dstrect->y * dst->pitch + + (Uint16)dstrect->x * info->dst_fmt->BytesPerPixel; info->dst_w = dstrect->w; info->dst_h = dstrect->h; info->dst_pitch = dst->pitch; info->dst_skip = info->dst_pitch - info->dst_w * info->dst_fmt->BytesPerPixel; - RunBlit = (SDL_BlitFunc) src->map->data; + RunBlit = (SDL_BlitFunc)src->map->data; /* Run the actual software blit */ RunBlit(info); @@ -96,7 +95,7 @@ SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, SDL_UnlockSurface(src); } /* Blit is done! */ - return (okay ? 0 : -1); + return okay ? 0 : -1; } #if SDL_HAVE_BLIT_AUTO @@ -104,8 +103,7 @@ SDL_SoftBlit(SDL_Surface * src, SDL_Rect * srcrect, #ifdef __MACOSX__ #include -static SDL_bool -SDL_UseAltivecPrefetch() +static SDL_bool SDL_UseAltivecPrefetch(void) { const char key[] = "hw.l3cachesize"; u_int64_t result = 0; @@ -118,17 +116,15 @@ SDL_UseAltivecPrefetch() } } #else -static SDL_bool -SDL_UseAltivecPrefetch() +static SDL_bool SDL_UseAltivecPrefetch(void) { /* Just guess G4 */ return SDL_TRUE; } #endif /* __MACOSX__ */ -static SDL_BlitFunc -SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, - SDL_BlitFuncEntry * entries) +static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, + SDL_BlitFuncEntry *entries) { int i, flagcheck = (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_COLORKEY | SDL_COPY_NEAREST)); static int features = 0x7fffffff; @@ -141,7 +137,7 @@ SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, /* Allow an override for testing .. */ if (override) { - SDL_sscanf(override, "%u", &features); + (void)SDL_sscanf(override, "%u", &features); } else { if (SDL_HasMMX()) { features |= SDL_CPU_MMX; @@ -192,8 +188,7 @@ SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, #endif /* SDL_HAVE_BLIT_AUTO */ /* Figure out which of many blit routines to set up on a surface */ -int -SDL_CalculateBlit(SDL_Surface * surface) +int SDL_CalculateBlit(SDL_Surface *surface) { SDL_BlitFunc blit = NULL; SDL_BlitMap *map = surface->map; @@ -235,13 +230,13 @@ SDL_CalculateBlit(SDL_Surface * surface) } #if SDL_HAVE_BLIT_0 else if (surface->format->BitsPerPixel < 8 && - SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { blit = SDL_CalculateBlit0(surface); } #endif #if SDL_HAVE_BLIT_1 else if (surface->format->BytesPerPixel == 1 && - SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { blit = SDL_CalculateBlit1(surface); } #endif @@ -256,7 +251,7 @@ SDL_CalculateBlit(SDL_Surface * surface) } #endif #if SDL_HAVE_BLIT_AUTO - if (blit == NULL) { + if (!blit) { Uint32 src_format = surface->format->format; Uint32 dst_format = dst->format->format; @@ -267,7 +262,7 @@ SDL_CalculateBlit(SDL_Surface * surface) #endif #ifndef TEST_SLOW_BLIT - if (blit == NULL) + if (!blit) #endif { Uint32 src_format = surface->format->format; @@ -283,7 +278,7 @@ SDL_CalculateBlit(SDL_Surface * surface) map->data = blit; /* Make sure we have a blit function */ - if (blit == NULL) { + if (!blit) { SDL_InvalidateMap(map); return SDL_SetError("Blit combination not supported"); } diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 2f99fa8d9ace2..563f00c628d1a 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,36 +28,36 @@ #include "SDL_surface.h" /* pixman ARM blitters are 32 bit only : */ -#if defined(__aarch64__)||defined(_M_ARM64) +#if defined(__aarch64__) || defined(_M_ARM64) #undef SDL_ARM_SIMD_BLITTERS #undef SDL_ARM_NEON_BLITTERS #endif /* Table to do pixel byte expansion */ -extern Uint8* SDL_expand_byte[9]; +extern Uint8 *SDL_expand_byte[9]; /* SDL blit copy flags */ -#define SDL_COPY_MODULATE_COLOR 0x00000001 -#define SDL_COPY_MODULATE_ALPHA 0x00000002 -#define SDL_COPY_BLEND 0x00000010 -#define SDL_COPY_ADD 0x00000020 -#define SDL_COPY_MOD 0x00000040 -#define SDL_COPY_MUL 0x00000080 -#define SDL_COPY_COLORKEY 0x00000100 -#define SDL_COPY_NEAREST 0x00000200 -#define SDL_COPY_RLE_DESIRED 0x00001000 -#define SDL_COPY_RLE_COLORKEY 0x00002000 -#define SDL_COPY_RLE_ALPHAKEY 0x00004000 -#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY) +#define SDL_COPY_MODULATE_COLOR 0x00000001 +#define SDL_COPY_MODULATE_ALPHA 0x00000002 +#define SDL_COPY_BLEND 0x00000010 +#define SDL_COPY_ADD 0x00000020 +#define SDL_COPY_MOD 0x00000040 +#define SDL_COPY_MUL 0x00000080 +#define SDL_COPY_COLORKEY 0x00000100 +#define SDL_COPY_NEAREST 0x00000200 +#define SDL_COPY_RLE_DESIRED 0x00001000 +#define SDL_COPY_RLE_COLORKEY 0x00002000 +#define SDL_COPY_RLE_ALPHAKEY 0x00004000 +#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY) /* SDL blit CPU flags */ -#define SDL_CPU_ANY 0x00000000 -#define SDL_CPU_MMX 0x00000001 -#define SDL_CPU_3DNOW 0x00000002 -#define SDL_CPU_SSE 0x00000004 -#define SDL_CPU_SSE2 0x00000008 -#define SDL_CPU_ALTIVEC_PREFETCH 0x00000010 -#define SDL_CPU_ALTIVEC_NOPREFETCH 0x00000020 +#define SDL_CPU_ANY 0x00000000 +#define SDL_CPU_MMX 0x00000001 +#define SDL_CPU_3DNOW 0x00000002 +#define SDL_CPU_SSE 0x00000004 +#define SDL_CPU_SSE2 0x00000008 +#define SDL_CPU_ALTIVEC_PREFETCH 0x00000010 +#define SDL_CPU_ALTIVEC_NOPREFETCH 0x00000020 typedef struct { @@ -77,8 +77,7 @@ typedef struct Uint8 r, g, b, a; } SDL_BlitInfo; -typedef void (*SDL_BlitFunc) (SDL_BlitInfo *info); - +typedef void (*SDL_BlitFunc)(SDL_BlitInfo *info); typedef struct { @@ -106,367 +105,365 @@ struct SDL_BlitMap }; /* Functions found in SDL_blit.c */ -extern int SDL_CalculateBlit(SDL_Surface * surface); +extern int SDL_CalculateBlit(SDL_Surface *surface); /* Functions found in SDL_blit_*.c */ -extern SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface * surface); -extern SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface * surface); -extern SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface * surface); -extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface * surface); +extern SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface); +extern SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface); +extern SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface); +extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* * Useful macros for blitting routines */ #if defined(__GNUC__) -#define DECLARE_ALIGNED(t,v,a) t __attribute__((aligned(a))) v +#define DECLARE_ALIGNED(t, v, a) t __attribute__((aligned(a))) v #elif defined(_MSC_VER) -#define DECLARE_ALIGNED(t,v,a) __declspec(align(a)) t v +#define DECLARE_ALIGNED(t, v, a) __declspec(align(a)) t v #else -#define DECLARE_ALIGNED(t,v,a) t v +#define DECLARE_ALIGNED(t, v, a) t v #endif /* Load pixel of the specified format from a buffer and get its R-G-B values */ -#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ -{ \ - r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \ -} -#define RGB_FROM_RGB565(Pixel, r, g, b) \ -{ \ - r = SDL_expand_byte[3][((Pixel&0xF800)>>11)]; \ - g = SDL_expand_byte[2][((Pixel&0x07E0)>>5)]; \ - b = SDL_expand_byte[3][(Pixel&0x001F)]; \ -} -#define RGB_FROM_RGB555(Pixel, r, g, b) \ -{ \ - r = SDL_expand_byte[3][((Pixel&0x7C00)>>10)]; \ - g = SDL_expand_byte[3][((Pixel&0x03E0)>>5)]; \ - b = SDL_expand_byte[3][(Pixel&0x001F)]; \ -} -#define RGB_FROM_RGB888(Pixel, r, g, b) \ -{ \ - r = ((Pixel&0xFF0000)>>16); \ - g = ((Pixel&0xFF00)>>8); \ - b = (Pixel&0xFF); \ -} -#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \ -do { \ - switch (bpp) { \ - case 1: \ - Pixel = *((Uint8 *)(buf)); \ - break; \ - \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - break; \ - \ - case 3: { \ - Uint8 *B = (Uint8 *)(buf); \ - if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ - } else { \ - Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ - } \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - break; \ - \ - default: \ - Pixel = 0; /* stop gcc complaints */ \ - break; \ - } \ -} while (0) - -#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \ -do { \ - switch (bpp) { \ - case 1: \ - Pixel = *((Uint8 *)(buf)); \ - RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ - break; \ - \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ - break; \ - \ - case 3: { \ - Pixel = 0; \ - if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - r = *((buf)+fmt->Rshift/8); \ - g = *((buf)+fmt->Gshift/8); \ - b = *((buf)+fmt->Bshift/8); \ - } else { \ - r = *((buf)+2-fmt->Rshift/8); \ - g = *((buf)+2-fmt->Gshift/8); \ - b = *((buf)+2-fmt->Bshift/8); \ - } \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ - break; \ - \ - default: \ - /* stop gcc complaints */ \ - Pixel = 0; \ - r = g = b = 0; \ - break; \ - } \ -} while (0) +#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ + { \ + r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + } +#define RGB_FROM_RGB565(Pixel, r, g, b) \ + { \ + r = SDL_expand_byte[3][((Pixel & 0xF800) >> 11)]; \ + g = SDL_expand_byte[2][((Pixel & 0x07E0) >> 5)]; \ + b = SDL_expand_byte[3][(Pixel & 0x001F)]; \ + } +#define RGB_FROM_RGB555(Pixel, r, g, b) \ + { \ + r = SDL_expand_byte[3][((Pixel & 0x7C00) >> 10)]; \ + g = SDL_expand_byte[3][((Pixel & 0x03E0) >> 5)]; \ + b = SDL_expand_byte[3][(Pixel & 0x001F)]; \ + } +#define RGB_FROM_RGB888(Pixel, r, g, b) \ + { \ + r = ((Pixel & 0xFF0000) >> 16); \ + g = ((Pixel & 0xFF00) >> 8); \ + b = (Pixel & 0xFF); \ + } +#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \ + do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + break; \ + \ + case 3: \ + { \ + Uint8 *B = (Uint8 *)(buf); \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \ + } else { \ + Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \ + } \ + } break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + break; \ + \ + default: \ + Pixel = 0; /* stop gcc complaints */ \ + break; \ + } \ + } while (0) + +#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \ + do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + case 3: \ + { \ + Pixel = 0; \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + r = *((buf) + fmt->Rshift / 8); \ + g = *((buf) + fmt->Gshift / 8); \ + b = *((buf) + fmt->Bshift / 8); \ + } else { \ + r = *((buf) + 2 - fmt->Rshift / 8); \ + g = *((buf) + 2 - fmt->Gshift / 8); \ + b = *((buf) + 2 - fmt->Bshift / 8); \ + } \ + } break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \ + break; \ + \ + default: \ + /* stop gcc complaints */ \ + Pixel = 0; \ + r = g = b = 0; \ + break; \ + } \ + } while (0) /* Assemble R-G-B values into a specified pixel format and store them */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - fmt->Amask; \ -} -#define RGB565_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \ -} -#define RGB555_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \ -} -#define RGB888_FROM_RGB(Pixel, r, g, b) \ -{ \ - Pixel = (r<<16)|(g<<8)|b; \ -} -#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (a<<24)|(r<<16)|(g<<8)|b; \ -} -#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (r<<24)|(g<<16)|(b<<8)|a; \ -} -#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (a<<24)|(b<<16)|(g<<8)|r; \ -} -#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - Pixel = (b<<24)|(g<<16)|(r<<8)|a; \ -} -#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a) \ -{ \ - r = r ? ((r << 2) | 0x3) : 0; \ - g = g ? ((g << 2) | 0x3) : 0; \ - b = b ? ((b << 2) | 0x3) : 0; \ - a = (a * 3) / 255; \ - Pixel = (a<<30)|(r<<20)|(g<<10)|b; \ -} -#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ -{ \ - switch (bpp) { \ - case 1: { \ - Uint8 _pixel; \ - \ - PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ - *((Uint8 *)(buf)) = _pixel; \ - } \ - break; \ - \ - case 2: { \ - Uint16 _pixel; \ - \ - PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ - *((Uint16 *)(buf)) = _pixel; \ - } \ - break; \ - \ - case 3: { \ - if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - *((buf)+fmt->Rshift/8) = r; \ - *((buf)+fmt->Gshift/8) = g; \ - *((buf)+fmt->Bshift/8) = b; \ - } else { \ - *((buf)+2-fmt->Rshift/8) = r; \ - *((buf)+2-fmt->Gshift/8) = g; \ - *((buf)+2-fmt->Bshift/8) = b; \ - } \ - } \ - break; \ - \ - case 4: { \ - Uint32 _pixel; \ - \ - PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ - *((Uint32 *)(buf)) = _pixel; \ - } \ - break; \ - } \ -} +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ + { \ + Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ + ((g >> fmt->Gloss) << fmt->Gshift) | \ + ((b >> fmt->Bloss) << fmt->Bshift) | \ + fmt->Amask; \ + } +#define RGB565_FROM_RGB(Pixel, r, g, b) \ + { \ + Pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3); \ + } +#define RGB555_FROM_RGB(Pixel, r, g, b) \ + { \ + Pixel = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); \ + } +#define RGB888_FROM_RGB(Pixel, r, g, b) \ + { \ + Pixel = (r << 16) | (g << 8) | b; \ + } +#define ARGB8888_FROM_RGBA(Pixel, r, g, b, a) \ + { \ + Pixel = (a << 24) | (r << 16) | (g << 8) | b; \ + } +#define RGBA8888_FROM_RGBA(Pixel, r, g, b, a) \ + { \ + Pixel = (r << 24) | (g << 16) | (b << 8) | a; \ + } +#define ABGR8888_FROM_RGBA(Pixel, r, g, b, a) \ + { \ + Pixel = (a << 24) | (b << 16) | (g << 8) | r; \ + } +#define BGRA8888_FROM_RGBA(Pixel, r, g, b, a) \ + { \ + Pixel = (b << 24) | (g << 16) | (r << 8) | a; \ + } +#define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a) \ + { \ + r = r ? ((r << 2) | 0x3) : 0; \ + g = g ? ((g << 2) | 0x3) : 0; \ + b = b ? ((b << 2) | 0x3) : 0; \ + a = (a * 3) / 255; \ + Pixel = (a << 30) | (r << 20) | (g << 10) | b; \ + } +#define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b) \ + { \ + switch (bpp) { \ + case 1: \ + { \ + Uint8 _pixel; \ + \ + PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ + *((Uint8 *)(buf)) = _pixel; \ + } break; \ + \ + case 2: \ + { \ + Uint16 _pixel; \ + \ + PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ + *((Uint16 *)(buf)) = _pixel; \ + } break; \ + \ + case 3: \ + { \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + *((buf) + fmt->Rshift / 8) = r; \ + *((buf) + fmt->Gshift / 8) = g; \ + *((buf) + fmt->Bshift / 8) = b; \ + } else { \ + *((buf) + 2 - fmt->Rshift / 8) = r; \ + *((buf) + 2 - fmt->Gshift / 8) = g; \ + *((buf) + 2 - fmt->Bshift / 8) = b; \ + } \ + } break; \ + \ + case 4: \ + { \ + Uint32 _pixel; \ + \ + PIXEL_FROM_RGB(_pixel, fmt, r, g, b); \ + *((Uint32 *)(buf)) = _pixel; \ + } break; \ + } \ + } /* FIXME: Should we rescale alpha into 0..255 here? */ -#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ -{ \ - r = SDL_expand_byte[fmt->Rloss][((Pixel&fmt->Rmask)>>fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel&fmt->Gmask)>>fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel&fmt->Bmask)>>fmt->Bshift)]; \ - a = SDL_expand_byte[fmt->Aloss][((Pixel&fmt->Amask)>>fmt->Ashift)]; \ -} -#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ -{ \ - r = (Pixel&fmt->Rmask)>>fmt->Rshift; \ - g = (Pixel&fmt->Gmask)>>fmt->Gshift; \ - b = (Pixel&fmt->Bmask)>>fmt->Bshift; \ - a = (Pixel&fmt->Amask)>>fmt->Ashift; \ -} -#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a) \ -{ \ - r = (Pixel>>24); \ - g = ((Pixel>>16)&0xFF); \ - b = ((Pixel>>8)&0xFF); \ - a = (Pixel&0xFF); \ -} -#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a) \ -{ \ - r = ((Pixel>>16)&0xFF); \ - g = ((Pixel>>8)&0xFF); \ - b = (Pixel&0xFF); \ - a = (Pixel>>24); \ -} -#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a) \ -{ \ - r = (Pixel&0xFF); \ - g = ((Pixel>>8)&0xFF); \ - b = ((Pixel>>16)&0xFF); \ - a = (Pixel>>24); \ -} -#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a) \ -{ \ - r = ((Pixel>>8)&0xFF); \ - g = ((Pixel>>16)&0xFF); \ - b = (Pixel>>24); \ - a = (Pixel&0xFF); \ -} -#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a) \ -{ \ - r = ((Pixel>>22)&0xFF); \ - g = ((Pixel>>12)&0xFF); \ - b = ((Pixel>>2)&0xFF); \ - a = SDL_expand_byte[6][(Pixel>>30)]; \ -} -#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ -do { \ - switch (bpp) { \ - case 1: \ - Pixel = *((Uint8 *)(buf)); \ - RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ - break; \ - \ - case 2: \ - Pixel = *((Uint16 *)(buf)); \ - RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ - break; \ - \ - case 3: { \ - Pixel = 0; \ - if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - r = *((buf)+fmt->Rshift/8); \ - g = *((buf)+fmt->Gshift/8); \ - b = *((buf)+fmt->Bshift/8); \ - } else { \ - r = *((buf)+2-fmt->Rshift/8); \ - g = *((buf)+2-fmt->Gshift/8); \ - b = *((buf)+2-fmt->Bshift/8); \ - } \ - a = 0xFF; \ - } \ - break; \ - \ - case 4: \ - Pixel = *((Uint32 *)(buf)); \ - RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ - break; \ - \ - default: \ - /* stop gcc complaints */ \ - Pixel = 0; \ - r = g = b = a = 0; \ - break; \ - } \ -} while (0) +#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ + { \ + r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + a = SDL_expand_byte[fmt->Aloss][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ + } +#define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ + { \ + r = (Pixel & fmt->Rmask) >> fmt->Rshift; \ + g = (Pixel & fmt->Gmask) >> fmt->Gshift; \ + b = (Pixel & fmt->Bmask) >> fmt->Bshift; \ + a = (Pixel & fmt->Amask) >> fmt->Ashift; \ + } +#define RGBA_FROM_RGBA8888(Pixel, r, g, b, a) \ + { \ + r = (Pixel >> 24); \ + g = ((Pixel >> 16) & 0xFF); \ + b = ((Pixel >> 8) & 0xFF); \ + a = (Pixel & 0xFF); \ + } +#define RGBA_FROM_ARGB8888(Pixel, r, g, b, a) \ + { \ + r = ((Pixel >> 16) & 0xFF); \ + g = ((Pixel >> 8) & 0xFF); \ + b = (Pixel & 0xFF); \ + a = (Pixel >> 24); \ + } +#define RGBA_FROM_ABGR8888(Pixel, r, g, b, a) \ + { \ + r = (Pixel & 0xFF); \ + g = ((Pixel >> 8) & 0xFF); \ + b = ((Pixel >> 16) & 0xFF); \ + a = (Pixel >> 24); \ + } +#define RGBA_FROM_BGRA8888(Pixel, r, g, b, a) \ + { \ + r = ((Pixel >> 8) & 0xFF); \ + g = ((Pixel >> 16) & 0xFF); \ + b = (Pixel >> 24); \ + a = (Pixel & 0xFF); \ + } +#define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a) \ + { \ + r = ((Pixel >> 22) & 0xFF); \ + g = ((Pixel >> 12) & 0xFF); \ + b = ((Pixel >> 2) & 0xFF); \ + a = SDL_expand_byte[6][(Pixel >> 30)]; \ + } +#define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ + do { \ + switch (bpp) { \ + case 1: \ + Pixel = *((Uint8 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + case 2: \ + Pixel = *((Uint16 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + case 3: \ + { \ + Pixel = 0; \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + r = *((buf) + fmt->Rshift / 8); \ + g = *((buf) + fmt->Gshift / 8); \ + b = *((buf) + fmt->Bshift / 8); \ + } else { \ + r = *((buf) + 2 - fmt->Rshift / 8); \ + g = *((buf) + 2 - fmt->Gshift / 8); \ + b = *((buf) + 2 - fmt->Bshift / 8); \ + } \ + a = 0xFF; \ + } break; \ + \ + case 4: \ + Pixel = *((Uint32 *)(buf)); \ + RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \ + break; \ + \ + default: \ + /* stop gcc complaints */ \ + Pixel = 0; \ + r = g = b = a = 0; \ + break; \ + } \ + } while (0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ -{ \ - Pixel = ((r>>fmt->Rloss)<Rshift)| \ - ((g>>fmt->Gloss)<Gshift)| \ - ((b>>fmt->Bloss)<Bshift)| \ - ((a>>fmt->Aloss)<Ashift); \ -} -#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ -{ \ - switch (bpp) { \ - case 1: { \ - Uint8 _pixel; \ - \ - PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ - *((Uint8 *)(buf)) = _pixel; \ - } \ - break; \ - \ - case 2: { \ - Uint16 _pixel; \ - \ - PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ - *((Uint16 *)(buf)) = _pixel; \ - } \ - break; \ - \ - case 3: { \ - if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ - *((buf)+fmt->Rshift/8) = r; \ - *((buf)+fmt->Gshift/8) = g; \ - *((buf)+fmt->Bshift/8) = b; \ - } else { \ - *((buf)+2-fmt->Rshift/8) = r; \ - *((buf)+2-fmt->Gshift/8) = g; \ - *((buf)+2-fmt->Bshift/8) = b; \ - } \ - } \ - break; \ - \ - case 4: { \ - Uint32 _pixel; \ - \ - PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ - *((Uint32 *)(buf)) = _pixel; \ - } \ - break; \ - } \ -} +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ + { \ + Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ + ((g >> fmt->Gloss) << fmt->Gshift) | \ + ((b >> fmt->Bloss) << fmt->Bshift) | \ + ((a >> fmt->Aloss) << fmt->Ashift); \ + } +#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ + { \ + switch (bpp) { \ + case 1: \ + { \ + Uint8 _pixel; \ + \ + PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ + *((Uint8 *)(buf)) = _pixel; \ + } break; \ + \ + case 2: \ + { \ + Uint16 _pixel; \ + \ + PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ + *((Uint16 *)(buf)) = _pixel; \ + } break; \ + \ + case 3: \ + { \ + if (SDL_BYTEORDER == SDL_LIL_ENDIAN) { \ + *((buf) + fmt->Rshift / 8) = r; \ + *((buf) + fmt->Gshift / 8) = g; \ + *((buf) + fmt->Bshift / 8) = b; \ + } else { \ + *((buf) + 2 - fmt->Rshift / 8) = r; \ + *((buf) + 2 - fmt->Gshift / 8) = g; \ + *((buf) + 2 - fmt->Bshift / 8) = b; \ + } \ + } break; \ + \ + case 4: \ + { \ + Uint32 _pixel; \ + \ + PIXEL_FROM_RGBA(_pixel, fmt, r, g, b, a); \ + *((Uint32 *)(buf)) = _pixel; \ + } break; \ + } \ + } /* Blend the RGB values of two pixels with an alpha value */ -#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ -do { \ - dR = (Uint8)((((int)(sR-dR)*(int)A)/255)+dR); \ - dG = (Uint8)((((int)(sG-dG)*(int)A)/255)+dG); \ - dB = (Uint8)((((int)(sB-dB)*(int)A)/255)+dB); \ -} while(0) - +#define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ + do { \ + dR = (Uint8)((((int)(sR - dR) * (int)A) / 255) + dR); \ + dG = (Uint8)((((int)(sG - dG) * (int)A) / 255) + dG); \ + dB = (Uint8)((((int)(sB - dB) * (int)A) / 255) + dB); \ + } while (0) /* Blend the RGBA values of two pixels */ -#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ -do { \ - dR = (Uint8)((((int)(sR-dR)*(int)sA)/255)+dR); \ - dG = (Uint8)((((int)(sG-dG)*(int)sA)/255)+dG); \ - dB = (Uint8)((((int)(sB-dB)*(int)sA)/255)+dB); \ - dA = (Uint8)((int)sA+dA-((int)sA*dA)/255); \ -} while(0) - +#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ + do { \ + dR = (Uint8)((((int)(sR - dR) * (int)sA) / 255) + dR); \ + dG = (Uint8)((((int)(sG - dG) * (int)sA) / 255) + dG); \ + dB = (Uint8)((((int)(sB - dB) * (int)sA) / 255) + dB); \ + dA = (Uint8)((int)sA + dA - ((int)sA * dA) / 255); \ + } while (0) /* This is a very useful loop for optimizing blitters */ #if defined(_MSC_VER) && (_MSC_VER == 1300) @@ -474,86 +471,143 @@ do { \ #else #define USE_DUFFS_LOOP #endif + +#define DUFFS_LOOP1(pixel_copy_increment, width) \ + { \ + int n; \ + for (n = width; n > 0; --n) { \ + pixel_copy_increment; \ + } \ + } + #ifdef USE_DUFFS_LOOP /* 8-times unrolled loop */ -#define DUFFS_LOOP8(pixel_copy_increment, width) \ -{ int n = (width+7)/8; \ - switch (width & 7) { \ - case 0: do { pixel_copy_increment; SDL_FALLTHROUGH; \ - case 7: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 6: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 5: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 4: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 3: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 2: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 1: pixel_copy_increment; \ - } while ( --n > 0 ); \ - } \ -} +#define DUFFS_LOOP8(pixel_copy_increment, width) \ + { \ + int n = (width + 7) / 8; \ + switch (width & 7) { \ + case 0: \ + do { \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 7: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 6: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 5: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 4: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 3: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 2: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 1: \ + pixel_copy_increment; \ + } while (--n > 0); \ + } \ + } /* 4-times unrolled loop */ -#define DUFFS_LOOP4(pixel_copy_increment, width) \ -{ int n = (width+3)/4; \ - switch (width & 3) { \ - case 0: do { pixel_copy_increment; SDL_FALLTHROUGH; \ - case 3: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 2: pixel_copy_increment; SDL_FALLTHROUGH; \ - case 1: pixel_copy_increment; \ - } while (--n > 0); \ - } \ -} - -/* Use the 8-times version of the loop by default */ -#define DUFFS_LOOP(pixel_copy_increment, width) \ +#define DUFFS_LOOP4(pixel_copy_increment, width) \ + { \ + int n = (width + 3) / 4; \ + switch (width & 3) { \ + case 0: \ + do { \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 3: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 2: \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 1: \ + pixel_copy_increment; \ + } while (--n > 0); \ + } \ + } + +/* 2-times unrolled loop */ +#define DUFFS_LOOP2(pixel_copy_increment, width) \ + { \ + int n = (width + 1) / 2; \ + switch (width & 1) { \ + case 0: \ + do { \ + pixel_copy_increment; \ + SDL_FALLTHROUGH; \ + case 1: \ + pixel_copy_increment; \ + } while (--n > 0); \ + } \ + } + +/* Use the 4-times version of the loop by default */ +#define DUFFS_LOOP(pixel_copy_increment, width) \ + DUFFS_LOOP4(pixel_copy_increment, width) +/* Use the 8-times version of the loop for simple routines */ +#define DUFFS_LOOP_TRIVIAL(pixel_copy_increment, width) \ DUFFS_LOOP8(pixel_copy_increment, width) /* Special version of Duff's device for even more optimization */ -#define DUFFS_LOOP_124(pixel_copy_increment1, \ - pixel_copy_increment2, \ - pixel_copy_increment4, width) \ -{ int n = width; \ - if (n & 1) { \ - pixel_copy_increment1; n -= 1; \ - } \ - if (n & 2) { \ - pixel_copy_increment2; n -= 2; \ - } \ - if (n & 4) { \ - pixel_copy_increment4; n -= 4; \ - } \ - if (n) { \ - n /= 8; \ - do { \ - pixel_copy_increment4; \ - pixel_copy_increment4; \ - } while (--n > 0); \ - } \ -} +#define DUFFS_LOOP_124(pixel_copy_increment1, \ + pixel_copy_increment2, \ + pixel_copy_increment4, width) \ + { \ + int n = width; \ + if (n & 1) { \ + pixel_copy_increment1; \ + n -= 1; \ + } \ + if (n & 2) { \ + pixel_copy_increment2; \ + n -= 2; \ + } \ + if (n & 4) { \ + pixel_copy_increment4; \ + n -= 4; \ + } \ + if (n) { \ + n /= 8; \ + do { \ + pixel_copy_increment4; \ + pixel_copy_increment4; \ + } while (--n > 0); \ + } \ + } #else /* Don't use Duff's device to unroll loops */ -#define DUFFS_LOOP(pixel_copy_increment, width) \ -{ int n; \ - for ( n=width; n > 0; --n ) { \ - pixel_copy_increment; \ - } \ -} -#define DUFFS_LOOP8(pixel_copy_increment, width) \ - DUFFS_LOOP(pixel_copy_increment, width) -#define DUFFS_LOOP4(pixel_copy_increment, width) \ - DUFFS_LOOP(pixel_copy_increment, width) -#define DUFFS_LOOP_124(pixel_copy_increment1, \ - pixel_copy_increment2, \ - pixel_copy_increment4, width) \ - DUFFS_LOOP(pixel_copy_increment1, width) +#define DUFFS_LOOP(pixel_copy_increment, width) \ + DUFFS_LOOP1(pixel_copy_increment, width) +#define DUFFS_LOOP_TRIVIAL(pixel_copy_increment, width) \ + DUFFS_LOOP1(pixel_copy_increment, width) +#define DUFFS_LOOP8(pixel_copy_increment, width) \ + DUFFS_LOOP1(pixel_copy_increment, width) +#define DUFFS_LOOP4(pixel_copy_increment, width) \ + DUFFS_LOOP1(pixel_copy_increment, width) +#define DUFFS_LOOP2(pixel_copy_increment, width) \ + DUFFS_LOOP1(pixel_copy_increment, width) +#define DUFFS_LOOP_124(pixel_copy_increment1, \ + pixel_copy_increment2, \ + pixel_copy_increment4, width) \ + DUFFS_LOOP1(pixel_copy_increment1, width) #endif /* USE_DUFFS_LOOP */ /* Prevent Visual C++ 6.0 from printing out stupid warnings */ #if defined(_MSC_VER) && (_MSC_VER >= 600) -#pragma warning(disable: 4550) +#pragma warning(disable : 4550) #endif #endif /* SDL_blit_h_ */ diff --git a/src/video/SDL_blit_0.c b/src/video/SDL_blit_0.c index 54882f8b1a5a9..4056200ceb738 100644 --- a/src/video/SDL_blit_0.c +++ b/src/video/SDL_blit_0.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,9 +27,11 @@ /* Functions to blit from bitmaps to other surfaces */ -static void -BlitBto1(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto1(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int c; int width, height; Uint8 *src, *map, *dst; @@ -43,48 +45,94 @@ BlitBto1(SDL_BlitInfo * info) dst = info->dst; dstskip = info->dst_skip; map = info->table; - srcskip += width - (width + 7) / 8; + + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; if (map) { - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + *dst = map[bit]; + } + dst++; + byte >>= srcbpp; } - bit = (byte & 0x80) >> 7; - if (1) { - *dst = map[bit]; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + *dst = map[bit]; + } + dst++; + byte <<= srcbpp; } - dst++; - byte <<= 1; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } else { - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + *dst = bit; + } + dst++; + byte >>= srcbpp; } - bit = (byte & 0x80) >> 7; - if (1) { - *dst = bit; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + *dst = bit; + } + dst++; + byte <<= srcbpp; } - dst++; - byte <<= 1; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } } -static void -BlitBto2(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto2(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int c; int width, height; Uint8 *src; @@ -96,32 +144,59 @@ BlitBto2(SDL_BlitInfo * info) height = info->dst_h; src = info->src; srcskip = info->src_skip; - dst = (Uint16 *) info->dst; + dst = (Uint16 *)info->dst; dstskip = info->dst_skip / 2; - map = (Uint16 *) info->table; - srcskip += width - (width + 7) / 8; - - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + map = (Uint16 *)info->table; + + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + *dst = map[bit]; + } + byte >>= srcbpp; + dst++; } - bit = (byte & 0x80) >> 7; - if (1) { - *dst = map[bit]; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + *dst = map[bit]; + } + byte <<= srcbpp; + dst++; } - byte <<= 1; - dst++; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static void -BlitBto3(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto3(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int c, o; int width, height; Uint8 *src, *map, *dst; @@ -135,32 +210,62 @@ BlitBto3(SDL_BlitInfo * info) dst = info->dst; dstskip = info->dst_skip; map = info->table; - srcskip += width - (width + 7) / 8; - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + o = bit * 4; + dst[0] = map[o++]; + dst[1] = map[o++]; + dst[2] = map[o++]; + } + byte >>= srcbpp; + dst += 3; } - bit = (byte & 0x80) >> 7; - if (1) { - o = bit * 4; - dst[0] = map[o++]; - dst[1] = map[o++]; - dst[2] = map[o++]; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + o = bit * 4; + dst[0] = map[o++]; + dst[1] = map[o++]; + dst[2] = map[o++]; + } + byte <<= srcbpp; + dst += 3; } - byte <<= 1; - dst += 3; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static void -BlitBto4(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto4(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int width, height; Uint8 *src; Uint32 *map, *dst; @@ -172,32 +277,59 @@ BlitBto4(SDL_BlitInfo * info) height = info->dst_h; src = info->src; srcskip = info->src_skip; - dst = (Uint32 *) info->dst; + dst = (Uint32 *)info->dst; dstskip = info->dst_skip / 4; - map = (Uint32 *) info->table; - srcskip += width - (width + 7) / 8; - - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + map = (Uint32 *)info->table; + + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + *dst = map[bit]; + } + byte >>= srcbpp; + dst++; } - bit = (byte & 0x80) >> 7; - if (1) { - *dst = map[bit]; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + *dst = map[bit]; + } + byte <<= srcbpp; + dst++; } - byte <<= 1; - dst++; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static void -BlitBto1Key(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto1Key(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; @@ -209,52 +341,97 @@ BlitBto1Key(SDL_BlitInfo * info) int c; /* Set up some basic variables */ - srcskip += width - (width + 7) / 8; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; if (palmap) { - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + *dst = palmap[bit]; + } + dst++; + byte >>= srcbpp; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - *dst = palmap[bit]; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + *dst = palmap[bit]; + } + dst++; + byte <<= srcbpp; } - dst++; - byte <<= 1; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } else { - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + *dst = bit; + } + dst++; + byte >>= srcbpp; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - *dst = bit; + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + *dst = bit; + } + dst++; + byte <<= srcbpp; } - dst++; - byte <<= 1; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } } -static void -BlitBto2Key(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto2Key(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int srcskip = info->src_skip; int dstskip = info->dst_skip; Uint32 ckey = info->colorkey; @@ -262,30 +439,56 @@ BlitBto2Key(SDL_BlitInfo * info) int c; /* Set up some basic variables */ - srcskip += width - (width + 7) / 8; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; dstskip /= 2; - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + *dstp = ((Uint16 *)palmap)[bit]; + } + byte >>= srcbpp; + dstp++; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - *dstp = ((Uint16 *) palmap)[bit]; + src += srcskip; + dstp += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + *dstp = ((Uint16 *)palmap)[bit]; + } + byte <<= srcbpp; + dstp++; } - byte <<= 1; - dstp++; + src += srcskip; + dstp += dstskip; } - src += srcskip; - dstp += dstskip; } } -static void -BlitBto3Key(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto3Key(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; @@ -297,33 +500,59 @@ BlitBto3Key(SDL_BlitInfo * info) int c; /* Set up some basic variables */ - srcskip += width - (width + 7) / 8; - - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + SDL_memcpy(dst, &palmap[bit * 4], 3); + } + byte >>= srcbpp; + dst += 3; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - SDL_memcpy(dst, &palmap[bit * 4], 3); + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + SDL_memcpy(dst, &palmap[bit * 4], 3); + } + byte <<= srcbpp; + dst += 3; } - byte <<= 1; - dst += 3; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static void -BlitBto4Key(SDL_BlitInfo * info) +SDL_FORCE_INLINE void BlitBto4Key(SDL_BlitInfo *info, const Uint32 srcbpp) { + const Uint32 mask = (1 << srcbpp) - 1; + const Uint32 align = (8 / srcbpp) - 1; + int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int srcskip = info->src_skip; int dstskip = info->dst_skip; Uint32 ckey = info->colorkey; @@ -331,29 +560,52 @@ BlitBto4Key(SDL_BlitInfo * info) int c; /* Set up some basic variables */ - srcskip += width - (width + 7) / 8; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; dstskip /= 4; - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + *dstp = ((Uint32 *)palmap)[bit]; + } + byte >>= srcbpp; + dstp++; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - *dstp = ((Uint32 *) palmap)[bit]; + src += srcskip; + dstp += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + *dstp = ((Uint32 *)palmap)[bit]; + } + byte <<= srcbpp; + dstp++; } - byte <<= 1; - dstp++; + src += srcskip; + dstp += dstskip; } - src += srcskip; - dstp += dstskip; } } -static void -BlitBtoNAlpha(SDL_BlitInfo * info) +static void BlitBtoNAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -362,43 +614,75 @@ BlitBtoNAlpha(SDL_BlitInfo * info) int srcskip = info->src_skip; int dstskip = info->dst_skip; const SDL_Color *srcpal = info->src_fmt->palette->colors; + SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; - int dstbpp; + int srcbpp, dstbpp; int c; - Uint32 pixel; + Uint32 pixel, mask, align; unsigned sR, sG, sB; unsigned dR, dG, dB, dA; const unsigned A = info->a; /* Set up some basic variables */ + srcbpp = srcfmt->BytesPerPixel; dstbpp = dstfmt->BytesPerPixel; - srcskip += width - (width + 7) / 8; - - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + mask = (1 << srcbpp) - 1; + align = (8 / srcbpp) - 1; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (1) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte >>= srcbpp; + dst += dstbpp; } - bit = (byte & 0x80) >> 7; - if (1) { - sR = srcpal[bit].r; - sG = srcpal[bit].g; - sB = srcpal[bit].b; - DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); - ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (1) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte <<= srcbpp; + dst += dstbpp; } - byte <<= 1; - dst += dstbpp; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static void -BlitBtoNAlphaKey(SDL_BlitInfo * info) +static void BlitBtoNAlphaKey(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -409,160 +693,263 @@ BlitBtoNAlphaKey(SDL_BlitInfo * info) SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; const SDL_Color *srcpal = srcfmt->palette->colors; - int dstbpp; + int srcbpp, dstbpp; int c; - Uint32 pixel; + Uint32 pixel, mask, align; unsigned sR, sG, sB; unsigned dR, dG, dB, dA; const unsigned A = info->a; Uint32 ckey = info->colorkey; /* Set up some basic variables */ + srcbpp = srcfmt->BytesPerPixel; dstbpp = dstfmt->BytesPerPixel; - srcskip += width - (width + 7) / 8; - - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 7) == 0) { - byte = *src++; + if (srcbpp == 4) + srcskip += width - (width + 1) / 2; + else if (srcbpp == 2) + srcskip += width - (width + 3) / 4; + else if (srcbpp == 1) + srcskip += width - (width + 7) / 8; + mask = (1 << srcbpp) - 1; + align = (8 / srcbpp) - 1; + + if (SDL_PIXELORDER(info->src_fmt->format) == SDL_BITMAPORDER_4321) { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte & mask); + if (bit != ckey) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte >>= srcbpp; + dst += dstbpp; } - bit = (byte & 0x80) >> 7; - if (bit != ckey) { - sR = srcpal[bit].r; - sG = srcpal[bit].g; - sB = srcpal[bit].b; - DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); - ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + src += srcskip; + dst += dstskip; + } + } else { + while (height--) { + Uint8 byte = 0, bit; + for (c = 0; c < width; ++c) { + if (!(c & align)) { + byte = *src++; + } + bit = (byte >> (8 - srcbpp)) & mask; + if (bit != ckey) { + sR = srcpal[bit].r; + sG = srcpal[bit].g; + sB = srcpal[bit].b; + DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + byte <<= srcbpp; + dst += dstbpp; } - byte <<= 1; - dst += dstbpp; + src += srcskip; + dst += dstskip; } - src += srcskip; - dst += dstskip; } } -static const SDL_BlitFunc bitmap_blit[] = { - (SDL_BlitFunc) NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4 + + +static void Blit1bto1(SDL_BlitInfo *info) { + BlitBto1(info, 1); +} + +static void Blit1bto2(SDL_BlitInfo *info) { + BlitBto2(info, 1); +} + +static void Blit1bto3(SDL_BlitInfo *info) { + BlitBto3(info, 1); +} + +static void Blit1bto4(SDL_BlitInfo *info) { + BlitBto4(info, 1); +} + +static const SDL_BlitFunc bitmap_blit_1b[] = { + (SDL_BlitFunc)NULL, Blit1bto1, Blit1bto2, Blit1bto3, Blit1bto4 }; -static const SDL_BlitFunc colorkey_blit[] = { - (SDL_BlitFunc) NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key +static void Blit1bto1Key(SDL_BlitInfo *info) { + BlitBto1Key(info, 1); +} + +static void Blit1bto2Key(SDL_BlitInfo *info) { + BlitBto2Key(info, 1); +} + +static void Blit1bto3Key(SDL_BlitInfo *info) { + BlitBto3Key(info, 1); +} + +static void Blit1bto4Key(SDL_BlitInfo *info) { + BlitBto4Key(info, 1); +} + +static const SDL_BlitFunc colorkey_blit_1b[] = { + (SDL_BlitFunc)NULL, Blit1bto1Key, Blit1bto2Key, Blit1bto3Key, Blit1bto4Key }; -static void -Blit4bto4(SDL_BlitInfo * info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint8 *src = info->src; - Uint32 *dst = (Uint32 *) info->dst; - int srcskip = info->src_skip; - int dstskip = info->dst_skip; - Uint32 *map = (Uint32 *) info->table; - int c; - /* Set up some basic variables */ - srcskip += width - (width + 1) / 2; +static void Blit2bto1(SDL_BlitInfo *info) { + BlitBto1(info, 2); +} - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 0x1) == 0) { - byte = *src++; - } - bit = (byte & 0xF0) >> 4; - if (1) { - *dst = map[bit]; - } - byte <<= 4; - dst++; - } - src += srcskip; - dst = (Uint32 *) ((Uint8 *) dst + dstskip); - } +static void Blit2bto2(SDL_BlitInfo *info) { + BlitBto2(info, 2); } -static void -Blit4bto4Key(SDL_BlitInfo * info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint8 *src = info->src; - Uint32 *dst = (Uint32 *) info->dst; - int srcskip = info->src_skip; - int dstskip = info->dst_skip; - Uint32 ckey = info->colorkey; - Uint32 *map = (Uint32 *) info->table; - int c; +static void Blit2bto3(SDL_BlitInfo *info) { + BlitBto3(info, 2); +} - /* Set up some basic variables */ - srcskip += width - (width + 1) / 2; +static void Blit2bto4(SDL_BlitInfo *info) { + BlitBto4(info, 2); +} - while (height--) { - Uint8 byte = 0, bit; - for (c = 0; c < width; ++c) { - if ((c & 0x1) == 0) { - byte = *src++; - } - bit = (byte & 0xF0) >> 4; - if (bit != ckey) { - *dst = map[bit]; - } - byte <<= 4; - dst++; - } - src += srcskip; - dst = (Uint32 *) ((Uint8 *) dst + dstskip); - } +static const SDL_BlitFunc bitmap_blit_2b[] = { + (SDL_BlitFunc)NULL, Blit2bto1, Blit2bto2, Blit2bto3, Blit2bto4 +}; + +static void Blit2bto1Key(SDL_BlitInfo *info) { + BlitBto1Key(info, 2); +} + +static void Blit2bto2Key(SDL_BlitInfo *info) { + BlitBto2Key(info, 2); +} + +static void Blit2bto3Key(SDL_BlitInfo *info) { + BlitBto3Key(info, 2); +} + +static void Blit2bto4Key(SDL_BlitInfo *info) { + BlitBto4Key(info, 2); +} + +static const SDL_BlitFunc colorkey_blit_2b[] = { + (SDL_BlitFunc)NULL, Blit2bto1Key, Blit2bto2Key, Blit2bto3Key, Blit2bto4Key +}; + + + +static void Blit4bto1(SDL_BlitInfo *info) { + BlitBto1(info, 4); +} + +static void Blit4bto2(SDL_BlitInfo *info) { + BlitBto2(info, 4); +} + +static void Blit4bto3(SDL_BlitInfo *info) { + BlitBto3(info, 4); +} + +static void Blit4bto4(SDL_BlitInfo *info) { + BlitBto4(info, 4); +} + +static const SDL_BlitFunc bitmap_blit_4b[] = { + (SDL_BlitFunc)NULL, Blit4bto1, Blit4bto2, Blit4bto3, Blit4bto4 +}; + +static void Blit4bto1Key(SDL_BlitInfo *info) { + BlitBto1Key(info, 4); +} + +static void Blit4bto2Key(SDL_BlitInfo *info) { + BlitBto2Key(info, 4); +} + +static void Blit4bto3Key(SDL_BlitInfo *info) { + BlitBto3Key(info, 4); +} + +static void Blit4bto4Key(SDL_BlitInfo *info) { + BlitBto4Key(info, 4); } -SDL_BlitFunc -SDL_CalculateBlit0(SDL_Surface * surface) +static const SDL_BlitFunc colorkey_blit_4b[] = { + (SDL_BlitFunc)NULL, Blit4bto1Key, Blit4bto2Key, Blit4bto3Key, Blit4bto4Key +}; + + + +SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface) { int which; - /* 4bits to 32bits */ - if (surface->format->BitsPerPixel == 4) { - if (surface->map->dst->format->BytesPerPixel == 4) { - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { - case 0: - return Blit4bto4; + if (surface->map->dst->format->BitsPerPixel < 8) { + which = 0; + } else { + which = surface->map->dst->format->BytesPerPixel; + } + + if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX1) { + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + return bitmap_blit_1b[which]; - case SDL_COPY_COLORKEY: - return Blit4bto4Key; - } + case SDL_COPY_COLORKEY: + return colorkey_blit_1b[which]; + + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc)NULL; + + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc)NULL; } - /* We don't fully support 4-bit packed pixel modes */ return NULL; } - if (surface->format->BitsPerPixel != 1) { - /* We don't support sub 8-bit packed pixel modes */ - return (SDL_BlitFunc) NULL; - } - if (surface->map->dst->format->BitsPerPixel < 8) { - which = 0; - } else { - which = surface->map->dst->format->BytesPerPixel; + if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX2) { + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + return bitmap_blit_2b[which]; + + case SDL_COPY_COLORKEY: + return colorkey_blit_2b[which]; + + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc)NULL; + + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc)NULL; + } + return NULL; } - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { - case 0: - return bitmap_blit[which]; - case SDL_COPY_COLORKEY: - return colorkey_blit[which]; + if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX4) { + switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + case 0: + return bitmap_blit_4b[which]; + + case SDL_COPY_COLORKEY: + return colorkey_blit_4b[which]; - case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: - return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc) NULL; + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc)NULL; - case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: - return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc) NULL; + case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: + return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc)NULL; + } + return NULL; } - return (SDL_BlitFunc) NULL; + + return NULL; } #endif /* SDL_HAVE_BLIT_0 */ diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c index 2c353fd27a337..6e59b5030ac17 100644 --- a/src/video/SDL_blit_1.c +++ b/src/video/SDL_blit_1.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,7 @@ /* Functions to blit from 8-bit surfaces to other surfaces */ -static void -Blit1to1(SDL_BlitInfo * info) +static void Blit1to1(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -51,7 +50,7 @@ Blit1to1(SDL_BlitInfo * info) while (height--) { #ifdef USE_DUFFS_LOOP /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { *dst = map[*src]; } @@ -73,16 +72,15 @@ Blit1to1(SDL_BlitInfo * info) /* This is now endian dependent */ #ifndef USE_DUFFS_LOOP -# if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) -# define HI 1 -# define LO 0 -# else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */ -# define HI 0 -# define LO 1 -# endif +#if (SDL_BYTEORDER == SDL_LIL_ENDIAN) +#define HI 1 +#define LO 0 +#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */ +#define HI 0 +#define LO 1 +#endif #endif -static void -Blit1to2(SDL_BlitInfo * info) +static void Blit1to2(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -99,12 +97,12 @@ Blit1to2(SDL_BlitInfo * info) srcskip = info->src_skip; dst = info->dst; dstskip = info->dst_skip; - map = (Uint16 *) info->table; + map = (Uint16 *)info->table; #ifdef USE_DUFFS_LOOP while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { *(Uint16 *)dst = map[*src++]; dst += 2; @@ -116,7 +114,7 @@ Blit1to2(SDL_BlitInfo * info) } #else /* Memory align at 4-byte boundary, if necessary */ - if ((long) dst & 0x03) { + if ((long)dst & 0x03) { /* Don't do anything if width is 0 */ if (width == 0) { return; @@ -125,30 +123,31 @@ Blit1to2(SDL_BlitInfo * info) while (height--) { /* Perform copy alignment */ - *(Uint16 *) dst = map[*src++]; + *(Uint16 *)dst = map[*src++]; dst += 2; /* Copy in 4 pixel chunks */ for (c = width / 4; c; --c) { - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; } /* Get any leftovers */ switch (width & 3) { case 3: - *(Uint16 *) dst = map[*src++]; + *(Uint16 *)dst = map[*src++]; dst += 2; + SDL_FALLTHROUGH; case 2: - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; break; case 1: - *(Uint16 *) dst = map[*src++]; + *(Uint16 *)dst = map[*src++]; dst += 2; break; } @@ -159,25 +158,26 @@ Blit1to2(SDL_BlitInfo * info) while (height--) { /* Copy in 4 pixel chunks */ for (c = width / 4; c; --c) { - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; } /* Get any leftovers */ switch (width & 3) { case 3: - *(Uint16 *) dst = map[*src++]; + *(Uint16 *)dst = map[*src++]; dst += 2; + SDL_FALLTHROUGH; case 2: - *(Uint32 *) dst = (map[src[HI]] << 16) | (map[src[LO]]); + *(Uint32 *)dst = (map[src[HI]] << 16) | (map[src[LO]]); src += 2; dst += 4; break; case 1: - *(Uint16 *) dst = map[*src++]; + *(Uint16 *)dst = map[*src++]; dst += 2; break; } @@ -188,8 +188,7 @@ Blit1to2(SDL_BlitInfo * info) #endif /* USE_DUFFS_LOOP */ } -static void -Blit1to3(SDL_BlitInfo * info) +static void Blit1to3(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -237,8 +236,7 @@ Blit1to3(SDL_BlitInfo * info) } } -static void -Blit1to4(SDL_BlitInfo * info) +static void Blit1to4(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -253,14 +251,14 @@ Blit1to4(SDL_BlitInfo * info) height = info->dst_h; src = info->src; srcskip = info->src_skip; - dst = (Uint32 *) info->dst; + dst = (Uint32 *)info->dst; dstskip = info->dst_skip / 4; - map = (Uint32 *) info->table; + map = (Uint32 *)info->table; while (height--) { #ifdef USE_DUFFS_LOOP /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( *dst++ = map[*src++]; , width); /* *INDENT-ON* */ /* clang-format on */ @@ -274,8 +272,10 @@ Blit1to4(SDL_BlitInfo * info) switch (width & 3) { case 3: *dst++ = map[*src++]; + SDL_FALLTHROUGH; case 2: *dst++ = map[*src++]; + SDL_FALLTHROUGH; case 1: *dst++ = map[*src++]; } @@ -285,8 +285,7 @@ Blit1to4(SDL_BlitInfo * info) } } -static void -Blit1to1Key(SDL_BlitInfo * info) +static void Blit1to1Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -300,7 +299,7 @@ Blit1to1Key(SDL_BlitInfo * info) if (palmap) { while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ( *src != ckey ) { *dst = palmap[*src]; @@ -316,7 +315,7 @@ Blit1to1Key(SDL_BlitInfo * info) } else { while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ( *src != ckey ) { *dst = *src; @@ -332,16 +331,15 @@ Blit1to1Key(SDL_BlitInfo * info) } } -static void -Blit1to2Key(SDL_BlitInfo * info) +static void Blit1to2Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; int srcskip = info->src_skip; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip; - Uint16 *palmap = (Uint16 *) info->table; + Uint16 *palmap = (Uint16 *)info->table; Uint32 ckey = info->colorkey; /* Set up some basic variables */ @@ -349,7 +347,7 @@ Blit1to2Key(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ( *src != ckey ) { *dstp=palmap[*src]; @@ -364,8 +362,7 @@ Blit1to2Key(SDL_BlitInfo * info) } } -static void -Blit1to3Key(SDL_BlitInfo * info) +static void Blit1to3Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -397,16 +394,15 @@ Blit1to3Key(SDL_BlitInfo * info) } } -static void -Blit1to4Key(SDL_BlitInfo * info) +static void Blit1to4Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; int srcskip = info->src_skip; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip; - Uint32 *palmap = (Uint32 *) info->table; + Uint32 *palmap = (Uint32 *)info->table; Uint32 ckey = info->colorkey; /* Set up some basic variables */ @@ -414,7 +410,7 @@ Blit1to4Key(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ( *src != ckey ) { *dstp = palmap[*src]; @@ -429,8 +425,7 @@ Blit1to4Key(SDL_BlitInfo * info) } } -static void -Blit1toNAlpha(SDL_BlitInfo * info) +static void Blit1toNAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -451,7 +446,7 @@ Blit1toNAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + DUFFS_LOOP( { sR = srcpal[*src].r; sG = srcpal[*src].g; @@ -469,8 +464,7 @@ Blit1toNAlpha(SDL_BlitInfo * info) } } -static void -Blit1toNAlphaKey(SDL_BlitInfo * info) +static void Blit1toNAlphaKey(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -513,15 +507,14 @@ Blit1toNAlphaKey(SDL_BlitInfo * info) } static const SDL_BlitFunc one_blit[] = { - (SDL_BlitFunc) NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 + (SDL_BlitFunc)NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4 }; static const SDL_BlitFunc one_blitkey[] = { - (SDL_BlitFunc) NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key + (SDL_BlitFunc)NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key }; -SDL_BlitFunc -SDL_CalculateBlit1(SDL_Surface * surface) +SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface) { int which; SDL_PixelFormat *dstfmt; @@ -539,16 +532,19 @@ SDL_CalculateBlit1(SDL_Surface * surface) case SDL_COPY_COLORKEY: return one_blitkey[which]; + case SDL_COPY_COLORKEY | SDL_COPY_BLEND: /* this is not super-robust but handles a specific case we found sdl12-compat. */ + return (surface->map->info.a == 255) ? one_blitkey[which] : (SDL_BlitFunc)NULL; + case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: /* Supporting 8bpp->8bpp alpha is doable but requires lots of tables which consume space and takes time to precompute, so is better left to the user */ - return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc) NULL; + return which >= 2 ? Blit1toNAlpha : (SDL_BlitFunc)NULL; case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND: - return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc) NULL; + return which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc)NULL; } - return (SDL_BlitFunc) NULL; + return (SDL_BlitFunc)NULL; } #endif /* SDL_HAVE_BLIT_1 */ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 56ba024c97f6e..d135a83839f6e 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,8 +28,7 @@ /* Functions to perform alpha blended blitting */ /* N->1 blending with per-surface alpha */ -static void -BlitNto1SurfaceAlpha(SDL_BlitInfo * info) +static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -48,7 +47,7 @@ BlitNto1SurfaceAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + DUFFS_LOOP( { DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); dR = dstfmt->palette->colors[*dst].r; @@ -75,8 +74,7 @@ BlitNto1SurfaceAlpha(SDL_BlitInfo * info) } /* N->1 blending with pixel alpha */ -static void -BlitNto1PixelAlpha(SDL_BlitInfo * info) +static void BlitNto1PixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -94,7 +92,7 @@ BlitNto1PixelAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + DUFFS_LOOP( { DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA); dR = dstfmt->palette->colors[*dst].r; @@ -121,8 +119,7 @@ BlitNto1PixelAlpha(SDL_BlitInfo * info) } /* colorkeyed N->1 blending with per-surface alpha */ -static void -BlitNto1SurfaceAlphaKey(SDL_BlitInfo * info) +static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -173,51 +170,49 @@ BlitNto1SurfaceAlphaKey(SDL_BlitInfo * info) #ifdef __MMX__ /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void -BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo * info) +static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; Uint32 dalpha = info->dst_fmt->Amask; __m64 src1, src2, dst1, dst2, lmask, hmask, dsta; - hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */ - lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */ - dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ + hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */ + lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */ + dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ while (height--) { int n = width; if (n & 1) { Uint32 s = *srcp++; Uint32 d = *dstp; - *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) - + (s & d & 0x00010101)) | dalpha; + *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) + (s & d & 0x00010101)) | dalpha; n--; } for (n >>= 1; n > 0; --n) { - dst1 = *(__m64 *) dstp; /* 2 x dst -> dst1(ARGBARGB) */ - dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ + dst1 = *(__m64 *)dstp; /* 2 x dst -> dst1(ARGBARGB) */ + dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ - src1 = *(__m64 *) srcp; /* 2 x src -> src1(ARGBARGB) */ - src2 = src1; /* 2 x src -> src2(ARGBARGB) */ + src1 = *(__m64 *)srcp; /* 2 x src -> src1(ARGBARGB) */ + src2 = src1; /* 2 x src -> src2(ARGBARGB) */ - dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */ - src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */ - src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */ - src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */ + dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */ + src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */ + src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */ + src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */ - dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */ - dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */ - dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */ + dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */ + dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */ + dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */ - *(__m64 *) dstp = dst1; /* dst1 -> 2 x dst pixels */ + *(__m64 *)dstp = dst1; /* dst1 -> 2 x dst pixels */ dstp += 2; srcp += 2; } @@ -229,8 +224,7 @@ BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo * info) } /* fast RGB888->(A)RGB888 blending with surface alpha */ -static void -BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info) +static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info) { SDL_PixelFormat *df = info->dst_fmt; Uint32 chanmask; @@ -242,45 +236,44 @@ BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info) } else { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; Uint32 dalpha = df->Amask; Uint32 amult; __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta; - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ /* form the alpha mult */ amult = alpha | (alpha << 8); amult = amult | (amult << 16); chanmask = - (0xff << df->Rshift) | (0xff << df-> - Gshift) | (0xff << df->Bshift); + (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift); mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ - dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ + dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ while (height--) { int n = width; if (n & 1) { /* One Pixel Blend */ - src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB) */ + src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB) */ src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */ - dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */ + dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */ - src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */ - src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ - src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ - dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */ + src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */ + src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ + src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ + dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */ - dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ - *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ + dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ ++srcp; ++dstp; @@ -290,30 +283,30 @@ BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info) for (n >>= 1; n > 0; --n) { /* Two Pixels Blend */ - src1 = *(__m64 *) srcp; /* 2 x src -> src1(ARGBARGB) */ - src2 = src1; /* 2 x src -> src2(ARGBARGB) */ + src1 = *(__m64 *)srcp; /* 2 x src -> src1(ARGBARGB) */ + src2 = src1; /* 2 x src -> src2(ARGBARGB) */ src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */ src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */ - dst1 = *(__m64 *) dstp; /* 2 x dst -> dst1(ARGBARGB) */ - dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ + dst1 = *(__m64 *)dstp; /* 2 x dst -> dst1(ARGBARGB) */ + dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */ dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */ - src1 = _mm_sub_pi16(src1, dst1); /* src1 - dst1 -> src1 */ - src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */ - src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */ - dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */ + src1 = _mm_sub_pi16(src1, dst1); /* src1 - dst1 -> src1 */ + src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */ + src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */ + dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */ - src2 = _mm_sub_pi16(src2, dst2); /* src2 - dst2 -> src2 */ - src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ - src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ - dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */ + src2 = _mm_sub_pi16(src2, dst2); /* src2 - dst2 -> src2 */ + src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */ + src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */ + dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */ - dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */ + dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ - *(__m64 *) dstp = dst1; /* dst1 -> 2 x pixel */ + *(__m64 *)dstp = dst1; /* dst1 -> 2 x pixel */ srcp += 2; dstp += 2; @@ -326,23 +319,32 @@ BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo * info) } /* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void -BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) +static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; SDL_PixelFormat *sf = info->src_fmt; Uint32 amask = sf->Amask; Uint32 ashift = sf->Ashift; Uint64 multmask, multmask2; - __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2; + __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2, mm_one_alpha; + + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + if (amask == 0xFF000000) { /* 1 in the alpha channel -> mm_one_alpha */ + mm_one_alpha = _mm_set_pi16(1, 0, 0, 0); + } else if (amask == 0x00FF0000) { + mm_one_alpha = _mm_set_pi16(0, 1, 0, 0); + } else if (amask == 0x0000FF00) { + mm_one_alpha = _mm_set_pi16(0, 0, 1, 0); + } else { + mm_one_alpha = _mm_set_pi16(0, 0, 0, 1); + } - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ multmask = 0x00FF; multmask <<= (ashift * 2); multmask2 = 0x00FF00FF00FF00FFULL; @@ -369,14 +371,33 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask); /* 0F0A0A0A -> mm_alpha */ mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2); /* 255 - mm_alpha -> mm_alpha */ - /* blend */ + /* + Alpha blending is: + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) * + + Here, 'src1' is: + srcRGB * srcA + srcA + And 'dst1' is: + dstRGB * (1-srcA) + dstA * (1-srcA) + so that *dstp is 'src1 + dst1' + + src1 is computed using mullo_pi16: (X * mask) >> 8, but is approximate for srcA ((srcA * 255) >> 8). + + need to a 1 to get an exact result: (srcA * 256) >> 8 == srcA + */ + mm_alpha = _mm_add_pi16(mm_alpha, mm_one_alpha); + + /* blend */ src1 = _mm_mullo_pi16(src1, mm_alpha); src1 = _mm_srli_pi16(src1, 8); dst1 = _mm_mullo_pi16(dst1, mm_alpha2); dst1 = _mm_srli_pi16(dst1, 8); dst1 = _mm_add_pi16(src1, dst1); dst1 = _mm_packs_pu16(dst1, mm_zero); - + *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ } ++srcp; @@ -391,11 +412,70 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info) #endif /* __MMX__ */ -#if SDL_ARM_SIMD_BLITTERS -void BlitARGBto565PixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); +#if defined(__loongarch_sx) static void -BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo * info) +BlitRGBtoRGBPixelAlphaLSX(SDL_BlitInfo * info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *) info->src; + int srcskip = info->src_skip >> 2; + Uint32 *dstp = (Uint32 *) info->dst; + int dstskip = info->dst_skip >> 2; + SDL_PixelFormat *sf = info->src_fmt; + Uint32 amask = sf->Amask; + Uint32 ashift = sf->Ashift; + Uint64 multmask, multmask2; + + __m128i src1, src2, src3, dst1, alpha, alpha2; + multmask = 0x00FF; + multmask <<= (ashift * 2); + multmask2 = 0x00FF00FF00FF00FFULL; + + while (height--) { + /* *INDENT-OFF* */ + DUFFS_LOOP4({ + Uint32 alpha1 = *srcp & amask; + if (alpha1 == 0) { + /* do nothing */ + } else if (alpha1 == amask) { + *dstp = *srcp; + } else { + src1 = __lsx_vreplgr2vr_w(*srcp); + src1 = __lsx_vinsgr2vr_w(src1, *dstp, 1); + src2 = __lsx_vsllwil_hu_bu(src1, 0); + + alpha = __lsx_vreplgr2vr_w(alpha1); + alpha = __lsx_vsrl_d(alpha, __lsx_vreplgr2vr_d(ashift)); + alpha = __lsx_vilvl_h(alpha, alpha); + alpha2 = __lsx_vilvl_w(alpha, alpha); + alpha = __lsx_vor_v(alpha2, __lsx_vreplgr2vr_d(multmask)); + alpha2 = __lsx_vxor_v(alpha2, __lsx_vreplgr2vr_d(multmask2)); + + src3 = __lsx_vilvl_d(alpha2, alpha); + src1 = __lsx_vmul_h(src2, src3); + src1 = __lsx_vsrli_h(src1, 8); + src2 = __lsx_vilvh_d(src1, src1); + src1 = __lsx_vadd_h(src1, src2); + dst1 = __lsx_vssrlni_bu_h(src1, src1, 0); + __lsx_vstelm_w(dst1, dstp, 0, 0); + } + ++srcp; + ++dstp; + }, width); + /* *INDENT-ON* */ + srcp += srcskip; + dstp += dstskip; + } +} + +#endif /* __loongarch_sx */ + +#ifdef SDL_ARM_SIMD_BLITTERS +void BlitARGBto565PixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); + +static void BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -409,8 +489,7 @@ BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo * info) void BlitRGBtoRGBPixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); -static void -BlitRGBtoRGBPixelAlphaARMSIMD(SDL_BlitInfo * info) +static void BlitRGBtoRGBPixelAlphaARMSIMD(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -423,11 +502,10 @@ BlitRGBtoRGBPixelAlphaARMSIMD(SDL_BlitInfo * info) } #endif -#if SDL_ARM_NEON_BLITTERS +#ifdef SDL_ARM_NEON_BLITTERS void BlitARGBto565PixelAlphaARMNEONAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); -static void -BlitARGBto565PixelAlphaARMNEON(SDL_BlitInfo * info) +static void BlitARGBto565PixelAlphaARMNEON(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -441,8 +519,7 @@ BlitARGBto565PixelAlphaARMNEON(SDL_BlitInfo * info) void BlitRGBtoRGBPixelAlphaARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); -static void -BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo * info) +static void BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -456,19 +533,18 @@ BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo * info) #endif /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void -BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo * info) +static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ Uint32 s = *srcp++; Uint32 d = *dstp; *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) @@ -481,8 +557,7 @@ BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo * info) } /* fast RGB888->(A)RGB888 blending with surface alpha */ -static void -BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info) +static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) { unsigned alpha = info->a; if (alpha == 128) { @@ -490,9 +565,9 @@ BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info) } else { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; Uint32 s; Uint32 d; @@ -501,7 +576,7 @@ BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ s = *srcp; d = *dstp; s1 = s & 0xff00ff; @@ -523,14 +598,13 @@ BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo * info) } /* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void -BlitRGBtoRGBPixelAlpha(SDL_BlitInfo * info) +static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; while (height--) { @@ -576,14 +650,13 @@ BlitRGBtoRGBPixelAlpha(SDL_BlitInfo * info) } /* fast ARGB888->(A)BGR888 blending with pixel alpha */ -static void -BlitRGBtoBGRPixelAlpha(SDL_BlitInfo * info) +static void BlitRGBtoBGRPixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; while (height--) { @@ -632,23 +705,32 @@ BlitRGBtoBGRPixelAlpha(SDL_BlitInfo * info) #ifdef __3dNOW__ /* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */ -static void -BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info) +static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip >> 2; SDL_PixelFormat *sf = info->src_fmt; Uint32 amask = sf->Amask; Uint32 ashift = sf->Ashift; Uint64 multmask, multmask2; - __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2; + __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2, mm_one_alpha; + + mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ + if (amask == 0xFF000000) { /* 1 in the alpha channel -> mm_one_alpha */ + mm_one_alpha = _mm_set_pi16(1, 0, 0, 0); + } else if (amask == 0x00FF0000) { + mm_one_alpha = _mm_set_pi16(0, 1, 0, 0); + } else if (amask == 0x0000FF00) { + mm_one_alpha = _mm_set_pi16(0, 0, 1, 0); + } else { + mm_one_alpha = _mm_set_pi16(0, 0, 0, 1); + } - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ multmask = 0x00FF; multmask <<= (ashift * 2); multmask2 = 0x00FF00FF00FF00FFULL; @@ -680,15 +762,33 @@ BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info) mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask); /* 0F0A0A0A -> mm_alpha */ mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2); /* 255 - mm_alpha -> mm_alpha */ + /* + Alpha blending is: + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) * + + Here, 'src1' is: + srcRGB * srcA + srcA + And 'dst1' is: + dstRGB * (1-srcA) + dstA * (1-srcA) + so that *dstp is 'src1 + dst1' + + src1 is computed using mullo_pi16: (X * mask) >> 8, but is approximate for srcA ((srcA * 255) >> 8). - /* blend */ + need to a 1 to get an exact result: (srcA * 256) >> 8 == srcA + */ + mm_alpha = _mm_add_pi16(mm_alpha, mm_one_alpha); + + /* blend */ src1 = _mm_mullo_pi16(src1, mm_alpha); src1 = _mm_srli_pi16(src1, 8); dst1 = _mm_mullo_pi16(dst1, mm_alpha2); dst1 = _mm_srli_pi16(dst1, 8); dst1 = _mm_add_pi16(src1, dst1); dst1 = _mm_packs_pu16(dst1, mm_zero); - + *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ } ++srcp; @@ -706,26 +806,24 @@ BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo * info) /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */ /* blend a single 16 bit pixel at 50% */ -#define BLEND16_50(d, s, mask) \ +#define BLEND16_50(d, s, mask) \ ((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff))) /* blend two 16 bit pixels at 50% */ -#define BLEND2x16_50(d, s, mask) \ - (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \ - + (s & d & (~(mask | mask << 16)))) +#define BLEND2x16_50(d, s, mask) \ + (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) + (s & d & (~(mask | mask << 16)))) -static void -Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) +static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask) { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip >> 1; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; while (height--) { - if (((uintptr_t) srcp ^ (uintptr_t) dstp) & 2) { + if (((uintptr_t)srcp ^ (uintptr_t)dstp) & 2) { /* * Source and destination not aligned, pipeline it. * This is mostly a win for big blits but no loss for @@ -735,29 +833,29 @@ Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) int w = width; /* handle odd destination */ - if ((uintptr_t) dstp & 2) { + if ((uintptr_t)dstp & 2) { Uint16 d = *dstp, s = *srcp; *dstp = BLEND16_50(d, s, mask); dstp++; srcp++; w--; } - srcp++; /* srcp is now 32-bit aligned */ + srcp++; /* srcp is now 32-bit aligned */ /* bootstrap pipeline with first halfword */ - prev_sw = ((Uint32 *) srcp)[-1]; + prev_sw = ((Uint32 *)srcp)[-1]; while (w > 1) { Uint32 sw, dw, s; - sw = *(Uint32 *) srcp; - dw = *(Uint32 *) dstp; + sw = *(Uint32 *)srcp; + dw = *(Uint32 *)dstp; #if SDL_BYTEORDER == SDL_BIG_ENDIAN s = (prev_sw << 16) + (sw >> 16); #else s = (prev_sw >> 16) + (sw << 16); #endif prev_sw = sw; - *(Uint32 *) dstp = BLEND2x16_50(dw, s, mask); + *(Uint32 *)dstp = BLEND2x16_50(dw, s, mask); dstp += 2; srcp += 2; w -= 2; @@ -767,9 +865,9 @@ Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) if (w) { Uint16 d = *dstp, s; #if SDL_BYTEORDER == SDL_BIG_ENDIAN - s = (Uint16) prev_sw; + s = (Uint16)prev_sw; #else - s = (Uint16) (prev_sw >> 16); + s = (Uint16)(prev_sw >> 16); #endif *dstp = BLEND16_50(d, s, mask); srcp++; @@ -782,7 +880,7 @@ Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) int w = width; /* first odd pixel? */ - if ((uintptr_t) srcp & 2) { + if ((uintptr_t)srcp & 2) { Uint16 d = *dstp, s = *srcp; *dstp = BLEND16_50(d, s, mask); srcp++; @@ -792,9 +890,9 @@ Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) /* srcp and dstp are now 32-bit aligned */ while (w > 1) { - Uint32 sw = *(Uint32 *) srcp; - Uint32 dw = *(Uint32 *) dstp; - *(Uint32 *) dstp = BLEND2x16_50(dw, sw, mask); + Uint32 sw = *(Uint32 *)srcp; + Uint32 dw = *(Uint32 *)dstp; + *(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask); srcp += 2; dstp += 2; w -= 2; @@ -816,8 +914,7 @@ Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask) #ifdef __MMX__ /* fast RGB565->RGB565 blending with surface alpha */ -static void -Blit565to565SurfaceAlphaMMX(SDL_BlitInfo * info) +static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info) { unsigned alpha = info->a; if (alpha == 128) { @@ -825,27 +922,29 @@ Blit565to565SurfaceAlphaMMX(SDL_BlitInfo * info) } else { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip >> 1; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; Uint32 s, d; +#ifdef USE_DUFFS_LOOP __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha; - alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ - mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ - alpha >>= 3; /* downscale alpha to 5 bits */ + alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ + mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ + alpha >>= 3; /* downscale alpha to 5 bits */ - mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ - mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ /* position alpha to allow for mullo and mulhi on diff channels to reduce the number of operations */ mm_alpha = _mm_slli_si64(mm_alpha, 3); /* Setup the 565 color channel masks */ - gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */ - bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ + gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */ + bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ +#endif while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -953,8 +1052,7 @@ Blit565to565SurfaceAlphaMMX(SDL_BlitInfo * info) } /* fast RGB555->RGB555 blending with surface alpha */ -static void -Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info) +static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info) { unsigned alpha = info->a; if (alpha == 128) { @@ -962,29 +1060,30 @@ Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info) } else { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip >> 1; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; Uint32 s, d; +#ifdef USE_DUFFS_LOOP __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha; - alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ - mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ - alpha >>= 3; /* downscale alpha to 5 bits */ + alpha &= ~(1 + 2 + 4); /* cut alpha to get the exact same behaviour */ + mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */ + alpha >>= 3; /* downscale alpha to 5 bits */ - mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ - mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */ + mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */ /* position alpha to allow for mullo and mulhi on diff channels to reduce the number of operations */ mm_alpha = _mm_slli_si64(mm_alpha, 3); /* Setup the 555 color channel masks */ - rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */ - gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */ - bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ - + rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */ + gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */ + bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */ +#endif while (height--) { /* *INDENT-OFF* */ /* clang-format off */ DUFFS_LOOP_124( @@ -1045,7 +1144,7 @@ Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info) dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */ mm_res = dst2; /* RED -> mm_res */ - + /* green -- process the bits in place */ src2 = src1; src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */ @@ -1093,8 +1192,7 @@ Blit555to555SurfaceAlphaMMX(SDL_BlitInfo * info) #endif /* __MMX__ */ /* fast RGB565->RGB565 blending with surface alpha */ -static void -Blit565to565SurfaceAlpha(SDL_BlitInfo * info) +static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info) { unsigned alpha = info->a; if (alpha == 128) { @@ -1102,15 +1200,15 @@ Blit565to565SurfaceAlpha(SDL_BlitInfo * info) } else { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip >> 1; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; - alpha >>= 3; /* downscale alpha to 5 bits */ + alpha >>= 3; /* downscale alpha to 5 bits */ while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ Uint32 s = *srcp++; Uint32 d = *dstp; /* @@ -1132,24 +1230,23 @@ Blit565to565SurfaceAlpha(SDL_BlitInfo * info) } /* fast RGB555->RGB555 blending with surface alpha */ -static void -Blit555to555SurfaceAlpha(SDL_BlitInfo * info) +static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) { - unsigned alpha = info->a; /* downscale alpha to 5 bits */ + unsigned alpha = info->a; /* downscale alpha to 5 bits */ if (alpha == 128) { Blit16to16SurfaceAlpha128(info, 0xfbde); } else { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip >> 1; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; - alpha >>= 3; /* downscale alpha to 5 bits */ + alpha >>= 3; /* downscale alpha to 5 bits */ while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ Uint32 s = *srcp++; Uint32 d = *dstp; /* @@ -1171,27 +1268,25 @@ Blit555to555SurfaceAlpha(SDL_BlitInfo * info) } /* fast ARGB8888->RGB565 blending with pixel alpha */ -static void -BlitARGBto565PixelAlpha(SDL_BlitInfo * info) +static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ Uint32 s = *srcp; unsigned alpha = s >> 27; /* downscale alpha to 5 bits */ - /* FIXME: Here we special-case opaque alpha since the + /* Here we special-case opaque alpha since the compositioning used (>>8 instead of /255) doesn't handle - it correctly. Also special-case alpha=0 for speed? - Benchmark this! */ - if(alpha) { - if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { + it correctly. */ + if (alpha) { + if (alpha == (SDL_ALPHA_OPAQUE >> 3)) { *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3 & 0x1f)); } else { Uint32 d = *dstp; @@ -1199,8 +1294,7 @@ BlitARGBto565PixelAlpha(SDL_BlitInfo * info) * convert source and destination to G0RAB65565 * and blend all components at the same time */ - s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800) - + (s >> 3 & 0x1f); + s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800) + (s >> 3 & 0x1f); d = (d | d << 16) & 0x07e0f81f; d += (s - d) * alpha >> 5; d &= 0x07e0f81f; @@ -1217,37 +1311,34 @@ BlitARGBto565PixelAlpha(SDL_BlitInfo * info) } /* fast ARGB8888->RGB555 blending with pixel alpha */ -static void -BlitARGBto555PixelAlpha(SDL_BlitInfo * info) +static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip >> 2; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip >> 1; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ + DUFFS_LOOP({ unsigned alpha; Uint32 s = *srcp; alpha = s >> 27; /* downscale alpha to 5 bits */ - /* FIXME: Here we special-case opaque alpha since the + /* Here we special-case opaque alpha since the compositioning used (>>8 instead of /255) doesn't handle - it correctly. Also special-case alpha=0 for speed? - Benchmark this! */ - if(alpha) { - if(alpha == (SDL_ALPHA_OPAQUE >> 3)) { + it correctly. */ + if (alpha) { + if (alpha == (SDL_ALPHA_OPAQUE >> 3)) { *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3 & 0x1f)); } else { Uint32 d = *dstp; /* - * convert source and destination to G0RAB65565 + * convert source and destination to G0RAB55555 * and blend all components at the same time */ - s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00) - + (s >> 3 & 0x1f); + s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00) + (s >> 3 & 0x1f); d = (d | d << 16) & 0x03e07c1f; d += (s - d) * alpha >> 5; d &= 0x03e07c1f; @@ -1264,8 +1355,7 @@ BlitARGBto555PixelAlpha(SDL_BlitInfo * info) } /* General (slow) N->N blending with per-surface alpha */ -static void -BlitNtoNSurfaceAlpha(SDL_BlitInfo * info) +static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -1284,8 +1374,8 @@ BlitNtoNSurfaceAlpha(SDL_BlitInfo * info) if (sA) { while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + /* *INDENT-OFF* */ /* clang-format off */ + DUFFS_LOOP( { DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB); DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); @@ -1303,8 +1393,7 @@ BlitNtoNSurfaceAlpha(SDL_BlitInfo * info) } /* General (slow) colorkeyed N->N blending with per-surface alpha */ -static void -BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info) +static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -1324,10 +1413,10 @@ BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + DUFFS_LOOP( { RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel); - if(sA && Pixel != ckey) { + if (sA && Pixel != ckey) { RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); @@ -1344,8 +1433,7 @@ BlitNtoNSurfaceAlphaKey(SDL_BlitInfo * info) } /* General (slow) N->N blending with pixel alpha */ -static void -BlitNtoNPixelAlpha(SDL_BlitInfo * info) +static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -1367,10 +1455,10 @@ BlitNtoNPixelAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( + DUFFS_LOOP( { DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); - if(sA) { + if (sA) { DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); @@ -1385,9 +1473,7 @@ BlitNtoNPixelAlpha(SDL_BlitInfo * info) } } - -SDL_BlitFunc -SDL_CalculateBlitA(SDL_Surface * surface) +SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) { SDL_PixelFormat *sf = surface->format; SDL_PixelFormat *df = surface->map->dst->format; @@ -1397,7 +1483,7 @@ SDL_CalculateBlitA(SDL_Surface * surface) /* Per-pixel alpha blits */ switch (df->BytesPerPixel) { case 1: - if (df->palette != NULL) { + if (df->palette) { return BlitNto1PixelAlpha; } else { /* RGB332 has no palette ! */ @@ -1405,66 +1491,64 @@ SDL_CalculateBlitA(SDL_Surface * surface) } case 2: -#if SDL_ARM_NEON_BLITTERS || SDL_ARM_SIMD_BLITTERS - if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 - && sf->Gmask == 0xff00 && df->Gmask == 0x7e0 - && ((sf->Rmask == 0xff && df->Rmask == 0x1f) - || (sf->Bmask == 0xff && df->Bmask == 0x1f))) - { -#if SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON()) - return BlitARGBto565PixelAlphaARMNEON; -#endif -#if SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD()) - return BlitARGBto565PixelAlphaARMSIMD; +#if defined(SDL_ARM_NEON_BLITTERS) || defined(SDL_ARM_SIMD_BLITTERS) + if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && df->Gmask == 0x7e0 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { +#ifdef SDL_ARM_NEON_BLITTERS + if (SDL_HasNEON()) { + return BlitARGBto565PixelAlphaARMNEON; + } #endif +#ifdef SDL_ARM_SIMD_BLITTERS + if (SDL_HasARMSIMD()) { + return BlitARGBto565PixelAlphaARMSIMD; } #endif - if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 - && sf->Gmask == 0xff00 - && ((sf->Rmask == 0xff && df->Rmask == 0x1f) - || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { - if (df->Gmask == 0x7e0) + } +#endif + if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { + if (df->Gmask == 0x7e0) { return BlitARGBto565PixelAlpha; - else if (df->Gmask == 0x3e0) + } else if (df->Gmask == 0x3e0 && !df->Amask) { return BlitARGBto555PixelAlpha; + } } return BlitNtoNPixelAlpha; case 4: - if (sf->Rmask == df->Rmask - && sf->Gmask == df->Gmask - && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { -#if defined(__MMX__) || defined(__3dNOW__) - if (sf->Rshift % 8 == 0 - && sf->Gshift % 8 == 0 - && sf->Bshift % 8 == 0 - && sf->Ashift % 8 == 0 && sf->Aloss == 0) { + if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { +#if defined(__MMX__) || defined(__3dNOW__) || defined(__loongarch_sx) + if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { #ifdef __3dNOW__ - if (SDL_Has3DNow()) + if (SDL_Has3DNow()) { return BlitRGBtoRGBPixelAlphaMMX3DNOW; + } #endif #ifdef __MMX__ - if (SDL_HasMMX()) + if (SDL_HasMMX()) { return BlitRGBtoRGBPixelAlphaMMX; + } +#endif +#ifdef __loongarch_sx + if (SDL_HasLSX()) { + return BlitRGBtoRGBPixelAlphaLSX; + } #endif } -#endif /* __MMX__ || __3dNOW__ */ +#endif /* __MMX__ || __3dNOW__ || __loongarch_sx*/ if (sf->Amask == 0xff000000) { -#if SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON()) +#ifdef SDL_ARM_NEON_BLITTERS + if (SDL_HasNEON()) { return BlitRGBtoRGBPixelAlphaARMNEON; + } #endif -#if SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD()) +#ifdef SDL_ARM_SIMD_BLITTERS + if (SDL_HasARMSIMD()) { return BlitRGBtoRGBPixelAlphaARMSIMD; + } #endif return BlitRGBtoRGBPixelAlpha; } - } else if (sf->Rmask == df->Bmask - && sf->Gmask == df->Gmask - && sf->Bmask == df->Rmask && sf->BytesPerPixel == 4) { + } else if (sf->Rmask == df->Bmask && sf->Gmask == df->Gmask && sf->Bmask == df->Rmask && sf->BytesPerPixel == 4) { if (sf->Amask == 0xff000000) { return BlitRGBtoBGRPixelAlpha; } @@ -1482,7 +1566,7 @@ SDL_CalculateBlitA(SDL_Surface * surface) /* Per-surface alpha blits */ switch (df->BytesPerPixel) { case 1: - if (df->palette != NULL) { + if (df->palette) { return BlitNto1SurfaceAlpha; } else { /* RGB332 has no palette ! */ @@ -1493,31 +1577,32 @@ SDL_CalculateBlitA(SDL_Surface * surface) if (surface->map->identity) { if (df->Gmask == 0x7e0) { #ifdef __MMX__ - if (SDL_HasMMX()) + if (SDL_HasMMX()) { return Blit565to565SurfaceAlphaMMX; - else + } else #endif + { return Blit565to565SurfaceAlpha; + } } else if (df->Gmask == 0x3e0) { #ifdef __MMX__ - if (SDL_HasMMX()) + if (SDL_HasMMX()) { return Blit555to555SurfaceAlphaMMX; - else + } else #endif + { return Blit555to555SurfaceAlpha; + } } } return BlitNtoNSurfaceAlpha; case 4: - if (sf->Rmask == df->Rmask - && sf->Gmask == df->Gmask - && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { + if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->BytesPerPixel == 4) { #ifdef __MMX__ - if (sf->Rshift % 8 == 0 - && sf->Gshift % 8 == 0 - && sf->Bshift % 8 == 0 && SDL_HasMMX()) + if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && SDL_HasMMX()) { return BlitRGBtoRGBSurfaceAlphaMMX; + } #endif if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) { return BlitRGBtoRGBSurfaceAlpha; @@ -1536,7 +1621,7 @@ SDL_CalculateBlitA(SDL_Surface * surface) if (sf->Amask == 0) { if (df->BytesPerPixel == 1) { - if (df->palette != NULL) { + if (df->palette) { return BlitNto1SurfaceAlphaKey; } else { /* RGB332 has no palette ! */ diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 3efa917d68f1b..41161d57d370d 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,19 +28,19 @@ #include "SDL_blit.h" #include "SDL_blit_copy.h" - /* General optimized routines that write char by char */ #define HAVE_FAST_WRITE_INT8 1 /* On some CPU, it's slower than combining and write a word */ -#if defined(__MIPS__) -# undef HAVE_FAST_WRITE_INT8 -# define HAVE_FAST_WRITE_INT8 0 +#if defined(__MIPS__) +#undef HAVE_FAST_WRITE_INT8 +#define HAVE_FAST_WRITE_INT8 0 #endif /* Functions to blit from N-bit surfaces to other surfaces */ -enum blit_features { +enum blit_features +{ BLIT_FEATURE_NONE = 0, BLIT_FEATURE_HAS_MMX = 1, BLIT_FEATURE_HAS_ALTIVEC = 2, @@ -48,29 +48,27 @@ enum blit_features { BLIT_FEATURE_HAS_ARM_SIMD = 8 }; -#if SDL_ALTIVEC_BLITTERS +#ifdef SDL_ALTIVEC_BLITTERS #ifdef HAVE_ALTIVEC_H #include #endif #ifdef __MACOSX__ #include -static size_t -GetL3CacheSize(void) +static size_t GetL3CacheSize(void) { const char key[] = "hw.l3cachesize"; u_int64_t result = 0; size_t typeSize = sizeof(result); - int err = sysctlbyname(key, &result, &typeSize, NULL, 0); - if (0 != err) + if (0 != err) { return 0; + } return result; } #else -static size_t -GetL3CacheSize(void) +static size_t GetL3CacheSize(void) { /* XXX: Just guess G4 */ return 2097152; @@ -83,24 +81,29 @@ GetL3CacheSize(void) #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ (vector unsigned short) ( a,b,c,d,e,f,g,h ) #else -#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \ - (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p } -#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \ - (vector unsigned short) { a,b,c,d,e,f,g,h } +#define VECUINT8_LITERAL(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \ + (vector unsigned char) \ + { \ + a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p \ + } +#define VECUINT16_LITERAL(a, b, c, d, e, f, g, h) \ + (vector unsigned short) \ + { \ + a, b, c, d, e, f, g, h \ + } #endif -#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F) -#define VSWIZZLE32(a,b,c,d) (vector unsigned char) \ - ( 0x00+a, 0x00+b, 0x00+c, 0x00+d, \ - 0x04+a, 0x04+b, 0x04+c, 0x04+d, \ - 0x08+a, 0x08+b, 0x08+c, 0x08+d, \ - 0x0C+a, 0x0C+b, 0x0C+c, 0x0C+d ) +#define UNALIGNED_PTR(x) (((size_t)x) & 0x0000000F) +#define VSWIZZLE32(a, b, c, d) (vector unsigned char)(0x00 + a, 0x00 + b, 0x00 + c, 0x00 + d, \ + 0x04 + a, 0x04 + b, 0x04 + c, 0x04 + d, \ + 0x08 + a, 0x08 + b, 0x08 + c, 0x08 + d, \ + 0x0C + a, 0x0C + b, 0x0C + c, 0x0C + d) -#define MAKE8888(dstfmt, r, g, b, a) \ - ( ((r<Rshift)&dstfmt->Rmask) | \ - ((g<Gshift)&dstfmt->Gmask) | \ - ((b<Bshift)&dstfmt->Bmask) | \ - ((a<Ashift)&dstfmt->Amask) ) +#define MAKE8888(dstfmt, r, g, b, a) \ + (((r << dstfmt->Rshift) & dstfmt->Rmask) | \ + ((g << dstfmt->Gshift) & dstfmt->Gmask) | \ + ((b << dstfmt->Bshift) & dstfmt->Bmask) | \ + ((a << dstfmt->Ashift) & dstfmt->Amask)) /* * Data Stream Touch...Altivec cache prefetching. @@ -108,20 +111,19 @@ GetL3CacheSize(void) * Don't use this on a G5...however, the speed boost is very significant * on a G4. */ -#define DST_CHAN_SRC 1 +#define DST_CHAN_SRC 1 #define DST_CHAN_DEST 2 /* macro to set DST control word value... */ #define DST_CTRL(size, count, stride) \ (((size) << 24) | ((count) << 16) | (stride)) -#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \ - ? vec_lvsl(0, src) \ - : vec_add(vec_lvsl(8, src), vec_splat_u8(8))) +#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \ + ? vec_lvsl(0, src) \ + : vec_add(vec_lvsl(8, src), vec_splat_u8(8))) /* Calculate the permute vector used for 32->32 swizzling */ -static vector unsigned char -calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) +static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, const SDL_PixelFormat *dstfmt) { /* * We have to assume that the bits that aren't used by other @@ -130,12 +132,7 @@ calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) */ /* ARGB */ static const struct SDL_PixelFormat default_pixel_format = { - 0, NULL, 0, 0, - {0, 0}, - 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, - 0, 0, 0, 0, - 16, 8, 0, 24, - 0, NULL + 0, NULL, 0, 0, { 0, 0 }, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 0, 0, 0, 0, 16, 8, 0, 24, 0, NULL }; const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, @@ -161,8 +158,7 @@ calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) /* Use zero for alpha if either surface doesn't have alpha */ if (dstfmt->Amask) { amask = - ((srcfmt->Amask) ? RESHIFT(srcfmt-> - Ashift) : 0x10) << (dstfmt->Ashift); + ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift); } else { amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ @@ -170,19 +166,19 @@ calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt) } #undef RESHIFT - ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask); - vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0)); + ((unsigned int *)(char *)&srcvec)[0] = (rmask | gmask | bmask | amask); + vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0)); return (vswiz); } -#if defined(__powerpc__) && (SDL_BYTEORDER == SDL_LIL_ENDIAN) +#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* reorder bytes for PowerPC little endian */ static vector unsigned char reorder_ppc64le_vec(vector unsigned char vpermute) { /* The result vector of calc_swizzle32 reorder bytes using vec_perm. The LE transformation for vec_perm has an implicit assumption that the permutation is being used to reorder vector elements, - not to reorder bytes within those elements. + not to reorder bytes within those elements. Unfortunatly the result order is not the expected one for powerpc little endian when the two first vector parameters of vec_perm are not of type 'vector char'. This is because the numbering from the @@ -192,25 +188,24 @@ static vector unsigned char reorder_ppc64le_vec(vector unsigned char vpermute) */ const vector unsigned char ppc64le_reorder = VECUINT8_LITERAL( - 0x01, 0x00, 0x03, 0x02, - 0x05, 0x04, 0x07, 0x06, - 0x09, 0x08, 0x0B, 0x0A, - 0x0D, 0x0C, 0x0F, 0x0E ); + 0x01, 0x00, 0x03, 0x02, + 0x05, 0x04, 0x07, 0x06, + 0x09, 0x08, 0x0B, 0x0A, + 0x0D, 0x0C, 0x0F, 0x0E); vector unsigned char vswiz_ppc64le; vswiz_ppc64le = vec_perm(vpermute, vpermute, ppc64le_reorder); - return(vswiz_ppc64le); + return (vswiz_ppc64le); } #endif -static void Blit_RGB888_RGB565(SDL_BlitInfo * info); -static void -Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) +static void Blit_RGB888_RGB565(SDL_BlitInfo *info); +static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) { int height = info->dst_h; - Uint8 *src = (Uint8 *) info->src; + Uint8 *src = (Uint8 *)info->src; int srcskip = info->src_skip; - Uint8 *dst = (Uint8 *) info->dst; + Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; vector unsigned char valpha = vec_splat_u8(0); @@ -227,7 +222,7 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) vector unsigned short vfc = VECUINT16_LITERAL(0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc, 0x00fc); - vector unsigned short vf800 = (vector unsigned short) vec_splat_u8(-7); + vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); while (height--) { @@ -239,24 +234,24 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) int extrawidth; /* do scalar until we can align... */ -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while (condition) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, sA; \ - DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \ - sR, sG, sB, sA); \ - *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \ - ((sG << 3) & 0x000007E0) | \ - ((sB >> 3) & 0x0000001F)); \ - dst += 2; \ - src += 4; \ - widthvar--; \ - } +#define ONE_PIXEL_BLEND(condition, widthvar) \ + while (condition) { \ + Uint32 Pixel; \ + unsigned sR, sG, sB, sA; \ + DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \ + sR, sG, sB, sA); \ + *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \ + ((sG << 3) & 0x000007E0) | \ + ((sB >> 3) & 0x0000001F)); \ + dst += 2; \ + src += 4; \ + widthvar--; \ + } ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -268,25 +263,25 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vsrc1 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute); + vsrc1 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute); src += 16; vsrc = voverflow; voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vsrc2 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute); + vsrc2 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute); /* 1555 */ - vpixel = (vector unsigned short) vec_packpx(vsrc1, vsrc2); - vgpixel = (vector unsigned short) vec_perm(vsrc1, vsrc2, vgmerge); + vpixel = (vector unsigned short)vec_packpx(vsrc1, vsrc2); + vgpixel = (vector unsigned short)vec_perm(vsrc1, vsrc2, vgmerge); vgpixel = vec_and(vgpixel, vfc); vgpixel = vec_sl(vgpixel, v3); vrpixel = vec_sl(vpixel, v1); vrpixel = vec_and(vrpixel, vf800); vbpixel = vec_and(vpixel, v3f); vdst = - vec_or((vector unsigned char) vrpixel, - (vector unsigned char) vgpixel); + vec_or((vector unsigned char)vrpixel, + (vector unsigned char)vgpixel); /* 565 */ - vdst = vec_or(vdst, (vector unsigned char) vbpixel); + vdst = vec_or(vdst, (vector unsigned char)vbpixel); vec_st(vdst, 0, dst); width -= 8; @@ -301,20 +296,17 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info) ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } - - } -static void -Blit_RGB565_32Altivec(SDL_BlitInfo * info) +static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) { int height = info->dst_h; - Uint8 *src = (Uint8 *) info->src; + Uint8 *src = (Uint8 *)info->src; int srcskip = info->src_skip; - Uint8 *dst = (Uint8 *) info->dst; + Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -337,9 +329,7 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) 0x10, 0x06, 0x01, 0x01); vector unsigned char vredalpha2 = - (vector unsigned - char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16)) - ); + (vector unsigned char)(vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))); /* 0x00 - 0x0f is ARxx ARxx ARxx ARxx 0x11 - 0x0f odds are blue @@ -349,8 +339,7 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) 0x08, 0x09, 0x0a, 0x15, 0x0c, 0x0d, 0x0e, 0x17); vector unsigned char vblue2 = - (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8) - ); + (vector unsigned char)(vec_add((vector unsigned int)vblue1, v8)); /* 0x00 - 0x0f is ARxB ARxB ARxB ARxB 0x10 - 0x0e evens are green @@ -360,18 +349,16 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) 0x08, 0x09, 0x14, 0x0b, 0x0c, 0x0d, 0x16, 0x0f); vector unsigned char vgreen2 = - (vector unsigned - char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8)) - ); + (vector unsigned char)(vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))); SDL_assert(srcfmt->BytesPerPixel == 2); SDL_assert(dstfmt->BytesPerPixel == 4); - vf800 = (vector unsigned short) vec_splat_u8(-7); + vf800 = (vector unsigned short)vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); if (dstfmt->Amask && info->a) { - ((unsigned char *) &valpha)[0] = alpha = info->a; + ((unsigned char *)&valpha)[0] = alpha = info->a; valpha = vec_splat(valpha, 0); } else { alpha = 0; @@ -388,22 +375,22 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) int extrawidth; /* do scalar until we can align... */ -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while (condition) { \ - unsigned sR, sG, sB; \ - unsigned short Pixel = *((unsigned short *)src); \ - sR = (Pixel >> 8) & 0xf8; \ - sG = (Pixel >> 3) & 0xfc; \ - sB = (Pixel << 3) & 0xf8; \ - ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \ - src += 2; \ - dst += 4; \ - widthvar--; \ - } +#define ONE_PIXEL_BLEND(condition, widthvar) \ + while (condition) { \ + unsigned sR, sG, sB; \ + unsigned short Pixel = *((unsigned short *)src); \ + sR = (Pixel >> 8) & 0xf8; \ + sG = (Pixel >> 3) & 0xfc; \ + sB = (Pixel << 3) & 0xf8; \ + ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \ + src += 2; \ + dst += 4; \ + widthvar--; \ + } ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -415,23 +402,23 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vR = vec_and((vector unsigned short) vsrc, vf800); - vB = vec_sl((vector unsigned short) vsrc, v3); + vR = vec_and((vector unsigned short)vsrc, vf800); + vB = vec_sl((vector unsigned short)vsrc, v3); vG = vec_sl(vB, v2); vdst1 = - (vector unsigned char) vec_perm((vector unsigned char) vR, - valpha, vredalpha1); - vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1); - vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1); + (vector unsigned char)vec_perm((vector unsigned char)vR, + valpha, vredalpha1); + vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1); + vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1); vdst1 = vec_perm(vdst1, valpha, vpermute); vec_st(vdst1, 0, dst); vdst2 = - (vector unsigned char) vec_perm((vector unsigned char) vR, - valpha, vredalpha2); - vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2); - vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2); + (vector unsigned char)vec_perm((vector unsigned char)vR, + valpha, vredalpha2); + vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2); + vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2); vdst2 = vec_perm(vdst2, valpha, vpermute); vec_st(vdst2, 16, dst); @@ -443,25 +430,21 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info) SDL_assert(width == 0); - /* do scalar until we can align... */ ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } - } - -static void -Blit_RGB555_32Altivec(SDL_BlitInfo * info) +static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) { int height = info->dst_h; - Uint8 *src = (Uint8 *) info->src; + Uint8 *src = (Uint8 *)info->src; int srcskip = info->src_skip; - Uint8 *dst = (Uint8 *) info->dst; + Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -484,9 +467,7 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) 0x10, 0x06, 0x01, 0x01); vector unsigned char vredalpha2 = - (vector unsigned - char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16)) - ); + (vector unsigned char)(vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))); /* 0x00 - 0x0f is ARxx ARxx ARxx ARxx 0x11 - 0x0f odds are blue @@ -496,8 +477,7 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) 0x08, 0x09, 0x0a, 0x15, 0x0c, 0x0d, 0x0e, 0x17); vector unsigned char vblue2 = - (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8) - ); + (vector unsigned char)(vec_add((vector unsigned int)vblue1, v8)); /* 0x00 - 0x0f is ARxB ARxB ARxB ARxB 0x10 - 0x0e evens are green @@ -507,18 +487,16 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) 0x08, 0x09, 0x14, 0x0b, 0x0c, 0x0d, 0x16, 0x0f); vector unsigned char vgreen2 = - (vector unsigned - char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8)) - ); + (vector unsigned char)(vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))); SDL_assert(srcfmt->BytesPerPixel == 2); SDL_assert(dstfmt->BytesPerPixel == 4); - vf800 = (vector unsigned short) vec_splat_u8(-7); + vf800 = (vector unsigned short)vec_splat_u8(-7); vf800 = vec_sl(vf800, vec_splat_u16(8)); if (dstfmt->Amask && info->a) { - ((unsigned char *) &valpha)[0] = alpha = info->a; + ((unsigned char *)&valpha)[0] = alpha = info->a; valpha = vec_splat(valpha, 0); } else { alpha = 0; @@ -535,22 +513,22 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) int extrawidth; /* do scalar until we can align... */ -#define ONE_PIXEL_BLEND(condition, widthvar) \ - while (condition) { \ - unsigned sR, sG, sB; \ - unsigned short Pixel = *((unsigned short *)src); \ - sR = (Pixel >> 7) & 0xf8; \ - sG = (Pixel >> 2) & 0xf8; \ - sB = (Pixel << 3) & 0xf8; \ - ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \ - src += 2; \ - dst += 4; \ - widthvar--; \ - } +#define ONE_PIXEL_BLEND(condition, widthvar) \ + while (condition) { \ + unsigned sR, sG, sB; \ + unsigned short Pixel = *((unsigned short *)src); \ + sR = (Pixel >> 7) & 0xf8; \ + sG = (Pixel >> 2) & 0xf8; \ + sB = (Pixel << 3) & 0xf8; \ + ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \ + src += 2; \ + dst += 4; \ + widthvar--; \ + } ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width); /* After all that work, here's the vector part! */ - extrawidth = (width % 8); /* trailing unaligned stores */ + extrawidth = (width % 8); /* trailing unaligned stores */ width -= extrawidth; vsrc = vec_ld(0, src); valigner = VEC_ALIGNER(src); @@ -562,23 +540,23 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) voverflow = vec_ld(15, src); vsrc = vec_perm(vsrc, voverflow, valigner); - vR = vec_and(vec_sl((vector unsigned short) vsrc, v1), vf800); - vB = vec_sl((vector unsigned short) vsrc, v3); + vR = vec_and(vec_sl((vector unsigned short)vsrc, v1), vf800); + vB = vec_sl((vector unsigned short)vsrc, v3); vG = vec_sl(vB, v3); vdst1 = - (vector unsigned char) vec_perm((vector unsigned char) vR, - valpha, vredalpha1); - vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1); - vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1); + (vector unsigned char)vec_perm((vector unsigned char)vR, + valpha, vredalpha1); + vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1); + vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1); vdst1 = vec_perm(vdst1, valpha, vpermute); vec_st(vdst1, 0, dst); vdst2 = - (vector unsigned char) vec_perm((vector unsigned char) vR, - valpha, vredalpha2); - vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2); - vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2); + (vector unsigned char)vec_perm((vector unsigned char)vR, + valpha, vredalpha2); + vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2); + vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2); vdst2 = vec_perm(vdst2, valpha, vpermute); vec_st(vdst2, 16, dst); @@ -590,26 +568,23 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info) SDL_assert(width == 0); - /* do scalar until we can align... */ ONE_PIXEL_BLEND((extrawidth), extrawidth); #undef ONE_PIXEL_BLEND - src += srcskip; /* move to next row, accounting for pitch. */ + src += srcskip; /* move to next row, accounting for pitch. */ dst += dstskip; } - } -static void BlitNtoNKey(SDL_BlitInfo * info); -static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info); -static void -Blit32to32KeyAltivec(SDL_BlitInfo * info) +static void BlitNtoNKey(SDL_BlitInfo *info); +static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info); +static void Blit32to32KeyAltivec(SDL_BlitInfo *info) { int height = info->dst_h; - Uint32 *srcp = (Uint32 *) info->src; + Uint32 *srcp = (Uint32 *)info->src; int srcskip = info->src_skip / 4; - Uint32 *dstp = (Uint32 *) info->dst; + Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; SDL_PixelFormat *srcfmt = info->src_fmt; int srcbpp = srcfmt->BytesPerPixel; @@ -635,49 +610,54 @@ Blit32to32KeyAltivec(SDL_BlitInfo * info) } vzero = vec_splat_u8(0); if (alpha) { - ((unsigned char *) &valpha)[0] = (unsigned char) alpha; + ((unsigned char *)&valpha)[0] = (unsigned char)alpha; valpha = - (vector unsigned int) vec_splat((vector unsigned char) valpha, 0); + (vector unsigned int)vec_splat((vector unsigned char)valpha, 0); } else { - valpha = (vector unsigned int) vzero; + valpha = (vector unsigned int)vzero; } ckey &= rgbmask; - ((unsigned int *) (char *) &vckey)[0] = ckey; + ((unsigned int *)(char *)&vckey)[0] = ckey; vckey = vec_splat(vckey, 0); - ((unsigned int *) (char *) &vrgbmask)[0] = rgbmask; + ((unsigned int *)(char *)&vrgbmask)[0] = rgbmask; vrgbmask = vec_splat(vrgbmask, 0); +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + /* reorder bytes for PowerPC little endian */ + vpermute = reorder_ppc64le_vec(vpermute); +#endif + while (height--) { -#define ONE_PIXEL_BLEND(condition, widthvar) \ - if (copy_alpha) { \ - while (condition) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB, sA; \ - DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \ - sR, sG, sB, sA); \ - if ( (Pixel & rgbmask) != ckey ) { \ - ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \ - sR, sG, sB, sA); \ - } \ - dstp = (Uint32 *) (((Uint8 *) dstp) + dstbpp); \ - srcp = (Uint32 *) (((Uint8 *) srcp) + srcbpp); \ - widthvar--; \ - } \ - } else { \ - while (condition) { \ - Uint32 Pixel; \ - unsigned sR, sG, sB; \ - RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \ - if ( Pixel != ckey ) { \ - RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \ - ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \ - sR, sG, sB, alpha); \ - } \ - dstp = (Uint32 *) (((Uint8 *)dstp) + dstbpp); \ - srcp = (Uint32 *) (((Uint8 *)srcp) + srcbpp); \ - widthvar--; \ - } \ - } +#define ONE_PIXEL_BLEND(condition, widthvar) \ + if (copy_alpha) { \ + while (condition) { \ + Uint32 Pixel; \ + unsigned sR, sG, sB, sA; \ + DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \ + sR, sG, sB, sA); \ + if ((Pixel & rgbmask) != ckey) { \ + ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \ + sR, sG, sB, sA); \ + } \ + dstp = (Uint32 *)(((Uint8 *)dstp) + dstbpp); \ + srcp = (Uint32 *)(((Uint8 *)srcp) + srcbpp); \ + widthvar--; \ + } \ + } else { \ + while (condition) { \ + Uint32 Pixel; \ + unsigned sR, sG, sB; \ + RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \ + if (Pixel != ckey) { \ + RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \ + ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \ + sR, sG, sB, alpha); \ + } \ + dstp = (Uint32 *)(((Uint8 *)dstp) + dstbpp); \ + srcp = (Uint32 *)(((Uint8 *)srcp) + srcbpp); \ + widthvar--; \ + } \ + } int width = info->dst_w; ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width); SDL_assert(width > 0); @@ -694,20 +674,16 @@ Blit32to32KeyAltivec(SDL_BlitInfo * info) /* load the source vec */ vs = vec_perm(vs, voverflow, valigner); /* vsel is set for items that match the key */ - vsel = (vector unsigned char) vec_and(vs, vrgbmask); - vsel = (vector unsigned char) vec_cmpeq(vs, vckey); -#if defined(__powerpc__) && (SDL_BYTEORDER == SDL_LIL_ENDIAN) - /* reorder bytes for PowerPC little endian */ - vpermute = reorder_ppc64le_vec(vpermute); -#endif + vsel = (vector unsigned char)vec_and(vs, vrgbmask); + vsel = (vector unsigned char)vec_cmpeq(vs, vckey); /* permute the src vec to the dest format */ vs = vec_perm(vs, valpha, vpermute); /* load the destination vec */ vd = vec_ld(0, dstp); /* select the source and dest into vs */ - vd = (vector unsigned int) vec_sel((vector unsigned char) vs, - (vector unsigned char) vd, - vsel); + vd = (vector unsigned int)vec_sel((vector unsigned char)vs, + (vector unsigned char)vd, + vsel); vec_st(vd, 0, dstp); srcp += 4; @@ -725,13 +701,12 @@ Blit32to32KeyAltivec(SDL_BlitInfo * info) /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */ /* Use this on a G5 */ -static void -ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) +static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info) { int height = info->dst_h; - Uint32 *src = (Uint32 *) info->src; + Uint32 *src = (Uint32 *)info->src; int srcskip = info->src_skip / 4; - Uint32 *dst = (Uint32 *) info->dst; + Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -740,14 +715,19 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) if (dstfmt->Amask && !srcfmt->Amask) { if (info->a) { vector unsigned char valpha; - ((unsigned char *) &valpha)[0] = info->a; - vzero = (vector unsigned int) vec_splat(valpha, 0); + ((unsigned char *)&valpha)[0] = info->a; + vzero = (vector unsigned int)vec_splat(valpha, 0); } } SDL_assert(srcfmt->BytesPerPixel == 4); SDL_assert(dstfmt->BytesPerPixel == 4); +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + /* reorder bytes for PowerPC little endian */ + vpermute = reorder_ppc64le_vec(vpermute); +#endif + while (height--) { vector unsigned char valigner; vector unsigned int vbits; @@ -762,8 +742,8 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) while ((UNALIGNED_PTR(dst)) && (width)) { bits = *(src++); RGBA_FROM_8888(bits, srcfmt, r, g, b, a); - if(!srcfmt->Amask) - a = info->a; + if (!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); width--; } @@ -778,13 +758,9 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) voverflow = vec_ld(15, src); src += 4; width -= 4; - vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ -#if defined(__powerpc__) && (SDL_BYTEORDER == SDL_LIL_ENDIAN) - /* reorder bytes for PowerPC little endian */ - vpermute = reorder_ppc64le_vec(vpermute); -#endif - vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ - vec_st(vbits, 0, dst); /* store it back out. */ + vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ + vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ + vec_st(vbits, 0, dst); /* store it back out. */ dst += 4; vbits = voverflow; } @@ -793,10 +769,10 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) /* cover pixels at the end of the row that didn't fit in 16 bytes. */ while (extrawidth) { - bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ + bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ RGBA_FROM_8888(bits, srcfmt, r, g, b, a); - if(!srcfmt->Amask) - a = info->a; + if (!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); extrawidth--; } @@ -804,21 +780,19 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info) src += srcskip; dst += dstskip; } - } /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */ /* Use this on a G4 */ -static void -ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) +static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info) { const int scalar_dst_lead = sizeof(Uint32) * 4; const int vector_dst_lead = sizeof(Uint32) * 16; int height = info->dst_h; - Uint32 *src = (Uint32 *) info->src; + Uint32 *src = (Uint32 *)info->src; int srcskip = info->src_skip / 4; - Uint32 *dst = (Uint32 *) info->dst; + Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -827,14 +801,19 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) if (dstfmt->Amask && !srcfmt->Amask) { if (info->a) { vector unsigned char valpha; - ((unsigned char *) &valpha)[0] = info->a; - vzero = (vector unsigned int) vec_splat(valpha, 0); + ((unsigned char *)&valpha)[0] = info->a; + vzero = (vector unsigned int)vec_splat(valpha, 0); } } SDL_assert(srcfmt->BytesPerPixel == 4); SDL_assert(dstfmt->BytesPerPixel == 4); +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + /* reorder bytes for PowerPC little endian */ + vpermute = reorder_ppc64le_vec(vpermute); +#endif + while (height--) { vector unsigned char valigner; vector unsigned int vbits; @@ -853,8 +832,8 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) DST_CHAN_DEST); bits = *(src++); RGBA_FROM_8888(bits, srcfmt, r, g, b, a); - if(!srcfmt->Amask) - a = info->a; + if (!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); width--; } @@ -873,13 +852,9 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) voverflow = vec_ld(15, src); src += 4; width -= 4; - vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ -#if defined(__powerpc__) && (SDL_BYTEORDER == SDL_LIL_ENDIAN) - /* reorder bytes for PowerPC little endian */ - vpermute = reorder_ppc64le_vec(vpermute); -#endif - vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ - vec_st(vbits, 0, dst); /* store it back out. */ + vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */ + vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */ + vec_st(vbits, 0, dst); /* store it back out. */ dst += 4; vbits = voverflow; } @@ -888,10 +863,10 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) /* cover pixels at the end of the row that didn't fit in 16 bytes. */ while (extrawidth) { - bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ + bits = *(src++); /* max 7 pixels, don't bother with prefetch. */ RGBA_FROM_8888(bits, srcfmt, r, g, b, a); - if(!srcfmt->Amask) - a = info->a; + if (!srcfmt->Amask) + a = info->a; *(dst++) = MAKE8888(dstfmt, r, g, b, a); extrawidth--; } @@ -904,33 +879,31 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info) vec_dss(DST_CHAN_DEST); } -static enum blit_features -GetBlitFeatures(void) +static enum blit_features GetBlitFeatures(void) { static enum blit_features features = -1; - if (features == (enum blit_features) -1) { + if (features == (enum blit_features) - 1) { /* Provide an override for testing .. */ char *override = SDL_getenv("SDL_ALTIVEC_BLIT_FEATURES"); if (override) { unsigned int features_as_uint = 0; SDL_sscanf(override, "%u", &features_as_uint); - features = (enum blit_features) features_as_uint; + features = (enum blit_features)features_as_uint; } else { features = (0 /* Feature 1 is has-MMX */ - | ((SDL_HasMMX())? BLIT_FEATURE_HAS_MMX : 0) + | ((SDL_HasMMX()) ? BLIT_FEATURE_HAS_MMX : 0) /* Feature 2 is has-AltiVec */ - | ((SDL_HasAltiVec())? BLIT_FEATURE_HAS_ALTIVEC : 0) + | ((SDL_HasAltiVec()) ? BLIT_FEATURE_HAS_ALTIVEC : 0) /* Feature 4 is dont-use-prefetch */ /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */ - | ((GetL3CacheSize() == 0) ? BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH : 0) - ); + | ((GetL3CacheSize() == 0) ? BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH : 0)); } } return features; } -#if __MWERKS__ +#ifdef __MWERKS__ #pragma altivec_model off #endif #else @@ -938,11 +911,10 @@ GetBlitFeatures(void) #define GetBlitFeatures() ((SDL_HasMMX() ? BLIT_FEATURE_HAS_MMX : 0) | (SDL_HasARMSIMD() ? BLIT_FEATURE_HAS_ARM_SIMD : 0)) #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS void Blit_BGR888_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); -static void -Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo * info) +static void Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -956,8 +928,7 @@ Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo * info) void Blit_RGB444_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint16_t *src, int32_t src_stride); -static void -Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo * info) +static void Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo *info) { int32_t width = info->dst_w; int32_t height = info->dst_h; @@ -972,21 +943,21 @@ Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo * info) /* This is now endian dependent */ #if SDL_BYTEORDER == SDL_LIL_ENDIAN -#define HI 1 -#define LO 0 +#define HI 1 +#define LO 0 #else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */ -#define HI 0 -#define LO 1 +#define HI 0 +#define LO 1 #endif /* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */ -#define RGB888_RGB332(dst, src) { \ - dst = (Uint8)((((src)&0x00E00000)>>16)| \ - (((src)&0x0000E000)>>11)| \ - (((src)&0x000000C0)>>6)); \ -} -static void -Blit_RGB888_index8(SDL_BlitInfo * info) +#define RGB888_RGB332(dst, src) \ + { \ + dst = (Uint8)((((src)&0x00E00000) >> 16) | \ + (((src)&0x0000E000) >> 11) | \ + (((src)&0x000000C0) >> 6)); \ + } +static void Blit_RGB888_index8(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -1000,13 +971,13 @@ Blit_RGB888_index8(SDL_BlitInfo * info) /* Set up some basic variables */ width = info->dst_w; height = info->dst_h; - src = (Uint32 *) info->src; + src = (Uint32 *)info->src; srcskip = info->src_skip / 4; dst = info->dst; dstskip = info->dst_skip; map = info->table; - if (map == NULL) { + if (!map) { while (height--) { #ifdef USE_DUFFS_LOOP /* *INDENT-OFF* */ /* clang-format off */ @@ -1029,9 +1000,11 @@ Blit_RGB888_index8(SDL_BlitInfo * info) case 3: RGB888_RGB332(*dst++, *src); ++src; + SDL_FALLTHROUGH; case 2: RGB888_RGB332(*dst++, *src); ++src; + SDL_FALLTHROUGH; case 1: RGB888_RGB332(*dst++, *src); ++src; @@ -1073,10 +1046,12 @@ Blit_RGB888_index8(SDL_BlitInfo * info) RGB888_RGB332(Pixel, *src); *dst++ = map[Pixel]; ++src; + SDL_FALLTHROUGH; case 2: RGB888_RGB332(Pixel, *src); *dst++ = map[Pixel]; ++src; + SDL_FALLTHROUGH; case 1: RGB888_RGB332(Pixel, *src); *dst++ = map[Pixel]; @@ -1090,13 +1065,13 @@ Blit_RGB888_index8(SDL_BlitInfo * info) } /* Special optimized blit for RGB 10-10-10 --> RGB 3-3-2 */ -#define RGB101010_RGB332(dst, src) { \ - dst = (Uint8)((((src)&0x38000000)>>22)| \ - (((src)&0x000E0000)>>15)| \ - (((src)&0x00000300)>>8)); \ -} -static void -Blit_RGB101010_index8(SDL_BlitInfo * info) +#define RGB101010_RGB332(dst, src) \ + { \ + dst = (Uint8)((((src)&0x38000000) >> 22) | \ + (((src)&0x000E0000) >> 15) | \ + (((src)&0x00000300) >> 8)); \ + } +static void Blit_RGB101010_index8(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -1110,13 +1085,13 @@ Blit_RGB101010_index8(SDL_BlitInfo * info) /* Set up some basic variables */ width = info->dst_w; height = info->dst_h; - src = (Uint32 *) info->src; + src = (Uint32 *)info->src; srcskip = info->src_skip / 4; dst = info->dst; dstskip = info->dst_skip; map = info->table; - if (map == NULL) { + if (!map) { while (height--) { #ifdef USE_DUFFS_LOOP /* *INDENT-OFF* */ /* clang-format off */ @@ -1139,9 +1114,11 @@ Blit_RGB101010_index8(SDL_BlitInfo * info) case 3: RGB101010_RGB332(*dst++, *src); ++src; + SDL_FALLTHROUGH; case 2: RGB101010_RGB332(*dst++, *src); ++src; + SDL_FALLTHROUGH; case 1: RGB101010_RGB332(*dst++, *src); ++src; @@ -1183,10 +1160,12 @@ Blit_RGB101010_index8(SDL_BlitInfo * info) RGB101010_RGB332(Pixel, *src); *dst++ = map[Pixel]; ++src; + SDL_FALLTHROUGH; case 2: RGB101010_RGB332(Pixel, *src); *dst++ = map[Pixel]; ++src; + SDL_FALLTHROUGH; case 1: RGB101010_RGB332(Pixel, *src); *dst++ = map[Pixel]; @@ -1200,23 +1179,25 @@ Blit_RGB101010_index8(SDL_BlitInfo * info) } /* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */ -#define RGB888_RGB555(dst, src) { \ - *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \ - (((*src)&0x0000F800)>>6)| \ - (((*src)&0x000000F8)>>3)); \ -} +#define RGB888_RGB555(dst, src) \ + { \ + *(Uint16 *)(dst) = (Uint16)((((*src) & 0x00F80000) >> 9) | \ + (((*src) & 0x0000F800) >> 6) | \ + (((*src) & 0x000000F8) >> 3)); \ + } #ifndef USE_DUFFS_LOOP -#define RGB888_RGB555_TWO(dst, src) { \ - *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \ - (((src[HI])&0x0000F800)>>6)| \ - (((src[HI])&0x000000F8)>>3))<<16)| \ - (((src[LO])&0x00F80000)>>9)| \ - (((src[LO])&0x0000F800)>>6)| \ - (((src[LO])&0x000000F8)>>3); \ -} +#define RGB888_RGB555_TWO(dst, src) \ + { \ + *(Uint32 *)(dst) = (((((src[HI]) & 0x00F80000) >> 9) | \ + (((src[HI]) & 0x0000F800) >> 6) | \ + (((src[HI]) & 0x000000F8) >> 3)) \ + << 16) | \ + (((src[LO]) & 0x00F80000) >> 9) | \ + (((src[LO]) & 0x0000F800) >> 6) | \ + (((src[LO]) & 0x000000F8) >> 3); \ + } #endif -static void -Blit_RGB888_RGB555(SDL_BlitInfo * info) +static void Blit_RGB888_RGB555(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -1229,9 +1210,9 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) /* Set up some basic variables */ width = info->dst_w; height = info->dst_h; - src = (Uint32 *) info->src; + src = (Uint32 *)info->src; srcskip = info->src_skip / 4; - dst = (Uint16 *) info->dst; + dst = (Uint16 *)info->dst; dstskip = info->dst_skip / 2; #ifdef USE_DUFFS_LOOP @@ -1248,7 +1229,7 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) } #else /* Memory align at 4-byte boundary, if necessary */ - if ((long) dst & 0x03) { + if ((long)dst & 0x03) { /* Don't do anything if width is 0 */ if (width == 0) { return; @@ -1276,6 +1257,7 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) RGB888_RGB555(dst, src); ++src; ++dst; + SDL_FALLTHROUGH; case 2: RGB888_RGB555_TWO(dst, src); src += 2; @@ -1307,6 +1289,7 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) RGB888_RGB555(dst, src); ++src; ++dst; + SDL_FALLTHROUGH; case 2: RGB888_RGB555_TWO(dst, src); src += 2; @@ -1326,23 +1309,25 @@ Blit_RGB888_RGB555(SDL_BlitInfo * info) } /* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */ -#define RGB888_RGB565(dst, src) { \ - *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \ - (((*src)&0x0000FC00)>>5)| \ - (((*src)&0x000000F8)>>3)); \ -} +#define RGB888_RGB565(dst, src) \ + { \ + *(Uint16 *)(dst) = (Uint16)((((*src) & 0x00F80000) >> 8) | \ + (((*src) & 0x0000FC00) >> 5) | \ + (((*src) & 0x000000F8) >> 3)); \ + } #ifndef USE_DUFFS_LOOP -#define RGB888_RGB565_TWO(dst, src) { \ - *(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \ - (((src[HI])&0x0000FC00)>>5)| \ - (((src[HI])&0x000000F8)>>3))<<16)| \ - (((src[LO])&0x00F80000)>>8)| \ - (((src[LO])&0x0000FC00)>>5)| \ - (((src[LO])&0x000000F8)>>3); \ -} +#define RGB888_RGB565_TWO(dst, src) \ + { \ + *(Uint32 *)(dst) = (((((src[HI]) & 0x00F80000) >> 8) | \ + (((src[HI]) & 0x0000FC00) >> 5) | \ + (((src[HI]) & 0x000000F8) >> 3)) \ + << 16) | \ + (((src[LO]) & 0x00F80000) >> 8) | \ + (((src[LO]) & 0x0000FC00) >> 5) | \ + (((src[LO]) & 0x000000F8) >> 3); \ + } #endif -static void -Blit_RGB888_RGB565(SDL_BlitInfo * info) +static void Blit_RGB888_RGB565(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -1355,9 +1340,9 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) /* Set up some basic variables */ width = info->dst_w; height = info->dst_h; - src = (Uint32 *) info->src; + src = (Uint32 *)info->src; srcskip = info->src_skip / 4; - dst = (Uint16 *) info->dst; + dst = (Uint16 *)info->dst; dstskip = info->dst_skip / 2; #ifdef USE_DUFFS_LOOP @@ -1374,7 +1359,7 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) } #else /* Memory align at 4-byte boundary, if necessary */ - if ((long) dst & 0x03) { + if ((long)dst & 0x03) { /* Don't do anything if width is 0 */ if (width == 0) { return; @@ -1402,6 +1387,7 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) RGB888_RGB565(dst, src); ++src; ++dst; + SDL_FALLTHROUGH; case 2: RGB888_RGB565_TWO(dst, src); src += 2; @@ -1433,6 +1419,7 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) RGB888_RGB565(dst, src); ++src; ++dst; + SDL_FALLTHROUGH; case 2: RGB888_RGB565_TWO(dst, src); src += 2; @@ -1451,13 +1438,11 @@ Blit_RGB888_RGB565(SDL_BlitInfo * info) #endif /* USE_DUFFS_LOOP */ } - #if SDL_HAVE_BLIT_N_RGB565 /* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */ -#define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1]) -static void -Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) +#define RGB565_32(dst, src, map) (map[src[LO] * 2] + map[src[HI] * 2 + 1]) +static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map) { #ifndef USE_DUFFS_LOOP int c; @@ -1472,7 +1457,7 @@ Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) height = info->dst_h; src = info->src; srcskip = info->src_skip; - dst = (Uint32 *) info->dst; + dst = (Uint32 *)info->dst; dstskip = info->dst_skip / 4; #ifdef USE_DUFFS_LOOP @@ -1506,9 +1491,11 @@ Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) case 3: *dst++ = RGB565_32(dst, src, map); src += 2; + SDL_FALLTHROUGH; case 2: *dst++ = RGB565_32(dst, src, map); src += 2; + SDL_FALLTHROUGH; case 1: *dst++ = RGB565_32(dst, src, map); src += 2; @@ -1520,6 +1507,8 @@ Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map) #endif /* USE_DUFFS_LOOP */ } +/* *INDENT-OFF* */ /* clang-format off */ + /* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */ static const Uint32 RGB565_ARGB8888_LUT[512] = { 0x00000000, 0xff000000, 0x00000008, 0xff002000, @@ -1652,8 +1641,7 @@ static const Uint32 RGB565_ARGB8888_LUT[512] = { 0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200 }; -static void -Blit_RGB565_ARGB8888(SDL_BlitInfo * info) +static void Blit_RGB565_ARGB8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_ARGB8888_LUT); } @@ -1790,8 +1778,7 @@ static const Uint32 RGB565_ABGR8888_LUT[512] = { 0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff }; -static void -Blit_RGB565_ABGR8888(SDL_BlitInfo * info) +static void Blit_RGB565_ABGR8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_ABGR8888_LUT); } @@ -1928,8 +1915,7 @@ static const Uint32 RGB565_RGBA8888_LUT[512] = { 0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000, }; -static void -Blit_RGB565_RGBA8888(SDL_BlitInfo * info) +static void Blit_RGB565_RGBA8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_RGBA8888_LUT); } @@ -2066,23 +2052,23 @@ static const Uint32 RGB565_BGRA8888_LUT[512] = { 0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff }; -static void -Blit_RGB565_BGRA8888(SDL_BlitInfo * info) +static void Blit_RGB565_BGRA8888(SDL_BlitInfo * info) { Blit_RGB565_32(info, RGB565_BGRA8888_LUT); } +/* *INDENT-ON* */ /* clang-format on */ + #endif /* SDL_HAVE_BLIT_N_RGB565 */ /* RGB555->ARGB1555, and BGR555->ABGR1555, SET_ALPHA */ -static void -Blit_RGB555_ARGB1555(SDL_BlitInfo * info) +static void Blit_RGB555_ARGB1555(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint16 *src = (Uint16 *) info->src; + Uint16 *src = (Uint16 *)info->src; int srcskip = info->src_skip; - Uint16 *dst = (Uint16 *) info->dst; + Uint16 *dst = (Uint16 *)info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -2090,7 +2076,7 @@ Blit_RGB555_ARGB1555(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { *dst = *src | mask; ++dst; @@ -2098,13 +2084,12 @@ Blit_RGB555_ARGB1555(SDL_BlitInfo * info) }, width); /* *INDENT-ON* */ /* clang-format on */ - src = (Uint16 *) ((Uint8 *) src + srcskip); - dst = (Uint16 *) ((Uint8 *) dst + dstskip); + src = (Uint16 *)((Uint8 *)src + srcskip); + dst = (Uint16 *)((Uint8 *)dst + dstskip); } } -static void -BlitNto1(SDL_BlitInfo * info) +static void BlitNto1(SDL_BlitInfo *info) { #ifndef USE_DUFFS_LOOP int c; @@ -2130,7 +2115,7 @@ BlitNto1(SDL_BlitInfo * info) srcfmt = info->src_fmt; srcbpp = srcfmt->BytesPerPixel; - if (map == NULL) { + if (!map) { while (height--) { #ifdef USE_DUFFS_LOOP /* *INDENT-OFF* */ /* clang-format off */ @@ -2153,7 +2138,7 @@ BlitNto1(SDL_BlitInfo * info) if (1) { /* Pack RGB into 8bit pixel */ *dst = ((sR >> 5) << (3 + 2)) | - ((sG >> 5) << (2)) | ((sB >> 6) << (0)); + ((sG >> 5) << (2)) | ((sB >> 6) << (0)); } dst++; src += srcbpp; @@ -2198,14 +2183,13 @@ BlitNto1(SDL_BlitInfo * info) } /* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */ -static void -Blit4to4MaskAlpha(SDL_BlitInfo * info) +static void Blit4to4MaskAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *src = (Uint32 *) info->src; + Uint32 *src = (Uint32 *)info->src; int srcskip = info->src_skip; - Uint32 *dst = (Uint32 *) info->dst; + Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; @@ -2216,7 +2200,7 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { *dst = *src | mask; ++dst; @@ -2224,8 +2208,8 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) }, width); /* *INDENT-ON* */ /* clang-format on */ - src = (Uint32 *) ((Uint8 *) src + srcskip); - dst = (Uint32 *) ((Uint8 *) dst + dstskip); + src = (Uint32 *)((Uint8 *)src + srcskip); + dst = (Uint32 *)((Uint8 *)dst + dstskip); } } else { /* RGBA->RGB, NO_ALPHA */ @@ -2233,7 +2217,7 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { *dst = *src & mask; ++dst; @@ -2241,16 +2225,15 @@ Blit4to4MaskAlpha(SDL_BlitInfo * info) }, width); /* *INDENT-ON* */ /* clang-format on */ - src = (Uint32 *) ((Uint8 *) src + srcskip); - dst = (Uint32 *) ((Uint8 *) dst + dstskip); + src = (Uint32 *)((Uint8 *)src + srcskip); + dst = (Uint32 *)((Uint8 *)dst + dstskip); } } } /* permutation for mapping srcfmt to dstfmt, overloading or not the alpha channel */ -static void -get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, - int *_p0 , int *_p1, int *_p2, int *_p3, int *_alpha_channel) +static void get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, + int *_p0, int *_p1, int *_p2, int *_p3, int *_alpha_channel) { int alpha_channel = 0, p0, p1, p2, p3; #if SDL_BYTEORDER == SDL_LIL_ENDIAN @@ -2307,10 +2290,18 @@ get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, #if SDL_BYTEORDER == SDL_LIL_ENDIAN #else if (srcbpp == 3 && dstbpp == 4) { - if (p0 != 1) p0--; - if (p1 != 1) p1--; - if (p2 != 1) p2--; - if (p3 != 1) p3--; + if (p0 != 1) { + p0--; + } + if (p1 != 1) { + p1--; + } + if (p2 != 1) { + p2--; + } + if (p3 != 1) { + p3--; + } } else if (srcbpp == 4 && dstbpp == 3) { p0 = p1; p1 = p2; @@ -2327,9 +2318,7 @@ get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, } } - -static void -BlitNtoN(SDL_BlitInfo * info) +static void BlitNtoN(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -2447,8 +2436,7 @@ BlitNtoN(SDL_BlitInfo * info) } } -static void -BlitNtoNCopyAlpha(SDL_BlitInfo * info) +static void BlitNtoNCopyAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -2505,8 +2493,7 @@ BlitNtoNCopyAlpha(SDL_BlitInfo * info) } } -static void -BlitNto1Key(SDL_BlitInfo * info) +static void BlitNto1Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -2526,7 +2513,7 @@ BlitNto1Key(SDL_BlitInfo * info) srcbpp = srcfmt->BytesPerPixel; ckey &= rgbmask; - if (palmap == NULL) { + if (!palmap) { while (height--) { /* *INDENT-OFF* */ /* clang-format off */ DUFFS_LOOP( @@ -2571,14 +2558,13 @@ BlitNto1Key(SDL_BlitInfo * info) } } -static void -Blit2to2Key(SDL_BlitInfo * info) +static void Blit2to2Key(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint16 *srcp = (Uint16 *) info->src; + Uint16 *srcp = (Uint16 *)info->src; int srcskip = info->src_skip; - Uint16 *dstp = (Uint16 *) info->dst; + Uint16 *dstp = (Uint16 *)info->dst; int dstskip = info->dst_skip; Uint32 ckey = info->colorkey; Uint32 rgbmask = ~info->src_fmt->Amask; @@ -2590,7 +2576,7 @@ Blit2to2Key(SDL_BlitInfo * info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ( (*srcp & rgbmask) != ckey ) { *dstp = *srcp; @@ -2605,8 +2591,7 @@ Blit2to2Key(SDL_BlitInfo * info) } } -static void -BlitNtoNKey(SDL_BlitInfo * info) +static void BlitNtoNKey(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -2629,15 +2614,15 @@ BlitNtoNKey(SDL_BlitInfo * info) /* BPP 4, same rgb */ if (srcbpp == 4 && dstbpp == 4 && srcfmt->Rmask == dstfmt->Rmask && srcfmt->Gmask == dstfmt->Gmask && srcfmt->Bmask == dstfmt->Bmask) { - Uint32 *src32 = (Uint32*)src; - Uint32 *dst32 = (Uint32*)dst; + Uint32 *src32 = (Uint32 *)src; + Uint32 *dst32 = (Uint32 *)dst; if (dstfmt->Amask) { /* RGB->RGBA, SET_ALPHA */ Uint32 mask = ((Uint32)info->a) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ((*src32 & rgbmask) != ckey) { *dst32 = *src32 | mask; @@ -2646,8 +2631,8 @@ BlitNtoNKey(SDL_BlitInfo * info) ++src32; }, width); /* *INDENT-ON* */ /* clang-format on */ - src32 = (Uint32 *) ((Uint8 *) src32 + srcskip); - dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip); + src32 = (Uint32 *)((Uint8 *)src32 + srcskip); + dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip); } return; } else { @@ -2655,7 +2640,7 @@ BlitNtoNKey(SDL_BlitInfo * info) Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ((*src32 & rgbmask) != ckey) { *dst32 = *src32 & mask; @@ -2664,8 +2649,8 @@ BlitNtoNKey(SDL_BlitInfo * info) ++src32; }, width); /* *INDENT-ON* */ /* clang-format on */ - src32 = (Uint32 *) ((Uint8 *) src32 + srcskip); - dst32 = (Uint32 *) ((Uint8 *) dst32 + dstskip); + src32 = (Uint32 *)((Uint8 *)src32 + srcskip); + dst32 = (Uint32 *)((Uint8 *)dst32 + dstskip); } return; } @@ -2711,7 +2696,7 @@ BlitNtoNKey(SDL_BlitInfo * info) #if SDL_BYTEORDER == SDL_LIL_ENDIAN Uint8 k0 = ckey & 0xFF; - Uint8 k1 = (ckey >> 8) & 0xFF; + Uint8 k1 = (ckey >> 8) & 0xFF; Uint8 k2 = (ckey >> 16) & 0xFF; #else Uint8 k0 = (ckey >> 16) & 0xFF; @@ -2749,7 +2734,7 @@ BlitNtoNKey(SDL_BlitInfo * info) #if SDL_BYTEORDER == SDL_LIL_ENDIAN Uint8 k0 = ckey & 0xFF; - Uint8 k1 = (ckey >> 8) & 0xFF; + Uint8 k1 = (ckey >> 8) & 0xFF; Uint8 k2 = (ckey >> 16) & 0xFF; #else Uint8 k0 = (ckey >> 16) & 0xFF; @@ -2816,12 +2801,12 @@ BlitNtoNKey(SDL_BlitInfo * info) #if SDL_BYTEORDER == SDL_LIL_ENDIAN Uint8 k0 = ckey & 0xFF; - Uint8 k1 = (ckey >> 8) & 0xFF; + Uint8 k1 = (ckey >> 8) & 0xFF; Uint8 k2 = (ckey >> 16) & 0xFF; #else Uint8 k0 = (ckey >> 16) & 0xFF; Uint8 k1 = (ckey >> 8) & 0xFF; - Uint8 k2 = ckey & 0xFF; + Uint8 k2 = ckey & 0xFF; #endif /* Find the appropriate permutation */ @@ -2877,8 +2862,7 @@ BlitNtoNKey(SDL_BlitInfo * info) } } -static void -BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info) +static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -2909,11 +2893,11 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info) srcfmt->format == SDL_PIXELFORMAT_BGRA8888 || srcfmt->format == SDL_PIXELFORMAT_RGBA8888) { - Uint32 *src32 = (Uint32*)src; - Uint32 *dst32 = (Uint32*)dst; + Uint32 *src32 = (Uint32 *)src; + Uint32 *dst32 = (Uint32 *)dst; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP( + DUFFS_LOOP_TRIVIAL( { if ((*src32 & rgbmask) != ckey) { *dst32 = *src32; @@ -2981,8 +2965,7 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info) } /* Special optimized blit for ARGB 2-10-10-10 --> RGBA */ -static void -Blit2101010toN(SDL_BlitInfo * info) +static void Blit2101010toN(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -3013,8 +2996,7 @@ Blit2101010toN(SDL_BlitInfo * info) } /* Special optimized blit for RGBA --> ARGB 2-10-10-10 */ -static void -BlitNto2101010(SDL_BlitInfo * info) +static void BlitNto2101010(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -3045,8 +3027,7 @@ BlitNto2101010(SDL_BlitInfo * info) } /* Blit_3or4_to_3or4__same_rgb: 3 or 4 bpp, same RGB triplet */ -static void -Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo * info) +static void Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -3119,8 +3100,7 @@ Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo * info) } /* Blit_3or4_to_3or4__inversed_rgb: 3 or 4 bpp, inversed RGB triplet */ -static void -Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo * info) +static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -3233,126 +3213,126 @@ struct blit_table Uint32 dstR, dstG, dstB; enum blit_features blit_features; SDL_BlitFunc blitfunc; - Uint32 alpha; /* bitwise NO_ALPHA, SET_ALPHA, COPY_ALPHA */ + Uint32 alpha; /* bitwise NO_ALPHA, SET_ALPHA, COPY_ALPHA */ }; static const struct blit_table normal_blit_1[] = { /* Default for 8-bit RGB source, never optimized */ - {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} + { 0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0 } }; static const struct blit_table normal_blit_2[] = { -#if SDL_ALTIVEC_BLITTERS +#ifdef SDL_ALTIVEC_BLITTERS /* has-altivec */ - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, - BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, - BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, + BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + { 0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000, 0x00000000, + BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, #endif -#if SDL_ARM_SIMD_BLITTERS - {0x00000F00, 0x000000F0, 0x0000000F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - BLIT_FEATURE_HAS_ARM_SIMD, Blit_RGB444_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA}, +#ifdef SDL_ARM_SIMD_BLITTERS + { 0x00000F00, 0x000000F0, 0x0000000F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + BLIT_FEATURE_HAS_ARM_SIMD, Blit_RGB444_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA }, #endif #if SDL_HAVE_BLIT_N_RGB565 - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00, - 0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, - {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000, - 0, Blit_RGB565_BGRA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_RGB565_ARGB8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_RGB565_ABGR8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000, 0x0000FF00, + 0, Blit_RGB565_RGBA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, + { 0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000, 0xFF000000, + 0, Blit_RGB565_BGRA8888, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, #endif - {0x00007C00, 0x000003E0, 0x0000001F, 2, 0x00007C00, 0x000003E0, 0x0000001F, - 0, Blit_RGB555_ARGB1555, SET_ALPHA}, - {0x0000001F, 0x000003E0, 0x00007C00, 2, 0x0000001F, 0x000003E0, 0x00007C00, - 0, Blit_RGB555_ARGB1555, SET_ALPHA}, + { 0x00007C00, 0x000003E0, 0x0000001F, 2, 0x00007C00, 0x000003E0, 0x0000001F, + 0, Blit_RGB555_ARGB1555, SET_ALPHA }, + { 0x0000001F, 0x000003E0, 0x00007C00, 2, 0x0000001F, 0x000003E0, 0x00007C00, + 0, Blit_RGB555_ARGB1555, SET_ALPHA }, /* Default for 16-bit RGB source, used if no other blitter matches */ - {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} + { 0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0 } }; static const struct blit_table normal_blit_3[] = { /* 3->4 with same rgb triplet */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__same_rgb, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__same_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__same_rgb, + SET_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__same_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA}, + SET_ALPHA }, /* 3->4 with inversed rgb triplet */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__inversed_rgb, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__inversed_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__inversed_rgb, + SET_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__inversed_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA}, + SET_ALPHA }, /* 3->3 to switch RGB 24 <-> BGR 24 */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA }, - {0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA }, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA }, /* Default for 24-bit RGB source, never optimized */ - {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} + { 0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0 } }; static const struct blit_table normal_blit_4[] = { -#if SDL_ALTIVEC_BLITTERS +#ifdef SDL_ALTIVEC_BLITTERS /* has-altivec | dont-use-prefetch */ - {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, - BLIT_FEATURE_HAS_ALTIVEC | BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + { 0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, + BLIT_FEATURE_HAS_ALTIVEC | BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, /* has-altivec */ - {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, - BLIT_FEATURE_HAS_ALTIVEC, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA}, + { 0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000, 0x00000000, + BLIT_FEATURE_HAS_ALTIVEC, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA }, /* has-altivec */ - {0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F, - BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB888_RGB565Altivec, NO_ALPHA}, + { 0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0, 0x0000001F, + BLIT_FEATURE_HAS_ALTIVEC, Blit_RGB888_RGB565Altivec, NO_ALPHA }, #endif -#if SDL_ARM_SIMD_BLITTERS - {0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - BLIT_FEATURE_HAS_ARM_SIMD, Blit_BGR888_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA }, +#ifdef SDL_ARM_SIMD_BLITTERS + { 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + BLIT_FEATURE_HAS_ARM_SIMD, Blit_BGR888_RGB888ARMSIMD, NO_ALPHA | COPY_ALPHA }, #endif /* 4->3 with same rgb triplet */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__same_rgb, NO_ALPHA | SET_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__same_rgb, NO_ALPHA | SET_ALPHA}, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__same_rgb, NO_ALPHA | SET_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__same_rgb, NO_ALPHA | SET_ALPHA }, /* 4->3 with inversed rgb triplet */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA | SET_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA | SET_ALPHA}, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 3, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA | SET_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__inversed_rgb, NO_ALPHA | SET_ALPHA }, /* 4->4 with inversed rgb triplet, and COPY_ALPHA to switch ABGR8888 <-> ARGB8888 */ - {0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, - 0, Blit_3or4_to_3or4__inversed_rgb, + { 0x000000FF, 0x0000FF00, 0x00FF0000, 4, 0x00FF0000, 0x0000FF00, 0x000000FF, + 0, Blit_3or4_to_3or4__inversed_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA | COPY_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, - 0, Blit_3or4_to_3or4__inversed_rgb, + SET_ALPHA | COPY_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x000000FF, 0x0000FF00, 0x00FF0000, + 0, Blit_3or4_to_3or4__inversed_rgb, #if HAVE_FAST_WRITE_INT8 - NO_ALPHA | + NO_ALPHA | #endif - SET_ALPHA | COPY_ALPHA}, + SET_ALPHA | COPY_ALPHA }, /* RGB 888 and RGB 565 */ - {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F, - 0, Blit_RGB888_RGB565, NO_ALPHA}, - {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F, - 0, Blit_RGB888_RGB555, NO_ALPHA}, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0, 0x0000001F, + 0, Blit_RGB888_RGB565, NO_ALPHA }, + { 0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0, 0x0000001F, + 0, Blit_RGB888_RGB555, NO_ALPHA }, /* Default for 32-bit RGB source, used if no other blitter matches */ - {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0} + { 0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0 } }; static const struct blit_table *const normal_blit[] = { @@ -3362,8 +3342,7 @@ static const struct blit_table *const normal_blit[] = { /* Mask matches table, or table entry is zero */ #define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000)) -SDL_BlitFunc -SDL_CalculateBlitN(SDL_Surface * surface) +SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface) { SDL_PixelFormat *srcfmt; SDL_PixelFormat *dstfmt; @@ -3377,7 +3356,7 @@ SDL_CalculateBlitN(SDL_Surface * surface) /* We don't support destinations less than 8-bits */ if (dstfmt->BitsPerPixel < 8) { - return (NULL); + return NULL; } switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { @@ -3390,9 +3369,9 @@ SDL_CalculateBlitN(SDL_Surface * surface) (srcfmt->Bmask == 0x000000FF)) { blitfun = Blit_RGB888_index8; } else if ((srcfmt->BytesPerPixel == 4) && - (srcfmt->Rmask == 0x3FF00000) && - (srcfmt->Gmask == 0x000FFC00) && - (srcfmt->Bmask == 0x000003FF)) { + (srcfmt->Rmask == 0x3FF00000) && + (srcfmt->Gmask == 0x000FFC00) && + (srcfmt->Bmask == 0x000003FF)) { blitfun = Blit_RGB101010_index8; } else { blitfun = BlitNto1; @@ -3400,8 +3379,9 @@ SDL_CalculateBlitN(SDL_Surface * surface) } else { /* Now the meat, choose the blitter we want */ Uint32 a_need = NO_ALPHA; - if (dstfmt->Amask) + if (dstfmt->Amask) { a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA; + } table = normal_blit[srcfmt->BytesPerPixel - 1]; for (which = 0; table[which].dstbpp; ++which) { if (MASKOK(srcfmt->Rmask, table[which].srcR) && @@ -3413,21 +3393,22 @@ SDL_CalculateBlitN(SDL_Surface * surface) dstfmt->BytesPerPixel == table[which].dstbpp && (a_need & table[which].alpha) == a_need && ((table[which].blit_features & GetBlitFeatures()) == - table[which].blit_features)) + table[which].blit_features)) { break; + } } blitfun = table[which].blitfunc; - if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */ + if (blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */ if (srcfmt->format == SDL_PIXELFORMAT_ARGB2101010) { blitfun = Blit2101010toN; } else if (dstfmt->format == SDL_PIXELFORMAT_ARGB2101010) { blitfun = BlitNto2101010; } else if (srcfmt->BytesPerPixel == 4 && - dstfmt->BytesPerPixel == 4 && - srcfmt->Rmask == dstfmt->Rmask && - srcfmt->Gmask == dstfmt->Gmask && - srcfmt->Bmask == dstfmt->Bmask) { + dstfmt->BytesPerPixel == 4 && + srcfmt->Rmask == dstfmt->Rmask && + srcfmt->Gmask == dstfmt->Gmask && + srcfmt->Bmask == dstfmt->Bmask) { if (a_need == COPY_ALPHA) { if (srcfmt->Amask == dstfmt->Amask) { /* Fastpath C fallback: 32bit RGBA<->RGBA blit with matching RGBA */ @@ -3444,25 +3425,24 @@ SDL_CalculateBlitN(SDL_Surface * surface) } } } - return (blitfun); + return blitfun; case SDL_COPY_COLORKEY: /* colorkey blit: Here we don't have too many options, mostly because RLE is the preferred fast way to deal with this. If a particular case turns out to be useful we'll add it. */ - if (srcfmt->BytesPerPixel == 2 && surface->map->identity) + if (srcfmt->BytesPerPixel == 2 && surface->map->identity != 0) { return Blit2to2Key; - else if (dstfmt->BytesPerPixel == 1) + } else if (dstfmt->BytesPerPixel == 1) { return BlitNto1Key; - else { -#if SDL_ALTIVEC_BLITTERS - if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) - && SDL_HasAltiVec()) { + } else { +#ifdef SDL_ALTIVEC_BLITTERS + if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) { return Blit32to32KeyAltivec; } else #endif - if (srcfmt->Amask && dstfmt->Amask) { + if (srcfmt->Amask && dstfmt->Amask) { return BlitNtoNKeyCopyAlpha; } else { return BlitNtoNKey; diff --git a/src/video/SDL_blit_auto.c b/src/video/SDL_blit_auto.c index f15a4362228f1..e7a25e7a44f4b 100644 --- a/src/video/SDL_blit_auto.c +++ b/src/video/SDL_blit_auto.c @@ -1,7 +1,7 @@ /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,12 +31,12 @@ static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info) { - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -114,12 +114,12 @@ static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -207,12 +207,12 @@ static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -321,12 +321,12 @@ static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -392,12 +392,12 @@ static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -478,12 +478,12 @@ static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -571,12 +571,12 @@ static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -685,12 +685,12 @@ static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -756,12 +756,12 @@ static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; const Uint32 A = 0xFF; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -823,7 +823,6 @@ static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = (srcR * dstR) / 255; dstG = (srcG * dstG) / 255; dstB = (srcB * dstB) / 255; - dstA = 0xFF; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -843,12 +842,12 @@ static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -886,7 +885,6 @@ static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = (srcR * dstR) / 255; dstG = (srcG * dstG) / 255; dstB = (srcB * dstB) / 255; - dstA = 0xFF; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -942,12 +940,12 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) Uint32 pixel; const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1033,7 +1031,6 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1058,12 +1055,12 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1114,7 +1111,6 @@ static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1131,12 +1127,12 @@ static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1217,12 +1213,12 @@ static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1310,12 +1306,12 @@ static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1424,12 +1420,12 @@ static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1493,12 +1489,12 @@ static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info) { - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1576,12 +1572,12 @@ static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1669,12 +1665,12 @@ static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1783,12 +1779,12 @@ static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1855,12 +1851,12 @@ static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info) Uint32 pixel; const Uint32 A = 0xFF; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1923,7 +1919,6 @@ static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = (srcR * dstR) / 255; dstG = (srcG * dstG) / 255; dstB = (srcB * dstB) / 255; - dstA = 0xFF; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1943,12 +1938,12 @@ static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -1986,7 +1981,6 @@ static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = (srcR * dstR) / 255; dstG = (srcG * dstG) / 255; dstB = (srcB * dstB) / 255; - dstA = 0xFF; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2042,12 +2036,12 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) Uint32 pixel; const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2133,7 +2127,6 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2158,12 +2151,12 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2214,7 +2207,6 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2230,12 +2222,12 @@ static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2323,12 +2315,12 @@ static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2424,12 +2416,12 @@ static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2539,12 +2531,12 @@ static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2613,12 +2605,12 @@ static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2707,12 +2699,12 @@ static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2808,12 +2800,12 @@ static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2923,12 +2915,12 @@ static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -2995,12 +2987,12 @@ static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) { - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3068,7 +3060,6 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3088,12 +3079,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3139,7 +3130,6 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3196,12 +3186,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateA = info->a; Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3292,7 +3282,6 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3316,12 +3305,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3375,7 +3364,6 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3391,12 +3379,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3484,12 +3472,12 @@ static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3585,12 +3573,12 @@ static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3700,12 +3688,12 @@ static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3774,12 +3762,12 @@ static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3868,12 +3856,12 @@ static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -3969,12 +3957,12 @@ static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4084,12 +4072,12 @@ static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4157,12 +4145,12 @@ static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4232,7 +4220,6 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4252,12 +4239,12 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4303,7 +4290,6 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4360,12 +4346,12 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateA = info->a; Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4456,7 +4442,6 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4480,12 +4465,12 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4539,7 +4524,6 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4556,12 +4540,12 @@ static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4650,12 +4634,12 @@ static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4751,12 +4735,12 @@ static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4866,12 +4850,12 @@ static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -4939,12 +4923,12 @@ static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5032,12 +5016,12 @@ static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5133,12 +5117,12 @@ static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5248,12 +5232,12 @@ static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5322,12 +5306,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5398,7 +5382,6 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5418,12 +5401,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5469,7 +5452,6 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5526,12 +5508,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateA = info->a; Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5622,7 +5604,6 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5646,12 +5627,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5705,7 +5686,6 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5722,12 +5702,12 @@ static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5816,12 +5796,12 @@ static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -5917,12 +5897,12 @@ static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6032,12 +6012,12 @@ static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6105,12 +6085,12 @@ static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info) static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6198,12 +6178,12 @@ static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6299,12 +6279,12 @@ static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; Uint32 pixel; Uint32 R, G, B; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6414,12 +6394,12 @@ static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6488,12 +6468,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6564,7 +6544,6 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6584,12 +6563,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6635,7 +6614,6 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6692,12 +6670,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateA = info->a; Uint32 pixel; Uint32 R, G, B, A; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6788,7 +6766,6 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6812,12 +6789,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { @@ -6871,7 +6848,6 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; diff --git a/src/video/SDL_blit_auto.h b/src/video/SDL_blit_auto.h index 9203e4f9b8030..3f76c7ee73281 100644 --- a/src/video/SDL_blit_auto.h +++ b/src/video/SDL_blit_auto.h @@ -1,7 +1,7 @@ /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,11 +23,11 @@ #if SDL_HAVE_BLIT_AUTO -/* *INDENT-OFF* */ +/* *INDENT-OFF* */ /* clang-format off */ extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]; -/* *INDENT-ON* */ +/* *INDENT-ON* */ /* clang-format on */ #endif /* SDL_HAVE_BLIT_AUTO */ diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c index 0223d9a1619fe..4559c010019b0 100644 --- a/src/video/SDL_blit_copy.c +++ b/src/video/SDL_blit_copy.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,48 +24,46 @@ #include "SDL_blit.h" #include "SDL_blit_copy.h" - #ifdef __SSE__ /* This assumes 16-byte aligned src and dst */ -static SDL_INLINE void -SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len) +static SDL_INLINE void SDL_memcpySSE(Uint8 *dst, const Uint8 *src, int len) { int i; __m128 values[4]; for (i = len / 64; i--;) { _mm_prefetch((const char *)src, _MM_HINT_NTA); - values[0] = *(__m128 *) (src + 0); - values[1] = *(__m128 *) (src + 16); - values[2] = *(__m128 *) (src + 32); - values[3] = *(__m128 *) (src + 48); - _mm_stream_ps((float *) (dst + 0), values[0]); - _mm_stream_ps((float *) (dst + 16), values[1]); - _mm_stream_ps((float *) (dst + 32), values[2]); - _mm_stream_ps((float *) (dst + 48), values[3]); + values[0] = *(__m128 *)(src + 0); + values[1] = *(__m128 *)(src + 16); + values[2] = *(__m128 *)(src + 32); + values[3] = *(__m128 *)(src + 48); + _mm_stream_ps((float *)(dst + 0), values[0]); + _mm_stream_ps((float *)(dst + 16), values[1]); + _mm_stream_ps((float *)(dst + 32), values[2]); + _mm_stream_ps((float *)(dst + 48), values[3]); src += 64; dst += 64; } - if (len & 63) + if (len & 63) { SDL_memcpy(dst, src, len & 63); + } } #endif /* __SSE__ */ #ifdef __MMX__ #ifdef _MSC_VER -#pragma warning(disable:4799) +#pragma warning(disable : 4799) #endif -static SDL_INLINE void -SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len) +static SDL_INLINE void SDL_memcpyMMX(Uint8 *dst, const Uint8 *src, int len) { - const int remain = (len & 63); + int remain = len & 63; int i; - __m64* d64 = (__m64*)dst; - __m64* s64 = (__m64*)src; + __m64 *d64 = (__m64 *)dst; + __m64 *s64 = (__m64 *)src; - for(i= len / 64; i--;) { + for (i = len / 64; i--;) { d64[0] = s64[0]; d64[1] = s64[1]; d64[2] = s64[2]; @@ -79,16 +77,18 @@ SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len) s64 += 8; } - if (remain) - { + if (remain) { const int skip = len - remain; - SDL_memcpy(dst + skip, src + skip, remain); + dst += skip; + src += skip; + while (remain--) { + *dst++ = *src++; + } } } #endif /* __MMX__ */ -void -SDL_BlitCopy(SDL_BlitInfo * info) +void SDL_BlitCopy(SDL_BlitInfo *info) { SDL_bool overlap; Uint8 *src, *dst; @@ -104,33 +104,33 @@ SDL_BlitCopy(SDL_BlitInfo * info) /* Properly handle overlapping blits */ if (src < dst) { - overlap = (dst < (src + h*srcskip)); + overlap = (dst < (src + h * srcskip)); } else { - overlap = (src < (dst + h*dstskip)); + overlap = (src < (dst + h * dstskip)); } if (overlap) { - if ( dst < src ) { - while ( h-- ) { - SDL_memmove(dst, src, w); - src += srcskip; - dst += dstskip; - } + if (dst < src) { + while (h--) { + SDL_memmove(dst, src, w); + src += srcskip; + dst += dstskip; + } } else { - src += ((h-1) * srcskip); - dst += ((h-1) * dstskip); - while ( h-- ) { - SDL_memmove(dst, src, w); - src -= srcskip; - dst -= dstskip; - } + src += ((h - 1) * srcskip); + dst += ((h - 1) * dstskip); + while (h--) { + SDL_memmove(dst, src, w); + src -= srcskip; + dst -= dstskip; + } } return; } #ifdef __SSE__ if (SDL_HasSSE() && - !((uintptr_t) src & 15) && !(srcskip & 15) && - !((uintptr_t) dst & 15) && !(dstskip & 15)) { + !((uintptr_t)src & 15) && !(srcskip & 15) && + !((uintptr_t)dst & 15) && !(dstskip & 15)) { while (h--) { SDL_memcpySSE(dst, src, w); src += srcskip; diff --git a/src/video/SDL_blit_copy.h b/src/video/SDL_blit_copy.h index 24ced5241776a..40a0dda4db667 100644 --- a/src/video/SDL_blit_copy.h +++ b/src/video/SDL_blit_copy.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_blit_copy_h_ #define SDL_blit_copy_h_ -void SDL_BlitCopy(SDL_BlitInfo * info); +void SDL_BlitCopy(SDL_BlitInfo *info); #endif /* SDL_blit_copy_h_ */ diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index ed9c692b16091..2cdca1c482b6a 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,12 +24,13 @@ #include "SDL_blit.h" #include "SDL_blit_slow.h" -#define FORMAT_ALPHA 0 -#define FORMAT_NO_ALPHA -1 -#define FORMAT_2101010 1 -#define FORMAT_HAS_ALPHA(format) format == 0 -#define FORMAT_HAS_NO_ALPHA(format) format < 0 -static int SDL_INLINE detect_format(SDL_PixelFormat *pf) { +#define FORMAT_ALPHA 0 +#define FORMAT_NO_ALPHA -1 +#define FORMAT_2101010 1 +#define FORMAT_HAS_ALPHA(format) format == 0 +#define FORMAT_HAS_NO_ALPHA(format) format < 0 +static int SDL_INLINE detect_format(SDL_PixelFormat *pf) +{ if (pf->format == SDL_PIXELFORMAT_ARGB2101010) { return FORMAT_2101010; } else if (pf->Amask) { @@ -42,8 +43,7 @@ static int SDL_INLINE detect_format(SDL_PixelFormat *pf) { /* The ONE TRUE BLITTER * This puppy has to handle all the unoptimized cases - yes, it's slow. */ -void -SDL_Blit_Slow(SDL_BlitInfo * info) +void SDL_Blit_Slow(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -54,9 +54,9 @@ SDL_Blit_Slow(SDL_BlitInfo * info) Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; SDL_PixelFormat *src_fmt = info->src_fmt; SDL_PixelFormat *dst_fmt = info->dst_fmt; int srcbpp = src_fmt->BytesPerPixel; @@ -69,8 +69,8 @@ SDL_Blit_Slow(SDL_BlitInfo * info) srcfmt_val = detect_format(src_fmt); dstfmt_val = detect_format(dst_fmt); - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; /* start at the middle of pixel */ while (info->dst_h--) { @@ -98,7 +98,7 @@ SDL_Blit_Slow(SDL_BlitInfo * info) /* srcpixel isn't set for 24 bpp */ if (srcbpp == 3) { srcpixel = (srcR << src_fmt->Rshift) | - (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift); + (srcG << src_fmt->Gshift) | (srcB << src_fmt->Bshift); } if ((srcpixel & rgbmask) == ckey) { posx += incx; @@ -106,15 +106,20 @@ SDL_Blit_Slow(SDL_BlitInfo * info) continue; } } - if (FORMAT_HAS_ALPHA(dstfmt_val)) { - DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA); - } else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) { - DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); - dstA = 0xFF; + if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) { + if (FORMAT_HAS_ALPHA(dstfmt_val)) { + DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA); + } else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) { + DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); + dstA = 0xFF; + } else { + /* SDL_PIXELFORMAT_ARGB2101010 */ + dstpixel = *((Uint32 *) (dst)); + RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA); + } } else { - /* SDL_PIXELFORMAT_ARGB2101010 */ - dstpixel = *((Uint32 *)(dst)); - RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA); + /* don't care */ + dstR = dstG = dstB = dstA = 0; } if (flags & SDL_COPY_MODULATE_COLOR) { @@ -148,14 +153,17 @@ SDL_Blit_Slow(SDL_BlitInfo * info) break; case SDL_COPY_ADD: dstR = srcR + dstR; - if (dstR > 255) + if (dstR > 255) { dstR = 255; + } dstG = srcG + dstG; - if (dstG > 255) + if (dstG > 255) { dstG = 255; + } dstB = srcB + dstB; - if (dstB > 255) + if (dstB > 255) { dstB = 255; + } break; case SDL_COPY_MOD: dstR = (srcR * dstR) / 255; @@ -164,17 +172,17 @@ SDL_Blit_Slow(SDL_BlitInfo * info) break; case SDL_COPY_MUL: dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; - if (dstR > 255) + if (dstR > 255) { dstR = 255; + } dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; - if (dstG > 255) + if (dstG > 255) { dstG = 255; + } dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; - if (dstB > 255) + if (dstB > 255) { dstB = 255; - dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; - if (dstA > 255) - dstA = 255; + } break; } if (FORMAT_HAS_ALPHA(dstfmt_val)) { diff --git a/src/video/SDL_blit_slow.h b/src/video/SDL_blit_slow.h index cb5388a3e2a8e..76d173fab96dc 100644 --- a/src/video/SDL_blit_slow.h +++ b/src/video/SDL_blit_slow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ #include "../SDL_internal.h" -extern void SDL_Blit_Slow(SDL_BlitInfo * info); +extern void SDL_Blit_Slow(SDL_BlitInfo *info); #endif /* SDL_blit_slow_h_ */ diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 369b925a67e83..292a061f45e54 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,19 +41,19 @@ /* Compression encodings for BMP files */ #ifndef BI_RGB -#define BI_RGB 0 -#define BI_RLE8 1 -#define BI_RLE4 2 -#define BI_BITFIELDS 3 +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 +#define BI_BITFIELDS 3 #endif /* Logical color space values for BMP files */ #ifndef LCS_WINDOWS_COLOR_SPACE /* 0x57696E20 == "Win " */ -#define LCS_WINDOWS_COLOR_SPACE 0x57696E20 +#define LCS_WINDOWS_COLOR_SPACE 0x57696E20 #endif -static SDL_bool readRlePixels(SDL_Surface * surface, SDL_RWops * src, int isRle8) +static SDL_bool readRlePixels(SDL_Surface *surface, SDL_RWops *src, int isRle8) { /* | Sets the surface pixels from src. A bmp image is upside down. @@ -61,35 +61,46 @@ static SDL_bool readRlePixels(SDL_Surface * surface, SDL_RWops * src, int isRle8 int pitch = surface->pitch; int height = surface->h; Uint8 *start = (Uint8 *)surface->pixels; - Uint8 *end = start + (height*pitch); - Uint8 *bits = end-pitch, *spot; + Uint8 *end = start + (height * pitch); + Uint8 *bits = end - pitch, *spot; int ofs = 0; Uint8 ch; Uint8 needsPad; -#define COPY_PIXEL(x) spot = &bits[ofs++]; if(spot >= start && spot < end) *spot = (x) +#define COPY_PIXEL(x) \ + spot = &bits[ofs++]; \ + if (spot >= start && spot < end) \ + *spot = (x) for (;;) { - if (!SDL_RWread(src, &ch, 1, 1)) return SDL_TRUE; + if (!SDL_RWread(src, &ch, 1, 1)) { + return SDL_TRUE; + } /* | encoded mode starts with a run length, and then a byte | with two colour indexes to alternate between for the run */ if (ch) { Uint8 pixel; - if (!SDL_RWread(src, &pixel, 1, 1)) return SDL_TRUE; - if (isRle8) { /* 256-color bitmap, compressed */ + if (!SDL_RWread(src, &pixel, 1, 1)) { + return SDL_TRUE; + } + if (isRle8) { /* 256-color bitmap, compressed */ do { COPY_PIXEL(pixel); } while (--ch); - } else { /* 16-color bitmap, compressed */ + } else { /* 16-color bitmap, compressed */ Uint8 pixel0 = pixel >> 4; Uint8 pixel1 = pixel & 0x0F; for (;;) { COPY_PIXEL(pixel0); /* even count, high nibble */ - if (!--ch) break; + if (!--ch) { + break; + } COPY_PIXEL(pixel1); /* odd count, low nibble */ - if (!--ch) break; + if (!--ch) { + break; + } } } } else { @@ -98,41 +109,57 @@ static SDL_bool readRlePixels(SDL_Surface * surface, SDL_RWops * src, int isRle8 | a cursor move, or some absolute data. | zero tag may be absolute mode or an escape */ - if (!SDL_RWread(src, &ch, 1, 1)) return SDL_TRUE; + if (!SDL_RWread(src, &ch, 1, 1)) { + return SDL_TRUE; + } switch (ch) { - case 0: /* end of line */ + case 0: /* end of line */ ofs = 0; - bits -= pitch; /* go to previous */ + bits -= pitch; /* go to previous */ break; - case 1: /* end of bitmap */ - return SDL_FALSE; /* success! */ - case 2: /* delta */ - if (!SDL_RWread(src, &ch, 1, 1)) return SDL_TRUE; + case 1: /* end of bitmap */ + return SDL_FALSE; /* success! */ + case 2: /* delta */ + if (!SDL_RWread(src, &ch, 1, 1)) { + return SDL_TRUE; + } ofs += ch; - if (!SDL_RWread(src, &ch, 1, 1)) return SDL_TRUE; + if (!SDL_RWread(src, &ch, 1, 1)) { + return SDL_TRUE; + } bits -= (ch * pitch); break; - default: /* no compression */ + default: /* no compression */ if (isRle8) { needsPad = (ch & 1); do { Uint8 pixel; - if (!SDL_RWread(src, &pixel, 1, 1)) return SDL_TRUE; + if (!SDL_RWread(src, &pixel, 1, 1)) { + return SDL_TRUE; + } COPY_PIXEL(pixel); } while (--ch); } else { - needsPad = (((ch+1)>>1) & 1); /* (ch+1)>>1: bytes size */ + needsPad = (((ch + 1) >> 1) & 1); /* (ch+1)>>1: bytes size */ for (;;) { Uint8 pixel; - if (!SDL_RWread(src, &pixel, 1, 1)) return SDL_TRUE; + if (!SDL_RWread(src, &pixel, 1, 1)) { + return SDL_TRUE; + } COPY_PIXEL(pixel >> 4); - if (!--ch) break; + if (!--ch) { + break; + } COPY_PIXEL(pixel & 0x0F); - if (!--ch) break; + if (!--ch) { + break; + } } } /* pad at even boundary */ - if (needsPad && !SDL_RWread(src, &ch, 1, 1)) return SDL_TRUE; + if (needsPad && !SDL_RWread(src, &ch, 1, 1)) { + return SDL_TRUE; + } break; } } @@ -148,7 +175,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface) #else int alphaChannelOffset = 3; #endif - Uint8 *alpha = ((Uint8*)surface->pixels) + alphaChannelOffset; + Uint8 *alpha = ((Uint8 *)surface->pixels) + alphaChannelOffset; Uint8 *end = alpha + surface->h * surface->pitch; while (alpha < end) { @@ -160,7 +187,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface) } if (!hasAlpha) { - alpha = ((Uint8*)surface->pixels) + alphaChannelOffset; + alpha = ((Uint8 *)surface->pixels) + alphaChannelOffset; while (alpha < end) { *alpha = SDL_ALPHA_OPAQUE; alpha += 4; @@ -168,8 +195,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface) } } -SDL_Surface * -SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) +SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc) { SDL_bool was_error; Sint64 fp_offset = 0; @@ -212,7 +238,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) /* Make sure we are passed a valid data source */ surface = NULL; was_error = SDL_FALSE; - if (src == NULL) { + if (!src) { SDL_InvalidParamError("src"); was_error = SDL_TRUE; goto done; @@ -238,13 +264,13 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) /* bfSize = */ SDL_ReadLE32(src); /* bfReserved1 = */ SDL_ReadLE16(src); /* bfReserved2 = */ SDL_ReadLE16(src); - bfOffBits = SDL_ReadLE32(src); + bfOffBits = SDL_ReadLE32(src); /* Read the Win32 BITMAPINFOHEADER */ biSize = SDL_ReadLE32(src); - if (biSize == 12) { /* really old BITMAPCOREHEADER */ - biWidth = (Uint32) SDL_ReadLE16(src); - biHeight = (Uint32) SDL_ReadLE16(src); + if (biSize == 12) { /* really old BITMAPCOREHEADER */ + biWidth = (Uint32)SDL_ReadLE16(src); + biHeight = (Uint32)SDL_ReadLE16(src); /* biPlanes = */ SDL_ReadLE16(src); biBitCount = SDL_ReadLE16(src); biCompression = BI_RGB; @@ -253,7 +279,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) /* biYPelsPerMeter = 0; */ biClrUsed = 0; /* biClrImportant = 0; */ - } else if (biSize >= 40) { /* some version of BITMAPINFOHEADER */ + } else if (biSize >= 40) { /* some version of BITMAPINFOHEADER */ Uint32 headerSize; biWidth = SDL_ReadLE32(src); biHeight = SDL_ReadLE32(src); @@ -282,18 +308,18 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) Bmask = SDL_ReadLE32(src); /* ...v3 adds an alpha mask. */ - if (biSize >= 56) { /* BITMAPV3INFOHEADER; adds alpha mask */ + if (biSize >= 56) { /* BITMAPV3INFOHEADER; adds alpha mask */ haveAlphaMask = SDL_TRUE; Amask = SDL_ReadLE32(src); } } else { /* the mask fields are ignored for v2+ headers if not BI_BITFIELD. */ - if (biSize >= 52) { /* BITMAPV2INFOHEADER; adds RGB masks */ + if (biSize >= 52) { /* BITMAPV2INFOHEADER; adds RGB masks */ /*Rmask = */ SDL_ReadLE32(src); /*Gmask = */ SDL_ReadLE32(src); /*Bmask = */ SDL_ReadLE32(src); } - if (biSize >= 56) { /* BITMAPV3INFOHEADER; adds alpha mask */ + if (biSize >= 56) { /* BITMAPV3INFOHEADER; adds alpha mask */ /*Amask = */ SDL_ReadLE32(src); } } @@ -305,7 +331,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) } /* skip any header bytes we didn't handle... */ - headerSize = (Uint32) (SDL_RWtell(src) - (fp_offset + 14)); + headerSize = (Uint32)(SDL_RWtell(src) - (fp_offset + 14)); if (biSize > headerSize) { SDL_RWseek(src, (biSize - headerSize), RW_SEEK_CUR); } @@ -388,7 +414,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) break; case BI_BITFIELDS: - break; /* we handled this in the info header. */ + break; /* we handled this in the info header. */ default: break; @@ -398,7 +424,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) surface = SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, Amask); - if (surface == NULL) { + if (!surface) { was_error = SDL_TRUE; goto done; } @@ -406,13 +432,13 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) /* Load the palette, if any */ palette = (surface->format)->palette; if (palette) { - if (SDL_RWseek(src, fp_offset+14+biSize, RW_SEEK_SET) < 0) { + if (SDL_RWseek(src, fp_offset + 14 + biSize, RW_SEEK_SET) < 0) { SDL_Error(SDL_EFSEEK); was_error = SDL_TRUE; goto done; } - if (biBitCount >= 32) { /* we shift biClrUsed by this value later. */ + if (biBitCount >= 32) { /* we shift biClrUsed by this value later. */ SDL_SetError("Unsupported or incorrect biBitCount field"); was_error = SDL_TRUE; goto done; @@ -423,7 +449,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) } if (biClrUsed > (Uint32)palette->ncolors) { - biClrUsed = 1 << biBitCount; /* try forcing it? */ + biClrUsed = 1 << biBitCount; /* try forcing it? */ if (biClrUsed > (Uint32)palette->ncolors) { SDL_SetError("Unsupported or incorrect biClrUsed field"); was_error = SDL_TRUE; @@ -431,15 +457,15 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) } } - if (biSize == 12) { - for (i = 0; i < (int) biClrUsed; ++i) { + if (biSize == 12) { + for (i = 0; i < (int)biClrUsed; ++i) { SDL_RWread(src, &palette->colors[i].b, 1, 1); SDL_RWread(src, &palette->colors[i].g, 1, 1); SDL_RWread(src, &palette->colors[i].r, 1, 1); palette->colors[i].a = SDL_ALPHA_OPAQUE; } } else { - for (i = 0; i < (int) biClrUsed; ++i) { + for (i = 0; i < (int)biClrUsed; ++i) { SDL_RWread(src, &palette->colors[i].b, 1, 1); SDL_RWread(src, &palette->colors[i].g, 1, 1); SDL_RWread(src, &palette->colors[i].r, 1, 1); @@ -463,11 +489,13 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) } if ((biCompression == BI_RLE4) || (biCompression == BI_RLE8)) { was_error = readRlePixels(surface, src, biCompression == BI_RLE8); - if (was_error) SDL_Error(SDL_EFREAD); + if (was_error) { + SDL_Error(SDL_EFREAD); + } goto done; } top = (Uint8 *)surface->pixels; - end = (Uint8 *)surface->pixels+(surface->h*surface->pitch); + end = (Uint8 *)surface->pixels + (surface->h * surface->pitch); switch (ExpandBMP) { case 1: bmpPitch = (biWidth + 7) >> 3; @@ -494,27 +522,27 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) switch (ExpandBMP) { case 1: case 2: - case 4:{ - Uint8 pixel = 0; - int shift = (8 - ExpandBMP); - for (i = 0; i < surface->w; ++i) { - if (i % (8 / ExpandBMP) == 0) { - if (!SDL_RWread(src, &pixel, 1, 1)) { - SDL_Error(SDL_EFREAD); - was_error = SDL_TRUE; - goto done; - } - } - bits[i] = (pixel >> shift); - if (bits[i] >= biClrUsed) { - SDL_SetError("A BMP image contains a pixel with a color out of the palette"); + case 4: + { + Uint8 pixel = 0; + int shift = (8 - ExpandBMP); + for (i = 0; i < surface->w; ++i) { + if (i % (8 / ExpandBMP) == 0) { + if (!SDL_RWread(src, &pixel, 1, 1)) { + SDL_Error(SDL_EFREAD); was_error = SDL_TRUE; goto done; } - pixel <<= ExpandBMP; } + bits[i] = (pixel >> shift); + if (bits[i] >= biClrUsed) { + SDL_SetError("A BMP image contains a pixel with a color out of the palette"); + was_error = SDL_TRUE; + goto done; + } + pixel <<= ExpandBMP; } - break; + } break; default: if (SDL_RWread(src, bits, 1, surface->pitch) != surface->pitch) { @@ -536,19 +564,23 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) case has already been taken care of above. */ switch (biBitCount) { case 15: - case 16:{ - Uint16 *pix = (Uint16 *) bits; - for (i = 0; i < surface->w; i++) - pix[i] = SDL_Swap16(pix[i]); - break; + case 16: + { + Uint16 *pix = (Uint16 *)bits; + for (i = 0; i < surface->w; i++) { + pix[i] = SDL_Swap16(pix[i]); } + break; + } - case 32:{ - Uint32 *pix = (Uint32 *) bits; - for (i = 0; i < surface->w; i++) - pix[i] = SDL_Swap32(pix[i]); - break; + case 32: + { + Uint32 *pix = (Uint32 *)bits; + for (i = 0; i < surface->w; i++) { + pix[i] = SDL_Swap32(pix[i]); } + break; + } } #endif break; @@ -569,7 +601,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) if (correctAlpha) { CorrectAlphaChannel(surface); } - done: +done: if (was_error) { if (src) { SDL_RWseek(src, fp_offset, RW_SEEK_SET); @@ -580,15 +612,14 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) if (freesrc && src) { SDL_RWclose(src); } - return (surface); + return surface; } -int -SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) +int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst) { Sint64 fp_offset; int i, pad; - SDL_Surface *surface; + SDL_Surface *intermediate_surface; Uint8 *bits; SDL_bool save32bit = SDL_FALSE; SDL_bool saveLegacyBMP = SDL_FALSE; @@ -619,41 +650,42 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) Uint32 bV4BlueMask = 0; Uint32 bV4AlphaMask = 0; Uint32 bV4CSType = 0; - Sint32 bV4Endpoints[3 * 3] = {0}; + Sint32 bV4Endpoints[3 * 3] = { 0 }; Uint32 bV4GammaRed = 0; Uint32 bV4GammaGreen = 0; Uint32 bV4GammaBlue = 0; /* Make sure we have somewhere to save */ - surface = NULL; + intermediate_surface = NULL; if (dst) { #ifdef SAVE_32BIT_BMP /* We can save alpha information in a 32-bit BMP */ - if (saveme->format->BitsPerPixel >= 8 && (saveme->format->Amask || - saveme->map->info.flags & SDL_COPY_COLORKEY)) { + if (surface->format->BitsPerPixel >= 8 && + (surface->format->Amask != 0 || + surface->map->info.flags & SDL_COPY_COLORKEY)) { save32bit = SDL_TRUE; } #endif /* SAVE_32BIT_BMP */ - if (saveme->format->palette && !save32bit) { - if (saveme->format->BitsPerPixel == 8) { - surface = saveme; + if (surface->format->palette && !save32bit) { + if (surface->format->BitsPerPixel == 8) { + intermediate_surface = surface; } else { SDL_SetError("%d bpp BMP files not supported", - saveme->format->BitsPerPixel); + surface->format->BitsPerPixel); } - } else if ((saveme->format->BitsPerPixel == 24) && !save32bit && + } else if ((surface->format->BitsPerPixel == 24) && !save32bit && #if SDL_BYTEORDER == SDL_LIL_ENDIAN - (saveme->format->Rmask == 0x00FF0000) && - (saveme->format->Gmask == 0x0000FF00) && - (saveme->format->Bmask == 0x000000FF) + (surface->format->Rmask == 0x00FF0000) && + (surface->format->Gmask == 0x0000FF00) && + (surface->format->Bmask == 0x000000FF) #else - (saveme->format->Rmask == 0x000000FF) && - (saveme->format->Gmask == 0x0000FF00) && - (saveme->format->Bmask == 0x00FF0000) + (surface->format->Rmask == 0x000000FF) && + (surface->format->Gmask == 0x0000FF00) && + (surface->format->Bmask == 0x00FF0000) #endif - ) { - surface = saveme; + ) { + intermediate_surface = surface; } else { SDL_PixelFormat format; @@ -664,8 +696,8 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) } else { SDL_InitFormat(&format, SDL_PIXELFORMAT_BGR24); } - surface = SDL_ConvertSurface(saveme, &format, 0); - if (!surface) { + intermediate_surface = SDL_ConvertSurface(surface, &format, 0); + if (!intermediate_surface) { SDL_SetError("Couldn't convert image to %d bpp", format.BitsPerPixel); } @@ -680,14 +712,14 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) saveLegacyBMP = SDL_GetHintBoolean(SDL_HINT_BMP_SAVE_LEGACY_FORMAT, SDL_FALSE); } - if (surface && (SDL_LockSurface(surface) == 0)) { - const int bw = surface->w * surface->format->BytesPerPixel; + if (intermediate_surface && (SDL_LockSurface(intermediate_surface) == 0)) { + const int bw = intermediate_surface->w * intermediate_surface->format->BytesPerPixel; /* Set the BMP file header values */ - bfSize = 0; /* We'll write this when we're done */ + bfSize = 0; /* We'll write this when we're done */ bfReserved1 = 0; bfReserved2 = 0; - bfOffBits = 0; /* We'll write this when we're done */ + bfOffBits = 0; /* We'll write this when we're done */ /* Write the BMP file header values */ fp_offset = SDL_RWtell(dst); @@ -700,16 +732,16 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) /* Set the BMP info values */ biSize = 40; - biWidth = surface->w; - biHeight = surface->h; + biWidth = intermediate_surface->w; + biHeight = intermediate_surface->h; biPlanes = 1; - biBitCount = surface->format->BitsPerPixel; + biBitCount = intermediate_surface->format->BitsPerPixel; biCompression = BI_RGB; - biSizeImage = surface->h * surface->pitch; + biSizeImage = intermediate_surface->h * intermediate_surface->pitch; biXPelsPerMeter = 0; biYPelsPerMeter = 0; - if (surface->format->palette) { - biClrUsed = surface->format->palette->ncolors; + if (intermediate_surface->format->palette) { + biClrUsed = intermediate_surface->format->palette->ncolors; } else { biClrUsed = 0; } @@ -720,9 +752,9 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) biSize = 108; biCompression = BI_BITFIELDS; /* The BMP format is always little endian, these masks stay the same */ - bV4RedMask = 0x00ff0000; + bV4RedMask = 0x00ff0000; bV4GreenMask = 0x0000ff00; - bV4BlueMask = 0x000000ff; + bV4BlueMask = 0x000000ff; bV4AlphaMask = 0xff000000; bV4CSType = LCS_WINDOWS_COLOR_SPACE; bV4GammaRed = 0; @@ -759,12 +791,12 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) } /* Write the palette (in BGR color order) */ - if (surface->format->palette) { + if (intermediate_surface->format->palette) { SDL_Color *colors; int ncolors; - colors = surface->format->palette->colors; - ncolors = surface->format->palette->ncolors; + colors = intermediate_surface->format->palette->colors; + ncolors = intermediate_surface->format->palette->ncolors; for (i = 0; i < ncolors; ++i) { SDL_RWwrite(dst, &colors[i].b, 1, 1); SDL_RWwrite(dst, &colors[i].g, 1, 1); @@ -784,10 +816,10 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) } /* Write the bitmap image upside down */ - bits = (Uint8 *) surface->pixels + (surface->h * surface->pitch); + bits = (Uint8 *)intermediate_surface->pixels + (intermediate_surface->h * intermediate_surface->pitch); pad = ((bw % 4) ? (4 - (bw % 4)) : 0); - while (bits > (Uint8 *) surface->pixels) { - bits -= surface->pitch; + while (bits > (Uint8 *)intermediate_surface->pixels) { + bits -= intermediate_surface->pitch; if (SDL_RWwrite(dst, bits, 1, bw) != bw) { SDL_Error(SDL_EFWRITE); break; @@ -811,16 +843,16 @@ SDL_SaveBMP_RW(SDL_Surface * saveme, SDL_RWops * dst, int freedst) } /* Close it up.. */ - SDL_UnlockSurface(surface); - if (surface != saveme) { - SDL_FreeSurface(surface); + SDL_UnlockSurface(intermediate_surface); + if (intermediate_surface != surface) { + SDL_FreeSurface(intermediate_surface); } } if (freedst && dst) { SDL_RWclose(dst); } - return ((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1); + return (SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index b5ea5ed533e88..ce61b0094bcf1 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,9 +23,7 @@ #include "SDL_clipboard.h" #include "SDL_sysvideo.h" - -int -SDL_SetClipboardText(const char *text) +int SDL_SetClipboardText(const char *text) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -45,8 +43,7 @@ SDL_SetClipboardText(const char *text) } } -int -SDL_SetPrimarySelectionText(const char *text) +int SDL_SetPrimarySelectionText(const char *text) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -66,8 +63,7 @@ SDL_SetPrimarySelectionText(const char *text) } } -char * -SDL_GetClipboardText(void) +char *SDL_GetClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -87,8 +83,7 @@ SDL_GetClipboardText(void) } } -char * -SDL_GetPrimarySelectionText(void) +char *SDL_GetPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -108,8 +103,7 @@ SDL_GetPrimarySelectionText(void) } } -SDL_bool -SDL_HasClipboardText(void) +SDL_bool SDL_HasClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -129,8 +123,7 @@ SDL_HasClipboardText(void) } } -SDL_bool -SDL_HasPrimarySelectionText(void) +SDL_bool SDL_HasPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 41ae6ec016499..50f7082f489b0 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -1,15 +1,15 @@ /* * Simple DirectMedia Layer - * Copyright (C) 1997-2022 Sam Lantinga - * + * Copyright (C) 1997-2025 Sam Lantinga + * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. - * + * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: - * + * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be @@ -20,16 +20,16 @@ */ #include "../SDL_internal.h" -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT +#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) #include "../core/windows/SDL_windows.h" #endif -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include #include "../video/android/SDL_androidvideo.h" #endif -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI #include #endif @@ -47,65 +47,65 @@ #ifndef EGL_EXT_pixel_format_float #define EGL_EXT_pixel_format_float -#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 +#define EGL_COLOR_COMPONENT_TYPE_EXT 0x3339 #define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT 0x333A #define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT 0x333B #endif #ifndef EGL_EXT_present_opaque #define EGL_EXT_present_opaque 1 -#define EGL_PRESENT_OPAQUE_EXT 0x31DF +#define EGL_PRESENT_OPAQUE_EXT 0x31DF #endif /* EGL_EXT_present_opaque */ -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */ -#define DEFAULT_EGL ( vc4 ? "libEGL.so.1" : "libbrcmEGL.so" ) -#define DEFAULT_OGL_ES2 ( vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so" ) -#define ALT_EGL "libEGL.so" -#define ALT_OGL_ES2 "libGLESv2.so" -#define DEFAULT_OGL_ES_PVR ( vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so" ) -#define DEFAULT_OGL_ES ( vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so" ) - -#elif SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_VIVANTE +#define DEFAULT_EGL (vc4 ? "libEGL.so.1" : "libbrcmEGL.so") +#define DEFAULT_OGL_ES2 (vc4 ? "libGLESv2.so.2" : "libbrcmGLESv2.so") +#define ALT_EGL "libEGL.so" +#define ALT_OGL_ES2 "libGLESv2.so" +#define DEFAULT_OGL_ES_PVR (vc4 ? "libGLES_CM.so.1" : "libbrcmGLESv2.so") +#define DEFAULT_OGL_ES (vc4 ? "libGLESv1_CM.so.1" : "libbrcmGLESv2.so") + +#elif defined(SDL_VIDEO_DRIVER_ANDROID) || defined(SDL_VIDEO_DRIVER_VIVANTE) /* Android */ -#define DEFAULT_EGL "libEGL.so" -#define DEFAULT_OGL_ES2 "libGLESv2.so" +#define DEFAULT_EGL "libEGL.so" +#define DEFAULT_OGL_ES2 "libGLESv2.so" #define DEFAULT_OGL_ES_PVR "libGLES_CM.so" -#define DEFAULT_OGL_ES "libGLESv1_CM.so" +#define DEFAULT_OGL_ES "libGLESv1_CM.so" -#elif SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT +#elif defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) /* EGL AND OpenGL ES support via ANGLE */ #define DEFAULT_EGL "libEGL.dll" #define DEFAULT_OGL_ES2 "libGLESv2.dll" #define DEFAULT_OGL_ES_PVR "libGLES_CM.dll" -#define DEFAULT_OGL_ES "libGLESv1_CM.dll" +#define DEFAULT_OGL_ES "libGLESv1_CM.dll" -#elif SDL_VIDEO_DRIVER_COCOA +#elif defined(SDL_VIDEO_DRIVER_COCOA) /* EGL AND OpenGL ES support via ANGLE */ -#define DEFAULT_EGL "libEGL.dylib" -#define DEFAULT_OGL_ES2 "libGLESv2.dylib" +#define DEFAULT_EGL "libEGL.dylib" +#define DEFAULT_OGL_ES2 "libGLESv2.dylib" #define DEFAULT_OGL_ES_PVR "libGLES_CM.dylib" //??? -#define DEFAULT_OGL_ES "libGLESv1_CM.dylib" //??? +#define DEFAULT_OGL_ES "libGLESv1_CM.dylib" //??? #elif defined(__OpenBSD__) /* OpenBSD */ -#define DEFAULT_OGL "libGL.so" -#define DEFAULT_EGL "libEGL.so" -#define DEFAULT_OGL_ES2 "libGLESv2.so" +#define DEFAULT_OGL "libGL.so" +#define DEFAULT_EGL "libEGL.so" +#define DEFAULT_OGL_ES2 "libGLESv2.so" #define DEFAULT_OGL_ES_PVR "libGLES_CM.so" -#define DEFAULT_OGL_ES "libGLESv1_CM.so" +#define DEFAULT_OGL_ES "libGLESv1_CM.so" #else /* Desktop Linux/Unix-like */ -#define DEFAULT_OGL "libGL.so.1" -#define DEFAULT_EGL "libEGL.so.1" -#define ALT_OGL "libOpenGL.so.0" -#define DEFAULT_OGL_ES2 "libGLESv2.so.2" +#define DEFAULT_OGL "libGL.so.1" +#define DEFAULT_EGL "libEGL.so.1" +#define ALT_OGL "libOpenGL.so.0" +#define DEFAULT_OGL_ES2 "libGLESv2.so.2" #define DEFAULT_OGL_ES_PVR "libGLES_CM.so.1" -#define DEFAULT_OGL_ES "libGLESv1_CM.so.1" +#define DEFAULT_OGL_ES "libGLESv1_CM.so.1" #endif /* SDL_VIDEO_DRIVER_RPI */ -#if SDL_VIDEO_OPENGL && !SDL_VIDEO_VITA_PVR_OGL +#if defined(SDL_VIDEO_OPENGL) && !defined(SDL_VIDEO_VITA_PVR_OGL) #include "SDL_opengl.h" #endif @@ -118,23 +118,24 @@ #if defined(SDL_VIDEO_STATIC_ANGLE) || defined(SDL_VIDEO_DRIVER_VITA) #define LOAD_FUNC(NAME) \ -_this->egl_data->NAME = (void *)NAME; + _this->egl_data->NAME = (void *)NAME; #else -#define LOAD_FUNC(NAME) \ -_this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->egl_dll_handle, #NAME); \ -if (!_this->egl_data->NAME) \ -{ \ - return SDL_SetError("Could not retrieve EGL function " #NAME); \ -} +#define LOAD_FUNC(NAME) \ + _this->egl_data->NAME = SDL_LoadFunction(_this->egl_data->egl_dll_handle, #NAME); \ + if (!_this->egl_data->NAME) { \ + return SDL_SetError("Could not retrieve EGL function " #NAME); \ + } #endif /* it is allowed to not have some of the EGL extensions on start - attempts to use them will fail later. */ #define LOAD_FUNC_EGLEXT(NAME) \ _this->egl_data->NAME = _this->egl_data->eglGetProcAddress(#NAME); -static const char * SDL_EGL_GetErrorName(EGLint eglErrorCode) +static const char *SDL_EGL_GetErrorName(EGLint eglErrorCode) { -#define SDL_EGL_ERROR_TRANSLATE(e) case e: return #e; +#define SDL_EGL_ERROR_TRANSLATE(e) \ + case e: \ + return #e; switch (eglErrorCode) { SDL_EGL_ERROR_TRANSLATE(EGL_SUCCESS); SDL_EGL_ERROR_TRANSLATE(EGL_NOT_INITIALIZED); @@ -155,13 +156,13 @@ static const char * SDL_EGL_GetErrorName(EGLint eglErrorCode) return ""; } -int SDL_EGL_SetErrorEx(const char * message, const char * eglFunctionName, EGLint eglErrorCode) +int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint eglErrorCode) { - const char * errorText = SDL_EGL_GetErrorName(eglErrorCode); + const char *errorText = SDL_EGL_GetErrorName(eglErrorCode); char altErrorText[32]; if (errorText[0] == '\0') { /* An unknown-to-SDL error code was reported. Report its hexadecimal value, instead of its name. */ - SDL_snprintf(altErrorText, SDL_arraysize(altErrorText), "0x%x", (unsigned int)eglErrorCode); + (void)SDL_snprintf(altErrorText, SDL_arraysize(altErrorText), "0x%x", (unsigned int)eglErrorCode); errorText = altErrorText; } return SDL_SetError("%s (call to %s failed, reporting an error of %s)", message, eglFunctionName, errorText); @@ -177,7 +178,7 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext const char *ext_start; /* Invalid extensions can be rejected early */ - if (ext == NULL || *ext == 0 || SDL_strchr(ext, ' ') != NULL) { + if (!ext || *ext == 0 || SDL_strchr(ext, ' ') != NULL) { /* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "SDL_EGL_HasExtension: Invalid EGL extension"); */ return SDL_FALSE; } @@ -190,7 +191,7 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext * 1 If set, the client extension is masked and not present to SDL. */ ext_override = SDL_getenv(ext); - if (ext_override != NULL) { + if (ext_override) { int disable_ext = SDL_atoi(ext_override); if (disable_ext & 0x01 && type == SDL_EGL_DISPLAY_EXTENSION) { return SDL_FALSE; @@ -216,12 +217,12 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext return SDL_FALSE; } - if (egl_extstr != NULL) { + if (egl_extstr) { ext_start = egl_extstr; while (*ext_start) { ext_start = SDL_strstr(ext_start, ext); - if (ext_start == NULL) { + if (!ext_start) { return SDL_FALSE; } /* Check if the match is not just a substring of one of the extensions */ @@ -241,25 +242,24 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext return SDL_FALSE; } -void * -SDL_EGL_GetProcAddress(_THIS, const char *proc) +void *SDL_EGL_GetProcAddress(_THIS, const char *proc) { void *retval = NULL; - if (_this->egl_data != NULL) { - const Uint32 eglver = (((Uint32) _this->egl_data->egl_version_major) << 16) | ((Uint32) _this->egl_data->egl_version_minor); - const SDL_bool is_egl_15_or_later = eglver >= ((((Uint32) 1) << 16) | 5); + if (_this->egl_data) { + const Uint32 eglver = (((Uint32)_this->egl_data->egl_version_major) << 16) | ((Uint32)_this->egl_data->egl_version_minor); + const SDL_bool is_egl_15_or_later = eglver >= ((((Uint32)1) << 16) | 5); /* EGL 1.5 can use eglGetProcAddress() for any symbol. 1.4 and earlier can't use it for core entry points. */ if (!retval && is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { retval = _this->egl_data->eglGetProcAddress(proc); } - #if !defined(__EMSCRIPTEN__) && !defined(SDL_VIDEO_DRIVER_VITA) /* LoadFunction isn't needed on Emscripten and will call dlsym(), causing other problems. */ +#if !defined(__EMSCRIPTEN__) && !defined(SDL_VIDEO_DRIVER_VITA) /* LoadFunction isn't needed on Emscripten and will call dlsym(), causing other problems. */ /* Try SDL_LoadFunction() first for EGL <= 1.4, or as a fallback for >= 1.5. */ if (!retval) { retval = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, proc); } - #endif +#endif /* Try eglGetProcAddress if we're on <= 1.4 and still searching... */ if (!retval && !is_egl_15_or_later && _this->egl_data->eglGetProcAddress) { @@ -269,8 +269,7 @@ SDL_EGL_GetProcAddress(_THIS, const char *proc) return retval; } -void -SDL_EGL_UnloadLibrary(_THIS) +void SDL_EGL_UnloadLibrary(_THIS) { if (_this->egl_data) { if (_this->egl_data->egl_display) { @@ -286,25 +285,24 @@ SDL_EGL_UnloadLibrary(_THIS) SDL_UnloadObject(_this->egl_data->opengl_dll_handle); _this->egl_data->opengl_dll_handle = NULL; } - + SDL_free(_this->egl_data); _this->egl_data = NULL; } } -static int -SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) +static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) { void *egl_dll_handle = NULL, *opengl_dll_handle = NULL; const char *path = NULL; -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT +#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) const char *d3dcompiler; #endif -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI SDL_bool vc4 = (0 == access("/sys/module/vc4/", F_OK)); #endif -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT +#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER); if (d3dcompiler) { if (SDL_strcasecmp(d3dcompiler, "none") != 0) { @@ -316,7 +314,8 @@ SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) if (WIN_IsWindowsVistaOrGreater()) { /* Try the newer d3d compilers first */ const char *d3dcompiler_list[] = { - "d3dcompiler_47.dll", "d3dcompiler_46.dll", + "d3dcompiler_47.dll", + "d3dcompiler_46.dll", }; int i; @@ -337,17 +336,17 @@ SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) #if !defined(SDL_VIDEO_STATIC_ANGLE) && !defined(SDL_VIDEO_DRIVER_VITA) /* A funny thing, loading EGL.so first does not work on the Raspberry, so we load libGL* first */ path = SDL_getenv("SDL_VIDEO_GL_DRIVER"); - if (path != NULL) { + if (path) { opengl_dll_handle = SDL_LoadObject(path); } - if (opengl_dll_handle == NULL) { + if (!opengl_dll_handle) { if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { if (_this->gl_config.major_version > 1) { path = DEFAULT_OGL_ES2; opengl_dll_handle = SDL_LoadObject(path); #ifdef ALT_OGL_ES2 - if (opengl_dll_handle == NULL && !vc4) { + if (!opengl_dll_handle && !vc4) { path = ALT_OGL_ES2; opengl_dll_handle = SDL_LoadObject(path); } @@ -356,61 +355,61 @@ SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) } else { path = DEFAULT_OGL_ES; opengl_dll_handle = SDL_LoadObject(path); - if (opengl_dll_handle == NULL) { + if (!opengl_dll_handle) { path = DEFAULT_OGL_ES_PVR; opengl_dll_handle = SDL_LoadObject(path); } #ifdef ALT_OGL_ES2 - if (opengl_dll_handle == NULL && !vc4) { + if (!opengl_dll_handle && !vc4) { path = ALT_OGL_ES2; opengl_dll_handle = SDL_LoadObject(path); } #endif } } -#ifdef DEFAULT_OGL +#ifdef DEFAULT_OGL else { path = DEFAULT_OGL; opengl_dll_handle = SDL_LoadObject(path); #ifdef ALT_OGL - if (opengl_dll_handle == NULL) { + if (!opengl_dll_handle) { path = ALT_OGL; opengl_dll_handle = SDL_LoadObject(path); } #endif } -#endif +#endif } _this->egl_data->opengl_dll_handle = opengl_dll_handle; - if (opengl_dll_handle == NULL) { + if (!opengl_dll_handle) { return SDL_SetError("Could not initialize OpenGL / GLES library"); } /* Loading libGL* in the previous step took care of loading libEGL.so, but we future proof by double checking */ - if (egl_path != NULL) { + if (egl_path) { egl_dll_handle = SDL_LoadObject(egl_path); - } + } /* Try loading a EGL symbol, if it does not work try the default library paths */ - if (egl_dll_handle == NULL || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) { - if (egl_dll_handle != NULL) { + if (!egl_dll_handle || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) { + if (egl_dll_handle) { SDL_UnloadObject(egl_dll_handle); } path = SDL_getenv("SDL_VIDEO_EGL_DRIVER"); - if (path == NULL) { + if (!path) { path = DEFAULT_EGL; } egl_dll_handle = SDL_LoadObject(path); #ifdef ALT_EGL - if (egl_dll_handle == NULL && !vc4) { + if (!egl_dll_handle && !vc4) { path = ALT_EGL; egl_dll_handle = SDL_LoadObject(path); } #endif - if (egl_dll_handle == NULL || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) { - if (egl_dll_handle != NULL) { + if (!egl_dll_handle || SDL_LoadFunction(egl_dll_handle, "eglChooseConfig") == NULL) { + if (egl_dll_handle) { SDL_UnloadObject(egl_dll_handle); } return SDL_SetError("Could not load EGL library"); @@ -420,7 +419,7 @@ SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) #endif _this->egl_data->egl_dll_handle = egl_dll_handle; -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA _this->egl_data->opengl_dll_handle = opengl_dll_handle; #endif @@ -464,14 +463,13 @@ SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) return 0; } -int -SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) +int SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) { if (_this->egl_data) { return SDL_SetError("EGL context already created"); } - _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData)); + _this->egl_data = (struct SDL_EGL_VideoData *)SDL_calloc(1, sizeof(SDL_EGL_VideoData)); if (!_this->egl_data) { return SDL_OutOfMemory(); } @@ -484,8 +482,8 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) return 0; } -static void -SDL_EGL_GetVersion(_THIS) { +static void SDL_EGL_GetVersion(_THIS) +{ if (_this->egl_data->eglQueryString) { const char *egl_version = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_VERSION); if (egl_version) { @@ -500,8 +498,7 @@ SDL_EGL_GetVersion(_THIS) { } } -int -SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_display, EGLenum platform) +int SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_display, EGLenum platform) { int library_load_retcode = SDL_EGL_LoadLibraryOnly(_this, egl_path); if (library_load_retcode != 0) { @@ -538,7 +535,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa } #endif /* Try the implementation-specific eglGetDisplay even if eglGetPlatformDisplay fails */ - if ((_this->egl_data->egl_display == EGL_NO_DISPLAY) && (_this->egl_data->eglGetDisplay != NULL)) { + if ((_this->egl_data->egl_display == EGL_NO_DISPLAY) && (_this->egl_data->eglGetDisplay)) { _this->egl_data->egl_display = _this->egl_data->eglGetDisplay(native_display); } if (_this->egl_data->egl_display == EGL_NO_DISPLAY) { @@ -570,8 +567,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa valid available GPU for EGL to use. */ -int -SDL_EGL_InitializeOffscreen(_THIS, int device) +int SDL_EGL_InitializeOffscreen(_THIS, int device) { void *egl_devices[SDL_EGL_MAX_DEVICES]; EGLint num_egl_devices = 0; @@ -582,11 +578,11 @@ SDL_EGL_InitializeOffscreen(_THIS, int device) } /* Check for all extensions that are optional until used and fail if any is missing */ - if (_this->egl_data->eglQueryDevicesEXT == NULL) { + if (!_this->egl_data->eglQueryDevicesEXT) { return SDL_SetError("eglQueryDevicesEXT is missing (EXT_device_enumeration not supported by the drivers?)"); } - if (_this->egl_data->eglGetPlatformDisplayEXT == NULL) { + if (!_this->egl_data->eglGetPlatformDisplayEXT) { return SDL_SetError("eglGetPlatformDisplayEXT is missing (EXT_platform_base not supported by the drivers?)"); } @@ -611,8 +607,7 @@ SDL_EGL_InitializeOffscreen(_THIS, int device) if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { return SDL_SetError("Could not initialize EGL"); } - } - else { + } else { int i; SDL_bool found = SDL_FALSE; EGLDisplay attempted_egl_display; @@ -650,63 +645,64 @@ SDL_EGL_InitializeOffscreen(_THIS, int device) return 0; } -void -SDL_EGL_SetRequiredVisualId(_THIS, int visual_id) +void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id) { - _this->egl_data->egl_required_visual_id=visual_id; + _this->egl_data->egl_required_visual_id = visual_id; } #ifdef DUMP_EGL_CONFIG -#define ATTRIBUTE(_attr) { _attr, #_attr } +#define ATTRIBUTE(_attr) \ + { \ + _attr, #_attr \ + } -typedef struct { +typedef struct +{ EGLint attribute; - char const* name; + char const *name; } Attribute; -static -Attribute all_attributes[] = { - ATTRIBUTE( EGL_BUFFER_SIZE ), - ATTRIBUTE( EGL_ALPHA_SIZE ), - ATTRIBUTE( EGL_BLUE_SIZE ), - ATTRIBUTE( EGL_GREEN_SIZE ), - ATTRIBUTE( EGL_RED_SIZE ), - ATTRIBUTE( EGL_DEPTH_SIZE ), - ATTRIBUTE( EGL_STENCIL_SIZE ), - ATTRIBUTE( EGL_CONFIG_CAVEAT ), - ATTRIBUTE( EGL_CONFIG_ID ), - ATTRIBUTE( EGL_LEVEL ), - ATTRIBUTE( EGL_MAX_PBUFFER_HEIGHT ), - ATTRIBUTE( EGL_MAX_PBUFFER_WIDTH ), - ATTRIBUTE( EGL_MAX_PBUFFER_PIXELS ), - ATTRIBUTE( EGL_NATIVE_RENDERABLE ), - ATTRIBUTE( EGL_NATIVE_VISUAL_ID ), - ATTRIBUTE( EGL_NATIVE_VISUAL_TYPE ), - ATTRIBUTE( EGL_SAMPLES ), - ATTRIBUTE( EGL_SAMPLE_BUFFERS ), - ATTRIBUTE( EGL_SURFACE_TYPE ), - ATTRIBUTE( EGL_TRANSPARENT_TYPE ), - ATTRIBUTE( EGL_TRANSPARENT_BLUE_VALUE ), - ATTRIBUTE( EGL_TRANSPARENT_GREEN_VALUE ), - ATTRIBUTE( EGL_TRANSPARENT_RED_VALUE ), - ATTRIBUTE( EGL_BIND_TO_TEXTURE_RGB ), - ATTRIBUTE( EGL_BIND_TO_TEXTURE_RGBA ), - ATTRIBUTE( EGL_MIN_SWAP_INTERVAL ), - ATTRIBUTE( EGL_MAX_SWAP_INTERVAL ), - ATTRIBUTE( EGL_LUMINANCE_SIZE ), - ATTRIBUTE( EGL_ALPHA_MASK_SIZE ), - ATTRIBUTE( EGL_COLOR_BUFFER_TYPE ), - ATTRIBUTE( EGL_RENDERABLE_TYPE ), - ATTRIBUTE( EGL_MATCH_NATIVE_PIXMAP ), - ATTRIBUTE( EGL_CONFORMANT ), +static Attribute all_attributes[] = { + ATTRIBUTE(EGL_BUFFER_SIZE), + ATTRIBUTE(EGL_ALPHA_SIZE), + ATTRIBUTE(EGL_BLUE_SIZE), + ATTRIBUTE(EGL_GREEN_SIZE), + ATTRIBUTE(EGL_RED_SIZE), + ATTRIBUTE(EGL_DEPTH_SIZE), + ATTRIBUTE(EGL_STENCIL_SIZE), + ATTRIBUTE(EGL_CONFIG_CAVEAT), + ATTRIBUTE(EGL_CONFIG_ID), + ATTRIBUTE(EGL_LEVEL), + ATTRIBUTE(EGL_MAX_PBUFFER_HEIGHT), + ATTRIBUTE(EGL_MAX_PBUFFER_WIDTH), + ATTRIBUTE(EGL_MAX_PBUFFER_PIXELS), + ATTRIBUTE(EGL_NATIVE_RENDERABLE), + ATTRIBUTE(EGL_NATIVE_VISUAL_ID), + ATTRIBUTE(EGL_NATIVE_VISUAL_TYPE), + ATTRIBUTE(EGL_SAMPLES), + ATTRIBUTE(EGL_SAMPLE_BUFFERS), + ATTRIBUTE(EGL_SURFACE_TYPE), + ATTRIBUTE(EGL_TRANSPARENT_TYPE), + ATTRIBUTE(EGL_TRANSPARENT_BLUE_VALUE), + ATTRIBUTE(EGL_TRANSPARENT_GREEN_VALUE), + ATTRIBUTE(EGL_TRANSPARENT_RED_VALUE), + ATTRIBUTE(EGL_BIND_TO_TEXTURE_RGB), + ATTRIBUTE(EGL_BIND_TO_TEXTURE_RGBA), + ATTRIBUTE(EGL_MIN_SWAP_INTERVAL), + ATTRIBUTE(EGL_MAX_SWAP_INTERVAL), + ATTRIBUTE(EGL_LUMINANCE_SIZE), + ATTRIBUTE(EGL_ALPHA_MASK_SIZE), + ATTRIBUTE(EGL_COLOR_BUFFER_TYPE), + ATTRIBUTE(EGL_RENDERABLE_TYPE), + ATTRIBUTE(EGL_MATCH_NATIVE_PIXMAP), + ATTRIBUTE(EGL_CONFORMANT), }; - static void dumpconfig(_THIS, EGLConfig config) { int attr; - for (attr = 0 ; attregl_data->eglGetConfigAttrib(_this->egl_data->egl_display, config, all_attributes[attr].attribute, &value); SDL_Log("\t%-32s: %10d (0x%08x)\n", all_attributes[attr].name, value, value); @@ -715,8 +711,7 @@ static void dumpconfig(_THIS, EGLConfig config) #endif /* DUMP_EGL_CONFIG */ -static int -SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) +static int SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) { /* 64 seems nice. */ EGLint attribs[64]; @@ -789,7 +784,7 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) attribs[i++] = EGL_OPENGL_ES3_BIT_KHR; } else #endif - if (_this->gl_config.major_version >= 2) { + if (_this->gl_config.major_version >= 2) { attribs[i++] = EGL_OPENGL_ES2_BIT; } else { attribs[i++] = EGL_OPENGL_ES_BIT; @@ -810,21 +805,20 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) SDL_assert(i < SDL_arraysize(attribs)); if (_this->egl_data->eglChooseConfig(_this->egl_data->egl_display, - attribs, - configs, SDL_arraysize(configs), - &found_configs) == EGL_FALSE || + attribs, + configs, SDL_arraysize(configs), + &found_configs) == EGL_FALSE || found_configs == 0) { return -1; } /* first ensure that a found config has a matching format, or the function will fall through. */ - if (_this->egl_data->egl_required_visual_id) - { - for (i = 0; i < found_configs; i++ ) { + if (_this->egl_data->egl_required_visual_id) { + for (i = 0; i < found_configs; i++) { EGLint format; _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, - configs[i], - EGL_NATIVE_VISUAL_ID, &format); + configs[i], + EGL_NATIVE_VISUAL_ID, &format); if (_this->egl_data->egl_required_visual_id == format) { has_matching_format = SDL_TRUE; break; @@ -835,15 +829,15 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) /* eglChooseConfig returns a number of configurations that match or exceed the requested attribs. */ /* From those, we select the one that matches our requirements more closely via a makeshift algorithm */ - for (i = 0; i < found_configs; i++ ) { + for (i = 0; i < found_configs; i++) { SDL_bool is_truecolor = SDL_FALSE; int bitdiff = 0; if (has_matching_format && _this->egl_data->egl_required_visual_id) { EGLint format; _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, - configs[i], - EGL_NATIVE_VISUAL_ID, &format); + configs[i], + EGL_NATIVE_VISUAL_ID, &format); if (_this->egl_data->egl_required_visual_id != format) { continue; } @@ -862,16 +856,15 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) for (j = 0; j < SDL_arraysize(attribs) - 1; j += 2) { if (attribs[j] == EGL_NONE) { - break; + break; } - if ( attribs[j+1] != EGL_DONT_CARE && ( - attribs[j] == EGL_RED_SIZE || - attribs[j] == EGL_GREEN_SIZE || - attribs[j] == EGL_BLUE_SIZE || - attribs[j] == EGL_ALPHA_SIZE || - attribs[j] == EGL_DEPTH_SIZE || - attribs[j] == EGL_STENCIL_SIZE)) { + if (attribs[j + 1] != EGL_DONT_CARE && (attribs[j] == EGL_RED_SIZE || + attribs[j] == EGL_GREEN_SIZE || + attribs[j] == EGL_BLUE_SIZE || + attribs[j] == EGL_ALPHA_SIZE || + attribs[j] == EGL_DEPTH_SIZE || + attribs[j] == EGL_STENCIL_SIZE)) { _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, configs[i], attribs[j], &value); bitdiff += value - attribs[j + 1]; /* value is always >= attrib */ } @@ -888,8 +881,8 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) } } - #define FAVOR_TRUECOLOR 1 - #if FAVOR_TRUECOLOR +#define FAVOR_TRUECOLOR 1 +#if FAVOR_TRUECOLOR /* Some apps request a low color depth, either because they _assume_ they'll get a larger one but don't want to fail if only smaller ones are available, or they just never called SDL_GL_SetAttribute at all and @@ -902,12 +895,12 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) on small hardware that all expected to actually get 16-bit color. In this case, turn off FAVOR_TRUECOLOR (and maybe send a patch to make this more flexible). */ - if ( ((_this->gl_config.red_size + _this->gl_config.blue_size + _this->gl_config.green_size) <= 16) ) { + if (((_this->gl_config.red_size + _this->gl_config.blue_size + _this->gl_config.green_size) <= 16)) { if (truecolor_config_idx != -1) { _this->egl_data->egl_config = configs[truecolor_config_idx]; } } - #endif +#endif #ifdef DUMP_EGL_CONFIG dumpconfig(_this, _this->egl_data->egl_config); @@ -916,8 +909,7 @@ SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) return 0; } -int -SDL_EGL_ChooseConfig(_THIS) +int SDL_EGL_ChooseConfig(_THIS) { int ret; @@ -941,8 +933,7 @@ SDL_EGL_ChooseConfig(_THIS) return SDL_EGL_SetError("Couldn't find matching EGL config", "eglChooseConfig"); } -SDL_GLContext -SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) +SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) { /* max 14 values plus terminator. */ EGLint attribs[15]; @@ -963,8 +954,8 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) share_context = (EGLContext)SDL_GL_GetCurrentContext(); } -#if SDL_VIDEO_DRIVER_ANDROID - if ((_this->gl_config.flags & SDL_GL_CONTEXT_DEBUG_FLAG) != 0) { +#ifdef SDL_VIDEO_DRIVER_ANDROID + if (_this->gl_config.flags & SDL_GL_CONTEXT_DEBUG_FLAG) { /* If SDL_GL_CONTEXT_DEBUG_FLAG is set but EGL_KHR_debug unsupported, unset. * This is required because some Android devices like to complain about it * by "silently" failing, logging a hint which could be easily overlooked: @@ -1045,8 +1036,8 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) _this->egl_data->eglBindAPI(_this->egl_data->apitype); egl_context = _this->egl_data->eglCreateContext(_this->egl_data->egl_display, - _this->egl_data->egl_config, - share_context, attribs); + _this->egl_data->egl_config, + share_context, attribs); if (egl_context == EGL_NO_CONTEXT) { SDL_EGL_SetError("Could not create EGL context", "eglCreateContext"); @@ -1066,8 +1057,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) * or later, or if the EGL_KHR_surfaceless_context extension is present. */ if ((_this->egl_data->egl_version_major > 1) || ((_this->egl_data->egl_version_major == 1) && (_this->egl_data->egl_version_minor >= 5)) || - SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_surfaceless_context")) - { + SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_KHR_surfaceless_context")) { /* Secondary condition: The client API must support it. */ if (profile_es) { /* On OpenGL ES, the GL_OES_surfaceless_context extension must be @@ -1075,10 +1065,10 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) if (SDL_GL_ExtensionSupported("GL_OES_surfaceless_context")) { _this->gl_allow_no_surface = SDL_TRUE; } -#if SDL_VIDEO_OPENGL && !defined(SDL_VIDEO_DRIVER_VITA) +#if defined(SDL_VIDEO_OPENGL) && !defined(SDL_VIDEO_DRIVER_VITA) } else { /* Desktop OpenGL supports it by default from version 3.0 on. */ - void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); + void(APIENTRY * glGetIntegervFunc)(GLenum pname, GLint * params); glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); if (glGetIntegervFunc) { GLint v = 0; @@ -1091,13 +1081,12 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) } } - return (SDL_GLContext) egl_context; + return (SDL_GLContext)egl_context; } -int -SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) +int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) { - EGLContext egl_context = (EGLContext) context; + EGLContext egl_context = (EGLContext)context; if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); @@ -1108,7 +1097,7 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) /* Can't do the nothing there is to do? Probably trying to cleanup a failed startup, just return. */ return 0; } else { - return SDL_SetError("EGL not initialized"); /* something clearly went wrong somewhere. */ + return SDL_SetError("EGL not initialized"); /* something clearly went wrong somewhere. */ } } @@ -1117,14 +1106,14 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) _this->egl_data->eglBindAPI(_this->egl_data->apitype); } - /* The android emulator crashes badly if you try to eglMakeCurrent + /* The android emulator crashes badly if you try to eglMakeCurrent * with a valid context and invalid surface, so we have to check for both here. */ if (!egl_context || (!egl_surface && !_this->gl_allow_no_surface)) { - _this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + _this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } else { if (!_this->egl_data->eglMakeCurrent(_this->egl_data->egl_display, - egl_surface, egl_surface, egl_context)) { + egl_surface, egl_surface, egl_context)) { return SDL_EGL_SetError("Unable to make EGL context current", "eglMakeCurrent"); } } @@ -1132,11 +1121,10 @@ SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) return 0; } -int -SDL_EGL_SetSwapInterval(_THIS, int interval) +int SDL_EGL_SetSwapInterval(_THIS, int interval) { EGLBoolean status; - + if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); } @@ -1147,29 +1135,27 @@ SDL_EGL_SetSwapInterval(_THIS, int interval) if (interval < 0) { return SDL_SetError("Late swap tearing currently unsupported"); } - + status = _this->egl_data->eglSwapInterval(_this->egl_data->egl_display, interval); if (status == EGL_TRUE) { _this->egl_data->egl_swapinterval = interval; return 0; } - + return SDL_EGL_SetError("Unable to set the EGL swap interval", "eglSwapInterval"); } -int -SDL_EGL_GetSwapInterval(_THIS) +int SDL_EGL_GetSwapInterval(_THIS) { if (!_this->egl_data) { SDL_SetError("EGL not initialized"); return 0; } - + return _this->egl_data->egl_swapinterval; } -int -SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) +int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) { if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface)) { return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); @@ -1177,26 +1163,23 @@ SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) return 0; } -void -SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) +void SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) { - EGLContext egl_context = (EGLContext) context; + EGLContext egl_context = (EGLContext)context; /* Clean up GLES and EGL */ if (!_this->egl_data) { return; } - + if (egl_context != NULL && egl_context != EGL_NO_CONTEXT) { _this->egl_data->eglDestroyContext(_this->egl_data->egl_display, egl_context); } - } -EGLSurface * -SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) +EGLSurface *SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) { -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID EGLint format_wanted; EGLint format_got; #endif @@ -1204,18 +1187,18 @@ SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) EGLint attribs[5]; int attr = 0; - EGLSurface * surface; + EGLSurface *surface; if (SDL_EGL_ChooseConfig(_this) != 0) { return EGL_NO_SURFACE; } -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID /* On Android, EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). */ _this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, - _this->egl_data->egl_config, - EGL_NATIVE_VISUAL_ID, &format_wanted); + _this->egl_data->egl_config, + EGL_NATIVE_VISUAL_ID, &format_wanted); /* Format based on selected egl config. */ ANativeWindow_setBuffersGeometry(nw, 0, 0, format_wanted); @@ -1243,16 +1226,16 @@ SDL_EGL_CreateSurface(_THIS, NativeWindowType nw) #endif attribs[attr++] = EGL_NONE; - + surface = _this->egl_data->eglCreateWindowSurface( - _this->egl_data->egl_display, - _this->egl_data->egl_config, - nw, &attribs[0]); + _this->egl_data->egl_display, + _this->egl_data->egl_config, + nw, &attribs[0]); if (surface == EGL_NO_SURFACE) { SDL_EGL_SetError("unable to create an EGL window surface", "eglCreateWindowSurface"); } -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID format_got = ANativeWindow_getFormat(nw); Android_SetFormat(format_wanted, format_got); #endif @@ -1281,13 +1264,12 @@ SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height) attributes); } -void -SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) +void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) { if (!_this->egl_data) { return; } - + if (egl_surface != EGL_NO_SURFACE) { _this->egl_data->eglDestroySurface(_this->egl_data->egl_display, egl_surface); } @@ -1296,4 +1278,3 @@ SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) #endif /* SDL_VIDEO_OPENGL_EGL */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/SDL_egl_c.h b/src/video/SDL_egl_c.h index 76d26f93b0699..f6052617e62e4 100644 --- a/src/video/SDL_egl_c.h +++ b/src/video/SDL_egl_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,13 +23,13 @@ #ifndef SDL_egl_h_ #define SDL_egl_h_ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "SDL_egl.h" #include "SDL_sysvideo.h" -#define SDL_EGL_MAX_DEVICES 8 +#define SDL_EGL_MAX_DEVICES 8 typedef struct SDL_EGL_VideoData { @@ -42,7 +42,7 @@ typedef struct SDL_EGL_VideoData EGLint egl_required_visual_id; SDL_bool is_offscreen; /* whether EGL display was offscreen */ EGLenum apitype; /* EGL_OPENGL_ES_API, EGL_OPENGL_API, etc */ - + EGLDisplay(EGLAPIENTRY *eglGetDisplay) (NativeDisplayType display); EGLDisplay(EGLAPIENTRY *eglGetPlatformDisplay) (EGLenum platform, void *native_display, @@ -53,21 +53,21 @@ typedef struct SDL_EGL_VideoData EGLBoolean(EGLAPIENTRY *eglInitialize) (EGLDisplay dpy, EGLint * major, EGLint * minor); EGLBoolean(EGLAPIENTRY *eglTerminate) (EGLDisplay dpy); - + void *(EGLAPIENTRY *eglGetProcAddress) (const char * procName); - + EGLBoolean(EGLAPIENTRY *eglChooseConfig) (EGLDisplay dpy, const EGLint * attrib_list, EGLConfig * configs, EGLint config_size, EGLint * num_config); - + EGLContext(EGLAPIENTRY *eglCreateContext) (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint * attrib_list); - + EGLBoolean(EGLAPIENTRY *eglDestroyContext) (EGLDisplay dpy, EGLContext ctx); - + EGLSurface(EGLAPIENTRY *eglCreatePbufferSurface)(EGLDisplay dpy, EGLConfig config, EGLint const* attrib_list); @@ -76,25 +76,25 @@ typedef struct SDL_EGL_VideoData NativeWindowType window, const EGLint * attrib_list); EGLBoolean(EGLAPIENTRY *eglDestroySurface) (EGLDisplay dpy, EGLSurface surface); - + EGLBoolean(EGLAPIENTRY *eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); - + EGLBoolean(EGLAPIENTRY *eglSwapBuffers) (EGLDisplay dpy, EGLSurface draw); - + EGLBoolean(EGLAPIENTRY *eglSwapInterval) (EGLDisplay dpy, EGLint interval); - + const char *(EGLAPIENTRY *eglQueryString) (EGLDisplay dpy, EGLint name); EGLenum(EGLAPIENTRY *eglQueryAPI)(void); - + EGLBoolean(EGLAPIENTRY *eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); - + EGLBoolean(EGLAPIENTRY *eglWaitNative) (EGLint engine); EGLBoolean(EGLAPIENTRY *eglWaitGL)(void); - + EGLBoolean(EGLAPIENTRY *eglBindAPI)(EGLenum); EGLint(EGLAPIENTRY *eglGetError)(void); @@ -109,7 +109,7 @@ typedef struct SDL_EGL_VideoData EGLBoolean(EGLAPIENTRY *eglDestroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync); - EGLint(EGLAPIENTRY *eglDupNativeFenceFDANDROID)(EGLDisplay dpy, EGLSyncKHR sync); + EGLint(EGLAPIENTRY *eglDupNativeFenceFDANDROID)(EGLDisplay dpy, EGLSyncKHR sync); EGLint(EGLAPIENTRY *eglWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags); @@ -119,7 +119,8 @@ typedef struct SDL_EGL_VideoData } SDL_EGL_VideoData; /* OpenGLES functions */ -typedef enum SDL_EGL_ExtensionType { +typedef enum SDL_EGL_ExtensionType +{ SDL_EGL_DISPLAY_EXTENSION, SDL_EGL_CLIENT_EXTENSION } SDL_EGL_ExtensionType; @@ -152,28 +153,31 @@ extern int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext cont extern int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface); /* SDL Error-reporting */ -extern int SDL_EGL_SetErrorEx(const char * message, const char * eglFunctionName, EGLint eglErrorCode); +extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint eglErrorCode); #define SDL_EGL_SetError(message, eglFunctionName) SDL_EGL_SetErrorEx(message, eglFunctionName, _this->egl_data->eglGetError()) /* A few of useful macros */ -#define SDL_EGL_SwapWindow_impl(BACKEND) int \ -BACKEND ## _GLES_SwapWindow(_THIS, SDL_Window * window) \ -{\ - return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);\ -} - -#define SDL_EGL_MakeCurrent_impl(BACKEND) int \ -BACKEND ## _GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) \ -{\ - return SDL_EGL_MakeCurrent(_this, window ? ((SDL_WindowData *) window->driverdata)->egl_surface : EGL_NO_SURFACE, context);\ -} - -#define SDL_EGL_CreateContext_impl(BACKEND) SDL_GLContext \ -BACKEND ## _GLES_CreateContext(_THIS, SDL_Window * window) \ -{\ - return SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface);\ -} +#define SDL_EGL_SwapWindow_impl(BACKEND) \ + int \ + BACKEND##_GLES_SwapWindow(_THIS, SDL_Window *window) \ + { \ + return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); \ + } + +#define SDL_EGL_MakeCurrent_impl(BACKEND) \ + int \ + BACKEND##_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) \ + { \ + return SDL_EGL_MakeCurrent(_this, window ? ((SDL_WindowData *)window->driverdata)->egl_surface : EGL_NO_SURFACE, context); \ + } + +#define SDL_EGL_CreateContext_impl(BACKEND) \ + SDL_GLContext \ + BACKEND##_GLES_CreateContext(_THIS, SDL_Window *window) \ + { \ + return SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); \ + } #endif /* SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index 222d69e220c67..8d34f2ed5b2ff 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,6 @@ #include "SDL_blit.h" #include "SDL_cpuinfo.h" - #ifdef __SSE__ /* *INDENT-OFF* */ /* clang-format off */ @@ -58,13 +57,19 @@ #define SSE_END #define DEFINE_SSE_FILLRECT(bpp, type) \ -static void \ -SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ +static void SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ { \ int i, n; \ Uint8 *p = NULL; \ \ SSE_BEGIN; \ + \ + /* If the number of bytes per row is equal to the pitch, treat */ \ + /* all rows as one long continuous row (for better performance) */ \ + if ((w) * (bpp) == pitch) { \ + w = w * h; \ + h = 1; \ + } \ \ while (h--) { \ n = w * bpp; \ @@ -96,8 +101,7 @@ SDL_FillRect##bpp##SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ SSE_END; \ } -static void -SDL_FillRect1SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +static void SDL_FillRect1SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h) { int i, n; @@ -129,28 +133,84 @@ DEFINE_SSE_FILLRECT(2, Uint16) DEFINE_SSE_FILLRECT(4, Uint32) /* *INDENT-ON* */ /* clang-format on */ -#endif /* __SSE__ */ +#endif /* __SSE__ */ + +#if defined(__loongarch_sx) + +#define LSX_BEGIN __m128i c128 = __lsx_vreplgr2vr_w(color); -static void -SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +#define LSX_WORK \ + for (i = n / 64; i--;) { \ + __lsx_vst(c128, p, 0); \ + __lsx_vst(c128, p, 16); \ + __lsx_vst(c128, p, 32); \ + __lsx_vst(c128, p, 48); \ + p += 64; \ + } + +#define DEFINE_LSX_FILLRECT(bpp, type) \ +static void \ +SDL_FillRect##bpp##LSX(Uint8 *pixels, int pitch, Uint32 color, int w, int h) \ +{ \ + int i, n; \ + Uint8 *p = NULL; \ + \ + LSX_BEGIN; \ + \ + while (h--) { \ + n = w * bpp; \ + p = pixels; \ + \ + if (n > 63) { \ + int adjust = 16 - ((uintptr_t)p & 15); \ + if (adjust < 16) { \ + n -= adjust; \ + adjust /= bpp; \ + while (adjust--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + LSX_WORK; \ + } \ + if (n & 63) { \ + int remainder = (n & 63); \ + remainder /= bpp; \ + while (remainder--) { \ + *((type *)p) = (type)color; \ + p += bpp; \ + } \ + } \ + pixels += pitch; \ + } \ + \ +} + +DEFINE_LSX_FILLRECT(4, Uint32) + +#endif + +static void SDL_FillRect1(Uint8 *pixels, int pitch, Uint32 color, int w, int h) { int n; Uint8 *p = NULL; - + while (h--) { n = w; p = pixels; if (n > 3) { - switch ((uintptr_t) p & 3) { + switch ((uintptr_t)p & 3) { case 1: - *p++ = (Uint8) color; - --n; SDL_FALLTHROUGH; + *p++ = (Uint8)color; + --n; + SDL_FALLTHROUGH; case 2: - *p++ = (Uint8) color; - --n; SDL_FALLTHROUGH; + *p++ = (Uint8)color; + --n; + SDL_FALLTHROUGH; case 3: - *p++ = (Uint8) color; + *p++ = (Uint8)color; --n; } SDL_memset4(p, color, (n >> 2)); @@ -159,52 +219,52 @@ SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h) p += (n & ~3); switch (n & 3) { case 3: - *p++ = (Uint8) color; SDL_FALLTHROUGH; + *p++ = (Uint8)color; + SDL_FALLTHROUGH; case 2: - *p++ = (Uint8) color; SDL_FALLTHROUGH; + *p++ = (Uint8)color; + SDL_FALLTHROUGH; case 1: - *p++ = (Uint8) color; + *p++ = (Uint8)color; } } pixels += pitch; } } -static void -SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +static void SDL_FillRect2(Uint8 *pixels, int pitch, Uint32 color, int w, int h) { int n; Uint16 *p = NULL; - + while (h--) { n = w; - p = (Uint16 *) pixels; + p = (Uint16 *)pixels; if (n > 1) { - if ((uintptr_t) p & 2) { - *p++ = (Uint16) color; + if ((uintptr_t)p & 2) { + *p++ = (Uint16)color; --n; } SDL_memset4(p, color, (n >> 1)); } if (n & 1) { - p[n - 1] = (Uint16) color; + p[n - 1] = (Uint16)color; } pixels += pitch; } } -static void -SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +static void SDL_FillRect3(Uint8 *pixels, int pitch, Uint32 color, int w, int h) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN - Uint8 b1 = (Uint8) (color & 0xFF); - Uint8 b2 = (Uint8) ((color >> 8) & 0xFF); - Uint8 b3 = (Uint8) ((color >> 16) & 0xFF); + Uint8 b1 = (Uint8)(color & 0xFF); + Uint8 b2 = (Uint8)((color >> 8) & 0xFF); + Uint8 b3 = (Uint8)((color >> 16) & 0xFF); #elif SDL_BYTEORDER == SDL_BIG_ENDIAN - Uint8 b1 = (Uint8) ((color >> 16) & 0xFF); - Uint8 b2 = (Uint8) ((color >> 8) & 0xFF); - Uint8 b3 = (Uint8) (color & 0xFF); + Uint8 b1 = (Uint8)((color >> 16) & 0xFF); + Uint8 b2 = (Uint8)((color >> 8) & 0xFF); + Uint8 b3 = (Uint8)(color & 0xFF); #endif int n; Uint8 *p = NULL; @@ -222,8 +282,7 @@ SDL_FillRect3(Uint8 * pixels, int pitch, Uint32 color, int w, int h) } } -static void -SDL_FillRect4(Uint8 * pixels, int pitch, Uint32 color, int w, int h) +static void SDL_FillRect4(Uint8 *pixels, int pitch, Uint32 color, int w, int h) { while (h--) { SDL_memset4(pixels, color, w); @@ -231,11 +290,10 @@ SDL_FillRect4(Uint8 * pixels, int pitch, Uint32 color, int w, int h) } } -/* +/* * This function performs a fast fill of the given rectangle with 'color' */ -int -SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color) +int SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) { if (!dst) { return SDL_InvalidParamError("SDL_FillRect(): dst"); @@ -253,55 +311,60 @@ SDL_FillRect(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color) return SDL_FillRects(dst, rect, 1, color); } -#if SDL_ARM_NEON_BLITTERS +#ifdef SDL_ARM_NEON_BLITTERS void FillRect8ARMNEONAsm(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); void FillRect16ARMNEONAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint16_t src); void FillRect32ARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t src); -static void fill_8_neon(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect8ARMNEONAsm(w, h, (uint8_t *) pixels, pitch >> 0, color); +static void fill_8_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect8ARMNEONAsm(w, h, (uint8_t *)pixels, pitch >> 0, color); return; } -static void fill_16_neon(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect16ARMNEONAsm(w, h, (uint16_t *) pixels, pitch >> 1, color); +static void fill_16_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect16ARMNEONAsm(w, h, (uint16_t *)pixels, pitch >> 1, color); return; } -static void fill_32_neon(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect32ARMNEONAsm(w, h, (uint32_t *) pixels, pitch >> 2, color); +static void fill_32_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect32ARMNEONAsm(w, h, (uint32_t *)pixels, pitch >> 2, color); return; } #endif -#if SDL_ARM_SIMD_BLITTERS +#ifdef SDL_ARM_SIMD_BLITTERS void FillRect8ARMSIMDAsm(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); void FillRect16ARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint16_t src); void FillRect32ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t src); -static void fill_8_simd(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect8ARMSIMDAsm(w, h, (uint8_t *) pixels, pitch >> 0, color); +static void fill_8_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect8ARMSIMDAsm(w, h, (uint8_t *)pixels, pitch >> 0, color); return; } -static void fill_16_simd(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect16ARMSIMDAsm(w, h, (uint16_t *) pixels, pitch >> 1, color); +static void fill_16_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect16ARMSIMDAsm(w, h, (uint16_t *)pixels, pitch >> 1, color); return; } -static void fill_32_simd(Uint8 * pixels, int pitch, Uint32 color, int w, int h) { - FillRect32ARMSIMDAsm(w, h, (uint32_t *) pixels, pitch >> 2, color); +static void fill_32_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) +{ + FillRect32ARMSIMDAsm(w, h, (uint32_t *)pixels, pitch >> 2, color); return; } #endif -int -SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, - Uint32 color) +int SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, + Uint32 color) { SDL_Rect clipped; Uint8 *pixels; - const SDL_Rect* rect; + const SDL_Rect *rect; void (*fill_function)(Uint8 * pixels, int pitch, Uint32 color, int w, int h) = NULL; int i; @@ -331,8 +394,8 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, const SDL_Rect *r = &rects[0]; if (r->x == 0 && r->y == 0 && r->w == dst->w && r->h == dst->h) { if (dst->format->BitsPerPixel == 4) { - Uint8 b = (((Uint8) color << 4) | (Uint8) color); - SDL_memset(dst->pixels, b, dst->h * dst->pitch); + Uint8 b = (((Uint8)color << 4) | (Uint8)color); + SDL_memset(dst->pixels, b, (size_t)dst->h * dst->pitch); return 1; } } @@ -340,8 +403,8 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, return SDL_SetError("SDL_FillRects(): Unsupported surface format"); } -#if SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON() && dst->format->BytesPerPixel != 3 && fill_function == NULL) { +#ifdef SDL_ARM_NEON_BLITTERS + if (SDL_HasNEON() && dst->format->BytesPerPixel != 3 && !fill_function) { switch (dst->format->BytesPerPixel) { case 1: fill_function = fill_8_neon; @@ -355,8 +418,8 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, } } #endif -#if SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD() && dst->format->BytesPerPixel != 3 && fill_function == NULL) { +#ifdef SDL_ARM_SIMD_BLITTERS + if (SDL_HasARMSIMD() && dst->format->BytesPerPixel != 3 && !fill_function) { switch (dst->format->BytesPerPixel) { case 1: fill_function = fill_8_simd; @@ -371,34 +434,34 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, } #endif - if (fill_function == NULL) { + if (!fill_function) { switch (dst->format->BytesPerPixel) { case 1: - { - color |= (color << 8); - color |= (color << 16); + { + color |= (color << 8); + color |= (color << 16); #ifdef __SSE__ - if (SDL_HasSSE()) { - fill_function = SDL_FillRect1SSE; - break; - } -#endif - fill_function = SDL_FillRect1; + if (SDL_HasSSE()) { + fill_function = SDL_FillRect1SSE; break; } +#endif + fill_function = SDL_FillRect1; + break; + } case 2: - { - color |= (color << 16); + { + color |= (color << 16); #ifdef __SSE__ - if (SDL_HasSSE()) { - fill_function = SDL_FillRect2SSE; - break; - } -#endif - fill_function = SDL_FillRect2; + if (SDL_HasSSE()) { + fill_function = SDL_FillRect2SSE; break; } +#endif + fill_function = SDL_FillRect2; + break; + } case 3: /* 24-bit RGB is a slow path, at least for now. */ @@ -408,16 +471,23 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, } case 4: - { + { #ifdef __SSE__ - if (SDL_HasSSE()) { - fill_function = SDL_FillRect4SSE; + if (SDL_HasSSE()) { + fill_function = SDL_FillRect4SSE; + break; + } +#endif + +#ifdef __loongarch_sx + if (SDL_HasLSX()) { + fill_function = SDL_FillRect4LSX; break; } #endif - fill_function = SDL_FillRect4; - break; - } + fill_function = SDL_FillRect4; + break; + } default: return SDL_SetError("Unsupported pixel format"); @@ -432,8 +502,8 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, } rect = &clipped; - pixels = (Uint8 *) dst->pixels + rect->y * dst->pitch + - rect->x * dst->format->BytesPerPixel; + pixels = (Uint8 *)dst->pixels + rect->y * dst->pitch + + rect->x * dst->format->BytesPerPixel; fill_function(pixels, dst->pitch, color, rect->w, rect->h); } diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 654453278b2a0..034b47c611d31 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,46 +30,45 @@ #include "SDL_RLEaccel_c.h" #include "../SDL_list.h" - /* Lookup tables to expand partial bytes to the full 0..255 range */ static Uint8 lookup_0[] = { -0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; static Uint8 lookup_1[] = { -0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 }; static Uint8 lookup_2[] = { -0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 }; static Uint8 lookup_3[] = { -0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 + 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 }; static Uint8 lookup_4[] = { -0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 + 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 }; static Uint8 lookup_5[] = { -0, 36, 72, 109, 145, 182, 218, 255 + 0, 36, 72, 109, 145, 182, 218, 255 }; static Uint8 lookup_6[] = { -0, 85, 170, 255 + 0, 85, 170, 255 }; static Uint8 lookup_7[] = { -0, 255 + 0, 255 }; static Uint8 lookup_8[] = { -255 + 255 }; -Uint8* SDL_expand_byte[9] = { +Uint8 *SDL_expand_byte[9] = { lookup_0, lookup_1, lookup_2, @@ -83,59 +82,63 @@ Uint8* SDL_expand_byte[9] = { /* Helper functions */ -const char* -SDL_GetPixelFormatName(Uint32 format) +#define CASE(X) \ + case X: \ + return #X; +const char *SDL_GetPixelFormatName(Uint32 format) { switch (format) { -#define CASE(X) case X: return #X; - CASE(SDL_PIXELFORMAT_INDEX1LSB) - CASE(SDL_PIXELFORMAT_INDEX1MSB) - CASE(SDL_PIXELFORMAT_INDEX4LSB) - CASE(SDL_PIXELFORMAT_INDEX4MSB) - CASE(SDL_PIXELFORMAT_INDEX8) - CASE(SDL_PIXELFORMAT_RGB332) - CASE(SDL_PIXELFORMAT_RGB444) - CASE(SDL_PIXELFORMAT_BGR444) - CASE(SDL_PIXELFORMAT_RGB555) - CASE(SDL_PIXELFORMAT_BGR555) - CASE(SDL_PIXELFORMAT_ARGB4444) - CASE(SDL_PIXELFORMAT_RGBA4444) - CASE(SDL_PIXELFORMAT_ABGR4444) - CASE(SDL_PIXELFORMAT_BGRA4444) - CASE(SDL_PIXELFORMAT_ARGB1555) - CASE(SDL_PIXELFORMAT_RGBA5551) - CASE(SDL_PIXELFORMAT_ABGR1555) - CASE(SDL_PIXELFORMAT_BGRA5551) - CASE(SDL_PIXELFORMAT_RGB565) - CASE(SDL_PIXELFORMAT_BGR565) - CASE(SDL_PIXELFORMAT_RGB24) - CASE(SDL_PIXELFORMAT_BGR24) - CASE(SDL_PIXELFORMAT_RGB888) - CASE(SDL_PIXELFORMAT_RGBX8888) - CASE(SDL_PIXELFORMAT_BGR888) - CASE(SDL_PIXELFORMAT_BGRX8888) - CASE(SDL_PIXELFORMAT_ARGB8888) - CASE(SDL_PIXELFORMAT_RGBA8888) - CASE(SDL_PIXELFORMAT_ABGR8888) - CASE(SDL_PIXELFORMAT_BGRA8888) - CASE(SDL_PIXELFORMAT_ARGB2101010) - CASE(SDL_PIXELFORMAT_YV12) - CASE(SDL_PIXELFORMAT_IYUV) - CASE(SDL_PIXELFORMAT_YUY2) - CASE(SDL_PIXELFORMAT_UYVY) - CASE(SDL_PIXELFORMAT_YVYU) - CASE(SDL_PIXELFORMAT_NV12) - CASE(SDL_PIXELFORMAT_NV21) - CASE(SDL_PIXELFORMAT_EXTERNAL_OES) -#undef CASE + + CASE(SDL_PIXELFORMAT_INDEX1LSB) + CASE(SDL_PIXELFORMAT_INDEX1MSB) + CASE(SDL_PIXELFORMAT_INDEX2LSB) + CASE(SDL_PIXELFORMAT_INDEX2MSB) + CASE(SDL_PIXELFORMAT_INDEX4LSB) + CASE(SDL_PIXELFORMAT_INDEX4MSB) + CASE(SDL_PIXELFORMAT_INDEX8) + CASE(SDL_PIXELFORMAT_RGB332) + CASE(SDL_PIXELFORMAT_RGB444) + CASE(SDL_PIXELFORMAT_BGR444) + CASE(SDL_PIXELFORMAT_RGB555) + CASE(SDL_PIXELFORMAT_BGR555) + CASE(SDL_PIXELFORMAT_ARGB4444) + CASE(SDL_PIXELFORMAT_RGBA4444) + CASE(SDL_PIXELFORMAT_ABGR4444) + CASE(SDL_PIXELFORMAT_BGRA4444) + CASE(SDL_PIXELFORMAT_ARGB1555) + CASE(SDL_PIXELFORMAT_RGBA5551) + CASE(SDL_PIXELFORMAT_ABGR1555) + CASE(SDL_PIXELFORMAT_BGRA5551) + CASE(SDL_PIXELFORMAT_RGB565) + CASE(SDL_PIXELFORMAT_BGR565) + CASE(SDL_PIXELFORMAT_RGB24) + CASE(SDL_PIXELFORMAT_BGR24) + CASE(SDL_PIXELFORMAT_RGB888) + CASE(SDL_PIXELFORMAT_RGBX8888) + CASE(SDL_PIXELFORMAT_BGR888) + CASE(SDL_PIXELFORMAT_BGRX8888) + CASE(SDL_PIXELFORMAT_ARGB8888) + CASE(SDL_PIXELFORMAT_RGBA8888) + CASE(SDL_PIXELFORMAT_ABGR8888) + CASE(SDL_PIXELFORMAT_BGRA8888) + CASE(SDL_PIXELFORMAT_ARGB2101010) + CASE(SDL_PIXELFORMAT_YV12) + CASE(SDL_PIXELFORMAT_IYUV) + CASE(SDL_PIXELFORMAT_YUY2) + CASE(SDL_PIXELFORMAT_UYVY) + CASE(SDL_PIXELFORMAT_YVYU) + CASE(SDL_PIXELFORMAT_NV12) + CASE(SDL_PIXELFORMAT_NV21) + CASE(SDL_PIXELFORMAT_EXTERNAL_OES) + default: return "SDL_PIXELFORMAT_UNKNOWN"; } } +#undef CASE -SDL_bool -SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, - Uint32 * Gmask, Uint32 * Bmask, Uint32 * Amask) +SDL_bool SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 *Rmask, + Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) { Uint32 masks[4]; @@ -292,14 +295,15 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask, return SDL_TRUE; } -Uint32 -SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, - Uint32 Amask) +Uint32 SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { switch (bpp) { case 1: /* SDL defaults to MSB ordering */ return SDL_PIXELFORMAT_INDEX1MSB; + case 2: + /* SDL defaults to MSB ordering */ + return SDL_PIXELFORMAT_INDEX2MSB; case 4: /* SDL defaults to MSB ordering */ return SDL_PIXELFORMAT_INDEX4MSB; @@ -502,8 +506,7 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, static SDL_PixelFormat *formats; static SDL_SpinLock formats_lock = 0; -SDL_PixelFormat * -SDL_AllocFormat(Uint32 pixel_format) +SDL_PixelFormat *SDL_AllocFormat(Uint32 pixel_format) { SDL_PixelFormat *format; @@ -520,7 +523,7 @@ SDL_AllocFormat(Uint32 pixel_format) /* Allocate an empty pixel format structure, and initialize it */ format = SDL_malloc(sizeof(*format)); - if (format == NULL) { + if (!format) { SDL_AtomicUnlock(&formats_lock); SDL_OutOfMemory(); return NULL; @@ -528,7 +531,6 @@ SDL_AllocFormat(Uint32 pixel_format) if (SDL_InitFormat(format, pixel_format) < 0) { SDL_AtomicUnlock(&formats_lock); SDL_free(format); - SDL_InvalidParamError("format"); return NULL; } @@ -543,8 +545,7 @@ SDL_AllocFormat(Uint32 pixel_format) return format; } -int -SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format) +int SDL_InitFormat(SDL_PixelFormat *format, Uint32 pixel_format) { int bpp; Uint32 Rmask, Gmask, Bmask, Amask; @@ -565,40 +566,48 @@ SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format) format->Rshift = 0; format->Rloss = 8; if (Rmask) { - for (mask = Rmask; !(mask & 0x01); mask >>= 1) + for (mask = Rmask; !(mask & 0x01); mask >>= 1) { ++format->Rshift; - for (; (mask & 0x01); mask >>= 1) + } + for (; (mask & 0x01); mask >>= 1) { --format->Rloss; + } } format->Gmask = Gmask; format->Gshift = 0; format->Gloss = 8; if (Gmask) { - for (mask = Gmask; !(mask & 0x01); mask >>= 1) + for (mask = Gmask; !(mask & 0x01); mask >>= 1) { ++format->Gshift; - for (; (mask & 0x01); mask >>= 1) + } + for (; (mask & 0x01); mask >>= 1) { --format->Gloss; + } } format->Bmask = Bmask; format->Bshift = 0; format->Bloss = 8; if (Bmask) { - for (mask = Bmask; !(mask & 0x01); mask >>= 1) + for (mask = Bmask; !(mask & 0x01); mask >>= 1) { ++format->Bshift; - for (; (mask & 0x01); mask >>= 1) + } + for (; (mask & 0x01); mask >>= 1) { --format->Bloss; + } } format->Amask = Amask; format->Ashift = 0; format->Aloss = 8; if (Amask) { - for (mask = Amask; !(mask & 0x01); mask >>= 1) + for (mask = Amask; !(mask & 0x01); mask >>= 1) { ++format->Ashift; - for (; (mask & 0x01); mask >>= 1) + } + for (; (mask & 0x01); mask >>= 1) { --format->Aloss; + } } format->palette = NULL; @@ -608,8 +617,7 @@ SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format) return 0; } -void -SDL_FreeFormat(SDL_PixelFormat *format) +void SDL_FreeFormat(SDL_PixelFormat *format) { SDL_PixelFormat *prev; @@ -645,26 +653,26 @@ SDL_FreeFormat(SDL_PixelFormat *format) SDL_free(format); } -SDL_Palette * -SDL_AllocPalette(int ncolors) +SDL_Palette *SDL_AllocPalette(int ncolors) { SDL_Palette *palette; /* Input validation */ if (ncolors < 1) { - SDL_InvalidParamError("ncolors"); - return NULL; + SDL_InvalidParamError("ncolors"); + return NULL; } - palette = (SDL_Palette *) SDL_malloc(sizeof(*palette)); + palette = (SDL_Palette *)SDL_malloc(sizeof(*palette)); if (!palette) { SDL_OutOfMemory(); return NULL; } palette->colors = - (SDL_Color *) SDL_malloc(ncolors * sizeof(*palette->colors)); + (SDL_Color *)SDL_malloc(ncolors * sizeof(*palette->colors)); if (!palette->colors) { SDL_free(palette); + SDL_OutOfMemory(); return NULL; } palette->ncolors = ncolors; @@ -676,8 +684,7 @@ SDL_AllocPalette(int ncolors) return palette; } -int -SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette) +int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette) { if (!format) { return SDL_InvalidParamError("SDL_SetPixelFormatPalette(): format"); @@ -704,9 +711,8 @@ SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette) return 0; } -int -SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors, - int firstcolor, int ncolors) +int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, + int firstcolor, int ncolors) { int status = 0; @@ -731,8 +737,7 @@ SDL_SetPaletteColors(SDL_Palette * palette, const SDL_Color * colors, return status; } -void -SDL_FreePalette(SDL_Palette * palette) +void SDL_FreePalette(SDL_Palette *palette) { if (!palette) { SDL_InvalidParamError("palette"); @@ -748,12 +753,12 @@ SDL_FreePalette(SDL_Palette * palette) /* * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors */ -void -SDL_DitherColors(SDL_Color * colors, int bpp) +void SDL_DitherColors(SDL_Color *colors, int bpp) { int i; - if (bpp != 8) - return; /* only 8bpp supported right now */ + if (bpp != 8) { + return; /* only 8bpp supported right now */ + } for (i = 0; i < 256; i++) { int r, g, b; @@ -776,8 +781,7 @@ SDL_DitherColors(SDL_Color * colors, int bpp) /* * Match an RGB value to a particular palette index */ -Uint8 -SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* Do colorspace distance matching */ unsigned int smallest; @@ -795,18 +799,17 @@ SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) distance = (rd * rd) + (gd * gd) + (bd * bd) + (ad * ad); if (distance < smallest) { pixel = i; - if (distance == 0) { /* Perfect match! */ + if (distance == 0) { /* Perfect match! */ break; } smallest = distance; } } - return (pixel); + return pixel; } /* Tell whether palette is opaque, and if it has an alpha_channel */ -void -SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel) +void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel) { int i; @@ -851,40 +854,38 @@ SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_cha *has_alpha_channel = SDL_TRUE; } - /* Find the opaque pixel value corresponding to an RGB triple */ -Uint32 -SDL_MapRGB(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b) +Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) { - if (format->palette == NULL) { - return (r >> format->Rloss) << format->Rshift - | (g >> format->Gloss) << format->Gshift - | (b >> format->Bloss) << format->Bshift | format->Amask; + if (!format) { + SDL_InvalidParamError("format"); + return 0; + } + if (!format->palette) { + return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; } else { return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE); } } /* Find the pixel value corresponding to an RGBA quadruple */ -Uint32 -SDL_MapRGBA(const SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b, - Uint8 a) +Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - if (format->palette == NULL) { - return (r >> format->Rloss) << format->Rshift - | (g >> format->Gloss) << format->Gshift - | (b >> format->Bloss) << format->Bshift - | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); + if (!format) { + SDL_InvalidParamError("format"); + return 0; + } + if (!format->palette) { + return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); } else { return SDL_FindColor(format->palette, r, g, b, a); } } -void -SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g, - Uint8 * b) +void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, + Uint8 *b) { - if (format->palette == NULL) { + if (!format->palette) { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; *r = SDL_expand_byte[format->Rloss][v]; @@ -903,11 +904,10 @@ SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * format, Uint8 * r, Uint8 * g, } } -void -SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) +void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { - if (format->palette == NULL) { + if (!format->palette) { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; *r = SDL_expand_byte[format->Rloss][v]; @@ -930,8 +930,7 @@ SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * format, } /* Map from Palette to Palette */ -static Uint8 * -Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical) +static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical) { Uint8 *map; int i; @@ -939,34 +938,31 @@ Map1to1(SDL_Palette * src, SDL_Palette * dst, int *identical) if (identical) { if (src->ncolors <= dst->ncolors) { /* If an identical palette, no need to map */ - if (src == dst - || - (SDL_memcmp - (src->colors, dst->colors, - src->ncolors * sizeof(SDL_Color)) == 0)) { + if (src == dst || + (SDL_memcmp(src->colors, dst->colors, + src->ncolors * sizeof(SDL_Color)) == 0)) { *identical = 1; - return (NULL); + return NULL; } } *identical = 0; } - map = (Uint8 *) SDL_calloc(256, sizeof(Uint8)); - if (map == NULL) { + map = (Uint8 *)SDL_calloc(256, sizeof(Uint8)); + if (!map) { SDL_OutOfMemory(); - return (NULL); + return NULL; } for (i = 0; i < src->ncolors; ++i) { map[i] = SDL_FindColor(dst, src->colors[i].r, src->colors[i].g, src->colors[i].b, src->colors[i].a); } - return (map); + return map; } /* Map from Palette to BitField */ -static Uint8 * -Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, - SDL_PixelFormat * dst) +static Uint8 *Map1toN(SDL_PixelFormat *src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, + SDL_PixelFormat *dst) { Uint8 *map; int i; @@ -974,26 +970,25 @@ Map1toN(SDL_PixelFormat * src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, SDL_Palette *pal = src->palette; bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel); - map = (Uint8 *) SDL_calloc(256, bpp); - if (map == NULL) { + map = (Uint8 *)SDL_calloc(256, bpp); + if (!map) { SDL_OutOfMemory(); - return (NULL); + return NULL; } /* We memory copy to the pixel map so the endianness is preserved */ for (i = 0; i < pal->ncolors; ++i) { - Uint8 R = (Uint8) ((pal->colors[i].r * Rmod) / 255); - Uint8 G = (Uint8) ((pal->colors[i].g * Gmod) / 255); - Uint8 B = (Uint8) ((pal->colors[i].b * Bmod) / 255); - Uint8 A = (Uint8) ((pal->colors[i].a * Amod) / 255); + Uint8 R = (Uint8)((pal->colors[i].r * Rmod) / 255); + Uint8 G = (Uint8)((pal->colors[i].g * Gmod) / 255); + Uint8 B = (Uint8)((pal->colors[i].b * Bmod) / 255); + Uint8 A = (Uint8)((pal->colors[i].a * Amod) / 255); ASSEMBLE_RGBA(&map[i * bpp], dst->BytesPerPixel, dst, (Uint32)R, (Uint32)G, (Uint32)B, (Uint32)A); } - return (map); + return map; } /* Map from BitField to Dithered-Palette to Palette */ -static Uint8 * -MapNto1(SDL_PixelFormat * src, SDL_PixelFormat * dst, int *identical) +static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical) { /* Generate a 256 color dither palette */ SDL_Palette dithered; @@ -1003,19 +998,18 @@ MapNto1(SDL_PixelFormat * src, SDL_PixelFormat * dst, int *identical) dithered.ncolors = 256; SDL_DitherColors(colors, 8); dithered.colors = colors; - return (Map1to1(&dithered, pal, identical)); + return Map1to1(&dithered, pal, identical); } -SDL_BlitMap * -SDL_AllocBlitMap(void) +SDL_BlitMap *SDL_AllocBlitMap(void) { SDL_BlitMap *map; /* Allocate the empty map */ - map = (SDL_BlitMap *) SDL_calloc(1, sizeof(*map)); - if (map == NULL) { + map = (SDL_BlitMap *)SDL_calloc(1, sizeof(*map)); + if (!map) { SDL_OutOfMemory(); - return (NULL); + return NULL; } map->info.r = 0xFF; map->info.g = 0xFF; @@ -1023,12 +1017,10 @@ SDL_AllocBlitMap(void) map->info.a = 0xFF; /* It's ready to go */ - return (map); + return map; } - -void -SDL_InvalidateAllBlitMap(SDL_Surface *surface) +void SDL_InvalidateAllBlitMap(SDL_Surface *surface) { SDL_ListNode *l = surface->list_blitmap; @@ -1042,8 +1034,7 @@ SDL_InvalidateAllBlitMap(SDL_Surface *surface) } } -void -SDL_InvalidateMap(SDL_BlitMap * map) +void SDL_InvalidateMap(SDL_BlitMap *map) { if (!map) { return; @@ -1059,8 +1050,7 @@ SDL_InvalidateMap(SDL_BlitMap * map) map->info.table = NULL; } -int -SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) +int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) { SDL_PixelFormat *srcfmt; SDL_PixelFormat *dstfmt; @@ -1085,19 +1075,20 @@ SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) map->info.table = Map1to1(srcfmt->palette, dstfmt->palette, &map->identity); if (!map->identity) { - if (map->info.table == NULL) { - return (-1); + if (!map->info.table) { + return -1; } } - if (srcfmt->BitsPerPixel != dstfmt->BitsPerPixel) + if (srcfmt->BitsPerPixel != dstfmt->BitsPerPixel) { map->identity = 0; + } } else { /* Palette --> BitField */ map->info.table = Map1toN(srcfmt, src->map->info.r, src->map->info.g, src->map->info.b, src->map->info.a, dstfmt); - if (map->info.table == NULL) { - return (-1); + if (!map->info.table) { + return -1; } } } else { @@ -1105,11 +1096,11 @@ SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) /* BitField --> Palette */ map->info.table = MapNto1(srcfmt, dstfmt, &map->identity); if (!map->identity) { - if (map->info.table == NULL) { - return (-1); + if (!map->info.table) { + return -1; } } - map->identity = 0; /* Don't optimize to copy */ + map->identity = 0; /* Don't optimize to copy */ } else { /* BitField --> BitField */ if (srcfmt == dstfmt) { @@ -1138,11 +1129,10 @@ SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst) } /* Choose your blitters wisely */ - return (SDL_CalculateBlit(src)); + return SDL_CalculateBlit(src); } -void -SDL_FreeBlitMap(SDL_BlitMap * map) +void SDL_FreeBlitMap(SDL_BlitMap *map) { if (map) { SDL_InvalidateMap(map); @@ -1150,8 +1140,7 @@ SDL_FreeBlitMap(SDL_BlitMap * map) } } -void -SDL_CalculateGammaRamp(float gamma, Uint16 * ramp) +void SDL_CalculateGammaRamp(float gamma, Uint16 * ramp) { int i; @@ -1160,7 +1149,7 @@ SDL_CalculateGammaRamp(float gamma, Uint16 * ramp) SDL_InvalidParamError("gamma"); return; } - if (ramp == NULL) { + if (!ramp) { SDL_InvalidParamError("ramp"); return; } diff --git a/src/video/SDL_pixels_c.h b/src/video/SDL_pixels_c.h index 828fe3bd8cdb6..6ad77c3b1289f 100644 --- a/src/video/SDL_pixels_c.h +++ b/src/video/SDL_pixels_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,19 +29,19 @@ #include "SDL_blit.h" /* Pixel format functions */ -extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format); +extern int SDL_InitFormat(SDL_PixelFormat *format, Uint32 pixel_format); /* Blit mapping functions */ extern SDL_BlitMap *SDL_AllocBlitMap(void); -extern void SDL_InvalidateMap(SDL_BlitMap * map); -extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst); -extern void SDL_FreeBlitMap(SDL_BlitMap * map); +extern void SDL_InvalidateMap(SDL_BlitMap *map); +extern int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst); +extern void SDL_FreeBlitMap(SDL_BlitMap *map); extern void SDL_InvalidateAllBlitMap(SDL_Surface *surface); /* Miscellaneous functions */ -extern void SDL_DitherColors(SDL_Color * colors, int bpp); -extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern void SDL_DitherColors(SDL_Color *colors, int bpp); +extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel); #endif /* SDL_pixels_c_h_ */ diff --git a/src/video/SDL_rect.c b/src/video/SDL_rect.c index dfa939032a45f..77653c8edbbf4 100644 --- a/src/video/SDL_rect.c +++ b/src/video/SDL_rect.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,9 +25,8 @@ /* There's no float version of this at the moment, because it's not a public API and internally we only need the int version. */ -SDL_bool -SDL_GetSpanEnclosingRect(int width, int height, - int numrects, const SDL_Rect * rects, SDL_Rect *span) +SDL_bool SDL_GetSpanEnclosingRect(int width, int height, + int numrects, const SDL_Rect *rects, SDL_Rect *span) { int i; int span_y1, span_y2; @@ -80,7 +79,6 @@ SDL_GetSpanEnclosingRect(int width, int height, return SDL_FALSE; } - /* For use with the Cohen-Sutherland algorithm for line clipping, in SDL_rect_impl.h */ #define CODE_BOTTOM 1 #define CODE_TOP 2 @@ -88,27 +86,29 @@ SDL_GetSpanEnclosingRect(int width, int height, #define CODE_RIGHT 8 /* Same code twice, for float and int versions... */ -#define RECTTYPE SDL_Rect -#define POINTTYPE SDL_Point -#define SCALARTYPE int -#define COMPUTEOUTCODE ComputeOutCode -#define SDL_HASINTERSECTION SDL_HasIntersection -#define SDL_INTERSECTRECT SDL_IntersectRect -#define SDL_RECTEMPTY SDL_RectEmpty -#define SDL_UNIONRECT SDL_UnionRect -#define SDL_ENCLOSEPOINTS SDL_EnclosePoints +#define RECTTYPE SDL_Rect +#define POINTTYPE SDL_Point +#define SCALARTYPE int +#define BIGSCALARTYPE Sint64 +#define COMPUTEOUTCODE ComputeOutCode +#define SDL_HASINTERSECTION SDL_HasIntersection +#define SDL_INTERSECTRECT SDL_IntersectRect +#define SDL_RECTEMPTY SDL_RectEmpty +#define SDL_UNIONRECT SDL_UnionRect +#define SDL_ENCLOSEPOINTS SDL_EnclosePoints #define SDL_INTERSECTRECTANDLINE SDL_IntersectRectAndLine #include "SDL_rect_impl.h" -#define RECTTYPE SDL_FRect -#define POINTTYPE SDL_FPoint -#define SCALARTYPE float -#define COMPUTEOUTCODE ComputeOutCodeF -#define SDL_HASINTERSECTION SDL_HasIntersectionF -#define SDL_INTERSECTRECT SDL_IntersectFRect -#define SDL_RECTEMPTY SDL_FRectEmpty -#define SDL_UNIONRECT SDL_UnionFRect -#define SDL_ENCLOSEPOINTS SDL_EncloseFPoints +#define RECTTYPE SDL_FRect +#define POINTTYPE SDL_FPoint +#define SCALARTYPE float +#define BIGSCALARTYPE double +#define COMPUTEOUTCODE ComputeOutCodeF +#define SDL_HASINTERSECTION SDL_HasIntersectionF +#define SDL_INTERSECTRECT SDL_IntersectFRect +#define SDL_RECTEMPTY SDL_FRectEmpty +#define SDL_UNIONRECT SDL_UnionFRect +#define SDL_ENCLOSEPOINTS SDL_EncloseFPoints #define SDL_INTERSECTRECTANDLINE SDL_IntersectFRectAndLine #include "SDL_rect_impl.h" diff --git a/src/video/SDL_rect_c.h b/src/video/SDL_rect_c.h index 6205abc70469b..bcd96585e9611 100644 --- a/src/video/SDL_rect_c.h +++ b/src/video/SDL_rect_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ #include "../SDL_internal.h" -extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span); +extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect *rects, SDL_Rect *span); #endif /* SDL_rect_c_h_ */ diff --git a/src/video/SDL_rect_impl.h b/src/video/SDL_rect_impl.h index 26a54484acdcd..31f2a23c928e9 100644 --- a/src/video/SDL_rect_impl.h +++ b/src/video/SDL_rect_impl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,8 +21,7 @@ /* This file is #included twice to support int and float versions with the same code. */ -SDL_bool -SDL_HASINTERSECTION(const RECTTYPE * A, const RECTTYPE * B) +SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -32,8 +31,6 @@ SDL_HASINTERSECTION(const RECTTYPE * A, const RECTTYPE * B) } else if (!B) { SDL_InvalidParamError("B"); return SDL_FALSE; - } else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { - return SDL_FALSE; /* Special cases for empty rects */ } /* Horizontal intersection */ @@ -67,8 +64,7 @@ SDL_HASINTERSECTION(const RECTTYPE * A, const RECTTYPE * B) return SDL_TRUE; } -SDL_bool -SDL_INTERSECTRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) +SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -81,10 +77,6 @@ SDL_INTERSECTRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) } else if (!result) { SDL_InvalidParamError("result"); return SDL_FALSE; - } else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { /* Special cases for empty rects */ - result->w = 0; - result->h = 0; - return SDL_FALSE; } /* Horizontal intersection */ @@ -118,8 +110,7 @@ SDL_INTERSECTRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) return !SDL_RECTEMPTY(result); } -void -SDL_UNIONRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) +void SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) { SCALARTYPE Amin, Amax, Bmin, Bmax; @@ -132,16 +123,16 @@ SDL_UNIONRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) } else if (!result) { SDL_InvalidParamError("result"); return; - } else if (SDL_RECTEMPTY(A)) { /* Special cases for empty Rects */ - if (SDL_RECTEMPTY(B)) { /* A and B empty */ + } else if (SDL_RECTEMPTY(A)) { /* Special cases for empty Rects */ + if (SDL_RECTEMPTY(B)) { /* A and B empty */ SDL_zerop(result); - } else { /* A empty, B not empty */ + } else { /* A empty, B not empty */ *result = *B; } return; - } else if (SDL_RECTEMPTY(B)) { /* A not empty, B empty */ - *result = *A; - return; + } else if (SDL_RECTEMPTY(B)) { /* A not empty, B empty */ + *result = *A; + return; } /* Horizontal union */ @@ -173,8 +164,8 @@ SDL_UNIONRECT(const RECTTYPE * A, const RECTTYPE * B, RECTTYPE * result) result->h = Amax - Amin; } -SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE * clip, - RECTTYPE * result) +SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE *points, int count, const RECTTYPE *clip, + RECTTYPE *result) { SCALARTYPE minx = 0; SCALARTYPE miny = 0; @@ -195,8 +186,8 @@ SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE * SDL_bool added = SDL_FALSE; const SCALARTYPE clip_minx = clip->x; const SCALARTYPE clip_miny = clip->y; - const SCALARTYPE clip_maxx = clip->x+clip->w-1; - const SCALARTYPE clip_maxy = clip->y+clip->h-1; + const SCALARTYPE clip_maxx = clip->x + clip->w - 1; + const SCALARTYPE clip_maxy = clip->y + clip->h - 1; /* Special case for empty rectangle */ if (SDL_RECTEMPTY(clip)) { @@ -213,7 +204,7 @@ SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE * } if (!added) { /* Special case: if no result was requested, we are done */ - if (result == NULL) { + if (!result) { return SDL_TRUE; } @@ -239,7 +230,7 @@ SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE * } } else { /* Special case: if no result was requested, we are done */ - if (result == NULL) { + if (!result) { return SDL_TRUE; } @@ -267,15 +258,14 @@ SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE * points, int count, const RECTTYPE * if (result) { result->x = minx; result->y = miny; - result->w = (maxx-minx)+1; - result->h = (maxy-miny)+1; + result->w = (maxx - minx) + 1; + result->h = (maxy - miny) + 1; } return SDL_TRUE; } /* Use the Cohen-Sutherland algorithm for line clipping */ -static int -COMPUTEOUTCODE(const RECTTYPE * rect, SCALARTYPE x, SCALARTYPE y) +static int COMPUTEOUTCODE(const RECTTYPE *rect, SCALARTYPE x, SCALARTYPE y) { int code = 0; if (y < rect->y) { @@ -291,9 +281,7 @@ COMPUTEOUTCODE(const RECTTYPE * rect, SCALARTYPE x, SCALARTYPE y) return code; } -SDL_bool -SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, - SCALARTYPE *Y2) +SDL_bool SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, SCALARTYPE *Y2) { SCALARTYPE x = 0; SCALARTYPE y = 0; @@ -321,7 +309,7 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, SDL_InvalidParamError("Y2"); return SDL_FALSE; } else if (SDL_RECTEMPTY(rect)) { - return SDL_FALSE; /* Special case for empty rect */ + return SDL_FALSE; /* Special case for empty rect */ } x1 = *X1; @@ -345,7 +333,7 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, return SDL_FALSE; } - if (y1 == y2) { /* Horizontal line, easy to clip */ + if (y1 == y2) { /* Horizontal line, easy to clip */ if (x1 < rectx1) { *X1 = rectx1; } else if (x1 > rectx2) { @@ -359,7 +347,7 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, return SDL_TRUE; } - if (x1 == x2) { /* Vertical line, easy to clip */ + if (x1 == x2) { /* Vertical line, easy to clip */ if (y1 < recty1) { *Y1 = recty1; } else if (y1 > recty2) { @@ -384,41 +372,41 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, if (outcode1) { if (outcode1 & CODE_TOP) { y = recty1; - x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + x = (SCALARTYPE) (x1 + ((BIGSCALARTYPE)(x2 - x1) * (y - y1)) / (y2 - y1)); } else if (outcode1 & CODE_BOTTOM) { y = recty2; - x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + x = (SCALARTYPE) (x1 + ((BIGSCALARTYPE)(x2 - x1) * (y - y1)) / (y2 - y1)); } else if (outcode1 & CODE_LEFT) { x = rectx1; - y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + y = (SCALARTYPE) (y1 + ((BIGSCALARTYPE)(y2 - y1) * (x - x1)) / (x2 - x1)); } else if (outcode1 & CODE_RIGHT) { x = rectx2; - y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + y = (SCALARTYPE) (y1 + ((BIGSCALARTYPE)(y2 - y1) * (x - x1)) / (x2 - x1)); } x1 = x; y1 = y; outcode1 = COMPUTEOUTCODE(rect, x, y); } else { if (outcode2 & CODE_TOP) { - SDL_assert(y2 != y1); /* if equal: division by zero. */ + SDL_assert(y2 != y1); /* if equal: division by zero. */ y = recty1; - x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + x = (SCALARTYPE) (x1 + ((BIGSCALARTYPE)(x2 - x1) * (y - y1)) / (y2 - y1)); } else if (outcode2 & CODE_BOTTOM) { - SDL_assert(y2 != y1); /* if equal: division by zero. */ + SDL_assert(y2 != y1); /* if equal: division by zero. */ y = recty2; - x = x1 + ((x2 - x1) * (y - y1)) / (y2 - y1); + x = (SCALARTYPE) (x1 + ((BIGSCALARTYPE)(x2 - x1) * (y - y1)) / (y2 - y1)); } else if (outcode2 & CODE_LEFT) { /* If this assertion ever fires, here's the static analysis that warned about it: http://buildbot.libsdl.org/sdl-static-analysis/sdl-macosx-static-analysis/sdl-macosx-static-analysis-1101/report-b0d01a.html#EndPath */ - SDL_assert(x2 != x1); /* if equal: division by zero. */ + SDL_assert(x2 != x1); /* if equal: division by zero. */ x = rectx1; - y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + y = (SCALARTYPE) (y1 + ((BIGSCALARTYPE)(y2 - y1) * (x - x1)) / (x2 - x1)); } else if (outcode2 & CODE_RIGHT) { /* If this assertion ever fires, here's the static analysis that warned about it: http://buildbot.libsdl.org/sdl-static-analysis/sdl-macosx-static-analysis/sdl-macosx-static-analysis-1101/report-39b114.html#EndPath */ - SDL_assert(x2 != x1); /* if equal: division by zero. */ + SDL_assert(x2 != x1); /* if equal: division by zero. */ x = rectx2; - y = y1 + ((y2 - y1) * (x - x1)) / (x2 - x1); + y = (SCALARTYPE) (y1 + ((BIGSCALARTYPE)(y2 - y1) * (x - x1)) / (x2 - x1)); } x2 = x; y2 = y; @@ -435,6 +423,7 @@ SDL_INTERSECTRECTANDLINE(const RECTTYPE * rect, SCALARTYPE *X1, SCALARTYPE *Y1, #undef RECTTYPE #undef POINTTYPE #undef SCALARTYPE +#undef BIGSCALARTYPE #undef COMPUTEOUTCODE #undef SDL_HASINTERSECTION #undef SDL_INTERSECTRECT diff --git a/src/video/SDL_shape.c b/src/video/SDL_shape.c index 6c95164f25a86..2ec6d027f8ea7 100644 --- a/src/video/SDL_shape.c +++ b/src/video/SDL_shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,154 +28,157 @@ #include "SDL_shape.h" #include "SDL_shape_internals.h" -SDL_Window* -SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags) +SDL_Window *SDL_CreateShapedWindow(const char *title, unsigned int x, unsigned int y, unsigned int w, unsigned int h, Uint32 flags) { SDL_Window *result = NULL; - result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */); - if(result != NULL) { + result = SDL_CreateWindow(title, -1000, -1000, w, h, (flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */); + if (result) { if (SDL_GetVideoDevice()->shape_driver.CreateShaper == NULL) { SDL_DestroyWindow(result); return NULL; } result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result); - if(result->shaper != NULL) { + if (result->shaper) { result->shaper->userx = x; result->shaper->usery = y; result->shaper->mode.mode = ShapeModeDefault; result->shaper->mode.parameters.binarizationCutoff = 1; result->shaper->hasshape = SDL_FALSE; return result; - } - else { + } else { SDL_DestroyWindow(result); return NULL; } } - else - return NULL; + return NULL; } -SDL_bool -SDL_IsShapedWindow(const SDL_Window *window) +SDL_bool SDL_IsShapedWindow(const SDL_Window *window) { - if(window == NULL) + if (window == NULL) { return SDL_FALSE; - else - return (SDL_bool)(window->shaper != NULL); + } + return (SDL_bool)(window->shaper != NULL); } /* REQUIRES that bitmap point to a w-by-h bitmap with ppb pixels-per-byte. */ -void -SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb) +void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode, SDL_Surface *shape, Uint8 *bitmap, Uint8 ppb) { int x = 0; int y = 0; - Uint8 r = 0,g = 0,b = 0,alpha = 0; - Uint8* pixel = NULL; - Uint32 pixel_value = 0,mask_value = 0; - int bytes_per_scanline = (shape->w + (ppb - 1)) / ppb; + Uint8 r = 0, g = 0, b = 0, alpha = 0; + Uint8 *pixel = NULL; + Uint32 pixel_value = 0, mask_value = 0; + size_t bytes_per_scanline = (size_t)(shape->w + (ppb - 1)) / ppb; Uint8 *bitmap_scanline; SDL_Color key; - if(SDL_MUSTLOCK(shape)) + if (SDL_MUSTLOCK(shape)) { SDL_LockSurface(shape); + } SDL_memset(bitmap, 0, shape->h * bytes_per_scanline); - for(y = 0;yh;y++) { + for (y = 0; y < shape->h; y++) { bitmap_scanline = bitmap + y * bytes_per_scanline; - for(x=0;xw;x++) { + for (x = 0; x < shape->w; x++) { alpha = 0; pixel_value = 0; - pixel = (Uint8 *)(shape->pixels) + (y*shape->pitch) + (x*shape->format->BytesPerPixel); - switch(shape->format->BytesPerPixel) { - case(1): - pixel_value = *pixel; - break; - case(2): - pixel_value = *(Uint16*)pixel; - break; - case(3): - pixel_value = *(Uint32*)pixel & (~shape->format->Amask); - break; - case(4): - pixel_value = *(Uint32*)pixel; - break; + pixel = (Uint8 *)(shape->pixels) + (y * shape->pitch) + (x * shape->format->BytesPerPixel); + switch (shape->format->BytesPerPixel) { + case (1): + pixel_value = *pixel; + break; + case (2): + pixel_value = *(Uint16 *)pixel; + break; + case (3): + pixel_value = *(Uint32 *)pixel & (~shape->format->Amask); + break; + case (4): + pixel_value = *(Uint32 *)pixel; + break; } - SDL_GetRGBA(pixel_value,shape->format,&r,&g,&b,&alpha); - switch(mode.mode) { - case(ShapeModeDefault): - mask_value = (alpha >= 1 ? 1 : 0); - break; - case(ShapeModeBinarizeAlpha): - mask_value = (alpha >= mode.parameters.binarizationCutoff ? 1 : 0); - break; - case(ShapeModeReverseBinarizeAlpha): - mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0); - break; - case(ShapeModeColorKey): - key = mode.parameters.colorKey; - mask_value = ((key.r != r || key.g != g || key.b != b) ? 1 : 0); - break; + SDL_GetRGBA(pixel_value, shape->format, &r, &g, &b, &alpha); + switch (mode.mode) { + case (ShapeModeDefault): + mask_value = (alpha >= 1 ? 1 : 0); + break; + case (ShapeModeBinarizeAlpha): + mask_value = (alpha >= mode.parameters.binarizationCutoff ? 1 : 0); + break; + case (ShapeModeReverseBinarizeAlpha): + mask_value = (alpha <= mode.parameters.binarizationCutoff ? 1 : 0); + break; + case (ShapeModeColorKey): + key = mode.parameters.colorKey; + mask_value = ((key.r != r || key.g != g || key.b != b) ? 1 : 0); + break; } bitmap_scanline[x / ppb] |= mask_value << (x % ppb); } } - if(SDL_MUSTLOCK(shape)) + if (SDL_MUSTLOCK(shape)) { SDL_UnlockSurface(shape); + } } -static SDL_ShapeTree* -RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rect dimensions) { - int x = 0,y = 0; - Uint8* pixel = NULL; +static SDL_ShapeTree *RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *mask, SDL_Rect dimensions) +{ + int x = 0, y = 0; + Uint8 *pixel = NULL; Uint32 pixel_value = 0; - Uint8 r = 0,g = 0,b = 0,a = 0; + Uint8 r = 0, g = 0, b = 0, a = 0; SDL_bool pixel_opaque = SDL_FALSE; int last_opaque = -1; SDL_Color key; - SDL_ShapeTree* result = (SDL_ShapeTree*)SDL_malloc(sizeof(SDL_ShapeTree)); - SDL_Rect next = {0,0,0,0}; + SDL_ShapeTree *result = (SDL_ShapeTree *)SDL_malloc(sizeof(SDL_ShapeTree)); + SDL_Rect next = { 0, 0, 0, 0 }; + + if (!result) { + SDL_OutOfMemory(); + return NULL; + } - for(y=dimensions.y;ypixels) + (y*mask->pitch) + (x*mask->format->BytesPerPixel); - switch(mask->format->BytesPerPixel) { - case(1): - pixel_value = *pixel; - break; - case(2): - pixel_value = *(Uint16*)pixel; - break; - case(3): - pixel_value = *(Uint32*)pixel & (~mask->format->Amask); - break; - case(4): - pixel_value = *(Uint32*)pixel; - break; + pixel = (Uint8 *)(mask->pixels) + (y * mask->pitch) + (x * mask->format->BytesPerPixel); + switch (mask->format->BytesPerPixel) { + case (1): + pixel_value = *pixel; + break; + case (2): + pixel_value = *(Uint16 *)pixel; + break; + case (3): + pixel_value = *(Uint32 *)pixel & (~mask->format->Amask); + break; + case (4): + pixel_value = *(Uint32 *)pixel; + break; } - SDL_GetRGBA(pixel_value,mask->format,&r,&g,&b,&a); - switch(mode.mode) { - case(ShapeModeDefault): - pixel_opaque = (a >= 1 ? SDL_TRUE : SDL_FALSE); - break; - case(ShapeModeBinarizeAlpha): - pixel_opaque = (a >= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); - break; - case(ShapeModeReverseBinarizeAlpha): - pixel_opaque = (a <= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); - break; - case(ShapeModeColorKey): - key = mode.parameters.colorKey; - pixel_opaque = ((key.r != r || key.g != g || key.b != b) ? SDL_TRUE : SDL_FALSE); - break; + SDL_GetRGBA(pixel_value, mask->format, &r, &g, &b, &a); + switch (mode.mode) { + case (ShapeModeDefault): + pixel_opaque = (a >= 1 ? SDL_TRUE : SDL_FALSE); + break; + case (ShapeModeBinarizeAlpha): + pixel_opaque = (a >= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); + break; + case (ShapeModeReverseBinarizeAlpha): + pixel_opaque = (a <= mode.parameters.binarizationCutoff ? SDL_TRUE : SDL_FALSE); + break; + case (ShapeModeColorKey): + key = mode.parameters.colorKey; + pixel_opaque = ((key.r != r || key.g != g || key.b != b) ? SDL_TRUE : SDL_FALSE); + break; } - if(last_opaque == -1) + if (last_opaque == -1) { last_opaque = pixel_opaque; - if(last_opaque != pixel_opaque) { + } + if (last_opaque != pixel_opaque) { const int halfwidth = dimensions.w / 2; const int halfheight = dimensions.h / 2; @@ -185,96 +188,93 @@ RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rec next.y = dimensions.y; next.w = halfwidth; next.h = halfheight; - result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + result->data.children.upleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode, mask, next); next.x = dimensions.x + halfwidth; next.w = dimensions.w - halfwidth; - result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + result->data.children.upright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode, mask, next); next.x = dimensions.x; next.w = halfwidth; next.y = dimensions.y + halfheight; next.h = dimensions.h - halfheight; - result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + result->data.children.downleft = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode, mask, next); next.x = dimensions.x + halfwidth; next.w = dimensions.w - halfwidth; - result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode,mask,next); + result->data.children.downright = (struct SDL_ShapeTree *)RecursivelyCalculateShapeTree(mode, mask, next); return result; } } } - /* If we never recursed, all the pixels in this quadrant have the same "value". */ result->kind = (last_opaque == SDL_TRUE ? OpaqueShape : TransparentShape); result->data.shape = dimensions; return result; } -SDL_ShapeTree* -SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape) +SDL_ShapeTree *SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape) { SDL_Rect dimensions; - SDL_ShapeTree* result = NULL; + SDL_ShapeTree *result = NULL; dimensions.x = 0; dimensions.y = 0; dimensions.w = shape->w; dimensions.h = shape->h; - if(SDL_MUSTLOCK(shape)) + if (SDL_MUSTLOCK(shape)) { SDL_LockSurface(shape); - result = RecursivelyCalculateShapeTree(mode,shape,dimensions); - if(SDL_MUSTLOCK(shape)) + } + result = RecursivelyCalculateShapeTree(mode, shape, dimensions); + if (SDL_MUSTLOCK(shape)) { SDL_UnlockSurface(shape); + } return result; } -void -SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure) +void SDL_TraverseShapeTree(SDL_ShapeTree *tree, SDL_TraversalFunction function, void *closure) { SDL_assert(tree != NULL); - if(tree->kind == QuadShape) { - SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft,function,closure); - SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright,function,closure); - SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downleft,function,closure); - SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downright,function,closure); + if (tree->kind == QuadShape) { + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upleft, function, closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.upright, function, closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downleft, function, closure); + SDL_TraverseShapeTree((SDL_ShapeTree *)tree->data.children.downright, function, closure); + } else { + function(tree, closure); } - else - function(tree,closure); } -void -SDL_FreeShapeTree(SDL_ShapeTree** shape_tree) +void SDL_FreeShapeTree(SDL_ShapeTree **shape_tree) { - if((*shape_tree)->kind == QuadShape) { - SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.upleft); - SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.upright); - SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.downleft); - SDL_FreeShapeTree((SDL_ShapeTree **)(char*)&(*shape_tree)->data.children.downright); + if ((*shape_tree)->kind == QuadShape) { + SDL_FreeShapeTree((SDL_ShapeTree **)(char *)&(*shape_tree)->data.children.upleft); + SDL_FreeShapeTree((SDL_ShapeTree **)(char *)&(*shape_tree)->data.children.upright); + SDL_FreeShapeTree((SDL_ShapeTree **)(char *)&(*shape_tree)->data.children.downleft); + SDL_FreeShapeTree((SDL_ShapeTree **)(char *)&(*shape_tree)->data.children.downright); } SDL_free(*shape_tree); *shape_tree = NULL; } -int -SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) +int SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); int result; - if (window == NULL || !SDL_IsShapedWindow(window)) { + if (!window || !SDL_IsShapedWindow(window)) { /* The window given was not a shapeable window. */ return SDL_NONSHAPEABLE_WINDOW; } - if (shape == NULL) { + if (!shape) { /* Invalid shape argument. */ return SDL_INVALID_SHAPE_ARGUMENT; } - if (shape_mode != NULL) { + if (shape_mode) { window->shaper->mode = *shape_mode; } result = _this->shape_driver.SetWindowShape(window->shaper, shape, shape_mode); @@ -315,32 +315,27 @@ SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *sh return result; } -static SDL_bool -SDL_WindowHasAShape(SDL_Window *window) +static SDL_bool SDL_WindowHasAShape(SDL_Window *window) { - if (window == NULL || !SDL_IsShapedWindow(window)) + if (!window || !SDL_IsShapedWindow(window)) { return SDL_FALSE; + } return window->shaper->hasshape; } -int -SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode) +int SDL_GetShapedWindowMode(SDL_Window *window, SDL_WindowShapeMode *shape_mode) { - if(window != NULL && SDL_IsShapedWindow(window)) { - if(shape_mode == NULL) { - if(SDL_WindowHasAShape(window)) - /* The window given has a shape. */ - return 0; - else - /* The window given is shapeable but lacks a shape. */ - return SDL_WINDOW_LACKS_SHAPE; - } - else { + if (window && SDL_IsShapedWindow(window)) { + if (!shape_mode) { + if (SDL_WindowHasAShape(window)) { + return 0; /* The window given has a shape. */ + } else { + return SDL_WINDOW_LACKS_SHAPE; /* The window given is shapeable but lacks a shape. */ + } + } else { *shape_mode = window->shaper->mode; return 0; } } - else - /* The window given is not a valid shapeable window. */ - return SDL_NONSHAPEABLE_WINDOW; + return SDL_NONSHAPEABLE_WINDOW; /* The window given is not a valid shapeable window. */ } diff --git a/src/video/SDL_shape_internals.h b/src/video/SDL_shape_internals.h index 16d659ef12d08..dafd3b265532b 100644 --- a/src/video/SDL_shape_internals.h +++ b/src/video/SDL_shape_internals.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,28 +37,36 @@ extern "C" { struct SDL_ShapeTree; -typedef struct { - struct SDL_ShapeTree *upleft,*upright,*downleft,*downright; +typedef struct +{ + struct SDL_ShapeTree *upleft, *upright, *downleft, *downright; } SDL_QuadTreeChildren; -typedef union { +typedef union +{ SDL_QuadTreeChildren children; SDL_Rect shape; } SDL_ShapeUnion; -typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind; +typedef enum +{ + QuadShape, + TransparentShape, + OpaqueShape +} SDL_ShapeKind; -typedef struct SDL_ShapeTree { +typedef struct SDL_ShapeTree +{ SDL_ShapeKind kind; SDL_ShapeUnion data; } SDL_ShapeTree; -typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*); +typedef void (*SDL_TraversalFunction)(SDL_ShapeTree *, void *); -extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb); -extern SDL_ShapeTree* SDL_CalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* shape); -extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree,SDL_TraversalFunction function,void* closure); -extern void SDL_FreeShapeTree(SDL_ShapeTree** shape_tree); +extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode, SDL_Surface *shape, Uint8 *bitmap, Uint8 ppb); +extern SDL_ShapeTree *SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape); +extern void SDL_TraverseShapeTree(SDL_ShapeTree *tree, SDL_TraversalFunction function, void *closure); +extern void SDL_FreeShapeTree(SDL_ShapeTree **shape_tree); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index bc7b4e5514f55..5277b790b0124 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,25 +26,22 @@ static int SDL_LowerSoftStretchNearest(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); static int SDL_LowerSoftStretchLinear(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); -static int SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect, SDL_ScaleMode scaleMode); +static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); -int -SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, - SDL_Surface *dst, const SDL_Rect *dstrect) +int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, const SDL_Rect *dstrect) { return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_ScaleModeNearest); } -int -SDL_SoftStretchLinear(SDL_Surface *src, const SDL_Rect *srcrect, - SDL_Surface *dst, const SDL_Rect *dstrect) +int SDL_SoftStretchLinear(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, const SDL_Rect *dstrect) { return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_ScaleModeLinear); } -static int -SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, const SDL_Rect * dstrect, SDL_ScaleMode scaleMode) +static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { int ret; int src_locked; @@ -140,55 +137,57 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, Because with SSE: add-multiply: _mm_madd_epi16 works with signed int so pixels 0xb1...... are negatives and false the result same in NEON probably */ -#define PRECISION 7 - -#define FIXED_POINT(i) ((Uint32)(i) << 16) -#define SRC_INDEX(fp) ((Uint32)(fp) >> 16) -#define INTEGER(fp) ((Uint32)(fp) >> PRECISION) -#define FRAC(fp) ((Uint32)(fp >> (16 - PRECISION)) & ((1< dst_h - 1 - right_pad_h); \ - index_h = SRC_INDEX(fp_sum_h); \ - frac_h0 = FRAC(fp_sum_h); \ - \ - index_h = no_padding ? index_h : (i < left_pad_h ? 0 : src_h - 1); \ - frac_h0 = no_padding ? frac_h0 : 0; \ - incr_h1 = no_padding ? src_pitch : 0; \ - incr_h0 = index_h * src_pitch; \ - \ - src_h0 = (const Uint32 *)((const Uint8 *)src + incr_h0); \ - src_h1 = (const Uint32 *)((const Uint8 *)src_h0 + incr_h1); \ - \ - fp_sum_h += fp_step_h; \ - \ - frac_h1 = FRAC_ONE - frac_h0; \ - fp_sum_w = fp_sum_w_init; \ - right_pad_w = right_pad_w_init; \ - left_pad_w = left_pad_w_init; \ - middle = middle_init; \ - - +#define PRECISION 7 + +#define FIXED_POINT(i) ((Uint32)(i) << 16) +#define SRC_INDEX(fp) ((Uint32)(fp) >> 16) +#define INTEGER(fp) ((Uint32)(fp) >> PRECISION) +#define FRAC(fp) ((Uint32)(fp >> (16 - PRECISION)) & ((1 << PRECISION) - 1)) +#define FRAC_ZERO 0 +#define FRAC_ONE (1 << PRECISION) +#define FP_ONE FIXED_POINT(1) + +#define BILINEAR___START \ + int i; \ + Sint64 fp_sum_h; \ + int fp_step_h, left_pad_h, right_pad_h; \ + Sint64 fp_sum_w; \ + int fp_step_w, left_pad_w, right_pad_w; \ + Sint64 fp_sum_w_init; \ + int left_pad_w_init, right_pad_w_init, dst_gap, middle_init; \ + get_scaler_datas(src_h, dst_h, &fp_sum_h, &fp_step_h, &left_pad_h, &right_pad_h); \ + get_scaler_datas(src_w, dst_w, &fp_sum_w, &fp_step_w, &left_pad_w, &right_pad_w); \ + fp_sum_w_init = fp_sum_w + left_pad_w * fp_step_w; \ + left_pad_w_init = left_pad_w; \ + right_pad_w_init = right_pad_w; \ + dst_gap = dst_pitch - 4 * dst_w; \ + middle_init = dst_w - left_pad_w - right_pad_w; + +#define BILINEAR___HEIGHT \ + int index_h, frac_h0, frac_h1, middle; \ + const Uint32 *src_h0, *src_h1; \ + int no_padding; \ + Uint64 incr_h0, incr_h1; \ + \ + no_padding = !(i < left_pad_h || i > dst_h - 1 - right_pad_h); \ + index_h = SRC_INDEX(fp_sum_h); \ + frac_h0 = FRAC(fp_sum_h); \ + \ + index_h = no_padding ? index_h : (i < left_pad_h ? 0 : src_h - 1); \ + frac_h0 = no_padding ? frac_h0 : 0; \ + incr_h1 = no_padding ? src_pitch : 0; \ + incr_h0 = (Uint64)index_h * src_pitch; \ + \ + src_h0 = (const Uint32 *)((const Uint8 *)src + incr_h0); \ + src_h1 = (const Uint32 *)((const Uint8 *)src_h0 + incr_h1); \ + \ + fp_sum_h += fp_step_h; \ + \ + frac_h1 = FRAC_ONE - frac_h0; \ + fp_sum_w = fp_sum_w_init; \ + right_pad_w = right_pad_w_init; \ + left_pad_w = left_pad_w_init; \ + middle = middle_init; #if defined(__clang__) // Remove inlining of this function @@ -198,13 +197,12 @@ SDL_UpperSoftStretch(SDL_Surface * src, const SDL_Rect * srcrect, // OK with clang 12.0.0 / Xcode __attribute__((noinline)) #endif -static void -get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_pad, int *right_pad) +static void get_scaler_datas(int src_nb, int dst_nb, Sint64 *fp_start, int *fp_step, int *left_pad, int *right_pad) { - int step = FIXED_POINT(src_nb) / (dst_nb); /* source step in fixed point */ - int x0 = FP_ONE / 2; /* dst first pixel center at 0.5 in fixed point */ - int fp_sum; + int step = FIXED_POINT(src_nb) / (dst_nb); /* source step in fixed point */ + int x0 = FP_ONE / 2; /* dst first pixel center at 0.5 in fixed point */ + Sint64 fp_sum; int i; #if 0 /* scale to source coordinates */ @@ -215,7 +213,7 @@ get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_ Sint64 tmp[2]; tmp[0] = (Sint64)step * (x0 >> 16); tmp[1] = (Sint64)step * (x0 & 0xFFFF); - x0 = (int) (tmp[0] + ((tmp[1] + 0x8000) >> 16)); /* x0 == (step + 1) / 2 */ + x0 = (int)(tmp[0] + ((tmp[1] + 0x8000) >> 16)); /* x0 == (step + 1) / 2 */ #endif /* -= 0.5, get back the pixel origin, in source coordinates */ x0 -= FP_ONE / 2; @@ -237,19 +235,19 @@ get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_ } fp_sum += step; } -// SDL_Log("%d -> %d x0=%d step=%d left_pad=%d right_pad=%d", src_nb, dst_nb, *fp_start, *fp_step, *left_pad, *right_pad); + // SDL_Log("%d -> %d x0=%d step=%d left_pad=%d right_pad=%d", src_nb, dst_nb, *fp_start, *fp_step, *left_pad, *right_pad); } -typedef struct color_t { - Uint8 a; - Uint8 b; - Uint8 c; - Uint8 d; +typedef struct color_t +{ + Uint8 a; + Uint8 b; + Uint8 c; + Uint8 d; } color_t; #if 0 -static void -printf_64(const char *str, void *var) +static void printf_64(const char *str, void *var) { uint8_t *val = (uint8_t*) var; printf(" * %s: %02x %02x %02x %02x _ %02x %02x %02x %02x\n", @@ -259,12 +257,11 @@ printf_64(const char *str, void *var) /* Interpolated == x0 + frac * (x1 - x0) == x0 * (1 - frac) + x1 * frac */ -static SDL_INLINE void -INTERPOL(const Uint32 *src_x0, const Uint32 *src_x1, int frac0, int frac1, Uint32 *dst) +static SDL_INLINE void INTERPOL(const Uint32 *src_x0, const Uint32 *src_x1, int frac0, int frac1, Uint32 *dst) { const color_t *c0 = (const color_t *)src_x0; const color_t *c1 = (const color_t *)src_x1; - color_t *cx = (color_t *)dst; + color_t *cx = (color_t *)dst; #if 0 cx->a = c0->a + INTEGER(frac0 * (c1->a - c0->a)); cx->b = c0->b + INTEGER(frac0 * (c1->b - c0->b)); @@ -278,23 +275,21 @@ INTERPOL(const Uint32 *src_x0, const Uint32 *src_x1, int frac0, int frac1, Uint3 #endif } -static SDL_INLINE void -INTERPOL_BILINEAR(const Uint32 *s0, const Uint32 *s1, int frac_w0, int frac_h0, int frac_h1, Uint32 *dst) +static SDL_INLINE void INTERPOL_BILINEAR(const Uint32 *s0, const Uint32 *s1, int frac_w0, int frac_h0, int frac_h1, Uint32 *dst) { Uint32 tmp[2]; unsigned int frac_w1 = FRAC_ONE - frac_w0; /* Vertical first, store to 'tmp' */ - INTERPOL(s0, s1, frac_h0, frac_h1, tmp); + INTERPOL(s0, s1, frac_h0, frac_h1, tmp); INTERPOL(s0 + 1, s1 + 1, frac_h0, frac_h1, tmp + 1); /* Horizontal, store to 'dst' */ - INTERPOL(tmp, tmp + 1, frac_w0, frac_w1, dst); + INTERPOL(tmp, tmp + 1, frac_w0, frac_w1, dst); } -static int -scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, - Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, + Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { BILINEAR___START @@ -314,14 +309,14 @@ scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, int frac_w = FRAC(fp_sum_w); fp_sum_w += fp_step_w; -/* - x00 ... x0_ ..... x01 - . . . - . x . - . . . - . . . - x10 ... x1_ ..... x11 -*/ + /* + x00 ... x0_ ..... x01 + . . . + . x . + . . . + . . . + x10 ... x1_ ..... x11 + */ s_00_01 = (const Uint32 *)((const Uint8 *)src_h0 + index_w); s_10_11 = (const Uint32 *)((const Uint8 *)src_h1 + index_w); @@ -343,29 +338,28 @@ scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, } #if defined(__SSE2__) -# define HAVE_SSE2_INTRINSICS 1 +#define HAVE_SSE2_INTRINSICS #endif #if defined(__ARM_NEON) -# define HAVE_NEON_INTRINSICS 1 -# define CAST_uint8x8_t (uint8x8_t) -# define CAST_uint32x2_t (uint32x2_t) +#define HAVE_NEON_INTRINSICS 1 +#define CAST_uint8x8_t (uint8x8_t) +#define CAST_uint32x2_t (uint32x2_t) #endif #if defined(__WINRT__) || defined(_MSC_VER) -# if defined(HAVE_NEON_INTRINSICS) -# undef CAST_uint8x8_t -# undef CAST_uint32x2_t -# define CAST_uint8x8_t -# define CAST_uint32x2_t -# endif +#if defined(HAVE_NEON_INTRINSICS) +#undef CAST_uint8x8_t +#undef CAST_uint32x2_t +#define CAST_uint8x8_t +#define CAST_uint32x2_t +#endif #endif #if defined(HAVE_SSE2_INTRINSICS) #if 0 -static void -printf_128(const char *str, __m128i var) +static void printf_128(const char *str, __m128i var) { uint16_t *val = (uint16_t*) &var; printf(" * %s: %04x %04x %04x %04x _ %04x %04x %04x %04x\n", @@ -373,8 +367,7 @@ printf_128(const char *str, __m128i var) } #endif -static SDL_INLINE int -hasSSE2() +static SDL_INLINE int hasSSE2(void) { static int val = -1; if (val != -1) { @@ -384,8 +377,7 @@ hasSSE2() return val; } -static SDL_INLINE void -INTERPOL_BILINEAR_SSE(const Uint32 *s0, const Uint32 *s1, int frac_w, __m128i v_frac_h0, __m128i v_frac_h1, Uint32 *dst, __m128i zero) +static SDL_INLINE void INTERPOL_BILINEAR_SSE(const Uint32 *s0, const Uint32 *s1, int frac_w, __m128i v_frac_h0, __m128i v_frac_h1, Uint32 *dst, __m128i zero) { __m128i x_00_01, x_10_11; /* Pixels in 4*uint8 in row */ __m128i v_frac_w0, k0, l0, d0, e0; @@ -395,8 +387,7 @@ INTERPOL_BILINEAR_SSE(const Uint32 *s0, const Uint32 *s1, int frac_w, __m128i v_ f2 = FRAC_ONE - frac_w; v_frac_w0 = _mm_set_epi16(f, f2, f, f2, f, f2, f, f2); - - x_00_01 = _mm_loadl_epi64((const __m128i *)s0); /* Load x00 and x01 */ + x_00_01 = _mm_loadl_epi64((const __m128i *)s0); /* Load x00 and x01 */ x_10_11 = _mm_loadl_epi64((const __m128i *)s1); /* Interpolated == x0 + frac * (x1 - x0) == x0 * (1 - frac) + x1 * frac */ @@ -423,8 +414,7 @@ INTERPOL_BILINEAR_SSE(const Uint32 *s0, const Uint32 *s1, int frac_w, __m128i v_ *dst = _mm_cvtsi128_si32(e0); } -static int -scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { BILINEAR___START @@ -453,7 +443,7 @@ scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *ds const Uint32 *s_00_01, *s_02_03, *s_10_11, *s_12_13; - __m128i x_00_01, x_10_11, x_02_03, x_12_13;/* Pixels in 4*uint8 in row */ + __m128i x_00_01, x_10_11, x_02_03, x_12_13; /* Pixels in 4*uint8 in row */ __m128i v_frac_w0, k0, l0, d0, e0; __m128i v_frac_w1, k1, l1, d1, e1; @@ -464,15 +454,15 @@ scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *ds index_w_1 = 4 * SRC_INDEX(fp_sum_w); frac_w_1 = FRAC(fp_sum_w); fp_sum_w += fp_step_w; -/* - x00............ x01 x02...........x03 - . . . . . . - j0 f0 j1 j2 f1 j3 - . . . . . . - . . . . . . - . . . . . . - x10............ x11 x12...........x13 - */ + /* + x00............ x01 x02...........x03 + . . . . . . + j0 f0 j1 j2 f1 j3 + . . . . . . + . . . . . . + . . . . . . + x10............ x11 x12...........x13 + */ s_00_01 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_0); s_02_03 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_1); s_10_11 = (const Uint32 *)((const Uint8 *)src_h1 + index_w_0); @@ -546,8 +536,7 @@ scale_mat_SSE(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *ds #if defined(HAVE_NEON_INTRINSICS) -static SDL_INLINE int -hasNEON() +static SDL_INLINE int hasNEON(void) { static int val = -1; if (val != -1) { @@ -557,8 +546,7 @@ hasNEON() return val; } -static SDL_INLINE void -INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1, int frac_w, uint8x8_t v_frac_h0, uint8x8_t v_frac_h1, Uint32 *dst) +static SDL_INLINE void INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1, int frac_w, uint8x8_t v_frac_h0, uint8x8_t v_frac_h1, Uint32 *dst) { uint8x8_t x_00_01, x_10_11; /* Pixels in 4*uint8 in row */ uint16x8_t k0; @@ -570,8 +558,8 @@ INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1, int frac_w, uint8x8_t x_10_11 = CAST_uint8x8_t vld1_u32(s1); /* Interpolated == x0 + frac * (x1 - x0) == x0 * (1 - frac) + x1 * frac */ - k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ - k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ + k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ + k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ /* k0 now contains 2 interpolated pixels { j0, j1 } */ l0 = vshll_n_u16(vget_low_u16(k0), PRECISION); @@ -580,9 +568,8 @@ INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1, int frac_w, uint8x8_t /* Shift and narrow */ d0 = vcombine_u16( - /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), - /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION) - ); + /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), + /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION)); /* Narrow again */ e0 = vmovn_u16(d0); @@ -591,8 +578,7 @@ INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1, int frac_w, uint8x8_t *dst = vget_lane_u32(CAST_uint32x2_t e0, 0); } - static int -scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { BILINEAR___START @@ -621,7 +607,7 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d const Uint32 *s_00_01, *s_02_03, *s_04_05, *s_06_07; const Uint32 *s_10_11, *s_12_13, *s_14_15, *s_16_17; - uint8x8_t x_00_01, x_10_11, x_02_03, x_12_13;/* Pixels in 4*uint8 in row */ + uint8x8_t x_00_01, x_10_11, x_02_03, x_12_13; /* Pixels in 4*uint8 in row */ uint8x8_t x_04_05, x_14_15, x_06_07, x_16_17; uint16x8_t k0, k1, k2, k3; @@ -631,17 +617,17 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d uint32x4_t f0; index_w_0 = 4 * SRC_INDEX(fp_sum_w); - frac_w_0 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; + frac_w_0 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; index_w_1 = 4 * SRC_INDEX(fp_sum_w); - frac_w_1 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; + frac_w_1 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; index_w_2 = 4 * SRC_INDEX(fp_sum_w); - frac_w_2 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; + frac_w_2 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; index_w_3 = 4 * SRC_INDEX(fp_sum_w); - frac_w_3 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; + frac_w_3 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; s_00_01 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_0); s_02_03 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_1); @@ -663,8 +649,8 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d x_16_17 = CAST_uint8x8_t vld1_u32(s_16_17); /* Interpolated == x0 + frac * (x1 - x0) == x0 * (1 - frac) + x1 * frac */ - k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ - k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ + k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ + k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ k1 = vmull_u8(x_02_03, v_frac_h1); k1 = vmlal_u8(k1, x_12_13, v_frac_h0); @@ -698,17 +684,15 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d /* shift and narrow */ d0 = vcombine_u16( - /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), - /* uint16x4_t */ vshrn_n_u32(l1, 2 * PRECISION) - ); + /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), + /* uint16x4_t */ vshrn_n_u32(l1, 2 * PRECISION)); /* narrow again */ e0 = vmovn_u16(d0); /* Shift and narrow */ d1 = vcombine_u16( - /* uint16x4_t */ vshrn_n_u32(l2, 2 * PRECISION), - /* uint16x4_t */ vshrn_n_u32(l3, 2 * PRECISION) - ); + /* uint16x4_t */ vshrn_n_u32(l2, 2 * PRECISION), + /* uint16x4_t */ vshrn_n_u32(l3, 2 * PRECISION)); /* Narrow again */ e1 = vmovn_u16(d1); @@ -724,41 +708,41 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d int index_w_1, frac_w_1; const Uint32 *s_00_01, *s_02_03; const Uint32 *s_10_11, *s_12_13; - uint8x8_t x_00_01, x_10_11, x_02_03, x_12_13;/* Pixels in 4*uint8 in row */ + uint8x8_t x_00_01, x_10_11, x_02_03, x_12_13; /* Pixels in 4*uint8 in row */ uint16x8_t k0, k1; uint32x4_t l0, l1; uint16x8_t d0; uint8x8_t e0; index_w_0 = 4 * SRC_INDEX(fp_sum_w); - frac_w_0 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; + frac_w_0 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; index_w_1 = 4 * SRC_INDEX(fp_sum_w); - frac_w_1 = FRAC(fp_sum_w); - fp_sum_w += fp_step_w; -/* - x00............ x01 x02...........x03 - . . . . . . - j0 dest0 j1 j2 dest1 j3 - . . . . . . - . . . . . . - . . . . . . - x10............ x11 x12...........x13 -*/ + frac_w_1 = FRAC(fp_sum_w); + fp_sum_w += fp_step_w; + /* + x00............ x01 x02...........x03 + . . . . . . + j0 dest0 j1 j2 dest1 j3 + . . . . . . + . . . . . . + . . . . . . + x10............ x11 x12...........x13 + */ s_00_01 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_0); s_02_03 = (const Uint32 *)((const Uint8 *)src_h0 + index_w_1); s_10_11 = (const Uint32 *)((const Uint8 *)src_h1 + index_w_0); s_12_13 = (const Uint32 *)((const Uint8 *)src_h1 + index_w_1); /* Interpolation vertical */ - x_00_01 = CAST_uint8x8_t vld1_u32(s_00_01);/* Load 2 pixels */ + x_00_01 = CAST_uint8x8_t vld1_u32(s_00_01); /* Load 2 pixels */ x_02_03 = CAST_uint8x8_t vld1_u32(s_02_03); x_10_11 = CAST_uint8x8_t vld1_u32(s_10_11); x_12_13 = CAST_uint8x8_t vld1_u32(s_12_13); /* Interpolated == x0 + frac * (x1 - x0) == x0 * (1 - frac) + x1 * frac */ - k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ - k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ + k0 = vmull_u8(x_00_01, v_frac_h1); /* k0 := x0 * (1 - frac) */ + k0 = vmlal_u8(k0, x_10_11, v_frac_h0); /* k0 += x1 * frac */ k1 = vmull_u8(x_02_03, v_frac_h1); k1 = vmlal_u8(k1, x_12_13, v_frac_h0); @@ -777,9 +761,8 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d /* Shift and narrow */ d0 = vcombine_u16( - /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), - /* uint16x4_t */ vshrn_n_u32(l1, 2 * PRECISION) - ); + /* uint16x4_t */ vshrn_n_u32(l0, 2 * PRECISION), + /* uint16x4_t */ vshrn_n_u32(l1, 2 * PRECISION)); /* Narrow again */ e0 = vmovn_u16(d0); @@ -813,9 +796,8 @@ scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *d } #endif -int -SDL_LowerSoftStretchLinear(SDL_Surface *s, const SDL_Rect *srcrect, - SDL_Surface *d, const SDL_Rect *dstrect) +int SDL_LowerSoftStretchLinear(SDL_Surface *s, const SDL_Rect *srcrect, + SDL_Surface *d, const SDL_Rect *dstrect) { int ret = -1; int src_w = srcrect->w; @@ -824,8 +806,8 @@ SDL_LowerSoftStretchLinear(SDL_Surface *s, const SDL_Rect *srcrect, int dst_h = dstrect->h; int src_pitch = s->pitch; int dst_pitch = d->pitch; - Uint32 *src = (Uint32 *) ((Uint8 *)s->pixels + srcrect->x * 4 + srcrect->y * src_pitch); - Uint32 *dst = (Uint32 *) ((Uint8 *)d->pixels + dstrect->x * 4 + dstrect->y * dst_pitch); + Uint32 *src = (Uint32 *)((Uint8 *)s->pixels + srcrect->x * 4 + srcrect->y * src_pitch); + Uint32 *dst = (Uint32 *)((Uint8 *)d->pixels + dstrect->x * 4 + dstrect->y * dst_pitch); #if defined(HAVE_NEON_INTRINSICS) if (ret == -1 && hasNEON()) { @@ -846,30 +828,27 @@ SDL_LowerSoftStretchLinear(SDL_Surface *s, const SDL_Rect *srcrect, return ret; } - -#define SDL_SCALE_NEAREST__START \ - int i; \ - Uint32 posy, incy; \ - Uint32 posx, incx; \ - int dst_gap; \ - int srcy, n; \ - const Uint32 *src_h0; \ - incy = (src_h << 16) / dst_h; \ - incx = (src_w << 16) / dst_w; \ - dst_gap = dst_pitch - bpp * dst_w; \ - posy = incy / 2; \ - -#define SDL_SCALE_NEAREST__HEIGHT \ - srcy = (posy >> 16); \ - src_h0 = (const Uint32 *)((const Uint8 *)src_ptr + srcy * src_pitch); \ - posy += incy; \ - posx = incx / 2; \ +#define SDL_SCALE_NEAREST__START \ + int i; \ + Uint64 posy, incy; \ + Uint64 posx, incx; \ + Uint64 srcy, srcx; \ + int dst_gap, n; \ + const Uint32 *src_h0; \ + incy = ((Uint64)src_h << 16) / dst_h; \ + incx = ((Uint64)src_w << 16) / dst_w; \ + dst_gap = dst_pitch - bpp * dst_w; \ + posy = incy / 2; + +#define SDL_SCALE_NEAREST__HEIGHT \ + srcy = (posy >> 16); \ + src_h0 = (const Uint32 *)((const Uint8 *)src_ptr + srcy * src_pitch); \ + posy += incy; \ + posx = incx / 2; \ n = dst_w; - -static int -scale_mat_nearest_1(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, - Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_nearest_1(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, + Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { Uint32 bpp = 1; SDL_SCALE_NEAREST__START @@ -877,20 +856,19 @@ scale_mat_nearest_1(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, SDL_SCALE_NEAREST__HEIGHT while (n--) { const Uint8 *src; - int srcx = bpp * (posx >> 16); + srcx = bpp * (posx >> 16); posx += incx; src = (const Uint8 *)src_h0 + srcx; - *(Uint8*)dst = *src; - dst = (Uint32 *)((Uint8*)dst + bpp); + *(Uint8 *)dst = *src; + dst = (Uint32 *)((Uint8 *)dst + bpp); } dst = (Uint32 *)((Uint8 *)dst + dst_gap); } return 0; } -static int -scale_mat_nearest_2(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, - Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_nearest_2(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, + Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { Uint32 bpp = 2; SDL_SCALE_NEAREST__START @@ -898,20 +876,19 @@ scale_mat_nearest_2(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, SDL_SCALE_NEAREST__HEIGHT while (n--) { const Uint16 *src; - int srcx = bpp * (posx >> 16); + srcx = bpp * (posx >> 16); posx += incx; src = (const Uint16 *)((const Uint8 *)src_h0 + srcx); - *(Uint16*)dst = *src; - dst = (Uint32 *)((Uint8*)dst + bpp); + *(Uint16 *)dst = *src; + dst = (Uint32 *)((Uint8 *)dst + bpp); } dst = (Uint32 *)((Uint8 *)dst + dst_gap); } return 0; } -static int -scale_mat_nearest_3(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, - Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_nearest_3(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, + Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { Uint32 bpp = 3; SDL_SCALE_NEAREST__START @@ -919,22 +896,21 @@ scale_mat_nearest_3(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, SDL_SCALE_NEAREST__HEIGHT while (n--) { const Uint8 *src; - int srcx = bpp * (posx >> 16); + srcx = bpp * (posx >> 16); posx += incx; src = (const Uint8 *)src_h0 + srcx; - ((Uint8*)dst)[0] = src[0]; - ((Uint8*)dst)[1] = src[1]; - ((Uint8*)dst)[2] = src[2]; - dst = (Uint32 *)((Uint8*)dst + bpp); + ((Uint8 *)dst)[0] = src[0]; + ((Uint8 *)dst)[1] = src[1]; + ((Uint8 *)dst)[2] = src[2]; + dst = (Uint32 *)((Uint8 *)dst + bpp); } dst = (Uint32 *)((Uint8 *)dst + dst_gap); } return 0; } -static int -scale_mat_nearest_4(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, - Uint32 *dst, int dst_w, int dst_h, int dst_pitch) +static int scale_mat_nearest_4(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, + Uint32 *dst, int dst_w, int dst_h, int dst_pitch) { Uint32 bpp = 4; SDL_SCALE_NEAREST__START @@ -942,20 +918,19 @@ scale_mat_nearest_4(const Uint32 *src_ptr, int src_w, int src_h, int src_pitch, SDL_SCALE_NEAREST__HEIGHT while (n--) { const Uint32 *src; - int srcx = bpp * (posx >> 16); + srcx = bpp * (posx >> 16); posx += incx; src = (const Uint32 *)((const Uint8 *)src_h0 + srcx); *dst = *src; - dst = (Uint32 *)((Uint8*)dst + bpp); + dst = (Uint32 *)((Uint8 *)dst + bpp); } dst = (Uint32 *)((Uint8 *)dst + dst_gap); } return 0; } -int -SDL_LowerSoftStretchNearest(SDL_Surface *s, const SDL_Rect *srcrect, - SDL_Surface *d, const SDL_Rect *dstrect) +int SDL_LowerSoftStretchNearest(SDL_Surface *s, const SDL_Rect *srcrect, + SDL_Surface *d, const SDL_Rect *dstrect) { int src_w = srcrect->w; int src_h = srcrect->h; @@ -963,11 +938,11 @@ SDL_LowerSoftStretchNearest(SDL_Surface *s, const SDL_Rect *srcrect, int dst_h = dstrect->h; int src_pitch = s->pitch; int dst_pitch = d->pitch; - + const int bpp = d->format->BytesPerPixel; - Uint32 *src = (Uint32 *) ((Uint8 *)s->pixels + srcrect->x * bpp + srcrect->y * src_pitch); - Uint32 *dst = (Uint32 *) ((Uint8 *)d->pixels + dstrect->x * bpp + dstrect->y * dst_pitch); + Uint32 *src = (Uint32 *)((Uint8 *)s->pixels + srcrect->x * bpp + srcrect->y * src_pitch); + Uint32 *dst = (Uint32 *)((Uint8 *)d->pixels + dstrect->x * bpp + dstrect->y * dst_pitch); if (bpp == 4) { return scale_mat_nearest_4(src, src_w, src_h, src_pitch, dst, dst_w, dst_h, dst_pitch); diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 5930e40551e00..d05c8b17e494f 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,10 +28,9 @@ #include "SDL_yuv_c.h" #include "../render/SDL_sysrender.h" - /* Check to make sure we can safely check multiplication of surface w and pitch and it won't overflow size_t */ SDL_COMPILE_TIME_ASSERT(surface_size_assumptions, - sizeof(int) == sizeof(Sint32) && sizeof(size_t) >= sizeof(Sint32)); + sizeof(int) == sizeof(Sint32) && sizeof(size_t) >= sizeof(Sint32)); SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32); @@ -40,13 +39,14 @@ SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32); /* * Calculate the pad-aligned scanline width of a surface. * Return SDL_SIZE_MAX on overflow. + * + * for FOURCC, use SDL_CalculateYUVSize() */ -static size_t -SDL_CalculatePitch(Uint32 format, size_t width, SDL_bool minimal) +static size_t SDL_CalculatePitch(Uint32 format, size_t width, SDL_bool minimal) { size_t pitch; - if (SDL_ISPIXELFORMAT_FOURCC(format) || SDL_BITSPERPIXEL(format) >= 8) { + if (SDL_BITSPERPIXEL(format) >= 8) { if (SDL_size_mul_overflow(width, SDL_BYTESPERPIXEL(format), &pitch)) { return SDL_SIZE_MAX; } @@ -74,8 +74,7 @@ SDL_CalculatePitch(Uint32 format, size_t width, SDL_bool minimal) * Create an empty RGB surface of the appropriate depth using the given * enum SDL_PIXELFORMAT_* format */ -SDL_Surface * -SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, +SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) { size_t pitch; @@ -94,16 +93,21 @@ SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, return NULL; } - pitch = SDL_CalculatePitch(format, width, SDL_FALSE); - if (pitch > SDL_MAX_SINT32) { - /* Overflow... */ - SDL_OutOfMemory(); + if (SDL_ISPIXELFORMAT_FOURCC(format)) { + SDL_SetError("invalid format"); return NULL; + } else { + pitch = SDL_CalculatePitch(format, width, SDL_FALSE); + if (pitch > SDL_MAX_SINT32) { + /* Overflow... */ + SDL_OutOfMemory(); + return NULL; + } } /* Allocate the surface */ - surface = (SDL_Surface *) SDL_calloc(1, sizeof(*surface)); - if (surface == NULL) { + surface = (SDL_Surface *)SDL_calloc(1, sizeof(*surface)); + if (!surface) { SDL_OutOfMemory(); return NULL; } @@ -181,8 +185,7 @@ SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, /* * Create an empty RGB surface of the appropriate depth */ -SDL_Surface * -SDL_CreateRGBSurface(Uint32 flags, +SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { @@ -201,8 +204,7 @@ SDL_CreateRGBSurface(Uint32 flags, /* * Create an RGB surface from an existing memory buffer */ -SDL_Surface * -SDL_CreateRGBSurfaceFrom(void *pixels, +SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) @@ -230,13 +232,13 @@ SDL_CreateRGBSurfaceFrom(void *pixels, minimalPitch = SDL_CalculatePitch(format, width, SDL_TRUE); - if (pitch < 0 || (pitch > 0 && ((size_t) pitch) < minimalPitch)) { + if (pitch < 0 || (pitch > 0 && ((size_t)pitch) < minimalPitch)) { SDL_InvalidParamError("pitch"); return NULL; } surface = SDL_CreateRGBSurfaceWithFormat(0, 0, 0, depth, format); - if (surface != NULL) { + if (surface) { surface->flags |= SDL_PREALLOC; surface->pixels = pixels; surface->w = width; @@ -252,8 +254,7 @@ SDL_CreateRGBSurfaceFrom(void *pixels, * Create an RGB surface from an existing memory buffer using the given given * enum SDL_PIXELFORMAT_* format */ -SDL_Surface * -SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, +SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) { @@ -270,15 +271,20 @@ SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, return NULL; } - minimalPitch = SDL_CalculatePitch(format, width, SDL_TRUE); + if (SDL_ISPIXELFORMAT_FOURCC(format)) { + SDL_SetError("invalid format"); + return NULL; + } else { + minimalPitch = SDL_CalculatePitch(format, width, SDL_TRUE); + } - if (pitch < 0 || (pitch > 0 && ((size_t) pitch) < minimalPitch)) { + if (pitch < 0 || (pitch > 0 && ((size_t)pitch) < minimalPitch)) { SDL_InvalidParamError("pitch"); return NULL; } surface = SDL_CreateRGBSurfaceWithFormat(0, 0, 0, depth, format); - if (surface != NULL) { + if (surface) { surface->flags |= SDL_PREALLOC; surface->pixels = pixels; surface->w = width; @@ -289,8 +295,7 @@ SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, return surface; } -int -SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette) +int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) { if (!surface) { return SDL_InvalidParamError("SDL_SetSurfacePalette(): surface"); @@ -303,13 +308,12 @@ SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette) return 0; } -int -SDL_SetSurfaceRLE(SDL_Surface * surface, int flag) +int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) { int flags; if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } flags = surface->map->info.flags; @@ -324,8 +328,7 @@ SDL_SetSurfaceRLE(SDL_Surface * surface, int flag) return 0; } -SDL_bool -SDL_HasSurfaceRLE(SDL_Surface * surface) +SDL_bool SDL_HasSurfaceRLE(SDL_Surface *surface) { if (!surface) { return SDL_FALSE; @@ -338,8 +341,7 @@ SDL_HasSurfaceRLE(SDL_Surface * surface) return SDL_TRUE; } -int -SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) +int SDL_SetColorKey(SDL_Surface *surface, int flag, Uint32 key) { int flags; @@ -347,7 +349,7 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) return SDL_InvalidParamError("surface"); } - if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) { + if (surface->format->palette && key >= ((Uint32)surface->format->palette->ncolors)) { return SDL_InvalidParamError("key"); } @@ -369,8 +371,7 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) return 0; } -SDL_bool -SDL_HasColorKey(SDL_Surface * surface) +SDL_bool SDL_HasColorKey(SDL_Surface *surface) { if (!surface) { return SDL_FALSE; @@ -383,8 +384,7 @@ SDL_HasColorKey(SDL_Surface * surface) return SDL_TRUE; } -int -SDL_GetColorKey(SDL_Surface * surface, Uint32 * key) +int SDL_GetColorKey(SDL_Surface *surface, Uint32 *key) { if (!surface) { return SDL_InvalidParamError("surface"); @@ -400,10 +400,9 @@ SDL_GetColorKey(SDL_Surface * surface, Uint32 * key) return 0; } -/* This is a fairly slow function to switch from colorkey to alpha +/* This is a fairly slow function to switch from colorkey to alpha NB: it doesn't handle bpp 1 or 3, because they have no alpha channel */ -static void -SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) +static void SDL_ConvertColorkeyToAlpha(SDL_Surface *surface, SDL_bool ignore_alpha) { int x, y, bpp; @@ -422,13 +421,13 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) if (bpp == 2) { Uint16 *row, *spot; - Uint16 ckey = (Uint16) surface->map->info.colorkey; - Uint16 mask = (Uint16) (~surface->format->Amask); + Uint16 ckey = (Uint16)surface->map->info.colorkey; + Uint16 mask = (Uint16)(~surface->format->Amask); /* Ignore, or not, alpha in colorkey comparison */ if (ignore_alpha) { ckey &= mask; - row = (Uint16 *) surface->pixels; + row = (Uint16 *)surface->pixels; for (y = surface->h; y--;) { spot = row; for (x = surface->w; x--;) { @@ -440,7 +439,7 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) row += surface->pitch / 2; } } else { - row = (Uint16 *) surface->pixels; + row = (Uint16 *)surface->pixels; for (y = surface->h; y--;) { spot = row; for (x = surface->w; x--;) { @@ -460,7 +459,7 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) /* Ignore, or not, alpha in colorkey comparison */ if (ignore_alpha) { ckey &= mask; - row = (Uint32 *) surface->pixels; + row = (Uint32 *)surface->pixels; for (y = surface->h; y--;) { spot = row; for (x = surface->w; x--;) { @@ -472,7 +471,7 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) row += surface->pitch / 4; } } else { - row = (Uint32 *) surface->pixels; + row = (Uint32 *)surface->pixels; for (y = surface->h; y--;) { spot = row; for (x = surface->w; x--;) { @@ -492,13 +491,12 @@ SDL_ConvertColorkeyToAlpha(SDL_Surface * surface, SDL_bool ignore_alpha) SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); } -int -SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b) +int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) { int flags; if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } surface->map->info.r = r; @@ -517,12 +515,10 @@ SDL_SetSurfaceColorMod(SDL_Surface * surface, Uint8 r, Uint8 g, Uint8 b) return 0; } - -int -SDL_GetSurfaceColorMod(SDL_Surface * surface, Uint8 * r, Uint8 * g, Uint8 * b) +int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) { if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } if (r) { @@ -537,13 +533,12 @@ SDL_GetSurfaceColorMod(SDL_Surface * surface, Uint8 * r, Uint8 * g, Uint8 * b) return 0; } -int -SDL_SetSurfaceAlphaMod(SDL_Surface * surface, Uint8 alpha) +int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) { int flags; if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } surface->map->info.a = alpha; @@ -560,11 +555,10 @@ SDL_SetSurfaceAlphaMod(SDL_Surface * surface, Uint8 alpha) return 0; } -int -SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha) +int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) { if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } if (alpha) { @@ -573,13 +567,12 @@ SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha) return 0; } -int -SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode) +int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) { int flags, status; if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } status = 0; @@ -613,19 +606,17 @@ SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode) return status; } -int -SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode) +int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) { if (!surface) { - return -1; + return SDL_InvalidParamError("surface"); } if (!blendMode) { return 0; } - switch (surface->map-> - info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { + switch (surface->map->info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: *blendMode = SDL_BLENDMODE_BLEND; break; @@ -645,8 +636,7 @@ SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode) return 0; } -SDL_bool -SDL_SetClipRect(SDL_Surface * surface, const SDL_Rect * rect) +SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect) { SDL_Rect full_rect; @@ -669,8 +659,7 @@ SDL_SetClipRect(SDL_Surface * surface, const SDL_Rect * rect) return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect); } -void -SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * rect) +void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) { if (surface && rect) { *rect = surface->clip_rect; @@ -688,9 +677,8 @@ SDL_GetClipRect(SDL_Surface * surface, SDL_Rect * rect) * you know exactly what you are doing, you can optimize your code * by calling the one(s) you need. */ -int -SDL_LowerBlit(SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect) +int SDL_LowerBlit(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) { /* Check to make sure the blit mapping is valid */ if ((src->map->dst != dst) || @@ -699,97 +687,79 @@ SDL_LowerBlit(SDL_Surface * src, SDL_Rect * srcrect, (src->format->palette && src->map->src_palette_version != src->format->palette->version)) { if (SDL_MapSurface(src, dst) < 0) { - return (-1); + return -1; } /* just here for debugging */ -/* printf */ -/* ("src = 0x%08X src->flags = %08X src->map->info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->map->info.flags = %08X\nsrc->map->blit = 0x%08x\n", */ -/* src, dst->flags, src->map->info.flags, dst, dst->flags, */ -/* dst->map->info.flags, src->map->blit); */ + /* printf */ + /* ("src = 0x%08X src->flags = %08X src->map->info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->map->info.flags = %08X\nsrc->map->blit = 0x%08x\n", */ + /* src, dst->flags, src->map->info.flags, dst, dst->flags, */ + /* dst->map->info.flags, src->map->blit); */ } - return (src->map->blit(src, srcrect, dst, dstrect)); + return src->map->blit(src, srcrect, dst, dstrect); } - -int -SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect) +int SDL_UpperBlit(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) { - SDL_Rect fulldst; - int srcx, srcy, w, h; + SDL_Rect r_src, r_dst; /* Make sure the surfaces aren't locked */ - if (!src || !dst) { - return SDL_InvalidParamError("SDL_UpperBlit(): src/dst"); - } - if (src->locked || dst->locked) { + if (!src) { + return SDL_InvalidParamError("src"); + } else if (!dst) { + return SDL_InvalidParamError("dst"); + } else if (src->locked || dst->locked) { return SDL_SetError("Surfaces must not be locked during blit"); } - /* If the destination rectangle is NULL, use the entire dest surface */ - if (dstrect == NULL) { - fulldst.x = fulldst.y = 0; - fulldst.w = dst->w; - fulldst.h = dst->h; - dstrect = &fulldst; + /* Full src surface */ + r_src.x = 0; + r_src.y = 0; + r_src.w = src->w; + r_src.h = src->h; + + if (dstrect) { + r_dst.x = dstrect->x; + r_dst.y = dstrect->y; + } else { + r_dst.x = 0; + r_dst.y = 0; } /* clip the source rectangle to the source surface */ if (srcrect) { - int maxw, maxh; - - srcx = srcrect->x; - w = srcrect->w; - if (srcx < 0) { - w += srcx; - dstrect->x -= srcx; - srcx = 0; - } - maxw = src->w - srcx; - if (maxw < w) - w = maxw; - - srcy = srcrect->y; - h = srcrect->h; - if (srcy < 0) { - h += srcy; - dstrect->y -= srcy; - srcy = 0; + SDL_Rect tmp; + if (SDL_IntersectRect(srcrect, &r_src, &tmp) == SDL_FALSE) { + goto end; } - maxh = src->h - srcy; - if (maxh < h) - h = maxh; - } else { - srcx = srcy = 0; - w = src->w; - h = src->h; + /* Shift dstrect, if srcrect origin has changed */ + r_dst.x += tmp.x - srcrect->x; + r_dst.y += tmp.y - srcrect->y; + + /* Update srcrect */ + r_src = tmp; } + /* There're no dstrect.w/h parameters. It's the same as srcrect */ + r_dst.w = r_src.w; + r_dst.h = r_src.h; + /* clip the destination rectangle against the clip rectangle */ { - SDL_Rect *clip = &dst->clip_rect; - int dx, dy; - - dx = clip->x - dstrect->x; - if (dx > 0) { - w -= dx; - dstrect->x += dx; - srcx += dx; - } - dx = dstrect->x + w - clip->x - clip->w; - if (dx > 0) - w -= dx; - - dy = clip->y - dstrect->y; - if (dy > 0) { - h -= dy; - dstrect->y += dy; - srcy += dy; + SDL_Rect tmp; + if (SDL_IntersectRect(&r_dst, &dst->clip_rect, &tmp) == SDL_FALSE) { + goto end; } - dy = dstrect->y + h - clip->y - clip->h; - if (dy > 0) - h -= dy; + + /* Shift srcrect, if dstrect has changed */ + r_src.x += tmp.x - r_dst.x; + r_src.y += tmp.y - r_dst.y; + r_src.w = tmp.w; + r_src.h = tmp.h; + + /* Update dstrect */ + r_dst = tmp; } /* Switch back to a fast blit if we were previously stretching */ @@ -798,29 +768,28 @@ SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect, SDL_InvalidateMap(src->map); } - if (w > 0 && h > 0) { - SDL_Rect sr; - sr.x = srcx; - sr.y = srcy; - sr.w = dstrect->w = w; - sr.h = dstrect->h = h; - return SDL_LowerBlit(src, &sr, dst, dstrect); + if (r_dst.w > 0 && r_dst.h > 0) { + if (dstrect) { /* update output parameter */ + *dstrect = r_dst; + } + return SDL_LowerBlit(src, &r_src, dst, &r_dst); + } + +end: + if (dstrect) { /* update output parameter */ + dstrect->w = dstrect->h = 0; } - dstrect->w = dstrect->h = 0; return 0; } -int -SDL_UpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect) +int SDL_UpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) { return SDL_PrivateUpperBlitScaled(src, srcrect, dst, dstrect, SDL_ScaleModeNearest); } - -int -SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect, SDL_ScaleMode scaleMode) +int SDL_PrivateUpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { double src_x0, src_y0, src_x1, src_y1; double dst_x0, dst_y0, dst_x1, dst_y1; @@ -837,7 +806,7 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, return SDL_SetError("Surfaces must not be locked during blit"); } - if (NULL == srcrect) { + if (!srcrect) { src_w = src->w; src_h = src->h; } else { @@ -845,7 +814,7 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, src_h = srcrect->h; } - if (NULL == dstrect) { + if (!dstrect) { dst_w = dst->w; dst_h = dst->h; } else { @@ -861,7 +830,7 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, scaling_w = (double)dst_w / src_w; scaling_h = (double)dst_h / src_h; - if (NULL == dstrect) { + if (!dstrect) { dst_x0 = 0; dst_y0 = 0; dst_x1 = dst_w; @@ -873,7 +842,7 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, dst_y1 = dst_y0 + dst_h; } - if (NULL == srcrect) { + if (!srcrect) { src_x0 = 0; src_y0 = 0; src_x1 = src_w; @@ -981,22 +950,18 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect, * This is a semi-private blit function and it performs low-level surface * scaled blitting only. */ -int -SDL_LowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect) +int SDL_LowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect) { return SDL_PrivateLowerBlitScaled(src, srcrect, dst, dstrect, SDL_ScaleModeNearest); } -int -SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, - SDL_Surface * dst, SDL_Rect * dstrect, SDL_ScaleMode scaleMode) +int SDL_PrivateLowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { - static const Uint32 complex_copy_flags = ( - SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | - SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | - SDL_COPY_COLORKEY - ); + static const Uint32 complex_copy_flags = (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | + SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | + SDL_COPY_COLORKEY); if (srcrect->w > SDL_MAX_UINT16 || srcrect->h > SDL_MAX_UINT16 || dstrect->w > SDL_MAX_UINT16 || dstrect->h > SDL_MAX_UINT16) { @@ -1009,19 +974,19 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, } if (scaleMode == SDL_ScaleModeNearest) { - if ( !(src->map->info.flags & complex_copy_flags) && - src->format->format == dst->format->format && - !SDL_ISPIXELFORMAT_INDEXED(src->format->format) ) { - return SDL_SoftStretch( src, srcrect, dst, dstrect ); + if (!(src->map->info.flags & complex_copy_flags) && + src->format->format == dst->format->format && + !SDL_ISPIXELFORMAT_INDEXED(src->format->format)) { + return SDL_SoftStretch(src, srcrect, dst, dstrect); } else { - return SDL_LowerBlit( src, srcrect, dst, dstrect ); + return SDL_LowerBlit(src, srcrect, dst, dstrect); } } else { - if ( !(src->map->info.flags & complex_copy_flags) && - src->format->format == dst->format->format && - !SDL_ISPIXELFORMAT_INDEXED(src->format->format) && - src->format->BytesPerPixel == 4 && - src->format->format != SDL_PIXELFORMAT_ARGB2101010) { + if (!(src->map->info.flags & complex_copy_flags) && + src->format->format == dst->format->format && + !SDL_ISPIXELFORMAT_INDEXED(src->format->format) && + src->format->BytesPerPixel == 4 && + src->format->format != SDL_PIXELFORMAT_ARGB2101010) { /* fast path */ return SDL_SoftStretchLinear(src, srcrect, dst, dstrect); } else { @@ -1062,7 +1027,6 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, tmp1 = SDL_CreateRGBSurfaceWithFormat(flags, src->w, src->h, 0, fmt); SDL_LowerBlit(src, srcrect, tmp1, &tmprect); - srcrect2.x = 0; srcrect2.y = 0; SDL_SetSurfaceColorMod(tmp1, r, g, b); @@ -1101,15 +1065,14 @@ SDL_PrivateLowerBlitScaled(SDL_Surface * src, SDL_Rect * srcrect, /* * Lock a surface to directly access the pixels */ -int -SDL_LockSurface(SDL_Surface * surface) +int SDL_LockSurface(SDL_Surface *surface) { if (!surface->locked) { #if SDL_HAVE_RLE /* Perform the lock */ if (surface->flags & SDL_RLEACCEL) { SDL_UnRLESurface(surface, 1); - surface->flags |= SDL_RLEACCEL; /* save accel'd state */ + surface->flags |= SDL_RLEACCEL; /* save accel'd state */ } #endif } @@ -1118,14 +1081,13 @@ SDL_LockSurface(SDL_Surface * surface) ++surface->locked; /* Ready to go.. */ - return (0); + return 0; } /* * Unlock a previously locked surface */ -void -SDL_UnlockSurface(SDL_Surface * surface) +void SDL_UnlockSurface(SDL_Surface *surface) { /* Only perform an unlock if we are locked */ if (!surface->locked || (--surface->locked > 0)) { @@ -1135,7 +1097,7 @@ SDL_UnlockSurface(SDL_Surface * surface) #if SDL_HAVE_RLE /* Update RLE encoded surface with new data */ if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { - surface->flags &= ~SDL_RLEACCEL; /* stop lying */ + surface->flags &= ~SDL_RLEACCEL; /* stop lying */ SDL_RLESurface(surface); } #endif @@ -1144,8 +1106,7 @@ SDL_UnlockSurface(SDL_Surface * surface) /* * Creates a new surface identical to the existing surface */ -SDL_Surface * -SDL_DuplicateSurface(SDL_Surface * surface) +SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface) { return SDL_ConvertSurface(surface, surface->format, surface->flags); } @@ -1153,8 +1114,7 @@ SDL_DuplicateSurface(SDL_Surface * surface) /* * Convert a surface into the specified pixel format. */ -SDL_Surface * -SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, +SDL_Surface *SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, Uint32 flags) { SDL_Surface *convert; @@ -1178,17 +1138,16 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, } /* Check for empty destination palette! (results in empty image) */ - if (format->palette != NULL) { + if (format->palette) { int i; for (i = 0; i < format->palette->ncolors; ++i) { - if ((format->palette->colors[i].r != 0xFF) || - (format->palette->colors[i].g != 0xFF) || - (format->palette->colors[i].b != 0xFF)) + if ((format->palette->colors[i].r != 0xFF) || (format->palette->colors[i].g != 0xFF) || (format->palette->colors[i].b != 0xFF)) { break; + } } if (i == format->palette->ncolors) { SDL_SetError("Empty destination palette"); - return (NULL); + return NULL; } } @@ -1197,8 +1156,8 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, format->BitsPerPixel, format->Rmask, format->Gmask, format->Bmask, format->Amask); - if (convert == NULL) { - return (NULL); + if (!convert) { + return NULL; } /* Copy the palette if any */ @@ -1290,8 +1249,7 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, convert->map->info.a = copy_color.a; convert->map->info.flags = (copy_flags & - ~(SDL_COPY_COLORKEY | SDL_COPY_BLEND - | SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | + ~(SDL_COPY_COLORKEY | SDL_COPY_BLEND | SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY)); surface->map->info.r = copy_color.r; surface->map->info.g = copy_color.g; @@ -1314,7 +1272,7 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, if (format->palette && surface->format->palette->ncolors <= format->palette->ncolors && (SDL_memcmp(surface->format->palette->colors, format->palette->colors, - surface->format->palette->ncolors * sizeof(SDL_Color)) == 0)) { + surface->format->palette->ncolors * sizeof(SDL_Color)) == 0)) { /* The palette is identical, just set the same colorkey */ SDL_SetColorKey(convert, 1, surface->map->info.colorkey); } else if (!format->palette) { @@ -1384,11 +1342,10 @@ SDL_ConvertSurface(SDL_Surface * surface, const SDL_PixelFormat * format, } /* We're ready to go! */ - return (convert); + return convert; } -SDL_Surface * -SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, +SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, Uint32 flags) { SDL_PixelFormat *fmt; @@ -1405,10 +1362,9 @@ SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, /* * Create a surface on the stack for quick blit operations */ -static SDL_INLINE SDL_bool -SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format, - void * pixels, int pitch, SDL_Surface * surface, - SDL_PixelFormat * format, SDL_BlitMap * blitmap) +static SDL_INLINE SDL_bool SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format, + void *pixels, int pitch, SDL_Surface *surface, + SDL_PixelFormat *format, SDL_BlitMap *blitmap) { if (SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { SDL_SetError("Indexed pixel formats not supported"); @@ -1445,14 +1401,14 @@ SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format, * Copy a block of pixels of one format to another format */ int SDL_ConvertPixels(int width, int height, - Uint32 src_format, const void * src, int src_pitch, - Uint32 dst_format, void * dst, int dst_pitch) + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { SDL_Surface src_surface, dst_surface; SDL_PixelFormat src_fmt, dst_fmt; SDL_BlitMap src_blitmap, dst_blitmap; SDL_Rect rect; - void *nonconst_src = (void *) src; + void *nonconst_src = (void *)src; int ret; if (!src) { @@ -1489,8 +1445,8 @@ int SDL_ConvertPixels(int width, int height, width *= bpp; for (i = height; i--;) { SDL_memcpy(dst, src, width); - src = (const Uint8*)src + src_pitch; - dst = (Uint8*)dst + dst_pitch; + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; } return 0; } @@ -1528,8 +1484,8 @@ int SDL_ConvertPixels(int width, int height, * https://developer.arm.com/documentation/101964/0201/Pre-multiplied-alpha-channel-data */ int SDL_PremultiplyAlpha(int width, int height, - Uint32 src_format, const void * src, int src_pitch, - Uint32 dst_format, void * dst, int dst_pitch) + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { int c; Uint32 srcpixel; @@ -1583,10 +1539,9 @@ int SDL_PremultiplyAlpha(int width, int height, /* * Free a surface created by the above function. */ -void -SDL_FreeSurface(SDL_Surface * surface) +void SDL_FreeSurface(SDL_Surface *surface) { - if (surface == NULL) { + if (!surface) { return; } if (surface->flags & SDL_DONTFREE) { diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 4bc1f111fd8a6..1018fd78c12cb 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,6 +24,7 @@ #define SDL_sysvideo_h_ #include "SDL_messagebox.h" +#include "SDL_mouse.h" #include "SDL_shape.h" #include "SDL_thread.h" #include "SDL_metal.h" @@ -44,7 +45,7 @@ struct SDL_WindowShaper SDL_Window *window; /* The user's specified coordinates for the window, for once we give it a shape. */ - Uint32 userx,usery; + Uint32 userx, usery; /* The parameters for shape calculation. */ SDL_WindowShapeMode mode; @@ -58,8 +59,8 @@ struct SDL_WindowShaper /* Define the SDL shape driver structure */ struct SDL_ShapeDriver { - SDL_WindowShaper *(*CreateShaper)(SDL_Window * window); - int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + SDL_WindowShaper *(*CreateShaper)(SDL_Window *window); + int (*SetWindowShape)(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode); int (*ResizeWindowShape)(SDL_Window *window); }; @@ -101,7 +102,7 @@ struct SDL_Window SDL_bool is_hiding; SDL_bool is_destroying; - SDL_bool is_dropping; /* drag/drop in progress, expecting SDL_SendDropComplete(). */ + SDL_bool is_dropping; /* drag/drop in progress, expecting SDL_SendDropComplete(). */ SDL_Rect mouse_rect; @@ -117,9 +118,9 @@ struct SDL_Window SDL_Window *prev; SDL_Window *next; }; -#define FULLSCREEN_VISIBLE(W) \ +#define FULLSCREEN_VISIBLE(W) \ (((W)->flags & SDL_WINDOW_FULLSCREEN) && \ - ((W)->flags & SDL_WINDOW_SHOWN) && \ + ((W)->flags & SDL_WINDOW_SHOWN) && \ !((W)->flags & SDL_WINDOW_MINIMIZED)) /* @@ -147,12 +148,14 @@ struct SDL_VideoDisplay struct SDL_SysWMinfo; /* Define the SDL video driver structure */ -#define _THIS SDL_VideoDevice *_this +#define _THIS SDL_VideoDevice *_this /* Video device flags */ -typedef enum { - VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING = 0x01, +typedef enum +{ + VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING = 0x01, VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE = 0x02, + VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY = 0x04, } DeviceQuirkFlags; struct SDL_VideoDevice @@ -168,43 +171,48 @@ struct SDL_VideoDevice * Initialize the native video subsystem, filling in the list of * displays for this driver, returning 0 or -1 if there's an error. */ - int (*VideoInit) (_THIS); + int (*VideoInit)(_THIS); /* * Reverse the effects VideoInit() -- called if VideoInit() fails or * if the application is shutting down the video subsystem. */ - void (*VideoQuit) (_THIS); + void (*VideoQuit)(_THIS); /* * Reinitialize the touch devices -- called if an unknown touch ID occurs. */ - void (*ResetTouch) (_THIS); + void (*ResetTouch)(_THIS); /* * * */ /* * Display functions */ + /* + * Refresh the display list + */ + void (*RefreshDisplays)(_THIS); + /* * Get the bounds of a display */ - int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); + int (*GetDisplayBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); /* * Get the usable bounds of a display (bounds minus menubar or whatever) */ - int (*GetDisplayUsableBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); + int (*GetDisplayUsableBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); /* * Get the dots/pixels-per-inch of a display */ - int (*GetDisplayDPI) (_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi); + int (*GetDisplayDPI)(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); /* * Get a list of the available display modes for a display. */ - void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display); + void (*GetDisplayModes)(_THIS, SDL_VideoDisplay *display); /* * Setting the display mode is independent of creating windows, so @@ -212,21 +220,21 @@ struct SDL_VideoDevice * their data updated accordingly, including the display surfaces * associated with them. */ - int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); + int (*SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); /* * * */ /* * Window functions */ - int (*CreateSDLWindow) (_THIS, SDL_Window * window); - int (*CreateSDLWindowFrom) (_THIS, SDL_Window * window, const void *data); - void (*SetWindowTitle) (_THIS, SDL_Window * window); - void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon); - void (*SetWindowPosition) (_THIS, SDL_Window * window); - void (*SetWindowSize) (_THIS, SDL_Window * window); - void (*SetWindowMinimumSize) (_THIS, SDL_Window * window); - void (*SetWindowMaximumSize) (_THIS, SDL_Window * window); - int (*GetWindowBordersSize) (_THIS, SDL_Window * window, int *top, int *left, int *bottom, int *right); + int (*CreateSDLWindow)(_THIS, SDL_Window *window); + int (*CreateSDLWindowFrom)(_THIS, SDL_Window *window, const void *data); + void (*SetWindowTitle)(_THIS, SDL_Window *window); + void (*SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon); + void (*SetWindowPosition)(_THIS, SDL_Window *window); + void (*SetWindowSize)(_THIS, SDL_Window *window); + void (*SetWindowMinimumSize)(_THIS, SDL_Window *window); + void (*SetWindowMaximumSize)(_THIS, SDL_Window *window); + int (*GetWindowBordersSize)(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right); void (*GetWindowSizeInPixels)(_THIS, SDL_Window *window, int *w, int *h); int (*SetWindowOpacity) (_THIS, SDL_Window * window, float opacity); int (*SetWindowModalFor) (_THIS, SDL_Window * modal_window, SDL_Window * parent_window); @@ -285,61 +293,61 @@ struct SDL_VideoDevice /* * Vulkan support */ - int (*Vulkan_LoadLibrary) (_THIS, const char *path); - void (*Vulkan_UnloadLibrary) (_THIS); - SDL_bool (*Vulkan_GetInstanceExtensions) (_THIS, SDL_Window *window, unsigned *count, const char **names); - SDL_bool (*Vulkan_CreateSurface) (_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); - void (*Vulkan_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h); + int (*Vulkan_LoadLibrary)(_THIS, const char *path); + void (*Vulkan_UnloadLibrary)(_THIS); + SDL_bool (*Vulkan_GetInstanceExtensions)(_THIS, SDL_Window *window, unsigned *count, const char **names); + SDL_bool (*Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); + void (*Vulkan_GetDrawableSize)(_THIS, SDL_Window *window, int *w, int *h); /* * * */ /* * Metal support */ - SDL_MetalView (*Metal_CreateView) (_THIS, SDL_Window * window); - void (*Metal_DestroyView) (_THIS, SDL_MetalView view); - void *(*Metal_GetLayer) (_THIS, SDL_MetalView view); - void (*Metal_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h); + SDL_MetalView (*Metal_CreateView)(_THIS, SDL_Window *window); + void (*Metal_DestroyView)(_THIS, SDL_MetalView view); + void *(*Metal_GetLayer)(_THIS, SDL_MetalView view); + void (*Metal_GetDrawableSize)(_THIS, SDL_Window *window, int *w, int *h); /* * * */ /* * Event manager functions */ - int (*WaitEventTimeout) (_THIS, int timeout); - void (*SendWakeupEvent) (_THIS, SDL_Window *window); - void (*PumpEvents) (_THIS); + int (*WaitEventTimeout)(_THIS, int timeout); + void (*SendWakeupEvent)(_THIS, SDL_Window *window); + void (*PumpEvents)(_THIS); /* Suspend the screensaver */ - void (*SuspendScreenSaver) (_THIS); + void (*SuspendScreenSaver)(_THIS); /* Text input */ - void (*StartTextInput) (_THIS); - void (*StopTextInput) (_THIS); - void (*SetTextInputRect) (_THIS, const SDL_Rect *rect); - void (*ClearComposition) (_THIS); - SDL_bool (*IsTextInputShown) (_THIS); + void (*StartTextInput)(_THIS); + void (*StopTextInput)(_THIS); + void (*SetTextInputRect)(_THIS, const SDL_Rect *rect); + void (*ClearComposition)(_THIS); + SDL_bool (*IsTextInputShown)(_THIS); /* Screen keyboard */ - SDL_bool (*HasScreenKeyboardSupport) (_THIS); - void (*ShowScreenKeyboard) (_THIS, SDL_Window *window); - void (*HideScreenKeyboard) (_THIS, SDL_Window *window); - SDL_bool (*IsScreenKeyboardShown) (_THIS, SDL_Window *window); + SDL_bool (*HasScreenKeyboardSupport)(_THIS); + void (*ShowScreenKeyboard)(_THIS, SDL_Window *window); + void (*HideScreenKeyboard)(_THIS, SDL_Window *window); + SDL_bool (*IsScreenKeyboardShown)(_THIS, SDL_Window *window); /* Clipboard */ - int (*SetClipboardText) (_THIS, const char *text); - char * (*GetClipboardText) (_THIS); - SDL_bool (*HasClipboardText) (_THIS); - int (*SetPrimarySelectionText) (_THIS, const char *text); - char * (*GetPrimarySelectionText) (_THIS); - SDL_bool (*HasPrimarySelectionText) (_THIS); + int (*SetClipboardText)(_THIS, const char *text); + char *(*GetClipboardText)(_THIS); + SDL_bool (*HasClipboardText)(_THIS); + int (*SetPrimarySelectionText)(_THIS, const char *text); + char *(*GetPrimarySelectionText)(_THIS); + SDL_bool (*HasPrimarySelectionText)(_THIS); /* MessageBox */ - int (*ShowMessageBox) (_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid); + int (*ShowMessageBox)(_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid); /* Hit-testing */ - int (*SetWindowHitTest)(SDL_Window * window, SDL_bool enabled); + int (*SetWindowHitTest)(SDL_Window *window, SDL_bool enabled); /* Tell window that app enabled drag'n'drop events */ - void (*AcceptDragAndDrop)(SDL_Window * window, SDL_bool accept); + void (*AcceptDragAndDrop)(SDL_Window *window, SDL_bool accept); /* * * */ /* Data common to all drivers */ @@ -347,8 +355,7 @@ struct SDL_VideoDevice SDL_bool checked_texture_framebuffer; SDL_bool is_dummy; SDL_bool suspend_screensaver; - SDL_Window *wakeup_window; - SDL_mutex *wakeup_lock; /* Initialized only if WaitEventTimeout/SendWakeupEvent are supported */ + void *wakeup_window; int num_displays; SDL_VideoDisplay *displays; SDL_Window *windows; @@ -392,6 +399,7 @@ struct SDL_VideoDevice int no_error; int retained_backing; int driver_loaded; + int HAS_GL_ARB_color_buffer_float; char driver_path[256]; void *dll_handle; } gl_config; @@ -427,24 +435,25 @@ struct SDL_VideoDevice void *driverdata; struct SDL_GLDriverData *gl_data; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL struct SDL_EGL_VideoData *egl_data; #endif -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) struct SDL_PrivateGLESData *gles_data; #endif /* * * */ /* The function used to dispose of this structure */ - void (*free) (_THIS); + void (*free)(_THIS); }; typedef struct VideoBootStrap { const char *name; const char *desc; - SDL_VideoDevice *(*create) (void); + SDL_VideoDevice *(*create)(void); + int (*ShowMessageBox)(const SDL_MessageBoxData *messageboxdata, int *buttonid); /* can be done without initializing backend! */ } VideoBootStrap; /* Not all of these are available in a given build. Use #ifdefs, etc. */ @@ -480,37 +489,38 @@ extern VideoBootStrap OS2VMAN_bootstrap; /* Use SDL_OnVideoThread() sparingly, to avoid regressions in use cases that currently happen to work */ extern SDL_bool SDL_OnVideoThread(void); extern SDL_VideoDevice *SDL_GetVideoDevice(void); -extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); -extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display, SDL_bool send_event); +extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode); +extern int SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send_event); extern void SDL_DelVideoDisplay(int index); -extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); -extern void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); -extern void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); +extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode); +extern void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode); +extern void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode); extern void SDL_ResetDisplayModes(int displayIndex); extern int SDL_GetIndexOfDisplay(SDL_VideoDisplay *display); extern SDL_VideoDisplay *SDL_GetDisplay(int displayIndex); extern SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window); -extern void *SDL_GetDisplayDriverData( int displayIndex ); +extern void *SDL_GetDisplayDriverData(int displayIndex); extern SDL_bool SDL_IsVideoContextExternal(void); extern int SDL_GetMessageBoxCount(void); -extern void SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor); +extern void SDL_GL_DeduceMaxSupportedESProfile(int *major, int *minor); -extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); +extern int SDL_RecreateWindow(SDL_Window *window, Uint32 flags); extern SDL_bool SDL_HasWindows(void); -extern void SDL_OnWindowShown(SDL_Window * window); -extern void SDL_OnWindowHidden(SDL_Window * window); -extern void SDL_OnWindowMoved(SDL_Window * window); -extern void SDL_OnWindowResized(SDL_Window * window); -extern void SDL_OnWindowMinimized(SDL_Window * window); -extern void SDL_OnWindowRestored(SDL_Window * window); -extern void SDL_OnWindowEnter(SDL_Window * window); -extern void SDL_OnWindowLeave(SDL_Window * window); -extern void SDL_OnWindowFocusGained(SDL_Window * window); -extern void SDL_OnWindowFocusLost(SDL_Window * window); -extern void SDL_UpdateWindowGrab(SDL_Window * window); -extern SDL_Window * SDL_GetFocusWindow(void); +extern void SDL_OnWindowShown(SDL_Window *window); +extern void SDL_OnWindowHidden(SDL_Window *window); +extern void SDL_OnWindowMoved(SDL_Window *window); +extern void SDL_OnWindowResized(SDL_Window *window); +extern void SDL_OnWindowLiveResizeUpdate(SDL_Window *window); +extern void SDL_OnWindowMinimized(SDL_Window *window); +extern void SDL_OnWindowRestored(SDL_Window *window); +extern void SDL_OnWindowEnter(SDL_Window *window); +extern void SDL_OnWindowLeave(SDL_Window *window); +extern void SDL_OnWindowFocusGained(SDL_Window *window); +extern void SDL_OnWindowFocusLost(SDL_Window *window); +extern void SDL_UpdateWindowGrab(SDL_Window *window); +extern SDL_Window *SDL_GetFocusWindow(void); extern SDL_bool SDL_ShouldAllowTopmost(void); @@ -518,9 +528,13 @@ extern float SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vin extern void SDL_ToggleDragAndDropSupport(void); -extern int SDL_GetPointDisplayIndex(const SDL_Point * point); +extern int SDL_GetPointDisplayIndex(const SDL_Point *point); + +extern int SDL_GL_SwapWindowWithResult(SDL_Window *window); -extern int SDL_GL_SwapWindowWithResult(SDL_Window * window); +#if defined(SDL_VIDEO_DRIVER_X11) || defined(SDL_VIDEO_DRIVER_WAYLAND) || defined(SDL_VIDEO_DRIVER_EMSCRIPTEN) +const char *SDL_GetCSSCursorName(SDL_SystemCursor id, const char **fallback_name); +#endif #endif /* SDL_sysvideo_h_ */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0804c9cfbfec9..4e22f28c580e7 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,6 +18,7 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ + #include "../SDL_internal.h" /* The high-level video driver subsystem */ @@ -33,20 +34,22 @@ #include "SDL_syswm.h" -#if SDL_VIDEO_OPENGL +#include "../render/SDL_sysrender.h" + +#ifdef SDL_VIDEO_OPENGL #include "SDL_opengl.h" #endif /* SDL_VIDEO_OPENGL */ -#if SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL +#if defined(SDL_VIDEO_OPENGL_ES) && !defined(SDL_VIDEO_OPENGL) #include "SDL_opengles.h" #endif /* SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL */ /* GL and GLES2 headers conflict on Linux 32 bits */ -#if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL +#if defined(SDL_VIDEO_OPENGL_ES2) && !defined(SDL_VIDEO_OPENGL) #include "SDL_opengles2.h" #endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */ -#if !SDL_VIDEO_OPENGL +#ifndef SDL_VIDEO_OPENGL #ifndef GL_CONTEXT_RELEASE_BEHAVIOR_KHR #define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB #endif @@ -56,116 +59,124 @@ #include #endif +#ifdef __3DS__ +#include <3ds.h> +#endif + #ifdef __LINUX__ #include #include #include +#include #endif +#ifndef GL_RGBA_FLOAT_MODE_ARB +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#endif /* GL_RGBA_FLOAT_MODE_ARB */ /* Available video drivers */ static VideoBootStrap *bootstrap[] = { -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA &COCOA_bootstrap, #endif -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 &X11_bootstrap, #endif -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND &Wayland_bootstrap, #endif -#if SDL_VIDEO_DRIVER_VIVANTE +#ifdef SDL_VIDEO_DRIVER_VIVANTE &VIVANTE_bootstrap, #endif -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB &DirectFB_bootstrap, #endif -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS &WINDOWS_bootstrap, #endif -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT &WINRT_bootstrap, #endif -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU &HAIKU_bootstrap, #endif -#if SDL_VIDEO_DRIVER_PANDORA +#ifdef SDL_VIDEO_DRIVER_PANDORA &PND_bootstrap, #endif -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT &UIKIT_bootstrap, #endif -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID &Android_bootstrap, #endif -#if SDL_VIDEO_DRIVER_PS2 +#ifdef SDL_VIDEO_DRIVER_PS2 &PS2_bootstrap, #endif -#if SDL_VIDEO_DRIVER_PSP +#ifdef SDL_VIDEO_DRIVER_PSP &PSP_bootstrap, #endif -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA &VITA_bootstrap, #endif -#if SDL_VIDEO_DRIVER_N3DS +#ifdef SDL_VIDEO_DRIVER_N3DS &N3DS_bootstrap, #endif -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM &KMSDRM_bootstrap, #endif -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS &RISCOS_bootstrap, #endif -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI &RPI_bootstrap, #endif -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL &NACL_bootstrap, #endif -#if SDL_VIDEO_DRIVER_EMSCRIPTEN +#ifdef SDL_VIDEO_DRIVER_EMSCRIPTEN &Emscripten_bootstrap, #endif -#if SDL_VIDEO_DRIVER_QNX +#ifdef SDL_VIDEO_DRIVER_QNX &QNX_bootstrap, #endif -#if SDL_VIDEO_DRIVER_OFFSCREEN - &OFFSCREEN_bootstrap, +#ifdef SDL_VIDEO_DRIVER_OS2 + &OS2DIVE_bootstrap, + &OS2VMAN_bootstrap, #endif -#if SDL_VIDEO_DRIVER_NGAGE +#ifdef SDL_VIDEO_DRIVER_NGAGE &NGAGE_bootstrap, #endif -#if SDL_VIDEO_DRIVER_OS2 - &OS2DIVE_bootstrap, - &OS2VMAN_bootstrap, +#ifdef SDL_VIDEO_DRIVER_OFFSCREEN + &OFFSCREEN_bootstrap, #endif -#if SDL_VIDEO_DRIVER_DUMMY +#ifdef SDL_VIDEO_DRIVER_DUMMY &DUMMY_bootstrap, -#if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV &DUMMY_evdev_bootstrap, #endif #endif NULL }; -#define CHECK_WINDOW_MAGIC(window, retval) \ - if (!_this) { \ - SDL_UninitializedVideo(); \ - return retval; \ - } \ +#define CHECK_WINDOW_MAGIC(window, retval) \ + if (!_this) { \ + SDL_UninitializedVideo(); \ + return retval; \ + } \ if (!window || window->magic != &_this->window_magic) { \ - SDL_SetError("Invalid window"); \ - return retval; \ + SDL_SetError("Invalid window"); \ + return retval; \ } -#define CHECK_DISPLAY_INDEX(displayIndex, retval) \ - if (!_this) { \ - SDL_UninitializedVideo(); \ - return retval; \ - } \ +#define CHECK_DISPLAY_INDEX(displayIndex, retval) \ + if (!_this) { \ + SDL_UninitializedVideo(); \ + return retval; \ + } \ if (displayIndex < 0 || displayIndex >= _this->num_displays) { \ - SDL_SetError("displayIndex must be in the range 0 - %d", \ - _this->num_displays - 1); \ - return retval; \ + SDL_SetError("displayIndex must be in the range 0 - %d", \ + _this->num_displays - 1); \ + return retval; \ } #define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN) @@ -177,23 +188,27 @@ extern SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool sta #endif /* Convenience functions for reading driver flags */ -static SDL_bool -DisableDisplayModeSwitching(_THIS) +static SDL_bool DisableDisplayModeSwitching(_THIS) { return !!(_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING); } -static SDL_bool -DisableUnsetFullscreenOnMinimize(_THIS) +static SDL_bool DisableUnsetFullscreenOnMinimize(_THIS) { return !!(_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE); } +static SDL_bool IsFullscreenOnly(_THIS) +{ + return !!(_this->quirk_flags & VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY); +} + /* Support for framebuffer emulation using an accelerated renderer */ -#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" +#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" -typedef struct { +typedef struct +{ SDL_Renderer *renderer; SDL_Texture *texture; void *pixels; @@ -201,52 +216,63 @@ typedef struct { int bytes_per_pixel; } SDL_WindowTextureData; - -static Uint32 -SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this) +static Uint32 SDL_DefaultGraphicsBackends(SDL_VideoDevice *_this) { -#if (SDL_VIDEO_OPENGL && __MACOSX__) || (__IPHONEOS__ && !TARGET_OS_MACCATALYST) || __ANDROID__ || __NACL__ - if (_this->GL_CreateContext != NULL) { +#if (defined(SDL_VIDEO_OPENGL) && defined(__MACOSX__)) || (defined(__IPHONEOS__) && !TARGET_OS_MACCATALYST) || defined(__ANDROID__) || defined(__NACL__) + if (_this->GL_CreateContext) { return SDL_WINDOW_OPENGL; } #endif -#if SDL_VIDEO_METAL && (TARGET_OS_MACCATALYST || __MACOSX__ || __IPHONEOS__) - if (_this->Metal_CreateView != NULL) { +#if defined(SDL_VIDEO_METAL) && (TARGET_OS_MACCATALYST || defined(__MACOSX__) || defined(__IPHONEOS__)) + if (_this->Metal_CreateView) { return SDL_WINDOW_METAL; } #endif return 0; } -static int -SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_RendererInfo info; SDL_WindowTextureData *data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); int i; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); if (!data) { SDL_Renderer *renderer = NULL; - const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); - const SDL_bool specific_accelerated_renderer = ( - hint && *hint != '0' && *hint != '1' && + const char *render_driver = NULL; + const char *hint; + + /* See if there's a render driver being requested */ + hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint && *hint != '0' && *hint != '1' && SDL_strcasecmp(hint, "true") != 0 && SDL_strcasecmp(hint, "false") != 0 && - SDL_strcasecmp(hint, "software") != 0 - ); + SDL_strcasecmp(hint, "software") != 0) { + render_driver = hint; + } + + if (!render_driver) { + hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); + if (hint && *hint && SDL_strcasecmp(hint, "software") != 0) { + render_driver = hint; + } + } /* Check to see if there's a specific driver requested */ - if (specific_accelerated_renderer) { + if (render_driver) { for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) { SDL_GetRenderDriverInfo(i, &info); - if (SDL_strcasecmp(info.name, hint) == 0) { + if (SDL_strcasecmp(info.name, render_driver) == 0) { renderer = SDL_CreateRenderer(window, i, 0); break; } } - if (!renderer || (SDL_GetRendererInfo(renderer, &info) == -1)) { - if (renderer) { SDL_DestroyRenderer(renderer); } - return SDL_SetError("Requested renderer for " SDL_HINT_FRAMEBUFFER_ACCELERATION " is not available"); + if (!renderer) { + /* The error for this specific renderer has already been set */ + return -1; } /* if it was specifically requested, even if SDL_RENDERER_ACCELERATED isn't set, we'll accept this renderer. */ } else { @@ -255,9 +281,9 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo if (SDL_strcmp(info.name, "software") != 0) { renderer = SDL_CreateRenderer(window, i, 0); if (renderer && (SDL_GetRendererInfo(renderer, &info) == 0) && (info.flags & SDL_RENDERER_ACCELERATED)) { - break; /* this will work. */ + break; /* this will work. */ } - if (renderer) { /* wasn't accelerated, etc, skip it. */ + if (renderer) { /* wasn't accelerated, etc, skip it. */ SDL_DestroyRenderer(renderer); renderer = NULL; } @@ -268,7 +294,7 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo } } - SDL_assert(renderer != NULL); /* should have explicitly checked this above. */ + SDL_assert(renderer != NULL); /* should have explicitly checked this above. */ /* Create the data after we successfully create the renderer (bug #1116) */ data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data)); @@ -296,7 +322,7 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo /* Find the first format without an alpha channel */ *format = info.texture_formats[0]; - for (i = 0; i < (int) info.num_texture_formats; ++i) { + for (i = 0; i < (int)info.num_texture_formats; ++i) { if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) && !SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) { *format = info.texture_formats[i]; @@ -306,19 +332,19 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo data->texture = SDL_CreateTexture(data->renderer, *format, SDL_TEXTUREACCESS_STREAMING, - window->w, window->h); + w, h); if (!data->texture) { /* codechecker_false_positive [Malloc] Static analyzer doesn't realize allocated `data` is saved to SDL_WINDOWTEXTUREDATA and not leaked here. */ - return -1; + return -1; /* NOLINT(clang-analyzer-unix.Malloc) */ } /* Create framebuffer data */ data->bytes_per_pixel = SDL_BYTESPERPIXEL(*format); - data->pitch = (((window->w * data->bytes_per_pixel) + 3) & ~3); + data->pitch = (((w * data->bytes_per_pixel) + 3) & ~3); { /* Make static analysis happy about potential SDL_malloc(0) calls. */ - const size_t allocsize = window->h * data->pitch; + const size_t allocsize = (size_t)h * data->pitch; data->pixels = SDL_malloc((allocsize > 0) ? allocsize : 1); if (!data->pixels) { return SDL_OutOfMemory(); @@ -337,12 +363,14 @@ SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo static SDL_VideoDevice *_this = NULL; static SDL_atomic_t SDL_messagebox_count; -static int -SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window * window, const SDL_Rect * rects, int numrects) +static int SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_WindowTextureData *data; SDL_Rect rect; void *src; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); if (!data || !data->texture) { @@ -350,10 +378,10 @@ SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window * window, const SDL_ } /* Update a single rect that contains subrects for best DMA performance */ - if (SDL_GetSpanEnclosingRect(window->w, window->h, numrects, rects, &rect)) { + if (SDL_GetSpanEnclosingRect(w, h, numrects, rects, &rect)) { src = (void *)((Uint8 *)data->pixels + - rect.y * data->pitch + - rect.x * data->bytes_per_pixel); + rect.y * data->pitch + + rect.x * data->bytes_per_pixel); if (SDL_UpdateTexture(data->texture, &rect, src, data->pitch) < 0) { return -1; } @@ -367,8 +395,7 @@ SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window * window, const SDL_ return 0; } -static void -SDL_DestroyWindowTexture(SDL_VideoDevice *unused, SDL_Window * window) +static void SDL_DestroyWindowTexture(SDL_VideoDevice *unused, SDL_Window *window) { SDL_WindowTextureData *data; @@ -386,11 +413,10 @@ SDL_DestroyWindowTexture(SDL_VideoDevice *unused, SDL_Window * window) SDL_free(data); } -static int SDLCALL -cmpmodes(const void *A, const void *B) +static int SDLCALL cmpmodes(const void *A, const void *B) { - const SDL_DisplayMode *a = (const SDL_DisplayMode *) A; - const SDL_DisplayMode *b = (const SDL_DisplayMode *) B; + const SDL_DisplayMode *a = (const SDL_DisplayMode *)A; + const SDL_DisplayMode *b = (const SDL_DisplayMode *)B; if (a == b) { return 0; } else if (a->w != b->w) { @@ -407,20 +433,17 @@ cmpmodes(const void *A, const void *B) return 0; } -static int -SDL_UninitializedVideo() +static int SDL_UninitializedVideo(void) { return SDL_SetError("Video subsystem has not been initialized"); } -int -SDL_GetNumVideoDrivers(void) +int SDL_GetNumVideoDrivers(void) { return SDL_arraysize(bootstrap) - 1; } -const char * -SDL_GetVideoDriver(int index) +const char *SDL_GetVideoDriver(int index) { if (index >= 0 && index < SDL_GetNumVideoDrivers()) { return bootstrap[index]->name; @@ -431,8 +454,7 @@ SDL_GetVideoDriver(int index) /* * Initialize the video and event subsystems -- determine native pixel format */ -int -SDL_VideoInit(const char *driver_name) +int SDL_VideoInit(const char *driver_name) { SDL_VideoDevice *video; SDL_bool init_events = SDL_FALSE; @@ -442,11 +464,11 @@ SDL_VideoInit(const char *driver_name) int i = 0; /* Check to make sure we don't overwrite '_this' */ - if (_this != NULL) { + if (_this) { SDL_VideoQuit(); } -#if !SDL_TIMERS_DISABLED +#ifndef SDL_TIMERS_DISABLED SDL_TicksInit(); #endif @@ -459,7 +481,7 @@ SDL_VideoInit(const char *driver_name) goto pre_driver_error; } init_keyboard = SDL_TRUE; - if (SDL_MouseInit() < 0) { + if (SDL_MousePreInit() < 0) { goto pre_driver_error; } init_mouse = SDL_TRUE; @@ -470,14 +492,36 @@ SDL_VideoInit(const char *driver_name) /* Select the proper video driver */ video = NULL; - if (driver_name == NULL) { + if (!driver_name) { driver_name = SDL_GetHint(SDL_HINT_VIDEODRIVER); } - if (driver_name != NULL && *driver_name != 0) { +#if defined(__LINUX__) && defined(SDL_VIDEO_DRIVER_X11) + if (!driver_name) { + /* See if it looks like we need X11 */ + SDL_bool force_x11 = SDL_FALSE; + void *global_symbols = dlopen(NULL, RTLD_LOCAL|RTLD_NOW); + + /* Use linked libraries to detect what quirks we are likely to need */ + if (global_symbols != NULL) { + if (dlsym(global_symbols, "glxewInit") != NULL) { /* GLEW (e.g. Frogatto, SLUDGE) */ + force_x11 = SDL_TRUE; + } else if (dlsym(global_symbols, "cgGLEnableProgramProfiles") != NULL) { /* NVIDIA Cg (e.g. Awesomenauts, Braid) */ + force_x11 = SDL_TRUE; + } else if (dlsym(global_symbols, "_Z7ssgInitv") != NULL) { /* ::ssgInit(void) in plib (e.g. crrcsim) */ + force_x11 = SDL_TRUE; + } + dlclose(global_symbols); + } + if (force_x11) { + driver_name = "x11"; + } + } +#endif + if (driver_name && *driver_name != 0) { const char *driver_attempt = driver_name; - while(driver_attempt != NULL && *driver_attempt != 0 && video == NULL) { - const char* driver_attempt_end = SDL_strchr(driver_attempt, ','); - size_t driver_attempt_len = (driver_attempt_end != NULL) ? (driver_attempt_end - driver_attempt) + while (driver_attempt && *driver_attempt != 0 && !video) { + const char *driver_attempt_end = SDL_strchr(driver_attempt, ','); + size_t driver_attempt_len = (driver_attempt_end) ? (driver_attempt_end - driver_attempt) : SDL_strlen(driver_attempt); for (i = 0; bootstrap[i]; ++i) { @@ -488,17 +532,17 @@ SDL_VideoInit(const char *driver_name) } } - driver_attempt = (driver_attempt_end != NULL) ? (driver_attempt_end + 1) : NULL; + driver_attempt = (driver_attempt_end) ? (driver_attempt_end + 1) : NULL; } } else { for (i = 0; bootstrap[i]; ++i) { video = bootstrap[i]->create(); - if (video != NULL) { + if (video) { break; } } } - if (video == NULL) { + if (!video) { if (driver_name) { SDL_SetError("%s not available", driver_name); goto pre_driver_error; @@ -506,7 +550,7 @@ SDL_VideoInit(const char *driver_name) SDL_SetError("No available video device"); goto pre_driver_error; } - + /* From this point on, use SDL_VideoQuit to cleanup on error, rather than pre_driver_error. */ _this = video; @@ -514,7 +558,6 @@ SDL_VideoInit(const char *driver_name) _this->next_object_id = 1; _this->thread = SDL_ThreadID(); - /* Set some very sane GL defaults */ _this->gl_config.driver_loaded = 0; _this->gl_config.dll_handle = NULL; @@ -545,16 +588,23 @@ SDL_VideoInit(const char *driver_name) SDL_DisableScreenSaver(); } - /* If we don't use a screen keyboard, turn on text input by default, - otherwise programs that expect to get text events without enabling - UNICODE input won't get any events. - - Actually, come to think of it, you needed to call SDL_EnableUNICODE(1) - in SDL 1.2 before you got text input events. Hmm... +#if !defined(SDL_VIDEO_DRIVER_N3DS) && !defined(SDL_VIDEO_DRIVER_PSP) + /* In the initial state we don't want to pop up an on-screen keyboard, + * but we do want to allow text input from other mechanisms. */ - if (!SDL_HasScreenKeyboardSupport()) { + { + const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD); + if (!hint) { + SDL_SetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD, "0"); + } SDL_StartTextInput(); + if (!hint) { + SDL_SetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD, NULL); + } } +#endif /* !SDL_VIDEO_DRIVER_N3DS && !SDL_VIDEO_DRIVER_PSP */ + + SDL_MousePostInit(); /* We're ready to go! */ return 0; @@ -576,8 +626,7 @@ SDL_VideoInit(const char *driver_name) return -1; } -const char * -SDL_GetCurrentVideoDriver() +const char *SDL_GetCurrentVideoDriver(void) { if (!_this) { SDL_UninitializedVideo(); @@ -586,20 +635,17 @@ SDL_GetCurrentVideoDriver() return _this->name; } -SDL_VideoDevice * -SDL_GetVideoDevice(void) +SDL_VideoDevice *SDL_GetVideoDevice(void) { return _this; } -SDL_bool -SDL_OnVideoThread() +SDL_bool SDL_OnVideoThread(void) { return (_this && SDL_ThreadID() == _this->thread) ? SDL_TRUE : SDL_FALSE; } -int -SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode) +int SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode) { SDL_VideoDisplay display; @@ -612,8 +658,7 @@ SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode) return SDL_AddVideoDisplay(&display, SDL_FALSE); } -int -SDL_AddVideoDisplay(const SDL_VideoDisplay * display, SDL_bool send_event) +int SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send_event) { SDL_VideoDisplay *displays; int index = -1; @@ -645,8 +690,7 @@ SDL_AddVideoDisplay(const SDL_VideoDisplay * display, SDL_bool send_event) return index; } -void -SDL_DelVideoDisplay(int index) +void SDL_DelVideoDisplay(int index) { if (index < 0 || index >= _this->num_displays) { return; @@ -654,14 +698,17 @@ SDL_DelVideoDisplay(int index) SDL_SendDisplayEvent(&_this->displays[index], SDL_DISPLAYEVENT_DISCONNECTED, 0); + SDL_free(_this->displays[index].driverdata); + _this->displays[index].driverdata = NULL; + SDL_free(_this->displays[index].name); + _this->displays[index].name = NULL; if (index < (_this->num_displays - 1)) { - SDL_memmove(&_this->displays[index], &_this->displays[index+1], (_this->num_displays - index - 1)*sizeof(_this->displays[index])); + SDL_memmove(&_this->displays[index], &_this->displays[index + 1], (_this->num_displays - index - 1) * sizeof(_this->displays[index])); } --_this->num_displays; } -int -SDL_GetNumVideoDisplays(void) +int SDL_GetNumVideoDisplays(void) { if (!_this) { SDL_UninitializedVideo(); @@ -670,8 +717,7 @@ SDL_GetNumVideoDisplays(void) return _this->num_displays; } -int -SDL_GetIndexOfDisplay(SDL_VideoDisplay *display) +int SDL_GetIndexOfDisplay(SDL_VideoDisplay *display) { int displayIndex; @@ -685,30 +731,26 @@ SDL_GetIndexOfDisplay(SDL_VideoDisplay *display) return 0; } -void * -SDL_GetDisplayDriverData(int displayIndex) +void *SDL_GetDisplayDriverData(int displayIndex) { CHECK_DISPLAY_INDEX(displayIndex, NULL); return _this->displays[displayIndex].driverdata; } -SDL_bool -SDL_IsVideoContextExternal(void) +SDL_bool SDL_IsVideoContextExternal(void) { return SDL_GetHintBoolean(SDL_HINT_VIDEO_EXTERNAL_CONTEXT, SDL_FALSE); } -const char * -SDL_GetDisplayName(int displayIndex) +const char *SDL_GetDisplayName(int displayIndex) { CHECK_DISPLAY_INDEX(displayIndex, NULL); return _this->displays[displayIndex].name; } -int -SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) +int SDL_GetDisplayBounds(int displayIndex, SDL_Rect *rect) { SDL_VideoDisplay *display; @@ -731,7 +773,7 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) rect->x = 0; rect->y = 0; } else { - SDL_GetDisplayBounds(displayIndex-1, rect); + SDL_GetDisplayBounds(displayIndex - 1, rect); rect->x += rect->w; } rect->w = display->current_mode.w; @@ -739,15 +781,13 @@ SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect) return 0; } -static int -ParseDisplayUsableBoundsHint(SDL_Rect *rect) +static int ParseDisplayUsableBoundsHint(SDL_Rect *rect) { const char *hint = SDL_GetHint(SDL_HINT_DISPLAY_USABLE_BOUNDS); return hint && (SDL_sscanf(hint, "%d,%d,%d,%d", &rect->x, &rect->y, &rect->w, &rect->h) == 4); } -int -SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect) +int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect *rect) { SDL_VideoDisplay *display; @@ -773,8 +813,7 @@ SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect) return SDL_GetDisplayBounds(displayIndex, rect); } -int -SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) +int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) { SDL_VideoDisplay *display; @@ -793,8 +832,7 @@ SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi) return -1; } -SDL_DisplayOrientation -SDL_GetDisplayOrientation(int displayIndex) +SDL_DisplayOrientation SDL_GetDisplayOrientation(int displayIndex) { SDL_VideoDisplay *display; @@ -804,8 +842,7 @@ SDL_GetDisplayOrientation(int displayIndex) return display->orientation; } -SDL_bool -SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { SDL_DisplayMode *modes; int i, nmodes; @@ -840,20 +877,20 @@ SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) return SDL_TRUE; } -void -SDL_SetCurrentDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { SDL_memcpy(&display->current_mode, mode, sizeof(*mode)); } -void -SDL_SetDesktopDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { + if (display->desktop_mode.driverdata) { + SDL_free(display->desktop_mode.driverdata); + } SDL_memcpy(&display->desktop_mode, mode, sizeof(*mode)); } -static int -SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display) +static int SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay *display) { if (!display->num_display_modes && _this->GetDisplayModes) { _this->GetDisplayModes(_this, display); @@ -863,21 +900,19 @@ SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display) return display->num_display_modes; } -int -SDL_GetNumDisplayModes(int displayIndex) +int SDL_GetNumDisplayModes(int displayIndex) { CHECK_DISPLAY_INDEX(displayIndex, -1); return SDL_GetNumDisplayModesForDisplay(&_this->displays[displayIndex]); } -void -SDL_ResetDisplayModes(int displayIndex) +void SDL_ResetDisplayModes(int displayIndex) { SDL_VideoDisplay *display; int i; - CHECK_DISPLAY_INDEX(displayIndex,); + CHECK_DISPLAY_INDEX(displayIndex, ); display = &_this->displays[displayIndex]; for (i = display->num_display_modes; i--;) { @@ -890,8 +925,7 @@ SDL_ResetDisplayModes(int displayIndex) display->max_display_modes = 0; } -int -SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode * mode) +int SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode *mode) { SDL_VideoDisplay *display; @@ -899,8 +933,7 @@ SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode * mode) display = &_this->displays[displayIndex]; if (index < 0 || index >= SDL_GetNumDisplayModesForDisplay(display)) { - return SDL_SetError("index must be in the range of 0 - %d", - SDL_GetNumDisplayModesForDisplay(display) - 1); + return SDL_SetError("index must be in the range of 0 - %d", SDL_GetNumDisplayModesForDisplay(display) - 1); } if (mode) { *mode = display->display_modes[index]; @@ -908,8 +941,7 @@ SDL_GetDisplayMode(int displayIndex, int index, SDL_DisplayMode * mode) return 0; } -int -SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode) +int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode) { SDL_VideoDisplay *display; @@ -922,8 +954,7 @@ SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode) return 0; } -int -SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode) +int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode) { SDL_VideoDisplay *display; @@ -936,10 +967,9 @@ SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode) return 0; } -static SDL_DisplayMode * -SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, - const SDL_DisplayMode * mode, - SDL_DisplayMode * closest) +static SDL_DisplayMode *SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay *display, + const SDL_DisplayMode *mode, + SDL_DisplayMode *closest) { Uint32 target_format; int target_refresh_rate; @@ -987,18 +1017,18 @@ SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, match = current; continue; } - if (current->format != match->format) { + if (current->format != match->format && match->format != target_format) { /* Sorted highest depth to lowest */ if (current->format == target_format || (SDL_BITSPERPIXEL(current->format) >= - SDL_BITSPERPIXEL(target_format) - && SDL_PIXELTYPE(current->format) == - SDL_PIXELTYPE(target_format))) { + SDL_BITSPERPIXEL(target_format) && + SDL_PIXELTYPE(current->format) == + SDL_PIXELTYPE(target_format))) { match = current; } continue; } - if (current->refresh_rate != match->refresh_rate) { + if (current->refresh_rate != match->refresh_rate && match->refresh_rate != target_refresh_rate) { /* Sorted highest refresh to lowest */ if (current->refresh_rate >= target_refresh_rate) { match = current; @@ -1043,10 +1073,9 @@ SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, return NULL; } -SDL_DisplayMode * -SDL_GetClosestDisplayMode(int displayIndex, - const SDL_DisplayMode * mode, - SDL_DisplayMode * closest) +SDL_DisplayMode *SDL_GetClosestDisplayMode(int displayIndex, + const SDL_DisplayMode *mode, + SDL_DisplayMode *closest) { SDL_VideoDisplay *display; @@ -1056,8 +1085,7 @@ SDL_GetClosestDisplayMode(int displayIndex, return SDL_GetClosestDisplayModeForDisplay(display, mode, closest); } -static int -SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode) +static int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { SDL_DisplayMode display_mode; SDL_DisplayMode current_mode; @@ -1087,8 +1115,7 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * /* Get a good video mode, the closest one possible */ if (!SDL_GetClosestDisplayModeForDisplay(display, &display_mode, &display_mode)) { - return SDL_SetError("No video mode large enough for %dx%d", - display_mode.w, display_mode.h); + return SDL_SetError("No video mode large enough for %dx%d", display_mode.w, display_mode.h); } } else { display_mode = display->desktop_mode; @@ -1114,8 +1141,7 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * return 0; } -SDL_VideoDisplay * -SDL_GetDisplay(int displayIndex) +SDL_VideoDisplay *SDL_GetDisplay(int displayIndex) { CHECK_DISPLAY_INDEX(displayIndex, NULL); @@ -1126,8 +1152,7 @@ SDL_GetDisplay(int displayIndex) * If x, y are outside of rect, snaps them to the closest point inside rect * (between rect->x, rect->y, inclusive, and rect->x + w, rect->y + h, exclusive) */ -static void -SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point) +static void SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point) { const int right = rect->x + rect->w - 1; const int bottom = rect->y + rect->h - 1; @@ -1145,8 +1170,7 @@ SDL_GetClosestPointOnRect(const SDL_Rect *rect, SDL_Point *point) } } -static int -GetRectDisplayIndex(int x, int y, int w, int h) +static int GetRectDisplayIndex(int x, int y, int w, int h) { int i, dist; int closest = -1; @@ -1157,25 +1181,27 @@ GetRectDisplayIndex(int x, int y, int w, int h) center.x = x + w / 2; center.y = y + h / 2; - for (i = 0; i < _this->num_displays; ++i) { - SDL_Rect display_rect; - SDL_GetDisplayBounds(i, &display_rect); + if (_this) { + for (i = 0; i < _this->num_displays; ++i) { + SDL_Rect display_rect; + SDL_GetDisplayBounds(i, &display_rect); - /* Check if the window is fully enclosed */ - if (SDL_EnclosePoints(¢er, 1, &display_rect, NULL)) { - return i; - } + /* Check if the window is fully enclosed */ + if (SDL_EnclosePoints(¢er, 1, &display_rect, NULL)) { + return i; + } - /* Snap window center to the display rect */ - closest_point_on_display = center; - SDL_GetClosestPointOnRect(&display_rect, &closest_point_on_display); + /* Snap window center to the display rect */ + closest_point_on_display = center; + SDL_GetClosestPointOnRect(&display_rect, &closest_point_on_display); - delta.x = center.x - closest_point_on_display.x; - delta.y = center.y - closest_point_on_display.y; - dist = (delta.x*delta.x + delta.y*delta.y); - if (dist < closest_dist) { - closest = i; - closest_dist = dist; + delta.x = center.x - closest_point_on_display.x; + delta.y = center.y - closest_point_on_display.y; + dist = (delta.x * delta.x + delta.y * delta.y); + if (dist < closest_dist) { + closest = i; + closest_dist = dist; + } } } @@ -1186,20 +1212,17 @@ GetRectDisplayIndex(int x, int y, int w, int h) return closest; } -int -SDL_GetPointDisplayIndex(const SDL_Point *point) +int SDL_GetPointDisplayIndex(const SDL_Point *point) { return GetRectDisplayIndex(point->x, point->y, 1, 1); } -int -SDL_GetRectDisplayIndex(const SDL_Rect *rect) +int SDL_GetRectDisplayIndex(const SDL_Rect *rect) { return GetRectDisplayIndex(rect->x, rect->y, rect->w, rect->h); } -int -SDL_GetWindowDisplayIndex(SDL_Window * window) +int SDL_GetWindowDisplayIndex(SDL_Window *window) { int displayIndex = -1; @@ -1233,21 +1256,36 @@ SDL_GetWindowDisplayIndex(SDL_Window * window) return displayIndex; } + displayIndex = GetRectDisplayIndex(window->x, window->y, window->w, window->h); + /* Find the display containing the window if fullscreen */ for (i = 0; i < _this->num_displays; ++i) { SDL_VideoDisplay *display = &_this->displays[i]; if (display->fullscreen_window == window) { - return i; + if (displayIndex != i) { + if (displayIndex < 0) { + displayIndex = i; + } else { + SDL_VideoDisplay *new_display = &_this->displays[displayIndex]; + + /* The window was moved to a different display */ + if (new_display->fullscreen_window) { + /* Uh oh, there's already a fullscreen window here */ + } else { + new_display->fullscreen_window = window; + } + display->fullscreen_window = NULL; + } + } + break; } } - - return GetRectDisplayIndex(window->x, window->y, window->w, window->h); + return displayIndex; } } -SDL_VideoDisplay * -SDL_GetDisplayForWindow(SDL_Window *window) +SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window) { int displayIndex = SDL_GetWindowDisplayIndex(window); if (displayIndex >= 0) { @@ -1257,8 +1295,7 @@ SDL_GetDisplayForWindow(SDL_Window *window) } } -int -SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode) +int SDL_SetWindowDisplayMode(SDL_Window *window, const SDL_DisplayMode *mode) { CHECK_WINDOW_MAGIC(window, -1); @@ -1286,8 +1323,7 @@ SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode) return 0; } -int -SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) +int SDL_GetWindowDisplayMode(SDL_Window *window, SDL_DisplayMode *mode) { SDL_DisplayMode fullscreen_mode; SDL_VideoDisplay *display; @@ -1312,8 +1348,8 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) if ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) { fullscreen_mode = display->desktop_mode; } else if (!SDL_GetClosestDisplayModeForDisplay(SDL_GetDisplayForWindow(window), - &fullscreen_mode, - &fullscreen_mode)) { + &fullscreen_mode, + &fullscreen_mode)) { SDL_zerop(mode); return SDL_SetError("Couldn't find display mode match"); } @@ -1323,8 +1359,7 @@ SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode) return 0; } -void* -SDL_GetWindowICCProfile(SDL_Window * window, size_t* size) +void *SDL_GetWindowICCProfile(SDL_Window *window, size_t *size) { if (!_this->GetWindowICCProfile) { SDL_Unsupported(); @@ -1333,8 +1368,7 @@ SDL_GetWindowICCProfile(SDL_Window * window, size_t* size) return _this->GetWindowICCProfile(_this, window, size); } -Uint32 -SDL_GetWindowPixelFormat(SDL_Window * window) +Uint32 SDL_GetWindowPixelFormat(SDL_Window *window) { SDL_VideoDisplay *display; @@ -1344,8 +1378,7 @@ SDL_GetWindowPixelFormat(SDL_Window * window) return display->current_mode.format; } -static void -SDL_RestoreMousePosition(SDL_Window *window) +static void SDL_RestoreMousePosition(SDL_Window *window) { int x, y; @@ -1355,17 +1388,17 @@ SDL_RestoreMousePosition(SDL_Window *window) } } -#if __WINRT__ -extern Uint32 WINRT_DetectWindowFlags(SDL_Window * window); +#ifdef __WINRT__ +extern Uint32 WINRT_DetectWindowFlags(SDL_Window *window); #endif -static int -SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) +static int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen) { SDL_VideoDisplay *display; SDL_Window *other; + SDL_bool resized = SDL_FALSE; - CHECK_WINDOW_MAGIC(window,-1); + CHECK_WINDOW_MAGIC(window, -1); /* if we are in the process of hiding don't go back to fullscreen */ if (window->is_hiding && fullscreen) { @@ -1376,10 +1409,11 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) /* if the window is going away and no resolution change is necessary, do nothing, or else we may trigger an ugly double-transition */ - if (SDL_strcmp(_this->name, "cocoa") == 0) { /* don't do this for X11, etc */ - if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) + if (SDL_strcmp(_this->name, "cocoa") == 0) { /* don't do this for X11, etc */ + if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) { return 0; - + } + /* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */ if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) { if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) { @@ -1401,7 +1435,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) return 0; } } -#elif __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) +#elif defined(__WINRT__) && (NTDDI_VERSION < NTDDI_WIN10) /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen or not. The user can choose this, via OS-provided UI, but this can't be set programmatically. @@ -1428,6 +1462,9 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) #endif display = SDL_GetDisplayForWindow(window); + if (!display) { /* No display connected, nothing to do. */ + return 0; + } if (fullscreen) { /* Hide any other fullscreen windows */ @@ -1442,6 +1479,13 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) if ((window->last_fullscreen_flags & FULLSCREEN_MASK) == (window->flags & FULLSCREEN_MASK)) { return 0; } + if (!fullscreen) { + if (_this->SetWindowFullscreen) { + _this->SetWindowFullscreen(_this, window, display, SDL_FALSE); + } + window->last_fullscreen_flags = window->flags; + return 0; + } } /* See if there are any fullscreen windows */ @@ -1461,14 +1505,14 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) SDL_zero(fullscreen_mode); if (SDL_GetWindowDisplayMode(other, &fullscreen_mode) == 0) { - SDL_bool resized = SDL_TRUE; + resized = SDL_TRUE; if (other->w == fullscreen_mode.w && other->h == fullscreen_mode.h) { resized = SDL_FALSE; } /* only do the mode change if we want exclusive fullscreen */ - if ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP) { + if ((other->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP) { if (SDL_SetDisplayModeForDisplay(display, &fullscreen_mode) < 0) { return -1; } @@ -1485,20 +1529,21 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) /* Generate a mode change event here */ if (resized) { -#if !defined(__ANDROID__) && !defined(__WIN32__) - /* Android may not resize the window to exactly what our fullscreen mode is, especially on - * windowed Android environments like the Chromebook or Samsung DeX. Given this, we shouldn't - * use fullscreen_mode.w and fullscreen_mode.h, but rather get our current native size. As such, - * Android's SetWindowFullscreen will generate the window event for us with the proper final size. - */ - - /* This is also unnecessary on Win32 (WIN_SetWindowFullscreen calls SetWindowPos, - * WM_WINDOWPOSCHANGED will send SDL_WINDOWEVENT_RESIZED). Also, on Windows with DPI scaling enabled, - * we're keeping modes in pixels, but window sizes in dpi-scaled points, so this would be a unit mismatch. - */ - SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED, - fullscreen_mode.w, fullscreen_mode.h); -#endif + if (SDL_strcmp(_this->name, "Android") != 0 && SDL_strcmp(_this->name, "windows") != 0) { + /* Android may not resize the window to exactly what our fullscreen mode is, especially on + * windowed Android environments like the Chromebook or Samsung DeX. Given this, we shouldn't + * use fullscreen_mode.w and fullscreen_mode.h, but rather get our current native size. As such, + * Android's SetWindowFullscreen will generate the window event for us with the proper final size. + */ + + /* This is also unnecessary on Win32 (WIN_SetWindowFullscreen calls SetWindowPos, + * WM_WINDOWPOSCHANGED will send SDL_WINDOWEVENT_RESIZED). Also, on Windows with DPI scaling enabled, + * we're keeping modes in pixels, but window sizes in dpi-scaled points, so this would be a unit mismatch. + */ + SDL_SendWindowEvent(other, SDL_WINDOWEVENT_RESIZED, + fullscreen_mode.w, fullscreen_mode.h); + } + } else { SDL_OnWindowResized(other); } @@ -1516,11 +1561,18 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) if (_this->SetWindowFullscreen) { _this->SetWindowFullscreen(_this, window, display, SDL_FALSE); + } else { + resized = SDL_TRUE; } display->fullscreen_window = NULL; - /* Generate a mode change event here */ - SDL_OnWindowResized(window); + if (!resized) { + /* Generate a mode change event here */ + SDL_OnWindowResized(window); + } else { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, + window->windowed.w, window->windowed.h); + } /* Restore the cursor position */ SDL_RestoreMousePosition(window); @@ -1532,8 +1584,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen) #define CREATE_FLAGS \ (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_ALWAYS_ON_TOP | SDL_WINDOW_SKIP_TASKBAR | SDL_WINDOW_POPUP_MENU | SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_VULKAN | SDL_WINDOW_MINIMIZED | SDL_WINDOW_METAL) -static SDL_INLINE SDL_bool -IsAcceptingDragAndDrop(void) +static SDL_INLINE SDL_bool IsAcceptingDragAndDrop(void) { if ((SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) || (SDL_GetEventState(SDL_DROPTEXT) == SDL_ENABLE)) { @@ -1543,8 +1594,7 @@ IsAcceptingDragAndDrop(void) } /* prepare a newly-created window */ -static SDL_INLINE void -PrepareDragAndDropSupport(SDL_Window *window) +static SDL_INLINE void PrepareDragAndDropSupport(SDL_Window *window) { if (_this->AcceptDragAndDrop) { _this->AcceptDragAndDrop(window, IsAcceptingDragAndDrop()); @@ -1552,8 +1602,7 @@ PrepareDragAndDropSupport(SDL_Window *window) } /* toggle d'n'd for all existing windows. */ -void -SDL_ToggleDragAndDropSupport(void) +void SDL_ToggleDragAndDropSupport(void) { if (_this && _this->AcceptDragAndDrop) { const SDL_bool enable = IsAcceptingDragAndDrop(); @@ -1564,8 +1613,7 @@ SDL_ToggleDragAndDropSupport(void) } } -static void -SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags) +static void SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags) { PrepareDragAndDropSupport(window); @@ -1594,22 +1642,21 @@ SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags) } } -static int -SDL_ContextNotSupported(const char *name) +static int SDL_ContextNotSupported(const char *name) { return SDL_SetError("%s support is either not configured in SDL " - "or not available in current SDL video driver " - "(%s) or platform", name, _this->name); + "or not available in current SDL video driver " + "(%s) or platform", + name, + _this->name); } -static int -SDL_DllNotSupported(const char *name) +static int SDL_DllNotSupported(const char *name) { return SDL_SetError("No dynamic %s support in current SDL video driver (%s)", name, _this->name); } -SDL_Window * -SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) +SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) { SDL_Window *window; Uint32 type_flags, graphics_flags; @@ -1619,11 +1666,21 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) if (SDL_Init(SDL_INIT_VIDEO) < 0) { return NULL; } + + /* Make clang-tidy happy */ + if (!_this) { + return NULL; + } + } + + /* Make sure the display list is up to date for window placement */ + if (_this->RefreshDisplays) { + _this->RefreshDisplays(_this); } /* ensure no more than one of these flags is set */ type_flags = flags & (SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU); - if ((type_flags & (type_flags - 1)) != 0) { + if (type_flags & (type_flags - 1)) { SDL_SetError("Conflicting window flags specified"); return NULL; } @@ -1637,14 +1694,16 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) } /* Some platforms blow up if the windows are too large. Raise it later? */ - if ((w > 16384) || (h > 16384)) { - SDL_SetError("Window is too large."); - return NULL; + if (w > 16384) { + w = 16384; + } + if (h > 16384) { + h = 16384; } /* ensure no more than one of these flags is set */ graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); - if ((graphics_flags & (graphics_flags - 1)) != 0) { + if (graphics_flags & (graphics_flags - 1)) { SDL_SetError("Conflicting window flags specified"); return NULL; } @@ -1721,7 +1780,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) window->windowed.w = window->w; window->windowed.h = window->h; - if (flags & SDL_WINDOW_FULLSCREEN) { + if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); int displayIndex; SDL_Rect bounds; @@ -1732,8 +1791,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) /* for real fullscreen we might switch the resolution, so get width and height * from closest supported mode and use that instead of current resolution */ - if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP - && (bounds.w != w || bounds.h != h)) { + if ((flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP && (bounds.w != w || bounds.h != h)) { SDL_DisplayMode fullscreen_mode, closest_mode; SDL_zero(fullscreen_mode); fullscreen_mode.w = w; @@ -1749,6 +1807,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) window->y = bounds.y; window->w = bounds.w; window->h = bounds.h; + flags |= SDL_WINDOW_FULLSCREEN; } window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN); @@ -1778,7 +1837,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) } #endif -#if __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) +#if defined(__WINRT__) && (NTDDI_VERSION < NTDDI_WIN10) /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen or not. The user can choose this, via OS-provided UI, but this can't be set programmatically. @@ -1801,8 +1860,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) return window; } -SDL_Window * -SDL_CreateWindowFrom(const void *data) +SDL_Window *SDL_CreateWindowFrom(const void *data) { SDL_Window *window; Uint32 flags = SDL_WINDOW_FOREIGN; @@ -1871,8 +1929,7 @@ SDL_CreateWindowFrom(const void *data) return window; } -int -SDL_RecreateWindow(SDL_Window * window, Uint32 flags) +int SDL_RecreateWindow(SDL_Window *window, Uint32 flags) { SDL_bool loaded_opengl = SDL_FALSE; SDL_bool need_gl_unload = SDL_FALSE; @@ -1884,7 +1941,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) /* ensure no more than one of these flags is set */ graphics_flags = flags & (SDL_WINDOW_OPENGL | SDL_WINDOW_METAL | SDL_WINDOW_VULKAN); - if ((graphics_flags & (graphics_flags - 1)) != 0) { + if (graphics_flags & (graphics_flags - 1)) { return SDL_SetError("Conflicting window flags specified"); } @@ -1911,18 +1968,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } /* Tear down the old native window */ - if (window->surface) { - window->surface->flags &= ~SDL_DONTFREE; - SDL_FreeSurface(window->surface); - window->surface = NULL; - window->surface_valid = SDL_FALSE; - } - - if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ - if (_this->DestroyWindowFramebuffer) { - _this->DestroyWindowFramebuffer(_this, window); - } - } + SDL_DestroyWindowSurface(window); if (_this->DestroyWindow && !(flags & SDL_WINDOW_FOREIGN)) { _this->DestroyWindow(_this, window); @@ -1936,7 +1982,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } } else if (window->flags & SDL_WINDOW_OPENGL) { need_gl_unload = SDL_TRUE; - need_gl_load = SDL_TRUE; + need_gl_load = SDL_TRUE; } if ((window->flags & SDL_WINDOW_VULKAN) != (flags & SDL_WINDOW_VULKAN)) { @@ -1947,7 +1993,7 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) } } else if (window->flags & SDL_WINDOW_VULKAN) { need_vulkan_unload = SDL_TRUE; - need_vulkan_load = SDL_TRUE; + need_vulkan_load = SDL_TRUE; } if (need_gl_unload) { @@ -2002,6 +2048,14 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) _this->SetWindowIcon(_this, window, window->icon); } + if (_this->SetWindowMinimumSize && (window->min_w || window->min_h)) { + _this->SetWindowMinimumSize(_this, window); + } + + if (_this->SetWindowMaximumSize && (window->max_w || window->max_h)) { + _this->SetWindowMaximumSize(_this, window); + } + if (window->hit_test) { _this->SetWindowHitTest(window, SDL_TRUE); } @@ -2011,22 +2065,19 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags) return 0; } -SDL_bool -SDL_HasWindows(void) +SDL_bool SDL_HasWindows(void) { - return (_this && _this->windows != NULL); + return _this && _this->windows; } -Uint32 -SDL_GetWindowID(SDL_Window * window) +Uint32 SDL_GetWindowID(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, 0); return window->id; } -SDL_Window * -SDL_GetWindowFromID(Uint32 id) +SDL_Window *SDL_GetWindowFromID(Uint32 id) { SDL_Window *window; @@ -2041,18 +2092,16 @@ SDL_GetWindowFromID(Uint32 id) return NULL; } -Uint32 -SDL_GetWindowFlags(SDL_Window * window) +Uint32 SDL_GetWindowFlags(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, 0); return window->flags; } -void -SDL_SetWindowTitle(SDL_Window * window, const char *title) +void SDL_SetWindowTitle(SDL_Window *window, const char *title) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (title == window->title) { return; @@ -2066,18 +2115,16 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title) } } -const char * -SDL_GetWindowTitle(SDL_Window * window) +const char *SDL_GetWindowTitle(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, ""); return window->title ? window->title : ""; } -void -SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon) +void SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!icon) { return; @@ -2096,8 +2143,7 @@ SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon) } } -void* -SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata) +void *SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata) { SDL_WindowUserData *prev, *data; @@ -2105,8 +2151,8 @@ SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata) /* Input validation */ if (name == NULL || name[0] == '\0') { - SDL_InvalidParamError("name"); - return NULL; + SDL_InvalidParamError("name"); + return NULL; } /* See if the named data already exists */ @@ -2143,8 +2189,7 @@ SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata) return NULL; } -void * -SDL_GetWindowData(SDL_Window * window, const char *name) +void *SDL_GetWindowData(SDL_Window *window, const char *name) { SDL_WindowUserData *data; @@ -2152,8 +2197,8 @@ SDL_GetWindowData(SDL_Window * window, const char *name) /* Input validation */ if (name == NULL || name[0] == '\0') { - SDL_InvalidParamError("name"); - return NULL; + SDL_InvalidParamError("name"); + return NULL; } for (data = window->data; data; data = data->next) { @@ -2164,10 +2209,9 @@ SDL_GetWindowData(SDL_Window * window, const char *name) return NULL; } -void -SDL_SetWindowPosition(SDL_Window * window, int x, int y) +void SDL_SetWindowPosition(SDL_Window *window, int x, int y) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { int displayIndex = (x & 0xFFFF); @@ -2208,15 +2252,14 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) } } -void -SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) +void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); /* Fullscreen windows are always at their display's origin */ if (window->flags & SDL_WINDOW_FULLSCREEN) { int displayIndex; - + if (x) { *x = 0; } @@ -2250,30 +2293,28 @@ SDL_GetWindowPosition(SDL_Window * window, int *x, int *y) } } -void -SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered) +void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { - const int want = (bordered != SDL_FALSE); /* normalize the flag. */ - const int have = ((window->flags & SDL_WINDOW_BORDERLESS) == 0); + const int want = (bordered != SDL_FALSE); /* normalize the flag. */ + const int have = !(window->flags & SDL_WINDOW_BORDERLESS); if ((want != have) && (_this->SetWindowBordered)) { if (want) { window->flags &= ~SDL_WINDOW_BORDERLESS; } else { window->flags |= SDL_WINDOW_BORDERLESS; } - _this->SetWindowBordered(_this, window, (SDL_bool) want); + _this->SetWindowBordered(_this, window, (SDL_bool)want); } } } -void -SDL_SetWindowResizable(SDL_Window * window, SDL_bool resizable) +void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { - const int want = (resizable != SDL_FALSE); /* normalize the flag. */ + const int want = (resizable != SDL_FALSE); /* normalize the flag. */ const int have = ((window->flags & SDL_WINDOW_RESIZABLE) != 0); if ((want != have) && (_this->SetWindowResizable)) { if (want) { @@ -2281,17 +2322,16 @@ SDL_SetWindowResizable(SDL_Window * window, SDL_bool resizable) } else { window->flags &= ~SDL_WINDOW_RESIZABLE; } - _this->SetWindowResizable(_this, window, (SDL_bool) want); + _this->SetWindowResizable(_this, window, (SDL_bool)want); } } } -void -SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top) +void SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { - const int want = (on_top != SDL_FALSE); /* normalize the flag. */ + const int want = (on_top != SDL_FALSE); /* normalize the flag. */ const int have = ((window->flags & SDL_WINDOW_ALWAYS_ON_TOP) != 0); if ((want != have) && (_this->SetWindowAlwaysOnTop)) { if (want) { @@ -2299,16 +2339,15 @@ SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top) } else { window->flags &= ~SDL_WINDOW_ALWAYS_ON_TOP; } - - _this->SetWindowAlwaysOnTop(_this, window, (SDL_bool) want); + + _this->SetWindowAlwaysOnTop(_this, window, (SDL_bool)want); } } } -void -SDL_SetWindowSize(SDL_Window * window, int w, int h) +void SDL_SetWindowSize(SDL_Window *window, int w, int h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (w <= 0) { SDL_InvalidParamError("w"); return; @@ -2355,10 +2394,9 @@ SDL_SetWindowSize(SDL_Window * window, int w, int h) } } -void -SDL_GetWindowSize(SDL_Window * window, int *w, int *h) +void SDL_GetWindowSize(SDL_Window *window, int *w, int *h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (w) { *w = window->w; } @@ -2367,15 +2405,22 @@ SDL_GetWindowSize(SDL_Window * window, int *w, int *h) } } -int -SDL_GetWindowBordersSize(SDL_Window * window, int *top, int *left, int *bottom, int *right) +int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right) { int dummy = 0; - if (!top) { top = &dummy; } - if (!left) { left = &dummy; } - if (!right) { right = &dummy; } - if (!bottom) { bottom = &dummy; } + if (!top) { + top = &dummy; + } + if (!left) { + left = &dummy; + } + if (!right) { + right = &dummy; + } + if (!bottom) { + bottom = &dummy; + } /* Always initialize, so applications don't have to care */ *top = *left = *bottom = *right = 0; @@ -2389,18 +2434,17 @@ SDL_GetWindowBordersSize(SDL_Window * window, int *top, int *left, int *bottom, return _this->GetWindowBordersSize(_this, window, top, left, bottom, right); } -void -SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) +void SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) { int filter; - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); - if (w == NULL) { + if (!w) { w = &filter; } - if (h == NULL) { + if (!h) { h = &filter; } @@ -2411,10 +2455,9 @@ SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) } } -void -SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h) +void SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (min_w <= 0) { SDL_InvalidParamError("min_w"); return; @@ -2442,10 +2485,9 @@ SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h) } } -void -SDL_GetWindowMinimumSize(SDL_Window * window, int *min_w, int *min_h) +void SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (min_w) { *min_w = window->min_w; } @@ -2454,10 +2496,9 @@ SDL_GetWindowMinimumSize(SDL_Window * window, int *min_w, int *min_h) } } -void -SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h) +void SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (max_w <= 0) { SDL_InvalidParamError("max_w"); return; @@ -2484,10 +2525,9 @@ SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h) } } -void -SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h) +void SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (max_w) { *max_w = window->max_w; } @@ -2496,10 +2536,9 @@ SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h) } } -void -SDL_ShowWindow(SDL_Window * window) +void SDL_ShowWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (window->flags & SDL_WINDOW_SHOWN) { return; @@ -2507,14 +2546,16 @@ SDL_ShowWindow(SDL_Window * window) if (_this->ShowWindow) { _this->ShowWindow(_this, window); + } else { + SDL_SetMouseFocus(window); + SDL_SetKeyboardFocus(window); } SDL_SendWindowEvent(window, SDL_WINDOWEVENT_SHOWN, 0, 0); } -void -SDL_HideWindow(SDL_Window * window) +void SDL_HideWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & SDL_WINDOW_SHOWN)) { return; @@ -2525,15 +2566,17 @@ SDL_HideWindow(SDL_Window * window) if (_this->HideWindow) { _this->HideWindow(_this, window); + } else { + SDL_SetMouseFocus(NULL); + SDL_SetKeyboardFocus(NULL); } window->is_hiding = SDL_FALSE; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIDDEN, 0, 0); } -void -SDL_RaiseWindow(SDL_Window * window) +void SDL_RaiseWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & SDL_WINDOW_SHOWN)) { return; @@ -2543,10 +2586,9 @@ SDL_RaiseWindow(SDL_Window * window) } } -void -SDL_MaximizeWindow(SDL_Window * window) +void SDL_MaximizeWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (window->flags & SDL_WINDOW_MAXIMIZED) { return; @@ -2559,8 +2601,7 @@ SDL_MaximizeWindow(SDL_Window * window) } } -static SDL_bool -CanMinimizeWindow(SDL_Window * window) +static SDL_bool CanMinimizeWindow(SDL_Window *window) { if (!_this->MinimizeWindow) { return SDL_FALSE; @@ -2568,10 +2609,9 @@ CanMinimizeWindow(SDL_Window * window) return SDL_TRUE; } -void -SDL_MinimizeWindow(SDL_Window * window) +void SDL_MinimizeWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (window->flags & SDL_WINDOW_MINIMIZED) { return; @@ -2590,10 +2630,9 @@ SDL_MinimizeWindow(SDL_Window * window) } } -void -SDL_RestoreWindow(SDL_Window * window) +void SDL_RestoreWindow(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) { return; @@ -2604,8 +2643,7 @@ SDL_RestoreWindow(SDL_Window * window) } } -int -SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) +int SDL_SetWindowFullscreen(SDL_Window *window, Uint32 flags) { Uint32 oldflags; CHECK_WINDOW_MAGIC(window, -1); @@ -2624,43 +2662,35 @@ SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags) if (SDL_UpdateFullscreenMode(window, FULLSCREEN_VISIBLE(window)) == 0) { return 0; } - + window->flags &= ~FULLSCREEN_MASK; window->flags |= oldflags; return -1; } -static SDL_Surface * -SDL_CreateWindowFramebuffer(SDL_Window * window) +static SDL_bool ShouldAttemptTextureFramebuffer(void) { - Uint32 format = 0; - void *pixels = NULL; - int pitch = 0; - int bpp; - Uint32 Rmask, Gmask, Bmask, Amask; - SDL_bool created_framebuffer = SDL_FALSE; - - /* This will switch the video backend from using a software surface to - using a GPU texture through the 2D render API, if we think this would - be more efficient. This only checks once, on demand. */ - if (!_this->checked_texture_framebuffer) { - SDL_bool attempt_texture_framebuffer = SDL_TRUE; + const char *hint; + SDL_bool attempt_texture_framebuffer = SDL_TRUE; - /* See if the user or application wants to specifically disable the framebuffer */ - const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); - if (hint) { - if ((*hint == '0') || (SDL_strcasecmp(hint, "false") == 0) || (SDL_strcasecmp(hint, "software") == 0)) { - attempt_texture_framebuffer = SDL_FALSE; - } - } + /* The dummy driver never has GPU support, of course. */ + if (_this->is_dummy) { + return SDL_FALSE; + } - if (_this->is_dummy) { /* dummy driver never has GPU support, of course. */ + /* See if there's a hint override */ + hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint && *hint) { + if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0 || SDL_strcasecmp(hint, "software") == 0) { attempt_texture_framebuffer = SDL_FALSE; + } else { + attempt_texture_framebuffer = SDL_TRUE; } - + } else { + /* Check for platform specific defaults */ #if defined(__LINUX__) /* On WSL, direct X11 is faster than using OpenGL for window framebuffers, so try to detect WSL and avoid texture framebuffer. */ - else if ((_this->CreateWindowFramebuffer != NULL) && (SDL_strcmp(_this->name, "x11") == 0)) { + if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "x11") == 0)) { struct stat sb; if ((stat("/proc/sys/fs/binfmt_misc/WSLInterop", &sb) == 0) || (stat("/run/WSL", &sb) == 0)) { /* if either of these exist, we're on WSL. */ attempt_texture_framebuffer = SDL_FALSE; @@ -2668,18 +2698,35 @@ SDL_CreateWindowFramebuffer(SDL_Window * window) } #endif #if defined(__WIN32__) || defined(__WINGDK__) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */ - else if ((_this->CreateWindowFramebuffer != NULL) && (SDL_strcmp(_this->name, "windows") == 0)) { + if (_this->CreateWindowFramebuffer && (SDL_strcmp(_this->name, "windows") == 0)) { attempt_texture_framebuffer = SDL_FALSE; } #endif #if defined(__EMSCRIPTEN__) - else { - attempt_texture_framebuffer = SDL_FALSE; - } + attempt_texture_framebuffer = SDL_FALSE; #endif + } + return attempt_texture_framebuffer; +} - if (attempt_texture_framebuffer) { - if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) == -1) { +static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) +{ + Uint32 format = 0; + void *pixels = NULL; + int pitch = 0; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; + SDL_bool created_framebuffer = SDL_FALSE; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); + + /* This will switch the video backend from using a software surface to + using a GPU texture through the 2D render API, if we think this would + be more efficient. This only checks once, on demand. */ + if (!_this->checked_texture_framebuffer) { + if (ShouldAttemptTextureFramebuffer()) { + if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) { /* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc), !!! FIXME: we probably need to clean this up so it doesn't interfere with !!! FIXME: a software fallback at the system level (can we blit to an @@ -2696,11 +2743,12 @@ SDL_CreateWindowFramebuffer(SDL_Window * window) } } - _this->checked_texture_framebuffer = SDL_TRUE; /* don't check this again. */ + _this->checked_texture_framebuffer = SDL_TRUE; /* don't check this again. */ } if (!created_framebuffer) { if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) { + SDL_SetError("Window framebuffer support not available"); return NULL; } @@ -2710,6 +2758,7 @@ SDL_CreateWindowFramebuffer(SDL_Window * window) } if (window->surface) { + /* We may have gone recursive and already created the surface */ return window->surface; } @@ -2717,11 +2766,17 @@ SDL_CreateWindowFramebuffer(SDL_Window * window) return NULL; } - return SDL_CreateRGBSurfaceFrom(pixels, window->w, window->h, bpp, pitch, Rmask, Gmask, Bmask, Amask); + return SDL_CreateRGBSurfaceFrom(pixels, w, h, bpp, pitch, Rmask, Gmask, Bmask, Amask); } -SDL_Surface * -SDL_GetWindowSurface(SDL_Window * window) +SDL_bool SDL_HasWindowSurface(SDL_Window *window) +{ + CHECK_WINDOW_MAGIC(window, SDL_FALSE); + + return window->surface ? SDL_TRUE : SDL_FALSE; +} + +SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, NULL); @@ -2731,6 +2786,7 @@ SDL_GetWindowSurface(SDL_Window * window) SDL_FreeSurface(window->surface); window->surface = NULL; } + window->surface = SDL_CreateWindowFramebuffer(window); if (window->surface) { window->surface_valid = SDL_TRUE; @@ -2740,8 +2796,7 @@ SDL_GetWindowSurface(SDL_Window * window) return window->surface; } -int -SDL_UpdateWindowSurface(SDL_Window * window) +int SDL_UpdateWindowSurface(SDL_Window *window) { SDL_Rect full_rect; @@ -2749,14 +2804,13 @@ SDL_UpdateWindowSurface(SDL_Window * window) full_rect.x = 0; full_rect.y = 0; - full_rect.w = window->w; - full_rect.h = window->h; + SDL_GetWindowSizeInPixels(window, &full_rect.w, &full_rect.h); + return SDL_UpdateWindowSurfaceRects(window, &full_rect, 1); } -int -SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, - int numrects) +int SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, + int numrects) { CHECK_WINDOW_MAGIC(window, -1); @@ -2769,8 +2823,26 @@ SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, return _this->UpdateWindowFramebuffer(_this, window, rects, numrects); } -int -SDL_SetWindowBrightness(SDL_Window * window, float brightness) +int SDL_DestroyWindowSurface(SDL_Window *window) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_FreeSurface(window->surface); + window->surface = NULL; + window->surface_valid = SDL_FALSE; + } + + if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ + if (_this->DestroyWindowFramebuffer) { + _this->DestroyWindowFramebuffer(_this, window); + } + } + return 0; +} + +int SDL_SetWindowBrightness(SDL_Window * window, float brightness) { Uint16 ramp[256]; int status; @@ -2785,16 +2857,14 @@ SDL_SetWindowBrightness(SDL_Window * window, float brightness) return status; } -float -SDL_GetWindowBrightness(SDL_Window * window) +float SDL_GetWindowBrightness(SDL_Window * window) { CHECK_WINDOW_MAGIC(window, 1.0f); return window->brightness; } -int -SDL_SetWindowOpacity(SDL_Window * window, float opacity) +int SDL_SetWindowOpacity(SDL_Window * window, float opacity) { int retval; CHECK_WINDOW_MAGIC(window, -1); @@ -2817,8 +2887,7 @@ SDL_SetWindowOpacity(SDL_Window * window, float opacity) return retval; } -int -SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity) +int SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity) { CHECK_WINDOW_MAGIC(window, -1); @@ -2829,8 +2898,7 @@ SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity) return 0; } -int -SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window) +int SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window) { CHECK_WINDOW_MAGIC(modal_window, -1); CHECK_WINDOW_MAGIC(parent_window, -1); @@ -2838,25 +2906,23 @@ SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window) if (!_this->SetWindowModalFor) { return SDL_Unsupported(); } - + return _this->SetWindowModalFor(_this, modal_window, parent_window); } -int -SDL_SetWindowInputFocus(SDL_Window * window) +int SDL_SetWindowInputFocus(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, -1); if (!_this->SetWindowInputFocus) { return SDL_Unsupported(); } - + return _this->SetWindowInputFocus(_this, window); } -int -SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, +int SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, const Uint16 * green, const Uint16 * blue) { @@ -2889,8 +2955,7 @@ SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, } } -int -SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, +int SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, Uint16 * green, Uint16 * blue) { @@ -2934,8 +2999,7 @@ SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, return 0; } -void -SDL_UpdateWindowGrab(SDL_Window * window) +void SDL_UpdateWindowGrab(SDL_Window * window) { SDL_bool keyboard_grabbed, mouse_grabbed; @@ -2969,7 +3033,7 @@ SDL_UpdateWindowGrab(SDL_Window * window) } _this->grabbed_window = window; } else if (_this->grabbed_window == window) { - _this->grabbed_window = NULL; /* ungrabbing input. */ + _this->grabbed_window = NULL; /* ungrabbing input. */ } if (_this->SetWindowMouseGrab) { @@ -2980,10 +3044,9 @@ SDL_UpdateWindowGrab(SDL_Window * window) } } -void -SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed) +void SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); SDL_SetWindowMouseGrab(window, grabbed); @@ -2992,10 +3055,9 @@ SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed) } } -void -SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed) +void SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!!grabbed == !!(window->flags & SDL_WINDOW_KEYBOARD_GRABBED)) { return; @@ -3008,10 +3070,9 @@ SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed) SDL_UpdateWindowGrab(window); } -void -SDL_SetWindowMouseGrab(SDL_Window * window, SDL_bool grabbed) +void SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (!!grabbed == !!(window->flags & SDL_WINDOW_MOUSE_GRABBED)) { return; @@ -3024,41 +3085,34 @@ SDL_SetWindowMouseGrab(SDL_Window * window, SDL_bool grabbed) SDL_UpdateWindowGrab(window); } -SDL_bool -SDL_GetWindowGrab(SDL_Window * window) +SDL_bool SDL_GetWindowGrab(SDL_Window *window) { - return (SDL_GetWindowKeyboardGrab(window) || SDL_GetWindowMouseGrab(window)); + return SDL_GetWindowKeyboardGrab(window) || SDL_GetWindowMouseGrab(window); } -SDL_bool -SDL_GetWindowKeyboardGrab(SDL_Window * window) +SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, SDL_FALSE); - return window == _this->grabbed_window && - ((_this->grabbed_window->flags & SDL_WINDOW_KEYBOARD_GRABBED) != 0); + return window == _this->grabbed_window && (_this->grabbed_window->flags & SDL_WINDOW_KEYBOARD_GRABBED); } -SDL_bool -SDL_GetWindowMouseGrab(SDL_Window * window) +SDL_bool SDL_GetWindowMouseGrab(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, SDL_FALSE); - return window == _this->grabbed_window && - ((_this->grabbed_window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0); + return window == _this->grabbed_window && (_this->grabbed_window->flags & SDL_WINDOW_MOUSE_GRABBED); } -SDL_Window * -SDL_GetGrabbedWindow(void) +SDL_Window *SDL_GetGrabbedWindow(void) { if (_this->grabbed_window && - (_this->grabbed_window->flags & (SDL_WINDOW_MOUSE_GRABBED|SDL_WINDOW_KEYBOARD_GRABBED)) != 0) { + (_this->grabbed_window->flags & (SDL_WINDOW_MOUSE_GRABBED | SDL_WINDOW_KEYBOARD_GRABBED))) { return _this->grabbed_window; } else { return NULL; } } -int -SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect) +int SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect) { CHECK_WINDOW_MAGIC(window, -1); @@ -3074,8 +3128,7 @@ SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect) return 0; } -const SDL_Rect * -SDL_GetWindowMouseRect(SDL_Window * window) +const SDL_Rect *SDL_GetWindowMouseRect(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, NULL); @@ -3086,8 +3139,7 @@ SDL_GetWindowMouseRect(SDL_Window * window) } } -int -SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation) +int SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation) { CHECK_WINDOW_MAGIC(window, -1); @@ -3098,20 +3150,17 @@ SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation) return SDL_Unsupported(); } -void -SDL_OnWindowShown(SDL_Window * window) +void SDL_OnWindowShown(SDL_Window *window) { SDL_OnWindowRestored(window); } -void -SDL_OnWindowHidden(SDL_Window * window) +void SDL_OnWindowHidden(SDL_Window *window) { SDL_UpdateFullscreenMode(window, SDL_FALSE); } -void -SDL_OnWindowResized(SDL_Window * window) +void SDL_OnWindowResized(SDL_Window *window) { int display_index = SDL_GetWindowDisplayIndex(window); window->surface_valid = SDL_FALSE; @@ -3126,8 +3175,7 @@ SDL_OnWindowResized(SDL_Window * window) } } -void -SDL_OnWindowMoved(SDL_Window * window) +void SDL_OnWindowMoved(SDL_Window *window) { int display_index = SDL_GetWindowDisplayIndex(window); @@ -3137,16 +3185,20 @@ SDL_OnWindowMoved(SDL_Window * window) } } -void -SDL_OnWindowMinimized(SDL_Window * window) +void SDL_OnWindowLiveResizeUpdate(SDL_Window *window) +{ + /* Send an expose event so the application can redraw */ + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_EXPOSED, 0, 0); +} + +void SDL_OnWindowMinimized(SDL_Window *window) { if (!DisableUnsetFullscreenOnMinimize(_this)) { SDL_UpdateFullscreenMode(window, SDL_FALSE); } } -void -SDL_OnWindowRestored(SDL_Window * window) +void SDL_OnWindowRestored(SDL_Window *window) { /* * FIXME: Is this fine to just remove this, or should it be preserved just @@ -3161,21 +3213,18 @@ SDL_OnWindowRestored(SDL_Window * window) } } -void -SDL_OnWindowEnter(SDL_Window * window) +void SDL_OnWindowEnter(SDL_Window *window) { if (_this->OnWindowEnter) { _this->OnWindowEnter(_this, window); } } -void -SDL_OnWindowLeave(SDL_Window * window) +void SDL_OnWindowLeave(SDL_Window *window) { } -void -SDL_OnWindowFocusGained(SDL_Window * window) +void SDL_OnWindowFocusGained(SDL_Window *window) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -3186,15 +3235,14 @@ SDL_OnWindowFocusGained(SDL_Window * window) if (mouse && mouse->relative_mode) { SDL_SetMouseFocus(window); if (mouse->relative_mode_warp) { - SDL_PerformWarpMouseInWindow(window, window->w/2, window->h/2, SDL_TRUE); + SDL_PerformWarpMouseInWindow(window, window->w / 2, window->h / 2, SDL_TRUE); } } SDL_UpdateWindowGrab(window); } -static SDL_bool -ShouldMinimizeOnFocusLoss(SDL_Window * window) +static SDL_bool ShouldMinimizeOnFocusLoss(SDL_Window *window) { const char *hint; @@ -3232,8 +3280,7 @@ ShouldMinimizeOnFocusLoss(SDL_Window * window) return SDL_GetHintBoolean(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, SDL_FALSE); } -void -SDL_OnWindowFocusLost(SDL_Window * window) +void SDL_OnWindowFocusLost(SDL_Window *window) { if (window->gamma && _this->SetWindowGammaRamp) { _this->SetWindowGammaRamp(_this, window, window->saved_gamma); @@ -3248,8 +3295,7 @@ SDL_OnWindowFocusLost(SDL_Window * window) /* !!! FIXME: is this different than SDL_GetKeyboardFocus()? !!! FIXME: Also, SDL_GetKeyboardFocus() is O(1), this isn't. */ -SDL_Window * -SDL_GetFocusWindow(void) +SDL_Window *SDL_GetFocusWindow(void) { SDL_Window *window; @@ -3264,12 +3310,12 @@ SDL_GetFocusWindow(void) return NULL; } -void -SDL_DestroyWindow(SDL_Window * window) +void SDL_DestroyWindow(SDL_Window *window) { SDL_VideoDisplay *display; + SDL_Renderer *renderer; - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); window->is_destroying = SDL_TRUE; @@ -3282,28 +3328,27 @@ SDL_DestroyWindow(SDL_Window * window) if (SDL_GetKeyboardFocus() == window) { SDL_SetKeyboardFocus(NULL); } + if ((window->flags & SDL_WINDOW_MOUSE_CAPTURE)) { + SDL_UpdateMouseCapture(SDL_TRUE); + } if (SDL_GetMouseFocus() == window) { SDL_SetMouseFocus(NULL); } - /* make no context current if this is the current context window. */ + renderer = SDL_GetRenderer(window); + if (renderer) { + SDL_DestroyRendererWithoutFreeing(renderer); + } + + SDL_DestroyWindowSurface(window); + + /* Make no context current if this is the current context window */ if (window->flags & SDL_WINDOW_OPENGL) { if (_this->current_glwin == window) { SDL_GL_MakeCurrent(window, NULL); } } - if (window->surface) { - window->surface->flags &= ~SDL_DONTFREE; - SDL_FreeSurface(window->surface); - window->surface = NULL; - window->surface_valid = SDL_FALSE; - } - if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ - if (_this->DestroyWindowFramebuffer) { - _this->DestroyWindowFramebuffer(_this, window); - } - } if (_this->DestroyWindow) { _this->DestroyWindow(_this, window); } @@ -3319,6 +3364,16 @@ SDL_DestroyWindow(SDL_Window * window) display->fullscreen_window = NULL; } + if (_this->grabbed_window == window) { + _this->grabbed_window = NULL; /* ungrabbing input. */ + } + + if (_this->current_glwin == window) { + _this->current_glwin = NULL; + } + + SDL_AtomicCASPtr(&_this->wakeup_window, window, NULL); + /* Now invalidate magic */ window->magic = NULL; @@ -3347,8 +3402,7 @@ SDL_DestroyWindow(SDL_Window * window) SDL_free(window); } -SDL_bool -SDL_IsScreenSaverEnabled() +SDL_bool SDL_IsScreenSaverEnabled(void) { if (!_this) { return SDL_TRUE; @@ -3356,8 +3410,7 @@ SDL_IsScreenSaverEnabled() return _this->suspend_screensaver ? SDL_FALSE : SDL_TRUE; } -void -SDL_EnableScreenSaver() +void SDL_EnableScreenSaver(void) { if (!_this) { return; @@ -3371,8 +3424,7 @@ SDL_EnableScreenSaver() } } -void -SDL_DisableScreenSaver() +void SDL_DisableScreenSaver(void) { if (!_this) { return; @@ -3386,8 +3438,7 @@ SDL_DisableScreenSaver() } } -void -SDL_VideoQuit(void) +void SDL_VideoQuit(void) { int i; @@ -3413,26 +3464,21 @@ SDL_VideoQuit(void) SDL_VideoDisplay *display = &_this->displays[i]; SDL_ResetDisplayModes(i); SDL_free(display->desktop_mode.driverdata); - display->desktop_mode.driverdata = NULL; SDL_free(display->driverdata); - display->driverdata = NULL; - } - if (_this->displays) { - for (i = 0; i < _this->num_displays; ++i) { - SDL_free(_this->displays[i].name); - } - SDL_free(_this->displays); - _this->displays = NULL; - _this->num_displays = 0; + SDL_free(display->name); } + + SDL_free(_this->displays); + _this->displays = NULL; + _this->num_displays = 0; + SDL_free(_this->clipboard_text); _this->clipboard_text = NULL; _this->free(_this); _this = NULL; } -int -SDL_GL_LoadLibrary(const char *path) +int SDL_GL_LoadLibrary(const char *path) { int retval; @@ -3457,11 +3503,10 @@ SDL_GL_LoadLibrary(const char *path) _this->GL_UnloadLibrary(_this); } } - return (retval); + return retval; } -void * -SDL_GL_GetProcAddress(const char *proc) +void *SDL_GL_GetProcAddress(const char *proc) { void *func; @@ -3482,8 +3527,7 @@ SDL_GL_GetProcAddress(const char *proc) return func; } -void -SDL_GL_UnloadLibrary(void) +void SDL_GL_UnloadLibrary(void) { if (!_this) { SDL_UninitializedVideo(); @@ -3499,19 +3543,17 @@ SDL_GL_UnloadLibrary(void) } } -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 -static SDL_INLINE SDL_bool -isAtLeastGL3(const char *verstr) +#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) +static SDL_INLINE SDL_bool isAtLeastGL3(const char *verstr) { - return (verstr && (SDL_atoi(verstr) >= 3)); + return verstr && (SDL_atoi(verstr) >= 3); } #endif -SDL_bool -SDL_GL_ExtensionSupported(const char *extension) +SDL_bool SDL_GL_ExtensionSupported(const char *extension) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 - const GLubyte *(APIENTRY * glGetStringFunc) (GLenum); +#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) + const GLubyte *(APIENTRY * glGetStringFunc)(GLenum); const char *extensions; const char *start; const char *where, *terminator; @@ -3534,9 +3576,9 @@ SDL_GL_ExtensionSupported(const char *extension) return SDL_FALSE; } - if (isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) { - const GLubyte *(APIENTRY * glGetStringiFunc) (GLenum, GLuint); - void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); + if (isAtLeastGL3((const char *)glGetStringFunc(GL_VERSION))) { + const GLubyte *(APIENTRY * glGetStringiFunc)(GLenum, GLuint); + void(APIENTRY * glGetIntegervFunc)(GLenum pname, GLint * params); GLint num_exts = 0; GLint i; @@ -3546,12 +3588,12 @@ SDL_GL_ExtensionSupported(const char *extension) return SDL_FALSE; } - #ifndef GL_NUM_EXTENSIONS - #define GL_NUM_EXTENSIONS 0x821D - #endif +#ifndef GL_NUM_EXTENSIONS +#define GL_NUM_EXTENSIONS 0x821D +#endif glGetIntegervFunc(GL_NUM_EXTENSIONS, &num_exts); for (i = 0; i < num_exts; i++) { - const char *thisext = (const char *) glGetStringiFunc(GL_EXTENSIONS, i); + const char *thisext = (const char *)glGetStringiFunc(GL_EXTENSIONS, i); if (SDL_strcmp(thisext, extension) == 0) { return SDL_TRUE; } @@ -3562,7 +3604,7 @@ SDL_GL_ExtensionSupported(const char *extension) /* Try the old way with glGetString(GL_EXTENSIONS) ... */ - extensions = (const char *) glGetStringFunc(GL_EXTENSIONS); + extensions = (const char *)glGetStringFunc(GL_EXTENSIONS); if (!extensions) { return SDL_FALSE; } @@ -3575,13 +3617,16 @@ SDL_GL_ExtensionSupported(const char *extension) for (;;) { where = SDL_strstr(start, extension); - if (!where) + if (!where) { break; + } terminator = where + SDL_strlen(extension); - if (where == extensions || *(where - 1) == ' ') - if (*terminator == ' ' || *terminator == '\0') + if (where == extensions || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { return SDL_TRUE; + } + } start = terminator; } @@ -3593,16 +3638,15 @@ SDL_GL_ExtensionSupported(const char *extension) /* Deduce supported ES profile versions from the supported ARB_ES*_compatibility extensions. There is no direct query. - + This is normally only called when the OpenGL driver supports {GLX,WGL}_EXT_create_context_es2_profile. */ -void -SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor) +void SDL_GL_DeduceMaxSupportedESProfile(int *major, int *minor) { /* THIS REQUIRES AN EXISTING GL CONTEXT THAT HAS BEEN MADE CURRENT. */ /* Please refer to https://bugzilla.libsdl.org/show_bug.cgi?id=3725 for discussion. */ -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) /* XXX This is fragile; it will break in the event of release of * new versions of OpenGL ES. */ @@ -3622,8 +3666,7 @@ SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor) #endif } -void -SDL_GL_ResetAttributes() +void SDL_GL_ResetAttributes(void) { if (!_this) { return; @@ -3646,17 +3689,17 @@ SDL_GL_ResetAttributes() _this->gl_config.multisamplesamples = 0; _this->gl_config.floatbuffers = 0; _this->gl_config.retained_backing = 1; - _this->gl_config.accelerated = -1; /* accelerated or not, both are fine */ + _this->gl_config.accelerated = -1; /* accelerated or not, both are fine */ -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL _this->gl_config.major_version = 2; _this->gl_config.minor_version = 1; _this->gl_config.profile_mask = 0; -#elif SDL_VIDEO_OPENGL_ES2 +#elif defined(SDL_VIDEO_OPENGL_ES2) _this->gl_config.major_version = 2; _this->gl_config.minor_version = 0; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; -#elif SDL_VIDEO_OPENGL_ES +#elif defined(SDL_VIDEO_OPENGL_ES) _this->gl_config.major_version = 1; _this->gl_config.minor_version = 1; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; @@ -3677,10 +3720,9 @@ SDL_GL_ResetAttributes() _this->gl_config.share_with_current_context = 0; } -int -SDL_GL_SetAttribute(SDL_GLattr attr, int value) +int SDL_GL_SetAttribute(SDL_GLattr attr, int value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) int retval; if (!_this) { @@ -3801,11 +3843,10 @@ SDL_GL_SetAttribute(SDL_GLattr attr, int value) #endif /* SDL_VIDEO_OPENGL */ } -int -SDL_GL_GetAttribute(SDL_GLattr attr, int *value) +int SDL_GL_GetAttribute(SDL_GLattr attr, int *value) { -#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 - GLenum (APIENTRY *glGetErrorFunc) (void); +#if defined(SDL_VIDEO_OPENGL) || defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) + GLenum(APIENTRY * glGetErrorFunc)(void); GLenum attrib = 0; GLenum error = 0; @@ -3815,9 +3856,9 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) * the enums we use for the former function don't exist in OpenGL ES 2, and * the function itself doesn't exist prior to OpenGL 3 and OpenGL ES 2. */ -#if SDL_VIDEO_OPENGL - const GLubyte *(APIENTRY *glGetStringFunc) (GLenum name); - void (APIENTRY *glGetFramebufferAttachmentParameterivFunc) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +#ifdef SDL_VIDEO_OPENGL + const GLubyte *(APIENTRY * glGetStringFunc)(GLenum name); + void(APIENTRY * glGetFramebufferAttachmentParameterivFunc)(GLenum target, GLenum attachment, GLenum pname, GLint * params); GLenum attachment = GL_BACK_LEFT; GLenum attachmentattrib = 0; #endif @@ -3835,31 +3876,31 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) switch (attr) { case SDL_GL_RED_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE; #endif attrib = GL_RED_BITS; break; case SDL_GL_BLUE_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE; #endif attrib = GL_BLUE_BITS; break; case SDL_GL_GREEN_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE; #endif attrib = GL_GREEN_BITS; break; case SDL_GL_ALPHA_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE; #endif attrib = GL_ALPHA_BITS; break; case SDL_GL_DOUBLEBUFFER: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attrib = GL_DOUBLEBUFFER; break; #else @@ -3870,20 +3911,20 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) return 0; #endif case SDL_GL_DEPTH_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachment = GL_DEPTH; attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE; #endif attrib = GL_DEPTH_BITS; break; case SDL_GL_STENCIL_SIZE: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attachment = GL_STENCIL; attachmentattrib = GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE; #endif attrib = GL_STENCIL_BITS; break; -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL case SDL_GL_ACCUM_RED_SIZE: attrib = GL_ACCUM_RED_BITS; break; @@ -3916,105 +3957,113 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) attrib = GL_SAMPLES; break; case SDL_GL_CONTEXT_RELEASE_BEHAVIOR: -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL attrib = GL_CONTEXT_RELEASE_BEHAVIOR; #else attrib = GL_CONTEXT_RELEASE_BEHAVIOR_KHR; #endif break; case SDL_GL_BUFFER_SIZE: - { - int rsize = 0, gsize = 0, bsize = 0, asize = 0; - - /* There doesn't seem to be a single flag in OpenGL for this! */ - if (SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &rsize) < 0) { - return -1; - } - if (SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &gsize) < 0) { - return -1; - } - if (SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &bsize) < 0) { - return -1; - } - if (SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &asize) < 0) { - return -1; - } + { + int rsize = 0, gsize = 0, bsize = 0, asize = 0; - *value = rsize + gsize + bsize + asize; - return 0; + /* There doesn't seem to be a single flag in OpenGL for this! */ + if (SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &rsize) < 0) { + return -1; } - case SDL_GL_ACCELERATED_VISUAL: - { - /* FIXME: How do we get this information? */ - *value = (_this->gl_config.accelerated != 0); - return 0; + if (SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &gsize) < 0) { + return -1; } - case SDL_GL_RETAINED_BACKING: - { - *value = _this->gl_config.retained_backing; - return 0; + if (SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &bsize) < 0) { + return -1; } - case SDL_GL_CONTEXT_MAJOR_VERSION: - { - *value = _this->gl_config.major_version; - return 0; + if (SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &asize) < 0) { + return -1; } + + *value = rsize + gsize + bsize + asize; + return 0; + } + case SDL_GL_ACCELERATED_VISUAL: + { + /* FIXME: How do we get this information? */ + *value = (_this->gl_config.accelerated != 0); + return 0; + } + case SDL_GL_RETAINED_BACKING: + { + *value = _this->gl_config.retained_backing; + return 0; + } + case SDL_GL_CONTEXT_MAJOR_VERSION: + { + *value = _this->gl_config.major_version; + return 0; + } case SDL_GL_CONTEXT_MINOR_VERSION: - { - *value = _this->gl_config.minor_version; - return 0; - } + { + *value = _this->gl_config.minor_version; + return 0; + } case SDL_GL_CONTEXT_EGL: /* FIXME: SDL_GL_CONTEXT_EGL to be deprecated in SDL 2.1 */ { if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { *value = 1; - } - else { + } else { *value = 0; } return 0; } case SDL_GL_CONTEXT_FLAGS: - { - *value = _this->gl_config.flags; - return 0; - } + { + *value = _this->gl_config.flags; + return 0; + } case SDL_GL_CONTEXT_PROFILE_MASK: - { - *value = _this->gl_config.profile_mask; - return 0; - } + { + *value = _this->gl_config.profile_mask; + return 0; + } case SDL_GL_SHARE_WITH_CURRENT_CONTEXT: - { - *value = _this->gl_config.share_with_current_context; - return 0; - } + { + *value = _this->gl_config.share_with_current_context; + return 0; + } case SDL_GL_FRAMEBUFFER_SRGB_CAPABLE: - { - *value = _this->gl_config.framebuffer_srgb_capable; - return 0; - } + { + *value = _this->gl_config.framebuffer_srgb_capable; + return 0; + } case SDL_GL_CONTEXT_NO_ERROR: { *value = _this->gl_config.no_error; return 0; } + case SDL_GL_FLOATBUFFERS: + { + if (_this->gl_config.HAS_GL_ARB_color_buffer_float) { + attrib = GL_RGBA_FLOAT_MODE_ARB; + break; + } else { + return 0; + } + } default: return SDL_SetError("Unknown OpenGL attribute"); } -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL glGetStringFunc = SDL_GL_GetProcAddress("glGetString"); if (!glGetStringFunc) { return -1; } - if (attachmentattrib && isAtLeastGL3((const char *) glGetStringFunc(GL_VERSION))) { + if (attachmentattrib && isAtLeastGL3((const char *)glGetStringFunc(GL_VERSION))) { /* glGetFramebufferAttachmentParameteriv needs to operate on the window framebuffer for this, so bind FBO 0 if necessary. */ GLint current_fbo = 0; - void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params) = SDL_GL_GetProcAddress("glGetIntegerv"); - void (APIENTRY *glBindFramebufferFunc) (GLenum target, GLuint fbo) = SDL_GL_GetProcAddress("glBindFramebuffer"); + void(APIENTRY * glGetIntegervFunc)(GLenum pname, GLint * params) = SDL_GL_GetProcAddress("glGetIntegerv"); + void(APIENTRY * glBindFramebufferFunc)(GLenum target, GLuint fbo) = SDL_GL_GetProcAddress("glBindFramebuffer"); if (glGetIntegervFunc && glBindFramebufferFunc) { glGetIntegervFunc(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); } @@ -4024,7 +4073,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) if (glBindFramebufferFunc && (current_fbo != 0)) { glBindFramebufferFunc(GL_DRAW_FRAMEBUFFER, 0); } - glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *) value); + glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, attachmentattrib, (GLint *)value); if (glBindFramebufferFunc && (current_fbo != 0)) { glBindFramebufferFunc(GL_DRAW_FRAMEBUFFER, current_fbo); } @@ -4034,10 +4083,10 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) } else #endif { - void (APIENTRY *glGetIntegervFunc) (GLenum pname, GLint * params); + void(APIENTRY * glGetIntegervFunc)(GLenum pname, GLint * params); glGetIntegervFunc = SDL_GL_GetProcAddress("glGetIntegerv"); if (glGetIntegervFunc) { - glGetIntegervFunc(attrib, (GLint *) value); + glGetIntegervFunc(attrib, (GLint *)value); } else { return -1; } @@ -4065,8 +4114,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) #define NOT_AN_OPENGL_WINDOW "The specified window isn't an OpenGL window" -SDL_GLContext -SDL_GL_CreateContext(SDL_Window * window) +SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) { SDL_GLContext ctx = NULL; CHECK_WINDOW_MAGIC(window, NULL); @@ -4088,8 +4136,7 @@ SDL_GL_CreateContext(SDL_Window * window) return ctx; } -int -SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) +int SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) { int retval; @@ -4098,12 +4145,12 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) } if (window == SDL_GL_GetCurrentWindow() && - ctx == SDL_GL_GetCurrentContext()) { + context == SDL_GL_GetCurrentContext()) { /* We're already current. */ return 0; } - if (!ctx) { + if (!context) { window = NULL; } else if (window) { CHECK_WINDOW_MAGIC(window, -1); @@ -4115,18 +4162,17 @@ SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext ctx) return SDL_SetError("Use of OpenGL without a window is not supported on this platform"); } - retval = _this->GL_MakeCurrent(_this, window, ctx); + retval = _this->GL_MakeCurrent(_this, window, context); if (retval == 0) { _this->current_glwin = window; - _this->current_glctx = ctx; + _this->current_glctx = context; SDL_TLSSet(_this->current_glwin_tls, window, NULL); - SDL_TLSSet(_this->current_glctx_tls, ctx, NULL); + SDL_TLSSet(_this->current_glctx_tls, context, NULL); } return retval; } -SDL_Window * -SDL_GL_GetCurrentWindow(void) +SDL_Window *SDL_GL_GetCurrentWindow(void) { if (!_this) { SDL_UninitializedVideo(); @@ -4135,8 +4181,7 @@ SDL_GL_GetCurrentWindow(void) return (SDL_Window *)SDL_TLSGet(_this->current_glwin_tls); } -SDL_GLContext -SDL_GL_GetCurrentContext(void) +SDL_GLContext SDL_GL_GetCurrentContext(void) { if (!_this) { SDL_UninitializedVideo(); @@ -4147,7 +4192,7 @@ SDL_GL_GetCurrentContext(void) void SDL_GL_GetDrawableSize(SDL_Window * window, int *w, int *h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (_this->GL_GetDrawableSize) { _this->GL_GetDrawableSize(_this, window, w, h); @@ -4156,8 +4201,7 @@ void SDL_GL_GetDrawableSize(SDL_Window * window, int *w, int *h) } } -int -SDL_GL_SetSwapInterval(int interval) +int SDL_GL_SetSwapInterval(int interval) { if (!_this) { return SDL_UninitializedVideo(); @@ -4170,8 +4214,7 @@ SDL_GL_SetSwapInterval(int interval) } } -int -SDL_GL_GetSwapInterval(void) +int SDL_GL_GetSwapInterval(void) { if (!_this) { return 0; @@ -4184,8 +4227,7 @@ SDL_GL_GetSwapInterval(void) } } -int -SDL_GL_SwapWindowWithResult(SDL_Window * window) +int SDL_GL_SwapWindowWithResult(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, -1); @@ -4200,14 +4242,12 @@ SDL_GL_SwapWindowWithResult(SDL_Window * window) return _this->GL_SwapWindow(_this, window); } -void -SDL_GL_SwapWindow(SDL_Window * window) +void SDL_GL_SwapWindow(SDL_Window *window) { SDL_GL_SwapWindowWithResult(window); } -void -SDL_GL_DeleteContext(SDL_GLContext context) +void SDL_GL_DeleteContext(SDL_GLContext context) { if (!_this || !context) { return; @@ -4220,18 +4260,17 @@ SDL_GL_DeleteContext(SDL_GLContext context) _this->GL_DeleteContext(_this, context); } -#if 0 /* FIXME */ +#if 0 /* FIXME */ /* * Utility function used by SDL_WM_SetIcon(); flags & 1 for color key, flags * & 2 for alpha channel. */ -static void -CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags) +static void CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags) { int x, y; Uint32 colorkey; #define SET_MASKBIT(icon, x, y, mask) \ - mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8))) + mask[(y * ((icon->w + 7) / 8)) + (x / 8)] &= ~(0x01 << (7 - (x % 8))) colorkey = icon->format->colorkey; switch (icon->format->BytesPerPixel) { @@ -4290,8 +4329,7 @@ CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags) /* * Sets the window manager icon for the display window. */ -void -SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask) +void SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask) { if (icon && _this->SetIcon) { /* Generate a mask if necessary, and create the icon! */ @@ -4319,8 +4357,7 @@ SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask) } #endif -SDL_bool -SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info) { CHECK_WINDOW_MAGIC(window, SDL_FALSE); @@ -4337,8 +4374,7 @@ SDL_GetWindowWMInfo(SDL_Window * window, struct SDL_SysWMinfo *info) return (_this->GetWindowWMInfo(_this, window, info)); } -void -SDL_StartTextInput(void) +void SDL_StartTextInput(void) { SDL_Window *window; @@ -4347,9 +4383,11 @@ SDL_StartTextInput(void) (void)SDL_EventState(SDL_TEXTEDITING, SDL_ENABLE); /* Then show the on-screen keyboard, if any */ - window = SDL_GetFocusWindow(); - if (window && _this && _this->ShowScreenKeyboard) { - _this->ShowScreenKeyboard(_this, window); + if (SDL_GetHintBoolean(SDL_HINT_ENABLE_SCREEN_KEYBOARD, SDL_TRUE)) { + window = SDL_GetFocusWindow(); + if (window && _this && _this->ShowScreenKeyboard) { + _this->ShowScreenKeyboard(_this, window); + } } /* Finally start the text input system */ @@ -4358,16 +4396,14 @@ SDL_StartTextInput(void) } } -void -SDL_ClearComposition(void) +void SDL_ClearComposition(void) { if (_this && _this->ClearComposition) { _this->ClearComposition(_this); } } -SDL_bool -SDL_IsTextInputShown(void) +SDL_bool SDL_IsTextInputShown(void) { if (_this && _this->IsTextInputShown) { return _this->IsTextInputShown(_this); @@ -4376,14 +4412,12 @@ SDL_IsTextInputShown(void) return SDL_FALSE; } -SDL_bool -SDL_IsTextInputActive(void) +SDL_bool SDL_IsTextInputActive(void) { - return (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE); + return SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE; } -void -SDL_StopTextInput(void) +void SDL_StopTextInput(void) { SDL_Window *window; @@ -4393,9 +4427,11 @@ SDL_StopTextInput(void) } /* Hide the on-screen keyboard, if any */ - window = SDL_GetFocusWindow(); - if (window && _this && _this->HideScreenKeyboard) { - _this->HideScreenKeyboard(_this, window); + if (SDL_GetHintBoolean(SDL_HINT_ENABLE_SCREEN_KEYBOARD, SDL_TRUE)) { + window = SDL_GetFocusWindow(); + if (window && _this && _this->HideScreenKeyboard) { + _this->HideScreenKeyboard(_this, window); + } } /* Finally disable text events */ @@ -4403,16 +4439,14 @@ SDL_StopTextInput(void) (void)SDL_EventState(SDL_TEXTEDITING, SDL_DISABLE); } -void -SDL_SetTextInputRect(const SDL_Rect *rect) +void SDL_SetTextInputRect(const SDL_Rect *rect) { if (_this && _this->SetTextInputRect) { _this->SetTextInputRect(_this, rect); } } -SDL_bool -SDL_HasScreenKeyboardSupport(void) +SDL_bool SDL_HasScreenKeyboardSupport(void) { if (_this && _this->HasScreenKeyboardSupport) { return _this->HasScreenKeyboardSupport(_this); @@ -4420,8 +4454,7 @@ SDL_HasScreenKeyboardSupport(void) return SDL_FALSE; } -SDL_bool -SDL_IsScreenKeyboardShown(SDL_Window *window) +SDL_bool SDL_IsScreenKeyboardShown(SDL_Window *window) { if (window && _this && _this->IsScreenKeyboardShown) { return _this->IsScreenKeyboardShown(_this, window); @@ -4429,67 +4462,12 @@ SDL_IsScreenKeyboardShown(SDL_Window *window) return SDL_FALSE; } -int -SDL_GetMessageBoxCount(void) +int SDL_GetMessageBoxCount(void) { return SDL_AtomicGet(&SDL_messagebox_count); } -#if SDL_VIDEO_DRIVER_ANDROID -#include "android/SDL_androidmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_WINDOWS -#include "windows/SDL_windowsmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_WINRT -#include "winrt/SDL_winrtmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_COCOA -#include "cocoa/SDL_cocoamessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_UIKIT -#include "uikit/SDL_uikitmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_X11 -#include "x11/SDL_x11messagebox.h" -#endif -#if SDL_VIDEO_DRIVER_WAYLAND -#include "wayland/SDL_waylandmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_HAIKU -#include "haiku/SDL_bmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_OS2 -#include "os2/SDL_os2messagebox.h" -#endif -#if SDL_VIDEO_DRIVER_RISCOS -#include "riscos/SDL_riscosmessagebox.h" -#endif -#if SDL_VIDEO_DRIVER_VITA -#include "vita/SDL_vitamessagebox.h" -#endif - -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT || SDL_VIDEO_DRIVER_COCOA || SDL_VIDEO_DRIVER_UIKIT || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_OS2 || SDL_VIDEO_DRIVER_RISCOS -static SDL_bool SDL_MessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype) -{ - SDL_SysWMinfo info; - SDL_Window *window = messageboxdata->window; - - if (!window) { - return SDL_TRUE; - } - - SDL_VERSION(&info.version); - if (!SDL_GetWindowWMInfo(window, &info)) { - return SDL_TRUE; - } else { - return (info.subsystem == drivertype); - } -} -#endif - -int -SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { int dummybutton; int retval = -1; @@ -4518,92 +4496,50 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) } SDL_memcpy(&mbdata, messageboxdata, sizeof(*messageboxdata)); - if (!mbdata.title) mbdata.title = ""; - if (!mbdata.message) mbdata.message = ""; + if (!mbdata.title) { + mbdata.title = ""; + } + if (!mbdata.message) { + mbdata.message = ""; + } messageboxdata = &mbdata; SDL_ClearError(); if (_this && _this->ShowMessageBox) { retval = _this->ShowMessageBox(_this, messageboxdata, buttonid); - } + } else { + /* It's completely fine to call this function before video is initialized */ + const char *driver_name = SDL_GetHint(SDL_HINT_VIDEODRIVER); + int i; + if (driver_name && *driver_name != 0) { + const char *driver_attempt = driver_name; + while (driver_attempt && (*driver_attempt != 0) && (retval == -1)) { + const char *driver_attempt_end = SDL_strchr(driver_attempt, ','); + size_t driver_attempt_len = (driver_attempt_end) ? (driver_attempt_end - driver_attempt) + : SDL_strlen(driver_attempt); + for (i = 0; bootstrap[i]; ++i) { + if (bootstrap[i]->ShowMessageBox && (driver_attempt_len == SDL_strlen(bootstrap[i]->name)) && + (SDL_strncasecmp(bootstrap[i]->name, driver_attempt, driver_attempt_len) == 0)) { + if (bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + } + break; + } + } - /* It's completely fine to call this function before video is initialized */ -#if SDL_VIDEO_DRIVER_ANDROID - if (retval == -1 && - Android_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WINDOWS) && - WIN_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_WINRT - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WINRT) && - WINRT_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_COCOA - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_COCOA) && - Cocoa_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_UIKIT - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_UIKIT) && - UIKit_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_X11 - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_X11) && - X11_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_WAYLAND - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_WAYLAND) && - Wayland_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_HAIKU - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_HAIKU) && - HAIKU_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_OS2 - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_OS2) && - OS2_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_RISCOS - if (retval == -1 && - SDL_MessageboxValidForDriver(messageboxdata, SDL_SYSWM_RISCOS) && - RISCOS_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; - } -#endif -#if SDL_VIDEO_DRIVER_VITA - if (retval == -1 && - VITA_ShowMessageBox(messageboxdata, buttonid) == 0) { - retval = 0; + driver_attempt = (driver_attempt_end) ? (driver_attempt_end + 1) : NULL; + } + } else { + for (i = 0; bootstrap[i]; ++i) { + if (bootstrap[i]->ShowMessageBox && bootstrap[i]->ShowMessageBox(messageboxdata, buttonid) == 0) { + retval = 0; + break; + } + } + } } -#endif + if (retval == -1) { const char *error = SDL_GetError(); @@ -4625,19 +4561,40 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) return retval; } -int -SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) +int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window) { #ifdef __EMSCRIPTEN__ /* !!! FIXME: propose a browser API for this, get this #ifdef out of here? */ /* Web browsers don't (currently) have an API for a custom message box that can block, but for the most common case (SDL_ShowSimpleMessageBox), we can use the standard Javascript alert() function. */ - if (!title) title = ""; - if (!message) message = ""; - EM_ASM_({ + if (!title) { + title = ""; + } + if (!message) { + message = ""; + } + EM_ASM({ alert(UTF8ToString($0) + "\n\n" + UTF8ToString($1)); - }, title, message); + }, + title, message); + return 0; +#elif defined(__3DS__) + errorConf errCnf; + bool hasGpuRight; + + /* If the video subsystem has not been initialised, set up graphics temporarily */ + hasGpuRight = gspHasGpuRight(); + if (!hasGpuRight) + gfxInitDefault(); + + errorInit(&errCnf, ERROR_TEXT_WORD_WRAP, CFG_LANGUAGE_EN); + errorText(&errCnf, message); + errorDisp(&errCnf); + + if (!hasGpuRight) + gfxExit(); + return 0; #else SDL_MessageBoxData data; @@ -4660,14 +4617,12 @@ SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, S #endif } -SDL_bool -SDL_ShouldAllowTopmost(void) +SDL_bool SDL_ShouldAllowTopmost(void) { return SDL_GetHintBoolean(SDL_HINT_ALLOW_TOPMOST, SDL_TRUE); } -int -SDL_SetWindowHitTest(SDL_Window * window, SDL_HitTest callback, void *userdata) +int SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data) { CHECK_WINDOW_MAGIC(window, -1); @@ -4678,21 +4633,19 @@ SDL_SetWindowHitTest(SDL_Window * window, SDL_HitTest callback, void *userdata) } window->hit_test = callback; - window->hit_test_data = userdata; + window->hit_test_data = callback_data; return 0; } -float -SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vinches) +float SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vinches) { float den2 = hinches * hinches + vinches * vinches; if (den2 <= 0.0f) { return 0.0f; } - return (float)(SDL_sqrt((double)hpix * (double)hpix + (double)vpix * (double)vpix) / - SDL_sqrt((double)den2)); + return (float)(SDL_sqrt((double)hpix * (double)hpix + (double)vpix * (double)vpix) / SDL_sqrt((double)den2)); } /* @@ -4712,7 +4665,7 @@ void SDL_OnApplicationWillResignActive(void) { if (_this) { SDL_Window *window; - for (window = _this->windows; window != NULL; window = window->next) { + for (window = _this->windows; window; window = window->next) { SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); } @@ -4736,7 +4689,7 @@ void SDL_OnApplicationDidBecomeActive(void) if (_this) { SDL_Window *window; - for (window = _this->windows; window != NULL; window = window->next) { + for (window = _this->windows; window; window = window->next) { SDL_SendWindowEvent(window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); } @@ -4803,8 +4756,7 @@ SDL_bool SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned *count, c if (window) { CHECK_WINDOW_MAGIC(window, SDL_FALSE); - if (!(window->flags & SDL_WINDOW_VULKAN)) - { + if (!(window->flags & SDL_WINDOW_VULKAN)) { SDL_SetError(NOT_A_VULKAN_WINDOW); return SDL_FALSE; } @@ -4842,9 +4794,9 @@ SDL_bool SDL_Vulkan_CreateSurface(SDL_Window *window, return _this->Vulkan_CreateSurface(_this, window, instance, surface); } -void SDL_Vulkan_GetDrawableSize(SDL_Window * window, int *w, int *h) +void SDL_Vulkan_GetDrawableSize(SDL_Window *window, int *w, int *h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (_this->Vulkan_GetDrawableSize) { _this->Vulkan_GetDrawableSize(_this, window, w, h); @@ -4853,8 +4805,7 @@ void SDL_Vulkan_GetDrawableSize(SDL_Window * window, int *w, int *h) } } -SDL_MetalView -SDL_Metal_CreateView(SDL_Window * window) +SDL_MetalView SDL_Metal_CreateView(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, NULL); @@ -4874,16 +4825,14 @@ SDL_Metal_CreateView(SDL_Window * window) return _this->Metal_CreateView(_this, window); } -void -SDL_Metal_DestroyView(SDL_MetalView view) +void SDL_Metal_DestroyView(SDL_MetalView view) { if (_this && view && _this->Metal_DestroyView) { _this->Metal_DestroyView(_this, view); } } -void * -SDL_Metal_GetLayer(SDL_MetalView view) +void *SDL_Metal_GetLayer(SDL_MetalView view) { if (_this && _this->Metal_GetLayer) { if (view) { @@ -4898,9 +4847,9 @@ SDL_Metal_GetLayer(SDL_MetalView view) } } -void SDL_Metal_GetDrawableSize(SDL_Window * window, int *w, int *h) +void SDL_Metal_GetDrawableSize(SDL_Window *window, int *w, int *h) { - CHECK_WINDOW_MAGIC(window,); + CHECK_WINDOW_MAGIC(window, ); if (_this->Metal_GetDrawableSize) { _this->Metal_GetDrawableSize(_this, window, w, h); @@ -4909,4 +4858,93 @@ void SDL_Metal_GetDrawableSize(SDL_Window * window, int *w, int *h) } } +#if defined(SDL_VIDEO_DRIVER_X11) || defined(SDL_VIDEO_DRIVER_WAYLAND) || defined(SDL_VIDEO_DRIVER_EMSCRIPTEN) +const char *SDL_GetCSSCursorName(SDL_SystemCursor id, const char **fallback_name) +{ + /* Reference: https://www.w3.org/TR/css-ui-4/#cursor */ + /* Also in: https://www.freedesktop.org/wiki/Specifications/cursor-spec/ */ + switch (id) { + case SDL_SYSTEM_CURSOR_ARROW: + return "default"; + + case SDL_SYSTEM_CURSOR_IBEAM: + return "text"; + + case SDL_SYSTEM_CURSOR_WAIT: + return "wait"; + + case SDL_SYSTEM_CURSOR_CROSSHAIR: + return "crosshair"; + + case SDL_SYSTEM_CURSOR_WAITARROW: + return "progress"; + + case SDL_SYSTEM_CURSOR_SIZENWSE: + if (fallback_name) { + /* only a single arrow */ + *fallback_name = "nw-resize"; + } + return "nwse-resize"; + + case SDL_SYSTEM_CURSOR_SIZENESW: + if (fallback_name) { + /* only a single arrow */ + *fallback_name = "ne-resize"; + } + return "nesw-resize"; + + case SDL_SYSTEM_CURSOR_SIZEWE: + if (fallback_name) { + *fallback_name = "col-resize"; + } + return "ew-resize"; + + case SDL_SYSTEM_CURSOR_SIZENS: + if (fallback_name) { + *fallback_name = "row-resize"; + } + return "ns-resize"; + + case SDL_SYSTEM_CURSOR_SIZEALL: + return "all-scroll"; + + case SDL_SYSTEM_CURSOR_NO: + return "not-allowed"; + + case SDL_SYSTEM_CURSOR_HAND: + return "pointer"; + +#if 0 + case SDL_SYSTEM_CURSOR_WINDOW_TOPLEFT: + return "nw-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_TOP: + return "n-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_TOPRIGHT: + return "ne-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_RIGHT: + return "e-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMRIGHT: + return "se-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOM: + return "s-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_BOTTOMLEFT: + return "sw-resize"; + + case SDL_SYSTEM_CURSOR_WINDOW_LEFT: + return "w-resize"; +#endif + + default: + SDL_assert(0); + return "default"; + } +} +#endif + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/SDL_vulkan_internal.h b/src/video/SDL_vulkan_internal.h index ae9b962209f19..ac14f9a354904 100644 --- a/src/video/SDL_vulkan_internal.h +++ b/src/video/SDL_vulkan_internal.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,34 +25,34 @@ #include "SDL_stdinc.h" -#if SDL_VIDEO_VULKAN -#if SDL_LOADSO_DISABLED || SDL_LOADSO_DUMMY +#ifdef SDL_VIDEO_VULKAN +#if defined(SDL_LOADSO_DISABLED) || defined(SDL_LOADSO_DUMMY) #error You should not be here. #endif -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #define VK_USE_PLATFORM_ANDROID_KHR #endif -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #define VK_USE_PLATFORM_METAL_EXT #define VK_USE_PLATFORM_MACOS_MVK #endif -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #define VK_USE_PLATFORM_DIRECTFB_EXT #endif -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define VK_USE_PLATFORM_METAL_EXT #define VK_USE_PLATFORM_IOS_MVK #endif -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #define VK_USE_PLATFORM_WAYLAND_KHR #include "wayland/SDL_waylanddyn.h" #endif -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS #define VK_USE_PLATFORM_WIN32_KHR #include "../core/windows/SDL_windows.h" #endif -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #define VK_USE_PLATFORM_XLIB_KHR #define VK_USE_PLATFORM_XCB_KHR #endif @@ -62,7 +62,6 @@ #include "SDL_vulkan.h" - extern const char *SDL_Vulkan_GetResultString(VkResult result); extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList( @@ -88,8 +87,8 @@ extern SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr, /* No SDL Vulkan support, just include the header for typedefs */ #include "SDL_vulkan.h" -typedef void (*PFN_vkGetInstanceProcAddr) (void); -typedef int (*PFN_vkEnumerateInstanceExtensionProperties) (void); +typedef void (*PFN_vkGetInstanceProcAddr)(void); +typedef int (*PFN_vkEnumerateInstanceExtensionProperties)(void); #endif /* SDL_VIDEO_VULKAN */ diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c index 33761a5918a63..1c796e7ba9430 100644 --- a/src/video/SDL_vulkan_utils.c +++ b/src/video/SDL_vulkan_utils.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,93 +23,93 @@ #include "SDL_vulkan_internal.h" #include "SDL_error.h" -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN const char *SDL_Vulkan_GetResultString(VkResult result) { switch ((int)result) { - case VK_SUCCESS: - return "VK_SUCCESS"; - case VK_NOT_READY: - return "VK_NOT_READY"; - case VK_TIMEOUT: - return "VK_TIMEOUT"; - case VK_EVENT_SET: - return "VK_EVENT_SET"; - case VK_EVENT_RESET: - return "VK_EVENT_RESET"; - case VK_INCOMPLETE: - return "VK_INCOMPLETE"; - case VK_ERROR_OUT_OF_HOST_MEMORY: - return "VK_ERROR_OUT_OF_HOST_MEMORY"; - case VK_ERROR_OUT_OF_DEVICE_MEMORY: - return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; - case VK_ERROR_INITIALIZATION_FAILED: - return "VK_ERROR_INITIALIZATION_FAILED"; - case VK_ERROR_DEVICE_LOST: - return "VK_ERROR_DEVICE_LOST"; - case VK_ERROR_MEMORY_MAP_FAILED: - return "VK_ERROR_MEMORY_MAP_FAILED"; - case VK_ERROR_LAYER_NOT_PRESENT: - return "VK_ERROR_LAYER_NOT_PRESENT"; - case VK_ERROR_EXTENSION_NOT_PRESENT: - return "VK_ERROR_EXTENSION_NOT_PRESENT"; - case VK_ERROR_FEATURE_NOT_PRESENT: - return "VK_ERROR_FEATURE_NOT_PRESENT"; - case VK_ERROR_INCOMPATIBLE_DRIVER: - return "VK_ERROR_INCOMPATIBLE_DRIVER"; - case VK_ERROR_TOO_MANY_OBJECTS: - return "VK_ERROR_TOO_MANY_OBJECTS"; - case VK_ERROR_FORMAT_NOT_SUPPORTED: - return "VK_ERROR_FORMAT_NOT_SUPPORTED"; - case VK_ERROR_FRAGMENTED_POOL: - return "VK_ERROR_FRAGMENTED_POOL"; - case VK_ERROR_UNKNOWN: - return "VK_ERROR_UNKNOWN"; - case VK_ERROR_OUT_OF_POOL_MEMORY: - return "VK_ERROR_OUT_OF_POOL_MEMORY"; - case VK_ERROR_INVALID_EXTERNAL_HANDLE: - return "VK_ERROR_INVALID_EXTERNAL_HANDLE"; - case VK_ERROR_FRAGMENTATION: - return "VK_ERROR_FRAGMENTATION"; - case VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS: - return "VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"; - case VK_ERROR_SURFACE_LOST_KHR: - return "VK_ERROR_SURFACE_LOST_KHR"; - case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR: - return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"; - case VK_SUBOPTIMAL_KHR: - return "VK_SUBOPTIMAL_KHR"; - case VK_ERROR_OUT_OF_DATE_KHR: - return "VK_ERROR_OUT_OF_DATE_KHR"; - case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR: - return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR"; - case VK_ERROR_VALIDATION_FAILED_EXT: - return "VK_ERROR_VALIDATION_FAILED_EXT"; - case VK_ERROR_INVALID_SHADER_NV: - return "VK_ERROR_INVALID_SHADER_NV"; + case VK_SUCCESS: + return "VK_SUCCESS"; + case VK_NOT_READY: + return "VK_NOT_READY"; + case VK_TIMEOUT: + return "VK_TIMEOUT"; + case VK_EVENT_SET: + return "VK_EVENT_SET"; + case VK_EVENT_RESET: + return "VK_EVENT_RESET"; + case VK_INCOMPLETE: + return "VK_INCOMPLETE"; + case VK_ERROR_OUT_OF_HOST_MEMORY: + return "VK_ERROR_OUT_OF_HOST_MEMORY"; + case VK_ERROR_OUT_OF_DEVICE_MEMORY: + return "VK_ERROR_OUT_OF_DEVICE_MEMORY"; + case VK_ERROR_INITIALIZATION_FAILED: + return "VK_ERROR_INITIALIZATION_FAILED"; + case VK_ERROR_DEVICE_LOST: + return "VK_ERROR_DEVICE_LOST"; + case VK_ERROR_MEMORY_MAP_FAILED: + return "VK_ERROR_MEMORY_MAP_FAILED"; + case VK_ERROR_LAYER_NOT_PRESENT: + return "VK_ERROR_LAYER_NOT_PRESENT"; + case VK_ERROR_EXTENSION_NOT_PRESENT: + return "VK_ERROR_EXTENSION_NOT_PRESENT"; + case VK_ERROR_FEATURE_NOT_PRESENT: + return "VK_ERROR_FEATURE_NOT_PRESENT"; + case VK_ERROR_INCOMPATIBLE_DRIVER: + return "VK_ERROR_INCOMPATIBLE_DRIVER"; + case VK_ERROR_TOO_MANY_OBJECTS: + return "VK_ERROR_TOO_MANY_OBJECTS"; + case VK_ERROR_FORMAT_NOT_SUPPORTED: + return "VK_ERROR_FORMAT_NOT_SUPPORTED"; + case VK_ERROR_FRAGMENTED_POOL: + return "VK_ERROR_FRAGMENTED_POOL"; + case VK_ERROR_UNKNOWN: + return "VK_ERROR_UNKNOWN"; + case VK_ERROR_OUT_OF_POOL_MEMORY: + return "VK_ERROR_OUT_OF_POOL_MEMORY"; + case VK_ERROR_INVALID_EXTERNAL_HANDLE: + return "VK_ERROR_INVALID_EXTERNAL_HANDLE"; + case VK_ERROR_FRAGMENTATION: + return "VK_ERROR_FRAGMENTATION"; + case VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS: + return "VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS"; + case VK_ERROR_SURFACE_LOST_KHR: + return "VK_ERROR_SURFACE_LOST_KHR"; + case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR: + return "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR"; + case VK_SUBOPTIMAL_KHR: + return "VK_SUBOPTIMAL_KHR"; + case VK_ERROR_OUT_OF_DATE_KHR: + return "VK_ERROR_OUT_OF_DATE_KHR"; + case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR: + return "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR"; + case VK_ERROR_VALIDATION_FAILED_EXT: + return "VK_ERROR_VALIDATION_FAILED_EXT"; + case VK_ERROR_INVALID_SHADER_NV: + return "VK_ERROR_INVALID_SHADER_NV"; #if VK_HEADER_VERSION >= 135 && VK_HEADER_VERSION < 162 - case VK_ERROR_INCOMPATIBLE_VERSION_KHR: - return "VK_ERROR_INCOMPATIBLE_VERSION_KHR"; + case VK_ERROR_INCOMPATIBLE_VERSION_KHR: + return "VK_ERROR_INCOMPATIBLE_VERSION_KHR"; #endif - case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT: - return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"; - case VK_ERROR_NOT_PERMITTED_EXT: - return "VK_ERROR_NOT_PERMITTED_EXT"; - case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT: - return "VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT"; - case VK_THREAD_IDLE_KHR: - return "VK_THREAD_IDLE_KHR"; - case VK_THREAD_DONE_KHR: - return "VK_THREAD_DONE_KHR"; - case VK_OPERATION_DEFERRED_KHR: - return "VK_OPERATION_DEFERRED_KHR"; - case VK_OPERATION_NOT_DEFERRED_KHR: - return "VK_OPERATION_NOT_DEFERRED_KHR"; - case VK_PIPELINE_COMPILE_REQUIRED_EXT: - return "VK_PIPELINE_COMPILE_REQUIRED_EXT"; - default: - break; + case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT: + return "VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT"; + case VK_ERROR_NOT_PERMITTED_EXT: + return "VK_ERROR_NOT_PERMITTED_EXT"; + case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT: + return "VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT"; + case VK_THREAD_IDLE_KHR: + return "VK_THREAD_IDLE_KHR"; + case VK_THREAD_DONE_KHR: + return "VK_THREAD_DONE_KHR"; + case VK_OPERATION_DEFERRED_KHR: + return "VK_OPERATION_DEFERRED_KHR"; + case VK_OPERATION_NOT_DEFERRED_KHR: + return "VK_OPERATION_NOT_DEFERRED_KHR"; + case VK_PIPELINE_COMPILE_REQUIRED_EXT: + return "VK_PIPELINE_COMPILE_REQUIRED_EXT"; + default: + break; } if (result < 0) { return "VK_ERROR_"; @@ -198,12 +198,12 @@ static const VkDisplayPlaneAlphaFlagBitsKHR alphaModes[4] = { }; SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, - VkInstance instance, - VkSurfaceKHR *surface) + VkInstance instance, + VkSurfaceKHR *surface) { PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)vkGetInstanceProcAddr_; -#define VULKAN_INSTANCE_FUNCTION(name) \ +#define VULKAN_INSTANCE_FUNCTION(name) \ PFN_##name name = (PFN_##name)vkGetInstanceProcAddr((VkInstance)instance, #name) VULKAN_INSTANCE_FUNCTION(vkEnumeratePhysicalDevices); VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceDisplayPropertiesKHR); @@ -222,17 +222,17 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, int displayId = 0; /* Counting from physical device 0, display 0 */ if (!vkEnumeratePhysicalDevices || - !vkGetPhysicalDeviceDisplayPropertiesKHR || - !vkGetDisplayModePropertiesKHR || - !vkGetPhysicalDeviceDisplayPlanePropertiesKHR || - !vkGetDisplayPlaneCapabilitiesKHR || - !vkGetDisplayPlaneSupportedDisplaysKHR || - !vkCreateDisplayPlaneSurfaceKHR) { + !vkGetPhysicalDeviceDisplayPropertiesKHR || + !vkGetDisplayModePropertiesKHR || + !vkGetPhysicalDeviceDisplayPlanePropertiesKHR || + !vkGetDisplayPlaneCapabilitiesKHR || + !vkGetDisplayPlaneSupportedDisplaysKHR || + !vkCreateDisplayPlaneSurfaceKHR) { SDL_SetError(VK_KHR_DISPLAY_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); goto error; } - - if ((chosenDisplayId = SDL_getenv("SDL_VULKAN_DISPLAY")) != NULL) { + chosenDisplayId = SDL_getenv("SDL_VULKAN_DISPLAY"); + if (chosenDisplayId) { displayId = SDL_atoi(chosenDisplayId); } @@ -283,9 +283,9 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, continue; } SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of display properties for device %u: %u", - physicalDeviceIndex, displayPropertiesCount); + physicalDeviceIndex, displayPropertiesCount); - if (displayId < 0 || (uint32_t) displayId >= displayPropertiesCount) { + if (displayId < 0 || (uint32_t)displayId >= displayPropertiesCount) { /* Display id specified was higher than number of available displays, move to next physical device. */ displayId -= displayPropertiesCount; continue; @@ -307,15 +307,14 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, display = displayProperties[displayId].display; extent = displayProperties[displayId].physicalResolution; SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Display: %s Native resolution: %ux%u", - displayProperties[displayId].displayName, extent.width, extent.height); + displayProperties[displayId].displayName, extent.width, extent.height); SDL_free(displayProperties); displayProperties = NULL; /* Get display mode properties for the chosen display */ result = vkGetDisplayModePropertiesKHR(physicalDevice, display, &displayModePropertiesCount, NULL); - if (result != VK_SUCCESS || displayModePropertiesCount == 0) - { + if (result != VK_SUCCESS || displayModePropertiesCount == 0) { SDL_SetError("Error enumerating display modes"); goto error; } @@ -353,9 +352,9 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, SDL_zero(createInfo); createInfo.displayMode = displayModeProperties[bestMatchIndex].displayMode; SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Matching mode %ux%u with refresh rate %u", - displayModeProperties[bestMatchIndex].parameters.visibleRegion.width, - displayModeProperties[bestMatchIndex].parameters.visibleRegion.height, - refreshRate); + displayModeProperties[bestMatchIndex].parameters.visibleRegion.width, + displayModeProperties[bestMatchIndex].parameters.visibleRegion.height, + refreshRate); SDL_free(displayModeProperties); displayModeProperties = NULL; @@ -394,7 +393,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, /* Check supported displays for this plane. */ result = vkGetDisplayPlaneSupportedDisplaysKHR(physicalDevice, i, &planeSupportedDisplaysCount, NULL); if (result != VK_SUCCESS || planeSupportedDisplaysCount == 0) { - continue; /* No supported displays, on to next plane. */ + continue; /* No supported displays, on to next plane. */ } SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Number of supported displays for plane %u: %u", i, planeSupportedDisplaysCount); @@ -414,8 +413,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, goto error; } - for (j = 0; j < planeSupportedDisplaysCount && planeSupportedDisplays[j] != display; ++j) - { + for (j = 0; j < planeSupportedDisplaysCount && planeSupportedDisplays[j] != display; ++j) { } SDL_free(planeSupportedDisplays); @@ -438,8 +436,8 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, extent.width <= planeCaps.maxDstExtent.width && extent.height <= planeCaps.maxDstExtent.height) { /* If it does, choose this plane. */ SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Choosing plane %d, minimum extent %dx%d maximum extent %dx%d", i, - planeCaps.minDstExtent.width, planeCaps.minDstExtent.height, - planeCaps.maxDstExtent.width, planeCaps.maxDstExtent.height); + planeCaps.minDstExtent.width, planeCaps.minDstExtent.height, + planeCaps.maxDstExtent.width, planeCaps.maxDstExtent.height); planeIndex = i; break; } diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index 38cf9e733e4fb..3334b752450fa 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,18 +27,20 @@ #include "yuv2rgb/yuv_rgb.h" -#define SDL_YUV_SD_THRESHOLD 576 - +#define SDL_YUV_SD_THRESHOLD 576 static SDL_YUV_CONVERSION_MODE SDL_YUV_ConversionMode = SDL_YUV_CONVERSION_BT601; +#if SDL_HAVE_YUV +static SDL_bool IsPlanar2x2Format(Uint32 format); +#endif void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode) { SDL_YUV_ConversionMode = mode; } -SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode() +SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void) { return SDL_YUV_ConversionMode; } @@ -56,6 +58,133 @@ SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int hei return mode; } +/* + * Calculate YUV size and pitch. Check for overflow. + * Output 'pitch' that can be used with SDL_ConvertPixels() + * + * return 0 on success, -1 on error + */ +int SDL_CalculateYUVSize(Uint32 format, int w, int h, size_t *size, int *pitch) +{ +#if SDL_HAVE_YUV + int sz_plane = 0, sz_plane_chroma = 0, sz_plane_packed = 0; + + if (IsPlanar2x2Format(format) == SDL_TRUE) { + { + /* sz_plane == w * h; */ + size_t s1; + if (SDL_size_mul_overflow(w, h, &s1) < 0) { + return -1; + } + sz_plane = (int) s1; + } + + { + /* sz_plane_chroma == ((w + 1) / 2) * ((h + 1) / 2); */ + size_t s1, s2, s3; + if (SDL_size_add_overflow(w, 1, &s1) < 0) { + return -1; + } + s1 = s1 / 2; + if (SDL_size_add_overflow(h, 1, &s2) < 0) { + return -1; + } + s2 = s2 / 2; + if (SDL_size_mul_overflow(s1, s2, &s3) < 0) { + return -1; + } + sz_plane_chroma = (int) s3; + } + } else { + /* sz_plane_packed == ((w + 1) / 2) * h; */ + size_t s1, s2; + if (SDL_size_add_overflow(w, 1, &s1) < 0) { + return -1; + } + s1 = s1 / 2; + if (SDL_size_mul_overflow(s1, h, &s2) < 0) { + return -1; + } + sz_plane_packed = (int) s2; + } + + switch (format) { + case SDL_PIXELFORMAT_YV12: /**< Planar mode: Y + V + U (3 planes) */ + case SDL_PIXELFORMAT_IYUV: /**< Planar mode: Y + U + V (3 planes) */ + + if (pitch) { + *pitch = w; + } + + if (size) { + /* dst_size == sz_plane + sz_plane_chroma + sz_plane_chroma; */ + size_t s1, s2; + if (SDL_size_add_overflow(sz_plane, sz_plane_chroma, &s1) < 0) { + return -1; + } + if (SDL_size_add_overflow(s1, sz_plane_chroma, &s2) < 0) { + return -1; + } + *size = (int)s2; + } + break; + + case SDL_PIXELFORMAT_YUY2: /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + case SDL_PIXELFORMAT_UYVY: /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + case SDL_PIXELFORMAT_YVYU: /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + + if (pitch) { + /* pitch == ((w + 1) / 2) * 4; */ + size_t p1, p2; + if (SDL_size_add_overflow(w, 1, &p1) < 0) { + return -1; + } + p1 = p1 / 2; + if (SDL_size_mul_overflow(p1, 4, &p2) < 0) { + return -1; + } + *pitch = (int) p2; + } + + if (size) { + /* dst_size == 4 * sz_plane_packed; */ + size_t s1; + if (SDL_size_mul_overflow(sz_plane_packed, 4, &s1) < 0) { + return -1; + } + *size = (int) s1; + } + break; + + case SDL_PIXELFORMAT_NV12: /**< Planar mode: Y + U/V interleaved (2 planes) */ + case SDL_PIXELFORMAT_NV21: /**< Planar mode: Y + V/U interleaved (2 planes) */ + if (pitch) { + *pitch = w; + } + + if (size) { + /* dst_size == sz_plane + sz_plane_chroma + sz_plane_chroma; */ + size_t s1, s2; + if (SDL_size_add_overflow(sz_plane, sz_plane_chroma, &s1) < 0) { + return -1; + } + if (SDL_size_add_overflow(s1, sz_plane_chroma, &s2) < 0) { + return -1; + } + *size = (int) s2; + } + break; + + default: + return -1; + } + + return 0; +#else + return -1; +#endif +} + #if SDL_HAVE_YUV static int GetYUVConversionType(int width, int height, YCbCrType *yuv_type) @@ -78,17 +207,12 @@ static int GetYUVConversionType(int width, int height, YCbCrType *yuv_type) static SDL_bool IsPlanar2x2Format(Uint32 format) { - return (format == SDL_PIXELFORMAT_YV12 || - format == SDL_PIXELFORMAT_IYUV || - format == SDL_PIXELFORMAT_NV12 || - format == SDL_PIXELFORMAT_NV21); + return format == SDL_PIXELFORMAT_YV12 || format == SDL_PIXELFORMAT_IYUV || format == SDL_PIXELFORMAT_NV12 || format == SDL_PIXELFORMAT_NV21; } static SDL_bool IsPacked4Format(Uint32 format) { - return (format == SDL_PIXELFORMAT_YUY2 || - format == SDL_PIXELFORMAT_UYVY || - format == SDL_PIXELFORMAT_YVYU); + return format == SDL_PIXELFORMAT_YUY2 || format == SDL_PIXELFORMAT_UYVY || format == SDL_PIXELFORMAT_YVYU; } static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, int yuv_pitch, @@ -183,9 +307,9 @@ static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, i static SDL_bool yuv_rgb_sse( Uint32 src_format, Uint32 dst_format, - Uint32 width, Uint32 height, - const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, - Uint8 *rgb, Uint32 rgb_stride, + Uint32 width, Uint32 height, + const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, + Uint8 *rgb, Uint32 rgb_stride, YCbCrType yuv_type) { #ifdef __SSE2__ @@ -334,9 +458,9 @@ static SDL_bool yuv_rgb_lsx( static SDL_bool yuv_rgb_std( Uint32 src_format, Uint32 dst_format, - Uint32 width, Uint32 height, - const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, - Uint8 *rgb, Uint32 rgb_stride, + Uint32 width, Uint32 height, + const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, + Uint8 *rgb, Uint32 rgb_stride, YCbCrType yuv_type) { if (src_format == SDL_PIXELFORMAT_YV12 || @@ -435,10 +559,9 @@ static SDL_bool yuv_rgb_std( return SDL_FALSE; } -int -SDL_ConvertPixels_YUV_to_RGB(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +int SDL_ConvertPixels_YUV_to_RGB(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { const Uint8 *y = NULL; const Uint8 *u = NULL; @@ -455,15 +578,15 @@ SDL_ConvertPixels_YUV_to_RGB(int width, int height, return -1; } - if (yuv_rgb_sse(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8*)dst, dst_pitch, yuv_type)) { + if (yuv_rgb_sse(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8 *)dst, dst_pitch, yuv_type)) { return 0; } - if (yuv_rgb_lsx(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8*)dst, dst_pitch, yuv_type)) { + if (yuv_rgb_lsx(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8 *)dst, dst_pitch, yuv_type)) { return 0; } - if (yuv_rgb_std(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8*)dst, dst_pitch, yuv_type)) { + if (yuv_rgb_std(src_format, dst_format, width, height, y, u, v, y_stride, uv_stride, (Uint8 *)dst, dst_pitch, yuv_type)) { return 0; } @@ -473,8 +596,8 @@ SDL_ConvertPixels_YUV_to_RGB(int width, int height, void *tmp; int tmp_pitch = (width * sizeof(Uint32)); - tmp = SDL_malloc(tmp_pitch * height); - if (tmp == NULL) { + tmp = SDL_malloc((size_t)tmp_pitch * height); + if (!tmp) { return SDL_OutOfMemory(); } @@ -502,37 +625,35 @@ struct RGB2YUVFactors float v[3]; /* Rfactor, Gfactor, Bfactor */ }; -static int -SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch) +static int SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch) { - const int src_pitch_x_2 = src_pitch * 2; - const int height_half = height / 2; + const int src_pitch_x_2 = src_pitch * 2; + const int height_half = height / 2; const int height_remainder = (height & 0x1); - const int width_half = width / 2; - const int width_remainder = (width & 0x1); + const int width_half = width / 2; + const int width_remainder = (width & 0x1); int i, j; - - static struct RGB2YUVFactors RGB2YUVFactorTables[SDL_YUV_CONVERSION_BT709 + 1] = - { + + static struct RGB2YUVFactors RGB2YUVFactorTables[SDL_YUV_CONVERSION_BT709 + 1] = { /* ITU-T T.871 (JPEG) */ { 0, - { 0.2990f, 0.5870f, 0.1140f }, - { -0.1687f, -0.3313f, 0.5000f }, - { 0.5000f, -0.4187f, -0.0813f }, + { 0.2990f, 0.5870f, 0.1140f }, + { -0.1687f, -0.3313f, 0.5000f }, + { 0.5000f, -0.4187f, -0.0813f }, }, /* ITU-R BT.601-7 */ { 16, - { 0.2568f, 0.5041f, 0.0979f }, - { -0.1482f, -0.2910f, 0.4392f }, - { 0.4392f, -0.3678f, -0.0714f }, + { 0.2568f, 0.5041f, 0.0979f }, + { -0.1482f, -0.2910f, 0.4392f }, + { 0.4392f, -0.3678f, -0.0714f }, }, /* ITU-R BT.709-6 */ { 16, - { 0.1826f, 0.6142f, 0.0620f }, - {-0.1006f, -0.3386f, 0.4392f }, + { 0.1826f, 0.6142f, 0.0620f }, + { -0.1006f, -0.3386f, 0.4392f }, { 0.4392f, -0.3989f, -0.0403f }, }, }; @@ -542,279 +663,266 @@ SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int sr #define MAKE_U(r, g, b) (Uint8)((int)(cvt->u[0] * (r) + cvt->u[1] * (g) + cvt->u[2] * (b) + 0.5f) + 128) #define MAKE_V(r, g, b) (Uint8)((int)(cvt->v[0] * (r) + cvt->v[1] * (g) + cvt->v[2] * (b) + 0.5f) + 128) -#define READ_2x2_PIXELS \ - const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ - const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ - const Uint32 p3 = ((const Uint32 *)next_row)[2 * i]; \ - const Uint32 p4 = ((const Uint32 *)next_row)[2 * i + 1]; \ - const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000) + (p3 & 0x00ff0000) + (p4 & 0x00ff0000)) >> 18; \ - const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00) + (p3 & 0x0000ff00) + (p4 & 0x0000ff00)) >> 10; \ - const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff) + (p3 & 0x000000ff) + (p4 & 0x000000ff)) >> 2; \ - -#define READ_2x1_PIXELS \ - const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ - const Uint32 p2 = ((const Uint32 *)next_row)[2 * i]; \ - const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ - const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ - const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \ - -#define READ_1x2_PIXELS \ - const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ - const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ - const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ - const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ - const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; \ - -#define READ_1x1_PIXEL \ - const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ - const Uint32 r = (p & 0x00ff0000) >> 16; \ - const Uint32 g = (p & 0x0000ff00) >> 8; \ - const Uint32 b = (p & 0x000000ff); \ - -#define READ_TWO_RGB_PIXELS \ - const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ - const Uint32 r = (p & 0x00ff0000) >> 16; \ - const Uint32 g = (p & 0x0000ff00) >> 8; \ - const Uint32 b = (p & 0x000000ff); \ - const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i + 1]; \ - const Uint32 r1 = (p1 & 0x00ff0000) >> 16; \ - const Uint32 g1 = (p1 & 0x0000ff00) >> 8; \ - const Uint32 b1 = (p1 & 0x000000ff); \ - const Uint32 R = (r + r1)/2; \ - const Uint32 G = (g + g1)/2; \ - const Uint32 B = (b + b1)/2; \ - -#define READ_ONE_RGB_PIXEL READ_1x1_PIXEL - - switch (dst_format) - { +#define READ_2x2_PIXELS \ + const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ + const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ + const Uint32 p3 = ((const Uint32 *)next_row)[2 * i]; \ + const Uint32 p4 = ((const Uint32 *)next_row)[2 * i + 1]; \ + const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000) + (p3 & 0x00ff0000) + (p4 & 0x00ff0000)) >> 18; \ + const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00) + (p3 & 0x0000ff00) + (p4 & 0x0000ff00)) >> 10; \ + const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff) + (p3 & 0x000000ff) + (p4 & 0x000000ff)) >> 2; + +#define READ_2x1_PIXELS \ + const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ + const Uint32 p2 = ((const Uint32 *)next_row)[2 * i]; \ + const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ + const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ + const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; + +#define READ_1x2_PIXELS \ + const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i]; \ + const Uint32 p2 = ((const Uint32 *)curr_row)[2 * i + 1]; \ + const Uint32 r = ((p1 & 0x00ff0000) + (p2 & 0x00ff0000)) >> 17; \ + const Uint32 g = ((p1 & 0x0000ff00) + (p2 & 0x0000ff00)) >> 9; \ + const Uint32 b = ((p1 & 0x000000ff) + (p2 & 0x000000ff)) >> 1; + +#define READ_1x1_PIXEL \ + const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ + const Uint32 r = (p & 0x00ff0000) >> 16; \ + const Uint32 g = (p & 0x0000ff00) >> 8; \ + const Uint32 b = (p & 0x000000ff); + +#define READ_TWO_RGB_PIXELS \ + const Uint32 p = ((const Uint32 *)curr_row)[2 * i]; \ + const Uint32 r = (p & 0x00ff0000) >> 16; \ + const Uint32 g = (p & 0x0000ff00) >> 8; \ + const Uint32 b = (p & 0x000000ff); \ + const Uint32 p1 = ((const Uint32 *)curr_row)[2 * i + 1]; \ + const Uint32 r1 = (p1 & 0x00ff0000) >> 16; \ + const Uint32 g1 = (p1 & 0x0000ff00) >> 8; \ + const Uint32 b1 = (p1 & 0x000000ff); \ + const Uint32 R = (r + r1) / 2; \ + const Uint32 G = (g + g1) / 2; \ + const Uint32 B = (b + b1) / 2; + +#define READ_ONE_RGB_PIXEL READ_1x1_PIXEL + + switch (dst_format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: case SDL_PIXELFORMAT_NV12: case SDL_PIXELFORMAT_NV21: - { - const Uint8 *curr_row, *next_row; - - Uint8 *plane_y; - Uint8 *plane_u; - Uint8 *plane_v; - Uint8 *plane_interleaved_uv; - Uint32 y_stride, uv_stride, y_skip, uv_skip; - - if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, - (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, - &y_stride, &uv_stride) != 0) { - return -1; - } + { + const Uint8 *curr_row, *next_row; + + Uint8 *plane_y; + Uint8 *plane_u; + Uint8 *plane_v; + Uint8 *plane_interleaved_uv; + Uint32 y_stride, uv_stride, y_skip, uv_skip; - plane_interleaved_uv = (plane_y + height * y_stride); - y_skip = (y_stride - width); + if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, + (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v, + &y_stride, &uv_stride) != 0) { + return -1; + } - curr_row = (const Uint8*)src; + plane_interleaved_uv = (plane_y + height * y_stride); + y_skip = (y_stride - width); - /* Write Y plane */ - for (j = 0; j < height; j++) { - for (i = 0; i < width; i++) { - const Uint32 p1 = ((const Uint32 *)curr_row)[i]; - const Uint32 r = (p1 & 0x00ff0000) >> 16; - const Uint32 g = (p1 & 0x0000ff00) >> 8; - const Uint32 b = (p1 & 0x000000ff); - *plane_y++ = MAKE_Y(r, g, b); - } - plane_y += y_skip; - curr_row += src_pitch; + curr_row = (const Uint8 *)src; + + /* Write Y plane */ + for (j = 0; j < height; j++) { + for (i = 0; i < width; i++) { + const Uint32 p1 = ((const Uint32 *)curr_row)[i]; + const Uint32 r = (p1 & 0x00ff0000) >> 16; + const Uint32 g = (p1 & 0x0000ff00) >> 8; + const Uint32 b = (p1 & 0x000000ff); + *plane_y++ = MAKE_Y(r, g, b); } + plane_y += y_skip; + curr_row += src_pitch; + } - curr_row = (const Uint8*)src; - next_row = (const Uint8*)src; - next_row += src_pitch; - - if (dst_format == SDL_PIXELFORMAT_YV12 || dst_format == SDL_PIXELFORMAT_IYUV) - { - /* Write UV planes, not interleaved */ - uv_skip = (uv_stride - (width + 1)/2); - for (j = 0; j < height_half; j++) { - for (i = 0; i < width_half; i++) { - READ_2x2_PIXELS; - *plane_u++ = MAKE_U(r, g, b); - *plane_v++ = MAKE_V(r, g, b); - } - if (width_remainder) { - READ_2x1_PIXELS; - *plane_u++ = MAKE_U(r, g, b); - *plane_v++ = MAKE_V(r, g, b); - } - plane_u += uv_skip; - plane_v += uv_skip; - curr_row += src_pitch_x_2; - next_row += src_pitch_x_2; + curr_row = (const Uint8 *)src; + next_row = (const Uint8 *)src; + next_row += src_pitch; + + if (dst_format == SDL_PIXELFORMAT_YV12 || dst_format == SDL_PIXELFORMAT_IYUV) { + /* Write UV planes, not interleaved */ + uv_skip = (uv_stride - (width + 1) / 2); + for (j = 0; j < height_half; j++) { + for (i = 0; i < width_half; i++) { + READ_2x2_PIXELS; + *plane_u++ = MAKE_U(r, g, b); + *plane_v++ = MAKE_V(r, g, b); } - if (height_remainder) { - for (i = 0; i < width_half; i++) { - READ_1x2_PIXELS; - *plane_u++ = MAKE_U(r, g, b); - *plane_v++ = MAKE_V(r, g, b); - } - if (width_remainder) { - READ_1x1_PIXEL; - *plane_u++ = MAKE_U(r, g, b); - *plane_v++ = MAKE_V(r, g, b); - } - plane_u += uv_skip; - plane_v += uv_skip; + if (width_remainder) { + READ_2x1_PIXELS; + *plane_u++ = MAKE_U(r, g, b); + *plane_v++ = MAKE_V(r, g, b); } + plane_u += uv_skip; + plane_v += uv_skip; + curr_row += src_pitch_x_2; + next_row += src_pitch_x_2; } - else if (dst_format == SDL_PIXELFORMAT_NV12) - { - uv_skip = (uv_stride - ((width + 1)/2)*2); - for (j = 0; j < height_half; j++) { - for (i = 0; i < width_half; i++) { - READ_2x2_PIXELS; - *plane_interleaved_uv++ = MAKE_U(r, g, b); - *plane_interleaved_uv++ = MAKE_V(r, g, b); - } - if (width_remainder) { - READ_2x1_PIXELS; - *plane_interleaved_uv++ = MAKE_U(r, g, b); - *plane_interleaved_uv++ = MAKE_V(r, g, b); - } - plane_interleaved_uv += uv_skip; - curr_row += src_pitch_x_2; - next_row += src_pitch_x_2; + if (height_remainder) { + for (i = 0; i < width_half; i++) { + READ_1x2_PIXELS; + *plane_u++ = MAKE_U(r, g, b); + *plane_v++ = MAKE_V(r, g, b); } - if (height_remainder) { - for (i = 0; i < width_half; i++) { - READ_1x2_PIXELS; - *plane_interleaved_uv++ = MAKE_U(r, g, b); - *plane_interleaved_uv++ = MAKE_V(r, g, b); - } - if (width_remainder) { - READ_1x1_PIXEL; - *plane_interleaved_uv++ = MAKE_U(r, g, b); - *plane_interleaved_uv++ = MAKE_V(r, g, b); - } + if (width_remainder) { + READ_1x1_PIXEL; + *plane_u++ = MAKE_U(r, g, b); + *plane_v++ = MAKE_V(r, g, b); } - } - else /* dst_format == SDL_PIXELFORMAT_NV21 */ - { - uv_skip = (uv_stride - ((width + 1)/2)*2); - for (j = 0; j < height_half; j++) { - for (i = 0; i < width_half; i++) { - READ_2x2_PIXELS; - *plane_interleaved_uv++ = MAKE_V(r, g, b); - *plane_interleaved_uv++ = MAKE_U(r, g, b); - } - if (width_remainder) { - READ_2x1_PIXELS; - *plane_interleaved_uv++ = MAKE_V(r, g, b); - *plane_interleaved_uv++ = MAKE_U(r, g, b); - } - plane_interleaved_uv += uv_skip; - curr_row += src_pitch_x_2; - next_row += src_pitch_x_2; + plane_u += uv_skip; + plane_v += uv_skip; + } + } else if (dst_format == SDL_PIXELFORMAT_NV12) { + uv_skip = (uv_stride - ((width + 1) / 2) * 2); + for (j = 0; j < height_half; j++) { + for (i = 0; i < width_half; i++) { + READ_2x2_PIXELS; + *plane_interleaved_uv++ = MAKE_U(r, g, b); + *plane_interleaved_uv++ = MAKE_V(r, g, b); + } + if (width_remainder) { + READ_2x1_PIXELS; + *plane_interleaved_uv++ = MAKE_U(r, g, b); + *plane_interleaved_uv++ = MAKE_V(r, g, b); + } + plane_interleaved_uv += uv_skip; + curr_row += src_pitch_x_2; + next_row += src_pitch_x_2; + } + if (height_remainder) { + for (i = 0; i < width_half; i++) { + READ_1x2_PIXELS; + *plane_interleaved_uv++ = MAKE_U(r, g, b); + *plane_interleaved_uv++ = MAKE_V(r, g, b); + } + if (width_remainder) { + READ_1x1_PIXEL; + *plane_interleaved_uv++ = MAKE_U(r, g, b); + *plane_interleaved_uv++ = MAKE_V(r, g, b); + } + } + } else /* dst_format == SDL_PIXELFORMAT_NV21 */ { + uv_skip = (uv_stride - ((width + 1) / 2) * 2); + for (j = 0; j < height_half; j++) { + for (i = 0; i < width_half; i++) { + READ_2x2_PIXELS; + *plane_interleaved_uv++ = MAKE_V(r, g, b); + *plane_interleaved_uv++ = MAKE_U(r, g, b); } - if (height_remainder) { - for (i = 0; i < width_half; i++) { - READ_1x2_PIXELS; - *plane_interleaved_uv++ = MAKE_V(r, g, b); - *plane_interleaved_uv++ = MAKE_U(r, g, b); - } - if (width_remainder) { - READ_1x1_PIXEL; - *plane_interleaved_uv++ = MAKE_V(r, g, b); - *plane_interleaved_uv++ = MAKE_U(r, g, b); - } + if (width_remainder) { + READ_2x1_PIXELS; + *plane_interleaved_uv++ = MAKE_V(r, g, b); + *plane_interleaved_uv++ = MAKE_U(r, g, b); + } + plane_interleaved_uv += uv_skip; + curr_row += src_pitch_x_2; + next_row += src_pitch_x_2; + } + if (height_remainder) { + for (i = 0; i < width_half; i++) { + READ_1x2_PIXELS; + *plane_interleaved_uv++ = MAKE_V(r, g, b); + *plane_interleaved_uv++ = MAKE_U(r, g, b); + } + if (width_remainder) { + READ_1x1_PIXEL; + *plane_interleaved_uv++ = MAKE_V(r, g, b); + *plane_interleaved_uv++ = MAKE_U(r, g, b); } } } - break; + } break; case SDL_PIXELFORMAT_YUY2: case SDL_PIXELFORMAT_UYVY: case SDL_PIXELFORMAT_YVYU: - { - const Uint8 *curr_row = (const Uint8*) src; - Uint8 *plane = (Uint8*) dst; - const int row_size = (4 * ((width + 1) / 2)); - int plane_skip; + { + const Uint8 *curr_row = (const Uint8 *)src; + Uint8 *plane = (Uint8 *)dst; + const int row_size = (4 * ((width + 1) / 2)); + int plane_skip; + + if (dst_pitch < row_size) { + return SDL_SetError("Destination pitch is too small, expected at least %d\n", row_size); + } + plane_skip = (dst_pitch - row_size); - if (dst_pitch < row_size) { - return SDL_SetError("Destination pitch is too small, expected at least %d\n", row_size); + /* Write YUV plane, packed */ + if (dst_format == SDL_PIXELFORMAT_YUY2) { + for (j = 0; j < height; j++) { + for (i = 0; i < width_half; i++) { + READ_TWO_RGB_PIXELS; + /* Y U Y1 V */ + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_U(R, G, B); + *plane++ = MAKE_Y(r1, g1, b1); + *plane++ = MAKE_V(R, G, B); + } + if (width_remainder) { + READ_ONE_RGB_PIXEL; + /* Y U Y V */ + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_U(r, g, b); + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_V(r, g, b); + } + plane += plane_skip; + curr_row += src_pitch; } - plane_skip = (dst_pitch - row_size); - - /* Write YUV plane, packed */ - if (dst_format == SDL_PIXELFORMAT_YUY2) - { - for (j = 0; j < height; j++) { - for (i = 0; i < width_half; i++) { - READ_TWO_RGB_PIXELS; - /* Y U Y1 V */ - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_U(R, G, B); - *plane++ = MAKE_Y(r1, g1, b1); - *plane++ = MAKE_V(R, G, B); - } - if (width_remainder) { - READ_ONE_RGB_PIXEL; - /* Y U Y V */ - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_U(r, g, b); - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_V(r, g, b); - } - plane += plane_skip; - curr_row += src_pitch; + } else if (dst_format == SDL_PIXELFORMAT_UYVY) { + for (j = 0; j < height; j++) { + for (i = 0; i < width_half; i++) { + READ_TWO_RGB_PIXELS; + /* U Y V Y1 */ + *plane++ = MAKE_U(R, G, B); + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_V(R, G, B); + *plane++ = MAKE_Y(r1, g1, b1); } - } - else if (dst_format == SDL_PIXELFORMAT_UYVY) - { - for (j = 0; j < height; j++) { - for (i = 0; i < width_half; i++) { - READ_TWO_RGB_PIXELS; - /* U Y V Y1 */ - *plane++ = MAKE_U(R, G, B); - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_V(R, G, B); - *plane++ = MAKE_Y(r1, g1, b1); - } - if (width_remainder) { - READ_ONE_RGB_PIXEL; - /* U Y V Y */ - *plane++ = MAKE_U(r, g, b); - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_V(r, g, b); - *plane++ = MAKE_Y(r, g, b); - } - plane += plane_skip; - curr_row += src_pitch; + if (width_remainder) { + READ_ONE_RGB_PIXEL; + /* U Y V Y */ + *plane++ = MAKE_U(r, g, b); + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_V(r, g, b); + *plane++ = MAKE_Y(r, g, b); } + plane += plane_skip; + curr_row += src_pitch; } - else if (dst_format == SDL_PIXELFORMAT_YVYU) - { - for (j = 0; j < height; j++) { - for (i = 0; i < width_half; i++) { - READ_TWO_RGB_PIXELS; - /* Y V Y1 U */ - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_V(R, G, B); - *plane++ = MAKE_Y(r1, g1, b1); - *plane++ = MAKE_U(R, G, B); - } - if (width_remainder) { - READ_ONE_RGB_PIXEL; - /* Y V Y U */ - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_V(r, g, b); - *plane++ = MAKE_Y(r, g, b); - *plane++ = MAKE_U(r, g, b); - } - plane += plane_skip; - curr_row += src_pitch; + } else if (dst_format == SDL_PIXELFORMAT_YVYU) { + for (j = 0; j < height; j++) { + for (i = 0; i < width_half; i++) { + READ_TWO_RGB_PIXELS; + /* Y V Y1 U */ + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_V(R, G, B); + *plane++ = MAKE_Y(r1, g1, b1); + *plane++ = MAKE_U(R, G, B); + } + if (width_remainder) { + READ_ONE_RGB_PIXEL; + /* Y V Y U */ + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_V(r, g, b); + *plane++ = MAKE_Y(r, g, b); + *plane++ = MAKE_U(r, g, b); } + plane += plane_skip; + curr_row += src_pitch; } } - break; + } break; default: return SDL_SetError("Unsupported YUV destination format: %s", SDL_GetPixelFormatName(dst_format)); @@ -831,10 +939,9 @@ SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int sr return 0; } -int -SDL_ConvertPixels_RGB_to_YUV(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +int SDL_ConvertPixels_RGB_to_YUV(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { #if 0 /* Doesn't handle odd widths */ /* RGB24 to FOURCC */ @@ -870,8 +977,8 @@ SDL_ConvertPixels_RGB_to_YUV(int width, int height, void *tmp; int tmp_pitch = (width * sizeof(Uint32)); - tmp = SDL_malloc(tmp_pitch * height); - if (tmp == NULL) { + tmp = SDL_malloc((size_t)tmp_pitch * height); + if (!tmp) { return SDL_OutOfMemory(); } @@ -889,9 +996,8 @@ SDL_ConvertPixels_RGB_to_YUV(int width, int height, } } -static int -SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, - const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, + const void *src, int src_pitch, void *dst, int dst_pitch) { int i; @@ -899,8 +1005,8 @@ SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, /* Y plane */ for (i = height; i--;) { SDL_memcpy(dst, src, width); - src = (const Uint8*)src + src_pitch; - dst = (Uint8*)dst + dst_pitch; + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; } if (format == SDL_PIXELFORMAT_YV12 || format == SDL_PIXELFORMAT_IYUV) { @@ -911,19 +1017,19 @@ SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, dst_pitch = (dst_pitch + 1) / 2; for (i = height * 2; i--;) { SDL_memcpy(dst, src, width); - src = (const Uint8*)src + src_pitch; - dst = (Uint8*)dst + dst_pitch; + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; } } else if (format == SDL_PIXELFORMAT_NV12 || format == SDL_PIXELFORMAT_NV21) { /* U/V plane is half the height of the Y plane, rounded up */ height = (height + 1) / 2; - width = ((width + 1) / 2)*2; - src_pitch = ((src_pitch + 1) / 2)*2; - dst_pitch = ((dst_pitch + 1) / 2)*2; + width = ((width + 1) / 2) * 2; + src_pitch = ((src_pitch + 1) / 2) * 2; + dst_pitch = ((dst_pitch + 1) / 2) * 2; for (i = height; i--;) { SDL_memcpy(dst, src, width); - src = (const Uint8*)src + src_pitch; - dst = (Uint8*)dst + dst_pitch; + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; } } return 0; @@ -934,8 +1040,8 @@ SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, width = 4 * ((width + 1) / 2); for (i = height; i--;) { SDL_memcpy(dst, src, width); - src = (const Uint8*)src + src_pitch; - dst = (Uint8*)dst + dst_pitch; + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; } return 0; } @@ -943,19 +1049,18 @@ SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, Uint32 format, return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV_Copy: Unsupported YUV format: %s", SDL_GetPixelFormatName(format)); } -static int -SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int y; - const int UVwidth = (width + 1)/2; - const int UVheight = (height + 1)/2; + const int UVwidth = (width + 1) / 2; + const int UVheight = (height + 1) / 2; /* Skip the Y plane */ src = (const Uint8 *)src + height * src_pitch; dst = (Uint8 *)dst + height * dst_pitch; if (src == dst) { - int UVpitch = (dst_pitch + 1)/2; + int UVpitch = (dst_pitch + 1) / 2; Uint8 *tmp; Uint8 *row1 = dst; Uint8 *row2 = (Uint8 *)dst + UVheight * UVpitch; @@ -976,8 +1081,8 @@ SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_p } else { const Uint8 *srcUV; Uint8 *dstUV; - int srcUVPitch = ((src_pitch + 1)/2); - int dstUVPitch = ((dst_pitch + 1)/2); + int srcUVPitch = ((src_pitch + 1) / 2); + int dstUVPitch = ((dst_pitch + 1) / 2); /* Copy the first plane */ srcUV = (const Uint8 *)src; @@ -999,16 +1104,15 @@ SDL_ConvertPixels_SwapUVPlanes(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV) +static int SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV) { int x, y; - const int UVwidth = (width + 1)/2; - const int UVheight = (height + 1)/2; - const int srcUVPitch = ((src_pitch + 1)/2); + const int UVwidth = (width + 1) / 2; + const int UVheight = (height + 1) / 2; + const int srcUVPitch = ((src_pitch + 1) / 2); const int srcUVPitchLeft = srcUVPitch - UVwidth; - const int dstUVPitch = ((dst_pitch + 1)/2)*2; - const int dstUVPitchLeft = dstUVPitch - UVwidth*2; + const int dstUVPitch = ((dst_pitch + 1) / 2) * 2; + const int dstUVPitchLeft = dstUVPitch - UVwidth * 2; const Uint8 *src1, *src2; Uint8 *dstUV; Uint8 *tmp = NULL; @@ -1022,11 +1126,11 @@ SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int if (src == dst) { /* Need to make a copy of the buffer so we don't clobber it while converting */ - tmp = (Uint8 *)SDL_malloc(2*UVheight*srcUVPitch); + tmp = (Uint8 *)SDL_malloc((size_t)2 * UVheight * srcUVPitch); if (!tmp) { return SDL_OutOfMemory(); } - SDL_memcpy(tmp, src, 2*UVheight*srcUVPitch); + SDL_memcpy(tmp, src, (size_t)2 * UVheight * srcUVPitch); src = tmp; } @@ -1049,8 +1153,8 @@ SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int __m128i v = _mm_loadu_si128((__m128i *)src2); __m128i uv1 = _mm_unpacklo_epi8(u, v); __m128i uv2 = _mm_unpackhi_epi8(u, v); - _mm_storeu_si128((__m128i*)dstUV, uv1); - _mm_storeu_si128((__m128i*)(dstUV + 16), uv2); + _mm_storeu_si128((__m128i *)dstUV, uv1); + _mm_storeu_si128((__m128i *)(dstUV + 16), uv2); src1 += 16; src2 += 16; dstUV += 32; @@ -1073,15 +1177,14 @@ SDL_ConvertPixels_PackUVPlanes_to_NV(int width, int height, const void *src, int return 0; } -static int -SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV) +static int SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch, SDL_bool reverseUV) { int x, y; - const int UVwidth = (width + 1)/2; - const int UVheight = (height + 1)/2; - const int srcUVPitch = ((src_pitch + 1)/2)*2; - const int srcUVPitchLeft = srcUVPitch - UVwidth*2; - const int dstUVPitch = ((dst_pitch + 1)/2); + const int UVwidth = (width + 1) / 2; + const int UVheight = (height + 1) / 2; + const int srcUVPitch = ((src_pitch + 1) / 2) * 2; + const int srcUVPitchLeft = srcUVPitch - UVwidth * 2; + const int dstUVPitch = ((dst_pitch + 1) / 2); const int dstUVPitchLeft = dstUVPitch - UVwidth; const Uint8 *srcUV; Uint8 *dst1, *dst2; @@ -1096,11 +1199,11 @@ SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, in if (src == dst) { /* Need to make a copy of the buffer so we don't clobber it while converting */ - tmp = (Uint8 *)SDL_malloc(UVheight*srcUVPitch); + tmp = (Uint8 *)SDL_malloc((size_t)UVheight * srcUVPitch); if (!tmp) { return SDL_OutOfMemory(); } - SDL_memcpy(tmp, src, UVheight*srcUVPitch); + SDL_memcpy(tmp, src, (size_t)UVheight * srcUVPitch); src = tmp; } @@ -1120,16 +1223,16 @@ SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, in if (use_SSE2) { __m128i mask = _mm_set1_epi16(0x00FF); while (x >= 16) { - __m128i uv1 = _mm_loadu_si128((__m128i*)srcUV); - __m128i uv2 = _mm_loadu_si128((__m128i*)(srcUV+16)); + __m128i uv1 = _mm_loadu_si128((__m128i *)srcUV); + __m128i uv2 = _mm_loadu_si128((__m128i *)(srcUV + 16)); __m128i u1 = _mm_and_si128(uv1, mask); __m128i u2 = _mm_and_si128(uv2, mask); __m128i u = _mm_packus_epi16(u1, u2); __m128i v1 = _mm_srli_epi16(uv1, 8); __m128i v2 = _mm_srli_epi16(uv2, 8); __m128i v = _mm_packus_epi16(v1, v2); - _mm_storeu_si128((__m128i*)dst1, u); - _mm_storeu_si128((__m128i*)dst2, v); + _mm_storeu_si128((__m128i *)dst1, u); + _mm_storeu_si128((__m128i *)dst2, v); srcUV += 32; dst1 += 16; dst2 += 16; @@ -1152,16 +1255,15 @@ SDL_ConvertPixels_SplitNV_to_UVPlanes(int width, int height, const void *src, in return 0; } -static int -SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int UVwidth = (width + 1)/2; - const int UVheight = (height + 1)/2; - const int srcUVPitch = ((src_pitch + 1)/2)*2; - const int srcUVPitchLeft = (srcUVPitch - UVwidth*2)/sizeof(Uint16); - const int dstUVPitch = ((dst_pitch + 1)/2)*2; - const int dstUVPitchLeft = (dstUVPitch - UVwidth*2)/sizeof(Uint16); + const int UVwidth = (width + 1) / 2; + const int UVheight = (height + 1) / 2; + const int srcUVPitch = ((src_pitch + 1) / 2) * 2; + const int srcUVPitchLeft = (srcUVPitch - UVwidth * 2) / sizeof(Uint16); + const int dstUVPitch = ((dst_pitch + 1) / 2) * 2; + const int dstUVPitchLeft = (dstUVPitch - UVwidth * 2) / sizeof(Uint16); const Uint16 *srcUV; Uint16 *dstUV; #ifdef __SSE2__ @@ -1180,11 +1282,11 @@ SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, #ifdef __SSE2__ if (use_SSE2) { while (x >= 8) { - __m128i uv = _mm_loadu_si128((__m128i*)srcUV); + __m128i uv = _mm_loadu_si128((__m128i *)srcUV); __m128i v = _mm_slli_epi16(uv, 8); __m128i u = _mm_srli_epi16(uv, 8); __m128i vu = _mm_or_si128(v, u); - _mm_storeu_si128((__m128i*)dstUV, vu); + _mm_storeu_si128((__m128i *)dstUV, vu); srcUV += 8; dstUV += 8; x -= 8; @@ -1200,17 +1302,16 @@ SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int src_pitch, return 0; } -static int -SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +static int SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { if (src != dst) { /* Copy Y plane */ int i; const Uint8 *srcY = (const Uint8 *)src; Uint8 *dstY = (Uint8 *)dst; - for (i = height; i--; ) { + for (i = height; i--;) { SDL_memcpy(dstY, srcY, width); srcY += src_pitch; dstY += dst_pitch; @@ -1269,35 +1370,35 @@ SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height, default: break; } - return SDL_SetError("SDL_ConvertPixels_Planar2x2_to_Planar2x2: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); + return SDL_SetError("SDL_ConvertPixels_Planar2x2_to_Planar2x2: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), + SDL_GetPixelFormatName(dst_format)); } #ifdef __SSE2__ -#define PACKED4_TO_PACKED4_ROW_SSE2(shuffle) \ - while (x >= 4) { \ - __m128i yuv = _mm_loadu_si128((__m128i*)srcYUV); \ - __m128i lo = _mm_unpacklo_epi8(yuv, _mm_setzero_si128()); \ - __m128i hi = _mm_unpackhi_epi8(yuv, _mm_setzero_si128()); \ - lo = _mm_shufflelo_epi16(lo, shuffle); \ - lo = _mm_shufflehi_epi16(lo, shuffle); \ - hi = _mm_shufflelo_epi16(hi, shuffle); \ - hi = _mm_shufflehi_epi16(hi, shuffle); \ - yuv = _mm_packus_epi16(lo, hi); \ - _mm_storeu_si128((__m128i*)dstYUV, yuv); \ - srcYUV += 16; \ - dstYUV += 16; \ - x -= 4; \ - } \ +#define PACKED4_TO_PACKED4_ROW_SSE2(shuffle) \ + while (x >= 4) { \ + __m128i yuv = _mm_loadu_si128((__m128i *)srcYUV); \ + __m128i lo = _mm_unpacklo_epi8(yuv, _mm_setzero_si128()); \ + __m128i hi = _mm_unpackhi_epi8(yuv, _mm_setzero_si128()); \ + lo = _mm_shufflelo_epi16(lo, shuffle); \ + lo = _mm_shufflehi_epi16(lo, shuffle); \ + hi = _mm_shufflelo_epi16(hi, shuffle); \ + hi = _mm_shufflehi_epi16(hi, shuffle); \ + yuv = _mm_packus_epi16(lo, hi); \ + _mm_storeu_si128((__m128i *)dstYUV, yuv); \ + srcYUV += 16; \ + dstYUV += 16; \ + x -= 4; \ + } #endif -static int -SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1333,13 +1434,12 @@ SDL_ConvertPixels_YUY2_to_UYVY(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_YUY2_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_YUY2_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1375,13 +1475,12 @@ SDL_ConvertPixels_YUY2_to_YVYU(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_UYVY_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_UYVY_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1417,13 +1516,12 @@ SDL_ConvertPixels_UYVY_to_YUY2(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_UYVY_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_UYVY_to_YVYU(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1459,13 +1557,12 @@ SDL_ConvertPixels_UYVY_to_YVYU(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_YVYU_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_YVYU_to_YUY2(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1501,13 +1598,12 @@ SDL_ConvertPixels_YVYU_to_YUY2(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +static int SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int x, y; - const int YUVwidth = (width + 1)/2; - const int srcYUVPitchLeft = (src_pitch - YUVwidth*4); - const int dstYUVPitchLeft = (dst_pitch - YUVwidth*4); + const int YUVwidth = (width + 1) / 2; + const int srcYUVPitchLeft = (src_pitch - YUVwidth * 4); + const int dstYUVPitchLeft = (dst_pitch - YUVwidth * 4); const Uint8 *srcYUV = (const Uint8 *)src; Uint8 *dstYUV = (Uint8 *)dst; #ifdef __SSE2__ @@ -1543,10 +1639,9 @@ SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src, int src_p return 0; } -static int -SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +static int SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { switch (src_format) { case SDL_PIXELFORMAT_YUY2: @@ -1582,13 +1677,13 @@ SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, default: break; } - return SDL_SetError("SDL_ConvertPixels_Packed4_to_Packed4: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); + return SDL_SetError("SDL_ConvertPixels_Packed4_to_Packed4: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), + SDL_GetPixelFormatName(dst_format)); } -static int -SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +static int SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { int x, y; const Uint8 *srcY1, *srcY2, *srcU, *srcV; @@ -1611,10 +1706,10 @@ SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, if (src_format == SDL_PIXELFORMAT_NV12 || src_format == SDL_PIXELFORMAT_NV21) { srcUV_pixel_stride = 2; - srcUV_pitch_left = (srcUV_pitch - 2*((width + 1)/2)); + srcUV_pitch_left = (srcUV_pitch - 2 * ((width + 1) / 2)); } else { srcUV_pixel_stride = 1; - srcUV_pitch_left = (srcUV_pitch - ((width + 1)/2)); + srcUV_pitch_left = (srcUV_pitch - ((width + 1) / 2)); } if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, @@ -1625,7 +1720,7 @@ SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, dstY2 = dstY1 + dstY_pitch; dstU2 = dstU1 + dstUV_pitch; dstV2 = dstV1 + dstUV_pitch; - dst_pitch_left = (dstY_pitch - 4*((width + 1)/2)); + dst_pitch_left = (dstY_pitch - 4 * ((width + 1) / 2)); /* Copy 2x2 blocks of pixels at a time */ for (y = 0; y < (height - 1); y += 2) { @@ -1728,10 +1823,9 @@ SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, return 0; } -static int -SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +static int SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { int x, y; const Uint8 *srcY1, *srcY2, *srcU1, *srcU2, *srcV1, *srcV2; @@ -1752,7 +1846,7 @@ SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, srcY2 = srcY1 + srcY_pitch; srcU2 = srcU1 + srcUV_pitch; srcV2 = srcV1 + srcUV_pitch; - src_pitch_left = (srcY_pitch - 4*((width + 1)/2)); + src_pitch_left = (srcY_pitch - 4 * ((width + 1) / 2)); if (GetYUVPlanes(width, height, dst_format, dst, dst_pitch, (const Uint8 **)&dstY1, (const Uint8 **)&dstU, (const Uint8 **)&dstV, @@ -1764,10 +1858,10 @@ SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, if (dst_format == SDL_PIXELFORMAT_NV12 || dst_format == SDL_PIXELFORMAT_NV21) { dstUV_pixel_stride = 2; - dstUV_pitch_left = (dstUV_pitch - 2*((width + 1)/2)); + dstUV_pitch_left = (dstUV_pitch - 2 * ((width + 1) / 2)); } else { dstUV_pixel_stride = 1; - dstUV_pitch_left = (dstUV_pitch - ((width + 1)/2)); + dstUV_pitch_left = (dstUV_pitch - ((width + 1) / 2)); } /* Copy 2x2 blocks of pixels at a time */ @@ -1785,8 +1879,8 @@ SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, *dstY2++ = *srcY2; srcY2 += 2; - *dstU = (Uint8)(((Uint32)*srcU1 + *srcU2)/2); - *dstV = (Uint8)(((Uint32)*srcV1 + *srcV2)/2); + *dstU = (Uint8)(((Uint32)*srcU1 + *srcU2) / 2); + *dstV = (Uint8)(((Uint32)*srcV1 + *srcV2) / 2); srcU1 += 4; srcU2 += 4; @@ -1810,8 +1904,8 @@ SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, *dstY2++ = *srcY2; srcY2 += 2; - *dstU = (Uint8)(((Uint32)*srcU1 + *srcU2)/2); - *dstV = (Uint8)(((Uint32)*srcV1 + *srcV2)/2); + *dstU = (Uint8)(((Uint32)*srcU1 + *srcU2) / 2); + *dstV = (Uint8)(((Uint32)*srcV1 + *srcV2) / 2); srcU1 += 4; srcU2 += 4; @@ -1862,10 +1956,9 @@ SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, #endif /* SDL_HAVE_YUV */ -int -SDL_ConvertPixels_YUV_to_YUV(int width, int height, - Uint32 src_format, const void *src, int src_pitch, - Uint32 dst_format, void *dst, int dst_pitch) +int SDL_ConvertPixels_YUV_to_YUV(int width, int height, + Uint32 src_format, const void *src, int src_pitch, + Uint32 dst_format, void *dst, int dst_pitch) { #if SDL_HAVE_YUV if (src_format == dst_format) { @@ -1885,7 +1978,8 @@ SDL_ConvertPixels_YUV_to_YUV(int width, int height, } else if (IsPacked4Format(src_format) && IsPlanar2x2Format(dst_format)) { return SDL_ConvertPixels_Packed4_to_Planar2x2(width, height, src_format, src, src_pitch, dst_format, dst, dst_pitch); } else { - return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); + return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), + SDL_GetPixelFormatName(dst_format)); } #else return SDL_SetError("SDL not built with YUV support"); diff --git a/src/video/SDL_yuv_c.h b/src/video/SDL_yuv_c.h index d4e2c9108d282..ea58ea4d06fa6 100644 --- a/src/video/SDL_yuv_c.h +++ b/src/video/SDL_yuv_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,15 @@ #include "../SDL_internal.h" - /* YUV conversion functions */ extern int SDL_ConvertPixels_YUV_to_RGB(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch); extern int SDL_ConvertPixels_RGB_to_YUV(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch); extern int SDL_ConvertPixels_YUV_to_YUV(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch); + +extern int SDL_CalculateYUVSize(Uint32 format, int w, int h, size_t *size, int *pitch); + #endif /* SDL_yuv_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidclipboard.c b/src/video/android/SDL_androidclipboard.c index 42460d723ac5a..6a8b872d57fb4 100644 --- a/src/video/android/SDL_androidclipboard.c +++ b/src/video/android/SDL_androidclipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,20 +20,18 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include "SDL_androidvideo.h" #include "SDL_androidclipboard.h" #include "../../core/android/SDL_android.h" -int -Android_SetClipboardText(_THIS, const char *text) +int Android_SetClipboardText(_THIS, const char *text) { return Android_JNI_SetClipboardText(text); } -char * -Android_GetClipboardText(_THIS) +char *Android_GetClipboardText(_THIS) { return Android_JNI_GetClipboardText(); } diff --git a/src/video/android/SDL_androidclipboard.h b/src/video/android/SDL_androidclipboard.h index 9e6ce60d61896..eee537b2b7275 100644 --- a/src/video/android/SDL_androidclipboard.h +++ b/src/video/android/SDL_androidclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c index 3424a82549713..cbe7dd1741051 100644 --- a/src/video/android/SDL_androidevents.c +++ b/src/video/android/SDL_androidevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,10 +20,11 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include "SDL_androidevents.h" #include "SDL_events.h" +#include "SDL_hints.h" #include "SDL_androidkeyboard.h" #include "SDL_androidwindow.h" #include "../SDL_sysvideo.h" @@ -32,7 +33,7 @@ /* Can't include sysaudio "../../audio/android/SDL_androidaudio.h" * because of THIS redefinition */ -#if !SDL_AUDIO_DISABLED && SDL_AUDIO_DRIVER_ANDROID +#if !defined(SDL_AUDIO_DISABLED) && defined(SDL_AUDIO_DRIVER_ANDROID) extern void ANDROIDAUDIO_ResumeDevices(void); extern void ANDROIDAUDIO_PauseDevices(void); #else @@ -40,44 +41,45 @@ static void ANDROIDAUDIO_ResumeDevices(void) {} static void ANDROIDAUDIO_PauseDevices(void) {} #endif -#if !SDL_AUDIO_DISABLED && SDL_AUDIO_DRIVER_OPENSLES +#if !defined(SDL_AUDIO_DISABLED) && defined(SDL_AUDIO_DRIVER_OPENSLES) extern void openslES_ResumeDevices(void); extern void openslES_PauseDevices(void); #else -static void openslES_ResumeDevices(void) {} +static void openslES_ResumeDevices(void) +{ +} static void openslES_PauseDevices(void) {} #endif -#if !SDL_AUDIO_DISABLED && SDL_AUDIO_DRIVER_AAUDIO +#if !defined(SDL_AUDIO_DISABLED) && defined(SDL_AUDIO_DRIVER_AAUDIO) extern void aaudio_ResumeDevices(void); extern void aaudio_PauseDevices(void); -SDL_bool aaudio_DetectBrokenPlayState( void ); +SDL_bool aaudio_DetectBrokenPlayState(void); #else -static void aaudio_ResumeDevices(void) {} +static void aaudio_ResumeDevices(void) +{ +} static void aaudio_PauseDevices(void) {} -static SDL_bool aaudio_DetectBrokenPlayState( void ) { return SDL_FALSE; } +static SDL_bool aaudio_DetectBrokenPlayState(void) { return SDL_FALSE; } #endif - - /* Number of 'type' events in the event queue */ -static int -SDL_NumberOfEvents(Uint32 type) +static int SDL_NumberOfEvents(Uint32 type) { return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type); } -#if SDL_VIDEO_OPENGL_EGL -static void -android_egl_context_restore(SDL_Window *window) +#ifdef SDL_VIDEO_OPENGL_EGL +static void android_egl_context_restore(SDL_Window *window) { if (window) { SDL_Event event; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - if (SDL_GL_MakeCurrent(window, (SDL_GLContext) data->egl_context) < 0) { + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + SDL_GL_MakeCurrent(window, NULL); + if (SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context) < 0) { /* The context is no longer valid, create a new one */ - data->egl_context = (EGLContext) SDL_GL_CreateContext(window); - SDL_GL_MakeCurrent(window, (SDL_GLContext) data->egl_context); + data->egl_context = (EGLContext)SDL_GL_CreateContext(window); + SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context); event.type = SDL_RENDER_DEVICE_RESET; SDL_PushEvent(&event); } @@ -85,12 +87,11 @@ android_egl_context_restore(SDL_Window *window) } } -static void -android_egl_context_backup(SDL_Window *window) +static void android_egl_context_backup(SDL_Window *window) { if (window) { /* Keep a copy of the EGL Context so we can try to restore it when we resume */ - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; data->egl_context = SDL_GL_GetCurrentContext(); /* We need to do this so the EGLSurface can be freed */ SDL_GL_MakeCurrent(window, NULL); @@ -106,15 +107,14 @@ android_egl_context_backup(SDL_Window *window) * No polling necessary */ -void -Android_PumpEvents_Blocking(_THIS) +void Android_PumpEvents_Blocking(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; if (videodata->isPaused) { SDL_bool isContextExternal = SDL_IsVideoContextExternal(); -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Make sure this is the last thing we do before pausing */ if (!isContextExternal) { SDL_LockMutex(Android_ActivityMutex); @@ -141,7 +141,7 @@ Android_PumpEvents_Blocking(_THIS) aaudio_ResumeDevices(); /* Restore the GL Context from here, as this operation is thread dependent */ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (!isContextExternal && !SDL_HasEvent(SDL_QUIT)) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_restore(Android_Window); @@ -150,9 +150,7 @@ Android_PumpEvents_Blocking(_THIS) #endif /* Make sure SW Keyboard is restored when an app becomes foreground */ - if (SDL_IsTextInputActive()) { - Android_StartTextInput(_this); /* Only showTextInput */ - } + Android_RestoreScreenKeyboardOnResume(_this, Android_Window); } } else { if (videodata->isPausing || SDL_SemTryWait(Android_PauseSem) == 0) { @@ -176,14 +174,13 @@ Android_PumpEvents_Blocking(_THIS) } } - if ( aaudio_DetectBrokenPlayState() ) { + if (aaudio_DetectBrokenPlayState()) { aaudio_PauseDevices(); aaudio_ResumeDevices(); } } -void -Android_PumpEvents_NonBlocking(_THIS) +void Android_PumpEvents_NonBlocking(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; static int backup_context = 0; @@ -193,7 +190,7 @@ Android_PumpEvents_NonBlocking(_THIS) SDL_bool isContextExternal = SDL_IsVideoContextExternal(); if (backup_context) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (!isContextExternal) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_backup(Android_Window); @@ -210,7 +207,6 @@ Android_PumpEvents_NonBlocking(_THIS) backup_context = 0; } - if (SDL_SemTryWait(Android_ResumeSem) == 0) { videodata->isPaused = 0; @@ -226,7 +222,7 @@ Android_PumpEvents_NonBlocking(_THIS) aaudio_ResumeDevices(); } -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Restore the GL Context from here, as this operation is thread dependent */ if (!isContextExternal && !SDL_HasEvent(SDL_QUIT)) { SDL_LockMutex(Android_ActivityMutex); @@ -236,9 +232,7 @@ Android_PumpEvents_NonBlocking(_THIS) #endif /* Make sure SW Keyboard is restored when an app becomes foreground */ - if (SDL_IsTextInputActive()) { - Android_StartTextInput(_this); /* Only showTextInput */ - } + Android_RestoreScreenKeyboardOnResume(_this, Android_Window); } } else { if (videodata->isPausing || SDL_SemTryWait(Android_PauseSem) == 0) { @@ -263,7 +257,7 @@ Android_PumpEvents_NonBlocking(_THIS) } } - if ( aaudio_DetectBrokenPlayState() ) { + if (aaudio_DetectBrokenPlayState()) { aaudio_PauseDevices(); aaudio_ResumeDevices(); } diff --git a/src/video/android/SDL_androidevents.h b/src/video/android/SDL_androidevents.h index db78b00410f5f..cf043aa59f47d 100644 --- a/src/video/android/SDL_androidevents.h +++ b/src/video/android/SDL_androidevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index fe1b17b264936..dade42b1d2b15 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_ANDROID) && defined(SDL_VIDEO_OPENGL_EGL) /* Android SDL video driver implementation */ @@ -36,32 +36,29 @@ #include -int -Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { if (window && context) { - return SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *) window->driverdata)->egl_surface, context); + return SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *)window->driverdata)->egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); } } -SDL_GLContext -Android_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window *window) { SDL_GLContext ret; Android_ActivityMutex_Lock_Running(); - ret = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + ret = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); SDL_UnlockMutex(Android_ActivityMutex); return ret; } -int -Android_GLES_SwapWindow(_THIS, SDL_Window * window) +int Android_GLES_SwapWindow(_THIS, SDL_Window *window) { int retval; @@ -74,16 +71,16 @@ Android_GLES_SwapWindow(_THIS, SDL_Window * window) /*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE); _this->egl_data->eglWaitGL();*/ - retval = SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + retval = SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); SDL_UnlockMutex(Android_ActivityMutex); return retval; } -int -Android_GLES_LoadLibrary(_THIS, const char *path) { - return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0, 0); +int Android_GLES_LoadLibrary(_THIS, const char *path) +{ + return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } #endif /* SDL_VIDEO_DRIVER_ANDROID */ diff --git a/src/video/android/SDL_androidgl.h b/src/video/android/SDL_androidgl.h index 15225303bf726..e9fd3fbf1b831 100644 --- a/src/video/android/SDL_androidgl.h +++ b/src/video/android/SDL_androidgl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,12 +23,11 @@ #ifndef SDL_androidgl_h_ #define SDL_androidgl_h_ -SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window); -int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); -int Android_GLES_SwapWindow(_THIS, SDL_Window * window); +SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window *window); +int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +int Android_GLES_SwapWindow(_THIS, SDL_Window *window); int Android_GLES_LoadLibrary(_THIS, const char *path); - #endif /* SDL_androidgl_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index 3a05eb445dc9a..a9ad4900c5831 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include @@ -31,290 +31,291 @@ #include "../../core/android/SDL_android.h" static SDL_Scancode Android_Keycodes[] = { - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */ - SDL_SCANCODE_SOFTLEFT, /* AKEYCODE_SOFT_LEFT */ - SDL_SCANCODE_SOFTRIGHT, /* AKEYCODE_SOFT_RIGHT */ - SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */ - SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */ - SDL_SCANCODE_CALL, /* AKEYCODE_CALL */ - SDL_SCANCODE_ENDCALL, /* AKEYCODE_ENDCALL */ - SDL_SCANCODE_0, /* AKEYCODE_0 */ - SDL_SCANCODE_1, /* AKEYCODE_1 */ - SDL_SCANCODE_2, /* AKEYCODE_2 */ - SDL_SCANCODE_3, /* AKEYCODE_3 */ - SDL_SCANCODE_4, /* AKEYCODE_4 */ - SDL_SCANCODE_5, /* AKEYCODE_5 */ - SDL_SCANCODE_6, /* AKEYCODE_6 */ - SDL_SCANCODE_7, /* AKEYCODE_7 */ - SDL_SCANCODE_8, /* AKEYCODE_8 */ - SDL_SCANCODE_9, /* AKEYCODE_9 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */ - SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */ - SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */ - SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */ - SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */ - SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */ - SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */ - SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */ - SDL_SCANCODE_POWER, /* AKEYCODE_POWER */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */ - SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */ - SDL_SCANCODE_A, /* AKEYCODE_A */ - SDL_SCANCODE_B, /* AKEYCODE_B */ - SDL_SCANCODE_C, /* AKEYCODE_C */ - SDL_SCANCODE_D, /* AKEYCODE_D */ - SDL_SCANCODE_E, /* AKEYCODE_E */ - SDL_SCANCODE_F, /* AKEYCODE_F */ - SDL_SCANCODE_G, /* AKEYCODE_G */ - SDL_SCANCODE_H, /* AKEYCODE_H */ - SDL_SCANCODE_I, /* AKEYCODE_I */ - SDL_SCANCODE_J, /* AKEYCODE_J */ - SDL_SCANCODE_K, /* AKEYCODE_K */ - SDL_SCANCODE_L, /* AKEYCODE_L */ - SDL_SCANCODE_M, /* AKEYCODE_M */ - SDL_SCANCODE_N, /* AKEYCODE_N */ - SDL_SCANCODE_O, /* AKEYCODE_O */ - SDL_SCANCODE_P, /* AKEYCODE_P */ - SDL_SCANCODE_Q, /* AKEYCODE_Q */ - SDL_SCANCODE_R, /* AKEYCODE_R */ - SDL_SCANCODE_S, /* AKEYCODE_S */ - SDL_SCANCODE_T, /* AKEYCODE_T */ - SDL_SCANCODE_U, /* AKEYCODE_U */ - SDL_SCANCODE_V, /* AKEYCODE_V */ - SDL_SCANCODE_W, /* AKEYCODE_W */ - SDL_SCANCODE_X, /* AKEYCODE_X */ - SDL_SCANCODE_Y, /* AKEYCODE_Y */ - SDL_SCANCODE_Z, /* AKEYCODE_Z */ - SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */ - SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */ - SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */ - SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */ - SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */ - SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */ - SDL_SCANCODE_TAB, /* AKEYCODE_TAB */ - SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */ - SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */ - SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */ - SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */ - SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */ - SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */ - SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */ - SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */ - SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */ - SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */ - SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */ - SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */ - SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */ - SDL_SCANCODE_SLASH, /* AKEYCODE_SLASH */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */ - SDL_SCANCODE_MENU, /* AKEYCODE_MENU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */ - SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */ - SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */ - SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */ - SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */ - SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */ - SDL_SCANCODE_AUDIOREWIND, /* AKEYCODE_MEDIA_REWIND */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_UNKNOWN */ + SDL_SCANCODE_SOFTLEFT, /* AKEYCODE_SOFT_LEFT */ + SDL_SCANCODE_SOFTRIGHT, /* AKEYCODE_SOFT_RIGHT */ + SDL_SCANCODE_AC_HOME, /* AKEYCODE_HOME */ + SDL_SCANCODE_AC_BACK, /* AKEYCODE_BACK */ + SDL_SCANCODE_CALL, /* AKEYCODE_CALL */ + SDL_SCANCODE_ENDCALL, /* AKEYCODE_ENDCALL */ + SDL_SCANCODE_0, /* AKEYCODE_0 */ + SDL_SCANCODE_1, /* AKEYCODE_1 */ + SDL_SCANCODE_2, /* AKEYCODE_2 */ + SDL_SCANCODE_3, /* AKEYCODE_3 */ + SDL_SCANCODE_4, /* AKEYCODE_4 */ + SDL_SCANCODE_5, /* AKEYCODE_5 */ + SDL_SCANCODE_6, /* AKEYCODE_6 */ + SDL_SCANCODE_7, /* AKEYCODE_7 */ + SDL_SCANCODE_8, /* AKEYCODE_8 */ + SDL_SCANCODE_9, /* AKEYCODE_9 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STAR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_POUND */ + SDL_SCANCODE_UP, /* AKEYCODE_DPAD_UP */ + SDL_SCANCODE_DOWN, /* AKEYCODE_DPAD_DOWN */ + SDL_SCANCODE_LEFT, /* AKEYCODE_DPAD_LEFT */ + SDL_SCANCODE_RIGHT, /* AKEYCODE_DPAD_RIGHT */ + SDL_SCANCODE_SELECT, /* AKEYCODE_DPAD_CENTER */ + SDL_SCANCODE_VOLUMEUP, /* AKEYCODE_VOLUME_UP */ + SDL_SCANCODE_VOLUMEDOWN, /* AKEYCODE_VOLUME_DOWN */ + SDL_SCANCODE_POWER, /* AKEYCODE_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAMERA */ + SDL_SCANCODE_CLEAR, /* AKEYCODE_CLEAR */ + SDL_SCANCODE_A, /* AKEYCODE_A */ + SDL_SCANCODE_B, /* AKEYCODE_B */ + SDL_SCANCODE_C, /* AKEYCODE_C */ + SDL_SCANCODE_D, /* AKEYCODE_D */ + SDL_SCANCODE_E, /* AKEYCODE_E */ + SDL_SCANCODE_F, /* AKEYCODE_F */ + SDL_SCANCODE_G, /* AKEYCODE_G */ + SDL_SCANCODE_H, /* AKEYCODE_H */ + SDL_SCANCODE_I, /* AKEYCODE_I */ + SDL_SCANCODE_J, /* AKEYCODE_J */ + SDL_SCANCODE_K, /* AKEYCODE_K */ + SDL_SCANCODE_L, /* AKEYCODE_L */ + SDL_SCANCODE_M, /* AKEYCODE_M */ + SDL_SCANCODE_N, /* AKEYCODE_N */ + SDL_SCANCODE_O, /* AKEYCODE_O */ + SDL_SCANCODE_P, /* AKEYCODE_P */ + SDL_SCANCODE_Q, /* AKEYCODE_Q */ + SDL_SCANCODE_R, /* AKEYCODE_R */ + SDL_SCANCODE_S, /* AKEYCODE_S */ + SDL_SCANCODE_T, /* AKEYCODE_T */ + SDL_SCANCODE_U, /* AKEYCODE_U */ + SDL_SCANCODE_V, /* AKEYCODE_V */ + SDL_SCANCODE_W, /* AKEYCODE_W */ + SDL_SCANCODE_X, /* AKEYCODE_X */ + SDL_SCANCODE_Y, /* AKEYCODE_Y */ + SDL_SCANCODE_Z, /* AKEYCODE_Z */ + SDL_SCANCODE_COMMA, /* AKEYCODE_COMMA */ + SDL_SCANCODE_PERIOD, /* AKEYCODE_PERIOD */ + SDL_SCANCODE_LALT, /* AKEYCODE_ALT_LEFT */ + SDL_SCANCODE_RALT, /* AKEYCODE_ALT_RIGHT */ + SDL_SCANCODE_LSHIFT, /* AKEYCODE_SHIFT_LEFT */ + SDL_SCANCODE_RSHIFT, /* AKEYCODE_SHIFT_RIGHT */ + SDL_SCANCODE_TAB, /* AKEYCODE_TAB */ + SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */ + SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */ + SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */ + SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */ + SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */ + SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */ + SDL_SCANCODE_MINUS, /* AKEYCODE_MINUS */ + SDL_SCANCODE_EQUALS, /* AKEYCODE_EQUALS */ + SDL_SCANCODE_LEFTBRACKET, /* AKEYCODE_LEFT_BRACKET */ + SDL_SCANCODE_RIGHTBRACKET, /* AKEYCODE_RIGHT_BRACKET */ + SDL_SCANCODE_BACKSLASH, /* AKEYCODE_BACKSLASH */ + SDL_SCANCODE_SEMICOLON, /* AKEYCODE_SEMICOLON */ + SDL_SCANCODE_APOSTROPHE, /* AKEYCODE_APOSTROPHE */ + SDL_SCANCODE_SLASH, /* AKEYCODE_SLASH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_HEADSETHOOK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FOCUS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PLUS */ + SDL_SCANCODE_MENU, /* AKEYCODE_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */ + SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */ + SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */ + SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */ + SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */ + SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */ + SDL_SCANCODE_AUDIOREWIND, /* AKEYCODE_MEDIA_REWIND */ SDL_SCANCODE_AUDIOFASTFORWARD, /* AKEYCODE_MEDIA_FAST_FORWARD */ - SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */ - SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */ - SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */ - SDL_SCANCODE_ESCAPE, /* AKEYCODE_ESCAPE */ - SDL_SCANCODE_DELETE, /* AKEYCODE_FORWARD_DEL */ - SDL_SCANCODE_LCTRL, /* AKEYCODE_CTRL_LEFT */ - SDL_SCANCODE_RCTRL, /* AKEYCODE_CTRL_RIGHT */ - SDL_SCANCODE_CAPSLOCK, /* AKEYCODE_CAPS_LOCK */ - SDL_SCANCODE_SCROLLLOCK, /* AKEYCODE_SCROLL_LOCK */ - SDL_SCANCODE_LGUI, /* AKEYCODE_META_LEFT */ - SDL_SCANCODE_RGUI, /* AKEYCODE_META_RIGHT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FUNCTION */ - SDL_SCANCODE_PRINTSCREEN, /* AKEYCODE_SYSRQ */ - SDL_SCANCODE_PAUSE, /* AKEYCODE_BREAK */ - SDL_SCANCODE_HOME, /* AKEYCODE_MOVE_HOME */ - SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */ - SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */ - SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */ - SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */ - SDL_SCANCODE_F1, /* AKEYCODE_F1 */ - SDL_SCANCODE_F2, /* AKEYCODE_F2 */ - SDL_SCANCODE_F3, /* AKEYCODE_F3 */ - SDL_SCANCODE_F4, /* AKEYCODE_F4 */ - SDL_SCANCODE_F5, /* AKEYCODE_F5 */ - SDL_SCANCODE_F6, /* AKEYCODE_F6 */ - SDL_SCANCODE_F7, /* AKEYCODE_F7 */ - SDL_SCANCODE_F8, /* AKEYCODE_F8 */ - SDL_SCANCODE_F9, /* AKEYCODE_F9 */ - SDL_SCANCODE_F10, /* AKEYCODE_F10 */ - SDL_SCANCODE_F11, /* AKEYCODE_F11 */ - SDL_SCANCODE_F12, /* AKEYCODE_F12 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */ - SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */ - SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */ - SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */ - SDL_SCANCODE_KP_3, /* AKEYCODE_NUMPAD_3 */ - SDL_SCANCODE_KP_4, /* AKEYCODE_NUMPAD_4 */ - SDL_SCANCODE_KP_5, /* AKEYCODE_NUMPAD_5 */ - SDL_SCANCODE_KP_6, /* AKEYCODE_NUMPAD_6 */ - SDL_SCANCODE_KP_7, /* AKEYCODE_NUMPAD_7 */ - SDL_SCANCODE_KP_8, /* AKEYCODE_NUMPAD_8 */ - SDL_SCANCODE_KP_9, /* AKEYCODE_NUMPAD_9 */ - SDL_SCANCODE_KP_DIVIDE, /* AKEYCODE_NUMPAD_DIVIDE */ - SDL_SCANCODE_KP_MULTIPLY, /* AKEYCODE_NUMPAD_MULTIPLY */ - SDL_SCANCODE_KP_MINUS, /* AKEYCODE_NUMPAD_SUBTRACT */ - SDL_SCANCODE_KP_PLUS, /* AKEYCODE_NUMPAD_ADD */ - SDL_SCANCODE_KP_PERIOD, /* AKEYCODE_NUMPAD_DOT */ - SDL_SCANCODE_KP_COMMA, /* AKEYCODE_NUMPAD_COMMA */ - SDL_SCANCODE_KP_ENTER, /* AKEYCODE_NUMPAD_ENTER */ - SDL_SCANCODE_KP_EQUALS, /* AKEYCODE_NUMPAD_EQUALS */ - SDL_SCANCODE_KP_LEFTPAREN, /* AKEYCODE_NUMPAD_LEFT_PAREN */ - SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WINDOW */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_GUIDE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DVR */ - SDL_SCANCODE_AC_BOOKMARKS, /* AKEYCODE_BOOKMARK */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAPTIONS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SETTINGS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_POWER */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_POWER */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_INPUT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_POWER */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_INPUT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_RED */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_GREEN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_YELLOW */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_BLUE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_APP_SWITCH */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_3 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_4 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_5 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_6 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_7 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_8 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_9 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_10 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_11 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_12 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_13 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_14 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_15 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_16 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LANGUAGE_SWITCH */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MANNER_MODE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_3D_MODE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */ - SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */ - SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */ - SDL_SCANCODE_INTERNATIONAL5, /* AKEYCODE_MUHENKAN */ - SDL_SCANCODE_INTERNATIONAL4, /* AKEYCODE_HENKAN */ - SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */ - SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */ - SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ - SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_AUDIO_TRACK */ - SDL_SCANCODE_SLEEP, /* AKEYCODE_SLEEP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WAKEUP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PAIRING */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_TOP_MENU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_11 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_12 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LAST_CHANNEL */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_DATA_SERVICE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOICE_ASSIST */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_RADIO_SERVICE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TELETEXT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NUMBER_ENTRY */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_ANALOG */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_DIGITAL */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_BS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_CS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_SERVICE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NETWORK */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ANTENNA_CABLE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_3 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_4 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_VGA_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ZOOM_MODE */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_CONTENTS_MENU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_MEDIA_CONTEXT_MENU */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TIMER_PROGRAMMING */ - SDL_SCANCODE_HELP, /* AKEYCODE_HELP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_PREVIOUS */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_NEXT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_IN */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_OUT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_PRIMARY */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_1 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_2 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_3 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_UP_LEFT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_DOWN_LEFT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_UP_RIGHT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_DOWN_RIGHT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_FORWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_BACKWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_FORWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_BACKWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_SLEEP */ - SDL_SCANCODE_CUT, /* AKEYCODE_CUT */ - SDL_SCANCODE_COPY, /* AKEYCODE_COPY */ - SDL_SCANCODE_PASTE, /* AKEYCODE_PASTE */ + SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */ + SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */ + SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PICTSYMBOLS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SWITCH_CHARSET */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_A */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_B */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_C */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_X */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Y */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_Z */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_L2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_R2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_THUMBR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_START */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_SELECT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_MODE */ + SDL_SCANCODE_ESCAPE, /* AKEYCODE_ESCAPE */ + SDL_SCANCODE_DELETE, /* AKEYCODE_FORWARD_DEL */ + SDL_SCANCODE_LCTRL, /* AKEYCODE_CTRL_LEFT */ + SDL_SCANCODE_RCTRL, /* AKEYCODE_CTRL_RIGHT */ + SDL_SCANCODE_CAPSLOCK, /* AKEYCODE_CAPS_LOCK */ + SDL_SCANCODE_SCROLLLOCK, /* AKEYCODE_SCROLL_LOCK */ + SDL_SCANCODE_LGUI, /* AKEYCODE_META_LEFT */ + SDL_SCANCODE_RGUI, /* AKEYCODE_META_RIGHT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_FUNCTION */ + SDL_SCANCODE_PRINTSCREEN, /* AKEYCODE_SYSRQ */ + SDL_SCANCODE_PAUSE, /* AKEYCODE_BREAK */ + SDL_SCANCODE_HOME, /* AKEYCODE_MOVE_HOME */ + SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */ + SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */ + SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */ + SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */ + SDL_SCANCODE_F1, /* AKEYCODE_F1 */ + SDL_SCANCODE_F2, /* AKEYCODE_F2 */ + SDL_SCANCODE_F3, /* AKEYCODE_F3 */ + SDL_SCANCODE_F4, /* AKEYCODE_F4 */ + SDL_SCANCODE_F5, /* AKEYCODE_F5 */ + SDL_SCANCODE_F6, /* AKEYCODE_F6 */ + SDL_SCANCODE_F7, /* AKEYCODE_F7 */ + SDL_SCANCODE_F8, /* AKEYCODE_F8 */ + SDL_SCANCODE_F9, /* AKEYCODE_F9 */ + SDL_SCANCODE_F10, /* AKEYCODE_F10 */ + SDL_SCANCODE_F11, /* AKEYCODE_F11 */ + SDL_SCANCODE_F12, /* AKEYCODE_F12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */ + SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */ + SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */ + SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */ + SDL_SCANCODE_KP_3, /* AKEYCODE_NUMPAD_3 */ + SDL_SCANCODE_KP_4, /* AKEYCODE_NUMPAD_4 */ + SDL_SCANCODE_KP_5, /* AKEYCODE_NUMPAD_5 */ + SDL_SCANCODE_KP_6, /* AKEYCODE_NUMPAD_6 */ + SDL_SCANCODE_KP_7, /* AKEYCODE_NUMPAD_7 */ + SDL_SCANCODE_KP_8, /* AKEYCODE_NUMPAD_8 */ + SDL_SCANCODE_KP_9, /* AKEYCODE_NUMPAD_9 */ + SDL_SCANCODE_KP_DIVIDE, /* AKEYCODE_NUMPAD_DIVIDE */ + SDL_SCANCODE_KP_MULTIPLY, /* AKEYCODE_NUMPAD_MULTIPLY */ + SDL_SCANCODE_KP_MINUS, /* AKEYCODE_NUMPAD_SUBTRACT */ + SDL_SCANCODE_KP_PLUS, /* AKEYCODE_NUMPAD_ADD */ + SDL_SCANCODE_KP_PERIOD, /* AKEYCODE_NUMPAD_DOT */ + SDL_SCANCODE_KP_COMMA, /* AKEYCODE_NUMPAD_COMMA */ + SDL_SCANCODE_KP_ENTER, /* AKEYCODE_NUMPAD_ENTER */ + SDL_SCANCODE_KP_EQUALS, /* AKEYCODE_NUMPAD_EQUALS */ + SDL_SCANCODE_KP_LEFTPAREN, /* AKEYCODE_NUMPAD_LEFT_PAREN */ + SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WINDOW */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_GUIDE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DVR */ + SDL_SCANCODE_AC_BOOKMARKS, /* AKEYCODE_BOOKMARK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CAPTIONS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SETTINGS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STB_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_POWER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_AVR_INPUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_RED */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_GREEN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_YELLOW */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PROG_BLUE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_APP_SWITCH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_3 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_4 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_5 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_6 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_7 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_8 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_9 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_10 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_11 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_13 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_14 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_15 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BUTTON_16 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LANGUAGE_SWITCH */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MANNER_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_3D_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */ + SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */ + SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */ + SDL_SCANCODE_INTERNATIONAL5, /* AKEYCODE_MUHENKAN */ + SDL_SCANCODE_INTERNATIONAL4, /* AKEYCODE_HENKAN */ + SDL_SCANCODE_LANG3, /* AKEYCODE_KATAKANA_HIRAGANA */ + SDL_SCANCODE_INTERNATIONAL3, /* AKEYCODE_YEN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */ + SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ + SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_AUDIO_TRACK */ + SDL_SCANCODE_SLEEP, /* AKEYCODE_SLEEP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WAKEUP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_PAIRING */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_TOP_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_11 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_12 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_LAST_CHANNEL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_DATA_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOICE_ASSIST */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_RADIO_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TELETEXT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NUMBER_ENTRY */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_ANALOG */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TERRESTRIAL_DIGITAL */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_BS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_CS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_SATELLITE_SERVICE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_NETWORK */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ANTENNA_CABLE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_3 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_HDMI_4 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPOSITE_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_COMPONENT_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_INPUT_VGA_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_ZOOM_MODE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_CONTENTS_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_MEDIA_CONTEXT_MENU */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV_TIMER_PROGRAMMING */ + SDL_SCANCODE_HELP, /* AKEYCODE_HELP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_PREVIOUS */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_NEXT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_IN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NAVIGATE_OUT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_PRIMARY */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_1 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_2 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_STEM_3 */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_UP_LEFT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_DOWN_LEFT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_UP_RIGHT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_DPAD_DOWN_RIGHT */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_SKIP_BACKWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_FORWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_STEP_BACKWARD */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SOFT_SLEEP */ + SDL_SCANCODE_CUT, /* AKEYCODE_CUT */ + SDL_SCANCODE_COPY, /* AKEYCODE_COPY */ + SDL_SCANCODE_PASTE, /* AKEYCODE_PASTE */ }; -static SDL_Scancode -TranslateKeycode(int keycode) +static SDL_bool SDL_screen_keyboard_shown; + +static SDL_Scancode TranslateKeycode(int keycode) { SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; @@ -327,45 +328,47 @@ TranslateKeycode(int keycode) return scancode; } -int -Android_OnKeyDown(int keycode) +int Android_OnKeyDown(int keycode) { return SDL_SendKeyboardKey(SDL_PRESSED, TranslateKeycode(keycode)); } -int -Android_OnKeyUp(int keycode) +int Android_OnKeyUp(int keycode) { return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode)); } -SDL_bool -Android_HasScreenKeyboardSupport(_THIS) +SDL_bool Android_HasScreenKeyboardSupport(_THIS) { return SDL_TRUE; } -SDL_bool -Android_IsScreenKeyboardShown(_THIS, SDL_Window * window) +void Android_ShowScreenKeyboard(_THIS, SDL_Window *window) { - return Android_JNI_IsScreenKeyboardShown(); + SDL_VideoData *videodata = _this->driverdata; + Android_JNI_ShowScreenKeyboard(&videodata->textRect); + SDL_screen_keyboard_shown = SDL_TRUE; } -void -Android_StartTextInput(_THIS) +void Android_HideScreenKeyboard(_THIS, SDL_Window *window) { - SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; - Android_JNI_ShowTextInput(&videodata->textRect); + Android_JNI_HideScreenKeyboard(); + SDL_screen_keyboard_shown = SDL_FALSE; +} + +void Android_RestoreScreenKeyboardOnResume(_THIS, SDL_Window *window) +{ + if (SDL_screen_keyboard_shown) { + Android_ShowScreenKeyboard(_this, window); + } } -void -Android_StopTextInput(_THIS) +SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window *window) { - Android_JNI_HideTextInput(); + return Android_JNI_IsScreenKeyboardShown(); } -void -Android_SetTextInputRect(_THIS, const SDL_Rect *rect) +void Android_SetTextInputRect(_THIS, const SDL_Rect *rect) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h index 6bdcc87bed026..829a4f40775a5 100644 --- a/src/video/android/SDL_androidkeyboard.h +++ b/src/video/android/SDL_androidkeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,10 +26,10 @@ extern int Android_OnKeyDown(int keycode); extern int Android_OnKeyUp(int keycode); extern SDL_bool Android_HasScreenKeyboardSupport(_THIS); -extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window * window); - -extern void Android_StartTextInput(_THIS); -extern void Android_StopTextInput(_THIS); +extern void Android_ShowScreenKeyboard(_THIS, SDL_Window *window); +extern void Android_HideScreenKeyboard(_THIS, SDL_Window *window); +extern void Android_RestoreScreenKeyboardOnResume(_THIS, SDL_Window *window); +extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window *window); extern void Android_SetTextInputRect(_THIS, const SDL_Rect *rect); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/android/SDL_androidmessagebox.c b/src/video/android/SDL_androidmessagebox.c index dc8b8ad034589..d30c6e635405d 100644 --- a/src/video/android/SDL_androidmessagebox.c +++ b/src/video/android/SDL_androidmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include "SDL_messagebox.h" #include "SDL_androidmessagebox.h" #include "../../core/android/SDL_android.h" -int -Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { return Android_JNI_ShowMessageBox(messageboxdata, buttonid); } diff --git a/src/video/android/SDL_androidmessagebox.h b/src/video/android/SDL_androidmessagebox.h index 73b276f830e54..254790c4429ab 100644 --- a/src/video/android/SDL_androidmessagebox.h +++ b/src/video/android/SDL_androidmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID extern int Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/android/SDL_androidmouse.c b/src/video/android/SDL_androidmouse.c index 38953fa07d902..4f12dd15668e8 100644 --- a/src/video/android/SDL_androidmouse.c +++ b/src/video/android/SDL_androidmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include "SDL_androidmouse.h" @@ -31,16 +31,16 @@ #include "../../core/android/SDL_android.h" /* See Android's MotionEvent class for constants */ -#define ACTION_DOWN 0 -#define ACTION_UP 1 -#define ACTION_MOVE 2 +#define ACTION_DOWN 0 +#define ACTION_UP 1 +#define ACTION_MOVE 2 #define ACTION_HOVER_MOVE 7 -#define ACTION_SCROLL 8 -#define BUTTON_PRIMARY 1 -#define BUTTON_SECONDARY 2 -#define BUTTON_TERTIARY 4 -#define BUTTON_BACK 8 -#define BUTTON_FORWARD 16 +#define ACTION_SCROLL 8 +#define BUTTON_PRIMARY 1 +#define BUTTON_SECONDARY 2 +#define BUTTON_TERTIARY 4 +#define BUTTON_BACK 8 +#define BUTTON_FORWARD 16 typedef struct { @@ -55,8 +55,7 @@ static int last_state; /* Blank cursor */ static SDL_Cursor *empty_cursor; -static SDL_Cursor * -Android_WrapCursor(int custom_cursor, int system_cursor) +static SDL_Cursor *Android_WrapCursor(int custom_cursor, int system_cursor) { SDL_Cursor *cursor; @@ -79,14 +78,12 @@ Android_WrapCursor(int custom_cursor, int system_cursor) return cursor; } -static SDL_Cursor * -Android_CreateDefaultCursor() +static SDL_Cursor *Android_CreateDefaultCursor(void) { return Android_WrapCursor(0, SDL_SYSTEM_CURSOR_ARROW); } -static SDL_Cursor * -Android_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *Android_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { int custom_cursor; SDL_Surface *converted; @@ -104,16 +101,14 @@ Android_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) return Android_WrapCursor(custom_cursor, 0); } -static SDL_Cursor * -Android_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *Android_CreateSystemCursor(SDL_SystemCursor id) { return Android_WrapCursor(0, id); } -static void -Android_FreeCursor(SDL_Cursor * cursor) +static void Android_FreeCursor(SDL_Cursor *cursor) { - SDL_AndroidCursorData *data = (SDL_AndroidCursorData*) cursor->driverdata; + SDL_AndroidCursorData *data = (SDL_AndroidCursorData *)cursor->driverdata; if (data->custom_cursor != 0) { Android_JNI_DestroyCustomCursor(data->custom_cursor); } @@ -121,13 +116,12 @@ Android_FreeCursor(SDL_Cursor * cursor) SDL_free(cursor); } -static SDL_Cursor * -Android_CreateEmptyCursor() +static SDL_Cursor *Android_CreateEmptyCursor(void) { if (!empty_cursor) { SDL_Surface *empty_surface = SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888); if (empty_surface) { - SDL_memset(empty_surface->pixels, 0, empty_surface->h * empty_surface->pitch); + SDL_memset(empty_surface->pixels, 0, (size_t)empty_surface->h * empty_surface->pitch); empty_cursor = Android_CreateCursor(empty_surface, 0, 0); SDL_FreeSurface(empty_surface); } @@ -135,8 +129,7 @@ Android_CreateEmptyCursor() return empty_cursor; } -static void -Android_DestroyEmptyCursor() +static void Android_DestroyEmptyCursor(void) { if (empty_cursor) { Android_FreeCursor(empty_cursor); @@ -144,8 +137,7 @@ Android_DestroyEmptyCursor() } } -static int -Android_ShowCursor(SDL_Cursor *cursor) +static int Android_ShowCursor(SDL_Cursor *cursor) { if (!cursor) { cursor = Android_CreateEmptyCursor(); @@ -168,8 +160,7 @@ Android_ShowCursor(SDL_Cursor *cursor) } } -static int -Android_SetRelativeMouseMode(SDL_bool enabled) +static int Android_SetRelativeMouseMode(SDL_bool enabled) { if (!Android_JNI_SupportsRelativeMouse()) { return SDL_Unsupported(); @@ -182,8 +173,7 @@ Android_SetRelativeMouseMode(SDL_bool enabled) return 0; } -void -Android_InitMouse(void) +void Android_InitMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -198,15 +188,13 @@ Android_InitMouse(void) last_state = 0; } -void -Android_QuitMouse(void) +void Android_QuitMouse(void) { Android_DestroyEmptyCursor(); } /* Translate Android mouse button state to SDL mouse button */ -static Uint8 -TranslateButton(int state) +static Uint8 TranslateButton(int state) { if (state & BUTTON_PRIMARY) { return SDL_BUTTON_LEFT; @@ -223,8 +211,7 @@ TranslateButton(int state) } } -void -Android_OnMouse(SDL_Window *window, int state, int action, float x, float y, SDL_bool relative) +void Android_OnMouse(SDL_Window *window, int state, int action, float x, float y, SDL_bool relative) { int changes; Uint8 button; @@ -233,38 +220,37 @@ Android_OnMouse(SDL_Window *window, int state, int action, float x, float y, SDL return; } - switch(action) { - case ACTION_DOWN: - changes = state & ~last_state; - button = TranslateButton(changes); - last_state = state; - SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); - SDL_SendMouseButton(window, 0, SDL_PRESSED, button); - break; - - case ACTION_UP: - changes = last_state & ~state; - button = TranslateButton(changes); - last_state = state; - SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); - SDL_SendMouseButton(window, 0, SDL_RELEASED, button); - break; - - case ACTION_MOVE: - case ACTION_HOVER_MOVE: - SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); - break; - - case ACTION_SCROLL: - SDL_SendMouseWheel(window, 0, x, y, SDL_MOUSEWHEEL_NORMAL); - break; - - default: - break; + switch (action) { + case ACTION_DOWN: + changes = state & ~last_state; + button = TranslateButton(changes); + last_state = state; + SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); + SDL_SendMouseButton(window, 0, SDL_PRESSED, button); + break; + + case ACTION_UP: + changes = last_state & ~state; + button = TranslateButton(changes); + last_state = state; + SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); + SDL_SendMouseButton(window, 0, SDL_RELEASED, button); + break; + + case ACTION_MOVE: + case ACTION_HOVER_MOVE: + SDL_SendMouseMotion(window, 0, relative, (int)x, (int)y); + break; + + case ACTION_SCROLL: + SDL_SendMouseWheel(window, 0, x, y, SDL_MOUSEWHEEL_NORMAL); + break; + + default: + break; } } #endif /* SDL_VIDEO_DRIVER_ANDROID */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/android/SDL_androidmouse.h b/src/video/android/SDL_androidmouse.h index b81085999958d..561a1f8a1f0ac 100644 --- a/src/video/android/SDL_androidmouse.h +++ b/src/video/android/SDL_androidmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/android/SDL_androidtouch.c b/src/video/android/SDL_androidtouch.c index 24d985b0e983d..5741a86c16064 100644 --- a/src/video/android/SDL_androidtouch.c +++ b/src/video/android/SDL_androidtouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include @@ -32,12 +32,12 @@ #include "../../core/android/SDL_android.h" #define ACTION_DOWN 0 -#define ACTION_UP 1 +#define ACTION_UP 1 #define ACTION_MOVE 2 /* #define ACTION_CANCEL 3 */ /* #define ACTION_OUTSIDE 4 */ #define ACTION_POINTER_DOWN 5 -#define ACTION_POINTER_UP 6 +#define ACTION_POINTER_UP 6 void Android_InitTouch(void) { @@ -65,22 +65,22 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin fingerId = (SDL_FingerID)pointer_finger_id_in; switch (action) { - case ACTION_DOWN: - case ACTION_POINTER_DOWN: - SDL_SendTouch(touchDeviceId, fingerId, window, SDL_TRUE, x, y, p); - break; - - case ACTION_MOVE: - SDL_SendTouchMotion(touchDeviceId, fingerId, window, x, y, p); - break; - - case ACTION_UP: - case ACTION_POINTER_UP: - SDL_SendTouch(touchDeviceId, fingerId, window, SDL_FALSE, x, y, p); - break; - - default: - break; + case ACTION_DOWN: + case ACTION_POINTER_DOWN: + SDL_SendTouch(touchDeviceId, fingerId, window, SDL_TRUE, x, y, p); + break; + + case ACTION_MOVE: + SDL_SendTouchMotion(touchDeviceId, fingerId, window, x, y, p); + break; + + case ACTION_UP: + case ACTION_POINTER_UP: + SDL_SendTouch(touchDeviceId, fingerId, window, SDL_FALSE, x, y, p); + break; + + default: + break; } } diff --git a/src/video/android/SDL_androidtouch.h b/src/video/android/SDL_androidtouch.h index 641276f3e1c7c..806f6b8d8c35a 100644 --- a/src/video/android/SDL_androidtouch.h +++ b/src/video/android/SDL_androidtouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index 3ed828fde1bca..12a976c4da38b 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID /* Android SDL video driver implementation */ @@ -41,6 +41,7 @@ #include "SDL_androidtouch.h" #include "SDL_androidwindow.h" #include "SDL_androidvulkan.h" +#include "SDL_androidmessagebox.h" #define ANDROID_VID_DRIVER_NAME "Android" @@ -54,50 +55,46 @@ int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float * #define Android_GLES_UnloadLibrary SDL_EGL_UnloadLibrary #define Android_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define Android_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define Android_GLES_DeleteContext SDL_EGL_DeleteContext +#define Android_GLES_DeleteContext SDL_EGL_DeleteContext /* Android driver bootstrap functions */ - /* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */ -int Android_SurfaceWidth = 0; -int Android_SurfaceHeight = 0; -static int Android_DeviceWidth = 0; -static int Android_DeviceHeight = 0; +int Android_SurfaceWidth = 0; +int Android_SurfaceHeight = 0; +static int Android_DeviceWidth = 0; +static int Android_DeviceHeight = 0; static Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_RGB565; /* Default SurfaceView format, in case this is queried before being filled */ -static int Android_ScreenRate = 0; -SDL_sem *Android_PauseSem = NULL; -SDL_sem *Android_ResumeSem = NULL; -SDL_mutex *Android_ActivityMutex = NULL; +static int Android_ScreenRate = 0; +SDL_sem *Android_PauseSem = NULL; +SDL_sem *Android_ResumeSem = NULL; +SDL_mutex *Android_ActivityMutex = NULL; -static void -Android_SuspendScreenSaver(_THIS) +static void Android_SuspendScreenSaver(_THIS) { Android_JNI_SuspendScreenSaver(_this->suspend_screensaver); } -static void -Android_DeleteDevice(SDL_VideoDevice *device) +static void Android_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device->driverdata); SDL_free(device); } -static SDL_VideoDevice * -Android_CreateDevice(void) +static SDL_VideoDevice *Android_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *data; SDL_bool block_on_pause; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); return NULL; } - data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); + data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!data) { SDL_OutOfMemory(); SDL_free(device); @@ -129,7 +126,7 @@ Android_CreateDevice(void) device->free = Android_DeleteDevice; /* GL pointers */ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL device->GL_LoadLibrary = Android_GLES_LoadLibrary; device->GL_GetProcAddress = Android_GLES_GetProcAddress; device->GL_UnloadLibrary = Android_GLES_UnloadLibrary; @@ -141,7 +138,7 @@ Android_CreateDevice(void) device->GL_DeleteContext = Android_GLES_DeleteContext; #endif -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = Android_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = Android_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = Android_Vulkan_GetInstanceExtensions; @@ -152,12 +149,12 @@ Android_CreateDevice(void) device->SuspendScreenSaver = Android_SuspendScreenSaver; /* Text input */ - device->StartTextInput = Android_StartTextInput; - device->StopTextInput = Android_StopTextInput; device->SetTextInputRect = Android_SetTextInputRect; /* Screen keyboard */ device->HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport; + device->ShowScreenKeyboard = Android_ShowScreenKeyboard; + device->HideScreenKeyboard = Android_HideScreenKeyboard; device->IsScreenKeyboardShown = Android_IsScreenKeyboardShown; /* Clipboard */ @@ -170,27 +167,26 @@ Android_CreateDevice(void) VideoBootStrap Android_bootstrap = { ANDROID_VID_DRIVER_NAME, "SDL Android video driver", - Android_CreateDevice + Android_CreateDevice, + Android_ShowMessageBox }; - -int -Android_VideoInit(_THIS) +int Android_VideoInit(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; int display_index; SDL_VideoDisplay *display; SDL_DisplayMode mode; - videodata->isPaused = SDL_FALSE; + videodata->isPaused = SDL_FALSE; videodata->isPausing = SDL_FALSE; videodata->pauseAudio = SDL_GetHintBoolean(SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO, SDL_TRUE); - mode.format = Android_ScreenFormat; - mode.w = Android_DeviceWidth; - mode.h = Android_DeviceHeight; - mode.refresh_rate = Android_ScreenRate; - mode.driverdata = NULL; + mode.format = Android_ScreenFormat; + mode.w = Android_DeviceWidth; + mode.h = Android_DeviceHeight; + mode.refresh_rate = Android_ScreenRate; + mode.driverdata = NULL; display_index = SDL_AddBasicVideoDisplay(&mode); if (display_index < 0) { @@ -209,33 +205,30 @@ Android_VideoInit(_THIS) return 0; } -void -Android_VideoQuit(_THIS) +void Android_VideoQuit(_THIS) { Android_QuitMouse(); Android_QuitTouch(); } -int -Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) +int Android_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi) { return Android_JNI_GetDisplayDPI(ddpi, hdpi, vdpi); } -void -Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate) +void Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, float rate) { - Android_SurfaceWidth = surfaceWidth; + Android_SurfaceWidth = surfaceWidth; Android_SurfaceHeight = surfaceHeight; - Android_DeviceWidth = deviceWidth; - Android_DeviceHeight = deviceHeight; - Android_ScreenRate = (int)rate; + Android_DeviceWidth = deviceWidth; + Android_DeviceHeight = deviceHeight; + Android_ScreenRate = (int)rate; } -static -Uint32 format_to_pixelFormat(int format) { +static Uint32 format_to_pixelFormat(int format) +{ Uint32 pf; - if (format == AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM) { /* 1 */ + if (format == AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM) { /* 1 */ pf = SDL_PIXELFORMAT_RGBA8888; } else if (format == AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM) { /* 2 */ pf = SDL_PIXELFORMAT_RGBX8888; @@ -258,8 +251,7 @@ Uint32 format_to_pixelFormat(int format) { return pf; } -void -Android_SetFormat(int format_wanted, int format_got) +void Android_SetFormat(int format_wanted, int format_got) { Uint32 pf_wanted; Uint32 pf_got; @@ -283,24 +275,23 @@ void Android_SendResize(SDL_Window *window) which can happen after VideoInit(). */ SDL_VideoDevice *device = SDL_GetVideoDevice(); - if (device && device->num_displays > 0) - { - SDL_VideoDisplay *display = &device->displays[0]; - display->desktop_mode.format = Android_ScreenFormat; - display->desktop_mode.w = Android_DeviceWidth; - display->desktop_mode.h = Android_DeviceHeight; + if (device && device->num_displays > 0) { + SDL_VideoDisplay *display = &device->displays[0]; + display->desktop_mode.format = Android_ScreenFormat; + display->desktop_mode.w = Android_DeviceWidth; + display->desktop_mode.h = Android_DeviceHeight; display->desktop_mode.refresh_rate = Android_ScreenRate; } if (window) { /* Force the current mode to match the resize otherwise the SDL_WINDOWEVENT_RESTORED event * will fall back to the old mode */ - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - display->display_modes[0].format = Android_ScreenFormat; - display->display_modes[0].w = Android_DeviceWidth; - display->display_modes[0].h = Android_DeviceHeight; + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + display->display_modes[0].format = Android_ScreenFormat; + display->display_modes[0].w = Android_DeviceWidth; + display->display_modes[0].h = Android_DeviceHeight; display->display_modes[0].refresh_rate = Android_ScreenRate; - display->current_mode = display->display_modes[0]; + display->current_mode = display->display_modes[0]; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, Android_SurfaceWidth, Android_SurfaceHeight); } diff --git a/src/video/android/SDL_androidvideo.h b/src/video/android/SDL_androidvideo.h index 371419ba3cbe8..0ba13263b2aff 100644 --- a/src/video/android/SDL_androidvideo.h +++ b/src/video/android/SDL_androidvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,9 +37,9 @@ extern void Android_SendResize(SDL_Window *window); typedef struct SDL_VideoData { SDL_Rect textRect; - int isPaused; - int isPausing; - int pauseAudio; + int isPaused; + int isPausing; + int pauseAudio; } SDL_VideoData; extern int Android_SurfaceWidth; diff --git a/src/video/android/SDL_androidvulkan.c b/src/video/android/SDL_androidvulkan.c index 058165f5768d8..c4c21550cb74d 100644 --- a/src/video/android/SDL_androidvulkan.c +++ b/src/video/android/SDL_androidvulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_ANDROID +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_ANDROID) #include "SDL_androidvideo.h" #include "SDL_androidwindow.h" @@ -42,53 +42,55 @@ int Android_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasSurfaceExtension = SDL_FALSE; SDL_bool hasAndroidSurfaceExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan loader library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) + } + if (!path) { path = "libvulkan.so"; + } _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasAndroidSurfaceExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else if(!hasAndroidSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "extension"); + } else if (!hasAndroidSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "extension"); goto fail; } return 0; @@ -101,54 +103,50 @@ int Android_Vulkan_LoadLibrary(_THIS, const char *path) void Android_Vulkan_UnloadLibrary(_THIS) { - if(_this->vulkan_config.loader_handle) - { + if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } } SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names) + SDL_Window *window, + unsigned *count, + const char **names) { static const char *const extensionsForAndroid[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME }; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } return SDL_Vulkan_GetInstanceExtensions_Helper( - count, names, SDL_arraysize(extensionsForAndroid), - extensionsForAndroid); + count, names, SDL_arraysize(extensionsForAndroid), + extensionsForAndroid); } SDL_bool Android_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface) + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface) { SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR)vkGetInstanceProcAddr( - instance, - "vkCreateAndroidSurfaceKHR"); + instance, + "vkCreateAndroidSurfaceKHR"); VkAndroidSurfaceCreateInfoKHR createInfo; VkResult result; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } - if(!vkCreateAndroidSurfaceKHR) - { + if (!vkCreateAndroidSurfaceKHR) { SDL_SetError(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); return SDL_FALSE; @@ -160,8 +158,7 @@ SDL_bool Android_Vulkan_CreateSurface(_THIS, createInfo.window = windowData->native_window; result = vkCreateAndroidSurfaceKHR(instance, &createInfo, NULL, surface); - if(result != VK_SUCCESS) - { + if (result != VK_SUCCESS) { SDL_SetError("vkCreateAndroidSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); return SDL_FALSE; diff --git a/src/video/android/SDL_androidvulkan.h b/src/video/android/SDL_androidvulkan.h index f8f23eee51576..2cf99e8af3bee 100644 --- a/src/video/android/SDL_androidvulkan.h +++ b/src/video/android/SDL_androidvulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,18 +32,18 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_ANDROID +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_ANDROID) int Android_Vulkan_LoadLibrary(_THIS, const char *path); void Android_Vulkan_UnloadLibrary(_THIS); SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names); + SDL_Window *window, + unsigned *count, + const char **names); SDL_bool Android_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface); + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface); #endif diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 21bedca7d80ef..7af56691d127b 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_ANDROID +#ifdef SDL_VIDEO_DRIVER_ANDROID #include "SDL_syswm.h" #include "../SDL_sysvideo.h" @@ -36,8 +36,7 @@ /* Currently only one window */ SDL_Window *Android_Window = NULL; -int -Android_CreateWindow(_THIS, SDL_Window * window) +int Android_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *data; int retval = 0; @@ -59,13 +58,13 @@ Android_CreateWindow(_THIS, SDL_Window * window) window->h = Android_SurfaceHeight; window->flags &= ~SDL_WINDOW_HIDDEN; - window->flags |= SDL_WINDOW_SHOWN; /* only one window on Android */ + window->flags |= SDL_WINDOW_SHOWN; /* only one window on Android */ /* One window, it always has focus */ SDL_SetMouseFocus(window); SDL_SetKeyboardFocus(window); - data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data)); + data = (SDL_WindowData *)SDL_calloc(1, sizeof(*data)); if (!data) { retval = SDL_OutOfMemory(); goto endfunction; @@ -81,9 +80,9 @@ Android_CreateWindow(_THIS, SDL_Window * window) /* Do not create EGLSurface for Vulkan window since it will then make the window incompatible with vkCreateAndroidSurfaceKHR */ -#if SDL_VIDEO_OPENGL_EGL - if ((window->flags & SDL_WINDOW_OPENGL) != 0) { - data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->native_window); +#ifdef SDL_VIDEO_OPENGL_EGL + if (window->flags & SDL_WINDOW_OPENGL) { + data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)data->native_window); if (data->egl_surface == EGL_NO_SURFACE) { ANativeWindow_release(data->native_window); @@ -104,14 +103,12 @@ Android_CreateWindow(_THIS, SDL_Window * window) return retval; } -void -Android_SetWindowTitle(_THIS, SDL_Window *window) +void Android_SetWindowTitle(_THIS, SDL_Window *window) { Android_JNI_SetActivityTitle(window->title); } -void -Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) +void Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_LockMutex(Android_ActivityMutex); @@ -162,8 +159,7 @@ Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display SDL_UnlockMutex(Android_ActivityMutex); } -void -Android_MinimizeWindow(_THIS, SDL_Window *window) +void Android_MinimizeWindow(_THIS, SDL_Window *window) { Android_JNI_MinizeWindow(); } @@ -174,8 +170,7 @@ void Android_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) Android_JNI_SetOrientation(window->w, window->h, window->flags & SDL_WINDOW_RESIZABLE, SDL_GetHint(SDL_HINT_ORIENTATIONS)); } -void -Android_DestroyWindow(_THIS, SDL_Window *window) +void Android_DestroyWindow(_THIS, SDL_Window *window) { SDL_LockMutex(Android_ActivityMutex); @@ -183,9 +178,9 @@ Android_DestroyWindow(_THIS, SDL_Window *window) Android_Window = NULL; if (window->driverdata) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); } @@ -202,16 +197,15 @@ Android_DestroyWindow(_THIS, SDL_Window *window) SDL_UnlockMutex(Android_ActivityMutex); } -SDL_bool -Android_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) +SDL_bool Android_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (info->version.major == SDL_MAJOR_VERSION) { info->subsystem = SDL_SYSWM_ANDROID; info->info.android.window = data->native_window; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL info->info.android.surface = data->egl_surface; #endif diff --git a/src/video/android/SDL_androidwindow.h b/src/video/android/SDL_androidwindow.h index 58e459006ffd3..eddfe7f0d7321 100644 --- a/src/video/android/SDL_androidwindow.h +++ b/src/video/android/SDL_androidwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,13 +38,13 @@ extern SDL_Window *Android_Window; typedef struct { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; EGLContext egl_context; /* We use this to preserve the context when losing focus */ #endif - SDL_bool backup_done; + SDL_bool backup_done; ANativeWindow *native_window; - + } SDL_WindowData; #endif /* SDL_androidwindow_h_ */ diff --git a/src/video/cocoa/SDL_cocoaclipboard.h b/src/video/cocoa/SDL_cocoaclipboard.h index c8c4d68080a37..b3b3d81622a27 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.h +++ b/src/video/cocoa/SDL_cocoaclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoaclipboard.m b/src/video/cocoa/SDL_cocoaclipboard.m index e3878ce8f4c92..5b32bbca02b5d 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.m +++ b/src/video/cocoa/SDL_cocoaclipboard.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,13 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_cocoavideo.h" #include "../../events/SDL_clipboardevents_c.h" -int -Cocoa_SetClipboardText(_THIS, const char *text) +int Cocoa_SetClipboardText(_THIS, const char *text) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -44,8 +43,7 @@ return 0; }} -char * -Cocoa_GetClipboardText(_THIS) +char *Cocoa_GetClipboardText(_THIS) { @autoreleasepool { NSPasteboard *pasteboard; @@ -73,8 +71,7 @@ return text; }} -SDL_bool -Cocoa_HasClipboardText(_THIS) +SDL_bool Cocoa_HasClipboardText(_THIS) { SDL_bool result = SDL_FALSE; char *text = Cocoa_GetClipboardText(_this); @@ -85,8 +82,7 @@ return result; } -void -Cocoa_CheckClipboardUpdate(SDL_VideoData * data) +void Cocoa_CheckClipboardUpdate(SDL_VideoData * data) { @autoreleasepool { NSPasteboard *pasteboard; diff --git a/src/video/cocoa/SDL_cocoaevents.h b/src/video/cocoa/SDL_cocoaevents.h index ae49be099d4ec..e99089ab12527 100644 --- a/src/video/cocoa/SDL_cocoaevents.h +++ b/src/video/cocoa/SDL_cocoaevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 4903a8a040e4a..f97ee63c1fc38 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_timer.h" @@ -46,8 +46,9 @@ if (device && device->windows) { for (sdlwindow = device->windows; sdlwindow; sdlwindow = sdlwindow->next) { NSWindow *nswindow = ((__bridge SDL_WindowData *) sdlwindow->driverdata).nswindow; - if (win == nswindow) + if (win == nswindow) { return sdlwindow; + } } } @@ -137,6 +138,7 @@ @interface SDLAppDelegate : NSObject { - (id)init; - (void)localeDidChange:(NSNotification *)notification; +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app; @end @implementation SDLAppDelegate : NSObject @@ -192,8 +194,9 @@ - (void)windowWillClose:(NSNotification *)notification; } /* Don't do anything if this was not an SDL window that was closed */ - if (FindSDLWindowForNSWindow(win) == NULL) + if (FindSDLWindowForNSWindow(win) == NULL) { return; + } /* HACK: Make the next window in the z-order key when the key window is * closed. The custom event loop and/or windowing code we have seems to @@ -284,9 +287,21 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification /* The menu bar of SDL apps which don't have the typical .app bundle * structure fails to work the first time a window is created (until it's * de-focused and re-focused), if this call is in Cocoa_RegisterApp instead - * of here. https://bugzilla.libsdl.org/show_bug.cgi?id=3051 + * of here. https://github.com/libsdl-org/SDL/issues/1913 */ - if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, SDL_FALSE)) { + + /* this apparently became unnecessary on macOS 14.0, and will addition pop up a + hidden dock if you're moving the mouse during launch, so change the default + behaviour there. https://github.com/libsdl-org/SDL/issues/10340 + (13.6 still needs it, presumably 13.7 does, too.) */ + SDL_bool background_app_default = SDL_FALSE; +#if _SDL_HAS_BUILTIN(__builtin_available) + if (@available(macOS 14.0, *)) { + background_app_default = SDL_TRUE; /* by default, don't explicitly activate the dock and then us again to force to foreground */ + } +#endif + + if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, background_app_default)) { /* Get more aggressive for Catalina: activate the Dock first so we definitely reset all activation state. */ for (NSRunningApplication *i in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.dock"]) { [i activateWithOptions:NSApplicationActivateIgnoringOtherApps]; @@ -308,12 +323,27 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv SDL_SendDropComplete(NULL); } +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app +{ + // This just tells Cocoa that we didn't do any custom save state magic for the app, + // so the system is safe to use NSSecureCoding internally, instead of using unencrypted + // save states for backwards compatibility. If we don't return YES here, we'll get a + // warning on the console at startup: + // + // ``` + // WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES. + // ``` + // + // More-detailed explanation: + // https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate/77320845#77320845 + return YES; +} + @end static SDLAppDelegate *appDelegate = nil; -static NSString * -GetApplicationName(void) +static NSString *GetApplicationName(void) { NSString *appName; @@ -330,9 +360,9 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv return appName; } -static bool -LoadMainMenuNibIfAvailable(void) +static bool LoadMainMenuNibIfAvailable(void) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 NSDictionary *infoDict; NSString *mainNibFileName; bool success = false; @@ -343,17 +373,19 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv infoDict = [[NSBundle mainBundle] infoDictionary]; if (infoDict) { mainNibFileName = [infoDict valueForKey:@"NSMainNibFile"]; - + if (mainNibFileName) { success = [[NSBundle mainBundle] loadNibNamed:mainNibFileName owner:[NSApplication sharedApplication] topLevelObjects:nil]; } } - + return success; +#else + return false; +#endif } -static void -CreateApplicationMenus(void) +static void CreateApplicationMenus(void) { NSString *appName; NSString *title; @@ -366,7 +398,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv if (NSApp == nil) { return; } - + mainMenu = [[NSMenu alloc] init]; /* Create the main menu bar */ @@ -387,7 +419,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv [appleMenu addItem:[NSMenuItem separatorItem]]; serviceMenu = [[NSMenu alloc] initWithTitle:@""]; - menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""]; + menuItem = [appleMenu addItemWithTitle:@"Services" action:nil keyEquivalent:@""]; [menuItem setSubmenu:serviceMenu]; [NSApp setServicesMenu:serviceMenu]; @@ -424,7 +456,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv [windowMenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; [windowMenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""]; - + /* Add the fullscreen toggle menu option. */ /* Cocoa should update the title to Enter or Exit Full Screen automatically. * But if not, then just fallback to Toggle Full Screen. @@ -442,8 +474,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv [NSApp setWindowsMenu:windowMenu]; } -void -Cocoa_RegisterApp(void) +void Cocoa_RegisterApp(void) { @autoreleasepool { /* This can get called more than once! Be careful what you initialize! */ @@ -464,7 +495,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv */ if ([NSApp mainMenu] == nil) { bool nibLoaded; - + nibLoaded = LoadMainMenuNibIfAvailable(); if (!nibLoaded) { CreateApplicationMenus(); @@ -501,8 +532,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv } }} -int -Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate) +int Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate) { for ( ; ; ) { NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:expiration inMode:NSDefaultRunLoopMode dequeue:YES ]; @@ -523,8 +553,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv return 1; } -int -Cocoa_WaitEventTimeout(_THIS, int timeout) +int Cocoa_WaitEventTimeout(_THIS, int timeout) { @autoreleasepool { if (timeout > 0) { @@ -539,8 +568,7 @@ - (void)handleURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEv return 1; }} -void -Cocoa_PumpEvents(_THIS) +void Cocoa_PumpEvents(_THIS) { @autoreleasepool { Cocoa_PumpEventsUntilDate(_this, [NSDate distantPast], true); @@ -562,8 +590,7 @@ void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window) [NSApp postEvent: event atStart: YES]; }} -void -Cocoa_SuspendScreenSaver(_THIS) +void Cocoa_SuspendScreenSaver(_THIS) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *)_this->driverdata; diff --git a/src/video/cocoa/SDL_cocoakeyboard.h b/src/video/cocoa/SDL_cocoakeyboard.h index e3b8460b7180e..62d6f0383e466 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.h +++ b/src/video/cocoa/SDL_cocoakeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 096b71a4c34b0..2a676322837fe 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_cocoavideo.h" @@ -182,53 +182,61 @@ - (NSArray *)validAttributesForMarkedText @end -static void -HandleModifiers(_THIS, unsigned short scancode, unsigned int modifierFlags) +static bool IsModifierKeyPressed(unsigned int flags, + unsigned int target_mask, + unsigned int other_mask, + unsigned int either_mask) { - SDL_Scancode code = darwin_scancode_table[scancode]; - - const SDL_Scancode codes[] = { - SDL_SCANCODE_LSHIFT, - SDL_SCANCODE_LCTRL, - SDL_SCANCODE_LALT, - SDL_SCANCODE_LGUI, - SDL_SCANCODE_RSHIFT, - SDL_SCANCODE_RCTRL, - SDL_SCANCODE_RALT, - SDL_SCANCODE_RGUI, - SDL_SCANCODE_LSHIFT, - SDL_SCANCODE_LCTRL, - SDL_SCANCODE_LALT, - SDL_SCANCODE_LGUI, }; - - const unsigned int modifiers[] = { - NX_DEVICELSHIFTKEYMASK, - NX_DEVICELCTLKEYMASK, - NX_DEVICELALTKEYMASK, - NX_DEVICELCMDKEYMASK, - NX_DEVICERSHIFTKEYMASK, - NX_DEVICERCTLKEYMASK, - NX_DEVICERALTKEYMASK, - NX_DEVICERCMDKEYMASK, - NX_SHIFTMASK, - NX_CONTROLMASK, - NX_ALTERNATEMASK, - NX_COMMANDMASK }; - - for (int i = 0; i < 12; i++) - { - if (code == codes[i]) - { - if (modifierFlags & modifiers[i]) - SDL_SendKeyboardKey(SDL_PRESSED, code); - else - SDL_SendKeyboardKey(SDL_RELEASED, code); - } + bool target_pressed = (flags & target_mask) != 0; + bool other_pressed = (flags & other_mask) != 0; + bool either_pressed = (flags & either_mask) != 0; + + if (either_pressed != (target_pressed || other_pressed)) + return either_pressed; + + return target_pressed; +} + +static void HandleModifiers(_THIS, SDL_Scancode code, unsigned int modifierFlags) +{ + bool pressed = false; + + if (code == SDL_SCANCODE_LSHIFT) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICELSHIFTKEYMASK, + NX_DEVICERSHIFTKEYMASK, NX_SHIFTMASK); + } else if (code == SDL_SCANCODE_LCTRL) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICELCTLKEYMASK, + NX_DEVICERCTLKEYMASK, NX_CONTROLMASK); + } else if (code == SDL_SCANCODE_LALT) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICELALTKEYMASK, + NX_DEVICERALTKEYMASK, NX_ALTERNATEMASK); + } else if (code == SDL_SCANCODE_LGUI) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICELCMDKEYMASK, + NX_DEVICERCMDKEYMASK, NX_COMMANDMASK); + } else if (code == SDL_SCANCODE_RSHIFT) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICERSHIFTKEYMASK, + NX_DEVICELSHIFTKEYMASK, NX_SHIFTMASK); + } else if (code == SDL_SCANCODE_RCTRL) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICERCTLKEYMASK, + NX_DEVICELCTLKEYMASK, NX_CONTROLMASK); + } else if (code == SDL_SCANCODE_RALT) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICERALTKEYMASK, + NX_DEVICELALTKEYMASK, NX_ALTERNATEMASK); + } else if (code == SDL_SCANCODE_RGUI) { + pressed = IsModifierKeyPressed(modifierFlags, NX_DEVICERCMDKEYMASK, + NX_DEVICELCMDKEYMASK, NX_COMMANDMASK); + } else { + return; + } + + if (pressed) { + SDL_SendKeyboardKey(SDL_PRESSED, code); + } else { + SDL_SendKeyboardKey(SDL_RELEASED, code); } } -static void -UpdateKeymap(SDL_VideoData *data, SDL_bool send_event) +static void UpdateKeymap(SDL_VideoData *data, SDL_bool send_event) { TISInputSourceRef key_layout; const void *chr_data; @@ -270,6 +278,17 @@ - (NSArray *)validAttributesForMarkedText continue; } + /* + * Swap the scancode for these two wrongly translated keys + * UCKeyTranslate() function does not do its job properly for ISO layout keyboards, where the key '@', + * which is located in the top left corner of the keyboard right under the Escape key, and the additional + * key '<', which is on the right of the Shift key, are inverted + */ + if ((scancode == SDL_SCANCODE_NONUSBACKSLASH || scancode == SDL_SCANCODE_GRAVE) && KBGetLayoutType(LMGetKbdType()) == kKeyboardISO) { + /* see comments in scancodes_darwin.h */ + scancode = (SDL_Scancode)((SDL_SCANCODE_NONUSBACKSLASH + SDL_SCANCODE_GRAVE) - scancode); + } + dead_key_state = 0; err = UCKeyTranslate ((UCKeyboardLayout *) chr_data, i, kUCKeyActionDown, @@ -292,8 +311,7 @@ - (NSArray *)validAttributesForMarkedText CFRelease(key_layout); } -void -Cocoa_InitKeyboard(_THIS) +void Cocoa_InitKeyboard(_THIS) { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -308,11 +326,10 @@ - (NSArray *)validAttributesForMarkedText SDL_SetScancodeName(SDL_SCANCODE_RGUI, "Right Command"); data.modifierFlags = (unsigned int)[NSEvent modifierFlags]; - SDL_ToggleModState(KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) != 0); + SDL_ToggleModState(KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE); } -void -Cocoa_StartTextInput(_THIS) +void Cocoa_StartTextInput(_THIS) { @autoreleasepool { NSView *parentView; @@ -343,8 +360,7 @@ - (NSArray *)validAttributesForMarkedText } }} -void -Cocoa_StopTextInput(_THIS) +void Cocoa_StopTextInput(_THIS) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -355,8 +371,7 @@ - (NSArray *)validAttributesForMarkedText } }} -void -Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect) +void Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect) { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -368,8 +383,7 @@ - (NSArray *)validAttributesForMarkedText [data.fieldEdit setInputRect:rect]; } -void -Cocoa_HandleKeyEvent(_THIS, NSEvent *event) +void Cocoa_HandleKeyEvent(_THIS, NSEvent *event) { unsigned short scancode; SDL_Scancode code; @@ -384,7 +398,7 @@ - (NSArray *)validAttributesForMarkedText #endif if ((scancode == 10 || scancode == 50) && KBGetLayoutType(LMGetKbdType()) == kKeyboardISO) { - /* see comments in SDL_cocoakeys.h */ + /* see comments in scancodes_darwin.h */ scancode = 60 - scancode; } @@ -423,16 +437,25 @@ - (NSArray *)validAttributesForMarkedText case NSEventTypeKeyUp: SDL_SendKeyboardKey(SDL_RELEASED, code); break; - case NSEventTypeFlagsChanged: - HandleModifiers(_this, scancode, (unsigned int)[event modifierFlags]); + case NSEventTypeFlagsChanged: { + // see if the new modifierFlags mean any existing keys should be pressed/released... + const unsigned int modflags = (unsigned int)[event modifierFlags]; + HandleModifiers(_this, SDL_SCANCODE_LSHIFT, modflags); + HandleModifiers(_this, SDL_SCANCODE_LCTRL, modflags); + HandleModifiers(_this, SDL_SCANCODE_LALT, modflags); + HandleModifiers(_this, SDL_SCANCODE_LGUI, modflags); + HandleModifiers(_this, SDL_SCANCODE_RSHIFT, modflags); + HandleModifiers(_this, SDL_SCANCODE_RCTRL, modflags); + HandleModifiers(_this, SDL_SCANCODE_RALT, modflags); + HandleModifiers(_this, SDL_SCANCODE_RGUI, modflags); break; + } default: /* just to avoid compiler warnings */ break; } } -void -Cocoa_QuitKeyboard(_THIS) +void Cocoa_QuitKeyboard(_THIS) { } @@ -445,10 +468,9 @@ - (NSArray *)validAttributesForMarkedText extern CGSConnection _CGSDefaultConnection(void); extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection, CGSGlobalHotKeyOperatingMode mode); -void -Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { -#if SDL_MAC_NO_SANDBOX +#ifdef SDL_MAC_NO_SANDBOX CGSSetGlobalHotKeyOperatingMode(_CGSDefaultConnection(), grabbed ? CGSGlobalHotKeyDisable : CGSGlobalHotKeyEnable); #endif } diff --git a/src/video/cocoa/SDL_cocoamessagebox.h b/src/video/cocoa/SDL_cocoamessagebox.h index 439a68a80255d..501ffa50208eb 100644 --- a/src/video/cocoa/SDL_cocoamessagebox.h +++ b/src/video/cocoa/SDL_cocoamessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA extern int Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/cocoa/SDL_cocoamessagebox.m b/src/video/cocoa/SDL_cocoamessagebox.m index 1f8eddc3aff4b..20eabe3eeece5 100644 --- a/src/video/cocoa/SDL_cocoamessagebox.m +++ b/src/video/cocoa/SDL_cocoamessagebox.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_events.h" #include "SDL_timer.h" @@ -32,8 +32,10 @@ @interface SDLMessageBoxPresenter : NSObject { NSInteger clicked; NSWindow *nswindow; } -- (id) initWithParentWindow:(SDL_Window *)window; -- (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; +- (id)initWithParentWindow:(SDL_Window *)window; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 +- (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; +#endif @end @implementation SDLMessageBoxPresenter @@ -57,11 +59,12 @@ - (id) initWithParentWindow:(SDL_Window *)window - (void)showAlert:(NSAlert*)alert { if (nswindow) { -#ifdef MAC_OS_X_VERSION_10_9 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1090 if ([alert respondsToSelector:@selector(beginSheetModalForWindow:completionHandler:)]) { - [alert beginSheetModalForWindow:nswindow completionHandler:^(NSModalResponse returnCode) { - self->clicked = returnCode; - }]; + [alert beginSheetModalForWindow:nswindow + completionHandler:^(NSModalResponse returnCode) { + [NSApp stopModalWithCode:returnCode]; + }]; } else #endif { @@ -69,28 +72,23 @@ - (void)showAlert:(NSAlert*)alert [alert beginSheetModalForWindow:nswindow modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil]; #endif } - - while (clicked < 0) { - SDL_PumpEvents(); - SDL_Delay(100); - } - + clicked = [NSApp runModalForWindow:nswindow]; nswindow = nil; } else { clicked = [alert runModal]; } } +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 - (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { - clicked = returnCode; + [NSApp stopModalWithCode:returnCode]; } - +#endif @end -static void -Cocoa_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid, int *returnValue) +static void Cocoa_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid, int *returnValue) { NSAlert* alert; const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; @@ -150,8 +148,7 @@ - (void) alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextIn } /* Display a Cocoa message box */ -int -Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int Cocoa_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { @autoreleasepool { __block int returnValue = 0; diff --git a/src/video/cocoa/SDL_cocoametalview.h b/src/video/cocoa/SDL_cocoametalview.h index 326c6a3ce8bb5..b8b6b7a24ae52 100644 --- a/src/video/cocoa/SDL_cocoametalview.h +++ b/src/video/cocoa/SDL_cocoametalview.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ #ifndef SDL_cocoametalview_h_ #define SDL_cocoametalview_h_ -#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) +#if defined(SDL_VIDEO_DRIVER_COCOA) && (defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)) #import "../SDL_sysvideo.h" diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m index 2898485612642..9591f9771b1cc 100644 --- a/src/video/cocoa/SDL_cocoametalview.m +++ b/src/video/cocoa/SDL_cocoametalview.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,7 @@ #import "SDL_cocoametalview.h" -#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) +#if defined(SDL_VIDEO_DRIVER_COCOA) && (defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)) #include "SDL_events.h" #include "SDL_syswm.h" @@ -81,7 +81,8 @@ - (instancetype)initWithFrame:(NSRect)frame highDPI:(BOOL)highDPI windowID:(Uint32)windowID; { - if ((self = [super initWithFrame:frame])) { + self = [super initWithFrame:frame]; + if (self != nil) { self.highDPI = highDPI; self.sdlWindowID = windowID; self.wantsLayer = YES; @@ -93,7 +94,7 @@ - (instancetype)initWithFrame:(NSRect)frame [self updateDrawableSize]; } - + return self; } @@ -130,8 +131,7 @@ - (NSView *)hitTest:(NSPoint)point { @end -SDL_MetalView -Cocoa_Metal_CreateView(_THIS, SDL_Window * window) +SDL_MetalView Cocoa_Metal_CreateView(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData* data = (__bridge SDL_WindowData *)window->driverdata; NSView *view = data.nswindow.contentView; @@ -144,32 +144,33 @@ - (NSView *)hitTest:(NSPoint)point { highDPI:highDPI windowID:windowID]; if (newview == nil) { + SDL_OutOfMemory(); return NULL; } [view addSubview:newview]; + /* Make sure the drawable size is up to date after attaching the view. */ + [newview updateDrawableSize]; + metalview = (SDL_MetalView)CFBridgingRetain(newview); return metalview; }} -void -Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view) +void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view) { @autoreleasepool { SDL_cocoametalview *metalview = CFBridgingRelease(view); [metalview removeFromSuperview]; }} -void * -Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view) +void *Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view) { @autoreleasepool { SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view; return (__bridge void *)cocoaview.layer; }} -void -Cocoa_Metal_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) +void Cocoa_Metal_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; NSView *contentView = data.sdlContentView; diff --git a/src/video/cocoa/SDL_cocoamodes.h b/src/video/cocoa/SDL_cocoamodes.h index a4176dee857cf..dc6273d5e162b 100644 --- a/src/video/cocoa/SDL_cocoamodes.h +++ b/src/video/cocoa/SDL_cocoamodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 072afc8e7b136..fa5b184582422 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_cocoavideo.h" @@ -42,8 +42,7 @@ #endif -static int -CG_SetError(const char *prefix, CGDisplayErr result) +static int CG_SetError(const char *prefix, CGDisplayErr result) { const char *error; @@ -85,8 +84,7 @@ return SDL_SetError("%s: %s", prefix, error); } -static int -GetDisplayModeRefreshRate(CGDisplayModeRef vidmode, CVDisplayLinkRef link) +static int GetDisplayModeRefreshRate(CGDisplayModeRef vidmode, CVDisplayLinkRef link) { int refreshRate = (int) (CGDisplayModeGetRefreshRate(vidmode) + 0.5); @@ -101,8 +99,7 @@ return refreshRate; } -static SDL_bool -HasValidDisplayModeFlags(CGDisplayModeRef vidmode) +static SDL_bool HasValidDisplayModeFlags(CGDisplayModeRef vidmode) { uint32_t ioflags = CGDisplayModeGetIOFlags(vidmode); @@ -119,8 +116,7 @@ return SDL_TRUE; } -static Uint32 -GetDisplayModePixelFormat(CGDisplayModeRef vidmode) +static Uint32 GetDisplayModePixelFormat(CGDisplayModeRef vidmode) { /* This API is deprecated in 10.11 with no good replacement (as of 10.15). */ CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode); @@ -144,8 +140,7 @@ return pixelformat; } -static SDL_bool -GetDisplayMode(_THIS, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode) +static SDL_bool GetDisplayMode(_THIS, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode) { SDL_DisplayModeData *data; bool usableForGUI = CGDisplayModeIsUsableForDesktopGUI(vidmode); @@ -283,8 +278,7 @@ return SDL_TRUE; } -static const char * -Cocoa_GetDisplayName(CGDirectDisplayID displayID) +static const char *Cocoa_GetDisplayName(CGDirectDisplayID displayID) { /* This API is deprecated in 10.9 with no good replacement (as of 10.15). */ io_service_t servicePort = CGDisplayIOServicePort(displayID); @@ -299,8 +293,7 @@ return displayName; } -void -Cocoa_InitModes(_THIS) +void Cocoa_InitModes(_THIS) { @autoreleasepool { CGDisplayErr result; @@ -384,8 +377,7 @@ SDL_small_free(displays, isstack); }} -int -Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) { SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; CGRect cgrect; @@ -398,8 +390,7 @@ return 0; } -int -Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) { SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; const CGDirectDisplayID cgdisplay = displaydata->display; @@ -431,8 +422,7 @@ return 0; } -int -Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi) +int Cocoa_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi) { @autoreleasepool { const float MM_IN_INCH = 25.4f; @@ -445,7 +435,7 @@ NSSize displayNativeSize; displayNativeSize.width = (int) CGDisplayPixelsWide(data->display); displayNativeSize.height = (int) CGDisplayPixelsHigh(data->display); - + for (NSScreen *screen in screens) { const CGDirectDisplayID dpyid = (const CGDirectDisplayID ) [[[screen deviceDescription] objectForKey:@"NSScreenNumber"] unsignedIntValue]; if (dpyid == data->display) { @@ -462,7 +452,7 @@ CGFloat width = CGDisplayModeGetPixelWidth(m); CGFloat height = CGDisplayModeGetPixelHeight(m); CGFloat HiDPIWidth = CGDisplayModeGetWidth(m); - + //Only check 1x mode if(width == HiDPIWidth) { if (CGDisplayModeGetIOFlags(m) & kDisplayModeNativeFlag) { @@ -470,7 +460,7 @@ displayNativeSize.height = height; break; } - + //Get the largest size even if kDisplayModeNativeFlag is not present e.g. iMac 27-Inch with 5K Retina if(width > displayNativeSize.width) { displayNativeSize.width = width; @@ -510,8 +500,7 @@ return 0; }} -void -Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay * display) { SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; CVDisplayLinkRef link = NULL; @@ -591,8 +580,7 @@ CVDisplayLinkRelease(link); } -static CGError -SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayModeData *data) +static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayModeData *data) { /* SDL_DisplayModeData can contain multiple CGDisplayModes to try (with * identical properties), some of which might not work. See GetDisplayMode. @@ -610,8 +598,7 @@ return result; } -int -Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata; @@ -676,8 +663,7 @@ return -1; } -void -Cocoa_QuitModes(_THIS) +void Cocoa_QuitModes(_THIS) { int i, j; diff --git a/src/video/cocoa/SDL_cocoamouse.h b/src/video/cocoa/SDL_cocoamouse.h index f6dcdc04542f6..4fee8655e7c61 100644 --- a/src/video/cocoa/SDL_cocoamouse.h +++ b/src/video/cocoa/SDL_cocoamouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -40,6 +40,8 @@ typedef struct { /* What location we last saw the cursor move to. */ CGFloat lastMoveX; CGFloat lastMoveY; + /* If we just turned on relative mode, and should skip a single mouse motion event. */ + SDL_bool justEnabledRelative; } SDL_MouseData; @interface NSCursor (InvisibleCursor) diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index da5ffac69c59c..e70c40956ad1f 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_events.h" #include "SDL_cocoamouse.h" @@ -63,8 +63,7 @@ + (NSCursor *)invisibleCursor @end -static SDL_Cursor * -Cocoa_CreateDefaultCursor() +static SDL_Cursor *Cocoa_CreateDefaultCursor() { @autoreleasepool { NSCursor *nscursor; @@ -82,8 +81,7 @@ + (NSCursor *)invisibleCursor return cursor; }} -static SDL_Cursor * -Cocoa_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *Cocoa_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) { @autoreleasepool { NSImage *nsimage; @@ -108,8 +106,7 @@ + (NSCursor *)invisibleCursor /* there are .pdf files of some of the cursors we need, installed by default on macOS, but not available through NSCursor. If we can load them ourselves, use them, otherwise fallback to something standard but not super-great. Since these are under /System, they should be available even to sandboxed apps. */ -static NSCursor * -LoadHiddenSystemCursor(NSString *cursorName, SEL fallback) +static NSCursor *LoadHiddenSystemCursor(NSString *cursorName, SEL fallback) { NSString *cursorPath = [@"/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Resources/cursors" stringByAppendingPathComponent:cursorName]; NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile:[cursorPath stringByAppendingPathComponent:@"info.plist"]]; @@ -146,8 +143,7 @@ + (NSCursor *)invisibleCursor return cursor; } -static SDL_Cursor * -Cocoa_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *Cocoa_CreateSystemCursor(SDL_SystemCursor id) { @autoreleasepool { NSCursor *nscursor = NULL; @@ -206,16 +202,14 @@ + (NSCursor *)invisibleCursor return cursor; }} -static void -Cocoa_FreeCursor(SDL_Cursor * cursor) +static void Cocoa_FreeCursor(SDL_Cursor * cursor) { @autoreleasepool { CFBridgingRelease(cursor->driverdata); SDL_free(cursor); }} -static int -Cocoa_ShowCursor(SDL_Cursor * cursor) +static int Cocoa_ShowCursor(SDL_Cursor * cursor) { @autoreleasepool { SDL_VideoDevice *device = SDL_GetVideoDevice(); @@ -231,8 +225,7 @@ + (NSCursor *)invisibleCursor return 0; }} -static SDL_Window * -SDL_FindWindowAtPoint(const int x, const int y) +static SDL_Window *SDL_FindWindowAtPoint(const int x, const int y) { const SDL_Point pt = { x, y }; SDL_Window *i; @@ -246,8 +239,7 @@ + (NSCursor *)invisibleCursor return NULL; } -static int -Cocoa_WarpMouseGlobal(int x, int y) +static int Cocoa_WarpMouseGlobal(int x, int y) { CGPoint point; SDL_Mouse *mouse = SDL_GetMouse(); @@ -288,19 +280,26 @@ + (NSCursor *)invisibleCursor return 0; } -static void -Cocoa_WarpMouse(SDL_Window * window, int x, int y) +static void Cocoa_WarpMouse(SDL_Window * window, int x, int y) { Cocoa_WarpMouseGlobal(window->x + x, window->y + y); } -static int -Cocoa_SetRelativeMouseMode(SDL_bool enabled) +static int Cocoa_SetRelativeMouseMode(SDL_bool enabled) { + SDL_Window *window = SDL_GetKeyboardFocus(); CGError result; - SDL_Window *window; SDL_WindowData *data; if (enabled) { + if (window) { + /* make sure the mouse isn't at the corner of the window, as this can confuse things if macOS thinks a window resize is happening on the first click. */ + SDL_MouseData *mousedriverdata = (SDL_MouseData*)SDL_GetMouse()->driverdata; + const CGPoint point = CGPointMake((float)(window->x + (window->w / 2)), (float)(window->y + (window->h / 2))); + if (mousedriverdata) { + mousedriverdata->justEnabledRelative = SDL_TRUE; + } + CGWarpMouseCursorPosition(point); + } DLog("Turning on."); result = CGAssociateMouseAndMouseCursorPosition(NO); } else { @@ -314,7 +313,6 @@ + (NSCursor *)invisibleCursor /* We will re-apply the non-relative mode when the window gets focus, if it * doesn't have focus right now. */ - window = SDL_GetKeyboardFocus(); if (!window) { return 0; } @@ -338,16 +336,14 @@ + (NSCursor *)invisibleCursor return 0; } -static int -Cocoa_CaptureMouse(SDL_Window *window) +static int Cocoa_CaptureMouse(SDL_Window *window) { /* our Cocoa event code already tracks the mouse outside the window, so all we have to do here is say "okay" and do what we always do. */ return 0; } -static Uint32 -Cocoa_GetGlobalMouseState(int *x, int *y) +static Uint32 Cocoa_GetGlobalMouseState(int *x, int *y) { const NSUInteger cocoaButtons = [NSEvent pressedMouseButtons]; const NSPoint cocoaLocation = [NSEvent mouseLocation]; @@ -365,8 +361,7 @@ + (NSCursor *)invisibleCursor return retval; } -int -Cocoa_InitMouse(_THIS) +int Cocoa_InitMouse(_THIS) { NSPoint location; SDL_Mouse *mouse = SDL_GetMouse(); @@ -394,8 +389,7 @@ + (NSCursor *)invisibleCursor return 0; } -static void -Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event) +static void Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event) { SDL_Window *window; NSWindow *nswindow = [event window]; @@ -428,8 +422,7 @@ + (NSCursor *)invisibleCursor } } -void -Cocoa_HandleMouseEvent(_THIS, NSEvent *event) +void Cocoa_HandleMouseEvent(_THIS, NSEvent *event) { SDL_Mouse *mouse; SDL_MouseData *driverdata; @@ -475,6 +468,11 @@ + (NSCursor *)invisibleCursor seenWarp = driverdata->seenWarp; driverdata->seenWarp = NO; + if (driverdata->justEnabledRelative) { + driverdata->justEnabledRelative = SDL_FALSE; + return; // dump the first event back. + } + location = [NSEvent mouseLocation]; lastMoveX = driverdata->lastMoveX; lastMoveY = driverdata->lastMoveY; @@ -508,8 +506,7 @@ + (NSCursor *)invisibleCursor SDL_SendMouseMotion(mouse->focus, mouseID, 1, (int)deltaX, (int)deltaY); } -void -Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) +void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) { SDL_MouseID mouseID; SDL_MouseWheelDirection direction; @@ -546,8 +543,7 @@ + (NSCursor *)invisibleCursor SDL_SendMouseWheel(window, mouseID, x, y, direction); } -void -Cocoa_HandleMouseWarp(CGFloat x, CGFloat y) +void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y) { /* This makes Cocoa_HandleMouseEvent ignore the delta caused by the warp, * since it gets included in the next movement event. @@ -560,8 +556,7 @@ + (NSCursor *)invisibleCursor DLog("(%g, %g)", x, y); } -void -Cocoa_QuitMouse(_THIS) +void Cocoa_QuitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse) { diff --git a/src/video/cocoa/SDL_cocoaopengl.h b/src/video/cocoa/SDL_cocoaopengl.h index 7b900dee63b01..f152a726c0449 100644 --- a/src/video/cocoa/SDL_cocoaopengl.h +++ b/src/video/cocoa/SDL_cocoaopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,10 +23,11 @@ #ifndef SDL_cocoaopengl_h_ #define SDL_cocoaopengl_h_ -#if SDL_VIDEO_OPENGL_CGL +#ifdef SDL_VIDEO_OPENGL_CGL #include "SDL_atomic.h" #import +#import /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ #ifdef __clang__ @@ -57,7 +58,10 @@ struct SDL_GLDriverData - (void)setWindow:(SDL_Window *)window; - (SDL_Window*)window; - (void)explicitUpdate; -- (void)dealloc; +- (void)cleanup; + +@property (retain, nonatomic) NSOpenGLPixelFormat* openglPixelFormat; // macOS 10.10 has -[NSOpenGLContext pixelFormat] but this handles older OS releases. + @end /* OpenGL functions */ diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 607f307161645..ffc59e671ffd5 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ /* NSOpenGL implementation of SDL OpenGL support */ -#if SDL_VIDEO_OPENGL_CGL +#ifdef SDL_VIDEO_OPENGL_CGL #include "SDL_cocoavideo.h" #include "SDL_cocoaopengl.h" #include "SDL_cocoaopengles.h" @@ -44,6 +44,16 @@ #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif +/* _Nullable is available starting Xcode 7 */ +#ifdef __has_feature +#if __has_feature(nullability) +#define HAS_FEATURE_NULLABLE +#endif +#endif +#ifndef HAS_FEATURE_NULLABLE +#define _Nullable +#endif + static SDL_bool SDL_opengl_async_dispatch = SDL_FALSE; static void SDLCALL @@ -52,8 +62,7 @@ SDL_opengl_async_dispatch = SDL_GetStringBoolean(hint, SDL_FALSE); } -static CVReturn -DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) +static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *) displayLinkContext; @@ -76,6 +85,7 @@ - (id)initWithFormat:(NSOpenGLPixelFormat *)format { self = [super initWithFormat:format shareContext:share]; if (self) { + self.openglPixelFormat = format; SDL_AtomicSet(&self->dirty, 0); self->window = NULL; SDL_AtomicSet(&self->swapIntervalSetting, 0); @@ -100,7 +110,7 @@ - (id)initWithFormat:(NSOpenGLPixelFormat *)format - (void)movedToNewScreen { if (self->displayLink) { - CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [[self pixelFormat] CGLPixelFormatObj]); + CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(self->displayLink, [self CGLContextObj], [[self openglPixelFormat] CGLPixelFormatObj]); } } @@ -165,11 +175,10 @@ - (void)setWindow:(SDL_Window *)newWindow } } } else { - [self clearDrawable]; - if (self == [NSOpenGLContext currentContext]) { - [self explicitUpdate]; + if ([NSThread isMainThread]) { + [self setView:nil]; } else { - [self scheduleUpdate]; + dispatch_sync(dispatch_get_main_queue(), ^{ [self setView:nil]; }); } } } @@ -192,25 +201,29 @@ - (void)explicitUpdate } } -- (void)dealloc +- (void)cleanup { + [self setWindow:NULL]; + SDL_DelHintCallback(SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH, SDL_OpenGLAsyncDispatchChanged, NULL); if (self->displayLink) { CVDisplayLinkRelease(self->displayLink); + self->displayLink = nil; } if (self->swapIntervalCond) { SDL_DestroyCond(self->swapIntervalCond); + self->swapIntervalCond = NULL; } if (self->swapIntervalMutex) { SDL_DestroyMutex(self->swapIntervalMutex); + self->swapIntervalMutex = NULL; } } @end -int -Cocoa_GL_LoadLibrary(_THIS, const char *path) +int Cocoa_GL_LoadLibrary(_THIS, const char *path) { /* Load the OpenGL library */ if (path == NULL) { @@ -228,21 +241,18 @@ - (void)dealloc return 0; } -void * -Cocoa_GL_GetProcAddress(_THIS, const char *proc) +void *Cocoa_GL_GetProcAddress(_THIS, const char *proc) { return SDL_LoadFunction(_this->gl_config.dll_handle, proc); } -void -Cocoa_GL_UnloadLibrary(_THIS) +void Cocoa_GL_UnloadLibrary(_THIS) { SDL_UnloadObject(_this->gl_config.dll_handle); _this->gl_config.dll_handle = NULL; } -SDL_GLContext -Cocoa_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window * window) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); @@ -260,7 +270,7 @@ - (void)dealloc int interval; if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Switch to EGL based functions */ Cocoa_GL_UnloadLibrary(_this); _this->GL_LoadLibrary = Cocoa_GLES_LoadLibrary; @@ -272,7 +282,7 @@ - (void)dealloc _this->GL_GetSwapInterval = Cocoa_GLES_GetSwapInterval; _this->GL_SwapWindow = Cocoa_GLES_SwapWindow; _this->GL_DeleteContext = Cocoa_GLES_DeleteContext; - + if (Cocoa_GLES_LoadLibrary(_this, NULL) != 0) { return NULL; } @@ -369,8 +379,8 @@ - (void)dealloc interval = 0; [context setValues:&interval forParameter:NSOpenGLCPSwapInterval]; - if ( Cocoa_GL_MakeCurrent(_this, window, (__bridge SDL_GLContext)context) < 0 ) { - Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); + if (Cocoa_GL_MakeCurrent(_this, window, sdlcontext) < 0) { + SDL_GL_DeleteContext(sdlcontext); SDL_SetError("Failed making OpenGL context current"); return NULL; } @@ -384,27 +394,27 @@ - (void)dealloc glGetStringFunc = (const GLubyte *(APIENTRY *)(GLenum)) SDL_GL_GetProcAddress("glGetString"); if (!glGetStringFunc) { - Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); + SDL_GL_DeleteContext(sdlcontext); SDL_SetError ("Failed getting OpenGL glGetString entry point"); return NULL; } glversion = (const char *)glGetStringFunc(GL_VERSION); if (glversion == NULL) { - Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); + SDL_GL_DeleteContext(sdlcontext); SDL_SetError ("Failed getting OpenGL context version"); return NULL; } if (SDL_sscanf(glversion, "%d.%d", &glversion_major, &glversion_minor) != 2) { - Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); + SDL_GL_DeleteContext(sdlcontext); SDL_SetError ("Failed parsing OpenGL context version"); return NULL; } if ((glversion_major < _this->gl_config.major_version) || ((glversion_major == _this->gl_config.major_version) && (glversion_minor < _this->gl_config.minor_version))) { - Cocoa_GL_DeleteContext(_this, (__bridge SDL_GLContext)context); + SDL_GL_DeleteContext(sdlcontext); SDL_SetError ("Failed creating OpenGL context at version requested"); return NULL; } @@ -418,8 +428,7 @@ - (void)dealloc return sdlcontext; }} -int -Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int Cocoa_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { @autoreleasepool { if (context) { @@ -436,8 +445,7 @@ - (void)dealloc return 0; }} -int -Cocoa_GL_SetSwapInterval(_THIS, int interval) +int Cocoa_GL_SetSwapInterval(_THIS, int interval) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *) SDL_GL_GetCurrentContext(); @@ -456,16 +464,14 @@ - (void)dealloc return status; }} -int -Cocoa_GL_GetSwapInterval(_THIS) +int Cocoa_GL_GetSwapInterval(_THIS) { @autoreleasepool { SDLOpenGLContext* nscontext = (__bridge SDLOpenGLContext*)SDL_GL_GetCurrentContext(); return nscontext ? SDL_AtomicGet(&nscontext->swapIntervalSetting) : 0; }} -int -Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) +int Cocoa_GL_SwapWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDLOpenGLContext* nscontext = (__bridge SDLOpenGLContext*)SDL_GL_GetCurrentContext(); @@ -501,13 +507,31 @@ - (void)dealloc return 0; }} -void -Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) -{ @autoreleasepool +static void DispatchedDeleteContext(SDL_GLContext context) { - SDLOpenGLContext *nscontext = (SDLOpenGLContext *)CFBridgingRelease(context); - [nscontext setWindow:NULL]; -}} + @autoreleasepool { + SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)context; + [nscontext cleanup]; + CFRelease(context); + } +} + +void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) +{ + if ([NSThread isMainThread]) { + DispatchedDeleteContext(context); + } else { + if (SDL_opengl_async_dispatch) { + dispatch_async(dispatch_get_main_queue(), ^{ + DispatchedDeleteContext(context); + }); + } else { + dispatch_sync(dispatch_get_main_queue(), ^{ + DispatchedDeleteContext(context); + }); + } + } +} /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ #ifdef __clang__ diff --git a/src/video/cocoa/SDL_cocoaopengles.h b/src/video/cocoa/SDL_cocoaopengles.h index bfabb6d57f9d0..8ec93a3c3620e 100644 --- a/src/video/cocoa/SDL_cocoaopengles.h +++ b/src/video/cocoa/SDL_cocoaopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_cocoaopengles_h_ #define SDL_cocoaopengles_h_ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m index bdf2e9a084bb3..074646037d467 100644 --- a/src/video/cocoa/SDL_cocoaopengles.m +++ b/src/video/cocoa/SDL_cocoaopengles.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_COCOA) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_cocoavideo.h" #include "SDL_cocoaopengles.h" @@ -28,12 +28,11 @@ /* EGL implementation of SDL OpenGL support */ -int -Cocoa_GLES_LoadLibrary(_THIS, const char *path) +int Cocoa_GLES_LoadLibrary(_THIS, const char *path) { /* If the profile requested is not GL ES, switch over to WIN_GL functions */ if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { -#if SDL_VIDEO_OPENGL_CGL +#ifdef SDL_VIDEO_OPENGL_CGL Cocoa_GLES_UnloadLibrary(_this); _this->GL_LoadLibrary = Cocoa_GL_LoadLibrary; _this->GL_GetProcAddress = Cocoa_GL_GetProcAddress; @@ -49,7 +48,7 @@ return SDL_SetError("SDL not configured with OpenGL/CGL support"); #endif } - + if (_this->egl_data == NULL) { return SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0); } @@ -57,14 +56,13 @@ return 0; } -SDL_GLContext -Cocoa_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext Cocoa_GLES_CreateContext(_THIS, SDL_Window * window) { @autoreleasepool { SDL_GLContext context; SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; -#if SDL_VIDEO_OPENGL_CGL +#ifdef SDL_VIDEO_OPENGL_CGL if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { /* Switch to CGL based functions */ Cocoa_GLES_UnloadLibrary(_this); @@ -90,30 +88,25 @@ return context; }} -void -Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) +void Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) { @autoreleasepool { SDL_EGL_DeleteContext(_this, context); - Cocoa_GLES_UnloadLibrary(_this); }} -int -Cocoa_GLES_SwapWindow(_THIS, SDL_Window * window) +int Cocoa_GLES_SwapWindow(_THIS, SDL_Window * window) { @autoreleasepool { return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_WindowData *) window->driverdata).egl_surface); }} -int -Cocoa_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { @autoreleasepool { return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_WindowData *) window->driverdata).egl_surface : EGL_NO_SURFACE, context); }} -int -Cocoa_GLES_SetupWindow(_THIS, SDL_Window * window) +int Cocoa_GLES_SetupWindow(_THIS, SDL_Window * window) { NSView* v; /* The current context is lost in here; save it and reset it. */ @@ -133,7 +126,7 @@ } _this->gl_config.driver_loaded = 1; } - + /* Create the GLES window surface */ v = windowdata.nswindow.contentView; windowdata.egl_surface = SDL_EGL_CreateSurface(_this, (__bridge NativeWindowType)[v layer]); diff --git a/src/video/cocoa/SDL_cocoashape.h b/src/video/cocoa/SDL_cocoashape.h index 358d878ef64c5..82b8658b34268 100644 --- a/src/video/cocoa/SDL_cocoashape.h +++ b/src/video/cocoa/SDL_cocoashape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoashape.m b/src/video/cocoa/SDL_cocoashape.m index ac3459c5613d8..e1421ee1b274d 100644 --- a/src/video/cocoa/SDL_cocoashape.m +++ b/src/video/cocoa/SDL_cocoashape.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #include "SDL_cocoavideo.h" #include "SDL_shape.h" @@ -39,8 +39,7 @@ @interface SDL_CocoaClosure : NSObject @implementation SDL_CocoaClosure @end -SDL_WindowShaper* -Cocoa_CreateShaper(SDL_Window* window) +SDL_WindowShaper *Cocoa_CreateShaper(SDL_Window* window) { @autoreleasepool { SDL_WindowShaper* result; @@ -77,8 +76,7 @@ @implementation SDL_CocoaClosure return result; }} -void -ConvertRects(SDL_ShapeTree* tree, void* closure) +static void ConvertRects(SDL_ShapeTree* tree, void* closure) { SDL_CocoaClosure* data = (__bridge SDL_CocoaClosure*)closure; if(tree->kind == OpaqueShape) { @@ -87,8 +85,7 @@ @implementation SDL_CocoaClosure } } -int -Cocoa_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) +int Cocoa_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) { @autoreleasepool { SDL_ShapeData* data = (__bridge SDL_ShapeData*)shaper->driverdata; @@ -118,8 +115,7 @@ @implementation SDL_CocoaClosure return 0; }} -int -Cocoa_ResizeWindowShape(SDL_Window *window) +int Cocoa_ResizeWindowShape(SDL_Window *window) { @autoreleasepool { SDL_ShapeData* data = (__bridge SDL_ShapeData*)window->shaper->driverdata; SDL_assert(data != NULL); diff --git a/src/video/cocoa/SDL_cocoavideo.h b/src/video/cocoa/SDL_cocoavideo.h index 8f4a413e9ef33..d7663f90ca427 100644 --- a/src/video/cocoa/SDL_cocoavideo.h +++ b/src/video/cocoa/SDL_cocoavideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 6c3d44efae175..4ca68ba836fa6 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #if !__has_feature(objc_arc) #error SDL must be built with Objective-C ARC (automatic reference counting) enabled @@ -33,6 +33,7 @@ #include "SDL_cocoavulkan.h" #include "SDL_cocoametalview.h" #include "SDL_cocoaopengles.h" +#include "SDL_cocoamessagebox.h" @implementation SDL_VideoData @@ -44,19 +45,14 @@ @implementation SDL_VideoData /* Cocoa driver bootstrap functions */ -static void -Cocoa_DeleteDevice(SDL_VideoDevice * device) +static void Cocoa_DeleteDevice(SDL_VideoDevice * device) { @autoreleasepool { - if (device->wakeup_lock) { - SDL_DestroyMutex(device->wakeup_lock); - } CFBridgingRelease(device->driverdata); SDL_free(device); }} -static SDL_VideoDevice * -Cocoa_CreateDevice(void) +static SDL_VideoDevice *Cocoa_CreateDevice(void) { @autoreleasepool { SDL_VideoDevice *device; @@ -77,7 +73,6 @@ @implementation SDL_VideoData return NULL; } device->driverdata = (void *)CFBridgingRetain(data); - device->wakeup_lock = SDL_CreateMutex(); /* Set the function pointers */ device->VideoInit = Cocoa_VideoInit; @@ -129,7 +124,7 @@ @implementation SDL_VideoData device->shape_driver.SetWindowShape = Cocoa_SetWindowShape; device->shape_driver.ResizeWindowShape = Cocoa_ResizeWindowShape; -#if SDL_VIDEO_OPENGL_CGL +#ifdef SDL_VIDEO_OPENGL_CGL device->GL_LoadLibrary = Cocoa_GL_LoadLibrary; device->GL_GetProcAddress = Cocoa_GL_GetProcAddress; device->GL_UnloadLibrary = Cocoa_GL_UnloadLibrary; @@ -139,7 +134,7 @@ @implementation SDL_VideoData device->GL_GetSwapInterval = Cocoa_GL_GetSwapInterval; device->GL_SwapWindow = Cocoa_GL_SwapWindow; device->GL_DeleteContext = Cocoa_GL_DeleteContext; -#elif SDL_VIDEO_OPENGL_EGL +#elif defined(SDL_VIDEO_OPENGL_EGL) device->GL_LoadLibrary = Cocoa_GLES_LoadLibrary; device->GL_GetProcAddress = Cocoa_GLES_GetProcAddress; device->GL_UnloadLibrary = Cocoa_GLES_UnloadLibrary; @@ -151,7 +146,7 @@ @implementation SDL_VideoData device->GL_DeleteContext = Cocoa_GLES_DeleteContext; #endif -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = Cocoa_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = Cocoa_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = Cocoa_Vulkan_GetInstanceExtensions; @@ -159,7 +154,7 @@ @implementation SDL_VideoData device->Vulkan_GetDrawableSize = Cocoa_Vulkan_GetDrawableSize; #endif -#if SDL_VIDEO_METAL +#ifdef SDL_VIDEO_METAL device->Metal_CreateView = Cocoa_Metal_CreateView; device->Metal_DestroyView = Cocoa_Metal_DestroyView; device->Metal_GetLayer = Cocoa_Metal_GetLayer; @@ -181,12 +176,12 @@ @implementation SDL_VideoData VideoBootStrap COCOA_bootstrap = { "cocoa", "SDL Cocoa video driver", - Cocoa_CreateDevice + Cocoa_CreateDevice, + Cocoa_ShowMessageBox }; -int -Cocoa_VideoInit(_THIS) +int Cocoa_VideoInit(_THIS) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -208,8 +203,7 @@ @implementation SDL_VideoData return 0; }} -void -Cocoa_VideoQuit(_THIS) +void Cocoa_VideoQuit(_THIS) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; @@ -221,8 +215,7 @@ @implementation SDL_VideoData }} /* This function assumes that it's called from within an autorelease pool */ -NSImage * -Cocoa_CreateImage(SDL_Surface * surface) +NSImage *Cocoa_CreateImage(SDL_Surface * surface) { SDL_Surface *converted; NSBitmapImageRep *imgrep; diff --git a/src/video/cocoa/SDL_cocoavulkan.h b/src/video/cocoa/SDL_cocoavulkan.h index 9ddc70996b554..3de20dcd269c3 100644 --- a/src/video/cocoa/SDL_cocoavulkan.h +++ b/src/video/cocoa/SDL_cocoavulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,7 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_COCOA) int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path); void Cocoa_Vulkan_UnloadLibrary(_THIS); diff --git a/src/video/cocoa/SDL_cocoavulkan.m b/src/video/cocoa/SDL_cocoavulkan.m index 02817f8f11419..1454de50b4abf 100644 --- a/src/video/cocoa/SDL_cocoavulkan.m +++ b/src/video/cocoa/SDL_cocoavulkan.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_COCOA) #include "SDL_cocoavideo.h" #include "SDL_cocoawindow.h" diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h index 18f7d8587d9ae..7ef0bc036414e 100644 --- a/src/video/cocoa/SDL_cocoawindow.h +++ b/src/video/cocoa/SDL_cocoawindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #import -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "../SDL_egl_c.h" #endif @@ -54,6 +54,7 @@ typedef enum NSInteger focusClickPending; int pendingWindowWarpX, pendingWindowWarpY; BOOL isDragAreaRunning; + NSTimer *liveResizeTimer; } -(BOOL) isTouchFromTrackpad:(NSEvent *)theEvent; @@ -77,6 +78,9 @@ typedef enum /* Window delegate functionality */ -(BOOL) windowShouldClose:(id) sender; -(void) windowDidExpose:(NSNotification *) aNotification; +-(void) onLiveResizeTimerFire:(id) sender; +-(void) windowWillStartLiveResize:(NSNotification *)aNotification; +-(void) windowDidEndLiveResize:(NSNotification *)aNotification; -(void) windowDidMove:(NSNotification *) aNotification; -(void) windowDidResize:(NSNotification *) aNotification; -(void) windowDidMiniaturize:(NSNotification *) aNotification; @@ -132,7 +136,7 @@ typedef enum @property (nonatomic) NSInteger flash_request; @property (nonatomic) Cocoa_WindowListener *listener; @property (nonatomic) SDL_VideoData *videodata; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL @property (nonatomic) EGLSurface egl_surface; #endif @end diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index c738276568105..641df8129e468 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_COCOA +#ifdef SDL_VIDEO_DRIVER_COCOA #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 # error SDL for Mac OS X must be built with a 10.7 SDK or above. @@ -102,7 +102,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem SDL_Window *window = [self findSDLWindow]; if (window == NULL) { return NO; - } else if ((window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0) { + } else if (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) { return NO; } else if ((window->flags & SDL_WINDOW_RESIZABLE) == 0) { return NO; @@ -257,11 +257,10 @@ static void ConvertNSRect(NSScreen *screen, BOOL fullscreen, NSRect *r) r->origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - r->origin.y - r->size.height; } -static void -ScheduleContextUpdates(SDL_WindowData *data) +static void ScheduleContextUpdates(SDL_WindowData *data) { /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ - #if SDL_VIDEO_OPENGL + #ifdef SDL_VIDEO_OPENGL #ifdef __clang__ #pragma clang diagnostic push @@ -294,14 +293,12 @@ static void ConvertNSRect(NSScreen *screen, BOOL fullscreen, NSRect *r) } /* !!! FIXME: this should use a hint callback. */ -static int -GetHintCtrlClickEmulateRightClick() +static int GetHintCtrlClickEmulateRightClick() { return SDL_GetHintBoolean(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, SDL_FALSE); } -static NSUInteger -GetWindowWindowedStyle(SDL_Window * window) +static NSUInteger GetWindowWindowedStyle(SDL_Window * window) { /* IF YOU CHANGE ANY FLAGS IN HERE, PLEASE READ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ @@ -321,8 +318,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ return style; } -static NSUInteger -GetWindowStyle(SDL_Window * window) +static NSUInteger GetWindowStyle(SDL_Window * window) { NSUInteger style = 0; @@ -334,8 +330,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ return style; } -static SDL_bool -SetWindowStyle(SDL_Window * window, NSUInteger style) +static SDL_bool SetWindowStyle(SDL_Window * window, NSUInteger style) { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; NSWindow *nswindow = data.nswindow; @@ -355,8 +350,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ return SDL_TRUE; } -static SDL_bool -ShouldAdjustCoordinatesForGrab(SDL_Window * window) +static SDL_bool ShouldAdjustCoordinatesForGrab(SDL_Window * window) { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -374,8 +368,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ return SDL_FALSE; } -static SDL_bool -AdjustCoordinatesForGrab(SDL_Window * window, int x, int y, CGPoint *adjusted) +static SDL_bool AdjustCoordinatesForGrab(SDL_Window * window, int x, int y, CGPoint *adjusted) { if (window->mouse_rect.w > 0 && window->mouse_rect.h > 0) { SDL_Rect window_rect; @@ -400,7 +393,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ } } - if ((window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) { + if (window->flags & SDL_WINDOW_MOUSE_GRABBED) { int left = window->x; int right = left + window->w - 1; int top = window->y; @@ -414,8 +407,7 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ return SDL_FALSE; } -static void -Cocoa_UpdateClipCursor(SDL_Window * window) +static void Cocoa_UpdateClipCursor(SDL_Window * window) { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -468,6 +460,17 @@ the NSWindowStyleMaskBorderless comments in SetupWindowData()! */ } } +static NSCursor *Cocoa_GetDesiredCursor(void) +{ + SDL_Mouse *mouse = SDL_GetMouse(); + + if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) { + return (__bridge NSCursor *)mouse->cur_cursor->driverdata; + } + + return [NSCursor invisibleCursor]; +} + @implementation Cocoa_WindowListener @@ -487,11 +490,14 @@ - (void)listen:(SDL_WindowData *)data isMoving = NO; isDragAreaRunning = NO; pendingWindowWarpX = pendingWindowWarpY = INT_MAX; + liveResizeTimer = nil; center = [NSNotificationCenter defaultCenter]; if ([window delegate] != nil) { [center addObserver:self selector:@selector(windowDidExpose:) name:NSWindowDidExposeNotification object:window]; + [center addObserver:self selector:@selector(windowWillStartLiveResize:) name:NSWindowWillStartLiveResizeNotification object:window]; + [center addObserver:self selector:@selector(windowDidEndLiveResize:) name:NSWindowDidEndLiveResizeNotification object:window]; [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:window]; [center addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:window]; [center addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:window]; @@ -625,6 +631,8 @@ - (void)close if ([window delegate] != self) { [center removeObserver:self name:NSWindowDidExposeNotification object:window]; + [center removeObserver:self name:NSWindowWillStartLiveResizeNotification object:window]; + [center removeObserver:self name:NSWindowDidEndLiveResizeNotification object:window]; [center removeObserver:self name:NSWindowDidMoveNotification object:window]; [center removeObserver:self name:NSWindowDidResizeNotification object:window]; [center removeObserver:self name:NSWindowDidMiniaturizeNotification object:window]; @@ -671,7 +679,7 @@ -(void) setFocusClickPending:(NSInteger) button -(void) clearFocusClickPending:(NSInteger) button { - if ((focusClickPending & (1 << button)) != 0) { + if (focusClickPending & (1 << button)) { focusClickPending &= ~(1 << button); if (focusClickPending == 0) { [self onMovingOrFocusClickPendingStateCleared]; @@ -735,6 +743,36 @@ - (void)windowDidExpose:(NSNotification *)aNotification SDL_SendWindowEvent(_data.window, SDL_WINDOWEVENT_EXPOSED, 0, 0); } +- (void)onLiveResizeTimerFire:(id)sender +{ + SDL_OnWindowLiveResizeUpdate(_data.window); +} + +- (void)windowWillStartLiveResize:(NSNotification *)aNotification +{ + // We'll try to maintain 60 FPS during live resizing + const NSTimeInterval interval = 1.0 / 60.0; + + NSMethodSignature *invocationSig = [Cocoa_WindowListener + instanceMethodSignatureForSelector:@selector(onLiveResizeTimerFire:)]; + NSInvocation *invocation = [NSInvocation + invocationWithMethodSignature:invocationSig]; + [invocation setTarget:self]; + [invocation setSelector:@selector(onLiveResizeTimerFire:)]; + + liveResizeTimer = [NSTimer scheduledTimerWithTimeInterval:interval + invocation:invocation + repeats:TRUE]; + + [[NSRunLoop currentRunLoop] addTimer:liveResizeTimer forMode:NSRunLoopCommonModes]; +} + +- (void)windowDidEndLiveResize:(NSNotification *)aNotification +{ + [liveResizeTimer invalidate]; + liveResizeTimer = nil; +} + - (void)windowWillMove:(NSNotification *)aNotification { if ([_data.nswindow isKindOfClass:[SDLWindow class]]) { @@ -817,7 +855,17 @@ - (void)windowDidResize:(NSNotification *)aNotification SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, w, h); - zoomed = [nswindow isZoomed]; + /* The OS can resize the window automatically if the display density + changes while the window is miniaturized or hidden */ + if (![nswindow isVisible]) + return; + + /* isZoomed always returns true if the window is not resizable */ + if ((window->flags & SDL_WINDOW_RESIZABLE) && [nswindow isZoomed]) { + zoomed = YES; + } else { + zoomed = NO; + } if (!zoomed) { SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); } else if (zoomed) { @@ -875,7 +923,7 @@ - (void)windowDidBecomeKey:(NSNotification *)aNotification { const unsigned int newflags = [NSEvent modifierFlags] & NSEventModifierFlagCapsLock; _data.videodata.modifierFlags = (_data.videodata.modifierFlags & ~NSEventModifierFlagCapsLock) | newflags; - SDL_ToggleModState(KMOD_CAPS, newflags != 0); + SDL_ToggleModState(KMOD_CAPS, newflags ? SDL_TRUE : SDL_FALSE); } } @@ -925,11 +973,13 @@ - (void)windowDidChangeScreenProfile:(NSNotification *)aNotification - (void)windowDidChangeScreen:(NSNotification *)aNotification { /*printf("WINDOWDIDCHANGESCREEN\n");*/ +#ifdef SDL_VIDEO_OPENGL if (_data && _data.nscontexts) { for (SDLOpenGLContext *context in _data.nscontexts) { [context movedToNewScreen]; } } +#endif /* SDL_VIDEO_OPENGL */ } - (void)windowWillEnterFullScreen:(NSNotification *)aNotification @@ -954,7 +1004,7 @@ - (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification isFullscreenSpace = NO; inFullscreenTransition = NO; - + [self windowDidExitFullScreen:nil]; } @@ -1004,16 +1054,16 @@ when returning to windowed mode from a space (instead of using a pending - (void)windowDidFailToExitFullScreen:(NSNotification *)aNotification { SDL_Window *window = _data.window; - + if (window->is_destroying) { return; } SetWindowStyle(window, (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable)); - + isFullscreenSpace = YES; inFullscreenTransition = NO; - + [self windowDidEnterFullScreen:nil]; } @@ -1187,8 +1237,7 @@ - (BOOL)processHitTest:(NSEvent *)theEvent return NO; /* not a special area, carry on. */ } -static int -Cocoa_SendMouseButtonClicks(SDL_Mouse * mouse, NSEvent *theEvent, SDL_Window * window, const Uint8 state, const Uint8 button) +static int Cocoa_SendMouseButtonClicks(SDL_Mouse * mouse, NSEvent *theEvent, SDL_Window * window, const Uint8 state, const Uint8 button) { const SDL_MouseID mouseID = mouse->mouseID; const int clicks = (int) [theEvent clickCount]; @@ -1327,6 +1376,7 @@ - (void)mouseMoved:(NSEvent *)theEvent NSPoint point; int x, y; SDL_Window *window; + NSView *contentView; if (!mouse) { return; @@ -1334,6 +1384,17 @@ - (void)mouseMoved:(NSEvent *)theEvent mouseID = mouse->mouseID; window = _data.window; + contentView = _data.sdlContentView; + point = [theEvent locationInWindow]; + + if ([contentView mouse:[contentView convertPoint:point fromView:nil] inRect:[contentView bounds]] && + [NSCursor currentCursor] != Cocoa_GetDesiredCursor()) { + // The wrong cursor is on screen, fix it. This fixes an macOS bug that is only known to + // occur in fullscreen windows on the built-in displays of newer MacBooks with camera + // notches. When the mouse is moved near the top of such a window (within about 44 units) + // and then moved back down, the cursor rects aren't respected. + [_data.nswindow invalidateCursorRectsForView:contentView]; + } if ([self processHitTest:theEvent]) { SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIT_TEST, 0, 0); @@ -1344,7 +1405,6 @@ - (void)mouseMoved:(NSEvent *)theEvent return; } - point = [theEvent locationInWindow]; x = (int)point.x; y = (int)(window->h - point.y); @@ -1594,17 +1654,9 @@ - (BOOL)mouseDownCanMoveWindow - (void)resetCursorRects { - SDL_Mouse *mouse; [super resetCursorRects]; - mouse = SDL_GetMouse(); - - if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) { - [self addCursorRect:[self bounds] - cursor:(__bridge NSCursor *)mouse->cur_cursor->driverdata]; - } else { - [self addCursorRect:[self bounds] - cursor:[NSCursor invisibleCursor]]; - } + [self addCursorRect:[self bounds] + cursor:Cocoa_GetDesiredCursor()]; } - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent @@ -1617,8 +1669,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } @end -static int -SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, NSView *nsview, SDL_bool created) +static int SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, NSView *nsview, SDL_bool created) { @autoreleasepool { SDL_VideoData *videodata = (__bridge SDL_VideoData *) _this->driverdata; @@ -1711,8 +1762,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return 0; }} -int -Cocoa_CreateWindow(_THIS, SDL_Window * window) +int Cocoa_CreateWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_VideoData *videodata = (__bridge SDL_VideoData *) _this->driverdata; @@ -1794,8 +1844,8 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent #pragma clang diagnostic pop #endif -#if SDL_VIDEO_OPENGL_ES2 -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_ES2 +#ifdef SDL_VIDEO_OPENGL_EGL if ((window->flags & SDL_WINDOW_OPENGL) && _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { [contentView setWantsLayer:TRUE]; @@ -1811,11 +1861,11 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent if (!(window->flags & SDL_WINDOW_OPENGL)) { return 0; } - + /* The rest of this macro mess is for OpenGL or OpenGL ES windows */ -#if SDL_VIDEO_OPENGL_ES2 +#ifdef SDL_VIDEO_OPENGL_ES2 if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (Cocoa_GLES_SetupWindow(_this, window) < 0) { Cocoa_DestroyWindow(_this, window); return -1; @@ -1829,8 +1879,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return 0; }} -int -Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { @autoreleasepool { NSView* nsview = nil; @@ -1870,8 +1919,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return SetupWindowData(_this, window, nswindow, nsview, SDL_FALSE); }} -void -Cocoa_SetWindowTitle(_THIS, SDL_Window * window) +void Cocoa_SetWindowTitle(_THIS, SDL_Window * window) { @autoreleasepool { const char *title = window->title ? window->title : ""; @@ -1880,8 +1928,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [nswindow setTitle:string]; }} -void -Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) { @autoreleasepool { NSImage *nsimage = Cocoa_CreateImage(icon); @@ -1891,8 +1938,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_SetWindowPosition(_THIS, SDL_Window * window) +void Cocoa_SetWindowPosition(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -1914,8 +1960,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent ScheduleContextUpdates(windata); }} -void -Cocoa_SetWindowSize(_THIS, SDL_Window * window) +void Cocoa_SetWindowSize(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -1941,8 +1986,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent ScheduleContextUpdates(windata); }} -void -Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window) +void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -1954,8 +1998,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [windata.nswindow setContentMinSize:minSize]; }} -void -Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window) +void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -1967,8 +2010,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [windata.nswindow setContentMaxSize:maxSize]; }} -void -Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) +void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -1985,8 +2027,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent }} -void -Cocoa_ShowWindow(_THIS, SDL_Window * window) +void Cocoa_ShowWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windowData = ((__bridge SDL_WindowData *) window->driverdata); @@ -1999,8 +2040,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_HideWindow(_THIS, SDL_Window * window) +void Cocoa_HideWindow(_THIS, SDL_Window * window) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_WindowData *) window->driverdata).nswindow; @@ -2008,8 +2048,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [nswindow orderOut:nil]; }} -void -Cocoa_RaiseWindow(_THIS, SDL_Window * window) +void Cocoa_RaiseWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windowData = ((__bridge SDL_WindowData *) window->driverdata); @@ -2026,8 +2065,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [windowData.listener resumeVisibleObservation]; }} -void -Cocoa_MaximizeWindow(_THIS, SDL_Window * window) +void Cocoa_MaximizeWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -2038,8 +2076,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent ScheduleContextUpdates(windata); }} -void -Cocoa_MinimizeWindow(_THIS, SDL_Window * window) +void Cocoa_MinimizeWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2051,8 +2088,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_RestoreWindow(_THIS, SDL_Window * window) +void Cocoa_RestoreWindow(_THIS, SDL_Window * window) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_WindowData *) window->driverdata).nswindow; @@ -2064,8 +2100,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) { @autoreleasepool { if (SetWindowStyle(window, GetWindowStyle(window))) { @@ -2075,8 +2110,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) +void Cocoa_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) { @autoreleasepool { /* Don't set this if we're in a space! @@ -2100,8 +2134,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) +void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_WindowData *) window->driverdata).nswindow; @@ -2112,8 +2145,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +void Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2201,8 +2233,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent ScheduleContextUpdates(data); }} -int -Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) +int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); @@ -2228,8 +2259,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return 0; }} -void* -Cocoa_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) +void *Cocoa_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2265,8 +2295,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return retIccProfileData; }} -int -Cocoa_GetWindowDisplayIndex(_THIS, SDL_Window * window) +int Cocoa_GetWindowDisplayIndex(_THIS, SDL_Window * window) { @autoreleasepool { NSScreen *screen; @@ -2304,8 +2333,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return SDL_SetError("Couldn't find the display where the window is located."); }} -int -Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) +int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); CGDirectDisplayID display_id = ((SDL_DisplayData *)display->driverdata)->display; @@ -2328,14 +2356,12 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent return 0; } -void -Cocoa_SetWindowMouseRect(_THIS, SDL_Window * window) +void Cocoa_SetWindowMouseRect(_THIS, SDL_Window * window) { Cocoa_UpdateClipCursor(window); } -void -Cocoa_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2356,14 +2382,16 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -void -Cocoa_DestroyWindow(_THIS, SDL_Window * window) +void Cocoa_DestroyWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata); if (data) { +#ifdef SDL_VIDEO_OPENGL NSArray *contexts; +#endif + if ([data.listener isInFullscreenSpace]) { [NSMenu setMenuBarVisible:YES]; } @@ -2375,15 +2403,13 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent [data.nswindow close]; } - #if SDL_VIDEO_OPENGL - +#ifdef SDL_VIDEO_OPENGL contexts = [data.nscontexts copy]; for (SDLOpenGLContext *context in contexts) { - /* Calling setWindow:NULL causes the context to remove itself from the context list. */ + /* Calling setWindow:NULL causes the context to remove itself from the context list. */ [context setWindow:NULL]; } - - #endif /* SDL_VIDEO_OPENGL */ +#endif /* SDL_VIDEO_OPENGL */ if (window->shaper) { CFBridgingRelease(window->shaper->driverdata); @@ -2394,8 +2420,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent window->driverdata = NULL; }} -SDL_bool -Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { @autoreleasepool { NSWindow *nswindow = ((__bridge SDL_WindowData *) window->driverdata).nswindow; @@ -2411,8 +2436,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -SDL_bool -Cocoa_IsWindowInFullscreenSpace(SDL_Window * window) +SDL_bool Cocoa_IsWindowInFullscreenSpace(SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2424,8 +2448,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent } }} -SDL_bool -Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool state) +SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window * window, SDL_bool state) { @autoreleasepool { SDL_bool succeeded = SDL_FALSE; @@ -2467,14 +2490,12 @@ take effect properly (e.g. setting the window size, etc.) return succeeded; }} -int -Cocoa_SetWindowHitTest(SDL_Window * window, SDL_bool enabled) +int Cocoa_SetWindowHitTest(SDL_Window * window, SDL_bool enabled) { return 0; /* just succeed, the real work is done elsewhere. */ } -void -Cocoa_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept) +void Cocoa_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -2485,8 +2506,7 @@ take effect properly (e.g. setting the window size, etc.) } }} -int -Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) { @autoreleasepool { /* Note that this is app-wide and not window-specific! */ @@ -2513,8 +2533,7 @@ take effect properly (e.g. setting the window size, etc.) return 0; }} -int -Cocoa_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) +int Cocoa_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; diff --git a/src/video/directfb/SDL_DirectFB_WM.c b/src/video/directfb/SDL_DirectFB_WM.c index dc4af539f6cf9..425ca0979151f 100644 --- a/src/video/directfb/SDL_DirectFB_WM.c +++ b/src/video/directfb/SDL_DirectFB_WM.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_window.h" @@ -51,8 +51,7 @@ static DFB_Theme theme_none = { NULL }; -static void -DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w) +static void DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w) { int x1, x2, x3; int y1, y2, y3; @@ -75,19 +74,18 @@ DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w) s->FillTriangle(s, x1, y1, x2, y2, x3, y3); } -static void -LoadFont(_THIS, SDL_Window * window) +static void LoadFont(_THIS, SDL_Window * window) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); - if (windata->font != NULL) { + if (windata->font) { SDL_DFB_RELEASE(windata->font); windata->font = NULL; SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); } - if (windata->theme.font != NULL) + if (windata->theme.font) { DFBFontDescription fdesc; @@ -101,8 +99,7 @@ LoadFont(_THIS, SDL_Window * window) } } -static void -DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text) +static void DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text) { DFBSurfaceTextFlags flags; @@ -111,8 +108,7 @@ DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text) s->DrawString(s, text, -1, x, y, flags); } -void -DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) +void DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); IDirectFBSurface *s = windata->window_surface; @@ -180,8 +176,7 @@ DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) windata->wm_needs_redraw = 0; } -DFBResult -DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch) +DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch) { SDL_DFB_WINDOWDATA(window); IDirectFBWindow *dfbwin = windata->dfbwin; @@ -195,8 +190,7 @@ DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch) return DFB_OK; } -void -DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h) +void DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h) { SDL_DFB_WINDOWDATA(window); @@ -241,8 +235,7 @@ enum WM_POS_BOTTOM = 0x40, }; -static int -WMIsClient(DFB_WindowData * p, int x, int y) +static int WMIsClient(DFB_WindowData * p, int x, int y) { x -= p->client.x; y -= p->client.y; @@ -253,8 +246,7 @@ WMIsClient(DFB_WindowData * p, int x, int y) return 1; } -static int -WMPos(DFB_WindowData * p, int x, int y) +static int WMPos(DFB_WindowData * p, int x, int y) { int pos = WM_POS_NONE; @@ -284,8 +276,7 @@ WMPos(DFB_WindowData * p, int x, int y) return pos; } -int -DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) +int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) { SDL_DFB_WINDOWDATA(window); SDL_Window *grabbed_window = SDL_GetGrabbedWindow(); @@ -326,7 +317,7 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) SDL_FALLTHROUGH; default: windata->wm_grab = pos; - if (grabbed_window != NULL) + if (grabbed_window) DirectFB_SetWindowMouseGrab(_this, grabbed_window, SDL_FALSE); DirectFB_SetWindowMouseGrab(_this, window, SDL_TRUE); windata->wm_lastx = evt->cx; @@ -359,7 +350,7 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) } } DirectFB_SetWindowMouseGrab(_this, window, SDL_FALSE); - if (grabbed_window != NULL) + if (grabbed_window) DirectFB_SetWindowMouseGrab(_this, grabbed_window, SDL_TRUE); windata->wm_grab = WM_POS_NONE; return 1; diff --git a/src/video/directfb/SDL_DirectFB_WM.h b/src/video/directfb/SDL_DirectFB_WM.h index be96ec648751e..d36ada421b8e7 100644 --- a/src/video/directfb/SDL_DirectFB_WM.h +++ b/src/video/directfb/SDL_DirectFB_WM.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_dyn.c b/src/video/directfb/SDL_DirectFB_dyn.c index d872c29bcb7e2..e3aca31634dc4 100644 --- a/src/video/directfb/SDL_DirectFB_dyn.c +++ b/src/video/directfb/SDL_DirectFB_dyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_dyn.h" @@ -45,8 +45,7 @@ DFB_SYMS static void *handle = NULL; -int -SDL_DirectFB_LoadLibrary(void) +int SDL_DirectFB_LoadLibrary(void) { int retval = 0; @@ -92,26 +91,25 @@ SDL_DirectFB_LoadLibrary(void) return retval; } -void -SDL_DirectFB_UnLoadLibrary(void) +void SDL_DirectFB_UnLoadLibrary(void) { - if (handle != NULL) { + if (handle) { SDL_UnloadObject(handle); handle = NULL; } } #else -int -SDL_DirectFB_LoadLibrary(void) + +int SDL_DirectFB_LoadLibrary(void) { return 1; } -void -SDL_DirectFB_UnLoadLibrary(void) +void SDL_DirectFB_UnLoadLibrary(void) { } + #endif #endif /* SDL_VIDEO_DRIVER_DIRECTFB */ diff --git a/src/video/directfb/SDL_DirectFB_dyn.h b/src/video/directfb/SDL_DirectFB_dyn.h index 28882b8330905..854ce43ca8580 100644 --- a/src/video/directfb/SDL_DirectFB_dyn.h +++ b/src/video/directfb/SDL_DirectFB_dyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index 71aac7669840b..e076ff000df0d 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB /* Handle the event stream, converting DirectFB input events into SDL events */ @@ -91,8 +91,7 @@ static void UnicodeToUtf8( Uint16 w , char *utf8buf) } } -static void -FocusAllMice(_THIS, SDL_Window *window) +static void FocusAllMice(_THIS, SDL_Window *window) { #if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); @@ -106,8 +105,7 @@ FocusAllMice(_THIS, SDL_Window *window) } -static void -FocusAllKeyboards(_THIS, SDL_Window *window) +static void FocusAllKeyboards(_THIS, SDL_Window *window) { #if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); @@ -120,8 +118,7 @@ FocusAllKeyboards(_THIS, SDL_Window *window) #endif } -static void -MotionAllMice(_THIS, int x, int y) +static void MotionAllMice(_THIS, int x, int y) { #if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); @@ -136,8 +133,7 @@ MotionAllMice(_THIS, int x, int y) #endif } -static int -KbdIndex(_THIS, int id) +static int KbdIndex(_THIS, int id) { SDL_DFB_DEVICEDATA(_this); int index; @@ -149,8 +145,7 @@ KbdIndex(_THIS, int id) return -1; } -static int -ClientXY(DFB_WindowData * p, int *x, int *y) +static int ClientXY(DFB_WindowData * p, int *x, int *y) { int cx, cy; @@ -169,8 +164,7 @@ ClientXY(DFB_WindowData * p, int *x, int *y) return 1; } -static void -ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) +static void ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(sdlwin); @@ -303,8 +297,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt) printf("Event Clazz %d\n", evt->clazz); } -static void -ProcessInputEvent(_THIS, DFBInputEvent * ievt) +static void ProcessInputEvent(_THIS, DFBInputEvent * ievt) { SDL_DFB_DEVICEDATA(_this); SDL_Keysym keysym; @@ -315,7 +308,7 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt) if (!devdata->use_linux_input) { if (ievt->type == DIET_AXISMOTION) { - if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) { + if ((grabbed_window) && (ievt->flags & DIEF_AXISREL)) { if (ievt->axis == DIAI_X) SDL_SendMouseMotion_ex(grabbed_window, ievt->device_id, 1, ievt->axisrel, 0, 0); @@ -406,14 +399,13 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt) } } -void -DirectFB_PumpEventsWindow(_THIS) +void DirectFB_PumpEventsWindow(_THIS) { SDL_DFB_DEVICEDATA(_this); DFBInputEvent ievt; SDL_Window *w; - for (w = devdata->firstwin; w != NULL; w = w->next) { + for (w = devdata->firstwin; w; w = w->next) { SDL_DFB_WINDOWDATA(w); DFBWindowEvent evt; @@ -448,8 +440,7 @@ DirectFB_PumpEventsWindow(_THIS) } } -void -DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys) +void DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys) { int i; @@ -576,8 +567,7 @@ DirectFB_InitOSKeymap(_THIS, SDL_Scancode * keymap, int numkeys) } -static SDL_Keysym * -DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym, Uint32 *unicode) +static SDL_Keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym, Uint32 *unicode) { SDL_DFB_DEVICEDATA(_this); int kbd_idx = 0; /* Window events lag the device source KbdIndex(_this, evt->device_id); */ @@ -606,8 +596,7 @@ DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_Keysym * keysym, Uint32 * return keysym; } -static SDL_Keysym * -DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, +static SDL_Keysym *DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, SDL_Keysym * keysym, Uint32 *unicode) { SDL_DFB_DEVICEDATA(_this); @@ -636,8 +625,7 @@ DirectFB_TranslateKeyInputEvent(_THIS, DFBInputEvent * evt, return keysym; } -static int -DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) +static int DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) { switch (button) { case DIBI_LEFT: @@ -651,9 +639,7 @@ DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) } } -static DFBEnumerationResult -EnumKeyboards(DFBInputDeviceID device_id, - DFBInputDeviceDescription desc, void *callbackdata) +static DFBEnumerationResult EnumKeyboards(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) { cb_data *cb = callbackdata; DFB_DeviceData *devdata = cb->devdata; @@ -700,8 +686,7 @@ EnumKeyboards(DFBInputDeviceID device_id, return DFENUM_OK; } -void -DirectFB_InitKeyboard(_THIS) +void DirectFB_InitKeyboard(_THIS) { SDL_DFB_DEVICEDATA(_this); cb_data cb; @@ -730,8 +715,7 @@ DirectFB_InitKeyboard(_THIS) } } -void -DirectFB_QuitKeyboard(_THIS) +void DirectFB_QuitKeyboard(_THIS) { /* SDL_DFB_DEVICEDATA(_this); */ } diff --git a/src/video/directfb/SDL_DirectFB_events.h b/src/video/directfb/SDL_DirectFB_events.h index 276d972c6df6d..c41cb1518ba80 100644 --- a/src/video/directfb/SDL_DirectFB_events.h +++ b/src/video/directfb/SDL_DirectFB_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_modes.c b/src/video/directfb/SDL_DirectFB_modes.c index 88fa0568cc0d4..6829e206ece65 100644 --- a/src/video/directfb/SDL_DirectFB_modes.c +++ b/src/video/directfb/SDL_DirectFB_modes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_modes.h" @@ -42,8 +42,7 @@ struct modes_callback_t SDL_DisplayMode *modelist; }; -static DFBEnumerationResult -EnumModesCallback(int width, int height, int bpp, void *data) +static DFBEnumerationResult EnumModesCallback(int width, int height, int bpp, void *data) { struct modes_callback_t *modedata = (struct modes_callback_t *) data; SDL_DisplayMode mode; @@ -61,9 +60,7 @@ EnumModesCallback(int width, int height, int bpp, void *data) return DFENUM_OK; } -static DFBEnumerationResult -EnumScreensCallback(DFBScreenID screen_id, DFBScreenDescription desc, - void *callbackdata) +static DFBEnumerationResult EnumScreensCallback(DFBScreenID screen_id, DFBScreenDescription desc, void *callbackdata) { struct screen_callback_t *devdata = (struct screen_callback_t *) callbackdata; @@ -71,9 +68,7 @@ EnumScreensCallback(DFBScreenID screen_id, DFBScreenDescription desc, return DFENUM_OK; } -static DFBEnumerationResult -EnumLayersCallback(DFBDisplayLayerID layer_id, DFBDisplayLayerDescription desc, - void *callbackdata) +static DFBEnumerationResult EnumLayersCallback(DFBDisplayLayerID layer_id, DFBDisplayLayerDescription desc, void *callbackdata) { struct screen_callback_t *devdata = (struct screen_callback_t *) callbackdata; @@ -89,8 +84,7 @@ EnumLayersCallback(DFBDisplayLayerID layer_id, DFBDisplayLayerDescription desc, return DFENUM_OK; } -static void -CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, SDL_DisplayMode * mode) +static void CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, SDL_DisplayMode * mode) { SDL_DFB_DEVICEDATA(_this); DFBDisplayLayerConfig config; @@ -125,8 +119,7 @@ CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, S } -void -DirectFB_SetContext(_THIS, SDL_Window *window) +void DirectFB_SetContext(_THIS, SDL_Window *window) { #if (DFB_VERSION_ATLEAST(1,0,0)) /* FIXME: does not work on 1.0/1.2 with radeon driver @@ -144,8 +137,7 @@ DirectFB_SetContext(_THIS, SDL_Window *window) #endif } -void -DirectFB_InitModes(_THIS) +void DirectFB_InitModes(_THIS) { SDL_DFB_DEVICEDATA(_this); IDirectFBDisplayLayer *layer = NULL; @@ -269,8 +261,7 @@ DirectFB_InitModes(_THIS) return; } -void -DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display) { SDL_DFB_DEVICEDATA(_this); DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; @@ -304,8 +295,7 @@ DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display) return; } -int -DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { /* * FIXME: video mode switch is currently broken for 1.2.0 @@ -375,8 +365,7 @@ DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mod return -1; } -void -DirectFB_QuitModes(_THIS) +void DirectFB_QuitModes(_THIS) { SDL_DisplayMode tmode; int i; diff --git a/src/video/directfb/SDL_DirectFB_modes.h b/src/video/directfb/SDL_DirectFB_modes.h index 22727aa4edc72..58374c80deee8 100644 --- a/src/video/directfb/SDL_DirectFB_modes.h +++ b/src/video/directfb/SDL_DirectFB_modes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_mouse.c b/src/video/directfb/SDL_DirectFB_mouse.c index 2457aa9038b29..0e24fbffc585e 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.c +++ b/src/video/directfb/SDL_DirectFB_mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" @@ -74,8 +74,7 @@ static const char *arrow[] = { " ", }; -static SDL_Cursor * -DirectFB_CreateDefaultCursor(void) +static SDL_Cursor *DirectFB_CreateDefaultCursor(void) { SDL_VideoDevice *dev = SDL_GetVideoDevice(); @@ -127,8 +126,7 @@ DirectFB_CreateDefaultCursor(void) } /* Create a cursor from a surface */ -static SDL_Cursor * -DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) { SDL_VideoDevice *dev = SDL_GetVideoDevice(); @@ -174,8 +172,7 @@ DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) } /* Show the specified cursor, or hide if cursor is NULL */ -static int -DirectFB_ShowCursor(SDL_Cursor * cursor) +static int DirectFB_ShowCursor(SDL_Cursor * cursor) { SDL_DFB_CURSORDATA(cursor); SDL_Window *window; @@ -215,8 +212,7 @@ DirectFB_ShowCursor(SDL_Cursor * cursor) } /* Free a window manager cursor */ -static void -DirectFB_FreeCursor(SDL_Cursor * cursor) +static void DirectFB_FreeCursor(SDL_Cursor * cursor) { SDL_DFB_CURSORDATA(cursor); @@ -226,8 +222,7 @@ DirectFB_FreeCursor(SDL_Cursor * cursor) } /* Warp the mouse to (x,y) */ -static void -DirectFB_WarpMouse(SDL_Window * window, int x, int y) +static void DirectFB_WarpMouse(SDL_Window * window, int x, int y) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; @@ -252,9 +247,7 @@ static void DirectFB_FreeMouse(SDL_Mouse * mouse); static int id_mask; -static DFBEnumerationResult -EnumMice(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, - void *callbackdata) +static DFBEnumerationResult EnumMice(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) { DFB_DeviceData *devdata = callbackdata; @@ -277,8 +270,7 @@ EnumMice(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, return DFENUM_OK; } -void -DirectFB_InitMouse(_THIS) +void DirectFB_InitMouse(_THIS) { SDL_DFB_DEVICEDATA(_this); @@ -310,8 +302,7 @@ DirectFB_InitMouse(_THIS) } } -void -DirectFB_QuitMouse(_THIS) +void DirectFB_QuitMouse(_THIS) { SDL_DFB_DEVICEDATA(_this); @@ -324,15 +315,13 @@ DirectFB_QuitMouse(_THIS) /* This is called when a mouse motion event occurs */ -static void -DirectFB_MoveCursor(SDL_Cursor * cursor) +static void DirectFB_MoveCursor(SDL_Cursor * cursor) { } /* Warp the mouse to (x,y) */ -static void -DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y) +static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; @@ -350,16 +339,14 @@ DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y) } /* Free the mouse when it's time */ -static void -DirectFB_FreeMouse(SDL_Mouse * mouse) +static void DirectFB_FreeMouse(SDL_Mouse * mouse) { /* nothing yet */ } #else /* USE_MULTI_API */ -void -DirectFB_InitMouse(_THIS) +void DirectFB_InitMouse(_THIS) { SDL_DFB_DEVICEDATA(_this); @@ -375,12 +362,10 @@ DirectFB_InitMouse(_THIS) devdata->num_mice = 1; } -void -DirectFB_QuitMouse(_THIS) +void DirectFB_QuitMouse(_THIS) { } - #endif #endif /* SDL_VIDEO_DRIVER_DIRECTFB */ diff --git a/src/video/directfb/SDL_DirectFB_mouse.h b/src/video/directfb/SDL_DirectFB_mouse.h index f5c207645af38..d45b202e74b98 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.h +++ b/src/video/directfb/SDL_DirectFB_mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_opengl.c b/src/video/directfb/SDL_DirectFB_opengl.c index a1ab96c4ab852..17737c2960fe8 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.c +++ b/src/video/directfb/SDL_DirectFB_opengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,11 +20,11 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL #include "SDL_DirectFB_opengl.h" #include "SDL_DirectFB_window.h" @@ -33,7 +33,7 @@ #include "SDL_loadso.h" #endif -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL struct SDL_GLDriverData { @@ -60,8 +60,7 @@ struct SDL_GLDriverData static void DirectFB_GL_UnloadLibrary(_THIS); -int -DirectFB_GL_Initialize(_THIS) +int DirectFB_GL_Initialize(_THIS) { if (_this->gl_data) { return 0; @@ -91,8 +90,7 @@ DirectFB_GL_Initialize(_THIS) return 0; } -void -DirectFB_GL_Shutdown(_THIS) +void DirectFB_GL_Shutdown(_THIS) { if (!_this->gl_data || (--_this->gl_data->initialized > 0)) { return; @@ -104,8 +102,7 @@ DirectFB_GL_Shutdown(_THIS) _this->gl_data = NULL; } -int -DirectFB_GL_LoadLibrary(_THIS, const char *path) +int DirectFB_GL_LoadLibrary(_THIS, const char *path) { void *handle = NULL; @@ -116,15 +113,15 @@ DirectFB_GL_LoadLibrary(_THIS, const char *path) } - if (path == NULL) { + if (!path) { path = SDL_getenv("SDL_OPENGL_LIBRARY"); - if (path == NULL) { + if (!path) { path = "libGL.so.1"; } } handle = GL_LoadObject(path); - if (handle == NULL) { + if (!handle) { SDL_DFB_ERR("Library not found: %s\n", path); /* SDL_LoadObject() will call SDL_SetError() for us. */ return -1; @@ -146,8 +143,7 @@ DirectFB_GL_LoadLibrary(_THIS, const char *path) return 0; } -static void -DirectFB_GL_UnloadLibrary(_THIS) +static void DirectFB_GL_UnloadLibrary(_THIS) { #if 0 int ret = GL_UnloadObject(_this->gl_config.dll_handle); @@ -160,8 +156,7 @@ DirectFB_GL_UnloadLibrary(_THIS) _this->gl_data = NULL; } -void * -DirectFB_GL_GetProcAddress(_THIS, const char *proc) +void *DirectFB_GL_GetProcAddress(_THIS, const char *proc) { void *handle; @@ -169,8 +164,7 @@ DirectFB_GL_GetProcAddress(_THIS, const char *proc) return GL_LoadFunction(handle, proc); } -SDL_GLContext -DirectFB_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext DirectFB_GL_CreateContext(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *context; @@ -202,8 +196,7 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window) return NULL; } -int -DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { DirectFB_GLContext *ctx = (DirectFB_GLContext *) context; DirectFB_GLContext *p; @@ -217,7 +210,7 @@ DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) } - if (ctx != NULL) { + if (ctx) { SDL_DFB_CHECKERR(ctx->context->Lock(ctx->context)); ctx->is_locked = 1; } @@ -227,20 +220,17 @@ DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) return -1; } -int -DirectFB_GL_SetSwapInterval(_THIS, int interval) +int DirectFB_GL_SetSwapInterval(_THIS, int interval) { return SDL_Unsupported(); } -int -DirectFB_GL_GetSwapInterval(_THIS) +int DirectFB_GL_GetSwapInterval(_THIS) { return 0; } -int -DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) +int DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *p; @@ -252,7 +242,7 @@ DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) devdata->glFlush(); #endif - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + for (p = _this->gl_data->firstgl; p; p = p->next) if (p->sdl_window == window && p->is_locked) { SDL_DFB_CHECKERR(p->context->Unlock(p->context)); @@ -265,8 +255,7 @@ DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) return -1; } -void -DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context) +void DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context) { DirectFB_GLContext *ctx = (DirectFB_GLContext *) context; DirectFB_GLContext *p; @@ -285,12 +274,11 @@ DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context) SDL_DFB_FREE(ctx); } -void -DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window) +void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + for (p = _this->gl_data->firstgl; p; p = p->next) if (p->sdl_window == window) { if (p->is_locked) @@ -299,12 +287,11 @@ DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window) } } -void -DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window) +void DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + for (p = _this->gl_data->firstgl; p; p = p->next) if (p->sdl_window == window) { SDL_DFB_WINDOWDATA(window); @@ -315,12 +302,11 @@ DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window) } } -void -DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window) +void DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window) { DirectFB_GLContext *p; - for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + for (p = _this->gl_data->firstgl; p; p = p->next) if (p->sdl_window == window) DirectFB_GL_DeleteContext(_this, p); } diff --git a/src/video/directfb/SDL_DirectFB_opengl.h b/src/video/directfb/SDL_DirectFB_opengl.h index be02c7df1e050..1e27774ff6729 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.h +++ b/src/video/directfb/SDL_DirectFB_opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "SDL_DirectFB_video.h" -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL #include "SDL_opengl.h" diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index bcb2600ea23e2..38ff16fb15c94 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_window.h" #include "SDL_DirectFB_modes.h" @@ -79,16 +79,14 @@ typedef struct #endif } DirectFB_TextureData; -static SDL_INLINE void -SDLtoDFBRect(const SDL_Rect * sr, DFBRectangle * dr) +static void SDLtoDFBRect(const SDL_Rect * sr, DFBRectangle * dr) { dr->x = sr->x; dr->y = sr->y; dr->h = sr->h; dr->w = sr->w; } -static SDL_INLINE void -SDLtoDFBRect_Float(const SDL_FRect * sr, DFBRectangle * dr) +static void SDLtoDFBRect_Float(const SDL_FRect * sr, DFBRectangle * dr) { dr->x = sr->x; dr->y = sr->y; @@ -97,8 +95,7 @@ SDLtoDFBRect_Float(const SDL_FRect * sr, DFBRectangle * dr) } -static int -TextureHasAlpha(DirectFB_TextureData * data) +static int TextureHasAlpha(DirectFB_TextureData * data) { /* Drawing primitive ? */ if (!data) @@ -149,9 +146,7 @@ static SDL_INLINE IDirectFBWindow *get_dfb_window(SDL_Window *window) return wm_info.info.dfb.window; } -static void -SetBlendMode(DirectFB_RenderData * data, int blendMode, - DirectFB_TextureData * source) +static void SetBlendMode(DirectFB_RenderData * data, int blendMode, DirectFB_TextureData * source) { IDirectFBSurface *destsurf = data->target; @@ -201,6 +196,7 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, case SDL_BLENDMODE_MUL: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; + /* FIXME SDL_BLENDMODE_MUL is simplified, and dstA is in fact un-changed.*/ SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR)); SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA)); @@ -210,8 +206,7 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, } } -static int -PrepareDraw(SDL_Renderer * renderer, const SDL_RenderCommand *cmd) +static int PrepareDraw(SDL_Renderer * renderer, const SDL_RenderCommand *cmd) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; IDirectFBSurface *destsurf = data->target; @@ -245,8 +240,7 @@ PrepareDraw(SDL_Renderer * renderer, const SDL_RenderCommand *cmd) return -1; } -static void -DirectFB_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) +static void DirectFB_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) { SDL_DFB_RENDERERDATA(renderer); @@ -258,8 +252,7 @@ DirectFB_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } -static void -DirectFB_ActivateRenderer(SDL_Renderer * renderer) +static void DirectFB_ActivateRenderer(SDL_Renderer * renderer) { SDL_DFB_RENDERERDATA(renderer); @@ -268,8 +261,7 @@ DirectFB_ActivateRenderer(SDL_Renderer * renderer) } } -static int -DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) +static int DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Window *window = renderer->window; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); @@ -340,8 +332,7 @@ void DirectFB_SetTexturePalette(SDL_Renderer *renderer, SDL_Texture *texture, SD data->palette->SetEntries(data->palette, dfbpal, pal->ncolors, 0); } -static int -DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static int DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Window *window = renderer->window; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); @@ -436,8 +427,7 @@ DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } #if 0 -static int -DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) +static int DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { #if (DFB_VERSION_ATLEAST(1,2,0)) @@ -465,8 +455,7 @@ DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) } #endif -static int -DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, +static int DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; @@ -522,8 +511,7 @@ DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } -static int -DirectFB_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, +static int DirectFB_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, void **pixels, int *pitch) { DirectFB_TextureData *texturedata = @@ -560,8 +548,7 @@ DirectFB_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, return -1; } -static void -DirectFB_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void DirectFB_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) { DirectFB_TextureData *texturedata = (DirectFB_TextureData *) texture->driverdata; @@ -574,14 +561,12 @@ DirectFB_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } -static void -DirectFB_SetTextureScaleMode() +static void DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode) { } #if 0 -static void -DirectFB_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, +static void DirectFB_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects, const SDL_Rect * rects) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; @@ -610,16 +595,14 @@ static int DirectFB_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * textu } -static int -DirectFB_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) +static int DirectFB_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd) { return 0; /* nothing to do in this backend. */ } -static int -DirectFB_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) +static int DirectFB_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - const size_t len = count * sizeof (SDL_FPoint); + const size_t len = count * sizeof(SDL_FPoint); SDL_FPoint *verts = (SDL_FPoint *) SDL_AllocateRenderVertices(renderer, len, 0, &cmd->data.draw.first); if (!verts) { @@ -631,8 +614,7 @@ DirectFB_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const return 0; } -static int -DirectFB_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, +static int DirectFB_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices, float scale_x, float scale_y) @@ -642,7 +624,7 @@ DirectFB_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu float *verts; int sz = 2 + 4 + (texture ? 2 : 0); - verts = (float *) SDL_AllocateRenderVertices(renderer, count * sz * sizeof (float), 0, &cmd->data.draw.first); + verts = (float *) SDL_AllocateRenderVertices(renderer, count * sz * sizeof(float), 0, &cmd->data.draw.first); if (!verts) { return -1; } @@ -684,10 +666,9 @@ DirectFB_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Textu return 0; } -static int -DirectFB_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count) +static int DirectFB_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FRect * rects, int count) { - const size_t len = count * sizeof (SDL_FRect); + const size_t len = count * sizeof(SDL_FRect); SDL_FRect *verts = (SDL_FRect *) SDL_AllocateRenderVertices(renderer, len, 0, &cmd->data.draw.first); if (!verts) { @@ -699,11 +680,10 @@ DirectFB_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const S return 0; } -static int -DirectFB_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, +static int DirectFB_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_FRect * dstrect) { - DFBRectangle *verts = (DFBRectangle *) SDL_AllocateRenderVertices(renderer, 2 * sizeof (DFBRectangle), 0, &cmd->data.draw.first); + DFBRectangle *verts = (DFBRectangle *) SDL_AllocateRenderVertices(renderer, 2 * sizeof(DFBRectangle), 0, &cmd->data.draw.first); if (!verts) { return -1; @@ -717,8 +697,7 @@ DirectFB_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture return 0; } -static int -DirectFB_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) +static int DirectFB_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { /* !!! FIXME: there are probably some good optimization wins in here if someone wants to look it over. */ DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; @@ -1025,8 +1004,7 @@ DirectFB_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void * } -static int -DirectFB_RenderPresent(SDL_Renderer * renderer) +static int DirectFB_RenderPresent(SDL_Renderer * renderer) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; @@ -1059,8 +1037,7 @@ DirectFB_RenderPresent(SDL_Renderer * renderer) return 0; } -static void -DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) +static void DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; @@ -1085,8 +1062,7 @@ DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) texture->driverdata = NULL; } -static void -DirectFB_DestroyRenderer(SDL_Renderer * renderer) +static void DirectFB_DestroyRenderer(SDL_Renderer * renderer) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; #if 0 @@ -1100,8 +1076,7 @@ DirectFB_DestroyRenderer(SDL_Renderer * renderer) SDL_free(renderer); } -static int -DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, +static int DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, void * pixels, int pitch) { Uint32 sdl_format; @@ -1128,8 +1103,7 @@ DirectFB_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect, } #if 0 -static int -DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, +static int DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 format, const void * pixels, int pitch) { SDL_Window *window = renderer->window; @@ -1156,8 +1130,7 @@ DirectFB_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect, #endif -SDL_Renderer * -DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) +SDL_Renderer *DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) { IDirectFBSurface *winsurf = get_dfb_surface(window); /*SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);*/ diff --git a/src/video/directfb/SDL_DirectFB_render.h b/src/video/directfb/SDL_DirectFB_render.h index b8ebae2ccb923..8030948fe967f 100644 --- a/src/video/directfb/SDL_DirectFB_render.h +++ b/src/video/directfb/SDL_DirectFB_render.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_shape.c b/src/video/directfb/SDL_DirectFB_shape.c index b6f5d0811c007..3167a5bc161ac 100644 --- a/src/video/directfb/SDL_DirectFB_shape.c +++ b/src/video/directfb/SDL_DirectFB_shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_shape.h" @@ -28,8 +28,8 @@ #include "../SDL_shape_internals.h" -SDL_WindowShaper* -DirectFB_CreateShaper(SDL_Window* window) { +SDL_WindowShaper *DirectFB_CreateShaper(SDL_Window* window) +{ SDL_WindowShaper* result = NULL; SDL_ShapeData* data; int resized_properly; @@ -58,8 +58,8 @@ DirectFB_CreateShaper(SDL_Window* window) { return result; } -int -DirectFB_ResizeWindowShape(SDL_Window* window) { +int DirectFB_ResizeWindowShape(SDL_Window* window) +{ SDL_ShapeData* data = window->shaper->driverdata; SDL_assert(data != NULL); @@ -73,10 +73,10 @@ DirectFB_ResizeWindowShape(SDL_Window* window) { return 0; } -int -DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { +int DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) +{ - if(shaper == NULL || shape == NULL || shaper->driverdata == NULL) + if(!shaper || !shape || !shaper->driverdata) return -1; if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode)) return -2; @@ -103,7 +103,7 @@ DirectFB_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowSh dsc.pixelformat = DSPF_ARGB; SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc, &data->surface)); - + SDL_DFB_CALLOC(bitmap, shape->w * shape->h, 1); /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */ SDL_CalculateShapeBitmap(shaper->mode, shape, bitmap, 1); diff --git a/src/video/directfb/SDL_DirectFB_shape.h b/src/video/directfb/SDL_DirectFB_shape.h index 579e5e4b113a2..70e97b941b075 100644 --- a/src/video/directfb/SDL_DirectFB_shape.h +++ b/src/video/directfb/SDL_DirectFB_shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_video.c b/src/video/directfb/SDL_DirectFB_video.c index 22badec67c018..b3110cbc334cb 100644 --- a/src/video/directfb/SDL_DirectFB_video.c +++ b/src/video/directfb/SDL_DirectFB_video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB /* * #include "SDL_DirectFB_keyboard.h" @@ -65,7 +65,8 @@ static SDL_VideoDevice *DirectFB_CreateDevice(void); VideoBootStrap DirectFB_bootstrap = { "directfb", "DirectFB", - DirectFB_CreateDevice + DirectFB_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; static const DirectFBSurfaceDrawingFlagsNames(drawing_flags); @@ -74,16 +75,14 @@ static const DirectFBAccelerationMaskNames(acceleration_mask); /* DirectFB driver bootstrap functions */ -static void -DirectFB_DeleteDevice(SDL_VideoDevice * device) +static void DirectFB_DeleteDevice(SDL_VideoDevice * device) { SDL_DirectFB_UnLoadLibrary(); SDL_DFB_FREE(device->driverdata); SDL_DFB_FREE(device); } -static SDL_VideoDevice * -DirectFB_CreateDevice(void) +static SDL_VideoDevice *DirectFB_CreateDevice(void) { SDL_VideoDevice *device; @@ -120,7 +119,7 @@ DirectFB_CreateDevice(void) /* !!! FIXME: implement SetWindowBordered */ -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL device->GL_LoadLibrary = DirectFB_GL_LoadLibrary; device->GL_GetProcAddress = DirectFB_GL_GetProcAddress; device->GL_MakeCurrent = DirectFB_GL_MakeCurrent; @@ -138,7 +137,7 @@ DirectFB_CreateDevice(void) device->shape_driver.SetWindowShape = DirectFB_SetWindowShape; device->shape_driver.ResizeWindowShape = DirectFB_ResizeWindowShape; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = DirectFB_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = DirectFB_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = DirectFB_Vulkan_GetInstanceExtensions; @@ -154,8 +153,7 @@ DirectFB_CreateDevice(void) return (0); } -static void -DirectFB_DeviceInformation(IDirectFB * dfb) +static void DirectFB_DeviceInformation(IDirectFB * dfb) { DFBGraphicsDeviceDescription desc; int n; @@ -206,8 +204,7 @@ static int readBoolEnv(const char *env_name, int def_val) return def_val; } -static int -DirectFB_VideoInit(_THIS) +static int DirectFB_VideoInit(_THIS) { IDirectFB *dfb = NULL; DFB_DeviceData *devdata = NULL; @@ -266,7 +263,7 @@ DirectFB_VideoInit(_THIS) DirectFB_InitModes(_this); -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL DirectFB_GL_Initialize(_this); #endif @@ -282,8 +279,7 @@ DirectFB_VideoInit(_THIS) return -1; } -static void -DirectFB_VideoQuit(_THIS) +static void DirectFB_VideoQuit(_THIS) { DFB_DeviceData *devdata = (DFB_DeviceData *) _this->driverdata; @@ -295,7 +291,7 @@ DirectFB_VideoQuit(_THIS) SDL_DFB_RELEASE(devdata->events); SDL_DFB_RELEASE(devdata->dfb); -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL DirectFB_GL_Shutdown(_this); #endif @@ -379,8 +375,7 @@ static const struct { { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU }, /**< Packed mode: Y0+V0+Y1+U0 (1 pla */ }; -Uint32 -DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat) +Uint32 DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat) { int i; @@ -392,8 +387,7 @@ DirectFB_DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat) return SDL_PIXELFORMAT_UNKNOWN; } -DFBSurfacePixelFormat -DirectFB_SDLToDFBPixelFormat(Uint32 format) +DFBSurfacePixelFormat DirectFB_SDLToDFBPixelFormat(Uint32 format) { int i; diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index 17bbdea2834f8..39d7b2a56aa54 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/directfb/SDL_DirectFB_vulkan.c b/src/video/directfb/SDL_DirectFB_vulkan.c index 398ba55bab456..24bacbb14342e 100644 --- a/src/video/directfb/SDL_DirectFB_vulkan.c +++ b/src/video/directfb/SDL_DirectFB_vulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_DIRECTFB +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_DIRECTFB) #include "SDL_DirectFB_window.h" diff --git a/src/video/directfb/SDL_DirectFB_vulkan.h b/src/video/directfb/SDL_DirectFB_vulkan.h index 1e6eb964117fa..54e109de2b2ad 100644 --- a/src/video/directfb/SDL_DirectFB_vulkan.h +++ b/src/video/directfb/SDL_DirectFB_vulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_DIRECTFB +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_DIRECTFB) int DirectFB_Vulkan_LoadLibrary(_THIS, const char *path); void DirectFB_Vulkan_UnloadLibrary(_THIS); diff --git a/src/video/directfb/SDL_DirectFB_window.c b/src/video/directfb/SDL_DirectFB_window.c index 999f21d5cba37..601a9f95eeb57 100644 --- a/src/video/directfb/SDL_DirectFB_window.c +++ b/src/video/directfb/SDL_DirectFB_window.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DIRECTFB +#ifdef SDL_VIDEO_DRIVER_DIRECTFB #include "SDL_DirectFB_video.h" #include "SDL_DirectFB_modes.h" #include "SDL_DirectFB_window.h" #include "SDL_DirectFB_shape.h" -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL #include "SDL_DirectFB_opengl.h" #endif @@ -35,8 +35,7 @@ #include "../SDL_pixels_c.h" -int -DirectFB_CreateWindow(_THIS, SDL_Window * window) +int DirectFB_CreateWindow(_THIS, SDL_Window * window) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_DISPLAYDATA(window); @@ -173,14 +172,12 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) return -1; } -int -DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { return SDL_Unsupported(); } -void -DirectFB_SetWindowTitle(_THIS, SDL_Window * window) +void DirectFB_SetWindowTitle(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); @@ -192,8 +189,7 @@ DirectFB_SetWindowTitle(_THIS, SDL_Window * window) } } -void -DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); @@ -242,8 +238,7 @@ DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) return; } -void -DirectFB_SetWindowPosition(_THIS, SDL_Window * window) +void DirectFB_SetWindowPosition(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); int x, y; @@ -255,8 +250,7 @@ DirectFB_SetWindowPosition(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->MoveTo(windata->dfbwin, x, y)); } -void -DirectFB_SetWindowSize(_THIS, SDL_Window * window) +void DirectFB_SetWindowSize(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); @@ -294,8 +288,7 @@ DirectFB_SetWindowSize(_THIS, SDL_Window * window) return; } -void -DirectFB_ShowWindow(_THIS, SDL_Window * window) +void DirectFB_ShowWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); @@ -303,8 +296,7 @@ DirectFB_ShowWindow(_THIS, SDL_Window * window) } -void -DirectFB_HideWindow(_THIS, SDL_Window * window) +void DirectFB_HideWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); @@ -312,8 +304,7 @@ DirectFB_HideWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->SetOpacity(windata->dfbwin, 0)); } -void -DirectFB_RaiseWindow(_THIS, SDL_Window * window) +void DirectFB_RaiseWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); @@ -321,8 +312,7 @@ DirectFB_RaiseWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->RequestFocus(windata->dfbwin)); } -void -DirectFB_MaximizeWindow(_THIS, SDL_Window * window) +void DirectFB_MaximizeWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); @@ -345,16 +335,14 @@ DirectFB_MaximizeWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->SetOptions(windata->dfbwin, wopts)); } -void -DirectFB_MinimizeWindow(_THIS, SDL_Window * window) +void DirectFB_MinimizeWindow(_THIS, SDL_Window * window) { /* FIXME: Size to 32x32 ? */ SDL_Unsupported(); } -void -DirectFB_RestoreWindow(_THIS, SDL_Window * window) +void DirectFB_RestoreWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); DFBWindowOptions wopts; @@ -382,8 +370,7 @@ DirectFB_RestoreWindow(_THIS, SDL_Window * window) } -void -DirectFB_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void DirectFB_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { SDL_DFB_WINDOWDATA(window); @@ -394,8 +381,7 @@ DirectFB_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) } } -void -DirectFB_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void DirectFB_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { SDL_DFB_WINDOWDATA(window); @@ -406,8 +392,7 @@ DirectFB_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) } } -void -DirectFB_DestroyWindow(_THIS, SDL_Window * window) +void DirectFB_DestroyWindow(_THIS, SDL_Window * window) { SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); @@ -417,7 +402,7 @@ DirectFB_DestroyWindow(_THIS, SDL_Window * window) SDL_DFB_CHECK(windata->dfbwin->UngrabPointer(windata->dfbwin)); SDL_DFB_CHECK(windata->dfbwin->UngrabKeyboard(windata->dfbwin)); -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL DirectFB_GL_DestroyWindowContexts(_this, window); #endif @@ -455,8 +440,7 @@ DirectFB_DestroyWindow(_THIS, SDL_Window * window) return; } -SDL_bool -DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window, +SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo * info) { const Uint32 version = ((((Uint32) info->version.major) * 1000000) + @@ -495,8 +479,7 @@ DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window, } } -void -DirectFB_AdjustWindowSurface(SDL_Window * window) +void DirectFB_AdjustWindowSurface(SDL_Window * window) { SDL_DFB_WINDOWDATA(window); int adjust = windata->wm_needs_redraw; @@ -512,7 +495,7 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) } if (adjust) { -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window); #endif @@ -541,7 +524,7 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) #endif DirectFB_WM_RedrawLayout(SDL_GetVideoDevice(), window); -#if SDL_DIRECTFB_OPENGL +#ifdef SDL_DIRECTFB_OPENGL DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window); #endif } @@ -549,8 +532,7 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) return; } -int -DirectFB_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) +int DirectFB_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) { const Uint8 alpha = (Uint8) ((unsigned int) (opacity * 255.0f)); SDL_DFB_WINDOWDATA(window); diff --git a/src/video/directfb/SDL_DirectFB_window.h b/src/video/directfb/SDL_DirectFB_window.h index fc0b22ccc68e8..8046b6221421a 100644 --- a/src/video/directfb/SDL_DirectFB_window.h +++ b/src/video/directfb/SDL_DirectFB_window.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/dummy/SDL_nullevents.c b/src/video/dummy/SDL_nullevents.c index e58ba29781168..c961d197b2aea 100644 --- a/src/video/dummy/SDL_nullevents.c +++ b/src/video/dummy/SDL_nullevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DUMMY +#ifdef SDL_VIDEO_DRIVER_DUMMY /* Being a null driver, there's no event stream. We just define stubs for most of the API. */ @@ -30,8 +30,7 @@ #include "SDL_nullvideo.h" #include "SDL_nullevents_c.h" -void -DUMMY_PumpEvents(_THIS) +void DUMMY_PumpEvents(_THIS) { /* do nothing. */ } diff --git a/src/video/dummy/SDL_nullevents_c.h b/src/video/dummy/SDL_nullevents_c.h index 54eb74c915040..5e6730b3cbca8 100644 --- a/src/video/dummy/SDL_nullevents_c.h +++ b/src/video/dummy/SDL_nullevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index dd7cbbd165f04..879b77484ef5f 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DUMMY +#ifdef SDL_VIDEO_DRIVER_DUMMY #include "../SDL_sysvideo.h" #include "SDL_nullframebuffer_c.h" +#define DUMMY_SURFACE "_SDL_DummySurface" -#define DUMMY_SURFACE "_SDL_DummySurface" - -int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; @@ -38,7 +37,7 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma SDL_DUMMY_DestroyWindowFramebuffer(_this, window); /* Create a new one */ - SDL_GetWindowSize(window, &w, &h); + SDL_GetWindowSizeInPixels(window, &w, &h); surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 0, surface_format); if (!surface) { return -1; @@ -52,12 +51,12 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma return 0; } -int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE); + surface = (SDL_Surface *)SDL_GetWindowData(window, DUMMY_SURFACE); if (!surface) { return SDL_SetError("Couldn't find dummy surface for window"); } @@ -65,18 +64,18 @@ int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect /* Send the data to the display */ if (SDL_getenv("SDL_VIDEO_DUMMY_SAVE_FRAMES")) { char file[128]; - SDL_snprintf(file, sizeof(file), "SDL_window%" SDL_PRIu32 "-%8.8d.bmp", - SDL_GetWindowID(window), ++frame_number); + (void)SDL_snprintf(file, sizeof(file), "SDL_window%" SDL_PRIu32 "-%8.8d.bmp", + SDL_GetWindowID(window), ++frame_number); SDL_SaveBMP(surface, file); } return 0; } -void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { SDL_Surface *surface; - surface = (SDL_Surface *) SDL_SetWindowData(window, DUMMY_SURFACE, NULL); + surface = (SDL_Surface *)SDL_SetWindowData(window, DUMMY_SURFACE, NULL); SDL_FreeSurface(surface); } diff --git a/src/video/dummy/SDL_nullframebuffer_c.h b/src/video/dummy/SDL_nullframebuffer_c.h index cd8158e47c509..aeca720dbac08 100644 --- a/src/video/dummy/SDL_nullframebuffer_c.h +++ b/src/video/dummy/SDL_nullframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,9 @@ #include "../../SDL_internal.h" -extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window); #endif /* SDL_nullframebuffer_c_h_ */ diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index df6c769cf75ab..b5c60bb0fffe8 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_DUMMY +#ifdef SDL_VIDEO_DRIVER_DUMMY /* Dummy SDL video driver implementation; this is just enough to make an * SDL-based application THINK it's got a working video driver, for @@ -48,72 +48,67 @@ #include "SDL_nullframebuffer_c.h" #include "SDL_hints.h" -#define DUMMYVID_DRIVER_NAME "dummy" +#define DUMMYVID_DRIVER_NAME "dummy" #define DUMMYVID_DRIVER_EVDEV_NAME "evdev" /* Initialization/Query functions */ static int DUMMY_VideoInit(_THIS); -static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); static void DUMMY_VideoQuit(_THIS); -#if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV static int evdev = 0; static void DUMMY_EVDEV_Poll(_THIS); #endif /* DUMMY driver bootstrap functions */ -static int -DUMMY_Available(void) +static int DUMMY_Available(void) { const char *envr = SDL_GetHint(SDL_HINT_VIDEODRIVER); if (envr) { if (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0) { return 1; } - #if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV if (SDL_strcmp(envr, DUMMYVID_DRIVER_EVDEV_NAME) == 0) { evdev = 1; return 1; } - #endif +#endif } return 0; } -static void -DUMMY_DeleteDevice(SDL_VideoDevice * device) +static void DUMMY_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device); } -static SDL_VideoDevice * -DUMMY_CreateDevice(void) +static SDL_VideoDevice *DUMMY_CreateDevice(void) { SDL_VideoDevice *device; if (!DUMMY_Available()) { - return (0); + return 0; } /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } device->is_dummy = SDL_TRUE; /* Set the function pointers */ device->VideoInit = DUMMY_VideoInit; device->VideoQuit = DUMMY_VideoQuit; - device->SetDisplayMode = DUMMY_SetDisplayMode; device->PumpEvents = DUMMY_PumpEvents; - #if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV if (evdev) { device->PumpEvents = DUMMY_EVDEV_Poll; } - #endif +#endif device->CreateWindowFramebuffer = SDL_DUMMY_CreateWindowFramebuffer; device->UpdateWindowFramebuffer = SDL_DUMMY_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = SDL_DUMMY_DestroyWindowFramebuffer; @@ -125,25 +120,27 @@ DUMMY_CreateDevice(void) VideoBootStrap DUMMY_bootstrap = { DUMMYVID_DRIVER_NAME, "SDL dummy video driver", - DUMMY_CreateDevice + DUMMY_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; -#if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV VideoBootStrap DUMMY_evdev_bootstrap = { DUMMYVID_DRIVER_EVDEV_NAME, "SDL dummy video driver with evdev", - DUMMY_CreateDevice + DUMMY_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; void SDL_EVDEV_Init(void); -void SDL_EVDEV_Poll(); +void SDL_EVDEV_Poll(void); void SDL_EVDEV_Quit(void); -static void DUMMY_EVDEV_Poll(_THIS) { - (void) _this; +static void DUMMY_EVDEV_Poll(_THIS) +{ + (void)_this; SDL_EVDEV_Poll(); } #endif -int -DUMMY_VideoInit(_THIS) +int DUMMY_VideoInit(_THIS) { SDL_DisplayMode mode; @@ -152,7 +149,7 @@ DUMMY_VideoInit(_THIS) mode.format = SDL_PIXELFORMAT_RGB888; mode.w = 1024; mode.h = 768; - mode.refresh_rate = 0; + mode.refresh_rate = 60; mode.driverdata = NULL; if (SDL_AddBasicVideoDisplay(&mode) < 0) { return -1; @@ -160,27 +157,19 @@ DUMMY_VideoInit(_THIS) SDL_AddDisplayMode(&_this->displays[0], &mode); - #if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Init(); - #endif +#endif /* We're done! */ return 0; } -static int -DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) -{ - return 0; -} - - -void -DUMMY_VideoQuit(_THIS) +void DUMMY_VideoQuit(_THIS) { - #if SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Quit(); - #endif +#endif } #endif /* SDL_VIDEO_DRIVER_DUMMY */ diff --git a/src/video/dummy/SDL_nullvideo.h b/src/video/dummy/SDL_nullvideo.h index c07aaf1445070..42927321c8497 100644 --- a/src/video/dummy/SDL_nullvideo.h +++ b/src/video/dummy/SDL_nullvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index deb12b47a479d..9957c1a361fb2 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN +#ifdef SDL_VIDEO_DRIVER_EMSCRIPTEN #include #include @@ -44,232 +44,231 @@ https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode */ static const SDL_Keycode emscripten_keycode_table[] = { - /* 0 */ SDLK_UNKNOWN, - /* 1 */ SDLK_UNKNOWN, - /* 2 */ SDLK_UNKNOWN, - /* 3 */ SDLK_CANCEL, - /* 4 */ SDLK_UNKNOWN, - /* 5 */ SDLK_UNKNOWN, - /* 6 */ SDLK_HELP, - /* 7 */ SDLK_UNKNOWN, - /* 8 */ SDLK_BACKSPACE, - /* 9 */ SDLK_TAB, - /* 10 */ SDLK_UNKNOWN, - /* 11 */ SDLK_UNKNOWN, - /* 12 */ SDLK_KP_5, - /* 13 */ SDLK_RETURN, - /* 14 */ SDLK_UNKNOWN, - /* 15 */ SDLK_UNKNOWN, - /* 16 */ SDLK_LSHIFT, - /* 17 */ SDLK_LCTRL, - /* 18 */ SDLK_LALT, - /* 19 */ SDLK_PAUSE, - /* 20 */ SDLK_CAPSLOCK, - /* 21 */ SDLK_UNKNOWN, - /* 22 */ SDLK_UNKNOWN, - /* 23 */ SDLK_UNKNOWN, - /* 24 */ SDLK_UNKNOWN, - /* 25 */ SDLK_UNKNOWN, - /* 26 */ SDLK_UNKNOWN, - /* 27 */ SDLK_ESCAPE, - /* 28 */ SDLK_UNKNOWN, - /* 29 */ SDLK_UNKNOWN, - /* 30 */ SDLK_UNKNOWN, - /* 31 */ SDLK_UNKNOWN, - /* 32 */ SDLK_SPACE, - /* 33 */ SDLK_PAGEUP, - /* 34 */ SDLK_PAGEDOWN, - /* 35 */ SDLK_END, - /* 36 */ SDLK_HOME, - /* 37 */ SDLK_LEFT, - /* 38 */ SDLK_UP, - /* 39 */ SDLK_RIGHT, - /* 40 */ SDLK_DOWN, - /* 41 */ SDLK_UNKNOWN, - /* 42 */ SDLK_UNKNOWN, - /* 43 */ SDLK_UNKNOWN, - /* 44 */ SDLK_UNKNOWN, - /* 45 */ SDLK_INSERT, - /* 46 */ SDLK_DELETE, - /* 47 */ SDLK_UNKNOWN, - /* 48 */ SDLK_0, - /* 49 */ SDLK_1, - /* 50 */ SDLK_2, - /* 51 */ SDLK_3, - /* 52 */ SDLK_4, - /* 53 */ SDLK_5, - /* 54 */ SDLK_6, - /* 55 */ SDLK_7, - /* 56 */ SDLK_8, - /* 57 */ SDLK_9, - /* 58 */ SDLK_UNKNOWN, - /* 59 */ SDLK_SEMICOLON, - /* 60 */ SDLK_BACKSLASH /*SDL_SCANCODE_NONUSBACKSLASH*/, - /* 61 */ SDLK_EQUALS, - /* 62 */ SDLK_UNKNOWN, - /* 63 */ SDLK_MINUS, - /* 64 */ SDLK_UNKNOWN, - /* 65 */ SDLK_a, - /* 66 */ SDLK_b, - /* 67 */ SDLK_c, - /* 68 */ SDLK_d, - /* 69 */ SDLK_e, - /* 70 */ SDLK_f, - /* 71 */ SDLK_g, - /* 72 */ SDLK_h, - /* 73 */ SDLK_i, - /* 74 */ SDLK_j, - /* 75 */ SDLK_k, - /* 76 */ SDLK_l, - /* 77 */ SDLK_m, - /* 78 */ SDLK_n, - /* 79 */ SDLK_o, - /* 80 */ SDLK_p, - /* 81 */ SDLK_q, - /* 82 */ SDLK_r, - /* 83 */ SDLK_s, - /* 84 */ SDLK_t, - /* 85 */ SDLK_u, - /* 86 */ SDLK_v, - /* 87 */ SDLK_w, - /* 88 */ SDLK_x, - /* 89 */ SDLK_y, - /* 90 */ SDLK_z, - /* 91 */ SDLK_LGUI, - /* 92 */ SDLK_UNKNOWN, - /* 93 */ SDLK_APPLICATION, - /* 94 */ SDLK_UNKNOWN, - /* 95 */ SDLK_UNKNOWN, - /* 96 */ SDLK_KP_0, - /* 97 */ SDLK_KP_1, - /* 98 */ SDLK_KP_2, - /* 99 */ SDLK_KP_3, - /* 100 */ SDLK_KP_4, - /* 101 */ SDLK_KP_5, - /* 102 */ SDLK_KP_6, - /* 103 */ SDLK_KP_7, - /* 104 */ SDLK_KP_8, - /* 105 */ SDLK_KP_9, - /* 106 */ SDLK_KP_MULTIPLY, - /* 107 */ SDLK_KP_PLUS, - /* 108 */ SDLK_UNKNOWN, - /* 109 */ SDLK_KP_MINUS, - /* 110 */ SDLK_KP_PERIOD, - /* 111 */ SDLK_KP_DIVIDE, - /* 112 */ SDLK_F1, - /* 113 */ SDLK_F2, - /* 114 */ SDLK_F3, - /* 115 */ SDLK_F4, - /* 116 */ SDLK_F5, - /* 117 */ SDLK_F6, - /* 118 */ SDLK_F7, - /* 119 */ SDLK_F8, - /* 120 */ SDLK_F9, - /* 121 */ SDLK_F10, - /* 122 */ SDLK_F11, - /* 123 */ SDLK_F12, - /* 124 */ SDLK_F13, - /* 125 */ SDLK_F14, - /* 126 */ SDLK_F15, - /* 127 */ SDLK_F16, - /* 128 */ SDLK_F17, - /* 129 */ SDLK_F18, - /* 130 */ SDLK_F19, - /* 131 */ SDLK_F20, - /* 132 */ SDLK_F21, - /* 133 */ SDLK_F22, - /* 134 */ SDLK_F23, - /* 135 */ SDLK_F24, - /* 136 */ SDLK_UNKNOWN, - /* 137 */ SDLK_UNKNOWN, - /* 138 */ SDLK_UNKNOWN, - /* 139 */ SDLK_UNKNOWN, - /* 140 */ SDLK_UNKNOWN, - /* 141 */ SDLK_UNKNOWN, - /* 142 */ SDLK_UNKNOWN, - /* 143 */ SDLK_UNKNOWN, - /* 144 */ SDLK_NUMLOCKCLEAR, - /* 145 */ SDLK_SCROLLLOCK, - /* 146 */ SDLK_UNKNOWN, - /* 147 */ SDLK_UNKNOWN, - /* 148 */ SDLK_UNKNOWN, - /* 149 */ SDLK_UNKNOWN, - /* 150 */ SDLK_UNKNOWN, - /* 151 */ SDLK_UNKNOWN, - /* 152 */ SDLK_UNKNOWN, - /* 153 */ SDLK_UNKNOWN, - /* 154 */ SDLK_UNKNOWN, - /* 155 */ SDLK_UNKNOWN, - /* 156 */ SDLK_UNKNOWN, - /* 157 */ SDLK_UNKNOWN, - /* 158 */ SDLK_UNKNOWN, - /* 159 */ SDLK_UNKNOWN, - /* 160 */ SDLK_BACKQUOTE, - /* 161 */ SDLK_UNKNOWN, - /* 162 */ SDLK_UNKNOWN, - /* 163 */ SDLK_KP_HASH, /*KaiOS phone keypad*/ - /* 164 */ SDLK_UNKNOWN, - /* 165 */ SDLK_UNKNOWN, - /* 166 */ SDLK_UNKNOWN, - /* 167 */ SDLK_UNKNOWN, - /* 168 */ SDLK_UNKNOWN, - /* 169 */ SDLK_UNKNOWN, - /* 170 */ SDLK_KP_MULTIPLY, /*KaiOS phone keypad*/ - /* 171 */ SDLK_RIGHTBRACKET, - /* 172 */ SDLK_UNKNOWN, - /* 173 */ SDLK_MINUS, /*FX*/ - /* 174 */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ - /* 175 */ SDLK_VOLUMEUP, /*IE, Chrome*/ - /* 176 */ SDLK_AUDIONEXT, /*IE, Chrome*/ - /* 177 */ SDLK_AUDIOPREV, /*IE, Chrome*/ - /* 178 */ SDLK_UNKNOWN, - /* 179 */ SDLK_AUDIOPLAY, /*IE, Chrome*/ - /* 180 */ SDLK_UNKNOWN, - /* 181 */ SDLK_AUDIOMUTE, /*FX*/ - /* 182 */ SDLK_VOLUMEDOWN, /*FX*/ - /* 183 */ SDLK_VOLUMEUP, /*FX*/ - /* 184 */ SDLK_UNKNOWN, - /* 185 */ SDLK_UNKNOWN, - /* 186 */ SDLK_SEMICOLON, /*IE, Chrome, D3E legacy*/ - /* 187 */ SDLK_EQUALS, /*IE, Chrome, D3E legacy*/ - /* 188 */ SDLK_COMMA, - /* 189 */ SDLK_MINUS, /*IE, Chrome, D3E legacy*/ - /* 190 */ SDLK_PERIOD, - /* 191 */ SDLK_SLASH, - /* 192 */ SDLK_BACKQUOTE, /*FX, D3E legacy (SDLK_APOSTROPHE in IE/Chrome)*/ - /* 193 */ SDLK_UNKNOWN, - /* 194 */ SDLK_UNKNOWN, - /* 195 */ SDLK_UNKNOWN, - /* 196 */ SDLK_UNKNOWN, - /* 197 */ SDLK_UNKNOWN, - /* 198 */ SDLK_UNKNOWN, - /* 199 */ SDLK_UNKNOWN, - /* 200 */ SDLK_UNKNOWN, - /* 201 */ SDLK_UNKNOWN, - /* 202 */ SDLK_UNKNOWN, - /* 203 */ SDLK_UNKNOWN, - /* 204 */ SDLK_UNKNOWN, - /* 205 */ SDLK_UNKNOWN, - /* 206 */ SDLK_UNKNOWN, - /* 207 */ SDLK_UNKNOWN, - /* 208 */ SDLK_UNKNOWN, - /* 209 */ SDLK_UNKNOWN, - /* 210 */ SDLK_UNKNOWN, - /* 211 */ SDLK_UNKNOWN, - /* 212 */ SDLK_UNKNOWN, - /* 213 */ SDLK_UNKNOWN, - /* 214 */ SDLK_UNKNOWN, - /* 215 */ SDLK_UNKNOWN, - /* 216 */ SDLK_UNKNOWN, - /* 217 */ SDLK_UNKNOWN, - /* 218 */ SDLK_UNKNOWN, - /* 219 */ SDLK_LEFTBRACKET, - /* 220 */ SDLK_BACKSLASH, - /* 221 */ SDLK_RIGHTBRACKET, - /* 222 */ SDLK_QUOTE, /*FX, D3E legacy*/ + /* 0 */ SDLK_UNKNOWN, + /* 1 */ SDLK_UNKNOWN, + /* 2 */ SDLK_UNKNOWN, + /* 3 */ SDLK_CANCEL, + /* 4 */ SDLK_UNKNOWN, + /* 5 */ SDLK_UNKNOWN, + /* 6 */ SDLK_HELP, + /* 7 */ SDLK_UNKNOWN, + /* 8 */ SDLK_BACKSPACE, + /* 9 */ SDLK_TAB, + /* 10 */ SDLK_UNKNOWN, + /* 11 */ SDLK_UNKNOWN, + /* 12 */ SDLK_KP_5, + /* 13 */ SDLK_RETURN, + /* 14 */ SDLK_UNKNOWN, + /* 15 */ SDLK_UNKNOWN, + /* 16 */ SDLK_LSHIFT, + /* 17 */ SDLK_LCTRL, + /* 18 */ SDLK_LALT, + /* 19 */ SDLK_PAUSE, + /* 20 */ SDLK_CAPSLOCK, + /* 21 */ SDLK_UNKNOWN, + /* 22 */ SDLK_UNKNOWN, + /* 23 */ SDLK_UNKNOWN, + /* 24 */ SDLK_UNKNOWN, + /* 25 */ SDLK_UNKNOWN, + /* 26 */ SDLK_UNKNOWN, + /* 27 */ SDLK_ESCAPE, + /* 28 */ SDLK_UNKNOWN, + /* 29 */ SDLK_UNKNOWN, + /* 30 */ SDLK_UNKNOWN, + /* 31 */ SDLK_UNKNOWN, + /* 32 */ SDLK_SPACE, + /* 33 */ SDLK_PAGEUP, + /* 34 */ SDLK_PAGEDOWN, + /* 35 */ SDLK_END, + /* 36 */ SDLK_HOME, + /* 37 */ SDLK_LEFT, + /* 38 */ SDLK_UP, + /* 39 */ SDLK_RIGHT, + /* 40 */ SDLK_DOWN, + /* 41 */ SDLK_UNKNOWN, + /* 42 */ SDLK_UNKNOWN, + /* 43 */ SDLK_UNKNOWN, + /* 44 */ SDLK_UNKNOWN, + /* 45 */ SDLK_INSERT, + /* 46 */ SDLK_DELETE, + /* 47 */ SDLK_UNKNOWN, + /* 48 */ SDLK_0, + /* 49 */ SDLK_1, + /* 50 */ SDLK_2, + /* 51 */ SDLK_3, + /* 52 */ SDLK_4, + /* 53 */ SDLK_5, + /* 54 */ SDLK_6, + /* 55 */ SDLK_7, + /* 56 */ SDLK_8, + /* 57 */ SDLK_9, + /* 58 */ SDLK_UNKNOWN, + /* 59 */ SDLK_SEMICOLON, + /* 60 */ SDLK_BACKSLASH /*SDL_SCANCODE_NONUSBACKSLASH*/, + /* 61 */ SDLK_EQUALS, + /* 62 */ SDLK_UNKNOWN, + /* 63 */ SDLK_MINUS, + /* 64 */ SDLK_UNKNOWN, + /* 65 */ SDLK_a, + /* 66 */ SDLK_b, + /* 67 */ SDLK_c, + /* 68 */ SDLK_d, + /* 69 */ SDLK_e, + /* 70 */ SDLK_f, + /* 71 */ SDLK_g, + /* 72 */ SDLK_h, + /* 73 */ SDLK_i, + /* 74 */ SDLK_j, + /* 75 */ SDLK_k, + /* 76 */ SDLK_l, + /* 77 */ SDLK_m, + /* 78 */ SDLK_n, + /* 79 */ SDLK_o, + /* 80 */ SDLK_p, + /* 81 */ SDLK_q, + /* 82 */ SDLK_r, + /* 83 */ SDLK_s, + /* 84 */ SDLK_t, + /* 85 */ SDLK_u, + /* 86 */ SDLK_v, + /* 87 */ SDLK_w, + /* 88 */ SDLK_x, + /* 89 */ SDLK_y, + /* 90 */ SDLK_z, + /* 91 */ SDLK_LGUI, + /* 92 */ SDLK_UNKNOWN, + /* 93 */ SDLK_APPLICATION, + /* 94 */ SDLK_UNKNOWN, + /* 95 */ SDLK_UNKNOWN, + /* 96 */ SDLK_KP_0, + /* 97 */ SDLK_KP_1, + /* 98 */ SDLK_KP_2, + /* 99 */ SDLK_KP_3, + /* 100 */ SDLK_KP_4, + /* 101 */ SDLK_KP_5, + /* 102 */ SDLK_KP_6, + /* 103 */ SDLK_KP_7, + /* 104 */ SDLK_KP_8, + /* 105 */ SDLK_KP_9, + /* 106 */ SDLK_KP_MULTIPLY, + /* 107 */ SDLK_KP_PLUS, + /* 108 */ SDLK_UNKNOWN, + /* 109 */ SDLK_KP_MINUS, + /* 110 */ SDLK_KP_PERIOD, + /* 111 */ SDLK_KP_DIVIDE, + /* 112 */ SDLK_F1, + /* 113 */ SDLK_F2, + /* 114 */ SDLK_F3, + /* 115 */ SDLK_F4, + /* 116 */ SDLK_F5, + /* 117 */ SDLK_F6, + /* 118 */ SDLK_F7, + /* 119 */ SDLK_F8, + /* 120 */ SDLK_F9, + /* 121 */ SDLK_F10, + /* 122 */ SDLK_F11, + /* 123 */ SDLK_F12, + /* 124 */ SDLK_F13, + /* 125 */ SDLK_F14, + /* 126 */ SDLK_F15, + /* 127 */ SDLK_F16, + /* 128 */ SDLK_F17, + /* 129 */ SDLK_F18, + /* 130 */ SDLK_F19, + /* 131 */ SDLK_F20, + /* 132 */ SDLK_F21, + /* 133 */ SDLK_F22, + /* 134 */ SDLK_F23, + /* 135 */ SDLK_F24, + /* 136 */ SDLK_UNKNOWN, + /* 137 */ SDLK_UNKNOWN, + /* 138 */ SDLK_UNKNOWN, + /* 139 */ SDLK_UNKNOWN, + /* 140 */ SDLK_UNKNOWN, + /* 141 */ SDLK_UNKNOWN, + /* 142 */ SDLK_UNKNOWN, + /* 143 */ SDLK_UNKNOWN, + /* 144 */ SDLK_NUMLOCKCLEAR, + /* 145 */ SDLK_SCROLLLOCK, + /* 146 */ SDLK_UNKNOWN, + /* 147 */ SDLK_UNKNOWN, + /* 148 */ SDLK_UNKNOWN, + /* 149 */ SDLK_UNKNOWN, + /* 150 */ SDLK_UNKNOWN, + /* 151 */ SDLK_UNKNOWN, + /* 152 */ SDLK_UNKNOWN, + /* 153 */ SDLK_UNKNOWN, + /* 154 */ SDLK_UNKNOWN, + /* 155 */ SDLK_UNKNOWN, + /* 156 */ SDLK_UNKNOWN, + /* 157 */ SDLK_UNKNOWN, + /* 158 */ SDLK_UNKNOWN, + /* 159 */ SDLK_UNKNOWN, + /* 160 */ SDLK_BACKQUOTE, + /* 161 */ SDLK_UNKNOWN, + /* 162 */ SDLK_UNKNOWN, + /* 163 */ SDLK_KP_HASH, /*KaiOS phone keypad*/ + /* 164 */ SDLK_UNKNOWN, + /* 165 */ SDLK_UNKNOWN, + /* 166 */ SDLK_UNKNOWN, + /* 167 */ SDLK_UNKNOWN, + /* 168 */ SDLK_UNKNOWN, + /* 169 */ SDLK_UNKNOWN, + /* 170 */ SDLK_KP_MULTIPLY, /*KaiOS phone keypad*/ + /* 171 */ SDLK_RIGHTBRACKET, + /* 172 */ SDLK_UNKNOWN, + /* 173 */ SDLK_MINUS, /*FX*/ + /* 174 */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ + /* 175 */ SDLK_VOLUMEUP, /*IE, Chrome*/ + /* 176 */ SDLK_AUDIONEXT, /*IE, Chrome*/ + /* 177 */ SDLK_AUDIOPREV, /*IE, Chrome*/ + /* 178 */ SDLK_UNKNOWN, + /* 179 */ SDLK_AUDIOPLAY, /*IE, Chrome*/ + /* 180 */ SDLK_UNKNOWN, + /* 181 */ SDLK_AUDIOMUTE, /*FX*/ + /* 182 */ SDLK_VOLUMEDOWN, /*FX*/ + /* 183 */ SDLK_VOLUMEUP, /*FX*/ + /* 184 */ SDLK_UNKNOWN, + /* 185 */ SDLK_UNKNOWN, + /* 186 */ SDLK_SEMICOLON, /*IE, Chrome, D3E legacy*/ + /* 187 */ SDLK_EQUALS, /*IE, Chrome, D3E legacy*/ + /* 188 */ SDLK_COMMA, + /* 189 */ SDLK_MINUS, /*IE, Chrome, D3E legacy*/ + /* 190 */ SDLK_PERIOD, + /* 191 */ SDLK_SLASH, + /* 192 */ SDLK_BACKQUOTE, /*FX, D3E legacy (SDLK_APOSTROPHE in IE/Chrome)*/ + /* 193 */ SDLK_UNKNOWN, + /* 194 */ SDLK_UNKNOWN, + /* 195 */ SDLK_UNKNOWN, + /* 196 */ SDLK_UNKNOWN, + /* 197 */ SDLK_UNKNOWN, + /* 198 */ SDLK_UNKNOWN, + /* 199 */ SDLK_UNKNOWN, + /* 200 */ SDLK_UNKNOWN, + /* 201 */ SDLK_UNKNOWN, + /* 202 */ SDLK_UNKNOWN, + /* 203 */ SDLK_UNKNOWN, + /* 204 */ SDLK_UNKNOWN, + /* 205 */ SDLK_UNKNOWN, + /* 206 */ SDLK_UNKNOWN, + /* 207 */ SDLK_UNKNOWN, + /* 208 */ SDLK_UNKNOWN, + /* 209 */ SDLK_UNKNOWN, + /* 210 */ SDLK_UNKNOWN, + /* 211 */ SDLK_UNKNOWN, + /* 212 */ SDLK_UNKNOWN, + /* 213 */ SDLK_UNKNOWN, + /* 214 */ SDLK_UNKNOWN, + /* 215 */ SDLK_UNKNOWN, + /* 216 */ SDLK_UNKNOWN, + /* 217 */ SDLK_UNKNOWN, + /* 218 */ SDLK_UNKNOWN, + /* 219 */ SDLK_LEFTBRACKET, + /* 220 */ SDLK_BACKSLASH, + /* 221 */ SDLK_RIGHTBRACKET, + /* 222 */ SDLK_QUOTE, /*FX, D3E legacy*/ }; - /* Emscripten PK code to scancode https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent @@ -405,8 +404,7 @@ static const SDL_Scancode emscripten_scancode_table[] = { /* 0x7E "NumpadComma" */ SDL_SCANCODE_KP_COMMA }; -static SDL_Scancode -Emscripten_MapScanCode(const char *code) +static SDL_Scancode Emscripten_MapScanCode(const char *code) { const DOM_PK_CODE_TYPE pk_code = emscripten_compute_dom_pk_code(code); if (pk_code < SDL_arraysize(emscripten_scancode_table)) { @@ -414,97 +412,96 @@ Emscripten_MapScanCode(const char *code) } switch (pk_code) { - case DOM_PK_PASTE: - return SDL_SCANCODE_PASTE; - case DOM_PK_MEDIA_TRACK_PREVIOUS: - return SDL_SCANCODE_AUDIOPREV; - case DOM_PK_CUT: - return SDL_SCANCODE_CUT; - case DOM_PK_COPY: - return SDL_SCANCODE_COPY; - case DOM_PK_MEDIA_TRACK_NEXT: - return SDL_SCANCODE_AUDIONEXT; - case DOM_PK_NUMPAD_ENTER: - return SDL_SCANCODE_KP_ENTER; - case DOM_PK_CONTROL_RIGHT: - return SDL_SCANCODE_RCTRL; - case DOM_PK_AUDIO_VOLUME_MUTE: - return SDL_SCANCODE_AUDIOMUTE; - case DOM_PK_LAUNCH_APP_2: - return SDL_SCANCODE_CALCULATOR; - case DOM_PK_MEDIA_PLAY_PAUSE: - return SDL_SCANCODE_AUDIOPLAY; - case DOM_PK_MEDIA_STOP: - return SDL_SCANCODE_AUDIOSTOP; - case DOM_PK_EJECT: - return SDL_SCANCODE_EJECT; - case DOM_PK_AUDIO_VOLUME_DOWN: - return SDL_SCANCODE_VOLUMEDOWN; - case DOM_PK_AUDIO_VOLUME_UP: - return SDL_SCANCODE_VOLUMEUP; - case DOM_PK_BROWSER_HOME: - return SDL_SCANCODE_AC_HOME; - case DOM_PK_NUMPAD_DIVIDE: - return SDL_SCANCODE_KP_DIVIDE; - case DOM_PK_ALT_RIGHT: - return SDL_SCANCODE_RALT; - case DOM_PK_HELP: - return SDL_SCANCODE_HELP; - case DOM_PK_NUM_LOCK: - return SDL_SCANCODE_NUMLOCKCLEAR; - case DOM_PK_HOME: - return SDL_SCANCODE_HOME; - case DOM_PK_ARROW_UP: - return SDL_SCANCODE_UP; - case DOM_PK_PAGE_UP: - return SDL_SCANCODE_PAGEUP; - case DOM_PK_ARROW_LEFT: - return SDL_SCANCODE_LEFT; - case DOM_PK_ARROW_RIGHT: - return SDL_SCANCODE_RIGHT; - case DOM_PK_END: - return SDL_SCANCODE_END; - case DOM_PK_ARROW_DOWN: - return SDL_SCANCODE_DOWN; - case DOM_PK_PAGE_DOWN: - return SDL_SCANCODE_PAGEDOWN; - case DOM_PK_INSERT: - return SDL_SCANCODE_INSERT; - case DOM_PK_DELETE: - return SDL_SCANCODE_DELETE; - case DOM_PK_META_LEFT: - return SDL_SCANCODE_LGUI; - case DOM_PK_META_RIGHT: - return SDL_SCANCODE_RGUI; - case DOM_PK_CONTEXT_MENU: - return SDL_SCANCODE_APPLICATION; - case DOM_PK_POWER: - return SDL_SCANCODE_POWER; - case DOM_PK_BROWSER_SEARCH: - return SDL_SCANCODE_AC_SEARCH; - case DOM_PK_BROWSER_FAVORITES: - return SDL_SCANCODE_AC_BOOKMARKS; - case DOM_PK_BROWSER_REFRESH: - return SDL_SCANCODE_AC_REFRESH; - case DOM_PK_BROWSER_STOP: - return SDL_SCANCODE_AC_STOP; - case DOM_PK_BROWSER_FORWARD: - return SDL_SCANCODE_AC_FORWARD; - case DOM_PK_BROWSER_BACK: - return SDL_SCANCODE_AC_BACK; - case DOM_PK_LAUNCH_APP_1: - return SDL_SCANCODE_COMPUTER; - case DOM_PK_LAUNCH_MAIL: - return SDL_SCANCODE_MAIL; - case DOM_PK_MEDIA_SELECT: - return SDL_SCANCODE_MEDIASELECT; + case DOM_PK_PASTE: + return SDL_SCANCODE_PASTE; + case DOM_PK_MEDIA_TRACK_PREVIOUS: + return SDL_SCANCODE_AUDIOPREV; + case DOM_PK_CUT: + return SDL_SCANCODE_CUT; + case DOM_PK_COPY: + return SDL_SCANCODE_COPY; + case DOM_PK_MEDIA_TRACK_NEXT: + return SDL_SCANCODE_AUDIONEXT; + case DOM_PK_NUMPAD_ENTER: + return SDL_SCANCODE_KP_ENTER; + case DOM_PK_CONTROL_RIGHT: + return SDL_SCANCODE_RCTRL; + case DOM_PK_AUDIO_VOLUME_MUTE: + return SDL_SCANCODE_AUDIOMUTE; + case DOM_PK_LAUNCH_APP_2: + return SDL_SCANCODE_CALCULATOR; + case DOM_PK_MEDIA_PLAY_PAUSE: + return SDL_SCANCODE_AUDIOPLAY; + case DOM_PK_MEDIA_STOP: + return SDL_SCANCODE_AUDIOSTOP; + case DOM_PK_EJECT: + return SDL_SCANCODE_EJECT; + case DOM_PK_AUDIO_VOLUME_DOWN: + return SDL_SCANCODE_VOLUMEDOWN; + case DOM_PK_AUDIO_VOLUME_UP: + return SDL_SCANCODE_VOLUMEUP; + case DOM_PK_BROWSER_HOME: + return SDL_SCANCODE_AC_HOME; + case DOM_PK_NUMPAD_DIVIDE: + return SDL_SCANCODE_KP_DIVIDE; + case DOM_PK_ALT_RIGHT: + return SDL_SCANCODE_RALT; + case DOM_PK_HELP: + return SDL_SCANCODE_HELP; + case DOM_PK_NUM_LOCK: + return SDL_SCANCODE_NUMLOCKCLEAR; + case DOM_PK_HOME: + return SDL_SCANCODE_HOME; + case DOM_PK_ARROW_UP: + return SDL_SCANCODE_UP; + case DOM_PK_PAGE_UP: + return SDL_SCANCODE_PAGEUP; + case DOM_PK_ARROW_LEFT: + return SDL_SCANCODE_LEFT; + case DOM_PK_ARROW_RIGHT: + return SDL_SCANCODE_RIGHT; + case DOM_PK_END: + return SDL_SCANCODE_END; + case DOM_PK_ARROW_DOWN: + return SDL_SCANCODE_DOWN; + case DOM_PK_PAGE_DOWN: + return SDL_SCANCODE_PAGEDOWN; + case DOM_PK_INSERT: + return SDL_SCANCODE_INSERT; + case DOM_PK_DELETE: + return SDL_SCANCODE_DELETE; + case DOM_PK_META_LEFT: + return SDL_SCANCODE_LGUI; + case DOM_PK_META_RIGHT: + return SDL_SCANCODE_RGUI; + case DOM_PK_CONTEXT_MENU: + return SDL_SCANCODE_APPLICATION; + case DOM_PK_POWER: + return SDL_SCANCODE_POWER; + case DOM_PK_BROWSER_SEARCH: + return SDL_SCANCODE_AC_SEARCH; + case DOM_PK_BROWSER_FAVORITES: + return SDL_SCANCODE_AC_BOOKMARKS; + case DOM_PK_BROWSER_REFRESH: + return SDL_SCANCODE_AC_REFRESH; + case DOM_PK_BROWSER_STOP: + return SDL_SCANCODE_AC_STOP; + case DOM_PK_BROWSER_FORWARD: + return SDL_SCANCODE_AC_FORWARD; + case DOM_PK_BROWSER_BACK: + return SDL_SCANCODE_AC_BACK; + case DOM_PK_LAUNCH_APP_1: + return SDL_SCANCODE_COMPUTER; + case DOM_PK_LAUNCH_MAIL: + return SDL_SCANCODE_MAIL; + case DOM_PK_MEDIA_SELECT: + return SDL_SCANCODE_MEDIASELECT; } return SDL_SCANCODE_UNKNOWN; } -static SDL_Keycode -Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent) +static SDL_Keycode Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent) { SDL_Keycode keycode = SDLK_UNKNOWN; if (keyEvent->keyCode < SDL_arraysize(emscripten_keycode_table)) { @@ -512,66 +509,66 @@ Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent) if (keycode != SDLK_UNKNOWN) { if (keyEvent->location == DOM_KEY_LOCATION_RIGHT) { switch (keycode) { - case SDLK_LSHIFT: - keycode = SDLK_RSHIFT; - break; - case SDLK_LCTRL: - keycode = SDLK_RCTRL; - break; - case SDLK_LALT: - keycode = SDLK_RALT; - break; - case SDLK_LGUI: - keycode = SDLK_RGUI; - break; + case SDLK_LSHIFT: + keycode = SDLK_RSHIFT; + break; + case SDLK_LCTRL: + keycode = SDLK_RCTRL; + break; + case SDLK_LALT: + keycode = SDLK_RALT; + break; + case SDLK_LGUI: + keycode = SDLK_RGUI; + break; } } else if (keyEvent->location == DOM_KEY_LOCATION_NUMPAD) { switch (keycode) { - case SDLK_0: - case SDLK_INSERT: - keycode = SDLK_KP_0; - break; - case SDLK_1: - case SDLK_END: - keycode = SDLK_KP_1; - break; - case SDLK_2: - case SDLK_DOWN: - keycode = SDLK_KP_2; - break; - case SDLK_3: - case SDLK_PAGEDOWN: - keycode = SDLK_KP_3; - break; - case SDLK_4: - case SDLK_LEFT: - keycode = SDLK_KP_4; - break; - case SDLK_5: - keycode = SDLK_KP_5; - break; - case SDLK_6: - case SDLK_RIGHT: - keycode = SDLK_KP_6; - break; - case SDLK_7: - case SDLK_HOME: - keycode = SDLK_KP_7; - break; - case SDLK_8: - case SDLK_UP: - keycode = SDLK_KP_8; - break; - case SDLK_9: - case SDLK_PAGEUP: - keycode = SDLK_KP_9; - break; - case SDLK_RETURN: - keycode = SDLK_KP_ENTER; - break; - case SDLK_DELETE: - keycode = SDLK_KP_PERIOD; - break; + case SDLK_0: + case SDLK_INSERT: + keycode = SDLK_KP_0; + break; + case SDLK_1: + case SDLK_END: + keycode = SDLK_KP_1; + break; + case SDLK_2: + case SDLK_DOWN: + keycode = SDLK_KP_2; + break; + case SDLK_3: + case SDLK_PAGEDOWN: + keycode = SDLK_KP_3; + break; + case SDLK_4: + case SDLK_LEFT: + keycode = SDLK_KP_4; + break; + case SDLK_5: + keycode = SDLK_KP_5; + break; + case SDLK_6: + case SDLK_RIGHT: + keycode = SDLK_KP_6; + break; + case SDLK_7: + case SDLK_HOME: + keycode = SDLK_KP_7; + break; + case SDLK_8: + case SDLK_UP: + keycode = SDLK_KP_8; + break; + case SDLK_9: + case SDLK_PAGEUP: + keycode = SDLK_KP_9; + break; + case SDLK_RETURN: + keycode = SDLK_KP_ENTER; + break; + case SDLK_DELETE: + keycode = SDLK_KP_PERIOD; + break; } } } @@ -581,26 +578,25 @@ Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent) } /* "borrowed" from SDL_windowsevents.c */ -static int -Emscripten_ConvertUTF32toUTF8(Uint32 codepoint, char * text) +static int Emscripten_ConvertUTF32toUTF8(Uint32 codepoint, char *text) { if (codepoint <= 0x7F) { - text[0] = (char) codepoint; + text[0] = (char)codepoint; text[1] = '\0'; } else if (codepoint <= 0x7FF) { - text[0] = 0xC0 | (char) ((codepoint >> 6) & 0x1F); - text[1] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xC0 | (char)((codepoint >> 6) & 0x1F); + text[1] = 0x80 | (char)(codepoint & 0x3F); text[2] = '\0'; } else if (codepoint <= 0xFFFF) { - text[0] = 0xE0 | (char) ((codepoint >> 12) & 0x0F); - text[1] = 0x80 | (char) ((codepoint >> 6) & 0x3F); - text[2] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xE0 | (char)((codepoint >> 12) & 0x0F); + text[1] = 0x80 | (char)((codepoint >> 6) & 0x3F); + text[2] = 0x80 | (char)(codepoint & 0x3F); text[3] = '\0'; } else if (codepoint <= 0x10FFFF) { - text[0] = 0xF0 | (char) ((codepoint >> 18) & 0x0F); - text[1] = 0x80 | (char) ((codepoint >> 12) & 0x3F); - text[2] = 0x80 | (char) ((codepoint >> 6) & 0x3F); - text[3] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xF0 | (char)((codepoint >> 18) & 0x0F); + text[1] = 0x80 | (char)((codepoint >> 12) & 0x3F); + text[2] = 0x80 | (char)((codepoint >> 6) & 0x3F); + text[3] = 0x80 | (char)(codepoint & 0x3F); text[4] = '\0'; } else { return SDL_FALSE; @@ -608,18 +604,15 @@ Emscripten_ConvertUTF32toUTF8(Uint32 codepoint, char * text) return SDL_TRUE; } -static EM_BOOL -Emscripten_HandlePointerLockChange(int eventType, const EmscriptenPointerlockChangeEvent *changeEvent, void *userData) +static EM_BOOL Emscripten_HandlePointerLockChange(int eventType, const EmscriptenPointerlockChangeEvent *changeEvent, void *userData) { - SDL_WindowData *window_data = (SDL_WindowData *) userData; + SDL_WindowData *window_data = (SDL_WindowData *)userData; /* keep track of lock losses, so we can regrab if/when appropriate. */ window_data->has_pointer_lock = changeEvent->isActive; return 0; } - -static EM_BOOL -Emscripten_HandleMouseMove(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) +static EM_BOOL Emscripten_HandleMouseMove(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) { SDL_WindowData *window_data = userData; const int isPointerLocked = window_data->has_pointer_lock; @@ -649,38 +642,39 @@ Emscripten_HandleMouseMove(int eventType, const EmscriptenMouseEvent *mouseEvent return 0; } -static EM_BOOL -Emscripten_HandleMouseButton(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) +static EM_BOOL Emscripten_HandleMouseButton(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) { SDL_WindowData *window_data = userData; Uint8 sdl_button; Uint8 sdl_button_state; SDL_EventType sdl_event_type; double css_w, css_h; + SDL_bool prevent_default = SDL_FALSE; /* needed for iframe implementation in Chrome-based browsers. */ switch (mouseEvent->button) { - case 0: - sdl_button = SDL_BUTTON_LEFT; - break; - case 1: - sdl_button = SDL_BUTTON_MIDDLE; - break; - case 2: - sdl_button = SDL_BUTTON_RIGHT; - break; - default: - return 0; + case 0: + sdl_button = SDL_BUTTON_LEFT; + break; + case 1: + sdl_button = SDL_BUTTON_MIDDLE; + break; + case 2: + sdl_button = SDL_BUTTON_RIGHT; + break; + default: + return 0; } if (eventType == EMSCRIPTEN_EVENT_MOUSEDOWN) { if (SDL_GetMouse()->relative_mode && !window_data->has_pointer_lock) { - emscripten_request_pointerlock(window_data->canvas_id, 0); /* try to regrab lost pointer lock. */ + emscripten_request_pointerlock(window_data->canvas_id, 0); /* try to regrab lost pointer lock. */ } sdl_button_state = SDL_PRESSED; sdl_event_type = SDL_MOUSEBUTTONDOWN; } else { sdl_button_state = SDL_RELEASED; sdl_event_type = SDL_MOUSEBUTTONUP; + prevent_default = SDL_GetEventState(sdl_event_type) == SDL_ENABLE; } SDL_SendMouseButton(window_data->window, 0, sdl_button_state, sdl_button); @@ -691,11 +685,10 @@ Emscripten_HandleMouseButton(int eventType, const EmscriptenMouseEvent *mouseEve return 0; } - return SDL_GetEventState(sdl_event_type) == SDL_ENABLE; + return prevent_default; } -static EM_BOOL -Emscripten_HandleMouseFocus(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) +static EM_BOOL Emscripten_HandleMouseFocus(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData) { SDL_WindowData *window_data = userData; @@ -716,31 +709,33 @@ Emscripten_HandleMouseFocus(int eventType, const EmscriptenMouseEvent *mouseEven return SDL_GetEventState(SDL_WINDOWEVENT) == SDL_ENABLE; } -static EM_BOOL -Emscripten_HandleWheel(int eventType, const EmscriptenWheelEvent *wheelEvent, void *userData) +static EM_BOOL Emscripten_HandleWheel(int eventType, const EmscriptenWheelEvent *wheelEvent, void *userData) { SDL_WindowData *window_data = userData; float deltaY = wheelEvent->deltaY; + float deltaX = wheelEvent->deltaX; switch (wheelEvent->deltaMode) { - case DOM_DELTA_PIXEL: - deltaY /= 100; /* 100 pixels make up a step */ - break; - case DOM_DELTA_LINE: - deltaY /= 3; /* 3 lines make up a step */ - break; - case DOM_DELTA_PAGE: - deltaY *= 80; /* A page makes up 80 steps */ - break; + case DOM_DELTA_PIXEL: + deltaY /= 100; /* 100 pixels make up a step */ + deltaX /= 100; /* 100 pixels make up a step */ + break; + case DOM_DELTA_LINE: + deltaY /= 3; /* 3 lines make up a step */ + deltaX /= 3; /* 3 lines make up a step */ + break; + case DOM_DELTA_PAGE: + deltaY *= 80; /* A page makes up 80 steps */ + deltaX *= 80; /* A page makes up 80 steps */ + break; } - SDL_SendMouseWheel(window_data->window, 0, (float)wheelEvent->deltaX, -deltaY, SDL_MOUSEWHEEL_NORMAL); + SDL_SendMouseWheel(window_data->window, 0, deltaX, -deltaY, SDL_MOUSEWHEEL_NORMAL); return SDL_GetEventState(SDL_MOUSEWHEEL) == SDL_ENABLE; } -static EM_BOOL -Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, void *userData) +static EM_BOOL Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, void *userData) { SDL_WindowData *window_data = userData; /* If the user switches away while keys are pressed (such as @@ -749,22 +744,20 @@ Emscripten_HandleFocus(int eventType, const EmscriptenFocusEvent *wheelEvent, vo SDL_ResetKeyboard(); } - SDL_SendWindowEvent(window_data->window, eventType == EMSCRIPTEN_EVENT_FOCUS ? SDL_WINDOWEVENT_FOCUS_GAINED : SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); return SDL_GetEventState(SDL_WINDOWEVENT) == SDL_ENABLE; } -static EM_BOOL -Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) +static EM_BOOL Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData) { - SDL_WindowData *window_data = (SDL_WindowData *) userData; + SDL_WindowData *window_data = (SDL_WindowData *)userData; int i; double client_w, client_h; int preventDefault = 0; SDL_TouchID deviceId = 1; if (SDL_AddTouch(deviceId, SDL_TOUCH_DEVICE_DIRECT, "") < 0) { - return 0; + return 0; } emscripten_get_element_css_size(window_data->canvas_id, &client_w, &client_h); @@ -773,8 +766,9 @@ Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, vo SDL_FingerID id; float x, y; - if (!touchEvent->touches[i].isChanged) + if (!touchEvent->touches[i].isChanged) { continue; + } id = touchEvent->touches[i].identifier; x = touchEvent->touches[i].targetX / client_w; @@ -800,12 +794,25 @@ Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent *touchEvent, vo return preventDefault; } -static EM_BOOL -Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) +static SDL_bool IsFunctionKey(SDL_Scancode scancode) +{ + if (scancode >= SDL_SCANCODE_F1 && scancode <= SDL_SCANCODE_F12) { + return SDL_TRUE; + } + if (scancode >= SDL_SCANCODE_F13 && scancode <= SDL_SCANCODE_F24) { + return SDL_TRUE; + } + return SDL_FALSE; +} + +/* This is a great tool to see web keyboard events live: + * https://w3c.github.io/uievents/tools/key-event-viewer.html + */ +static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { const SDL_Keycode keycode = Emscripten_MapKeyCode(keyEvent); SDL_Scancode scancode = Emscripten_MapScanCode(keyEvent->code); - SDL_bool prevent_default = SDL_TRUE; + SDL_bool prevent_default = SDL_FALSE; SDL_bool is_nav_key = SDL_FALSE; if (scancode == SDL_SCANCODE_UNKNOWN) { @@ -818,20 +825,20 @@ Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, voi } if (scancode != SDL_SCANCODE_UNKNOWN) { - SDL_SendKeyboardKeyAndKeycode(eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED, scancode, keycode); + prevent_default = SDL_SendKeyboardKeyAndKeycode(eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED, scancode, keycode); } /* if TEXTINPUT events are enabled we can't prevent keydown or we won't get keypress * we need to ALWAYS prevent backspace and tab otherwise chrome takes action and does bad navigation UX */ - if ( (scancode == SDL_SCANCODE_BACKSPACE) || - (scancode == SDL_SCANCODE_TAB) || - (scancode == SDL_SCANCODE_LEFT) || - (scancode == SDL_SCANCODE_UP) || - (scancode == SDL_SCANCODE_RIGHT) || - (scancode == SDL_SCANCODE_DOWN) || - ((scancode >= SDL_SCANCODE_F1) && (scancode <= SDL_SCANCODE_F15)) || - keyEvent->ctrlKey ) { + if ((scancode == SDL_SCANCODE_BACKSPACE) || + (scancode == SDL_SCANCODE_TAB) || + (scancode == SDL_SCANCODE_LEFT) || + (scancode == SDL_SCANCODE_UP) || + (scancode == SDL_SCANCODE_RIGHT) || + (scancode == SDL_SCANCODE_DOWN) || + IsFunctionKey(scancode) || + keyEvent->ctrlKey) { is_nav_key = SDL_TRUE; } @@ -842,8 +849,7 @@ Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, voi return prevent_default; } -static EM_BOOL -Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) +static EM_BOOL Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { char text[5]; if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) { @@ -852,20 +858,16 @@ Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent return SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE; } -static EM_BOOL -Emscripten_HandleFullscreenChange(int eventType, const EmscriptenFullscreenChangeEvent *fullscreenChangeEvent, void *userData) +static EM_BOOL Emscripten_HandleFullscreenChange(int eventType, const EmscriptenFullscreenChangeEvent *fullscreenChangeEvent, void *userData) { SDL_WindowData *window_data = userData; SDL_VideoDisplay *display; - if(fullscreenChangeEvent->isFullscreen) - { + if (fullscreenChangeEvent->isFullscreen) { window_data->window->flags |= window_data->requested_fullscreen_mode; window_data->requested_fullscreen_mode = 0; - } - else - { + } else { window_data->window->flags &= ~FULLSCREEN_MASK; /* reset fullscreen window if the browser left fullscreen */ @@ -879,8 +881,7 @@ Emscripten_HandleFullscreenChange(int eventType, const EmscriptenFullscreenChang return 0; } -static EM_BOOL -Emscripten_HandleResize(int eventType, const EmscriptenUiEvent *uiEvent, void *userData) +static EM_BOOL Emscripten_HandleResize(int eventType, const EmscriptenUiEvent *uiEvent, void *userData) { SDL_WindowData *window_data = userData; SDL_bool force = SDL_FALSE; @@ -893,15 +894,13 @@ Emscripten_HandleResize(int eventType, const EmscriptenUiEvent *uiEvent, void *u } } - if(!(window_data->window->flags & FULLSCREEN_MASK)) - { + if (!(window_data->window->flags & FULLSCREEN_MASK)) { /* this will only work if the canvas size is set through css */ - if(window_data->window->flags & SDL_WINDOW_RESIZABLE) - { + if (window_data->window->flags & SDL_WINDOW_RESIZABLE) { double w = window_data->window->w; double h = window_data->window->h; - if(window_data->external_size) { + if (window_data->external_size) { emscripten_get_element_css_size(window_data->canvas_id, &w, &h); } @@ -913,9 +912,9 @@ Emscripten_HandleResize(int eventType, const EmscriptenUiEvent *uiEvent, void *u } if (force) { - /* force the event to trigger, so pixel ratio changes can be handled */ - window_data->window->w = 0; - window_data->window->h = 0; + /* force the event to trigger, so pixel ratio changes can be handled */ + window_data->window->w = 0; + window_data->window->h = 0; } SDL_SendWindowEvent(window_data->window, SDL_WINDOWEVENT_RESIZED, w, h); @@ -931,8 +930,7 @@ Emscripten_HandleCanvasResize(int eventType, const void *reserved, void *userDat /*this is used during fullscreen changes*/ SDL_WindowData *window_data = userData; - if(window_data->fullscreen_resize) - { + if (window_data->fullscreen_resize) { double css_w, css_h; emscripten_get_element_css_size(window_data->canvas_id, &css_w, &css_h); SDL_SendWindowEvent(window_data->window, SDL_WINDOWEVENT_RESIZED, css_w, css_h); @@ -941,16 +939,14 @@ Emscripten_HandleCanvasResize(int eventType, const void *reserved, void *userDat return 0; } -static EM_BOOL -Emscripten_HandleVisibilityChange(int eventType, const EmscriptenVisibilityChangeEvent *visEvent, void *userData) +static EM_BOOL Emscripten_HandleVisibilityChange(int eventType, const EmscriptenVisibilityChangeEvent *visEvent, void *userData) { SDL_WindowData *window_data = userData; SDL_SendWindowEvent(window_data->window, visEvent->hidden ? SDL_WINDOWEVENT_HIDDEN : SDL_WINDOWEVENT_SHOWN, 0, 0); return 0; } -static const char* -Emscripten_HandleBeforeUnload(int eventType, const void *reserved, void *userData) +static const char *Emscripten_HandleBeforeUnload(int eventType, const void *reserved, void *userData) { /* This event will need to be handled synchronously, e.g. using SDL_AddEventWatch, as the page is being closed *now*. */ @@ -959,8 +955,7 @@ Emscripten_HandleBeforeUnload(int eventType, const void *reserved, void *userDat return ""; /* don't trigger confirmation dialog */ } -void -Emscripten_RegisterEventHandlers(SDL_WindowData *data) +void Emscripten_RegisterEventHandlers(SDL_WindowData *data) { const char *keyElement; @@ -987,7 +982,9 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data) /* Keyboard events are awkward */ keyElement = SDL_GetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT); - if (!keyElement) keyElement = EMSCRIPTEN_EVENT_TARGET_WINDOW; + if (!keyElement) { + keyElement = EMSCRIPTEN_EVENT_TARGET_WINDOW; + } emscripten_set_keydown_callback(keyElement, data, 0, Emscripten_HandleKey); emscripten_set_keyup_callback(keyElement, data, 0, Emscripten_HandleKey); @@ -1002,8 +999,7 @@ Emscripten_RegisterEventHandlers(SDL_WindowData *data) emscripten_set_beforeunload_callback(data, Emscripten_HandleBeforeUnload); } -void -Emscripten_UnregisterEventHandlers(SDL_WindowData *data) +void Emscripten_UnregisterEventHandlers(SDL_WindowData *data) { const char *target; diff --git a/src/video/emscripten/SDL_emscriptenevents.h b/src/video/emscripten/SDL_emscriptenevents.h index cc93e1a7989ec..cb4bdf07fcd99 100644 --- a/src/video/emscripten/SDL_emscriptenevents.h +++ b/src/video/emscripten/SDL_emscriptenevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,6 @@ 3. This notice may not be removed or altered from any source distribution. */ - #ifndef SDL_emscriptenevents_h_ #define SDL_emscriptenevents_h_ @@ -37,4 +36,3 @@ Emscripten_HandleCanvasResize(int eventType, const void *reserved, void *userDat #endif /* SDL_emscriptenevents_h_ */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index 03fea04efa303..b87fb476fa1c6 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN +#ifdef SDL_VIDEO_DRIVER_EMSCRIPTEN #include "SDL_emscriptenvideo.h" #include "SDL_emscriptenframebuffer.h" @@ -28,8 +28,7 @@ #include - -int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_BGR888; @@ -38,13 +37,13 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * form Uint32 Rmask, Gmask, Bmask, Amask; /* Free the old framebuffer surface */ - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; surface = data->surface; SDL_FreeSurface(surface); /* Create a new one */ SDL_PixelFormatEnumToMasks(surface_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); - SDL_GetWindowSize(window, &w, &h); + SDL_GetWindowSizeInPixels(window, &w, &h); surface = SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask); if (!surface) { @@ -59,11 +58,11 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * form return 0; } -int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { SDL_Surface *surface; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; surface = data->surface; if (!surface) { return SDL_SetError("Couldn't find framebuffer surface for window"); @@ -71,6 +70,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec /* Send the data to the display */ + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM({ var w = $0; var h = $1; @@ -79,7 +79,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec if (!Module['SDL2']) Module['SDL2'] = {}; var SDL2 = Module['SDL2']; if (SDL2.ctxCanvas !== Module['canvas']) { - SDL2.ctx = Module['createContext'](Module['canvas'], false, true); + SDL2.ctx = Browser.createContext(Module['canvas'], false, true); SDL2.ctxCanvas = Module['canvas']; } if (SDL2.w !== w || SDL2.h !== h || SDL2.imageCtx !== SDL2.ctx) { @@ -89,7 +89,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec SDL2.imageCtx = SDL2.ctx; } var data = SDL2.image.data; - var src = pixels >> 2; + var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { @@ -166,9 +166,9 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rec return 0; } -void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_FreeSurface(data->surface); data->surface = NULL; diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.h b/src/video/emscripten/SDL_emscriptenframebuffer.h index ec59281afe8c6..d022b4c1b8695 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.h +++ b/src/video/emscripten/SDL_emscriptenframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,9 +23,9 @@ #ifndef SDL_emscriptenframebuffer_h_ #define SDL_emscriptenframebuffer_h_ -extern int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window); #endif /* SDL_emscriptenframebuffer_h_ */ diff --git a/src/video/emscripten/SDL_emscriptenmouse.c b/src/video/emscripten/SDL_emscriptenmouse.c index 38e394ac104af..600716191888f 100644 --- a/src/video/emscripten/SDL_emscriptenmouse.c +++ b/src/video/emscripten/SDL_emscriptenmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN +#ifdef SDL_VIDEO_DRIVER_EMSCRIPTEN #include #include @@ -31,15 +31,23 @@ #include "../../events/SDL_mouse_c.h" -static SDL_Cursor* -Emscripten_CreateCursorFromString(const char* cursor_str, SDL_bool is_custom) +/* older Emscriptens don't have this, but we need to for wasm64 compatibility. */ +#ifndef MAIN_THREAD_EM_ASM_PTR + #ifdef __wasm64__ + #error You need to upgrade your Emscripten compiler to support wasm64 + #else + #define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT + #endif +#endif + +static SDL_Cursor *Emscripten_CreateCursorFromString(const char *cursor_str, SDL_bool is_custom) { - SDL_Cursor* cursor; + SDL_Cursor *cursor; Emscripten_CursorData *curdata; cursor = SDL_calloc(1, sizeof(SDL_Cursor)); if (cursor) { - curdata = (Emscripten_CursorData *) SDL_calloc(1, sizeof(*curdata)); + curdata = (Emscripten_CursorData *)SDL_calloc(1, sizeof(*curdata)); if (!curdata) { SDL_OutOfMemory(); SDL_free(cursor); @@ -49,23 +57,21 @@ Emscripten_CreateCursorFromString(const char* cursor_str, SDL_bool is_custom) curdata->system_cursor = cursor_str; curdata->is_custom = is_custom; cursor->driverdata = curdata; - } - else { + } else { SDL_OutOfMemory(); } return cursor; } -static SDL_Cursor* -Emscripten_CreateDefaultCursor() +static SDL_Cursor *Emscripten_CreateDefaultCursor() { return Emscripten_CreateCursorFromString("default", SDL_FALSE); } +EM_JS_DEPS(sdlmouse, "$stringToUTF8,$UTF8ToString"); -static SDL_Cursor* -Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) +static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { const char *cursor_url = NULL; SDL_Surface *conv_surf; @@ -76,7 +82,8 @@ Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) return NULL; } - cursor_url = (const char *)MAIN_THREAD_EM_ASM_INT({ + /* *INDENT-OFF* */ /* clang-format off */ + cursor_url = (const char *)MAIN_THREAD_EM_ASM_PTR({ var w = $0; var h = $1; var hot_x = $2; @@ -91,7 +98,7 @@ Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) var image = ctx.createImageData(w, h); var data = image.data; - var src = pixels >> 2; + var src = pixels / 4; var dst = 0; var num; if (typeof CanvasPixelArray !== 'undefined' && data instanceof CanvasPixelArray) { @@ -125,70 +132,27 @@ Emscripten_CreateCursor(SDL_Surface* surface, int hot_x, int hot_y) return urlBuf; }, surface->w, surface->h, hot_x, hot_y, conv_surf->pixels); + /* *INDENT-ON* */ /* clang-format on */ SDL_FreeSurface(conv_surf); return Emscripten_CreateCursorFromString(cursor_url, SDL_TRUE); } -static SDL_Cursor* -Emscripten_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *Emscripten_CreateSystemCursor(SDL_SystemCursor id) { - const char *cursor_name = NULL; - - switch(id) { - case SDL_SYSTEM_CURSOR_ARROW: - cursor_name = "default"; - break; - case SDL_SYSTEM_CURSOR_IBEAM: - cursor_name = "text"; - break; - case SDL_SYSTEM_CURSOR_WAIT: - cursor_name = "wait"; - break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: - cursor_name = "crosshair"; - break; - case SDL_SYSTEM_CURSOR_WAITARROW: - cursor_name = "progress"; - break; - case SDL_SYSTEM_CURSOR_SIZENWSE: - cursor_name = "nwse-resize"; - break; - case SDL_SYSTEM_CURSOR_SIZENESW: - cursor_name = "nesw-resize"; - break; - case SDL_SYSTEM_CURSOR_SIZEWE: - cursor_name = "ew-resize"; - break; - case SDL_SYSTEM_CURSOR_SIZENS: - cursor_name = "ns-resize"; - break; - case SDL_SYSTEM_CURSOR_SIZEALL: - cursor_name = "move"; - break; - case SDL_SYSTEM_CURSOR_NO: - cursor_name = "not-allowed"; - break; - case SDL_SYSTEM_CURSOR_HAND: - cursor_name = "pointer"; - break; - default: - SDL_assert(0); - return NULL; - } + const char *cursor_name = SDL_GetCSSCursorName(id, NULL); return Emscripten_CreateCursorFromString(cursor_name, SDL_FALSE); } -static void -Emscripten_FreeCursor(SDL_Cursor* cursor) +static void Emscripten_FreeCursor(SDL_Cursor *cursor) { Emscripten_CursorData *curdata; if (cursor) { - curdata = (Emscripten_CursorData *) cursor->driverdata; + curdata = (Emscripten_CursorData *)cursor->driverdata; - if (curdata != NULL) { + if (curdata) { if (curdata->is_custom) { SDL_free((char *)curdata->system_cursor); } @@ -199,86 +163,83 @@ Emscripten_FreeCursor(SDL_Cursor* cursor) } } -static int -Emscripten_ShowCursor(SDL_Cursor* cursor) +static int Emscripten_ShowCursor(SDL_Cursor *cursor) { Emscripten_CursorData *curdata; if (SDL_GetMouseFocus() != NULL) { - if(cursor && cursor->driverdata) { - curdata = (Emscripten_CursorData *) cursor->driverdata; + if (cursor && cursor->driverdata) { + curdata = (Emscripten_CursorData *)cursor->driverdata; - if(curdata->system_cursor) { + if (curdata->system_cursor) { + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM({ if (Module['canvas']) { Module['canvas'].style['cursor'] = UTF8ToString($0); } }, curdata->system_cursor); + /* *INDENT-ON* */ /* clang-format on */ } - } - else { + } else { + /* *INDENT-OFF* */ /* clang-format off */ MAIN_THREAD_EM_ASM( if (Module['canvas']) { Module['canvas'].style['cursor'] = 'none'; } ); + /* *INDENT-ON* */ /* clang-format on */ } } return 0; } -static void -Emscripten_WarpMouse(SDL_Window* window, int x, int y) +static void Emscripten_WarpMouse(SDL_Window *window, int x, int y) { SDL_Unsupported(); } -static int -Emscripten_SetRelativeMouseMode(SDL_bool enabled) +static int Emscripten_SetRelativeMouseMode(SDL_bool enabled) { SDL_Window *window; SDL_WindowData *window_data; /* TODO: pointer lock isn't actually enabled yet */ - if(enabled) { + if (enabled) { window = SDL_GetMouseFocus(); - if (window == NULL) { + if (!window) { return -1; } - window_data = (SDL_WindowData *) window->driverdata; + window_data = (SDL_WindowData *)window->driverdata; - if(emscripten_request_pointerlock(window_data->canvas_id, 1) >= EMSCRIPTEN_RESULT_SUCCESS) { + if (emscripten_request_pointerlock(window_data->canvas_id, 1) >= EMSCRIPTEN_RESULT_SUCCESS) { return 0; } } else { - if(emscripten_exit_pointerlock() >= EMSCRIPTEN_RESULT_SUCCESS) { + if (emscripten_exit_pointerlock() >= EMSCRIPTEN_RESULT_SUCCESS) { return 0; } } return -1; } -void -Emscripten_InitMouse() +void Emscripten_InitMouse(void) { - SDL_Mouse* mouse = SDL_GetMouse(); + SDL_Mouse *mouse = SDL_GetMouse(); - mouse->CreateCursor = Emscripten_CreateCursor; - mouse->ShowCursor = Emscripten_ShowCursor; - mouse->FreeCursor = Emscripten_FreeCursor; - mouse->WarpMouse = Emscripten_WarpMouse; - mouse->CreateSystemCursor = Emscripten_CreateSystemCursor; + mouse->CreateCursor = Emscripten_CreateCursor; + mouse->ShowCursor = Emscripten_ShowCursor; + mouse->FreeCursor = Emscripten_FreeCursor; + mouse->WarpMouse = Emscripten_WarpMouse; + mouse->CreateSystemCursor = Emscripten_CreateSystemCursor; mouse->SetRelativeMouseMode = Emscripten_SetRelativeMouseMode; SDL_SetDefaultCursor(Emscripten_CreateDefaultCursor()); } -void -Emscripten_FiniMouse() +void Emscripten_FiniMouse(void) { } #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/emscripten/SDL_emscriptenmouse.h b/src/video/emscripten/SDL_emscriptenmouse.h index cfc36aee33aa3..7ca49783bb308 100644 --- a/src/video/emscripten/SDL_emscriptenmouse.h +++ b/src/video/emscripten/SDL_emscriptenmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,6 @@ 3. This notice may not be removed or altered from any source distribution. */ - #ifndef SDL_emscriptenmouse_h_ #define SDL_emscriptenmouse_h_ diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index 10c6285cf325e..b78c1ea1938d5 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_EMSCRIPTEN) && defined(SDL_VIDEO_OPENGL_EGL) #include #include @@ -33,8 +33,8 @@ /* EGL implementation of SDL OpenGL support */ -int -Emscripten_GLES_LoadLibrary(_THIS, const char *path) { +int Emscripten_GLES_LoadLibrary(_THIS, const char *path) +{ /*we can't load EGL dynamically*/ _this->egl_data = (struct SDL_EGL_VideoData *) SDL_calloc(1, sizeof(SDL_EGL_VideoData)); if (!_this->egl_data) { @@ -68,7 +68,7 @@ Emscripten_GLES_LoadLibrary(_THIS, const char *path) { if (!_this->egl_data->egl_display) { return SDL_SetError("Could not get EGL display"); } - + if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { return SDL_SetError("Could not initialize EGL"); } @@ -78,15 +78,14 @@ Emscripten_GLES_LoadLibrary(_THIS, const char *path) { } else { *_this->gl_config.driver_path = '\0'; } - + return 0; } SDL_EGL_CreateContext_impl(Emscripten) SDL_EGL_MakeCurrent_impl(Emscripten) -int -Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window) +int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window) { EGLBoolean ret = SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { @@ -99,4 +98,3 @@ Emscripten_GLES_SwapWindow(_THIS, SDL_Window * window) #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/emscripten/SDL_emscriptenopengles.h b/src/video/emscripten/SDL_emscriptenopengles.h index 9d178f6902d9c..cea5d2729484c 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.h +++ b/src/video/emscripten/SDL_emscriptenopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_emscriptenopengles_h_ #define SDL_emscriptenopengles_h_ -#if SDL_VIDEO_DRIVER_EMSCRIPTEN && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_EMSCRIPTEN) && defined(SDL_VIDEO_OPENGL_EGL) #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 550031d3fbea1..d32dd2f205360 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_EMSCRIPTEN +#ifdef SDL_VIDEO_DRIVER_EMSCRIPTEN #include "SDL_video.h" #include "SDL_mouse.h" @@ -40,44 +40,41 @@ /* Initialization/Query functions */ static int Emscripten_VideoInit(_THIS); -static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static void Emscripten_VideoQuit(_THIS); -static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); -static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi); - -static int Emscripten_CreateWindow(_THIS, SDL_Window * window); -static void Emscripten_SetWindowSize(_THIS, SDL_Window * window); -static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h); -static void Emscripten_DestroyWindow(_THIS, SDL_Window * window); -static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen); +static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); + +static int Emscripten_CreateWindow(_THIS, SDL_Window *window); +static void Emscripten_SetWindowSize(_THIS, SDL_Window *window); +static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); +static void Emscripten_DestroyWindow(_THIS, SDL_Window *window); +static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); static void Emscripten_PumpEvents(_THIS); -static void Emscripten_SetWindowTitle(_THIS, SDL_Window * window); - +static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window); /* Emscripten driver bootstrap functions */ -static void -Emscripten_DeleteDevice(SDL_VideoDevice * device) +static void Emscripten_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device); } -static SDL_VideoDevice * -Emscripten_CreateDevice(void) +static SDL_VideoDevice *Emscripten_CreateDevice(void) { SDL_VideoDevice *device; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } /* Firefox sends blur event which would otherwise prevent full screen * when the user clicks to allow full screen. * See https://bugzilla.mozilla.org/show_bug.cgi?id=1144964 - */ + */ SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); /* Set the function pointers */ @@ -87,7 +84,6 @@ Emscripten_CreateDevice(void) device->GetDisplayDPI = Emscripten_GetDisplayDPI; device->SetDisplayMode = Emscripten_SetDisplayMode; - device->PumpEvents = Emscripten_PumpEvents; device->CreateSDLWindow = Emscripten_CreateWindow; @@ -110,7 +106,7 @@ Emscripten_CreateDevice(void) device->UpdateWindowFramebuffer = Emscripten_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = Emscripten_DestroyWindowFramebuffer; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL device->GL_LoadLibrary = Emscripten_GLES_LoadLibrary; device->GL_GetProcAddress = Emscripten_GLES_GetProcAddress; device->GL_UnloadLibrary = Emscripten_GLES_UnloadLibrary; @@ -129,12 +125,11 @@ Emscripten_CreateDevice(void) VideoBootStrap Emscripten_bootstrap = { EMSCRIPTENVID_DRIVER_NAME, "SDL emscripten video driver", - Emscripten_CreateDevice + Emscripten_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; - -int -Emscripten_VideoInit(_THIS) +int Emscripten_VideoInit(_THIS) { SDL_DisplayMode mode; @@ -156,21 +151,18 @@ Emscripten_VideoInit(_THIS) return 0; } -static int -Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* can't do this */ return 0; } -static void -Emscripten_VideoQuit(_THIS) +static void Emscripten_VideoQuit(_THIS) { Emscripten_FiniMouse(); } -static int -Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { if (rect) { rect->x = 0; @@ -185,8 +177,7 @@ Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * return 0; } -static int -Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi_out, float * hdpi_out, float * vdpi_out) +static int Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) { const float dpi_reference = 96.0f; float dpi; @@ -206,22 +197,20 @@ Emscripten_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi_out, fl return 0; } -static void -Emscripten_PumpEvents(_THIS) +static void Emscripten_PumpEvents(_THIS) { /* do nothing. */ } -static int -Emscripten_CreateWindow(_THIS, SDL_Window * window) +static int Emscripten_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *wdata; double scaled_w, scaled_h; double css_w, css_h; /* Allocate window internal data */ - wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { + wdata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!wdata) { return SDL_OutOfMemory(); } @@ -259,7 +248,7 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window) } } -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { if (!_this->egl_data) { if (SDL_GL_LoadLibrary(NULL) < 0) { @@ -289,12 +278,12 @@ Emscripten_CreateWindow(_THIS, SDL_Window * window) return 0; } -static void Emscripten_SetWindowSize(_THIS, SDL_Window * window) +static void Emscripten_SetWindowSize(_THIS, SDL_Window *window) { SDL_WindowData *data; if (window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + data = (SDL_WindowData *)window->driverdata; /* update pixel ratio */ if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { data->pixel_ratio = emscripten_get_device_pixel_ratio(); @@ -308,28 +297,25 @@ static void Emscripten_SetWindowSize(_THIS, SDL_Window * window) } } - -static void -Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) +static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) { SDL_WindowData *data; if (window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + data = (SDL_WindowData *)window->driverdata; *w = window->w * data->pixel_ratio; *h = window->h * data->pixel_ratio; } } -static void -Emscripten_DestroyWindow(_THIS, SDL_Window * window) +static void Emscripten_DestroyWindow(_THIS, SDL_Window *window) { SDL_WindowData *data; - if(window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + if (window->driverdata) { + data = (SDL_WindowData *)window->driverdata; Emscripten_UnregisterEventHandlers(data); -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); data->egl_surface = EGL_NO_SURFACE; @@ -345,23 +331,23 @@ Emscripten_DestroyWindow(_THIS, SDL_Window * window) } } -static void -Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_WindowData *data; - if(window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + if (window->driverdata) { + data = (SDL_WindowData *)window->driverdata; - if(fullscreen) { + if (fullscreen) { EmscriptenFullscreenStrategy strategy; SDL_bool is_desktop_fullscreen = (window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP; int res; + SDL_zero(strategy); strategy.scaleMode = is_desktop_fullscreen ? EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH : EMSCRIPTEN_FULLSCREEN_SCALE_ASPECT; - if(!is_desktop_fullscreen) { + if (!is_desktop_fullscreen) { strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE; - } else if(window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { + } else if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF; } else { strategy.canvasResolutionScaleMode = EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF; @@ -376,18 +362,17 @@ Emscripten_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * di data->fullscreen_resize = is_desktop_fullscreen; res = emscripten_request_fullscreen_strategy(data->canvas_id, 1, &strategy); - if(res != EMSCRIPTEN_RESULT_SUCCESS && res != EMSCRIPTEN_RESULT_DEFERRED) { + if (res != EMSCRIPTEN_RESULT_SUCCESS && res != EMSCRIPTEN_RESULT_DEFERRED) { /* unset flags, fullscreen failed */ window->flags &= ~(SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN); } - } - else + } else emscripten_exit_fullscreen(); } } -static void -Emscripten_SetWindowTitle(_THIS, SDL_Window * window) { +static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window) +{ emscripten_set_window_title(window->title); } diff --git a/src/video/emscripten/SDL_emscriptenvideo.h b/src/video/emscripten/SDL_emscriptenvideo.h index e87788d3f8152..2ec0d5185c7e8 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.h +++ b/src/video/emscripten/SDL_emscriptenvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,13 +28,13 @@ #include #include -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include #endif typedef struct SDL_WindowData { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif SDL_Window *window; diff --git a/src/video/haiku/SDL_BApp.h b/src/video/haiku/SDL_BApp.h index 215f83662a084..60272193faab2 100644 --- a/src/video/haiku/SDL_BApp.h +++ b/src/video/haiku/SDL_BApp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,12 @@ #include #include #include -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL #include #endif #include "../../video/haiku/SDL_bkeyboard.h" - #ifdef __cplusplus extern "C" { #endif @@ -49,28 +48,27 @@ extern "C" { #include - - - /* Forward declarations */ +class SDL_BLooper; class SDL_BWin; /* Message constants */ -enum ToSDL { +enum ToSDL +{ /* Intercepted by BWindow on its way to BView */ BAPP_MOUSE_MOVED, BAPP_MOUSE_BUTTON, BAPP_MOUSE_WHEEL, BAPP_KEY, - BAPP_REPAINT, /* from _UPDATE_ */ + BAPP_REPAINT, /* from _UPDATE_ */ /* From BWindow */ - BAPP_MAXIMIZE, /* from B_ZOOM */ + BAPP_MAXIMIZE, /* from B_ZOOM */ BAPP_MINIMIZE, - BAPP_RESTORE, /* TODO: IMPLEMENT! */ + BAPP_RESTORE, /* TODO: IMPLEMENT! */ BAPP_SHOW, BAPP_HIDE, - BAPP_MOUSE_FOCUS, /* caused by MOUSE_MOVE */ - BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */ + BAPP_MOUSE_FOCUS, /* caused by MOUSE_MOVE */ + BAPP_KEYBOARD_FOCUS, /* from WINDOW_ACTIVATED */ BAPP_WINDOW_CLOSE_REQUESTED, BAPP_WINDOW_MOVED, BAPP_WINDOW_RESIZED, @@ -78,36 +76,29 @@ enum ToSDL { }; +extern "C" SDL_BLooper *SDL_Looper; + -/* Create a descendant of BApplication */ -class SDL_BApp : public BApplication { -public: - SDL_BApp(const char* signature) : - BApplication(signature) { -#if SDL_VIDEO_OPENGL +/* Create a descendant of BLooper */ +class SDL_BLooper : public BLooper +{ + public: + SDL_BLooper(const char* name) : BLooper(name) + { +#ifdef SDL_VIDEO_OPENGL _current_context = NULL; #endif } - - virtual ~SDL_BApp() { + virtual ~SDL_BLooper() + { } - - virtual void RefsReceived(BMessage* message) { - char filePath[512]; - entry_ref entryRef; - for (int32 i = 0; message->FindRef("refs", i, &entryRef) == B_OK; i++) { - BPath referencePath = BPath(&entryRef); - SDL_SendDropFile(NULL, referencePath.Path()); - } - return; - } - - /* Event-handling functions */ - virtual void MessageReceived(BMessage* message) { + /* Event-handling functions */ + virtual void MessageReceived(BMessage *message) + { /* Sort out SDL-related messages */ - switch ( message->what ) { + switch (message->what) { case BAPP_MOUSE_MOVED: _HandleMouseMove(message); break; @@ -173,23 +164,24 @@ class SDL_BApp : public BApplication { break; default: - BApplication::MessageReceived(message); - break; + BLooper::MessageReceived(message); + break; } } /* Window creation/destruction methods */ - int32 GetID(SDL_Window *win) { + int32 GetID(SDL_Window *win) + { int32 i; - for(i = 0; i < _GetNumWindowSlots(); ++i) { - if( GetSDLWindow(i) == NULL ) { + for (i = 0; i < _GetNumWindowSlots(); ++i) { + if (GetSDLWindow(i) == NULL) { _SetSDLWindow(win, i); return i; } } /* Expand the vector if all slots are full */ - if( i == _GetNumWindowSlots() ) { + if (i == _GetNumWindowSlots()) { _PushBackWindow(win); return i; } @@ -202,18 +194,20 @@ class SDL_BApp : public BApplication { there another way to do this? */ void ClearID(SDL_BWin *bwin); /* Defined in SDL_BeApp.cc */ - - SDL_Window *GetSDLWindow(int32 winID) { + SDL_Window *GetSDLWindow(int32 winID) + { return _window_map[winID]; } -#if SDL_VIDEO_OPENGL - BGLView *GetCurrentContext() { +#ifdef SDL_VIDEO_OPENGL + BGLView *GetCurrentContext() + { return _current_context; } - - void SetCurrentContext(BGLView *newContext) { - if(_current_context) + + void SetCurrentContext(BGLView *newContext) + { + if (_current_context) _current_context->UnlockGL(); _current_context = newContext; if (_current_context) @@ -221,25 +215,26 @@ class SDL_BApp : public BApplication { } #endif -private: + private: /* Event management */ - void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) { + void _HandleBasicWindowEvent(BMessage *msg, int32 sdlEventType) + { SDL_Window *win; int32 winID; - if( - !_GetWinID(msg, &winID) - ) { + if ( + !_GetWinID(msg, &winID)) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, sdlEventType, 0, 0); } - void _HandleMouseMove(BMessage *msg) { + void _HandleMouseMove(BMessage *msg) + { SDL_Window *win; int32 winID; int32 x = 0, y = 0; - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("x", &x) != B_OK || /* x movement */ msg->FindInt32("y", &y) != B_OK /* y movement */ @@ -266,47 +261,47 @@ class SDL_BApp : public BApplication { } } - void _HandleMouseButton(BMessage *msg) { + void _HandleMouseButton(BMessage *msg) + { SDL_Window *win; int32 winID; - int32 button, state; /* left/middle/right, pressed/released */ - if( + int32 button, state; /* left/middle/right, pressed/released */ + if ( !_GetWinID(msg, &winID) || msg->FindInt32("button-id", &button) != B_OK || - msg->FindInt32("button-state", &state) != B_OK - ) { + msg->FindInt32("button-state", &state) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendMouseButton(win, 0, state, button); } - void _HandleMouseWheel(BMessage *msg) { + void _HandleMouseWheel(BMessage *msg) + { SDL_Window *win; int32 winID; int32 xTicks, yTicks; - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("xticks", &xTicks) != B_OK || - msg->FindInt32("yticks", &yTicks) != B_OK - ) { + msg->FindInt32("yticks", &yTicks) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendMouseWheel(win, 0, xTicks, -yTicks, SDL_MOUSEWHEEL_NORMAL); } - void _HandleKey(BMessage *msg) { - int32 scancode, state; /* scancode, pressed/released */ - if( + void _HandleKey(BMessage *msg) + { + int32 scancode, state; /* scancode, pressed/released */ + if ( msg->FindInt32("key-state", &state) != B_OK || - msg->FindInt32("key-scancode", &scancode) != B_OK - ) { + msg->FindInt32("key-scancode", &scancode) != B_OK) { return; } /* Make sure this isn't a repeated event (key pressed and held) */ - if(state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) { + if (state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) { return; } HAIKU_SetKeyState(scancode, state); @@ -315,7 +310,7 @@ class SDL_BApp : public BApplication { if (state == SDL_PRESSED && SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { const int8 *keyUtf8; ssize_t count; - if (msg->FindData("key-utf8", B_INT8_TYPE, (const void**)&keyUtf8, &count) == B_OK) { + if (msg->FindData("key-utf8", B_INT8_TYPE, (const void **)&keyUtf8, &count) == B_OK) { char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; SDL_zeroa(text); SDL_memcpy(text, keyUtf8, count); @@ -324,107 +319,108 @@ class SDL_BApp : public BApplication { } } - void _HandleMouseFocus(BMessage *msg) { + void _HandleMouseFocus(BMessage *msg) + { SDL_Window *win; int32 winID; bool bSetFocus; /* If false, lose focus */ - if( + if ( !_GetWinID(msg, &winID) || - msg->FindBool("focusGained", &bSetFocus) != B_OK - ) { + msg->FindBool("focusGained", &bSetFocus) != B_OK) { return; } win = GetSDLWindow(winID); - if(bSetFocus) { + if (bSetFocus) { SDL_SetMouseFocus(win); - } else if(SDL_GetMouseFocus() == win) { + } else if (SDL_GetMouseFocus() == win) { /* Only lose all focus if this window was the current focus */ SDL_SetMouseFocus(NULL); } } - void _HandleKeyboardFocus(BMessage *msg) { + void _HandleKeyboardFocus(BMessage *msg) + { SDL_Window *win; int32 winID; bool bSetFocus; /* If false, lose focus */ - if( + if ( !_GetWinID(msg, &winID) || - msg->FindBool("focusGained", &bSetFocus) != B_OK - ) { + msg->FindBool("focusGained", &bSetFocus) != B_OK) { return; } win = GetSDLWindow(winID); - if(bSetFocus) { + if (bSetFocus) { SDL_SetKeyboardFocus(win); - } else if(SDL_GetKeyboardFocus() == win) { + } else if (SDL_GetKeyboardFocus() == win) { /* Only lose all focus if this window was the current focus */ SDL_SetKeyboardFocus(NULL); } } - void _HandleWindowMoved(BMessage *msg) { + void _HandleWindowMoved(BMessage *msg) + { SDL_Window *win; int32 winID; int32 xPos, yPos; /* Get the window id and new x/y position of the window */ - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("window-x", &xPos) != B_OK || - msg->FindInt32("window-y", &yPos) != B_OK - ) { + msg->FindInt32("window-y", &yPos) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_MOVED, xPos, yPos); } - void _HandleWindowResized(BMessage *msg) { + void _HandleWindowResized(BMessage *msg) + { SDL_Window *win; int32 winID; int32 w, h; /* Get the window id ]and new x/y position of the window */ - if( + if ( !_GetWinID(msg, &winID) || msg->FindInt32("window-w", &w) != B_OK || - msg->FindInt32("window-h", &h) != B_OK - ) { + msg->FindInt32("window-h", &h) != B_OK) { return; } win = GetSDLWindow(winID); SDL_SendWindowEvent(win, SDL_WINDOWEVENT_RESIZED, w, h); } - bool _GetWinID(BMessage *msg, int32 *winID) { + bool _GetWinID(BMessage *msg, int32 *winID) + { return msg->FindInt32("window-id", winID) == B_OK; } - - /* Vector functions: Wraps vector stuff in case we need to change implementation */ - void _SetSDLWindow(SDL_Window *win, int32 winID) { + void _SetSDLWindow(SDL_Window *win, int32 winID) + { _window_map[winID] = win; } - int32 _GetNumWindowSlots() { + int32 _GetNumWindowSlots() + { return _window_map.size(); } - - void _PopBackWindow() { + void _PopBackWindow() + { _window_map.pop_back(); } - void _PushBackWindow(SDL_Window *win) { + void _PushBackWindow(SDL_Window *win) + { _window_map.push_back(win); } - /* Members */ - std::vector _window_map; /* Keeps track of SDL_Windows by index-id */ + std::vector _window_map; /* Keeps track of SDL_Windows by index-id */ -#if SDL_VIDEO_OPENGL - BGLView *_current_context; +#ifdef SDL_VIDEO_OPENGL + BGLView *_current_context; #endif }; diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h index 1ac517164e2d8..4d4d4af889ebd 100644 --- a/src/video/haiku/SDL_BWin.h +++ b/src/video/haiku/SDL_BWin.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,14 +39,14 @@ extern "C" { #include #include #include -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL #include #endif #include "SDL_events.h" #include "../../main/haiku/SDL_BApp.h" - -enum WinCommands { +enum WinCommands +{ BWIN_MOVE_WINDOW, BWIN_RESIZE_WINDOW, BWIN_SHOW_WINDOW, @@ -63,12 +63,12 @@ enum WinCommands { }; // non-OpenGL framebuffer view -class SDL_BView: public BView +class SDL_BView : public BView { -public: - SDL_BView(BRect frame, const char* name, uint32 resizingMode) + public: + SDL_BView(BRect frame, const char *name, uint32 resizingMode) : BView(frame, name, resizingMode, B_WILL_DRAW), - fBitmap(NULL) + fBitmap(NULL) { } @@ -83,11 +83,11 @@ class SDL_BView: public BView fBitmap = bitmap; } -private: + private: BBitmap *fBitmap; }; -class SDL_BWin: public BWindow +class SDL_BWin : public BWindow { public: /* Constructor/Destructor */ @@ -99,7 +99,7 @@ class SDL_BWin: public BWindow _cur_view = NULL; _SDL_View = NULL; -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL _SDL_GLView = NULL; _gl_type = 0; #endif @@ -114,19 +114,19 @@ class SDL_BWin: public BWindow _bitmap = NULL; } - virtual ~ SDL_BWin() + virtual ~SDL_BWin() { Lock(); - + if (_SDL_View != NULL && _SDL_View != _cur_view) { delete _SDL_View; _SDL_View = NULL; } -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL if (_SDL_GLView) { - if (((SDL_BApp*)be_app)->GetCurrentContext() == _SDL_GLView) - ((SDL_BApp*)be_app)->SetCurrentContext(NULL); + if (SDL_Looper->GetCurrentContext() == _SDL_GLView) + SDL_Looper->SetCurrentContext(NULL); if (_SDL_GLView == _cur_view) RemoveChild(_SDL_GLView); _SDL_GLView = NULL; @@ -142,7 +142,7 @@ class SDL_BWin: public BWindow _buffer_locker->Lock(); delete _buffer_locker; } - + void SetCurrentView(BView *view) { if (_cur_view != view) { @@ -165,7 +165,8 @@ class SDL_BWin: public BWindow } } - SDL_BView *CreateView() { + SDL_BView *CreateView() + { Lock(); if (_SDL_View == NULL) { _SDL_View = new SDL_BView(Bounds(), "SDL View", B_FOLLOW_ALL_SIDES); @@ -175,9 +176,10 @@ class SDL_BWin: public BWindow return _SDL_View; } - void RemoveView() { + void RemoveView() + { Lock(); - if(_SDL_View != NULL) { + if (_SDL_View != NULL) { SDL_BView *oldView = _SDL_View; _SDL_View = NULL; UpdateCurrentView(); @@ -187,14 +189,15 @@ class SDL_BWin: public BWindow } /* * * * * OpenGL functionality * * * * */ -#if SDL_VIDEO_OPENGL - BGLView *CreateGLView(Uint32 gl_flags) { +#ifdef SDL_VIDEO_OPENGL + BGLView *CreateGLView(Uint32 gl_flags) + { Lock(); if (_SDL_GLView == NULL) { _SDL_GLView = new BGLView(Bounds(), "SDL GLView", - B_FOLLOW_ALL_SIDES, - (B_WILL_DRAW | B_FRAME_EVENTS), - gl_flags); + B_FOLLOW_ALL_SIDES, + (B_WILL_DRAW | B_FRAME_EVENTS), + gl_flags); _gl_type = gl_flags; UpdateCurrentView(); } @@ -202,11 +205,12 @@ class SDL_BWin: public BWindow return _SDL_GLView; } - void RemoveGLView() { + void RemoveGLView() + { Lock(); - if(_SDL_GLView != NULL) { - if (((SDL_BApp*)be_app)->GetCurrentContext() == _SDL_GLView) - ((SDL_BApp*)be_app)->SetCurrentContext(NULL); + if (_SDL_GLView != NULL) { + if (SDL_Looper->GetCurrentContext() == _SDL_GLView) + SDL_Looper->SetCurrentContext(NULL); _SDL_GLView = NULL; UpdateCurrentView(); // _SDL_GLView deleted by HAIKU_GL_DeleteContext @@ -214,14 +218,16 @@ class SDL_BWin: public BWindow Unlock(); } - void SwapBuffers(void) { + void SwapBuffers(void) + { _SDL_GLView->SwapBuffers(); } #endif /* * * * * Event sending * * * * */ /* Hook functions */ - virtual void FrameMoved(BPoint origin) { + virtual void FrameMoved(BPoint origin) + { /* Post a message to the BApp so that it can handle the window event */ BMessage msg(BAPP_WINDOW_MOVED); msg.AddInt32("window-x", (int)origin.x); @@ -232,7 +238,8 @@ class SDL_BWin: public BWindow BWindow::FrameMoved(origin); } - void FrameResized(float width, float height) { + void FrameResized(float width, float height) + { /* Post a message to the BApp so that it can handle the window event */ BMessage msg(BAPP_WINDOW_RESIZED); @@ -244,7 +251,8 @@ class SDL_BWin: public BWindow BWindow::FrameResized(width, height); } - bool QuitRequested() { + bool QuitRequested() + { BMessage msg(BAPP_WINDOW_CLOSE_REQUESTED); _PostWindowEvent(msg); @@ -252,20 +260,22 @@ class SDL_BWin: public BWindow return false; } - void WindowActivated(bool active) { - BMessage msg(BAPP_KEYBOARD_FOCUS); /* Mouse focus sold separately */ + void WindowActivated(bool active) + { + BMessage msg(BAPP_KEYBOARD_FOCUS); /* Mouse focus sold separately */ msg.AddBool("focusGained", active); _PostWindowEvent(msg); } void Zoom(BPoint origin, - float width, - float height) { - BMessage msg(BAPP_MAXIMIZE); /* Closest thing to maximization Haiku has */ + float width, + float height) + { + BMessage msg(BAPP_MAXIMIZE); /* Closest thing to maximization Haiku has */ _PostWindowEvent(msg); /* Before the window zooms, record its size */ - if( !_prev_frame ) + if (!_prev_frame) _prev_frame = new BRect(Frame()); /* Perform normal hook operations */ @@ -273,8 +283,9 @@ class SDL_BWin: public BWindow } /* Member functions */ - void Show() { - while(IsHidden()) { + void Show() + { + while (IsHidden()) { BWindow::Show(); } _shown = true; @@ -283,7 +294,8 @@ class SDL_BWin: public BWindow _PostWindowEvent(msg); } - void Hide() { + void Hide() + { BWindow::Hide(); _shown = false; @@ -291,7 +303,8 @@ class SDL_BWin: public BWindow _PostWindowEvent(msg); } - void Minimize(bool minimize) { + void Minimize(bool minimize) + { BWindow::Minimize(minimize); int32 minState = (minimize ? BAPP_MINIMIZE : BAPP_RESTORE); @@ -307,19 +320,17 @@ class SDL_BWin: public BWindow } } - /* BView message interruption */ - void DispatchMessage(BMessage * msg, BHandler * target) + void DispatchMessage(BMessage *msg, BHandler *target) { - BPoint where; /* Used by mouse moved */ - int32 buttons; /* Used for mouse button events */ - int32 key; /* Used for key events */ + BPoint where; /* Used by mouse moved */ + int32 buttons; /* Used for mouse button events */ + int32 key; /* Used for key events */ switch (msg->what) { case B_MOUSE_MOVED: int32 transit; - if (msg->FindPoint("where", &where) == B_OK - && msg->FindInt32("be:transit", &transit) == B_OK) { + if (msg->FindPoint("where", &where) == B_OK && msg->FindInt32("be:transit", &transit) == B_OK) { _MouseMotionEvent(where, transit); } break; @@ -338,35 +349,33 @@ class SDL_BWin: public BWindow case B_MOUSE_WHEEL_CHANGED: float x, y; - if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK - && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) { - _MouseWheelEvent((int)x, (int)y); + if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) { + _MouseWheelEvent((int)x, (int)y); } break; case B_KEY_DOWN: - { - int32 i = 0; - int8 byte; - int8 bytes[4] = { 0, 0, 0, 0 }; - while (i < 4 && msg->FindInt8("byte", i, &byte) == B_OK) { - bytes[i] = byte; - i++; - } - if (msg->FindInt32("key", &key) == B_OK) { - _KeyEvent((SDL_Scancode)key, &bytes[0], i, SDL_PRESSED); - } + { + int32 i = 0; + int8 byte; + int8 bytes[4] = { 0, 0, 0, 0 }; + while (i < 4 && msg->FindInt8("byte", i, &byte) == B_OK) { + bytes[i] = byte; + i++; } - break; + if (msg->FindInt32("key", &key) == B_OK) { + _KeyEvent((SDL_Scancode)key, &bytes[0], i, SDL_PRESSED); + } + } break; - case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */ + case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */ if (msg->FindInt32("key", &key) == B_OK) { _KeyEvent((SDL_Scancode)key, NULL, 0, SDL_PRESSED); } break; case B_KEY_UP: - case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */ + case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */ if (msg->FindInt32("key", &key) == B_OK) { _KeyEvent(key, NULL, 0, SDL_RELEASED); } @@ -386,88 +395,92 @@ class SDL_BWin: public BWindow } /* Handle command messages */ - void MessageReceived(BMessage* message) { + void MessageReceived(BMessage *message) + { switch (message->what) { - /* Handle commands from SDL */ - case BWIN_SET_TITLE: - _SetTitle(message); - break; - case BWIN_MOVE_WINDOW: - _MoveTo(message); - break; - case BWIN_RESIZE_WINDOW: - _ResizeTo(message); - break; - case BWIN_SET_BORDERED: { - bool bEnabled; - if (message->FindBool("window-border", &bEnabled) == B_OK) - _SetBordered(bEnabled); - break; - } - case BWIN_SET_RESIZABLE: { - bool bEnabled; - if (message->FindBool("window-resizable", &bEnabled) == B_OK) - _SetResizable(bEnabled); - break; - } - case BWIN_SHOW_WINDOW: - Show(); - break; - case BWIN_HIDE_WINDOW: - Hide(); - break; - case BWIN_MAXIMIZE_WINDOW: - BWindow::Zoom(); - break; - case BWIN_MINIMIZE_WINDOW: - Minimize(true); - break; - case BWIN_RESTORE_WINDOW: - _Restore(); - break; - case BWIN_FULLSCREEN: { - bool fullscreen; - if (message->FindBool("fullscreen", &fullscreen) == B_OK) - _SetFullScreen(fullscreen); - break; + /* Handle commands from SDL */ + case BWIN_SET_TITLE: + _SetTitle(message); + break; + case BWIN_MOVE_WINDOW: + _MoveTo(message); + break; + case BWIN_RESIZE_WINDOW: + _ResizeTo(message); + break; + case BWIN_SET_BORDERED: + { + bool bEnabled; + if (message->FindBool("window-border", &bEnabled) == B_OK) + _SetBordered(bEnabled); + break; + } + case BWIN_SET_RESIZABLE: + { + bool bEnabled; + if (message->FindBool("window-resizable", &bEnabled) == B_OK) + _SetResizable(bEnabled); + break; + } + case BWIN_SHOW_WINDOW: + Show(); + break; + case BWIN_HIDE_WINDOW: + Hide(); + break; + case BWIN_MAXIMIZE_WINDOW: + BWindow::Zoom(); + break; + case BWIN_MINIMIZE_WINDOW: + Minimize(true); + break; + case BWIN_RESTORE_WINDOW: + _Restore(); + break; + case BWIN_FULLSCREEN: + { + bool fullscreen; + if (message->FindBool("fullscreen", &fullscreen) == B_OK) + _SetFullScreen(fullscreen); + break; + } + case BWIN_MINIMUM_SIZE_WINDOW: + _SetMinimumSize(message); + break; + case BWIN_UPDATE_FRAMEBUFFER: + { + BMessage *pendingMessage; + while ((pendingMessage = MessageQueue()->FindMessage(BWIN_UPDATE_FRAMEBUFFER, 0))) { + MessageQueue()->RemoveMessage(pendingMessage); + delete pendingMessage; } - case BWIN_MINIMUM_SIZE_WINDOW: - _SetMinimumSize(message); - break; - case BWIN_UPDATE_FRAMEBUFFER: { - BMessage* pendingMessage; - while ((pendingMessage - = MessageQueue()->FindMessage(BWIN_UPDATE_FRAMEBUFFER, 0))) { - MessageQueue()->RemoveMessage(pendingMessage); - delete pendingMessage; - } - if (_bitmap != NULL) { - if (_SDL_View != NULL && _cur_view == _SDL_View) - _SDL_View->Draw(Bounds()); - else if (_SDL_GLView != NULL && _cur_view == _SDL_GLView) { - _SDL_GLView->CopyPixelsIn(_bitmap, B_ORIGIN); - } + if (_bitmap != NULL) { + if (_SDL_View != NULL && _cur_view == _SDL_View) + _SDL_View->Draw(Bounds()); + else if (_SDL_GLView != NULL && _cur_view == _SDL_GLView) { + _SDL_GLView->CopyPixelsIn(_bitmap, B_ORIGIN); } - break; } - default: - /* Perform normal message handling */ - BWindow::MessageReceived(message); - break; + break; + } + default: + /* Perform normal message handling */ + BWindow::MessageReceived(message); + break; } - } - - /* Accessor methods */ bool IsShown() { return _shown; } int32 GetID() { return _id; } BBitmap *GetBitmap() { return _bitmap; } BView *GetCurView() { return _cur_view; } SDL_BView *GetView() { return _SDL_View; } -#if SDL_VIDEO_OPENGL - BGLView *GetGLView() { return _SDL_GLView; } +#ifdef SDL_VIDEO_OPENGL + BGLView *GetGLView() + { + return _SDL_GLView; + } Uint32 GetGLType() { return _gl_type; } #endif @@ -475,15 +488,20 @@ class SDL_BWin: public BWindow void SetID(int32 id) { _id = id; } void LockBuffer() { _buffer_locker->Lock(); } void UnlockBuffer() { _buffer_locker->Unlock(); } - void SetBitmap(BBitmap *bitmap) { _bitmap = bitmap; if (_SDL_View != NULL) _SDL_View->SetBitmap(bitmap); } - + void SetBitmap(BBitmap *bitmap) + { + _bitmap = bitmap; + if (_SDL_View != NULL) + _SDL_View->SetBitmap(bitmap); + } -private: + private: /* Event redirection */ - void _MouseMotionEvent(BPoint &where, int32 transit) { - if(transit == B_EXITED_VIEW) { + void _MouseMotionEvent(BPoint &where, int32 transit) + { + if (transit == B_EXITED_VIEW) { /* Change mouse focus */ - if(_mouse_focused) { + if (_mouse_focused) { _MouseFocusEvent(false); } } else { @@ -499,41 +517,45 @@ class SDL_BWin: public BWindow } } - void _MouseFocusEvent(bool focusGained) { + void _MouseFocusEvent(bool focusGained) + { _mouse_focused = focusGained; BMessage msg(BAPP_MOUSE_FOCUS); msg.AddBool("focusGained", focusGained); _PostWindowEvent(msg); -/* FIXME: Why were these here? - if false: be_app->SetCursor(B_HAND_CURSOR); - if true: SDL_SetCursor(NULL); */ + /* FIXME: Why were these here? + if false: be_app->SetCursor(B_HAND_CURSOR); + if true: SDL_SetCursor(NULL); */ } - void _MouseButtonEvent(int32 buttons, Uint8 state) { + void _MouseButtonEvent(int32 buttons, Uint8 state) + { int32 buttonStateChange = buttons ^ _last_buttons; - if(buttonStateChange & B_PRIMARY_MOUSE_BUTTON) { + if (buttonStateChange & B_PRIMARY_MOUSE_BUTTON) { _SendMouseButton(SDL_BUTTON_LEFT, state); } - if(buttonStateChange & B_SECONDARY_MOUSE_BUTTON) { + if (buttonStateChange & B_SECONDARY_MOUSE_BUTTON) { _SendMouseButton(SDL_BUTTON_RIGHT, state); } - if(buttonStateChange & B_TERTIARY_MOUSE_BUTTON) { + if (buttonStateChange & B_TERTIARY_MOUSE_BUTTON) { _SendMouseButton(SDL_BUTTON_MIDDLE, state); } _last_buttons = buttons; } - void _SendMouseButton(int32 button, int32 state) { + void _SendMouseButton(int32 button, int32 state) + { BMessage msg(BAPP_MOUSE_BUTTON); msg.AddInt32("button-id", button); msg.AddInt32("button-state", state); _PostWindowEvent(msg); } - void _MouseWheelEvent(int32 x, int32 y) { + void _MouseWheelEvent(int32 x, int32 y) + { /* Create a message to pass along to the BeApp thread */ BMessage msg(BAPP_MOUSE_WHEEL); msg.AddInt32("xticks", x); @@ -541,44 +563,47 @@ class SDL_BWin: public BWindow _PostWindowEvent(msg); } - void _KeyEvent(int32 keyCode, const int8 *keyUtf8, const ssize_t & len, int32 keyState) { + void _KeyEvent(int32 keyCode, const int8 *keyUtf8, const ssize_t &len, int32 keyState) + { /* Create a message to pass along to the BeApp thread */ BMessage msg(BAPP_KEY); msg.AddInt32("key-state", keyState); msg.AddInt32("key-scancode", keyCode); if (keyUtf8 != NULL) { - msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len); + msg.AddData("key-utf8", B_INT8_TYPE, (const void *)keyUtf8, len); } - be_app->PostMessage(&msg); + SDL_Looper->PostMessage(&msg); } - void _RepaintEvent() { + void _RepaintEvent() + { /* Force a repaint: Call the SDL exposed event */ BMessage msg(BAPP_REPAINT); _PostWindowEvent(msg); } - void _PostWindowEvent(BMessage &msg) { + void _PostWindowEvent(BMessage &msg) + { msg.AddInt32("window-id", _id); - be_app->PostMessage(&msg); + SDL_Looper->PostMessage(&msg); } /* Command methods (functions called upon by SDL) */ - void _SetTitle(BMessage *msg) { + void _SetTitle(BMessage *msg) + { const char *title; - if( - msg->FindString("window-title", &title) != B_OK - ) { + if ( + msg->FindString("window-title", &title) != B_OK) { return; } SetTitle(title); } - void _MoveTo(BMessage *msg) { + void _MoveTo(BMessage *msg) + { int32 x, y; - if( + if ( msg->FindInt32("window-x", &x) != B_OK || - msg->FindInt32("window-y", &y) != B_OK - ) { + msg->FindInt32("window-y", &y) != B_OK) { return; } if (_fullscreen) @@ -587,12 +612,12 @@ class SDL_BWin: public BWindow MoveTo(x, y); } - void _ResizeTo(BMessage *msg) { + void _ResizeTo(BMessage *msg) + { int32 w, h; - if( + if ( msg->FindInt32("window-w", &w) != B_OK || - msg->FindInt32("window-h", &h) != B_OK - ) { + msg->FindInt32("window-h", &h) != B_OK) { return; } if (_fullscreen) { @@ -602,14 +627,16 @@ class SDL_BWin: public BWindow ResizeTo(w, h); } - void _SetBordered(bool bEnabled) { + void _SetBordered(bool bEnabled) + { if (_fullscreen) _bordered = bEnabled; else SetLook(bEnabled ? B_TITLED_WINDOW_LOOK : B_NO_BORDER_WINDOW_LOOK); } - void _SetResizable(bool bEnabled) { + void _SetResizable(bool bEnabled) + { if (_fullscreen) _resizable = bEnabled; else { @@ -621,7 +648,8 @@ class SDL_BWin: public BWindow } } - void _SetMinimumSize(BMessage *msg) { + void _SetMinimumSize(BMessage *msg) + { float maxHeight; float maxWidth; float _; @@ -639,25 +667,29 @@ class SDL_BWin: public BWindow UpdateSizeLimits(); } - void _Restore() { - if(IsMinimized()) { + void _Restore() + { + if (IsMinimized()) { Minimize(false); - } else if(IsHidden()) { + } else if (IsHidden()) { Show(); } else if (_fullscreen) { - } else if(_prev_frame != NULL) { /* Zoomed */ + } else if (_prev_frame != NULL) { /* Zoomed */ MoveTo(_prev_frame->left, _prev_frame->top); ResizeTo(_prev_frame->Width(), _prev_frame->Height()); } } - void _SetFullScreen(bool fullscreen) { + void _SetFullScreen(bool fullscreen) + { if (fullscreen != _fullscreen) { if (fullscreen) { BScreen screen(this); BRect screenFrame = screen.Frame(); - printf("screen frame: "); screenFrame.PrintToStream(); printf("\n"); + printf("screen frame: "); + screenFrame.PrintToStream(); + printf("\n"); _bordered = Look() != B_NO_BORDER_WINDOW_LOOK; _resizable = !(Flags() & B_NOT_RESIZABLE); _non_fullscreen_frame = Frame(); @@ -678,18 +710,18 @@ class SDL_BWin: public BWindow /* Members */ - BView* _cur_view; - SDL_BView* _SDL_View; -#if SDL_VIDEO_OPENGL - BGLView * _SDL_GLView; + BView *_cur_view; + SDL_BView *_SDL_View; +#ifdef SDL_VIDEO_OPENGL + BGLView *_SDL_GLView; Uint32 _gl_type; #endif int32 _last_buttons; - int32 _id; /* Window id used by SDL_BApp */ - bool _mouse_focused; /* Does this window have mouse focus? */ - bool _shown; - bool _inhibit_resize; + int32 _id; /* Window id used by SDL_BApp */ + bool _mouse_focused; /* Does this window have mouse focus? */ + bool _shown; + bool _inhibit_resize; BRect *_prev_frame; /* Previous position and size of the window */ bool _fullscreen; @@ -703,7 +735,6 @@ class SDL_BWin: public BWindow BBitmap *_bitmap; }; - /* FIXME: * An explanation of framebuffer flags. * diff --git a/src/video/haiku/SDL_bclipboard.cc b/src/video/haiku/SDL_bclipboard.cc index 37cec38d3b36d..658cd5fed45b0 100644 --- a/src/video/haiku/SDL_bclipboard.cc +++ b/src/video/haiku/SDL_bclipboard.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU /* BWindow based clipboard implementation */ @@ -37,12 +37,12 @@ extern "C" { int HAIKU_SetClipboardText(_THIS, const char *text) { BMessage *clip = NULL; - if(be_clipboard->Lock()) { + if (be_clipboard->Lock()) { be_clipboard->Clear(); - if((clip = be_clipboard->Data())) { + if ((clip = be_clipboard->Data())) { /* Presumably the string of characters is ascii-format */ ssize_t asciiLength = 0; - for(; text[asciiLength] != 0; ++asciiLength) {} + for (; text[asciiLength] != 0; ++asciiLength) {} clip->AddData("text/plain", B_MIME_TYPE, text, asciiLength); be_clipboard->Commit(); } @@ -56,8 +56,8 @@ char *HAIKU_GetClipboardText(_THIS) { const char *text = NULL; ssize_t length; char *result; - if(be_clipboard->Lock()) { - if((clip = be_clipboard->Data())) { + if (be_clipboard->Lock()) { + if ((clip = be_clipboard->Data())) { /* Presumably the string of characters is ascii-format */ clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text, &length); diff --git a/src/video/haiku/SDL_bclipboard.h b/src/video/haiku/SDL_bclipboard.h index 128e545f9e218..801d5d3d989c2 100644 --- a/src/video/haiku/SDL_bclipboard.h +++ b/src/video/haiku/SDL_bclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/haiku/SDL_bevents.cc b/src/video/haiku/SDL_bevents.cc index 460b4ff26c726..cd9f4185e18cf 100644 --- a/src/video/haiku/SDL_bevents.cc +++ b/src/video/haiku/SDL_bevents.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include "SDL_bevents.h" diff --git a/src/video/haiku/SDL_bevents.h b/src/video/haiku/SDL_bevents.h index 22e491adbd0e1..ac5b9b0c72bf6 100644 --- a/src/video/haiku/SDL_bevents.h +++ b/src/video/haiku/SDL_bevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc index f303177cbf74b..71e7689a878f9 100644 --- a/src/video/haiku/SDL_bframebuffer.cc +++ b/src/video/haiku/SDL_bframebuffer.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include "SDL_bframebuffer.h" @@ -36,11 +36,11 @@ extern "C" { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return ((SDL_BWin*)(window->driverdata)); + return (SDL_BWin *)(window->driverdata); } -static SDL_INLINE SDL_BApp *_GetBeApp() { - return ((SDL_BApp*)be_app); +static SDL_INLINE SDL_BLooper *_GetBeLooper() { + return SDL_Looper; } int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, @@ -48,7 +48,7 @@ int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, void ** pixels, int *pitch) { SDL_BWin *bwin = _ToBeWin(window); BScreen bscreen; - if(!bscreen.IsValid()) { + if (!bscreen.IsValid()) { return -1; } @@ -65,14 +65,14 @@ int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, /* Create the new bitmap object */ BBitmap *bitmap = bwin->GetBitmap(); - if(bitmap) { + if (bitmap) { delete bitmap; } bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space, false, /* Views not accepted */ true); /* Contiguous memory required */ - if(bitmap->InitCheck() != B_OK) { + if (bitmap->InitCheck() != B_OK) { delete bitmap; return SDL_SetError("Could not initialize back buffer!"); } @@ -94,8 +94,9 @@ int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) { - if(!window) + if (!window) { return 0; + } SDL_BWin *bwin = _ToBeWin(window); diff --git a/src/video/haiku/SDL_bframebuffer.h b/src/video/haiku/SDL_bframebuffer.h index 4361a39df42d0..0b2a16580c15e 100644 --- a/src/video/haiku/SDL_bframebuffer.h +++ b/src/video/haiku/SDL_bframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,12 +30,12 @@ extern "C" { #include "../SDL_sysvideo.h" -extern int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, - Uint32 * format, - void ** pixels, int *pitch); -extern int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window, - const SDL_Rect * rects, int numrects); -extern void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window *window, + Uint32 *format, + void **pixels, int *pitch); +extern int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, + const SDL_Rect *rects, int numrects); +extern void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern int32 HAIKU_DrawThread(void *data); #ifdef __cplusplus diff --git a/src/video/haiku/SDL_bkeyboard.cc b/src/video/haiku/SDL_bkeyboard.cc index a4aea4d48b6dd..84dd4fdd7bcc9 100644 --- a/src/video/haiku/SDL_bkeyboard.cc +++ b/src/video/haiku/SDL_bkeyboard.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include #include @@ -42,11 +42,11 @@ static SDL_Scancode keymap[KEYMAP_SIZE]; static int8 keystate[KEYMAP_SIZE]; void HAIKU_InitOSKeymap(void) { - for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) { + for ( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) { keymap[i] = SDL_SCANCODE_UNKNOWN; } - for( uint i = 0; i < KEYMAP_SIZE; ++i ) { + for ( uint i = 0; i < KEYMAP_SIZE; ++i ) { keystate[i] = SDL_RELEASED; } @@ -160,7 +160,7 @@ void HAIKU_InitOSKeymap(void) { } SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) { - if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) { + if (bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) { return keymap[bkey]; } else { return SDL_SCANCODE_UNKNOWN; @@ -168,7 +168,7 @@ SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) { } int8 HAIKU_GetKeyState(int32 bkey) { - if(bkey > 0 && bkey < KEYMAP_SIZE) { + if (bkey > 0 && bkey < KEYMAP_SIZE) { return keystate[bkey]; } else { return SDL_RELEASED; @@ -176,7 +176,7 @@ int8 HAIKU_GetKeyState(int32 bkey) { } void HAIKU_SetKeyState(int32 bkey, int8 state) { - if(bkey > 0 && bkey < KEYMAP_SIZE) { + if (bkey > 0 && bkey < KEYMAP_SIZE) { keystate[bkey] = state; } } diff --git a/src/video/haiku/SDL_bkeyboard.h b/src/video/haiku/SDL_bkeyboard.h index 4c2a5903a4cc5..6fdc9cf449906 100644 --- a/src/video/haiku/SDL_bkeyboard.h +++ b/src/video/haiku/SDL_bkeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/haiku/SDL_bmessagebox.cc b/src/video/haiku/SDL_bmessagebox.cc index d777ed834e30a..d59c7a564ae65 100644 --- a/src/video/haiku/SDL_bmessagebox.cc +++ b/src/video/haiku/SDL_bmessagebox.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2018-2019 EXL This software is provided 'as-is', without any express or implied @@ -22,7 +22,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include "SDL_messagebox.h" @@ -131,25 +131,20 @@ class HAIKU_SDL_MessageBox : public BAlert void ParseSdlMessageBoxData(const SDL_MessageBoxData *aMessageBoxData) { - if (aMessageBoxData == NULL) - { + if (aMessageBoxData == NULL) { SetTitle(HAIKU_SDL_DefTitle); SetMessageText(HAIKU_SDL_DefMessage); AddButton(HAIKU_SDL_DefButton); return; } - if (aMessageBoxData->numbuttons <= 0) - { + if (aMessageBoxData->numbuttons <= 0) { AddButton(HAIKU_SDL_DefButton); - } - else - { + } else { AddSdlButtons(aMessageBoxData->buttons, aMessageBoxData->numbuttons); } - if (aMessageBoxData->colorScheme != NULL) - { + if (aMessageBoxData->colorScheme != NULL) { fCustomColorScheme = true; ApplyAndParseColorScheme(aMessageBoxData->colorScheme); } @@ -179,11 +174,9 @@ class HAIKU_SDL_MessageBox : public BAlert const SDL_MessageBoxColor *aTextColor, const SDL_MessageBoxColor *aSelectedColor) { - if (fCustomColorScheme) - { + if (fCustomColorScheme) { int32 countButtons = CountButtons(); - for (int i = 0; i < countButtons; ++i) - { + for (int i = 0; i < countButtons; ++i) { ButtonAt(i)->SetViewColor(ConvertColorType(aBorderColor)); ButtonAt(i)->SetLowColor(ConvertColorType(aBackgroundColor)); @@ -218,15 +211,12 @@ class HAIKU_SDL_MessageBox : public BAlert BString message = aMessage; int32 length = message.CountChars(); - for (int i = 0, c = 0; i < length; ++i) - { + for (int i = 0, c = 0; i < length; ++i) { c++; - if (*(message.CharAt(i)) == '\n') - { + if (*(message.CharAt(i)) == '\n') { c = 0; } - if (c > final) - { + if (c > final) { final = c; } } @@ -238,20 +228,17 @@ class HAIKU_SDL_MessageBox : public BAlert SetMessageText(const char *aMessage) { fThereIsLongLine = CheckLongLines(aMessage); - if (fThereIsLongLine) - { + if (fThereIsLongLine) { fMessageBoxTextView->SetWordWrap(true); } rgb_color textColor = ui_color(B_PANEL_TEXT_COLOR); - if (fCustomColorScheme) - { + if (fCustomColorScheme) { textColor = fTextColor; } /* - if (fNoTitledWindow) - { + if (fNoTitledWindow) { fMessageBoxTextView->SetFontAndColor(be_bold_font); fMessageBoxTextView->Insert(fTitle); fMessageBoxTextView->Insert("\n\n"); @@ -269,16 +256,14 @@ class HAIKU_SDL_MessageBox : public BAlert void AddSdlButtons(const SDL_MessageBoxButtonData *aButtons, int aNumButtons) { - for (int i = 0; i < aNumButtons; ++i) - { + for (int i = 0; i < aNumButtons; ++i) { fButtons.push_back(&aButtons[i]); } std::sort(fButtons.begin(), fButtons.end(), &HAIKU_SDL_MessageBox::SortButtonsPredicate); size_t countButtons = fButtons.size(); - for (size_t i = 0; i < countButtons; ++i) - { + for (size_t i = 0; i < countButtons; ++i) { switch (fButtons[i]->flags) { case SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT: @@ -342,12 +327,9 @@ class HAIKU_SDL_MessageBox : public BAlert virtual void FrameResized(float aNewWidth, float aNewHeight) { - if (fComputedMessageBoxWidth > aNewWidth) - { + if (fComputedMessageBoxWidth > aNewWidth) { ResizeTo(fComputedMessageBoxWidth, aNewHeight); - } - else - { + } else { BAlert::FrameResized(aNewWidth, aNewHeight); } } @@ -364,8 +346,7 @@ class HAIKU_SDL_MessageBox : public BAlert extern "C" { #endif -int -HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { // Initialize button by closed or error value first. *buttonid = G_CLOSE_BUTTON_ID; @@ -375,38 +356,32 @@ HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) // "You need a valid BApplication object before interacting with the app_server." // "2 BApplication objects were created. Only one is allowed." BApplication *application = NULL; - if (be_app == NULL) - { - application = new(std::nothrow) BApplication(signature); - if (application == NULL) - { + if (!be_app) { + application = new(std::nothrow) BApplication(SDL_signature); + if (!application) { return SDL_SetError("Cannot create the BApplication object. Lack of memory?"); } } HAIKU_SDL_MessageBox *SDL_MessageBox = new(std::nothrow) HAIKU_SDL_MessageBox(messageboxdata); - if (SDL_MessageBox == NULL) - { + if (!SDL_MessageBox) { return SDL_SetError("Cannot create the HAIKU_SDL_MessageBox (BAlert inheritor) object. Lack of memory?"); } const int closeButton = SDL_MessageBox->GetCloseButtonId(); int pushedButton = SDL_MessageBox->Go(); // The close button is equivalent to pressing Escape. - if (closeButton != G_CLOSE_BUTTON_ID && pushedButton == G_CLOSE_BUTTON_ID) - { + if (closeButton != G_CLOSE_BUTTON_ID && pushedButton == G_CLOSE_BUTTON_ID) { pushedButton = closeButton; } // It's deleted by itself after the "Go()" method was executed. /* - if (messageBox != NULL) - { + if (messageBox != NULL) { delete messageBox; } */ - if (application != NULL) - { + if (application) { delete application; } diff --git a/src/video/haiku/SDL_bmessagebox.h b/src/video/haiku/SDL_bmessagebox.h index ca4406ebbb855..f61ecad691350 100644 --- a/src/video/haiku/SDL_bmessagebox.h +++ b/src/video/haiku/SDL_bmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2018-2019 EXL This software is provided 'as-is', without any express or implied @@ -25,7 +25,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #ifdef __cplusplus extern "C" { diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc index 5e51647ca14e9..77b91236efbba 100644 --- a/src/video/haiku/SDL_bmodes.cc +++ b/src/video/haiku/SDL_bmodes.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include #include #include "SDL_bmodes.h" #include "SDL_BWin.h" -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL #include "SDL_bopengl.h" #endif @@ -49,18 +49,18 @@ struct SDL_DisplayModeData { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return ((SDL_BWin*)(window->driverdata)); + return (SDL_BWin *)(window->driverdata); } -static SDL_INLINE SDL_BApp *_GetBeApp() { - return ((SDL_BApp*)be_app); +static SDL_INLINE SDL_BLooper *_GetBeLooper() { + return SDL_Looper; } static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) { #if WRAP_BMODE - return ((SDL_DisplayModeData*)mode->driverdata)->bmode; + return ((SDL_DisplayModeData *)mode->driverdata)->bmode; #else - return (display_mode*)(mode->driverdata); + return (display_mode *)(mode->driverdata); #endif } @@ -80,24 +80,24 @@ void _SpoutModeData(display_mode *bmode) { printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height); printf("\th,v = (%i,%i)\n", bmode->h_display_start, bmode->v_display_start); - if(bmode->flags) { + if (bmode->flags) { printf("\tFlags:\n"); - if(bmode->flags & B_SCROLL) { + if (bmode->flags & B_SCROLL) { printf("\t\tB_SCROLL\n"); } - if(bmode->flags & B_8_BIT_DAC) { + if (bmode->flags & B_8_BIT_DAC) { printf("\t\tB_8_BIT_DAC\n"); } - if(bmode->flags & B_HARDWARE_CURSOR) { + if (bmode->flags & B_HARDWARE_CURSOR) { printf("\t\tB_HARDWARE_CURSOR\n"); } - if(bmode->flags & B_PARALLEL_ACCESS) { + if (bmode->flags & B_PARALLEL_ACCESS) { printf("\t\tB_PARALLEL_ACCESS\n"); } - if(bmode->flags & B_DPMS) { + if (bmode->flags & B_DPMS) { printf("\t\tB_DPMS\n"); } - if(bmode->flags & B_IO_FB_NA) { + if (bmode->flags & B_IO_FB_NA) { printf("\t\tB_IO_FB_NA\n"); } } @@ -109,21 +109,21 @@ void _SpoutModeData(display_mode *bmode) { printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n", bmode->timing.v_display, bmode->timing.v_sync_start, bmode->timing.v_sync_end, bmode->timing.v_total); - if(bmode->timing.flags) { + if (bmode->timing.flags) { printf("\t\tFlags:\n"); - if(bmode->timing.flags & B_BLANK_PEDESTAL) { + if (bmode->timing.flags & B_BLANK_PEDESTAL) { printf("\t\t\tB_BLANK_PEDESTAL\n"); } - if(bmode->timing.flags & B_TIMING_INTERLACED) { + if (bmode->timing.flags & B_TIMING_INTERLACED) { printf("\t\t\tB_TIMING_INTERLACED\n"); } - if(bmode->timing.flags & B_POSITIVE_HSYNC) { + if (bmode->timing.flags & B_POSITIVE_HSYNC) { printf("\t\t\tB_POSITIVE_HSYNC\n"); } - if(bmode->timing.flags & B_POSITIVE_VSYNC) { + if (bmode->timing.flags & B_POSITIVE_VSYNC) { printf("\t\t\tB_POSITIVE_VSYNC\n"); } - if(bmode->timing.flags & B_SYNC_ON_GREEN) { + if (bmode->timing.flags & B_SYNC_ON_GREEN) { printf("\t\t\tB_SYNC_ON_GREEN\n"); } } @@ -247,7 +247,7 @@ void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { bscreen.GetModeList(&bmodes, &count); bscreen.GetMode(&this_bmode); - for(i = 0; i < count; ++i) { + for (i = 0; i < count; ++i) { // FIXME: Apparently there are errors with colorspace changes if (bmodes[i].space == this_bmode.space) { _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode); @@ -258,10 +258,10 @@ void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { } -int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){ +int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* Get the current screen */ BScreen bscreen; - if(!bscreen.IsValid()) { + if (!bscreen.IsValid()) { printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__); } @@ -273,8 +273,8 @@ int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode uint32 c = 0, i; display_mode *bmode_list; bscreen.GetModeList(&bmode_list, &c); - for(i = 0; i < c; ++i) { - if( bmode_list[i].space == bmode->space && + for (i = 0; i < c; ++i) { + if ( bmode_list[i].space == bmode->space && bmode_list[i].virtual_width == bmode->virtual_width && bmode_list[i].virtual_height == bmode->virtual_height ) { bmode = &bmode_list[i]; @@ -282,13 +282,13 @@ int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode } } - if(bscreen.SetMode(bmode) != B_OK) { + if (bscreen.SetMode(bmode) != B_OK) { return SDL_SetError("Bad video mode"); } free(bmode_list); /* This should not be SDL_free() */ -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL /* FIXME: Is there some way to reboot the OpenGL context? This doesn't help */ // HAIKU_GL_RebootContexts(_this); diff --git a/src/video/haiku/SDL_bmodes.h b/src/video/haiku/SDL_bmodes.h index 5b404183350f1..b0d956ed04adf 100644 --- a/src/video/haiku/SDL_bmodes.h +++ b/src/video/haiku/SDL_bmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,10 +33,10 @@ extern int32 HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace); extern int HAIKU_InitModes(_THIS); extern int HAIKU_QuitModes(_THIS); extern int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, - SDL_Rect *rect); + SDL_Rect *rect); extern void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, - SDL_DisplayMode *mode); + SDL_DisplayMode *mode); #ifdef __cplusplus } diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc index 72bdb77f48fa1..eada4c0025c01 100644 --- a/src/video/haiku/SDL_bopengl.cc +++ b/src/video/haiku/SDL_bopengl.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL +#if defined(SDL_VIDEO_DRIVER_HAIKU) && defined(SDL_VIDEO_OPENGL) #include "SDL_bopengl.h" @@ -36,11 +36,11 @@ extern "C" { static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return ((SDL_BWin*)(window->driverdata)); + return (SDL_BWin *)(window->driverdata); } -static SDL_INLINE SDL_BApp *_GetBeApp() { - return ((SDL_BApp*)be_app); +static SDL_INLINE SDL_BLooper *_GetBeLooper() { + return SDL_Looper; } /* Passing a NULL path means load pointers from the application */ @@ -51,7 +51,7 @@ int HAIKU_GL_LoadLibrary(_THIS, const char *path) int32 cookie = 0; while (get_next_image_info(0, &cookie, &info) == B_OK) { void *location = NULL; - if( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY, + if ( get_image_symbol(info.id, "glBegin", B_SYMBOL_TYPE_ANY, &location) == B_OK) { _this->gl_config.dll_handle = (void *) (addr_t) info.id; @@ -65,7 +65,7 @@ int HAIKU_GL_LoadLibrary(_THIS, const char *path) void *HAIKU_GL_GetProcAddress(_THIS, const char *proc) { - if (_this->gl_config.dll_handle != NULL) { + if (_this->gl_config.dll_handle) { void *location = NULL; status_t err; if ((err = @@ -92,12 +92,12 @@ int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window) { int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { BGLView* glView = (BGLView*)context; // printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL)); - if (glView != NULL) { - if ((glView->Window() == NULL) || (window == NULL) || (_ToBeWin(window)->GetGLView() != glView)) { + if (glView) { + if ((glView->Window() == NULL) || (!window) || (_ToBeWin(window)->GetGLView() != glView)) { return SDL_SetError("MakeCurrent failed"); } } - _GetBeApp()->SetCurrentContext(glView); + _GetBeLooper()->SetCurrentContext(glView); return 0; } @@ -138,7 +138,7 @@ SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) { } #endif bwin->CreateGLView(gl_flags); - _GetBeApp()->SetCurrentContext(bwin->GetGLView()); + _GetBeLooper()->SetCurrentContext(bwin->GetGLView()); return (SDL_GLContext)(bwin->GetGLView()); } @@ -146,7 +146,7 @@ void HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) { // printf("HAIKU_GL_DeleteContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL)); BGLView* glView = (BGLView*)context; SDL_BWin *bwin = (SDL_BWin*)glView->Window(); - if (bwin == NULL) { + if (!bwin) { delete glView; } else { bwin->RemoveGLView(); @@ -175,9 +175,9 @@ void HAIKU_GL_UnloadLibrary(_THIS) { currently in use. */ void HAIKU_GL_RebootContexts(_THIS) { SDL_Window *window = _this->windows; - while(window) { + while (window) { SDL_BWin *bwin = _ToBeWin(window); - if(bwin->GetGLView()) { + if (bwin->GetGLView()) { bwin->LockLooper(); bwin->RemoveGLView(); bwin->CreateGLView(bwin->GetGLType()); diff --git a/src/video/haiku/SDL_bopengl.h b/src/video/haiku/SDL_bopengl.h index 4723ae6b5e1bc..b3bd6c894019a 100644 --- a/src/video/haiku/SDL_bopengl.h +++ b/src/video/haiku/SDL_bopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_BOPENGL_H #define SDL_BOPENGL_H -#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL +#if defined(SDL_VIDEO_DRIVER_HAIKU) && defined(SDL_VIDEO_OPENGL) #ifdef __cplusplus extern "C" { @@ -30,16 +30,15 @@ extern "C" { #include "../SDL_sysvideo.h" - -extern int HAIKU_GL_LoadLibrary(_THIS, const char *path); /* FIXME */ -extern void *HAIKU_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */ -extern void HAIKU_GL_UnloadLibrary(_THIS); /* TODO */ -extern int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, - SDL_GLContext context); -extern int HAIKU_GL_SetSwapInterval(_THIS, int interval); /* TODO */ -extern int HAIKU_GL_GetSwapInterval(_THIS); /* TODO */ -extern int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window); -extern SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window); +extern int HAIKU_GL_LoadLibrary(_THIS, const char *path); /* FIXME */ +extern void *HAIKU_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */ +extern void HAIKU_GL_UnloadLibrary(_THIS); /* TODO */ +extern int HAIKU_GL_MakeCurrent(_THIS, SDL_Window *window, + SDL_GLContext context); +extern int HAIKU_GL_SetSwapInterval(_THIS, int interval); /* TODO */ +extern int HAIKU_GL_GetSwapInterval(_THIS); /* TODO */ +extern int HAIKU_GL_SwapWindow(_THIS, SDL_Window *window); +extern SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window *window); extern void HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context); extern void HAIKU_GL_RebootContexts(_THIS); diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc index e409f3c6fd61c..d5412893432f0 100644 --- a/src/video/haiku/SDL_bvideo.cc +++ b/src/video/haiku/SDL_bvideo.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #include "../../SDL_internal.h" #include "../../main/haiku/SDL_BApp.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include "SDL_BWin.h" #include @@ -39,9 +39,10 @@ extern "C" { #include "SDL_bmodes.h" #include "SDL_bframebuffer.h" #include "SDL_bevents.h" +#include "SDL_bmessagebox.h" static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return ((SDL_BWin*)(window->driverdata)); + return (SDL_BWin *)(window->driverdata); } /* FIXME: Undefined functions */ @@ -54,8 +55,7 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { /* End undefined functions */ -static SDL_VideoDevice * -HAIKU_CreateDevice(void) +static SDL_VideoDevice * HAIKU_CreateDevice(void) { SDL_VideoDevice *device; /*SDL_VideoData *data;*/ @@ -105,7 +105,7 @@ HAIKU_CreateDevice(void) device->shape_driver.SetWindowShape = NULL; device->shape_driver.ResizeWindowShape = NULL; -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL device->GL_LoadLibrary = HAIKU_GL_LoadLibrary; device->GL_GetProcAddress = HAIKU_GL_GetProcAddress; device->GL_UnloadLibrary = HAIKU_GL_UnloadLibrary; @@ -132,7 +132,8 @@ HAIKU_CreateDevice(void) VideoBootStrap HAIKU_bootstrap = { "haiku", "Haiku graphics", - HAIKU_CreateDevice + HAIKU_CreateDevice, + HAIKU_ShowMessageBox }; void HAIKU_DeleteDevice(SDL_VideoDevice * device) @@ -141,8 +142,7 @@ void HAIKU_DeleteDevice(SDL_VideoDevice * device) SDL_free(device); } -static SDL_Cursor * -HAIKU_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor * HAIKU_CreateSystemCursor(SDL_SystemCursor id) { SDL_Cursor *cursor; BCursorID cursorId = B_CURSOR_ID_SYSTEM_DEFAULT; @@ -176,14 +176,12 @@ HAIKU_CreateSystemCursor(SDL_SystemCursor id) return cursor; } -static SDL_Cursor * -HAIKU_CreateDefaultCursor() +static SDL_Cursor * HAIKU_CreateDefaultCursor() { return HAIKU_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW); } -static void -HAIKU_FreeCursor(SDL_Cursor * cursor) +static void HAIKU_FreeCursor(SDL_Cursor * cursor) { if (cursor->driverdata) { delete (BCursor*) cursor->driverdata; @@ -191,8 +189,7 @@ HAIKU_FreeCursor(SDL_Cursor * cursor) SDL_free(cursor); } -static SDL_Cursor * -HAIKU_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor * HAIKU_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) { SDL_Cursor *cursor; SDL_Surface *converted; @@ -220,8 +217,9 @@ static int HAIKU_ShowCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse) + if (!mouse) { return 0; + } if (cursor) { BCursor *hCursor = (BCursor*)cursor->driverdata; @@ -235,8 +233,7 @@ static int HAIKU_ShowCursor(SDL_Cursor *cursor) return 0; } -static int -HAIKU_SetRelativeMouseMode(SDL_bool enabled) +static int HAIKU_SetRelativeMouseMode(SDL_bool enabled) { SDL_Window *window = SDL_GetMouseFocus(); if (!window) { @@ -259,8 +256,9 @@ HAIKU_SetRelativeMouseMode(SDL_bool enabled) static void HAIKU_MouseInit(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse) + if (!mouse) { return; + } mouse->CreateCursor = HAIKU_CreateCursor; mouse->CreateSystemCursor = HAIKU_CreateSystemCursor; mouse->ShowCursor = HAIKU_ShowCursor; @@ -285,14 +283,14 @@ int HAIKU_VideoInit(_THIS) HAIKU_MouseInit(_this); -#if SDL_VIDEO_OPENGL +#ifdef SDL_VIDEO_OPENGL /* testgl application doesn't load library, just tries to load symbols */ /* is it correct? if so we have to load library here */ HAIKU_GL_LoadLibrary(_this, NULL); #endif /* We're done! */ - return (0); + return 0; } void HAIKU_VideoQuit(_THIS) @@ -309,7 +307,7 @@ int HAIKU_OpenURL(const char *url) { BUrl burl(url); const status_t rc = burl.OpenWithPreferredApplication(false); - return (rc == B_NO_ERROR) ? 0 : SDL_SetError("URL open failed (err=%d)", (int) rc); + return (rc == B_NO_ERROR) ? 0 : SDL_SetError("URL open failed (err=%d)", (int)rc); } #ifdef __cplusplus diff --git a/src/video/haiku/SDL_bvideo.h b/src/video/haiku/SDL_bvideo.h index d0d7bfea575df..21a6797df499b 100644 --- a/src/video/haiku/SDL_bvideo.h +++ b/src/video/haiku/SDL_bvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,6 @@ extern "C" { #include "../../main/haiku/SDL_BeApp.h" #include "../SDL_sysvideo.h" - extern void HAIKU_VideoQuit(_THIS); extern int HAIKU_VideoInit(_THIS); extern void HAIKU_DeleteDevice(_THIS); diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc index 24625337d9e07..0ca751aca0cea 100644 --- a/src/video/haiku/SDL_bwindow.cc +++ b/src/video/haiku/SDL_bwindow.cc @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_HAIKU +#ifdef SDL_VIDEO_DRIVER_HAIKU #include "../SDL_sysvideo.h" #include "SDL_BWin.h" @@ -34,11 +34,11 @@ extern "C" { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return ((SDL_BWin*)(window->driverdata)); + return (SDL_BWin *)(window->driverdata); } -static SDL_INLINE SDL_BApp *_GetBeApp() { - return ((SDL_BApp*)be_app); +static SDL_INLINE SDL_BLooper *_GetBeLooper() { + return SDL_Looper; } static int _InitWindow(_THIS, SDL_Window *window) { @@ -52,26 +52,27 @@ static int _InitWindow(_THIS, SDL_Window *window) { window->y + window->h - 1 ); - if(window->flags & SDL_WINDOW_FULLSCREEN) { + if (window->flags & SDL_WINDOW_FULLSCREEN) { /* TODO: Add support for this flag */ printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__); } - if(window->flags & SDL_WINDOW_OPENGL) { + if (window->flags & SDL_WINDOW_OPENGL) { /* TODO: Add support for this flag */ } - if(!(window->flags & SDL_WINDOW_RESIZABLE)) { + if (!(window->flags & SDL_WINDOW_RESIZABLE)) { flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE; } - if(window->flags & SDL_WINDOW_BORDERLESS) { + if (window->flags & SDL_WINDOW_BORDERLESS) { look = B_NO_BORDER_WINDOW_LOOK; } SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags); - if(bwin == NULL) + if (!bwin) { return -1; + } window->driverdata = bwin; - int32 winID = _GetBeApp()->GetID(window); + int32 winID = _GetBeLooper()->GetID(window); bwin->SetID(winID); return 0; @@ -90,8 +91,9 @@ int HAIKU_CreateWindow(_THIS, SDL_Window *window) { int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { SDL_BWin *otherBWin = (SDL_BWin*)data; - if(!otherBWin->LockLooper()) + if (!otherBWin->LockLooper()) { return -1; + } /* Create the new window and initialize its members */ window->x = (int)otherBWin->Frame().left; @@ -100,7 +102,7 @@ int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { window->h = (int)otherBWin->Frame().Height(); /* Set SDL flags */ - if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) { + if (!(otherBWin->Flags() & B_NOT_RESIZABLE)) { window->flags |= SDL_WINDOW_RESIZABLE; } @@ -205,7 +207,7 @@ int HAIKU_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) { } -void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window * window){ +void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window * window) { BMessage msg(BWIN_MINIMUM_SIZE_WINDOW); msg.AddInt32("window-w", window->w -1); msg.AddInt32("window-h", window->h -1); @@ -218,7 +220,7 @@ void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { void HAIKU_DestroyWindow(_THIS, SDL_Window * window) { _ToBeWin(window)->LockLooper(); /* This MUST be locked */ - _GetBeApp()->ClearID(_ToBeWin(window)); + _GetBeLooper()->ClearID(_ToBeWin(window)); _ToBeWin(window)->Quit(); window->driverdata = NULL; } diff --git a/src/video/haiku/SDL_bwindow.h b/src/video/haiku/SDL_bwindow.h index 58a85d8725d59..fa42c356ad94b 100644 --- a/src/video/haiku/SDL_bwindow.h +++ b/src/video/haiku/SDL_bwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,10 +22,8 @@ #ifndef SDL_BWINDOW_H #define SDL_BWINDOW_H - #include "../SDL_sysvideo.h" - extern int HAIKU_CreateWindow(_THIS, SDL_Window *window); extern int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); extern void HAIKU_SetWindowTitle(_THIS, SDL_Window * window); @@ -49,8 +47,6 @@ extern void HAIKU_DestroyWindow(_THIS, SDL_Window * window); extern SDL_bool HAIKU_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info); - - #endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/khronos/EGL/egl.h b/src/video/khronos/EGL/egl.h index 97d0878cc7a29..c58f552bf58d0 100644 --- a/src/video/khronos/EGL/egl.h +++ b/src/video/khronos/EGL/egl.h @@ -14,7 +14,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ +** Khronos $Git commit SHA1: f4cc936b88 $ on $Git commit date: 2023-12-16 01:21:49 -0500 $ */ #include @@ -23,7 +23,7 @@ extern "C" { #define EGL_EGL_PROTOTYPES 1 #endif -/* Generated on date 20220525 */ +/* Generated on date 20231215 */ /* Generated C header for: * API: egl diff --git a/src/video/khronos/EGL/eglext.h b/src/video/khronos/EGL/eglext.h index d58da70e6b3be..9932ebeec55cd 100644 --- a/src/video/khronos/EGL/eglext.h +++ b/src/video/khronos/EGL/eglext.h @@ -14,12 +14,12 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.khronos.org/registry/egl ** -** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $ +** Khronos $Git commit SHA1: f4cc936b88 $ on $Git commit date: 2023-12-16 01:21:49 -0500 $ */ #include -#define EGL_EGLEXT_VERSION 20220525 +#define EGL_EGLEXT_VERSION 20231215 /* Generated C header for: * API: egl @@ -727,6 +727,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi #define EGL_EXT_explicit_device 1 #endif /* EGL_EXT_explicit_device */ +#ifndef EGL_EXT_gl_colorspace_bt2020_hlg +#define EGL_EXT_gl_colorspace_bt2020_hlg 1 +#define EGL_GL_COLORSPACE_BT2020_HLG_EXT 0x3540 +#endif /* EGL_EXT_gl_colorspace_bt2020_hlg */ + #ifndef EGL_EXT_gl_colorspace_bt2020_linear #define EGL_EXT_gl_colorspace_bt2020_linear 1 #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F @@ -923,6 +928,10 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, #define EGL_EXT_protected_surface 1 #endif /* EGL_EXT_protected_surface */ +#ifndef EGL_EXT_query_reset_notification_strategy +#define EGL_EXT_query_reset_notification_strategy 1 +#endif /* EGL_EXT_query_reset_notification_strategy */ + #ifndef EGL_EXT_stream_consumer_egloutput #define EGL_EXT_stream_consumer_egloutput 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer); @@ -1223,6 +1232,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStream #endif #endif /* EGL_NV_stream_consumer_eglimage */ +#ifndef EGL_NV_stream_consumer_eglimage_use_scanout_attrib +#define EGL_NV_stream_consumer_eglimage_use_scanout_attrib 1 +#define EGL_STREAM_CONSUMER_IMAGE_USE_SCANOUT_NV 0x3378 +#endif /* EGL_NV_stream_consumer_eglimage_use_scanout_attrib */ + #ifndef EGL_NV_stream_consumer_gltexture_yuv #define EGL_NV_stream_consumer_gltexture_yuv 1 #define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C @@ -1432,6 +1446,16 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #define EGL_TRIPLE_BUFFER_NV 0x3230 #endif /* EGL_NV_triple_buffer */ +#ifndef EGL_QNX_image_native_buffer +#define EGL_QNX_image_native_buffer 1 +#define EGL_NATIVE_BUFFER_QNX 0x3551 +#endif /* EGL_QNX_image_native_buffer */ + +#ifndef EGL_QNX_platform_screen +#define EGL_QNX_platform_screen 1 +#define EGL_PLATFORM_SCREEN_QNX 0x3550 +#endif /* EGL_QNX_platform_screen */ + #ifndef EGL_TIZEN_image_native_buffer #define EGL_TIZEN_image_native_buffer 1 #define EGL_NATIVE_BUFFER_TIZEN 0x32A0 diff --git a/src/video/khronos/EGL/eglplatform.h b/src/video/khronos/EGL/eglplatform.h index 99362a23deeac..6786afd90b685 100644 --- a/src/video/khronos/EGL/eglplatform.h +++ b/src/video/khronos/EGL/eglplatform.h @@ -64,6 +64,12 @@ typedef HDC EGLNativeDisplayType; typedef HBITMAP EGLNativePixmapType; typedef HWND EGLNativeWindowType; +#elif defined(__QNX__) + +typedef khronos_uintptr_t EGLNativeDisplayType; +typedef struct _screen_pixmap* EGLNativePixmapType; /* screen_pixmap_t */ +typedef struct _screen_window* EGLNativeWindowType; /* screen_window_t */ + #elif defined(__EMSCRIPTEN__) typedef int EGLNativeDisplayType; diff --git a/src/video/khronos/GLES2/gl2.h b/src/video/khronos/GLES2/gl2.h index af244a70c1f7f..6be4e3637b4a6 100644 --- a/src/video/khronos/GLES2/gl2.h +++ b/src/video/khronos/GLES2/gl2.h @@ -25,7 +25,7 @@ extern "C" { #define GL_GLES_PROTOTYPES 1 #endif -/* Generated on date 20220530 */ +/* Generated on date 20231129 */ /* Generated C header for: * API: gles2 diff --git a/src/video/khronos/GLES2/gl2ext.h b/src/video/khronos/GLES2/gl2ext.h index 9448ce09fc705..63b530b4b7c3f 100644 --- a/src/video/khronos/GLES2/gl2ext.h +++ b/src/video/khronos/GLES2/gl2ext.h @@ -19,7 +19,7 @@ extern "C" { #define GL_APIENTRYP GL_APIENTRY* #endif -/* Generated on date 20220530 */ +/* Generated on date 20231129 */ /* Generated C header for: * API: gles2 @@ -1052,6 +1052,21 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei #define GL_ARM_rgba8 1 #endif /* GL_ARM_rgba8 */ +#ifndef GL_ARM_shader_core_properties +#define GL_ARM_shader_core_properties 1 +#define GL_SHADER_CORE_COUNT_ARM 0x96F0 +#define GL_SHADER_CORE_ACTIVE_COUNT_ARM 0x96F1 +#define GL_SHADER_CORE_PRESENT_MASK_ARM 0x96F2 +#define GL_SHADER_CORE_MAX_WARP_COUNT_ARM 0x96F3 +#define GL_SHADER_CORE_PIXEL_RATE_ARM 0x96F4 +#define GL_SHADER_CORE_TEXEL_RATE_ARM 0x96F5 +#define GL_SHADER_CORE_FMA_RATE_ARM 0x96F6 +typedef void (GL_APIENTRYP PFNGLMAXACTIVESHADERCORESARMPROC) (GLuint count); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMaxActiveShaderCoresARM (GLuint count); +#endif +#endif /* GL_ARM_shader_core_properties */ + #ifndef GL_ARM_shader_framebuffer_fetch #define GL_ARM_shader_framebuffer_fetch 1 #define GL_FETCH_PER_SAMPLE_ARM 0x8F65 @@ -1459,6 +1474,16 @@ GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum a #endif #endif /* GL_EXT_fragment_shading_rate */ +#ifndef GL_EXT_framebuffer_blit_layers +#define GL_EXT_framebuffer_blit_layers 1 +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERLAYERSEXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERLAYEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferLayersEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GL_APICALL void GL_APIENTRY glBlitFramebufferLayerEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint srcLayer, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstLayer, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_EXT_framebuffer_blit_layers */ + #ifndef GL_EXT_geometry_point_size #define GL_EXT_geometry_point_size 1 #endif /* GL_EXT_geometry_point_size */ @@ -1856,7 +1881,7 @@ GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLe #define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar *const*strings); typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); @@ -1901,7 +1926,7 @@ typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint progra #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); +GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar *const*strings); GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); @@ -2553,6 +2578,33 @@ GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLen #define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F #endif /* GL_MESA_program_binary_formats */ +#ifndef GL_MESA_sampler_objects +#define GL_MESA_sampler_objects 1 +#define GL_SAMPLER_BINDING 0x8919 +typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GL_APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler); +GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +#endif +#endif /* GL_MESA_sampler_objects */ + #ifndef GL_MESA_shader_integer_functions #define GL_MESA_shader_integer_functions 1 #endif /* GL_MESA_shader_integer_functions */ @@ -3186,6 +3238,13 @@ GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei coun #endif #endif /* GL_NV_non_square_matrices */ +#ifndef GL_NV_pack_subimage +#define GL_NV_pack_subimage 1 +#define GL_PACK_ROW_LENGTH_NV 0x0D02 +#define GL_PACK_SKIP_ROWS_NV 0x0D03 +#define GL_PACK_SKIP_PIXELS_NV 0x0D04 +#endif /* GL_NV_pack_subimage */ + #ifndef GL_NV_path_rendering #define GL_NV_path_rendering 1 typedef double GLdouble; @@ -3917,6 +3976,10 @@ GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint t #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif /* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_render_sRGB_R8_RG8 +#define GL_QCOM_render_sRGB_R8_RG8 1 +#endif /* GL_QCOM_render_sRGB_R8_RG8 */ + #ifndef GL_QCOM_render_shared_exponent #define GL_QCOM_render_shared_exponent 1 #endif /* GL_QCOM_render_shared_exponent */ @@ -3974,6 +4037,11 @@ GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GL #define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1 #endif /* GL_QCOM_texture_foveated_subsampled_layout */ +#ifndef GL_QCOM_texture_lod_bias +#define GL_QCOM_texture_lod_bias 1 +#define GL_TEXTURE_LOD_BIAS_QCOM 0x8C96 +#endif /* GL_QCOM_texture_lod_bias */ + #ifndef GL_QCOM_tiled_rendering #define GL_QCOM_tiled_rendering 1 #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h264std.h b/src/video/khronos/vk_video/vulkan_video_codec_h264std.h new file mode 100644 index 0000000000000..6d27af37b7334 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h264std.h @@ -0,0 +1,312 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_H_ +#define VULKAN_VIDEO_CODEC_H264STD_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h264std is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h264std 1 +#include "vulkan_video_codecs_common.h" +#define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 +#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 +#define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 +#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS 6 +#define STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS 64 +#define STD_VIDEO_H264_MAX_NUM_LIST_REF 32 +#define STD_VIDEO_H264_MAX_CHROMA_PLANES 2 +#define STD_VIDEO_H264_NO_REFERENCE_PICTURE 0xFF + +typedef enum StdVideoH264ChromaFormatIdc { + STD_VIDEO_H264_CHROMA_FORMAT_IDC_MONOCHROME = 0, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_420 = 1, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_422 = 2, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_444 = 3, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ChromaFormatIdc; + +typedef enum StdVideoH264ProfileIdc { + STD_VIDEO_H264_PROFILE_IDC_BASELINE = 66, + STD_VIDEO_H264_PROFILE_IDC_MAIN = 77, + STD_VIDEO_H264_PROFILE_IDC_HIGH = 100, + STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE = 244, + STD_VIDEO_H264_PROFILE_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ProfileIdc; + +typedef enum StdVideoH264LevelIdc { + STD_VIDEO_H264_LEVEL_IDC_1_0 = 0, + STD_VIDEO_H264_LEVEL_IDC_1_1 = 1, + STD_VIDEO_H264_LEVEL_IDC_1_2 = 2, + STD_VIDEO_H264_LEVEL_IDC_1_3 = 3, + STD_VIDEO_H264_LEVEL_IDC_2_0 = 4, + STD_VIDEO_H264_LEVEL_IDC_2_1 = 5, + STD_VIDEO_H264_LEVEL_IDC_2_2 = 6, + STD_VIDEO_H264_LEVEL_IDC_3_0 = 7, + STD_VIDEO_H264_LEVEL_IDC_3_1 = 8, + STD_VIDEO_H264_LEVEL_IDC_3_2 = 9, + STD_VIDEO_H264_LEVEL_IDC_4_0 = 10, + STD_VIDEO_H264_LEVEL_IDC_4_1 = 11, + STD_VIDEO_H264_LEVEL_IDC_4_2 = 12, + STD_VIDEO_H264_LEVEL_IDC_5_0 = 13, + STD_VIDEO_H264_LEVEL_IDC_5_1 = 14, + STD_VIDEO_H264_LEVEL_IDC_5_2 = 15, + STD_VIDEO_H264_LEVEL_IDC_6_0 = 16, + STD_VIDEO_H264_LEVEL_IDC_6_1 = 17, + STD_VIDEO_H264_LEVEL_IDC_6_2 = 18, + STD_VIDEO_H264_LEVEL_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264LevelIdc; + +typedef enum StdVideoH264PocType { + STD_VIDEO_H264_POC_TYPE_0 = 0, + STD_VIDEO_H264_POC_TYPE_1 = 1, + STD_VIDEO_H264_POC_TYPE_2 = 2, + STD_VIDEO_H264_POC_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_POC_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264PocType; + +typedef enum StdVideoH264AspectRatioIdc { + STD_VIDEO_H264_ASPECT_RATIO_IDC_UNSPECIFIED = 0, + STD_VIDEO_H264_ASPECT_RATIO_IDC_SQUARE = 1, + STD_VIDEO_H264_ASPECT_RATIO_IDC_12_11 = 2, + STD_VIDEO_H264_ASPECT_RATIO_IDC_10_11 = 3, + STD_VIDEO_H264_ASPECT_RATIO_IDC_16_11 = 4, + STD_VIDEO_H264_ASPECT_RATIO_IDC_40_33 = 5, + STD_VIDEO_H264_ASPECT_RATIO_IDC_24_11 = 6, + STD_VIDEO_H264_ASPECT_RATIO_IDC_20_11 = 7, + STD_VIDEO_H264_ASPECT_RATIO_IDC_32_11 = 8, + STD_VIDEO_H264_ASPECT_RATIO_IDC_80_33 = 9, + STD_VIDEO_H264_ASPECT_RATIO_IDC_18_11 = 10, + STD_VIDEO_H264_ASPECT_RATIO_IDC_15_11 = 11, + STD_VIDEO_H264_ASPECT_RATIO_IDC_64_33 = 12, + STD_VIDEO_H264_ASPECT_RATIO_IDC_160_99 = 13, + STD_VIDEO_H264_ASPECT_RATIO_IDC_4_3 = 14, + STD_VIDEO_H264_ASPECT_RATIO_IDC_3_2 = 15, + STD_VIDEO_H264_ASPECT_RATIO_IDC_2_1 = 16, + STD_VIDEO_H264_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, + STD_VIDEO_H264_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264AspectRatioIdc; + +typedef enum StdVideoH264WeightedBipredIdc { + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_DEFAULT = 0, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_EXPLICIT = 1, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_IMPLICIT = 2, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_WEIGHTED_BIPRED_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264WeightedBipredIdc; + +typedef enum StdVideoH264ModificationOfPicNumsIdc { + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_SUBTRACT = 0, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_SHORT_TERM_ADD = 1, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_LONG_TERM = 2, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_END = 3, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_MODIFICATION_OF_PIC_NUMS_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264ModificationOfPicNumsIdc; + +typedef enum StdVideoH264MemMgmtControlOp { + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_END = 0, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_SHORT_TERM = 1, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_LONG_TERM = 2, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_LONG_TERM = 3, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_SET_MAX_LONG_TERM_INDEX = 4, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_UNMARK_ALL = 5, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MARK_CURRENT_AS_LONG_TERM = 6, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_MEM_MGMT_CONTROL_OP_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264MemMgmtControlOp; + +typedef enum StdVideoH264CabacInitIdc { + STD_VIDEO_H264_CABAC_INIT_IDC_0 = 0, + STD_VIDEO_H264_CABAC_INIT_IDC_1 = 1, + STD_VIDEO_H264_CABAC_INIT_IDC_2 = 2, + STD_VIDEO_H264_CABAC_INIT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_CABAC_INIT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264CabacInitIdc; + +typedef enum StdVideoH264DisableDeblockingFilterIdc { + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_DISABLED = 0, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_ENABLED = 1, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_PARTIAL = 2, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_DISABLE_DEBLOCKING_FILTER_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264DisableDeblockingFilterIdc; + +typedef enum StdVideoH264SliceType { + STD_VIDEO_H264_SLICE_TYPE_P = 0, + STD_VIDEO_H264_SLICE_TYPE_B = 1, + STD_VIDEO_H264_SLICE_TYPE_I = 2, + STD_VIDEO_H264_SLICE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264SliceType; + +typedef enum StdVideoH264PictureType { + STD_VIDEO_H264_PICTURE_TYPE_P = 0, + STD_VIDEO_H264_PICTURE_TYPE_B = 1, + STD_VIDEO_H264_PICTURE_TYPE_I = 2, + STD_VIDEO_H264_PICTURE_TYPE_IDR = 5, + STD_VIDEO_H264_PICTURE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264PictureType; + +typedef enum StdVideoH264NonVclNaluType { + STD_VIDEO_H264_NON_VCL_NALU_TYPE_SPS = 0, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PPS = 1, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_AUD = 2, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PREFIX = 3, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_SEQUENCE = 4, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_END_OF_STREAM = 5, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_PRECODED = 6, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H264_NON_VCL_NALU_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH264NonVclNaluType; +typedef struct StdVideoH264SpsVuiFlags { + uint32_t aspect_ratio_info_present_flag : 1; + uint32_t overscan_info_present_flag : 1; + uint32_t overscan_appropriate_flag : 1; + uint32_t video_signal_type_present_flag : 1; + uint32_t video_full_range_flag : 1; + uint32_t color_description_present_flag : 1; + uint32_t chroma_loc_info_present_flag : 1; + uint32_t timing_info_present_flag : 1; + uint32_t fixed_frame_rate_flag : 1; + uint32_t bitstream_restriction_flag : 1; + uint32_t nal_hrd_parameters_present_flag : 1; + uint32_t vcl_hrd_parameters_present_flag : 1; +} StdVideoH264SpsVuiFlags; + +typedef struct StdVideoH264HrdParameters { + uint8_t cpb_cnt_minus1; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t reserved1; + uint32_t bit_rate_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_value_minus1[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint8_t cbr_flag[STD_VIDEO_H264_CPB_CNT_LIST_SIZE]; + uint32_t initial_cpb_removal_delay_length_minus1; + uint32_t cpb_removal_delay_length_minus1; + uint32_t dpb_output_delay_length_minus1; + uint32_t time_offset_length; +} StdVideoH264HrdParameters; + +typedef struct StdVideoH264SequenceParameterSetVui { + StdVideoH264SpsVuiFlags flags; + StdVideoH264AspectRatioIdc aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + uint8_t video_format; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + uint32_t num_units_in_tick; + uint32_t time_scale; + uint8_t max_num_reorder_frames; + uint8_t max_dec_frame_buffering; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + uint32_t reserved1; + const StdVideoH264HrdParameters* pHrdParameters; +} StdVideoH264SequenceParameterSetVui; + +typedef struct StdVideoH264SpsFlags { + uint32_t constraint_set0_flag : 1; + uint32_t constraint_set1_flag : 1; + uint32_t constraint_set2_flag : 1; + uint32_t constraint_set3_flag : 1; + uint32_t constraint_set4_flag : 1; + uint32_t constraint_set5_flag : 1; + uint32_t direct_8x8_inference_flag : 1; + uint32_t mb_adaptive_frame_field_flag : 1; + uint32_t frame_mbs_only_flag : 1; + uint32_t delta_pic_order_always_zero_flag : 1; + uint32_t separate_colour_plane_flag : 1; + uint32_t gaps_in_frame_num_value_allowed_flag : 1; + uint32_t qpprime_y_zero_transform_bypass_flag : 1; + uint32_t frame_cropping_flag : 1; + uint32_t seq_scaling_matrix_present_flag : 1; + uint32_t vui_parameters_present_flag : 1; +} StdVideoH264SpsFlags; + +typedef struct StdVideoH264ScalingLists { + uint16_t scaling_list_present_mask; + uint16_t use_default_scaling_matrix_mask; + uint8_t ScalingList4x4[STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS]; + uint8_t ScalingList8x8[STD_VIDEO_H264_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H264_SCALING_LIST_8X8_NUM_ELEMENTS]; +} StdVideoH264ScalingLists; + +typedef struct StdVideoH264SequenceParameterSet { + StdVideoH264SpsFlags flags; + StdVideoH264ProfileIdc profile_idc; + StdVideoH264LevelIdc level_idc; + StdVideoH264ChromaFormatIdc chroma_format_idc; + uint8_t seq_parameter_set_id; + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + uint8_t log2_max_frame_num_minus4; + StdVideoH264PocType pic_order_cnt_type; + int32_t offset_for_non_ref_pic; + int32_t offset_for_top_to_bottom_field; + uint8_t log2_max_pic_order_cnt_lsb_minus4; + uint8_t num_ref_frames_in_pic_order_cnt_cycle; + uint8_t max_num_ref_frames; + uint8_t reserved1; + uint32_t pic_width_in_mbs_minus1; + uint32_t pic_height_in_map_units_minus1; + uint32_t frame_crop_left_offset; + uint32_t frame_crop_right_offset; + uint32_t frame_crop_top_offset; + uint32_t frame_crop_bottom_offset; + uint32_t reserved2; + const int32_t* pOffsetForRefFrame; + const StdVideoH264ScalingLists* pScalingLists; + const StdVideoH264SequenceParameterSetVui* pSequenceParameterSetVui; +} StdVideoH264SequenceParameterSet; + +typedef struct StdVideoH264PpsFlags { + uint32_t transform_8x8_mode_flag : 1; + uint32_t redundant_pic_cnt_present_flag : 1; + uint32_t constrained_intra_pred_flag : 1; + uint32_t deblocking_filter_control_present_flag : 1; + uint32_t weighted_pred_flag : 1; + uint32_t bottom_field_pic_order_in_frame_present_flag : 1; + uint32_t entropy_coding_mode_flag : 1; + uint32_t pic_scaling_matrix_present_flag : 1; +} StdVideoH264PpsFlags; + +typedef struct StdVideoH264PictureParameterSet { + StdVideoH264PpsFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + StdVideoH264WeightedBipredIdc weighted_bipred_idc; + int8_t pic_init_qp_minus26; + int8_t pic_init_qs_minus26; + int8_t chroma_qp_index_offset; + int8_t second_chroma_qp_index_offset; + const StdVideoH264ScalingLists* pScalingLists; +} StdVideoH264PictureParameterSet; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h264std_decode.h b/src/video/khronos/vk_video/vulkan_video_codec_h264std_decode.h new file mode 100644 index 0000000000000..439cb885e71b7 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h264std_decode.h @@ -0,0 +1,77 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ +#define VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h264std_decode is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h264std_decode 1 +#include "vulkan_video_codec_h264std.h" + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_decode" +#define STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE 2 + +typedef enum StdVideoDecodeH264FieldOrderCount { + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_TOP = 0, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_BOTTOM = 1, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_INVALID = 0x7FFFFFFF, + STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_MAX_ENUM = 0x7FFFFFFF +} StdVideoDecodeH264FieldOrderCount; +typedef struct StdVideoDecodeH264PictureInfoFlags { + uint32_t field_pic_flag : 1; + uint32_t is_intra : 1; + uint32_t IdrPicFlag : 1; + uint32_t bottom_field_flag : 1; + uint32_t is_reference : 1; + uint32_t complementary_field_pair : 1; +} StdVideoDecodeH264PictureInfoFlags; + +typedef struct StdVideoDecodeH264PictureInfo { + StdVideoDecodeH264PictureInfoFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint8_t reserved1; + uint8_t reserved2; + uint16_t frame_num; + uint16_t idr_pic_id; + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; +} StdVideoDecodeH264PictureInfo; + +typedef struct StdVideoDecodeH264ReferenceInfoFlags { + uint32_t top_field_flag : 1; + uint32_t bottom_field_flag : 1; + uint32_t used_for_long_term_reference : 1; + uint32_t is_non_existing : 1; +} StdVideoDecodeH264ReferenceInfoFlags; + +typedef struct StdVideoDecodeH264ReferenceInfo { + StdVideoDecodeH264ReferenceInfoFlags flags; + uint16_t FrameNum; + uint16_t reserved; + int32_t PicOrderCnt[STD_VIDEO_DECODE_H264_FIELD_ORDER_COUNT_LIST_SIZE]; +} StdVideoDecodeH264ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h264std_encode.h b/src/video/khronos/vk_video/vulkan_video_codec_h264std_encode.h new file mode 100644 index 0000000000000..9e24aa5d991d3 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h264std_encode.h @@ -0,0 +1,147 @@ +#ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ +#define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h264std_encode is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h264std_encode 1 +#include "vulkan_video_codec_h264std.h" + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H264_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h264_encode" +typedef struct StdVideoEncodeH264WeightTableFlags { + uint32_t luma_weight_l0_flag; + uint32_t chroma_weight_l0_flag; + uint32_t luma_weight_l1_flag; + uint32_t chroma_weight_l1_flag; +} StdVideoEncodeH264WeightTableFlags; + +typedef struct StdVideoEncodeH264WeightTable { + StdVideoEncodeH264WeightTableFlags flags; + uint8_t luma_log2_weight_denom; + uint8_t chroma_log2_weight_denom; + int8_t luma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t luma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t chroma_weight_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t chroma_offset_l0[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t luma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t luma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + int8_t chroma_weight_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; + int8_t chroma_offset_l1[STD_VIDEO_H264_MAX_NUM_LIST_REF][STD_VIDEO_H264_MAX_CHROMA_PLANES]; +} StdVideoEncodeH264WeightTable; + +typedef struct StdVideoEncodeH264SliceHeaderFlags { + uint32_t direct_spatial_mv_pred_flag : 1; + uint32_t num_ref_idx_active_override_flag : 1; + uint32_t reserved : 30; +} StdVideoEncodeH264SliceHeaderFlags; + +typedef struct StdVideoEncodeH264PictureInfoFlags { + uint32_t IdrPicFlag : 1; + uint32_t is_reference : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t long_term_reference_flag : 1; + uint32_t adaptive_ref_pic_marking_mode_flag : 1; + uint32_t reserved : 27; +} StdVideoEncodeH264PictureInfoFlags; + +typedef struct StdVideoEncodeH264ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; + uint32_t reserved : 31; +} StdVideoEncodeH264ReferenceInfoFlags; + +typedef struct StdVideoEncodeH264ReferenceListsInfoFlags { + uint32_t ref_pic_list_modification_flag_l0 : 1; + uint32_t ref_pic_list_modification_flag_l1 : 1; + uint32_t reserved : 30; +} StdVideoEncodeH264ReferenceListsInfoFlags; + +typedef struct StdVideoEncodeH264RefListModEntry { + StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc; + uint16_t abs_diff_pic_num_minus1; + uint16_t long_term_pic_num; +} StdVideoEncodeH264RefListModEntry; + +typedef struct StdVideoEncodeH264RefPicMarkingEntry { + StdVideoH264MemMgmtControlOp memory_management_control_operation; + uint16_t difference_of_pic_nums_minus1; + uint16_t long_term_pic_num; + uint16_t long_term_frame_idx; + uint16_t max_long_term_frame_idx_plus1; +} StdVideoEncodeH264RefPicMarkingEntry; + +typedef struct StdVideoEncodeH264ReferenceListsInfo { + StdVideoEncodeH264ReferenceListsInfoFlags flags; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + uint8_t RefPicList0[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + uint8_t RefPicList1[STD_VIDEO_H264_MAX_NUM_LIST_REF]; + uint8_t refList0ModOpCount; + uint8_t refList1ModOpCount; + uint8_t refPicMarkingOpCount; + uint8_t reserved1[7]; + const StdVideoEncodeH264RefListModEntry* pRefList0ModOperations; + const StdVideoEncodeH264RefListModEntry* pRefList1ModOperations; + const StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations; +} StdVideoEncodeH264ReferenceListsInfo; + +typedef struct StdVideoEncodeH264PictureInfo { + StdVideoEncodeH264PictureInfoFlags flags; + uint8_t seq_parameter_set_id; + uint8_t pic_parameter_set_id; + uint16_t idr_pic_id; + StdVideoH264PictureType primary_pic_type; + uint32_t frame_num; + int32_t PicOrderCnt; + uint8_t temporal_id; + uint8_t reserved1[3]; + const StdVideoEncodeH264ReferenceListsInfo* pRefLists; +} StdVideoEncodeH264PictureInfo; + +typedef struct StdVideoEncodeH264ReferenceInfo { + StdVideoEncodeH264ReferenceInfoFlags flags; + StdVideoH264PictureType primary_pic_type; + uint32_t FrameNum; + int32_t PicOrderCnt; + uint16_t long_term_pic_num; + uint16_t long_term_frame_idx; + uint8_t temporal_id; +} StdVideoEncodeH264ReferenceInfo; + +typedef struct StdVideoEncodeH264SliceHeader { + StdVideoEncodeH264SliceHeaderFlags flags; + uint32_t first_mb_in_slice; + StdVideoH264SliceType slice_type; + int8_t slice_alpha_c0_offset_div2; + int8_t slice_beta_offset_div2; + int8_t slice_qp_delta; + uint8_t reserved1; + StdVideoH264CabacInitIdc cabac_init_idc; + StdVideoH264DisableDeblockingFilterIdc disable_deblocking_filter_idc; + const StdVideoEncodeH264WeightTable* pWeightTable; +} StdVideoEncodeH264SliceHeader; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h265std.h b/src/video/khronos/vk_video/vulkan_video_codec_h265std.h new file mode 100644 index 0000000000000..d0a1bacbea378 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h265std.h @@ -0,0 +1,446 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_H_ +#define VULKAN_VIDEO_CODEC_H265STD_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h265std is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h265std 1 +#include "vulkan_video_codecs_common.h" +#define STD_VIDEO_H265_CPB_CNT_LIST_SIZE 32 +#define STD_VIDEO_H265_SUBLAYERS_LIST_SIZE 7 +#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS 16 +#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS 6 +#define STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS 2 +#define STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS 64 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE 6 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE 19 +#define STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE 21 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE 3 +#define STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE 128 +#define STD_VIDEO_H265_MAX_NUM_LIST_REF 15 +#define STD_VIDEO_H265_MAX_CHROMA_PLANES 2 +#define STD_VIDEO_H265_MAX_SHORT_TERM_REF_PIC_SETS 64 +#define STD_VIDEO_H265_MAX_DPB_SIZE 16 +#define STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS 32 +#define STD_VIDEO_H265_MAX_LONG_TERM_PICS 16 +#define STD_VIDEO_H265_MAX_DELTA_POC 48 +#define STD_VIDEO_H265_NO_REFERENCE_PICTURE 0xFF + +typedef enum StdVideoH265ChromaFormatIdc { + STD_VIDEO_H265_CHROMA_FORMAT_IDC_MONOCHROME = 0, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_420 = 1, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_422 = 2, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_444 = 3, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_CHROMA_FORMAT_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265ChromaFormatIdc; + +typedef enum StdVideoH265ProfileIdc { + STD_VIDEO_H265_PROFILE_IDC_MAIN = 1, + STD_VIDEO_H265_PROFILE_IDC_MAIN_10 = 2, + STD_VIDEO_H265_PROFILE_IDC_MAIN_STILL_PICTURE = 3, + STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS = 4, + STD_VIDEO_H265_PROFILE_IDC_SCC_EXTENSIONS = 9, + STD_VIDEO_H265_PROFILE_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_PROFILE_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265ProfileIdc; + +typedef enum StdVideoH265LevelIdc { + STD_VIDEO_H265_LEVEL_IDC_1_0 = 0, + STD_VIDEO_H265_LEVEL_IDC_2_0 = 1, + STD_VIDEO_H265_LEVEL_IDC_2_1 = 2, + STD_VIDEO_H265_LEVEL_IDC_3_0 = 3, + STD_VIDEO_H265_LEVEL_IDC_3_1 = 4, + STD_VIDEO_H265_LEVEL_IDC_4_0 = 5, + STD_VIDEO_H265_LEVEL_IDC_4_1 = 6, + STD_VIDEO_H265_LEVEL_IDC_5_0 = 7, + STD_VIDEO_H265_LEVEL_IDC_5_1 = 8, + STD_VIDEO_H265_LEVEL_IDC_5_2 = 9, + STD_VIDEO_H265_LEVEL_IDC_6_0 = 10, + STD_VIDEO_H265_LEVEL_IDC_6_1 = 11, + STD_VIDEO_H265_LEVEL_IDC_6_2 = 12, + STD_VIDEO_H265_LEVEL_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_LEVEL_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265LevelIdc; + +typedef enum StdVideoH265SliceType { + STD_VIDEO_H265_SLICE_TYPE_B = 0, + STD_VIDEO_H265_SLICE_TYPE_P = 1, + STD_VIDEO_H265_SLICE_TYPE_I = 2, + STD_VIDEO_H265_SLICE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_SLICE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265SliceType; + +typedef enum StdVideoH265PictureType { + STD_VIDEO_H265_PICTURE_TYPE_P = 0, + STD_VIDEO_H265_PICTURE_TYPE_B = 1, + STD_VIDEO_H265_PICTURE_TYPE_I = 2, + STD_VIDEO_H265_PICTURE_TYPE_IDR = 3, + STD_VIDEO_H265_PICTURE_TYPE_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_PICTURE_TYPE_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265PictureType; + +typedef enum StdVideoH265AspectRatioIdc { + STD_VIDEO_H265_ASPECT_RATIO_IDC_UNSPECIFIED = 0, + STD_VIDEO_H265_ASPECT_RATIO_IDC_SQUARE = 1, + STD_VIDEO_H265_ASPECT_RATIO_IDC_12_11 = 2, + STD_VIDEO_H265_ASPECT_RATIO_IDC_10_11 = 3, + STD_VIDEO_H265_ASPECT_RATIO_IDC_16_11 = 4, + STD_VIDEO_H265_ASPECT_RATIO_IDC_40_33 = 5, + STD_VIDEO_H265_ASPECT_RATIO_IDC_24_11 = 6, + STD_VIDEO_H265_ASPECT_RATIO_IDC_20_11 = 7, + STD_VIDEO_H265_ASPECT_RATIO_IDC_32_11 = 8, + STD_VIDEO_H265_ASPECT_RATIO_IDC_80_33 = 9, + STD_VIDEO_H265_ASPECT_RATIO_IDC_18_11 = 10, + STD_VIDEO_H265_ASPECT_RATIO_IDC_15_11 = 11, + STD_VIDEO_H265_ASPECT_RATIO_IDC_64_33 = 12, + STD_VIDEO_H265_ASPECT_RATIO_IDC_160_99 = 13, + STD_VIDEO_H265_ASPECT_RATIO_IDC_4_3 = 14, + STD_VIDEO_H265_ASPECT_RATIO_IDC_3_2 = 15, + STD_VIDEO_H265_ASPECT_RATIO_IDC_2_1 = 16, + STD_VIDEO_H265_ASPECT_RATIO_IDC_EXTENDED_SAR = 255, + STD_VIDEO_H265_ASPECT_RATIO_IDC_INVALID = 0x7FFFFFFF, + STD_VIDEO_H265_ASPECT_RATIO_IDC_MAX_ENUM = 0x7FFFFFFF +} StdVideoH265AspectRatioIdc; +typedef struct StdVideoH265DecPicBufMgr { + uint32_t max_latency_increase_plus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint8_t max_dec_pic_buffering_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint8_t max_num_reorder_pics[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; +} StdVideoH265DecPicBufMgr; + +typedef struct StdVideoH265SubLayerHrdParameters { + uint32_t bit_rate_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cpb_size_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t bit_rate_du_value_minus1[STD_VIDEO_H265_CPB_CNT_LIST_SIZE]; + uint32_t cbr_flag; +} StdVideoH265SubLayerHrdParameters; + +typedef struct StdVideoH265HrdFlags { + uint32_t nal_hrd_parameters_present_flag : 1; + uint32_t vcl_hrd_parameters_present_flag : 1; + uint32_t sub_pic_hrd_params_present_flag : 1; + uint32_t sub_pic_cpb_params_in_pic_timing_sei_flag : 1; + uint32_t fixed_pic_rate_general_flag : 8; + uint32_t fixed_pic_rate_within_cvs_flag : 8; + uint32_t low_delay_hrd_flag : 8; +} StdVideoH265HrdFlags; + +typedef struct StdVideoH265HrdParameters { + StdVideoH265HrdFlags flags; + uint8_t tick_divisor_minus2; + uint8_t du_cpb_removal_delay_increment_length_minus1; + uint8_t dpb_output_delay_du_length_minus1; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t cpb_size_du_scale; + uint8_t initial_cpb_removal_delay_length_minus1; + uint8_t au_cpb_removal_delay_length_minus1; + uint8_t dpb_output_delay_length_minus1; + uint8_t cpb_cnt_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint16_t elemental_duration_in_tc_minus1[STD_VIDEO_H265_SUBLAYERS_LIST_SIZE]; + uint16_t reserved[3]; + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersNal; + const StdVideoH265SubLayerHrdParameters* pSubLayerHrdParametersVcl; +} StdVideoH265HrdParameters; + +typedef struct StdVideoH265VpsFlags { + uint32_t vps_temporal_id_nesting_flag : 1; + uint32_t vps_sub_layer_ordering_info_present_flag : 1; + uint32_t vps_timing_info_present_flag : 1; + uint32_t vps_poc_proportional_to_timing_flag : 1; +} StdVideoH265VpsFlags; + +typedef struct StdVideoH265ProfileTierLevelFlags { + uint32_t general_tier_flag : 1; + uint32_t general_progressive_source_flag : 1; + uint32_t general_interlaced_source_flag : 1; + uint32_t general_non_packed_constraint_flag : 1; + uint32_t general_frame_only_constraint_flag : 1; +} StdVideoH265ProfileTierLevelFlags; + +typedef struct StdVideoH265ProfileTierLevel { + StdVideoH265ProfileTierLevelFlags flags; + StdVideoH265ProfileIdc general_profile_idc; + StdVideoH265LevelIdc general_level_idc; +} StdVideoH265ProfileTierLevel; + +typedef struct StdVideoH265VideoParameterSet { + StdVideoH265VpsFlags flags; + uint8_t vps_video_parameter_set_id; + uint8_t vps_max_sub_layers_minus1; + uint8_t reserved1; + uint8_t reserved2; + uint32_t vps_num_units_in_tick; + uint32_t vps_time_scale; + uint32_t vps_num_ticks_poc_diff_one_minus1; + uint32_t reserved3; + const StdVideoH265DecPicBufMgr* pDecPicBufMgr; + const StdVideoH265HrdParameters* pHrdParameters; + const StdVideoH265ProfileTierLevel* pProfileTierLevel; +} StdVideoH265VideoParameterSet; + +typedef struct StdVideoH265ScalingLists { + uint8_t ScalingList4x4[STD_VIDEO_H265_SCALING_LIST_4X4_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_4X4_NUM_ELEMENTS]; + uint8_t ScalingList8x8[STD_VIDEO_H265_SCALING_LIST_8X8_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_8X8_NUM_ELEMENTS]; + uint8_t ScalingList16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_16X16_NUM_ELEMENTS]; + uint8_t ScalingList32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS][STD_VIDEO_H265_SCALING_LIST_32X32_NUM_ELEMENTS]; + uint8_t ScalingListDCCoef16x16[STD_VIDEO_H265_SCALING_LIST_16X16_NUM_LISTS]; + uint8_t ScalingListDCCoef32x32[STD_VIDEO_H265_SCALING_LIST_32X32_NUM_LISTS]; +} StdVideoH265ScalingLists; + +typedef struct StdVideoH265SpsVuiFlags { + uint32_t aspect_ratio_info_present_flag : 1; + uint32_t overscan_info_present_flag : 1; + uint32_t overscan_appropriate_flag : 1; + uint32_t video_signal_type_present_flag : 1; + uint32_t video_full_range_flag : 1; + uint32_t colour_description_present_flag : 1; + uint32_t chroma_loc_info_present_flag : 1; + uint32_t neutral_chroma_indication_flag : 1; + uint32_t field_seq_flag : 1; + uint32_t frame_field_info_present_flag : 1; + uint32_t default_display_window_flag : 1; + uint32_t vui_timing_info_present_flag : 1; + uint32_t vui_poc_proportional_to_timing_flag : 1; + uint32_t vui_hrd_parameters_present_flag : 1; + uint32_t bitstream_restriction_flag : 1; + uint32_t tiles_fixed_structure_flag : 1; + uint32_t motion_vectors_over_pic_boundaries_flag : 1; + uint32_t restricted_ref_pic_lists_flag : 1; +} StdVideoH265SpsVuiFlags; + +typedef struct StdVideoH265SequenceParameterSetVui { + StdVideoH265SpsVuiFlags flags; + StdVideoH265AspectRatioIdc aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + uint8_t video_format; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coeffs; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + uint8_t reserved1; + uint8_t reserved2; + uint16_t def_disp_win_left_offset; + uint16_t def_disp_win_right_offset; + uint16_t def_disp_win_top_offset; + uint16_t def_disp_win_bottom_offset; + uint32_t vui_num_units_in_tick; + uint32_t vui_time_scale; + uint32_t vui_num_ticks_poc_diff_one_minus1; + uint16_t min_spatial_segmentation_idc; + uint16_t reserved3; + uint8_t max_bytes_per_pic_denom; + uint8_t max_bits_per_min_cu_denom; + uint8_t log2_max_mv_length_horizontal; + uint8_t log2_max_mv_length_vertical; + const StdVideoH265HrdParameters* pHrdParameters; +} StdVideoH265SequenceParameterSetVui; + +typedef struct StdVideoH265PredictorPaletteEntries { + uint16_t PredictorPaletteEntries[STD_VIDEO_H265_PREDICTOR_PALETTE_COMPONENTS_LIST_SIZE][STD_VIDEO_H265_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE]; +} StdVideoH265PredictorPaletteEntries; + +typedef struct StdVideoH265SpsFlags { + uint32_t sps_temporal_id_nesting_flag : 1; + uint32_t separate_colour_plane_flag : 1; + uint32_t conformance_window_flag : 1; + uint32_t sps_sub_layer_ordering_info_present_flag : 1; + uint32_t scaling_list_enabled_flag : 1; + uint32_t sps_scaling_list_data_present_flag : 1; + uint32_t amp_enabled_flag : 1; + uint32_t sample_adaptive_offset_enabled_flag : 1; + uint32_t pcm_enabled_flag : 1; + uint32_t pcm_loop_filter_disabled_flag : 1; + uint32_t long_term_ref_pics_present_flag : 1; + uint32_t sps_temporal_mvp_enabled_flag : 1; + uint32_t strong_intra_smoothing_enabled_flag : 1; + uint32_t vui_parameters_present_flag : 1; + uint32_t sps_extension_present_flag : 1; + uint32_t sps_range_extension_flag : 1; + uint32_t transform_skip_rotation_enabled_flag : 1; + uint32_t transform_skip_context_enabled_flag : 1; + uint32_t implicit_rdpcm_enabled_flag : 1; + uint32_t explicit_rdpcm_enabled_flag : 1; + uint32_t extended_precision_processing_flag : 1; + uint32_t intra_smoothing_disabled_flag : 1; + uint32_t high_precision_offsets_enabled_flag : 1; + uint32_t persistent_rice_adaptation_enabled_flag : 1; + uint32_t cabac_bypass_alignment_enabled_flag : 1; + uint32_t sps_scc_extension_flag : 1; + uint32_t sps_curr_pic_ref_enabled_flag : 1; + uint32_t palette_mode_enabled_flag : 1; + uint32_t sps_palette_predictor_initializers_present_flag : 1; + uint32_t intra_boundary_filtering_disabled_flag : 1; +} StdVideoH265SpsFlags; + +typedef struct StdVideoH265ShortTermRefPicSetFlags { + uint32_t inter_ref_pic_set_prediction_flag : 1; + uint32_t delta_rps_sign : 1; +} StdVideoH265ShortTermRefPicSetFlags; + +typedef struct StdVideoH265ShortTermRefPicSet { + StdVideoH265ShortTermRefPicSetFlags flags; + uint32_t delta_idx_minus1; + uint16_t use_delta_flag; + uint16_t abs_delta_rps_minus1; + uint16_t used_by_curr_pic_flag; + uint16_t used_by_curr_pic_s0_flag; + uint16_t used_by_curr_pic_s1_flag; + uint16_t reserved1; + uint8_t reserved2; + uint8_t reserved3; + uint8_t num_negative_pics; + uint8_t num_positive_pics; + uint16_t delta_poc_s0_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; + uint16_t delta_poc_s1_minus1[STD_VIDEO_H265_MAX_DPB_SIZE]; +} StdVideoH265ShortTermRefPicSet; + +typedef struct StdVideoH265LongTermRefPicsSps { + uint32_t used_by_curr_pic_lt_sps_flag; + uint32_t lt_ref_pic_poc_lsb_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; +} StdVideoH265LongTermRefPicsSps; + +typedef struct StdVideoH265SequenceParameterSet { + StdVideoH265SpsFlags flags; + StdVideoH265ChromaFormatIdc chroma_format_idc; + uint32_t pic_width_in_luma_samples; + uint32_t pic_height_in_luma_samples; + uint8_t sps_video_parameter_set_id; + uint8_t sps_max_sub_layers_minus1; + uint8_t sps_seq_parameter_set_id; + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + uint8_t log2_max_pic_order_cnt_lsb_minus4; + uint8_t log2_min_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_luma_coding_block_size; + uint8_t log2_min_luma_transform_block_size_minus2; + uint8_t log2_diff_max_min_luma_transform_block_size; + uint8_t max_transform_hierarchy_depth_inter; + uint8_t max_transform_hierarchy_depth_intra; + uint8_t num_short_term_ref_pic_sets; + uint8_t num_long_term_ref_pics_sps; + uint8_t pcm_sample_bit_depth_luma_minus1; + uint8_t pcm_sample_bit_depth_chroma_minus1; + uint8_t log2_min_pcm_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_pcm_luma_coding_block_size; + uint8_t reserved1; + uint8_t reserved2; + uint8_t palette_max_size; + uint8_t delta_palette_max_predictor_size; + uint8_t motion_vector_resolution_control_idc; + uint8_t sps_num_palette_predictor_initializers_minus1; + uint32_t conf_win_left_offset; + uint32_t conf_win_right_offset; + uint32_t conf_win_top_offset; + uint32_t conf_win_bottom_offset; + const StdVideoH265ProfileTierLevel* pProfileTierLevel; + const StdVideoH265DecPicBufMgr* pDecPicBufMgr; + const StdVideoH265ScalingLists* pScalingLists; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoH265LongTermRefPicsSps* pLongTermRefPicsSps; + const StdVideoH265SequenceParameterSetVui* pSequenceParameterSetVui; + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; +} StdVideoH265SequenceParameterSet; + +typedef struct StdVideoH265PpsFlags { + uint32_t dependent_slice_segments_enabled_flag : 1; + uint32_t output_flag_present_flag : 1; + uint32_t sign_data_hiding_enabled_flag : 1; + uint32_t cabac_init_present_flag : 1; + uint32_t constrained_intra_pred_flag : 1; + uint32_t transform_skip_enabled_flag : 1; + uint32_t cu_qp_delta_enabled_flag : 1; + uint32_t pps_slice_chroma_qp_offsets_present_flag : 1; + uint32_t weighted_pred_flag : 1; + uint32_t weighted_bipred_flag : 1; + uint32_t transquant_bypass_enabled_flag : 1; + uint32_t tiles_enabled_flag : 1; + uint32_t entropy_coding_sync_enabled_flag : 1; + uint32_t uniform_spacing_flag : 1; + uint32_t loop_filter_across_tiles_enabled_flag : 1; + uint32_t pps_loop_filter_across_slices_enabled_flag : 1; + uint32_t deblocking_filter_control_present_flag : 1; + uint32_t deblocking_filter_override_enabled_flag : 1; + uint32_t pps_deblocking_filter_disabled_flag : 1; + uint32_t pps_scaling_list_data_present_flag : 1; + uint32_t lists_modification_present_flag : 1; + uint32_t slice_segment_header_extension_present_flag : 1; + uint32_t pps_extension_present_flag : 1; + uint32_t cross_component_prediction_enabled_flag : 1; + uint32_t chroma_qp_offset_list_enabled_flag : 1; + uint32_t pps_curr_pic_ref_enabled_flag : 1; + uint32_t residual_adaptive_colour_transform_enabled_flag : 1; + uint32_t pps_slice_act_qp_offsets_present_flag : 1; + uint32_t pps_palette_predictor_initializers_present_flag : 1; + uint32_t monochrome_palette_flag : 1; + uint32_t pps_range_extension_flag : 1; +} StdVideoH265PpsFlags; + +typedef struct StdVideoH265PictureParameterSet { + StdVideoH265PpsFlags flags; + uint8_t pps_pic_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t sps_video_parameter_set_id; + uint8_t num_extra_slice_header_bits; + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + int8_t init_qp_minus26; + uint8_t diff_cu_qp_delta_depth; + int8_t pps_cb_qp_offset; + int8_t pps_cr_qp_offset; + int8_t pps_beta_offset_div2; + int8_t pps_tc_offset_div2; + uint8_t log2_parallel_merge_level_minus2; + uint8_t log2_max_transform_skip_block_size_minus2; + uint8_t diff_cu_chroma_qp_offset_depth; + uint8_t chroma_qp_offset_list_len_minus1; + int8_t cb_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; + int8_t cr_qp_offset_list[STD_VIDEO_H265_CHROMA_QP_OFFSET_LIST_SIZE]; + uint8_t log2_sao_offset_scale_luma; + uint8_t log2_sao_offset_scale_chroma; + int8_t pps_act_y_qp_offset_plus5; + int8_t pps_act_cb_qp_offset_plus5; + int8_t pps_act_cr_qp_offset_plus3; + uint8_t pps_num_palette_predictor_initializers; + uint8_t luma_bit_depth_entry_minus8; + uint8_t chroma_bit_depth_entry_minus8; + uint8_t num_tile_columns_minus1; + uint8_t num_tile_rows_minus1; + uint8_t reserved1; + uint8_t reserved2; + uint16_t column_width_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_COLS_LIST_SIZE]; + uint16_t row_height_minus1[STD_VIDEO_H265_CHROMA_QP_OFFSET_TILE_ROWS_LIST_SIZE]; + uint32_t reserved3; + const StdVideoH265ScalingLists* pScalingLists; + const StdVideoH265PredictorPaletteEntries* pPredictorPaletteEntries; +} StdVideoH265PictureParameterSet; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h265std_decode.h b/src/video/khronos/vk_video/vulkan_video_codec_h265std_decode.h new file mode 100644 index 0000000000000..0178793e5111a --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h265std_decode.h @@ -0,0 +1,67 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ +#define VULKAN_VIDEO_CODEC_H265STD_DECODE_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h265std_decode is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h265std_decode 1 +#include "vulkan_video_codec_h265std.h" + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_decode" +#define STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE 8 +typedef struct StdVideoDecodeH265PictureInfoFlags { + uint32_t IrapPicFlag : 1; + uint32_t IdrPicFlag : 1; + uint32_t IsReference : 1; + uint32_t short_term_ref_pic_set_sps_flag : 1; +} StdVideoDecodeH265PictureInfoFlags; + +typedef struct StdVideoDecodeH265PictureInfo { + StdVideoDecodeH265PictureInfoFlags flags; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + uint8_t NumDeltaPocsOfRefRpsIdx; + int32_t PicOrderCntVal; + uint16_t NumBitsForSTRefPicSetInSlice; + uint16_t reserved; + uint8_t RefPicSetStCurrBefore[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; + uint8_t RefPicSetStCurrAfter[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; + uint8_t RefPicSetLtCurr[STD_VIDEO_DECODE_H265_REF_PIC_SET_LIST_SIZE]; +} StdVideoDecodeH265PictureInfo; + +typedef struct StdVideoDecodeH265ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; + uint32_t unused_for_reference : 1; +} StdVideoDecodeH265ReferenceInfoFlags; + +typedef struct StdVideoDecodeH265ReferenceInfo { + StdVideoDecodeH265ReferenceInfoFlags flags; + int32_t PicOrderCntVal; +} StdVideoDecodeH265ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codec_h265std_encode.h b/src/video/khronos/vk_video/vulkan_video_codec_h265std_encode.h new file mode 100644 index 0000000000000..ee34491f4e9c0 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codec_h265std_encode.h @@ -0,0 +1,157 @@ +#ifndef VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ +#define VULKAN_VIDEO_CODEC_H265STD_ENCODE_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codec_h265std_encode is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codec_h265std_encode 1 +#include "vulkan_video_codec_h265std.h" + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0) + +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_API_VERSION_1_0_0 +#define VK_STD_VULKAN_VIDEO_CODEC_H265_ENCODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_h265_encode" +typedef struct StdVideoEncodeH265WeightTableFlags { + uint16_t luma_weight_l0_flag; + uint16_t chroma_weight_l0_flag; + uint16_t luma_weight_l1_flag; + uint16_t chroma_weight_l1_flag; +} StdVideoEncodeH265WeightTableFlags; + +typedef struct StdVideoEncodeH265WeightTable { + StdVideoEncodeH265WeightTableFlags flags; + uint8_t luma_log2_weight_denom; + int8_t delta_chroma_log2_weight_denom; + int8_t delta_luma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t luma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t delta_chroma_weight_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_chroma_offset_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_luma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t luma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + int8_t delta_chroma_weight_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; + int8_t delta_chroma_offset_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF][STD_VIDEO_H265_MAX_CHROMA_PLANES]; +} StdVideoEncodeH265WeightTable; + +typedef struct StdVideoEncodeH265SliceSegmentHeaderFlags { + uint32_t first_slice_segment_in_pic_flag : 1; + uint32_t dependent_slice_segment_flag : 1; + uint32_t slice_sao_luma_flag : 1; + uint32_t slice_sao_chroma_flag : 1; + uint32_t num_ref_idx_active_override_flag : 1; + uint32_t mvd_l1_zero_flag : 1; + uint32_t cabac_init_flag : 1; + uint32_t cu_chroma_qp_offset_enabled_flag : 1; + uint32_t deblocking_filter_override_flag : 1; + uint32_t slice_deblocking_filter_disabled_flag : 1; + uint32_t collocated_from_l0_flag : 1; + uint32_t slice_loop_filter_across_slices_enabled_flag : 1; + uint32_t reserved : 20; +} StdVideoEncodeH265SliceSegmentHeaderFlags; + +typedef struct StdVideoEncodeH265SliceSegmentHeader { + StdVideoEncodeH265SliceSegmentHeaderFlags flags; + StdVideoH265SliceType slice_type; + uint32_t slice_segment_address; + uint8_t collocated_ref_idx; + uint8_t MaxNumMergeCand; + int8_t slice_cb_qp_offset; + int8_t slice_cr_qp_offset; + int8_t slice_beta_offset_div2; + int8_t slice_tc_offset_div2; + int8_t slice_act_y_qp_offset; + int8_t slice_act_cb_qp_offset; + int8_t slice_act_cr_qp_offset; + int8_t slice_qp_delta; + uint16_t reserved1; + const StdVideoEncodeH265WeightTable* pWeightTable; +} StdVideoEncodeH265SliceSegmentHeader; + +typedef struct StdVideoEncodeH265ReferenceListsInfoFlags { + uint32_t ref_pic_list_modification_flag_l0 : 1; + uint32_t ref_pic_list_modification_flag_l1 : 1; + uint32_t reserved : 30; +} StdVideoEncodeH265ReferenceListsInfoFlags; + +typedef struct StdVideoEncodeH265ReferenceListsInfo { + StdVideoEncodeH265ReferenceListsInfoFlags flags; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + uint8_t RefPicList0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t RefPicList1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t list_entry_l0[STD_VIDEO_H265_MAX_NUM_LIST_REF]; + uint8_t list_entry_l1[STD_VIDEO_H265_MAX_NUM_LIST_REF]; +} StdVideoEncodeH265ReferenceListsInfo; + +typedef struct StdVideoEncodeH265PictureInfoFlags { + uint32_t is_reference : 1; + uint32_t IrapPicFlag : 1; + uint32_t used_for_long_term_reference : 1; + uint32_t discardable_flag : 1; + uint32_t cross_layer_bla_flag : 1; + uint32_t pic_output_flag : 1; + uint32_t no_output_of_prior_pics_flag : 1; + uint32_t short_term_ref_pic_set_sps_flag : 1; + uint32_t slice_temporal_mvp_enabled_flag : 1; + uint32_t reserved : 23; +} StdVideoEncodeH265PictureInfoFlags; + +typedef struct StdVideoEncodeH265LongTermRefPics { + uint8_t num_long_term_sps; + uint8_t num_long_term_pics; + uint8_t lt_idx_sps[STD_VIDEO_H265_MAX_LONG_TERM_REF_PICS_SPS]; + uint8_t poc_lsb_lt[STD_VIDEO_H265_MAX_LONG_TERM_PICS]; + uint16_t used_by_curr_pic_lt_flag; + uint8_t delta_poc_msb_present_flag[STD_VIDEO_H265_MAX_DELTA_POC]; + uint8_t delta_poc_msb_cycle_lt[STD_VIDEO_H265_MAX_DELTA_POC]; +} StdVideoEncodeH265LongTermRefPics; + +typedef struct StdVideoEncodeH265PictureInfo { + StdVideoEncodeH265PictureInfoFlags flags; + StdVideoH265PictureType pic_type; + uint8_t sps_video_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_pic_parameter_set_id; + uint8_t short_term_ref_pic_set_idx; + int32_t PicOrderCntVal; + uint8_t TemporalId; + uint8_t reserved1[7]; + const StdVideoEncodeH265ReferenceListsInfo* pRefLists; + const StdVideoH265ShortTermRefPicSet* pShortTermRefPicSet; + const StdVideoEncodeH265LongTermRefPics* pLongTermRefPics; +} StdVideoEncodeH265PictureInfo; + +typedef struct StdVideoEncodeH265ReferenceInfoFlags { + uint32_t used_for_long_term_reference : 1; + uint32_t unused_for_reference : 1; + uint32_t reserved : 30; +} StdVideoEncodeH265ReferenceInfoFlags; + +typedef struct StdVideoEncodeH265ReferenceInfo { + StdVideoEncodeH265ReferenceInfoFlags flags; + StdVideoH265PictureType pic_type; + int32_t PicOrderCntVal; + uint8_t TemporalId; +} StdVideoEncodeH265ReferenceInfo; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vk_video/vulkan_video_codecs_common.h b/src/video/khronos/vk_video/vulkan_video_codecs_common.h new file mode 100644 index 0000000000000..5e6ef1db48ee5 --- /dev/null +++ b/src/video/khronos/vk_video/vulkan_video_codecs_common.h @@ -0,0 +1,36 @@ +#ifndef VULKAN_VIDEO_CODECS_COMMON_H_ +#define VULKAN_VIDEO_CODECS_COMMON_H_ 1 + +/* +** Copyright 2015-2024 The Khronos Group Inc. +** +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* +** This header is generated from the Khronos Vulkan XML API Registry. +** +*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// vulkan_video_codecs_common is a preprocessor guard. Do not pass it to API calls. +#define vulkan_video_codecs_common 1 +#if !defined(VK_NO_STDINT_H) + #include +#endif + +#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/video/khronos/vulkan/vk_icd.h b/src/video/khronos/vulkan/vk_icd.h index 41989ee35474b..59204a3419f53 100644 --- a/src/video/khronos/vulkan/vk_icd.h +++ b/src/video/khronos/vulkan/vk_icd.h @@ -1,27 +1,11 @@ -// -// File: vk_icd.h -// /* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2015-2023 The Khronos Group Inc. + * Copyright 2015-2023 Valve Corporation + * Copyright 2015-2023 LunarG, Inc. * + * SPDX-License-Identifier: Apache-2.0 */ - -#ifndef VKICD_H -#define VKICD_H +#pragma once #include "vulkan.h" #include @@ -42,7 +26,17 @@ // call for any API version > 1.0. Otherwise, the loader will // manually determine if it can support the expected version. // Version 6 - Add support for vk_icdEnumerateAdapterPhysicalDevices. -#define CURRENT_LOADER_ICD_INTERFACE_VERSION 6 +// Version 7 - If an ICD supports any of the following functions, they must be +// queryable with vk_icdGetInstanceProcAddr: +// vk_icdNegotiateLoaderICDInterfaceVersion +// vk_icdGetPhysicalDeviceProcAddr +// vk_icdEnumerateAdapterPhysicalDevices (Windows only) +// In addition, these functions no longer need to be exported directly. +// This version allows drivers provided through the extension +// VK_LUNARG_direct_driver_loading be able to support the entire +// Driver-Loader interface. + +#define CURRENT_LOADER_ICD_INTERFACE_VERSION 7 #define MIN_SUPPORTED_LOADER_ICD_INTERFACE_VERSION 0 #define MIN_PHYS_DEV_EXTENSION_ICD_INTERFACE_VERSION 4 @@ -70,7 +64,7 @@ extern "C" { #endif VKAPI_ATTR VkResult VKAPI_CALL vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t* pVersion); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName); - VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance isntance, const char* pName); + VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_icdGetPhysicalDeviceProcAddr(VkInstance instance, const char* pName); #if defined(VK_USE_PLATFORM_WIN32_KHR) VKAPI_ATTR VkResult VKAPI_CALL vk_icdEnumerateAdapterPhysicalDevices(VkInstance instance, LUID adapterLUID, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); @@ -123,6 +117,7 @@ typedef enum { VK_ICD_WSI_PLATFORM_VI, VK_ICD_WSI_PLATFORM_GGP, VK_ICD_WSI_PLATFORM_SCREEN, + VK_ICD_WSI_PLATFORM_FUCHSIA, } VkIcdWsiPlatform; typedef struct { @@ -242,4 +237,8 @@ typedef struct { } VkIcdSurfaceScreen; #endif // VK_USE_PLATFORM_SCREEN_QNX -#endif // VKICD_H +#ifdef VK_USE_PLATFORM_FUCHSIA +typedef struct { + VkIcdSurfaceBase base; +} VkIcdSurfaceImagePipe; +#endif // VK_USE_PLATFORM_FUCHSIA diff --git a/src/video/khronos/vulkan/vk_layer.h b/src/video/khronos/vulkan/vk_layer.h index 0651870c70a4d..19d88fce4bac2 100644 --- a/src/video/khronos/vulkan/vk_layer.h +++ b/src/video/khronos/vulkan/vk_layer.h @@ -1,39 +1,18 @@ -// -// File: vk_layer.h -// /* - * Copyright (c) 2015-2017 The Khronos Group Inc. - * Copyright (c) 2015-2017 Valve Corporation - * Copyright (c) 2015-2017 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2015-2023 The Khronos Group Inc. + * Copyright 2015-2023 Valve Corporation + * Copyright 2015-2023 LunarG, Inc. * + * SPDX-License-Identifier: Apache-2.0 */ +#pragma once /* Need to define dispatch table * Core struct can then have ptr to dispatch table at the top * Along with object ptrs for current and next OBJ */ -#pragma once -#include "vulkan.h" -#if defined(__GNUC__) && __GNUC__ >= 4 -#define VK_LAYER_EXPORT __attribute__((visibility("default"))) -#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) -#define VK_LAYER_EXPORT __attribute__((visibility("default"))) -#else -#define VK_LAYER_EXPORT -#endif +#include "vulkan_core.h" #define MAX_NUM_UNKNOWN_EXTS 250 diff --git a/src/video/khronos/vulkan/vk_platform.h b/src/video/khronos/vulkan/vk_platform.h index 3ff8c5d146715..0ecd4f6471996 100644 --- a/src/video/khronos/vulkan/vk_platform.h +++ b/src/video/khronos/vulkan/vk_platform.h @@ -2,7 +2,7 @@ // File: vk_platform.h // /* -** Copyright 2014-2022 The Khronos Group Inc. +** Copyright 2014-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ diff --git a/src/video/khronos/vulkan/vulkan.h b/src/video/khronos/vulkan/vulkan.h index 004fa70952a42..ef94006bb319d 100644 --- a/src/video/khronos/vulkan/vulkan.h +++ b/src/video/khronos/vulkan/vulkan.h @@ -2,7 +2,7 @@ #define VULKAN_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -38,7 +38,6 @@ #ifdef VK_USE_PLATFORM_WAYLAND_KHR -#include #include "vulkan_wayland.h" #endif @@ -85,6 +84,14 @@ #include "vulkan_screen.h" #endif + +#ifdef VK_USE_PLATFORM_SCI +#include +#include +#include "vulkan_sci.h" +#endif + + #ifdef VK_ENABLE_BETA_EXTENSIONS #include "vulkan_beta.h" #endif diff --git a/src/video/khronos/vulkan/vulkan.hpp b/src/video/khronos/vulkan/vulkan.hpp deleted file mode 100644 index eac9ff0b6cfd4..0000000000000 --- a/src/video/khronos/vulkan/vulkan.hpp +++ /dev/null @@ -1,14537 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_HPP -#define VULKAN_HPP - -#if defined( _MSVC_LANG ) -# define VULKAN_HPP_CPLUSPLUS _MSVC_LANG -#else -# define VULKAN_HPP_CPLUSPLUS __cplusplus -#endif - -#if 201703L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 20 -#elif 201402L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 17 -#elif 201103L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 14 -#elif 199711L < VULKAN_HPP_CPLUSPLUS -# define VULKAN_HPP_CPP_VERSION 11 -#else -# error "vulkan.hpp needs at least c++ standard version 11" -#endif - -#include // ArrayWrapperND -#include // std::string -#include -#if 17 <= VULKAN_HPP_CPP_VERSION -# include // std::string_view -#endif - -#if defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) -# if !defined( VULKAN_HPP_NO_SMART_HANDLE ) -# define VULKAN_HPP_NO_SMART_HANDLE -# endif -#else -# include // std::tie -# include // std::vector -#endif - -#if !defined( VULKAN_HPP_NO_EXCEPTIONS ) -# include // std::is_error_code_enum -#endif - -#if !defined( VULKAN_HPP_NO_SMART_HANDLE ) -# include // std::transform -#endif - -#if defined( VULKAN_HPP_NO_CONSTRUCTORS ) -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) -# define VULKAN_HPP_NO_STRUCT_CONSTRUCTORS -# endif -# if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) -# define VULKAN_HPP_NO_UNION_CONSTRUCTORS -# endif -#endif - -#if defined( VULKAN_HPP_NO_SETTERS ) -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) -# define VULKAN_HPP_NO_STRUCT_SETTERS -# endif -# if !defined( VULKAN_HPP_NO_UNION_SETTERS ) -# define VULKAN_HPP_NO_UNION_SETTERS -# endif -#endif - -#if !defined( VULKAN_HPP_ASSERT ) -# include -# define VULKAN_HPP_ASSERT assert -#endif - -#if !defined( VULKAN_HPP_ASSERT_ON_RESULT ) -# define VULKAN_HPP_ASSERT_ON_RESULT VULKAN_HPP_ASSERT -#endif - -#if !defined( VULKAN_HPP_STATIC_ASSERT ) -# define VULKAN_HPP_STATIC_ASSERT static_assert -#endif - -#if !defined( VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL ) -# define VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL 1 -#endif - -#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) -# include -# elif defined( _WIN32 ) -typedef struct HINSTANCE__ * HINSTANCE; -# if defined( _WIN64 ) -typedef int64_t( __stdcall * FARPROC )(); -# else -typedef int( __stdcall * FARPROC )(); -# endif -extern "C" __declspec( dllimport ) HINSTANCE __stdcall LoadLibraryA( char const * lpLibFileName ); -extern "C" __declspec( dllimport ) int __stdcall FreeLibrary( HINSTANCE hLibModule ); -extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE hModule, const char * lpProcName ); -# endif -#endif - -#if !defined( __has_include ) -# define __has_include( x ) false -#endif - -#if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR ) -# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR -#endif -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) -# include -#endif - -#if ( 201803 <= __cpp_lib_span ) -# define VULKAN_HPP_SUPPORT_SPAN -# include -#endif - -static_assert( VK_HEADER_VERSION == 227, "Wrong VK_HEADER_VERSION!" ); - -// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default. -// To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION -#if ( VK_USE_64_BIT_PTR_DEFINES == 1 ) -# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION ) -# define VULKAN_HPP_TYPESAFE_CONVERSION -# endif -#endif - -// includes through some other header -// this results in major(x) being resolved to gnu_dev_major(x) -// which is an expression in a constructor initializer list. -#if defined( major ) -# undef major -#endif -#if defined( minor ) -# undef minor -#endif - -// Windows defines MemoryBarrier which is deprecated and collides -// with the VULKAN_HPP_NAMESPACE::MemoryBarrier struct. -#if defined( MemoryBarrier ) -# undef MemoryBarrier -#endif - -#if !defined( VULKAN_HPP_HAS_UNRESTRICTED_UNIONS ) -# if defined( __clang__ ) -# if __has_feature( cxx_unrestricted_unions ) -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# elif defined( __GNUC__ ) -# define GCC_VERSION ( __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ ) -# if 40600 <= GCC_VERSION -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# elif defined( _MSC_VER ) -# if 1900 <= _MSC_VER -# define VULKAN_HPP_HAS_UNRESTRICTED_UNIONS -# endif -# endif -#endif - -#if !defined( VULKAN_HPP_INLINE ) -# if defined( __clang__ ) -# if __has_attribute( always_inline ) -# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ -# else -# define VULKAN_HPP_INLINE inline -# endif -# elif defined( __GNUC__ ) -# define VULKAN_HPP_INLINE __attribute__( ( always_inline ) ) __inline__ -# elif defined( _MSC_VER ) -# define VULKAN_HPP_INLINE inline -# else -# define VULKAN_HPP_INLINE inline -# endif -#endif - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) -# define VULKAN_HPP_TYPESAFE_EXPLICIT -#else -# define VULKAN_HPP_TYPESAFE_EXPLICIT explicit -#endif - -#if defined( __cpp_constexpr ) -# define VULKAN_HPP_CONSTEXPR constexpr -# if __cpp_constexpr >= 201304 -# define VULKAN_HPP_CONSTEXPR_14 constexpr -# else -# define VULKAN_HPP_CONSTEXPR_14 -# endif -# define VULKAN_HPP_CONST_OR_CONSTEXPR constexpr -#else -# define VULKAN_HPP_CONSTEXPR -# define VULKAN_HPP_CONSTEXPR_14 -# define VULKAN_HPP_CONST_OR_CONSTEXPR const -#endif - -#if !defined( VULKAN_HPP_NOEXCEPT ) -# if defined( _MSC_VER ) && ( _MSC_VER <= 1800 ) -# define VULKAN_HPP_NOEXCEPT -# else -# define VULKAN_HPP_NOEXCEPT noexcept -# define VULKAN_HPP_HAS_NOEXCEPT 1 -# if defined( VULKAN_HPP_NO_EXCEPTIONS ) -# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS noexcept -# else -# define VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS -# endif -# endif -#endif - -#if 14 <= VULKAN_HPP_CPP_VERSION -# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]] -#else -# define VULKAN_HPP_DEPRECATED( msg ) -#endif - -#if ( 17 <= VULKAN_HPP_CPP_VERSION ) && !defined( VULKAN_HPP_NO_NODISCARD_WARNINGS ) -# define VULKAN_HPP_NODISCARD [[nodiscard]] -# if defined( VULKAN_HPP_NO_EXCEPTIONS ) -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS [[nodiscard]] -# else -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS -# endif -#else -# define VULKAN_HPP_NODISCARD -# define VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS -#endif - -#if !defined( VULKAN_HPP_NAMESPACE ) -# define VULKAN_HPP_NAMESPACE vk -#endif - -#define VULKAN_HPP_STRINGIFY2( text ) #text -#define VULKAN_HPP_STRINGIFY( text ) VULKAN_HPP_STRINGIFY2( text ) -#define VULKAN_HPP_NAMESPACE_STRING VULKAN_HPP_STRINGIFY( VULKAN_HPP_NAMESPACE ) - -namespace VULKAN_HPP_NAMESPACE -{ - template - class ArrayWrapper1D : public std::array - { - public: - VULKAN_HPP_CONSTEXPR ArrayWrapper1D() VULKAN_HPP_NOEXCEPT : std::array() {} - - VULKAN_HPP_CONSTEXPR ArrayWrapper1D( std::array const & data ) VULKAN_HPP_NOEXCEPT : std::array( data ) {} - -#if ( VK_USE_64_BIT_PTR_DEFINES == 0 ) - // on 32 bit compiles, needs overloads on index type int to resolve ambiguities - VULKAN_HPP_CONSTEXPR T const & operator[]( int index ) const VULKAN_HPP_NOEXCEPT - { - return std::array::operator[]( index ); - } - - T & operator[]( int index ) VULKAN_HPP_NOEXCEPT - { - return std::array::operator[]( index ); - } -#endif - - operator T const *() const VULKAN_HPP_NOEXCEPT - { - return this->data(); - } - - operator T *() VULKAN_HPP_NOEXCEPT - { - return this->data(); - } - - template ::value, int>::type = 0> - operator std::string() const - { - return std::string( this->data() ); - } - -#if 17 <= VULKAN_HPP_CPP_VERSION - template ::value, int>::type = 0> - operator std::string_view() const - { - return std::string_view( this->data() ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - template ::value, int>::type = 0> - std::strong_ordering operator<=>( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) <=> *static_cast const *>( &rhs ); - } -#else - template ::value, int>::type = 0> - bool operator<( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) < *static_cast const *>( &rhs ); - } - - template ::value, int>::type = 0> - bool operator<=( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) <= *static_cast const *>( &rhs ); - } - - template ::value, int>::type = 0> - bool operator>( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) > *static_cast const *>( &rhs ); - } - - template ::value, int>::type = 0> - bool operator>=( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) >= *static_cast const *>( &rhs ); - } -#endif - - template ::value, int>::type = 0> - bool operator==( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) == *static_cast const *>( &rhs ); - } - - template ::value, int>::type = 0> - bool operator!=( ArrayWrapper1D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return *static_cast const *>( this ) != *static_cast const *>( &rhs ); - } - }; - - // specialization of relational operators between std::string and arrays of chars - template - bool operator<( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs < rhs.data(); - } - - template - bool operator<=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs <= rhs.data(); - } - - template - bool operator>( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs > rhs.data(); - } - - template - bool operator>=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs >= rhs.data(); - } - - template - bool operator==( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs == rhs.data(); - } - - template - bool operator!=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT - { - return lhs != rhs.data(); - } - - template - class ArrayWrapper2D : public std::array, N> - { - public: - VULKAN_HPP_CONSTEXPR ArrayWrapper2D() VULKAN_HPP_NOEXCEPT : std::array, N>() {} - - VULKAN_HPP_CONSTEXPR ArrayWrapper2D( std::array, N> const & data ) VULKAN_HPP_NOEXCEPT - : std::array, N>( *reinterpret_cast, N> const *>( &data ) ) - { - } - }; - - template - struct FlagTraits - { - }; - - template - class Flags - { - public: - using MaskType = typename std::underlying_type::type; - - // constructors - VULKAN_HPP_CONSTEXPR Flags() VULKAN_HPP_NOEXCEPT : m_mask( 0 ) {} - - VULKAN_HPP_CONSTEXPR Flags( BitType bit ) VULKAN_HPP_NOEXCEPT : m_mask( static_cast( bit ) ) {} - - VULKAN_HPP_CONSTEXPR Flags( Flags const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VULKAN_HPP_CONSTEXPR explicit Flags( MaskType flags ) VULKAN_HPP_NOEXCEPT : m_mask( flags ) {} - - // relational operators -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Flags const & ) const = default; -#else - VULKAN_HPP_CONSTEXPR bool operator<( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask < rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator<=( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask <= rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator>( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask > rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator>=( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask >= rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator==( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask == rhs.m_mask; - } - - VULKAN_HPP_CONSTEXPR bool operator!=( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_mask != rhs.m_mask; - } -#endif - - // logical operator - VULKAN_HPP_CONSTEXPR bool operator!() const VULKAN_HPP_NOEXCEPT - { - return !m_mask; - } - - // bitwise operators - VULKAN_HPP_CONSTEXPR Flags operator&( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags( m_mask & rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags operator|( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags( m_mask | rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags operator^( Flags const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return Flags( m_mask ^ rhs.m_mask ); - } - - VULKAN_HPP_CONSTEXPR Flags operator~() const VULKAN_HPP_NOEXCEPT - { - return Flags( m_mask ^ FlagTraits::allFlags ); - } - - // assignment operators - VULKAN_HPP_CONSTEXPR_14 Flags & operator=( Flags const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VULKAN_HPP_CONSTEXPR_14 Flags & operator|=( Flags const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask |= rhs.m_mask; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Flags & operator&=( Flags const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask &= rhs.m_mask; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Flags & operator^=( Flags const & rhs ) VULKAN_HPP_NOEXCEPT - { - m_mask ^= rhs.m_mask; - return *this; - } - - // cast operators - explicit VULKAN_HPP_CONSTEXPR operator bool() const VULKAN_HPP_NOEXCEPT - { - return !!m_mask; - } - - explicit VULKAN_HPP_CONSTEXPR operator MaskType() const VULKAN_HPP_NOEXCEPT - { - return m_mask; - } - -#if defined( VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC ) - public: -#else - private: -#endif - MaskType m_mask; - }; - -#if !defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - // relational operators only needed for pre C++20 - template - VULKAN_HPP_CONSTEXPR bool operator<( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator>( bit ); - } - - template - VULKAN_HPP_CONSTEXPR bool operator<=( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator>=( bit ); - } - - template - VULKAN_HPP_CONSTEXPR bool operator>( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator<( bit ); - } - - template - VULKAN_HPP_CONSTEXPR bool operator>=( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator<=( bit ); - } - - template - VULKAN_HPP_CONSTEXPR bool operator==( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator==( bit ); - } - - template - VULKAN_HPP_CONSTEXPR bool operator!=( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator!=( bit ); - } -#endif - - // bitwise operators - template - VULKAN_HPP_CONSTEXPR Flags operator&( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator&( bit ); - } - - template - VULKAN_HPP_CONSTEXPR Flags operator|( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator|( bit ); - } - - template - VULKAN_HPP_CONSTEXPR Flags operator^( BitType bit, Flags const & flags ) VULKAN_HPP_NOEXCEPT - { - return flags.operator^( bit ); - } - -#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - class ArrayProxy - { - public: - VULKAN_HPP_CONSTEXPR ArrayProxy() VULKAN_HPP_NOEXCEPT - : m_count( 0 ) - , m_ptr( nullptr ) - { - } - - VULKAN_HPP_CONSTEXPR ArrayProxy( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - : m_count( 0 ) - , m_ptr( nullptr ) - { - } - - ArrayProxy( T & value ) VULKAN_HPP_NOEXCEPT - : m_count( 1 ) - , m_ptr( &value ) - { - } - - template ::value, int>::type = 0> - ArrayProxy( typename std::remove_const::type & value ) VULKAN_HPP_NOEXCEPT - : m_count( 1 ) - , m_ptr( &value ) - { - } - - ArrayProxy( uint32_t count, T * ptr ) VULKAN_HPP_NOEXCEPT - : m_count( count ) - , m_ptr( ptr ) - { - } - - template ::value, int>::type = 0> - ArrayProxy( uint32_t count, typename std::remove_const::type * ptr ) VULKAN_HPP_NOEXCEPT - : m_count( count ) - , m_ptr( ptr ) - { - } - - template - ArrayProxy( T ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT - : m_count( C ) - , m_ptr( ptr ) - { - } - - template ::value, int>::type = 0> - ArrayProxy( typename std::remove_const::type ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT - : m_count( C ) - , m_ptr( ptr ) - { - } - -# if __GNUC__ >= 9 -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Winit-list-lifetime" -# endif - - ArrayProxy( std::initializer_list const & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - template ::value, int>::type = 0> - ArrayProxy( std::initializer_list::type> const & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - ArrayProxy( std::initializer_list & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - template ::value, int>::type = 0> - ArrayProxy( std::initializer_list::type> & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - -# if __GNUC__ >= 9 -# pragma GCC diagnostic pop -# endif - - // Any type with a .data() return type implicitly convertible to T*, and a .size() return type implicitly - // convertible to size_t. The const version can capture temporaries, with lifetime ending at end of statement. - template ().data() ), T *>::value && - std::is_convertible().size() ), std::size_t>::value>::type * = nullptr> - ArrayProxy( V const & v ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( v.size() ) ) - , m_ptr( v.data() ) - { - } - - template ().data() ), T *>::value && - std::is_convertible().size() ), std::size_t>::value>::type * = nullptr> - ArrayProxy( V & v ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( v.size() ) ) - , m_ptr( v.data() ) - { - } - - const T * begin() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - - const T * end() const VULKAN_HPP_NOEXCEPT - { - return m_ptr + m_count; - } - - const T & front() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_count && m_ptr ); - return *m_ptr; - } - - const T & back() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_count && m_ptr ); - return *( m_ptr + m_count - 1 ); - } - - bool empty() const VULKAN_HPP_NOEXCEPT - { - return ( m_count == 0 ); - } - - uint32_t size() const VULKAN_HPP_NOEXCEPT - { - return m_count; - } - - T * data() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - - private: - uint32_t m_count; - T * m_ptr; - }; - - template - class ArrayProxyNoTemporaries - { - public: - VULKAN_HPP_CONSTEXPR ArrayProxyNoTemporaries() VULKAN_HPP_NOEXCEPT - : m_count( 0 ) - , m_ptr( nullptr ) - { - } - - VULKAN_HPP_CONSTEXPR ArrayProxyNoTemporaries( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - : m_count( 0 ) - , m_ptr( nullptr ) - { - } - - ArrayProxyNoTemporaries( T & value ) VULKAN_HPP_NOEXCEPT - : m_count( 1 ) - , m_ptr( &value ) - { - } - - template - ArrayProxyNoTemporaries( V && value ) = delete; - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( typename std::remove_const::type & value ) VULKAN_HPP_NOEXCEPT - : m_count( 1 ) - , m_ptr( &value ) - { - } - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( typename std::remove_const::type && value ) = delete; - - ArrayProxyNoTemporaries( uint32_t count, T * ptr ) VULKAN_HPP_NOEXCEPT - : m_count( count ) - , m_ptr( ptr ) - { - } - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( uint32_t count, typename std::remove_const::type * ptr ) VULKAN_HPP_NOEXCEPT - : m_count( count ) - , m_ptr( ptr ) - { - } - - template - ArrayProxyNoTemporaries( T ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT - : m_count( C ) - , m_ptr( ptr ) - { - } - - template - ArrayProxyNoTemporaries( T( &&ptr )[C] ) = delete; - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( typename std::remove_const::type ( &ptr )[C] ) VULKAN_HPP_NOEXCEPT - : m_count( C ) - , m_ptr( ptr ) - { - } - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( typename std::remove_const::type( &&ptr )[C] ) = delete; - - ArrayProxyNoTemporaries( std::initializer_list const & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - ArrayProxyNoTemporaries( std::initializer_list const && list ) = delete; - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( std::initializer_list::type> const & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( std::initializer_list::type> const && list ) = delete; - - ArrayProxyNoTemporaries( std::initializer_list & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - ArrayProxyNoTemporaries( std::initializer_list && list ) = delete; - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( std::initializer_list::type> & list ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( list.size() ) ) - , m_ptr( list.begin() ) - { - } - - template ::value, int>::type = 0> - ArrayProxyNoTemporaries( std::initializer_list::type> && list ) = delete; - - // Any type with a .data() return type implicitly convertible to T*, and a // .size() return type implicitly - // convertible to size_t. - template ().data() ), T *>::value && - std::is_convertible().size() ), std::size_t>::value>::type * = nullptr> - ArrayProxyNoTemporaries( V & v ) VULKAN_HPP_NOEXCEPT - : m_count( static_cast( v.size() ) ) - , m_ptr( v.data() ) - { - } - - const T * begin() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - - const T * end() const VULKAN_HPP_NOEXCEPT - { - return m_ptr + m_count; - } - - const T & front() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_count && m_ptr ); - return *m_ptr; - } - - const T & back() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_count && m_ptr ); - return *( m_ptr + m_count - 1 ); - } - - bool empty() const VULKAN_HPP_NOEXCEPT - { - return ( m_count == 0 ); - } - - uint32_t size() const VULKAN_HPP_NOEXCEPT - { - return m_count; - } - - T * data() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - - private: - uint32_t m_count; - T * m_ptr; - }; - - template - class Optional - { - public: - Optional( RefType & reference ) VULKAN_HPP_NOEXCEPT - { - m_ptr = &reference; - } - Optional( RefType * ptr ) VULKAN_HPP_NOEXCEPT - { - m_ptr = ptr; - } - Optional( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_ptr = nullptr; - } - - operator RefType *() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - RefType const * operator->() const VULKAN_HPP_NOEXCEPT - { - return m_ptr; - } - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return !!m_ptr; - } - - private: - RefType * m_ptr; - }; - - template - struct StructExtends - { - enum - { - value = false - }; - }; - - template - struct IsPartOfStructureChain - { - static const bool valid = false; - }; - - template - struct IsPartOfStructureChain - { - static const bool valid = std::is_same::value || IsPartOfStructureChain::valid; - }; - - template - struct StructureChainContains - { - static const bool value = std::is_same>::type>::value || - StructureChainContains::value; - }; - - template - struct StructureChainContains<0, T, ChainElements...> - { - static const bool value = std::is_same>::type>::value; - }; - - template - struct StructureChainValidation - { - using TestType = typename std::tuple_element>::type; - static const bool valid = StructExtends>::type>::value && - ( TestType::allowDuplicate || !StructureChainContains::value ) && - StructureChainValidation::valid; - }; - - template - struct StructureChainValidation<0, ChainElements...> - { - static const bool valid = true; - }; - - template - class StructureChain : public std::tuple - { - public: - StructureChain() VULKAN_HPP_NOEXCEPT - { - static_assert( StructureChainValidation::valid, "The structure chain is not valid!" ); - link(); - } - - StructureChain( StructureChain const & rhs ) VULKAN_HPP_NOEXCEPT : std::tuple( rhs ) - { - static_assert( StructureChainValidation::valid, "The structure chain is not valid!" ); - link( &std::get<0>( *this ), - &std::get<0>( rhs ), - reinterpret_cast( &std::get<0>( *this ) ), - reinterpret_cast( &std::get<0>( rhs ) ) ); - } - - StructureChain( StructureChain && rhs ) VULKAN_HPP_NOEXCEPT : std::tuple( std::forward>( rhs ) ) - { - static_assert( StructureChainValidation::valid, "The structure chain is not valid!" ); - link( &std::get<0>( *this ), - &std::get<0>( rhs ), - reinterpret_cast( &std::get<0>( *this ) ), - reinterpret_cast( &std::get<0>( rhs ) ) ); - } - - StructureChain( ChainElements const &... elems ) VULKAN_HPP_NOEXCEPT : std::tuple( elems... ) - { - static_assert( StructureChainValidation::valid, "The structure chain is not valid!" ); - link(); - } - - StructureChain & operator=( StructureChain const & rhs ) VULKAN_HPP_NOEXCEPT - { - std::tuple::operator=( rhs ); - link( &std::get<0>( *this ), - &std::get<0>( rhs ), - reinterpret_cast( &std::get<0>( *this ) ), - reinterpret_cast( &std::get<0>( rhs ) ) ); - return *this; - } - - StructureChain & operator=( StructureChain && rhs ) = delete; - - template >::type, size_t Which = 0> - T & get() VULKAN_HPP_NOEXCEPT - { - return std::get::value>( static_cast &>( *this ) ); - } - - template >::type, size_t Which = 0> - T const & get() const VULKAN_HPP_NOEXCEPT - { - return std::get::value>( static_cast const &>( *this ) ); - } - - template - std::tuple get() VULKAN_HPP_NOEXCEPT - { - return std::tie( get(), get(), get()... ); - } - - template - std::tuple get() const VULKAN_HPP_NOEXCEPT - { - return std::tie( get(), get(), get()... ); - } - - template - typename std::enable_if>::type>::value && ( Which == 0 ), bool>::type - isLinked() const VULKAN_HPP_NOEXCEPT - { - return true; - } - - template - typename std::enable_if>::type>::value || ( Which != 0 ), bool>::type - isLinked() const VULKAN_HPP_NOEXCEPT - { - static_assert( IsPartOfStructureChain::valid, "Can't unlink Structure that's not part of this StructureChain!" ); - return isLinked( reinterpret_cast( &get() ) ); - } - - template - typename std::enable_if>::type>::value || ( Which != 0 ), void>::type - relink() VULKAN_HPP_NOEXCEPT - { - static_assert( IsPartOfStructureChain::valid, "Can't relink Structure that's not part of this StructureChain!" ); - auto pNext = reinterpret_cast( &get() ); - VULKAN_HPP_ASSERT( !isLinked( pNext ) ); - auto & headElement = std::get<0>( static_cast &>( *this ) ); - pNext->pNext = reinterpret_cast( headElement.pNext ); - headElement.pNext = pNext; - } - - template - typename std::enable_if>::type>::value || ( Which != 0 ), void>::type - unlink() VULKAN_HPP_NOEXCEPT - { - static_assert( IsPartOfStructureChain::valid, "Can't unlink Structure that's not part of this StructureChain!" ); - unlink( reinterpret_cast( &get() ) ); - } - - private: - template - struct ChainElementIndex : ChainElementIndex - { - }; - - template - struct ChainElementIndex::value, void>::type, First, Types...> - : ChainElementIndex - { - }; - - template - struct ChainElementIndex::value, void>::type, First, Types...> - : ChainElementIndex - { - }; - - template - struct ChainElementIndex::value, void>::type, First, Types...> - : std::integral_constant - { - }; - - bool isLinked( VkBaseInStructure const * pNext ) const VULKAN_HPP_NOEXCEPT - { - VkBaseInStructure const * elementPtr = - reinterpret_cast( &std::get<0>( static_cast const &>( *this ) ) ); - while ( elementPtr ) - { - if ( elementPtr->pNext == pNext ) - { - return true; - } - elementPtr = elementPtr->pNext; - } - return false; - } - - template - typename std::enable_if::type link() VULKAN_HPP_NOEXCEPT - { - auto & x = std::get( static_cast &>( *this ) ); - x.pNext = &std::get( static_cast &>( *this ) ); - link(); - } - - template - typename std::enable_if::type link() VULKAN_HPP_NOEXCEPT - { - } - - void link( void * dstBase, void const * srcBase, VkBaseOutStructure * dst, VkBaseInStructure const * src ) - { - while ( src->pNext ) - { - std::ptrdiff_t offset = reinterpret_cast( src->pNext ) - reinterpret_cast( srcBase ); - dst->pNext = reinterpret_cast( reinterpret_cast( dstBase ) + offset ); - dst = dst->pNext; - src = src->pNext; - } - dst->pNext = nullptr; - } - - void unlink( VkBaseOutStructure const * pNext ) VULKAN_HPP_NOEXCEPT - { - VkBaseOutStructure * elementPtr = reinterpret_cast( &std::get<0>( static_cast &>( *this ) ) ); - while ( elementPtr && ( elementPtr->pNext != pNext ) ) - { - elementPtr = elementPtr->pNext; - } - if ( elementPtr ) - { - elementPtr->pNext = pNext->pNext; - } - else - { - VULKAN_HPP_ASSERT( false ); // fires, if the ClassType member has already been unlinked ! - } - } - }; - -# if !defined( VULKAN_HPP_NO_SMART_HANDLE ) - template - class UniqueHandleTraits; - - template - class UniqueHandle : public UniqueHandleTraits::deleter - { - private: - using Deleter = typename UniqueHandleTraits::deleter; - - public: - using element_type = Type; - - UniqueHandle() : Deleter(), m_value() {} - - explicit UniqueHandle( Type const & value, Deleter const & deleter = Deleter() ) VULKAN_HPP_NOEXCEPT - : Deleter( deleter ) - , m_value( value ) - { - } - - UniqueHandle( UniqueHandle const & ) = delete; - - UniqueHandle( UniqueHandle && other ) VULKAN_HPP_NOEXCEPT - : Deleter( std::move( static_cast( other ) ) ) - , m_value( other.release() ) - { - } - - ~UniqueHandle() VULKAN_HPP_NOEXCEPT - { - if ( m_value ) - { - this->destroy( m_value ); - } - } - - UniqueHandle & operator=( UniqueHandle const & ) = delete; - - UniqueHandle & operator=( UniqueHandle && other ) VULKAN_HPP_NOEXCEPT - { - reset( other.release() ); - *static_cast( this ) = std::move( static_cast( other ) ); - return *this; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_value.operator bool(); - } - - Type const * operator->() const VULKAN_HPP_NOEXCEPT - { - return &m_value; - } - - Type * operator->() VULKAN_HPP_NOEXCEPT - { - return &m_value; - } - - Type const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_value; - } - - Type & operator*() VULKAN_HPP_NOEXCEPT - { - return m_value; - } - - const Type & get() const VULKAN_HPP_NOEXCEPT - { - return m_value; - } - - Type & get() VULKAN_HPP_NOEXCEPT - { - return m_value; - } - - void reset( Type const & value = Type() ) VULKAN_HPP_NOEXCEPT - { - if ( m_value != value ) - { - if ( m_value ) - { - this->destroy( m_value ); - } - m_value = value; - } - } - - Type release() VULKAN_HPP_NOEXCEPT - { - Type value = m_value; - m_value = nullptr; - return value; - } - - void swap( UniqueHandle & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_value, rhs.m_value ); - std::swap( static_cast( *this ), static_cast( rhs ) ); - } - - private: - Type m_value; - }; - - template - VULKAN_HPP_INLINE std::vector uniqueToRaw( std::vector const & handles ) - { - std::vector newBuffer( handles.size() ); - std::transform( handles.begin(), handles.end(), newBuffer.begin(), []( UniqueType const & handle ) { return handle.get(); } ); - return newBuffer; - } - - template - VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) VULKAN_HPP_NOEXCEPT - { - lhs.swap( rhs ); - } -# endif -#endif // VULKAN_HPP_DISABLE_ENHANCED_MODE - - class DispatchLoaderBase - { - public: - DispatchLoaderBase() = default; - DispatchLoaderBase( std::nullptr_t ) -#if !defined( NDEBUG ) - : m_valid( false ) -#endif - { - } - -#if !defined( NDEBUG ) - size_t getVkHeaderVersion() const - { - VULKAN_HPP_ASSERT( m_valid ); - return vkHeaderVersion; - } - - private: - size_t vkHeaderVersion = VK_HEADER_VERSION; - bool m_valid = true; -#endif - }; - -#if !defined( VK_NO_PROTOTYPES ) - class DispatchLoaderStatic : public DispatchLoaderBase - { - public: - //=== VK_VERSION_1_0 === - - VkResult - vkCreateInstance( const VkInstanceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkInstance * pInstance ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateInstance( pCreateInfo, pAllocator, pInstance ); - } - - void vkDestroyInstance( VkInstance instance, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyInstance( instance, pAllocator ); - } - - VkResult vkEnumeratePhysicalDevices( VkInstance instance, uint32_t * pPhysicalDeviceCount, VkPhysicalDevice * pPhysicalDevices ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumeratePhysicalDevices( instance, pPhysicalDeviceCount, pPhysicalDevices ); - } - - void vkGetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures * pFeatures ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFeatures( physicalDevice, pFeatures ); - } - - void - vkGetPhysicalDeviceFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties * pFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFormatProperties( physicalDevice, format, pFormatProperties ); - } - - VkResult vkGetPhysicalDeviceImageFormatProperties( VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkImageFormatProperties * pImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceImageFormatProperties( physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties ); - } - - void vkGetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceProperties( physicalDevice, pProperties ); - } - - void vkGetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, - uint32_t * pQueueFamilyPropertyCount, - VkQueueFamilyProperties * pQueueFamilyProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceQueueFamilyProperties( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties ); - } - - void vkGetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties * pMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceMemoryProperties( physicalDevice, pMemoryProperties ); - } - - PFN_vkVoidFunction vkGetInstanceProcAddr( VkInstance instance, const char * pName ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetInstanceProcAddr( instance, pName ); - } - - PFN_vkVoidFunction vkGetDeviceProcAddr( VkDevice device, const char * pName ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceProcAddr( device, pName ); - } - - VkResult vkCreateDevice( VkPhysicalDevice physicalDevice, - const VkDeviceCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDevice * pDevice ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDevice( physicalDevice, pCreateInfo, pAllocator, pDevice ); - } - - void vkDestroyDevice( VkDevice device, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDevice( device, pAllocator ); - } - - VkResult vkEnumerateInstanceExtensionProperties( const char * pLayerName, - uint32_t * pPropertyCount, - VkExtensionProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, pProperties ); - } - - VkResult vkEnumerateDeviceExtensionProperties( VkPhysicalDevice physicalDevice, - const char * pLayerName, - uint32_t * pPropertyCount, - VkExtensionProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumerateDeviceExtensionProperties( physicalDevice, pLayerName, pPropertyCount, pProperties ); - } - - VkResult vkEnumerateInstanceLayerProperties( uint32_t * pPropertyCount, VkLayerProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumerateInstanceLayerProperties( pPropertyCount, pProperties ); - } - - VkResult - vkEnumerateDeviceLayerProperties( VkPhysicalDevice physicalDevice, uint32_t * pPropertyCount, VkLayerProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumerateDeviceLayerProperties( physicalDevice, pPropertyCount, pProperties ); - } - - void vkGetDeviceQueue( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue * pQueue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceQueue( device, queueFamilyIndex, queueIndex, pQueue ); - } - - VkResult vkQueueSubmit( VkQueue queue, uint32_t submitCount, const VkSubmitInfo * pSubmits, VkFence fence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueSubmit( queue, submitCount, pSubmits, fence ); - } - - VkResult vkQueueWaitIdle( VkQueue queue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueWaitIdle( queue ); - } - - VkResult vkDeviceWaitIdle( VkDevice device ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDeviceWaitIdle( device ); - } - - VkResult vkAllocateMemory( VkDevice device, - const VkMemoryAllocateInfo * pAllocateInfo, - const VkAllocationCallbacks * pAllocator, - VkDeviceMemory * pMemory ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAllocateMemory( device, pAllocateInfo, pAllocator, pMemory ); - } - - void vkFreeMemory( VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkFreeMemory( device, memory, pAllocator ); - } - - VkResult vkMapMemory( VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void ** ppData ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkMapMemory( device, memory, offset, size, flags, ppData ); - } - - void vkUnmapMemory( VkDevice device, VkDeviceMemory memory ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUnmapMemory( device, memory ); - } - - VkResult vkFlushMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges ) const VULKAN_HPP_NOEXCEPT - { - return ::vkFlushMappedMemoryRanges( device, memoryRangeCount, pMemoryRanges ); - } - - VkResult vkInvalidateMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges ) const VULKAN_HPP_NOEXCEPT - { - return ::vkInvalidateMappedMemoryRanges( device, memoryRangeCount, pMemoryRanges ); - } - - void vkGetDeviceMemoryCommitment( VkDevice device, VkDeviceMemory memory, VkDeviceSize * pCommittedMemoryInBytes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceMemoryCommitment( device, memory, pCommittedMemoryInBytes ); - } - - VkResult vkBindBufferMemory( VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindBufferMemory( device, buffer, memory, memoryOffset ); - } - - VkResult vkBindImageMemory( VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindImageMemory( device, image, memory, memoryOffset ); - } - - void vkGetBufferMemoryRequirements( VkDevice device, VkBuffer buffer, VkMemoryRequirements * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferMemoryRequirements( device, buffer, pMemoryRequirements ); - } - - void vkGetImageMemoryRequirements( VkDevice device, VkImage image, VkMemoryRequirements * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageMemoryRequirements( device, image, pMemoryRequirements ); - } - - void vkGetImageSparseMemoryRequirements( VkDevice device, - VkImage image, - uint32_t * pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements * pSparseMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageSparseMemoryRequirements( device, image, pSparseMemoryRequirementCount, pSparseMemoryRequirements ); - } - - void vkGetPhysicalDeviceSparseImageFormatProperties( VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkSampleCountFlagBits samples, - VkImageUsageFlags usage, - VkImageTiling tiling, - uint32_t * pPropertyCount, - VkSparseImageFormatProperties * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSparseImageFormatProperties( physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties ); - } - - VkResult vkQueueBindSparse( VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo * pBindInfo, VkFence fence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueBindSparse( queue, bindInfoCount, pBindInfo, fence ); - } - - VkResult vkCreateFence( VkDevice device, - const VkFenceCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkFence * pFence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateFence( device, pCreateInfo, pAllocator, pFence ); - } - - void vkDestroyFence( VkDevice device, VkFence fence, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyFence( device, fence, pAllocator ); - } - - VkResult vkResetFences( VkDevice device, uint32_t fenceCount, const VkFence * pFences ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetFences( device, fenceCount, pFences ); - } - - VkResult vkGetFenceStatus( VkDevice device, VkFence fence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetFenceStatus( device, fence ); - } - - VkResult vkWaitForFences( VkDevice device, uint32_t fenceCount, const VkFence * pFences, VkBool32 waitAll, uint64_t timeout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkWaitForFences( device, fenceCount, pFences, waitAll, timeout ); - } - - VkResult vkCreateSemaphore( VkDevice device, - const VkSemaphoreCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSemaphore * pSemaphore ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSemaphore( device, pCreateInfo, pAllocator, pSemaphore ); - } - - void vkDestroySemaphore( VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySemaphore( device, semaphore, pAllocator ); - } - - VkResult vkCreateEvent( VkDevice device, - const VkEventCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkEvent * pEvent ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateEvent( device, pCreateInfo, pAllocator, pEvent ); - } - - void vkDestroyEvent( VkDevice device, VkEvent event, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyEvent( device, event, pAllocator ); - } - - VkResult vkGetEventStatus( VkDevice device, VkEvent event ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetEventStatus( device, event ); - } - - VkResult vkSetEvent( VkDevice device, VkEvent event ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetEvent( device, event ); - } - - VkResult vkResetEvent( VkDevice device, VkEvent event ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetEvent( device, event ); - } - - VkResult vkCreateQueryPool( VkDevice device, - const VkQueryPoolCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkQueryPool * pQueryPool ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateQueryPool( device, pCreateInfo, pAllocator, pQueryPool ); - } - - void vkDestroyQueryPool( VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyQueryPool( device, queryPool, pAllocator ); - } - - VkResult vkGetQueryPoolResults( VkDevice device, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - void * pData, - VkDeviceSize stride, - VkQueryResultFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetQueryPoolResults( device, queryPool, firstQuery, queryCount, dataSize, pData, stride, flags ); - } - - VkResult vkCreateBuffer( VkDevice device, - const VkBufferCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkBuffer * pBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateBuffer( device, pCreateInfo, pAllocator, pBuffer ); - } - - void vkDestroyBuffer( VkDevice device, VkBuffer buffer, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyBuffer( device, buffer, pAllocator ); - } - - VkResult vkCreateBufferView( VkDevice device, - const VkBufferViewCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkBufferView * pView ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateBufferView( device, pCreateInfo, pAllocator, pView ); - } - - void vkDestroyBufferView( VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyBufferView( device, bufferView, pAllocator ); - } - - VkResult vkCreateImage( VkDevice device, - const VkImageCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkImage * pImage ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateImage( device, pCreateInfo, pAllocator, pImage ); - } - - void vkDestroyImage( VkDevice device, VkImage image, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyImage( device, image, pAllocator ); - } - - void vkGetImageSubresourceLayout( VkDevice device, - VkImage image, - const VkImageSubresource * pSubresource, - VkSubresourceLayout * pLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageSubresourceLayout( device, image, pSubresource, pLayout ); - } - - VkResult vkCreateImageView( VkDevice device, - const VkImageViewCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkImageView * pView ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateImageView( device, pCreateInfo, pAllocator, pView ); - } - - void vkDestroyImageView( VkDevice device, VkImageView imageView, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyImageView( device, imageView, pAllocator ); - } - - VkResult vkCreateShaderModule( VkDevice device, - const VkShaderModuleCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkShaderModule * pShaderModule ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateShaderModule( device, pCreateInfo, pAllocator, pShaderModule ); - } - - void vkDestroyShaderModule( VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyShaderModule( device, shaderModule, pAllocator ); - } - - VkResult vkCreatePipelineCache( VkDevice device, - const VkPipelineCacheCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkPipelineCache * pPipelineCache ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreatePipelineCache( device, pCreateInfo, pAllocator, pPipelineCache ); - } - - void vkDestroyPipelineCache( VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyPipelineCache( device, pipelineCache, pAllocator ); - } - - VkResult vkGetPipelineCacheData( VkDevice device, VkPipelineCache pipelineCache, size_t * pDataSize, void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPipelineCacheData( device, pipelineCache, pDataSize, pData ); - } - - VkResult - vkMergePipelineCaches( VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache * pSrcCaches ) const VULKAN_HPP_NOEXCEPT - { - return ::vkMergePipelineCaches( device, dstCache, srcCacheCount, pSrcCaches ); - } - - VkResult vkCreateGraphicsPipelines( VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkGraphicsPipelineCreateInfo * pCreateInfos, - const VkAllocationCallbacks * pAllocator, - VkPipeline * pPipelines ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateGraphicsPipelines( device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines ); - } - - VkResult vkCreateComputePipelines( VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkComputePipelineCreateInfo * pCreateInfos, - const VkAllocationCallbacks * pAllocator, - VkPipeline * pPipelines ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateComputePipelines( device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines ); - } - - void vkDestroyPipeline( VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyPipeline( device, pipeline, pAllocator ); - } - - VkResult vkCreatePipelineLayout( VkDevice device, - const VkPipelineLayoutCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkPipelineLayout * pPipelineLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreatePipelineLayout( device, pCreateInfo, pAllocator, pPipelineLayout ); - } - - void vkDestroyPipelineLayout( VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyPipelineLayout( device, pipelineLayout, pAllocator ); - } - - VkResult vkCreateSampler( VkDevice device, - const VkSamplerCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSampler * pSampler ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSampler( device, pCreateInfo, pAllocator, pSampler ); - } - - void vkDestroySampler( VkDevice device, VkSampler sampler, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySampler( device, sampler, pAllocator ); - } - - VkResult vkCreateDescriptorSetLayout( VkDevice device, - const VkDescriptorSetLayoutCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDescriptorSetLayout * pSetLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDescriptorSetLayout( device, pCreateInfo, pAllocator, pSetLayout ); - } - - void vkDestroyDescriptorSetLayout( VkDevice device, - VkDescriptorSetLayout descriptorSetLayout, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDescriptorSetLayout( device, descriptorSetLayout, pAllocator ); - } - - VkResult vkCreateDescriptorPool( VkDevice device, - const VkDescriptorPoolCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDescriptorPool * pDescriptorPool ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDescriptorPool( device, pCreateInfo, pAllocator, pDescriptorPool ); - } - - void vkDestroyDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDescriptorPool( device, descriptorPool, pAllocator ); - } - - VkResult vkResetDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetDescriptorPool( device, descriptorPool, flags ); - } - - VkResult vkAllocateDescriptorSets( VkDevice device, - const VkDescriptorSetAllocateInfo * pAllocateInfo, - VkDescriptorSet * pDescriptorSets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAllocateDescriptorSets( device, pAllocateInfo, pDescriptorSets ); - } - - VkResult vkFreeDescriptorSets( VkDevice device, - VkDescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VkDescriptorSet * pDescriptorSets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkFreeDescriptorSets( device, descriptorPool, descriptorSetCount, pDescriptorSets ); - } - - void vkUpdateDescriptorSets( VkDevice device, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet * pDescriptorWrites, - uint32_t descriptorCopyCount, - const VkCopyDescriptorSet * pDescriptorCopies ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUpdateDescriptorSets( device, descriptorWriteCount, pDescriptorWrites, descriptorCopyCount, pDescriptorCopies ); - } - - VkResult vkCreateFramebuffer( VkDevice device, - const VkFramebufferCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkFramebuffer * pFramebuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateFramebuffer( device, pCreateInfo, pAllocator, pFramebuffer ); - } - - void vkDestroyFramebuffer( VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyFramebuffer( device, framebuffer, pAllocator ); - } - - VkResult vkCreateRenderPass( VkDevice device, - const VkRenderPassCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkRenderPass * pRenderPass ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateRenderPass( device, pCreateInfo, pAllocator, pRenderPass ); - } - - void vkDestroyRenderPass( VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyRenderPass( device, renderPass, pAllocator ); - } - - void vkGetRenderAreaGranularity( VkDevice device, VkRenderPass renderPass, VkExtent2D * pGranularity ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRenderAreaGranularity( device, renderPass, pGranularity ); - } - - VkResult vkCreateCommandPool( VkDevice device, - const VkCommandPoolCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkCommandPool * pCommandPool ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateCommandPool( device, pCreateInfo, pAllocator, pCommandPool ); - } - - void vkDestroyCommandPool( VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyCommandPool( device, commandPool, pAllocator ); - } - - VkResult vkResetCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetCommandPool( device, commandPool, flags ); - } - - VkResult vkAllocateCommandBuffers( VkDevice device, - const VkCommandBufferAllocateInfo * pAllocateInfo, - VkCommandBuffer * pCommandBuffers ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAllocateCommandBuffers( device, pAllocateInfo, pCommandBuffers ); - } - - void vkFreeCommandBuffers( VkDevice device, - VkCommandPool commandPool, - uint32_t commandBufferCount, - const VkCommandBuffer * pCommandBuffers ) const VULKAN_HPP_NOEXCEPT - { - return ::vkFreeCommandBuffers( device, commandPool, commandBufferCount, pCommandBuffers ); - } - - VkResult vkBeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo * pBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBeginCommandBuffer( commandBuffer, pBeginInfo ); - } - - VkResult vkEndCommandBuffer( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEndCommandBuffer( commandBuffer ); - } - - VkResult vkResetCommandBuffer( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetCommandBuffer( commandBuffer, flags ); - } - - void vkCmdBindPipeline( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindPipeline( commandBuffer, pipelineBindPoint, pipeline ); - } - - void - vkCmdSetViewport( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport * pViewports ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetViewport( commandBuffer, firstViewport, viewportCount, pViewports ); - } - - void vkCmdSetScissor( VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D * pScissors ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetScissor( commandBuffer, firstScissor, scissorCount, pScissors ); - } - - void vkCmdSetLineWidth( VkCommandBuffer commandBuffer, float lineWidth ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetLineWidth( commandBuffer, lineWidth ); - } - - void vkCmdSetDepthBias( VkCommandBuffer commandBuffer, - float depthBiasConstantFactor, - float depthBiasClamp, - float depthBiasSlopeFactor ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBias( commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); - } - - void vkCmdSetBlendConstants( VkCommandBuffer commandBuffer, const float blendConstants[4] ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetBlendConstants( commandBuffer, blendConstants ); - } - - void vkCmdSetDepthBounds( VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBounds( commandBuffer, minDepthBounds, maxDepthBounds ); - } - - void vkCmdSetStencilCompareMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilCompareMask( commandBuffer, faceMask, compareMask ); - } - - void vkCmdSetStencilWriteMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilWriteMask( commandBuffer, faceMask, writeMask ); - } - - void vkCmdSetStencilReference( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilReference( commandBuffer, faceMask, reference ); - } - - void vkCmdBindDescriptorSets( VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t firstSet, - uint32_t descriptorSetCount, - const VkDescriptorSet * pDescriptorSets, - uint32_t dynamicOffsetCount, - const uint32_t * pDynamicOffsets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindDescriptorSets( - commandBuffer, pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, dynamicOffsetCount, pDynamicOffsets ); - } - - void vkCmdBindIndexBuffer( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindIndexBuffer( commandBuffer, buffer, offset, indexType ); - } - - void vkCmdBindVertexBuffers( VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer * pBuffers, - const VkDeviceSize * pOffsets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindVertexBuffers( commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets ); - } - - void vkCmdDraw( VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDraw( commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); - } - - void vkCmdDrawIndexed( VkCommandBuffer commandBuffer, - uint32_t indexCount, - uint32_t instanceCount, - uint32_t firstIndex, - int32_t vertexOffset, - uint32_t firstInstance ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndexed( commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } - - void vkCmdDrawIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndirect( commandBuffer, buffer, offset, drawCount, stride ); - } - - void vkCmdDrawIndexedIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndexedIndirect( commandBuffer, buffer, offset, drawCount, stride ); - } - - void vkCmdDispatch( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDispatch( commandBuffer, groupCountX, groupCountY, groupCountZ ); - } - - void vkCmdDispatchIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDispatchIndirect( commandBuffer, buffer, offset ); - } - - void vkCmdCopyBuffer( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy * pRegions ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBuffer( commandBuffer, srcBuffer, dstBuffer, regionCount, pRegions ); - } - - void vkCmdCopyImage( VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageCopy * pRegions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions ); - } - - void vkCmdBlitImage( VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageBlit * pRegions, - VkFilter filter ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBlitImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter ); - } - - void vkCmdCopyBufferToImage( VkCommandBuffer commandBuffer, - VkBuffer srcBuffer, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkBufferImageCopy * pRegions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBufferToImage( commandBuffer, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions ); - } - - void vkCmdCopyImageToBuffer( VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkBuffer dstBuffer, - uint32_t regionCount, - const VkBufferImageCopy * pRegions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImageToBuffer( commandBuffer, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions ); - } - - void vkCmdUpdateBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void * pData ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdUpdateBuffer( commandBuffer, dstBuffer, dstOffset, dataSize, pData ); - } - - void - vkCmdFillBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdFillBuffer( commandBuffer, dstBuffer, dstOffset, size, data ); - } - - void vkCmdClearColorImage( VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearColorValue * pColor, - uint32_t rangeCount, - const VkImageSubresourceRange * pRanges ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdClearColorImage( commandBuffer, image, imageLayout, pColor, rangeCount, pRanges ); - } - - void vkCmdClearDepthStencilImage( VkCommandBuffer commandBuffer, - VkImage image, - VkImageLayout imageLayout, - const VkClearDepthStencilValue * pDepthStencil, - uint32_t rangeCount, - const VkImageSubresourceRange * pRanges ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdClearDepthStencilImage( commandBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges ); - } - - void vkCmdClearAttachments( VkCommandBuffer commandBuffer, - uint32_t attachmentCount, - const VkClearAttachment * pAttachments, - uint32_t rectCount, - const VkClearRect * pRects ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdClearAttachments( commandBuffer, attachmentCount, pAttachments, rectCount, pRects ); - } - - void vkCmdResolveImage( VkCommandBuffer commandBuffer, - VkImage srcImage, - VkImageLayout srcImageLayout, - VkImage dstImage, - VkImageLayout dstImageLayout, - uint32_t regionCount, - const VkImageResolve * pRegions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResolveImage( commandBuffer, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions ); - } - - void vkCmdSetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetEvent( commandBuffer, event, stageMask ); - } - - void vkCmdResetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResetEvent( commandBuffer, event, stageMask ); - } - - void vkCmdWaitEvents( VkCommandBuffer commandBuffer, - uint32_t eventCount, - const VkEvent * pEvents, - VkPipelineStageFlags srcStageMask, - VkPipelineStageFlags dstStageMask, - uint32_t memoryBarrierCount, - const VkMemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier * pImageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWaitEvents( commandBuffer, - eventCount, - pEvents, - srcStageMask, - dstStageMask, - memoryBarrierCount, - pMemoryBarriers, - bufferMemoryBarrierCount, - pBufferMemoryBarriers, - imageMemoryBarrierCount, - pImageMemoryBarriers ); - } - - void vkCmdPipelineBarrier( VkCommandBuffer commandBuffer, - VkPipelineStageFlags srcStageMask, - VkPipelineStageFlags dstStageMask, - VkDependencyFlags dependencyFlags, - uint32_t memoryBarrierCount, - const VkMemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VkBufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VkImageMemoryBarrier * pImageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPipelineBarrier( commandBuffer, - srcStageMask, - dstStageMask, - dependencyFlags, - memoryBarrierCount, - pMemoryBarriers, - bufferMemoryBarrierCount, - pBufferMemoryBarriers, - imageMemoryBarrierCount, - pImageMemoryBarriers ); - } - - void vkCmdBeginQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginQuery( commandBuffer, queryPool, query, flags ); - } - - void vkCmdEndQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndQuery( commandBuffer, queryPool, query ); - } - - void vkCmdResetQueryPool( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResetQueryPool( commandBuffer, queryPool, firstQuery, queryCount ); - } - - void vkCmdWriteTimestamp( VkCommandBuffer commandBuffer, - VkPipelineStageFlagBits pipelineStage, - VkQueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteTimestamp( commandBuffer, pipelineStage, queryPool, query ); - } - - void vkCmdCopyQueryPoolResults( VkCommandBuffer commandBuffer, - VkQueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - VkDeviceSize stride, - VkQueryResultFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyQueryPoolResults( commandBuffer, queryPool, firstQuery, queryCount, dstBuffer, dstOffset, stride, flags ); - } - - void vkCmdPushConstants( VkCommandBuffer commandBuffer, - VkPipelineLayout layout, - VkShaderStageFlags stageFlags, - uint32_t offset, - uint32_t size, - const void * pValues ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPushConstants( commandBuffer, layout, stageFlags, offset, size, pValues ); - } - - void vkCmdBeginRenderPass( VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo * pRenderPassBegin, - VkSubpassContents contents ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginRenderPass( commandBuffer, pRenderPassBegin, contents ); - } - - void vkCmdNextSubpass( VkCommandBuffer commandBuffer, VkSubpassContents contents ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdNextSubpass( commandBuffer, contents ); - } - - void vkCmdEndRenderPass( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndRenderPass( commandBuffer ); - } - - void vkCmdExecuteCommands( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdExecuteCommands( commandBuffer, commandBufferCount, pCommandBuffers ); - } - - //=== VK_VERSION_1_1 === - - VkResult vkEnumerateInstanceVersion( uint32_t * pApiVersion ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumerateInstanceVersion( pApiVersion ); - } - - VkResult vkBindBufferMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo * pBindInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindBufferMemory2( device, bindInfoCount, pBindInfos ); - } - - VkResult vkBindImageMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo * pBindInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindImageMemory2( device, bindInfoCount, pBindInfos ); - } - - void vkGetDeviceGroupPeerMemoryFeatures( VkDevice device, - uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VkPeerMemoryFeatureFlags * pPeerMemoryFeatures ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceGroupPeerMemoryFeatures( device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures ); - } - - void vkCmdSetDeviceMask( VkCommandBuffer commandBuffer, uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDeviceMask( commandBuffer, deviceMask ); - } - - void vkCmdDispatchBase( VkCommandBuffer commandBuffer, - uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDispatchBase( commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - - VkResult vkEnumeratePhysicalDeviceGroups( VkInstance instance, - uint32_t * pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumeratePhysicalDeviceGroups( instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties ); - } - - void vkGetImageMemoryRequirements2( VkDevice device, - const VkImageMemoryRequirementsInfo2 * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageMemoryRequirements2( device, pInfo, pMemoryRequirements ); - } - - void vkGetBufferMemoryRequirements2( VkDevice device, - const VkBufferMemoryRequirementsInfo2 * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferMemoryRequirements2( device, pInfo, pMemoryRequirements ); - } - - void vkGetImageSparseMemoryRequirements2( VkDevice device, - const VkImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageSparseMemoryRequirements2( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements ); - } - - void vkGetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 * pFeatures ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFeatures2( physicalDevice, pFeatures ); - } - - void vkGetPhysicalDeviceProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceProperties2( physicalDevice, pProperties ); - } - - void vkGetPhysicalDeviceFormatProperties2( VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties2 * pFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFormatProperties2( physicalDevice, format, pFormatProperties ); - } - - VkResult vkGetPhysicalDeviceImageFormatProperties2( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VkImageFormatProperties2 * pImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceImageFormatProperties2( physicalDevice, pImageFormatInfo, pImageFormatProperties ); - } - - void vkGetPhysicalDeviceQueueFamilyProperties2( VkPhysicalDevice physicalDevice, - uint32_t * pQueueFamilyPropertyCount, - VkQueueFamilyProperties2 * pQueueFamilyProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceQueueFamilyProperties2( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties ); - } - - void vkGetPhysicalDeviceMemoryProperties2( VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2 * pMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceMemoryProperties2( physicalDevice, pMemoryProperties ); - } - - void vkGetPhysicalDeviceSparseImageFormatProperties2( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VkSparseImageFormatProperties2 * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSparseImageFormatProperties2( physicalDevice, pFormatInfo, pPropertyCount, pProperties ); - } - - void vkTrimCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkTrimCommandPool( device, commandPool, flags ); - } - - void vkGetDeviceQueue2( VkDevice device, const VkDeviceQueueInfo2 * pQueueInfo, VkQueue * pQueue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceQueue2( device, pQueueInfo, pQueue ); - } - - VkResult vkCreateSamplerYcbcrConversion( VkDevice device, - const VkSamplerYcbcrConversionCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSamplerYcbcrConversion * pYcbcrConversion ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSamplerYcbcrConversion( device, pCreateInfo, pAllocator, pYcbcrConversion ); - } - - void vkDestroySamplerYcbcrConversion( VkDevice device, - VkSamplerYcbcrConversion ycbcrConversion, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySamplerYcbcrConversion( device, ycbcrConversion, pAllocator ); - } - - VkResult vkCreateDescriptorUpdateTemplate( VkDevice device, - const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDescriptorUpdateTemplate( device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate ); - } - - void vkDestroyDescriptorUpdateTemplate( VkDevice device, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDescriptorUpdateTemplate( device, descriptorUpdateTemplate, pAllocator ); - } - - void vkUpdateDescriptorSetWithTemplate( VkDevice device, - VkDescriptorSet descriptorSet, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUpdateDescriptorSetWithTemplate( device, descriptorSet, descriptorUpdateTemplate, pData ); - } - - void vkGetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VkExternalBufferProperties * pExternalBufferProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalBufferProperties( physicalDevice, pExternalBufferInfo, pExternalBufferProperties ); - } - - void vkGetPhysicalDeviceExternalFenceProperties( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VkExternalFenceProperties * pExternalFenceProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalFenceProperties( physicalDevice, pExternalFenceInfo, pExternalFenceProperties ); - } - - void vkGetPhysicalDeviceExternalSemaphoreProperties( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VkExternalSemaphoreProperties * pExternalSemaphoreProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalSemaphoreProperties( physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties ); - } - - void vkGetDescriptorSetLayoutSupport( VkDevice device, - const VkDescriptorSetLayoutCreateInfo * pCreateInfo, - VkDescriptorSetLayoutSupport * pSupport ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDescriptorSetLayoutSupport( device, pCreateInfo, pSupport ); - } - - //=== VK_VERSION_1_2 === - - void vkCmdDrawIndirectCount( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndirectCount( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - void vkCmdDrawIndexedIndirectCount( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndexedIndirectCount( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - VkResult vkCreateRenderPass2( VkDevice device, - const VkRenderPassCreateInfo2 * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkRenderPass * pRenderPass ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateRenderPass2( device, pCreateInfo, pAllocator, pRenderPass ); - } - - void vkCmdBeginRenderPass2( VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo * pRenderPassBegin, - const VkSubpassBeginInfo * pSubpassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginRenderPass2( commandBuffer, pRenderPassBegin, pSubpassBeginInfo ); - } - - void vkCmdNextSubpass2( VkCommandBuffer commandBuffer, - const VkSubpassBeginInfo * pSubpassBeginInfo, - const VkSubpassEndInfo * pSubpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdNextSubpass2( commandBuffer, pSubpassBeginInfo, pSubpassEndInfo ); - } - - void vkCmdEndRenderPass2( VkCommandBuffer commandBuffer, const VkSubpassEndInfo * pSubpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndRenderPass2( commandBuffer, pSubpassEndInfo ); - } - - void vkResetQueryPool( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetQueryPool( device, queryPool, firstQuery, queryCount ); - } - - VkResult vkGetSemaphoreCounterValue( VkDevice device, VkSemaphore semaphore, uint64_t * pValue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSemaphoreCounterValue( device, semaphore, pValue ); - } - - VkResult vkWaitSemaphores( VkDevice device, const VkSemaphoreWaitInfo * pWaitInfo, uint64_t timeout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkWaitSemaphores( device, pWaitInfo, timeout ); - } - - VkResult vkSignalSemaphore( VkDevice device, const VkSemaphoreSignalInfo * pSignalInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSignalSemaphore( device, pSignalInfo ); - } - - VkDeviceAddress vkGetBufferDeviceAddress( VkDevice device, const VkBufferDeviceAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferDeviceAddress( device, pInfo ); - } - - uint64_t vkGetBufferOpaqueCaptureAddress( VkDevice device, const VkBufferDeviceAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferOpaqueCaptureAddress( device, pInfo ); - } - - uint64_t vkGetDeviceMemoryOpaqueCaptureAddress( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceMemoryOpaqueCaptureAddress( device, pInfo ); - } - - //=== VK_VERSION_1_3 === - - VkResult vkGetPhysicalDeviceToolProperties( VkPhysicalDevice physicalDevice, - uint32_t * pToolCount, - VkPhysicalDeviceToolProperties * pToolProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceToolProperties( physicalDevice, pToolCount, pToolProperties ); - } - - VkResult vkCreatePrivateDataSlot( VkDevice device, - const VkPrivateDataSlotCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkPrivateDataSlot * pPrivateDataSlot ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreatePrivateDataSlot( device, pCreateInfo, pAllocator, pPrivateDataSlot ); - } - - void vkDestroyPrivateDataSlot( VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyPrivateDataSlot( device, privateDataSlot, pAllocator ); - } - - VkResult vkSetPrivateData( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkSetPrivateData( device, objectType, objectHandle, privateDataSlot, data ); - } - - void vkGetPrivateData( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t * pData ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkGetPrivateData( device, objectType, objectHandle, privateDataSlot, pData ); - } - - void vkCmdSetEvent2( VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo * pDependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetEvent2( commandBuffer, event, pDependencyInfo ); - } - - void vkCmdResetEvent2( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResetEvent2( commandBuffer, event, stageMask ); - } - - void vkCmdWaitEvents2( VkCommandBuffer commandBuffer, - uint32_t eventCount, - const VkEvent * pEvents, - const VkDependencyInfo * pDependencyInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWaitEvents2( commandBuffer, eventCount, pEvents, pDependencyInfos ); - } - - void vkCmdPipelineBarrier2( VkCommandBuffer commandBuffer, const VkDependencyInfo * pDependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPipelineBarrier2( commandBuffer, pDependencyInfo ); - } - - void vkCmdWriteTimestamp2( VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteTimestamp2( commandBuffer, stage, queryPool, query ); - } - - VkResult vkQueueSubmit2( VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 * pSubmits, VkFence fence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueSubmit2( queue, submitCount, pSubmits, fence ); - } - - void vkCmdCopyBuffer2( VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 * pCopyBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBuffer2( commandBuffer, pCopyBufferInfo ); - } - - void vkCmdCopyImage2( VkCommandBuffer commandBuffer, const VkCopyImageInfo2 * pCopyImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImage2( commandBuffer, pCopyImageInfo ); - } - - void vkCmdCopyBufferToImage2( VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 * pCopyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBufferToImage2( commandBuffer, pCopyBufferToImageInfo ); - } - - void vkCmdCopyImageToBuffer2( VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 * pCopyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImageToBuffer2( commandBuffer, pCopyImageToBufferInfo ); - } - - void vkCmdBlitImage2( VkCommandBuffer commandBuffer, const VkBlitImageInfo2 * pBlitImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBlitImage2( commandBuffer, pBlitImageInfo ); - } - - void vkCmdResolveImage2( VkCommandBuffer commandBuffer, const VkResolveImageInfo2 * pResolveImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResolveImage2( commandBuffer, pResolveImageInfo ); - } - - void vkCmdBeginRendering( VkCommandBuffer commandBuffer, const VkRenderingInfo * pRenderingInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginRendering( commandBuffer, pRenderingInfo ); - } - - void vkCmdEndRendering( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndRendering( commandBuffer ); - } - - void vkCmdSetCullMode( VkCommandBuffer commandBuffer, VkCullModeFlags cullMode ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetCullMode( commandBuffer, cullMode ); - } - - void vkCmdSetFrontFace( VkCommandBuffer commandBuffer, VkFrontFace frontFace ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetFrontFace( commandBuffer, frontFace ); - } - - void vkCmdSetPrimitiveTopology( VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPrimitiveTopology( commandBuffer, primitiveTopology ); - } - - void vkCmdSetViewportWithCount( VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport * pViewports ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetViewportWithCount( commandBuffer, viewportCount, pViewports ); - } - - void vkCmdSetScissorWithCount( VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D * pScissors ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetScissorWithCount( commandBuffer, scissorCount, pScissors ); - } - - void vkCmdBindVertexBuffers2( VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer * pBuffers, - const VkDeviceSize * pOffsets, - const VkDeviceSize * pSizes, - const VkDeviceSize * pStrides ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindVertexBuffers2( commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides ); - } - - void vkCmdSetDepthTestEnable( VkCommandBuffer commandBuffer, VkBool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthTestEnable( commandBuffer, depthTestEnable ); - } - - void vkCmdSetDepthWriteEnable( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthWriteEnable( commandBuffer, depthWriteEnable ); - } - - void vkCmdSetDepthCompareOp( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthCompareOp( commandBuffer, depthCompareOp ); - } - - void vkCmdSetDepthBoundsTestEnable( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBoundsTestEnable( commandBuffer, depthBoundsTestEnable ); - } - - void vkCmdSetStencilTestEnable( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilTestEnable( commandBuffer, stencilTestEnable ); - } - - void vkCmdSetStencilOp( VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - VkStencilOp failOp, - VkStencilOp passOp, - VkStencilOp depthFailOp, - VkCompareOp compareOp ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilOp( commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp ); - } - - void vkCmdSetRasterizerDiscardEnable( VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetRasterizerDiscardEnable( commandBuffer, rasterizerDiscardEnable ); - } - - void vkCmdSetDepthBiasEnable( VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBiasEnable( commandBuffer, depthBiasEnable ); - } - - void vkCmdSetPrimitiveRestartEnable( VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPrimitiveRestartEnable( commandBuffer, primitiveRestartEnable ); - } - - void vkGetDeviceBufferMemoryRequirements( VkDevice device, - const VkDeviceBufferMemoryRequirements * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceBufferMemoryRequirements( device, pInfo, pMemoryRequirements ); - } - - void vkGetDeviceImageMemoryRequirements( VkDevice device, - const VkDeviceImageMemoryRequirements * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceImageMemoryRequirements( device, pInfo, pMemoryRequirements ); - } - - void vkGetDeviceImageSparseMemoryRequirements( VkDevice device, - const VkDeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceImageSparseMemoryRequirements( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements ); - } - - //=== VK_KHR_surface === - - void vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySurfaceKHR( instance, surface, pAllocator ); - } - - VkResult vkGetPhysicalDeviceSurfaceSupportKHR( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - VkSurfaceKHR surface, - VkBool32 * pSupported ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceSupportKHR( physicalDevice, queueFamilyIndex, surface, pSupported ); - } - - VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilitiesKHR * pSurfaceCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( physicalDevice, surface, pSurfaceCapabilities ); - } - - VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t * pSurfaceFormatCount, - VkSurfaceFormatKHR * pSurfaceFormats ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceFormatsKHR( physicalDevice, surface, pSurfaceFormatCount, pSurfaceFormats ); - } - - VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t * pPresentModeCount, - VkPresentModeKHR * pPresentModes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfacePresentModesKHR( physicalDevice, surface, pPresentModeCount, pPresentModes ); - } - - //=== VK_KHR_swapchain === - - VkResult vkCreateSwapchainKHR( VkDevice device, - const VkSwapchainCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSwapchainKHR * pSwapchain ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSwapchainKHR( device, pCreateInfo, pAllocator, pSwapchain ); - } - - void vkDestroySwapchainKHR( VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySwapchainKHR( device, swapchain, pAllocator ); - } - - VkResult vkGetSwapchainImagesKHR( VkDevice device, - VkSwapchainKHR swapchain, - uint32_t * pSwapchainImageCount, - VkImage * pSwapchainImages ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSwapchainImagesKHR( device, swapchain, pSwapchainImageCount, pSwapchainImages ); - } - - VkResult vkAcquireNextImageKHR( - VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t * pImageIndex ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireNextImageKHR( device, swapchain, timeout, semaphore, fence, pImageIndex ); - } - - VkResult vkQueuePresentKHR( VkQueue queue, const VkPresentInfoKHR * pPresentInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueuePresentKHR( queue, pPresentInfo ); - } - - VkResult vkGetDeviceGroupPresentCapabilitiesKHR( VkDevice device, - VkDeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceGroupPresentCapabilitiesKHR( device, pDeviceGroupPresentCapabilities ); - } - - VkResult - vkGetDeviceGroupSurfacePresentModesKHR( VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR * pModes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceGroupSurfacePresentModesKHR( device, surface, pModes ); - } - - VkResult vkGetPhysicalDevicePresentRectanglesKHR( VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - uint32_t * pRectCount, - VkRect2D * pRects ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDevicePresentRectanglesKHR( physicalDevice, surface, pRectCount, pRects ); - } - - VkResult vkAcquireNextImage2KHR( VkDevice device, const VkAcquireNextImageInfoKHR * pAcquireInfo, uint32_t * pImageIndex ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireNextImage2KHR( device, pAcquireInfo, pImageIndex ); - } - - //=== VK_KHR_display === - - VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( VkPhysicalDevice physicalDevice, - uint32_t * pPropertyCount, - VkDisplayPropertiesKHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceDisplayPropertiesKHR( physicalDevice, pPropertyCount, pProperties ); - } - - VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR( VkPhysicalDevice physicalDevice, - uint32_t * pPropertyCount, - VkDisplayPlanePropertiesKHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( physicalDevice, pPropertyCount, pProperties ); - } - - VkResult vkGetDisplayPlaneSupportedDisplaysKHR( VkPhysicalDevice physicalDevice, - uint32_t planeIndex, - uint32_t * pDisplayCount, - VkDisplayKHR * pDisplays ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDisplayPlaneSupportedDisplaysKHR( physicalDevice, planeIndex, pDisplayCount, pDisplays ); - } - - VkResult vkGetDisplayModePropertiesKHR( VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t * pPropertyCount, - VkDisplayModePropertiesKHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDisplayModePropertiesKHR( physicalDevice, display, pPropertyCount, pProperties ); - } - - VkResult vkCreateDisplayModeKHR( VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - const VkDisplayModeCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDisplayModeKHR * pMode ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDisplayModeKHR( physicalDevice, display, pCreateInfo, pAllocator, pMode ); - } - - VkResult vkGetDisplayPlaneCapabilitiesKHR( VkPhysicalDevice physicalDevice, - VkDisplayModeKHR mode, - uint32_t planeIndex, - VkDisplayPlaneCapabilitiesKHR * pCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDisplayPlaneCapabilitiesKHR( physicalDevice, mode, planeIndex, pCapabilities ); - } - - VkResult vkCreateDisplayPlaneSurfaceKHR( VkInstance instance, - const VkDisplaySurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDisplayPlaneSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } - - //=== VK_KHR_display_swapchain === - - VkResult vkCreateSharedSwapchainsKHR( VkDevice device, - uint32_t swapchainCount, - const VkSwapchainCreateInfoKHR * pCreateInfos, - const VkAllocationCallbacks * pAllocator, - VkSwapchainKHR * pSwapchains ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSharedSwapchainsKHR( device, swapchainCount, pCreateInfos, pAllocator, pSwapchains ); - } - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VkResult vkCreateXlibSurfaceKHR( VkInstance instance, - const VkXlibSurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateXlibSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - Display * dpy, - VisualID visualID ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceXlibPresentationSupportKHR( physicalDevice, queueFamilyIndex, dpy, visualID ); - } -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VkResult vkCreateXcbSurfaceKHR( VkInstance instance, - const VkXcbSurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateXcbSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - xcb_connection_t * connection, - xcb_visualid_t visual_id ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceXcbPresentationSupportKHR( physicalDevice, queueFamilyIndex, connection, visual_id ); - } -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VkResult vkCreateWaylandSurfaceKHR( VkInstance instance, - const VkWaylandSurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateWaylandSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - struct wl_display * display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceWaylandPresentationSupportKHR( physicalDevice, queueFamilyIndex, display ); - } -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - VkResult vkCreateAndroidSurfaceKHR( VkInstance instance, - const VkAndroidSurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateAndroidSurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VkResult vkCreateWin32SurfaceKHR( VkInstance instance, - const VkWin32SurfaceCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateWin32SurfaceKHR( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceWin32PresentationSupportKHR( physicalDevice, queueFamilyIndex ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - VkResult vkCreateDebugReportCallbackEXT( VkInstance instance, - const VkDebugReportCallbackCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDebugReportCallbackEXT * pCallback ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDebugReportCallbackEXT( instance, pCreateInfo, pAllocator, pCallback ); - } - - void vkDestroyDebugReportCallbackEXT( VkInstance instance, - VkDebugReportCallbackEXT callback, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDebugReportCallbackEXT( instance, callback, pAllocator ); - } - - void vkDebugReportMessageEXT( VkInstance instance, - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char * pLayerPrefix, - const char * pMessage ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDebugReportMessageEXT( instance, flags, objectType, object, location, messageCode, pLayerPrefix, pMessage ); - } - - //=== VK_EXT_debug_marker === - - VkResult vkDebugMarkerSetObjectTagEXT( VkDevice device, const VkDebugMarkerObjectTagInfoEXT * pTagInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDebugMarkerSetObjectTagEXT( device, pTagInfo ); - } - - VkResult vkDebugMarkerSetObjectNameEXT( VkDevice device, const VkDebugMarkerObjectNameInfoEXT * pNameInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDebugMarkerSetObjectNameEXT( device, pNameInfo ); - } - - void vkCmdDebugMarkerBeginEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT * pMarkerInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDebugMarkerBeginEXT( commandBuffer, pMarkerInfo ); - } - - void vkCmdDebugMarkerEndEXT( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDebugMarkerEndEXT( commandBuffer ); - } - - void vkCmdDebugMarkerInsertEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT * pMarkerInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDebugMarkerInsertEXT( commandBuffer, pMarkerInfo ); - } - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VkResult vkGetPhysicalDeviceVideoCapabilitiesKHR( VkPhysicalDevice physicalDevice, - const VkVideoProfileInfoKHR * pVideoProfile, - VkVideoCapabilitiesKHR * pCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceVideoCapabilitiesKHR( physicalDevice, pVideoProfile, pCapabilities ); - } - - VkResult vkGetPhysicalDeviceVideoFormatPropertiesKHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceVideoFormatInfoKHR * pVideoFormatInfo, - uint32_t * pVideoFormatPropertyCount, - VkVideoFormatPropertiesKHR * pVideoFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceVideoFormatPropertiesKHR( physicalDevice, pVideoFormatInfo, pVideoFormatPropertyCount, pVideoFormatProperties ); - } - - VkResult vkCreateVideoSessionKHR( VkDevice device, - const VkVideoSessionCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkVideoSessionKHR * pVideoSession ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateVideoSessionKHR( device, pCreateInfo, pAllocator, pVideoSession ); - } - - void vkDestroyVideoSessionKHR( VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyVideoSessionKHR( device, videoSession, pAllocator ); - } - - VkResult vkGetVideoSessionMemoryRequirementsKHR( VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t * pMemoryRequirementsCount, - VkVideoSessionMemoryRequirementsKHR * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetVideoSessionMemoryRequirementsKHR( device, videoSession, pMemoryRequirementsCount, pMemoryRequirements ); - } - - VkResult vkBindVideoSessionMemoryKHR( VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t bindSessionMemoryInfoCount, - const VkBindVideoSessionMemoryInfoKHR * pBindSessionMemoryInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindVideoSessionMemoryKHR( device, videoSession, bindSessionMemoryInfoCount, pBindSessionMemoryInfos ); - } - - VkResult vkCreateVideoSessionParametersKHR( VkDevice device, - const VkVideoSessionParametersCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkVideoSessionParametersKHR * pVideoSessionParameters ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateVideoSessionParametersKHR( device, pCreateInfo, pAllocator, pVideoSessionParameters ); - } - - VkResult vkUpdateVideoSessionParametersKHR( VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkVideoSessionParametersUpdateInfoKHR * pUpdateInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUpdateVideoSessionParametersKHR( device, videoSessionParameters, pUpdateInfo ); - } - - void vkDestroyVideoSessionParametersKHR( VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyVideoSessionParametersKHR( device, videoSessionParameters, pAllocator ); - } - - void vkCmdBeginVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR * pBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginVideoCodingKHR( commandBuffer, pBeginInfo ); - } - - void vkCmdEndVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR * pEndCodingInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndVideoCodingKHR( commandBuffer, pEndCodingInfo ); - } - - void vkCmdControlVideoCodingKHR( VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR * pCodingControlInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdControlVideoCodingKHR( commandBuffer, pCodingControlInfo ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - void vkCmdDecodeVideoKHR( VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR * pFrameInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDecodeVideoKHR( commandBuffer, pFrameInfo ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - void vkCmdBindTransformFeedbackBuffersEXT( VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer * pBuffers, - const VkDeviceSize * pOffsets, - const VkDeviceSize * pSizes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindTransformFeedbackBuffersEXT( commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes ); - } - - void vkCmdBeginTransformFeedbackEXT( VkCommandBuffer commandBuffer, - uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VkBuffer * pCounterBuffers, - const VkDeviceSize * pCounterBufferOffsets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginTransformFeedbackEXT( commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets ); - } - - void vkCmdEndTransformFeedbackEXT( VkCommandBuffer commandBuffer, - uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VkBuffer * pCounterBuffers, - const VkDeviceSize * pCounterBufferOffsets ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndTransformFeedbackEXT( commandBuffer, firstCounterBuffer, counterBufferCount, pCounterBuffers, pCounterBufferOffsets ); - } - - void vkCmdBeginQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginQueryIndexedEXT( commandBuffer, queryPool, query, flags, index ); - } - - void vkCmdEndQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndQueryIndexedEXT( commandBuffer, queryPool, query, index ); - } - - void vkCmdDrawIndirectByteCountEXT( VkCommandBuffer commandBuffer, - uint32_t instanceCount, - uint32_t firstInstance, - VkBuffer counterBuffer, - VkDeviceSize counterBufferOffset, - uint32_t counterOffset, - uint32_t vertexStride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndirectByteCountEXT( commandBuffer, instanceCount, firstInstance, counterBuffer, counterBufferOffset, counterOffset, vertexStride ); - } - - //=== VK_NVX_binary_import === - - VkResult vkCreateCuModuleNVX( VkDevice device, - const VkCuModuleCreateInfoNVX * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkCuModuleNVX * pModule ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateCuModuleNVX( device, pCreateInfo, pAllocator, pModule ); - } - - VkResult vkCreateCuFunctionNVX( VkDevice device, - const VkCuFunctionCreateInfoNVX * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkCuFunctionNVX * pFunction ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateCuFunctionNVX( device, pCreateInfo, pAllocator, pFunction ); - } - - void vkDestroyCuModuleNVX( VkDevice device, VkCuModuleNVX module, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyCuModuleNVX( device, module, pAllocator ); - } - - void vkDestroyCuFunctionNVX( VkDevice device, VkCuFunctionNVX function, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyCuFunctionNVX( device, function, pAllocator ); - } - - void vkCmdCuLaunchKernelNVX( VkCommandBuffer commandBuffer, const VkCuLaunchInfoNVX * pLaunchInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCuLaunchKernelNVX( commandBuffer, pLaunchInfo ); - } - - //=== VK_NVX_image_view_handle === - - uint32_t vkGetImageViewHandleNVX( VkDevice device, const VkImageViewHandleInfoNVX * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageViewHandleNVX( device, pInfo ); - } - - VkResult vkGetImageViewAddressNVX( VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageViewAddressNVX( device, imageView, pProperties ); - } - - //=== VK_AMD_draw_indirect_count === - - void vkCmdDrawIndirectCountAMD( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndirectCountAMD( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - void vkCmdDrawIndexedIndirectCountAMD( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndexedIndirectCountAMD( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - //=== VK_AMD_shader_info === - - VkResult vkGetShaderInfoAMD( VkDevice device, - VkPipeline pipeline, - VkShaderStageFlagBits shaderStage, - VkShaderInfoTypeAMD infoType, - size_t * pInfoSize, - void * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetShaderInfoAMD( device, pipeline, shaderStage, infoType, pInfoSize, pInfo ); - } - - //=== VK_KHR_dynamic_rendering === - - void vkCmdBeginRenderingKHR( VkCommandBuffer commandBuffer, const VkRenderingInfo * pRenderingInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginRenderingKHR( commandBuffer, pRenderingInfo ); - } - - void vkCmdEndRenderingKHR( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndRenderingKHR( commandBuffer ); - } - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - VkResult vkCreateStreamDescriptorSurfaceGGP( VkInstance instance, - const VkStreamDescriptorSurfaceCreateInfoGGP * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateStreamDescriptorSurfaceGGP( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV( VkPhysicalDevice physicalDevice, - VkFormat format, - VkImageType type, - VkImageTiling tiling, - VkImageUsageFlags usage, - VkImageCreateFlags flags, - VkExternalMemoryHandleTypeFlagsNV externalHandleType, - VkExternalImageFormatPropertiesNV * pExternalImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - physicalDevice, format, type, tiling, usage, flags, externalHandleType, pExternalImageFormatProperties ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - - VkResult vkGetMemoryWin32HandleNV( VkDevice device, - VkDeviceMemory memory, - VkExternalMemoryHandleTypeFlagsNV handleType, - HANDLE * pHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryWin32HandleNV( device, memory, handleType, pHandle ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_get_physical_device_properties2 === - - void vkGetPhysicalDeviceFeatures2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 * pFeatures ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFeatures2KHR( physicalDevice, pFeatures ); - } - - void vkGetPhysicalDeviceProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceProperties2KHR( physicalDevice, pProperties ); - } - - void vkGetPhysicalDeviceFormatProperties2KHR( VkPhysicalDevice physicalDevice, - VkFormat format, - VkFormatProperties2 * pFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFormatProperties2KHR( physicalDevice, format, pFormatProperties ); - } - - VkResult vkGetPhysicalDeviceImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VkImageFormatProperties2 * pImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceImageFormatProperties2KHR( physicalDevice, pImageFormatInfo, pImageFormatProperties ); - } - - void vkGetPhysicalDeviceQueueFamilyProperties2KHR( VkPhysicalDevice physicalDevice, - uint32_t * pQueueFamilyPropertyCount, - VkQueueFamilyProperties2 * pQueueFamilyProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceQueueFamilyProperties2KHR( physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties ); - } - - void vkGetPhysicalDeviceMemoryProperties2KHR( VkPhysicalDevice physicalDevice, - VkPhysicalDeviceMemoryProperties2 * pMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceMemoryProperties2KHR( physicalDevice, pMemoryProperties ); - } - - void vkGetPhysicalDeviceSparseImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VkSparseImageFormatProperties2 * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( physicalDevice, pFormatInfo, pPropertyCount, pProperties ); - } - - //=== VK_KHR_device_group === - - void vkGetDeviceGroupPeerMemoryFeaturesKHR( VkDevice device, - uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VkPeerMemoryFeatureFlags * pPeerMemoryFeatures ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceGroupPeerMemoryFeaturesKHR( device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures ); - } - - void vkCmdSetDeviceMaskKHR( VkCommandBuffer commandBuffer, uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDeviceMaskKHR( commandBuffer, deviceMask ); - } - - void vkCmdDispatchBaseKHR( VkCommandBuffer commandBuffer, - uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDispatchBaseKHR( commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - -# if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - VkResult vkCreateViSurfaceNN( VkInstance instance, - const VkViSurfaceCreateInfoNN * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateViSurfaceNN( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_maintenance1 === - - void vkTrimCommandPoolKHR( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags ) const VULKAN_HPP_NOEXCEPT - { - return ::vkTrimCommandPoolKHR( device, commandPool, flags ); - } - - //=== VK_KHR_device_group_creation === - - VkResult vkEnumeratePhysicalDeviceGroupsKHR( VkInstance instance, - uint32_t * pPhysicalDeviceGroupCount, - VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumeratePhysicalDeviceGroupsKHR( instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties ); - } - - //=== VK_KHR_external_memory_capabilities === - - void vkGetPhysicalDeviceExternalBufferPropertiesKHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VkExternalBufferProperties * pExternalBufferProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalBufferPropertiesKHR( physicalDevice, pExternalBufferInfo, pExternalBufferProperties ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - - VkResult vkGetMemoryWin32HandleKHR( VkDevice device, const VkMemoryGetWin32HandleInfoKHR * pGetWin32HandleInfo, HANDLE * pHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryWin32HandleKHR( device, pGetWin32HandleInfo, pHandle ); - } - - VkResult vkGetMemoryWin32HandlePropertiesKHR( VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - HANDLE handle, - VkMemoryWin32HandlePropertiesKHR * pMemoryWin32HandleProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryWin32HandlePropertiesKHR( device, handleType, handle, pMemoryWin32HandleProperties ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - - VkResult vkGetMemoryFdKHR( VkDevice device, const VkMemoryGetFdInfoKHR * pGetFdInfo, int * pFd ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryFdKHR( device, pGetFdInfo, pFd ); - } - - VkResult vkGetMemoryFdPropertiesKHR( VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - int fd, - VkMemoryFdPropertiesKHR * pMemoryFdProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryFdPropertiesKHR( device, handleType, fd, pMemoryFdProperties ); - } - - //=== VK_KHR_external_semaphore_capabilities === - - void vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VkExternalSemaphoreProperties * pExternalSemaphoreProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - - VkResult vkImportSemaphoreWin32HandleKHR( VkDevice device, - const VkImportSemaphoreWin32HandleInfoKHR * pImportSemaphoreWin32HandleInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkImportSemaphoreWin32HandleKHR( device, pImportSemaphoreWin32HandleInfo ); - } - - VkResult - vkGetSemaphoreWin32HandleKHR( VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR * pGetWin32HandleInfo, HANDLE * pHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSemaphoreWin32HandleKHR( device, pGetWin32HandleInfo, pHandle ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - - VkResult vkImportSemaphoreFdKHR( VkDevice device, const VkImportSemaphoreFdInfoKHR * pImportSemaphoreFdInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkImportSemaphoreFdKHR( device, pImportSemaphoreFdInfo ); - } - - VkResult vkGetSemaphoreFdKHR( VkDevice device, const VkSemaphoreGetFdInfoKHR * pGetFdInfo, int * pFd ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSemaphoreFdKHR( device, pGetFdInfo, pFd ); - } - - //=== VK_KHR_push_descriptor === - - void vkCmdPushDescriptorSetKHR( VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipelineLayout layout, - uint32_t set, - uint32_t descriptorWriteCount, - const VkWriteDescriptorSet * pDescriptorWrites ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPushDescriptorSetKHR( commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites ); - } - - void vkCmdPushDescriptorSetWithTemplateKHR( VkCommandBuffer commandBuffer, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - VkPipelineLayout layout, - uint32_t set, - const void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPushDescriptorSetWithTemplateKHR( commandBuffer, descriptorUpdateTemplate, layout, set, pData ); - } - - //=== VK_EXT_conditional_rendering === - - void vkCmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, - const VkConditionalRenderingBeginInfoEXT * pConditionalRenderingBegin ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginConditionalRenderingEXT( commandBuffer, pConditionalRenderingBegin ); - } - - void vkCmdEndConditionalRenderingEXT( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndConditionalRenderingEXT( commandBuffer ); - } - - //=== VK_KHR_descriptor_update_template === - - VkResult vkCreateDescriptorUpdateTemplateKHR( VkDevice device, - const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDescriptorUpdateTemplateKHR( device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate ); - } - - void vkDestroyDescriptorUpdateTemplateKHR( VkDevice device, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDescriptorUpdateTemplateKHR( device, descriptorUpdateTemplate, pAllocator ); - } - - void vkUpdateDescriptorSetWithTemplateKHR( VkDevice device, - VkDescriptorSet descriptorSet, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUpdateDescriptorSetWithTemplateKHR( device, descriptorSet, descriptorUpdateTemplate, pData ); - } - - //=== VK_NV_clip_space_w_scaling === - - void vkCmdSetViewportWScalingNV( VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkViewportWScalingNV * pViewportWScalings ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetViewportWScalingNV( commandBuffer, firstViewport, viewportCount, pViewportWScalings ); - } - - //=== VK_EXT_direct_mode_display === - - VkResult vkReleaseDisplayEXT( VkPhysicalDevice physicalDevice, VkDisplayKHR display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkReleaseDisplayEXT( physicalDevice, display ); - } - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - - VkResult vkAcquireXlibDisplayEXT( VkPhysicalDevice physicalDevice, Display * dpy, VkDisplayKHR display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireXlibDisplayEXT( physicalDevice, dpy, display ); - } - - VkResult vkGetRandROutputDisplayEXT( VkPhysicalDevice physicalDevice, Display * dpy, RROutput rrOutput, VkDisplayKHR * pDisplay ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRandROutputDisplayEXT( physicalDevice, dpy, rrOutput, pDisplay ); - } -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - - VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT( VkPhysicalDevice physicalDevice, - VkSurfaceKHR surface, - VkSurfaceCapabilities2EXT * pSurfaceCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceCapabilities2EXT( physicalDevice, surface, pSurfaceCapabilities ); - } - - //=== VK_EXT_display_control === - - VkResult vkDisplayPowerControlEXT( VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT * pDisplayPowerInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDisplayPowerControlEXT( device, display, pDisplayPowerInfo ); - } - - VkResult vkRegisterDeviceEventEXT( VkDevice device, - const VkDeviceEventInfoEXT * pDeviceEventInfo, - const VkAllocationCallbacks * pAllocator, - VkFence * pFence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkRegisterDeviceEventEXT( device, pDeviceEventInfo, pAllocator, pFence ); - } - - VkResult vkRegisterDisplayEventEXT( VkDevice device, - VkDisplayKHR display, - const VkDisplayEventInfoEXT * pDisplayEventInfo, - const VkAllocationCallbacks * pAllocator, - VkFence * pFence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkRegisterDisplayEventEXT( device, display, pDisplayEventInfo, pAllocator, pFence ); - } - - VkResult vkGetSwapchainCounterEXT( VkDevice device, - VkSwapchainKHR swapchain, - VkSurfaceCounterFlagBitsEXT counter, - uint64_t * pCounterValue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSwapchainCounterEXT( device, swapchain, counter, pCounterValue ); - } - - //=== VK_GOOGLE_display_timing === - - VkResult vkGetRefreshCycleDurationGOOGLE( VkDevice device, - VkSwapchainKHR swapchain, - VkRefreshCycleDurationGOOGLE * pDisplayTimingProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRefreshCycleDurationGOOGLE( device, swapchain, pDisplayTimingProperties ); - } - - VkResult vkGetPastPresentationTimingGOOGLE( VkDevice device, - VkSwapchainKHR swapchain, - uint32_t * pPresentationTimingCount, - VkPastPresentationTimingGOOGLE * pPresentationTimings ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPastPresentationTimingGOOGLE( device, swapchain, pPresentationTimingCount, pPresentationTimings ); - } - - //=== VK_EXT_discard_rectangles === - - void vkCmdSetDiscardRectangleEXT( VkCommandBuffer commandBuffer, - uint32_t firstDiscardRectangle, - uint32_t discardRectangleCount, - const VkRect2D * pDiscardRectangles ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDiscardRectangleEXT( commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles ); - } - - //=== VK_EXT_hdr_metadata === - - void vkSetHdrMetadataEXT( VkDevice device, - uint32_t swapchainCount, - const VkSwapchainKHR * pSwapchains, - const VkHdrMetadataEXT * pMetadata ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetHdrMetadataEXT( device, swapchainCount, pSwapchains, pMetadata ); - } - - //=== VK_KHR_create_renderpass2 === - - VkResult vkCreateRenderPass2KHR( VkDevice device, - const VkRenderPassCreateInfo2 * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkRenderPass * pRenderPass ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateRenderPass2KHR( device, pCreateInfo, pAllocator, pRenderPass ); - } - - void vkCmdBeginRenderPass2KHR( VkCommandBuffer commandBuffer, - const VkRenderPassBeginInfo * pRenderPassBegin, - const VkSubpassBeginInfo * pSubpassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginRenderPass2KHR( commandBuffer, pRenderPassBegin, pSubpassBeginInfo ); - } - - void vkCmdNextSubpass2KHR( VkCommandBuffer commandBuffer, - const VkSubpassBeginInfo * pSubpassBeginInfo, - const VkSubpassEndInfo * pSubpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdNextSubpass2KHR( commandBuffer, pSubpassBeginInfo, pSubpassEndInfo ); - } - - void vkCmdEndRenderPass2KHR( VkCommandBuffer commandBuffer, const VkSubpassEndInfo * pSubpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndRenderPass2KHR( commandBuffer, pSubpassEndInfo ); - } - - //=== VK_KHR_shared_presentable_image === - - VkResult vkGetSwapchainStatusKHR( VkDevice device, VkSwapchainKHR swapchain ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSwapchainStatusKHR( device, swapchain ); - } - - //=== VK_KHR_external_fence_capabilities === - - void vkGetPhysicalDeviceExternalFencePropertiesKHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VkExternalFenceProperties * pExternalFenceProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceExternalFencePropertiesKHR( physicalDevice, pExternalFenceInfo, pExternalFenceProperties ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - - VkResult vkImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR * pImportFenceWin32HandleInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkImportFenceWin32HandleKHR( device, pImportFenceWin32HandleInfo ); - } - - VkResult vkGetFenceWin32HandleKHR( VkDevice device, const VkFenceGetWin32HandleInfoKHR * pGetWin32HandleInfo, HANDLE * pHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetFenceWin32HandleKHR( device, pGetWin32HandleInfo, pHandle ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - - VkResult vkImportFenceFdKHR( VkDevice device, const VkImportFenceFdInfoKHR * pImportFenceFdInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkImportFenceFdKHR( device, pImportFenceFdInfo ); - } - - VkResult vkGetFenceFdKHR( VkDevice device, const VkFenceGetFdInfoKHR * pGetFdInfo, int * pFd ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetFenceFdKHR( device, pGetFdInfo, pFd ); - } - - //=== VK_KHR_performance_query === - - VkResult - vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - uint32_t * pCounterCount, - VkPerformanceCounterKHR * pCounters, - VkPerformanceCounterDescriptionKHR * pCounterDescriptions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions ); - } - - void vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( VkPhysicalDevice physicalDevice, - const VkQueryPoolPerformanceCreateInfoKHR * pPerformanceQueryCreateInfo, - uint32_t * pNumPasses ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( physicalDevice, pPerformanceQueryCreateInfo, pNumPasses ); - } - - VkResult vkAcquireProfilingLockKHR( VkDevice device, const VkAcquireProfilingLockInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireProfilingLockKHR( device, pInfo ); - } - - void vkReleaseProfilingLockKHR( VkDevice device ) const VULKAN_HPP_NOEXCEPT - { - return ::vkReleaseProfilingLockKHR( device ); - } - - //=== VK_KHR_get_surface_capabilities2 === - - VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VkSurfaceCapabilities2KHR * pSurfaceCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceCapabilities2KHR( physicalDevice, pSurfaceInfo, pSurfaceCapabilities ); - } - - VkResult vkGetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pSurfaceFormatCount, - VkSurfaceFormat2KHR * pSurfaceFormats ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfaceFormats2KHR( physicalDevice, pSurfaceInfo, pSurfaceFormatCount, pSurfaceFormats ); - } - - //=== VK_KHR_get_display_properties2 === - - VkResult vkGetPhysicalDeviceDisplayProperties2KHR( VkPhysicalDevice physicalDevice, - uint32_t * pPropertyCount, - VkDisplayProperties2KHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceDisplayProperties2KHR( physicalDevice, pPropertyCount, pProperties ); - } - - VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR( VkPhysicalDevice physicalDevice, - uint32_t * pPropertyCount, - VkDisplayPlaneProperties2KHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( physicalDevice, pPropertyCount, pProperties ); - } - - VkResult vkGetDisplayModeProperties2KHR( VkPhysicalDevice physicalDevice, - VkDisplayKHR display, - uint32_t * pPropertyCount, - VkDisplayModeProperties2KHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDisplayModeProperties2KHR( physicalDevice, display, pPropertyCount, pProperties ); - } - - VkResult vkGetDisplayPlaneCapabilities2KHR( VkPhysicalDevice physicalDevice, - const VkDisplayPlaneInfo2KHR * pDisplayPlaneInfo, - VkDisplayPlaneCapabilities2KHR * pCapabilities ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDisplayPlaneCapabilities2KHR( physicalDevice, pDisplayPlaneInfo, pCapabilities ); - } - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - VkResult vkCreateIOSSurfaceMVK( VkInstance instance, - const VkIOSSurfaceCreateInfoMVK * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateIOSSurfaceMVK( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - VkResult vkCreateMacOSSurfaceMVK( VkInstance instance, - const VkMacOSSurfaceCreateInfoMVK * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateMacOSSurfaceMVK( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - VkResult vkSetDebugUtilsObjectNameEXT( VkDevice device, const VkDebugUtilsObjectNameInfoEXT * pNameInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetDebugUtilsObjectNameEXT( device, pNameInfo ); - } - - VkResult vkSetDebugUtilsObjectTagEXT( VkDevice device, const VkDebugUtilsObjectTagInfoEXT * pTagInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetDebugUtilsObjectTagEXT( device, pTagInfo ); - } - - void vkQueueBeginDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT * pLabelInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueBeginDebugUtilsLabelEXT( queue, pLabelInfo ); - } - - void vkQueueEndDebugUtilsLabelEXT( VkQueue queue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueEndDebugUtilsLabelEXT( queue ); - } - - void vkQueueInsertDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT * pLabelInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueInsertDebugUtilsLabelEXT( queue, pLabelInfo ); - } - - void vkCmdBeginDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT * pLabelInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBeginDebugUtilsLabelEXT( commandBuffer, pLabelInfo ); - } - - void vkCmdEndDebugUtilsLabelEXT( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEndDebugUtilsLabelEXT( commandBuffer ); - } - - void vkCmdInsertDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT * pLabelInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdInsertDebugUtilsLabelEXT( commandBuffer, pLabelInfo ); - } - - VkResult vkCreateDebugUtilsMessengerEXT( VkInstance instance, - const VkDebugUtilsMessengerCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkDebugUtilsMessengerEXT * pMessenger ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDebugUtilsMessengerEXT( instance, pCreateInfo, pAllocator, pMessenger ); - } - - void vkDestroyDebugUtilsMessengerEXT( VkInstance instance, - VkDebugUtilsMessengerEXT messenger, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDebugUtilsMessengerEXT( instance, messenger, pAllocator ); - } - - void vkSubmitDebugUtilsMessageEXT( VkInstance instance, - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageTypes, - const VkDebugUtilsMessengerCallbackDataEXT * pCallbackData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSubmitDebugUtilsMessageEXT( instance, messageSeverity, messageTypes, pCallbackData ); - } - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - - VkResult vkGetAndroidHardwareBufferPropertiesANDROID( VkDevice device, - const struct AHardwareBuffer * buffer, - VkAndroidHardwareBufferPropertiesANDROID * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetAndroidHardwareBufferPropertiesANDROID( device, buffer, pProperties ); - } - - VkResult vkGetMemoryAndroidHardwareBufferANDROID( VkDevice device, - const VkMemoryGetAndroidHardwareBufferInfoANDROID * pInfo, - struct AHardwareBuffer ** pBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryAndroidHardwareBufferANDROID( device, pInfo, pBuffer ); - } -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - - void vkCmdSetSampleLocationsEXT( VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT * pSampleLocationsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetSampleLocationsEXT( commandBuffer, pSampleLocationsInfo ); - } - - void vkGetPhysicalDeviceMultisamplePropertiesEXT( VkPhysicalDevice physicalDevice, - VkSampleCountFlagBits samples, - VkMultisamplePropertiesEXT * pMultisampleProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceMultisamplePropertiesEXT( physicalDevice, samples, pMultisampleProperties ); - } - - //=== VK_KHR_get_memory_requirements2 === - - void vkGetImageMemoryRequirements2KHR( VkDevice device, - const VkImageMemoryRequirementsInfo2 * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageMemoryRequirements2KHR( device, pInfo, pMemoryRequirements ); - } - - void vkGetBufferMemoryRequirements2KHR( VkDevice device, - const VkBufferMemoryRequirementsInfo2 * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferMemoryRequirements2KHR( device, pInfo, pMemoryRequirements ); - } - - void vkGetImageSparseMemoryRequirements2KHR( VkDevice device, - const VkImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageSparseMemoryRequirements2KHR( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements ); - } - - //=== VK_KHR_acceleration_structure === - - VkResult vkCreateAccelerationStructureKHR( VkDevice device, - const VkAccelerationStructureCreateInfoKHR * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkAccelerationStructureKHR * pAccelerationStructure ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateAccelerationStructureKHR( device, pCreateInfo, pAllocator, pAccelerationStructure ); - } - - void vkDestroyAccelerationStructureKHR( VkDevice device, - VkAccelerationStructureKHR accelerationStructure, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyAccelerationStructureKHR( device, accelerationStructure, pAllocator ); - } - - void vkCmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, - uint32_t infoCount, - const VkAccelerationStructureBuildGeometryInfoKHR * pInfos, - const VkAccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBuildAccelerationStructuresKHR( commandBuffer, infoCount, pInfos, ppBuildRangeInfos ); - } - - void vkCmdBuildAccelerationStructuresIndirectKHR( VkCommandBuffer commandBuffer, - uint32_t infoCount, - const VkAccelerationStructureBuildGeometryInfoKHR * pInfos, - const VkDeviceAddress * pIndirectDeviceAddresses, - const uint32_t * pIndirectStrides, - const uint32_t * const * ppMaxPrimitiveCounts ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBuildAccelerationStructuresIndirectKHR( - commandBuffer, infoCount, pInfos, pIndirectDeviceAddresses, pIndirectStrides, ppMaxPrimitiveCounts ); - } - - VkResult vkBuildAccelerationStructuresKHR( VkDevice device, - VkDeferredOperationKHR deferredOperation, - uint32_t infoCount, - const VkAccelerationStructureBuildGeometryInfoKHR * pInfos, - const VkAccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBuildAccelerationStructuresKHR( device, deferredOperation, infoCount, pInfos, ppBuildRangeInfos ); - } - - VkResult vkCopyAccelerationStructureKHR( VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyAccelerationStructureInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCopyAccelerationStructureKHR( device, deferredOperation, pInfo ); - } - - VkResult vkCopyAccelerationStructureToMemoryKHR( VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyAccelerationStructureToMemoryInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCopyAccelerationStructureToMemoryKHR( device, deferredOperation, pInfo ); - } - - VkResult vkCopyMemoryToAccelerationStructureKHR( VkDevice device, - VkDeferredOperationKHR deferredOperation, - const VkCopyMemoryToAccelerationStructureInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCopyMemoryToAccelerationStructureKHR( device, deferredOperation, pInfo ); - } - - VkResult vkWriteAccelerationStructuresPropertiesKHR( VkDevice device, - uint32_t accelerationStructureCount, - const VkAccelerationStructureKHR * pAccelerationStructures, - VkQueryType queryType, - size_t dataSize, - void * pData, - size_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkWriteAccelerationStructuresPropertiesKHR( device, accelerationStructureCount, pAccelerationStructures, queryType, dataSize, pData, stride ); - } - - void vkCmdCopyAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyAccelerationStructureKHR( commandBuffer, pInfo ); - } - - void vkCmdCopyAccelerationStructureToMemoryKHR( VkCommandBuffer commandBuffer, - const VkCopyAccelerationStructureToMemoryInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyAccelerationStructureToMemoryKHR( commandBuffer, pInfo ); - } - - void vkCmdCopyMemoryToAccelerationStructureKHR( VkCommandBuffer commandBuffer, - const VkCopyMemoryToAccelerationStructureInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyMemoryToAccelerationStructureKHR( commandBuffer, pInfo ); - } - - VkDeviceAddress vkGetAccelerationStructureDeviceAddressKHR( VkDevice device, - const VkAccelerationStructureDeviceAddressInfoKHR * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetAccelerationStructureDeviceAddressKHR( device, pInfo ); - } - - void vkCmdWriteAccelerationStructuresPropertiesKHR( VkCommandBuffer commandBuffer, - uint32_t accelerationStructureCount, - const VkAccelerationStructureKHR * pAccelerationStructures, - VkQueryType queryType, - VkQueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteAccelerationStructuresPropertiesKHR( - commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery ); - } - - void vkGetDeviceAccelerationStructureCompatibilityKHR( VkDevice device, - const VkAccelerationStructureVersionInfoKHR * pVersionInfo, - VkAccelerationStructureCompatibilityKHR * pCompatibility ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceAccelerationStructureCompatibilityKHR( device, pVersionInfo, pCompatibility ); - } - - void vkGetAccelerationStructureBuildSizesKHR( VkDevice device, - VkAccelerationStructureBuildTypeKHR buildType, - const VkAccelerationStructureBuildGeometryInfoKHR * pBuildInfo, - const uint32_t * pMaxPrimitiveCounts, - VkAccelerationStructureBuildSizesInfoKHR * pSizeInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetAccelerationStructureBuildSizesKHR( device, buildType, pBuildInfo, pMaxPrimitiveCounts, pSizeInfo ); - } - - //=== VK_KHR_sampler_ycbcr_conversion === - - VkResult vkCreateSamplerYcbcrConversionKHR( VkDevice device, - const VkSamplerYcbcrConversionCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSamplerYcbcrConversion * pYcbcrConversion ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateSamplerYcbcrConversionKHR( device, pCreateInfo, pAllocator, pYcbcrConversion ); - } - - void vkDestroySamplerYcbcrConversionKHR( VkDevice device, - VkSamplerYcbcrConversion ycbcrConversion, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroySamplerYcbcrConversionKHR( device, ycbcrConversion, pAllocator ); - } - - //=== VK_KHR_bind_memory2 === - - VkResult vkBindBufferMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo * pBindInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindBufferMemory2KHR( device, bindInfoCount, pBindInfos ); - } - - VkResult vkBindImageMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo * pBindInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindImageMemory2KHR( device, bindInfoCount, pBindInfos ); - } - - //=== VK_EXT_image_drm_format_modifier === - - VkResult - vkGetImageDrmFormatModifierPropertiesEXT( VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageDrmFormatModifierPropertiesEXT( device, image, pProperties ); - } - - //=== VK_EXT_validation_cache === - - VkResult vkCreateValidationCacheEXT( VkDevice device, - const VkValidationCacheCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkValidationCacheEXT * pValidationCache ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateValidationCacheEXT( device, pCreateInfo, pAllocator, pValidationCache ); - } - - void - vkDestroyValidationCacheEXT( VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyValidationCacheEXT( device, validationCache, pAllocator ); - } - - VkResult vkMergeValidationCachesEXT( VkDevice device, - VkValidationCacheEXT dstCache, - uint32_t srcCacheCount, - const VkValidationCacheEXT * pSrcCaches ) const VULKAN_HPP_NOEXCEPT - { - return ::vkMergeValidationCachesEXT( device, dstCache, srcCacheCount, pSrcCaches ); - } - - VkResult vkGetValidationCacheDataEXT( VkDevice device, VkValidationCacheEXT validationCache, size_t * pDataSize, void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetValidationCacheDataEXT( device, validationCache, pDataSize, pData ); - } - - //=== VK_NV_shading_rate_image === - - void vkCmdBindShadingRateImageNV( VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindShadingRateImageNV( commandBuffer, imageView, imageLayout ); - } - - void vkCmdSetViewportShadingRatePaletteNV( VkCommandBuffer commandBuffer, - uint32_t firstViewport, - uint32_t viewportCount, - const VkShadingRatePaletteNV * pShadingRatePalettes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetViewportShadingRatePaletteNV( commandBuffer, firstViewport, viewportCount, pShadingRatePalettes ); - } - - void vkCmdSetCoarseSampleOrderNV( VkCommandBuffer commandBuffer, - VkCoarseSampleOrderTypeNV sampleOrderType, - uint32_t customSampleOrderCount, - const VkCoarseSampleOrderCustomNV * pCustomSampleOrders ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetCoarseSampleOrderNV( commandBuffer, sampleOrderType, customSampleOrderCount, pCustomSampleOrders ); - } - - //=== VK_NV_ray_tracing === - - VkResult vkCreateAccelerationStructureNV( VkDevice device, - const VkAccelerationStructureCreateInfoNV * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkAccelerationStructureNV * pAccelerationStructure ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateAccelerationStructureNV( device, pCreateInfo, pAllocator, pAccelerationStructure ); - } - - void vkDestroyAccelerationStructureNV( VkDevice device, - VkAccelerationStructureNV accelerationStructure, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyAccelerationStructureNV( device, accelerationStructure, pAllocator ); - } - - void vkGetAccelerationStructureMemoryRequirementsNV( VkDevice device, - const VkAccelerationStructureMemoryRequirementsInfoNV * pInfo, - VkMemoryRequirements2KHR * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetAccelerationStructureMemoryRequirementsNV( device, pInfo, pMemoryRequirements ); - } - - VkResult vkBindAccelerationStructureMemoryNV( VkDevice device, - uint32_t bindInfoCount, - const VkBindAccelerationStructureMemoryInfoNV * pBindInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkBindAccelerationStructureMemoryNV( device, bindInfoCount, pBindInfos ); - } - - void vkCmdBuildAccelerationStructureNV( VkCommandBuffer commandBuffer, - const VkAccelerationStructureInfoNV * pInfo, - VkBuffer instanceData, - VkDeviceSize instanceOffset, - VkBool32 update, - VkAccelerationStructureNV dst, - VkAccelerationStructureNV src, - VkBuffer scratch, - VkDeviceSize scratchOffset ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBuildAccelerationStructureNV( commandBuffer, pInfo, instanceData, instanceOffset, update, dst, src, scratch, scratchOffset ); - } - - void vkCmdCopyAccelerationStructureNV( VkCommandBuffer commandBuffer, - VkAccelerationStructureNV dst, - VkAccelerationStructureNV src, - VkCopyAccelerationStructureModeKHR mode ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyAccelerationStructureNV( commandBuffer, dst, src, mode ); - } - - void vkCmdTraceRaysNV( VkCommandBuffer commandBuffer, - VkBuffer raygenShaderBindingTableBuffer, - VkDeviceSize raygenShaderBindingOffset, - VkBuffer missShaderBindingTableBuffer, - VkDeviceSize missShaderBindingOffset, - VkDeviceSize missShaderBindingStride, - VkBuffer hitShaderBindingTableBuffer, - VkDeviceSize hitShaderBindingOffset, - VkDeviceSize hitShaderBindingStride, - VkBuffer callableShaderBindingTableBuffer, - VkDeviceSize callableShaderBindingOffset, - VkDeviceSize callableShaderBindingStride, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdTraceRaysNV( commandBuffer, - raygenShaderBindingTableBuffer, - raygenShaderBindingOffset, - missShaderBindingTableBuffer, - missShaderBindingOffset, - missShaderBindingStride, - hitShaderBindingTableBuffer, - hitShaderBindingOffset, - hitShaderBindingStride, - callableShaderBindingTableBuffer, - callableShaderBindingOffset, - callableShaderBindingStride, - width, - height, - depth ); - } - - VkResult vkCreateRayTracingPipelinesNV( VkDevice device, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkRayTracingPipelineCreateInfoNV * pCreateInfos, - const VkAllocationCallbacks * pAllocator, - VkPipeline * pPipelines ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateRayTracingPipelinesNV( device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines ); - } - - VkResult vkGetRayTracingShaderGroupHandlesNV( - VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRayTracingShaderGroupHandlesNV( device, pipeline, firstGroup, groupCount, dataSize, pData ); - } - - VkResult vkGetAccelerationStructureHandleNV( VkDevice device, - VkAccelerationStructureNV accelerationStructure, - size_t dataSize, - void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetAccelerationStructureHandleNV( device, accelerationStructure, dataSize, pData ); - } - - void vkCmdWriteAccelerationStructuresPropertiesNV( VkCommandBuffer commandBuffer, - uint32_t accelerationStructureCount, - const VkAccelerationStructureNV * pAccelerationStructures, - VkQueryType queryType, - VkQueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteAccelerationStructuresPropertiesNV( - commandBuffer, accelerationStructureCount, pAccelerationStructures, queryType, queryPool, firstQuery ); - } - - VkResult vkCompileDeferredNV( VkDevice device, VkPipeline pipeline, uint32_t shader ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCompileDeferredNV( device, pipeline, shader ); - } - - //=== VK_KHR_maintenance3 === - - void vkGetDescriptorSetLayoutSupportKHR( VkDevice device, - const VkDescriptorSetLayoutCreateInfo * pCreateInfo, - VkDescriptorSetLayoutSupport * pSupport ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDescriptorSetLayoutSupportKHR( device, pCreateInfo, pSupport ); - } - - //=== VK_KHR_draw_indirect_count === - - void vkCmdDrawIndirectCountKHR( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndirectCountKHR( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - void vkCmdDrawIndexedIndirectCountKHR( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawIndexedIndirectCountKHR( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - //=== VK_EXT_external_memory_host === - - VkResult vkGetMemoryHostPointerPropertiesEXT( VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - const void * pHostPointer, - VkMemoryHostPointerPropertiesEXT * pMemoryHostPointerProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryHostPointerPropertiesEXT( device, handleType, pHostPointer, pMemoryHostPointerProperties ); - } - - //=== VK_AMD_buffer_marker === - - void vkCmdWriteBufferMarkerAMD( VkCommandBuffer commandBuffer, - VkPipelineStageFlagBits pipelineStage, - VkBuffer dstBuffer, - VkDeviceSize dstOffset, - uint32_t marker ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteBufferMarkerAMD( commandBuffer, pipelineStage, dstBuffer, dstOffset, marker ); - } - - //=== VK_EXT_calibrated_timestamps === - - VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( VkPhysicalDevice physicalDevice, - uint32_t * pTimeDomainCount, - VkTimeDomainEXT * pTimeDomains ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( physicalDevice, pTimeDomainCount, pTimeDomains ); - } - - VkResult vkGetCalibratedTimestampsEXT( VkDevice device, - uint32_t timestampCount, - const VkCalibratedTimestampInfoEXT * pTimestampInfos, - uint64_t * pTimestamps, - uint64_t * pMaxDeviation ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetCalibratedTimestampsEXT( device, timestampCount, pTimestampInfos, pTimestamps, pMaxDeviation ); - } - - //=== VK_NV_mesh_shader === - - void vkCmdDrawMeshTasksNV( VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksNV( commandBuffer, taskCount, firstTask ); - } - - void vkCmdDrawMeshTasksIndirectNV( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksIndirectNV( commandBuffer, buffer, offset, drawCount, stride ); - } - - void vkCmdDrawMeshTasksIndirectCountNV( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksIndirectCountNV( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - //=== VK_NV_scissor_exclusive === - - void vkCmdSetExclusiveScissorNV( VkCommandBuffer commandBuffer, - uint32_t firstExclusiveScissor, - uint32_t exclusiveScissorCount, - const VkRect2D * pExclusiveScissors ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetExclusiveScissorNV( commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors ); - } - - //=== VK_NV_device_diagnostic_checkpoints === - - void vkCmdSetCheckpointNV( VkCommandBuffer commandBuffer, const void * pCheckpointMarker ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetCheckpointNV( commandBuffer, pCheckpointMarker ); - } - - void vkGetQueueCheckpointDataNV( VkQueue queue, uint32_t * pCheckpointDataCount, VkCheckpointDataNV * pCheckpointData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetQueueCheckpointDataNV( queue, pCheckpointDataCount, pCheckpointData ); - } - - //=== VK_KHR_timeline_semaphore === - - VkResult vkGetSemaphoreCounterValueKHR( VkDevice device, VkSemaphore semaphore, uint64_t * pValue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSemaphoreCounterValueKHR( device, semaphore, pValue ); - } - - VkResult vkWaitSemaphoresKHR( VkDevice device, const VkSemaphoreWaitInfo * pWaitInfo, uint64_t timeout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkWaitSemaphoresKHR( device, pWaitInfo, timeout ); - } - - VkResult vkSignalSemaphoreKHR( VkDevice device, const VkSemaphoreSignalInfo * pSignalInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSignalSemaphoreKHR( device, pSignalInfo ); - } - - //=== VK_INTEL_performance_query === - - VkResult vkInitializePerformanceApiINTEL( VkDevice device, const VkInitializePerformanceApiInfoINTEL * pInitializeInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkInitializePerformanceApiINTEL( device, pInitializeInfo ); - } - - void vkUninitializePerformanceApiINTEL( VkDevice device ) const VULKAN_HPP_NOEXCEPT - { - return ::vkUninitializePerformanceApiINTEL( device ); - } - - VkResult vkCmdSetPerformanceMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL * pMarkerInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPerformanceMarkerINTEL( commandBuffer, pMarkerInfo ); - } - - VkResult vkCmdSetPerformanceStreamMarkerINTEL( VkCommandBuffer commandBuffer, - const VkPerformanceStreamMarkerInfoINTEL * pMarkerInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPerformanceStreamMarkerINTEL( commandBuffer, pMarkerInfo ); - } - - VkResult vkCmdSetPerformanceOverrideINTEL( VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL * pOverrideInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPerformanceOverrideINTEL( commandBuffer, pOverrideInfo ); - } - - VkResult vkAcquirePerformanceConfigurationINTEL( VkDevice device, - const VkPerformanceConfigurationAcquireInfoINTEL * pAcquireInfo, - VkPerformanceConfigurationINTEL * pConfiguration ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquirePerformanceConfigurationINTEL( device, pAcquireInfo, pConfiguration ); - } - - VkResult vkReleasePerformanceConfigurationINTEL( VkDevice device, VkPerformanceConfigurationINTEL configuration ) const VULKAN_HPP_NOEXCEPT - { - return ::vkReleasePerformanceConfigurationINTEL( device, configuration ); - } - - VkResult vkQueueSetPerformanceConfigurationINTEL( VkQueue queue, VkPerformanceConfigurationINTEL configuration ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueSetPerformanceConfigurationINTEL( queue, configuration ); - } - - VkResult - vkGetPerformanceParameterINTEL( VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL * pValue ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPerformanceParameterINTEL( device, parameter, pValue ); - } - - //=== VK_AMD_display_native_hdr === - - void vkSetLocalDimmingAMD( VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetLocalDimmingAMD( device, swapChain, localDimmingEnable ); - } - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - VkResult vkCreateImagePipeSurfaceFUCHSIA( VkInstance instance, - const VkImagePipeSurfaceCreateInfoFUCHSIA * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateImagePipeSurfaceFUCHSIA( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - VkResult vkCreateMetalSurfaceEXT( VkInstance instance, - const VkMetalSurfaceCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateMetalSurfaceEXT( instance, pCreateInfo, pAllocator, pSurface ); - } -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - - VkResult vkGetPhysicalDeviceFragmentShadingRatesKHR( VkPhysicalDevice physicalDevice, - uint32_t * pFragmentShadingRateCount, - VkPhysicalDeviceFragmentShadingRateKHR * pFragmentShadingRates ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceFragmentShadingRatesKHR( physicalDevice, pFragmentShadingRateCount, pFragmentShadingRates ); - } - - void vkCmdSetFragmentShadingRateKHR( VkCommandBuffer commandBuffer, - const VkExtent2D * pFragmentSize, - const VkFragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetFragmentShadingRateKHR( commandBuffer, pFragmentSize, combinerOps ); - } - - //=== VK_EXT_buffer_device_address === - - VkDeviceAddress vkGetBufferDeviceAddressEXT( VkDevice device, const VkBufferDeviceAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferDeviceAddressEXT( device, pInfo ); - } - - //=== VK_EXT_tooling_info === - - VkResult vkGetPhysicalDeviceToolPropertiesEXT( VkPhysicalDevice physicalDevice, - uint32_t * pToolCount, - VkPhysicalDeviceToolProperties * pToolProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceToolPropertiesEXT( physicalDevice, pToolCount, pToolProperties ); - } - - //=== VK_KHR_present_wait === - - VkResult vkWaitForPresentKHR( VkDevice device, VkSwapchainKHR swapchain, uint64_t presentId, uint64_t timeout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkWaitForPresentKHR( device, swapchain, presentId, timeout ); - } - - //=== VK_NV_cooperative_matrix === - - VkResult vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( VkPhysicalDevice physicalDevice, - uint32_t * pPropertyCount, - VkCooperativeMatrixPropertiesNV * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( physicalDevice, pPropertyCount, pProperties ); - } - - //=== VK_NV_coverage_reduction_mode === - - VkResult vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - VkPhysicalDevice physicalDevice, uint32_t * pCombinationCount, VkFramebufferMixedSamplesCombinationNV * pCombinations ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( physicalDevice, pCombinationCount, pCombinations ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - VkResult vkGetPhysicalDeviceSurfacePresentModes2EXT( VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pPresentModeCount, - VkPresentModeKHR * pPresentModes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceSurfacePresentModes2EXT( physicalDevice, pSurfaceInfo, pPresentModeCount, pPresentModes ); - } - - VkResult vkAcquireFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireFullScreenExclusiveModeEXT( device, swapchain ); - } - - VkResult vkReleaseFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain ) const VULKAN_HPP_NOEXCEPT - { - return ::vkReleaseFullScreenExclusiveModeEXT( device, swapchain ); - } - - VkResult vkGetDeviceGroupSurfacePresentModes2EXT( VkDevice device, - const VkPhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VkDeviceGroupPresentModeFlagsKHR * pModes ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceGroupSurfacePresentModes2EXT( device, pSurfaceInfo, pModes ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - - VkResult vkCreateHeadlessSurfaceEXT( VkInstance instance, - const VkHeadlessSurfaceCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateHeadlessSurfaceEXT( instance, pCreateInfo, pAllocator, pSurface ); - } - - //=== VK_KHR_buffer_device_address === - - VkDeviceAddress vkGetBufferDeviceAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferDeviceAddressKHR( device, pInfo ); - } - - uint64_t vkGetBufferOpaqueCaptureAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferOpaqueCaptureAddressKHR( device, pInfo ); - } - - uint64_t vkGetDeviceMemoryOpaqueCaptureAddressKHR( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo * pInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceMemoryOpaqueCaptureAddressKHR( device, pInfo ); - } - - //=== VK_EXT_line_rasterization === - - void vkCmdSetLineStippleEXT( VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetLineStippleEXT( commandBuffer, lineStippleFactor, lineStipplePattern ); - } - - //=== VK_EXT_host_query_reset === - - void vkResetQueryPoolEXT( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - return ::vkResetQueryPoolEXT( device, queryPool, firstQuery, queryCount ); - } - - //=== VK_EXT_extended_dynamic_state === - - void vkCmdSetCullModeEXT( VkCommandBuffer commandBuffer, VkCullModeFlags cullMode ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetCullModeEXT( commandBuffer, cullMode ); - } - - void vkCmdSetFrontFaceEXT( VkCommandBuffer commandBuffer, VkFrontFace frontFace ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetFrontFaceEXT( commandBuffer, frontFace ); - } - - void vkCmdSetPrimitiveTopologyEXT( VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPrimitiveTopologyEXT( commandBuffer, primitiveTopology ); - } - - void vkCmdSetViewportWithCountEXT( VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport * pViewports ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetViewportWithCountEXT( commandBuffer, viewportCount, pViewports ); - } - - void vkCmdSetScissorWithCountEXT( VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D * pScissors ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetScissorWithCountEXT( commandBuffer, scissorCount, pScissors ); - } - - void vkCmdBindVertexBuffers2EXT( VkCommandBuffer commandBuffer, - uint32_t firstBinding, - uint32_t bindingCount, - const VkBuffer * pBuffers, - const VkDeviceSize * pOffsets, - const VkDeviceSize * pSizes, - const VkDeviceSize * pStrides ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindVertexBuffers2EXT( commandBuffer, firstBinding, bindingCount, pBuffers, pOffsets, pSizes, pStrides ); - } - - void vkCmdSetDepthTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthTestEnableEXT( commandBuffer, depthTestEnable ); - } - - void vkCmdSetDepthWriteEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthWriteEnableEXT( commandBuffer, depthWriteEnable ); - } - - void vkCmdSetDepthCompareOpEXT( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthCompareOpEXT( commandBuffer, depthCompareOp ); - } - - void vkCmdSetDepthBoundsTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBoundsTestEnableEXT( commandBuffer, depthBoundsTestEnable ); - } - - void vkCmdSetStencilTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilTestEnableEXT( commandBuffer, stencilTestEnable ); - } - - void vkCmdSetStencilOpEXT( VkCommandBuffer commandBuffer, - VkStencilFaceFlags faceMask, - VkStencilOp failOp, - VkStencilOp passOp, - VkStencilOp depthFailOp, - VkCompareOp compareOp ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetStencilOpEXT( commandBuffer, faceMask, failOp, passOp, depthFailOp, compareOp ); - } - - //=== VK_KHR_deferred_host_operations === - - VkResult vkCreateDeferredOperationKHR( VkDevice device, - const VkAllocationCallbacks * pAllocator, - VkDeferredOperationKHR * pDeferredOperation ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDeferredOperationKHR( device, pAllocator, pDeferredOperation ); - } - - void vkDestroyDeferredOperationKHR( VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyDeferredOperationKHR( device, operation, pAllocator ); - } - - uint32_t vkGetDeferredOperationMaxConcurrencyKHR( VkDevice device, VkDeferredOperationKHR operation ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeferredOperationMaxConcurrencyKHR( device, operation ); - } - - VkResult vkGetDeferredOperationResultKHR( VkDevice device, VkDeferredOperationKHR operation ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeferredOperationResultKHR( device, operation ); - } - - VkResult vkDeferredOperationJoinKHR( VkDevice device, VkDeferredOperationKHR operation ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDeferredOperationJoinKHR( device, operation ); - } - - //=== VK_KHR_pipeline_executable_properties === - - VkResult vkGetPipelineExecutablePropertiesKHR( VkDevice device, - const VkPipelineInfoKHR * pPipelineInfo, - uint32_t * pExecutableCount, - VkPipelineExecutablePropertiesKHR * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPipelineExecutablePropertiesKHR( device, pPipelineInfo, pExecutableCount, pProperties ); - } - - VkResult vkGetPipelineExecutableStatisticsKHR( VkDevice device, - const VkPipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pStatisticCount, - VkPipelineExecutableStatisticKHR * pStatistics ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPipelineExecutableStatisticsKHR( device, pExecutableInfo, pStatisticCount, pStatistics ); - } - - VkResult - vkGetPipelineExecutableInternalRepresentationsKHR( VkDevice device, - const VkPipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pInternalRepresentationCount, - VkPipelineExecutableInternalRepresentationKHR * pInternalRepresentations ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPipelineExecutableInternalRepresentationsKHR( device, pExecutableInfo, pInternalRepresentationCount, pInternalRepresentations ); - } - - //=== VK_NV_device_generated_commands === - - void vkGetGeneratedCommandsMemoryRequirementsNV( VkDevice device, - const VkGeneratedCommandsMemoryRequirementsInfoNV * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetGeneratedCommandsMemoryRequirementsNV( device, pInfo, pMemoryRequirements ); - } - - void vkCmdPreprocessGeneratedCommandsNV( VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV * pGeneratedCommandsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPreprocessGeneratedCommandsNV( commandBuffer, pGeneratedCommandsInfo ); - } - - void vkCmdExecuteGeneratedCommandsNV( VkCommandBuffer commandBuffer, - VkBool32 isPreprocessed, - const VkGeneratedCommandsInfoNV * pGeneratedCommandsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdExecuteGeneratedCommandsNV( commandBuffer, isPreprocessed, pGeneratedCommandsInfo ); - } - - void vkCmdBindPipelineShaderGroupNV( VkCommandBuffer commandBuffer, - VkPipelineBindPoint pipelineBindPoint, - VkPipeline pipeline, - uint32_t groupIndex ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindPipelineShaderGroupNV( commandBuffer, pipelineBindPoint, pipeline, groupIndex ); - } - - VkResult vkCreateIndirectCommandsLayoutNV( VkDevice device, - const VkIndirectCommandsLayoutCreateInfoNV * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkIndirectCommandsLayoutNV * pIndirectCommandsLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateIndirectCommandsLayoutNV( device, pCreateInfo, pAllocator, pIndirectCommandsLayout ); - } - - void vkDestroyIndirectCommandsLayoutNV( VkDevice device, - VkIndirectCommandsLayoutNV indirectCommandsLayout, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyIndirectCommandsLayoutNV( device, indirectCommandsLayout, pAllocator ); - } - - //=== VK_EXT_acquire_drm_display === - - VkResult vkAcquireDrmDisplayEXT( VkPhysicalDevice physicalDevice, int32_t drmFd, VkDisplayKHR display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireDrmDisplayEXT( physicalDevice, drmFd, display ); - } - - VkResult vkGetDrmDisplayEXT( VkPhysicalDevice physicalDevice, int32_t drmFd, uint32_t connectorId, VkDisplayKHR * display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDrmDisplayEXT( physicalDevice, drmFd, connectorId, display ); - } - - //=== VK_EXT_private_data === - - VkResult vkCreatePrivateDataSlotEXT( VkDevice device, - const VkPrivateDataSlotCreateInfo * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkPrivateDataSlot * pPrivateDataSlot ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreatePrivateDataSlotEXT( device, pCreateInfo, pAllocator, pPrivateDataSlot ); - } - - void vkDestroyPrivateDataSlotEXT( VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyPrivateDataSlotEXT( device, privateDataSlot, pAllocator ); - } - - VkResult vkSetPrivateDataEXT( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkSetPrivateDataEXT( device, objectType, objectHandle, privateDataSlot, data ); - } - - void vkGetPrivateDataEXT( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t * pData ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkGetPrivateDataEXT( device, objectType, objectHandle, privateDataSlot, pData ); - } - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - void vkCmdEncodeVideoKHR( VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR * pEncodeInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdEncodeVideoKHR( commandBuffer, pEncodeInfo ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - void vkExportMetalObjectsEXT( VkDevice device, VkExportMetalObjectsInfoEXT * pMetalObjectsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkExportMetalObjectsEXT( device, pMetalObjectsInfo ); - } -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - - void vkCmdSetEvent2KHR( VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo * pDependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetEvent2KHR( commandBuffer, event, pDependencyInfo ); - } - - void vkCmdResetEvent2KHR( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResetEvent2KHR( commandBuffer, event, stageMask ); - } - - void vkCmdWaitEvents2KHR( VkCommandBuffer commandBuffer, - uint32_t eventCount, - const VkEvent * pEvents, - const VkDependencyInfo * pDependencyInfos ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWaitEvents2KHR( commandBuffer, eventCount, pEvents, pDependencyInfos ); - } - - void vkCmdPipelineBarrier2KHR( VkCommandBuffer commandBuffer, const VkDependencyInfo * pDependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdPipelineBarrier2KHR( commandBuffer, pDependencyInfo ); - } - - void vkCmdWriteTimestamp2KHR( VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteTimestamp2KHR( commandBuffer, stage, queryPool, query ); - } - - VkResult vkQueueSubmit2KHR( VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 * pSubmits, VkFence fence ) const VULKAN_HPP_NOEXCEPT - { - return ::vkQueueSubmit2KHR( queue, submitCount, pSubmits, fence ); - } - - void vkCmdWriteBufferMarker2AMD( - VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdWriteBufferMarker2AMD( commandBuffer, stage, dstBuffer, dstOffset, marker ); - } - - void vkGetQueueCheckpointData2NV( VkQueue queue, uint32_t * pCheckpointDataCount, VkCheckpointData2NV * pCheckpointData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetQueueCheckpointData2NV( queue, pCheckpointDataCount, pCheckpointData ); - } - - //=== VK_NV_fragment_shading_rate_enums === - - void vkCmdSetFragmentShadingRateEnumNV( VkCommandBuffer commandBuffer, - VkFragmentShadingRateNV shadingRate, - const VkFragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetFragmentShadingRateEnumNV( commandBuffer, shadingRate, combinerOps ); - } - - //=== VK_EXT_mesh_shader === - - void vkCmdDrawMeshTasksEXT( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksEXT( commandBuffer, groupCountX, groupCountY, groupCountZ ); - } - - void vkCmdDrawMeshTasksIndirectEXT( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride ) const - VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksIndirectEXT( commandBuffer, buffer, offset, drawCount, stride ); - } - - void vkCmdDrawMeshTasksIndirectCountEXT( VkCommandBuffer commandBuffer, - VkBuffer buffer, - VkDeviceSize offset, - VkBuffer countBuffer, - VkDeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMeshTasksIndirectCountEXT( commandBuffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride ); - } - - //=== VK_KHR_copy_commands2 === - - void vkCmdCopyBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 * pCopyBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBuffer2KHR( commandBuffer, pCopyBufferInfo ); - } - - void vkCmdCopyImage2KHR( VkCommandBuffer commandBuffer, const VkCopyImageInfo2 * pCopyImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImage2KHR( commandBuffer, pCopyImageInfo ); - } - - void vkCmdCopyBufferToImage2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 * pCopyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyBufferToImage2KHR( commandBuffer, pCopyBufferToImageInfo ); - } - - void vkCmdCopyImageToBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 * pCopyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdCopyImageToBuffer2KHR( commandBuffer, pCopyImageToBufferInfo ); - } - - void vkCmdBlitImage2KHR( VkCommandBuffer commandBuffer, const VkBlitImageInfo2 * pBlitImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBlitImage2KHR( commandBuffer, pBlitImageInfo ); - } - - void vkCmdResolveImage2KHR( VkCommandBuffer commandBuffer, const VkResolveImageInfo2 * pResolveImageInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdResolveImage2KHR( commandBuffer, pResolveImageInfo ); - } - - //=== VK_EXT_image_compression_control === - - void vkGetImageSubresourceLayout2EXT( VkDevice device, - VkImage image, - const VkImageSubresource2EXT * pSubresource, - VkSubresourceLayout2EXT * pLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetImageSubresourceLayout2EXT( device, image, pSubresource, pLayout ); - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - - VkResult vkAcquireWinrtDisplayNV( VkPhysicalDevice physicalDevice, VkDisplayKHR display ) const VULKAN_HPP_NOEXCEPT - { - return ::vkAcquireWinrtDisplayNV( physicalDevice, display ); - } - - VkResult vkGetWinrtDisplayNV( VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR * pDisplay ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetWinrtDisplayNV( physicalDevice, deviceRelativeId, pDisplay ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VkResult vkCreateDirectFBSurfaceEXT( VkInstance instance, - const VkDirectFBSurfaceCreateInfoEXT * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateDirectFBSurfaceEXT( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 - vkGetPhysicalDeviceDirectFBPresentationSupportEXT( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB * dfb ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceDirectFBPresentationSupportEXT( physicalDevice, queueFamilyIndex, dfb ); - } -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - void vkCmdTraceRaysKHR( VkCommandBuffer commandBuffer, - const VkStridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdTraceRaysKHR( - commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, width, height, depth ); - } - - VkResult vkCreateRayTracingPipelinesKHR( VkDevice device, - VkDeferredOperationKHR deferredOperation, - VkPipelineCache pipelineCache, - uint32_t createInfoCount, - const VkRayTracingPipelineCreateInfoKHR * pCreateInfos, - const VkAllocationCallbacks * pAllocator, - VkPipeline * pPipelines ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateRayTracingPipelinesKHR( device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines ); - } - - VkResult vkGetRayTracingShaderGroupHandlesKHR( - VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRayTracingShaderGroupHandlesKHR( device, pipeline, firstGroup, groupCount, dataSize, pData ); - } - - VkResult vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( - VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void * pData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( device, pipeline, firstGroup, groupCount, dataSize, pData ); - } - - void vkCmdTraceRaysIndirectKHR( VkCommandBuffer commandBuffer, - const VkStridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VkStridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - VkDeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdTraceRaysIndirectKHR( - commandBuffer, pRaygenShaderBindingTable, pMissShaderBindingTable, pHitShaderBindingTable, pCallableShaderBindingTable, indirectDeviceAddress ); - } - - VkDeviceSize vkGetRayTracingShaderGroupStackSizeKHR( VkDevice device, - VkPipeline pipeline, - uint32_t group, - VkShaderGroupShaderKHR groupShader ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetRayTracingShaderGroupStackSizeKHR( device, pipeline, group, groupShader ); - } - - void vkCmdSetRayTracingPipelineStackSizeKHR( VkCommandBuffer commandBuffer, uint32_t pipelineStackSize ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetRayTracingPipelineStackSizeKHR( commandBuffer, pipelineStackSize ); - } - - //=== VK_EXT_vertex_input_dynamic_state === - - void vkCmdSetVertexInputEXT( VkCommandBuffer commandBuffer, - uint32_t vertexBindingDescriptionCount, - const VkVertexInputBindingDescription2EXT * pVertexBindingDescriptions, - uint32_t vertexAttributeDescriptionCount, - const VkVertexInputAttributeDescription2EXT * pVertexAttributeDescriptions ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetVertexInputEXT( - commandBuffer, vertexBindingDescriptionCount, pVertexBindingDescriptions, vertexAttributeDescriptionCount, pVertexAttributeDescriptions ); - } - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - - VkResult vkGetMemoryZirconHandleFUCHSIA( VkDevice device, - const VkMemoryGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryZirconHandleFUCHSIA( device, pGetZirconHandleInfo, pZirconHandle ); - } - - VkResult vkGetMemoryZirconHandlePropertiesFUCHSIA( VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t zirconHandle, - VkMemoryZirconHandlePropertiesFUCHSIA * pMemoryZirconHandleProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryZirconHandlePropertiesFUCHSIA( device, handleType, zirconHandle, pMemoryZirconHandleProperties ); - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - - VkResult vkImportSemaphoreZirconHandleFUCHSIA( VkDevice device, - const VkImportSemaphoreZirconHandleInfoFUCHSIA * pImportSemaphoreZirconHandleInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkImportSemaphoreZirconHandleFUCHSIA( device, pImportSemaphoreZirconHandleInfo ); - } - - VkResult vkGetSemaphoreZirconHandleFUCHSIA( VkDevice device, - const VkSemaphoreGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetSemaphoreZirconHandleFUCHSIA( device, pGetZirconHandleInfo, pZirconHandle ); - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - VkResult vkCreateBufferCollectionFUCHSIA( VkDevice device, - const VkBufferCollectionCreateInfoFUCHSIA * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkBufferCollectionFUCHSIA * pCollection ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateBufferCollectionFUCHSIA( device, pCreateInfo, pAllocator, pCollection ); - } - - VkResult vkSetBufferCollectionImageConstraintsFUCHSIA( VkDevice device, - VkBufferCollectionFUCHSIA collection, - const VkImageConstraintsInfoFUCHSIA * pImageConstraintsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetBufferCollectionImageConstraintsFUCHSIA( device, collection, pImageConstraintsInfo ); - } - - VkResult vkSetBufferCollectionBufferConstraintsFUCHSIA( VkDevice device, - VkBufferCollectionFUCHSIA collection, - const VkBufferConstraintsInfoFUCHSIA * pBufferConstraintsInfo ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetBufferCollectionBufferConstraintsFUCHSIA( device, collection, pBufferConstraintsInfo ); - } - - void vkDestroyBufferCollectionFUCHSIA( VkDevice device, - VkBufferCollectionFUCHSIA collection, - const VkAllocationCallbacks * pAllocator ) const VULKAN_HPP_NOEXCEPT - { - return ::vkDestroyBufferCollectionFUCHSIA( device, collection, pAllocator ); - } - - VkResult vkGetBufferCollectionPropertiesFUCHSIA( VkDevice device, - VkBufferCollectionFUCHSIA collection, - VkBufferCollectionPropertiesFUCHSIA * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetBufferCollectionPropertiesFUCHSIA( device, collection, pProperties ); - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - - VkResult - vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( VkDevice device, VkRenderPass renderpass, VkExtent2D * pMaxWorkgroupSize ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( device, renderpass, pMaxWorkgroupSize ); - } - - void vkCmdSubpassShadingHUAWEI( VkCommandBuffer commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSubpassShadingHUAWEI( commandBuffer ); - } - - //=== VK_HUAWEI_invocation_mask === - - void vkCmdBindInvocationMaskHUAWEI( VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdBindInvocationMaskHUAWEI( commandBuffer, imageView, imageLayout ); - } - - //=== VK_NV_external_memory_rdma === - - VkResult vkGetMemoryRemoteAddressNV( VkDevice device, - const VkMemoryGetRemoteAddressInfoNV * pMemoryGetRemoteAddressInfo, - VkRemoteAddressNV * pAddress ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetMemoryRemoteAddressNV( device, pMemoryGetRemoteAddressInfo, pAddress ); - } - - //=== VK_EXT_pipeline_properties === - - VkResult - vkGetPipelinePropertiesEXT( VkDevice device, const VkPipelineInfoEXT * pPipelineInfo, VkBaseOutStructure * pPipelineProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPipelinePropertiesEXT( device, pPipelineInfo, pPipelineProperties ); - } - - //=== VK_EXT_extended_dynamic_state2 === - - void vkCmdSetPatchControlPointsEXT( VkCommandBuffer commandBuffer, uint32_t patchControlPoints ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPatchControlPointsEXT( commandBuffer, patchControlPoints ); - } - - void vkCmdSetRasterizerDiscardEnableEXT( VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetRasterizerDiscardEnableEXT( commandBuffer, rasterizerDiscardEnable ); - } - - void vkCmdSetDepthBiasEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetDepthBiasEnableEXT( commandBuffer, depthBiasEnable ); - } - - void vkCmdSetLogicOpEXT( VkCommandBuffer commandBuffer, VkLogicOp logicOp ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetLogicOpEXT( commandBuffer, logicOp ); - } - - void vkCmdSetPrimitiveRestartEnableEXT( VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetPrimitiveRestartEnableEXT( commandBuffer, primitiveRestartEnable ); - } - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VkResult vkCreateScreenSurfaceQNX( VkInstance instance, - const VkScreenSurfaceCreateInfoQNX * pCreateInfo, - const VkAllocationCallbacks * pAllocator, - VkSurfaceKHR * pSurface ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCreateScreenSurfaceQNX( instance, pCreateInfo, pAllocator, pSurface ); - } - - VkBool32 vkGetPhysicalDeviceScreenPresentationSupportQNX( VkPhysicalDevice physicalDevice, - uint32_t queueFamilyIndex, - struct _screen_window * window ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetPhysicalDeviceScreenPresentationSupportQNX( physicalDevice, queueFamilyIndex, window ); - } -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - - void vkCmdSetColorWriteEnableEXT( VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32 * pColorWriteEnables ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdSetColorWriteEnableEXT( commandBuffer, attachmentCount, pColorWriteEnables ); - } - - //=== VK_KHR_ray_tracing_maintenance1 === - - void vkCmdTraceRaysIndirect2KHR( VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdTraceRaysIndirect2KHR( commandBuffer, indirectDeviceAddress ); - } - - //=== VK_EXT_multi_draw === - - void vkCmdDrawMultiEXT( VkCommandBuffer commandBuffer, - uint32_t drawCount, - const VkMultiDrawInfoEXT * pVertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMultiEXT( commandBuffer, drawCount, pVertexInfo, instanceCount, firstInstance, stride ); - } - - void vkCmdDrawMultiIndexedEXT( VkCommandBuffer commandBuffer, - uint32_t drawCount, - const VkMultiDrawIndexedInfoEXT * pIndexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - const int32_t * pVertexOffset ) const VULKAN_HPP_NOEXCEPT - { - return ::vkCmdDrawMultiIndexedEXT( commandBuffer, drawCount, pIndexInfo, instanceCount, firstInstance, stride, pVertexOffset ); - } - - //=== VK_EXT_pageable_device_local_memory === - - void vkSetDeviceMemoryPriorityEXT( VkDevice device, VkDeviceMemory memory, float priority ) const VULKAN_HPP_NOEXCEPT - { - return ::vkSetDeviceMemoryPriorityEXT( device, memory, priority ); - } - - //=== VK_KHR_maintenance4 === - - void vkGetDeviceBufferMemoryRequirementsKHR( VkDevice device, - const VkDeviceBufferMemoryRequirements * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceBufferMemoryRequirementsKHR( device, pInfo, pMemoryRequirements ); - } - - void vkGetDeviceImageMemoryRequirementsKHR( VkDevice device, - const VkDeviceImageMemoryRequirements * pInfo, - VkMemoryRequirements2 * pMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceImageMemoryRequirementsKHR( device, pInfo, pMemoryRequirements ); - } - - void vkGetDeviceImageSparseMemoryRequirementsKHR( VkDevice device, - const VkDeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDeviceImageSparseMemoryRequirementsKHR( device, pInfo, pSparseMemoryRequirementCount, pSparseMemoryRequirements ); - } - - //=== VK_VALVE_descriptor_set_host_mapping === - - void vkGetDescriptorSetLayoutHostMappingInfoVALVE( VkDevice device, - const VkDescriptorSetBindingReferenceVALVE * pBindingReference, - VkDescriptorSetLayoutHostMappingInfoVALVE * pHostMapping ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDescriptorSetLayoutHostMappingInfoVALVE( device, pBindingReference, pHostMapping ); - } - - void vkGetDescriptorSetHostMappingVALVE( VkDevice device, VkDescriptorSet descriptorSet, void ** ppData ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDescriptorSetHostMappingVALVE( device, descriptorSet, ppData ); - } - - //=== VK_EXT_shader_module_identifier === - - void vkGetShaderModuleIdentifierEXT( VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT * pIdentifier ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetShaderModuleIdentifierEXT( device, shaderModule, pIdentifier ); - } - - void vkGetShaderModuleCreateInfoIdentifierEXT( VkDevice device, - const VkShaderModuleCreateInfo * pCreateInfo, - VkShaderModuleIdentifierEXT * pIdentifier ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetShaderModuleCreateInfoIdentifierEXT( device, pCreateInfo, pIdentifier ); - } - - //=== VK_QCOM_tile_properties === - - VkResult vkGetFramebufferTilePropertiesQCOM( VkDevice device, - VkFramebuffer framebuffer, - uint32_t * pPropertiesCount, - VkTilePropertiesQCOM * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetFramebufferTilePropertiesQCOM( device, framebuffer, pPropertiesCount, pProperties ); - } - - VkResult vkGetDynamicRenderingTilePropertiesQCOM( VkDevice device, - const VkRenderingInfo * pRenderingInfo, - VkTilePropertiesQCOM * pProperties ) const VULKAN_HPP_NOEXCEPT - { - return ::vkGetDynamicRenderingTilePropertiesQCOM( device, pRenderingInfo, pProperties ); - } - }; -#endif - - class DispatchLoaderDynamic; -#if !defined( VULKAN_HPP_DISPATCH_LOADER_DYNAMIC ) -# if defined( VK_NO_PROTOTYPES ) -# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 -# else -# define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 0 -# endif -#endif - -#if !defined( VULKAN_HPP_STORAGE_API ) -# if defined( VULKAN_HPP_STORAGE_SHARED ) -# if defined( _MSC_VER ) -# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) -# define VULKAN_HPP_STORAGE_API __declspec( dllexport ) -# else -# define VULKAN_HPP_STORAGE_API __declspec( dllimport ) -# endif -# elif defined( __clang__ ) || defined( __GNUC__ ) -# if defined( VULKAN_HPP_STORAGE_SHARED_EXPORT ) -# define VULKAN_HPP_STORAGE_API __attribute__( ( visibility( "default" ) ) ) -# else -# define VULKAN_HPP_STORAGE_API -# endif -# else -# define VULKAN_HPP_STORAGE_API -# pragma warning Unknown import / export semantics -# endif -# else -# define VULKAN_HPP_STORAGE_API -# endif -#endif - -#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER ) -# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 -# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::defaultDispatchLoaderDynamic -# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE \ - namespace VULKAN_HPP_NAMESPACE \ - { \ - VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; \ - } - extern VULKAN_HPP_STORAGE_API DispatchLoaderDynamic defaultDispatchLoaderDynamic; -# else - static inline ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic & getDispatchLoaderStatic() - { - static ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic dls; - return dls; - } -# define VULKAN_HPP_DEFAULT_DISPATCHER ::VULKAN_HPP_NAMESPACE::getDispatchLoaderStatic() -# define VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE -# endif -#endif - -#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ) -# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 -# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderDynamic -# else -# define VULKAN_HPP_DEFAULT_DISPATCHER_TYPE ::VULKAN_HPP_NAMESPACE::DispatchLoaderStatic -# endif -#endif - -#if defined( VULKAN_HPP_NO_DEFAULT_DISPATCHER ) -# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT -# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT -# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT -#else -# define VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT = {} -# define VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT = nullptr -# define VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT = VULKAN_HPP_DEFAULT_DISPATCHER -#endif - -#if !defined( VULKAN_HPP_NO_SMART_HANDLE ) - struct AllocationCallbacks; - - template - class ObjectDestroy - { - public: - ObjectDestroy() = default; - - ObjectDestroy( OwnerType owner, - Optional allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT - : m_owner( owner ) - , m_allocationCallbacks( allocationCallbacks ) - , m_dispatch( &dispatch ) - { - } - - OwnerType getOwner() const VULKAN_HPP_NOEXCEPT - { - return m_owner; - } - Optional getAllocator() const VULKAN_HPP_NOEXCEPT - { - return m_allocationCallbacks; - } - - protected: - template - void destroy( T t ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_owner && m_dispatch ); - m_owner.destroy( t, m_allocationCallbacks, *m_dispatch ); - } - - private: - OwnerType m_owner = {}; - Optional m_allocationCallbacks = nullptr; - Dispatch const * m_dispatch = nullptr; - }; - - class NoParent; - - template - class ObjectDestroy - { - public: - ObjectDestroy() = default; - - ObjectDestroy( Optional allocationCallbacks, - Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT - : m_allocationCallbacks( allocationCallbacks ) - , m_dispatch( &dispatch ) - { - } - - Optional getAllocator() const VULKAN_HPP_NOEXCEPT - { - return m_allocationCallbacks; - } - - protected: - template - void destroy( T t ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_dispatch ); - t.destroy( m_allocationCallbacks, *m_dispatch ); - } - - private: - Optional m_allocationCallbacks = nullptr; - Dispatch const * m_dispatch = nullptr; - }; - - template - class ObjectFree - { - public: - ObjectFree() = default; - - ObjectFree( OwnerType owner, - Optional allocationCallbacks VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT - : m_owner( owner ) - , m_allocationCallbacks( allocationCallbacks ) - , m_dispatch( &dispatch ) - { - } - - OwnerType getOwner() const VULKAN_HPP_NOEXCEPT - { - return m_owner; - } - - Optional getAllocator() const VULKAN_HPP_NOEXCEPT - { - return m_allocationCallbacks; - } - - protected: - template - void destroy( T t ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_owner && m_dispatch ); - ( m_owner.free )( t, m_allocationCallbacks, *m_dispatch ); - } - - private: - OwnerType m_owner = {}; - Optional m_allocationCallbacks = nullptr; - Dispatch const * m_dispatch = nullptr; - }; - - template - class ObjectRelease - { - public: - ObjectRelease() = default; - - ObjectRelease( OwnerType owner, Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT - : m_owner( owner ) - , m_dispatch( &dispatch ) - { - } - - OwnerType getOwner() const VULKAN_HPP_NOEXCEPT - { - return m_owner; - } - - protected: - template - void destroy( T t ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( m_owner && m_dispatch ); - m_owner.release( t, *m_dispatch ); - } - - private: - OwnerType m_owner = {}; - Dispatch const * m_dispatch = nullptr; - }; - - template - class PoolFree - { - public: - PoolFree() = default; - - PoolFree( OwnerType owner, PoolType pool, Dispatch const & dispatch VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT - : m_owner( owner ) - , m_pool( pool ) - , m_dispatch( &dispatch ) - { - } - - OwnerType getOwner() const VULKAN_HPP_NOEXCEPT - { - return m_owner; - } - PoolType getPool() const VULKAN_HPP_NOEXCEPT - { - return m_pool; - } - - protected: - template - void destroy( T t ) VULKAN_HPP_NOEXCEPT - { - ( m_owner.free )( m_pool, t, *m_dispatch ); - } - - private: - OwnerType m_owner = OwnerType(); - PoolType m_pool = PoolType(); - Dispatch const * m_dispatch = nullptr; - }; - -#endif // !VULKAN_HPP_NO_SMART_HANDLE - - //================== - //=== BASE TYPEs === - //================== - - using Bool32 = uint32_t; - using DeviceAddress = uint64_t; - using DeviceSize = uint64_t; - using RemoteAddressNV = void *; - using SampleMask = uint32_t; - -} // namespace VULKAN_HPP_NAMESPACE - -#include -#if !defined( VULKAN_HPP_NO_TO_STRING ) -# include -#endif - -#ifndef VULKAN_HPP_NO_EXCEPTIONS -namespace std -{ - template <> - struct is_error_code_enum : public true_type - { - }; -} // namespace std -#endif - -namespace VULKAN_HPP_NAMESPACE -{ -#ifndef VULKAN_HPP_NO_EXCEPTIONS - class ErrorCategoryImpl : public std::error_category - { - public: - virtual const char * name() const VULKAN_HPP_NOEXCEPT override - { - return VULKAN_HPP_NAMESPACE_STRING "::Result"; - } - virtual std::string message( int ev ) const override - { -# if defined( VULKAN_HPP_NO_TO_STRING ) - return std::to_string( ev ); -# else - return VULKAN_HPP_NAMESPACE::to_string( static_cast( ev ) ); -# endif - } - }; - - class Error - { - public: - Error() VULKAN_HPP_NOEXCEPT = default; - Error( const Error & ) VULKAN_HPP_NOEXCEPT = default; - virtual ~Error() VULKAN_HPP_NOEXCEPT = default; - - virtual const char * what() const VULKAN_HPP_NOEXCEPT = 0; - }; - - class LogicError - : public Error - , public std::logic_error - { - public: - explicit LogicError( const std::string & what ) : Error(), std::logic_error( what ) {} - explicit LogicError( char const * what ) : Error(), std::logic_error( what ) {} - - virtual const char * what() const VULKAN_HPP_NOEXCEPT - { - return std::logic_error::what(); - } - }; - - class SystemError - : public Error - , public std::system_error - { - public: - SystemError( std::error_code ec ) : Error(), std::system_error( ec ) {} - SystemError( std::error_code ec, std::string const & what ) : Error(), std::system_error( ec, what ) {} - SystemError( std::error_code ec, char const * what ) : Error(), std::system_error( ec, what ) {} - SystemError( int ev, std::error_category const & ecat ) : Error(), std::system_error( ev, ecat ) {} - SystemError( int ev, std::error_category const & ecat, std::string const & what ) : Error(), std::system_error( ev, ecat, what ) {} - SystemError( int ev, std::error_category const & ecat, char const * what ) : Error(), std::system_error( ev, ecat, what ) {} - - virtual const char * what() const VULKAN_HPP_NOEXCEPT - { - return std::system_error::what(); - } - }; - - VULKAN_HPP_INLINE const std::error_category & errorCategory() VULKAN_HPP_NOEXCEPT - { - static ErrorCategoryImpl instance; - return instance; - } - - VULKAN_HPP_INLINE std::error_code make_error_code( Result e ) VULKAN_HPP_NOEXCEPT - { - return std::error_code( static_cast( e ), errorCategory() ); - } - - VULKAN_HPP_INLINE std::error_condition make_error_condition( Result e ) VULKAN_HPP_NOEXCEPT - { - return std::error_condition( static_cast( e ), errorCategory() ); - } - - class OutOfHostMemoryError : public SystemError - { - public: - OutOfHostMemoryError( std::string const & message ) : SystemError( make_error_code( Result::eErrorOutOfHostMemory ), message ) {} - OutOfHostMemoryError( char const * message ) : SystemError( make_error_code( Result::eErrorOutOfHostMemory ), message ) {} - }; - - class OutOfDeviceMemoryError : public SystemError - { - public: - OutOfDeviceMemoryError( std::string const & message ) : SystemError( make_error_code( Result::eErrorOutOfDeviceMemory ), message ) {} - OutOfDeviceMemoryError( char const * message ) : SystemError( make_error_code( Result::eErrorOutOfDeviceMemory ), message ) {} - }; - - class InitializationFailedError : public SystemError - { - public: - InitializationFailedError( std::string const & message ) : SystemError( make_error_code( Result::eErrorInitializationFailed ), message ) {} - InitializationFailedError( char const * message ) : SystemError( make_error_code( Result::eErrorInitializationFailed ), message ) {} - }; - - class DeviceLostError : public SystemError - { - public: - DeviceLostError( std::string const & message ) : SystemError( make_error_code( Result::eErrorDeviceLost ), message ) {} - DeviceLostError( char const * message ) : SystemError( make_error_code( Result::eErrorDeviceLost ), message ) {} - }; - - class MemoryMapFailedError : public SystemError - { - public: - MemoryMapFailedError( std::string const & message ) : SystemError( make_error_code( Result::eErrorMemoryMapFailed ), message ) {} - MemoryMapFailedError( char const * message ) : SystemError( make_error_code( Result::eErrorMemoryMapFailed ), message ) {} - }; - - class LayerNotPresentError : public SystemError - { - public: - LayerNotPresentError( std::string const & message ) : SystemError( make_error_code( Result::eErrorLayerNotPresent ), message ) {} - LayerNotPresentError( char const * message ) : SystemError( make_error_code( Result::eErrorLayerNotPresent ), message ) {} - }; - - class ExtensionNotPresentError : public SystemError - { - public: - ExtensionNotPresentError( std::string const & message ) : SystemError( make_error_code( Result::eErrorExtensionNotPresent ), message ) {} - ExtensionNotPresentError( char const * message ) : SystemError( make_error_code( Result::eErrorExtensionNotPresent ), message ) {} - }; - - class FeatureNotPresentError : public SystemError - { - public: - FeatureNotPresentError( std::string const & message ) : SystemError( make_error_code( Result::eErrorFeatureNotPresent ), message ) {} - FeatureNotPresentError( char const * message ) : SystemError( make_error_code( Result::eErrorFeatureNotPresent ), message ) {} - }; - - class IncompatibleDriverError : public SystemError - { - public: - IncompatibleDriverError( std::string const & message ) : SystemError( make_error_code( Result::eErrorIncompatibleDriver ), message ) {} - IncompatibleDriverError( char const * message ) : SystemError( make_error_code( Result::eErrorIncompatibleDriver ), message ) {} - }; - - class TooManyObjectsError : public SystemError - { - public: - TooManyObjectsError( std::string const & message ) : SystemError( make_error_code( Result::eErrorTooManyObjects ), message ) {} - TooManyObjectsError( char const * message ) : SystemError( make_error_code( Result::eErrorTooManyObjects ), message ) {} - }; - - class FormatNotSupportedError : public SystemError - { - public: - FormatNotSupportedError( std::string const & message ) : SystemError( make_error_code( Result::eErrorFormatNotSupported ), message ) {} - FormatNotSupportedError( char const * message ) : SystemError( make_error_code( Result::eErrorFormatNotSupported ), message ) {} - }; - - class FragmentedPoolError : public SystemError - { - public: - FragmentedPoolError( std::string const & message ) : SystemError( make_error_code( Result::eErrorFragmentedPool ), message ) {} - FragmentedPoolError( char const * message ) : SystemError( make_error_code( Result::eErrorFragmentedPool ), message ) {} - }; - - class UnknownError : public SystemError - { - public: - UnknownError( std::string const & message ) : SystemError( make_error_code( Result::eErrorUnknown ), message ) {} - UnknownError( char const * message ) : SystemError( make_error_code( Result::eErrorUnknown ), message ) {} - }; - - class OutOfPoolMemoryError : public SystemError - { - public: - OutOfPoolMemoryError( std::string const & message ) : SystemError( make_error_code( Result::eErrorOutOfPoolMemory ), message ) {} - OutOfPoolMemoryError( char const * message ) : SystemError( make_error_code( Result::eErrorOutOfPoolMemory ), message ) {} - }; - - class InvalidExternalHandleError : public SystemError - { - public: - InvalidExternalHandleError( std::string const & message ) : SystemError( make_error_code( Result::eErrorInvalidExternalHandle ), message ) {} - InvalidExternalHandleError( char const * message ) : SystemError( make_error_code( Result::eErrorInvalidExternalHandle ), message ) {} - }; - - class FragmentationError : public SystemError - { - public: - FragmentationError( std::string const & message ) : SystemError( make_error_code( Result::eErrorFragmentation ), message ) {} - FragmentationError( char const * message ) : SystemError( make_error_code( Result::eErrorFragmentation ), message ) {} - }; - - class InvalidOpaqueCaptureAddressError : public SystemError - { - public: - InvalidOpaqueCaptureAddressError( std::string const & message ) : SystemError( make_error_code( Result::eErrorInvalidOpaqueCaptureAddress ), message ) {} - InvalidOpaqueCaptureAddressError( char const * message ) : SystemError( make_error_code( Result::eErrorInvalidOpaqueCaptureAddress ), message ) {} - }; - - class SurfaceLostKHRError : public SystemError - { - public: - SurfaceLostKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorSurfaceLostKHR ), message ) {} - SurfaceLostKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorSurfaceLostKHR ), message ) {} - }; - - class NativeWindowInUseKHRError : public SystemError - { - public: - NativeWindowInUseKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorNativeWindowInUseKHR ), message ) {} - NativeWindowInUseKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorNativeWindowInUseKHR ), message ) {} - }; - - class OutOfDateKHRError : public SystemError - { - public: - OutOfDateKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorOutOfDateKHR ), message ) {} - OutOfDateKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorOutOfDateKHR ), message ) {} - }; - - class IncompatibleDisplayKHRError : public SystemError - { - public: - IncompatibleDisplayKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorIncompatibleDisplayKHR ), message ) {} - IncompatibleDisplayKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorIncompatibleDisplayKHR ), message ) {} - }; - - class ValidationFailedEXTError : public SystemError - { - public: - ValidationFailedEXTError( std::string const & message ) : SystemError( make_error_code( Result::eErrorValidationFailedEXT ), message ) {} - ValidationFailedEXTError( char const * message ) : SystemError( make_error_code( Result::eErrorValidationFailedEXT ), message ) {} - }; - - class InvalidShaderNVError : public SystemError - { - public: - InvalidShaderNVError( std::string const & message ) : SystemError( make_error_code( Result::eErrorInvalidShaderNV ), message ) {} - InvalidShaderNVError( char const * message ) : SystemError( make_error_code( Result::eErrorInvalidShaderNV ), message ) {} - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class ImageUsageNotSupportedKHRError : public SystemError - { - public: - ImageUsageNotSupportedKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorImageUsageNotSupportedKHR ), message ) {} - ImageUsageNotSupportedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorImageUsageNotSupportedKHR ), message ) {} - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoPictureLayoutNotSupportedKHRError : public SystemError - { - public: - VideoPictureLayoutNotSupportedKHRError( std::string const & message ) - : SystemError( make_error_code( Result::eErrorVideoPictureLayoutNotSupportedKHR ), message ) - { - } - VideoPictureLayoutNotSupportedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorVideoPictureLayoutNotSupportedKHR ), message ) - { - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoProfileOperationNotSupportedKHRError : public SystemError - { - public: - VideoProfileOperationNotSupportedKHRError( std::string const & message ) - : SystemError( make_error_code( Result::eErrorVideoProfileOperationNotSupportedKHR ), message ) - { - } - VideoProfileOperationNotSupportedKHRError( char const * message ) - : SystemError( make_error_code( Result::eErrorVideoProfileOperationNotSupportedKHR ), message ) - { - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoProfileFormatNotSupportedKHRError : public SystemError - { - public: - VideoProfileFormatNotSupportedKHRError( std::string const & message ) - : SystemError( make_error_code( Result::eErrorVideoProfileFormatNotSupportedKHR ), message ) - { - } - VideoProfileFormatNotSupportedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorVideoProfileFormatNotSupportedKHR ), message ) - { - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoProfileCodecNotSupportedKHRError : public SystemError - { - public: - VideoProfileCodecNotSupportedKHRError( std::string const & message ) - : SystemError( make_error_code( Result::eErrorVideoProfileCodecNotSupportedKHR ), message ) - { - } - VideoProfileCodecNotSupportedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorVideoProfileCodecNotSupportedKHR ), message ) {} - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoStdVersionNotSupportedKHRError : public SystemError - { - public: - VideoStdVersionNotSupportedKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorVideoStdVersionNotSupportedKHR ), message ) - { - } - VideoStdVersionNotSupportedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorVideoStdVersionNotSupportedKHR ), message ) {} - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - class InvalidDrmFormatModifierPlaneLayoutEXTError : public SystemError - { - public: - InvalidDrmFormatModifierPlaneLayoutEXTError( std::string const & message ) - : SystemError( make_error_code( Result::eErrorInvalidDrmFormatModifierPlaneLayoutEXT ), message ) - { - } - InvalidDrmFormatModifierPlaneLayoutEXTError( char const * message ) - : SystemError( make_error_code( Result::eErrorInvalidDrmFormatModifierPlaneLayoutEXT ), message ) - { - } - }; - - class NotPermittedKHRError : public SystemError - { - public: - NotPermittedKHRError( std::string const & message ) : SystemError( make_error_code( Result::eErrorNotPermittedKHR ), message ) {} - NotPermittedKHRError( char const * message ) : SystemError( make_error_code( Result::eErrorNotPermittedKHR ), message ) {} - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - class FullScreenExclusiveModeLostEXTError : public SystemError - { - public: - FullScreenExclusiveModeLostEXTError( std::string const & message ) : SystemError( make_error_code( Result::eErrorFullScreenExclusiveModeLostEXT ), message ) - { - } - FullScreenExclusiveModeLostEXTError( char const * message ) : SystemError( make_error_code( Result::eErrorFullScreenExclusiveModeLostEXT ), message ) {} - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - class CompressionExhaustedEXTError : public SystemError - { - public: - CompressionExhaustedEXTError( std::string const & message ) : SystemError( make_error_code( Result::eErrorCompressionExhaustedEXT ), message ) {} - CompressionExhaustedEXTError( char const * message ) : SystemError( make_error_code( Result::eErrorCompressionExhaustedEXT ), message ) {} - }; - - namespace - { - [[noreturn]] void throwResultException( Result result, char const * message ) - { - switch ( result ) - { - case Result::eErrorOutOfHostMemory: throw OutOfHostMemoryError( message ); - case Result::eErrorOutOfDeviceMemory: throw OutOfDeviceMemoryError( message ); - case Result::eErrorInitializationFailed: throw InitializationFailedError( message ); - case Result::eErrorDeviceLost: throw DeviceLostError( message ); - case Result::eErrorMemoryMapFailed: throw MemoryMapFailedError( message ); - case Result::eErrorLayerNotPresent: throw LayerNotPresentError( message ); - case Result::eErrorExtensionNotPresent: throw ExtensionNotPresentError( message ); - case Result::eErrorFeatureNotPresent: throw FeatureNotPresentError( message ); - case Result::eErrorIncompatibleDriver: throw IncompatibleDriverError( message ); - case Result::eErrorTooManyObjects: throw TooManyObjectsError( message ); - case Result::eErrorFormatNotSupported: throw FormatNotSupportedError( message ); - case Result::eErrorFragmentedPool: throw FragmentedPoolError( message ); - case Result::eErrorUnknown: throw UnknownError( message ); - case Result::eErrorOutOfPoolMemory: throw OutOfPoolMemoryError( message ); - case Result::eErrorInvalidExternalHandle: throw InvalidExternalHandleError( message ); - case Result::eErrorFragmentation: throw FragmentationError( message ); - case Result::eErrorInvalidOpaqueCaptureAddress: throw InvalidOpaqueCaptureAddressError( message ); - case Result::eErrorSurfaceLostKHR: throw SurfaceLostKHRError( message ); - case Result::eErrorNativeWindowInUseKHR: throw NativeWindowInUseKHRError( message ); - case Result::eErrorOutOfDateKHR: throw OutOfDateKHRError( message ); - case Result::eErrorIncompatibleDisplayKHR: throw IncompatibleDisplayKHRError( message ); - case Result::eErrorValidationFailedEXT: throw ValidationFailedEXTError( message ); - case Result::eErrorInvalidShaderNV: throw InvalidShaderNVError( message ); -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorImageUsageNotSupportedKHR: throw ImageUsageNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorVideoPictureLayoutNotSupportedKHR: throw VideoPictureLayoutNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorVideoProfileOperationNotSupportedKHR: throw VideoProfileOperationNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorVideoProfileFormatNotSupportedKHR: throw VideoProfileFormatNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorVideoProfileCodecNotSupportedKHR: throw VideoProfileCodecNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorVideoStdVersionNotSupportedKHR: throw VideoStdVersionNotSupportedKHRError( message ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case Result::eErrorInvalidDrmFormatModifierPlaneLayoutEXT: throw InvalidDrmFormatModifierPlaneLayoutEXTError( message ); - case Result::eErrorNotPermittedKHR: throw NotPermittedKHRError( message ); -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - case Result::eErrorFullScreenExclusiveModeLostEXT: throw FullScreenExclusiveModeLostEXTError( message ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case Result::eErrorCompressionExhaustedEXT: throw CompressionExhaustedEXTError( message ); - default: throw SystemError( make_error_code( result ) ); - } - } - } // namespace -#endif - - template - void ignore( T const & ) VULKAN_HPP_NOEXCEPT - { - } - - template - struct ResultValue - { -#ifdef VULKAN_HPP_HAS_NOEXCEPT - ResultValue( Result r, T & v ) VULKAN_HPP_NOEXCEPT( VULKAN_HPP_NOEXCEPT( T( v ) ) ) -#else - ResultValue( Result r, T & v ) -#endif - : result( r ), value( v ) - { - } - -#ifdef VULKAN_HPP_HAS_NOEXCEPT - ResultValue( Result r, T && v ) VULKAN_HPP_NOEXCEPT( VULKAN_HPP_NOEXCEPT( T( std::move( v ) ) ) ) -#else - ResultValue( Result r, T && v ) -#endif - : result( r ), value( std::move( v ) ) - { - } - - Result result; - T value; - - operator std::tuple() VULKAN_HPP_NOEXCEPT - { - return std::tuple( result, value ); - } - }; - -#if !defined( VULKAN_HPP_NO_SMART_HANDLE ) - template - struct ResultValue> - { -# ifdef VULKAN_HPP_HAS_NOEXCEPT - ResultValue( Result r, UniqueHandle && v ) VULKAN_HPP_NOEXCEPT -# else - ResultValue( Result r, UniqueHandle && v ) -# endif - : result( r ) - , value( std::move( v ) ) - { - } - - std::tuple> asTuple() - { - return std::make_tuple( result, std::move( value ) ); - } - - Result result; - UniqueHandle value; - }; - - template - struct ResultValue>> - { -# ifdef VULKAN_HPP_HAS_NOEXCEPT - ResultValue( Result r, std::vector> && v ) VULKAN_HPP_NOEXCEPT -# else - ResultValue( Result r, std::vector> && v ) -# endif - : result( r ) - , value( std::move( v ) ) - { - } - - std::tuple>> asTuple() - { - return std::make_tuple( result, std::move( value ) ); - } - - Result result; - std::vector> value; - }; -#endif - - template - struct ResultValueType - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - typedef ResultValue type; -#else - typedef T type; -#endif - }; - - template <> - struct ResultValueType - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - typedef Result type; -#else - typedef void type; -#endif - }; - - VULKAN_HPP_INLINE typename ResultValueType::type createResultValueType( Result result ) - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - return result; -#else - ignore( result ); -#endif - } - - template - VULKAN_HPP_INLINE typename ResultValueType::type createResultValueType( Result result, T & data ) - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - return ResultValue( result, data ); -#else - ignore( result ); - return data; -#endif - } - - template - VULKAN_HPP_INLINE typename ResultValueType::type createResultValueType( Result result, T && data ) - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - return ResultValue( result, std::move( data ) ); -#else - ignore( result ); - return std::move( data ); -#endif - } - - VULKAN_HPP_INLINE void resultCheck( Result result, char const * message ) - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty - ignore( message ); - VULKAN_HPP_ASSERT_ON_RESULT( result == Result::eSuccess ); -#else - if ( result != Result::eSuccess ) - { - throwResultException( result, message ); - } -#endif - } - - VULKAN_HPP_INLINE void resultCheck( Result result, char const * message, std::initializer_list successCodes ) - { -#ifdef VULKAN_HPP_NO_EXCEPTIONS - ignore( result ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty - ignore( message ); - ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty - VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() ); -#else - if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() ) - { - throwResultException( result, message ); - } -#endif - } -} // namespace VULKAN_HPP_NAMESPACE - -// clang-format off -#include -#include -#include -// clang-format on - -namespace VULKAN_HPP_NAMESPACE -{ -#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - - //======================= - //=== STRUCTS EXTENDS === - //======================= - - //=== VK_VERSION_1_0 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_VERSION_1_1 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_VERSION_1_2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_VERSION_1_3 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_swapchain === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_display_swapchain === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_debug_report === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_rasterization_order === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_dedicated_allocation === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_transform_feedback === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_AMD_texture_gather_bias_lod === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_dynamic_rendering === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_corner_sampled_image === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_external_memory === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_win32_keyed_mutex === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_validation_flags === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_astc_decode_mode === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_pipeline_robustness === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_keyed_mutex === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_push_descriptor === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_conditional_rendering === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_incremental_present === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_clip_space_w_scaling === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_display_control === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_GOOGLE_display_timing === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NVX_multiview_per_view_attributes === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_viewport_swizzle === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_discard_rectangles === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_conservative_rasterization === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_depth_clip_enable === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_shared_presentable_image === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_performance_query === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_debug_utils === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_blend_operation_advanced === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_fragment_coverage_to_color === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_acceleration_structure === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_framebuffer_mixed_samples === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_shader_sm_builtins === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_image_drm_format_modifier === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_validation_cache === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_portability_subset === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_shading_rate_image === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_ray_tracing === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_representative_fragment_test === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_filter_cubic === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_external_memory_host === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_shader_clock === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_pipeline_compiler_control === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_shader_core_properties === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h265 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_KHR_global_priority === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_memory_overallocation_behavior === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_vertex_attribute_divisor === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_frame_token === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_compute_shader_derivatives === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_mesh_shader === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_shader_image_footprint === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_scissor_exclusive === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_device_diagnostic_checkpoints === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_INTEL_shader_integer_functions2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_INTEL_performance_query === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_pci_bus_info === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_display_native_hdr === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_fragment_density_map === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_fragment_shading_rate === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_shader_core_properties2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_device_coherent_memory === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_shader_image_atomic_int64 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_memory_budget === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_memory_priority === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_surface_protected_capabilities === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_dedicated_allocation_image_aliasing === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_buffer_device_address === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_validation_features === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_present_wait === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_cooperative_matrix === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_coverage_reduction_mode === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_fragment_shader_interlock === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_ycbcr_image_arrays === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_provoking_vertex === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_line_rasterization === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_shader_atomic_float === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_index_type_uint8 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_extended_dynamic_state === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_pipeline_executable_properties === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_shader_atomic_float2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_device_generated_commands === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_inherited_viewport_scissor === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_texel_buffer_alignment === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_QCOM_render_pass_transform === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_device_memory_report === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_robustness2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_custom_border_color === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_pipeline_library === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_present_id === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_graphics_pipeline_library === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_AMD_shader_early_and_late_fragment_tests === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_fragment_shader_barycentric === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_shader_subgroup_uniform_control_flow === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_fragment_shading_rate_enums === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_ray_tracing_motion_blur === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_mesh_shader === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_ycbcr_2plane_444_formats === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_fragment_density_map2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_QCOM_rotated_copy_commands === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_workgroup_memory_explicit_layout === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_image_compression_control === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_attachment_feedback_loop_layout === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_4444_formats === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_rgba10x6_formats === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_ray_tracing_pipeline === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_ray_query === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_VALVE_mutable_descriptor_type === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_vertex_input_dynamic_state === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_physical_device_drm === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_depth_clip_control === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_primitive_topology_list_restart === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_HUAWEI_invocation_mask === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_external_memory_rdma === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_pipeline_properties === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_multisampled_render_to_single_sampled === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_extended_dynamic_state2 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_color_write_enable === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_primitives_generated_query === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_KHR_ray_tracing_maintenance1 === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_image_view_min_lod === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_multi_draw === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_image_2d_view_of_3d === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_border_color_swizzle === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_pageable_device_local_memory === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_VALVE_descriptor_set_host_mapping === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_depth_clamp_zero_one === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_non_seamless_cube_map === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_QCOM_fragment_density_map_offset === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_NV_linear_color_attachment === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_image_compression_control_swapchain === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_QCOM_image_processing === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_subpass_merge_feedback === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_shader_module_identifier === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_rasterization_order_attachment_access === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_EXT_legacy_dithering === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_QCOM_tile_properties === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - - //=== VK_SEC_amigo_profiling === - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - template <> - struct StructExtends - { - enum - { - value = true - }; - }; - -#endif // VULKAN_HPP_DISABLE_ENHANCED_MODE - -#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - class DynamicLoader - { - public: -# ifdef VULKAN_HPP_NO_EXCEPTIONS - DynamicLoader( std::string const & vulkanLibraryName = {} ) VULKAN_HPP_NOEXCEPT -# else - DynamicLoader( std::string const & vulkanLibraryName = {} ) -# endif - { - if ( !vulkanLibraryName.empty() ) - { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) - m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL ); -# elif defined( _WIN32 ) - m_library = ::LoadLibraryA( vulkanLibraryName.c_str() ); -# else -# error unsupported platform -# endif - } - else - { -# if defined( __unix__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) - m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); - if ( m_library == nullptr ) - { - m_library = dlopen( "libvulkan.so.1", RTLD_NOW | RTLD_LOCAL ); - } -# elif defined( __APPLE__ ) - m_library = dlopen( "libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); -# elif defined( _WIN32 ) - m_library = ::LoadLibraryA( "vulkan-1.dll" ); -# else -# error unsupported platform -# endif - } - -# ifndef VULKAN_HPP_NO_EXCEPTIONS - if ( m_library == nullptr ) - { - // NOTE there should be an InitializationFailedError, but msvc insists on the symbol does not exist within the scope of this function. - throw std::runtime_error( "Failed to load vulkan library!" ); - } -# endif - } - - DynamicLoader( DynamicLoader const & ) = delete; - - DynamicLoader( DynamicLoader && other ) VULKAN_HPP_NOEXCEPT : m_library( other.m_library ) - { - other.m_library = nullptr; - } - - DynamicLoader & operator=( DynamicLoader const & ) = delete; - - DynamicLoader & operator=( DynamicLoader && other ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_library, other.m_library ); - return *this; - } - - ~DynamicLoader() VULKAN_HPP_NOEXCEPT - { - if ( m_library ) - { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) - dlclose( m_library ); -# elif defined( _WIN32 ) - ::FreeLibrary( m_library ); -# else -# error unsupported platform -# endif - } - } - - template - T getProcAddress( const char * function ) const VULKAN_HPP_NOEXCEPT - { -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) - return (T)dlsym( m_library, function ); -# elif defined( _WIN32 ) - return ( T )::GetProcAddress( m_library, function ); -# else -# error unsupported platform -# endif - } - - bool success() const VULKAN_HPP_NOEXCEPT - { - return m_library != nullptr; - } - - private: -# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) - void * m_library; -# elif defined( _WIN32 ) - ::HINSTANCE m_library; -# else -# error unsupported platform -# endif - }; -#endif - - using PFN_dummy = void ( * )(); - - class DispatchLoaderDynamic : public DispatchLoaderBase - { - public: - //=== VK_VERSION_1_0 === - PFN_vkCreateInstance vkCreateInstance = 0; - PFN_vkDestroyInstance vkDestroyInstance = 0; - PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices = 0; - PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures = 0; - PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties = 0; - PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties = 0; - PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties = 0; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = 0; - PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr = 0; - PFN_vkCreateDevice vkCreateDevice = 0; - PFN_vkDestroyDevice vkDestroyDevice = 0; - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = 0; - PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties = 0; - PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties = 0; - PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties = 0; - PFN_vkGetDeviceQueue vkGetDeviceQueue = 0; - PFN_vkQueueSubmit vkQueueSubmit = 0; - PFN_vkQueueWaitIdle vkQueueWaitIdle = 0; - PFN_vkDeviceWaitIdle vkDeviceWaitIdle = 0; - PFN_vkAllocateMemory vkAllocateMemory = 0; - PFN_vkFreeMemory vkFreeMemory = 0; - PFN_vkMapMemory vkMapMemory = 0; - PFN_vkUnmapMemory vkUnmapMemory = 0; - PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges = 0; - PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges = 0; - PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment = 0; - PFN_vkBindBufferMemory vkBindBufferMemory = 0; - PFN_vkBindImageMemory vkBindImageMemory = 0; - PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements = 0; - PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements = 0; - PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties = 0; - PFN_vkQueueBindSparse vkQueueBindSparse = 0; - PFN_vkCreateFence vkCreateFence = 0; - PFN_vkDestroyFence vkDestroyFence = 0; - PFN_vkResetFences vkResetFences = 0; - PFN_vkGetFenceStatus vkGetFenceStatus = 0; - PFN_vkWaitForFences vkWaitForFences = 0; - PFN_vkCreateSemaphore vkCreateSemaphore = 0; - PFN_vkDestroySemaphore vkDestroySemaphore = 0; - PFN_vkCreateEvent vkCreateEvent = 0; - PFN_vkDestroyEvent vkDestroyEvent = 0; - PFN_vkGetEventStatus vkGetEventStatus = 0; - PFN_vkSetEvent vkSetEvent = 0; - PFN_vkResetEvent vkResetEvent = 0; - PFN_vkCreateQueryPool vkCreateQueryPool = 0; - PFN_vkDestroyQueryPool vkDestroyQueryPool = 0; - PFN_vkGetQueryPoolResults vkGetQueryPoolResults = 0; - PFN_vkCreateBuffer vkCreateBuffer = 0; - PFN_vkDestroyBuffer vkDestroyBuffer = 0; - PFN_vkCreateBufferView vkCreateBufferView = 0; - PFN_vkDestroyBufferView vkDestroyBufferView = 0; - PFN_vkCreateImage vkCreateImage = 0; - PFN_vkDestroyImage vkDestroyImage = 0; - PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout = 0; - PFN_vkCreateImageView vkCreateImageView = 0; - PFN_vkDestroyImageView vkDestroyImageView = 0; - PFN_vkCreateShaderModule vkCreateShaderModule = 0; - PFN_vkDestroyShaderModule vkDestroyShaderModule = 0; - PFN_vkCreatePipelineCache vkCreatePipelineCache = 0; - PFN_vkDestroyPipelineCache vkDestroyPipelineCache = 0; - PFN_vkGetPipelineCacheData vkGetPipelineCacheData = 0; - PFN_vkMergePipelineCaches vkMergePipelineCaches = 0; - PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines = 0; - PFN_vkCreateComputePipelines vkCreateComputePipelines = 0; - PFN_vkDestroyPipeline vkDestroyPipeline = 0; - PFN_vkCreatePipelineLayout vkCreatePipelineLayout = 0; - PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout = 0; - PFN_vkCreateSampler vkCreateSampler = 0; - PFN_vkDestroySampler vkDestroySampler = 0; - PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout = 0; - PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout = 0; - PFN_vkCreateDescriptorPool vkCreateDescriptorPool = 0; - PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool = 0; - PFN_vkResetDescriptorPool vkResetDescriptorPool = 0; - PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets = 0; - PFN_vkFreeDescriptorSets vkFreeDescriptorSets = 0; - PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets = 0; - PFN_vkCreateFramebuffer vkCreateFramebuffer = 0; - PFN_vkDestroyFramebuffer vkDestroyFramebuffer = 0; - PFN_vkCreateRenderPass vkCreateRenderPass = 0; - PFN_vkDestroyRenderPass vkDestroyRenderPass = 0; - PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity = 0; - PFN_vkCreateCommandPool vkCreateCommandPool = 0; - PFN_vkDestroyCommandPool vkDestroyCommandPool = 0; - PFN_vkResetCommandPool vkResetCommandPool = 0; - PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers = 0; - PFN_vkFreeCommandBuffers vkFreeCommandBuffers = 0; - PFN_vkBeginCommandBuffer vkBeginCommandBuffer = 0; - PFN_vkEndCommandBuffer vkEndCommandBuffer = 0; - PFN_vkResetCommandBuffer vkResetCommandBuffer = 0; - PFN_vkCmdBindPipeline vkCmdBindPipeline = 0; - PFN_vkCmdSetViewport vkCmdSetViewport = 0; - PFN_vkCmdSetScissor vkCmdSetScissor = 0; - PFN_vkCmdSetLineWidth vkCmdSetLineWidth = 0; - PFN_vkCmdSetDepthBias vkCmdSetDepthBias = 0; - PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants = 0; - PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds = 0; - PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask = 0; - PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask = 0; - PFN_vkCmdSetStencilReference vkCmdSetStencilReference = 0; - PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets = 0; - PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer = 0; - PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers = 0; - PFN_vkCmdDraw vkCmdDraw = 0; - PFN_vkCmdDrawIndexed vkCmdDrawIndexed = 0; - PFN_vkCmdDrawIndirect vkCmdDrawIndirect = 0; - PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect = 0; - PFN_vkCmdDispatch vkCmdDispatch = 0; - PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect = 0; - PFN_vkCmdCopyBuffer vkCmdCopyBuffer = 0; - PFN_vkCmdCopyImage vkCmdCopyImage = 0; - PFN_vkCmdBlitImage vkCmdBlitImage = 0; - PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage = 0; - PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer = 0; - PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer = 0; - PFN_vkCmdFillBuffer vkCmdFillBuffer = 0; - PFN_vkCmdClearColorImage vkCmdClearColorImage = 0; - PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage = 0; - PFN_vkCmdClearAttachments vkCmdClearAttachments = 0; - PFN_vkCmdResolveImage vkCmdResolveImage = 0; - PFN_vkCmdSetEvent vkCmdSetEvent = 0; - PFN_vkCmdResetEvent vkCmdResetEvent = 0; - PFN_vkCmdWaitEvents vkCmdWaitEvents = 0; - PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier = 0; - PFN_vkCmdBeginQuery vkCmdBeginQuery = 0; - PFN_vkCmdEndQuery vkCmdEndQuery = 0; - PFN_vkCmdResetQueryPool vkCmdResetQueryPool = 0; - PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp = 0; - PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults = 0; - PFN_vkCmdPushConstants vkCmdPushConstants = 0; - PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass = 0; - PFN_vkCmdNextSubpass vkCmdNextSubpass = 0; - PFN_vkCmdEndRenderPass vkCmdEndRenderPass = 0; - PFN_vkCmdExecuteCommands vkCmdExecuteCommands = 0; - - //=== VK_VERSION_1_1 === - PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion = 0; - PFN_vkBindBufferMemory2 vkBindBufferMemory2 = 0; - PFN_vkBindImageMemory2 vkBindImageMemory2 = 0; - PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures = 0; - PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask = 0; - PFN_vkCmdDispatchBase vkCmdDispatchBase = 0; - PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups = 0; - PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2 = 0; - PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2 = 0; - PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2 = 0; - PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2 = 0; - PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2 = 0; - PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2 = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2 = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2 = 0; - PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2 = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2 = 0; - PFN_vkTrimCommandPool vkTrimCommandPool = 0; - PFN_vkGetDeviceQueue2 vkGetDeviceQueue2 = 0; - PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion = 0; - PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion = 0; - PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate = 0; - PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate = 0; - PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate = 0; - PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties = 0; - PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties = 0; - PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties = 0; - PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport = 0; - - //=== VK_VERSION_1_2 === - PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount = 0; - PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount = 0; - PFN_vkCreateRenderPass2 vkCreateRenderPass2 = 0; - PFN_vkCmdBeginRenderPass2 vkCmdBeginRenderPass2 = 0; - PFN_vkCmdNextSubpass2 vkCmdNextSubpass2 = 0; - PFN_vkCmdEndRenderPass2 vkCmdEndRenderPass2 = 0; - PFN_vkResetQueryPool vkResetQueryPool = 0; - PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue = 0; - PFN_vkWaitSemaphores vkWaitSemaphores = 0; - PFN_vkSignalSemaphore vkSignalSemaphore = 0; - PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress = 0; - PFN_vkGetBufferOpaqueCaptureAddress vkGetBufferOpaqueCaptureAddress = 0; - PFN_vkGetDeviceMemoryOpaqueCaptureAddress vkGetDeviceMemoryOpaqueCaptureAddress = 0; - - //=== VK_VERSION_1_3 === - PFN_vkGetPhysicalDeviceToolProperties vkGetPhysicalDeviceToolProperties = 0; - PFN_vkCreatePrivateDataSlot vkCreatePrivateDataSlot = 0; - PFN_vkDestroyPrivateDataSlot vkDestroyPrivateDataSlot = 0; - PFN_vkSetPrivateData vkSetPrivateData = 0; - PFN_vkGetPrivateData vkGetPrivateData = 0; - PFN_vkCmdSetEvent2 vkCmdSetEvent2 = 0; - PFN_vkCmdResetEvent2 vkCmdResetEvent2 = 0; - PFN_vkCmdWaitEvents2 vkCmdWaitEvents2 = 0; - PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2 = 0; - PFN_vkCmdWriteTimestamp2 vkCmdWriteTimestamp2 = 0; - PFN_vkQueueSubmit2 vkQueueSubmit2 = 0; - PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2 = 0; - PFN_vkCmdCopyImage2 vkCmdCopyImage2 = 0; - PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2 = 0; - PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2 = 0; - PFN_vkCmdBlitImage2 vkCmdBlitImage2 = 0; - PFN_vkCmdResolveImage2 vkCmdResolveImage2 = 0; - PFN_vkCmdBeginRendering vkCmdBeginRendering = 0; - PFN_vkCmdEndRendering vkCmdEndRendering = 0; - PFN_vkCmdSetCullMode vkCmdSetCullMode = 0; - PFN_vkCmdSetFrontFace vkCmdSetFrontFace = 0; - PFN_vkCmdSetPrimitiveTopology vkCmdSetPrimitiveTopology = 0; - PFN_vkCmdSetViewportWithCount vkCmdSetViewportWithCount = 0; - PFN_vkCmdSetScissorWithCount vkCmdSetScissorWithCount = 0; - PFN_vkCmdBindVertexBuffers2 vkCmdBindVertexBuffers2 = 0; - PFN_vkCmdSetDepthTestEnable vkCmdSetDepthTestEnable = 0; - PFN_vkCmdSetDepthWriteEnable vkCmdSetDepthWriteEnable = 0; - PFN_vkCmdSetDepthCompareOp vkCmdSetDepthCompareOp = 0; - PFN_vkCmdSetDepthBoundsTestEnable vkCmdSetDepthBoundsTestEnable = 0; - PFN_vkCmdSetStencilTestEnable vkCmdSetStencilTestEnable = 0; - PFN_vkCmdSetStencilOp vkCmdSetStencilOp = 0; - PFN_vkCmdSetRasterizerDiscardEnable vkCmdSetRasterizerDiscardEnable = 0; - PFN_vkCmdSetDepthBiasEnable vkCmdSetDepthBiasEnable = 0; - PFN_vkCmdSetPrimitiveRestartEnable vkCmdSetPrimitiveRestartEnable = 0; - PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements = 0; - PFN_vkGetDeviceImageMemoryRequirements vkGetDeviceImageMemoryRequirements = 0; - PFN_vkGetDeviceImageSparseMemoryRequirements vkGetDeviceImageSparseMemoryRequirements = 0; - - //=== VK_KHR_surface === - PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR = 0; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR = 0; - - //=== VK_KHR_swapchain === - PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = 0; - PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR = 0; - PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR = 0; - PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR = 0; - PFN_vkQueuePresentKHR vkQueuePresentKHR = 0; - PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR = 0; - PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR = 0; - PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR = 0; - PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR = 0; - - //=== VK_KHR_display === - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR = 0; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 0; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR = 0; - PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR = 0; - PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR = 0; - PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR = 0; - PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR = 0; - - //=== VK_KHR_display_swapchain === - PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR = 0; - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR = 0; -#else - PFN_dummy vkCreateXlibSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceXlibPresentationSupportKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR = 0; -#else - PFN_dummy vkCreateXcbSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceXcbPresentationSupportKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR = 0; -#else - PFN_dummy vkCreateWaylandSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceWaylandPresentationSupportKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR = 0; -#else - PFN_dummy vkCreateAndroidSurfaceKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = 0; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR = 0; -#else - PFN_dummy vkCreateWin32SurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceWin32PresentationSupportKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT = 0; - PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT = 0; - PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT = 0; - - //=== VK_EXT_debug_marker === - PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT = 0; - PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT = 0; - PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT = 0; - PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT = 0; - PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT = 0; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR = 0; - PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR vkGetPhysicalDeviceVideoFormatPropertiesKHR = 0; - PFN_vkCreateVideoSessionKHR vkCreateVideoSessionKHR = 0; - PFN_vkDestroyVideoSessionKHR vkDestroyVideoSessionKHR = 0; - PFN_vkGetVideoSessionMemoryRequirementsKHR vkGetVideoSessionMemoryRequirementsKHR = 0; - PFN_vkBindVideoSessionMemoryKHR vkBindVideoSessionMemoryKHR = 0; - PFN_vkCreateVideoSessionParametersKHR vkCreateVideoSessionParametersKHR = 0; - PFN_vkUpdateVideoSessionParametersKHR vkUpdateVideoSessionParametersKHR = 0; - PFN_vkDestroyVideoSessionParametersKHR vkDestroyVideoSessionParametersKHR = 0; - PFN_vkCmdBeginVideoCodingKHR vkCmdBeginVideoCodingKHR = 0; - PFN_vkCmdEndVideoCodingKHR vkCmdEndVideoCodingKHR = 0; - PFN_vkCmdControlVideoCodingKHR vkCmdControlVideoCodingKHR = 0; -#else - PFN_dummy vkGetPhysicalDeviceVideoCapabilitiesKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceVideoFormatPropertiesKHR_placeholder = 0; - PFN_dummy vkCreateVideoSessionKHR_placeholder = 0; - PFN_dummy vkDestroyVideoSessionKHR_placeholder = 0; - PFN_dummy vkGetVideoSessionMemoryRequirementsKHR_placeholder = 0; - PFN_dummy vkBindVideoSessionMemoryKHR_placeholder = 0; - PFN_dummy vkCreateVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkUpdateVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkDestroyVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkCmdBeginVideoCodingKHR_placeholder = 0; - PFN_dummy vkCmdEndVideoCodingKHR_placeholder = 0; - PFN_dummy vkCmdControlVideoCodingKHR_placeholder = 0; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR = 0; -#else - PFN_dummy vkCmdDecodeVideoKHR_placeholder = 0; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT = 0; - PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT = 0; - PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT = 0; - PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT = 0; - PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT = 0; - PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT = 0; - - //=== VK_NVX_binary_import === - PFN_vkCreateCuModuleNVX vkCreateCuModuleNVX = 0; - PFN_vkCreateCuFunctionNVX vkCreateCuFunctionNVX = 0; - PFN_vkDestroyCuModuleNVX vkDestroyCuModuleNVX = 0; - PFN_vkDestroyCuFunctionNVX vkDestroyCuFunctionNVX = 0; - PFN_vkCmdCuLaunchKernelNVX vkCmdCuLaunchKernelNVX = 0; - - //=== VK_NVX_image_view_handle === - PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX = 0; - PFN_vkGetImageViewAddressNVX vkGetImageViewAddressNVX = 0; - - //=== VK_AMD_draw_indirect_count === - PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD = 0; - PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD = 0; - - //=== VK_AMD_shader_info === - PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD = 0; - - //=== VK_KHR_dynamic_rendering === - PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR = 0; - PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHR = 0; - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP = 0; -#else - PFN_dummy vkCreateStreamDescriptorSurfaceGGP_placeholder = 0; -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV = 0; -#else - PFN_dummy vkGetMemoryWin32HandleNV_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_get_physical_device_properties2 === - PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR = 0; - PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR = 0; - PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR = 0; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 0; - - //=== VK_KHR_device_group === - PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR = 0; - PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR = 0; - PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR = 0; - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - PFN_vkCreateViSurfaceNN vkCreateViSurfaceNN = 0; -#else - PFN_dummy vkCreateViSurfaceNN_placeholder = 0; -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_maintenance1 === - PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR = 0; - - //=== VK_KHR_device_group_creation === - PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR = 0; - - //=== VK_KHR_external_memory_capabilities === - PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR = 0; - PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR = 0; -#else - PFN_dummy vkGetMemoryWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetMemoryWin32HandlePropertiesKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR = 0; - PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR = 0; - - //=== VK_KHR_external_semaphore_capabilities === - PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR = 0; - PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR = 0; -#else - PFN_dummy vkImportSemaphoreWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetSemaphoreWin32HandleKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR = 0; - PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR = 0; - - //=== VK_KHR_push_descriptor === - PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR = 0; - PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR = 0; - - //=== VK_EXT_conditional_rendering === - PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT = 0; - PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT = 0; - - //=== VK_KHR_descriptor_update_template === - PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR = 0; - PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR = 0; - PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR = 0; - - //=== VK_NV_clip_space_w_scaling === - PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV = 0; - - //=== VK_EXT_direct_mode_display === - PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT = 0; - -#if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT = 0; - PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT = 0; -#else - PFN_dummy vkAcquireXlibDisplayEXT_placeholder = 0; - PFN_dummy vkGetRandROutputDisplayEXT_placeholder = 0; -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT = 0; - - //=== VK_EXT_display_control === - PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT = 0; - PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT = 0; - PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT = 0; - PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT = 0; - - //=== VK_GOOGLE_display_timing === - PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE = 0; - PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE = 0; - - //=== VK_EXT_discard_rectangles === - PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT = 0; - - //=== VK_EXT_hdr_metadata === - PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT = 0; - - //=== VK_KHR_create_renderpass2 === - PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR = 0; - PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR = 0; - PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR = 0; - PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR = 0; - - //=== VK_KHR_shared_presentable_image === - PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR = 0; - - //=== VK_KHR_external_fence_capabilities === - PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR = 0; - PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR = 0; -#else - PFN_dummy vkImportFenceWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetFenceWin32HandleKHR_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - PFN_vkImportFenceFdKHR vkImportFenceFdKHR = 0; - PFN_vkGetFenceFdKHR vkGetFenceFdKHR = 0; - - //=== VK_KHR_performance_query === - PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = 0; - PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = 0; - PFN_vkAcquireProfilingLockKHR vkAcquireProfilingLockKHR = 0; - PFN_vkReleaseProfilingLockKHR vkReleaseProfilingLockKHR = 0; - - //=== VK_KHR_get_surface_capabilities2 === - PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR = 0; - PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR = 0; - - //=== VK_KHR_get_display_properties2 === - PFN_vkGetPhysicalDeviceDisplayProperties2KHR vkGetPhysicalDeviceDisplayProperties2KHR = 0; - PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 0; - PFN_vkGetDisplayModeProperties2KHR vkGetDisplayModeProperties2KHR = 0; - PFN_vkGetDisplayPlaneCapabilities2KHR vkGetDisplayPlaneCapabilities2KHR = 0; - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - PFN_vkCreateIOSSurfaceMVK vkCreateIOSSurfaceMVK = 0; -#else - PFN_dummy vkCreateIOSSurfaceMVK_placeholder = 0; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK = 0; -#else - PFN_dummy vkCreateMacOSSurfaceMVK_placeholder = 0; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT = 0; - PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT = 0; - PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT = 0; - PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT = 0; - PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT = 0; - PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT = 0; - PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT = 0; - PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT = 0; - PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT = 0; - PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT = 0; - PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT = 0; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID = 0; - PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID = 0; -#else - PFN_dummy vkGetAndroidHardwareBufferPropertiesANDROID_placeholder = 0; - PFN_dummy vkGetMemoryAndroidHardwareBufferANDROID_placeholder = 0; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT = 0; - PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT = 0; - - //=== VK_KHR_get_memory_requirements2 === - PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR = 0; - PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR = 0; - PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR = 0; - - //=== VK_KHR_acceleration_structure === - PFN_vkCreateAccelerationStructureKHR vkCreateAccelerationStructureKHR = 0; - PFN_vkDestroyAccelerationStructureKHR vkDestroyAccelerationStructureKHR = 0; - PFN_vkCmdBuildAccelerationStructuresKHR vkCmdBuildAccelerationStructuresKHR = 0; - PFN_vkCmdBuildAccelerationStructuresIndirectKHR vkCmdBuildAccelerationStructuresIndirectKHR = 0; - PFN_vkBuildAccelerationStructuresKHR vkBuildAccelerationStructuresKHR = 0; - PFN_vkCopyAccelerationStructureKHR vkCopyAccelerationStructureKHR = 0; - PFN_vkCopyAccelerationStructureToMemoryKHR vkCopyAccelerationStructureToMemoryKHR = 0; - PFN_vkCopyMemoryToAccelerationStructureKHR vkCopyMemoryToAccelerationStructureKHR = 0; - PFN_vkWriteAccelerationStructuresPropertiesKHR vkWriteAccelerationStructuresPropertiesKHR = 0; - PFN_vkCmdCopyAccelerationStructureKHR vkCmdCopyAccelerationStructureKHR = 0; - PFN_vkCmdCopyAccelerationStructureToMemoryKHR vkCmdCopyAccelerationStructureToMemoryKHR = 0; - PFN_vkCmdCopyMemoryToAccelerationStructureKHR vkCmdCopyMemoryToAccelerationStructureKHR = 0; - PFN_vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureDeviceAddressKHR = 0; - PFN_vkCmdWriteAccelerationStructuresPropertiesKHR vkCmdWriteAccelerationStructuresPropertiesKHR = 0; - PFN_vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceAccelerationStructureCompatibilityKHR = 0; - PFN_vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureBuildSizesKHR = 0; - - //=== VK_KHR_sampler_ycbcr_conversion === - PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR = 0; - PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR = 0; - - //=== VK_KHR_bind_memory2 === - PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR = 0; - PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR = 0; - - //=== VK_EXT_image_drm_format_modifier === - PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT = 0; - - //=== VK_EXT_validation_cache === - PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT = 0; - PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT = 0; - PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT = 0; - PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT = 0; - - //=== VK_NV_shading_rate_image === - PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV = 0; - PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV = 0; - PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV = 0; - - //=== VK_NV_ray_tracing === - PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV = 0; - PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV = 0; - PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV = 0; - PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV = 0; - PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV = 0; - PFN_vkCmdCopyAccelerationStructureNV vkCmdCopyAccelerationStructureNV = 0; - PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV = 0; - PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV = 0; - PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV = 0; - PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV = 0; - PFN_vkCmdWriteAccelerationStructuresPropertiesNV vkCmdWriteAccelerationStructuresPropertiesNV = 0; - PFN_vkCompileDeferredNV vkCompileDeferredNV = 0; - - //=== VK_KHR_maintenance3 === - PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR = 0; - - //=== VK_KHR_draw_indirect_count === - PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR = 0; - PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR = 0; - - //=== VK_EXT_external_memory_host === - PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT = 0; - - //=== VK_AMD_buffer_marker === - PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD = 0; - - //=== VK_EXT_calibrated_timestamps === - PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = 0; - PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT = 0; - - //=== VK_NV_mesh_shader === - PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV = 0; - PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV = 0; - PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV = 0; - - //=== VK_NV_scissor_exclusive === - PFN_vkCmdSetExclusiveScissorNV vkCmdSetExclusiveScissorNV = 0; - - //=== VK_NV_device_diagnostic_checkpoints === - PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV = 0; - PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV = 0; - - //=== VK_KHR_timeline_semaphore === - PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR = 0; - PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR = 0; - PFN_vkSignalSemaphoreKHR vkSignalSemaphoreKHR = 0; - - //=== VK_INTEL_performance_query === - PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL = 0; - PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL = 0; - PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL = 0; - PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL = 0; - PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL = 0; - PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL = 0; - PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL = 0; - PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL = 0; - PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL = 0; - - //=== VK_AMD_display_native_hdr === - PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD = 0; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA = 0; -#else - PFN_dummy vkCreateImagePipeSurfaceFUCHSIA_placeholder = 0; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT = 0; -#else - PFN_dummy vkCreateMetalSurfaceEXT_placeholder = 0; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR vkGetPhysicalDeviceFragmentShadingRatesKHR = 0; - PFN_vkCmdSetFragmentShadingRateKHR vkCmdSetFragmentShadingRateKHR = 0; - - //=== VK_EXT_buffer_device_address === - PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT = 0; - - //=== VK_EXT_tooling_info === - PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT = 0; - - //=== VK_KHR_present_wait === - PFN_vkWaitForPresentKHR vkWaitForPresentKHR = 0; - - //=== VK_NV_cooperative_matrix === - PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = 0; - - //=== VK_NV_coverage_reduction_mode === - PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT = 0; - PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT = 0; - PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT = 0; - PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT = 0; -#else - PFN_dummy vkGetPhysicalDeviceSurfacePresentModes2EXT_placeholder = 0; - PFN_dummy vkAcquireFullScreenExclusiveModeEXT_placeholder = 0; - PFN_dummy vkReleaseFullScreenExclusiveModeEXT_placeholder = 0; - PFN_dummy vkGetDeviceGroupSurfacePresentModes2EXT_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT = 0; - - //=== VK_KHR_buffer_device_address === - PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR = 0; - PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR = 0; - PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR = 0; - - //=== VK_EXT_line_rasterization === - PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT = 0; - - //=== VK_EXT_host_query_reset === - PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT = 0; - - //=== VK_EXT_extended_dynamic_state === - PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT = 0; - PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT = 0; - PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT = 0; - PFN_vkCmdSetViewportWithCountEXT vkCmdSetViewportWithCountEXT = 0; - PFN_vkCmdSetScissorWithCountEXT vkCmdSetScissorWithCountEXT = 0; - PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT = 0; - PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT = 0; - PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT = 0; - PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT = 0; - PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT = 0; - PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT = 0; - PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT = 0; - - //=== VK_KHR_deferred_host_operations === - PFN_vkCreateDeferredOperationKHR vkCreateDeferredOperationKHR = 0; - PFN_vkDestroyDeferredOperationKHR vkDestroyDeferredOperationKHR = 0; - PFN_vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationMaxConcurrencyKHR = 0; - PFN_vkGetDeferredOperationResultKHR vkGetDeferredOperationResultKHR = 0; - PFN_vkDeferredOperationJoinKHR vkDeferredOperationJoinKHR = 0; - - //=== VK_KHR_pipeline_executable_properties === - PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR = 0; - PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR = 0; - PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR = 0; - - //=== VK_NV_device_generated_commands === - PFN_vkGetGeneratedCommandsMemoryRequirementsNV vkGetGeneratedCommandsMemoryRequirementsNV = 0; - PFN_vkCmdPreprocessGeneratedCommandsNV vkCmdPreprocessGeneratedCommandsNV = 0; - PFN_vkCmdExecuteGeneratedCommandsNV vkCmdExecuteGeneratedCommandsNV = 0; - PFN_vkCmdBindPipelineShaderGroupNV vkCmdBindPipelineShaderGroupNV = 0; - PFN_vkCreateIndirectCommandsLayoutNV vkCreateIndirectCommandsLayoutNV = 0; - PFN_vkDestroyIndirectCommandsLayoutNV vkDestroyIndirectCommandsLayoutNV = 0; - - //=== VK_EXT_acquire_drm_display === - PFN_vkAcquireDrmDisplayEXT vkAcquireDrmDisplayEXT = 0; - PFN_vkGetDrmDisplayEXT vkGetDrmDisplayEXT = 0; - - //=== VK_EXT_private_data === - PFN_vkCreatePrivateDataSlotEXT vkCreatePrivateDataSlotEXT = 0; - PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT = 0; - PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT = 0; - PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT = 0; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR = 0; -#else - PFN_dummy vkCmdEncodeVideoKHR_placeholder = 0; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - PFN_vkExportMetalObjectsEXT vkExportMetalObjectsEXT = 0; -#else - PFN_dummy vkExportMetalObjectsEXT_placeholder = 0; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - PFN_vkCmdSetEvent2KHR vkCmdSetEvent2KHR = 0; - PFN_vkCmdResetEvent2KHR vkCmdResetEvent2KHR = 0; - PFN_vkCmdWaitEvents2KHR vkCmdWaitEvents2KHR = 0; - PFN_vkCmdPipelineBarrier2KHR vkCmdPipelineBarrier2KHR = 0; - PFN_vkCmdWriteTimestamp2KHR vkCmdWriteTimestamp2KHR = 0; - PFN_vkQueueSubmit2KHR vkQueueSubmit2KHR = 0; - PFN_vkCmdWriteBufferMarker2AMD vkCmdWriteBufferMarker2AMD = 0; - PFN_vkGetQueueCheckpointData2NV vkGetQueueCheckpointData2NV = 0; - - //=== VK_NV_fragment_shading_rate_enums === - PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV = 0; - - //=== VK_EXT_mesh_shader === - PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXT = 0; - PFN_vkCmdDrawMeshTasksIndirectEXT vkCmdDrawMeshTasksIndirectEXT = 0; - PFN_vkCmdDrawMeshTasksIndirectCountEXT vkCmdDrawMeshTasksIndirectCountEXT = 0; - - //=== VK_KHR_copy_commands2 === - PFN_vkCmdCopyBuffer2KHR vkCmdCopyBuffer2KHR = 0; - PFN_vkCmdCopyImage2KHR vkCmdCopyImage2KHR = 0; - PFN_vkCmdCopyBufferToImage2KHR vkCmdCopyBufferToImage2KHR = 0; - PFN_vkCmdCopyImageToBuffer2KHR vkCmdCopyImageToBuffer2KHR = 0; - PFN_vkCmdBlitImage2KHR vkCmdBlitImage2KHR = 0; - PFN_vkCmdResolveImage2KHR vkCmdResolveImage2KHR = 0; - - //=== VK_EXT_image_compression_control === - PFN_vkGetImageSubresourceLayout2EXT vkGetImageSubresourceLayout2EXT = 0; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV = 0; - PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV = 0; -#else - PFN_dummy vkAcquireWinrtDisplayNV_placeholder = 0; - PFN_dummy vkGetWinrtDisplayNV_placeholder = 0; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - PFN_vkCreateDirectFBSurfaceEXT vkCreateDirectFBSurfaceEXT = 0; - PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT vkGetPhysicalDeviceDirectFBPresentationSupportEXT = 0; -#else - PFN_dummy vkCreateDirectFBSurfaceEXT_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceDirectFBPresentationSupportEXT_placeholder = 0; -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - PFN_vkCmdTraceRaysKHR vkCmdTraceRaysKHR = 0; - PFN_vkCreateRayTracingPipelinesKHR vkCreateRayTracingPipelinesKHR = 0; - PFN_vkGetRayTracingShaderGroupHandlesKHR vkGetRayTracingShaderGroupHandlesKHR = 0; - PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = 0; - PFN_vkCmdTraceRaysIndirectKHR vkCmdTraceRaysIndirectKHR = 0; - PFN_vkGetRayTracingShaderGroupStackSizeKHR vkGetRayTracingShaderGroupStackSizeKHR = 0; - PFN_vkCmdSetRayTracingPipelineStackSizeKHR vkCmdSetRayTracingPipelineStackSizeKHR = 0; - - //=== VK_EXT_vertex_input_dynamic_state === - PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT = 0; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - PFN_vkGetMemoryZirconHandleFUCHSIA vkGetMemoryZirconHandleFUCHSIA = 0; - PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA vkGetMemoryZirconHandlePropertiesFUCHSIA = 0; -#else - PFN_dummy vkGetMemoryZirconHandleFUCHSIA_placeholder = 0; - PFN_dummy vkGetMemoryZirconHandlePropertiesFUCHSIA_placeholder = 0; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - PFN_vkImportSemaphoreZirconHandleFUCHSIA vkImportSemaphoreZirconHandleFUCHSIA = 0; - PFN_vkGetSemaphoreZirconHandleFUCHSIA vkGetSemaphoreZirconHandleFUCHSIA = 0; -#else - PFN_dummy vkImportSemaphoreZirconHandleFUCHSIA_placeholder = 0; - PFN_dummy vkGetSemaphoreZirconHandleFUCHSIA_placeholder = 0; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - PFN_vkCreateBufferCollectionFUCHSIA vkCreateBufferCollectionFUCHSIA = 0; - PFN_vkSetBufferCollectionImageConstraintsFUCHSIA vkSetBufferCollectionImageConstraintsFUCHSIA = 0; - PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA vkSetBufferCollectionBufferConstraintsFUCHSIA = 0; - PFN_vkDestroyBufferCollectionFUCHSIA vkDestroyBufferCollectionFUCHSIA = 0; - PFN_vkGetBufferCollectionPropertiesFUCHSIA vkGetBufferCollectionPropertiesFUCHSIA = 0; -#else - PFN_dummy vkCreateBufferCollectionFUCHSIA_placeholder = 0; - PFN_dummy vkSetBufferCollectionImageConstraintsFUCHSIA_placeholder = 0; - PFN_dummy vkSetBufferCollectionBufferConstraintsFUCHSIA_placeholder = 0; - PFN_dummy vkDestroyBufferCollectionFUCHSIA_placeholder = 0; - PFN_dummy vkGetBufferCollectionPropertiesFUCHSIA_placeholder = 0; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = 0; - PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI = 0; - - //=== VK_HUAWEI_invocation_mask === - PFN_vkCmdBindInvocationMaskHUAWEI vkCmdBindInvocationMaskHUAWEI = 0; - - //=== VK_NV_external_memory_rdma === - PFN_vkGetMemoryRemoteAddressNV vkGetMemoryRemoteAddressNV = 0; - - //=== VK_EXT_pipeline_properties === - PFN_vkGetPipelinePropertiesEXT vkGetPipelinePropertiesEXT = 0; - - //=== VK_EXT_extended_dynamic_state2 === - PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT = 0; - PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT = 0; - PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT = 0; - PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT = 0; - PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT = 0; - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - PFN_vkCreateScreenSurfaceQNX vkCreateScreenSurfaceQNX = 0; - PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX vkGetPhysicalDeviceScreenPresentationSupportQNX = 0; -#else - PFN_dummy vkCreateScreenSurfaceQNX_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceScreenPresentationSupportQNX_placeholder = 0; -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT = 0; - - //=== VK_KHR_ray_tracing_maintenance1 === - PFN_vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirect2KHR = 0; - - //=== VK_EXT_multi_draw === - PFN_vkCmdDrawMultiEXT vkCmdDrawMultiEXT = 0; - PFN_vkCmdDrawMultiIndexedEXT vkCmdDrawMultiIndexedEXT = 0; - - //=== VK_EXT_pageable_device_local_memory === - PFN_vkSetDeviceMemoryPriorityEXT vkSetDeviceMemoryPriorityEXT = 0; - - //=== VK_KHR_maintenance4 === - PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirementsKHR = 0; - PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirementsKHR = 0; - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceImageSparseMemoryRequirementsKHR = 0; - - //=== VK_VALVE_descriptor_set_host_mapping === - PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutHostMappingInfoVALVE = 0; - PFN_vkGetDescriptorSetHostMappingVALVE vkGetDescriptorSetHostMappingVALVE = 0; - - //=== VK_EXT_shader_module_identifier === - PFN_vkGetShaderModuleIdentifierEXT vkGetShaderModuleIdentifierEXT = 0; - PFN_vkGetShaderModuleCreateInfoIdentifierEXT vkGetShaderModuleCreateInfoIdentifierEXT = 0; - - //=== VK_QCOM_tile_properties === - PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM = 0; - PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM = 0; - - public: - DispatchLoaderDynamic() VULKAN_HPP_NOEXCEPT = default; - DispatchLoaderDynamic( DispatchLoaderDynamic const & rhs ) VULKAN_HPP_NOEXCEPT = default; - -#if !defined( VK_NO_PROTOTYPES ) - // This interface is designed to be used for per-device function pointers in combination with a linked vulkan library. - template - void init( VULKAN_HPP_NAMESPACE::Instance const & instance, VULKAN_HPP_NAMESPACE::Device const & device, DynamicLoader const & dl ) VULKAN_HPP_NOEXCEPT - { - PFN_vkGetInstanceProcAddr getInstanceProcAddr = dl.template getProcAddress( "vkGetInstanceProcAddr" ); - PFN_vkGetDeviceProcAddr getDeviceProcAddr = dl.template getProcAddress( "vkGetDeviceProcAddr" ); - init( static_cast( instance ), getInstanceProcAddr, static_cast( device ), device ? getDeviceProcAddr : nullptr ); - } - - // This interface is designed to be used for per-device function pointers in combination with a linked vulkan library. - template - void init( VULKAN_HPP_NAMESPACE::Instance const & instance, VULKAN_HPP_NAMESPACE::Device const & device ) VULKAN_HPP_NOEXCEPT - { - static DynamicLoader dl; - init( instance, device, dl ); - } -#endif // !defined( VK_NO_PROTOTYPES ) - - DispatchLoaderDynamic( PFN_vkGetInstanceProcAddr getInstanceProcAddr ) VULKAN_HPP_NOEXCEPT - { - init( getInstanceProcAddr ); - } - - void init( PFN_vkGetInstanceProcAddr getInstanceProcAddr ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getInstanceProcAddr ); - - vkGetInstanceProcAddr = getInstanceProcAddr; - - //=== VK_VERSION_1_0 === - vkCreateInstance = PFN_vkCreateInstance( vkGetInstanceProcAddr( NULL, "vkCreateInstance" ) ); - vkEnumerateInstanceExtensionProperties = - PFN_vkEnumerateInstanceExtensionProperties( vkGetInstanceProcAddr( NULL, "vkEnumerateInstanceExtensionProperties" ) ); - vkEnumerateInstanceLayerProperties = PFN_vkEnumerateInstanceLayerProperties( vkGetInstanceProcAddr( NULL, "vkEnumerateInstanceLayerProperties" ) ); - - //=== VK_VERSION_1_1 === - vkEnumerateInstanceVersion = PFN_vkEnumerateInstanceVersion( vkGetInstanceProcAddr( NULL, "vkEnumerateInstanceVersion" ) ); - } - - // This interface does not require a linked vulkan library. - DispatchLoaderDynamic( VkInstance instance, - PFN_vkGetInstanceProcAddr getInstanceProcAddr, - VkDevice device = {}, - PFN_vkGetDeviceProcAddr getDeviceProcAddr = nullptr ) VULKAN_HPP_NOEXCEPT - { - init( instance, getInstanceProcAddr, device, getDeviceProcAddr ); - } - - // This interface does not require a linked vulkan library. - void init( VkInstance instance, - PFN_vkGetInstanceProcAddr getInstanceProcAddr, - VkDevice device = {}, - PFN_vkGetDeviceProcAddr /*getDeviceProcAddr*/ = nullptr ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( instance && getInstanceProcAddr ); - vkGetInstanceProcAddr = getInstanceProcAddr; - init( VULKAN_HPP_NAMESPACE::Instance( instance ) ); - if ( device ) - { - init( VULKAN_HPP_NAMESPACE::Device( device ) ); - } - } - - void init( VULKAN_HPP_NAMESPACE::Instance instanceCpp ) VULKAN_HPP_NOEXCEPT - { - VkInstance instance = static_cast( instanceCpp ); - - //=== VK_VERSION_1_0 === - vkDestroyInstance = PFN_vkDestroyInstance( vkGetInstanceProcAddr( instance, "vkDestroyInstance" ) ); - vkEnumeratePhysicalDevices = PFN_vkEnumeratePhysicalDevices( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDevices" ) ); - vkGetPhysicalDeviceFeatures = PFN_vkGetPhysicalDeviceFeatures( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures" ) ); - vkGetPhysicalDeviceFormatProperties = PFN_vkGetPhysicalDeviceFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties" ) ); - vkGetPhysicalDeviceImageFormatProperties = - PFN_vkGetPhysicalDeviceImageFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties" ) ); - vkGetPhysicalDeviceProperties = PFN_vkGetPhysicalDeviceProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties" ) ); - vkGetPhysicalDeviceQueueFamilyProperties = - PFN_vkGetPhysicalDeviceQueueFamilyProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties" ) ); - vkGetPhysicalDeviceMemoryProperties = PFN_vkGetPhysicalDeviceMemoryProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties" ) ); - vkGetDeviceProcAddr = PFN_vkGetDeviceProcAddr( vkGetInstanceProcAddr( instance, "vkGetDeviceProcAddr" ) ); - vkCreateDevice = PFN_vkCreateDevice( vkGetInstanceProcAddr( instance, "vkCreateDevice" ) ); - vkDestroyDevice = PFN_vkDestroyDevice( vkGetInstanceProcAddr( instance, "vkDestroyDevice" ) ); - vkEnumerateDeviceExtensionProperties = - PFN_vkEnumerateDeviceExtensionProperties( vkGetInstanceProcAddr( instance, "vkEnumerateDeviceExtensionProperties" ) ); - vkEnumerateDeviceLayerProperties = PFN_vkEnumerateDeviceLayerProperties( vkGetInstanceProcAddr( instance, "vkEnumerateDeviceLayerProperties" ) ); - vkGetDeviceQueue = PFN_vkGetDeviceQueue( vkGetInstanceProcAddr( instance, "vkGetDeviceQueue" ) ); - vkQueueSubmit = PFN_vkQueueSubmit( vkGetInstanceProcAddr( instance, "vkQueueSubmit" ) ); - vkQueueWaitIdle = PFN_vkQueueWaitIdle( vkGetInstanceProcAddr( instance, "vkQueueWaitIdle" ) ); - vkDeviceWaitIdle = PFN_vkDeviceWaitIdle( vkGetInstanceProcAddr( instance, "vkDeviceWaitIdle" ) ); - vkAllocateMemory = PFN_vkAllocateMemory( vkGetInstanceProcAddr( instance, "vkAllocateMemory" ) ); - vkFreeMemory = PFN_vkFreeMemory( vkGetInstanceProcAddr( instance, "vkFreeMemory" ) ); - vkMapMemory = PFN_vkMapMemory( vkGetInstanceProcAddr( instance, "vkMapMemory" ) ); - vkUnmapMemory = PFN_vkUnmapMemory( vkGetInstanceProcAddr( instance, "vkUnmapMemory" ) ); - vkFlushMappedMemoryRanges = PFN_vkFlushMappedMemoryRanges( vkGetInstanceProcAddr( instance, "vkFlushMappedMemoryRanges" ) ); - vkInvalidateMappedMemoryRanges = PFN_vkInvalidateMappedMemoryRanges( vkGetInstanceProcAddr( instance, "vkInvalidateMappedMemoryRanges" ) ); - vkGetDeviceMemoryCommitment = PFN_vkGetDeviceMemoryCommitment( vkGetInstanceProcAddr( instance, "vkGetDeviceMemoryCommitment" ) ); - vkBindBufferMemory = PFN_vkBindBufferMemory( vkGetInstanceProcAddr( instance, "vkBindBufferMemory" ) ); - vkBindImageMemory = PFN_vkBindImageMemory( vkGetInstanceProcAddr( instance, "vkBindImageMemory" ) ); - vkGetBufferMemoryRequirements = PFN_vkGetBufferMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetBufferMemoryRequirements" ) ); - vkGetImageMemoryRequirements = PFN_vkGetImageMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetImageMemoryRequirements" ) ); - vkGetImageSparseMemoryRequirements = PFN_vkGetImageSparseMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetImageSparseMemoryRequirements" ) ); - vkGetPhysicalDeviceSparseImageFormatProperties = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties" ) ); - vkQueueBindSparse = PFN_vkQueueBindSparse( vkGetInstanceProcAddr( instance, "vkQueueBindSparse" ) ); - vkCreateFence = PFN_vkCreateFence( vkGetInstanceProcAddr( instance, "vkCreateFence" ) ); - vkDestroyFence = PFN_vkDestroyFence( vkGetInstanceProcAddr( instance, "vkDestroyFence" ) ); - vkResetFences = PFN_vkResetFences( vkGetInstanceProcAddr( instance, "vkResetFences" ) ); - vkGetFenceStatus = PFN_vkGetFenceStatus( vkGetInstanceProcAddr( instance, "vkGetFenceStatus" ) ); - vkWaitForFences = PFN_vkWaitForFences( vkGetInstanceProcAddr( instance, "vkWaitForFences" ) ); - vkCreateSemaphore = PFN_vkCreateSemaphore( vkGetInstanceProcAddr( instance, "vkCreateSemaphore" ) ); - vkDestroySemaphore = PFN_vkDestroySemaphore( vkGetInstanceProcAddr( instance, "vkDestroySemaphore" ) ); - vkCreateEvent = PFN_vkCreateEvent( vkGetInstanceProcAddr( instance, "vkCreateEvent" ) ); - vkDestroyEvent = PFN_vkDestroyEvent( vkGetInstanceProcAddr( instance, "vkDestroyEvent" ) ); - vkGetEventStatus = PFN_vkGetEventStatus( vkGetInstanceProcAddr( instance, "vkGetEventStatus" ) ); - vkSetEvent = PFN_vkSetEvent( vkGetInstanceProcAddr( instance, "vkSetEvent" ) ); - vkResetEvent = PFN_vkResetEvent( vkGetInstanceProcAddr( instance, "vkResetEvent" ) ); - vkCreateQueryPool = PFN_vkCreateQueryPool( vkGetInstanceProcAddr( instance, "vkCreateQueryPool" ) ); - vkDestroyQueryPool = PFN_vkDestroyQueryPool( vkGetInstanceProcAddr( instance, "vkDestroyQueryPool" ) ); - vkGetQueryPoolResults = PFN_vkGetQueryPoolResults( vkGetInstanceProcAddr( instance, "vkGetQueryPoolResults" ) ); - vkCreateBuffer = PFN_vkCreateBuffer( vkGetInstanceProcAddr( instance, "vkCreateBuffer" ) ); - vkDestroyBuffer = PFN_vkDestroyBuffer( vkGetInstanceProcAddr( instance, "vkDestroyBuffer" ) ); - vkCreateBufferView = PFN_vkCreateBufferView( vkGetInstanceProcAddr( instance, "vkCreateBufferView" ) ); - vkDestroyBufferView = PFN_vkDestroyBufferView( vkGetInstanceProcAddr( instance, "vkDestroyBufferView" ) ); - vkCreateImage = PFN_vkCreateImage( vkGetInstanceProcAddr( instance, "vkCreateImage" ) ); - vkDestroyImage = PFN_vkDestroyImage( vkGetInstanceProcAddr( instance, "vkDestroyImage" ) ); - vkGetImageSubresourceLayout = PFN_vkGetImageSubresourceLayout( vkGetInstanceProcAddr( instance, "vkGetImageSubresourceLayout" ) ); - vkCreateImageView = PFN_vkCreateImageView( vkGetInstanceProcAddr( instance, "vkCreateImageView" ) ); - vkDestroyImageView = PFN_vkDestroyImageView( vkGetInstanceProcAddr( instance, "vkDestroyImageView" ) ); - vkCreateShaderModule = PFN_vkCreateShaderModule( vkGetInstanceProcAddr( instance, "vkCreateShaderModule" ) ); - vkDestroyShaderModule = PFN_vkDestroyShaderModule( vkGetInstanceProcAddr( instance, "vkDestroyShaderModule" ) ); - vkCreatePipelineCache = PFN_vkCreatePipelineCache( vkGetInstanceProcAddr( instance, "vkCreatePipelineCache" ) ); - vkDestroyPipelineCache = PFN_vkDestroyPipelineCache( vkGetInstanceProcAddr( instance, "vkDestroyPipelineCache" ) ); - vkGetPipelineCacheData = PFN_vkGetPipelineCacheData( vkGetInstanceProcAddr( instance, "vkGetPipelineCacheData" ) ); - vkMergePipelineCaches = PFN_vkMergePipelineCaches( vkGetInstanceProcAddr( instance, "vkMergePipelineCaches" ) ); - vkCreateGraphicsPipelines = PFN_vkCreateGraphicsPipelines( vkGetInstanceProcAddr( instance, "vkCreateGraphicsPipelines" ) ); - vkCreateComputePipelines = PFN_vkCreateComputePipelines( vkGetInstanceProcAddr( instance, "vkCreateComputePipelines" ) ); - vkDestroyPipeline = PFN_vkDestroyPipeline( vkGetInstanceProcAddr( instance, "vkDestroyPipeline" ) ); - vkCreatePipelineLayout = PFN_vkCreatePipelineLayout( vkGetInstanceProcAddr( instance, "vkCreatePipelineLayout" ) ); - vkDestroyPipelineLayout = PFN_vkDestroyPipelineLayout( vkGetInstanceProcAddr( instance, "vkDestroyPipelineLayout" ) ); - vkCreateSampler = PFN_vkCreateSampler( vkGetInstanceProcAddr( instance, "vkCreateSampler" ) ); - vkDestroySampler = PFN_vkDestroySampler( vkGetInstanceProcAddr( instance, "vkDestroySampler" ) ); - vkCreateDescriptorSetLayout = PFN_vkCreateDescriptorSetLayout( vkGetInstanceProcAddr( instance, "vkCreateDescriptorSetLayout" ) ); - vkDestroyDescriptorSetLayout = PFN_vkDestroyDescriptorSetLayout( vkGetInstanceProcAddr( instance, "vkDestroyDescriptorSetLayout" ) ); - vkCreateDescriptorPool = PFN_vkCreateDescriptorPool( vkGetInstanceProcAddr( instance, "vkCreateDescriptorPool" ) ); - vkDestroyDescriptorPool = PFN_vkDestroyDescriptorPool( vkGetInstanceProcAddr( instance, "vkDestroyDescriptorPool" ) ); - vkResetDescriptorPool = PFN_vkResetDescriptorPool( vkGetInstanceProcAddr( instance, "vkResetDescriptorPool" ) ); - vkAllocateDescriptorSets = PFN_vkAllocateDescriptorSets( vkGetInstanceProcAddr( instance, "vkAllocateDescriptorSets" ) ); - vkFreeDescriptorSets = PFN_vkFreeDescriptorSets( vkGetInstanceProcAddr( instance, "vkFreeDescriptorSets" ) ); - vkUpdateDescriptorSets = PFN_vkUpdateDescriptorSets( vkGetInstanceProcAddr( instance, "vkUpdateDescriptorSets" ) ); - vkCreateFramebuffer = PFN_vkCreateFramebuffer( vkGetInstanceProcAddr( instance, "vkCreateFramebuffer" ) ); - vkDestroyFramebuffer = PFN_vkDestroyFramebuffer( vkGetInstanceProcAddr( instance, "vkDestroyFramebuffer" ) ); - vkCreateRenderPass = PFN_vkCreateRenderPass( vkGetInstanceProcAddr( instance, "vkCreateRenderPass" ) ); - vkDestroyRenderPass = PFN_vkDestroyRenderPass( vkGetInstanceProcAddr( instance, "vkDestroyRenderPass" ) ); - vkGetRenderAreaGranularity = PFN_vkGetRenderAreaGranularity( vkGetInstanceProcAddr( instance, "vkGetRenderAreaGranularity" ) ); - vkCreateCommandPool = PFN_vkCreateCommandPool( vkGetInstanceProcAddr( instance, "vkCreateCommandPool" ) ); - vkDestroyCommandPool = PFN_vkDestroyCommandPool( vkGetInstanceProcAddr( instance, "vkDestroyCommandPool" ) ); - vkResetCommandPool = PFN_vkResetCommandPool( vkGetInstanceProcAddr( instance, "vkResetCommandPool" ) ); - vkAllocateCommandBuffers = PFN_vkAllocateCommandBuffers( vkGetInstanceProcAddr( instance, "vkAllocateCommandBuffers" ) ); - vkFreeCommandBuffers = PFN_vkFreeCommandBuffers( vkGetInstanceProcAddr( instance, "vkFreeCommandBuffers" ) ); - vkBeginCommandBuffer = PFN_vkBeginCommandBuffer( vkGetInstanceProcAddr( instance, "vkBeginCommandBuffer" ) ); - vkEndCommandBuffer = PFN_vkEndCommandBuffer( vkGetInstanceProcAddr( instance, "vkEndCommandBuffer" ) ); - vkResetCommandBuffer = PFN_vkResetCommandBuffer( vkGetInstanceProcAddr( instance, "vkResetCommandBuffer" ) ); - vkCmdBindPipeline = PFN_vkCmdBindPipeline( vkGetInstanceProcAddr( instance, "vkCmdBindPipeline" ) ); - vkCmdSetViewport = PFN_vkCmdSetViewport( vkGetInstanceProcAddr( instance, "vkCmdSetViewport" ) ); - vkCmdSetScissor = PFN_vkCmdSetScissor( vkGetInstanceProcAddr( instance, "vkCmdSetScissor" ) ); - vkCmdSetLineWidth = PFN_vkCmdSetLineWidth( vkGetInstanceProcAddr( instance, "vkCmdSetLineWidth" ) ); - vkCmdSetDepthBias = PFN_vkCmdSetDepthBias( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBias" ) ); - vkCmdSetBlendConstants = PFN_vkCmdSetBlendConstants( vkGetInstanceProcAddr( instance, "vkCmdSetBlendConstants" ) ); - vkCmdSetDepthBounds = PFN_vkCmdSetDepthBounds( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBounds" ) ); - vkCmdSetStencilCompareMask = PFN_vkCmdSetStencilCompareMask( vkGetInstanceProcAddr( instance, "vkCmdSetStencilCompareMask" ) ); - vkCmdSetStencilWriteMask = PFN_vkCmdSetStencilWriteMask( vkGetInstanceProcAddr( instance, "vkCmdSetStencilWriteMask" ) ); - vkCmdSetStencilReference = PFN_vkCmdSetStencilReference( vkGetInstanceProcAddr( instance, "vkCmdSetStencilReference" ) ); - vkCmdBindDescriptorSets = PFN_vkCmdBindDescriptorSets( vkGetInstanceProcAddr( instance, "vkCmdBindDescriptorSets" ) ); - vkCmdBindIndexBuffer = PFN_vkCmdBindIndexBuffer( vkGetInstanceProcAddr( instance, "vkCmdBindIndexBuffer" ) ); - vkCmdBindVertexBuffers = PFN_vkCmdBindVertexBuffers( vkGetInstanceProcAddr( instance, "vkCmdBindVertexBuffers" ) ); - vkCmdDraw = PFN_vkCmdDraw( vkGetInstanceProcAddr( instance, "vkCmdDraw" ) ); - vkCmdDrawIndexed = PFN_vkCmdDrawIndexed( vkGetInstanceProcAddr( instance, "vkCmdDrawIndexed" ) ); - vkCmdDrawIndirect = PFN_vkCmdDrawIndirect( vkGetInstanceProcAddr( instance, "vkCmdDrawIndirect" ) ); - vkCmdDrawIndexedIndirect = PFN_vkCmdDrawIndexedIndirect( vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirect" ) ); - vkCmdDispatch = PFN_vkCmdDispatch( vkGetInstanceProcAddr( instance, "vkCmdDispatch" ) ); - vkCmdDispatchIndirect = PFN_vkCmdDispatchIndirect( vkGetInstanceProcAddr( instance, "vkCmdDispatchIndirect" ) ); - vkCmdCopyBuffer = PFN_vkCmdCopyBuffer( vkGetInstanceProcAddr( instance, "vkCmdCopyBuffer" ) ); - vkCmdCopyImage = PFN_vkCmdCopyImage( vkGetInstanceProcAddr( instance, "vkCmdCopyImage" ) ); - vkCmdBlitImage = PFN_vkCmdBlitImage( vkGetInstanceProcAddr( instance, "vkCmdBlitImage" ) ); - vkCmdCopyBufferToImage = PFN_vkCmdCopyBufferToImage( vkGetInstanceProcAddr( instance, "vkCmdCopyBufferToImage" ) ); - vkCmdCopyImageToBuffer = PFN_vkCmdCopyImageToBuffer( vkGetInstanceProcAddr( instance, "vkCmdCopyImageToBuffer" ) ); - vkCmdUpdateBuffer = PFN_vkCmdUpdateBuffer( vkGetInstanceProcAddr( instance, "vkCmdUpdateBuffer" ) ); - vkCmdFillBuffer = PFN_vkCmdFillBuffer( vkGetInstanceProcAddr( instance, "vkCmdFillBuffer" ) ); - vkCmdClearColorImage = PFN_vkCmdClearColorImage( vkGetInstanceProcAddr( instance, "vkCmdClearColorImage" ) ); - vkCmdClearDepthStencilImage = PFN_vkCmdClearDepthStencilImage( vkGetInstanceProcAddr( instance, "vkCmdClearDepthStencilImage" ) ); - vkCmdClearAttachments = PFN_vkCmdClearAttachments( vkGetInstanceProcAddr( instance, "vkCmdClearAttachments" ) ); - vkCmdResolveImage = PFN_vkCmdResolveImage( vkGetInstanceProcAddr( instance, "vkCmdResolveImage" ) ); - vkCmdSetEvent = PFN_vkCmdSetEvent( vkGetInstanceProcAddr( instance, "vkCmdSetEvent" ) ); - vkCmdResetEvent = PFN_vkCmdResetEvent( vkGetInstanceProcAddr( instance, "vkCmdResetEvent" ) ); - vkCmdWaitEvents = PFN_vkCmdWaitEvents( vkGetInstanceProcAddr( instance, "vkCmdWaitEvents" ) ); - vkCmdPipelineBarrier = PFN_vkCmdPipelineBarrier( vkGetInstanceProcAddr( instance, "vkCmdPipelineBarrier" ) ); - vkCmdBeginQuery = PFN_vkCmdBeginQuery( vkGetInstanceProcAddr( instance, "vkCmdBeginQuery" ) ); - vkCmdEndQuery = PFN_vkCmdEndQuery( vkGetInstanceProcAddr( instance, "vkCmdEndQuery" ) ); - vkCmdResetQueryPool = PFN_vkCmdResetQueryPool( vkGetInstanceProcAddr( instance, "vkCmdResetQueryPool" ) ); - vkCmdWriteTimestamp = PFN_vkCmdWriteTimestamp( vkGetInstanceProcAddr( instance, "vkCmdWriteTimestamp" ) ); - vkCmdCopyQueryPoolResults = PFN_vkCmdCopyQueryPoolResults( vkGetInstanceProcAddr( instance, "vkCmdCopyQueryPoolResults" ) ); - vkCmdPushConstants = PFN_vkCmdPushConstants( vkGetInstanceProcAddr( instance, "vkCmdPushConstants" ) ); - vkCmdBeginRenderPass = PFN_vkCmdBeginRenderPass( vkGetInstanceProcAddr( instance, "vkCmdBeginRenderPass" ) ); - vkCmdNextSubpass = PFN_vkCmdNextSubpass( vkGetInstanceProcAddr( instance, "vkCmdNextSubpass" ) ); - vkCmdEndRenderPass = PFN_vkCmdEndRenderPass( vkGetInstanceProcAddr( instance, "vkCmdEndRenderPass" ) ); - vkCmdExecuteCommands = PFN_vkCmdExecuteCommands( vkGetInstanceProcAddr( instance, "vkCmdExecuteCommands" ) ); - - //=== VK_VERSION_1_1 === - vkBindBufferMemory2 = PFN_vkBindBufferMemory2( vkGetInstanceProcAddr( instance, "vkBindBufferMemory2" ) ); - vkBindImageMemory2 = PFN_vkBindImageMemory2( vkGetInstanceProcAddr( instance, "vkBindImageMemory2" ) ); - vkGetDeviceGroupPeerMemoryFeatures = PFN_vkGetDeviceGroupPeerMemoryFeatures( vkGetInstanceProcAddr( instance, "vkGetDeviceGroupPeerMemoryFeatures" ) ); - vkCmdSetDeviceMask = PFN_vkCmdSetDeviceMask( vkGetInstanceProcAddr( instance, "vkCmdSetDeviceMask" ) ); - vkCmdDispatchBase = PFN_vkCmdDispatchBase( vkGetInstanceProcAddr( instance, "vkCmdDispatchBase" ) ); - vkEnumeratePhysicalDeviceGroups = PFN_vkEnumeratePhysicalDeviceGroups( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceGroups" ) ); - vkGetImageMemoryRequirements2 = PFN_vkGetImageMemoryRequirements2( vkGetInstanceProcAddr( instance, "vkGetImageMemoryRequirements2" ) ); - vkGetBufferMemoryRequirements2 = PFN_vkGetBufferMemoryRequirements2( vkGetInstanceProcAddr( instance, "vkGetBufferMemoryRequirements2" ) ); - vkGetImageSparseMemoryRequirements2 = PFN_vkGetImageSparseMemoryRequirements2( vkGetInstanceProcAddr( instance, "vkGetImageSparseMemoryRequirements2" ) ); - vkGetPhysicalDeviceFeatures2 = PFN_vkGetPhysicalDeviceFeatures2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures2" ) ); - vkGetPhysicalDeviceProperties2 = PFN_vkGetPhysicalDeviceProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties2" ) ); - vkGetPhysicalDeviceFormatProperties2 = - PFN_vkGetPhysicalDeviceFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties2" ) ); - vkGetPhysicalDeviceImageFormatProperties2 = - PFN_vkGetPhysicalDeviceImageFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties2" ) ); - vkGetPhysicalDeviceQueueFamilyProperties2 = - PFN_vkGetPhysicalDeviceQueueFamilyProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties2" ) ); - vkGetPhysicalDeviceMemoryProperties2 = - PFN_vkGetPhysicalDeviceMemoryProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties2" ) ); - vkGetPhysicalDeviceSparseImageFormatProperties2 = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties2" ) ); - vkTrimCommandPool = PFN_vkTrimCommandPool( vkGetInstanceProcAddr( instance, "vkTrimCommandPool" ) ); - vkGetDeviceQueue2 = PFN_vkGetDeviceQueue2( vkGetInstanceProcAddr( instance, "vkGetDeviceQueue2" ) ); - vkCreateSamplerYcbcrConversion = PFN_vkCreateSamplerYcbcrConversion( vkGetInstanceProcAddr( instance, "vkCreateSamplerYcbcrConversion" ) ); - vkDestroySamplerYcbcrConversion = PFN_vkDestroySamplerYcbcrConversion( vkGetInstanceProcAddr( instance, "vkDestroySamplerYcbcrConversion" ) ); - vkCreateDescriptorUpdateTemplate = PFN_vkCreateDescriptorUpdateTemplate( vkGetInstanceProcAddr( instance, "vkCreateDescriptorUpdateTemplate" ) ); - vkDestroyDescriptorUpdateTemplate = PFN_vkDestroyDescriptorUpdateTemplate( vkGetInstanceProcAddr( instance, "vkDestroyDescriptorUpdateTemplate" ) ); - vkUpdateDescriptorSetWithTemplate = PFN_vkUpdateDescriptorSetWithTemplate( vkGetInstanceProcAddr( instance, "vkUpdateDescriptorSetWithTemplate" ) ); - vkGetPhysicalDeviceExternalBufferProperties = - PFN_vkGetPhysicalDeviceExternalBufferProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalBufferProperties" ) ); - vkGetPhysicalDeviceExternalFenceProperties = - PFN_vkGetPhysicalDeviceExternalFenceProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalFenceProperties" ) ); - vkGetPhysicalDeviceExternalSemaphoreProperties = - PFN_vkGetPhysicalDeviceExternalSemaphoreProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalSemaphoreProperties" ) ); - vkGetDescriptorSetLayoutSupport = PFN_vkGetDescriptorSetLayoutSupport( vkGetInstanceProcAddr( instance, "vkGetDescriptorSetLayoutSupport" ) ); - - //=== VK_VERSION_1_2 === - vkCmdDrawIndirectCount = PFN_vkCmdDrawIndirectCount( vkGetInstanceProcAddr( instance, "vkCmdDrawIndirectCount" ) ); - vkCmdDrawIndexedIndirectCount = PFN_vkCmdDrawIndexedIndirectCount( vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirectCount" ) ); - vkCreateRenderPass2 = PFN_vkCreateRenderPass2( vkGetInstanceProcAddr( instance, "vkCreateRenderPass2" ) ); - vkCmdBeginRenderPass2 = PFN_vkCmdBeginRenderPass2( vkGetInstanceProcAddr( instance, "vkCmdBeginRenderPass2" ) ); - vkCmdNextSubpass2 = PFN_vkCmdNextSubpass2( vkGetInstanceProcAddr( instance, "vkCmdNextSubpass2" ) ); - vkCmdEndRenderPass2 = PFN_vkCmdEndRenderPass2( vkGetInstanceProcAddr( instance, "vkCmdEndRenderPass2" ) ); - vkResetQueryPool = PFN_vkResetQueryPool( vkGetInstanceProcAddr( instance, "vkResetQueryPool" ) ); - vkGetSemaphoreCounterValue = PFN_vkGetSemaphoreCounterValue( vkGetInstanceProcAddr( instance, "vkGetSemaphoreCounterValue" ) ); - vkWaitSemaphores = PFN_vkWaitSemaphores( vkGetInstanceProcAddr( instance, "vkWaitSemaphores" ) ); - vkSignalSemaphore = PFN_vkSignalSemaphore( vkGetInstanceProcAddr( instance, "vkSignalSemaphore" ) ); - vkGetBufferDeviceAddress = PFN_vkGetBufferDeviceAddress( vkGetInstanceProcAddr( instance, "vkGetBufferDeviceAddress" ) ); - vkGetBufferOpaqueCaptureAddress = PFN_vkGetBufferOpaqueCaptureAddress( vkGetInstanceProcAddr( instance, "vkGetBufferOpaqueCaptureAddress" ) ); - vkGetDeviceMemoryOpaqueCaptureAddress = - PFN_vkGetDeviceMemoryOpaqueCaptureAddress( vkGetInstanceProcAddr( instance, "vkGetDeviceMemoryOpaqueCaptureAddress" ) ); - - //=== VK_VERSION_1_3 === - vkGetPhysicalDeviceToolProperties = PFN_vkGetPhysicalDeviceToolProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceToolProperties" ) ); - vkCreatePrivateDataSlot = PFN_vkCreatePrivateDataSlot( vkGetInstanceProcAddr( instance, "vkCreatePrivateDataSlot" ) ); - vkDestroyPrivateDataSlot = PFN_vkDestroyPrivateDataSlot( vkGetInstanceProcAddr( instance, "vkDestroyPrivateDataSlot" ) ); - vkSetPrivateData = PFN_vkSetPrivateData( vkGetInstanceProcAddr( instance, "vkSetPrivateData" ) ); - vkGetPrivateData = PFN_vkGetPrivateData( vkGetInstanceProcAddr( instance, "vkGetPrivateData" ) ); - vkCmdSetEvent2 = PFN_vkCmdSetEvent2( vkGetInstanceProcAddr( instance, "vkCmdSetEvent2" ) ); - vkCmdResetEvent2 = PFN_vkCmdResetEvent2( vkGetInstanceProcAddr( instance, "vkCmdResetEvent2" ) ); - vkCmdWaitEvents2 = PFN_vkCmdWaitEvents2( vkGetInstanceProcAddr( instance, "vkCmdWaitEvents2" ) ); - vkCmdPipelineBarrier2 = PFN_vkCmdPipelineBarrier2( vkGetInstanceProcAddr( instance, "vkCmdPipelineBarrier2" ) ); - vkCmdWriteTimestamp2 = PFN_vkCmdWriteTimestamp2( vkGetInstanceProcAddr( instance, "vkCmdWriteTimestamp2" ) ); - vkQueueSubmit2 = PFN_vkQueueSubmit2( vkGetInstanceProcAddr( instance, "vkQueueSubmit2" ) ); - vkCmdCopyBuffer2 = PFN_vkCmdCopyBuffer2( vkGetInstanceProcAddr( instance, "vkCmdCopyBuffer2" ) ); - vkCmdCopyImage2 = PFN_vkCmdCopyImage2( vkGetInstanceProcAddr( instance, "vkCmdCopyImage2" ) ); - vkCmdCopyBufferToImage2 = PFN_vkCmdCopyBufferToImage2( vkGetInstanceProcAddr( instance, "vkCmdCopyBufferToImage2" ) ); - vkCmdCopyImageToBuffer2 = PFN_vkCmdCopyImageToBuffer2( vkGetInstanceProcAddr( instance, "vkCmdCopyImageToBuffer2" ) ); - vkCmdBlitImage2 = PFN_vkCmdBlitImage2( vkGetInstanceProcAddr( instance, "vkCmdBlitImage2" ) ); - vkCmdResolveImage2 = PFN_vkCmdResolveImage2( vkGetInstanceProcAddr( instance, "vkCmdResolveImage2" ) ); - vkCmdBeginRendering = PFN_vkCmdBeginRendering( vkGetInstanceProcAddr( instance, "vkCmdBeginRendering" ) ); - vkCmdEndRendering = PFN_vkCmdEndRendering( vkGetInstanceProcAddr( instance, "vkCmdEndRendering" ) ); - vkCmdSetCullMode = PFN_vkCmdSetCullMode( vkGetInstanceProcAddr( instance, "vkCmdSetCullMode" ) ); - vkCmdSetFrontFace = PFN_vkCmdSetFrontFace( vkGetInstanceProcAddr( instance, "vkCmdSetFrontFace" ) ); - vkCmdSetPrimitiveTopology = PFN_vkCmdSetPrimitiveTopology( vkGetInstanceProcAddr( instance, "vkCmdSetPrimitiveTopology" ) ); - vkCmdSetViewportWithCount = PFN_vkCmdSetViewportWithCount( vkGetInstanceProcAddr( instance, "vkCmdSetViewportWithCount" ) ); - vkCmdSetScissorWithCount = PFN_vkCmdSetScissorWithCount( vkGetInstanceProcAddr( instance, "vkCmdSetScissorWithCount" ) ); - vkCmdBindVertexBuffers2 = PFN_vkCmdBindVertexBuffers2( vkGetInstanceProcAddr( instance, "vkCmdBindVertexBuffers2" ) ); - vkCmdSetDepthTestEnable = PFN_vkCmdSetDepthTestEnable( vkGetInstanceProcAddr( instance, "vkCmdSetDepthTestEnable" ) ); - vkCmdSetDepthWriteEnable = PFN_vkCmdSetDepthWriteEnable( vkGetInstanceProcAddr( instance, "vkCmdSetDepthWriteEnable" ) ); - vkCmdSetDepthCompareOp = PFN_vkCmdSetDepthCompareOp( vkGetInstanceProcAddr( instance, "vkCmdSetDepthCompareOp" ) ); - vkCmdSetDepthBoundsTestEnable = PFN_vkCmdSetDepthBoundsTestEnable( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBoundsTestEnable" ) ); - vkCmdSetStencilTestEnable = PFN_vkCmdSetStencilTestEnable( vkGetInstanceProcAddr( instance, "vkCmdSetStencilTestEnable" ) ); - vkCmdSetStencilOp = PFN_vkCmdSetStencilOp( vkGetInstanceProcAddr( instance, "vkCmdSetStencilOp" ) ); - vkCmdSetRasterizerDiscardEnable = PFN_vkCmdSetRasterizerDiscardEnable( vkGetInstanceProcAddr( instance, "vkCmdSetRasterizerDiscardEnable" ) ); - vkCmdSetDepthBiasEnable = PFN_vkCmdSetDepthBiasEnable( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBiasEnable" ) ); - vkCmdSetPrimitiveRestartEnable = PFN_vkCmdSetPrimitiveRestartEnable( vkGetInstanceProcAddr( instance, "vkCmdSetPrimitiveRestartEnable" ) ); - vkGetDeviceBufferMemoryRequirements = PFN_vkGetDeviceBufferMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetDeviceBufferMemoryRequirements" ) ); - vkGetDeviceImageMemoryRequirements = PFN_vkGetDeviceImageMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetDeviceImageMemoryRequirements" ) ); - vkGetDeviceImageSparseMemoryRequirements = - PFN_vkGetDeviceImageSparseMemoryRequirements( vkGetInstanceProcAddr( instance, "vkGetDeviceImageSparseMemoryRequirements" ) ); - - //=== VK_KHR_surface === - vkDestroySurfaceKHR = PFN_vkDestroySurfaceKHR( vkGetInstanceProcAddr( instance, "vkDestroySurfaceKHR" ) ); - vkGetPhysicalDeviceSurfaceSupportKHR = - PFN_vkGetPhysicalDeviceSurfaceSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceSupportKHR" ) ); - vkGetPhysicalDeviceSurfaceCapabilitiesKHR = - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR" ) ); - vkGetPhysicalDeviceSurfaceFormatsKHR = - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormatsKHR" ) ); - vkGetPhysicalDeviceSurfacePresentModesKHR = - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfacePresentModesKHR" ) ); - - //=== VK_KHR_swapchain === - vkCreateSwapchainKHR = PFN_vkCreateSwapchainKHR( vkGetInstanceProcAddr( instance, "vkCreateSwapchainKHR" ) ); - vkDestroySwapchainKHR = PFN_vkDestroySwapchainKHR( vkGetInstanceProcAddr( instance, "vkDestroySwapchainKHR" ) ); - vkGetSwapchainImagesKHR = PFN_vkGetSwapchainImagesKHR( vkGetInstanceProcAddr( instance, "vkGetSwapchainImagesKHR" ) ); - vkAcquireNextImageKHR = PFN_vkAcquireNextImageKHR( vkGetInstanceProcAddr( instance, "vkAcquireNextImageKHR" ) ); - vkQueuePresentKHR = PFN_vkQueuePresentKHR( vkGetInstanceProcAddr( instance, "vkQueuePresentKHR" ) ); - vkGetDeviceGroupPresentCapabilitiesKHR = - PFN_vkGetDeviceGroupPresentCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceGroupPresentCapabilitiesKHR" ) ); - vkGetDeviceGroupSurfacePresentModesKHR = - PFN_vkGetDeviceGroupSurfacePresentModesKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceGroupSurfacePresentModesKHR" ) ); - vkGetPhysicalDevicePresentRectanglesKHR = - PFN_vkGetPhysicalDevicePresentRectanglesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDevicePresentRectanglesKHR" ) ); - vkAcquireNextImage2KHR = PFN_vkAcquireNextImage2KHR( vkGetInstanceProcAddr( instance, "vkAcquireNextImage2KHR" ) ); - - //=== VK_KHR_display === - vkGetPhysicalDeviceDisplayPropertiesKHR = - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPropertiesKHR" ) ); - vkGetPhysicalDeviceDisplayPlanePropertiesKHR = - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR" ) ); - vkGetDisplayPlaneSupportedDisplaysKHR = - PFN_vkGetDisplayPlaneSupportedDisplaysKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneSupportedDisplaysKHR" ) ); - vkGetDisplayModePropertiesKHR = PFN_vkGetDisplayModePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayModePropertiesKHR" ) ); - vkCreateDisplayModeKHR = PFN_vkCreateDisplayModeKHR( vkGetInstanceProcAddr( instance, "vkCreateDisplayModeKHR" ) ); - vkGetDisplayPlaneCapabilitiesKHR = PFN_vkGetDisplayPlaneCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneCapabilitiesKHR" ) ); - vkCreateDisplayPlaneSurfaceKHR = PFN_vkCreateDisplayPlaneSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateDisplayPlaneSurfaceKHR" ) ); - - //=== VK_KHR_display_swapchain === - vkCreateSharedSwapchainsKHR = PFN_vkCreateSharedSwapchainsKHR( vkGetInstanceProcAddr( instance, "vkCreateSharedSwapchainsKHR" ) ); - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - vkCreateXlibSurfaceKHR = PFN_vkCreateXlibSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateXlibSurfaceKHR" ) ); - vkGetPhysicalDeviceXlibPresentationSupportKHR = - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceXlibPresentationSupportKHR" ) ); -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - vkCreateXcbSurfaceKHR = PFN_vkCreateXcbSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateXcbSurfaceKHR" ) ); - vkGetPhysicalDeviceXcbPresentationSupportKHR = - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceXcbPresentationSupportKHR" ) ); -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - vkCreateWaylandSurfaceKHR = PFN_vkCreateWaylandSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateWaylandSurfaceKHR" ) ); - vkGetPhysicalDeviceWaylandPresentationSupportKHR = - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceWaylandPresentationSupportKHR" ) ); -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - vkCreateAndroidSurfaceKHR = PFN_vkCreateAndroidSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateAndroidSurfaceKHR" ) ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - vkCreateWin32SurfaceKHR = PFN_vkCreateWin32SurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateWin32SurfaceKHR" ) ); - vkGetPhysicalDeviceWin32PresentationSupportKHR = - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceWin32PresentationSupportKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - vkCreateDebugReportCallbackEXT = PFN_vkCreateDebugReportCallbackEXT( vkGetInstanceProcAddr( instance, "vkCreateDebugReportCallbackEXT" ) ); - vkDestroyDebugReportCallbackEXT = PFN_vkDestroyDebugReportCallbackEXT( vkGetInstanceProcAddr( instance, "vkDestroyDebugReportCallbackEXT" ) ); - vkDebugReportMessageEXT = PFN_vkDebugReportMessageEXT( vkGetInstanceProcAddr( instance, "vkDebugReportMessageEXT" ) ); - - //=== VK_EXT_debug_marker === - vkDebugMarkerSetObjectTagEXT = PFN_vkDebugMarkerSetObjectTagEXT( vkGetInstanceProcAddr( instance, "vkDebugMarkerSetObjectTagEXT" ) ); - vkDebugMarkerSetObjectNameEXT = PFN_vkDebugMarkerSetObjectNameEXT( vkGetInstanceProcAddr( instance, "vkDebugMarkerSetObjectNameEXT" ) ); - vkCmdDebugMarkerBeginEXT = PFN_vkCmdDebugMarkerBeginEXT( vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerBeginEXT" ) ); - vkCmdDebugMarkerEndEXT = PFN_vkCmdDebugMarkerEndEXT( vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerEndEXT" ) ); - vkCmdDebugMarkerInsertEXT = PFN_vkCmdDebugMarkerInsertEXT( vkGetInstanceProcAddr( instance, "vkCmdDebugMarkerInsertEXT" ) ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - vkGetPhysicalDeviceVideoCapabilitiesKHR = - PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceVideoCapabilitiesKHR" ) ); - vkGetPhysicalDeviceVideoFormatPropertiesKHR = - PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceVideoFormatPropertiesKHR" ) ); - vkCreateVideoSessionKHR = PFN_vkCreateVideoSessionKHR( vkGetInstanceProcAddr( instance, "vkCreateVideoSessionKHR" ) ); - vkDestroyVideoSessionKHR = PFN_vkDestroyVideoSessionKHR( vkGetInstanceProcAddr( instance, "vkDestroyVideoSessionKHR" ) ); - vkGetVideoSessionMemoryRequirementsKHR = - PFN_vkGetVideoSessionMemoryRequirementsKHR( vkGetInstanceProcAddr( instance, "vkGetVideoSessionMemoryRequirementsKHR" ) ); - vkBindVideoSessionMemoryKHR = PFN_vkBindVideoSessionMemoryKHR( vkGetInstanceProcAddr( instance, "vkBindVideoSessionMemoryKHR" ) ); - vkCreateVideoSessionParametersKHR = PFN_vkCreateVideoSessionParametersKHR( vkGetInstanceProcAddr( instance, "vkCreateVideoSessionParametersKHR" ) ); - vkUpdateVideoSessionParametersKHR = PFN_vkUpdateVideoSessionParametersKHR( vkGetInstanceProcAddr( instance, "vkUpdateVideoSessionParametersKHR" ) ); - vkDestroyVideoSessionParametersKHR = PFN_vkDestroyVideoSessionParametersKHR( vkGetInstanceProcAddr( instance, "vkDestroyVideoSessionParametersKHR" ) ); - vkCmdBeginVideoCodingKHR = PFN_vkCmdBeginVideoCodingKHR( vkGetInstanceProcAddr( instance, "vkCmdBeginVideoCodingKHR" ) ); - vkCmdEndVideoCodingKHR = PFN_vkCmdEndVideoCodingKHR( vkGetInstanceProcAddr( instance, "vkCmdEndVideoCodingKHR" ) ); - vkCmdControlVideoCodingKHR = PFN_vkCmdControlVideoCodingKHR( vkGetInstanceProcAddr( instance, "vkCmdControlVideoCodingKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - vkCmdDecodeVideoKHR = PFN_vkCmdDecodeVideoKHR( vkGetInstanceProcAddr( instance, "vkCmdDecodeVideoKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - vkCmdBindTransformFeedbackBuffersEXT = - PFN_vkCmdBindTransformFeedbackBuffersEXT( vkGetInstanceProcAddr( instance, "vkCmdBindTransformFeedbackBuffersEXT" ) ); - vkCmdBeginTransformFeedbackEXT = PFN_vkCmdBeginTransformFeedbackEXT( vkGetInstanceProcAddr( instance, "vkCmdBeginTransformFeedbackEXT" ) ); - vkCmdEndTransformFeedbackEXT = PFN_vkCmdEndTransformFeedbackEXT( vkGetInstanceProcAddr( instance, "vkCmdEndTransformFeedbackEXT" ) ); - vkCmdBeginQueryIndexedEXT = PFN_vkCmdBeginQueryIndexedEXT( vkGetInstanceProcAddr( instance, "vkCmdBeginQueryIndexedEXT" ) ); - vkCmdEndQueryIndexedEXT = PFN_vkCmdEndQueryIndexedEXT( vkGetInstanceProcAddr( instance, "vkCmdEndQueryIndexedEXT" ) ); - vkCmdDrawIndirectByteCountEXT = PFN_vkCmdDrawIndirectByteCountEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawIndirectByteCountEXT" ) ); - - //=== VK_NVX_binary_import === - vkCreateCuModuleNVX = PFN_vkCreateCuModuleNVX( vkGetInstanceProcAddr( instance, "vkCreateCuModuleNVX" ) ); - vkCreateCuFunctionNVX = PFN_vkCreateCuFunctionNVX( vkGetInstanceProcAddr( instance, "vkCreateCuFunctionNVX" ) ); - vkDestroyCuModuleNVX = PFN_vkDestroyCuModuleNVX( vkGetInstanceProcAddr( instance, "vkDestroyCuModuleNVX" ) ); - vkDestroyCuFunctionNVX = PFN_vkDestroyCuFunctionNVX( vkGetInstanceProcAddr( instance, "vkDestroyCuFunctionNVX" ) ); - vkCmdCuLaunchKernelNVX = PFN_vkCmdCuLaunchKernelNVX( vkGetInstanceProcAddr( instance, "vkCmdCuLaunchKernelNVX" ) ); - - //=== VK_NVX_image_view_handle === - vkGetImageViewHandleNVX = PFN_vkGetImageViewHandleNVX( vkGetInstanceProcAddr( instance, "vkGetImageViewHandleNVX" ) ); - vkGetImageViewAddressNVX = PFN_vkGetImageViewAddressNVX( vkGetInstanceProcAddr( instance, "vkGetImageViewAddressNVX" ) ); - - //=== VK_AMD_draw_indirect_count === - vkCmdDrawIndirectCountAMD = PFN_vkCmdDrawIndirectCountAMD( vkGetInstanceProcAddr( instance, "vkCmdDrawIndirectCountAMD" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountAMD; - vkCmdDrawIndexedIndirectCountAMD = PFN_vkCmdDrawIndexedIndirectCountAMD( vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirectCountAMD" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountAMD; - - //=== VK_AMD_shader_info === - vkGetShaderInfoAMD = PFN_vkGetShaderInfoAMD( vkGetInstanceProcAddr( instance, "vkGetShaderInfoAMD" ) ); - - //=== VK_KHR_dynamic_rendering === - vkCmdBeginRenderingKHR = PFN_vkCmdBeginRenderingKHR( vkGetInstanceProcAddr( instance, "vkCmdBeginRenderingKHR" ) ); - if ( !vkCmdBeginRendering ) - vkCmdBeginRendering = vkCmdBeginRenderingKHR; - vkCmdEndRenderingKHR = PFN_vkCmdEndRenderingKHR( vkGetInstanceProcAddr( instance, "vkCmdEndRenderingKHR" ) ); - if ( !vkCmdEndRendering ) - vkCmdEndRendering = vkCmdEndRenderingKHR; - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - vkCreateStreamDescriptorSurfaceGGP = PFN_vkCreateStreamDescriptorSurfaceGGP( vkGetInstanceProcAddr( instance, "vkCreateStreamDescriptorSurfaceGGP" ) ); -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - vkGetPhysicalDeviceExternalImageFormatPropertiesNV = - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - vkGetMemoryWin32HandleNV = PFN_vkGetMemoryWin32HandleNV( vkGetInstanceProcAddr( instance, "vkGetMemoryWin32HandleNV" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_get_physical_device_properties2 === - vkGetPhysicalDeviceFeatures2KHR = PFN_vkGetPhysicalDeviceFeatures2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures2KHR" ) ); - if ( !vkGetPhysicalDeviceFeatures2 ) - vkGetPhysicalDeviceFeatures2 = vkGetPhysicalDeviceFeatures2KHR; - vkGetPhysicalDeviceProperties2KHR = PFN_vkGetPhysicalDeviceProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceProperties2 ) - vkGetPhysicalDeviceProperties2 = vkGetPhysicalDeviceProperties2KHR; - vkGetPhysicalDeviceFormatProperties2KHR = - PFN_vkGetPhysicalDeviceFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceFormatProperties2 ) - vkGetPhysicalDeviceFormatProperties2 = vkGetPhysicalDeviceFormatProperties2KHR; - vkGetPhysicalDeviceImageFormatProperties2KHR = - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceImageFormatProperties2 ) - vkGetPhysicalDeviceImageFormatProperties2 = vkGetPhysicalDeviceImageFormatProperties2KHR; - vkGetPhysicalDeviceQueueFamilyProperties2KHR = - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceQueueFamilyProperties2 ) - vkGetPhysicalDeviceQueueFamilyProperties2 = vkGetPhysicalDeviceQueueFamilyProperties2KHR; - vkGetPhysicalDeviceMemoryProperties2KHR = - PFN_vkGetPhysicalDeviceMemoryProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceMemoryProperties2 ) - vkGetPhysicalDeviceMemoryProperties2 = vkGetPhysicalDeviceMemoryProperties2KHR; - vkGetPhysicalDeviceSparseImageFormatProperties2KHR = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceSparseImageFormatProperties2 ) - vkGetPhysicalDeviceSparseImageFormatProperties2 = vkGetPhysicalDeviceSparseImageFormatProperties2KHR; - - //=== VK_KHR_device_group === - vkGetDeviceGroupPeerMemoryFeaturesKHR = - PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceGroupPeerMemoryFeaturesKHR" ) ); - if ( !vkGetDeviceGroupPeerMemoryFeatures ) - vkGetDeviceGroupPeerMemoryFeatures = vkGetDeviceGroupPeerMemoryFeaturesKHR; - vkCmdSetDeviceMaskKHR = PFN_vkCmdSetDeviceMaskKHR( vkGetInstanceProcAddr( instance, "vkCmdSetDeviceMaskKHR" ) ); - if ( !vkCmdSetDeviceMask ) - vkCmdSetDeviceMask = vkCmdSetDeviceMaskKHR; - vkCmdDispatchBaseKHR = PFN_vkCmdDispatchBaseKHR( vkGetInstanceProcAddr( instance, "vkCmdDispatchBaseKHR" ) ); - if ( !vkCmdDispatchBase ) - vkCmdDispatchBase = vkCmdDispatchBaseKHR; - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - vkCreateViSurfaceNN = PFN_vkCreateViSurfaceNN( vkGetInstanceProcAddr( instance, "vkCreateViSurfaceNN" ) ); -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_maintenance1 === - vkTrimCommandPoolKHR = PFN_vkTrimCommandPoolKHR( vkGetInstanceProcAddr( instance, "vkTrimCommandPoolKHR" ) ); - if ( !vkTrimCommandPool ) - vkTrimCommandPool = vkTrimCommandPoolKHR; - - //=== VK_KHR_device_group_creation === - vkEnumeratePhysicalDeviceGroupsKHR = PFN_vkEnumeratePhysicalDeviceGroupsKHR( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceGroupsKHR" ) ); - if ( !vkEnumeratePhysicalDeviceGroups ) - vkEnumeratePhysicalDeviceGroups = vkEnumeratePhysicalDeviceGroupsKHR; - - //=== VK_KHR_external_memory_capabilities === - vkGetPhysicalDeviceExternalBufferPropertiesKHR = - PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalBufferProperties ) - vkGetPhysicalDeviceExternalBufferProperties = vkGetPhysicalDeviceExternalBufferPropertiesKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - vkGetMemoryWin32HandleKHR = PFN_vkGetMemoryWin32HandleKHR( vkGetInstanceProcAddr( instance, "vkGetMemoryWin32HandleKHR" ) ); - vkGetMemoryWin32HandlePropertiesKHR = PFN_vkGetMemoryWin32HandlePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetMemoryWin32HandlePropertiesKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - vkGetMemoryFdKHR = PFN_vkGetMemoryFdKHR( vkGetInstanceProcAddr( instance, "vkGetMemoryFdKHR" ) ); - vkGetMemoryFdPropertiesKHR = PFN_vkGetMemoryFdPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetMemoryFdPropertiesKHR" ) ); - - //=== VK_KHR_external_semaphore_capabilities === - vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = - PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalSemaphoreProperties ) - vkGetPhysicalDeviceExternalSemaphoreProperties = vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - vkImportSemaphoreWin32HandleKHR = PFN_vkImportSemaphoreWin32HandleKHR( vkGetInstanceProcAddr( instance, "vkImportSemaphoreWin32HandleKHR" ) ); - vkGetSemaphoreWin32HandleKHR = PFN_vkGetSemaphoreWin32HandleKHR( vkGetInstanceProcAddr( instance, "vkGetSemaphoreWin32HandleKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - vkImportSemaphoreFdKHR = PFN_vkImportSemaphoreFdKHR( vkGetInstanceProcAddr( instance, "vkImportSemaphoreFdKHR" ) ); - vkGetSemaphoreFdKHR = PFN_vkGetSemaphoreFdKHR( vkGetInstanceProcAddr( instance, "vkGetSemaphoreFdKHR" ) ); - - //=== VK_KHR_push_descriptor === - vkCmdPushDescriptorSetKHR = PFN_vkCmdPushDescriptorSetKHR( vkGetInstanceProcAddr( instance, "vkCmdPushDescriptorSetKHR" ) ); - vkCmdPushDescriptorSetWithTemplateKHR = - PFN_vkCmdPushDescriptorSetWithTemplateKHR( vkGetInstanceProcAddr( instance, "vkCmdPushDescriptorSetWithTemplateKHR" ) ); - - //=== VK_EXT_conditional_rendering === - vkCmdBeginConditionalRenderingEXT = PFN_vkCmdBeginConditionalRenderingEXT( vkGetInstanceProcAddr( instance, "vkCmdBeginConditionalRenderingEXT" ) ); - vkCmdEndConditionalRenderingEXT = PFN_vkCmdEndConditionalRenderingEXT( vkGetInstanceProcAddr( instance, "vkCmdEndConditionalRenderingEXT" ) ); - - //=== VK_KHR_descriptor_update_template === - vkCreateDescriptorUpdateTemplateKHR = PFN_vkCreateDescriptorUpdateTemplateKHR( vkGetInstanceProcAddr( instance, "vkCreateDescriptorUpdateTemplateKHR" ) ); - if ( !vkCreateDescriptorUpdateTemplate ) - vkCreateDescriptorUpdateTemplate = vkCreateDescriptorUpdateTemplateKHR; - vkDestroyDescriptorUpdateTemplateKHR = - PFN_vkDestroyDescriptorUpdateTemplateKHR( vkGetInstanceProcAddr( instance, "vkDestroyDescriptorUpdateTemplateKHR" ) ); - if ( !vkDestroyDescriptorUpdateTemplate ) - vkDestroyDescriptorUpdateTemplate = vkDestroyDescriptorUpdateTemplateKHR; - vkUpdateDescriptorSetWithTemplateKHR = - PFN_vkUpdateDescriptorSetWithTemplateKHR( vkGetInstanceProcAddr( instance, "vkUpdateDescriptorSetWithTemplateKHR" ) ); - if ( !vkUpdateDescriptorSetWithTemplate ) - vkUpdateDescriptorSetWithTemplate = vkUpdateDescriptorSetWithTemplateKHR; - - //=== VK_NV_clip_space_w_scaling === - vkCmdSetViewportWScalingNV = PFN_vkCmdSetViewportWScalingNV( vkGetInstanceProcAddr( instance, "vkCmdSetViewportWScalingNV" ) ); - - //=== VK_EXT_direct_mode_display === - vkReleaseDisplayEXT = PFN_vkReleaseDisplayEXT( vkGetInstanceProcAddr( instance, "vkReleaseDisplayEXT" ) ); - -#if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - vkAcquireXlibDisplayEXT = PFN_vkAcquireXlibDisplayEXT( vkGetInstanceProcAddr( instance, "vkAcquireXlibDisplayEXT" ) ); - vkGetRandROutputDisplayEXT = PFN_vkGetRandROutputDisplayEXT( vkGetInstanceProcAddr( instance, "vkGetRandROutputDisplayEXT" ) ); -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - vkGetPhysicalDeviceSurfaceCapabilities2EXT = - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT" ) ); - - //=== VK_EXT_display_control === - vkDisplayPowerControlEXT = PFN_vkDisplayPowerControlEXT( vkGetInstanceProcAddr( instance, "vkDisplayPowerControlEXT" ) ); - vkRegisterDeviceEventEXT = PFN_vkRegisterDeviceEventEXT( vkGetInstanceProcAddr( instance, "vkRegisterDeviceEventEXT" ) ); - vkRegisterDisplayEventEXT = PFN_vkRegisterDisplayEventEXT( vkGetInstanceProcAddr( instance, "vkRegisterDisplayEventEXT" ) ); - vkGetSwapchainCounterEXT = PFN_vkGetSwapchainCounterEXT( vkGetInstanceProcAddr( instance, "vkGetSwapchainCounterEXT" ) ); - - //=== VK_GOOGLE_display_timing === - vkGetRefreshCycleDurationGOOGLE = PFN_vkGetRefreshCycleDurationGOOGLE( vkGetInstanceProcAddr( instance, "vkGetRefreshCycleDurationGOOGLE" ) ); - vkGetPastPresentationTimingGOOGLE = PFN_vkGetPastPresentationTimingGOOGLE( vkGetInstanceProcAddr( instance, "vkGetPastPresentationTimingGOOGLE" ) ); - - //=== VK_EXT_discard_rectangles === - vkCmdSetDiscardRectangleEXT = PFN_vkCmdSetDiscardRectangleEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDiscardRectangleEXT" ) ); - - //=== VK_EXT_hdr_metadata === - vkSetHdrMetadataEXT = PFN_vkSetHdrMetadataEXT( vkGetInstanceProcAddr( instance, "vkSetHdrMetadataEXT" ) ); - - //=== VK_KHR_create_renderpass2 === - vkCreateRenderPass2KHR = PFN_vkCreateRenderPass2KHR( vkGetInstanceProcAddr( instance, "vkCreateRenderPass2KHR" ) ); - if ( !vkCreateRenderPass2 ) - vkCreateRenderPass2 = vkCreateRenderPass2KHR; - vkCmdBeginRenderPass2KHR = PFN_vkCmdBeginRenderPass2KHR( vkGetInstanceProcAddr( instance, "vkCmdBeginRenderPass2KHR" ) ); - if ( !vkCmdBeginRenderPass2 ) - vkCmdBeginRenderPass2 = vkCmdBeginRenderPass2KHR; - vkCmdNextSubpass2KHR = PFN_vkCmdNextSubpass2KHR( vkGetInstanceProcAddr( instance, "vkCmdNextSubpass2KHR" ) ); - if ( !vkCmdNextSubpass2 ) - vkCmdNextSubpass2 = vkCmdNextSubpass2KHR; - vkCmdEndRenderPass2KHR = PFN_vkCmdEndRenderPass2KHR( vkGetInstanceProcAddr( instance, "vkCmdEndRenderPass2KHR" ) ); - if ( !vkCmdEndRenderPass2 ) - vkCmdEndRenderPass2 = vkCmdEndRenderPass2KHR; - - //=== VK_KHR_shared_presentable_image === - vkGetSwapchainStatusKHR = PFN_vkGetSwapchainStatusKHR( vkGetInstanceProcAddr( instance, "vkGetSwapchainStatusKHR" ) ); - - //=== VK_KHR_external_fence_capabilities === - vkGetPhysicalDeviceExternalFencePropertiesKHR = - PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalFenceProperties ) - vkGetPhysicalDeviceExternalFenceProperties = vkGetPhysicalDeviceExternalFencePropertiesKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - vkImportFenceWin32HandleKHR = PFN_vkImportFenceWin32HandleKHR( vkGetInstanceProcAddr( instance, "vkImportFenceWin32HandleKHR" ) ); - vkGetFenceWin32HandleKHR = PFN_vkGetFenceWin32HandleKHR( vkGetInstanceProcAddr( instance, "vkGetFenceWin32HandleKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - vkImportFenceFdKHR = PFN_vkImportFenceFdKHR( vkGetInstanceProcAddr( instance, "vkImportFenceFdKHR" ) ); - vkGetFenceFdKHR = PFN_vkGetFenceFdKHR( vkGetInstanceProcAddr( instance, "vkGetFenceFdKHR" ) ); - - //=== VK_KHR_performance_query === - vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR" ) ); - vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( - vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR" ) ); - vkAcquireProfilingLockKHR = PFN_vkAcquireProfilingLockKHR( vkGetInstanceProcAddr( instance, "vkAcquireProfilingLockKHR" ) ); - vkReleaseProfilingLockKHR = PFN_vkReleaseProfilingLockKHR( vkGetInstanceProcAddr( instance, "vkReleaseProfilingLockKHR" ) ); - - //=== VK_KHR_get_surface_capabilities2 === - vkGetPhysicalDeviceSurfaceCapabilities2KHR = - PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR" ) ); - vkGetPhysicalDeviceSurfaceFormats2KHR = - PFN_vkGetPhysicalDeviceSurfaceFormats2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormats2KHR" ) ); - - //=== VK_KHR_get_display_properties2 === - vkGetPhysicalDeviceDisplayProperties2KHR = - PFN_vkGetPhysicalDeviceDisplayProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayProperties2KHR" ) ); - vkGetPhysicalDeviceDisplayPlaneProperties2KHR = - PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR" ) ); - vkGetDisplayModeProperties2KHR = PFN_vkGetDisplayModeProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetDisplayModeProperties2KHR" ) ); - vkGetDisplayPlaneCapabilities2KHR = PFN_vkGetDisplayPlaneCapabilities2KHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneCapabilities2KHR" ) ); - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - vkCreateIOSSurfaceMVK = PFN_vkCreateIOSSurfaceMVK( vkGetInstanceProcAddr( instance, "vkCreateIOSSurfaceMVK" ) ); -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - vkCreateMacOSSurfaceMVK = PFN_vkCreateMacOSSurfaceMVK( vkGetInstanceProcAddr( instance, "vkCreateMacOSSurfaceMVK" ) ); -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - vkSetDebugUtilsObjectNameEXT = PFN_vkSetDebugUtilsObjectNameEXT( vkGetInstanceProcAddr( instance, "vkSetDebugUtilsObjectNameEXT" ) ); - vkSetDebugUtilsObjectTagEXT = PFN_vkSetDebugUtilsObjectTagEXT( vkGetInstanceProcAddr( instance, "vkSetDebugUtilsObjectTagEXT" ) ); - vkQueueBeginDebugUtilsLabelEXT = PFN_vkQueueBeginDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkQueueBeginDebugUtilsLabelEXT" ) ); - vkQueueEndDebugUtilsLabelEXT = PFN_vkQueueEndDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkQueueEndDebugUtilsLabelEXT" ) ); - vkQueueInsertDebugUtilsLabelEXT = PFN_vkQueueInsertDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkQueueInsertDebugUtilsLabelEXT" ) ); - vkCmdBeginDebugUtilsLabelEXT = PFN_vkCmdBeginDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkCmdBeginDebugUtilsLabelEXT" ) ); - vkCmdEndDebugUtilsLabelEXT = PFN_vkCmdEndDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkCmdEndDebugUtilsLabelEXT" ) ); - vkCmdInsertDebugUtilsLabelEXT = PFN_vkCmdInsertDebugUtilsLabelEXT( vkGetInstanceProcAddr( instance, "vkCmdInsertDebugUtilsLabelEXT" ) ); - vkCreateDebugUtilsMessengerEXT = PFN_vkCreateDebugUtilsMessengerEXT( vkGetInstanceProcAddr( instance, "vkCreateDebugUtilsMessengerEXT" ) ); - vkDestroyDebugUtilsMessengerEXT = PFN_vkDestroyDebugUtilsMessengerEXT( vkGetInstanceProcAddr( instance, "vkDestroyDebugUtilsMessengerEXT" ) ); - vkSubmitDebugUtilsMessageEXT = PFN_vkSubmitDebugUtilsMessageEXT( vkGetInstanceProcAddr( instance, "vkSubmitDebugUtilsMessageEXT" ) ); - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - vkGetAndroidHardwareBufferPropertiesANDROID = - PFN_vkGetAndroidHardwareBufferPropertiesANDROID( vkGetInstanceProcAddr( instance, "vkGetAndroidHardwareBufferPropertiesANDROID" ) ); - vkGetMemoryAndroidHardwareBufferANDROID = - PFN_vkGetMemoryAndroidHardwareBufferANDROID( vkGetInstanceProcAddr( instance, "vkGetMemoryAndroidHardwareBufferANDROID" ) ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - vkCmdSetSampleLocationsEXT = PFN_vkCmdSetSampleLocationsEXT( vkGetInstanceProcAddr( instance, "vkCmdSetSampleLocationsEXT" ) ); - vkGetPhysicalDeviceMultisamplePropertiesEXT = - PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMultisamplePropertiesEXT" ) ); - - //=== VK_KHR_get_memory_requirements2 === - vkGetImageMemoryRequirements2KHR = PFN_vkGetImageMemoryRequirements2KHR( vkGetInstanceProcAddr( instance, "vkGetImageMemoryRequirements2KHR" ) ); - if ( !vkGetImageMemoryRequirements2 ) - vkGetImageMemoryRequirements2 = vkGetImageMemoryRequirements2KHR; - vkGetBufferMemoryRequirements2KHR = PFN_vkGetBufferMemoryRequirements2KHR( vkGetInstanceProcAddr( instance, "vkGetBufferMemoryRequirements2KHR" ) ); - if ( !vkGetBufferMemoryRequirements2 ) - vkGetBufferMemoryRequirements2 = vkGetBufferMemoryRequirements2KHR; - vkGetImageSparseMemoryRequirements2KHR = - PFN_vkGetImageSparseMemoryRequirements2KHR( vkGetInstanceProcAddr( instance, "vkGetImageSparseMemoryRequirements2KHR" ) ); - if ( !vkGetImageSparseMemoryRequirements2 ) - vkGetImageSparseMemoryRequirements2 = vkGetImageSparseMemoryRequirements2KHR; - - //=== VK_KHR_acceleration_structure === - vkCreateAccelerationStructureKHR = PFN_vkCreateAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkCreateAccelerationStructureKHR" ) ); - vkDestroyAccelerationStructureKHR = PFN_vkDestroyAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkDestroyAccelerationStructureKHR" ) ); - vkCmdBuildAccelerationStructuresKHR = PFN_vkCmdBuildAccelerationStructuresKHR( vkGetInstanceProcAddr( instance, "vkCmdBuildAccelerationStructuresKHR" ) ); - vkCmdBuildAccelerationStructuresIndirectKHR = - PFN_vkCmdBuildAccelerationStructuresIndirectKHR( vkGetInstanceProcAddr( instance, "vkCmdBuildAccelerationStructuresIndirectKHR" ) ); - vkBuildAccelerationStructuresKHR = PFN_vkBuildAccelerationStructuresKHR( vkGetInstanceProcAddr( instance, "vkBuildAccelerationStructuresKHR" ) ); - vkCopyAccelerationStructureKHR = PFN_vkCopyAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkCopyAccelerationStructureKHR" ) ); - vkCopyAccelerationStructureToMemoryKHR = - PFN_vkCopyAccelerationStructureToMemoryKHR( vkGetInstanceProcAddr( instance, "vkCopyAccelerationStructureToMemoryKHR" ) ); - vkCopyMemoryToAccelerationStructureKHR = - PFN_vkCopyMemoryToAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkCopyMemoryToAccelerationStructureKHR" ) ); - vkWriteAccelerationStructuresPropertiesKHR = - PFN_vkWriteAccelerationStructuresPropertiesKHR( vkGetInstanceProcAddr( instance, "vkWriteAccelerationStructuresPropertiesKHR" ) ); - vkCmdCopyAccelerationStructureKHR = PFN_vkCmdCopyAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkCmdCopyAccelerationStructureKHR" ) ); - vkCmdCopyAccelerationStructureToMemoryKHR = - PFN_vkCmdCopyAccelerationStructureToMemoryKHR( vkGetInstanceProcAddr( instance, "vkCmdCopyAccelerationStructureToMemoryKHR" ) ); - vkCmdCopyMemoryToAccelerationStructureKHR = - PFN_vkCmdCopyMemoryToAccelerationStructureKHR( vkGetInstanceProcAddr( instance, "vkCmdCopyMemoryToAccelerationStructureKHR" ) ); - vkGetAccelerationStructureDeviceAddressKHR = - PFN_vkGetAccelerationStructureDeviceAddressKHR( vkGetInstanceProcAddr( instance, "vkGetAccelerationStructureDeviceAddressKHR" ) ); - vkCmdWriteAccelerationStructuresPropertiesKHR = - PFN_vkCmdWriteAccelerationStructuresPropertiesKHR( vkGetInstanceProcAddr( instance, "vkCmdWriteAccelerationStructuresPropertiesKHR" ) ); - vkGetDeviceAccelerationStructureCompatibilityKHR = - PFN_vkGetDeviceAccelerationStructureCompatibilityKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceAccelerationStructureCompatibilityKHR" ) ); - vkGetAccelerationStructureBuildSizesKHR = - PFN_vkGetAccelerationStructureBuildSizesKHR( vkGetInstanceProcAddr( instance, "vkGetAccelerationStructureBuildSizesKHR" ) ); - - //=== VK_KHR_sampler_ycbcr_conversion === - vkCreateSamplerYcbcrConversionKHR = PFN_vkCreateSamplerYcbcrConversionKHR( vkGetInstanceProcAddr( instance, "vkCreateSamplerYcbcrConversionKHR" ) ); - if ( !vkCreateSamplerYcbcrConversion ) - vkCreateSamplerYcbcrConversion = vkCreateSamplerYcbcrConversionKHR; - vkDestroySamplerYcbcrConversionKHR = PFN_vkDestroySamplerYcbcrConversionKHR( vkGetInstanceProcAddr( instance, "vkDestroySamplerYcbcrConversionKHR" ) ); - if ( !vkDestroySamplerYcbcrConversion ) - vkDestroySamplerYcbcrConversion = vkDestroySamplerYcbcrConversionKHR; - - //=== VK_KHR_bind_memory2 === - vkBindBufferMemory2KHR = PFN_vkBindBufferMemory2KHR( vkGetInstanceProcAddr( instance, "vkBindBufferMemory2KHR" ) ); - if ( !vkBindBufferMemory2 ) - vkBindBufferMemory2 = vkBindBufferMemory2KHR; - vkBindImageMemory2KHR = PFN_vkBindImageMemory2KHR( vkGetInstanceProcAddr( instance, "vkBindImageMemory2KHR" ) ); - if ( !vkBindImageMemory2 ) - vkBindImageMemory2 = vkBindImageMemory2KHR; - - //=== VK_EXT_image_drm_format_modifier === - vkGetImageDrmFormatModifierPropertiesEXT = - PFN_vkGetImageDrmFormatModifierPropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetImageDrmFormatModifierPropertiesEXT" ) ); - - //=== VK_EXT_validation_cache === - vkCreateValidationCacheEXT = PFN_vkCreateValidationCacheEXT( vkGetInstanceProcAddr( instance, "vkCreateValidationCacheEXT" ) ); - vkDestroyValidationCacheEXT = PFN_vkDestroyValidationCacheEXT( vkGetInstanceProcAddr( instance, "vkDestroyValidationCacheEXT" ) ); - vkMergeValidationCachesEXT = PFN_vkMergeValidationCachesEXT( vkGetInstanceProcAddr( instance, "vkMergeValidationCachesEXT" ) ); - vkGetValidationCacheDataEXT = PFN_vkGetValidationCacheDataEXT( vkGetInstanceProcAddr( instance, "vkGetValidationCacheDataEXT" ) ); - - //=== VK_NV_shading_rate_image === - vkCmdBindShadingRateImageNV = PFN_vkCmdBindShadingRateImageNV( vkGetInstanceProcAddr( instance, "vkCmdBindShadingRateImageNV" ) ); - vkCmdSetViewportShadingRatePaletteNV = - PFN_vkCmdSetViewportShadingRatePaletteNV( vkGetInstanceProcAddr( instance, "vkCmdSetViewportShadingRatePaletteNV" ) ); - vkCmdSetCoarseSampleOrderNV = PFN_vkCmdSetCoarseSampleOrderNV( vkGetInstanceProcAddr( instance, "vkCmdSetCoarseSampleOrderNV" ) ); - - //=== VK_NV_ray_tracing === - vkCreateAccelerationStructureNV = PFN_vkCreateAccelerationStructureNV( vkGetInstanceProcAddr( instance, "vkCreateAccelerationStructureNV" ) ); - vkDestroyAccelerationStructureNV = PFN_vkDestroyAccelerationStructureNV( vkGetInstanceProcAddr( instance, "vkDestroyAccelerationStructureNV" ) ); - vkGetAccelerationStructureMemoryRequirementsNV = - PFN_vkGetAccelerationStructureMemoryRequirementsNV( vkGetInstanceProcAddr( instance, "vkGetAccelerationStructureMemoryRequirementsNV" ) ); - vkBindAccelerationStructureMemoryNV = PFN_vkBindAccelerationStructureMemoryNV( vkGetInstanceProcAddr( instance, "vkBindAccelerationStructureMemoryNV" ) ); - vkCmdBuildAccelerationStructureNV = PFN_vkCmdBuildAccelerationStructureNV( vkGetInstanceProcAddr( instance, "vkCmdBuildAccelerationStructureNV" ) ); - vkCmdCopyAccelerationStructureNV = PFN_vkCmdCopyAccelerationStructureNV( vkGetInstanceProcAddr( instance, "vkCmdCopyAccelerationStructureNV" ) ); - vkCmdTraceRaysNV = PFN_vkCmdTraceRaysNV( vkGetInstanceProcAddr( instance, "vkCmdTraceRaysNV" ) ); - vkCreateRayTracingPipelinesNV = PFN_vkCreateRayTracingPipelinesNV( vkGetInstanceProcAddr( instance, "vkCreateRayTracingPipelinesNV" ) ); - vkGetRayTracingShaderGroupHandlesNV = PFN_vkGetRayTracingShaderGroupHandlesNV( vkGetInstanceProcAddr( instance, "vkGetRayTracingShaderGroupHandlesNV" ) ); - if ( !vkGetRayTracingShaderGroupHandlesKHR ) - vkGetRayTracingShaderGroupHandlesKHR = vkGetRayTracingShaderGroupHandlesNV; - vkGetAccelerationStructureHandleNV = PFN_vkGetAccelerationStructureHandleNV( vkGetInstanceProcAddr( instance, "vkGetAccelerationStructureHandleNV" ) ); - vkCmdWriteAccelerationStructuresPropertiesNV = - PFN_vkCmdWriteAccelerationStructuresPropertiesNV( vkGetInstanceProcAddr( instance, "vkCmdWriteAccelerationStructuresPropertiesNV" ) ); - vkCompileDeferredNV = PFN_vkCompileDeferredNV( vkGetInstanceProcAddr( instance, "vkCompileDeferredNV" ) ); - - //=== VK_KHR_maintenance3 === - vkGetDescriptorSetLayoutSupportKHR = PFN_vkGetDescriptorSetLayoutSupportKHR( vkGetInstanceProcAddr( instance, "vkGetDescriptorSetLayoutSupportKHR" ) ); - if ( !vkGetDescriptorSetLayoutSupport ) - vkGetDescriptorSetLayoutSupport = vkGetDescriptorSetLayoutSupportKHR; - - //=== VK_KHR_draw_indirect_count === - vkCmdDrawIndirectCountKHR = PFN_vkCmdDrawIndirectCountKHR( vkGetInstanceProcAddr( instance, "vkCmdDrawIndirectCountKHR" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountKHR; - vkCmdDrawIndexedIndirectCountKHR = PFN_vkCmdDrawIndexedIndirectCountKHR( vkGetInstanceProcAddr( instance, "vkCmdDrawIndexedIndirectCountKHR" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountKHR; - - //=== VK_EXT_external_memory_host === - vkGetMemoryHostPointerPropertiesEXT = PFN_vkGetMemoryHostPointerPropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetMemoryHostPointerPropertiesEXT" ) ); - - //=== VK_AMD_buffer_marker === - vkCmdWriteBufferMarkerAMD = PFN_vkCmdWriteBufferMarkerAMD( vkGetInstanceProcAddr( instance, "vkCmdWriteBufferMarkerAMD" ) ); - - //=== VK_EXT_calibrated_timestamps === - vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = - PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT" ) ); - vkGetCalibratedTimestampsEXT = PFN_vkGetCalibratedTimestampsEXT( vkGetInstanceProcAddr( instance, "vkGetCalibratedTimestampsEXT" ) ); - - //=== VK_NV_mesh_shader === - vkCmdDrawMeshTasksNV = PFN_vkCmdDrawMeshTasksNV( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksNV" ) ); - vkCmdDrawMeshTasksIndirectNV = PFN_vkCmdDrawMeshTasksIndirectNV( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksIndirectNV" ) ); - vkCmdDrawMeshTasksIndirectCountNV = PFN_vkCmdDrawMeshTasksIndirectCountNV( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksIndirectCountNV" ) ); - - //=== VK_NV_scissor_exclusive === - vkCmdSetExclusiveScissorNV = PFN_vkCmdSetExclusiveScissorNV( vkGetInstanceProcAddr( instance, "vkCmdSetExclusiveScissorNV" ) ); - - //=== VK_NV_device_diagnostic_checkpoints === - vkCmdSetCheckpointNV = PFN_vkCmdSetCheckpointNV( vkGetInstanceProcAddr( instance, "vkCmdSetCheckpointNV" ) ); - vkGetQueueCheckpointDataNV = PFN_vkGetQueueCheckpointDataNV( vkGetInstanceProcAddr( instance, "vkGetQueueCheckpointDataNV" ) ); - - //=== VK_KHR_timeline_semaphore === - vkGetSemaphoreCounterValueKHR = PFN_vkGetSemaphoreCounterValueKHR( vkGetInstanceProcAddr( instance, "vkGetSemaphoreCounterValueKHR" ) ); - if ( !vkGetSemaphoreCounterValue ) - vkGetSemaphoreCounterValue = vkGetSemaphoreCounterValueKHR; - vkWaitSemaphoresKHR = PFN_vkWaitSemaphoresKHR( vkGetInstanceProcAddr( instance, "vkWaitSemaphoresKHR" ) ); - if ( !vkWaitSemaphores ) - vkWaitSemaphores = vkWaitSemaphoresKHR; - vkSignalSemaphoreKHR = PFN_vkSignalSemaphoreKHR( vkGetInstanceProcAddr( instance, "vkSignalSemaphoreKHR" ) ); - if ( !vkSignalSemaphore ) - vkSignalSemaphore = vkSignalSemaphoreKHR; - - //=== VK_INTEL_performance_query === - vkInitializePerformanceApiINTEL = PFN_vkInitializePerformanceApiINTEL( vkGetInstanceProcAddr( instance, "vkInitializePerformanceApiINTEL" ) ); - vkUninitializePerformanceApiINTEL = PFN_vkUninitializePerformanceApiINTEL( vkGetInstanceProcAddr( instance, "vkUninitializePerformanceApiINTEL" ) ); - vkCmdSetPerformanceMarkerINTEL = PFN_vkCmdSetPerformanceMarkerINTEL( vkGetInstanceProcAddr( instance, "vkCmdSetPerformanceMarkerINTEL" ) ); - vkCmdSetPerformanceStreamMarkerINTEL = - PFN_vkCmdSetPerformanceStreamMarkerINTEL( vkGetInstanceProcAddr( instance, "vkCmdSetPerformanceStreamMarkerINTEL" ) ); - vkCmdSetPerformanceOverrideINTEL = PFN_vkCmdSetPerformanceOverrideINTEL( vkGetInstanceProcAddr( instance, "vkCmdSetPerformanceOverrideINTEL" ) ); - vkAcquirePerformanceConfigurationINTEL = - PFN_vkAcquirePerformanceConfigurationINTEL( vkGetInstanceProcAddr( instance, "vkAcquirePerformanceConfigurationINTEL" ) ); - vkReleasePerformanceConfigurationINTEL = - PFN_vkReleasePerformanceConfigurationINTEL( vkGetInstanceProcAddr( instance, "vkReleasePerformanceConfigurationINTEL" ) ); - vkQueueSetPerformanceConfigurationINTEL = - PFN_vkQueueSetPerformanceConfigurationINTEL( vkGetInstanceProcAddr( instance, "vkQueueSetPerformanceConfigurationINTEL" ) ); - vkGetPerformanceParameterINTEL = PFN_vkGetPerformanceParameterINTEL( vkGetInstanceProcAddr( instance, "vkGetPerformanceParameterINTEL" ) ); - - //=== VK_AMD_display_native_hdr === - vkSetLocalDimmingAMD = PFN_vkSetLocalDimmingAMD( vkGetInstanceProcAddr( instance, "vkSetLocalDimmingAMD" ) ); - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - vkCreateImagePipeSurfaceFUCHSIA = PFN_vkCreateImagePipeSurfaceFUCHSIA( vkGetInstanceProcAddr( instance, "vkCreateImagePipeSurfaceFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - vkCreateMetalSurfaceEXT = PFN_vkCreateMetalSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateMetalSurfaceEXT" ) ); -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - vkGetPhysicalDeviceFragmentShadingRatesKHR = - PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFragmentShadingRatesKHR" ) ); - vkCmdSetFragmentShadingRateKHR = PFN_vkCmdSetFragmentShadingRateKHR( vkGetInstanceProcAddr( instance, "vkCmdSetFragmentShadingRateKHR" ) ); - - //=== VK_EXT_buffer_device_address === - vkGetBufferDeviceAddressEXT = PFN_vkGetBufferDeviceAddressEXT( vkGetInstanceProcAddr( instance, "vkGetBufferDeviceAddressEXT" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressEXT; - - //=== VK_EXT_tooling_info === - vkGetPhysicalDeviceToolPropertiesEXT = - PFN_vkGetPhysicalDeviceToolPropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceToolPropertiesEXT" ) ); - if ( !vkGetPhysicalDeviceToolProperties ) - vkGetPhysicalDeviceToolProperties = vkGetPhysicalDeviceToolPropertiesEXT; - - //=== VK_KHR_present_wait === - vkWaitForPresentKHR = PFN_vkWaitForPresentKHR( vkGetInstanceProcAddr( instance, "vkWaitForPresentKHR" ) ); - - //=== VK_NV_cooperative_matrix === - vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = - PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV" ) ); - - //=== VK_NV_coverage_reduction_mode === - vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - vkGetPhysicalDeviceSurfacePresentModes2EXT = - PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfacePresentModes2EXT" ) ); - vkAcquireFullScreenExclusiveModeEXT = PFN_vkAcquireFullScreenExclusiveModeEXT( vkGetInstanceProcAddr( instance, "vkAcquireFullScreenExclusiveModeEXT" ) ); - vkReleaseFullScreenExclusiveModeEXT = PFN_vkReleaseFullScreenExclusiveModeEXT( vkGetInstanceProcAddr( instance, "vkReleaseFullScreenExclusiveModeEXT" ) ); - vkGetDeviceGroupSurfacePresentModes2EXT = - PFN_vkGetDeviceGroupSurfacePresentModes2EXT( vkGetInstanceProcAddr( instance, "vkGetDeviceGroupSurfacePresentModes2EXT" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - vkCreateHeadlessSurfaceEXT = PFN_vkCreateHeadlessSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateHeadlessSurfaceEXT" ) ); - - //=== VK_KHR_buffer_device_address === - vkGetBufferDeviceAddressKHR = PFN_vkGetBufferDeviceAddressKHR( vkGetInstanceProcAddr( instance, "vkGetBufferDeviceAddressKHR" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressKHR; - vkGetBufferOpaqueCaptureAddressKHR = PFN_vkGetBufferOpaqueCaptureAddressKHR( vkGetInstanceProcAddr( instance, "vkGetBufferOpaqueCaptureAddressKHR" ) ); - if ( !vkGetBufferOpaqueCaptureAddress ) - vkGetBufferOpaqueCaptureAddress = vkGetBufferOpaqueCaptureAddressKHR; - vkGetDeviceMemoryOpaqueCaptureAddressKHR = - PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceMemoryOpaqueCaptureAddressKHR" ) ); - if ( !vkGetDeviceMemoryOpaqueCaptureAddress ) - vkGetDeviceMemoryOpaqueCaptureAddress = vkGetDeviceMemoryOpaqueCaptureAddressKHR; - - //=== VK_EXT_line_rasterization === - vkCmdSetLineStippleEXT = PFN_vkCmdSetLineStippleEXT( vkGetInstanceProcAddr( instance, "vkCmdSetLineStippleEXT" ) ); - - //=== VK_EXT_host_query_reset === - vkResetQueryPoolEXT = PFN_vkResetQueryPoolEXT( vkGetInstanceProcAddr( instance, "vkResetQueryPoolEXT" ) ); - if ( !vkResetQueryPool ) - vkResetQueryPool = vkResetQueryPoolEXT; - - //=== VK_EXT_extended_dynamic_state === - vkCmdSetCullModeEXT = PFN_vkCmdSetCullModeEXT( vkGetInstanceProcAddr( instance, "vkCmdSetCullModeEXT" ) ); - if ( !vkCmdSetCullMode ) - vkCmdSetCullMode = vkCmdSetCullModeEXT; - vkCmdSetFrontFaceEXT = PFN_vkCmdSetFrontFaceEXT( vkGetInstanceProcAddr( instance, "vkCmdSetFrontFaceEXT" ) ); - if ( !vkCmdSetFrontFace ) - vkCmdSetFrontFace = vkCmdSetFrontFaceEXT; - vkCmdSetPrimitiveTopologyEXT = PFN_vkCmdSetPrimitiveTopologyEXT( vkGetInstanceProcAddr( instance, "vkCmdSetPrimitiveTopologyEXT" ) ); - if ( !vkCmdSetPrimitiveTopology ) - vkCmdSetPrimitiveTopology = vkCmdSetPrimitiveTopologyEXT; - vkCmdSetViewportWithCountEXT = PFN_vkCmdSetViewportWithCountEXT( vkGetInstanceProcAddr( instance, "vkCmdSetViewportWithCountEXT" ) ); - if ( !vkCmdSetViewportWithCount ) - vkCmdSetViewportWithCount = vkCmdSetViewportWithCountEXT; - vkCmdSetScissorWithCountEXT = PFN_vkCmdSetScissorWithCountEXT( vkGetInstanceProcAddr( instance, "vkCmdSetScissorWithCountEXT" ) ); - if ( !vkCmdSetScissorWithCount ) - vkCmdSetScissorWithCount = vkCmdSetScissorWithCountEXT; - vkCmdBindVertexBuffers2EXT = PFN_vkCmdBindVertexBuffers2EXT( vkGetInstanceProcAddr( instance, "vkCmdBindVertexBuffers2EXT" ) ); - if ( !vkCmdBindVertexBuffers2 ) - vkCmdBindVertexBuffers2 = vkCmdBindVertexBuffers2EXT; - vkCmdSetDepthTestEnableEXT = PFN_vkCmdSetDepthTestEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDepthTestEnableEXT" ) ); - if ( !vkCmdSetDepthTestEnable ) - vkCmdSetDepthTestEnable = vkCmdSetDepthTestEnableEXT; - vkCmdSetDepthWriteEnableEXT = PFN_vkCmdSetDepthWriteEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDepthWriteEnableEXT" ) ); - if ( !vkCmdSetDepthWriteEnable ) - vkCmdSetDepthWriteEnable = vkCmdSetDepthWriteEnableEXT; - vkCmdSetDepthCompareOpEXT = PFN_vkCmdSetDepthCompareOpEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDepthCompareOpEXT" ) ); - if ( !vkCmdSetDepthCompareOp ) - vkCmdSetDepthCompareOp = vkCmdSetDepthCompareOpEXT; - vkCmdSetDepthBoundsTestEnableEXT = PFN_vkCmdSetDepthBoundsTestEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBoundsTestEnableEXT" ) ); - if ( !vkCmdSetDepthBoundsTestEnable ) - vkCmdSetDepthBoundsTestEnable = vkCmdSetDepthBoundsTestEnableEXT; - vkCmdSetStencilTestEnableEXT = PFN_vkCmdSetStencilTestEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetStencilTestEnableEXT" ) ); - if ( !vkCmdSetStencilTestEnable ) - vkCmdSetStencilTestEnable = vkCmdSetStencilTestEnableEXT; - vkCmdSetStencilOpEXT = PFN_vkCmdSetStencilOpEXT( vkGetInstanceProcAddr( instance, "vkCmdSetStencilOpEXT" ) ); - if ( !vkCmdSetStencilOp ) - vkCmdSetStencilOp = vkCmdSetStencilOpEXT; - - //=== VK_KHR_deferred_host_operations === - vkCreateDeferredOperationKHR = PFN_vkCreateDeferredOperationKHR( vkGetInstanceProcAddr( instance, "vkCreateDeferredOperationKHR" ) ); - vkDestroyDeferredOperationKHR = PFN_vkDestroyDeferredOperationKHR( vkGetInstanceProcAddr( instance, "vkDestroyDeferredOperationKHR" ) ); - vkGetDeferredOperationMaxConcurrencyKHR = - PFN_vkGetDeferredOperationMaxConcurrencyKHR( vkGetInstanceProcAddr( instance, "vkGetDeferredOperationMaxConcurrencyKHR" ) ); - vkGetDeferredOperationResultKHR = PFN_vkGetDeferredOperationResultKHR( vkGetInstanceProcAddr( instance, "vkGetDeferredOperationResultKHR" ) ); - vkDeferredOperationJoinKHR = PFN_vkDeferredOperationJoinKHR( vkGetInstanceProcAddr( instance, "vkDeferredOperationJoinKHR" ) ); - - //=== VK_KHR_pipeline_executable_properties === - vkGetPipelineExecutablePropertiesKHR = - PFN_vkGetPipelineExecutablePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPipelineExecutablePropertiesKHR" ) ); - vkGetPipelineExecutableStatisticsKHR = - PFN_vkGetPipelineExecutableStatisticsKHR( vkGetInstanceProcAddr( instance, "vkGetPipelineExecutableStatisticsKHR" ) ); - vkGetPipelineExecutableInternalRepresentationsKHR = - PFN_vkGetPipelineExecutableInternalRepresentationsKHR( vkGetInstanceProcAddr( instance, "vkGetPipelineExecutableInternalRepresentationsKHR" ) ); - - //=== VK_NV_device_generated_commands === - vkGetGeneratedCommandsMemoryRequirementsNV = - PFN_vkGetGeneratedCommandsMemoryRequirementsNV( vkGetInstanceProcAddr( instance, "vkGetGeneratedCommandsMemoryRequirementsNV" ) ); - vkCmdPreprocessGeneratedCommandsNV = PFN_vkCmdPreprocessGeneratedCommandsNV( vkGetInstanceProcAddr( instance, "vkCmdPreprocessGeneratedCommandsNV" ) ); - vkCmdExecuteGeneratedCommandsNV = PFN_vkCmdExecuteGeneratedCommandsNV( vkGetInstanceProcAddr( instance, "vkCmdExecuteGeneratedCommandsNV" ) ); - vkCmdBindPipelineShaderGroupNV = PFN_vkCmdBindPipelineShaderGroupNV( vkGetInstanceProcAddr( instance, "vkCmdBindPipelineShaderGroupNV" ) ); - vkCreateIndirectCommandsLayoutNV = PFN_vkCreateIndirectCommandsLayoutNV( vkGetInstanceProcAddr( instance, "vkCreateIndirectCommandsLayoutNV" ) ); - vkDestroyIndirectCommandsLayoutNV = PFN_vkDestroyIndirectCommandsLayoutNV( vkGetInstanceProcAddr( instance, "vkDestroyIndirectCommandsLayoutNV" ) ); - - //=== VK_EXT_acquire_drm_display === - vkAcquireDrmDisplayEXT = PFN_vkAcquireDrmDisplayEXT( vkGetInstanceProcAddr( instance, "vkAcquireDrmDisplayEXT" ) ); - vkGetDrmDisplayEXT = PFN_vkGetDrmDisplayEXT( vkGetInstanceProcAddr( instance, "vkGetDrmDisplayEXT" ) ); - - //=== VK_EXT_private_data === - vkCreatePrivateDataSlotEXT = PFN_vkCreatePrivateDataSlotEXT( vkGetInstanceProcAddr( instance, "vkCreatePrivateDataSlotEXT" ) ); - if ( !vkCreatePrivateDataSlot ) - vkCreatePrivateDataSlot = vkCreatePrivateDataSlotEXT; - vkDestroyPrivateDataSlotEXT = PFN_vkDestroyPrivateDataSlotEXT( vkGetInstanceProcAddr( instance, "vkDestroyPrivateDataSlotEXT" ) ); - if ( !vkDestroyPrivateDataSlot ) - vkDestroyPrivateDataSlot = vkDestroyPrivateDataSlotEXT; - vkSetPrivateDataEXT = PFN_vkSetPrivateDataEXT( vkGetInstanceProcAddr( instance, "vkSetPrivateDataEXT" ) ); - if ( !vkSetPrivateData ) - vkSetPrivateData = vkSetPrivateDataEXT; - vkGetPrivateDataEXT = PFN_vkGetPrivateDataEXT( vkGetInstanceProcAddr( instance, "vkGetPrivateDataEXT" ) ); - if ( !vkGetPrivateData ) - vkGetPrivateData = vkGetPrivateDataEXT; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - vkCmdEncodeVideoKHR = PFN_vkCmdEncodeVideoKHR( vkGetInstanceProcAddr( instance, "vkCmdEncodeVideoKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - vkExportMetalObjectsEXT = PFN_vkExportMetalObjectsEXT( vkGetInstanceProcAddr( instance, "vkExportMetalObjectsEXT" ) ); -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - vkCmdSetEvent2KHR = PFN_vkCmdSetEvent2KHR( vkGetInstanceProcAddr( instance, "vkCmdSetEvent2KHR" ) ); - if ( !vkCmdSetEvent2 ) - vkCmdSetEvent2 = vkCmdSetEvent2KHR; - vkCmdResetEvent2KHR = PFN_vkCmdResetEvent2KHR( vkGetInstanceProcAddr( instance, "vkCmdResetEvent2KHR" ) ); - if ( !vkCmdResetEvent2 ) - vkCmdResetEvent2 = vkCmdResetEvent2KHR; - vkCmdWaitEvents2KHR = PFN_vkCmdWaitEvents2KHR( vkGetInstanceProcAddr( instance, "vkCmdWaitEvents2KHR" ) ); - if ( !vkCmdWaitEvents2 ) - vkCmdWaitEvents2 = vkCmdWaitEvents2KHR; - vkCmdPipelineBarrier2KHR = PFN_vkCmdPipelineBarrier2KHR( vkGetInstanceProcAddr( instance, "vkCmdPipelineBarrier2KHR" ) ); - if ( !vkCmdPipelineBarrier2 ) - vkCmdPipelineBarrier2 = vkCmdPipelineBarrier2KHR; - vkCmdWriteTimestamp2KHR = PFN_vkCmdWriteTimestamp2KHR( vkGetInstanceProcAddr( instance, "vkCmdWriteTimestamp2KHR" ) ); - if ( !vkCmdWriteTimestamp2 ) - vkCmdWriteTimestamp2 = vkCmdWriteTimestamp2KHR; - vkQueueSubmit2KHR = PFN_vkQueueSubmit2KHR( vkGetInstanceProcAddr( instance, "vkQueueSubmit2KHR" ) ); - if ( !vkQueueSubmit2 ) - vkQueueSubmit2 = vkQueueSubmit2KHR; - vkCmdWriteBufferMarker2AMD = PFN_vkCmdWriteBufferMarker2AMD( vkGetInstanceProcAddr( instance, "vkCmdWriteBufferMarker2AMD" ) ); - vkGetQueueCheckpointData2NV = PFN_vkGetQueueCheckpointData2NV( vkGetInstanceProcAddr( instance, "vkGetQueueCheckpointData2NV" ) ); - - //=== VK_NV_fragment_shading_rate_enums === - vkCmdSetFragmentShadingRateEnumNV = PFN_vkCmdSetFragmentShadingRateEnumNV( vkGetInstanceProcAddr( instance, "vkCmdSetFragmentShadingRateEnumNV" ) ); - - //=== VK_EXT_mesh_shader === - vkCmdDrawMeshTasksEXT = PFN_vkCmdDrawMeshTasksEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksEXT" ) ); - vkCmdDrawMeshTasksIndirectEXT = PFN_vkCmdDrawMeshTasksIndirectEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksIndirectEXT" ) ); - vkCmdDrawMeshTasksIndirectCountEXT = PFN_vkCmdDrawMeshTasksIndirectCountEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawMeshTasksIndirectCountEXT" ) ); - - //=== VK_KHR_copy_commands2 === - vkCmdCopyBuffer2KHR = PFN_vkCmdCopyBuffer2KHR( vkGetInstanceProcAddr( instance, "vkCmdCopyBuffer2KHR" ) ); - if ( !vkCmdCopyBuffer2 ) - vkCmdCopyBuffer2 = vkCmdCopyBuffer2KHR; - vkCmdCopyImage2KHR = PFN_vkCmdCopyImage2KHR( vkGetInstanceProcAddr( instance, "vkCmdCopyImage2KHR" ) ); - if ( !vkCmdCopyImage2 ) - vkCmdCopyImage2 = vkCmdCopyImage2KHR; - vkCmdCopyBufferToImage2KHR = PFN_vkCmdCopyBufferToImage2KHR( vkGetInstanceProcAddr( instance, "vkCmdCopyBufferToImage2KHR" ) ); - if ( !vkCmdCopyBufferToImage2 ) - vkCmdCopyBufferToImage2 = vkCmdCopyBufferToImage2KHR; - vkCmdCopyImageToBuffer2KHR = PFN_vkCmdCopyImageToBuffer2KHR( vkGetInstanceProcAddr( instance, "vkCmdCopyImageToBuffer2KHR" ) ); - if ( !vkCmdCopyImageToBuffer2 ) - vkCmdCopyImageToBuffer2 = vkCmdCopyImageToBuffer2KHR; - vkCmdBlitImage2KHR = PFN_vkCmdBlitImage2KHR( vkGetInstanceProcAddr( instance, "vkCmdBlitImage2KHR" ) ); - if ( !vkCmdBlitImage2 ) - vkCmdBlitImage2 = vkCmdBlitImage2KHR; - vkCmdResolveImage2KHR = PFN_vkCmdResolveImage2KHR( vkGetInstanceProcAddr( instance, "vkCmdResolveImage2KHR" ) ); - if ( !vkCmdResolveImage2 ) - vkCmdResolveImage2 = vkCmdResolveImage2KHR; - - //=== VK_EXT_image_compression_control === - vkGetImageSubresourceLayout2EXT = PFN_vkGetImageSubresourceLayout2EXT( vkGetInstanceProcAddr( instance, "vkGetImageSubresourceLayout2EXT" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - vkAcquireWinrtDisplayNV = PFN_vkAcquireWinrtDisplayNV( vkGetInstanceProcAddr( instance, "vkAcquireWinrtDisplayNV" ) ); - vkGetWinrtDisplayNV = PFN_vkGetWinrtDisplayNV( vkGetInstanceProcAddr( instance, "vkGetWinrtDisplayNV" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - vkCreateDirectFBSurfaceEXT = PFN_vkCreateDirectFBSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateDirectFBSurfaceEXT" ) ); - vkGetPhysicalDeviceDirectFBPresentationSupportEXT = - PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT" ) ); -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - vkCmdTraceRaysKHR = PFN_vkCmdTraceRaysKHR( vkGetInstanceProcAddr( instance, "vkCmdTraceRaysKHR" ) ); - vkCreateRayTracingPipelinesKHR = PFN_vkCreateRayTracingPipelinesKHR( vkGetInstanceProcAddr( instance, "vkCreateRayTracingPipelinesKHR" ) ); - vkGetRayTracingShaderGroupHandlesKHR = - PFN_vkGetRayTracingShaderGroupHandlesKHR( vkGetInstanceProcAddr( instance, "vkGetRayTracingShaderGroupHandlesKHR" ) ); - vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = - PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( vkGetInstanceProcAddr( instance, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR" ) ); - vkCmdTraceRaysIndirectKHR = PFN_vkCmdTraceRaysIndirectKHR( vkGetInstanceProcAddr( instance, "vkCmdTraceRaysIndirectKHR" ) ); - vkGetRayTracingShaderGroupStackSizeKHR = - PFN_vkGetRayTracingShaderGroupStackSizeKHR( vkGetInstanceProcAddr( instance, "vkGetRayTracingShaderGroupStackSizeKHR" ) ); - vkCmdSetRayTracingPipelineStackSizeKHR = - PFN_vkCmdSetRayTracingPipelineStackSizeKHR( vkGetInstanceProcAddr( instance, "vkCmdSetRayTracingPipelineStackSizeKHR" ) ); - - //=== VK_EXT_vertex_input_dynamic_state === - vkCmdSetVertexInputEXT = PFN_vkCmdSetVertexInputEXT( vkGetInstanceProcAddr( instance, "vkCmdSetVertexInputEXT" ) ); - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - vkGetMemoryZirconHandleFUCHSIA = PFN_vkGetMemoryZirconHandleFUCHSIA( vkGetInstanceProcAddr( instance, "vkGetMemoryZirconHandleFUCHSIA" ) ); - vkGetMemoryZirconHandlePropertiesFUCHSIA = - PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA( vkGetInstanceProcAddr( instance, "vkGetMemoryZirconHandlePropertiesFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - vkImportSemaphoreZirconHandleFUCHSIA = - PFN_vkImportSemaphoreZirconHandleFUCHSIA( vkGetInstanceProcAddr( instance, "vkImportSemaphoreZirconHandleFUCHSIA" ) ); - vkGetSemaphoreZirconHandleFUCHSIA = PFN_vkGetSemaphoreZirconHandleFUCHSIA( vkGetInstanceProcAddr( instance, "vkGetSemaphoreZirconHandleFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - vkCreateBufferCollectionFUCHSIA = PFN_vkCreateBufferCollectionFUCHSIA( vkGetInstanceProcAddr( instance, "vkCreateBufferCollectionFUCHSIA" ) ); - vkSetBufferCollectionImageConstraintsFUCHSIA = - PFN_vkSetBufferCollectionImageConstraintsFUCHSIA( vkGetInstanceProcAddr( instance, "vkSetBufferCollectionImageConstraintsFUCHSIA" ) ); - vkSetBufferCollectionBufferConstraintsFUCHSIA = - PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA( vkGetInstanceProcAddr( instance, "vkSetBufferCollectionBufferConstraintsFUCHSIA" ) ); - vkDestroyBufferCollectionFUCHSIA = PFN_vkDestroyBufferCollectionFUCHSIA( vkGetInstanceProcAddr( instance, "vkDestroyBufferCollectionFUCHSIA" ) ); - vkGetBufferCollectionPropertiesFUCHSIA = - PFN_vkGetBufferCollectionPropertiesFUCHSIA( vkGetInstanceProcAddr( instance, "vkGetBufferCollectionPropertiesFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = - PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( vkGetInstanceProcAddr( instance, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI" ) ); - vkCmdSubpassShadingHUAWEI = PFN_vkCmdSubpassShadingHUAWEI( vkGetInstanceProcAddr( instance, "vkCmdSubpassShadingHUAWEI" ) ); - - //=== VK_HUAWEI_invocation_mask === - vkCmdBindInvocationMaskHUAWEI = PFN_vkCmdBindInvocationMaskHUAWEI( vkGetInstanceProcAddr( instance, "vkCmdBindInvocationMaskHUAWEI" ) ); - - //=== VK_NV_external_memory_rdma === - vkGetMemoryRemoteAddressNV = PFN_vkGetMemoryRemoteAddressNV( vkGetInstanceProcAddr( instance, "vkGetMemoryRemoteAddressNV" ) ); - - //=== VK_EXT_pipeline_properties === - vkGetPipelinePropertiesEXT = PFN_vkGetPipelinePropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetPipelinePropertiesEXT" ) ); - - //=== VK_EXT_extended_dynamic_state2 === - vkCmdSetPatchControlPointsEXT = PFN_vkCmdSetPatchControlPointsEXT( vkGetInstanceProcAddr( instance, "vkCmdSetPatchControlPointsEXT" ) ); - vkCmdSetRasterizerDiscardEnableEXT = PFN_vkCmdSetRasterizerDiscardEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetRasterizerDiscardEnableEXT" ) ); - if ( !vkCmdSetRasterizerDiscardEnable ) - vkCmdSetRasterizerDiscardEnable = vkCmdSetRasterizerDiscardEnableEXT; - vkCmdSetDepthBiasEnableEXT = PFN_vkCmdSetDepthBiasEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetDepthBiasEnableEXT" ) ); - if ( !vkCmdSetDepthBiasEnable ) - vkCmdSetDepthBiasEnable = vkCmdSetDepthBiasEnableEXT; - vkCmdSetLogicOpEXT = PFN_vkCmdSetLogicOpEXT( vkGetInstanceProcAddr( instance, "vkCmdSetLogicOpEXT" ) ); - vkCmdSetPrimitiveRestartEnableEXT = PFN_vkCmdSetPrimitiveRestartEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetPrimitiveRestartEnableEXT" ) ); - if ( !vkCmdSetPrimitiveRestartEnable ) - vkCmdSetPrimitiveRestartEnable = vkCmdSetPrimitiveRestartEnableEXT; - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - vkCreateScreenSurfaceQNX = PFN_vkCreateScreenSurfaceQNX( vkGetInstanceProcAddr( instance, "vkCreateScreenSurfaceQNX" ) ); - vkGetPhysicalDeviceScreenPresentationSupportQNX = - PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceScreenPresentationSupportQNX" ) ); -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - vkCmdSetColorWriteEnableEXT = PFN_vkCmdSetColorWriteEnableEXT( vkGetInstanceProcAddr( instance, "vkCmdSetColorWriteEnableEXT" ) ); - - //=== VK_KHR_ray_tracing_maintenance1 === - vkCmdTraceRaysIndirect2KHR = PFN_vkCmdTraceRaysIndirect2KHR( vkGetInstanceProcAddr( instance, "vkCmdTraceRaysIndirect2KHR" ) ); - - //=== VK_EXT_multi_draw === - vkCmdDrawMultiEXT = PFN_vkCmdDrawMultiEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawMultiEXT" ) ); - vkCmdDrawMultiIndexedEXT = PFN_vkCmdDrawMultiIndexedEXT( vkGetInstanceProcAddr( instance, "vkCmdDrawMultiIndexedEXT" ) ); - - //=== VK_EXT_pageable_device_local_memory === - vkSetDeviceMemoryPriorityEXT = PFN_vkSetDeviceMemoryPriorityEXT( vkGetInstanceProcAddr( instance, "vkSetDeviceMemoryPriorityEXT" ) ); - - //=== VK_KHR_maintenance4 === - vkGetDeviceBufferMemoryRequirementsKHR = - PFN_vkGetDeviceBufferMemoryRequirementsKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceBufferMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceBufferMemoryRequirements ) - vkGetDeviceBufferMemoryRequirements = vkGetDeviceBufferMemoryRequirementsKHR; - vkGetDeviceImageMemoryRequirementsKHR = - PFN_vkGetDeviceImageMemoryRequirementsKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceImageMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageMemoryRequirements ) - vkGetDeviceImageMemoryRequirements = vkGetDeviceImageMemoryRequirementsKHR; - vkGetDeviceImageSparseMemoryRequirementsKHR = - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR( vkGetInstanceProcAddr( instance, "vkGetDeviceImageSparseMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageSparseMemoryRequirements ) - vkGetDeviceImageSparseMemoryRequirements = vkGetDeviceImageSparseMemoryRequirementsKHR; - - //=== VK_VALVE_descriptor_set_host_mapping === - vkGetDescriptorSetLayoutHostMappingInfoVALVE = - PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE( vkGetInstanceProcAddr( instance, "vkGetDescriptorSetLayoutHostMappingInfoVALVE" ) ); - vkGetDescriptorSetHostMappingVALVE = PFN_vkGetDescriptorSetHostMappingVALVE( vkGetInstanceProcAddr( instance, "vkGetDescriptorSetHostMappingVALVE" ) ); - - //=== VK_EXT_shader_module_identifier === - vkGetShaderModuleIdentifierEXT = PFN_vkGetShaderModuleIdentifierEXT( vkGetInstanceProcAddr( instance, "vkGetShaderModuleIdentifierEXT" ) ); - vkGetShaderModuleCreateInfoIdentifierEXT = - PFN_vkGetShaderModuleCreateInfoIdentifierEXT( vkGetInstanceProcAddr( instance, "vkGetShaderModuleCreateInfoIdentifierEXT" ) ); - - //=== VK_QCOM_tile_properties === - vkGetFramebufferTilePropertiesQCOM = PFN_vkGetFramebufferTilePropertiesQCOM( vkGetInstanceProcAddr( instance, "vkGetFramebufferTilePropertiesQCOM" ) ); - vkGetDynamicRenderingTilePropertiesQCOM = - PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetInstanceProcAddr( instance, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); - } - - void init( VULKAN_HPP_NAMESPACE::Device deviceCpp ) VULKAN_HPP_NOEXCEPT - { - VkDevice device = static_cast( deviceCpp ); - - //=== VK_VERSION_1_0 === - vkGetDeviceProcAddr = PFN_vkGetDeviceProcAddr( vkGetDeviceProcAddr( device, "vkGetDeviceProcAddr" ) ); - vkDestroyDevice = PFN_vkDestroyDevice( vkGetDeviceProcAddr( device, "vkDestroyDevice" ) ); - vkGetDeviceQueue = PFN_vkGetDeviceQueue( vkGetDeviceProcAddr( device, "vkGetDeviceQueue" ) ); - vkQueueSubmit = PFN_vkQueueSubmit( vkGetDeviceProcAddr( device, "vkQueueSubmit" ) ); - vkQueueWaitIdle = PFN_vkQueueWaitIdle( vkGetDeviceProcAddr( device, "vkQueueWaitIdle" ) ); - vkDeviceWaitIdle = PFN_vkDeviceWaitIdle( vkGetDeviceProcAddr( device, "vkDeviceWaitIdle" ) ); - vkAllocateMemory = PFN_vkAllocateMemory( vkGetDeviceProcAddr( device, "vkAllocateMemory" ) ); - vkFreeMemory = PFN_vkFreeMemory( vkGetDeviceProcAddr( device, "vkFreeMemory" ) ); - vkMapMemory = PFN_vkMapMemory( vkGetDeviceProcAddr( device, "vkMapMemory" ) ); - vkUnmapMemory = PFN_vkUnmapMemory( vkGetDeviceProcAddr( device, "vkUnmapMemory" ) ); - vkFlushMappedMemoryRanges = PFN_vkFlushMappedMemoryRanges( vkGetDeviceProcAddr( device, "vkFlushMappedMemoryRanges" ) ); - vkInvalidateMappedMemoryRanges = PFN_vkInvalidateMappedMemoryRanges( vkGetDeviceProcAddr( device, "vkInvalidateMappedMemoryRanges" ) ); - vkGetDeviceMemoryCommitment = PFN_vkGetDeviceMemoryCommitment( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryCommitment" ) ); - vkBindBufferMemory = PFN_vkBindBufferMemory( vkGetDeviceProcAddr( device, "vkBindBufferMemory" ) ); - vkBindImageMemory = PFN_vkBindImageMemory( vkGetDeviceProcAddr( device, "vkBindImageMemory" ) ); - vkGetBufferMemoryRequirements = PFN_vkGetBufferMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements" ) ); - vkGetImageMemoryRequirements = PFN_vkGetImageMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements" ) ); - vkGetImageSparseMemoryRequirements = PFN_vkGetImageSparseMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements" ) ); - vkQueueBindSparse = PFN_vkQueueBindSparse( vkGetDeviceProcAddr( device, "vkQueueBindSparse" ) ); - vkCreateFence = PFN_vkCreateFence( vkGetDeviceProcAddr( device, "vkCreateFence" ) ); - vkDestroyFence = PFN_vkDestroyFence( vkGetDeviceProcAddr( device, "vkDestroyFence" ) ); - vkResetFences = PFN_vkResetFences( vkGetDeviceProcAddr( device, "vkResetFences" ) ); - vkGetFenceStatus = PFN_vkGetFenceStatus( vkGetDeviceProcAddr( device, "vkGetFenceStatus" ) ); - vkWaitForFences = PFN_vkWaitForFences( vkGetDeviceProcAddr( device, "vkWaitForFences" ) ); - vkCreateSemaphore = PFN_vkCreateSemaphore( vkGetDeviceProcAddr( device, "vkCreateSemaphore" ) ); - vkDestroySemaphore = PFN_vkDestroySemaphore( vkGetDeviceProcAddr( device, "vkDestroySemaphore" ) ); - vkCreateEvent = PFN_vkCreateEvent( vkGetDeviceProcAddr( device, "vkCreateEvent" ) ); - vkDestroyEvent = PFN_vkDestroyEvent( vkGetDeviceProcAddr( device, "vkDestroyEvent" ) ); - vkGetEventStatus = PFN_vkGetEventStatus( vkGetDeviceProcAddr( device, "vkGetEventStatus" ) ); - vkSetEvent = PFN_vkSetEvent( vkGetDeviceProcAddr( device, "vkSetEvent" ) ); - vkResetEvent = PFN_vkResetEvent( vkGetDeviceProcAddr( device, "vkResetEvent" ) ); - vkCreateQueryPool = PFN_vkCreateQueryPool( vkGetDeviceProcAddr( device, "vkCreateQueryPool" ) ); - vkDestroyQueryPool = PFN_vkDestroyQueryPool( vkGetDeviceProcAddr( device, "vkDestroyQueryPool" ) ); - vkGetQueryPoolResults = PFN_vkGetQueryPoolResults( vkGetDeviceProcAddr( device, "vkGetQueryPoolResults" ) ); - vkCreateBuffer = PFN_vkCreateBuffer( vkGetDeviceProcAddr( device, "vkCreateBuffer" ) ); - vkDestroyBuffer = PFN_vkDestroyBuffer( vkGetDeviceProcAddr( device, "vkDestroyBuffer" ) ); - vkCreateBufferView = PFN_vkCreateBufferView( vkGetDeviceProcAddr( device, "vkCreateBufferView" ) ); - vkDestroyBufferView = PFN_vkDestroyBufferView( vkGetDeviceProcAddr( device, "vkDestroyBufferView" ) ); - vkCreateImage = PFN_vkCreateImage( vkGetDeviceProcAddr( device, "vkCreateImage" ) ); - vkDestroyImage = PFN_vkDestroyImage( vkGetDeviceProcAddr( device, "vkDestroyImage" ) ); - vkGetImageSubresourceLayout = PFN_vkGetImageSubresourceLayout( vkGetDeviceProcAddr( device, "vkGetImageSubresourceLayout" ) ); - vkCreateImageView = PFN_vkCreateImageView( vkGetDeviceProcAddr( device, "vkCreateImageView" ) ); - vkDestroyImageView = PFN_vkDestroyImageView( vkGetDeviceProcAddr( device, "vkDestroyImageView" ) ); - vkCreateShaderModule = PFN_vkCreateShaderModule( vkGetDeviceProcAddr( device, "vkCreateShaderModule" ) ); - vkDestroyShaderModule = PFN_vkDestroyShaderModule( vkGetDeviceProcAddr( device, "vkDestroyShaderModule" ) ); - vkCreatePipelineCache = PFN_vkCreatePipelineCache( vkGetDeviceProcAddr( device, "vkCreatePipelineCache" ) ); - vkDestroyPipelineCache = PFN_vkDestroyPipelineCache( vkGetDeviceProcAddr( device, "vkDestroyPipelineCache" ) ); - vkGetPipelineCacheData = PFN_vkGetPipelineCacheData( vkGetDeviceProcAddr( device, "vkGetPipelineCacheData" ) ); - vkMergePipelineCaches = PFN_vkMergePipelineCaches( vkGetDeviceProcAddr( device, "vkMergePipelineCaches" ) ); - vkCreateGraphicsPipelines = PFN_vkCreateGraphicsPipelines( vkGetDeviceProcAddr( device, "vkCreateGraphicsPipelines" ) ); - vkCreateComputePipelines = PFN_vkCreateComputePipelines( vkGetDeviceProcAddr( device, "vkCreateComputePipelines" ) ); - vkDestroyPipeline = PFN_vkDestroyPipeline( vkGetDeviceProcAddr( device, "vkDestroyPipeline" ) ); - vkCreatePipelineLayout = PFN_vkCreatePipelineLayout( vkGetDeviceProcAddr( device, "vkCreatePipelineLayout" ) ); - vkDestroyPipelineLayout = PFN_vkDestroyPipelineLayout( vkGetDeviceProcAddr( device, "vkDestroyPipelineLayout" ) ); - vkCreateSampler = PFN_vkCreateSampler( vkGetDeviceProcAddr( device, "vkCreateSampler" ) ); - vkDestroySampler = PFN_vkDestroySampler( vkGetDeviceProcAddr( device, "vkDestroySampler" ) ); - vkCreateDescriptorSetLayout = PFN_vkCreateDescriptorSetLayout( vkGetDeviceProcAddr( device, "vkCreateDescriptorSetLayout" ) ); - vkDestroyDescriptorSetLayout = PFN_vkDestroyDescriptorSetLayout( vkGetDeviceProcAddr( device, "vkDestroyDescriptorSetLayout" ) ); - vkCreateDescriptorPool = PFN_vkCreateDescriptorPool( vkGetDeviceProcAddr( device, "vkCreateDescriptorPool" ) ); - vkDestroyDescriptorPool = PFN_vkDestroyDescriptorPool( vkGetDeviceProcAddr( device, "vkDestroyDescriptorPool" ) ); - vkResetDescriptorPool = PFN_vkResetDescriptorPool( vkGetDeviceProcAddr( device, "vkResetDescriptorPool" ) ); - vkAllocateDescriptorSets = PFN_vkAllocateDescriptorSets( vkGetDeviceProcAddr( device, "vkAllocateDescriptorSets" ) ); - vkFreeDescriptorSets = PFN_vkFreeDescriptorSets( vkGetDeviceProcAddr( device, "vkFreeDescriptorSets" ) ); - vkUpdateDescriptorSets = PFN_vkUpdateDescriptorSets( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSets" ) ); - vkCreateFramebuffer = PFN_vkCreateFramebuffer( vkGetDeviceProcAddr( device, "vkCreateFramebuffer" ) ); - vkDestroyFramebuffer = PFN_vkDestroyFramebuffer( vkGetDeviceProcAddr( device, "vkDestroyFramebuffer" ) ); - vkCreateRenderPass = PFN_vkCreateRenderPass( vkGetDeviceProcAddr( device, "vkCreateRenderPass" ) ); - vkDestroyRenderPass = PFN_vkDestroyRenderPass( vkGetDeviceProcAddr( device, "vkDestroyRenderPass" ) ); - vkGetRenderAreaGranularity = PFN_vkGetRenderAreaGranularity( vkGetDeviceProcAddr( device, "vkGetRenderAreaGranularity" ) ); - vkCreateCommandPool = PFN_vkCreateCommandPool( vkGetDeviceProcAddr( device, "vkCreateCommandPool" ) ); - vkDestroyCommandPool = PFN_vkDestroyCommandPool( vkGetDeviceProcAddr( device, "vkDestroyCommandPool" ) ); - vkResetCommandPool = PFN_vkResetCommandPool( vkGetDeviceProcAddr( device, "vkResetCommandPool" ) ); - vkAllocateCommandBuffers = PFN_vkAllocateCommandBuffers( vkGetDeviceProcAddr( device, "vkAllocateCommandBuffers" ) ); - vkFreeCommandBuffers = PFN_vkFreeCommandBuffers( vkGetDeviceProcAddr( device, "vkFreeCommandBuffers" ) ); - vkBeginCommandBuffer = PFN_vkBeginCommandBuffer( vkGetDeviceProcAddr( device, "vkBeginCommandBuffer" ) ); - vkEndCommandBuffer = PFN_vkEndCommandBuffer( vkGetDeviceProcAddr( device, "vkEndCommandBuffer" ) ); - vkResetCommandBuffer = PFN_vkResetCommandBuffer( vkGetDeviceProcAddr( device, "vkResetCommandBuffer" ) ); - vkCmdBindPipeline = PFN_vkCmdBindPipeline( vkGetDeviceProcAddr( device, "vkCmdBindPipeline" ) ); - vkCmdSetViewport = PFN_vkCmdSetViewport( vkGetDeviceProcAddr( device, "vkCmdSetViewport" ) ); - vkCmdSetScissor = PFN_vkCmdSetScissor( vkGetDeviceProcAddr( device, "vkCmdSetScissor" ) ); - vkCmdSetLineWidth = PFN_vkCmdSetLineWidth( vkGetDeviceProcAddr( device, "vkCmdSetLineWidth" ) ); - vkCmdSetDepthBias = PFN_vkCmdSetDepthBias( vkGetDeviceProcAddr( device, "vkCmdSetDepthBias" ) ); - vkCmdSetBlendConstants = PFN_vkCmdSetBlendConstants( vkGetDeviceProcAddr( device, "vkCmdSetBlendConstants" ) ); - vkCmdSetDepthBounds = PFN_vkCmdSetDepthBounds( vkGetDeviceProcAddr( device, "vkCmdSetDepthBounds" ) ); - vkCmdSetStencilCompareMask = PFN_vkCmdSetStencilCompareMask( vkGetDeviceProcAddr( device, "vkCmdSetStencilCompareMask" ) ); - vkCmdSetStencilWriteMask = PFN_vkCmdSetStencilWriteMask( vkGetDeviceProcAddr( device, "vkCmdSetStencilWriteMask" ) ); - vkCmdSetStencilReference = PFN_vkCmdSetStencilReference( vkGetDeviceProcAddr( device, "vkCmdSetStencilReference" ) ); - vkCmdBindDescriptorSets = PFN_vkCmdBindDescriptorSets( vkGetDeviceProcAddr( device, "vkCmdBindDescriptorSets" ) ); - vkCmdBindIndexBuffer = PFN_vkCmdBindIndexBuffer( vkGetDeviceProcAddr( device, "vkCmdBindIndexBuffer" ) ); - vkCmdBindVertexBuffers = PFN_vkCmdBindVertexBuffers( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers" ) ); - vkCmdDraw = PFN_vkCmdDraw( vkGetDeviceProcAddr( device, "vkCmdDraw" ) ); - vkCmdDrawIndexed = PFN_vkCmdDrawIndexed( vkGetDeviceProcAddr( device, "vkCmdDrawIndexed" ) ); - vkCmdDrawIndirect = PFN_vkCmdDrawIndirect( vkGetDeviceProcAddr( device, "vkCmdDrawIndirect" ) ); - vkCmdDrawIndexedIndirect = PFN_vkCmdDrawIndexedIndirect( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirect" ) ); - vkCmdDispatch = PFN_vkCmdDispatch( vkGetDeviceProcAddr( device, "vkCmdDispatch" ) ); - vkCmdDispatchIndirect = PFN_vkCmdDispatchIndirect( vkGetDeviceProcAddr( device, "vkCmdDispatchIndirect" ) ); - vkCmdCopyBuffer = PFN_vkCmdCopyBuffer( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer" ) ); - vkCmdCopyImage = PFN_vkCmdCopyImage( vkGetDeviceProcAddr( device, "vkCmdCopyImage" ) ); - vkCmdBlitImage = PFN_vkCmdBlitImage( vkGetDeviceProcAddr( device, "vkCmdBlitImage" ) ); - vkCmdCopyBufferToImage = PFN_vkCmdCopyBufferToImage( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage" ) ); - vkCmdCopyImageToBuffer = PFN_vkCmdCopyImageToBuffer( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer" ) ); - vkCmdUpdateBuffer = PFN_vkCmdUpdateBuffer( vkGetDeviceProcAddr( device, "vkCmdUpdateBuffer" ) ); - vkCmdFillBuffer = PFN_vkCmdFillBuffer( vkGetDeviceProcAddr( device, "vkCmdFillBuffer" ) ); - vkCmdClearColorImage = PFN_vkCmdClearColorImage( vkGetDeviceProcAddr( device, "vkCmdClearColorImage" ) ); - vkCmdClearDepthStencilImage = PFN_vkCmdClearDepthStencilImage( vkGetDeviceProcAddr( device, "vkCmdClearDepthStencilImage" ) ); - vkCmdClearAttachments = PFN_vkCmdClearAttachments( vkGetDeviceProcAddr( device, "vkCmdClearAttachments" ) ); - vkCmdResolveImage = PFN_vkCmdResolveImage( vkGetDeviceProcAddr( device, "vkCmdResolveImage" ) ); - vkCmdSetEvent = PFN_vkCmdSetEvent( vkGetDeviceProcAddr( device, "vkCmdSetEvent" ) ); - vkCmdResetEvent = PFN_vkCmdResetEvent( vkGetDeviceProcAddr( device, "vkCmdResetEvent" ) ); - vkCmdWaitEvents = PFN_vkCmdWaitEvents( vkGetDeviceProcAddr( device, "vkCmdWaitEvents" ) ); - vkCmdPipelineBarrier = PFN_vkCmdPipelineBarrier( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier" ) ); - vkCmdBeginQuery = PFN_vkCmdBeginQuery( vkGetDeviceProcAddr( device, "vkCmdBeginQuery" ) ); - vkCmdEndQuery = PFN_vkCmdEndQuery( vkGetDeviceProcAddr( device, "vkCmdEndQuery" ) ); - vkCmdResetQueryPool = PFN_vkCmdResetQueryPool( vkGetDeviceProcAddr( device, "vkCmdResetQueryPool" ) ); - vkCmdWriteTimestamp = PFN_vkCmdWriteTimestamp( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp" ) ); - vkCmdCopyQueryPoolResults = PFN_vkCmdCopyQueryPoolResults( vkGetDeviceProcAddr( device, "vkCmdCopyQueryPoolResults" ) ); - vkCmdPushConstants = PFN_vkCmdPushConstants( vkGetDeviceProcAddr( device, "vkCmdPushConstants" ) ); - vkCmdBeginRenderPass = PFN_vkCmdBeginRenderPass( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass" ) ); - vkCmdNextSubpass = PFN_vkCmdNextSubpass( vkGetDeviceProcAddr( device, "vkCmdNextSubpass" ) ); - vkCmdEndRenderPass = PFN_vkCmdEndRenderPass( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass" ) ); - vkCmdExecuteCommands = PFN_vkCmdExecuteCommands( vkGetDeviceProcAddr( device, "vkCmdExecuteCommands" ) ); - - //=== VK_VERSION_1_1 === - vkBindBufferMemory2 = PFN_vkBindBufferMemory2( vkGetDeviceProcAddr( device, "vkBindBufferMemory2" ) ); - vkBindImageMemory2 = PFN_vkBindImageMemory2( vkGetDeviceProcAddr( device, "vkBindImageMemory2" ) ); - vkGetDeviceGroupPeerMemoryFeatures = PFN_vkGetDeviceGroupPeerMemoryFeatures( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPeerMemoryFeatures" ) ); - vkCmdSetDeviceMask = PFN_vkCmdSetDeviceMask( vkGetDeviceProcAddr( device, "vkCmdSetDeviceMask" ) ); - vkCmdDispatchBase = PFN_vkCmdDispatchBase( vkGetDeviceProcAddr( device, "vkCmdDispatchBase" ) ); - vkGetImageMemoryRequirements2 = PFN_vkGetImageMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements2" ) ); - vkGetBufferMemoryRequirements2 = PFN_vkGetBufferMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements2" ) ); - vkGetImageSparseMemoryRequirements2 = PFN_vkGetImageSparseMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements2" ) ); - vkTrimCommandPool = PFN_vkTrimCommandPool( vkGetDeviceProcAddr( device, "vkTrimCommandPool" ) ); - vkGetDeviceQueue2 = PFN_vkGetDeviceQueue2( vkGetDeviceProcAddr( device, "vkGetDeviceQueue2" ) ); - vkCreateSamplerYcbcrConversion = PFN_vkCreateSamplerYcbcrConversion( vkGetDeviceProcAddr( device, "vkCreateSamplerYcbcrConversion" ) ); - vkDestroySamplerYcbcrConversion = PFN_vkDestroySamplerYcbcrConversion( vkGetDeviceProcAddr( device, "vkDestroySamplerYcbcrConversion" ) ); - vkCreateDescriptorUpdateTemplate = PFN_vkCreateDescriptorUpdateTemplate( vkGetDeviceProcAddr( device, "vkCreateDescriptorUpdateTemplate" ) ); - vkDestroyDescriptorUpdateTemplate = PFN_vkDestroyDescriptorUpdateTemplate( vkGetDeviceProcAddr( device, "vkDestroyDescriptorUpdateTemplate" ) ); - vkUpdateDescriptorSetWithTemplate = PFN_vkUpdateDescriptorSetWithTemplate( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSetWithTemplate" ) ); - vkGetDescriptorSetLayoutSupport = PFN_vkGetDescriptorSetLayoutSupport( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutSupport" ) ); - - //=== VK_VERSION_1_2 === - vkCmdDrawIndirectCount = PFN_vkCmdDrawIndirectCount( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCount" ) ); - vkCmdDrawIndexedIndirectCount = PFN_vkCmdDrawIndexedIndirectCount( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCount" ) ); - vkCreateRenderPass2 = PFN_vkCreateRenderPass2( vkGetDeviceProcAddr( device, "vkCreateRenderPass2" ) ); - vkCmdBeginRenderPass2 = PFN_vkCmdBeginRenderPass2( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass2" ) ); - vkCmdNextSubpass2 = PFN_vkCmdNextSubpass2( vkGetDeviceProcAddr( device, "vkCmdNextSubpass2" ) ); - vkCmdEndRenderPass2 = PFN_vkCmdEndRenderPass2( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass2" ) ); - vkResetQueryPool = PFN_vkResetQueryPool( vkGetDeviceProcAddr( device, "vkResetQueryPool" ) ); - vkGetSemaphoreCounterValue = PFN_vkGetSemaphoreCounterValue( vkGetDeviceProcAddr( device, "vkGetSemaphoreCounterValue" ) ); - vkWaitSemaphores = PFN_vkWaitSemaphores( vkGetDeviceProcAddr( device, "vkWaitSemaphores" ) ); - vkSignalSemaphore = PFN_vkSignalSemaphore( vkGetDeviceProcAddr( device, "vkSignalSemaphore" ) ); - vkGetBufferDeviceAddress = PFN_vkGetBufferDeviceAddress( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddress" ) ); - vkGetBufferOpaqueCaptureAddress = PFN_vkGetBufferOpaqueCaptureAddress( vkGetDeviceProcAddr( device, "vkGetBufferOpaqueCaptureAddress" ) ); - vkGetDeviceMemoryOpaqueCaptureAddress = - PFN_vkGetDeviceMemoryOpaqueCaptureAddress( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryOpaqueCaptureAddress" ) ); - - //=== VK_VERSION_1_3 === - vkCreatePrivateDataSlot = PFN_vkCreatePrivateDataSlot( vkGetDeviceProcAddr( device, "vkCreatePrivateDataSlot" ) ); - vkDestroyPrivateDataSlot = PFN_vkDestroyPrivateDataSlot( vkGetDeviceProcAddr( device, "vkDestroyPrivateDataSlot" ) ); - vkSetPrivateData = PFN_vkSetPrivateData( vkGetDeviceProcAddr( device, "vkSetPrivateData" ) ); - vkGetPrivateData = PFN_vkGetPrivateData( vkGetDeviceProcAddr( device, "vkGetPrivateData" ) ); - vkCmdSetEvent2 = PFN_vkCmdSetEvent2( vkGetDeviceProcAddr( device, "vkCmdSetEvent2" ) ); - vkCmdResetEvent2 = PFN_vkCmdResetEvent2( vkGetDeviceProcAddr( device, "vkCmdResetEvent2" ) ); - vkCmdWaitEvents2 = PFN_vkCmdWaitEvents2( vkGetDeviceProcAddr( device, "vkCmdWaitEvents2" ) ); - vkCmdPipelineBarrier2 = PFN_vkCmdPipelineBarrier2( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier2" ) ); - vkCmdWriteTimestamp2 = PFN_vkCmdWriteTimestamp2( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp2" ) ); - vkQueueSubmit2 = PFN_vkQueueSubmit2( vkGetDeviceProcAddr( device, "vkQueueSubmit2" ) ); - vkCmdCopyBuffer2 = PFN_vkCmdCopyBuffer2( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer2" ) ); - vkCmdCopyImage2 = PFN_vkCmdCopyImage2( vkGetDeviceProcAddr( device, "vkCmdCopyImage2" ) ); - vkCmdCopyBufferToImage2 = PFN_vkCmdCopyBufferToImage2( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage2" ) ); - vkCmdCopyImageToBuffer2 = PFN_vkCmdCopyImageToBuffer2( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer2" ) ); - vkCmdBlitImage2 = PFN_vkCmdBlitImage2( vkGetDeviceProcAddr( device, "vkCmdBlitImage2" ) ); - vkCmdResolveImage2 = PFN_vkCmdResolveImage2( vkGetDeviceProcAddr( device, "vkCmdResolveImage2" ) ); - vkCmdBeginRendering = PFN_vkCmdBeginRendering( vkGetDeviceProcAddr( device, "vkCmdBeginRendering" ) ); - vkCmdEndRendering = PFN_vkCmdEndRendering( vkGetDeviceProcAddr( device, "vkCmdEndRendering" ) ); - vkCmdSetCullMode = PFN_vkCmdSetCullMode( vkGetDeviceProcAddr( device, "vkCmdSetCullMode" ) ); - vkCmdSetFrontFace = PFN_vkCmdSetFrontFace( vkGetDeviceProcAddr( device, "vkCmdSetFrontFace" ) ); - vkCmdSetPrimitiveTopology = PFN_vkCmdSetPrimitiveTopology( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveTopology" ) ); - vkCmdSetViewportWithCount = PFN_vkCmdSetViewportWithCount( vkGetDeviceProcAddr( device, "vkCmdSetViewportWithCount" ) ); - vkCmdSetScissorWithCount = PFN_vkCmdSetScissorWithCount( vkGetDeviceProcAddr( device, "vkCmdSetScissorWithCount" ) ); - vkCmdBindVertexBuffers2 = PFN_vkCmdBindVertexBuffers2( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers2" ) ); - vkCmdSetDepthTestEnable = PFN_vkCmdSetDepthTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthTestEnable" ) ); - vkCmdSetDepthWriteEnable = PFN_vkCmdSetDepthWriteEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthWriteEnable" ) ); - vkCmdSetDepthCompareOp = PFN_vkCmdSetDepthCompareOp( vkGetDeviceProcAddr( device, "vkCmdSetDepthCompareOp" ) ); - vkCmdSetDepthBoundsTestEnable = PFN_vkCmdSetDepthBoundsTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthBoundsTestEnable" ) ); - vkCmdSetStencilTestEnable = PFN_vkCmdSetStencilTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetStencilTestEnable" ) ); - vkCmdSetStencilOp = PFN_vkCmdSetStencilOp( vkGetDeviceProcAddr( device, "vkCmdSetStencilOp" ) ); - vkCmdSetRasterizerDiscardEnable = PFN_vkCmdSetRasterizerDiscardEnable( vkGetDeviceProcAddr( device, "vkCmdSetRasterizerDiscardEnable" ) ); - vkCmdSetDepthBiasEnable = PFN_vkCmdSetDepthBiasEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthBiasEnable" ) ); - vkCmdSetPrimitiveRestartEnable = PFN_vkCmdSetPrimitiveRestartEnable( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveRestartEnable" ) ); - vkGetDeviceBufferMemoryRequirements = PFN_vkGetDeviceBufferMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceBufferMemoryRequirements" ) ); - vkGetDeviceImageMemoryRequirements = PFN_vkGetDeviceImageMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceImageMemoryRequirements" ) ); - vkGetDeviceImageSparseMemoryRequirements = - PFN_vkGetDeviceImageSparseMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceImageSparseMemoryRequirements" ) ); - - //=== VK_KHR_swapchain === - vkCreateSwapchainKHR = PFN_vkCreateSwapchainKHR( vkGetDeviceProcAddr( device, "vkCreateSwapchainKHR" ) ); - vkDestroySwapchainKHR = PFN_vkDestroySwapchainKHR( vkGetDeviceProcAddr( device, "vkDestroySwapchainKHR" ) ); - vkGetSwapchainImagesKHR = PFN_vkGetSwapchainImagesKHR( vkGetDeviceProcAddr( device, "vkGetSwapchainImagesKHR" ) ); - vkAcquireNextImageKHR = PFN_vkAcquireNextImageKHR( vkGetDeviceProcAddr( device, "vkAcquireNextImageKHR" ) ); - vkQueuePresentKHR = PFN_vkQueuePresentKHR( vkGetDeviceProcAddr( device, "vkQueuePresentKHR" ) ); - vkGetDeviceGroupPresentCapabilitiesKHR = - PFN_vkGetDeviceGroupPresentCapabilitiesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPresentCapabilitiesKHR" ) ); - vkGetDeviceGroupSurfacePresentModesKHR = - PFN_vkGetDeviceGroupSurfacePresentModesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupSurfacePresentModesKHR" ) ); - vkAcquireNextImage2KHR = PFN_vkAcquireNextImage2KHR( vkGetDeviceProcAddr( device, "vkAcquireNextImage2KHR" ) ); - - //=== VK_KHR_display_swapchain === - vkCreateSharedSwapchainsKHR = PFN_vkCreateSharedSwapchainsKHR( vkGetDeviceProcAddr( device, "vkCreateSharedSwapchainsKHR" ) ); - - //=== VK_EXT_debug_marker === - vkDebugMarkerSetObjectTagEXT = PFN_vkDebugMarkerSetObjectTagEXT( vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectTagEXT" ) ); - vkDebugMarkerSetObjectNameEXT = PFN_vkDebugMarkerSetObjectNameEXT( vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectNameEXT" ) ); - vkCmdDebugMarkerBeginEXT = PFN_vkCmdDebugMarkerBeginEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerBeginEXT" ) ); - vkCmdDebugMarkerEndEXT = PFN_vkCmdDebugMarkerEndEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerEndEXT" ) ); - vkCmdDebugMarkerInsertEXT = PFN_vkCmdDebugMarkerInsertEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerInsertEXT" ) ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - vkCreateVideoSessionKHR = PFN_vkCreateVideoSessionKHR( vkGetDeviceProcAddr( device, "vkCreateVideoSessionKHR" ) ); - vkDestroyVideoSessionKHR = PFN_vkDestroyVideoSessionKHR( vkGetDeviceProcAddr( device, "vkDestroyVideoSessionKHR" ) ); - vkGetVideoSessionMemoryRequirementsKHR = - PFN_vkGetVideoSessionMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetVideoSessionMemoryRequirementsKHR" ) ); - vkBindVideoSessionMemoryKHR = PFN_vkBindVideoSessionMemoryKHR( vkGetDeviceProcAddr( device, "vkBindVideoSessionMemoryKHR" ) ); - vkCreateVideoSessionParametersKHR = PFN_vkCreateVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkCreateVideoSessionParametersKHR" ) ); - vkUpdateVideoSessionParametersKHR = PFN_vkUpdateVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkUpdateVideoSessionParametersKHR" ) ); - vkDestroyVideoSessionParametersKHR = PFN_vkDestroyVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkDestroyVideoSessionParametersKHR" ) ); - vkCmdBeginVideoCodingKHR = PFN_vkCmdBeginVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdBeginVideoCodingKHR" ) ); - vkCmdEndVideoCodingKHR = PFN_vkCmdEndVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdEndVideoCodingKHR" ) ); - vkCmdControlVideoCodingKHR = PFN_vkCmdControlVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdControlVideoCodingKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - vkCmdDecodeVideoKHR = PFN_vkCmdDecodeVideoKHR( vkGetDeviceProcAddr( device, "vkCmdDecodeVideoKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - vkCmdBindTransformFeedbackBuffersEXT = PFN_vkCmdBindTransformFeedbackBuffersEXT( vkGetDeviceProcAddr( device, "vkCmdBindTransformFeedbackBuffersEXT" ) ); - vkCmdBeginTransformFeedbackEXT = PFN_vkCmdBeginTransformFeedbackEXT( vkGetDeviceProcAddr( device, "vkCmdBeginTransformFeedbackEXT" ) ); - vkCmdEndTransformFeedbackEXT = PFN_vkCmdEndTransformFeedbackEXT( vkGetDeviceProcAddr( device, "vkCmdEndTransformFeedbackEXT" ) ); - vkCmdBeginQueryIndexedEXT = PFN_vkCmdBeginQueryIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdBeginQueryIndexedEXT" ) ); - vkCmdEndQueryIndexedEXT = PFN_vkCmdEndQueryIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdEndQueryIndexedEXT" ) ); - vkCmdDrawIndirectByteCountEXT = PFN_vkCmdDrawIndirectByteCountEXT( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectByteCountEXT" ) ); - - //=== VK_NVX_binary_import === - vkCreateCuModuleNVX = PFN_vkCreateCuModuleNVX( vkGetDeviceProcAddr( device, "vkCreateCuModuleNVX" ) ); - vkCreateCuFunctionNVX = PFN_vkCreateCuFunctionNVX( vkGetDeviceProcAddr( device, "vkCreateCuFunctionNVX" ) ); - vkDestroyCuModuleNVX = PFN_vkDestroyCuModuleNVX( vkGetDeviceProcAddr( device, "vkDestroyCuModuleNVX" ) ); - vkDestroyCuFunctionNVX = PFN_vkDestroyCuFunctionNVX( vkGetDeviceProcAddr( device, "vkDestroyCuFunctionNVX" ) ); - vkCmdCuLaunchKernelNVX = PFN_vkCmdCuLaunchKernelNVX( vkGetDeviceProcAddr( device, "vkCmdCuLaunchKernelNVX" ) ); - - //=== VK_NVX_image_view_handle === - vkGetImageViewHandleNVX = PFN_vkGetImageViewHandleNVX( vkGetDeviceProcAddr( device, "vkGetImageViewHandleNVX" ) ); - vkGetImageViewAddressNVX = PFN_vkGetImageViewAddressNVX( vkGetDeviceProcAddr( device, "vkGetImageViewAddressNVX" ) ); - - //=== VK_AMD_draw_indirect_count === - vkCmdDrawIndirectCountAMD = PFN_vkCmdDrawIndirectCountAMD( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCountAMD" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountAMD; - vkCmdDrawIndexedIndirectCountAMD = PFN_vkCmdDrawIndexedIndirectCountAMD( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCountAMD" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountAMD; - - //=== VK_AMD_shader_info === - vkGetShaderInfoAMD = PFN_vkGetShaderInfoAMD( vkGetDeviceProcAddr( device, "vkGetShaderInfoAMD" ) ); - - //=== VK_KHR_dynamic_rendering === - vkCmdBeginRenderingKHR = PFN_vkCmdBeginRenderingKHR( vkGetDeviceProcAddr( device, "vkCmdBeginRenderingKHR" ) ); - if ( !vkCmdBeginRendering ) - vkCmdBeginRendering = vkCmdBeginRenderingKHR; - vkCmdEndRenderingKHR = PFN_vkCmdEndRenderingKHR( vkGetDeviceProcAddr( device, "vkCmdEndRenderingKHR" ) ); - if ( !vkCmdEndRendering ) - vkCmdEndRendering = vkCmdEndRenderingKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - vkGetMemoryWin32HandleNV = PFN_vkGetMemoryWin32HandleNV( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandleNV" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_device_group === - vkGetDeviceGroupPeerMemoryFeaturesKHR = - PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPeerMemoryFeaturesKHR" ) ); - if ( !vkGetDeviceGroupPeerMemoryFeatures ) - vkGetDeviceGroupPeerMemoryFeatures = vkGetDeviceGroupPeerMemoryFeaturesKHR; - vkCmdSetDeviceMaskKHR = PFN_vkCmdSetDeviceMaskKHR( vkGetDeviceProcAddr( device, "vkCmdSetDeviceMaskKHR" ) ); - if ( !vkCmdSetDeviceMask ) - vkCmdSetDeviceMask = vkCmdSetDeviceMaskKHR; - vkCmdDispatchBaseKHR = PFN_vkCmdDispatchBaseKHR( vkGetDeviceProcAddr( device, "vkCmdDispatchBaseKHR" ) ); - if ( !vkCmdDispatchBase ) - vkCmdDispatchBase = vkCmdDispatchBaseKHR; - - //=== VK_KHR_maintenance1 === - vkTrimCommandPoolKHR = PFN_vkTrimCommandPoolKHR( vkGetDeviceProcAddr( device, "vkTrimCommandPoolKHR" ) ); - if ( !vkTrimCommandPool ) - vkTrimCommandPool = vkTrimCommandPoolKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - vkGetMemoryWin32HandleKHR = PFN_vkGetMemoryWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandleKHR" ) ); - vkGetMemoryWin32HandlePropertiesKHR = PFN_vkGetMemoryWin32HandlePropertiesKHR( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandlePropertiesKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - vkGetMemoryFdKHR = PFN_vkGetMemoryFdKHR( vkGetDeviceProcAddr( device, "vkGetMemoryFdKHR" ) ); - vkGetMemoryFdPropertiesKHR = PFN_vkGetMemoryFdPropertiesKHR( vkGetDeviceProcAddr( device, "vkGetMemoryFdPropertiesKHR" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - vkImportSemaphoreWin32HandleKHR = PFN_vkImportSemaphoreWin32HandleKHR( vkGetDeviceProcAddr( device, "vkImportSemaphoreWin32HandleKHR" ) ); - vkGetSemaphoreWin32HandleKHR = PFN_vkGetSemaphoreWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreWin32HandleKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - vkImportSemaphoreFdKHR = PFN_vkImportSemaphoreFdKHR( vkGetDeviceProcAddr( device, "vkImportSemaphoreFdKHR" ) ); - vkGetSemaphoreFdKHR = PFN_vkGetSemaphoreFdKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreFdKHR" ) ); - - //=== VK_KHR_push_descriptor === - vkCmdPushDescriptorSetKHR = PFN_vkCmdPushDescriptorSetKHR( vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetKHR" ) ); - vkCmdPushDescriptorSetWithTemplateKHR = - PFN_vkCmdPushDescriptorSetWithTemplateKHR( vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetWithTemplateKHR" ) ); - - //=== VK_EXT_conditional_rendering === - vkCmdBeginConditionalRenderingEXT = PFN_vkCmdBeginConditionalRenderingEXT( vkGetDeviceProcAddr( device, "vkCmdBeginConditionalRenderingEXT" ) ); - vkCmdEndConditionalRenderingEXT = PFN_vkCmdEndConditionalRenderingEXT( vkGetDeviceProcAddr( device, "vkCmdEndConditionalRenderingEXT" ) ); - - //=== VK_KHR_descriptor_update_template === - vkCreateDescriptorUpdateTemplateKHR = PFN_vkCreateDescriptorUpdateTemplateKHR( vkGetDeviceProcAddr( device, "vkCreateDescriptorUpdateTemplateKHR" ) ); - if ( !vkCreateDescriptorUpdateTemplate ) - vkCreateDescriptorUpdateTemplate = vkCreateDescriptorUpdateTemplateKHR; - vkDestroyDescriptorUpdateTemplateKHR = PFN_vkDestroyDescriptorUpdateTemplateKHR( vkGetDeviceProcAddr( device, "vkDestroyDescriptorUpdateTemplateKHR" ) ); - if ( !vkDestroyDescriptorUpdateTemplate ) - vkDestroyDescriptorUpdateTemplate = vkDestroyDescriptorUpdateTemplateKHR; - vkUpdateDescriptorSetWithTemplateKHR = PFN_vkUpdateDescriptorSetWithTemplateKHR( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSetWithTemplateKHR" ) ); - if ( !vkUpdateDescriptorSetWithTemplate ) - vkUpdateDescriptorSetWithTemplate = vkUpdateDescriptorSetWithTemplateKHR; - - //=== VK_NV_clip_space_w_scaling === - vkCmdSetViewportWScalingNV = PFN_vkCmdSetViewportWScalingNV( vkGetDeviceProcAddr( device, "vkCmdSetViewportWScalingNV" ) ); - - //=== VK_EXT_display_control === - vkDisplayPowerControlEXT = PFN_vkDisplayPowerControlEXT( vkGetDeviceProcAddr( device, "vkDisplayPowerControlEXT" ) ); - vkRegisterDeviceEventEXT = PFN_vkRegisterDeviceEventEXT( vkGetDeviceProcAddr( device, "vkRegisterDeviceEventEXT" ) ); - vkRegisterDisplayEventEXT = PFN_vkRegisterDisplayEventEXT( vkGetDeviceProcAddr( device, "vkRegisterDisplayEventEXT" ) ); - vkGetSwapchainCounterEXT = PFN_vkGetSwapchainCounterEXT( vkGetDeviceProcAddr( device, "vkGetSwapchainCounterEXT" ) ); - - //=== VK_GOOGLE_display_timing === - vkGetRefreshCycleDurationGOOGLE = PFN_vkGetRefreshCycleDurationGOOGLE( vkGetDeviceProcAddr( device, "vkGetRefreshCycleDurationGOOGLE" ) ); - vkGetPastPresentationTimingGOOGLE = PFN_vkGetPastPresentationTimingGOOGLE( vkGetDeviceProcAddr( device, "vkGetPastPresentationTimingGOOGLE" ) ); - - //=== VK_EXT_discard_rectangles === - vkCmdSetDiscardRectangleEXT = PFN_vkCmdSetDiscardRectangleEXT( vkGetDeviceProcAddr( device, "vkCmdSetDiscardRectangleEXT" ) ); - - //=== VK_EXT_hdr_metadata === - vkSetHdrMetadataEXT = PFN_vkSetHdrMetadataEXT( vkGetDeviceProcAddr( device, "vkSetHdrMetadataEXT" ) ); - - //=== VK_KHR_create_renderpass2 === - vkCreateRenderPass2KHR = PFN_vkCreateRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCreateRenderPass2KHR" ) ); - if ( !vkCreateRenderPass2 ) - vkCreateRenderPass2 = vkCreateRenderPass2KHR; - vkCmdBeginRenderPass2KHR = PFN_vkCmdBeginRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass2KHR" ) ); - if ( !vkCmdBeginRenderPass2 ) - vkCmdBeginRenderPass2 = vkCmdBeginRenderPass2KHR; - vkCmdNextSubpass2KHR = PFN_vkCmdNextSubpass2KHR( vkGetDeviceProcAddr( device, "vkCmdNextSubpass2KHR" ) ); - if ( !vkCmdNextSubpass2 ) - vkCmdNextSubpass2 = vkCmdNextSubpass2KHR; - vkCmdEndRenderPass2KHR = PFN_vkCmdEndRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass2KHR" ) ); - if ( !vkCmdEndRenderPass2 ) - vkCmdEndRenderPass2 = vkCmdEndRenderPass2KHR; - - //=== VK_KHR_shared_presentable_image === - vkGetSwapchainStatusKHR = PFN_vkGetSwapchainStatusKHR( vkGetDeviceProcAddr( device, "vkGetSwapchainStatusKHR" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - vkImportFenceWin32HandleKHR = PFN_vkImportFenceWin32HandleKHR( vkGetDeviceProcAddr( device, "vkImportFenceWin32HandleKHR" ) ); - vkGetFenceWin32HandleKHR = PFN_vkGetFenceWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetFenceWin32HandleKHR" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - vkImportFenceFdKHR = PFN_vkImportFenceFdKHR( vkGetDeviceProcAddr( device, "vkImportFenceFdKHR" ) ); - vkGetFenceFdKHR = PFN_vkGetFenceFdKHR( vkGetDeviceProcAddr( device, "vkGetFenceFdKHR" ) ); - - //=== VK_KHR_performance_query === - vkAcquireProfilingLockKHR = PFN_vkAcquireProfilingLockKHR( vkGetDeviceProcAddr( device, "vkAcquireProfilingLockKHR" ) ); - vkReleaseProfilingLockKHR = PFN_vkReleaseProfilingLockKHR( vkGetDeviceProcAddr( device, "vkReleaseProfilingLockKHR" ) ); - - //=== VK_EXT_debug_utils === - vkSetDebugUtilsObjectNameEXT = PFN_vkSetDebugUtilsObjectNameEXT( vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectNameEXT" ) ); - vkSetDebugUtilsObjectTagEXT = PFN_vkSetDebugUtilsObjectTagEXT( vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectTagEXT" ) ); - vkQueueBeginDebugUtilsLabelEXT = PFN_vkQueueBeginDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueBeginDebugUtilsLabelEXT" ) ); - vkQueueEndDebugUtilsLabelEXT = PFN_vkQueueEndDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueEndDebugUtilsLabelEXT" ) ); - vkQueueInsertDebugUtilsLabelEXT = PFN_vkQueueInsertDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueInsertDebugUtilsLabelEXT" ) ); - vkCmdBeginDebugUtilsLabelEXT = PFN_vkCmdBeginDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdBeginDebugUtilsLabelEXT" ) ); - vkCmdEndDebugUtilsLabelEXT = PFN_vkCmdEndDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdEndDebugUtilsLabelEXT" ) ); - vkCmdInsertDebugUtilsLabelEXT = PFN_vkCmdInsertDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdInsertDebugUtilsLabelEXT" ) ); - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - vkGetAndroidHardwareBufferPropertiesANDROID = - PFN_vkGetAndroidHardwareBufferPropertiesANDROID( vkGetDeviceProcAddr( device, "vkGetAndroidHardwareBufferPropertiesANDROID" ) ); - vkGetMemoryAndroidHardwareBufferANDROID = - PFN_vkGetMemoryAndroidHardwareBufferANDROID( vkGetDeviceProcAddr( device, "vkGetMemoryAndroidHardwareBufferANDROID" ) ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - vkCmdSetSampleLocationsEXT = PFN_vkCmdSetSampleLocationsEXT( vkGetDeviceProcAddr( device, "vkCmdSetSampleLocationsEXT" ) ); - - //=== VK_KHR_get_memory_requirements2 === - vkGetImageMemoryRequirements2KHR = PFN_vkGetImageMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements2KHR" ) ); - if ( !vkGetImageMemoryRequirements2 ) - vkGetImageMemoryRequirements2 = vkGetImageMemoryRequirements2KHR; - vkGetBufferMemoryRequirements2KHR = PFN_vkGetBufferMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements2KHR" ) ); - if ( !vkGetBufferMemoryRequirements2 ) - vkGetBufferMemoryRequirements2 = vkGetBufferMemoryRequirements2KHR; - vkGetImageSparseMemoryRequirements2KHR = - PFN_vkGetImageSparseMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements2KHR" ) ); - if ( !vkGetImageSparseMemoryRequirements2 ) - vkGetImageSparseMemoryRequirements2 = vkGetImageSparseMemoryRequirements2KHR; - - //=== VK_KHR_acceleration_structure === - vkCreateAccelerationStructureKHR = PFN_vkCreateAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCreateAccelerationStructureKHR" ) ); - vkDestroyAccelerationStructureKHR = PFN_vkDestroyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkDestroyAccelerationStructureKHR" ) ); - vkCmdBuildAccelerationStructuresKHR = PFN_vkCmdBuildAccelerationStructuresKHR( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructuresKHR" ) ); - vkCmdBuildAccelerationStructuresIndirectKHR = - PFN_vkCmdBuildAccelerationStructuresIndirectKHR( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructuresIndirectKHR" ) ); - vkBuildAccelerationStructuresKHR = PFN_vkBuildAccelerationStructuresKHR( vkGetDeviceProcAddr( device, "vkBuildAccelerationStructuresKHR" ) ); - vkCopyAccelerationStructureKHR = PFN_vkCopyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCopyAccelerationStructureKHR" ) ); - vkCopyAccelerationStructureToMemoryKHR = - PFN_vkCopyAccelerationStructureToMemoryKHR( vkGetDeviceProcAddr( device, "vkCopyAccelerationStructureToMemoryKHR" ) ); - vkCopyMemoryToAccelerationStructureKHR = - PFN_vkCopyMemoryToAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCopyMemoryToAccelerationStructureKHR" ) ); - vkWriteAccelerationStructuresPropertiesKHR = - PFN_vkWriteAccelerationStructuresPropertiesKHR( vkGetDeviceProcAddr( device, "vkWriteAccelerationStructuresPropertiesKHR" ) ); - vkCmdCopyAccelerationStructureKHR = PFN_vkCmdCopyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureKHR" ) ); - vkCmdCopyAccelerationStructureToMemoryKHR = - PFN_vkCmdCopyAccelerationStructureToMemoryKHR( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureToMemoryKHR" ) ); - vkCmdCopyMemoryToAccelerationStructureKHR = - PFN_vkCmdCopyMemoryToAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCmdCopyMemoryToAccelerationStructureKHR" ) ); - vkGetAccelerationStructureDeviceAddressKHR = - PFN_vkGetAccelerationStructureDeviceAddressKHR( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureDeviceAddressKHR" ) ); - vkCmdWriteAccelerationStructuresPropertiesKHR = - PFN_vkCmdWriteAccelerationStructuresPropertiesKHR( vkGetDeviceProcAddr( device, "vkCmdWriteAccelerationStructuresPropertiesKHR" ) ); - vkGetDeviceAccelerationStructureCompatibilityKHR = - PFN_vkGetDeviceAccelerationStructureCompatibilityKHR( vkGetDeviceProcAddr( device, "vkGetDeviceAccelerationStructureCompatibilityKHR" ) ); - vkGetAccelerationStructureBuildSizesKHR = - PFN_vkGetAccelerationStructureBuildSizesKHR( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureBuildSizesKHR" ) ); - - //=== VK_KHR_sampler_ycbcr_conversion === - vkCreateSamplerYcbcrConversionKHR = PFN_vkCreateSamplerYcbcrConversionKHR( vkGetDeviceProcAddr( device, "vkCreateSamplerYcbcrConversionKHR" ) ); - if ( !vkCreateSamplerYcbcrConversion ) - vkCreateSamplerYcbcrConversion = vkCreateSamplerYcbcrConversionKHR; - vkDestroySamplerYcbcrConversionKHR = PFN_vkDestroySamplerYcbcrConversionKHR( vkGetDeviceProcAddr( device, "vkDestroySamplerYcbcrConversionKHR" ) ); - if ( !vkDestroySamplerYcbcrConversion ) - vkDestroySamplerYcbcrConversion = vkDestroySamplerYcbcrConversionKHR; - - //=== VK_KHR_bind_memory2 === - vkBindBufferMemory2KHR = PFN_vkBindBufferMemory2KHR( vkGetDeviceProcAddr( device, "vkBindBufferMemory2KHR" ) ); - if ( !vkBindBufferMemory2 ) - vkBindBufferMemory2 = vkBindBufferMemory2KHR; - vkBindImageMemory2KHR = PFN_vkBindImageMemory2KHR( vkGetDeviceProcAddr( device, "vkBindImageMemory2KHR" ) ); - if ( !vkBindImageMemory2 ) - vkBindImageMemory2 = vkBindImageMemory2KHR; - - //=== VK_EXT_image_drm_format_modifier === - vkGetImageDrmFormatModifierPropertiesEXT = - PFN_vkGetImageDrmFormatModifierPropertiesEXT( vkGetDeviceProcAddr( device, "vkGetImageDrmFormatModifierPropertiesEXT" ) ); - - //=== VK_EXT_validation_cache === - vkCreateValidationCacheEXT = PFN_vkCreateValidationCacheEXT( vkGetDeviceProcAddr( device, "vkCreateValidationCacheEXT" ) ); - vkDestroyValidationCacheEXT = PFN_vkDestroyValidationCacheEXT( vkGetDeviceProcAddr( device, "vkDestroyValidationCacheEXT" ) ); - vkMergeValidationCachesEXT = PFN_vkMergeValidationCachesEXT( vkGetDeviceProcAddr( device, "vkMergeValidationCachesEXT" ) ); - vkGetValidationCacheDataEXT = PFN_vkGetValidationCacheDataEXT( vkGetDeviceProcAddr( device, "vkGetValidationCacheDataEXT" ) ); - - //=== VK_NV_shading_rate_image === - vkCmdBindShadingRateImageNV = PFN_vkCmdBindShadingRateImageNV( vkGetDeviceProcAddr( device, "vkCmdBindShadingRateImageNV" ) ); - vkCmdSetViewportShadingRatePaletteNV = PFN_vkCmdSetViewportShadingRatePaletteNV( vkGetDeviceProcAddr( device, "vkCmdSetViewportShadingRatePaletteNV" ) ); - vkCmdSetCoarseSampleOrderNV = PFN_vkCmdSetCoarseSampleOrderNV( vkGetDeviceProcAddr( device, "vkCmdSetCoarseSampleOrderNV" ) ); - - //=== VK_NV_ray_tracing === - vkCreateAccelerationStructureNV = PFN_vkCreateAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCreateAccelerationStructureNV" ) ); - vkDestroyAccelerationStructureNV = PFN_vkDestroyAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkDestroyAccelerationStructureNV" ) ); - vkGetAccelerationStructureMemoryRequirementsNV = - PFN_vkGetAccelerationStructureMemoryRequirementsNV( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureMemoryRequirementsNV" ) ); - vkBindAccelerationStructureMemoryNV = PFN_vkBindAccelerationStructureMemoryNV( vkGetDeviceProcAddr( device, "vkBindAccelerationStructureMemoryNV" ) ); - vkCmdBuildAccelerationStructureNV = PFN_vkCmdBuildAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructureNV" ) ); - vkCmdCopyAccelerationStructureNV = PFN_vkCmdCopyAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureNV" ) ); - vkCmdTraceRaysNV = PFN_vkCmdTraceRaysNV( vkGetDeviceProcAddr( device, "vkCmdTraceRaysNV" ) ); - vkCreateRayTracingPipelinesNV = PFN_vkCreateRayTracingPipelinesNV( vkGetDeviceProcAddr( device, "vkCreateRayTracingPipelinesNV" ) ); - vkGetRayTracingShaderGroupHandlesNV = PFN_vkGetRayTracingShaderGroupHandlesNV( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupHandlesNV" ) ); - if ( !vkGetRayTracingShaderGroupHandlesKHR ) - vkGetRayTracingShaderGroupHandlesKHR = vkGetRayTracingShaderGroupHandlesNV; - vkGetAccelerationStructureHandleNV = PFN_vkGetAccelerationStructureHandleNV( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureHandleNV" ) ); - vkCmdWriteAccelerationStructuresPropertiesNV = - PFN_vkCmdWriteAccelerationStructuresPropertiesNV( vkGetDeviceProcAddr( device, "vkCmdWriteAccelerationStructuresPropertiesNV" ) ); - vkCompileDeferredNV = PFN_vkCompileDeferredNV( vkGetDeviceProcAddr( device, "vkCompileDeferredNV" ) ); - - //=== VK_KHR_maintenance3 === - vkGetDescriptorSetLayoutSupportKHR = PFN_vkGetDescriptorSetLayoutSupportKHR( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutSupportKHR" ) ); - if ( !vkGetDescriptorSetLayoutSupport ) - vkGetDescriptorSetLayoutSupport = vkGetDescriptorSetLayoutSupportKHR; - - //=== VK_KHR_draw_indirect_count === - vkCmdDrawIndirectCountKHR = PFN_vkCmdDrawIndirectCountKHR( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCountKHR" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountKHR; - vkCmdDrawIndexedIndirectCountKHR = PFN_vkCmdDrawIndexedIndirectCountKHR( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCountKHR" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountKHR; - - //=== VK_EXT_external_memory_host === - vkGetMemoryHostPointerPropertiesEXT = PFN_vkGetMemoryHostPointerPropertiesEXT( vkGetDeviceProcAddr( device, "vkGetMemoryHostPointerPropertiesEXT" ) ); - - //=== VK_AMD_buffer_marker === - vkCmdWriteBufferMarkerAMD = PFN_vkCmdWriteBufferMarkerAMD( vkGetDeviceProcAddr( device, "vkCmdWriteBufferMarkerAMD" ) ); - - //=== VK_EXT_calibrated_timestamps === - vkGetCalibratedTimestampsEXT = PFN_vkGetCalibratedTimestampsEXT( vkGetDeviceProcAddr( device, "vkGetCalibratedTimestampsEXT" ) ); - - //=== VK_NV_mesh_shader === - vkCmdDrawMeshTasksNV = PFN_vkCmdDrawMeshTasksNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksNV" ) ); - vkCmdDrawMeshTasksIndirectNV = PFN_vkCmdDrawMeshTasksIndirectNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectNV" ) ); - vkCmdDrawMeshTasksIndirectCountNV = PFN_vkCmdDrawMeshTasksIndirectCountNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectCountNV" ) ); - - //=== VK_NV_scissor_exclusive === - vkCmdSetExclusiveScissorNV = PFN_vkCmdSetExclusiveScissorNV( vkGetDeviceProcAddr( device, "vkCmdSetExclusiveScissorNV" ) ); - - //=== VK_NV_device_diagnostic_checkpoints === - vkCmdSetCheckpointNV = PFN_vkCmdSetCheckpointNV( vkGetDeviceProcAddr( device, "vkCmdSetCheckpointNV" ) ); - vkGetQueueCheckpointDataNV = PFN_vkGetQueueCheckpointDataNV( vkGetDeviceProcAddr( device, "vkGetQueueCheckpointDataNV" ) ); - - //=== VK_KHR_timeline_semaphore === - vkGetSemaphoreCounterValueKHR = PFN_vkGetSemaphoreCounterValueKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreCounterValueKHR" ) ); - if ( !vkGetSemaphoreCounterValue ) - vkGetSemaphoreCounterValue = vkGetSemaphoreCounterValueKHR; - vkWaitSemaphoresKHR = PFN_vkWaitSemaphoresKHR( vkGetDeviceProcAddr( device, "vkWaitSemaphoresKHR" ) ); - if ( !vkWaitSemaphores ) - vkWaitSemaphores = vkWaitSemaphoresKHR; - vkSignalSemaphoreKHR = PFN_vkSignalSemaphoreKHR( vkGetDeviceProcAddr( device, "vkSignalSemaphoreKHR" ) ); - if ( !vkSignalSemaphore ) - vkSignalSemaphore = vkSignalSemaphoreKHR; - - //=== VK_INTEL_performance_query === - vkInitializePerformanceApiINTEL = PFN_vkInitializePerformanceApiINTEL( vkGetDeviceProcAddr( device, "vkInitializePerformanceApiINTEL" ) ); - vkUninitializePerformanceApiINTEL = PFN_vkUninitializePerformanceApiINTEL( vkGetDeviceProcAddr( device, "vkUninitializePerformanceApiINTEL" ) ); - vkCmdSetPerformanceMarkerINTEL = PFN_vkCmdSetPerformanceMarkerINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceMarkerINTEL" ) ); - vkCmdSetPerformanceStreamMarkerINTEL = PFN_vkCmdSetPerformanceStreamMarkerINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceStreamMarkerINTEL" ) ); - vkCmdSetPerformanceOverrideINTEL = PFN_vkCmdSetPerformanceOverrideINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceOverrideINTEL" ) ); - vkAcquirePerformanceConfigurationINTEL = - PFN_vkAcquirePerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkAcquirePerformanceConfigurationINTEL" ) ); - vkReleasePerformanceConfigurationINTEL = - PFN_vkReleasePerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkReleasePerformanceConfigurationINTEL" ) ); - vkQueueSetPerformanceConfigurationINTEL = - PFN_vkQueueSetPerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkQueueSetPerformanceConfigurationINTEL" ) ); - vkGetPerformanceParameterINTEL = PFN_vkGetPerformanceParameterINTEL( vkGetDeviceProcAddr( device, "vkGetPerformanceParameterINTEL" ) ); - - //=== VK_AMD_display_native_hdr === - vkSetLocalDimmingAMD = PFN_vkSetLocalDimmingAMD( vkGetDeviceProcAddr( device, "vkSetLocalDimmingAMD" ) ); - - //=== VK_KHR_fragment_shading_rate === - vkCmdSetFragmentShadingRateKHR = PFN_vkCmdSetFragmentShadingRateKHR( vkGetDeviceProcAddr( device, "vkCmdSetFragmentShadingRateKHR" ) ); - - //=== VK_EXT_buffer_device_address === - vkGetBufferDeviceAddressEXT = PFN_vkGetBufferDeviceAddressEXT( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddressEXT" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressEXT; - - //=== VK_KHR_present_wait === - vkWaitForPresentKHR = PFN_vkWaitForPresentKHR( vkGetDeviceProcAddr( device, "vkWaitForPresentKHR" ) ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - vkAcquireFullScreenExclusiveModeEXT = PFN_vkAcquireFullScreenExclusiveModeEXT( vkGetDeviceProcAddr( device, "vkAcquireFullScreenExclusiveModeEXT" ) ); - vkReleaseFullScreenExclusiveModeEXT = PFN_vkReleaseFullScreenExclusiveModeEXT( vkGetDeviceProcAddr( device, "vkReleaseFullScreenExclusiveModeEXT" ) ); - vkGetDeviceGroupSurfacePresentModes2EXT = - PFN_vkGetDeviceGroupSurfacePresentModes2EXT( vkGetDeviceProcAddr( device, "vkGetDeviceGroupSurfacePresentModes2EXT" ) ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_buffer_device_address === - vkGetBufferDeviceAddressKHR = PFN_vkGetBufferDeviceAddressKHR( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddressKHR" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressKHR; - vkGetBufferOpaqueCaptureAddressKHR = PFN_vkGetBufferOpaqueCaptureAddressKHR( vkGetDeviceProcAddr( device, "vkGetBufferOpaqueCaptureAddressKHR" ) ); - if ( !vkGetBufferOpaqueCaptureAddress ) - vkGetBufferOpaqueCaptureAddress = vkGetBufferOpaqueCaptureAddressKHR; - vkGetDeviceMemoryOpaqueCaptureAddressKHR = - PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryOpaqueCaptureAddressKHR" ) ); - if ( !vkGetDeviceMemoryOpaqueCaptureAddress ) - vkGetDeviceMemoryOpaqueCaptureAddress = vkGetDeviceMemoryOpaqueCaptureAddressKHR; - - //=== VK_EXT_line_rasterization === - vkCmdSetLineStippleEXT = PFN_vkCmdSetLineStippleEXT( vkGetDeviceProcAddr( device, "vkCmdSetLineStippleEXT" ) ); - - //=== VK_EXT_host_query_reset === - vkResetQueryPoolEXT = PFN_vkResetQueryPoolEXT( vkGetDeviceProcAddr( device, "vkResetQueryPoolEXT" ) ); - if ( !vkResetQueryPool ) - vkResetQueryPool = vkResetQueryPoolEXT; - - //=== VK_EXT_extended_dynamic_state === - vkCmdSetCullModeEXT = PFN_vkCmdSetCullModeEXT( vkGetDeviceProcAddr( device, "vkCmdSetCullModeEXT" ) ); - if ( !vkCmdSetCullMode ) - vkCmdSetCullMode = vkCmdSetCullModeEXT; - vkCmdSetFrontFaceEXT = PFN_vkCmdSetFrontFaceEXT( vkGetDeviceProcAddr( device, "vkCmdSetFrontFaceEXT" ) ); - if ( !vkCmdSetFrontFace ) - vkCmdSetFrontFace = vkCmdSetFrontFaceEXT; - vkCmdSetPrimitiveTopologyEXT = PFN_vkCmdSetPrimitiveTopologyEXT( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveTopologyEXT" ) ); - if ( !vkCmdSetPrimitiveTopology ) - vkCmdSetPrimitiveTopology = vkCmdSetPrimitiveTopologyEXT; - vkCmdSetViewportWithCountEXT = PFN_vkCmdSetViewportWithCountEXT( vkGetDeviceProcAddr( device, "vkCmdSetViewportWithCountEXT" ) ); - if ( !vkCmdSetViewportWithCount ) - vkCmdSetViewportWithCount = vkCmdSetViewportWithCountEXT; - vkCmdSetScissorWithCountEXT = PFN_vkCmdSetScissorWithCountEXT( vkGetDeviceProcAddr( device, "vkCmdSetScissorWithCountEXT" ) ); - if ( !vkCmdSetScissorWithCount ) - vkCmdSetScissorWithCount = vkCmdSetScissorWithCountEXT; - vkCmdBindVertexBuffers2EXT = PFN_vkCmdBindVertexBuffers2EXT( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers2EXT" ) ); - if ( !vkCmdBindVertexBuffers2 ) - vkCmdBindVertexBuffers2 = vkCmdBindVertexBuffers2EXT; - vkCmdSetDepthTestEnableEXT = PFN_vkCmdSetDepthTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthTestEnableEXT" ) ); - if ( !vkCmdSetDepthTestEnable ) - vkCmdSetDepthTestEnable = vkCmdSetDepthTestEnableEXT; - vkCmdSetDepthWriteEnableEXT = PFN_vkCmdSetDepthWriteEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthWriteEnableEXT" ) ); - if ( !vkCmdSetDepthWriteEnable ) - vkCmdSetDepthWriteEnable = vkCmdSetDepthWriteEnableEXT; - vkCmdSetDepthCompareOpEXT = PFN_vkCmdSetDepthCompareOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthCompareOpEXT" ) ); - if ( !vkCmdSetDepthCompareOp ) - vkCmdSetDepthCompareOp = vkCmdSetDepthCompareOpEXT; - vkCmdSetDepthBoundsTestEnableEXT = PFN_vkCmdSetDepthBoundsTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthBoundsTestEnableEXT" ) ); - if ( !vkCmdSetDepthBoundsTestEnable ) - vkCmdSetDepthBoundsTestEnable = vkCmdSetDepthBoundsTestEnableEXT; - vkCmdSetStencilTestEnableEXT = PFN_vkCmdSetStencilTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetStencilTestEnableEXT" ) ); - if ( !vkCmdSetStencilTestEnable ) - vkCmdSetStencilTestEnable = vkCmdSetStencilTestEnableEXT; - vkCmdSetStencilOpEXT = PFN_vkCmdSetStencilOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetStencilOpEXT" ) ); - if ( !vkCmdSetStencilOp ) - vkCmdSetStencilOp = vkCmdSetStencilOpEXT; - - //=== VK_KHR_deferred_host_operations === - vkCreateDeferredOperationKHR = PFN_vkCreateDeferredOperationKHR( vkGetDeviceProcAddr( device, "vkCreateDeferredOperationKHR" ) ); - vkDestroyDeferredOperationKHR = PFN_vkDestroyDeferredOperationKHR( vkGetDeviceProcAddr( device, "vkDestroyDeferredOperationKHR" ) ); - vkGetDeferredOperationMaxConcurrencyKHR = - PFN_vkGetDeferredOperationMaxConcurrencyKHR( vkGetDeviceProcAddr( device, "vkGetDeferredOperationMaxConcurrencyKHR" ) ); - vkGetDeferredOperationResultKHR = PFN_vkGetDeferredOperationResultKHR( vkGetDeviceProcAddr( device, "vkGetDeferredOperationResultKHR" ) ); - vkDeferredOperationJoinKHR = PFN_vkDeferredOperationJoinKHR( vkGetDeviceProcAddr( device, "vkDeferredOperationJoinKHR" ) ); - - //=== VK_KHR_pipeline_executable_properties === - vkGetPipelineExecutablePropertiesKHR = PFN_vkGetPipelineExecutablePropertiesKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutablePropertiesKHR" ) ); - vkGetPipelineExecutableStatisticsKHR = PFN_vkGetPipelineExecutableStatisticsKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutableStatisticsKHR" ) ); - vkGetPipelineExecutableInternalRepresentationsKHR = - PFN_vkGetPipelineExecutableInternalRepresentationsKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutableInternalRepresentationsKHR" ) ); - - //=== VK_NV_device_generated_commands === - vkGetGeneratedCommandsMemoryRequirementsNV = - PFN_vkGetGeneratedCommandsMemoryRequirementsNV( vkGetDeviceProcAddr( device, "vkGetGeneratedCommandsMemoryRequirementsNV" ) ); - vkCmdPreprocessGeneratedCommandsNV = PFN_vkCmdPreprocessGeneratedCommandsNV( vkGetDeviceProcAddr( device, "vkCmdPreprocessGeneratedCommandsNV" ) ); - vkCmdExecuteGeneratedCommandsNV = PFN_vkCmdExecuteGeneratedCommandsNV( vkGetDeviceProcAddr( device, "vkCmdExecuteGeneratedCommandsNV" ) ); - vkCmdBindPipelineShaderGroupNV = PFN_vkCmdBindPipelineShaderGroupNV( vkGetDeviceProcAddr( device, "vkCmdBindPipelineShaderGroupNV" ) ); - vkCreateIndirectCommandsLayoutNV = PFN_vkCreateIndirectCommandsLayoutNV( vkGetDeviceProcAddr( device, "vkCreateIndirectCommandsLayoutNV" ) ); - vkDestroyIndirectCommandsLayoutNV = PFN_vkDestroyIndirectCommandsLayoutNV( vkGetDeviceProcAddr( device, "vkDestroyIndirectCommandsLayoutNV" ) ); - - //=== VK_EXT_private_data === - vkCreatePrivateDataSlotEXT = PFN_vkCreatePrivateDataSlotEXT( vkGetDeviceProcAddr( device, "vkCreatePrivateDataSlotEXT" ) ); - if ( !vkCreatePrivateDataSlot ) - vkCreatePrivateDataSlot = vkCreatePrivateDataSlotEXT; - vkDestroyPrivateDataSlotEXT = PFN_vkDestroyPrivateDataSlotEXT( vkGetDeviceProcAddr( device, "vkDestroyPrivateDataSlotEXT" ) ); - if ( !vkDestroyPrivateDataSlot ) - vkDestroyPrivateDataSlot = vkDestroyPrivateDataSlotEXT; - vkSetPrivateDataEXT = PFN_vkSetPrivateDataEXT( vkGetDeviceProcAddr( device, "vkSetPrivateDataEXT" ) ); - if ( !vkSetPrivateData ) - vkSetPrivateData = vkSetPrivateDataEXT; - vkGetPrivateDataEXT = PFN_vkGetPrivateDataEXT( vkGetDeviceProcAddr( device, "vkGetPrivateDataEXT" ) ); - if ( !vkGetPrivateData ) - vkGetPrivateData = vkGetPrivateDataEXT; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - vkCmdEncodeVideoKHR = PFN_vkCmdEncodeVideoKHR( vkGetDeviceProcAddr( device, "vkCmdEncodeVideoKHR" ) ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - vkExportMetalObjectsEXT = PFN_vkExportMetalObjectsEXT( vkGetDeviceProcAddr( device, "vkExportMetalObjectsEXT" ) ); -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - vkCmdSetEvent2KHR = PFN_vkCmdSetEvent2KHR( vkGetDeviceProcAddr( device, "vkCmdSetEvent2KHR" ) ); - if ( !vkCmdSetEvent2 ) - vkCmdSetEvent2 = vkCmdSetEvent2KHR; - vkCmdResetEvent2KHR = PFN_vkCmdResetEvent2KHR( vkGetDeviceProcAddr( device, "vkCmdResetEvent2KHR" ) ); - if ( !vkCmdResetEvent2 ) - vkCmdResetEvent2 = vkCmdResetEvent2KHR; - vkCmdWaitEvents2KHR = PFN_vkCmdWaitEvents2KHR( vkGetDeviceProcAddr( device, "vkCmdWaitEvents2KHR" ) ); - if ( !vkCmdWaitEvents2 ) - vkCmdWaitEvents2 = vkCmdWaitEvents2KHR; - vkCmdPipelineBarrier2KHR = PFN_vkCmdPipelineBarrier2KHR( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier2KHR" ) ); - if ( !vkCmdPipelineBarrier2 ) - vkCmdPipelineBarrier2 = vkCmdPipelineBarrier2KHR; - vkCmdWriteTimestamp2KHR = PFN_vkCmdWriteTimestamp2KHR( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp2KHR" ) ); - if ( !vkCmdWriteTimestamp2 ) - vkCmdWriteTimestamp2 = vkCmdWriteTimestamp2KHR; - vkQueueSubmit2KHR = PFN_vkQueueSubmit2KHR( vkGetDeviceProcAddr( device, "vkQueueSubmit2KHR" ) ); - if ( !vkQueueSubmit2 ) - vkQueueSubmit2 = vkQueueSubmit2KHR; - vkCmdWriteBufferMarker2AMD = PFN_vkCmdWriteBufferMarker2AMD( vkGetDeviceProcAddr( device, "vkCmdWriteBufferMarker2AMD" ) ); - vkGetQueueCheckpointData2NV = PFN_vkGetQueueCheckpointData2NV( vkGetDeviceProcAddr( device, "vkGetQueueCheckpointData2NV" ) ); - - //=== VK_NV_fragment_shading_rate_enums === - vkCmdSetFragmentShadingRateEnumNV = PFN_vkCmdSetFragmentShadingRateEnumNV( vkGetDeviceProcAddr( device, "vkCmdSetFragmentShadingRateEnumNV" ) ); - - //=== VK_EXT_mesh_shader === - vkCmdDrawMeshTasksEXT = PFN_vkCmdDrawMeshTasksEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksEXT" ) ); - vkCmdDrawMeshTasksIndirectEXT = PFN_vkCmdDrawMeshTasksIndirectEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectEXT" ) ); - vkCmdDrawMeshTasksIndirectCountEXT = PFN_vkCmdDrawMeshTasksIndirectCountEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectCountEXT" ) ); - - //=== VK_KHR_copy_commands2 === - vkCmdCopyBuffer2KHR = PFN_vkCmdCopyBuffer2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer2KHR" ) ); - if ( !vkCmdCopyBuffer2 ) - vkCmdCopyBuffer2 = vkCmdCopyBuffer2KHR; - vkCmdCopyImage2KHR = PFN_vkCmdCopyImage2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyImage2KHR" ) ); - if ( !vkCmdCopyImage2 ) - vkCmdCopyImage2 = vkCmdCopyImage2KHR; - vkCmdCopyBufferToImage2KHR = PFN_vkCmdCopyBufferToImage2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage2KHR" ) ); - if ( !vkCmdCopyBufferToImage2 ) - vkCmdCopyBufferToImage2 = vkCmdCopyBufferToImage2KHR; - vkCmdCopyImageToBuffer2KHR = PFN_vkCmdCopyImageToBuffer2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer2KHR" ) ); - if ( !vkCmdCopyImageToBuffer2 ) - vkCmdCopyImageToBuffer2 = vkCmdCopyImageToBuffer2KHR; - vkCmdBlitImage2KHR = PFN_vkCmdBlitImage2KHR( vkGetDeviceProcAddr( device, "vkCmdBlitImage2KHR" ) ); - if ( !vkCmdBlitImage2 ) - vkCmdBlitImage2 = vkCmdBlitImage2KHR; - vkCmdResolveImage2KHR = PFN_vkCmdResolveImage2KHR( vkGetDeviceProcAddr( device, "vkCmdResolveImage2KHR" ) ); - if ( !vkCmdResolveImage2 ) - vkCmdResolveImage2 = vkCmdResolveImage2KHR; - - //=== VK_EXT_image_compression_control === - vkGetImageSubresourceLayout2EXT = PFN_vkGetImageSubresourceLayout2EXT( vkGetDeviceProcAddr( device, "vkGetImageSubresourceLayout2EXT" ) ); - - //=== VK_KHR_ray_tracing_pipeline === - vkCmdTraceRaysKHR = PFN_vkCmdTraceRaysKHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysKHR" ) ); - vkCreateRayTracingPipelinesKHR = PFN_vkCreateRayTracingPipelinesKHR( vkGetDeviceProcAddr( device, "vkCreateRayTracingPipelinesKHR" ) ); - vkGetRayTracingShaderGroupHandlesKHR = PFN_vkGetRayTracingShaderGroupHandlesKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupHandlesKHR" ) ); - vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = - PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR" ) ); - vkCmdTraceRaysIndirectKHR = PFN_vkCmdTraceRaysIndirectKHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysIndirectKHR" ) ); - vkGetRayTracingShaderGroupStackSizeKHR = - PFN_vkGetRayTracingShaderGroupStackSizeKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupStackSizeKHR" ) ); - vkCmdSetRayTracingPipelineStackSizeKHR = - PFN_vkCmdSetRayTracingPipelineStackSizeKHR( vkGetDeviceProcAddr( device, "vkCmdSetRayTracingPipelineStackSizeKHR" ) ); - - //=== VK_EXT_vertex_input_dynamic_state === - vkCmdSetVertexInputEXT = PFN_vkCmdSetVertexInputEXT( vkGetDeviceProcAddr( device, "vkCmdSetVertexInputEXT" ) ); - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - vkGetMemoryZirconHandleFUCHSIA = PFN_vkGetMemoryZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkGetMemoryZirconHandleFUCHSIA" ) ); - vkGetMemoryZirconHandlePropertiesFUCHSIA = - PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA( vkGetDeviceProcAddr( device, "vkGetMemoryZirconHandlePropertiesFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - vkImportSemaphoreZirconHandleFUCHSIA = PFN_vkImportSemaphoreZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkImportSemaphoreZirconHandleFUCHSIA" ) ); - vkGetSemaphoreZirconHandleFUCHSIA = PFN_vkGetSemaphoreZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkGetSemaphoreZirconHandleFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - vkCreateBufferCollectionFUCHSIA = PFN_vkCreateBufferCollectionFUCHSIA( vkGetDeviceProcAddr( device, "vkCreateBufferCollectionFUCHSIA" ) ); - vkSetBufferCollectionImageConstraintsFUCHSIA = - PFN_vkSetBufferCollectionImageConstraintsFUCHSIA( vkGetDeviceProcAddr( device, "vkSetBufferCollectionImageConstraintsFUCHSIA" ) ); - vkSetBufferCollectionBufferConstraintsFUCHSIA = - PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA( vkGetDeviceProcAddr( device, "vkSetBufferCollectionBufferConstraintsFUCHSIA" ) ); - vkDestroyBufferCollectionFUCHSIA = PFN_vkDestroyBufferCollectionFUCHSIA( vkGetDeviceProcAddr( device, "vkDestroyBufferCollectionFUCHSIA" ) ); - vkGetBufferCollectionPropertiesFUCHSIA = - PFN_vkGetBufferCollectionPropertiesFUCHSIA( vkGetDeviceProcAddr( device, "vkGetBufferCollectionPropertiesFUCHSIA" ) ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = - PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( vkGetDeviceProcAddr( device, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI" ) ); - vkCmdSubpassShadingHUAWEI = PFN_vkCmdSubpassShadingHUAWEI( vkGetDeviceProcAddr( device, "vkCmdSubpassShadingHUAWEI" ) ); - - //=== VK_HUAWEI_invocation_mask === - vkCmdBindInvocationMaskHUAWEI = PFN_vkCmdBindInvocationMaskHUAWEI( vkGetDeviceProcAddr( device, "vkCmdBindInvocationMaskHUAWEI" ) ); - - //=== VK_NV_external_memory_rdma === - vkGetMemoryRemoteAddressNV = PFN_vkGetMemoryRemoteAddressNV( vkGetDeviceProcAddr( device, "vkGetMemoryRemoteAddressNV" ) ); - - //=== VK_EXT_pipeline_properties === - vkGetPipelinePropertiesEXT = PFN_vkGetPipelinePropertiesEXT( vkGetDeviceProcAddr( device, "vkGetPipelinePropertiesEXT" ) ); - - //=== VK_EXT_extended_dynamic_state2 === - vkCmdSetPatchControlPointsEXT = PFN_vkCmdSetPatchControlPointsEXT( vkGetDeviceProcAddr( device, "vkCmdSetPatchControlPointsEXT" ) ); - vkCmdSetRasterizerDiscardEnableEXT = PFN_vkCmdSetRasterizerDiscardEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetRasterizerDiscardEnableEXT" ) ); - if ( !vkCmdSetRasterizerDiscardEnable ) - vkCmdSetRasterizerDiscardEnable = vkCmdSetRasterizerDiscardEnableEXT; - vkCmdSetDepthBiasEnableEXT = PFN_vkCmdSetDepthBiasEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthBiasEnableEXT" ) ); - if ( !vkCmdSetDepthBiasEnable ) - vkCmdSetDepthBiasEnable = vkCmdSetDepthBiasEnableEXT; - vkCmdSetLogicOpEXT = PFN_vkCmdSetLogicOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetLogicOpEXT" ) ); - vkCmdSetPrimitiveRestartEnableEXT = PFN_vkCmdSetPrimitiveRestartEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveRestartEnableEXT" ) ); - if ( !vkCmdSetPrimitiveRestartEnable ) - vkCmdSetPrimitiveRestartEnable = vkCmdSetPrimitiveRestartEnableEXT; - - //=== VK_EXT_color_write_enable === - vkCmdSetColorWriteEnableEXT = PFN_vkCmdSetColorWriteEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetColorWriteEnableEXT" ) ); - - //=== VK_KHR_ray_tracing_maintenance1 === - vkCmdTraceRaysIndirect2KHR = PFN_vkCmdTraceRaysIndirect2KHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysIndirect2KHR" ) ); - - //=== VK_EXT_multi_draw === - vkCmdDrawMultiEXT = PFN_vkCmdDrawMultiEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMultiEXT" ) ); - vkCmdDrawMultiIndexedEXT = PFN_vkCmdDrawMultiIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMultiIndexedEXT" ) ); - - //=== VK_EXT_pageable_device_local_memory === - vkSetDeviceMemoryPriorityEXT = PFN_vkSetDeviceMemoryPriorityEXT( vkGetDeviceProcAddr( device, "vkSetDeviceMemoryPriorityEXT" ) ); - - //=== VK_KHR_maintenance4 === - vkGetDeviceBufferMemoryRequirementsKHR = - PFN_vkGetDeviceBufferMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceBufferMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceBufferMemoryRequirements ) - vkGetDeviceBufferMemoryRequirements = vkGetDeviceBufferMemoryRequirementsKHR; - vkGetDeviceImageMemoryRequirementsKHR = - PFN_vkGetDeviceImageMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceImageMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageMemoryRequirements ) - vkGetDeviceImageMemoryRequirements = vkGetDeviceImageMemoryRequirementsKHR; - vkGetDeviceImageSparseMemoryRequirementsKHR = - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceImageSparseMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageSparseMemoryRequirements ) - vkGetDeviceImageSparseMemoryRequirements = vkGetDeviceImageSparseMemoryRequirementsKHR; - - //=== VK_VALVE_descriptor_set_host_mapping === - vkGetDescriptorSetLayoutHostMappingInfoVALVE = - PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutHostMappingInfoVALVE" ) ); - vkGetDescriptorSetHostMappingVALVE = PFN_vkGetDescriptorSetHostMappingVALVE( vkGetDeviceProcAddr( device, "vkGetDescriptorSetHostMappingVALVE" ) ); - - //=== VK_EXT_shader_module_identifier === - vkGetShaderModuleIdentifierEXT = PFN_vkGetShaderModuleIdentifierEXT( vkGetDeviceProcAddr( device, "vkGetShaderModuleIdentifierEXT" ) ); - vkGetShaderModuleCreateInfoIdentifierEXT = - PFN_vkGetShaderModuleCreateInfoIdentifierEXT( vkGetDeviceProcAddr( device, "vkGetShaderModuleCreateInfoIdentifierEXT" ) ); - - //=== VK_QCOM_tile_properties === - vkGetFramebufferTilePropertiesQCOM = PFN_vkGetFramebufferTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetFramebufferTilePropertiesQCOM" ) ); - vkGetDynamicRenderingTilePropertiesQCOM = - PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); - } - }; -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_android.h b/src/video/khronos/vulkan/vulkan_android.h index 11f5397966c2f..61ff40ba8cd29 100644 --- a/src/video/khronos/vulkan/vulkan_android.h +++ b/src/video/khronos/vulkan/vulkan_android.h @@ -2,7 +2,7 @@ #define VULKAN_ANDROID_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_KHR_android_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_android_surface 1 struct ANativeWindow; #define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6 @@ -42,6 +43,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( #endif +// VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls. #define VK_ANDROID_external_memory_android_hardware_buffer 1 struct AHardwareBuffer; #define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5 @@ -118,6 +120,32 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( struct AHardwareBuffer** pBuffer); #endif + +// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls. +#define VK_ANDROID_external_format_resolve 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_SPEC_VERSION 1 +#define VK_ANDROID_EXTERNAL_FORMAT_RESOLVE_EXTENSION_NAME "VK_ANDROID_external_format_resolve" +typedef struct VkPhysicalDeviceExternalFormatResolveFeaturesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 externalFormatResolve; +} VkPhysicalDeviceExternalFormatResolveFeaturesANDROID; + +typedef struct VkPhysicalDeviceExternalFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkBool32 nullColorAttachmentWithExternalFormatResolve; + VkChromaLocation externalFormatResolveChromaOffsetX; + VkChromaLocation externalFormatResolveChromaOffsetY; +} VkPhysicalDeviceExternalFormatResolvePropertiesANDROID; + +typedef struct VkAndroidHardwareBufferFormatResolvePropertiesANDROID { + VkStructureType sType; + void* pNext; + VkFormat colorAttachmentFormat; +} VkAndroidHardwareBufferFormatResolvePropertiesANDROID; + + #ifdef __cplusplus } #endif diff --git a/src/video/khronos/vulkan/vulkan_beta.h b/src/video/khronos/vulkan/vulkan_beta.h index db03af41bd891..df18b4042b177 100644 --- a/src/video/khronos/vulkan/vulkan_beta.h +++ b/src/video/khronos/vulkan/vulkan_beta.h @@ -2,7 +2,7 @@ #define VULKAN_BETA_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,356 +19,7 @@ extern "C" { -#define VK_KHR_video_queue 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) -#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 5 -#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" - -typedef enum VkQueryResultStatusKHR { - VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, - VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, - VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, - VK_QUERY_RESULT_STATUS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkQueryResultStatusKHR; - -typedef enum VkVideoCodecOperationFlagBitsKHR { - VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0x00010000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0x00020000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT = 0x00000001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT = 0x00000002, -#endif - VK_VIDEO_CODEC_OPERATION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCodecOperationFlagBitsKHR; -typedef VkFlags VkVideoCodecOperationFlagsKHR; - -typedef enum VkVideoChromaSubsamplingFlagBitsKHR { - VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR = 0, - VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0x00000001, - VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0x00000002, - VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0x00000004, - VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0x00000008, - VK_VIDEO_CHROMA_SUBSAMPLING_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoChromaSubsamplingFlagBitsKHR; -typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; - -typedef enum VkVideoComponentBitDepthFlagBitsKHR { - VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR = 0, - VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0x00000001, - VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0x00000004, - VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0x00000010, - VK_VIDEO_COMPONENT_BIT_DEPTH_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoComponentBitDepthFlagBitsKHR; -typedef VkFlags VkVideoComponentBitDepthFlagsKHR; - -typedef enum VkVideoCapabilityFlagBitsKHR { - VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0x00000002, - VK_VIDEO_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCapabilityFlagBitsKHR; -typedef VkFlags VkVideoCapabilityFlagsKHR; - -typedef enum VkVideoSessionCreateFlagBitsKHR { - VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, - VK_VIDEO_SESSION_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoSessionCreateFlagBitsKHR; -typedef VkFlags VkVideoSessionCreateFlagsKHR; -typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; -typedef VkFlags VkVideoBeginCodingFlagsKHR; -typedef VkFlags VkVideoEndCodingFlagsKHR; - -typedef enum VkVideoCodingControlFlagBitsKHR { - VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR = 0x00000004, -#endif - VK_VIDEO_CODING_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoCodingControlFlagBitsKHR; -typedef VkFlags VkVideoCodingControlFlagsKHR; -typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR { - VkStructureType sType; - void* pNext; - VkBool32 queryResultStatusSupport; -} VkQueueFamilyQueryResultStatusPropertiesKHR; - -typedef struct VkQueueFamilyVideoPropertiesKHR { - VkStructureType sType; - void* pNext; - VkVideoCodecOperationFlagsKHR videoCodecOperations; -} VkQueueFamilyVideoPropertiesKHR; - -typedef struct VkVideoProfileInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoCodecOperationFlagBitsKHR videoCodecOperation; - VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; - VkVideoComponentBitDepthFlagsKHR lumaBitDepth; - VkVideoComponentBitDepthFlagsKHR chromaBitDepth; -} VkVideoProfileInfoKHR; - -typedef struct VkVideoProfileListInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t profileCount; - const VkVideoProfileInfoKHR* pProfiles; -} VkVideoProfileListInfoKHR; - -typedef struct VkVideoCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoCapabilityFlagsKHR capabilityFlags; - VkDeviceSize minBitstreamBufferOffsetAlignment; - VkDeviceSize minBitstreamBufferSizeAlignment; - VkExtent2D videoPictureExtentGranularity; - VkExtent2D minExtent; - VkExtent2D maxExtent; - uint32_t maxReferencePicturesSlotsCount; - uint32_t maxReferencePicturesActiveCount; - VkExtensionProperties stdHeaderVersion; -} VkVideoCapabilitiesKHR; - -typedef struct VkPhysicalDeviceVideoFormatInfoKHR { - VkStructureType sType; - const void* pNext; - VkImageUsageFlags imageUsage; -} VkPhysicalDeviceVideoFormatInfoKHR; - -typedef struct VkVideoFormatPropertiesKHR { - VkStructureType sType; - void* pNext; - VkFormat format; - VkComponentMapping componentMapping; - VkImageCreateFlags imageCreateFlags; - VkImageType imageType; - VkImageTiling imageTiling; - VkImageUsageFlags imageUsageFlags; -} VkVideoFormatPropertiesKHR; - -typedef struct VkVideoPictureResourceInfoKHR { - VkStructureType sType; - const void* pNext; - VkOffset2D codedOffset; - VkExtent2D codedExtent; - uint32_t baseArrayLayer; - VkImageView imageViewBinding; -} VkVideoPictureResourceInfoKHR; - -typedef struct VkVideoReferenceSlotInfoKHR { - VkStructureType sType; - const void* pNext; - int8_t slotIndex; - const VkVideoPictureResourceInfoKHR* pPictureResource; -} VkVideoReferenceSlotInfoKHR; - -typedef struct VkVideoSessionMemoryRequirementsKHR { - VkStructureType sType; - void* pNext; - uint32_t memoryBindIndex; - VkMemoryRequirements memoryRequirements; -} VkVideoSessionMemoryRequirementsKHR; - -typedef struct VkBindVideoSessionMemoryInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t memoryBindIndex; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkDeviceSize memorySize; -} VkBindVideoSessionMemoryInfoKHR; - -typedef struct VkVideoSessionCreateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t queueFamilyIndex; - VkVideoSessionCreateFlagsKHR flags; - const VkVideoProfileInfoKHR* pVideoProfile; - VkFormat pictureFormat; - VkExtent2D maxCodedExtent; - VkFormat referencePicturesFormat; - uint32_t maxReferencePicturesSlotsCount; - uint32_t maxReferencePicturesActiveCount; - const VkExtensionProperties* pStdHeaderVersion; -} VkVideoSessionCreateInfoKHR; - -typedef struct VkVideoSessionParametersCreateInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoSessionParametersCreateFlagsKHR flags; - VkVideoSessionParametersKHR videoSessionParametersTemplate; - VkVideoSessionKHR videoSession; -} VkVideoSessionParametersCreateInfoKHR; - -typedef struct VkVideoSessionParametersUpdateInfoKHR { - VkStructureType sType; - const void* pNext; - uint32_t updateSequenceCount; -} VkVideoSessionParametersUpdateInfoKHR; - -typedef struct VkVideoBeginCodingInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoBeginCodingFlagsKHR flags; - VkVideoSessionKHR videoSession; - VkVideoSessionParametersKHR videoSessionParameters; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; -} VkVideoBeginCodingInfoKHR; - -typedef struct VkVideoEndCodingInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEndCodingFlagsKHR flags; -} VkVideoEndCodingInfoKHR; - -typedef struct VkVideoCodingControlInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoCodingControlFlagsKHR flags; -} VkVideoCodingControlInfoKHR; - -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities); -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionKHR)(VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionKHR)(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks* pAllocator); -typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); -typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); -typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionParametersKHR)(VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters); -typedef VkResult (VKAPI_PTR *PFN_vkUpdateVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); -typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks* pAllocator); -typedef void (VKAPI_PTR *PFN_vkCmdBeginVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR* pBeginInfo); -typedef void (VKAPI_PTR *PFN_vkCmdEndVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR* pEndCodingInfo); -typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR( - VkPhysicalDevice physicalDevice, - const VkVideoProfileInfoKHR* pVideoProfile, - VkVideoCapabilitiesKHR* pCapabilities); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR( - VkPhysicalDevice physicalDevice, - const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, - uint32_t* pVideoFormatPropertyCount, - VkVideoFormatPropertiesKHR* pVideoFormatProperties); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionKHR( - VkDevice device, - const VkVideoSessionCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkVideoSessionKHR* pVideoSession); - -VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t* pMemoryRequirementsCount, - VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); - -VKAPI_ATTR VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR( - VkDevice device, - VkVideoSessionKHR videoSession, - uint32_t bindSessionMemoryInfoCount, - const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); - -VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR( - VkDevice device, - const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, - const VkAllocationCallbacks* pAllocator, - VkVideoSessionParametersKHR* pVideoSessionParameters); - -VKAPI_ATTR VkResult VKAPI_CALL vkUpdateVideoSessionParametersKHR( - VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); - -VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionParametersKHR( - VkDevice device, - VkVideoSessionParametersKHR videoSessionParameters, - const VkAllocationCallbacks* pAllocator); - -VKAPI_ATTR void VKAPI_CALL vkCmdBeginVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoBeginCodingInfoKHR* pBeginInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdEndVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoEndCodingInfoKHR* pEndCodingInfo); - -VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR( - VkCommandBuffer commandBuffer, - const VkVideoCodingControlInfoKHR* pCodingControlInfo); -#endif - - -#define VK_KHR_video_decode_queue 1 -#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 6 -#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" - -typedef enum VkVideoDecodeCapabilityFlagBitsKHR { - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoDecodeCapabilityFlagBitsKHR; -typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; - -typedef enum VkVideoDecodeUsageFlagBitsKHR { - VK_VIDEO_DECODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0x00000002, - VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0x00000004, - VK_VIDEO_DECODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoDecodeUsageFlagBitsKHR; -typedef VkFlags VkVideoDecodeUsageFlagsKHR; -typedef VkFlags VkVideoDecodeFlagsKHR; -typedef struct VkVideoDecodeCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoDecodeCapabilityFlagsKHR flags; -} VkVideoDecodeCapabilitiesKHR; - -typedef struct VkVideoDecodeUsageInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoDecodeUsageFlagsKHR videoUsageHints; -} VkVideoDecodeUsageInfoKHR; - -typedef struct VkVideoDecodeInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoDecodeFlagsKHR flags; - VkBuffer srcBuffer; - VkDeviceSize srcBufferOffset; - VkDeviceSize srcBufferRange; - VkVideoPictureResourceInfoKHR dstPictureResource; - const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; -} VkVideoDecodeInfoKHR; - -typedef void (VKAPI_PTR *PFN_vkCmdDecodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pFrameInfo); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( - VkCommandBuffer commandBuffer, - const VkVideoDecodeInfoKHR* pFrameInfo); -#endif - - +// VK_KHR_portability_subset is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_portability_subset 1 #define VK_KHR_PORTABILITY_SUBSET_SPEC_VERSION 1 #define VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME "VK_KHR_portability_subset" @@ -400,617 +51,162 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR { -#define VK_KHR_video_encode_queue 1 -#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 7 -#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" - -typedef enum VkVideoEncodeTuningModeKHR { - VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1, - VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2, - VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3, - VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4, - VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeTuningModeKHR; -typedef VkFlags VkVideoEncodeFlagsKHR; - -typedef enum VkVideoEncodeCapabilityFlagBitsKHR { - VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeCapabilityFlagBitsKHR; -typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; - -typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 1, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 2, - VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeRateControlModeFlagBitsKHR; -typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; - -typedef enum VkVideoEncodeUsageFlagBitsKHR { - VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008, - VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeUsageFlagBitsKHR; -typedef VkFlags VkVideoEncodeUsageFlagsKHR; - -typedef enum VkVideoEncodeContentFlagBitsKHR { - VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0, - VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001, - VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002, - VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004, - VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF -} VkVideoEncodeContentFlagBitsKHR; -typedef VkFlags VkVideoEncodeContentFlagsKHR; -typedef VkFlags VkVideoEncodeRateControlFlagsKHR; -typedef struct VkVideoEncodeInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeFlagsKHR flags; - uint32_t qualityLevel; - VkBuffer dstBitstreamBuffer; - VkDeviceSize dstBitstreamBufferOffset; - VkDeviceSize dstBitstreamBufferMaxRange; - VkVideoPictureResourceInfoKHR srcPictureResource; - const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; - uint32_t referenceSlotCount; - const VkVideoReferenceSlotInfoKHR* pReferenceSlots; - uint32_t precedingExternallyEncodedBytes; -} VkVideoEncodeInfoKHR; - -typedef struct VkVideoEncodeCapabilitiesKHR { - VkStructureType sType; - void* pNext; - VkVideoEncodeCapabilityFlagsKHR flags; - VkVideoEncodeRateControlModeFlagsKHR rateControlModes; - uint8_t rateControlLayerCount; - uint8_t qualityLevelCount; - VkExtent2D inputImageDataFillAlignment; -} VkVideoEncodeCapabilitiesKHR; - -typedef struct VkVideoEncodeUsageInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeUsageFlagsKHR videoUsageHints; - VkVideoEncodeContentFlagsKHR videoContentHints; - VkVideoEncodeTuningModeKHR tuningMode; -} VkVideoEncodeUsageInfoKHR; - -typedef struct VkVideoEncodeRateControlLayerInfoKHR { +// VK_AMDX_shader_enqueue is a preprocessor guard. Do not pass it to API calls. +#define VK_AMDX_shader_enqueue 1 +#define VK_AMDX_SHADER_ENQUEUE_SPEC_VERSION 1 +#define VK_AMDX_SHADER_ENQUEUE_EXTENSION_NAME "VK_AMDX_shader_enqueue" +#define VK_SHADER_INDEX_UNUSED_AMDX (~0U) +typedef struct VkPhysicalDeviceShaderEnqueueFeaturesAMDX { VkStructureType sType; - const void* pNext; - uint32_t averageBitrate; - uint32_t maxBitrate; - uint32_t frameRateNumerator; - uint32_t frameRateDenominator; - uint32_t virtualBufferSizeInMs; - uint32_t initialVirtualBufferSizeInMs; -} VkVideoEncodeRateControlLayerInfoKHR; - -typedef struct VkVideoEncodeRateControlInfoKHR { - VkStructureType sType; - const void* pNext; - VkVideoEncodeRateControlFlagsKHR flags; - VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; - uint8_t layerCount; - const VkVideoEncodeRateControlLayerInfoKHR* pLayerConfigs; -} VkVideoEncodeRateControlInfoKHR; - -typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo); + void* pNext; + VkBool32 shaderEnqueue; +} VkPhysicalDeviceShaderEnqueueFeaturesAMDX; + +typedef struct VkPhysicalDeviceShaderEnqueuePropertiesAMDX { + VkStructureType sType; + void* pNext; + uint32_t maxExecutionGraphDepth; + uint32_t maxExecutionGraphShaderOutputNodes; + uint32_t maxExecutionGraphShaderPayloadSize; + uint32_t maxExecutionGraphShaderPayloadCount; + uint32_t executionGraphDispatchAddressAlignment; +} VkPhysicalDeviceShaderEnqueuePropertiesAMDX; + +typedef struct VkExecutionGraphPipelineScratchSizeAMDX { + VkStructureType sType; + void* pNext; + VkDeviceSize size; +} VkExecutionGraphPipelineScratchSizeAMDX; + +typedef struct VkExecutionGraphPipelineCreateInfoAMDX { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags flags; + uint32_t stageCount; + const VkPipelineShaderStageCreateInfo* pStages; + const VkPipelineLibraryCreateInfoKHR* pLibraryInfo; + VkPipelineLayout layout; + VkPipeline basePipelineHandle; + int32_t basePipelineIndex; +} VkExecutionGraphPipelineCreateInfoAMDX; + +typedef union VkDeviceOrHostAddressConstAMDX { + VkDeviceAddress deviceAddress; + const void* hostAddress; +} VkDeviceOrHostAddressConstAMDX; + +typedef struct VkDispatchGraphInfoAMDX { + uint32_t nodeIndex; + uint32_t payloadCount; + VkDeviceOrHostAddressConstAMDX payloads; + uint64_t payloadStride; +} VkDispatchGraphInfoAMDX; + +typedef struct VkDispatchGraphCountInfoAMDX { + uint32_t count; + VkDeviceOrHostAddressConstAMDX infos; + uint64_t stride; +} VkDispatchGraphCountInfoAMDX; + +typedef struct VkPipelineShaderStageNodeCreateInfoAMDX { + VkStructureType sType; + const void* pNext; + const char* pName; + uint32_t index; +} VkPipelineShaderStageNodeCreateInfoAMDX; + +typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); +typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); +typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex); +typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, const VkDispatchGraphCountInfoAMDX* pCountInfo); +typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceAddress countInfo); #ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( +VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX( + VkDevice device, + VkPipelineCache pipelineCache, + uint32_t createInfoCount, + const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkPipeline* pPipelines); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineScratchSizeAMDX( + VkDevice device, + VkPipeline executionGraph, + VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX( + VkDevice device, + VkPipeline executionGraph, + const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, + uint32_t* pNodeIndex); + +VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX( VkCommandBuffer commandBuffer, - const VkVideoEncodeInfoKHR* pEncodeInfo); + VkDeviceAddress scratch); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX( + VkCommandBuffer commandBuffer, + VkDeviceAddress scratch, + const VkDispatchGraphCountInfoAMDX* pCountInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX( + VkCommandBuffer commandBuffer, + VkDeviceAddress scratch, + const VkDispatchGraphCountInfoAMDX* pCountInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX( + VkCommandBuffer commandBuffer, + VkDeviceAddress scratch, + VkDeviceAddress countInfo); #endif -#define VK_EXT_video_encode_h264 1 -#include "vk_video/vulkan_video_codec_h264std.h" -#include "vk_video/vulkan_video_codec_h264std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 8 -#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264" - -typedef enum VkVideoEncodeH264RateControlStructureEXT { - VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2, - VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264RateControlStructureEXT; - -typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT { - VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00000200, - VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT = 0x00000400, - VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT = 0x00000800, - VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00001000, - VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00002000, - VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00004000, - VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00008000, - VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00010000, - VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00020000, - VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00040000, - VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT = 0x00080000, - VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00100000, - VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT = 0x00200000, - VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00400000, - VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00800000, - VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x01000000, - VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264CapabilityFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT; - -typedef enum VkVideoEncodeH264InputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264InputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264InputModeFlagsEXT; - -typedef enum VkVideoEncodeH264OutputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH264OutputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH264OutputModeFlagsEXT; -typedef struct VkVideoEncodeH264CapabilitiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH264CapabilityFlagsEXT flags; - VkVideoEncodeH264InputModeFlagsEXT inputModeFlags; - VkVideoEncodeH264OutputModeFlagsEXT outputModeFlags; - uint8_t maxPPictureL0ReferenceCount; - uint8_t maxBPictureL0ReferenceCount; - uint8_t maxL1ReferenceCount; - VkBool32 motionVectorsOverPicBoundariesFlag; - uint32_t maxBytesPerPicDenom; - uint32_t maxBitsPerMbDenom; - uint32_t log2MaxMvLengthHorizontal; - uint32_t log2MaxMvLengthVertical; -} VkVideoEncodeH264CapabilitiesEXT; - -typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t spsStdCount; - const StdVideoH264SequenceParameterSet* pSpsStd; - uint32_t ppsStdCount; - const StdVideoH264PictureParameterSet* pPpsStd; -} VkVideoEncodeH264SessionParametersAddInfoEXT; - -typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxSpsStdCount; - uint32_t maxPpsStdCount; - const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoEncodeH264SessionParametersCreateInfoEXT; - -typedef struct VkVideoEncodeH264DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - int8_t slotIndex; - const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH264DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH264ReferenceListsInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t referenceList0EntryCount; - const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList0Entries; - uint8_t referenceList1EntryCount; - const VkVideoEncodeH264DpbSlotInfoEXT* pReferenceList1Entries; - const StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations; -} VkVideoEncodeH264ReferenceListsInfoEXT; - -typedef struct VkVideoEncodeH264NaluSliceInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t mbCount; - const VkVideoEncodeH264ReferenceListsInfoEXT* pReferenceFinalLists; - const StdVideoEncodeH264SliceHeader* pSliceHeaderStd; -} VkVideoEncodeH264NaluSliceInfoEXT; - -typedef struct VkVideoEncodeH264VclFrameInfoEXT { - VkStructureType sType; - const void* pNext; - const VkVideoEncodeH264ReferenceListsInfoEXT* pReferenceFinalLists; - uint32_t naluSliceEntryCount; - const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries; - const StdVideoEncodeH264PictureInfo* pCurrentPictureInfo; -} VkVideoEncodeH264VclFrameInfoEXT; - -typedef struct VkVideoEncodeH264EmitPictureParametersInfoEXT { +// VK_NV_displacement_micromap is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_displacement_micromap 1 +#define VK_NV_DISPLACEMENT_MICROMAP_SPEC_VERSION 2 +#define VK_NV_DISPLACEMENT_MICROMAP_EXTENSION_NAME "VK_NV_displacement_micromap" + +typedef enum VkDisplacementMicromapFormatNV { + VK_DISPLACEMENT_MICROMAP_FORMAT_64_TRIANGLES_64_BYTES_NV = 1, + VK_DISPLACEMENT_MICROMAP_FORMAT_256_TRIANGLES_128_BYTES_NV = 2, + VK_DISPLACEMENT_MICROMAP_FORMAT_1024_TRIANGLES_128_BYTES_NV = 3, + VK_DISPLACEMENT_MICROMAP_FORMAT_MAX_ENUM_NV = 0x7FFFFFFF +} VkDisplacementMicromapFormatNV; +typedef struct VkPhysicalDeviceDisplacementMicromapFeaturesNV { VkStructureType sType; - const void* pNext; - uint8_t spsId; - VkBool32 emitSpsEnable; - uint32_t ppsIdEntryCount; - const uint8_t* ppsIdEntries; -} VkVideoEncodeH264EmitPictureParametersInfoEXT; - -typedef struct VkVideoEncodeH264ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH264ProfileIdc stdProfileIdc; -} VkVideoEncodeH264ProfileInfoEXT; - -typedef struct VkVideoEncodeH264RateControlInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - VkVideoEncodeH264RateControlStructureEXT rateControlStructure; - uint8_t temporalLayerCount; -} VkVideoEncodeH264RateControlInfoEXT; - -typedef struct VkVideoEncodeH264QpEXT { - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH264QpEXT; - -typedef struct VkVideoEncodeH264FrameSizeEXT { - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH264FrameSizeEXT; - -typedef struct VkVideoEncodeH264RateControlLayerInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t temporalLayerId; - VkBool32 useInitialRcQp; - VkVideoEncodeH264QpEXT initialRcQp; - VkBool32 useMinQp; - VkVideoEncodeH264QpEXT minQp; - VkBool32 useMaxQp; - VkVideoEncodeH264QpEXT maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH264FrameSizeEXT maxFrameSize; -} VkVideoEncodeH264RateControlLayerInfoEXT; - - - -#define VK_EXT_video_encode_h265 1 -#include "vk_video/vulkan_video_codec_h265std.h" -#include "vk_video/vulkan_video_codec_h265std_encode.h" -#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 8 -#define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265" - -typedef enum VkVideoEncodeH265RateControlStructureEXT { - VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2, - VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265RateControlStructureEXT; - -typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT { - VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT = 0x00000010, - VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020, - VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT = 0x00000040, - VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000080, - VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT = 0x00000100, - VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT = 0x00000200, - VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT = 0x00000400, - VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT = 0x00000800, - VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00001000, - VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT = 0x00002000, - VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00004000, - VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT = 0x00008000, - VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT = 0x00010000, - VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT = 0x00020000, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT = 0x00040000, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT = 0x00080000, - VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT = 0x00100000, - VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT = 0x00200000, - VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00400000, - VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0x00800000, - VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x01000000, - VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x02000000, - VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265CapabilityFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT; - -typedef enum VkVideoEncodeH265InputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_INPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265InputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265InputModeFlagsEXT; - -typedef enum VkVideoEncodeH265OutputModeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265OutputModeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265OutputModeFlagsEXT; - -typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265CtbSizeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT; - -typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT { - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008, - VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT; -typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT; -typedef struct VkVideoEncodeH265CapabilitiesEXT { - VkStructureType sType; - void* pNext; - VkVideoEncodeH265CapabilityFlagsEXT flags; - VkVideoEncodeH265InputModeFlagsEXT inputModeFlags; - VkVideoEncodeH265OutputModeFlagsEXT outputModeFlags; - VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes; - VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes; - uint8_t maxPPictureL0ReferenceCount; - uint8_t maxBPictureL0ReferenceCount; - uint8_t maxL1ReferenceCount; - uint8_t maxSubLayersCount; - uint8_t minLog2MinLumaCodingBlockSizeMinus3; - uint8_t maxLog2MinLumaCodingBlockSizeMinus3; - uint8_t minLog2MinLumaTransformBlockSizeMinus2; - uint8_t maxLog2MinLumaTransformBlockSizeMinus2; - uint8_t minMaxTransformHierarchyDepthInter; - uint8_t maxMaxTransformHierarchyDepthInter; - uint8_t minMaxTransformHierarchyDepthIntra; - uint8_t maxMaxTransformHierarchyDepthIntra; - uint8_t maxDiffCuQpDeltaDepth; - uint8_t minMaxNumMergeCand; - uint8_t maxMaxNumMergeCand; -} VkVideoEncodeH265CapabilitiesEXT; - -typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t vpsStdCount; - const StdVideoH265VideoParameterSet* pVpsStd; - uint32_t spsStdCount; - const StdVideoH265SequenceParameterSet* pSpsStd; - uint32_t ppsStdCount; - const StdVideoH265PictureParameterSet* pPpsStd; -} VkVideoEncodeH265SessionParametersAddInfoEXT; - -typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxVpsStdCount; - uint32_t maxSpsStdCount; - uint32_t maxPpsStdCount; - const VkVideoEncodeH265SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoEncodeH265SessionParametersCreateInfoEXT; - -typedef struct VkVideoEncodeH265DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - int8_t slotIndex; - const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; -} VkVideoEncodeH265DpbSlotInfoEXT; - -typedef struct VkVideoEncodeH265ReferenceListsInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t referenceList0EntryCount; - const VkVideoEncodeH265DpbSlotInfoEXT* pReferenceList0Entries; - uint8_t referenceList1EntryCount; - const VkVideoEncodeH265DpbSlotInfoEXT* pReferenceList1Entries; - const StdVideoEncodeH265ReferenceModifications* pReferenceModifications; -} VkVideoEncodeH265ReferenceListsInfoEXT; - -typedef struct VkVideoEncodeH265NaluSliceSegmentInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t ctbCount; - const VkVideoEncodeH265ReferenceListsInfoEXT* pReferenceFinalLists; - const StdVideoEncodeH265SliceSegmentHeader* pSliceSegmentHeaderStd; -} VkVideoEncodeH265NaluSliceSegmentInfoEXT; - -typedef struct VkVideoEncodeH265VclFrameInfoEXT { - VkStructureType sType; - const void* pNext; - const VkVideoEncodeH265ReferenceListsInfoEXT* pReferenceFinalLists; - uint32_t naluSliceSegmentEntryCount; - const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries; - const StdVideoEncodeH265PictureInfo* pCurrentPictureInfo; -} VkVideoEncodeH265VclFrameInfoEXT; - -typedef struct VkVideoEncodeH265EmitPictureParametersInfoEXT { + void* pNext; + VkBool32 displacementMicromap; +} VkPhysicalDeviceDisplacementMicromapFeaturesNV; + +typedef struct VkPhysicalDeviceDisplacementMicromapPropertiesNV { VkStructureType sType; - const void* pNext; - uint8_t vpsId; - uint8_t spsId; - VkBool32 emitVpsEnable; - VkBool32 emitSpsEnable; - uint32_t ppsIdEntryCount; - const uint8_t* ppsIdEntries; -} VkVideoEncodeH265EmitPictureParametersInfoEXT; - -typedef struct VkVideoEncodeH265ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoEncodeH265ProfileInfoEXT; - -typedef struct VkVideoEncodeH265RateControlInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t gopFrameCount; - uint32_t idrPeriod; - uint32_t consecutiveBFrameCount; - VkVideoEncodeH265RateControlStructureEXT rateControlStructure; - uint8_t subLayerCount; -} VkVideoEncodeH265RateControlInfoEXT; - -typedef struct VkVideoEncodeH265QpEXT { - int32_t qpI; - int32_t qpP; - int32_t qpB; -} VkVideoEncodeH265QpEXT; - -typedef struct VkVideoEncodeH265FrameSizeEXT { - uint32_t frameISize; - uint32_t framePSize; - uint32_t frameBSize; -} VkVideoEncodeH265FrameSizeEXT; - -typedef struct VkVideoEncodeH265RateControlLayerInfoEXT { - VkStructureType sType; - const void* pNext; - uint8_t temporalId; - VkBool32 useInitialRcQp; - VkVideoEncodeH265QpEXT initialRcQp; - VkBool32 useMinQp; - VkVideoEncodeH265QpEXT minQp; - VkBool32 useMaxQp; - VkVideoEncodeH265QpEXT maxQp; - VkBool32 useMaxFrameSize; - VkVideoEncodeH265FrameSizeEXT maxFrameSize; -} VkVideoEncodeH265RateControlLayerInfoEXT; - - - -#define VK_EXT_video_decode_h264 1 -#include "vk_video/vulkan_video_codec_h264std_decode.h" -#define VK_EXT_VIDEO_DECODE_H264_SPEC_VERSION 6 -#define VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME "VK_EXT_video_decode_h264" - -typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT { - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT = 0, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT = 0x00000001, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT = 0x00000002, - VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkVideoDecodeH264PictureLayoutFlagBitsEXT; -typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT; -typedef struct VkVideoDecodeH264ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH264ProfileIdc stdProfileIdc; - VkVideoDecodeH264PictureLayoutFlagsEXT pictureLayout; -} VkVideoDecodeH264ProfileInfoEXT; - -typedef struct VkVideoDecodeH264CapabilitiesEXT { - VkStructureType sType; - void* pNext; - StdVideoH264Level maxLevel; - VkOffset2D fieldOffsetGranularity; -} VkVideoDecodeH264CapabilitiesEXT; - -typedef struct VkVideoDecodeH264SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t spsStdCount; - const StdVideoH264SequenceParameterSet* pSpsStd; - uint32_t ppsStdCount; - const StdVideoH264PictureParameterSet* pPpsStd; -} VkVideoDecodeH264SessionParametersAddInfoEXT; - -typedef struct VkVideoDecodeH264SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxSpsStdCount; - uint32_t maxPpsStdCount; - const VkVideoDecodeH264SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoDecodeH264SessionParametersCreateInfoEXT; - -typedef struct VkVideoDecodeH264PictureInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH264PictureInfo* pStdPictureInfo; - uint32_t slicesCount; - const uint32_t* pSlicesDataOffsets; -} VkVideoDecodeH264PictureInfoEXT; - -typedef struct VkVideoDecodeH264MvcInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH264Mvc* pStdMvc; -} VkVideoDecodeH264MvcInfoEXT; - -typedef struct VkVideoDecodeH264DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo; -} VkVideoDecodeH264DpbSlotInfoEXT; - - - -#define VK_EXT_video_decode_h265 1 -#include "vk_video/vulkan_video_codec_h265std_decode.h" -#define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 4 -#define VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME "VK_EXT_video_decode_h265" -typedef struct VkVideoDecodeH265ProfileInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoH265ProfileIdc stdProfileIdc; -} VkVideoDecodeH265ProfileInfoEXT; - -typedef struct VkVideoDecodeH265CapabilitiesEXT { - VkStructureType sType; - void* pNext; - StdVideoH265Level maxLevel; -} VkVideoDecodeH265CapabilitiesEXT; - -typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t vpsStdCount; - const StdVideoH265VideoParameterSet* pVpsStd; - uint32_t spsStdCount; - const StdVideoH265SequenceParameterSet* pSpsStd; - uint32_t ppsStdCount; - const StdVideoH265PictureParameterSet* pPpsStd; -} VkVideoDecodeH265SessionParametersAddInfoEXT; - -typedef struct VkVideoDecodeH265SessionParametersCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t maxVpsStdCount; - uint32_t maxSpsStdCount; - uint32_t maxPpsStdCount; - const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo; -} VkVideoDecodeH265SessionParametersCreateInfoEXT; - -typedef struct VkVideoDecodeH265PictureInfoEXT { - VkStructureType sType; - const void* pNext; - StdVideoDecodeH265PictureInfo* pStdPictureInfo; - uint32_t slicesCount; - const uint32_t* pSlicesDataOffsets; -} VkVideoDecodeH265PictureInfoEXT; - -typedef struct VkVideoDecodeH265DpbSlotInfoEXT { - VkStructureType sType; - const void* pNext; - const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo; -} VkVideoDecodeH265DpbSlotInfoEXT; + void* pNext; + uint32_t maxDisplacementMicromapSubdivisionLevel; +} VkPhysicalDeviceDisplacementMicromapPropertiesNV; + +typedef struct VkAccelerationStructureTrianglesDisplacementMicromapNV { + VkStructureType sType; + void* pNext; + VkFormat displacementBiasAndScaleFormat; + VkFormat displacementVectorFormat; + VkDeviceOrHostAddressConstKHR displacementBiasAndScaleBuffer; + VkDeviceSize displacementBiasAndScaleStride; + VkDeviceOrHostAddressConstKHR displacementVectorBuffer; + VkDeviceSize displacementVectorStride; + VkDeviceOrHostAddressConstKHR displacedMicromapPrimitiveFlags; + VkDeviceSize displacedMicromapPrimitiveFlagsStride; + VkIndexType indexType; + VkDeviceOrHostAddressConstKHR indexBuffer; + VkDeviceSize indexStride; + uint32_t baseTriangle; + uint32_t usageCountsCount; + const VkMicromapUsageEXT* pUsageCounts; + const VkMicromapUsageEXT* const* ppUsageCounts; + VkMicromapEXT micromap; +} VkAccelerationStructureTrianglesDisplacementMicromapNV; #ifdef __cplusplus diff --git a/src/video/khronos/vulkan/vulkan_core.h b/src/video/khronos/vulkan/vulkan_core.h index 00f32b3353191..5354f61dc9433 100644 --- a/src/video/khronos/vulkan/vulkan_core.h +++ b/src/video/khronos/vulkan/vulkan_core.h @@ -2,7 +2,7 @@ #define VULKAN_CORE_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_VERSION_1_0 is a preprocessor guard. Do not pass it to API calls. #define VK_VERSION_1_0 1 #include "vk_platform.h" @@ -26,7 +27,7 @@ extern "C" { #ifndef VK_USE_64_BIT_PTR_DEFINES - #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) + #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64) #define VK_USE_64_BIT_PTR_DEFINES 1 #else #define VK_USE_64_BIT_PTR_DEFINES 0 @@ -58,37 +59,37 @@ extern "C" { #endif #endif -// DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. -#define VK_MAKE_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) +#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ + ((((uint32_t)(variant)) << 29U) | (((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) // DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. -//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 - -#define VK_MAKE_API_VERSION(variant, major, minor, patch) \ - ((((uint32_t)(variant)) << 29) | (((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) +//#define VK_API_VERSION VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0 // Vulkan 1.0 version number #define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)// Patch version should always be set to 0 // Version of this file -#define VK_HEADER_VERSION 227 +#define VK_HEADER_VERSION 275 // Complete version of this file #define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION) +// DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. +#define VK_MAKE_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(patch))) + // DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) +#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22U) // DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU) +#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) // DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) -#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29) -#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22) & 0x7FU) -#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU) +#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29U) +#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22U) & 0x7FU) +#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12U) & 0x3FFU) #define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) typedef uint32_t VkBool32; typedef uint64_t VkDeviceAddress; @@ -168,24 +169,12 @@ typedef enum VkResult { VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, VK_ERROR_INVALID_SHADER_NV = -1000012000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR = -1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR = -1000023001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR = -1000023002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR = -1000023003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR = -1000023004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR = -1000023005, -#endif VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000, VK_ERROR_NOT_PERMITTED_KHR = -1000174001, VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT = -1000255000, @@ -193,7 +182,9 @@ typedef enum VkResult { VK_THREAD_DONE_KHR = 1000268001, VK_OPERATION_DEFERRED_KHR = 1000268002, VK_OPERATION_NOT_DEFERRED_KHR = 1000268003, + VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR = -1000299000, VK_ERROR_COMPRESSION_EXHAUSTED_EXT = -1000338000, + VK_ERROR_INCOMPATIBLE_SHADER_BINARY_EXT = 1000482000, VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY, VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = VK_ERROR_INVALID_EXTERNAL_HANDLE, VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION, @@ -443,66 +434,26 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000, VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001, VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR = 1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR = 1000023001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR = 1000023002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR = 1000023003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR = 1000023004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR = 1000023005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000023006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR = 1000023007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR = 1000023008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR = 1000023009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR = 1000023010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR = 1000023011, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR = 1000023012, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR = 1000023013, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR = 1000023014, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR = 1000023015, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR = 1000023016, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR = 1000024000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR = 1000024001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR = 1000024002, -#endif VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, @@ -514,93 +465,40 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX = 1000029002, VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX = 1000030000, VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX = 1000030001, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT = 1000038000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000038001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000038002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT = 1000038003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT = 1000038004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT = 1000038005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT = 1000038006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT = 1000038007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT = 1000038008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT = 1000038009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT = 1000038010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT = 1000039000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000039001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT = 1000039002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT = 1000039003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT = 1000039004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT = 1000039005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT = 1000039006, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT = 1000039007, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT = 1000039008, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT = 1000039009, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT = 1000039010, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT = 1000040000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT = 1000040001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_INFO_EXT = 1000040002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_EXT = 1000040003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000040004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000040005, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT = 1000040006, -#endif + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR = 1000038000, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000038001, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000038002, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PICTURE_INFO_KHR = 1000038003, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_KHR = 1000038004, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_KHR = 1000038005, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_GOP_REMAINING_FRAME_INFO_KHR = 1000038006, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR = 1000038007, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR = 1000038008, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_KHR = 1000038009, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_KHR = 1000038010, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_QUALITY_LEVEL_PROPERTIES_KHR = 1000038011, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_GET_INFO_KHR = 1000038012, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000038013, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR = 1000039000, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000039001, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000039002, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PICTURE_INFO_KHR = 1000039003, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_KHR = 1000039004, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_KHR = 1000039005, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_GOP_REMAINING_FRAME_INFO_KHR = 1000039006, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR = 1000039007, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR = 1000039009, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_KHR = 1000039010, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_CREATE_INFO_KHR = 1000039011, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_QUALITY_LEVEL_PROPERTIES_KHR = 1000039012, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_GET_INFO_KHR = 1000039013, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000039014, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR = 1000040000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_KHR = 1000040001, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR = 1000040003, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000040004, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_KHR = 1000040005, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_KHR = 1000040006, VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000044006, VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT = 1000044007, @@ -655,6 +553,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT = 1000102000, VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT = 1000102001, VK_STRUCTURE_TYPE_HDR_METADATA_EXT = 1000105000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG = 1000110000, VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR = 1000111000, VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114000, VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR = 1000114001, @@ -690,6 +589,21 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129004, VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = 1000129005, VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID = 1000129006, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_FEATURES_AMDX = 1000134000, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ENQUEUE_PROPERTIES_AMDX = 1000134001, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_SCRATCH_SIZE_AMDX = 1000134002, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_EXECUTION_GRAPH_PIPELINE_CREATE_INFO_AMDX = 1000134003, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_NODE_CREATE_INFO_AMDX = 1000134004, +#endif VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000, VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001, VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002, @@ -761,33 +675,18 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR = 1000181000, VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD = 1000183000, - VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT = 1000187000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000187001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT = 1000187002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_EXT = 1000187003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT = 1000187004, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT = 1000187005, -#endif + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR = 1000187000, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR = 1000187001, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_KHR = 1000187002, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR = 1000187003, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_KHR = 1000187004, + VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_KHR = 1000187005, VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR = 1000174000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR = 1000388000, VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR = 1000388001, VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002, VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP = 1000191000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000, @@ -856,7 +755,28 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR = 1000269003, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR = 1000269004, VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR = 1000269005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT = 1000270000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_PROPERTIES_EXT = 1000270001, + VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT = 1000270002, + VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT = 1000270003, + VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT = 1000270004, + VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT = 1000270005, + VK_STRUCTURE_TYPE_HOST_IMAGE_LAYOUT_TRANSITION_INFO_EXT = 1000270006, + VK_STRUCTURE_TYPE_COPY_IMAGE_TO_IMAGE_INFO_EXT = 1000270007, + VK_STRUCTURE_TYPE_SUBRESOURCE_HOST_MEMCPY_SIZE_EXT = 1000270008, + VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY_EXT = 1000270009, + VK_STRUCTURE_TYPE_MEMORY_MAP_INFO_KHR = 1000271000, + VK_STRUCTURE_TYPE_MEMORY_UNMAP_INFO_KHR = 1000271001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT = 1000273000, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT = 1000274000, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_SCALING_CAPABILITIES_EXT = 1000274001, + VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_COMPATIBILITY_EXT = 1000274002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT = 1000275000, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_FENCE_INFO_EXT = 1000275001, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT = 1000275002, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT = 1000275003, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_SCALING_CREATE_INFO_EXT = 1000275004, + VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT = 1000275005, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV = 1000277000, VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV = 1000277001, VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV = 1000277002, @@ -870,6 +790,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT = 1000281000, VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = 1000282000, VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = 1000282001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_BIAS_CONTROL_FEATURES_EXT = 1000283000, + VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT = 1000283001, + VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT = 1000283002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT = 1000284000, VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT = 1000284001, VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT = 1000284002, @@ -879,25 +802,30 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT = 1000287001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT = 1000287002, VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR = 1000290000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV = 1000292000, + VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV = 1000292001, + VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV = 1000292002, VK_STRUCTURE_TYPE_PRESENT_ID_KHR = 1000294000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = 1000294001, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR = 1000299000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR = 1000299001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR = 1000299002, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR = 1000299003, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR = 1000299004, -#endif + VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR = 1000299005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299006, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_PROPERTIES_KHR = 1000299007, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_QUALITY_LEVEL_INFO_KHR = 1000299008, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_GET_INFO_KHR = 1000299009, + VK_STRUCTURE_TYPE_VIDEO_ENCODE_SESSION_PARAMETERS_FEEDBACK_INFO_KHR = 1000299010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000, VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001, + VK_STRUCTURE_TYPE_CUDA_MODULE_CREATE_INFO_NV = 1000307000, + VK_STRUCTURE_TYPE_CUDA_FUNCTION_CREATE_INFO_NV = 1000307001, + VK_STRUCTURE_TYPE_CUDA_LAUNCH_INFO_NV = 1000307002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_FEATURES_NV = 1000307003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUDA_KERNEL_LAUNCH_PROPERTIES_NV = 1000307004, + VK_STRUCTURE_TYPE_QUERY_LOW_LATENCY_SUPPORT_NV = 1000310000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT = 1000311000, VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT = 1000311001, VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT = 1000311002, @@ -912,6 +840,19 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT = 1000311011, VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008, VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT = 1000316000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT = 1000316001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT = 1000316002, + VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT = 1000316003, + VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT = 1000316004, + VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316005, + VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316006, + VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316007, + VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316008, + VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT = 1000316010, + VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT = 1000316011, + VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT = 1000316012, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316009, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT = 1000320000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT = 1000320001, VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT = 1000320002, @@ -934,19 +875,20 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR = 1000336000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT = 1000338000, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT = 1000338001, - VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT = 1000338002, - VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT = 1000338003, VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT = 1000338004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT = 1000339000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT = 1000341000, + VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT = 1000341001, + VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT = 1000341002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT = 1000344000, VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT = 1000346000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = 1000351000, - VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = 1000351002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000, VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001, VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT = 1000352002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT = 1000353000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT = 1000354000, + VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT = 1000354001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000, VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = 1000356000, @@ -973,6 +915,8 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV = 1000371001, VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAME_BOUNDARY_FEATURES_EXT = 1000375000, + VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT = 1000375001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000, VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001, VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002, @@ -987,36 +931,167 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT = 1000392000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT = 1000392001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT = 1000393000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_FEATURES_EXT = 1000395000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TILE_IMAGE_PROPERTIES_EXT = 1000395001, + VK_STRUCTURE_TYPE_MICROMAP_BUILD_INFO_EXT = 1000396000, + VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT = 1000396001, + VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT = 1000396002, + VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT = 1000396003, + VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT = 1000396004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT = 1000396005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT = 1000396006, + VK_STRUCTURE_TYPE_MICROMAP_CREATE_INFO_EXT = 1000396007, + VK_STRUCTURE_TYPE_MICROMAP_BUILD_SIZES_INFO_EXT = 1000396008, + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_OPACITY_MICROMAP_EXT = 1000396009, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_FEATURES_NV = 1000397000, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISPLACEMENT_MICROMAP_PROPERTIES_NV = 1000397001, +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_TRIANGLES_DISPLACEMENT_MICROMAP_NV = 1000397002, +#endif + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_FEATURES_HUAWEI = 1000404000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_PROPERTIES_HUAWEI = 1000404001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CLUSTER_CULLING_SHADER_VRS_FEATURES_HUAWEI = 1000404002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT = 1000411000, VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT = 1000411001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT = 1000412000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_ARM = 1000415000, + VK_STRUCTURE_TYPE_DEVICE_QUEUE_SHADER_CORE_CONTROL_CREATE_INFO_ARM = 1000417000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_FEATURES_ARM = 1000417001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_PROPERTIES_ARM = 1000417002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_SLICED_VIEW_OF_3D_FEATURES_EXT = 1000418000, + VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT = 1000418001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE = 1000420000, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE = 1000420001, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE = 1000420002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_FEATURES_ARM = 1000424000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RENDER_PASS_STRIPED_PROPERTIES_ARM = 1000424001, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_BEGIN_INFO_ARM = 1000424002, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_INFO_ARM = 1000424003, + VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM = 1000424004, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001, VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV = 1000426000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV = 1000426001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV = 1000427000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV = 1000427001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_COMPUTE_FEATURES_NV = 1000428000, + VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_INDIRECT_BUFFER_INFO_NV = 1000428001, + VK_STRUCTURE_TYPE_PIPELINE_INDIRECT_DEVICE_ADDRESS_INFO_NV = 1000428002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = 1000430000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT = 1000437000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001, VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_FEATURES_EXT = 1000451000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NESTED_COMMAND_BUFFER_PROPERTIES_EXT = 1000451001, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXT = 1000453000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT = 1000458000, VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT = 1000458001, VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT = 1000458002, VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT = 1000458003, + VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_INFO_LUNARG = 1000459000, + VK_STRUCTURE_TYPE_DIRECT_DRIVER_LOADING_LIST_LUNARG = 1000459001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT = 1000462000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT = 1000462001, VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT = 1000462002, VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT = 1000462003, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT = 1000342000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV = 1000464000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV = 1000464001, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV = 1000464002, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV = 1000464003, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV = 1000464004, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV = 1000464005, + VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_PRIVATE_DATA_INFO_NV = 1000464010, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT = 1000465000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROTECTED_ACCESS_FEATURES_EXT = 1000466000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID = 1000468000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468001, + VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_RESOLVE_PROPERTIES_ANDROID = 1000468002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR = 1000470000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES_KHR = 1000470001, + VK_STRUCTURE_TYPE_RENDERING_AREA_INFO_KHR = 1000470003, + VK_STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO_KHR = 1000470004, + VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR = 1000338002, + VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR = 1000338003, + VK_STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO_KHR = 1000470005, + VK_STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO_KHR = 1000470006, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_POSITION_FETCH_FEATURES_KHR = 1000481000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT = 1000482000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_PROPERTIES_EXT = 1000482001, + VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT = 1000482002, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM = 1000484000, VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM = 1000484001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC = 1000485000, VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC = 1000485001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_VIEWPORTS_FEATURES_QCOM = 1000488000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_NV = 1000490000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_NV = 1000490001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_FEATURES_NV = 1000492000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_SPARSE_ADDRESS_SPACE_PROPERTIES_NV = 1000492001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT = 1000351000, + VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT = 1000351002, + VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT = 1000496000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_FEATURES_ARM = 1000497000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_BUILTINS_PROPERTIES_ARM = 1000497001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_LIBRARY_GROUP_HANDLES_FEATURES_EXT = 1000498000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_FEATURES_EXT = 1000499000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_MODE_INFO_NV = 1000505000, + VK_STRUCTURE_TYPE_LATENCY_SLEEP_INFO_NV = 1000505001, + VK_STRUCTURE_TYPE_SET_LATENCY_MARKER_INFO_NV = 1000505002, + VK_STRUCTURE_TYPE_GET_LATENCY_MARKER_INFO_NV = 1000505003, + VK_STRUCTURE_TYPE_LATENCY_TIMINGS_FRAME_REPORT_NV = 1000505004, + VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV = 1000505005, + VK_STRUCTURE_TYPE_OUT_OF_BAND_QUEUE_TYPE_INFO_NV = 1000505006, + VK_STRUCTURE_TYPE_SWAPCHAIN_LATENCY_CREATE_INFO_NV = 1000505007, + VK_STRUCTURE_TYPE_LATENCY_SURFACE_CAPABILITIES_NV = 1000505008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_KHR = 1000506000, + VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_KHR = 1000506002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_RENDER_AREAS_FEATURES_QCOM = 1000510000, + VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_RENDER_AREAS_RENDER_PASS_BEGIN_INFO_QCOM = 1000510001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR = 1000515000, + VK_STRUCTURE_TYPE_VIDEO_INLINE_QUERY_INFO_KHR = 1000515001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PER_STAGE_DESCRIPTOR_SET_FEATURES_NV = 1000516000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM = 1000518000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM = 1000518001, + VK_STRUCTURE_TYPE_SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM = 1000518002, + VK_STRUCTURE_TYPE_SAMPLER_CUBIC_WEIGHTS_CREATE_INFO_QCOM = 1000519000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_WEIGHTS_FEATURES_QCOM = 1000519001, + VK_STRUCTURE_TYPE_BLIT_IMAGE_CUBIC_WEIGHTS_INFO_QCOM = 1000519002, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_DEGAMMA_FEATURES_QCOM = 1000520000, + VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_YCBCR_DEGAMMA_CREATE_INFO_QCOM = 1000520001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUBIC_CLAMP_FEATURES_QCOM = 1000521000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT = 1000524000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_KHR = 1000525000, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR = 1000190001, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR = 1000190002, + VK_STRUCTURE_TYPE_SCREEN_BUFFER_PROPERTIES_QNX = 1000529000, + VK_STRUCTURE_TYPE_SCREEN_BUFFER_FORMAT_PROPERTIES_QNX = 1000529001, + VK_STRUCTURE_TYPE_IMPORT_SCREEN_BUFFER_INFO_QNX = 1000529002, + VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_QNX = 1000529003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_SCREEN_BUFFER_FEATURES_QNX = 1000529004, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT = 1000530000, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR = 1000184000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_FEATURES_KHR = 1000545000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_6_PROPERTIES_KHR = 1000545001, + VK_STRUCTURE_TYPE_BIND_MEMORY_STATUS_KHR = 1000545002, + VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_SETS_INFO_KHR = 1000545003, + VK_STRUCTURE_TYPE_PUSH_CONSTANTS_INFO_KHR = 1000545004, + VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_INFO_KHR = 1000545005, + VK_STRUCTURE_TYPE_PUSH_DESCRIPTOR_SET_WITH_TEMPLATE_INFO_KHR = 1000545006, + VK_STRUCTURE_TYPE_SET_DESCRIPTOR_BUFFER_OFFSETS_INFO_EXT = 1000545007, + VK_STRUCTURE_TYPE_BIND_DESCRIPTOR_BUFFER_EMBEDDED_SAMPLERS_INFO_EXT = 1000545008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_POOL_OVERALLOCATION_FEATURES_NV = 1000546000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, @@ -1117,6 +1192,9 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, + VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_KHR, + VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_KHR, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_KHR, VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, @@ -1179,7 +1257,11 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, + VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_KHR, + VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT, + VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR, @@ -1188,6 +1270,7 @@ typedef enum VkStructureType { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, + VK_STRUCTURE_TYPE_SHADER_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } VkStructureType; @@ -1215,27 +1298,15 @@ typedef enum VkImageLayout { VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL = 1000314000, VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL = 1000314001, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR = 1000024000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR = 1000024001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR = 1000024002, -#endif VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000, VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT = 1000218000, VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = 1000164003, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR = 1000299000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR = 1000299001, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR = 1000299002, -#endif VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT = 1000339000, VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, @@ -1284,12 +1355,8 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000, VK_OBJECT_TYPE_DISPLAY_MODE_KHR = 1000002001, VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_OBJECT_TYPE_VIDEO_SESSION_KHR = 1000023000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR = 1000023001, -#endif VK_OBJECT_TYPE_CU_MODULE_NVX = 1000029000, VK_OBJECT_TYPE_CU_FUNCTION_NVX = 1000029001, VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000128000, @@ -1299,7 +1366,12 @@ typedef enum VkObjectType { VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL = 1000210000, VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR = 1000268000, VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV = 1000277000, + VK_OBJECT_TYPE_CUDA_MODULE_NV = 1000307000, + VK_OBJECT_TYPE_CUDA_FUNCTION_NV = 1000307001, VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA = 1000366000, + VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000, + VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000, + VK_OBJECT_TYPE_SHADER_EXT = 1000482000, VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, @@ -1313,6 +1385,7 @@ typedef enum VkVendorId { VK_VENDOR_ID_CODEPLAY = 0x10004, VK_VENDOR_ID_MESA = 0x10005, VK_VENDOR_ID_POCL = 0x10006, + VK_VENDOR_ID_MOBILEYE = 0x10007, VK_VENDOR_ID_MAX_ENUM = 0x7FFFFFFF } VkVendorId; @@ -1578,6 +1651,9 @@ typedef enum VkFormat { VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, + VK_FORMAT_R16G16_S10_5_NV = 1000464000, + VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR = 1000470000, + VK_FORMAT_A8_UNORM_KHR = 1000470001, VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK, VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK, VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK, @@ -1662,22 +1738,20 @@ typedef enum VkQueryType { VK_QUERY_TYPE_OCCLUSION = 0, VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, VK_QUERY_TYPE_TIMESTAMP = 2, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR = 1000023000, -#endif VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004, VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR = 1000116000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR = 1000150000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR = 1000150001, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV = 1000165000, VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL = 1000210000, -#ifdef VK_ENABLE_BETA_EXTENSIONS - VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR = 1000299000, -#endif + VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR = 1000299000, VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000, VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR = 1000386000, VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR = 1000386001, + VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT = 1000396000, + VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT = 1000396001, VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF } VkQueryType; @@ -1826,10 +1900,13 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004, VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT = 1000099001, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT = 1000099002, VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000, VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000, VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004, VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006, + VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000, VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001, VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000, VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = 1000259000, @@ -1837,6 +1914,38 @@ typedef enum VkDynamicState { VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000, VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003, VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000, + VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002, + VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003, + VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004, + VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005, + VK_DYNAMIC_STATE_SAMPLE_MASK_EXT = 1000455006, + VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT = 1000455007, + VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT = 1000455008, + VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT = 1000455009, + VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010, + VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011, + VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012, + VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013, + VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014, + VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015, + VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT = 1000455016, + VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT = 1000455017, + VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT = 1000455018, + VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT = 1000455019, + VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT = 1000455020, + VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT = 1000455021, + VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT = 1000455022, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV = 1000455023, + VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV = 1000455024, + VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV = 1000455025, + VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV = 1000455026, + VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV = 1000455027, + VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV = 1000455028, + VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV = 1000455029, + VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV = 1000455030, + VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031, + VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032, + VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000, VK_DYNAMIC_STATE_CULL_MODE_EXT = VK_DYNAMIC_STATE_CULL_MODE, VK_DYNAMIC_STATE_FRONT_FACE_EXT = VK_DYNAMIC_STATE_FRONT_FACE, VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, @@ -1973,10 +2082,11 @@ typedef enum VkDescriptorType { VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK = 1000138000, VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000, VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000, - VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = 1000351000, VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM = 1000440000, VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM = 1000440001, + VK_DESCRIPTOR_TYPE_MUTABLE_EXT = 1000351000, VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, + VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = VK_DESCRIPTOR_TYPE_MUTABLE_EXT, VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF } VkDescriptorType; @@ -2001,6 +2111,9 @@ typedef enum VkAttachmentStoreOp { typedef enum VkPipelineBindPoint { VK_PIPELINE_BIND_POINT_GRAPHICS = 0, VK_PIPELINE_BIND_POINT_COMPUTE = 1, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_PIPELINE_BIND_POINT_EXECUTION_GRAPH_AMDX = 1000134000, +#endif VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR = 1000165000, VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI = 1000369003, VK_PIPELINE_BIND_POINT_RAY_TRACING_NV = VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, @@ -2025,6 +2138,7 @@ typedef enum VkIndexType { typedef enum VkSubpassContents { VK_SUBPASS_CONTENTS_INLINE = 0, VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1, + VK_SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_EXT = 1000451000, VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF } VkSubpassContents; @@ -2111,22 +2225,14 @@ typedef enum VkFormatFeatureFlagBits { VK_FORMAT_FEATURE_DISJOINT_BIT = 0x00400000, VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 0x00800000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000, -#endif VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000, VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000, VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000, -#endif VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, @@ -2158,9 +2264,11 @@ typedef enum VkImageCreateFlagBits { VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000, VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000, VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x00004000, + VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00010000, VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0x00040000, VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0x00020000, VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM = 0x00008000, + VK_IMAGE_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00100000, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, @@ -2192,26 +2300,15 @@ typedef enum VkImageUsageFlagBits { VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00000400, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00000800, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR = 0x00001000, -#endif VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x00000200, VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00000100, -#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT = 0x00400000, VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00002000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00004000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR = 0x00008000, -#endif VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x00080000, VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI = 0x00040000, VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0x00100000, @@ -2255,12 +2352,9 @@ typedef enum VkQueueFlagBits { VK_QUEUE_TRANSFER_BIT = 0x00000004, VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, VK_QUEUE_PROTECTED_BIT = 0x00000010, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUEUE_VIDEO_DECODE_BIT_KHR = 0x00000020, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUEUE_VIDEO_ENCODE_BIT_KHR = 0x00000040, -#endif + VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0x00000100, VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueueFlagBits; typedef VkFlags VkQueueFlags; @@ -2353,6 +2447,7 @@ typedef enum VkQueryPipelineStatisticFlagBits { VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT = 0x00000800, VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0x00001000, + VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0x00002000, VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueryPipelineStatisticFlagBits; typedef VkFlags VkQueryPipelineStatisticFlags; @@ -2363,9 +2458,7 @@ typedef enum VkQueryResultFlagBits { VK_QUERY_RESULT_WAIT_BIT = 0x00000002, VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_QUERY_RESULT_WITH_STATUS_BIT_KHR = 0x00000010, -#endif VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkQueryResultFlagBits; typedef VkFlags VkQueryResultFlags; @@ -2376,6 +2469,8 @@ typedef enum VkBufferCreateFlagBits { VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000010, + VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000020, + VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR = 0x00000040, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -2393,24 +2488,24 @@ typedef enum VkBufferUsageFlagBits { VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 0x00020000, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR = 0x00004000, -#endif VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800, VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000, VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_BUFFER_USAGE_EXECUTION_GRAPH_SCRATCH_BIT_AMDX = 0x02000000, +#endif VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000, VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000, VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400, -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000, -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000, -#endif + VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000, + VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000, + VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000, + VK_BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000, + VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT = 0x01000000, VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR, VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, @@ -2421,6 +2516,7 @@ typedef VkFlags VkBufferViewCreateFlags; typedef enum VkImageViewCreateFlagBits { VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001, + VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000004, VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0x00000002, VK_IMAGE_VIEW_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkImageViewCreateFlagBits; @@ -2465,11 +2561,18 @@ typedef enum VkPipelineCreateFlagBits { VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080, VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00040000, VK_PIPELINE_CREATE_LIBRARY_BIT_KHR = 0x00000800, + VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000, VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000, VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400, VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000, VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000, VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000, + VK_PIPELINE_CREATE_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_PIPELINE_CREATE_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000, +#endif + VK_PIPELINE_CREATE_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000, + VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000, VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, @@ -2508,6 +2611,7 @@ typedef enum VkShaderStageFlagBits { VK_SHADER_STAGE_TASK_BIT_EXT = 0x00000040, VK_SHADER_STAGE_MESH_BIT_EXT = 0x00000080, VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI = 0x00004000, + VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0x00080000, VK_SHADER_STAGE_RAYGEN_BIT_NV = VK_SHADER_STAGE_RAYGEN_BIT_KHR, VK_SHADER_STAGE_ANY_HIT_BIT_NV = VK_SHADER_STAGE_ANY_HIT_BIT_KHR, VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR, @@ -2561,6 +2665,7 @@ typedef VkFlags VkShaderStageFlags; typedef enum VkSamplerCreateFlagBits { VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0x00000001, VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT = 0x00000002, + VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT = 0x00000004, VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0x00000010, VK_SAMPLER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF @@ -2570,8 +2675,11 @@ typedef VkFlags VkSamplerCreateFlags; typedef enum VkDescriptorPoolCreateFlagBits { VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0x00000002, - VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = 0x00000004, + VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV = 0x00000008, + VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV = 0x00000010, VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, + VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT, VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDescriptorPoolCreateFlagBits; typedef VkFlags VkDescriptorPoolCreateFlags; @@ -2580,8 +2688,13 @@ typedef VkFlags VkDescriptorPoolResetFlags; typedef enum VkDescriptorSetLayoutCreateFlagBits { VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT = 0x00000002, VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, - VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = 0x00000004, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00000010, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0x00000020, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00000080, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT = 0x00000004, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV = 0x00000040, VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, + VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT, VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF } VkDescriptorSetLayoutCreateFlagBits; typedef VkFlags VkDescriptorSetLayoutCreateFlags; @@ -4735,6 +4848,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands( #endif +// VK_VERSION_1_1 is a preprocessor guard. Do not pass it to API calls. #define VK_VERSION_1_1 1 // Vulkan 1.1 version number #define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0)// Patch version should always be set to 0 @@ -4852,6 +4966,7 @@ typedef enum VkExternalMemoryHandleTypeFlagBits { VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT = 0x00000100, VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0x00000800, VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0x00001000, + VK_EXTERNAL_MEMORY_HANDLE_TYPE_SCREEN_BUFFER_BIT_QNX = 0x00004000, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, @@ -5600,6 +5715,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport( #endif +// VK_VERSION_1_2 is a preprocessor guard. Do not pass it to API calls. #define VK_VERSION_1_2 1 // Vulkan 1.2 version number #define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0)// Patch version should always be set to 0 @@ -5631,6 +5747,9 @@ typedef enum VkDriverId { VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21, VK_DRIVER_ID_MESA_VENUS = 22, VK_DRIVER_ID_MESA_DOZEN = 23, + VK_DRIVER_ID_MESA_NVK = 24, + VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25, + VK_DRIVER_ID_MESA_AGXV = 26, VK_DRIVER_ID_AMD_PROPRIETARY_KHR = VK_DRIVER_ID_AMD_PROPRIETARY, VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR = VK_DRIVER_ID_AMD_OPEN_SOURCE, VK_DRIVER_ID_MESA_RADV_KHR = VK_DRIVER_ID_MESA_RADV, @@ -5660,6 +5779,7 @@ typedef enum VkSamplerReductionMode { VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = 0, VK_SAMPLER_REDUCTION_MODE_MIN = 1, VK_SAMPLER_REDUCTION_MODE_MAX = 2, + VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_RANGECLAMP_QCOM = 1000521000, VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, VK_SAMPLER_REDUCTION_MODE_MIN_EXT = VK_SAMPLER_REDUCTION_MODE_MIN, VK_SAMPLER_REDUCTION_MODE_MAX_EXT = VK_SAMPLER_REDUCTION_MODE_MAX, @@ -5680,6 +5800,7 @@ typedef enum VkResolveModeFlagBits { VK_RESOLVE_MODE_AVERAGE_BIT = 0x00000002, VK_RESOLVE_MODE_MIN_BIT = 0x00000004, VK_RESOLVE_MODE_MAX_BIT = 0x00000008, + VK_RESOLVE_MODE_EXTERNAL_FORMAT_DOWNSAMPLE_ANDROID = 0x00000010, VK_RESOLVE_MODE_NONE_KHR = VK_RESOLVE_MODE_NONE, VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, VK_RESOLVE_MODE_AVERAGE_BIT_KHR = VK_RESOLVE_MODE_AVERAGE_BIT, @@ -6352,6 +6473,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddress( #endif +// VK_VERSION_1_3 is a preprocessor guard. Do not pass it to API calls. #define VK_VERSION_1_3 1 // Vulkan 1.3 version number #define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)// Patch version should always be set to 0 @@ -6443,12 +6565,8 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 0x2000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 0x4000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR = 0x04000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR = 0x08000000ULL; -#endif static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ULL; @@ -6463,9 +6581,13 @@ static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV = 0 static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0x00100000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT = 0x00080000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT = 0x00100000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADER_BIT_HUAWEI = 0x8000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ULL; static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR = 0x10000000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MICROMAP_BUILD_BIT_EXT = 0x40000000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0x20000000000ULL; +static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_OPTICAL_FLOW_BIT_NV = 0x20000000ULL; typedef VkFlags64 VkAccessFlags2; @@ -6513,18 +6635,10 @@ static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 0x200000000 static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 0x200000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 0x400000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR = 0x800000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR = 0x1000000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR = 0x2000000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR = 0x4000000000ULL; -#endif static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ULL; @@ -6539,8 +6653,13 @@ static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV = static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT = 0x20000000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI = 0x8000000000ULL; static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR = 0x10000000000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_READ_BIT_EXT = 0x100000000000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0x200000000000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV = 0x40000000000ULL; +static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV = 0x80000000000ULL; typedef enum VkSubmitFlagBits { @@ -6554,6 +6673,7 @@ typedef enum VkRenderingFlagBits { VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0x00000001, VK_RENDERING_SUSPENDING_BIT = 0x00000002, VK_RENDERING_RESUMING_BIT = 0x00000004, + VK_RENDERING_CONTENTS_INLINE_BIT_EXT = 0x00000010, VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008, VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT, @@ -6619,26 +6739,22 @@ static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_ static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 0x100000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 0x200000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 0x200000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR = 0x04000000ULL; -#endif static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0x20000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT = 0x01000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000ULL; -#ifdef VK_ENABLE_BETA_EXTENSIONS +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT = 0x400000000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000ULL; -#endif -#ifdef VK_ENABLE_BETA_EXTENSIONS static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000ULL; -#endif static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM = 0x400000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM = 0x800000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM = 0x1000000000ULL; static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM = 0x2000000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV = 0x10000000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV = 0x20000000000ULL; +static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV = 0x40000000000ULL; typedef struct VkPhysicalDeviceVulkan13Features { VkStructureType sType; @@ -7392,6 +7508,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirements( #endif +// VK_KHR_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_surface 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) #define VK_KHR_SURFACE_SPEC_VERSION 25 @@ -7506,6 +7623,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR( #endif +// VK_KHR_swapchain is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_swapchain 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) #define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 @@ -7515,6 +7633,7 @@ typedef enum VkSwapchainCreateFlagBitsKHR { VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0x00000001, VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 0x00000002, VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0x00000004, + VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0x00000008, VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkSwapchainCreateFlagBitsKHR; typedef VkFlags VkSwapchainCreateFlagsKHR; @@ -7665,6 +7784,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAcquireNextImage2KHR( #endif +// VK_KHR_display is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_display 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayModeKHR) @@ -7790,6 +7910,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDisplayPlaneSurfaceKHR( #endif +// VK_KHR_display_swapchain is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_display_swapchain 1 #define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 10 #define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" @@ -7813,23 +7934,852 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSharedSwapchainsKHR( #endif +// VK_KHR_sampler_mirror_clamp_to_edge is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_sampler_mirror_clamp_to_edge 1 #define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 3 #define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME "VK_KHR_sampler_mirror_clamp_to_edge" -#define VK_KHR_dynamic_rendering 1 -#define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 -#define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" -typedef VkRenderingFlags VkRenderingFlagsKHR; +// VK_KHR_video_queue is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_queue 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionKHR) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkVideoSessionParametersKHR) +#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 8 +#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue" + +typedef enum VkQueryResultStatusKHR { + VK_QUERY_RESULT_STATUS_ERROR_KHR = -1, + VK_QUERY_RESULT_STATUS_NOT_READY_KHR = 0, + VK_QUERY_RESULT_STATUS_COMPLETE_KHR = 1, + VK_QUERY_RESULT_STATUS_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_KHR = -1000299000, + VK_QUERY_RESULT_STATUS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkQueryResultStatusKHR; + +typedef enum VkVideoCodecOperationFlagBitsKHR { + VK_VIDEO_CODEC_OPERATION_NONE_KHR = 0, + VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR = 0x00010000, + VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR = 0x00020000, + VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR = 0x00000001, + VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR = 0x00000002, + VK_VIDEO_CODEC_OPERATION_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCodecOperationFlagBitsKHR; +typedef VkFlags VkVideoCodecOperationFlagsKHR; + +typedef enum VkVideoChromaSubsamplingFlagBitsKHR { + VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR = 0, + VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0x00000001, + VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0x00000002, + VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0x00000004, + VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0x00000008, + VK_VIDEO_CHROMA_SUBSAMPLING_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoChromaSubsamplingFlagBitsKHR; +typedef VkFlags VkVideoChromaSubsamplingFlagsKHR; + +typedef enum VkVideoComponentBitDepthFlagBitsKHR { + VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR = 0, + VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0x00000001, + VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0x00000004, + VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0x00000010, + VK_VIDEO_COMPONENT_BIT_DEPTH_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoComponentBitDepthFlagBitsKHR; +typedef VkFlags VkVideoComponentBitDepthFlagsKHR; + +typedef enum VkVideoCapabilityFlagBitsKHR { + VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0x00000001, + VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0x00000002, + VK_VIDEO_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCapabilityFlagBitsKHR; +typedef VkFlags VkVideoCapabilityFlagsKHR; + +typedef enum VkVideoSessionCreateFlagBitsKHR { + VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0x00000001, + VK_VIDEO_SESSION_CREATE_ALLOW_ENCODE_PARAMETER_OPTIMIZATIONS_BIT_KHR = 0x00000002, + VK_VIDEO_SESSION_CREATE_INLINE_QUERIES_BIT_KHR = 0x00000004, + VK_VIDEO_SESSION_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoSessionCreateFlagBitsKHR; +typedef VkFlags VkVideoSessionCreateFlagsKHR; +typedef VkFlags VkVideoSessionParametersCreateFlagsKHR; +typedef VkFlags VkVideoBeginCodingFlagsKHR; +typedef VkFlags VkVideoEndCodingFlagsKHR; + +typedef enum VkVideoCodingControlFlagBitsKHR { + VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0x00000001, + VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0x00000002, + VK_VIDEO_CODING_CONTROL_ENCODE_QUALITY_LEVEL_BIT_KHR = 0x00000004, + VK_VIDEO_CODING_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoCodingControlFlagBitsKHR; +typedef VkFlags VkVideoCodingControlFlagsKHR; +typedef struct VkQueueFamilyQueryResultStatusPropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 queryResultStatusSupport; +} VkQueueFamilyQueryResultStatusPropertiesKHR; -typedef VkRenderingFlagBits VkRenderingFlagBitsKHR; +typedef struct VkQueueFamilyVideoPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoCodecOperationFlagsKHR videoCodecOperations; +} VkQueueFamilyVideoPropertiesKHR; -typedef VkRenderingInfo VkRenderingInfoKHR; +typedef struct VkVideoProfileInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoCodecOperationFlagBitsKHR videoCodecOperation; + VkVideoChromaSubsamplingFlagsKHR chromaSubsampling; + VkVideoComponentBitDepthFlagsKHR lumaBitDepth; + VkVideoComponentBitDepthFlagsKHR chromaBitDepth; +} VkVideoProfileInfoKHR; -typedef VkRenderingAttachmentInfo VkRenderingAttachmentInfoKHR; +typedef struct VkVideoProfileListInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t profileCount; + const VkVideoProfileInfoKHR* pProfiles; +} VkVideoProfileListInfoKHR; -typedef VkPipelineRenderingCreateInfo VkPipelineRenderingCreateInfoKHR; +typedef struct VkVideoCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoCapabilityFlagsKHR flags; + VkDeviceSize minBitstreamBufferOffsetAlignment; + VkDeviceSize minBitstreamBufferSizeAlignment; + VkExtent2D pictureAccessGranularity; + VkExtent2D minCodedExtent; + VkExtent2D maxCodedExtent; + uint32_t maxDpbSlots; + uint32_t maxActiveReferencePictures; + VkExtensionProperties stdHeaderVersion; +} VkVideoCapabilitiesKHR; + +typedef struct VkPhysicalDeviceVideoFormatInfoKHR { + VkStructureType sType; + const void* pNext; + VkImageUsageFlags imageUsage; +} VkPhysicalDeviceVideoFormatInfoKHR; + +typedef struct VkVideoFormatPropertiesKHR { + VkStructureType sType; + void* pNext; + VkFormat format; + VkComponentMapping componentMapping; + VkImageCreateFlags imageCreateFlags; + VkImageType imageType; + VkImageTiling imageTiling; + VkImageUsageFlags imageUsageFlags; +} VkVideoFormatPropertiesKHR; + +typedef struct VkVideoPictureResourceInfoKHR { + VkStructureType sType; + const void* pNext; + VkOffset2D codedOffset; + VkExtent2D codedExtent; + uint32_t baseArrayLayer; + VkImageView imageViewBinding; +} VkVideoPictureResourceInfoKHR; + +typedef struct VkVideoReferenceSlotInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t slotIndex; + const VkVideoPictureResourceInfoKHR* pPictureResource; +} VkVideoReferenceSlotInfoKHR; + +typedef struct VkVideoSessionMemoryRequirementsKHR { + VkStructureType sType; + void* pNext; + uint32_t memoryBindIndex; + VkMemoryRequirements memoryRequirements; +} VkVideoSessionMemoryRequirementsKHR; + +typedef struct VkBindVideoSessionMemoryInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t memoryBindIndex; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkDeviceSize memorySize; +} VkBindVideoSessionMemoryInfoKHR; + +typedef struct VkVideoSessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t queueFamilyIndex; + VkVideoSessionCreateFlagsKHR flags; + const VkVideoProfileInfoKHR* pVideoProfile; + VkFormat pictureFormat; + VkExtent2D maxCodedExtent; + VkFormat referencePictureFormat; + uint32_t maxDpbSlots; + uint32_t maxActiveReferencePictures; + const VkExtensionProperties* pStdHeaderVersion; +} VkVideoSessionCreateInfoKHR; + +typedef struct VkVideoSessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoSessionParametersCreateFlagsKHR flags; + VkVideoSessionParametersKHR videoSessionParametersTemplate; + VkVideoSessionKHR videoSession; +} VkVideoSessionParametersCreateInfoKHR; + +typedef struct VkVideoSessionParametersUpdateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t updateSequenceCount; +} VkVideoSessionParametersUpdateInfoKHR; + +typedef struct VkVideoBeginCodingInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoBeginCodingFlagsKHR flags; + VkVideoSessionKHR videoSession; + VkVideoSessionParametersKHR videoSessionParameters; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; +} VkVideoBeginCodingInfoKHR; + +typedef struct VkVideoEndCodingInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEndCodingFlagsKHR flags; +} VkVideoEndCodingInfoKHR; + +typedef struct VkVideoCodingControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoCodingControlFlagsKHR flags; +} VkVideoCodingControlInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice physicalDevice, const VkVideoProfileInfoKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, uint32_t* pVideoFormatPropertyCount, VkVideoFormatPropertiesKHR* pVideoFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionKHR)(VkDevice device, const VkVideoSessionCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionKHR* pVideoSession); +typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionKHR)(VkDevice device, VkVideoSessionKHR videoSession, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetVideoSessionMemoryRequirementsKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t* pMemoryRequirementsCount, VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); +typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t bindSessionMemoryInfoCount, const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); +typedef VkResult (VKAPI_PTR *PFN_vkCreateVideoSessionParametersKHR)(VkDevice device, const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkVideoSessionParametersKHR* pVideoSessionParameters); +typedef VkResult (VKAPI_PTR *PFN_vkUpdateVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); +typedef void (VKAPI_PTR *PFN_vkDestroyVideoSessionParametersKHR)(VkDevice device, VkVideoSessionParametersKHR videoSessionParameters, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkCmdBeginVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoBeginCodingInfoKHR* pBeginInfo); +typedef void (VKAPI_PTR *PFN_vkCmdEndVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoEndCodingInfoKHR* pEndCodingInfo); +typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer commandBuffer, const VkVideoCodingControlInfoKHR* pCodingControlInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR( + VkPhysicalDevice physicalDevice, + const VkVideoProfileInfoKHR* pVideoProfile, + VkVideoCapabilitiesKHR* pCapabilities); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceVideoFormatInfoKHR* pVideoFormatInfo, + uint32_t* pVideoFormatPropertyCount, + VkVideoFormatPropertiesKHR* pVideoFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionKHR( + VkDevice device, + const VkVideoSessionCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkVideoSessionKHR* pVideoSession); + +VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + uint32_t* pMemoryRequirementsCount, + VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR( + VkDevice device, + VkVideoSessionKHR videoSession, + uint32_t bindSessionMemoryInfoCount, + const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR( + VkDevice device, + const VkVideoSessionParametersCreateInfoKHR* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkVideoSessionParametersKHR* pVideoSessionParameters); + +VKAPI_ATTR VkResult VKAPI_CALL vkUpdateVideoSessionParametersKHR( + VkDevice device, + VkVideoSessionParametersKHR videoSessionParameters, + const VkVideoSessionParametersUpdateInfoKHR* pUpdateInfo); + +VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionParametersKHR( + VkDevice device, + VkVideoSessionParametersKHR videoSessionParameters, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkCmdBeginVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoBeginCodingInfoKHR* pBeginInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdEndVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoEndCodingInfoKHR* pEndCodingInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR( + VkCommandBuffer commandBuffer, + const VkVideoCodingControlInfoKHR* pCodingControlInfo); +#endif + + +// VK_KHR_video_decode_queue is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_decode_queue 1 +#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 8 +#define VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME "VK_KHR_video_decode_queue" + +typedef enum VkVideoDecodeCapabilityFlagBitsKHR { + VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeCapabilityFlagBitsKHR; +typedef VkFlags VkVideoDecodeCapabilityFlagsKHR; + +typedef enum VkVideoDecodeUsageFlagBitsKHR { + VK_VIDEO_DECODE_USAGE_DEFAULT_KHR = 0, + VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0x00000004, + VK_VIDEO_DECODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeUsageFlagBitsKHR; +typedef VkFlags VkVideoDecodeUsageFlagsKHR; +typedef VkFlags VkVideoDecodeFlagsKHR; +typedef struct VkVideoDecodeCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoDecodeCapabilityFlagsKHR flags; +} VkVideoDecodeCapabilitiesKHR; + +typedef struct VkVideoDecodeUsageInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoDecodeUsageFlagsKHR videoUsageHints; +} VkVideoDecodeUsageInfoKHR; + +typedef struct VkVideoDecodeInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoDecodeFlagsKHR flags; + VkBuffer srcBuffer; + VkDeviceSize srcBufferOffset; + VkDeviceSize srcBufferRange; + VkVideoPictureResourceInfoKHR dstPictureResource; + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; +} VkVideoDecodeInfoKHR; + +typedef void (VKAPI_PTR *PFN_vkCmdDecodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoDecodeInfoKHR* pDecodeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDecodeVideoKHR( + VkCommandBuffer commandBuffer, + const VkVideoDecodeInfoKHR* pDecodeInfo); +#endif + + +// VK_KHR_video_encode_h264 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_h264 1 +#include "../vk_video/vulkan_video_codec_h264std.h" +#include "../vk_video/vulkan_video_codec_h264std_encode.h" +#define VK_KHR_VIDEO_ENCODE_H264_SPEC_VERSION 14 +#define VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_KHR_video_encode_h264" + +typedef enum VkVideoEncodeH264CapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H264_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H264_CAPABILITY_PER_SLICE_CONSTANT_QP_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264CapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264CapabilityFlagsKHR; + +typedef enum VkVideoEncodeH264StdFlagBitsKHR { + VK_VIDEO_ENCODE_H264_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_STD_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG_SET_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_STD_SCALING_MATRIX_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_STD_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_STD_SECOND_CHROMA_QP_INDEX_OFFSET_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_STD_PIC_INIT_QP_MINUS26_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_EXPLICIT_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H264_STD_WEIGHTED_BIPRED_IDC_IMPLICIT_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H264_STD_TRANSFORM_8X8_MODE_FLAG_SET_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H264_STD_DIRECT_SPATIAL_MV_PRED_FLAG_UNSET_BIT_KHR = 0x00000400, + VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_UNSET_BIT_KHR = 0x00000800, + VK_VIDEO_ENCODE_H264_STD_ENTROPY_CODING_MODE_FLAG_SET_BIT_KHR = 0x00001000, + VK_VIDEO_ENCODE_H264_STD_DIRECT_8X8_INFERENCE_FLAG_UNSET_BIT_KHR = 0x00002000, + VK_VIDEO_ENCODE_H264_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_DISABLED_BIT_KHR = 0x00008000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_ENABLED_BIT_KHR = 0x00010000, + VK_VIDEO_ENCODE_H264_STD_DEBLOCKING_FILTER_PARTIAL_BIT_KHR = 0x00020000, + VK_VIDEO_ENCODE_H264_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, + VK_VIDEO_ENCODE_H264_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, + VK_VIDEO_ENCODE_H264_STD_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264StdFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264StdFlagsKHR; + +typedef enum VkVideoEncodeH264RateControlFlagBitsKHR { + VK_VIDEO_ENCODE_H264_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_TEMPORAL_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H264_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH264RateControlFlagBitsKHR; +typedef VkFlags VkVideoEncodeH264RateControlFlagsKHR; +typedef struct VkVideoEncodeH264CapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH264CapabilityFlagsKHR flags; + StdVideoH264LevelIdc maxLevelIdc; + uint32_t maxSliceCount; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; + uint32_t maxTemporalLayerCount; + VkBool32 expectDyadicTemporalLayerPattern; + int32_t minQp; + int32_t maxQp; + VkBool32 prefersGopRemainingFrames; + VkBool32 requiresGopRemainingFrames; + VkVideoEncodeH264StdFlagsKHR stdSyntaxFlags; +} VkVideoEncodeH264CapabilitiesKHR; + +typedef struct VkVideoEncodeH264QpKHR { + int32_t qpI; + int32_t qpP; + int32_t qpB; +} VkVideoEncodeH264QpKHR; + +typedef struct VkVideoEncodeH264QualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH264RateControlFlagsKHR preferredRateControlFlags; + uint32_t preferredGopFrameCount; + uint32_t preferredIdrPeriod; + uint32_t preferredConsecutiveBFrameCount; + uint32_t preferredTemporalLayerCount; + VkVideoEncodeH264QpKHR preferredConstantQp; + uint32_t preferredMaxL0ReferenceCount; + uint32_t preferredMaxL1ReferenceCount; + VkBool32 preferredStdEntropyCodingModeFlag; +} VkVideoEncodeH264QualityLevelPropertiesKHR; + +typedef struct VkVideoEncodeH264SessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMaxLevelIdc; + StdVideoH264LevelIdc maxLevelIdc; +} VkVideoEncodeH264SessionCreateInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdSPSCount; + const StdVideoH264SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH264PictureParameterSet* pStdPPSs; +} VkVideoEncodeH264SessionParametersAddInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoEncodeH264SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoEncodeH264SessionParametersCreateInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 writeStdSPS; + VkBool32 writeStdPPS; + uint32_t stdSPSId; + uint32_t stdPPSId; +} VkVideoEncodeH264SessionParametersGetInfoKHR; + +typedef struct VkVideoEncodeH264SessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasStdSPSOverrides; + VkBool32 hasStdPPSOverrides; +} VkVideoEncodeH264SessionParametersFeedbackInfoKHR; + +typedef struct VkVideoEncodeH264NaluSliceInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t constantQp; + const StdVideoEncodeH264SliceHeader* pStdSliceHeader; +} VkVideoEncodeH264NaluSliceInfoKHR; + +typedef struct VkVideoEncodeH264PictureInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t naluSliceEntryCount; + const VkVideoEncodeH264NaluSliceInfoKHR* pNaluSliceEntries; + const StdVideoEncodeH264PictureInfo* pStdPictureInfo; + VkBool32 generatePrefixNalu; +} VkVideoEncodeH264PictureInfoKHR; + +typedef struct VkVideoEncodeH264DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH264DpbSlotInfoKHR; + +typedef struct VkVideoEncodeH264ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH264ProfileIdc stdProfileIdc; +} VkVideoEncodeH264ProfileInfoKHR; + +typedef struct VkVideoEncodeH264RateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeH264RateControlFlagsKHR flags; + uint32_t gopFrameCount; + uint32_t idrPeriod; + uint32_t consecutiveBFrameCount; + uint32_t temporalLayerCount; +} VkVideoEncodeH264RateControlInfoKHR; + +typedef struct VkVideoEncodeH264FrameSizeKHR { + uint32_t frameISize; + uint32_t framePSize; + uint32_t frameBSize; +} VkVideoEncodeH264FrameSizeKHR; + +typedef struct VkVideoEncodeH264RateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMinQp; + VkVideoEncodeH264QpKHR minQp; + VkBool32 useMaxQp; + VkVideoEncodeH264QpKHR maxQp; + VkBool32 useMaxFrameSize; + VkVideoEncodeH264FrameSizeKHR maxFrameSize; +} VkVideoEncodeH264RateControlLayerInfoKHR; + +typedef struct VkVideoEncodeH264GopRemainingFrameInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useGopRemainingFrames; + uint32_t gopRemainingI; + uint32_t gopRemainingP; + uint32_t gopRemainingB; +} VkVideoEncodeH264GopRemainingFrameInfoKHR; + + + +// VK_KHR_video_encode_h265 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_h265 1 +#include "../vk_video/vulkan_video_codec_h265std.h" +#include "../vk_video/vulkan_video_codec_h265std_encode.h" +#define VK_KHR_VIDEO_ENCODE_H265_SPEC_VERSION 14 +#define VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_KHR_video_encode_h265" + +typedef enum VkVideoEncodeH265CapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_CAPABILITY_PREDICTION_WEIGHT_TABLE_GENERATED_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_SEGMENT_TYPE_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L0_LIST_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H265_CAPABILITY_PER_PICTURE_TYPE_MIN_MAX_QP_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H265_CAPABILITY_PER_SLICE_SEGMENT_CONSTANT_QP_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILES_PER_SLICE_SEGMENT_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_SEGMENTS_PER_TILE_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265CapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265CapabilityFlagsKHR; + +typedef enum VkVideoEncodeH265StdFlagBitsKHR { + VK_VIDEO_ENCODE_H265_STD_SEPARATE_COLOR_PLANE_FLAG_SET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_STD_SAMPLE_ADAPTIVE_OFFSET_ENABLED_FLAG_SET_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_STD_SCALING_LIST_DATA_PRESENT_FLAG_SET_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_STD_PCM_ENABLED_FLAG_SET_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_STD_SPS_TEMPORAL_MVP_ENABLED_FLAG_SET_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_STD_INIT_QP_MINUS26_BIT_KHR = 0x00000020, + VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR = 0x00000040, + VK_VIDEO_ENCODE_H265_STD_WEIGHTED_BIPRED_FLAG_SET_BIT_KHR = 0x00000080, + VK_VIDEO_ENCODE_H265_STD_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_KHR = 0x00000100, + VK_VIDEO_ENCODE_H265_STD_SIGN_DATA_HIDING_ENABLED_FLAG_SET_BIT_KHR = 0x00000200, + VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR = 0x00000400, + VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_UNSET_BIT_KHR = 0x00000800, + VK_VIDEO_ENCODE_H265_STD_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_FLAG_SET_BIT_KHR = 0x00001000, + VK_VIDEO_ENCODE_H265_STD_TRANSQUANT_BYPASS_ENABLED_FLAG_SET_BIT_KHR = 0x00002000, + VK_VIDEO_ENCODE_H265_STD_CONSTRAINED_INTRA_PRED_FLAG_SET_BIT_KHR = 0x00004000, + VK_VIDEO_ENCODE_H265_STD_ENTROPY_CODING_SYNC_ENABLED_FLAG_SET_BIT_KHR = 0x00008000, + VK_VIDEO_ENCODE_H265_STD_DEBLOCKING_FILTER_OVERRIDE_ENABLED_FLAG_SET_BIT_KHR = 0x00010000, + VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENTS_ENABLED_FLAG_SET_BIT_KHR = 0x00020000, + VK_VIDEO_ENCODE_H265_STD_DEPENDENT_SLICE_SEGMENT_FLAG_SET_BIT_KHR = 0x00040000, + VK_VIDEO_ENCODE_H265_STD_SLICE_QP_DELTA_BIT_KHR = 0x00080000, + VK_VIDEO_ENCODE_H265_STD_DIFFERENT_SLICE_QP_DELTA_BIT_KHR = 0x00100000, + VK_VIDEO_ENCODE_H265_STD_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265StdFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265StdFlagsKHR; + +typedef enum VkVideoEncodeH265CtbSizeFlagBitsKHR { + VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265CtbSizeFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265CtbSizeFlagsKHR; + +typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsKHR { + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265TransformBlockSizeFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsKHR; + +typedef enum VkVideoEncodeH265RateControlFlagBitsKHR { + VK_VIDEO_ENCODE_H265_RATE_CONTROL_ATTEMPT_HRD_COMPLIANCE_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REGULAR_GOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_FLAT_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_REFERENCE_PATTERN_DYADIC_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_TEMPORAL_SUB_LAYER_PATTERN_DYADIC_BIT_KHR = 0x00000010, + VK_VIDEO_ENCODE_H265_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeH265RateControlFlagBitsKHR; +typedef VkFlags VkVideoEncodeH265RateControlFlagsKHR; +typedef struct VkVideoEncodeH265CapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH265CapabilityFlagsKHR flags; + StdVideoH265LevelIdc maxLevelIdc; + uint32_t maxSliceSegmentCount; + VkExtent2D maxTiles; + VkVideoEncodeH265CtbSizeFlagsKHR ctbSizes; + VkVideoEncodeH265TransformBlockSizeFlagsKHR transformBlockSizes; + uint32_t maxPPictureL0ReferenceCount; + uint32_t maxBPictureL0ReferenceCount; + uint32_t maxL1ReferenceCount; + uint32_t maxSubLayerCount; + VkBool32 expectDyadicTemporalSubLayerPattern; + int32_t minQp; + int32_t maxQp; + VkBool32 prefersGopRemainingFrames; + VkBool32 requiresGopRemainingFrames; + VkVideoEncodeH265StdFlagsKHR stdSyntaxFlags; +} VkVideoEncodeH265CapabilitiesKHR; + +typedef struct VkVideoEncodeH265SessionCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMaxLevelIdc; + StdVideoH265LevelIdc maxLevelIdc; +} VkVideoEncodeH265SessionCreateInfoKHR; + +typedef struct VkVideoEncodeH265QpKHR { + int32_t qpI; + int32_t qpP; + int32_t qpB; +} VkVideoEncodeH265QpKHR; + +typedef struct VkVideoEncodeH265QualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeH265RateControlFlagsKHR preferredRateControlFlags; + uint32_t preferredGopFrameCount; + uint32_t preferredIdrPeriod; + uint32_t preferredConsecutiveBFrameCount; + uint32_t preferredSubLayerCount; + VkVideoEncodeH265QpKHR preferredConstantQp; + uint32_t preferredMaxL0ReferenceCount; + uint32_t preferredMaxL1ReferenceCount; +} VkVideoEncodeH265QualityLevelPropertiesKHR; + +typedef struct VkVideoEncodeH265SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdVPSCount; + const StdVideoH265VideoParameterSet* pStdVPSs; + uint32_t stdSPSCount; + const StdVideoH265SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH265PictureParameterSet* pStdPPSs; +} VkVideoEncodeH265SessionParametersAddInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdVPSCount; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoEncodeH265SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoEncodeH265SessionParametersCreateInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 writeStdVPS; + VkBool32 writeStdSPS; + VkBool32 writeStdPPS; + uint32_t stdVPSId; + uint32_t stdSPSId; + uint32_t stdPPSId; +} VkVideoEncodeH265SessionParametersGetInfoKHR; + +typedef struct VkVideoEncodeH265SessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasStdVPSOverrides; + VkBool32 hasStdSPSOverrides; + VkBool32 hasStdPPSOverrides; +} VkVideoEncodeH265SessionParametersFeedbackInfoKHR; + +typedef struct VkVideoEncodeH265NaluSliceSegmentInfoKHR { + VkStructureType sType; + const void* pNext; + int32_t constantQp; + const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader; +} VkVideoEncodeH265NaluSliceSegmentInfoKHR; + +typedef struct VkVideoEncodeH265PictureInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t naluSliceSegmentEntryCount; + const VkVideoEncodeH265NaluSliceSegmentInfoKHR* pNaluSliceSegmentEntries; + const StdVideoEncodeH265PictureInfo* pStdPictureInfo; +} VkVideoEncodeH265PictureInfoKHR; + +typedef struct VkVideoEncodeH265DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo; +} VkVideoEncodeH265DpbSlotInfoKHR; + +typedef struct VkVideoEncodeH265ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH265ProfileIdc stdProfileIdc; +} VkVideoEncodeH265ProfileInfoKHR; + +typedef struct VkVideoEncodeH265RateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeH265RateControlFlagsKHR flags; + uint32_t gopFrameCount; + uint32_t idrPeriod; + uint32_t consecutiveBFrameCount; + uint32_t subLayerCount; +} VkVideoEncodeH265RateControlInfoKHR; + +typedef struct VkVideoEncodeH265FrameSizeKHR { + uint32_t frameISize; + uint32_t framePSize; + uint32_t frameBSize; +} VkVideoEncodeH265FrameSizeKHR; + +typedef struct VkVideoEncodeH265RateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useMinQp; + VkVideoEncodeH265QpKHR minQp; + VkBool32 useMaxQp; + VkVideoEncodeH265QpKHR maxQp; + VkBool32 useMaxFrameSize; + VkVideoEncodeH265FrameSizeKHR maxFrameSize; +} VkVideoEncodeH265RateControlLayerInfoKHR; + +typedef struct VkVideoEncodeH265GopRemainingFrameInfoKHR { + VkStructureType sType; + const void* pNext; + VkBool32 useGopRemainingFrames; + uint32_t gopRemainingI; + uint32_t gopRemainingP; + uint32_t gopRemainingB; +} VkVideoEncodeH265GopRemainingFrameInfoKHR; + + + +// VK_KHR_video_decode_h264 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_decode_h264 1 +#include "../vk_video/vulkan_video_codec_h264std_decode.h" +#define VK_KHR_VIDEO_DECODE_H264_SPEC_VERSION 9 +#define VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME "VK_KHR_video_decode_h264" + +typedef enum VkVideoDecodeH264PictureLayoutFlagBitsKHR { + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR = 0, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR = 0x00000001, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR = 0x00000002, + VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoDecodeH264PictureLayoutFlagBitsKHR; +typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsKHR; +typedef struct VkVideoDecodeH264ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH264ProfileIdc stdProfileIdc; + VkVideoDecodeH264PictureLayoutFlagBitsKHR pictureLayout; +} VkVideoDecodeH264ProfileInfoKHR; + +typedef struct VkVideoDecodeH264CapabilitiesKHR { + VkStructureType sType; + void* pNext; + StdVideoH264LevelIdc maxLevelIdc; + VkOffset2D fieldOffsetGranularity; +} VkVideoDecodeH264CapabilitiesKHR; + +typedef struct VkVideoDecodeH264SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdSPSCount; + const StdVideoH264SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH264PictureParameterSet* pStdPPSs; +} VkVideoDecodeH264SessionParametersAddInfoKHR; + +typedef struct VkVideoDecodeH264SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoDecodeH264SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoDecodeH264SessionParametersCreateInfoKHR; + +typedef struct VkVideoDecodeH264PictureInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH264PictureInfo* pStdPictureInfo; + uint32_t sliceCount; + const uint32_t* pSliceOffsets; +} VkVideoDecodeH264PictureInfoKHR; + +typedef struct VkVideoDecodeH264DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH264ReferenceInfo* pStdReferenceInfo; +} VkVideoDecodeH264DpbSlotInfoKHR; + + + +// VK_KHR_dynamic_rendering is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_dynamic_rendering 1 +#define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1 +#define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering" +typedef VkRenderingFlags VkRenderingFlagsKHR; + +typedef VkRenderingFlagBits VkRenderingFlagBitsKHR; + +typedef VkRenderingInfo VkRenderingInfoKHR; + +typedef VkRenderingAttachmentInfo VkRenderingAttachmentInfoKHR; + +typedef VkPipelineRenderingCreateInfo VkPipelineRenderingCreateInfoKHR; typedef VkPhysicalDeviceDynamicRenderingFeatures VkPhysicalDeviceDynamicRenderingFeaturesKHR; @@ -7880,6 +8830,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderingKHR( #endif +// VK_KHR_multiview is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_multiview 1 #define VK_KHR_MULTIVIEW_SPEC_VERSION 1 #define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview" @@ -7891,6 +8842,7 @@ typedef VkPhysicalDeviceMultiviewProperties VkPhysicalDeviceMultiviewPropertiesK +// VK_KHR_get_physical_device_properties2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_get_physical_device_properties2 1 #define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 2 #define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2" @@ -7956,6 +8908,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR( #endif +// VK_KHR_device_group is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_device_group 1 #define VK_KHR_DEVICE_GROUP_SPEC_VERSION 4 #define VK_KHR_DEVICE_GROUP_EXTENSION_NAME "VK_KHR_device_group" @@ -8008,11 +8961,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBaseKHR( #endif +// VK_KHR_shader_draw_parameters is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_draw_parameters 1 #define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1 #define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters" +// VK_KHR_maintenance1 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_maintenance1 1 #define VK_KHR_MAINTENANCE_1_SPEC_VERSION 2 #define VK_KHR_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_maintenance1" @@ -8030,6 +8985,7 @@ VKAPI_ATTR void VKAPI_CALL vkTrimCommandPoolKHR( #endif +// VK_KHR_device_group_creation is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_device_group_creation 1 #define VK_KHR_DEVICE_GROUP_CREATION_SPEC_VERSION 1 #define VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME "VK_KHR_device_group_creation" @@ -8048,6 +9004,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroupsKHR( #endif +// VK_KHR_external_memory_capabilities is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_memory_capabilities 1 #define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_memory_capabilities" @@ -8082,6 +9039,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferPropertiesKHR( #endif +// VK_KHR_external_memory is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_memory 1 #define VK_KHR_EXTERNAL_MEMORY_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME "VK_KHR_external_memory" @@ -8094,6 +9052,7 @@ typedef VkExportMemoryAllocateInfo VkExportMemoryAllocateInfoKHR; +// VK_KHR_external_memory_fd is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_memory_fd 1 #define VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME "VK_KHR_external_memory_fd" @@ -8134,6 +9093,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryFdPropertiesKHR( #endif +// VK_KHR_external_semaphore_capabilities is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_semaphore_capabilities 1 #define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_semaphore_capabilities" @@ -8159,6 +9119,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( #endif +// VK_KHR_external_semaphore is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_semaphore 1 #define VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_KHR_external_semaphore" @@ -8170,6 +9131,7 @@ typedef VkExportSemaphoreCreateInfo VkExportSemaphoreCreateInfoKHR; +// VK_KHR_external_semaphore_fd is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_semaphore_fd 1 #define VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME "VK_KHR_external_semaphore_fd" @@ -8204,6 +9166,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreFdKHR( #endif +// VK_KHR_push_descriptor is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_push_descriptor 1 #define VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION 2 #define VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME "VK_KHR_push_descriptor" @@ -8234,6 +9197,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR( #endif +// VK_KHR_shader_float16_int8 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_float16_int8 1 #define VK_KHR_SHADER_FLOAT16_INT8_SPEC_VERSION 1 #define VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME "VK_KHR_shader_float16_int8" @@ -8243,6 +9207,7 @@ typedef VkPhysicalDeviceShaderFloat16Int8Features VkPhysicalDeviceFloat16Int8Fea +// VK_KHR_16bit_storage is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_16bit_storage 1 #define VK_KHR_16BIT_STORAGE_SPEC_VERSION 1 #define VK_KHR_16BIT_STORAGE_EXTENSION_NAME "VK_KHR_16bit_storage" @@ -8250,6 +9215,7 @@ typedef VkPhysicalDevice16BitStorageFeatures VkPhysicalDevice16BitStorageFeature +// VK_KHR_incremental_present is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_incremental_present 1 #define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 2 #define VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME "VK_KHR_incremental_present" @@ -8273,6 +9239,7 @@ typedef struct VkPresentRegionsKHR { +// VK_KHR_descriptor_update_template is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_descriptor_update_template 1 typedef VkDescriptorUpdateTemplate VkDescriptorUpdateTemplateKHR; @@ -8310,6 +9277,7 @@ VKAPI_ATTR void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR( #endif +// VK_KHR_imageless_framebuffer is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_imageless_framebuffer 1 #define VK_KHR_IMAGELESS_FRAMEBUFFER_SPEC_VERSION 1 #define VK_KHR_IMAGELESS_FRAMEBUFFER_EXTENSION_NAME "VK_KHR_imageless_framebuffer" @@ -8323,6 +9291,7 @@ typedef VkRenderPassAttachmentBeginInfo VkRenderPassAttachmentBeginInfoKHR; +// VK_KHR_create_renderpass2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_create_renderpass2 1 #define VK_KHR_CREATE_RENDERPASS_2_SPEC_VERSION 1 #define VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME "VK_KHR_create_renderpass2" @@ -8368,6 +9337,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderPass2KHR( #endif +// VK_KHR_shared_presentable_image is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shared_presentable_image 1 #define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1 #define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image" @@ -8386,6 +9356,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainStatusKHR( #endif +// VK_KHR_external_fence_capabilities is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_fence_capabilities 1 #define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_FENCE_CAPABILITIES_EXTENSION_NAME "VK_KHR_external_fence_capabilities" @@ -8411,6 +9382,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFencePropertiesKHR( #endif +// VK_KHR_external_fence is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_fence 1 #define VK_KHR_EXTERNAL_FENCE_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_FENCE_EXTENSION_NAME "VK_KHR_external_fence" @@ -8422,6 +9394,7 @@ typedef VkExportFenceCreateInfo VkExportFenceCreateInfoKHR; +// VK_KHR_external_fence_fd is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_fence_fd 1 #define VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME "VK_KHR_external_fence_fd" @@ -8456,6 +9429,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceFdKHR( #endif +// VK_KHR_performance_query is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_performance_query 1 #define VK_KHR_PERFORMANCE_QUERY_SPEC_VERSION 1 #define VK_KHR_PERFORMANCE_QUERY_EXTENSION_NAME "VK_KHR_performance_query" @@ -8596,6 +9570,7 @@ VKAPI_ATTR void VKAPI_CALL vkReleaseProfilingLockKHR( #endif +// VK_KHR_maintenance2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_maintenance2 1 #define VK_KHR_MAINTENANCE_2_SPEC_VERSION 1 #define VK_KHR_MAINTENANCE_2_EXTENSION_NAME "VK_KHR_maintenance2" @@ -8617,6 +9592,7 @@ typedef VkPipelineTessellationDomainOriginStateCreateInfo VkPipelineTessellation +// VK_KHR_get_surface_capabilities2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_get_surface_capabilities2 1 #define VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION 1 #define VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME "VK_KHR_get_surface_capabilities2" @@ -8655,6 +9631,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats2KHR( #endif +// VK_KHR_variable_pointers is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_variable_pointers 1 #define VK_KHR_VARIABLE_POINTERS_SPEC_VERSION 1 #define VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME "VK_KHR_variable_pointers" @@ -8664,6 +9641,7 @@ typedef VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointer +// VK_KHR_get_display_properties2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_get_display_properties2 1 #define VK_KHR_GET_DISPLAY_PROPERTIES_2_SPEC_VERSION 1 #define VK_KHR_GET_DISPLAY_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_display_properties2" @@ -8727,6 +9705,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDisplayPlaneCapabilities2KHR( #endif +// VK_KHR_dedicated_allocation is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_dedicated_allocation 1 #define VK_KHR_DEDICATED_ALLOCATION_SPEC_VERSION 3 #define VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_KHR_dedicated_allocation" @@ -8736,16 +9715,19 @@ typedef VkMemoryDedicatedAllocateInfo VkMemoryDedicatedAllocateInfoKHR; +// VK_KHR_storage_buffer_storage_class is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_storage_buffer_storage_class 1 #define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_SPEC_VERSION 1 #define VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME "VK_KHR_storage_buffer_storage_class" +// VK_KHR_relaxed_block_layout is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_relaxed_block_layout 1 #define VK_KHR_RELAXED_BLOCK_LAYOUT_SPEC_VERSION 1 #define VK_KHR_RELAXED_BLOCK_LAYOUT_EXTENSION_NAME "VK_KHR_relaxed_block_layout" +// VK_KHR_get_memory_requirements2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_get_memory_requirements2 1 #define VK_KHR_GET_MEMORY_REQUIREMENTS_2_SPEC_VERSION 1 #define VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME "VK_KHR_get_memory_requirements2" @@ -8782,6 +9764,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2KHR( #endif +// VK_KHR_image_format_list is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_image_format_list 1 #define VK_KHR_IMAGE_FORMAT_LIST_SPEC_VERSION 1 #define VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME "VK_KHR_image_format_list" @@ -8789,6 +9772,7 @@ typedef VkImageFormatListCreateInfo VkImageFormatListCreateInfoKHR; +// VK_KHR_sampler_ycbcr_conversion is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_sampler_ycbcr_conversion 1 typedef VkSamplerYcbcrConversion VkSamplerYcbcrConversionKHR; @@ -8829,6 +9813,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversionKHR( #endif +// VK_KHR_bind_memory2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_bind_memory2 1 #define VK_KHR_BIND_MEMORY_2_SPEC_VERSION 1 #define VK_KHR_BIND_MEMORY_2_EXTENSION_NAME "VK_KHR_bind_memory2" @@ -8852,6 +9837,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2KHR( #endif +// VK_KHR_maintenance3 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_maintenance3 1 #define VK_KHR_MAINTENANCE_3_SPEC_VERSION 1 #define VK_KHR_MAINTENANCE_3_EXTENSION_NAME "VK_KHR_maintenance3" @@ -8871,6 +9857,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupportKHR( #endif +// VK_KHR_draw_indirect_count is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_draw_indirect_count 1 #define VK_KHR_DRAW_INDIRECT_COUNT_SPEC_VERSION 1 #define VK_KHR_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_KHR_draw_indirect_count" @@ -8898,6 +9885,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountKHR( #endif +// VK_KHR_shader_subgroup_extended_types is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_subgroup_extended_types 1 #define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_SPEC_VERSION 1 #define VK_KHR_SHADER_SUBGROUP_EXTENDED_TYPES_EXTENSION_NAME "VK_KHR_shader_subgroup_extended_types" @@ -8905,6 +9893,7 @@ typedef VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures VkPhysicalDeviceShad +// VK_KHR_8bit_storage is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_8bit_storage 1 #define VK_KHR_8BIT_STORAGE_SPEC_VERSION 1 #define VK_KHR_8BIT_STORAGE_EXTENSION_NAME "VK_KHR_8bit_storage" @@ -8912,6 +9901,7 @@ typedef VkPhysicalDevice8BitStorageFeatures VkPhysicalDevice8BitStorageFeaturesK +// VK_KHR_shader_atomic_int64 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_atomic_int64 1 #define VK_KHR_SHADER_ATOMIC_INT64_SPEC_VERSION 1 #define VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME "VK_KHR_shader_atomic_int64" @@ -8919,6 +9909,7 @@ typedef VkPhysicalDeviceShaderAtomicInt64Features VkPhysicalDeviceShaderAtomicIn +// VK_KHR_shader_clock is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_clock 1 #define VK_KHR_SHADER_CLOCK_SPEC_VERSION 1 #define VK_KHR_SHADER_CLOCK_EXTENSION_NAME "VK_KHR_shader_clock" @@ -8931,6 +9922,60 @@ typedef struct VkPhysicalDeviceShaderClockFeaturesKHR { +// VK_KHR_video_decode_h265 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_decode_h265 1 +#include "../vk_video/vulkan_video_codec_h265std_decode.h" +#define VK_KHR_VIDEO_DECODE_H265_SPEC_VERSION 8 +#define VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME "VK_KHR_video_decode_h265" +typedef struct VkVideoDecodeH265ProfileInfoKHR { + VkStructureType sType; + const void* pNext; + StdVideoH265ProfileIdc stdProfileIdc; +} VkVideoDecodeH265ProfileInfoKHR; + +typedef struct VkVideoDecodeH265CapabilitiesKHR { + VkStructureType sType; + void* pNext; + StdVideoH265LevelIdc maxLevelIdc; +} VkVideoDecodeH265CapabilitiesKHR; + +typedef struct VkVideoDecodeH265SessionParametersAddInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t stdVPSCount; + const StdVideoH265VideoParameterSet* pStdVPSs; + uint32_t stdSPSCount; + const StdVideoH265SequenceParameterSet* pStdSPSs; + uint32_t stdPPSCount; + const StdVideoH265PictureParameterSet* pStdPPSs; +} VkVideoDecodeH265SessionParametersAddInfoKHR; + +typedef struct VkVideoDecodeH265SessionParametersCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t maxStdVPSCount; + uint32_t maxStdSPSCount; + uint32_t maxStdPPSCount; + const VkVideoDecodeH265SessionParametersAddInfoKHR* pParametersAddInfo; +} VkVideoDecodeH265SessionParametersCreateInfoKHR; + +typedef struct VkVideoDecodeH265PictureInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH265PictureInfo* pStdPictureInfo; + uint32_t sliceSegmentCount; + const uint32_t* pSliceSegmentOffsets; +} VkVideoDecodeH265PictureInfoKHR; + +typedef struct VkVideoDecodeH265DpbSlotInfoKHR { + VkStructureType sType; + const void* pNext; + const StdVideoDecodeH265ReferenceInfo* pStdReferenceInfo; +} VkVideoDecodeH265DpbSlotInfoKHR; + + + +// VK_KHR_global_priority is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_global_priority 1 #define VK_MAX_GLOBAL_PRIORITY_SIZE_KHR 16U #define VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION 1 @@ -8968,6 +10013,7 @@ typedef struct VkQueueFamilyGlobalPriorityPropertiesKHR { +// VK_KHR_driver_properties is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_driver_properties 1 #define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1 #define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties" @@ -8981,6 +10027,7 @@ typedef VkPhysicalDeviceDriverProperties VkPhysicalDeviceDriverPropertiesKHR; +// VK_KHR_shader_float_controls is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_float_controls 1 #define VK_KHR_SHADER_FLOAT_CONTROLS_SPEC_VERSION 4 #define VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME "VK_KHR_shader_float_controls" @@ -8990,6 +10037,7 @@ typedef VkPhysicalDeviceFloatControlsProperties VkPhysicalDeviceFloatControlsPro +// VK_KHR_depth_stencil_resolve is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_depth_stencil_resolve 1 #define VK_KHR_DEPTH_STENCIL_RESOLVE_SPEC_VERSION 1 #define VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME "VK_KHR_depth_stencil_resolve" @@ -9003,11 +10051,13 @@ typedef VkPhysicalDeviceDepthStencilResolveProperties VkPhysicalDeviceDepthStenc +// VK_KHR_swapchain_mutable_format is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_swapchain_mutable_format 1 #define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_SPEC_VERSION 1 #define VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME "VK_KHR_swapchain_mutable_format" +// VK_KHR_timeline_semaphore is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_timeline_semaphore 1 #define VK_KHR_TIMELINE_SEMAPHORE_SPEC_VERSION 2 #define VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME "VK_KHR_timeline_semaphore" @@ -9050,6 +10100,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkSignalSemaphoreKHR( #endif +// VK_KHR_vulkan_memory_model is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_vulkan_memory_model 1 #define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 3 #define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model" @@ -9057,6 +10108,7 @@ typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryMo +// VK_KHR_shader_terminate_invocation is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_terminate_invocation 1 #define VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION 1 #define VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME "VK_KHR_shader_terminate_invocation" @@ -9064,6 +10116,7 @@ typedef VkPhysicalDeviceShaderTerminateInvocationFeatures VkPhysicalDeviceShader +// VK_KHR_fragment_shading_rate is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_fragment_shading_rate 1 #define VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION 2 #define VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME "VK_KHR_fragment_shading_rate" @@ -9143,11 +10196,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetFragmentShadingRateKHR( #endif +// VK_KHR_spirv_1_4 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_spirv_1_4 1 #define VK_KHR_SPIRV_1_4_SPEC_VERSION 1 #define VK_KHR_SPIRV_1_4_EXTENSION_NAME "VK_KHR_spirv_1_4" +// VK_KHR_surface_protected_capabilities is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_surface_protected_capabilities 1 #define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION 1 #define VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME "VK_KHR_surface_protected_capabilities" @@ -9159,6 +10214,7 @@ typedef struct VkSurfaceProtectedCapabilitiesKHR { +// VK_KHR_separate_depth_stencil_layouts is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_separate_depth_stencil_layouts 1 #define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_SPEC_VERSION 1 #define VK_KHR_SEPARATE_DEPTH_STENCIL_LAYOUTS_EXTENSION_NAME "VK_KHR_separate_depth_stencil_layouts" @@ -9170,6 +10226,7 @@ typedef VkAttachmentDescriptionStencilLayout VkAttachmentDescriptionStencilLayou +// VK_KHR_present_wait is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_present_wait 1 #define VK_KHR_PRESENT_WAIT_SPEC_VERSION 1 #define VK_KHR_PRESENT_WAIT_EXTENSION_NAME "VK_KHR_present_wait" @@ -9190,6 +10247,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkWaitForPresentKHR( #endif +// VK_KHR_uniform_buffer_standard_layout is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_uniform_buffer_standard_layout 1 #define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_SPEC_VERSION 1 #define VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME "VK_KHR_uniform_buffer_standard_layout" @@ -9197,6 +10255,7 @@ typedef VkPhysicalDeviceUniformBufferStandardLayoutFeatures VkPhysicalDeviceUnif +// VK_KHR_buffer_device_address is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_buffer_device_address 1 #define VK_KHR_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 1 #define VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_KHR_buffer_device_address" @@ -9229,6 +10288,7 @@ VKAPI_ATTR uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddressKHR( #endif +// VK_KHR_deferred_host_operations is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_deferred_host_operations 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeferredOperationKHR) #define VK_KHR_DEFERRED_HOST_OPERATIONS_SPEC_VERSION 4 @@ -9264,6 +10324,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkDeferredOperationJoinKHR( #endif +// VK_KHR_pipeline_executable_properties is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_pipeline_executable_properties 1 #define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_SPEC_VERSION 1 #define VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME "VK_KHR_pipeline_executable_properties" @@ -9354,6 +10415,43 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR #endif +// VK_KHR_map_memory2 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_map_memory2 1 +#define VK_KHR_MAP_MEMORY_2_SPEC_VERSION 1 +#define VK_KHR_MAP_MEMORY_2_EXTENSION_NAME "VK_KHR_map_memory2" +typedef VkFlags VkMemoryUnmapFlagsKHR; +typedef struct VkMemoryMapInfoKHR { + VkStructureType sType; + const void* pNext; + VkMemoryMapFlags flags; + VkDeviceMemory memory; + VkDeviceSize offset; + VkDeviceSize size; +} VkMemoryMapInfoKHR; + +typedef struct VkMemoryUnmapInfoKHR { + VkStructureType sType; + const void* pNext; + VkMemoryUnmapFlagsKHR flags; + VkDeviceMemory memory; +} VkMemoryUnmapInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkMapMemory2KHR)(VkDevice device, const VkMemoryMapInfoKHR* pMemoryMapInfo, void** ppData); +typedef VkResult (VKAPI_PTR *PFN_vkUnmapMemory2KHR)(VkDevice device, const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory2KHR( + VkDevice device, + const VkMemoryMapInfoKHR* pMemoryMapInfo, + void** ppData); + +VKAPI_ATTR VkResult VKAPI_CALL vkUnmapMemory2KHR( + VkDevice device, + const VkMemoryUnmapInfoKHR* pMemoryUnmapInfo); +#endif + + +// VK_KHR_shader_integer_dot_product is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_integer_dot_product 1 #define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_SPEC_VERSION 1 #define VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME "VK_KHR_shader_integer_dot_product" @@ -9363,6 +10461,7 @@ typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShader +// VK_KHR_pipeline_library is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_pipeline_library 1 #define VK_KHR_PIPELINE_LIBRARY_SPEC_VERSION 1 #define VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME "VK_KHR_pipeline_library" @@ -9375,11 +10474,13 @@ typedef struct VkPipelineLibraryCreateInfoKHR { +// VK_KHR_shader_non_semantic_info is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_non_semantic_info 1 #define VK_KHR_SHADER_NON_SEMANTIC_INFO_SPEC_VERSION 1 #define VK_KHR_SHADER_NON_SEMANTIC_INFO_EXTENSION_NAME "VK_KHR_shader_non_semantic_info" +// VK_KHR_present_id is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_present_id 1 #define VK_KHR_PRESENT_ID_SPEC_VERSION 1 #define VK_KHR_PRESENT_ID_EXTENSION_NAME "VK_KHR_present_id" @@ -9398,28 +10499,202 @@ typedef struct VkPhysicalDevicePresentIdFeaturesKHR { -#define VK_KHR_synchronization2 1 -#define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1 -#define VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME "VK_KHR_synchronization2" -typedef VkPipelineStageFlags2 VkPipelineStageFlags2KHR; +// VK_KHR_video_encode_queue is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_encode_queue 1 +#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 12 +#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue" + +typedef enum VkVideoEncodeTuningModeKHR { + VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1, + VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2, + VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3, + VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4, + VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeTuningModeKHR; +typedef VkFlags VkVideoEncodeFlagsKHR; + +typedef enum VkVideoEncodeCapabilityFlagBitsKHR { + VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_CAPABILITY_INSUFFICIENT_BITSTREAM_BUFFER_RANGE_DETECTION_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeCapabilityFlagBitsKHR; +typedef VkFlags VkVideoEncodeCapabilityFlagsKHR; + +typedef enum VkVideoEncodeRateControlModeFlagBitsKHR { + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeRateControlModeFlagBitsKHR; +typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR; + +typedef enum VkVideoEncodeFeedbackFlagBitsKHR { + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeFeedbackFlagBitsKHR; +typedef VkFlags VkVideoEncodeFeedbackFlagsKHR; + +typedef enum VkVideoEncodeUsageFlagBitsKHR { + VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008, + VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeUsageFlagBitsKHR; +typedef VkFlags VkVideoEncodeUsageFlagsKHR; + +typedef enum VkVideoEncodeContentFlagBitsKHR { + VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0, + VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001, + VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002, + VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004, + VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF +} VkVideoEncodeContentFlagBitsKHR; +typedef VkFlags VkVideoEncodeContentFlagsKHR; +typedef VkFlags VkVideoEncodeRateControlFlagsKHR; +typedef struct VkVideoEncodeInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeFlagsKHR flags; + VkBuffer dstBuffer; + VkDeviceSize dstBufferOffset; + VkDeviceSize dstBufferRange; + VkVideoPictureResourceInfoKHR srcPictureResource; + const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot; + uint32_t referenceSlotCount; + const VkVideoReferenceSlotInfoKHR* pReferenceSlots; + uint32_t precedingExternallyEncodedBytes; +} VkVideoEncodeInfoKHR; + +typedef struct VkVideoEncodeCapabilitiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeCapabilityFlagsKHR flags; + VkVideoEncodeRateControlModeFlagsKHR rateControlModes; + uint32_t maxRateControlLayers; + uint64_t maxBitrate; + uint32_t maxQualityLevels; + VkExtent2D encodeInputPictureGranularity; + VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags; +} VkVideoEncodeCapabilitiesKHR; + +typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags; +} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR; -typedef VkPipelineStageFlagBits2 VkPipelineStageFlagBits2KHR; +typedef struct VkVideoEncodeUsageInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeUsageFlagsKHR videoUsageHints; + VkVideoEncodeContentFlagsKHR videoContentHints; + VkVideoEncodeTuningModeKHR tuningMode; +} VkVideoEncodeUsageInfoKHR; -typedef VkAccessFlags2 VkAccessFlags2KHR; +typedef struct VkVideoEncodeRateControlLayerInfoKHR { + VkStructureType sType; + const void* pNext; + uint64_t averageBitrate; + uint64_t maxBitrate; + uint32_t frameRateNumerator; + uint32_t frameRateDenominator; +} VkVideoEncodeRateControlLayerInfoKHR; -typedef VkAccessFlagBits2 VkAccessFlagBits2KHR; +typedef struct VkVideoEncodeRateControlInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoEncodeRateControlFlagsKHR flags; + VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode; + uint32_t layerCount; + const VkVideoEncodeRateControlLayerInfoKHR* pLayers; + uint32_t virtualBufferSizeInMs; + uint32_t initialVirtualBufferSizeInMs; +} VkVideoEncodeRateControlInfoKHR; + +typedef struct VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR { + VkStructureType sType; + const void* pNext; + const VkVideoProfileInfoKHR* pVideoProfile; + uint32_t qualityLevel; +} VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR; -typedef VkSubmitFlagBits VkSubmitFlagBitsKHR; +typedef struct VkVideoEncodeQualityLevelPropertiesKHR { + VkStructureType sType; + void* pNext; + VkVideoEncodeRateControlModeFlagBitsKHR preferredRateControlMode; + uint32_t preferredRateControlLayerCount; +} VkVideoEncodeQualityLevelPropertiesKHR; -typedef VkSubmitFlags VkSubmitFlagsKHR; +typedef struct VkVideoEncodeQualityLevelInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t qualityLevel; +} VkVideoEncodeQualityLevelInfoKHR; -typedef VkMemoryBarrier2 VkMemoryBarrier2KHR; +typedef struct VkVideoEncodeSessionParametersGetInfoKHR { + VkStructureType sType; + const void* pNext; + VkVideoSessionParametersKHR videoSessionParameters; +} VkVideoEncodeSessionParametersGetInfoKHR; -typedef VkBufferMemoryBarrier2 VkBufferMemoryBarrier2KHR; +typedef struct VkVideoEncodeSessionParametersFeedbackInfoKHR { + VkStructureType sType; + void* pNext; + VkBool32 hasOverrides; +} VkVideoEncodeSessionParametersFeedbackInfoKHR; -typedef VkImageMemoryBarrier2 VkImageMemoryBarrier2KHR; +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); +typedef VkResult (VKAPI_PTR *PFN_vkGetEncodedVideoSessionParametersKHR)(VkDevice device, const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, size_t* pDataSize, void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo); -typedef VkDependencyInfo VkDependencyInfoKHR; +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR( + VkPhysicalDevice physicalDevice, + const VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR* pQualityLevelInfo, + VkVideoEncodeQualityLevelPropertiesKHR* pQualityLevelProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetEncodedVideoSessionParametersKHR( + VkDevice device, + const VkVideoEncodeSessionParametersGetInfoKHR* pVideoSessionParametersInfo, + VkVideoEncodeSessionParametersFeedbackInfoKHR* pFeedbackInfo, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR( + VkCommandBuffer commandBuffer, + const VkVideoEncodeInfoKHR* pEncodeInfo); +#endif + + +// VK_KHR_synchronization2 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_synchronization2 1 +#define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1 +#define VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME "VK_KHR_synchronization2" +typedef VkPipelineStageFlags2 VkPipelineStageFlags2KHR; + +typedef VkPipelineStageFlagBits2 VkPipelineStageFlagBits2KHR; + +typedef VkAccessFlags2 VkAccessFlags2KHR; + +typedef VkAccessFlagBits2 VkAccessFlagBits2KHR; + +typedef VkSubmitFlagBits VkSubmitFlagBitsKHR; + +typedef VkSubmitFlags VkSubmitFlagsKHR; + +typedef VkMemoryBarrier2 VkMemoryBarrier2KHR; + +typedef VkBufferMemoryBarrier2 VkBufferMemoryBarrier2KHR; + +typedef VkImageMemoryBarrier2 VkImageMemoryBarrier2KHR; + +typedef VkDependencyInfo VkDependencyInfoKHR; typedef VkSubmitInfo2 VkSubmitInfo2KHR; @@ -9498,6 +10773,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointData2NV( #endif +// VK_KHR_fragment_shader_barycentric is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_fragment_shader_barycentric 1 #define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 #define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_KHR_fragment_shader_barycentric" @@ -9515,6 +10791,7 @@ typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR { +// VK_KHR_shader_subgroup_uniform_control_flow is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_shader_subgroup_uniform_control_flow 1 #define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_SPEC_VERSION 1 #define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME "VK_KHR_shader_subgroup_uniform_control_flow" @@ -9526,6 +10803,7 @@ typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR { +// VK_KHR_zero_initialize_workgroup_memory is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_zero_initialize_workgroup_memory 1 #define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_SPEC_VERSION 1 #define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_EXTENSION_NAME "VK_KHR_zero_initialize_workgroup_memory" @@ -9533,6 +10811,7 @@ typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures VkPhysicalDeviceZe +// VK_KHR_workgroup_memory_explicit_layout is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_workgroup_memory_explicit_layout 1 #define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_SPEC_VERSION 1 #define VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME "VK_KHR_workgroup_memory_explicit_layout" @@ -9547,6 +10826,7 @@ typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR { +// VK_KHR_copy_commands2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_copy_commands2 1 #define VK_KHR_COPY_COMMANDS_2_SPEC_VERSION 1 #define VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME "VK_KHR_copy_commands2" @@ -9606,6 +10886,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage2KHR( #endif +// VK_KHR_format_feature_flags2 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_format_feature_flags2 1 #define VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION 2 #define VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME "VK_KHR_format_feature_flags2" @@ -9617,6 +10898,7 @@ typedef VkFormatProperties3 VkFormatProperties3KHR; +// VK_KHR_ray_tracing_maintenance1 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_ray_tracing_maintenance1 1 #define VK_KHR_RAY_TRACING_MAINTENANCE_1_SPEC_VERSION 1 #define VK_KHR_RAY_TRACING_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_ray_tracing_maintenance1" @@ -9653,11 +10935,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdTraceRaysIndirect2KHR( #endif +// VK_KHR_portability_enumeration is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_portability_enumeration 1 #define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1 #define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration" +// VK_KHR_maintenance4 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_maintenance4 1 #define VK_KHR_MAINTENANCE_4_SPEC_VERSION 2 #define VK_KHR_MAINTENANCE_4_EXTENSION_NAME "VK_KHR_maintenance4" @@ -9692,6 +10976,473 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR( #endif +// VK_KHR_maintenance5 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_maintenance5 1 +#define VK_KHR_MAINTENANCE_5_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE_5_EXTENSION_NAME "VK_KHR_maintenance5" +typedef VkFlags64 VkPipelineCreateFlags2KHR; + +// Flag bits for VkPipelineCreateFlagBits2KHR +typedef VkFlags64 VkPipelineCreateFlagBits2KHR; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISABLE_OPTIMIZATION_BIT_KHR = 0x00000001ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_ALLOW_DERIVATIVES_BIT_KHR = 0x00000002ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DERIVATIVE_BIT_KHR = 0x00000004ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = 0x00000008ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DISPATCH_BASE_BIT_KHR = 0x00000010ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DEFER_COMPILE_BIT_NV = 0x00000020ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_CAPTURE_STATISTICS_BIT_KHR = 0x00000040ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_KHR = 0x00000100ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_EARLY_RETURN_ON_FAILURE_BIT_KHR = 0x00000200ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_LIBRARY_BIT_KHR = 0x00000800ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR = 0x00001000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SKIP_AABBS_BIT_KHR = 0x00002000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR = 0x00020000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR = 0x00080000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_INDIRECT_BINDABLE_BIT_NV = 0x00040000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_OPACITY_MICROMAP_BIT_EXT = 0x01000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x02000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x04000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_NO_PROTECTED_ACCESS_BIT_EXT = 0x08000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_PROTECTED_ACCESS_ONLY_BIT_EXT = 0x40000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_RAY_TRACING_DISPLACEMENT_MICROMAP_BIT_NV = 0x10000000ULL; +static const VkPipelineCreateFlagBits2KHR VK_PIPELINE_CREATE_2_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000ULL; + +typedef VkFlags64 VkBufferUsageFlags2KHR; + +// Flag bits for VkBufferUsageFlagBits2KHR +typedef VkFlags64 VkBufferUsageFlagBits2KHR; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFER_SRC_BIT_KHR = 0x00000001ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFER_DST_BIT_KHR = 0x00000002ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000004ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000008ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_UNIFORM_BUFFER_BIT_KHR = 0x00000010ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_STORAGE_BUFFER_BIT_KHR = 0x00000020ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDEX_BUFFER_BIT_KHR = 0x00000040ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VERTEX_BUFFER_BIT_KHR = 0x00000080ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_INDIRECT_BUFFER_BIT_KHR = 0x00000100ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_EXECUTION_GRAPH_SCRATCH_BIT_AMDX = 0x02000000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_BINDING_TABLE_BIT_KHR = 0x00000400ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RAY_TRACING_BIT_NV = 0x00000400ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHR = 0x00002000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_DECODE_DST_BIT_KHR = 0x00004000ULL; +#ifdef VK_ENABLE_BETA_EXTENSIONS +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHR = 0x00008000ULL; +#endif +#ifdef VK_ENABLE_BETA_EXTENSIONS +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000ULL; +#endif +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SHADER_DEVICE_ADDRESS_BIT_KHR = 0x00020000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR = 0x00080000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR = 0x00100000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000ULL; +static const VkBufferUsageFlagBits2KHR VK_BUFFER_USAGE_2_MICROMAP_STORAGE_BIT_EXT = 0x01000000ULL; + +typedef struct VkPhysicalDeviceMaintenance5FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 maintenance5; +} VkPhysicalDeviceMaintenance5FeaturesKHR; + +typedef struct VkPhysicalDeviceMaintenance5PropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 earlyFragmentMultisampleCoverageAfterSampleCounting; + VkBool32 earlyFragmentSampleMaskTestBeforeSampleCounting; + VkBool32 depthStencilSwizzleOneSupport; + VkBool32 polygonModePointSize; + VkBool32 nonStrictSinglePixelWideLinesUseParallelogram; + VkBool32 nonStrictWideLinesUseParallelogram; +} VkPhysicalDeviceMaintenance5PropertiesKHR; + +typedef struct VkRenderingAreaInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t viewMask; + uint32_t colorAttachmentCount; + const VkFormat* pColorAttachmentFormats; + VkFormat depthAttachmentFormat; + VkFormat stencilAttachmentFormat; +} VkRenderingAreaInfoKHR; + +typedef struct VkImageSubresource2KHR { + VkStructureType sType; + void* pNext; + VkImageSubresource imageSubresource; +} VkImageSubresource2KHR; + +typedef struct VkDeviceImageSubresourceInfoKHR { + VkStructureType sType; + const void* pNext; + const VkImageCreateInfo* pCreateInfo; + const VkImageSubresource2KHR* pSubresource; +} VkDeviceImageSubresourceInfoKHR; + +typedef struct VkSubresourceLayout2KHR { + VkStructureType sType; + void* pNext; + VkSubresourceLayout subresourceLayout; +} VkSubresourceLayout2KHR; + +typedef struct VkPipelineCreateFlags2CreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkPipelineCreateFlags2KHR flags; +} VkPipelineCreateFlags2CreateInfoKHR; + +typedef struct VkBufferUsageFlags2CreateInfoKHR { + VkStructureType sType; + const void* pNext; + VkBufferUsageFlags2KHR usage; +} VkBufferUsageFlags2CreateInfoKHR; + +typedef void (VKAPI_PTR *PFN_vkCmdBindIndexBuffer2KHR)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize size, VkIndexType indexType); +typedef void (VKAPI_PTR *PFN_vkGetRenderingAreaGranularityKHR)(VkDevice device, const VkRenderingAreaInfoKHR* pRenderingAreaInfo, VkExtent2D* pGranularity); +typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSubresourceLayoutKHR)(VkDevice device, const VkDeviceImageSubresourceInfoKHR* pInfo, VkSubresourceLayout2KHR* pLayout); +typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2KHR)(VkDevice device, VkImage image, const VkImageSubresource2KHR* pSubresource, VkSubresourceLayout2KHR* pLayout); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer2KHR( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset, + VkDeviceSize size, + VkIndexType indexType); + +VKAPI_ATTR void VKAPI_CALL vkGetRenderingAreaGranularityKHR( + VkDevice device, + const VkRenderingAreaInfoKHR* pRenderingAreaInfo, + VkExtent2D* pGranularity); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSubresourceLayoutKHR( + VkDevice device, + const VkDeviceImageSubresourceInfoKHR* pInfo, + VkSubresourceLayout2KHR* pLayout); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2KHR( + VkDevice device, + VkImage image, + const VkImageSubresource2KHR* pSubresource, + VkSubresourceLayout2KHR* pLayout); +#endif + + +// VK_KHR_ray_tracing_position_fetch is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_ray_tracing_position_fetch 1 +#define VK_KHR_RAY_TRACING_POSITION_FETCH_SPEC_VERSION 1 +#define VK_KHR_RAY_TRACING_POSITION_FETCH_EXTENSION_NAME "VK_KHR_ray_tracing_position_fetch" +typedef struct VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 rayTracingPositionFetch; +} VkPhysicalDeviceRayTracingPositionFetchFeaturesKHR; + + + +// VK_KHR_cooperative_matrix is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_cooperative_matrix 1 +#define VK_KHR_COOPERATIVE_MATRIX_SPEC_VERSION 2 +#define VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_KHR_cooperative_matrix" + +typedef enum VkComponentTypeKHR { + VK_COMPONENT_TYPE_FLOAT16_KHR = 0, + VK_COMPONENT_TYPE_FLOAT32_KHR = 1, + VK_COMPONENT_TYPE_FLOAT64_KHR = 2, + VK_COMPONENT_TYPE_SINT8_KHR = 3, + VK_COMPONENT_TYPE_SINT16_KHR = 4, + VK_COMPONENT_TYPE_SINT32_KHR = 5, + VK_COMPONENT_TYPE_SINT64_KHR = 6, + VK_COMPONENT_TYPE_UINT8_KHR = 7, + VK_COMPONENT_TYPE_UINT16_KHR = 8, + VK_COMPONENT_TYPE_UINT32_KHR = 9, + VK_COMPONENT_TYPE_UINT64_KHR = 10, + VK_COMPONENT_TYPE_FLOAT16_NV = VK_COMPONENT_TYPE_FLOAT16_KHR, + VK_COMPONENT_TYPE_FLOAT32_NV = VK_COMPONENT_TYPE_FLOAT32_KHR, + VK_COMPONENT_TYPE_FLOAT64_NV = VK_COMPONENT_TYPE_FLOAT64_KHR, + VK_COMPONENT_TYPE_SINT8_NV = VK_COMPONENT_TYPE_SINT8_KHR, + VK_COMPONENT_TYPE_SINT16_NV = VK_COMPONENT_TYPE_SINT16_KHR, + VK_COMPONENT_TYPE_SINT32_NV = VK_COMPONENT_TYPE_SINT32_KHR, + VK_COMPONENT_TYPE_SINT64_NV = VK_COMPONENT_TYPE_SINT64_KHR, + VK_COMPONENT_TYPE_UINT8_NV = VK_COMPONENT_TYPE_UINT8_KHR, + VK_COMPONENT_TYPE_UINT16_NV = VK_COMPONENT_TYPE_UINT16_KHR, + VK_COMPONENT_TYPE_UINT32_NV = VK_COMPONENT_TYPE_UINT32_KHR, + VK_COMPONENT_TYPE_UINT64_NV = VK_COMPONENT_TYPE_UINT64_KHR, + VK_COMPONENT_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkComponentTypeKHR; + +typedef enum VkScopeKHR { + VK_SCOPE_DEVICE_KHR = 1, + VK_SCOPE_WORKGROUP_KHR = 2, + VK_SCOPE_SUBGROUP_KHR = 3, + VK_SCOPE_QUEUE_FAMILY_KHR = 5, + VK_SCOPE_DEVICE_NV = VK_SCOPE_DEVICE_KHR, + VK_SCOPE_WORKGROUP_NV = VK_SCOPE_WORKGROUP_KHR, + VK_SCOPE_SUBGROUP_NV = VK_SCOPE_SUBGROUP_KHR, + VK_SCOPE_QUEUE_FAMILY_NV = VK_SCOPE_QUEUE_FAMILY_KHR, + VK_SCOPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkScopeKHR; +typedef struct VkCooperativeMatrixPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t MSize; + uint32_t NSize; + uint32_t KSize; + VkComponentTypeKHR AType; + VkComponentTypeKHR BType; + VkComponentTypeKHR CType; + VkComponentTypeKHR ResultType; + VkBool32 saturatingAccumulation; + VkScopeKHR scope; +} VkCooperativeMatrixPropertiesKHR; + +typedef struct VkPhysicalDeviceCooperativeMatrixFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 cooperativeMatrix; + VkBool32 cooperativeMatrixRobustBufferAccess; +} VkPhysicalDeviceCooperativeMatrixFeaturesKHR; + +typedef struct VkPhysicalDeviceCooperativeMatrixPropertiesKHR { + VkStructureType sType; + void* pNext; + VkShaderStageFlags cooperativeMatrixSupportedStages; +} VkPhysicalDeviceCooperativeMatrixPropertiesKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR)(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesKHR* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pPropertyCount, + VkCooperativeMatrixPropertiesKHR* pProperties); +#endif + + +// VK_KHR_video_maintenance1 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_video_maintenance1 1 +#define VK_KHR_VIDEO_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_video_maintenance1" +typedef struct VkPhysicalDeviceVideoMaintenance1FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 videoMaintenance1; +} VkPhysicalDeviceVideoMaintenance1FeaturesKHR; + +typedef struct VkVideoInlineQueryInfoKHR { + VkStructureType sType; + const void* pNext; + VkQueryPool queryPool; + uint32_t firstQuery; + uint32_t queryCount; +} VkVideoInlineQueryInfoKHR; + + + +// VK_KHR_vertex_attribute_divisor is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_vertex_attribute_divisor 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 1 +#define VK_KHR_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_KHR_vertex_attribute_divisor" +typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR { + VkStructureType sType; + void* pNext; + uint32_t maxVertexAttribDivisor; + VkBool32 supportsNonZeroFirstInstance; +} VkPhysicalDeviceVertexAttributeDivisorPropertiesKHR; + +typedef struct VkVertexInputBindingDivisorDescriptionKHR { + uint32_t binding; + uint32_t divisor; +} VkVertexInputBindingDivisorDescriptionKHR; + +typedef struct VkPipelineVertexInputDivisorStateCreateInfoKHR { + VkStructureType sType; + const void* pNext; + uint32_t vertexBindingDivisorCount; + const VkVertexInputBindingDivisorDescriptionKHR* pVertexBindingDivisors; +} VkPipelineVertexInputDivisorStateCreateInfoKHR; + +typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 vertexAttributeInstanceRateDivisor; + VkBool32 vertexAttributeInstanceRateZeroDivisor; +} VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR; + + + +// VK_KHR_calibrated_timestamps is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_calibrated_timestamps 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1 +#define VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_KHR_calibrated_timestamps" + +typedef enum VkTimeDomainKHR { + VK_TIME_DOMAIN_DEVICE_KHR = 0, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR = 1, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR = 2, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR = 3, + VK_TIME_DOMAIN_DEVICE_EXT = VK_TIME_DOMAIN_DEVICE_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR, + VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR, + VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_KHR, + VK_TIME_DOMAIN_MAX_ENUM_KHR = 0x7FFFFFFF +} VkTimeDomainKHR; +typedef struct VkCalibratedTimestampInfoKHR { + VkStructureType sType; + const void* pNext; + VkTimeDomainKHR timeDomain; +} VkCalibratedTimestampInfoKHR; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsKHR)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsKHR)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsKHR( + VkPhysicalDevice physicalDevice, + uint32_t* pTimeDomainCount, + VkTimeDomainKHR* pTimeDomains); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsKHR( + VkDevice device, + uint32_t timestampCount, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, + uint64_t* pTimestamps, + uint64_t* pMaxDeviation); +#endif + + +// VK_KHR_maintenance6 is a preprocessor guard. Do not pass it to API calls. +#define VK_KHR_maintenance6 1 +#define VK_KHR_MAINTENANCE_6_SPEC_VERSION 1 +#define VK_KHR_MAINTENANCE_6_EXTENSION_NAME "VK_KHR_maintenance6" +typedef struct VkPhysicalDeviceMaintenance6FeaturesKHR { + VkStructureType sType; + void* pNext; + VkBool32 maintenance6; +} VkPhysicalDeviceMaintenance6FeaturesKHR; + +typedef struct VkPhysicalDeviceMaintenance6PropertiesKHR { + VkStructureType sType; + void* pNext; + VkBool32 blockTexelViewCompatibleMultipleLayers; + uint32_t maxCombinedImageSamplerDescriptorCount; + VkBool32 fragmentShadingRateClampCombinerInputs; +} VkPhysicalDeviceMaintenance6PropertiesKHR; + +typedef struct VkBindMemoryStatusKHR { + VkStructureType sType; + const void* pNext; + VkResult* pResult; +} VkBindMemoryStatusKHR; + +typedef struct VkBindDescriptorSetsInfoKHR { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t firstSet; + uint32_t descriptorSetCount; + const VkDescriptorSet* pDescriptorSets; + uint32_t dynamicOffsetCount; + const uint32_t* pDynamicOffsets; +} VkBindDescriptorSetsInfoKHR; + +typedef struct VkPushConstantsInfoKHR { + VkStructureType sType; + const void* pNext; + VkPipelineLayout layout; + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; + const void* pValues; +} VkPushConstantsInfoKHR; + +typedef struct VkPushDescriptorSetInfoKHR { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t set; + uint32_t descriptorWriteCount; + const VkWriteDescriptorSet* pDescriptorWrites; +} VkPushDescriptorSetInfoKHR; + +typedef struct VkPushDescriptorSetWithTemplateInfoKHR { + VkStructureType sType; + const void* pNext; + VkDescriptorUpdateTemplate descriptorUpdateTemplate; + VkPipelineLayout layout; + uint32_t set; + const void* pData; +} VkPushDescriptorSetWithTemplateInfoKHR; + +typedef struct VkSetDescriptorBufferOffsetsInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t firstSet; + uint32_t setCount; + const uint32_t* pBufferIndices; + const VkDeviceSize* pOffsets; +} VkSetDescriptorBufferOffsetsInfoEXT; + +typedef struct VkBindDescriptorBufferEmbeddedSamplersInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderStageFlags stageFlags; + VkPipelineLayout layout; + uint32_t set; +} VkBindDescriptorBufferEmbeddedSamplersInfoEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorSets2KHR)(VkCommandBuffer commandBuffer, const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushConstants2KHR)(VkCommandBuffer commandBuffer, const VkPushConstantsInfoKHR* pPushConstantsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSet2KHR)(VkCommandBuffer commandBuffer, const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo); +typedef void (VKAPI_PTR *PFN_vkCmdPushDescriptorSetWithTemplate2KHR)(VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo); +typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsets2EXT)(VkCommandBuffer commandBuffer, const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplers2EXT)(VkCommandBuffer commandBuffer, const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets2KHR( + VkCommandBuffer commandBuffer, + const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants2KHR( + VkCommandBuffer commandBuffer, + const VkPushConstantsInfoKHR* pPushConstantsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet2KHR( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2KHR( + VkCommandBuffer commandBuffer, + const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDescriptorBufferOffsets2EXT( + VkCommandBuffer commandBuffer, + const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplers2EXT( + VkCommandBuffer commandBuffer, + const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo); +#endif + + +// VK_EXT_debug_report is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_debug_report 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) #define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10 @@ -9736,6 +11487,8 @@ typedef enum VkDebugReportObjectTypeEXT { VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001, VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000, VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000, + VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_MODULE_NV_EXT = 1000307000, + VK_DEBUG_REPORT_OBJECT_TYPE_CUDA_FUNCTION_NV_EXT = 1000307001, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT = 1000366000, VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, @@ -9799,21 +11552,25 @@ VKAPI_ATTR void VKAPI_CALL vkDebugReportMessageEXT( #endif +// VK_NV_glsl_shader is a preprocessor guard. Do not pass it to API calls. #define VK_NV_glsl_shader 1 #define VK_NV_GLSL_SHADER_SPEC_VERSION 1 #define VK_NV_GLSL_SHADER_EXTENSION_NAME "VK_NV_glsl_shader" +// VK_EXT_depth_range_unrestricted is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_depth_range_unrestricted 1 #define VK_EXT_DEPTH_RANGE_UNRESTRICTED_SPEC_VERSION 1 #define VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME "VK_EXT_depth_range_unrestricted" +// VK_IMG_filter_cubic is a preprocessor guard. Do not pass it to API calls. #define VK_IMG_filter_cubic 1 #define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1 #define VK_IMG_FILTER_CUBIC_EXTENSION_NAME "VK_IMG_filter_cubic" +// VK_AMD_rasterization_order is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_rasterization_order 1 #define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1 #define VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME "VK_AMD_rasterization_order" @@ -9831,16 +11588,19 @@ typedef struct VkPipelineRasterizationStateRasterizationOrderAMD { +// VK_AMD_shader_trinary_minmax is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_trinary_minmax 1 #define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1 #define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax" +// VK_AMD_shader_explicit_vertex_parameter is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_explicit_vertex_parameter 1 #define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1 #define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter" +// VK_EXT_debug_marker is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_debug_marker 1 #define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4 #define VK_EXT_DEBUG_MARKER_EXTENSION_NAME "VK_EXT_debug_marker" @@ -9897,11 +11657,13 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDebugMarkerInsertEXT( #endif +// VK_AMD_gcn_shader is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_gcn_shader 1 #define VK_AMD_GCN_SHADER_SPEC_VERSION 1 #define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader" +// VK_NV_dedicated_allocation is a preprocessor guard. Do not pass it to API calls. #define VK_NV_dedicated_allocation 1 #define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1 #define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation" @@ -9926,6 +11688,7 @@ typedef struct VkDedicatedAllocationMemoryAllocateInfoNV { +// VK_EXT_transform_feedback is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_transform_feedback 1 #define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1 #define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback" @@ -10013,6 +11776,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectByteCountEXT( #endif +// VK_NVX_binary_import is a preprocessor guard. Do not pass it to API calls. #define VK_NVX_binary_import 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX) @@ -10084,6 +11848,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdCuLaunchKernelNVX( #endif +// VK_NVX_image_view_handle is a preprocessor guard. Do not pass it to API calls. #define VK_NVX_image_view_handle 1 #define VK_NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION 2 #define VK_NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME "VK_NVX_image_view_handle" @@ -10117,6 +11882,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetImageViewAddressNVX( #endif +// VK_AMD_draw_indirect_count is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_draw_indirect_count 1 #define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 2 #define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count" @@ -10144,21 +11910,25 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD( #endif +// VK_AMD_negative_viewport_height is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_negative_viewport_height 1 #define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1 #define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height" +// VK_AMD_gpu_shader_half_float is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_gpu_shader_half_float 1 #define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 2 #define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float" +// VK_AMD_shader_ballot is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_ballot 1 #define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1 #define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot" +// VK_AMD_texture_gather_bias_lod is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_texture_gather_bias_lod 1 #define VK_AMD_TEXTURE_GATHER_BIAS_LOD_SPEC_VERSION 1 #define VK_AMD_TEXTURE_GATHER_BIAS_LOD_EXTENSION_NAME "VK_AMD_texture_gather_bias_lod" @@ -10170,6 +11940,7 @@ typedef struct VkTextureLODGatherFormatPropertiesAMD { +// VK_AMD_shader_info is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_info 1 #define VK_AMD_SHADER_INFO_SPEC_VERSION 1 #define VK_AMD_SHADER_INFO_EXTENSION_NAME "VK_AMD_shader_info" @@ -10211,11 +11982,13 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderInfoAMD( #endif +// VK_AMD_shader_image_load_store_lod is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_image_load_store_lod 1 #define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_SPEC_VERSION 1 #define VK_AMD_SHADER_IMAGE_LOAD_STORE_LOD_EXTENSION_NAME "VK_AMD_shader_image_load_store_lod" +// VK_NV_corner_sampled_image is a preprocessor guard. Do not pass it to API calls. #define VK_NV_corner_sampled_image 1 #define VK_NV_CORNER_SAMPLED_IMAGE_SPEC_VERSION 2 #define VK_NV_CORNER_SAMPLED_IMAGE_EXTENSION_NAME "VK_NV_corner_sampled_image" @@ -10227,11 +12000,13 @@ typedef struct VkPhysicalDeviceCornerSampledImageFeaturesNV { +// VK_IMG_format_pvrtc is a preprocessor guard. Do not pass it to API calls. #define VK_IMG_format_pvrtc 1 #define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1 #define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc" +// VK_NV_external_memory_capabilities is a preprocessor guard. Do not pass it to API calls. #define VK_NV_external_memory_capabilities 1 #define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1 #define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities" @@ -10274,6 +12049,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceExternalImageFormatPropertiesN #endif +// VK_NV_external_memory is a preprocessor guard. Do not pass it to API calls. #define VK_NV_external_memory 1 #define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1 #define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory" @@ -10291,8 +12067,9 @@ typedef struct VkExportMemoryAllocateInfoNV { +// VK_EXT_validation_flags is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_flags 1 -#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 2 +#define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 3 #define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags" typedef enum VkValidationCheckEXT { @@ -10309,16 +12086,19 @@ typedef struct VkValidationFlagsEXT { +// VK_EXT_shader_subgroup_ballot is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_subgroup_ballot 1 #define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1 #define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot" +// VK_EXT_shader_subgroup_vote is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_subgroup_vote 1 #define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1 #define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote" +// VK_EXT_texture_compression_astc_hdr is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_texture_compression_astc_hdr 1 #define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_SPEC_VERSION 1 #define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME "VK_EXT_texture_compression_astc_hdr" @@ -10326,6 +12106,7 @@ typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures VkPhysicalDeviceTextur +// VK_EXT_astc_decode_mode is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_astc_decode_mode 1 #define VK_EXT_ASTC_DECODE_MODE_SPEC_VERSION 1 #define VK_EXT_ASTC_DECODE_MODE_EXTENSION_NAME "VK_EXT_astc_decode_mode" @@ -10343,6 +12124,7 @@ typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT { +// VK_EXT_pipeline_robustness is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_pipeline_robustness 1 #define VK_EXT_PIPELINE_ROBUSTNESS_SPEC_VERSION 1 #define VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_pipeline_robustness" @@ -10388,6 +12170,7 @@ typedef struct VkPipelineRobustnessCreateInfoEXT { +// VK_EXT_conditional_rendering is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_conditional_rendering 1 #define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 2 #define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering" @@ -10431,6 +12214,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdEndConditionalRenderingEXT( #endif +// VK_NV_clip_space_w_scaling is a preprocessor guard. Do not pass it to API calls. #define VK_NV_clip_space_w_scaling 1 #define VK_NV_CLIP_SPACE_W_SCALING_SPEC_VERSION 1 #define VK_NV_CLIP_SPACE_W_SCALING_EXTENSION_NAME "VK_NV_clip_space_w_scaling" @@ -10458,6 +12242,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingNV( #endif +// VK_EXT_direct_mode_display is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_direct_mode_display 1 #define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1 #define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display" @@ -10470,6 +12255,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkReleaseDisplayEXT( #endif +// VK_EXT_display_surface_counter is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_display_surface_counter 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1 #define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter" @@ -10506,6 +12292,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilities2EXT( #endif +// VK_EXT_display_control is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_display_control 1 #define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1 #define VK_EXT_DISPLAY_CONTROL_EXTENSION_NAME "VK_EXT_display_control" @@ -10582,6 +12369,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainCounterEXT( #endif +// VK_GOOGLE_display_timing is a preprocessor guard. Do not pass it to API calls. #define VK_GOOGLE_display_timing 1 #define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1 #define VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME "VK_GOOGLE_display_timing" @@ -10626,16 +12414,19 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( #endif +// VK_NV_sample_mask_override_coverage is a preprocessor guard. Do not pass it to API calls. #define VK_NV_sample_mask_override_coverage 1 #define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_SPEC_VERSION 1 #define VK_NV_SAMPLE_MASK_OVERRIDE_COVERAGE_EXTENSION_NAME "VK_NV_sample_mask_override_coverage" +// VK_NV_geometry_shader_passthrough is a preprocessor guard. Do not pass it to API calls. #define VK_NV_geometry_shader_passthrough 1 #define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_SPEC_VERSION 1 #define VK_NV_GEOMETRY_SHADER_PASSTHROUGH_EXTENSION_NAME "VK_NV_geometry_shader_passthrough" +// VK_NV_viewport_array2 is a preprocessor guard. Do not pass it to API calls. #define VK_NV_viewport_array2 1 #define VK_NV_VIEWPORT_ARRAY_2_SPEC_VERSION 1 #define VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME "VK_NV_viewport_array2" @@ -10643,6 +12434,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPastPresentationTimingGOOGLE( #define VK_NV_VIEWPORT_ARRAY2_EXTENSION_NAME VK_NV_VIEWPORT_ARRAY_2_EXTENSION_NAME +// VK_NVX_multiview_per_view_attributes is a preprocessor guard. Do not pass it to API calls. #define VK_NVX_multiview_per_view_attributes 1 #define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION 1 #define VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME "VK_NVX_multiview_per_view_attributes" @@ -10654,6 +12446,7 @@ typedef struct VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { +// VK_NV_viewport_swizzle is a preprocessor guard. Do not pass it to API calls. #define VK_NV_viewport_swizzle 1 #define VK_NV_VIEWPORT_SWIZZLE_SPEC_VERSION 1 #define VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME "VK_NV_viewport_swizzle" @@ -10687,8 +12480,9 @@ typedef struct VkPipelineViewportSwizzleStateCreateInfoNV { +// VK_EXT_discard_rectangles is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_discard_rectangles 1 -#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1 +#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 2 #define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles" typedef enum VkDiscardRectangleModeEXT { @@ -10713,6 +12507,8 @@ typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT { } VkPipelineDiscardRectangleStateCreateInfoEXT; typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 discardRectangleEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleModeEXT)(VkCommandBuffer commandBuffer, VkDiscardRectangleModeEXT discardRectangleMode); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( @@ -10720,9 +12516,18 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEXT( uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 discardRectangleEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDiscardRectangleModeEXT( + VkCommandBuffer commandBuffer, + VkDiscardRectangleModeEXT discardRectangleMode); #endif +// VK_EXT_conservative_rasterization is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_conservative_rasterization 1 #define VK_EXT_CONSERVATIVE_RASTERIZATION_SPEC_VERSION 1 #define VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME "VK_EXT_conservative_rasterization" @@ -10758,6 +12563,7 @@ typedef struct VkPipelineRasterizationConservativeStateCreateInfoEXT { +// VK_EXT_depth_clip_enable is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_depth_clip_enable 1 #define VK_EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION 1 #define VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME "VK_EXT_depth_clip_enable" @@ -10777,11 +12583,13 @@ typedef struct VkPipelineRasterizationDepthClipStateCreateInfoEXT { +// VK_EXT_swapchain_colorspace is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_swapchain_colorspace 1 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION 4 #define VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME "VK_EXT_swapchain_colorspace" +// VK_EXT_hdr_metadata is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_hdr_metadata 1 #define VK_EXT_HDR_METADATA_SPEC_VERSION 2 #define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata" @@ -10814,17 +12622,32 @@ VKAPI_ATTR void VKAPI_CALL vkSetHdrMetadataEXT( #endif +// VK_IMG_relaxed_line_rasterization is a preprocessor guard. Do not pass it to API calls. +#define VK_IMG_relaxed_line_rasterization 1 +#define VK_IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION 1 +#define VK_IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME "VK_IMG_relaxed_line_rasterization" +typedef struct VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG { + VkStructureType sType; + void* pNext; + VkBool32 relaxedLineRasterization; +} VkPhysicalDeviceRelaxedLineRasterizationFeaturesIMG; + + + +// VK_EXT_external_memory_dma_buf is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_external_memory_dma_buf 1 #define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_SPEC_VERSION 1 #define VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME "VK_EXT_external_memory_dma_buf" +// VK_EXT_queue_family_foreign is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_queue_family_foreign 1 #define VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION 1 #define VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME "VK_EXT_queue_family_foreign" #define VK_QUEUE_FAMILY_FOREIGN_EXT (~2U) +// VK_EXT_debug_utils is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_debug_utils 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugUtilsMessengerEXT) #define VK_EXT_DEBUG_UTILS_SPEC_VERSION 2 @@ -10843,6 +12666,7 @@ typedef enum VkDebugUtilsMessageTypeFlagBitsEXT { VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001, VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002, VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004, + VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0x00000008, VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF } VkDebugUtilsMessageTypeFlagBitsEXT; typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT; @@ -10966,6 +12790,7 @@ VKAPI_ATTR void VKAPI_CALL vkSubmitDebugUtilsMessageEXT( #endif +// VK_EXT_sampler_filter_minmax is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_sampler_filter_minmax 1 #define VK_EXT_SAMPLER_FILTER_MINMAX_SPEC_VERSION 2 #define VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME "VK_EXT_sampler_filter_minmax" @@ -10977,21 +12802,25 @@ typedef VkPhysicalDeviceSamplerFilterMinmaxProperties VkPhysicalDeviceSamplerFil +// VK_AMD_gpu_shader_int16 is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_gpu_shader_int16 1 #define VK_AMD_GPU_SHADER_INT16_SPEC_VERSION 2 #define VK_AMD_GPU_SHADER_INT16_EXTENSION_NAME "VK_AMD_gpu_shader_int16" +// VK_AMD_mixed_attachment_samples is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_mixed_attachment_samples 1 #define VK_AMD_MIXED_ATTACHMENT_SAMPLES_SPEC_VERSION 1 #define VK_AMD_MIXED_ATTACHMENT_SAMPLES_EXTENSION_NAME "VK_AMD_mixed_attachment_samples" +// VK_AMD_shader_fragment_mask is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_fragment_mask 1 #define VK_AMD_SHADER_FRAGMENT_MASK_SPEC_VERSION 1 #define VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME "VK_AMD_shader_fragment_mask" +// VK_EXT_inline_uniform_block is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_inline_uniform_block 1 #define VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION 1 #define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block" @@ -11005,11 +12834,13 @@ typedef VkDescriptorPoolInlineUniformBlockCreateInfo VkDescriptorPoolInlineUnifo +// VK_EXT_shader_stencil_export is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_stencil_export 1 #define VK_EXT_SHADER_STENCIL_EXPORT_SPEC_VERSION 1 #define VK_EXT_SHADER_STENCIL_EXPORT_EXTENSION_NAME "VK_EXT_shader_stencil_export" +// VK_EXT_sample_locations is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_sample_locations 1 #define VK_EXT_SAMPLE_LOCATIONS_SPEC_VERSION 1 #define VK_EXT_SAMPLE_LOCATIONS_EXTENSION_NAME "VK_EXT_sample_locations" @@ -11084,6 +12915,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMultisamplePropertiesEXT( #endif +// VK_EXT_blend_operation_advanced is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_blend_operation_advanced 1 #define VK_EXT_BLEND_OPERATION_ADVANCED_SPEC_VERSION 2 #define VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME "VK_EXT_blend_operation_advanced" @@ -11121,6 +12953,7 @@ typedef struct VkPipelineColorBlendAdvancedStateCreateInfoEXT { +// VK_NV_fragment_coverage_to_color is a preprocessor guard. Do not pass it to API calls. #define VK_NV_fragment_coverage_to_color 1 #define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_SPEC_VERSION 1 #define VK_NV_FRAGMENT_COVERAGE_TO_COLOR_EXTENSION_NAME "VK_NV_fragment_coverage_to_color" @@ -11135,6 +12968,7 @@ typedef struct VkPipelineCoverageToColorStateCreateInfoNV { +// VK_NV_framebuffer_mixed_samples is a preprocessor guard. Do not pass it to API calls. #define VK_NV_framebuffer_mixed_samples 1 #define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_SPEC_VERSION 1 #define VK_NV_FRAMEBUFFER_MIXED_SAMPLES_EXTENSION_NAME "VK_NV_framebuffer_mixed_samples" @@ -11159,11 +12993,13 @@ typedef struct VkPipelineCoverageModulationStateCreateInfoNV { +// VK_NV_fill_rectangle is a preprocessor guard. Do not pass it to API calls. #define VK_NV_fill_rectangle 1 #define VK_NV_FILL_RECTANGLE_SPEC_VERSION 1 #define VK_NV_FILL_RECTANGLE_EXTENSION_NAME "VK_NV_fill_rectangle" +// VK_NV_shader_sm_builtins is a preprocessor guard. Do not pass it to API calls. #define VK_NV_shader_sm_builtins 1 #define VK_NV_SHADER_SM_BUILTINS_SPEC_VERSION 1 #define VK_NV_SHADER_SM_BUILTINS_EXTENSION_NAME "VK_NV_shader_sm_builtins" @@ -11182,11 +13018,13 @@ typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV { +// VK_EXT_post_depth_coverage is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_post_depth_coverage 1 #define VK_EXT_POST_DEPTH_COVERAGE_SPEC_VERSION 1 #define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage" +// VK_EXT_image_drm_format_modifier is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_drm_format_modifier 1 #define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 2 #define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier" @@ -11256,6 +13094,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetImageDrmFormatModifierPropertiesEXT( #endif +// VK_EXT_validation_cache is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_cache 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT) #define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1 @@ -11311,6 +13150,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetValidationCacheDataEXT( #endif +// VK_EXT_descriptor_indexing is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_descriptor_indexing 1 #define VK_EXT_DESCRIPTOR_INDEXING_SPEC_VERSION 2 #define VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME "VK_EXT_descriptor_indexing" @@ -11330,11 +13170,13 @@ typedef VkDescriptorSetVariableDescriptorCountLayoutSupport VkDescriptorSetVaria +// VK_EXT_shader_viewport_index_layer is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_viewport_index_layer 1 #define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_SPEC_VERSION 1 #define VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME "VK_EXT_shader_viewport_index_layer" +// VK_NV_shading_rate_image is a preprocessor guard. Do not pass it to API calls. #define VK_NV_shading_rate_image 1 #define VK_NV_SHADING_RATE_IMAGE_SPEC_VERSION 3 #define VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME "VK_NV_shading_rate_image" @@ -11435,6 +13277,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetCoarseSampleOrderNV( #endif +// VK_NV_ray_tracing is a preprocessor guard. Do not pass it to API calls. #define VK_NV_ray_tracing 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV) #define VK_NV_RAY_TRACING_SPEC_VERSION 3 @@ -11513,6 +13356,8 @@ typedef enum VkGeometryInstanceFlagBitsKHR { VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR = 0x00000002, VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR = 0x00000004, VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0x00000008, + VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0x00000010, + VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000020, VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR, VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR, VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR, @@ -11533,6 +13378,13 @@ typedef enum VkBuildAccelerationStructureFlagBitsKHR { VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = 0x00000008, VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR = 0x00000010, VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV = 0x00000020, + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_UPDATE_EXT = 0x00000040, + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000080, + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT = 0x00000100, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DISPLACEMENT_MICROMAP_UPDATE_NV = 0x00000200, +#endif + VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR = 0x00000800, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_NV = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, @@ -11804,6 +13656,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCompileDeferredNV( #endif +// VK_NV_representative_fragment_test is a preprocessor guard. Do not pass it to API calls. #define VK_NV_representative_fragment_test 1 #define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_SPEC_VERSION 2 #define VK_NV_REPRESENTATIVE_FRAGMENT_TEST_EXTENSION_NAME "VK_NV_representative_fragment_test" @@ -11821,6 +13674,7 @@ typedef struct VkPipelineRepresentativeFragmentTestStateCreateInfoNV { +// VK_EXT_filter_cubic is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_filter_cubic 1 #define VK_EXT_FILTER_CUBIC_SPEC_VERSION 3 #define VK_EXT_FILTER_CUBIC_EXTENSION_NAME "VK_EXT_filter_cubic" @@ -11839,11 +13693,13 @@ typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT { +// VK_QCOM_render_pass_shader_resolve is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_render_pass_shader_resolve 1 #define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION 4 #define VK_QCOM_RENDER_PASS_SHADER_RESOLVE_EXTENSION_NAME "VK_QCOM_render_pass_shader_resolve" +// VK_EXT_global_priority is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_global_priority 1 #define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2 #define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority" @@ -11853,6 +13709,7 @@ typedef VkDeviceQueueGlobalPriorityCreateInfoKHR VkDeviceQueueGlobalPriorityCrea +// VK_EXT_external_memory_host is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_external_memory_host 1 #define VK_EXT_EXTERNAL_MEMORY_HOST_SPEC_VERSION 1 #define VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME "VK_EXT_external_memory_host" @@ -11886,6 +13743,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryHostPointerPropertiesEXT( #endif +// VK_AMD_buffer_marker is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_buffer_marker 1 #define VK_AMD_BUFFER_MARKER_SPEC_VERSION 1 #define VK_AMD_BUFFER_MARKER_EXTENSION_NAME "VK_AMD_buffer_marker" @@ -11901,6 +13759,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarkerAMD( #endif +// VK_AMD_pipeline_compiler_control is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_pipeline_compiler_control 1 #define VK_AMD_PIPELINE_COMPILER_CONTROL_SPEC_VERSION 1 #define VK_AMD_PIPELINE_COMPILER_CONTROL_EXTENSION_NAME "VK_AMD_pipeline_compiler_control" @@ -11917,41 +13776,33 @@ typedef struct VkPipelineCompilerControlCreateInfoAMD { +// VK_EXT_calibrated_timestamps is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_calibrated_timestamps 1 #define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 2 #define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps" +typedef VkTimeDomainKHR VkTimeDomainEXT; -typedef enum VkTimeDomainEXT { - VK_TIME_DOMAIN_DEVICE_EXT = 0, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1, - VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2, - VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3, - VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF -} VkTimeDomainEXT; -typedef struct VkCalibratedTimestampInfoEXT { - VkStructureType sType; - const void* pNext; - VkTimeDomainEXT timeDomain; -} VkCalibratedTimestampInfoEXT; +typedef VkCalibratedTimestampInfoKHR VkCalibratedTimestampInfoEXT; -typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains); -typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainKHR* pTimeDomains); +typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #ifndef VK_NO_PROTOTYPES VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, - VkTimeDomainEXT* pTimeDomains); + VkTimeDomainKHR* pTimeDomains); VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, - const VkCalibratedTimestampInfoEXT* pTimestampInfos, + const VkCalibratedTimestampInfoKHR* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #endif +// VK_AMD_shader_core_properties is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_core_properties 1 #define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 2 #define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties" @@ -11976,6 +13827,7 @@ typedef struct VkPhysicalDeviceShaderCorePropertiesAMD { +// VK_AMD_memory_overallocation_behavior is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_memory_overallocation_behavior 1 #define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_SPEC_VERSION 1 #define VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME "VK_AMD_memory_overallocation_behavior" @@ -11994,6 +13846,7 @@ typedef struct VkDeviceMemoryOverallocationCreateInfoAMD { +// VK_EXT_vertex_attribute_divisor is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_vertex_attribute_divisor 1 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 3 #define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor" @@ -12003,27 +13856,15 @@ typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT { uint32_t maxVertexAttribDivisor; } VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; -typedef struct VkVertexInputBindingDivisorDescriptionEXT { - uint32_t binding; - uint32_t divisor; -} VkVertexInputBindingDivisorDescriptionEXT; +typedef VkVertexInputBindingDivisorDescriptionKHR VkVertexInputBindingDivisorDescriptionEXT; -typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT { - VkStructureType sType; - const void* pNext; - uint32_t vertexBindingDivisorCount; - const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors; -} VkPipelineVertexInputDivisorStateCreateInfoEXT; +typedef VkPipelineVertexInputDivisorStateCreateInfoKHR VkPipelineVertexInputDivisorStateCreateInfoEXT; -typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT { - VkStructureType sType; - void* pNext; - VkBool32 vertexAttributeInstanceRateDivisor; - VkBool32 vertexAttributeInstanceRateZeroDivisor; -} VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; +typedef VkPhysicalDeviceVertexAttributeDivisorFeaturesKHR VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; +// VK_EXT_pipeline_creation_feedback is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_pipeline_creation_feedback 1 #define VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION 1 #define VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME "VK_EXT_pipeline_creation_feedback" @@ -12037,11 +13878,13 @@ typedef VkPipelineCreationFeedback VkPipelineCreationFeedbackEXT; +// VK_NV_shader_subgroup_partitioned is a preprocessor guard. Do not pass it to API calls. #define VK_NV_shader_subgroup_partitioned 1 #define VK_NV_SHADER_SUBGROUP_PARTITIONED_SPEC_VERSION 1 #define VK_NV_SHADER_SUBGROUP_PARTITIONED_EXTENSION_NAME "VK_NV_shader_subgroup_partitioned" +// VK_NV_compute_shader_derivatives is a preprocessor guard. Do not pass it to API calls. #define VK_NV_compute_shader_derivatives 1 #define VK_NV_COMPUTE_SHADER_DERIVATIVES_SPEC_VERSION 1 #define VK_NV_COMPUTE_SHADER_DERIVATIVES_EXTENSION_NAME "VK_NV_compute_shader_derivatives" @@ -12054,6 +13897,7 @@ typedef struct VkPhysicalDeviceComputeShaderDerivativesFeaturesNV { +// VK_NV_mesh_shader is a preprocessor guard. Do not pass it to API calls. #define VK_NV_mesh_shader 1 #define VK_NV_MESH_SHADER_SPEC_VERSION 1 #define VK_NV_MESH_SHADER_EXTENSION_NAME "VK_NV_mesh_shader" @@ -12115,6 +13959,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV( #endif +// VK_NV_fragment_shader_barycentric is a preprocessor guard. Do not pass it to API calls. #define VK_NV_fragment_shader_barycentric 1 #define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1 #define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric" @@ -12122,6 +13967,7 @@ typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR VkPhysicalDeviceFra +// VK_NV_shader_image_footprint is a preprocessor guard. Do not pass it to API calls. #define VK_NV_shader_image_footprint 1 #define VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION 2 #define VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME "VK_NV_shader_image_footprint" @@ -12133,8 +13979,9 @@ typedef struct VkPhysicalDeviceShaderImageFootprintFeaturesNV { +// VK_NV_scissor_exclusive is a preprocessor guard. Do not pass it to API calls. #define VK_NV_scissor_exclusive 1 -#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 1 +#define VK_NV_SCISSOR_EXCLUSIVE_SPEC_VERSION 2 #define VK_NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME "VK_NV_scissor_exclusive" typedef struct VkPipelineViewportExclusiveScissorStateCreateInfoNV { VkStructureType sType; @@ -12149,9 +13996,16 @@ typedef struct VkPhysicalDeviceExclusiveScissorFeaturesNV { VkBool32 exclusiveScissor; } VkPhysicalDeviceExclusiveScissorFeaturesNV; +typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorEnableNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32* pExclusiveScissorEnables); typedef void (VKAPI_PTR *PFN_vkCmdSetExclusiveScissorNV)(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); #ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorEnableNV( + VkCommandBuffer commandBuffer, + uint32_t firstExclusiveScissor, + uint32_t exclusiveScissorCount, + const VkBool32* pExclusiveScissorEnables); + VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorNV( VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, @@ -12160,6 +14014,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetExclusiveScissorNV( #endif +// VK_NV_device_diagnostic_checkpoints is a preprocessor guard. Do not pass it to API calls. #define VK_NV_device_diagnostic_checkpoints 1 #define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_SPEC_VERSION 2 #define VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME "VK_NV_device_diagnostic_checkpoints" @@ -12191,6 +14046,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointDataNV( #endif +// VK_INTEL_shader_integer_functions2 is a preprocessor guard. Do not pass it to API calls. #define VK_INTEL_shader_integer_functions2 1 #define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_SPEC_VERSION 1 #define VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME "VK_INTEL_shader_integer_functions2" @@ -12202,6 +14058,7 @@ typedef struct VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL { +// VK_INTEL_performance_query is a preprocessor guard. Do not pass it to API calls. #define VK_INTEL_performance_query 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPerformanceConfigurationINTEL) #define VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION 2 @@ -12340,6 +14197,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPerformanceParameterINTEL( #endif +// VK_EXT_pci_bus_info is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_pci_bus_info 1 #define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 2 #define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info" @@ -12354,6 +14212,7 @@ typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT { +// VK_AMD_display_native_hdr is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_display_native_hdr 1 #define VK_AMD_DISPLAY_NATIVE_HDR_SPEC_VERSION 1 #define VK_AMD_DISPLAY_NATIVE_HDR_EXTENSION_NAME "VK_AMD_display_native_hdr" @@ -12379,6 +14238,7 @@ VKAPI_ATTR void VKAPI_CALL vkSetLocalDimmingAMD( #endif +// VK_EXT_fragment_density_map is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_fragment_density_map 1 #define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 2 #define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map" @@ -12406,6 +14266,7 @@ typedef struct VkRenderPassFragmentDensityMapCreateInfoEXT { +// VK_EXT_scalar_block_layout is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_scalar_block_layout 1 #define VK_EXT_SCALAR_BLOCK_LAYOUT_SPEC_VERSION 1 #define VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME "VK_EXT_scalar_block_layout" @@ -12413,6 +14274,7 @@ typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLay +// VK_GOOGLE_hlsl_functionality1 is a preprocessor guard. Do not pass it to API calls. #define VK_GOOGLE_hlsl_functionality1 1 #define VK_GOOGLE_HLSL_FUNCTIONALITY_1_SPEC_VERSION 1 #define VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1" @@ -12420,11 +14282,13 @@ typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLay #define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME VK_GOOGLE_HLSL_FUNCTIONALITY_1_EXTENSION_NAME +// VK_GOOGLE_decorate_string is a preprocessor guard. Do not pass it to API calls. #define VK_GOOGLE_decorate_string 1 #define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 1 #define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string" +// VK_EXT_subgroup_size_control is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_subgroup_size_control 1 #define VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION 2 #define VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME "VK_EXT_subgroup_size_control" @@ -12436,6 +14300,7 @@ typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStag +// VK_AMD_shader_core_properties2 is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_shader_core_properties2 1 #define VK_AMD_SHADER_CORE_PROPERTIES_2_SPEC_VERSION 1 #define VK_AMD_SHADER_CORE_PROPERTIES_2_EXTENSION_NAME "VK_AMD_shader_core_properties2" @@ -12453,6 +14318,7 @@ typedef struct VkPhysicalDeviceShaderCoreProperties2AMD { +// VK_AMD_device_coherent_memory is a preprocessor guard. Do not pass it to API calls. #define VK_AMD_device_coherent_memory 1 #define VK_AMD_DEVICE_COHERENT_MEMORY_SPEC_VERSION 1 #define VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME "VK_AMD_device_coherent_memory" @@ -12464,6 +14330,7 @@ typedef struct VkPhysicalDeviceCoherentMemoryFeaturesAMD { +// VK_EXT_shader_image_atomic_int64 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_image_atomic_int64 1 #define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION 1 #define VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME "VK_EXT_shader_image_atomic_int64" @@ -12476,6 +14343,7 @@ typedef struct VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT { +// VK_EXT_memory_budget is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_memory_budget 1 #define VK_EXT_MEMORY_BUDGET_SPEC_VERSION 1 #define VK_EXT_MEMORY_BUDGET_EXTENSION_NAME "VK_EXT_memory_budget" @@ -12488,6 +14356,7 @@ typedef struct VkPhysicalDeviceMemoryBudgetPropertiesEXT { +// VK_EXT_memory_priority is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_memory_priority 1 #define VK_EXT_MEMORY_PRIORITY_SPEC_VERSION 1 #define VK_EXT_MEMORY_PRIORITY_EXTENSION_NAME "VK_EXT_memory_priority" @@ -12505,6 +14374,7 @@ typedef struct VkMemoryPriorityAllocateInfoEXT { +// VK_NV_dedicated_allocation_image_aliasing is a preprocessor guard. Do not pass it to API calls. #define VK_NV_dedicated_allocation_image_aliasing 1 #define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_SPEC_VERSION 1 #define VK_NV_DEDICATED_ALLOCATION_IMAGE_ALIASING_EXTENSION_NAME "VK_NV_dedicated_allocation_image_aliasing" @@ -12516,6 +14386,7 @@ typedef struct VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV { +// VK_EXT_buffer_device_address is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_buffer_device_address 1 #define VK_EXT_BUFFER_DEVICE_ADDRESS_SPEC_VERSION 2 #define VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME "VK_EXT_buffer_device_address" @@ -12546,6 +14417,7 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressEXT( #endif +// VK_EXT_tooling_info is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_tooling_info 1 #define VK_EXT_TOOLING_INFO_SPEC_VERSION 1 #define VK_EXT_TOOLING_INFO_EXTENSION_NAME "VK_EXT_tooling_info" @@ -12565,6 +14437,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceToolPropertiesEXT( #endif +// VK_EXT_separate_stencil_usage is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_separate_stencil_usage 1 #define VK_EXT_SEPARATE_STENCIL_USAGE_SPEC_VERSION 1 #define VK_EXT_SEPARATE_STENCIL_USAGE_EXTENSION_NAME "VK_EXT_separate_stencil_usage" @@ -12572,8 +14445,9 @@ typedef VkImageStencilUsageCreateInfo VkImageStencilUsageCreateInfoEXT; +// VK_EXT_validation_features is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_validation_features 1 -#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 5 +#define VK_EXT_VALIDATION_FEATURES_SPEC_VERSION 6 #define VK_EXT_VALIDATION_FEATURES_EXTENSION_NAME "VK_EXT_validation_features" typedef enum VkValidationFeatureEnableEXT { @@ -12607,32 +14481,14 @@ typedef struct VkValidationFeaturesEXT { +// VK_NV_cooperative_matrix is a preprocessor guard. Do not pass it to API calls. #define VK_NV_cooperative_matrix 1 #define VK_NV_COOPERATIVE_MATRIX_SPEC_VERSION 1 #define VK_NV_COOPERATIVE_MATRIX_EXTENSION_NAME "VK_NV_cooperative_matrix" +typedef VkComponentTypeKHR VkComponentTypeNV; + +typedef VkScopeKHR VkScopeNV; -typedef enum VkComponentTypeNV { - VK_COMPONENT_TYPE_FLOAT16_NV = 0, - VK_COMPONENT_TYPE_FLOAT32_NV = 1, - VK_COMPONENT_TYPE_FLOAT64_NV = 2, - VK_COMPONENT_TYPE_SINT8_NV = 3, - VK_COMPONENT_TYPE_SINT16_NV = 4, - VK_COMPONENT_TYPE_SINT32_NV = 5, - VK_COMPONENT_TYPE_SINT64_NV = 6, - VK_COMPONENT_TYPE_UINT8_NV = 7, - VK_COMPONENT_TYPE_UINT16_NV = 8, - VK_COMPONENT_TYPE_UINT32_NV = 9, - VK_COMPONENT_TYPE_UINT64_NV = 10, - VK_COMPONENT_TYPE_MAX_ENUM_NV = 0x7FFFFFFF -} VkComponentTypeNV; - -typedef enum VkScopeNV { - VK_SCOPE_DEVICE_NV = 1, - VK_SCOPE_WORKGROUP_NV = 2, - VK_SCOPE_SUBGROUP_NV = 3, - VK_SCOPE_QUEUE_FAMILY_NV = 5, - VK_SCOPE_MAX_ENUM_NV = 0x7FFFFFFF -} VkScopeNV; typedef struct VkCooperativeMatrixPropertiesNV { VkStructureType sType; void* pNext; @@ -12669,6 +14525,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( #endif +// VK_NV_coverage_reduction_mode is a preprocessor guard. Do not pass it to API calls. #define VK_NV_coverage_reduction_mode 1 #define VK_NV_COVERAGE_REDUCTION_MODE_SPEC_VERSION 1 #define VK_NV_COVERAGE_REDUCTION_MODE_EXTENSION_NAME "VK_NV_coverage_reduction_mode" @@ -12711,6 +14568,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSupportedFramebufferMixedSampl #endif +// VK_EXT_fragment_shader_interlock is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_fragment_shader_interlock 1 #define VK_EXT_FRAGMENT_SHADER_INTERLOCK_SPEC_VERSION 1 #define VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME "VK_EXT_fragment_shader_interlock" @@ -12724,6 +14582,7 @@ typedef struct VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT { +// VK_EXT_ycbcr_image_arrays is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_ycbcr_image_arrays 1 #define VK_EXT_YCBCR_IMAGE_ARRAYS_SPEC_VERSION 1 #define VK_EXT_YCBCR_IMAGE_ARRAYS_EXTENSION_NAME "VK_EXT_ycbcr_image_arrays" @@ -12735,6 +14594,7 @@ typedef struct VkPhysicalDeviceYcbcrImageArraysFeaturesEXT { +// VK_EXT_provoking_vertex is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_provoking_vertex 1 #define VK_EXT_PROVOKING_VERTEX_SPEC_VERSION 1 #define VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME "VK_EXT_provoking_vertex" @@ -12766,6 +14626,7 @@ typedef struct VkPipelineRasterizationProvokingVertexStateCreateInfoEXT { +// VK_EXT_headless_surface is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_headless_surface 1 #define VK_EXT_HEADLESS_SURFACE_SPEC_VERSION 1 #define VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME "VK_EXT_headless_surface" @@ -12787,6 +14648,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateHeadlessSurfaceEXT( #endif +// VK_EXT_line_rasterization is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_line_rasterization 1 #define VK_EXT_LINE_RASTERIZATION_SPEC_VERSION 1 #define VK_EXT_LINE_RASTERIZATION_EXTENSION_NAME "VK_EXT_line_rasterization" @@ -12834,6 +14696,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEXT( #endif +// VK_EXT_shader_atomic_float is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_atomic_float 1 #define VK_EXT_SHADER_ATOMIC_FLOAT_SPEC_VERSION 1 #define VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME "VK_EXT_shader_atomic_float" @@ -12856,6 +14719,7 @@ typedef struct VkPhysicalDeviceShaderAtomicFloatFeaturesEXT { +// VK_EXT_host_query_reset is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_host_query_reset 1 #define VK_EXT_HOST_QUERY_RESET_SPEC_VERSION 1 #define VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME "VK_EXT_host_query_reset" @@ -12872,6 +14736,7 @@ VKAPI_ATTR void VKAPI_CALL vkResetQueryPoolEXT( #endif +// VK_EXT_index_type_uint8 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_index_type_uint8 1 #define VK_EXT_INDEX_TYPE_UINT8_SPEC_VERSION 1 #define VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME "VK_EXT_index_type_uint8" @@ -12883,6 +14748,7 @@ typedef struct VkPhysicalDeviceIndexTypeUint8FeaturesEXT { +// VK_EXT_extended_dynamic_state is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_extended_dynamic_state 1 #define VK_EXT_EXTENDED_DYNAMIC_STATE_SPEC_VERSION 1 #define VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_extended_dynamic_state" @@ -12967,36 +14833,279 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilOpEXT( #endif -#define VK_EXT_shader_atomic_float2 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION 1 -#define VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME "VK_EXT_shader_atomic_float2" -typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT { +// VK_EXT_host_image_copy is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_host_image_copy 1 +#define VK_EXT_HOST_IMAGE_COPY_SPEC_VERSION 1 +#define VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME "VK_EXT_host_image_copy" + +typedef enum VkHostImageCopyFlagBitsEXT { + VK_HOST_IMAGE_COPY_MEMCPY_EXT = 0x00000001, + VK_HOST_IMAGE_COPY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkHostImageCopyFlagBitsEXT; +typedef VkFlags VkHostImageCopyFlagsEXT; +typedef struct VkPhysicalDeviceHostImageCopyFeaturesEXT { VkStructureType sType; void* pNext; - VkBool32 shaderBufferFloat16Atomics; - VkBool32 shaderBufferFloat16AtomicAdd; - VkBool32 shaderBufferFloat16AtomicMinMax; - VkBool32 shaderBufferFloat32AtomicMinMax; - VkBool32 shaderBufferFloat64AtomicMinMax; - VkBool32 shaderSharedFloat16Atomics; - VkBool32 shaderSharedFloat16AtomicAdd; - VkBool32 shaderSharedFloat16AtomicMinMax; - VkBool32 shaderSharedFloat32AtomicMinMax; - VkBool32 shaderSharedFloat64AtomicMinMax; - VkBool32 shaderImageFloat32AtomicMinMax; - VkBool32 sparseImageFloat32AtomicMinMax; -} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; - - - -#define VK_EXT_shader_demote_to_helper_invocation 1 -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION 1 -#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME "VK_EXT_shader_demote_to_helper_invocation" -typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; + VkBool32 hostImageCopy; +} VkPhysicalDeviceHostImageCopyFeaturesEXT; +typedef struct VkPhysicalDeviceHostImageCopyPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t copySrcLayoutCount; + VkImageLayout* pCopySrcLayouts; + uint32_t copyDstLayoutCount; + VkImageLayout* pCopyDstLayouts; + uint8_t optimalTilingLayoutUUID[VK_UUID_SIZE]; + VkBool32 identicalMemoryTypeRequirements; +} VkPhysicalDeviceHostImageCopyPropertiesEXT; + +typedef struct VkMemoryToImageCopyEXT { + VkStructureType sType; + const void* pNext; + const void* pHostPointer; + uint32_t memoryRowLength; + uint32_t memoryImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkMemoryToImageCopyEXT; +typedef struct VkImageToMemoryCopyEXT { + VkStructureType sType; + const void* pNext; + void* pHostPointer; + uint32_t memoryRowLength; + uint32_t memoryImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkImageToMemoryCopyEXT; -#define VK_NV_device_generated_commands 1 +typedef struct VkCopyMemoryToImageInfoEXT { + VkStructureType sType; + const void* pNext; + VkHostImageCopyFlagsEXT flags; + VkImage dstImage; + VkImageLayout dstImageLayout; + uint32_t regionCount; + const VkMemoryToImageCopyEXT* pRegions; +} VkCopyMemoryToImageInfoEXT; + +typedef struct VkCopyImageToMemoryInfoEXT { + VkStructureType sType; + const void* pNext; + VkHostImageCopyFlagsEXT flags; + VkImage srcImage; + VkImageLayout srcImageLayout; + uint32_t regionCount; + const VkImageToMemoryCopyEXT* pRegions; +} VkCopyImageToMemoryInfoEXT; + +typedef struct VkCopyImageToImageInfoEXT { + VkStructureType sType; + const void* pNext; + VkHostImageCopyFlagsEXT flags; + VkImage srcImage; + VkImageLayout srcImageLayout; + VkImage dstImage; + VkImageLayout dstImageLayout; + uint32_t regionCount; + const VkImageCopy2* pRegions; +} VkCopyImageToImageInfoEXT; + +typedef struct VkHostImageLayoutTransitionInfoEXT { + VkStructureType sType; + const void* pNext; + VkImage image; + VkImageLayout oldLayout; + VkImageLayout newLayout; + VkImageSubresourceRange subresourceRange; +} VkHostImageLayoutTransitionInfoEXT; + +typedef struct VkSubresourceHostMemcpySizeEXT { + VkStructureType sType; + void* pNext; + VkDeviceSize size; +} VkSubresourceHostMemcpySizeEXT; + +typedef struct VkHostImageCopyDevicePerformanceQueryEXT { + VkStructureType sType; + void* pNext; + VkBool32 optimalDeviceAccess; + VkBool32 identicalMemoryLayout; +} VkHostImageCopyDevicePerformanceQueryEXT; + +typedef VkSubresourceLayout2KHR VkSubresourceLayout2EXT; + +typedef VkImageSubresource2KHR VkImageSubresource2EXT; + +typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToImageEXT)(VkDevice device, const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToMemoryEXT)(VkDevice device, const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCopyImageToImageEXT)(VkDevice device, const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo); +typedef VkResult (VKAPI_PTR *PFN_vkTransitionImageLayoutEXT)(VkDevice device, uint32_t transitionCount, const VkHostImageLayoutTransitionInfoEXT* pTransitions); +typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2EXT)(VkDevice device, VkImage image, const VkImageSubresource2KHR* pSubresource, VkSubresourceLayout2KHR* pLayout); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCopyMemoryToImageEXT( + VkDevice device, + const VkCopyMemoryToImageInfoEXT* pCopyMemoryToImageInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToMemoryEXT( + VkDevice device, + const VkCopyImageToMemoryInfoEXT* pCopyImageToMemoryInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToImageEXT( + VkDevice device, + const VkCopyImageToImageInfoEXT* pCopyImageToImageInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkTransitionImageLayoutEXT( + VkDevice device, + uint32_t transitionCount, + const VkHostImageLayoutTransitionInfoEXT* pTransitions); + +VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2EXT( + VkDevice device, + VkImage image, + const VkImageSubresource2KHR* pSubresource, + VkSubresourceLayout2KHR* pLayout); +#endif + + +// VK_EXT_shader_atomic_float2 is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_shader_atomic_float2 1 +#define VK_EXT_SHADER_ATOMIC_FLOAT_2_SPEC_VERSION 1 +#define VK_EXT_SHADER_ATOMIC_FLOAT_2_EXTENSION_NAME "VK_EXT_shader_atomic_float2" +typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderBufferFloat16Atomics; + VkBool32 shaderBufferFloat16AtomicAdd; + VkBool32 shaderBufferFloat16AtomicMinMax; + VkBool32 shaderBufferFloat32AtomicMinMax; + VkBool32 shaderBufferFloat64AtomicMinMax; + VkBool32 shaderSharedFloat16Atomics; + VkBool32 shaderSharedFloat16AtomicAdd; + VkBool32 shaderSharedFloat16AtomicMinMax; + VkBool32 shaderSharedFloat32AtomicMinMax; + VkBool32 shaderSharedFloat64AtomicMinMax; + VkBool32 shaderImageFloat32AtomicMinMax; + VkBool32 sparseImageFloat32AtomicMinMax; +} VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; + + + +// VK_EXT_surface_maintenance1 is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_surface_maintenance1 1 +#define VK_EXT_SURFACE_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_surface_maintenance1" + +typedef enum VkPresentScalingFlagBitsEXT { + VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT = 0x00000001, + VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0x00000002, + VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0x00000004, + VK_PRESENT_SCALING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkPresentScalingFlagBitsEXT; +typedef VkFlags VkPresentScalingFlagsEXT; + +typedef enum VkPresentGravityFlagBitsEXT { + VK_PRESENT_GRAVITY_MIN_BIT_EXT = 0x00000001, + VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0x00000002, + VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0x00000004, + VK_PRESENT_GRAVITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkPresentGravityFlagBitsEXT; +typedef VkFlags VkPresentGravityFlagsEXT; +typedef struct VkSurfacePresentModeEXT { + VkStructureType sType; + void* pNext; + VkPresentModeKHR presentMode; +} VkSurfacePresentModeEXT; + +typedef struct VkSurfacePresentScalingCapabilitiesEXT { + VkStructureType sType; + void* pNext; + VkPresentScalingFlagsEXT supportedPresentScaling; + VkPresentGravityFlagsEXT supportedPresentGravityX; + VkPresentGravityFlagsEXT supportedPresentGravityY; + VkExtent2D minScaledImageExtent; + VkExtent2D maxScaledImageExtent; +} VkSurfacePresentScalingCapabilitiesEXT; + +typedef struct VkSurfacePresentModeCompatibilityEXT { + VkStructureType sType; + void* pNext; + uint32_t presentModeCount; + VkPresentModeKHR* pPresentModes; +} VkSurfacePresentModeCompatibilityEXT; + + + +// VK_EXT_swapchain_maintenance1 is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_swapchain_maintenance1 1 +#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_SPEC_VERSION 1 +#define VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME "VK_EXT_swapchain_maintenance1" +typedef struct VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 swapchainMaintenance1; +} VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT; + +typedef struct VkSwapchainPresentFenceInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkFence* pFences; +} VkSwapchainPresentFenceInfoEXT; + +typedef struct VkSwapchainPresentModesCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t presentModeCount; + const VkPresentModeKHR* pPresentModes; +} VkSwapchainPresentModesCreateInfoEXT; + +typedef struct VkSwapchainPresentModeInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t swapchainCount; + const VkPresentModeKHR* pPresentModes; +} VkSwapchainPresentModeInfoEXT; + +typedef struct VkSwapchainPresentScalingCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkPresentScalingFlagsEXT scalingBehavior; + VkPresentGravityFlagsEXT presentGravityX; + VkPresentGravityFlagsEXT presentGravityY; +} VkSwapchainPresentScalingCreateInfoEXT; + +typedef struct VkReleaseSwapchainImagesInfoEXT { + VkStructureType sType; + const void* pNext; + VkSwapchainKHR swapchain; + uint32_t imageIndexCount; + const uint32_t* pImageIndices; +} VkReleaseSwapchainImagesInfoEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkReleaseSwapchainImagesEXT)(VkDevice device, const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkReleaseSwapchainImagesEXT( + VkDevice device, + const VkReleaseSwapchainImagesInfoEXT* pReleaseInfo); +#endif + + +// VK_EXT_shader_demote_to_helper_invocation is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_shader_demote_to_helper_invocation 1 +#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_SPEC_VERSION 1 +#define VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME "VK_EXT_shader_demote_to_helper_invocation" +typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT; + + + +// VK_NV_device_generated_commands is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_device_generated_commands 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkIndirectCommandsLayoutNV) #define VK_NV_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 3 #define VK_NV_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NV_device_generated_commands" @@ -13011,6 +15120,8 @@ typedef enum VkIndirectCommandsTokenTypeNV { VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV = 6, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV = 7, VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV = 1000328000, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_PIPELINE_NV = 1000428003, + VK_INDIRECT_COMMANDS_TOKEN_TYPE_DISPATCH_NV = 1000428004, VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NV = 0x7FFFFFFF } VkIndirectCommandsTokenTypeNV; @@ -13187,6 +15298,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyIndirectCommandsLayoutNV( #endif +// VK_NV_inherited_viewport_scissor is a preprocessor guard. Do not pass it to API calls. #define VK_NV_inherited_viewport_scissor 1 #define VK_NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION 1 #define VK_NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME "VK_NV_inherited_viewport_scissor" @@ -13206,6 +15318,7 @@ typedef struct VkCommandBufferInheritanceViewportScissorInfoNV { +// VK_EXT_texel_buffer_alignment is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_texel_buffer_alignment 1 #define VK_EXT_TEXEL_BUFFER_ALIGNMENT_SPEC_VERSION 1 #define VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME "VK_EXT_texel_buffer_alignment" @@ -13219,8 +15332,9 @@ typedef VkPhysicalDeviceTexelBufferAlignmentProperties VkPhysicalDeviceTexelBuff +// VK_QCOM_render_pass_transform is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_render_pass_transform 1 -#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 3 +#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 4 #define VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME "VK_QCOM_render_pass_transform" typedef struct VkRenderPassTransformBeginInfoQCOM { VkStructureType sType; @@ -13237,6 +15351,51 @@ typedef struct VkCommandBufferInheritanceRenderPassTransformInfoQCOM { +// VK_EXT_depth_bias_control is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_depth_bias_control 1 +#define VK_EXT_DEPTH_BIAS_CONTROL_SPEC_VERSION 1 +#define VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME "VK_EXT_depth_bias_control" + +typedef enum VkDepthBiasRepresentationEXT { + VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORMAT_EXT = 0, + VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT = 1, + VK_DEPTH_BIAS_REPRESENTATION_FLOAT_EXT = 2, + VK_DEPTH_BIAS_REPRESENTATION_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDepthBiasRepresentationEXT; +typedef struct VkPhysicalDeviceDepthBiasControlFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 depthBiasControl; + VkBool32 leastRepresentableValueForceUnormRepresentation; + VkBool32 floatRepresentation; + VkBool32 depthBiasExact; +} VkPhysicalDeviceDepthBiasControlFeaturesEXT; + +typedef struct VkDepthBiasInfoEXT { + VkStructureType sType; + const void* pNext; + float depthBiasConstantFactor; + float depthBiasClamp; + float depthBiasSlopeFactor; +} VkDepthBiasInfoEXT; + +typedef struct VkDepthBiasRepresentationInfoEXT { + VkStructureType sType; + const void* pNext; + VkDepthBiasRepresentationEXT depthBiasRepresentation; + VkBool32 depthBiasExact; +} VkDepthBiasRepresentationInfoEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBias2EXT)(VkCommandBuffer commandBuffer, const VkDepthBiasInfoEXT* pDepthBiasInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBias2EXT( + VkCommandBuffer commandBuffer, + const VkDepthBiasInfoEXT* pDepthBiasInfo); +#endif + + +// VK_EXT_device_memory_report is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_device_memory_report 1 #define VK_EXT_DEVICE_MEMORY_REPORT_SPEC_VERSION 2 #define VK_EXT_DEVICE_MEMORY_REPORT_EXTENSION_NAME "VK_EXT_device_memory_report" @@ -13282,6 +15441,7 @@ typedef struct VkDeviceDeviceMemoryReportCreateInfoEXT { +// VK_EXT_acquire_drm_display is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_acquire_drm_display 1 #define VK_EXT_ACQUIRE_DRM_DISPLAY_SPEC_VERSION 1 #define VK_EXT_ACQUIRE_DRM_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_drm_display" @@ -13302,6 +15462,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDrmDisplayEXT( #endif +// VK_EXT_robustness2 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_robustness2 1 #define VK_EXT_ROBUSTNESS_2_SPEC_VERSION 1 #define VK_EXT_ROBUSTNESS_2_EXTENSION_NAME "VK_EXT_robustness2" @@ -13322,6 +15483,7 @@ typedef struct VkPhysicalDeviceRobustness2PropertiesEXT { +// VK_EXT_custom_border_color is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_custom_border_color 1 #define VK_EXT_CUSTOM_BORDER_COLOR_SPEC_VERSION 12 #define VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME "VK_EXT_custom_border_color" @@ -13347,11 +15509,37 @@ typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT { +// VK_GOOGLE_user_type is a preprocessor guard. Do not pass it to API calls. #define VK_GOOGLE_user_type 1 #define VK_GOOGLE_USER_TYPE_SPEC_VERSION 1 #define VK_GOOGLE_USER_TYPE_EXTENSION_NAME "VK_GOOGLE_user_type" +// VK_NV_present_barrier is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_present_barrier 1 +#define VK_NV_PRESENT_BARRIER_SPEC_VERSION 1 +#define VK_NV_PRESENT_BARRIER_EXTENSION_NAME "VK_NV_present_barrier" +typedef struct VkPhysicalDevicePresentBarrierFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 presentBarrier; +} VkPhysicalDevicePresentBarrierFeaturesNV; + +typedef struct VkSurfaceCapabilitiesPresentBarrierNV { + VkStructureType sType; + void* pNext; + VkBool32 presentBarrierSupported; +} VkSurfaceCapabilitiesPresentBarrierNV; + +typedef struct VkSwapchainPresentBarrierCreateInfoNV { + VkStructureType sType; + void* pNext; + VkBool32 presentBarrierEnable; +} VkSwapchainPresentBarrierCreateInfoNV; + + + +// VK_EXT_private_data is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_private_data 1 typedef VkPrivateDataSlot VkPrivateDataSlotEXT; @@ -13398,6 +15586,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPrivateDataEXT( #endif +// VK_EXT_pipeline_creation_cache_control is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_pipeline_creation_cache_control 1 #define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION 3 #define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME "VK_EXT_pipeline_creation_cache_control" @@ -13405,6 +15594,7 @@ typedef VkPhysicalDevicePipelineCreationCacheControlFeatures VkPhysicalDevicePip +// VK_NV_device_diagnostics_config is a preprocessor guard. Do not pass it to API calls. #define VK_NV_device_diagnostics_config 1 #define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION 2 #define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME "VK_NV_device_diagnostics_config" @@ -13431,113 +15621,435 @@ typedef struct VkDeviceDiagnosticsConfigCreateInfoNV { +// VK_QCOM_render_pass_store_ops is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_render_pass_store_ops 1 #define VK_QCOM_RENDER_PASS_STORE_OPS_SPEC_VERSION 2 #define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops" -#define VK_EXT_graphics_pipeline_library 1 -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION 1 -#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME "VK_EXT_graphics_pipeline_library" +// VK_NV_cuda_kernel_launch is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_cuda_kernel_launch 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV) +#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2 +#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch" +typedef struct VkCudaModuleCreateInfoNV { + VkStructureType sType; + const void* pNext; + size_t dataSize; + const void* pData; +} VkCudaModuleCreateInfoNV; -typedef enum VkGraphicsPipelineLibraryFlagBitsEXT { - VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0x00000001, - VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0x00000002, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0x00000004, - VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0x00000008, - VK_GRAPHICS_PIPELINE_LIBRARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF -} VkGraphicsPipelineLibraryFlagBitsEXT; -typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT { +typedef struct VkCudaFunctionCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkCudaModuleNV module; + const char* pName; +} VkCudaFunctionCreateInfoNV; + +typedef struct VkCudaLaunchInfoNV { + VkStructureType sType; + const void* pNext; + VkCudaFunctionNV function; + uint32_t gridDimX; + uint32_t gridDimY; + uint32_t gridDimZ; + uint32_t blockDimX; + uint32_t blockDimY; + uint32_t blockDimZ; + uint32_t sharedMemBytes; + size_t paramCount; + const void* const * pParams; + size_t extraCount; + const void* const * pExtras; +} VkCudaLaunchInfoNV; + +typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV { VkStructureType sType; void* pNext; - VkBool32 graphicsPipelineLibrary; -} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; + VkBool32 cudaKernelLaunchFeatures; +} VkPhysicalDeviceCudaKernelLaunchFeaturesNV; -typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT { +typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV { VkStructureType sType; void* pNext; - VkBool32 graphicsPipelineLibraryFastLinking; - VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; -} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; + uint32_t computeCapabilityMinor; + uint32_t computeCapabilityMajor; +} VkPhysicalDeviceCudaKernelLaunchPropertiesNV; -typedef struct VkGraphicsPipelineLibraryCreateInfoEXT { - VkStructureType sType; - void* pNext; - VkGraphicsPipelineLibraryFlagsEXT flags; -} VkGraphicsPipelineLibraryCreateInfoEXT; +typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice device, const VkCudaModuleCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule); +typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice device, VkCudaModuleNV module, size_t* pCacheSize, void* pCacheData); +typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice device, const VkCudaFunctionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction); +typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo); +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaModuleNV( + VkDevice device, + const VkCudaModuleCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCudaModuleNV* pModule); +VKAPI_ATTR VkResult VKAPI_CALL vkGetCudaModuleCacheNV( + VkDevice device, + VkCudaModuleNV module, + size_t* pCacheSize, + void* pCacheData); -#define VK_AMD_shader_early_and_late_fragment_tests 1 -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_SPEC_VERSION 1 -#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_EXTENSION_NAME "VK_AMD_shader_early_and_late_fragment_tests" -typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD { - VkStructureType sType; - void* pNext; - VkBool32 shaderEarlyAndLateFragmentTests; -} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; +VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaFunctionNV( + VkDevice device, + const VkCudaFunctionCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkCudaFunctionNV* pFunction); +VKAPI_ATTR void VKAPI_CALL vkDestroyCudaModuleNV( + VkDevice device, + VkCudaModuleNV module, + const VkAllocationCallbacks* pAllocator); +VKAPI_ATTR void VKAPI_CALL vkDestroyCudaFunctionNV( + VkDevice device, + VkCudaFunctionNV function, + const VkAllocationCallbacks* pAllocator); -#define VK_NV_fragment_shading_rate_enums 1 -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION 1 -#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME "VK_NV_fragment_shading_rate_enums" +VKAPI_ATTR void VKAPI_CALL vkCmdCudaLaunchKernelNV( + VkCommandBuffer commandBuffer, + const VkCudaLaunchInfoNV* pLaunchInfo); +#endif -typedef enum VkFragmentShadingRateTypeNV { - VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV = 0, - VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV = 1, - VK_FRAGMENT_SHADING_RATE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF -} VkFragmentShadingRateTypeNV; -typedef enum VkFragmentShadingRateNV { - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 1, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 4, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 5, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 6, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 9, - VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 10, - VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 11, - VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 12, - VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 13, - VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 14, - VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV = 15, - VK_FRAGMENT_SHADING_RATE_MAX_ENUM_NV = 0x7FFFFFFF -} VkFragmentShadingRateNV; -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV { +// VK_NV_low_latency is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_low_latency 1 +#define VK_NV_LOW_LATENCY_SPEC_VERSION 1 +#define VK_NV_LOW_LATENCY_EXTENSION_NAME "VK_NV_low_latency" +typedef struct VkQueryLowLatencySupportNV { VkStructureType sType; - void* pNext; - VkBool32 fragmentShadingRateEnums; - VkBool32 supersampleFragmentShadingRates; - VkBool32 noInvocationFragmentShadingRates; -} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV; + const void* pNext; + void* pQueriedLowLatencyData; +} VkQueryLowLatencySupportNV; -typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV { - VkStructureType sType; - void* pNext; - VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; -} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV; -typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV { - VkStructureType sType; - const void* pNext; - VkFragmentShadingRateTypeNV shadingRateType; - VkFragmentShadingRateNV shadingRate; - VkFragmentShadingRateCombinerOpKHR combinerOps[2]; -} VkPipelineFragmentShadingRateEnumStateCreateInfoNV; -typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateEnumNV)(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); +// VK_EXT_descriptor_buffer is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_descriptor_buffer 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) +#define VK_EXT_DESCRIPTOR_BUFFER_SPEC_VERSION 1 +#define VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME "VK_EXT_descriptor_buffer" +typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 combinedImageSamplerDescriptorSingleArray; + VkBool32 bufferlessPushDescriptors; + VkBool32 allowSamplerImageViewPostSubmitCreation; + VkDeviceSize descriptorBufferOffsetAlignment; + uint32_t maxDescriptorBufferBindings; + uint32_t maxResourceDescriptorBufferBindings; + uint32_t maxSamplerDescriptorBufferBindings; + uint32_t maxEmbeddedImmutableSamplerBindings; + uint32_t maxEmbeddedImmutableSamplers; + size_t bufferCaptureReplayDescriptorDataSize; + size_t imageCaptureReplayDescriptorDataSize; + size_t imageViewCaptureReplayDescriptorDataSize; + size_t samplerCaptureReplayDescriptorDataSize; + size_t accelerationStructureCaptureReplayDescriptorDataSize; + size_t samplerDescriptorSize; + size_t combinedImageSamplerDescriptorSize; + size_t sampledImageDescriptorSize; + size_t storageImageDescriptorSize; + size_t uniformTexelBufferDescriptorSize; + size_t robustUniformTexelBufferDescriptorSize; + size_t storageTexelBufferDescriptorSize; + size_t robustStorageTexelBufferDescriptorSize; + size_t uniformBufferDescriptorSize; + size_t robustUniformBufferDescriptorSize; + size_t storageBufferDescriptorSize; + size_t robustStorageBufferDescriptorSize; + size_t inputAttachmentDescriptorSize; + size_t accelerationStructureDescriptorSize; + VkDeviceSize maxSamplerDescriptorBufferRange; + VkDeviceSize maxResourceDescriptorBufferRange; + VkDeviceSize samplerDescriptorBufferAddressSpaceSize; + VkDeviceSize resourceDescriptorBufferAddressSpaceSize; + VkDeviceSize descriptorBufferAddressSpaceSize; +} VkPhysicalDeviceDescriptorBufferPropertiesEXT; + +typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT { + VkStructureType sType; + void* pNext; + size_t combinedImageSamplerDensityMapDescriptorSize; +} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT; -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkCmdSetFragmentShadingRateEnumNV( - VkCommandBuffer commandBuffer, - VkFragmentShadingRateNV shadingRate, - const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); -#endif +typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 descriptorBuffer; + VkBool32 descriptorBufferCaptureReplay; + VkBool32 descriptorBufferImageLayoutIgnored; + VkBool32 descriptorBufferPushDescriptors; +} VkPhysicalDeviceDescriptorBufferFeaturesEXT; +typedef struct VkDescriptorAddressInfoEXT { + VkStructureType sType; + void* pNext; + VkDeviceAddress address; + VkDeviceSize range; + VkFormat format; +} VkDescriptorAddressInfoEXT; -#define VK_NV_ray_tracing_motion_blur 1 +typedef struct VkDescriptorBufferBindingInfoEXT { + VkStructureType sType; + void* pNext; + VkDeviceAddress address; + VkBufferUsageFlags usage; +} VkDescriptorBufferBindingInfoEXT; + +typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT { + VkStructureType sType; + void* pNext; + VkBuffer buffer; +} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT; + +typedef union VkDescriptorDataEXT { + const VkSampler* pSampler; + const VkDescriptorImageInfo* pCombinedImageSampler; + const VkDescriptorImageInfo* pInputAttachmentImage; + const VkDescriptorImageInfo* pSampledImage; + const VkDescriptorImageInfo* pStorageImage; + const VkDescriptorAddressInfoEXT* pUniformTexelBuffer; + const VkDescriptorAddressInfoEXT* pStorageTexelBuffer; + const VkDescriptorAddressInfoEXT* pUniformBuffer; + const VkDescriptorAddressInfoEXT* pStorageBuffer; + VkDeviceAddress accelerationStructure; +} VkDescriptorDataEXT; + +typedef struct VkDescriptorGetInfoEXT { + VkStructureType sType; + const void* pNext; + VkDescriptorType type; + VkDescriptorDataEXT data; +} VkDescriptorGetInfoEXT; + +typedef struct VkBufferCaptureDescriptorDataInfoEXT { + VkStructureType sType; + const void* pNext; + VkBuffer buffer; +} VkBufferCaptureDescriptorDataInfoEXT; + +typedef struct VkImageCaptureDescriptorDataInfoEXT { + VkStructureType sType; + const void* pNext; + VkImage image; +} VkImageCaptureDescriptorDataInfoEXT; + +typedef struct VkImageViewCaptureDescriptorDataInfoEXT { + VkStructureType sType; + const void* pNext; + VkImageView imageView; +} VkImageViewCaptureDescriptorDataInfoEXT; + +typedef struct VkSamplerCaptureDescriptorDataInfoEXT { + VkStructureType sType; + const void* pNext; + VkSampler sampler; +} VkSamplerCaptureDescriptorDataInfoEXT; + +typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT { + VkStructureType sType; + const void* pNext; + const void* opaqueCaptureDescriptorData; +} VkOpaqueCaptureDescriptorDataCreateInfoEXT; + +typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT { + VkStructureType sType; + const void* pNext; + VkAccelerationStructureKHR accelerationStructure; + VkAccelerationStructureNV accelerationStructureNV; +} VkAccelerationStructureCaptureDescriptorDataInfoEXT; + +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSizeEXT)(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize* pLayoutSizeInBytes); +typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize* pOffset); +typedef void (VKAPI_PTR *PFN_vkGetDescriptorEXT)(VkDevice device, const VkDescriptorGetInfoEXT* pDescriptorInfo, size_t dataSize, void* pDescriptor); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBuffersEXT)(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT* pBindingInfos); +typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsetsEXT)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t* pBufferIndices, const VkDeviceSize* pOffsets); +typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set); +typedef VkResult (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT* pInfo, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT* pInfo, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT* pInfo, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT* pInfo, void* pData); +typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo, void* pData); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSizeEXT( + VkDevice device, + VkDescriptorSetLayout layout, + VkDeviceSize* pLayoutSizeInBytes); + +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutBindingOffsetEXT( + VkDevice device, + VkDescriptorSetLayout layout, + uint32_t binding, + VkDeviceSize* pOffset); + +VKAPI_ATTR void VKAPI_CALL vkGetDescriptorEXT( + VkDevice device, + const VkDescriptorGetInfoEXT* pDescriptorInfo, + size_t dataSize, + void* pDescriptor); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBuffersEXT( + VkCommandBuffer commandBuffer, + uint32_t bufferCount, + const VkDescriptorBufferBindingInfoEXT* pBindingInfos); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDescriptorBufferOffsetsEXT( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t firstSet, + uint32_t setCount, + const uint32_t* pBufferIndices, + const VkDeviceSize* pOffsets); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplersEXT( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipelineLayout layout, + uint32_t set); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferOpaqueCaptureDescriptorDataEXT( + VkDevice device, + const VkBufferCaptureDescriptorDataInfoEXT* pInfo, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetImageOpaqueCaptureDescriptorDataEXT( + VkDevice device, + const VkImageCaptureDescriptorDataInfoEXT* pInfo, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetImageViewOpaqueCaptureDescriptorDataEXT( + VkDevice device, + const VkImageViewCaptureDescriptorDataInfoEXT* pInfo, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetSamplerOpaqueCaptureDescriptorDataEXT( + VkDevice device, + const VkSamplerCaptureDescriptorDataInfoEXT* pInfo, + void* pData); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT( + VkDevice device, + const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo, + void* pData); +#endif + + +// VK_EXT_graphics_pipeline_library is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_graphics_pipeline_library 1 +#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION 1 +#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME "VK_EXT_graphics_pipeline_library" + +typedef enum VkGraphicsPipelineLibraryFlagBitsEXT { + VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0x00000001, + VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0x00000002, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0x00000004, + VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0x00000008, + VK_GRAPHICS_PIPELINE_LIBRARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkGraphicsPipelineLibraryFlagBitsEXT; +typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT; +typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 graphicsPipelineLibrary; +} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; + +typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 graphicsPipelineLibraryFastLinking; + VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration; +} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; + +typedef struct VkGraphicsPipelineLibraryCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkGraphicsPipelineLibraryFlagsEXT flags; +} VkGraphicsPipelineLibraryCreateInfoEXT; + + + +// VK_AMD_shader_early_and_late_fragment_tests is a preprocessor guard. Do not pass it to API calls. +#define VK_AMD_shader_early_and_late_fragment_tests 1 +#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_SPEC_VERSION 1 +#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_EXTENSION_NAME "VK_AMD_shader_early_and_late_fragment_tests" +typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD { + VkStructureType sType; + void* pNext; + VkBool32 shaderEarlyAndLateFragmentTests; +} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; + + + +// VK_NV_fragment_shading_rate_enums is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_fragment_shading_rate_enums 1 +#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION 1 +#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME "VK_NV_fragment_shading_rate_enums" + +typedef enum VkFragmentShadingRateTypeNV { + VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV = 0, + VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV = 1, + VK_FRAGMENT_SHADING_RATE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkFragmentShadingRateTypeNV; + +typedef enum VkFragmentShadingRateNV { + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 1, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 4, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 5, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 6, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 9, + VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 10, + VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 11, + VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 12, + VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 13, + VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 14, + VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV = 15, + VK_FRAGMENT_SHADING_RATE_MAX_ENUM_NV = 0x7FFFFFFF +} VkFragmentShadingRateNV; +typedef struct VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 fragmentShadingRateEnums; + VkBool32 supersampleFragmentShadingRates; + VkBool32 noInvocationFragmentShadingRates; +} VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV; + +typedef struct VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV { + VkStructureType sType; + void* pNext; + VkSampleCountFlagBits maxFragmentShadingRateInvocationCount; +} VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV; + +typedef struct VkPipelineFragmentShadingRateEnumStateCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkFragmentShadingRateTypeNV shadingRateType; + VkFragmentShadingRateNV shadingRate; + VkFragmentShadingRateCombinerOpKHR combinerOps[2]; +} VkPipelineFragmentShadingRateEnumStateCreateInfoNV; + +typedef void (VKAPI_PTR *PFN_vkCmdSetFragmentShadingRateEnumNV)(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetFragmentShadingRateEnumNV( + VkCommandBuffer commandBuffer, + VkFragmentShadingRateNV shadingRate, + const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); +#endif + + +// VK_NV_ray_tracing_motion_blur is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_ray_tracing_motion_blur 1 #define VK_NV_RAY_TRACING_MOTION_BLUR_SPEC_VERSION 1 #define VK_NV_RAY_TRACING_MOTION_BLUR_EXTENSION_NAME "VK_NV_ray_tracing_motion_blur" @@ -13627,6 +16139,7 @@ typedef struct VkPhysicalDeviceRayTracingMotionBlurFeaturesNV { +// VK_EXT_ycbcr_2plane_444_formats is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_ycbcr_2plane_444_formats 1 #define VK_EXT_YCBCR_2PLANE_444_FORMATS_SPEC_VERSION 1 #define VK_EXT_YCBCR_2PLANE_444_FORMATS_EXTENSION_NAME "VK_EXT_ycbcr_2plane_444_formats" @@ -13638,6 +16151,7 @@ typedef struct VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT { +// VK_EXT_fragment_density_map2 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_fragment_density_map2 1 #define VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION 1 #define VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME "VK_EXT_fragment_density_map2" @@ -13658,8 +16172,9 @@ typedef struct VkPhysicalDeviceFragmentDensityMap2PropertiesEXT { +// VK_QCOM_rotated_copy_commands is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_rotated_copy_commands 1 -#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 1 +#define VK_QCOM_ROTATED_COPY_COMMANDS_SPEC_VERSION 2 #define VK_QCOM_ROTATED_COPY_COMMANDS_EXTENSION_NAME "VK_QCOM_rotated_copy_commands" typedef struct VkCopyCommandTransformInfoQCOM { VkStructureType sType; @@ -13669,6 +16184,7 @@ typedef struct VkCopyCommandTransformInfoQCOM { +// VK_EXT_image_robustness is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_robustness 1 #define VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION 1 #define VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_image_robustness" @@ -13676,6 +16192,7 @@ typedef VkPhysicalDeviceImageRobustnessFeatures VkPhysicalDeviceImageRobustnessF +// VK_EXT_image_compression_control is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_compression_control 1 #define VK_EXT_IMAGE_COMPRESSION_CONTROL_SPEC_VERSION 1 #define VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME "VK_EXT_image_compression_control" @@ -13732,18 +16249,6 @@ typedef struct VkImageCompressionControlEXT { VkImageCompressionFixedRateFlagsEXT* pFixedRateFlags; } VkImageCompressionControlEXT; -typedef struct VkSubresourceLayout2EXT { - VkStructureType sType; - void* pNext; - VkSubresourceLayout subresourceLayout; -} VkSubresourceLayout2EXT; - -typedef struct VkImageSubresource2EXT { - VkStructureType sType; - void* pNext; - VkImageSubresource imageSubresource; -} VkImageSubresource2EXT; - typedef struct VkImageCompressionPropertiesEXT { VkStructureType sType; void* pNext; @@ -13751,17 +16256,9 @@ typedef struct VkImageCompressionPropertiesEXT { VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags; } VkImageCompressionPropertiesEXT; -typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2EXT)(VkDevice device, VkImage image, const VkImageSubresource2EXT* pSubresource, VkSubresourceLayout2EXT* pLayout); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2EXT( - VkDevice device, - VkImage image, - const VkImageSubresource2EXT* pSubresource, - VkSubresourceLayout2EXT* pLayout); -#endif +// VK_EXT_attachment_feedback_loop_layout is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_attachment_feedback_loop_layout 1 #define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION 2 #define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout" @@ -13773,6 +16270,7 @@ typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT { +// VK_EXT_4444_formats is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_4444_formats 1 #define VK_EXT_4444_FORMATS_SPEC_VERSION 1 #define VK_EXT_4444_FORMATS_EXTENSION_NAME "VK_EXT_4444_formats" @@ -13785,6 +16283,87 @@ typedef struct VkPhysicalDevice4444FormatsFeaturesEXT { +// VK_EXT_device_fault is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_device_fault 1 +#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 2 +#define VK_EXT_DEVICE_FAULT_EXTENSION_NAME "VK_EXT_device_fault" + +typedef enum VkDeviceFaultAddressTypeEXT { + VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT = 0, + VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT = 1, + VK_DEVICE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT = 2, + VK_DEVICE_FAULT_ADDRESS_TYPE_EXECUTE_INVALID_EXT = 3, + VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_UNKNOWN_EXT = 4, + VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_INVALID_EXT = 5, + VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_FAULT_EXT = 6, + VK_DEVICE_FAULT_ADDRESS_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceFaultAddressTypeEXT; + +typedef enum VkDeviceFaultVendorBinaryHeaderVersionEXT { + VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT = 1, + VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceFaultVendorBinaryHeaderVersionEXT; +typedef struct VkPhysicalDeviceFaultFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 deviceFault; + VkBool32 deviceFaultVendorBinary; +} VkPhysicalDeviceFaultFeaturesEXT; + +typedef struct VkDeviceFaultCountsEXT { + VkStructureType sType; + void* pNext; + uint32_t addressInfoCount; + uint32_t vendorInfoCount; + VkDeviceSize vendorBinarySize; +} VkDeviceFaultCountsEXT; + +typedef struct VkDeviceFaultAddressInfoEXT { + VkDeviceFaultAddressTypeEXT addressType; + VkDeviceAddress reportedAddress; + VkDeviceSize addressPrecision; +} VkDeviceFaultAddressInfoEXT; + +typedef struct VkDeviceFaultVendorInfoEXT { + char description[VK_MAX_DESCRIPTION_SIZE]; + uint64_t vendorFaultCode; + uint64_t vendorFaultData; +} VkDeviceFaultVendorInfoEXT; + +typedef struct VkDeviceFaultInfoEXT { + VkStructureType sType; + void* pNext; + char description[VK_MAX_DESCRIPTION_SIZE]; + VkDeviceFaultAddressInfoEXT* pAddressInfos; + VkDeviceFaultVendorInfoEXT* pVendorInfos; + void* pVendorBinaryData; +} VkDeviceFaultInfoEXT; + +typedef struct VkDeviceFaultVendorBinaryHeaderVersionOneEXT { + uint32_t headerSize; + VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion; + uint32_t vendorID; + uint32_t deviceID; + uint32_t driverVersion; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + uint32_t applicationNameOffset; + uint32_t applicationVersion; + uint32_t engineNameOffset; + uint32_t engineVersion; + uint32_t apiVersion; +} VkDeviceFaultVendorBinaryHeaderVersionOneEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceFaultInfoEXT)(VkDevice device, VkDeviceFaultCountsEXT* pFaultCounts, VkDeviceFaultInfoEXT* pFaultInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceFaultInfoEXT( + VkDevice device, + VkDeviceFaultCountsEXT* pFaultCounts, + VkDeviceFaultInfoEXT* pFaultInfo); +#endif + + +// VK_ARM_rasterization_order_attachment_access is a preprocessor guard. Do not pass it to API calls. #define VK_ARM_rasterization_order_attachment_access 1 #define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 #define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_ARM_rasterization_order_attachment_access" @@ -13800,6 +16379,7 @@ typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT VkPhysical +// VK_EXT_rgba10x6_formats is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_rgba10x6_formats 1 #define VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION 1 #define VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME "VK_EXT_rgba10x6_formats" @@ -13811,47 +16391,37 @@ typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT { -#define VK_NV_acquire_winrt_display 1 -#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1 -#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display" -typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); -typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay); - -#ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV( - VkPhysicalDevice physicalDevice, - VkDisplayKHR display); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV( - VkPhysicalDevice physicalDevice, - uint32_t deviceRelativeId, - VkDisplayKHR* pDisplay); -#endif - - +// VK_VALVE_mutable_descriptor_type is a preprocessor guard. Do not pass it to API calls. #define VK_VALVE_mutable_descriptor_type 1 #define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 #define VK_VALVE_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_VALVE_mutable_descriptor_type" -typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE { +typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT { VkStructureType sType; void* pNext; VkBool32 mutableDescriptorType; -} VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE; +} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT; + +typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE; -typedef struct VkMutableDescriptorTypeListVALVE { +typedef struct VkMutableDescriptorTypeListEXT { uint32_t descriptorTypeCount; const VkDescriptorType* pDescriptorTypes; -} VkMutableDescriptorTypeListVALVE; +} VkMutableDescriptorTypeListEXT; -typedef struct VkMutableDescriptorTypeCreateInfoVALVE { - VkStructureType sType; - const void* pNext; - uint32_t mutableDescriptorTypeListCount; - const VkMutableDescriptorTypeListVALVE* pMutableDescriptorTypeLists; -} VkMutableDescriptorTypeCreateInfoVALVE; +typedef VkMutableDescriptorTypeListEXT VkMutableDescriptorTypeListVALVE; + +typedef struct VkMutableDescriptorTypeCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t mutableDescriptorTypeListCount; + const VkMutableDescriptorTypeListEXT* pMutableDescriptorTypeLists; +} VkMutableDescriptorTypeCreateInfoEXT; + +typedef VkMutableDescriptorTypeCreateInfoEXT VkMutableDescriptorTypeCreateInfoVALVE; +// VK_EXT_vertex_input_dynamic_state is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_vertex_input_dynamic_state 1 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_SPEC_VERSION 2 #define VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_vertex_input_dynamic_state" @@ -13891,6 +16461,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetVertexInputEXT( #endif +// VK_EXT_physical_device_drm is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_physical_device_drm 1 #define VK_EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION 1 #define VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME "VK_EXT_physical_device_drm" @@ -13907,6 +16478,40 @@ typedef struct VkPhysicalDeviceDrmPropertiesEXT { +// VK_EXT_device_address_binding_report is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_device_address_binding_report 1 +#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_SPEC_VERSION 1 +#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_EXTENSION_NAME "VK_EXT_device_address_binding_report" + +typedef enum VkDeviceAddressBindingTypeEXT { + VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT = 0, + VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT = 1, + VK_DEVICE_ADDRESS_BINDING_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceAddressBindingTypeEXT; + +typedef enum VkDeviceAddressBindingFlagBitsEXT { + VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0x00000001, + VK_DEVICE_ADDRESS_BINDING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkDeviceAddressBindingFlagBitsEXT; +typedef VkFlags VkDeviceAddressBindingFlagsEXT; +typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 reportAddressBinding; +} VkPhysicalDeviceAddressBindingReportFeaturesEXT; + +typedef struct VkDeviceAddressBindingCallbackDataEXT { + VkStructureType sType; + void* pNext; + VkDeviceAddressBindingFlagsEXT flags; + VkDeviceAddress baseAddress; + VkDeviceSize size; + VkDeviceAddressBindingTypeEXT bindingType; +} VkDeviceAddressBindingCallbackDataEXT; + + + +// VK_EXT_depth_clip_control is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_depth_clip_control 1 #define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1 #define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control" @@ -13924,6 +16529,7 @@ typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT { +// VK_EXT_primitive_topology_list_restart is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_primitive_topology_list_restart 1 #define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION 1 #define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME "VK_EXT_primitive_topology_list_restart" @@ -13936,8 +16542,9 @@ typedef struct VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT { +// VK_HUAWEI_subpass_shading is a preprocessor guard. Do not pass it to API calls. #define VK_HUAWEI_subpass_shading 1 -#define VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION 2 +#define VK_HUAWEI_SUBPASS_SHADING_SPEC_VERSION 3 #define VK_HUAWEI_SUBPASS_SHADING_EXTENSION_NAME "VK_HUAWEI_subpass_shading" typedef struct VkSubpassShadingPipelineCreateInfoHUAWEI { VkStructureType sType; @@ -13972,6 +16579,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSubpassShadingHUAWEI( #endif +// VK_HUAWEI_invocation_mask is a preprocessor guard. Do not pass it to API calls. #define VK_HUAWEI_invocation_mask 1 #define VK_HUAWEI_INVOCATION_MASK_SPEC_VERSION 1 #define VK_HUAWEI_INVOCATION_MASK_EXTENSION_NAME "VK_HUAWEI_invocation_mask" @@ -13991,6 +16599,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBindInvocationMaskHUAWEI( #endif +// VK_NV_external_memory_rdma is a preprocessor guard. Do not pass it to API calls. #define VK_NV_external_memory_rdma 1 typedef void* VkRemoteAddressNV; #define VK_NV_EXTERNAL_MEMORY_RDMA_SPEC_VERSION 1 @@ -14018,6 +16627,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryRemoteAddressNV( #endif +// VK_EXT_pipeline_properties is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_pipeline_properties 1 #define VK_EXT_PIPELINE_PROPERTIES_SPEC_VERSION 1 #define VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME "VK_EXT_pipeline_properties" @@ -14045,6 +16655,39 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelinePropertiesEXT( #endif +// VK_EXT_frame_boundary is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_frame_boundary 1 +#define VK_EXT_FRAME_BOUNDARY_SPEC_VERSION 1 +#define VK_EXT_FRAME_BOUNDARY_EXTENSION_NAME "VK_EXT_frame_boundary" + +typedef enum VkFrameBoundaryFlagBitsEXT { + VK_FRAME_BOUNDARY_FRAME_END_BIT_EXT = 0x00000001, + VK_FRAME_BOUNDARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkFrameBoundaryFlagBitsEXT; +typedef VkFlags VkFrameBoundaryFlagsEXT; +typedef struct VkPhysicalDeviceFrameBoundaryFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 frameBoundary; +} VkPhysicalDeviceFrameBoundaryFeaturesEXT; + +typedef struct VkFrameBoundaryEXT { + VkStructureType sType; + const void* pNext; + VkFrameBoundaryFlagsEXT flags; + uint64_t frameID; + uint32_t imageCount; + const VkImage* pImages; + uint32_t bufferCount; + const VkBuffer* pBuffers; + uint64_t tagName; + size_t tagSize; + const void* pTag; +} VkFrameBoundaryEXT; + + + +// VK_EXT_multisampled_render_to_single_sampled is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_multisampled_render_to_single_sampled 1 #define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1 #define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME "VK_EXT_multisampled_render_to_single_sampled" @@ -14069,6 +16712,7 @@ typedef struct VkMultisampledRenderToSingleSampledInfoEXT { +// VK_EXT_extended_dynamic_state2 is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_extended_dynamic_state2 1 #define VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION 1 #define VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME "VK_EXT_extended_dynamic_state2" @@ -14109,6 +16753,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetPrimitiveRestartEnableEXT( #endif +// VK_EXT_color_write_enable is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_color_write_enable 1 #define VK_EXT_COLOR_WRITE_ENABLE_SPEC_VERSION 1 #define VK_EXT_COLOR_WRITE_ENABLE_EXTENSION_NAME "VK_EXT_color_write_enable" @@ -14135,6 +16780,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWrite #endif +// VK_EXT_primitives_generated_query is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_primitives_generated_query 1 #define VK_EXT_PRIMITIVES_GENERATED_QUERY_SPEC_VERSION 1 #define VK_EXT_PRIMITIVES_GENERATED_QUERY_EXTENSION_NAME "VK_EXT_primitives_generated_query" @@ -14148,6 +16794,7 @@ typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT { +// VK_EXT_global_priority_query is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_global_priority_query 1 #define VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION 1 #define VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME "VK_EXT_global_priority_query" @@ -14158,6 +16805,7 @@ typedef VkQueueFamilyGlobalPriorityPropertiesKHR VkQueueFamilyGlobalPriorityProp +// VK_EXT_image_view_min_lod is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_view_min_lod 1 #define VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION 1 #define VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME "VK_EXT_image_view_min_lod" @@ -14175,6 +16823,7 @@ typedef struct VkImageViewMinLodCreateInfoEXT { +// VK_EXT_multi_draw is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_multi_draw 1 #define VK_EXT_MULTI_DRAW_SPEC_VERSION 1 #define VK_EXT_MULTI_DRAW_EXTENSION_NAME "VK_EXT_multi_draw" @@ -14224,6 +16873,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawMultiIndexedEXT( #endif +// VK_EXT_image_2d_view_of_3d is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_2d_view_of_3d 1 #define VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION 1 #define VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_2d_view_of_3d" @@ -14236,32 +16886,372 @@ typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT { -#define VK_EXT_load_store_op_none 1 -#define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1 -#define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" - +// VK_EXT_shader_tile_image is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_shader_tile_image 1 +#define VK_EXT_SHADER_TILE_IMAGE_SPEC_VERSION 1 +#define VK_EXT_SHADER_TILE_IMAGE_EXTENSION_NAME "VK_EXT_shader_tile_image" +typedef struct VkPhysicalDeviceShaderTileImageFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderTileImageColorReadAccess; + VkBool32 shaderTileImageDepthReadAccess; + VkBool32 shaderTileImageStencilReadAccess; +} VkPhysicalDeviceShaderTileImageFeaturesEXT; -#define VK_EXT_border_color_swizzle 1 -#define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 -#define VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME "VK_EXT_border_color_swizzle" -typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT { +typedef struct VkPhysicalDeviceShaderTileImagePropertiesEXT { VkStructureType sType; void* pNext; - VkBool32 borderColorSwizzle; - VkBool32 borderColorSwizzleFromImage; -} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT; + VkBool32 shaderTileImageCoherentReadAccelerated; + VkBool32 shaderTileImageReadSampleFromPixelRateInvocation; + VkBool32 shaderTileImageReadFromHelperInvocation; +} VkPhysicalDeviceShaderTileImagePropertiesEXT; -typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT { - VkStructureType sType; - const void* pNext; - VkComponentMapping components; - VkBool32 srgb; -} VkSamplerBorderColorComponentMappingCreateInfoEXT; +// VK_EXT_opacity_micromap is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_opacity_micromap 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT) +#define VK_EXT_OPACITY_MICROMAP_SPEC_VERSION 2 +#define VK_EXT_OPACITY_MICROMAP_EXTENSION_NAME "VK_EXT_opacity_micromap" -#define VK_EXT_pageable_device_local_memory 1 -#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION 1 +typedef enum VkMicromapTypeEXT { + VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0, +#ifdef VK_ENABLE_BETA_EXTENSIONS + VK_MICROMAP_TYPE_DISPLACEMENT_MICROMAP_NV = 1000397000, +#endif + VK_MICROMAP_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkMicromapTypeEXT; + +typedef enum VkBuildMicromapModeEXT { + VK_BUILD_MICROMAP_MODE_BUILD_EXT = 0, + VK_BUILD_MICROMAP_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkBuildMicromapModeEXT; + +typedef enum VkCopyMicromapModeEXT { + VK_COPY_MICROMAP_MODE_CLONE_EXT = 0, + VK_COPY_MICROMAP_MODE_SERIALIZE_EXT = 1, + VK_COPY_MICROMAP_MODE_DESERIALIZE_EXT = 2, + VK_COPY_MICROMAP_MODE_COMPACT_EXT = 3, + VK_COPY_MICROMAP_MODE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkCopyMicromapModeEXT; + +typedef enum VkOpacityMicromapFormatEXT { + VK_OPACITY_MICROMAP_FORMAT_2_STATE_EXT = 1, + VK_OPACITY_MICROMAP_FORMAT_4_STATE_EXT = 2, + VK_OPACITY_MICROMAP_FORMAT_MAX_ENUM_EXT = 0x7FFFFFFF +} VkOpacityMicromapFormatEXT; + +typedef enum VkOpacityMicromapSpecialIndexEXT { + VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT_EXT = -1, + VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE_EXT = -2, + VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT_EXT = -3, + VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE_EXT = -4, + VK_OPACITY_MICROMAP_SPECIAL_INDEX_MAX_ENUM_EXT = 0x7FFFFFFF +} VkOpacityMicromapSpecialIndexEXT; + +typedef enum VkAccelerationStructureCompatibilityKHR { + VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0, + VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1, + VK_ACCELERATION_STRUCTURE_COMPATIBILITY_MAX_ENUM_KHR = 0x7FFFFFFF +} VkAccelerationStructureCompatibilityKHR; + +typedef enum VkAccelerationStructureBuildTypeKHR { + VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0, + VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1, + VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2, + VK_ACCELERATION_STRUCTURE_BUILD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF +} VkAccelerationStructureBuildTypeKHR; + +typedef enum VkBuildMicromapFlagBitsEXT { + VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT = 0x00000001, + VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0x00000002, + VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0x00000004, + VK_BUILD_MICROMAP_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkBuildMicromapFlagBitsEXT; +typedef VkFlags VkBuildMicromapFlagsEXT; + +typedef enum VkMicromapCreateFlagBitsEXT { + VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0x00000001, + VK_MICROMAP_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkMicromapCreateFlagBitsEXT; +typedef VkFlags VkMicromapCreateFlagsEXT; +typedef struct VkMicromapUsageEXT { + uint32_t count; + uint32_t subdivisionLevel; + uint32_t format; +} VkMicromapUsageEXT; + +typedef union VkDeviceOrHostAddressKHR { + VkDeviceAddress deviceAddress; + void* hostAddress; +} VkDeviceOrHostAddressKHR; + +typedef struct VkMicromapBuildInfoEXT { + VkStructureType sType; + const void* pNext; + VkMicromapTypeEXT type; + VkBuildMicromapFlagsEXT flags; + VkBuildMicromapModeEXT mode; + VkMicromapEXT dstMicromap; + uint32_t usageCountsCount; + const VkMicromapUsageEXT* pUsageCounts; + const VkMicromapUsageEXT* const* ppUsageCounts; + VkDeviceOrHostAddressConstKHR data; + VkDeviceOrHostAddressKHR scratchData; + VkDeviceOrHostAddressConstKHR triangleArray; + VkDeviceSize triangleArrayStride; +} VkMicromapBuildInfoEXT; + +typedef struct VkMicromapCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkMicromapCreateFlagsEXT createFlags; + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize size; + VkMicromapTypeEXT type; + VkDeviceAddress deviceAddress; +} VkMicromapCreateInfoEXT; + +typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 micromap; + VkBool32 micromapCaptureReplay; + VkBool32 micromapHostCommands; +} VkPhysicalDeviceOpacityMicromapFeaturesEXT; + +typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxOpacity2StateSubdivisionLevel; + uint32_t maxOpacity4StateSubdivisionLevel; +} VkPhysicalDeviceOpacityMicromapPropertiesEXT; + +typedef struct VkMicromapVersionInfoEXT { + VkStructureType sType; + const void* pNext; + const uint8_t* pVersionData; +} VkMicromapVersionInfoEXT; + +typedef struct VkCopyMicromapToMemoryInfoEXT { + VkStructureType sType; + const void* pNext; + VkMicromapEXT src; + VkDeviceOrHostAddressKHR dst; + VkCopyMicromapModeEXT mode; +} VkCopyMicromapToMemoryInfoEXT; + +typedef struct VkCopyMemoryToMicromapInfoEXT { + VkStructureType sType; + const void* pNext; + VkDeviceOrHostAddressConstKHR src; + VkMicromapEXT dst; + VkCopyMicromapModeEXT mode; +} VkCopyMemoryToMicromapInfoEXT; + +typedef struct VkCopyMicromapInfoEXT { + VkStructureType sType; + const void* pNext; + VkMicromapEXT src; + VkMicromapEXT dst; + VkCopyMicromapModeEXT mode; +} VkCopyMicromapInfoEXT; + +typedef struct VkMicromapBuildSizesInfoEXT { + VkStructureType sType; + const void* pNext; + VkDeviceSize micromapSize; + VkDeviceSize buildScratchSize; + VkBool32 discardable; +} VkMicromapBuildSizesInfoEXT; + +typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT { + VkStructureType sType; + void* pNext; + VkIndexType indexType; + VkDeviceOrHostAddressConstKHR indexBuffer; + VkDeviceSize indexStride; + uint32_t baseTriangle; + uint32_t usageCountsCount; + const VkMicromapUsageEXT* pUsageCounts; + const VkMicromapUsageEXT* const* ppUsageCounts; + VkMicromapEXT micromap; +} VkAccelerationStructureTrianglesOpacityMicromapEXT; + +typedef struct VkMicromapTriangleEXT { + uint32_t dataOffset; + uint16_t subdivisionLevel; + uint16_t format; +} VkMicromapTriangleEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkCreateMicromapEXT)(VkDevice device, const VkMicromapCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkMicromapEXT* pMicromap); +typedef void (VKAPI_PTR *PFN_vkDestroyMicromapEXT)(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks* pAllocator); +typedef void (VKAPI_PTR *PFN_vkCmdBuildMicromapsEXT)(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos); +typedef VkResult (VKAPI_PTR *PFN_vkBuildMicromapsEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos); +typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT* pInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapToMemoryEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT* pInfo); +typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToMicromapEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT* pInfo); +typedef VkResult (VKAPI_PTR *PFN_vkWriteMicromapsPropertiesEXT)(VkDevice device, uint32_t micromapCount, const VkMicromapEXT* pMicromaps, VkQueryType queryType, size_t dataSize, void* pData, size_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapEXT)(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT* pInfo); +typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapToMemoryEXT)(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT* pInfo); +typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToMicromapEXT)(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT* pInfo); +typedef void (VKAPI_PTR *PFN_vkCmdWriteMicromapsPropertiesEXT)(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT* pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); +typedef void (VKAPI_PTR *PFN_vkGetDeviceMicromapCompatibilityEXT)(VkDevice device, const VkMicromapVersionInfoEXT* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility); +typedef void (VKAPI_PTR *PFN_vkGetMicromapBuildSizesEXT)(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT* pBuildInfo, VkMicromapBuildSizesInfoEXT* pSizeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateMicromapEXT( + VkDevice device, + const VkMicromapCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkMicromapEXT* pMicromap); + +VKAPI_ATTR void VKAPI_CALL vkDestroyMicromapEXT( + VkDevice device, + VkMicromapEXT micromap, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR void VKAPI_CALL vkCmdBuildMicromapsEXT( + VkCommandBuffer commandBuffer, + uint32_t infoCount, + const VkMicromapBuildInfoEXT* pInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkBuildMicromapsEXT( + VkDevice device, + VkDeferredOperationKHR deferredOperation, + uint32_t infoCount, + const VkMicromapBuildInfoEXT* pInfos); + +VKAPI_ATTR VkResult VKAPI_CALL vkCopyMicromapEXT( + VkDevice device, + VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapInfoEXT* pInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCopyMicromapToMemoryEXT( + VkDevice device, + VkDeferredOperationKHR deferredOperation, + const VkCopyMicromapToMemoryInfoEXT* pInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkCopyMemoryToMicromapEXT( + VkDevice device, + VkDeferredOperationKHR deferredOperation, + const VkCopyMemoryToMicromapInfoEXT* pInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT( + VkDevice device, + uint32_t micromapCount, + const VkMicromapEXT* pMicromaps, + VkQueryType queryType, + size_t dataSize, + void* pData, + size_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyMicromapEXT( + VkCommandBuffer commandBuffer, + const VkCopyMicromapInfoEXT* pInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyMicromapToMemoryEXT( + VkCommandBuffer commandBuffer, + const VkCopyMicromapToMemoryInfoEXT* pInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryToMicromapEXT( + VkCommandBuffer commandBuffer, + const VkCopyMemoryToMicromapInfoEXT* pInfo); + +VKAPI_ATTR void VKAPI_CALL vkCmdWriteMicromapsPropertiesEXT( + VkCommandBuffer commandBuffer, + uint32_t micromapCount, + const VkMicromapEXT* pMicromaps, + VkQueryType queryType, + VkQueryPool queryPool, + uint32_t firstQuery); + +VKAPI_ATTR void VKAPI_CALL vkGetDeviceMicromapCompatibilityEXT( + VkDevice device, + const VkMicromapVersionInfoEXT* pVersionInfo, + VkAccelerationStructureCompatibilityKHR* pCompatibility); + +VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT( + VkDevice device, + VkAccelerationStructureBuildTypeKHR buildType, + const VkMicromapBuildInfoEXT* pBuildInfo, + VkMicromapBuildSizesInfoEXT* pSizeInfo); +#endif + + +// VK_EXT_load_store_op_none is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_load_store_op_none 1 +#define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1 +#define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none" + + +// VK_HUAWEI_cluster_culling_shader is a preprocessor guard. Do not pass it to API calls. +#define VK_HUAWEI_cluster_culling_shader 1 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_SPEC_VERSION 3 +#define VK_HUAWEI_CLUSTER_CULLING_SHADER_EXTENSION_NAME "VK_HUAWEI_cluster_culling_shader" +typedef struct VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI { + VkStructureType sType; + void* pNext; + VkBool32 clustercullingShader; + VkBool32 multiviewClusterCullingShader; +} VkPhysicalDeviceClusterCullingShaderFeaturesHUAWEI; + +typedef struct VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI { + VkStructureType sType; + void* pNext; + uint32_t maxWorkGroupCount[3]; + uint32_t maxWorkGroupSize[3]; + uint32_t maxOutputClusterCount; + VkDeviceSize indirectBufferOffsetAlignment; +} VkPhysicalDeviceClusterCullingShaderPropertiesHUAWEI; + +typedef struct VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI { + VkStructureType sType; + void* pNext; + VkBool32 clusterShadingRate; +} VkPhysicalDeviceClusterCullingShaderVrsFeaturesHUAWEI; + +typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterHUAWEI)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); +typedef void (VKAPI_PTR *PFN_vkCmdDrawClusterIndirectHUAWEI)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDrawClusterHUAWEI( + VkCommandBuffer commandBuffer, + uint32_t groupCountX, + uint32_t groupCountY, + uint32_t groupCountZ); + +VKAPI_ATTR void VKAPI_CALL vkCmdDrawClusterIndirectHUAWEI( + VkCommandBuffer commandBuffer, + VkBuffer buffer, + VkDeviceSize offset); +#endif + + +// VK_EXT_border_color_swizzle is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_border_color_swizzle 1 +#define VK_EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION 1 +#define VK_EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME "VK_EXT_border_color_swizzle" +typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 borderColorSwizzle; + VkBool32 borderColorSwizzleFromImage; +} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT; + +typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkComponentMapping components; + VkBool32 srgb; +} VkSamplerBorderColorComponentMappingCreateInfoEXT; + + + +// VK_EXT_pageable_device_local_memory is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_pageable_device_local_memory 1 +#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION 1 #define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME "VK_EXT_pageable_device_local_memory" typedef struct VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT { VkStructureType sType; @@ -14279,6 +17269,71 @@ VKAPI_ATTR void VKAPI_CALL vkSetDeviceMemoryPriorityEXT( #endif +// VK_ARM_shader_core_properties is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_shader_core_properties 1 +#define VK_ARM_SHADER_CORE_PROPERTIES_SPEC_VERSION 1 +#define VK_ARM_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_ARM_shader_core_properties" +typedef struct VkPhysicalDeviceShaderCorePropertiesARM { + VkStructureType sType; + void* pNext; + uint32_t pixelRate; + uint32_t texelRate; + uint32_t fmaRate; +} VkPhysicalDeviceShaderCorePropertiesARM; + + + +// VK_ARM_scheduling_controls is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_scheduling_controls 1 +#define VK_ARM_SCHEDULING_CONTROLS_SPEC_VERSION 1 +#define VK_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME "VK_ARM_scheduling_controls" +typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagsARM; + +// Flag bits for VkPhysicalDeviceSchedulingControlsFlagBitsARM +typedef VkFlags64 VkPhysicalDeviceSchedulingControlsFlagBitsARM; +static const VkPhysicalDeviceSchedulingControlsFlagBitsARM VK_PHYSICAL_DEVICE_SCHEDULING_CONTROLS_SHADER_CORE_COUNT_ARM = 0x00000001ULL; + +typedef struct VkDeviceQueueShaderCoreControlCreateInfoARM { + VkStructureType sType; + void* pNext; + uint32_t shaderCoreCount; +} VkDeviceQueueShaderCoreControlCreateInfoARM; + +typedef struct VkPhysicalDeviceSchedulingControlsFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 schedulingControls; +} VkPhysicalDeviceSchedulingControlsFeaturesARM; + +typedef struct VkPhysicalDeviceSchedulingControlsPropertiesARM { + VkStructureType sType; + void* pNext; + VkPhysicalDeviceSchedulingControlsFlagsARM schedulingControlsFlags; +} VkPhysicalDeviceSchedulingControlsPropertiesARM; + + + +// VK_EXT_image_sliced_view_of_3d is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_image_sliced_view_of_3d 1 +#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_SPEC_VERSION 1 +#define VK_EXT_IMAGE_SLICED_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_sliced_view_of_3d" +#define VK_REMAINING_3D_SLICES_EXT (~0U) +typedef struct VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 imageSlicedViewOf3D; +} VkPhysicalDeviceImageSlicedViewOf3DFeaturesEXT; + +typedef struct VkImageViewSlicedCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t sliceOffset; + uint32_t sliceCount; +} VkImageViewSlicedCreateInfoEXT; + + + +// VK_VALVE_descriptor_set_host_mapping is a preprocessor guard. Do not pass it to API calls. #define VK_VALVE_descriptor_set_host_mapping 1 #define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_SPEC_VERSION 1 #define VK_VALVE_DESCRIPTOR_SET_HOST_MAPPING_EXTENSION_NAME "VK_VALVE_descriptor_set_host_mapping" @@ -14318,6 +17373,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetHostMappingVALVE( #endif +// VK_EXT_depth_clamp_zero_one is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_depth_clamp_zero_one 1 #define VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION 1 #define VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME "VK_EXT_depth_clamp_zero_one" @@ -14329,6 +17385,7 @@ typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT { +// VK_EXT_non_seamless_cube_map is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_non_seamless_cube_map 1 #define VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION 1 #define VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME "VK_EXT_non_seamless_cube_map" @@ -14340,6 +17397,46 @@ typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT { +// VK_ARM_render_pass_striped is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_render_pass_striped 1 +#define VK_ARM_RENDER_PASS_STRIPED_SPEC_VERSION 1 +#define VK_ARM_RENDER_PASS_STRIPED_EXTENSION_NAME "VK_ARM_render_pass_striped" +typedef struct VkPhysicalDeviceRenderPassStripedFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 renderPassStriped; +} VkPhysicalDeviceRenderPassStripedFeaturesARM; + +typedef struct VkPhysicalDeviceRenderPassStripedPropertiesARM { + VkStructureType sType; + void* pNext; + VkExtent2D renderPassStripeGranularity; + uint32_t maxRenderPassStripes; +} VkPhysicalDeviceRenderPassStripedPropertiesARM; + +typedef struct VkRenderPassStripeInfoARM { + VkStructureType sType; + const void* pNext; + VkRect2D stripeArea; +} VkRenderPassStripeInfoARM; + +typedef struct VkRenderPassStripeBeginInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeInfoCount; + const VkRenderPassStripeInfoARM* pStripeInfos; +} VkRenderPassStripeBeginInfoARM; + +typedef struct VkRenderPassStripeSubmitInfoARM { + VkStructureType sType; + const void* pNext; + uint32_t stripeSemaphoreInfoCount; + const VkSemaphoreSubmitInfo* pStripeSemaphoreInfos; +} VkRenderPassStripeSubmitInfoARM; + + + +// VK_QCOM_fragment_density_map_offset is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_fragment_density_map_offset 1 #define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 1 #define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME "VK_QCOM_fragment_density_map_offset" @@ -14364,6 +17461,159 @@ typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM { +// VK_NV_copy_memory_indirect is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_copy_memory_indirect 1 +#define VK_NV_COPY_MEMORY_INDIRECT_SPEC_VERSION 1 +#define VK_NV_COPY_MEMORY_INDIRECT_EXTENSION_NAME "VK_NV_copy_memory_indirect" +typedef struct VkCopyMemoryIndirectCommandNV { + VkDeviceAddress srcAddress; + VkDeviceAddress dstAddress; + VkDeviceSize size; +} VkCopyMemoryIndirectCommandNV; + +typedef struct VkCopyMemoryToImageIndirectCommandNV { + VkDeviceAddress srcAddress; + uint32_t bufferRowLength; + uint32_t bufferImageHeight; + VkImageSubresourceLayers imageSubresource; + VkOffset3D imageOffset; + VkExtent3D imageExtent; +} VkCopyMemoryToImageIndirectCommandNV; + +typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 indirectCopy; +} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV; + +typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV { + VkStructureType sType; + void* pNext; + VkQueueFlags supportedQueues; +} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV; + +typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryIndirectNV)(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride); +typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToImageIndirectNV)(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers* pImageSubresources); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryIndirectNV( + VkCommandBuffer commandBuffer, + VkDeviceAddress copyBufferAddress, + uint32_t copyCount, + uint32_t stride); + +VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryToImageIndirectNV( + VkCommandBuffer commandBuffer, + VkDeviceAddress copyBufferAddress, + uint32_t copyCount, + uint32_t stride, + VkImage dstImage, + VkImageLayout dstImageLayout, + const VkImageSubresourceLayers* pImageSubresources); +#endif + + +// VK_NV_memory_decompression is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_memory_decompression 1 +#define VK_NV_MEMORY_DECOMPRESSION_SPEC_VERSION 1 +#define VK_NV_MEMORY_DECOMPRESSION_EXTENSION_NAME "VK_NV_memory_decompression" + +// Flag bits for VkMemoryDecompressionMethodFlagBitsNV +typedef VkFlags64 VkMemoryDecompressionMethodFlagBitsNV; +static const VkMemoryDecompressionMethodFlagBitsNV VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0x00000001ULL; + +typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV; +typedef struct VkDecompressMemoryRegionNV { + VkDeviceAddress srcAddress; + VkDeviceAddress dstAddress; + VkDeviceSize compressedSize; + VkDeviceSize decompressedSize; + VkMemoryDecompressionMethodFlagsNV decompressionMethod; +} VkDecompressMemoryRegionNV; + +typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 memoryDecompression; +} VkPhysicalDeviceMemoryDecompressionFeaturesNV; + +typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV { + VkStructureType sType; + void* pNext; + VkMemoryDecompressionMethodFlagsNV decompressionMethods; + uint64_t maxDecompressionIndirectCount; +} VkPhysicalDeviceMemoryDecompressionPropertiesNV; + +typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryNV)(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV* pDecompressMemoryRegions); +typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryIndirectCountNV)(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdDecompressMemoryNV( + VkCommandBuffer commandBuffer, + uint32_t decompressRegionCount, + const VkDecompressMemoryRegionNV* pDecompressMemoryRegions); + +VKAPI_ATTR void VKAPI_CALL vkCmdDecompressMemoryIndirectCountNV( + VkCommandBuffer commandBuffer, + VkDeviceAddress indirectCommandsAddress, + VkDeviceAddress indirectCommandsCountAddress, + uint32_t stride); +#endif + + +// VK_NV_device_generated_commands_compute is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_device_generated_commands_compute 1 +#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_SPEC_VERSION 2 +#define VK_NV_DEVICE_GENERATED_COMMANDS_COMPUTE_EXTENSION_NAME "VK_NV_device_generated_commands_compute" +typedef struct VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 deviceGeneratedCompute; + VkBool32 deviceGeneratedComputePipelines; + VkBool32 deviceGeneratedComputeCaptureReplay; +} VkPhysicalDeviceDeviceGeneratedCommandsComputeFeaturesNV; + +typedef struct VkComputePipelineIndirectBufferInfoNV { + VkStructureType sType; + const void* pNext; + VkDeviceAddress deviceAddress; + VkDeviceSize size; + VkDeviceAddress pipelineDeviceAddressCaptureReplay; +} VkComputePipelineIndirectBufferInfoNV; + +typedef struct VkPipelineIndirectDeviceAddressInfoNV { + VkStructureType sType; + const void* pNext; + VkPipelineBindPoint pipelineBindPoint; + VkPipeline pipeline; +} VkPipelineIndirectDeviceAddressInfoNV; + +typedef struct VkBindPipelineIndirectCommandNV { + VkDeviceAddress pipelineAddress; +} VkBindPipelineIndirectCommandNV; + +typedef void (VKAPI_PTR *PFN_vkGetPipelineIndirectMemoryRequirementsNV)(VkDevice device, const VkComputePipelineCreateInfo* pCreateInfo, VkMemoryRequirements2* pMemoryRequirements); +typedef void (VKAPI_PTR *PFN_vkCmdUpdatePipelineIndirectBufferNV)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); +typedef VkDeviceAddress (VKAPI_PTR *PFN_vkGetPipelineIndirectDeviceAddressNV)(VkDevice device, const VkPipelineIndirectDeviceAddressInfoNV* pInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkGetPipelineIndirectMemoryRequirementsNV( + VkDevice device, + const VkComputePipelineCreateInfo* pCreateInfo, + VkMemoryRequirements2* pMemoryRequirements); + +VKAPI_ATTR void VKAPI_CALL vkCmdUpdatePipelineIndirectBufferNV( + VkCommandBuffer commandBuffer, + VkPipelineBindPoint pipelineBindPoint, + VkPipeline pipeline); + +VKAPI_ATTR VkDeviceAddress VKAPI_CALL vkGetPipelineIndirectDeviceAddressNV( + VkDevice device, + const VkPipelineIndirectDeviceAddressInfoNV* pInfo); +#endif + + +// VK_NV_linear_color_attachment is a preprocessor guard. Do not pass it to API calls. #define VK_NV_linear_color_attachment 1 #define VK_NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION 1 #define VK_NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME "VK_NV_linear_color_attachment" @@ -14375,11 +17625,13 @@ typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV { +// VK_GOOGLE_surfaceless_query is a preprocessor guard. Do not pass it to API calls. #define VK_GOOGLE_surfaceless_query 1 -#define VK_GOOGLE_SURFACELESS_QUERY_SPEC_VERSION 1 +#define VK_GOOGLE_SURFACELESS_QUERY_SPEC_VERSION 2 #define VK_GOOGLE_SURFACELESS_QUERY_EXTENSION_NAME "VK_GOOGLE_surfaceless_query" +// VK_EXT_image_compression_control_swapchain is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_image_compression_control_swapchain 1 #define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_SPEC_VERSION 1 #define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_EXTENSION_NAME "VK_EXT_image_compression_control_swapchain" @@ -14391,6 +17643,7 @@ typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT { +// VK_QCOM_image_processing is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_image_processing 1 #define VK_QCOM_IMAGE_PROCESSING_SPEC_VERSION 1 #define VK_QCOM_IMAGE_PROCESSING_EXTENSION_NAME "VK_QCOM_image_processing" @@ -14421,6 +17674,273 @@ typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM { +// VK_EXT_nested_command_buffer is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_nested_command_buffer 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_SPEC_VERSION 1 +#define VK_EXT_NESTED_COMMAND_BUFFER_EXTENSION_NAME "VK_EXT_nested_command_buffer" +typedef struct VkPhysicalDeviceNestedCommandBufferFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 nestedCommandBuffer; + VkBool32 nestedCommandBufferRendering; + VkBool32 nestedCommandBufferSimultaneousUse; +} VkPhysicalDeviceNestedCommandBufferFeaturesEXT; + +typedef struct VkPhysicalDeviceNestedCommandBufferPropertiesEXT { + VkStructureType sType; + void* pNext; + uint32_t maxCommandBufferNestingLevel; +} VkPhysicalDeviceNestedCommandBufferPropertiesEXT; + + + +// VK_EXT_external_memory_acquire_unmodified is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_external_memory_acquire_unmodified 1 +#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_SPEC_VERSION 1 +#define VK_EXT_EXTERNAL_MEMORY_ACQUIRE_UNMODIFIED_EXTENSION_NAME "VK_EXT_external_memory_acquire_unmodified" +typedef struct VkExternalMemoryAcquireUnmodifiedEXT { + VkStructureType sType; + const void* pNext; + VkBool32 acquireUnmodifiedMemory; +} VkExternalMemoryAcquireUnmodifiedEXT; + + + +// VK_EXT_extended_dynamic_state3 is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_extended_dynamic_state3 1 +#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_SPEC_VERSION 2 +#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME "VK_EXT_extended_dynamic_state3" +typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 extendedDynamicState3TessellationDomainOrigin; + VkBool32 extendedDynamicState3DepthClampEnable; + VkBool32 extendedDynamicState3PolygonMode; + VkBool32 extendedDynamicState3RasterizationSamples; + VkBool32 extendedDynamicState3SampleMask; + VkBool32 extendedDynamicState3AlphaToCoverageEnable; + VkBool32 extendedDynamicState3AlphaToOneEnable; + VkBool32 extendedDynamicState3LogicOpEnable; + VkBool32 extendedDynamicState3ColorBlendEnable; + VkBool32 extendedDynamicState3ColorBlendEquation; + VkBool32 extendedDynamicState3ColorWriteMask; + VkBool32 extendedDynamicState3RasterizationStream; + VkBool32 extendedDynamicState3ConservativeRasterizationMode; + VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize; + VkBool32 extendedDynamicState3DepthClipEnable; + VkBool32 extendedDynamicState3SampleLocationsEnable; + VkBool32 extendedDynamicState3ColorBlendAdvanced; + VkBool32 extendedDynamicState3ProvokingVertexMode; + VkBool32 extendedDynamicState3LineRasterizationMode; + VkBool32 extendedDynamicState3LineStippleEnable; + VkBool32 extendedDynamicState3DepthClipNegativeOneToOne; + VkBool32 extendedDynamicState3ViewportWScalingEnable; + VkBool32 extendedDynamicState3ViewportSwizzle; + VkBool32 extendedDynamicState3CoverageToColorEnable; + VkBool32 extendedDynamicState3CoverageToColorLocation; + VkBool32 extendedDynamicState3CoverageModulationMode; + VkBool32 extendedDynamicState3CoverageModulationTableEnable; + VkBool32 extendedDynamicState3CoverageModulationTable; + VkBool32 extendedDynamicState3CoverageReductionMode; + VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable; + VkBool32 extendedDynamicState3ShadingRateImageEnable; +} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT; + +typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT { + VkStructureType sType; + void* pNext; + VkBool32 dynamicPrimitiveTopologyUnrestricted; +} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT; + +typedef struct VkColorBlendEquationEXT { + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; +} VkColorBlendEquationEXT; + +typedef struct VkColorBlendAdvancedEXT { + VkBlendOp advancedBlendOp; + VkBool32 srcPremultiplied; + VkBool32 dstPremultiplied; + VkBlendOverlapEXT blendOverlap; + VkBool32 clampResults; +} VkColorBlendAdvancedEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetPolygonModeEXT)(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode); +typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples); +typedef void (VKAPI_PTR *PFN_vkCmdSetSampleMaskEXT)(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask* pSampleMask); +typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToCoverageEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToOneEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32* pColorBlendEnables); +typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT* pColorBlendEquations); +typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags* pColorWriteMasks); +typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer commandBuffer, uint32_t rasterizationStream); +typedef void (VKAPI_PTR *PFN_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode); +typedef void (VKAPI_PTR *PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendAdvancedEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT* pColorBlendAdvanced); +typedef void (VKAPI_PTR *PFN_vkCmdSetProvokingVertexModeEXT)(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode); +typedef void (VKAPI_PTR *PFN_vkCmdSetLineRasterizationModeEXT)(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode); +typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipNegativeOneToOneEXT)(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne); +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingEnableNV)(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetViewportSwizzleNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV* pViewportSwizzles); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorEnableNV)(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorLocationNV)(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationModeNV)(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableEnableNV)(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableNV)(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float* pCoverageModulationTable); +typedef void (VKAPI_PTR *PFN_vkCmdSetShadingRateImageEnableNV)(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetRepresentativeFragmentTestEnableNV)(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable); +typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT( + VkCommandBuffer commandBuffer, + VkTessellationDomainOrigin domainOrigin); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClampEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 depthClampEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetPolygonModeEXT( + VkCommandBuffer commandBuffer, + VkPolygonMode polygonMode); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizationSamplesEXT( + VkCommandBuffer commandBuffer, + VkSampleCountFlagBits rasterizationSamples); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleMaskEXT( + VkCommandBuffer commandBuffer, + VkSampleCountFlagBits samples, + const VkSampleMask* pSampleMask); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetAlphaToCoverageEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 alphaToCoverageEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetAlphaToOneEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 alphaToOneEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetLogicOpEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 logicOpEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendEnableEXT( + VkCommandBuffer commandBuffer, + uint32_t firstAttachment, + uint32_t attachmentCount, + const VkBool32* pColorBlendEnables); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendEquationEXT( + VkCommandBuffer commandBuffer, + uint32_t firstAttachment, + uint32_t attachmentCount, + const VkColorBlendEquationEXT* pColorBlendEquations); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWriteMaskEXT( + VkCommandBuffer commandBuffer, + uint32_t firstAttachment, + uint32_t attachmentCount, + const VkColorComponentFlags* pColorWriteMasks); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizationStreamEXT( + VkCommandBuffer commandBuffer, + uint32_t rasterizationStream); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetConservativeRasterizationModeEXT( + VkCommandBuffer commandBuffer, + VkConservativeRasterizationModeEXT conservativeRasterizationMode); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetExtraPrimitiveOverestimationSizeEXT( + VkCommandBuffer commandBuffer, + float extraPrimitiveOverestimationSize); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClipEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 depthClipEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 sampleLocationsEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendAdvancedEXT( + VkCommandBuffer commandBuffer, + uint32_t firstAttachment, + uint32_t attachmentCount, + const VkColorBlendAdvancedEXT* pColorBlendAdvanced); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetProvokingVertexModeEXT( + VkCommandBuffer commandBuffer, + VkProvokingVertexModeEXT provokingVertexMode); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetLineRasterizationModeEXT( + VkCommandBuffer commandBuffer, + VkLineRasterizationModeEXT lineRasterizationMode); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEnableEXT( + VkCommandBuffer commandBuffer, + VkBool32 stippledLineEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClipNegativeOneToOneEXT( + VkCommandBuffer commandBuffer, + VkBool32 negativeOneToOne); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingEnableNV( + VkCommandBuffer commandBuffer, + VkBool32 viewportWScalingEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportSwizzleNV( + VkCommandBuffer commandBuffer, + uint32_t firstViewport, + uint32_t viewportCount, + const VkViewportSwizzleNV* pViewportSwizzles); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageToColorEnableNV( + VkCommandBuffer commandBuffer, + VkBool32 coverageToColorEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageToColorLocationNV( + VkCommandBuffer commandBuffer, + uint32_t coverageToColorLocation); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationModeNV( + VkCommandBuffer commandBuffer, + VkCoverageModulationModeNV coverageModulationMode); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationTableEnableNV( + VkCommandBuffer commandBuffer, + VkBool32 coverageModulationTableEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationTableNV( + VkCommandBuffer commandBuffer, + uint32_t coverageModulationTableCount, + const float* pCoverageModulationTable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetShadingRateImageEnableNV( + VkCommandBuffer commandBuffer, + VkBool32 shadingRateImageEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetRepresentativeFragmentTestEnableNV( + VkCommandBuffer commandBuffer, + VkBool32 representativeFragmentTestEnable); + +VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageReductionModeNV( + VkCommandBuffer commandBuffer, + VkCoverageReductionModeNV coverageReductionMode); +#endif + + +// VK_EXT_subpass_merge_feedback is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_subpass_merge_feedback 1 #define VK_EXT_SUBPASS_MERGE_FEEDBACK_SPEC_VERSION 2 #define VK_EXT_SUBPASS_MERGE_FEEDBACK_EXTENSION_NAME "VK_EXT_subpass_merge_feedback" @@ -14478,6 +17998,38 @@ typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT { +// VK_LUNARG_direct_driver_loading is a preprocessor guard. Do not pass it to API calls. +#define VK_LUNARG_direct_driver_loading 1 +#define VK_LUNARG_DIRECT_DRIVER_LOADING_SPEC_VERSION 1 +#define VK_LUNARG_DIRECT_DRIVER_LOADING_EXTENSION_NAME "VK_LUNARG_direct_driver_loading" + +typedef enum VkDirectDriverLoadingModeLUNARG { + VK_DIRECT_DRIVER_LOADING_MODE_EXCLUSIVE_LUNARG = 0, + VK_DIRECT_DRIVER_LOADING_MODE_INCLUSIVE_LUNARG = 1, + VK_DIRECT_DRIVER_LOADING_MODE_MAX_ENUM_LUNARG = 0x7FFFFFFF +} VkDirectDriverLoadingModeLUNARG; +typedef VkFlags VkDirectDriverLoadingFlagsLUNARG; +typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)( + VkInstance instance, const char* pName); + +typedef struct VkDirectDriverLoadingInfoLUNARG { + VkStructureType sType; + void* pNext; + VkDirectDriverLoadingFlagsLUNARG flags; + PFN_vkGetInstanceProcAddrLUNARG pfnGetInstanceProcAddr; +} VkDirectDriverLoadingInfoLUNARG; + +typedef struct VkDirectDriverLoadingListLUNARG { + VkStructureType sType; + const void* pNext; + VkDirectDriverLoadingModeLUNARG mode; + uint32_t driverCount; + const VkDirectDriverLoadingInfoLUNARG* pDrivers; +} VkDirectDriverLoadingListLUNARG; + + + +// VK_EXT_shader_module_identifier is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_shader_module_identifier 1 #define VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT 32U #define VK_EXT_SHADER_MODULE_IDENTIFIER_SPEC_VERSION 1 @@ -14524,11 +18076,178 @@ VKAPI_ATTR void VKAPI_CALL vkGetShaderModuleCreateInfoIdentifierEXT( #endif +// VK_EXT_rasterization_order_attachment_access is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_rasterization_order_attachment_access 1 #define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1 #define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_EXT_rasterization_order_attachment_access" +// VK_NV_optical_flow is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_optical_flow 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV) +#define VK_NV_OPTICAL_FLOW_SPEC_VERSION 1 +#define VK_NV_OPTICAL_FLOW_EXTENSION_NAME "VK_NV_optical_flow" + +typedef enum VkOpticalFlowPerformanceLevelNV { + VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV = 0, + VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV = 1, + VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV = 2, + VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV = 3, + VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowPerformanceLevelNV; + +typedef enum VkOpticalFlowSessionBindingPointNV { + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV = 0, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV = 1, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV = 2, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_HINT_NV = 3, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV = 4, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_FLOW_VECTOR_NV = 5, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_COST_NV = 6, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_COST_NV = 7, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_GLOBAL_FLOW_NV = 8, + VK_OPTICAL_FLOW_SESSION_BINDING_POINT_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowSessionBindingPointNV; + +typedef enum VkOpticalFlowGridSizeFlagBitsNV { + VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV = 0, + VK_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV = 0x00000001, + VK_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV = 0x00000002, + VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0x00000004, + VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0x00000008, + VK_OPTICAL_FLOW_GRID_SIZE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowGridSizeFlagBitsNV; +typedef VkFlags VkOpticalFlowGridSizeFlagsNV; + +typedef enum VkOpticalFlowUsageFlagBitsNV { + VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV = 0, + VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV = 0x00000001, + VK_OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV = 0x00000002, + VK_OPTICAL_FLOW_USAGE_HINT_BIT_NV = 0x00000004, + VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0x00000008, + VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0x00000010, + VK_OPTICAL_FLOW_USAGE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowUsageFlagBitsNV; +typedef VkFlags VkOpticalFlowUsageFlagsNV; + +typedef enum VkOpticalFlowSessionCreateFlagBitsNV { + VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV = 0x00000001, + VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV = 0x00000002, + VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV = 0x00000004, + VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0x00000008, + VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0x00000010, + VK_OPTICAL_FLOW_SESSION_CREATE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowSessionCreateFlagBitsNV; +typedef VkFlags VkOpticalFlowSessionCreateFlagsNV; + +typedef enum VkOpticalFlowExecuteFlagBitsNV { + VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0x00000001, + VK_OPTICAL_FLOW_EXECUTE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF +} VkOpticalFlowExecuteFlagBitsNV; +typedef VkFlags VkOpticalFlowExecuteFlagsNV; +typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 opticalFlow; +} VkPhysicalDeviceOpticalFlowFeaturesNV; + +typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV { + VkStructureType sType; + void* pNext; + VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes; + VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes; + VkBool32 hintSupported; + VkBool32 costSupported; + VkBool32 bidirectionalFlowSupported; + VkBool32 globalFlowSupported; + uint32_t minWidth; + uint32_t minHeight; + uint32_t maxWidth; + uint32_t maxHeight; + uint32_t maxNumRegionsOfInterest; +} VkPhysicalDeviceOpticalFlowPropertiesNV; + +typedef struct VkOpticalFlowImageFormatInfoNV { + VkStructureType sType; + const void* pNext; + VkOpticalFlowUsageFlagsNV usage; +} VkOpticalFlowImageFormatInfoNV; + +typedef struct VkOpticalFlowImageFormatPropertiesNV { + VkStructureType sType; + const void* pNext; + VkFormat format; +} VkOpticalFlowImageFormatPropertiesNV; + +typedef struct VkOpticalFlowSessionCreateInfoNV { + VkStructureType sType; + void* pNext; + uint32_t width; + uint32_t height; + VkFormat imageFormat; + VkFormat flowVectorFormat; + VkFormat costFormat; + VkOpticalFlowGridSizeFlagsNV outputGridSize; + VkOpticalFlowGridSizeFlagsNV hintGridSize; + VkOpticalFlowPerformanceLevelNV performanceLevel; + VkOpticalFlowSessionCreateFlagsNV flags; +} VkOpticalFlowSessionCreateInfoNV; + +typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV { + VkStructureType sType; + void* pNext; + uint32_t id; + uint32_t size; + const void* pPrivateData; +} VkOpticalFlowSessionCreatePrivateDataInfoNV; + +typedef struct VkOpticalFlowExecuteInfoNV { + VkStructureType sType; + void* pNext; + VkOpticalFlowExecuteFlagsNV flags; + uint32_t regionCount; + const VkRect2D* pRegions; +} VkOpticalFlowExecuteInfoNV; + +typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo, uint32_t* pFormatCount, VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties); +typedef VkResult (VKAPI_PTR *PFN_vkCreateOpticalFlowSessionNV)(VkDevice device, const VkOpticalFlowSessionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkOpticalFlowSessionNV* pSession); +typedef void (VKAPI_PTR *PFN_vkDestroyOpticalFlowSessionNV)(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkBindOpticalFlowSessionImageNV)(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout); +typedef void (VKAPI_PTR *PFN_vkCmdOpticalFlowExecuteNV)(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV* pExecuteInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceOpticalFlowImageFormatsNV( + VkPhysicalDevice physicalDevice, + const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo, + uint32_t* pFormatCount, + VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties); + +VKAPI_ATTR VkResult VKAPI_CALL vkCreateOpticalFlowSessionNV( + VkDevice device, + const VkOpticalFlowSessionCreateInfoNV* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkOpticalFlowSessionNV* pSession); + +VKAPI_ATTR void VKAPI_CALL vkDestroyOpticalFlowSessionNV( + VkDevice device, + VkOpticalFlowSessionNV session, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkBindOpticalFlowSessionImageNV( + VkDevice device, + VkOpticalFlowSessionNV session, + VkOpticalFlowSessionBindingPointNV bindingPoint, + VkImageView view, + VkImageLayout layout); + +VKAPI_ATTR void VKAPI_CALL vkCmdOpticalFlowExecuteNV( + VkCommandBuffer commandBuffer, + VkOpticalFlowSessionNV session, + const VkOpticalFlowExecuteInfoNV* pExecuteInfo); +#endif + + +// VK_EXT_legacy_dithering is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_legacy_dithering 1 #define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 1 #define VK_EXT_LEGACY_DITHERING_EXTENSION_NAME "VK_EXT_legacy_dithering" @@ -14540,6 +18259,106 @@ typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT { +// VK_EXT_pipeline_protected_access is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_pipeline_protected_access 1 +#define VK_EXT_PIPELINE_PROTECTED_ACCESS_SPEC_VERSION 1 +#define VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME "VK_EXT_pipeline_protected_access" +typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 pipelineProtectedAccess; +} VkPhysicalDevicePipelineProtectedAccessFeaturesEXT; + + + +// VK_EXT_shader_object is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_shader_object 1 +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderEXT) +#define VK_EXT_SHADER_OBJECT_SPEC_VERSION 1 +#define VK_EXT_SHADER_OBJECT_EXTENSION_NAME "VK_EXT_shader_object" + +typedef enum VkShaderCodeTypeEXT { + VK_SHADER_CODE_TYPE_BINARY_EXT = 0, + VK_SHADER_CODE_TYPE_SPIRV_EXT = 1, + VK_SHADER_CODE_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkShaderCodeTypeEXT; + +typedef enum VkShaderCreateFlagBitsEXT { + VK_SHADER_CREATE_LINK_STAGE_BIT_EXT = 0x00000001, + VK_SHADER_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000002, + VK_SHADER_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = 0x00000004, + VK_SHADER_CREATE_NO_TASK_SHADER_BIT_EXT = 0x00000008, + VK_SHADER_CREATE_DISPATCH_BASE_BIT_EXT = 0x00000010, + VK_SHADER_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_EXT = 0x00000020, + VK_SHADER_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00000040, + VK_SHADER_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF +} VkShaderCreateFlagBitsEXT; +typedef VkFlags VkShaderCreateFlagsEXT; +typedef struct VkPhysicalDeviceShaderObjectFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 shaderObject; +} VkPhysicalDeviceShaderObjectFeaturesEXT; + +typedef struct VkPhysicalDeviceShaderObjectPropertiesEXT { + VkStructureType sType; + void* pNext; + uint8_t shaderBinaryUUID[VK_UUID_SIZE]; + uint32_t shaderBinaryVersion; +} VkPhysicalDeviceShaderObjectPropertiesEXT; + +typedef struct VkShaderCreateInfoEXT { + VkStructureType sType; + const void* pNext; + VkShaderCreateFlagsEXT flags; + VkShaderStageFlagBits stage; + VkShaderStageFlags nextStage; + VkShaderCodeTypeEXT codeType; + size_t codeSize; + const void* pCode; + const char* pName; + uint32_t setLayoutCount; + const VkDescriptorSetLayout* pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange* pPushConstantRanges; + const VkSpecializationInfo* pSpecializationInfo; +} VkShaderCreateInfoEXT; + +typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkShaderRequiredSubgroupSizeCreateInfoEXT; + +typedef VkResult (VKAPI_PTR *PFN_vkCreateShadersEXT)(VkDevice device, uint32_t createInfoCount, const VkShaderCreateInfoEXT* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkShaderEXT* pShaders); +typedef void (VKAPI_PTR *PFN_vkDestroyShaderEXT)(VkDevice device, VkShaderEXT shader, const VkAllocationCallbacks* pAllocator); +typedef VkResult (VKAPI_PTR *PFN_vkGetShaderBinaryDataEXT)(VkDevice device, VkShaderEXT shader, size_t* pDataSize, void* pData); +typedef void (VKAPI_PTR *PFN_vkCmdBindShadersEXT)(VkCommandBuffer commandBuffer, uint32_t stageCount, const VkShaderStageFlagBits* pStages, const VkShaderEXT* pShaders); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkCreateShadersEXT( + VkDevice device, + uint32_t createInfoCount, + const VkShaderCreateInfoEXT* pCreateInfos, + const VkAllocationCallbacks* pAllocator, + VkShaderEXT* pShaders); + +VKAPI_ATTR void VKAPI_CALL vkDestroyShaderEXT( + VkDevice device, + VkShaderEXT shader, + const VkAllocationCallbacks* pAllocator); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetShaderBinaryDataEXT( + VkDevice device, + VkShaderEXT shader, + size_t* pDataSize, + void* pData); + +VKAPI_ATTR void VKAPI_CALL vkCmdBindShadersEXT( + VkCommandBuffer commandBuffer, + uint32_t stageCount, + const VkShaderStageFlagBits* pStages, + const VkShaderEXT* pShaders); +#endif + + +// VK_QCOM_tile_properties is a preprocessor guard. Do not pass it to API calls. #define VK_QCOM_tile_properties 1 #define VK_QCOM_TILE_PROPERTIES_SPEC_VERSION 1 #define VK_QCOM_TILE_PROPERTIES_EXTENSION_NAME "VK_QCOM_tile_properties" @@ -14574,6 +18393,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDynamicRenderingTilePropertiesQCOM( #endif +// VK_SEC_amigo_profiling is a preprocessor guard. Do not pass it to API calls. #define VK_SEC_amigo_profiling 1 #define VK_SEC_AMIGO_PROFILING_SPEC_VERSION 1 #define VK_SEC_AMIGO_PROFILING_EXTENSION_NAME "VK_SEC_amigo_profiling" @@ -14592,8 +18412,454 @@ typedef struct VkAmigoProfilingSubmitInfoSEC { +// VK_QCOM_multiview_per_view_viewports is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_multiview_per_view_viewports 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_SPEC_VERSION 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_VIEWPORTS_EXTENSION_NAME "VK_QCOM_multiview_per_view_viewports" +typedef struct VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 multiviewPerViewViewports; +} VkPhysicalDeviceMultiviewPerViewViewportsFeaturesQCOM; + + + +// VK_NV_ray_tracing_invocation_reorder is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_ray_tracing_invocation_reorder 1 +#define VK_NV_RAY_TRACING_INVOCATION_REORDER_SPEC_VERSION 1 +#define VK_NV_RAY_TRACING_INVOCATION_REORDER_EXTENSION_NAME "VK_NV_ray_tracing_invocation_reorder" + +typedef enum VkRayTracingInvocationReorderModeNV { + VK_RAY_TRACING_INVOCATION_REORDER_MODE_NONE_NV = 0, + VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_NV = 1, + VK_RAY_TRACING_INVOCATION_REORDER_MODE_MAX_ENUM_NV = 0x7FFFFFFF +} VkRayTracingInvocationReorderModeNV; +typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV { + VkStructureType sType; + void* pNext; + VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint; +} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV; + +typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 rayTracingInvocationReorder; +} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV; + + + +// VK_NV_extended_sparse_address_space is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_extended_sparse_address_space 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_SPEC_VERSION 1 +#define VK_NV_EXTENDED_SPARSE_ADDRESS_SPACE_EXTENSION_NAME "VK_NV_extended_sparse_address_space" +typedef struct VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 extendedSparseAddressSpace; +} VkPhysicalDeviceExtendedSparseAddressSpaceFeaturesNV; + +typedef struct VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV { + VkStructureType sType; + void* pNext; + VkDeviceSize extendedSparseAddressSpaceSize; + VkImageUsageFlags extendedSparseImageUsageFlags; + VkBufferUsageFlags extendedSparseBufferUsageFlags; +} VkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV; + + + +// VK_EXT_mutable_descriptor_type is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_mutable_descriptor_type 1 +#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1 +#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type" + + +// VK_EXT_layer_settings is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_layer_settings 1 +#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 2 +#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings" + +typedef enum VkLayerSettingTypeEXT { + VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0, + VK_LAYER_SETTING_TYPE_INT32_EXT = 1, + VK_LAYER_SETTING_TYPE_INT64_EXT = 2, + VK_LAYER_SETTING_TYPE_UINT32_EXT = 3, + VK_LAYER_SETTING_TYPE_UINT64_EXT = 4, + VK_LAYER_SETTING_TYPE_FLOAT32_EXT = 5, + VK_LAYER_SETTING_TYPE_FLOAT64_EXT = 6, + VK_LAYER_SETTING_TYPE_STRING_EXT = 7, + VK_LAYER_SETTING_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF +} VkLayerSettingTypeEXT; +typedef struct VkLayerSettingEXT { + const char* pLayerName; + const char* pSettingName; + VkLayerSettingTypeEXT type; + uint32_t valueCount; + const void* pValues; +} VkLayerSettingEXT; + +typedef struct VkLayerSettingsCreateInfoEXT { + VkStructureType sType; + const void* pNext; + uint32_t settingCount; + const VkLayerSettingEXT* pSettings; +} VkLayerSettingsCreateInfoEXT; + + + +// VK_ARM_shader_core_builtins is a preprocessor guard. Do not pass it to API calls. +#define VK_ARM_shader_core_builtins 1 +#define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2 +#define VK_ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME "VK_ARM_shader_core_builtins" +typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM { + VkStructureType sType; + void* pNext; + VkBool32 shaderCoreBuiltins; +} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM; + +typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM { + VkStructureType sType; + void* pNext; + uint64_t shaderCoreMask; + uint32_t shaderCoreCount; + uint32_t shaderWarpsPerCore; +} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM; + + + +// VK_EXT_pipeline_library_group_handles is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_pipeline_library_group_handles 1 +#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_SPEC_VERSION 1 +#define VK_EXT_PIPELINE_LIBRARY_GROUP_HANDLES_EXTENSION_NAME "VK_EXT_pipeline_library_group_handles" +typedef struct VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 pipelineLibraryGroupHandles; +} VkPhysicalDevicePipelineLibraryGroupHandlesFeaturesEXT; + + + +// VK_EXT_dynamic_rendering_unused_attachments is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_dynamic_rendering_unused_attachments 1 +#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_SPEC_VERSION 1 +#define VK_EXT_DYNAMIC_RENDERING_UNUSED_ATTACHMENTS_EXTENSION_NAME "VK_EXT_dynamic_rendering_unused_attachments" +typedef struct VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 dynamicRenderingUnusedAttachments; +} VkPhysicalDeviceDynamicRenderingUnusedAttachmentsFeaturesEXT; + + + +// VK_NV_low_latency2 is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_low_latency2 1 +#define VK_NV_LOW_LATENCY_2_SPEC_VERSION 2 +#define VK_NV_LOW_LATENCY_2_EXTENSION_NAME "VK_NV_low_latency2" + +typedef enum VkLatencyMarkerNV { + VK_LATENCY_MARKER_SIMULATION_START_NV = 0, + VK_LATENCY_MARKER_SIMULATION_END_NV = 1, + VK_LATENCY_MARKER_RENDERSUBMIT_START_NV = 2, + VK_LATENCY_MARKER_RENDERSUBMIT_END_NV = 3, + VK_LATENCY_MARKER_PRESENT_START_NV = 4, + VK_LATENCY_MARKER_PRESENT_END_NV = 5, + VK_LATENCY_MARKER_INPUT_SAMPLE_NV = 6, + VK_LATENCY_MARKER_TRIGGER_FLASH_NV = 7, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_START_NV = 8, + VK_LATENCY_MARKER_OUT_OF_BAND_RENDERSUBMIT_END_NV = 9, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_START_NV = 10, + VK_LATENCY_MARKER_OUT_OF_BAND_PRESENT_END_NV = 11, + VK_LATENCY_MARKER_MAX_ENUM_NV = 0x7FFFFFFF +} VkLatencyMarkerNV; + +typedef enum VkOutOfBandQueueTypeNV { + VK_OUT_OF_BAND_QUEUE_TYPE_RENDER_NV = 0, + VK_OUT_OF_BAND_QUEUE_TYPE_PRESENT_NV = 1, + VK_OUT_OF_BAND_QUEUE_TYPE_MAX_ENUM_NV = 0x7FFFFFFF +} VkOutOfBandQueueTypeNV; +typedef struct VkLatencySleepModeInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 lowLatencyMode; + VkBool32 lowLatencyBoost; + uint32_t minimumIntervalUs; +} VkLatencySleepModeInfoNV; + +typedef struct VkLatencySleepInfoNV { + VkStructureType sType; + const void* pNext; + VkSemaphore signalSemaphore; + uint64_t value; +} VkLatencySleepInfoNV; + +typedef struct VkSetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + VkLatencyMarkerNV marker; +} VkSetLatencyMarkerInfoNV; + +typedef struct VkLatencyTimingsFrameReportNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; + uint64_t inputSampleTimeUs; + uint64_t simStartTimeUs; + uint64_t simEndTimeUs; + uint64_t renderSubmitStartTimeUs; + uint64_t renderSubmitEndTimeUs; + uint64_t presentStartTimeUs; + uint64_t presentEndTimeUs; + uint64_t driverStartTimeUs; + uint64_t driverEndTimeUs; + uint64_t osRenderQueueStartTimeUs; + uint64_t osRenderQueueEndTimeUs; + uint64_t gpuRenderStartTimeUs; + uint64_t gpuRenderEndTimeUs; +} VkLatencyTimingsFrameReportNV; + +typedef struct VkGetLatencyMarkerInfoNV { + VkStructureType sType; + const void* pNext; + uint32_t timingCount; + VkLatencyTimingsFrameReportNV* pTimings; +} VkGetLatencyMarkerInfoNV; + +typedef struct VkLatencySubmissionPresentIdNV { + VkStructureType sType; + const void* pNext; + uint64_t presentID; +} VkLatencySubmissionPresentIdNV; + +typedef struct VkSwapchainLatencyCreateInfoNV { + VkStructureType sType; + const void* pNext; + VkBool32 latencyModeEnable; +} VkSwapchainLatencyCreateInfoNV; + +typedef struct VkOutOfBandQueueTypeInfoNV { + VkStructureType sType; + const void* pNext; + VkOutOfBandQueueTypeNV queueType; +} VkOutOfBandQueueTypeInfoNV; + +typedef struct VkLatencySurfaceCapabilitiesNV { + VkStructureType sType; + const void* pNext; + uint32_t presentModeCount; + VkPresentModeKHR* pPresentModes; +} VkLatencySurfaceCapabilitiesNV; + +typedef VkResult (VKAPI_PTR *PFN_vkSetLatencySleepModeNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepModeInfoNV* pSleepModeInfo); +typedef VkResult (VKAPI_PTR *PFN_vkLatencySleepNV)(VkDevice device, VkSwapchainKHR swapchain, const VkLatencySleepInfoNV* pSleepInfo); +typedef void (VKAPI_PTR *PFN_vkSetLatencyMarkerNV)(VkDevice device, VkSwapchainKHR swapchain, const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkGetLatencyTimingsNV)(VkDevice device, VkSwapchainKHR swapchain, VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); +typedef void (VKAPI_PTR *PFN_vkQueueNotifyOutOfBandNV)(VkQueue queue, const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkSetLatencySleepModeNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepModeInfoNV* pSleepModeInfo); + +VKAPI_ATTR VkResult VKAPI_CALL vkLatencySleepNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkLatencySleepInfoNV* pSleepInfo); + +VKAPI_ATTR void VKAPI_CALL vkSetLatencyMarkerNV( + VkDevice device, + VkSwapchainKHR swapchain, + const VkSetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkGetLatencyTimingsNV( + VkDevice device, + VkSwapchainKHR swapchain, + VkGetLatencyMarkerInfoNV* pLatencyMarkerInfo); + +VKAPI_ATTR void VKAPI_CALL vkQueueNotifyOutOfBandNV( + VkQueue queue, + const VkOutOfBandQueueTypeInfoNV* pQueueTypeInfo); +#endif + + +// VK_QCOM_multiview_per_view_render_areas is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_multiview_per_view_render_areas 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_SPEC_VERSION 1 +#define VK_QCOM_MULTIVIEW_PER_VIEW_RENDER_AREAS_EXTENSION_NAME "VK_QCOM_multiview_per_view_render_areas" +typedef struct VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 multiviewPerViewRenderAreas; +} VkPhysicalDeviceMultiviewPerViewRenderAreasFeaturesQCOM; + +typedef struct VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM { + VkStructureType sType; + const void* pNext; + uint32_t perViewRenderAreaCount; + const VkRect2D* pPerViewRenderAreas; +} VkMultiviewPerViewRenderAreasRenderPassBeginInfoQCOM; + + + +// VK_NV_per_stage_descriptor_set is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_per_stage_descriptor_set 1 +#define VK_NV_PER_STAGE_DESCRIPTOR_SET_SPEC_VERSION 1 +#define VK_NV_PER_STAGE_DESCRIPTOR_SET_EXTENSION_NAME "VK_NV_per_stage_descriptor_set" +typedef struct VkPhysicalDevicePerStageDescriptorSetFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 perStageDescriptorSet; + VkBool32 dynamicPipelineLayout; +} VkPhysicalDevicePerStageDescriptorSetFeaturesNV; + + + +// VK_QCOM_image_processing2 is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_image_processing2 1 +#define VK_QCOM_IMAGE_PROCESSING_2_SPEC_VERSION 1 +#define VK_QCOM_IMAGE_PROCESSING_2_EXTENSION_NAME "VK_QCOM_image_processing2" + +typedef enum VkBlockMatchWindowCompareModeQCOM { + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MIN_QCOM = 0, + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_QCOM = 1, + VK_BLOCK_MATCH_WINDOW_COMPARE_MODE_MAX_ENUM_QCOM = 0x7FFFFFFF +} VkBlockMatchWindowCompareModeQCOM; +typedef struct VkPhysicalDeviceImageProcessing2FeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 textureBlockMatch2; +} VkPhysicalDeviceImageProcessing2FeaturesQCOM; + +typedef struct VkPhysicalDeviceImageProcessing2PropertiesQCOM { + VkStructureType sType; + void* pNext; + VkExtent2D maxBlockMatchWindow; +} VkPhysicalDeviceImageProcessing2PropertiesQCOM; + +typedef struct VkSamplerBlockMatchWindowCreateInfoQCOM { + VkStructureType sType; + const void* pNext; + VkExtent2D windowExtent; + VkBlockMatchWindowCompareModeQCOM windowCompareMode; +} VkSamplerBlockMatchWindowCreateInfoQCOM; + + + +// VK_QCOM_filter_cubic_weights is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_filter_cubic_weights 1 +#define VK_QCOM_FILTER_CUBIC_WEIGHTS_SPEC_VERSION 1 +#define VK_QCOM_FILTER_CUBIC_WEIGHTS_EXTENSION_NAME "VK_QCOM_filter_cubic_weights" + +typedef enum VkCubicFilterWeightsQCOM { + VK_CUBIC_FILTER_WEIGHTS_CATMULL_ROM_QCOM = 0, + VK_CUBIC_FILTER_WEIGHTS_ZERO_TANGENT_CARDINAL_QCOM = 1, + VK_CUBIC_FILTER_WEIGHTS_B_SPLINE_QCOM = 2, + VK_CUBIC_FILTER_WEIGHTS_MITCHELL_NETRAVALI_QCOM = 3, + VK_CUBIC_FILTER_WEIGHTS_MAX_ENUM_QCOM = 0x7FFFFFFF +} VkCubicFilterWeightsQCOM; +typedef struct VkPhysicalDeviceCubicWeightsFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 selectableCubicWeights; +} VkPhysicalDeviceCubicWeightsFeaturesQCOM; + +typedef struct VkSamplerCubicWeightsCreateInfoQCOM { + VkStructureType sType; + const void* pNext; + VkCubicFilterWeightsQCOM cubicWeights; +} VkSamplerCubicWeightsCreateInfoQCOM; + +typedef struct VkBlitImageCubicWeightsInfoQCOM { + VkStructureType sType; + const void* pNext; + VkCubicFilterWeightsQCOM cubicWeights; +} VkBlitImageCubicWeightsInfoQCOM; + + + +// VK_QCOM_ycbcr_degamma is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_ycbcr_degamma 1 +#define VK_QCOM_YCBCR_DEGAMMA_SPEC_VERSION 1 +#define VK_QCOM_YCBCR_DEGAMMA_EXTENSION_NAME "VK_QCOM_ycbcr_degamma" +typedef struct VkPhysicalDeviceYcbcrDegammaFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 ycbcrDegamma; +} VkPhysicalDeviceYcbcrDegammaFeaturesQCOM; + +typedef struct VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM { + VkStructureType sType; + void* pNext; + VkBool32 enableYDegamma; + VkBool32 enableCbCrDegamma; +} VkSamplerYcbcrConversionYcbcrDegammaCreateInfoQCOM; + + + +// VK_QCOM_filter_cubic_clamp is a preprocessor guard. Do not pass it to API calls. +#define VK_QCOM_filter_cubic_clamp 1 +#define VK_QCOM_FILTER_CUBIC_CLAMP_SPEC_VERSION 1 +#define VK_QCOM_FILTER_CUBIC_CLAMP_EXTENSION_NAME "VK_QCOM_filter_cubic_clamp" +typedef struct VkPhysicalDeviceCubicClampFeaturesQCOM { + VkStructureType sType; + void* pNext; + VkBool32 cubicRangeClamp; +} VkPhysicalDeviceCubicClampFeaturesQCOM; + + + +// VK_EXT_attachment_feedback_loop_dynamic_state is a preprocessor guard. Do not pass it to API calls. +#define VK_EXT_attachment_feedback_loop_dynamic_state 1 +#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION 1 +#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_dynamic_state" +typedef struct VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT { + VkStructureType sType; + void* pNext; + VkBool32 attachmentFeedbackLoopDynamicState; +} VkPhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT; + +typedef void (VKAPI_PTR *PFN_vkCmdSetAttachmentFeedbackLoopEnableEXT)(VkCommandBuffer commandBuffer, VkImageAspectFlags aspectMask); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR void VKAPI_CALL vkCmdSetAttachmentFeedbackLoopEnableEXT( + VkCommandBuffer commandBuffer, + VkImageAspectFlags aspectMask); +#endif + + +// VK_MSFT_layered_driver is a preprocessor guard. Do not pass it to API calls. +#define VK_MSFT_layered_driver 1 +#define VK_MSFT_LAYERED_DRIVER_SPEC_VERSION 1 +#define VK_MSFT_LAYERED_DRIVER_EXTENSION_NAME "VK_MSFT_layered_driver" + +typedef enum VkLayeredDriverUnderlyingApiMSFT { + VK_LAYERED_DRIVER_UNDERLYING_API_NONE_MSFT = 0, + VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT = 1, + VK_LAYERED_DRIVER_UNDERLYING_API_MAX_ENUM_MSFT = 0x7FFFFFFF +} VkLayeredDriverUnderlyingApiMSFT; +typedef struct VkPhysicalDeviceLayeredDriverPropertiesMSFT { + VkStructureType sType; + void* pNext; + VkLayeredDriverUnderlyingApiMSFT underlyingAPI; +} VkPhysicalDeviceLayeredDriverPropertiesMSFT; + + + +// VK_NV_descriptor_pool_overallocation is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_descriptor_pool_overallocation 1 +#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_SPEC_VERSION 1 +#define VK_NV_DESCRIPTOR_POOL_OVERALLOCATION_EXTENSION_NAME "VK_NV_descriptor_pool_overallocation" +typedef struct VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV { + VkStructureType sType; + void* pNext; + VkBool32 descriptorPoolOverallocation; +} VkPhysicalDeviceDescriptorPoolOverallocationFeaturesNV; + + + +// VK_KHR_acceleration_structure is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_acceleration_structure 1 -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR) #define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13 #define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure" @@ -14603,30 +18869,13 @@ typedef enum VkBuildAccelerationStructureModeKHR { VK_BUILD_ACCELERATION_STRUCTURE_MODE_MAX_ENUM_KHR = 0x7FFFFFFF } VkBuildAccelerationStructureModeKHR; -typedef enum VkAccelerationStructureBuildTypeKHR { - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2, - VK_ACCELERATION_STRUCTURE_BUILD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF -} VkAccelerationStructureBuildTypeKHR; - -typedef enum VkAccelerationStructureCompatibilityKHR { - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1, - VK_ACCELERATION_STRUCTURE_COMPATIBILITY_MAX_ENUM_KHR = 0x7FFFFFFF -} VkAccelerationStructureCompatibilityKHR; - typedef enum VkAccelerationStructureCreateFlagBitsKHR { VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x00000001, + VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008, VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0x00000004, VK_ACCELERATION_STRUCTURE_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF } VkAccelerationStructureCreateFlagBitsKHR; typedef VkFlags VkAccelerationStructureCreateFlagsKHR; -typedef union VkDeviceOrHostAddressKHR { - VkDeviceAddress deviceAddress; - void* hostAddress; -} VkDeviceOrHostAddressKHR; - typedef struct VkAccelerationStructureBuildRangeInfoKHR { uint32_t primitiveCount; uint32_t primitiveOffset; @@ -14885,6 +19134,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetAccelerationStructureBuildSizesKHR( #endif +// VK_KHR_ray_tracing_pipeline is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_ray_tracing_pipeline 1 #define VK_KHR_RAY_TRACING_PIPELINE_SPEC_VERSION 1 #define VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME "VK_KHR_ray_tracing_pipeline" @@ -15021,6 +19271,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetRayTracingPipelineStackSizeKHR( #endif +// VK_KHR_ray_query is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_ray_query 1 #define VK_KHR_RAY_QUERY_SPEC_VERSION 1 #define VK_KHR_RAY_QUERY_EXTENSION_NAME "VK_KHR_ray_query" @@ -15032,6 +19283,7 @@ typedef struct VkPhysicalDeviceRayQueryFeaturesKHR { +// VK_EXT_mesh_shader is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_mesh_shader 1 #define VK_EXT_MESH_SHADER_SPEC_VERSION 1 #define VK_EXT_MESH_SHADER_EXTENSION_NAME "VK_EXT_mesh_shader" diff --git a/src/video/khronos/vulkan/vulkan_directfb.h b/src/video/khronos/vulkan/vulkan_directfb.h index ab3504efafd12..f06f80b70e377 100644 --- a/src/video/khronos/vulkan/vulkan_directfb.h +++ b/src/video/khronos/vulkan/vulkan_directfb.h @@ -2,7 +2,7 @@ #define VULKAN_DIRECTFB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_EXT_directfb_surface is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_directfb_surface 1 #define VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION 1 #define VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME "VK_EXT_directfb_surface" diff --git a/src/video/khronos/vulkan/vulkan_enums.hpp b/src/video/khronos/vulkan/vulkan_enums.hpp deleted file mode 100644 index 1c540cfdd7f2a..0000000000000 --- a/src/video/khronos/vulkan/vulkan_enums.hpp +++ /dev/null @@ -1,8538 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_ENUMS_HPP -#define VULKAN_ENUMS_HPP - -namespace VULKAN_HPP_NAMESPACE -{ - template - struct CppType - { - }; - - template - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = false; - }; - - //============= - //=== ENUMs === - //============= - - //=== VK_VERSION_1_0 === - - enum class Result - { - eSuccess = VK_SUCCESS, - eNotReady = VK_NOT_READY, - eTimeout = VK_TIMEOUT, - eEventSet = VK_EVENT_SET, - eEventReset = VK_EVENT_RESET, - eIncomplete = VK_INCOMPLETE, - eErrorOutOfHostMemory = VK_ERROR_OUT_OF_HOST_MEMORY, - eErrorOutOfDeviceMemory = VK_ERROR_OUT_OF_DEVICE_MEMORY, - eErrorInitializationFailed = VK_ERROR_INITIALIZATION_FAILED, - eErrorDeviceLost = VK_ERROR_DEVICE_LOST, - eErrorMemoryMapFailed = VK_ERROR_MEMORY_MAP_FAILED, - eErrorLayerNotPresent = VK_ERROR_LAYER_NOT_PRESENT, - eErrorExtensionNotPresent = VK_ERROR_EXTENSION_NOT_PRESENT, - eErrorFeatureNotPresent = VK_ERROR_FEATURE_NOT_PRESENT, - eErrorIncompatibleDriver = VK_ERROR_INCOMPATIBLE_DRIVER, - eErrorTooManyObjects = VK_ERROR_TOO_MANY_OBJECTS, - eErrorFormatNotSupported = VK_ERROR_FORMAT_NOT_SUPPORTED, - eErrorFragmentedPool = VK_ERROR_FRAGMENTED_POOL, - eErrorUnknown = VK_ERROR_UNKNOWN, - eErrorOutOfPoolMemory = VK_ERROR_OUT_OF_POOL_MEMORY, - eErrorInvalidExternalHandle = VK_ERROR_INVALID_EXTERNAL_HANDLE, - eErrorFragmentation = VK_ERROR_FRAGMENTATION, - eErrorInvalidOpaqueCaptureAddress = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, - ePipelineCompileRequired = VK_PIPELINE_COMPILE_REQUIRED, - eErrorSurfaceLostKHR = VK_ERROR_SURFACE_LOST_KHR, - eErrorNativeWindowInUseKHR = VK_ERROR_NATIVE_WINDOW_IN_USE_KHR, - eSuboptimalKHR = VK_SUBOPTIMAL_KHR, - eErrorOutOfDateKHR = VK_ERROR_OUT_OF_DATE_KHR, - eErrorIncompatibleDisplayKHR = VK_ERROR_INCOMPATIBLE_DISPLAY_KHR, - eErrorValidationFailedEXT = VK_ERROR_VALIDATION_FAILED_EXT, - eErrorInvalidShaderNV = VK_ERROR_INVALID_SHADER_NV, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eErrorImageUsageNotSupportedKHR = VK_ERROR_IMAGE_USAGE_NOT_SUPPORTED_KHR, - eErrorVideoPictureLayoutNotSupportedKHR = VK_ERROR_VIDEO_PICTURE_LAYOUT_NOT_SUPPORTED_KHR, - eErrorVideoProfileOperationNotSupportedKHR = VK_ERROR_VIDEO_PROFILE_OPERATION_NOT_SUPPORTED_KHR, - eErrorVideoProfileFormatNotSupportedKHR = VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR, - eErrorVideoProfileCodecNotSupportedKHR = VK_ERROR_VIDEO_PROFILE_CODEC_NOT_SUPPORTED_KHR, - eErrorVideoStdVersionNotSupportedKHR = VK_ERROR_VIDEO_STD_VERSION_NOT_SUPPORTED_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eErrorInvalidDrmFormatModifierPlaneLayoutEXT = VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT, - eErrorNotPermittedKHR = VK_ERROR_NOT_PERMITTED_KHR, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eErrorFullScreenExclusiveModeLostEXT = VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eThreadIdleKHR = VK_THREAD_IDLE_KHR, - eThreadDoneKHR = VK_THREAD_DONE_KHR, - eOperationDeferredKHR = VK_OPERATION_DEFERRED_KHR, - eOperationNotDeferredKHR = VK_OPERATION_NOT_DEFERRED_KHR, - eErrorCompressionExhaustedEXT = VK_ERROR_COMPRESSION_EXHAUSTED_EXT, - eErrorFragmentationEXT = VK_ERROR_FRAGMENTATION_EXT, - eErrorInvalidDeviceAddressEXT = VK_ERROR_INVALID_DEVICE_ADDRESS_EXT, - eErrorInvalidExternalHandleKHR = VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR, - eErrorInvalidOpaqueCaptureAddressKHR = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR, - eErrorNotPermittedEXT = VK_ERROR_NOT_PERMITTED_EXT, - eErrorOutOfPoolMemoryKHR = VK_ERROR_OUT_OF_POOL_MEMORY_KHR, - eErrorPipelineCompileRequiredEXT = VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT, - ePipelineCompileRequiredEXT = VK_PIPELINE_COMPILE_REQUIRED_EXT - }; - - enum class StructureType - { - eApplicationInfo = VK_STRUCTURE_TYPE_APPLICATION_INFO, - eInstanceCreateInfo = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, - eDeviceQueueCreateInfo = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, - eDeviceCreateInfo = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - eSubmitInfo = VK_STRUCTURE_TYPE_SUBMIT_INFO, - eMemoryAllocateInfo = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - eMappedMemoryRange = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, - eBindSparseInfo = VK_STRUCTURE_TYPE_BIND_SPARSE_INFO, - eFenceCreateInfo = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, - eSemaphoreCreateInfo = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, - eEventCreateInfo = VK_STRUCTURE_TYPE_EVENT_CREATE_INFO, - eQueryPoolCreateInfo = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO, - eBufferCreateInfo = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - eBufferViewCreateInfo = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO, - eImageCreateInfo = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - eImageViewCreateInfo = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, - eShaderModuleCreateInfo = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO, - ePipelineCacheCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO, - ePipelineShaderStageCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, - ePipelineVertexInputStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, - ePipelineInputAssemblyStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO, - ePipelineTessellationStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO, - ePipelineViewportStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, - ePipelineRasterizationStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, - ePipelineMultisampleStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, - ePipelineDepthStencilStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, - ePipelineColorBlendStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO, - ePipelineDynamicStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO, - eGraphicsPipelineCreateInfo = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, - eComputePipelineCreateInfo = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, - ePipelineLayoutCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, - eSamplerCreateInfo = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, - eDescriptorSetLayoutCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, - eDescriptorPoolCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, - eDescriptorSetAllocateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - eWriteDescriptorSet = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, - eCopyDescriptorSet = VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET, - eFramebufferCreateInfo = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - eRenderPassCreateInfo = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, - eCommandPoolCreateInfo = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, - eCommandBufferAllocateInfo = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, - eCommandBufferInheritanceInfo = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO, - eCommandBufferBeginInfo = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, - eRenderPassBeginInfo = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, - eBufferMemoryBarrier = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, - eImageMemoryBarrier = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - eMemoryBarrier = VK_STRUCTURE_TYPE_MEMORY_BARRIER, - eLoaderInstanceCreateInfo = VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO, - eLoaderDeviceCreateInfo = VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO, - ePhysicalDeviceSubgroupProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES, - eBindBufferMemoryInfo = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO, - eBindImageMemoryInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO, - ePhysicalDevice16BitStorageFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES, - eMemoryDedicatedRequirements = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS, - eMemoryDedicatedAllocateInfo = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO, - eMemoryAllocateFlagsInfo = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO, - eDeviceGroupRenderPassBeginInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO, - eDeviceGroupCommandBufferBeginInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO, - eDeviceGroupSubmitInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO, - eDeviceGroupBindSparseInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO, - eBindBufferMemoryDeviceGroupInfo = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO, - eBindImageMemoryDeviceGroupInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO, - ePhysicalDeviceGroupProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES, - eDeviceGroupDeviceCreateInfo = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO, - eBufferMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2, - eImageMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, - eImageSparseMemoryRequirementsInfo2 = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2, - eMemoryRequirements2 = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, - eSparseImageMemoryRequirements2 = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2, - ePhysicalDeviceFeatures2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, - ePhysicalDeviceProperties2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - eFormatProperties2 = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2, - eImageFormatProperties2 = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, - ePhysicalDeviceImageFormatInfo2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, - eQueueFamilyProperties2 = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, - ePhysicalDeviceMemoryProperties2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2, - eSparseImageFormatProperties2 = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2, - ePhysicalDeviceSparseImageFormatInfo2 = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2, - ePhysicalDevicePointClippingProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES, - eRenderPassInputAttachmentAspectCreateInfo = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO, - eImageViewUsageCreateInfo = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO, - ePipelineTessellationDomainOriginStateCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO, - eRenderPassMultiviewCreateInfo = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO, - ePhysicalDeviceMultiviewFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES, - ePhysicalDeviceMultiviewProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES, - ePhysicalDeviceVariablePointersFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - eProtectedSubmitInfo = VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO, - ePhysicalDeviceProtectedMemoryFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES, - ePhysicalDeviceProtectedMemoryProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES, - eDeviceQueueInfo2 = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, - eSamplerYcbcrConversionCreateInfo = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO, - eSamplerYcbcrConversionInfo = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO, - eBindImagePlaneMemoryInfo = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO, - eImagePlaneMemoryRequirementsInfo = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO, - ePhysicalDeviceSamplerYcbcrConversionFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES, - eSamplerYcbcrConversionImageFormatProperties = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES, - eDescriptorUpdateTemplateCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, - ePhysicalDeviceExternalImageFormatInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO, - eExternalImageFormatProperties = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES, - ePhysicalDeviceExternalBufferInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO, - eExternalBufferProperties = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES, - ePhysicalDeviceIdProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES, - eExternalMemoryBufferCreateInfo = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO, - eExternalMemoryImageCreateInfo = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, - eExportMemoryAllocateInfo = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO, - ePhysicalDeviceExternalFenceInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO, - eExternalFenceProperties = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES, - eExportFenceCreateInfo = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO, - eExportSemaphoreCreateInfo = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO, - ePhysicalDeviceExternalSemaphoreInfo = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO, - eExternalSemaphoreProperties = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES, - ePhysicalDeviceMaintenance3Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES, - eDescriptorSetLayoutSupport = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT, - ePhysicalDeviceShaderDrawParametersFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, - ePhysicalDeviceVulkan11Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES, - ePhysicalDeviceVulkan11Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES, - ePhysicalDeviceVulkan12Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES, - ePhysicalDeviceVulkan12Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES, - eImageFormatListCreateInfo = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO, - eAttachmentDescription2 = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2, - eAttachmentReference2 = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2, - eSubpassDescription2 = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2, - eSubpassDependency2 = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2, - eRenderPassCreateInfo2 = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2, - eSubpassBeginInfo = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, - eSubpassEndInfo = VK_STRUCTURE_TYPE_SUBPASS_END_INFO, - ePhysicalDevice8BitStorageFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES, - ePhysicalDeviceDriverProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, - ePhysicalDeviceShaderAtomicInt64Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES, - ePhysicalDeviceShaderFloat16Int8Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES, - ePhysicalDeviceFloatControlsProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES, - eDescriptorSetLayoutBindingFlagsCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, - ePhysicalDeviceDescriptorIndexingFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES, - ePhysicalDeviceDescriptorIndexingProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES, - eDescriptorSetVariableDescriptorCountAllocateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO, - eDescriptorSetVariableDescriptorCountLayoutSupport = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT, - ePhysicalDeviceDepthStencilResolveProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES, - eSubpassDescriptionDepthStencilResolve = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE, - ePhysicalDeviceScalarBlockLayoutFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES, - eImageStencilUsageCreateInfo = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO, - ePhysicalDeviceSamplerFilterMinmaxProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES, - eSamplerReductionModeCreateInfo = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO, - ePhysicalDeviceVulkanMemoryModelFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES, - ePhysicalDeviceImagelessFramebufferFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES, - eFramebufferAttachmentsCreateInfo = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO, - eFramebufferAttachmentImageInfo = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO, - eRenderPassAttachmentBeginInfo = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO, - ePhysicalDeviceUniformBufferStandardLayoutFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, - ePhysicalDeviceShaderSubgroupExtendedTypesFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES, - ePhysicalDeviceSeparateDepthStencilLayoutsFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES, - eAttachmentReferenceStencilLayout = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT, - eAttachmentDescriptionStencilLayout = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT, - ePhysicalDeviceHostQueryResetFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES, - ePhysicalDeviceTimelineSemaphoreFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, - ePhysicalDeviceTimelineSemaphoreProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES, - eSemaphoreTypeCreateInfo = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO, - eTimelineSemaphoreSubmitInfo = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO, - eSemaphoreWaitInfo = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, - eSemaphoreSignalInfo = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO, - ePhysicalDeviceBufferDeviceAddressFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES, - eBufferDeviceAddressInfo = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO, - eBufferOpaqueCaptureAddressCreateInfo = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO, - eMemoryOpaqueCaptureAddressAllocateInfo = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO, - eDeviceMemoryOpaqueCaptureAddressInfo = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO, - ePhysicalDeviceVulkan13Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES, - ePhysicalDeviceVulkan13Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES, - ePipelineCreationFeedbackCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, - ePhysicalDeviceShaderTerminateInvocationFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES, - ePhysicalDeviceToolProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES, - ePhysicalDeviceShaderDemoteToHelperInvocationFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES, - ePhysicalDevicePrivateDataFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES, - eDevicePrivateDataCreateInfo = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO, - ePrivateDataSlotCreateInfo = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO, - ePhysicalDevicePipelineCreationCacheControlFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES, - eMemoryBarrier2 = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2, - eBufferMemoryBarrier2 = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2, - eImageMemoryBarrier2 = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2, - eDependencyInfo = VK_STRUCTURE_TYPE_DEPENDENCY_INFO, - eSubmitInfo2 = VK_STRUCTURE_TYPE_SUBMIT_INFO_2, - eSemaphoreSubmitInfo = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, - eCommandBufferSubmitInfo = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, - ePhysicalDeviceSynchronization2Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES, - ePhysicalDeviceZeroInitializeWorkgroupMemoryFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES, - ePhysicalDeviceImageRobustnessFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES, - eCopyBufferInfo2 = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2, - eCopyImageInfo2 = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2, - eCopyBufferToImageInfo2 = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2, - eCopyImageToBufferInfo2 = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2, - eBlitImageInfo2 = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2, - eResolveImageInfo2 = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2, - eBufferCopy2 = VK_STRUCTURE_TYPE_BUFFER_COPY_2, - eImageCopy2 = VK_STRUCTURE_TYPE_IMAGE_COPY_2, - eImageBlit2 = VK_STRUCTURE_TYPE_IMAGE_BLIT_2, - eBufferImageCopy2 = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2, - eImageResolve2 = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2, - ePhysicalDeviceSubgroupSizeControlProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, - ePipelineShaderStageRequiredSubgroupSizeCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO, - ePhysicalDeviceSubgroupSizeControlFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES, - ePhysicalDeviceInlineUniformBlockFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES, - ePhysicalDeviceInlineUniformBlockProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES, - eWriteDescriptorSetInlineUniformBlock = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK, - eDescriptorPoolInlineUniformBlockCreateInfo = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO, - ePhysicalDeviceTextureCompressionAstcHdrFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES, - eRenderingInfo = VK_STRUCTURE_TYPE_RENDERING_INFO, - eRenderingAttachmentInfo = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO, - ePipelineRenderingCreateInfo = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO, - ePhysicalDeviceDynamicRenderingFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES, - eCommandBufferInheritanceRenderingInfo = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO, - ePhysicalDeviceShaderIntegerDotProductFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES, - ePhysicalDeviceShaderIntegerDotProductProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES, - ePhysicalDeviceTexelBufferAlignmentProperties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES, - eFormatProperties3 = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3, - ePhysicalDeviceMaintenance4Features = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES, - ePhysicalDeviceMaintenance4Properties = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES, - eDeviceBufferMemoryRequirements = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS, - eDeviceImageMemoryRequirements = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS, - eSwapchainCreateInfoKHR = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, - ePresentInfoKHR = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, - eDeviceGroupPresentCapabilitiesKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR, - eImageSwapchainCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR, - eBindImageMemorySwapchainInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR, - eAcquireNextImageInfoKHR = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR, - eDeviceGroupPresentInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR, - eDeviceGroupSwapchainCreateInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR, - eDisplayModeCreateInfoKHR = VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR, - eDisplaySurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR, - eDisplayPresentInfoKHR = VK_STRUCTURE_TYPE_DISPLAY_PRESENT_INFO_KHR, -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - eXlibSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR, -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ -#if defined( VK_USE_PLATFORM_XCB_KHR ) - eXcbSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, -#endif /*VK_USE_PLATFORM_XCB_KHR*/ -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - eWaylandSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - eAndroidSurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eWin32SurfaceCreateInfoKHR = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eDebugReportCallbackCreateInfoEXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT, - ePipelineRasterizationStateRasterizationOrderAMD = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD, - eDebugMarkerObjectNameInfoEXT = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT, - eDebugMarkerObjectTagInfoEXT = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT, - eDebugMarkerMarkerInfoEXT = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoProfileInfoKHR = VK_STRUCTURE_TYPE_VIDEO_PROFILE_INFO_KHR, - eVideoCapabilitiesKHR = VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR, - eVideoPictureResourceInfoKHR = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, - eVideoSessionMemoryRequirementsKHR = VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR, - eBindVideoSessionMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_VIDEO_SESSION_MEMORY_INFO_KHR, - eVideoSessionCreateInfoKHR = VK_STRUCTURE_TYPE_VIDEO_SESSION_CREATE_INFO_KHR, - eVideoSessionParametersCreateInfoKHR = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, - eVideoSessionParametersUpdateInfoKHR = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_UPDATE_INFO_KHR, - eVideoBeginCodingInfoKHR = VK_STRUCTURE_TYPE_VIDEO_BEGIN_CODING_INFO_KHR, - eVideoEndCodingInfoKHR = VK_STRUCTURE_TYPE_VIDEO_END_CODING_INFO_KHR, - eVideoCodingControlInfoKHR = VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR, - eVideoReferenceSlotInfoKHR = VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, - eQueueFamilyVideoPropertiesKHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR, - eVideoProfileListInfoKHR = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR, - ePhysicalDeviceVideoFormatInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_FORMAT_INFO_KHR, - eVideoFormatPropertiesKHR = VK_STRUCTURE_TYPE_VIDEO_FORMAT_PROPERTIES_KHR, - eQueueFamilyQueryResultStatusPropertiesKHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR, - eVideoDecodeInfoKHR = VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR, - eVideoDecodeCapabilitiesKHR = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR, - eVideoDecodeUsageInfoKHR = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eDedicatedAllocationImageCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV, - eDedicatedAllocationBufferCreateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV, - eDedicatedAllocationMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV, - ePhysicalDeviceTransformFeedbackFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT, - ePhysicalDeviceTransformFeedbackPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT, - ePipelineRasterizationStateStreamCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT, - eCuModuleCreateInfoNVX = VK_STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX, - eCuFunctionCreateInfoNVX = VK_STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX, - eCuLaunchInfoNVX = VK_STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX, - eImageViewHandleInfoNVX = VK_STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX, - eImageViewAddressPropertiesNVX = VK_STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeH264CapabilitiesEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT, - eVideoEncodeH264SessionParametersCreateInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT, - eVideoEncodeH264SessionParametersAddInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT, - eVideoEncodeH264VclFrameInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT, - eVideoEncodeH264DpbSlotInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT, - eVideoEncodeH264NaluSliceInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT, - eVideoEncodeH264EmitPictureParametersInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT, - eVideoEncodeH264ProfileInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT, - eVideoEncodeH264RateControlInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT, - eVideoEncodeH264RateControlLayerInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_LAYER_INFO_EXT, - eVideoEncodeH264ReferenceListsInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_REFERENCE_LISTS_INFO_EXT, - eVideoEncodeH265CapabilitiesEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_EXT, - eVideoEncodeH265SessionParametersCreateInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT, - eVideoEncodeH265SessionParametersAddInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT, - eVideoEncodeH265VclFrameInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT, - eVideoEncodeH265DpbSlotInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT, - eVideoEncodeH265NaluSliceSegmentInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_EXT, - eVideoEncodeH265EmitPictureParametersInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_EMIT_PICTURE_PARAMETERS_INFO_EXT, - eVideoEncodeH265ProfileInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_EXT, - eVideoEncodeH265ReferenceListsInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_REFERENCE_LISTS_INFO_EXT, - eVideoEncodeH265RateControlInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_EXT, - eVideoEncodeH265RateControlLayerInfoEXT = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT, - eVideoDecodeH264CapabilitiesEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT, - eVideoDecodeH264PictureInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT, - eVideoDecodeH264MvcInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_INFO_EXT, - eVideoDecodeH264ProfileInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_EXT, - eVideoDecodeH264SessionParametersCreateInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT, - eVideoDecodeH264SessionParametersAddInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT, - eVideoDecodeH264DpbSlotInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eTextureLodGatherFormatPropertiesAMD = VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD, - eRenderingFragmentShadingRateAttachmentInfoKHR = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR, - eRenderingFragmentDensityMapAttachmentInfoEXT = VK_STRUCTURE_TYPE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_INFO_EXT, - eAttachmentSampleCountInfoAMD = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD, - eMultiviewPerViewAttributesInfoNVX = VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX, -#if defined( VK_USE_PLATFORM_GGP ) - eStreamDescriptorSurfaceCreateInfoGGP = VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP, -#endif /*VK_USE_PLATFORM_GGP*/ - ePhysicalDeviceCornerSampledImageFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV, - eExternalMemoryImageCreateInfoNV = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV, - eExportMemoryAllocateInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eImportMemoryWin32HandleInfoNV = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV, - eExportMemoryWin32HandleInfoNV = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV, - eWin32KeyedMutexAcquireReleaseInfoNV = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eValidationFlagsEXT = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT, -#if defined( VK_USE_PLATFORM_VI_NN ) - eViSurfaceCreateInfoNN = VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN, -#endif /*VK_USE_PLATFORM_VI_NN*/ - eImageViewAstcDecodeModeEXT = VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT, - ePhysicalDeviceAstcDecodeFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT, - ePipelineRobustnessCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT, - ePhysicalDevicePipelineRobustnessFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT, - ePhysicalDevicePipelineRobustnessPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eImportMemoryWin32HandleInfoKHR = VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR, - eExportMemoryWin32HandleInfoKHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR, - eMemoryWin32HandlePropertiesKHR = VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR, - eMemoryGetWin32HandleInfoKHR = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eImportMemoryFdInfoKHR = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR, - eMemoryFdPropertiesKHR = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR, - eMemoryGetFdInfoKHR = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eWin32KeyedMutexAcquireReleaseInfoKHR = VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_KHR, - eImportSemaphoreWin32HandleInfoKHR = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, - eExportSemaphoreWin32HandleInfoKHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR, - eD3D12FenceSubmitInfoKHR = VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR, - eSemaphoreGetWin32HandleInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eImportSemaphoreFdInfoKHR = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR, - eSemaphoreGetFdInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR, - ePhysicalDevicePushDescriptorPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR, - eCommandBufferInheritanceConditionalRenderingInfoEXT = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT, - ePhysicalDeviceConditionalRenderingFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT, - eConditionalRenderingBeginInfoEXT = VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT, - ePresentRegionsKHR = VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR, - ePipelineViewportWScalingStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV, - eSurfaceCapabilities2EXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_EXT, - eDisplayPowerInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT, - eDeviceEventInfoEXT = VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT, - eDisplayEventInfoEXT = VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT, - eSwapchainCounterCreateInfoEXT = VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT, - ePresentTimesInfoGOOGLE = VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE, - ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX, - ePipelineViewportSwizzleStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV, - ePhysicalDeviceDiscardRectanglePropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT, - ePipelineDiscardRectangleStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT, - ePhysicalDeviceConservativeRasterizationPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONSERVATIVE_RASTERIZATION_PROPERTIES_EXT, - ePipelineRasterizationConservativeStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_CONSERVATIVE_STATE_CREATE_INFO_EXT, - ePhysicalDeviceDepthClipEnableFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT, - ePipelineRasterizationDepthClipStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT, - eHdrMetadataEXT = VK_STRUCTURE_TYPE_HDR_METADATA_EXT, - eSharedPresentSurfaceCapabilitiesKHR = VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eImportFenceWin32HandleInfoKHR = VK_STRUCTURE_TYPE_IMPORT_FENCE_WIN32_HANDLE_INFO_KHR, - eExportFenceWin32HandleInfoKHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_WIN32_HANDLE_INFO_KHR, - eFenceGetWin32HandleInfoKHR = VK_STRUCTURE_TYPE_FENCE_GET_WIN32_HANDLE_INFO_KHR, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eImportFenceFdInfoKHR = VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR, - eFenceGetFdInfoKHR = VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR, - ePhysicalDevicePerformanceQueryFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_FEATURES_KHR, - ePhysicalDevicePerformanceQueryPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PERFORMANCE_QUERY_PROPERTIES_KHR, - eQueryPoolPerformanceCreateInfoKHR = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_CREATE_INFO_KHR, - ePerformanceQuerySubmitInfoKHR = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR, - eAcquireProfilingLockInfoKHR = VK_STRUCTURE_TYPE_ACQUIRE_PROFILING_LOCK_INFO_KHR, - ePerformanceCounterKHR = VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_KHR, - ePerformanceCounterDescriptionKHR = VK_STRUCTURE_TYPE_PERFORMANCE_COUNTER_DESCRIPTION_KHR, - ePhysicalDeviceSurfaceInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, - eSurfaceCapabilities2KHR = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR, - eSurfaceFormat2KHR = VK_STRUCTURE_TYPE_SURFACE_FORMAT_2_KHR, - eDisplayProperties2KHR = VK_STRUCTURE_TYPE_DISPLAY_PROPERTIES_2_KHR, - eDisplayPlaneProperties2KHR = VK_STRUCTURE_TYPE_DISPLAY_PLANE_PROPERTIES_2_KHR, - eDisplayModeProperties2KHR = VK_STRUCTURE_TYPE_DISPLAY_MODE_PROPERTIES_2_KHR, - eDisplayPlaneInfo2KHR = VK_STRUCTURE_TYPE_DISPLAY_PLANE_INFO_2_KHR, - eDisplayPlaneCapabilities2KHR = VK_STRUCTURE_TYPE_DISPLAY_PLANE_CAPABILITIES_2_KHR, -#if defined( VK_USE_PLATFORM_IOS_MVK ) - eIosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK, -#endif /*VK_USE_PLATFORM_IOS_MVK*/ -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - eMacosSurfaceCreateInfoMVK = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK, -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - eDebugUtilsObjectNameInfoEXT = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, - eDebugUtilsObjectTagInfoEXT = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT, - eDebugUtilsLabelEXT = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT, - eDebugUtilsMessengerCallbackDataEXT = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CALLBACK_DATA_EXT, - eDebugUtilsMessengerCreateInfoEXT = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT, -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - eAndroidHardwareBufferUsageANDROID = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID, - eAndroidHardwareBufferPropertiesANDROID = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID, - eAndroidHardwareBufferFormatPropertiesANDROID = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID, - eImportAndroidHardwareBufferInfoANDROID = VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, - eMemoryGetAndroidHardwareBufferInfoANDROID = VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID, - eExternalFormatANDROID = VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID, - eAndroidHardwareBufferFormatProperties2ANDROID = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID, -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - eSampleLocationsInfoEXT = VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT, - eRenderPassSampleLocationsBeginInfoEXT = VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT, - ePipelineSampleLocationsStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT, - ePhysicalDeviceSampleLocationsPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT, - eMultisamplePropertiesEXT = VK_STRUCTURE_TYPE_MULTISAMPLE_PROPERTIES_EXT, - ePhysicalDeviceBlendOperationAdvancedFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT, - ePhysicalDeviceBlendOperationAdvancedPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_PROPERTIES_EXT, - ePipelineColorBlendAdvancedStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT, - ePipelineCoverageToColorStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV, - eWriteDescriptorSetAccelerationStructureKHR = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR, - eAccelerationStructureBuildGeometryInfoKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_GEOMETRY_INFO_KHR, - eAccelerationStructureDeviceAddressInfoKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_DEVICE_ADDRESS_INFO_KHR, - eAccelerationStructureGeometryAabbsDataKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_AABBS_DATA_KHR, - eAccelerationStructureGeometryInstancesDataKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_INSTANCES_DATA_KHR, - eAccelerationStructureGeometryTrianglesDataKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR, - eAccelerationStructureGeometryKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR, - eAccelerationStructureVersionInfoKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_VERSION_INFO_KHR, - eCopyAccelerationStructureInfoKHR = VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_INFO_KHR, - eCopyAccelerationStructureToMemoryInfoKHR = VK_STRUCTURE_TYPE_COPY_ACCELERATION_STRUCTURE_TO_MEMORY_INFO_KHR, - eCopyMemoryToAccelerationStructureInfoKHR = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_ACCELERATION_STRUCTURE_INFO_KHR, - ePhysicalDeviceAccelerationStructureFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR, - ePhysicalDeviceAccelerationStructurePropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR, - eAccelerationStructureCreateInfoKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_KHR, - eAccelerationStructureBuildSizesInfoKHR = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_BUILD_SIZES_INFO_KHR, - ePhysicalDeviceRayTracingPipelineFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_FEATURES_KHR, - ePhysicalDeviceRayTracingPipelinePropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR, - eRayTracingPipelineCreateInfoKHR = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_KHR, - eRayTracingShaderGroupCreateInfoKHR = VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_KHR, - eRayTracingPipelineInterfaceCreateInfoKHR = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_INTERFACE_CREATE_INFO_KHR, - ePhysicalDeviceRayQueryFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR, - ePipelineCoverageModulationStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV, - ePhysicalDeviceShaderSmBuiltinsFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_FEATURES_NV, - ePhysicalDeviceShaderSmBuiltinsPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SM_BUILTINS_PROPERTIES_NV, - eDrmFormatModifierPropertiesListEXT = VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT, - ePhysicalDeviceImageDrmFormatModifierInfoEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT, - eImageDrmFormatModifierListCreateInfoEXT = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT, - eImageDrmFormatModifierExplicitCreateInfoEXT = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT, - eImageDrmFormatModifierPropertiesEXT = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT, - eDrmFormatModifierPropertiesList2EXT = VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT, - eValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT, - eShaderModuleValidationCacheCreateInfoEXT = VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - ePhysicalDevicePortabilitySubsetFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR, - ePhysicalDevicePortabilitySubsetPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_PROPERTIES_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - ePipelineViewportShadingRateImageStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SHADING_RATE_IMAGE_STATE_CREATE_INFO_NV, - ePhysicalDeviceShadingRateImageFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_FEATURES_NV, - ePhysicalDeviceShadingRateImagePropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADING_RATE_IMAGE_PROPERTIES_NV, - ePipelineViewportCoarseSampleOrderStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_COARSE_SAMPLE_ORDER_STATE_CREATE_INFO_NV, - eRayTracingPipelineCreateInfoNV = VK_STRUCTURE_TYPE_RAY_TRACING_PIPELINE_CREATE_INFO_NV, - eAccelerationStructureCreateInfoNV = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CREATE_INFO_NV, - eGeometryNV = VK_STRUCTURE_TYPE_GEOMETRY_NV, - eGeometryTrianglesNV = VK_STRUCTURE_TYPE_GEOMETRY_TRIANGLES_NV, - eGeometryAabbNV = VK_STRUCTURE_TYPE_GEOMETRY_AABB_NV, - eBindAccelerationStructureMemoryInfoNV = VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_NV, - eWriteDescriptorSetAccelerationStructureNV = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_NV, - eAccelerationStructureMemoryRequirementsInfoNV = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_INFO_NV, - ePhysicalDeviceRayTracingPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PROPERTIES_NV, - eRayTracingShaderGroupCreateInfoNV = VK_STRUCTURE_TYPE_RAY_TRACING_SHADER_GROUP_CREATE_INFO_NV, - eAccelerationStructureInfoNV = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_INFO_NV, - ePhysicalDeviceRepresentativeFragmentTestFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_REPRESENTATIVE_FRAGMENT_TEST_FEATURES_NV, - ePipelineRepresentativeFragmentTestStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV, - ePhysicalDeviceImageViewImageFormatInfoEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT, - eFilterCubicImageViewImageFormatPropertiesEXT = VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT, - eImportMemoryHostPointerInfoEXT = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT, - eMemoryHostPointerPropertiesEXT = VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT, - ePhysicalDeviceExternalMemoryHostPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, - ePhysicalDeviceShaderClockFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR, - ePipelineCompilerControlCreateInfoAMD = VK_STRUCTURE_TYPE_PIPELINE_COMPILER_CONTROL_CREATE_INFO_AMD, - eCalibratedTimestampInfoEXT = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT, - ePhysicalDeviceShaderCorePropertiesAMD = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeH265CapabilitiesEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT, - eVideoDecodeH265SessionParametersCreateInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT, - eVideoDecodeH265SessionParametersAddInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT, - eVideoDecodeH265ProfileInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_EXT, - eVideoDecodeH265PictureInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PICTURE_INFO_EXT, - eVideoDecodeH265DpbSlotInfoEXT = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eDeviceQueueGlobalPriorityCreateInfoKHR = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR, - ePhysicalDeviceGlobalPriorityQueryFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR, - eQueueFamilyGlobalPriorityPropertiesKHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR, - eDeviceMemoryOverallocationCreateInfoAMD = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD, - ePhysicalDeviceVertexAttributeDivisorPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT, - ePipelineVertexInputDivisorStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT, - ePhysicalDeviceVertexAttributeDivisorFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT, -#if defined( VK_USE_PLATFORM_GGP ) - ePresentFrameTokenGGP = VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, -#endif /*VK_USE_PLATFORM_GGP*/ - ePhysicalDeviceComputeShaderDerivativesFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV, - ePhysicalDeviceMeshShaderFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV, - ePhysicalDeviceMeshShaderPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV, - ePhysicalDeviceShaderImageFootprintFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV, - ePipelineViewportExclusiveScissorStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV, - ePhysicalDeviceExclusiveScissorFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV, - eCheckpointDataNV = VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV, - eQueueFamilyCheckpointPropertiesNV = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV, - ePhysicalDeviceShaderIntegerFunctions2FeaturesINTEL = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL, - eQueryPoolPerformanceQueryCreateInfoINTEL = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL, - eInitializePerformanceApiInfoINTEL = VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL, - ePerformanceMarkerInfoINTEL = VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL, - ePerformanceStreamMarkerInfoINTEL = VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL, - ePerformanceOverrideInfoINTEL = VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL, - ePerformanceConfigurationAcquireInfoINTEL = VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL, - ePhysicalDevicePciBusInfoPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT, - eDisplayNativeHdrSurfaceCapabilitiesAMD = VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD, - eSwapchainDisplayNativeHdrCreateInfoAMD = VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eImagepipeSurfaceCreateInfoFUCHSIA = VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ -#if defined( VK_USE_PLATFORM_METAL_EXT ) - eMetalSurfaceCreateInfoEXT = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - ePhysicalDeviceFragmentDensityMapFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT, - ePhysicalDeviceFragmentDensityMapPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT, - eRenderPassFragmentDensityMapCreateInfoEXT = VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT, - eFragmentShadingRateAttachmentInfoKHR = VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR, - ePipelineFragmentShadingRateStateCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR, - ePhysicalDeviceFragmentShadingRatePropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR, - ePhysicalDeviceFragmentShadingRateFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR, - ePhysicalDeviceFragmentShadingRateKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR, - ePhysicalDeviceShaderCoreProperties2AMD = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_2_AMD, - ePhysicalDeviceCoherentMemoryFeaturesAMD = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COHERENT_MEMORY_FEATURES_AMD, - ePhysicalDeviceShaderImageAtomicInt64FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT, - ePhysicalDeviceMemoryBudgetPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT, - ePhysicalDeviceMemoryPriorityFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PRIORITY_FEATURES_EXT, - eMemoryPriorityAllocateInfoEXT = VK_STRUCTURE_TYPE_MEMORY_PRIORITY_ALLOCATE_INFO_EXT, - eSurfaceProtectedCapabilitiesKHR = VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR, - ePhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV, - ePhysicalDeviceBufferDeviceAddressFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT, - eBufferDeviceAddressCreateInfoEXT = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT, - eValidationFeaturesEXT = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT, - ePhysicalDevicePresentWaitFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR, - ePhysicalDeviceCooperativeMatrixFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV, - eCooperativeMatrixPropertiesNV = VK_STRUCTURE_TYPE_COOPERATIVE_MATRIX_PROPERTIES_NV, - ePhysicalDeviceCooperativeMatrixPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_PROPERTIES_NV, - ePhysicalDeviceCoverageReductionModeFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COVERAGE_REDUCTION_MODE_FEATURES_NV, - ePipelineCoverageReductionStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_REDUCTION_STATE_CREATE_INFO_NV, - eFramebufferMixedSamplesCombinationNV = VK_STRUCTURE_TYPE_FRAMEBUFFER_MIXED_SAMPLES_COMBINATION_NV, - ePhysicalDeviceFragmentShaderInterlockFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT, - ePhysicalDeviceYcbcrImageArraysFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_IMAGE_ARRAYS_FEATURES_EXT, - ePhysicalDeviceProvokingVertexFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_FEATURES_EXT, - ePipelineRasterizationProvokingVertexStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_PROVOKING_VERTEX_STATE_CREATE_INFO_EXT, - ePhysicalDeviceProvokingVertexPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROVOKING_VERTEX_PROPERTIES_EXT, -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - eSurfaceFullScreenExclusiveInfoEXT = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT, - eSurfaceCapabilitiesFullScreenExclusiveEXT = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_FULL_SCREEN_EXCLUSIVE_EXT, - eSurfaceFullScreenExclusiveWin32InfoEXT = VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_WIN32_INFO_EXT, -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - eHeadlessSurfaceCreateInfoEXT = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT, - ePhysicalDeviceLineRasterizationFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES_EXT, - ePipelineRasterizationLineStateCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT, - ePhysicalDeviceLineRasterizationPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES_EXT, - ePhysicalDeviceShaderAtomicFloatFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT, - ePhysicalDeviceIndexTypeUint8FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT, - ePhysicalDeviceExtendedDynamicStateFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT, - ePhysicalDevicePipelineExecutablePropertiesFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR, - ePipelineInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR, - ePipelineExecutablePropertiesKHR = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_PROPERTIES_KHR, - ePipelineExecutableInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INFO_KHR, - ePipelineExecutableStatisticKHR = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_STATISTIC_KHR, - ePipelineExecutableInternalRepresentationKHR = VK_STRUCTURE_TYPE_PIPELINE_EXECUTABLE_INTERNAL_REPRESENTATION_KHR, - ePhysicalDeviceShaderAtomicFloat2FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_2_FEATURES_EXT, - ePhysicalDeviceDeviceGeneratedCommandsPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_PROPERTIES_NV, - eGraphicsShaderGroupCreateInfoNV = VK_STRUCTURE_TYPE_GRAPHICS_SHADER_GROUP_CREATE_INFO_NV, - eGraphicsPipelineShaderGroupsCreateInfoNV = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_SHADER_GROUPS_CREATE_INFO_NV, - eIndirectCommandsLayoutTokenNV = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_TOKEN_NV, - eIndirectCommandsLayoutCreateInfoNV = VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NV, - eGeneratedCommandsInfoNV = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV, - eGeneratedCommandsMemoryRequirementsInfoNV = VK_STRUCTURE_TYPE_GENERATED_COMMANDS_MEMORY_REQUIREMENTS_INFO_NV, - ePhysicalDeviceDeviceGeneratedCommandsFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV, - ePhysicalDeviceInheritedViewportScissorFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV, - eCommandBufferInheritanceViewportScissorInfoNV = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV, - ePhysicalDeviceTexelBufferAlignmentFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT, - eCommandBufferInheritanceRenderPassTransformInfoQCOM = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM, - eRenderPassTransformBeginInfoQCOM = VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM, - ePhysicalDeviceDeviceMemoryReportFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT, - eDeviceDeviceMemoryReportCreateInfoEXT = VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT, - eDeviceMemoryReportCallbackDataEXT = VK_STRUCTURE_TYPE_DEVICE_MEMORY_REPORT_CALLBACK_DATA_EXT, - ePhysicalDeviceRobustness2FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT, - ePhysicalDeviceRobustness2PropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT, - eSamplerCustomBorderColorCreateInfoEXT = VK_STRUCTURE_TYPE_SAMPLER_CUSTOM_BORDER_COLOR_CREATE_INFO_EXT, - ePhysicalDeviceCustomBorderColorPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT, - ePhysicalDeviceCustomBorderColorFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT, - ePipelineLibraryCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR, - ePresentIdKHR = VK_STRUCTURE_TYPE_PRESENT_ID_KHR, - ePhysicalDevicePresentIdFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeInfoKHR = VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR, - eVideoEncodeRateControlInfoKHR = VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR, - eVideoEncodeRateControlLayerInfoKHR = VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR, - eVideoEncodeCapabilitiesKHR = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR, - eVideoEncodeUsageInfoKHR = VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - ePhysicalDeviceDiagnosticsConfigFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV, - eDeviceDiagnosticsConfigCreateInfoNV = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV, -#if defined( VK_USE_PLATFORM_METAL_EXT ) - eExportMetalObjectCreateInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECT_CREATE_INFO_EXT, - eExportMetalObjectsInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_OBJECTS_INFO_EXT, - eExportMetalDeviceInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_DEVICE_INFO_EXT, - eExportMetalCommandQueueInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT, - eExportMetalBufferInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT, - eImportMetalBufferInfoEXT = VK_STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT, - eExportMetalTextureInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT, - eImportMetalTextureInfoEXT = VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT, - eExportMetalIoSurfaceInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT, - eImportMetalIoSurfaceInfoEXT = VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT, - eExportMetalSharedEventInfoEXT = VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT, - eImportMetalSharedEventInfoEXT = VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT, -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - eQueueFamilyCheckpointProperties2NV = VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV, - eCheckpointData2NV = VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV, - ePhysicalDeviceGraphicsPipelineLibraryFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT, - ePhysicalDeviceGraphicsPipelineLibraryPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT, - eGraphicsPipelineLibraryCreateInfoEXT = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT, - ePhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD, - ePhysicalDeviceFragmentShaderBarycentricFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR, - ePhysicalDeviceFragmentShaderBarycentricPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR, - ePhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR, - ePhysicalDeviceFragmentShadingRateEnumsPropertiesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV, - ePhysicalDeviceFragmentShadingRateEnumsFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV, - ePipelineFragmentShadingRateEnumStateCreateInfoNV = VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV, - eAccelerationStructureGeometryMotionTrianglesDataNV = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV, - ePhysicalDeviceRayTracingMotionBlurFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV, - eAccelerationStructureMotionInfoNV = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV, - ePhysicalDeviceMeshShaderFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT, - ePhysicalDeviceMeshShaderPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT, - ePhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT, - ePhysicalDeviceFragmentDensityMap2FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT, - ePhysicalDeviceFragmentDensityMap2PropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT, - eCopyCommandTransformInfoQCOM = VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM, - ePhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR, - ePhysicalDeviceImageCompressionControlFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT, - eImageCompressionControlEXT = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT, - eSubresourceLayout2EXT = VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT, - eImageSubresource2EXT = VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT, - eImageCompressionPropertiesEXT = VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT, - ePhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT, - ePhysicalDevice4444FormatsFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT, - ePhysicalDeviceRgba10X6FormatsFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT, -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - eDirectfbSurfaceCreateInfoEXT = VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT, -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - ePhysicalDeviceMutableDescriptorTypeFeaturesVALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE, - eMutableDescriptorTypeCreateInfoVALVE = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE, - ePhysicalDeviceVertexInputDynamicStateFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT, - eVertexInputBindingDescription2EXT = VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT, - eVertexInputAttributeDescription2EXT = VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT, - ePhysicalDeviceDrmPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT, - ePhysicalDeviceDepthClipControlFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT, - ePipelineViewportDepthClipControlCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT, - ePhysicalDevicePrimitiveTopologyListRestartFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eImportMemoryZirconHandleInfoFUCHSIA = VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA, - eMemoryZirconHandlePropertiesFUCHSIA = VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA, - eMemoryGetZirconHandleInfoFUCHSIA = VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA, - eImportSemaphoreZirconHandleInfoFUCHSIA = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA, - eSemaphoreGetZirconHandleInfoFUCHSIA = VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA, - eBufferCollectionCreateInfoFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA, - eImportMemoryBufferCollectionFUCHSIA = VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA, - eBufferCollectionImageCreateInfoFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA, - eBufferCollectionPropertiesFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA, - eBufferConstraintsInfoFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA, - eBufferCollectionBufferCreateInfoFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA, - eImageConstraintsInfoFUCHSIA = VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA, - eImageFormatConstraintsInfoFUCHSIA = VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA, - eSysmemColorSpaceFUCHSIA = VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA, - eBufferCollectionConstraintsInfoFUCHSIA = VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - eSubpassShadingPipelineCreateInfoHUAWEI = VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI, - ePhysicalDeviceSubpassShadingFeaturesHUAWEI = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI, - ePhysicalDeviceSubpassShadingPropertiesHUAWEI = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI, - ePhysicalDeviceInvocationMaskFeaturesHUAWEI = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI, - eMemoryGetRemoteAddressInfoNV = VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV, - ePhysicalDeviceExternalMemoryRdmaFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV, - ePipelinePropertiesIdentifierEXT = VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT, - ePhysicalDevicePipelinePropertiesFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT, - ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT, - eSubpassResolvePerformanceQueryEXT = VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT, - eMultisampledRenderToSingleSampledInfoEXT = VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT, - ePhysicalDeviceExtendedDynamicState2FeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT, -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - eScreenSurfaceCreateInfoQNX = VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX, -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - ePhysicalDeviceColorWriteEnableFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT, - ePipelineColorWriteCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT, - ePhysicalDevicePrimitivesGeneratedQueryFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT, - ePhysicalDeviceRayTracingMaintenance1FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR, - ePhysicalDeviceImageViewMinLodFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT, - eImageViewMinLodCreateInfoEXT = VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT, - ePhysicalDeviceMultiDrawFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_FEATURES_EXT, - ePhysicalDeviceMultiDrawPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTI_DRAW_PROPERTIES_EXT, - ePhysicalDeviceImage2DViewOf3DFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_2D_VIEW_OF_3D_FEATURES_EXT, - ePhysicalDeviceBorderColorSwizzleFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT, - eSamplerBorderColorComponentMappingCreateInfoEXT = VK_STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT, - ePhysicalDevicePageableDeviceLocalMemoryFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PAGEABLE_DEVICE_LOCAL_MEMORY_FEATURES_EXT, - ePhysicalDeviceDescriptorSetHostMappingFeaturesVALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE, - eDescriptorSetBindingReferenceVALVE = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE, - eDescriptorSetLayoutHostMappingInfoVALVE = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE, - ePhysicalDeviceDepthClampZeroOneFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT, - ePhysicalDeviceNonSeamlessCubeMapFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT, - ePhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM, - ePhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM, - eSubpassFragmentDensityMapOffsetEndInfoQCOM = VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM, - ePhysicalDeviceLinearColorAttachmentFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV, - ePhysicalDeviceImageCompressionControlSwapchainFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT, - ePhysicalDeviceImageProcessingFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM, - ePhysicalDeviceImageProcessingPropertiesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM, - eImageViewSampleWeightCreateInfoQCOM = VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM, - ePhysicalDeviceSubpassMergeFeedbackFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT, - eRenderPassCreationControlEXT = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_CONTROL_EXT, - eRenderPassCreationFeedbackCreateInfoEXT = VK_STRUCTURE_TYPE_RENDER_PASS_CREATION_FEEDBACK_CREATE_INFO_EXT, - eRenderPassSubpassFeedbackCreateInfoEXT = VK_STRUCTURE_TYPE_RENDER_PASS_SUBPASS_FEEDBACK_CREATE_INFO_EXT, - ePhysicalDeviceShaderModuleIdentifierFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_FEATURES_EXT, - ePhysicalDeviceShaderModuleIdentifierPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MODULE_IDENTIFIER_PROPERTIES_EXT, - ePipelineShaderStageModuleIdentifierCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_MODULE_IDENTIFIER_CREATE_INFO_EXT, - eShaderModuleIdentifierEXT = VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT, - ePhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT, - ePhysicalDeviceLegacyDitheringFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LEGACY_DITHERING_FEATURES_EXT, - ePhysicalDeviceTilePropertiesFeaturesQCOM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TILE_PROPERTIES_FEATURES_QCOM, - eTilePropertiesQCOM = VK_STRUCTURE_TYPE_TILE_PROPERTIES_QCOM, - ePhysicalDeviceAmigoProfilingFeaturesSEC = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_AMIGO_PROFILING_FEATURES_SEC, - eAmigoProfilingSubmitInfoSEC = VK_STRUCTURE_TYPE_AMIGO_PROFILING_SUBMIT_INFO_SEC, - eAttachmentDescription2KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2_KHR, - eAttachmentDescriptionStencilLayoutKHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR, - eAttachmentReference2KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2_KHR, - eAttachmentReferenceStencilLayoutKHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR, - eAttachmentSampleCountInfoNV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV, - eBindBufferMemoryDeviceGroupInfoKHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR, - eBindBufferMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR, - eBindImageMemoryDeviceGroupInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR, - eBindImageMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR, - eBindImagePlaneMemoryInfoKHR = VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR, - eBlitImageInfo2KHR = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR, - eBufferCopy2KHR = VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR, - eBufferDeviceAddressInfoEXT = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT, - eBufferDeviceAddressInfoKHR = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_KHR, - eBufferImageCopy2KHR = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR, - eBufferMemoryBarrier2KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR, - eBufferMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR, - eBufferOpaqueCaptureAddressCreateInfoKHR = VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO_KHR, - eCommandBufferInheritanceRenderingInfoKHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR, - eCommandBufferSubmitInfoKHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR, - eCopyBufferInfo2KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR, - eCopyBufferToImageInfo2KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR, - eCopyImageInfo2KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR, - eCopyImageToBufferInfo2KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR, - eDebugReportCreateInfoEXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT, - eDependencyInfoKHR = VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR, - eDescriptorPoolInlineUniformBlockCreateInfoEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT, - eDescriptorSetLayoutBindingFlagsCreateInfoEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT, - eDescriptorSetLayoutSupportKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR, - eDescriptorSetVariableDescriptorCountAllocateInfoEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO_EXT, - eDescriptorSetVariableDescriptorCountLayoutSupportEXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT, - eDescriptorUpdateTemplateCreateInfoKHR = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, - eDeviceBufferMemoryRequirementsKHR = VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS_KHR, - eDeviceGroupBindSparseInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR, - eDeviceGroupCommandBufferBeginInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO_KHR, - eDeviceGroupDeviceCreateInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR, - eDeviceGroupRenderPassBeginInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO_KHR, - eDeviceGroupSubmitInfoKHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO_KHR, - eDeviceImageMemoryRequirementsKHR = VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS_KHR, - eDeviceMemoryOpaqueCaptureAddressInfoKHR = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR, - eDevicePrivateDataCreateInfoEXT = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT, - eDeviceQueueGlobalPriorityCreateInfoEXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT, - eExportFenceCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO_KHR, - eExportMemoryAllocateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, - eExportSemaphoreCreateInfoKHR = VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO_KHR, - eExternalBufferPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES_KHR, - eExternalFencePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES_KHR, - eExternalImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR, - eExternalMemoryBufferCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, - eExternalMemoryImageCreateInfoKHR = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_KHR, - eExternalSemaphorePropertiesKHR = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES_KHR, - eFormatProperties2KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR, - eFormatProperties3KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR, - eFramebufferAttachmentsCreateInfoKHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR, - eFramebufferAttachmentImageInfoKHR = VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR, - eImageBlit2KHR = VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR, - eImageCopy2KHR = VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR, - eImageFormatListCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO_KHR, - eImageFormatProperties2KHR = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR, - eImageMemoryBarrier2KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR, - eImageMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR, - eImagePlaneMemoryRequirementsInfoKHR = VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR, - eImageResolve2KHR = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR, - eImageSparseMemoryRequirementsInfo2KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR, - eImageStencilUsageCreateInfoEXT = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT, - eImageViewUsageCreateInfoKHR = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO_KHR, - eMemoryAllocateFlagsInfoKHR = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR, - eMemoryBarrier2KHR = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR, - eMemoryDedicatedAllocateInfoKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR, - eMemoryDedicatedRequirementsKHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR, - eMemoryOpaqueCaptureAddressAllocateInfoKHR = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR, - eMemoryRequirements2KHR = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR, - ePhysicalDevice16BitStorageFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR, - ePhysicalDevice8BitStorageFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR, - ePhysicalDeviceBufferAddressFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT, - ePhysicalDeviceBufferDeviceAddressFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR, - ePhysicalDeviceDepthStencilResolvePropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR, - ePhysicalDeviceDescriptorIndexingFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT, - ePhysicalDeviceDescriptorIndexingPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT, - ePhysicalDeviceDriverPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR, - ePhysicalDeviceDynamicRenderingFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR, - ePhysicalDeviceExternalBufferInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO_KHR, - ePhysicalDeviceExternalFenceInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO_KHR, - ePhysicalDeviceExternalImageFormatInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR, - ePhysicalDeviceExternalSemaphoreInfoKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO_KHR, - ePhysicalDeviceFeatures2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, - ePhysicalDeviceFloat16Int8FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, - ePhysicalDeviceFloatControlsPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR, - ePhysicalDeviceFragmentShaderBarycentricFeaturesNV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV, - ePhysicalDeviceGlobalPriorityQueryFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT, - ePhysicalDeviceGroupPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR, - ePhysicalDeviceHostQueryResetFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT, - ePhysicalDeviceIdPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR, - ePhysicalDeviceImagelessFramebufferFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES_KHR, - ePhysicalDeviceImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR, - ePhysicalDeviceImageRobustnessFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT, - ePhysicalDeviceInlineUniformBlockFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT, - ePhysicalDeviceInlineUniformBlockPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT, - ePhysicalDeviceMaintenance3PropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR, - ePhysicalDeviceMaintenance4FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR, - ePhysicalDeviceMaintenance4PropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES_KHR, - ePhysicalDeviceMemoryProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR, - ePhysicalDeviceMultiviewFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR, - ePhysicalDeviceMultiviewPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR, - ePhysicalDevicePipelineCreationCacheControlFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT, - ePhysicalDevicePointClippingPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR, - ePhysicalDevicePrivateDataFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT, - ePhysicalDeviceProperties2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR, - ePhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM, - ePhysicalDeviceSamplerFilterMinmaxPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT, - ePhysicalDeviceSamplerYcbcrConversionFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR, - ePhysicalDeviceScalarBlockLayoutFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT, - ePhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR, - ePhysicalDeviceShaderAtomicInt64FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR, - ePhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT, - ePhysicalDeviceShaderDrawParameterFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES, - ePhysicalDeviceShaderFloat16Int8FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR, - ePhysicalDeviceShaderIntegerDotProductFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR, - ePhysicalDeviceShaderIntegerDotProductPropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR, - ePhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR, - ePhysicalDeviceShaderTerminateInvocationFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR, - ePhysicalDeviceSparseImageFormatInfo2KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR, - ePhysicalDeviceSubgroupSizeControlFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT, - ePhysicalDeviceSubgroupSizeControlPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT, - ePhysicalDeviceSynchronization2FeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR, - ePhysicalDeviceTexelBufferAlignmentPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT, - ePhysicalDeviceTextureCompressionAstcHdrFeaturesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT, - ePhysicalDeviceTimelineSemaphoreFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR, - ePhysicalDeviceTimelineSemaphorePropertiesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR, - ePhysicalDeviceToolPropertiesEXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT, - ePhysicalDeviceUniformBufferStandardLayoutFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR, - ePhysicalDeviceVariablePointersFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES_KHR, - ePhysicalDeviceVariablePointerFeatures = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES, - ePhysicalDeviceVariablePointerFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR, - ePhysicalDeviceVulkanMemoryModelFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR, - ePhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR, - ePipelineCreationFeedbackCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT, - ePipelineInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT, - ePipelineRenderingCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR, - ePipelineShaderStageRequiredSubgroupSizeCreateInfoEXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT, - ePipelineTessellationDomainOriginStateCreateInfoKHR = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO_KHR, - ePrivateDataSlotCreateInfoEXT = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT, - eQueryPoolCreateInfoINTEL = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL, - eQueueFamilyGlobalPriorityPropertiesEXT = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT, - eQueueFamilyProperties2KHR = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR, - eRenderingAttachmentInfoKHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR, - eRenderingInfoKHR = VK_STRUCTURE_TYPE_RENDERING_INFO_KHR, - eRenderPassAttachmentBeginInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO_KHR, - eRenderPassCreateInfo2KHR = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2_KHR, - eRenderPassInputAttachmentAspectCreateInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO_KHR, - eRenderPassMultiviewCreateInfoKHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR, - eResolveImageInfo2KHR = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR, - eSamplerReductionModeCreateInfoEXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT, - eSamplerYcbcrConversionCreateInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR, - eSamplerYcbcrConversionImageFormatPropertiesKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR, - eSamplerYcbcrConversionInfoKHR = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR, - eSemaphoreSignalInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR, - eSemaphoreSubmitInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR, - eSemaphoreTypeCreateInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR, - eSemaphoreWaitInfoKHR = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO_KHR, - eSparseImageFormatProperties2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR, - eSparseImageMemoryRequirements2KHR = VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2_KHR, - eSubmitInfo2KHR = VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR, - eSubpassBeginInfoKHR = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO_KHR, - eSubpassDependency2KHR = VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2_KHR, - eSubpassDescription2KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2_KHR, - eSubpassDescriptionDepthStencilResolveKHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR, - eSubpassEndInfoKHR = VK_STRUCTURE_TYPE_SUBPASS_END_INFO_KHR, - eTimelineSemaphoreSubmitInfoKHR = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO_KHR, - eWriteDescriptorSetInlineUniformBlockEXT = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT - }; - - enum class PipelineCacheHeaderVersion - { - eOne = VK_PIPELINE_CACHE_HEADER_VERSION_ONE - }; - - enum class ObjectType - { - eUnknown = VK_OBJECT_TYPE_UNKNOWN, - eInstance = VK_OBJECT_TYPE_INSTANCE, - ePhysicalDevice = VK_OBJECT_TYPE_PHYSICAL_DEVICE, - eDevice = VK_OBJECT_TYPE_DEVICE, - eQueue = VK_OBJECT_TYPE_QUEUE, - eSemaphore = VK_OBJECT_TYPE_SEMAPHORE, - eCommandBuffer = VK_OBJECT_TYPE_COMMAND_BUFFER, - eFence = VK_OBJECT_TYPE_FENCE, - eDeviceMemory = VK_OBJECT_TYPE_DEVICE_MEMORY, - eBuffer = VK_OBJECT_TYPE_BUFFER, - eImage = VK_OBJECT_TYPE_IMAGE, - eEvent = VK_OBJECT_TYPE_EVENT, - eQueryPool = VK_OBJECT_TYPE_QUERY_POOL, - eBufferView = VK_OBJECT_TYPE_BUFFER_VIEW, - eImageView = VK_OBJECT_TYPE_IMAGE_VIEW, - eShaderModule = VK_OBJECT_TYPE_SHADER_MODULE, - ePipelineCache = VK_OBJECT_TYPE_PIPELINE_CACHE, - ePipelineLayout = VK_OBJECT_TYPE_PIPELINE_LAYOUT, - eRenderPass = VK_OBJECT_TYPE_RENDER_PASS, - ePipeline = VK_OBJECT_TYPE_PIPELINE, - eDescriptorSetLayout = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, - eSampler = VK_OBJECT_TYPE_SAMPLER, - eDescriptorPool = VK_OBJECT_TYPE_DESCRIPTOR_POOL, - eDescriptorSet = VK_OBJECT_TYPE_DESCRIPTOR_SET, - eFramebuffer = VK_OBJECT_TYPE_FRAMEBUFFER, - eCommandPool = VK_OBJECT_TYPE_COMMAND_POOL, - eSamplerYcbcrConversion = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION, - eDescriptorUpdateTemplate = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE, - ePrivateDataSlot = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT, - eSurfaceKHR = VK_OBJECT_TYPE_SURFACE_KHR, - eSwapchainKHR = VK_OBJECT_TYPE_SWAPCHAIN_KHR, - eDisplayKHR = VK_OBJECT_TYPE_DISPLAY_KHR, - eDisplayModeKHR = VK_OBJECT_TYPE_DISPLAY_MODE_KHR, - eDebugReportCallbackEXT = VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoSessionKHR = VK_OBJECT_TYPE_VIDEO_SESSION_KHR, - eVideoSessionParametersKHR = VK_OBJECT_TYPE_VIDEO_SESSION_PARAMETERS_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eCuModuleNVX = VK_OBJECT_TYPE_CU_MODULE_NVX, - eCuFunctionNVX = VK_OBJECT_TYPE_CU_FUNCTION_NVX, - eDebugUtilsMessengerEXT = VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT, - eAccelerationStructureKHR = VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR, - eValidationCacheEXT = VK_OBJECT_TYPE_VALIDATION_CACHE_EXT, - eAccelerationStructureNV = VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV, - ePerformanceConfigurationINTEL = VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL, - eDeferredOperationKHR = VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR, - eIndirectCommandsLayoutNV = VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eBufferCollectionFUCHSIA = VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - eDescriptorUpdateTemplateKHR = VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR, - ePrivateDataSlotEXT = VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT, - eSamplerYcbcrConversionKHR = VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR - }; - - enum class VendorId - { - eVIV = VK_VENDOR_ID_VIV, - eVSI = VK_VENDOR_ID_VSI, - eKazan = VK_VENDOR_ID_KAZAN, - eCodeplay = VK_VENDOR_ID_CODEPLAY, - eMESA = VK_VENDOR_ID_MESA, - ePocl = VK_VENDOR_ID_POCL - }; - - enum class Format - { - eUndefined = VK_FORMAT_UNDEFINED, - eR4G4UnormPack8 = VK_FORMAT_R4G4_UNORM_PACK8, - eR4G4B4A4UnormPack16 = VK_FORMAT_R4G4B4A4_UNORM_PACK16, - eB4G4R4A4UnormPack16 = VK_FORMAT_B4G4R4A4_UNORM_PACK16, - eR5G6B5UnormPack16 = VK_FORMAT_R5G6B5_UNORM_PACK16, - eB5G6R5UnormPack16 = VK_FORMAT_B5G6R5_UNORM_PACK16, - eR5G5B5A1UnormPack16 = VK_FORMAT_R5G5B5A1_UNORM_PACK16, - eB5G5R5A1UnormPack16 = VK_FORMAT_B5G5R5A1_UNORM_PACK16, - eA1R5G5B5UnormPack16 = VK_FORMAT_A1R5G5B5_UNORM_PACK16, - eR8Unorm = VK_FORMAT_R8_UNORM, - eR8Snorm = VK_FORMAT_R8_SNORM, - eR8Uscaled = VK_FORMAT_R8_USCALED, - eR8Sscaled = VK_FORMAT_R8_SSCALED, - eR8Uint = VK_FORMAT_R8_UINT, - eR8Sint = VK_FORMAT_R8_SINT, - eR8Srgb = VK_FORMAT_R8_SRGB, - eR8G8Unorm = VK_FORMAT_R8G8_UNORM, - eR8G8Snorm = VK_FORMAT_R8G8_SNORM, - eR8G8Uscaled = VK_FORMAT_R8G8_USCALED, - eR8G8Sscaled = VK_FORMAT_R8G8_SSCALED, - eR8G8Uint = VK_FORMAT_R8G8_UINT, - eR8G8Sint = VK_FORMAT_R8G8_SINT, - eR8G8Srgb = VK_FORMAT_R8G8_SRGB, - eR8G8B8Unorm = VK_FORMAT_R8G8B8_UNORM, - eR8G8B8Snorm = VK_FORMAT_R8G8B8_SNORM, - eR8G8B8Uscaled = VK_FORMAT_R8G8B8_USCALED, - eR8G8B8Sscaled = VK_FORMAT_R8G8B8_SSCALED, - eR8G8B8Uint = VK_FORMAT_R8G8B8_UINT, - eR8G8B8Sint = VK_FORMAT_R8G8B8_SINT, - eR8G8B8Srgb = VK_FORMAT_R8G8B8_SRGB, - eB8G8R8Unorm = VK_FORMAT_B8G8R8_UNORM, - eB8G8R8Snorm = VK_FORMAT_B8G8R8_SNORM, - eB8G8R8Uscaled = VK_FORMAT_B8G8R8_USCALED, - eB8G8R8Sscaled = VK_FORMAT_B8G8R8_SSCALED, - eB8G8R8Uint = VK_FORMAT_B8G8R8_UINT, - eB8G8R8Sint = VK_FORMAT_B8G8R8_SINT, - eB8G8R8Srgb = VK_FORMAT_B8G8R8_SRGB, - eR8G8B8A8Unorm = VK_FORMAT_R8G8B8A8_UNORM, - eR8G8B8A8Snorm = VK_FORMAT_R8G8B8A8_SNORM, - eR8G8B8A8Uscaled = VK_FORMAT_R8G8B8A8_USCALED, - eR8G8B8A8Sscaled = VK_FORMAT_R8G8B8A8_SSCALED, - eR8G8B8A8Uint = VK_FORMAT_R8G8B8A8_UINT, - eR8G8B8A8Sint = VK_FORMAT_R8G8B8A8_SINT, - eR8G8B8A8Srgb = VK_FORMAT_R8G8B8A8_SRGB, - eB8G8R8A8Unorm = VK_FORMAT_B8G8R8A8_UNORM, - eB8G8R8A8Snorm = VK_FORMAT_B8G8R8A8_SNORM, - eB8G8R8A8Uscaled = VK_FORMAT_B8G8R8A8_USCALED, - eB8G8R8A8Sscaled = VK_FORMAT_B8G8R8A8_SSCALED, - eB8G8R8A8Uint = VK_FORMAT_B8G8R8A8_UINT, - eB8G8R8A8Sint = VK_FORMAT_B8G8R8A8_SINT, - eB8G8R8A8Srgb = VK_FORMAT_B8G8R8A8_SRGB, - eA8B8G8R8UnormPack32 = VK_FORMAT_A8B8G8R8_UNORM_PACK32, - eA8B8G8R8SnormPack32 = VK_FORMAT_A8B8G8R8_SNORM_PACK32, - eA8B8G8R8UscaledPack32 = VK_FORMAT_A8B8G8R8_USCALED_PACK32, - eA8B8G8R8SscaledPack32 = VK_FORMAT_A8B8G8R8_SSCALED_PACK32, - eA8B8G8R8UintPack32 = VK_FORMAT_A8B8G8R8_UINT_PACK32, - eA8B8G8R8SintPack32 = VK_FORMAT_A8B8G8R8_SINT_PACK32, - eA8B8G8R8SrgbPack32 = VK_FORMAT_A8B8G8R8_SRGB_PACK32, - eA2R10G10B10UnormPack32 = VK_FORMAT_A2R10G10B10_UNORM_PACK32, - eA2R10G10B10SnormPack32 = VK_FORMAT_A2R10G10B10_SNORM_PACK32, - eA2R10G10B10UscaledPack32 = VK_FORMAT_A2R10G10B10_USCALED_PACK32, - eA2R10G10B10SscaledPack32 = VK_FORMAT_A2R10G10B10_SSCALED_PACK32, - eA2R10G10B10UintPack32 = VK_FORMAT_A2R10G10B10_UINT_PACK32, - eA2R10G10B10SintPack32 = VK_FORMAT_A2R10G10B10_SINT_PACK32, - eA2B10G10R10UnormPack32 = VK_FORMAT_A2B10G10R10_UNORM_PACK32, - eA2B10G10R10SnormPack32 = VK_FORMAT_A2B10G10R10_SNORM_PACK32, - eA2B10G10R10UscaledPack32 = VK_FORMAT_A2B10G10R10_USCALED_PACK32, - eA2B10G10R10SscaledPack32 = VK_FORMAT_A2B10G10R10_SSCALED_PACK32, - eA2B10G10R10UintPack32 = VK_FORMAT_A2B10G10R10_UINT_PACK32, - eA2B10G10R10SintPack32 = VK_FORMAT_A2B10G10R10_SINT_PACK32, - eR16Unorm = VK_FORMAT_R16_UNORM, - eR16Snorm = VK_FORMAT_R16_SNORM, - eR16Uscaled = VK_FORMAT_R16_USCALED, - eR16Sscaled = VK_FORMAT_R16_SSCALED, - eR16Uint = VK_FORMAT_R16_UINT, - eR16Sint = VK_FORMAT_R16_SINT, - eR16Sfloat = VK_FORMAT_R16_SFLOAT, - eR16G16Unorm = VK_FORMAT_R16G16_UNORM, - eR16G16Snorm = VK_FORMAT_R16G16_SNORM, - eR16G16Uscaled = VK_FORMAT_R16G16_USCALED, - eR16G16Sscaled = VK_FORMAT_R16G16_SSCALED, - eR16G16Uint = VK_FORMAT_R16G16_UINT, - eR16G16Sint = VK_FORMAT_R16G16_SINT, - eR16G16Sfloat = VK_FORMAT_R16G16_SFLOAT, - eR16G16B16Unorm = VK_FORMAT_R16G16B16_UNORM, - eR16G16B16Snorm = VK_FORMAT_R16G16B16_SNORM, - eR16G16B16Uscaled = VK_FORMAT_R16G16B16_USCALED, - eR16G16B16Sscaled = VK_FORMAT_R16G16B16_SSCALED, - eR16G16B16Uint = VK_FORMAT_R16G16B16_UINT, - eR16G16B16Sint = VK_FORMAT_R16G16B16_SINT, - eR16G16B16Sfloat = VK_FORMAT_R16G16B16_SFLOAT, - eR16G16B16A16Unorm = VK_FORMAT_R16G16B16A16_UNORM, - eR16G16B16A16Snorm = VK_FORMAT_R16G16B16A16_SNORM, - eR16G16B16A16Uscaled = VK_FORMAT_R16G16B16A16_USCALED, - eR16G16B16A16Sscaled = VK_FORMAT_R16G16B16A16_SSCALED, - eR16G16B16A16Uint = VK_FORMAT_R16G16B16A16_UINT, - eR16G16B16A16Sint = VK_FORMAT_R16G16B16A16_SINT, - eR16G16B16A16Sfloat = VK_FORMAT_R16G16B16A16_SFLOAT, - eR32Uint = VK_FORMAT_R32_UINT, - eR32Sint = VK_FORMAT_R32_SINT, - eR32Sfloat = VK_FORMAT_R32_SFLOAT, - eR32G32Uint = VK_FORMAT_R32G32_UINT, - eR32G32Sint = VK_FORMAT_R32G32_SINT, - eR32G32Sfloat = VK_FORMAT_R32G32_SFLOAT, - eR32G32B32Uint = VK_FORMAT_R32G32B32_UINT, - eR32G32B32Sint = VK_FORMAT_R32G32B32_SINT, - eR32G32B32Sfloat = VK_FORMAT_R32G32B32_SFLOAT, - eR32G32B32A32Uint = VK_FORMAT_R32G32B32A32_UINT, - eR32G32B32A32Sint = VK_FORMAT_R32G32B32A32_SINT, - eR32G32B32A32Sfloat = VK_FORMAT_R32G32B32A32_SFLOAT, - eR64Uint = VK_FORMAT_R64_UINT, - eR64Sint = VK_FORMAT_R64_SINT, - eR64Sfloat = VK_FORMAT_R64_SFLOAT, - eR64G64Uint = VK_FORMAT_R64G64_UINT, - eR64G64Sint = VK_FORMAT_R64G64_SINT, - eR64G64Sfloat = VK_FORMAT_R64G64_SFLOAT, - eR64G64B64Uint = VK_FORMAT_R64G64B64_UINT, - eR64G64B64Sint = VK_FORMAT_R64G64B64_SINT, - eR64G64B64Sfloat = VK_FORMAT_R64G64B64_SFLOAT, - eR64G64B64A64Uint = VK_FORMAT_R64G64B64A64_UINT, - eR64G64B64A64Sint = VK_FORMAT_R64G64B64A64_SINT, - eR64G64B64A64Sfloat = VK_FORMAT_R64G64B64A64_SFLOAT, - eB10G11R11UfloatPack32 = VK_FORMAT_B10G11R11_UFLOAT_PACK32, - eE5B9G9R9UfloatPack32 = VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, - eD16Unorm = VK_FORMAT_D16_UNORM, - eX8D24UnormPack32 = VK_FORMAT_X8_D24_UNORM_PACK32, - eD32Sfloat = VK_FORMAT_D32_SFLOAT, - eS8Uint = VK_FORMAT_S8_UINT, - eD16UnormS8Uint = VK_FORMAT_D16_UNORM_S8_UINT, - eD24UnormS8Uint = VK_FORMAT_D24_UNORM_S8_UINT, - eD32SfloatS8Uint = VK_FORMAT_D32_SFLOAT_S8_UINT, - eBc1RgbUnormBlock = VK_FORMAT_BC1_RGB_UNORM_BLOCK, - eBc1RgbSrgbBlock = VK_FORMAT_BC1_RGB_SRGB_BLOCK, - eBc1RgbaUnormBlock = VK_FORMAT_BC1_RGBA_UNORM_BLOCK, - eBc1RgbaSrgbBlock = VK_FORMAT_BC1_RGBA_SRGB_BLOCK, - eBc2UnormBlock = VK_FORMAT_BC2_UNORM_BLOCK, - eBc2SrgbBlock = VK_FORMAT_BC2_SRGB_BLOCK, - eBc3UnormBlock = VK_FORMAT_BC3_UNORM_BLOCK, - eBc3SrgbBlock = VK_FORMAT_BC3_SRGB_BLOCK, - eBc4UnormBlock = VK_FORMAT_BC4_UNORM_BLOCK, - eBc4SnormBlock = VK_FORMAT_BC4_SNORM_BLOCK, - eBc5UnormBlock = VK_FORMAT_BC5_UNORM_BLOCK, - eBc5SnormBlock = VK_FORMAT_BC5_SNORM_BLOCK, - eBc6HUfloatBlock = VK_FORMAT_BC6H_UFLOAT_BLOCK, - eBc6HSfloatBlock = VK_FORMAT_BC6H_SFLOAT_BLOCK, - eBc7UnormBlock = VK_FORMAT_BC7_UNORM_BLOCK, - eBc7SrgbBlock = VK_FORMAT_BC7_SRGB_BLOCK, - eEtc2R8G8B8UnormBlock = VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, - eEtc2R8G8B8SrgbBlock = VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, - eEtc2R8G8B8A1UnormBlock = VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, - eEtc2R8G8B8A1SrgbBlock = VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, - eEtc2R8G8B8A8UnormBlock = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, - eEtc2R8G8B8A8SrgbBlock = VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, - eEacR11UnormBlock = VK_FORMAT_EAC_R11_UNORM_BLOCK, - eEacR11SnormBlock = VK_FORMAT_EAC_R11_SNORM_BLOCK, - eEacR11G11UnormBlock = VK_FORMAT_EAC_R11G11_UNORM_BLOCK, - eEacR11G11SnormBlock = VK_FORMAT_EAC_R11G11_SNORM_BLOCK, - eAstc4x4UnormBlock = VK_FORMAT_ASTC_4x4_UNORM_BLOCK, - eAstc4x4SrgbBlock = VK_FORMAT_ASTC_4x4_SRGB_BLOCK, - eAstc5x4UnormBlock = VK_FORMAT_ASTC_5x4_UNORM_BLOCK, - eAstc5x4SrgbBlock = VK_FORMAT_ASTC_5x4_SRGB_BLOCK, - eAstc5x5UnormBlock = VK_FORMAT_ASTC_5x5_UNORM_BLOCK, - eAstc5x5SrgbBlock = VK_FORMAT_ASTC_5x5_SRGB_BLOCK, - eAstc6x5UnormBlock = VK_FORMAT_ASTC_6x5_UNORM_BLOCK, - eAstc6x5SrgbBlock = VK_FORMAT_ASTC_6x5_SRGB_BLOCK, - eAstc6x6UnormBlock = VK_FORMAT_ASTC_6x6_UNORM_BLOCK, - eAstc6x6SrgbBlock = VK_FORMAT_ASTC_6x6_SRGB_BLOCK, - eAstc8x5UnormBlock = VK_FORMAT_ASTC_8x5_UNORM_BLOCK, - eAstc8x5SrgbBlock = VK_FORMAT_ASTC_8x5_SRGB_BLOCK, - eAstc8x6UnormBlock = VK_FORMAT_ASTC_8x6_UNORM_BLOCK, - eAstc8x6SrgbBlock = VK_FORMAT_ASTC_8x6_SRGB_BLOCK, - eAstc8x8UnormBlock = VK_FORMAT_ASTC_8x8_UNORM_BLOCK, - eAstc8x8SrgbBlock = VK_FORMAT_ASTC_8x8_SRGB_BLOCK, - eAstc10x5UnormBlock = VK_FORMAT_ASTC_10x5_UNORM_BLOCK, - eAstc10x5SrgbBlock = VK_FORMAT_ASTC_10x5_SRGB_BLOCK, - eAstc10x6UnormBlock = VK_FORMAT_ASTC_10x6_UNORM_BLOCK, - eAstc10x6SrgbBlock = VK_FORMAT_ASTC_10x6_SRGB_BLOCK, - eAstc10x8UnormBlock = VK_FORMAT_ASTC_10x8_UNORM_BLOCK, - eAstc10x8SrgbBlock = VK_FORMAT_ASTC_10x8_SRGB_BLOCK, - eAstc10x10UnormBlock = VK_FORMAT_ASTC_10x10_UNORM_BLOCK, - eAstc10x10SrgbBlock = VK_FORMAT_ASTC_10x10_SRGB_BLOCK, - eAstc12x10UnormBlock = VK_FORMAT_ASTC_12x10_UNORM_BLOCK, - eAstc12x10SrgbBlock = VK_FORMAT_ASTC_12x10_SRGB_BLOCK, - eAstc12x12UnormBlock = VK_FORMAT_ASTC_12x12_UNORM_BLOCK, - eAstc12x12SrgbBlock = VK_FORMAT_ASTC_12x12_SRGB_BLOCK, - eG8B8G8R8422Unorm = VK_FORMAT_G8B8G8R8_422_UNORM, - eB8G8R8G8422Unorm = VK_FORMAT_B8G8R8G8_422_UNORM, - eG8B8R83Plane420Unorm = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, - eG8B8R82Plane420Unorm = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, - eG8B8R83Plane422Unorm = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, - eG8B8R82Plane422Unorm = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, - eG8B8R83Plane444Unorm = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, - eR10X6UnormPack16 = VK_FORMAT_R10X6_UNORM_PACK16, - eR10X6G10X6Unorm2Pack16 = VK_FORMAT_R10X6G10X6_UNORM_2PACK16, - eR10X6G10X6B10X6A10X6Unorm4Pack16 = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, - eG10X6B10X6G10X6R10X6422Unorm4Pack16 = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, - eB10X6G10X6R10X6G10X6422Unorm4Pack16 = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, - eG10X6B10X6R10X63Plane420Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, - eG10X6B10X6R10X62Plane420Unorm3Pack16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, - eG10X6B10X6R10X63Plane422Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, - eG10X6B10X6R10X62Plane422Unorm3Pack16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, - eG10X6B10X6R10X63Plane444Unorm3Pack16 = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, - eR12X4UnormPack16 = VK_FORMAT_R12X4_UNORM_PACK16, - eR12X4G12X4Unorm2Pack16 = VK_FORMAT_R12X4G12X4_UNORM_2PACK16, - eR12X4G12X4B12X4A12X4Unorm4Pack16 = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, - eG12X4B12X4G12X4R12X4422Unorm4Pack16 = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, - eB12X4G12X4R12X4G12X4422Unorm4Pack16 = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, - eG12X4B12X4R12X43Plane420Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, - eG12X4B12X4R12X42Plane420Unorm3Pack16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, - eG12X4B12X4R12X43Plane422Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, - eG12X4B12X4R12X42Plane422Unorm3Pack16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, - eG12X4B12X4R12X43Plane444Unorm3Pack16 = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, - eG16B16G16R16422Unorm = VK_FORMAT_G16B16G16R16_422_UNORM, - eB16G16R16G16422Unorm = VK_FORMAT_B16G16R16G16_422_UNORM, - eG16B16R163Plane420Unorm = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, - eG16B16R162Plane420Unorm = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, - eG16B16R163Plane422Unorm = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, - eG16B16R162Plane422Unorm = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, - eG16B16R163Plane444Unorm = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, - eG8B8R82Plane444Unorm = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM, - eG10X6B10X6R10X62Plane444Unorm3Pack16 = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16, - eG12X4B12X4R12X42Plane444Unorm3Pack16 = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16, - eG16B16R162Plane444Unorm = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM, - eA4R4G4B4UnormPack16 = VK_FORMAT_A4R4G4B4_UNORM_PACK16, - eA4B4G4R4UnormPack16 = VK_FORMAT_A4B4G4R4_UNORM_PACK16, - eAstc4x4SfloatBlock = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK, - eAstc5x4SfloatBlock = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK, - eAstc5x5SfloatBlock = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK, - eAstc6x5SfloatBlock = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK, - eAstc6x6SfloatBlock = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK, - eAstc8x5SfloatBlock = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK, - eAstc8x6SfloatBlock = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK, - eAstc8x8SfloatBlock = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK, - eAstc10x5SfloatBlock = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK, - eAstc10x6SfloatBlock = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK, - eAstc10x8SfloatBlock = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK, - eAstc10x10SfloatBlock = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK, - eAstc12x10SfloatBlock = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK, - eAstc12x12SfloatBlock = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK, - ePvrtc12BppUnormBlockIMG = VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG, - ePvrtc14BppUnormBlockIMG = VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG, - ePvrtc22BppUnormBlockIMG = VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG, - ePvrtc24BppUnormBlockIMG = VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG, - ePvrtc12BppSrgbBlockIMG = VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, - ePvrtc14BppSrgbBlockIMG = VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, - ePvrtc22BppSrgbBlockIMG = VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, - ePvrtc24BppSrgbBlockIMG = VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, - eA4B4G4R4UnormPack16EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT, - eA4R4G4B4UnormPack16EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT, - eAstc10x10SfloatBlockEXT = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT, - eAstc10x5SfloatBlockEXT = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT, - eAstc10x6SfloatBlockEXT = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT, - eAstc10x8SfloatBlockEXT = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT, - eAstc12x10SfloatBlockEXT = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT, - eAstc12x12SfloatBlockEXT = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT, - eAstc4x4SfloatBlockEXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT, - eAstc5x4SfloatBlockEXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT, - eAstc5x5SfloatBlockEXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT, - eAstc6x5SfloatBlockEXT = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT, - eAstc6x6SfloatBlockEXT = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT, - eAstc8x5SfloatBlockEXT = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT, - eAstc8x6SfloatBlockEXT = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT, - eAstc8x8SfloatBlockEXT = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT, - eB10X6G10X6R10X6G10X6422Unorm4Pack16KHR = VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR, - eB12X4G12X4R12X4G12X4422Unorm4Pack16KHR = VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR, - eB16G16R16G16422UnormKHR = VK_FORMAT_B16G16R16G16_422_UNORM_KHR, - eB8G8R8G8422UnormKHR = VK_FORMAT_B8G8R8G8_422_UNORM_KHR, - eG10X6B10X6G10X6R10X6422Unorm4Pack16KHR = VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR, - eG10X6B10X6R10X62Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR, - eG10X6B10X6R10X62Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR, - eG10X6B10X6R10X62Plane444Unorm3Pack16EXT = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT, - eG10X6B10X6R10X63Plane420Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR, - eG10X6B10X6R10X63Plane422Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR, - eG10X6B10X6R10X63Plane444Unorm3Pack16KHR = VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR, - eG12X4B12X4G12X4R12X4422Unorm4Pack16KHR = VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR, - eG12X4B12X4R12X42Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR, - eG12X4B12X4R12X42Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR, - eG12X4B12X4R12X42Plane444Unorm3Pack16EXT = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT, - eG12X4B12X4R12X43Plane420Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR, - eG12X4B12X4R12X43Plane422Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR, - eG12X4B12X4R12X43Plane444Unorm3Pack16KHR = VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR, - eG16B16G16R16422UnormKHR = VK_FORMAT_G16B16G16R16_422_UNORM_KHR, - eG16B16R162Plane420UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, - eG16B16R162Plane422UnormKHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, - eG16B16R162Plane444UnormEXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT, - eG16B16R163Plane420UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, - eG16B16R163Plane422UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, - eG16B16R163Plane444UnormKHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR, - eG8B8G8R8422UnormKHR = VK_FORMAT_G8B8G8R8_422_UNORM_KHR, - eG8B8R82Plane420UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, - eG8B8R82Plane422UnormKHR = VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, - eG8B8R82Plane444UnormEXT = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT, - eG8B8R83Plane420UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, - eG8B8R83Plane422UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, - eG8B8R83Plane444UnormKHR = VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, - eR10X6G10X6B10X6A10X6Unorm4Pack16KHR = VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR, - eR10X6G10X6Unorm2Pack16KHR = VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR, - eR10X6UnormPack16KHR = VK_FORMAT_R10X6_UNORM_PACK16_KHR, - eR12X4G12X4B12X4A12X4Unorm4Pack16KHR = VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR, - eR12X4G12X4Unorm2Pack16KHR = VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR, - eR12X4UnormPack16KHR = VK_FORMAT_R12X4_UNORM_PACK16_KHR - }; - - enum class FormatFeatureFlagBits : VkFormatFeatureFlags - { - eSampledImage = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT, - eStorageImage = VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT, - eStorageImageAtomic = VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT, - eUniformTexelBuffer = VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT, - eStorageTexelBuffer = VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT, - eStorageTexelBufferAtomic = VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT, - eVertexBuffer = VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT, - eColorAttachment = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, - eColorAttachmentBlend = VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT, - eDepthStencilAttachment = VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, - eBlitSrc = VK_FORMAT_FEATURE_BLIT_SRC_BIT, - eBlitDst = VK_FORMAT_FEATURE_BLIT_DST_BIT, - eSampledImageFilterLinear = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, - eTransferSrc = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT, - eTransferDst = VK_FORMAT_FEATURE_TRANSFER_DST_BIT, - eMidpointChromaSamples = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT, - eSampledImageYcbcrConversionLinearFilter = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, - eSampledImageYcbcrConversionSeparateReconstructionFilter = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, - eSampledImageYcbcrConversionChromaReconstructionExplicit = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, - eSampledImageYcbcrConversionChromaReconstructionExplicitForceable = - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, - eDisjoint = VK_FORMAT_FEATURE_DISJOINT_BIT, - eCositedChromaSamples = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, - eSampledImageFilterMinmax = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeOutputKHR = VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR, - eVideoDecodeDpbKHR = VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eAccelerationStructureVertexBufferKHR = VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR, - eSampledImageFilterCubicEXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT, - eFragmentDensityMapEXT = VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT, - eFragmentShadingRateAttachmentKHR = VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeInputKHR = VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR, - eVideoEncodeDpbKHR = VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eCositedChromaSamplesKHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR, - eDisjointKHR = VK_FORMAT_FEATURE_DISJOINT_BIT_KHR, - eMidpointChromaSamplesKHR = VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR, - eSampledImageFilterCubicIMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG, - eSampledImageFilterMinmaxEXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT, - eSampledImageYcbcrConversionChromaReconstructionExplicitKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR, - eSampledImageYcbcrConversionChromaReconstructionExplicitForceableKHR = - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR, - eSampledImageYcbcrConversionLinearFilterKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR, - eSampledImageYcbcrConversionSeparateReconstructionFilterKHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR, - eTransferDstKHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR, - eTransferSrcKHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR - }; - - enum class ImageCreateFlagBits : VkImageCreateFlags - { - eSparseBinding = VK_IMAGE_CREATE_SPARSE_BINDING_BIT, - eSparseResidency = VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, - eSparseAliased = VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, - eMutableFormat = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, - eCubeCompatible = VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, - eAlias = VK_IMAGE_CREATE_ALIAS_BIT, - eSplitInstanceBindRegions = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, - e2DArrayCompatible = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, - eBlockTexelViewCompatible = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, - eExtendedUsage = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, - eProtected = VK_IMAGE_CREATE_PROTECTED_BIT, - eDisjoint = VK_IMAGE_CREATE_DISJOINT_BIT, - eCornerSampledNV = VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV, - eSampleLocationsCompatibleDepthEXT = VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, - eSubsampledEXT = VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT, - eMultisampledRenderToSingleSampledEXT = VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT, - e2DViewCompatibleEXT = VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT, - eFragmentDensityMapOffsetQCOM = VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM, - e2DArrayCompatibleKHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR, - eAliasKHR = VK_IMAGE_CREATE_ALIAS_BIT_KHR, - eBlockTexelViewCompatibleKHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR, - eDisjointKHR = VK_IMAGE_CREATE_DISJOINT_BIT_KHR, - eExtendedUsageKHR = VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR, - eSplitInstanceBindRegionsKHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR - }; - - enum class ImageTiling - { - eOptimal = VK_IMAGE_TILING_OPTIMAL, - eLinear = VK_IMAGE_TILING_LINEAR, - eDrmFormatModifierEXT = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT - }; - - enum class ImageType - { - e1D = VK_IMAGE_TYPE_1D, - e2D = VK_IMAGE_TYPE_2D, - e3D = VK_IMAGE_TYPE_3D - }; - - enum class ImageUsageFlagBits : VkImageUsageFlags - { - eTransferSrc = VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - eTransferDst = VK_IMAGE_USAGE_TRANSFER_DST_BIT, - eSampled = VK_IMAGE_USAGE_SAMPLED_BIT, - eStorage = VK_IMAGE_USAGE_STORAGE_BIT, - eColorAttachment = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - eDepthStencilAttachment = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - eTransientAttachment = VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, - eInputAttachment = VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeDstKHR = VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR, - eVideoDecodeSrcKHR = VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR, - eVideoDecodeDpbKHR = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eFragmentDensityMapEXT = VK_IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT, - eFragmentShadingRateAttachmentKHR = VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeDstKHR = VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR, - eVideoEncodeSrcKHR = VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, - eVideoEncodeDpbKHR = VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eAttachmentFeedbackLoopEXT = VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, - eInvocationMaskHUAWEI = VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI, - eSampleWeightQCOM = VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM, - eSampleBlockMatchQCOM = VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM, - eShadingRateImageNV = VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV - }; - - enum class InstanceCreateFlagBits : VkInstanceCreateFlags - { - eEnumeratePortabilityKHR = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR - }; - - enum class InternalAllocationType - { - eExecutable = VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE - }; - - enum class MemoryHeapFlagBits : VkMemoryHeapFlags - { - eDeviceLocal = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, - eMultiInstance = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, - eMultiInstanceKHR = VK_MEMORY_HEAP_MULTI_INSTANCE_BIT_KHR - }; - - enum class MemoryPropertyFlagBits : VkMemoryPropertyFlags - { - eDeviceLocal = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, - eHostVisible = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, - eHostCoherent = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, - eHostCached = VK_MEMORY_PROPERTY_HOST_CACHED_BIT, - eLazilyAllocated = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, - eProtected = VK_MEMORY_PROPERTY_PROTECTED_BIT, - eDeviceCoherentAMD = VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD, - eDeviceUncachedAMD = VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD, - eRdmaCapableNV = VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV - }; - - enum class PhysicalDeviceType - { - eOther = VK_PHYSICAL_DEVICE_TYPE_OTHER, - eIntegratedGpu = VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, - eDiscreteGpu = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, - eVirtualGpu = VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU, - eCpu = VK_PHYSICAL_DEVICE_TYPE_CPU - }; - - enum class QueueFlagBits : VkQueueFlags - { - eGraphics = VK_QUEUE_GRAPHICS_BIT, - eCompute = VK_QUEUE_COMPUTE_BIT, - eTransfer = VK_QUEUE_TRANSFER_BIT, - eSparseBinding = VK_QUEUE_SPARSE_BINDING_BIT, - eProtected = VK_QUEUE_PROTECTED_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeKHR = VK_QUEUE_VIDEO_DECODE_BIT_KHR, - eVideoEncodeKHR = VK_QUEUE_VIDEO_ENCODE_BIT_KHR -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - - enum class SampleCountFlagBits : VkSampleCountFlags - { - e1 = VK_SAMPLE_COUNT_1_BIT, - e2 = VK_SAMPLE_COUNT_2_BIT, - e4 = VK_SAMPLE_COUNT_4_BIT, - e8 = VK_SAMPLE_COUNT_8_BIT, - e16 = VK_SAMPLE_COUNT_16_BIT, - e32 = VK_SAMPLE_COUNT_32_BIT, - e64 = VK_SAMPLE_COUNT_64_BIT - }; - - enum class SystemAllocationScope - { - eCommand = VK_SYSTEM_ALLOCATION_SCOPE_COMMAND, - eObject = VK_SYSTEM_ALLOCATION_SCOPE_OBJECT, - eCache = VK_SYSTEM_ALLOCATION_SCOPE_CACHE, - eDevice = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE, - eInstance = VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - }; - - enum class DeviceCreateFlagBits - { - }; - - enum class PipelineStageFlagBits : VkPipelineStageFlags - { - eTopOfPipe = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, - eDrawIndirect = VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT, - eVertexInput = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, - eVertexShader = VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, - eTessellationControlShader = VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT, - eTessellationEvaluationShader = VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT, - eGeometryShader = VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT, - eFragmentShader = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - eEarlyFragmentTests = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT, - eLateFragmentTests = VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, - eColorAttachmentOutput = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - eComputeShader = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - eTransfer = VK_PIPELINE_STAGE_TRANSFER_BIT, - eBottomOfPipe = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - eHost = VK_PIPELINE_STAGE_HOST_BIT, - eAllGraphics = VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, - eAllCommands = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - eNone = VK_PIPELINE_STAGE_NONE, - eTransformFeedbackEXT = VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT, - eConditionalRenderingEXT = VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT, - eAccelerationStructureBuildKHR = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, - eRayTracingShaderKHR = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR, - eFragmentDensityProcessEXT = VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT, - eFragmentShadingRateAttachmentKHR = VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - eCommandPreprocessNV = VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV, - eTaskShaderEXT = VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT, - eMeshShaderEXT = VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT, - eAccelerationStructureBuildNV = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV, - eMeshShaderNV = VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV, - eNoneKHR = VK_PIPELINE_STAGE_NONE_KHR, - eRayTracingShaderNV = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV, - eShadingRateImageNV = VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV, - eTaskShaderNV = VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV - }; - - enum class MemoryMapFlagBits : VkMemoryMapFlags - { - }; - - enum class ImageAspectFlagBits : VkImageAspectFlags - { - eColor = VK_IMAGE_ASPECT_COLOR_BIT, - eDepth = VK_IMAGE_ASPECT_DEPTH_BIT, - eStencil = VK_IMAGE_ASPECT_STENCIL_BIT, - eMetadata = VK_IMAGE_ASPECT_METADATA_BIT, - ePlane0 = VK_IMAGE_ASPECT_PLANE_0_BIT, - ePlane1 = VK_IMAGE_ASPECT_PLANE_1_BIT, - ePlane2 = VK_IMAGE_ASPECT_PLANE_2_BIT, - eNone = VK_IMAGE_ASPECT_NONE, - eMemoryPlane0EXT = VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT, - eMemoryPlane1EXT = VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT, - eMemoryPlane2EXT = VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT, - eMemoryPlane3EXT = VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT, - eNoneKHR = VK_IMAGE_ASPECT_NONE_KHR, - ePlane0KHR = VK_IMAGE_ASPECT_PLANE_0_BIT_KHR, - ePlane1KHR = VK_IMAGE_ASPECT_PLANE_1_BIT_KHR, - ePlane2KHR = VK_IMAGE_ASPECT_PLANE_2_BIT_KHR - }; - - enum class SparseImageFormatFlagBits : VkSparseImageFormatFlags - { - eSingleMiptail = VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT, - eAlignedMipSize = VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT, - eNonstandardBlockSize = VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT - }; - - enum class SparseMemoryBindFlagBits : VkSparseMemoryBindFlags - { - eMetadata = VK_SPARSE_MEMORY_BIND_METADATA_BIT - }; - - enum class FenceCreateFlagBits : VkFenceCreateFlags - { - eSignaled = VK_FENCE_CREATE_SIGNALED_BIT - }; - - enum class SemaphoreCreateFlagBits : VkSemaphoreCreateFlags - { - }; - - enum class EventCreateFlagBits : VkEventCreateFlags - { - eDeviceOnly = VK_EVENT_CREATE_DEVICE_ONLY_BIT, - eDeviceOnlyKHR = VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR - }; - - enum class QueryPipelineStatisticFlagBits : VkQueryPipelineStatisticFlags - { - eInputAssemblyVertices = VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT, - eInputAssemblyPrimitives = VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT, - eVertexShaderInvocations = VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT, - eGeometryShaderInvocations = VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT, - eGeometryShaderPrimitives = VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT, - eClippingInvocations = VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT, - eClippingPrimitives = VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT, - eFragmentShaderInvocations = VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT, - eTessellationControlShaderPatches = VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT, - eTessellationEvaluationShaderInvocations = VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT, - eComputeShaderInvocations = VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT, - eTaskShaderInvocationsEXT = VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT, - eMeshShaderInvocationsEXT = VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT - }; - - enum class QueryResultFlagBits : VkQueryResultFlags - { - e64 = VK_QUERY_RESULT_64_BIT, - eWait = VK_QUERY_RESULT_WAIT_BIT, - eWithAvailability = VK_QUERY_RESULT_WITH_AVAILABILITY_BIT, - ePartial = VK_QUERY_RESULT_PARTIAL_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eWithStatusKHR = VK_QUERY_RESULT_WITH_STATUS_BIT_KHR -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - - enum class QueryType - { - eOcclusion = VK_QUERY_TYPE_OCCLUSION, - ePipelineStatistics = VK_QUERY_TYPE_PIPELINE_STATISTICS, - eTimestamp = VK_QUERY_TYPE_TIMESTAMP, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eResultStatusOnlyKHR = VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eTransformFeedbackStreamEXT = VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT, - ePerformanceQueryKHR = VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR, - eAccelerationStructureCompactedSizeKHR = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR, - eAccelerationStructureSerializationSizeKHR = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR, - eAccelerationStructureCompactedSizeNV = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV, - ePerformanceQueryINTEL = VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeBitstreamBufferRangeKHR = VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eMeshPrimitivesGeneratedEXT = VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT, - ePrimitivesGeneratedEXT = VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT, - eAccelerationStructureSerializationBottomLevelPointersKHR = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR, - eAccelerationStructureSizeKHR = VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR - }; - - enum class QueryPoolCreateFlagBits - { - }; - - enum class BufferCreateFlagBits : VkBufferCreateFlags - { - eSparseBinding = VK_BUFFER_CREATE_SPARSE_BINDING_BIT, - eSparseResidency = VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, - eSparseAliased = VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, - eProtected = VK_BUFFER_CREATE_PROTECTED_BIT, - eDeviceAddressCaptureReplay = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, - eDeviceAddressCaptureReplayEXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT, - eDeviceAddressCaptureReplayKHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR - }; - - enum class BufferUsageFlagBits : VkBufferUsageFlags - { - eTransferSrc = VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - eTransferDst = VK_BUFFER_USAGE_TRANSFER_DST_BIT, - eUniformTexelBuffer = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, - eStorageTexelBuffer = VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, - eUniformBuffer = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, - eStorageBuffer = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, - eIndexBuffer = VK_BUFFER_USAGE_INDEX_BUFFER_BIT, - eVertexBuffer = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, - eIndirectBuffer = VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, - eShaderDeviceAddress = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeSrcKHR = VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR, - eVideoDecodeDstKHR = VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eTransformFeedbackBufferEXT = VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT, - eTransformFeedbackCounterBufferEXT = VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT, - eConditionalRenderingEXT = VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT, - eAccelerationStructureBuildInputReadOnlyKHR = VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR, - eAccelerationStructureStorageKHR = VK_BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR, - eShaderBindingTableKHR = VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeDstKHR = VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR, - eVideoEncodeSrcKHR = VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eRayTracingNV = VK_BUFFER_USAGE_RAY_TRACING_BIT_NV, - eShaderDeviceAddressEXT = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT, - eShaderDeviceAddressKHR = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR - }; - - enum class SharingMode - { - eExclusive = VK_SHARING_MODE_EXCLUSIVE, - eConcurrent = VK_SHARING_MODE_CONCURRENT - }; - - enum class BufferViewCreateFlagBits : VkBufferViewCreateFlags - { - }; - - enum class ImageLayout - { - eUndefined = VK_IMAGE_LAYOUT_UNDEFINED, - eGeneral = VK_IMAGE_LAYOUT_GENERAL, - eColorAttachmentOptimal = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - eDepthStencilAttachmentOptimal = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - eDepthStencilReadOnlyOptimal = VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, - eShaderReadOnlyOptimal = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - eTransferSrcOptimal = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - eTransferDstOptimal = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - ePreinitialized = VK_IMAGE_LAYOUT_PREINITIALIZED, - eDepthReadOnlyStencilAttachmentOptimal = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, - eDepthAttachmentStencilReadOnlyOptimal = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, - eDepthAttachmentOptimal = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL, - eDepthReadOnlyOptimal = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL, - eStencilAttachmentOptimal = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL, - eStencilReadOnlyOptimal = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL, - eReadOnlyOptimal = VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL, - eAttachmentOptimal = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, - ePresentSrcKHR = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeDstKHR = VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR, - eVideoDecodeSrcKHR = VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR, - eVideoDecodeDpbKHR = VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eSharedPresentKHR = VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, - eFragmentDensityMapOptimalEXT = VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT, - eFragmentShadingRateAttachmentOptimalKHR = VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeDstKHR = VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR, - eVideoEncodeSrcKHR = VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR, - eVideoEncodeDpbKHR = VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eAttachmentFeedbackLoopOptimalEXT = VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT, - eAttachmentOptimalKHR = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR, - eDepthAttachmentOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR, - eDepthAttachmentStencilReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR, - eDepthReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR, - eDepthReadOnlyStencilAttachmentOptimalKHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR, - eReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR, - eShadingRateOptimalNV = VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV, - eStencilAttachmentOptimalKHR = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR, - eStencilReadOnlyOptimalKHR = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR - }; - - enum class ComponentSwizzle - { - eIdentity = VK_COMPONENT_SWIZZLE_IDENTITY, - eZero = VK_COMPONENT_SWIZZLE_ZERO, - eOne = VK_COMPONENT_SWIZZLE_ONE, - eR = VK_COMPONENT_SWIZZLE_R, - eG = VK_COMPONENT_SWIZZLE_G, - eB = VK_COMPONENT_SWIZZLE_B, - eA = VK_COMPONENT_SWIZZLE_A - }; - - enum class ImageViewCreateFlagBits : VkImageViewCreateFlags - { - eFragmentDensityMapDynamicEXT = VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT, - eFragmentDensityMapDeferredEXT = VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT - }; - - enum class ImageViewType - { - e1D = VK_IMAGE_VIEW_TYPE_1D, - e2D = VK_IMAGE_VIEW_TYPE_2D, - e3D = VK_IMAGE_VIEW_TYPE_3D, - eCube = VK_IMAGE_VIEW_TYPE_CUBE, - e1DArray = VK_IMAGE_VIEW_TYPE_1D_ARRAY, - e2DArray = VK_IMAGE_VIEW_TYPE_2D_ARRAY, - eCubeArray = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY - }; - - enum class ShaderModuleCreateFlagBits : VkShaderModuleCreateFlags - { - }; - - enum class BlendFactor - { - eZero = VK_BLEND_FACTOR_ZERO, - eOne = VK_BLEND_FACTOR_ONE, - eSrcColor = VK_BLEND_FACTOR_SRC_COLOR, - eOneMinusSrcColor = VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR, - eDstColor = VK_BLEND_FACTOR_DST_COLOR, - eOneMinusDstColor = VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR, - eSrcAlpha = VK_BLEND_FACTOR_SRC_ALPHA, - eOneMinusSrcAlpha = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, - eDstAlpha = VK_BLEND_FACTOR_DST_ALPHA, - eOneMinusDstAlpha = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA, - eConstantColor = VK_BLEND_FACTOR_CONSTANT_COLOR, - eOneMinusConstantColor = VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR, - eConstantAlpha = VK_BLEND_FACTOR_CONSTANT_ALPHA, - eOneMinusConstantAlpha = VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA, - eSrcAlphaSaturate = VK_BLEND_FACTOR_SRC_ALPHA_SATURATE, - eSrc1Color = VK_BLEND_FACTOR_SRC1_COLOR, - eOneMinusSrc1Color = VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR, - eSrc1Alpha = VK_BLEND_FACTOR_SRC1_ALPHA, - eOneMinusSrc1Alpha = VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA - }; - - enum class BlendOp - { - eAdd = VK_BLEND_OP_ADD, - eSubtract = VK_BLEND_OP_SUBTRACT, - eReverseSubtract = VK_BLEND_OP_REVERSE_SUBTRACT, - eMin = VK_BLEND_OP_MIN, - eMax = VK_BLEND_OP_MAX, - eZeroEXT = VK_BLEND_OP_ZERO_EXT, - eSrcEXT = VK_BLEND_OP_SRC_EXT, - eDstEXT = VK_BLEND_OP_DST_EXT, - eSrcOverEXT = VK_BLEND_OP_SRC_OVER_EXT, - eDstOverEXT = VK_BLEND_OP_DST_OVER_EXT, - eSrcInEXT = VK_BLEND_OP_SRC_IN_EXT, - eDstInEXT = VK_BLEND_OP_DST_IN_EXT, - eSrcOutEXT = VK_BLEND_OP_SRC_OUT_EXT, - eDstOutEXT = VK_BLEND_OP_DST_OUT_EXT, - eSrcAtopEXT = VK_BLEND_OP_SRC_ATOP_EXT, - eDstAtopEXT = VK_BLEND_OP_DST_ATOP_EXT, - eXorEXT = VK_BLEND_OP_XOR_EXT, - eMultiplyEXT = VK_BLEND_OP_MULTIPLY_EXT, - eScreenEXT = VK_BLEND_OP_SCREEN_EXT, - eOverlayEXT = VK_BLEND_OP_OVERLAY_EXT, - eDarkenEXT = VK_BLEND_OP_DARKEN_EXT, - eLightenEXT = VK_BLEND_OP_LIGHTEN_EXT, - eColordodgeEXT = VK_BLEND_OP_COLORDODGE_EXT, - eColorburnEXT = VK_BLEND_OP_COLORBURN_EXT, - eHardlightEXT = VK_BLEND_OP_HARDLIGHT_EXT, - eSoftlightEXT = VK_BLEND_OP_SOFTLIGHT_EXT, - eDifferenceEXT = VK_BLEND_OP_DIFFERENCE_EXT, - eExclusionEXT = VK_BLEND_OP_EXCLUSION_EXT, - eInvertEXT = VK_BLEND_OP_INVERT_EXT, - eInvertRgbEXT = VK_BLEND_OP_INVERT_RGB_EXT, - eLineardodgeEXT = VK_BLEND_OP_LINEARDODGE_EXT, - eLinearburnEXT = VK_BLEND_OP_LINEARBURN_EXT, - eVividlightEXT = VK_BLEND_OP_VIVIDLIGHT_EXT, - eLinearlightEXT = VK_BLEND_OP_LINEARLIGHT_EXT, - ePinlightEXT = VK_BLEND_OP_PINLIGHT_EXT, - eHardmixEXT = VK_BLEND_OP_HARDMIX_EXT, - eHslHueEXT = VK_BLEND_OP_HSL_HUE_EXT, - eHslSaturationEXT = VK_BLEND_OP_HSL_SATURATION_EXT, - eHslColorEXT = VK_BLEND_OP_HSL_COLOR_EXT, - eHslLuminosityEXT = VK_BLEND_OP_HSL_LUMINOSITY_EXT, - ePlusEXT = VK_BLEND_OP_PLUS_EXT, - ePlusClampedEXT = VK_BLEND_OP_PLUS_CLAMPED_EXT, - ePlusClampedAlphaEXT = VK_BLEND_OP_PLUS_CLAMPED_ALPHA_EXT, - ePlusDarkerEXT = VK_BLEND_OP_PLUS_DARKER_EXT, - eMinusEXT = VK_BLEND_OP_MINUS_EXT, - eMinusClampedEXT = VK_BLEND_OP_MINUS_CLAMPED_EXT, - eContrastEXT = VK_BLEND_OP_CONTRAST_EXT, - eInvertOvgEXT = VK_BLEND_OP_INVERT_OVG_EXT, - eRedEXT = VK_BLEND_OP_RED_EXT, - eGreenEXT = VK_BLEND_OP_GREEN_EXT, - eBlueEXT = VK_BLEND_OP_BLUE_EXT - }; - - enum class ColorComponentFlagBits : VkColorComponentFlags - { - eR = VK_COLOR_COMPONENT_R_BIT, - eG = VK_COLOR_COMPONENT_G_BIT, - eB = VK_COLOR_COMPONENT_B_BIT, - eA = VK_COLOR_COMPONENT_A_BIT - }; - - enum class CompareOp - { - eNever = VK_COMPARE_OP_NEVER, - eLess = VK_COMPARE_OP_LESS, - eEqual = VK_COMPARE_OP_EQUAL, - eLessOrEqual = VK_COMPARE_OP_LESS_OR_EQUAL, - eGreater = VK_COMPARE_OP_GREATER, - eNotEqual = VK_COMPARE_OP_NOT_EQUAL, - eGreaterOrEqual = VK_COMPARE_OP_GREATER_OR_EQUAL, - eAlways = VK_COMPARE_OP_ALWAYS - }; - - enum class CullModeFlagBits : VkCullModeFlags - { - eNone = VK_CULL_MODE_NONE, - eFront = VK_CULL_MODE_FRONT_BIT, - eBack = VK_CULL_MODE_BACK_BIT, - eFrontAndBack = VK_CULL_MODE_FRONT_AND_BACK - }; - - enum class DynamicState - { - eViewport = VK_DYNAMIC_STATE_VIEWPORT, - eScissor = VK_DYNAMIC_STATE_SCISSOR, - eLineWidth = VK_DYNAMIC_STATE_LINE_WIDTH, - eDepthBias = VK_DYNAMIC_STATE_DEPTH_BIAS, - eBlendConstants = VK_DYNAMIC_STATE_BLEND_CONSTANTS, - eDepthBounds = VK_DYNAMIC_STATE_DEPTH_BOUNDS, - eStencilCompareMask = VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK, - eStencilWriteMask = VK_DYNAMIC_STATE_STENCIL_WRITE_MASK, - eStencilReference = VK_DYNAMIC_STATE_STENCIL_REFERENCE, - eCullMode = VK_DYNAMIC_STATE_CULL_MODE, - eFrontFace = VK_DYNAMIC_STATE_FRONT_FACE, - ePrimitiveTopology = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY, - eViewportWithCount = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT, - eScissorWithCount = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT, - eVertexInputBindingStride = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE, - eDepthTestEnable = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE, - eDepthWriteEnable = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE, - eDepthCompareOp = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP, - eDepthBoundsTestEnable = VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE, - eStencilTestEnable = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE, - eStencilOp = VK_DYNAMIC_STATE_STENCIL_OP, - eRasterizerDiscardEnable = VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE, - eDepthBiasEnable = VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE, - ePrimitiveRestartEnable = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE, - eViewportWScalingNV = VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV, - eDiscardRectangleEXT = VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT, - eSampleLocationsEXT = VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT, - eRayTracingPipelineStackSizeKHR = VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR, - eViewportShadingRatePaletteNV = VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV, - eViewportCoarseSampleOrderNV = VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV, - eExclusiveScissorNV = VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV, - eFragmentShadingRateKHR = VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR, - eLineStippleEXT = VK_DYNAMIC_STATE_LINE_STIPPLE_EXT, - eVertexInputEXT = VK_DYNAMIC_STATE_VERTEX_INPUT_EXT, - ePatchControlPointsEXT = VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT, - eLogicOpEXT = VK_DYNAMIC_STATE_LOGIC_OP_EXT, - eColorWriteEnableEXT = VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT, - eCullModeEXT = VK_DYNAMIC_STATE_CULL_MODE_EXT, - eDepthBiasEnableEXT = VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT, - eDepthBoundsTestEnableEXT = VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT, - eDepthCompareOpEXT = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT, - eDepthTestEnableEXT = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT, - eDepthWriteEnableEXT = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT, - eFrontFaceEXT = VK_DYNAMIC_STATE_FRONT_FACE_EXT, - ePrimitiveRestartEnableEXT = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT, - ePrimitiveTopologyEXT = VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT, - eRasterizerDiscardEnableEXT = VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT, - eScissorWithCountEXT = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT, - eStencilOpEXT = VK_DYNAMIC_STATE_STENCIL_OP_EXT, - eStencilTestEnableEXT = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT, - eVertexInputBindingStrideEXT = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, - eViewportWithCountEXT = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT - }; - - enum class FrontFace - { - eCounterClockwise = VK_FRONT_FACE_COUNTER_CLOCKWISE, - eClockwise = VK_FRONT_FACE_CLOCKWISE - }; - - enum class LogicOp - { - eClear = VK_LOGIC_OP_CLEAR, - eAnd = VK_LOGIC_OP_AND, - eAndReverse = VK_LOGIC_OP_AND_REVERSE, - eCopy = VK_LOGIC_OP_COPY, - eAndInverted = VK_LOGIC_OP_AND_INVERTED, - eNoOp = VK_LOGIC_OP_NO_OP, - eXor = VK_LOGIC_OP_XOR, - eOr = VK_LOGIC_OP_OR, - eNor = VK_LOGIC_OP_NOR, - eEquivalent = VK_LOGIC_OP_EQUIVALENT, - eInvert = VK_LOGIC_OP_INVERT, - eOrReverse = VK_LOGIC_OP_OR_REVERSE, - eCopyInverted = VK_LOGIC_OP_COPY_INVERTED, - eOrInverted = VK_LOGIC_OP_OR_INVERTED, - eNand = VK_LOGIC_OP_NAND, - eSet = VK_LOGIC_OP_SET - }; - - enum class PipelineCreateFlagBits : VkPipelineCreateFlags - { - eDisableOptimization = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, - eAllowDerivatives = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, - eDerivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT, - eViewIndexFromDeviceIndex = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT, - eDispatchBase = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT, - eFailOnPipelineCompileRequired = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT, - eEarlyReturnOnFailure = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT, - eRenderingFragmentShadingRateAttachmentKHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - eRenderingFragmentDensityMapAttachmentEXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, - eRayTracingNoNullAnyHitShadersKHR = VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR, - eRayTracingNoNullClosestHitShadersKHR = VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR, - eRayTracingNoNullMissShadersKHR = VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR, - eRayTracingNoNullIntersectionShadersKHR = VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_INTERSECTION_SHADERS_BIT_KHR, - eRayTracingSkipTrianglesKHR = VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR, - eRayTracingSkipAabbsKHR = VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR, - eRayTracingShaderGroupHandleCaptureReplayKHR = VK_PIPELINE_CREATE_RAY_TRACING_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_BIT_KHR, - eDeferCompileNV = VK_PIPELINE_CREATE_DEFER_COMPILE_BIT_NV, - eCaptureStatisticsKHR = VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR, - eCaptureInternalRepresentationsKHR = VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR, - eIndirectBindableNV = VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV, - eLibraryKHR = VK_PIPELINE_CREATE_LIBRARY_BIT_KHR, - eRetainLinkTimeOptimizationInfoEXT = VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT, - eLinkTimeOptimizationEXT = VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT, - eRayTracingAllowMotionNV = VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV, - eColorAttachmentFeedbackLoopEXT = VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, - eDepthStencilAttachmentFeedbackLoopEXT = VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, - eDispatchBaseKHR = VK_PIPELINE_CREATE_DISPATCH_BASE_KHR, - eEarlyReturnOnFailureEXT = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT, - eFailOnPipelineCompileRequiredEXT = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT, - eViewIndexFromDeviceIndexKHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR, - eVkPipelineRasterizationStateCreateFragmentDensityMapAttachmentEXT = VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT, - eVkPipelineRasterizationStateCreateFragmentShadingRateAttachmentKHR = VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR - }; - - enum class PipelineShaderStageCreateFlagBits : VkPipelineShaderStageCreateFlags - { - eAllowVaryingSubgroupSize = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT, - eRequireFullSubgroups = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT, - eAllowVaryingSubgroupSizeEXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT, - eRequireFullSubgroupsEXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT - }; - - enum class PolygonMode - { - eFill = VK_POLYGON_MODE_FILL, - eLine = VK_POLYGON_MODE_LINE, - ePoint = VK_POLYGON_MODE_POINT, - eFillRectangleNV = VK_POLYGON_MODE_FILL_RECTANGLE_NV - }; - - enum class PrimitiveTopology - { - ePointList = VK_PRIMITIVE_TOPOLOGY_POINT_LIST, - eLineList = VK_PRIMITIVE_TOPOLOGY_LINE_LIST, - eLineStrip = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, - eTriangleList = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, - eTriangleStrip = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, - eTriangleFan = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN, - eLineListWithAdjacency = VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY, - eLineStripWithAdjacency = VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY, - eTriangleListWithAdjacency = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY, - eTriangleStripWithAdjacency = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY, - ePatchList = VK_PRIMITIVE_TOPOLOGY_PATCH_LIST - }; - - enum class ShaderStageFlagBits : VkShaderStageFlags - { - eVertex = VK_SHADER_STAGE_VERTEX_BIT, - eTessellationControl = VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, - eTessellationEvaluation = VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, - eGeometry = VK_SHADER_STAGE_GEOMETRY_BIT, - eFragment = VK_SHADER_STAGE_FRAGMENT_BIT, - eCompute = VK_SHADER_STAGE_COMPUTE_BIT, - eAllGraphics = VK_SHADER_STAGE_ALL_GRAPHICS, - eAll = VK_SHADER_STAGE_ALL, - eRaygenKHR = VK_SHADER_STAGE_RAYGEN_BIT_KHR, - eAnyHitKHR = VK_SHADER_STAGE_ANY_HIT_BIT_KHR, - eClosestHitKHR = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR, - eMissKHR = VK_SHADER_STAGE_MISS_BIT_KHR, - eIntersectionKHR = VK_SHADER_STAGE_INTERSECTION_BIT_KHR, - eCallableKHR = VK_SHADER_STAGE_CALLABLE_BIT_KHR, - eTaskEXT = VK_SHADER_STAGE_TASK_BIT_EXT, - eMeshEXT = VK_SHADER_STAGE_MESH_BIT_EXT, - eSubpassShadingHUAWEI = VK_SHADER_STAGE_SUBPASS_SHADING_BIT_HUAWEI, - eAnyHitNV = VK_SHADER_STAGE_ANY_HIT_BIT_NV, - eCallableNV = VK_SHADER_STAGE_CALLABLE_BIT_NV, - eClosestHitNV = VK_SHADER_STAGE_CLOSEST_HIT_BIT_NV, - eIntersectionNV = VK_SHADER_STAGE_INTERSECTION_BIT_NV, - eMeshNV = VK_SHADER_STAGE_MESH_BIT_NV, - eMissNV = VK_SHADER_STAGE_MISS_BIT_NV, - eRaygenNV = VK_SHADER_STAGE_RAYGEN_BIT_NV, - eTaskNV = VK_SHADER_STAGE_TASK_BIT_NV - }; - - enum class StencilOp - { - eKeep = VK_STENCIL_OP_KEEP, - eZero = VK_STENCIL_OP_ZERO, - eReplace = VK_STENCIL_OP_REPLACE, - eIncrementAndClamp = VK_STENCIL_OP_INCREMENT_AND_CLAMP, - eDecrementAndClamp = VK_STENCIL_OP_DECREMENT_AND_CLAMP, - eInvert = VK_STENCIL_OP_INVERT, - eIncrementAndWrap = VK_STENCIL_OP_INCREMENT_AND_WRAP, - eDecrementAndWrap = VK_STENCIL_OP_DECREMENT_AND_WRAP - }; - - enum class VertexInputRate - { - eVertex = VK_VERTEX_INPUT_RATE_VERTEX, - eInstance = VK_VERTEX_INPUT_RATE_INSTANCE - }; - - enum class PipelineDynamicStateCreateFlagBits : VkPipelineDynamicStateCreateFlags - { - }; - - enum class PipelineInputAssemblyStateCreateFlagBits : VkPipelineInputAssemblyStateCreateFlags - { - }; - - enum class PipelineMultisampleStateCreateFlagBits : VkPipelineMultisampleStateCreateFlags - { - }; - - enum class PipelineRasterizationStateCreateFlagBits : VkPipelineRasterizationStateCreateFlags - { - }; - - enum class PipelineTessellationStateCreateFlagBits : VkPipelineTessellationStateCreateFlags - { - }; - - enum class PipelineVertexInputStateCreateFlagBits : VkPipelineVertexInputStateCreateFlags - { - }; - - enum class PipelineViewportStateCreateFlagBits : VkPipelineViewportStateCreateFlags - { - }; - - enum class BorderColor - { - eFloatTransparentBlack = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, - eIntTransparentBlack = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK, - eFloatOpaqueBlack = VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK, - eIntOpaqueBlack = VK_BORDER_COLOR_INT_OPAQUE_BLACK, - eFloatOpaqueWhite = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, - eIntOpaqueWhite = VK_BORDER_COLOR_INT_OPAQUE_WHITE, - eFloatCustomEXT = VK_BORDER_COLOR_FLOAT_CUSTOM_EXT, - eIntCustomEXT = VK_BORDER_COLOR_INT_CUSTOM_EXT - }; - - enum class Filter - { - eNearest = VK_FILTER_NEAREST, - eLinear = VK_FILTER_LINEAR, - eCubicEXT = VK_FILTER_CUBIC_EXT, - eCubicIMG = VK_FILTER_CUBIC_IMG - }; - - enum class SamplerAddressMode - { - eRepeat = VK_SAMPLER_ADDRESS_MODE_REPEAT, - eMirroredRepeat = VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, - eClampToEdge = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, - eClampToBorder = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, - eMirrorClampToEdge = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE, - eMirrorClampToEdgeKHR = VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE_KHR - }; - - enum class SamplerCreateFlagBits : VkSamplerCreateFlags - { - eSubsampledEXT = VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT, - eSubsampledCoarseReconstructionEXT = VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT, - eNonSeamlessCubeMapEXT = VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT, - eImageProcessingQCOM = VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM - }; - - enum class SamplerMipmapMode - { - eNearest = VK_SAMPLER_MIPMAP_MODE_NEAREST, - eLinear = VK_SAMPLER_MIPMAP_MODE_LINEAR - }; - - enum class DescriptorPoolCreateFlagBits : VkDescriptorPoolCreateFlags - { - eFreeDescriptorSet = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, - eUpdateAfterBind = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, - eHostOnlyVALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE, - eUpdateAfterBindEXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT - }; - - enum class DescriptorSetLayoutCreateFlagBits : VkDescriptorSetLayoutCreateFlags - { - eUpdateAfterBindPool = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, - ePushDescriptorKHR = VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, - eHostOnlyPoolVALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE, - eUpdateAfterBindPoolEXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT - }; - - enum class DescriptorType - { - eSampler = VK_DESCRIPTOR_TYPE_SAMPLER, - eCombinedImageSampler = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - eSampledImage = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, - eStorageImage = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, - eUniformTexelBuffer = VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, - eStorageTexelBuffer = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, - eUniformBuffer = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, - eStorageBuffer = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - eUniformBufferDynamic = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, - eStorageBufferDynamic = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, - eInputAttachment = VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, - eInlineUniformBlock = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, - eAccelerationStructureKHR = VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, - eAccelerationStructureNV = VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, - eMutableVALVE = VK_DESCRIPTOR_TYPE_MUTABLE_VALVE, - eSampleWeightImageQCOM = VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, - eBlockMatchImageQCOM = VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, - eInlineUniformBlockEXT = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT - }; - - enum class DescriptorPoolResetFlagBits : VkDescriptorPoolResetFlags - { - }; - - enum class AccessFlagBits : VkAccessFlags - { - eIndirectCommandRead = VK_ACCESS_INDIRECT_COMMAND_READ_BIT, - eIndexRead = VK_ACCESS_INDEX_READ_BIT, - eVertexAttributeRead = VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, - eUniformRead = VK_ACCESS_UNIFORM_READ_BIT, - eInputAttachmentRead = VK_ACCESS_INPUT_ATTACHMENT_READ_BIT, - eShaderRead = VK_ACCESS_SHADER_READ_BIT, - eShaderWrite = VK_ACCESS_SHADER_WRITE_BIT, - eColorAttachmentRead = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, - eColorAttachmentWrite = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - eDepthStencilAttachmentRead = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, - eDepthStencilAttachmentWrite = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - eTransferRead = VK_ACCESS_TRANSFER_READ_BIT, - eTransferWrite = VK_ACCESS_TRANSFER_WRITE_BIT, - eHostRead = VK_ACCESS_HOST_READ_BIT, - eHostWrite = VK_ACCESS_HOST_WRITE_BIT, - eMemoryRead = VK_ACCESS_MEMORY_READ_BIT, - eMemoryWrite = VK_ACCESS_MEMORY_WRITE_BIT, - eNone = VK_ACCESS_NONE, - eTransformFeedbackWriteEXT = VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, - eTransformFeedbackCounterReadEXT = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, - eTransformFeedbackCounterWriteEXT = VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, - eConditionalRenderingReadEXT = VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT, - eColorAttachmentReadNoncoherentEXT = VK_ACCESS_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT, - eAccelerationStructureReadKHR = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR, - eAccelerationStructureWriteKHR = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, - eFragmentDensityMapReadEXT = VK_ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT, - eFragmentShadingRateAttachmentReadKHR = VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR, - eCommandPreprocessReadNV = VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV, - eCommandPreprocessWriteNV = VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV, - eAccelerationStructureReadNV = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV, - eAccelerationStructureWriteNV = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV, - eNoneKHR = VK_ACCESS_NONE_KHR, - eShadingRateImageReadNV = VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV - }; - - enum class AttachmentDescriptionFlagBits : VkAttachmentDescriptionFlags - { - eMayAlias = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT - }; - - enum class AttachmentLoadOp - { - eLoad = VK_ATTACHMENT_LOAD_OP_LOAD, - eClear = VK_ATTACHMENT_LOAD_OP_CLEAR, - eDontCare = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - eNoneEXT = VK_ATTACHMENT_LOAD_OP_NONE_EXT - }; - - enum class AttachmentStoreOp - { - eStore = VK_ATTACHMENT_STORE_OP_STORE, - eDontCare = VK_ATTACHMENT_STORE_OP_DONT_CARE, - eNone = VK_ATTACHMENT_STORE_OP_NONE, - eNoneEXT = VK_ATTACHMENT_STORE_OP_NONE_EXT, - eNoneKHR = VK_ATTACHMENT_STORE_OP_NONE_KHR, - eNoneQCOM = VK_ATTACHMENT_STORE_OP_NONE_QCOM - }; - - enum class DependencyFlagBits : VkDependencyFlags - { - eByRegion = VK_DEPENDENCY_BY_REGION_BIT, - eDeviceGroup = VK_DEPENDENCY_DEVICE_GROUP_BIT, - eViewLocal = VK_DEPENDENCY_VIEW_LOCAL_BIT, - eFeedbackLoopEXT = VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT, - eDeviceGroupKHR = VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR, - eViewLocalKHR = VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR - }; - - enum class FramebufferCreateFlagBits : VkFramebufferCreateFlags - { - eImageless = VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, - eImagelessKHR = VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR - }; - - enum class PipelineBindPoint - { - eGraphics = VK_PIPELINE_BIND_POINT_GRAPHICS, - eCompute = VK_PIPELINE_BIND_POINT_COMPUTE, - eRayTracingKHR = VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR, - eSubpassShadingHUAWEI = VK_PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI, - eRayTracingNV = VK_PIPELINE_BIND_POINT_RAY_TRACING_NV - }; - - enum class RenderPassCreateFlagBits : VkRenderPassCreateFlags - { - eTransformQCOM = VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM - }; - - enum class SubpassDescriptionFlagBits : VkSubpassDescriptionFlags - { - ePerViewAttributesNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX, - ePerViewPositionXOnlyNVX = VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX, - eFragmentRegionQCOM = VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, - eShaderResolveQCOM = VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM, - eRasterizationOrderAttachmentColorAccessEXT = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentDepthAccessEXT = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentStencilAccessEXT = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - eEnableLegacyDitheringEXT = VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT, - eRasterizationOrderAttachmentColorAccessARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentDepthAccessARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentStencilAccessARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM - }; - - enum class CommandPoolCreateFlagBits : VkCommandPoolCreateFlags - { - eTransient = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, - eResetCommandBuffer = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, - eProtected = VK_COMMAND_POOL_CREATE_PROTECTED_BIT - }; - - enum class CommandPoolResetFlagBits : VkCommandPoolResetFlags - { - eReleaseResources = VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT - }; - - enum class CommandBufferLevel - { - ePrimary = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - eSecondary = VK_COMMAND_BUFFER_LEVEL_SECONDARY - }; - - enum class CommandBufferResetFlagBits : VkCommandBufferResetFlags - { - eReleaseResources = VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT - }; - - enum class CommandBufferUsageFlagBits : VkCommandBufferUsageFlags - { - eOneTimeSubmit = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, - eRenderPassContinue = VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, - eSimultaneousUse = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT - }; - - enum class QueryControlFlagBits : VkQueryControlFlags - { - ePrecise = VK_QUERY_CONTROL_PRECISE_BIT - }; - - enum class IndexType - { - eUint16 = VK_INDEX_TYPE_UINT16, - eUint32 = VK_INDEX_TYPE_UINT32, - eNoneKHR = VK_INDEX_TYPE_NONE_KHR, - eUint8EXT = VK_INDEX_TYPE_UINT8_EXT, - eNoneNV = VK_INDEX_TYPE_NONE_NV - }; - - enum class StencilFaceFlagBits : VkStencilFaceFlags - { - eFront = VK_STENCIL_FACE_FRONT_BIT, - eBack = VK_STENCIL_FACE_BACK_BIT, - eFrontAndBack = VK_STENCIL_FACE_FRONT_AND_BACK, - eVkStencilFrontAndBack = VK_STENCIL_FRONT_AND_BACK - }; - - enum class SubpassContents - { - eInline = VK_SUBPASS_CONTENTS_INLINE, - eSecondaryCommandBuffers = VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS - }; - - //=== VK_VERSION_1_1 === - - enum class SubgroupFeatureFlagBits : VkSubgroupFeatureFlags - { - eBasic = VK_SUBGROUP_FEATURE_BASIC_BIT, - eVote = VK_SUBGROUP_FEATURE_VOTE_BIT, - eArithmetic = VK_SUBGROUP_FEATURE_ARITHMETIC_BIT, - eBallot = VK_SUBGROUP_FEATURE_BALLOT_BIT, - eShuffle = VK_SUBGROUP_FEATURE_SHUFFLE_BIT, - eShuffleRelative = VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT, - eClustered = VK_SUBGROUP_FEATURE_CLUSTERED_BIT, - eQuad = VK_SUBGROUP_FEATURE_QUAD_BIT, - ePartitionedNV = VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV - }; - - enum class PeerMemoryFeatureFlagBits : VkPeerMemoryFeatureFlags - { - eCopySrc = VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT, - eCopyDst = VK_PEER_MEMORY_FEATURE_COPY_DST_BIT, - eGenericSrc = VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT, - eGenericDst = VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT - }; - using PeerMemoryFeatureFlagBitsKHR = PeerMemoryFeatureFlagBits; - - enum class MemoryAllocateFlagBits : VkMemoryAllocateFlags - { - eDeviceMask = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT, - eDeviceAddress = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT, - eDeviceAddressCaptureReplay = VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT - }; - using MemoryAllocateFlagBitsKHR = MemoryAllocateFlagBits; - - enum class CommandPoolTrimFlagBits : VkCommandPoolTrimFlags - { - }; - - enum class PointClippingBehavior - { - eAllClipPlanes = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES, - eUserClipPlanesOnly = VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY - }; - using PointClippingBehaviorKHR = PointClippingBehavior; - - enum class TessellationDomainOrigin - { - eUpperLeft = VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT, - eLowerLeft = VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT - }; - using TessellationDomainOriginKHR = TessellationDomainOrigin; - - enum class DeviceQueueCreateFlagBits : VkDeviceQueueCreateFlags - { - eProtected = VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT - }; - - enum class SamplerYcbcrModelConversion - { - eRgbIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY, - eYcbcrIdentity = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY, - eYcbcr709 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709, - eYcbcr601 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601, - eYcbcr2020 = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 - }; - using SamplerYcbcrModelConversionKHR = SamplerYcbcrModelConversion; - - enum class SamplerYcbcrRange - { - eItuFull = VK_SAMPLER_YCBCR_RANGE_ITU_FULL, - eItuNarrow = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW - }; - using SamplerYcbcrRangeKHR = SamplerYcbcrRange; - - enum class ChromaLocation - { - eCositedEven = VK_CHROMA_LOCATION_COSITED_EVEN, - eMidpoint = VK_CHROMA_LOCATION_MIDPOINT - }; - using ChromaLocationKHR = ChromaLocation; - - enum class DescriptorUpdateTemplateType - { - eDescriptorSet = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, - ePushDescriptorsKHR = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR - }; - using DescriptorUpdateTemplateTypeKHR = DescriptorUpdateTemplateType; - - enum class DescriptorUpdateTemplateCreateFlagBits : VkDescriptorUpdateTemplateCreateFlags - { - }; - - enum class ExternalMemoryHandleTypeFlagBits : VkExternalMemoryHandleTypeFlags - { - eOpaqueFd = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT, - eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, - eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - eD3D11Texture = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, - eD3D11TextureKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, - eD3D12Heap = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, - eD3D12Resource = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, - eDmaBufEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - eAndroidHardwareBufferANDROID = VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID, -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - eHostAllocationEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT, - eHostMappedForeignMemoryEXT = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eZirconVmoFUCHSIA = VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - eRdmaAddressNV = VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV - }; - using ExternalMemoryHandleTypeFlagBitsKHR = ExternalMemoryHandleTypeFlagBits; - - enum class ExternalMemoryFeatureFlagBits : VkExternalMemoryFeatureFlags - { - eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT, - eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT, - eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT - }; - using ExternalMemoryFeatureFlagBitsKHR = ExternalMemoryFeatureFlagBits; - - enum class ExternalFenceHandleTypeFlagBits : VkExternalFenceHandleTypeFlags - { - eOpaqueFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT, - eOpaqueWin32 = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - eOpaqueWin32Kmt = VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - eSyncFd = VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT - }; - using ExternalFenceHandleTypeFlagBitsKHR = ExternalFenceHandleTypeFlagBits; - - enum class ExternalFenceFeatureFlagBits : VkExternalFenceFeatureFlags - { - eExportable = VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT, - eImportable = VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT - }; - using ExternalFenceFeatureFlagBitsKHR = ExternalFenceFeatureFlagBits; - - enum class FenceImportFlagBits : VkFenceImportFlags - { - eTemporary = VK_FENCE_IMPORT_TEMPORARY_BIT - }; - using FenceImportFlagBitsKHR = FenceImportFlagBits; - - enum class SemaphoreImportFlagBits : VkSemaphoreImportFlags - { - eTemporary = VK_SEMAPHORE_IMPORT_TEMPORARY_BIT - }; - using SemaphoreImportFlagBitsKHR = SemaphoreImportFlagBits; - - enum class ExternalSemaphoreHandleTypeFlagBits : VkExternalSemaphoreHandleTypeFlags - { - eOpaqueFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT, - eOpaqueWin32 = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT, - eOpaqueWin32Kmt = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT, - eD3D12Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - eSyncFd = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eZirconEventFUCHSIA = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - eD3D11Fence = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT - }; - using ExternalSemaphoreHandleTypeFlagBitsKHR = ExternalSemaphoreHandleTypeFlagBits; - - enum class ExternalSemaphoreFeatureFlagBits : VkExternalSemaphoreFeatureFlags - { - eExportable = VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT, - eImportable = VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT - }; - using ExternalSemaphoreFeatureFlagBitsKHR = ExternalSemaphoreFeatureFlagBits; - - //=== VK_VERSION_1_2 === - - enum class DriverId - { - eAmdProprietary = VK_DRIVER_ID_AMD_PROPRIETARY, - eAmdOpenSource = VK_DRIVER_ID_AMD_OPEN_SOURCE, - eMesaRadv = VK_DRIVER_ID_MESA_RADV, - eNvidiaProprietary = VK_DRIVER_ID_NVIDIA_PROPRIETARY, - eIntelProprietaryWindows = VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, - eIntelOpenSourceMESA = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA, - eImaginationProprietary = VK_DRIVER_ID_IMAGINATION_PROPRIETARY, - eQualcommProprietary = VK_DRIVER_ID_QUALCOMM_PROPRIETARY, - eArmProprietary = VK_DRIVER_ID_ARM_PROPRIETARY, - eGoogleSwiftshader = VK_DRIVER_ID_GOOGLE_SWIFTSHADER, - eGgpProprietary = VK_DRIVER_ID_GGP_PROPRIETARY, - eBroadcomProprietary = VK_DRIVER_ID_BROADCOM_PROPRIETARY, - eMesaLlvmpipe = VK_DRIVER_ID_MESA_LLVMPIPE, - eMoltenvk = VK_DRIVER_ID_MOLTENVK, - eCoreaviProprietary = VK_DRIVER_ID_COREAVI_PROPRIETARY, - eJuiceProprietary = VK_DRIVER_ID_JUICE_PROPRIETARY, - eVerisiliconProprietary = VK_DRIVER_ID_VERISILICON_PROPRIETARY, - eMesaTurnip = VK_DRIVER_ID_MESA_TURNIP, - eMesaV3Dv = VK_DRIVER_ID_MESA_V3DV, - eMesaPanvk = VK_DRIVER_ID_MESA_PANVK, - eSamsungProprietary = VK_DRIVER_ID_SAMSUNG_PROPRIETARY, - eMesaVenus = VK_DRIVER_ID_MESA_VENUS, - eMesaDozen = VK_DRIVER_ID_MESA_DOZEN - }; - using DriverIdKHR = DriverId; - - enum class ShaderFloatControlsIndependence - { - e32BitOnly = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, - eAll = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL, - eNone = VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE - }; - using ShaderFloatControlsIndependenceKHR = ShaderFloatControlsIndependence; - - enum class DescriptorBindingFlagBits : VkDescriptorBindingFlags - { - eUpdateAfterBind = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, - eUpdateUnusedWhilePending = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, - ePartiallyBound = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, - eVariableDescriptorCount = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT - }; - using DescriptorBindingFlagBitsEXT = DescriptorBindingFlagBits; - - enum class ResolveModeFlagBits : VkResolveModeFlags - { - eNone = VK_RESOLVE_MODE_NONE, - eSampleZero = VK_RESOLVE_MODE_SAMPLE_ZERO_BIT, - eAverage = VK_RESOLVE_MODE_AVERAGE_BIT, - eMin = VK_RESOLVE_MODE_MIN_BIT, - eMax = VK_RESOLVE_MODE_MAX_BIT - }; - using ResolveModeFlagBitsKHR = ResolveModeFlagBits; - - enum class SamplerReductionMode - { - eWeightedAverage = VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE, - eMin = VK_SAMPLER_REDUCTION_MODE_MIN, - eMax = VK_SAMPLER_REDUCTION_MODE_MAX - }; - using SamplerReductionModeEXT = SamplerReductionMode; - - enum class SemaphoreType - { - eBinary = VK_SEMAPHORE_TYPE_BINARY, - eTimeline = VK_SEMAPHORE_TYPE_TIMELINE - }; - using SemaphoreTypeKHR = SemaphoreType; - - enum class SemaphoreWaitFlagBits : VkSemaphoreWaitFlags - { - eAny = VK_SEMAPHORE_WAIT_ANY_BIT - }; - using SemaphoreWaitFlagBitsKHR = SemaphoreWaitFlagBits; - - //=== VK_VERSION_1_3 === - - enum class PipelineCreationFeedbackFlagBits : VkPipelineCreationFeedbackFlags - { - eValid = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT, - eApplicationPipelineCacheHit = VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT, - eBasePipelineAcceleration = VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT - }; - using PipelineCreationFeedbackFlagBitsEXT = PipelineCreationFeedbackFlagBits; - - enum class ToolPurposeFlagBits : VkToolPurposeFlags - { - eValidation = VK_TOOL_PURPOSE_VALIDATION_BIT, - eProfiling = VK_TOOL_PURPOSE_PROFILING_BIT, - eTracing = VK_TOOL_PURPOSE_TRACING_BIT, - eAdditionalFeatures = VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT, - eModifyingFeatures = VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT, - eDebugReportingEXT = VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT, - eDebugMarkersEXT = VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT - }; - using ToolPurposeFlagBitsEXT = ToolPurposeFlagBits; - - enum class PrivateDataSlotCreateFlagBits : VkPrivateDataSlotCreateFlags - { - }; - using PrivateDataSlotCreateFlagBitsEXT = PrivateDataSlotCreateFlagBits; - - enum class PipelineStageFlagBits2 : VkPipelineStageFlags2 - { - eNone = VK_PIPELINE_STAGE_2_NONE, - eTopOfPipe = VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT, - eDrawIndirect = VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT, - eVertexInput = VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT, - eVertexShader = VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT, - eTessellationControlShader = VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT, - eTessellationEvaluationShader = VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT, - eGeometryShader = VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT, - eFragmentShader = VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT, - eEarlyFragmentTests = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT, - eLateFragmentTests = VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT, - eColorAttachmentOutput = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, - eComputeShader = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, - eAllTransfer = VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT, - eBottomOfPipe = VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT, - eHost = VK_PIPELINE_STAGE_2_HOST_BIT, - eAllGraphics = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT, - eAllCommands = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, - eCopy = VK_PIPELINE_STAGE_2_COPY_BIT, - eResolve = VK_PIPELINE_STAGE_2_RESOLVE_BIT, - eBlit = VK_PIPELINE_STAGE_2_BLIT_BIT, - eClear = VK_PIPELINE_STAGE_2_CLEAR_BIT, - eIndexInput = VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT, - eVertexAttributeInput = VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT, - ePreRasterizationShaders = VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeKHR = VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR, - eVideoEncodeKHR = VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eTransformFeedbackEXT = VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT, - eConditionalRenderingEXT = VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT, - eCommandPreprocessNV = VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV, - eFragmentShadingRateAttachmentKHR = VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, - eAccelerationStructureBuildKHR = VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR, - eRayTracingShaderKHR = VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR, - eFragmentDensityProcessEXT = VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT, - eTaskShaderEXT = VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT, - eMeshShaderEXT = VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT, - eSubpassShadingHUAWEI = VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI, - eInvocationMaskHUAWEI = VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI, - eAccelerationStructureCopyKHR = VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_COPY_BIT_KHR, - eAccelerationStructureBuildNV = VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV, - eMeshShaderNV = VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV, - eRayTracingShaderNV = VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV, - eShadingRateImageNV = VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV, - eTaskShaderNV = VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV, - eTransfer = VK_PIPELINE_STAGE_2_TRANSFER_BIT - }; - using PipelineStageFlagBits2KHR = PipelineStageFlagBits2; - - enum class AccessFlagBits2 : VkAccessFlags2 - { - eNone = VK_ACCESS_2_NONE, - eIndirectCommandRead = VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT, - eIndexRead = VK_ACCESS_2_INDEX_READ_BIT, - eVertexAttributeRead = VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT, - eUniformRead = VK_ACCESS_2_UNIFORM_READ_BIT, - eInputAttachmentRead = VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT, - eShaderRead = VK_ACCESS_2_SHADER_READ_BIT, - eShaderWrite = VK_ACCESS_2_SHADER_WRITE_BIT, - eColorAttachmentRead = VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT, - eColorAttachmentWrite = VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, - eDepthStencilAttachmentRead = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT, - eDepthStencilAttachmentWrite = VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, - eTransferRead = VK_ACCESS_2_TRANSFER_READ_BIT, - eTransferWrite = VK_ACCESS_2_TRANSFER_WRITE_BIT, - eHostRead = VK_ACCESS_2_HOST_READ_BIT, - eHostWrite = VK_ACCESS_2_HOST_WRITE_BIT, - eMemoryRead = VK_ACCESS_2_MEMORY_READ_BIT, - eMemoryWrite = VK_ACCESS_2_MEMORY_WRITE_BIT, - eShaderSampledRead = VK_ACCESS_2_SHADER_SAMPLED_READ_BIT, - eShaderStorageRead = VK_ACCESS_2_SHADER_STORAGE_READ_BIT, - eShaderStorageWrite = VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeReadKHR = VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR, - eVideoDecodeWriteKHR = VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR, - eVideoEncodeReadKHR = VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR, - eVideoEncodeWriteKHR = VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eTransformFeedbackWriteEXT = VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT, - eTransformFeedbackCounterReadEXT = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT, - eTransformFeedbackCounterWriteEXT = VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT, - eConditionalRenderingReadEXT = VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT, - eCommandPreprocessReadNV = VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV, - eCommandPreprocessWriteNV = VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV, - eFragmentShadingRateAttachmentReadKHR = VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR, - eAccelerationStructureReadKHR = VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR, - eAccelerationStructureWriteKHR = VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR, - eFragmentDensityMapReadEXT = VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT, - eColorAttachmentReadNoncoherentEXT = VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT, - eInvocationMaskReadHUAWEI = VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI, - eShaderBindingTableReadKHR = VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR, - eAccelerationStructureReadNV = VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV, - eAccelerationStructureWriteNV = VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV, - eShadingRateImageReadNV = VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV - }; - using AccessFlagBits2KHR = AccessFlagBits2; - - enum class SubmitFlagBits : VkSubmitFlags - { - eProtected = VK_SUBMIT_PROTECTED_BIT - }; - using SubmitFlagBitsKHR = SubmitFlagBits; - - enum class RenderingFlagBits : VkRenderingFlags - { - eContentsSecondaryCommandBuffers = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT, - eSuspending = VK_RENDERING_SUSPENDING_BIT, - eResuming = VK_RENDERING_RESUMING_BIT, - eEnableLegacyDitheringEXT = VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT - }; - using RenderingFlagBitsKHR = RenderingFlagBits; - - enum class FormatFeatureFlagBits2 : VkFormatFeatureFlags2 - { - eSampledImage = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT, - eStorageImage = VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT, - eStorageImageAtomic = VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT, - eUniformTexelBuffer = VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT, - eStorageTexelBuffer = VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT, - eStorageTexelBufferAtomic = VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT, - eVertexBuffer = VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT, - eColorAttachment = VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT, - eColorAttachmentBlend = VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT, - eDepthStencilAttachment = VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT, - eBlitSrc = VK_FORMAT_FEATURE_2_BLIT_SRC_BIT, - eBlitDst = VK_FORMAT_FEATURE_2_BLIT_DST_BIT, - eSampledImageFilterLinear = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT, - eSampledImageFilterCubic = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT, - eTransferSrc = VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT, - eTransferDst = VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT, - eSampledImageFilterMinmax = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT, - eMidpointChromaSamples = VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT, - eSampledImageYcbcrConversionLinearFilter = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT, - eSampledImageYcbcrConversionSeparateReconstructionFilter = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT, - eSampledImageYcbcrConversionChromaReconstructionExplicit = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT, - eSampledImageYcbcrConversionChromaReconstructionExplicitForceable = - VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT, - eDisjoint = VK_FORMAT_FEATURE_2_DISJOINT_BIT, - eCositedChromaSamples = VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT, - eStorageReadWithoutFormat = VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT, - eStorageWriteWithoutFormat = VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT, - eSampledImageDepthComparison = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoDecodeOutputKHR = VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR, - eVideoDecodeDpbKHR = VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eAccelerationStructureVertexBufferKHR = VK_FORMAT_FEATURE_2_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR, - eFragmentDensityMapEXT = VK_FORMAT_FEATURE_2_FRAGMENT_DENSITY_MAP_BIT_EXT, - eFragmentShadingRateAttachmentKHR = VK_FORMAT_FEATURE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR, -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - eVideoEncodeInputKHR = VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR, - eVideoEncodeDpbKHR = VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR, -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - eLinearColorAttachmentNV = VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV, - eWeightImageQCOM = VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM, - eWeightSampledImageQCOM = VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM, - eBlockMatchingQCOM = VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM, - eBoxFilterSampledQCOM = VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM, - eSampledImageFilterCubicEXT = VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT - }; - using FormatFeatureFlagBits2KHR = FormatFeatureFlagBits2; - - //=== VK_KHR_surface === - - enum class SurfaceTransformFlagBitsKHR : VkSurfaceTransformFlagsKHR - { - eIdentity = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR, - eRotate90 = VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR, - eRotate180 = VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, - eRotate270 = VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR, - eHorizontalMirror = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR, - eHorizontalMirrorRotate90 = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR, - eHorizontalMirrorRotate180 = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR, - eHorizontalMirrorRotate270 = VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR, - eInherit = VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR - }; - - enum class PresentModeKHR - { - eImmediate = VK_PRESENT_MODE_IMMEDIATE_KHR, - eMailbox = VK_PRESENT_MODE_MAILBOX_KHR, - eFifo = VK_PRESENT_MODE_FIFO_KHR, - eFifoRelaxed = VK_PRESENT_MODE_FIFO_RELAXED_KHR, - eSharedDemandRefresh = VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR, - eSharedContinuousRefresh = VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR - }; - - enum class ColorSpaceKHR - { - eSrgbNonlinear = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, - eDisplayP3NonlinearEXT = VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT, - eExtendedSrgbLinearEXT = VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, - eDisplayP3LinearEXT = VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT, - eDciP3NonlinearEXT = VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT, - eBt709LinearEXT = VK_COLOR_SPACE_BT709_LINEAR_EXT, - eBt709NonlinearEXT = VK_COLOR_SPACE_BT709_NONLINEAR_EXT, - eBt2020LinearEXT = VK_COLOR_SPACE_BT2020_LINEAR_EXT, - eHdr10St2084EXT = VK_COLOR_SPACE_HDR10_ST2084_EXT, - eDolbyvisionEXT = VK_COLOR_SPACE_DOLBYVISION_EXT, - eHdr10HlgEXT = VK_COLOR_SPACE_HDR10_HLG_EXT, - eAdobergbLinearEXT = VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT, - eAdobergbNonlinearEXT = VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT, - ePassThroughEXT = VK_COLOR_SPACE_PASS_THROUGH_EXT, - eExtendedSrgbNonlinearEXT = VK_COLOR_SPACE_EXTENDED_SRGB_NONLINEAR_EXT, - eDisplayNativeAMD = VK_COLOR_SPACE_DISPLAY_NATIVE_AMD, - eVkColorspaceSrgbNonlinear = VK_COLORSPACE_SRGB_NONLINEAR_KHR, - eDciP3LinearEXT = VK_COLOR_SPACE_DCI_P3_LINEAR_EXT - }; - - enum class CompositeAlphaFlagBitsKHR : VkCompositeAlphaFlagsKHR - { - eOpaque = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, - ePreMultiplied = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR, - ePostMultiplied = VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR, - eInherit = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR - }; - - //=== VK_KHR_swapchain === - - enum class SwapchainCreateFlagBitsKHR : VkSwapchainCreateFlagsKHR - { - eSplitInstanceBindRegions = VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR, - eProtected = VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR, - eMutableFormat = VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR - }; - - enum class DeviceGroupPresentModeFlagBitsKHR : VkDeviceGroupPresentModeFlagsKHR - { - eLocal = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR, - eRemote = VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR, - eSum = VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR, - eLocalMultiDevice = VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR - }; - - //=== VK_KHR_display === - - enum class DisplayPlaneAlphaFlagBitsKHR : VkDisplayPlaneAlphaFlagsKHR - { - eOpaque = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR, - eGlobal = VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR, - ePerPixel = VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR, - ePerPixelPremultiplied = VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR - }; - - enum class DisplayModeCreateFlagBitsKHR : VkDisplayModeCreateFlagsKHR - { - }; - - enum class DisplaySurfaceCreateFlagBitsKHR : VkDisplaySurfaceCreateFlagsKHR - { - }; - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - enum class XlibSurfaceCreateFlagBitsKHR : VkXlibSurfaceCreateFlagsKHR - { - }; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - enum class XcbSurfaceCreateFlagBitsKHR : VkXcbSurfaceCreateFlagsKHR - { - }; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - enum class WaylandSurfaceCreateFlagBitsKHR : VkWaylandSurfaceCreateFlagsKHR - { - }; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - enum class AndroidSurfaceCreateFlagBitsKHR : VkAndroidSurfaceCreateFlagsKHR - { - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - enum class Win32SurfaceCreateFlagBitsKHR : VkWin32SurfaceCreateFlagsKHR - { - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - enum class DebugReportFlagBitsEXT : VkDebugReportFlagsEXT - { - eInformation = VK_DEBUG_REPORT_INFORMATION_BIT_EXT, - eWarning = VK_DEBUG_REPORT_WARNING_BIT_EXT, - ePerformanceWarning = VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT, - eError = VK_DEBUG_REPORT_ERROR_BIT_EXT, - eDebug = VK_DEBUG_REPORT_DEBUG_BIT_EXT - }; - - enum class DebugReportObjectTypeEXT - { - eUnknown = VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, - eInstance = VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, - ePhysicalDevice = VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, - eDevice = VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, - eQueue = VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT, - eSemaphore = VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - eCommandBuffer = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - eFence = VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT, - eDeviceMemory = VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, - eBuffer = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - eImage = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - eEvent = VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT, - eQueryPool = VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, - eBufferView = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT, - eImageView = VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT, - eShaderModule = VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, - ePipelineCache = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT, - ePipelineLayout = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT, - eRenderPass = VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT, - ePipeline = VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - eDescriptorSetLayout = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT, - eSampler = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT, - eDescriptorPool = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT, - eDescriptorSet = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - eFramebuffer = VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT, - eCommandPool = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT, - eSurfaceKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT, - eSwapchainKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, - eDebugReportCallbackEXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, - eDisplayKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT, - eDisplayModeKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT, - eValidationCacheEXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - eSamplerYcbcrConversion = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT, - eDescriptorUpdateTemplate = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT, - eCuModuleNVX = VK_DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT, - eCuFunctionNVX = VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT, - eAccelerationStructureKHR = VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT, - eAccelerationStructureNV = VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT, -#if defined( VK_USE_PLATFORM_FUCHSIA ) - eBufferCollectionFUCHSIA = VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT, -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - eDebugReport = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, - eDescriptorUpdateTemplateKHR = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT, - eSamplerYcbcrConversionKHR = VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_KHR_EXT, - eValidationCache = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT - }; - - //=== VK_AMD_rasterization_order === - - enum class RasterizationOrderAMD - { - eStrict = VK_RASTERIZATION_ORDER_STRICT_AMD, - eRelaxed = VK_RASTERIZATION_ORDER_RELAXED_AMD - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - enum class VideoCodecOperationFlagBitsKHR : VkVideoCodecOperationFlagsKHR - { - eNone = VK_VIDEO_CODEC_OPERATION_NONE_KHR, -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - eEncodeH264EXT = VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT, - eEncodeH265EXT = VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT, - eDecodeH264EXT = VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_EXT, - eDecodeH265EXT = VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_EXT -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - - enum class VideoChromaSubsamplingFlagBitsKHR : VkVideoChromaSubsamplingFlagsKHR - { - eInvalid = VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR, - eMonochrome = VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR, - e420 = VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR, - e422 = VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR, - e444 = VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR - }; - - enum class VideoComponentBitDepthFlagBitsKHR : VkVideoComponentBitDepthFlagsKHR - { - eInvalid = VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR, - e8 = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR, - e10 = VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR, - e12 = VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR - }; - - enum class VideoCapabilityFlagBitsKHR : VkVideoCapabilityFlagsKHR - { - eProtectedContent = VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR, - eSeparateReferenceImages = VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR - }; - - enum class VideoSessionCreateFlagBitsKHR : VkVideoSessionCreateFlagsKHR - { - eProtectedContent = VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR - }; - - enum class VideoCodingControlFlagBitsKHR : VkVideoCodingControlFlagsKHR - { - eReset = VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR, -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - eEncodeRateControl = VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR, - eEncodeRateControlLayer = VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - - enum class QueryResultStatusKHR - { - eError = VK_QUERY_RESULT_STATUS_ERROR_KHR, - eNotReady = VK_QUERY_RESULT_STATUS_NOT_READY_KHR, - eComplete = VK_QUERY_RESULT_STATUS_COMPLETE_KHR - }; - - enum class VideoSessionParametersCreateFlagBitsKHR : VkVideoSessionParametersCreateFlagsKHR - { - }; - - enum class VideoBeginCodingFlagBitsKHR : VkVideoBeginCodingFlagsKHR - { - }; - - enum class VideoEndCodingFlagBitsKHR : VkVideoEndCodingFlagsKHR - { - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - enum class VideoDecodeCapabilityFlagBitsKHR : VkVideoDecodeCapabilityFlagsKHR - { - eDpbAndOutputCoincide = VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR, - eDpbAndOutputDistinct = VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR - }; - - enum class VideoDecodeUsageFlagBitsKHR : VkVideoDecodeUsageFlagsKHR - { - eDefault = VK_VIDEO_DECODE_USAGE_DEFAULT_KHR, - eTranscoding = VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR, - eOffline = VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR, - eStreaming = VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR - }; - - enum class VideoDecodeFlagBitsKHR : VkVideoDecodeFlagsKHR - { - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - enum class PipelineRasterizationStateStreamCreateFlagBitsEXT : VkPipelineRasterizationStateStreamCreateFlagsEXT - { - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - - enum class VideoEncodeH264CapabilityFlagBitsEXT : VkVideoEncodeH264CapabilityFlagsEXT - { - eDirect8X8InferenceEnabled = VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT, - eDirect8X8InferenceDisabled = VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT, - eSeparateColourPlane = VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT, - eQpprimeYZeroTransformBypass = VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT, - eScalingLists = VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT, - eHrdCompliance = VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT, - eChromaQpOffset = VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT, - eSecondChromaQpOffset = VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT, - ePicInitQpMinus26 = VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT, - eWeightedPred = VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT, - eWeightedBipredExplicit = VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT, - eWeightedBipredImplicit = VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT, - eWeightedPredNoTable = VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT, - eTransform8X8 = VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT, - eCabac = VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT, - eCavlc = VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT, - eDeblockingFilterDisabled = VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT, - eDeblockingFilterEnabled = VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT, - eDeblockingFilterPartial = VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT, - eDisableDirectSpatialMvPred = VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT, - eMultipleSlicePerFrame = VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT, - eSliceMbCount = VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT, - eRowUnalignedSlice = VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT, - eDifferentSliceType = VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT, - eBFrameInL1List = VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT - }; - - enum class VideoEncodeH264InputModeFlagBitsEXT : VkVideoEncodeH264InputModeFlagsEXT - { - eFrame = VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT, - eSlice = VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT, - eNonVcl = VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT - }; - - enum class VideoEncodeH264OutputModeFlagBitsEXT : VkVideoEncodeH264OutputModeFlagsEXT - { - eFrame = VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT, - eSlice = VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT, - eNonVcl = VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT - }; - - enum class VideoEncodeH264RateControlStructureEXT - { - eUnknown = VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT, - eFlat = VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_EXT, - eDyadic = VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_DYADIC_EXT - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - - enum class VideoEncodeH265CapabilityFlagBitsEXT : VkVideoEncodeH265CapabilityFlagsEXT - { - eSeparateColourPlane = VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT, - eScalingLists = VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT, - eSampleAdaptiveOffsetEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT, - ePcmEnable = VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT, - eSpsTemporalMvpEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT, - eHrdCompliance = VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT, - eInitQpMinus26 = VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT, - eLog2ParallelMergeLevelMinus2 = VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT, - eSignDataHidingEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT, - eTransformSkipEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT, - eTransformSkipDisabled = VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT, - ePpsSliceChromaQpOffsetsPresent = VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT, - eWeightedPred = VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT, - eWeightedBipred = VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT, - eWeightedPredNoTable = VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT, - eTransquantBypassEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT, - eEntropyCodingSyncEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT, - eDeblockingFilterOverrideEnabled = VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT, - eMultipleTilePerFrame = VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT, - eMultipleSlicePerTile = VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT, - eMultipleTilePerSlice = VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT, - eSliceSegmentCtbCount = VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT, - eRowUnalignedSliceSegment = VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT, - eDependentSliceSegment = VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT, - eDifferentSliceType = VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT, - eBFrameInL1List = VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT - }; - - enum class VideoEncodeH265InputModeFlagBitsEXT : VkVideoEncodeH265InputModeFlagsEXT - { - eFrame = VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT, - eSliceSegment = VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT, - eNonVcl = VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT - }; - - enum class VideoEncodeH265OutputModeFlagBitsEXT : VkVideoEncodeH265OutputModeFlagsEXT - { - eFrame = VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT, - eSliceSegment = VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT, - eNonVcl = VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT - }; - - enum class VideoEncodeH265CtbSizeFlagBitsEXT : VkVideoEncodeH265CtbSizeFlagsEXT - { - e16 = VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT, - e32 = VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT, - e64 = VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT - }; - - enum class VideoEncodeH265TransformBlockSizeFlagBitsEXT : VkVideoEncodeH265TransformBlockSizeFlagsEXT - { - e4 = VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT, - e8 = VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT, - e16 = VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT, - e32 = VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT - }; - - enum class VideoEncodeH265RateControlStructureEXT - { - eUnknown = VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT, - eFlat = VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_EXT, - eDyadic = VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_DYADIC_EXT - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - - enum class VideoDecodeH264PictureLayoutFlagBitsEXT : VkVideoDecodeH264PictureLayoutFlagsEXT - { - eProgressive = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_EXT, - eInterlacedInterleavedLines = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_EXT, - eInterlacedSeparatePlanes = VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_EXT - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_AMD_shader_info === - - enum class ShaderInfoTypeAMD - { - eStatistics = VK_SHADER_INFO_TYPE_STATISTICS_AMD, - eBinary = VK_SHADER_INFO_TYPE_BINARY_AMD, - eDisassembly = VK_SHADER_INFO_TYPE_DISASSEMBLY_AMD - }; - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - enum class StreamDescriptorSurfaceCreateFlagBitsGGP : VkStreamDescriptorSurfaceCreateFlagsGGP - { - }; -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - enum class ExternalMemoryHandleTypeFlagBitsNV : VkExternalMemoryHandleTypeFlagsNV - { - eOpaqueWin32 = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV, - eOpaqueWin32Kmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV, - eD3D11Image = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV, - eD3D11ImageKmt = VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV - }; - - enum class ExternalMemoryFeatureFlagBitsNV : VkExternalMemoryFeatureFlagsNV - { - eDedicatedOnly = VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV, - eExportable = VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV, - eImportable = VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV - }; - - //=== VK_EXT_validation_flags === - - enum class ValidationCheckEXT - { - eAll = VK_VALIDATION_CHECK_ALL_EXT, - eShaders = VK_VALIDATION_CHECK_SHADERS_EXT - }; - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - enum class ViSurfaceCreateFlagBitsNN : VkViSurfaceCreateFlagsNN - { - }; -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_EXT_pipeline_robustness === - - enum class PipelineRobustnessBufferBehaviorEXT - { - eDeviceDefault = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT, - eDisabled = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT, - eRobustBufferAccess = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT, - eRobustBufferAccess2 = VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT - }; - - enum class PipelineRobustnessImageBehaviorEXT - { - eDeviceDefault = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT, - eDisabled = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT, - eRobustImageAccess = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT, - eRobustImageAccess2 = VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT - }; - - //=== VK_EXT_conditional_rendering === - - enum class ConditionalRenderingFlagBitsEXT : VkConditionalRenderingFlagsEXT - { - eInverted = VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT - }; - - //=== VK_EXT_display_surface_counter === - - enum class SurfaceCounterFlagBitsEXT : VkSurfaceCounterFlagsEXT - { - eVblank = VK_SURFACE_COUNTER_VBLANK_BIT_EXT - }; - - //=== VK_EXT_display_control === - - enum class DisplayPowerStateEXT - { - eOff = VK_DISPLAY_POWER_STATE_OFF_EXT, - eSuspend = VK_DISPLAY_POWER_STATE_SUSPEND_EXT, - eOn = VK_DISPLAY_POWER_STATE_ON_EXT - }; - - enum class DeviceEventTypeEXT - { - eDisplayHotplug = VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT - }; - - enum class DisplayEventTypeEXT - { - eFirstPixelOut = VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT - }; - - //=== VK_NV_viewport_swizzle === - - enum class ViewportCoordinateSwizzleNV - { - ePositiveX = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV, - eNegativeX = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV, - ePositiveY = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV, - eNegativeY = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV, - ePositiveZ = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV, - eNegativeZ = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV, - ePositiveW = VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV, - eNegativeW = VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV - }; - - enum class PipelineViewportSwizzleStateCreateFlagBitsNV : VkPipelineViewportSwizzleStateCreateFlagsNV - { - }; - - //=== VK_EXT_discard_rectangles === - - enum class DiscardRectangleModeEXT - { - eInclusive = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT, - eExclusive = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - }; - - enum class PipelineDiscardRectangleStateCreateFlagBitsEXT : VkPipelineDiscardRectangleStateCreateFlagsEXT - { - }; - - //=== VK_EXT_conservative_rasterization === - - enum class ConservativeRasterizationModeEXT - { - eDisabled = VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT, - eOverestimate = VK_CONSERVATIVE_RASTERIZATION_MODE_OVERESTIMATE_EXT, - eUnderestimate = VK_CONSERVATIVE_RASTERIZATION_MODE_UNDERESTIMATE_EXT - }; - - enum class PipelineRasterizationConservativeStateCreateFlagBitsEXT : VkPipelineRasterizationConservativeStateCreateFlagsEXT - { - }; - - //=== VK_EXT_depth_clip_enable === - - enum class PipelineRasterizationDepthClipStateCreateFlagBitsEXT : VkPipelineRasterizationDepthClipStateCreateFlagsEXT - { - }; - - //=== VK_KHR_performance_query === - - enum class PerformanceCounterDescriptionFlagBitsKHR : VkPerformanceCounterDescriptionFlagsKHR - { - ePerformanceImpacting = VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR, - eConcurrentlyImpacted = VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR - }; - - enum class PerformanceCounterScopeKHR - { - eCommandBuffer = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_BUFFER_KHR, - eRenderPass = VK_PERFORMANCE_COUNTER_SCOPE_RENDER_PASS_KHR, - eCommand = VK_PERFORMANCE_COUNTER_SCOPE_COMMAND_KHR, - eVkQueryScopeCommandBuffer = VK_QUERY_SCOPE_COMMAND_BUFFER_KHR, - eVkQueryScopeCommand = VK_QUERY_SCOPE_COMMAND_KHR, - eVkQueryScopeRenderPass = VK_QUERY_SCOPE_RENDER_PASS_KHR - }; - - enum class PerformanceCounterStorageKHR - { - eInt32 = VK_PERFORMANCE_COUNTER_STORAGE_INT32_KHR, - eInt64 = VK_PERFORMANCE_COUNTER_STORAGE_INT64_KHR, - eUint32 = VK_PERFORMANCE_COUNTER_STORAGE_UINT32_KHR, - eUint64 = VK_PERFORMANCE_COUNTER_STORAGE_UINT64_KHR, - eFloat32 = VK_PERFORMANCE_COUNTER_STORAGE_FLOAT32_KHR, - eFloat64 = VK_PERFORMANCE_COUNTER_STORAGE_FLOAT64_KHR - }; - - enum class PerformanceCounterUnitKHR - { - eGeneric = VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR, - ePercentage = VK_PERFORMANCE_COUNTER_UNIT_PERCENTAGE_KHR, - eNanoseconds = VK_PERFORMANCE_COUNTER_UNIT_NANOSECONDS_KHR, - eBytes = VK_PERFORMANCE_COUNTER_UNIT_BYTES_KHR, - eBytesPerSecond = VK_PERFORMANCE_COUNTER_UNIT_BYTES_PER_SECOND_KHR, - eKelvin = VK_PERFORMANCE_COUNTER_UNIT_KELVIN_KHR, - eWatts = VK_PERFORMANCE_COUNTER_UNIT_WATTS_KHR, - eVolts = VK_PERFORMANCE_COUNTER_UNIT_VOLTS_KHR, - eAmps = VK_PERFORMANCE_COUNTER_UNIT_AMPS_KHR, - eHertz = VK_PERFORMANCE_COUNTER_UNIT_HERTZ_KHR, - eCycles = VK_PERFORMANCE_COUNTER_UNIT_CYCLES_KHR - }; - - enum class AcquireProfilingLockFlagBitsKHR : VkAcquireProfilingLockFlagsKHR - { - }; - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - enum class IOSSurfaceCreateFlagBitsMVK : VkIOSSurfaceCreateFlagsMVK - { - }; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - enum class MacOSSurfaceCreateFlagBitsMVK : VkMacOSSurfaceCreateFlagsMVK - { - }; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - enum class DebugUtilsMessageSeverityFlagBitsEXT : VkDebugUtilsMessageSeverityFlagsEXT - { - eVerbose = VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT, - eInfo = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT, - eWarning = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT, - eError = VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT - }; - - enum class DebugUtilsMessageTypeFlagBitsEXT : VkDebugUtilsMessageTypeFlagsEXT - { - eGeneral = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT, - eValidation = VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT, - ePerformance = VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT - }; - - enum class DebugUtilsMessengerCallbackDataFlagBitsEXT : VkDebugUtilsMessengerCallbackDataFlagsEXT - { - }; - - enum class DebugUtilsMessengerCreateFlagBitsEXT : VkDebugUtilsMessengerCreateFlagsEXT - { - }; - - //=== VK_EXT_blend_operation_advanced === - - enum class BlendOverlapEXT - { - eUncorrelated = VK_BLEND_OVERLAP_UNCORRELATED_EXT, - eDisjoint = VK_BLEND_OVERLAP_DISJOINT_EXT, - eConjoint = VK_BLEND_OVERLAP_CONJOINT_EXT - }; - - //=== VK_NV_fragment_coverage_to_color === - - enum class PipelineCoverageToColorStateCreateFlagBitsNV : VkPipelineCoverageToColorStateCreateFlagsNV - { - }; - - //=== VK_KHR_acceleration_structure === - - enum class AccelerationStructureTypeKHR - { - eTopLevel = VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR, - eBottomLevel = VK_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL_KHR, - eGeneric = VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR - }; - using AccelerationStructureTypeNV = AccelerationStructureTypeKHR; - - enum class AccelerationStructureBuildTypeKHR - { - eHost = VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR, - eDevice = VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR, - eHostOrDevice = VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR - }; - - enum class GeometryFlagBitsKHR : VkGeometryFlagsKHR - { - eOpaque = VK_GEOMETRY_OPAQUE_BIT_KHR, - eNoDuplicateAnyHitInvocation = VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR - }; - using GeometryFlagBitsNV = GeometryFlagBitsKHR; - - enum class GeometryInstanceFlagBitsKHR : VkGeometryInstanceFlagsKHR - { - eTriangleFacingCullDisable = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR, - eTriangleFlipFacing = VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR, - eForceOpaque = VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR, - eForceNoOpaque = VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR, - eTriangleCullDisable = VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV, - eTriangleFrontCounterclockwiseKHR = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR, - eTriangleFrontCounterclockwise = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV - }; - using GeometryInstanceFlagBitsNV = GeometryInstanceFlagBitsKHR; - - enum class BuildAccelerationStructureFlagBitsKHR : VkBuildAccelerationStructureFlagsKHR - { - eAllowUpdate = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR, - eAllowCompaction = VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_COMPACTION_BIT_KHR, - ePreferFastTrace = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_TRACE_BIT_KHR, - ePreferFastBuild = VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR, - eLowMemory = VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR, - eMotionNV = VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV - }; - using BuildAccelerationStructureFlagBitsNV = BuildAccelerationStructureFlagBitsKHR; - - enum class CopyAccelerationStructureModeKHR - { - eClone = VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR, - eCompact = VK_COPY_ACCELERATION_STRUCTURE_MODE_COMPACT_KHR, - eSerialize = VK_COPY_ACCELERATION_STRUCTURE_MODE_SERIALIZE_KHR, - eDeserialize = VK_COPY_ACCELERATION_STRUCTURE_MODE_DESERIALIZE_KHR - }; - using CopyAccelerationStructureModeNV = CopyAccelerationStructureModeKHR; - - enum class GeometryTypeKHR - { - eTriangles = VK_GEOMETRY_TYPE_TRIANGLES_KHR, - eAabbs = VK_GEOMETRY_TYPE_AABBS_KHR, - eInstances = VK_GEOMETRY_TYPE_INSTANCES_KHR - }; - using GeometryTypeNV = GeometryTypeKHR; - - enum class AccelerationStructureCompatibilityKHR - { - eCompatible = VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR, - eIncompatible = VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR - }; - - enum class AccelerationStructureCreateFlagBitsKHR : VkAccelerationStructureCreateFlagsKHR - { - eDeviceAddressCaptureReplay = VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR, - eMotionNV = VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV - }; - - enum class BuildAccelerationStructureModeKHR - { - eBuild = VK_BUILD_ACCELERATION_STRUCTURE_MODE_BUILD_KHR, - eUpdate = VK_BUILD_ACCELERATION_STRUCTURE_MODE_UPDATE_KHR - }; - - //=== VK_NV_framebuffer_mixed_samples === - - enum class CoverageModulationModeNV - { - eNone = VK_COVERAGE_MODULATION_MODE_NONE_NV, - eRgb = VK_COVERAGE_MODULATION_MODE_RGB_NV, - eAlpha = VK_COVERAGE_MODULATION_MODE_ALPHA_NV, - eRgba = VK_COVERAGE_MODULATION_MODE_RGBA_NV - }; - - enum class PipelineCoverageModulationStateCreateFlagBitsNV : VkPipelineCoverageModulationStateCreateFlagsNV - { - }; - - //=== VK_EXT_validation_cache === - - enum class ValidationCacheHeaderVersionEXT - { - eOne = VK_VALIDATION_CACHE_HEADER_VERSION_ONE_EXT - }; - - enum class ValidationCacheCreateFlagBitsEXT : VkValidationCacheCreateFlagsEXT - { - }; - - //=== VK_NV_shading_rate_image === - - enum class ShadingRatePaletteEntryNV - { - eNoInvocations = VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV, - e16InvocationsPerPixel = VK_SHADING_RATE_PALETTE_ENTRY_16_INVOCATIONS_PER_PIXEL_NV, - e8InvocationsPerPixel = VK_SHADING_RATE_PALETTE_ENTRY_8_INVOCATIONS_PER_PIXEL_NV, - e4InvocationsPerPixel = VK_SHADING_RATE_PALETTE_ENTRY_4_INVOCATIONS_PER_PIXEL_NV, - e2InvocationsPerPixel = VK_SHADING_RATE_PALETTE_ENTRY_2_INVOCATIONS_PER_PIXEL_NV, - e1InvocationPerPixel = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_PIXEL_NV, - e1InvocationPer2X1Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X1_PIXELS_NV, - e1InvocationPer1X2Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_1X2_PIXELS_NV, - e1InvocationPer2X2Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X2_PIXELS_NV, - e1InvocationPer4X2Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X2_PIXELS_NV, - e1InvocationPer2X4Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_2X4_PIXELS_NV, - e1InvocationPer4X4Pixels = VK_SHADING_RATE_PALETTE_ENTRY_1_INVOCATION_PER_4X4_PIXELS_NV - }; - - enum class CoarseSampleOrderTypeNV - { - eDefault = VK_COARSE_SAMPLE_ORDER_TYPE_DEFAULT_NV, - eCustom = VK_COARSE_SAMPLE_ORDER_TYPE_CUSTOM_NV, - ePixelMajor = VK_COARSE_SAMPLE_ORDER_TYPE_PIXEL_MAJOR_NV, - eSampleMajor = VK_COARSE_SAMPLE_ORDER_TYPE_SAMPLE_MAJOR_NV - }; - - //=== VK_NV_ray_tracing === - - enum class AccelerationStructureMemoryRequirementsTypeNV - { - eObject = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_NV, - eBuildScratch = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_BUILD_SCRATCH_NV, - eUpdateScratch = VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_UPDATE_SCRATCH_NV - }; - - //=== VK_AMD_pipeline_compiler_control === - - enum class PipelineCompilerControlFlagBitsAMD : VkPipelineCompilerControlFlagsAMD - { - }; - - //=== VK_EXT_calibrated_timestamps === - - enum class TimeDomainEXT - { - eDevice = VK_TIME_DOMAIN_DEVICE_EXT, - eClockMonotonic = VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT, - eClockMonotonicRaw = VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT, - eQueryPerformanceCounter = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT - }; - - //=== VK_KHR_global_priority === - - enum class QueueGlobalPriorityKHR - { - eLow = VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR, - eMedium = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR, - eHigh = VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR, - eRealtime = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR - }; - using QueueGlobalPriorityEXT = QueueGlobalPriorityKHR; - - //=== VK_AMD_memory_overallocation_behavior === - - enum class MemoryOverallocationBehaviorAMD - { - eDefault = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DEFAULT_AMD, - eAllowed = VK_MEMORY_OVERALLOCATION_BEHAVIOR_ALLOWED_AMD, - eDisallowed = VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD - }; - - //=== VK_INTEL_performance_query === - - enum class PerformanceConfigurationTypeINTEL - { - eCommandQueueMetricsDiscoveryActivated = VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL - }; - - enum class QueryPoolSamplingModeINTEL - { - eManual = VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL - }; - - enum class PerformanceOverrideTypeINTEL - { - eNullHardware = VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL, - eFlushGpuCaches = VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL - }; - - enum class PerformanceParameterTypeINTEL - { - eHwCountersSupported = VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL, - eStreamMarkerValidBits = VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL - }; - - enum class PerformanceValueTypeINTEL - { - eUint32 = VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL, - eUint64 = VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL, - eFloat = VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL, - eBool = VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL, - eString = VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - enum class ImagePipeSurfaceCreateFlagBitsFUCHSIA : VkImagePipeSurfaceCreateFlagsFUCHSIA - { - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - enum class MetalSurfaceCreateFlagBitsEXT : VkMetalSurfaceCreateFlagsEXT - { - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - - enum class FragmentShadingRateCombinerOpKHR - { - eKeep = VK_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR, - eReplace = VK_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR, - eMin = VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR, - eMax = VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR, - eMul = VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR - }; - - //=== VK_AMD_shader_core_properties2 === - - enum class ShaderCorePropertiesFlagBitsAMD : VkShaderCorePropertiesFlagsAMD - { - }; - - //=== VK_EXT_validation_features === - - enum class ValidationFeatureEnableEXT - { - eGpuAssisted = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT, - eGpuAssistedReserveBindingSlot = VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_RESERVE_BINDING_SLOT_EXT, - eBestPractices = VK_VALIDATION_FEATURE_ENABLE_BEST_PRACTICES_EXT, - eDebugPrintf = VK_VALIDATION_FEATURE_ENABLE_DEBUG_PRINTF_EXT, - eSynchronizationValidation = VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT - }; - - enum class ValidationFeatureDisableEXT - { - eAll = VK_VALIDATION_FEATURE_DISABLE_ALL_EXT, - eShaders = VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT, - eThreadSafety = VK_VALIDATION_FEATURE_DISABLE_THREAD_SAFETY_EXT, - eApiParameters = VK_VALIDATION_FEATURE_DISABLE_API_PARAMETERS_EXT, - eObjectLifetimes = VK_VALIDATION_FEATURE_DISABLE_OBJECT_LIFETIMES_EXT, - eCoreChecks = VK_VALIDATION_FEATURE_DISABLE_CORE_CHECKS_EXT, - eUniqueHandles = VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, - eShaderValidationCache = VK_VALIDATION_FEATURE_DISABLE_SHADER_VALIDATION_CACHE_EXT - }; - - //=== VK_NV_cooperative_matrix === - - enum class ScopeNV - { - eDevice = VK_SCOPE_DEVICE_NV, - eWorkgroup = VK_SCOPE_WORKGROUP_NV, - eSubgroup = VK_SCOPE_SUBGROUP_NV, - eQueueFamily = VK_SCOPE_QUEUE_FAMILY_NV - }; - - enum class ComponentTypeNV - { - eFloat16 = VK_COMPONENT_TYPE_FLOAT16_NV, - eFloat32 = VK_COMPONENT_TYPE_FLOAT32_NV, - eFloat64 = VK_COMPONENT_TYPE_FLOAT64_NV, - eSint8 = VK_COMPONENT_TYPE_SINT8_NV, - eSint16 = VK_COMPONENT_TYPE_SINT16_NV, - eSint32 = VK_COMPONENT_TYPE_SINT32_NV, - eSint64 = VK_COMPONENT_TYPE_SINT64_NV, - eUint8 = VK_COMPONENT_TYPE_UINT8_NV, - eUint16 = VK_COMPONENT_TYPE_UINT16_NV, - eUint32 = VK_COMPONENT_TYPE_UINT32_NV, - eUint64 = VK_COMPONENT_TYPE_UINT64_NV - }; - - //=== VK_NV_coverage_reduction_mode === - - enum class CoverageReductionModeNV - { - eMerge = VK_COVERAGE_REDUCTION_MODE_MERGE_NV, - eTruncate = VK_COVERAGE_REDUCTION_MODE_TRUNCATE_NV - }; - - enum class PipelineCoverageReductionStateCreateFlagBitsNV : VkPipelineCoverageReductionStateCreateFlagsNV - { - }; - - //=== VK_EXT_provoking_vertex === - - enum class ProvokingVertexModeEXT - { - eFirstVertex = VK_PROVOKING_VERTEX_MODE_FIRST_VERTEX_EXT, - eLastVertex = VK_PROVOKING_VERTEX_MODE_LAST_VERTEX_EXT - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - enum class FullScreenExclusiveEXT - { - eDefault = VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT, - eAllowed = VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT, - eDisallowed = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT, - eApplicationControlled = VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - - enum class HeadlessSurfaceCreateFlagBitsEXT : VkHeadlessSurfaceCreateFlagsEXT - { - }; - - //=== VK_EXT_line_rasterization === - - enum class LineRasterizationModeEXT - { - eDefault = VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT, - eRectangular = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_EXT, - eBresenham = VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT, - eRectangularSmooth = VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT - }; - - //=== VK_KHR_pipeline_executable_properties === - - enum class PipelineExecutableStatisticFormatKHR - { - eBool32 = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_BOOL32_KHR, - eInt64 = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_INT64_KHR, - eUint64 = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR, - eFloat64 = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_FLOAT64_KHR - }; - - //=== VK_NV_device_generated_commands === - - enum class IndirectStateFlagBitsNV : VkIndirectStateFlagsNV - { - eFlagFrontface = VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV - }; - - enum class IndirectCommandsTokenTypeNV - { - eShaderGroup = VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV, - eStateFlags = VK_INDIRECT_COMMANDS_TOKEN_TYPE_STATE_FLAGS_NV, - eIndexBuffer = VK_INDIRECT_COMMANDS_TOKEN_TYPE_INDEX_BUFFER_NV, - eVertexBuffer = VK_INDIRECT_COMMANDS_TOKEN_TYPE_VERTEX_BUFFER_NV, - ePushConstant = VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV, - eDrawIndexed = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV, - eDraw = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV, - eDrawTasks = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV, - eDrawMeshTasks = VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV - }; - - enum class IndirectCommandsLayoutUsageFlagBitsNV : VkIndirectCommandsLayoutUsageFlagsNV - { - eExplicitPreprocess = VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV, - eIndexedSequences = VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV, - eUnorderedSequences = VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV - }; - - //=== VK_EXT_device_memory_report === - - enum class DeviceMemoryReportEventTypeEXT - { - eAllocate = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATE_EXT, - eFree = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_FREE_EXT, - eImport = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_IMPORT_EXT, - eUnimport = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_UNIMPORT_EXT, - eAllocationFailed = VK_DEVICE_MEMORY_REPORT_EVENT_TYPE_ALLOCATION_FAILED_EXT - }; - - enum class DeviceMemoryReportFlagBitsEXT : VkDeviceMemoryReportFlagsEXT - { - }; - - //=== VK_EXT_pipeline_creation_cache_control === - - enum class PipelineCacheCreateFlagBits : VkPipelineCacheCreateFlags - { - eExternallySynchronized = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT, - eExternallySynchronizedEXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - enum class VideoEncodeCapabilityFlagBitsKHR : VkVideoEncodeCapabilityFlagsKHR - { - ePrecedingExternallyEncodedBytes = VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR - }; - - enum class VideoEncodeUsageFlagBitsKHR : VkVideoEncodeUsageFlagsKHR - { - eDefault = VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR, - eTranscoding = VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR, - eStreaming = VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR, - eRecording = VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR, - eConferencing = VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR - }; - - enum class VideoEncodeContentFlagBitsKHR : VkVideoEncodeContentFlagsKHR - { - eDefault = VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR, - eCamera = VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR, - eDesktop = VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR, - eRendered = VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR - }; - - enum class VideoEncodeTuningModeKHR - { - eDefault = VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR, - eHighQuality = VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR, - eLowLatency = VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR, - eUltraLowLatency = VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR, - eLossless = VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR - }; - - enum class VideoEncodeRateControlModeFlagBitsKHR : VkVideoEncodeRateControlModeFlagsKHR - { - eNone = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR, - eCbr = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR, - eVbr = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR - }; - - enum class VideoEncodeFlagBitsKHR : VkVideoEncodeFlagsKHR - { - }; - - enum class VideoEncodeRateControlFlagBitsKHR : VkVideoEncodeRateControlFlagsKHR - { - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - - enum class DeviceDiagnosticsConfigFlagBitsNV : VkDeviceDiagnosticsConfigFlagsNV - { - eEnableShaderDebugInfo = VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV, - eEnableResourceTracking = VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV, - eEnableAutomaticCheckpoints = VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV, - eEnableShaderErrorReporting = VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV - }; - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - enum class ExportMetalObjectTypeFlagBitsEXT : VkExportMetalObjectTypeFlagsEXT - { - eMetalDevice = VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT, - eMetalCommandQueue = VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT, - eMetalBuffer = VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT, - eMetalTexture = VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT, - eMetalIosurface = VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT, - eMetalSharedEvent = VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_graphics_pipeline_library === - - enum class GraphicsPipelineLibraryFlagBitsEXT : VkGraphicsPipelineLibraryFlagsEXT - { - eVertexInputInterface = VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT, - ePreRasterizationShaders = VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT, - eFragmentShader = VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT, - eFragmentOutputInterface = VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT - }; - - enum class PipelineLayoutCreateFlagBits : VkPipelineLayoutCreateFlags - { - eIndependentSetsEXT = VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT - }; - - //=== VK_NV_fragment_shading_rate_enums === - - enum class FragmentShadingRateNV - { - e1InvocationPerPixel = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV, - e1InvocationPer1X2Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV, - e1InvocationPer2X1Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV, - e1InvocationPer2X2Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV, - e1InvocationPer2X4Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV, - e1InvocationPer4X2Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV, - e1InvocationPer4X4Pixels = VK_FRAGMENT_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV, - e2InvocationsPerPixel = VK_FRAGMENT_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV, - e4InvocationsPerPixel = VK_FRAGMENT_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV, - e8InvocationsPerPixel = VK_FRAGMENT_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV, - e16InvocationsPerPixel = VK_FRAGMENT_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV, - eNoInvocations = VK_FRAGMENT_SHADING_RATE_NO_INVOCATIONS_NV - }; - - enum class FragmentShadingRateTypeNV - { - eFragmentSize = VK_FRAGMENT_SHADING_RATE_TYPE_FRAGMENT_SIZE_NV, - eEnums = VK_FRAGMENT_SHADING_RATE_TYPE_ENUMS_NV - }; - - //=== VK_NV_ray_tracing_motion_blur === - - enum class AccelerationStructureMotionInstanceTypeNV - { - eStatic = VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_STATIC_NV, - eMatrixMotion = VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_MATRIX_MOTION_NV, - eSrtMotion = VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV - }; - - enum class AccelerationStructureMotionInfoFlagBitsNV : VkAccelerationStructureMotionInfoFlagsNV - { - }; - - enum class AccelerationStructureMotionInstanceFlagBitsNV : VkAccelerationStructureMotionInstanceFlagsNV - { - }; - - //=== VK_EXT_image_compression_control === - - enum class ImageCompressionFlagBitsEXT : VkImageCompressionFlagsEXT - { - eDefault = VK_IMAGE_COMPRESSION_DEFAULT_EXT, - eFixedRateDefault = VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT, - eFixedRateExplicit = VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT, - eDisabled = VK_IMAGE_COMPRESSION_DISABLED_EXT - }; - - enum class ImageCompressionFixedRateFlagBitsEXT : VkImageCompressionFixedRateFlagsEXT - { - eNone = VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT, - e1Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_1BPC_BIT_EXT, - e2Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_2BPC_BIT_EXT, - e3Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_3BPC_BIT_EXT, - e4Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_4BPC_BIT_EXT, - e5Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_5BPC_BIT_EXT, - e6Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_6BPC_BIT_EXT, - e7Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_7BPC_BIT_EXT, - e8Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_8BPC_BIT_EXT, - e9Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_9BPC_BIT_EXT, - e10Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_10BPC_BIT_EXT, - e11Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_11BPC_BIT_EXT, - e12Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_12BPC_BIT_EXT, - e13Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_13BPC_BIT_EXT, - e14Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_14BPC_BIT_EXT, - e15Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_15BPC_BIT_EXT, - e16Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_16BPC_BIT_EXT, - e17Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_17BPC_BIT_EXT, - e18Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_18BPC_BIT_EXT, - e19Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_19BPC_BIT_EXT, - e20Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_20BPC_BIT_EXT, - e21Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_21BPC_BIT_EXT, - e22Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_22BPC_BIT_EXT, - e23Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT, - e24Bpc = VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT - }; - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - enum class DirectFBSurfaceCreateFlagBitsEXT : VkDirectFBSurfaceCreateFlagsEXT - { - }; -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - enum class RayTracingShaderGroupTypeKHR - { - eGeneral = VK_RAY_TRACING_SHADER_GROUP_TYPE_GENERAL_KHR, - eTrianglesHitGroup = VK_RAY_TRACING_SHADER_GROUP_TYPE_TRIANGLES_HIT_GROUP_KHR, - eProceduralHitGroup = VK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR - }; - using RayTracingShaderGroupTypeNV = RayTracingShaderGroupTypeKHR; - - enum class ShaderGroupShaderKHR - { - eGeneral = VK_SHADER_GROUP_SHADER_GENERAL_KHR, - eClosestHit = VK_SHADER_GROUP_SHADER_CLOSEST_HIT_KHR, - eAnyHit = VK_SHADER_GROUP_SHADER_ANY_HIT_KHR, - eIntersection = VK_SHADER_GROUP_SHADER_INTERSECTION_KHR - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - enum class ImageConstraintsInfoFlagBitsFUCHSIA : VkImageConstraintsInfoFlagsFUCHSIA - { - eCpuReadRarely = VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA, - eCpuReadOften = VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA, - eCpuWriteRarely = VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA, - eCpuWriteOften = VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA, - eProtectedOptional = VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA - }; - - enum class ImageFormatConstraintsFlagBitsFUCHSIA : VkImageFormatConstraintsFlagsFUCHSIA - { - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - enum class ScreenSurfaceCreateFlagBitsQNX : VkScreenSurfaceCreateFlagsQNX - { - }; -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_subpass_merge_feedback === - - enum class SubpassMergeStatusEXT - { - eMerged = VK_SUBPASS_MERGE_STATUS_MERGED_EXT, - eDisallowed = VK_SUBPASS_MERGE_STATUS_DISALLOWED_EXT, - eNotMergedSideEffects = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SIDE_EFFECTS_EXT, - eNotMergedSamplesMismatch = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SAMPLES_MISMATCH_EXT, - eNotMergedViewsMismatch = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_VIEWS_MISMATCH_EXT, - eNotMergedAliasing = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_ALIASING_EXT, - eNotMergedDependencies = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPENDENCIES_EXT, - eNotMergedIncompatibleInputAttachment = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INCOMPATIBLE_INPUT_ATTACHMENT_EXT, - eNotMergedTooManyAttachments = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_TOO_MANY_ATTACHMENTS_EXT, - eNotMergedInsufficientStorage = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INSUFFICIENT_STORAGE_EXT, - eNotMergedDepthStencilCount = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPTH_STENCIL_COUNT_EXT, - eNotMergedResolveAttachmentReuse = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_RESOLVE_ATTACHMENT_REUSE_EXT, - eNotMergedSingleSubpass = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SINGLE_SUBPASS_EXT, - eNotMergedUnspecified = VK_SUBPASS_MERGE_STATUS_NOT_MERGED_UNSPECIFIED_EXT - }; - - //=== VK_EXT_rasterization_order_attachment_access === - - enum class PipelineColorBlendStateCreateFlagBits : VkPipelineColorBlendStateCreateFlags - { - eRasterizationOrderAttachmentAccessEXT = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentAccessARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM - }; - - enum class PipelineDepthStencilStateCreateFlagBits : VkPipelineDepthStencilStateCreateFlags - { - eRasterizationOrderAttachmentDepthAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentStencilAccessEXT = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT, - eRasterizationOrderAttachmentDepthAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM, - eRasterizationOrderAttachmentStencilAccessARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM - }; - - template - struct IndexTypeValue - { - }; - - template <> - struct IndexTypeValue - { - static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint16; - }; - - template <> - struct CppType - { - using Type = uint16_t; - }; - - template <> - struct IndexTypeValue - { - static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint32; - }; - - template <> - struct CppType - { - using Type = uint32_t; - }; - - template <> - struct IndexTypeValue - { - static VULKAN_HPP_CONST_OR_CONSTEXPR IndexType value = IndexType::eUint8EXT; - }; - - template <> - struct CppType - { - using Type = uint8_t; - }; - - //================ - //=== BITMASKs === - //================ - - //=== VK_VERSION_1_0 === - - using FormatFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = - VkFlags( FormatFeatureFlagBits::eSampledImage ) | VkFlags( FormatFeatureFlagBits::eStorageImage ) | - VkFlags( FormatFeatureFlagBits::eStorageImageAtomic ) | VkFlags( FormatFeatureFlagBits::eUniformTexelBuffer ) | - VkFlags( FormatFeatureFlagBits::eStorageTexelBuffer ) | VkFlags( FormatFeatureFlagBits::eStorageTexelBufferAtomic ) | - VkFlags( FormatFeatureFlagBits::eVertexBuffer ) | VkFlags( FormatFeatureFlagBits::eColorAttachment ) | - VkFlags( FormatFeatureFlagBits::eColorAttachmentBlend ) | VkFlags( FormatFeatureFlagBits::eDepthStencilAttachment ) | - VkFlags( FormatFeatureFlagBits::eBlitSrc ) | VkFlags( FormatFeatureFlagBits::eBlitDst ) | VkFlags( FormatFeatureFlagBits::eSampledImageFilterLinear ) | - VkFlags( FormatFeatureFlagBits::eTransferSrc ) | VkFlags( FormatFeatureFlagBits::eTransferDst ) | - VkFlags( FormatFeatureFlagBits::eMidpointChromaSamples ) | VkFlags( FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilter ) | - VkFlags( FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilter ) | - VkFlags( FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicit ) | - VkFlags( FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable ) | VkFlags( FormatFeatureFlagBits::eDisjoint ) | - VkFlags( FormatFeatureFlagBits::eCositedChromaSamples ) | VkFlags( FormatFeatureFlagBits::eSampledImageFilterMinmax ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( FormatFeatureFlagBits::eVideoDecodeOutputKHR ) | VkFlags( FormatFeatureFlagBits::eVideoDecodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags( FormatFeatureFlagBits::eAccelerationStructureVertexBufferKHR ) | VkFlags( FormatFeatureFlagBits::eSampledImageFilterCubicEXT ) | - VkFlags( FormatFeatureFlagBits::eFragmentDensityMapEXT ) | VkFlags( FormatFeatureFlagBits::eFragmentShadingRateAttachmentKHR ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( FormatFeatureFlagBits::eVideoEncodeInputKHR ) | VkFlags( FormatFeatureFlagBits::eVideoEncodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags operator|( FormatFeatureFlagBits bit0, FormatFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags operator&( FormatFeatureFlagBits bit0, FormatFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags operator^( FormatFeatureFlagBits bit0, FormatFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags operator~( FormatFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( FormatFeatureFlags( bits ) ); - } - - using ImageCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageCreateFlagBits::eSparseBinding ) | VkFlags( ImageCreateFlagBits::eSparseResidency ) | - VkFlags( ImageCreateFlagBits::eSparseAliased ) | VkFlags( ImageCreateFlagBits::eMutableFormat ) | - VkFlags( ImageCreateFlagBits::eCubeCompatible ) | VkFlags( ImageCreateFlagBits::eAlias ) | - VkFlags( ImageCreateFlagBits::eSplitInstanceBindRegions ) | VkFlags( ImageCreateFlagBits::e2DArrayCompatible ) | - VkFlags( ImageCreateFlagBits::eBlockTexelViewCompatible ) | VkFlags( ImageCreateFlagBits::eExtendedUsage ) | - VkFlags( ImageCreateFlagBits::eProtected ) | VkFlags( ImageCreateFlagBits::eDisjoint ) | VkFlags( ImageCreateFlagBits::eCornerSampledNV ) | - VkFlags( ImageCreateFlagBits::eSampleLocationsCompatibleDepthEXT ) | VkFlags( ImageCreateFlagBits::eSubsampledEXT ) | - VkFlags( ImageCreateFlagBits::eMultisampledRenderToSingleSampledEXT ) | VkFlags( ImageCreateFlagBits::e2DViewCompatibleEXT ) | - VkFlags( ImageCreateFlagBits::eFragmentDensityMapOffsetQCOM ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCreateFlags operator|( ImageCreateFlagBits bit0, ImageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCreateFlags operator&( ImageCreateFlagBits bit0, ImageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCreateFlags operator^( ImageCreateFlagBits bit0, ImageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCreateFlags operator~( ImageCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageCreateFlags( bits ) ); - } - - using ImageUsageFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageUsageFlagBits::eTransferSrc ) | VkFlags( ImageUsageFlagBits::eTransferDst ) | VkFlags( ImageUsageFlagBits::eSampled ) | - VkFlags( ImageUsageFlagBits::eStorage ) | VkFlags( ImageUsageFlagBits::eColorAttachment ) | - VkFlags( ImageUsageFlagBits::eDepthStencilAttachment ) | VkFlags( ImageUsageFlagBits::eTransientAttachment ) | - VkFlags( ImageUsageFlagBits::eInputAttachment ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( ImageUsageFlagBits::eVideoDecodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoDecodeSrcKHR ) | - VkFlags( ImageUsageFlagBits::eVideoDecodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags( ImageUsageFlagBits::eFragmentDensityMapEXT ) | VkFlags( ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( ImageUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( ImageUsageFlagBits::eVideoEncodeSrcKHR ) | - VkFlags( ImageUsageFlagBits::eVideoEncodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags( ImageUsageFlagBits::eAttachmentFeedbackLoopEXT ) | VkFlags( ImageUsageFlagBits::eInvocationMaskHUAWEI ) | - VkFlags( ImageUsageFlagBits::eSampleWeightQCOM ) | VkFlags( ImageUsageFlagBits::eSampleBlockMatchQCOM ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageUsageFlags operator|( ImageUsageFlagBits bit0, ImageUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageUsageFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageUsageFlags operator&( ImageUsageFlagBits bit0, ImageUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageUsageFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageUsageFlags operator^( ImageUsageFlagBits bit0, ImageUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageUsageFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageUsageFlags operator~( ImageUsageFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageUsageFlags( bits ) ); - } - - using InstanceCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( InstanceCreateFlagBits::eEnumeratePortabilityKHR ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR InstanceCreateFlags operator|( InstanceCreateFlagBits bit0, InstanceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return InstanceCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR InstanceCreateFlags operator&( InstanceCreateFlagBits bit0, InstanceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return InstanceCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR InstanceCreateFlags operator^( InstanceCreateFlagBits bit0, InstanceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return InstanceCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR InstanceCreateFlags operator~( InstanceCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( InstanceCreateFlags( bits ) ); - } - - using MemoryHeapFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( MemoryHeapFlagBits::eDeviceLocal ) | VkFlags( MemoryHeapFlagBits::eMultiInstance ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryHeapFlags operator|( MemoryHeapFlagBits bit0, MemoryHeapFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryHeapFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryHeapFlags operator&( MemoryHeapFlagBits bit0, MemoryHeapFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryHeapFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryHeapFlags operator^( MemoryHeapFlagBits bit0, MemoryHeapFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryHeapFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryHeapFlags operator~( MemoryHeapFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( MemoryHeapFlags( bits ) ); - } - - using MemoryPropertyFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( MemoryPropertyFlagBits::eDeviceLocal ) | VkFlags( MemoryPropertyFlagBits::eHostVisible ) | - VkFlags( MemoryPropertyFlagBits::eHostCoherent ) | VkFlags( MemoryPropertyFlagBits::eHostCached ) | - VkFlags( MemoryPropertyFlagBits::eLazilyAllocated ) | VkFlags( MemoryPropertyFlagBits::eProtected ) | - VkFlags( MemoryPropertyFlagBits::eDeviceCoherentAMD ) | VkFlags( MemoryPropertyFlagBits::eDeviceUncachedAMD ) | - VkFlags( MemoryPropertyFlagBits::eRdmaCapableNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryPropertyFlags operator|( MemoryPropertyFlagBits bit0, MemoryPropertyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryPropertyFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryPropertyFlags operator&( MemoryPropertyFlagBits bit0, MemoryPropertyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryPropertyFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryPropertyFlags operator^( MemoryPropertyFlagBits bit0, MemoryPropertyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryPropertyFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryPropertyFlags operator~( MemoryPropertyFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( MemoryPropertyFlags( bits ) ); - } - - using QueueFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( QueueFlagBits::eGraphics ) | VkFlags( QueueFlagBits::eCompute ) | VkFlags( QueueFlagBits::eTransfer ) | - VkFlags( QueueFlagBits::eSparseBinding ) | VkFlags( QueueFlagBits::eProtected ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( QueueFlagBits::eVideoDecodeKHR ) | VkFlags( QueueFlagBits::eVideoEncodeKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueueFlags operator|( QueueFlagBits bit0, QueueFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueueFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueueFlags operator&( QueueFlagBits bit0, QueueFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueueFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueueFlags operator^( QueueFlagBits bit0, QueueFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueueFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueueFlags operator~( QueueFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( QueueFlags( bits ) ); - } - - using SampleCountFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SampleCountFlagBits::e1 ) | VkFlags( SampleCountFlagBits::e2 ) | VkFlags( SampleCountFlagBits::e4 ) | - VkFlags( SampleCountFlagBits::e8 ) | VkFlags( SampleCountFlagBits::e16 ) | VkFlags( SampleCountFlagBits::e32 ) | - VkFlags( SampleCountFlagBits::e64 ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SampleCountFlags operator|( SampleCountFlagBits bit0, SampleCountFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SampleCountFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SampleCountFlags operator&( SampleCountFlagBits bit0, SampleCountFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SampleCountFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SampleCountFlags operator^( SampleCountFlagBits bit0, SampleCountFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SampleCountFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SampleCountFlags operator~( SampleCountFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SampleCountFlags( bits ) ); - } - - using DeviceCreateFlags = Flags; - - using DeviceQueueCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DeviceQueueCreateFlagBits::eProtected ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceQueueCreateFlags operator|( DeviceQueueCreateFlagBits bit0, DeviceQueueCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceQueueCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceQueueCreateFlags operator&( DeviceQueueCreateFlagBits bit0, DeviceQueueCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceQueueCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceQueueCreateFlags operator^( DeviceQueueCreateFlagBits bit0, DeviceQueueCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceQueueCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceQueueCreateFlags operator~( DeviceQueueCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DeviceQueueCreateFlags( bits ) ); - } - - using PipelineStageFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineStageFlagBits::eTopOfPipe ) | VkFlags( PipelineStageFlagBits::eDrawIndirect ) | - VkFlags( PipelineStageFlagBits::eVertexInput ) | VkFlags( PipelineStageFlagBits::eVertexShader ) | - VkFlags( PipelineStageFlagBits::eTessellationControlShader ) | VkFlags( PipelineStageFlagBits::eTessellationEvaluationShader ) | - VkFlags( PipelineStageFlagBits::eGeometryShader ) | VkFlags( PipelineStageFlagBits::eFragmentShader ) | - VkFlags( PipelineStageFlagBits::eEarlyFragmentTests ) | VkFlags( PipelineStageFlagBits::eLateFragmentTests ) | - VkFlags( PipelineStageFlagBits::eColorAttachmentOutput ) | VkFlags( PipelineStageFlagBits::eComputeShader ) | - VkFlags( PipelineStageFlagBits::eTransfer ) | VkFlags( PipelineStageFlagBits::eBottomOfPipe ) | VkFlags( PipelineStageFlagBits::eHost ) | - VkFlags( PipelineStageFlagBits::eAllGraphics ) | VkFlags( PipelineStageFlagBits::eAllCommands ) | VkFlags( PipelineStageFlagBits::eNone ) | - VkFlags( PipelineStageFlagBits::eTransformFeedbackEXT ) | VkFlags( PipelineStageFlagBits::eConditionalRenderingEXT ) | - VkFlags( PipelineStageFlagBits::eAccelerationStructureBuildKHR ) | VkFlags( PipelineStageFlagBits::eRayTracingShaderKHR ) | - VkFlags( PipelineStageFlagBits::eFragmentDensityProcessEXT ) | VkFlags( PipelineStageFlagBits::eFragmentShadingRateAttachmentKHR ) | - VkFlags( PipelineStageFlagBits::eCommandPreprocessNV ) | VkFlags( PipelineStageFlagBits::eTaskShaderEXT ) | - VkFlags( PipelineStageFlagBits::eMeshShaderEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags operator|( PipelineStageFlagBits bit0, PipelineStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags operator&( PipelineStageFlagBits bit0, PipelineStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags operator^( PipelineStageFlagBits bit0, PipelineStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags operator~( PipelineStageFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineStageFlags( bits ) ); - } - - using MemoryMapFlags = Flags; - - using ImageAspectFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageAspectFlagBits::eColor ) | VkFlags( ImageAspectFlagBits::eDepth ) | VkFlags( ImageAspectFlagBits::eStencil ) | - VkFlags( ImageAspectFlagBits::eMetadata ) | VkFlags( ImageAspectFlagBits::ePlane0 ) | VkFlags( ImageAspectFlagBits::ePlane1 ) | - VkFlags( ImageAspectFlagBits::ePlane2 ) | VkFlags( ImageAspectFlagBits::eNone ) | VkFlags( ImageAspectFlagBits::eMemoryPlane0EXT ) | - VkFlags( ImageAspectFlagBits::eMemoryPlane1EXT ) | VkFlags( ImageAspectFlagBits::eMemoryPlane2EXT ) | - VkFlags( ImageAspectFlagBits::eMemoryPlane3EXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageAspectFlags operator|( ImageAspectFlagBits bit0, ImageAspectFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageAspectFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageAspectFlags operator&( ImageAspectFlagBits bit0, ImageAspectFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageAspectFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageAspectFlags operator^( ImageAspectFlagBits bit0, ImageAspectFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageAspectFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageAspectFlags operator~( ImageAspectFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageAspectFlags( bits ) ); - } - - using SparseImageFormatFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SparseImageFormatFlagBits::eSingleMiptail ) | VkFlags( SparseImageFormatFlagBits::eAlignedMipSize ) | - VkFlags( SparseImageFormatFlagBits::eNonstandardBlockSize ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseImageFormatFlags operator|( SparseImageFormatFlagBits bit0, SparseImageFormatFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseImageFormatFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseImageFormatFlags operator&( SparseImageFormatFlagBits bit0, SparseImageFormatFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseImageFormatFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseImageFormatFlags operator^( SparseImageFormatFlagBits bit0, SparseImageFormatFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseImageFormatFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseImageFormatFlags operator~( SparseImageFormatFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SparseImageFormatFlags( bits ) ); - } - - using SparseMemoryBindFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SparseMemoryBindFlagBits::eMetadata ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseMemoryBindFlags operator|( SparseMemoryBindFlagBits bit0, SparseMemoryBindFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseMemoryBindFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseMemoryBindFlags operator&( SparseMemoryBindFlagBits bit0, SparseMemoryBindFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseMemoryBindFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseMemoryBindFlags operator^( SparseMemoryBindFlagBits bit0, SparseMemoryBindFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SparseMemoryBindFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SparseMemoryBindFlags operator~( SparseMemoryBindFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SparseMemoryBindFlags( bits ) ); - } - - using FenceCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( FenceCreateFlagBits::eSignaled ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceCreateFlags operator|( FenceCreateFlagBits bit0, FenceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceCreateFlags operator&( FenceCreateFlagBits bit0, FenceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceCreateFlags operator^( FenceCreateFlagBits bit0, FenceCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceCreateFlags operator~( FenceCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( FenceCreateFlags( bits ) ); - } - - using SemaphoreCreateFlags = Flags; - - using EventCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( EventCreateFlagBits::eDeviceOnly ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR EventCreateFlags operator|( EventCreateFlagBits bit0, EventCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return EventCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR EventCreateFlags operator&( EventCreateFlagBits bit0, EventCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return EventCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR EventCreateFlags operator^( EventCreateFlagBits bit0, EventCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return EventCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR EventCreateFlags operator~( EventCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( EventCreateFlags( bits ) ); - } - - using QueryPipelineStatisticFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( QueryPipelineStatisticFlagBits::eInputAssemblyVertices ) | VkFlags( QueryPipelineStatisticFlagBits::eInputAssemblyPrimitives ) | - VkFlags( QueryPipelineStatisticFlagBits::eVertexShaderInvocations ) | VkFlags( QueryPipelineStatisticFlagBits::eGeometryShaderInvocations ) | - VkFlags( QueryPipelineStatisticFlagBits::eGeometryShaderPrimitives ) | VkFlags( QueryPipelineStatisticFlagBits::eClippingInvocations ) | - VkFlags( QueryPipelineStatisticFlagBits::eClippingPrimitives ) | VkFlags( QueryPipelineStatisticFlagBits::eFragmentShaderInvocations ) | - VkFlags( QueryPipelineStatisticFlagBits::eTessellationControlShaderPatches ) | - VkFlags( QueryPipelineStatisticFlagBits::eTessellationEvaluationShaderInvocations ) | - VkFlags( QueryPipelineStatisticFlagBits::eComputeShaderInvocations ) | VkFlags( QueryPipelineStatisticFlagBits::eTaskShaderInvocationsEXT ) | - VkFlags( QueryPipelineStatisticFlagBits::eMeshShaderInvocationsEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryPipelineStatisticFlags operator|( QueryPipelineStatisticFlagBits bit0, - QueryPipelineStatisticFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryPipelineStatisticFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryPipelineStatisticFlags operator&( QueryPipelineStatisticFlagBits bit0, - QueryPipelineStatisticFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryPipelineStatisticFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryPipelineStatisticFlags operator^( QueryPipelineStatisticFlagBits bit0, - QueryPipelineStatisticFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryPipelineStatisticFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryPipelineStatisticFlags operator~( QueryPipelineStatisticFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( QueryPipelineStatisticFlags( bits ) ); - } - - using QueryPoolCreateFlags = Flags; - - using QueryResultFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( QueryResultFlagBits::e64 ) | VkFlags( QueryResultFlagBits::eWait ) | VkFlags( QueryResultFlagBits::eWithAvailability ) | - VkFlags( QueryResultFlagBits::ePartial ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( QueryResultFlagBits::eWithStatusKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryResultFlags operator|( QueryResultFlagBits bit0, QueryResultFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryResultFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryResultFlags operator&( QueryResultFlagBits bit0, QueryResultFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryResultFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryResultFlags operator^( QueryResultFlagBits bit0, QueryResultFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryResultFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryResultFlags operator~( QueryResultFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( QueryResultFlags( bits ) ); - } - - using BufferCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( BufferCreateFlagBits::eSparseBinding ) | VkFlags( BufferCreateFlagBits::eSparseResidency ) | - VkFlags( BufferCreateFlagBits::eSparseAliased ) | VkFlags( BufferCreateFlagBits::eProtected ) | - VkFlags( BufferCreateFlagBits::eDeviceAddressCaptureReplay ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferCreateFlags operator|( BufferCreateFlagBits bit0, BufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferCreateFlags operator&( BufferCreateFlagBits bit0, BufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferCreateFlags operator^( BufferCreateFlagBits bit0, BufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferCreateFlags operator~( BufferCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( BufferCreateFlags( bits ) ); - } - - using BufferUsageFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( BufferUsageFlagBits::eTransferSrc ) | VkFlags( BufferUsageFlagBits::eTransferDst ) | - VkFlags( BufferUsageFlagBits::eUniformTexelBuffer ) | VkFlags( BufferUsageFlagBits::eStorageTexelBuffer ) | - VkFlags( BufferUsageFlagBits::eUniformBuffer ) | VkFlags( BufferUsageFlagBits::eStorageBuffer ) | - VkFlags( BufferUsageFlagBits::eIndexBuffer ) | VkFlags( BufferUsageFlagBits::eVertexBuffer ) | - VkFlags( BufferUsageFlagBits::eIndirectBuffer ) | VkFlags( BufferUsageFlagBits::eShaderDeviceAddress ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( BufferUsageFlagBits::eVideoDecodeSrcKHR ) | VkFlags( BufferUsageFlagBits::eVideoDecodeDstKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags( BufferUsageFlagBits::eTransformFeedbackBufferEXT ) | VkFlags( BufferUsageFlagBits::eTransformFeedbackCounterBufferEXT ) | - VkFlags( BufferUsageFlagBits::eConditionalRenderingEXT ) | VkFlags( BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR ) | - VkFlags( BufferUsageFlagBits::eAccelerationStructureStorageKHR ) | VkFlags( BufferUsageFlagBits::eShaderBindingTableKHR ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( BufferUsageFlagBits::eVideoEncodeDstKHR ) | VkFlags( BufferUsageFlagBits::eVideoEncodeSrcKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferUsageFlags operator|( BufferUsageFlagBits bit0, BufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferUsageFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferUsageFlags operator&( BufferUsageFlagBits bit0, BufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferUsageFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferUsageFlags operator^( BufferUsageFlagBits bit0, BufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return BufferUsageFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BufferUsageFlags operator~( BufferUsageFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( BufferUsageFlags( bits ) ); - } - - using BufferViewCreateFlags = Flags; - - using ImageViewCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageViewCreateFlagBits::eFragmentDensityMapDynamicEXT ) | VkFlags( ImageViewCreateFlagBits::eFragmentDensityMapDeferredEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageViewCreateFlags operator|( ImageViewCreateFlagBits bit0, ImageViewCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageViewCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageViewCreateFlags operator&( ImageViewCreateFlagBits bit0, ImageViewCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageViewCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageViewCreateFlags operator^( ImageViewCreateFlagBits bit0, ImageViewCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageViewCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageViewCreateFlags operator~( ImageViewCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageViewCreateFlags( bits ) ); - } - - using ShaderModuleCreateFlags = Flags; - - using PipelineCacheCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineCacheCreateFlagBits::eExternallySynchronized ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCacheCreateFlags operator|( PipelineCacheCreateFlagBits bit0, - PipelineCacheCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCacheCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCacheCreateFlags operator&( PipelineCacheCreateFlagBits bit0, - PipelineCacheCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCacheCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCacheCreateFlags operator^( PipelineCacheCreateFlagBits bit0, - PipelineCacheCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCacheCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCacheCreateFlags operator~( PipelineCacheCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineCacheCreateFlags( bits ) ); - } - - using ColorComponentFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ColorComponentFlagBits::eR ) | VkFlags( ColorComponentFlagBits::eG ) | VkFlags( ColorComponentFlagBits::eB ) | - VkFlags( ColorComponentFlagBits::eA ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ColorComponentFlags operator|( ColorComponentFlagBits bit0, ColorComponentFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ColorComponentFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ColorComponentFlags operator&( ColorComponentFlagBits bit0, ColorComponentFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ColorComponentFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ColorComponentFlags operator^( ColorComponentFlagBits bit0, ColorComponentFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ColorComponentFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ColorComponentFlags operator~( ColorComponentFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ColorComponentFlags( bits ) ); - } - - using CullModeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CullModeFlagBits::eNone ) | VkFlags( CullModeFlagBits::eFront ) | VkFlags( CullModeFlagBits::eBack ) | - VkFlags( CullModeFlagBits::eFrontAndBack ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CullModeFlags operator|( CullModeFlagBits bit0, CullModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CullModeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CullModeFlags operator&( CullModeFlagBits bit0, CullModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CullModeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CullModeFlags operator^( CullModeFlagBits bit0, CullModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CullModeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CullModeFlags operator~( CullModeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CullModeFlags( bits ) ); - } - - using PipelineColorBlendStateCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineColorBlendStateCreateFlags operator|( PipelineColorBlendStateCreateFlagBits bit0, - PipelineColorBlendStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineColorBlendStateCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineColorBlendStateCreateFlags operator&( PipelineColorBlendStateCreateFlagBits bit0, - PipelineColorBlendStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineColorBlendStateCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineColorBlendStateCreateFlags operator^( PipelineColorBlendStateCreateFlagBits bit0, - PipelineColorBlendStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineColorBlendStateCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineColorBlendStateCreateFlags operator~( PipelineColorBlendStateCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineColorBlendStateCreateFlags( bits ) ); - } - - using PipelineCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineCreateFlagBits::eDisableOptimization ) | VkFlags( PipelineCreateFlagBits::eAllowDerivatives ) | - VkFlags( PipelineCreateFlagBits::eDerivative ) | VkFlags( PipelineCreateFlagBits::eViewIndexFromDeviceIndex ) | - VkFlags( PipelineCreateFlagBits::eDispatchBase ) | VkFlags( PipelineCreateFlagBits::eFailOnPipelineCompileRequired ) | - VkFlags( PipelineCreateFlagBits::eEarlyReturnOnFailure ) | VkFlags( PipelineCreateFlagBits::eRenderingFragmentShadingRateAttachmentKHR ) | - VkFlags( PipelineCreateFlagBits::eRenderingFragmentDensityMapAttachmentEXT ) | - VkFlags( PipelineCreateFlagBits::eRayTracingNoNullAnyHitShadersKHR ) | - VkFlags( PipelineCreateFlagBits::eRayTracingNoNullClosestHitShadersKHR ) | VkFlags( PipelineCreateFlagBits::eRayTracingNoNullMissShadersKHR ) | - VkFlags( PipelineCreateFlagBits::eRayTracingNoNullIntersectionShadersKHR ) | VkFlags( PipelineCreateFlagBits::eRayTracingSkipTrianglesKHR ) | - VkFlags( PipelineCreateFlagBits::eRayTracingSkipAabbsKHR ) | VkFlags( PipelineCreateFlagBits::eRayTracingShaderGroupHandleCaptureReplayKHR ) | - VkFlags( PipelineCreateFlagBits::eDeferCompileNV ) | VkFlags( PipelineCreateFlagBits::eCaptureStatisticsKHR ) | - VkFlags( PipelineCreateFlagBits::eCaptureInternalRepresentationsKHR ) | VkFlags( PipelineCreateFlagBits::eIndirectBindableNV ) | - VkFlags( PipelineCreateFlagBits::eLibraryKHR ) | VkFlags( PipelineCreateFlagBits::eRetainLinkTimeOptimizationInfoEXT ) | - VkFlags( PipelineCreateFlagBits::eLinkTimeOptimizationEXT ) | VkFlags( PipelineCreateFlagBits::eRayTracingAllowMotionNV ) | - VkFlags( PipelineCreateFlagBits::eColorAttachmentFeedbackLoopEXT ) | VkFlags( PipelineCreateFlagBits::eDepthStencilAttachmentFeedbackLoopEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreateFlags operator|( PipelineCreateFlagBits bit0, PipelineCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreateFlags operator&( PipelineCreateFlagBits bit0, PipelineCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreateFlags operator^( PipelineCreateFlagBits bit0, PipelineCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreateFlags operator~( PipelineCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineCreateFlags( bits ) ); - } - - using PipelineDepthStencilStateCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT ) | - VkFlags( PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateFlags operator|( PipelineDepthStencilStateCreateFlagBits bit0, - PipelineDepthStencilStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineDepthStencilStateCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateFlags operator&( PipelineDepthStencilStateCreateFlagBits bit0, - PipelineDepthStencilStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineDepthStencilStateCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateFlags operator^( PipelineDepthStencilStateCreateFlagBits bit0, - PipelineDepthStencilStateCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineDepthStencilStateCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateFlags operator~( PipelineDepthStencilStateCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineDepthStencilStateCreateFlags( bits ) ); - } - - using PipelineDynamicStateCreateFlags = Flags; - - using PipelineInputAssemblyStateCreateFlags = Flags; - - using PipelineLayoutCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineLayoutCreateFlagBits::eIndependentSetsEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineLayoutCreateFlags operator|( PipelineLayoutCreateFlagBits bit0, - PipelineLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineLayoutCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineLayoutCreateFlags operator&( PipelineLayoutCreateFlagBits bit0, - PipelineLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineLayoutCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineLayoutCreateFlags operator^( PipelineLayoutCreateFlagBits bit0, - PipelineLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineLayoutCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineLayoutCreateFlags operator~( PipelineLayoutCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineLayoutCreateFlags( bits ) ); - } - - using PipelineMultisampleStateCreateFlags = Flags; - - using PipelineRasterizationStateCreateFlags = Flags; - - using PipelineShaderStageCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineShaderStageCreateFlagBits::eAllowVaryingSubgroupSize ) | VkFlags( PipelineShaderStageCreateFlagBits::eRequireFullSubgroups ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateFlags operator|( PipelineShaderStageCreateFlagBits bit0, - PipelineShaderStageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineShaderStageCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateFlags operator&( PipelineShaderStageCreateFlagBits bit0, - PipelineShaderStageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineShaderStageCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateFlags operator^( PipelineShaderStageCreateFlagBits bit0, - PipelineShaderStageCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineShaderStageCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateFlags operator~( PipelineShaderStageCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineShaderStageCreateFlags( bits ) ); - } - - using PipelineTessellationStateCreateFlags = Flags; - - using PipelineVertexInputStateCreateFlags = Flags; - - using PipelineViewportStateCreateFlags = Flags; - - using ShaderStageFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ShaderStageFlagBits::eVertex ) | VkFlags( ShaderStageFlagBits::eTessellationControl ) | - VkFlags( ShaderStageFlagBits::eTessellationEvaluation ) | VkFlags( ShaderStageFlagBits::eGeometry ) | - VkFlags( ShaderStageFlagBits::eFragment ) | VkFlags( ShaderStageFlagBits::eCompute ) | VkFlags( ShaderStageFlagBits::eAllGraphics ) | - VkFlags( ShaderStageFlagBits::eAll ) | VkFlags( ShaderStageFlagBits::eRaygenKHR ) | VkFlags( ShaderStageFlagBits::eAnyHitKHR ) | - VkFlags( ShaderStageFlagBits::eClosestHitKHR ) | VkFlags( ShaderStageFlagBits::eMissKHR ) | VkFlags( ShaderStageFlagBits::eIntersectionKHR ) | - VkFlags( ShaderStageFlagBits::eCallableKHR ) | VkFlags( ShaderStageFlagBits::eTaskEXT ) | VkFlags( ShaderStageFlagBits::eMeshEXT ) | - VkFlags( ShaderStageFlagBits::eSubpassShadingHUAWEI ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ShaderStageFlags operator|( ShaderStageFlagBits bit0, ShaderStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ShaderStageFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ShaderStageFlags operator&( ShaderStageFlagBits bit0, ShaderStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ShaderStageFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ShaderStageFlags operator^( ShaderStageFlagBits bit0, ShaderStageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ShaderStageFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ShaderStageFlags operator~( ShaderStageFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ShaderStageFlags( bits ) ); - } - - using SamplerCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SamplerCreateFlagBits::eSubsampledEXT ) | VkFlags( SamplerCreateFlagBits::eSubsampledCoarseReconstructionEXT ) | - VkFlags( SamplerCreateFlagBits::eNonSeamlessCubeMapEXT ) | VkFlags( SamplerCreateFlagBits::eImageProcessingQCOM ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SamplerCreateFlags operator|( SamplerCreateFlagBits bit0, SamplerCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SamplerCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SamplerCreateFlags operator&( SamplerCreateFlagBits bit0, SamplerCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SamplerCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SamplerCreateFlags operator^( SamplerCreateFlagBits bit0, SamplerCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SamplerCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SamplerCreateFlags operator~( SamplerCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SamplerCreateFlags( bits ) ); - } - - using DescriptorPoolCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DescriptorPoolCreateFlagBits::eFreeDescriptorSet ) | VkFlags( DescriptorPoolCreateFlagBits::eUpdateAfterBind ) | - VkFlags( DescriptorPoolCreateFlagBits::eHostOnlyVALVE ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorPoolCreateFlags operator|( DescriptorPoolCreateFlagBits bit0, - DescriptorPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorPoolCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorPoolCreateFlags operator&( DescriptorPoolCreateFlagBits bit0, - DescriptorPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorPoolCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorPoolCreateFlags operator^( DescriptorPoolCreateFlagBits bit0, - DescriptorPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorPoolCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorPoolCreateFlags operator~( DescriptorPoolCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DescriptorPoolCreateFlags( bits ) ); - } - - using DescriptorPoolResetFlags = Flags; - - using DescriptorSetLayoutCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPool ) | VkFlags( DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR ) | - VkFlags( DescriptorSetLayoutCreateFlagBits::eHostOnlyPoolVALVE ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateFlags operator|( DescriptorSetLayoutCreateFlagBits bit0, - DescriptorSetLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorSetLayoutCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateFlags operator&( DescriptorSetLayoutCreateFlagBits bit0, - DescriptorSetLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorSetLayoutCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateFlags operator^( DescriptorSetLayoutCreateFlagBits bit0, - DescriptorSetLayoutCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorSetLayoutCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateFlags operator~( DescriptorSetLayoutCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DescriptorSetLayoutCreateFlags( bits ) ); - } - - using AccessFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( AccessFlagBits::eIndirectCommandRead ) | VkFlags( AccessFlagBits::eIndexRead ) | VkFlags( AccessFlagBits::eVertexAttributeRead ) | - VkFlags( AccessFlagBits::eUniformRead ) | VkFlags( AccessFlagBits::eInputAttachmentRead ) | VkFlags( AccessFlagBits::eShaderRead ) | - VkFlags( AccessFlagBits::eShaderWrite ) | VkFlags( AccessFlagBits::eColorAttachmentRead ) | VkFlags( AccessFlagBits::eColorAttachmentWrite ) | - VkFlags( AccessFlagBits::eDepthStencilAttachmentRead ) | VkFlags( AccessFlagBits::eDepthStencilAttachmentWrite ) | - VkFlags( AccessFlagBits::eTransferRead ) | VkFlags( AccessFlagBits::eTransferWrite ) | VkFlags( AccessFlagBits::eHostRead ) | - VkFlags( AccessFlagBits::eHostWrite ) | VkFlags( AccessFlagBits::eMemoryRead ) | VkFlags( AccessFlagBits::eMemoryWrite ) | - VkFlags( AccessFlagBits::eNone ) | VkFlags( AccessFlagBits::eTransformFeedbackWriteEXT ) | - VkFlags( AccessFlagBits::eTransformFeedbackCounterReadEXT ) | VkFlags( AccessFlagBits::eTransformFeedbackCounterWriteEXT ) | - VkFlags( AccessFlagBits::eConditionalRenderingReadEXT ) | VkFlags( AccessFlagBits::eColorAttachmentReadNoncoherentEXT ) | - VkFlags( AccessFlagBits::eAccelerationStructureReadKHR ) | VkFlags( AccessFlagBits::eAccelerationStructureWriteKHR ) | - VkFlags( AccessFlagBits::eFragmentDensityMapReadEXT ) | VkFlags( AccessFlagBits::eFragmentShadingRateAttachmentReadKHR ) | - VkFlags( AccessFlagBits::eCommandPreprocessReadNV ) | VkFlags( AccessFlagBits::eCommandPreprocessWriteNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags operator|( AccessFlagBits bit0, AccessFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags operator&( AccessFlagBits bit0, AccessFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags operator^( AccessFlagBits bit0, AccessFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags operator~( AccessFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( AccessFlags( bits ) ); - } - - using AttachmentDescriptionFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( AttachmentDescriptionFlagBits::eMayAlias ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AttachmentDescriptionFlags operator|( AttachmentDescriptionFlagBits bit0, - AttachmentDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AttachmentDescriptionFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AttachmentDescriptionFlags operator&( AttachmentDescriptionFlagBits bit0, - AttachmentDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AttachmentDescriptionFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AttachmentDescriptionFlags operator^( AttachmentDescriptionFlagBits bit0, - AttachmentDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return AttachmentDescriptionFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AttachmentDescriptionFlags operator~( AttachmentDescriptionFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( AttachmentDescriptionFlags( bits ) ); - } - - using DependencyFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DependencyFlagBits::eByRegion ) | VkFlags( DependencyFlagBits::eDeviceGroup ) | VkFlags( DependencyFlagBits::eViewLocal ) | - VkFlags( DependencyFlagBits::eFeedbackLoopEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DependencyFlags operator|( DependencyFlagBits bit0, DependencyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DependencyFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DependencyFlags operator&( DependencyFlagBits bit0, DependencyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DependencyFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DependencyFlags operator^( DependencyFlagBits bit0, DependencyFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DependencyFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DependencyFlags operator~( DependencyFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DependencyFlags( bits ) ); - } - - using FramebufferCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( FramebufferCreateFlagBits::eImageless ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FramebufferCreateFlags operator|( FramebufferCreateFlagBits bit0, FramebufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FramebufferCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FramebufferCreateFlags operator&( FramebufferCreateFlagBits bit0, FramebufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FramebufferCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FramebufferCreateFlags operator^( FramebufferCreateFlagBits bit0, FramebufferCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FramebufferCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FramebufferCreateFlags operator~( FramebufferCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( FramebufferCreateFlags( bits ) ); - } - - using RenderPassCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( RenderPassCreateFlagBits::eTransformQCOM ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderPassCreateFlags operator|( RenderPassCreateFlagBits bit0, RenderPassCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderPassCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderPassCreateFlags operator&( RenderPassCreateFlagBits bit0, RenderPassCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderPassCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderPassCreateFlags operator^( RenderPassCreateFlagBits bit0, RenderPassCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderPassCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderPassCreateFlags operator~( RenderPassCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( RenderPassCreateFlags( bits ) ); - } - - using SubpassDescriptionFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SubpassDescriptionFlagBits::ePerViewAttributesNVX ) | VkFlags( SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX ) | - VkFlags( SubpassDescriptionFlagBits::eFragmentRegionQCOM ) | VkFlags( SubpassDescriptionFlagBits::eShaderResolveQCOM ) | - VkFlags( SubpassDescriptionFlagBits::eRasterizationOrderAttachmentColorAccessEXT ) | - VkFlags( SubpassDescriptionFlagBits::eRasterizationOrderAttachmentDepthAccessEXT ) | - VkFlags( SubpassDescriptionFlagBits::eRasterizationOrderAttachmentStencilAccessEXT ) | - VkFlags( SubpassDescriptionFlagBits::eEnableLegacyDitheringEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubpassDescriptionFlags operator|( SubpassDescriptionFlagBits bit0, - SubpassDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubpassDescriptionFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubpassDescriptionFlags operator&( SubpassDescriptionFlagBits bit0, - SubpassDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubpassDescriptionFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubpassDescriptionFlags operator^( SubpassDescriptionFlagBits bit0, - SubpassDescriptionFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubpassDescriptionFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubpassDescriptionFlags operator~( SubpassDescriptionFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SubpassDescriptionFlags( bits ) ); - } - - using CommandPoolCreateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CommandPoolCreateFlagBits::eTransient ) | VkFlags( CommandPoolCreateFlagBits::eResetCommandBuffer ) | - VkFlags( CommandPoolCreateFlagBits::eProtected ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolCreateFlags operator|( CommandPoolCreateFlagBits bit0, CommandPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolCreateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolCreateFlags operator&( CommandPoolCreateFlagBits bit0, CommandPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolCreateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolCreateFlags operator^( CommandPoolCreateFlagBits bit0, CommandPoolCreateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolCreateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolCreateFlags operator~( CommandPoolCreateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CommandPoolCreateFlags( bits ) ); - } - - using CommandPoolResetFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CommandPoolResetFlagBits::eReleaseResources ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolResetFlags operator|( CommandPoolResetFlagBits bit0, CommandPoolResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolResetFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolResetFlags operator&( CommandPoolResetFlagBits bit0, CommandPoolResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolResetFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolResetFlags operator^( CommandPoolResetFlagBits bit0, CommandPoolResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandPoolResetFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandPoolResetFlags operator~( CommandPoolResetFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CommandPoolResetFlags( bits ) ); - } - - using CommandBufferResetFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CommandBufferResetFlagBits::eReleaseResources ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferResetFlags operator|( CommandBufferResetFlagBits bit0, - CommandBufferResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferResetFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferResetFlags operator&( CommandBufferResetFlagBits bit0, - CommandBufferResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferResetFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferResetFlags operator^( CommandBufferResetFlagBits bit0, - CommandBufferResetFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferResetFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferResetFlags operator~( CommandBufferResetFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CommandBufferResetFlags( bits ) ); - } - - using CommandBufferUsageFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CommandBufferUsageFlagBits::eOneTimeSubmit ) | VkFlags( CommandBufferUsageFlagBits::eRenderPassContinue ) | - VkFlags( CommandBufferUsageFlagBits::eSimultaneousUse ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferUsageFlags operator|( CommandBufferUsageFlagBits bit0, - CommandBufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferUsageFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferUsageFlags operator&( CommandBufferUsageFlagBits bit0, - CommandBufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferUsageFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferUsageFlags operator^( CommandBufferUsageFlagBits bit0, - CommandBufferUsageFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return CommandBufferUsageFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CommandBufferUsageFlags operator~( CommandBufferUsageFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CommandBufferUsageFlags( bits ) ); - } - - using QueryControlFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( QueryControlFlagBits::ePrecise ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryControlFlags operator|( QueryControlFlagBits bit0, QueryControlFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryControlFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryControlFlags operator&( QueryControlFlagBits bit0, QueryControlFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryControlFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryControlFlags operator^( QueryControlFlagBits bit0, QueryControlFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return QueryControlFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR QueryControlFlags operator~( QueryControlFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( QueryControlFlags( bits ) ); - } - - using StencilFaceFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( StencilFaceFlagBits::eFront ) | VkFlags( StencilFaceFlagBits::eBack ) | VkFlags( StencilFaceFlagBits::eFrontAndBack ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR StencilFaceFlags operator|( StencilFaceFlagBits bit0, StencilFaceFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return StencilFaceFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR StencilFaceFlags operator&( StencilFaceFlagBits bit0, StencilFaceFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return StencilFaceFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR StencilFaceFlags operator^( StencilFaceFlagBits bit0, StencilFaceFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return StencilFaceFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR StencilFaceFlags operator~( StencilFaceFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( StencilFaceFlags( bits ) ); - } - - //=== VK_VERSION_1_1 === - - using SubgroupFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SubgroupFeatureFlagBits::eBasic ) | VkFlags( SubgroupFeatureFlagBits::eVote ) | VkFlags( SubgroupFeatureFlagBits::eArithmetic ) | - VkFlags( SubgroupFeatureFlagBits::eBallot ) | VkFlags( SubgroupFeatureFlagBits::eShuffle ) | - VkFlags( SubgroupFeatureFlagBits::eShuffleRelative ) | VkFlags( SubgroupFeatureFlagBits::eClustered ) | - VkFlags( SubgroupFeatureFlagBits::eQuad ) | VkFlags( SubgroupFeatureFlagBits::ePartitionedNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubgroupFeatureFlags operator|( SubgroupFeatureFlagBits bit0, SubgroupFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubgroupFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubgroupFeatureFlags operator&( SubgroupFeatureFlagBits bit0, SubgroupFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubgroupFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubgroupFeatureFlags operator^( SubgroupFeatureFlagBits bit0, SubgroupFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubgroupFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubgroupFeatureFlags operator~( SubgroupFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SubgroupFeatureFlags( bits ) ); - } - - using PeerMemoryFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PeerMemoryFeatureFlagBits::eCopySrc ) | VkFlags( PeerMemoryFeatureFlagBits::eCopyDst ) | - VkFlags( PeerMemoryFeatureFlagBits::eGenericSrc ) | VkFlags( PeerMemoryFeatureFlagBits::eGenericDst ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PeerMemoryFeatureFlags operator|( PeerMemoryFeatureFlagBits bit0, PeerMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PeerMemoryFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PeerMemoryFeatureFlags operator&( PeerMemoryFeatureFlagBits bit0, PeerMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PeerMemoryFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PeerMemoryFeatureFlags operator^( PeerMemoryFeatureFlagBits bit0, PeerMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PeerMemoryFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PeerMemoryFeatureFlags operator~( PeerMemoryFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PeerMemoryFeatureFlags( bits ) ); - } - - using PeerMemoryFeatureFlagsKHR = PeerMemoryFeatureFlags; - - using MemoryAllocateFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( MemoryAllocateFlagBits::eDeviceMask ) | VkFlags( MemoryAllocateFlagBits::eDeviceAddress ) | - VkFlags( MemoryAllocateFlagBits::eDeviceAddressCaptureReplay ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryAllocateFlags operator|( MemoryAllocateFlagBits bit0, MemoryAllocateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryAllocateFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryAllocateFlags operator&( MemoryAllocateFlagBits bit0, MemoryAllocateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryAllocateFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryAllocateFlags operator^( MemoryAllocateFlagBits bit0, MemoryAllocateFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return MemoryAllocateFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR MemoryAllocateFlags operator~( MemoryAllocateFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( MemoryAllocateFlags( bits ) ); - } - - using MemoryAllocateFlagsKHR = MemoryAllocateFlags; - - using CommandPoolTrimFlags = Flags; - - using CommandPoolTrimFlagsKHR = CommandPoolTrimFlags; - - using DescriptorUpdateTemplateCreateFlags = Flags; - - using DescriptorUpdateTemplateCreateFlagsKHR = DescriptorUpdateTemplateCreateFlags; - - using ExternalMemoryHandleTypeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eOpaqueWin32 ) | - VkFlags( ExternalMemoryHandleTypeFlagBits::eOpaqueWin32Kmt ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D11Texture ) | - VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D11TextureKmt ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D12Heap ) | - VkFlags( ExternalMemoryHandleTypeFlagBits::eD3D12Resource ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eDmaBufEXT ) -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - | VkFlags( ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID ) -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - | VkFlags( ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT ) | VkFlags( ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT ) -#if defined( VK_USE_PLATFORM_FUCHSIA ) - | VkFlags( ExternalMemoryHandleTypeFlagBits::eZirconVmoFUCHSIA ) -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - | VkFlags( ExternalMemoryHandleTypeFlagBits::eRdmaAddressNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlags operator|( ExternalMemoryHandleTypeFlagBits bit0, - ExternalMemoryHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlags operator&( ExternalMemoryHandleTypeFlagBits bit0, - ExternalMemoryHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlags operator^( ExternalMemoryHandleTypeFlagBits bit0, - ExternalMemoryHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlags operator~( ExternalMemoryHandleTypeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalMemoryHandleTypeFlags( bits ) ); - } - - using ExternalMemoryHandleTypeFlagsKHR = ExternalMemoryHandleTypeFlags; - - using ExternalMemoryFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalMemoryFeatureFlagBits::eDedicatedOnly ) | VkFlags( ExternalMemoryFeatureFlagBits::eExportable ) | - VkFlags( ExternalMemoryFeatureFlagBits::eImportable ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlags operator|( ExternalMemoryFeatureFlagBits bit0, - ExternalMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlags operator&( ExternalMemoryFeatureFlagBits bit0, - ExternalMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlags operator^( ExternalMemoryFeatureFlagBits bit0, - ExternalMemoryFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlags operator~( ExternalMemoryFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalMemoryFeatureFlags( bits ) ); - } - - using ExternalMemoryFeatureFlagsKHR = ExternalMemoryFeatureFlags; - - using ExternalFenceHandleTypeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalFenceHandleTypeFlagBits::eOpaqueFd ) | VkFlags( ExternalFenceHandleTypeFlagBits::eOpaqueWin32 ) | - VkFlags( ExternalFenceHandleTypeFlagBits::eOpaqueWin32Kmt ) | VkFlags( ExternalFenceHandleTypeFlagBits::eSyncFd ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceHandleTypeFlags operator|( ExternalFenceHandleTypeFlagBits bit0, - ExternalFenceHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceHandleTypeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceHandleTypeFlags operator&( ExternalFenceHandleTypeFlagBits bit0, - ExternalFenceHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceHandleTypeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceHandleTypeFlags operator^( ExternalFenceHandleTypeFlagBits bit0, - ExternalFenceHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceHandleTypeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceHandleTypeFlags operator~( ExternalFenceHandleTypeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalFenceHandleTypeFlags( bits ) ); - } - - using ExternalFenceHandleTypeFlagsKHR = ExternalFenceHandleTypeFlags; - - using ExternalFenceFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalFenceFeatureFlagBits::eExportable ) | VkFlags( ExternalFenceFeatureFlagBits::eImportable ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceFeatureFlags operator|( ExternalFenceFeatureFlagBits bit0, - ExternalFenceFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceFeatureFlags operator&( ExternalFenceFeatureFlagBits bit0, - ExternalFenceFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceFeatureFlags operator^( ExternalFenceFeatureFlagBits bit0, - ExternalFenceFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalFenceFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalFenceFeatureFlags operator~( ExternalFenceFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalFenceFeatureFlags( bits ) ); - } - - using ExternalFenceFeatureFlagsKHR = ExternalFenceFeatureFlags; - - using FenceImportFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( FenceImportFlagBits::eTemporary ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceImportFlags operator|( FenceImportFlagBits bit0, FenceImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceImportFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceImportFlags operator&( FenceImportFlagBits bit0, FenceImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceImportFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceImportFlags operator^( FenceImportFlagBits bit0, FenceImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return FenceImportFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FenceImportFlags operator~( FenceImportFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( FenceImportFlags( bits ) ); - } - - using FenceImportFlagsKHR = FenceImportFlags; - - using SemaphoreImportFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SemaphoreImportFlagBits::eTemporary ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreImportFlags operator|( SemaphoreImportFlagBits bit0, SemaphoreImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreImportFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreImportFlags operator&( SemaphoreImportFlagBits bit0, SemaphoreImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreImportFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreImportFlags operator^( SemaphoreImportFlagBits bit0, SemaphoreImportFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreImportFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreImportFlags operator~( SemaphoreImportFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SemaphoreImportFlags( bits ) ); - } - - using SemaphoreImportFlagsKHR = SemaphoreImportFlags; - - using ExternalSemaphoreHandleTypeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd ) | VkFlags( ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32 ) | - VkFlags( ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32Kmt ) | VkFlags( ExternalSemaphoreHandleTypeFlagBits::eD3D12Fence ) | - VkFlags( ExternalSemaphoreHandleTypeFlagBits::eSyncFd ) -#if defined( VK_USE_PLATFORM_FUCHSIA ) - | VkFlags( ExternalSemaphoreHandleTypeFlagBits::eZirconEventFUCHSIA ) -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreHandleTypeFlags operator|( ExternalSemaphoreHandleTypeFlagBits bit0, - ExternalSemaphoreHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreHandleTypeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreHandleTypeFlags operator&( ExternalSemaphoreHandleTypeFlagBits bit0, - ExternalSemaphoreHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreHandleTypeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreHandleTypeFlags operator^( ExternalSemaphoreHandleTypeFlagBits bit0, - ExternalSemaphoreHandleTypeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreHandleTypeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreHandleTypeFlags operator~( ExternalSemaphoreHandleTypeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalSemaphoreHandleTypeFlags( bits ) ); - } - - using ExternalSemaphoreHandleTypeFlagsKHR = ExternalSemaphoreHandleTypeFlags; - - using ExternalSemaphoreFeatureFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalSemaphoreFeatureFlagBits::eExportable ) | VkFlags( ExternalSemaphoreFeatureFlagBits::eImportable ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreFeatureFlags operator|( ExternalSemaphoreFeatureFlagBits bit0, - ExternalSemaphoreFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreFeatureFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreFeatureFlags operator&( ExternalSemaphoreFeatureFlagBits bit0, - ExternalSemaphoreFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreFeatureFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreFeatureFlags operator^( ExternalSemaphoreFeatureFlagBits bit0, - ExternalSemaphoreFeatureFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalSemaphoreFeatureFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalSemaphoreFeatureFlags operator~( ExternalSemaphoreFeatureFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalSemaphoreFeatureFlags( bits ) ); - } - - using ExternalSemaphoreFeatureFlagsKHR = ExternalSemaphoreFeatureFlags; - - //=== VK_VERSION_1_2 === - - using DescriptorBindingFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DescriptorBindingFlagBits::eUpdateAfterBind ) | VkFlags( DescriptorBindingFlagBits::eUpdateUnusedWhilePending ) | - VkFlags( DescriptorBindingFlagBits::ePartiallyBound ) | VkFlags( DescriptorBindingFlagBits::eVariableDescriptorCount ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorBindingFlags operator|( DescriptorBindingFlagBits bit0, DescriptorBindingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorBindingFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorBindingFlags operator&( DescriptorBindingFlagBits bit0, DescriptorBindingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorBindingFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorBindingFlags operator^( DescriptorBindingFlagBits bit0, DescriptorBindingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return DescriptorBindingFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DescriptorBindingFlags operator~( DescriptorBindingFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DescriptorBindingFlags( bits ) ); - } - - using DescriptorBindingFlagsEXT = DescriptorBindingFlags; - - using ResolveModeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ResolveModeFlagBits::eNone ) | VkFlags( ResolveModeFlagBits::eSampleZero ) | VkFlags( ResolveModeFlagBits::eAverage ) | - VkFlags( ResolveModeFlagBits::eMin ) | VkFlags( ResolveModeFlagBits::eMax ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ResolveModeFlags operator|( ResolveModeFlagBits bit0, ResolveModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ResolveModeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ResolveModeFlags operator&( ResolveModeFlagBits bit0, ResolveModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ResolveModeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ResolveModeFlags operator^( ResolveModeFlagBits bit0, ResolveModeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ResolveModeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ResolveModeFlags operator~( ResolveModeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ResolveModeFlags( bits ) ); - } - - using ResolveModeFlagsKHR = ResolveModeFlags; - - using SemaphoreWaitFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SemaphoreWaitFlagBits::eAny ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreWaitFlags operator|( SemaphoreWaitFlagBits bit0, SemaphoreWaitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreWaitFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreWaitFlags operator&( SemaphoreWaitFlagBits bit0, SemaphoreWaitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreWaitFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreWaitFlags operator^( SemaphoreWaitFlagBits bit0, SemaphoreWaitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SemaphoreWaitFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SemaphoreWaitFlags operator~( SemaphoreWaitFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SemaphoreWaitFlags( bits ) ); - } - - using SemaphoreWaitFlagsKHR = SemaphoreWaitFlags; - - //=== VK_VERSION_1_3 === - - using PipelineCreationFeedbackFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( PipelineCreationFeedbackFlagBits::eValid ) | VkFlags( PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit ) | - VkFlags( PipelineCreationFeedbackFlagBits::eBasePipelineAcceleration ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackFlags operator|( PipelineCreationFeedbackFlagBits bit0, - PipelineCreationFeedbackFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreationFeedbackFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackFlags operator&( PipelineCreationFeedbackFlagBits bit0, - PipelineCreationFeedbackFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreationFeedbackFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackFlags operator^( PipelineCreationFeedbackFlagBits bit0, - PipelineCreationFeedbackFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineCreationFeedbackFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackFlags operator~( PipelineCreationFeedbackFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineCreationFeedbackFlags( bits ) ); - } - - using PipelineCreationFeedbackFlagsEXT = PipelineCreationFeedbackFlags; - - using ToolPurposeFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ToolPurposeFlagBits::eValidation ) | VkFlags( ToolPurposeFlagBits::eProfiling ) | VkFlags( ToolPurposeFlagBits::eTracing ) | - VkFlags( ToolPurposeFlagBits::eAdditionalFeatures ) | VkFlags( ToolPurposeFlagBits::eModifyingFeatures ) | - VkFlags( ToolPurposeFlagBits::eDebugReportingEXT ) | VkFlags( ToolPurposeFlagBits::eDebugMarkersEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ToolPurposeFlags operator|( ToolPurposeFlagBits bit0, ToolPurposeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ToolPurposeFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ToolPurposeFlags operator&( ToolPurposeFlagBits bit0, ToolPurposeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ToolPurposeFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ToolPurposeFlags operator^( ToolPurposeFlagBits bit0, ToolPurposeFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return ToolPurposeFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ToolPurposeFlags operator~( ToolPurposeFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ToolPurposeFlags( bits ) ); - } - - using ToolPurposeFlagsEXT = ToolPurposeFlags; - - using PrivateDataSlotCreateFlags = Flags; - - using PrivateDataSlotCreateFlagsEXT = PrivateDataSlotCreateFlags; - - using PipelineStageFlags2 = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags64 - { - allFlags = VkFlags64( PipelineStageFlagBits2::eNone ) | VkFlags64( PipelineStageFlagBits2::eTopOfPipe ) | - VkFlags64( PipelineStageFlagBits2::eDrawIndirect ) | VkFlags64( PipelineStageFlagBits2::eVertexInput ) | - VkFlags64( PipelineStageFlagBits2::eVertexShader ) | VkFlags64( PipelineStageFlagBits2::eTessellationControlShader ) | - VkFlags64( PipelineStageFlagBits2::eTessellationEvaluationShader ) | VkFlags64( PipelineStageFlagBits2::eGeometryShader ) | - VkFlags64( PipelineStageFlagBits2::eFragmentShader ) | VkFlags64( PipelineStageFlagBits2::eEarlyFragmentTests ) | - VkFlags64( PipelineStageFlagBits2::eLateFragmentTests ) | VkFlags64( PipelineStageFlagBits2::eColorAttachmentOutput ) | - VkFlags64( PipelineStageFlagBits2::eComputeShader ) | VkFlags64( PipelineStageFlagBits2::eAllTransfer ) | - VkFlags64( PipelineStageFlagBits2::eBottomOfPipe ) | VkFlags64( PipelineStageFlagBits2::eHost ) | - VkFlags64( PipelineStageFlagBits2::eAllGraphics ) | VkFlags64( PipelineStageFlagBits2::eAllCommands ) | - VkFlags64( PipelineStageFlagBits2::eCopy ) | VkFlags64( PipelineStageFlagBits2::eResolve ) | VkFlags64( PipelineStageFlagBits2::eBlit ) | - VkFlags64( PipelineStageFlagBits2::eClear ) | VkFlags64( PipelineStageFlagBits2::eIndexInput ) | - VkFlags64( PipelineStageFlagBits2::eVertexAttributeInput ) | VkFlags64( PipelineStageFlagBits2::ePreRasterizationShaders ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags64( PipelineStageFlagBits2::eVideoDecodeKHR ) | VkFlags64( PipelineStageFlagBits2::eVideoEncodeKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags64( PipelineStageFlagBits2::eTransformFeedbackEXT ) | VkFlags64( PipelineStageFlagBits2::eConditionalRenderingEXT ) | - VkFlags64( PipelineStageFlagBits2::eCommandPreprocessNV ) | VkFlags64( PipelineStageFlagBits2::eFragmentShadingRateAttachmentKHR ) | - VkFlags64( PipelineStageFlagBits2::eAccelerationStructureBuildKHR ) | VkFlags64( PipelineStageFlagBits2::eRayTracingShaderKHR ) | - VkFlags64( PipelineStageFlagBits2::eFragmentDensityProcessEXT ) | VkFlags64( PipelineStageFlagBits2::eTaskShaderEXT ) | - VkFlags64( PipelineStageFlagBits2::eMeshShaderEXT ) | VkFlags64( PipelineStageFlagBits2::eSubpassShadingHUAWEI ) | - VkFlags64( PipelineStageFlagBits2::eInvocationMaskHUAWEI ) | VkFlags64( PipelineStageFlagBits2::eAccelerationStructureCopyKHR ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags2 operator|( PipelineStageFlagBits2 bit0, PipelineStageFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags2( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags2 operator&( PipelineStageFlagBits2 bit0, PipelineStageFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags2( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags2 operator^( PipelineStageFlagBits2 bit0, PipelineStageFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return PipelineStageFlags2( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PipelineStageFlags2 operator~( PipelineStageFlagBits2 bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PipelineStageFlags2( bits ) ); - } - - using PipelineStageFlags2KHR = PipelineStageFlags2; - - using AccessFlags2 = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags64 - { - allFlags = VkFlags64( AccessFlagBits2::eNone ) | VkFlags64( AccessFlagBits2::eIndirectCommandRead ) | VkFlags64( AccessFlagBits2::eIndexRead ) | - VkFlags64( AccessFlagBits2::eVertexAttributeRead ) | VkFlags64( AccessFlagBits2::eUniformRead ) | - VkFlags64( AccessFlagBits2::eInputAttachmentRead ) | VkFlags64( AccessFlagBits2::eShaderRead ) | VkFlags64( AccessFlagBits2::eShaderWrite ) | - VkFlags64( AccessFlagBits2::eColorAttachmentRead ) | VkFlags64( AccessFlagBits2::eColorAttachmentWrite ) | - VkFlags64( AccessFlagBits2::eDepthStencilAttachmentRead ) | VkFlags64( AccessFlagBits2::eDepthStencilAttachmentWrite ) | - VkFlags64( AccessFlagBits2::eTransferRead ) | VkFlags64( AccessFlagBits2::eTransferWrite ) | VkFlags64( AccessFlagBits2::eHostRead ) | - VkFlags64( AccessFlagBits2::eHostWrite ) | VkFlags64( AccessFlagBits2::eMemoryRead ) | VkFlags64( AccessFlagBits2::eMemoryWrite ) | - VkFlags64( AccessFlagBits2::eShaderSampledRead ) | VkFlags64( AccessFlagBits2::eShaderStorageRead ) | - VkFlags64( AccessFlagBits2::eShaderStorageWrite ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags64( AccessFlagBits2::eVideoDecodeReadKHR ) | VkFlags64( AccessFlagBits2::eVideoDecodeWriteKHR ) | - VkFlags64( AccessFlagBits2::eVideoEncodeReadKHR ) | VkFlags64( AccessFlagBits2::eVideoEncodeWriteKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags64( AccessFlagBits2::eTransformFeedbackWriteEXT ) | VkFlags64( AccessFlagBits2::eTransformFeedbackCounterReadEXT ) | - VkFlags64( AccessFlagBits2::eTransformFeedbackCounterWriteEXT ) | VkFlags64( AccessFlagBits2::eConditionalRenderingReadEXT ) | - VkFlags64( AccessFlagBits2::eCommandPreprocessReadNV ) | VkFlags64( AccessFlagBits2::eCommandPreprocessWriteNV ) | - VkFlags64( AccessFlagBits2::eFragmentShadingRateAttachmentReadKHR ) | VkFlags64( AccessFlagBits2::eAccelerationStructureReadKHR ) | - VkFlags64( AccessFlagBits2::eAccelerationStructureWriteKHR ) | VkFlags64( AccessFlagBits2::eFragmentDensityMapReadEXT ) | - VkFlags64( AccessFlagBits2::eColorAttachmentReadNoncoherentEXT ) | VkFlags64( AccessFlagBits2::eInvocationMaskReadHUAWEI ) | - VkFlags64( AccessFlagBits2::eShaderBindingTableReadKHR ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags2 operator|( AccessFlagBits2 bit0, AccessFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags2( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags2 operator&( AccessFlagBits2 bit0, AccessFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags2( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags2 operator^( AccessFlagBits2 bit0, AccessFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccessFlags2( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccessFlags2 operator~( AccessFlagBits2 bits ) VULKAN_HPP_NOEXCEPT - { - return ~( AccessFlags2( bits ) ); - } - - using AccessFlags2KHR = AccessFlags2; - - using SubmitFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SubmitFlagBits::eProtected ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubmitFlags operator|( SubmitFlagBits bit0, SubmitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubmitFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubmitFlags operator&( SubmitFlagBits bit0, SubmitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubmitFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubmitFlags operator^( SubmitFlagBits bit0, SubmitFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return SubmitFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SubmitFlags operator~( SubmitFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SubmitFlags( bits ) ); - } - - using SubmitFlagsKHR = SubmitFlags; - - using RenderingFlags = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( RenderingFlagBits::eContentsSecondaryCommandBuffers ) | VkFlags( RenderingFlagBits::eSuspending ) | - VkFlags( RenderingFlagBits::eResuming ) | VkFlags( RenderingFlagBits::eEnableLegacyDitheringEXT ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderingFlags operator|( RenderingFlagBits bit0, RenderingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderingFlags( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderingFlags operator&( RenderingFlagBits bit0, RenderingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderingFlags( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderingFlags operator^( RenderingFlagBits bit0, RenderingFlagBits bit1 ) VULKAN_HPP_NOEXCEPT - { - return RenderingFlags( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR RenderingFlags operator~( RenderingFlagBits bits ) VULKAN_HPP_NOEXCEPT - { - return ~( RenderingFlags( bits ) ); - } - - using RenderingFlagsKHR = RenderingFlags; - - using FormatFeatureFlags2 = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags64 - { - allFlags = VkFlags64( FormatFeatureFlagBits2::eSampledImage ) | VkFlags64( FormatFeatureFlagBits2::eStorageImage ) | - VkFlags64( FormatFeatureFlagBits2::eStorageImageAtomic ) | VkFlags64( FormatFeatureFlagBits2::eUniformTexelBuffer ) | - VkFlags64( FormatFeatureFlagBits2::eStorageTexelBuffer ) | VkFlags64( FormatFeatureFlagBits2::eStorageTexelBufferAtomic ) | - VkFlags64( FormatFeatureFlagBits2::eVertexBuffer ) | VkFlags64( FormatFeatureFlagBits2::eColorAttachment ) | - VkFlags64( FormatFeatureFlagBits2::eColorAttachmentBlend ) | VkFlags64( FormatFeatureFlagBits2::eDepthStencilAttachment ) | - VkFlags64( FormatFeatureFlagBits2::eBlitSrc ) | VkFlags64( FormatFeatureFlagBits2::eBlitDst ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageFilterLinear ) | VkFlags64( FormatFeatureFlagBits2::eSampledImageFilterCubic ) | - VkFlags64( FormatFeatureFlagBits2::eTransferSrc ) | VkFlags64( FormatFeatureFlagBits2::eTransferDst ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageFilterMinmax ) | VkFlags64( FormatFeatureFlagBits2::eMidpointChromaSamples ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageYcbcrConversionLinearFilter ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageYcbcrConversionSeparateReconstructionFilter ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicit ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable ) | - VkFlags64( FormatFeatureFlagBits2::eDisjoint ) | VkFlags64( FormatFeatureFlagBits2::eCositedChromaSamples ) | - VkFlags64( FormatFeatureFlagBits2::eStorageReadWithoutFormat ) | VkFlags64( FormatFeatureFlagBits2::eStorageWriteWithoutFormat ) | - VkFlags64( FormatFeatureFlagBits2::eSampledImageDepthComparison ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags64( FormatFeatureFlagBits2::eVideoDecodeOutputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoDecodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags64( FormatFeatureFlagBits2::eAccelerationStructureVertexBufferKHR ) | VkFlags64( FormatFeatureFlagBits2::eFragmentDensityMapEXT ) | - VkFlags64( FormatFeatureFlagBits2::eFragmentShadingRateAttachmentKHR ) -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags64( FormatFeatureFlagBits2::eVideoEncodeInputKHR ) | VkFlags64( FormatFeatureFlagBits2::eVideoEncodeDpbKHR ) -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - | VkFlags64( FormatFeatureFlagBits2::eLinearColorAttachmentNV ) | VkFlags64( FormatFeatureFlagBits2::eWeightImageQCOM ) | - VkFlags64( FormatFeatureFlagBits2::eWeightSampledImageQCOM ) | VkFlags64( FormatFeatureFlagBits2::eBlockMatchingQCOM ) | - VkFlags64( FormatFeatureFlagBits2::eBoxFilterSampledQCOM ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags2 operator|( FormatFeatureFlagBits2 bit0, FormatFeatureFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags2( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags2 operator&( FormatFeatureFlagBits2 bit0, FormatFeatureFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags2( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags2 operator^( FormatFeatureFlagBits2 bit0, FormatFeatureFlagBits2 bit1 ) VULKAN_HPP_NOEXCEPT - { - return FormatFeatureFlags2( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR FormatFeatureFlags2 operator~( FormatFeatureFlagBits2 bits ) VULKAN_HPP_NOEXCEPT - { - return ~( FormatFeatureFlags2( bits ) ); - } - - using FormatFeatureFlags2KHR = FormatFeatureFlags2; - - //=== VK_KHR_surface === - - using CompositeAlphaFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( CompositeAlphaFlagBitsKHR::eOpaque ) | VkFlags( CompositeAlphaFlagBitsKHR::ePreMultiplied ) | - VkFlags( CompositeAlphaFlagBitsKHR::ePostMultiplied ) | VkFlags( CompositeAlphaFlagBitsKHR::eInherit ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CompositeAlphaFlagsKHR operator|( CompositeAlphaFlagBitsKHR bit0, CompositeAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return CompositeAlphaFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CompositeAlphaFlagsKHR operator&( CompositeAlphaFlagBitsKHR bit0, CompositeAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return CompositeAlphaFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CompositeAlphaFlagsKHR operator^( CompositeAlphaFlagBitsKHR bit0, CompositeAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return CompositeAlphaFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR CompositeAlphaFlagsKHR operator~( CompositeAlphaFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( CompositeAlphaFlagsKHR( bits ) ); - } - - //=== VK_KHR_swapchain === - - using SwapchainCreateFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions ) | VkFlags( SwapchainCreateFlagBitsKHR::eProtected ) | - VkFlags( SwapchainCreateFlagBitsKHR::eMutableFormat ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SwapchainCreateFlagsKHR operator|( SwapchainCreateFlagBitsKHR bit0, - SwapchainCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SwapchainCreateFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SwapchainCreateFlagsKHR operator&( SwapchainCreateFlagBitsKHR bit0, - SwapchainCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SwapchainCreateFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SwapchainCreateFlagsKHR operator^( SwapchainCreateFlagBitsKHR bit0, - SwapchainCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SwapchainCreateFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SwapchainCreateFlagsKHR operator~( SwapchainCreateFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SwapchainCreateFlagsKHR( bits ) ); - } - - using DeviceGroupPresentModeFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DeviceGroupPresentModeFlagBitsKHR::eLocal ) | VkFlags( DeviceGroupPresentModeFlagBitsKHR::eRemote ) | - VkFlags( DeviceGroupPresentModeFlagBitsKHR::eSum ) | VkFlags( DeviceGroupPresentModeFlagBitsKHR::eLocalMultiDevice ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceGroupPresentModeFlagsKHR operator|( DeviceGroupPresentModeFlagBitsKHR bit0, - DeviceGroupPresentModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceGroupPresentModeFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceGroupPresentModeFlagsKHR operator&( DeviceGroupPresentModeFlagBitsKHR bit0, - DeviceGroupPresentModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceGroupPresentModeFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceGroupPresentModeFlagsKHR operator^( DeviceGroupPresentModeFlagBitsKHR bit0, - DeviceGroupPresentModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceGroupPresentModeFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceGroupPresentModeFlagsKHR operator~( DeviceGroupPresentModeFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DeviceGroupPresentModeFlagsKHR( bits ) ); - } - - //=== VK_KHR_display === - - using DisplayModeCreateFlagsKHR = Flags; - - using DisplayPlaneAlphaFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DisplayPlaneAlphaFlagBitsKHR::eOpaque ) | VkFlags( DisplayPlaneAlphaFlagBitsKHR::eGlobal ) | - VkFlags( DisplayPlaneAlphaFlagBitsKHR::ePerPixel ) | VkFlags( DisplayPlaneAlphaFlagBitsKHR::ePerPixelPremultiplied ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DisplayPlaneAlphaFlagsKHR operator|( DisplayPlaneAlphaFlagBitsKHR bit0, - DisplayPlaneAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DisplayPlaneAlphaFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DisplayPlaneAlphaFlagsKHR operator&( DisplayPlaneAlphaFlagBitsKHR bit0, - DisplayPlaneAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DisplayPlaneAlphaFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DisplayPlaneAlphaFlagsKHR operator^( DisplayPlaneAlphaFlagBitsKHR bit0, - DisplayPlaneAlphaFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return DisplayPlaneAlphaFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DisplayPlaneAlphaFlagsKHR operator~( DisplayPlaneAlphaFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DisplayPlaneAlphaFlagsKHR( bits ) ); - } - - using DisplaySurfaceCreateFlagsKHR = Flags; - - using SurfaceTransformFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SurfaceTransformFlagBitsKHR::eIdentity ) | VkFlags( SurfaceTransformFlagBitsKHR::eRotate90 ) | - VkFlags( SurfaceTransformFlagBitsKHR::eRotate180 ) | VkFlags( SurfaceTransformFlagBitsKHR::eRotate270 ) | - VkFlags( SurfaceTransformFlagBitsKHR::eHorizontalMirror ) | VkFlags( SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate90 ) | - VkFlags( SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate180 ) | VkFlags( SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate270 ) | - VkFlags( SurfaceTransformFlagBitsKHR::eInherit ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceTransformFlagsKHR operator|( SurfaceTransformFlagBitsKHR bit0, - SurfaceTransformFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceTransformFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceTransformFlagsKHR operator&( SurfaceTransformFlagBitsKHR bit0, - SurfaceTransformFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceTransformFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceTransformFlagsKHR operator^( SurfaceTransformFlagBitsKHR bit0, - SurfaceTransformFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceTransformFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceTransformFlagsKHR operator~( SurfaceTransformFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SurfaceTransformFlagsKHR( bits ) ); - } - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - using XlibSurfaceCreateFlagsKHR = Flags; - -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - using XcbSurfaceCreateFlagsKHR = Flags; - -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - using WaylandSurfaceCreateFlagsKHR = Flags; - -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - using AndroidSurfaceCreateFlagsKHR = Flags; - -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - using Win32SurfaceCreateFlagsKHR = Flags; - -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - using DebugReportFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DebugReportFlagBitsEXT::eInformation ) | VkFlags( DebugReportFlagBitsEXT::eWarning ) | - VkFlags( DebugReportFlagBitsEXT::ePerformanceWarning ) | VkFlags( DebugReportFlagBitsEXT::eError ) | VkFlags( DebugReportFlagBitsEXT::eDebug ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugReportFlagsEXT operator|( DebugReportFlagBitsEXT bit0, DebugReportFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugReportFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugReportFlagsEXT operator&( DebugReportFlagBitsEXT bit0, DebugReportFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugReportFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugReportFlagsEXT operator^( DebugReportFlagBitsEXT bit0, DebugReportFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugReportFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugReportFlagsEXT operator~( DebugReportFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DebugReportFlagsEXT( bits ) ); - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - using VideoCodecOperationFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoCodecOperationFlagBitsKHR::eNone ) -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH264EXT ) | VkFlags( VideoCodecOperationFlagBitsKHR::eEncodeH265EXT ) | - VkFlags( VideoCodecOperationFlagBitsKHR::eDecodeH264EXT ) | VkFlags( VideoCodecOperationFlagBitsKHR::eDecodeH265EXT ) -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodecOperationFlagsKHR operator|( VideoCodecOperationFlagBitsKHR bit0, - VideoCodecOperationFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodecOperationFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodecOperationFlagsKHR operator&( VideoCodecOperationFlagBitsKHR bit0, - VideoCodecOperationFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodecOperationFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodecOperationFlagsKHR operator^( VideoCodecOperationFlagBitsKHR bit0, - VideoCodecOperationFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodecOperationFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodecOperationFlagsKHR operator~( VideoCodecOperationFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoCodecOperationFlagsKHR( bits ) ); - } - - using VideoChromaSubsamplingFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoChromaSubsamplingFlagBitsKHR::eInvalid ) | VkFlags( VideoChromaSubsamplingFlagBitsKHR::eMonochrome ) | - VkFlags( VideoChromaSubsamplingFlagBitsKHR::e420 ) | VkFlags( VideoChromaSubsamplingFlagBitsKHR::e422 ) | - VkFlags( VideoChromaSubsamplingFlagBitsKHR::e444 ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoChromaSubsamplingFlagsKHR operator|( VideoChromaSubsamplingFlagBitsKHR bit0, - VideoChromaSubsamplingFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoChromaSubsamplingFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoChromaSubsamplingFlagsKHR operator&( VideoChromaSubsamplingFlagBitsKHR bit0, - VideoChromaSubsamplingFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoChromaSubsamplingFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoChromaSubsamplingFlagsKHR operator^( VideoChromaSubsamplingFlagBitsKHR bit0, - VideoChromaSubsamplingFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoChromaSubsamplingFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoChromaSubsamplingFlagsKHR operator~( VideoChromaSubsamplingFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoChromaSubsamplingFlagsKHR( bits ) ); - } - - using VideoComponentBitDepthFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoComponentBitDepthFlagBitsKHR::eInvalid ) | VkFlags( VideoComponentBitDepthFlagBitsKHR::e8 ) | - VkFlags( VideoComponentBitDepthFlagBitsKHR::e10 ) | VkFlags( VideoComponentBitDepthFlagBitsKHR::e12 ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoComponentBitDepthFlagsKHR operator|( VideoComponentBitDepthFlagBitsKHR bit0, - VideoComponentBitDepthFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoComponentBitDepthFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoComponentBitDepthFlagsKHR operator&( VideoComponentBitDepthFlagBitsKHR bit0, - VideoComponentBitDepthFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoComponentBitDepthFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoComponentBitDepthFlagsKHR operator^( VideoComponentBitDepthFlagBitsKHR bit0, - VideoComponentBitDepthFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoComponentBitDepthFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoComponentBitDepthFlagsKHR operator~( VideoComponentBitDepthFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoComponentBitDepthFlagsKHR( bits ) ); - } - - using VideoCapabilityFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoCapabilityFlagBitsKHR::eProtectedContent ) | VkFlags( VideoCapabilityFlagBitsKHR::eSeparateReferenceImages ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCapabilityFlagsKHR operator|( VideoCapabilityFlagBitsKHR bit0, - VideoCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCapabilityFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCapabilityFlagsKHR operator&( VideoCapabilityFlagBitsKHR bit0, - VideoCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCapabilityFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCapabilityFlagsKHR operator^( VideoCapabilityFlagBitsKHR bit0, - VideoCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCapabilityFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCapabilityFlagsKHR operator~( VideoCapabilityFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoCapabilityFlagsKHR( bits ) ); - } - - using VideoSessionCreateFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoSessionCreateFlagBitsKHR::eProtectedContent ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoSessionCreateFlagsKHR operator|( VideoSessionCreateFlagBitsKHR bit0, - VideoSessionCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoSessionCreateFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoSessionCreateFlagsKHR operator&( VideoSessionCreateFlagBitsKHR bit0, - VideoSessionCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoSessionCreateFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoSessionCreateFlagsKHR operator^( VideoSessionCreateFlagBitsKHR bit0, - VideoSessionCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoSessionCreateFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoSessionCreateFlagsKHR operator~( VideoSessionCreateFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoSessionCreateFlagsKHR( bits ) ); - } - - using VideoSessionParametersCreateFlagsKHR = Flags; - - using VideoBeginCodingFlagsKHR = Flags; - - using VideoEndCodingFlagsKHR = Flags; - - using VideoCodingControlFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoCodingControlFlagBitsKHR::eReset ) -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - | VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControl ) | VkFlags( VideoCodingControlFlagBitsKHR::eEncodeRateControlLayer ) -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodingControlFlagsKHR operator|( VideoCodingControlFlagBitsKHR bit0, - VideoCodingControlFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodingControlFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodingControlFlagsKHR operator&( VideoCodingControlFlagBitsKHR bit0, - VideoCodingControlFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodingControlFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodingControlFlagsKHR operator^( VideoCodingControlFlagBitsKHR bit0, - VideoCodingControlFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoCodingControlFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoCodingControlFlagsKHR operator~( VideoCodingControlFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoCodingControlFlagsKHR( bits ) ); - } - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - using VideoDecodeCapabilityFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputCoincide ) | VkFlags( VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputDistinct ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeCapabilityFlagsKHR operator|( VideoDecodeCapabilityFlagBitsKHR bit0, - VideoDecodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeCapabilityFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeCapabilityFlagsKHR operator&( VideoDecodeCapabilityFlagBitsKHR bit0, - VideoDecodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeCapabilityFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeCapabilityFlagsKHR operator^( VideoDecodeCapabilityFlagBitsKHR bit0, - VideoDecodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeCapabilityFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeCapabilityFlagsKHR operator~( VideoDecodeCapabilityFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoDecodeCapabilityFlagsKHR( bits ) ); - } - - using VideoDecodeUsageFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoDecodeUsageFlagBitsKHR::eDefault ) | VkFlags( VideoDecodeUsageFlagBitsKHR::eTranscoding ) | - VkFlags( VideoDecodeUsageFlagBitsKHR::eOffline ) | VkFlags( VideoDecodeUsageFlagBitsKHR::eStreaming ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeUsageFlagsKHR operator|( VideoDecodeUsageFlagBitsKHR bit0, - VideoDecodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeUsageFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeUsageFlagsKHR operator&( VideoDecodeUsageFlagBitsKHR bit0, - VideoDecodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeUsageFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeUsageFlagsKHR operator^( VideoDecodeUsageFlagBitsKHR bit0, - VideoDecodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeUsageFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeUsageFlagsKHR operator~( VideoDecodeUsageFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoDecodeUsageFlagsKHR( bits ) ); - } - - using VideoDecodeFlagsKHR = Flags; - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - using PipelineRasterizationStateStreamCreateFlagsEXT = Flags; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - - using VideoEncodeH264CapabilityFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceEnabled ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceDisabled ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eSeparateColourPlane ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eQpprimeYZeroTransformBypass ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eScalingLists ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eHrdCompliance ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eChromaQpOffset ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eSecondChromaQpOffset ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::ePicInitQpMinus26 ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPred ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredExplicit ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredImplicit ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPredNoTable ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eTransform8X8 ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eCabac ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eCavlc ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterDisabled ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterEnabled ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterPartial ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDisableDirectSpatialMvPred ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eMultipleSlicePerFrame ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eSliceMbCount ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eRowUnalignedSlice ) | - VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eDifferentSliceType ) | VkFlags( VideoEncodeH264CapabilityFlagBitsEXT::eBFrameInL1List ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilityFlagsEXT operator|( VideoEncodeH264CapabilityFlagBitsEXT bit0, - VideoEncodeH264CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264CapabilityFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilityFlagsEXT operator&( VideoEncodeH264CapabilityFlagBitsEXT bit0, - VideoEncodeH264CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264CapabilityFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilityFlagsEXT operator^( VideoEncodeH264CapabilityFlagBitsEXT bit0, - VideoEncodeH264CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264CapabilityFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilityFlagsEXT operator~( VideoEncodeH264CapabilityFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH264CapabilityFlagsEXT( bits ) ); - } - - using VideoEncodeH264InputModeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH264InputModeFlagBitsEXT::eFrame ) | VkFlags( VideoEncodeH264InputModeFlagBitsEXT::eSlice ) | - VkFlags( VideoEncodeH264InputModeFlagBitsEXT::eNonVcl ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264InputModeFlagsEXT operator|( VideoEncodeH264InputModeFlagBitsEXT bit0, - VideoEncodeH264InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264InputModeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264InputModeFlagsEXT operator&( VideoEncodeH264InputModeFlagBitsEXT bit0, - VideoEncodeH264InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264InputModeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264InputModeFlagsEXT operator^( VideoEncodeH264InputModeFlagBitsEXT bit0, - VideoEncodeH264InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264InputModeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264InputModeFlagsEXT operator~( VideoEncodeH264InputModeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH264InputModeFlagsEXT( bits ) ); - } - - using VideoEncodeH264OutputModeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH264OutputModeFlagBitsEXT::eFrame ) | VkFlags( VideoEncodeH264OutputModeFlagBitsEXT::eSlice ) | - VkFlags( VideoEncodeH264OutputModeFlagBitsEXT::eNonVcl ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264OutputModeFlagsEXT operator|( VideoEncodeH264OutputModeFlagBitsEXT bit0, - VideoEncodeH264OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264OutputModeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264OutputModeFlagsEXT operator&( VideoEncodeH264OutputModeFlagBitsEXT bit0, - VideoEncodeH264OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264OutputModeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264OutputModeFlagsEXT operator^( VideoEncodeH264OutputModeFlagBitsEXT bit0, - VideoEncodeH264OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH264OutputModeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH264OutputModeFlagsEXT operator~( VideoEncodeH264OutputModeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH264OutputModeFlagsEXT( bits ) ); - } - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - - using VideoEncodeH265CapabilityFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eSeparateColourPlane ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eScalingLists ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eSampleAdaptiveOffsetEnabled ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::ePcmEnable ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eSpsTemporalMvpEnabled ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eHrdCompliance ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eInitQpMinus26 ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eLog2ParallelMergeLevelMinus2 ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eSignDataHidingEnabled ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipEnabled ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipDisabled ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::ePpsSliceChromaQpOffsetsPresent ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPred ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eWeightedBipred ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPredNoTable ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eTransquantBypassEnabled ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eEntropyCodingSyncEnabled ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eDeblockingFilterOverrideEnabled ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerFrame ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eMultipleSlicePerTile ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerSlice ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eSliceSegmentCtbCount ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eRowUnalignedSliceSegment ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eDependentSliceSegment ) | - VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eDifferentSliceType ) | VkFlags( VideoEncodeH265CapabilityFlagBitsEXT::eBFrameInL1List ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilityFlagsEXT operator|( VideoEncodeH265CapabilityFlagBitsEXT bit0, - VideoEncodeH265CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CapabilityFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilityFlagsEXT operator&( VideoEncodeH265CapabilityFlagBitsEXT bit0, - VideoEncodeH265CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CapabilityFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilityFlagsEXT operator^( VideoEncodeH265CapabilityFlagBitsEXT bit0, - VideoEncodeH265CapabilityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CapabilityFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilityFlagsEXT operator~( VideoEncodeH265CapabilityFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH265CapabilityFlagsEXT( bits ) ); - } - - using VideoEncodeH265InputModeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH265InputModeFlagBitsEXT::eFrame ) | VkFlags( VideoEncodeH265InputModeFlagBitsEXT::eSliceSegment ) | - VkFlags( VideoEncodeH265InputModeFlagBitsEXT::eNonVcl ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265InputModeFlagsEXT operator|( VideoEncodeH265InputModeFlagBitsEXT bit0, - VideoEncodeH265InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265InputModeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265InputModeFlagsEXT operator&( VideoEncodeH265InputModeFlagBitsEXT bit0, - VideoEncodeH265InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265InputModeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265InputModeFlagsEXT operator^( VideoEncodeH265InputModeFlagBitsEXT bit0, - VideoEncodeH265InputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265InputModeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265InputModeFlagsEXT operator~( VideoEncodeH265InputModeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH265InputModeFlagsEXT( bits ) ); - } - - using VideoEncodeH265OutputModeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH265OutputModeFlagBitsEXT::eFrame ) | VkFlags( VideoEncodeH265OutputModeFlagBitsEXT::eSliceSegment ) | - VkFlags( VideoEncodeH265OutputModeFlagBitsEXT::eNonVcl ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265OutputModeFlagsEXT operator|( VideoEncodeH265OutputModeFlagBitsEXT bit0, - VideoEncodeH265OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265OutputModeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265OutputModeFlagsEXT operator&( VideoEncodeH265OutputModeFlagBitsEXT bit0, - VideoEncodeH265OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265OutputModeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265OutputModeFlagsEXT operator^( VideoEncodeH265OutputModeFlagBitsEXT bit0, - VideoEncodeH265OutputModeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265OutputModeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265OutputModeFlagsEXT operator~( VideoEncodeH265OutputModeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH265OutputModeFlagsEXT( bits ) ); - } - - using VideoEncodeH265CtbSizeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH265CtbSizeFlagBitsEXT::e16 ) | VkFlags( VideoEncodeH265CtbSizeFlagBitsEXT::e32 ) | - VkFlags( VideoEncodeH265CtbSizeFlagBitsEXT::e64 ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CtbSizeFlagsEXT operator|( VideoEncodeH265CtbSizeFlagBitsEXT bit0, - VideoEncodeH265CtbSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CtbSizeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CtbSizeFlagsEXT operator&( VideoEncodeH265CtbSizeFlagBitsEXT bit0, - VideoEncodeH265CtbSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CtbSizeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CtbSizeFlagsEXT operator^( VideoEncodeH265CtbSizeFlagBitsEXT bit0, - VideoEncodeH265CtbSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265CtbSizeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265CtbSizeFlagsEXT operator~( VideoEncodeH265CtbSizeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH265CtbSizeFlagsEXT( bits ) ); - } - - using VideoEncodeH265TransformBlockSizeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeH265TransformBlockSizeFlagBitsEXT::e4 ) | VkFlags( VideoEncodeH265TransformBlockSizeFlagBitsEXT::e8 ) | - VkFlags( VideoEncodeH265TransformBlockSizeFlagBitsEXT::e16 ) | VkFlags( VideoEncodeH265TransformBlockSizeFlagBitsEXT::e32 ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265TransformBlockSizeFlagsEXT - operator|( VideoEncodeH265TransformBlockSizeFlagBitsEXT bit0, VideoEncodeH265TransformBlockSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265TransformBlockSizeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265TransformBlockSizeFlagsEXT - operator&( VideoEncodeH265TransformBlockSizeFlagBitsEXT bit0, VideoEncodeH265TransformBlockSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265TransformBlockSizeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265TransformBlockSizeFlagsEXT - operator^( VideoEncodeH265TransformBlockSizeFlagBitsEXT bit0, VideoEncodeH265TransformBlockSizeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeH265TransformBlockSizeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeH265TransformBlockSizeFlagsEXT operator~( VideoEncodeH265TransformBlockSizeFlagBitsEXT bits ) - VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeH265TransformBlockSizeFlagsEXT( bits ) ); - } - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - - using VideoDecodeH264PictureLayoutFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoDecodeH264PictureLayoutFlagBitsEXT::eProgressive ) | - VkFlags( VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedInterleavedLines ) | - VkFlags( VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedSeparatePlanes ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureLayoutFlagsEXT operator|( VideoDecodeH264PictureLayoutFlagBitsEXT bit0, - VideoDecodeH264PictureLayoutFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeH264PictureLayoutFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureLayoutFlagsEXT operator&( VideoDecodeH264PictureLayoutFlagBitsEXT bit0, - VideoDecodeH264PictureLayoutFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeH264PictureLayoutFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureLayoutFlagsEXT operator^( VideoDecodeH264PictureLayoutFlagBitsEXT bit0, - VideoDecodeH264PictureLayoutFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoDecodeH264PictureLayoutFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureLayoutFlagsEXT operator~( VideoDecodeH264PictureLayoutFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoDecodeH264PictureLayoutFlagsEXT( bits ) ); - } - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - using StreamDescriptorSurfaceCreateFlagsGGP = Flags; - -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - using ExternalMemoryHandleTypeFlagsNV = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32 ) | VkFlags( ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32Kmt ) | - VkFlags( ExternalMemoryHandleTypeFlagBitsNV::eD3D11Image ) | VkFlags( ExternalMemoryHandleTypeFlagBitsNV::eD3D11ImageKmt ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlagsNV operator|( ExternalMemoryHandleTypeFlagBitsNV bit0, - ExternalMemoryHandleTypeFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlagsNV( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlagsNV operator&( ExternalMemoryHandleTypeFlagBitsNV bit0, - ExternalMemoryHandleTypeFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlagsNV( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlagsNV operator^( ExternalMemoryHandleTypeFlagBitsNV bit0, - ExternalMemoryHandleTypeFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryHandleTypeFlagsNV( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryHandleTypeFlagsNV operator~( ExternalMemoryHandleTypeFlagBitsNV bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalMemoryHandleTypeFlagsNV( bits ) ); - } - - using ExternalMemoryFeatureFlagsNV = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExternalMemoryFeatureFlagBitsNV::eDedicatedOnly ) | VkFlags( ExternalMemoryFeatureFlagBitsNV::eExportable ) | - VkFlags( ExternalMemoryFeatureFlagBitsNV::eImportable ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlagsNV operator|( ExternalMemoryFeatureFlagBitsNV bit0, - ExternalMemoryFeatureFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlagsNV( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlagsNV operator&( ExternalMemoryFeatureFlagBitsNV bit0, - ExternalMemoryFeatureFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlagsNV( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlagsNV operator^( ExternalMemoryFeatureFlagBitsNV bit0, - ExternalMemoryFeatureFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExternalMemoryFeatureFlagsNV( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExternalMemoryFeatureFlagsNV operator~( ExternalMemoryFeatureFlagBitsNV bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExternalMemoryFeatureFlagsNV( bits ) ); - } - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - using ViSurfaceCreateFlagsNN = Flags; - -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_EXT_conditional_rendering === - - using ConditionalRenderingFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ConditionalRenderingFlagBitsEXT::eInverted ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ConditionalRenderingFlagsEXT operator|( ConditionalRenderingFlagBitsEXT bit0, - ConditionalRenderingFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ConditionalRenderingFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ConditionalRenderingFlagsEXT operator&( ConditionalRenderingFlagBitsEXT bit0, - ConditionalRenderingFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ConditionalRenderingFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ConditionalRenderingFlagsEXT operator^( ConditionalRenderingFlagBitsEXT bit0, - ConditionalRenderingFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ConditionalRenderingFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ConditionalRenderingFlagsEXT operator~( ConditionalRenderingFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ConditionalRenderingFlagsEXT( bits ) ); - } - - //=== VK_EXT_display_surface_counter === - - using SurfaceCounterFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( SurfaceCounterFlagBitsEXT::eVblank ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceCounterFlagsEXT operator|( SurfaceCounterFlagBitsEXT bit0, SurfaceCounterFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceCounterFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceCounterFlagsEXT operator&( SurfaceCounterFlagBitsEXT bit0, SurfaceCounterFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceCounterFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceCounterFlagsEXT operator^( SurfaceCounterFlagBitsEXT bit0, SurfaceCounterFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return SurfaceCounterFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR SurfaceCounterFlagsEXT operator~( SurfaceCounterFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( SurfaceCounterFlagsEXT( bits ) ); - } - - //=== VK_NV_viewport_swizzle === - - using PipelineViewportSwizzleStateCreateFlagsNV = Flags; - - //=== VK_EXT_discard_rectangles === - - using PipelineDiscardRectangleStateCreateFlagsEXT = Flags; - - //=== VK_EXT_conservative_rasterization === - - using PipelineRasterizationConservativeStateCreateFlagsEXT = Flags; - - //=== VK_EXT_depth_clip_enable === - - using PipelineRasterizationDepthClipStateCreateFlagsEXT = Flags; - - //=== VK_KHR_performance_query === - - using PerformanceCounterDescriptionFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = - VkFlags( PerformanceCounterDescriptionFlagBitsKHR::ePerformanceImpacting ) | VkFlags( PerformanceCounterDescriptionFlagBitsKHR::eConcurrentlyImpacted ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PerformanceCounterDescriptionFlagsKHR operator|( PerformanceCounterDescriptionFlagBitsKHR bit0, - PerformanceCounterDescriptionFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return PerformanceCounterDescriptionFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PerformanceCounterDescriptionFlagsKHR operator&( PerformanceCounterDescriptionFlagBitsKHR bit0, - PerformanceCounterDescriptionFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return PerformanceCounterDescriptionFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PerformanceCounterDescriptionFlagsKHR operator^( PerformanceCounterDescriptionFlagBitsKHR bit0, - PerformanceCounterDescriptionFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return PerformanceCounterDescriptionFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR PerformanceCounterDescriptionFlagsKHR operator~( PerformanceCounterDescriptionFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( PerformanceCounterDescriptionFlagsKHR( bits ) ); - } - - using AcquireProfilingLockFlagsKHR = Flags; - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - using IOSSurfaceCreateFlagsMVK = Flags; - -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - using MacOSSurfaceCreateFlagsMVK = Flags; - -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - using DebugUtilsMessageSeverityFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DebugUtilsMessageSeverityFlagBitsEXT::eVerbose ) | VkFlags( DebugUtilsMessageSeverityFlagBitsEXT::eInfo ) | - VkFlags( DebugUtilsMessageSeverityFlagBitsEXT::eWarning ) | VkFlags( DebugUtilsMessageSeverityFlagBitsEXT::eError ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageSeverityFlagsEXT operator|( DebugUtilsMessageSeverityFlagBitsEXT bit0, - DebugUtilsMessageSeverityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageSeverityFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageSeverityFlagsEXT operator&( DebugUtilsMessageSeverityFlagBitsEXT bit0, - DebugUtilsMessageSeverityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageSeverityFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageSeverityFlagsEXT operator^( DebugUtilsMessageSeverityFlagBitsEXT bit0, - DebugUtilsMessageSeverityFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageSeverityFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageSeverityFlagsEXT operator~( DebugUtilsMessageSeverityFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DebugUtilsMessageSeverityFlagsEXT( bits ) ); - } - - using DebugUtilsMessageTypeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DebugUtilsMessageTypeFlagBitsEXT::eGeneral ) | VkFlags( DebugUtilsMessageTypeFlagBitsEXT::eValidation ) | - VkFlags( DebugUtilsMessageTypeFlagBitsEXT::ePerformance ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageTypeFlagsEXT operator|( DebugUtilsMessageTypeFlagBitsEXT bit0, - DebugUtilsMessageTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageTypeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageTypeFlagsEXT operator&( DebugUtilsMessageTypeFlagBitsEXT bit0, - DebugUtilsMessageTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageTypeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageTypeFlagsEXT operator^( DebugUtilsMessageTypeFlagBitsEXT bit0, - DebugUtilsMessageTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return DebugUtilsMessageTypeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DebugUtilsMessageTypeFlagsEXT operator~( DebugUtilsMessageTypeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DebugUtilsMessageTypeFlagsEXT( bits ) ); - } - - using DebugUtilsMessengerCallbackDataFlagsEXT = Flags; - - using DebugUtilsMessengerCreateFlagsEXT = Flags; - - //=== VK_NV_fragment_coverage_to_color === - - using PipelineCoverageToColorStateCreateFlagsNV = Flags; - - //=== VK_KHR_acceleration_structure === - - using GeometryFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( GeometryFlagBitsKHR::eOpaque ) | VkFlags( GeometryFlagBitsKHR::eNoDuplicateAnyHitInvocation ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryFlagsKHR operator|( GeometryFlagBitsKHR bit0, GeometryFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryFlagsKHR operator&( GeometryFlagBitsKHR bit0, GeometryFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryFlagsKHR operator^( GeometryFlagBitsKHR bit0, GeometryFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryFlagsKHR operator~( GeometryFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( GeometryFlagsKHR( bits ) ); - } - - using GeometryFlagsNV = GeometryFlagsKHR; - - using GeometryInstanceFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( GeometryInstanceFlagBitsKHR::eTriangleFacingCullDisable ) | VkFlags( GeometryInstanceFlagBitsKHR::eTriangleFlipFacing ) | - VkFlags( GeometryInstanceFlagBitsKHR::eForceOpaque ) | VkFlags( GeometryInstanceFlagBitsKHR::eForceNoOpaque ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryInstanceFlagsKHR operator|( GeometryInstanceFlagBitsKHR bit0, - GeometryInstanceFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryInstanceFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryInstanceFlagsKHR operator&( GeometryInstanceFlagBitsKHR bit0, - GeometryInstanceFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryInstanceFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryInstanceFlagsKHR operator^( GeometryInstanceFlagBitsKHR bit0, - GeometryInstanceFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return GeometryInstanceFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GeometryInstanceFlagsKHR operator~( GeometryInstanceFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( GeometryInstanceFlagsKHR( bits ) ); - } - - using GeometryInstanceFlagsNV = GeometryInstanceFlagsKHR; - - using BuildAccelerationStructureFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( BuildAccelerationStructureFlagBitsKHR::eAllowUpdate ) | VkFlags( BuildAccelerationStructureFlagBitsKHR::eAllowCompaction ) | - VkFlags( BuildAccelerationStructureFlagBitsKHR::ePreferFastTrace ) | VkFlags( BuildAccelerationStructureFlagBitsKHR::ePreferFastBuild ) | - VkFlags( BuildAccelerationStructureFlagBitsKHR::eLowMemory ) | VkFlags( BuildAccelerationStructureFlagBitsKHR::eMotionNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BuildAccelerationStructureFlagsKHR operator|( BuildAccelerationStructureFlagBitsKHR bit0, - BuildAccelerationStructureFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return BuildAccelerationStructureFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BuildAccelerationStructureFlagsKHR operator&( BuildAccelerationStructureFlagBitsKHR bit0, - BuildAccelerationStructureFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return BuildAccelerationStructureFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BuildAccelerationStructureFlagsKHR operator^( BuildAccelerationStructureFlagBitsKHR bit0, - BuildAccelerationStructureFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return BuildAccelerationStructureFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR BuildAccelerationStructureFlagsKHR operator~( BuildAccelerationStructureFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( BuildAccelerationStructureFlagsKHR( bits ) ); - } - - using BuildAccelerationStructureFlagsNV = BuildAccelerationStructureFlagsKHR; - - using AccelerationStructureCreateFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( AccelerationStructureCreateFlagBitsKHR::eDeviceAddressCaptureReplay ) | VkFlags( AccelerationStructureCreateFlagBitsKHR::eMotionNV ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccelerationStructureCreateFlagsKHR operator|( AccelerationStructureCreateFlagBitsKHR bit0, - AccelerationStructureCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccelerationStructureCreateFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccelerationStructureCreateFlagsKHR operator&( AccelerationStructureCreateFlagBitsKHR bit0, - AccelerationStructureCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccelerationStructureCreateFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccelerationStructureCreateFlagsKHR operator^( AccelerationStructureCreateFlagBitsKHR bit0, - AccelerationStructureCreateFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return AccelerationStructureCreateFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR AccelerationStructureCreateFlagsKHR operator~( AccelerationStructureCreateFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( AccelerationStructureCreateFlagsKHR( bits ) ); - } - - //=== VK_NV_framebuffer_mixed_samples === - - using PipelineCoverageModulationStateCreateFlagsNV = Flags; - - //=== VK_EXT_validation_cache === - - using ValidationCacheCreateFlagsEXT = Flags; - - //=== VK_AMD_pipeline_compiler_control === - - using PipelineCompilerControlFlagsAMD = Flags; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - using ImagePipeSurfaceCreateFlagsFUCHSIA = Flags; - -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - using MetalSurfaceCreateFlagsEXT = Flags; - -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_AMD_shader_core_properties2 === - - using ShaderCorePropertiesFlagsAMD = Flags; - - //=== VK_NV_coverage_reduction_mode === - - using PipelineCoverageReductionStateCreateFlagsNV = Flags; - - //=== VK_EXT_headless_surface === - - using HeadlessSurfaceCreateFlagsEXT = Flags; - - //=== VK_NV_device_generated_commands === - - using IndirectStateFlagsNV = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( IndirectStateFlagBitsNV::eFlagFrontface ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectStateFlagsNV operator|( IndirectStateFlagBitsNV bit0, IndirectStateFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectStateFlagsNV( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectStateFlagsNV operator&( IndirectStateFlagBitsNV bit0, IndirectStateFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectStateFlagsNV( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectStateFlagsNV operator^( IndirectStateFlagBitsNV bit0, IndirectStateFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectStateFlagsNV( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectStateFlagsNV operator~( IndirectStateFlagBitsNV bits ) VULKAN_HPP_NOEXCEPT - { - return ~( IndirectStateFlagsNV( bits ) ); - } - - using IndirectCommandsLayoutUsageFlagsNV = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( IndirectCommandsLayoutUsageFlagBitsNV::eExplicitPreprocess ) | VkFlags( IndirectCommandsLayoutUsageFlagBitsNV::eIndexedSequences ) | - VkFlags( IndirectCommandsLayoutUsageFlagBitsNV::eUnorderedSequences ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutUsageFlagsNV operator|( IndirectCommandsLayoutUsageFlagBitsNV bit0, - IndirectCommandsLayoutUsageFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectCommandsLayoutUsageFlagsNV( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutUsageFlagsNV operator&( IndirectCommandsLayoutUsageFlagBitsNV bit0, - IndirectCommandsLayoutUsageFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectCommandsLayoutUsageFlagsNV( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutUsageFlagsNV operator^( IndirectCommandsLayoutUsageFlagBitsNV bit0, - IndirectCommandsLayoutUsageFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return IndirectCommandsLayoutUsageFlagsNV( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutUsageFlagsNV operator~( IndirectCommandsLayoutUsageFlagBitsNV bits ) VULKAN_HPP_NOEXCEPT - { - return ~( IndirectCommandsLayoutUsageFlagsNV( bits ) ); - } - - //=== VK_EXT_device_memory_report === - - using DeviceMemoryReportFlagsEXT = Flags; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - using VideoEncodeFlagsKHR = Flags; - - using VideoEncodeCapabilityFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeCapabilityFlagsKHR operator|( VideoEncodeCapabilityFlagBitsKHR bit0, - VideoEncodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeCapabilityFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeCapabilityFlagsKHR operator&( VideoEncodeCapabilityFlagBitsKHR bit0, - VideoEncodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeCapabilityFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeCapabilityFlagsKHR operator^( VideoEncodeCapabilityFlagBitsKHR bit0, - VideoEncodeCapabilityFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeCapabilityFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeCapabilityFlagsKHR operator~( VideoEncodeCapabilityFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeCapabilityFlagsKHR( bits ) ); - } - - using VideoEncodeUsageFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeUsageFlagBitsKHR::eDefault ) | VkFlags( VideoEncodeUsageFlagBitsKHR::eTranscoding ) | - VkFlags( VideoEncodeUsageFlagBitsKHR::eStreaming ) | VkFlags( VideoEncodeUsageFlagBitsKHR::eRecording ) | - VkFlags( VideoEncodeUsageFlagBitsKHR::eConferencing ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeUsageFlagsKHR operator|( VideoEncodeUsageFlagBitsKHR bit0, - VideoEncodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeUsageFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeUsageFlagsKHR operator&( VideoEncodeUsageFlagBitsKHR bit0, - VideoEncodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeUsageFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeUsageFlagsKHR operator^( VideoEncodeUsageFlagBitsKHR bit0, - VideoEncodeUsageFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeUsageFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeUsageFlagsKHR operator~( VideoEncodeUsageFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeUsageFlagsKHR( bits ) ); - } - - using VideoEncodeContentFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeContentFlagBitsKHR::eDefault ) | VkFlags( VideoEncodeContentFlagBitsKHR::eCamera ) | - VkFlags( VideoEncodeContentFlagBitsKHR::eDesktop ) | VkFlags( VideoEncodeContentFlagBitsKHR::eRendered ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeContentFlagsKHR operator|( VideoEncodeContentFlagBitsKHR bit0, - VideoEncodeContentFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeContentFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeContentFlagsKHR operator&( VideoEncodeContentFlagBitsKHR bit0, - VideoEncodeContentFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeContentFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeContentFlagsKHR operator^( VideoEncodeContentFlagBitsKHR bit0, - VideoEncodeContentFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeContentFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeContentFlagsKHR operator~( VideoEncodeContentFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeContentFlagsKHR( bits ) ); - } - - using VideoEncodeRateControlFlagsKHR = Flags; - - using VideoEncodeRateControlModeFlagsKHR = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( VideoEncodeRateControlModeFlagBitsKHR::eNone ) | VkFlags( VideoEncodeRateControlModeFlagBitsKHR::eCbr ) | - VkFlags( VideoEncodeRateControlModeFlagBitsKHR::eVbr ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeRateControlModeFlagsKHR operator|( VideoEncodeRateControlModeFlagBitsKHR bit0, - VideoEncodeRateControlModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeRateControlModeFlagsKHR( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeRateControlModeFlagsKHR operator&( VideoEncodeRateControlModeFlagBitsKHR bit0, - VideoEncodeRateControlModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeRateControlModeFlagsKHR( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeRateControlModeFlagsKHR operator^( VideoEncodeRateControlModeFlagBitsKHR bit0, - VideoEncodeRateControlModeFlagBitsKHR bit1 ) VULKAN_HPP_NOEXCEPT - { - return VideoEncodeRateControlModeFlagsKHR( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR VideoEncodeRateControlModeFlagsKHR operator~( VideoEncodeRateControlModeFlagBitsKHR bits ) VULKAN_HPP_NOEXCEPT - { - return ~( VideoEncodeRateControlModeFlagsKHR( bits ) ); - } - -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - - using DeviceDiagnosticsConfigFlagsNV = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderDebugInfo ) | VkFlags( DeviceDiagnosticsConfigFlagBitsNV::eEnableResourceTracking ) | - VkFlags( DeviceDiagnosticsConfigFlagBitsNV::eEnableAutomaticCheckpoints ) | - VkFlags( DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderErrorReporting ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigFlagsNV operator|( DeviceDiagnosticsConfigFlagBitsNV bit0, - DeviceDiagnosticsConfigFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceDiagnosticsConfigFlagsNV( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigFlagsNV operator&( DeviceDiagnosticsConfigFlagBitsNV bit0, - DeviceDiagnosticsConfigFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceDiagnosticsConfigFlagsNV( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigFlagsNV operator^( DeviceDiagnosticsConfigFlagBitsNV bit0, - DeviceDiagnosticsConfigFlagBitsNV bit1 ) VULKAN_HPP_NOEXCEPT - { - return DeviceDiagnosticsConfigFlagsNV( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigFlagsNV operator~( DeviceDiagnosticsConfigFlagBitsNV bits ) VULKAN_HPP_NOEXCEPT - { - return ~( DeviceDiagnosticsConfigFlagsNV( bits ) ); - } - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - using ExportMetalObjectTypeFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalDevice ) | VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalCommandQueue ) | - VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalBuffer ) | VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalTexture ) | - VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalIosurface ) | VkFlags( ExportMetalObjectTypeFlagBitsEXT::eMetalSharedEvent ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExportMetalObjectTypeFlagsEXT operator|( ExportMetalObjectTypeFlagBitsEXT bit0, - ExportMetalObjectTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExportMetalObjectTypeFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExportMetalObjectTypeFlagsEXT operator&( ExportMetalObjectTypeFlagBitsEXT bit0, - ExportMetalObjectTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExportMetalObjectTypeFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExportMetalObjectTypeFlagsEXT operator^( ExportMetalObjectTypeFlagBitsEXT bit0, - ExportMetalObjectTypeFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ExportMetalObjectTypeFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ExportMetalObjectTypeFlagsEXT operator~( ExportMetalObjectTypeFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ExportMetalObjectTypeFlagsEXT( bits ) ); - } - -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_graphics_pipeline_library === - - using GraphicsPipelineLibraryFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( GraphicsPipelineLibraryFlagBitsEXT::eVertexInputInterface ) | - VkFlags( GraphicsPipelineLibraryFlagBitsEXT::ePreRasterizationShaders ) | VkFlags( GraphicsPipelineLibraryFlagBitsEXT::eFragmentShader ) | - VkFlags( GraphicsPipelineLibraryFlagBitsEXT::eFragmentOutputInterface ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryFlagsEXT operator|( GraphicsPipelineLibraryFlagBitsEXT bit0, - GraphicsPipelineLibraryFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return GraphicsPipelineLibraryFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryFlagsEXT operator&( GraphicsPipelineLibraryFlagBitsEXT bit0, - GraphicsPipelineLibraryFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return GraphicsPipelineLibraryFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryFlagsEXT operator^( GraphicsPipelineLibraryFlagBitsEXT bit0, - GraphicsPipelineLibraryFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return GraphicsPipelineLibraryFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryFlagsEXT operator~( GraphicsPipelineLibraryFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( GraphicsPipelineLibraryFlagsEXT( bits ) ); - } - - //=== VK_NV_ray_tracing_motion_blur === - - using AccelerationStructureMotionInfoFlagsNV = Flags; - - using AccelerationStructureMotionInstanceFlagsNV = Flags; - - //=== VK_EXT_image_compression_control === - - using ImageCompressionFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageCompressionFlagBitsEXT::eDefault ) | VkFlags( ImageCompressionFlagBitsEXT::eFixedRateDefault ) | - VkFlags( ImageCompressionFlagBitsEXT::eFixedRateExplicit ) | VkFlags( ImageCompressionFlagBitsEXT::eDisabled ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFlagsEXT operator|( ImageCompressionFlagBitsEXT bit0, - ImageCompressionFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFlagsEXT operator&( ImageCompressionFlagBitsEXT bit0, - ImageCompressionFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFlagsEXT operator^( ImageCompressionFlagBitsEXT bit0, - ImageCompressionFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFlagsEXT operator~( ImageCompressionFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageCompressionFlagsEXT( bits ) ); - } - - using ImageCompressionFixedRateFlagsEXT = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageCompressionFixedRateFlagBitsEXT::eNone ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e1Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e2Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e3Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e4Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e5Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e6Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e7Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e8Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e9Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e10Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e11Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e12Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e13Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e14Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e15Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e16Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e17Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e18Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e19Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e20Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e21Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e22Bpc ) | VkFlags( ImageCompressionFixedRateFlagBitsEXT::e23Bpc ) | - VkFlags( ImageCompressionFixedRateFlagBitsEXT::e24Bpc ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFixedRateFlagsEXT operator|( ImageCompressionFixedRateFlagBitsEXT bit0, - ImageCompressionFixedRateFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFixedRateFlagsEXT( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFixedRateFlagsEXT operator&( ImageCompressionFixedRateFlagBitsEXT bit0, - ImageCompressionFixedRateFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFixedRateFlagsEXT( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFixedRateFlagsEXT operator^( ImageCompressionFixedRateFlagBitsEXT bit0, - ImageCompressionFixedRateFlagBitsEXT bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageCompressionFixedRateFlagsEXT( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageCompressionFixedRateFlagsEXT operator~( ImageCompressionFixedRateFlagBitsEXT bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageCompressionFixedRateFlagsEXT( bits ) ); - } - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - using DirectFBSurfaceCreateFlagsEXT = Flags; - -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - using ImageFormatConstraintsFlagsFUCHSIA = Flags; - - using ImageConstraintsInfoFlagsFUCHSIA = Flags; - - template <> - struct FlagTraits - { - enum : VkFlags - { - allFlags = VkFlags( ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadRarely ) | VkFlags( ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadOften ) | - VkFlags( ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteRarely ) | VkFlags( ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteOften ) | - VkFlags( ImageConstraintsInfoFlagBitsFUCHSIA::eProtectedOptional ) - }; - }; - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFlagsFUCHSIA operator|( ImageConstraintsInfoFlagBitsFUCHSIA bit0, - ImageConstraintsInfoFlagBitsFUCHSIA bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageConstraintsInfoFlagsFUCHSIA( bit0 ) | bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFlagsFUCHSIA operator&( ImageConstraintsInfoFlagBitsFUCHSIA bit0, - ImageConstraintsInfoFlagBitsFUCHSIA bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageConstraintsInfoFlagsFUCHSIA( bit0 ) & bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFlagsFUCHSIA operator^( ImageConstraintsInfoFlagBitsFUCHSIA bit0, - ImageConstraintsInfoFlagBitsFUCHSIA bit1 ) VULKAN_HPP_NOEXCEPT - { - return ImageConstraintsInfoFlagsFUCHSIA( bit0 ) ^ bit1; - } - - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFlagsFUCHSIA operator~( ImageConstraintsInfoFlagBitsFUCHSIA bits ) VULKAN_HPP_NOEXCEPT - { - return ~( ImageConstraintsInfoFlagsFUCHSIA( bits ) ); - } - -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - using ScreenSurfaceCreateFlagsQNX = Flags; - -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_format_traits.hpp b/src/video/khronos/vulkan/vulkan_format_traits.hpp deleted file mode 100644 index ac4250a6a5bac..0000000000000 --- a/src/video/khronos/vulkan/vulkan_format_traits.hpp +++ /dev/null @@ -1,7333 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_FORMAT_TRAITS_HPP -#define VULKAN_FORMAT_TRAITS_HPP - -#include - -namespace VULKAN_HPP_NAMESPACE -{ - //===================== - //=== Format Traits === - //===================== - - // The texel block size in bytes. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t blockSize( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: return 12; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: return 12; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: return 12; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: return 24; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: return 24; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: return 24; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: return 32; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: return 32; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: return 32; - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: return 5; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: return 8; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return 8; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: return 8; - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: return 8; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 6; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: return 6; - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 8; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 8; - - default: VULKAN_HPP_ASSERT( false ); return 0; - } - } - - // The number of texels in a texel block. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t texelsPerBlock( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: return 20; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: return 20; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: return 25; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: return 25; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: return 30; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: return 30; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: return 36; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: return 36; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: return 40; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: return 40; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: return 48; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: return 48; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: return 64; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: return 64; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: return 50; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: return 50; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: return 60; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: return 60; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: return 80; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: return 80; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: return 100; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: return 100; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: return 120; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: return 120; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: return 144; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: return 144; - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: return 16; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: return 20; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: return 25; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: return 30; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: return 36; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: return 40; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: return 48; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: return 64; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: return 50; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: return 60; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: return 80; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 100; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 120; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 144; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 1; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 1; - - default: VULKAN_HPP_ASSERT( false ); return 0; - } - } - - // The three-dimensional extent of a texel block. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 std::array blockExtent( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: return { { 5, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: return { { 5, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: return { { 5, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: return { { 5, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: return { { 6, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: return { { 6, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: return { { 6, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: return { { 6, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: return { { 8, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: return { { 8, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: return { { 8, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: return { { 8, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: return { { 8, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: return { { 8, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: return { { 10, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: return { { 10, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: return { { 10, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: return { { 10, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: return { { 10, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: return { { 10, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: return { { 10, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: return { { 10, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: return { { 12, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: return { { 12, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: return { { 12, 12, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: return { { 12, 12, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: return { { 2, 1, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: return { { 5, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: return { { 5, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: return { { 6, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: return { { 6, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: return { { 8, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: return { { 8, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: return { { 8, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: return { { 10, 5, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: return { { 10, 6, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: return { { 10, 8, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return { { 10, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return { { 12, 10, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return { { 12, 12, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return { { 8, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return { { 8, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: return { { 8, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return { { 4, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return { { 8, 4, 1 } }; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return { { 4, 4, 1 } }; - - default: return { { 1, 1, 1 } }; - } - } - - // A textual description of the compression scheme, or an empty string if it is not compressed - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 char const * compressionScheme( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: return "BC"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: return "ETC2"; - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: return "EAC"; - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: return "EAC"; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: return "EAC"; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: return "EAC"; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: return "ASTC LDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return "ASTC HDR"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return "PVRTC"; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return "PVRTC"; - - default: return ""; - } - } - - // True, if this format is a compressed one. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 bool isCompressed( VULKAN_HPP_NAMESPACE::Format format ) - { - return ( *VULKAN_HPP_NAMESPACE::compressionScheme( format ) != 0 ); - } - - // The number of bits into which the format is packed. A single image element in this format - // can be stored in the same space as a scalar type of this bit width. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t packed( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: return 8; - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: return 32; - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: return 16; - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: return 16; - - default: return 0; - } - } - - // True, if the components of this format are compressed, otherwise false. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 bool componentsAreCompressed( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return true; - default: return false; - } - } - - // The number of bits in this component, if not compressed, otherwise 0. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t componentBits( VULKAN_HPP_NAMESPACE::Format format, uint8_t component ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: - switch ( component ) - { - case 0: return 4; - case 1: return 4; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: - switch ( component ) - { - case 0: return 4; - case 1: return 4; - case 2: return 4; - case 3: return 4; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: - switch ( component ) - { - case 0: return 4; - case 1: return 4; - case 2: return 4; - case 3: return 4; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: - switch ( component ) - { - case 0: return 5; - case 1: return 6; - case 2: return 5; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: - switch ( component ) - { - case 0: return 5; - case 1: return 6; - case 2: return 5; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: - switch ( component ) - { - case 0: return 5; - case 1: return 5; - case 2: return 5; - case 3: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: - switch ( component ) - { - case 0: return 5; - case 1: return 5; - case 2: return 5; - case 3: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: - switch ( component ) - { - case 0: return 1; - case 1: return 5; - case 2: return 5; - case 3: return 5; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: - switch ( component ) - { - case 0: return 2; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: - switch ( component ) - { - case 0: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: - switch ( component ) - { - case 0: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: - switch ( component ) - { - case 0: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - case 3: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - case 3: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: - switch ( component ) - { - case 0: return 32; - case 1: return 32; - case 2: return 32; - case 3: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: - switch ( component ) - { - case 0: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: - switch ( component ) - { - case 0: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: - switch ( component ) - { - case 0: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - case 3: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - case 3: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: - switch ( component ) - { - case 0: return 64; - case 1: return 64; - case 2: return 64; - case 3: return 64; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: - switch ( component ) - { - case 0: return 10; - case 1: return 11; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: - switch ( component ) - { - case 0: return 9; - case 1: return 9; - case 2: return 9; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: - switch ( component ) - { - case 0: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: - switch ( component ) - { - case 0: return 24; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: - switch ( component ) - { - case 0: return 32; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: - switch ( component ) - { - case 0: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: - switch ( component ) - { - case 0: return 16; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: - switch ( component ) - { - case 0: return 24; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: - switch ( component ) - { - case 0: return 32; - case 1: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: - switch ( component ) - { - case 0: return 11; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: - switch ( component ) - { - case 0: return 11; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: - switch ( component ) - { - case 0: return 11; - case 1: return 11; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: - switch ( component ) - { - case 0: return 11; - case 1: return 11; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - case 3: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: - switch ( component ) - { - case 0: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - case 3: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: - switch ( component ) - { - case 0: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - case 3: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - case 3: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - case 3: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - case 3: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( component ) - { - case 0: return 8; - case 1: return 8; - case 2: return 8; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 10; - case 1: return 10; - case 2: return 10; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 12; - case 1: return 12; - case 2: return 12; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( component ) - { - case 0: return 16; - case 1: return 16; - case 2: return 16; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: - switch ( component ) - { - case 0: return 4; - case 1: return 4; - case 2: return 4; - case 3: return 4; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: - switch ( component ) - { - case 0: return 4; - case 1: return 4; - case 2: return 4; - case 3: return 4; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - - default: return 0; - } - } - - // The number of components of this format. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t componentCount( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: return 4; - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: return 3; - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: return 3; - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: return 1; - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: return 1; - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: return 1; - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: return 2; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: return 1; - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: return 1; - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: return 2; - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: return 2; - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: return 3; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: return 1; - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: return 1; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: return 2; - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: return 2; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: return 1; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: return 4; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: return 4; - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: return 4; - - default: return 0; - } - } - - // The name of the component - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 char const * componentName( VULKAN_HPP_NAMESPACE::Format format, uint8_t component ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: - switch ( component ) - { - case 0: return "B"; - case 1: return "R"; - case 2: return "G"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: - switch ( component ) - { - case 0: return "D"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: - switch ( component ) - { - case 0: return "D"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: - switch ( component ) - { - case 0: return "D"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: - switch ( component ) - { - case 0: return "S"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: - switch ( component ) - { - case 0: return "D"; - case 1: return "S"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: - switch ( component ) - { - case 0: return "D"; - case 1: return "S"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: - switch ( component ) - { - case 0: return "D"; - case 1: return "S"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: - switch ( component ) - { - case 0: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: - switch ( component ) - { - case 0: return "B"; - case 1: return "G"; - case 2: return "R"; - case 3: return "G"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( component ) - { - case 0: return "G"; - case 1: return "B"; - case 2: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: - switch ( component ) - { - case 0: return "A"; - case 1: return "R"; - case 2: return "G"; - case 3: return "B"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: - switch ( component ) - { - case 0: return "A"; - case 1: return "B"; - case 2: return "G"; - case 3: return "R"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "R"; - case 1: return "G"; - case 2: return "B"; - case 3: return "A"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - - default: return ""; - } - } - - // The numeric format of the component - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 char const * componentNumericFormat( VULKAN_HPP_NAMESPACE::Format format, uint8_t component ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eR4G4UnormPack8: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR4G4B4A4UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB4G4R4A4UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G6B5UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G6R5UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR5G5B5A1UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB5G5R5A1UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA1R5G5B5UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Uint: - switch ( component ) - { - case 0: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Sint: - switch ( component ) - { - case 0: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR8G8B8A8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8A8Srgb: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UnormPack32: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SnormPack32: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UscaledPack32: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SscaledPack32: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8UintPack32: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SintPack32: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA8B8G8R8SrgbPack32: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UnormPack32: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SnormPack32: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UscaledPack32: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SscaledPack32: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10UintPack32: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2R10G10B10SintPack32: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UnormPack32: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SnormPack32: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UscaledPack32: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SscaledPack32: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10UintPack32: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA2B10G10R10SintPack32: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Unorm: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Snorm: - switch ( component ) - { - case 0: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Uint: - switch ( component ) - { - case 0: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sint: - switch ( component ) - { - case 0: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Snorm: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - case 2: return "SNORM"; - case 3: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uscaled: - switch ( component ) - { - case 0: return "USCALED"; - case 1: return "USCALED"; - case 2: return "USCALED"; - case 3: return "USCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sscaled: - switch ( component ) - { - case 0: return "SSCALED"; - case 1: return "SSCALED"; - case 2: return "SSCALED"; - case 3: return "SSCALED"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR16G16B16A16Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Uint: - switch ( component ) - { - case 0: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sint: - switch ( component ) - { - case 0: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR32G32B32A32Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Uint: - switch ( component ) - { - case 0: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sint: - switch ( component ) - { - case 0: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Uint: - switch ( component ) - { - case 0: return "UINT"; - case 1: return "UINT"; - case 2: return "UINT"; - case 3: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sint: - switch ( component ) - { - case 0: return "SINT"; - case 1: return "SINT"; - case 2: return "SINT"; - case 3: return "SINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR64G64B64A64Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB10G11R11UfloatPack32: - switch ( component ) - { - case 0: return "UFLOAT"; - case 1: return "UFLOAT"; - case 2: return "UFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eE5B9G9R9UfloatPack32: - switch ( component ) - { - case 0: return "UFLOAT"; - case 1: return "UFLOAT"; - case 2: return "UFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD16Unorm: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eX8D24UnormPack32: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD32Sfloat: - switch ( component ) - { - case 0: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eS8Uint: - switch ( component ) - { - case 0: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD16UnormS8Uint: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD24UnormS8Uint: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eD32SfloatS8Uint: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "UINT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbUnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbSrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaUnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc1RgbaSrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc2UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc2SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc3UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc3SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc4UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc4SnormBlock: - switch ( component ) - { - case 0: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc5UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc5SnormBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc6HUfloatBlock: - switch ( component ) - { - case 0: return "UFLOAT"; - case 1: return "UFLOAT"; - case 2: return "UFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc6HSfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc7UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eBc7SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A1SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEtc2R8G8B8A8SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11SnormBlock: - switch ( component ) - { - case 0: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eEacR11G11SnormBlock: - switch ( component ) - { - case 0: return "SNORM"; - case 1: return "SNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12UnormBlock: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SrgbBlock: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8G8R8422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB8G8R8G8422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16G16R16422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eB16G16R16G16422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA4R4G4B4UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eA4B4G4R4UnormPack16: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc4x4SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x4SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc5x5SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x5SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc6x6SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x5SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x6SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc8x8SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x5SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x6SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x8SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc10x10SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x10SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::eAstc12x12SfloatBlock: - switch ( component ) - { - case 0: return "SFLOAT"; - case 1: return "SFLOAT"; - case 2: return "SFLOAT"; - case 3: return "SFLOAT"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppUnormBlockIMG: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppUnormBlockIMG: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppUnormBlockIMG: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppUnormBlockIMG: - switch ( component ) - { - case 0: return "UNORM"; - case 1: return "UNORM"; - case 2: return "UNORM"; - case 3: return "UNORM"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc12BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc14BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc22BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - case VULKAN_HPP_NAMESPACE::Format::ePvrtc24BppSrgbBlockIMG: - switch ( component ) - { - case 0: return "SRGB"; - case 1: return "SRGB"; - case 2: return "SRGB"; - case 3: return "SRGB"; - default: VULKAN_HPP_ASSERT( false ); return ""; - } - - default: return ""; - } - } - - // The plane this component lies in. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t componentPlaneIndex( VULKAN_HPP_NAMESPACE::Format format, uint8_t component ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( component ) - { - case 0: return 0; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 0; - } - - default: return 0; - } - } - - // The number of image planes of this format. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t planeCount( VULKAN_HPP_NAMESPACE::Format format ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: return 3; - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return 2; - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: return 2; - - default: return 1; - } - } - - // The single-plane format that this plane is compatible with. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 VULKAN_HPP_NAMESPACE::Format planeCompatibleFormat( VULKAN_HPP_NAMESPACE::Format format, uint8_t plane ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 2: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR8Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR8G8Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR10X6UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR10X6G10X6Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR12X4UnormPack16; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR12X4G12X4Unorm2Pack16; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( plane ) - { - case 0: return VULKAN_HPP_NAMESPACE::Format::eR16Unorm; - case 1: return VULKAN_HPP_NAMESPACE::Format::eR16G16Unorm; - default: VULKAN_HPP_ASSERT( false ); return VULKAN_HPP_NAMESPACE::Format::eUndefined; - } - - default: VULKAN_HPP_ASSERT( plane == 0 ); return format; - } - } - - // The relative height of this plane. A value of k means that this plane is 1/k the height of the overall format. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t planeHeightDivisor( VULKAN_HPP_NAMESPACE::Format format, uint8_t plane ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - - default: VULKAN_HPP_ASSERT( plane == 0 ); return 1; - } - } - - // The relative width of this plane. A value of k means that this plane is 1/k the width of the overall format. - VULKAN_HPP_INLINE VULKAN_HPP_CONSTEXPR_14 uint8_t planeWidthDivisor( VULKAN_HPP_NAMESPACE::Format format, uint8_t plane ) - { - switch ( format ) - { - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R83Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane420Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - case 2: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane422Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 2; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R163Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - case 2: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG8B8R82Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - case VULKAN_HPP_NAMESPACE::Format::eG16B16R162Plane444Unorm: - switch ( plane ) - { - case 0: return 1; - case 1: return 1; - default: VULKAN_HPP_ASSERT( false ); return 1; - } - - default: VULKAN_HPP_ASSERT( plane == 0 ); return 1; - } - } - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_fuchsia.h b/src/video/khronos/vulkan/vulkan_fuchsia.h index 61774ff9cb718..f60907d10b430 100644 --- a/src/video/khronos/vulkan/vulkan_fuchsia.h +++ b/src/video/khronos/vulkan/vulkan_fuchsia.h @@ -2,7 +2,7 @@ #define VULKAN_FUCHSIA_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_FUCHSIA_imagepipe_surface is a preprocessor guard. Do not pass it to API calls. #define VK_FUCHSIA_imagepipe_surface 1 #define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1 #define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface" @@ -41,6 +42,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA( #endif +// VK_FUCHSIA_external_memory is a preprocessor guard. Do not pass it to API calls. #define VK_FUCHSIA_external_memory 1 #define VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION 1 #define VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME "VK_FUCHSIA_external_memory" @@ -81,6 +83,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA( #endif +// VK_FUCHSIA_external_semaphore is a preprocessor guard. Do not pass it to API calls. #define VK_FUCHSIA_external_semaphore 1 #define VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 #define VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_FUCHSIA_external_semaphore" @@ -115,6 +118,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA( #endif +// VK_FUCHSIA_buffer_collection is a preprocessor guard. Do not pass it to API calls. #define VK_FUCHSIA_buffer_collection 1 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA) #define VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION 2 diff --git a/src/video/khronos/vulkan/vulkan_funcs.hpp b/src/video/khronos/vulkan/vulkan_funcs.hpp deleted file mode 100644 index 0d8749f9f196b..0000000000000 --- a/src/video/khronos/vulkan/vulkan_funcs.hpp +++ /dev/null @@ -1,20008 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_FUNCS_HPP -#define VULKAN_FUNCS_HPP - -namespace VULKAN_HPP_NAMESPACE -{ - //=========================== - //=== COMMAND Definitions === - //=========================== - - //=== VK_VERSION_1_0 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result createInstance( const VULKAN_HPP_NAMESPACE::InstanceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Instance * pInstance, - Dispatch const & d ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateInstance( reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pInstance ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type createInstance( - const VULKAN_HPP_NAMESPACE::InstanceCreateInfo & createInfo, Optional allocator, Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Instance instance; - VkResult result = - d.vkCreateInstance( reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &instance ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::createInstance" ); - - return createResultValueType( static_cast( result ), instance ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type createInstanceUnique( - const VULKAN_HPP_NAMESPACE::InstanceCreateInfo & createInfo, Optional allocator, Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Instance instance; - VkResult result = - d.vkCreateInstance( reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &instance ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::createInstanceUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( instance, ObjectDestroy( allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroy( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyInstance( m_instance, reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroy( Optional allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyInstance( m_instance, - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::enumeratePhysicalDevices( uint32_t * pPhysicalDeviceCount, - VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumeratePhysicalDevices( m_instance, pPhysicalDeviceCount, reinterpret_cast( pPhysicalDevices ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::enumeratePhysicalDevices( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDevices; - uint32_t physicalDeviceCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceCount ) - { - physicalDevices.resize( physicalDeviceCount ); - result = d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDevices" ); - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); - if ( physicalDeviceCount < physicalDevices.size() ) - { - physicalDevices.resize( physicalDeviceCount ); - } - return createResultValueType( static_cast( result ), physicalDevices ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDevices( physicalDeviceAllocator ); - uint32_t physicalDeviceCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceCount ) - { - physicalDevices.resize( physicalDeviceCount ); - result = d.vkEnumeratePhysicalDevices( m_instance, &physicalDeviceCount, reinterpret_cast( physicalDevices.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDevices" ); - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); - if ( physicalDeviceCount < physicalDevices.size() ) - { - physicalDevices.resize( physicalDeviceCount ); - } - return createResultValueType( static_cast( result ), physicalDevices ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFeatures( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pFeatures, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( pFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures - PhysicalDevice::getFeatures( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures features; - d.vkGetPhysicalDeviceFeatures( m_physicalDevice, reinterpret_cast( &features ) ); - - return features; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties * pFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties - PhysicalDevice::getFormatProperties( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::FormatProperties formatProperties; - d.vkGetPhysicalDeviceFormatProperties( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ImageFormatProperties * pImageFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - reinterpret_cast( pImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties; - VkResult result = d.vkGetPhysicalDeviceImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties" ); - - return createResultValueType( static_cast( result ), imageFormatProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getProperties( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties - PhysicalDevice::getProperties( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties properties; - d.vkGetPhysicalDeviceProperties( m_physicalDevice, reinterpret_cast( &properties ) ); - - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties * pQueueFamilyProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceQueueFamilyProperties( - m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties( QueueFamilyPropertiesAllocator & queueFamilyPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties( queueFamilyPropertiesAllocator ); - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties * pMemoryProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties - PhysicalDevice::getMemoryProperties( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties memoryProperties; - d.vkGetPhysicalDeviceMemoryProperties( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const char * pName, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetInstanceProcAddr( m_instance, pName ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const std::string & name, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - PFN_vkVoidFunction result = d.vkGetInstanceProcAddr( m_instance, name.c_str() ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const char * pName, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetDeviceProcAddr( m_device, pName ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const std::string & name, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - PFN_vkVoidFunction result = d.vkGetDeviceProcAddr( m_device, name.c_str() ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::createDevice( const VULKAN_HPP_NAMESPACE::DeviceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Device * pDevice, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDevice( m_physicalDevice, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pDevice ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type PhysicalDevice::createDevice( - const VULKAN_HPP_NAMESPACE::DeviceCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Device device; - VkResult result = - d.vkCreateDevice( m_physicalDevice, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &device ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::createDevice" ); - - return createResultValueType( static_cast( result ), device ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::createDeviceUnique( const VULKAN_HPP_NAMESPACE::DeviceCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Device device; - VkResult result = - d.vkCreateDevice( m_physicalDevice, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &device ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::createDeviceUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( device, ObjectDestroy( allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDevice( m_device, reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( Optional allocator, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDevice( m_device, - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result enumerateInstanceExtensionProperties( const char * pLayerName, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::ExtensionProperties * pProperties, - Dispatch const & d ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkEnumerateInstanceExtensionProperties( pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - enumerateInstanceExtensionProperties( Optional layerName, Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateInstanceExtensionProperties( - layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::enumerateInstanceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - enumerateInstanceExtensionProperties( Optional layerName, - ExtensionPropertiesAllocator & extensionPropertiesAllocator, - Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( extensionPropertiesAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateInstanceExtensionProperties( - layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::enumerateInstanceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceExtensionProperties( const char * pLayerName, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::ExtensionProperties * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, pLayerName, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateDeviceExtensionProperties( - m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName, - ExtensionPropertiesAllocator & extensionPropertiesAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( extensionPropertiesAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateDeviceExtensionProperties( m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateDeviceExtensionProperties( - m_physicalDevice, layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result enumerateInstanceLayerProperties( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::LayerProperties * pProperties, - Dispatch const & d ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumerateInstanceLayerProperties( pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - enumerateInstanceLayerProperties( Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateInstanceLayerProperties( &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::enumerateInstanceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - enumerateInstanceLayerProperties( LayerPropertiesAllocator & layerPropertiesAllocator, Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( layerPropertiesAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateInstanceLayerProperties( &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::enumerateInstanceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::enumerateDeviceLayerProperties( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::LayerProperties * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumerateDeviceLayerProperties( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::enumerateDeviceLayerProperties( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::enumerateDeviceLayerProperties( LayerPropertiesAllocator & layerPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( layerPropertiesAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkEnumerateDeviceLayerProperties( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, VULKAN_HPP_NAMESPACE::Queue * pQueue, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( pQueue ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Queue - Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Queue queue; - d.vkGetDeviceQueue( m_device, queueFamilyIndex, queueIndex, reinterpret_cast( &queue ) ); - - return queue; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::submit( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkQueueSubmit( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Queue::submit( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueueSubmit( m_queue, submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::waitIdle( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkQueueWaitIdle( m_queue ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Queue::waitIdle( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueueWaitIdle( m_queue ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::waitIdle" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitIdle( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkDeviceWaitIdle( m_device ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::waitIdle( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkDeviceWaitIdle( m_device ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::waitIdle" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo * pAllocateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DeviceMemory * pMemory, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAllocateMemory( m_device, - reinterpret_cast( pAllocateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pMemory ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo & allocateInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceMemory memory; - VkResult result = - d.vkAllocateMemory( m_device, - reinterpret_cast( &allocateInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &memory ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateMemory" ); - - return createResultValueType( static_cast( result ), memory ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::allocateMemoryUnique( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo & allocateInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceMemory memory; - VkResult result = - d.vkAllocateMemory( m_device, - reinterpret_cast( &allocateInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &memory ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateMemoryUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( memory, ObjectFree( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::freeMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::freeMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeMemory( m_device, - static_cast( memory ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void( Device::free )( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkFreeMemory( m_device, static_cast( memory ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void( Device::free )( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeMemory( m_device, - static_cast( memory ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::mapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags, - void ** ppData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkMapMemory( m_device, - static_cast( memory ), - static_cast( offset ), - static_cast( size ), - static_cast( flags ), - ppData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::mapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - void * pData; - VkResult result = d.vkMapMemory( m_device, - static_cast( memory ), - static_cast( offset ), - static_cast( size ), - static_cast( flags ), - &pData ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::mapMemory" ); - - return createResultValueType( static_cast( result ), pData ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::unmapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkUnmapMemory( m_device, static_cast( memory ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::flushMappedMemoryRanges( uint32_t memoryRangeCount, - const VULKAN_HPP_NAMESPACE::MappedMemoryRange * pMemoryRanges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkFlushMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::flushMappedMemoryRanges( ArrayProxy const & memoryRanges, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkFlushMappedMemoryRanges( m_device, memoryRanges.size(), reinterpret_cast( memoryRanges.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::flushMappedMemoryRanges" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::invalidateMappedMemoryRanges( uint32_t memoryRangeCount, - const VULKAN_HPP_NAMESPACE::MappedMemoryRange * pMemoryRanges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkInvalidateMappedMemoryRanges( m_device, memoryRangeCount, reinterpret_cast( pMemoryRanges ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::invalidateMappedMemoryRanges( ArrayProxy const & memoryRanges, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkInvalidateMappedMemoryRanges( m_device, memoryRanges.size(), reinterpret_cast( memoryRanges.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::invalidateMappedMemoryRanges" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getMemoryCommitment( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize * pCommittedMemoryInBytes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), reinterpret_cast( pCommittedMemoryInBytes ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceSize Device::getMemoryCommitment( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceSize committedMemoryInBytes; - d.vkGetDeviceMemoryCommitment( m_device, static_cast( memory ), reinterpret_cast( &committedMemoryInBytes ) ); - - return committedMemoryInBytes; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindBufferMemory( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), static_cast( memoryOffset ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::bindBufferMemory( - VULKAN_HPP_NAMESPACE::Buffer buffer, VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkBindBufferMemory( m_device, static_cast( buffer ), static_cast( memory ), static_cast( memoryOffset ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindBufferMemory" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindImageMemory( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), static_cast( memoryOffset ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::bindImageMemory( - VULKAN_HPP_NAMESPACE::Image image, VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkBindImageMemory( m_device, static_cast( image ), static_cast( memory ), static_cast( memoryOffset ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindImageMemory" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::MemoryRequirements * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements - Device::getBufferMemoryRequirements( VULKAN_HPP_NAMESPACE::Buffer buffer, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements; - d.vkGetBufferMemoryRequirements( m_device, static_cast( buffer ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::MemoryRequirements * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements - Device::getImageMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements; - d.vkGetImageMemoryRequirements( m_device, static_cast( image ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements * pSparseMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageSparseMemoryRequirements( m_device, - static_cast( image ), - pSparseMemoryRequirementCount, - reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements( m_device, - static_cast( image ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - SparseImageMemoryRequirementsAllocator & sparseImageMemoryRequirementsAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements( - sparseImageMemoryRequirementsAllocator ); - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements( m_device, static_cast( image ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements( m_device, - static_cast( image ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - pPropertyCount, - reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - SparseImageFormatPropertiesAllocator & sparseImageFormatPropertiesAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( sparseImageFormatPropertiesAllocator ); - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::bindSparse( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindSparseInfo * pBindInfo, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkQueueBindSparse( m_queue, bindInfoCount, reinterpret_cast( pBindInfo ), static_cast( fence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Queue::bindSparse( ArrayProxy const & bindInfo, VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkQueueBindSparse( m_queue, bindInfo.size(), reinterpret_cast( bindInfo.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::bindSparse" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createFence( const VULKAN_HPP_NAMESPACE::FenceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateFence( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pFence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::createFence( - const VULKAN_HPP_NAMESPACE::FenceCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = - d.vkCreateFence( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createFence" ); - - return createResultValueType( static_cast( result ), fence ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::createFenceUnique( - const VULKAN_HPP_NAMESPACE::FenceCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = - d.vkCreateFence( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createFenceUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( fence, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyFence( VULKAN_HPP_NAMESPACE::Fence fence, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyFence( VULKAN_HPP_NAMESPACE::Fence fence, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyFence( m_device, - static_cast( fence ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Fence fence, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyFence( m_device, static_cast( fence ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Fence fence, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyFence( m_device, - static_cast( fence ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::resetFences( uint32_t fenceCount, - const VULKAN_HPP_NAMESPACE::Fence * pFences, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkResetFences( m_device, fenceCount, reinterpret_cast( pFences ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType::type Device::resetFences( ArrayProxy const & fences, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkResetFences( m_device, fences.size(), reinterpret_cast( fences.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::resetFences" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getFenceStatus( VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetFenceStatus( m_device, static_cast( fence ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::getFenceStatus( VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkGetFenceStatus( m_device, static_cast( fence ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceStatus", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitForFences( uint32_t fenceCount, - const VULKAN_HPP_NAMESPACE::Fence * pFences, - VULKAN_HPP_NAMESPACE::Bool32 waitAll, - uint64_t timeout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkWaitForFences( m_device, fenceCount, reinterpret_cast( pFences ), static_cast( waitAll ), timeout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::waitForFences( ArrayProxy const & fences, - VULKAN_HPP_NAMESPACE::Bool32 waitAll, - uint64_t timeout, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkWaitForFences( m_device, fences.size(), reinterpret_cast( fences.data() ), static_cast( waitAll ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitForFences", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Semaphore * pSemaphore, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSemaphore( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSemaphore ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Semaphore semaphore; - VkResult result = - d.vkCreateSemaphore( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &semaphore ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSemaphore" ); - - return createResultValueType( static_cast( result ), semaphore ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSemaphoreUnique( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Semaphore semaphore; - VkResult result = - d.vkCreateSemaphore( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &semaphore ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSemaphoreUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( semaphore, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroySemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroySemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySemaphore( m_device, - static_cast( semaphore ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySemaphore( m_device, static_cast( semaphore ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySemaphore( m_device, - static_cast( semaphore ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createEvent( const VULKAN_HPP_NAMESPACE::EventCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Event * pEvent, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateEvent( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pEvent ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::createEvent( - const VULKAN_HPP_NAMESPACE::EventCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Event event; - VkResult result = - d.vkCreateEvent( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createEvent" ); - - return createResultValueType( static_cast( result ), event ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::createEventUnique( - const VULKAN_HPP_NAMESPACE::EventCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Event event; - VkResult result = - d.vkCreateEvent( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createEventUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( event, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyEvent( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyEvent( VULKAN_HPP_NAMESPACE::Event event, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyEvent( m_device, - static_cast( event ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyEvent( m_device, static_cast( event ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Event event, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyEvent( m_device, - static_cast( event ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getEventStatus( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetEventStatus( m_device, static_cast( event ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::getEventStatus( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkGetEventStatus( m_device, static_cast( event ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getEventStatus", - { VULKAN_HPP_NAMESPACE::Result::eEventSet, VULKAN_HPP_NAMESPACE::Result::eEventReset } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setEvent( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSetEvent( m_device, static_cast( event ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::setEvent( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSetEvent( m_device, static_cast( event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setEvent" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::resetEvent( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkResetEvent( m_device, static_cast( event ) ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type Device::resetEvent( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkResetEvent( m_device, static_cast( event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::resetEvent" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createQueryPool( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::QueryPool * pQueryPool, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateQueryPool( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pQueryPool ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createQueryPool( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::QueryPool queryPool; - VkResult result = - d.vkCreateQueryPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &queryPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createQueryPool" ); - - return createResultValueType( static_cast( result ), queryPool ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createQueryPoolUnique( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::QueryPool queryPool; - VkResult result = - d.vkCreateQueryPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &queryPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createQueryPoolUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( queryPool, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyQueryPool( m_device, - static_cast( queryPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyQueryPool( m_device, static_cast( queryPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyQueryPool( m_device, - static_cast( queryPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - void * pData, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetQueryPoolResults( m_device, - static_cast( queryPool ), - firstQuery, - queryCount, - dataSize, - pData, - static_cast( stride ), - static_cast( flags ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkGetQueryPoolResults( m_device, - static_cast( queryPool ), - firstQuery, - queryCount, - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ), - static_cast( stride ), - static_cast( flags ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResults", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return ResultValue>( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue Device::getQueryPoolResult( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkGetQueryPoolResults( m_device, - static_cast( queryPool ), - firstQuery, - queryCount, - sizeof( DataType ), - reinterpret_cast( &data ), - static_cast( stride ), - static_cast( flags ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getQueryPoolResult", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return ResultValue( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createBuffer( const VULKAN_HPP_NAMESPACE::BufferCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Buffer * pBuffer, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateBuffer( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pBuffer ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::createBuffer( - const VULKAN_HPP_NAMESPACE::BufferCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Buffer buffer; - VkResult result = - d.vkCreateBuffer( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &buffer ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBuffer" ); - - return createResultValueType( static_cast( result ), buffer ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::createBufferUnique( - const VULKAN_HPP_NAMESPACE::BufferCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Buffer buffer; - VkResult result = - d.vkCreateBuffer( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &buffer ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBufferUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( buffer, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBuffer( m_device, - static_cast( buffer ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Buffer buffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBuffer( m_device, static_cast( buffer ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Buffer buffer, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBuffer( m_device, - static_cast( buffer ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createBufferView( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::BufferView * pView, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateBufferView( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pView ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createBufferView( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BufferView view; - VkResult result = - d.vkCreateBufferView( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &view ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBufferView" ); - - return createResultValueType( static_cast( result ), view ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createBufferViewUnique( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BufferView view; - VkResult result = - d.vkCreateBufferView( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &view ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBufferViewUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( view, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyBufferView( VULKAN_HPP_NAMESPACE::BufferView bufferView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyBufferView( VULKAN_HPP_NAMESPACE::BufferView bufferView, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBufferView( m_device, - static_cast( bufferView ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::BufferView bufferView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBufferView( m_device, static_cast( bufferView ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::BufferView bufferView, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBufferView( m_device, - static_cast( bufferView ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createImage( const VULKAN_HPP_NAMESPACE::ImageCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Image * pImage, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateImage( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pImage ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::createImage( - const VULKAN_HPP_NAMESPACE::ImageCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Image image; - VkResult result = - d.vkCreateImage( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &image ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createImage" ); - - return createResultValueType( static_cast( result ), image ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::createImageUnique( - const VULKAN_HPP_NAMESPACE::ImageCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Image image; - VkResult result = - d.vkCreateImage( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &image ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createImageUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( image, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyImage( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyImage( VULKAN_HPP_NAMESPACE::Image image, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyImage( m_device, - static_cast( image ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyImage( m_device, static_cast( image ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Image image, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyImage( m_device, - static_cast( image ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSubresourceLayout( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource * pSubresource, - VULKAN_HPP_NAMESPACE::SubresourceLayout * pLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageSubresourceLayout( m_device, - static_cast( image ), - reinterpret_cast( pSubresource ), - reinterpret_cast( pLayout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SubresourceLayout Device::getImageSubresourceLayout( - VULKAN_HPP_NAMESPACE::Image image, const VULKAN_HPP_NAMESPACE::ImageSubresource & subresource, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SubresourceLayout layout; - d.vkGetImageSubresourceLayout( m_device, - static_cast( image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return layout; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createImageView( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ImageView * pView, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateImageView( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pView ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createImageView( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageView view; - VkResult result = - d.vkCreateImageView( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &view ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createImageView" ); - - return createResultValueType( static_cast( result ), view ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createImageViewUnique( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageView view; - VkResult result = - d.vkCreateImageView( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &view ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createImageViewUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( view, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyImageView( VULKAN_HPP_NAMESPACE::ImageView imageView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyImageView( VULKAN_HPP_NAMESPACE::ImageView imageView, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyImageView( m_device, - static_cast( imageView ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ImageView imageView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyImageView( m_device, static_cast( imageView ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ImageView imageView, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyImageView( m_device, - static_cast( imageView ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createShaderModule( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ShaderModule * pShaderModule, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateShaderModule( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pShaderModule ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createShaderModule( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ShaderModule shaderModule; - VkResult result = - d.vkCreateShaderModule( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &shaderModule ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createShaderModule" ); - - return createResultValueType( static_cast( result ), shaderModule ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createShaderModuleUnique( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ShaderModule shaderModule; - VkResult result = - d.vkCreateShaderModule( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &shaderModule ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createShaderModuleUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( shaderModule, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyShaderModule( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyShaderModule( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyShaderModule( m_device, - static_cast( shaderModule ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyShaderModule( m_device, static_cast( shaderModule ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyShaderModule( m_device, - static_cast( shaderModule ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createPipelineCache( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PipelineCache * pPipelineCache, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreatePipelineCache( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelineCache ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createPipelineCache( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache; - VkResult result = - d.vkCreatePipelineCache( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipelineCache ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPipelineCache" ); - - return createResultValueType( static_cast( result ), pipelineCache ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createPipelineCacheUnique( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache; - VkResult result = - d.vkCreatePipelineCache( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipelineCache ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPipelineCacheUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( pipelineCache, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipelineCache( m_device, - static_cast( pipelineCache ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipelineCache( m_device, static_cast( pipelineCache ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipelineCache( m_device, - static_cast( pipelineCache ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - size_t * pDataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), pDataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector data; - size_t dataSize; - VkResult result; - do - { - result = d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineCacheData" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return createResultValueType( static_cast( result ), data ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, Uint8_tAllocator & uint8_tAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector data( uint8_tAllocator ); - size_t dataSize; - VkResult result; - do - { - result = d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = d.vkGetPipelineCacheData( m_device, static_cast( pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineCacheData" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::mergePipelineCaches( VULKAN_HPP_NAMESPACE::PipelineCache dstCache, - uint32_t srcCacheCount, - const VULKAN_HPP_NAMESPACE::PipelineCache * pSrcCaches, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkMergePipelineCaches( m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::mergePipelineCaches( - VULKAN_HPP_NAMESPACE::PipelineCache dstCache, ArrayProxy const & srcCaches, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkMergePipelineCaches( - m_device, static_cast( dstCache ), srcCaches.size(), reinterpret_cast( srcCaches.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::mergePipelineCaches" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateGraphicsPipelines( m_device, - static_cast( pipelineCache ), - createInfoCount, - reinterpret_cast( pCreateInfos ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelines ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipelines", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size(), pipelineAllocator ); - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipelines", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue - Device::createGraphicsPipeline( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipeline", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue( static_cast( result ), pipeline ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createGraphicsPipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipelinesUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines; - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createGraphicsPipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipelinesUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines( pipelineAllocator ); - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createGraphicsPipelineUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateGraphicsPipelines( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createGraphicsPipelineUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( - static_cast( result ), - UniqueHandle( pipeline, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateComputePipelines( m_device, - static_cast( pipelineCache ), - createInfoCount, - reinterpret_cast( pCreateInfos ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelines ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipelines", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size(), pipelineAllocator ); - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipelines", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue - Device::createComputePipeline( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipeline", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue( static_cast( result ), pipeline ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createComputePipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipelinesUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines; - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createComputePipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipelinesUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines( pipelineAllocator ); - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createComputePipelineUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateComputePipelines( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createComputePipelineUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( - static_cast( result ), - UniqueHandle( pipeline, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipeline( m_device, - static_cast( pipeline ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipeline( m_device, static_cast( pipeline ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipeline( m_device, - static_cast( pipeline ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createPipelineLayout( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PipelineLayout * pPipelineLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreatePipelineLayout( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelineLayout ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createPipelineLayout( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout; - VkResult result = - d.vkCreatePipelineLayout( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipelineLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPipelineLayout" ); - - return createResultValueType( static_cast( result ), pipelineLayout ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createPipelineLayoutUnique( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout; - VkResult result = - d.vkCreatePipelineLayout( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipelineLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPipelineLayoutUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( pipelineLayout, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipelineLayout( m_device, - static_cast( pipelineLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPipelineLayout( m_device, static_cast( pipelineLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPipelineLayout( m_device, - static_cast( pipelineLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createSampler( const VULKAN_HPP_NAMESPACE::SamplerCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Sampler * pSampler, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSampler( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSampler ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::createSampler( - const VULKAN_HPP_NAMESPACE::SamplerCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Sampler sampler; - VkResult result = - d.vkCreateSampler( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &sampler ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSampler" ); - - return createResultValueType( static_cast( result ), sampler ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::createSamplerUnique( - const VULKAN_HPP_NAMESPACE::SamplerCreateInfo & createInfo, Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Sampler sampler; - VkResult result = - d.vkCreateSampler( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &sampler ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSamplerUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( sampler, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroySampler( VULKAN_HPP_NAMESPACE::Sampler sampler, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroySampler( VULKAN_HPP_NAMESPACE::Sampler sampler, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySampler( m_device, - static_cast( sampler ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Sampler sampler, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySampler( m_device, static_cast( sampler ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Sampler sampler, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySampler( m_device, - static_cast( sampler ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createDescriptorSetLayout( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDescriptorSetLayout( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSetLayout ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createDescriptorSetLayout( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayout setLayout; - VkResult result = d.vkCreateDescriptorSetLayout( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &setLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorSetLayout" ); - - return createResultValueType( static_cast( result ), setLayout ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createDescriptorSetLayoutUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayout setLayout; - VkResult result = d.vkCreateDescriptorSetLayout( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &setLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorSetLayoutUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( setLayout, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorSetLayout( - m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorSetLayout( - m_device, - static_cast( descriptorSetLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorSetLayout( - m_device, static_cast( descriptorSetLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorSetLayout( - m_device, - static_cast( descriptorSetLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createDescriptorPool( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorPool * pDescriptorPool, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDescriptorPool( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pDescriptorPool ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createDescriptorPool( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool; - VkResult result = - d.vkCreateDescriptorPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorPool" ); - - return createResultValueType( static_cast( result ), descriptorPool ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createDescriptorPoolUnique( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool; - VkResult result = - d.vkCreateDescriptorPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorPoolUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( descriptorPool, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorPool( m_device, - static_cast( descriptorPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorPool( m_device, static_cast( descriptorPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorPool( m_device, - static_cast( descriptorPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE Result Device::resetDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ) ); - } -#else - template - VULKAN_HPP_INLINE void Device::resetDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkResetDescriptorPool( m_device, static_cast( descriptorPool ), static_cast( flags ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo * pAllocateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAllocateDescriptorSets( - m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pDescriptorSets ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector descriptorSets( allocateInfo.descriptorSetCount ); - VkResult result = d.vkAllocateDescriptorSets( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateDescriptorSets" ); - - return createResultValueType( static_cast( result ), descriptorSets ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - DescriptorSetAllocator & descriptorSetAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector descriptorSets( allocateInfo.descriptorSetCount, descriptorSetAllocator ); - VkResult result = d.vkAllocateDescriptorSets( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateDescriptorSets" ); - - return createResultValueType( static_cast( result ), descriptorSets ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, DescriptorSetAllocator>>::type - Device::allocateDescriptorSetsUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector descriptorSets( allocateInfo.descriptorSetCount ); - VkResult result = d.vkAllocateDescriptorSets( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateDescriptorSetsUnique" ); - std::vector, DescriptorSetAllocator> uniqueDescriptorSets; - uniqueDescriptorSets.reserve( allocateInfo.descriptorSetCount ); - PoolFree deleter( *this, allocateInfo.descriptorPool, d ); - for ( auto const & descriptorSet : descriptorSets ) - { - uniqueDescriptorSets.push_back( UniqueHandle( descriptorSet, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueDescriptorSets ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, DescriptorSetAllocator>>::type - Device::allocateDescriptorSetsUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - DescriptorSetAllocator & descriptorSetAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector descriptorSets( allocateInfo.descriptorSetCount ); - VkResult result = d.vkAllocateDescriptorSets( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( descriptorSets.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateDescriptorSetsUnique" ); - std::vector, DescriptorSetAllocator> uniqueDescriptorSets( descriptorSetAllocator ); - uniqueDescriptorSets.reserve( allocateInfo.descriptorSetCount ); - PoolFree deleter( *this, allocateInfo.descriptorPool, d ); - for ( auto const & descriptorSet : descriptorSets ) - { - uniqueDescriptorSets.push_back( UniqueHandle( descriptorSet, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueDescriptorSets ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Result Device::freeDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkFreeDescriptorSets( - m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::freeDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - ArrayProxy const & descriptorSets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeDescriptorSets( - m_device, static_cast( descriptorPool ), descriptorSets.size(), reinterpret_cast( descriptorSets.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Result( Device::free )( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkFreeDescriptorSets( - m_device, static_cast( descriptorPool ), descriptorSetCount, reinterpret_cast( pDescriptorSets ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void( Device::free )( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - ArrayProxy const & descriptorSets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeDescriptorSets( - m_device, static_cast( descriptorPool ), descriptorSets.size(), reinterpret_cast( descriptorSets.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::updateDescriptorSets( uint32_t descriptorWriteCount, - const VULKAN_HPP_NAMESPACE::WriteDescriptorSet * pDescriptorWrites, - uint32_t descriptorCopyCount, - const VULKAN_HPP_NAMESPACE::CopyDescriptorSet * pDescriptorCopies, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkUpdateDescriptorSets( m_device, - descriptorWriteCount, - reinterpret_cast( pDescriptorWrites ), - descriptorCopyCount, - reinterpret_cast( pDescriptorCopies ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::updateDescriptorSets( ArrayProxy const & descriptorWrites, - ArrayProxy const & descriptorCopies, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkUpdateDescriptorSets( m_device, - descriptorWrites.size(), - reinterpret_cast( descriptorWrites.data() ), - descriptorCopies.size(), - reinterpret_cast( descriptorCopies.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createFramebuffer( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Framebuffer * pFramebuffer, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateFramebuffer( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pFramebuffer ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createFramebuffer( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer; - VkResult result = - d.vkCreateFramebuffer( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &framebuffer ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createFramebuffer" ); - - return createResultValueType( static_cast( result ), framebuffer ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createFramebufferUnique( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer; - VkResult result = - d.vkCreateFramebuffer( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &framebuffer ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createFramebufferUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( framebuffer, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyFramebuffer( m_device, - static_cast( framebuffer ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyFramebuffer( m_device, static_cast( framebuffer ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyFramebuffer( m_device, - static_cast( framebuffer ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateRenderPass( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pRenderPass ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPass" ); - - return createResultValueType( static_cast( result ), renderPass ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createRenderPassUnique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPassUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( renderPass, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyRenderPass( m_device, - static_cast( renderPass ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyRenderPass( m_device, static_cast( renderPass ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyRenderPass( m_device, - static_cast( renderPass ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getRenderAreaGranularity( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - VULKAN_HPP_NAMESPACE::Extent2D * pGranularity, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( pGranularity ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Extent2D Device::getRenderAreaGranularity( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Extent2D granularity; - d.vkGetRenderAreaGranularity( m_device, static_cast( renderPass ), reinterpret_cast( &granularity ) ); - - return granularity; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createCommandPool( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CommandPool * pCommandPool, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateCommandPool( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pCommandPool ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createCommandPool( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CommandPool commandPool; - VkResult result = - d.vkCreateCommandPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &commandPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCommandPool" ); - - return createResultValueType( static_cast( result ), commandPool ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createCommandPoolUnique( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CommandPool commandPool; - VkResult result = - d.vkCreateCommandPool( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &commandPool ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCommandPoolUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( commandPool, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCommandPool( m_device, - static_cast( commandPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCommandPool( m_device, static_cast( commandPool ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCommandPool( m_device, - static_cast( commandPool ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::resetCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type - Device::resetCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkResetCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::resetCommandPool" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo * pAllocateInfo, - VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAllocateCommandBuffers( - m_device, reinterpret_cast( pAllocateInfo ), reinterpret_cast( pCommandBuffers ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector commandBuffers( allocateInfo.commandBufferCount ); - VkResult result = d.vkAllocateCommandBuffers( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateCommandBuffers" ); - - return createResultValueType( static_cast( result ), commandBuffers ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - CommandBufferAllocator & commandBufferAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector commandBuffers( allocateInfo.commandBufferCount, commandBufferAllocator ); - VkResult result = d.vkAllocateCommandBuffers( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateCommandBuffers" ); - - return createResultValueType( static_cast( result ), commandBuffers ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, CommandBufferAllocator>>::type - Device::allocateCommandBuffersUnique( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector commandBuffers( allocateInfo.commandBufferCount ); - VkResult result = d.vkAllocateCommandBuffers( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateCommandBuffersUnique" ); - std::vector, CommandBufferAllocator> uniqueCommandBuffers; - uniqueCommandBuffers.reserve( allocateInfo.commandBufferCount ); - PoolFree deleter( *this, allocateInfo.commandPool, d ); - for ( auto const & commandBuffer : commandBuffers ) - { - uniqueCommandBuffers.push_back( UniqueHandle( commandBuffer, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueCommandBuffers ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, CommandBufferAllocator>>::type - Device::allocateCommandBuffersUnique( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - CommandBufferAllocator & commandBufferAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector commandBuffers( allocateInfo.commandBufferCount ); - VkResult result = d.vkAllocateCommandBuffers( - m_device, reinterpret_cast( &allocateInfo ), reinterpret_cast( commandBuffers.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::allocateCommandBuffersUnique" ); - std::vector, CommandBufferAllocator> uniqueCommandBuffers( commandBufferAllocator ); - uniqueCommandBuffers.reserve( allocateInfo.commandBufferCount ); - PoolFree deleter( *this, allocateInfo.commandPool, d ); - for ( auto const & commandBuffer : commandBuffers ) - { - uniqueCommandBuffers.push_back( UniqueHandle( commandBuffer, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueCommandBuffers ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::freeCommandBuffers( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkFreeCommandBuffers( - m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::freeCommandBuffers( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - ArrayProxy const & commandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeCommandBuffers( - m_device, static_cast( commandPool ), commandBuffers.size(), reinterpret_cast( commandBuffers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void( Device::free )( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkFreeCommandBuffers( - m_device, static_cast( commandPool ), commandBufferCount, reinterpret_cast( pCommandBuffers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void( Device::free )( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - ArrayProxy const & commandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkFreeCommandBuffers( - m_device, static_cast( commandPool ), commandBuffers.size(), reinterpret_cast( commandBuffers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo * pBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( pBeginInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - CommandBuffer::begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo & beginInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBeginCommandBuffer( m_commandBuffer, reinterpret_cast( &beginInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::begin" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::end( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEndCommandBuffer( m_commandBuffer ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type CommandBuffer::end( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkEndCommandBuffer( m_commandBuffer ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::end" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type CommandBuffer::reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkResetCommandBuffer( m_commandBuffer, static_cast( flags ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::reset" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindPipeline( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetViewport( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewports ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, - ArrayProxy const & viewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetViewport( m_commandBuffer, firstViewport, viewports.size(), reinterpret_cast( viewports.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, - uint32_t scissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetScissor( m_commandBuffer, firstScissor, scissorCount, reinterpret_cast( pScissors ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, - ArrayProxy const & scissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetScissor( m_commandBuffer, firstScissor, scissors.size(), reinterpret_cast( scissors.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetLineWidth( m_commandBuffer, lineWidth ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBias( m_commandBuffer, depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4], Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetBlendConstants( m_commandBuffer, blendConstants ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBounds( m_commandBuffer, minDepthBounds, maxDepthBounds ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::setStencilCompareMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t compareMask, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilCompareMask( m_commandBuffer, static_cast( faceMask ), compareMask ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::setStencilWriteMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t writeMask, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilWriteMask( m_commandBuffer, static_cast( faceMask ), writeMask ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::setStencilReference( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t reference, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilReference( m_commandBuffer, static_cast( faceMask ), reference ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - uint32_t dynamicOffsetCount, - const uint32_t * pDynamicOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindDescriptorSets( m_commandBuffer, - static_cast( pipelineBindPoint ), - static_cast( layout ), - firstSet, - descriptorSetCount, - reinterpret_cast( pDescriptorSets ), - dynamicOffsetCount, - pDynamicOffsets ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - ArrayProxy const & descriptorSets, - ArrayProxy const & dynamicOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBindDescriptorSets( m_commandBuffer, - static_cast( pipelineBindPoint ), - static_cast( layout ), - firstSet, - descriptorSets.size(), - reinterpret_cast( descriptorSets.data() ), - dynamicOffsets.size(), - dynamicOffsets.data() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::IndexType indexType, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindIndexBuffer( m_commandBuffer, static_cast( buffer ), static_cast( offset ), static_cast( indexType ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindVertexBuffers( - m_commandBuffer, firstBinding, bindingCount, reinterpret_cast( pBuffers ), reinterpret_cast( pOffsets ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( buffers.size() == offsets.size() ); -# else - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBindVertexBuffers( m_commandBuffer, - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::draw( - uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDraw( m_commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndexed( uint32_t indexCount, - uint32_t instanceCount, - uint32_t firstIndex, - int32_t vertexOffset, - uint32_t firstInstance, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndexed( m_commandBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndirect( m_commandBuffer, static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndexedIndirect( m_commandBuffer, static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDispatch( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDispatchIndirect( m_commandBuffer, static_cast( buffer ), static_cast( offset ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferCopy * pRegions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBuffer( m_commandBuffer, - static_cast( srcBuffer ), - static_cast( dstBuffer ), - regionCount, - reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBuffer( m_commandBuffer, - static_cast( srcBuffer ), - static_cast( dstBuffer ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageCopy * pRegions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regionCount, - reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageBlit * pRegions, - VULKAN_HPP_NAMESPACE::Filter filter, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBlitImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regionCount, - reinterpret_cast( pRegions ), - static_cast( filter ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - VULKAN_HPP_NAMESPACE::Filter filter, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBlitImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ), - static_cast( filter ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferImageCopy * pRegions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBufferToImage( m_commandBuffer, - static_cast( srcBuffer ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regionCount, - reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBufferToImage( m_commandBuffer, - static_cast( srcBuffer ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferImageCopy * pRegions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImageToBuffer( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstBuffer ), - regionCount, - reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImageToBuffer( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstBuffer ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize dataSize, - const void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdUpdateBuffer( - m_commandBuffer, static_cast( dstBuffer ), static_cast( dstOffset ), static_cast( dataSize ), pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - ArrayProxy const & data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdUpdateBuffer( m_commandBuffer, - static_cast( dstBuffer ), - static_cast( dstOffset ), - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - uint32_t data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdFillBuffer( m_commandBuffer, static_cast( dstBuffer ), static_cast( dstOffset ), static_cast( size ), data ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue * pColor, - uint32_t rangeCount, - const VULKAN_HPP_NAMESPACE::ImageSubresourceRange * pRanges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdClearColorImage( m_commandBuffer, - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( pColor ), - rangeCount, - reinterpret_cast( pRanges ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue & color, - ArrayProxy const & ranges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdClearColorImage( m_commandBuffer, - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( &color ), - ranges.size(), - reinterpret_cast( ranges.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue * pDepthStencil, - uint32_t rangeCount, - const VULKAN_HPP_NAMESPACE::ImageSubresourceRange * pRanges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdClearDepthStencilImage( m_commandBuffer, - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( pDepthStencil ), - rangeCount, - reinterpret_cast( pRanges ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue & depthStencil, - ArrayProxy const & ranges, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdClearDepthStencilImage( m_commandBuffer, - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( &depthStencil ), - ranges.size(), - reinterpret_cast( ranges.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( uint32_t attachmentCount, - const VULKAN_HPP_NAMESPACE::ClearAttachment * pAttachments, - uint32_t rectCount, - const VULKAN_HPP_NAMESPACE::ClearRect * pRects, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdClearAttachments( m_commandBuffer, - attachmentCount, - reinterpret_cast( pAttachments ), - rectCount, - reinterpret_cast( pRects ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( ArrayProxy const & attachments, - ArrayProxy const & rects, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdClearAttachments( m_commandBuffer, - attachments.size(), - reinterpret_cast( attachments.data() ), - rects.size(), - reinterpret_cast( rects.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageResolve * pRegions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResolveImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regionCount, - reinterpret_cast( pRegions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdResolveImage( m_commandBuffer, - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::resetEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResetEvent( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - uint32_t memoryBarrierCount, - const VULKAN_HPP_NAMESPACE::MemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier * pImageMemoryBarriers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWaitEvents( m_commandBuffer, - eventCount, - reinterpret_cast( pEvents ), - static_cast( srcStageMask ), - static_cast( dstStageMask ), - memoryBarrierCount, - reinterpret_cast( pMemoryBarriers ), - bufferMemoryBarrierCount, - reinterpret_cast( pBufferMemoryBarriers ), - imageMemoryBarrierCount, - reinterpret_cast( pImageMemoryBarriers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents( ArrayProxy const & events, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdWaitEvents( m_commandBuffer, - events.size(), - reinterpret_cast( events.data() ), - static_cast( srcStageMask ), - static_cast( dstStageMask ), - memoryBarriers.size(), - reinterpret_cast( memoryBarriers.data() ), - bufferMemoryBarriers.size(), - reinterpret_cast( bufferMemoryBarriers.data() ), - imageMemoryBarriers.size(), - reinterpret_cast( imageMemoryBarriers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - uint32_t memoryBarrierCount, - const VULKAN_HPP_NAMESPACE::MemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier * pImageMemoryBarriers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPipelineBarrier( m_commandBuffer, - static_cast( srcStageMask ), - static_cast( dstStageMask ), - static_cast( dependencyFlags ), - memoryBarrierCount, - reinterpret_cast( pMemoryBarriers ), - bufferMemoryBarrierCount, - reinterpret_cast( pBufferMemoryBarriers ), - imageMemoryBarrierCount, - reinterpret_cast( pImageMemoryBarriers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPipelineBarrier( m_commandBuffer, - static_cast( srcStageMask ), - static_cast( dstStageMask ), - static_cast( dependencyFlags ), - memoryBarriers.size(), - reinterpret_cast( memoryBarriers.data() ), - bufferMemoryBarriers.size(), - reinterpret_cast( bufferMemoryBarriers.data() ), - imageMemoryBarriers.size(), - reinterpret_cast( imageMemoryBarriers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginQuery( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::endQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndQuery( m_commandBuffer, static_cast( queryPool ), query ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResetQueryPool( m_commandBuffer, static_cast( queryPool ), firstQuery, queryCount ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteTimestamp( m_commandBuffer, static_cast( pipelineStage ), static_cast( queryPool ), query ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyQueryPoolResults( m_commandBuffer, - static_cast( queryPool ), - firstQuery, - queryCount, - static_cast( dstBuffer ), - static_cast( dstOffset ), - static_cast( stride ), - static_cast( flags ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - uint32_t size, - const void * pValues, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPushConstants( m_commandBuffer, static_cast( layout ), static_cast( stageFlags ), offset, size, pValues ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - ArrayProxy const & values, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPushConstants( m_commandBuffer, - static_cast( layout ), - static_cast( stageFlags ), - offset, - values.size() * sizeof( ValuesType ), - reinterpret_cast( values.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( pRenderPassBegin ), static_cast( contents ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginRenderPass( m_commandBuffer, reinterpret_cast( &renderPassBegin ), static_cast( contents ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( VULKAN_HPP_NAMESPACE::SubpassContents contents, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdNextSubpass( m_commandBuffer, static_cast( contents ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndRenderPass( m_commandBuffer ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::executeCommands( uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdExecuteCommands( m_commandBuffer, commandBufferCount, reinterpret_cast( pCommandBuffers ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::executeCommands( ArrayProxy const & commandBuffers, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdExecuteCommands( m_commandBuffer, commandBuffers.size(), reinterpret_cast( commandBuffers.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result enumerateInstanceVersion( uint32_t * pApiVersion, Dispatch const & d ) VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumerateInstanceVersion( pApiVersion ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type enumerateInstanceVersion( Dispatch const & d ) - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint32_t apiVersion; - VkResult result = d.vkEnumerateInstanceVersion( &apiVersion ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::enumerateInstanceVersion" ); - - return createResultValueType( static_cast( result ), apiVersion ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindBufferMemory2( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo * pBindInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBindBufferMemory2( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindBufferMemory2( ArrayProxy const & bindInfos, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindBufferMemory2( m_device, bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindBufferMemory2" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindImageMemory2( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindImageMemoryInfo * pBindInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBindImageMemory2( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindImageMemory2( ArrayProxy const & bindInfos, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindImageMemory2( m_device, bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindImageMemory2" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeatures( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags * pPeerMemoryFeatures, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceGroupPeerMemoryFeatures( - m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags Device::getGroupPeerMemoryFeatures( - uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags peerMemoryFeatures; - d.vkGetDeviceGroupPeerMemoryFeatures( - m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); - - return peerMemoryFeatures; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setDeviceMask( uint32_t deviceMask, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDeviceMask( m_commandBuffer, deviceMask ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::dispatchBase( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDispatchBase( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::enumeratePhysicalDeviceGroups( uint32_t * pPhysicalDeviceGroupCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumeratePhysicalDeviceGroups( - m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Instance::enumeratePhysicalDeviceGroups( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDeviceGroupProperties; - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = d.vkEnumeratePhysicalDeviceGroups( - m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroups" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return createResultValueType( static_cast( result ), physicalDeviceGroupProperties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Instance::enumeratePhysicalDeviceGroups( PhysicalDeviceGroupPropertiesAllocator & physicalDeviceGroupPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDeviceGroupProperties( - physicalDeviceGroupPropertiesAllocator ); - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceGroups( m_instance, &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = d.vkEnumeratePhysicalDeviceGroups( - m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroups" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return createResultValueType( static_cast( result ), physicalDeviceGroupProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageMemoryRequirements2( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetImageMemoryRequirements2( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetImageMemoryRequirements2( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetBufferMemoryRequirements2( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetBufferMemoryRequirements2( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetBufferMemoryRequirements2( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageSparseMemoryRequirements2( m_device, - reinterpret_cast( pInfo ), - pSparseMemoryRequirementCount, - reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements2( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements2( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements( - sparseImageMemoryRequirements2Allocator ); - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements2( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements2( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFeatures2( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 * pFeatures, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFeatures2( m_physicalDevice, reinterpret_cast( pFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 - PhysicalDevice::getFeatures2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 features; - d.vkGetPhysicalDeviceFeatures2( m_physicalDevice, reinterpret_cast( &features ) ); - - return features; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 & features = structureChain.template get(); - d.vkGetPhysicalDeviceFeatures2( m_physicalDevice, reinterpret_cast( &features ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 - PhysicalDevice::getProperties2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 properties; - d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( &properties ) ); - - return properties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 & properties = structureChain.template get(); - d.vkGetPhysicalDeviceProperties2( m_physicalDevice, reinterpret_cast( &properties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties2 * pFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties2 - PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::FormatProperties2 formatProperties; - d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::FormatProperties2 & formatProperties = structureChain.template get(); - d.vkGetPhysicalDeviceFormatProperties2( m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 * pImageFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, - reinterpret_cast( pImageFormatInfo ), - reinterpret_cast( pImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 imageFormatProperties; - VkResult result = d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2" ); - - return createResultValueType( static_cast( result ), imageFormatProperties ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 & imageFormatProperties = structureChain.template get(); - VkResult result = d.vkGetPhysicalDeviceImageFormatProperties2( m_physicalDevice, - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2" ); - - return createResultValueType( static_cast( result ), structureChain ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 * pQueueFamilyProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceQueueFamilyProperties2( - m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties2( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2( QueueFamilyProperties2Allocator & queueFamilyProperties2Allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties( queueFamilyProperties2Allocator ); - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties2( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains; - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - d.vkGetPhysicalDeviceQueueFamilyProperties2( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2( StructureChainAllocator & structureChainAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains( structureChainAllocator ); - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - d.vkGetPhysicalDeviceQueueFamilyProperties2( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 * pMemoryProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceMemoryProperties2( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - PhysicalDevice::getMemoryProperties2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 memoryProperties; - d.vkGetPhysicalDeviceMemoryProperties2( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getMemoryProperties2( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 & memoryProperties = - structureChain.template get(); - d.vkGetPhysicalDeviceMemoryProperties2( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2( m_physicalDevice, - reinterpret_cast( pFormatInfo ), - pPropertyCount, - reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties2( - m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2( m_physicalDevice, - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - SparseImageFormatProperties2Allocator & sparseImageFormatProperties2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( sparseImageFormatProperties2Allocator ); - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties2( - m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2( m_physicalDevice, - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::trimCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkTrimCommandPool( m_device, static_cast( commandPool ), static_cast( flags ) ); - } - - template - VULKAN_HPP_INLINE void Device::getQueue2( const VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 * pQueueInfo, - VULKAN_HPP_NAMESPACE::Queue * pQueue, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceQueue2( m_device, reinterpret_cast( pQueueInfo ), reinterpret_cast( pQueue ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Queue Device::getQueue2( const VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 & queueInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Queue queue; - d.vkGetDeviceQueue2( m_device, reinterpret_cast( &queueInfo ), reinterpret_cast( &queue ) ); - - return queue; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createSamplerYcbcrConversion( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion * pYcbcrConversion, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSamplerYcbcrConversion( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pYcbcrConversion ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createSamplerYcbcrConversion( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion; - VkResult result = d.vkCreateSamplerYcbcrConversion( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &ycbcrConversion ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSamplerYcbcrConversion" ); - - return createResultValueType( static_cast( result ), ycbcrConversion ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSamplerYcbcrConversionUnique( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion; - VkResult result = d.vkCreateSamplerYcbcrConversion( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &ycbcrConversion ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSamplerYcbcrConversionUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( ycbcrConversion, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySamplerYcbcrConversion( - m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySamplerYcbcrConversion( - m_device, - static_cast( ycbcrConversion ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySamplerYcbcrConversion( - m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySamplerYcbcrConversion( - m_device, - static_cast( ycbcrConversion ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createDescriptorUpdateTemplate( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate * pDescriptorUpdateTemplate, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDescriptorUpdateTemplate( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pDescriptorUpdateTemplate ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createDescriptorUpdateTemplate( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate; - VkResult result = d.vkCreateDescriptorUpdateTemplate( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorUpdateTemplate ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorUpdateTemplate" ); - - return createResultValueType( static_cast( result ), descriptorUpdateTemplate ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createDescriptorUpdateTemplateUnique( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate; - VkResult result = d.vkCreateDescriptorUpdateTemplate( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorUpdateTemplate ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorUpdateTemplateUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( - descriptorUpdateTemplate, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorUpdateTemplate( - m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorUpdateTemplate( - m_device, - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorUpdateTemplate( - m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorUpdateTemplate( - m_device, - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkUpdateDescriptorSetWithTemplate( - m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkUpdateDescriptorSetWithTemplate( m_device, - static_cast( descriptorSet ), - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( &data ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VULKAN_HPP_NAMESPACE::ExternalBufferProperties * pExternalBufferProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalBufferProperties( m_physicalDevice, - reinterpret_cast( pExternalBufferInfo ), - reinterpret_cast( pExternalBufferProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalBufferProperties - PhysicalDevice::getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalBufferProperties externalBufferProperties; - d.vkGetPhysicalDeviceExternalBufferProperties( m_physicalDevice, - reinterpret_cast( &externalBufferInfo ), - reinterpret_cast( &externalBufferProperties ) ); - - return externalBufferProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VULKAN_HPP_NAMESPACE::ExternalFenceProperties * pExternalFenceProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalFenceProperties( m_physicalDevice, - reinterpret_cast( pExternalFenceInfo ), - reinterpret_cast( pExternalFenceProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalFenceProperties - PhysicalDevice::getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalFenceProperties externalFenceProperties; - d.vkGetPhysicalDeviceExternalFenceProperties( m_physicalDevice, - reinterpret_cast( &externalFenceInfo ), - reinterpret_cast( &externalFenceProperties ) ); - - return externalFenceProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - PhysicalDevice::getExternalSemaphoreProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties * pExternalSemaphoreProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalSemaphoreProperties( m_physicalDevice, - reinterpret_cast( pExternalSemaphoreInfo ), - reinterpret_cast( pExternalSemaphoreProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - PhysicalDevice::getExternalSemaphoreProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties externalSemaphoreProperties; - d.vkGetPhysicalDeviceExternalSemaphoreProperties( m_physicalDevice, - reinterpret_cast( &externalSemaphoreInfo ), - reinterpret_cast( &externalSemaphoreProperties ) ); - - return externalSemaphoreProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport * pSupport, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDescriptorSetLayoutSupport( - m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pSupport ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - Device::getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport support; - d.vkGetDescriptorSetLayoutSupport( - m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); - - return support; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport & support = structureChain.template get(); - d.vkGetDescriptorSetLayoutSupport( - m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_2 === - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndirectCount( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndexedIndirectCount( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateRenderPass2( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pRenderPass ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass2( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPass2" ); - - return createResultValueType( static_cast( result ), renderPass ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createRenderPass2Unique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass2( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPass2Unique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( renderPass, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginRenderPass2( - m_commandBuffer, reinterpret_cast( pRenderPassBegin ), reinterpret_cast( pSubpassBeginInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginRenderPass2( - m_commandBuffer, reinterpret_cast( &renderPassBegin ), reinterpret_cast( &subpassBeginInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdNextSubpass2( - m_commandBuffer, reinterpret_cast( pSubpassBeginInfo ), reinterpret_cast( pSubpassEndInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdNextSubpass2( - m_commandBuffer, reinterpret_cast( &subpassBeginInfo ), reinterpret_cast( &subpassEndInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndRenderPass2( m_commandBuffer, reinterpret_cast( pSubpassEndInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdEndRenderPass2( m_commandBuffer, reinterpret_cast( &subpassEndInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - Device::resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkResetQueryPool( m_device, static_cast( queryPool ), firstQuery, queryCount ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSemaphoreCounterValue( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - uint64_t * pValue, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetSemaphoreCounterValue( m_device, static_cast( semaphore ), pValue ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getSemaphoreCounterValue( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t value; - VkResult result = d.vkGetSemaphoreCounterValue( m_device, static_cast( semaphore ), &value ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreCounterValue" ); - - return createResultValueType( static_cast( result ), value ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo * pWaitInfo, - uint64_t timeout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkWaitSemaphores( m_device, reinterpret_cast( pWaitInfo ), timeout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, uint64_t timeout, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkWaitSemaphores( m_device, reinterpret_cast( &waitInfo ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphores", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo * pSignalInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSignalSemaphore( m_device, reinterpret_cast( pSignalInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSignalSemaphore( m_device, reinterpret_cast( &signalInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::signalSemaphore" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE DeviceAddress Device::getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetBufferDeviceAddress( m_device, reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress Device::getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkDeviceAddress result = d.vkGetBufferDeviceAddress( m_device, reinterpret_cast( &info ) ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE uint64_t Device::getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetBufferOpaqueCaptureAddress( m_device, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE uint64_t Device::getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t result = d.vkGetBufferOpaqueCaptureAddress( m_device, reinterpret_cast( &info ) ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE uint64_t Device::getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetDeviceMemoryOpaqueCaptureAddress( m_device, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE uint64_t Device::getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t result = d.vkGetDeviceMemoryOpaqueCaptureAddress( m_device, reinterpret_cast( &info ) ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_3 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getToolProperties( uint32_t * pToolCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties * pToolProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceToolProperties( m_physicalDevice, pToolCount, reinterpret_cast( pToolProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getToolProperties( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector toolProperties; - uint32_t toolCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceToolProperties( m_physicalDevice, &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = - d.vkGetPhysicalDeviceToolProperties( m_physicalDevice, &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolProperties" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return createResultValueType( static_cast( result ), toolProperties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getToolProperties( PhysicalDeviceToolPropertiesAllocator & physicalDeviceToolPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector toolProperties( - physicalDeviceToolPropertiesAllocator ); - uint32_t toolCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceToolProperties( m_physicalDevice, &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = - d.vkGetPhysicalDeviceToolProperties( m_physicalDevice, &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolProperties" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return createResultValueType( static_cast( result ), toolProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createPrivateDataSlot( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PrivateDataSlot * pPrivateDataSlot, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreatePrivateDataSlot( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPrivateDataSlot ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createPrivateDataSlot( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot; - VkResult result = - d.vkCreatePrivateDataSlot( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &privateDataSlot ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPrivateDataSlot" ); - - return createResultValueType( static_cast( result ), privateDataSlot ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createPrivateDataSlotUnique( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot; - VkResult result = - d.vkCreatePrivateDataSlot( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &privateDataSlot ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPrivateDataSlotUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( privateDataSlot, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPrivateDataSlot( m_device, static_cast( privateDataSlot ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPrivateDataSlot( - m_device, - static_cast( privateDataSlot ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPrivateDataSlot( m_device, static_cast( privateDataSlot ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPrivateDataSlot( - m_device, - static_cast( privateDataSlot ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkSetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkSetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateData" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t data; - d.vkGetPrivateData( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), &data ); - - return data; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setEvent2( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetEvent2( m_commandBuffer, static_cast( event ), reinterpret_cast( pDependencyInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setEvent2( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetEvent2( m_commandBuffer, static_cast( event ), reinterpret_cast( &dependencyInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::resetEvent2( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResetEvent2( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWaitEvents2( - m_commandBuffer, eventCount, reinterpret_cast( pEvents ), reinterpret_cast( pDependencyInfos ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2( ArrayProxy const & events, - ArrayProxy const & dependencyInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( events.size() == dependencyInfos.size() ); -# else - if ( events.size() != dependencyInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::waitEvents2: events.size() != dependencyInfos.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdWaitEvents2( m_commandBuffer, - events.size(), - reinterpret_cast( events.data() ), - reinterpret_cast( dependencyInfos.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPipelineBarrier2( m_commandBuffer, reinterpret_cast( pDependencyInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPipelineBarrier2( m_commandBuffer, reinterpret_cast( &dependencyInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteTimestamp2( m_commandBuffer, static_cast( stage ), static_cast( queryPool ), query ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::submit2( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo2 * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkQueueSubmit2( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Queue::submit2( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueueSubmit2( m_queue, submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit2" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 * pCopyBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBuffer2( m_commandBuffer, reinterpret_cast( pCopyBufferInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBuffer2( m_commandBuffer, reinterpret_cast( ©BufferInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 * pCopyImageInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImage2( m_commandBuffer, reinterpret_cast( pCopyImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImage2( m_commandBuffer, reinterpret_cast( ©ImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 * pCopyBufferToImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBufferToImage2( m_commandBuffer, reinterpret_cast( pCopyBufferToImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBufferToImage2( m_commandBuffer, reinterpret_cast( ©BufferToImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 * pCopyImageToBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImageToBuffer2( m_commandBuffer, reinterpret_cast( pCopyImageToBufferInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImageToBuffer2( m_commandBuffer, reinterpret_cast( ©ImageToBufferInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 * pBlitImageInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBlitImage2( m_commandBuffer, reinterpret_cast( pBlitImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBlitImage2( m_commandBuffer, reinterpret_cast( &blitImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 * pResolveImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResolveImage2( m_commandBuffer, reinterpret_cast( pResolveImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdResolveImage2( m_commandBuffer, reinterpret_cast( &resolveImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginRendering( m_commandBuffer, reinterpret_cast( pRenderingInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginRendering( m_commandBuffer, reinterpret_cast( &renderingInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endRendering( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndRendering( m_commandBuffer ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setCullMode( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetCullMode( m_commandBuffer, static_cast( cullMode ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setFrontFace( VULKAN_HPP_NAMESPACE::FrontFace frontFace, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetFrontFace( m_commandBuffer, static_cast( frontFace ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveTopology( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetPrimitiveTopology( m_commandBuffer, static_cast( primitiveTopology ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWithCount( uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetViewportWithCount( m_commandBuffer, viewportCount, reinterpret_cast( pViewports ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWithCount( ArrayProxy const & viewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetViewportWithCount( m_commandBuffer, viewports.size(), reinterpret_cast( viewports.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - CommandBuffer::setScissorWithCount( uint32_t scissorCount, const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetScissorWithCount( m_commandBuffer, scissorCount, reinterpret_cast( pScissors ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setScissorWithCount( ArrayProxy const & scissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetScissorWithCount( m_commandBuffer, scissors.size(), reinterpret_cast( scissors.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - const VULKAN_HPP_NAMESPACE::DeviceSize * pStrides, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindVertexBuffers2( m_commandBuffer, - firstBinding, - bindingCount, - reinterpret_cast( pBuffers ), - reinterpret_cast( pOffsets ), - reinterpret_cast( pSizes ), - reinterpret_cast( pStrides ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes, - ArrayProxy const & strides, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( buffers.size() == offsets.size() ); - VULKAN_HPP_ASSERT( sizes.empty() || buffers.size() == sizes.size() ); - VULKAN_HPP_ASSERT( strides.empty() || buffers.size() == strides.size() ); -# else - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != sizes.size()" ); - } - if ( !strides.empty() && buffers.size() != strides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != strides.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBindVertexBuffers2( m_commandBuffer, - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ), - reinterpret_cast( strides.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthTestEnable( m_commandBuffer, static_cast( depthTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthWriteEnable( m_commandBuffer, static_cast( depthWriteEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthCompareOp( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthCompareOp( m_commandBuffer, static_cast( depthCompareOp ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthBoundsTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBoundsTestEnable( m_commandBuffer, static_cast( depthBoundsTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setStencilTestEnable( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilTestEnable( m_commandBuffer, static_cast( stencilTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setStencilOp( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilOp( m_commandBuffer, - static_cast( faceMask ), - static_cast( failOp ), - static_cast( passOp ), - static_cast( depthFailOp ), - static_cast( compareOp ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setRasterizerDiscardEnable( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetRasterizerDiscardEnable( m_commandBuffer, static_cast( rasterizerDiscardEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthBiasEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBiasEnable( m_commandBuffer, static_cast( depthBiasEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveRestartEnable( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetPrimitiveRestartEnable( m_commandBuffer, static_cast( primitiveRestartEnable ) ); - } - - template - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceBufferMemoryRequirements( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetDeviceBufferMemoryRequirements( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetDeviceBufferMemoryRequirements( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceImageMemoryRequirements( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetDeviceImageMemoryRequirements( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetDeviceImageMemoryRequirements( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceImageSparseMemoryRequirements( m_device, - reinterpret_cast( pInfo ), - pSparseMemoryRequirementCount, - reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - d.vkGetDeviceImageSparseMemoryRequirements( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetDeviceImageSparseMemoryRequirements( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements( - sparseImageMemoryRequirements2Allocator ); - uint32_t sparseMemoryRequirementCount; - d.vkGetDeviceImageSparseMemoryRequirements( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetDeviceImageSparseMemoryRequirements( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_surface === - - template - VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroySurfaceKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySurfaceKHR( m_instance, - static_cast( surface ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySurfaceKHR( m_instance, static_cast( surface ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySurfaceKHR( m_instance, - static_cast( surface ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, - VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::Bool32 * pSupported, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceSupportKHR( - m_physicalDevice, queueFamilyIndex, static_cast( surface ), reinterpret_cast( pSupported ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Bool32 supported; - VkResult result = d.vkGetPhysicalDeviceSurfaceSupportKHR( - m_physicalDevice, queueFamilyIndex, static_cast( surface ), reinterpret_cast( &supported ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceSupportKHR" ); - - return createResultValueType( static_cast( result ), supported ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR * pSurfaceCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR surfaceCapabilities; - VkResult result = d.vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilitiesKHR" ); - - return createResultValueType( static_cast( result ), surfaceCapabilities ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pSurfaceFormatCount, - VULKAN_HPP_NAMESPACE::SurfaceFormatKHR * pSurfaceFormats, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceFormatsKHR( - m_physicalDevice, static_cast( surface ), pSurfaceFormatCount, reinterpret_cast( pSurfaceFormats ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = d.vkGetPhysicalDeviceSurfaceFormatsKHR( - m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormatsKHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return createResultValueType( static_cast( result ), surfaceFormats ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - SurfaceFormatKHRAllocator & surfaceFormatKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector surfaceFormats( surfaceFormatKHRAllocator ); - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormatsKHR( m_physicalDevice, static_cast( surface ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = d.vkGetPhysicalDeviceSurfaceFormatsKHR( - m_physicalDevice, static_cast( surface ), &surfaceFormatCount, reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormatsKHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return createResultValueType( static_cast( result ), surfaceFormats ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pPresentModeCount, - VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfacePresentModesKHR( - m_physicalDevice, static_cast( surface ), pPresentModeCount, reinterpret_cast( pPresentModes ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentModes; - uint32_t presentModeCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = d.vkGetPhysicalDeviceSurfacePresentModesKHR( - m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModesKHR" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return createResultValueType( static_cast( result ), presentModes ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - PresentModeKHRAllocator & presentModeKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentModes( presentModeKHRAllocator ); - uint32_t presentModeCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfacePresentModesKHR( m_physicalDevice, static_cast( surface ), &presentModeCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = d.vkGetPhysicalDeviceSurfacePresentModesKHR( - m_physicalDevice, static_cast( surface ), &presentModeCount, reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModesKHR" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return createResultValueType( static_cast( result ), presentModes ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_swapchain === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchain, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSwapchainKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSwapchain ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain; - VkResult result = - d.vkCreateSwapchainKHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSwapchainKHR" ); - - return createResultValueType( static_cast( result ), swapchain ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSwapchainKHRUnique( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain; - VkResult result = - d.vkCreateSwapchainKHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSwapchainKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( swapchain, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroySwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroySwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySwapchainKHR( m_device, - static_cast( swapchain ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySwapchainKHR( m_device, static_cast( swapchain ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySwapchainKHR( m_device, - static_cast( swapchain ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint32_t * pSwapchainImageCount, - VULKAN_HPP_NAMESPACE::Image * pSwapchainImages, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), pSwapchainImageCount, reinterpret_cast( pSwapchainImages ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchainImages; - uint32_t swapchainImageCount; - VkResult result; - do - { - result = d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ); - if ( ( result == VK_SUCCESS ) && swapchainImageCount ) - { - swapchainImages.resize( swapchainImageCount ); - result = d.vkGetSwapchainImagesKHR( - m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainImagesKHR" ); - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); - if ( swapchainImageCount < swapchainImages.size() ) - { - swapchainImages.resize( swapchainImageCount ); - } - return createResultValueType( static_cast( result ), swapchainImages ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, ImageAllocator & imageAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchainImages( imageAllocator ); - uint32_t swapchainImageCount; - VkResult result; - do - { - result = d.vkGetSwapchainImagesKHR( m_device, static_cast( swapchain ), &swapchainImageCount, nullptr ); - if ( ( result == VK_SUCCESS ) && swapchainImageCount ) - { - swapchainImages.resize( swapchainImageCount ); - result = d.vkGetSwapchainImagesKHR( - m_device, static_cast( swapchain ), &swapchainImageCount, reinterpret_cast( swapchainImages.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainImagesKHR" ); - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); - if ( swapchainImageCount < swapchainImages.size() ) - { - swapchainImages.resize( swapchainImageCount ); - } - return createResultValueType( static_cast( result ), swapchainImages ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::acquireNextImageKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t timeout, - VULKAN_HPP_NAMESPACE::Semaphore semaphore, - VULKAN_HPP_NAMESPACE::Fence fence, - uint32_t * pImageIndex, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireNextImageKHR( - m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), pImageIndex ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue Device::acquireNextImageKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t timeout, - VULKAN_HPP_NAMESPACE::Semaphore semaphore, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint32_t imageIndex; - VkResult result = d.vkAcquireNextImageKHR( - m_device, static_cast( swapchain ), timeout, static_cast( semaphore ), static_cast( fence ), &imageIndex ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::acquireNextImageKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eTimeout, - VULKAN_HPP_NAMESPACE::Result::eNotReady, - VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return ResultValue( static_cast( result ), imageIndex ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR * pPresentInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkQueuePresentKHR( m_queue, reinterpret_cast( pPresentInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Queue::presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR & presentInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueuePresentKHR( m_queue, reinterpret_cast( &presentInfo ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Queue::presentKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getGroupPresentCapabilitiesKHR( - VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetDeviceGroupPresentCapabilitiesKHR( m_device, reinterpret_cast( pDeviceGroupPresentCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getGroupPresentCapabilitiesKHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR deviceGroupPresentCapabilities; - VkResult result = - d.vkGetDeviceGroupPresentCapabilitiesKHR( m_device, reinterpret_cast( &deviceGroupPresentCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupPresentCapabilitiesKHR" ); - - return createResultValueType( static_cast( result ), deviceGroupPresentCapabilities ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR * pModes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDeviceGroupSurfacePresentModesKHR( - m_device, static_cast( surface ), reinterpret_cast( pModes ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes; - VkResult result = d.vkGetDeviceGroupSurfacePresentModesKHR( - m_device, static_cast( surface ), reinterpret_cast( &modes ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModesKHR" ); - - return createResultValueType( static_cast( result ), modes ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pRectCount, - VULKAN_HPP_NAMESPACE::Rect2D * pRects, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), pRectCount, reinterpret_cast( pRects ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector rects; - uint32_t rectCount; - VkResult result; - do - { - result = d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, nullptr ); - if ( ( result == VK_SUCCESS ) && rectCount ) - { - rects.resize( rectCount ); - result = d.vkGetPhysicalDevicePresentRectanglesKHR( - m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getPresentRectanglesKHR" ); - VULKAN_HPP_ASSERT( rectCount <= rects.size() ); - if ( rectCount < rects.size() ) - { - rects.resize( rectCount ); - } - return createResultValueType( static_cast( result ), rects ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Rect2DAllocator & rect2DAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector rects( rect2DAllocator ); - uint32_t rectCount; - VkResult result; - do - { - result = d.vkGetPhysicalDevicePresentRectanglesKHR( m_physicalDevice, static_cast( surface ), &rectCount, nullptr ); - if ( ( result == VK_SUCCESS ) && rectCount ) - { - rects.resize( rectCount ); - result = d.vkGetPhysicalDevicePresentRectanglesKHR( - m_physicalDevice, static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getPresentRectanglesKHR" ); - VULKAN_HPP_ASSERT( rectCount <= rects.size() ); - if ( rectCount < rects.size() ) - { - rects.resize( rectCount ); - } - return createResultValueType( static_cast( result ), rects ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR * pAcquireInfo, - uint32_t * pImageIndex, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireNextImage2KHR( m_device, reinterpret_cast( pAcquireInfo ), pImageIndex ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue Device::acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR & acquireInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint32_t imageIndex; - VkResult result = d.vkAcquireNextImage2KHR( m_device, reinterpret_cast( &acquireInfo ), &imageIndex ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::acquireNextImage2KHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eTimeout, - VULKAN_HPP_NAMESPACE::Result::eNotReady, - VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return ResultValue( static_cast( result ), imageIndex ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_display === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPropertiesKHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDisplayPropertiesKHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDisplayPropertiesKHR( DisplayPropertiesKHRAllocator & displayPropertiesKHRAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayPropertiesKHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPropertiesKHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlanePropertiesKHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayPlanePropertiesKHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlanePropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayPlanePropertiesKHR( DisplayPlanePropertiesKHRAllocator & displayPlanePropertiesKHRAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayPlanePropertiesKHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlanePropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, - uint32_t * pDisplayCount, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplays, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, pDisplayCount, reinterpret_cast( pDisplays ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector displays; - uint32_t displayCount; - VkResult result; - do - { - result = d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ); - if ( ( result == VK_SUCCESS ) && displayCount ) - { - displays.resize( displayCount ); - result = d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); - if ( displayCount < displays.size() ) - { - displays.resize( displayCount ); - } - return createResultValueType( static_cast( result ), displays ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, DisplayKHRAllocator & displayKHRAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector displays( displayKHRAllocator ); - uint32_t displayCount; - VkResult result; - do - { - result = d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, nullptr ); - if ( ( result == VK_SUCCESS ) && displayCount ) - { - displays.resize( displayCount ); - result = d.vkGetDisplayPlaneSupportedDisplaysKHR( m_physicalDevice, planeIndex, &displayCount, reinterpret_cast( displays.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR" ); - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); - if ( displayCount < displays.size() ) - { - displays.resize( displayCount ); - } - return createResultValueType( static_cast( result ), displays ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDisplayModePropertiesKHR( - m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetDisplayModePropertiesKHR( - m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayModePropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - DisplayModePropertiesKHRAllocator & displayModePropertiesKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayModePropertiesKHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetDisplayModePropertiesKHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetDisplayModePropertiesKHR( - m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayModePropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::createDisplayModeKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DisplayModeKHR * pMode, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDisplayModeKHR( m_physicalDevice, - static_cast( display ), - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pMode ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::createDisplayModeKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayModeKHR mode; - VkResult result = - d.vkCreateDisplayModeKHR( m_physicalDevice, - static_cast( display ), - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &mode ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::createDisplayModeKHR" ); - - return createResultValueType( static_cast( result ), mode ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::createDisplayModeKHRUnique( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayModeKHR mode; - VkResult result = - d.vkCreateDisplayModeKHR( m_physicalDevice, - static_cast( display ), - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &mode ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::createDisplayModeKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( mode, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getDisplayPlaneCapabilitiesKHR( VULKAN_HPP_NAMESPACE::DisplayModeKHR mode, - uint32_t planeIndex, - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR * pCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDisplayPlaneCapabilitiesKHR( - m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( pCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getDisplayPlaneCapabilitiesKHR( VULKAN_HPP_NAMESPACE::DisplayModeKHR mode, uint32_t planeIndex, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR capabilities; - VkResult result = d.vkGetDisplayPlaneCapabilitiesKHR( - m_physicalDevice, static_cast( mode ), planeIndex, reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneCapabilitiesKHR" ); - - return createResultValueType( static_cast( result ), capabilities ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createDisplayPlaneSurfaceKHR( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDisplayPlaneSurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createDisplayPlaneSurfaceKHR( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateDisplayPlaneSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDisplayPlaneSurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createDisplayPlaneSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateDisplayPlaneSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDisplayPlaneSurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_display_swapchain === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createSharedSwapchainsKHR( uint32_t swapchainCount, - const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSharedSwapchainsKHR( m_device, - swapchainCount, - reinterpret_cast( pCreateInfos ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSwapchains ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSharedSwapchainsKHR( ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchains( createInfos.size() ); - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( swapchains.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainsKHR" ); - - return createResultValueType( static_cast( result ), swapchains ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSharedSwapchainsKHR( ArrayProxy const & createInfos, - Optional allocator, - SwapchainKHRAllocator & swapchainKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchains( createInfos.size(), swapchainKHRAllocator ); - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( swapchains.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainsKHR" ); - - return createResultValueType( static_cast( result ), swapchains ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createSharedSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain; - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainKHR" ); - - return createResultValueType( static_cast( result ), swapchain ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, SwapchainKHRAllocator>>::type - Device::createSharedSwapchainsKHRUnique( ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchains( createInfos.size() ); - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( swapchains.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainsKHRUnique" ); - std::vector, SwapchainKHRAllocator> uniqueSwapchains; - uniqueSwapchains.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & swapchain : swapchains ) - { - uniqueSwapchains.push_back( UniqueHandle( swapchain, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueSwapchains ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, SwapchainKHRAllocator>>::type - Device::createSharedSwapchainsKHRUnique( ArrayProxy const & createInfos, - Optional allocator, - SwapchainKHRAllocator & swapchainKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector swapchains( createInfos.size() ); - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( swapchains.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainsKHRUnique" ); - std::vector, SwapchainKHRAllocator> uniqueSwapchains( swapchainKHRAllocator ); - uniqueSwapchains.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & swapchain : swapchains ) - { - uniqueSwapchains.push_back( UniqueHandle( swapchain, deleter ) ); - } - return createResultValueType( static_cast( result ), std::move( uniqueSwapchains ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSharedSwapchainKHRUnique( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain; - VkResult result = d.vkCreateSharedSwapchainsKHR( - m_device, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSharedSwapchainKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( swapchain, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createXlibSurfaceKHR( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateXlibSurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createXlibSurfaceKHR( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateXlibSurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createXlibSurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createXlibSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateXlibSurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createXlibSurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 - PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display * dpy, VisualID visualID, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, dpy, visualID ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkBool32 result = d.vkGetPhysicalDeviceXlibPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &dpy, visualID ); - - return static_cast( result ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createXcbSurfaceKHR( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateXcbSurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createXcbSurfaceKHR( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateXcbSurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createXcbSurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createXcbSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateXcbSurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createXcbSurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, - xcb_connection_t * connection, - xcb_visualid_t visual_id, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, connection, visual_id ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 PhysicalDevice::getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, - xcb_connection_t & connection, - xcb_visualid_t visual_id, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkBool32 result = d.vkGetPhysicalDeviceXcbPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &connection, visual_id ); - - return static_cast( result ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createWaylandSurfaceKHR( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateWaylandSurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createWaylandSurfaceKHR( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateWaylandSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createWaylandSurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createWaylandSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateWaylandSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createWaylandSurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, - struct wl_display * display, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, display ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkBool32 result = d.vkGetPhysicalDeviceWaylandPresentationSupportKHR( m_physicalDevice, queueFamilyIndex, &display ); - - return static_cast( result ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createAndroidSurfaceKHR( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateAndroidSurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createAndroidSurfaceKHR( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateAndroidSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createAndroidSurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createAndroidSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateAndroidSurfaceKHR( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createAndroidSurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createWin32SurfaceKHR( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateWin32SurfaceKHR( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createWin32SurfaceKHR( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateWin32SurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createWin32SurfaceKHR" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createWin32SurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateWin32SurfaceKHR( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createWin32SurfaceKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceWin32PresentationSupportKHR( m_physicalDevice, queueFamilyIndex ) ); - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::createDebugReportCallbackEXT( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT * pCallback, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDebugReportCallbackEXT( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pCallback ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createDebugReportCallbackEXT( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback; - VkResult result = d.vkCreateDebugReportCallbackEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &callback ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDebugReportCallbackEXT" ); - - return createResultValueType( static_cast( result ), callback ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createDebugReportCallbackEXTUnique( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback; - VkResult result = d.vkCreateDebugReportCallbackEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &callback ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDebugReportCallbackEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( callback, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDebugReportCallbackEXT( - m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroyDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDebugReportCallbackEXT( - m_instance, - static_cast( callback ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDebugReportCallbackEXT( - m_instance, static_cast( callback ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDebugReportCallbackEXT( - m_instance, - static_cast( callback ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char * pLayerPrefix, - const char * pMessage, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDebugReportMessageEXT( m_instance, - static_cast( flags ), - static_cast( objectType ), - object, - location, - messageCode, - pLayerPrefix, - pMessage ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const std::string & layerPrefix, - const std::string & message, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDebugReportMessageEXT( m_instance, - static_cast( flags ), - static_cast( objectType ), - object, - location, - messageCode, - layerPrefix.c_str(), - message.c_str() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_debug_marker === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT * pTagInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT & tagInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkDebugMarkerSetObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::debugMarkerSetObjectTagEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT * pNameInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT & nameInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkDebugMarkerSetObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::debugMarkerSetObjectNameEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT * pMarkerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdDebugMarkerBeginEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDebugMarkerEndEXT( m_commandBuffer ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT * pMarkerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdDebugMarkerInsertEXT( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pVideoProfile, - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR * pCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceVideoCapabilitiesKHR( - m_physicalDevice, reinterpret_cast( pVideoProfile ), reinterpret_cast( pCapabilities ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR capabilities; - VkResult result = d.vkGetPhysicalDeviceVideoCapabilitiesKHR( - m_physicalDevice, reinterpret_cast( &videoProfile ), reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoCapabilitiesKHR" ); - - return createResultValueType( static_cast( result ), capabilities ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR & capabilities = structureChain.template get(); - VkResult result = d.vkGetPhysicalDeviceVideoCapabilitiesKHR( - m_physicalDevice, reinterpret_cast( &videoProfile ), reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoCapabilitiesKHR" ); - - return createResultValueType( static_cast( result ), structureChain ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR * pVideoFormatInfo, - uint32_t * pVideoFormatPropertyCount, - VULKAN_HPP_NAMESPACE::VideoFormatPropertiesKHR * pVideoFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceVideoFormatPropertiesKHR( m_physicalDevice, - reinterpret_cast( pVideoFormatInfo ), - pVideoFormatPropertyCount, - reinterpret_cast( pVideoFormatProperties ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector videoFormatProperties; - uint32_t videoFormatPropertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceVideoFormatPropertiesKHR( - m_physicalDevice, reinterpret_cast( &videoFormatInfo ), &videoFormatPropertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && videoFormatPropertyCount ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - result = d.vkGetPhysicalDeviceVideoFormatPropertiesKHR( m_physicalDevice, - reinterpret_cast( &videoFormatInfo ), - &videoFormatPropertyCount, - reinterpret_cast( videoFormatProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoFormatPropertiesKHR" ); - VULKAN_HPP_ASSERT( videoFormatPropertyCount <= videoFormatProperties.size() ); - if ( videoFormatPropertyCount < videoFormatProperties.size() ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - } - return createResultValueType( static_cast( result ), videoFormatProperties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo, - VideoFormatPropertiesKHRAllocator & videoFormatPropertiesKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector videoFormatProperties( videoFormatPropertiesKHRAllocator ); - uint32_t videoFormatPropertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceVideoFormatPropertiesKHR( - m_physicalDevice, reinterpret_cast( &videoFormatInfo ), &videoFormatPropertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && videoFormatPropertyCount ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - result = d.vkGetPhysicalDeviceVideoFormatPropertiesKHR( m_physicalDevice, - reinterpret_cast( &videoFormatInfo ), - &videoFormatPropertyCount, - reinterpret_cast( videoFormatProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoFormatPropertiesKHR" ); - VULKAN_HPP_ASSERT( videoFormatPropertyCount <= videoFormatProperties.size() ); - if ( videoFormatPropertyCount < videoFormatProperties.size() ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - } - return createResultValueType( static_cast( result ), videoFormatProperties ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createVideoSessionKHR( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::VideoSessionKHR * pVideoSession, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateVideoSessionKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pVideoSession ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createVideoSessionKHR( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession; - VkResult result = - d.vkCreateVideoSessionKHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &videoSession ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createVideoSessionKHR" ); - - return createResultValueType( static_cast( result ), videoSession ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createVideoSessionKHRUnique( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession; - VkResult result = - d.vkCreateVideoSessionKHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &videoSession ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createVideoSessionKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( videoSession, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyVideoSessionKHR( m_device, static_cast( videoSession ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyVideoSessionKHR( - m_device, - static_cast( videoSession ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyVideoSessionKHR( m_device, static_cast( videoSession ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyVideoSessionKHR( - m_device, - static_cast( videoSession ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - uint32_t * pMemoryRequirementsCount, - VULKAN_HPP_NAMESPACE::VideoSessionMemoryRequirementsKHR * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetVideoSessionMemoryRequirementsKHR( m_device, - static_cast( videoSession ), - pMemoryRequirementsCount, - reinterpret_cast( pMemoryRequirements ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector memoryRequirements; - uint32_t memoryRequirementsCount; - VkResult result; - do - { - result = d.vkGetVideoSessionMemoryRequirementsKHR( m_device, static_cast( videoSession ), &memoryRequirementsCount, nullptr ); - if ( ( result == VK_SUCCESS ) && memoryRequirementsCount ) - { - memoryRequirements.resize( memoryRequirementsCount ); - result = d.vkGetVideoSessionMemoryRequirementsKHR( m_device, - static_cast( videoSession ), - &memoryRequirementsCount, - reinterpret_cast( memoryRequirements.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getVideoSessionMemoryRequirementsKHR" ); - VULKAN_HPP_ASSERT( memoryRequirementsCount <= memoryRequirements.size() ); - if ( memoryRequirementsCount < memoryRequirements.size() ) - { - memoryRequirements.resize( memoryRequirementsCount ); - } - return createResultValueType( static_cast( result ), memoryRequirements ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - VideoSessionMemoryRequirementsKHRAllocator & videoSessionMemoryRequirementsKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector memoryRequirements( - videoSessionMemoryRequirementsKHRAllocator ); - uint32_t memoryRequirementsCount; - VkResult result; - do - { - result = d.vkGetVideoSessionMemoryRequirementsKHR( m_device, static_cast( videoSession ), &memoryRequirementsCount, nullptr ); - if ( ( result == VK_SUCCESS ) && memoryRequirementsCount ) - { - memoryRequirements.resize( memoryRequirementsCount ); - result = d.vkGetVideoSessionMemoryRequirementsKHR( m_device, - static_cast( videoSession ), - &memoryRequirementsCount, - reinterpret_cast( memoryRequirements.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getVideoSessionMemoryRequirementsKHR" ); - VULKAN_HPP_ASSERT( memoryRequirementsCount <= memoryRequirements.size() ); - if ( memoryRequirementsCount < memoryRequirements.size() ) - { - memoryRequirements.resize( memoryRequirementsCount ); - } - return createResultValueType( static_cast( result ), memoryRequirements ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::bindVideoSessionMemoryKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - uint32_t bindSessionMemoryInfoCount, - const VULKAN_HPP_NAMESPACE::BindVideoSessionMemoryInfoKHR * pBindSessionMemoryInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBindVideoSessionMemoryKHR( m_device, - static_cast( videoSession ), - bindSessionMemoryInfoCount, - reinterpret_cast( pBindSessionMemoryInfos ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindVideoSessionMemoryKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - ArrayProxy const & bindSessionMemoryInfos, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindVideoSessionMemoryKHR( m_device, - static_cast( videoSession ), - bindSessionMemoryInfos.size(), - reinterpret_cast( bindSessionMemoryInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindVideoSessionMemoryKHR" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createVideoSessionParametersKHR( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR * pVideoSessionParameters, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateVideoSessionParametersKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pVideoSessionParameters ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createVideoSessionParametersKHR( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters; - VkResult result = d.vkCreateVideoSessionParametersKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &videoSessionParameters ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createVideoSessionParametersKHR" ); - - return createResultValueType( static_cast( result ), videoSessionParameters ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createVideoSessionParametersKHRUnique( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters; - VkResult result = d.vkCreateVideoSessionParametersKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &videoSessionParameters ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createVideoSessionParametersKHRUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( - videoSessionParameters, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::updateVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR * pUpdateInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkUpdateVideoSessionParametersKHR( m_device, - static_cast( videoSessionParameters ), - reinterpret_cast( pUpdateInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::updateVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR & updateInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkUpdateVideoSessionParametersKHR( m_device, - static_cast( videoSessionParameters ), - reinterpret_cast( &updateInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::updateVideoSessionParametersKHR" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyVideoSessionParametersKHR( - m_device, static_cast( videoSessionParameters ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyVideoSessionParametersKHR( - m_device, - static_cast( videoSessionParameters ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyVideoSessionParametersKHR( - m_device, static_cast( videoSessionParameters ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyVideoSessionParametersKHR( - m_device, - static_cast( videoSessionParameters ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR * pBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginVideoCodingKHR( m_commandBuffer, reinterpret_cast( pBeginInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR & beginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginVideoCodingKHR( m_commandBuffer, reinterpret_cast( &beginInfo ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR * pEndCodingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndVideoCodingKHR( m_commandBuffer, reinterpret_cast( pEndCodingInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR & endCodingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdEndVideoCodingKHR( m_commandBuffer, reinterpret_cast( &endCodingInfo ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR * pCodingControlInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdControlVideoCodingKHR( m_commandBuffer, reinterpret_cast( pCodingControlInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR & codingControlInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdControlVideoCodingKHR( m_commandBuffer, reinterpret_cast( &codingControlInfo ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - template - VULKAN_HPP_INLINE void CommandBuffer::decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR * pFrameInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDecodeVideoKHR( m_commandBuffer, reinterpret_cast( pFrameInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR & frameInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdDecodeVideoKHR( m_commandBuffer, reinterpret_cast( &frameInfo ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - template - VULKAN_HPP_INLINE void CommandBuffer::bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindTransformFeedbackBuffersEXT( m_commandBuffer, - firstBinding, - bindingCount, - reinterpret_cast( pBuffers ), - reinterpret_cast( pOffsets ), - reinterpret_cast( pSizes ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( buffers.size() == offsets.size() ); - VULKAN_HPP_ASSERT( sizes.empty() || buffers.size() == sizes.size() ); -# else - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindTransformFeedbackBuffersEXT: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindTransformFeedbackBuffersEXT: buffers.size() != sizes.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBindTransformFeedbackBuffersEXT( m_commandBuffer, - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VULKAN_HPP_NAMESPACE::Buffer * pCounterBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pCounterBufferOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginTransformFeedbackEXT( m_commandBuffer, - firstCounterBuffer, - counterBufferCount, - reinterpret_cast( pCounterBuffers ), - reinterpret_cast( pCounterBufferOffsets ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( counterBufferOffsets.empty() || counterBuffers.size() == counterBufferOffsets.size() ); -# else - if ( !counterBufferOffsets.empty() && counterBuffers.size() != counterBufferOffsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::beginTransformFeedbackEXT: counterBuffers.size() != counterBufferOffsets.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBeginTransformFeedbackEXT( m_commandBuffer, - firstCounterBuffer, - counterBuffers.size(), - reinterpret_cast( counterBuffers.data() ), - reinterpret_cast( counterBufferOffsets.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endTransformFeedbackEXT( uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VULKAN_HPP_NAMESPACE::Buffer * pCounterBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pCounterBufferOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndTransformFeedbackEXT( m_commandBuffer, - firstCounterBuffer, - counterBufferCount, - reinterpret_cast( pCounterBuffers ), - reinterpret_cast( pCounterBufferOffsets ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::endTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( counterBufferOffsets.empty() || counterBuffers.size() == counterBufferOffsets.size() ); -# else - if ( !counterBufferOffsets.empty() && counterBuffers.size() != counterBufferOffsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::endTransformFeedbackEXT: counterBuffers.size() != counterBufferOffsets.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdEndTransformFeedbackEXT( m_commandBuffer, - firstCounterBuffer, - counterBuffers.size(), - reinterpret_cast( counterBuffers.data() ), - reinterpret_cast( counterBufferOffsets.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - uint32_t index, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginQueryIndexedEXT( m_commandBuffer, static_cast( queryPool ), query, static_cast( flags ), index ); - } - - template - VULKAN_HPP_INLINE void - CommandBuffer::endQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query, uint32_t index, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndQueryIndexedEXT( m_commandBuffer, static_cast( queryPool ), query, index ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectByteCountEXT( uint32_t instanceCount, - uint32_t firstInstance, - VULKAN_HPP_NAMESPACE::Buffer counterBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize counterBufferOffset, - uint32_t counterOffset, - uint32_t vertexStride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndirectByteCountEXT( m_commandBuffer, - instanceCount, - firstInstance, - static_cast( counterBuffer ), - static_cast( counterBufferOffset ), - counterOffset, - vertexStride ); - } - - //=== VK_NVX_binary_import === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createCuModuleNVX( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CuModuleNVX * pModule, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateCuModuleNVX( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pModule ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createCuModuleNVX( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CuModuleNVX module; - VkResult result = - d.vkCreateCuModuleNVX( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &module ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCuModuleNVX" ); - - return createResultValueType( static_cast( result ), module ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createCuModuleNVXUnique( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CuModuleNVX module; - VkResult result = - d.vkCreateCuModuleNVX( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &module ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCuModuleNVXUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( module, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createCuFunctionNVX( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CuFunctionNVX * pFunction, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateCuFunctionNVX( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pFunction ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createCuFunctionNVX( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CuFunctionNVX function; - VkResult result = - d.vkCreateCuFunctionNVX( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &function ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCuFunctionNVX" ); - - return createResultValueType( static_cast( result ), function ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createCuFunctionNVXUnique( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::CuFunctionNVX function; - VkResult result = - d.vkCreateCuFunctionNVX( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &function ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createCuFunctionNVXUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( function, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCuModuleNVX( m_device, static_cast( module ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCuModuleNVX( m_device, - static_cast( module ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCuModuleNVX( m_device, static_cast( module ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCuModuleNVX( m_device, - static_cast( module ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCuFunctionNVX( m_device, static_cast( function ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCuFunctionNVX( m_device, - static_cast( function ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyCuFunctionNVX( m_device, static_cast( function ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyCuFunctionNVX( m_device, - static_cast( function ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX * pLaunchInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCuLaunchKernelNVX( m_commandBuffer, reinterpret_cast( pLaunchInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX & launchInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCuLaunchKernelNVX( m_commandBuffer, reinterpret_cast( &launchInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NVX_image_view_handle === - - template - VULKAN_HPP_INLINE uint32_t Device::getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetImageViewHandleNVX( m_device, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE uint32_t Device::getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint32_t result = d.vkGetImageViewHandleNVX( m_device, reinterpret_cast( &info ) ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getImageViewAddressNVX( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetImageViewAddressNVX( m_device, static_cast( imageView ), reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getImageViewAddressNVX( VULKAN_HPP_NAMESPACE::ImageView imageView, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX properties; - VkResult result = - d.vkGetImageViewAddressNVX( m_device, static_cast( imageView ), reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getImageViewAddressNVX" ); - - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_draw_indirect_count === - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndirectCountAMD( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndexedIndirectCountAMD( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_AMD_shader_info === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - size_t * pInfoSize, - void * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetShaderInfoAMD( m_device, - static_cast( pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - pInfoSize, - pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector info; - size_t infoSize; - VkResult result; - do - { - result = d.vkGetShaderInfoAMD( m_device, - static_cast( pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - nullptr ); - if ( ( result == VK_SUCCESS ) && infoSize ) - { - info.resize( infoSize ); - result = d.vkGetShaderInfoAMD( m_device, - static_cast( pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - reinterpret_cast( info.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getShaderInfoAMD" ); - VULKAN_HPP_ASSERT( infoSize <= info.size() ); - if ( infoSize < info.size() ) - { - info.resize( infoSize ); - } - return createResultValueType( static_cast( result ), info ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - Uint8_tAllocator & uint8_tAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector info( uint8_tAllocator ); - size_t infoSize; - VkResult result; - do - { - result = d.vkGetShaderInfoAMD( m_device, - static_cast( pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - nullptr ); - if ( ( result == VK_SUCCESS ) && infoSize ) - { - info.resize( infoSize ); - result = d.vkGetShaderInfoAMD( m_device, - static_cast( pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - reinterpret_cast( info.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getShaderInfoAMD" ); - VULKAN_HPP_ASSERT( infoSize <= info.size() ); - if ( infoSize < info.size() ) - { - info.resize( infoSize ); - } - return createResultValueType( static_cast( result ), info ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_dynamic_rendering === - - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginRenderingKHR( m_commandBuffer, reinterpret_cast( pRenderingInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginRenderingKHR( m_commandBuffer, reinterpret_cast( &renderingInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderingKHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndRenderingKHR( m_commandBuffer ); - } - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::createStreamDescriptorSurfaceGGP( const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateStreamDescriptorSurfaceGGP( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createStreamDescriptorSurfaceGGP( const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateStreamDescriptorSurfaceGGP( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createStreamDescriptorSurfaceGGP" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createStreamDescriptorSurfaceGGPUnique( const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateStreamDescriptorSurfaceGGP( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createStreamDescriptorSurfaceGGPUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType, - VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV * pExternalImageFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - static_cast( externalHandleType ), - reinterpret_cast( pExternalImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV externalImageFormatProperties; - VkResult result = - d.vkGetPhysicalDeviceExternalImageFormatPropertiesNV( m_physicalDevice, - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - static_cast( externalHandleType ), - reinterpret_cast( &externalImageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getExternalImageFormatPropertiesNV" ); - - return createResultValueType( static_cast( result ), externalImageFormatProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleNV( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType, - HANDLE * pHandle, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), pHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getMemoryWin32HandleNV( - VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - HANDLE handle; - VkResult result = - d.vkGetMemoryWin32HandleNV( m_device, static_cast( memory ), static_cast( handleType ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandleNV" ); - - return createResultValueType( static_cast( result ), handle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_get_physical_device_properties2 === - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFeatures2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 * pFeatures, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( pFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 - PhysicalDevice::getFeatures2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 features; - d.vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); - - return features; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 & features = structureChain.template get(); - d.vkGetPhysicalDeviceFeatures2KHR( m_physicalDevice, reinterpret_cast( &features ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getProperties2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 - PhysicalDevice::getProperties2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 properties; - d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); - - return properties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 & properties = structureChain.template get(); - d.vkGetPhysicalDeviceProperties2KHR( m_physicalDevice, reinterpret_cast( &properties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties2 * pFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceFormatProperties2KHR( - m_physicalDevice, static_cast( format ), reinterpret_cast( pFormatProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties2 - PhysicalDevice::getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::FormatProperties2 formatProperties; - d.vkGetPhysicalDeviceFormatProperties2KHR( - m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::FormatProperties2 & formatProperties = structureChain.template get(); - d.vkGetPhysicalDeviceFormatProperties2KHR( - m_physicalDevice, static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 * pImageFormatProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( pImageFormatInfo ), - reinterpret_cast( pImageFormatProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 imageFormatProperties; - VkResult result = d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2KHR" ); - - return createResultValueType( static_cast( result ), imageFormatProperties ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 & imageFormatProperties = structureChain.template get(); - VkResult result = d.vkGetPhysicalDeviceImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2KHR" ); - - return createResultValueType( static_cast( result ), structureChain ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getQueueFamilyProperties2KHR( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 * pQueueFamilyProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( - m_physicalDevice, pQueueFamilyPropertyCount, reinterpret_cast( pQueueFamilyProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2KHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2KHR( QueueFamilyProperties2Allocator & queueFamilyProperties2Allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector queueFamilyProperties( queueFamilyProperties2Allocator ); - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2KHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains; - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getQueueFamilyProperties2KHR( StructureChainAllocator & structureChainAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains( structureChainAllocator ); - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( m_physicalDevice, &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - d.vkGetPhysicalDeviceQueueFamilyProperties2KHR( - m_physicalDevice, &queueFamilyPropertyCount, reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getMemoryProperties2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 * pMemoryProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( pMemoryProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - PhysicalDevice::getMemoryProperties2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 memoryProperties; - d.vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getMemoryProperties2KHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 & memoryProperties = - structureChain.template get(); - d.vkGetPhysicalDeviceMemoryProperties2KHR( m_physicalDevice, reinterpret_cast( &memoryProperties ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( pFormatInfo ), - pPropertyCount, - reinterpret_cast( pProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - SparseImageFormatProperties2Allocator & sparseImageFormatProperties2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( sparseImageFormatProperties2Allocator ); - uint32_t propertyCount; - d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( - m_physicalDevice, reinterpret_cast( &formatInfo ), &propertyCount, nullptr ); - properties.resize( propertyCount ); - d.vkGetPhysicalDeviceSparseImageFormatProperties2KHR( m_physicalDevice, - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_device_group === - - template - VULKAN_HPP_INLINE void Device::getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags * pPeerMemoryFeatures, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceGroupPeerMemoryFeaturesKHR( - m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( pPeerMemoryFeatures ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags Device::getGroupPeerMemoryFeaturesKHR( - uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags peerMemoryFeatures; - d.vkGetDeviceGroupPeerMemoryFeaturesKHR( - m_device, heapIndex, localDeviceIndex, remoteDeviceIndex, reinterpret_cast( &peerMemoryFeatures ) ); - - return peerMemoryFeatures; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHR( uint32_t deviceMask, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDeviceMaskKHR( m_commandBuffer, deviceMask ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::dispatchBaseKHR( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDispatchBaseKHR( m_commandBuffer, baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createViSurfaceNN( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateViSurfaceNN( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createViSurfaceNN( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateViSurfaceNN( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createViSurfaceNN" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createViSurfaceNNUnique( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateViSurfaceNN( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createViSurfaceNNUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_maintenance1 === - - template - VULKAN_HPP_INLINE void Device::trimCommandPoolKHR( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkTrimCommandPoolKHR( m_device, static_cast( commandPool ), static_cast( flags ) ); - } - - //=== VK_KHR_device_group_creation === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::enumeratePhysicalDeviceGroupsKHR( uint32_t * pPhysicalDeviceGroupCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkEnumeratePhysicalDeviceGroupsKHR( - m_instance, pPhysicalDeviceGroupCount, reinterpret_cast( pPhysicalDeviceGroupProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Instance::enumeratePhysicalDeviceGroupsKHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDeviceGroupProperties; - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = d.vkEnumeratePhysicalDeviceGroupsKHR( - m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroupsKHR" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return createResultValueType( static_cast( result ), physicalDeviceGroupProperties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Instance::enumeratePhysicalDeviceGroupsKHR( PhysicalDeviceGroupPropertiesAllocator & physicalDeviceGroupPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector physicalDeviceGroupProperties( - physicalDeviceGroupPropertiesAllocator ); - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceGroupsKHR( m_instance, &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = d.vkEnumeratePhysicalDeviceGroupsKHR( - m_instance, &physicalDeviceGroupCount, reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroupsKHR" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return createResultValueType( static_cast( result ), physicalDeviceGroupProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_memory_capabilities === - - template - VULKAN_HPP_INLINE void PhysicalDevice::getExternalBufferPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VULKAN_HPP_NAMESPACE::ExternalBufferProperties * pExternalBufferProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, - reinterpret_cast( pExternalBufferInfo ), - reinterpret_cast( pExternalBufferProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalBufferProperties - PhysicalDevice::getExternalBufferPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalBufferProperties externalBufferProperties; - d.vkGetPhysicalDeviceExternalBufferPropertiesKHR( m_physicalDevice, - reinterpret_cast( &externalBufferInfo ), - reinterpret_cast( &externalBufferProperties ) ); - - return externalBufferProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR * pGetWin32HandleInfo, - HANDLE * pHandle, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - HANDLE handle; - VkResult result = d.vkGetMemoryWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandleKHR" ); - - return createResultValueType( static_cast( result ), handle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryWin32HandlePropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - HANDLE handle, - VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR * pMemoryWin32HandleProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetMemoryWin32HandlePropertiesKHR( m_device, - static_cast( handleType ), - handle, - reinterpret_cast( pMemoryWin32HandleProperties ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryWin32HandlePropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR memoryWin32HandleProperties; - VkResult result = d.vkGetMemoryWin32HandlePropertiesKHR( m_device, - static_cast( handleType ), - handle, - reinterpret_cast( &memoryWin32HandleProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandlePropertiesKHR" ); - - return createResultValueType( static_cast( result ), memoryWin32HandleProperties ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetMemoryFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR & getFdInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - int fd; - VkResult result = d.vkGetMemoryFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdKHR" ); - - return createResultValueType( static_cast( result ), fd ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getMemoryFdPropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - int fd, - VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR * pMemoryFdProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetMemoryFdPropertiesKHR( - m_device, static_cast( handleType ), fd, reinterpret_cast( pMemoryFdProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryFdPropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, int fd, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR memoryFdProperties; - VkResult result = d.vkGetMemoryFdPropertiesKHR( - m_device, static_cast( handleType ), fd, reinterpret_cast( &memoryFdProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdPropertiesKHR" ); - - return createResultValueType( static_cast( result ), memoryFdProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_semaphore_capabilities === - - template - VULKAN_HPP_INLINE void - PhysicalDevice::getExternalSemaphorePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties * pExternalSemaphoreProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, - reinterpret_cast( pExternalSemaphoreInfo ), - reinterpret_cast( pExternalSemaphoreProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - PhysicalDevice::getExternalSemaphorePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties externalSemaphoreProperties; - d.vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( m_physicalDevice, - reinterpret_cast( &externalSemaphoreInfo ), - reinterpret_cast( &externalSemaphoreProperties ) ); - - return externalSemaphoreProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::importSemaphoreWin32HandleKHR( - const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR * pImportSemaphoreWin32HandleInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pImportSemaphoreWin32HandleInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::importSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkImportSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &importSemaphoreWin32HandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreWin32HandleKHR" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSemaphoreWin32HandleKHR( - const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR * pGetWin32HandleInfo, HANDLE * pHandle, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - HANDLE handle; - VkResult result = d.vkGetSemaphoreWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreWin32HandleKHR" ); - - return createResultValueType( static_cast( result ), handle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR * pImportSemaphoreFdInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkImportSemaphoreFdKHR( m_device, reinterpret_cast( pImportSemaphoreFdInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkImportSemaphoreFdKHR( m_device, reinterpret_cast( &importSemaphoreFdInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreFdKHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetSemaphoreFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR & getFdInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - int fd; - VkResult result = d.vkGetSemaphoreFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreFdKHR" ); - - return createResultValueType( static_cast( result ), fd ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_push_descriptor === - - template - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - uint32_t descriptorWriteCount, - const VULKAN_HPP_NAMESPACE::WriteDescriptorSet * pDescriptorWrites, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPushDescriptorSetKHR( m_commandBuffer, - static_cast( pipelineBindPoint ), - static_cast( layout ), - set, - descriptorWriteCount, - reinterpret_cast( pDescriptorWrites ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - ArrayProxy const & descriptorWrites, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPushDescriptorSetKHR( m_commandBuffer, - static_cast( pipelineBindPoint ), - static_cast( layout ), - set, - descriptorWrites.size(), - reinterpret_cast( descriptorWrites.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - const void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPushDescriptorSetWithTemplateKHR( - m_commandBuffer, static_cast( descriptorUpdateTemplate ), static_cast( layout ), set, pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - DataType const & data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPushDescriptorSetWithTemplateKHR( m_commandBuffer, - static_cast( descriptorUpdateTemplate ), - static_cast( layout ), - set, - reinterpret_cast( &data ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_conditional_rendering === - - template - VULKAN_HPP_INLINE void CommandBuffer::beginConditionalRenderingEXT( const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT * pConditionalRenderingBegin, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginConditionalRenderingEXT( m_commandBuffer, reinterpret_cast( pConditionalRenderingBegin ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginConditionalRenderingEXT( const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT & conditionalRenderingBegin, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginConditionalRenderingEXT( m_commandBuffer, reinterpret_cast( &conditionalRenderingBegin ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endConditionalRenderingEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndConditionalRenderingEXT( m_commandBuffer ); - } - - //=== VK_KHR_descriptor_update_template === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createDescriptorUpdateTemplateKHR( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate * pDescriptorUpdateTemplate, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDescriptorUpdateTemplateKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pDescriptorUpdateTemplate ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createDescriptorUpdateTemplateKHR( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate; - VkResult result = d.vkCreateDescriptorUpdateTemplateKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorUpdateTemplate ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorUpdateTemplateKHR" ); - - return createResultValueType( static_cast( result ), descriptorUpdateTemplate ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createDescriptorUpdateTemplateKHRUnique( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate; - VkResult result = d.vkCreateDescriptorUpdateTemplateKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &descriptorUpdateTemplate ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDescriptorUpdateTemplateKHRUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( - descriptorUpdateTemplate, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDescriptorUpdateTemplateKHR( - m_device, static_cast( descriptorUpdateTemplate ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDescriptorUpdateTemplateKHR( - m_device, - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkUpdateDescriptorSetWithTemplateKHR( - m_device, static_cast( descriptorSet ), static_cast( descriptorUpdateTemplate ), pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::updateDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkUpdateDescriptorSetWithTemplateKHR( m_device, - static_cast( descriptorSet ), - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( &data ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_clip_space_w_scaling === - - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::ViewportWScalingNV * pViewportWScalings, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetViewportWScalingNV( m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pViewportWScalings ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, - ArrayProxy const & viewportWScalings, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetViewportWScalingNV( - m_commandBuffer, firstViewport, viewportWScalings.size(), reinterpret_cast( viewportWScalings.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_direct_mode_display === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE Result PhysicalDevice::releaseDisplayEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ) ); - } -#else - template - VULKAN_HPP_INLINE void PhysicalDevice::releaseDisplayEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkReleaseDisplayEXT( m_physicalDevice, static_cast( display ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::acquireXlibDisplayEXT( Display * dpy, - VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireXlibDisplayEXT( m_physicalDevice, dpy, static_cast( display ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::acquireXlibDisplayEXT( Display & dpy, VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkAcquireXlibDisplayEXT( m_physicalDevice, &dpy, static_cast( display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::acquireXlibDisplayEXT" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getRandROutputDisplayEXT( Display * dpy, - RROutput rrOutput, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplay, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetRandROutputDisplayEXT( m_physicalDevice, dpy, rrOutput, reinterpret_cast( pDisplay ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getRandROutputDisplayEXT" ); - - return createResultValueType( static_cast( result ), display ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getRandROutputDisplayEXTUnique( Display & dpy, RROutput rrOutput, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetRandROutputDisplayEXT( m_physicalDevice, &dpy, rrOutput, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getRandROutputDisplayEXTUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( display, ObjectRelease( *this, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT * pSurfaceCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2EXT( - m_physicalDevice, static_cast( surface ), reinterpret_cast( pSurfaceCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT surfaceCapabilities; - VkResult result = d.vkGetPhysicalDeviceSurfaceCapabilities2EXT( - m_physicalDevice, static_cast( surface ), reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2EXT" ); - - return createResultValueType( static_cast( result ), surfaceCapabilities ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_display_control === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT * pDisplayPowerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( pDisplayPowerInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE typename ResultValueType::type Device::displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT & displayPowerInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkDisplayPowerControlEXT( m_device, static_cast( display ), reinterpret_cast( &displayPowerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::displayPowerControlEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::registerEventEXT( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT * pDeviceEventInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkRegisterDeviceEventEXT( m_device, - reinterpret_cast( pDeviceEventInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pFence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::registerEventEXT( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT & deviceEventInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = d.vkRegisterDeviceEventEXT( - m_device, - reinterpret_cast( &deviceEventInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::registerEventEXT" ); - - return createResultValueType( static_cast( result ), fence ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::registerEventEXTUnique( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT & deviceEventInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = d.vkRegisterDeviceEventEXT( - m_device, - reinterpret_cast( &deviceEventInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::registerEventEXTUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( fence, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT * pDisplayEventInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkRegisterDisplayEventEXT( m_device, - static_cast( display ), - reinterpret_cast( pDisplayEventInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pFence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT & displayEventInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = d.vkRegisterDisplayEventEXT( - m_device, - static_cast( display ), - reinterpret_cast( &displayEventInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::registerDisplayEventEXT" ); - - return createResultValueType( static_cast( result ), fence ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::registerDisplayEventEXTUnique( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT & displayEventInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Fence fence; - VkResult result = d.vkRegisterDisplayEventEXT( - m_device, - static_cast( display ), - reinterpret_cast( &displayEventInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::registerDisplayEventEXTUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( fence, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSwapchainCounterEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter, - uint64_t * pCounterValue, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), pCounterValue ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getSwapchainCounterEXT( - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t counterValue; - VkResult result = - d.vkGetSwapchainCounterEXT( m_device, static_cast( swapchain ), static_cast( counter ), &counterValue ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainCounterEXT" ); - - return createResultValueType( static_cast( result ), counterValue ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_GOOGLE_display_timing === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getRefreshCycleDurationGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE * pDisplayTimingProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetRefreshCycleDurationGOOGLE( - m_device, static_cast( swapchain ), reinterpret_cast( pDisplayTimingProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getRefreshCycleDurationGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE displayTimingProperties; - VkResult result = d.vkGetRefreshCycleDurationGOOGLE( - m_device, static_cast( swapchain ), reinterpret_cast( &displayTimingProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRefreshCycleDurationGOOGLE" ); - - return createResultValueType( static_cast( result ), displayTimingProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint32_t * pPresentationTimingCount, - VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE * pPresentationTimings, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPastPresentationTimingGOOGLE( m_device, - static_cast( swapchain ), - pPresentationTimingCount, - reinterpret_cast( pPresentationTimings ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentationTimings; - uint32_t presentationTimingCount; - VkResult result; - do - { - result = d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentationTimingCount ) - { - presentationTimings.resize( presentationTimingCount ); - result = d.vkGetPastPresentationTimingGOOGLE( m_device, - static_cast( swapchain ), - &presentationTimingCount, - reinterpret_cast( presentationTimings.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPastPresentationTimingGOOGLE" ); - VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); - if ( presentationTimingCount < presentationTimings.size() ) - { - presentationTimings.resize( presentationTimingCount ); - } - return createResultValueType( static_cast( result ), presentationTimings ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - PastPresentationTimingGOOGLEAllocator & pastPresentationTimingGOOGLEAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentationTimings( - pastPresentationTimingGOOGLEAllocator ); - uint32_t presentationTimingCount; - VkResult result; - do - { - result = d.vkGetPastPresentationTimingGOOGLE( m_device, static_cast( swapchain ), &presentationTimingCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentationTimingCount ) - { - presentationTimings.resize( presentationTimingCount ); - result = d.vkGetPastPresentationTimingGOOGLE( m_device, - static_cast( swapchain ), - &presentationTimingCount, - reinterpret_cast( presentationTimings.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPastPresentationTimingGOOGLE" ); - VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); - if ( presentationTimingCount < presentationTimings.size() ) - { - presentationTimings.resize( presentationTimingCount ); - } - return createResultValueType( static_cast( result ), presentationTimings ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_discard_rectangles === - - template - VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - uint32_t discardRectangleCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pDiscardRectangles, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDiscardRectangleEXT( m_commandBuffer, firstDiscardRectangle, discardRectangleCount, reinterpret_cast( pDiscardRectangles ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - ArrayProxy const & discardRectangles, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetDiscardRectangleEXT( - m_commandBuffer, firstDiscardRectangle, discardRectangles.size(), reinterpret_cast( discardRectangles.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_hdr_metadata === - - template - VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( uint32_t swapchainCount, - const VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains, - const VULKAN_HPP_NAMESPACE::HdrMetadataEXT * pMetadata, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkSetHdrMetadataEXT( - m_device, swapchainCount, reinterpret_cast( pSwapchains ), reinterpret_cast( pMetadata ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( ArrayProxy const & swapchains, - ArrayProxy const & metadata, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( swapchains.size() == metadata.size() ); -# else - if ( swapchains.size() != metadata.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::setHdrMetadataEXT: swapchains.size() != metadata.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkSetHdrMetadataEXT( m_device, - swapchains.size(), - reinterpret_cast( swapchains.data() ), - reinterpret_cast( metadata.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_create_renderpass2 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateRenderPass2KHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pRenderPass ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass2KHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPass2KHR" ); - - return createResultValueType( static_cast( result ), renderPass ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createRenderPass2KHRUnique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RenderPass renderPass; - VkResult result = - d.vkCreateRenderPass2KHR( m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &renderPass ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createRenderPass2KHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( renderPass, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginRenderPass2KHR( - m_commandBuffer, reinterpret_cast( pRenderPassBegin ), reinterpret_cast( pSubpassBeginInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginRenderPass2KHR( - m_commandBuffer, reinterpret_cast( &renderPassBegin ), reinterpret_cast( &subpassBeginInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdNextSubpass2KHR( - m_commandBuffer, reinterpret_cast( pSubpassBeginInfo ), reinterpret_cast( pSubpassEndInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdNextSubpass2KHR( - m_commandBuffer, reinterpret_cast( &subpassBeginInfo ), reinterpret_cast( &subpassEndInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndRenderPass2KHR( m_commandBuffer, reinterpret_cast( pSubpassEndInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdEndRenderPass2KHR( m_commandBuffer, reinterpret_cast( &subpassEndInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_shared_presentable_image === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSwapchainStatusKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::getSwapchainStatusKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkGetSwapchainStatusKHR( m_device, static_cast( swapchain ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getSwapchainStatusKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_fence_capabilities === - - template - VULKAN_HPP_INLINE void PhysicalDevice::getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VULKAN_HPP_NAMESPACE::ExternalFenceProperties * pExternalFenceProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, - reinterpret_cast( pExternalFenceInfo ), - reinterpret_cast( pExternalFenceProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalFenceProperties - PhysicalDevice::getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExternalFenceProperties externalFenceProperties; - d.vkGetPhysicalDeviceExternalFencePropertiesKHR( m_physicalDevice, - reinterpret_cast( &externalFenceInfo ), - reinterpret_cast( &externalFenceProperties ) ); - - return externalFenceProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::importFenceWin32HandleKHR( - const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR * pImportFenceWin32HandleInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( pImportFenceWin32HandleInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::importFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkImportFenceWin32HandleKHR( m_device, reinterpret_cast( &importFenceWin32HandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importFenceWin32HandleKHR" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR * pGetWin32HandleInfo, - HANDLE * pHandle, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( pGetWin32HandleInfo ), pHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR & getWin32HandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - HANDLE handle; - VkResult result = d.vkGetFenceWin32HandleKHR( m_device, reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceWin32HandleKHR" ); - - return createResultValueType( static_cast( result ), handle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR * pImportFenceFdInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkImportFenceFdKHR( m_device, reinterpret_cast( pImportFenceFdInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR & importFenceFdInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkImportFenceFdKHR( m_device, reinterpret_cast( &importFenceFdInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importFenceFdKHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetFenceFdKHR( m_device, reinterpret_cast( pGetFdInfo ), pFd ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR & getFdInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - int fd; - VkResult result = d.vkGetFenceFdKHR( m_device, reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceFdKHR" ); - - return createResultValueType( static_cast( result ), fd ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_performance_query === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, - uint32_t * pCounterCount, - VULKAN_HPP_NAMESPACE::PerformanceCounterKHR * pCounters, - VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionKHR * pCounterDescriptions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( m_physicalDevice, - queueFamilyIndex, - pCounterCount, - reinterpret_cast( pCounters ), - reinterpret_cast( pCounterDescriptions ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, - std::vector>>::type - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::pair, - std::vector> - data; - std::vector & counters = data.first; - std::vector & counterDescriptions = data.second; - uint32_t counterCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ); - if ( ( result == VK_SUCCESS ) && counterCount ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - result = d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - &counterCount, - reinterpret_cast( counters.data() ), - reinterpret_cast( counterDescriptions.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" ); - VULKAN_HPP_ASSERT( counterCount <= counters.size() ); - if ( counterCount < counters.size() ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - } - return createResultValueType( static_cast( result ), data ); - } - - template ::value && - std::is_same::value, - int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType, - std::vector>>::type - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, - PerformanceCounterKHRAllocator & performanceCounterKHRAllocator, - PerformanceCounterDescriptionKHRAllocator & performanceCounterDescriptionKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::pair, - std::vector> - data( - std::piecewise_construct, std::forward_as_tuple( performanceCounterKHRAllocator ), std::forward_as_tuple( performanceCounterDescriptionKHRAllocator ) ); - std::vector & counters = data.first; - std::vector & counterDescriptions = data.second; - uint32_t counterCount; - VkResult result; - do - { - result = d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( m_physicalDevice, queueFamilyIndex, &counterCount, nullptr, nullptr ); - if ( ( result == VK_SUCCESS ) && counterCount ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - result = d.vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - m_physicalDevice, - queueFamilyIndex, - &counterCount, - reinterpret_cast( counters.data() ), - reinterpret_cast( counterDescriptions.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" ); - VULKAN_HPP_ASSERT( counterCount <= counters.size() ); - if ( counterCount < counters.size() ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - } - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - PhysicalDevice::getQueueFamilyPerformanceQueryPassesKHR( const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR * pPerformanceQueryCreateInfo, - uint32_t * pNumPasses, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( - m_physicalDevice, reinterpret_cast( pPerformanceQueryCreateInfo ), pNumPasses ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint32_t PhysicalDevice::getQueueFamilyPerformanceQueryPassesKHR( - const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR & performanceQueryCreateInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint32_t numPasses; - d.vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( - m_physicalDevice, reinterpret_cast( &performanceQueryCreateInfo ), &numPasses ); - - return numPasses; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireProfilingLockKHR( m_device, reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkAcquireProfilingLockKHR( m_device, reinterpret_cast( &info ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::acquireProfilingLockKHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::releaseProfilingLockKHR( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkReleaseProfilingLockKHR( m_device ); - } - - //=== VK_KHR_get_surface_capabilities2 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR * pSurfaceCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, - reinterpret_cast( pSurfaceInfo ), - reinterpret_cast( pSurfaceCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR surfaceCapabilities; - VkResult result = d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2KHR" ); - - return createResultValueType( static_cast( result ), surfaceCapabilities ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR & surfaceCapabilities = structureChain.template get(); - VkResult result = d.vkGetPhysicalDeviceSurfaceCapabilities2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2KHR" ); - - return createResultValueType( static_cast( result ), structureChain ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pSurfaceFormatCount, - VULKAN_HPP_NAMESPACE::SurfaceFormat2KHR * pSurfaceFormats, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, - reinterpret_cast( pSurfaceInfo ), - pSurfaceFormatCount, - reinterpret_cast( pSurfaceFormats ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return createResultValueType( static_cast( result ), surfaceFormats ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - SurfaceFormat2KHRAllocator & surfaceFormat2KHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector surfaceFormats( surfaceFormat2KHRAllocator ); - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return createResultValueType( static_cast( result ), surfaceFormats ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains; - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - structureChains.resize( surfaceFormatCount ); - surfaceFormats.resize( surfaceFormatCount ); - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - surfaceFormats[i].pNext = structureChains[i].template get().pNext; - } - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - structureChains.resize( surfaceFormatCount ); - } - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - structureChains[i].template get() = surfaceFormats[i]; - } - return createResultValueType( static_cast( result ), structureChains ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - StructureChainAllocator & structureChainAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector structureChains( structureChainAllocator ); - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - structureChains.resize( surfaceFormatCount ); - surfaceFormats.resize( surfaceFormatCount ); - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - surfaceFormats[i].pNext = structureChains[i].template get().pNext; - } - result = d.vkGetPhysicalDeviceSurfaceFormats2KHR( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - structureChains.resize( surfaceFormatCount ); - } - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - structureChains[i].template get() = surfaceFormats[i]; - } - return createResultValueType( static_cast( result ), structureChains ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_get_display_properties2 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayProperties2KHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayProperties2KHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayProperties2KHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = - d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayProperties2KHR( DisplayProperties2KHRAllocator & displayProperties2KHRAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayProperties2KHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = - d.vkGetPhysicalDeviceDisplayProperties2KHR( m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayPlaneProperties2KHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPlaneProperties2KHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayPlaneProperties2KHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayPlaneProperties2KHR( DisplayPlaneProperties2KHRAllocator & displayPlaneProperties2KHRAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayPlaneProperties2KHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceDisplayPlaneProperties2KHR( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayModeProperties2KHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDisplayModeProperties2KHR( - m_physicalDevice, static_cast( display ), pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetDisplayModeProperties2KHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetDisplayModeProperties2KHR( - m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayModeProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - DisplayModeProperties2KHRAllocator & displayModeProperties2KHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( displayModeProperties2KHRAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetDisplayModeProperties2KHR( m_physicalDevice, static_cast( display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetDisplayModeProperties2KHR( - m_physicalDevice, static_cast( display ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayModeProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR * pDisplayPlaneInfo, - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR * pCapabilities, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDisplayPlaneCapabilities2KHR( m_physicalDevice, - reinterpret_cast( pDisplayPlaneInfo ), - reinterpret_cast( pCapabilities ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR & displayPlaneInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR capabilities; - VkResult result = d.vkGetDisplayPlaneCapabilities2KHR( m_physicalDevice, - reinterpret_cast( &displayPlaneInfo ), - reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneCapabilities2KHR" ); - - return createResultValueType( static_cast( result ), capabilities ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createIOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateIOSSurfaceMVK( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createIOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateIOSSurfaceMVK( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createIOSSurfaceMVK" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createIOSSurfaceMVKUnique( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateIOSSurfaceMVK( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createIOSSurfaceMVKUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createMacOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateMacOSSurfaceMVK( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createMacOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateMacOSSurfaceMVK( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createMacOSSurfaceMVK" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createMacOSSurfaceMVKUnique( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateMacOSSurfaceMVK( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createMacOSSurfaceMVKUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT * pNameInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSetDebugUtilsObjectNameEXT( m_device, reinterpret_cast( pNameInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT & nameInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSetDebugUtilsObjectNameEXT( m_device, reinterpret_cast( &nameInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setDebugUtilsObjectNameEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT * pTagInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSetDebugUtilsObjectTagEXT( m_device, reinterpret_cast( pTagInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT & tagInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSetDebugUtilsObjectTagEXT( m_device, reinterpret_cast( &tagInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setDebugUtilsObjectTagEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Queue::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkQueueBeginDebugUtilsLabelEXT( m_queue, reinterpret_cast( pLabelInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Queue::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkQueueBeginDebugUtilsLabelEXT( m_queue, reinterpret_cast( &labelInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Queue::endDebugUtilsLabelEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkQueueEndDebugUtilsLabelEXT( m_queue ); - } - - template - VULKAN_HPP_INLINE void Queue::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkQueueInsertDebugUtilsLabelEXT( m_queue, reinterpret_cast( pLabelInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Queue::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkQueueInsertDebugUtilsLabelEXT( m_queue, reinterpret_cast( &labelInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBeginDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( pLabelInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBeginDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( &labelInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::endDebugUtilsLabelEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEndDebugUtilsLabelEXT( m_commandBuffer ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdInsertDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( pLabelInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdInsertDebugUtilsLabelEXT( m_commandBuffer, reinterpret_cast( &labelInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::createDebugUtilsMessengerEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT * pMessenger, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDebugUtilsMessengerEXT( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pMessenger ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createDebugUtilsMessengerEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger; - VkResult result = d.vkCreateDebugUtilsMessengerEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &messenger ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDebugUtilsMessengerEXT" ); - - return createResultValueType( static_cast( result ), messenger ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createDebugUtilsMessengerEXTUnique( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger; - VkResult result = d.vkCreateDebugUtilsMessengerEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &messenger ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDebugUtilsMessengerEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( messenger, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroyDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDebugUtilsMessengerEXT( - m_instance, static_cast( messenger ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroyDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDebugUtilsMessengerEXT( - m_instance, - static_cast( messenger ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDebugUtilsMessengerEXT( - m_instance, static_cast( messenger ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::destroy( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDebugUtilsMessengerEXT( - m_instance, - static_cast( messenger ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Instance::submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT * pCallbackData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkSubmitDebugUtilsMessageEXT( m_instance, - static_cast( messageSeverity ), - static_cast( messageTypes ), - reinterpret_cast( pCallbackData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Instance::submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT & callbackData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkSubmitDebugUtilsMessageEXT( m_instance, - static_cast( messageSeverity ), - static_cast( messageTypes ), - reinterpret_cast( &callbackData ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer * buffer, - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, buffer, reinterpret_cast( pProperties ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID properties; - VkResult result = - d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, &buffer, reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAndroidHardwareBufferPropertiesANDROID" ); - - return createResultValueType( static_cast( result ), properties ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID & properties = - structureChain.template get(); - VkResult result = - d.vkGetAndroidHardwareBufferPropertiesANDROID( m_device, &buffer, reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAndroidHardwareBufferPropertiesANDROID" ); - - return createResultValueType( static_cast( result ), structureChain ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID * pInfo, - struct AHardwareBuffer ** pBuffer, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetMemoryAndroidHardwareBufferANDROID( m_device, reinterpret_cast( pInfo ), pBuffer ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - struct AHardwareBuffer * buffer; - VkResult result = - d.vkGetMemoryAndroidHardwareBufferANDROID( m_device, reinterpret_cast( &info ), &buffer ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryAndroidHardwareBufferANDROID" ); - - return createResultValueType( static_cast( result ), buffer ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - - template - VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT * pSampleLocationsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( pSampleLocationsInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT & sampleLocationsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetSampleLocationsEXT( m_commandBuffer, reinterpret_cast( &sampleLocationsInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void PhysicalDevice::getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT * pMultisampleProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPhysicalDeviceMultisamplePropertiesEXT( - m_physicalDevice, static_cast( samples ), reinterpret_cast( pMultisampleProperties ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT - PhysicalDevice::getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT multisampleProperties; - d.vkGetPhysicalDeviceMultisamplePropertiesEXT( - m_physicalDevice, static_cast( samples ), reinterpret_cast( &multisampleProperties ) ); - - return multisampleProperties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_get_memory_requirements2 === - - template - VULKAN_HPP_INLINE void Device::getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageMemoryRequirements2KHR( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetImageMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetImageMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetBufferMemoryRequirements2KHR( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetBufferMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetBufferMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageSparseMemoryRequirements2KHR( m_device, - reinterpret_cast( pInfo ), - pSparseMemoryRequirementCount, - reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements2KHR( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements( - sparseImageMemoryRequirements2Allocator ); - uint32_t sparseMemoryRequirementCount; - d.vkGetImageSparseMemoryRequirements2KHR( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetImageSparseMemoryRequirements2KHR( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_acceleration_structure === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructure, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateAccelerationStructureKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pAccelerationStructure ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure; - VkResult result = d.vkCreateAccelerationStructureKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &accelerationStructure ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createAccelerationStructureKHR" ); - - return createResultValueType( static_cast( result ), accelerationStructure ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createAccelerationStructureKHRUnique( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure; - VkResult result = d.vkCreateAccelerationStructureKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &accelerationStructure ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createAccelerationStructureKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( accelerationStructure, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyAccelerationStructureKHR( - m_device, static_cast( accelerationStructure ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyAccelerationStructureKHR( - m_device, - static_cast( accelerationStructure ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyAccelerationStructureKHR( - m_device, static_cast( accelerationStructure ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyAccelerationStructureKHR( - m_device, - static_cast( accelerationStructure ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - CommandBuffer::buildAccelerationStructuresKHR( uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBuildAccelerationStructuresKHR( m_commandBuffer, - infoCount, - reinterpret_cast( pInfos ), - reinterpret_cast( ppBuildRangeInfos ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructuresKHR( - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( infos.size() == pBuildRangeInfos.size() ); -# else - if ( infos.size() != pBuildRangeInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresKHR: infos.size() != pBuildRangeInfos.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBuildAccelerationStructuresKHR( m_commandBuffer, - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( pBuildRangeInfos.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructuresIndirectKHR( uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::DeviceAddress * pIndirectDeviceAddresses, - const uint32_t * pIndirectStrides, - const uint32_t * const * ppMaxPrimitiveCounts, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBuildAccelerationStructuresIndirectKHR( m_commandBuffer, - infoCount, - reinterpret_cast( pInfos ), - reinterpret_cast( pIndirectDeviceAddresses ), - pIndirectStrides, - ppMaxPrimitiveCounts ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void - CommandBuffer::buildAccelerationStructuresIndirectKHR( ArrayProxy const & infos, - ArrayProxy const & indirectDeviceAddresses, - ArrayProxy const & indirectStrides, - ArrayProxy const & pMaxPrimitiveCounts, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( infos.size() == indirectDeviceAddresses.size() ); - VULKAN_HPP_ASSERT( infos.size() == indirectStrides.size() ); - VULKAN_HPP_ASSERT( infos.size() == pMaxPrimitiveCounts.size() ); -# else - if ( infos.size() != indirectDeviceAddresses.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != indirectDeviceAddresses.size()" ); - } - if ( infos.size() != indirectStrides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != indirectStrides.size()" ); - } - if ( infos.size() != pMaxPrimitiveCounts.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != pMaxPrimitiveCounts.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBuildAccelerationStructuresIndirectKHR( m_commandBuffer, - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( indirectDeviceAddresses.data() ), - indirectStrides.data(), - pMaxPrimitiveCounts.data() ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::buildAccelerationStructuresKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkBuildAccelerationStructuresKHR( m_device, - static_cast( deferredOperation ), - infoCount, - reinterpret_cast( pInfos ), - reinterpret_cast( ppBuildRangeInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::buildAccelerationStructuresKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( infos.size() == pBuildRangeInfos.size() ); -# else - if ( infos.size() != pBuildRangeInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::buildAccelerationStructuresKHR: infos.size() != pBuildRangeInfos.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - VkResult result = - d.vkBuildAccelerationStructuresKHR( m_device, - static_cast( deferredOperation ), - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( pBuildRangeInfos.data() ) ); - resultCheck( - static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::buildAccelerationStructuresKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCopyAccelerationStructureKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCopyAccelerationStructureKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( &info ) ); - resultCheck( - static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyAccelerationStructureKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCopyAccelerationStructureToMemoryKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCopyAccelerationStructureToMemoryKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( &info ) ); - resultCheck( - static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyAccelerationStructureToMemoryKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCopyMemoryToAccelerationStructureKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCopyMemoryToAccelerationStructureKHR( - m_device, static_cast( deferredOperation ), reinterpret_cast( &info ) ); - resultCheck( - static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyMemoryToAccelerationStructureKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::writeAccelerationStructuresPropertiesKHR( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - void * pData, - size_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkWriteAccelerationStructuresPropertiesKHR( m_device, - accelerationStructureCount, - reinterpret_cast( pAccelerationStructures ), - static_cast( queryType ), - dataSize, - pData, - stride ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - size_t stride, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkWriteAccelerationStructuresPropertiesKHR( m_device, - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ), - stride ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertiesKHR" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::writeAccelerationStructuresPropertyKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t stride, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkWriteAccelerationStructuresPropertiesKHR( m_device, - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - sizeof( DataType ), - reinterpret_cast( &data ), - stride ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertyKHR" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyAccelerationStructureKHR( m_commandBuffer, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyAccelerationStructureKHR( m_commandBuffer, reinterpret_cast( &info ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureToMemoryKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyAccelerationStructureToMemoryKHR( m_commandBuffer, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureToMemoryKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyAccelerationStructureToMemoryKHR( m_commandBuffer, reinterpret_cast( &info ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyMemoryToAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyMemoryToAccelerationStructureKHR( m_commandBuffer, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyMemoryToAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyMemoryToAccelerationStructureKHR( m_commandBuffer, reinterpret_cast( &info ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE DeviceAddress Device::getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetAccelerationStructureDeviceAddressKHR( m_device, reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress - Device::getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkDeviceAddress result = - d.vkGetAccelerationStructureDeviceAddressKHR( m_device, reinterpret_cast( &info ) ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - CommandBuffer::writeAccelerationStructuresPropertiesKHR( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteAccelerationStructuresPropertiesKHR( m_commandBuffer, - accelerationStructureCount, - reinterpret_cast( pAccelerationStructures ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void - CommandBuffer::writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdWriteAccelerationStructuresPropertiesKHR( m_commandBuffer, - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getAccelerationStructureCompatibilityKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR * pVersionInfo, - VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR * pCompatibility, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceAccelerationStructureCompatibilityKHR( m_device, - reinterpret_cast( pVersionInfo ), - reinterpret_cast( pCompatibility ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR - Device::getAccelerationStructureCompatibilityKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR & versionInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR compatibility; - d.vkGetDeviceAccelerationStructureCompatibilityKHR( m_device, - reinterpret_cast( &versionInfo ), - reinterpret_cast( &compatibility ) ); - - return compatibility; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pBuildInfo, - const uint32_t * pMaxPrimitiveCounts, - VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR * pSizeInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetAccelerationStructureBuildSizesKHR( m_device, - static_cast( buildType ), - reinterpret_cast( pBuildInfo ), - pMaxPrimitiveCounts, - reinterpret_cast( pSizeInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR - Device::getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR & buildInfo, - ArrayProxy const & maxPrimitiveCounts, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( maxPrimitiveCounts.size() == buildInfo.geometryCount ); -# else - if ( maxPrimitiveCounts.size() != buildInfo.geometryCount ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureBuildSizesKHR: maxPrimitiveCounts.size() != buildInfo.geometryCount" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR sizeInfo; - d.vkGetAccelerationStructureBuildSizesKHR( m_device, - static_cast( buildType ), - reinterpret_cast( &buildInfo ), - maxPrimitiveCounts.data(), - reinterpret_cast( &sizeInfo ) ); - - return sizeInfo; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_sampler_ycbcr_conversion === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createSamplerYcbcrConversionKHR( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion * pYcbcrConversion, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateSamplerYcbcrConversionKHR( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pYcbcrConversion ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createSamplerYcbcrConversionKHR( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion; - VkResult result = d.vkCreateSamplerYcbcrConversionKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &ycbcrConversion ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSamplerYcbcrConversionKHR" ); - - return createResultValueType( static_cast( result ), ycbcrConversion ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createSamplerYcbcrConversionKHRUnique( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion; - VkResult result = d.vkCreateSamplerYcbcrConversionKHR( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &ycbcrConversion ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createSamplerYcbcrConversionKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( ycbcrConversion, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroySamplerYcbcrConversionKHR( - m_device, static_cast( ycbcrConversion ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroySamplerYcbcrConversionKHR( - m_device, - static_cast( ycbcrConversion ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_bind_memory2 === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindBufferMemory2KHR( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo * pBindInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBindBufferMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindBufferMemory2KHR( ArrayProxy const & bindInfos, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindBufferMemory2KHR( m_device, bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindBufferMemory2KHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindImageMemory2KHR( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindImageMemoryInfo * pBindInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkBindImageMemory2KHR( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindImageMemory2KHR( ArrayProxy const & bindInfos, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindImageMemory2KHR( m_device, bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindImageMemory2KHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_image_drm_format_modifier === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getImageDrmFormatModifierPropertiesEXT( - VULKAN_HPP_NAMESPACE::Image image, VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT * pProperties, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetImageDrmFormatModifierPropertiesEXT( - m_device, static_cast( image ), reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getImageDrmFormatModifierPropertiesEXT( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT properties; - VkResult result = d.vkGetImageDrmFormatModifierPropertiesEXT( - m_device, static_cast( image ), reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getImageDrmFormatModifierPropertiesEXT" ); - - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_validation_cache === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createValidationCacheEXT( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ValidationCacheEXT * pValidationCache, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateValidationCacheEXT( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pValidationCache ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createValidationCacheEXT( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache; - VkResult result = d.vkCreateValidationCacheEXT( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &validationCache ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createValidationCacheEXT" ); - - return createResultValueType( static_cast( result ), validationCache ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createValidationCacheEXTUnique( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache; - VkResult result = d.vkCreateValidationCacheEXT( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &validationCache ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createValidationCacheEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( validationCache, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyValidationCacheEXT( - m_device, static_cast( validationCache ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyValidationCacheEXT( - m_device, - static_cast( validationCache ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyValidationCacheEXT( - m_device, static_cast( validationCache ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyValidationCacheEXT( - m_device, - static_cast( validationCache ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::mergeValidationCachesEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT dstCache, - uint32_t srcCacheCount, - const VULKAN_HPP_NAMESPACE::ValidationCacheEXT * pSrcCaches, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkMergeValidationCachesEXT( - m_device, static_cast( dstCache ), srcCacheCount, reinterpret_cast( pSrcCaches ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type Device::mergeValidationCachesEXT( - VULKAN_HPP_NAMESPACE::ValidationCacheEXT dstCache, ArrayProxy const & srcCaches, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkMergeValidationCachesEXT( - m_device, static_cast( dstCache ), srcCaches.size(), reinterpret_cast( srcCaches.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::mergeValidationCachesEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - size_t * pDataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), pDataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector data; - size_t dataSize; - VkResult result; - do - { - result = d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = - d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getValidationCacheDataEXT" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return createResultValueType( static_cast( result ), data ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, Uint8_tAllocator & uint8_tAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector data( uint8_tAllocator ); - size_t dataSize; - VkResult result; - do - { - result = d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = - d.vkGetValidationCacheDataEXT( m_device, static_cast( validationCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getValidationCacheDataEXT" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_shading_rate_image === - - template - VULKAN_HPP_INLINE void CommandBuffer::bindShadingRateImageNV( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindShadingRateImageNV( m_commandBuffer, static_cast( imageView ), static_cast( imageLayout ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportShadingRatePaletteNV( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV * pShadingRatePalettes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetViewportShadingRatePaletteNV( - m_commandBuffer, firstViewport, viewportCount, reinterpret_cast( pShadingRatePalettes ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void - CommandBuffer::setViewportShadingRatePaletteNV( uint32_t firstViewport, - ArrayProxy const & shadingRatePalettes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetViewportShadingRatePaletteNV( - m_commandBuffer, firstViewport, shadingRatePalettes.size(), reinterpret_cast( shadingRatePalettes.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setCoarseSampleOrderNV( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - uint32_t customSampleOrderCount, - const VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV * pCustomSampleOrders, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetCoarseSampleOrderNV( m_commandBuffer, - static_cast( sampleOrderType ), - customSampleOrderCount, - reinterpret_cast( pCustomSampleOrders ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setCoarseSampleOrderNV( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - ArrayProxy const & customSampleOrders, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetCoarseSampleOrderNV( m_commandBuffer, - static_cast( sampleOrderType ), - customSampleOrders.size(), - reinterpret_cast( customSampleOrders.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_ray_tracing === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructure, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateAccelerationStructureNV( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pAccelerationStructure ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure; - VkResult result = d.vkCreateAccelerationStructureNV( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &accelerationStructure ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createAccelerationStructureNV" ); - - return createResultValueType( static_cast( result ), accelerationStructure ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createAccelerationStructureNVUnique( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure; - VkResult result = d.vkCreateAccelerationStructureNV( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &accelerationStructure ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createAccelerationStructureNVUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( accelerationStructure, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyAccelerationStructureNV( - m_device, static_cast( accelerationStructure ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyAccelerationStructureNV( - m_device, - static_cast( accelerationStructure ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyAccelerationStructureNV( - m_device, static_cast( accelerationStructure ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyAccelerationStructureNV( - m_device, - static_cast( accelerationStructure ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - Device::getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetAccelerationStructureMemoryRequirementsNV( m_device, - reinterpret_cast( pInfo ), - reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR - Device::getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR memoryRequirements; - d.vkGetAccelerationStructureMemoryRequirementsNV( m_device, - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR & memoryRequirements = structureChain.template get(); - d.vkGetAccelerationStructureMemoryRequirementsNV( m_device, - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::bindAccelerationStructureMemoryNV( - uint32_t bindInfoCount, const VULKAN_HPP_NAMESPACE::BindAccelerationStructureMemoryInfoNV * pBindInfos, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkBindAccelerationStructureMemoryNV( m_device, bindInfoCount, reinterpret_cast( pBindInfos ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::bindAccelerationStructureMemoryNV( ArrayProxy const & bindInfos, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkBindAccelerationStructureMemoryNV( - m_device, bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindAccelerationStructureMemoryNV" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBuildAccelerationStructureNV( m_commandBuffer, - reinterpret_cast( pInfo ), - static_cast( instanceData ), - static_cast( instanceOffset ), - static_cast( update ), - static_cast( dst ), - static_cast( src ), - static_cast( scratch ), - static_cast( scratchOffset ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV & info, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBuildAccelerationStructureNV( m_commandBuffer, - reinterpret_cast( &info ), - static_cast( instanceData ), - static_cast( instanceOffset ), - static_cast( update ), - static_cast( dst ), - static_cast( src ), - static_cast( scratch ), - static_cast( scratchOffset ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyAccelerationStructureNV( m_commandBuffer, - static_cast( dst ), - static_cast( src ), - static_cast( mode ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysNV( VULKAN_HPP_NAMESPACE::Buffer raygenShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderBindingOffset, - VULKAN_HPP_NAMESPACE::Buffer missShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer hitShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer callableShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingStride, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdTraceRaysNV( m_commandBuffer, - static_cast( raygenShaderBindingTableBuffer ), - static_cast( raygenShaderBindingOffset ), - static_cast( missShaderBindingTableBuffer ), - static_cast( missShaderBindingOffset ), - static_cast( missShaderBindingStride ), - static_cast( hitShaderBindingTableBuffer ), - static_cast( hitShaderBindingOffset ), - static_cast( hitShaderBindingStride ), - static_cast( callableShaderBindingTableBuffer ), - static_cast( callableShaderBindingOffset ), - static_cast( callableShaderBindingStride ), - width, - height, - depth ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateRayTracingPipelinesNV( m_device, - static_cast( pipelineCache ), - createInfoCount, - reinterpret_cast( pCreateInfos ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelines ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesNV", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size(), pipelineAllocator ); - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesNV", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue - Device::createRayTracingPipelineNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelineNV", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue( static_cast( result ), pipeline ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createRayTracingPipelinesNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesNVUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines; - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createRayTracingPipelinesNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesNVUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines( pipelineAllocator ); - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelineNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateRayTracingPipelinesNV( - m_device, - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelineNVUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( - static_cast( result ), - UniqueHandle( pipeline, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetRayTracingShaderGroupHandlesNV( m_device, static_cast( pipeline ), firstGroup, groupCount, dataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::getRayTracingShaderGroupHandlesNV( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkGetRayTracingShaderGroupHandlesNV( - m_device, static_cast( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesNV" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getRayTracingShaderGroupHandleNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkGetRayTracingShaderGroupHandlesNV( - m_device, static_cast( pipeline ), firstGroup, groupCount, sizeof( DataType ), reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandleNV" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - size_t dataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetAccelerationStructureHandleNV( m_device, static_cast( accelerationStructure ), dataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, size_t dataSize, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkGetAccelerationStructureHandleNV( - m_device, static_cast( accelerationStructure ), data.size() * sizeof( DataType ), reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkGetAccelerationStructureHandleNV( - m_device, static_cast( accelerationStructure ), sizeof( DataType ), reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureHandleNV" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::writeAccelerationStructuresPropertiesNV( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteAccelerationStructuresPropertiesNV( m_commandBuffer, - accelerationStructureCount, - reinterpret_cast( pAccelerationStructures ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void - CommandBuffer::writeAccelerationStructuresPropertiesNV( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdWriteAccelerationStructuresPropertiesNV( m_commandBuffer, - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::compileDeferredNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t shader, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCompileDeferredNV( m_device, static_cast( pipeline ), shader ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::compileDeferredNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t shader, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCompileDeferredNV( m_device, static_cast( pipeline ), shader ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::compileDeferredNV" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_maintenance3 === - - template - VULKAN_HPP_INLINE void Device::getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport * pSupport, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDescriptorSetLayoutSupportKHR( - m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pSupport ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - Device::getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport support; - d.vkGetDescriptorSetLayoutSupportKHR( - m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); - - return support; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport & support = structureChain.template get(); - d.vkGetDescriptorSetLayoutSupportKHR( - m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &support ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_draw_indirect_count === - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndirectCountKHR( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawIndexedIndirectCountKHR( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_EXT_external_memory_host === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - const void * pHostPointer, - VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT * pMemoryHostPointerProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetMemoryHostPointerPropertiesEXT( m_device, - static_cast( handleType ), - pHostPointer, - reinterpret_cast( pMemoryHostPointerProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - const void * pHostPointer, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT memoryHostPointerProperties; - VkResult result = d.vkGetMemoryHostPointerPropertiesEXT( m_device, - static_cast( handleType ), - pHostPointer, - reinterpret_cast( &memoryHostPointerProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryHostPointerPropertiesEXT" ); - - return createResultValueType( static_cast( result ), memoryHostPointerProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_buffer_marker === - - template - VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarkerAMD( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteBufferMarkerAMD( m_commandBuffer, - static_cast( pipelineStage ), - static_cast( dstBuffer ), - static_cast( dstOffset ), - marker ); - } - - //=== VK_EXT_calibrated_timestamps === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getCalibrateableTimeDomainsEXT( uint32_t * pTimeDomainCount, - VULKAN_HPP_NAMESPACE::TimeDomainEXT * pTimeDomains, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, pTimeDomainCount, reinterpret_cast( pTimeDomains ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getCalibrateableTimeDomainsEXT( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector timeDomains; - uint32_t timeDomainCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, nullptr ); - if ( ( result == VK_SUCCESS ) && timeDomainCount ) - { - timeDomains.resize( timeDomainCount ); - result = - d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, reinterpret_cast( timeDomains.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCalibrateableTimeDomainsEXT" ); - VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); - if ( timeDomainCount < timeDomains.size() ) - { - timeDomains.resize( timeDomainCount ); - } - return createResultValueType( static_cast( result ), timeDomains ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getCalibrateableTimeDomainsEXT( TimeDomainEXTAllocator & timeDomainEXTAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector timeDomains( timeDomainEXTAllocator ); - uint32_t timeDomainCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, nullptr ); - if ( ( result == VK_SUCCESS ) && timeDomainCount ) - { - timeDomains.resize( timeDomainCount ); - result = - d.vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( m_physicalDevice, &timeDomainCount, reinterpret_cast( timeDomains.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCalibrateableTimeDomainsEXT" ); - VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); - if ( timeDomainCount < timeDomains.size() ) - { - timeDomains.resize( timeDomainCount ); - } - return createResultValueType( static_cast( result ), timeDomains ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getCalibratedTimestampsEXT( uint32_t timestampCount, - const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT * pTimestampInfos, - uint64_t * pTimestamps, - uint64_t * pMaxDeviation, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetCalibratedTimestampsEXT( - m_device, timestampCount, reinterpret_cast( pTimestampInfos ), pTimestamps, pMaxDeviation ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType, uint64_t>>::type - Device::getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::pair, uint64_t> data( - std::piecewise_construct, std::forward_as_tuple( timestampInfos.size() ), std::forward_as_tuple( 0 ) ); - std::vector & timestamps = data.first; - uint64_t & maxDeviation = data.second; - VkResult result = d.vkGetCalibratedTimestampsEXT( - m_device, timestampInfos.size(), reinterpret_cast( timestampInfos.data() ), timestamps.data(), &maxDeviation ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" ); - - return createResultValueType( static_cast( result ), data ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType, uint64_t>>::type - Device::getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos, - Uint64_tAllocator & uint64_tAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::pair, uint64_t> data( - std::piecewise_construct, std::forward_as_tuple( timestampInfos.size(), uint64_tAllocator ), std::forward_as_tuple( 0 ) ); - std::vector & timestamps = data.first; - uint64_t & maxDeviation = data.second; - VkResult result = d.vkGetCalibratedTimestampsEXT( - m_device, timestampInfos.size(), reinterpret_cast( timestampInfos.data() ), timestamps.data(), &maxDeviation ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getCalibratedTimestampEXT( const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT & timestampInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::pair data; - uint64_t & timestamp = data.first; - uint64_t & maxDeviation = data.second; - VkResult result = - d.vkGetCalibratedTimestampsEXT( m_device, 1, reinterpret_cast( ×tampInfo ), ×tamp, &maxDeviation ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampEXT" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_mesh_shader === - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksNV( uint32_t taskCount, uint32_t firstTask, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksNV( m_commandBuffer, taskCount, firstTask ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksIndirectNV( m_commandBuffer, static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectCountNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksIndirectCountNV( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_NV_scissor_exclusive === - - template - VULKAN_HPP_INLINE void CommandBuffer::setExclusiveScissorNV( uint32_t firstExclusiveScissor, - uint32_t exclusiveScissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pExclusiveScissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetExclusiveScissorNV( m_commandBuffer, firstExclusiveScissor, exclusiveScissorCount, reinterpret_cast( pExclusiveScissors ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setExclusiveScissorNV( uint32_t firstExclusiveScissor, - ArrayProxy const & exclusiveScissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetExclusiveScissorNV( - m_commandBuffer, firstExclusiveScissor, exclusiveScissors.size(), reinterpret_cast( exclusiveScissors.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_device_diagnostic_checkpoints === - - template - VULKAN_HPP_INLINE void CommandBuffer::setCheckpointNV( const void * pCheckpointMarker, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetCheckpointNV( m_commandBuffer, pCheckpointMarker ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setCheckpointNV( CheckpointMarkerType const & checkpointMarker, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetCheckpointNV( m_commandBuffer, reinterpret_cast( &checkpointMarker ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Queue::getCheckpointDataNV( uint32_t * pCheckpointDataCount, - VULKAN_HPP_NAMESPACE::CheckpointDataNV * pCheckpointData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetQueueCheckpointDataNV( m_queue, pCheckpointDataCount, reinterpret_cast( pCheckpointData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Queue::getCheckpointDataNV( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector checkpointData; - uint32_t checkpointDataCount; - d.vkGetQueueCheckpointDataNV( m_queue, &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - d.vkGetQueueCheckpointDataNV( m_queue, &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Queue::getCheckpointDataNV( CheckpointDataNVAllocator & checkpointDataNVAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector checkpointData( checkpointDataNVAllocator ); - uint32_t checkpointDataCount; - d.vkGetQueueCheckpointDataNV( m_queue, &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - d.vkGetQueueCheckpointDataNV( m_queue, &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_timeline_semaphore === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSemaphoreCounterValueKHR( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - uint64_t * pValue, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetSemaphoreCounterValueKHR( m_device, static_cast( semaphore ), pValue ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getSemaphoreCounterValueKHR( VULKAN_HPP_NAMESPACE::Semaphore semaphore, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t value; - VkResult result = d.vkGetSemaphoreCounterValueKHR( m_device, static_cast( semaphore ), &value ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreCounterValueKHR" ); - - return createResultValueType( static_cast( result ), value ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo * pWaitInfo, - uint64_t timeout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkWaitSemaphoresKHR( m_device, reinterpret_cast( pWaitInfo ), timeout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, uint64_t timeout, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkWaitSemaphoresKHR( m_device, reinterpret_cast( &waitInfo ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphoresKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo * pSignalInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSignalSemaphoreKHR( m_device, reinterpret_cast( pSignalInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSignalSemaphoreKHR( m_device, reinterpret_cast( &signalInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::signalSemaphoreKHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_INTEL_performance_query === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::initializePerformanceApiINTEL( - const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL * pInitializeInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkInitializePerformanceApiINTEL( m_device, reinterpret_cast( pInitializeInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::initializePerformanceApiINTEL( const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL & initializeInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkInitializePerformanceApiINTEL( m_device, reinterpret_cast( &initializeInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::initializePerformanceApiINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::uninitializePerformanceApiINTEL( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkUninitializePerformanceApiINTEL( m_device ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL * pMarkerInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCmdSetPerformanceMarkerINTEL( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - CommandBuffer::setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL & markerInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCmdSetPerformanceMarkerINTEL( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceMarkerINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::setPerformanceStreamMarkerINTEL( - const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL * pMarkerInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkCmdSetPerformanceStreamMarkerINTEL( m_commandBuffer, reinterpret_cast( pMarkerInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - CommandBuffer::setPerformanceStreamMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL & markerInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCmdSetPerformanceStreamMarkerINTEL( m_commandBuffer, reinterpret_cast( &markerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceStreamMarkerINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result CommandBuffer::setPerformanceOverrideINTEL( - const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL * pOverrideInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkCmdSetPerformanceOverrideINTEL( m_commandBuffer, reinterpret_cast( pOverrideInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - CommandBuffer::setPerformanceOverrideINTEL( const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL & overrideInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkCmdSetPerformanceOverrideINTEL( m_commandBuffer, reinterpret_cast( &overrideInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceOverrideINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::acquirePerformanceConfigurationINTEL( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL * pAcquireInfo, - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL * pConfiguration, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquirePerformanceConfigurationINTEL( m_device, - reinterpret_cast( pAcquireInfo ), - reinterpret_cast( pConfiguration ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::acquirePerformanceConfigurationINTEL( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL & acquireInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration; - VkResult result = d.vkAcquirePerformanceConfigurationINTEL( m_device, - reinterpret_cast( &acquireInfo ), - reinterpret_cast( &configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::acquirePerformanceConfigurationINTEL" ); - - return createResultValueType( static_cast( result ), configuration ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::acquirePerformanceConfigurationINTELUnique( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL & acquireInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration; - VkResult result = d.vkAcquirePerformanceConfigurationINTEL( m_device, - reinterpret_cast( &acquireInfo ), - reinterpret_cast( &configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::acquirePerformanceConfigurationINTELUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( configuration, ObjectRelease( *this, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::releasePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkReleasePerformanceConfigurationINTEL( m_device, static_cast( configuration ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::releasePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkReleasePerformanceConfigurationINTEL( m_device, static_cast( configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::releasePerformanceConfigurationINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::release( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkReleasePerformanceConfigurationINTEL( m_device, static_cast( configuration ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::release( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkReleasePerformanceConfigurationINTEL( m_device, static_cast( configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::release" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkQueueSetPerformanceConfigurationINTEL( m_queue, static_cast( configuration ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Queue::setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueueSetPerformanceConfigurationINTEL( m_queue, static_cast( configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::setPerformanceConfigurationINTEL" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter, - VULKAN_HPP_NAMESPACE::PerformanceValueINTEL * pValue, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPerformanceParameterINTEL( - m_device, static_cast( parameter ), reinterpret_cast( pValue ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PerformanceValueINTEL value; - VkResult result = d.vkGetPerformanceParameterINTEL( - m_device, static_cast( parameter ), reinterpret_cast( &value ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPerformanceParameterINTEL" ); - - return createResultValueType( static_cast( result ), value ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_display_native_hdr === - - template - VULKAN_HPP_INLINE void Device::setLocalDimmingAMD( VULKAN_HPP_NAMESPACE::SwapchainKHR swapChain, - VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkSetLocalDimmingAMD( m_device, static_cast( swapChain ), static_cast( localDimmingEnable ) ); - } - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Instance::createImagePipeSurfaceFUCHSIA( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateImagePipeSurfaceFUCHSIA( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createImagePipeSurfaceFUCHSIA( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateImagePipeSurfaceFUCHSIA( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createImagePipeSurfaceFUCHSIA" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createImagePipeSurfaceFUCHSIAUnique( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateImagePipeSurfaceFUCHSIA( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createImagePipeSurfaceFUCHSIAUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createMetalSurfaceEXT( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateMetalSurfaceEXT( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createMetalSurfaceEXT( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateMetalSurfaceEXT( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createMetalSurfaceEXT" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createMetalSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = - d.vkCreateMetalSurfaceEXT( m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createMetalSurfaceEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getFragmentShadingRatesKHR( uint32_t * pFragmentShadingRateCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateKHR * pFragmentShadingRates, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceFragmentShadingRatesKHR( - m_physicalDevice, pFragmentShadingRateCount, reinterpret_cast( pFragmentShadingRates ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getFragmentShadingRatesKHR( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector fragmentShadingRates; - uint32_t fragmentShadingRateCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceFragmentShadingRatesKHR( m_physicalDevice, &fragmentShadingRateCount, nullptr ); - if ( ( result == VK_SUCCESS ) && fragmentShadingRateCount ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - result = d.vkGetPhysicalDeviceFragmentShadingRatesKHR( - m_physicalDevice, &fragmentShadingRateCount, reinterpret_cast( fragmentShadingRates.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getFragmentShadingRatesKHR" ); - VULKAN_HPP_ASSERT( fragmentShadingRateCount <= fragmentShadingRates.size() ); - if ( fragmentShadingRateCount < fragmentShadingRates.size() ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - } - return createResultValueType( static_cast( result ), fragmentShadingRates ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getFragmentShadingRatesKHR( PhysicalDeviceFragmentShadingRateKHRAllocator & physicalDeviceFragmentShadingRateKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector fragmentShadingRates( - physicalDeviceFragmentShadingRateKHRAllocator ); - uint32_t fragmentShadingRateCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceFragmentShadingRatesKHR( m_physicalDevice, &fragmentShadingRateCount, nullptr ); - if ( ( result == VK_SUCCESS ) && fragmentShadingRateCount ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - result = d.vkGetPhysicalDeviceFragmentShadingRatesKHR( - m_physicalDevice, &fragmentShadingRateCount, reinterpret_cast( fragmentShadingRates.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getFragmentShadingRatesKHR" ); - VULKAN_HPP_ASSERT( fragmentShadingRateCount <= fragmentShadingRates.size() ); - if ( fragmentShadingRateCount < fragmentShadingRates.size() ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - } - return createResultValueType( static_cast( result ), fragmentShadingRates ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D * pFragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetFragmentShadingRateKHR( - m_commandBuffer, reinterpret_cast( pFragmentSize ), reinterpret_cast( combinerOps ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D & fragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetFragmentShadingRateKHR( - m_commandBuffer, reinterpret_cast( &fragmentSize ), reinterpret_cast( combinerOps ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_buffer_device_address === - - template - VULKAN_HPP_INLINE DeviceAddress Device::getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetBufferDeviceAddressEXT( m_device, reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress Device::getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkDeviceAddress result = d.vkGetBufferDeviceAddressEXT( m_device, reinterpret_cast( &info ) ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_tooling_info === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getToolPropertiesEXT( uint32_t * pToolCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties * pToolProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPhysicalDeviceToolPropertiesEXT( m_physicalDevice, pToolCount, reinterpret_cast( pToolProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getToolPropertiesEXT( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector toolProperties; - uint32_t toolCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceToolPropertiesEXT( m_physicalDevice, &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = - d.vkGetPhysicalDeviceToolPropertiesEXT( m_physicalDevice, &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolPropertiesEXT" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return createResultValueType( static_cast( result ), toolProperties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getToolPropertiesEXT( PhysicalDeviceToolPropertiesAllocator & physicalDeviceToolPropertiesAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector toolProperties( - physicalDeviceToolPropertiesAllocator ); - uint32_t toolCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceToolPropertiesEXT( m_physicalDevice, &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = - d.vkGetPhysicalDeviceToolPropertiesEXT( m_physicalDevice, &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolPropertiesEXT" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return createResultValueType( static_cast( result ), toolProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_present_wait === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::waitForPresentKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t presentId, - uint64_t timeout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkWaitForPresentKHR( m_device, static_cast( swapchain ), presentId, timeout ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::waitForPresentKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, uint64_t presentId, uint64_t timeout, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkWaitForPresentKHR( m_device, static_cast( swapchain ), presentId, timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitForPresentKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_cooperative_matrix === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getCooperativeMatrixPropertiesNV( - uint32_t * pPropertyCount, VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesNV * pProperties, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( - m_physicalDevice, pPropertyCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getCooperativeMatrixPropertiesNV( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCooperativeMatrixPropertiesNV" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getCooperativeMatrixPropertiesNV( CooperativeMatrixPropertiesNVAllocator & cooperativeMatrixPropertiesNVAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( - cooperativeMatrixPropertiesNVAllocator ); - uint32_t propertyCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( m_physicalDevice, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = d.vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( - m_physicalDevice, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCooperativeMatrixPropertiesNV" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_coverage_reduction_mode === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV( - uint32_t * pCombinationCount, VULKAN_HPP_NAMESPACE::FramebufferMixedSamplesCombinationNV * pCombinations, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - m_physicalDevice, pCombinationCount, reinterpret_cast( pCombinations ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector combinations; - uint32_t combinationCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( m_physicalDevice, &combinationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && combinationCount ) - { - combinations.resize( combinationCount ); - result = d.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - m_physicalDevice, &combinationCount, reinterpret_cast( combinations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV" ); - VULKAN_HPP_ASSERT( combinationCount <= combinations.size() ); - if ( combinationCount < combinations.size() ) - { - combinations.resize( combinationCount ); - } - return createResultValueType( static_cast( result ), combinations ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV( - FramebufferMixedSamplesCombinationNVAllocator & framebufferMixedSamplesCombinationNVAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector combinations( - framebufferMixedSamplesCombinationNVAllocator ); - uint32_t combinationCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( m_physicalDevice, &combinationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && combinationCount ) - { - combinations.resize( combinationCount ); - result = d.vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - m_physicalDevice, &combinationCount, reinterpret_cast( combinations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV" ); - VULKAN_HPP_ASSERT( combinationCount <= combinations.size() ); - if ( combinationCount < combinations.size() ) - { - combinations.resize( combinationCount ); - } - return createResultValueType( static_cast( result ), combinations ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - PhysicalDevice::getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pPresentModeCount, - VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceSurfacePresentModes2EXT( m_physicalDevice, - reinterpret_cast( pSurfaceInfo ), - pPresentModeCount, - reinterpret_cast( pPresentModes ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentModes; - uint32_t presentModeCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfacePresentModes2EXT( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &presentModeCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = d.vkGetPhysicalDeviceSurfacePresentModes2EXT( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &presentModeCount, - reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModes2EXT" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return createResultValueType( static_cast( result ), presentModes ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - PresentModeKHRAllocator & presentModeKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector presentModes( presentModeKHRAllocator ); - uint32_t presentModeCount; - VkResult result; - do - { - result = d.vkGetPhysicalDeviceSurfacePresentModes2EXT( - m_physicalDevice, reinterpret_cast( &surfaceInfo ), &presentModeCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = d.vkGetPhysicalDeviceSurfacePresentModes2EXT( m_physicalDevice, - reinterpret_cast( &surfaceInfo ), - &presentModeCount, - reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModes2EXT" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return createResultValueType( static_cast( result ), presentModes ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::acquireFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireFullScreenExclusiveModeEXT( m_device, static_cast( swapchain ) ) ); - } -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::acquireFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkAcquireFullScreenExclusiveModeEXT( m_device, static_cast( swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::acquireFullScreenExclusiveModeEXT" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::releaseFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkReleaseFullScreenExclusiveModeEXT( m_device, static_cast( swapchain ) ) ); - } -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::releaseFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkReleaseFullScreenExclusiveModeEXT( m_device, static_cast( swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::releaseFullScreenExclusiveModeEXT" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR * pModes, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDeviceGroupSurfacePresentModes2EXT( - m_device, reinterpret_cast( pSurfaceInfo ), reinterpret_cast( pModes ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes; - VkResult result = d.vkGetDeviceGroupSurfacePresentModes2EXT( - m_device, reinterpret_cast( &surfaceInfo ), reinterpret_cast( &modes ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModes2EXT" ); - - return createResultValueType( static_cast( result ), modes ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createHeadlessSurfaceEXT( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateHeadlessSurfaceEXT( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createHeadlessSurfaceEXT( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateHeadlessSurfaceEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createHeadlessSurfaceEXT" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createHeadlessSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateHeadlessSurfaceEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createHeadlessSurfaceEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_buffer_device_address === - - template - VULKAN_HPP_INLINE DeviceAddress Device::getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetBufferDeviceAddressKHR( m_device, reinterpret_cast( pInfo ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress Device::getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkDeviceAddress result = d.vkGetBufferDeviceAddressKHR( m_device, reinterpret_cast( &info ) ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE uint64_t Device::getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetBufferOpaqueCaptureAddressKHR( m_device, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE uint64_t Device::getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t result = d.vkGetBufferOpaqueCaptureAddressKHR( m_device, reinterpret_cast( &info ) ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE uint64_t Device::getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo * pInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetDeviceMemoryOpaqueCaptureAddressKHR( m_device, reinterpret_cast( pInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE uint64_t Device::getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t result = d.vkGetDeviceMemoryOpaqueCaptureAddressKHR( m_device, reinterpret_cast( &info ) ); - - return result; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_line_rasterization === - - template - VULKAN_HPP_INLINE void - CommandBuffer::setLineStippleEXT( uint32_t lineStippleFactor, uint16_t lineStipplePattern, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetLineStippleEXT( m_commandBuffer, lineStippleFactor, lineStipplePattern ); - } - - //=== VK_EXT_host_query_reset === - - template - VULKAN_HPP_INLINE void Device::resetQueryPoolEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkResetQueryPoolEXT( m_device, static_cast( queryPool ), firstQuery, queryCount ); - } - - //=== VK_EXT_extended_dynamic_state === - - template - VULKAN_HPP_INLINE void CommandBuffer::setCullModeEXT( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetCullModeEXT( m_commandBuffer, static_cast( cullMode ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setFrontFaceEXT( VULKAN_HPP_NAMESPACE::FrontFace frontFace, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetFrontFaceEXT( m_commandBuffer, static_cast( frontFace ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveTopologyEXT( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetPrimitiveTopologyEXT( m_commandBuffer, static_cast( primitiveTopology ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWithCountEXT( uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetViewportWithCountEXT( m_commandBuffer, viewportCount, reinterpret_cast( pViewports ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setViewportWithCountEXT( ArrayProxy const & viewports, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetViewportWithCountEXT( m_commandBuffer, viewports.size(), reinterpret_cast( viewports.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - CommandBuffer::setScissorWithCountEXT( uint32_t scissorCount, const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetScissorWithCountEXT( m_commandBuffer, scissorCount, reinterpret_cast( pScissors ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setScissorWithCountEXT( ArrayProxy const & scissors, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetScissorWithCountEXT( m_commandBuffer, scissors.size(), reinterpret_cast( scissors.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2EXT( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - const VULKAN_HPP_NAMESPACE::DeviceSize * pStrides, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindVertexBuffers2EXT( m_commandBuffer, - firstBinding, - bindingCount, - reinterpret_cast( pBuffers ), - reinterpret_cast( pOffsets ), - reinterpret_cast( pSizes ), - reinterpret_cast( pStrides ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2EXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes, - ArrayProxy const & strides, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( buffers.size() == offsets.size() ); - VULKAN_HPP_ASSERT( sizes.empty() || buffers.size() == sizes.size() ); - VULKAN_HPP_ASSERT( strides.empty() || buffers.size() == strides.size() ); -# else - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != sizes.size()" ); - } - if ( !strides.empty() && buffers.size() != strides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != strides.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdBindVertexBuffers2EXT( m_commandBuffer, - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ), - reinterpret_cast( strides.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthTestEnableEXT( m_commandBuffer, static_cast( depthTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthWriteEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthWriteEnableEXT( m_commandBuffer, static_cast( depthWriteEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthCompareOpEXT( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthCompareOpEXT( m_commandBuffer, static_cast( depthCompareOp ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthBoundsTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBoundsTestEnableEXT( m_commandBuffer, static_cast( depthBoundsTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setStencilTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilTestEnableEXT( m_commandBuffer, static_cast( stencilTestEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setStencilOpEXT( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetStencilOpEXT( m_commandBuffer, - static_cast( faceMask ), - static_cast( failOp ), - static_cast( passOp ), - static_cast( depthFailOp ), - static_cast( compareOp ) ); - } - - //=== VK_KHR_deferred_host_operations === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createDeferredOperationKHR( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DeferredOperationKHR * pDeferredOperation, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDeferredOperationKHR( - m_device, reinterpret_cast( pAllocator ), reinterpret_cast( pDeferredOperation ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createDeferredOperationKHR( Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation; - VkResult result = d.vkCreateDeferredOperationKHR( - m_device, - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &deferredOperation ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDeferredOperationKHR" ); - - return createResultValueType( static_cast( result ), deferredOperation ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createDeferredOperationKHRUnique( Optional allocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation; - VkResult result = d.vkCreateDeferredOperationKHR( - m_device, - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &deferredOperation ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createDeferredOperationKHRUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( deferredOperation, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyDeferredOperationKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDeferredOperationKHR( - m_device, static_cast( operation ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyDeferredOperationKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDeferredOperationKHR( - m_device, - static_cast( operation ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyDeferredOperationKHR( - m_device, static_cast( operation ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyDeferredOperationKHR( - m_device, - static_cast( operation ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE uint32_t Device::getDeferredOperationMaxConcurrencyKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return d.vkGetDeferredOperationMaxConcurrencyKHR( m_device, static_cast( operation ) ); - } - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getDeferredOperationResultKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDeferredOperationResultKHR( m_device, static_cast( operation ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::getDeferredOperationResultKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkGetDeferredOperationResultKHR( m_device, static_cast( operation ) ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::deferredOperationJoinKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkDeferredOperationJoinKHR( m_device, static_cast( operation ) ) ); - } -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::deferredOperationJoinKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkDeferredOperationJoinKHR( m_device, static_cast( operation ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::deferredOperationJoinKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eThreadDoneKHR, VULKAN_HPP_NAMESPACE::Result::eThreadIdleKHR } ); - - return static_cast( result ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_pipeline_executable_properties === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR * pPipelineInfo, - uint32_t * pExecutableCount, - VULKAN_HPP_NAMESPACE::PipelineExecutablePropertiesKHR * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPipelineExecutablePropertiesKHR( m_device, - reinterpret_cast( pPipelineInfo ), - pExecutableCount, - reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t executableCount; - VkResult result; - do - { - result = d.vkGetPipelineExecutablePropertiesKHR( m_device, reinterpret_cast( &pipelineInfo ), &executableCount, nullptr ); - if ( ( result == VK_SUCCESS ) && executableCount ) - { - properties.resize( executableCount ); - result = d.vkGetPipelineExecutablePropertiesKHR( m_device, - reinterpret_cast( &pipelineInfo ), - &executableCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutablePropertiesKHR" ); - VULKAN_HPP_ASSERT( executableCount <= properties.size() ); - if ( executableCount < properties.size() ) - { - properties.resize( executableCount ); - } - return createResultValueType( static_cast( result ), properties ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo, - PipelineExecutablePropertiesKHRAllocator & pipelineExecutablePropertiesKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( - pipelineExecutablePropertiesKHRAllocator ); - uint32_t executableCount; - VkResult result; - do - { - result = d.vkGetPipelineExecutablePropertiesKHR( m_device, reinterpret_cast( &pipelineInfo ), &executableCount, nullptr ); - if ( ( result == VK_SUCCESS ) && executableCount ) - { - properties.resize( executableCount ); - result = d.vkGetPipelineExecutablePropertiesKHR( m_device, - reinterpret_cast( &pipelineInfo ), - &executableCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutablePropertiesKHR" ); - VULKAN_HPP_ASSERT( executableCount <= properties.size() ); - if ( executableCount < properties.size() ) - { - properties.resize( executableCount ); - } - return createResultValueType( static_cast( result ), properties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pStatisticCount, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticKHR * pStatistics, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPipelineExecutableStatisticsKHR( m_device, - reinterpret_cast( pExecutableInfo ), - pStatisticCount, - reinterpret_cast( pStatistics ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector statistics; - uint32_t statisticCount; - VkResult result; - do - { - result = - d.vkGetPipelineExecutableStatisticsKHR( m_device, reinterpret_cast( &executableInfo ), &statisticCount, nullptr ); - if ( ( result == VK_SUCCESS ) && statisticCount ) - { - statistics.resize( statisticCount ); - result = d.vkGetPipelineExecutableStatisticsKHR( m_device, - reinterpret_cast( &executableInfo ), - &statisticCount, - reinterpret_cast( statistics.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableStatisticsKHR" ); - VULKAN_HPP_ASSERT( statisticCount <= statistics.size() ); - if ( statisticCount < statistics.size() ) - { - statistics.resize( statisticCount ); - } - return createResultValueType( static_cast( result ), statistics ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE - typename ResultValueType>::type - Device::getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - PipelineExecutableStatisticKHRAllocator & pipelineExecutableStatisticKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector statistics( - pipelineExecutableStatisticKHRAllocator ); - uint32_t statisticCount; - VkResult result; - do - { - result = - d.vkGetPipelineExecutableStatisticsKHR( m_device, reinterpret_cast( &executableInfo ), &statisticCount, nullptr ); - if ( ( result == VK_SUCCESS ) && statisticCount ) - { - statistics.resize( statisticCount ); - result = d.vkGetPipelineExecutableStatisticsKHR( m_device, - reinterpret_cast( &executableInfo ), - &statisticCount, - reinterpret_cast( statistics.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableStatisticsKHR" ); - VULKAN_HPP_ASSERT( statisticCount <= statistics.size() ); - if ( statisticCount < statistics.size() ) - { - statistics.resize( statisticCount ); - } - return createResultValueType( static_cast( result ), statistics ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pInternalRepresentationCount, - VULKAN_HPP_NAMESPACE::PipelineExecutableInternalRepresentationKHR * pInternalRepresentations, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetPipelineExecutableInternalRepresentationsKHR( m_device, - reinterpret_cast( pExecutableInfo ), - pInternalRepresentationCount, - reinterpret_cast( pInternalRepresentations ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType< - std::vector>::type - Device::getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector - internalRepresentations; - uint32_t internalRepresentationCount; - VkResult result; - do - { - result = d.vkGetPipelineExecutableInternalRepresentationsKHR( - m_device, reinterpret_cast( &executableInfo ), &internalRepresentationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && internalRepresentationCount ) - { - internalRepresentations.resize( internalRepresentationCount ); - result = d.vkGetPipelineExecutableInternalRepresentationsKHR( - m_device, - reinterpret_cast( &executableInfo ), - &internalRepresentationCount, - reinterpret_cast( internalRepresentations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableInternalRepresentationsKHR" ); - VULKAN_HPP_ASSERT( internalRepresentationCount <= internalRepresentations.size() ); - if ( internalRepresentationCount < internalRepresentations.size() ) - { - internalRepresentations.resize( internalRepresentationCount ); - } - return createResultValueType( static_cast( result ), internalRepresentations ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType< - std::vector>::type - Device::getPipelineExecutableInternalRepresentationsKHR( - const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - PipelineExecutableInternalRepresentationKHRAllocator & pipelineExecutableInternalRepresentationKHRAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector - internalRepresentations( pipelineExecutableInternalRepresentationKHRAllocator ); - uint32_t internalRepresentationCount; - VkResult result; - do - { - result = d.vkGetPipelineExecutableInternalRepresentationsKHR( - m_device, reinterpret_cast( &executableInfo ), &internalRepresentationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && internalRepresentationCount ) - { - internalRepresentations.resize( internalRepresentationCount ); - result = d.vkGetPipelineExecutableInternalRepresentationsKHR( - m_device, - reinterpret_cast( &executableInfo ), - &internalRepresentationCount, - reinterpret_cast( internalRepresentations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableInternalRepresentationsKHR" ); - VULKAN_HPP_ASSERT( internalRepresentationCount <= internalRepresentations.size() ); - if ( internalRepresentationCount < internalRepresentations.size() ) - { - internalRepresentations.resize( internalRepresentationCount ); - } - return createResultValueType( static_cast( result ), internalRepresentations ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_device_generated_commands === - - template - VULKAN_HPP_INLINE void Device::getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetGeneratedCommandsMemoryRequirementsNV( m_device, - reinterpret_cast( pInfo ), - reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetGeneratedCommandsMemoryRequirementsNV( m_device, - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetGeneratedCommandsMemoryRequirementsNV( m_device, - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV * pGeneratedCommandsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPreprocessGeneratedCommandsNV( m_commandBuffer, reinterpret_cast( pGeneratedCommandsInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPreprocessGeneratedCommandsNV( m_commandBuffer, reinterpret_cast( &generatedCommandsInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV * pGeneratedCommandsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdExecuteGeneratedCommandsNV( - m_commandBuffer, static_cast( isPreprocessed ), reinterpret_cast( pGeneratedCommandsInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdExecuteGeneratedCommandsNV( - m_commandBuffer, static_cast( isPreprocessed ), reinterpret_cast( &generatedCommandsInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::bindPipelineShaderGroupNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t groupIndex, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindPipelineShaderGroupNV( m_commandBuffer, static_cast( pipelineBindPoint ), static_cast( pipeline ), groupIndex ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createIndirectCommandsLayoutNV( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV * pIndirectCommandsLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateIndirectCommandsLayoutNV( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pIndirectCommandsLayout ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createIndirectCommandsLayoutNV( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout; - VkResult result = d.vkCreateIndirectCommandsLayoutNV( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &indirectCommandsLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createIndirectCommandsLayoutNV" ); - - return createResultValueType( static_cast( result ), indirectCommandsLayout ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createIndirectCommandsLayoutNVUnique( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout; - VkResult result = d.vkCreateIndirectCommandsLayoutNV( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &indirectCommandsLayout ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createIndirectCommandsLayoutNVUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( - indirectCommandsLayout, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyIndirectCommandsLayoutNV( - m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyIndirectCommandsLayoutNV( - m_device, - static_cast( indirectCommandsLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyIndirectCommandsLayoutNV( - m_device, static_cast( indirectCommandsLayout ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyIndirectCommandsLayoutNV( - m_device, - static_cast( indirectCommandsLayout ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_acquire_drm_display === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::acquireDrmDisplayEXT( int32_t drmFd, - VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireDrmDisplayEXT( m_physicalDevice, drmFd, static_cast( display ) ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::acquireDrmDisplayEXT( int32_t drmFd, VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkAcquireDrmDisplayEXT( m_physicalDevice, drmFd, static_cast( display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::acquireDrmDisplayEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getDrmDisplayEXT( int32_t drmFd, - uint32_t connectorId, - VULKAN_HPP_NAMESPACE::DisplayKHR * display, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDrmDisplayEXT( m_physicalDevice, drmFd, connectorId, reinterpret_cast( display ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getDrmDisplayEXT( int32_t drmFd, uint32_t connectorId, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetDrmDisplayEXT( m_physicalDevice, drmFd, connectorId, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDrmDisplayEXT" ); - - return createResultValueType( static_cast( result ), display ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getDrmDisplayEXTUnique( int32_t drmFd, uint32_t connectorId, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetDrmDisplayEXT( m_physicalDevice, drmFd, connectorId, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDrmDisplayEXTUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( display, ObjectRelease( *this, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_private_data === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::createPrivateDataSlotEXT( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PrivateDataSlot * pPrivateDataSlot, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreatePrivateDataSlotEXT( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPrivateDataSlot ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createPrivateDataSlotEXT( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot; - VkResult result = d.vkCreatePrivateDataSlotEXT( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &privateDataSlot ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPrivateDataSlotEXT" ); - - return createResultValueType( static_cast( result ), privateDataSlot ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createPrivateDataSlotEXTUnique( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot; - VkResult result = d.vkCreatePrivateDataSlotEXT( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &privateDataSlot ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createPrivateDataSlotEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( privateDataSlot, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyPrivateDataSlotEXT( m_device, static_cast( privateDataSlot ), reinterpret_cast( pAllocator ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyPrivateDataSlotEXT( - m_device, - static_cast( privateDataSlot ), - reinterpret_cast( static_cast( allocator ) ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkSetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ) ); - } -#else - template - VULKAN_HPP_INLINE typename ResultValueType::type Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = - d.vkSetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), data ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateDataEXT" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), pData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - uint64_t data; - d.vkGetPrivateDataEXT( m_device, static_cast( objectType ), objectHandle, static_cast( privateDataSlot ), &data ); - - return data; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - template - VULKAN_HPP_INLINE void CommandBuffer::encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR * pEncodeInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdEncodeVideoKHR( m_commandBuffer, reinterpret_cast( pEncodeInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR & encodeInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdEncodeVideoKHR( m_commandBuffer, reinterpret_cast( &encodeInfo ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - template - VULKAN_HPP_INLINE void Device::exportMetalObjectsEXT( VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT * pMetalObjectsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkExportMetalObjectsEXT( m_device, reinterpret_cast( pMetalObjectsInfo ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT - Device::exportMetalObjectsEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT metalObjectsInfo; - d.vkExportMetalObjectsEXT( m_device, reinterpret_cast( &metalObjectsInfo ) ); - - return metalObjectsInfo; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain Device::exportMetalObjectsEXT( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT & metalObjectsInfo = structureChain.template get(); - d.vkExportMetalObjectsEXT( m_device, reinterpret_cast( &metalObjectsInfo ) ); - - return structureChain; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - - template - VULKAN_HPP_INLINE void CommandBuffer::setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetEvent2KHR( m_commandBuffer, static_cast( event ), reinterpret_cast( pDependencyInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetEvent2KHR( m_commandBuffer, static_cast( event ), reinterpret_cast( &dependencyInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::resetEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResetEvent2KHR( m_commandBuffer, static_cast( event ), static_cast( stageMask ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2KHR( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWaitEvents2KHR( - m_commandBuffer, eventCount, reinterpret_cast( pEvents ), reinterpret_cast( pDependencyInfos ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2KHR( ArrayProxy const & events, - ArrayProxy const & dependencyInfos, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( events.size() == dependencyInfos.size() ); -# else - if ( events.size() != dependencyInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::waitEvents2KHR: events.size() != dependencyInfos.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - - d.vkCmdWaitEvents2KHR( m_commandBuffer, - events.size(), - reinterpret_cast( events.data() ), - reinterpret_cast( dependencyInfos.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdPipelineBarrier2KHR( m_commandBuffer, reinterpret_cast( pDependencyInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdPipelineBarrier2KHR( m_commandBuffer, reinterpret_cast( &dependencyInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp2KHR( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteTimestamp2KHR( m_commandBuffer, static_cast( stage ), static_cast( queryPool ), query ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Queue::submit2KHR( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo2 * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkQueueSubmit2KHR( m_queue, submitCount, reinterpret_cast( pSubmits ), static_cast( fence ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Queue::submit2KHR( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkQueueSubmit2KHR( m_queue, submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit2KHR" ); - - return createResultValueType( static_cast( result ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarker2AMD( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdWriteBufferMarker2AMD( - m_commandBuffer, static_cast( stage ), static_cast( dstBuffer ), static_cast( dstOffset ), marker ); - } - - template - VULKAN_HPP_INLINE void Queue::getCheckpointData2NV( uint32_t * pCheckpointDataCount, - VULKAN_HPP_NAMESPACE::CheckpointData2NV * pCheckpointData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetQueueCheckpointData2NV( m_queue, pCheckpointDataCount, reinterpret_cast( pCheckpointData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Queue::getCheckpointData2NV( Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector checkpointData; - uint32_t checkpointDataCount; - d.vkGetQueueCheckpointData2NV( m_queue, &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - d.vkGetQueueCheckpointData2NV( m_queue, &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Queue::getCheckpointData2NV( CheckpointData2NVAllocator & checkpointData2NVAllocator, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector checkpointData( checkpointData2NVAllocator ); - uint32_t checkpointDataCount; - d.vkGetQueueCheckpointData2NV( m_queue, &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - d.vkGetQueueCheckpointData2NV( m_queue, &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_fragment_shading_rate_enums === - - template - VULKAN_HPP_INLINE void CommandBuffer::setFragmentShadingRateEnumNV( VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetFragmentShadingRateEnumNV( - m_commandBuffer, static_cast( shadingRate ), reinterpret_cast( combinerOps ) ); - } - - //=== VK_EXT_mesh_shader === - - template - VULKAN_HPP_INLINE void - CommandBuffer::drawMeshTasksEXT( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksEXT( m_commandBuffer, groupCountX, groupCountY, groupCountZ ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksIndirectEXT( m_commandBuffer, static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectCountEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMeshTasksIndirectCountEXT( m_commandBuffer, - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_KHR_copy_commands2 === - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 * pCopyBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBuffer2KHR( m_commandBuffer, reinterpret_cast( pCopyBufferInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBuffer2KHR( m_commandBuffer, reinterpret_cast( ©BufferInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 * pCopyImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImage2KHR( m_commandBuffer, reinterpret_cast( pCopyImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImage2KHR( m_commandBuffer, reinterpret_cast( ©ImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 * pCopyBufferToImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyBufferToImage2KHR( m_commandBuffer, reinterpret_cast( pCopyBufferToImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyBufferToImage2KHR( m_commandBuffer, reinterpret_cast( ©BufferToImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 * pCopyImageToBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdCopyImageToBuffer2KHR( m_commandBuffer, reinterpret_cast( pCopyImageToBufferInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdCopyImageToBuffer2KHR( m_commandBuffer, reinterpret_cast( ©ImageToBufferInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 * pBlitImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBlitImage2KHR( m_commandBuffer, reinterpret_cast( pBlitImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdBlitImage2KHR( m_commandBuffer, reinterpret_cast( &blitImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 * pResolveImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdResolveImage2KHR( m_commandBuffer, reinterpret_cast( pResolveImageInfo ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdResolveImage2KHR( m_commandBuffer, reinterpret_cast( &resolveImageInfo ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_image_compression_control === - - template - VULKAN_HPP_INLINE void Device::getImageSubresourceLayout2EXT( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT * pSubresource, - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT * pLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetImageSubresourceLayout2EXT( m_device, - static_cast( image ), - reinterpret_cast( pSubresource ), - reinterpret_cast( pLayout ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT Device::getImageSubresourceLayout2EXT( - VULKAN_HPP_NAMESPACE::Image image, const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT layout; - d.vkGetImageSubresourceLayout2EXT( m_device, - static_cast( image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return layout; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain Device::getImageSubresourceLayout2EXT( - VULKAN_HPP_NAMESPACE::Image image, const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT & layout = structureChain.template get(); - d.vkGetImageSubresourceLayout2EXT( m_device, - static_cast( image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::acquireWinrtDisplayNV( VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkAcquireWinrtDisplayNV( m_physicalDevice, static_cast( display ) ) ); - } -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::acquireWinrtDisplayNV( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkAcquireWinrtDisplayNV( m_physicalDevice, static_cast( display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::acquireWinrtDisplayNV" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result PhysicalDevice::getWinrtDisplayNV( uint32_t deviceRelativeId, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplay, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetWinrtDisplayNV( m_physicalDevice, deviceRelativeId, reinterpret_cast( pDisplay ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - PhysicalDevice::getWinrtDisplayNV( uint32_t deviceRelativeId, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetWinrtDisplayNV( m_physicalDevice, deviceRelativeId, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getWinrtDisplayNV" ); - - return createResultValueType( static_cast( result ), display ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - PhysicalDevice::getWinrtDisplayNVUnique( uint32_t deviceRelativeId, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DisplayKHR display; - VkResult result = d.vkGetWinrtDisplayNV( m_physicalDevice, deviceRelativeId, reinterpret_cast( &display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getWinrtDisplayNVUnique" ); - - return createResultValueType( static_cast( result ), - UniqueHandle( display, ObjectRelease( *this, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createDirectFBSurfaceEXT( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateDirectFBSurfaceEXT( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createDirectFBSurfaceEXT( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateDirectFBSurfaceEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDirectFBSurfaceEXT" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createDirectFBSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateDirectFBSurfaceEXT( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createDirectFBSurfaceEXTUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, - IDirectFB * dfb, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceDirectFBPresentationSupportEXT( m_physicalDevice, queueFamilyIndex, dfb ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, IDirectFB & dfb, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkBool32 result = d.vkGetPhysicalDeviceDirectFBPresentationSupportEXT( m_physicalDevice, queueFamilyIndex, &dfb ); - - return static_cast( result ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdTraceRaysKHR( m_commandBuffer, - reinterpret_cast( pRaygenShaderBindingTable ), - reinterpret_cast( pMissShaderBindingTable ), - reinterpret_cast( pHitShaderBindingTable ), - reinterpret_cast( pCallableShaderBindingTable ), - width, - height, - depth ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdTraceRaysKHR( m_commandBuffer, - reinterpret_cast( &raygenShaderBindingTable ), - reinterpret_cast( &missShaderBindingTable ), - reinterpret_cast( &hitShaderBindingTable ), - reinterpret_cast( &callableShaderBindingTable ), - width, - height, - depth ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateRayTracingPipelinesKHR( m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - createInfoCount, - reinterpret_cast( pCreateInfos ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pPipelines ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size(), pipelineAllocator ); - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( static_cast( result ), pipelines ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue - Device::createRayTracingPipelineKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelineKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue( static_cast( result ), pipeline ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createRayTracingPipelinesKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesKHRUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines; - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template >::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue, PipelineAllocator>> - Device::createRayTracingPipelinesKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector pipelines( createInfos.size() ); - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( pipelines.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelinesKHRUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - std::vector, PipelineAllocator> uniquePipelines( pipelineAllocator ); - uniquePipelines.reserve( createInfos.size() ); - ObjectDestroy deleter( *this, allocator, d ); - for ( auto const & pipeline : pipelines ) - { - uniquePipelines.push_back( UniqueHandle( pipeline, deleter ) ); - } - return ResultValue, PipelineAllocator>>( - static_cast( result ), std::move( uniquePipelines ) ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue> - Device::createRayTracingPipelineKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Pipeline pipeline; - VkResult result = d.vkCreateRayTracingPipelinesKHR( - m_device, - static_cast( deferredOperation ), - static_cast( pipelineCache ), - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &pipeline ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::createRayTracingPipelineKHRUnique", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT } ); - - return ResultValue>( - static_cast( result ), - UniqueHandle( pipeline, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetRayTracingShaderGroupHandlesKHR( m_device, static_cast( pipeline ), firstGroup, groupCount, dataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type Device::getRayTracingShaderGroupHandlesKHR( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkGetRayTracingShaderGroupHandlesKHR( - m_device, static_cast( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandlesKHR" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getRayTracingShaderGroupHandleKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkGetRayTracingShaderGroupHandlesKHR( - m_device, static_cast( pipeline ), firstGroup, groupCount, sizeof( DataType ), reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingShaderGroupHandleKHR" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( m_device, static_cast( pipeline ), firstGroup, groupCount, dataSize, pData ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getRayTracingCaptureReplayShaderGroupHandlesKHR( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( - m_device, static_cast( pipeline ), firstGroup, groupCount, data.size() * sizeof( DataType ), reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandlesKHR" ); - - return createResultValueType( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type Device::getRayTracingCaptureReplayShaderGroupHandleKHR( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - DataType data; - VkResult result = d.vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( - m_device, static_cast( pipeline ), firstGroup, groupCount, sizeof( DataType ), reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getRayTracingCaptureReplayShaderGroupHandleKHR" ); - - return createResultValueType( static_cast( result ), data ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdTraceRaysIndirectKHR( m_commandBuffer, - reinterpret_cast( pRaygenShaderBindingTable ), - reinterpret_cast( pMissShaderBindingTable ), - reinterpret_cast( pHitShaderBindingTable ), - reinterpret_cast( pCallableShaderBindingTable ), - static_cast( indirectDeviceAddress ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdTraceRaysIndirectKHR( m_commandBuffer, - reinterpret_cast( &raygenShaderBindingTable ), - reinterpret_cast( &missShaderBindingTable ), - reinterpret_cast( &hitShaderBindingTable ), - reinterpret_cast( &callableShaderBindingTable ), - static_cast( indirectDeviceAddress ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE DeviceSize Device::getRayTracingShaderGroupStackSizeKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t group, - VULKAN_HPP_NAMESPACE::ShaderGroupShaderKHR groupShader, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetRayTracingShaderGroupStackSizeKHR( m_device, static_cast( pipeline ), group, static_cast( groupShader ) ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setRayTracingPipelineStackSizeKHR( uint32_t pipelineStackSize, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetRayTracingPipelineStackSizeKHR( m_commandBuffer, pipelineStackSize ); - } - - //=== VK_EXT_vertex_input_dynamic_state === - - template - VULKAN_HPP_INLINE void CommandBuffer::setVertexInputEXT( uint32_t vertexBindingDescriptionCount, - const VULKAN_HPP_NAMESPACE::VertexInputBindingDescription2EXT * pVertexBindingDescriptions, - uint32_t vertexAttributeDescriptionCount, - const VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription2EXT * pVertexAttributeDescriptions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetVertexInputEXT( m_commandBuffer, - vertexBindingDescriptionCount, - reinterpret_cast( pVertexBindingDescriptions ), - vertexAttributeDescriptionCount, - reinterpret_cast( pVertexAttributeDescriptions ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void - CommandBuffer::setVertexInputEXT( ArrayProxy const & vertexBindingDescriptions, - ArrayProxy const & vertexAttributeDescriptions, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetVertexInputEXT( m_commandBuffer, - vertexBindingDescriptions.size(), - reinterpret_cast( vertexBindingDescriptions.data() ), - vertexAttributeDescriptions.size(), - reinterpret_cast( vertexAttributeDescriptions.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetMemoryZirconHandleFUCHSIA( m_device, reinterpret_cast( pGetZirconHandleInfo ), pZirconHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA & getZirconHandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - zx_handle_t zirconHandle; - VkResult result = - d.vkGetMemoryZirconHandleFUCHSIA( m_device, reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandleFUCHSIA" ); - - return createResultValueType( static_cast( result ), zirconHandle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t zirconHandle, - VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA * pMemoryZirconHandleProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetMemoryZirconHandlePropertiesFUCHSIA( m_device, - static_cast( handleType ), - zirconHandle, - reinterpret_cast( pMemoryZirconHandleProperties ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t zirconHandle, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA memoryZirconHandleProperties; - VkResult result = d.vkGetMemoryZirconHandlePropertiesFUCHSIA( m_device, - static_cast( handleType ), - zirconHandle, - reinterpret_cast( &memoryZirconHandleProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandlePropertiesFUCHSIA" ); - - return createResultValueType( static_cast( result ), memoryZirconHandleProperties ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::importSemaphoreZirconHandleFUCHSIA( - const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA * pImportSemaphoreZirconHandleInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkImportSemaphoreZirconHandleFUCHSIA( - m_device, reinterpret_cast( pImportSemaphoreZirconHandleInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::importSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA & importSemaphoreZirconHandleInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkImportSemaphoreZirconHandleFUCHSIA( - m_device, reinterpret_cast( &importSemaphoreZirconHandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreZirconHandleFUCHSIA" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( - d.vkGetSemaphoreZirconHandleFUCHSIA( m_device, reinterpret_cast( pGetZirconHandleInfo ), pZirconHandle ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA & getZirconHandleInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - zx_handle_t zirconHandle; - VkResult result = - d.vkGetSemaphoreZirconHandleFUCHSIA( m_device, reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreZirconHandleFUCHSIA" ); - - return createResultValueType( static_cast( result ), zirconHandle ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::createBufferCollectionFUCHSIA( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA * pCollection, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateBufferCollectionFUCHSIA( m_device, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pCollection ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::createBufferCollectionFUCHSIA( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection; - VkResult result = d.vkCreateBufferCollectionFUCHSIA( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &collection ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBufferCollectionFUCHSIA" ); - - return createResultValueType( static_cast( result ), collection ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::createBufferCollectionFUCHSIAUnique( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection; - VkResult result = d.vkCreateBufferCollectionFUCHSIA( - m_device, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &collection ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::createBufferCollectionFUCHSIAUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( collection, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::setBufferCollectionImageConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA * pImageConstraintsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSetBufferCollectionImageConstraintsFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( pImageConstraintsInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::setBufferCollectionImageConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA & imageConstraintsInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSetBufferCollectionImageConstraintsFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( &imageConstraintsInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setBufferCollectionImageConstraintsFUCHSIA" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::setBufferCollectionBufferConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA * pBufferConstraintsInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkSetBufferCollectionBufferConstraintsFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( pBufferConstraintsInfo ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS VULKAN_HPP_INLINE typename ResultValueType::type - Device::setBufferCollectionBufferConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA & bufferConstraintsInfo, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkResult result = d.vkSetBufferCollectionBufferConstraintsFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( &bufferConstraintsInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setBufferCollectionBufferConstraintsFUCHSIA" ); - - return createResultValueType( static_cast( result ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroyBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBufferCollectionFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroyBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBufferCollectionFUCHSIA( - m_device, - static_cast( collection ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkDestroyBufferCollectionFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( pAllocator ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void Device::destroy( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - Optional allocator, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkDestroyBufferCollectionFUCHSIA( - m_device, - static_cast( collection ), - reinterpret_cast( static_cast( allocator ) ) ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getBufferCollectionPropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetBufferCollectionPropertiesFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( pProperties ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getBufferCollectionPropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA properties; - VkResult result = d.vkGetBufferCollectionPropertiesFUCHSIA( - m_device, static_cast( collection ), reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getBufferCollectionPropertiesFUCHSIA" ); - - return createResultValueType( static_cast( result ), properties ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getSubpassShadingMaxWorkgroupSizeHUAWEI( VULKAN_HPP_NAMESPACE::RenderPass renderpass, - VULKAN_HPP_NAMESPACE::Extent2D * pMaxWorkgroupSize, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( - m_device, static_cast( renderpass ), reinterpret_cast( pMaxWorkgroupSize ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE ResultValue - Device::getSubpassShadingMaxWorkgroupSizeHUAWEI( VULKAN_HPP_NAMESPACE::RenderPass renderpass, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::Extent2D maxWorkgroupSize; - VkResult result = d.vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( - m_device, static_cast( renderpass ), reinterpret_cast( &maxWorkgroupSize ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getSubpassShadingMaxWorkgroupSizeHUAWEI", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eIncomplete } ); - - return ResultValue( static_cast( result ), maxWorkgroupSize ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::subpassShadingHUAWEI( Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSubpassShadingHUAWEI( m_commandBuffer ); - } - - //=== VK_HUAWEI_invocation_mask === - - template - VULKAN_HPP_INLINE void CommandBuffer::bindInvocationMaskHUAWEI( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdBindInvocationMaskHUAWEI( m_commandBuffer, static_cast( imageView ), static_cast( imageLayout ) ); - } - - //=== VK_NV_external_memory_rdma === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result - Device::getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV * pMemoryGetRemoteAddressInfo, - VULKAN_HPP_NAMESPACE::RemoteAddressNV * pAddress, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetMemoryRemoteAddressNV( - m_device, reinterpret_cast( pMemoryGetRemoteAddressInfo ), reinterpret_cast( pAddress ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV & memoryGetRemoteAddressInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::RemoteAddressNV address; - VkResult result = d.vkGetMemoryRemoteAddressNV( - m_device, reinterpret_cast( &memoryGetRemoteAddressInfo ), reinterpret_cast( &address ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryRemoteAddressNV" ); - - return createResultValueType( static_cast( result ), address ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_pipeline_properties === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT * pPipelineInfo, - VULKAN_HPP_NAMESPACE::BaseOutStructure * pPipelineProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPipelinePropertiesEXT( - m_device, reinterpret_cast( pPipelineInfo ), reinterpret_cast( pPipelineProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Device::getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT & pipelineInfo, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::BaseOutStructure pipelineProperties; - VkResult result = d.vkGetPipelinePropertiesEXT( - m_device, reinterpret_cast( &pipelineInfo ), reinterpret_cast( &pipelineProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelinePropertiesEXT" ); - - return createResultValueType( static_cast( result ), pipelineProperties ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_extended_dynamic_state2 === - - template - VULKAN_HPP_INLINE void CommandBuffer::setPatchControlPointsEXT( uint32_t patchControlPoints, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetPatchControlPointsEXT( m_commandBuffer, patchControlPoints ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setRasterizerDiscardEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetRasterizerDiscardEnableEXT( m_commandBuffer, static_cast( rasterizerDiscardEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setDepthBiasEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetDepthBiasEnableEXT( m_commandBuffer, static_cast( depthBiasEnable ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setLogicOpEXT( VULKAN_HPP_NAMESPACE::LogicOp logicOp, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetLogicOpEXT( m_commandBuffer, static_cast( logicOp ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveRestartEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetPrimitiveRestartEnableEXT( m_commandBuffer, static_cast( primitiveRestartEnable ) ); - } - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Instance::createScreenSurfaceQNX( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkCreateScreenSurfaceQNX( m_instance, - reinterpret_cast( pCreateInfo ), - reinterpret_cast( pAllocator ), - reinterpret_cast( pSurface ) ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType::type - Instance::createScreenSurfaceQNX( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateScreenSurfaceQNX( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createScreenSurfaceQNX" ); - - return createResultValueType( static_cast( result ), surface ); - } - -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Instance::createScreenSurfaceQNXUnique( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX & createInfo, - Optional allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::SurfaceKHR surface; - VkResult result = d.vkCreateScreenSurfaceQNX( - m_instance, - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &surface ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::createScreenSurfaceQNXUnique" ); - - return createResultValueType( - static_cast( result ), - UniqueHandle( surface, ObjectDestroy( *this, allocator, d ) ) ); - } -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Bool32 PhysicalDevice::getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, - struct _screen_window * window, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetPhysicalDeviceScreenPresentationSupportQNX( m_physicalDevice, queueFamilyIndex, window ) ); - } - -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, struct _screen_window & window, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VkBool32 result = d.vkGetPhysicalDeviceScreenPresentationSupportQNX( m_physicalDevice, queueFamilyIndex, &window ); - - return static_cast( result ); - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - - template - VULKAN_HPP_INLINE void CommandBuffer::setColorWriteEnableEXT( uint32_t attachmentCount, - const VULKAN_HPP_NAMESPACE::Bool32 * pColorWriteEnables, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdSetColorWriteEnableEXT( m_commandBuffer, attachmentCount, reinterpret_cast( pColorWriteEnables ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::setColorWriteEnableEXT( ArrayProxy const & colorWriteEnables, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdSetColorWriteEnableEXT( m_commandBuffer, colorWriteEnables.size(), reinterpret_cast( colorWriteEnables.data() ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_ray_tracing_maintenance1 === - - template - VULKAN_HPP_INLINE void CommandBuffer::traceRaysIndirect2KHR( VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdTraceRaysIndirect2KHR( m_commandBuffer, static_cast( indirectDeviceAddress ) ); - } - - //=== VK_EXT_multi_draw === - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMultiEXT( uint32_t drawCount, - const VULKAN_HPP_NAMESPACE::MultiDrawInfoEXT * pVertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMultiEXT( m_commandBuffer, drawCount, reinterpret_cast( pVertexInfo ), instanceCount, firstInstance, stride ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::drawMultiEXT( ArrayProxy const & vertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdDrawMultiEXT( - m_commandBuffer, vertexInfo.size(), reinterpret_cast( vertexInfo.data() ), instanceCount, firstInstance, stride ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void CommandBuffer::drawMultiIndexedEXT( uint32_t drawCount, - const VULKAN_HPP_NAMESPACE::MultiDrawIndexedInfoEXT * pIndexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - const int32_t * pVertexOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkCmdDrawMultiIndexedEXT( - m_commandBuffer, drawCount, reinterpret_cast( pIndexInfo ), instanceCount, firstInstance, stride, pVertexOffset ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_INLINE void CommandBuffer::drawMultiIndexedEXT( ArrayProxy const & indexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Optional vertexOffset, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - d.vkCmdDrawMultiIndexedEXT( m_commandBuffer, - indexInfo.size(), - reinterpret_cast( indexInfo.data() ), - instanceCount, - firstInstance, - stride, - static_cast( vertexOffset ) ); - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_pageable_device_local_memory === - - template - VULKAN_HPP_INLINE void Device::setMemoryPriorityEXT( VULKAN_HPP_NAMESPACE::DeviceMemory memory, float priority, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkSetDeviceMemoryPriorityEXT( m_device, static_cast( memory ), priority ); - } - - //=== VK_KHR_maintenance4 === - - template - VULKAN_HPP_INLINE void Device::getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceBufferMemoryRequirementsKHR( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetDeviceBufferMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetDeviceBufferMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceImageMemoryRequirementsKHR( - m_device, reinterpret_cast( pInfo ), reinterpret_cast( pMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - d.vkGetDeviceImageMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - d.vkGetDeviceImageMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDeviceImageSparseMemoryRequirementsKHR( m_device, - reinterpret_cast( pInfo ), - pSparseMemoryRequirementCount, - reinterpret_cast( pSparseMemoryRequirements ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - d.vkGetDeviceImageSparseMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetDeviceImageSparseMemoryRequirementsKHR( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector sparseMemoryRequirements( - sparseImageMemoryRequirements2Allocator ); - uint32_t sparseMemoryRequirementCount; - d.vkGetDeviceImageSparseMemoryRequirementsKHR( - m_device, reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - d.vkGetDeviceImageSparseMemoryRequirementsKHR( m_device, - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VALVE_descriptor_set_host_mapping === - - template - VULKAN_HPP_INLINE void Device::getDescriptorSetLayoutHostMappingInfoVALVE( const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE * pBindingReference, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE * pHostMapping, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDescriptorSetLayoutHostMappingInfoVALVE( m_device, - reinterpret_cast( pBindingReference ), - reinterpret_cast( pHostMapping ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE - Device::getDescriptorSetLayoutHostMappingInfoVALVE( const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE & bindingReference, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE hostMapping; - d.vkGetDescriptorSetLayoutHostMappingInfoVALVE( m_device, - reinterpret_cast( &bindingReference ), - reinterpret_cast( &hostMapping ) ); - - return hostMapping; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void - Device::getDescriptorSetHostMappingVALVE( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, void ** ppData, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetDescriptorSetHostMappingVALVE( m_device, static_cast( descriptorSet ), ppData ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE void * Device::getDescriptorSetHostMappingVALVE( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - void * pData; - d.vkGetDescriptorSetHostMappingVALVE( m_device, static_cast( descriptorSet ), &pData ); - - return pData; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_shader_module_identifier === - - template - VULKAN_HPP_INLINE void Device::getShaderModuleIdentifierEXT( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT * pIdentifier, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetShaderModuleIdentifierEXT( m_device, static_cast( shaderModule ), reinterpret_cast( pIdentifier ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - Device::getShaderModuleIdentifierEXT( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT identifier; - d.vkGetShaderModuleIdentifierEXT( m_device, static_cast( shaderModule ), reinterpret_cast( &identifier ) ); - - return identifier; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE void Device::getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT * pIdentifier, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - d.vkGetShaderModuleCreateInfoIdentifierEXT( - m_device, reinterpret_cast( pCreateInfo ), reinterpret_cast( pIdentifier ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - Device::getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT identifier; - d.vkGetShaderModuleCreateInfoIdentifierEXT( - m_device, reinterpret_cast( &createInfo ), reinterpret_cast( &identifier ) ); - - return identifier; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_QCOM_tile_properties === - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE Result Device::getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - uint32_t * pPropertiesCount, - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetFramebufferTilePropertiesQCOM( - m_device, static_cast( framebuffer ), pPropertiesCount, reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties; - uint32_t propertiesCount; - VkResult result; - do - { - result = d.vkGetFramebufferTilePropertiesQCOM( m_device, static_cast( framebuffer ), &propertiesCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertiesCount ) - { - properties.resize( propertiesCount ); - result = d.vkGetFramebufferTilePropertiesQCOM( - m_device, static_cast( framebuffer ), &propertiesCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - - VULKAN_HPP_ASSERT( propertiesCount <= properties.size() ); - if ( propertiesCount < properties.size() ) - { - properties.resize( propertiesCount ); - } - return properties; - } - - template ::value, int>::type> - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE typename ResultValueType>::type - Device::getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - TilePropertiesQCOMAllocator & tilePropertiesQCOMAllocator, - Dispatch const & d ) const - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - std::vector properties( tilePropertiesQCOMAllocator ); - uint32_t propertiesCount; - VkResult result; - do - { - result = d.vkGetFramebufferTilePropertiesQCOM( m_device, static_cast( framebuffer ), &propertiesCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertiesCount ) - { - properties.resize( propertiesCount ); - result = d.vkGetFramebufferTilePropertiesQCOM( - m_device, static_cast( framebuffer ), &propertiesCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - - VULKAN_HPP_ASSERT( propertiesCount <= properties.size() ); - if ( propertiesCount < properties.size() ) - { - properties.resize( propertiesCount ); - } - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_INLINE Result Device::getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM * pProperties, - Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - return static_cast( d.vkGetDynamicRenderingTilePropertiesQCOM( - m_device, reinterpret_cast( pRenderingInfo ), reinterpret_cast( pProperties ) ) ); - } - -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::TilePropertiesQCOM - Device::getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, Dispatch const & d ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( d.getVkHeaderVersion() == VK_HEADER_VERSION ); - - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM properties; - d.vkGetDynamicRenderingTilePropertiesQCOM( - m_device, reinterpret_cast( &renderingInfo ), reinterpret_cast( &properties ) ); - - return properties; - } -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_ggp.h b/src/video/khronos/vulkan/vulkan_ggp.h index 19dfd22617e9a..0a8863a14b147 100644 --- a/src/video/khronos/vulkan/vulkan_ggp.h +++ b/src/video/khronos/vulkan/vulkan_ggp.h @@ -2,7 +2,7 @@ #define VULKAN_GGP_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_GGP_stream_descriptor_surface is a preprocessor guard. Do not pass it to API calls. #define VK_GGP_stream_descriptor_surface 1 #define VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION 1 #define VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME "VK_GGP_stream_descriptor_surface" @@ -41,6 +42,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP( #endif +// VK_GGP_frame_token is a preprocessor guard. Do not pass it to API calls. #define VK_GGP_frame_token 1 #define VK_GGP_FRAME_TOKEN_SPEC_VERSION 1 #define VK_GGP_FRAME_TOKEN_EXTENSION_NAME "VK_GGP_frame_token" diff --git a/src/video/khronos/vulkan/vulkan_handles.hpp b/src/video/khronos/vulkan/vulkan_handles.hpp deleted file mode 100644 index f56db03450a10..0000000000000 --- a/src/video/khronos/vulkan/vulkan_handles.hpp +++ /dev/null @@ -1,13585 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_HANDLES_HPP -#define VULKAN_HANDLES_HPP - -namespace VULKAN_HPP_NAMESPACE -{ - //=================================== - //=== STRUCT forward declarations === - //=================================== - - //=== VK_VERSION_1_0 === - struct Extent2D; - struct Extent3D; - struct Offset2D; - struct Offset3D; - struct Rect2D; - struct BaseInStructure; - struct BaseOutStructure; - struct BufferMemoryBarrier; - struct DispatchIndirectCommand; - struct DrawIndexedIndirectCommand; - struct DrawIndirectCommand; - struct ImageMemoryBarrier; - struct MemoryBarrier; - struct PipelineCacheHeaderVersionOne; - struct AllocationCallbacks; - struct ApplicationInfo; - struct FormatProperties; - struct ImageFormatProperties; - struct InstanceCreateInfo; - struct MemoryHeap; - struct MemoryType; - struct PhysicalDeviceFeatures; - struct PhysicalDeviceLimits; - struct PhysicalDeviceMemoryProperties; - struct PhysicalDeviceProperties; - struct PhysicalDeviceSparseProperties; - struct QueueFamilyProperties; - struct DeviceCreateInfo; - struct DeviceQueueCreateInfo; - struct ExtensionProperties; - struct LayerProperties; - struct SubmitInfo; - struct MappedMemoryRange; - struct MemoryAllocateInfo; - struct MemoryRequirements; - struct BindSparseInfo; - struct ImageSubresource; - struct SparseBufferMemoryBindInfo; - struct SparseImageFormatProperties; - struct SparseImageMemoryBind; - struct SparseImageMemoryBindInfo; - struct SparseImageMemoryRequirements; - struct SparseImageOpaqueMemoryBindInfo; - struct SparseMemoryBind; - struct FenceCreateInfo; - struct SemaphoreCreateInfo; - struct EventCreateInfo; - struct QueryPoolCreateInfo; - struct BufferCreateInfo; - struct BufferViewCreateInfo; - struct ImageCreateInfo; - struct SubresourceLayout; - struct ComponentMapping; - struct ImageSubresourceRange; - struct ImageViewCreateInfo; - struct ShaderModuleCreateInfo; - struct PipelineCacheCreateInfo; - struct ComputePipelineCreateInfo; - struct GraphicsPipelineCreateInfo; - struct PipelineColorBlendAttachmentState; - struct PipelineColorBlendStateCreateInfo; - struct PipelineDepthStencilStateCreateInfo; - struct PipelineDynamicStateCreateInfo; - struct PipelineInputAssemblyStateCreateInfo; - struct PipelineMultisampleStateCreateInfo; - struct PipelineRasterizationStateCreateInfo; - struct PipelineShaderStageCreateInfo; - struct PipelineTessellationStateCreateInfo; - struct PipelineVertexInputStateCreateInfo; - struct PipelineViewportStateCreateInfo; - struct SpecializationInfo; - struct SpecializationMapEntry; - struct StencilOpState; - struct VertexInputAttributeDescription; - struct VertexInputBindingDescription; - struct Viewport; - struct PipelineLayoutCreateInfo; - struct PushConstantRange; - struct SamplerCreateInfo; - struct CopyDescriptorSet; - struct DescriptorBufferInfo; - struct DescriptorImageInfo; - struct DescriptorPoolCreateInfo; - struct DescriptorPoolSize; - struct DescriptorSetAllocateInfo; - struct DescriptorSetLayoutBinding; - struct DescriptorSetLayoutCreateInfo; - struct WriteDescriptorSet; - struct AttachmentDescription; - struct AttachmentReference; - struct FramebufferCreateInfo; - struct RenderPassCreateInfo; - struct SubpassDependency; - struct SubpassDescription; - struct CommandPoolCreateInfo; - struct CommandBufferAllocateInfo; - struct CommandBufferBeginInfo; - struct CommandBufferInheritanceInfo; - struct BufferCopy; - struct BufferImageCopy; - struct ClearAttachment; - union ClearColorValue; - struct ClearDepthStencilValue; - struct ClearRect; - union ClearValue; - struct ImageBlit; - struct ImageCopy; - struct ImageResolve; - struct ImageSubresourceLayers; - struct RenderPassBeginInfo; - - //=== VK_VERSION_1_1 === - struct PhysicalDeviceSubgroupProperties; - struct BindBufferMemoryInfo; - using BindBufferMemoryInfoKHR = BindBufferMemoryInfo; - struct BindImageMemoryInfo; - using BindImageMemoryInfoKHR = BindImageMemoryInfo; - struct PhysicalDevice16BitStorageFeatures; - using PhysicalDevice16BitStorageFeaturesKHR = PhysicalDevice16BitStorageFeatures; - struct MemoryDedicatedRequirements; - using MemoryDedicatedRequirementsKHR = MemoryDedicatedRequirements; - struct MemoryDedicatedAllocateInfo; - using MemoryDedicatedAllocateInfoKHR = MemoryDedicatedAllocateInfo; - struct MemoryAllocateFlagsInfo; - using MemoryAllocateFlagsInfoKHR = MemoryAllocateFlagsInfo; - struct DeviceGroupRenderPassBeginInfo; - using DeviceGroupRenderPassBeginInfoKHR = DeviceGroupRenderPassBeginInfo; - struct DeviceGroupCommandBufferBeginInfo; - using DeviceGroupCommandBufferBeginInfoKHR = DeviceGroupCommandBufferBeginInfo; - struct DeviceGroupSubmitInfo; - using DeviceGroupSubmitInfoKHR = DeviceGroupSubmitInfo; - struct DeviceGroupBindSparseInfo; - using DeviceGroupBindSparseInfoKHR = DeviceGroupBindSparseInfo; - struct BindBufferMemoryDeviceGroupInfo; - using BindBufferMemoryDeviceGroupInfoKHR = BindBufferMemoryDeviceGroupInfo; - struct BindImageMemoryDeviceGroupInfo; - using BindImageMemoryDeviceGroupInfoKHR = BindImageMemoryDeviceGroupInfo; - struct PhysicalDeviceGroupProperties; - using PhysicalDeviceGroupPropertiesKHR = PhysicalDeviceGroupProperties; - struct DeviceGroupDeviceCreateInfo; - using DeviceGroupDeviceCreateInfoKHR = DeviceGroupDeviceCreateInfo; - struct BufferMemoryRequirementsInfo2; - using BufferMemoryRequirementsInfo2KHR = BufferMemoryRequirementsInfo2; - struct ImageMemoryRequirementsInfo2; - using ImageMemoryRequirementsInfo2KHR = ImageMemoryRequirementsInfo2; - struct ImageSparseMemoryRequirementsInfo2; - using ImageSparseMemoryRequirementsInfo2KHR = ImageSparseMemoryRequirementsInfo2; - struct MemoryRequirements2; - using MemoryRequirements2KHR = MemoryRequirements2; - struct SparseImageMemoryRequirements2; - using SparseImageMemoryRequirements2KHR = SparseImageMemoryRequirements2; - struct PhysicalDeviceFeatures2; - using PhysicalDeviceFeatures2KHR = PhysicalDeviceFeatures2; - struct PhysicalDeviceProperties2; - using PhysicalDeviceProperties2KHR = PhysicalDeviceProperties2; - struct FormatProperties2; - using FormatProperties2KHR = FormatProperties2; - struct ImageFormatProperties2; - using ImageFormatProperties2KHR = ImageFormatProperties2; - struct PhysicalDeviceImageFormatInfo2; - using PhysicalDeviceImageFormatInfo2KHR = PhysicalDeviceImageFormatInfo2; - struct QueueFamilyProperties2; - using QueueFamilyProperties2KHR = QueueFamilyProperties2; - struct PhysicalDeviceMemoryProperties2; - using PhysicalDeviceMemoryProperties2KHR = PhysicalDeviceMemoryProperties2; - struct SparseImageFormatProperties2; - using SparseImageFormatProperties2KHR = SparseImageFormatProperties2; - struct PhysicalDeviceSparseImageFormatInfo2; - using PhysicalDeviceSparseImageFormatInfo2KHR = PhysicalDeviceSparseImageFormatInfo2; - struct PhysicalDevicePointClippingProperties; - using PhysicalDevicePointClippingPropertiesKHR = PhysicalDevicePointClippingProperties; - struct RenderPassInputAttachmentAspectCreateInfo; - using RenderPassInputAttachmentAspectCreateInfoKHR = RenderPassInputAttachmentAspectCreateInfo; - struct InputAttachmentAspectReference; - using InputAttachmentAspectReferenceKHR = InputAttachmentAspectReference; - struct ImageViewUsageCreateInfo; - using ImageViewUsageCreateInfoKHR = ImageViewUsageCreateInfo; - struct PipelineTessellationDomainOriginStateCreateInfo; - using PipelineTessellationDomainOriginStateCreateInfoKHR = PipelineTessellationDomainOriginStateCreateInfo; - struct RenderPassMultiviewCreateInfo; - using RenderPassMultiviewCreateInfoKHR = RenderPassMultiviewCreateInfo; - struct PhysicalDeviceMultiviewFeatures; - using PhysicalDeviceMultiviewFeaturesKHR = PhysicalDeviceMultiviewFeatures; - struct PhysicalDeviceMultiviewProperties; - using PhysicalDeviceMultiviewPropertiesKHR = PhysicalDeviceMultiviewProperties; - struct PhysicalDeviceVariablePointersFeatures; - using PhysicalDeviceVariablePointerFeatures = PhysicalDeviceVariablePointersFeatures; - using PhysicalDeviceVariablePointerFeaturesKHR = PhysicalDeviceVariablePointersFeatures; - using PhysicalDeviceVariablePointersFeaturesKHR = PhysicalDeviceVariablePointersFeatures; - struct PhysicalDeviceProtectedMemoryFeatures; - struct PhysicalDeviceProtectedMemoryProperties; - struct DeviceQueueInfo2; - struct ProtectedSubmitInfo; - struct SamplerYcbcrConversionCreateInfo; - using SamplerYcbcrConversionCreateInfoKHR = SamplerYcbcrConversionCreateInfo; - struct SamplerYcbcrConversionInfo; - using SamplerYcbcrConversionInfoKHR = SamplerYcbcrConversionInfo; - struct BindImagePlaneMemoryInfo; - using BindImagePlaneMemoryInfoKHR = BindImagePlaneMemoryInfo; - struct ImagePlaneMemoryRequirementsInfo; - using ImagePlaneMemoryRequirementsInfoKHR = ImagePlaneMemoryRequirementsInfo; - struct PhysicalDeviceSamplerYcbcrConversionFeatures; - using PhysicalDeviceSamplerYcbcrConversionFeaturesKHR = PhysicalDeviceSamplerYcbcrConversionFeatures; - struct SamplerYcbcrConversionImageFormatProperties; - using SamplerYcbcrConversionImageFormatPropertiesKHR = SamplerYcbcrConversionImageFormatProperties; - struct DescriptorUpdateTemplateEntry; - using DescriptorUpdateTemplateEntryKHR = DescriptorUpdateTemplateEntry; - struct DescriptorUpdateTemplateCreateInfo; - using DescriptorUpdateTemplateCreateInfoKHR = DescriptorUpdateTemplateCreateInfo; - struct ExternalMemoryProperties; - using ExternalMemoryPropertiesKHR = ExternalMemoryProperties; - struct PhysicalDeviceExternalImageFormatInfo; - using PhysicalDeviceExternalImageFormatInfoKHR = PhysicalDeviceExternalImageFormatInfo; - struct ExternalImageFormatProperties; - using ExternalImageFormatPropertiesKHR = ExternalImageFormatProperties; - struct PhysicalDeviceExternalBufferInfo; - using PhysicalDeviceExternalBufferInfoKHR = PhysicalDeviceExternalBufferInfo; - struct ExternalBufferProperties; - using ExternalBufferPropertiesKHR = ExternalBufferProperties; - struct PhysicalDeviceIDProperties; - using PhysicalDeviceIDPropertiesKHR = PhysicalDeviceIDProperties; - struct ExternalMemoryImageCreateInfo; - using ExternalMemoryImageCreateInfoKHR = ExternalMemoryImageCreateInfo; - struct ExternalMemoryBufferCreateInfo; - using ExternalMemoryBufferCreateInfoKHR = ExternalMemoryBufferCreateInfo; - struct ExportMemoryAllocateInfo; - using ExportMemoryAllocateInfoKHR = ExportMemoryAllocateInfo; - struct PhysicalDeviceExternalFenceInfo; - using PhysicalDeviceExternalFenceInfoKHR = PhysicalDeviceExternalFenceInfo; - struct ExternalFenceProperties; - using ExternalFencePropertiesKHR = ExternalFenceProperties; - struct ExportFenceCreateInfo; - using ExportFenceCreateInfoKHR = ExportFenceCreateInfo; - struct ExportSemaphoreCreateInfo; - using ExportSemaphoreCreateInfoKHR = ExportSemaphoreCreateInfo; - struct PhysicalDeviceExternalSemaphoreInfo; - using PhysicalDeviceExternalSemaphoreInfoKHR = PhysicalDeviceExternalSemaphoreInfo; - struct ExternalSemaphoreProperties; - using ExternalSemaphorePropertiesKHR = ExternalSemaphoreProperties; - struct PhysicalDeviceMaintenance3Properties; - using PhysicalDeviceMaintenance3PropertiesKHR = PhysicalDeviceMaintenance3Properties; - struct DescriptorSetLayoutSupport; - using DescriptorSetLayoutSupportKHR = DescriptorSetLayoutSupport; - struct PhysicalDeviceShaderDrawParametersFeatures; - using PhysicalDeviceShaderDrawParameterFeatures = PhysicalDeviceShaderDrawParametersFeatures; - - //=== VK_VERSION_1_2 === - struct PhysicalDeviceVulkan11Features; - struct PhysicalDeviceVulkan11Properties; - struct PhysicalDeviceVulkan12Features; - struct PhysicalDeviceVulkan12Properties; - struct ImageFormatListCreateInfo; - using ImageFormatListCreateInfoKHR = ImageFormatListCreateInfo; - struct RenderPassCreateInfo2; - using RenderPassCreateInfo2KHR = RenderPassCreateInfo2; - struct AttachmentDescription2; - using AttachmentDescription2KHR = AttachmentDescription2; - struct AttachmentReference2; - using AttachmentReference2KHR = AttachmentReference2; - struct SubpassDescription2; - using SubpassDescription2KHR = SubpassDescription2; - struct SubpassDependency2; - using SubpassDependency2KHR = SubpassDependency2; - struct SubpassBeginInfo; - using SubpassBeginInfoKHR = SubpassBeginInfo; - struct SubpassEndInfo; - using SubpassEndInfoKHR = SubpassEndInfo; - struct PhysicalDevice8BitStorageFeatures; - using PhysicalDevice8BitStorageFeaturesKHR = PhysicalDevice8BitStorageFeatures; - struct ConformanceVersion; - using ConformanceVersionKHR = ConformanceVersion; - struct PhysicalDeviceDriverProperties; - using PhysicalDeviceDriverPropertiesKHR = PhysicalDeviceDriverProperties; - struct PhysicalDeviceShaderAtomicInt64Features; - using PhysicalDeviceShaderAtomicInt64FeaturesKHR = PhysicalDeviceShaderAtomicInt64Features; - struct PhysicalDeviceShaderFloat16Int8Features; - using PhysicalDeviceFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; - using PhysicalDeviceShaderFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; - struct PhysicalDeviceFloatControlsProperties; - using PhysicalDeviceFloatControlsPropertiesKHR = PhysicalDeviceFloatControlsProperties; - struct DescriptorSetLayoutBindingFlagsCreateInfo; - using DescriptorSetLayoutBindingFlagsCreateInfoEXT = DescriptorSetLayoutBindingFlagsCreateInfo; - struct PhysicalDeviceDescriptorIndexingFeatures; - using PhysicalDeviceDescriptorIndexingFeaturesEXT = PhysicalDeviceDescriptorIndexingFeatures; - struct PhysicalDeviceDescriptorIndexingProperties; - using PhysicalDeviceDescriptorIndexingPropertiesEXT = PhysicalDeviceDescriptorIndexingProperties; - struct DescriptorSetVariableDescriptorCountAllocateInfo; - using DescriptorSetVariableDescriptorCountAllocateInfoEXT = DescriptorSetVariableDescriptorCountAllocateInfo; - struct DescriptorSetVariableDescriptorCountLayoutSupport; - using DescriptorSetVariableDescriptorCountLayoutSupportEXT = DescriptorSetVariableDescriptorCountLayoutSupport; - struct SubpassDescriptionDepthStencilResolve; - using SubpassDescriptionDepthStencilResolveKHR = SubpassDescriptionDepthStencilResolve; - struct PhysicalDeviceDepthStencilResolveProperties; - using PhysicalDeviceDepthStencilResolvePropertiesKHR = PhysicalDeviceDepthStencilResolveProperties; - struct PhysicalDeviceScalarBlockLayoutFeatures; - using PhysicalDeviceScalarBlockLayoutFeaturesEXT = PhysicalDeviceScalarBlockLayoutFeatures; - struct ImageStencilUsageCreateInfo; - using ImageStencilUsageCreateInfoEXT = ImageStencilUsageCreateInfo; - struct SamplerReductionModeCreateInfo; - using SamplerReductionModeCreateInfoEXT = SamplerReductionModeCreateInfo; - struct PhysicalDeviceSamplerFilterMinmaxProperties; - using PhysicalDeviceSamplerFilterMinmaxPropertiesEXT = PhysicalDeviceSamplerFilterMinmaxProperties; - struct PhysicalDeviceVulkanMemoryModelFeatures; - using PhysicalDeviceVulkanMemoryModelFeaturesKHR = PhysicalDeviceVulkanMemoryModelFeatures; - struct PhysicalDeviceImagelessFramebufferFeatures; - using PhysicalDeviceImagelessFramebufferFeaturesKHR = PhysicalDeviceImagelessFramebufferFeatures; - struct FramebufferAttachmentsCreateInfo; - using FramebufferAttachmentsCreateInfoKHR = FramebufferAttachmentsCreateInfo; - struct FramebufferAttachmentImageInfo; - using FramebufferAttachmentImageInfoKHR = FramebufferAttachmentImageInfo; - struct RenderPassAttachmentBeginInfo; - using RenderPassAttachmentBeginInfoKHR = RenderPassAttachmentBeginInfo; - struct PhysicalDeviceUniformBufferStandardLayoutFeatures; - using PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR = PhysicalDeviceUniformBufferStandardLayoutFeatures; - struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures; - using PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR = PhysicalDeviceShaderSubgroupExtendedTypesFeatures; - struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures; - using PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR = PhysicalDeviceSeparateDepthStencilLayoutsFeatures; - struct AttachmentReferenceStencilLayout; - using AttachmentReferenceStencilLayoutKHR = AttachmentReferenceStencilLayout; - struct AttachmentDescriptionStencilLayout; - using AttachmentDescriptionStencilLayoutKHR = AttachmentDescriptionStencilLayout; - struct PhysicalDeviceHostQueryResetFeatures; - using PhysicalDeviceHostQueryResetFeaturesEXT = PhysicalDeviceHostQueryResetFeatures; - struct PhysicalDeviceTimelineSemaphoreFeatures; - using PhysicalDeviceTimelineSemaphoreFeaturesKHR = PhysicalDeviceTimelineSemaphoreFeatures; - struct PhysicalDeviceTimelineSemaphoreProperties; - using PhysicalDeviceTimelineSemaphorePropertiesKHR = PhysicalDeviceTimelineSemaphoreProperties; - struct SemaphoreTypeCreateInfo; - using SemaphoreTypeCreateInfoKHR = SemaphoreTypeCreateInfo; - struct TimelineSemaphoreSubmitInfo; - using TimelineSemaphoreSubmitInfoKHR = TimelineSemaphoreSubmitInfo; - struct SemaphoreWaitInfo; - using SemaphoreWaitInfoKHR = SemaphoreWaitInfo; - struct SemaphoreSignalInfo; - using SemaphoreSignalInfoKHR = SemaphoreSignalInfo; - struct PhysicalDeviceBufferDeviceAddressFeatures; - using PhysicalDeviceBufferDeviceAddressFeaturesKHR = PhysicalDeviceBufferDeviceAddressFeatures; - struct BufferDeviceAddressInfo; - using BufferDeviceAddressInfoEXT = BufferDeviceAddressInfo; - using BufferDeviceAddressInfoKHR = BufferDeviceAddressInfo; - struct BufferOpaqueCaptureAddressCreateInfo; - using BufferOpaqueCaptureAddressCreateInfoKHR = BufferOpaqueCaptureAddressCreateInfo; - struct MemoryOpaqueCaptureAddressAllocateInfo; - using MemoryOpaqueCaptureAddressAllocateInfoKHR = MemoryOpaqueCaptureAddressAllocateInfo; - struct DeviceMemoryOpaqueCaptureAddressInfo; - using DeviceMemoryOpaqueCaptureAddressInfoKHR = DeviceMemoryOpaqueCaptureAddressInfo; - - //=== VK_VERSION_1_3 === - struct PhysicalDeviceVulkan13Features; - struct PhysicalDeviceVulkan13Properties; - struct PipelineCreationFeedbackCreateInfo; - using PipelineCreationFeedbackCreateInfoEXT = PipelineCreationFeedbackCreateInfo; - struct PipelineCreationFeedback; - using PipelineCreationFeedbackEXT = PipelineCreationFeedback; - struct PhysicalDeviceShaderTerminateInvocationFeatures; - using PhysicalDeviceShaderTerminateInvocationFeaturesKHR = PhysicalDeviceShaderTerminateInvocationFeatures; - struct PhysicalDeviceToolProperties; - using PhysicalDeviceToolPropertiesEXT = PhysicalDeviceToolProperties; - struct PhysicalDeviceShaderDemoteToHelperInvocationFeatures; - using PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT = PhysicalDeviceShaderDemoteToHelperInvocationFeatures; - struct PhysicalDevicePrivateDataFeatures; - using PhysicalDevicePrivateDataFeaturesEXT = PhysicalDevicePrivateDataFeatures; - struct DevicePrivateDataCreateInfo; - using DevicePrivateDataCreateInfoEXT = DevicePrivateDataCreateInfo; - struct PrivateDataSlotCreateInfo; - using PrivateDataSlotCreateInfoEXT = PrivateDataSlotCreateInfo; - struct PhysicalDevicePipelineCreationCacheControlFeatures; - using PhysicalDevicePipelineCreationCacheControlFeaturesEXT = PhysicalDevicePipelineCreationCacheControlFeatures; - struct MemoryBarrier2; - using MemoryBarrier2KHR = MemoryBarrier2; - struct BufferMemoryBarrier2; - using BufferMemoryBarrier2KHR = BufferMemoryBarrier2; - struct ImageMemoryBarrier2; - using ImageMemoryBarrier2KHR = ImageMemoryBarrier2; - struct DependencyInfo; - using DependencyInfoKHR = DependencyInfo; - struct SubmitInfo2; - using SubmitInfo2KHR = SubmitInfo2; - struct SemaphoreSubmitInfo; - using SemaphoreSubmitInfoKHR = SemaphoreSubmitInfo; - struct CommandBufferSubmitInfo; - using CommandBufferSubmitInfoKHR = CommandBufferSubmitInfo; - struct PhysicalDeviceSynchronization2Features; - using PhysicalDeviceSynchronization2FeaturesKHR = PhysicalDeviceSynchronization2Features; - struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - using PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR = PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - struct PhysicalDeviceImageRobustnessFeatures; - using PhysicalDeviceImageRobustnessFeaturesEXT = PhysicalDeviceImageRobustnessFeatures; - struct CopyBufferInfo2; - using CopyBufferInfo2KHR = CopyBufferInfo2; - struct CopyImageInfo2; - using CopyImageInfo2KHR = CopyImageInfo2; - struct CopyBufferToImageInfo2; - using CopyBufferToImageInfo2KHR = CopyBufferToImageInfo2; - struct CopyImageToBufferInfo2; - using CopyImageToBufferInfo2KHR = CopyImageToBufferInfo2; - struct BlitImageInfo2; - using BlitImageInfo2KHR = BlitImageInfo2; - struct ResolveImageInfo2; - using ResolveImageInfo2KHR = ResolveImageInfo2; - struct BufferCopy2; - using BufferCopy2KHR = BufferCopy2; - struct ImageCopy2; - using ImageCopy2KHR = ImageCopy2; - struct ImageBlit2; - using ImageBlit2KHR = ImageBlit2; - struct BufferImageCopy2; - using BufferImageCopy2KHR = BufferImageCopy2; - struct ImageResolve2; - using ImageResolve2KHR = ImageResolve2; - struct PhysicalDeviceSubgroupSizeControlFeatures; - using PhysicalDeviceSubgroupSizeControlFeaturesEXT = PhysicalDeviceSubgroupSizeControlFeatures; - struct PhysicalDeviceSubgroupSizeControlProperties; - using PhysicalDeviceSubgroupSizeControlPropertiesEXT = PhysicalDeviceSubgroupSizeControlProperties; - struct PipelineShaderStageRequiredSubgroupSizeCreateInfo; - using PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT = PipelineShaderStageRequiredSubgroupSizeCreateInfo; - struct PhysicalDeviceInlineUniformBlockFeatures; - using PhysicalDeviceInlineUniformBlockFeaturesEXT = PhysicalDeviceInlineUniformBlockFeatures; - struct PhysicalDeviceInlineUniformBlockProperties; - using PhysicalDeviceInlineUniformBlockPropertiesEXT = PhysicalDeviceInlineUniformBlockProperties; - struct WriteDescriptorSetInlineUniformBlock; - using WriteDescriptorSetInlineUniformBlockEXT = WriteDescriptorSetInlineUniformBlock; - struct DescriptorPoolInlineUniformBlockCreateInfo; - using DescriptorPoolInlineUniformBlockCreateInfoEXT = DescriptorPoolInlineUniformBlockCreateInfo; - struct PhysicalDeviceTextureCompressionASTCHDRFeatures; - using PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT = PhysicalDeviceTextureCompressionASTCHDRFeatures; - struct RenderingInfo; - using RenderingInfoKHR = RenderingInfo; - struct RenderingAttachmentInfo; - using RenderingAttachmentInfoKHR = RenderingAttachmentInfo; - struct PipelineRenderingCreateInfo; - using PipelineRenderingCreateInfoKHR = PipelineRenderingCreateInfo; - struct PhysicalDeviceDynamicRenderingFeatures; - using PhysicalDeviceDynamicRenderingFeaturesKHR = PhysicalDeviceDynamicRenderingFeatures; - struct CommandBufferInheritanceRenderingInfo; - using CommandBufferInheritanceRenderingInfoKHR = CommandBufferInheritanceRenderingInfo; - struct PhysicalDeviceShaderIntegerDotProductFeatures; - using PhysicalDeviceShaderIntegerDotProductFeaturesKHR = PhysicalDeviceShaderIntegerDotProductFeatures; - struct PhysicalDeviceShaderIntegerDotProductProperties; - using PhysicalDeviceShaderIntegerDotProductPropertiesKHR = PhysicalDeviceShaderIntegerDotProductProperties; - struct PhysicalDeviceTexelBufferAlignmentProperties; - using PhysicalDeviceTexelBufferAlignmentPropertiesEXT = PhysicalDeviceTexelBufferAlignmentProperties; - struct FormatProperties3; - using FormatProperties3KHR = FormatProperties3; - struct PhysicalDeviceMaintenance4Features; - using PhysicalDeviceMaintenance4FeaturesKHR = PhysicalDeviceMaintenance4Features; - struct PhysicalDeviceMaintenance4Properties; - using PhysicalDeviceMaintenance4PropertiesKHR = PhysicalDeviceMaintenance4Properties; - struct DeviceBufferMemoryRequirements; - using DeviceBufferMemoryRequirementsKHR = DeviceBufferMemoryRequirements; - struct DeviceImageMemoryRequirements; - using DeviceImageMemoryRequirementsKHR = DeviceImageMemoryRequirements; - - //=== VK_KHR_surface === - struct SurfaceCapabilitiesKHR; - struct SurfaceFormatKHR; - - //=== VK_KHR_swapchain === - struct SwapchainCreateInfoKHR; - struct PresentInfoKHR; - struct ImageSwapchainCreateInfoKHR; - struct BindImageMemorySwapchainInfoKHR; - struct AcquireNextImageInfoKHR; - struct DeviceGroupPresentCapabilitiesKHR; - struct DeviceGroupPresentInfoKHR; - struct DeviceGroupSwapchainCreateInfoKHR; - - //=== VK_KHR_display === - struct DisplayModeCreateInfoKHR; - struct DisplayModeParametersKHR; - struct DisplayModePropertiesKHR; - struct DisplayPlaneCapabilitiesKHR; - struct DisplayPlanePropertiesKHR; - struct DisplayPropertiesKHR; - struct DisplaySurfaceCreateInfoKHR; - - //=== VK_KHR_display_swapchain === - struct DisplayPresentInfoKHR; - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - struct XlibSurfaceCreateInfoKHR; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - struct XcbSurfaceCreateInfoKHR; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - struct WaylandSurfaceCreateInfoKHR; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - struct AndroidSurfaceCreateInfoKHR; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - struct Win32SurfaceCreateInfoKHR; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - struct DebugReportCallbackCreateInfoEXT; - - //=== VK_AMD_rasterization_order === - struct PipelineRasterizationStateRasterizationOrderAMD; - - //=== VK_EXT_debug_marker === - struct DebugMarkerObjectNameInfoEXT; - struct DebugMarkerObjectTagInfoEXT; - struct DebugMarkerMarkerInfoEXT; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - struct QueueFamilyQueryResultStatusPropertiesKHR; - struct QueueFamilyVideoPropertiesKHR; - struct VideoProfileInfoKHR; - struct VideoProfileListInfoKHR; - struct VideoCapabilitiesKHR; - struct PhysicalDeviceVideoFormatInfoKHR; - struct VideoFormatPropertiesKHR; - struct VideoPictureResourceInfoKHR; - struct VideoReferenceSlotInfoKHR; - struct VideoSessionMemoryRequirementsKHR; - struct BindVideoSessionMemoryInfoKHR; - struct VideoSessionCreateInfoKHR; - struct VideoSessionParametersCreateInfoKHR; - struct VideoSessionParametersUpdateInfoKHR; - struct VideoBeginCodingInfoKHR; - struct VideoEndCodingInfoKHR; - struct VideoCodingControlInfoKHR; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - struct VideoDecodeCapabilitiesKHR; - struct VideoDecodeUsageInfoKHR; - struct VideoDecodeInfoKHR; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_dedicated_allocation === - struct DedicatedAllocationImageCreateInfoNV; - struct DedicatedAllocationBufferCreateInfoNV; - struct DedicatedAllocationMemoryAllocateInfoNV; - - //=== VK_EXT_transform_feedback === - struct PhysicalDeviceTransformFeedbackFeaturesEXT; - struct PhysicalDeviceTransformFeedbackPropertiesEXT; - struct PipelineRasterizationStateStreamCreateInfoEXT; - - //=== VK_NVX_binary_import === - struct CuModuleCreateInfoNVX; - struct CuFunctionCreateInfoNVX; - struct CuLaunchInfoNVX; - - //=== VK_NVX_image_view_handle === - struct ImageViewHandleInfoNVX; - struct ImageViewAddressPropertiesNVX; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - struct VideoEncodeH264CapabilitiesEXT; - struct VideoEncodeH264SessionParametersCreateInfoEXT; - struct VideoEncodeH264SessionParametersAddInfoEXT; - struct VideoEncodeH264VclFrameInfoEXT; - struct VideoEncodeH264ReferenceListsInfoEXT; - struct VideoEncodeH264EmitPictureParametersInfoEXT; - struct VideoEncodeH264DpbSlotInfoEXT; - struct VideoEncodeH264NaluSliceInfoEXT; - struct VideoEncodeH264ProfileInfoEXT; - struct VideoEncodeH264RateControlInfoEXT; - struct VideoEncodeH264RateControlLayerInfoEXT; - struct VideoEncodeH264QpEXT; - struct VideoEncodeH264FrameSizeEXT; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - struct VideoEncodeH265CapabilitiesEXT; - struct VideoEncodeH265SessionParametersCreateInfoEXT; - struct VideoEncodeH265SessionParametersAddInfoEXT; - struct VideoEncodeH265VclFrameInfoEXT; - struct VideoEncodeH265EmitPictureParametersInfoEXT; - struct VideoEncodeH265DpbSlotInfoEXT; - struct VideoEncodeH265NaluSliceSegmentInfoEXT; - struct VideoEncodeH265ProfileInfoEXT; - struct VideoEncodeH265ReferenceListsInfoEXT; - struct VideoEncodeH265RateControlInfoEXT; - struct VideoEncodeH265RateControlLayerInfoEXT; - struct VideoEncodeH265QpEXT; - struct VideoEncodeH265FrameSizeEXT; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - struct VideoDecodeH264ProfileInfoEXT; - struct VideoDecodeH264CapabilitiesEXT; - struct VideoDecodeH264SessionParametersCreateInfoEXT; - struct VideoDecodeH264SessionParametersAddInfoEXT; - struct VideoDecodeH264PictureInfoEXT; - struct VideoDecodeH264MvcInfoEXT; - struct VideoDecodeH264DpbSlotInfoEXT; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_AMD_texture_gather_bias_lod === - struct TextureLODGatherFormatPropertiesAMD; - - //=== VK_AMD_shader_info === - struct ShaderResourceUsageAMD; - struct ShaderStatisticsInfoAMD; - - //=== VK_KHR_dynamic_rendering === - struct RenderingFragmentShadingRateAttachmentInfoKHR; - struct RenderingFragmentDensityMapAttachmentInfoEXT; - struct AttachmentSampleCountInfoAMD; - using AttachmentSampleCountInfoNV = AttachmentSampleCountInfoAMD; - struct MultiviewPerViewAttributesInfoNVX; - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - struct StreamDescriptorSurfaceCreateInfoGGP; -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_corner_sampled_image === - struct PhysicalDeviceCornerSampledImageFeaturesNV; - - //=== VK_NV_external_memory_capabilities === - struct ExternalImageFormatPropertiesNV; - - //=== VK_NV_external_memory === - struct ExternalMemoryImageCreateInfoNV; - struct ExportMemoryAllocateInfoNV; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - struct ImportMemoryWin32HandleInfoNV; - struct ExportMemoryWin32HandleInfoNV; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_win32_keyed_mutex === - struct Win32KeyedMutexAcquireReleaseInfoNV; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_validation_flags === - struct ValidationFlagsEXT; - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - struct ViSurfaceCreateInfoNN; -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_EXT_astc_decode_mode === - struct ImageViewASTCDecodeModeEXT; - struct PhysicalDeviceASTCDecodeFeaturesEXT; - - //=== VK_EXT_pipeline_robustness === - struct PhysicalDevicePipelineRobustnessFeaturesEXT; - struct PhysicalDevicePipelineRobustnessPropertiesEXT; - struct PipelineRobustnessCreateInfoEXT; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - struct ImportMemoryWin32HandleInfoKHR; - struct ExportMemoryWin32HandleInfoKHR; - struct MemoryWin32HandlePropertiesKHR; - struct MemoryGetWin32HandleInfoKHR; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - struct ImportMemoryFdInfoKHR; - struct MemoryFdPropertiesKHR; - struct MemoryGetFdInfoKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_keyed_mutex === - struct Win32KeyedMutexAcquireReleaseInfoKHR; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - struct ImportSemaphoreWin32HandleInfoKHR; - struct ExportSemaphoreWin32HandleInfoKHR; - struct D3D12FenceSubmitInfoKHR; - struct SemaphoreGetWin32HandleInfoKHR; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - struct ImportSemaphoreFdInfoKHR; - struct SemaphoreGetFdInfoKHR; - - //=== VK_KHR_push_descriptor === - struct PhysicalDevicePushDescriptorPropertiesKHR; - - //=== VK_EXT_conditional_rendering === - struct ConditionalRenderingBeginInfoEXT; - struct PhysicalDeviceConditionalRenderingFeaturesEXT; - struct CommandBufferInheritanceConditionalRenderingInfoEXT; - - //=== VK_KHR_incremental_present === - struct PresentRegionsKHR; - struct PresentRegionKHR; - struct RectLayerKHR; - - //=== VK_NV_clip_space_w_scaling === - struct ViewportWScalingNV; - struct PipelineViewportWScalingStateCreateInfoNV; - - //=== VK_EXT_display_surface_counter === - struct SurfaceCapabilities2EXT; - - //=== VK_EXT_display_control === - struct DisplayPowerInfoEXT; - struct DeviceEventInfoEXT; - struct DisplayEventInfoEXT; - struct SwapchainCounterCreateInfoEXT; - - //=== VK_GOOGLE_display_timing === - struct RefreshCycleDurationGOOGLE; - struct PastPresentationTimingGOOGLE; - struct PresentTimesInfoGOOGLE; - struct PresentTimeGOOGLE; - - //=== VK_NVX_multiview_per_view_attributes === - struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - - //=== VK_NV_viewport_swizzle === - struct ViewportSwizzleNV; - struct PipelineViewportSwizzleStateCreateInfoNV; - - //=== VK_EXT_discard_rectangles === - struct PhysicalDeviceDiscardRectanglePropertiesEXT; - struct PipelineDiscardRectangleStateCreateInfoEXT; - - //=== VK_EXT_conservative_rasterization === - struct PhysicalDeviceConservativeRasterizationPropertiesEXT; - struct PipelineRasterizationConservativeStateCreateInfoEXT; - - //=== VK_EXT_depth_clip_enable === - struct PhysicalDeviceDepthClipEnableFeaturesEXT; - struct PipelineRasterizationDepthClipStateCreateInfoEXT; - - //=== VK_EXT_hdr_metadata === - struct HdrMetadataEXT; - struct XYColorEXT; - - //=== VK_KHR_shared_presentable_image === - struct SharedPresentSurfaceCapabilitiesKHR; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - struct ImportFenceWin32HandleInfoKHR; - struct ExportFenceWin32HandleInfoKHR; - struct FenceGetWin32HandleInfoKHR; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - struct ImportFenceFdInfoKHR; - struct FenceGetFdInfoKHR; - - //=== VK_KHR_performance_query === - struct PhysicalDevicePerformanceQueryFeaturesKHR; - struct PhysicalDevicePerformanceQueryPropertiesKHR; - struct PerformanceCounterKHR; - struct PerformanceCounterDescriptionKHR; - struct QueryPoolPerformanceCreateInfoKHR; - union PerformanceCounterResultKHR; - struct AcquireProfilingLockInfoKHR; - struct PerformanceQuerySubmitInfoKHR; - - //=== VK_KHR_get_surface_capabilities2 === - struct PhysicalDeviceSurfaceInfo2KHR; - struct SurfaceCapabilities2KHR; - struct SurfaceFormat2KHR; - - //=== VK_KHR_get_display_properties2 === - struct DisplayProperties2KHR; - struct DisplayPlaneProperties2KHR; - struct DisplayModeProperties2KHR; - struct DisplayPlaneInfo2KHR; - struct DisplayPlaneCapabilities2KHR; - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - struct IOSSurfaceCreateInfoMVK; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - struct MacOSSurfaceCreateInfoMVK; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - struct DebugUtilsLabelEXT; - struct DebugUtilsMessengerCallbackDataEXT; - struct DebugUtilsMessengerCreateInfoEXT; - struct DebugUtilsObjectNameInfoEXT; - struct DebugUtilsObjectTagInfoEXT; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - struct AndroidHardwareBufferUsageANDROID; - struct AndroidHardwareBufferPropertiesANDROID; - struct AndroidHardwareBufferFormatPropertiesANDROID; - struct ImportAndroidHardwareBufferInfoANDROID; - struct MemoryGetAndroidHardwareBufferInfoANDROID; - struct ExternalFormatANDROID; - struct AndroidHardwareBufferFormatProperties2ANDROID; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - struct SampleLocationEXT; - struct SampleLocationsInfoEXT; - struct AttachmentSampleLocationsEXT; - struct SubpassSampleLocationsEXT; - struct RenderPassSampleLocationsBeginInfoEXT; - struct PipelineSampleLocationsStateCreateInfoEXT; - struct PhysicalDeviceSampleLocationsPropertiesEXT; - struct MultisamplePropertiesEXT; - - //=== VK_EXT_blend_operation_advanced === - struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT; - struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT; - struct PipelineColorBlendAdvancedStateCreateInfoEXT; - - //=== VK_NV_fragment_coverage_to_color === - struct PipelineCoverageToColorStateCreateInfoNV; - - //=== VK_KHR_acceleration_structure === - union DeviceOrHostAddressKHR; - union DeviceOrHostAddressConstKHR; - struct AccelerationStructureBuildRangeInfoKHR; - struct AabbPositionsKHR; - using AabbPositionsNV = AabbPositionsKHR; - struct AccelerationStructureGeometryTrianglesDataKHR; - struct TransformMatrixKHR; - using TransformMatrixNV = TransformMatrixKHR; - struct AccelerationStructureBuildGeometryInfoKHR; - struct AccelerationStructureGeometryAabbsDataKHR; - struct AccelerationStructureInstanceKHR; - using AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR; - struct AccelerationStructureGeometryInstancesDataKHR; - union AccelerationStructureGeometryDataKHR; - struct AccelerationStructureGeometryKHR; - struct AccelerationStructureCreateInfoKHR; - struct WriteDescriptorSetAccelerationStructureKHR; - struct PhysicalDeviceAccelerationStructureFeaturesKHR; - struct PhysicalDeviceAccelerationStructurePropertiesKHR; - struct AccelerationStructureDeviceAddressInfoKHR; - struct AccelerationStructureVersionInfoKHR; - struct CopyAccelerationStructureToMemoryInfoKHR; - struct CopyMemoryToAccelerationStructureInfoKHR; - struct CopyAccelerationStructureInfoKHR; - struct AccelerationStructureBuildSizesInfoKHR; - - //=== VK_NV_framebuffer_mixed_samples === - struct PipelineCoverageModulationStateCreateInfoNV; - - //=== VK_NV_shader_sm_builtins === - struct PhysicalDeviceShaderSMBuiltinsPropertiesNV; - struct PhysicalDeviceShaderSMBuiltinsFeaturesNV; - - //=== VK_EXT_image_drm_format_modifier === - struct DrmFormatModifierPropertiesListEXT; - struct DrmFormatModifierPropertiesEXT; - struct PhysicalDeviceImageDrmFormatModifierInfoEXT; - struct ImageDrmFormatModifierListCreateInfoEXT; - struct ImageDrmFormatModifierExplicitCreateInfoEXT; - struct ImageDrmFormatModifierPropertiesEXT; - struct DrmFormatModifierPropertiesList2EXT; - struct DrmFormatModifierProperties2EXT; - - //=== VK_EXT_validation_cache === - struct ValidationCacheCreateInfoEXT; - struct ShaderModuleValidationCacheCreateInfoEXT; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_portability_subset === - struct PhysicalDevicePortabilitySubsetFeaturesKHR; - struct PhysicalDevicePortabilitySubsetPropertiesKHR; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_shading_rate_image === - struct ShadingRatePaletteNV; - struct PipelineViewportShadingRateImageStateCreateInfoNV; - struct PhysicalDeviceShadingRateImageFeaturesNV; - struct PhysicalDeviceShadingRateImagePropertiesNV; - struct CoarseSampleLocationNV; - struct CoarseSampleOrderCustomNV; - struct PipelineViewportCoarseSampleOrderStateCreateInfoNV; - - //=== VK_NV_ray_tracing === - struct RayTracingShaderGroupCreateInfoNV; - struct RayTracingPipelineCreateInfoNV; - struct GeometryTrianglesNV; - struct GeometryAABBNV; - struct GeometryDataNV; - struct GeometryNV; - struct AccelerationStructureInfoNV; - struct AccelerationStructureCreateInfoNV; - struct BindAccelerationStructureMemoryInfoNV; - struct WriteDescriptorSetAccelerationStructureNV; - struct AccelerationStructureMemoryRequirementsInfoNV; - struct PhysicalDeviceRayTracingPropertiesNV; - - //=== VK_NV_representative_fragment_test === - struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV; - struct PipelineRepresentativeFragmentTestStateCreateInfoNV; - - //=== VK_EXT_filter_cubic === - struct PhysicalDeviceImageViewImageFormatInfoEXT; - struct FilterCubicImageViewImageFormatPropertiesEXT; - - //=== VK_EXT_external_memory_host === - struct ImportMemoryHostPointerInfoEXT; - struct MemoryHostPointerPropertiesEXT; - struct PhysicalDeviceExternalMemoryHostPropertiesEXT; - - //=== VK_KHR_shader_clock === - struct PhysicalDeviceShaderClockFeaturesKHR; - - //=== VK_AMD_pipeline_compiler_control === - struct PipelineCompilerControlCreateInfoAMD; - - //=== VK_EXT_calibrated_timestamps === - struct CalibratedTimestampInfoEXT; - - //=== VK_AMD_shader_core_properties === - struct PhysicalDeviceShaderCorePropertiesAMD; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h265 === - struct VideoDecodeH265ProfileInfoEXT; - struct VideoDecodeH265CapabilitiesEXT; - struct VideoDecodeH265SessionParametersCreateInfoEXT; - struct VideoDecodeH265SessionParametersAddInfoEXT; - struct VideoDecodeH265PictureInfoEXT; - struct VideoDecodeH265DpbSlotInfoEXT; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_KHR_global_priority === - struct DeviceQueueGlobalPriorityCreateInfoKHR; - using DeviceQueueGlobalPriorityCreateInfoEXT = DeviceQueueGlobalPriorityCreateInfoKHR; - struct PhysicalDeviceGlobalPriorityQueryFeaturesKHR; - using PhysicalDeviceGlobalPriorityQueryFeaturesEXT = PhysicalDeviceGlobalPriorityQueryFeaturesKHR; - struct QueueFamilyGlobalPriorityPropertiesKHR; - using QueueFamilyGlobalPriorityPropertiesEXT = QueueFamilyGlobalPriorityPropertiesKHR; - - //=== VK_AMD_memory_overallocation_behavior === - struct DeviceMemoryOverallocationCreateInfoAMD; - - //=== VK_EXT_vertex_attribute_divisor === - struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT; - struct VertexInputBindingDivisorDescriptionEXT; - struct PipelineVertexInputDivisorStateCreateInfoEXT; - struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT; - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_frame_token === - struct PresentFrameTokenGGP; -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_compute_shader_derivatives === - struct PhysicalDeviceComputeShaderDerivativesFeaturesNV; - - //=== VK_NV_mesh_shader === - struct PhysicalDeviceMeshShaderFeaturesNV; - struct PhysicalDeviceMeshShaderPropertiesNV; - struct DrawMeshTasksIndirectCommandNV; - - //=== VK_NV_shader_image_footprint === - struct PhysicalDeviceShaderImageFootprintFeaturesNV; - - //=== VK_NV_scissor_exclusive === - struct PipelineViewportExclusiveScissorStateCreateInfoNV; - struct PhysicalDeviceExclusiveScissorFeaturesNV; - - //=== VK_NV_device_diagnostic_checkpoints === - struct QueueFamilyCheckpointPropertiesNV; - struct CheckpointDataNV; - - //=== VK_INTEL_shader_integer_functions2 === - struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - - //=== VK_INTEL_performance_query === - union PerformanceValueDataINTEL; - struct PerformanceValueINTEL; - struct InitializePerformanceApiInfoINTEL; - struct QueryPoolPerformanceQueryCreateInfoINTEL; - using QueryPoolCreateInfoINTEL = QueryPoolPerformanceQueryCreateInfoINTEL; - struct PerformanceMarkerInfoINTEL; - struct PerformanceStreamMarkerInfoINTEL; - struct PerformanceOverrideInfoINTEL; - struct PerformanceConfigurationAcquireInfoINTEL; - - //=== VK_EXT_pci_bus_info === - struct PhysicalDevicePCIBusInfoPropertiesEXT; - - //=== VK_AMD_display_native_hdr === - struct DisplayNativeHdrSurfaceCapabilitiesAMD; - struct SwapchainDisplayNativeHdrCreateInfoAMD; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - struct ImagePipeSurfaceCreateInfoFUCHSIA; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - struct MetalSurfaceCreateInfoEXT; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_fragment_density_map === - struct PhysicalDeviceFragmentDensityMapFeaturesEXT; - struct PhysicalDeviceFragmentDensityMapPropertiesEXT; - struct RenderPassFragmentDensityMapCreateInfoEXT; - - //=== VK_KHR_fragment_shading_rate === - struct FragmentShadingRateAttachmentInfoKHR; - struct PipelineFragmentShadingRateStateCreateInfoKHR; - struct PhysicalDeviceFragmentShadingRateFeaturesKHR; - struct PhysicalDeviceFragmentShadingRatePropertiesKHR; - struct PhysicalDeviceFragmentShadingRateKHR; - - //=== VK_AMD_shader_core_properties2 === - struct PhysicalDeviceShaderCoreProperties2AMD; - - //=== VK_AMD_device_coherent_memory === - struct PhysicalDeviceCoherentMemoryFeaturesAMD; - - //=== VK_EXT_shader_image_atomic_int64 === - struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - - //=== VK_EXT_memory_budget === - struct PhysicalDeviceMemoryBudgetPropertiesEXT; - - //=== VK_EXT_memory_priority === - struct PhysicalDeviceMemoryPriorityFeaturesEXT; - struct MemoryPriorityAllocateInfoEXT; - - //=== VK_KHR_surface_protected_capabilities === - struct SurfaceProtectedCapabilitiesKHR; - - //=== VK_NV_dedicated_allocation_image_aliasing === - struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - - //=== VK_EXT_buffer_device_address === - struct PhysicalDeviceBufferDeviceAddressFeaturesEXT; - using PhysicalDeviceBufferAddressFeaturesEXT = PhysicalDeviceBufferDeviceAddressFeaturesEXT; - struct BufferDeviceAddressCreateInfoEXT; - - //=== VK_EXT_validation_features === - struct ValidationFeaturesEXT; - - //=== VK_KHR_present_wait === - struct PhysicalDevicePresentWaitFeaturesKHR; - - //=== VK_NV_cooperative_matrix === - struct CooperativeMatrixPropertiesNV; - struct PhysicalDeviceCooperativeMatrixFeaturesNV; - struct PhysicalDeviceCooperativeMatrixPropertiesNV; - - //=== VK_NV_coverage_reduction_mode === - struct PhysicalDeviceCoverageReductionModeFeaturesNV; - struct PipelineCoverageReductionStateCreateInfoNV; - struct FramebufferMixedSamplesCombinationNV; - - //=== VK_EXT_fragment_shader_interlock === - struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT; - - //=== VK_EXT_ycbcr_image_arrays === - struct PhysicalDeviceYcbcrImageArraysFeaturesEXT; - - //=== VK_EXT_provoking_vertex === - struct PhysicalDeviceProvokingVertexFeaturesEXT; - struct PhysicalDeviceProvokingVertexPropertiesEXT; - struct PipelineRasterizationProvokingVertexStateCreateInfoEXT; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - struct SurfaceFullScreenExclusiveInfoEXT; - struct SurfaceCapabilitiesFullScreenExclusiveEXT; - struct SurfaceFullScreenExclusiveWin32InfoEXT; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - struct HeadlessSurfaceCreateInfoEXT; - - //=== VK_EXT_line_rasterization === - struct PhysicalDeviceLineRasterizationFeaturesEXT; - struct PhysicalDeviceLineRasterizationPropertiesEXT; - struct PipelineRasterizationLineStateCreateInfoEXT; - - //=== VK_EXT_shader_atomic_float === - struct PhysicalDeviceShaderAtomicFloatFeaturesEXT; - - //=== VK_EXT_index_type_uint8 === - struct PhysicalDeviceIndexTypeUint8FeaturesEXT; - - //=== VK_EXT_extended_dynamic_state === - struct PhysicalDeviceExtendedDynamicStateFeaturesEXT; - - //=== VK_KHR_pipeline_executable_properties === - struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - struct PipelineInfoKHR; - using PipelineInfoEXT = PipelineInfoKHR; - struct PipelineExecutablePropertiesKHR; - struct PipelineExecutableInfoKHR; - union PipelineExecutableStatisticValueKHR; - struct PipelineExecutableStatisticKHR; - struct PipelineExecutableInternalRepresentationKHR; - - //=== VK_EXT_shader_atomic_float2 === - struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT; - - //=== VK_NV_device_generated_commands === - struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - struct GraphicsShaderGroupCreateInfoNV; - struct GraphicsPipelineShaderGroupsCreateInfoNV; - struct BindShaderGroupIndirectCommandNV; - struct BindIndexBufferIndirectCommandNV; - struct BindVertexBufferIndirectCommandNV; - struct SetStateFlagsIndirectCommandNV; - struct IndirectCommandsStreamNV; - struct IndirectCommandsLayoutTokenNV; - struct IndirectCommandsLayoutCreateInfoNV; - struct GeneratedCommandsInfoNV; - struct GeneratedCommandsMemoryRequirementsInfoNV; - - //=== VK_NV_inherited_viewport_scissor === - struct PhysicalDeviceInheritedViewportScissorFeaturesNV; - struct CommandBufferInheritanceViewportScissorInfoNV; - - //=== VK_EXT_texel_buffer_alignment === - struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT; - - //=== VK_QCOM_render_pass_transform === - struct RenderPassTransformBeginInfoQCOM; - struct CommandBufferInheritanceRenderPassTransformInfoQCOM; - - //=== VK_EXT_device_memory_report === - struct PhysicalDeviceDeviceMemoryReportFeaturesEXT; - struct DeviceDeviceMemoryReportCreateInfoEXT; - struct DeviceMemoryReportCallbackDataEXT; - - //=== VK_EXT_robustness2 === - struct PhysicalDeviceRobustness2FeaturesEXT; - struct PhysicalDeviceRobustness2PropertiesEXT; - - //=== VK_EXT_custom_border_color === - struct SamplerCustomBorderColorCreateInfoEXT; - struct PhysicalDeviceCustomBorderColorPropertiesEXT; - struct PhysicalDeviceCustomBorderColorFeaturesEXT; - - //=== VK_KHR_pipeline_library === - struct PipelineLibraryCreateInfoKHR; - - //=== VK_KHR_present_id === - struct PresentIdKHR; - struct PhysicalDevicePresentIdFeaturesKHR; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - struct VideoEncodeInfoKHR; - struct VideoEncodeCapabilitiesKHR; - struct VideoEncodeUsageInfoKHR; - struct VideoEncodeRateControlInfoKHR; - struct VideoEncodeRateControlLayerInfoKHR; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - struct PhysicalDeviceDiagnosticsConfigFeaturesNV; - struct DeviceDiagnosticsConfigCreateInfoNV; - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - struct ExportMetalObjectCreateInfoEXT; - struct ExportMetalObjectsInfoEXT; - struct ExportMetalDeviceInfoEXT; - struct ExportMetalCommandQueueInfoEXT; - struct ExportMetalBufferInfoEXT; - struct ImportMetalBufferInfoEXT; - struct ExportMetalTextureInfoEXT; - struct ImportMetalTextureInfoEXT; - struct ExportMetalIOSurfaceInfoEXT; - struct ImportMetalIOSurfaceInfoEXT; - struct ExportMetalSharedEventInfoEXT; - struct ImportMetalSharedEventInfoEXT; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - struct QueueFamilyCheckpointProperties2NV; - struct CheckpointData2NV; - - //=== VK_EXT_graphics_pipeline_library === - struct PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - struct PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - struct GraphicsPipelineLibraryCreateInfoEXT; - - //=== VK_AMD_shader_early_and_late_fragment_tests === - struct PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - - //=== VK_KHR_fragment_shader_barycentric === - struct PhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - using PhysicalDeviceFragmentShaderBarycentricFeaturesNV = PhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - struct PhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - - //=== VK_KHR_shader_subgroup_uniform_control_flow === - struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - - //=== VK_NV_fragment_shading_rate_enums === - struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - struct PipelineFragmentShadingRateEnumStateCreateInfoNV; - - //=== VK_NV_ray_tracing_motion_blur === - struct AccelerationStructureGeometryMotionTrianglesDataNV; - struct AccelerationStructureMotionInfoNV; - struct AccelerationStructureMotionInstanceNV; - union AccelerationStructureMotionInstanceDataNV; - struct AccelerationStructureMatrixMotionInstanceNV; - struct AccelerationStructureSRTMotionInstanceNV; - struct SRTDataNV; - struct PhysicalDeviceRayTracingMotionBlurFeaturesNV; - - //=== VK_EXT_mesh_shader === - struct PhysicalDeviceMeshShaderFeaturesEXT; - struct PhysicalDeviceMeshShaderPropertiesEXT; - struct DrawMeshTasksIndirectCommandEXT; - - //=== VK_EXT_ycbcr_2plane_444_formats === - struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - - //=== VK_EXT_fragment_density_map2 === - struct PhysicalDeviceFragmentDensityMap2FeaturesEXT; - struct PhysicalDeviceFragmentDensityMap2PropertiesEXT; - - //=== VK_QCOM_rotated_copy_commands === - struct CopyCommandTransformInfoQCOM; - - //=== VK_KHR_workgroup_memory_explicit_layout === - struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - - //=== VK_EXT_image_compression_control === - struct PhysicalDeviceImageCompressionControlFeaturesEXT; - struct ImageCompressionControlEXT; - struct SubresourceLayout2EXT; - struct ImageSubresource2EXT; - struct ImageCompressionPropertiesEXT; - - //=== VK_EXT_attachment_feedback_loop_layout === - struct PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - - //=== VK_EXT_4444_formats === - struct PhysicalDevice4444FormatsFeaturesEXT; - - //=== VK_EXT_rgba10x6_formats === - struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT; - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - struct DirectFBSurfaceCreateInfoEXT; -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - struct RayTracingShaderGroupCreateInfoKHR; - struct RayTracingPipelineCreateInfoKHR; - struct PhysicalDeviceRayTracingPipelineFeaturesKHR; - struct PhysicalDeviceRayTracingPipelinePropertiesKHR; - struct StridedDeviceAddressRegionKHR; - struct TraceRaysIndirectCommandKHR; - struct RayTracingPipelineInterfaceCreateInfoKHR; - - //=== VK_KHR_ray_query === - struct PhysicalDeviceRayQueryFeaturesKHR; - - //=== VK_VALVE_mutable_descriptor_type === - struct PhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - struct MutableDescriptorTypeListVALVE; - struct MutableDescriptorTypeCreateInfoVALVE; - - //=== VK_EXT_vertex_input_dynamic_state === - struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT; - struct VertexInputBindingDescription2EXT; - struct VertexInputAttributeDescription2EXT; - - //=== VK_EXT_physical_device_drm === - struct PhysicalDeviceDrmPropertiesEXT; - - //=== VK_EXT_depth_clip_control === - struct PhysicalDeviceDepthClipControlFeaturesEXT; - struct PipelineViewportDepthClipControlCreateInfoEXT; - - //=== VK_EXT_primitive_topology_list_restart === - struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - struct ImportMemoryZirconHandleInfoFUCHSIA; - struct MemoryZirconHandlePropertiesFUCHSIA; - struct MemoryGetZirconHandleInfoFUCHSIA; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - struct ImportSemaphoreZirconHandleInfoFUCHSIA; - struct SemaphoreGetZirconHandleInfoFUCHSIA; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - struct BufferCollectionCreateInfoFUCHSIA; - struct ImportMemoryBufferCollectionFUCHSIA; - struct BufferCollectionImageCreateInfoFUCHSIA; - struct BufferConstraintsInfoFUCHSIA; - struct BufferCollectionBufferCreateInfoFUCHSIA; - struct BufferCollectionPropertiesFUCHSIA; - struct SysmemColorSpaceFUCHSIA; - struct ImageConstraintsInfoFUCHSIA; - struct ImageFormatConstraintsInfoFUCHSIA; - struct BufferCollectionConstraintsInfoFUCHSIA; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - struct SubpassShadingPipelineCreateInfoHUAWEI; - struct PhysicalDeviceSubpassShadingFeaturesHUAWEI; - struct PhysicalDeviceSubpassShadingPropertiesHUAWEI; - - //=== VK_HUAWEI_invocation_mask === - struct PhysicalDeviceInvocationMaskFeaturesHUAWEI; - - //=== VK_NV_external_memory_rdma === - struct MemoryGetRemoteAddressInfoNV; - struct PhysicalDeviceExternalMemoryRDMAFeaturesNV; - - //=== VK_EXT_pipeline_properties === - struct PipelinePropertiesIdentifierEXT; - struct PhysicalDevicePipelinePropertiesFeaturesEXT; - - //=== VK_EXT_multisampled_render_to_single_sampled === - struct PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - struct SubpassResolvePerformanceQueryEXT; - struct MultisampledRenderToSingleSampledInfoEXT; - - //=== VK_EXT_extended_dynamic_state2 === - struct PhysicalDeviceExtendedDynamicState2FeaturesEXT; - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - struct ScreenSurfaceCreateInfoQNX; -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - struct PhysicalDeviceColorWriteEnableFeaturesEXT; - struct PipelineColorWriteCreateInfoEXT; - - //=== VK_EXT_primitives_generated_query === - struct PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - - //=== VK_KHR_ray_tracing_maintenance1 === - struct PhysicalDeviceRayTracingMaintenance1FeaturesKHR; - struct TraceRaysIndirectCommand2KHR; - - //=== VK_EXT_image_view_min_lod === - struct PhysicalDeviceImageViewMinLodFeaturesEXT; - struct ImageViewMinLodCreateInfoEXT; - - //=== VK_EXT_multi_draw === - struct PhysicalDeviceMultiDrawFeaturesEXT; - struct PhysicalDeviceMultiDrawPropertiesEXT; - struct MultiDrawInfoEXT; - struct MultiDrawIndexedInfoEXT; - - //=== VK_EXT_image_2d_view_of_3d === - struct PhysicalDeviceImage2DViewOf3DFeaturesEXT; - - //=== VK_EXT_border_color_swizzle === - struct PhysicalDeviceBorderColorSwizzleFeaturesEXT; - struct SamplerBorderColorComponentMappingCreateInfoEXT; - - //=== VK_EXT_pageable_device_local_memory === - struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - - //=== VK_VALVE_descriptor_set_host_mapping === - struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - struct DescriptorSetBindingReferenceVALVE; - struct DescriptorSetLayoutHostMappingInfoVALVE; - - //=== VK_EXT_depth_clamp_zero_one === - struct PhysicalDeviceDepthClampZeroOneFeaturesEXT; - - //=== VK_EXT_non_seamless_cube_map === - struct PhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - - //=== VK_QCOM_fragment_density_map_offset === - struct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - struct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - struct SubpassFragmentDensityMapOffsetEndInfoQCOM; - - //=== VK_NV_linear_color_attachment === - struct PhysicalDeviceLinearColorAttachmentFeaturesNV; - - //=== VK_EXT_image_compression_control_swapchain === - struct PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - - //=== VK_QCOM_image_processing === - struct ImageViewSampleWeightCreateInfoQCOM; - struct PhysicalDeviceImageProcessingFeaturesQCOM; - struct PhysicalDeviceImageProcessingPropertiesQCOM; - - //=== VK_EXT_subpass_merge_feedback === - struct PhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - struct RenderPassCreationControlEXT; - struct RenderPassCreationFeedbackInfoEXT; - struct RenderPassCreationFeedbackCreateInfoEXT; - struct RenderPassSubpassFeedbackInfoEXT; - struct RenderPassSubpassFeedbackCreateInfoEXT; - - //=== VK_EXT_shader_module_identifier === - struct PhysicalDeviceShaderModuleIdentifierFeaturesEXT; - struct PhysicalDeviceShaderModuleIdentifierPropertiesEXT; - struct PipelineShaderStageModuleIdentifierCreateInfoEXT; - struct ShaderModuleIdentifierEXT; - - //=== VK_EXT_rasterization_order_attachment_access === - struct PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - using PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM = PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - - //=== VK_EXT_legacy_dithering === - struct PhysicalDeviceLegacyDitheringFeaturesEXT; - - //=== VK_QCOM_tile_properties === - struct PhysicalDeviceTilePropertiesFeaturesQCOM; - struct TilePropertiesQCOM; - - //=== VK_SEC_amigo_profiling === - struct PhysicalDeviceAmigoProfilingFeaturesSEC; - struct AmigoProfilingSubmitInfoSEC; - - //=============== - //=== HANDLEs === - //=============== - - class SurfaceKHR - { - public: - using CType = VkSurfaceKHR; - using NativeType = VkSurfaceKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSurfaceKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSurfaceKHR; - - public: - VULKAN_HPP_CONSTEXPR SurfaceKHR() = default; - VULKAN_HPP_CONSTEXPR SurfaceKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT SurfaceKHR( VkSurfaceKHR surfaceKHR ) VULKAN_HPP_NOEXCEPT : m_surfaceKHR( surfaceKHR ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - SurfaceKHR & operator=( VkSurfaceKHR surfaceKHR ) VULKAN_HPP_NOEXCEPT - { - m_surfaceKHR = surfaceKHR; - return *this; - } -#endif - - SurfaceKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_surfaceKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceKHR const & ) const = default; -#else - bool operator==( SurfaceKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR == rhs.m_surfaceKHR; - } - - bool operator!=( SurfaceKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR != rhs.m_surfaceKHR; - } - - bool operator<( SurfaceKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR < rhs.m_surfaceKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSurfaceKHR() const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_surfaceKHR == VK_NULL_HANDLE; - } - - private: - VkSurfaceKHR m_surfaceKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SurfaceKHR; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SurfaceKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DebugReportCallbackEXT - { - public: - using CType = VkDebugReportCallbackEXT; - using NativeType = VkDebugReportCallbackEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugReportCallbackEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDebugReportCallbackEXT; - - public: - VULKAN_HPP_CONSTEXPR DebugReportCallbackEXT() = default; - VULKAN_HPP_CONSTEXPR DebugReportCallbackEXT( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DebugReportCallbackEXT( VkDebugReportCallbackEXT debugReportCallbackEXT ) VULKAN_HPP_NOEXCEPT - : m_debugReportCallbackEXT( debugReportCallbackEXT ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DebugReportCallbackEXT & operator=( VkDebugReportCallbackEXT debugReportCallbackEXT ) VULKAN_HPP_NOEXCEPT - { - m_debugReportCallbackEXT = debugReportCallbackEXT; - return *this; - } -#endif - - DebugReportCallbackEXT & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_debugReportCallbackEXT = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DebugReportCallbackEXT const & ) const = default; -#else - bool operator==( DebugReportCallbackEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT == rhs.m_debugReportCallbackEXT; - } - - bool operator!=( DebugReportCallbackEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT != rhs.m_debugReportCallbackEXT; - } - - bool operator<( DebugReportCallbackEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT < rhs.m_debugReportCallbackEXT; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugReportCallbackEXT() const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_debugReportCallbackEXT == VK_NULL_HANDLE; - } - - private: - VkDebugReportCallbackEXT m_debugReportCallbackEXT = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DebugUtilsMessengerEXT - { - public: - using CType = VkDebugUtilsMessengerEXT; - using NativeType = VkDebugUtilsMessengerEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugUtilsMessengerEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT() = default; - VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DebugUtilsMessengerEXT( VkDebugUtilsMessengerEXT debugUtilsMessengerEXT ) VULKAN_HPP_NOEXCEPT - : m_debugUtilsMessengerEXT( debugUtilsMessengerEXT ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DebugUtilsMessengerEXT & operator=( VkDebugUtilsMessengerEXT debugUtilsMessengerEXT ) VULKAN_HPP_NOEXCEPT - { - m_debugUtilsMessengerEXT = debugUtilsMessengerEXT; - return *this; - } -#endif - - DebugUtilsMessengerEXT & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_debugUtilsMessengerEXT = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DebugUtilsMessengerEXT const & ) const = default; -#else - bool operator==( DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT == rhs.m_debugUtilsMessengerEXT; - } - - bool operator!=( DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT != rhs.m_debugUtilsMessengerEXT; - } - - bool operator<( DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT < rhs.m_debugUtilsMessengerEXT; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugUtilsMessengerEXT() const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_debugUtilsMessengerEXT == VK_NULL_HANDLE; - } - - private: - VkDebugUtilsMessengerEXT m_debugUtilsMessengerEXT = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DisplayKHR - { - public: - using CType = VkDisplayKHR; - using NativeType = VkDisplayKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayKHR; - - public: - VULKAN_HPP_CONSTEXPR DisplayKHR() = default; - VULKAN_HPP_CONSTEXPR DisplayKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DisplayKHR( VkDisplayKHR displayKHR ) VULKAN_HPP_NOEXCEPT : m_displayKHR( displayKHR ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DisplayKHR & operator=( VkDisplayKHR displayKHR ) VULKAN_HPP_NOEXCEPT - { - m_displayKHR = displayKHR; - return *this; - } -#endif - - DisplayKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_displayKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayKHR const & ) const = default; -#else - bool operator==( DisplayKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR == rhs.m_displayKHR; - } - - bool operator!=( DisplayKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR != rhs.m_displayKHR; - } - - bool operator<( DisplayKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR < rhs.m_displayKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayKHR() const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_displayKHR == VK_NULL_HANDLE; - } - - private: - VkDisplayKHR m_displayKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DisplayKHR; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DisplayKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class SwapchainKHR - { - public: - using CType = VkSwapchainKHR; - using NativeType = VkSwapchainKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSwapchainKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSwapchainKHR; - - public: - VULKAN_HPP_CONSTEXPR SwapchainKHR() = default; - VULKAN_HPP_CONSTEXPR SwapchainKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT SwapchainKHR( VkSwapchainKHR swapchainKHR ) VULKAN_HPP_NOEXCEPT : m_swapchainKHR( swapchainKHR ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - SwapchainKHR & operator=( VkSwapchainKHR swapchainKHR ) VULKAN_HPP_NOEXCEPT - { - m_swapchainKHR = swapchainKHR; - return *this; - } -#endif - - SwapchainKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_swapchainKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SwapchainKHR const & ) const = default; -#else - bool operator==( SwapchainKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR == rhs.m_swapchainKHR; - } - - bool operator!=( SwapchainKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR != rhs.m_swapchainKHR; - } - - bool operator<( SwapchainKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR < rhs.m_swapchainKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSwapchainKHR() const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_swapchainKHR == VK_NULL_HANDLE; - } - - private: - VkSwapchainKHR m_swapchainKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SwapchainKHR; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SwapchainKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Semaphore - { - public: - using CType = VkSemaphore; - using NativeType = VkSemaphore; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSemaphore; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSemaphore; - - public: - VULKAN_HPP_CONSTEXPR Semaphore() = default; - VULKAN_HPP_CONSTEXPR Semaphore( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Semaphore( VkSemaphore semaphore ) VULKAN_HPP_NOEXCEPT : m_semaphore( semaphore ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Semaphore & operator=( VkSemaphore semaphore ) VULKAN_HPP_NOEXCEPT - { - m_semaphore = semaphore; - return *this; - } -#endif - - Semaphore & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_semaphore = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Semaphore const & ) const = default; -#else - bool operator==( Semaphore const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_semaphore == rhs.m_semaphore; - } - - bool operator!=( Semaphore const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_semaphore != rhs.m_semaphore; - } - - bool operator<( Semaphore const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_semaphore < rhs.m_semaphore; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSemaphore() const VULKAN_HPP_NOEXCEPT - { - return m_semaphore; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_semaphore != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_semaphore == VK_NULL_HANDLE; - } - - private: - VkSemaphore m_semaphore = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Semaphore; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Semaphore; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Fence - { - public: - using CType = VkFence; - using NativeType = VkFence; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFence; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFence; - - public: - VULKAN_HPP_CONSTEXPR Fence() = default; - VULKAN_HPP_CONSTEXPR Fence( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Fence( VkFence fence ) VULKAN_HPP_NOEXCEPT : m_fence( fence ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Fence & operator=( VkFence fence ) VULKAN_HPP_NOEXCEPT - { - m_fence = fence; - return *this; - } -#endif - - Fence & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_fence = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Fence const & ) const = default; -#else - bool operator==( Fence const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_fence == rhs.m_fence; - } - - bool operator!=( Fence const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_fence != rhs.m_fence; - } - - bool operator<( Fence const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_fence < rhs.m_fence; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFence() const VULKAN_HPP_NOEXCEPT - { - return m_fence; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_fence != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_fence == VK_NULL_HANDLE; - } - - private: - VkFence m_fence = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Fence; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Fence; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class PerformanceConfigurationINTEL - { - public: - using CType = VkPerformanceConfigurationINTEL; - using NativeType = VkPerformanceConfigurationINTEL; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePerformanceConfigurationINTEL; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR PerformanceConfigurationINTEL() = default; - VULKAN_HPP_CONSTEXPR PerformanceConfigurationINTEL( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT PerformanceConfigurationINTEL( VkPerformanceConfigurationINTEL performanceConfigurationINTEL ) VULKAN_HPP_NOEXCEPT - : m_performanceConfigurationINTEL( performanceConfigurationINTEL ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - PerformanceConfigurationINTEL & operator=( VkPerformanceConfigurationINTEL performanceConfigurationINTEL ) VULKAN_HPP_NOEXCEPT - { - m_performanceConfigurationINTEL = performanceConfigurationINTEL; - return *this; - } -#endif - - PerformanceConfigurationINTEL & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_performanceConfigurationINTEL = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceConfigurationINTEL const & ) const = default; -#else - bool operator==( PerformanceConfigurationINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL == rhs.m_performanceConfigurationINTEL; - } - - bool operator!=( PerformanceConfigurationINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL != rhs.m_performanceConfigurationINTEL; - } - - bool operator<( PerformanceConfigurationINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL < rhs.m_performanceConfigurationINTEL; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPerformanceConfigurationINTEL() const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_performanceConfigurationINTEL == VK_NULL_HANDLE; - } - - private: - VkPerformanceConfigurationINTEL m_performanceConfigurationINTEL = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class QueryPool - { - public: - using CType = VkQueryPool; - using NativeType = VkQueryPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueryPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueryPool; - - public: - VULKAN_HPP_CONSTEXPR QueryPool() = default; - VULKAN_HPP_CONSTEXPR QueryPool( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT QueryPool( VkQueryPool queryPool ) VULKAN_HPP_NOEXCEPT : m_queryPool( queryPool ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - QueryPool & operator=( VkQueryPool queryPool ) VULKAN_HPP_NOEXCEPT - { - m_queryPool = queryPool; - return *this; - } -#endif - - QueryPool & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_queryPool = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueryPool const & ) const = default; -#else - bool operator==( QueryPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queryPool == rhs.m_queryPool; - } - - bool operator!=( QueryPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queryPool != rhs.m_queryPool; - } - - bool operator<( QueryPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queryPool < rhs.m_queryPool; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkQueryPool() const VULKAN_HPP_NOEXCEPT - { - return m_queryPool; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_queryPool != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_queryPool == VK_NULL_HANDLE; - } - - private: - VkQueryPool m_queryPool = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::QueryPool; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::QueryPool; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Buffer - { - public: - using CType = VkBuffer; - using NativeType = VkBuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBuffer; - - public: - VULKAN_HPP_CONSTEXPR Buffer() = default; - VULKAN_HPP_CONSTEXPR Buffer( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Buffer( VkBuffer buffer ) VULKAN_HPP_NOEXCEPT : m_buffer( buffer ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Buffer & operator=( VkBuffer buffer ) VULKAN_HPP_NOEXCEPT - { - m_buffer = buffer; - return *this; - } -#endif - - Buffer & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_buffer = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Buffer const & ) const = default; -#else - bool operator==( Buffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_buffer == rhs.m_buffer; - } - - bool operator!=( Buffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_buffer != rhs.m_buffer; - } - - bool operator<( Buffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_buffer < rhs.m_buffer; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBuffer() const VULKAN_HPP_NOEXCEPT - { - return m_buffer; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_buffer != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_buffer == VK_NULL_HANDLE; - } - - private: - VkBuffer m_buffer = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Buffer; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Buffer; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class PipelineLayout - { - public: - using CType = VkPipelineLayout; - using NativeType = VkPipelineLayout; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineLayout; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineLayout; - - public: - VULKAN_HPP_CONSTEXPR PipelineLayout() = default; - VULKAN_HPP_CONSTEXPR PipelineLayout( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT PipelineLayout( VkPipelineLayout pipelineLayout ) VULKAN_HPP_NOEXCEPT : m_pipelineLayout( pipelineLayout ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - PipelineLayout & operator=( VkPipelineLayout pipelineLayout ) VULKAN_HPP_NOEXCEPT - { - m_pipelineLayout = pipelineLayout; - return *this; - } -#endif - - PipelineLayout & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_pipelineLayout = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineLayout const & ) const = default; -#else - bool operator==( PipelineLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout == rhs.m_pipelineLayout; - } - - bool operator!=( PipelineLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout != rhs.m_pipelineLayout; - } - - bool operator<( PipelineLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout < rhs.m_pipelineLayout; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineLayout() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout == VK_NULL_HANDLE; - } - - private: - VkPipelineLayout m_pipelineLayout = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PipelineLayout; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PipelineLayout; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DescriptorSet - { - public: - using CType = VkDescriptorSet; - using NativeType = VkDescriptorSet; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSet; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSet; - - public: - VULKAN_HPP_CONSTEXPR DescriptorSet() = default; - VULKAN_HPP_CONSTEXPR DescriptorSet( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSet( VkDescriptorSet descriptorSet ) VULKAN_HPP_NOEXCEPT : m_descriptorSet( descriptorSet ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DescriptorSet & operator=( VkDescriptorSet descriptorSet ) VULKAN_HPP_NOEXCEPT - { - m_descriptorSet = descriptorSet; - return *this; - } -#endif - - DescriptorSet & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_descriptorSet = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSet const & ) const = default; -#else - bool operator==( DescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet == rhs.m_descriptorSet; - } - - bool operator!=( DescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet != rhs.m_descriptorSet; - } - - bool operator<( DescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet < rhs.m_descriptorSet; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSet() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet == VK_NULL_HANDLE; - } - - private: - VkDescriptorSet m_descriptorSet = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorSet; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorSet; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class ImageView - { - public: - using CType = VkImageView; - using NativeType = VkImageView; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImageView; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImageView; - - public: - VULKAN_HPP_CONSTEXPR ImageView() = default; - VULKAN_HPP_CONSTEXPR ImageView( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT ImageView( VkImageView imageView ) VULKAN_HPP_NOEXCEPT : m_imageView( imageView ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - ImageView & operator=( VkImageView imageView ) VULKAN_HPP_NOEXCEPT - { - m_imageView = imageView; - return *this; - } -#endif - - ImageView & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_imageView = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageView const & ) const = default; -#else - bool operator==( ImageView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_imageView == rhs.m_imageView; - } - - bool operator!=( ImageView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_imageView != rhs.m_imageView; - } - - bool operator<( ImageView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_imageView < rhs.m_imageView; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImageView() const VULKAN_HPP_NOEXCEPT - { - return m_imageView; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_imageView != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_imageView == VK_NULL_HANDLE; - } - - private: - VkImageView m_imageView = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ImageView; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ImageView; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Pipeline - { - public: - using CType = VkPipeline; - using NativeType = VkPipeline; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipeline; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipeline; - - public: - VULKAN_HPP_CONSTEXPR Pipeline() = default; - VULKAN_HPP_CONSTEXPR Pipeline( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Pipeline( VkPipeline pipeline ) VULKAN_HPP_NOEXCEPT : m_pipeline( pipeline ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Pipeline & operator=( VkPipeline pipeline ) VULKAN_HPP_NOEXCEPT - { - m_pipeline = pipeline; - return *this; - } -#endif - - Pipeline & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_pipeline = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Pipeline const & ) const = default; -#else - bool operator==( Pipeline const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipeline == rhs.m_pipeline; - } - - bool operator!=( Pipeline const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipeline != rhs.m_pipeline; - } - - bool operator<( Pipeline const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipeline < rhs.m_pipeline; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipeline() const VULKAN_HPP_NOEXCEPT - { - return m_pipeline; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_pipeline != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_pipeline == VK_NULL_HANDLE; - } - - private: - VkPipeline m_pipeline = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Pipeline; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Pipeline; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Image - { - public: - using CType = VkImage; - using NativeType = VkImage; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImage; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImage; - - public: - VULKAN_HPP_CONSTEXPR Image() = default; - VULKAN_HPP_CONSTEXPR Image( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Image( VkImage image ) VULKAN_HPP_NOEXCEPT : m_image( image ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Image & operator=( VkImage image ) VULKAN_HPP_NOEXCEPT - { - m_image = image; - return *this; - } -#endif - - Image & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_image = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Image const & ) const = default; -#else - bool operator==( Image const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_image == rhs.m_image; - } - - bool operator!=( Image const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_image != rhs.m_image; - } - - bool operator<( Image const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_image < rhs.m_image; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkImage() const VULKAN_HPP_NOEXCEPT - { - return m_image; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_image != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_image == VK_NULL_HANDLE; - } - - private: - VkImage m_image = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Image; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Image; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class AccelerationStructureNV - { - public: - using CType = VkAccelerationStructureNV; - using NativeType = VkAccelerationStructureNV; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureNV; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureNV; - - public: - VULKAN_HPP_CONSTEXPR AccelerationStructureNV() = default; - VULKAN_HPP_CONSTEXPR AccelerationStructureNV( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT AccelerationStructureNV( VkAccelerationStructureNV accelerationStructureNV ) VULKAN_HPP_NOEXCEPT - : m_accelerationStructureNV( accelerationStructureNV ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - AccelerationStructureNV & operator=( VkAccelerationStructureNV accelerationStructureNV ) VULKAN_HPP_NOEXCEPT - { - m_accelerationStructureNV = accelerationStructureNV; - return *this; - } -#endif - - AccelerationStructureNV & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_accelerationStructureNV = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureNV const & ) const = default; -#else - bool operator==( AccelerationStructureNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV == rhs.m_accelerationStructureNV; - } - - bool operator!=( AccelerationStructureNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV != rhs.m_accelerationStructureNV; - } - - bool operator<( AccelerationStructureNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV < rhs.m_accelerationStructureNV; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkAccelerationStructureNV() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureNV == VK_NULL_HANDLE; - } - - private: - VkAccelerationStructureNV m_accelerationStructureNV = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::AccelerationStructureNV; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::AccelerationStructureNV; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DescriptorUpdateTemplate - { - public: - using CType = VkDescriptorUpdateTemplate; - using NativeType = VkDescriptorUpdateTemplate; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorUpdateTemplate; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorUpdateTemplate; - - public: - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplate() = default; - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplate( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorUpdateTemplate( VkDescriptorUpdateTemplate descriptorUpdateTemplate ) VULKAN_HPP_NOEXCEPT - : m_descriptorUpdateTemplate( descriptorUpdateTemplate ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DescriptorUpdateTemplate & operator=( VkDescriptorUpdateTemplate descriptorUpdateTemplate ) VULKAN_HPP_NOEXCEPT - { - m_descriptorUpdateTemplate = descriptorUpdateTemplate; - return *this; - } -#endif - - DescriptorUpdateTemplate & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_descriptorUpdateTemplate = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorUpdateTemplate const & ) const = default; -#else - bool operator==( DescriptorUpdateTemplate const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate == rhs.m_descriptorUpdateTemplate; - } - - bool operator!=( DescriptorUpdateTemplate const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate != rhs.m_descriptorUpdateTemplate; - } - - bool operator<( DescriptorUpdateTemplate const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate < rhs.m_descriptorUpdateTemplate; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorUpdateTemplate() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate == VK_NULL_HANDLE; - } - - private: - VkDescriptorUpdateTemplate m_descriptorUpdateTemplate = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - using DescriptorUpdateTemplateKHR = DescriptorUpdateTemplate; - - class Event - { - public: - using CType = VkEvent; - using NativeType = VkEvent; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eEvent; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eEvent; - - public: - VULKAN_HPP_CONSTEXPR Event() = default; - VULKAN_HPP_CONSTEXPR Event( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Event( VkEvent event ) VULKAN_HPP_NOEXCEPT : m_event( event ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Event & operator=( VkEvent event ) VULKAN_HPP_NOEXCEPT - { - m_event = event; - return *this; - } -#endif - - Event & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_event = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Event const & ) const = default; -#else - bool operator==( Event const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_event == rhs.m_event; - } - - bool operator!=( Event const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_event != rhs.m_event; - } - - bool operator<( Event const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_event < rhs.m_event; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkEvent() const VULKAN_HPP_NOEXCEPT - { - return m_event; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_event != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_event == VK_NULL_HANDLE; - } - - private: - VkEvent m_event = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Event; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Event; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class AccelerationStructureKHR - { - public: - using CType = VkAccelerationStructureKHR; - using NativeType = VkAccelerationStructureKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureKHR; - - public: - VULKAN_HPP_CONSTEXPR AccelerationStructureKHR() = default; - VULKAN_HPP_CONSTEXPR AccelerationStructureKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT AccelerationStructureKHR( VkAccelerationStructureKHR accelerationStructureKHR ) VULKAN_HPP_NOEXCEPT - : m_accelerationStructureKHR( accelerationStructureKHR ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - AccelerationStructureKHR & operator=( VkAccelerationStructureKHR accelerationStructureKHR ) VULKAN_HPP_NOEXCEPT - { - m_accelerationStructureKHR = accelerationStructureKHR; - return *this; - } -#endif - - AccelerationStructureKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_accelerationStructureKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureKHR const & ) const = default; -#else - bool operator==( AccelerationStructureKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR == rhs.m_accelerationStructureKHR; - } - - bool operator!=( AccelerationStructureKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR != rhs.m_accelerationStructureKHR; - } - - bool operator<( AccelerationStructureKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR < rhs.m_accelerationStructureKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkAccelerationStructureKHR() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructureKHR == VK_NULL_HANDLE; - } - - private: - VkAccelerationStructureKHR m_accelerationStructureKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::AccelerationStructureKHR; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::AccelerationStructureKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class CommandBuffer - { - public: - using CType = VkCommandBuffer; - using NativeType = VkCommandBuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandBuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandBuffer; - - public: - VULKAN_HPP_CONSTEXPR CommandBuffer() = default; - VULKAN_HPP_CONSTEXPR CommandBuffer( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - CommandBuffer( VkCommandBuffer commandBuffer ) VULKAN_HPP_NOEXCEPT : m_commandBuffer( commandBuffer ) {} - - CommandBuffer & operator=( VkCommandBuffer commandBuffer ) VULKAN_HPP_NOEXCEPT - { - m_commandBuffer = commandBuffer; - return *this; - } - - CommandBuffer & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_commandBuffer = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBuffer const & ) const = default; -#else - bool operator==( CommandBuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer == rhs.m_commandBuffer; - } - - bool operator!=( CommandBuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer != rhs.m_commandBuffer; - } - - bool operator<( CommandBuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer < rhs.m_commandBuffer; - } -#endif - - //=== VK_VERSION_1_0 === - - template - VULKAN_HPP_NODISCARD Result begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo * pBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo & beginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result end( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type end( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void bindPipeline( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setViewport( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setViewport( uint32_t firstViewport, - ArrayProxy const & viewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setScissor( uint32_t firstScissor, - uint32_t scissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setScissor( uint32_t firstScissor, - ArrayProxy const & scissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setLineWidth( float lineWidth, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBias( float depthBiasConstantFactor, - float depthBiasClamp, - float depthBiasSlopeFactor, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setBlendConstants( const float blendConstants[4], Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBounds( float minDepthBounds, float maxDepthBounds, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilCompareMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - uint32_t compareMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilWriteMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - uint32_t writeMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilReference( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - uint32_t reference, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - uint32_t dynamicOffsetCount, - const uint32_t * pDynamicOffsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - ArrayProxy const & descriptorSets, - ArrayProxy const & dynamicOffsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void bindIndexBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::IndexType indexType, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void bindVertexBuffers( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void bindVertexBuffers( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void draw( uint32_t vertexCount, - uint32_t instanceCount, - uint32_t firstVertex, - uint32_t firstInstance, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndexed( uint32_t indexCount, - uint32_t instanceCount, - uint32_t firstIndex, - int32_t vertexOffset, - uint32_t firstInstance, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndexedIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void dispatch( uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void dispatchIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferCopy * pRegions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageCopy * pRegions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageBlit * pRegions, - VULKAN_HPP_NAMESPACE::Filter filter, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - VULKAN_HPP_NAMESPACE::Filter filter, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferImageCopy * pRegions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::BufferImageCopy * pRegions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize dataSize, - const void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - ArrayProxy const & data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void fillBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - uint32_t data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue * pColor, - uint32_t rangeCount, - const VULKAN_HPP_NAMESPACE::ImageSubresourceRange * pRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue & color, - ArrayProxy const & ranges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue * pDepthStencil, - uint32_t rangeCount, - const VULKAN_HPP_NAMESPACE::ImageSubresourceRange * pRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue & depthStencil, - ArrayProxy const & ranges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void clearAttachments( uint32_t attachmentCount, - const VULKAN_HPP_NAMESPACE::ClearAttachment * pAttachments, - uint32_t rectCount, - const VULKAN_HPP_NAMESPACE::ClearRect * pRects, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void clearAttachments( ArrayProxy const & attachments, - ArrayProxy const & rects, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - uint32_t regionCount, - const VULKAN_HPP_NAMESPACE::ImageResolve * pRegions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void resetEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void waitEvents( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - uint32_t memoryBarrierCount, - const VULKAN_HPP_NAMESPACE::MemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier * pImageMemoryBarriers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void waitEvents( ArrayProxy const & events, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - uint32_t memoryBarrierCount, - const VULKAN_HPP_NAMESPACE::MemoryBarrier * pMemoryBarriers, - uint32_t bufferMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier * pBufferMemoryBarriers, - uint32_t imageMemoryBarrierCount, - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier * pImageMemoryBarriers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void beginQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void endQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void writeTimestamp( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void copyQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - uint32_t size, - const void * pValues, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - ArrayProxy const & values, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void nextSubpass( VULKAN_HPP_NAMESPACE::SubpassContents contents, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void endRenderPass( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void executeCommands( uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void executeCommands( ArrayProxy const & commandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - void setDeviceMask( uint32_t deviceMask, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void dispatchBase( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_2 === - - template - void drawIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndexedIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_3 === - - template - void setEvent2( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setEvent2( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resetEvent2( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void waitEvents2( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void waitEvents2( ArrayProxy const & events, - ArrayProxy const & dependencyInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void writeTimestamp2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 * pCopyBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 * pCopyImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 * pCopyBufferToImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 * pCopyImageToBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 * pBlitImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 * pResolveImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endRendering( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setCullMode( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setFrontFace( VULKAN_HPP_NAMESPACE::FrontFace frontFace, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setPrimitiveTopology( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setViewportWithCount( uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setViewportWithCount( ArrayProxy const & viewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setScissorWithCount( uint32_t scissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setScissorWithCount( ArrayProxy const & scissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void bindVertexBuffers2( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - const VULKAN_HPP_NAMESPACE::DeviceSize * pStrides, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void bindVertexBuffers2( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - ArrayProxy const & strides VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setDepthTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthCompareOp( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBoundsTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilTestEnable( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilOp( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setRasterizerDiscardEnable( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBiasEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setPrimitiveRestartEnable( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_debug_marker === - - template - void debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT * pMarkerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void debugMarkerEndEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT * pMarkerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - template - void beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR * pBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR & beginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR * pEndCodingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR & endCodingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR * pCodingControlInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR & codingControlInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - template - void decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR * pFrameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR & frameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - template - void bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VULKAN_HPP_NAMESPACE::Buffer * pCounterBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pCounterBufferOffsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void - beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endTransformFeedbackEXT( uint32_t firstCounterBuffer, - uint32_t counterBufferCount, - const VULKAN_HPP_NAMESPACE::Buffer * pCounterBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pCounterBufferOffsets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void - endTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void beginQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - uint32_t index, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void endQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - uint32_t index, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndirectByteCountEXT( uint32_t instanceCount, - uint32_t firstInstance, - VULKAN_HPP_NAMESPACE::Buffer counterBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize counterBufferOffset, - uint32_t counterOffset, - uint32_t vertexStride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NVX_binary_import === - - template - void cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX * pLaunchInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX & launchInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_draw_indirect_count === - - template - void drawIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndexedIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_dynamic_rendering === - - template - void beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endRenderingKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_device_group === - - template - void setDeviceMaskKHR( uint32_t deviceMask, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void dispatchBaseKHR( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_push_descriptor === - - template - void pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - uint32_t descriptorWriteCount, - const VULKAN_HPP_NAMESPACE::WriteDescriptorSet * pDescriptorWrites, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - ArrayProxy const & descriptorWrites, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - const void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - DataType const & data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_conditional_rendering === - - template - void beginConditionalRenderingEXT( const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT * pConditionalRenderingBegin, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginConditionalRenderingEXT( const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT & conditionalRenderingBegin, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endConditionalRenderingEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_clip_space_w_scaling === - - template - void setViewportWScalingNV( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::ViewportWScalingNV * pViewportWScalings, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setViewportWScalingNV( uint32_t firstViewport, - ArrayProxy const & viewportWScalings, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_discard_rectangles === - - template - void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - uint32_t discardRectangleCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pDiscardRectangles, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - ArrayProxy const & discardRectangles, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_create_renderpass2 === - - template - void beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo * pRenderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo * pSubpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo * pSubpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_debug_utils === - - template - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endDebugUtilsLabelEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_sample_locations === - - template - void setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT * pSampleLocationsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT & sampleLocationsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_acceleration_structure === - - template - void buildAccelerationStructuresKHR( uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void buildAccelerationStructuresKHR( ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void buildAccelerationStructuresIndirectKHR( uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::DeviceAddress * pIndirectDeviceAddresses, - const uint32_t * pIndirectStrides, - const uint32_t * const * ppMaxPrimitiveCounts, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void buildAccelerationStructuresIndirectKHR( ArrayProxy const & infos, - ArrayProxy const & indirectDeviceAddresses, - ArrayProxy const & indirectStrides, - ArrayProxy const & pMaxPrimitiveCounts, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyAccelerationStructureToMemoryKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyAccelerationStructureToMemoryKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyMemoryToAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyMemoryToAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void writeAccelerationStructuresPropertiesKHR( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_shading_rate_image === - - template - void bindShadingRateImageNV( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setViewportShadingRatePaletteNV( uint32_t firstViewport, - uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV * pShadingRatePalettes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setViewportShadingRatePaletteNV( uint32_t firstViewport, - ArrayProxy const & shadingRatePalettes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setCoarseSampleOrderNV( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - uint32_t customSampleOrderCount, - const VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV * pCustomSampleOrders, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setCoarseSampleOrderNV( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - ArrayProxy const & customSampleOrders, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_ray_tracing === - - template - void buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV & info, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void traceRaysNV( VULKAN_HPP_NAMESPACE::Buffer raygenShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderBindingOffset, - VULKAN_HPP_NAMESPACE::Buffer missShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer hitShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer callableShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingStride, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void writeAccelerationStructuresPropertiesNV( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void writeAccelerationStructuresPropertiesNV( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_draw_indirect_count === - - template - void drawIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawIndexedIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_AMD_buffer_marker === - - template - void writeBufferMarkerAMD( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_mesh_shader === - - template - void drawMeshTasksNV( uint32_t taskCount, uint32_t firstTask, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawMeshTasksIndirectNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawMeshTasksIndirectCountNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_scissor_exclusive === - - template - void setExclusiveScissorNV( uint32_t firstExclusiveScissor, - uint32_t exclusiveScissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pExclusiveScissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setExclusiveScissorNV( uint32_t firstExclusiveScissor, - ArrayProxy const & exclusiveScissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_device_diagnostic_checkpoints === - - template - void setCheckpointNV( const void * pCheckpointMarker, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setCheckpointNV( CheckpointMarkerType const & checkpointMarker, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_INTEL_performance_query === - - template - VULKAN_HPP_NODISCARD Result setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL * pMarkerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL & markerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result setPerformanceStreamMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL * pMarkerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setPerformanceStreamMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL & markerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result setPerformanceOverrideINTEL( const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL * pOverrideInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setPerformanceOverrideINTEL( const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL & overrideInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_fragment_shading_rate === - - template - void setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D * pFragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D & fragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_line_rasterization === - - template - void setLineStippleEXT( uint32_t lineStippleFactor, - uint16_t lineStipplePattern, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_extended_dynamic_state === - - template - void setCullModeEXT( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setFrontFaceEXT( VULKAN_HPP_NAMESPACE::FrontFace frontFace, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setPrimitiveTopologyEXT( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setViewportWithCountEXT( uint32_t viewportCount, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setViewportWithCountEXT( ArrayProxy const & viewports, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setScissorWithCountEXT( uint32_t scissorCount, - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setScissorWithCountEXT( ArrayProxy const & scissors, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void bindVertexBuffers2EXT( uint32_t firstBinding, - uint32_t bindingCount, - const VULKAN_HPP_NAMESPACE::Buffer * pBuffers, - const VULKAN_HPP_NAMESPACE::DeviceSize * pOffsets, - const VULKAN_HPP_NAMESPACE::DeviceSize * pSizes, - const VULKAN_HPP_NAMESPACE::DeviceSize * pStrides, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void bindVertexBuffers2EXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - ArrayProxy const & strides VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setDepthTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthWriteEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthCompareOpEXT( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBoundsTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setStencilOpEXT( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_device_generated_commands === - - template - void preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV * pGeneratedCommandsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV * pGeneratedCommandsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void bindPipelineShaderGroupNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t groupIndex, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - template - void encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR * pEncodeInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR & encodeInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_KHR_synchronization2 === - - template - void setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resetEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void waitEvents2KHR( uint32_t eventCount, - const VULKAN_HPP_NAMESPACE::Event * pEvents, - const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void waitEvents2KHR( ArrayProxy const & events, - ArrayProxy const & dependencyInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo * pDependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void writeTimestamp2KHR( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void writeBufferMarker2AMD( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_fragment_shading_rate_enums === - - template - void setFragmentShadingRateEnumNV( VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2], - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_mesh_shader === - - template - void drawMeshTasksEXT( uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawMeshTasksIndirectEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void drawMeshTasksIndirectCountEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_copy_commands2 === - - template - void copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 * pCopyBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 * pCopyImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 * pCopyBufferToImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 * pCopyImageToBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 * pBlitImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 * pResolveImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_ray_tracing_pipeline === - - template - void traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pRaygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pMissShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pHitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR * pCallableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void setRayTracingPipelineStackSizeKHR( uint32_t pipelineStackSize, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_vertex_input_dynamic_state === - - template - void setVertexInputEXT( uint32_t vertexBindingDescriptionCount, - const VULKAN_HPP_NAMESPACE::VertexInputBindingDescription2EXT * pVertexBindingDescriptions, - uint32_t vertexAttributeDescriptionCount, - const VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription2EXT * pVertexAttributeDescriptions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setVertexInputEXT( ArrayProxy const & vertexBindingDescriptions, - ArrayProxy const & vertexAttributeDescriptions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_HUAWEI_subpass_shading === - - template - void subpassShadingHUAWEI( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_HUAWEI_invocation_mask === - - template - void bindInvocationMaskHUAWEI( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_extended_dynamic_state2 === - - template - void setPatchControlPointsEXT( uint32_t patchControlPoints, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setRasterizerDiscardEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setDepthBiasEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setLogicOpEXT( VULKAN_HPP_NAMESPACE::LogicOp logicOp, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void setPrimitiveRestartEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_color_write_enable === - - template - void setColorWriteEnableEXT( uint32_t attachmentCount, - const VULKAN_HPP_NAMESPACE::Bool32 * pColorWriteEnables, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setColorWriteEnableEXT( ArrayProxy const & colorWriteEnables, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_ray_tracing_maintenance1 === - - template - void traceRaysIndirect2KHR( VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_multi_draw === - - template - void drawMultiEXT( uint32_t drawCount, - const VULKAN_HPP_NAMESPACE::MultiDrawInfoEXT * pVertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void drawMultiEXT( ArrayProxy const & vertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void drawMultiIndexedEXT( uint32_t drawCount, - const VULKAN_HPP_NAMESPACE::MultiDrawIndexedInfoEXT * pIndexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - const int32_t * pVertexOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void drawMultiIndexedEXT( ArrayProxy const & indexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Optional vertexOffset VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - operator VkCommandBuffer() const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer == VK_NULL_HANDLE; - } - - private: - VkCommandBuffer m_commandBuffer = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CommandBuffer; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CommandBuffer; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DeviceMemory - { - public: - using CType = VkDeviceMemory; - using NativeType = VkDeviceMemory; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeviceMemory; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDeviceMemory; - - public: - VULKAN_HPP_CONSTEXPR DeviceMemory() = default; - VULKAN_HPP_CONSTEXPR DeviceMemory( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DeviceMemory( VkDeviceMemory deviceMemory ) VULKAN_HPP_NOEXCEPT : m_deviceMemory( deviceMemory ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DeviceMemory & operator=( VkDeviceMemory deviceMemory ) VULKAN_HPP_NOEXCEPT - { - m_deviceMemory = deviceMemory; - return *this; - } -#endif - - DeviceMemory & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_deviceMemory = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceMemory const & ) const = default; -#else - bool operator==( DeviceMemory const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory == rhs.m_deviceMemory; - } - - bool operator!=( DeviceMemory const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory != rhs.m_deviceMemory; - } - - bool operator<( DeviceMemory const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory < rhs.m_deviceMemory; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDeviceMemory() const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_deviceMemory == VK_NULL_HANDLE; - } - - private: - VkDeviceMemory m_deviceMemory = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DeviceMemory; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DeviceMemory; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoSessionKHR - { - public: - using CType = VkVideoSessionKHR; - using NativeType = VkVideoSessionKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR VideoSessionKHR() = default; - VULKAN_HPP_CONSTEXPR VideoSessionKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT VideoSessionKHR( VkVideoSessionKHR videoSessionKHR ) VULKAN_HPP_NOEXCEPT : m_videoSessionKHR( videoSessionKHR ) {} - -# if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - VideoSessionKHR & operator=( VkVideoSessionKHR videoSessionKHR ) VULKAN_HPP_NOEXCEPT - { - m_videoSessionKHR = videoSessionKHR; - return *this; - } -# endif - - VideoSessionKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_videoSessionKHR = {}; - return *this; - } - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionKHR const & ) const = default; -# else - bool operator==( VideoSessionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR == rhs.m_videoSessionKHR; - } - - bool operator!=( VideoSessionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR != rhs.m_videoSessionKHR; - } - - bool operator<( VideoSessionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR < rhs.m_videoSessionKHR; - } -# endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkVideoSessionKHR() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionKHR == VK_NULL_HANDLE; - } - - private: - VkVideoSessionKHR m_videoSessionKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::VideoSessionKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - class DeferredOperationKHR - { - public: - using CType = VkDeferredOperationKHR; - using NativeType = VkDeferredOperationKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeferredOperationKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR DeferredOperationKHR() = default; - VULKAN_HPP_CONSTEXPR DeferredOperationKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DeferredOperationKHR( VkDeferredOperationKHR deferredOperationKHR ) VULKAN_HPP_NOEXCEPT - : m_deferredOperationKHR( deferredOperationKHR ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DeferredOperationKHR & operator=( VkDeferredOperationKHR deferredOperationKHR ) VULKAN_HPP_NOEXCEPT - { - m_deferredOperationKHR = deferredOperationKHR; - return *this; - } -#endif - - DeferredOperationKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_deferredOperationKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeferredOperationKHR const & ) const = default; -#else - bool operator==( DeferredOperationKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR == rhs.m_deferredOperationKHR; - } - - bool operator!=( DeferredOperationKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR != rhs.m_deferredOperationKHR; - } - - bool operator<( DeferredOperationKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR < rhs.m_deferredOperationKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDeferredOperationKHR() const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_deferredOperationKHR == VK_NULL_HANDLE; - } - - private: - VkDeferredOperationKHR m_deferredOperationKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DeferredOperationKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - class BufferCollectionFUCHSIA - { - public: - using CType = VkBufferCollectionFUCHSIA; - using NativeType = VkBufferCollectionFUCHSIA; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferCollectionFUCHSIA; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferCollectionFUCHSIA; - - public: - VULKAN_HPP_CONSTEXPR BufferCollectionFUCHSIA() = default; - VULKAN_HPP_CONSTEXPR BufferCollectionFUCHSIA( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT BufferCollectionFUCHSIA( VkBufferCollectionFUCHSIA bufferCollectionFUCHSIA ) VULKAN_HPP_NOEXCEPT - : m_bufferCollectionFUCHSIA( bufferCollectionFUCHSIA ) - { - } - -# if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - BufferCollectionFUCHSIA & operator=( VkBufferCollectionFUCHSIA bufferCollectionFUCHSIA ) VULKAN_HPP_NOEXCEPT - { - m_bufferCollectionFUCHSIA = bufferCollectionFUCHSIA; - return *this; - } -# endif - - BufferCollectionFUCHSIA & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_bufferCollectionFUCHSIA = {}; - return *this; - } - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCollectionFUCHSIA const & ) const = default; -# else - bool operator==( BufferCollectionFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA == rhs.m_bufferCollectionFUCHSIA; - } - - bool operator!=( BufferCollectionFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA != rhs.m_bufferCollectionFUCHSIA; - } - - bool operator<( BufferCollectionFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA < rhs.m_bufferCollectionFUCHSIA; - } -# endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBufferCollectionFUCHSIA() const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_bufferCollectionFUCHSIA == VK_NULL_HANDLE; - } - - private: - VkBufferCollectionFUCHSIA m_bufferCollectionFUCHSIA = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - class BufferView - { - public: - using CType = VkBufferView; - using NativeType = VkBufferView; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferView; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferView; - - public: - VULKAN_HPP_CONSTEXPR BufferView() = default; - VULKAN_HPP_CONSTEXPR BufferView( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT BufferView( VkBufferView bufferView ) VULKAN_HPP_NOEXCEPT : m_bufferView( bufferView ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - BufferView & operator=( VkBufferView bufferView ) VULKAN_HPP_NOEXCEPT - { - m_bufferView = bufferView; - return *this; - } -#endif - - BufferView & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_bufferView = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferView const & ) const = default; -#else - bool operator==( BufferView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferView == rhs.m_bufferView; - } - - bool operator!=( BufferView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferView != rhs.m_bufferView; - } - - bool operator<( BufferView const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_bufferView < rhs.m_bufferView; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkBufferView() const VULKAN_HPP_NOEXCEPT - { - return m_bufferView; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_bufferView != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_bufferView == VK_NULL_HANDLE; - } - - private: - VkBufferView m_bufferView = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::BufferView; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::BufferView; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class CommandPool - { - public: - using CType = VkCommandPool; - using NativeType = VkCommandPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandPool; - - public: - VULKAN_HPP_CONSTEXPR CommandPool() = default; - VULKAN_HPP_CONSTEXPR CommandPool( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT CommandPool( VkCommandPool commandPool ) VULKAN_HPP_NOEXCEPT : m_commandPool( commandPool ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - CommandPool & operator=( VkCommandPool commandPool ) VULKAN_HPP_NOEXCEPT - { - m_commandPool = commandPool; - return *this; - } -#endif - - CommandPool & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_commandPool = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandPool const & ) const = default; -#else - bool operator==( CommandPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandPool == rhs.m_commandPool; - } - - bool operator!=( CommandPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandPool != rhs.m_commandPool; - } - - bool operator<( CommandPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_commandPool < rhs.m_commandPool; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCommandPool() const VULKAN_HPP_NOEXCEPT - { - return m_commandPool; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_commandPool != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_commandPool == VK_NULL_HANDLE; - } - - private: - VkCommandPool m_commandPool = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CommandPool; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CommandPool; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class PipelineCache - { - public: - using CType = VkPipelineCache; - using NativeType = VkPipelineCache; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineCache; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineCache; - - public: - VULKAN_HPP_CONSTEXPR PipelineCache() = default; - VULKAN_HPP_CONSTEXPR PipelineCache( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT PipelineCache( VkPipelineCache pipelineCache ) VULKAN_HPP_NOEXCEPT : m_pipelineCache( pipelineCache ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - PipelineCache & operator=( VkPipelineCache pipelineCache ) VULKAN_HPP_NOEXCEPT - { - m_pipelineCache = pipelineCache; - return *this; - } -#endif - - PipelineCache & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_pipelineCache = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCache const & ) const = default; -#else - bool operator==( PipelineCache const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache == rhs.m_pipelineCache; - } - - bool operator!=( PipelineCache const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache != rhs.m_pipelineCache; - } - - bool operator<( PipelineCache const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache < rhs.m_pipelineCache; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPipelineCache() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache == VK_NULL_HANDLE; - } - - private: - VkPipelineCache m_pipelineCache = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PipelineCache; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PipelineCache; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class CuFunctionNVX - { - public: - using CType = VkCuFunctionNVX; - using NativeType = VkCuFunctionNVX; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuFunctionNVX; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuFunctionNVX; - - public: - VULKAN_HPP_CONSTEXPR CuFunctionNVX() = default; - VULKAN_HPP_CONSTEXPR CuFunctionNVX( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT CuFunctionNVX( VkCuFunctionNVX cuFunctionNVX ) VULKAN_HPP_NOEXCEPT : m_cuFunctionNVX( cuFunctionNVX ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - CuFunctionNVX & operator=( VkCuFunctionNVX cuFunctionNVX ) VULKAN_HPP_NOEXCEPT - { - m_cuFunctionNVX = cuFunctionNVX; - return *this; - } -#endif - - CuFunctionNVX & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_cuFunctionNVX = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CuFunctionNVX const & ) const = default; -#else - bool operator==( CuFunctionNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX == rhs.m_cuFunctionNVX; - } - - bool operator!=( CuFunctionNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX != rhs.m_cuFunctionNVX; - } - - bool operator<( CuFunctionNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX < rhs.m_cuFunctionNVX; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCuFunctionNVX() const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_cuFunctionNVX == VK_NULL_HANDLE; - } - - private: - VkCuFunctionNVX m_cuFunctionNVX = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CuFunctionNVX; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CuFunctionNVX; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class CuModuleNVX - { - public: - using CType = VkCuModuleNVX; - using NativeType = VkCuModuleNVX; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuModuleNVX; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuModuleNVX; - - public: - VULKAN_HPP_CONSTEXPR CuModuleNVX() = default; - VULKAN_HPP_CONSTEXPR CuModuleNVX( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT CuModuleNVX( VkCuModuleNVX cuModuleNVX ) VULKAN_HPP_NOEXCEPT : m_cuModuleNVX( cuModuleNVX ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - CuModuleNVX & operator=( VkCuModuleNVX cuModuleNVX ) VULKAN_HPP_NOEXCEPT - { - m_cuModuleNVX = cuModuleNVX; - return *this; - } -#endif - - CuModuleNVX & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_cuModuleNVX = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CuModuleNVX const & ) const = default; -#else - bool operator==( CuModuleNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX == rhs.m_cuModuleNVX; - } - - bool operator!=( CuModuleNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX != rhs.m_cuModuleNVX; - } - - bool operator<( CuModuleNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX < rhs.m_cuModuleNVX; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkCuModuleNVX() const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_cuModuleNVX == VK_NULL_HANDLE; - } - - private: - VkCuModuleNVX m_cuModuleNVX = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CuModuleNVX; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::CuModuleNVX; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DescriptorPool - { - public: - using CType = VkDescriptorPool; - using NativeType = VkDescriptorPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorPool; - - public: - VULKAN_HPP_CONSTEXPR DescriptorPool() = default; - VULKAN_HPP_CONSTEXPR DescriptorPool( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorPool( VkDescriptorPool descriptorPool ) VULKAN_HPP_NOEXCEPT : m_descriptorPool( descriptorPool ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DescriptorPool & operator=( VkDescriptorPool descriptorPool ) VULKAN_HPP_NOEXCEPT - { - m_descriptorPool = descriptorPool; - return *this; - } -#endif - - DescriptorPool & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_descriptorPool = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorPool const & ) const = default; -#else - bool operator==( DescriptorPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool == rhs.m_descriptorPool; - } - - bool operator!=( DescriptorPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool != rhs.m_descriptorPool; - } - - bool operator<( DescriptorPool const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool < rhs.m_descriptorPool; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorPool() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool == VK_NULL_HANDLE; - } - - private: - VkDescriptorPool m_descriptorPool = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorPool; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorPool; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DescriptorSetLayout - { - public: - using CType = VkDescriptorSetLayout; - using NativeType = VkDescriptorSetLayout; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSetLayout; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSetLayout; - - public: - VULKAN_HPP_CONSTEXPR DescriptorSetLayout() = default; - VULKAN_HPP_CONSTEXPR DescriptorSetLayout( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DescriptorSetLayout( VkDescriptorSetLayout descriptorSetLayout ) VULKAN_HPP_NOEXCEPT - : m_descriptorSetLayout( descriptorSetLayout ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DescriptorSetLayout & operator=( VkDescriptorSetLayout descriptorSetLayout ) VULKAN_HPP_NOEXCEPT - { - m_descriptorSetLayout = descriptorSetLayout; - return *this; - } -#endif - - DescriptorSetLayout & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_descriptorSetLayout = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayout const & ) const = default; -#else - bool operator==( DescriptorSetLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout == rhs.m_descriptorSetLayout; - } - - bool operator!=( DescriptorSetLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout != rhs.m_descriptorSetLayout; - } - - bool operator<( DescriptorSetLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout < rhs.m_descriptorSetLayout; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDescriptorSetLayout() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout == VK_NULL_HANDLE; - } - - private: - VkDescriptorSetLayout m_descriptorSetLayout = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorSetLayout; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DescriptorSetLayout; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Framebuffer - { - public: - using CType = VkFramebuffer; - using NativeType = VkFramebuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFramebuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFramebuffer; - - public: - VULKAN_HPP_CONSTEXPR Framebuffer() = default; - VULKAN_HPP_CONSTEXPR Framebuffer( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Framebuffer( VkFramebuffer framebuffer ) VULKAN_HPP_NOEXCEPT : m_framebuffer( framebuffer ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Framebuffer & operator=( VkFramebuffer framebuffer ) VULKAN_HPP_NOEXCEPT - { - m_framebuffer = framebuffer; - return *this; - } -#endif - - Framebuffer & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_framebuffer = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Framebuffer const & ) const = default; -#else - bool operator==( Framebuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer == rhs.m_framebuffer; - } - - bool operator!=( Framebuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer != rhs.m_framebuffer; - } - - bool operator<( Framebuffer const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer < rhs.m_framebuffer; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkFramebuffer() const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer == VK_NULL_HANDLE; - } - - private: - VkFramebuffer m_framebuffer = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Framebuffer; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Framebuffer; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class IndirectCommandsLayoutNV - { - public: - using CType = VkIndirectCommandsLayoutNV; - using NativeType = VkIndirectCommandsLayoutNV; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eIndirectCommandsLayoutNV; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutNV() = default; - VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutNV( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT IndirectCommandsLayoutNV( VkIndirectCommandsLayoutNV indirectCommandsLayoutNV ) VULKAN_HPP_NOEXCEPT - : m_indirectCommandsLayoutNV( indirectCommandsLayoutNV ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - IndirectCommandsLayoutNV & operator=( VkIndirectCommandsLayoutNV indirectCommandsLayoutNV ) VULKAN_HPP_NOEXCEPT - { - m_indirectCommandsLayoutNV = indirectCommandsLayoutNV; - return *this; - } -#endif - - IndirectCommandsLayoutNV & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_indirectCommandsLayoutNV = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( IndirectCommandsLayoutNV const & ) const = default; -#else - bool operator==( IndirectCommandsLayoutNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV == rhs.m_indirectCommandsLayoutNV; - } - - bool operator!=( IndirectCommandsLayoutNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV != rhs.m_indirectCommandsLayoutNV; - } - - bool operator<( IndirectCommandsLayoutNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV < rhs.m_indirectCommandsLayoutNV; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkIndirectCommandsLayoutNV() const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayoutNV == VK_NULL_HANDLE; - } - - private: - VkIndirectCommandsLayoutNV m_indirectCommandsLayoutNV = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class PrivateDataSlot - { - public: - using CType = VkPrivateDataSlot; - using NativeType = VkPrivateDataSlot; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePrivateDataSlot; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR PrivateDataSlot() = default; - VULKAN_HPP_CONSTEXPR PrivateDataSlot( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT PrivateDataSlot( VkPrivateDataSlot privateDataSlot ) VULKAN_HPP_NOEXCEPT : m_privateDataSlot( privateDataSlot ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - PrivateDataSlot & operator=( VkPrivateDataSlot privateDataSlot ) VULKAN_HPP_NOEXCEPT - { - m_privateDataSlot = privateDataSlot; - return *this; - } -#endif - - PrivateDataSlot & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_privateDataSlot = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PrivateDataSlot const & ) const = default; -#else - bool operator==( PrivateDataSlot const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot == rhs.m_privateDataSlot; - } - - bool operator!=( PrivateDataSlot const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot != rhs.m_privateDataSlot; - } - - bool operator<( PrivateDataSlot const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot < rhs.m_privateDataSlot; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkPrivateDataSlot() const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot == VK_NULL_HANDLE; - } - - private: - VkPrivateDataSlot m_privateDataSlot = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PrivateDataSlot; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - using PrivateDataSlotEXT = PrivateDataSlot; - - class RenderPass - { - public: - using CType = VkRenderPass; - using NativeType = VkRenderPass; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eRenderPass; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eRenderPass; - - public: - VULKAN_HPP_CONSTEXPR RenderPass() = default; - VULKAN_HPP_CONSTEXPR RenderPass( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT RenderPass( VkRenderPass renderPass ) VULKAN_HPP_NOEXCEPT : m_renderPass( renderPass ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - RenderPass & operator=( VkRenderPass renderPass ) VULKAN_HPP_NOEXCEPT - { - m_renderPass = renderPass; - return *this; - } -#endif - - RenderPass & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_renderPass = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPass const & ) const = default; -#else - bool operator==( RenderPass const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_renderPass == rhs.m_renderPass; - } - - bool operator!=( RenderPass const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_renderPass != rhs.m_renderPass; - } - - bool operator<( RenderPass const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_renderPass < rhs.m_renderPass; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkRenderPass() const VULKAN_HPP_NOEXCEPT - { - return m_renderPass; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_renderPass != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_renderPass == VK_NULL_HANDLE; - } - - private: - VkRenderPass m_renderPass = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::RenderPass; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::RenderPass; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class Sampler - { - public: - using CType = VkSampler; - using NativeType = VkSampler; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSampler; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSampler; - - public: - VULKAN_HPP_CONSTEXPR Sampler() = default; - VULKAN_HPP_CONSTEXPR Sampler( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT Sampler( VkSampler sampler ) VULKAN_HPP_NOEXCEPT : m_sampler( sampler ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - Sampler & operator=( VkSampler sampler ) VULKAN_HPP_NOEXCEPT - { - m_sampler = sampler; - return *this; - } -#endif - - Sampler & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_sampler = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Sampler const & ) const = default; -#else - bool operator==( Sampler const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_sampler == rhs.m_sampler; - } - - bool operator!=( Sampler const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_sampler != rhs.m_sampler; - } - - bool operator<( Sampler const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_sampler < rhs.m_sampler; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSampler() const VULKAN_HPP_NOEXCEPT - { - return m_sampler; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_sampler != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_sampler == VK_NULL_HANDLE; - } - - private: - VkSampler m_sampler = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Sampler; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Sampler; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class SamplerYcbcrConversion - { - public: - using CType = VkSamplerYcbcrConversion; - using NativeType = VkSamplerYcbcrConversion; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSamplerYcbcrConversion; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSamplerYcbcrConversion; - - public: - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversion() = default; - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversion( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT SamplerYcbcrConversion( VkSamplerYcbcrConversion samplerYcbcrConversion ) VULKAN_HPP_NOEXCEPT - : m_samplerYcbcrConversion( samplerYcbcrConversion ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - SamplerYcbcrConversion & operator=( VkSamplerYcbcrConversion samplerYcbcrConversion ) VULKAN_HPP_NOEXCEPT - { - m_samplerYcbcrConversion = samplerYcbcrConversion; - return *this; - } -#endif - - SamplerYcbcrConversion & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_samplerYcbcrConversion = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerYcbcrConversion const & ) const = default; -#else - bool operator==( SamplerYcbcrConversion const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion == rhs.m_samplerYcbcrConversion; - } - - bool operator!=( SamplerYcbcrConversion const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion != rhs.m_samplerYcbcrConversion; - } - - bool operator<( SamplerYcbcrConversion const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion < rhs.m_samplerYcbcrConversion; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkSamplerYcbcrConversion() const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_samplerYcbcrConversion == VK_NULL_HANDLE; - } - - private: - VkSamplerYcbcrConversion m_samplerYcbcrConversion = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - using SamplerYcbcrConversionKHR = SamplerYcbcrConversion; - - class ShaderModule - { - public: - using CType = VkShaderModule; - using NativeType = VkShaderModule; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eShaderModule; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eShaderModule; - - public: - VULKAN_HPP_CONSTEXPR ShaderModule() = default; - VULKAN_HPP_CONSTEXPR ShaderModule( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT ShaderModule( VkShaderModule shaderModule ) VULKAN_HPP_NOEXCEPT : m_shaderModule( shaderModule ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - ShaderModule & operator=( VkShaderModule shaderModule ) VULKAN_HPP_NOEXCEPT - { - m_shaderModule = shaderModule; - return *this; - } -#endif - - ShaderModule & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_shaderModule = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderModule const & ) const = default; -#else - bool operator==( ShaderModule const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule == rhs.m_shaderModule; - } - - bool operator!=( ShaderModule const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule != rhs.m_shaderModule; - } - - bool operator<( ShaderModule const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule < rhs.m_shaderModule; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkShaderModule() const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule == VK_NULL_HANDLE; - } - - private: - VkShaderModule m_shaderModule = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ShaderModule; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ShaderModule; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class ValidationCacheEXT - { - public: - using CType = VkValidationCacheEXT; - using NativeType = VkValidationCacheEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eValidationCacheEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eValidationCacheEXT; - - public: - VULKAN_HPP_CONSTEXPR ValidationCacheEXT() = default; - VULKAN_HPP_CONSTEXPR ValidationCacheEXT( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT ValidationCacheEXT( VkValidationCacheEXT validationCacheEXT ) VULKAN_HPP_NOEXCEPT : m_validationCacheEXT( validationCacheEXT ) - { - } - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - ValidationCacheEXT & operator=( VkValidationCacheEXT validationCacheEXT ) VULKAN_HPP_NOEXCEPT - { - m_validationCacheEXT = validationCacheEXT; - return *this; - } -#endif - - ValidationCacheEXT & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_validationCacheEXT = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ValidationCacheEXT const & ) const = default; -#else - bool operator==( ValidationCacheEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT == rhs.m_validationCacheEXT; - } - - bool operator!=( ValidationCacheEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT != rhs.m_validationCacheEXT; - } - - bool operator<( ValidationCacheEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT < rhs.m_validationCacheEXT; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkValidationCacheEXT() const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_validationCacheEXT == VK_NULL_HANDLE; - } - - private: - VkValidationCacheEXT m_validationCacheEXT = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ValidationCacheEXT; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::ValidationCacheEXT; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoSessionParametersKHR - { - public: - using CType = VkVideoSessionParametersKHR; - using NativeType = VkVideoSessionParametersKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionParametersKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VULKAN_HPP_CONSTEXPR VideoSessionParametersKHR() = default; - VULKAN_HPP_CONSTEXPR VideoSessionParametersKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT VideoSessionParametersKHR( VkVideoSessionParametersKHR videoSessionParametersKHR ) VULKAN_HPP_NOEXCEPT - : m_videoSessionParametersKHR( videoSessionParametersKHR ) - { - } - -# if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - VideoSessionParametersKHR & operator=( VkVideoSessionParametersKHR videoSessionParametersKHR ) VULKAN_HPP_NOEXCEPT - { - m_videoSessionParametersKHR = videoSessionParametersKHR; - return *this; - } -# endif - - VideoSessionParametersKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_videoSessionParametersKHR = {}; - return *this; - } - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionParametersKHR const & ) const = default; -# else - bool operator==( VideoSessionParametersKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR == rhs.m_videoSessionParametersKHR; - } - - bool operator!=( VideoSessionParametersKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR != rhs.m_videoSessionParametersKHR; - } - - bool operator<( VideoSessionParametersKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR < rhs.m_videoSessionParametersKHR; - } -# endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkVideoSessionParametersKHR() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParametersKHR == VK_NULL_HANDLE; - } - - private: - VkVideoSessionParametersKHR m_videoSessionParametersKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - class Queue - { - public: - using CType = VkQueue; - using NativeType = VkQueue; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueue; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueue; - - public: - VULKAN_HPP_CONSTEXPR Queue() = default; - VULKAN_HPP_CONSTEXPR Queue( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - Queue( VkQueue queue ) VULKAN_HPP_NOEXCEPT : m_queue( queue ) {} - - Queue & operator=( VkQueue queue ) VULKAN_HPP_NOEXCEPT - { - m_queue = queue; - return *this; - } - - Queue & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_queue = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Queue const & ) const = default; -#else - bool operator==( Queue const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queue == rhs.m_queue; - } - - bool operator!=( Queue const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queue != rhs.m_queue; - } - - bool operator<( Queue const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_queue < rhs.m_queue; - } -#endif - - //=== VK_VERSION_1_0 === - - template - VULKAN_HPP_NODISCARD Result submit( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - submit( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result waitIdle( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type waitIdle( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result bindSparse( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindSparseInfo * pBindInfo, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindSparse( ArrayProxy const & bindInfo, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_3 === - - template - VULKAN_HPP_NODISCARD Result submit2( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo2 * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - submit2( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_swapchain === - - template - VULKAN_HPP_NODISCARD Result presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR * pPresentInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR & presentInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_debug_utils === - - template - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void endDebugUtilsLabelEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pLabelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_device_diagnostic_checkpoints === - - template - void getCheckpointDataNV( uint32_t * pCheckpointDataCount, - VULKAN_HPP_NAMESPACE::CheckpointDataNV * pCheckpointData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getCheckpointDataNV( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = CheckpointDataNVAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getCheckpointDataNV( CheckpointDataNVAllocator & checkpointDataNVAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_INTEL_performance_query === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_synchronization2 === - - template - VULKAN_HPP_NODISCARD Result submit2KHR( uint32_t submitCount, - const VULKAN_HPP_NAMESPACE::SubmitInfo2 * pSubmits, - VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - submit2KHR( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getCheckpointData2NV( uint32_t * pCheckpointDataCount, - VULKAN_HPP_NAMESPACE::CheckpointData2NV * pCheckpointData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getCheckpointData2NV( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = CheckpointData2NVAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getCheckpointData2NV( CheckpointData2NVAllocator & checkpointData2NVAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - operator VkQueue() const VULKAN_HPP_NOEXCEPT - { - return m_queue; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_queue != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_queue == VK_NULL_HANDLE; - } - - private: - VkQueue m_queue = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Queue; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Queue; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class Device; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueAccelerationStructureKHR = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueAccelerationStructureNV = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueBuffer = UniqueHandle; -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueBufferCollectionFUCHSIA = UniqueHandle; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueBufferView = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = PoolFree; - }; - using UniqueCommandBuffer = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueCommandPool = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueCuFunctionNVX = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueCuModuleNVX = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDeferredOperationKHR = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDescriptorPool = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = PoolFree; - }; - using UniqueDescriptorSet = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDescriptorSetLayout = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDescriptorUpdateTemplate = UniqueHandle; - using UniqueDescriptorUpdateTemplateKHR = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectFree; - }; - using UniqueDeviceMemory = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueEvent = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueFence = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueFramebuffer = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueImage = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueImageView = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueIndirectCommandsLayoutNV = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniquePipeline = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniquePipelineCache = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniquePipelineLayout = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniquePrivateDataSlot = UniqueHandle; - using UniquePrivateDataSlotEXT = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueQueryPool = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueRenderPass = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueSampler = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueSamplerYcbcrConversion = UniqueHandle; - using UniqueSamplerYcbcrConversionKHR = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueSemaphore = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueShaderModule = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueSwapchainKHR = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueValidationCacheEXT = UniqueHandle; -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueVideoSessionKHR = UniqueHandle; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueVideoSessionParametersKHR = UniqueHandle; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - class Device - { - public: - using CType = VkDevice; - using NativeType = VkDevice; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDevice; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDevice; - - public: - VULKAN_HPP_CONSTEXPR Device() = default; - VULKAN_HPP_CONSTEXPR Device( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - Device( VkDevice device ) VULKAN_HPP_NOEXCEPT : m_device( device ) {} - - Device & operator=( VkDevice device ) VULKAN_HPP_NOEXCEPT - { - m_device = device; - return *this; - } - - Device & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_device = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Device const & ) const = default; -#else - bool operator==( Device const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_device == rhs.m_device; - } - - bool operator!=( Device const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_device != rhs.m_device; - } - - bool operator<( Device const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_device < rhs.m_device; - } -#endif - - //=== VK_VERSION_1_0 === - - template - PFN_vkVoidFunction getProcAddr( const char * pName, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - PFN_vkVoidFunction getProcAddr( const std::string & name, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getQueue( uint32_t queueFamilyIndex, - uint32_t queueIndex, - VULKAN_HPP_NAMESPACE::Queue * pQueue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Queue - getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result waitIdle( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type waitIdle( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo * pAllocateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DeviceMemory * pMemory, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - allocateMemory( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo & allocateInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - allocateMemoryUnique( const VULKAN_HPP_NAMESPACE::MemoryAllocateInfo & allocateInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void freeMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void freeMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void( free )( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void( free )( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result mapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags, - void ** ppData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type mapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void unmapMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD Result flushMappedMemoryRanges( uint32_t memoryRangeCount, - const VULKAN_HPP_NAMESPACE::MappedMemoryRange * pMemoryRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - flushMappedMemoryRanges( ArrayProxy const & memoryRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result invalidateMappedMemoryRanges( uint32_t memoryRangeCount, - const VULKAN_HPP_NAMESPACE::MappedMemoryRange * pMemoryRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - invalidateMappedMemoryRanges( ArrayProxy const & memoryRanges, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getMemoryCommitment( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize * pCommittedMemoryInBytes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceSize - getMemoryCommitment( VULKAN_HPP_NAMESPACE::DeviceMemory memory, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result bindBufferMemory( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindBufferMemory( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result bindImageMemory( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindImageMemory( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getBufferMemoryRequirements( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::MemoryRequirements * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements - getBufferMemoryRequirements( VULKAN_HPP_NAMESPACE::Buffer buffer, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::MemoryRequirements * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements - getImageMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements * pSparseMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageMemoryRequirementsAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements( VULKAN_HPP_NAMESPACE::Image image, - SparseImageMemoryRequirementsAllocator & sparseImageMemoryRequirementsAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createFence( const VULKAN_HPP_NAMESPACE::FenceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createFence( const VULKAN_HPP_NAMESPACE::FenceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createFenceUnique( const VULKAN_HPP_NAMESPACE::FenceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyFence( VULKAN_HPP_NAMESPACE::Fence fence, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyFence( VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Fence fence, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Fence fence, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result resetFences( uint32_t fenceCount, - const VULKAN_HPP_NAMESPACE::Fence * pFences, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - typename ResultValueType::type resetFences( ArrayProxy const & fences, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result getFenceStatus( VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getFenceStatus( VULKAN_HPP_NAMESPACE::Fence fence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result waitForFences( uint32_t fenceCount, - const VULKAN_HPP_NAMESPACE::Fence * pFences, - VULKAN_HPP_NAMESPACE::Bool32 waitAll, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitForFences( ArrayProxy const & fences, - VULKAN_HPP_NAMESPACE::Bool32 waitAll, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Semaphore * pSemaphore, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSemaphoreUnique( const VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroySemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createEvent( const VULKAN_HPP_NAMESPACE::EventCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Event * pEvent, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createEvent( const VULKAN_HPP_NAMESPACE::EventCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createEventUnique( const VULKAN_HPP_NAMESPACE::EventCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyEvent( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyEvent( VULKAN_HPP_NAMESPACE::Event event VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Event event, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result getEventStatus( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getEventStatus( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result setEvent( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type setEvent( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result resetEvent( VULKAN_HPP_NAMESPACE::Event event, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type resetEvent( VULKAN_HPP_NAMESPACE::Event event, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createQueryPool( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::QueryPool * pQueryPool, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createQueryPool( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createQueryPoolUnique( const VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - void * pData, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD ResultValue> - getQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue getQueryPoolResult( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createBuffer( const VULKAN_HPP_NAMESPACE::BufferCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Buffer * pBuffer, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createBuffer( const VULKAN_HPP_NAMESPACE::BufferCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createBufferUnique( const VULKAN_HPP_NAMESPACE::BufferCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Buffer buffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Buffer buffer, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createBufferView( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::BufferView * pView, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createBufferView( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createBufferViewUnique( const VULKAN_HPP_NAMESPACE::BufferViewCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyBufferView( VULKAN_HPP_NAMESPACE::BufferView bufferView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyBufferView( VULKAN_HPP_NAMESPACE::BufferView bufferView VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::BufferView bufferView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::BufferView bufferView, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createImage( const VULKAN_HPP_NAMESPACE::ImageCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Image * pImage, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createImage( const VULKAN_HPP_NAMESPACE::ImageCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createImageUnique( const VULKAN_HPP_NAMESPACE::ImageCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyImage( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyImage( VULKAN_HPP_NAMESPACE::Image image VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Image image, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSubresourceLayout( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource * pSubresource, - VULKAN_HPP_NAMESPACE::SubresourceLayout * pLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SubresourceLayout - getImageSubresourceLayout( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource & subresource, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createImageView( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ImageView * pView, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createImageView( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createImageViewUnique( const VULKAN_HPP_NAMESPACE::ImageViewCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyImageView( VULKAN_HPP_NAMESPACE::ImageView imageView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyImageView( VULKAN_HPP_NAMESPACE::ImageView imageView VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::ImageView imageView, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::ImageView imageView, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createShaderModule( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ShaderModule * pShaderModule, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createShaderModule( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createShaderModuleUnique( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyShaderModule( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyShaderModule( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createPipelineCache( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PipelineCache * pPipelineCache, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createPipelineCache( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createPipelineCacheUnique( const VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - size_t * pDataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = Uint8_tAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getPipelineCacheData( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - Uint8_tAllocator & uint8_tAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result mergePipelineCaches( VULKAN_HPP_NAMESPACE::PipelineCache dstCache, - uint32_t srcCacheCount, - const VULKAN_HPP_NAMESPACE::PipelineCache * pSrcCaches, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - mergePipelineCaches( VULKAN_HPP_NAMESPACE::PipelineCache dstCache, - ArrayProxy const & srcCaches, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD ResultValue> - createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = PipelineAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue> - createGraphicsPipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue - createGraphicsPipeline( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createGraphicsPipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = PipelineAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createGraphicsPipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue> - createGraphicsPipelineUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD ResultValue> - createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = PipelineAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue> - createComputePipelines( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue - createComputePipeline( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createComputePipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = PipelineAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createComputePipelinesUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue> - createComputePipelineUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createPipelineLayout( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PipelineLayout * pPipelineLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createPipelineLayout( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createPipelineLayoutUnique( const VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createSampler( const VULKAN_HPP_NAMESPACE::SamplerCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Sampler * pSampler, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSampler( const VULKAN_HPP_NAMESPACE::SamplerCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSamplerUnique( const VULKAN_HPP_NAMESPACE::SamplerCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroySampler( VULKAN_HPP_NAMESPACE::Sampler sampler, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySampler( VULKAN_HPP_NAMESPACE::Sampler sampler VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Sampler sampler, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Sampler sampler, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createDescriptorSetLayout( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDescriptorSetLayout( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDescriptorSetLayoutUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createDescriptorPool( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorPool * pDescriptorPool, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDescriptorPool( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDescriptorPoolUnique( const VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - Result resetDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - void resetDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo * pAllocateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = DescriptorSetAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - allocateDescriptorSets( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - DescriptorSetAllocator & descriptorSetAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD typename ResultValueType, DescriptorSetAllocator>>::type - allocateDescriptorSetsUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = DescriptorSetAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType, DescriptorSetAllocator>>::type - allocateDescriptorSetsUnique( const VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo & allocateInfo, - DescriptorSetAllocator & descriptorSetAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - Result freeDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void freeDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - ArrayProxy const & descriptorSets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - Result( free )( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - uint32_t descriptorSetCount, - const VULKAN_HPP_NAMESPACE::DescriptorSet * pDescriptorSets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void( free )( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool, - ArrayProxy const & descriptorSets, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void updateDescriptorSets( uint32_t descriptorWriteCount, - const VULKAN_HPP_NAMESPACE::WriteDescriptorSet * pDescriptorWrites, - uint32_t descriptorCopyCount, - const VULKAN_HPP_NAMESPACE::CopyDescriptorSet * pDescriptorCopies, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void updateDescriptorSets( ArrayProxy const & descriptorWrites, - ArrayProxy const & descriptorCopies, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createFramebuffer( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Framebuffer * pFramebuffer, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createFramebuffer( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createFramebufferUnique( const VULKAN_HPP_NAMESPACE::FramebufferCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createRenderPassUnique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getRenderAreaGranularity( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - VULKAN_HPP_NAMESPACE::Extent2D * pGranularity, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Extent2D - getRenderAreaGranularity( VULKAN_HPP_NAMESPACE::RenderPass renderPass, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createCommandPool( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CommandPool * pCommandPool, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createCommandPool( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createCommandPoolUnique( const VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result resetCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type resetCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo * pAllocateInfo, - VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = CommandBufferAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - allocateCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - CommandBufferAllocator & commandBufferAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD typename ResultValueType, CommandBufferAllocator>>::type - allocateCommandBuffersUnique( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = CommandBufferAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType, CommandBufferAllocator>>::type - allocateCommandBuffersUnique( const VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo & allocateInfo, - CommandBufferAllocator & commandBufferAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void freeCommandBuffers( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void freeCommandBuffers( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - ArrayProxy const & commandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void( free )( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - uint32_t commandBufferCount, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void( free )( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - ArrayProxy const & commandBuffers, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - VULKAN_HPP_NODISCARD Result bindBufferMemory2( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo * pBindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindBufferMemory2( ArrayProxy const & bindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result bindImageMemory2( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindImageMemoryInfo * pBindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindImageMemory2( ArrayProxy const & bindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getGroupPeerMemoryFeatures( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags * pPeerMemoryFeatures, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - getGroupPeerMemoryFeatures( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageMemoryRequirements2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void trimCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void getQueue2( const VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 * pQueueInfo, - VULKAN_HPP_NAMESPACE::Queue * pQueue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Queue getQueue2( const VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 & queueInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createSamplerYcbcrConversion( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion * pYcbcrConversion, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSamplerYcbcrConversion( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSamplerYcbcrConversionUnique( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroySamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createDescriptorUpdateTemplate( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate * pDescriptorUpdateTemplate, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDescriptorUpdateTemplate( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDescriptorUpdateTemplateUnique( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void updateDescriptorSetWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void updateDescriptorSetWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport * pSupport, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_2 === - - template - VULKAN_HPP_NODISCARD Result createRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createRenderPass2Unique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD Result getSemaphoreCounterValue( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - uint64_t * pValue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getSemaphoreCounterValue( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo * pWaitInfo, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo * pSignalInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - DeviceAddress getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::DeviceAddress getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - uint64_t getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - uint64_t getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - uint64_t getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - uint64_t getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_3 === - - template - VULKAN_HPP_NODISCARD Result createPrivateDataSlot( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PrivateDataSlot * pPrivateDataSlot, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createPrivateDataSlot( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createPrivateDataSlotUnique( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD uint64_t getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageMemoryRequirements2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_swapchain === - - template - VULKAN_HPP_NODISCARD Result createSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchain, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSwapchainKHRUnique( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroySwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint32_t * pSwapchainImageCount, - VULKAN_HPP_NAMESPACE::Image * pSwapchainImages, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSwapchainImagesKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = ImageAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type getSwapchainImagesKHR( - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, ImageAllocator & imageAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result acquireNextImageKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t timeout, - VULKAN_HPP_NAMESPACE::Semaphore semaphore, - VULKAN_HPP_NAMESPACE::Fence fence, - uint32_t * pImageIndex, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD ResultValue acquireNextImageKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t timeout, - VULKAN_HPP_NAMESPACE::Semaphore semaphore VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getGroupPresentCapabilitiesKHR( VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getGroupPresentCapabilitiesKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR * pModes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR * pAcquireInfo, - uint32_t * pImageIndex, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD ResultValue acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR & acquireInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_display_swapchain === - - template - VULKAN_HPP_NODISCARD Result createSharedSwapchainsKHR( uint32_t swapchainCount, - const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSharedSwapchainsKHR( ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = SwapchainKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSharedSwapchainsKHR( ArrayProxy const & createInfos, - Optional allocator, - SwapchainKHRAllocator & swapchainKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSharedSwapchainKHR( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD typename ResultValueType, SwapchainKHRAllocator>>::type - createSharedSwapchainsKHRUnique( ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = SwapchainKHRAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType, SwapchainKHRAllocator>>::type - createSharedSwapchainsKHRUnique( ArrayProxy const & createInfos, - Optional allocator, - SwapchainKHRAllocator & swapchainKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSharedSwapchainKHRUnique( const VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_debug_marker === - - template - VULKAN_HPP_NODISCARD Result debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT * pTagInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT & tagInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT * pNameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT & nameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - template - VULKAN_HPP_NODISCARD Result createVideoSessionKHR( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::VideoSessionKHR * pVideoSession, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createVideoSessionKHR( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createVideoSessionKHRUnique( const VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - uint32_t * pMemoryRequirementsCount, - VULKAN_HPP_NAMESPACE::VideoSessionMemoryRequirementsKHR * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = VideoSessionMemoryRequirementsKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getVideoSessionMemoryRequirementsKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - VideoSessionMemoryRequirementsKHRAllocator & videoSessionMemoryRequirementsKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result bindVideoSessionMemoryKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - uint32_t bindSessionMemoryInfoCount, - const VULKAN_HPP_NAMESPACE::BindVideoSessionMemoryInfoKHR * pBindSessionMemoryInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindVideoSessionMemoryKHR( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession, - ArrayProxy const & bindSessionMemoryInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createVideoSessionParametersKHR( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR * pVideoSessionParameters, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createVideoSessionParametersKHR( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createVideoSessionParametersKHRUnique( const VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result updateVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR * pUpdateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - updateVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR & updateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - - template - VULKAN_HPP_NODISCARD Result createCuModuleNVX( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CuModuleNVX * pModule, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createCuModuleNVX( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createCuModuleNVXUnique( const VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createCuFunctionNVX( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::CuFunctionNVX * pFunction, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createCuFunctionNVX( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createCuFunctionNVXUnique( const VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::CuModuleNVX module, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::CuFunctionNVX function, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NVX_image_view_handle === - - template - uint32_t getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - uint32_t getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getImageViewAddressNVX( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getImageViewAddressNVX( VULKAN_HPP_NAMESPACE::ImageView imageView, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_shader_info === - - template - VULKAN_HPP_NODISCARD Result getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - size_t * pInfoSize, - void * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = Uint8_tAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getShaderInfoAMD( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType, - Uint8_tAllocator & uint8_tAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - - template - VULKAN_HPP_NODISCARD Result getMemoryWin32HandleNV( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType, - HANDLE * pHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getMemoryWin32HandleNV( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_device_group === - - template - void getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags * pPeerMemoryFeatures, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, - uint32_t localDeviceIndex, - uint32_t remoteDeviceIndex, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_maintenance1 === - - template - void trimCommandPoolKHR( VULKAN_HPP_NAMESPACE::CommandPool commandPool, - VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - - template - VULKAN_HPP_NODISCARD Result getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR * pGetWin32HandleInfo, - HANDLE * pHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR & getWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getMemoryWin32HandlePropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - HANDLE handle, - VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR * pMemoryWin32HandleProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getMemoryWin32HandlePropertiesKHR( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - - template - VULKAN_HPP_NODISCARD Result getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR & getFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getMemoryFdPropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - int fd, - VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR * pMemoryFdProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getMemoryFdPropertiesKHR( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, int fd, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - - template - VULKAN_HPP_NODISCARD Result importSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR * pImportSemaphoreWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - importSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR * pGetWin32HandleInfo, - HANDLE * pHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - - template - VULKAN_HPP_NODISCARD Result importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR * pImportSemaphoreFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR & getFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_descriptor_update_template === - - template - VULKAN_HPP_NODISCARD Result createDescriptorUpdateTemplateKHR( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate * pDescriptorUpdateTemplate, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDescriptorUpdateTemplateKHR( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDescriptorUpdateTemplateKHRUnique( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo & createInfo, - Optional allocator - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void updateDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - const void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void updateDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_display_control === - - template - VULKAN_HPP_NODISCARD Result displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT * pDisplayPowerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - typename ResultValueType::type displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT & displayPowerInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result registerEventEXT( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT * pDeviceEventInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - registerEventEXT( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT & deviceEventInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - registerEventEXTUnique( const VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT & deviceEventInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT * pDisplayEventInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Fence * pFence, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT & displayEventInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - registerDisplayEventEXTUnique( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT & displayEventInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSwapchainCounterEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter, - uint64_t * pCounterValue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getSwapchainCounterEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_GOOGLE_display_timing === - - template - VULKAN_HPP_NODISCARD Result getRefreshCycleDurationGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE * pDisplayTimingProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getRefreshCycleDurationGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint32_t * pPresentationTimingCount, - VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE * pPresentationTimings, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PastPresentationTimingGOOGLEAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getPastPresentationTimingGOOGLE( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - PastPresentationTimingGOOGLEAllocator & pastPresentationTimingGOOGLEAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_hdr_metadata === - - template - void setHdrMetadataEXT( uint32_t swapchainCount, - const VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains, - const VULKAN_HPP_NAMESPACE::HdrMetadataEXT * pMetadata, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void setHdrMetadataEXT( ArrayProxy const & swapchains, - ArrayProxy const & metadata, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_create_renderpass2 === - - template - VULKAN_HPP_NODISCARD Result createRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::RenderPass * pRenderPass, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createRenderPass2KHRUnique( const VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_shared_presentable_image === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result getSwapchainStatusKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getSwapchainStatusKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - - template - VULKAN_HPP_NODISCARD Result importFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR * pImportFenceWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - importFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR * pGetWin32HandleInfo, - HANDLE * pHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR & getWin32HandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - - template - VULKAN_HPP_NODISCARD Result importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR * pImportFenceFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR & importFenceFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR * pGetFdInfo, - int * pFd, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR & getFdInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_performance_query === - - template - VULKAN_HPP_NODISCARD Result acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void releaseProfilingLockKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_debug_utils === - - template - VULKAN_HPP_NODISCARD Result setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT * pNameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT & nameInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT * pTagInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT & tagInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - - template - VULKAN_HPP_NODISCARD Result - getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer * buffer, - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID * pInfo, - struct AHardwareBuffer ** pBuffer, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_KHR_get_memory_requirements2 === - - template - void getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageMemoryRequirements2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_acceleration_structure === - - template - VULKAN_HPP_NODISCARD Result createAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructure, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createAccelerationStructureKHRUnique( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result buildAccelerationStructuresKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - uint32_t infoCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pInfos, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR * const * ppBuildRangeInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - buildAccelerationStructuresKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - writeAccelerationStructuresPropertiesKHR( uint32_t accelerationStructureCount, - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - void * pData, - size_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - size_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - writeAccelerationStructuresPropertyKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t stride, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - DeviceAddress getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::DeviceAddress - getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getAccelerationStructureCompatibilityKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR * pVersionInfo, - VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR * pCompatibility, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR - getAccelerationStructureCompatibilityKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR & versionInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR * pBuildInfo, - const uint32_t * pMaxPrimitiveCounts, - VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR * pSizeInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR - getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR & buildInfo, - ArrayProxy const & maxPrimitiveCounts VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT_WHEN_NO_EXCEPTIONS; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_sampler_ycbcr_conversion === - - template - VULKAN_HPP_NODISCARD Result createSamplerYcbcrConversionKHR( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion * pYcbcrConversion, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createSamplerYcbcrConversionKHR( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createSamplerYcbcrConversionKHRUnique( const VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_bind_memory2 === - - template - VULKAN_HPP_NODISCARD Result bindBufferMemory2KHR( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo * pBindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindBufferMemory2KHR( ArrayProxy const & bindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result bindImageMemory2KHR( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindImageMemoryInfo * pBindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindImageMemory2KHR( ArrayProxy const & bindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_image_drm_format_modifier === - - template - VULKAN_HPP_NODISCARD Result getImageDrmFormatModifierPropertiesEXT( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getImageDrmFormatModifierPropertiesEXT( VULKAN_HPP_NAMESPACE::Image image, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_validation_cache === - - template - VULKAN_HPP_NODISCARD Result createValidationCacheEXT( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::ValidationCacheEXT * pValidationCache, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createValidationCacheEXT( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createValidationCacheEXTUnique( const VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result mergeValidationCachesEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT dstCache, - uint32_t srcCacheCount, - const VULKAN_HPP_NAMESPACE::ValidationCacheEXT * pSrcCaches, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - mergeValidationCachesEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT dstCache, - ArrayProxy const & srcCaches, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - size_t * pDataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = Uint8_tAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getValidationCacheDataEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache, - Uint8_tAllocator & uint8_tAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_ray_tracing === - - template - VULKAN_HPP_NODISCARD Result createAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructure, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createAccelerationStructureNVUnique( const VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR - getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getAccelerationStructureMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result bindAccelerationStructureMemoryNV( uint32_t bindInfoCount, - const VULKAN_HPP_NAMESPACE::BindAccelerationStructureMemoryInfoNV * pBindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - bindAccelerationStructureMemoryNV( ArrayProxy const & bindInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = PipelineAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue - createRayTracingPipelineNV( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createRayTracingPipelinesNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = PipelineAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createRayTracingPipelinesNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelineNVUnique( VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getRayTracingShaderGroupHandlesNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getRayTracingShaderGroupHandleNV( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - size_t dataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type getAccelerationStructureHandleNV( - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, size_t dataSize, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getAccelerationStructureHandleNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result compileDeferredNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t shader, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - compileDeferredNV( VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t shader, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_maintenance3 === - - template - void getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport * pSupport, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_external_memory_host === - - template - VULKAN_HPP_NODISCARD Result getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - const void * pHostPointer, - VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT * pMemoryHostPointerProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - const void * pHostPointer, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_calibrated_timestamps === - - template - VULKAN_HPP_NODISCARD Result getCalibratedTimestampsEXT( uint32_t timestampCount, - const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT * pTimestampInfos, - uint64_t * pTimestamps, - uint64_t * pMaxDeviation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType, uint64_t>>::type - getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = Uint64_tAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType, uint64_t>>::type - getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos, - Uint64_tAllocator & uint64_tAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getCalibratedTimestampEXT( const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT & timestampInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_timeline_semaphore === - - template - VULKAN_HPP_NODISCARD Result getSemaphoreCounterValueKHR( VULKAN_HPP_NAMESPACE::Semaphore semaphore, - uint64_t * pValue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSemaphoreCounterValueKHR( VULKAN_HPP_NAMESPACE::Semaphore semaphore, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo * pWaitInfo, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo * pSignalInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_INTEL_performance_query === - - template - VULKAN_HPP_NODISCARD Result initializePerformanceApiINTEL( const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL * pInitializeInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - initializePerformanceApiINTEL( const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL & initializeInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void uninitializePerformanceApiINTEL( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD Result acquirePerformanceConfigurationINTEL( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL * pAcquireInfo, - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL * pConfiguration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - acquirePerformanceConfigurationINTEL( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL & acquireInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - acquirePerformanceConfigurationINTELUnique( const VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL & acquireInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result releasePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - releasePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result release( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type release( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter, - VULKAN_HPP_NAMESPACE::PerformanceValueINTEL * pValue, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_AMD_display_native_hdr === - - template - void setLocalDimmingAMD( VULKAN_HPP_NAMESPACE::SwapchainKHR swapChain, - VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_buffer_device_address === - - template - DeviceAddress getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::DeviceAddress getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_present_wait === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result waitForPresentKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t presentId, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitForPresentKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - uint64_t presentId, - uint64_t timeout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result acquireFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - acquireFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result releaseFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - releaseFullScreenExclusiveModeEXT( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR * pModes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_buffer_device_address === - - template - DeviceAddress getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::DeviceAddress getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - uint64_t getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - uint64_t getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - uint64_t getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo * pInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - uint64_t getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_host_query_reset === - - template - void resetQueryPoolEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_deferred_host_operations === - - template - VULKAN_HPP_NODISCARD Result createDeferredOperationKHR( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DeferredOperationKHR * pDeferredOperation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDeferredOperationKHR( Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDeferredOperationKHRUnique( Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDeferredOperationKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDeferredOperationKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - uint32_t getDeferredOperationMaxConcurrencyKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result getDeferredOperationResultKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - getDeferredOperationResultKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result deferredOperationJoinKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result deferredOperationJoinKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR operation, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_pipeline_executable_properties === - - template - VULKAN_HPP_NODISCARD Result getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR * pPipelineInfo, - uint32_t * pExecutableCount, - VULKAN_HPP_NAMESPACE::PipelineExecutablePropertiesKHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PipelineExecutablePropertiesKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo, - PipelineExecutablePropertiesKHRAllocator & pipelineExecutablePropertiesKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pStatisticCount, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticKHR * pStatistics, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PipelineExecutableStatisticKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - PipelineExecutableStatisticKHRAllocator & pipelineExecutableStatisticKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR * pExecutableInfo, - uint32_t * pInternalRepresentationCount, - VULKAN_HPP_NAMESPACE::PipelineExecutableInternalRepresentationKHR * pInternalRepresentations, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType< - std::vector>::type - getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PipelineExecutableInternalRepresentationKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType< - std::vector>::type - getPipelineExecutableInternalRepresentationsKHR( - const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo, - PipelineExecutableInternalRepresentationKHRAllocator & pipelineExecutableInternalRepresentationKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_device_generated_commands === - - template - void getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createIndirectCommandsLayoutNV( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV * pIndirectCommandsLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createIndirectCommandsLayoutNV( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createIndirectCommandsLayoutNVUnique( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_private_data === - - template - VULKAN_HPP_NODISCARD Result createPrivateDataSlotEXT( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::PrivateDataSlot * pPrivateDataSlot, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createPrivateDataSlotEXT( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createPrivateDataSlotEXTUnique( const VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD uint64_t getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - template - void exportMetalObjectsEXT( VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT * pMetalObjectsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT - exportMetalObjectsEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - exportMetalObjectsEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_image_compression_control === - - template - void getImageSubresourceLayout2EXT( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT * pSubresource, - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT * pLayout, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT - getImageSubresourceLayout2EXT( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getImageSubresourceLayout2EXT( VULKAN_HPP_NAMESPACE::Image image, - const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_ray_tracing_pipeline === - - template - VULKAN_HPP_NODISCARD Result createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - uint32_t createInfoCount, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR * pCreateInfos, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Pipeline * pPipelines, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B0 = PipelineAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelinesKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue - createRayTracingPipelineKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template >> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createRayTracingPipelinesKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template >, - typename B0 = PipelineAllocator, - typename std::enable_if>::value, int>::type = 0> - VULKAN_HPP_NODISCARD ResultValue, PipelineAllocator>> - createRayTracingPipelinesKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - ArrayProxy const & createInfos, - Optional allocator, - PipelineAllocator & pipelineAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD ResultValue> - createRayTracingPipelineKHRUnique( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - VULKAN_HPP_NAMESPACE::PipelineCache pipelineCache, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getRayTracingShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getRayTracingShaderGroupHandleKHR( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - void * pData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getRayTracingCaptureReplayShaderGroupHandlesKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t firstGroup, - uint32_t groupCount, - size_t dataSize, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getRayTracingCaptureReplayShaderGroupHandleKHR( - VULKAN_HPP_NAMESPACE::Pipeline pipeline, uint32_t firstGroup, uint32_t groupCount, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - DeviceSize getRayTracingShaderGroupStackSizeKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t group, - VULKAN_HPP_NAMESPACE::ShaderGroupShaderKHR groupShader, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - - template - VULKAN_HPP_NODISCARD Result getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA & getZirconHandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t zirconHandle, - VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA * pMemoryZirconHandleProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t zirconHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - - template - VULKAN_HPP_NODISCARD Result - importSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA * pImportSemaphoreZirconHandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - importSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA & importSemaphoreZirconHandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA * pGetZirconHandleInfo, - zx_handle_t * pZirconHandle, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA & getZirconHandleInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - template - VULKAN_HPP_NODISCARD Result createBufferCollectionFUCHSIA( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA * pCollection, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createBufferCollectionFUCHSIA( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createBufferCollectionFUCHSIAUnique( const VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - setBufferCollectionImageConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA * pImageConstraintsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setBufferCollectionImageConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA & imageConstraintsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result - setBufferCollectionBufferConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA * pBufferConstraintsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - setBufferCollectionBufferConstraintsFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA & bufferConstraintsInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getBufferCollectionPropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getBufferCollectionPropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - - template - VULKAN_HPP_NODISCARD Result - getSubpassShadingMaxWorkgroupSizeHUAWEI( VULKAN_HPP_NAMESPACE::RenderPass renderpass, - VULKAN_HPP_NAMESPACE::Extent2D * pMaxWorkgroupSize, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD ResultValue - getSubpassShadingMaxWorkgroupSizeHUAWEI( VULKAN_HPP_NAMESPACE::RenderPass renderpass, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_external_memory_rdma === - - template - VULKAN_HPP_NODISCARD Result getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV * pMemoryGetRemoteAddressInfo, - VULKAN_HPP_NAMESPACE::RemoteAddressNV * pAddress, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV & memoryGetRemoteAddressInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_pipeline_properties === - - template - VULKAN_HPP_NODISCARD Result getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT * pPipelineInfo, - VULKAN_HPP_NAMESPACE::BaseOutStructure * pPipelineProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT & pipelineInfo, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_pageable_device_local_memory === - - template - void setMemoryPriorityEXT( VULKAN_HPP_NAMESPACE::DeviceMemory memory, - float priority, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_maintenance4 === - - template - void getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - VULKAN_HPP_NAMESPACE::MemoryRequirements2 * pMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements * pInfo, - uint32_t * pSparseMemoryRequirementCount, - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 * pSparseMemoryRequirements, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageMemoryRequirements2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info, - SparseImageMemoryRequirements2Allocator & sparseImageMemoryRequirements2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VALVE_descriptor_set_host_mapping === - - template - void getDescriptorSetLayoutHostMappingInfoVALVE( const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE * pBindingReference, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE * pHostMapping, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE - getDescriptorSetLayoutHostMappingInfoVALVE( const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE & bindingReference, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getDescriptorSetHostMappingVALVE( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - void ** ppData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD void * getDescriptorSetHostMappingVALVE( VULKAN_HPP_NAMESPACE::DescriptorSet descriptorSet, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_shader_module_identifier === - - template - void getShaderModuleIdentifierEXT( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT * pIdentifier, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - getShaderModuleIdentifierEXT( VULKAN_HPP_NAMESPACE::ShaderModule shaderModule, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo * pCreateInfo, - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT * pIdentifier, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_QCOM_tile_properties === - - template - VULKAN_HPP_NODISCARD Result getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - uint32_t * pPropertiesCount, - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = TilePropertiesQCOMAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getFramebufferTilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer, - TilePropertiesQCOMAllocator & tilePropertiesQCOMAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - Result getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo * pRenderingInfo, - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::TilePropertiesQCOM - getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - operator VkDevice() const VULKAN_HPP_NOEXCEPT - { - return m_device; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_device != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_device == VK_NULL_HANDLE; - } - - private: - VkDevice m_device = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Device; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Device; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - class DisplayModeKHR - { - public: - using CType = VkDisplayModeKHR; - using NativeType = VkDisplayModeKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayModeKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayModeKHR; - - public: - VULKAN_HPP_CONSTEXPR DisplayModeKHR() = default; - VULKAN_HPP_CONSTEXPR DisplayModeKHR( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - VULKAN_HPP_TYPESAFE_EXPLICIT DisplayModeKHR( VkDisplayModeKHR displayModeKHR ) VULKAN_HPP_NOEXCEPT : m_displayModeKHR( displayModeKHR ) {} - -#if defined( VULKAN_HPP_TYPESAFE_CONVERSION ) - DisplayModeKHR & operator=( VkDisplayModeKHR displayModeKHR ) VULKAN_HPP_NOEXCEPT - { - m_displayModeKHR = displayModeKHR; - return *this; - } -#endif - - DisplayModeKHR & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_displayModeKHR = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayModeKHR const & ) const = default; -#else - bool operator==( DisplayModeKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR == rhs.m_displayModeKHR; - } - - bool operator!=( DisplayModeKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR != rhs.m_displayModeKHR; - } - - bool operator<( DisplayModeKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR < rhs.m_displayModeKHR; - } -#endif - - VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDisplayModeKHR() const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR == VK_NULL_HANDLE; - } - - private: - VkDisplayModeKHR m_displayModeKHR = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DisplayModeKHR; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::DisplayModeKHR; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDevice = UniqueHandle; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - class PhysicalDevice - { - public: - using CType = VkPhysicalDevice; - using NativeType = VkPhysicalDevice; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePhysicalDevice; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePhysicalDevice; - - public: - VULKAN_HPP_CONSTEXPR PhysicalDevice() = default; - VULKAN_HPP_CONSTEXPR PhysicalDevice( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - PhysicalDevice( VkPhysicalDevice physicalDevice ) VULKAN_HPP_NOEXCEPT : m_physicalDevice( physicalDevice ) {} - - PhysicalDevice & operator=( VkPhysicalDevice physicalDevice ) VULKAN_HPP_NOEXCEPT - { - m_physicalDevice = physicalDevice; - return *this; - } - - PhysicalDevice & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_physicalDevice = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevice const & ) const = default; -#else - bool operator==( PhysicalDevice const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice == rhs.m_physicalDevice; - } - - bool operator!=( PhysicalDevice const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice != rhs.m_physicalDevice; - } - - bool operator<( PhysicalDevice const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice < rhs.m_physicalDevice; - } -#endif - - //=== VK_VERSION_1_0 === - - template - void getFeatures( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pFeatures, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures - getFeatures( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties * pFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties - getFormatProperties( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ImageFormatProperties * pImageFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getProperties( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties - getProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getQueueFamilyProperties( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties * pQueueFamilyProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = QueueFamilyPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties( QueueFamilyPropertiesAllocator & queueFamilyPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getMemoryProperties( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties * pMemoryProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties - getMemoryProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createDevice( const VULKAN_HPP_NAMESPACE::DeviceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Device * pDevice, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDevice( const VULKAN_HPP_NAMESPACE::DeviceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDeviceUnique( const VULKAN_HPP_NAMESPACE::DeviceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result enumerateDeviceExtensionProperties( const char * pLayerName, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::ExtensionProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateDeviceExtensionProperties( Optional layerName VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = ExtensionPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateDeviceExtensionProperties( Optional layerName, - ExtensionPropertiesAllocator & extensionPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result enumerateDeviceLayerProperties( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::LayerProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateDeviceLayerProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = LayerPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateDeviceLayerProperties( LayerPropertiesAllocator & layerPropertiesAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageFormatPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - SparseImageFormatPropertiesAllocator & sparseImageFormatPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - void getFeatures2( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 * pFeatures, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 - getFeatures2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain getFeatures2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 - getProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain getProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties2 * pFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties2 - getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 * pImageFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getQueueFamilyProperties2( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 * pQueueFamilyProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = QueueFamilyProperties2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2( QueueFamilyProperties2Allocator & queueFamilyProperties2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = StructureChainAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2( StructureChainAllocator & structureChainAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getMemoryProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 * pMemoryProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - getMemoryProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getMemoryProperties2( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageFormatProperties2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - SparseImageFormatProperties2Allocator & sparseImageFormatProperties2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VULKAN_HPP_NAMESPACE::ExternalBufferProperties * pExternalBufferProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalBufferProperties - getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VULKAN_HPP_NAMESPACE::ExternalFenceProperties * pExternalFenceProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalFenceProperties - getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getExternalSemaphoreProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties * pExternalSemaphoreProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - getExternalSemaphoreProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_3 === - - template - VULKAN_HPP_NODISCARD Result getToolProperties( uint32_t * pToolCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties * pToolProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getToolProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceToolPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getToolProperties( PhysicalDeviceToolPropertiesAllocator & physicalDeviceToolPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_surface === - - template - VULKAN_HPP_NODISCARD Result getSurfaceSupportKHR( uint32_t queueFamilyIndex, - VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::Bool32 * pSupported, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getSurfaceSupportKHR( - uint32_t queueFamilyIndex, VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR * pSurfaceCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pSurfaceFormatCount, - VULKAN_HPP_NAMESPACE::SurfaceFormatKHR * pSurfaceFormats, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SurfaceFormatKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - SurfaceFormatKHRAllocator & surfaceFormatKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pPresentModeCount, - VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PresentModeKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - PresentModeKHRAllocator & presentModeKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_swapchain === - - template - VULKAN_HPP_NODISCARD Result getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - uint32_t * pRectCount, - VULKAN_HPP_NAMESPACE::Rect2D * pRects, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = Rect2DAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type getPresentRectanglesKHR( - VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Rect2DAllocator & rect2DAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_display === - - template - VULKAN_HPP_NODISCARD Result getDisplayPropertiesKHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPropertiesKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayPropertiesKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPropertiesKHR( DisplayPropertiesKHRAllocator & displayPropertiesKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayPlanePropertiesKHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlanePropertiesKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayPlanePropertiesKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlanePropertiesKHR( DisplayPlanePropertiesKHRAllocator & displayPlanePropertiesKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, - uint32_t * pDisplayCount, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplays, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type getDisplayPlaneSupportedDisplaysKHR( - uint32_t planeIndex, DisplayKHRAllocator & displayKHRAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayModePropertiesKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - DisplayModePropertiesKHRAllocator & displayModePropertiesKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result createDisplayModeKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DisplayModeKHR * pMode, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDisplayModeKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDisplayModeKHRUnique( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayPlaneCapabilitiesKHR( VULKAN_HPP_NAMESPACE::DisplayModeKHR mode, - uint32_t planeIndex, - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR * pCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type getDisplayPlaneCapabilitiesKHR( - VULKAN_HPP_NAMESPACE::DisplayModeKHR mode, uint32_t planeIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - template - Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, - Display * dpy, - VisualID visualID, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::Bool32 getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, - Display & dpy, - VisualID visualID, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - template - Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, - xcb_connection_t * connection, - xcb_visualid_t visual_id, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::Bool32 getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, - xcb_connection_t & connection, - xcb_visualid_t visual_id, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - template - Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, - struct wl_display * display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, - struct wl_display & display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - template - Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - template - VULKAN_HPP_NODISCARD Result getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pVideoProfile, - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR * pCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR * pVideoFormatInfo, - uint32_t * pVideoFormatPropertyCount, - VULKAN_HPP_NAMESPACE::VideoFormatPropertiesKHR * pVideoFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = VideoFormatPropertiesKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo, - VideoFormatPropertiesKHRAllocator & videoFormatPropertiesKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_external_memory_capabilities === - - template - VULKAN_HPP_NODISCARD Result getExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType, - VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV * pExternalImageFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_get_physical_device_properties2 === - - template - void getFeatures2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 * pFeatures, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 - getFeatures2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain getFeatures2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getProperties2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 - getProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain getProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::FormatProperties2 * pFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties2 - getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 * pImageFormatInfo, - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 * pImageFormatProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getQueueFamilyProperties2KHR( uint32_t * pQueueFamilyPropertyCount, - VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 * pQueueFamilyProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = QueueFamilyProperties2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2KHR( QueueFamilyProperties2Allocator & queueFamilyProperties2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = StructureChainAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getQueueFamilyProperties2KHR( StructureChainAllocator & structureChainAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getMemoryProperties2KHR( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 * pMemoryProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - getMemoryProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - template - VULKAN_HPP_NODISCARD StructureChain - getMemoryProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SparseImageFormatProperties2Allocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo, - SparseImageFormatProperties2Allocator & sparseImageFormatProperties2Allocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_memory_capabilities === - - template - void getExternalBufferPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo * pExternalBufferInfo, - VULKAN_HPP_NAMESPACE::ExternalBufferProperties * pExternalBufferProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalBufferProperties - getExternalBufferPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_semaphore_capabilities === - - template - void getExternalSemaphorePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties * pExternalSemaphoreProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - getExternalSemaphorePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_direct_mode_display === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - Result releaseDisplayEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - void releaseDisplayEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - - template - VULKAN_HPP_NODISCARD Result acquireXlibDisplayEXT( Display * dpy, - VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - acquireXlibDisplayEXT( Display & dpy, VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getRandROutputDisplayEXT( Display * dpy, - RROutput rrOutput, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplay, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getRandROutputDisplayEXTUnique( Display & dpy, RROutput rrOutput, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - - template - VULKAN_HPP_NODISCARD Result getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT * pSurfaceCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_external_fence_capabilities === - - template - void getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo * pExternalFenceInfo, - VULKAN_HPP_NAMESPACE::ExternalFenceProperties * pExternalFenceProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalFenceProperties - getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_performance_query === - - template - VULKAN_HPP_NODISCARD Result - enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, - uint32_t * pCounterCount, - VULKAN_HPP_NAMESPACE::PerformanceCounterKHR * pCounters, - VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionKHR * pCounterDescriptions, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename PerformanceCounterDescriptionKHRAllocator = std::allocator, - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType, - std::vector>>::type - enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename PerformanceCounterDescriptionKHRAllocator = std::allocator, - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PerformanceCounterKHRAllocator, - typename B2 = PerformanceCounterDescriptionKHRAllocator, - typename std::enable_if::value && - std::is_same::value, - int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType, - std::vector>>::type - enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex, - PerformanceCounterKHRAllocator & performanceCounterKHRAllocator, - PerformanceCounterDescriptionKHRAllocator & performanceCounterDescriptionKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void getQueueFamilyPerformanceQueryPassesKHR( const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR * pPerformanceQueryCreateInfo, - uint32_t * pNumPasses, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD uint32_t - getQueueFamilyPerformanceQueryPassesKHR( const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR & performanceQueryCreateInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_get_surface_capabilities2 === - - template - VULKAN_HPP_NODISCARD Result getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR * pSurfaceCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pSurfaceFormatCount, - VULKAN_HPP_NAMESPACE::SurfaceFormat2KHR * pSurfaceFormats, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = SurfaceFormat2KHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - SurfaceFormat2KHRAllocator & surfaceFormat2KHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = StructureChainAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - StructureChainAllocator & structureChainAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_get_display_properties2 === - - template - VULKAN_HPP_NODISCARD Result getDisplayProperties2KHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayProperties2KHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayProperties2KHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayProperties2KHR( DisplayProperties2KHRAllocator & displayProperties2KHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayPlaneProperties2KHR( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayPlaneProperties2KHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlaneProperties2KHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayPlaneProperties2KHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayPlaneProperties2KHR( DisplayPlaneProperties2KHRAllocator & displayPlaneProperties2KHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::DisplayModeProperties2KHR * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = DisplayModeProperties2KHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayKHR display, - DisplayModeProperties2KHRAllocator & displayModeProperties2KHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR * pDisplayPlaneInfo, - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR * pCapabilities, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR & displayPlaneInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_sample_locations === - - template - void getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT * pMultisampleProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT - getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_calibrated_timestamps === - - template - VULKAN_HPP_NODISCARD Result getCalibrateableTimeDomainsEXT( uint32_t * pTimeDomainCount, - VULKAN_HPP_NAMESPACE::TimeDomainEXT * pTimeDomains, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getCalibrateableTimeDomainsEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = TimeDomainEXTAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getCalibrateableTimeDomainsEXT( TimeDomainEXTAllocator & timeDomainEXTAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_fragment_shading_rate === - - template - VULKAN_HPP_NODISCARD Result getFragmentShadingRatesKHR( uint32_t * pFragmentShadingRateCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateKHR * pFragmentShadingRates, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getFragmentShadingRatesKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceFragmentShadingRateKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getFragmentShadingRatesKHR( PhysicalDeviceFragmentShadingRateKHRAllocator & physicalDeviceFragmentShadingRateKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_EXT_tooling_info === - - template - VULKAN_HPP_NODISCARD Result getToolPropertiesEXT( uint32_t * pToolCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties * pToolProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getToolPropertiesEXT( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceToolPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getToolPropertiesEXT( PhysicalDeviceToolPropertiesAllocator & physicalDeviceToolPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_cooperative_matrix === - - template - VULKAN_HPP_NODISCARD Result getCooperativeMatrixPropertiesNV( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesNV * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getCooperativeMatrixPropertiesNV( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = CooperativeMatrixPropertiesNVAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getCooperativeMatrixPropertiesNV( CooperativeMatrixPropertiesNVAllocator & cooperativeMatrixPropertiesNVAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_NV_coverage_reduction_mode === - - template - VULKAN_HPP_NODISCARD Result - getSupportedFramebufferMixedSamplesCombinationsNV( uint32_t * pCombinationCount, - VULKAN_HPP_NAMESPACE::FramebufferMixedSamplesCombinationNV * pCombinations, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getSupportedFramebufferMixedSamplesCombinationsNV( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = FramebufferMixedSamplesCombinationNVAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - getSupportedFramebufferMixedSamplesCombinationsNV( FramebufferMixedSamplesCombinationNVAllocator & framebufferMixedSamplesCombinationNVAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - template - VULKAN_HPP_NODISCARD Result getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR * pSurfaceInfo, - uint32_t * pPresentModeCount, - VULKAN_HPP_NAMESPACE::PresentModeKHR * pPresentModes, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PresentModeKHRAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo, - PresentModeKHRAllocator & presentModeKHRAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_acquire_drm_display === - -#ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result acquireDrmDisplayEXT( int32_t drmFd, - VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#else - template - typename ResultValueType::type - acquireDrmDisplayEXT( int32_t drmFd, VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getDrmDisplayEXT( int32_t drmFd, - uint32_t connectorId, - VULKAN_HPP_NAMESPACE::DisplayKHR * display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getDrmDisplayEXT( int32_t drmFd, uint32_t connectorId, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getDrmDisplayEXTUnique( int32_t drmFd, uint32_t connectorId, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - -# ifdef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD Result acquireWinrtDisplayNV( VULKAN_HPP_NAMESPACE::DisplayKHR display, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# else - template - VULKAN_HPP_NODISCARD_WHEN_NO_EXCEPTIONS typename ResultValueType::type - acquireWinrtDisplayNV( VULKAN_HPP_NAMESPACE::DisplayKHR display, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result getWinrtDisplayNV( uint32_t deviceRelativeId, - VULKAN_HPP_NAMESPACE::DisplayKHR * pDisplay, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - getWinrtDisplayNV( uint32_t deviceRelativeId, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - getWinrtDisplayNVUnique( uint32_t deviceRelativeId, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - template - Bool32 getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, - IDirectFB * dfb, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::Bool32 getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, - IDirectFB & dfb, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - template - Bool32 getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, - struct _screen_window * window, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NAMESPACE::Bool32 getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, - struct _screen_window & window, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - operator VkPhysicalDevice() const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice == VK_NULL_HANDLE; - } - - private: - VkPhysicalDevice m_physicalDevice = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PhysicalDevice; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::PhysicalDevice; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - class Instance; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDebugReportCallbackEXT = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueDebugUtilsMessengerEXT = UniqueHandle; - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueSurfaceKHR = UniqueHandle; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - class Instance - { - public: - using CType = VkInstance; - using NativeType = VkInstance; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eInstance; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eInstance; - - public: - VULKAN_HPP_CONSTEXPR Instance() = default; - VULKAN_HPP_CONSTEXPR Instance( std::nullptr_t ) VULKAN_HPP_NOEXCEPT {} - Instance( VkInstance instance ) VULKAN_HPP_NOEXCEPT : m_instance( instance ) {} - - Instance & operator=( VkInstance instance ) VULKAN_HPP_NOEXCEPT - { - m_instance = instance; - return *this; - } - - Instance & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT - { - m_instance = {}; - return *this; - } - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Instance const & ) const = default; -#else - bool operator==( Instance const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_instance == rhs.m_instance; - } - - bool operator!=( Instance const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_instance != rhs.m_instance; - } - - bool operator<( Instance const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return m_instance < rhs.m_instance; - } -#endif - - //=== VK_VERSION_1_0 === - - template - void destroy( const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result enumeratePhysicalDevices( uint32_t * pPhysicalDeviceCount, - VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumeratePhysicalDevices( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumeratePhysicalDevices( PhysicalDeviceAllocator & physicalDeviceAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - PFN_vkVoidFunction getProcAddr( const char * pName, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - PFN_vkVoidFunction getProcAddr( const std::string & name, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - VULKAN_HPP_NODISCARD Result enumeratePhysicalDeviceGroups( uint32_t * pPhysicalDeviceGroupCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - enumeratePhysicalDeviceGroups( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceGroupPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - enumeratePhysicalDeviceGroups( PhysicalDeviceGroupPropertiesAllocator & physicalDeviceGroupPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_surface === - - template - void destroySurfaceKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroySurfaceKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::SurfaceKHR surface, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_KHR_display === - - template - VULKAN_HPP_NODISCARD Result createDisplayPlaneSurfaceKHR( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDisplayPlaneSurfaceKHR( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDisplayPlaneSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - template - VULKAN_HPP_NODISCARD Result createXlibSurfaceKHR( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createXlibSurfaceKHR( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createXlibSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - template - VULKAN_HPP_NODISCARD Result createXcbSurfaceKHR( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createXcbSurfaceKHR( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createXcbSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - template - VULKAN_HPP_NODISCARD Result createWaylandSurfaceKHR( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createWaylandSurfaceKHR( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createWaylandSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - template - VULKAN_HPP_NODISCARD Result createAndroidSurfaceKHR( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createAndroidSurfaceKHR( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createAndroidSurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - template - VULKAN_HPP_NODISCARD Result createWin32SurfaceKHR( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createWin32SurfaceKHR( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createWin32SurfaceKHRUnique( const VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - template - VULKAN_HPP_NODISCARD Result createDebugReportCallbackEXT( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT * pCallback, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDebugReportCallbackEXT( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDebugReportCallbackEXTUnique( const VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT callback, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char * pLayerPrefix, - const char * pMessage, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const std::string & layerPrefix, - const std::string & message, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - template - VULKAN_HPP_NODISCARD Result createStreamDescriptorSurfaceGGP( const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createStreamDescriptorSurfaceGGP( const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type createStreamDescriptorSurfaceGGPUnique( - const VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_GGP*/ - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - template - VULKAN_HPP_NODISCARD Result createViSurfaceNN( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createViSurfaceNN( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createViSurfaceNNUnique( const VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_device_group_creation === - - template - VULKAN_HPP_NODISCARD Result enumeratePhysicalDeviceGroupsKHR( uint32_t * pPhysicalDeviceGroupCount, - VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - enumeratePhysicalDeviceGroupsKHR( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = PhysicalDeviceGroupPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD - typename ResultValueType>::type - enumeratePhysicalDeviceGroupsKHR( PhysicalDeviceGroupPropertiesAllocator & physicalDeviceGroupPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - template - VULKAN_HPP_NODISCARD Result createIOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createIOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createIOSSurfaceMVKUnique( const VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - template - VULKAN_HPP_NODISCARD Result createMacOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createMacOSSurfaceMVK( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createMacOSSurfaceMVKUnique( const VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - template - VULKAN_HPP_NODISCARD Result createDebugUtilsMessengerEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT * pMessenger, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDebugUtilsMessengerEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDebugUtilsMessengerEXTUnique( const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroyDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroyDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void destroy( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void destroy( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT messenger, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - void submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT * pCallbackData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - void submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT & callbackData, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - template - VULKAN_HPP_NODISCARD Result createImagePipeSurfaceFUCHSIA( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createImagePipeSurfaceFUCHSIA( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createImagePipeSurfaceFUCHSIAUnique( const VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - template - VULKAN_HPP_NODISCARD Result createMetalSurfaceEXT( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createMetalSurfaceEXT( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createMetalSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_headless_surface === - - template - VULKAN_HPP_NODISCARD Result createHeadlessSurfaceEXT( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createHeadlessSurfaceEXT( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createHeadlessSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - template - VULKAN_HPP_NODISCARD Result createDirectFBSurfaceEXT( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createDirectFBSurfaceEXT( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createDirectFBSurfaceEXTUnique( const VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - template - VULKAN_HPP_NODISCARD Result createScreenSurfaceQNX( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::SurfaceKHR * pSurface, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; -# ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createScreenSurfaceQNX( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createScreenSurfaceQNXUnique( const VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) const; -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - operator VkInstance() const VULKAN_HPP_NOEXCEPT - { - return m_instance; - } - - explicit operator bool() const VULKAN_HPP_NOEXCEPT - { - return m_instance != VK_NULL_HANDLE; - } - - bool operator!() const VULKAN_HPP_NOEXCEPT - { - return m_instance == VK_NULL_HANDLE; - } - - private: - VkInstance m_instance = {}; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Instance; - }; - - template <> - struct CppType - { - using Type = VULKAN_HPP_NAMESPACE::Instance; - }; - - template <> - struct isVulkanHandleType - { - static VULKAN_HPP_CONST_OR_CONSTEXPR bool value = true; - }; - - //=== VK_VERSION_1_0 === - -#ifndef VULKAN_HPP_NO_SMART_HANDLE - template - class UniqueHandleTraits - { - public: - using deleter = ObjectDestroy; - }; - using UniqueInstance = UniqueHandle; -#endif /*VULKAN_HPP_NO_SMART_HANDLE*/ - - template - VULKAN_HPP_NODISCARD Result createInstance( const VULKAN_HPP_NAMESPACE::InstanceCreateInfo * pCreateInfo, - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * pAllocator, - VULKAN_HPP_NAMESPACE::Instance * pInstance, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type - createInstance( const VULKAN_HPP_NAMESPACE::InstanceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); -# ifndef VULKAN_HPP_NO_SMART_HANDLE - template - VULKAN_HPP_NODISCARD typename ResultValueType>::type - createInstanceUnique( const VULKAN_HPP_NAMESPACE::InstanceCreateInfo & createInfo, - Optional allocator VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); -# endif /*VULKAN_HPP_NO_SMART_HANDLE*/ -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result enumerateInstanceExtensionProperties( const char * pLayerName, - uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::ExtensionProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateInstanceExtensionProperties( Optional layerName VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = ExtensionPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateInstanceExtensionProperties( Optional layerName, - ExtensionPropertiesAllocator & extensionPropertiesAllocator, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - template - VULKAN_HPP_NODISCARD Result enumerateInstanceLayerProperties( uint32_t * pPropertyCount, - VULKAN_HPP_NAMESPACE::LayerProperties * pProperties, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template , typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateInstanceLayerProperties( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); - template , - typename Dispatch = VULKAN_HPP_DEFAULT_DISPATCHER_TYPE, - typename B1 = LayerPropertiesAllocator, - typename std::enable_if::value, int>::type = 0> - VULKAN_HPP_NODISCARD typename ResultValueType>::type - enumerateInstanceLayerProperties( LayerPropertiesAllocator & layerPropertiesAllocator, Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - //=== VK_VERSION_1_1 === - - template - VULKAN_HPP_NODISCARD Result enumerateInstanceVersion( uint32_t * pApiVersion, - Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ) VULKAN_HPP_NOEXCEPT; -#ifndef VULKAN_HPP_DISABLE_ENHANCED_MODE - template - VULKAN_HPP_NODISCARD typename ResultValueType::type enumerateInstanceVersion( Dispatch const & d VULKAN_HPP_DEFAULT_DISPATCHER_ASSIGNMENT ); -#endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_hash.hpp b/src/video/khronos/vulkan/vulkan_hash.hpp deleted file mode 100644 index 369d609870194..0000000000000 --- a/src/video/khronos/vulkan/vulkan_hash.hpp +++ /dev/null @@ -1,13489 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_HASH_HPP -#define VULKAN_HASH_HPP - -#include - -namespace std -{ - //======================================= - //=== HASH structures for Flags types === - //======================================= - - template - struct hash> - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Flags const & flags ) const VULKAN_HPP_NOEXCEPT - { - return std::hash::type>{}( static_cast::type>( flags ) ); - } - }; - - //=================================== - //=== HASH structures for handles === - //=================================== - - //=== VK_VERSION_1_0 === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Instance const & instance ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( instance ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevice const & physicalDevice ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( physicalDevice ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Device const & device ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( device ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Queue const & queue ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( queue ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceMemory const & deviceMemory ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( deviceMemory ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Fence const & fence ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( fence ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Semaphore const & semaphore ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( semaphore ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Event const & event ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( event ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueryPool const & queryPool ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( queryPool ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Buffer const & buffer ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( buffer ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferView const & bufferView ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( bufferView ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Image const & image ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( image ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageView const & imageView ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( imageView ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShaderModule const & shaderModule ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( shaderModule ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCache const & pipelineCache ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( pipelineCache ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Pipeline const & pipeline ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( pipeline ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineLayout const & pipelineLayout ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( pipelineLayout ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Sampler const & sampler ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( sampler ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorPool const & descriptorPool ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( descriptorPool ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSet const & descriptorSet ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( descriptorSet ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayout const & descriptorSetLayout ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( descriptorSetLayout ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Framebuffer const & framebuffer ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( framebuffer ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPass const & renderPass ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( renderPass ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandPool const & commandPool ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( commandPool ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBuffer const & commandBuffer ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( commandBuffer ) ); - } - }; - - //=== VK_VERSION_1_1 === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion const & samplerYcbcrConversion ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( samplerYcbcrConversion ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate const & descriptorUpdateTemplate ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( descriptorUpdateTemplate ) ); - } - }; - - //=== VK_VERSION_1_3 === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PrivateDataSlot const & privateDataSlot ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( privateDataSlot ) ); - } - }; - - //=== VK_KHR_surface === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceKHR const & surfaceKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( surfaceKHR ) ); - } - }; - - //=== VK_KHR_swapchain === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SwapchainKHR const & swapchainKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( swapchainKHR ) ); - } - }; - - //=== VK_KHR_display === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayKHR const & displayKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( displayKHR ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayModeKHR const & displayModeKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( displayModeKHR ) ); - } - }; - - //=== VK_EXT_debug_report === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT const & debugReportCallbackEXT ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( debugReportCallbackEXT ) ); - } - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionKHR const & videoSessionKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( videoSessionKHR ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR const & videoSessionParametersKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( videoSessionParametersKHR ) ); - } - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CuModuleNVX const & cuModuleNVX ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( cuModuleNVX ) ); - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CuFunctionNVX const & cuFunctionNVX ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( cuFunctionNVX ) ); - } - }; - - //=== VK_EXT_debug_utils === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT const & debugUtilsMessengerEXT ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( debugUtilsMessengerEXT ) ); - } - }; - - //=== VK_KHR_acceleration_structure === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR const & accelerationStructureKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( accelerationStructureKHR ) ); - } - }; - - //=== VK_EXT_validation_cache === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ValidationCacheEXT const & validationCacheEXT ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( validationCacheEXT ) ); - } - }; - - //=== VK_NV_ray_tracing === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureNV const & accelerationStructureNV ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( accelerationStructureNV ) ); - } - }; - - //=== VK_INTEL_performance_query === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL const & performanceConfigurationINTEL ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( performanceConfigurationINTEL ) ); - } - }; - - //=== VK_KHR_deferred_host_operations === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeferredOperationKHR const & deferredOperationKHR ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( deferredOperationKHR ) ); - } - }; - - //=== VK_NV_device_generated_commands === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV const & indirectCommandsLayoutNV ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( indirectCommandsLayoutNV ) ); - } - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA const & bufferCollectionFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - return std::hash{}( static_cast( bufferCollectionFUCHSIA ) ); - } - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if 14 <= VULKAN_HPP_CPP_VERSION - //====================================== - //=== HASH structures for structures === - //====================================== - -# if !defined( VULKAN_HPP_HASH_COMBINE ) -# define VULKAN_HPP_HASH_COMBINE( seed, value ) \ - seed ^= std::hash::type>{}( value ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ) -# endif - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AabbPositionsKHR const & aabbPositionsKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.minX ); - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.minY ); - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.minZ ); - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.maxX ); - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.maxY ); - VULKAN_HPP_HASH_COMBINE( seed, aabbPositionsKHR.maxZ ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR const & accelerationStructureBuildRangeInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildRangeInfoKHR.primitiveCount ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildRangeInfoKHR.primitiveOffset ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildRangeInfoKHR.firstVertex ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildRangeInfoKHR.transformOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR const & accelerationStructureBuildSizesInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildSizesInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildSizesInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildSizesInfoKHR.accelerationStructureSize ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildSizesInfoKHR.updateScratchSize ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureBuildSizesInfoKHR.buildScratchSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR const & accelerationStructureCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.createFlags ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.offset ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.size ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.type ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoKHR.deviceAddress ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GeometryTrianglesNV const & geometryTrianglesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.vertexData ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.vertexOffset ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.vertexCount ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.vertexStride ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.vertexFormat ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.indexData ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.indexOffset ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.indexCount ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.indexType ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.transformData ); - VULKAN_HPP_HASH_COMBINE( seed, geometryTrianglesNV.transformOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GeometryAABBNV const & geometryAABBNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.aabbData ); - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.numAABBs ); - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.stride ); - VULKAN_HPP_HASH_COMBINE( seed, geometryAABBNV.offset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GeometryDataNV const & geometryDataNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, geometryDataNV.triangles ); - VULKAN_HPP_HASH_COMBINE( seed, geometryDataNV.aabbs ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GeometryNV const & geometryNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, geometryNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, geometryNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, geometryNV.geometryType ); - VULKAN_HPP_HASH_COMBINE( seed, geometryNV.geometry ); - VULKAN_HPP_HASH_COMBINE( seed, geometryNV.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV const & accelerationStructureInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.type ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.instanceCount ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.geometryCount ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInfoNV.pGeometries ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV const & accelerationStructureCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoNV.compactedSize ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureCreateInfoNV.info ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR const & accelerationStructureDeviceAddressInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureDeviceAddressInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureDeviceAddressInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureDeviceAddressInfoKHR.accelerationStructure ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TransformMatrixKHR const & transformMatrixKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - for ( size_t i = 0; i < 3; ++i ) - { - for ( size_t j = 0; j < 4; ++j ) - { - VULKAN_HPP_HASH_COMBINE( seed, transformMatrixKHR.matrix[i][j] ); - } - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureInstanceKHR const & accelerationStructureInstanceKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.transform ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.instanceCustomIndex ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.mask ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.instanceShaderBindingTableRecordOffset ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureInstanceKHR.accelerationStructureReference ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureMatrixMotionInstanceNV const & accelerationStructureMatrixMotionInstanceNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.transformT0 ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.transformT1 ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.instanceCustomIndex ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.mask ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.instanceShaderBindingTableRecordOffset ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMatrixMotionInstanceNV.accelerationStructureReference ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV const & accelerationStructureMemoryRequirementsInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMemoryRequirementsInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMemoryRequirementsInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMemoryRequirementsInfoNV.type ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMemoryRequirementsInfoNV.accelerationStructure ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInfoNV const & accelerationStructureMotionInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMotionInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMotionInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMotionInfoNV.maxInstances ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureMotionInfoNV.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SRTDataNV const & sRTDataNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.sx ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.a ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.b ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.pvx ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.sy ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.c ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.pvy ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.sz ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.pvz ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.qx ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.qy ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.qz ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.qw ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.tx ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.ty ); - VULKAN_HPP_HASH_COMBINE( seed, sRTDataNV.tz ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureSRTMotionInstanceNV const & accelerationStructureSRTMotionInstanceNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.transformT0 ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.transformT1 ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.instanceCustomIndex ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.mask ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.instanceShaderBindingTableRecordOffset ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureSRTMotionInstanceNV.accelerationStructureReference ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR const & accelerationStructureVersionInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureVersionInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureVersionInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, accelerationStructureVersionInfoKHR.pVersionData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR const & acquireNextImageInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.swapchain ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.timeout ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.fence ); - VULKAN_HPP_HASH_COMBINE( seed, acquireNextImageInfoKHR.deviceMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR const & acquireProfilingLockInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, acquireProfilingLockInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, acquireProfilingLockInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, acquireProfilingLockInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, acquireProfilingLockInfoKHR.timeout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AllocationCallbacks const & allocationCallbacks ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pUserData ); - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pfnAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pfnReallocation ); - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pfnFree ); - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pfnInternalAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, allocationCallbacks.pfnInternalFree ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AmigoProfilingSubmitInfoSEC const & amigoProfilingSubmitInfoSEC ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, amigoProfilingSubmitInfoSEC.sType ); - VULKAN_HPP_HASH_COMBINE( seed, amigoProfilingSubmitInfoSEC.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, amigoProfilingSubmitInfoSEC.firstDrawTimestamp ); - VULKAN_HPP_HASH_COMBINE( seed, amigoProfilingSubmitInfoSEC.swapBufferTimestamp ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ComponentMapping const & componentMapping ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, componentMapping.r ); - VULKAN_HPP_HASH_COMBINE( seed, componentMapping.g ); - VULKAN_HPP_HASH_COMBINE( seed, componentMapping.b ); - VULKAN_HPP_HASH_COMBINE( seed, componentMapping.a ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatProperties2ANDROID const & androidHardwareBufferFormatProperties2ANDROID ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.format ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.externalFormat ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.formatFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.samplerYcbcrConversionComponents ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.suggestedYcbcrModel ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.suggestedYcbcrRange ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.suggestedXChromaOffset ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatProperties2ANDROID.suggestedYChromaOffset ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatPropertiesANDROID const & androidHardwareBufferFormatPropertiesANDROID ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.format ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.externalFormat ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.formatFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.samplerYcbcrConversionComponents ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.suggestedYcbcrModel ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.suggestedYcbcrRange ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.suggestedXChromaOffset ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferFormatPropertiesANDROID.suggestedYChromaOffset ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID const & androidHardwareBufferPropertiesANDROID ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferPropertiesANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferPropertiesANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferPropertiesANDROID.allocationSize ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferPropertiesANDROID.memoryTypeBits ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferUsageANDROID const & androidHardwareBufferUsageANDROID ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferUsageANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferUsageANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, androidHardwareBufferUsageANDROID.androidHardwareBufferUsage ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR const & androidSurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, androidSurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, androidSurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, androidSurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, androidSurfaceCreateInfoKHR.window ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ApplicationInfo const & applicationInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, applicationInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, applicationInfo.pNext ); - for ( const char * p = applicationInfo.pApplicationName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, applicationInfo.applicationVersion ); - for ( const char * p = applicationInfo.pEngineName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, applicationInfo.engineVersion ); - VULKAN_HPP_HASH_COMBINE( seed, applicationInfo.apiVersion ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentDescription const & attachmentDescription ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.flags ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.format ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.samples ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.loadOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.storeOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.stencilLoadOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.stencilStoreOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.initialLayout ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription.finalLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentDescription2 const & attachmentDescription2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.flags ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.format ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.samples ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.loadOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.storeOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.stencilLoadOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.stencilStoreOp ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.initialLayout ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescription2.finalLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentDescriptionStencilLayout const & attachmentDescriptionStencilLayout ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescriptionStencilLayout.sType ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescriptionStencilLayout.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescriptionStencilLayout.stencilInitialLayout ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentDescriptionStencilLayout.stencilFinalLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentReference const & attachmentReference ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference.attachment ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference.layout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentReference2 const & attachmentReference2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference2.attachment ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference2.layout ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReference2.aspectMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentReferenceStencilLayout const & attachmentReferenceStencilLayout ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentReferenceStencilLayout.sType ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReferenceStencilLayout.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentReferenceStencilLayout.stencilLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentSampleCountInfoAMD const & attachmentSampleCountInfoAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleCountInfoAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleCountInfoAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleCountInfoAMD.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleCountInfoAMD.pColorAttachmentSamples ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleCountInfoAMD.depthStencilAttachmentSamples ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Extent2D const & extent2D ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, extent2D.width ); - VULKAN_HPP_HASH_COMBINE( seed, extent2D.height ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SampleLocationEXT const & sampleLocationEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationEXT.x ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationEXT.y ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT const & sampleLocationsInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.sampleLocationsPerPixel ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.sampleLocationGridSize ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.sampleLocationsCount ); - VULKAN_HPP_HASH_COMBINE( seed, sampleLocationsInfoEXT.pSampleLocations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::AttachmentSampleLocationsEXT const & attachmentSampleLocationsEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleLocationsEXT.attachmentIndex ); - VULKAN_HPP_HASH_COMBINE( seed, attachmentSampleLocationsEXT.sampleLocationsInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BaseInStructure const & baseInStructure ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, baseInStructure.sType ); - VULKAN_HPP_HASH_COMBINE( seed, baseInStructure.pNext ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BaseOutStructure const & baseOutStructure ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, baseOutStructure.sType ); - VULKAN_HPP_HASH_COMBINE( seed, baseOutStructure.pNext ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::BindAccelerationStructureMemoryInfoNV const & bindAccelerationStructureMemoryInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.accelerationStructure ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.memory ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.memoryOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.deviceIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindAccelerationStructureMemoryInfoNV.pDeviceIndices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindBufferMemoryDeviceGroupInfo const & bindBufferMemoryDeviceGroupInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryDeviceGroupInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryDeviceGroupInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryDeviceGroupInfo.deviceIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryDeviceGroupInfo.pDeviceIndices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo const & bindBufferMemoryInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryInfo.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryInfo.memory ); - VULKAN_HPP_HASH_COMBINE( seed, bindBufferMemoryInfo.memoryOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Offset2D const & offset2D ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, offset2D.x ); - VULKAN_HPP_HASH_COMBINE( seed, offset2D.y ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Rect2D const & rect2D ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rect2D.offset ); - VULKAN_HPP_HASH_COMBINE( seed, rect2D.extent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindImageMemoryDeviceGroupInfo const & bindImageMemoryDeviceGroupInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.deviceIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.pDeviceIndices ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.splitInstanceBindRegionCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryDeviceGroupInfo.pSplitInstanceBindRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindImageMemoryInfo const & bindImageMemoryInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryInfo.image ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryInfo.memory ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemoryInfo.memoryOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindImageMemorySwapchainInfoKHR const & bindImageMemorySwapchainInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemorySwapchainInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemorySwapchainInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemorySwapchainInfoKHR.swapchain ); - VULKAN_HPP_HASH_COMBINE( seed, bindImageMemorySwapchainInfoKHR.imageIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindImagePlaneMemoryInfo const & bindImagePlaneMemoryInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindImagePlaneMemoryInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindImagePlaneMemoryInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindImagePlaneMemoryInfo.planeAspect ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindIndexBufferIndirectCommandNV const & bindIndexBufferIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindIndexBufferIndirectCommandNV.bufferAddress ); - VULKAN_HPP_HASH_COMBINE( seed, bindIndexBufferIndirectCommandNV.size ); - VULKAN_HPP_HASH_COMBINE( seed, bindIndexBufferIndirectCommandNV.indexType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindShaderGroupIndirectCommandNV const & bindShaderGroupIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindShaderGroupIndirectCommandNV.groupIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseMemoryBind const & sparseMemoryBind ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseMemoryBind.resourceOffset ); - VULKAN_HPP_HASH_COMBINE( seed, sparseMemoryBind.size ); - VULKAN_HPP_HASH_COMBINE( seed, sparseMemoryBind.memory ); - VULKAN_HPP_HASH_COMBINE( seed, sparseMemoryBind.memoryOffset ); - VULKAN_HPP_HASH_COMBINE( seed, sparseMemoryBind.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseBufferMemoryBindInfo const & sparseBufferMemoryBindInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseBufferMemoryBindInfo.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, sparseBufferMemoryBindInfo.bindCount ); - VULKAN_HPP_HASH_COMBINE( seed, sparseBufferMemoryBindInfo.pBinds ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageOpaqueMemoryBindInfo const & sparseImageOpaqueMemoryBindInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageOpaqueMemoryBindInfo.image ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageOpaqueMemoryBindInfo.bindCount ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageOpaqueMemoryBindInfo.pBinds ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSubresource const & imageSubresource ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource.aspectMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource.mipLevel ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource.arrayLayer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Offset3D const & offset3D ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, offset3D.x ); - VULKAN_HPP_HASH_COMBINE( seed, offset3D.y ); - VULKAN_HPP_HASH_COMBINE( seed, offset3D.z ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Extent3D const & extent3D ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, extent3D.width ); - VULKAN_HPP_HASH_COMBINE( seed, extent3D.height ); - VULKAN_HPP_HASH_COMBINE( seed, extent3D.depth ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageMemoryBind const & sparseImageMemoryBind ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.subresource ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.offset ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.extent ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.memory ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.memoryOffset ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBind.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageMemoryBindInfo const & sparseImageMemoryBindInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBindInfo.image ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBindInfo.bindCount ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryBindInfo.pBinds ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindSparseInfo const & bindSparseInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.waitSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pWaitSemaphores ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.bufferBindCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pBufferBinds ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.imageOpaqueBindCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pImageOpaqueBinds ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.imageBindCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pImageBinds ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.signalSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, bindSparseInfo.pSignalSemaphores ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindVertexBufferIndirectCommandNV const & bindVertexBufferIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindVertexBufferIndirectCommandNV.bufferAddress ); - VULKAN_HPP_HASH_COMBINE( seed, bindVertexBufferIndirectCommandNV.size ); - VULKAN_HPP_HASH_COMBINE( seed, bindVertexBufferIndirectCommandNV.stride ); - return seed; - } - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BindVideoSessionMemoryInfoKHR const & bindVideoSessionMemoryInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.memoryBindIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.memory ); - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.memoryOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bindVideoSessionMemoryInfoKHR.memorySize ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & imageSubresourceLayers ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceLayers.aspectMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceLayers.mipLevel ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceLayers.baseArrayLayer ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceLayers.layerCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageBlit2 const & imageBlit2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.srcSubresource ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.srcOffsets[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.dstSubresource ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, imageBlit2.dstOffsets[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BlitImageInfo2 const & blitImageInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.srcImage ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.srcImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.dstImage ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.dstImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.pRegions ); - VULKAN_HPP_HASH_COMBINE( seed, blitImageInfo2.filter ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::BufferCollectionBufferCreateInfoFUCHSIA const & bufferCollectionBufferCreateInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionBufferCreateInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionBufferCreateInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionBufferCreateInfoFUCHSIA.collection ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionBufferCreateInfoFUCHSIA.index ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA const & bufferCollectionConstraintsInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.minBufferCount ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.maxBufferCount ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.minBufferCountForCamping ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.minBufferCountForDedicatedSlack ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionConstraintsInfoFUCHSIA.minBufferCountForSharedSlack ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA const & bufferCollectionCreateInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionCreateInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionCreateInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionCreateInfoFUCHSIA.collectionToken ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::BufferCollectionImageCreateInfoFUCHSIA const & bufferCollectionImageCreateInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionImageCreateInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionImageCreateInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionImageCreateInfoFUCHSIA.collection ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionImageCreateInfoFUCHSIA.index ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA const & sysmemColorSpaceFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sysmemColorSpaceFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, sysmemColorSpaceFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, sysmemColorSpaceFUCHSIA.colorSpace ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA const & bufferCollectionPropertiesFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.memoryTypeBits ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.bufferCount ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.createInfoIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.sysmemPixelFormat ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.formatFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.sysmemColorSpaceIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.samplerYcbcrConversionComponents ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.suggestedYcbcrModel ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.suggestedYcbcrRange ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.suggestedXChromaOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCollectionPropertiesFUCHSIA.suggestedYChromaOffset ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCreateInfo const & bufferCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.size ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.usage ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.sharingMode ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.queueFamilyIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCreateInfo.pQueueFamilyIndices ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA const & bufferConstraintsInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferConstraintsInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferConstraintsInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferConstraintsInfoFUCHSIA.createInfo ); - VULKAN_HPP_HASH_COMBINE( seed, bufferConstraintsInfoFUCHSIA.requiredFormatFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, bufferConstraintsInfoFUCHSIA.bufferCollectionConstraints ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCopy const & bufferCopy ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferCopy2 const & bufferCopy2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy2.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy2.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferCopy2.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferDeviceAddressCreateInfoEXT const & bufferDeviceAddressCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressCreateInfoEXT.deviceAddress ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo const & bufferDeviceAddressInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferDeviceAddressInfo.buffer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferImageCopy const & bufferImageCopy ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.bufferOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.bufferRowLength ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.bufferImageHeight ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.imageSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.imageOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy.imageExtent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferImageCopy2 const & bufferImageCopy2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.bufferOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.bufferRowLength ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.bufferImageHeight ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.imageSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.imageOffset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferImageCopy2.imageExtent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferMemoryBarrier const & bufferMemoryBarrier ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.srcQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.dstQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.offset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferMemoryBarrier2 const & bufferMemoryBarrier2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.srcStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.dstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.srcQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.dstQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.offset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryBarrier2.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 const & bufferMemoryRequirementsInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryRequirementsInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryRequirementsInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferMemoryRequirementsInfo2.buffer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferOpaqueCaptureAddressCreateInfo const & bufferOpaqueCaptureAddressCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferOpaqueCaptureAddressCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferOpaqueCaptureAddressCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferOpaqueCaptureAddressCreateInfo.opaqueCaptureAddress ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::BufferViewCreateInfo const & bufferViewCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.format ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.offset ); - VULKAN_HPP_HASH_COMBINE( seed, bufferViewCreateInfo.range ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT const & calibratedTimestampInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, calibratedTimestampInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, calibratedTimestampInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, calibratedTimestampInfoEXT.timeDomain ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CheckpointData2NV const & checkpointData2NV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, checkpointData2NV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointData2NV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointData2NV.stage ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointData2NV.pCheckpointMarker ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CheckpointDataNV const & checkpointDataNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, checkpointDataNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointDataNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointDataNV.stage ); - VULKAN_HPP_HASH_COMBINE( seed, checkpointDataNV.pCheckpointMarker ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ClearDepthStencilValue const & clearDepthStencilValue ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, clearDepthStencilValue.depth ); - VULKAN_HPP_HASH_COMBINE( seed, clearDepthStencilValue.stencil ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ClearRect const & clearRect ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, clearRect.rect ); - VULKAN_HPP_HASH_COMBINE( seed, clearRect.baseArrayLayer ); - VULKAN_HPP_HASH_COMBINE( seed, clearRect.layerCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CoarseSampleLocationNV const & coarseSampleLocationNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleLocationNV.pixelX ); - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleLocationNV.pixelY ); - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleLocationNV.sample ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV const & coarseSampleOrderCustomNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleOrderCustomNV.shadingRate ); - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleOrderCustomNV.sampleCount ); - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleOrderCustomNV.sampleLocationCount ); - VULKAN_HPP_HASH_COMBINE( seed, coarseSampleOrderCustomNV.pSampleLocations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo const & commandBufferAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferAllocateInfo.commandPool ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferAllocateInfo.level ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferAllocateInfo.commandBufferCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceInfo const & commandBufferInheritanceInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.renderPass ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.subpass ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.framebuffer ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.occlusionQueryEnable ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.queryFlags ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceInfo.pipelineStatistics ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo const & commandBufferBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferBeginInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferBeginInfo.pInheritanceInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceConditionalRenderingInfoEXT const & commandBufferInheritanceConditionalRenderingInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceConditionalRenderingInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceConditionalRenderingInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceConditionalRenderingInfoEXT.conditionalRenderingEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceRenderPassTransformInfoQCOM const & commandBufferInheritanceRenderPassTransformInfoQCOM ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderPassTransformInfoQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderPassTransformInfoQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderPassTransformInfoQCOM.transform ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderPassTransformInfoQCOM.renderArea ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceRenderingInfo const & commandBufferInheritanceRenderingInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.viewMask ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.pColorAttachmentFormats ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.depthAttachmentFormat ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.stencilAttachmentFormat ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceRenderingInfo.rasterizationSamples ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Viewport const & viewport ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, viewport.x ); - VULKAN_HPP_HASH_COMBINE( seed, viewport.y ); - VULKAN_HPP_HASH_COMBINE( seed, viewport.width ); - VULKAN_HPP_HASH_COMBINE( seed, viewport.height ); - VULKAN_HPP_HASH_COMBINE( seed, viewport.minDepth ); - VULKAN_HPP_HASH_COMBINE( seed, viewport.maxDepth ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceViewportScissorInfoNV const & commandBufferInheritanceViewportScissorInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceViewportScissorInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceViewportScissorInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceViewportScissorInfoNV.viewportScissor2D ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceViewportScissorInfoNV.viewportDepthCount ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferInheritanceViewportScissorInfoNV.pViewportDepths ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandBufferSubmitInfo const & commandBufferSubmitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandBufferSubmitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferSubmitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferSubmitInfo.commandBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, commandBufferSubmitInfo.deviceMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo const & commandPoolCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, commandPoolCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, commandPoolCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, commandPoolCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, commandPoolCreateInfo.queueFamilyIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SpecializationMapEntry const & specializationMapEntry ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, specializationMapEntry.constantID ); - VULKAN_HPP_HASH_COMBINE( seed, specializationMapEntry.offset ); - VULKAN_HPP_HASH_COMBINE( seed, specializationMapEntry.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SpecializationInfo const & specializationInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, specializationInfo.mapEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, specializationInfo.pMapEntries ); - VULKAN_HPP_HASH_COMBINE( seed, specializationInfo.dataSize ); - VULKAN_HPP_HASH_COMBINE( seed, specializationInfo.pData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo const & pipelineShaderStageCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.stage ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.module ); - for ( const char * p = pipelineShaderStageCreateInfo.pName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageCreateInfo.pSpecializationInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo const & computePipelineCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.stage ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.layout ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.basePipelineHandle ); - VULKAN_HPP_HASH_COMBINE( seed, computePipelineCreateInfo.basePipelineIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT const & conditionalRenderingBeginInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, conditionalRenderingBeginInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, conditionalRenderingBeginInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, conditionalRenderingBeginInfoEXT.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, conditionalRenderingBeginInfoEXT.offset ); - VULKAN_HPP_HASH_COMBINE( seed, conditionalRenderingBeginInfoEXT.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ConformanceVersion const & conformanceVersion ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, conformanceVersion.major ); - VULKAN_HPP_HASH_COMBINE( seed, conformanceVersion.minor ); - VULKAN_HPP_HASH_COMBINE( seed, conformanceVersion.subminor ); - VULKAN_HPP_HASH_COMBINE( seed, conformanceVersion.patch ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesNV const & cooperativeMatrixPropertiesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.MSize ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.NSize ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.KSize ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.AType ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.BType ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.CType ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.DType ); - VULKAN_HPP_HASH_COMBINE( seed, cooperativeMatrixPropertiesNV.scope ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR const & copyAccelerationStructureInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyAccelerationStructureInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyAccelerationStructureInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyAccelerationStructureInfoKHR.src ); - VULKAN_HPP_HASH_COMBINE( seed, copyAccelerationStructureInfoKHR.dst ); - VULKAN_HPP_HASH_COMBINE( seed, copyAccelerationStructureInfoKHR.mode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyBufferInfo2 const & copyBufferInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.srcBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.dstBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferInfo2.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 const & copyBufferToImageInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.srcBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.dstImage ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.dstImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, copyBufferToImageInfo2.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyCommandTransformInfoQCOM const & copyCommandTransformInfoQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyCommandTransformInfoQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyCommandTransformInfoQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyCommandTransformInfoQCOM.transform ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyDescriptorSet const & copyDescriptorSet ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.srcSet ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.srcBinding ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.srcArrayElement ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.dstSet ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.dstBinding ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.dstArrayElement ); - VULKAN_HPP_HASH_COMBINE( seed, copyDescriptorSet.descriptorCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageCopy2 const & imageCopy2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.srcSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.dstSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy2.extent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyImageInfo2 const & copyImageInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.srcImage ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.srcImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.dstImage ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.dstImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageInfo2.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 const & copyImageToBufferInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.srcImage ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.srcImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.dstBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, copyImageToBufferInfo2.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX const & cuFunctionCreateInfoNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, cuFunctionCreateInfoNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, cuFunctionCreateInfoNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, cuFunctionCreateInfoNVX.module ); - for ( const char * p = cuFunctionCreateInfoNVX.pName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX const & cuLaunchInfoNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.function ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.gridDimX ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.gridDimY ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.gridDimZ ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.blockDimX ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.blockDimY ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.blockDimZ ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.sharedMemBytes ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.paramCount ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.pParams ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.extraCount ); - VULKAN_HPP_HASH_COMBINE( seed, cuLaunchInfoNVX.pExtras ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX const & cuModuleCreateInfoNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, cuModuleCreateInfoNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, cuModuleCreateInfoNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, cuModuleCreateInfoNVX.dataSize ); - VULKAN_HPP_HASH_COMBINE( seed, cuModuleCreateInfoNVX.pData ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::D3D12FenceSubmitInfoKHR const & d3D12FenceSubmitInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.waitSemaphoreValuesCount ); - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.pWaitSemaphoreValues ); - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.signalSemaphoreValuesCount ); - VULKAN_HPP_HASH_COMBINE( seed, d3D12FenceSubmitInfoKHR.pSignalSemaphoreValues ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT const & debugMarkerMarkerInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerMarkerInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerMarkerInfoEXT.pNext ); - for ( const char * p = debugMarkerMarkerInfoEXT.pMarkerName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - for ( size_t i = 0; i < 4; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerMarkerInfoEXT.color[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT const & debugMarkerObjectNameInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectNameInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectNameInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectNameInfoEXT.objectType ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectNameInfoEXT.object ); - for ( const char * p = debugMarkerObjectNameInfoEXT.pObjectName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT const & debugMarkerObjectTagInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.objectType ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.object ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.tagName ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.tagSize ); - VULKAN_HPP_HASH_COMBINE( seed, debugMarkerObjectTagInfoEXT.pTag ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT const & debugReportCallbackCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugReportCallbackCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugReportCallbackCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugReportCallbackCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, debugReportCallbackCreateInfoEXT.pfnCallback ); - VULKAN_HPP_HASH_COMBINE( seed, debugReportCallbackCreateInfoEXT.pUserData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT const & debugUtilsLabelEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsLabelEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsLabelEXT.pNext ); - for ( const char * p = debugUtilsLabelEXT.pLabelName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - for ( size_t i = 0; i < 4; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsLabelEXT.color[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT const & debugUtilsObjectNameInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectNameInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectNameInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectNameInfoEXT.objectType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectNameInfoEXT.objectHandle ); - for ( const char * p = debugUtilsObjectNameInfoEXT.pObjectName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT const & debugUtilsMessengerCallbackDataEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.flags ); - for ( const char * p = debugUtilsMessengerCallbackDataEXT.pMessageIdName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.messageIdNumber ); - for ( const char * p = debugUtilsMessengerCallbackDataEXT.pMessage; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.queueLabelCount ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.pQueueLabels ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.cmdBufLabelCount ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.pCmdBufLabels ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.objectCount ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCallbackDataEXT.pObjects ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT const & debugUtilsMessengerCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.messageSeverity ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.messageType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.pfnUserCallback ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsMessengerCreateInfoEXT.pUserData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT const & debugUtilsObjectTagInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.objectType ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.objectHandle ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.tagName ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.tagSize ); - VULKAN_HPP_HASH_COMBINE( seed, debugUtilsObjectTagInfoEXT.pTag ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DedicatedAllocationBufferCreateInfoNV const & dedicatedAllocationBufferCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationBufferCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationBufferCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationBufferCreateInfoNV.dedicatedAllocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DedicatedAllocationImageCreateInfoNV const & dedicatedAllocationImageCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationImageCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationImageCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationImageCreateInfoNV.dedicatedAllocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DedicatedAllocationMemoryAllocateInfoNV const & dedicatedAllocationMemoryAllocateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationMemoryAllocateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationMemoryAllocateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationMemoryAllocateInfoNV.image ); - VULKAN_HPP_HASH_COMBINE( seed, dedicatedAllocationMemoryAllocateInfoNV.buffer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryBarrier2 const & memoryBarrier2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.srcStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.dstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier2.dstAccessMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSubresourceRange const & imageSubresourceRange ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceRange.aspectMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceRange.baseMipLevel ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceRange.levelCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceRange.baseArrayLayer ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresourceRange.layerCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageMemoryBarrier2 const & imageMemoryBarrier2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.srcStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.dstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.oldLayout ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.newLayout ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.srcQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.dstQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.image ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier2.subresourceRange ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DependencyInfo const & dependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.dependencyFlags ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.memoryBarrierCount ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.pMemoryBarriers ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.bufferMemoryBarrierCount ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.pBufferMemoryBarriers ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.imageMemoryBarrierCount ); - VULKAN_HPP_HASH_COMBINE( seed, dependencyInfo.pImageMemoryBarriers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorBufferInfo const & descriptorBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorBufferInfo.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorBufferInfo.offset ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorBufferInfo.range ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorImageInfo const & descriptorImageInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorImageInfo.sampler ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorImageInfo.imageView ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorImageInfo.imageLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorPoolSize const & descriptorPoolSize ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolSize.type ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolSize.descriptorCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo const & descriptorPoolCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.maxSets ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.poolSizeCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolCreateInfo.pPoolSizes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorPoolInlineUniformBlockCreateInfo const & descriptorPoolInlineUniformBlockCreateInfo ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolInlineUniformBlockCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolInlineUniformBlockCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorPoolInlineUniformBlockCreateInfo.maxInlineUniformBlockBindings ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo const & descriptorSetAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetAllocateInfo.descriptorPool ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetAllocateInfo.descriptorSetCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetAllocateInfo.pSetLayouts ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE const & descriptorSetBindingReferenceVALVE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetBindingReferenceVALVE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetBindingReferenceVALVE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetBindingReferenceVALVE.descriptorSetLayout ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetBindingReferenceVALVE.binding ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBinding const & descriptorSetLayoutBinding ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBinding.binding ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBinding.descriptorType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBinding.descriptorCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBinding.stageFlags ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBinding.pImmutableSamplers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBindingFlagsCreateInfo const & descriptorSetLayoutBindingFlagsCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBindingFlagsCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBindingFlagsCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBindingFlagsCreateInfo.bindingCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutBindingFlagsCreateInfo.pBindingFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo const & descriptorSetLayoutCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutCreateInfo.bindingCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutCreateInfo.pBindings ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE const & descriptorSetLayoutHostMappingInfoVALVE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutHostMappingInfoVALVE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutHostMappingInfoVALVE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutHostMappingInfoVALVE.descriptorOffset ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutHostMappingInfoVALVE.descriptorSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport const & descriptorSetLayoutSupport ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutSupport.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutSupport.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetLayoutSupport.supported ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetVariableDescriptorCountAllocateInfo const & descriptorSetVariableDescriptorCountAllocateInfo ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountAllocateInfo.descriptorSetCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountAllocateInfo.pDescriptorCounts ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorSetVariableDescriptorCountLayoutSupport const & descriptorSetVariableDescriptorCountLayoutSupport ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountLayoutSupport.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountLayoutSupport.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorSetVariableDescriptorCountLayoutSupport.maxVariableDescriptorCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateEntry const & descriptorUpdateTemplateEntry ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.dstBinding ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.dstArrayElement ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.descriptorCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.descriptorType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.offset ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateEntry.stride ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & descriptorUpdateTemplateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.descriptorUpdateEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.pDescriptorUpdateEntries ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.templateType ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.descriptorSetLayout ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.pipelineLayout ); - VULKAN_HPP_HASH_COMBINE( seed, descriptorUpdateTemplateCreateInfo.set ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements const & deviceBufferMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceBufferMemoryRequirements.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceBufferMemoryRequirements.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceBufferMemoryRequirements.pCreateInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceQueueCreateInfo const & deviceQueueCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.queueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.queueCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueCreateInfo.pQueuePriorities ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures const & physicalDeviceFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.robustBufferAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.fullDrawIndexUint32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.imageCubeArray ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.independentBlend ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.geometryShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.tessellationShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sampleRateShading ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.dualSrcBlend ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.logicOp ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.multiDrawIndirect ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.drawIndirectFirstInstance ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.depthClamp ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.depthBiasClamp ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.fillModeNonSolid ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.depthBounds ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.wideLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.largePoints ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.alphaToOne ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.multiViewport ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.samplerAnisotropy ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.textureCompressionETC2 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.textureCompressionASTC_LDR ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.textureCompressionBC ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.occlusionQueryPrecise ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.pipelineStatisticsQuery ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.vertexPipelineStoresAndAtomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.fragmentStoresAndAtomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderTessellationAndGeometryPointSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderImageGatherExtended ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageImageExtendedFormats ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageImageMultisample ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageImageReadWithoutFormat ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageImageWriteWithoutFormat ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderUniformBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderSampledImageArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderStorageImageArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderClipDistance ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderCullDistance ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderInt64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderInt16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderResourceResidency ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.shaderResourceMinLod ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseBinding ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidencyBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidencyImage2D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidencyImage3D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidency2Samples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidency4Samples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidency8Samples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidency16Samples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.sparseResidencyAliased ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.variableMultisampleRate ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures.inheritedQueries ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceCreateInfo const & deviceCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.queueCreateInfoCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.pQueueCreateInfos ); - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.enabledLayerCount ); - for ( size_t i = 0; i < deviceCreateInfo.enabledLayerCount; ++i ) - { - for ( const char * p = deviceCreateInfo.ppEnabledLayerNames[i]; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - } - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.enabledExtensionCount ); - for ( size_t i = 0; i < deviceCreateInfo.enabledExtensionCount; ++i ) - { - for ( const char * p = deviceCreateInfo.ppEnabledExtensionNames[i]; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - } - VULKAN_HPP_HASH_COMBINE( seed, deviceCreateInfo.pEnabledFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DeviceDeviceMemoryReportCreateInfoEXT const & deviceDeviceMemoryReportCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceDeviceMemoryReportCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDeviceMemoryReportCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDeviceMemoryReportCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDeviceMemoryReportCreateInfoEXT.pfnUserCallback ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDeviceMemoryReportCreateInfoEXT.pUserData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceDiagnosticsConfigCreateInfoNV const & deviceDiagnosticsConfigCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceDiagnosticsConfigCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDiagnosticsConfigCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceDiagnosticsConfigCreateInfoNV.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT const & deviceEventInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceEventInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceEventInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceEventInfoEXT.deviceEvent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupBindSparseInfo const & deviceGroupBindSparseInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupBindSparseInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupBindSparseInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupBindSparseInfo.resourceDeviceIndex ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupBindSparseInfo.memoryDeviceIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupCommandBufferBeginInfo const & deviceGroupCommandBufferBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupCommandBufferBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupCommandBufferBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupCommandBufferBeginInfo.deviceMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupDeviceCreateInfo const & deviceGroupDeviceCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupDeviceCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupDeviceCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupDeviceCreateInfo.physicalDeviceCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupDeviceCreateInfo.pPhysicalDevices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR const & deviceGroupPresentCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentCapabilitiesKHR.pNext ); - for ( size_t i = 0; i < VK_MAX_DEVICE_GROUP_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentCapabilitiesKHR.presentMask[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentCapabilitiesKHR.modes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupPresentInfoKHR const & deviceGroupPresentInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentInfoKHR.swapchainCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentInfoKHR.pDeviceMasks ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupPresentInfoKHR.mode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupRenderPassBeginInfo const & deviceGroupRenderPassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupRenderPassBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupRenderPassBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupRenderPassBeginInfo.deviceMask ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupRenderPassBeginInfo.deviceRenderAreaCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupRenderPassBeginInfo.pDeviceRenderAreas ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupSubmitInfo const & deviceGroupSubmitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.waitSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.pWaitSemaphoreDeviceIndices ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.commandBufferCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.pCommandBufferDeviceMasks ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.signalSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSubmitInfo.pSignalSemaphoreDeviceIndices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceGroupSwapchainCreateInfoKHR const & deviceGroupSwapchainCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSwapchainCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSwapchainCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceGroupSwapchainCreateInfoKHR.modes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageCreateInfo const & imageCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.imageType ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.format ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.extent ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.mipLevels ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.arrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.samples ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.tiling ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.usage ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.sharingMode ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.queueFamilyIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.pQueueFamilyIndices ); - VULKAN_HPP_HASH_COMBINE( seed, imageCreateInfo.initialLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements const & deviceImageMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceImageMemoryRequirements.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceImageMemoryRequirements.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceImageMemoryRequirements.pCreateInfo ); - VULKAN_HPP_HASH_COMBINE( seed, deviceImageMemoryRequirements.planeAspect ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo const & deviceMemoryOpaqueCaptureAddressInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOpaqueCaptureAddressInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOpaqueCaptureAddressInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOpaqueCaptureAddressInfo.memory ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DeviceMemoryOverallocationCreateInfoAMD const & deviceMemoryOverallocationCreateInfoAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOverallocationCreateInfoAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOverallocationCreateInfoAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryOverallocationCreateInfoAMD.overallocationBehavior ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceMemoryReportCallbackDataEXT const & deviceMemoryReportCallbackDataEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.type ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.memoryObjectId ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.size ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.objectType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.objectHandle ); - VULKAN_HPP_HASH_COMBINE( seed, deviceMemoryReportCallbackDataEXT.heapIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DevicePrivateDataCreateInfo const & devicePrivateDataCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, devicePrivateDataCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, devicePrivateDataCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, devicePrivateDataCreateInfo.privateDataSlotRequestCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DeviceQueueGlobalPriorityCreateInfoKHR const & deviceQueueGlobalPriorityCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueGlobalPriorityCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueGlobalPriorityCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueGlobalPriorityCreateInfoKHR.globalPriority ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 const & deviceQueueInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueInfo2.flags ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueInfo2.queueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, deviceQueueInfo2.queueIndex ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT const & directFBSurfaceCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, directFBSurfaceCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, directFBSurfaceCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, directFBSurfaceCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, directFBSurfaceCreateInfoEXT.dfb ); - VULKAN_HPP_HASH_COMBINE( seed, directFBSurfaceCreateInfoEXT.surface ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DispatchIndirectCommand const & dispatchIndirectCommand ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, dispatchIndirectCommand.x ); - VULKAN_HPP_HASH_COMBINE( seed, dispatchIndirectCommand.y ); - VULKAN_HPP_HASH_COMBINE( seed, dispatchIndirectCommand.z ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT const & displayEventInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayEventInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayEventInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayEventInfoEXT.displayEvent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR const & displayModeParametersKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayModeParametersKHR.visibleRegion ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeParametersKHR.refreshRate ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR const & displayModeCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayModeCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeCreateInfoKHR.parameters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR const & displayModePropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayModePropertiesKHR.displayMode ); - VULKAN_HPP_HASH_COMBINE( seed, displayModePropertiesKHR.parameters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayModeProperties2KHR const & displayModeProperties2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayModeProperties2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeProperties2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayModeProperties2KHR.displayModeProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::DisplayNativeHdrSurfaceCapabilitiesAMD const & displayNativeHdrSurfaceCapabilitiesAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayNativeHdrSurfaceCapabilitiesAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayNativeHdrSurfaceCapabilitiesAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayNativeHdrSurfaceCapabilitiesAMD.localDimmingSupport ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR const & displayPlaneCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.supportedAlpha ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.minSrcPosition ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.maxSrcPosition ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.minSrcExtent ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.maxSrcExtent ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.minDstPosition ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.maxDstPosition ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.minDstExtent ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilitiesKHR.maxDstExtent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR const & displayPlaneCapabilities2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilities2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilities2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneCapabilities2KHR.capabilities ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR const & displayPlaneInfo2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneInfo2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneInfo2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneInfo2KHR.mode ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneInfo2KHR.planeIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR const & displayPlanePropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPlanePropertiesKHR.currentDisplay ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlanePropertiesKHR.currentStackIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPlaneProperties2KHR const & displayPlaneProperties2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneProperties2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneProperties2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayPlaneProperties2KHR.displayPlaneProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT const & displayPowerInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPowerInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayPowerInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayPowerInfoEXT.powerState ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPresentInfoKHR const & displayPresentInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPresentInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayPresentInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayPresentInfoKHR.srcRect ); - VULKAN_HPP_HASH_COMBINE( seed, displayPresentInfoKHR.dstRect ); - VULKAN_HPP_HASH_COMBINE( seed, displayPresentInfoKHR.persistent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR const & displayPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.display ); - for ( const char * p = displayPropertiesKHR.displayName; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.physicalDimensions ); - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.physicalResolution ); - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.supportedTransforms ); - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.planeReorderPossible ); - VULKAN_HPP_HASH_COMBINE( seed, displayPropertiesKHR.persistentContent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplayProperties2KHR const & displayProperties2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displayProperties2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displayProperties2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displayProperties2KHR.displayProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR const & displaySurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.displayMode ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.planeIndex ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.planeStackIndex ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.transform ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.globalAlpha ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.alphaMode ); - VULKAN_HPP_HASH_COMBINE( seed, displaySurfaceCreateInfoKHR.imageExtent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrawIndexedIndirectCommand const & drawIndexedIndirectCommand ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drawIndexedIndirectCommand.indexCount ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndexedIndirectCommand.instanceCount ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndexedIndirectCommand.firstIndex ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndexedIndirectCommand.vertexOffset ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndexedIndirectCommand.firstInstance ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrawIndirectCommand const & drawIndirectCommand ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drawIndirectCommand.vertexCount ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndirectCommand.instanceCount ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndirectCommand.firstVertex ); - VULKAN_HPP_HASH_COMBINE( seed, drawIndirectCommand.firstInstance ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrawMeshTasksIndirectCommandEXT const & drawMeshTasksIndirectCommandEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drawMeshTasksIndirectCommandEXT.groupCountX ); - VULKAN_HPP_HASH_COMBINE( seed, drawMeshTasksIndirectCommandEXT.groupCountY ); - VULKAN_HPP_HASH_COMBINE( seed, drawMeshTasksIndirectCommandEXT.groupCountZ ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrawMeshTasksIndirectCommandNV const & drawMeshTasksIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drawMeshTasksIndirectCommandNV.taskCount ); - VULKAN_HPP_HASH_COMBINE( seed, drawMeshTasksIndirectCommandNV.firstTask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrmFormatModifierProperties2EXT const & drmFormatModifierProperties2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierProperties2EXT.drmFormatModifier ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierProperties2EXT.drmFormatModifierPlaneCount ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierProperties2EXT.drmFormatModifierTilingFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesEXT const & drmFormatModifierPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesEXT.drmFormatModifier ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesEXT.drmFormatModifierPlaneCount ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesEXT.drmFormatModifierTilingFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesList2EXT const & drmFormatModifierPropertiesList2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesList2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesList2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesList2EXT.drmFormatModifierCount ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesList2EXT.pDrmFormatModifierProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesListEXT const & drmFormatModifierPropertiesListEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesListEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesListEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesListEXT.drmFormatModifierCount ); - VULKAN_HPP_HASH_COMBINE( seed, drmFormatModifierPropertiesListEXT.pDrmFormatModifierProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::EventCreateInfo const & eventCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, eventCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, eventCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, eventCreateInfo.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportFenceCreateInfo const & exportFenceCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportFenceCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceCreateInfo.handleTypes ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportFenceWin32HandleInfoKHR const & exportFenceWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportFenceWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceWin32HandleInfoKHR.pAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceWin32HandleInfoKHR.dwAccess ); - VULKAN_HPP_HASH_COMBINE( seed, exportFenceWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMemoryAllocateInfo const & exportMemoryAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfo.handleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMemoryAllocateInfoNV const & exportMemoryAllocateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryAllocateInfoNV.handleTypes ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMemoryWin32HandleInfoKHR const & exportMemoryWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoKHR.pAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoKHR.dwAccess ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMemoryWin32HandleInfoNV const & exportMemoryWin32HandleInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoNV.pAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, exportMemoryWin32HandleInfoNV.dwAccess ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalBufferInfoEXT const & exportMetalBufferInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalBufferInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalBufferInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalBufferInfoEXT.memory ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalBufferInfoEXT.mtlBuffer ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalCommandQueueInfoEXT const & exportMetalCommandQueueInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalCommandQueueInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalCommandQueueInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalCommandQueueInfoEXT.queue ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalCommandQueueInfoEXT.mtlCommandQueue ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalDeviceInfoEXT const & exportMetalDeviceInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalDeviceInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalDeviceInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalDeviceInfoEXT.mtlDevice ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalIOSurfaceInfoEXT const & exportMetalIOSurfaceInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalIOSurfaceInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalIOSurfaceInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalIOSurfaceInfoEXT.image ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalIOSurfaceInfoEXT.ioSurface ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalObjectCreateInfoEXT const & exportMetalObjectCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalObjectCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalObjectCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalObjectCreateInfoEXT.exportObjectType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT const & exportMetalObjectsInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalObjectsInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalObjectsInfoEXT.pNext ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalSharedEventInfoEXT const & exportMetalSharedEventInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalSharedEventInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalSharedEventInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalSharedEventInfoEXT.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalSharedEventInfoEXT.event ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalSharedEventInfoEXT.mtlSharedEvent ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportMetalTextureInfoEXT const & exportMetalTextureInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.image ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.imageView ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.bufferView ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.plane ); - VULKAN_HPP_HASH_COMBINE( seed, exportMetalTextureInfoEXT.mtlTexture ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportSemaphoreCreateInfo const & exportSemaphoreCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreCreateInfo.handleTypes ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExportSemaphoreWin32HandleInfoKHR const & exportSemaphoreWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreWin32HandleInfoKHR.pAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreWin32HandleInfoKHR.dwAccess ); - VULKAN_HPP_HASH_COMBINE( seed, exportSemaphoreWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExtensionProperties const & extensionProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - for ( size_t i = 0; i < VK_MAX_EXTENSION_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, extensionProperties.extensionName[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, extensionProperties.specVersion ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalMemoryProperties const & externalMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryProperties.externalMemoryFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryProperties.exportFromImportedHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryProperties.compatibleHandleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalBufferProperties const & externalBufferProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalBufferProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalBufferProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalBufferProperties.externalMemoryProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalFenceProperties const & externalFenceProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalFenceProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalFenceProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalFenceProperties.exportFromImportedHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalFenceProperties.compatibleHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalFenceProperties.externalFenceFeatures ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalFormatANDROID const & externalFormatANDROID ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalFormatANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalFormatANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalFormatANDROID.externalFormat ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalImageFormatProperties const & externalImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatProperties.externalMemoryProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageFormatProperties const & imageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties.maxExtent ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties.maxMipLevels ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties.maxArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties.sampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties.maxResourceSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV const & externalImageFormatPropertiesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatPropertiesNV.imageFormatProperties ); - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatPropertiesNV.externalMemoryFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatPropertiesNV.exportFromImportedHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalImageFormatPropertiesNV.compatibleHandleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalMemoryBufferCreateInfo const & externalMemoryBufferCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryBufferCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryBufferCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryBufferCreateInfo.handleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalMemoryImageCreateInfo const & externalMemoryImageCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfo.handleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalMemoryImageCreateInfoNV const & externalMemoryImageCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalMemoryImageCreateInfoNV.handleTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties const & externalSemaphoreProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, externalSemaphoreProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, externalSemaphoreProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, externalSemaphoreProperties.exportFromImportedHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalSemaphoreProperties.compatibleHandleTypes ); - VULKAN_HPP_HASH_COMBINE( seed, externalSemaphoreProperties.externalSemaphoreFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FenceCreateInfo const & fenceCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, fenceCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, fenceCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, fenceCreateInfo.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR const & fenceGetFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, fenceGetFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetFdInfoKHR.fence ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetFdInfoKHR.handleType ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR const & fenceGetWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, fenceGetWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetWin32HandleInfoKHR.fence ); - VULKAN_HPP_HASH_COMBINE( seed, fenceGetWin32HandleInfoKHR.handleType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FilterCubicImageViewImageFormatPropertiesEXT const & filterCubicImageViewImageFormatPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, filterCubicImageViewImageFormatPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, filterCubicImageViewImageFormatPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, filterCubicImageViewImageFormatPropertiesEXT.filterCubic ); - VULKAN_HPP_HASH_COMBINE( seed, filterCubicImageViewImageFormatPropertiesEXT.filterCubicMinmax ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FormatProperties const & formatProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, formatProperties.linearTilingFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties.optimalTilingFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties.bufferFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FormatProperties2 const & formatProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, formatProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties2.formatProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FormatProperties3 const & formatProperties3 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, formatProperties3.sType ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties3.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties3.linearTilingFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties3.optimalTilingFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, formatProperties3.bufferFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FragmentShadingRateAttachmentInfoKHR const & fragmentShadingRateAttachmentInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, fragmentShadingRateAttachmentInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, fragmentShadingRateAttachmentInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, fragmentShadingRateAttachmentInfoKHR.pFragmentShadingRateAttachment ); - VULKAN_HPP_HASH_COMBINE( seed, fragmentShadingRateAttachmentInfoKHR.shadingRateAttachmentTexelSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo const & framebufferAttachmentImageInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.usage ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.width ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.height ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.layerCount ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.viewFormatCount ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentImageInfo.pViewFormats ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FramebufferAttachmentsCreateInfo const & framebufferAttachmentsCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentsCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentsCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentsCreateInfo.attachmentImageInfoCount ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferAttachmentsCreateInfo.pAttachmentImageInfos ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FramebufferCreateInfo const & framebufferCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.renderPass ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.pAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.width ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.height ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferCreateInfo.layers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::FramebufferMixedSamplesCombinationNV const & framebufferMixedSamplesCombinationNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.coverageReductionMode ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.rasterizationSamples ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.depthStencilSamples ); - VULKAN_HPP_HASH_COMBINE( seed, framebufferMixedSamplesCombinationNV.colorSamples ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::IndirectCommandsStreamNV const & indirectCommandsStreamNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsStreamNV.buffer ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsStreamNV.offset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV const & generatedCommandsInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.pipeline ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.indirectCommandsLayout ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.streamCount ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.pStreams ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sequencesCount ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.preprocessBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.preprocessOffset ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.preprocessSize ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sequencesCountBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sequencesCountOffset ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sequencesIndexBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsInfoNV.sequencesIndexOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV const & generatedCommandsMemoryRequirementsInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.pipeline ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.indirectCommandsLayout ); - VULKAN_HPP_HASH_COMBINE( seed, generatedCommandsMemoryRequirementsInfoNV.maxSequencesCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VertexInputBindingDescription const & vertexInputBindingDescription ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription.binding ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription.stride ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription.inputRate ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription const & vertexInputAttributeDescription ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription.location ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription.binding ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription.format ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription.offset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo const & pipelineVertexInputStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.vertexBindingDescriptionCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.pVertexBindingDescriptions ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.vertexAttributeDescriptionCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputStateCreateInfo.pVertexAttributeDescriptions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo const & pipelineInputAssemblyStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineInputAssemblyStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInputAssemblyStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInputAssemblyStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInputAssemblyStateCreateInfo.topology ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInputAssemblyStateCreateInfo.primitiveRestartEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo const & pipelineTessellationStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationStateCreateInfo.patchControlPoints ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo const & pipelineViewportStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.viewportCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.pViewports ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.scissorCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportStateCreateInfo.pScissors ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo const & pipelineRasterizationStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.depthClampEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.rasterizerDiscardEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.polygonMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.cullMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.frontFace ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.depthBiasEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.depthBiasConstantFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.depthBiasClamp ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.depthBiasSlopeFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateCreateInfo.lineWidth ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo const & pipelineMultisampleStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.rasterizationSamples ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.sampleShadingEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.minSampleShading ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.pSampleMask ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.alphaToCoverageEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineMultisampleStateCreateInfo.alphaToOneEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::StencilOpState const & stencilOpState ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.failOp ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.passOp ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.depthFailOp ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.compareOp ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.compareMask ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.writeMask ); - VULKAN_HPP_HASH_COMBINE( seed, stencilOpState.reference ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo const & pipelineDepthStencilStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.depthTestEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.depthWriteEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.depthCompareOp ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.depthBoundsTestEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.stencilTestEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.front ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.back ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.minDepthBounds ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDepthStencilStateCreateInfo.maxDepthBounds ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineColorBlendAttachmentState const & pipelineColorBlendAttachmentState ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.blendEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.srcColorBlendFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.dstColorBlendFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.colorBlendOp ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.srcAlphaBlendFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.dstAlphaBlendFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.alphaBlendOp ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAttachmentState.colorWriteMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo const & pipelineColorBlendStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.logicOpEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.logicOp ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.pAttachments ); - for ( size_t i = 0; i < 4; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendStateCreateInfo.blendConstants[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo const & pipelineDynamicStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineDynamicStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDynamicStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDynamicStateCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDynamicStateCreateInfo.dynamicStateCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDynamicStateCreateInfo.pDynamicStates ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo const & graphicsPipelineCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.stageCount ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pStages ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pVertexInputState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pInputAssemblyState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pTessellationState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pViewportState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pRasterizationState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pMultisampleState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pDepthStencilState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pColorBlendState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.pDynamicState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.layout ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.renderPass ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.subpass ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.basePipelineHandle ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineCreateInfo.basePipelineIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryCreateInfoEXT const & graphicsPipelineLibraryCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineLibraryCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineLibraryCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineLibraryCreateInfoEXT.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::GraphicsShaderGroupCreateInfoNV const & graphicsShaderGroupCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.stageCount ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.pStages ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.pVertexInputState ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsShaderGroupCreateInfoNV.pTessellationState ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::GraphicsPipelineShaderGroupsCreateInfoNV const & graphicsPipelineShaderGroupsCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.groupCount ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.pGroups ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.pipelineCount ); - VULKAN_HPP_HASH_COMBINE( seed, graphicsPipelineShaderGroupsCreateInfoNV.pPipelines ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::XYColorEXT const & xYColorEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, xYColorEXT.x ); - VULKAN_HPP_HASH_COMBINE( seed, xYColorEXT.y ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::HdrMetadataEXT const & hdrMetadataEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.displayPrimaryRed ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.displayPrimaryGreen ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.displayPrimaryBlue ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.whitePoint ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.maxLuminance ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.minLuminance ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.maxContentLightLevel ); - VULKAN_HPP_HASH_COMBINE( seed, hdrMetadataEXT.maxFrameAverageLightLevel ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT const & headlessSurfaceCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, headlessSurfaceCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, headlessSurfaceCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, headlessSurfaceCreateInfoEXT.flags ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK const & iOSSurfaceCreateInfoMVK ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, iOSSurfaceCreateInfoMVK.sType ); - VULKAN_HPP_HASH_COMBINE( seed, iOSSurfaceCreateInfoMVK.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, iOSSurfaceCreateInfoMVK.flags ); - VULKAN_HPP_HASH_COMBINE( seed, iOSSurfaceCreateInfoMVK.pView ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageBlit const & imageBlit ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageBlit.srcSubresource ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, imageBlit.srcOffsets[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, imageBlit.dstSubresource ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, imageBlit.dstOffsets[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageCompressionControlEXT const & imageCompressionControlEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionControlEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionControlEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionControlEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionControlEXT.compressionControlPlaneCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionControlEXT.pFixedRateFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageCompressionPropertiesEXT const & imageCompressionPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionPropertiesEXT.imageCompressionFlags ); - VULKAN_HPP_HASH_COMBINE( seed, imageCompressionPropertiesEXT.imageCompressionFixedRateFlags ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageFormatConstraintsInfoFUCHSIA const & imageFormatConstraintsInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.imageCreateInfo ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.requiredFormatFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.flags ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.sysmemPixelFormat ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.colorSpaceCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatConstraintsInfoFUCHSIA.pColorSpaces ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA const & imageConstraintsInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.formatConstraintsCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.pFormatConstraints ); - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.bufferCollectionConstraints ); - VULKAN_HPP_HASH_COMBINE( seed, imageConstraintsInfoFUCHSIA.flags ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageCopy const & imageCopy ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageCopy.srcSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy.dstSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageCopy.extent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubresourceLayout const & subresourceLayout ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout.offset ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout.size ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout.rowPitch ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout.arrayPitch ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout.depthPitch ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierExplicitCreateInfoEXT const & imageDrmFormatModifierExplicitCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierExplicitCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierExplicitCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierExplicitCreateInfoEXT.drmFormatModifier ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierExplicitCreateInfoEXT.drmFormatModifierPlaneCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierExplicitCreateInfoEXT.pPlaneLayouts ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierListCreateInfoEXT const & imageDrmFormatModifierListCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierListCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierListCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierListCreateInfoEXT.drmFormatModifierCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierListCreateInfoEXT.pDrmFormatModifiers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT const & imageDrmFormatModifierPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageDrmFormatModifierPropertiesEXT.drmFormatModifier ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageFormatListCreateInfo const & imageFormatListCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageFormatListCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatListCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatListCreateInfo.viewFormatCount ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatListCreateInfo.pViewFormats ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageFormatProperties2 const & imageFormatProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageFormatProperties2.imageFormatProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageMemoryBarrier const & imageMemoryBarrier ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.oldLayout ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.newLayout ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.srcQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.dstQueueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.image ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryBarrier.subresourceRange ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 const & imageMemoryRequirementsInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryRequirementsInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryRequirementsInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageMemoryRequirementsInfo2.image ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA const & imagePipeSurfaceCreateInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imagePipeSurfaceCreateInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imagePipeSurfaceCreateInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imagePipeSurfaceCreateInfoFUCHSIA.flags ); - VULKAN_HPP_HASH_COMBINE( seed, imagePipeSurfaceCreateInfoFUCHSIA.imagePipeHandle ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImagePlaneMemoryRequirementsInfo const & imagePlaneMemoryRequirementsInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imagePlaneMemoryRequirementsInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imagePlaneMemoryRequirementsInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imagePlaneMemoryRequirementsInfo.planeAspect ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageResolve const & imageResolve ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageResolve.srcSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve.dstSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve.extent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageResolve2 const & imageResolve2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.srcSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.srcOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.dstSubresource ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.dstOffset ); - VULKAN_HPP_HASH_COMBINE( seed, imageResolve2.extent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 const & imageSparseMemoryRequirementsInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSparseMemoryRequirementsInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageSparseMemoryRequirementsInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageSparseMemoryRequirementsInfo2.image ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageStencilUsageCreateInfo const & imageStencilUsageCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageStencilUsageCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageStencilUsageCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageStencilUsageCreateInfo.stencilUsage ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSubresource2EXT const & imageSubresource2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageSubresource2EXT.imageSubresource ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageSwapchainCreateInfoKHR const & imageSwapchainCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageSwapchainCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageSwapchainCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageSwapchainCreateInfoKHR.swapchain ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewASTCDecodeModeEXT const & imageViewASTCDecodeModeEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewASTCDecodeModeEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewASTCDecodeModeEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewASTCDecodeModeEXT.decodeMode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX const & imageViewAddressPropertiesNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewAddressPropertiesNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewAddressPropertiesNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewAddressPropertiesNVX.deviceAddress ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewAddressPropertiesNVX.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewCreateInfo const & imageViewCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.image ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.viewType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.format ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.components ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewCreateInfo.subresourceRange ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX const & imageViewHandleInfoNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewHandleInfoNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewHandleInfoNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewHandleInfoNVX.imageView ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewHandleInfoNVX.descriptorType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewHandleInfoNVX.sampler ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewMinLodCreateInfoEXT const & imageViewMinLodCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewMinLodCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewMinLodCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewMinLodCreateInfoEXT.minLod ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewSampleWeightCreateInfoQCOM const & imageViewSampleWeightCreateInfoQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewSampleWeightCreateInfoQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewSampleWeightCreateInfoQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewSampleWeightCreateInfoQCOM.filterCenter ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewSampleWeightCreateInfoQCOM.filterSize ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewSampleWeightCreateInfoQCOM.numPhases ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImageViewUsageCreateInfo const & imageViewUsageCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, imageViewUsageCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewUsageCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, imageViewUsageCreateInfo.usage ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::ImportAndroidHardwareBufferInfoANDROID const & importAndroidHardwareBufferInfoANDROID ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importAndroidHardwareBufferInfoANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importAndroidHardwareBufferInfoANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importAndroidHardwareBufferInfoANDROID.buffer ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR const & importFenceFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.fence ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceFdInfoKHR.fd ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR const & importFenceWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.fence ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.handle ); - VULKAN_HPP_HASH_COMBINE( seed, importFenceWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryBufferCollectionFUCHSIA const & importMemoryBufferCollectionFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryBufferCollectionFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryBufferCollectionFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryBufferCollectionFUCHSIA.collection ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryBufferCollectionFUCHSIA.index ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryFdInfoKHR const & importMemoryFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryFdInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryFdInfoKHR.fd ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryHostPointerInfoEXT const & importMemoryHostPointerInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryHostPointerInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryHostPointerInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryHostPointerInfoEXT.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryHostPointerInfoEXT.pHostPointer ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryWin32HandleInfoKHR const & importMemoryWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoKHR.handle ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryWin32HandleInfoNV const & importMemoryWin32HandleInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoNV.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryWin32HandleInfoNV.handle ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMemoryZirconHandleInfoFUCHSIA const & importMemoryZirconHandleInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMemoryZirconHandleInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryZirconHandleInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryZirconHandleInfoFUCHSIA.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importMemoryZirconHandleInfoFUCHSIA.handle ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMetalBufferInfoEXT const & importMetalBufferInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMetalBufferInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalBufferInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalBufferInfoEXT.mtlBuffer ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMetalIOSurfaceInfoEXT const & importMetalIOSurfaceInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMetalIOSurfaceInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalIOSurfaceInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalIOSurfaceInfoEXT.ioSurface ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMetalSharedEventInfoEXT const & importMetalSharedEventInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMetalSharedEventInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalSharedEventInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalSharedEventInfoEXT.mtlSharedEvent ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportMetalTextureInfoEXT const & importMetalTextureInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importMetalTextureInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalTextureInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalTextureInfoEXT.plane ); - VULKAN_HPP_HASH_COMBINE( seed, importMetalTextureInfoEXT.mtlTexture ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR const & importSemaphoreFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreFdInfoKHR.fd ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR const & importSemaphoreWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.handle ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreWin32HandleInfoKHR.name ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA const & importSemaphoreZirconHandleInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.flags ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.handleType ); - VULKAN_HPP_HASH_COMBINE( seed, importSemaphoreZirconHandleInfoFUCHSIA.zirconHandle ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutTokenNV const & indirectCommandsLayoutTokenNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.tokenType ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.stream ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.offset ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.vertexBindingUnit ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.vertexDynamicStride ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pushconstantPipelineLayout ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pushconstantShaderStageFlags ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pushconstantOffset ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pushconstantSize ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.indirectStateFlags ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.indexTypeCount ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pIndexTypes ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutTokenNV.pIndexTypeValues ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV const & indirectCommandsLayoutCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.tokenCount ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.pTokens ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.streamCount ); - VULKAN_HPP_HASH_COMBINE( seed, indirectCommandsLayoutCreateInfoNV.pStreamStrides ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL const & initializePerformanceApiInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, initializePerformanceApiInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, initializePerformanceApiInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, initializePerformanceApiInfoINTEL.pUserData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::InputAttachmentAspectReference const & inputAttachmentAspectReference ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, inputAttachmentAspectReference.subpass ); - VULKAN_HPP_HASH_COMBINE( seed, inputAttachmentAspectReference.inputAttachmentIndex ); - VULKAN_HPP_HASH_COMBINE( seed, inputAttachmentAspectReference.aspectMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::InstanceCreateInfo const & instanceCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.pApplicationInfo ); - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.enabledLayerCount ); - for ( size_t i = 0; i < instanceCreateInfo.enabledLayerCount; ++i ) - { - for ( const char * p = instanceCreateInfo.ppEnabledLayerNames[i]; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - } - VULKAN_HPP_HASH_COMBINE( seed, instanceCreateInfo.enabledExtensionCount ); - for ( size_t i = 0; i < instanceCreateInfo.enabledExtensionCount; ++i ) - { - for ( const char * p = instanceCreateInfo.ppEnabledExtensionNames[i]; *p != '\0'; ++p ) - { - VULKAN_HPP_HASH_COMBINE( seed, *p ); - } - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::LayerProperties const & layerProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - for ( size_t i = 0; i < VK_MAX_EXTENSION_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, layerProperties.layerName[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, layerProperties.specVersion ); - VULKAN_HPP_HASH_COMBINE( seed, layerProperties.implementationVersion ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, layerProperties.description[i] ); - } - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK const & macOSSurfaceCreateInfoMVK ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, macOSSurfaceCreateInfoMVK.sType ); - VULKAN_HPP_HASH_COMBINE( seed, macOSSurfaceCreateInfoMVK.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, macOSSurfaceCreateInfoMVK.flags ); - VULKAN_HPP_HASH_COMBINE( seed, macOSSurfaceCreateInfoMVK.pView ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MappedMemoryRange const & mappedMemoryRange ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, mappedMemoryRange.sType ); - VULKAN_HPP_HASH_COMBINE( seed, mappedMemoryRange.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, mappedMemoryRange.memory ); - VULKAN_HPP_HASH_COMBINE( seed, mappedMemoryRange.offset ); - VULKAN_HPP_HASH_COMBINE( seed, mappedMemoryRange.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryAllocateFlagsInfo const & memoryAllocateFlagsInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateFlagsInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateFlagsInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateFlagsInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateFlagsInfo.deviceMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryAllocateInfo const & memoryAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateInfo.allocationSize ); - VULKAN_HPP_HASH_COMBINE( seed, memoryAllocateInfo.memoryTypeIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryBarrier const & memoryBarrier ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, memoryBarrier.dstAccessMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryDedicatedAllocateInfo const & memoryDedicatedAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedAllocateInfo.image ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedAllocateInfo.buffer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryDedicatedRequirements const & memoryDedicatedRequirements ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedRequirements.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedRequirements.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedRequirements.prefersDedicatedAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, memoryDedicatedRequirements.requiresDedicatedAllocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR const & memoryFdPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryFdPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryFdPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryFdPropertiesKHR.memoryTypeBits ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID const & memoryGetAndroidHardwareBufferInfoANDROID ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryGetAndroidHardwareBufferInfoANDROID.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetAndroidHardwareBufferInfoANDROID.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetAndroidHardwareBufferInfoANDROID.memory ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR const & memoryGetFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryGetFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetFdInfoKHR.memory ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetFdInfoKHR.handleType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV const & memoryGetRemoteAddressInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryGetRemoteAddressInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetRemoteAddressInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetRemoteAddressInfoNV.memory ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetRemoteAddressInfoNV.handleType ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR const & memoryGetWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryGetWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetWin32HandleInfoKHR.memory ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetWin32HandleInfoKHR.handleType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA const & memoryGetZirconHandleInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryGetZirconHandleInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetZirconHandleInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetZirconHandleInfoFUCHSIA.memory ); - VULKAN_HPP_HASH_COMBINE( seed, memoryGetZirconHandleInfoFUCHSIA.handleType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryHeap const & memoryHeap ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryHeap.size ); - VULKAN_HPP_HASH_COMBINE( seed, memoryHeap.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT const & memoryHostPointerPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryHostPointerPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryHostPointerPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryHostPointerPropertiesEXT.memoryTypeBits ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::MemoryOpaqueCaptureAddressAllocateInfo const & memoryOpaqueCaptureAddressAllocateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryOpaqueCaptureAddressAllocateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryOpaqueCaptureAddressAllocateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryOpaqueCaptureAddressAllocateInfo.opaqueCaptureAddress ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryPriorityAllocateInfoEXT const & memoryPriorityAllocateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryPriorityAllocateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryPriorityAllocateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryPriorityAllocateInfoEXT.priority ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryRequirements const & memoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements.size ); - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements.alignment ); - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements.memoryTypeBits ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryRequirements2 const & memoryRequirements2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryRequirements2.memoryRequirements ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryType const & memoryType ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryType.propertyFlags ); - VULKAN_HPP_HASH_COMBINE( seed, memoryType.heapIndex ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR const & memoryWin32HandlePropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryWin32HandlePropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryWin32HandlePropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryWin32HandlePropertiesKHR.memoryTypeBits ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA const & memoryZirconHandlePropertiesFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, memoryZirconHandlePropertiesFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, memoryZirconHandlePropertiesFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, memoryZirconHandlePropertiesFUCHSIA.memoryTypeBits ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT const & metalSurfaceCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, metalSurfaceCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, metalSurfaceCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, metalSurfaceCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, metalSurfaceCreateInfoEXT.pLayer ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MultiDrawIndexedInfoEXT const & multiDrawIndexedInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, multiDrawIndexedInfoEXT.firstIndex ); - VULKAN_HPP_HASH_COMBINE( seed, multiDrawIndexedInfoEXT.indexCount ); - VULKAN_HPP_HASH_COMBINE( seed, multiDrawIndexedInfoEXT.vertexOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MultiDrawInfoEXT const & multiDrawInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, multiDrawInfoEXT.firstVertex ); - VULKAN_HPP_HASH_COMBINE( seed, multiDrawInfoEXT.vertexCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT const & multisamplePropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, multisamplePropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, multisamplePropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, multisamplePropertiesEXT.maxSampleLocationGridSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::MultisampledRenderToSingleSampledInfoEXT const & multisampledRenderToSingleSampledInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, multisampledRenderToSingleSampledInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, multisampledRenderToSingleSampledInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, multisampledRenderToSingleSampledInfoEXT.multisampledRenderToSingleSampledEnable ); - VULKAN_HPP_HASH_COMBINE( seed, multisampledRenderToSingleSampledInfoEXT.rasterizationSamples ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MultiviewPerViewAttributesInfoNVX const & multiviewPerViewAttributesInfoNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, multiviewPerViewAttributesInfoNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, multiviewPerViewAttributesInfoNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, multiviewPerViewAttributesInfoNVX.perViewAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, multiviewPerViewAttributesInfoNVX.perViewAttributesPositionXOnly ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MutableDescriptorTypeListVALVE const & mutableDescriptorTypeListVALVE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeListVALVE.descriptorTypeCount ); - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeListVALVE.pDescriptorTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::MutableDescriptorTypeCreateInfoVALVE const & mutableDescriptorTypeCreateInfoVALVE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeCreateInfoVALVE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeCreateInfoVALVE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeCreateInfoVALVE.mutableDescriptorTypeListCount ); - VULKAN_HPP_HASH_COMBINE( seed, mutableDescriptorTypeCreateInfoVALVE.pMutableDescriptorTypeLists ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE const & pastPresentationTimingGOOGLE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pastPresentationTimingGOOGLE.presentID ); - VULKAN_HPP_HASH_COMBINE( seed, pastPresentationTimingGOOGLE.desiredPresentTime ); - VULKAN_HPP_HASH_COMBINE( seed, pastPresentationTimingGOOGLE.actualPresentTime ); - VULKAN_HPP_HASH_COMBINE( seed, pastPresentationTimingGOOGLE.earliestPresentTime ); - VULKAN_HPP_HASH_COMBINE( seed, pastPresentationTimingGOOGLE.presentMargin ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL const & performanceConfigurationAcquireInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceConfigurationAcquireInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceConfigurationAcquireInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceConfigurationAcquireInfoINTEL.type ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionKHR const & performanceCounterDescriptionKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.flags ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.name[i] ); - } - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.category[i] ); - } - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterDescriptionKHR.description[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceCounterKHR const & performanceCounterKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.unit ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.scope ); - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.storage ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, performanceCounterKHR.uuid[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL const & performanceMarkerInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceMarkerInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceMarkerInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceMarkerInfoINTEL.marker ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL const & performanceOverrideInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceOverrideInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceOverrideInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceOverrideInfoINTEL.type ); - VULKAN_HPP_HASH_COMBINE( seed, performanceOverrideInfoINTEL.enable ); - VULKAN_HPP_HASH_COMBINE( seed, performanceOverrideInfoINTEL.parameter ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceQuerySubmitInfoKHR const & performanceQuerySubmitInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceQuerySubmitInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceQuerySubmitInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceQuerySubmitInfoKHR.counterPassIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL const & performanceStreamMarkerInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, performanceStreamMarkerInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, performanceStreamMarkerInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, performanceStreamMarkerInfoINTEL.marker ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevice16BitStorageFeatures const & physicalDevice16BitStorageFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.storageBuffer16BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.uniformAndStorageBuffer16BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.storagePushConstant16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice16BitStorageFeatures.storageInputOutput16 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevice4444FormatsFeaturesEXT const & physicalDevice4444FormatsFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice4444FormatsFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice4444FormatsFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice4444FormatsFeaturesEXT.formatA4R4G4B4 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice4444FormatsFeaturesEXT.formatA4B4G4R4 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevice8BitStorageFeatures const & physicalDevice8BitStorageFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice8BitStorageFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice8BitStorageFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice8BitStorageFeatures.storageBuffer8BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice8BitStorageFeatures.uniformAndStorageBuffer8BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevice8BitStorageFeatures.storagePushConstant8 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceASTCDecodeFeaturesEXT const & physicalDeviceASTCDecodeFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceASTCDecodeFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceASTCDecodeFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceASTCDecodeFeaturesEXT.decodeModeSharedExponent ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceAccelerationStructureFeaturesKHR const & physicalDeviceAccelerationStructureFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.accelerationStructure ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.accelerationStructureCaptureReplay ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.accelerationStructureIndirectBuild ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.accelerationStructureHostCommands ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructureFeaturesKHR.descriptorBindingAccelerationStructureUpdateAfterBind ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceAccelerationStructurePropertiesKHR const & physicalDeviceAccelerationStructurePropertiesKHR ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxGeometryCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxInstanceCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxPrimitiveCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxPerStageDescriptorAccelerationStructures ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxPerStageDescriptorUpdateAfterBindAccelerationStructures ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxDescriptorSetAccelerationStructures ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.maxDescriptorSetUpdateAfterBindAccelerationStructures ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAccelerationStructurePropertiesKHR.minAccelerationStructureScratchOffsetAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceAmigoProfilingFeaturesSEC const & physicalDeviceAmigoProfilingFeaturesSEC ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAmigoProfilingFeaturesSEC.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAmigoProfilingFeaturesSEC.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAmigoProfilingFeaturesSEC.amigoProfiling ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & - physicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT.attachmentFeedbackLoopLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & physicalDeviceBlendOperationAdvancedFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedFeaturesEXT.advancedBlendCoherentOperations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & physicalDeviceBlendOperationAdvancedPropertiesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendMaxColorAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendIndependentBlend ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendNonPremultipliedSrcColor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendNonPremultipliedDstColor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendCorrelatedOverlap ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBlendOperationAdvancedPropertiesEXT.advancedBlendAllOperations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceBorderColorSwizzleFeaturesEXT const & physicalDeviceBorderColorSwizzleFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBorderColorSwizzleFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBorderColorSwizzleFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBorderColorSwizzleFeaturesEXT.borderColorSwizzle ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBorderColorSwizzleFeaturesEXT.borderColorSwizzleFromImage ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceBufferDeviceAddressFeatures const & physicalDeviceBufferDeviceAddressFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeatures.bufferDeviceAddress ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeatures.bufferDeviceAddressCaptureReplay ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeatures.bufferDeviceAddressMultiDevice ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceBufferDeviceAddressFeaturesEXT const & physicalDeviceBufferDeviceAddressFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeaturesEXT.bufferDeviceAddress ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeaturesEXT.bufferDeviceAddressCaptureReplay ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceBufferDeviceAddressFeaturesEXT.bufferDeviceAddressMultiDevice ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCoherentMemoryFeaturesAMD const & physicalDeviceCoherentMemoryFeaturesAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoherentMemoryFeaturesAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoherentMemoryFeaturesAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoherentMemoryFeaturesAMD.deviceCoherentMemory ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceColorWriteEnableFeaturesEXT const & physicalDeviceColorWriteEnableFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceColorWriteEnableFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceColorWriteEnableFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceColorWriteEnableFeaturesEXT.colorWriteEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceComputeShaderDerivativesFeaturesNV const & physicalDeviceComputeShaderDerivativesFeaturesNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceComputeShaderDerivativesFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceComputeShaderDerivativesFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceComputeShaderDerivativesFeaturesNV.computeDerivativeGroupQuads ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceComputeShaderDerivativesFeaturesNV.computeDerivativeGroupLinear ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceConditionalRenderingFeaturesEXT const & physicalDeviceConditionalRenderingFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConditionalRenderingFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConditionalRenderingFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConditionalRenderingFeaturesEXT.conditionalRendering ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConditionalRenderingFeaturesEXT.inheritedConditionalRendering ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceConservativeRasterizationPropertiesEXT const & - physicalDeviceConservativeRasterizationPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.primitiveOverestimationSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.maxExtraPrimitiveOverestimationSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.extraPrimitiveOverestimationSizeGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.primitiveUnderestimation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.conservativePointAndLineRasterization ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.degenerateTrianglesRasterized ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.degenerateLinesRasterized ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.fullyCoveredFragmentShaderInputVariable ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceConservativeRasterizationPropertiesEXT.conservativeRasterizationPostDepthCoverage ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCooperativeMatrixFeaturesNV const & physicalDeviceCooperativeMatrixFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixFeaturesNV.cooperativeMatrix ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixFeaturesNV.cooperativeMatrixRobustBufferAccess ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCooperativeMatrixPropertiesNV const & physicalDeviceCooperativeMatrixPropertiesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCooperativeMatrixPropertiesNV.cooperativeMatrixSupportedStages ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCornerSampledImageFeaturesNV const & physicalDeviceCornerSampledImageFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCornerSampledImageFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCornerSampledImageFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCornerSampledImageFeaturesNV.cornerSampledImage ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCoverageReductionModeFeaturesNV const & physicalDeviceCoverageReductionModeFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoverageReductionModeFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoverageReductionModeFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCoverageReductionModeFeaturesNV.coverageReductionMode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorFeaturesEXT const & physicalDeviceCustomBorderColorFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorFeaturesEXT.customBorderColors ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorFeaturesEXT.customBorderColorWithoutFormat ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorPropertiesEXT const & physicalDeviceCustomBorderColorPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceCustomBorderColorPropertiesEXT.maxCustomBorderColorSamplers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & - physicalDeviceDedicatedAllocationImageAliasingFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDedicatedAllocationImageAliasingFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDedicatedAllocationImageAliasingFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDedicatedAllocationImageAliasingFeaturesNV.dedicatedAllocationImageAliasing ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClampZeroOneFeaturesEXT const & physicalDeviceDepthClampZeroOneFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClampZeroOneFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClampZeroOneFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClampZeroOneFeaturesEXT.depthClampZeroOne ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClipControlFeaturesEXT const & physicalDeviceDepthClipControlFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipControlFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipControlFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipControlFeaturesEXT.depthClipControl ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClipEnableFeaturesEXT const & physicalDeviceDepthClipEnableFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipEnableFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipEnableFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthClipEnableFeaturesEXT.depthClipEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthStencilResolveProperties const & physicalDeviceDepthStencilResolveProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.supportedDepthResolveModes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.supportedStencilResolveModes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.independentResolveNone ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDepthStencilResolveProperties.independentResolve ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorIndexingFeatures const & physicalDeviceDescriptorIndexingFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderInputAttachmentArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderUniformTexelBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderStorageTexelBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderUniformBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderSampledImageArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderStorageBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderStorageImageArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderInputAttachmentArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderUniformTexelBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.shaderStorageTexelBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingUniformBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingSampledImageUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingStorageImageUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingStorageBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingUniformTexelBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingStorageTexelBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingUpdateUnusedWhilePending ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingPartiallyBound ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.descriptorBindingVariableDescriptorCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingFeatures.runtimeDescriptorArray ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorIndexingProperties const & physicalDeviceDescriptorIndexingProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxUpdateAfterBindDescriptorsInAllPools ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.shaderUniformBufferArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.shaderSampledImageArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.shaderStorageBufferArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.shaderStorageImageArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.shaderInputAttachmentArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.robustBufferAccessUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.quadDivergentImplicitLod ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageDescriptorUpdateAfterBindInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxPerStageUpdateAfterBindResources ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorIndexingProperties.maxDescriptorSetUpdateAfterBindInputAttachments ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & physicalDeviceDescriptorSetHostMappingFeaturesVALVE ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorSetHostMappingFeaturesVALVE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorSetHostMappingFeaturesVALVE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDescriptorSetHostMappingFeaturesVALVE.descriptorSetHostMapping ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & physicalDeviceDeviceGeneratedCommandsFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsFeaturesNV.deviceGeneratedCommands ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & physicalDeviceDeviceGeneratedCommandsPropertiesNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxGraphicsShaderGroupCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxIndirectSequenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxIndirectCommandsTokenCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxIndirectCommandsStreamCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxIndirectCommandsTokenOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.maxIndirectCommandsStreamStride ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.minSequencesCountBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.minSequencesIndexBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceGeneratedCommandsPropertiesNV.minIndirectCommandsBufferOffsetAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceMemoryReportFeaturesEXT const & physicalDeviceDeviceMemoryReportFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceMemoryReportFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceMemoryReportFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDeviceMemoryReportFeaturesEXT.deviceMemoryReport ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDiagnosticsConfigFeaturesNV const & physicalDeviceDiagnosticsConfigFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiagnosticsConfigFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiagnosticsConfigFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiagnosticsConfigFeaturesNV.diagnosticsConfig ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDiscardRectanglePropertiesEXT const & physicalDeviceDiscardRectanglePropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiscardRectanglePropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiscardRectanglePropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDiscardRectanglePropertiesEXT.maxDiscardRectangles ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDriverProperties const & physicalDeviceDriverProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.driverID ); - for ( size_t i = 0; i < VK_MAX_DRIVER_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.driverName[i] ); - } - for ( size_t i = 0; i < VK_MAX_DRIVER_INFO_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.driverInfo[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDriverProperties.conformanceVersion ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDrmPropertiesEXT const & physicalDeviceDrmPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.hasPrimary ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.hasRender ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.primaryMajor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.primaryMinor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.renderMajor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDrmPropertiesEXT.renderMinor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceDynamicRenderingFeatures const & physicalDeviceDynamicRenderingFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDynamicRenderingFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDynamicRenderingFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceDynamicRenderingFeatures.dynamicRendering ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExclusiveScissorFeaturesNV const & physicalDeviceExclusiveScissorFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExclusiveScissorFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExclusiveScissorFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExclusiveScissorFeaturesNV.exclusiveScissor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedDynamicState2FeaturesEXT const & physicalDeviceExtendedDynamicState2FeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicState2FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicState2FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicState2FeaturesEXT.extendedDynamicState2 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicState2FeaturesEXT.extendedDynamicState2LogicOp ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicState2FeaturesEXT.extendedDynamicState2PatchControlPoints ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedDynamicStateFeaturesEXT const & physicalDeviceExtendedDynamicStateFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicStateFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicStateFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExtendedDynamicStateFeaturesEXT.extendedDynamicState ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo const & physicalDeviceExternalBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalBufferInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalBufferInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalBufferInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalBufferInfo.usage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalBufferInfo.handleType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo const & physicalDeviceExternalFenceInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFenceInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFenceInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalFenceInfo.handleType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalImageFormatInfo const & physicalDeviceExternalImageFormatInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalImageFormatInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalImageFormatInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalImageFormatInfo.handleType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalMemoryHostPropertiesEXT const & physicalDeviceExternalMemoryHostPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryHostPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryHostPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryHostPropertiesEXT.minImportedHostPointerAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalMemoryRDMAFeaturesNV const & physicalDeviceExternalMemoryRDMAFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryRDMAFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryRDMAFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalMemoryRDMAFeaturesNV.externalMemoryRDMA ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo const & physicalDeviceExternalSemaphoreInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalSemaphoreInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalSemaphoreInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceExternalSemaphoreInfo.handleType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 const & physicalDeviceFeatures2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFeatures2.features ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFloatControlsProperties const & physicalDeviceFloatControlsProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.denormBehaviorIndependence ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.roundingModeIndependence ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderSignedZeroInfNanPreserveFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderSignedZeroInfNanPreserveFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderSignedZeroInfNanPreserveFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormPreserveFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormPreserveFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormPreserveFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormFlushToZeroFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormFlushToZeroFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderDenormFlushToZeroFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTEFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTEFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTEFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTZFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTZFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFloatControlsProperties.shaderRoundingModeRTZFloat64 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMap2FeaturesEXT const & physicalDeviceFragmentDensityMap2FeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2FeaturesEXT.fragmentDensityMapDeferred ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMap2PropertiesEXT const & physicalDeviceFragmentDensityMap2PropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.subsampledLoads ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.subsampledCoarseReconstructionEarlyAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.maxSubsampledArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMap2PropertiesEXT.maxDescriptorSetSubsampledSamplers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapFeaturesEXT const & physicalDeviceFragmentDensityMapFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapFeaturesEXT.fragmentDensityMap ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapFeaturesEXT.fragmentDensityMapDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapFeaturesEXT.fragmentDensityMapNonSubsampledImages ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & physicalDeviceFragmentDensityMapOffsetFeaturesQCOM ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetFeaturesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetFeaturesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetFeaturesQCOM.fragmentDensityMapOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & - physicalDeviceFragmentDensityMapOffsetPropertiesQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetPropertiesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetPropertiesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapOffsetPropertiesQCOM.fragmentDensityOffsetGranularity ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapPropertiesEXT const & physicalDeviceFragmentDensityMapPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentDensityMapPropertiesEXT.fragmentDensityInvocations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & physicalDeviceFragmentShaderBarycentricFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricFeaturesKHR.fragmentShaderBarycentric ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & - physicalDeviceFragmentShaderBarycentricPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderBarycentricPropertiesKHR.triStripVertexOrderIndependentOfProvokingVertex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & physicalDeviceFragmentShaderInterlockFeaturesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderInterlockFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderInterlockFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderInterlockFeaturesEXT.fragmentShaderSampleInterlock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderInterlockFeaturesEXT.fragmentShaderPixelInterlock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShaderInterlockFeaturesEXT.fragmentShaderShadingRateInterlock ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & physicalDeviceFragmentShadingRateEnumsFeaturesNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsFeaturesNV.fragmentShadingRateEnums ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsFeaturesNV.supersampleFragmentShadingRates ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsFeaturesNV.noInvocationFragmentShadingRates ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & physicalDeviceFragmentShadingRateEnumsPropertiesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateEnumsPropertiesNV.maxFragmentShadingRateInvocationCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateFeaturesKHR const & physicalDeviceFragmentShadingRateFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateFeaturesKHR.pipelineFragmentShadingRate ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateFeaturesKHR.primitiveFragmentShadingRate ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateFeaturesKHR.attachmentFragmentShadingRate ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateKHR const & physicalDeviceFragmentShadingRateKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateKHR.sampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRateKHR.fragmentSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRatePropertiesKHR const & physicalDeviceFragmentShadingRatePropertiesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.minFragmentShadingRateAttachmentTexelSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentShadingRateAttachmentTexelSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentShadingRateAttachmentTexelSizeAspectRatio ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.primitiveFragmentShadingRateWithMultipleViewports ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.layeredShadingRateAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateNonTrivialCombinerOps ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentSizeAspectRatio ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentShadingRateCoverageSamples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.maxFragmentShadingRateRasterizationSamples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithShaderDepthStencilWrites ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithSampleMask ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithShaderSampleMask ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithConservativeRasterization ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithFragmentShaderInterlock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateWithCustomSampleLocations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceFragmentShadingRatePropertiesKHR.fragmentShadingRateStrictMultiplyCombiner ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & physicalDeviceGlobalPriorityQueryFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGlobalPriorityQueryFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGlobalPriorityQueryFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGlobalPriorityQueryFeaturesKHR.globalPriorityQuery ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & physicalDeviceGraphicsPipelineLibraryFeaturesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryFeaturesEXT.graphicsPipelineLibrary ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & physicalDeviceGraphicsPipelineLibraryPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryPropertiesEXT.graphicsPipelineLibraryFastLinking ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGraphicsPipelineLibraryPropertiesEXT.graphicsPipelineLibraryIndependentInterpolationDecoration ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties const & physicalDeviceGroupProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGroupProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGroupProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGroupProperties.physicalDeviceCount ); - for ( size_t i = 0; i < VK_MAX_DEVICE_GROUP_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGroupProperties.physicalDevices[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceGroupProperties.subsetAllocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceHostQueryResetFeatures const & physicalDeviceHostQueryResetFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceHostQueryResetFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceHostQueryResetFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceHostQueryResetFeatures.hostQueryReset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceIDProperties const & physicalDeviceIDProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.pNext ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.deviceUUID[i] ); - } - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.driverUUID[i] ); - } - for ( size_t i = 0; i < VK_LUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.deviceLUID[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.deviceNodeMask ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIDProperties.deviceLUIDValid ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImage2DViewOf3DFeaturesEXT const & physicalDeviceImage2DViewOf3DFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImage2DViewOf3DFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImage2DViewOf3DFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImage2DViewOf3DFeaturesEXT.image2DViewOf3D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImage2DViewOf3DFeaturesEXT.sampler2DViewOf3D ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageCompressionControlFeaturesEXT const & physicalDeviceImageCompressionControlFeaturesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlFeaturesEXT.imageCompressionControl ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & - physicalDeviceImageCompressionControlSwapchainFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlSwapchainFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlSwapchainFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageCompressionControlSwapchainFeaturesEXT.imageCompressionControlSwapchain ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageDrmFormatModifierInfoEXT const & physicalDeviceImageDrmFormatModifierInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.drmFormatModifier ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.sharingMode ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.queueFamilyIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageDrmFormatModifierInfoEXT.pQueueFamilyIndices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 const & physicalDeviceImageFormatInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.format ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.type ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.tiling ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.usage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageFormatInfo2.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingFeaturesQCOM const & physicalDeviceImageProcessingFeaturesQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingFeaturesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingFeaturesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingFeaturesQCOM.textureSampleWeighted ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingFeaturesQCOM.textureBoxFilter ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingFeaturesQCOM.textureBlockMatch ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingPropertiesQCOM const & physicalDeviceImageProcessingPropertiesQCOM ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.maxWeightFilterPhases ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.maxWeightFilterDimension ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.maxBlockMatchRegion ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageProcessingPropertiesQCOM.maxBoxFilterBlockSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageRobustnessFeatures const & physicalDeviceImageRobustnessFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageRobustnessFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageRobustnessFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageRobustnessFeatures.robustImageAccess ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageViewImageFormatInfoEXT const & physicalDeviceImageViewImageFormatInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewImageFormatInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewImageFormatInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewImageFormatInfoEXT.imageViewType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageViewMinLodFeaturesEXT const & physicalDeviceImageViewMinLodFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewMinLodFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewMinLodFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImageViewMinLodFeaturesEXT.minLod ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceImagelessFramebufferFeatures const & physicalDeviceImagelessFramebufferFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImagelessFramebufferFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImagelessFramebufferFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceImagelessFramebufferFeatures.imagelessFramebuffer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceIndexTypeUint8FeaturesEXT const & physicalDeviceIndexTypeUint8FeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIndexTypeUint8FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIndexTypeUint8FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceIndexTypeUint8FeaturesEXT.indexTypeUint8 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceInheritedViewportScissorFeaturesNV const & physicalDeviceInheritedViewportScissorFeaturesNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInheritedViewportScissorFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInheritedViewportScissorFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInheritedViewportScissorFeaturesNV.inheritedViewportScissor2D ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceInlineUniformBlockFeatures const & physicalDeviceInlineUniformBlockFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockFeatures.inlineUniformBlock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockFeatures.descriptorBindingInlineUniformBlockUpdateAfterBind ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceInlineUniformBlockProperties const & physicalDeviceInlineUniformBlockProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.maxInlineUniformBlockSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.maxPerStageDescriptorInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.maxDescriptorSetInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInlineUniformBlockProperties.maxDescriptorSetUpdateAfterBindInlineUniformBlocks ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceInvocationMaskFeaturesHUAWEI const & physicalDeviceInvocationMaskFeaturesHUAWEI ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInvocationMaskFeaturesHUAWEI.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInvocationMaskFeaturesHUAWEI.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceInvocationMaskFeaturesHUAWEI.invocationMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLegacyDitheringFeaturesEXT const & physicalDeviceLegacyDitheringFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLegacyDitheringFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLegacyDitheringFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLegacyDitheringFeaturesEXT.legacyDithering ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLimits const & physicalDeviceLimits ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxImageDimension1D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxImageDimension2D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxImageDimension3D ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxImageDimensionCube ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxImageArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTexelBufferElements ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxUniformBufferRange ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxStorageBufferRange ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPushConstantsSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxMemoryAllocationCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxSamplerAllocationCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.bufferImageGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.sparseAddressSpaceSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxBoundDescriptorSets ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageDescriptorInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxPerStageResources ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetUniformBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetStorageBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDescriptorSetInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxVertexInputAttributes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxVertexInputBindings ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxVertexInputAttributeOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxVertexInputBindingStride ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxVertexOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationGenerationLevel ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationPatchSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationControlPerVertexInputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationControlPerVertexOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationControlPerPatchOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationControlTotalOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationEvaluationInputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTessellationEvaluationOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxGeometryShaderInvocations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxGeometryInputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxGeometryOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxGeometryOutputVertices ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxGeometryTotalOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFragmentInputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFragmentOutputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFragmentDualSrcAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFragmentCombinedOutputResources ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxComputeSharedMemorySize ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxComputeWorkGroupCount[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxComputeWorkGroupInvocations ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxComputeWorkGroupSize[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.subPixelPrecisionBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.subTexelPrecisionBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.mipmapPrecisionBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDrawIndexedIndexValue ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxDrawIndirectCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxSamplerLodBias ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxSamplerAnisotropy ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxViewports ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxViewportDimensions[i] ); - } - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.viewportBoundsRange[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.viewportSubPixelBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minMemoryMapAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minTexelBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minUniformBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minStorageBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minTexelOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTexelOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minTexelGatherOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxTexelGatherOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.minInterpolationOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxInterpolationOffset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.subPixelInterpolationOffsetBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFramebufferWidth ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFramebufferHeight ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxFramebufferLayers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.framebufferColorSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.framebufferDepthSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.framebufferStencilSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.framebufferNoAttachmentsSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxColorAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.sampledImageColorSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.sampledImageIntegerSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.sampledImageDepthSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.sampledImageStencilSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.storageImageSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxSampleMaskWords ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.timestampComputeAndGraphics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.timestampPeriod ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxClipDistances ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxCullDistances ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.maxCombinedClipAndCullDistances ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.discreteQueuePriorities ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.pointSizeRange[i] ); - } - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.lineWidthRange[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.pointSizeGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.lineWidthGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.strictLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.standardSampleLocations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.optimalBufferCopyOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.optimalBufferCopyRowPitchAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLimits.nonCoherentAtomSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLineRasterizationFeaturesEXT const & physicalDeviceLineRasterizationFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.rectangularLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.bresenhamLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.smoothLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.stippledRectangularLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.stippledBresenhamLines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationFeaturesEXT.stippledSmoothLines ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLineRasterizationPropertiesEXT const & physicalDeviceLineRasterizationPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLineRasterizationPropertiesEXT.lineSubPixelPrecisionBits ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceLinearColorAttachmentFeaturesNV const & physicalDeviceLinearColorAttachmentFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLinearColorAttachmentFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLinearColorAttachmentFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceLinearColorAttachmentFeaturesNV.linearColorAttachment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance3Properties const & physicalDeviceMaintenance3Properties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance3Properties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance3Properties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance3Properties.maxPerSetDescriptors ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance3Properties.maxMemoryAllocationSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance4Features const & physicalDeviceMaintenance4Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Features.maintenance4 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance4Properties const & physicalDeviceMaintenance4Properties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Properties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Properties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMaintenance4Properties.maxBufferSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryBudgetPropertiesEXT const & physicalDeviceMemoryBudgetPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryBudgetPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryBudgetPropertiesEXT.pNext ); - for ( size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryBudgetPropertiesEXT.heapBudget[i] ); - } - for ( size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryBudgetPropertiesEXT.heapUsage[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryPriorityFeaturesEXT const & physicalDeviceMemoryPriorityFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryPriorityFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryPriorityFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryPriorityFeaturesEXT.memoryPriority ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties const & physicalDeviceMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties.memoryTypeCount ); - for ( size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties.memoryTypes[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties.memoryHeapCount ); - for ( size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties.memoryHeaps[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 const & physicalDeviceMemoryProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMemoryProperties2.memoryProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderFeaturesEXT const & physicalDeviceMeshShaderFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.taskShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.meshShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.multiviewMeshShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.primitiveFragmentShadingRateMeshShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesEXT.meshShaderQueries ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderFeaturesNV const & physicalDeviceMeshShaderFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesNV.taskShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderFeaturesNV.meshShader ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderPropertiesEXT const & physicalDeviceMeshShaderPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskWorkGroupTotalCount ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskWorkGroupCount[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskWorkGroupInvocations ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskWorkGroupSize[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskPayloadSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskSharedMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxTaskPayloadAndSharedMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshWorkGroupTotalCount ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshWorkGroupCount[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshWorkGroupInvocations ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshWorkGroupSize[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshSharedMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshPayloadAndSharedMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshOutputMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshPayloadAndOutputMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshOutputComponents ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshOutputVertices ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshOutputPrimitives ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshOutputLayers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxMeshMultiviewViewCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.meshOutputPerVertexGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.meshOutputPerPrimitiveGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxPreferredTaskWorkGroupInvocations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.maxPreferredMeshWorkGroupInvocations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.prefersLocalInvocationVertexOutput ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.prefersLocalInvocationPrimitiveOutput ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.prefersCompactVertexOutput ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesEXT.prefersCompactPrimitiveOutput ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderPropertiesNV const & physicalDeviceMeshShaderPropertiesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxDrawMeshTasksCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxTaskWorkGroupInvocations ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxTaskWorkGroupSize[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxTaskTotalMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxTaskOutputCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshWorkGroupInvocations ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshWorkGroupSize[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshTotalMemorySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshOutputVertices ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshOutputPrimitives ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.maxMeshMultiviewViewCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.meshOutputPerVertexGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMeshShaderPropertiesNV.meshOutputPerPrimitiveGranularity ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiDrawFeaturesEXT const & physicalDeviceMultiDrawFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawFeaturesEXT.multiDraw ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiDrawPropertiesEXT const & physicalDeviceMultiDrawPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiDrawPropertiesEXT.maxMultiDrawCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & - physicalDeviceMultisampledRenderToSingleSampledFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultisampledRenderToSingleSampledFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultisampledRenderToSingleSampledFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultisampledRenderToSingleSampledFeaturesEXT.multisampledRenderToSingleSampled ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewFeatures const & physicalDeviceMultiviewFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewFeatures.multiview ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewFeatures.multiviewGeometryShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewFeatures.multiviewTessellationShader ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & - physicalDeviceMultiviewPerViewAttributesPropertiesNVX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewPerViewAttributesPropertiesNVX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewPerViewAttributesPropertiesNVX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewPerViewAttributesPropertiesNVX.perViewPositionAllComponents ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewProperties const & physicalDeviceMultiviewProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewProperties.maxMultiviewViewCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMultiviewProperties.maxMultiviewInstanceIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & physicalDeviceMutableDescriptorTypeFeaturesVALVE ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMutableDescriptorTypeFeaturesVALVE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMutableDescriptorTypeFeaturesVALVE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceMutableDescriptorTypeFeaturesVALVE.mutableDescriptorType ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & physicalDeviceNonSeamlessCubeMapFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNonSeamlessCubeMapFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNonSeamlessCubeMapFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceNonSeamlessCubeMapFeaturesEXT.nonSeamlessCubeMap ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePCIBusInfoPropertiesEXT const & physicalDevicePCIBusInfoPropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.pciDomain ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.pciBus ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.pciDevice ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePCIBusInfoPropertiesEXT.pciFunction ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & physicalDevicePageableDeviceLocalMemoryFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePageableDeviceLocalMemoryFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePageableDeviceLocalMemoryFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePageableDeviceLocalMemoryFeaturesEXT.pageableDeviceLocalMemory ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePerformanceQueryFeaturesKHR const & physicalDevicePerformanceQueryFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryFeaturesKHR.performanceCounterQueryPools ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryFeaturesKHR.performanceCounterMultipleQueryPools ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePerformanceQueryPropertiesKHR const & physicalDevicePerformanceQueryPropertiesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePerformanceQueryPropertiesKHR.allowCommandBufferQueryCopies ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineCreationCacheControlFeatures const & physicalDevicePipelineCreationCacheControlFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineCreationCacheControlFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineCreationCacheControlFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineCreationCacheControlFeatures.pipelineCreationCacheControl ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & - physicalDevicePipelineExecutablePropertiesFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineExecutablePropertiesFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineExecutablePropertiesFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineExecutablePropertiesFeaturesKHR.pipelineExecutableInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelinePropertiesFeaturesEXT const & physicalDevicePipelinePropertiesFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelinePropertiesFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelinePropertiesFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelinePropertiesFeaturesEXT.pipelinePropertiesIdentifier ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineRobustnessFeaturesEXT const & physicalDevicePipelineRobustnessFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessFeaturesEXT.pipelineRobustness ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineRobustnessPropertiesEXT const & physicalDevicePipelineRobustnessPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.defaultRobustnessStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.defaultRobustnessUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.defaultRobustnessVertexInputs ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePipelineRobustnessPropertiesEXT.defaultRobustnessImages ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePointClippingProperties const & physicalDevicePointClippingProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePointClippingProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePointClippingProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePointClippingProperties.pointClippingBehavior ); - return seed; - } - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePortabilitySubsetFeaturesKHR const & physicalDevicePortabilitySubsetFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.constantAlphaColorBlendFactors ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.events ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.imageViewFormatReinterpretation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.imageViewFormatSwizzle ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.imageView2DOn3DImage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.multisampleArrayImage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.mutableComparisonSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.pointPolygons ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.samplerMipLodBias ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.separateStencilMaskRef ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.shaderSampleRateInterpolationFunctions ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.tessellationIsolines ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.tessellationPointMode ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.triangleFans ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetFeaturesKHR.vertexAttributeAccessBeyondStride ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePortabilitySubsetPropertiesKHR const & physicalDevicePortabilitySubsetPropertiesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePortabilitySubsetPropertiesKHR.minVertexInputBindingStrideAlignment ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePresentIdFeaturesKHR const & physicalDevicePresentIdFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentIdFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentIdFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentIdFeaturesKHR.presentId ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePresentWaitFeaturesKHR const & physicalDevicePresentWaitFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentWaitFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentWaitFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePresentWaitFeaturesKHR.presentWait ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & - physicalDevicePrimitiveTopologyListRestartFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitiveTopologyListRestartFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitiveTopologyListRestartFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitiveTopologyListRestartFeaturesEXT.primitiveTopologyListRestart ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitiveTopologyListRestartFeaturesEXT.primitiveTopologyPatchListRestart ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & physicalDevicePrimitivesGeneratedQueryFeaturesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitivesGeneratedQueryFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitivesGeneratedQueryFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitivesGeneratedQueryFeaturesEXT.primitivesGeneratedQuery ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitivesGeneratedQueryFeaturesEXT.primitivesGeneratedQueryWithRasterizerDiscard ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrimitivesGeneratedQueryFeaturesEXT.primitivesGeneratedQueryWithNonZeroStreams ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePrivateDataFeatures const & physicalDevicePrivateDataFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrivateDataFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrivateDataFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePrivateDataFeatures.privateData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseProperties const & physicalDeviceSparseProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseProperties.residencyStandard2DBlockShape ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseProperties.residencyStandard2DMultisampleBlockShape ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseProperties.residencyStandard3DBlockShape ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseProperties.residencyAlignedMipSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseProperties.residencyNonResidentStrict ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties const & physicalDeviceProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.apiVersion ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.driverVersion ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.vendorID ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.deviceID ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.deviceType ); - for ( size_t i = 0; i < VK_MAX_PHYSICAL_DEVICE_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.deviceName[i] ); - } - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.pipelineCacheUUID[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.limits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties.sparseProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 const & physicalDeviceProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProperties2.properties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProtectedMemoryFeatures const & physicalDeviceProtectedMemoryFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryFeatures.protectedMemory ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProtectedMemoryProperties const & physicalDeviceProtectedMemoryProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProtectedMemoryProperties.protectedNoFault ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProvokingVertexFeaturesEXT const & physicalDeviceProvokingVertexFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexFeaturesEXT.provokingVertexLast ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexFeaturesEXT.transformFeedbackPreservesProvokingVertex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceProvokingVertexPropertiesEXT const & physicalDeviceProvokingVertexPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexPropertiesEXT.provokingVertexModePerPipeline ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceProvokingVertexPropertiesEXT.transformFeedbackPreservesTriangleFanProvokingVertex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDevicePushDescriptorPropertiesKHR const & physicalDevicePushDescriptorPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePushDescriptorPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePushDescriptorPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDevicePushDescriptorPropertiesKHR.maxPushDescriptors ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & physicalDeviceRGBA10X6FormatsFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRGBA10X6FormatsFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRGBA10X6FormatsFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRGBA10X6FormatsFeaturesEXT.formatRgba10x6WithoutYCbCrSampler ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & - physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT.rasterizationOrderColorAttachmentAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT.rasterizationOrderDepthAttachmentAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT.rasterizationOrderStencilAttachmentAccess ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayQueryFeaturesKHR const & physicalDeviceRayQueryFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayQueryFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayQueryFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayQueryFeaturesKHR.rayQuery ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & physicalDeviceRayTracingMaintenance1FeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMaintenance1FeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMaintenance1FeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMaintenance1FeaturesKHR.rayTracingMaintenance1 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMaintenance1FeaturesKHR.rayTracingPipelineTraceRaysIndirect2 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingMotionBlurFeaturesNV const & physicalDeviceRayTracingMotionBlurFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMotionBlurFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMotionBlurFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMotionBlurFeaturesNV.rayTracingMotionBlur ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingMotionBlurFeaturesNV.rayTracingMotionBlurPipelineTraceRaysIndirect ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPipelineFeaturesKHR const & physicalDeviceRayTracingPipelineFeaturesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.rayTracingPipeline ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.rayTracingPipelineShaderGroupHandleCaptureReplay ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.rayTracingPipelineShaderGroupHandleCaptureReplayMixed ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.rayTracingPipelineTraceRaysIndirect ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelineFeaturesKHR.rayTraversalPrimitiveCulling ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPipelinePropertiesKHR const & physicalDeviceRayTracingPipelinePropertiesKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.shaderGroupHandleSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.maxRayRecursionDepth ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.maxShaderGroupStride ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.shaderGroupBaseAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.shaderGroupHandleCaptureReplaySize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.maxRayDispatchInvocationCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.shaderGroupHandleAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPipelinePropertiesKHR.maxRayHitAttributeSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPropertiesNV const & physicalDeviceRayTracingPropertiesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.shaderGroupHandleSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxRecursionDepth ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxShaderGroupStride ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.shaderGroupBaseAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxGeometryCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxInstanceCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxTriangleCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRayTracingPropertiesNV.maxDescriptorSetAccelerationStructures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & physicalDeviceRepresentativeFragmentTestFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRepresentativeFragmentTestFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRepresentativeFragmentTestFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRepresentativeFragmentTestFeaturesNV.representativeFragmentTest ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRobustness2FeaturesEXT const & physicalDeviceRobustness2FeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2FeaturesEXT.robustBufferAccess2 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2FeaturesEXT.robustImageAccess2 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2FeaturesEXT.nullDescriptor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceRobustness2PropertiesEXT const & physicalDeviceRobustness2PropertiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2PropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2PropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2PropertiesEXT.robustStorageBufferAccessSizeAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceRobustness2PropertiesEXT.robustUniformBufferAccessSizeAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSampleLocationsPropertiesEXT const & physicalDeviceSampleLocationsPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.sampleLocationSampleCounts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.maxSampleLocationGridSize ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.sampleLocationCoordinateRange[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.sampleLocationSubPixelBits ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSampleLocationsPropertiesEXT.variableSampleLocations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSamplerFilterMinmaxProperties const & physicalDeviceSamplerFilterMinmaxProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerFilterMinmaxProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerFilterMinmaxProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerFilterMinmaxProperties.filterMinmaxSingleComponentFormats ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerFilterMinmaxProperties.filterMinmaxImageComponentMapping ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSamplerYcbcrConversionFeatures const & physicalDeviceSamplerYcbcrConversionFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerYcbcrConversionFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerYcbcrConversionFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSamplerYcbcrConversionFeatures.samplerYcbcrConversion ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceScalarBlockLayoutFeatures const & physicalDeviceScalarBlockLayoutFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceScalarBlockLayoutFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceScalarBlockLayoutFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceScalarBlockLayoutFeatures.scalarBlockLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & physicalDeviceSeparateDepthStencilLayoutsFeatures ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSeparateDepthStencilLayoutsFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSeparateDepthStencilLayoutsFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSeparateDepthStencilLayoutsFeatures.separateDepthStencilLayouts ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & physicalDeviceShaderAtomicFloat2FeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderBufferFloat16Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderBufferFloat16AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderBufferFloat16AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderBufferFloat32AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderBufferFloat64AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderSharedFloat16Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderSharedFloat16AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderSharedFloat16AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderSharedFloat32AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderSharedFloat64AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.shaderImageFloat32AtomicMinMax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloat2FeaturesEXT.sparseImageFloat32AtomicMinMax ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicFloatFeaturesEXT const & physicalDeviceShaderAtomicFloatFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderBufferFloat32Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderBufferFloat32AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderBufferFloat64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderBufferFloat64AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderSharedFloat32Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderSharedFloat32AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderSharedFloat64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderSharedFloat64AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderImageFloat32Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.shaderImageFloat32AtomicAdd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.sparseImageFloat32Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicFloatFeaturesEXT.sparseImageFloat32AtomicAdd ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicInt64Features const & physicalDeviceShaderAtomicInt64Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicInt64Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicInt64Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicInt64Features.shaderBufferInt64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderAtomicInt64Features.shaderSharedInt64Atomics ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderClockFeaturesKHR const & physicalDeviceShaderClockFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderClockFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderClockFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderClockFeaturesKHR.shaderSubgroupClock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderClockFeaturesKHR.shaderDeviceClock ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderCoreProperties2AMD const & physicalDeviceShaderCoreProperties2AMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCoreProperties2AMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCoreProperties2AMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCoreProperties2AMD.shaderCoreFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCoreProperties2AMD.activeComputeUnitCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderCorePropertiesAMD const & physicalDeviceShaderCorePropertiesAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.shaderEngineCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.shaderArraysPerEngineCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.computeUnitsPerShaderArray ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.simdPerComputeUnit ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.wavefrontsPerSimd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.wavefrontSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.sgprsPerSimd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.minSgprAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.maxSgprAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.sgprAllocationGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.vgprsPerSimd ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.minVgprAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.maxVgprAllocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderCorePropertiesAMD.vgprAllocationGranularity ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & - physicalDeviceShaderDemoteToHelperInvocationFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDemoteToHelperInvocationFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDemoteToHelperInvocationFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDemoteToHelperInvocationFeatures.shaderDemoteToHelperInvocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderDrawParametersFeatures const & physicalDeviceShaderDrawParametersFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDrawParametersFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDrawParametersFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderDrawParametersFeatures.shaderDrawParameters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & - physicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD.shaderEarlyAndLateFragmentTests ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderFloat16Int8Features const & physicalDeviceShaderFloat16Int8Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderFloat16Int8Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderFloat16Int8Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderFloat16Int8Features.shaderFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderFloat16Int8Features.shaderInt8 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & physicalDeviceShaderImageAtomicInt64FeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageAtomicInt64FeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageAtomicInt64FeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageAtomicInt64FeaturesEXT.shaderImageInt64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageAtomicInt64FeaturesEXT.sparseImageInt64Atomics ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderImageFootprintFeaturesNV const & physicalDeviceShaderImageFootprintFeaturesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageFootprintFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageFootprintFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderImageFootprintFeaturesNV.imageFootprint ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerDotProductFeatures const & physicalDeviceShaderIntegerDotProductFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductFeatures.shaderIntegerDotProduct ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerDotProductProperties const & physicalDeviceShaderIntegerDotProductProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct8BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct8BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct8BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct4x8BitPackedUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct4x8BitPackedSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct4x8BitPackedMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct16BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct16BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct16BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct32BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct32BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct32BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct64BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct64BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProduct64BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, - physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerDotProductProperties.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & physicalDeviceShaderIntegerFunctions2FeaturesINTEL ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerFunctions2FeaturesINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerFunctions2FeaturesINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderIntegerFunctions2FeaturesINTEL.shaderIntegerFunctions2 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & physicalDeviceShaderModuleIdentifierFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierFeaturesEXT.shaderModuleIdentifier ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & physicalDeviceShaderModuleIdentifierPropertiesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierPropertiesEXT.pNext ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderModuleIdentifierPropertiesEXT.shaderModuleIdentifierAlgorithmUUID[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSMBuiltinsFeaturesNV const & physicalDeviceShaderSMBuiltinsFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsFeaturesNV.shaderSMBuiltins ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSMBuiltinsPropertiesNV const & physicalDeviceShaderSMBuiltinsPropertiesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsPropertiesNV.shaderSMCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSMBuiltinsPropertiesNV.shaderWarpsPerSM ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & physicalDeviceShaderSubgroupExtendedTypesFeatures ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupExtendedTypesFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupExtendedTypesFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupExtendedTypesFeatures.shaderSubgroupExtendedTypes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & - physicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.shaderSubgroupUniformControlFlow ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderTerminateInvocationFeatures const & physicalDeviceShaderTerminateInvocationFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderTerminateInvocationFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderTerminateInvocationFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShaderTerminateInvocationFeatures.shaderTerminateInvocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShadingRateImageFeaturesNV const & physicalDeviceShadingRateImageFeaturesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImageFeaturesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImageFeaturesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImageFeaturesNV.shadingRateImage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImageFeaturesNV.shadingRateCoarseSampleOrder ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceShadingRateImagePropertiesNV const & physicalDeviceShadingRateImagePropertiesNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImagePropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImagePropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImagePropertiesNV.shadingRateTexelSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImagePropertiesNV.shadingRatePaletteSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceShadingRateImagePropertiesNV.shadingRateMaxCoarseSamples ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 const & physicalDeviceSparseImageFormatInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.format ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.type ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.samples ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.usage ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSparseImageFormatInfo2.tiling ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupProperties const & physicalDeviceSubgroupProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.subgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.supportedStages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.supportedOperations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupProperties.quadOperationsInAllStages ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupSizeControlFeatures const & physicalDeviceSubgroupSizeControlFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlFeatures.subgroupSizeControl ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlFeatures.computeFullSubgroups ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupSizeControlProperties const & physicalDeviceSubgroupSizeControlProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.minSubgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.maxSubgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.maxComputeWorkgroupSubgroups ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubgroupSizeControlProperties.requiredSubgroupSizeStages ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & physicalDeviceSubpassMergeFeedbackFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassMergeFeedbackFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassMergeFeedbackFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassMergeFeedbackFeaturesEXT.subpassMergeFeedback ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassShadingFeaturesHUAWEI const & physicalDeviceSubpassShadingFeaturesHUAWEI ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingFeaturesHUAWEI.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingFeaturesHUAWEI.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingFeaturesHUAWEI.subpassShading ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassShadingPropertiesHUAWEI const & physicalDeviceSubpassShadingPropertiesHUAWEI ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingPropertiesHUAWEI.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingPropertiesHUAWEI.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSubpassShadingPropertiesHUAWEI.maxSubpassShadingWorkgroupSizeAspectRatio ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR const & physicalDeviceSurfaceInfo2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSurfaceInfo2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSurfaceInfo2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSurfaceInfo2KHR.surface ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceSynchronization2Features const & physicalDeviceSynchronization2Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSynchronization2Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSynchronization2Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceSynchronization2Features.synchronization2 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & physicalDeviceTexelBufferAlignmentFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentFeaturesEXT.texelBufferAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTexelBufferAlignmentProperties const & physicalDeviceTexelBufferAlignmentProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.storageTexelBufferOffsetAlignmentBytes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.storageTexelBufferOffsetSingleTexelAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.uniformTexelBufferOffsetAlignmentBytes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTexelBufferAlignmentProperties.uniformTexelBufferOffsetSingleTexelAlignment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceTextureCompressionASTCHDRFeatures const & physicalDeviceTextureCompressionASTCHDRFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTextureCompressionASTCHDRFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTextureCompressionASTCHDRFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTextureCompressionASTCHDRFeatures.textureCompressionASTC_HDR ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTilePropertiesFeaturesQCOM const & physicalDeviceTilePropertiesFeaturesQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTilePropertiesFeaturesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTilePropertiesFeaturesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTilePropertiesFeaturesQCOM.tileProperties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTimelineSemaphoreFeatures const & physicalDeviceTimelineSemaphoreFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreFeatures.timelineSemaphore ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTimelineSemaphoreProperties const & physicalDeviceTimelineSemaphoreProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTimelineSemaphoreProperties.maxTimelineSemaphoreValueDifference ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties const & physicalDeviceToolProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.pNext ); - for ( size_t i = 0; i < VK_MAX_EXTENSION_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.name[i] ); - } - for ( size_t i = 0; i < VK_MAX_EXTENSION_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.version[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.purposes ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.description[i] ); - } - for ( size_t i = 0; i < VK_MAX_EXTENSION_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceToolProperties.layer[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTransformFeedbackFeaturesEXT const & physicalDeviceTransformFeedbackFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackFeaturesEXT.transformFeedback ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackFeaturesEXT.geometryStreams ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceTransformFeedbackPropertiesEXT const & physicalDeviceTransformFeedbackPropertiesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackStreams ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackBufferSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackStreamDataSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataStride ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.transformFeedbackQueries ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.transformFeedbackStreamsLinesTriangles ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.transformFeedbackRasterizationStreamSelect ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceTransformFeedbackPropertiesEXT.transformFeedbackDraw ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceUniformBufferStandardLayoutFeatures const & physicalDeviceUniformBufferStandardLayoutFeatures ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceUniformBufferStandardLayoutFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceUniformBufferStandardLayoutFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceUniformBufferStandardLayoutFeatures.uniformBufferStandardLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVariablePointersFeatures const & physicalDeviceVariablePointersFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVariablePointersFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVariablePointersFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVariablePointersFeatures.variablePointersStorageBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVariablePointersFeatures.variablePointers ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & physicalDeviceVertexAttributeDivisorFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorFeaturesEXT.vertexAttributeInstanceRateDivisor ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorFeaturesEXT.vertexAttributeInstanceRateZeroDivisor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & physicalDeviceVertexAttributeDivisorPropertiesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorPropertiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorPropertiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexAttributeDivisorPropertiesEXT.maxVertexAttribDivisor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & physicalDeviceVertexInputDynamicStateFeaturesEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexInputDynamicStateFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexInputDynamicStateFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVertexInputDynamicStateFeaturesEXT.vertexInputDynamicState ); - return seed; - } - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR const & physicalDeviceVideoFormatInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVideoFormatInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVideoFormatInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVideoFormatInfoKHR.imageUsage ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan11Features const & physicalDeviceVulkan11Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.storageBuffer16BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.uniformAndStorageBuffer16BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.storagePushConstant16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.storageInputOutput16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.multiview ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.multiviewGeometryShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.multiviewTessellationShader ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.variablePointersStorageBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.variablePointers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.protectedMemory ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.samplerYcbcrConversion ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Features.shaderDrawParameters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan11Properties const & physicalDeviceVulkan11Properties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.pNext ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.deviceUUID[i] ); - } - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.driverUUID[i] ); - } - for ( size_t i = 0; i < VK_LUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.deviceLUID[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.deviceNodeMask ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.deviceLUIDValid ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.subgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.subgroupSupportedStages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.subgroupSupportedOperations ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.subgroupQuadOperationsInAllStages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.pointClippingBehavior ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.maxMultiviewViewCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.maxMultiviewInstanceIndex ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.protectedNoFault ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.maxPerSetDescriptors ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan11Properties.maxMemoryAllocationSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan12Features const & physicalDeviceVulkan12Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.samplerMirrorClampToEdge ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.drawIndirectCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.storageBuffer8BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.uniformAndStorageBuffer8BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.storagePushConstant8 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderBufferInt64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderSharedInt64Atomics ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderInt8 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderInputAttachmentArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderUniformTexelBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderStorageTexelBufferArrayDynamicIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderUniformBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderSampledImageArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderStorageBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderStorageImageArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderInputAttachmentArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderUniformTexelBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderStorageTexelBufferArrayNonUniformIndexing ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingUniformBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingSampledImageUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingStorageImageUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingStorageBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingUniformTexelBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingStorageTexelBufferUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingUpdateUnusedWhilePending ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingPartiallyBound ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.descriptorBindingVariableDescriptorCount ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.runtimeDescriptorArray ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.samplerFilterMinmax ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.scalarBlockLayout ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.imagelessFramebuffer ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.uniformBufferStandardLayout ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderSubgroupExtendedTypes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.separateDepthStencilLayouts ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.hostQueryReset ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.timelineSemaphore ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.bufferDeviceAddress ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.bufferDeviceAddressCaptureReplay ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.bufferDeviceAddressMultiDevice ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.vulkanMemoryModel ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.vulkanMemoryModelDeviceScope ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.vulkanMemoryModelAvailabilityVisibilityChains ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderOutputViewportIndex ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.shaderOutputLayer ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Features.subgroupBroadcastDynamicId ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan12Properties const & physicalDeviceVulkan12Properties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.driverID ); - for ( size_t i = 0; i < VK_MAX_DRIVER_NAME_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.driverName[i] ); - } - for ( size_t i = 0; i < VK_MAX_DRIVER_INFO_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.driverInfo[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.conformanceVersion ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.denormBehaviorIndependence ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.roundingModeIndependence ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderSignedZeroInfNanPreserveFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderSignedZeroInfNanPreserveFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderSignedZeroInfNanPreserveFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormPreserveFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormPreserveFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormPreserveFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormFlushToZeroFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormFlushToZeroFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderDenormFlushToZeroFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTEFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTEFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTEFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTZFloat16 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTZFloat32 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderRoundingModeRTZFloat64 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderUniformBufferArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderSampledImageArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderStorageBufferArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderStorageImageArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.shaderInputAttachmentArrayNonUniformIndexingNative ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.robustBufferAccessUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.quadDivergentImplicitLod ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxPerStageUpdateAfterBindResources ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.supportedDepthResolveModes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.supportedStencilResolveModes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.independentResolveNone ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.independentResolve ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.filterMinmaxSingleComponentFormats ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.filterMinmaxImageComponentMapping ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.maxTimelineSemaphoreValueDifference ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan12Properties.framebufferIntegerColorSampleCounts ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan13Features const & physicalDeviceVulkan13Features ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.robustImageAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.inlineUniformBlock ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.descriptorBindingInlineUniformBlockUpdateAfterBind ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.pipelineCreationCacheControl ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.privateData ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.shaderDemoteToHelperInvocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.shaderTerminateInvocation ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.subgroupSizeControl ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.computeFullSubgroups ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.synchronization2 ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.textureCompressionASTC_HDR ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.shaderZeroInitializeWorkgroupMemory ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.dynamicRendering ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.shaderIntegerDotProduct ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Features.maintenance4 ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan13Properties const & physicalDeviceVulkan13Properties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.minSubgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxSubgroupSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxComputeWorkgroupSubgroups ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.requiredSubgroupSizeStages ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxInlineUniformBlockSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxPerStageDescriptorInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxDescriptorSetInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxDescriptorSetUpdateAfterBindInlineUniformBlocks ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxInlineUniformTotalSize ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct8BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct8BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct8BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct4x8BitPackedUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct4x8BitPackedSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct4x8BitPackedMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct16BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct16BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct16BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct32BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct32BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct32BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct64BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct64BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProduct64BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating8BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating16BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating32BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating64BitSignedAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.storageTexelBufferOffsetAlignmentBytes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.storageTexelBufferOffsetSingleTexelAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.uniformTexelBufferOffsetAlignmentBytes ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.uniformTexelBufferOffsetSingleTexelAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkan13Properties.maxBufferSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkanMemoryModelFeatures const & physicalDeviceVulkanMemoryModelFeatures ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkanMemoryModelFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkanMemoryModelFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkanMemoryModelFeatures.vulkanMemoryModel ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkanMemoryModelFeatures.vulkanMemoryModelDeviceScope ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceVulkanMemoryModelFeatures.vulkanMemoryModelAvailabilityVisibilityChains ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & - physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.workgroupMemoryExplicitLayout ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.workgroupMemoryExplicitLayoutScalarBlockLayout ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.workgroupMemoryExplicitLayout8BitAccess ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.workgroupMemoryExplicitLayout16BitAccess ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & physicalDeviceYcbcr2Plane444FormatsFeaturesEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcr2Plane444FormatsFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcr2Plane444FormatsFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcr2Plane444FormatsFeaturesEXT.ycbcr2plane444Formats ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrImageArraysFeaturesEXT const & physicalDeviceYcbcrImageArraysFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrImageArraysFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrImageArraysFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceYcbcrImageArraysFeaturesEXT.ycbcrImageArrays ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & physicalDeviceZeroInitializeWorkgroupMemoryFeatures ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceZeroInitializeWorkgroupMemoryFeatures.sType ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceZeroInitializeWorkgroupMemoryFeatures.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, physicalDeviceZeroInitializeWorkgroupMemoryFeatures.shaderZeroInitializeWorkgroupMemory ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo const & pipelineCacheCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheCreateInfo.initialDataSize ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheCreateInfo.pInitialData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersionOne const & pipelineCacheHeaderVersionOne ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheHeaderVersionOne.headerSize ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheHeaderVersionOne.headerVersion ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheHeaderVersionOne.vendorID ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheHeaderVersionOne.deviceID ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineCacheHeaderVersionOne.pipelineCacheUUID[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineColorBlendAdvancedStateCreateInfoEXT const & pipelineColorBlendAdvancedStateCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAdvancedStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAdvancedStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAdvancedStateCreateInfoEXT.srcPremultiplied ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAdvancedStateCreateInfoEXT.dstPremultiplied ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorBlendAdvancedStateCreateInfoEXT.blendOverlap ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineColorWriteCreateInfoEXT const & pipelineColorWriteCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorWriteCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorWriteCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorWriteCreateInfoEXT.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineColorWriteCreateInfoEXT.pColorWriteEnables ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCompilerControlCreateInfoAMD const & pipelineCompilerControlCreateInfoAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCompilerControlCreateInfoAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCompilerControlCreateInfoAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCompilerControlCreateInfoAMD.compilerControlFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateInfoNV const & pipelineCoverageModulationStateCreateInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.coverageModulationMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.coverageModulationTableEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.coverageModulationTableCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageModulationStateCreateInfoNV.pCoverageModulationTable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCoverageReductionStateCreateInfoNV const & pipelineCoverageReductionStateCreateInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageReductionStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageReductionStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageReductionStateCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageReductionStateCreateInfoNV.coverageReductionMode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineCoverageToColorStateCreateInfoNV const & pipelineCoverageToColorStateCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageToColorStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageToColorStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageToColorStateCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageToColorStateCreateInfoNV.coverageToColorEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCoverageToColorStateCreateInfoNV.coverageToColorLocation ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCreationFeedback const & pipelineCreationFeedback ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedback.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedback.duration ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineCreationFeedbackCreateInfo const & pipelineCreationFeedbackCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedbackCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedbackCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedbackCreateInfo.pPipelineCreationFeedback ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedbackCreateInfo.pipelineStageCreationFeedbackCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineCreationFeedbackCreateInfo.pPipelineStageCreationFeedbacks ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateInfoEXT const & pipelineDiscardRectangleStateCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.discardRectangleMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.discardRectangleCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineDiscardRectangleStateCreateInfoEXT.pDiscardRectangles ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR const & pipelineExecutableInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInfoKHR.pipeline ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInfoKHR.executableIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineExecutableInternalRepresentationKHR const & pipelineExecutableInternalRepresentationKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.pNext ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.name[i] ); - } - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.description[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.isText ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.dataSize ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutableInternalRepresentationKHR.pData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineExecutablePropertiesKHR const & pipelineExecutablePropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.stages ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.name[i] ); - } - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.description[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, pipelineExecutablePropertiesKHR.subgroupSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineFragmentShadingRateEnumStateCreateInfoNV const & pipelineFragmentShadingRateEnumStateCreateInfoNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateEnumStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateEnumStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateEnumStateCreateInfoNV.shadingRateType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateEnumStateCreateInfoNV.shadingRate ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateEnumStateCreateInfoNV.combinerOps[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineFragmentShadingRateStateCreateInfoKHR const & pipelineFragmentShadingRateStateCreateInfoKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateStateCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateStateCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateStateCreateInfoKHR.fragmentSize ); - for ( size_t i = 0; i < 2; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelineFragmentShadingRateStateCreateInfoKHR.combinerOps[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineInfoKHR const & pipelineInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineInfoKHR.pipeline ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PushConstantRange const & pushConstantRange ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pushConstantRange.stageFlags ); - VULKAN_HPP_HASH_COMBINE( seed, pushConstantRange.offset ); - VULKAN_HPP_HASH_COMBINE( seed, pushConstantRange.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo const & pipelineLayoutCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.setLayoutCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.pSetLayouts ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.pushConstantRangeCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLayoutCreateInfo.pPushConstantRanges ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR const & pipelineLibraryCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineLibraryCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLibraryCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLibraryCreateInfoKHR.libraryCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineLibraryCreateInfoKHR.pLibraries ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelinePropertiesIdentifierEXT const & pipelinePropertiesIdentifierEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelinePropertiesIdentifierEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelinePropertiesIdentifierEXT.pNext ); - for ( size_t i = 0; i < VK_UUID_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, pipelinePropertiesIdentifierEXT.pipelineIdentifier[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationConservativeStateCreateInfoEXT const & pipelineRasterizationConservativeStateCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationConservativeStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationConservativeStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationConservativeStateCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationConservativeStateCreateInfoEXT.conservativeRasterizationMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationConservativeStateCreateInfoEXT.extraPrimitiveOverestimationSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationDepthClipStateCreateInfoEXT const & pipelineRasterizationDepthClipStateCreateInfoEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationDepthClipStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationDepthClipStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationDepthClipStateCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationDepthClipStateCreateInfoEXT.depthClipEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationLineStateCreateInfoEXT const & pipelineRasterizationLineStateCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.lineRasterizationMode ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.stippledLineEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.lineStippleFactor ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationLineStateCreateInfoEXT.lineStipplePattern ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationProvokingVertexStateCreateInfoEXT const & - pipelineRasterizationProvokingVertexStateCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationProvokingVertexStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationProvokingVertexStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationProvokingVertexStateCreateInfoEXT.provokingVertexMode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PipelineRasterizationStateRasterizationOrderAMD const & pipelineRasterizationStateRasterizationOrderAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateRasterizationOrderAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateRasterizationOrderAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateRasterizationOrderAMD.rasterizationOrder ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateStreamCreateInfoEXT const & pipelineRasterizationStateStreamCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateStreamCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateStreamCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateStreamCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRasterizationStateStreamCreateInfoEXT.rasterizationStream ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRenderingCreateInfo const & pipelineRenderingCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.viewMask ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.pColorAttachmentFormats ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.depthAttachmentFormat ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRenderingCreateInfo.stencilAttachmentFormat ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineRepresentativeFragmentTestStateCreateInfoNV const & pipelineRepresentativeFragmentTestStateCreateInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRepresentativeFragmentTestStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRepresentativeFragmentTestStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRepresentativeFragmentTestStateCreateInfoNV.representativeFragmentTestEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineRobustnessCreateInfoEXT const & pipelineRobustnessCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.storageBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.uniformBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.vertexInputs ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineRobustnessCreateInfoEXT.images ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineSampleLocationsStateCreateInfoEXT const & pipelineSampleLocationsStateCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineSampleLocationsStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineSampleLocationsStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineSampleLocationsStateCreateInfoEXT.sampleLocationsEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineSampleLocationsStateCreateInfoEXT.sampleLocationsInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineShaderStageModuleIdentifierCreateInfoEXT const & pipelineShaderStageModuleIdentifierCreateInfoEXT ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageModuleIdentifierCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageModuleIdentifierCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageModuleIdentifierCreateInfoEXT.identifierSize ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageModuleIdentifierCreateInfoEXT.pIdentifier ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineShaderStageRequiredSubgroupSizeCreateInfo const & pipelineShaderStageRequiredSubgroupSizeCreateInfo ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageRequiredSubgroupSizeCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageRequiredSubgroupSizeCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineShaderStageRequiredSubgroupSizeCreateInfo.requiredSubgroupSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::PipelineTessellationDomainOriginStateCreateInfo const & pipelineTessellationDomainOriginStateCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationDomainOriginStateCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationDomainOriginStateCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineTessellationDomainOriginStateCreateInfo.domainOrigin ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::VertexInputBindingDivisorDescriptionEXT const & vertexInputBindingDivisorDescriptionEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDivisorDescriptionEXT.binding ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDivisorDescriptionEXT.divisor ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineVertexInputDivisorStateCreateInfoEXT const & pipelineVertexInputDivisorStateCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputDivisorStateCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputDivisorStateCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputDivisorStateCreateInfoEXT.vertexBindingDivisorCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineVertexInputDivisorStateCreateInfoEXT.pVertexBindingDivisors ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineViewportCoarseSampleOrderStateCreateInfoNV const & pipelineViewportCoarseSampleOrderStateCreateInfoNV ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportCoarseSampleOrderStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportCoarseSampleOrderStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportCoarseSampleOrderStateCreateInfoNV.sampleOrderType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportCoarseSampleOrderStateCreateInfoNV.customSampleOrderCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportCoarseSampleOrderStateCreateInfoNV.pCustomSampleOrders ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineViewportDepthClipControlCreateInfoEXT const & pipelineViewportDepthClipControlCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportDepthClipControlCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportDepthClipControlCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportDepthClipControlCreateInfoEXT.negativeOneToOne ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineViewportExclusiveScissorStateCreateInfoNV const & pipelineViewportExclusiveScissorStateCreateInfoNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportExclusiveScissorStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportExclusiveScissorStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportExclusiveScissorStateCreateInfoNV.exclusiveScissorCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportExclusiveScissorStateCreateInfoNV.pExclusiveScissors ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV const & shadingRatePaletteNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shadingRatePaletteNV.shadingRatePaletteEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, shadingRatePaletteNV.pShadingRatePaletteEntries ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PipelineViewportShadingRateImageStateCreateInfoNV const & pipelineViewportShadingRateImageStateCreateInfoNV ) - const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportShadingRateImageStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportShadingRateImageStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportShadingRateImageStateCreateInfoNV.shadingRateImageEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportShadingRateImageStateCreateInfoNV.viewportCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportShadingRateImageStateCreateInfoNV.pShadingRatePalettes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ViewportSwizzleNV const & viewportSwizzleNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, viewportSwizzleNV.x ); - VULKAN_HPP_HASH_COMBINE( seed, viewportSwizzleNV.y ); - VULKAN_HPP_HASH_COMBINE( seed, viewportSwizzleNV.z ); - VULKAN_HPP_HASH_COMBINE( seed, viewportSwizzleNV.w ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateInfoNV const & pipelineViewportSwizzleStateCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportSwizzleStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportSwizzleStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportSwizzleStateCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportSwizzleStateCreateInfoNV.viewportCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportSwizzleStateCreateInfoNV.pViewportSwizzles ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ViewportWScalingNV const & viewportWScalingNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, viewportWScalingNV.xcoeff ); - VULKAN_HPP_HASH_COMBINE( seed, viewportWScalingNV.ycoeff ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::PipelineViewportWScalingStateCreateInfoNV const & pipelineViewportWScalingStateCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportWScalingStateCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportWScalingStateCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportWScalingStateCreateInfoNV.viewportWScalingEnable ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportWScalingStateCreateInfoNV.viewportCount ); - VULKAN_HPP_HASH_COMBINE( seed, pipelineViewportWScalingStateCreateInfoNV.pViewportWScalings ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_GGP ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentFrameTokenGGP const & presentFrameTokenGGP ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentFrameTokenGGP.sType ); - VULKAN_HPP_HASH_COMBINE( seed, presentFrameTokenGGP.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, presentFrameTokenGGP.frameToken ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_GGP*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentIdKHR const & presentIdKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentIdKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, presentIdKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, presentIdKHR.swapchainCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentIdKHR.pPresentIds ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentInfoKHR const & presentInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.waitSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.pWaitSemaphores ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.swapchainCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.pSwapchains ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.pImageIndices ); - VULKAN_HPP_HASH_COMBINE( seed, presentInfoKHR.pResults ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RectLayerKHR const & rectLayerKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rectLayerKHR.offset ); - VULKAN_HPP_HASH_COMBINE( seed, rectLayerKHR.extent ); - VULKAN_HPP_HASH_COMBINE( seed, rectLayerKHR.layer ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentRegionKHR const & presentRegionKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentRegionKHR.rectangleCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentRegionKHR.pRectangles ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentRegionsKHR const & presentRegionsKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentRegionsKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, presentRegionsKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, presentRegionsKHR.swapchainCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentRegionsKHR.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentTimeGOOGLE const & presentTimeGOOGLE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentTimeGOOGLE.presentID ); - VULKAN_HPP_HASH_COMBINE( seed, presentTimeGOOGLE.desiredPresentTime ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PresentTimesInfoGOOGLE const & presentTimesInfoGOOGLE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, presentTimesInfoGOOGLE.sType ); - VULKAN_HPP_HASH_COMBINE( seed, presentTimesInfoGOOGLE.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, presentTimesInfoGOOGLE.swapchainCount ); - VULKAN_HPP_HASH_COMBINE( seed, presentTimesInfoGOOGLE.pTimes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & privateDataSlotCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, privateDataSlotCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, privateDataSlotCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, privateDataSlotCreateInfo.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ProtectedSubmitInfo const & protectedSubmitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, protectedSubmitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, protectedSubmitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, protectedSubmitInfo.protectedSubmit ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo const & queryPoolCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.queryType ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.queryCount ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolCreateInfo.pipelineStatistics ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR const & queryPoolPerformanceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceCreateInfoKHR.queueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceCreateInfoKHR.counterIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceCreateInfoKHR.pCounterIndices ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::QueryPoolPerformanceQueryCreateInfoINTEL const & queryPoolPerformanceQueryCreateInfoINTEL ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceQueryCreateInfoINTEL.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceQueryCreateInfoINTEL.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queryPoolPerformanceQueryCreateInfoINTEL.performanceCountersSampling ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueueFamilyCheckpointProperties2NV const & queueFamilyCheckpointProperties2NV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointProperties2NV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointProperties2NV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointProperties2NV.checkpointExecutionStageMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueueFamilyCheckpointPropertiesNV const & queueFamilyCheckpointPropertiesNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointPropertiesNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointPropertiesNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyCheckpointPropertiesNV.checkpointExecutionStageMask ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::QueueFamilyGlobalPriorityPropertiesKHR const & queueFamilyGlobalPriorityPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyGlobalPriorityPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyGlobalPriorityPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyGlobalPriorityPropertiesKHR.priorityCount ); - for ( size_t i = 0; i < VK_MAX_GLOBAL_PRIORITY_SIZE_KHR; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyGlobalPriorityPropertiesKHR.priorities[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueueFamilyProperties const & queueFamilyProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties.queueFlags ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties.queueCount ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties.timestampValidBits ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties.minImageTransferGranularity ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 const & queueFamilyProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyProperties2.queueFamilyProperties ); - return seed; - } - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::QueueFamilyQueryResultStatusPropertiesKHR const & queueFamilyQueryResultStatusPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyQueryResultStatusPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyQueryResultStatusPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyQueryResultStatusPropertiesKHR.queryResultStatusSupport ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::QueueFamilyVideoPropertiesKHR const & queueFamilyVideoPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyVideoPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyVideoPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, queueFamilyVideoPropertiesKHR.videoCodecOperations ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoKHR const & rayTracingShaderGroupCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.type ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.generalShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.closestHitShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.anyHitShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.intersectionShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoKHR.pShaderGroupCaptureReplayHandle ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR const & rayTracingPipelineInterfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineInterfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineInterfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineInterfaceCreateInfoKHR.maxPipelineRayPayloadSize ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineInterfaceCreateInfoKHR.maxPipelineRayHitAttributeSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR const & rayTracingPipelineCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.stageCount ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pStages ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.groupCount ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pGroups ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.maxPipelineRayRecursionDepth ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pLibraryInfo ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pLibraryInterface ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.pDynamicState ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.layout ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.basePipelineHandle ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoKHR.basePipelineIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoNV const & rayTracingShaderGroupCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.type ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.generalShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.closestHitShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.anyHitShader ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingShaderGroupCreateInfoNV.intersectionShader ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV const & rayTracingPipelineCreateInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.flags ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.stageCount ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.pStages ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.groupCount ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.pGroups ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.maxRecursionDepth ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.layout ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.basePipelineHandle ); - VULKAN_HPP_HASH_COMBINE( seed, rayTracingPipelineCreateInfoNV.basePipelineIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE const & refreshCycleDurationGOOGLE ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, refreshCycleDurationGOOGLE.refreshDuration ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassAttachmentBeginInfo const & renderPassAttachmentBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassAttachmentBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassAttachmentBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassAttachmentBeginInfo.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassAttachmentBeginInfo.pAttachments ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassBeginInfo const & renderPassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.renderPass ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.framebuffer ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.renderArea ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.clearValueCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassBeginInfo.pClearValues ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassDescription const & subpassDescription ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.flags ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.inputAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pColorAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pResolveAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pDepthStencilAttachment ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.preserveAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription.pPreserveAttachments ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassDependency const & subpassDependency ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.srcSubpass ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.dstSubpass ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.srcStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.dstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency.dependencyFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo const & renderPassCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.pAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.subpassCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.pSubpasses ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.dependencyCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo.pDependencies ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassDescription2 const & subpassDescription2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.flags ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pipelineBindPoint ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.viewMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.inputAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pInputAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pColorAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pResolveAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pDepthStencilAttachment ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.preserveAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescription2.pPreserveAttachments ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassDependency2 const & subpassDependency2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.srcSubpass ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.dstSubpass ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.srcStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.dstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.srcAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.dstAccessMask ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.dependencyFlags ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDependency2.viewOffset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & renderPassCreateInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.flags ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.attachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.pAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.subpassCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.pSubpasses ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.dependencyCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.pDependencies ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.correlatedViewMaskCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreateInfo2.pCorrelatedViewMasks ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassCreationControlEXT const & renderPassCreationControlEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationControlEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationControlEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationControlEXT.disallowMerging ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackInfoEXT const & renderPassCreationFeedbackInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationFeedbackInfoEXT.postMergeSubpassCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackCreateInfoEXT const & renderPassCreationFeedbackCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationFeedbackCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationFeedbackCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassCreationFeedbackCreateInfoEXT.pRenderPassFeedback ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RenderPassFragmentDensityMapCreateInfoEXT const & renderPassFragmentDensityMapCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassFragmentDensityMapCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassFragmentDensityMapCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassFragmentDensityMapCreateInfoEXT.fragmentDensityMapAttachment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RenderPassInputAttachmentAspectCreateInfo const & renderPassInputAttachmentAspectCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassInputAttachmentAspectCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassInputAttachmentAspectCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassInputAttachmentAspectCreateInfo.aspectReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassInputAttachmentAspectCreateInfo.pAspectReferences ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassMultiviewCreateInfo const & renderPassMultiviewCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.subpassCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.pViewMasks ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.dependencyCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.pViewOffsets ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.correlationMaskCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassMultiviewCreateInfo.pCorrelationMasks ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassSampleLocationsEXT const & subpassSampleLocationsEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassSampleLocationsEXT.subpassIndex ); - VULKAN_HPP_HASH_COMBINE( seed, subpassSampleLocationsEXT.sampleLocationsInfo ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RenderPassSampleLocationsBeginInfoEXT const & renderPassSampleLocationsBeginInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.attachmentInitialSampleLocationsCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.pAttachmentInitialSampleLocations ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.postSubpassSampleLocationsCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSampleLocationsBeginInfoEXT.pPostSubpassSampleLocations ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackInfoEXT const & renderPassSubpassFeedbackInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackInfoEXT.subpassMergeStatus ); - for ( size_t i = 0; i < VK_MAX_DESCRIPTION_SIZE; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackInfoEXT.description[i] ); - } - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackInfoEXT.postMergeIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackCreateInfoEXT const & renderPassSubpassFeedbackCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassSubpassFeedbackCreateInfoEXT.pSubpassFeedback ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderPassTransformBeginInfoQCOM const & renderPassTransformBeginInfoQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderPassTransformBeginInfoQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassTransformBeginInfoQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderPassTransformBeginInfoQCOM.transform ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderingFragmentDensityMapAttachmentInfoEXT const & renderingFragmentDensityMapAttachmentInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentDensityMapAttachmentInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentDensityMapAttachmentInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentDensityMapAttachmentInfoEXT.imageView ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentDensityMapAttachmentInfoEXT.imageLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderingFragmentShadingRateAttachmentInfoKHR const & renderingFragmentShadingRateAttachmentInfoKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentShadingRateAttachmentInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentShadingRateAttachmentInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentShadingRateAttachmentInfoKHR.imageView ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentShadingRateAttachmentInfoKHR.imageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, renderingFragmentShadingRateAttachmentInfoKHR.shadingRateAttachmentTexelSize ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::RenderingInfo const & renderingInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.renderArea ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.layerCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.viewMask ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.colorAttachmentCount ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.pColorAttachments ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.pDepthAttachment ); - VULKAN_HPP_HASH_COMBINE( seed, renderingInfo.pStencilAttachment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ResolveImageInfo2 const & resolveImageInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.srcImage ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.srcImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.dstImage ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.dstImageLayout ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.regionCount ); - VULKAN_HPP_HASH_COMBINE( seed, resolveImageInfo2.pRegions ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( - VULKAN_HPP_NAMESPACE::SamplerBorderColorComponentMappingCreateInfoEXT const & samplerBorderColorComponentMappingCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerBorderColorComponentMappingCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerBorderColorComponentMappingCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerBorderColorComponentMappingCreateInfoEXT.components ); - VULKAN_HPP_HASH_COMBINE( seed, samplerBorderColorComponentMappingCreateInfoEXT.srgb ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerCreateInfo const & samplerCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.magFilter ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.minFilter ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.mipmapMode ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.addressModeU ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.addressModeV ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.addressModeW ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.mipLodBias ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.anisotropyEnable ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.maxAnisotropy ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.compareEnable ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.compareOp ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.minLod ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.maxLod ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.borderColor ); - VULKAN_HPP_HASH_COMBINE( seed, samplerCreateInfo.unnormalizedCoordinates ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerReductionModeCreateInfo const & samplerReductionModeCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerReductionModeCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerReductionModeCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerReductionModeCreateInfo.reductionMode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & samplerYcbcrConversionCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.format ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.ycbcrModel ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.ycbcrRange ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.components ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.xChromaOffset ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.yChromaOffset ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.chromaFilter ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionCreateInfo.forceExplicitReconstruction ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionImageFormatProperties const & samplerYcbcrConversionImageFormatProperties ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionImageFormatProperties.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionImageFormatProperties.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionImageFormatProperties.combinedImageSamplerDescriptorCount ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionInfo const & samplerYcbcrConversionInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, samplerYcbcrConversionInfo.conversion ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX const & screenSurfaceCreateInfoQNX ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, screenSurfaceCreateInfoQNX.sType ); - VULKAN_HPP_HASH_COMBINE( seed, screenSurfaceCreateInfoQNX.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, screenSurfaceCreateInfoQNX.flags ); - VULKAN_HPP_HASH_COMBINE( seed, screenSurfaceCreateInfoQNX.context ); - VULKAN_HPP_HASH_COMBINE( seed, screenSurfaceCreateInfoQNX.window ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo const & semaphoreCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreCreateInfo.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR const & semaphoreGetFdInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetFdInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetFdInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetFdInfoKHR.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetFdInfoKHR.handleType ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR const & semaphoreGetWin32HandleInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetWin32HandleInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetWin32HandleInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetWin32HandleInfoKHR.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetWin32HandleInfoKHR.handleType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA const & semaphoreGetZirconHandleInfoFUCHSIA ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetZirconHandleInfoFUCHSIA.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetZirconHandleInfoFUCHSIA.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetZirconHandleInfoFUCHSIA.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreGetZirconHandleInfoFUCHSIA.handleType ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo const & semaphoreSignalInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSignalInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSignalInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSignalInfo.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSignalInfo.value ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo const & semaphoreSubmitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.semaphore ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.value ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.stageMask ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreSubmitInfo.deviceIndex ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreTypeCreateInfo const & semaphoreTypeCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreTypeCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreTypeCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreTypeCreateInfo.semaphoreType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreTypeCreateInfo.initialValue ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo const & semaphoreWaitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.semaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.pSemaphores ); - VULKAN_HPP_HASH_COMBINE( seed, semaphoreWaitInfo.pValues ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SetStateFlagsIndirectCommandNV const & setStateFlagsIndirectCommandNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, setStateFlagsIndirectCommandNV.data ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo const & shaderModuleCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleCreateInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleCreateInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleCreateInfo.flags ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleCreateInfo.codeSize ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleCreateInfo.pCode ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT const & shaderModuleIdentifierEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleIdentifierEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleIdentifierEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleIdentifierEXT.identifierSize ); - for ( size_t i = 0; i < VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleIdentifierEXT.identifier[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::ShaderModuleValidationCacheCreateInfoEXT const & shaderModuleValidationCacheCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleValidationCacheCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleValidationCacheCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, shaderModuleValidationCacheCreateInfoEXT.validationCache ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShaderResourceUsageAMD const & shaderResourceUsageAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shaderResourceUsageAMD.numUsedVgprs ); - VULKAN_HPP_HASH_COMBINE( seed, shaderResourceUsageAMD.numUsedSgprs ); - VULKAN_HPP_HASH_COMBINE( seed, shaderResourceUsageAMD.ldsSizePerLocalWorkGroup ); - VULKAN_HPP_HASH_COMBINE( seed, shaderResourceUsageAMD.ldsUsageSizeInBytes ); - VULKAN_HPP_HASH_COMBINE( seed, shaderResourceUsageAMD.scratchMemUsageInBytes ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ShaderStatisticsInfoAMD const & shaderStatisticsInfoAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.shaderStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.resourceUsage ); - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.numPhysicalVgprs ); - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.numPhysicalSgprs ); - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.numAvailableVgprs ); - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.numAvailableSgprs ); - for ( size_t i = 0; i < 3; ++i ) - { - VULKAN_HPP_HASH_COMBINE( seed, shaderStatisticsInfoAMD.computeWorkGroupSize[i] ); - } - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SharedPresentSurfaceCapabilitiesKHR const & sharedPresentSurfaceCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sharedPresentSurfaceCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, sharedPresentSurfaceCapabilitiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, sharedPresentSurfaceCapabilitiesKHR.sharedPresentSupportedUsageFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties const & sparseImageFormatProperties ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties.aspectMask ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties.imageGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties.flags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 const & sparseImageFormatProperties2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageFormatProperties2.properties ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements const & sparseImageMemoryRequirements ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements.formatProperties ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements.imageMipTailFirstLod ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements.imageMipTailSize ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements.imageMipTailOffset ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements.imageMipTailStride ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 const & sparseImageMemoryRequirements2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, sparseImageMemoryRequirements2.memoryRequirements ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_GGP ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP const & streamDescriptorSurfaceCreateInfoGGP ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, streamDescriptorSurfaceCreateInfoGGP.sType ); - VULKAN_HPP_HASH_COMBINE( seed, streamDescriptorSurfaceCreateInfoGGP.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, streamDescriptorSurfaceCreateInfoGGP.flags ); - VULKAN_HPP_HASH_COMBINE( seed, streamDescriptorSurfaceCreateInfoGGP.streamDescriptor ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_GGP*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR const & stridedDeviceAddressRegionKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, stridedDeviceAddressRegionKHR.deviceAddress ); - VULKAN_HPP_HASH_COMBINE( seed, stridedDeviceAddressRegionKHR.stride ); - VULKAN_HPP_HASH_COMBINE( seed, stridedDeviceAddressRegionKHR.size ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubmitInfo const & submitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.waitSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.pWaitSemaphores ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.pWaitDstStageMask ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.commandBufferCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.pCommandBuffers ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.signalSemaphoreCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo.pSignalSemaphores ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubmitInfo2 const & submitInfo2 ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.sType ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.flags ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.waitSemaphoreInfoCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.pWaitSemaphoreInfos ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.commandBufferInfoCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.pCommandBufferInfos ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.signalSemaphoreInfoCount ); - VULKAN_HPP_HASH_COMBINE( seed, submitInfo2.pSignalSemaphoreInfos ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassBeginInfo const & subpassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassBeginInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassBeginInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassBeginInfo.contents ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::SubpassDescriptionDepthStencilResolve const & subpassDescriptionDepthStencilResolve ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassDescriptionDepthStencilResolve.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescriptionDepthStencilResolve.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescriptionDepthStencilResolve.depthResolveMode ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescriptionDepthStencilResolve.stencilResolveMode ); - VULKAN_HPP_HASH_COMBINE( seed, subpassDescriptionDepthStencilResolve.pDepthStencilResolveAttachment ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassEndInfo const & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassEndInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassEndInfo.pNext ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassFragmentDensityMapOffsetEndInfoQCOM const & subpassFragmentDensityMapOffsetEndInfoQCOM ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassFragmentDensityMapOffsetEndInfoQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassFragmentDensityMapOffsetEndInfoQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassFragmentDensityMapOffsetEndInfoQCOM.fragmentDensityOffsetCount ); - VULKAN_HPP_HASH_COMBINE( seed, subpassFragmentDensityMapOffsetEndInfoQCOM.pFragmentDensityOffsets ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubpassResolvePerformanceQueryEXT const & subpassResolvePerformanceQueryEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassResolvePerformanceQueryEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassResolvePerformanceQueryEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassResolvePerformanceQueryEXT.optimal ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::SubpassShadingPipelineCreateInfoHUAWEI const & subpassShadingPipelineCreateInfoHUAWEI ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subpassShadingPipelineCreateInfoHUAWEI.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subpassShadingPipelineCreateInfoHUAWEI.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subpassShadingPipelineCreateInfoHUAWEI.renderPass ); - VULKAN_HPP_HASH_COMBINE( seed, subpassShadingPipelineCreateInfoHUAWEI.subpass ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT const & subresourceLayout2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, subresourceLayout2EXT.subresourceLayout ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT const & surfaceCapabilities2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.minImageCount ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.maxImageCount ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.currentExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.minImageExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.maxImageExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.maxImageArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.supportedTransforms ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.currentTransform ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.supportedCompositeAlpha ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.supportedUsageFlags ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2EXT.supportedSurfaceCounters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR const & surfaceCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.minImageCount ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.maxImageCount ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.currentExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.minImageExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.maxImageExtent ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.maxImageArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.supportedTransforms ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.currentTransform ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.supportedCompositeAlpha ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesKHR.supportedUsageFlags ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR const & surfaceCapabilities2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilities2KHR.surfaceCapabilities ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesFullScreenExclusiveEXT const & surfaceCapabilitiesFullScreenExclusiveEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesFullScreenExclusiveEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesFullScreenExclusiveEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceCapabilitiesFullScreenExclusiveEXT.fullScreenExclusiveSupported ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceFormatKHR const & surfaceFormatKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceFormatKHR.format ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFormatKHR.colorSpace ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceFormat2KHR const & surfaceFormat2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceFormat2KHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFormat2KHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFormat2KHR.surfaceFormat ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceFullScreenExclusiveInfoEXT const & surfaceFullScreenExclusiveInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveInfoEXT.fullScreenExclusive ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::SurfaceFullScreenExclusiveWin32InfoEXT const & surfaceFullScreenExclusiveWin32InfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveWin32InfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveWin32InfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceFullScreenExclusiveWin32InfoEXT.hmonitor ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SurfaceProtectedCapabilitiesKHR const & surfaceProtectedCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, surfaceProtectedCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceProtectedCapabilitiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, surfaceProtectedCapabilitiesKHR.supportsProtected ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SwapchainCounterCreateInfoEXT const & swapchainCounterCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, swapchainCounterCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCounterCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCounterCreateInfoEXT.surfaceCounters ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & swapchainCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.surface ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.minImageCount ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageFormat ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageColorSpace ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageExtent ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageArrayLayers ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageUsage ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.imageSharingMode ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.queueFamilyIndexCount ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.pQueueFamilyIndices ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.preTransform ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.compositeAlpha ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.presentMode ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.clipped ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainCreateInfoKHR.oldSwapchain ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::SwapchainDisplayNativeHdrCreateInfoAMD const & swapchainDisplayNativeHdrCreateInfoAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, swapchainDisplayNativeHdrCreateInfoAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainDisplayNativeHdrCreateInfoAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, swapchainDisplayNativeHdrCreateInfoAMD.localDimmingEnable ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TextureLODGatherFormatPropertiesAMD const & textureLODGatherFormatPropertiesAMD ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, textureLODGatherFormatPropertiesAMD.sType ); - VULKAN_HPP_HASH_COMBINE( seed, textureLODGatherFormatPropertiesAMD.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, textureLODGatherFormatPropertiesAMD.supportsTextureGatherLODBiasAMD ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TilePropertiesQCOM const & tilePropertiesQCOM ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, tilePropertiesQCOM.sType ); - VULKAN_HPP_HASH_COMBINE( seed, tilePropertiesQCOM.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, tilePropertiesQCOM.tileSize ); - VULKAN_HPP_HASH_COMBINE( seed, tilePropertiesQCOM.apronSize ); - VULKAN_HPP_HASH_COMBINE( seed, tilePropertiesQCOM.origin ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TimelineSemaphoreSubmitInfo const & timelineSemaphoreSubmitInfo ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.sType ); - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.waitSemaphoreValueCount ); - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.pWaitSemaphoreValues ); - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.signalSemaphoreValueCount ); - VULKAN_HPP_HASH_COMBINE( seed, timelineSemaphoreSubmitInfo.pSignalSemaphoreValues ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TraceRaysIndirectCommand2KHR const & traceRaysIndirectCommand2KHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.raygenShaderRecordAddress ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.raygenShaderRecordSize ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.missShaderBindingTableAddress ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.missShaderBindingTableSize ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.missShaderBindingTableStride ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.hitShaderBindingTableAddress ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.hitShaderBindingTableSize ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.hitShaderBindingTableStride ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.callableShaderBindingTableAddress ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.callableShaderBindingTableSize ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.callableShaderBindingTableStride ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.width ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.height ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommand2KHR.depth ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::TraceRaysIndirectCommandKHR const & traceRaysIndirectCommandKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommandKHR.width ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommandKHR.height ); - VULKAN_HPP_HASH_COMBINE( seed, traceRaysIndirectCommandKHR.depth ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT const & validationCacheCreateInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, validationCacheCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, validationCacheCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, validationCacheCreateInfoEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, validationCacheCreateInfoEXT.initialDataSize ); - VULKAN_HPP_HASH_COMBINE( seed, validationCacheCreateInfoEXT.pInitialData ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ValidationFeaturesEXT const & validationFeaturesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.enabledValidationFeatureCount ); - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.pEnabledValidationFeatures ); - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.disabledValidationFeatureCount ); - VULKAN_HPP_HASH_COMBINE( seed, validationFeaturesEXT.pDisabledValidationFeatures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ValidationFlagsEXT const & validationFlagsEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, validationFlagsEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, validationFlagsEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, validationFlagsEXT.disabledValidationCheckCount ); - VULKAN_HPP_HASH_COMBINE( seed, validationFlagsEXT.pDisabledValidationChecks ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription2EXT const & vertexInputAttributeDescription2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.location ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.binding ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.format ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputAttributeDescription2EXT.offset ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VertexInputBindingDescription2EXT const & vertexInputBindingDescription2EXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.binding ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.stride ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.inputRate ); - VULKAN_HPP_HASH_COMBINE( seed, vertexInputBindingDescription2EXT.divisor ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_VI_NN ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN const & viSurfaceCreateInfoNN ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, viSurfaceCreateInfoNN.sType ); - VULKAN_HPP_HASH_COMBINE( seed, viSurfaceCreateInfoNN.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, viSurfaceCreateInfoNN.flags ); - VULKAN_HPP_HASH_COMBINE( seed, viSurfaceCreateInfoNN.window ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_VI_NN*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR const & videoPictureResourceInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.codedOffset ); - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.codedExtent ); - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.baseArrayLayer ); - VULKAN_HPP_HASH_COMBINE( seed, videoPictureResourceInfoKHR.imageViewBinding ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR const & videoReferenceSlotInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoReferenceSlotInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoReferenceSlotInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoReferenceSlotInfoKHR.slotIndex ); - VULKAN_HPP_HASH_COMBINE( seed, videoReferenceSlotInfoKHR.pPictureResource ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR const & videoBeginCodingInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.videoSession ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.videoSessionParameters ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.referenceSlotCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoBeginCodingInfoKHR.pReferenceSlots ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR const & videoCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.capabilityFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.minBitstreamBufferOffsetAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.minBitstreamBufferSizeAlignment ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.videoPictureExtentGranularity ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.minExtent ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.maxExtent ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.maxReferencePicturesSlotsCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.maxReferencePicturesActiveCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoCapabilitiesKHR.stdHeaderVersion ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR const & videoCodingControlInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoCodingControlInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoCodingControlInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoCodingControlInfoKHR.flags ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeCapabilitiesKHR const & videoDecodeCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeCapabilitiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeCapabilitiesKHR.flags ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264CapabilitiesEXT const & videoDecodeH264CapabilitiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264CapabilitiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264CapabilitiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264CapabilitiesEXT.maxLevel ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264CapabilitiesEXT.fieldOffsetGranularity ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264DpbSlotInfoEXT const & videoDecodeH264DpbSlotInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264DpbSlotInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264DpbSlotInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264DpbSlotInfoEXT.pStdReferenceInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264MvcInfoEXT const & videoDecodeH264MvcInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264MvcInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264MvcInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264MvcInfoEXT.pStdMvc ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264PictureInfoEXT const & videoDecodeH264PictureInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264PictureInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264PictureInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264PictureInfoEXT.pStdPictureInfo ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264PictureInfoEXT.slicesCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264PictureInfoEXT.pSlicesDataOffsets ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264ProfileInfoEXT const & videoDecodeH264ProfileInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264ProfileInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264ProfileInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264ProfileInfoEXT.stdProfileIdc ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264ProfileInfoEXT.pictureLayout ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersAddInfoEXT const & videoDecodeH264SessionParametersAddInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.spsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.pSpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.ppsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersAddInfoEXT.pPpsStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersCreateInfoEXT const & videoDecodeH264SessionParametersCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersCreateInfoEXT.maxSpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersCreateInfoEXT.maxPpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH264SessionParametersCreateInfoEXT.pParametersAddInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265CapabilitiesEXT const & videoDecodeH265CapabilitiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265CapabilitiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265CapabilitiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265CapabilitiesEXT.maxLevel ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265DpbSlotInfoEXT const & videoDecodeH265DpbSlotInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265DpbSlotInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265DpbSlotInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265DpbSlotInfoEXT.pStdReferenceInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265PictureInfoEXT const & videoDecodeH265PictureInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265PictureInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265PictureInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265PictureInfoEXT.pStdPictureInfo ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265PictureInfoEXT.slicesCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265PictureInfoEXT.pSlicesDataOffsets ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265ProfileInfoEXT const & videoDecodeH265ProfileInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265ProfileInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265ProfileInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265ProfileInfoEXT.stdProfileIdc ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersAddInfoEXT const & videoDecodeH265SessionParametersAddInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.vpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.pVpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.spsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.pSpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.ppsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersAddInfoEXT.pPpsStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersCreateInfoEXT const & videoDecodeH265SessionParametersCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.maxVpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.maxSpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.maxPpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeH265SessionParametersCreateInfoEXT.pParametersAddInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR const & videoDecodeInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.srcBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.srcBufferOffset ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.srcBufferRange ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.dstPictureResource ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.pSetupReferenceSlot ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.referenceSlotCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeInfoKHR.pReferenceSlots ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoDecodeUsageInfoKHR const & videoDecodeUsageInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeUsageInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeUsageInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoDecodeUsageInfoKHR.videoUsageHints ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeCapabilitiesKHR const & videoEncodeCapabilitiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.rateControlModes ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.rateControlLayerCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.qualityLevelCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeCapabilitiesKHR.inputImageDataFillAlignment ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264CapabilitiesEXT const & videoEncodeH264CapabilitiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.inputModeFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.outputModeFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.maxPPictureL0ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.maxBPictureL0ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.maxL1ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.motionVectorsOverPicBoundariesFlag ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.maxBytesPerPicDenom ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.maxBitsPerMbDenom ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.log2MaxMvLengthHorizontal ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264CapabilitiesEXT.log2MaxMvLengthVertical ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT const & videoEncodeH264DpbSlotInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264DpbSlotInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264DpbSlotInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264DpbSlotInfoEXT.slotIndex ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264DpbSlotInfoEXT.pStdReferenceInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264EmitPictureParametersInfoEXT const & videoEncodeH264EmitPictureParametersInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.spsId ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.emitSpsEnable ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.ppsIdEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264EmitPictureParametersInfoEXT.ppsIdEntries ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264FrameSizeEXT const & videoEncodeH264FrameSizeEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264FrameSizeEXT.frameISize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264FrameSizeEXT.framePSize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264FrameSizeEXT.frameBSize ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT const & videoEncodeH264ReferenceListsInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.referenceList0EntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.pReferenceList0Entries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.referenceList1EntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.pReferenceList1Entries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ReferenceListsInfoEXT.pMemMgmtCtrlOperations ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264NaluSliceInfoEXT const & videoEncodeH264NaluSliceInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264NaluSliceInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264NaluSliceInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264NaluSliceInfoEXT.mbCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264NaluSliceInfoEXT.pReferenceFinalLists ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264NaluSliceInfoEXT.pSliceHeaderStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264ProfileInfoEXT const & videoEncodeH264ProfileInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ProfileInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ProfileInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264ProfileInfoEXT.stdProfileIdc ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT const & videoEncodeH264QpEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264QpEXT.qpI ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264QpEXT.qpP ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264QpEXT.qpB ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlInfoEXT const & videoEncodeH264RateControlInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.gopFrameCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.idrPeriod ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.consecutiveBFrameCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.rateControlStructure ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlInfoEXT.temporalLayerCount ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlLayerInfoEXT const & videoEncodeH264RateControlLayerInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.temporalLayerId ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.useInitialRcQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.initialRcQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.useMinQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.minQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.useMaxQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.maxQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.useMaxFrameSize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264RateControlLayerInfoEXT.maxFrameSize ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersAddInfoEXT const & videoEncodeH264SessionParametersAddInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.spsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.pSpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.ppsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersAddInfoEXT.pPpsStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersCreateInfoEXT const & videoEncodeH264SessionParametersCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersCreateInfoEXT.maxSpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersCreateInfoEXT.maxPpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264SessionParametersCreateInfoEXT.pParametersAddInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH264VclFrameInfoEXT const & videoEncodeH264VclFrameInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.pReferenceFinalLists ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.naluSliceEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.pNaluSliceEntries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH264VclFrameInfoEXT.pCurrentPictureInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265CapabilitiesEXT const & videoEncodeH265CapabilitiesEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.inputModeFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.outputModeFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.ctbSizes ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.transformBlockSizes ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxPPictureL0ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxBPictureL0ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxL1ReferenceCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxSubLayersCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.minLog2MinLumaCodingBlockSizeMinus3 ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxLog2MinLumaCodingBlockSizeMinus3 ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.minLog2MinLumaTransformBlockSizeMinus2 ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxLog2MinLumaTransformBlockSizeMinus2 ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.minMaxTransformHierarchyDepthInter ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxMaxTransformHierarchyDepthInter ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.minMaxTransformHierarchyDepthIntra ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxMaxTransformHierarchyDepthIntra ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxDiffCuQpDeltaDepth ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.minMaxNumMergeCand ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265CapabilitiesEXT.maxMaxNumMergeCand ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT const & videoEncodeH265DpbSlotInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265DpbSlotInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265DpbSlotInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265DpbSlotInfoEXT.slotIndex ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265DpbSlotInfoEXT.pStdReferenceInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265EmitPictureParametersInfoEXT const & videoEncodeH265EmitPictureParametersInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.vpsId ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.spsId ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.emitVpsEnable ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.emitSpsEnable ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.ppsIdEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265EmitPictureParametersInfoEXT.ppsIdEntries ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265FrameSizeEXT const & videoEncodeH265FrameSizeEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265FrameSizeEXT.frameISize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265FrameSizeEXT.framePSize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265FrameSizeEXT.frameBSize ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT const & videoEncodeH265ReferenceListsInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.referenceList0EntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.pReferenceList0Entries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.referenceList1EntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.pReferenceList1Entries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ReferenceListsInfoEXT.pReferenceModifications ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265NaluSliceSegmentInfoEXT const & videoEncodeH265NaluSliceSegmentInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265NaluSliceSegmentInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265NaluSliceSegmentInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265NaluSliceSegmentInfoEXT.ctbCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265NaluSliceSegmentInfoEXT.pReferenceFinalLists ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265NaluSliceSegmentInfoEXT.pSliceSegmentHeaderStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265ProfileInfoEXT const & videoEncodeH265ProfileInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ProfileInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ProfileInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265ProfileInfoEXT.stdProfileIdc ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT const & videoEncodeH265QpEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265QpEXT.qpI ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265QpEXT.qpP ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265QpEXT.qpB ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlInfoEXT const & videoEncodeH265RateControlInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.gopFrameCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.idrPeriod ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.consecutiveBFrameCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.rateControlStructure ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlInfoEXT.subLayerCount ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlLayerInfoEXT const & videoEncodeH265RateControlLayerInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.temporalId ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.useInitialRcQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.initialRcQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.useMinQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.minQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.useMaxQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.maxQp ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.useMaxFrameSize ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265RateControlLayerInfoEXT.maxFrameSize ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersAddInfoEXT const & videoEncodeH265SessionParametersAddInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.vpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.pVpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.spsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.pSpsStd ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.ppsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersAddInfoEXT.pPpsStd ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersCreateInfoEXT const & videoEncodeH265SessionParametersCreateInfoEXT ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.maxVpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.maxSpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.maxPpsStdCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265SessionParametersCreateInfoEXT.pParametersAddInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeH265VclFrameInfoEXT const & videoEncodeH265VclFrameInfoEXT ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.pReferenceFinalLists ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.naluSliceSegmentEntryCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.pNaluSliceSegmentEntries ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeH265VclFrameInfoEXT.pCurrentPictureInfo ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR const & videoEncodeInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.qualityLevel ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.dstBitstreamBuffer ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.dstBitstreamBufferOffset ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.dstBitstreamBufferMaxRange ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.srcPictureResource ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.pSetupReferenceSlot ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.referenceSlotCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.pReferenceSlots ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeInfoKHR.precedingExternallyEncodedBytes ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlLayerInfoKHR const & videoEncodeRateControlLayerInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.averageBitrate ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.maxBitrate ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.frameRateNumerator ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.frameRateDenominator ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.virtualBufferSizeInMs ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlLayerInfoKHR.initialVirtualBufferSizeInMs ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlInfoKHR const & videoEncodeRateControlInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.rateControlMode ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.layerCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeRateControlInfoKHR.pLayerConfigs ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEncodeUsageInfoKHR const & videoEncodeUsageInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeUsageInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeUsageInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeUsageInfoKHR.videoUsageHints ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeUsageInfoKHR.videoContentHints ); - VULKAN_HPP_HASH_COMBINE( seed, videoEncodeUsageInfoKHR.tuningMode ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR const & videoEndCodingInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoEndCodingInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoEndCodingInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoEndCodingInfoKHR.flags ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoFormatPropertiesKHR const & videoFormatPropertiesKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.format ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.componentMapping ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.imageCreateFlags ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.imageType ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.imageTiling ); - VULKAN_HPP_HASH_COMBINE( seed, videoFormatPropertiesKHR.imageUsageFlags ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR const & videoProfileInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.videoCodecOperation ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.chromaSubsampling ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.lumaBitDepth ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileInfoKHR.chromaBitDepth ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoProfileListInfoKHR const & videoProfileListInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoProfileListInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileListInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileListInfoKHR.profileCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoProfileListInfoKHR.pProfiles ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR const & videoSessionCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.queueFamilyIndex ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.pVideoProfile ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.pictureFormat ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.maxCodedExtent ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.referencePicturesFormat ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.maxReferencePicturesSlotsCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.maxReferencePicturesActiveCount ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionCreateInfoKHR.pStdHeaderVersion ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionMemoryRequirementsKHR const & videoSessionMemoryRequirementsKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoSessionMemoryRequirementsKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionMemoryRequirementsKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionMemoryRequirementsKHR.memoryBindIndex ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionMemoryRequirementsKHR.memoryRequirements ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR const & videoSessionParametersCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersCreateInfoKHR.videoSessionParametersTemplate ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersCreateInfoKHR.videoSession ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR const & videoSessionParametersUpdateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersUpdateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersUpdateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, videoSessionParametersUpdateInfoKHR.updateSequenceCount ); - return seed; - } - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR const & waylandSurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, waylandSurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, waylandSurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, waylandSurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, waylandSurfaceCreateInfoKHR.display ); - VULKAN_HPP_HASH_COMBINE( seed, waylandSurfaceCreateInfoKHR.surface ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Win32KeyedMutexAcquireReleaseInfoKHR const & win32KeyedMutexAcquireReleaseInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.acquireCount ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pAcquireSyncs ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pAcquireKeys ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pAcquireTimeouts ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.releaseCount ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pReleaseSyncs ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoKHR.pReleaseKeys ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Win32KeyedMutexAcquireReleaseInfoNV const & win32KeyedMutexAcquireReleaseInfoNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.acquireCount ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pAcquireSyncs ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pAcquireKeys ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pAcquireTimeoutMilliseconds ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.releaseCount ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pReleaseSyncs ); - VULKAN_HPP_HASH_COMBINE( seed, win32KeyedMutexAcquireReleaseInfoNV.pReleaseKeys ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR const & win32SurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, win32SurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, win32SurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, win32SurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, win32SurfaceCreateInfoKHR.hinstance ); - VULKAN_HPP_HASH_COMBINE( seed, win32SurfaceCreateInfoKHR.hwnd ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::WriteDescriptorSet const & writeDescriptorSet ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.sType ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.dstSet ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.dstBinding ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.dstArrayElement ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.descriptorCount ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.descriptorType ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.pImageInfo ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.pBufferInfo ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSet.pTexelBufferView ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::WriteDescriptorSetAccelerationStructureKHR const & writeDescriptorSetAccelerationStructureKHR ) const - VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureKHR.accelerationStructureCount ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureKHR.pAccelerationStructures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t - operator()( VULKAN_HPP_NAMESPACE::WriteDescriptorSetAccelerationStructureNV const & writeDescriptorSetAccelerationStructureNV ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureNV.sType ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureNV.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureNV.accelerationStructureCount ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetAccelerationStructureNV.pAccelerationStructures ); - return seed; - } - }; - - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::WriteDescriptorSetInlineUniformBlock const & writeDescriptorSetInlineUniformBlock ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetInlineUniformBlock.sType ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetInlineUniformBlock.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetInlineUniformBlock.dataSize ); - VULKAN_HPP_HASH_COMBINE( seed, writeDescriptorSetInlineUniformBlock.pData ); - return seed; - } - }; - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR const & xcbSurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, xcbSurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, xcbSurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, xcbSurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, xcbSurfaceCreateInfoKHR.connection ); - VULKAN_HPP_HASH_COMBINE( seed, xcbSurfaceCreateInfoKHR.window ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - template <> - struct hash - { - std::size_t operator()( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR const & xlibSurfaceCreateInfoKHR ) const VULKAN_HPP_NOEXCEPT - { - std::size_t seed = 0; - VULKAN_HPP_HASH_COMBINE( seed, xlibSurfaceCreateInfoKHR.sType ); - VULKAN_HPP_HASH_COMBINE( seed, xlibSurfaceCreateInfoKHR.pNext ); - VULKAN_HPP_HASH_COMBINE( seed, xlibSurfaceCreateInfoKHR.flags ); - VULKAN_HPP_HASH_COMBINE( seed, xlibSurfaceCreateInfoKHR.dpy ); - VULKAN_HPP_HASH_COMBINE( seed, xlibSurfaceCreateInfoKHR.window ); - return seed; - } - }; -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#endif // 14 <= VULKAN_HPP_CPP_VERSION - -} // namespace std -#endif diff --git a/src/video/khronos/vulkan/vulkan_ios.h b/src/video/khronos/vulkan/vulkan_ios.h index 57922054393b7..22ed2c039a6b2 100644 --- a/src/video/khronos/vulkan/vulkan_ios.h +++ b/src/video/khronos/vulkan/vulkan_ios.h @@ -2,7 +2,7 @@ #define VULKAN_IOS_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_MVK_ios_surface is a preprocessor guard. Do not pass it to API calls. #define VK_MVK_ios_surface 1 #define VK_MVK_IOS_SURFACE_SPEC_VERSION 3 #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" diff --git a/src/video/khronos/vulkan/vulkan_macos.h b/src/video/khronos/vulkan/vulkan_macos.h index 8e197c7cff411..a7f5613a05986 100644 --- a/src/video/khronos/vulkan/vulkan_macos.h +++ b/src/video/khronos/vulkan/vulkan_macos.h @@ -2,7 +2,7 @@ #define VULKAN_MACOS_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_MVK_macos_surface is a preprocessor guard. Do not pass it to API calls. #define VK_MVK_macos_surface 1 #define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3 #define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" diff --git a/src/video/khronos/vulkan/vulkan_metal.h b/src/video/khronos/vulkan/vulkan_metal.h index 11b9640919dd2..badb45078addc 100644 --- a/src/video/khronos/vulkan/vulkan_metal.h +++ b/src/video/khronos/vulkan/vulkan_metal.h @@ -2,7 +2,7 @@ #define VULKAN_METAL_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_EXT_metal_surface is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_metal_surface 1 #ifdef __OBJC__ @class CAMetalLayer; @@ -26,6 +27,14 @@ extern "C" { typedef void CAMetalLayer; #endif +#define SDL_UNSAFE_UNRETAINED +#if defined(__OBJC__) && defined(__has_feature) +#if __has_feature(objc_arc) +#undef SDL_UNSAFE_UNRETAINED +#define SDL_UNSAFE_UNRETAINED __unsafe_unretained +#endif +#endif + #define VK_EXT_METAL_SURFACE_SPEC_VERSION 1 #define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface" typedef VkFlags VkMetalSurfaceCreateFlagsEXT; @@ -33,7 +42,7 @@ typedef struct VkMetalSurfaceCreateInfoEXT { VkStructureType sType; const void* pNext; VkMetalSurfaceCreateFlagsEXT flags; - const CAMetalLayer* pLayer; + const CAMetalLayer SDL_UNSAFE_UNRETAINED *pLayer; } VkMetalSurfaceCreateInfoEXT; typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); @@ -47,6 +56,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT( #endif +// VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_metal_objects 1 #ifdef __OBJC__ @protocol MTLDevice; @@ -111,27 +121,27 @@ typedef struct VkExportMetalObjectsInfoEXT { typedef struct VkExportMetalDeviceInfoEXT { VkStructureType sType; const void* pNext; - MTLDevice_id mtlDevice; + MTLDevice_id SDL_UNSAFE_UNRETAINED mtlDevice; } VkExportMetalDeviceInfoEXT; typedef struct VkExportMetalCommandQueueInfoEXT { VkStructureType sType; const void* pNext; VkQueue queue; - MTLCommandQueue_id mtlCommandQueue; + MTLCommandQueue_id SDL_UNSAFE_UNRETAINED mtlCommandQueue; } VkExportMetalCommandQueueInfoEXT; typedef struct VkExportMetalBufferInfoEXT { VkStructureType sType; const void* pNext; VkDeviceMemory memory; - MTLBuffer_id mtlBuffer; + MTLBuffer_id SDL_UNSAFE_UNRETAINED mtlBuffer; } VkExportMetalBufferInfoEXT; typedef struct VkImportMetalBufferInfoEXT { VkStructureType sType; const void* pNext; - MTLBuffer_id mtlBuffer; + MTLBuffer_id SDL_UNSAFE_UNRETAINED mtlBuffer; } VkImportMetalBufferInfoEXT; typedef struct VkExportMetalTextureInfoEXT { @@ -141,14 +151,14 @@ typedef struct VkExportMetalTextureInfoEXT { VkImageView imageView; VkBufferView bufferView; VkImageAspectFlagBits plane; - MTLTexture_id mtlTexture; + MTLTexture_id SDL_UNSAFE_UNRETAINED mtlTexture; } VkExportMetalTextureInfoEXT; typedef struct VkImportMetalTextureInfoEXT { VkStructureType sType; const void* pNext; VkImageAspectFlagBits plane; - MTLTexture_id mtlTexture; + MTLTexture_id SDL_UNSAFE_UNRETAINED mtlTexture; } VkImportMetalTextureInfoEXT; typedef struct VkExportMetalIOSurfaceInfoEXT { @@ -169,13 +179,13 @@ typedef struct VkExportMetalSharedEventInfoEXT { const void* pNext; VkSemaphore semaphore; VkEvent event; - MTLSharedEvent_id mtlSharedEvent; + MTLSharedEvent_id SDL_UNSAFE_UNRETAINED mtlSharedEvent; } VkExportMetalSharedEventInfoEXT; typedef struct VkImportMetalSharedEventInfoEXT { VkStructureType sType; const void* pNext; - MTLSharedEvent_id mtlSharedEvent; + MTLSharedEvent_id SDL_UNSAFE_UNRETAINED mtlSharedEvent; } VkImportMetalSharedEventInfoEXT; typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo); diff --git a/src/video/khronos/vulkan/vulkan_raii.hpp b/src/video/khronos/vulkan/vulkan_raii.hpp deleted file mode 100644 index 7b3d1e2178c36..0000000000000 --- a/src/video/khronos/vulkan/vulkan_raii.hpp +++ /dev/null @@ -1,17460 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_RAII_HPP -#define VULKAN_RAII_HPP - -#include -#include // std::exchange, std::forward -#include - -#if !defined( VULKAN_HPP_RAII_NAMESPACE ) -# define VULKAN_HPP_RAII_NAMESPACE raii -#endif - -namespace VULKAN_HPP_NAMESPACE -{ - namespace VULKAN_HPP_RAII_NAMESPACE - { -#if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) && !defined( VULKAN_HPP_NO_EXCEPTIONS ) - - template - VULKAN_HPP_CONSTEXPR_14 VULKAN_HPP_INLINE T exchange( T & obj, U && newValue ) - { -# if ( 14 <= VULKAN_HPP_CPP_VERSION ) - return std::exchange( obj, std::forward( newValue ) ); -# else - T oldValue = std::move( obj ); - obj = std::forward( newValue ); - return oldValue; -# endif - } - - class ContextDispatcher : public DispatchLoaderBase - { - public: - ContextDispatcher( PFN_vkGetInstanceProcAddr getProcAddr ) - : vkGetInstanceProcAddr( getProcAddr ) - //=== VK_VERSION_1_0 === - , vkCreateInstance( PFN_vkCreateInstance( getProcAddr( NULL, "vkCreateInstance" ) ) ) - , vkEnumerateInstanceExtensionProperties( PFN_vkEnumerateInstanceExtensionProperties( getProcAddr( NULL, "vkEnumerateInstanceExtensionProperties" ) ) ) - , vkEnumerateInstanceLayerProperties( PFN_vkEnumerateInstanceLayerProperties( getProcAddr( NULL, "vkEnumerateInstanceLayerProperties" ) ) ) - //=== VK_VERSION_1_1 === - , vkEnumerateInstanceVersion( PFN_vkEnumerateInstanceVersion( getProcAddr( NULL, "vkEnumerateInstanceVersion" ) ) ) - { - } - - public: - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = 0; - - //=== VK_VERSION_1_0 === - PFN_vkCreateInstance vkCreateInstance = 0; - PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties = 0; - PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties = 0; - - //=== VK_VERSION_1_1 === - PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion = 0; - }; - - class InstanceDispatcher : public DispatchLoaderBase - { - public: - InstanceDispatcher( PFN_vkGetInstanceProcAddr getProcAddr, VkInstance instance ) : vkGetInstanceProcAddr( getProcAddr ) - { - //=== VK_VERSION_1_0 === - vkDestroyInstance = PFN_vkDestroyInstance( vkGetInstanceProcAddr( instance, "vkDestroyInstance" ) ); - vkEnumeratePhysicalDevices = PFN_vkEnumeratePhysicalDevices( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDevices" ) ); - vkGetPhysicalDeviceFeatures = PFN_vkGetPhysicalDeviceFeatures( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures" ) ); - vkGetPhysicalDeviceFormatProperties = - PFN_vkGetPhysicalDeviceFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties" ) ); - vkGetPhysicalDeviceImageFormatProperties = - PFN_vkGetPhysicalDeviceImageFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties" ) ); - vkGetPhysicalDeviceProperties = PFN_vkGetPhysicalDeviceProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties" ) ); - vkGetPhysicalDeviceQueueFamilyProperties = - PFN_vkGetPhysicalDeviceQueueFamilyProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties" ) ); - vkGetPhysicalDeviceMemoryProperties = - PFN_vkGetPhysicalDeviceMemoryProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties" ) ); - vkCreateDevice = PFN_vkCreateDevice( vkGetInstanceProcAddr( instance, "vkCreateDevice" ) ); - vkEnumerateDeviceExtensionProperties = - PFN_vkEnumerateDeviceExtensionProperties( vkGetInstanceProcAddr( instance, "vkEnumerateDeviceExtensionProperties" ) ); - vkEnumerateDeviceLayerProperties = PFN_vkEnumerateDeviceLayerProperties( vkGetInstanceProcAddr( instance, "vkEnumerateDeviceLayerProperties" ) ); - vkGetPhysicalDeviceSparseImageFormatProperties = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties" ) ); - - //=== VK_VERSION_1_1 === - vkEnumeratePhysicalDeviceGroups = PFN_vkEnumeratePhysicalDeviceGroups( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceGroups" ) ); - vkGetPhysicalDeviceFeatures2 = PFN_vkGetPhysicalDeviceFeatures2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures2" ) ); - vkGetPhysicalDeviceProperties2 = PFN_vkGetPhysicalDeviceProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties2" ) ); - vkGetPhysicalDeviceFormatProperties2 = - PFN_vkGetPhysicalDeviceFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties2" ) ); - vkGetPhysicalDeviceImageFormatProperties2 = - PFN_vkGetPhysicalDeviceImageFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties2" ) ); - vkGetPhysicalDeviceQueueFamilyProperties2 = - PFN_vkGetPhysicalDeviceQueueFamilyProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties2" ) ); - vkGetPhysicalDeviceMemoryProperties2 = - PFN_vkGetPhysicalDeviceMemoryProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties2" ) ); - vkGetPhysicalDeviceSparseImageFormatProperties2 = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties2" ) ); - vkGetPhysicalDeviceExternalBufferProperties = - PFN_vkGetPhysicalDeviceExternalBufferProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalBufferProperties" ) ); - vkGetPhysicalDeviceExternalFenceProperties = - PFN_vkGetPhysicalDeviceExternalFenceProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalFenceProperties" ) ); - vkGetPhysicalDeviceExternalSemaphoreProperties = - PFN_vkGetPhysicalDeviceExternalSemaphoreProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalSemaphoreProperties" ) ); - - //=== VK_VERSION_1_3 === - vkGetPhysicalDeviceToolProperties = PFN_vkGetPhysicalDeviceToolProperties( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceToolProperties" ) ); - - //=== VK_EXT_acquire_drm_display === - vkAcquireDrmDisplayEXT = PFN_vkAcquireDrmDisplayEXT( vkGetInstanceProcAddr( instance, "vkAcquireDrmDisplayEXT" ) ); - vkGetDrmDisplayEXT = PFN_vkGetDrmDisplayEXT( vkGetInstanceProcAddr( instance, "vkGetDrmDisplayEXT" ) ); - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - vkAcquireXlibDisplayEXT = PFN_vkAcquireXlibDisplayEXT( vkGetInstanceProcAddr( instance, "vkAcquireXlibDisplayEXT" ) ); - vkGetRandROutputDisplayEXT = PFN_vkGetRandROutputDisplayEXT( vkGetInstanceProcAddr( instance, "vkGetRandROutputDisplayEXT" ) ); -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_calibrated_timestamps === - vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = - PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT" ) ); - - //=== VK_EXT_debug_report === - vkCreateDebugReportCallbackEXT = PFN_vkCreateDebugReportCallbackEXT( vkGetInstanceProcAddr( instance, "vkCreateDebugReportCallbackEXT" ) ); - vkDestroyDebugReportCallbackEXT = PFN_vkDestroyDebugReportCallbackEXT( vkGetInstanceProcAddr( instance, "vkDestroyDebugReportCallbackEXT" ) ); - vkDebugReportMessageEXT = PFN_vkDebugReportMessageEXT( vkGetInstanceProcAddr( instance, "vkDebugReportMessageEXT" ) ); - - //=== VK_EXT_debug_utils === - vkCreateDebugUtilsMessengerEXT = PFN_vkCreateDebugUtilsMessengerEXT( vkGetInstanceProcAddr( instance, "vkCreateDebugUtilsMessengerEXT" ) ); - vkDestroyDebugUtilsMessengerEXT = PFN_vkDestroyDebugUtilsMessengerEXT( vkGetInstanceProcAddr( instance, "vkDestroyDebugUtilsMessengerEXT" ) ); - vkSubmitDebugUtilsMessageEXT = PFN_vkSubmitDebugUtilsMessageEXT( vkGetInstanceProcAddr( instance, "vkSubmitDebugUtilsMessageEXT" ) ); - - //=== VK_EXT_direct_mode_display === - vkReleaseDisplayEXT = PFN_vkReleaseDisplayEXT( vkGetInstanceProcAddr( instance, "vkReleaseDisplayEXT" ) ); - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - vkCreateDirectFBSurfaceEXT = PFN_vkCreateDirectFBSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateDirectFBSurfaceEXT" ) ); - vkGetPhysicalDeviceDirectFBPresentationSupportEXT = - PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDirectFBPresentationSupportEXT" ) ); -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_EXT_display_surface_counter === - vkGetPhysicalDeviceSurfaceCapabilities2EXT = - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2EXT" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - vkGetPhysicalDeviceSurfacePresentModes2EXT = - PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfacePresentModes2EXT" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - vkCreateHeadlessSurfaceEXT = PFN_vkCreateHeadlessSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateHeadlessSurfaceEXT" ) ); - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - vkCreateMetalSurfaceEXT = PFN_vkCreateMetalSurfaceEXT( vkGetInstanceProcAddr( instance, "vkCreateMetalSurfaceEXT" ) ); -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_sample_locations === - vkGetPhysicalDeviceMultisamplePropertiesEXT = - PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMultisamplePropertiesEXT" ) ); - - //=== VK_EXT_tooling_info === - vkGetPhysicalDeviceToolPropertiesEXT = - PFN_vkGetPhysicalDeviceToolPropertiesEXT( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceToolPropertiesEXT" ) ); - if ( !vkGetPhysicalDeviceToolProperties ) - vkGetPhysicalDeviceToolProperties = vkGetPhysicalDeviceToolPropertiesEXT; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - vkCreateImagePipeSurfaceFUCHSIA = PFN_vkCreateImagePipeSurfaceFUCHSIA( vkGetInstanceProcAddr( instance, "vkCreateImagePipeSurfaceFUCHSIA" ) ); -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - vkCreateStreamDescriptorSurfaceGGP = PFN_vkCreateStreamDescriptorSurfaceGGP( vkGetInstanceProcAddr( instance, "vkCreateStreamDescriptorSurfaceGGP" ) ); -# endif /*VK_USE_PLATFORM_GGP*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - vkCreateAndroidSurfaceKHR = PFN_vkCreateAndroidSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateAndroidSurfaceKHR" ) ); -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_KHR_device_group === - vkGetPhysicalDevicePresentRectanglesKHR = - PFN_vkGetPhysicalDevicePresentRectanglesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDevicePresentRectanglesKHR" ) ); - - //=== VK_KHR_device_group_creation === - vkEnumeratePhysicalDeviceGroupsKHR = PFN_vkEnumeratePhysicalDeviceGroupsKHR( vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceGroupsKHR" ) ); - if ( !vkEnumeratePhysicalDeviceGroups ) - vkEnumeratePhysicalDeviceGroups = vkEnumeratePhysicalDeviceGroupsKHR; - - //=== VK_KHR_display === - vkGetPhysicalDeviceDisplayPropertiesKHR = - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPropertiesKHR" ) ); - vkGetPhysicalDeviceDisplayPlanePropertiesKHR = - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPlanePropertiesKHR" ) ); - vkGetDisplayPlaneSupportedDisplaysKHR = - PFN_vkGetDisplayPlaneSupportedDisplaysKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneSupportedDisplaysKHR" ) ); - vkGetDisplayModePropertiesKHR = PFN_vkGetDisplayModePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayModePropertiesKHR" ) ); - vkCreateDisplayModeKHR = PFN_vkCreateDisplayModeKHR( vkGetInstanceProcAddr( instance, "vkCreateDisplayModeKHR" ) ); - vkGetDisplayPlaneCapabilitiesKHR = PFN_vkGetDisplayPlaneCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneCapabilitiesKHR" ) ); - vkCreateDisplayPlaneSurfaceKHR = PFN_vkCreateDisplayPlaneSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateDisplayPlaneSurfaceKHR" ) ); - - //=== VK_KHR_external_fence_capabilities === - vkGetPhysicalDeviceExternalFencePropertiesKHR = - PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalFencePropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalFenceProperties ) - vkGetPhysicalDeviceExternalFenceProperties = vkGetPhysicalDeviceExternalFencePropertiesKHR; - - //=== VK_KHR_external_memory_capabilities === - vkGetPhysicalDeviceExternalBufferPropertiesKHR = - PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalBufferPropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalBufferProperties ) - vkGetPhysicalDeviceExternalBufferProperties = vkGetPhysicalDeviceExternalBufferPropertiesKHR; - - //=== VK_KHR_external_semaphore_capabilities === - vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = - PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalSemaphorePropertiesKHR" ) ); - if ( !vkGetPhysicalDeviceExternalSemaphoreProperties ) - vkGetPhysicalDeviceExternalSemaphoreProperties = vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; - - //=== VK_KHR_fragment_shading_rate === - vkGetPhysicalDeviceFragmentShadingRatesKHR = - PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFragmentShadingRatesKHR" ) ); - - //=== VK_KHR_get_display_properties2 === - vkGetPhysicalDeviceDisplayProperties2KHR = - PFN_vkGetPhysicalDeviceDisplayProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayProperties2KHR" ) ); - vkGetPhysicalDeviceDisplayPlaneProperties2KHR = - PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceDisplayPlaneProperties2KHR" ) ); - vkGetDisplayModeProperties2KHR = PFN_vkGetDisplayModeProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetDisplayModeProperties2KHR" ) ); - vkGetDisplayPlaneCapabilities2KHR = PFN_vkGetDisplayPlaneCapabilities2KHR( vkGetInstanceProcAddr( instance, "vkGetDisplayPlaneCapabilities2KHR" ) ); - - //=== VK_KHR_get_physical_device_properties2 === - vkGetPhysicalDeviceFeatures2KHR = PFN_vkGetPhysicalDeviceFeatures2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFeatures2KHR" ) ); - if ( !vkGetPhysicalDeviceFeatures2 ) - vkGetPhysicalDeviceFeatures2 = vkGetPhysicalDeviceFeatures2KHR; - vkGetPhysicalDeviceProperties2KHR = PFN_vkGetPhysicalDeviceProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceProperties2 ) - vkGetPhysicalDeviceProperties2 = vkGetPhysicalDeviceProperties2KHR; - vkGetPhysicalDeviceFormatProperties2KHR = - PFN_vkGetPhysicalDeviceFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceFormatProperties2 ) - vkGetPhysicalDeviceFormatProperties2 = vkGetPhysicalDeviceFormatProperties2KHR; - vkGetPhysicalDeviceImageFormatProperties2KHR = - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceImageFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceImageFormatProperties2 ) - vkGetPhysicalDeviceImageFormatProperties2 = vkGetPhysicalDeviceImageFormatProperties2KHR; - vkGetPhysicalDeviceQueueFamilyProperties2KHR = - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceQueueFamilyProperties2 ) - vkGetPhysicalDeviceQueueFamilyProperties2 = vkGetPhysicalDeviceQueueFamilyProperties2KHR; - vkGetPhysicalDeviceMemoryProperties2KHR = - PFN_vkGetPhysicalDeviceMemoryProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceMemoryProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceMemoryProperties2 ) - vkGetPhysicalDeviceMemoryProperties2 = vkGetPhysicalDeviceMemoryProperties2KHR; - vkGetPhysicalDeviceSparseImageFormatProperties2KHR = - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSparseImageFormatProperties2KHR" ) ); - if ( !vkGetPhysicalDeviceSparseImageFormatProperties2 ) - vkGetPhysicalDeviceSparseImageFormatProperties2 = vkGetPhysicalDeviceSparseImageFormatProperties2KHR; - - //=== VK_KHR_get_surface_capabilities2 === - vkGetPhysicalDeviceSurfaceCapabilities2KHR = - PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilities2KHR" ) ); - vkGetPhysicalDeviceSurfaceFormats2KHR = - PFN_vkGetPhysicalDeviceSurfaceFormats2KHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormats2KHR" ) ); - - //=== VK_KHR_performance_query === - vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - vkGetInstanceProcAddr( instance, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR" ) ); - vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( - vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR" ) ); - - //=== VK_KHR_surface === - vkDestroySurfaceKHR = PFN_vkDestroySurfaceKHR( vkGetInstanceProcAddr( instance, "vkDestroySurfaceKHR" ) ); - vkGetPhysicalDeviceSurfaceSupportKHR = - PFN_vkGetPhysicalDeviceSurfaceSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceSupportKHR" ) ); - vkGetPhysicalDeviceSurfaceCapabilitiesKHR = - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR" ) ); - vkGetPhysicalDeviceSurfaceFormatsKHR = - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfaceFormatsKHR" ) ); - vkGetPhysicalDeviceSurfacePresentModesKHR = - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSurfacePresentModesKHR" ) ); - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - vkGetPhysicalDeviceVideoCapabilitiesKHR = - PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceVideoCapabilitiesKHR" ) ); - vkGetPhysicalDeviceVideoFormatPropertiesKHR = - PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceVideoFormatPropertiesKHR" ) ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - vkCreateWaylandSurfaceKHR = PFN_vkCreateWaylandSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateWaylandSurfaceKHR" ) ); - vkGetPhysicalDeviceWaylandPresentationSupportKHR = - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceWaylandPresentationSupportKHR" ) ); -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - vkCreateWin32SurfaceKHR = PFN_vkCreateWin32SurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateWin32SurfaceKHR" ) ); - vkGetPhysicalDeviceWin32PresentationSupportKHR = - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceWin32PresentationSupportKHR" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - vkCreateXcbSurfaceKHR = PFN_vkCreateXcbSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateXcbSurfaceKHR" ) ); - vkGetPhysicalDeviceXcbPresentationSupportKHR = - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceXcbPresentationSupportKHR" ) ); -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - vkCreateXlibSurfaceKHR = PFN_vkCreateXlibSurfaceKHR( vkGetInstanceProcAddr( instance, "vkCreateXlibSurfaceKHR" ) ); - vkGetPhysicalDeviceXlibPresentationSupportKHR = - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceXlibPresentationSupportKHR" ) ); -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - vkCreateIOSSurfaceMVK = PFN_vkCreateIOSSurfaceMVK( vkGetInstanceProcAddr( instance, "vkCreateIOSSurfaceMVK" ) ); -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - vkCreateMacOSSurfaceMVK = PFN_vkCreateMacOSSurfaceMVK( vkGetInstanceProcAddr( instance, "vkCreateMacOSSurfaceMVK" ) ); -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - -# if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - vkCreateViSurfaceNN = PFN_vkCreateViSurfaceNN( vkGetInstanceProcAddr( instance, "vkCreateViSurfaceNN" ) ); -# endif /*VK_USE_PLATFORM_VI_NN*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - vkAcquireWinrtDisplayNV = PFN_vkAcquireWinrtDisplayNV( vkGetInstanceProcAddr( instance, "vkAcquireWinrtDisplayNV" ) ); - vkGetWinrtDisplayNV = PFN_vkGetWinrtDisplayNV( vkGetInstanceProcAddr( instance, "vkGetWinrtDisplayNV" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_NV_cooperative_matrix === - vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = - PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceCooperativeMatrixPropertiesNV" ) ); - - //=== VK_NV_coverage_reduction_mode === - vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV" ) ); - - //=== VK_NV_external_memory_capabilities === - vkGetPhysicalDeviceExternalImageFormatPropertiesNV = - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceExternalImageFormatPropertiesNV" ) ); - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - vkCreateScreenSurfaceQNX = PFN_vkCreateScreenSurfaceQNX( vkGetInstanceProcAddr( instance, "vkCreateScreenSurfaceQNX" ) ); - vkGetPhysicalDeviceScreenPresentationSupportQNX = - PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX( vkGetInstanceProcAddr( instance, "vkGetPhysicalDeviceScreenPresentationSupportQNX" ) ); -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - vkGetDeviceProcAddr = PFN_vkGetDeviceProcAddr( vkGetInstanceProcAddr( instance, "vkGetDeviceProcAddr" ) ); - } - - public: - //=== VK_VERSION_1_0 === - PFN_vkDestroyInstance vkDestroyInstance = 0; - PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices = 0; - PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures = 0; - PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties = 0; - PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties = 0; - PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties = 0; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = 0; - PFN_vkCreateDevice vkCreateDevice = 0; - PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties = 0; - PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties = 0; - - //=== VK_VERSION_1_1 === - PFN_vkEnumeratePhysicalDeviceGroups vkEnumeratePhysicalDeviceGroups = 0; - PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2 = 0; - PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2 = 0; - PFN_vkGetPhysicalDeviceFormatProperties2 vkGetPhysicalDeviceFormatProperties2 = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2 = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2 vkGetPhysicalDeviceQueueFamilyProperties2 = 0; - PFN_vkGetPhysicalDeviceMemoryProperties2 vkGetPhysicalDeviceMemoryProperties2 = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 vkGetPhysicalDeviceSparseImageFormatProperties2 = 0; - PFN_vkGetPhysicalDeviceExternalBufferProperties vkGetPhysicalDeviceExternalBufferProperties = 0; - PFN_vkGetPhysicalDeviceExternalFenceProperties vkGetPhysicalDeviceExternalFenceProperties = 0; - PFN_vkGetPhysicalDeviceExternalSemaphoreProperties vkGetPhysicalDeviceExternalSemaphoreProperties = 0; - - //=== VK_VERSION_1_3 === - PFN_vkGetPhysicalDeviceToolProperties vkGetPhysicalDeviceToolProperties = 0; - - //=== VK_EXT_acquire_drm_display === - PFN_vkAcquireDrmDisplayEXT vkAcquireDrmDisplayEXT = 0; - PFN_vkGetDrmDisplayEXT vkGetDrmDisplayEXT = 0; - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - PFN_vkAcquireXlibDisplayEXT vkAcquireXlibDisplayEXT = 0; - PFN_vkGetRandROutputDisplayEXT vkGetRandROutputDisplayEXT = 0; -# else - PFN_dummy vkAcquireXlibDisplayEXT_placeholder = 0; - PFN_dummy vkGetRandROutputDisplayEXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_calibrated_timestamps === - PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = 0; - - //=== VK_EXT_debug_report === - PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT = 0; - PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallbackEXT = 0; - PFN_vkDebugReportMessageEXT vkDebugReportMessageEXT = 0; - - //=== VK_EXT_debug_utils === - PFN_vkCreateDebugUtilsMessengerEXT vkCreateDebugUtilsMessengerEXT = 0; - PFN_vkDestroyDebugUtilsMessengerEXT vkDestroyDebugUtilsMessengerEXT = 0; - PFN_vkSubmitDebugUtilsMessageEXT vkSubmitDebugUtilsMessageEXT = 0; - - //=== VK_EXT_direct_mode_display === - PFN_vkReleaseDisplayEXT vkReleaseDisplayEXT = 0; - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - PFN_vkCreateDirectFBSurfaceEXT vkCreateDirectFBSurfaceEXT = 0; - PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT vkGetPhysicalDeviceDirectFBPresentationSupportEXT = 0; -# else - PFN_dummy vkCreateDirectFBSurfaceEXT_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceDirectFBPresentationSupportEXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_EXT_display_surface_counter === - PFN_vkGetPhysicalDeviceSurfaceCapabilities2EXT vkGetPhysicalDeviceSurfaceCapabilities2EXT = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT vkGetPhysicalDeviceSurfacePresentModes2EXT = 0; -# else - PFN_dummy vkGetPhysicalDeviceSurfacePresentModes2EXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT = 0; - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT = 0; -# else - PFN_dummy vkCreateMetalSurfaceEXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_sample_locations === - PFN_vkGetPhysicalDeviceMultisamplePropertiesEXT vkGetPhysicalDeviceMultisamplePropertiesEXT = 0; - - //=== VK_EXT_tooling_info === - PFN_vkGetPhysicalDeviceToolPropertiesEXT vkGetPhysicalDeviceToolPropertiesEXT = 0; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - PFN_vkCreateImagePipeSurfaceFUCHSIA vkCreateImagePipeSurfaceFUCHSIA = 0; -# else - PFN_dummy vkCreateImagePipeSurfaceFUCHSIA_placeholder = 0; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - PFN_vkCreateStreamDescriptorSurfaceGGP vkCreateStreamDescriptorSurfaceGGP = 0; -# else - PFN_dummy vkCreateStreamDescriptorSurfaceGGP_placeholder = 0; -# endif /*VK_USE_PLATFORM_GGP*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR = 0; -# else - PFN_dummy vkCreateAndroidSurfaceKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_KHR_device_group === - PFN_vkGetPhysicalDevicePresentRectanglesKHR vkGetPhysicalDevicePresentRectanglesKHR = 0; - - //=== VK_KHR_device_group_creation === - PFN_vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceGroupsKHR = 0; - - //=== VK_KHR_display === - PFN_vkGetPhysicalDeviceDisplayPropertiesKHR vkGetPhysicalDeviceDisplayPropertiesKHR = 0; - PFN_vkGetPhysicalDeviceDisplayPlanePropertiesKHR vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 0; - PFN_vkGetDisplayPlaneSupportedDisplaysKHR vkGetDisplayPlaneSupportedDisplaysKHR = 0; - PFN_vkGetDisplayModePropertiesKHR vkGetDisplayModePropertiesKHR = 0; - PFN_vkCreateDisplayModeKHR vkCreateDisplayModeKHR = 0; - PFN_vkGetDisplayPlaneCapabilitiesKHR vkGetDisplayPlaneCapabilitiesKHR = 0; - PFN_vkCreateDisplayPlaneSurfaceKHR vkCreateDisplayPlaneSurfaceKHR = 0; - - //=== VK_KHR_external_fence_capabilities === - PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR = 0; - - //=== VK_KHR_external_memory_capabilities === - PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR = 0; - - //=== VK_KHR_external_semaphore_capabilities === - PFN_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 0; - - //=== VK_KHR_fragment_shading_rate === - PFN_vkGetPhysicalDeviceFragmentShadingRatesKHR vkGetPhysicalDeviceFragmentShadingRatesKHR = 0; - - //=== VK_KHR_get_display_properties2 === - PFN_vkGetPhysicalDeviceDisplayProperties2KHR vkGetPhysicalDeviceDisplayProperties2KHR = 0; - PFN_vkGetPhysicalDeviceDisplayPlaneProperties2KHR vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 0; - PFN_vkGetDisplayModeProperties2KHR vkGetDisplayModeProperties2KHR = 0; - PFN_vkGetDisplayPlaneCapabilities2KHR vkGetDisplayPlaneCapabilities2KHR = 0; - - //=== VK_KHR_get_physical_device_properties2 === - PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR = 0; - PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR = 0; - PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2KHR = 0; - PFN_vkGetPhysicalDeviceImageFormatProperties2KHR vkGetPhysicalDeviceImageFormatProperties2KHR = 0; - PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR = 0; - PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR = 0; - PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 0; - - //=== VK_KHR_get_surface_capabilities2 === - PFN_vkGetPhysicalDeviceSurfaceCapabilities2KHR vkGetPhysicalDeviceSurfaceCapabilities2KHR = 0; - PFN_vkGetPhysicalDeviceSurfaceFormats2KHR vkGetPhysicalDeviceSurfaceFormats2KHR = 0; - - //=== VK_KHR_performance_query === - PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR = 0; - PFN_vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR = 0; - - //=== VK_KHR_surface === - PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 0; - PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR = 0; - PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR = 0; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR = 0; - PFN_vkGetPhysicalDeviceVideoFormatPropertiesKHR vkGetPhysicalDeviceVideoFormatPropertiesKHR = 0; -# else - PFN_dummy vkGetPhysicalDeviceVideoCapabilitiesKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceVideoFormatPropertiesKHR_placeholder = 0; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR = 0; -# else - PFN_dummy vkCreateWaylandSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceWaylandPresentationSupportKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = 0; - PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR = 0; -# else - PFN_dummy vkCreateWin32SurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceWin32PresentationSupportKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR = 0; -# else - PFN_dummy vkCreateXcbSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceXcbPresentationSupportKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR = 0; - PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR = 0; -# else - PFN_dummy vkCreateXlibSurfaceKHR_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceXlibPresentationSupportKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - PFN_vkCreateIOSSurfaceMVK vkCreateIOSSurfaceMVK = 0; -# else - PFN_dummy vkCreateIOSSurfaceMVK_placeholder = 0; -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK = 0; -# else - PFN_dummy vkCreateMacOSSurfaceMVK_placeholder = 0; -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - -# if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - PFN_vkCreateViSurfaceNN vkCreateViSurfaceNN = 0; -# else - PFN_dummy vkCreateViSurfaceNN_placeholder = 0; -# endif /*VK_USE_PLATFORM_VI_NN*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - PFN_vkAcquireWinrtDisplayNV vkAcquireWinrtDisplayNV = 0; - PFN_vkGetWinrtDisplayNV vkGetWinrtDisplayNV = 0; -# else - PFN_dummy vkAcquireWinrtDisplayNV_placeholder = 0; - PFN_dummy vkGetWinrtDisplayNV_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_NV_cooperative_matrix === - PFN_vkGetPhysicalDeviceCooperativeMatrixPropertiesNV vkGetPhysicalDeviceCooperativeMatrixPropertiesNV = 0; - - //=== VK_NV_coverage_reduction_mode === - PFN_vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV = 0; - - //=== VK_NV_external_memory_capabilities === - PFN_vkGetPhysicalDeviceExternalImageFormatPropertiesNV vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 0; - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - PFN_vkCreateScreenSurfaceQNX vkCreateScreenSurfaceQNX = 0; - PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX vkGetPhysicalDeviceScreenPresentationSupportQNX = 0; -# else - PFN_dummy vkCreateScreenSurfaceQNX_placeholder = 0; - PFN_dummy vkGetPhysicalDeviceScreenPresentationSupportQNX_placeholder = 0; -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr = 0; - }; - - class DeviceDispatcher : public DispatchLoaderBase - { - public: - DeviceDispatcher( PFN_vkGetDeviceProcAddr getProcAddr, VkDevice device ) : vkGetDeviceProcAddr( getProcAddr ) - { - //=== VK_VERSION_1_0 === - vkGetDeviceProcAddr = PFN_vkGetDeviceProcAddr( vkGetDeviceProcAddr( device, "vkGetDeviceProcAddr" ) ); - vkDestroyDevice = PFN_vkDestroyDevice( vkGetDeviceProcAddr( device, "vkDestroyDevice" ) ); - vkGetDeviceQueue = PFN_vkGetDeviceQueue( vkGetDeviceProcAddr( device, "vkGetDeviceQueue" ) ); - vkQueueSubmit = PFN_vkQueueSubmit( vkGetDeviceProcAddr( device, "vkQueueSubmit" ) ); - vkQueueWaitIdle = PFN_vkQueueWaitIdle( vkGetDeviceProcAddr( device, "vkQueueWaitIdle" ) ); - vkDeviceWaitIdle = PFN_vkDeviceWaitIdle( vkGetDeviceProcAddr( device, "vkDeviceWaitIdle" ) ); - vkAllocateMemory = PFN_vkAllocateMemory( vkGetDeviceProcAddr( device, "vkAllocateMemory" ) ); - vkFreeMemory = PFN_vkFreeMemory( vkGetDeviceProcAddr( device, "vkFreeMemory" ) ); - vkMapMemory = PFN_vkMapMemory( vkGetDeviceProcAddr( device, "vkMapMemory" ) ); - vkUnmapMemory = PFN_vkUnmapMemory( vkGetDeviceProcAddr( device, "vkUnmapMemory" ) ); - vkFlushMappedMemoryRanges = PFN_vkFlushMappedMemoryRanges( vkGetDeviceProcAddr( device, "vkFlushMappedMemoryRanges" ) ); - vkInvalidateMappedMemoryRanges = PFN_vkInvalidateMappedMemoryRanges( vkGetDeviceProcAddr( device, "vkInvalidateMappedMemoryRanges" ) ); - vkGetDeviceMemoryCommitment = PFN_vkGetDeviceMemoryCommitment( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryCommitment" ) ); - vkBindBufferMemory = PFN_vkBindBufferMemory( vkGetDeviceProcAddr( device, "vkBindBufferMemory" ) ); - vkBindImageMemory = PFN_vkBindImageMemory( vkGetDeviceProcAddr( device, "vkBindImageMemory" ) ); - vkGetBufferMemoryRequirements = PFN_vkGetBufferMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements" ) ); - vkGetImageMemoryRequirements = PFN_vkGetImageMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements" ) ); - vkGetImageSparseMemoryRequirements = PFN_vkGetImageSparseMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements" ) ); - vkQueueBindSparse = PFN_vkQueueBindSparse( vkGetDeviceProcAddr( device, "vkQueueBindSparse" ) ); - vkCreateFence = PFN_vkCreateFence( vkGetDeviceProcAddr( device, "vkCreateFence" ) ); - vkDestroyFence = PFN_vkDestroyFence( vkGetDeviceProcAddr( device, "vkDestroyFence" ) ); - vkResetFences = PFN_vkResetFences( vkGetDeviceProcAddr( device, "vkResetFences" ) ); - vkGetFenceStatus = PFN_vkGetFenceStatus( vkGetDeviceProcAddr( device, "vkGetFenceStatus" ) ); - vkWaitForFences = PFN_vkWaitForFences( vkGetDeviceProcAddr( device, "vkWaitForFences" ) ); - vkCreateSemaphore = PFN_vkCreateSemaphore( vkGetDeviceProcAddr( device, "vkCreateSemaphore" ) ); - vkDestroySemaphore = PFN_vkDestroySemaphore( vkGetDeviceProcAddr( device, "vkDestroySemaphore" ) ); - vkCreateEvent = PFN_vkCreateEvent( vkGetDeviceProcAddr( device, "vkCreateEvent" ) ); - vkDestroyEvent = PFN_vkDestroyEvent( vkGetDeviceProcAddr( device, "vkDestroyEvent" ) ); - vkGetEventStatus = PFN_vkGetEventStatus( vkGetDeviceProcAddr( device, "vkGetEventStatus" ) ); - vkSetEvent = PFN_vkSetEvent( vkGetDeviceProcAddr( device, "vkSetEvent" ) ); - vkResetEvent = PFN_vkResetEvent( vkGetDeviceProcAddr( device, "vkResetEvent" ) ); - vkCreateQueryPool = PFN_vkCreateQueryPool( vkGetDeviceProcAddr( device, "vkCreateQueryPool" ) ); - vkDestroyQueryPool = PFN_vkDestroyQueryPool( vkGetDeviceProcAddr( device, "vkDestroyQueryPool" ) ); - vkGetQueryPoolResults = PFN_vkGetQueryPoolResults( vkGetDeviceProcAddr( device, "vkGetQueryPoolResults" ) ); - vkCreateBuffer = PFN_vkCreateBuffer( vkGetDeviceProcAddr( device, "vkCreateBuffer" ) ); - vkDestroyBuffer = PFN_vkDestroyBuffer( vkGetDeviceProcAddr( device, "vkDestroyBuffer" ) ); - vkCreateBufferView = PFN_vkCreateBufferView( vkGetDeviceProcAddr( device, "vkCreateBufferView" ) ); - vkDestroyBufferView = PFN_vkDestroyBufferView( vkGetDeviceProcAddr( device, "vkDestroyBufferView" ) ); - vkCreateImage = PFN_vkCreateImage( vkGetDeviceProcAddr( device, "vkCreateImage" ) ); - vkDestroyImage = PFN_vkDestroyImage( vkGetDeviceProcAddr( device, "vkDestroyImage" ) ); - vkGetImageSubresourceLayout = PFN_vkGetImageSubresourceLayout( vkGetDeviceProcAddr( device, "vkGetImageSubresourceLayout" ) ); - vkCreateImageView = PFN_vkCreateImageView( vkGetDeviceProcAddr( device, "vkCreateImageView" ) ); - vkDestroyImageView = PFN_vkDestroyImageView( vkGetDeviceProcAddr( device, "vkDestroyImageView" ) ); - vkCreateShaderModule = PFN_vkCreateShaderModule( vkGetDeviceProcAddr( device, "vkCreateShaderModule" ) ); - vkDestroyShaderModule = PFN_vkDestroyShaderModule( vkGetDeviceProcAddr( device, "vkDestroyShaderModule" ) ); - vkCreatePipelineCache = PFN_vkCreatePipelineCache( vkGetDeviceProcAddr( device, "vkCreatePipelineCache" ) ); - vkDestroyPipelineCache = PFN_vkDestroyPipelineCache( vkGetDeviceProcAddr( device, "vkDestroyPipelineCache" ) ); - vkGetPipelineCacheData = PFN_vkGetPipelineCacheData( vkGetDeviceProcAddr( device, "vkGetPipelineCacheData" ) ); - vkMergePipelineCaches = PFN_vkMergePipelineCaches( vkGetDeviceProcAddr( device, "vkMergePipelineCaches" ) ); - vkCreateGraphicsPipelines = PFN_vkCreateGraphicsPipelines( vkGetDeviceProcAddr( device, "vkCreateGraphicsPipelines" ) ); - vkCreateComputePipelines = PFN_vkCreateComputePipelines( vkGetDeviceProcAddr( device, "vkCreateComputePipelines" ) ); - vkDestroyPipeline = PFN_vkDestroyPipeline( vkGetDeviceProcAddr( device, "vkDestroyPipeline" ) ); - vkCreatePipelineLayout = PFN_vkCreatePipelineLayout( vkGetDeviceProcAddr( device, "vkCreatePipelineLayout" ) ); - vkDestroyPipelineLayout = PFN_vkDestroyPipelineLayout( vkGetDeviceProcAddr( device, "vkDestroyPipelineLayout" ) ); - vkCreateSampler = PFN_vkCreateSampler( vkGetDeviceProcAddr( device, "vkCreateSampler" ) ); - vkDestroySampler = PFN_vkDestroySampler( vkGetDeviceProcAddr( device, "vkDestroySampler" ) ); - vkCreateDescriptorSetLayout = PFN_vkCreateDescriptorSetLayout( vkGetDeviceProcAddr( device, "vkCreateDescriptorSetLayout" ) ); - vkDestroyDescriptorSetLayout = PFN_vkDestroyDescriptorSetLayout( vkGetDeviceProcAddr( device, "vkDestroyDescriptorSetLayout" ) ); - vkCreateDescriptorPool = PFN_vkCreateDescriptorPool( vkGetDeviceProcAddr( device, "vkCreateDescriptorPool" ) ); - vkDestroyDescriptorPool = PFN_vkDestroyDescriptorPool( vkGetDeviceProcAddr( device, "vkDestroyDescriptorPool" ) ); - vkResetDescriptorPool = PFN_vkResetDescriptorPool( vkGetDeviceProcAddr( device, "vkResetDescriptorPool" ) ); - vkAllocateDescriptorSets = PFN_vkAllocateDescriptorSets( vkGetDeviceProcAddr( device, "vkAllocateDescriptorSets" ) ); - vkFreeDescriptorSets = PFN_vkFreeDescriptorSets( vkGetDeviceProcAddr( device, "vkFreeDescriptorSets" ) ); - vkUpdateDescriptorSets = PFN_vkUpdateDescriptorSets( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSets" ) ); - vkCreateFramebuffer = PFN_vkCreateFramebuffer( vkGetDeviceProcAddr( device, "vkCreateFramebuffer" ) ); - vkDestroyFramebuffer = PFN_vkDestroyFramebuffer( vkGetDeviceProcAddr( device, "vkDestroyFramebuffer" ) ); - vkCreateRenderPass = PFN_vkCreateRenderPass( vkGetDeviceProcAddr( device, "vkCreateRenderPass" ) ); - vkDestroyRenderPass = PFN_vkDestroyRenderPass( vkGetDeviceProcAddr( device, "vkDestroyRenderPass" ) ); - vkGetRenderAreaGranularity = PFN_vkGetRenderAreaGranularity( vkGetDeviceProcAddr( device, "vkGetRenderAreaGranularity" ) ); - vkCreateCommandPool = PFN_vkCreateCommandPool( vkGetDeviceProcAddr( device, "vkCreateCommandPool" ) ); - vkDestroyCommandPool = PFN_vkDestroyCommandPool( vkGetDeviceProcAddr( device, "vkDestroyCommandPool" ) ); - vkResetCommandPool = PFN_vkResetCommandPool( vkGetDeviceProcAddr( device, "vkResetCommandPool" ) ); - vkAllocateCommandBuffers = PFN_vkAllocateCommandBuffers( vkGetDeviceProcAddr( device, "vkAllocateCommandBuffers" ) ); - vkFreeCommandBuffers = PFN_vkFreeCommandBuffers( vkGetDeviceProcAddr( device, "vkFreeCommandBuffers" ) ); - vkBeginCommandBuffer = PFN_vkBeginCommandBuffer( vkGetDeviceProcAddr( device, "vkBeginCommandBuffer" ) ); - vkEndCommandBuffer = PFN_vkEndCommandBuffer( vkGetDeviceProcAddr( device, "vkEndCommandBuffer" ) ); - vkResetCommandBuffer = PFN_vkResetCommandBuffer( vkGetDeviceProcAddr( device, "vkResetCommandBuffer" ) ); - vkCmdBindPipeline = PFN_vkCmdBindPipeline( vkGetDeviceProcAddr( device, "vkCmdBindPipeline" ) ); - vkCmdSetViewport = PFN_vkCmdSetViewport( vkGetDeviceProcAddr( device, "vkCmdSetViewport" ) ); - vkCmdSetScissor = PFN_vkCmdSetScissor( vkGetDeviceProcAddr( device, "vkCmdSetScissor" ) ); - vkCmdSetLineWidth = PFN_vkCmdSetLineWidth( vkGetDeviceProcAddr( device, "vkCmdSetLineWidth" ) ); - vkCmdSetDepthBias = PFN_vkCmdSetDepthBias( vkGetDeviceProcAddr( device, "vkCmdSetDepthBias" ) ); - vkCmdSetBlendConstants = PFN_vkCmdSetBlendConstants( vkGetDeviceProcAddr( device, "vkCmdSetBlendConstants" ) ); - vkCmdSetDepthBounds = PFN_vkCmdSetDepthBounds( vkGetDeviceProcAddr( device, "vkCmdSetDepthBounds" ) ); - vkCmdSetStencilCompareMask = PFN_vkCmdSetStencilCompareMask( vkGetDeviceProcAddr( device, "vkCmdSetStencilCompareMask" ) ); - vkCmdSetStencilWriteMask = PFN_vkCmdSetStencilWriteMask( vkGetDeviceProcAddr( device, "vkCmdSetStencilWriteMask" ) ); - vkCmdSetStencilReference = PFN_vkCmdSetStencilReference( vkGetDeviceProcAddr( device, "vkCmdSetStencilReference" ) ); - vkCmdBindDescriptorSets = PFN_vkCmdBindDescriptorSets( vkGetDeviceProcAddr( device, "vkCmdBindDescriptorSets" ) ); - vkCmdBindIndexBuffer = PFN_vkCmdBindIndexBuffer( vkGetDeviceProcAddr( device, "vkCmdBindIndexBuffer" ) ); - vkCmdBindVertexBuffers = PFN_vkCmdBindVertexBuffers( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers" ) ); - vkCmdDraw = PFN_vkCmdDraw( vkGetDeviceProcAddr( device, "vkCmdDraw" ) ); - vkCmdDrawIndexed = PFN_vkCmdDrawIndexed( vkGetDeviceProcAddr( device, "vkCmdDrawIndexed" ) ); - vkCmdDrawIndirect = PFN_vkCmdDrawIndirect( vkGetDeviceProcAddr( device, "vkCmdDrawIndirect" ) ); - vkCmdDrawIndexedIndirect = PFN_vkCmdDrawIndexedIndirect( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirect" ) ); - vkCmdDispatch = PFN_vkCmdDispatch( vkGetDeviceProcAddr( device, "vkCmdDispatch" ) ); - vkCmdDispatchIndirect = PFN_vkCmdDispatchIndirect( vkGetDeviceProcAddr( device, "vkCmdDispatchIndirect" ) ); - vkCmdCopyBuffer = PFN_vkCmdCopyBuffer( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer" ) ); - vkCmdCopyImage = PFN_vkCmdCopyImage( vkGetDeviceProcAddr( device, "vkCmdCopyImage" ) ); - vkCmdBlitImage = PFN_vkCmdBlitImage( vkGetDeviceProcAddr( device, "vkCmdBlitImage" ) ); - vkCmdCopyBufferToImage = PFN_vkCmdCopyBufferToImage( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage" ) ); - vkCmdCopyImageToBuffer = PFN_vkCmdCopyImageToBuffer( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer" ) ); - vkCmdUpdateBuffer = PFN_vkCmdUpdateBuffer( vkGetDeviceProcAddr( device, "vkCmdUpdateBuffer" ) ); - vkCmdFillBuffer = PFN_vkCmdFillBuffer( vkGetDeviceProcAddr( device, "vkCmdFillBuffer" ) ); - vkCmdClearColorImage = PFN_vkCmdClearColorImage( vkGetDeviceProcAddr( device, "vkCmdClearColorImage" ) ); - vkCmdClearDepthStencilImage = PFN_vkCmdClearDepthStencilImage( vkGetDeviceProcAddr( device, "vkCmdClearDepthStencilImage" ) ); - vkCmdClearAttachments = PFN_vkCmdClearAttachments( vkGetDeviceProcAddr( device, "vkCmdClearAttachments" ) ); - vkCmdResolveImage = PFN_vkCmdResolveImage( vkGetDeviceProcAddr( device, "vkCmdResolveImage" ) ); - vkCmdSetEvent = PFN_vkCmdSetEvent( vkGetDeviceProcAddr( device, "vkCmdSetEvent" ) ); - vkCmdResetEvent = PFN_vkCmdResetEvent( vkGetDeviceProcAddr( device, "vkCmdResetEvent" ) ); - vkCmdWaitEvents = PFN_vkCmdWaitEvents( vkGetDeviceProcAddr( device, "vkCmdWaitEvents" ) ); - vkCmdPipelineBarrier = PFN_vkCmdPipelineBarrier( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier" ) ); - vkCmdBeginQuery = PFN_vkCmdBeginQuery( vkGetDeviceProcAddr( device, "vkCmdBeginQuery" ) ); - vkCmdEndQuery = PFN_vkCmdEndQuery( vkGetDeviceProcAddr( device, "vkCmdEndQuery" ) ); - vkCmdResetQueryPool = PFN_vkCmdResetQueryPool( vkGetDeviceProcAddr( device, "vkCmdResetQueryPool" ) ); - vkCmdWriteTimestamp = PFN_vkCmdWriteTimestamp( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp" ) ); - vkCmdCopyQueryPoolResults = PFN_vkCmdCopyQueryPoolResults( vkGetDeviceProcAddr( device, "vkCmdCopyQueryPoolResults" ) ); - vkCmdPushConstants = PFN_vkCmdPushConstants( vkGetDeviceProcAddr( device, "vkCmdPushConstants" ) ); - vkCmdBeginRenderPass = PFN_vkCmdBeginRenderPass( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass" ) ); - vkCmdNextSubpass = PFN_vkCmdNextSubpass( vkGetDeviceProcAddr( device, "vkCmdNextSubpass" ) ); - vkCmdEndRenderPass = PFN_vkCmdEndRenderPass( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass" ) ); - vkCmdExecuteCommands = PFN_vkCmdExecuteCommands( vkGetDeviceProcAddr( device, "vkCmdExecuteCommands" ) ); - - //=== VK_VERSION_1_1 === - vkBindBufferMemory2 = PFN_vkBindBufferMemory2( vkGetDeviceProcAddr( device, "vkBindBufferMemory2" ) ); - vkBindImageMemory2 = PFN_vkBindImageMemory2( vkGetDeviceProcAddr( device, "vkBindImageMemory2" ) ); - vkGetDeviceGroupPeerMemoryFeatures = PFN_vkGetDeviceGroupPeerMemoryFeatures( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPeerMemoryFeatures" ) ); - vkCmdSetDeviceMask = PFN_vkCmdSetDeviceMask( vkGetDeviceProcAddr( device, "vkCmdSetDeviceMask" ) ); - vkCmdDispatchBase = PFN_vkCmdDispatchBase( vkGetDeviceProcAddr( device, "vkCmdDispatchBase" ) ); - vkGetImageMemoryRequirements2 = PFN_vkGetImageMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements2" ) ); - vkGetBufferMemoryRequirements2 = PFN_vkGetBufferMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements2" ) ); - vkGetImageSparseMemoryRequirements2 = PFN_vkGetImageSparseMemoryRequirements2( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements2" ) ); - vkTrimCommandPool = PFN_vkTrimCommandPool( vkGetDeviceProcAddr( device, "vkTrimCommandPool" ) ); - vkGetDeviceQueue2 = PFN_vkGetDeviceQueue2( vkGetDeviceProcAddr( device, "vkGetDeviceQueue2" ) ); - vkCreateSamplerYcbcrConversion = PFN_vkCreateSamplerYcbcrConversion( vkGetDeviceProcAddr( device, "vkCreateSamplerYcbcrConversion" ) ); - vkDestroySamplerYcbcrConversion = PFN_vkDestroySamplerYcbcrConversion( vkGetDeviceProcAddr( device, "vkDestroySamplerYcbcrConversion" ) ); - vkCreateDescriptorUpdateTemplate = PFN_vkCreateDescriptorUpdateTemplate( vkGetDeviceProcAddr( device, "vkCreateDescriptorUpdateTemplate" ) ); - vkDestroyDescriptorUpdateTemplate = PFN_vkDestroyDescriptorUpdateTemplate( vkGetDeviceProcAddr( device, "vkDestroyDescriptorUpdateTemplate" ) ); - vkUpdateDescriptorSetWithTemplate = PFN_vkUpdateDescriptorSetWithTemplate( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSetWithTemplate" ) ); - vkGetDescriptorSetLayoutSupport = PFN_vkGetDescriptorSetLayoutSupport( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutSupport" ) ); - - //=== VK_VERSION_1_2 === - vkCmdDrawIndirectCount = PFN_vkCmdDrawIndirectCount( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCount" ) ); - vkCmdDrawIndexedIndirectCount = PFN_vkCmdDrawIndexedIndirectCount( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCount" ) ); - vkCreateRenderPass2 = PFN_vkCreateRenderPass2( vkGetDeviceProcAddr( device, "vkCreateRenderPass2" ) ); - vkCmdBeginRenderPass2 = PFN_vkCmdBeginRenderPass2( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass2" ) ); - vkCmdNextSubpass2 = PFN_vkCmdNextSubpass2( vkGetDeviceProcAddr( device, "vkCmdNextSubpass2" ) ); - vkCmdEndRenderPass2 = PFN_vkCmdEndRenderPass2( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass2" ) ); - vkResetQueryPool = PFN_vkResetQueryPool( vkGetDeviceProcAddr( device, "vkResetQueryPool" ) ); - vkGetSemaphoreCounterValue = PFN_vkGetSemaphoreCounterValue( vkGetDeviceProcAddr( device, "vkGetSemaphoreCounterValue" ) ); - vkWaitSemaphores = PFN_vkWaitSemaphores( vkGetDeviceProcAddr( device, "vkWaitSemaphores" ) ); - vkSignalSemaphore = PFN_vkSignalSemaphore( vkGetDeviceProcAddr( device, "vkSignalSemaphore" ) ); - vkGetBufferDeviceAddress = PFN_vkGetBufferDeviceAddress( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddress" ) ); - vkGetBufferOpaqueCaptureAddress = PFN_vkGetBufferOpaqueCaptureAddress( vkGetDeviceProcAddr( device, "vkGetBufferOpaqueCaptureAddress" ) ); - vkGetDeviceMemoryOpaqueCaptureAddress = - PFN_vkGetDeviceMemoryOpaqueCaptureAddress( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryOpaqueCaptureAddress" ) ); - - //=== VK_VERSION_1_3 === - vkCreatePrivateDataSlot = PFN_vkCreatePrivateDataSlot( vkGetDeviceProcAddr( device, "vkCreatePrivateDataSlot" ) ); - vkDestroyPrivateDataSlot = PFN_vkDestroyPrivateDataSlot( vkGetDeviceProcAddr( device, "vkDestroyPrivateDataSlot" ) ); - vkSetPrivateData = PFN_vkSetPrivateData( vkGetDeviceProcAddr( device, "vkSetPrivateData" ) ); - vkGetPrivateData = PFN_vkGetPrivateData( vkGetDeviceProcAddr( device, "vkGetPrivateData" ) ); - vkCmdSetEvent2 = PFN_vkCmdSetEvent2( vkGetDeviceProcAddr( device, "vkCmdSetEvent2" ) ); - vkCmdResetEvent2 = PFN_vkCmdResetEvent2( vkGetDeviceProcAddr( device, "vkCmdResetEvent2" ) ); - vkCmdWaitEvents2 = PFN_vkCmdWaitEvents2( vkGetDeviceProcAddr( device, "vkCmdWaitEvents2" ) ); - vkCmdPipelineBarrier2 = PFN_vkCmdPipelineBarrier2( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier2" ) ); - vkCmdWriteTimestamp2 = PFN_vkCmdWriteTimestamp2( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp2" ) ); - vkQueueSubmit2 = PFN_vkQueueSubmit2( vkGetDeviceProcAddr( device, "vkQueueSubmit2" ) ); - vkCmdCopyBuffer2 = PFN_vkCmdCopyBuffer2( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer2" ) ); - vkCmdCopyImage2 = PFN_vkCmdCopyImage2( vkGetDeviceProcAddr( device, "vkCmdCopyImage2" ) ); - vkCmdCopyBufferToImage2 = PFN_vkCmdCopyBufferToImage2( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage2" ) ); - vkCmdCopyImageToBuffer2 = PFN_vkCmdCopyImageToBuffer2( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer2" ) ); - vkCmdBlitImage2 = PFN_vkCmdBlitImage2( vkGetDeviceProcAddr( device, "vkCmdBlitImage2" ) ); - vkCmdResolveImage2 = PFN_vkCmdResolveImage2( vkGetDeviceProcAddr( device, "vkCmdResolveImage2" ) ); - vkCmdBeginRendering = PFN_vkCmdBeginRendering( vkGetDeviceProcAddr( device, "vkCmdBeginRendering" ) ); - vkCmdEndRendering = PFN_vkCmdEndRendering( vkGetDeviceProcAddr( device, "vkCmdEndRendering" ) ); - vkCmdSetCullMode = PFN_vkCmdSetCullMode( vkGetDeviceProcAddr( device, "vkCmdSetCullMode" ) ); - vkCmdSetFrontFace = PFN_vkCmdSetFrontFace( vkGetDeviceProcAddr( device, "vkCmdSetFrontFace" ) ); - vkCmdSetPrimitiveTopology = PFN_vkCmdSetPrimitiveTopology( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveTopology" ) ); - vkCmdSetViewportWithCount = PFN_vkCmdSetViewportWithCount( vkGetDeviceProcAddr( device, "vkCmdSetViewportWithCount" ) ); - vkCmdSetScissorWithCount = PFN_vkCmdSetScissorWithCount( vkGetDeviceProcAddr( device, "vkCmdSetScissorWithCount" ) ); - vkCmdBindVertexBuffers2 = PFN_vkCmdBindVertexBuffers2( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers2" ) ); - vkCmdSetDepthTestEnable = PFN_vkCmdSetDepthTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthTestEnable" ) ); - vkCmdSetDepthWriteEnable = PFN_vkCmdSetDepthWriteEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthWriteEnable" ) ); - vkCmdSetDepthCompareOp = PFN_vkCmdSetDepthCompareOp( vkGetDeviceProcAddr( device, "vkCmdSetDepthCompareOp" ) ); - vkCmdSetDepthBoundsTestEnable = PFN_vkCmdSetDepthBoundsTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthBoundsTestEnable" ) ); - vkCmdSetStencilTestEnable = PFN_vkCmdSetStencilTestEnable( vkGetDeviceProcAddr( device, "vkCmdSetStencilTestEnable" ) ); - vkCmdSetStencilOp = PFN_vkCmdSetStencilOp( vkGetDeviceProcAddr( device, "vkCmdSetStencilOp" ) ); - vkCmdSetRasterizerDiscardEnable = PFN_vkCmdSetRasterizerDiscardEnable( vkGetDeviceProcAddr( device, "vkCmdSetRasterizerDiscardEnable" ) ); - vkCmdSetDepthBiasEnable = PFN_vkCmdSetDepthBiasEnable( vkGetDeviceProcAddr( device, "vkCmdSetDepthBiasEnable" ) ); - vkCmdSetPrimitiveRestartEnable = PFN_vkCmdSetPrimitiveRestartEnable( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveRestartEnable" ) ); - vkGetDeviceBufferMemoryRequirements = PFN_vkGetDeviceBufferMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceBufferMemoryRequirements" ) ); - vkGetDeviceImageMemoryRequirements = PFN_vkGetDeviceImageMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceImageMemoryRequirements" ) ); - vkGetDeviceImageSparseMemoryRequirements = - PFN_vkGetDeviceImageSparseMemoryRequirements( vkGetDeviceProcAddr( device, "vkGetDeviceImageSparseMemoryRequirements" ) ); - - //=== VK_AMD_buffer_marker === - vkCmdWriteBufferMarkerAMD = PFN_vkCmdWriteBufferMarkerAMD( vkGetDeviceProcAddr( device, "vkCmdWriteBufferMarkerAMD" ) ); - - //=== VK_AMD_display_native_hdr === - vkSetLocalDimmingAMD = PFN_vkSetLocalDimmingAMD( vkGetDeviceProcAddr( device, "vkSetLocalDimmingAMD" ) ); - - //=== VK_AMD_draw_indirect_count === - vkCmdDrawIndirectCountAMD = PFN_vkCmdDrawIndirectCountAMD( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCountAMD" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountAMD; - vkCmdDrawIndexedIndirectCountAMD = PFN_vkCmdDrawIndexedIndirectCountAMD( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCountAMD" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountAMD; - - //=== VK_AMD_shader_info === - vkGetShaderInfoAMD = PFN_vkGetShaderInfoAMD( vkGetDeviceProcAddr( device, "vkGetShaderInfoAMD" ) ); - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - vkGetAndroidHardwareBufferPropertiesANDROID = - PFN_vkGetAndroidHardwareBufferPropertiesANDROID( vkGetDeviceProcAddr( device, "vkGetAndroidHardwareBufferPropertiesANDROID" ) ); - vkGetMemoryAndroidHardwareBufferANDROID = - PFN_vkGetMemoryAndroidHardwareBufferANDROID( vkGetDeviceProcAddr( device, "vkGetMemoryAndroidHardwareBufferANDROID" ) ); -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_buffer_device_address === - vkGetBufferDeviceAddressEXT = PFN_vkGetBufferDeviceAddressEXT( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddressEXT" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressEXT; - - //=== VK_EXT_calibrated_timestamps === - vkGetCalibratedTimestampsEXT = PFN_vkGetCalibratedTimestampsEXT( vkGetDeviceProcAddr( device, "vkGetCalibratedTimestampsEXT" ) ); - - //=== VK_EXT_color_write_enable === - vkCmdSetColorWriteEnableEXT = PFN_vkCmdSetColorWriteEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetColorWriteEnableEXT" ) ); - - //=== VK_EXT_conditional_rendering === - vkCmdBeginConditionalRenderingEXT = PFN_vkCmdBeginConditionalRenderingEXT( vkGetDeviceProcAddr( device, "vkCmdBeginConditionalRenderingEXT" ) ); - vkCmdEndConditionalRenderingEXT = PFN_vkCmdEndConditionalRenderingEXT( vkGetDeviceProcAddr( device, "vkCmdEndConditionalRenderingEXT" ) ); - - //=== VK_EXT_debug_marker === - vkDebugMarkerSetObjectTagEXT = PFN_vkDebugMarkerSetObjectTagEXT( vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectTagEXT" ) ); - vkDebugMarkerSetObjectNameEXT = PFN_vkDebugMarkerSetObjectNameEXT( vkGetDeviceProcAddr( device, "vkDebugMarkerSetObjectNameEXT" ) ); - vkCmdDebugMarkerBeginEXT = PFN_vkCmdDebugMarkerBeginEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerBeginEXT" ) ); - vkCmdDebugMarkerEndEXT = PFN_vkCmdDebugMarkerEndEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerEndEXT" ) ); - vkCmdDebugMarkerInsertEXT = PFN_vkCmdDebugMarkerInsertEXT( vkGetDeviceProcAddr( device, "vkCmdDebugMarkerInsertEXT" ) ); - - //=== VK_EXT_debug_utils === - vkSetDebugUtilsObjectNameEXT = PFN_vkSetDebugUtilsObjectNameEXT( vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectNameEXT" ) ); - vkSetDebugUtilsObjectTagEXT = PFN_vkSetDebugUtilsObjectTagEXT( vkGetDeviceProcAddr( device, "vkSetDebugUtilsObjectTagEXT" ) ); - vkQueueBeginDebugUtilsLabelEXT = PFN_vkQueueBeginDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueBeginDebugUtilsLabelEXT" ) ); - vkQueueEndDebugUtilsLabelEXT = PFN_vkQueueEndDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueEndDebugUtilsLabelEXT" ) ); - vkQueueInsertDebugUtilsLabelEXT = PFN_vkQueueInsertDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkQueueInsertDebugUtilsLabelEXT" ) ); - vkCmdBeginDebugUtilsLabelEXT = PFN_vkCmdBeginDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdBeginDebugUtilsLabelEXT" ) ); - vkCmdEndDebugUtilsLabelEXT = PFN_vkCmdEndDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdEndDebugUtilsLabelEXT" ) ); - vkCmdInsertDebugUtilsLabelEXT = PFN_vkCmdInsertDebugUtilsLabelEXT( vkGetDeviceProcAddr( device, "vkCmdInsertDebugUtilsLabelEXT" ) ); - - //=== VK_EXT_discard_rectangles === - vkCmdSetDiscardRectangleEXT = PFN_vkCmdSetDiscardRectangleEXT( vkGetDeviceProcAddr( device, "vkCmdSetDiscardRectangleEXT" ) ); - - //=== VK_EXT_display_control === - vkDisplayPowerControlEXT = PFN_vkDisplayPowerControlEXT( vkGetDeviceProcAddr( device, "vkDisplayPowerControlEXT" ) ); - vkRegisterDeviceEventEXT = PFN_vkRegisterDeviceEventEXT( vkGetDeviceProcAddr( device, "vkRegisterDeviceEventEXT" ) ); - vkRegisterDisplayEventEXT = PFN_vkRegisterDisplayEventEXT( vkGetDeviceProcAddr( device, "vkRegisterDisplayEventEXT" ) ); - vkGetSwapchainCounterEXT = PFN_vkGetSwapchainCounterEXT( vkGetDeviceProcAddr( device, "vkGetSwapchainCounterEXT" ) ); - - //=== VK_EXT_extended_dynamic_state === - vkCmdSetCullModeEXT = PFN_vkCmdSetCullModeEXT( vkGetDeviceProcAddr( device, "vkCmdSetCullModeEXT" ) ); - if ( !vkCmdSetCullMode ) - vkCmdSetCullMode = vkCmdSetCullModeEXT; - vkCmdSetFrontFaceEXT = PFN_vkCmdSetFrontFaceEXT( vkGetDeviceProcAddr( device, "vkCmdSetFrontFaceEXT" ) ); - if ( !vkCmdSetFrontFace ) - vkCmdSetFrontFace = vkCmdSetFrontFaceEXT; - vkCmdSetPrimitiveTopologyEXT = PFN_vkCmdSetPrimitiveTopologyEXT( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveTopologyEXT" ) ); - if ( !vkCmdSetPrimitiveTopology ) - vkCmdSetPrimitiveTopology = vkCmdSetPrimitiveTopologyEXT; - vkCmdSetViewportWithCountEXT = PFN_vkCmdSetViewportWithCountEXT( vkGetDeviceProcAddr( device, "vkCmdSetViewportWithCountEXT" ) ); - if ( !vkCmdSetViewportWithCount ) - vkCmdSetViewportWithCount = vkCmdSetViewportWithCountEXT; - vkCmdSetScissorWithCountEXT = PFN_vkCmdSetScissorWithCountEXT( vkGetDeviceProcAddr( device, "vkCmdSetScissorWithCountEXT" ) ); - if ( !vkCmdSetScissorWithCount ) - vkCmdSetScissorWithCount = vkCmdSetScissorWithCountEXT; - vkCmdBindVertexBuffers2EXT = PFN_vkCmdBindVertexBuffers2EXT( vkGetDeviceProcAddr( device, "vkCmdBindVertexBuffers2EXT" ) ); - if ( !vkCmdBindVertexBuffers2 ) - vkCmdBindVertexBuffers2 = vkCmdBindVertexBuffers2EXT; - vkCmdSetDepthTestEnableEXT = PFN_vkCmdSetDepthTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthTestEnableEXT" ) ); - if ( !vkCmdSetDepthTestEnable ) - vkCmdSetDepthTestEnable = vkCmdSetDepthTestEnableEXT; - vkCmdSetDepthWriteEnableEXT = PFN_vkCmdSetDepthWriteEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthWriteEnableEXT" ) ); - if ( !vkCmdSetDepthWriteEnable ) - vkCmdSetDepthWriteEnable = vkCmdSetDepthWriteEnableEXT; - vkCmdSetDepthCompareOpEXT = PFN_vkCmdSetDepthCompareOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthCompareOpEXT" ) ); - if ( !vkCmdSetDepthCompareOp ) - vkCmdSetDepthCompareOp = vkCmdSetDepthCompareOpEXT; - vkCmdSetDepthBoundsTestEnableEXT = PFN_vkCmdSetDepthBoundsTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthBoundsTestEnableEXT" ) ); - if ( !vkCmdSetDepthBoundsTestEnable ) - vkCmdSetDepthBoundsTestEnable = vkCmdSetDepthBoundsTestEnableEXT; - vkCmdSetStencilTestEnableEXT = PFN_vkCmdSetStencilTestEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetStencilTestEnableEXT" ) ); - if ( !vkCmdSetStencilTestEnable ) - vkCmdSetStencilTestEnable = vkCmdSetStencilTestEnableEXT; - vkCmdSetStencilOpEXT = PFN_vkCmdSetStencilOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetStencilOpEXT" ) ); - if ( !vkCmdSetStencilOp ) - vkCmdSetStencilOp = vkCmdSetStencilOpEXT; - - //=== VK_EXT_extended_dynamic_state2 === - vkCmdSetPatchControlPointsEXT = PFN_vkCmdSetPatchControlPointsEXT( vkGetDeviceProcAddr( device, "vkCmdSetPatchControlPointsEXT" ) ); - vkCmdSetRasterizerDiscardEnableEXT = PFN_vkCmdSetRasterizerDiscardEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetRasterizerDiscardEnableEXT" ) ); - if ( !vkCmdSetRasterizerDiscardEnable ) - vkCmdSetRasterizerDiscardEnable = vkCmdSetRasterizerDiscardEnableEXT; - vkCmdSetDepthBiasEnableEXT = PFN_vkCmdSetDepthBiasEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetDepthBiasEnableEXT" ) ); - if ( !vkCmdSetDepthBiasEnable ) - vkCmdSetDepthBiasEnable = vkCmdSetDepthBiasEnableEXT; - vkCmdSetLogicOpEXT = PFN_vkCmdSetLogicOpEXT( vkGetDeviceProcAddr( device, "vkCmdSetLogicOpEXT" ) ); - vkCmdSetPrimitiveRestartEnableEXT = PFN_vkCmdSetPrimitiveRestartEnableEXT( vkGetDeviceProcAddr( device, "vkCmdSetPrimitiveRestartEnableEXT" ) ); - if ( !vkCmdSetPrimitiveRestartEnable ) - vkCmdSetPrimitiveRestartEnable = vkCmdSetPrimitiveRestartEnableEXT; - - //=== VK_EXT_external_memory_host === - vkGetMemoryHostPointerPropertiesEXT = PFN_vkGetMemoryHostPointerPropertiesEXT( vkGetDeviceProcAddr( device, "vkGetMemoryHostPointerPropertiesEXT" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - vkAcquireFullScreenExclusiveModeEXT = PFN_vkAcquireFullScreenExclusiveModeEXT( vkGetDeviceProcAddr( device, "vkAcquireFullScreenExclusiveModeEXT" ) ); - vkReleaseFullScreenExclusiveModeEXT = PFN_vkReleaseFullScreenExclusiveModeEXT( vkGetDeviceProcAddr( device, "vkReleaseFullScreenExclusiveModeEXT" ) ); - vkGetDeviceGroupSurfacePresentModes2EXT = - PFN_vkGetDeviceGroupSurfacePresentModes2EXT( vkGetDeviceProcAddr( device, "vkGetDeviceGroupSurfacePresentModes2EXT" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_hdr_metadata === - vkSetHdrMetadataEXT = PFN_vkSetHdrMetadataEXT( vkGetDeviceProcAddr( device, "vkSetHdrMetadataEXT" ) ); - - //=== VK_EXT_host_query_reset === - vkResetQueryPoolEXT = PFN_vkResetQueryPoolEXT( vkGetDeviceProcAddr( device, "vkResetQueryPoolEXT" ) ); - if ( !vkResetQueryPool ) - vkResetQueryPool = vkResetQueryPoolEXT; - - //=== VK_EXT_image_compression_control === - vkGetImageSubresourceLayout2EXT = PFN_vkGetImageSubresourceLayout2EXT( vkGetDeviceProcAddr( device, "vkGetImageSubresourceLayout2EXT" ) ); - - //=== VK_EXT_image_drm_format_modifier === - vkGetImageDrmFormatModifierPropertiesEXT = - PFN_vkGetImageDrmFormatModifierPropertiesEXT( vkGetDeviceProcAddr( device, "vkGetImageDrmFormatModifierPropertiesEXT" ) ); - - //=== VK_EXT_line_rasterization === - vkCmdSetLineStippleEXT = PFN_vkCmdSetLineStippleEXT( vkGetDeviceProcAddr( device, "vkCmdSetLineStippleEXT" ) ); - - //=== VK_EXT_mesh_shader === - vkCmdDrawMeshTasksEXT = PFN_vkCmdDrawMeshTasksEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksEXT" ) ); - vkCmdDrawMeshTasksIndirectEXT = PFN_vkCmdDrawMeshTasksIndirectEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectEXT" ) ); - vkCmdDrawMeshTasksIndirectCountEXT = PFN_vkCmdDrawMeshTasksIndirectCountEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectCountEXT" ) ); - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - vkExportMetalObjectsEXT = PFN_vkExportMetalObjectsEXT( vkGetDeviceProcAddr( device, "vkExportMetalObjectsEXT" ) ); -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_multi_draw === - vkCmdDrawMultiEXT = PFN_vkCmdDrawMultiEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMultiEXT" ) ); - vkCmdDrawMultiIndexedEXT = PFN_vkCmdDrawMultiIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdDrawMultiIndexedEXT" ) ); - - //=== VK_EXT_pageable_device_local_memory === - vkSetDeviceMemoryPriorityEXT = PFN_vkSetDeviceMemoryPriorityEXT( vkGetDeviceProcAddr( device, "vkSetDeviceMemoryPriorityEXT" ) ); - - //=== VK_EXT_pipeline_properties === - vkGetPipelinePropertiesEXT = PFN_vkGetPipelinePropertiesEXT( vkGetDeviceProcAddr( device, "vkGetPipelinePropertiesEXT" ) ); - - //=== VK_EXT_private_data === - vkCreatePrivateDataSlotEXT = PFN_vkCreatePrivateDataSlotEXT( vkGetDeviceProcAddr( device, "vkCreatePrivateDataSlotEXT" ) ); - if ( !vkCreatePrivateDataSlot ) - vkCreatePrivateDataSlot = vkCreatePrivateDataSlotEXT; - vkDestroyPrivateDataSlotEXT = PFN_vkDestroyPrivateDataSlotEXT( vkGetDeviceProcAddr( device, "vkDestroyPrivateDataSlotEXT" ) ); - if ( !vkDestroyPrivateDataSlot ) - vkDestroyPrivateDataSlot = vkDestroyPrivateDataSlotEXT; - vkSetPrivateDataEXT = PFN_vkSetPrivateDataEXT( vkGetDeviceProcAddr( device, "vkSetPrivateDataEXT" ) ); - if ( !vkSetPrivateData ) - vkSetPrivateData = vkSetPrivateDataEXT; - vkGetPrivateDataEXT = PFN_vkGetPrivateDataEXT( vkGetDeviceProcAddr( device, "vkGetPrivateDataEXT" ) ); - if ( !vkGetPrivateData ) - vkGetPrivateData = vkGetPrivateDataEXT; - - //=== VK_EXT_sample_locations === - vkCmdSetSampleLocationsEXT = PFN_vkCmdSetSampleLocationsEXT( vkGetDeviceProcAddr( device, "vkCmdSetSampleLocationsEXT" ) ); - - //=== VK_EXT_shader_module_identifier === - vkGetShaderModuleIdentifierEXT = PFN_vkGetShaderModuleIdentifierEXT( vkGetDeviceProcAddr( device, "vkGetShaderModuleIdentifierEXT" ) ); - vkGetShaderModuleCreateInfoIdentifierEXT = - PFN_vkGetShaderModuleCreateInfoIdentifierEXT( vkGetDeviceProcAddr( device, "vkGetShaderModuleCreateInfoIdentifierEXT" ) ); - - //=== VK_EXT_transform_feedback === - vkCmdBindTransformFeedbackBuffersEXT = - PFN_vkCmdBindTransformFeedbackBuffersEXT( vkGetDeviceProcAddr( device, "vkCmdBindTransformFeedbackBuffersEXT" ) ); - vkCmdBeginTransformFeedbackEXT = PFN_vkCmdBeginTransformFeedbackEXT( vkGetDeviceProcAddr( device, "vkCmdBeginTransformFeedbackEXT" ) ); - vkCmdEndTransformFeedbackEXT = PFN_vkCmdEndTransformFeedbackEXT( vkGetDeviceProcAddr( device, "vkCmdEndTransformFeedbackEXT" ) ); - vkCmdBeginQueryIndexedEXT = PFN_vkCmdBeginQueryIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdBeginQueryIndexedEXT" ) ); - vkCmdEndQueryIndexedEXT = PFN_vkCmdEndQueryIndexedEXT( vkGetDeviceProcAddr( device, "vkCmdEndQueryIndexedEXT" ) ); - vkCmdDrawIndirectByteCountEXT = PFN_vkCmdDrawIndirectByteCountEXT( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectByteCountEXT" ) ); - - //=== VK_EXT_validation_cache === - vkCreateValidationCacheEXT = PFN_vkCreateValidationCacheEXT( vkGetDeviceProcAddr( device, "vkCreateValidationCacheEXT" ) ); - vkDestroyValidationCacheEXT = PFN_vkDestroyValidationCacheEXT( vkGetDeviceProcAddr( device, "vkDestroyValidationCacheEXT" ) ); - vkMergeValidationCachesEXT = PFN_vkMergeValidationCachesEXT( vkGetDeviceProcAddr( device, "vkMergeValidationCachesEXT" ) ); - vkGetValidationCacheDataEXT = PFN_vkGetValidationCacheDataEXT( vkGetDeviceProcAddr( device, "vkGetValidationCacheDataEXT" ) ); - - //=== VK_EXT_vertex_input_dynamic_state === - vkCmdSetVertexInputEXT = PFN_vkCmdSetVertexInputEXT( vkGetDeviceProcAddr( device, "vkCmdSetVertexInputEXT" ) ); - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - vkCreateBufferCollectionFUCHSIA = PFN_vkCreateBufferCollectionFUCHSIA( vkGetDeviceProcAddr( device, "vkCreateBufferCollectionFUCHSIA" ) ); - vkSetBufferCollectionImageConstraintsFUCHSIA = - PFN_vkSetBufferCollectionImageConstraintsFUCHSIA( vkGetDeviceProcAddr( device, "vkSetBufferCollectionImageConstraintsFUCHSIA" ) ); - vkSetBufferCollectionBufferConstraintsFUCHSIA = - PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA( vkGetDeviceProcAddr( device, "vkSetBufferCollectionBufferConstraintsFUCHSIA" ) ); - vkDestroyBufferCollectionFUCHSIA = PFN_vkDestroyBufferCollectionFUCHSIA( vkGetDeviceProcAddr( device, "vkDestroyBufferCollectionFUCHSIA" ) ); - vkGetBufferCollectionPropertiesFUCHSIA = - PFN_vkGetBufferCollectionPropertiesFUCHSIA( vkGetDeviceProcAddr( device, "vkGetBufferCollectionPropertiesFUCHSIA" ) ); -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - vkGetMemoryZirconHandleFUCHSIA = PFN_vkGetMemoryZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkGetMemoryZirconHandleFUCHSIA" ) ); - vkGetMemoryZirconHandlePropertiesFUCHSIA = - PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA( vkGetDeviceProcAddr( device, "vkGetMemoryZirconHandlePropertiesFUCHSIA" ) ); -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - vkImportSemaphoreZirconHandleFUCHSIA = - PFN_vkImportSemaphoreZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkImportSemaphoreZirconHandleFUCHSIA" ) ); - vkGetSemaphoreZirconHandleFUCHSIA = PFN_vkGetSemaphoreZirconHandleFUCHSIA( vkGetDeviceProcAddr( device, "vkGetSemaphoreZirconHandleFUCHSIA" ) ); -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_GOOGLE_display_timing === - vkGetRefreshCycleDurationGOOGLE = PFN_vkGetRefreshCycleDurationGOOGLE( vkGetDeviceProcAddr( device, "vkGetRefreshCycleDurationGOOGLE" ) ); - vkGetPastPresentationTimingGOOGLE = PFN_vkGetPastPresentationTimingGOOGLE( vkGetDeviceProcAddr( device, "vkGetPastPresentationTimingGOOGLE" ) ); - - //=== VK_HUAWEI_invocation_mask === - vkCmdBindInvocationMaskHUAWEI = PFN_vkCmdBindInvocationMaskHUAWEI( vkGetDeviceProcAddr( device, "vkCmdBindInvocationMaskHUAWEI" ) ); - - //=== VK_HUAWEI_subpass_shading === - vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = - PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( vkGetDeviceProcAddr( device, "vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI" ) ); - vkCmdSubpassShadingHUAWEI = PFN_vkCmdSubpassShadingHUAWEI( vkGetDeviceProcAddr( device, "vkCmdSubpassShadingHUAWEI" ) ); - - //=== VK_INTEL_performance_query === - vkInitializePerformanceApiINTEL = PFN_vkInitializePerformanceApiINTEL( vkGetDeviceProcAddr( device, "vkInitializePerformanceApiINTEL" ) ); - vkUninitializePerformanceApiINTEL = PFN_vkUninitializePerformanceApiINTEL( vkGetDeviceProcAddr( device, "vkUninitializePerformanceApiINTEL" ) ); - vkCmdSetPerformanceMarkerINTEL = PFN_vkCmdSetPerformanceMarkerINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceMarkerINTEL" ) ); - vkCmdSetPerformanceStreamMarkerINTEL = - PFN_vkCmdSetPerformanceStreamMarkerINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceStreamMarkerINTEL" ) ); - vkCmdSetPerformanceOverrideINTEL = PFN_vkCmdSetPerformanceOverrideINTEL( vkGetDeviceProcAddr( device, "vkCmdSetPerformanceOverrideINTEL" ) ); - vkAcquirePerformanceConfigurationINTEL = - PFN_vkAcquirePerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkAcquirePerformanceConfigurationINTEL" ) ); - vkReleasePerformanceConfigurationINTEL = - PFN_vkReleasePerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkReleasePerformanceConfigurationINTEL" ) ); - vkQueueSetPerformanceConfigurationINTEL = - PFN_vkQueueSetPerformanceConfigurationINTEL( vkGetDeviceProcAddr( device, "vkQueueSetPerformanceConfigurationINTEL" ) ); - vkGetPerformanceParameterINTEL = PFN_vkGetPerformanceParameterINTEL( vkGetDeviceProcAddr( device, "vkGetPerformanceParameterINTEL" ) ); - - //=== VK_KHR_acceleration_structure === - vkCreateAccelerationStructureKHR = PFN_vkCreateAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCreateAccelerationStructureKHR" ) ); - vkDestroyAccelerationStructureKHR = PFN_vkDestroyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkDestroyAccelerationStructureKHR" ) ); - vkCmdBuildAccelerationStructuresKHR = PFN_vkCmdBuildAccelerationStructuresKHR( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructuresKHR" ) ); - vkCmdBuildAccelerationStructuresIndirectKHR = - PFN_vkCmdBuildAccelerationStructuresIndirectKHR( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructuresIndirectKHR" ) ); - vkBuildAccelerationStructuresKHR = PFN_vkBuildAccelerationStructuresKHR( vkGetDeviceProcAddr( device, "vkBuildAccelerationStructuresKHR" ) ); - vkCopyAccelerationStructureKHR = PFN_vkCopyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCopyAccelerationStructureKHR" ) ); - vkCopyAccelerationStructureToMemoryKHR = - PFN_vkCopyAccelerationStructureToMemoryKHR( vkGetDeviceProcAddr( device, "vkCopyAccelerationStructureToMemoryKHR" ) ); - vkCopyMemoryToAccelerationStructureKHR = - PFN_vkCopyMemoryToAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCopyMemoryToAccelerationStructureKHR" ) ); - vkWriteAccelerationStructuresPropertiesKHR = - PFN_vkWriteAccelerationStructuresPropertiesKHR( vkGetDeviceProcAddr( device, "vkWriteAccelerationStructuresPropertiesKHR" ) ); - vkCmdCopyAccelerationStructureKHR = PFN_vkCmdCopyAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureKHR" ) ); - vkCmdCopyAccelerationStructureToMemoryKHR = - PFN_vkCmdCopyAccelerationStructureToMemoryKHR( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureToMemoryKHR" ) ); - vkCmdCopyMemoryToAccelerationStructureKHR = - PFN_vkCmdCopyMemoryToAccelerationStructureKHR( vkGetDeviceProcAddr( device, "vkCmdCopyMemoryToAccelerationStructureKHR" ) ); - vkGetAccelerationStructureDeviceAddressKHR = - PFN_vkGetAccelerationStructureDeviceAddressKHR( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureDeviceAddressKHR" ) ); - vkCmdWriteAccelerationStructuresPropertiesKHR = - PFN_vkCmdWriteAccelerationStructuresPropertiesKHR( vkGetDeviceProcAddr( device, "vkCmdWriteAccelerationStructuresPropertiesKHR" ) ); - vkGetDeviceAccelerationStructureCompatibilityKHR = - PFN_vkGetDeviceAccelerationStructureCompatibilityKHR( vkGetDeviceProcAddr( device, "vkGetDeviceAccelerationStructureCompatibilityKHR" ) ); - vkGetAccelerationStructureBuildSizesKHR = - PFN_vkGetAccelerationStructureBuildSizesKHR( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureBuildSizesKHR" ) ); - - //=== VK_KHR_bind_memory2 === - vkBindBufferMemory2KHR = PFN_vkBindBufferMemory2KHR( vkGetDeviceProcAddr( device, "vkBindBufferMemory2KHR" ) ); - if ( !vkBindBufferMemory2 ) - vkBindBufferMemory2 = vkBindBufferMemory2KHR; - vkBindImageMemory2KHR = PFN_vkBindImageMemory2KHR( vkGetDeviceProcAddr( device, "vkBindImageMemory2KHR" ) ); - if ( !vkBindImageMemory2 ) - vkBindImageMemory2 = vkBindImageMemory2KHR; - - //=== VK_KHR_buffer_device_address === - vkGetBufferDeviceAddressKHR = PFN_vkGetBufferDeviceAddressKHR( vkGetDeviceProcAddr( device, "vkGetBufferDeviceAddressKHR" ) ); - if ( !vkGetBufferDeviceAddress ) - vkGetBufferDeviceAddress = vkGetBufferDeviceAddressKHR; - vkGetBufferOpaqueCaptureAddressKHR = PFN_vkGetBufferOpaqueCaptureAddressKHR( vkGetDeviceProcAddr( device, "vkGetBufferOpaqueCaptureAddressKHR" ) ); - if ( !vkGetBufferOpaqueCaptureAddress ) - vkGetBufferOpaqueCaptureAddress = vkGetBufferOpaqueCaptureAddressKHR; - vkGetDeviceMemoryOpaqueCaptureAddressKHR = - PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR( vkGetDeviceProcAddr( device, "vkGetDeviceMemoryOpaqueCaptureAddressKHR" ) ); - if ( !vkGetDeviceMemoryOpaqueCaptureAddress ) - vkGetDeviceMemoryOpaqueCaptureAddress = vkGetDeviceMemoryOpaqueCaptureAddressKHR; - - //=== VK_KHR_copy_commands2 === - vkCmdCopyBuffer2KHR = PFN_vkCmdCopyBuffer2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyBuffer2KHR" ) ); - if ( !vkCmdCopyBuffer2 ) - vkCmdCopyBuffer2 = vkCmdCopyBuffer2KHR; - vkCmdCopyImage2KHR = PFN_vkCmdCopyImage2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyImage2KHR" ) ); - if ( !vkCmdCopyImage2 ) - vkCmdCopyImage2 = vkCmdCopyImage2KHR; - vkCmdCopyBufferToImage2KHR = PFN_vkCmdCopyBufferToImage2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyBufferToImage2KHR" ) ); - if ( !vkCmdCopyBufferToImage2 ) - vkCmdCopyBufferToImage2 = vkCmdCopyBufferToImage2KHR; - vkCmdCopyImageToBuffer2KHR = PFN_vkCmdCopyImageToBuffer2KHR( vkGetDeviceProcAddr( device, "vkCmdCopyImageToBuffer2KHR" ) ); - if ( !vkCmdCopyImageToBuffer2 ) - vkCmdCopyImageToBuffer2 = vkCmdCopyImageToBuffer2KHR; - vkCmdBlitImage2KHR = PFN_vkCmdBlitImage2KHR( vkGetDeviceProcAddr( device, "vkCmdBlitImage2KHR" ) ); - if ( !vkCmdBlitImage2 ) - vkCmdBlitImage2 = vkCmdBlitImage2KHR; - vkCmdResolveImage2KHR = PFN_vkCmdResolveImage2KHR( vkGetDeviceProcAddr( device, "vkCmdResolveImage2KHR" ) ); - if ( !vkCmdResolveImage2 ) - vkCmdResolveImage2 = vkCmdResolveImage2KHR; - - //=== VK_KHR_create_renderpass2 === - vkCreateRenderPass2KHR = PFN_vkCreateRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCreateRenderPass2KHR" ) ); - if ( !vkCreateRenderPass2 ) - vkCreateRenderPass2 = vkCreateRenderPass2KHR; - vkCmdBeginRenderPass2KHR = PFN_vkCmdBeginRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCmdBeginRenderPass2KHR" ) ); - if ( !vkCmdBeginRenderPass2 ) - vkCmdBeginRenderPass2 = vkCmdBeginRenderPass2KHR; - vkCmdNextSubpass2KHR = PFN_vkCmdNextSubpass2KHR( vkGetDeviceProcAddr( device, "vkCmdNextSubpass2KHR" ) ); - if ( !vkCmdNextSubpass2 ) - vkCmdNextSubpass2 = vkCmdNextSubpass2KHR; - vkCmdEndRenderPass2KHR = PFN_vkCmdEndRenderPass2KHR( vkGetDeviceProcAddr( device, "vkCmdEndRenderPass2KHR" ) ); - if ( !vkCmdEndRenderPass2 ) - vkCmdEndRenderPass2 = vkCmdEndRenderPass2KHR; - - //=== VK_KHR_deferred_host_operations === - vkCreateDeferredOperationKHR = PFN_vkCreateDeferredOperationKHR( vkGetDeviceProcAddr( device, "vkCreateDeferredOperationKHR" ) ); - vkDestroyDeferredOperationKHR = PFN_vkDestroyDeferredOperationKHR( vkGetDeviceProcAddr( device, "vkDestroyDeferredOperationKHR" ) ); - vkGetDeferredOperationMaxConcurrencyKHR = - PFN_vkGetDeferredOperationMaxConcurrencyKHR( vkGetDeviceProcAddr( device, "vkGetDeferredOperationMaxConcurrencyKHR" ) ); - vkGetDeferredOperationResultKHR = PFN_vkGetDeferredOperationResultKHR( vkGetDeviceProcAddr( device, "vkGetDeferredOperationResultKHR" ) ); - vkDeferredOperationJoinKHR = PFN_vkDeferredOperationJoinKHR( vkGetDeviceProcAddr( device, "vkDeferredOperationJoinKHR" ) ); - - //=== VK_KHR_descriptor_update_template === - vkCreateDescriptorUpdateTemplateKHR = PFN_vkCreateDescriptorUpdateTemplateKHR( vkGetDeviceProcAddr( device, "vkCreateDescriptorUpdateTemplateKHR" ) ); - if ( !vkCreateDescriptorUpdateTemplate ) - vkCreateDescriptorUpdateTemplate = vkCreateDescriptorUpdateTemplateKHR; - vkDestroyDescriptorUpdateTemplateKHR = - PFN_vkDestroyDescriptorUpdateTemplateKHR( vkGetDeviceProcAddr( device, "vkDestroyDescriptorUpdateTemplateKHR" ) ); - if ( !vkDestroyDescriptorUpdateTemplate ) - vkDestroyDescriptorUpdateTemplate = vkDestroyDescriptorUpdateTemplateKHR; - vkUpdateDescriptorSetWithTemplateKHR = - PFN_vkUpdateDescriptorSetWithTemplateKHR( vkGetDeviceProcAddr( device, "vkUpdateDescriptorSetWithTemplateKHR" ) ); - if ( !vkUpdateDescriptorSetWithTemplate ) - vkUpdateDescriptorSetWithTemplate = vkUpdateDescriptorSetWithTemplateKHR; - vkCmdPushDescriptorSetWithTemplateKHR = - PFN_vkCmdPushDescriptorSetWithTemplateKHR( vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetWithTemplateKHR" ) ); - - //=== VK_KHR_device_group === - vkGetDeviceGroupPeerMemoryFeaturesKHR = - PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPeerMemoryFeaturesKHR" ) ); - if ( !vkGetDeviceGroupPeerMemoryFeatures ) - vkGetDeviceGroupPeerMemoryFeatures = vkGetDeviceGroupPeerMemoryFeaturesKHR; - vkCmdSetDeviceMaskKHR = PFN_vkCmdSetDeviceMaskKHR( vkGetDeviceProcAddr( device, "vkCmdSetDeviceMaskKHR" ) ); - if ( !vkCmdSetDeviceMask ) - vkCmdSetDeviceMask = vkCmdSetDeviceMaskKHR; - vkCmdDispatchBaseKHR = PFN_vkCmdDispatchBaseKHR( vkGetDeviceProcAddr( device, "vkCmdDispatchBaseKHR" ) ); - if ( !vkCmdDispatchBase ) - vkCmdDispatchBase = vkCmdDispatchBaseKHR; - vkGetDeviceGroupPresentCapabilitiesKHR = - PFN_vkGetDeviceGroupPresentCapabilitiesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupPresentCapabilitiesKHR" ) ); - vkGetDeviceGroupSurfacePresentModesKHR = - PFN_vkGetDeviceGroupSurfacePresentModesKHR( vkGetDeviceProcAddr( device, "vkGetDeviceGroupSurfacePresentModesKHR" ) ); - vkAcquireNextImage2KHR = PFN_vkAcquireNextImage2KHR( vkGetDeviceProcAddr( device, "vkAcquireNextImage2KHR" ) ); - - //=== VK_KHR_display_swapchain === - vkCreateSharedSwapchainsKHR = PFN_vkCreateSharedSwapchainsKHR( vkGetDeviceProcAddr( device, "vkCreateSharedSwapchainsKHR" ) ); - - //=== VK_KHR_draw_indirect_count === - vkCmdDrawIndirectCountKHR = PFN_vkCmdDrawIndirectCountKHR( vkGetDeviceProcAddr( device, "vkCmdDrawIndirectCountKHR" ) ); - if ( !vkCmdDrawIndirectCount ) - vkCmdDrawIndirectCount = vkCmdDrawIndirectCountKHR; - vkCmdDrawIndexedIndirectCountKHR = PFN_vkCmdDrawIndexedIndirectCountKHR( vkGetDeviceProcAddr( device, "vkCmdDrawIndexedIndirectCountKHR" ) ); - if ( !vkCmdDrawIndexedIndirectCount ) - vkCmdDrawIndexedIndirectCount = vkCmdDrawIndexedIndirectCountKHR; - - //=== VK_KHR_dynamic_rendering === - vkCmdBeginRenderingKHR = PFN_vkCmdBeginRenderingKHR( vkGetDeviceProcAddr( device, "vkCmdBeginRenderingKHR" ) ); - if ( !vkCmdBeginRendering ) - vkCmdBeginRendering = vkCmdBeginRenderingKHR; - vkCmdEndRenderingKHR = PFN_vkCmdEndRenderingKHR( vkGetDeviceProcAddr( device, "vkCmdEndRenderingKHR" ) ); - if ( !vkCmdEndRendering ) - vkCmdEndRendering = vkCmdEndRenderingKHR; - - //=== VK_KHR_external_fence_fd === - vkImportFenceFdKHR = PFN_vkImportFenceFdKHR( vkGetDeviceProcAddr( device, "vkImportFenceFdKHR" ) ); - vkGetFenceFdKHR = PFN_vkGetFenceFdKHR( vkGetDeviceProcAddr( device, "vkGetFenceFdKHR" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - vkImportFenceWin32HandleKHR = PFN_vkImportFenceWin32HandleKHR( vkGetDeviceProcAddr( device, "vkImportFenceWin32HandleKHR" ) ); - vkGetFenceWin32HandleKHR = PFN_vkGetFenceWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetFenceWin32HandleKHR" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - vkGetMemoryFdKHR = PFN_vkGetMemoryFdKHR( vkGetDeviceProcAddr( device, "vkGetMemoryFdKHR" ) ); - vkGetMemoryFdPropertiesKHR = PFN_vkGetMemoryFdPropertiesKHR( vkGetDeviceProcAddr( device, "vkGetMemoryFdPropertiesKHR" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - vkGetMemoryWin32HandleKHR = PFN_vkGetMemoryWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandleKHR" ) ); - vkGetMemoryWin32HandlePropertiesKHR = PFN_vkGetMemoryWin32HandlePropertiesKHR( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandlePropertiesKHR" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - vkImportSemaphoreFdKHR = PFN_vkImportSemaphoreFdKHR( vkGetDeviceProcAddr( device, "vkImportSemaphoreFdKHR" ) ); - vkGetSemaphoreFdKHR = PFN_vkGetSemaphoreFdKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreFdKHR" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - vkImportSemaphoreWin32HandleKHR = PFN_vkImportSemaphoreWin32HandleKHR( vkGetDeviceProcAddr( device, "vkImportSemaphoreWin32HandleKHR" ) ); - vkGetSemaphoreWin32HandleKHR = PFN_vkGetSemaphoreWin32HandleKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreWin32HandleKHR" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_fragment_shading_rate === - vkCmdSetFragmentShadingRateKHR = PFN_vkCmdSetFragmentShadingRateKHR( vkGetDeviceProcAddr( device, "vkCmdSetFragmentShadingRateKHR" ) ); - - //=== VK_KHR_get_memory_requirements2 === - vkGetImageMemoryRequirements2KHR = PFN_vkGetImageMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetImageMemoryRequirements2KHR" ) ); - if ( !vkGetImageMemoryRequirements2 ) - vkGetImageMemoryRequirements2 = vkGetImageMemoryRequirements2KHR; - vkGetBufferMemoryRequirements2KHR = PFN_vkGetBufferMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetBufferMemoryRequirements2KHR" ) ); - if ( !vkGetBufferMemoryRequirements2 ) - vkGetBufferMemoryRequirements2 = vkGetBufferMemoryRequirements2KHR; - vkGetImageSparseMemoryRequirements2KHR = - PFN_vkGetImageSparseMemoryRequirements2KHR( vkGetDeviceProcAddr( device, "vkGetImageSparseMemoryRequirements2KHR" ) ); - if ( !vkGetImageSparseMemoryRequirements2 ) - vkGetImageSparseMemoryRequirements2 = vkGetImageSparseMemoryRequirements2KHR; - - //=== VK_KHR_maintenance1 === - vkTrimCommandPoolKHR = PFN_vkTrimCommandPoolKHR( vkGetDeviceProcAddr( device, "vkTrimCommandPoolKHR" ) ); - if ( !vkTrimCommandPool ) - vkTrimCommandPool = vkTrimCommandPoolKHR; - - //=== VK_KHR_maintenance3 === - vkGetDescriptorSetLayoutSupportKHR = PFN_vkGetDescriptorSetLayoutSupportKHR( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutSupportKHR" ) ); - if ( !vkGetDescriptorSetLayoutSupport ) - vkGetDescriptorSetLayoutSupport = vkGetDescriptorSetLayoutSupportKHR; - - //=== VK_KHR_maintenance4 === - vkGetDeviceBufferMemoryRequirementsKHR = - PFN_vkGetDeviceBufferMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceBufferMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceBufferMemoryRequirements ) - vkGetDeviceBufferMemoryRequirements = vkGetDeviceBufferMemoryRequirementsKHR; - vkGetDeviceImageMemoryRequirementsKHR = - PFN_vkGetDeviceImageMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceImageMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageMemoryRequirements ) - vkGetDeviceImageMemoryRequirements = vkGetDeviceImageMemoryRequirementsKHR; - vkGetDeviceImageSparseMemoryRequirementsKHR = - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetDeviceImageSparseMemoryRequirementsKHR" ) ); - if ( !vkGetDeviceImageSparseMemoryRequirements ) - vkGetDeviceImageSparseMemoryRequirements = vkGetDeviceImageSparseMemoryRequirementsKHR; - - //=== VK_KHR_performance_query === - vkAcquireProfilingLockKHR = PFN_vkAcquireProfilingLockKHR( vkGetDeviceProcAddr( device, "vkAcquireProfilingLockKHR" ) ); - vkReleaseProfilingLockKHR = PFN_vkReleaseProfilingLockKHR( vkGetDeviceProcAddr( device, "vkReleaseProfilingLockKHR" ) ); - - //=== VK_KHR_pipeline_executable_properties === - vkGetPipelineExecutablePropertiesKHR = - PFN_vkGetPipelineExecutablePropertiesKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutablePropertiesKHR" ) ); - vkGetPipelineExecutableStatisticsKHR = - PFN_vkGetPipelineExecutableStatisticsKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutableStatisticsKHR" ) ); - vkGetPipelineExecutableInternalRepresentationsKHR = - PFN_vkGetPipelineExecutableInternalRepresentationsKHR( vkGetDeviceProcAddr( device, "vkGetPipelineExecutableInternalRepresentationsKHR" ) ); - - //=== VK_KHR_present_wait === - vkWaitForPresentKHR = PFN_vkWaitForPresentKHR( vkGetDeviceProcAddr( device, "vkWaitForPresentKHR" ) ); - - //=== VK_KHR_push_descriptor === - vkCmdPushDescriptorSetKHR = PFN_vkCmdPushDescriptorSetKHR( vkGetDeviceProcAddr( device, "vkCmdPushDescriptorSetKHR" ) ); - - //=== VK_KHR_ray_tracing_maintenance1 === - vkCmdTraceRaysIndirect2KHR = PFN_vkCmdTraceRaysIndirect2KHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysIndirect2KHR" ) ); - - //=== VK_KHR_ray_tracing_pipeline === - vkCmdTraceRaysKHR = PFN_vkCmdTraceRaysKHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysKHR" ) ); - vkCreateRayTracingPipelinesKHR = PFN_vkCreateRayTracingPipelinesKHR( vkGetDeviceProcAddr( device, "vkCreateRayTracingPipelinesKHR" ) ); - vkGetRayTracingShaderGroupHandlesKHR = - PFN_vkGetRayTracingShaderGroupHandlesKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupHandlesKHR" ) ); - vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = - PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingCaptureReplayShaderGroupHandlesKHR" ) ); - vkCmdTraceRaysIndirectKHR = PFN_vkCmdTraceRaysIndirectKHR( vkGetDeviceProcAddr( device, "vkCmdTraceRaysIndirectKHR" ) ); - vkGetRayTracingShaderGroupStackSizeKHR = - PFN_vkGetRayTracingShaderGroupStackSizeKHR( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupStackSizeKHR" ) ); - vkCmdSetRayTracingPipelineStackSizeKHR = - PFN_vkCmdSetRayTracingPipelineStackSizeKHR( vkGetDeviceProcAddr( device, "vkCmdSetRayTracingPipelineStackSizeKHR" ) ); - - //=== VK_KHR_sampler_ycbcr_conversion === - vkCreateSamplerYcbcrConversionKHR = PFN_vkCreateSamplerYcbcrConversionKHR( vkGetDeviceProcAddr( device, "vkCreateSamplerYcbcrConversionKHR" ) ); - if ( !vkCreateSamplerYcbcrConversion ) - vkCreateSamplerYcbcrConversion = vkCreateSamplerYcbcrConversionKHR; - vkDestroySamplerYcbcrConversionKHR = PFN_vkDestroySamplerYcbcrConversionKHR( vkGetDeviceProcAddr( device, "vkDestroySamplerYcbcrConversionKHR" ) ); - if ( !vkDestroySamplerYcbcrConversion ) - vkDestroySamplerYcbcrConversion = vkDestroySamplerYcbcrConversionKHR; - - //=== VK_KHR_shared_presentable_image === - vkGetSwapchainStatusKHR = PFN_vkGetSwapchainStatusKHR( vkGetDeviceProcAddr( device, "vkGetSwapchainStatusKHR" ) ); - - //=== VK_KHR_swapchain === - vkCreateSwapchainKHR = PFN_vkCreateSwapchainKHR( vkGetDeviceProcAddr( device, "vkCreateSwapchainKHR" ) ); - vkDestroySwapchainKHR = PFN_vkDestroySwapchainKHR( vkGetDeviceProcAddr( device, "vkDestroySwapchainKHR" ) ); - vkGetSwapchainImagesKHR = PFN_vkGetSwapchainImagesKHR( vkGetDeviceProcAddr( device, "vkGetSwapchainImagesKHR" ) ); - vkAcquireNextImageKHR = PFN_vkAcquireNextImageKHR( vkGetDeviceProcAddr( device, "vkAcquireNextImageKHR" ) ); - vkQueuePresentKHR = PFN_vkQueuePresentKHR( vkGetDeviceProcAddr( device, "vkQueuePresentKHR" ) ); - - //=== VK_KHR_synchronization2 === - vkCmdSetEvent2KHR = PFN_vkCmdSetEvent2KHR( vkGetDeviceProcAddr( device, "vkCmdSetEvent2KHR" ) ); - if ( !vkCmdSetEvent2 ) - vkCmdSetEvent2 = vkCmdSetEvent2KHR; - vkCmdResetEvent2KHR = PFN_vkCmdResetEvent2KHR( vkGetDeviceProcAddr( device, "vkCmdResetEvent2KHR" ) ); - if ( !vkCmdResetEvent2 ) - vkCmdResetEvent2 = vkCmdResetEvent2KHR; - vkCmdWaitEvents2KHR = PFN_vkCmdWaitEvents2KHR( vkGetDeviceProcAddr( device, "vkCmdWaitEvents2KHR" ) ); - if ( !vkCmdWaitEvents2 ) - vkCmdWaitEvents2 = vkCmdWaitEvents2KHR; - vkCmdPipelineBarrier2KHR = PFN_vkCmdPipelineBarrier2KHR( vkGetDeviceProcAddr( device, "vkCmdPipelineBarrier2KHR" ) ); - if ( !vkCmdPipelineBarrier2 ) - vkCmdPipelineBarrier2 = vkCmdPipelineBarrier2KHR; - vkCmdWriteTimestamp2KHR = PFN_vkCmdWriteTimestamp2KHR( vkGetDeviceProcAddr( device, "vkCmdWriteTimestamp2KHR" ) ); - if ( !vkCmdWriteTimestamp2 ) - vkCmdWriteTimestamp2 = vkCmdWriteTimestamp2KHR; - vkQueueSubmit2KHR = PFN_vkQueueSubmit2KHR( vkGetDeviceProcAddr( device, "vkQueueSubmit2KHR" ) ); - if ( !vkQueueSubmit2 ) - vkQueueSubmit2 = vkQueueSubmit2KHR; - vkCmdWriteBufferMarker2AMD = PFN_vkCmdWriteBufferMarker2AMD( vkGetDeviceProcAddr( device, "vkCmdWriteBufferMarker2AMD" ) ); - vkGetQueueCheckpointData2NV = PFN_vkGetQueueCheckpointData2NV( vkGetDeviceProcAddr( device, "vkGetQueueCheckpointData2NV" ) ); - - //=== VK_KHR_timeline_semaphore === - vkGetSemaphoreCounterValueKHR = PFN_vkGetSemaphoreCounterValueKHR( vkGetDeviceProcAddr( device, "vkGetSemaphoreCounterValueKHR" ) ); - if ( !vkGetSemaphoreCounterValue ) - vkGetSemaphoreCounterValue = vkGetSemaphoreCounterValueKHR; - vkWaitSemaphoresKHR = PFN_vkWaitSemaphoresKHR( vkGetDeviceProcAddr( device, "vkWaitSemaphoresKHR" ) ); - if ( !vkWaitSemaphores ) - vkWaitSemaphores = vkWaitSemaphoresKHR; - vkSignalSemaphoreKHR = PFN_vkSignalSemaphoreKHR( vkGetDeviceProcAddr( device, "vkSignalSemaphoreKHR" ) ); - if ( !vkSignalSemaphore ) - vkSignalSemaphore = vkSignalSemaphoreKHR; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - vkCmdDecodeVideoKHR = PFN_vkCmdDecodeVideoKHR( vkGetDeviceProcAddr( device, "vkCmdDecodeVideoKHR" ) ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - vkCmdEncodeVideoKHR = PFN_vkCmdEncodeVideoKHR( vkGetDeviceProcAddr( device, "vkCmdEncodeVideoKHR" ) ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - vkCreateVideoSessionKHR = PFN_vkCreateVideoSessionKHR( vkGetDeviceProcAddr( device, "vkCreateVideoSessionKHR" ) ); - vkDestroyVideoSessionKHR = PFN_vkDestroyVideoSessionKHR( vkGetDeviceProcAddr( device, "vkDestroyVideoSessionKHR" ) ); - vkGetVideoSessionMemoryRequirementsKHR = - PFN_vkGetVideoSessionMemoryRequirementsKHR( vkGetDeviceProcAddr( device, "vkGetVideoSessionMemoryRequirementsKHR" ) ); - vkBindVideoSessionMemoryKHR = PFN_vkBindVideoSessionMemoryKHR( vkGetDeviceProcAddr( device, "vkBindVideoSessionMemoryKHR" ) ); - vkCreateVideoSessionParametersKHR = PFN_vkCreateVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkCreateVideoSessionParametersKHR" ) ); - vkUpdateVideoSessionParametersKHR = PFN_vkUpdateVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkUpdateVideoSessionParametersKHR" ) ); - vkDestroyVideoSessionParametersKHR = PFN_vkDestroyVideoSessionParametersKHR( vkGetDeviceProcAddr( device, "vkDestroyVideoSessionParametersKHR" ) ); - vkCmdBeginVideoCodingKHR = PFN_vkCmdBeginVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdBeginVideoCodingKHR" ) ); - vkCmdEndVideoCodingKHR = PFN_vkCmdEndVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdEndVideoCodingKHR" ) ); - vkCmdControlVideoCodingKHR = PFN_vkCmdControlVideoCodingKHR( vkGetDeviceProcAddr( device, "vkCmdControlVideoCodingKHR" ) ); -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - vkCreateCuModuleNVX = PFN_vkCreateCuModuleNVX( vkGetDeviceProcAddr( device, "vkCreateCuModuleNVX" ) ); - vkCreateCuFunctionNVX = PFN_vkCreateCuFunctionNVX( vkGetDeviceProcAddr( device, "vkCreateCuFunctionNVX" ) ); - vkDestroyCuModuleNVX = PFN_vkDestroyCuModuleNVX( vkGetDeviceProcAddr( device, "vkDestroyCuModuleNVX" ) ); - vkDestroyCuFunctionNVX = PFN_vkDestroyCuFunctionNVX( vkGetDeviceProcAddr( device, "vkDestroyCuFunctionNVX" ) ); - vkCmdCuLaunchKernelNVX = PFN_vkCmdCuLaunchKernelNVX( vkGetDeviceProcAddr( device, "vkCmdCuLaunchKernelNVX" ) ); - - //=== VK_NVX_image_view_handle === - vkGetImageViewHandleNVX = PFN_vkGetImageViewHandleNVX( vkGetDeviceProcAddr( device, "vkGetImageViewHandleNVX" ) ); - vkGetImageViewAddressNVX = PFN_vkGetImageViewAddressNVX( vkGetDeviceProcAddr( device, "vkGetImageViewAddressNVX" ) ); - - //=== VK_NV_clip_space_w_scaling === - vkCmdSetViewportWScalingNV = PFN_vkCmdSetViewportWScalingNV( vkGetDeviceProcAddr( device, "vkCmdSetViewportWScalingNV" ) ); - - //=== VK_NV_device_diagnostic_checkpoints === - vkCmdSetCheckpointNV = PFN_vkCmdSetCheckpointNV( vkGetDeviceProcAddr( device, "vkCmdSetCheckpointNV" ) ); - vkGetQueueCheckpointDataNV = PFN_vkGetQueueCheckpointDataNV( vkGetDeviceProcAddr( device, "vkGetQueueCheckpointDataNV" ) ); - - //=== VK_NV_device_generated_commands === - vkGetGeneratedCommandsMemoryRequirementsNV = - PFN_vkGetGeneratedCommandsMemoryRequirementsNV( vkGetDeviceProcAddr( device, "vkGetGeneratedCommandsMemoryRequirementsNV" ) ); - vkCmdPreprocessGeneratedCommandsNV = PFN_vkCmdPreprocessGeneratedCommandsNV( vkGetDeviceProcAddr( device, "vkCmdPreprocessGeneratedCommandsNV" ) ); - vkCmdExecuteGeneratedCommandsNV = PFN_vkCmdExecuteGeneratedCommandsNV( vkGetDeviceProcAddr( device, "vkCmdExecuteGeneratedCommandsNV" ) ); - vkCmdBindPipelineShaderGroupNV = PFN_vkCmdBindPipelineShaderGroupNV( vkGetDeviceProcAddr( device, "vkCmdBindPipelineShaderGroupNV" ) ); - vkCreateIndirectCommandsLayoutNV = PFN_vkCreateIndirectCommandsLayoutNV( vkGetDeviceProcAddr( device, "vkCreateIndirectCommandsLayoutNV" ) ); - vkDestroyIndirectCommandsLayoutNV = PFN_vkDestroyIndirectCommandsLayoutNV( vkGetDeviceProcAddr( device, "vkDestroyIndirectCommandsLayoutNV" ) ); - - //=== VK_NV_external_memory_rdma === - vkGetMemoryRemoteAddressNV = PFN_vkGetMemoryRemoteAddressNV( vkGetDeviceProcAddr( device, "vkGetMemoryRemoteAddressNV" ) ); - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - vkGetMemoryWin32HandleNV = PFN_vkGetMemoryWin32HandleNV( vkGetDeviceProcAddr( device, "vkGetMemoryWin32HandleNV" ) ); -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_NV_fragment_shading_rate_enums === - vkCmdSetFragmentShadingRateEnumNV = PFN_vkCmdSetFragmentShadingRateEnumNV( vkGetDeviceProcAddr( device, "vkCmdSetFragmentShadingRateEnumNV" ) ); - - //=== VK_NV_mesh_shader === - vkCmdDrawMeshTasksNV = PFN_vkCmdDrawMeshTasksNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksNV" ) ); - vkCmdDrawMeshTasksIndirectNV = PFN_vkCmdDrawMeshTasksIndirectNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectNV" ) ); - vkCmdDrawMeshTasksIndirectCountNV = PFN_vkCmdDrawMeshTasksIndirectCountNV( vkGetDeviceProcAddr( device, "vkCmdDrawMeshTasksIndirectCountNV" ) ); - - //=== VK_NV_ray_tracing === - vkCreateAccelerationStructureNV = PFN_vkCreateAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCreateAccelerationStructureNV" ) ); - vkDestroyAccelerationStructureNV = PFN_vkDestroyAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkDestroyAccelerationStructureNV" ) ); - vkGetAccelerationStructureMemoryRequirementsNV = - PFN_vkGetAccelerationStructureMemoryRequirementsNV( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureMemoryRequirementsNV" ) ); - vkBindAccelerationStructureMemoryNV = PFN_vkBindAccelerationStructureMemoryNV( vkGetDeviceProcAddr( device, "vkBindAccelerationStructureMemoryNV" ) ); - vkCmdBuildAccelerationStructureNV = PFN_vkCmdBuildAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCmdBuildAccelerationStructureNV" ) ); - vkCmdCopyAccelerationStructureNV = PFN_vkCmdCopyAccelerationStructureNV( vkGetDeviceProcAddr( device, "vkCmdCopyAccelerationStructureNV" ) ); - vkCmdTraceRaysNV = PFN_vkCmdTraceRaysNV( vkGetDeviceProcAddr( device, "vkCmdTraceRaysNV" ) ); - vkCreateRayTracingPipelinesNV = PFN_vkCreateRayTracingPipelinesNV( vkGetDeviceProcAddr( device, "vkCreateRayTracingPipelinesNV" ) ); - vkGetRayTracingShaderGroupHandlesNV = PFN_vkGetRayTracingShaderGroupHandlesNV( vkGetDeviceProcAddr( device, "vkGetRayTracingShaderGroupHandlesNV" ) ); - if ( !vkGetRayTracingShaderGroupHandlesKHR ) - vkGetRayTracingShaderGroupHandlesKHR = vkGetRayTracingShaderGroupHandlesNV; - vkGetAccelerationStructureHandleNV = PFN_vkGetAccelerationStructureHandleNV( vkGetDeviceProcAddr( device, "vkGetAccelerationStructureHandleNV" ) ); - vkCmdWriteAccelerationStructuresPropertiesNV = - PFN_vkCmdWriteAccelerationStructuresPropertiesNV( vkGetDeviceProcAddr( device, "vkCmdWriteAccelerationStructuresPropertiesNV" ) ); - vkCompileDeferredNV = PFN_vkCompileDeferredNV( vkGetDeviceProcAddr( device, "vkCompileDeferredNV" ) ); - - //=== VK_NV_scissor_exclusive === - vkCmdSetExclusiveScissorNV = PFN_vkCmdSetExclusiveScissorNV( vkGetDeviceProcAddr( device, "vkCmdSetExclusiveScissorNV" ) ); - - //=== VK_NV_shading_rate_image === - vkCmdBindShadingRateImageNV = PFN_vkCmdBindShadingRateImageNV( vkGetDeviceProcAddr( device, "vkCmdBindShadingRateImageNV" ) ); - vkCmdSetViewportShadingRatePaletteNV = - PFN_vkCmdSetViewportShadingRatePaletteNV( vkGetDeviceProcAddr( device, "vkCmdSetViewportShadingRatePaletteNV" ) ); - vkCmdSetCoarseSampleOrderNV = PFN_vkCmdSetCoarseSampleOrderNV( vkGetDeviceProcAddr( device, "vkCmdSetCoarseSampleOrderNV" ) ); - - //=== VK_QCOM_tile_properties === - vkGetFramebufferTilePropertiesQCOM = PFN_vkGetFramebufferTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetFramebufferTilePropertiesQCOM" ) ); - vkGetDynamicRenderingTilePropertiesQCOM = - PFN_vkGetDynamicRenderingTilePropertiesQCOM( vkGetDeviceProcAddr( device, "vkGetDynamicRenderingTilePropertiesQCOM" ) ); - - //=== VK_VALVE_descriptor_set_host_mapping === - vkGetDescriptorSetLayoutHostMappingInfoVALVE = - PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE( vkGetDeviceProcAddr( device, "vkGetDescriptorSetLayoutHostMappingInfoVALVE" ) ); - vkGetDescriptorSetHostMappingVALVE = PFN_vkGetDescriptorSetHostMappingVALVE( vkGetDeviceProcAddr( device, "vkGetDescriptorSetHostMappingVALVE" ) ); - } - - public: - //=== VK_VERSION_1_0 === - PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr = 0; - PFN_vkDestroyDevice vkDestroyDevice = 0; - PFN_vkGetDeviceQueue vkGetDeviceQueue = 0; - PFN_vkQueueSubmit vkQueueSubmit = 0; - PFN_vkQueueWaitIdle vkQueueWaitIdle = 0; - PFN_vkDeviceWaitIdle vkDeviceWaitIdle = 0; - PFN_vkAllocateMemory vkAllocateMemory = 0; - PFN_vkFreeMemory vkFreeMemory = 0; - PFN_vkMapMemory vkMapMemory = 0; - PFN_vkUnmapMemory vkUnmapMemory = 0; - PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges = 0; - PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges = 0; - PFN_vkGetDeviceMemoryCommitment vkGetDeviceMemoryCommitment = 0; - PFN_vkBindBufferMemory vkBindBufferMemory = 0; - PFN_vkBindImageMemory vkBindImageMemory = 0; - PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements = 0; - PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements = 0; - PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements = 0; - PFN_vkQueueBindSparse vkQueueBindSparse = 0; - PFN_vkCreateFence vkCreateFence = 0; - PFN_vkDestroyFence vkDestroyFence = 0; - PFN_vkResetFences vkResetFences = 0; - PFN_vkGetFenceStatus vkGetFenceStatus = 0; - PFN_vkWaitForFences vkWaitForFences = 0; - PFN_vkCreateSemaphore vkCreateSemaphore = 0; - PFN_vkDestroySemaphore vkDestroySemaphore = 0; - PFN_vkCreateEvent vkCreateEvent = 0; - PFN_vkDestroyEvent vkDestroyEvent = 0; - PFN_vkGetEventStatus vkGetEventStatus = 0; - PFN_vkSetEvent vkSetEvent = 0; - PFN_vkResetEvent vkResetEvent = 0; - PFN_vkCreateQueryPool vkCreateQueryPool = 0; - PFN_vkDestroyQueryPool vkDestroyQueryPool = 0; - PFN_vkGetQueryPoolResults vkGetQueryPoolResults = 0; - PFN_vkCreateBuffer vkCreateBuffer = 0; - PFN_vkDestroyBuffer vkDestroyBuffer = 0; - PFN_vkCreateBufferView vkCreateBufferView = 0; - PFN_vkDestroyBufferView vkDestroyBufferView = 0; - PFN_vkCreateImage vkCreateImage = 0; - PFN_vkDestroyImage vkDestroyImage = 0; - PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout = 0; - PFN_vkCreateImageView vkCreateImageView = 0; - PFN_vkDestroyImageView vkDestroyImageView = 0; - PFN_vkCreateShaderModule vkCreateShaderModule = 0; - PFN_vkDestroyShaderModule vkDestroyShaderModule = 0; - PFN_vkCreatePipelineCache vkCreatePipelineCache = 0; - PFN_vkDestroyPipelineCache vkDestroyPipelineCache = 0; - PFN_vkGetPipelineCacheData vkGetPipelineCacheData = 0; - PFN_vkMergePipelineCaches vkMergePipelineCaches = 0; - PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines = 0; - PFN_vkCreateComputePipelines vkCreateComputePipelines = 0; - PFN_vkDestroyPipeline vkDestroyPipeline = 0; - PFN_vkCreatePipelineLayout vkCreatePipelineLayout = 0; - PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout = 0; - PFN_vkCreateSampler vkCreateSampler = 0; - PFN_vkDestroySampler vkDestroySampler = 0; - PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout = 0; - PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout = 0; - PFN_vkCreateDescriptorPool vkCreateDescriptorPool = 0; - PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool = 0; - PFN_vkResetDescriptorPool vkResetDescriptorPool = 0; - PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets = 0; - PFN_vkFreeDescriptorSets vkFreeDescriptorSets = 0; - PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets = 0; - PFN_vkCreateFramebuffer vkCreateFramebuffer = 0; - PFN_vkDestroyFramebuffer vkDestroyFramebuffer = 0; - PFN_vkCreateRenderPass vkCreateRenderPass = 0; - PFN_vkDestroyRenderPass vkDestroyRenderPass = 0; - PFN_vkGetRenderAreaGranularity vkGetRenderAreaGranularity = 0; - PFN_vkCreateCommandPool vkCreateCommandPool = 0; - PFN_vkDestroyCommandPool vkDestroyCommandPool = 0; - PFN_vkResetCommandPool vkResetCommandPool = 0; - PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers = 0; - PFN_vkFreeCommandBuffers vkFreeCommandBuffers = 0; - PFN_vkBeginCommandBuffer vkBeginCommandBuffer = 0; - PFN_vkEndCommandBuffer vkEndCommandBuffer = 0; - PFN_vkResetCommandBuffer vkResetCommandBuffer = 0; - PFN_vkCmdBindPipeline vkCmdBindPipeline = 0; - PFN_vkCmdSetViewport vkCmdSetViewport = 0; - PFN_vkCmdSetScissor vkCmdSetScissor = 0; - PFN_vkCmdSetLineWidth vkCmdSetLineWidth = 0; - PFN_vkCmdSetDepthBias vkCmdSetDepthBias = 0; - PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants = 0; - PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds = 0; - PFN_vkCmdSetStencilCompareMask vkCmdSetStencilCompareMask = 0; - PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask = 0; - PFN_vkCmdSetStencilReference vkCmdSetStencilReference = 0; - PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets = 0; - PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer = 0; - PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers = 0; - PFN_vkCmdDraw vkCmdDraw = 0; - PFN_vkCmdDrawIndexed vkCmdDrawIndexed = 0; - PFN_vkCmdDrawIndirect vkCmdDrawIndirect = 0; - PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect = 0; - PFN_vkCmdDispatch vkCmdDispatch = 0; - PFN_vkCmdDispatchIndirect vkCmdDispatchIndirect = 0; - PFN_vkCmdCopyBuffer vkCmdCopyBuffer = 0; - PFN_vkCmdCopyImage vkCmdCopyImage = 0; - PFN_vkCmdBlitImage vkCmdBlitImage = 0; - PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage = 0; - PFN_vkCmdCopyImageToBuffer vkCmdCopyImageToBuffer = 0; - PFN_vkCmdUpdateBuffer vkCmdUpdateBuffer = 0; - PFN_vkCmdFillBuffer vkCmdFillBuffer = 0; - PFN_vkCmdClearColorImage vkCmdClearColorImage = 0; - PFN_vkCmdClearDepthStencilImage vkCmdClearDepthStencilImage = 0; - PFN_vkCmdClearAttachments vkCmdClearAttachments = 0; - PFN_vkCmdResolveImage vkCmdResolveImage = 0; - PFN_vkCmdSetEvent vkCmdSetEvent = 0; - PFN_vkCmdResetEvent vkCmdResetEvent = 0; - PFN_vkCmdWaitEvents vkCmdWaitEvents = 0; - PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier = 0; - PFN_vkCmdBeginQuery vkCmdBeginQuery = 0; - PFN_vkCmdEndQuery vkCmdEndQuery = 0; - PFN_vkCmdResetQueryPool vkCmdResetQueryPool = 0; - PFN_vkCmdWriteTimestamp vkCmdWriteTimestamp = 0; - PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults = 0; - PFN_vkCmdPushConstants vkCmdPushConstants = 0; - PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass = 0; - PFN_vkCmdNextSubpass vkCmdNextSubpass = 0; - PFN_vkCmdEndRenderPass vkCmdEndRenderPass = 0; - PFN_vkCmdExecuteCommands vkCmdExecuteCommands = 0; - - //=== VK_VERSION_1_1 === - PFN_vkBindBufferMemory2 vkBindBufferMemory2 = 0; - PFN_vkBindImageMemory2 vkBindImageMemory2 = 0; - PFN_vkGetDeviceGroupPeerMemoryFeatures vkGetDeviceGroupPeerMemoryFeatures = 0; - PFN_vkCmdSetDeviceMask vkCmdSetDeviceMask = 0; - PFN_vkCmdDispatchBase vkCmdDispatchBase = 0; - PFN_vkGetImageMemoryRequirements2 vkGetImageMemoryRequirements2 = 0; - PFN_vkGetBufferMemoryRequirements2 vkGetBufferMemoryRequirements2 = 0; - PFN_vkGetImageSparseMemoryRequirements2 vkGetImageSparseMemoryRequirements2 = 0; - PFN_vkTrimCommandPool vkTrimCommandPool = 0; - PFN_vkGetDeviceQueue2 vkGetDeviceQueue2 = 0; - PFN_vkCreateSamplerYcbcrConversion vkCreateSamplerYcbcrConversion = 0; - PFN_vkDestroySamplerYcbcrConversion vkDestroySamplerYcbcrConversion = 0; - PFN_vkCreateDescriptorUpdateTemplate vkCreateDescriptorUpdateTemplate = 0; - PFN_vkDestroyDescriptorUpdateTemplate vkDestroyDescriptorUpdateTemplate = 0; - PFN_vkUpdateDescriptorSetWithTemplate vkUpdateDescriptorSetWithTemplate = 0; - PFN_vkGetDescriptorSetLayoutSupport vkGetDescriptorSetLayoutSupport = 0; - - //=== VK_VERSION_1_2 === - PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount = 0; - PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount = 0; - PFN_vkCreateRenderPass2 vkCreateRenderPass2 = 0; - PFN_vkCmdBeginRenderPass2 vkCmdBeginRenderPass2 = 0; - PFN_vkCmdNextSubpass2 vkCmdNextSubpass2 = 0; - PFN_vkCmdEndRenderPass2 vkCmdEndRenderPass2 = 0; - PFN_vkResetQueryPool vkResetQueryPool = 0; - PFN_vkGetSemaphoreCounterValue vkGetSemaphoreCounterValue = 0; - PFN_vkWaitSemaphores vkWaitSemaphores = 0; - PFN_vkSignalSemaphore vkSignalSemaphore = 0; - PFN_vkGetBufferDeviceAddress vkGetBufferDeviceAddress = 0; - PFN_vkGetBufferOpaqueCaptureAddress vkGetBufferOpaqueCaptureAddress = 0; - PFN_vkGetDeviceMemoryOpaqueCaptureAddress vkGetDeviceMemoryOpaqueCaptureAddress = 0; - - //=== VK_VERSION_1_3 === - PFN_vkCreatePrivateDataSlot vkCreatePrivateDataSlot = 0; - PFN_vkDestroyPrivateDataSlot vkDestroyPrivateDataSlot = 0; - PFN_vkSetPrivateData vkSetPrivateData = 0; - PFN_vkGetPrivateData vkGetPrivateData = 0; - PFN_vkCmdSetEvent2 vkCmdSetEvent2 = 0; - PFN_vkCmdResetEvent2 vkCmdResetEvent2 = 0; - PFN_vkCmdWaitEvents2 vkCmdWaitEvents2 = 0; - PFN_vkCmdPipelineBarrier2 vkCmdPipelineBarrier2 = 0; - PFN_vkCmdWriteTimestamp2 vkCmdWriteTimestamp2 = 0; - PFN_vkQueueSubmit2 vkQueueSubmit2 = 0; - PFN_vkCmdCopyBuffer2 vkCmdCopyBuffer2 = 0; - PFN_vkCmdCopyImage2 vkCmdCopyImage2 = 0; - PFN_vkCmdCopyBufferToImage2 vkCmdCopyBufferToImage2 = 0; - PFN_vkCmdCopyImageToBuffer2 vkCmdCopyImageToBuffer2 = 0; - PFN_vkCmdBlitImage2 vkCmdBlitImage2 = 0; - PFN_vkCmdResolveImage2 vkCmdResolveImage2 = 0; - PFN_vkCmdBeginRendering vkCmdBeginRendering = 0; - PFN_vkCmdEndRendering vkCmdEndRendering = 0; - PFN_vkCmdSetCullMode vkCmdSetCullMode = 0; - PFN_vkCmdSetFrontFace vkCmdSetFrontFace = 0; - PFN_vkCmdSetPrimitiveTopology vkCmdSetPrimitiveTopology = 0; - PFN_vkCmdSetViewportWithCount vkCmdSetViewportWithCount = 0; - PFN_vkCmdSetScissorWithCount vkCmdSetScissorWithCount = 0; - PFN_vkCmdBindVertexBuffers2 vkCmdBindVertexBuffers2 = 0; - PFN_vkCmdSetDepthTestEnable vkCmdSetDepthTestEnable = 0; - PFN_vkCmdSetDepthWriteEnable vkCmdSetDepthWriteEnable = 0; - PFN_vkCmdSetDepthCompareOp vkCmdSetDepthCompareOp = 0; - PFN_vkCmdSetDepthBoundsTestEnable vkCmdSetDepthBoundsTestEnable = 0; - PFN_vkCmdSetStencilTestEnable vkCmdSetStencilTestEnable = 0; - PFN_vkCmdSetStencilOp vkCmdSetStencilOp = 0; - PFN_vkCmdSetRasterizerDiscardEnable vkCmdSetRasterizerDiscardEnable = 0; - PFN_vkCmdSetDepthBiasEnable vkCmdSetDepthBiasEnable = 0; - PFN_vkCmdSetPrimitiveRestartEnable vkCmdSetPrimitiveRestartEnable = 0; - PFN_vkGetDeviceBufferMemoryRequirements vkGetDeviceBufferMemoryRequirements = 0; - PFN_vkGetDeviceImageMemoryRequirements vkGetDeviceImageMemoryRequirements = 0; - PFN_vkGetDeviceImageSparseMemoryRequirements vkGetDeviceImageSparseMemoryRequirements = 0; - - //=== VK_AMD_buffer_marker === - PFN_vkCmdWriteBufferMarkerAMD vkCmdWriteBufferMarkerAMD = 0; - - //=== VK_AMD_display_native_hdr === - PFN_vkSetLocalDimmingAMD vkSetLocalDimmingAMD = 0; - - //=== VK_AMD_draw_indirect_count === - PFN_vkCmdDrawIndirectCountAMD vkCmdDrawIndirectCountAMD = 0; - PFN_vkCmdDrawIndexedIndirectCountAMD vkCmdDrawIndexedIndirectCountAMD = 0; - - //=== VK_AMD_shader_info === - PFN_vkGetShaderInfoAMD vkGetShaderInfoAMD = 0; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - PFN_vkGetAndroidHardwareBufferPropertiesANDROID vkGetAndroidHardwareBufferPropertiesANDROID = 0; - PFN_vkGetMemoryAndroidHardwareBufferANDROID vkGetMemoryAndroidHardwareBufferANDROID = 0; -# else - PFN_dummy vkGetAndroidHardwareBufferPropertiesANDROID_placeholder = 0; - PFN_dummy vkGetMemoryAndroidHardwareBufferANDROID_placeholder = 0; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_buffer_device_address === - PFN_vkGetBufferDeviceAddressEXT vkGetBufferDeviceAddressEXT = 0; - - //=== VK_EXT_calibrated_timestamps === - PFN_vkGetCalibratedTimestampsEXT vkGetCalibratedTimestampsEXT = 0; - - //=== VK_EXT_color_write_enable === - PFN_vkCmdSetColorWriteEnableEXT vkCmdSetColorWriteEnableEXT = 0; - - //=== VK_EXT_conditional_rendering === - PFN_vkCmdBeginConditionalRenderingEXT vkCmdBeginConditionalRenderingEXT = 0; - PFN_vkCmdEndConditionalRenderingEXT vkCmdEndConditionalRenderingEXT = 0; - - //=== VK_EXT_debug_marker === - PFN_vkDebugMarkerSetObjectTagEXT vkDebugMarkerSetObjectTagEXT = 0; - PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectNameEXT = 0; - PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBeginEXT = 0; - PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEndEXT = 0; - PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsertEXT = 0; - - //=== VK_EXT_debug_utils === - PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT = 0; - PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT = 0; - PFN_vkQueueBeginDebugUtilsLabelEXT vkQueueBeginDebugUtilsLabelEXT = 0; - PFN_vkQueueEndDebugUtilsLabelEXT vkQueueEndDebugUtilsLabelEXT = 0; - PFN_vkQueueInsertDebugUtilsLabelEXT vkQueueInsertDebugUtilsLabelEXT = 0; - PFN_vkCmdBeginDebugUtilsLabelEXT vkCmdBeginDebugUtilsLabelEXT = 0; - PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT = 0; - PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT = 0; - - //=== VK_EXT_discard_rectangles === - PFN_vkCmdSetDiscardRectangleEXT vkCmdSetDiscardRectangleEXT = 0; - - //=== VK_EXT_display_control === - PFN_vkDisplayPowerControlEXT vkDisplayPowerControlEXT = 0; - PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT = 0; - PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT = 0; - PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT = 0; - - //=== VK_EXT_extended_dynamic_state === - PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT = 0; - PFN_vkCmdSetFrontFaceEXT vkCmdSetFrontFaceEXT = 0; - PFN_vkCmdSetPrimitiveTopologyEXT vkCmdSetPrimitiveTopologyEXT = 0; - PFN_vkCmdSetViewportWithCountEXT vkCmdSetViewportWithCountEXT = 0; - PFN_vkCmdSetScissorWithCountEXT vkCmdSetScissorWithCountEXT = 0; - PFN_vkCmdBindVertexBuffers2EXT vkCmdBindVertexBuffers2EXT = 0; - PFN_vkCmdSetDepthTestEnableEXT vkCmdSetDepthTestEnableEXT = 0; - PFN_vkCmdSetDepthWriteEnableEXT vkCmdSetDepthWriteEnableEXT = 0; - PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT = 0; - PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT = 0; - PFN_vkCmdSetStencilTestEnableEXT vkCmdSetStencilTestEnableEXT = 0; - PFN_vkCmdSetStencilOpEXT vkCmdSetStencilOpEXT = 0; - - //=== VK_EXT_extended_dynamic_state2 === - PFN_vkCmdSetPatchControlPointsEXT vkCmdSetPatchControlPointsEXT = 0; - PFN_vkCmdSetRasterizerDiscardEnableEXT vkCmdSetRasterizerDiscardEnableEXT = 0; - PFN_vkCmdSetDepthBiasEnableEXT vkCmdSetDepthBiasEnableEXT = 0; - PFN_vkCmdSetLogicOpEXT vkCmdSetLogicOpEXT = 0; - PFN_vkCmdSetPrimitiveRestartEnableEXT vkCmdSetPrimitiveRestartEnableEXT = 0; - - //=== VK_EXT_external_memory_host === - PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesEXT = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - PFN_vkAcquireFullScreenExclusiveModeEXT vkAcquireFullScreenExclusiveModeEXT = 0; - PFN_vkReleaseFullScreenExclusiveModeEXT vkReleaseFullScreenExclusiveModeEXT = 0; - PFN_vkGetDeviceGroupSurfacePresentModes2EXT vkGetDeviceGroupSurfacePresentModes2EXT = 0; -# else - PFN_dummy vkAcquireFullScreenExclusiveModeEXT_placeholder = 0; - PFN_dummy vkReleaseFullScreenExclusiveModeEXT_placeholder = 0; - PFN_dummy vkGetDeviceGroupSurfacePresentModes2EXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_hdr_metadata === - PFN_vkSetHdrMetadataEXT vkSetHdrMetadataEXT = 0; - - //=== VK_EXT_host_query_reset === - PFN_vkResetQueryPoolEXT vkResetQueryPoolEXT = 0; - - //=== VK_EXT_image_compression_control === - PFN_vkGetImageSubresourceLayout2EXT vkGetImageSubresourceLayout2EXT = 0; - - //=== VK_EXT_image_drm_format_modifier === - PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT = 0; - - //=== VK_EXT_line_rasterization === - PFN_vkCmdSetLineStippleEXT vkCmdSetLineStippleEXT = 0; - - //=== VK_EXT_mesh_shader === - PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXT = 0; - PFN_vkCmdDrawMeshTasksIndirectEXT vkCmdDrawMeshTasksIndirectEXT = 0; - PFN_vkCmdDrawMeshTasksIndirectCountEXT vkCmdDrawMeshTasksIndirectCountEXT = 0; - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - PFN_vkExportMetalObjectsEXT vkExportMetalObjectsEXT = 0; -# else - PFN_dummy vkExportMetalObjectsEXT_placeholder = 0; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_multi_draw === - PFN_vkCmdDrawMultiEXT vkCmdDrawMultiEXT = 0; - PFN_vkCmdDrawMultiIndexedEXT vkCmdDrawMultiIndexedEXT = 0; - - //=== VK_EXT_pageable_device_local_memory === - PFN_vkSetDeviceMemoryPriorityEXT vkSetDeviceMemoryPriorityEXT = 0; - - //=== VK_EXT_pipeline_properties === - PFN_vkGetPipelinePropertiesEXT vkGetPipelinePropertiesEXT = 0; - - //=== VK_EXT_private_data === - PFN_vkCreatePrivateDataSlotEXT vkCreatePrivateDataSlotEXT = 0; - PFN_vkDestroyPrivateDataSlotEXT vkDestroyPrivateDataSlotEXT = 0; - PFN_vkSetPrivateDataEXT vkSetPrivateDataEXT = 0; - PFN_vkGetPrivateDataEXT vkGetPrivateDataEXT = 0; - - //=== VK_EXT_sample_locations === - PFN_vkCmdSetSampleLocationsEXT vkCmdSetSampleLocationsEXT = 0; - - //=== VK_EXT_shader_module_identifier === - PFN_vkGetShaderModuleIdentifierEXT vkGetShaderModuleIdentifierEXT = 0; - PFN_vkGetShaderModuleCreateInfoIdentifierEXT vkGetShaderModuleCreateInfoIdentifierEXT = 0; - - //=== VK_EXT_transform_feedback === - PFN_vkCmdBindTransformFeedbackBuffersEXT vkCmdBindTransformFeedbackBuffersEXT = 0; - PFN_vkCmdBeginTransformFeedbackEXT vkCmdBeginTransformFeedbackEXT = 0; - PFN_vkCmdEndTransformFeedbackEXT vkCmdEndTransformFeedbackEXT = 0; - PFN_vkCmdBeginQueryIndexedEXT vkCmdBeginQueryIndexedEXT = 0; - PFN_vkCmdEndQueryIndexedEXT vkCmdEndQueryIndexedEXT = 0; - PFN_vkCmdDrawIndirectByteCountEXT vkCmdDrawIndirectByteCountEXT = 0; - - //=== VK_EXT_validation_cache === - PFN_vkCreateValidationCacheEXT vkCreateValidationCacheEXT = 0; - PFN_vkDestroyValidationCacheEXT vkDestroyValidationCacheEXT = 0; - PFN_vkMergeValidationCachesEXT vkMergeValidationCachesEXT = 0; - PFN_vkGetValidationCacheDataEXT vkGetValidationCacheDataEXT = 0; - - //=== VK_EXT_vertex_input_dynamic_state === - PFN_vkCmdSetVertexInputEXT vkCmdSetVertexInputEXT = 0; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - PFN_vkCreateBufferCollectionFUCHSIA vkCreateBufferCollectionFUCHSIA = 0; - PFN_vkSetBufferCollectionImageConstraintsFUCHSIA vkSetBufferCollectionImageConstraintsFUCHSIA = 0; - PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA vkSetBufferCollectionBufferConstraintsFUCHSIA = 0; - PFN_vkDestroyBufferCollectionFUCHSIA vkDestroyBufferCollectionFUCHSIA = 0; - PFN_vkGetBufferCollectionPropertiesFUCHSIA vkGetBufferCollectionPropertiesFUCHSIA = 0; -# else - PFN_dummy vkCreateBufferCollectionFUCHSIA_placeholder = 0; - PFN_dummy vkSetBufferCollectionImageConstraintsFUCHSIA_placeholder = 0; - PFN_dummy vkSetBufferCollectionBufferConstraintsFUCHSIA_placeholder = 0; - PFN_dummy vkDestroyBufferCollectionFUCHSIA_placeholder = 0; - PFN_dummy vkGetBufferCollectionPropertiesFUCHSIA_placeholder = 0; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - PFN_vkGetMemoryZirconHandleFUCHSIA vkGetMemoryZirconHandleFUCHSIA = 0; - PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA vkGetMemoryZirconHandlePropertiesFUCHSIA = 0; -# else - PFN_dummy vkGetMemoryZirconHandleFUCHSIA_placeholder = 0; - PFN_dummy vkGetMemoryZirconHandlePropertiesFUCHSIA_placeholder = 0; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - PFN_vkImportSemaphoreZirconHandleFUCHSIA vkImportSemaphoreZirconHandleFUCHSIA = 0; - PFN_vkGetSemaphoreZirconHandleFUCHSIA vkGetSemaphoreZirconHandleFUCHSIA = 0; -# else - PFN_dummy vkImportSemaphoreZirconHandleFUCHSIA_placeholder = 0; - PFN_dummy vkGetSemaphoreZirconHandleFUCHSIA_placeholder = 0; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_GOOGLE_display_timing === - PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE = 0; - PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE = 0; - - //=== VK_HUAWEI_invocation_mask === - PFN_vkCmdBindInvocationMaskHUAWEI vkCmdBindInvocationMaskHUAWEI = 0; - - //=== VK_HUAWEI_subpass_shading === - PFN_vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI = 0; - PFN_vkCmdSubpassShadingHUAWEI vkCmdSubpassShadingHUAWEI = 0; - - //=== VK_INTEL_performance_query === - PFN_vkInitializePerformanceApiINTEL vkInitializePerformanceApiINTEL = 0; - PFN_vkUninitializePerformanceApiINTEL vkUninitializePerformanceApiINTEL = 0; - PFN_vkCmdSetPerformanceMarkerINTEL vkCmdSetPerformanceMarkerINTEL = 0; - PFN_vkCmdSetPerformanceStreamMarkerINTEL vkCmdSetPerformanceStreamMarkerINTEL = 0; - PFN_vkCmdSetPerformanceOverrideINTEL vkCmdSetPerformanceOverrideINTEL = 0; - PFN_vkAcquirePerformanceConfigurationINTEL vkAcquirePerformanceConfigurationINTEL = 0; - PFN_vkReleasePerformanceConfigurationINTEL vkReleasePerformanceConfigurationINTEL = 0; - PFN_vkQueueSetPerformanceConfigurationINTEL vkQueueSetPerformanceConfigurationINTEL = 0; - PFN_vkGetPerformanceParameterINTEL vkGetPerformanceParameterINTEL = 0; - - //=== VK_KHR_acceleration_structure === - PFN_vkCreateAccelerationStructureKHR vkCreateAccelerationStructureKHR = 0; - PFN_vkDestroyAccelerationStructureKHR vkDestroyAccelerationStructureKHR = 0; - PFN_vkCmdBuildAccelerationStructuresKHR vkCmdBuildAccelerationStructuresKHR = 0; - PFN_vkCmdBuildAccelerationStructuresIndirectKHR vkCmdBuildAccelerationStructuresIndirectKHR = 0; - PFN_vkBuildAccelerationStructuresKHR vkBuildAccelerationStructuresKHR = 0; - PFN_vkCopyAccelerationStructureKHR vkCopyAccelerationStructureKHR = 0; - PFN_vkCopyAccelerationStructureToMemoryKHR vkCopyAccelerationStructureToMemoryKHR = 0; - PFN_vkCopyMemoryToAccelerationStructureKHR vkCopyMemoryToAccelerationStructureKHR = 0; - PFN_vkWriteAccelerationStructuresPropertiesKHR vkWriteAccelerationStructuresPropertiesKHR = 0; - PFN_vkCmdCopyAccelerationStructureKHR vkCmdCopyAccelerationStructureKHR = 0; - PFN_vkCmdCopyAccelerationStructureToMemoryKHR vkCmdCopyAccelerationStructureToMemoryKHR = 0; - PFN_vkCmdCopyMemoryToAccelerationStructureKHR vkCmdCopyMemoryToAccelerationStructureKHR = 0; - PFN_vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureDeviceAddressKHR = 0; - PFN_vkCmdWriteAccelerationStructuresPropertiesKHR vkCmdWriteAccelerationStructuresPropertiesKHR = 0; - PFN_vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceAccelerationStructureCompatibilityKHR = 0; - PFN_vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureBuildSizesKHR = 0; - - //=== VK_KHR_bind_memory2 === - PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR = 0; - PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR = 0; - - //=== VK_KHR_buffer_device_address === - PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR = 0; - PFN_vkGetBufferOpaqueCaptureAddressKHR vkGetBufferOpaqueCaptureAddressKHR = 0; - PFN_vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR = 0; - - //=== VK_KHR_copy_commands2 === - PFN_vkCmdCopyBuffer2KHR vkCmdCopyBuffer2KHR = 0; - PFN_vkCmdCopyImage2KHR vkCmdCopyImage2KHR = 0; - PFN_vkCmdCopyBufferToImage2KHR vkCmdCopyBufferToImage2KHR = 0; - PFN_vkCmdCopyImageToBuffer2KHR vkCmdCopyImageToBuffer2KHR = 0; - PFN_vkCmdBlitImage2KHR vkCmdBlitImage2KHR = 0; - PFN_vkCmdResolveImage2KHR vkCmdResolveImage2KHR = 0; - - //=== VK_KHR_create_renderpass2 === - PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR = 0; - PFN_vkCmdBeginRenderPass2KHR vkCmdBeginRenderPass2KHR = 0; - PFN_vkCmdNextSubpass2KHR vkCmdNextSubpass2KHR = 0; - PFN_vkCmdEndRenderPass2KHR vkCmdEndRenderPass2KHR = 0; - - //=== VK_KHR_deferred_host_operations === - PFN_vkCreateDeferredOperationKHR vkCreateDeferredOperationKHR = 0; - PFN_vkDestroyDeferredOperationKHR vkDestroyDeferredOperationKHR = 0; - PFN_vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationMaxConcurrencyKHR = 0; - PFN_vkGetDeferredOperationResultKHR vkGetDeferredOperationResultKHR = 0; - PFN_vkDeferredOperationJoinKHR vkDeferredOperationJoinKHR = 0; - - //=== VK_KHR_descriptor_update_template === - PFN_vkCreateDescriptorUpdateTemplateKHR vkCreateDescriptorUpdateTemplateKHR = 0; - PFN_vkDestroyDescriptorUpdateTemplateKHR vkDestroyDescriptorUpdateTemplateKHR = 0; - PFN_vkUpdateDescriptorSetWithTemplateKHR vkUpdateDescriptorSetWithTemplateKHR = 0; - PFN_vkCmdPushDescriptorSetWithTemplateKHR vkCmdPushDescriptorSetWithTemplateKHR = 0; - - //=== VK_KHR_device_group === - PFN_vkGetDeviceGroupPeerMemoryFeaturesKHR vkGetDeviceGroupPeerMemoryFeaturesKHR = 0; - PFN_vkCmdSetDeviceMaskKHR vkCmdSetDeviceMaskKHR = 0; - PFN_vkCmdDispatchBaseKHR vkCmdDispatchBaseKHR = 0; - PFN_vkGetDeviceGroupPresentCapabilitiesKHR vkGetDeviceGroupPresentCapabilitiesKHR = 0; - PFN_vkGetDeviceGroupSurfacePresentModesKHR vkGetDeviceGroupSurfacePresentModesKHR = 0; - PFN_vkAcquireNextImage2KHR vkAcquireNextImage2KHR = 0; - - //=== VK_KHR_display_swapchain === - PFN_vkCreateSharedSwapchainsKHR vkCreateSharedSwapchainsKHR = 0; - - //=== VK_KHR_draw_indirect_count === - PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR = 0; - PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR = 0; - - //=== VK_KHR_dynamic_rendering === - PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHR = 0; - PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHR = 0; - - //=== VK_KHR_external_fence_fd === - PFN_vkImportFenceFdKHR vkImportFenceFdKHR = 0; - PFN_vkGetFenceFdKHR vkGetFenceFdKHR = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - PFN_vkImportFenceWin32HandleKHR vkImportFenceWin32HandleKHR = 0; - PFN_vkGetFenceWin32HandleKHR vkGetFenceWin32HandleKHR = 0; -# else - PFN_dummy vkImportFenceWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetFenceWin32HandleKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR = 0; - PFN_vkGetMemoryFdPropertiesKHR vkGetMemoryFdPropertiesKHR = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR = 0; - PFN_vkGetMemoryWin32HandlePropertiesKHR vkGetMemoryWin32HandlePropertiesKHR = 0; -# else - PFN_dummy vkGetMemoryWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetMemoryWin32HandlePropertiesKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - PFN_vkImportSemaphoreFdKHR vkImportSemaphoreFdKHR = 0; - PFN_vkGetSemaphoreFdKHR vkGetSemaphoreFdKHR = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - PFN_vkImportSemaphoreWin32HandleKHR vkImportSemaphoreWin32HandleKHR = 0; - PFN_vkGetSemaphoreWin32HandleKHR vkGetSemaphoreWin32HandleKHR = 0; -# else - PFN_dummy vkImportSemaphoreWin32HandleKHR_placeholder = 0; - PFN_dummy vkGetSemaphoreWin32HandleKHR_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_fragment_shading_rate === - PFN_vkCmdSetFragmentShadingRateKHR vkCmdSetFragmentShadingRateKHR = 0; - - //=== VK_KHR_get_memory_requirements2 === - PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR = 0; - PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR = 0; - PFN_vkGetImageSparseMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR = 0; - - //=== VK_KHR_maintenance1 === - PFN_vkTrimCommandPoolKHR vkTrimCommandPoolKHR = 0; - - //=== VK_KHR_maintenance3 === - PFN_vkGetDescriptorSetLayoutSupportKHR vkGetDescriptorSetLayoutSupportKHR = 0; - - //=== VK_KHR_maintenance4 === - PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirementsKHR = 0; - PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirementsKHR = 0; - PFN_vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceImageSparseMemoryRequirementsKHR = 0; - - //=== VK_KHR_performance_query === - PFN_vkAcquireProfilingLockKHR vkAcquireProfilingLockKHR = 0; - PFN_vkReleaseProfilingLockKHR vkReleaseProfilingLockKHR = 0; - - //=== VK_KHR_pipeline_executable_properties === - PFN_vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutablePropertiesKHR = 0; - PFN_vkGetPipelineExecutableStatisticsKHR vkGetPipelineExecutableStatisticsKHR = 0; - PFN_vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutableInternalRepresentationsKHR = 0; - - //=== VK_KHR_present_wait === - PFN_vkWaitForPresentKHR vkWaitForPresentKHR = 0; - - //=== VK_KHR_push_descriptor === - PFN_vkCmdPushDescriptorSetKHR vkCmdPushDescriptorSetKHR = 0; - - //=== VK_KHR_ray_tracing_maintenance1 === - PFN_vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirect2KHR = 0; - - //=== VK_KHR_ray_tracing_pipeline === - PFN_vkCmdTraceRaysKHR vkCmdTraceRaysKHR = 0; - PFN_vkCreateRayTracingPipelinesKHR vkCreateRayTracingPipelinesKHR = 0; - PFN_vkGetRayTracingShaderGroupHandlesKHR vkGetRayTracingShaderGroupHandlesKHR = 0; - PFN_vkGetRayTracingCaptureReplayShaderGroupHandlesKHR vkGetRayTracingCaptureReplayShaderGroupHandlesKHR = 0; - PFN_vkCmdTraceRaysIndirectKHR vkCmdTraceRaysIndirectKHR = 0; - PFN_vkGetRayTracingShaderGroupStackSizeKHR vkGetRayTracingShaderGroupStackSizeKHR = 0; - PFN_vkCmdSetRayTracingPipelineStackSizeKHR vkCmdSetRayTracingPipelineStackSizeKHR = 0; - - //=== VK_KHR_sampler_ycbcr_conversion === - PFN_vkCreateSamplerYcbcrConversionKHR vkCreateSamplerYcbcrConversionKHR = 0; - PFN_vkDestroySamplerYcbcrConversionKHR vkDestroySamplerYcbcrConversionKHR = 0; - - //=== VK_KHR_shared_presentable_image === - PFN_vkGetSwapchainStatusKHR vkGetSwapchainStatusKHR = 0; - - //=== VK_KHR_swapchain === - PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = 0; - PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR = 0; - PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR = 0; - PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR = 0; - PFN_vkQueuePresentKHR vkQueuePresentKHR = 0; - - //=== VK_KHR_synchronization2 === - PFN_vkCmdSetEvent2KHR vkCmdSetEvent2KHR = 0; - PFN_vkCmdResetEvent2KHR vkCmdResetEvent2KHR = 0; - PFN_vkCmdWaitEvents2KHR vkCmdWaitEvents2KHR = 0; - PFN_vkCmdPipelineBarrier2KHR vkCmdPipelineBarrier2KHR = 0; - PFN_vkCmdWriteTimestamp2KHR vkCmdWriteTimestamp2KHR = 0; - PFN_vkQueueSubmit2KHR vkQueueSubmit2KHR = 0; - PFN_vkCmdWriteBufferMarker2AMD vkCmdWriteBufferMarker2AMD = 0; - PFN_vkGetQueueCheckpointData2NV vkGetQueueCheckpointData2NV = 0; - - //=== VK_KHR_timeline_semaphore === - PFN_vkGetSemaphoreCounterValueKHR vkGetSemaphoreCounterValueKHR = 0; - PFN_vkWaitSemaphoresKHR vkWaitSemaphoresKHR = 0; - PFN_vkSignalSemaphoreKHR vkSignalSemaphoreKHR = 0; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - PFN_vkCmdDecodeVideoKHR vkCmdDecodeVideoKHR = 0; -# else - PFN_dummy vkCmdDecodeVideoKHR_placeholder = 0; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - PFN_vkCmdEncodeVideoKHR vkCmdEncodeVideoKHR = 0; -# else - PFN_dummy vkCmdEncodeVideoKHR_placeholder = 0; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - PFN_vkCreateVideoSessionKHR vkCreateVideoSessionKHR = 0; - PFN_vkDestroyVideoSessionKHR vkDestroyVideoSessionKHR = 0; - PFN_vkGetVideoSessionMemoryRequirementsKHR vkGetVideoSessionMemoryRequirementsKHR = 0; - PFN_vkBindVideoSessionMemoryKHR vkBindVideoSessionMemoryKHR = 0; - PFN_vkCreateVideoSessionParametersKHR vkCreateVideoSessionParametersKHR = 0; - PFN_vkUpdateVideoSessionParametersKHR vkUpdateVideoSessionParametersKHR = 0; - PFN_vkDestroyVideoSessionParametersKHR vkDestroyVideoSessionParametersKHR = 0; - PFN_vkCmdBeginVideoCodingKHR vkCmdBeginVideoCodingKHR = 0; - PFN_vkCmdEndVideoCodingKHR vkCmdEndVideoCodingKHR = 0; - PFN_vkCmdControlVideoCodingKHR vkCmdControlVideoCodingKHR = 0; -# else - PFN_dummy vkCreateVideoSessionKHR_placeholder = 0; - PFN_dummy vkDestroyVideoSessionKHR_placeholder = 0; - PFN_dummy vkGetVideoSessionMemoryRequirementsKHR_placeholder = 0; - PFN_dummy vkBindVideoSessionMemoryKHR_placeholder = 0; - PFN_dummy vkCreateVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkUpdateVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkDestroyVideoSessionParametersKHR_placeholder = 0; - PFN_dummy vkCmdBeginVideoCodingKHR_placeholder = 0; - PFN_dummy vkCmdEndVideoCodingKHR_placeholder = 0; - PFN_dummy vkCmdControlVideoCodingKHR_placeholder = 0; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - PFN_vkCreateCuModuleNVX vkCreateCuModuleNVX = 0; - PFN_vkCreateCuFunctionNVX vkCreateCuFunctionNVX = 0; - PFN_vkDestroyCuModuleNVX vkDestroyCuModuleNVX = 0; - PFN_vkDestroyCuFunctionNVX vkDestroyCuFunctionNVX = 0; - PFN_vkCmdCuLaunchKernelNVX vkCmdCuLaunchKernelNVX = 0; - - //=== VK_NVX_image_view_handle === - PFN_vkGetImageViewHandleNVX vkGetImageViewHandleNVX = 0; - PFN_vkGetImageViewAddressNVX vkGetImageViewAddressNVX = 0; - - //=== VK_NV_clip_space_w_scaling === - PFN_vkCmdSetViewportWScalingNV vkCmdSetViewportWScalingNV = 0; - - //=== VK_NV_device_diagnostic_checkpoints === - PFN_vkCmdSetCheckpointNV vkCmdSetCheckpointNV = 0; - PFN_vkGetQueueCheckpointDataNV vkGetQueueCheckpointDataNV = 0; - - //=== VK_NV_device_generated_commands === - PFN_vkGetGeneratedCommandsMemoryRequirementsNV vkGetGeneratedCommandsMemoryRequirementsNV = 0; - PFN_vkCmdPreprocessGeneratedCommandsNV vkCmdPreprocessGeneratedCommandsNV = 0; - PFN_vkCmdExecuteGeneratedCommandsNV vkCmdExecuteGeneratedCommandsNV = 0; - PFN_vkCmdBindPipelineShaderGroupNV vkCmdBindPipelineShaderGroupNV = 0; - PFN_vkCreateIndirectCommandsLayoutNV vkCreateIndirectCommandsLayoutNV = 0; - PFN_vkDestroyIndirectCommandsLayoutNV vkDestroyIndirectCommandsLayoutNV = 0; - - //=== VK_NV_external_memory_rdma === - PFN_vkGetMemoryRemoteAddressNV vkGetMemoryRemoteAddressNV = 0; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - PFN_vkGetMemoryWin32HandleNV vkGetMemoryWin32HandleNV = 0; -# else - PFN_dummy vkGetMemoryWin32HandleNV_placeholder = 0; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_NV_fragment_shading_rate_enums === - PFN_vkCmdSetFragmentShadingRateEnumNV vkCmdSetFragmentShadingRateEnumNV = 0; - - //=== VK_NV_mesh_shader === - PFN_vkCmdDrawMeshTasksNV vkCmdDrawMeshTasksNV = 0; - PFN_vkCmdDrawMeshTasksIndirectNV vkCmdDrawMeshTasksIndirectNV = 0; - PFN_vkCmdDrawMeshTasksIndirectCountNV vkCmdDrawMeshTasksIndirectCountNV = 0; - - //=== VK_NV_ray_tracing === - PFN_vkCreateAccelerationStructureNV vkCreateAccelerationStructureNV = 0; - PFN_vkDestroyAccelerationStructureNV vkDestroyAccelerationStructureNV = 0; - PFN_vkGetAccelerationStructureMemoryRequirementsNV vkGetAccelerationStructureMemoryRequirementsNV = 0; - PFN_vkBindAccelerationStructureMemoryNV vkBindAccelerationStructureMemoryNV = 0; - PFN_vkCmdBuildAccelerationStructureNV vkCmdBuildAccelerationStructureNV = 0; - PFN_vkCmdCopyAccelerationStructureNV vkCmdCopyAccelerationStructureNV = 0; - PFN_vkCmdTraceRaysNV vkCmdTraceRaysNV = 0; - PFN_vkCreateRayTracingPipelinesNV vkCreateRayTracingPipelinesNV = 0; - PFN_vkGetRayTracingShaderGroupHandlesNV vkGetRayTracingShaderGroupHandlesNV = 0; - PFN_vkGetAccelerationStructureHandleNV vkGetAccelerationStructureHandleNV = 0; - PFN_vkCmdWriteAccelerationStructuresPropertiesNV vkCmdWriteAccelerationStructuresPropertiesNV = 0; - PFN_vkCompileDeferredNV vkCompileDeferredNV = 0; - - //=== VK_NV_scissor_exclusive === - PFN_vkCmdSetExclusiveScissorNV vkCmdSetExclusiveScissorNV = 0; - - //=== VK_NV_shading_rate_image === - PFN_vkCmdBindShadingRateImageNV vkCmdBindShadingRateImageNV = 0; - PFN_vkCmdSetViewportShadingRatePaletteNV vkCmdSetViewportShadingRatePaletteNV = 0; - PFN_vkCmdSetCoarseSampleOrderNV vkCmdSetCoarseSampleOrderNV = 0; - - //=== VK_QCOM_tile_properties === - PFN_vkGetFramebufferTilePropertiesQCOM vkGetFramebufferTilePropertiesQCOM = 0; - PFN_vkGetDynamicRenderingTilePropertiesQCOM vkGetDynamicRenderingTilePropertiesQCOM = 0; - - //=== VK_VALVE_descriptor_set_host_mapping === - PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutHostMappingInfoVALVE = 0; - PFN_vkGetDescriptorSetHostMappingVALVE vkGetDescriptorSetHostMappingVALVE = 0; - }; - - //======================================== - //=== RAII HANDLE forward declarations === - //======================================== - - //=== VK_VERSION_1_0 === - class Instance; - class PhysicalDevice; - class Device; - class Queue; - class DeviceMemory; - class Fence; - class Semaphore; - class Event; - class QueryPool; - class Buffer; - class BufferView; - class Image; - class ImageView; - class ShaderModule; - class PipelineCache; - class Pipeline; - class PipelineLayout; - class Sampler; - class DescriptorPool; - class DescriptorSet; - class DescriptorSetLayout; - class Framebuffer; - class RenderPass; - class CommandPool; - class CommandBuffer; - - //=== VK_VERSION_1_1 === - class SamplerYcbcrConversion; - class DescriptorUpdateTemplate; - - //=== VK_VERSION_1_3 === - class PrivateDataSlot; - - //=== VK_KHR_surface === - class SurfaceKHR; - - //=== VK_KHR_swapchain === - class SwapchainKHR; - - //=== VK_KHR_display === - class DisplayKHR; - class DisplayModeKHR; - - //=== VK_EXT_debug_report === - class DebugReportCallbackEXT; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - class VideoSessionKHR; - class VideoSessionParametersKHR; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - class CuModuleNVX; - class CuFunctionNVX; - - //=== VK_EXT_debug_utils === - class DebugUtilsMessengerEXT; - - //=== VK_KHR_acceleration_structure === - class AccelerationStructureKHR; - - //=== VK_EXT_validation_cache === - class ValidationCacheEXT; - - //=== VK_NV_ray_tracing === - class AccelerationStructureNV; - - //=== VK_INTEL_performance_query === - class PerformanceConfigurationINTEL; - - //=== VK_KHR_deferred_host_operations === - class DeferredOperationKHR; - - //=== VK_NV_device_generated_commands === - class IndirectCommandsLayoutNV; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - class BufferCollectionFUCHSIA; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //==================== - //=== RAII HANDLES === - //==================== - - class Context - { - public: -# if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - Context() - : m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher( - m_dynamicLoader.getProcAddress( "vkGetInstanceProcAddr" ) ) ) -# else - Context( PFN_vkGetInstanceProcAddr getInstanceProcAddr ) - : m_dispatcher( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher( getInstanceProcAddr ) ) -# endif - { - } - - ~Context() = default; - - Context( Context const & ) = delete; - Context( Context && rhs ) VULKAN_HPP_NOEXCEPT -# if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - : m_dynamicLoader( std::move( rhs.m_dynamicLoader ) ) - , m_dispatcher( rhs.m_dispatcher.release() ) -# else - : m_dispatcher( rhs.m_dispatcher.release() ) -# endif - { - } - Context & operator=( Context const & ) = delete; - Context & operator =( Context && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { -# if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - m_dynamicLoader = std::move( rhs.m_dynamicLoader ); -# endif - m_dispatcher.reset( rhs.m_dispatcher.release() ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ContextDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return &*m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Context & rhs ) - { -# if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - std::swap( m_dynamicLoader, rhs.m_dynamicLoader ); -# endif - m_dispatcher.swap( rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Instance - createInstance( VULKAN_HPP_NAMESPACE::InstanceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - enumerateInstanceExtensionProperties( Optional layerName VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - VULKAN_HPP_NODISCARD std::vector enumerateInstanceLayerProperties() const; - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_NODISCARD uint32_t enumerateInstanceVersion() const; - - private: -# if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL - VULKAN_HPP_NAMESPACE::DynamicLoader m_dynamicLoader; -# endif - std::unique_ptr m_dispatcher; - }; - - class Instance - { - public: - using CType = VkInstance; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eInstance; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eInstance; - - public: - Instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Context const & context, - VULKAN_HPP_NAMESPACE::InstanceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_allocator( static_cast( allocator ) ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( context.getDispatcher()->vkCreateInstance( reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_instance ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateInstance" ); - } - m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher( context.getDispatcher()->vkGetInstanceProcAddr, - static_cast( m_instance ) ) ); - } - - Instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Context const & context, - VkInstance instance, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( instance ), m_allocator( static_cast( allocator ) ) - { - m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher( context.getDispatcher()->vkGetInstanceProcAddr, - static_cast( m_instance ) ) ); - } - - Instance( std::nullptr_t ) {} - - ~Instance() - { - clear(); - } - - Instance() = delete; - Instance( Instance const & ) = delete; - Instance( Instance && rhs ) VULKAN_HPP_NOEXCEPT - : m_instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( rhs.m_dispatcher.release() ) - { - } - Instance & operator=( Instance const & ) = delete; - Instance & operator =( Instance && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_instance = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher.reset( rhs.m_dispatcher.release() ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Instance const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_instance; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_instance ) - { - getDispatcher()->vkDestroyInstance( static_cast( m_instance ), reinterpret_cast( m_allocator ) ); - } - m_instance = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return &*m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_instance, rhs.m_instance ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD std::vector enumeratePhysicalDevices() const; - - VULKAN_HPP_NODISCARD PFN_vkVoidFunction getProcAddr( const std::string & name ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_NODISCARD std::vector enumeratePhysicalDeviceGroups() const; - - //=== VK_KHR_display === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createDisplayPlaneSurfaceKHR( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createXlibSurfaceKHR( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createXcbSurfaceKHR( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createWaylandSurfaceKHR( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createAndroidSurfaceKHR( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createWin32SurfaceKHR( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DebugReportCallbackEXT - createDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, - uint64_t object, - size_t location, - int32_t messageCode, - const std::string & layerPrefix, - const std::string & message ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createStreamDescriptorSurfaceGGP( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_GGP*/ - -# if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createViSurfaceNN( VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_device_group_creation === - - VULKAN_HPP_NODISCARD std::vector enumeratePhysicalDeviceGroupsKHR() const; - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createIOSSurfaceMVK( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createMacOSSurfaceMVK( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DebugUtilsMessengerEXT - createDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT & callbackData ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createImagePipeSurfaceFUCHSIA( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createMetalSurfaceEXT( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_headless_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createHeadlessSurfaceEXT( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createDirectFBSurfaceEXT( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - createScreenSurfaceQNX( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - private: - VULKAN_HPP_NAMESPACE::Instance m_instance = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - std::unique_ptr m_dispatcher; - }; - - class PhysicalDevice - { - public: - using CType = VkPhysicalDevice; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePhysicalDevice; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePhysicalDevice; - - public: - PhysicalDevice( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, VkPhysicalDevice physicalDevice ) - : m_physicalDevice( physicalDevice ), m_dispatcher( instance.getDispatcher() ) - { - } - - PhysicalDevice( std::nullptr_t ) {} - - ~PhysicalDevice() - { - clear(); - } - - PhysicalDevice() = delete; - PhysicalDevice( PhysicalDevice const & rhs ) : m_physicalDevice( rhs.m_physicalDevice ), m_dispatcher( rhs.m_dispatcher ) {} - PhysicalDevice( PhysicalDevice && rhs ) VULKAN_HPP_NOEXCEPT - : m_physicalDevice( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - PhysicalDevice & operator=( PhysicalDevice const & rhs ) - { - m_physicalDevice = rhs.m_physicalDevice; - m_dispatcher = rhs.m_dispatcher; - return *this; - } - PhysicalDevice & operator=( PhysicalDevice && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - m_physicalDevice = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::PhysicalDevice const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_physicalDevice; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - m_physicalDevice = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_physicalDevice, rhs.m_physicalDevice ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures getFeatures() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties getFormatProperties( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ImageFormatProperties - getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties getProperties() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector getQueueFamilyProperties() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties getMemoryProperties() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Device - createDevice( VULKAN_HPP_NAMESPACE::DeviceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - enumerateDeviceExtensionProperties( Optional layerName VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - VULKAN_HPP_NODISCARD std::vector enumerateDeviceLayerProperties() const; - - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling ) const; - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 getFeatures2() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getFeatures2() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 getProperties2() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getProperties2() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties2 getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ImageFormatProperties2 - getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const; - - VULKAN_HPP_NODISCARD std::vector getQueueFamilyProperties2() const; - - template - VULKAN_HPP_NODISCARD std::vector getQueueFamilyProperties2() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 getMemoryProperties2() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getMemoryProperties2() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalBufferProperties - getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalFenceProperties - getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - getExternalSemaphoreProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_3 === - - VULKAN_HPP_NODISCARD std::vector getToolProperties() const; - - //=== VK_KHR_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 getSurfaceSupportKHR( uint32_t queueFamilyIndex, VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const; - - VULKAN_HPP_NODISCARD std::vector - getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - VULKAN_HPP_NODISCARD std::vector - getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_KHR_swapchain === - - VULKAN_HPP_NODISCARD std::vector getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const; - - //=== VK_KHR_display === - - VULKAN_HPP_NODISCARD std::vector getDisplayPropertiesKHR() const; - - VULKAN_HPP_NODISCARD std::vector getDisplayPlanePropertiesKHR() const; - - VULKAN_HPP_NODISCARD std::vector getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const; - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 - getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 - getXcbPresentationSupportKHR( uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, - struct wl_display & display ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR - getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile ) const; - - template - VULKAN_HPP_NODISCARD StructureChain getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile ) const; - - VULKAN_HPP_NODISCARD std::vector - getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo ) const; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_external_memory_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV getExternalImageFormatPropertiesNV( - VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_KHR_get_physical_device_properties2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 getFeatures2KHR() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getFeatures2KHR() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 getProperties2KHR() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getProperties2KHR() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::FormatProperties2 getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ImageFormatProperties2 - getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const; - - VULKAN_HPP_NODISCARD std::vector getQueueFamilyProperties2KHR() const; - - template - VULKAN_HPP_NODISCARD std::vector getQueueFamilyProperties2KHR() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 getMemoryProperties2KHR() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getMemoryProperties2KHR() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo ) const; - - //=== VK_KHR_external_memory_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalBufferProperties - getExternalBufferPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_external_semaphore_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties - getExternalSemaphorePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - - void acquireXlibDisplayEXT( Display & dpy, VULKAN_HPP_NAMESPACE::DisplayKHR display ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DisplayKHR getRandROutputDisplayEXT( Display & dpy, RROutput rrOutput ) const; -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const; - - //=== VK_KHR_external_fence_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExternalFenceProperties - getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_performance_query === - - VULKAN_HPP_NODISCARD - std::pair, std::vector> - enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex ) const; - - VULKAN_HPP_NODISCARD uint32_t getQueueFamilyPerformanceQueryPassesKHR( - const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR & performanceQueryCreateInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_get_surface_capabilities2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR - getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; - - template - VULKAN_HPP_NODISCARD StructureChain - getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; - - VULKAN_HPP_NODISCARD std::vector - getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; - - template - VULKAN_HPP_NODISCARD std::vector getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; - - //=== VK_KHR_get_display_properties2 === - - VULKAN_HPP_NODISCARD std::vector getDisplayProperties2KHR() const; - - VULKAN_HPP_NODISCARD std::vector getDisplayPlaneProperties2KHR() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR - getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR & displayPlaneInfo ) const; - - //=== VK_EXT_sample_locations === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT - getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_calibrated_timestamps === - - VULKAN_HPP_NODISCARD std::vector getCalibrateableTimeDomainsEXT() const; - - //=== VK_KHR_fragment_shading_rate === - - VULKAN_HPP_NODISCARD std::vector getFragmentShadingRatesKHR() const; - - //=== VK_EXT_tooling_info === - - VULKAN_HPP_NODISCARD std::vector getToolPropertiesEXT() const; - - //=== VK_NV_cooperative_matrix === - - VULKAN_HPP_NODISCARD std::vector getCooperativeMatrixPropertiesNV() const; - - //=== VK_NV_coverage_reduction_mode === - - VULKAN_HPP_NODISCARD std::vector getSupportedFramebufferMixedSamplesCombinationsNV() const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - VULKAN_HPP_NODISCARD std::vector - getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_acquire_drm_display === - - void acquireDrmDisplayEXT( int32_t drmFd, VULKAN_HPP_NAMESPACE::DisplayKHR display ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DisplayKHR getDrmDisplayEXT( int32_t drmFd, uint32_t connectorId ) const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DisplayKHR getWinrtDisplayNV( uint32_t deviceRelativeId ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, - IDirectFB & dfb ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Bool32 getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, - struct _screen_window & window ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - private: - VULKAN_HPP_NAMESPACE::PhysicalDevice m_physicalDevice = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class PhysicalDevices : public std::vector - { - public: - PhysicalDevices( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * dispatcher = instance.getDispatcher(); - std::vector physicalDevices; - uint32_t physicalDeviceCount; - VULKAN_HPP_NAMESPACE::Result result; - do - { - result = static_cast( - dispatcher->vkEnumeratePhysicalDevices( static_cast( *instance ), &physicalDeviceCount, nullptr ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) && physicalDeviceCount ) - { - physicalDevices.resize( physicalDeviceCount ); - result = static_cast( - dispatcher->vkEnumeratePhysicalDevices( static_cast( *instance ), &physicalDeviceCount, physicalDevices.data() ) ); - } - } while ( result == VULKAN_HPP_NAMESPACE::Result::eIncomplete ); - if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - VULKAN_HPP_ASSERT( physicalDeviceCount <= physicalDevices.size() ); - this->reserve( physicalDeviceCount ); - for ( auto const & physicalDevice : physicalDevices ) - { - this->emplace_back( instance, physicalDevice ); - } - } - else - { - throwResultException( result, "vkEnumeratePhysicalDevices" ); - } - } - - PhysicalDevices( std::nullptr_t ) {} - - PhysicalDevices() = delete; - PhysicalDevices( PhysicalDevices const & ) = delete; - PhysicalDevices( PhysicalDevices && rhs ) = default; - PhysicalDevices & operator=( PhysicalDevices const & ) = delete; - PhysicalDevices & operator=( PhysicalDevices && rhs ) = default; - }; - - class Device - { - public: - using CType = VkDevice; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDevice; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDevice; - - public: - Device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, - VULKAN_HPP_NAMESPACE::DeviceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_allocator( static_cast( allocator ) ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - physicalDevice.getDispatcher()->vkCreateDevice( static_cast( *physicalDevice ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_device ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDevice" ); - } - m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher( physicalDevice.getDispatcher()->vkGetDeviceProcAddr, - static_cast( m_device ) ) ); - } - - Device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, - VkDevice device, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( device ), m_allocator( static_cast( allocator ) ) - { - m_dispatcher.reset( new VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher( physicalDevice.getDispatcher()->vkGetDeviceProcAddr, - static_cast( m_device ) ) ); - } - - Device( std::nullptr_t ) {} - - ~Device() - { - clear(); - } - - Device() = delete; - Device( Device const & ) = delete; - Device( Device && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( rhs.m_dispatcher.release() ) - { - } - Device & operator=( Device const & ) = delete; - Device & operator =( Device && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher.reset( rhs.m_dispatcher.release() ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Device const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_device; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_device ) - { - getDispatcher()->vkDestroyDevice( static_cast( m_device ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return &*m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD PFN_vkVoidFunction getProcAddr( const std::string & name ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Queue getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const; - - void waitIdle() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DeviceMemory - allocateMemory( VULKAN_HPP_NAMESPACE::MemoryAllocateInfo const & allocateInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void flushMappedMemoryRanges( ArrayProxy const & memoryRanges ) const; - - void invalidateMappedMemoryRanges( ArrayProxy const & memoryRanges ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Fence - createFence( VULKAN_HPP_NAMESPACE::FenceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void resetFences( ArrayProxy const & fences ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - waitForFences( ArrayProxy const & fences, VULKAN_HPP_NAMESPACE::Bool32 waitAll, uint64_t timeout ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Semaphore - createSemaphore( VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Event - createEvent( VULKAN_HPP_NAMESPACE::EventCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::QueryPool - createQueryPool( VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Buffer - createBuffer( VULKAN_HPP_NAMESPACE::BufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::BufferView - createBufferView( VULKAN_HPP_NAMESPACE::BufferViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Image - createImage( VULKAN_HPP_NAMESPACE::ImageCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::ImageView - createImageView( VULKAN_HPP_NAMESPACE::ImageViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::ShaderModule - createShaderModule( VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::PipelineCache - createPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - createGraphicsPipelines( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Pipeline - createGraphicsPipeline( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - createComputePipelines( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Pipeline - createComputePipeline( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::PipelineLayout - createPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Sampler - createSampler( VULKAN_HPP_NAMESPACE::SamplerCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DescriptorSetLayout - createDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DescriptorPool - createDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - allocateDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo const & allocateInfo ) const; - - void updateDescriptorSets( ArrayProxy const & descriptorWrites, - ArrayProxy const & descriptorCopies ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Framebuffer - createFramebuffer( VULKAN_HPP_NAMESPACE::FramebufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::RenderPass - createRenderPass( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::CommandPool - createCommandPool( VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD std::vector - allocateCommandBuffers( VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo const & allocateInfo ) const; - - //=== VK_VERSION_1_1 === - - void bindBufferMemory2( ArrayProxy const & bindInfos ) const; - - void bindImageMemory2( ArrayProxy const & bindInfos ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Queue getQueue2( VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 const & queueInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion - createSamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate - createDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::RenderPass - createRenderPass2( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, uint64_t timeout ) const; - - void signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceAddress - getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD uint64_t getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD uint64_t - getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_3 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot - createPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data ) const; - - VULKAN_HPP_NODISCARD uint64_t getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const; - - //=== VK_KHR_swapchain === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR - createSwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR getGroupPresentCapabilitiesKHR() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR - getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const; - - VULKAN_HPP_NODISCARD std::pair - acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR & acquireInfo ) const; - - //=== VK_KHR_display_swapchain === - - VULKAN_HPP_NODISCARD std::vector - createSharedSwapchainsKHR( VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR - createSharedSwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_EXT_debug_marker === - - void debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT & tagInfo ) const; - - void debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT & nameInfo ) const; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::VideoSessionKHR - createVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::VideoSessionParametersKHR - createVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NVX_binary_import === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::CuModuleNVX - createCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::CuFunctionNVX - createCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_NVX_image_view_handle === - - VULKAN_HPP_NODISCARD uint32_t getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX & info ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_device_group === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - - VULKAN_HPP_NODISCARD HANDLE getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR & getWin32HandleInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR - getMemoryWin32HandlePropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - - VULKAN_HPP_NODISCARD int getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR & getFdInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR - getMemoryFdPropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, int fd ) const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - - void importSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo ) const; - - VULKAN_HPP_NODISCARD HANDLE getSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - - void importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo ) const; - - VULKAN_HPP_NODISCARD int getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR & getFdInfo ) const; - - //=== VK_KHR_descriptor_update_template === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate - createDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_display_control === - - void displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT & displayPowerInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Fence - registerEventEXT( VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT const & deviceEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Fence - registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR const & display, - VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT const & displayEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_EXT_hdr_metadata === - - void setHdrMetadataEXT( ArrayProxy const & swapchains, - ArrayProxy const & metadata ) const; - - //=== VK_KHR_create_renderpass2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::RenderPass - createRenderPass2KHR( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - - void importFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo ) const; - - VULKAN_HPP_NODISCARD HANDLE getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR & getWin32HandleInfo ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - - void importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR & importFenceFdInfo ) const; - - VULKAN_HPP_NODISCARD int getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR & getFdInfo ) const; - - //=== VK_KHR_performance_query === - - void acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR & info ) const; - - void releaseProfilingLockKHR() const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_debug_utils === - - void setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT & nameInfo ) const; - - void setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT & tagInfo ) const; - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID - getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer ) const; - - template - VULKAN_HPP_NODISCARD StructureChain getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer ) const; - - VULKAN_HPP_NODISCARD struct AHardwareBuffer * - getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID & info ) const; -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_KHR_get_memory_requirements2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info ) const; - - //=== VK_KHR_acceleration_structure === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureKHR - createAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - buildAccelerationStructuresKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result - copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info ) const; - - template - VULKAN_HPP_NODISCARD std::vector - writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - size_t stride ) const; - - template - VULKAN_HPP_NODISCARD DataType - writeAccelerationStructuresPropertyKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t stride ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceAddress - getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR - getAccelerationStructureCompatibilityKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR & versionInfo ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR - getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR & buildInfo, - ArrayProxy const & maxPrimitiveCounts VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - //=== VK_KHR_sampler_ycbcr_conversion === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion - createSamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_bind_memory2 === - - void bindBufferMemory2KHR( ArrayProxy const & bindInfos ) const; - - void bindImageMemory2KHR( ArrayProxy const & bindInfos ) const; - - //=== VK_EXT_validation_cache === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::ValidationCacheEXT - createValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_NV_ray_tracing === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureNV - createAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR getAccelerationStructureMemoryRequirementsNV( - const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain getAccelerationStructureMemoryRequirementsNV( - const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT; - - void bindAccelerationStructureMemoryNV( ArrayProxy const & bindInfos ) const; - - VULKAN_HPP_NODISCARD std::vector - createRayTracingPipelinesNV( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Pipeline - createRayTracingPipelineNV( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_KHR_maintenance3 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_external_memory_host === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT - getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, const void * pHostPointer ) const; - - //=== VK_EXT_calibrated_timestamps === - - VULKAN_HPP_NODISCARD std::pair, uint64_t> - getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos ) const; - - VULKAN_HPP_NODISCARD std::pair - getCalibratedTimestampEXT( const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT & timestampInfo ) const; - - //=== VK_KHR_timeline_semaphore === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, uint64_t timeout ) const; - - void signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo ) const; - - //=== VK_INTEL_performance_query === - - void initializePerformanceApiINTEL( const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL & initializeInfo ) const; - - void uninitializePerformanceApiINTEL() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::PerformanceConfigurationINTEL - acquirePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL const & acquireInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::PerformanceValueINTEL - getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter ) const; - - //=== VK_EXT_buffer_device_address === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceAddress - getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR - getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_buffer_device_address === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceAddress - getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD uint64_t getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD uint64_t - getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_deferred_host_operations === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DeferredOperationKHR - createDeferredOperationKHR( VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_KHR_pipeline_executable_properties === - - VULKAN_HPP_NODISCARD std::vector - getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo ) const; - - VULKAN_HPP_NODISCARD std::vector - getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo ) const; - - VULKAN_HPP_NODISCARD std::vector - getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo ) const; - - //=== VK_NV_device_generated_commands === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::IndirectCommandsLayoutNV - createIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_EXT_private_data === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot - createPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - void destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - Optional allocator - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data ) const; - - VULKAN_HPP_NODISCARD uint64_t getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT exportMetalObjectsEXT() const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain exportMetalObjectsEXT() const VULKAN_HPP_NOEXCEPT; -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - VULKAN_HPP_NODISCARD std::vector createRayTracingPipelinesKHR( - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::Pipeline createRayTracingPipelineKHR( - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - - VULKAN_HPP_NODISCARD zx_handle_t getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA & getZirconHandleInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA - getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle ) const; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - - void importSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA & importSemaphoreZirconHandleInfo ) const; - - VULKAN_HPP_NODISCARD zx_handle_t - getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA & getZirconHandleInfo ) const; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::BufferCollectionFUCHSIA - createBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_NV_external_memory_rdma === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::RemoteAddressNV - getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV & memoryGetRemoteAddressInfo ) const; - - //=== VK_EXT_pipeline_properties === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::BaseOutStructure getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT & pipelineInfo ) const; - - //=== VK_KHR_maintenance4 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements2 - getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector - getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const; - - //=== VK_VALVE_descriptor_set_host_mapping === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE getDescriptorSetLayoutHostMappingInfoVALVE( - const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE & bindingReference ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_shader_module_identifier === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_QCOM_tile_properties === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::TilePropertiesQCOM - getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - std::unique_ptr m_dispatcher; - }; - - class AccelerationStructureKHR - { - public: - using CType = VkAccelerationStructureKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureKHR; - - public: - AccelerationStructureKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateAccelerationStructureKHR( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_accelerationStructure ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateAccelerationStructureKHR" ); - } - } - - AccelerationStructureKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkAccelerationStructureKHR accelerationStructure, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_accelerationStructure( accelerationStructure ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - AccelerationStructureKHR( std::nullptr_t ) {} - - ~AccelerationStructureKHR() - { - clear(); - } - - AccelerationStructureKHR() = delete; - AccelerationStructureKHR( AccelerationStructureKHR const & ) = delete; - AccelerationStructureKHR( AccelerationStructureKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_accelerationStructure( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_accelerationStructure, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - AccelerationStructureKHR & operator=( AccelerationStructureKHR const & ) = delete; - AccelerationStructureKHR & operator =( AccelerationStructureKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_accelerationStructure = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_accelerationStructure, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructure; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_accelerationStructure ) - { - getDispatcher()->vkDestroyAccelerationStructureKHR( static_cast( m_device ), - static_cast( m_accelerationStructure ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_accelerationStructure = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_accelerationStructure, rhs.m_accelerationStructure ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR m_accelerationStructure = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class AccelerationStructureNV - { - public: - using CType = VkAccelerationStructureNV; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eAccelerationStructureNV; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eAccelerationStructureNV; - - public: - AccelerationStructureNV( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateAccelerationStructureNV( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_accelerationStructure ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateAccelerationStructureNV" ); - } - } - - AccelerationStructureNV( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkAccelerationStructureNV accelerationStructure, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_accelerationStructure( accelerationStructure ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - AccelerationStructureNV( std::nullptr_t ) {} - - ~AccelerationStructureNV() - { - clear(); - } - - AccelerationStructureNV() = delete; - AccelerationStructureNV( AccelerationStructureNV const & ) = delete; - AccelerationStructureNV( AccelerationStructureNV && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_accelerationStructure( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_accelerationStructure, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - AccelerationStructureNV & operator=( AccelerationStructureNV const & ) = delete; - AccelerationStructureNV & operator =( AccelerationStructureNV && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_accelerationStructure = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_accelerationStructure, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::AccelerationStructureNV const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_accelerationStructure; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_accelerationStructure ) - { - getDispatcher()->vkDestroyAccelerationStructureNV( static_cast( m_device ), - static_cast( m_accelerationStructure ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_accelerationStructure = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureNV & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_accelerationStructure, rhs.m_accelerationStructure ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_NV_ray_tracing === - - template - VULKAN_HPP_NODISCARD std::vector getHandle( size_t dataSize ) const; - - template - VULKAN_HPP_NODISCARD DataType getHandle() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureNV m_accelerationStructure = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Buffer - { - public: - using CType = VkBuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBuffer; - - public: - Buffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::BufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateBuffer( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_buffer ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateBuffer" ); - } - } - - Buffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkBuffer buffer, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_buffer( buffer ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Buffer( std::nullptr_t ) {} - - ~Buffer() - { - clear(); - } - - Buffer() = delete; - Buffer( Buffer const & ) = delete; - Buffer( Buffer && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_buffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_buffer, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Buffer & operator=( Buffer const & ) = delete; - Buffer & operator =( Buffer && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_buffer = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_buffer, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Buffer const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_buffer; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_buffer ) - { - getDispatcher()->vkDestroyBuffer( - static_cast( m_device ), static_cast( m_buffer ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_buffer = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Buffer & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_buffer, rhs.m_buffer ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void bindMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements getMemoryRequirements() const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Buffer m_buffer = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - class BufferCollectionFUCHSIA - { - public: - using CType = VkBufferCollectionFUCHSIA; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferCollectionFUCHSIA; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferCollectionFUCHSIA; - - public: - BufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateBufferCollectionFUCHSIA( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_collection ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateBufferCollectionFUCHSIA" ); - } - } - - BufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkBufferCollectionFUCHSIA collection, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_collection( collection ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - BufferCollectionFUCHSIA( std::nullptr_t ) {} - - ~BufferCollectionFUCHSIA() - { - clear(); - } - - BufferCollectionFUCHSIA() = delete; - BufferCollectionFUCHSIA( BufferCollectionFUCHSIA const & ) = delete; - BufferCollectionFUCHSIA( BufferCollectionFUCHSIA && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_collection( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_collection, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - BufferCollectionFUCHSIA & operator=( BufferCollectionFUCHSIA const & ) = delete; - BufferCollectionFUCHSIA & operator =( BufferCollectionFUCHSIA && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_collection = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_collection, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_collection; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_collection ) - { - getDispatcher()->vkDestroyBufferCollectionFUCHSIA( static_cast( m_device ), - static_cast( m_collection ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_collection = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::BufferCollectionFUCHSIA & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_collection, rhs.m_collection ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_FUCHSIA_buffer_collection === - - void setImageConstraints( const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA & imageConstraintsInfo ) const; - - void setBufferConstraints( const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA & bufferConstraintsInfo ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA getProperties() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA m_collection = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - class BufferView - { - public: - using CType = VkBufferView; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eBufferView; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eBufferView; - - public: - BufferView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::BufferViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateBufferView( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_bufferView ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateBufferView" ); - } - } - - BufferView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkBufferView bufferView, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_bufferView( bufferView ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - BufferView( std::nullptr_t ) {} - - ~BufferView() - { - clear(); - } - - BufferView() = delete; - BufferView( BufferView const & ) = delete; - BufferView( BufferView && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_bufferView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_bufferView, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - BufferView & operator=( BufferView const & ) = delete; - BufferView & operator =( BufferView && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_bufferView = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_bufferView, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::BufferView const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_bufferView; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_bufferView ) - { - getDispatcher()->vkDestroyBufferView( - static_cast( m_device ), static_cast( m_bufferView ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_bufferView = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::BufferView & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_bufferView, rhs.m_bufferView ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::BufferView m_bufferView = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class CommandPool - { - public: - using CType = VkCommandPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandPool; - - public: - CommandPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateCommandPool( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_commandPool ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateCommandPool" ); - } - } - - CommandPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkCommandPool commandPool, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_commandPool( commandPool ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - CommandPool( std::nullptr_t ) {} - - ~CommandPool() - { - clear(); - } - - CommandPool() = delete; - CommandPool( CommandPool const & ) = delete; - CommandPool( CommandPool && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_commandPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandPool, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - CommandPool & operator=( CommandPool const & ) = delete; - CommandPool & operator =( CommandPool && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_commandPool = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandPool, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::CommandPool const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_commandPool; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_commandPool ) - { - getDispatcher()->vkDestroyCommandPool( - static_cast( m_device ), static_cast( m_commandPool ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_commandPool = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CommandPool & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_commandPool, rhs.m_commandPool ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void reset( VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_VERSION_1_1 === - - void trim( VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_maintenance1 === - - void trimKHR( VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::CommandPool m_commandPool = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class CommandBuffer - { - public: - using CType = VkCommandBuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCommandBuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCommandBuffer; - - public: - CommandBuffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, VkCommandBuffer commandBuffer, VkCommandPool commandPool ) - : m_device( *device ), m_commandPool( commandPool ), m_commandBuffer( commandBuffer ), m_dispatcher( device.getDispatcher() ) - { - } - - CommandBuffer( std::nullptr_t ) {} - - ~CommandBuffer() - { - clear(); - } - - CommandBuffer() = delete; - CommandBuffer( CommandBuffer const & ) = delete; - CommandBuffer( CommandBuffer && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_commandPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandPool, {} ) ) - , m_commandBuffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandBuffer, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - CommandBuffer & operator=( CommandBuffer const & ) = delete; - CommandBuffer & operator =( CommandBuffer && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_commandPool = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandPool, {} ); - m_commandBuffer = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_commandBuffer, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::CommandBuffer const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_commandBuffer; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_commandBuffer ) - { - getDispatcher()->vkFreeCommandBuffers( - static_cast( m_device ), static_cast( m_commandPool ), 1, reinterpret_cast( &m_commandBuffer ) ); - } - m_device = nullptr; - m_commandPool = nullptr; - m_commandBuffer = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CommandBuffer & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_commandPool, rhs.m_commandPool ); - std::swap( m_commandBuffer, rhs.m_commandBuffer ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo & beginInfo ) const; - - void end() const; - - void reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - void bindPipeline( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, VULKAN_HPP_NAMESPACE::Pipeline pipeline ) const VULKAN_HPP_NOEXCEPT; - - void setViewport( uint32_t firstViewport, ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT; - - void setScissor( uint32_t firstScissor, ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT; - - void setLineWidth( float lineWidth ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const VULKAN_HPP_NOEXCEPT; - - void setBlendConstants( const float blendConstants[4] ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBounds( float minDepthBounds, float maxDepthBounds ) const VULKAN_HPP_NOEXCEPT; - - void setStencilCompareMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t compareMask ) const VULKAN_HPP_NOEXCEPT; - - void setStencilWriteMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t writeMask ) const VULKAN_HPP_NOEXCEPT; - - void setStencilReference( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t reference ) const VULKAN_HPP_NOEXCEPT; - - void bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - ArrayProxy const & descriptorSets, - ArrayProxy const & dynamicOffsets ) const VULKAN_HPP_NOEXCEPT; - - void bindIndexBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::IndexType indexType ) const VULKAN_HPP_NOEXCEPT; - - void bindVertexBuffers( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets ) const; - - void draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const VULKAN_HPP_NOEXCEPT; - - void - drawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const VULKAN_HPP_NOEXCEPT; - - void drawIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawIndexedIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT; - - void dispatchIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, VULKAN_HPP_NAMESPACE::DeviceSize offset ) const VULKAN_HPP_NOEXCEPT; - - void copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT; - - void copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT; - - void blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - VULKAN_HPP_NAMESPACE::Filter filter ) const VULKAN_HPP_NOEXCEPT; - - void copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT; - - void copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT; - - template - void updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - ArrayProxy const & data ) const VULKAN_HPP_NOEXCEPT; - - void fillBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - uint32_t data ) const VULKAN_HPP_NOEXCEPT; - - void clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue & color, - ArrayProxy const & ranges ) const VULKAN_HPP_NOEXCEPT; - - void clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue & depthStencil, - ArrayProxy const & ranges ) const VULKAN_HPP_NOEXCEPT; - - void clearAttachments( ArrayProxy const & attachments, - ArrayProxy const & rects ) const VULKAN_HPP_NOEXCEPT; - - void resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT; - - void setEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void resetEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void waitEvents( ArrayProxy const & events, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT; - - void pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT; - - void beginQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void endQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT; - - void resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT; - - void writeTimestamp( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT; - - void copyQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - template - void pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - ArrayProxy const & values ) const VULKAN_HPP_NOEXCEPT; - - void beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents ) const VULKAN_HPP_NOEXCEPT; - - void nextSubpass( VULKAN_HPP_NAMESPACE::SubpassContents contents ) const VULKAN_HPP_NOEXCEPT; - - void endRenderPass() const VULKAN_HPP_NOEXCEPT; - - void executeCommands( ArrayProxy const & commandBuffers ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_1 === - - void setDeviceMask( uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT; - - void dispatchBase( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const - VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_2 === - - void drawIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawIndexedIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo ) const VULKAN_HPP_NOEXCEPT; - - void nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT; - - void endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VERSION_1_3 === - - void setEvent2( VULKAN_HPP_NAMESPACE::Event event, const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT; - - void resetEvent2( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void waitEvents2( ArrayProxy const & events, - ArrayProxy const & dependencyInfos ) const; - - void pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT; - - void - writeTimestamp2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT; - - void copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - void blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT; - - void endRendering() const VULKAN_HPP_NOEXCEPT; - - void setCullMode( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void setFrontFace( VULKAN_HPP_NAMESPACE::FrontFace frontFace ) const VULKAN_HPP_NOEXCEPT; - - void setPrimitiveTopology( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT; - - void setViewportWithCount( ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT; - - void setScissorWithCount( ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT; - - void bindVertexBuffers2( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - ArrayProxy const & strides VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - void setDepthTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthCompareOp( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBoundsTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setStencilTestEnable( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setStencilOp( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp ) const VULKAN_HPP_NOEXCEPT; - - void setRasterizerDiscardEnable( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBiasEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT; - - void setPrimitiveRestartEnable( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_debug_marker === - - void debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo ) const VULKAN_HPP_NOEXCEPT; - - void debugMarkerEndEXT() const VULKAN_HPP_NOEXCEPT; - - void debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - void beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR & beginInfo ) const VULKAN_HPP_NOEXCEPT; - - void endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR & endCodingInfo ) const VULKAN_HPP_NOEXCEPT; - - void controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR & codingControlInfo ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - void decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR & frameInfo ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - void bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - void beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - void endTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets - VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - void beginQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - uint32_t index ) const VULKAN_HPP_NOEXCEPT; - - void endQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query, uint32_t index ) const VULKAN_HPP_NOEXCEPT; - - void drawIndirectByteCountEXT( uint32_t instanceCount, - uint32_t firstInstance, - VULKAN_HPP_NAMESPACE::Buffer counterBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize counterBufferOffset, - uint32_t counterOffset, - uint32_t vertexStride ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NVX_binary_import === - - void cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX & launchInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_AMD_draw_indirect_count === - - void drawIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawIndexedIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_dynamic_rendering === - - void beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT; - - void endRenderingKHR() const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_device_group === - - void setDeviceMaskKHR( uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT; - - void dispatchBaseKHR( uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) - const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_push_descriptor === - - void pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - ArrayProxy const & descriptorWrites ) const VULKAN_HPP_NOEXCEPT; - - template - void pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - DataType const & data ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_conditional_rendering === - - void beginConditionalRenderingEXT( const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT & conditionalRenderingBegin ) const VULKAN_HPP_NOEXCEPT; - - void endConditionalRenderingEXT() const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_clip_space_w_scaling === - - void setViewportWScalingNV( uint32_t firstViewport, - ArrayProxy const & viewportWScalings ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_discard_rectangles === - - void setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - ArrayProxy const & discardRectangles ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_create_renderpass2 === - - void beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo ) const VULKAN_HPP_NOEXCEPT; - - void nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT; - - void endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_debug_utils === - - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT; - - void endDebugUtilsLabelEXT() const VULKAN_HPP_NOEXCEPT; - - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_sample_locations === - - void setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT & sampleLocationsInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_acceleration_structure === - - void - buildAccelerationStructuresKHR( ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos ) const; - - void buildAccelerationStructuresIndirectKHR( ArrayProxy const & infos, - ArrayProxy const & indirectDeviceAddresses, - ArrayProxy const & indirectStrides, - ArrayProxy const & pMaxPrimitiveCounts ) const; - - void copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info ) const VULKAN_HPP_NOEXCEPT; - - void copyAccelerationStructureToMemoryKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info ) const VULKAN_HPP_NOEXCEPT; - - void copyMemoryToAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info ) const VULKAN_HPP_NOEXCEPT; - - void writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_shading_rate_image === - - void bindShadingRateImageNV( VULKAN_HPP_NAMESPACE::ImageView imageView, VULKAN_HPP_NAMESPACE::ImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT; - - void - setViewportShadingRatePaletteNV( uint32_t firstViewport, - ArrayProxy const & shadingRatePalettes ) const VULKAN_HPP_NOEXCEPT; - - void setCoarseSampleOrderNV( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - ArrayProxy const & customSampleOrders ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_ray_tracing === - - void buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV & info, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset ) const VULKAN_HPP_NOEXCEPT; - - void copyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode ) const VULKAN_HPP_NOEXCEPT; - - void traceRaysNV( VULKAN_HPP_NAMESPACE::Buffer raygenShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderBindingOffset, - VULKAN_HPP_NAMESPACE::Buffer missShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer hitShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer callableShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingStride, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT; - - void writeAccelerationStructuresPropertiesNV( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_draw_indirect_count === - - void drawIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawIndexedIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_AMD_buffer_marker === - - void writeBufferMarkerAMD( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_mesh_shader === - - void drawMeshTasksNV( uint32_t taskCount, uint32_t firstTask ) const VULKAN_HPP_NOEXCEPT; - - void drawMeshTasksIndirectNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawMeshTasksIndirectCountNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_scissor_exclusive === - - void setExclusiveScissorNV( uint32_t firstExclusiveScissor, - ArrayProxy const & exclusiveScissors ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_device_diagnostic_checkpoints === - - template - void setCheckpointNV( CheckpointMarkerType const & checkpointMarker ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_INTEL_performance_query === - - void setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL & markerInfo ) const; - - void setPerformanceStreamMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL & markerInfo ) const; - - void setPerformanceOverrideINTEL( const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL & overrideInfo ) const; - - //=== VK_KHR_fragment_shading_rate === - - void setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D & fragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_line_rasterization === - - void setLineStippleEXT( uint32_t lineStippleFactor, uint16_t lineStipplePattern ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_extended_dynamic_state === - - void setCullModeEXT( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void setFrontFaceEXT( VULKAN_HPP_NAMESPACE::FrontFace frontFace ) const VULKAN_HPP_NOEXCEPT; - - void setPrimitiveTopologyEXT( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT; - - void setViewportWithCountEXT( ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT; - - void setScissorWithCountEXT( ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT; - - void bindVertexBuffers2EXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT, - ArrayProxy const & strides VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const; - - void setDepthTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthWriteEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthCompareOpEXT( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBoundsTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setStencilTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT; - - void setStencilOpEXT( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_device_generated_commands === - - void preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo ) const VULKAN_HPP_NOEXCEPT; - - void executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo ) const VULKAN_HPP_NOEXCEPT; - - void bindPipelineShaderGroupNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t groupIndex ) const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - void encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR & encodeInfo ) const VULKAN_HPP_NOEXCEPT; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_KHR_synchronization2 === - - void setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT; - - void resetEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - void waitEvents2KHR( ArrayProxy const & events, - ArrayProxy const & dependencyInfos ) const; - - void pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT; - - void writeTimestamp2KHR( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT; - - void writeBufferMarker2AMD( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_fragment_shading_rate_enums === - - void setFragmentShadingRateEnumNV( VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_mesh_shader === - - void drawMeshTasksEXT( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT; - - void drawMeshTasksIndirectEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawMeshTasksIndirectCountEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_copy_commands2 === - - void copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT; - - void blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo ) const VULKAN_HPP_NOEXCEPT; - - void resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_ray_tracing_pipeline === - - void traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT; - - void traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT; - - void setRayTracingPipelineStackSizeKHR( uint32_t pipelineStackSize ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_vertex_input_dynamic_state === - - void setVertexInputEXT( ArrayProxy const & vertexBindingDescriptions, - ArrayProxy const & vertexAttributeDescriptions ) const - VULKAN_HPP_NOEXCEPT; - - //=== VK_HUAWEI_subpass_shading === - - void subpassShadingHUAWEI() const VULKAN_HPP_NOEXCEPT; - - //=== VK_HUAWEI_invocation_mask === - - void bindInvocationMaskHUAWEI( VULKAN_HPP_NAMESPACE::ImageView imageView, VULKAN_HPP_NAMESPACE::ImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_extended_dynamic_state2 === - - void setPatchControlPointsEXT( uint32_t patchControlPoints ) const VULKAN_HPP_NOEXCEPT; - - void setRasterizerDiscardEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT; - - void setDepthBiasEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT; - - void setLogicOpEXT( VULKAN_HPP_NAMESPACE::LogicOp logicOp ) const VULKAN_HPP_NOEXCEPT; - - void setPrimitiveRestartEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_color_write_enable === - - void setColorWriteEnableEXT( ArrayProxy const & colorWriteEnables ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_ray_tracing_maintenance1 === - - void traceRaysIndirect2KHR( VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_multi_draw === - - void drawMultiEXT( ArrayProxy const & vertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT; - - void drawMultiIndexedEXT( ArrayProxy const & indexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Optional vertexOffset VULKAN_HPP_DEFAULT_ARGUMENT_NULLPTR_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::CommandPool m_commandPool = {}; - VULKAN_HPP_NAMESPACE::CommandBuffer m_commandBuffer = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class CommandBuffers : public std::vector - { - public: - CommandBuffers( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo const & allocateInfo ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector commandBuffers( allocateInfo.commandBufferCount ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkAllocateCommandBuffers( - static_cast( *device ), reinterpret_cast( &allocateInfo ), commandBuffers.data() ) ); - if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - this->reserve( allocateInfo.commandBufferCount ); - for ( auto const & commandBuffer : commandBuffers ) - { - this->emplace_back( device, commandBuffer, static_cast( allocateInfo.commandPool ) ); - } - } - else - { - throwResultException( result, "vkAllocateCommandBuffers" ); - } - } - - CommandBuffers( std::nullptr_t ) {} - - CommandBuffers() = delete; - CommandBuffers( CommandBuffers const & ) = delete; - CommandBuffers( CommandBuffers && rhs ) = default; - CommandBuffers & operator=( CommandBuffers const & ) = delete; - CommandBuffers & operator=( CommandBuffers && rhs ) = default; - }; - - class CuFunctionNVX - { - public: - using CType = VkCuFunctionNVX; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuFunctionNVX; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuFunctionNVX; - - public: - CuFunctionNVX( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateCuFunctionNVX( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_function ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateCuFunctionNVX" ); - } - } - - CuFunctionNVX( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkCuFunctionNVX function, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_function( function ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - CuFunctionNVX( std::nullptr_t ) {} - - ~CuFunctionNVX() - { - clear(); - } - - CuFunctionNVX() = delete; - CuFunctionNVX( CuFunctionNVX const & ) = delete; - CuFunctionNVX( CuFunctionNVX && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_function( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_function, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - CuFunctionNVX & operator=( CuFunctionNVX const & ) = delete; - CuFunctionNVX & operator =( CuFunctionNVX && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_function = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_function, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::CuFunctionNVX const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_function; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_function ) - { - getDispatcher()->vkDestroyCuFunctionNVX( - static_cast( m_device ), static_cast( m_function ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_function = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CuFunctionNVX & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_function, rhs.m_function ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::CuFunctionNVX m_function = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class CuModuleNVX - { - public: - using CType = VkCuModuleNVX; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eCuModuleNVX; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eCuModuleNVX; - - public: - CuModuleNVX( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateCuModuleNVX( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_module ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateCuModuleNVX" ); - } - } - - CuModuleNVX( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkCuModuleNVX module, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_module( module ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - CuModuleNVX( std::nullptr_t ) {} - - ~CuModuleNVX() - { - clear(); - } - - CuModuleNVX() = delete; - CuModuleNVX( CuModuleNVX const & ) = delete; - CuModuleNVX( CuModuleNVX && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_module( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_module, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - CuModuleNVX & operator=( CuModuleNVX const & ) = delete; - CuModuleNVX & operator =( CuModuleNVX && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_module = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_module, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::CuModuleNVX const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_module; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_module ) - { - getDispatcher()->vkDestroyCuModuleNVX( - static_cast( m_device ), static_cast( m_module ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_module = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::CuModuleNVX & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_module, rhs.m_module ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::CuModuleNVX m_module = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DebugReportCallbackEXT - { - public: - using CType = VkDebugReportCallbackEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugReportCallbackEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDebugReportCallbackEXT; - - public: - DebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateDebugReportCallbackEXT( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_callback ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDebugReportCallbackEXT" ); - } - } - - DebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VkDebugReportCallbackEXT callback, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_callback( callback ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - } - - DebugReportCallbackEXT( std::nullptr_t ) {} - - ~DebugReportCallbackEXT() - { - clear(); - } - - DebugReportCallbackEXT() = delete; - DebugReportCallbackEXT( DebugReportCallbackEXT const & ) = delete; - DebugReportCallbackEXT( DebugReportCallbackEXT && rhs ) VULKAN_HPP_NOEXCEPT - : m_instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ) ) - , m_callback( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_callback, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DebugReportCallbackEXT & operator=( DebugReportCallbackEXT const & ) = delete; - DebugReportCallbackEXT & operator =( DebugReportCallbackEXT && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_instance = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ); - m_callback = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_callback, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_callback; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_callback ) - { - getDispatcher()->vkDestroyDebugReportCallbackEXT( static_cast( m_instance ), - static_cast( m_callback ), - reinterpret_cast( m_allocator ) ); - } - m_instance = nullptr; - m_callback = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Instance getInstance() const - { - return m_instance; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DebugReportCallbackEXT & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_instance, rhs.m_instance ); - std::swap( m_callback, rhs.m_callback ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Instance m_instance = {}; - VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT m_callback = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class DebugUtilsMessengerEXT - { - public: - using CType = VkDebugUtilsMessengerEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDebugUtilsMessengerEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - DebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateDebugUtilsMessengerEXT( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_messenger ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDebugUtilsMessengerEXT" ); - } - } - - DebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VkDebugUtilsMessengerEXT messenger, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_messenger( messenger ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - } - - DebugUtilsMessengerEXT( std::nullptr_t ) {} - - ~DebugUtilsMessengerEXT() - { - clear(); - } - - DebugUtilsMessengerEXT() = delete; - DebugUtilsMessengerEXT( DebugUtilsMessengerEXT const & ) = delete; - DebugUtilsMessengerEXT( DebugUtilsMessengerEXT && rhs ) VULKAN_HPP_NOEXCEPT - : m_instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ) ) - , m_messenger( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_messenger, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DebugUtilsMessengerEXT & operator=( DebugUtilsMessengerEXT const & ) = delete; - DebugUtilsMessengerEXT & operator =( DebugUtilsMessengerEXT && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_instance = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ); - m_messenger = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_messenger, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_messenger; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_messenger ) - { - getDispatcher()->vkDestroyDebugUtilsMessengerEXT( static_cast( m_instance ), - static_cast( m_messenger ), - reinterpret_cast( m_allocator ) ); - } - m_instance = nullptr; - m_messenger = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Instance getInstance() const - { - return m_instance; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DebugUtilsMessengerEXT & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_instance, rhs.m_instance ); - std::swap( m_messenger, rhs.m_messenger ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Instance m_instance = {}; - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT m_messenger = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class DeferredOperationKHR - { - public: - using CType = VkDeferredOperationKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeferredOperationKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - DeferredOperationKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateDeferredOperationKHR( static_cast( *device ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_operation ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDeferredOperationKHR" ); - } - } - - DeferredOperationKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkDeferredOperationKHR operation, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_operation( operation ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - DeferredOperationKHR( std::nullptr_t ) {} - - ~DeferredOperationKHR() - { - clear(); - } - - DeferredOperationKHR() = delete; - DeferredOperationKHR( DeferredOperationKHR const & ) = delete; - DeferredOperationKHR( DeferredOperationKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_operation( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_operation, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DeferredOperationKHR & operator=( DeferredOperationKHR const & ) = delete; - DeferredOperationKHR & operator =( DeferredOperationKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_operation = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_operation, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DeferredOperationKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_operation; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_operation ) - { - getDispatcher()->vkDestroyDeferredOperationKHR( static_cast( m_device ), - static_cast( m_operation ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_operation = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeferredOperationKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_operation, rhs.m_operation ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_deferred_host_operations === - - VULKAN_HPP_NODISCARD uint32_t getMaxConcurrency() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getResult() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result join() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DeferredOperationKHR m_operation = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DescriptorPool - { - public: - using CType = VkDescriptorPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorPool; - - public: - DescriptorPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateDescriptorPool( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_descriptorPool ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDescriptorPool" ); - } - } - - DescriptorPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkDescriptorPool descriptorPool, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_descriptorPool( descriptorPool ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - DescriptorPool( std::nullptr_t ) {} - - ~DescriptorPool() - { - clear(); - } - - DescriptorPool() = delete; - DescriptorPool( DescriptorPool const & ) = delete; - DescriptorPool( DescriptorPool && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_descriptorPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorPool, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DescriptorPool & operator=( DescriptorPool const & ) = delete; - DescriptorPool & operator =( DescriptorPool && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_descriptorPool = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorPool, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DescriptorPool const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorPool; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_descriptorPool ) - { - getDispatcher()->vkDestroyDescriptorPool( static_cast( m_device ), - static_cast( m_descriptorPool ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_descriptorPool = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DescriptorPool & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_descriptorPool, rhs.m_descriptorPool ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void reset( VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DescriptorPool m_descriptorPool = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DescriptorSet - { - public: - using CType = VkDescriptorSet; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSet; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSet; - - public: - DescriptorSet( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, VkDescriptorSet descriptorSet, VkDescriptorPool descriptorPool ) - : m_device( *device ), m_descriptorPool( descriptorPool ), m_descriptorSet( descriptorSet ), m_dispatcher( device.getDispatcher() ) - { - } - - DescriptorSet( std::nullptr_t ) {} - - ~DescriptorSet() - { - clear(); - } - - DescriptorSet() = delete; - DescriptorSet( DescriptorSet const & ) = delete; - DescriptorSet( DescriptorSet && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_descriptorPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorPool, {} ) ) - , m_descriptorSet( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorSet, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DescriptorSet & operator=( DescriptorSet const & ) = delete; - DescriptorSet & operator =( DescriptorSet && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_descriptorPool = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorPool, {} ); - m_descriptorSet = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorSet, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DescriptorSet const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSet; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_descriptorSet ) - { - getDispatcher()->vkFreeDescriptorSets( static_cast( m_device ), - static_cast( m_descriptorPool ), - 1, - reinterpret_cast( &m_descriptorSet ) ); - } - m_device = nullptr; - m_descriptorPool = nullptr; - m_descriptorSet = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DescriptorSet & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_descriptorPool, rhs.m_descriptorPool ); - std::swap( m_descriptorSet, rhs.m_descriptorSet ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_1 === - - template - void updateWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, DataType const & data ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_descriptor_update_template === - - template - void updateWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, DataType const & data ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_VALVE_descriptor_set_host_mapping === - - VULKAN_HPP_NODISCARD void * getHostMappingVALVE() const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DescriptorPool m_descriptorPool = {}; - VULKAN_HPP_NAMESPACE::DescriptorSet m_descriptorSet = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DescriptorSets : public std::vector - { - public: - DescriptorSets( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo const & allocateInfo ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector descriptorSets( allocateInfo.descriptorSetCount ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkAllocateDescriptorSets( - static_cast( *device ), reinterpret_cast( &allocateInfo ), descriptorSets.data() ) ); - if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - this->reserve( allocateInfo.descriptorSetCount ); - for ( auto const & descriptorSet : descriptorSets ) - { - this->emplace_back( device, descriptorSet, static_cast( allocateInfo.descriptorPool ) ); - } - } - else - { - throwResultException( result, "vkAllocateDescriptorSets" ); - } - } - - DescriptorSets( std::nullptr_t ) {} - - DescriptorSets() = delete; - DescriptorSets( DescriptorSets const & ) = delete; - DescriptorSets( DescriptorSets && rhs ) = default; - DescriptorSets & operator=( DescriptorSets const & ) = delete; - DescriptorSets & operator=( DescriptorSets && rhs ) = default; - }; - - class DescriptorSetLayout - { - public: - using CType = VkDescriptorSetLayout; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorSetLayout; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorSetLayout; - - public: - DescriptorSetLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateDescriptorSetLayout( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_descriptorSetLayout ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDescriptorSetLayout" ); - } - } - - DescriptorSetLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkDescriptorSetLayout descriptorSetLayout, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_descriptorSetLayout( descriptorSetLayout ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - DescriptorSetLayout( std::nullptr_t ) {} - - ~DescriptorSetLayout() - { - clear(); - } - - DescriptorSetLayout() = delete; - DescriptorSetLayout( DescriptorSetLayout const & ) = delete; - DescriptorSetLayout( DescriptorSetLayout && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_descriptorSetLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorSetLayout, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DescriptorSetLayout & operator=( DescriptorSetLayout const & ) = delete; - DescriptorSetLayout & operator =( DescriptorSetLayout && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_descriptorSetLayout = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorSetLayout, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DescriptorSetLayout const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorSetLayout; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_descriptorSetLayout ) - { - getDispatcher()->vkDestroyDescriptorSetLayout( static_cast( m_device ), - static_cast( m_descriptorSetLayout ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_descriptorSetLayout = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DescriptorSetLayout & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_descriptorSetLayout, rhs.m_descriptorSetLayout ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DescriptorSetLayout m_descriptorSetLayout = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DescriptorUpdateTemplate - { - public: - using CType = VkDescriptorUpdateTemplate; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDescriptorUpdateTemplate; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDescriptorUpdateTemplate; - - public: - DescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateDescriptorUpdateTemplate( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_descriptorUpdateTemplate ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDescriptorUpdateTemplate" ); - } - } - - DescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkDescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_descriptorUpdateTemplate( descriptorUpdateTemplate ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - DescriptorUpdateTemplate( std::nullptr_t ) {} - - ~DescriptorUpdateTemplate() - { - clear(); - } - - DescriptorUpdateTemplate() = delete; - DescriptorUpdateTemplate( DescriptorUpdateTemplate const & ) = delete; - DescriptorUpdateTemplate( DescriptorUpdateTemplate && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_descriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorUpdateTemplate, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DescriptorUpdateTemplate & operator=( DescriptorUpdateTemplate const & ) = delete; - DescriptorUpdateTemplate & operator =( DescriptorUpdateTemplate && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_descriptorUpdateTemplate = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_descriptorUpdateTemplate, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_descriptorUpdateTemplate; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_descriptorUpdateTemplate ) - { - getDispatcher()->vkDestroyDescriptorUpdateTemplate( static_cast( m_device ), - static_cast( m_descriptorUpdateTemplate ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_descriptorUpdateTemplate = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_descriptorUpdateTemplate, rhs.m_descriptorUpdateTemplate ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate m_descriptorUpdateTemplate = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DeviceMemory - { - public: - using CType = VkDeviceMemory; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDeviceMemory; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDeviceMemory; - - public: - DeviceMemory( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::MemoryAllocateInfo const & allocateInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkAllocateMemory( static_cast( *device ), - reinterpret_cast( &allocateInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_memory ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkAllocateMemory" ); - } - } - - DeviceMemory( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkDeviceMemory memory, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_memory( memory ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - DeviceMemory( std::nullptr_t ) {} - - ~DeviceMemory() - { - clear(); - } - - DeviceMemory() = delete; - DeviceMemory( DeviceMemory const & ) = delete; - DeviceMemory( DeviceMemory && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_memory( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_memory, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DeviceMemory & operator=( DeviceMemory const & ) = delete; - DeviceMemory & operator =( DeviceMemory && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_memory = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_memory, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DeviceMemory const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_memory; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_memory ) - { - getDispatcher()->vkFreeMemory( - static_cast( m_device ), static_cast( m_memory ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_memory = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceMemory & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_memory, rhs.m_memory ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD void * mapMemory( VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - void unmapMemory() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceSize getCommitment() const VULKAN_HPP_NOEXCEPT; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - - VULKAN_HPP_NODISCARD HANDLE getMemoryWin32HandleNV( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType ) const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_pageable_device_local_memory === - - void setPriorityEXT( float priority ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory m_memory = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class DisplayKHR - { - public: - using CType = VkDisplayKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayKHR; - - public: - DisplayKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, int32_t drmFd, uint32_t connectorId ) - : m_physicalDevice( *physicalDevice ), m_dispatcher( physicalDevice.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( physicalDevice.getDispatcher()->vkGetDrmDisplayEXT( - static_cast( *physicalDevice ), drmFd, connectorId, reinterpret_cast( &m_display ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkGetDrmDisplayEXT" ); - } - } - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - DisplayKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, Display & dpy, RROutput rrOutput ) - : m_physicalDevice( *physicalDevice ), m_dispatcher( physicalDevice.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( physicalDevice.getDispatcher()->vkGetRandROutputDisplayEXT( - static_cast( *physicalDevice ), &dpy, rrOutput, reinterpret_cast( &m_display ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkGetRandROutputDisplayEXT" ); - } - } -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - DisplayKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, uint32_t deviceRelativeId ) - : m_physicalDevice( *physicalDevice ), m_dispatcher( physicalDevice.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( physicalDevice.getDispatcher()->vkGetWinrtDisplayNV( - static_cast( *physicalDevice ), deviceRelativeId, reinterpret_cast( &m_display ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkGetWinrtDisplayNV" ); - } - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - DisplayKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, VkDisplayKHR display ) - : m_physicalDevice( *physicalDevice ), m_display( display ), m_dispatcher( physicalDevice.getDispatcher() ) - { - } - - DisplayKHR( std::nullptr_t ) {} - - ~DisplayKHR() - { - clear(); - } - - DisplayKHR() = delete; - DisplayKHR( DisplayKHR const & ) = delete; - DisplayKHR( DisplayKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_physicalDevice( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ) ) - , m_display( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_display, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DisplayKHR & operator=( DisplayKHR const & ) = delete; - DisplayKHR & operator =( DisplayKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_physicalDevice = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ); - m_display = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_display, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DisplayKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_display; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_display ) - { - getDispatcher()->vkReleaseDisplayEXT( static_cast( m_physicalDevice ), static_cast( m_display ) ); - } - m_physicalDevice = nullptr; - m_display = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::PhysicalDevice getPhysicalDevice() const - { - return m_physicalDevice; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_physicalDevice, rhs.m_physicalDevice ); - std::swap( m_display, rhs.m_display ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_display === - - VULKAN_HPP_NODISCARD std::vector getModeProperties() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_RAII_NAMESPACE::DisplayModeKHR - createMode( VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) const; - - //=== VK_KHR_get_display_properties2 === - - VULKAN_HPP_NODISCARD std::vector getModeProperties2() const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - - void acquireWinrtNV() const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - private: - VULKAN_HPP_NAMESPACE::PhysicalDevice m_physicalDevice = {}; - VULKAN_HPP_NAMESPACE::DisplayKHR m_display = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class DisplayKHRs : public std::vector - { - public: - DisplayKHRs( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PhysicalDevice const & physicalDevice, uint32_t planeIndex ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * dispatcher = physicalDevice.getDispatcher(); - std::vector displays; - uint32_t displayCount; - VULKAN_HPP_NAMESPACE::Result result; - do - { - result = static_cast( - dispatcher->vkGetDisplayPlaneSupportedDisplaysKHR( static_cast( *physicalDevice ), planeIndex, &displayCount, nullptr ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) && displayCount ) - { - displays.resize( displayCount ); - result = static_cast( dispatcher->vkGetDisplayPlaneSupportedDisplaysKHR( - static_cast( *physicalDevice ), planeIndex, &displayCount, displays.data() ) ); - } - } while ( result == VULKAN_HPP_NAMESPACE::Result::eIncomplete ); - if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - VULKAN_HPP_ASSERT( displayCount <= displays.size() ); - this->reserve( displayCount ); - for ( auto const & displayKHR : displays ) - { - this->emplace_back( physicalDevice, displayKHR ); - } - } - else - { - throwResultException( result, "vkGetDisplayPlaneSupportedDisplaysKHR" ); - } - } - - DisplayKHRs( std::nullptr_t ) {} - - DisplayKHRs() = delete; - DisplayKHRs( DisplayKHRs const & ) = delete; - DisplayKHRs( DisplayKHRs && rhs ) = default; - DisplayKHRs & operator=( DisplayKHRs const & ) = delete; - DisplayKHRs & operator=( DisplayKHRs && rhs ) = default; - }; - - class DisplayModeKHR - { - public: - using CType = VkDisplayModeKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eDisplayModeKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eDisplayModeKHR; - - public: - DisplayModeKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR const & display, - VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_physicalDevice( display.getPhysicalDevice() ), m_dispatcher( display.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( display.getDispatcher()->vkCreateDisplayModeKHR( - static_cast( display.getPhysicalDevice() ), - static_cast( *display ), - reinterpret_cast( &createInfo ), - reinterpret_cast( static_cast( allocator ) ), - reinterpret_cast( &m_displayModeKHR ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDisplayModeKHR" ); - } - } - - DisplayModeKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR const & display, VkDisplayModeKHR displayModeKHR ) - : m_physicalDevice( display.getPhysicalDevice() ), m_displayModeKHR( displayModeKHR ), m_dispatcher( display.getDispatcher() ) - { - } - - DisplayModeKHR( std::nullptr_t ) {} - - ~DisplayModeKHR() - { - clear(); - } - - DisplayModeKHR() = delete; - DisplayModeKHR( DisplayModeKHR const & rhs ) : m_displayModeKHR( rhs.m_displayModeKHR ), m_dispatcher( rhs.m_dispatcher ) {} - DisplayModeKHR( DisplayModeKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_physicalDevice( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ) ) - , m_displayModeKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_displayModeKHR, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - DisplayModeKHR & operator=( DisplayModeKHR const & rhs ) - { - m_displayModeKHR = rhs.m_displayModeKHR; - m_dispatcher = rhs.m_dispatcher; - return *this; - } - DisplayModeKHR & operator=( DisplayModeKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - m_physicalDevice = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_physicalDevice, {} ); - m_displayModeKHR = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_displayModeKHR, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::DisplayModeKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_displayModeKHR; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - m_physicalDevice = nullptr; - m_displayModeKHR = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayModeKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_physicalDevice, rhs.m_physicalDevice ); - std::swap( m_displayModeKHR, rhs.m_displayModeKHR ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_display === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR getDisplayPlaneCapabilities( uint32_t planeIndex ) const; - - private: - VULKAN_HPP_NAMESPACE::PhysicalDevice m_physicalDevice = {}; - VULKAN_HPP_NAMESPACE::DisplayModeKHR m_displayModeKHR = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class Event - { - public: - using CType = VkEvent; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eEvent; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eEvent; - - public: - Event( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::EventCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateEvent( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_event ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateEvent" ); - } - } - - Event( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkEvent event, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_event( event ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Event( std::nullptr_t ) {} - - ~Event() - { - clear(); - } - - Event() = delete; - Event( Event const & ) = delete; - Event( Event && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_event( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_event, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Event & operator=( Event const & ) = delete; - Event & operator =( Event && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_event = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_event, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Event const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_event; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_event ) - { - getDispatcher()->vkDestroyEvent( - static_cast( m_device ), static_cast( m_event ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_event = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Event & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_event, rhs.m_event ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getStatus() const; - - void set() const; - - void reset() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Event m_event = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Fence - { - public: - using CType = VkFence; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFence; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFence; - - public: - Fence( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::FenceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateFence( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_fence ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateFence" ); - } - } - - Fence( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT const & deviceEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkRegisterDeviceEventEXT( static_cast( *device ), - reinterpret_cast( &deviceEventInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_fence ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkRegisterDeviceEventEXT" ); - } - } - - Fence( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR const & display, - VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT const & displayEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkRegisterDisplayEventEXT( static_cast( *device ), - static_cast( *display ), - reinterpret_cast( &displayEventInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_fence ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkRegisterDisplayEventEXT" ); - } - } - - Fence( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkFence fence, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_fence( fence ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Fence( std::nullptr_t ) {} - - ~Fence() - { - clear(); - } - - Fence() = delete; - Fence( Fence const & ) = delete; - Fence( Fence && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_fence( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_fence, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Fence & operator=( Fence const & ) = delete; - Fence & operator =( Fence && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_fence = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_fence, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Fence const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_fence; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_fence ) - { - getDispatcher()->vkDestroyFence( - static_cast( m_device ), static_cast( m_fence ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_fence = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Fence & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_fence, rhs.m_fence ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getStatus() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Fence m_fence = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Framebuffer - { - public: - using CType = VkFramebuffer; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eFramebuffer; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eFramebuffer; - - public: - Framebuffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::FramebufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateFramebuffer( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_framebuffer ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateFramebuffer" ); - } - } - - Framebuffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkFramebuffer framebuffer, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_framebuffer( framebuffer ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Framebuffer( std::nullptr_t ) {} - - ~Framebuffer() - { - clear(); - } - - Framebuffer() = delete; - Framebuffer( Framebuffer const & ) = delete; - Framebuffer( Framebuffer && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_framebuffer( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_framebuffer, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Framebuffer & operator=( Framebuffer const & ) = delete; - Framebuffer & operator =( Framebuffer && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_framebuffer = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_framebuffer, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Framebuffer const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_framebuffer; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_framebuffer ) - { - getDispatcher()->vkDestroyFramebuffer( - static_cast( m_device ), static_cast( m_framebuffer ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_framebuffer = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Framebuffer & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_framebuffer, rhs.m_framebuffer ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_QCOM_tile_properties === - - VULKAN_HPP_NODISCARD std::vector getTilePropertiesQCOM() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Framebuffer m_framebuffer = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Image - { - public: - using CType = VkImage; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImage; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImage; - - public: - Image( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::ImageCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateImage( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_image ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateImage" ); - } - } - - Image( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkImage image, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_image( image ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Image( std::nullptr_t ) {} - - ~Image() - { - clear(); - } - - Image() = delete; - Image( Image const & ) = delete; - Image( Image && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_image( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_image, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Image & operator=( Image const & ) = delete; - Image & operator =( Image && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_image = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_image, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Image const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_image; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_image ) - { - getDispatcher()->vkDestroyImage( - static_cast( m_device ), static_cast( m_image ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_image = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Image & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_image, rhs.m_image ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void bindMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::MemoryRequirements getMemoryRequirements() const VULKAN_HPP_NOEXCEPT; - - VULKAN_HPP_NODISCARD std::vector getSparseMemoryRequirements() const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SubresourceLayout - getSubresourceLayout( const VULKAN_HPP_NAMESPACE::ImageSubresource & subresource ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_image_drm_format_modifier === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT getDrmFormatModifierPropertiesEXT() const; - - //=== VK_EXT_image_compression_control === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT - getSubresourceLayout2EXT( const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource ) const VULKAN_HPP_NOEXCEPT; - - template - VULKAN_HPP_NODISCARD StructureChain - getSubresourceLayout2EXT( const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Image m_image = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class ImageView - { - public: - using CType = VkImageView; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eImageView; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eImageView; - - public: - ImageView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::ImageViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateImageView( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_imageView ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateImageView" ); - } - } - - ImageView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkImageView imageView, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_imageView( imageView ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - ImageView( std::nullptr_t ) {} - - ~ImageView() - { - clear(); - } - - ImageView() = delete; - ImageView( ImageView const & ) = delete; - ImageView( ImageView && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_imageView( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_imageView, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - ImageView & operator=( ImageView const & ) = delete; - ImageView & operator =( ImageView && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_imageView = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_imageView, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::ImageView const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_imageView; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_imageView ) - { - getDispatcher()->vkDestroyImageView( - static_cast( m_device ), static_cast( m_imageView ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_imageView = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ImageView & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_imageView, rhs.m_imageView ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_NVX_image_view_handle === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX getAddressNVX() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::ImageView m_imageView = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class IndirectCommandsLayoutNV - { - public: - using CType = VkIndirectCommandsLayoutNV; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eIndirectCommandsLayoutNV; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - IndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateIndirectCommandsLayoutNV( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_indirectCommandsLayout ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateIndirectCommandsLayoutNV" ); - } - } - - IndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkIndirectCommandsLayoutNV indirectCommandsLayout, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_indirectCommandsLayout( indirectCommandsLayout ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - IndirectCommandsLayoutNV( std::nullptr_t ) {} - - ~IndirectCommandsLayoutNV() - { - clear(); - } - - IndirectCommandsLayoutNV() = delete; - IndirectCommandsLayoutNV( IndirectCommandsLayoutNV const & ) = delete; - IndirectCommandsLayoutNV( IndirectCommandsLayoutNV && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_indirectCommandsLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_indirectCommandsLayout, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - IndirectCommandsLayoutNV & operator=( IndirectCommandsLayoutNV const & ) = delete; - IndirectCommandsLayoutNV & operator =( IndirectCommandsLayoutNV && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_indirectCommandsLayout = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_indirectCommandsLayout, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_indirectCommandsLayout; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_indirectCommandsLayout ) - { - getDispatcher()->vkDestroyIndirectCommandsLayoutNV( static_cast( m_device ), - static_cast( m_indirectCommandsLayout ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_indirectCommandsLayout = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::IndirectCommandsLayoutNV & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_indirectCommandsLayout, rhs.m_indirectCommandsLayout ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV m_indirectCommandsLayout = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class PerformanceConfigurationINTEL - { - public: - using CType = VkPerformanceConfigurationINTEL; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePerformanceConfigurationINTEL; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - PerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL const & acquireInfo ) - : m_device( *device ), m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkAcquirePerformanceConfigurationINTEL( static_cast( *device ), - reinterpret_cast( &acquireInfo ), - reinterpret_cast( &m_configuration ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkAcquirePerformanceConfigurationINTEL" ); - } - } - - PerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, VkPerformanceConfigurationINTEL configuration ) - : m_device( *device ), m_configuration( configuration ), m_dispatcher( device.getDispatcher() ) - { - } - - PerformanceConfigurationINTEL( std::nullptr_t ) {} - - ~PerformanceConfigurationINTEL() - { - clear(); - } - - PerformanceConfigurationINTEL() = delete; - PerformanceConfigurationINTEL( PerformanceConfigurationINTEL const & ) = delete; - PerformanceConfigurationINTEL( PerformanceConfigurationINTEL && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_configuration( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_configuration, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - PerformanceConfigurationINTEL & operator=( PerformanceConfigurationINTEL const & ) = delete; - PerformanceConfigurationINTEL & operator =( PerformanceConfigurationINTEL && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_configuration = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_configuration, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_configuration; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_configuration ) - { - getDispatcher()->vkReleasePerformanceConfigurationINTEL( static_cast( m_device ), - static_cast( m_configuration ) ); - } - m_device = nullptr; - m_configuration = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PerformanceConfigurationINTEL & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_configuration, rhs.m_configuration ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL m_configuration = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class PipelineCache - { - public: - using CType = VkPipelineCache; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineCache; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineCache; - - public: - PipelineCache( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreatePipelineCache( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipelineCache ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreatePipelineCache" ); - } - } - - PipelineCache( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkPipelineCache pipelineCache, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_pipelineCache( pipelineCache ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - PipelineCache( std::nullptr_t ) {} - - ~PipelineCache() - { - clear(); - } - - PipelineCache() = delete; - PipelineCache( PipelineCache const & ) = delete; - PipelineCache( PipelineCache && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_pipelineCache( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipelineCache, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - PipelineCache & operator=( PipelineCache const & ) = delete; - PipelineCache & operator =( PipelineCache && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_pipelineCache = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipelineCache, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::PipelineCache const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineCache; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_pipelineCache ) - { - getDispatcher()->vkDestroyPipelineCache( static_cast( m_device ), - static_cast( m_pipelineCache ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_pipelineCache = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PipelineCache & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_pipelineCache, rhs.m_pipelineCache ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD std::vector getData() const; - - void merge( ArrayProxy const & srcCaches ) const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::PipelineCache m_pipelineCache = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Pipeline - { - public: - using CType = VkPipeline; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipeline; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipeline; - - public: - Pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - m_constructorSuccessCode = static_cast( - getDispatcher()->vkCreateComputePipelines( static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipeline ) ) ); - if ( ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eSuccess ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - throwResultException( m_constructorSuccessCode, "vkCreateComputePipelines" ); - } - } - - Pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - m_constructorSuccessCode = static_cast( - getDispatcher()->vkCreateGraphicsPipelines( static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipeline ) ) ); - if ( ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eSuccess ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - throwResultException( m_constructorSuccessCode, "vkCreateGraphicsPipelines" ); - } - } - - Pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - m_constructorSuccessCode = static_cast( - getDispatcher()->vkCreateRayTracingPipelinesKHR( static_cast( *device ), - deferredOperation ? static_cast( **deferredOperation ) : 0, - pipelineCache ? static_cast( **pipelineCache ) : 0, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipeline ) ) ); - if ( ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eSuccess ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - throwResultException( m_constructorSuccessCode, "vkCreateRayTracingPipelinesKHR" ); - } - } - - Pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - m_constructorSuccessCode = static_cast( - getDispatcher()->vkCreateRayTracingPipelinesNV( static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - 1, - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipeline ) ) ); - if ( ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::eSuccess ) && - ( m_constructorSuccessCode != VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - throwResultException( m_constructorSuccessCode, "vkCreateRayTracingPipelinesNV" ); - } - } - - Pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkPipeline pipeline, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr, - VULKAN_HPP_NAMESPACE::Result successCode = VULKAN_HPP_NAMESPACE::Result::eSuccess ) - : m_device( *device ) - , m_pipeline( pipeline ) - , m_allocator( static_cast( allocator ) ) - , m_constructorSuccessCode( successCode ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Pipeline( std::nullptr_t ) {} - - ~Pipeline() - { - clear(); - } - - Pipeline() = delete; - Pipeline( Pipeline const & ) = delete; - Pipeline( Pipeline && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_pipeline( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipeline, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Pipeline & operator=( Pipeline const & ) = delete; - Pipeline & operator =( Pipeline && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_pipeline = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipeline, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Pipeline const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_pipeline; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_pipeline ) - { - getDispatcher()->vkDestroyPipeline( - static_cast( m_device ), static_cast( m_pipeline ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_pipeline = nullptr; - m_allocator = nullptr; - m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::Result::eErrorUnknown; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Result getConstructorSuccessCode() const - { - return m_constructorSuccessCode; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Pipeline & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_pipeline, rhs.m_pipeline ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_constructorSuccessCode, rhs.m_constructorSuccessCode ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_AMD_shader_info === - - VULKAN_HPP_NODISCARD std::vector getShaderInfoAMD( VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType ) const; - - //=== VK_NV_ray_tracing === - - template - VULKAN_HPP_NODISCARD std::vector getRayTracingShaderGroupHandlesNV( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const; - - template - VULKAN_HPP_NODISCARD DataType getRayTracingShaderGroupHandleNV( uint32_t firstGroup, uint32_t groupCount ) const; - - void compileDeferredNV( uint32_t shader ) const; - - //=== VK_KHR_ray_tracing_pipeline === - - template - VULKAN_HPP_NODISCARD std::vector getRayTracingShaderGroupHandlesKHR( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const; - - template - VULKAN_HPP_NODISCARD DataType getRayTracingShaderGroupHandleKHR( uint32_t firstGroup, uint32_t groupCount ) const; - - template - VULKAN_HPP_NODISCARD std::vector - getRayTracingCaptureReplayShaderGroupHandlesKHR( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const; - - template - VULKAN_HPP_NODISCARD DataType getRayTracingCaptureReplayShaderGroupHandleKHR( uint32_t firstGroup, uint32_t groupCount ) const; - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::DeviceSize - getRayTracingShaderGroupStackSizeKHR( uint32_t group, VULKAN_HPP_NAMESPACE::ShaderGroupShaderKHR groupShader ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Pipeline m_pipeline = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::Result m_constructorSuccessCode = VULKAN_HPP_NAMESPACE::Result::eErrorUnknown; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Pipelines : public std::vector - { - public: - Pipelines( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector pipelines( createInfos.size() ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkCreateComputePipelines( - static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - pipelines.data() ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) || ( result == VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - this->reserve( createInfos.size() ); - for ( auto const & pipeline : pipelines ) - { - this->emplace_back( device, pipeline, allocator, result ); - } - } - else - { - throwResultException( result, "vkCreateComputePipelines" ); - } - } - - Pipelines( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector pipelines( createInfos.size() ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkCreateGraphicsPipelines( - static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - pipelines.data() ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) || ( result == VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - this->reserve( createInfos.size() ); - for ( auto const & pipeline : pipelines ) - { - this->emplace_back( device, pipeline, allocator, result ); - } - } - else - { - throwResultException( result, "vkCreateGraphicsPipelines" ); - } - } - - Pipelines( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector pipelines( createInfos.size() ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkCreateRayTracingPipelinesKHR( - static_cast( *device ), - deferredOperation ? static_cast( **deferredOperation ) : 0, - pipelineCache ? static_cast( **pipelineCache ) : 0, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - pipelines.data() ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) || ( result == VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR ) || - ( result == VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR ) || ( result == VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - this->reserve( createInfos.size() ); - for ( auto const & pipeline : pipelines ) - { - this->emplace_back( device, pipeline, allocator, result ); - } - } - else - { - throwResultException( result, "vkCreateRayTracingPipelinesKHR" ); - } - } - - Pipelines( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector pipelines( createInfos.size() ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkCreateRayTracingPipelinesNV( - static_cast( *device ), - pipelineCache ? static_cast( **pipelineCache ) : 0, - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - pipelines.data() ) ); - if ( ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) || ( result == VULKAN_HPP_NAMESPACE::Result::ePipelineCompileRequiredEXT ) ) - { - this->reserve( createInfos.size() ); - for ( auto const & pipeline : pipelines ) - { - this->emplace_back( device, pipeline, allocator, result ); - } - } - else - { - throwResultException( result, "vkCreateRayTracingPipelinesNV" ); - } - } - - Pipelines( std::nullptr_t ) {} - - Pipelines() = delete; - Pipelines( Pipelines const & ) = delete; - Pipelines( Pipelines && rhs ) = default; - Pipelines & operator=( Pipelines const & ) = delete; - Pipelines & operator=( Pipelines && rhs ) = default; - }; - - class PipelineLayout - { - public: - using CType = VkPipelineLayout; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePipelineLayout; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::ePipelineLayout; - - public: - PipelineLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreatePipelineLayout( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_pipelineLayout ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreatePipelineLayout" ); - } - } - - PipelineLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkPipelineLayout pipelineLayout, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_pipelineLayout( pipelineLayout ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - PipelineLayout( std::nullptr_t ) {} - - ~PipelineLayout() - { - clear(); - } - - PipelineLayout() = delete; - PipelineLayout( PipelineLayout const & ) = delete; - PipelineLayout( PipelineLayout && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_pipelineLayout( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipelineLayout, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - PipelineLayout & operator=( PipelineLayout const & ) = delete; - PipelineLayout & operator =( PipelineLayout && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_pipelineLayout = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_pipelineLayout, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::PipelineLayout const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_pipelineLayout; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_pipelineLayout ) - { - getDispatcher()->vkDestroyPipelineLayout( static_cast( m_device ), - static_cast( m_pipelineLayout ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_pipelineLayout = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PipelineLayout & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_pipelineLayout, rhs.m_pipelineLayout ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout m_pipelineLayout = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class PrivateDataSlot - { - public: - using CType = VkPrivateDataSlot; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::ePrivateDataSlot; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - PrivateDataSlot( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreatePrivateDataSlot( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_privateDataSlot ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreatePrivateDataSlot" ); - } - } - - PrivateDataSlot( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkPrivateDataSlot privateDataSlot, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_privateDataSlot( privateDataSlot ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - PrivateDataSlot( std::nullptr_t ) {} - - ~PrivateDataSlot() - { - clear(); - } - - PrivateDataSlot() = delete; - PrivateDataSlot( PrivateDataSlot const & ) = delete; - PrivateDataSlot( PrivateDataSlot && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_privateDataSlot( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_privateDataSlot, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - PrivateDataSlot & operator=( PrivateDataSlot const & ) = delete; - PrivateDataSlot & operator =( PrivateDataSlot && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_privateDataSlot = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_privateDataSlot, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::PrivateDataSlot const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_privateDataSlot; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_privateDataSlot ) - { - getDispatcher()->vkDestroyPrivateDataSlot( static_cast( m_device ), - static_cast( m_privateDataSlot ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_privateDataSlot = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_privateDataSlot, rhs.m_privateDataSlot ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::PrivateDataSlot m_privateDataSlot = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class QueryPool - { - public: - using CType = VkQueryPool; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueryPool; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueryPool; - - public: - QueryPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateQueryPool( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_queryPool ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateQueryPool" ); - } - } - - QueryPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkQueryPool queryPool, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_queryPool( queryPool ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - QueryPool( std::nullptr_t ) {} - - ~QueryPool() - { - clear(); - } - - QueryPool() = delete; - QueryPool( QueryPool const & ) = delete; - QueryPool( QueryPool && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_queryPool( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_queryPool, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - QueryPool & operator=( QueryPool const & ) = delete; - QueryPool & operator =( QueryPool && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_queryPool = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_queryPool, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::QueryPool const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_queryPool; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_queryPool ) - { - getDispatcher()->vkDestroyQueryPool( - static_cast( m_device ), static_cast( m_queryPool ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_queryPool = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::QueryPool & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_queryPool, rhs.m_queryPool ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - template - VULKAN_HPP_NODISCARD std::pair> - getResults( uint32_t firstQuery, - uint32_t queryCount, - size_t dataSize, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - template - VULKAN_HPP_NODISCARD std::pair - getResult( uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_VERSION_1_2 === - - void reset( uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_EXT_host_query_reset === - - void resetEXT( uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::QueryPool m_queryPool = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Queue - { - public: - using CType = VkQueue; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eQueue; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eQueue; - - public: - Queue( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, uint32_t queueFamilyIndex, uint32_t queueIndex ) - : m_dispatcher( device.getDispatcher() ) - { - getDispatcher()->vkGetDeviceQueue( static_cast( *device ), queueFamilyIndex, queueIndex, reinterpret_cast( &m_queue ) ); - } - - Queue( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 const & queueInfo ) - : m_dispatcher( device.getDispatcher() ) - { - getDispatcher()->vkGetDeviceQueue2( - static_cast( *device ), reinterpret_cast( &queueInfo ), reinterpret_cast( &m_queue ) ); - } - - Queue( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, VkQueue queue ) : m_queue( queue ), m_dispatcher( device.getDispatcher() ) - { - } - - Queue( std::nullptr_t ) {} - - ~Queue() - { - clear(); - } - - Queue() = delete; - Queue( Queue const & rhs ) : m_queue( rhs.m_queue ), m_dispatcher( rhs.m_dispatcher ) {} - Queue( Queue && rhs ) VULKAN_HPP_NOEXCEPT - : m_queue( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_queue, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Queue & operator=( Queue const & rhs ) - { - m_queue = rhs.m_queue; - m_dispatcher = rhs.m_dispatcher; - return *this; - } - Queue & operator=( Queue && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - m_queue = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_queue, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Queue const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_queue; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - m_queue = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Queue & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_queue, rhs.m_queue ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - void submit( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - void waitIdle() const; - - void bindSparse( ArrayProxy const & bindInfo, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_VERSION_1_3 === - - void submit2( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_KHR_swapchain === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR & presentInfo ) const; - - //=== VK_EXT_debug_utils === - - void beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT; - - void endDebugUtilsLabelEXT() const VULKAN_HPP_NOEXCEPT; - - void insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_NV_device_diagnostic_checkpoints === - - VULKAN_HPP_NODISCARD std::vector getCheckpointDataNV() const; - - //=== VK_INTEL_performance_query === - - void setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration ) const; - - //=== VK_KHR_synchronization2 === - - void submit2KHR( ArrayProxy const & submits, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - VULKAN_HPP_NODISCARD std::vector getCheckpointData2NV() const; - - private: - VULKAN_HPP_NAMESPACE::Queue m_queue = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class RenderPass - { - public: - using CType = VkRenderPass; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eRenderPass; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eRenderPass; - - public: - RenderPass( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::RenderPassCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateRenderPass( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_renderPass ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateRenderPass" ); - } - } - - RenderPass( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateRenderPass2( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_renderPass ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateRenderPass2" ); - } - } - - RenderPass( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkRenderPass renderPass, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_renderPass( renderPass ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - RenderPass( std::nullptr_t ) {} - - ~RenderPass() - { - clear(); - } - - RenderPass() = delete; - RenderPass( RenderPass const & ) = delete; - RenderPass( RenderPass && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_renderPass( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_renderPass, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - RenderPass & operator=( RenderPass const & ) = delete; - RenderPass & operator =( RenderPass && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_renderPass = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_renderPass, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::RenderPass const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_renderPass; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_renderPass ) - { - getDispatcher()->vkDestroyRenderPass( - static_cast( m_device ), static_cast( m_renderPass ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_renderPass = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::RenderPass & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_renderPass, rhs.m_renderPass ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Extent2D getRenderAreaGranularity() const VULKAN_HPP_NOEXCEPT; - - //=== VK_HUAWEI_subpass_shading === - - VULKAN_HPP_NODISCARD std::pair getSubpassShadingMaxWorkgroupSizeHUAWEI() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::RenderPass m_renderPass = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Sampler - { - public: - using CType = VkSampler; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSampler; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSampler; - - public: - Sampler( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::SamplerCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateSampler( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_sampler ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateSampler" ); - } - } - - Sampler( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkSampler sampler, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_sampler( sampler ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Sampler( std::nullptr_t ) {} - - ~Sampler() - { - clear(); - } - - Sampler() = delete; - Sampler( Sampler const & ) = delete; - Sampler( Sampler && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_sampler( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_sampler, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Sampler & operator=( Sampler const & ) = delete; - Sampler & operator =( Sampler && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_sampler = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_sampler, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Sampler const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_sampler; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_sampler ) - { - getDispatcher()->vkDestroySampler( - static_cast( m_device ), static_cast( m_sampler ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_sampler = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Sampler & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_sampler, rhs.m_sampler ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Sampler m_sampler = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class SamplerYcbcrConversion - { - public: - using CType = VkSamplerYcbcrConversion; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSamplerYcbcrConversion; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSamplerYcbcrConversion; - - public: - SamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateSamplerYcbcrConversion( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_ycbcrConversion ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateSamplerYcbcrConversion" ); - } - } - - SamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkSamplerYcbcrConversion ycbcrConversion, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_ycbcrConversion( ycbcrConversion ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - SamplerYcbcrConversion( std::nullptr_t ) {} - - ~SamplerYcbcrConversion() - { - clear(); - } - - SamplerYcbcrConversion() = delete; - SamplerYcbcrConversion( SamplerYcbcrConversion const & ) = delete; - SamplerYcbcrConversion( SamplerYcbcrConversion && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_ycbcrConversion( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_ycbcrConversion, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - SamplerYcbcrConversion & operator=( SamplerYcbcrConversion const & ) = delete; - SamplerYcbcrConversion & operator =( SamplerYcbcrConversion && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_ycbcrConversion = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_ycbcrConversion, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_ycbcrConversion; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_ycbcrConversion ) - { - getDispatcher()->vkDestroySamplerYcbcrConversion( static_cast( m_device ), - static_cast( m_ycbcrConversion ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_ycbcrConversion = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_ycbcrConversion, rhs.m_ycbcrConversion ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion m_ycbcrConversion = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class Semaphore - { - public: - using CType = VkSemaphore; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSemaphore; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSemaphore; - - public: - Semaphore( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = - static_cast( device.getDispatcher()->vkCreateSemaphore( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_semaphore ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateSemaphore" ); - } - } - - Semaphore( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkSemaphore semaphore, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_semaphore( semaphore ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - Semaphore( std::nullptr_t ) {} - - ~Semaphore() - { - clear(); - } - - Semaphore() = delete; - Semaphore( Semaphore const & ) = delete; - Semaphore( Semaphore && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_semaphore( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_semaphore, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - Semaphore & operator=( Semaphore const & ) = delete; - Semaphore & operator =( Semaphore && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_semaphore = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_semaphore, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::Semaphore const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_semaphore; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_semaphore ) - { - getDispatcher()->vkDestroySemaphore( - static_cast( m_device ), static_cast( m_semaphore ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_semaphore = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Semaphore & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_semaphore, rhs.m_semaphore ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_VERSION_1_2 === - - VULKAN_HPP_NODISCARD uint64_t getCounterValue() const; - - //=== VK_KHR_timeline_semaphore === - - VULKAN_HPP_NODISCARD uint64_t getCounterValueKHR() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::Semaphore m_semaphore = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class ShaderModule - { - public: - using CType = VkShaderModule; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eShaderModule; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eShaderModule; - - public: - ShaderModule( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateShaderModule( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_shaderModule ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateShaderModule" ); - } - } - - ShaderModule( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkShaderModule shaderModule, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_shaderModule( shaderModule ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - ShaderModule( std::nullptr_t ) {} - - ~ShaderModule() - { - clear(); - } - - ShaderModule() = delete; - ShaderModule( ShaderModule const & ) = delete; - ShaderModule( ShaderModule && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_shaderModule( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_shaderModule, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - ShaderModule & operator=( ShaderModule const & ) = delete; - ShaderModule & operator =( ShaderModule && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_shaderModule = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_shaderModule, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::ShaderModule const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_shaderModule; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_shaderModule ) - { - getDispatcher()->vkDestroyShaderModule( - static_cast( m_device ), static_cast( m_shaderModule ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_shaderModule = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ShaderModule & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_shaderModule, rhs.m_shaderModule ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_EXT_shader_module_identifier === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT getIdentifierEXT() const VULKAN_HPP_NOEXCEPT; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::ShaderModule m_shaderModule = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class SurfaceKHR - { - public: - using CType = VkSurfaceKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSurfaceKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSurfaceKHR; - - public: -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateAndroidSurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateAndroidSurfaceKHR" ); - } - } -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateDirectFBSurfaceEXT( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDirectFBSurfaceEXT" ); - } - } -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateDisplayPlaneSurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateDisplayPlaneSurfaceKHR" ); - } - } - - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateHeadlessSurfaceEXT( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateHeadlessSurfaceEXT" ); - } - } - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateIOSSurfaceMVK( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateIOSSurfaceMVK" ); - } - } -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateImagePipeSurfaceFUCHSIA( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateImagePipeSurfaceFUCHSIA" ); - } - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateMacOSSurfaceMVK( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateMacOSSurfaceMVK" ); - } - } -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateMetalSurfaceEXT( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateMetalSurfaceEXT" ); - } - } -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateScreenSurfaceQNX( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateScreenSurfaceQNX" ); - } - } -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - -# if defined( VK_USE_PLATFORM_GGP ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateStreamDescriptorSurfaceGGP( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateStreamDescriptorSurfaceGGP" ); - } - } -# endif /*VK_USE_PLATFORM_GGP*/ - -# if defined( VK_USE_PLATFORM_VI_NN ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateViSurfaceNN( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateViSurfaceNN" ); - } - } -# endif /*VK_USE_PLATFORM_VI_NN*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateWaylandSurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateWaylandSurfaceKHR" ); - } - } -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateWin32SurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateWin32SurfaceKHR" ); - } - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateXcbSurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateXcbSurfaceKHR" ); - } - } -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - instance.getDispatcher()->vkCreateXlibSurfaceKHR( static_cast( *instance ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_surface ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateXlibSurfaceKHR" ); - } - } -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - - SurfaceKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Instance const & instance, - VkSurfaceKHR surface, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_instance( *instance ) - , m_surface( surface ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( instance.getDispatcher() ) - { - } - - SurfaceKHR( std::nullptr_t ) {} - - ~SurfaceKHR() - { - clear(); - } - - SurfaceKHR() = delete; - SurfaceKHR( SurfaceKHR const & ) = delete; - SurfaceKHR( SurfaceKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_instance( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ) ) - , m_surface( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_surface, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - SurfaceKHR & operator=( SurfaceKHR const & ) = delete; - SurfaceKHR & operator =( SurfaceKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_instance = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_instance, {} ); - m_surface = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_surface, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::SurfaceKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_surface; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_surface ) - { - getDispatcher()->vkDestroySurfaceKHR( - static_cast( m_instance ), static_cast( m_surface ), reinterpret_cast( m_allocator ) ); - } - m_instance = nullptr; - m_surface = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Instance getInstance() const - { - return m_instance; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_instance, rhs.m_instance ); - std::swap( m_surface, rhs.m_surface ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - private: - VULKAN_HPP_NAMESPACE::Instance m_instance = {}; - VULKAN_HPP_NAMESPACE::SurfaceKHR m_surface = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::InstanceDispatcher const * m_dispatcher = nullptr; - }; - - class SwapchainKHR - { - public: - using CType = VkSwapchainKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eSwapchainKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eSwapchainKHR; - - public: - SwapchainKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateSwapchainKHR( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_swapchain ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateSwapchainKHR" ); - } - } - - SwapchainKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkSwapchainKHR swapchain, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_swapchain( swapchain ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - SwapchainKHR( std::nullptr_t ) {} - - ~SwapchainKHR() - { - clear(); - } - - SwapchainKHR() = delete; - SwapchainKHR( SwapchainKHR const & ) = delete; - SwapchainKHR( SwapchainKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_swapchain( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_swapchain, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - SwapchainKHR & operator=( SwapchainKHR const & ) = delete; - SwapchainKHR & operator =( SwapchainKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_swapchain = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_swapchain, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::SwapchainKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_swapchain; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_swapchain ) - { - getDispatcher()->vkDestroySwapchainKHR( - static_cast( m_device ), static_cast( m_swapchain ), reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_swapchain = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_swapchain, rhs.m_swapchain ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_swapchain === - - VULKAN_HPP_NODISCARD std::vector getImages() const; - - VULKAN_HPP_NODISCARD std::pair - acquireNextImage( uint64_t timeout, - VULKAN_HPP_NAMESPACE::Semaphore semaphore VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT, - VULKAN_HPP_NAMESPACE::Fence fence VULKAN_HPP_DEFAULT_ARGUMENT_ASSIGNMENT ) const; - - //=== VK_EXT_display_control === - - VULKAN_HPP_NODISCARD uint64_t getCounterEXT( VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter ) const; - - //=== VK_GOOGLE_display_timing === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE getRefreshCycleDurationGOOGLE() const; - - VULKAN_HPP_NODISCARD std::vector getPastPresentationTimingGOOGLE() const; - - //=== VK_KHR_shared_presentable_image === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result getStatus() const; - - //=== VK_AMD_display_native_hdr === - - void setLocalDimmingAMD( VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable ) const VULKAN_HPP_NOEXCEPT; - - //=== VK_KHR_present_wait === - - VULKAN_HPP_NODISCARD VULKAN_HPP_NAMESPACE::Result waitForPresent( uint64_t presentId, uint64_t timeout ) const; - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - void acquireFullScreenExclusiveModeEXT() const; - - void releaseFullScreenExclusiveModeEXT() const; -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::SwapchainKHR m_swapchain = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - - class SwapchainKHRs : public std::vector - { - public: - SwapchainKHRs( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - { - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * dispatcher = device.getDispatcher(); - std::vector swapchains( createInfos.size() ); - VULKAN_HPP_NAMESPACE::Result result = static_cast( dispatcher->vkCreateSharedSwapchainsKHR( - static_cast( *device ), - createInfos.size(), - reinterpret_cast( createInfos.data() ), - reinterpret_cast( static_cast( allocator ) ), - swapchains.data() ) ); - if ( result == VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - this->reserve( createInfos.size() ); - for ( auto const & swapchainKHR : swapchains ) - { - this->emplace_back( device, swapchainKHR, allocator ); - } - } - else - { - throwResultException( result, "vkCreateSharedSwapchainsKHR" ); - } - } - - SwapchainKHRs( std::nullptr_t ) {} - - SwapchainKHRs() = delete; - SwapchainKHRs( SwapchainKHRs const & ) = delete; - SwapchainKHRs( SwapchainKHRs && rhs ) = default; - SwapchainKHRs & operator=( SwapchainKHRs const & ) = delete; - SwapchainKHRs & operator=( SwapchainKHRs && rhs ) = default; - }; - - class ValidationCacheEXT - { - public: - using CType = VkValidationCacheEXT; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eValidationCacheEXT; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eValidationCacheEXT; - - public: - ValidationCacheEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateValidationCacheEXT( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_validationCache ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateValidationCacheEXT" ); - } - } - - ValidationCacheEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkValidationCacheEXT validationCache, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_validationCache( validationCache ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - ValidationCacheEXT( std::nullptr_t ) {} - - ~ValidationCacheEXT() - { - clear(); - } - - ValidationCacheEXT() = delete; - ValidationCacheEXT( ValidationCacheEXT const & ) = delete; - ValidationCacheEXT( ValidationCacheEXT && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_validationCache( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_validationCache, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - ValidationCacheEXT & operator=( ValidationCacheEXT const & ) = delete; - ValidationCacheEXT & operator =( ValidationCacheEXT && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_validationCache = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_validationCache, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::ValidationCacheEXT const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_validationCache; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_validationCache ) - { - getDispatcher()->vkDestroyValidationCacheEXT( static_cast( m_device ), - static_cast( m_validationCache ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_validationCache = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::ValidationCacheEXT & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_validationCache, rhs.m_validationCache ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_EXT_validation_cache === - - void merge( ArrayProxy const & srcCaches ) const; - - VULKAN_HPP_NODISCARD std::vector getData() const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::ValidationCacheEXT m_validationCache = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoSessionKHR - { - public: - using CType = VkVideoSessionKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VideoSessionKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateVideoSessionKHR( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_videoSession ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateVideoSessionKHR" ); - } - } - - VideoSessionKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkVideoSessionKHR videoSession, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_videoSession( videoSession ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - VideoSessionKHR( std::nullptr_t ) {} - - ~VideoSessionKHR() - { - clear(); - } - - VideoSessionKHR() = delete; - VideoSessionKHR( VideoSessionKHR const & ) = delete; - VideoSessionKHR( VideoSessionKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_videoSession( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_videoSession, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - VideoSessionKHR & operator=( VideoSessionKHR const & ) = delete; - VideoSessionKHR & operator =( VideoSessionKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_videoSession = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_videoSession, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::VideoSessionKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_videoSession; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_videoSession ) - { - getDispatcher()->vkDestroyVideoSessionKHR( static_cast( m_device ), - static_cast( m_videoSession ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_videoSession = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::VideoSessionKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_videoSession, rhs.m_videoSession ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_video_queue === - - VULKAN_HPP_NODISCARD std::vector getMemoryRequirements() const; - - void bindMemory( ArrayProxy const & bindSessionMemoryInfos ) const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::VideoSessionKHR m_videoSession = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - class VideoSessionParametersKHR - { - public: - using CType = VkVideoSessionParametersKHR; - - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eVideoSessionParametersKHR; - static VULKAN_HPP_CONST_OR_CONSTEXPR VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT debugReportObjectType = - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - - public: - VideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - VULKAN_HPP_NAMESPACE::Result result = static_cast( - device.getDispatcher()->vkCreateVideoSessionParametersKHR( static_cast( *device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( m_allocator ), - reinterpret_cast( &m_videoSessionParameters ) ) ); - if ( result != VULKAN_HPP_NAMESPACE::Result::eSuccess ) - { - throwResultException( result, "vkCreateVideoSessionParametersKHR" ); - } - } - - VideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::Device const & device, - VkVideoSessionParametersKHR videoSessionParameters, - VULKAN_HPP_NAMESPACE::Optional allocator = nullptr ) - : m_device( *device ) - , m_videoSessionParameters( videoSessionParameters ) - , m_allocator( static_cast( allocator ) ) - , m_dispatcher( device.getDispatcher() ) - { - } - - VideoSessionParametersKHR( std::nullptr_t ) {} - - ~VideoSessionParametersKHR() - { - clear(); - } - - VideoSessionParametersKHR() = delete; - VideoSessionParametersKHR( VideoSessionParametersKHR const & ) = delete; - VideoSessionParametersKHR( VideoSessionParametersKHR && rhs ) VULKAN_HPP_NOEXCEPT - : m_device( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ) ) - , m_videoSessionParameters( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_videoSessionParameters, {} ) ) - , m_allocator( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ) ) - , m_dispatcher( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ) ) - { - } - VideoSessionParametersKHR & operator=( VideoSessionParametersKHR const & ) = delete; - VideoSessionParametersKHR & operator =( VideoSessionParametersKHR && rhs ) VULKAN_HPP_NOEXCEPT - { - if ( this != &rhs ) - { - clear(); - m_device = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_device, {} ); - m_videoSessionParameters = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_videoSessionParameters, {} ); - m_allocator = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_allocator, {} ); - m_dispatcher = VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::exchange( rhs.m_dispatcher, nullptr ); - } - return *this; - } - - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR const & operator*() const VULKAN_HPP_NOEXCEPT - { - return m_videoSessionParameters; - } - - void clear() VULKAN_HPP_NOEXCEPT - { - if ( m_videoSessionParameters ) - { - getDispatcher()->vkDestroyVideoSessionParametersKHR( static_cast( m_device ), - static_cast( m_videoSessionParameters ), - reinterpret_cast( m_allocator ) ); - } - m_device = nullptr; - m_videoSessionParameters = nullptr; - m_allocator = nullptr; - m_dispatcher = nullptr; - } - - VULKAN_HPP_NAMESPACE::Device getDevice() const - { - return m_device; - } - - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * getDispatcher() const - { - VULKAN_HPP_ASSERT( m_dispatcher->getVkHeaderVersion() == VK_HEADER_VERSION ); - return m_dispatcher; - } - - void swap( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::VideoSessionParametersKHR & rhs ) VULKAN_HPP_NOEXCEPT - { - std::swap( m_device, rhs.m_device ); - std::swap( m_videoSessionParameters, rhs.m_videoSessionParameters ); - std::swap( m_allocator, rhs.m_allocator ); - std::swap( m_dispatcher, rhs.m_dispatcher ); - } - - //=== VK_KHR_video_queue === - - void update( const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR & updateInfo ) const; - - private: - VULKAN_HPP_NAMESPACE::Device m_device = {}; - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR m_videoSessionParameters = {}; - const VULKAN_HPP_NAMESPACE::AllocationCallbacks * m_allocator = {}; - VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DeviceDispatcher const * m_dispatcher = nullptr; - }; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=========================== - //=== COMMAND Definitions === - //=========================== - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Instance - Context::createInstance( VULKAN_HPP_NAMESPACE::InstanceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Instance( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Instance::enumeratePhysicalDevices() const - { - return VULKAN_HPP_RAII_NAMESPACE::PhysicalDevices( *this ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures PhysicalDevice::getFeatures() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures features; - getDispatcher()->vkGetPhysicalDeviceFeatures( static_cast( m_physicalDevice ), - reinterpret_cast( &features ) ); - - return features; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties - PhysicalDevice::getFormatProperties( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::FormatProperties formatProperties; - getDispatcher()->vkGetPhysicalDeviceFormatProperties( - static_cast( m_physicalDevice ), static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ImageFormatProperties - PhysicalDevice::getImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags ) const - { - VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties; - VkResult result = getDispatcher()->vkGetPhysicalDeviceImageFormatProperties( static_cast( m_physicalDevice ), - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties" ); - - return imageFormatProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties PhysicalDevice::getProperties() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties properties; - getDispatcher()->vkGetPhysicalDeviceProperties( static_cast( m_physicalDevice ), - reinterpret_cast( &properties ) ); - - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties() const - { - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties( static_cast( m_physicalDevice ), - &queueFamilyPropertyCount, - reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties PhysicalDevice::getMemoryProperties() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties memoryProperties; - getDispatcher()->vkGetPhysicalDeviceMemoryProperties( static_cast( m_physicalDevice ), - reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE PFN_vkVoidFunction Instance::getProcAddr( const std::string & name ) const VULKAN_HPP_NOEXCEPT - { - PFN_vkVoidFunction result = getDispatcher()->vkGetInstanceProcAddr( static_cast( m_instance ), name.c_str() ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE PFN_vkVoidFunction Device::getProcAddr( const std::string & name ) const VULKAN_HPP_NOEXCEPT - { - PFN_vkVoidFunction result = getDispatcher()->vkGetDeviceProcAddr( static_cast( m_device ), name.c_str() ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Device - PhysicalDevice::createDevice( VULKAN_HPP_NAMESPACE::DeviceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Device( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Context::enumerateInstanceExtensionProperties( Optional layerName ) const - { - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumerateInstanceExtensionProperties( layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkEnumerateInstanceExtensionProperties( - layerName ? layerName->c_str() : nullptr, &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Context::enumerateInstanceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::enumerateDeviceExtensionProperties( Optional layerName ) const - { - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumerateDeviceExtensionProperties( - static_cast( m_physicalDevice ), layerName ? layerName->c_str() : nullptr, &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkEnumerateDeviceExtensionProperties( static_cast( m_physicalDevice ), - layerName ? layerName->c_str() : nullptr, - &propertyCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceExtensionProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Context::enumerateInstanceLayerProperties() const - { - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumerateInstanceLayerProperties( &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkEnumerateInstanceLayerProperties( &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Context::enumerateInstanceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::enumerateDeviceLayerProperties() const - { - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumerateDeviceLayerProperties( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkEnumerateDeviceLayerProperties( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateDeviceLayerProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Queue Device::getQueue( uint32_t queueFamilyIndex, uint32_t queueIndex ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Queue( *this, queueFamilyIndex, queueIndex ); - } - - VULKAN_HPP_INLINE void Queue::submit( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence ) const - { - VkResult result = getDispatcher()->vkQueueSubmit( - static_cast( m_queue ), submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit" ); - } - - VULKAN_HPP_INLINE void Queue::waitIdle() const - { - VkResult result = getDispatcher()->vkQueueWaitIdle( static_cast( m_queue ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::waitIdle" ); - } - - VULKAN_HPP_INLINE void Device::waitIdle() const - { - VkResult result = getDispatcher()->vkDeviceWaitIdle( static_cast( m_device ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::waitIdle" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DeviceMemory - Device::allocateMemory( VULKAN_HPP_NAMESPACE::MemoryAllocateInfo const & allocateInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DeviceMemory( *this, allocateInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE void * DeviceMemory::mapMemory( VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - VULKAN_HPP_NAMESPACE::MemoryMapFlags flags ) const - { - void * pData; - VkResult result = getDispatcher()->vkMapMemory( static_cast( m_device ), - static_cast( m_memory ), - static_cast( offset ), - static_cast( size ), - static_cast( flags ), - &pData ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DeviceMemory::mapMemory" ); - - return pData; - } - - VULKAN_HPP_INLINE void DeviceMemory::unmapMemory() const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkUnmapMemory( static_cast( m_device ), static_cast( m_memory ) ); - } - - VULKAN_HPP_INLINE void Device::flushMappedMemoryRanges( ArrayProxy const & memoryRanges ) const - { - VkResult result = getDispatcher()->vkFlushMappedMemoryRanges( - static_cast( m_device ), memoryRanges.size(), reinterpret_cast( memoryRanges.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::flushMappedMemoryRanges" ); - } - - VULKAN_HPP_INLINE void Device::invalidateMappedMemoryRanges( ArrayProxy const & memoryRanges ) const - { - VkResult result = getDispatcher()->vkInvalidateMappedMemoryRanges( - static_cast( m_device ), memoryRanges.size(), reinterpret_cast( memoryRanges.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::invalidateMappedMemoryRanges" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceSize DeviceMemory::getCommitment() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::DeviceSize committedMemoryInBytes; - getDispatcher()->vkGetDeviceMemoryCommitment( - static_cast( m_device ), static_cast( m_memory ), reinterpret_cast( &committedMemoryInBytes ) ); - - return committedMemoryInBytes; - } - - VULKAN_HPP_INLINE void Buffer::bindMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset ) const - { - VkResult result = getDispatcher()->vkBindBufferMemory( static_cast( m_device ), - static_cast( m_buffer ), - static_cast( memory ), - static_cast( memoryOffset ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Buffer::bindMemory" ); - } - - VULKAN_HPP_INLINE void Image::bindMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory, VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset ) const - { - VkResult result = getDispatcher()->vkBindImageMemory( - static_cast( m_device ), static_cast( m_image ), static_cast( memory ), static_cast( memoryOffset ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Image::bindMemory" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements Buffer::getMemoryRequirements() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements; - getDispatcher()->vkGetBufferMemoryRequirements( - static_cast( m_device ), static_cast( m_buffer ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements Image::getMemoryRequirements() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements; - getDispatcher()->vkGetImageMemoryRequirements( - static_cast( m_device ), static_cast( m_image ), reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Image::getSparseMemoryRequirements() const - { - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - getDispatcher()->vkGetImageSparseMemoryRequirements( - static_cast( m_device ), static_cast( m_image ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - getDispatcher()->vkGetImageSparseMemoryRequirements( static_cast( m_device ), - static_cast( m_image ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageTiling tiling ) const - { - std::vector properties; - uint32_t propertyCount; - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties( static_cast( m_physicalDevice ), - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - nullptr ); - properties.resize( propertyCount ); - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties( static_cast( m_physicalDevice ), - static_cast( format ), - static_cast( type ), - static_cast( samples ), - static_cast( usage ), - static_cast( tiling ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_INLINE void Queue::bindSparse( ArrayProxy const & bindInfo, VULKAN_HPP_NAMESPACE::Fence fence ) const - { - VkResult result = getDispatcher()->vkQueueBindSparse( - static_cast( m_queue ), bindInfo.size(), reinterpret_cast( bindInfo.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::bindSparse" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Fence - Device::createFence( VULKAN_HPP_NAMESPACE::FenceCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Fence( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void Device::resetFences( ArrayProxy const & fences ) const - { - VkResult result = getDispatcher()->vkResetFences( static_cast( m_device ), fences.size(), reinterpret_cast( fences.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::resetFences" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Fence::getStatus() const - { - VkResult result = getDispatcher()->vkGetFenceStatus( static_cast( m_device ), static_cast( m_fence ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Fence::getStatus", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::waitForFences( ArrayProxy const & fences, VULKAN_HPP_NAMESPACE::Bool32 waitAll, uint64_t timeout ) const - { - VkResult result = getDispatcher()->vkWaitForFences( - static_cast( m_device ), fences.size(), reinterpret_cast( fences.data() ), static_cast( waitAll ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitForFences", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Semaphore - Device::createSemaphore( VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Semaphore( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Event - Device::createEvent( VULKAN_HPP_NAMESPACE::EventCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Event( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Event::getStatus() const - { - VkResult result = getDispatcher()->vkGetEventStatus( static_cast( m_device ), static_cast( m_event ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Event::getStatus", - { VULKAN_HPP_NAMESPACE::Result::eEventSet, VULKAN_HPP_NAMESPACE::Result::eEventReset } ); - - return static_cast( result ); - } - - VULKAN_HPP_INLINE void Event::set() const - { - VkResult result = getDispatcher()->vkSetEvent( static_cast( m_device ), static_cast( m_event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Event::set" ); - } - - VULKAN_HPP_INLINE void Event::reset() const - { - VkResult result = getDispatcher()->vkResetEvent( static_cast( m_device ), static_cast( m_event ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Event::reset" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::QueryPool - Device::createQueryPool( VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::QueryPool( *this, createInfo, allocator ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair> QueryPool::getResults( - uint32_t firstQuery, uint32_t queryCount, size_t dataSize, VULKAN_HPP_NAMESPACE::DeviceSize stride, VULKAN_HPP_NAMESPACE::QueryResultFlags flags ) const - { - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = getDispatcher()->vkGetQueryPoolResults( static_cast( m_device ), - static_cast( m_queryPool ), - firstQuery, - queryCount, - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ), - static_cast( stride ), - static_cast( flags ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::QueryPool::getResults", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return std::make_pair( static_cast( result ), data ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair QueryPool::getResult( - uint32_t firstQuery, uint32_t queryCount, VULKAN_HPP_NAMESPACE::DeviceSize stride, VULKAN_HPP_NAMESPACE::QueryResultFlags flags ) const - { - DataType data; - VkResult result = getDispatcher()->vkGetQueryPoolResults( static_cast( m_device ), - static_cast( m_queryPool ), - firstQuery, - queryCount, - sizeof( DataType ), - reinterpret_cast( &data ), - static_cast( stride ), - static_cast( flags ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::QueryPool::getResult", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eNotReady } ); - - return std::make_pair( static_cast( result ), data ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Buffer - Device::createBuffer( VULKAN_HPP_NAMESPACE::BufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Buffer( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::BufferView - Device::createBufferView( VULKAN_HPP_NAMESPACE::BufferViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::BufferView( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Image - Device::createImage( VULKAN_HPP_NAMESPACE::ImageCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Image( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SubresourceLayout - Image::getSubresourceLayout( const VULKAN_HPP_NAMESPACE::ImageSubresource & subresource ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::SubresourceLayout layout; - getDispatcher()->vkGetImageSubresourceLayout( static_cast( m_device ), - static_cast( m_image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return layout; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::ImageView - Device::createImageView( VULKAN_HPP_NAMESPACE::ImageViewCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::ImageView( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::ShaderModule - Device::createShaderModule( VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::ShaderModule( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::PipelineCache - Device::createPipelineCache( VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::PipelineCache( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PipelineCache::getData() const - { - std::vector data; - size_t dataSize; - VkResult result; - do - { - result = - getDispatcher()->vkGetPipelineCacheData( static_cast( m_device ), static_cast( m_pipelineCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = getDispatcher()->vkGetPipelineCacheData( - static_cast( m_device ), static_cast( m_pipelineCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PipelineCache::getData" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return data; - } - - VULKAN_HPP_INLINE void PipelineCache::merge( ArrayProxy const & srcCaches ) const - { - VkResult result = getDispatcher()->vkMergePipelineCaches( static_cast( m_device ), - static_cast( m_pipelineCache ), - srcCaches.size(), - reinterpret_cast( srcCaches.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PipelineCache::merge" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::createGraphicsPipelines( - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipelines( *this, pipelineCache, createInfos, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Pipeline Device::createGraphicsPipeline( - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipeline( *this, pipelineCache, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::createComputePipelines( - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipelines( *this, pipelineCache, createInfos, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Pipeline - Device::createComputePipeline( VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipeline( *this, pipelineCache, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::PipelineLayout - Device::createPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::PipelineLayout( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Sampler - Device::createSampler( VULKAN_HPP_NAMESPACE::SamplerCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Sampler( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DescriptorSetLayout - Device::createDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DescriptorSetLayout( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DescriptorPool - Device::createDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DescriptorPool( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void DescriptorPool::reset( VULKAN_HPP_NAMESPACE::DescriptorPoolResetFlags flags ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkResetDescriptorPool( - static_cast( m_device ), static_cast( m_descriptorPool ), static_cast( flags ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::allocateDescriptorSets( VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo const & allocateInfo ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DescriptorSets( *this, allocateInfo ); - } - - VULKAN_HPP_INLINE void - Device::updateDescriptorSets( ArrayProxy const & descriptorWrites, - ArrayProxy const & descriptorCopies ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkUpdateDescriptorSets( static_cast( m_device ), - descriptorWrites.size(), - reinterpret_cast( descriptorWrites.data() ), - descriptorCopies.size(), - reinterpret_cast( descriptorCopies.data() ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Framebuffer - Device::createFramebuffer( VULKAN_HPP_NAMESPACE::FramebufferCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Framebuffer( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::RenderPass - Device::createRenderPass( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::RenderPass( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Extent2D RenderPass::getRenderAreaGranularity() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::Extent2D granularity; - getDispatcher()->vkGetRenderAreaGranularity( - static_cast( m_device ), static_cast( m_renderPass ), reinterpret_cast( &granularity ) ); - - return granularity; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::CommandPool - Device::createCommandPool( VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::CommandPool( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void CommandPool::reset( VULKAN_HPP_NAMESPACE::CommandPoolResetFlags flags ) const - { - VkResult result = getDispatcher()->vkResetCommandPool( - static_cast( m_device ), static_cast( m_commandPool ), static_cast( flags ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandPool::reset" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::allocateCommandBuffers( VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo const & allocateInfo ) const - { - return VULKAN_HPP_RAII_NAMESPACE::CommandBuffers( *this, allocateInfo ); - } - - VULKAN_HPP_INLINE void CommandBuffer::begin( const VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo & beginInfo ) const - { - VkResult result = getDispatcher()->vkBeginCommandBuffer( static_cast( m_commandBuffer ), - reinterpret_cast( &beginInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::begin" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::end() const - { - VkResult result = getDispatcher()->vkEndCommandBuffer( static_cast( m_commandBuffer ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::end" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::reset( VULKAN_HPP_NAMESPACE::CommandBufferResetFlags flags ) const - { - VkResult result = - getDispatcher()->vkResetCommandBuffer( static_cast( m_commandBuffer ), static_cast( flags ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::reset" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindPipeline( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBindPipeline( - static_cast( m_commandBuffer ), static_cast( pipelineBindPoint ), static_cast( pipeline ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setViewport( uint32_t firstViewport, - ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetViewport( - static_cast( m_commandBuffer ), firstViewport, viewports.size(), reinterpret_cast( viewports.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setScissor( uint32_t firstScissor, - ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetScissor( - static_cast( m_commandBuffer ), firstScissor, scissors.size(), reinterpret_cast( scissors.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setLineWidth( float lineWidth ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetLineWidth( static_cast( m_commandBuffer ), lineWidth ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::setDepthBias( float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthBias( static_cast( m_commandBuffer ), depthBiasConstantFactor, depthBiasClamp, depthBiasSlopeFactor ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setBlendConstants( const float blendConstants[4] ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetBlendConstants( static_cast( m_commandBuffer ), blendConstants ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthBounds( float minDepthBounds, float maxDepthBounds ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthBounds( static_cast( m_commandBuffer ), minDepthBounds, maxDepthBounds ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilCompareMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - uint32_t compareMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetStencilCompareMask( static_cast( m_commandBuffer ), static_cast( faceMask ), compareMask ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilWriteMask( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t writeMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetStencilWriteMask( static_cast( m_commandBuffer ), static_cast( faceMask ), writeMask ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilReference( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, uint32_t reference ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetStencilReference( static_cast( m_commandBuffer ), static_cast( faceMask ), reference ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindDescriptorSets( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t firstSet, - ArrayProxy const & descriptorSets, - ArrayProxy const & dynamicOffsets ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBindDescriptorSets( static_cast( m_commandBuffer ), - static_cast( pipelineBindPoint ), - static_cast( layout ), - firstSet, - descriptorSets.size(), - reinterpret_cast( descriptorSets.data() ), - dynamicOffsets.size(), - dynamicOffsets.data() ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindIndexBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::IndexType indexType ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBindIndexBuffer( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( indexType ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets ) const - { - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers: buffers.size() != offsets.size()" ); - } - - getDispatcher()->vkCmdBindVertexBuffers( static_cast( m_commandBuffer ), - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDraw( static_cast( m_commandBuffer ), vertexCount, instanceCount, firstVertex, firstInstance ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndexed( - uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDrawIndexed( static_cast( m_commandBuffer ), indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDrawIndirect( - static_cast( m_commandBuffer ), static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDrawIndexedIndirect( - static_cast( m_commandBuffer ), static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::dispatch( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDispatch( static_cast( m_commandBuffer ), groupCountX, groupCountY, groupCountZ ); - } - - VULKAN_HPP_INLINE void CommandBuffer::dispatchIndirect( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDispatchIndirect( - static_cast( m_commandBuffer ), static_cast( buffer ), static_cast( offset ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyBuffer( static_cast( m_commandBuffer ), - static_cast( srcBuffer ), - static_cast( dstBuffer ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyImage( static_cast( m_commandBuffer ), - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::blitImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions, - VULKAN_HPP_NAMESPACE::Filter filter ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBlitImage( static_cast( m_commandBuffer ), - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ), - static_cast( filter ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyBufferToImage( VULKAN_HPP_NAMESPACE::Buffer srcBuffer, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyBufferToImage( static_cast( m_commandBuffer ), - static_cast( srcBuffer ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyImageToBuffer( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyImageToBuffer( static_cast( m_commandBuffer ), - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstBuffer ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::updateBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - ArrayProxy const & data ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdUpdateBuffer( static_cast( m_commandBuffer ), - static_cast( dstBuffer ), - static_cast( dstOffset ), - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::fillBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize size, - uint32_t data ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdFillBuffer( static_cast( m_commandBuffer ), - static_cast( dstBuffer ), - static_cast( dstOffset ), - static_cast( size ), - data ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::clearColorImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearColorValue & color, - ArrayProxy const & ranges ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdClearColorImage( static_cast( m_commandBuffer ), - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( &color ), - ranges.size(), - reinterpret_cast( ranges.data() ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::clearDepthStencilImage( VULKAN_HPP_NAMESPACE::Image image, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout, - const VULKAN_HPP_NAMESPACE::ClearDepthStencilValue & depthStencil, - ArrayProxy const & ranges ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdClearDepthStencilImage( static_cast( m_commandBuffer ), - static_cast( image ), - static_cast( imageLayout ), - reinterpret_cast( &depthStencil ), - ranges.size(), - reinterpret_cast( ranges.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::clearAttachments( ArrayProxy const & attachments, - ArrayProxy const & rects ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdClearAttachments( static_cast( m_commandBuffer ), - attachments.size(), - reinterpret_cast( attachments.data() ), - rects.size(), - reinterpret_cast( rects.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resolveImage( VULKAN_HPP_NAMESPACE::Image srcImage, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout, - VULKAN_HPP_NAMESPACE::Image dstImage, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout, - ArrayProxy const & regions ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdResolveImage( static_cast( m_commandBuffer ), - static_cast( srcImage ), - static_cast( srcImageLayout ), - static_cast( dstImage ), - static_cast( dstImageLayout ), - regions.size(), - reinterpret_cast( regions.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetEvent( - static_cast( m_commandBuffer ), static_cast( event ), static_cast( stageMask ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resetEvent( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags stageMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdResetEvent( - static_cast( m_commandBuffer ), static_cast( event ), static_cast( stageMask ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::waitEvents( ArrayProxy const & events, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdWaitEvents( static_cast( m_commandBuffer ), - events.size(), - reinterpret_cast( events.data() ), - static_cast( srcStageMask ), - static_cast( dstStageMask ), - memoryBarriers.size(), - reinterpret_cast( memoryBarriers.data() ), - bufferMemoryBarriers.size(), - reinterpret_cast( bufferMemoryBarriers.data() ), - imageMemoryBarriers.size(), - reinterpret_cast( imageMemoryBarriers.data() ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::pipelineBarrier( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags, - ArrayProxy const & memoryBarriers, - ArrayProxy const & bufferMemoryBarriers, - ArrayProxy const & imageMemoryBarriers ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdPipelineBarrier( static_cast( m_commandBuffer ), - static_cast( srcStageMask ), - static_cast( dstStageMask ), - static_cast( dependencyFlags ), - memoryBarriers.size(), - reinterpret_cast( memoryBarriers.data() ), - bufferMemoryBarriers.size(), - reinterpret_cast( bufferMemoryBarriers.data() ), - imageMemoryBarriers.size(), - reinterpret_cast( imageMemoryBarriers.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBeginQuery( - static_cast( m_commandBuffer ), static_cast( queryPool ), query, static_cast( flags ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endQuery( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdEndQuery( static_cast( m_commandBuffer ), static_cast( queryPool ), query ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::resetQueryPool( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdResetQueryPool( static_cast( m_commandBuffer ), static_cast( queryPool ), firstQuery, queryCount ); - } - - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdWriteTimestamp( - static_cast( m_commandBuffer ), static_cast( pipelineStage ), static_cast( queryPool ), query ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyQueryPoolResults( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery, - uint32_t queryCount, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - VULKAN_HPP_NAMESPACE::DeviceSize stride, - VULKAN_HPP_NAMESPACE::QueryResultFlags flags ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyQueryPoolResults( static_cast( m_commandBuffer ), - static_cast( queryPool ), - firstQuery, - queryCount, - static_cast( dstBuffer ), - static_cast( dstOffset ), - static_cast( stride ), - static_cast( flags ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::pushConstants( VULKAN_HPP_NAMESPACE::PipelineLayout layout, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags, - uint32_t offset, - ArrayProxy const & values ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdPushConstants( static_cast( m_commandBuffer ), - static_cast( layout ), - static_cast( stageFlags ), - offset, - values.size() * sizeof( ValuesType ), - reinterpret_cast( values.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - VULKAN_HPP_NAMESPACE::SubpassContents contents ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBeginRenderPass( static_cast( m_commandBuffer ), - reinterpret_cast( &renderPassBegin ), - static_cast( contents ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass( VULKAN_HPP_NAMESPACE::SubpassContents contents ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdNextSubpass( static_cast( m_commandBuffer ), static_cast( contents ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass() const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdEndRenderPass( static_cast( m_commandBuffer ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::executeCommands( ArrayProxy const & commandBuffers ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdExecuteCommands( - static_cast( m_commandBuffer ), commandBuffers.size(), reinterpret_cast( commandBuffers.data() ) ); - } - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint32_t Context::enumerateInstanceVersion() const - { - uint32_t apiVersion; - VkResult result = getDispatcher()->vkEnumerateInstanceVersion( &apiVersion ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Context::enumerateInstanceVersion" ); - - return apiVersion; - } - - VULKAN_HPP_INLINE void Device::bindBufferMemory2( ArrayProxy const & bindInfos ) const - { - VkResult result = getDispatcher()->vkBindBufferMemory2( - static_cast( m_device ), bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindBufferMemory2" ); - } - - VULKAN_HPP_INLINE void Device::bindImageMemory2( ArrayProxy const & bindInfos ) const - { - VkResult result = getDispatcher()->vkBindImageMemory2( - static_cast( m_device ), bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindImageMemory2" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - Device::getGroupPeerMemoryFeatures( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags peerMemoryFeatures; - getDispatcher()->vkGetDeviceGroupPeerMemoryFeatures( static_cast( m_device ), - heapIndex, - localDeviceIndex, - remoteDeviceIndex, - reinterpret_cast( &peerMemoryFeatures ) ); - - return peerMemoryFeatures; - } - - VULKAN_HPP_INLINE void CommandBuffer::setDeviceMask( uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDeviceMask( static_cast( m_commandBuffer ), deviceMask ); - } - - VULKAN_HPP_INLINE void CommandBuffer::dispatchBase( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDispatchBase( - static_cast( m_commandBuffer ), baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Instance::enumeratePhysicalDeviceGroups() const - { - std::vector physicalDeviceGroupProperties; - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumeratePhysicalDeviceGroups( static_cast( m_instance ), &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = - getDispatcher()->vkEnumeratePhysicalDeviceGroups( static_cast( m_instance ), - &physicalDeviceGroupCount, - reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroups" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return physicalDeviceGroupProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetImageMemoryRequirements2( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetImageMemoryRequirements2( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetBufferMemoryRequirements2( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements2( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetBufferMemoryRequirements2( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info ) const - { - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - getDispatcher()->vkGetImageSparseMemoryRequirements2( - static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - getDispatcher()->vkGetImageSparseMemoryRequirements2( static_cast( m_device ), - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 PhysicalDevice::getFeatures2() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 features; - getDispatcher()->vkGetPhysicalDeviceFeatures2( static_cast( m_physicalDevice ), - reinterpret_cast( &features ) ); - - return features; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2() const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 & features = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceFeatures2( static_cast( m_physicalDevice ), - reinterpret_cast( &features ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 PhysicalDevice::getProperties2() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 properties; - getDispatcher()->vkGetPhysicalDeviceProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &properties ) ); - - return properties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2() const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 & properties = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &properties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties2 - PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::FormatProperties2 formatProperties; - getDispatcher()->vkGetPhysicalDeviceFormatProperties2( - static_cast( m_physicalDevice ), static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getFormatProperties2( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::FormatProperties2 & formatProperties = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceFormatProperties2( - static_cast( m_physicalDevice ), static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ImageFormatProperties2 - PhysicalDevice::getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const - { - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 imageFormatProperties; - VkResult result = - getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2" ); - - return imageFormatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 & imageFormatProperties = structureChain.template get(); - VkResult result = - getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2" ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2() const - { - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), - &queueFamilyPropertyCount, - reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2() const - { - std::vector structureChains; - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2( static_cast( m_physicalDevice ), - &queueFamilyPropertyCount, - reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - PhysicalDevice::getMemoryProperties2() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 memoryProperties; - getDispatcher()->vkGetPhysicalDeviceMemoryProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getMemoryProperties2() const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 & memoryProperties = - structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceMemoryProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &memoryProperties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo ) const - { - std::vector properties; - uint32_t propertyCount; - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &formatInfo ), - &propertyCount, - nullptr ); - properties.resize( propertyCount ); - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2( static_cast( m_physicalDevice ), - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_INLINE void CommandPool::trim( VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkTrimCommandPool( - static_cast( m_device ), static_cast( m_commandPool ), static_cast( flags ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Queue Device::getQueue2( VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 const & queueInfo ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Queue( *this, queueInfo ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion - Device::createSamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate - Device::createDescriptorUpdateTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate( *this, createInfo, allocator ); - } - - template - VULKAN_HPP_INLINE void DescriptorSet::updateWithTemplate( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkUpdateDescriptorSetWithTemplate( static_cast( m_device ), - static_cast( m_descriptorSet ), - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( &data ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalBufferProperties - PhysicalDevice::getExternalBufferProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::ExternalBufferProperties externalBufferProperties; - getDispatcher()->vkGetPhysicalDeviceExternalBufferProperties( static_cast( m_physicalDevice ), - reinterpret_cast( &externalBufferInfo ), - reinterpret_cast( &externalBufferProperties ) ); - - return externalBufferProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalFenceProperties - PhysicalDevice::getExternalFenceProperties( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::ExternalFenceProperties externalFenceProperties; - getDispatcher()->vkGetPhysicalDeviceExternalFenceProperties( static_cast( m_physicalDevice ), - reinterpret_cast( &externalFenceInfo ), - reinterpret_cast( &externalFenceProperties ) ); - - return externalFenceProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties PhysicalDevice::getExternalSemaphoreProperties( - const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties externalSemaphoreProperties; - getDispatcher()->vkGetPhysicalDeviceExternalSemaphoreProperties( - static_cast( m_physicalDevice ), - reinterpret_cast( &externalSemaphoreInfo ), - reinterpret_cast( &externalSemaphoreProperties ) ); - - return externalSemaphoreProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - Device::getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport support; - getDispatcher()->vkGetDescriptorSetLayoutSupport( static_cast( m_device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( &support ) ); - - return support; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getDescriptorSetLayoutSupport( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport & support = structureChain.template get(); - getDispatcher()->vkGetDescriptorSetLayoutSupport( static_cast( m_device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( &support ) ); - - return structureChain; - } - - //=== VK_VERSION_1_2 === - - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDrawIndirectCount( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCount( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdDrawIndexedIndirectCount( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::RenderPass - Device::createRenderPass2( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::RenderPass( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBeginRenderPass2( static_cast( m_commandBuffer ), - reinterpret_cast( &renderPassBegin ), - reinterpret_cast( &subpassBeginInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdNextSubpass2( static_cast( m_commandBuffer ), - reinterpret_cast( &subpassBeginInfo ), - reinterpret_cast( &subpassEndInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdEndRenderPass2( static_cast( m_commandBuffer ), reinterpret_cast( &subpassEndInfo ) ); - } - - VULKAN_HPP_INLINE void QueryPool::reset( uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkResetQueryPool( static_cast( m_device ), static_cast( m_queryPool ), firstQuery, queryCount ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Semaphore::getCounterValue() const - { - uint64_t value; - VkResult result = getDispatcher()->vkGetSemaphoreCounterValue( static_cast( m_device ), static_cast( m_semaphore ), &value ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Semaphore::getCounterValue" ); - - return value; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::waitSemaphores( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, - uint64_t timeout ) const - { - VkResult result = - getDispatcher()->vkWaitSemaphores( static_cast( m_device ), reinterpret_cast( &waitInfo ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphores", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } - - VULKAN_HPP_INLINE void Device::signalSemaphore( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo ) const - { - VkResult result = getDispatcher()->vkSignalSemaphore( static_cast( m_device ), reinterpret_cast( &signalInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::signalSemaphore" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress - Device::getBufferAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - VkDeviceAddress result = - getDispatcher()->vkGetBufferDeviceAddress( static_cast( m_device ), reinterpret_cast( &info ) ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t - Device::getBufferOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - uint64_t result = - getDispatcher()->vkGetBufferOpaqueCaptureAddress( static_cast( m_device ), reinterpret_cast( &info ) ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t - Device::getMemoryOpaqueCaptureAddress( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - uint64_t result = getDispatcher()->vkGetDeviceMemoryOpaqueCaptureAddress( static_cast( m_device ), - reinterpret_cast( &info ) ); - - return result; - } - - //=== VK_VERSION_1_3 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getToolProperties() const - { - std::vector toolProperties; - uint32_t toolCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceToolProperties( static_cast( m_physicalDevice ), &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = getDispatcher()->vkGetPhysicalDeviceToolProperties( - static_cast( m_physicalDevice ), &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolProperties" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return toolProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot - Device::createPrivateDataSlot( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void Device::setPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data ) const - { - VkResult result = getDispatcher()->vkSetPrivateData( - static_cast( m_device ), static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateData" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateData( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot ) const VULKAN_HPP_NOEXCEPT - { - uint64_t data; - getDispatcher()->vkGetPrivateData( - static_cast( m_device ), static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), &data ); - - return data; - } - - VULKAN_HPP_INLINE void CommandBuffer::setEvent2( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetEvent2( - static_cast( m_commandBuffer ), static_cast( event ), reinterpret_cast( &dependencyInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resetEvent2( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdResetEvent2( - static_cast( m_commandBuffer ), static_cast( event ), static_cast( stageMask ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2( ArrayProxy const & events, - ArrayProxy const & dependencyInfos ) const - { - if ( events.size() != dependencyInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::waitEvents2: events.size() != dependencyInfos.size()" ); - } - - getDispatcher()->vkCmdWaitEvents2( static_cast( m_commandBuffer ), - events.size(), - reinterpret_cast( events.data() ), - reinterpret_cast( dependencyInfos.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdPipelineBarrier2( static_cast( m_commandBuffer ), reinterpret_cast( &dependencyInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdWriteTimestamp2( - static_cast( m_commandBuffer ), static_cast( stage ), static_cast( queryPool ), query ); - } - - VULKAN_HPP_INLINE void Queue::submit2( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence ) const - { - VkResult result = getDispatcher()->vkQueueSubmit2( - static_cast( m_queue ), submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit2" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyBuffer2( static_cast( m_commandBuffer ), reinterpret_cast( ©BufferInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyImage2( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyImage2( static_cast( m_commandBuffer ), reinterpret_cast( ©ImageInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::copyBufferToImage2( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyBufferToImage2( static_cast( m_commandBuffer ), - reinterpret_cast( ©BufferToImageInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::copyImageToBuffer2( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdCopyImageToBuffer2( static_cast( m_commandBuffer ), - reinterpret_cast( ©ImageToBufferInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::blitImage2( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBlitImage2( static_cast( m_commandBuffer ), reinterpret_cast( &blitImageInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdResolveImage2( static_cast( m_commandBuffer ), - reinterpret_cast( &resolveImageInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginRendering( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdBeginRendering( static_cast( m_commandBuffer ), reinterpret_cast( &renderingInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endRendering() const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdEndRendering( static_cast( m_commandBuffer ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setCullMode( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetCullMode( static_cast( m_commandBuffer ), static_cast( cullMode ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setFrontFace( VULKAN_HPP_NAMESPACE::FrontFace frontFace ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetFrontFace( static_cast( m_commandBuffer ), static_cast( frontFace ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveTopology( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetPrimitiveTopology( static_cast( m_commandBuffer ), static_cast( primitiveTopology ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setViewportWithCount( ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetViewportWithCount( - static_cast( m_commandBuffer ), viewports.size(), reinterpret_cast( viewports.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setScissorWithCount( ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetScissorWithCount( - static_cast( m_commandBuffer ), scissors.size(), reinterpret_cast( scissors.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes, - ArrayProxy const & strides ) const - { - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != sizes.size()" ); - } - if ( !strides.empty() && buffers.size() != strides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2: buffers.size() != strides.size()" ); - } - - getDispatcher()->vkCmdBindVertexBuffers2( static_cast( m_commandBuffer ), - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ), - reinterpret_cast( strides.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthTestEnable( static_cast( m_commandBuffer ), static_cast( depthTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthWriteEnable( static_cast( m_commandBuffer ), static_cast( depthWriteEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthCompareOp( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthCompareOp( static_cast( m_commandBuffer ), static_cast( depthCompareOp ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthBoundsTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthBoundsTestEnable( static_cast( m_commandBuffer ), static_cast( depthBoundsTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilTestEnable( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetStencilTestEnable( static_cast( m_commandBuffer ), static_cast( stencilTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilOp( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetStencilOp( static_cast( m_commandBuffer ), - static_cast( faceMask ), - static_cast( failOp ), - static_cast( passOp ), - static_cast( depthFailOp ), - static_cast( compareOp ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setRasterizerDiscardEnable( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetRasterizerDiscardEnable( static_cast( m_commandBuffer ), static_cast( rasterizerDiscardEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthBiasEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetDepthBiasEnable( static_cast( m_commandBuffer ), static_cast( depthBiasEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveRestartEnable( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT - { - getDispatcher()->vkCmdSetPrimitiveRestartEnable( static_cast( m_commandBuffer ), static_cast( primitiveRestartEnable ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetDeviceBufferMemoryRequirements( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetDeviceBufferMemoryRequirements( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetDeviceImageMemoryRequirements( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetDeviceImageMemoryRequirements( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const - { - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - getDispatcher()->vkGetDeviceImageSparseMemoryRequirements( - static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - getDispatcher()->vkGetDeviceImageSparseMemoryRequirements( static_cast( m_device ), - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - //=== VK_KHR_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 PhysicalDevice::getSurfaceSupportKHR( uint32_t queueFamilyIndex, - VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceSupportKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::Bool32 supported; - VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceSupportKHR( - static_cast( m_physicalDevice ), queueFamilyIndex, static_cast( surface ), reinterpret_cast( &supported ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceSupportKHR" ); - - return supported; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR - PhysicalDevice::getSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilitiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR surfaceCapabilities; - VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilitiesKHR( static_cast( m_physicalDevice ), - static_cast( surface ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilitiesKHR" ); - - return surfaceCapabilities; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSurfaceFormatsKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceFormatsKHR && - "Function needs extension enabled!" ); - - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormatsKHR( - static_cast( m_physicalDevice ), static_cast( surface ), &surfaceFormatCount, nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormatsKHR( static_cast( m_physicalDevice ), - static_cast( surface ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormatsKHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return surfaceFormats; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfacePresentModesKHR && - "Function needs extension enabled!" ); - - std::vector presentModes; - uint32_t presentModeCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSurfacePresentModesKHR( - static_cast( m_physicalDevice ), static_cast( surface ), &presentModeCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = getDispatcher()->vkGetPhysicalDeviceSurfacePresentModesKHR( static_cast( m_physicalDevice ), - static_cast( surface ), - &presentModeCount, - reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModesKHR" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return presentModes; - } - - //=== VK_KHR_swapchain === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR - Device::createSwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector SwapchainKHR::getImages() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSwapchainImagesKHR && "Function needs extension enabled!" ); - - std::vector swapchainImages; - uint32_t swapchainImageCount; - VkResult result; - do - { - result = getDispatcher()->vkGetSwapchainImagesKHR( - static_cast( m_device ), static_cast( m_swapchain ), &swapchainImageCount, nullptr ); - if ( ( result == VK_SUCCESS ) && swapchainImageCount ) - { - swapchainImages.resize( swapchainImageCount ); - result = getDispatcher()->vkGetSwapchainImagesKHR( - static_cast( m_device ), static_cast( m_swapchain ), &swapchainImageCount, swapchainImages.data() ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getImages" ); - VULKAN_HPP_ASSERT( swapchainImageCount <= swapchainImages.size() ); - if ( swapchainImageCount < swapchainImages.size() ) - { - swapchainImages.resize( swapchainImageCount ); - } - return swapchainImages; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair - SwapchainKHR::acquireNextImage( uint64_t timeout, VULKAN_HPP_NAMESPACE::Semaphore semaphore, VULKAN_HPP_NAMESPACE::Fence fence ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireNextImageKHR && "Function needs extension enabled!" ); - - uint32_t imageIndex; - VkResult result = getDispatcher()->vkAcquireNextImageKHR( static_cast( m_device ), - static_cast( m_swapchain ), - timeout, - static_cast( semaphore ), - static_cast( fence ), - &imageIndex ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::acquireNextImage", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eTimeout, - VULKAN_HPP_NAMESPACE::Result::eNotReady, - VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return std::make_pair( static_cast( result ), imageIndex ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Queue::presentKHR( const VULKAN_HPP_NAMESPACE::PresentInfoKHR & presentInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueuePresentKHR && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkQueuePresentKHR( static_cast( m_queue ), reinterpret_cast( &presentInfo ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Queue::presentKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR Device::getGroupPresentCapabilitiesKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceGroupPresentCapabilitiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR deviceGroupPresentCapabilities; - VkResult result = getDispatcher()->vkGetDeviceGroupPresentCapabilitiesKHR( - static_cast( m_device ), reinterpret_cast( &deviceGroupPresentCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupPresentCapabilitiesKHR" ); - - return deviceGroupPresentCapabilities; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR - Device::getGroupSurfacePresentModesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceGroupSurfacePresentModesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes; - VkResult result = getDispatcher()->vkGetDeviceGroupSurfacePresentModesKHR( - static_cast( m_device ), static_cast( surface ), reinterpret_cast( &modes ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModesKHR" ); - - return modes; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getPresentRectanglesKHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDevicePresentRectanglesKHR && - "Function needs extension enabled!" ); - - std::vector rects; - uint32_t rectCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDevicePresentRectanglesKHR( - static_cast( m_physicalDevice ), static_cast( surface ), &rectCount, nullptr ); - if ( ( result == VK_SUCCESS ) && rectCount ) - { - rects.resize( rectCount ); - result = getDispatcher()->vkGetPhysicalDevicePresentRectanglesKHR( - static_cast( m_physicalDevice ), static_cast( surface ), &rectCount, reinterpret_cast( rects.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getPresentRectanglesKHR" ); - VULKAN_HPP_ASSERT( rectCount <= rects.size() ); - if ( rectCount < rects.size() ) - { - rects.resize( rectCount ); - } - return rects; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair - Device::acquireNextImage2KHR( const VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR & acquireInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireNextImage2KHR && "Function needs extension enabled!" ); - - uint32_t imageIndex; - VkResult result = getDispatcher()->vkAcquireNextImage2KHR( - static_cast( m_device ), reinterpret_cast( &acquireInfo ), &imageIndex ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::acquireNextImage2KHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eTimeout, - VULKAN_HPP_NAMESPACE::Result::eNotReady, - VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return std::make_pair( static_cast( result ), imageIndex ); - } - - //=== VK_KHR_display === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getDisplayPropertiesKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceDisplayPropertiesKHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceDisplayPropertiesKHR( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetPhysicalDeviceDisplayPropertiesKHR( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getDisplayPlanePropertiesKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceDisplayPlanePropertiesKHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceDisplayPlanePropertiesKHR( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetPhysicalDeviceDisplayPlanePropertiesKHR( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlanePropertiesKHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getDisplayPlaneSupportedDisplaysKHR( uint32_t planeIndex ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DisplayKHRs( *this, planeIndex ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector DisplayKHR::getModeProperties() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDisplayModePropertiesKHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetDisplayModePropertiesKHR( - static_cast( m_physicalDevice ), static_cast( m_display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetDisplayModePropertiesKHR( static_cast( m_physicalDevice ), - static_cast( m_display ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DisplayKHR::getModeProperties" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DisplayModeKHR - DisplayKHR::createMode( VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DisplayModeKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR - DisplayModeKHR::getDisplayPlaneCapabilities( uint32_t planeIndex ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDisplayPlaneCapabilitiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR capabilities; - VkResult result = getDispatcher()->vkGetDisplayPlaneCapabilitiesKHR( static_cast( m_physicalDevice ), - static_cast( m_displayModeKHR ), - planeIndex, - reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DisplayModeKHR::getDisplayPlaneCapabilities" ); - - return capabilities; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createDisplayPlaneSurfaceKHR( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - //=== VK_KHR_display_swapchain === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::createSharedSwapchainsKHR( VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SwapchainKHRs( *this, createInfos, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR - Device::createSharedSwapchainKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SwapchainKHR( *this, createInfo, allocator ); - } - -# if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createXlibSurfaceKHR( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getXlibPresentationSupportKHR( uint32_t queueFamilyIndex, Display & dpy, VisualID visualID ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceXlibPresentationSupportKHR && - "Function needs extension enabled!" ); - - VkBool32 result = - getDispatcher()->vkGetPhysicalDeviceXlibPresentationSupportKHR( static_cast( m_physicalDevice ), queueFamilyIndex, &dpy, visualID ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -# if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createXcbSurfaceKHR( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 PhysicalDevice::getXcbPresentationSupportKHR( - uint32_t queueFamilyIndex, xcb_connection_t & connection, xcb_visualid_t visual_id ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceXcbPresentationSupportKHR && - "Function needs extension enabled!" ); - - VkBool32 result = getDispatcher()->vkGetPhysicalDeviceXcbPresentationSupportKHR( - static_cast( m_physicalDevice ), queueFamilyIndex, &connection, visual_id ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_XCB_KHR*/ - -# if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createWaylandSurfaceKHR( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getWaylandPresentationSupportKHR( uint32_t queueFamilyIndex, struct wl_display & display ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceWaylandPresentationSupportKHR && - "Function needs extension enabled!" ); - - VkBool32 result = - getDispatcher()->vkGetPhysicalDeviceWaylandPresentationSupportKHR( static_cast( m_physicalDevice ), queueFamilyIndex, &display ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createAndroidSurfaceKHR( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createWin32SurfaceKHR( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getWin32PresentationSupportKHR( uint32_t queueFamilyIndex ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceWin32PresentationSupportKHR && - "Function needs extension enabled!" ); - - VkBool32 result = getDispatcher()->vkGetPhysicalDeviceWin32PresentationSupportKHR( static_cast( m_physicalDevice ), queueFamilyIndex ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DebugReportCallbackEXT - Instance::createDebugReportCallbackEXT( VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DebugReportCallbackEXT( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void Instance::debugReportMessageEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags, - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, - uint64_t object, - size_t location, - int32_t messageCode, - const std::string & layerPrefix, - const std::string & message ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDebugReportMessageEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkDebugReportMessageEXT( static_cast( m_instance ), - static_cast( flags ), - static_cast( objectType_ ), - object, - location, - messageCode, - layerPrefix.c_str(), - message.c_str() ); - } - - //=== VK_EXT_debug_marker === - - VULKAN_HPP_INLINE void Device::debugMarkerSetObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT & tagInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDebugMarkerSetObjectTagEXT && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkDebugMarkerSetObjectTagEXT( static_cast( m_device ), reinterpret_cast( &tagInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::debugMarkerSetObjectTagEXT" ); - } - - VULKAN_HPP_INLINE void Device::debugMarkerSetObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT & nameInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDebugMarkerSetObjectNameEXT && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkDebugMarkerSetObjectNameEXT( static_cast( m_device ), - reinterpret_cast( &nameInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::debugMarkerSetObjectNameEXT" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerBeginEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDebugMarkerBeginEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDebugMarkerBeginEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &markerInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerEndEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDebugMarkerEndEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDebugMarkerEndEXT( static_cast( m_commandBuffer ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::debugMarkerInsertEXT( const VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT & markerInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDebugMarkerInsertEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDebugMarkerInsertEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &markerInfo ) ); - } - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR - PhysicalDevice::getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceVideoCapabilitiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR capabilities; - VkResult result = getDispatcher()->vkGetPhysicalDeviceVideoCapabilitiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &videoProfile ), - reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoCapabilitiesKHR" ); - - return capabilities; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getVideoCapabilitiesKHR( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR & videoProfile ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceVideoCapabilitiesKHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR & capabilities = structureChain.template get(); - VkResult result = getDispatcher()->vkGetPhysicalDeviceVideoCapabilitiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &videoProfile ), - reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoCapabilitiesKHR" ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getVideoFormatPropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR & videoFormatInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceVideoFormatPropertiesKHR && - "Function needs extension enabled!" ); - - std::vector videoFormatProperties; - uint32_t videoFormatPropertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceVideoFormatPropertiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &videoFormatInfo ), - &videoFormatPropertyCount, - nullptr ); - if ( ( result == VK_SUCCESS ) && videoFormatPropertyCount ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - result = - getDispatcher()->vkGetPhysicalDeviceVideoFormatPropertiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &videoFormatInfo ), - &videoFormatPropertyCount, - reinterpret_cast( videoFormatProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getVideoFormatPropertiesKHR" ); - VULKAN_HPP_ASSERT( videoFormatPropertyCount <= videoFormatProperties.size() ); - if ( videoFormatPropertyCount < videoFormatProperties.size() ) - { - videoFormatProperties.resize( videoFormatPropertyCount ); - } - return videoFormatProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::VideoSessionKHR - Device::createVideoSessionKHR( VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::VideoSessionKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector VideoSessionKHR::getMemoryRequirements() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetVideoSessionMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - std::vector memoryRequirements; - uint32_t memoryRequirementsCount; - VkResult result; - do - { - result = getDispatcher()->vkGetVideoSessionMemoryRequirementsKHR( - static_cast( m_device ), static_cast( m_videoSession ), &memoryRequirementsCount, nullptr ); - if ( ( result == VK_SUCCESS ) && memoryRequirementsCount ) - { - memoryRequirements.resize( memoryRequirementsCount ); - result = - getDispatcher()->vkGetVideoSessionMemoryRequirementsKHR( static_cast( m_device ), - static_cast( m_videoSession ), - &memoryRequirementsCount, - reinterpret_cast( memoryRequirements.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::VideoSessionKHR::getMemoryRequirements" ); - VULKAN_HPP_ASSERT( memoryRequirementsCount <= memoryRequirements.size() ); - if ( memoryRequirementsCount < memoryRequirements.size() ) - { - memoryRequirements.resize( memoryRequirementsCount ); - } - return memoryRequirements; - } - - VULKAN_HPP_INLINE void - VideoSessionKHR::bindMemory( ArrayProxy const & bindSessionMemoryInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkBindVideoSessionMemoryKHR && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkBindVideoSessionMemoryKHR( static_cast( m_device ), - static_cast( m_videoSession ), - bindSessionMemoryInfos.size(), - reinterpret_cast( bindSessionMemoryInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::VideoSessionKHR::bindMemory" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::VideoSessionParametersKHR - Device::createVideoSessionParametersKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::VideoSessionParametersKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void VideoSessionParametersKHR::update( const VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR & updateInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkUpdateVideoSessionParametersKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkUpdateVideoSessionParametersKHR( static_cast( m_device ), - static_cast( m_videoSessionParameters ), - reinterpret_cast( &updateInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::VideoSessionParametersKHR::update" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR & beginInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginVideoCodingKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginVideoCodingKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &beginInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR & endCodingInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndVideoCodingKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndVideoCodingKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &endCodingInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::controlVideoCodingKHR( const VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR & codingControlInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdControlVideoCodingKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdControlVideoCodingKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &codingControlInfo ) ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - VULKAN_HPP_INLINE void CommandBuffer::decodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR & frameInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDecodeVideoKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDecodeVideoKHR( static_cast( m_commandBuffer ), reinterpret_cast( &frameInfo ) ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - VULKAN_HPP_INLINE void CommandBuffer::bindTransformFeedbackBuffersEXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBindTransformFeedbackBuffersEXT && - "Function needs extension enabled!" ); - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindTransformFeedbackBuffersEXT: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindTransformFeedbackBuffersEXT: buffers.size() != sizes.size()" ); - } - - getDispatcher()->vkCmdBindTransformFeedbackBuffersEXT( static_cast( m_commandBuffer ), - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginTransformFeedbackEXT && - "Function needs extension enabled!" ); - if ( !counterBufferOffsets.empty() && counterBuffers.size() != counterBufferOffsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::beginTransformFeedbackEXT: counterBuffers.size() != counterBufferOffsets.size()" ); - } - - getDispatcher()->vkCmdBeginTransformFeedbackEXT( static_cast( m_commandBuffer ), - firstCounterBuffer, - counterBuffers.size(), - reinterpret_cast( counterBuffers.data() ), - reinterpret_cast( counterBufferOffsets.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endTransformFeedbackEXT( uint32_t firstCounterBuffer, - ArrayProxy const & counterBuffers, - ArrayProxy const & counterBufferOffsets ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndTransformFeedbackEXT && - "Function needs extension enabled!" ); - if ( !counterBufferOffsets.empty() && counterBuffers.size() != counterBufferOffsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::endTransformFeedbackEXT: counterBuffers.size() != counterBufferOffsets.size()" ); - } - - getDispatcher()->vkCmdEndTransformFeedbackEXT( static_cast( m_commandBuffer ), - firstCounterBuffer, - counterBuffers.size(), - reinterpret_cast( counterBuffers.data() ), - reinterpret_cast( counterBufferOffsets.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query, - VULKAN_HPP_NAMESPACE::QueryControlFlags flags, - uint32_t index ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginQueryIndexedEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginQueryIndexedEXT( - static_cast( m_commandBuffer ), static_cast( queryPool ), query, static_cast( flags ), index ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::endQueryIndexedEXT( VULKAN_HPP_NAMESPACE::QueryPool queryPool, uint32_t query, uint32_t index ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndQueryIndexedEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndQueryIndexedEXT( static_cast( m_commandBuffer ), static_cast( queryPool ), query, index ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectByteCountEXT( uint32_t instanceCount, - uint32_t firstInstance, - VULKAN_HPP_NAMESPACE::Buffer counterBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize counterBufferOffset, - uint32_t counterOffset, - uint32_t vertexStride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawIndirectByteCountEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawIndirectByteCountEXT( static_cast( m_commandBuffer ), - instanceCount, - firstInstance, - static_cast( counterBuffer ), - static_cast( counterBufferOffset ), - counterOffset, - vertexStride ); - } - - //=== VK_NVX_binary_import === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::CuModuleNVX - Device::createCuModuleNVX( VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::CuModuleNVX( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::CuFunctionNVX - Device::createCuFunctionNVX( VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::CuFunctionNVX( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void CommandBuffer::cuLaunchKernelNVX( const VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX & launchInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCuLaunchKernelNVX && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCuLaunchKernelNVX( static_cast( m_commandBuffer ), reinterpret_cast( &launchInfo ) ); - } - - //=== VK_NVX_image_view_handle === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint32_t - Device::getImageViewHandleNVX( const VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageViewHandleNVX && "Function needs extension enabled!" ); - - uint32_t result = - getDispatcher()->vkGetImageViewHandleNVX( static_cast( m_device ), reinterpret_cast( &info ) ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX ImageView::getAddressNVX() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageViewAddressNVX && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX properties; - VkResult result = getDispatcher()->vkGetImageViewAddressNVX( - static_cast( m_device ), static_cast( m_imageView ), reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::ImageView::getAddressNVX" ); - - return properties; - } - - //=== VK_AMD_draw_indirect_count === - - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawIndirectCountAMD && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawIndirectCountAMD( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountAMD( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawIndexedIndirectCountAMD && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawIndexedIndirectCountAMD( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_AMD_shader_info === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Pipeline::getShaderInfoAMD( VULKAN_HPP_NAMESPACE::ShaderStageFlagBits shaderStage, - VULKAN_HPP_NAMESPACE::ShaderInfoTypeAMD infoType ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetShaderInfoAMD && "Function needs extension enabled!" ); - - std::vector info; - size_t infoSize; - VkResult result; - do - { - result = getDispatcher()->vkGetShaderInfoAMD( static_cast( m_device ), - static_cast( m_pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - nullptr ); - if ( ( result == VK_SUCCESS ) && infoSize ) - { - info.resize( infoSize ); - result = getDispatcher()->vkGetShaderInfoAMD( static_cast( m_device ), - static_cast( m_pipeline ), - static_cast( shaderStage ), - static_cast( infoType ), - &infoSize, - reinterpret_cast( info.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getShaderInfoAMD" ); - VULKAN_HPP_ASSERT( infoSize <= info.size() ); - if ( infoSize < info.size() ) - { - info.resize( infoSize ); - } - return info; - } - - //=== VK_KHR_dynamic_rendering === - - VULKAN_HPP_INLINE void CommandBuffer::beginRenderingKHR( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginRenderingKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginRenderingKHR( static_cast( m_commandBuffer ), reinterpret_cast( &renderingInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endRenderingKHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndRenderingKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndRenderingKHR( static_cast( m_commandBuffer ) ); - } - -# if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createStreamDescriptorSurfaceGGP( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV - PhysicalDevice::getExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::Format format, - VULKAN_HPP_NAMESPACE::ImageType type, - VULKAN_HPP_NAMESPACE::ImageTiling tiling, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV externalHandleType ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceExternalImageFormatPropertiesNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV externalImageFormatProperties; - VkResult result = getDispatcher()->vkGetPhysicalDeviceExternalImageFormatPropertiesNV( - static_cast( m_physicalDevice ), - static_cast( format ), - static_cast( type ), - static_cast( tiling ), - static_cast( usage ), - static_cast( flags ), - static_cast( externalHandleType ), - reinterpret_cast( &externalImageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getExternalImageFormatPropertiesNV" ); - - return externalImageFormatProperties; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_external_memory_win32 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE HANDLE DeviceMemory::getMemoryWin32HandleNV( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryWin32HandleNV && - "Function needs extension enabled!" ); - - HANDLE handle; - VkResult result = getDispatcher()->vkGetMemoryWin32HandleNV( - static_cast( m_device ), static_cast( m_memory ), static_cast( handleType ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DeviceMemory::getMemoryWin32HandleNV" ); - - return handle; - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_get_physical_device_properties2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 PhysicalDevice::getFeatures2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceFeatures2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 features; - getDispatcher()->vkGetPhysicalDeviceFeatures2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &features ) ); - - return features; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getFeatures2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceFeatures2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 & features = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceFeatures2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &features ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 PhysicalDevice::getProperties2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceProperties2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 properties; - getDispatcher()->vkGetPhysicalDeviceProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &properties ) ); - - return properties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getProperties2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceProperties2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 & properties = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &properties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::FormatProperties2 - PhysicalDevice::getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceFormatProperties2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::FormatProperties2 formatProperties; - getDispatcher()->vkGetPhysicalDeviceFormatProperties2KHR( - static_cast( m_physicalDevice ), static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return formatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getFormatProperties2KHR( VULKAN_HPP_NAMESPACE::Format format ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceFormatProperties2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::FormatProperties2 & formatProperties = structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceFormatProperties2KHR( - static_cast( m_physicalDevice ), static_cast( format ), reinterpret_cast( &formatProperties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ImageFormatProperties2 - PhysicalDevice::getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 imageFormatProperties; - VkResult result = - getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2KHR" ); - - return imageFormatProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 & imageFormatInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ImageFormatProperties2 & imageFormatProperties = structureChain.template get(); - VkResult result = - getDispatcher()->vkGetPhysicalDeviceImageFormatProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &imageFormatInfo ), - reinterpret_cast( &imageFormatProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getImageFormatProperties2KHR" ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2KHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR && - "Function needs extension enabled!" ); - - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), - &queueFamilyPropertyCount, - reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - queueFamilyProperties.resize( queueFamilyPropertyCount ); - } - return queueFamilyProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getQueueFamilyProperties2KHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR && - "Function needs extension enabled!" ); - - std::vector structureChains; - std::vector queueFamilyProperties; - uint32_t queueFamilyPropertyCount; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), &queueFamilyPropertyCount, nullptr ); - structureChains.resize( queueFamilyPropertyCount ); - queueFamilyProperties.resize( queueFamilyPropertyCount ); - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - queueFamilyProperties[i].pNext = structureChains[i].template get().pNext; - } - getDispatcher()->vkGetPhysicalDeviceQueueFamilyProperties2KHR( static_cast( m_physicalDevice ), - &queueFamilyPropertyCount, - reinterpret_cast( queueFamilyProperties.data() ) ); - - VULKAN_HPP_ASSERT( queueFamilyPropertyCount <= queueFamilyProperties.size() ); - if ( queueFamilyPropertyCount < queueFamilyProperties.size() ) - { - structureChains.resize( queueFamilyPropertyCount ); - } - for ( uint32_t i = 0; i < queueFamilyPropertyCount; i++ ) - { - structureChains[i].template get() = queueFamilyProperties[i]; - } - return structureChains; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 - PhysicalDevice::getMemoryProperties2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceMemoryProperties2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 memoryProperties; - getDispatcher()->vkGetPhysicalDeviceMemoryProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &memoryProperties ) ); - - return memoryProperties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain PhysicalDevice::getMemoryProperties2KHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceMemoryProperties2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 & memoryProperties = - structureChain.template get(); - getDispatcher()->vkGetPhysicalDeviceMemoryProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &memoryProperties ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSparseImageFormatProperties2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 & formatInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &formatInfo ), - &propertyCount, - nullptr ); - properties.resize( propertyCount ); - getDispatcher()->vkGetPhysicalDeviceSparseImageFormatProperties2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &formatInfo ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - //=== VK_KHR_device_group === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags - Device::getGroupPeerMemoryFeaturesKHR( uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceGroupPeerMemoryFeaturesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::PeerMemoryFeatureFlags peerMemoryFeatures; - getDispatcher()->vkGetDeviceGroupPeerMemoryFeaturesKHR( static_cast( m_device ), - heapIndex, - localDeviceIndex, - remoteDeviceIndex, - reinterpret_cast( &peerMemoryFeatures ) ); - - return peerMemoryFeatures; - } - - VULKAN_HPP_INLINE void CommandBuffer::setDeviceMaskKHR( uint32_t deviceMask ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDeviceMaskKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDeviceMaskKHR( static_cast( m_commandBuffer ), deviceMask ); - } - - VULKAN_HPP_INLINE void CommandBuffer::dispatchBaseKHR( uint32_t baseGroupX, - uint32_t baseGroupY, - uint32_t baseGroupZ, - uint32_t groupCountX, - uint32_t groupCountY, - uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDispatchBaseKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDispatchBaseKHR( - static_cast( m_commandBuffer ), baseGroupX, baseGroupY, baseGroupZ, groupCountX, groupCountY, groupCountZ ); - } - -# if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createViSurfaceNN( VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_KHR_maintenance1 === - - VULKAN_HPP_INLINE void CommandPool::trimKHR( VULKAN_HPP_NAMESPACE::CommandPoolTrimFlags flags ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkTrimCommandPoolKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkTrimCommandPoolKHR( - static_cast( m_device ), static_cast( m_commandPool ), static_cast( flags ) ); - } - - //=== VK_KHR_device_group_creation === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Instance::enumeratePhysicalDeviceGroupsKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkEnumeratePhysicalDeviceGroupsKHR && - "Function needs extension enabled!" ); - - std::vector physicalDeviceGroupProperties; - uint32_t physicalDeviceGroupCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumeratePhysicalDeviceGroupsKHR( static_cast( m_instance ), &physicalDeviceGroupCount, nullptr ); - if ( ( result == VK_SUCCESS ) && physicalDeviceGroupCount ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - result = - getDispatcher()->vkEnumeratePhysicalDeviceGroupsKHR( static_cast( m_instance ), - &physicalDeviceGroupCount, - reinterpret_cast( physicalDeviceGroupProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Instance::enumeratePhysicalDeviceGroupsKHR" ); - VULKAN_HPP_ASSERT( physicalDeviceGroupCount <= physicalDeviceGroupProperties.size() ); - if ( physicalDeviceGroupCount < physicalDeviceGroupProperties.size() ) - { - physicalDeviceGroupProperties.resize( physicalDeviceGroupCount ); - } - return physicalDeviceGroupProperties; - } - - //=== VK_KHR_external_memory_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalBufferProperties PhysicalDevice::getExternalBufferPropertiesKHR( - const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo & externalBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceExternalBufferPropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ExternalBufferProperties externalBufferProperties; - getDispatcher()->vkGetPhysicalDeviceExternalBufferPropertiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &externalBufferInfo ), - reinterpret_cast( &externalBufferProperties ) ); - - return externalBufferProperties; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_memory_win32 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE HANDLE - Device::getMemoryWin32HandleKHR( const VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR & getWin32HandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryWin32HandleKHR && - "Function needs extension enabled!" ); - - HANDLE handle; - VkResult result = getDispatcher()->vkGetMemoryWin32HandleKHR( - static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandleKHR" ); - - return handle; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR - Device::getMemoryWin32HandlePropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, HANDLE handle ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryWin32HandlePropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR memoryWin32HandleProperties; - VkResult result = - getDispatcher()->vkGetMemoryWin32HandlePropertiesKHR( static_cast( m_device ), - static_cast( handleType ), - handle, - reinterpret_cast( &memoryWin32HandleProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryWin32HandlePropertiesKHR" ); - - return memoryWin32HandleProperties; - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_memory_fd === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE int Device::getMemoryFdKHR( const VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR & getFdInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryFdKHR && "Function needs extension enabled!" ); - - int fd; - VkResult result = - getDispatcher()->vkGetMemoryFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdKHR" ); - - return fd; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR - Device::getMemoryFdPropertiesKHR( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, int fd ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryFdPropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR memoryFdProperties; - VkResult result = getDispatcher()->vkGetMemoryFdPropertiesKHR( static_cast( m_device ), - static_cast( handleType ), - fd, - reinterpret_cast( &memoryFdProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryFdPropertiesKHR" ); - - return memoryFdProperties; - } - - //=== VK_KHR_external_semaphore_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties PhysicalDevice::getExternalSemaphorePropertiesKHR( - const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo & externalSemaphoreInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceExternalSemaphorePropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties externalSemaphoreProperties; - getDispatcher()->vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( - static_cast( m_physicalDevice ), - reinterpret_cast( &externalSemaphoreInfo ), - reinterpret_cast( &externalSemaphoreProperties ) ); - - return externalSemaphoreProperties; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_semaphore_win32 === - - VULKAN_HPP_INLINE void - Device::importSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR & importSemaphoreWin32HandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkImportSemaphoreWin32HandleKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkImportSemaphoreWin32HandleKHR( - static_cast( m_device ), reinterpret_cast( &importSemaphoreWin32HandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreWin32HandleKHR" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE HANDLE - Device::getSemaphoreWin32HandleKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR & getWin32HandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSemaphoreWin32HandleKHR && - "Function needs extension enabled!" ); - - HANDLE handle; - VkResult result = getDispatcher()->vkGetSemaphoreWin32HandleKHR( - static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreWin32HandleKHR" ); - - return handle; - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_semaphore_fd === - - VULKAN_HPP_INLINE void Device::importSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR & importSemaphoreFdInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkImportSemaphoreFdKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkImportSemaphoreFdKHR( static_cast( m_device ), - reinterpret_cast( &importSemaphoreFdInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreFdKHR" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE int Device::getSemaphoreFdKHR( const VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR & getFdInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSemaphoreFdKHR && "Function needs extension enabled!" ); - - int fd; - VkResult result = - getDispatcher()->vkGetSemaphoreFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreFdKHR" ); - - return fd; - } - - //=== VK_KHR_push_descriptor === - - VULKAN_HPP_INLINE void - CommandBuffer::pushDescriptorSetKHR( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - ArrayProxy const & descriptorWrites ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdPushDescriptorSetKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdPushDescriptorSetKHR( static_cast( m_commandBuffer ), - static_cast( pipelineBindPoint ), - static_cast( layout ), - set, - descriptorWrites.size(), - reinterpret_cast( descriptorWrites.data() ) ); - } - - template - VULKAN_HPP_INLINE void CommandBuffer::pushDescriptorSetWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - VULKAN_HPP_NAMESPACE::PipelineLayout layout, - uint32_t set, - DataType const & data ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdPushDescriptorSetWithTemplateKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdPushDescriptorSetWithTemplateKHR( static_cast( m_commandBuffer ), - static_cast( descriptorUpdateTemplate ), - static_cast( layout ), - set, - reinterpret_cast( &data ) ); - } - - //=== VK_EXT_conditional_rendering === - - VULKAN_HPP_INLINE void CommandBuffer::beginConditionalRenderingEXT( - const VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT & conditionalRenderingBegin ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginConditionalRenderingEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginConditionalRenderingEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &conditionalRenderingBegin ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endConditionalRenderingEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndConditionalRenderingEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndConditionalRenderingEXT( static_cast( m_commandBuffer ) ); - } - - //=== VK_KHR_descriptor_update_template === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate - Device::createDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DescriptorUpdateTemplate( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void - Device::destroyDescriptorUpdateTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - Optional allocator ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDestroyDescriptorUpdateTemplateKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkDestroyDescriptorUpdateTemplateKHR( - static_cast( m_device ), - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( static_cast( allocator ) ) ); - } - - template - VULKAN_HPP_INLINE void DescriptorSet::updateWithTemplateKHR( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate descriptorUpdateTemplate, - DataType const & data ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkUpdateDescriptorSetWithTemplateKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkUpdateDescriptorSetWithTemplateKHR( static_cast( m_device ), - static_cast( m_descriptorSet ), - static_cast( descriptorUpdateTemplate ), - reinterpret_cast( &data ) ); - } - - //=== VK_NV_clip_space_w_scaling === - - VULKAN_HPP_INLINE void - CommandBuffer::setViewportWScalingNV( uint32_t firstViewport, - ArrayProxy const & viewportWScalings ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetViewportWScalingNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetViewportWScalingNV( static_cast( m_commandBuffer ), - firstViewport, - viewportWScalings.size(), - reinterpret_cast( viewportWScalings.data() ) ); - } - -# if defined( VK_USE_PLATFORM_XLIB_XRANDR_EXT ) - //=== VK_EXT_acquire_xlib_display === - - VULKAN_HPP_INLINE void PhysicalDevice::acquireXlibDisplayEXT( Display & dpy, VULKAN_HPP_NAMESPACE::DisplayKHR display ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireXlibDisplayEXT && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkAcquireXlibDisplayEXT( static_cast( m_physicalDevice ), &dpy, static_cast( display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::acquireXlibDisplayEXT" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DisplayKHR PhysicalDevice::getRandROutputDisplayEXT( Display & dpy, - RROutput rrOutput ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DisplayKHR( *this, dpy, rrOutput ); - } -# endif /*VK_USE_PLATFORM_XLIB_XRANDR_EXT*/ - - //=== VK_EXT_display_surface_counter === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT - PhysicalDevice::getSurfaceCapabilities2EXT( VULKAN_HPP_NAMESPACE::SurfaceKHR surface ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2EXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT surfaceCapabilities; - VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2EXT( static_cast( m_physicalDevice ), - static_cast( surface ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2EXT" ); - - return surfaceCapabilities; - } - - //=== VK_EXT_display_control === - - VULKAN_HPP_INLINE void Device::displayPowerControlEXT( VULKAN_HPP_NAMESPACE::DisplayKHR display, - const VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT & displayPowerInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDisplayPowerControlEXT && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkDisplayPowerControlEXT( - static_cast( m_device ), static_cast( display ), reinterpret_cast( &displayPowerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::displayPowerControlEXT" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Fence - Device::registerEventEXT( VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT const & deviceEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Fence( *this, deviceEventInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Fence - Device::registerDisplayEventEXT( VULKAN_HPP_NAMESPACE::VULKAN_HPP_RAII_NAMESPACE::DisplayKHR const & display, - VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT const & displayEventInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Fence( *this, display, displayEventInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t SwapchainKHR::getCounterEXT( VULKAN_HPP_NAMESPACE::SurfaceCounterFlagBitsEXT counter ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSwapchainCounterEXT && "Function needs extension enabled!" ); - - uint64_t counterValue; - VkResult result = getDispatcher()->vkGetSwapchainCounterEXT( - static_cast( m_device ), static_cast( m_swapchain ), static_cast( counter ), &counterValue ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getCounterEXT" ); - - return counterValue; - } - - //=== VK_GOOGLE_display_timing === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE SwapchainKHR::getRefreshCycleDurationGOOGLE() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRefreshCycleDurationGOOGLE && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE displayTimingProperties; - VkResult result = getDispatcher()->vkGetRefreshCycleDurationGOOGLE( static_cast( m_device ), - static_cast( m_swapchain ), - reinterpret_cast( &displayTimingProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getRefreshCycleDurationGOOGLE" ); - - return displayTimingProperties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector SwapchainKHR::getPastPresentationTimingGOOGLE() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPastPresentationTimingGOOGLE && - "Function needs extension enabled!" ); - - std::vector presentationTimings; - uint32_t presentationTimingCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPastPresentationTimingGOOGLE( - static_cast( m_device ), static_cast( m_swapchain ), &presentationTimingCount, nullptr ); - if ( ( result == VK_SUCCESS ) && presentationTimingCount ) - { - presentationTimings.resize( presentationTimingCount ); - result = getDispatcher()->vkGetPastPresentationTimingGOOGLE( static_cast( m_device ), - static_cast( m_swapchain ), - &presentationTimingCount, - reinterpret_cast( presentationTimings.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getPastPresentationTimingGOOGLE" ); - VULKAN_HPP_ASSERT( presentationTimingCount <= presentationTimings.size() ); - if ( presentationTimingCount < presentationTimings.size() ) - { - presentationTimings.resize( presentationTimingCount ); - } - return presentationTimings; - } - - //=== VK_EXT_discard_rectangles === - - VULKAN_HPP_INLINE void - CommandBuffer::setDiscardRectangleEXT( uint32_t firstDiscardRectangle, - ArrayProxy const & discardRectangles ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDiscardRectangleEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDiscardRectangleEXT( static_cast( m_commandBuffer ), - firstDiscardRectangle, - discardRectangles.size(), - reinterpret_cast( discardRectangles.data() ) ); - } - - //=== VK_EXT_hdr_metadata === - - VULKAN_HPP_INLINE void Device::setHdrMetadataEXT( ArrayProxy const & swapchains, - ArrayProxy const & metadata ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetHdrMetadataEXT && "Function needs extension enabled!" ); - if ( swapchains.size() != metadata.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::setHdrMetadataEXT: swapchains.size() != metadata.size()" ); - } - - getDispatcher()->vkSetHdrMetadataEXT( static_cast( m_device ), - swapchains.size(), - reinterpret_cast( swapchains.data() ), - reinterpret_cast( metadata.data() ) ); - } - - //=== VK_KHR_create_renderpass2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::RenderPass - Device::createRenderPass2KHR( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::RenderPass( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginRenderPass2KHR( const VULKAN_HPP_NAMESPACE::RenderPassBeginInfo & renderPassBegin, - const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginRenderPass2KHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginRenderPass2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( &renderPassBegin ), - reinterpret_cast( &subpassBeginInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::nextSubpass2KHR( const VULKAN_HPP_NAMESPACE::SubpassBeginInfo & subpassBeginInfo, - const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdNextSubpass2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdNextSubpass2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( &subpassBeginInfo ), - reinterpret_cast( &subpassEndInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endRenderPass2KHR( const VULKAN_HPP_NAMESPACE::SubpassEndInfo & subpassEndInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndRenderPass2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndRenderPass2KHR( static_cast( m_commandBuffer ), reinterpret_cast( &subpassEndInfo ) ); - } - - //=== VK_KHR_shared_presentable_image === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result SwapchainKHR::getStatus() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSwapchainStatusKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkGetSwapchainStatusKHR( static_cast( m_device ), static_cast( m_swapchain ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::getStatus", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } - - //=== VK_KHR_external_fence_capabilities === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExternalFenceProperties - PhysicalDevice::getExternalFencePropertiesKHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo & externalFenceInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceExternalFencePropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ExternalFenceProperties externalFenceProperties; - getDispatcher()->vkGetPhysicalDeviceExternalFencePropertiesKHR( static_cast( m_physicalDevice ), - reinterpret_cast( &externalFenceInfo ), - reinterpret_cast( &externalFenceProperties ) ); - - return externalFenceProperties; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_external_fence_win32 === - - VULKAN_HPP_INLINE void Device::importFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR & importFenceWin32HandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkImportFenceWin32HandleKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkImportFenceWin32HandleKHR( - static_cast( m_device ), reinterpret_cast( &importFenceWin32HandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importFenceWin32HandleKHR" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE HANDLE - Device::getFenceWin32HandleKHR( const VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR & getWin32HandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetFenceWin32HandleKHR && - "Function needs extension enabled!" ); - - HANDLE handle; - VkResult result = getDispatcher()->vkGetFenceWin32HandleKHR( - static_cast( m_device ), reinterpret_cast( &getWin32HandleInfo ), &handle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceWin32HandleKHR" ); - - return handle; - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_KHR_external_fence_fd === - - VULKAN_HPP_INLINE void Device::importFenceFdKHR( const VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR & importFenceFdInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkImportFenceFdKHR && "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkImportFenceFdKHR( static_cast( m_device ), reinterpret_cast( &importFenceFdInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importFenceFdKHR" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE int Device::getFenceFdKHR( const VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR & getFdInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetFenceFdKHR && "Function needs extension enabled!" ); - - int fd; - VkResult result = getDispatcher()->vkGetFenceFdKHR( static_cast( m_device ), reinterpret_cast( &getFdInfo ), &fd ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getFenceFdKHR" ); - - return fd; - } - - //=== VK_KHR_performance_query === - - VULKAN_HPP_NODISCARD - VULKAN_HPP_INLINE std::pair, std::vector> - PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR( uint32_t queueFamilyIndex ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR && - "Function needs extension enabled!" ); - - std::pair, std::vector> data; - std::vector & counters = data.first; - std::vector & counterDescriptions = data.second; - uint32_t counterCount; - VkResult result; - do - { - result = getDispatcher()->vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - static_cast( m_physicalDevice ), queueFamilyIndex, &counterCount, nullptr, nullptr ); - if ( ( result == VK_SUCCESS ) && counterCount ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - result = getDispatcher()->vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( - static_cast( m_physicalDevice ), - queueFamilyIndex, - &counterCount, - reinterpret_cast( counters.data() ), - reinterpret_cast( counterDescriptions.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::enumerateQueueFamilyPerformanceQueryCountersKHR" ); - VULKAN_HPP_ASSERT( counterCount <= counters.size() ); - if ( counterCount < counters.size() ) - { - counters.resize( counterCount ); - counterDescriptions.resize( counterCount ); - } - return data; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint32_t PhysicalDevice::getQueueFamilyPerformanceQueryPassesKHR( - const VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR & performanceQueryCreateInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR && - "Function needs extension enabled!" ); - - uint32_t numPasses; - getDispatcher()->vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( - static_cast( m_physicalDevice ), - reinterpret_cast( &performanceQueryCreateInfo ), - &numPasses ); - - return numPasses; - } - - VULKAN_HPP_INLINE void Device::acquireProfilingLockKHR( const VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireProfilingLockKHR && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkAcquireProfilingLockKHR( static_cast( m_device ), reinterpret_cast( &info ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::acquireProfilingLockKHR" ); - } - - VULKAN_HPP_INLINE void Device::releaseProfilingLockKHR() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkReleaseProfilingLockKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkReleaseProfilingLockKHR( static_cast( m_device ) ); - } - - //=== VK_KHR_get_surface_capabilities2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR - PhysicalDevice::getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR surfaceCapabilities; - VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2KHR" ); - - return surfaceCapabilities; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - PhysicalDevice::getSurfaceCapabilities2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR & surfaceCapabilities = structureChain.template get(); - VkResult result = getDispatcher()->vkGetPhysicalDeviceSurfaceCapabilities2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - reinterpret_cast( &surfaceCapabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceCapabilities2KHR" ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR && - "Function needs extension enabled!" ); - - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - surfaceFormats.resize( surfaceFormatCount ); - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - surfaceFormats.resize( surfaceFormatCount ); - } - return surfaceFormats; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSurfaceFormats2KHR( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR && - "Function needs extension enabled!" ); - - std::vector structureChains; - std::vector surfaceFormats; - uint32_t surfaceFormatCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - nullptr ); - if ( ( result == VK_SUCCESS ) && surfaceFormatCount ) - { - structureChains.resize( surfaceFormatCount ); - surfaceFormats.resize( surfaceFormatCount ); - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - surfaceFormats[i].pNext = structureChains[i].template get().pNext; - } - result = getDispatcher()->vkGetPhysicalDeviceSurfaceFormats2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &surfaceFormatCount, - reinterpret_cast( surfaceFormats.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfaceFormats2KHR" ); - VULKAN_HPP_ASSERT( surfaceFormatCount <= surfaceFormats.size() ); - if ( surfaceFormatCount < surfaceFormats.size() ) - { - structureChains.resize( surfaceFormatCount ); - } - for ( uint32_t i = 0; i < surfaceFormatCount; i++ ) - { - structureChains[i].template get() = surfaceFormats[i]; - } - return structureChains; - } - - //=== VK_KHR_get_display_properties2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getDisplayProperties2KHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceDisplayProperties2KHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceDisplayProperties2KHR( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetPhysicalDeviceDisplayProperties2KHR( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getDisplayPlaneProperties2KHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceDisplayPlaneProperties2KHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceDisplayPlaneProperties2KHR( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetPhysicalDeviceDisplayPlaneProperties2KHR( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneProperties2KHR" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector DisplayKHR::getModeProperties2() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDisplayModeProperties2KHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = getDispatcher()->vkGetDisplayModeProperties2KHR( - static_cast( m_physicalDevice ), static_cast( m_display ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetDisplayModeProperties2KHR( static_cast( m_physicalDevice ), - static_cast( m_display ), - &propertyCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DisplayKHR::getModeProperties2" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR - PhysicalDevice::getDisplayPlaneCapabilities2KHR( const VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR & displayPlaneInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDisplayPlaneCapabilities2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR capabilities; - VkResult result = getDispatcher()->vkGetDisplayPlaneCapabilities2KHR( static_cast( m_physicalDevice ), - reinterpret_cast( &displayPlaneInfo ), - reinterpret_cast( &capabilities ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getDisplayPlaneCapabilities2KHR" ); - - return capabilities; - } - -# if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createIOSSurfaceMVK( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_IOS_MVK*/ - -# if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createMacOSSurfaceMVK( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - VULKAN_HPP_INLINE void Device::setDebugUtilsObjectNameEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT & nameInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetDebugUtilsObjectNameEXT && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkSetDebugUtilsObjectNameEXT( static_cast( m_device ), - reinterpret_cast( &nameInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setDebugUtilsObjectNameEXT" ); - } - - VULKAN_HPP_INLINE void Device::setDebugUtilsObjectTagEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT & tagInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetDebugUtilsObjectTagEXT && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkSetDebugUtilsObjectTagEXT( static_cast( m_device ), reinterpret_cast( &tagInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setDebugUtilsObjectTagEXT" ); - } - - VULKAN_HPP_INLINE void Queue::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueueBeginDebugUtilsLabelEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkQueueBeginDebugUtilsLabelEXT( static_cast( m_queue ), reinterpret_cast( &labelInfo ) ); - } - - VULKAN_HPP_INLINE void Queue::endDebugUtilsLabelEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueueEndDebugUtilsLabelEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkQueueEndDebugUtilsLabelEXT( static_cast( m_queue ) ); - } - - VULKAN_HPP_INLINE void Queue::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueueInsertDebugUtilsLabelEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkQueueInsertDebugUtilsLabelEXT( static_cast( m_queue ), reinterpret_cast( &labelInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::beginDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBeginDebugUtilsLabelEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBeginDebugUtilsLabelEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &labelInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::endDebugUtilsLabelEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEndDebugUtilsLabelEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEndDebugUtilsLabelEXT( static_cast( m_commandBuffer ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::insertDebugUtilsLabelEXT( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT & labelInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdInsertDebugUtilsLabelEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdInsertDebugUtilsLabelEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &labelInfo ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DebugUtilsMessengerEXT - Instance::createDebugUtilsMessengerEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DebugUtilsMessengerEXT( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void - Instance::submitDebugUtilsMessageEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageTypes, - const VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT & callbackData ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSubmitDebugUtilsMessageEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkSubmitDebugUtilsMessageEXT( static_cast( m_instance ), - static_cast( messageSeverity ), - static_cast( messageTypes ), - reinterpret_cast( &callbackData ) ); - } - -# if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_ANDROID_external_memory_android_hardware_buffer === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID - Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer ) const - { - VULKAN_HPP_ASSERT( - getDispatcher()->vkGetAndroidHardwareBufferPropertiesANDROID && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID properties; - VkResult result = getDispatcher()->vkGetAndroidHardwareBufferPropertiesANDROID( - static_cast( m_device ), &buffer, reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAndroidHardwareBufferPropertiesANDROID" ); - - return properties; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getAndroidHardwareBufferPropertiesANDROID( const struct AHardwareBuffer & buffer ) const - { - VULKAN_HPP_ASSERT( - getDispatcher()->vkGetAndroidHardwareBufferPropertiesANDROID && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID & properties = - structureChain.template get(); - VkResult result = getDispatcher()->vkGetAndroidHardwareBufferPropertiesANDROID( - static_cast( m_device ), &buffer, reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getAndroidHardwareBufferPropertiesANDROID" ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE struct AHardwareBuffer * - Device::getMemoryAndroidHardwareBufferANDROID( const VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryAndroidHardwareBufferANDROID && - "Function needs extension enabled!" ); - - struct AHardwareBuffer * buffer; - VkResult result = getDispatcher()->vkGetMemoryAndroidHardwareBufferANDROID( - static_cast( m_device ), reinterpret_cast( &info ), &buffer ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryAndroidHardwareBufferANDROID" ); - - return buffer; - } -# endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - //=== VK_EXT_sample_locations === - - VULKAN_HPP_INLINE void - CommandBuffer::setSampleLocationsEXT( const VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT & sampleLocationsInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetSampleLocationsEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetSampleLocationsEXT( static_cast( m_commandBuffer ), - reinterpret_cast( &sampleLocationsInfo ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT - PhysicalDevice::getMultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceMultisamplePropertiesEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT multisampleProperties; - getDispatcher()->vkGetPhysicalDeviceMultisamplePropertiesEXT( static_cast( m_physicalDevice ), - static_cast( samples ), - reinterpret_cast( &multisampleProperties ) ); - - return multisampleProperties; - } - - //=== VK_KHR_get_memory_requirements2 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageMemoryRequirements2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetImageMemoryRequirements2KHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageMemoryRequirements2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetImageMemoryRequirements2KHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferMemoryRequirements2KHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetBufferMemoryRequirements2KHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferMemoryRequirements2KHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetBufferMemoryRequirements2KHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirements2KHR( const VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageSparseMemoryRequirements2KHR && - "Function needs extension enabled!" ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - getDispatcher()->vkGetImageSparseMemoryRequirements2KHR( - static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - getDispatcher()->vkGetImageSparseMemoryRequirements2KHR( static_cast( m_device ), - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - //=== VK_KHR_acceleration_structure === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureKHR - Device::createAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructuresKHR( - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBuildAccelerationStructuresKHR && - "Function needs extension enabled!" ); - if ( infos.size() != pBuildRangeInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresKHR: infos.size() != pBuildRangeInfos.size()" ); - } - - getDispatcher()->vkCmdBuildAccelerationStructuresKHR( - static_cast( m_commandBuffer ), - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( pBuildRangeInfos.data() ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::buildAccelerationStructuresIndirectKHR( ArrayProxy const & infos, - ArrayProxy const & indirectDeviceAddresses, - ArrayProxy const & indirectStrides, - ArrayProxy const & pMaxPrimitiveCounts ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBuildAccelerationStructuresIndirectKHR && - "Function needs extension enabled!" ); - if ( infos.size() != indirectDeviceAddresses.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != indirectDeviceAddresses.size()" ); - } - if ( infos.size() != indirectStrides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != indirectStrides.size()" ); - } - if ( infos.size() != pMaxPrimitiveCounts.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::buildAccelerationStructuresIndirectKHR: infos.size() != pMaxPrimitiveCounts.size()" ); - } - - getDispatcher()->vkCmdBuildAccelerationStructuresIndirectKHR( static_cast( m_commandBuffer ), - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( indirectDeviceAddresses.data() ), - indirectStrides.data(), - pMaxPrimitiveCounts.data() ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::buildAccelerationStructuresKHR( - VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - ArrayProxy const & infos, - ArrayProxy const & pBuildRangeInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkBuildAccelerationStructuresKHR && - "Function needs extension enabled!" ); - if ( infos.size() != pBuildRangeInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::buildAccelerationStructuresKHR: infos.size() != pBuildRangeInfos.size()" ); - } - - VkResult result = getDispatcher()->vkBuildAccelerationStructuresKHR( - static_cast( m_device ), - static_cast( deferredOperation ), - infos.size(), - reinterpret_cast( infos.data() ), - reinterpret_cast( pBuildRangeInfos.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::buildAccelerationStructuresKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCopyAccelerationStructureKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkCopyAccelerationStructureKHR( static_cast( m_device ), - static_cast( deferredOperation ), - reinterpret_cast( &info ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyAccelerationStructureKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyAccelerationStructureToMemoryKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCopyAccelerationStructureToMemoryKHR && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkCopyAccelerationStructureToMemoryKHR( static_cast( m_device ), - static_cast( deferredOperation ), - reinterpret_cast( &info ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyAccelerationStructureToMemoryKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result - Device::copyMemoryToAccelerationStructureKHR( VULKAN_HPP_NAMESPACE::DeferredOperationKHR deferredOperation, - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCopyMemoryToAccelerationStructureKHR && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkCopyMemoryToAccelerationStructureKHR( static_cast( m_device ), - static_cast( deferredOperation ), - reinterpret_cast( &info ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::copyMemoryToAccelerationStructureKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, - VULKAN_HPP_NAMESPACE::Result::eOperationDeferredKHR, - VULKAN_HPP_NAMESPACE::Result::eOperationNotDeferredKHR } ); - - return static_cast( result ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t dataSize, - size_t stride ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkWriteAccelerationStructuresPropertiesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = - getDispatcher()->vkWriteAccelerationStructuresPropertiesKHR( static_cast( m_device ), - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ), - stride ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertiesKHR" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DataType - Device::writeAccelerationStructuresPropertyKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - size_t stride ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkWriteAccelerationStructuresPropertiesKHR && - "Function needs extension enabled!" ); - - DataType data; - VkResult result = - getDispatcher()->vkWriteAccelerationStructuresPropertiesKHR( static_cast( m_device ), - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - sizeof( DataType ), - reinterpret_cast( &data ), - stride ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::writeAccelerationStructuresPropertyKHR" ); - - return data; - } - - VULKAN_HPP_INLINE void - CommandBuffer::copyAccelerationStructureKHR( const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyAccelerationStructureKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyAccelerationStructureKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &info ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureToMemoryKHR( - const VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyAccelerationStructureToMemoryKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyAccelerationStructureToMemoryKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &info ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyMemoryToAccelerationStructureKHR( - const VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyMemoryToAccelerationStructureKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyMemoryToAccelerationStructureKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &info ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress - Device::getAccelerationStructureAddressKHR( const VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureDeviceAddressKHR && - "Function needs extension enabled!" ); - - VkDeviceAddress result = getDispatcher()->vkGetAccelerationStructureDeviceAddressKHR( - static_cast( m_device ), reinterpret_cast( &info ) ); - - return static_cast( result ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::writeAccelerationStructuresPropertiesKHR( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWriteAccelerationStructuresPropertiesKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdWriteAccelerationStructuresPropertiesKHR( static_cast( m_commandBuffer ), - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR Device::getAccelerationStructureCompatibilityKHR( - const VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR & versionInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceAccelerationStructureCompatibilityKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::AccelerationStructureCompatibilityKHR compatibility; - getDispatcher()->vkGetDeviceAccelerationStructureCompatibilityKHR( static_cast( m_device ), - reinterpret_cast( &versionInfo ), - reinterpret_cast( &compatibility ) ); - - return compatibility; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR - Device::getAccelerationStructureBuildSizesKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildTypeKHR buildType, - const VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR & buildInfo, - ArrayProxy const & maxPrimitiveCounts ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureBuildSizesKHR && - "Function needs extension enabled!" ); - if ( maxPrimitiveCounts.size() != buildInfo.geometryCount ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::Device::getAccelerationStructureBuildSizesKHR: maxPrimitiveCounts.size() != buildInfo.geometryCount" ); - } - - VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR sizeInfo; - getDispatcher()->vkGetAccelerationStructureBuildSizesKHR( static_cast( m_device ), - static_cast( buildType ), - reinterpret_cast( &buildInfo ), - maxPrimitiveCounts.data(), - reinterpret_cast( &sizeInfo ) ); - - return sizeInfo; - } - - //=== VK_KHR_sampler_ycbcr_conversion === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion - Device::createSamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SamplerYcbcrConversion( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void - Device::destroySamplerYcbcrConversionKHR( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ycbcrConversion, - Optional allocator ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDestroySamplerYcbcrConversionKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkDestroySamplerYcbcrConversionKHR( - static_cast( m_device ), - static_cast( ycbcrConversion ), - reinterpret_cast( static_cast( allocator ) ) ); - } - - //=== VK_KHR_bind_memory2 === - - VULKAN_HPP_INLINE void Device::bindBufferMemory2KHR( ArrayProxy const & bindInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkBindBufferMemory2KHR && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkBindBufferMemory2KHR( - static_cast( m_device ), bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindBufferMemory2KHR" ); - } - - VULKAN_HPP_INLINE void Device::bindImageMemory2KHR( ArrayProxy const & bindInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkBindImageMemory2KHR && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkBindImageMemory2KHR( - static_cast( m_device ), bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindImageMemory2KHR" ); - } - - //=== VK_EXT_image_drm_format_modifier === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT Image::getDrmFormatModifierPropertiesEXT() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageDrmFormatModifierPropertiesEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT properties; - VkResult result = getDispatcher()->vkGetImageDrmFormatModifierPropertiesEXT( - static_cast( m_device ), static_cast( m_image ), reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Image::getDrmFormatModifierPropertiesEXT" ); - - return properties; - } - - //=== VK_EXT_validation_cache === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::ValidationCacheEXT - Device::createValidationCacheEXT( VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::ValidationCacheEXT( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void ValidationCacheEXT::merge( ArrayProxy const & srcCaches ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkMergeValidationCachesEXT && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkMergeValidationCachesEXT( static_cast( m_device ), - static_cast( m_validationCache ), - srcCaches.size(), - reinterpret_cast( srcCaches.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::ValidationCacheEXT::merge" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector ValidationCacheEXT::getData() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetValidationCacheDataEXT && - "Function needs extension enabled!" ); - - std::vector data; - size_t dataSize; - VkResult result; - do - { - result = getDispatcher()->vkGetValidationCacheDataEXT( - static_cast( m_device ), static_cast( m_validationCache ), &dataSize, nullptr ); - if ( ( result == VK_SUCCESS ) && dataSize ) - { - data.resize( dataSize ); - result = getDispatcher()->vkGetValidationCacheDataEXT( - static_cast( m_device ), static_cast( m_validationCache ), &dataSize, reinterpret_cast( data.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::ValidationCacheEXT::getData" ); - VULKAN_HPP_ASSERT( dataSize <= data.size() ); - if ( dataSize < data.size() ) - { - data.resize( dataSize ); - } - return data; - } - - //=== VK_NV_shading_rate_image === - - VULKAN_HPP_INLINE void CommandBuffer::bindShadingRateImageNV( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBindShadingRateImageNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBindShadingRateImageNV( - static_cast( m_commandBuffer ), static_cast( imageView ), static_cast( imageLayout ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setViewportShadingRatePaletteNV( - uint32_t firstViewport, ArrayProxy const & shadingRatePalettes ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetViewportShadingRatePaletteNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetViewportShadingRatePaletteNV( static_cast( m_commandBuffer ), - firstViewport, - shadingRatePalettes.size(), - reinterpret_cast( shadingRatePalettes.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setCoarseSampleOrderNV( - VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType, - ArrayProxy const & customSampleOrders ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetCoarseSampleOrderNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetCoarseSampleOrderNV( static_cast( m_commandBuffer ), - static_cast( sampleOrderType ), - customSampleOrders.size(), - reinterpret_cast( customSampleOrders.data() ) ); - } - - //=== VK_NV_ray_tracing === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureNV - Device::createAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::AccelerationStructureNV( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR Device::getAccelerationStructureMemoryRequirementsNV( - const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureMemoryRequirementsNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR memoryRequirements; - getDispatcher()->vkGetAccelerationStructureMemoryRequirementsNV( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain Device::getAccelerationStructureMemoryRequirementsNV( - const VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureMemoryRequirementsNV && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2KHR & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetAccelerationStructureMemoryRequirementsNV( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_INLINE void - Device::bindAccelerationStructureMemoryNV( ArrayProxy const & bindInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkBindAccelerationStructureMemoryNV && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkBindAccelerationStructureMemoryNV( - static_cast( m_device ), bindInfos.size(), reinterpret_cast( bindInfos.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::bindAccelerationStructureMemoryNV" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::buildAccelerationStructureNV( const VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV & info, - VULKAN_HPP_NAMESPACE::Buffer instanceData, - VULKAN_HPP_NAMESPACE::DeviceSize instanceOffset, - VULKAN_HPP_NAMESPACE::Bool32 update, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::Buffer scratch, - VULKAN_HPP_NAMESPACE::DeviceSize scratchOffset ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBuildAccelerationStructureNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBuildAccelerationStructureNV( static_cast( m_commandBuffer ), - reinterpret_cast( &info ), - static_cast( instanceData ), - static_cast( instanceOffset ), - static_cast( update ), - static_cast( dst ), - static_cast( src ), - static_cast( scratch ), - static_cast( scratchOffset ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyAccelerationStructureNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV dst, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV src, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyAccelerationStructureNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyAccelerationStructureNV( static_cast( m_commandBuffer ), - static_cast( dst ), - static_cast( src ), - static_cast( mode ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::traceRaysNV( VULKAN_HPP_NAMESPACE::Buffer raygenShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderBindingOffset, - VULKAN_HPP_NAMESPACE::Buffer missShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer hitShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingStride, - VULKAN_HPP_NAMESPACE::Buffer callableShaderBindingTableBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingOffset, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingStride, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdTraceRaysNV && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdTraceRaysNV( static_cast( m_commandBuffer ), - static_cast( raygenShaderBindingTableBuffer ), - static_cast( raygenShaderBindingOffset ), - static_cast( missShaderBindingTableBuffer ), - static_cast( missShaderBindingOffset ), - static_cast( missShaderBindingStride ), - static_cast( hitShaderBindingTableBuffer ), - static_cast( hitShaderBindingOffset ), - static_cast( hitShaderBindingStride ), - static_cast( callableShaderBindingTableBuffer ), - static_cast( callableShaderBindingOffset ), - static_cast( callableShaderBindingStride ), - width, - height, - depth ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::createRayTracingPipelinesNV( - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipelines( *this, pipelineCache, createInfos, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Pipeline Device::createRayTracingPipelineNV( - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipeline( *this, pipelineCache, createInfo, allocator ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Pipeline::getRayTracingShaderGroupHandlesNV( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingShaderGroupHandlesNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = getDispatcher()->vkGetRayTracingShaderGroupHandlesNV( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingShaderGroupHandlesNV" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DataType Pipeline::getRayTracingShaderGroupHandleNV( uint32_t firstGroup, uint32_t groupCount ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingShaderGroupHandlesNV && - "Function needs extension enabled!" ); - - DataType data; - VkResult result = getDispatcher()->vkGetRayTracingShaderGroupHandlesNV( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - sizeof( DataType ), - reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingShaderGroupHandleNV" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector AccelerationStructureNV::getHandle( size_t dataSize ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureHandleNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = getDispatcher()->vkGetAccelerationStructureHandleNV( static_cast( m_device ), - static_cast( m_accelerationStructure ), - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::AccelerationStructureNV::getHandle" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DataType AccelerationStructureNV::getHandle() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetAccelerationStructureHandleNV && - "Function needs extension enabled!" ); - - DataType data; - VkResult result = getDispatcher()->vkGetAccelerationStructureHandleNV( static_cast( m_device ), - static_cast( m_accelerationStructure ), - sizeof( DataType ), - reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::AccelerationStructureNV::getHandle" ); - - return data; - } - - VULKAN_HPP_INLINE void - CommandBuffer::writeAccelerationStructuresPropertiesNV( ArrayProxy const & accelerationStructures, - VULKAN_HPP_NAMESPACE::QueryType queryType, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t firstQuery ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWriteAccelerationStructuresPropertiesNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdWriteAccelerationStructuresPropertiesNV( static_cast( m_commandBuffer ), - accelerationStructures.size(), - reinterpret_cast( accelerationStructures.data() ), - static_cast( queryType ), - static_cast( queryPool ), - firstQuery ); - } - - VULKAN_HPP_INLINE void Pipeline::compileDeferredNV( uint32_t shader ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCompileDeferredNV && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkCompileDeferredNV( static_cast( m_device ), static_cast( m_pipeline ), shader ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::compileDeferredNV" ); - } - - //=== VK_KHR_maintenance3 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport - Device::getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDescriptorSetLayoutSupportKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport support; - getDispatcher()->vkGetDescriptorSetLayoutSupportKHR( static_cast( m_device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( &support ) ); - - return support; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getDescriptorSetLayoutSupportKHR( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDescriptorSetLayoutSupportKHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport & support = structureChain.template get(); - getDispatcher()->vkGetDescriptorSetLayoutSupportKHR( static_cast( m_device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( &support ) ); - - return structureChain; - } - - //=== VK_KHR_draw_indirect_count === - - VULKAN_HPP_INLINE void CommandBuffer::drawIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawIndirectCountKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawIndirectCountKHR( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawIndexedIndirectCountKHR( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawIndexedIndirectCountKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawIndexedIndirectCountKHR( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_EXT_external_memory_host === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT - Device::getMemoryHostPointerPropertiesEXT( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, const void * pHostPointer ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryHostPointerPropertiesEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT memoryHostPointerProperties; - VkResult result = - getDispatcher()->vkGetMemoryHostPointerPropertiesEXT( static_cast( m_device ), - static_cast( handleType ), - pHostPointer, - reinterpret_cast( &memoryHostPointerProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryHostPointerPropertiesEXT" ); - - return memoryHostPointerProperties; - } - - //=== VK_AMD_buffer_marker === - - VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarkerAMD( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits pipelineStage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWriteBufferMarkerAMD && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdWriteBufferMarkerAMD( static_cast( m_commandBuffer ), - static_cast( pipelineStage ), - static_cast( dstBuffer ), - static_cast( dstOffset ), - marker ); - } - - //=== VK_EXT_calibrated_timestamps === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getCalibrateableTimeDomainsEXT() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceCalibrateableTimeDomainsEXT && - "Function needs extension enabled!" ); - - std::vector timeDomains; - uint32_t timeDomainCount; - VkResult result; - do - { - result = - getDispatcher()->vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( static_cast( m_physicalDevice ), &timeDomainCount, nullptr ); - if ( ( result == VK_SUCCESS ) && timeDomainCount ) - { - timeDomains.resize( timeDomainCount ); - result = getDispatcher()->vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( - static_cast( m_physicalDevice ), &timeDomainCount, reinterpret_cast( timeDomains.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCalibrateableTimeDomainsEXT" ); - VULKAN_HPP_ASSERT( timeDomainCount <= timeDomains.size() ); - if ( timeDomainCount < timeDomains.size() ) - { - timeDomains.resize( timeDomainCount ); - } - return timeDomains; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair, uint64_t> - Device::getCalibratedTimestampsEXT( ArrayProxy const & timestampInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetCalibratedTimestampsEXT && - "Function needs extension enabled!" ); - - std::pair, uint64_t> data( std::piecewise_construct, std::forward_as_tuple( timestampInfos.size() ), std::forward_as_tuple( 0 ) ); - std::vector & timestamps = data.first; - uint64_t & maxDeviation = data.second; - VkResult result = getDispatcher()->vkGetCalibratedTimestampsEXT( static_cast( m_device ), - timestampInfos.size(), - reinterpret_cast( timestampInfos.data() ), - timestamps.data(), - &maxDeviation ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampsEXT" ); - - return data; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair - Device::getCalibratedTimestampEXT( const VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT & timestampInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetCalibratedTimestampsEXT && - "Function needs extension enabled!" ); - - std::pair data; - uint64_t & timestamp = data.first; - uint64_t & maxDeviation = data.second; - VkResult result = getDispatcher()->vkGetCalibratedTimestampsEXT( - static_cast( m_device ), 1, reinterpret_cast( ×tampInfo ), ×tamp, &maxDeviation ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getCalibratedTimestampEXT" ); - - return data; - } - - //=== VK_NV_mesh_shader === - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksNV( uint32_t taskCount, uint32_t firstTask ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksNV && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksNV( static_cast( m_commandBuffer ), taskCount, firstTask ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksIndirectNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksIndirectNV( - static_cast( m_commandBuffer ), static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectCountNV( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksIndirectCountNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksIndirectCountNV( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_NV_scissor_exclusive === - - VULKAN_HPP_INLINE void - CommandBuffer::setExclusiveScissorNV( uint32_t firstExclusiveScissor, - ArrayProxy const & exclusiveScissors ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetExclusiveScissorNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetExclusiveScissorNV( static_cast( m_commandBuffer ), - firstExclusiveScissor, - exclusiveScissors.size(), - reinterpret_cast( exclusiveScissors.data() ) ); - } - - //=== VK_NV_device_diagnostic_checkpoints === - - template - VULKAN_HPP_INLINE void CommandBuffer::setCheckpointNV( CheckpointMarkerType const & checkpointMarker ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetCheckpointNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetCheckpointNV( static_cast( m_commandBuffer ), reinterpret_cast( &checkpointMarker ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Queue::getCheckpointDataNV() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetQueueCheckpointDataNV && - "Function needs extension enabled!" ); - - std::vector checkpointData; - uint32_t checkpointDataCount; - getDispatcher()->vkGetQueueCheckpointDataNV( static_cast( m_queue ), &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - getDispatcher()->vkGetQueueCheckpointDataNV( - static_cast( m_queue ), &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } - - //=== VK_KHR_timeline_semaphore === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Semaphore::getCounterValueKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSemaphoreCounterValueKHR && - "Function needs extension enabled!" ); - - uint64_t value; - VkResult result = getDispatcher()->vkGetSemaphoreCounterValueKHR( static_cast( m_device ), static_cast( m_semaphore ), &value ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Semaphore::getCounterValueKHR" ); - - return value; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result Device::waitSemaphoresKHR( const VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo & waitInfo, - uint64_t timeout ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkWaitSemaphoresKHR && "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkWaitSemaphoresKHR( static_cast( m_device ), reinterpret_cast( &waitInfo ), timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::waitSemaphoresKHR", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout } ); - - return static_cast( result ); - } - - VULKAN_HPP_INLINE void Device::signalSemaphoreKHR( const VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo & signalInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSignalSemaphoreKHR && "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkSignalSemaphoreKHR( static_cast( m_device ), reinterpret_cast( &signalInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::signalSemaphoreKHR" ); - } - - //=== VK_INTEL_performance_query === - - VULKAN_HPP_INLINE void Device::initializePerformanceApiINTEL( const VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL & initializeInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkInitializePerformanceApiINTEL && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkInitializePerformanceApiINTEL( static_cast( m_device ), - reinterpret_cast( &initializeInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::initializePerformanceApiINTEL" ); - } - - VULKAN_HPP_INLINE void Device::uninitializePerformanceApiINTEL() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkUninitializePerformanceApiINTEL && - "Function needs extension enabled!" ); - - getDispatcher()->vkUninitializePerformanceApiINTEL( static_cast( m_device ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPerformanceMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL & markerInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPerformanceMarkerINTEL && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkCmdSetPerformanceMarkerINTEL( static_cast( m_commandBuffer ), - reinterpret_cast( &markerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceMarkerINTEL" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPerformanceStreamMarkerINTEL( const VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL & markerInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPerformanceStreamMarkerINTEL && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkCmdSetPerformanceStreamMarkerINTEL( static_cast( m_commandBuffer ), - reinterpret_cast( &markerInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceStreamMarkerINTEL" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPerformanceOverrideINTEL( const VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL & overrideInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPerformanceOverrideINTEL && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkCmdSetPerformanceOverrideINTEL( static_cast( m_commandBuffer ), - reinterpret_cast( &overrideInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::setPerformanceOverrideINTEL" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::PerformanceConfigurationINTEL - Device::acquirePerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL const & acquireInfo ) const - { - return VULKAN_HPP_RAII_NAMESPACE::PerformanceConfigurationINTEL( *this, acquireInfo ); - } - - VULKAN_HPP_INLINE void Queue::setPerformanceConfigurationINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL configuration ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueueSetPerformanceConfigurationINTEL && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkQueueSetPerformanceConfigurationINTEL( static_cast( m_queue ), - static_cast( configuration ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::setPerformanceConfigurationINTEL" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::PerformanceValueINTEL - Device::getPerformanceParameterINTEL( VULKAN_HPP_NAMESPACE::PerformanceParameterTypeINTEL parameter ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPerformanceParameterINTEL && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::PerformanceValueINTEL value; - VkResult result = getDispatcher()->vkGetPerformanceParameterINTEL( - static_cast( m_device ), static_cast( parameter ), reinterpret_cast( &value ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPerformanceParameterINTEL" ); - - return value; - } - - //=== VK_AMD_display_native_hdr === - - VULKAN_HPP_INLINE void SwapchainKHR::setLocalDimmingAMD( VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetLocalDimmingAMD && "Function needs extension enabled!" ); - - getDispatcher()->vkSetLocalDimmingAMD( - static_cast( m_device ), static_cast( m_swapchain ), static_cast( localDimmingEnable ) ); - } - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createImagePipeSurfaceFUCHSIA( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createMetalSurfaceEXT( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getFragmentShadingRatesKHR() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceFragmentShadingRatesKHR && - "Function needs extension enabled!" ); - - std::vector fragmentShadingRates; - uint32_t fragmentShadingRateCount; - VkResult result; - do - { - result = - getDispatcher()->vkGetPhysicalDeviceFragmentShadingRatesKHR( static_cast( m_physicalDevice ), &fragmentShadingRateCount, nullptr ); - if ( ( result == VK_SUCCESS ) && fragmentShadingRateCount ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - result = getDispatcher()->vkGetPhysicalDeviceFragmentShadingRatesKHR( - static_cast( m_physicalDevice ), - &fragmentShadingRateCount, - reinterpret_cast( fragmentShadingRates.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getFragmentShadingRatesKHR" ); - VULKAN_HPP_ASSERT( fragmentShadingRateCount <= fragmentShadingRates.size() ); - if ( fragmentShadingRateCount < fragmentShadingRates.size() ) - { - fragmentShadingRates.resize( fragmentShadingRateCount ); - } - return fragmentShadingRates; - } - - VULKAN_HPP_INLINE void - CommandBuffer::setFragmentShadingRateKHR( const VULKAN_HPP_NAMESPACE::Extent2D & fragmentSize, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetFragmentShadingRateKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetFragmentShadingRateKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &fragmentSize ), - reinterpret_cast( combinerOps ) ); - } - - //=== VK_EXT_buffer_device_address === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress - Device::getBufferAddressEXT( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferDeviceAddressEXT && - "Function needs extension enabled!" ); - - VkDeviceAddress result = - getDispatcher()->vkGetBufferDeviceAddressEXT( static_cast( m_device ), reinterpret_cast( &info ) ); - - return static_cast( result ); - } - - //=== VK_EXT_tooling_info === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector PhysicalDevice::getToolPropertiesEXT() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceToolPropertiesEXT && - "Function needs extension enabled!" ); - - std::vector toolProperties; - uint32_t toolCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceToolPropertiesEXT( static_cast( m_physicalDevice ), &toolCount, nullptr ); - if ( ( result == VK_SUCCESS ) && toolCount ) - { - toolProperties.resize( toolCount ); - result = getDispatcher()->vkGetPhysicalDeviceToolPropertiesEXT( - static_cast( m_physicalDevice ), &toolCount, reinterpret_cast( toolProperties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getToolPropertiesEXT" ); - VULKAN_HPP_ASSERT( toolCount <= toolProperties.size() ); - if ( toolCount < toolProperties.size() ) - { - toolProperties.resize( toolCount ); - } - return toolProperties; - } - - //=== VK_KHR_present_wait === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result SwapchainKHR::waitForPresent( uint64_t presentId, uint64_t timeout ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkWaitForPresentKHR && "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkWaitForPresentKHR( static_cast( m_device ), static_cast( m_swapchain ), presentId, timeout ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::waitForPresent", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eTimeout, VULKAN_HPP_NAMESPACE::Result::eSuboptimalKHR } ); - - return static_cast( result ); - } - - //=== VK_NV_cooperative_matrix === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getCooperativeMatrixPropertiesNV() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceCooperativeMatrixPropertiesNV && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertyCount; - VkResult result; - do - { - result = - getDispatcher()->vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( static_cast( m_physicalDevice ), &propertyCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertyCount ) - { - properties.resize( propertyCount ); - result = getDispatcher()->vkGetPhysicalDeviceCooperativeMatrixPropertiesNV( - static_cast( m_physicalDevice ), &propertyCount, reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getCooperativeMatrixPropertiesNV" ); - VULKAN_HPP_ASSERT( propertyCount <= properties.size() ); - if ( propertyCount < properties.size() ) - { - properties.resize( propertyCount ); - } - return properties; - } - - //=== VK_NV_coverage_reduction_mode === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV() const - { - VULKAN_HPP_ASSERT( - getDispatcher()->vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV && - "Function needs extension enabled!" ); - - std::vector combinations; - uint32_t combinationCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - static_cast( m_physicalDevice ), &combinationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && combinationCount ) - { - combinations.resize( combinationCount ); - result = getDispatcher()->vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( - static_cast( m_physicalDevice ), - &combinationCount, - reinterpret_cast( combinations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSupportedFramebufferMixedSamplesCombinationsNV" ); - VULKAN_HPP_ASSERT( combinationCount <= combinations.size() ); - if ( combinationCount < combinations.size() ) - { - combinations.resize( combinationCount ); - } - return combinations; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - PhysicalDevice::getSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceSurfacePresentModes2EXT && - "Function needs extension enabled!" ); - - std::vector presentModes; - uint32_t presentModeCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPhysicalDeviceSurfacePresentModes2EXT( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &presentModeCount, - nullptr ); - if ( ( result == VK_SUCCESS ) && presentModeCount ) - { - presentModes.resize( presentModeCount ); - result = getDispatcher()->vkGetPhysicalDeviceSurfacePresentModes2EXT( static_cast( m_physicalDevice ), - reinterpret_cast( &surfaceInfo ), - &presentModeCount, - reinterpret_cast( presentModes.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::getSurfacePresentModes2EXT" ); - VULKAN_HPP_ASSERT( presentModeCount <= presentModes.size() ); - if ( presentModeCount < presentModes.size() ) - { - presentModes.resize( presentModeCount ); - } - return presentModes; - } - - VULKAN_HPP_INLINE void SwapchainKHR::acquireFullScreenExclusiveModeEXT() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireFullScreenExclusiveModeEXT && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkAcquireFullScreenExclusiveModeEXT( static_cast( m_device ), static_cast( m_swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::acquireFullScreenExclusiveModeEXT" ); - } - - VULKAN_HPP_INLINE void SwapchainKHR::releaseFullScreenExclusiveModeEXT() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkReleaseFullScreenExclusiveModeEXT && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkReleaseFullScreenExclusiveModeEXT( static_cast( m_device ), static_cast( m_swapchain ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::SwapchainKHR::releaseFullScreenExclusiveModeEXT" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR - Device::getGroupSurfacePresentModes2EXT( const VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR & surfaceInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceGroupSurfacePresentModes2EXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes; - VkResult result = getDispatcher()->vkGetDeviceGroupSurfacePresentModes2EXT( static_cast( m_device ), - reinterpret_cast( &surfaceInfo ), - reinterpret_cast( &modes ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getGroupSurfacePresentModes2EXT" ); - - return modes; - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createHeadlessSurfaceEXT( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - //=== VK_KHR_buffer_device_address === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceAddress - Device::getBufferAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferDeviceAddressKHR && - "Function needs extension enabled!" ); - - VkDeviceAddress result = - getDispatcher()->vkGetBufferDeviceAddressKHR( static_cast( m_device ), reinterpret_cast( &info ) ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t - Device::getBufferOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferOpaqueCaptureAddressKHR && - "Function needs extension enabled!" ); - - uint64_t result = - getDispatcher()->vkGetBufferOpaqueCaptureAddressKHR( static_cast( m_device ), reinterpret_cast( &info ) ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t - Device::getMemoryOpaqueCaptureAddressKHR( const VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceMemoryOpaqueCaptureAddressKHR && - "Function needs extension enabled!" ); - - uint64_t result = getDispatcher()->vkGetDeviceMemoryOpaqueCaptureAddressKHR( static_cast( m_device ), - reinterpret_cast( &info ) ); - - return result; - } - - //=== VK_EXT_line_rasterization === - - VULKAN_HPP_INLINE void CommandBuffer::setLineStippleEXT( uint32_t lineStippleFactor, uint16_t lineStipplePattern ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetLineStippleEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetLineStippleEXT( static_cast( m_commandBuffer ), lineStippleFactor, lineStipplePattern ); - } - - //=== VK_EXT_host_query_reset === - - VULKAN_HPP_INLINE void QueryPool::resetEXT( uint32_t firstQuery, uint32_t queryCount ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkResetQueryPoolEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkResetQueryPoolEXT( static_cast( m_device ), static_cast( m_queryPool ), firstQuery, queryCount ); - } - - //=== VK_EXT_extended_dynamic_state === - - VULKAN_HPP_INLINE void CommandBuffer::setCullModeEXT( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetCullModeEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetCullModeEXT( static_cast( m_commandBuffer ), static_cast( cullMode ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setFrontFaceEXT( VULKAN_HPP_NAMESPACE::FrontFace frontFace ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetFrontFaceEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetFrontFaceEXT( static_cast( m_commandBuffer ), static_cast( frontFace ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveTopologyEXT( VULKAN_HPP_NAMESPACE::PrimitiveTopology primitiveTopology ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPrimitiveTopologyEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetPrimitiveTopologyEXT( static_cast( m_commandBuffer ), static_cast( primitiveTopology ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::setViewportWithCountEXT( ArrayProxy const & viewports ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetViewportWithCountEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetViewportWithCountEXT( - static_cast( m_commandBuffer ), viewports.size(), reinterpret_cast( viewports.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setScissorWithCountEXT( ArrayProxy const & scissors ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetScissorWithCountEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetScissorWithCountEXT( - static_cast( m_commandBuffer ), scissors.size(), reinterpret_cast( scissors.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindVertexBuffers2EXT( uint32_t firstBinding, - ArrayProxy const & buffers, - ArrayProxy const & offsets, - ArrayProxy const & sizes, - ArrayProxy const & strides ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBindVertexBuffers2EXT && - "Function needs extension enabled!" ); - if ( buffers.size() != offsets.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != offsets.size()" ); - } - if ( !sizes.empty() && buffers.size() != sizes.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != sizes.size()" ); - } - if ( !strides.empty() && buffers.size() != strides.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::bindVertexBuffers2EXT: buffers.size() != strides.size()" ); - } - - getDispatcher()->vkCmdBindVertexBuffers2EXT( static_cast( m_commandBuffer ), - firstBinding, - buffers.size(), - reinterpret_cast( buffers.data() ), - reinterpret_cast( offsets.data() ), - reinterpret_cast( sizes.data() ), - reinterpret_cast( strides.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDepthTestEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDepthTestEnableEXT( static_cast( m_commandBuffer ), static_cast( depthTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthWriteEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDepthWriteEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDepthWriteEnableEXT( static_cast( m_commandBuffer ), static_cast( depthWriteEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthCompareOpEXT( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDepthCompareOpEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDepthCompareOpEXT( static_cast( m_commandBuffer ), static_cast( depthCompareOp ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthBoundsTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDepthBoundsTestEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDepthBoundsTestEnableEXT( static_cast( m_commandBuffer ), static_cast( depthBoundsTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilTestEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetStencilTestEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetStencilTestEnableEXT( static_cast( m_commandBuffer ), static_cast( stencilTestEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setStencilOpEXT( VULKAN_HPP_NAMESPACE::StencilFaceFlags faceMask, - VULKAN_HPP_NAMESPACE::StencilOp failOp, - VULKAN_HPP_NAMESPACE::StencilOp passOp, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp, - VULKAN_HPP_NAMESPACE::CompareOp compareOp ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetStencilOpEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetStencilOpEXT( static_cast( m_commandBuffer ), - static_cast( faceMask ), - static_cast( failOp ), - static_cast( passOp ), - static_cast( depthFailOp ), - static_cast( compareOp ) ); - } - - //=== VK_KHR_deferred_host_operations === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DeferredOperationKHR - Device::createDeferredOperationKHR( VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DeferredOperationKHR( *this, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint32_t DeferredOperationKHR::getMaxConcurrency() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeferredOperationMaxConcurrencyKHR && - "Function needs extension enabled!" ); - - uint32_t result = - getDispatcher()->vkGetDeferredOperationMaxConcurrencyKHR( static_cast( m_device ), static_cast( m_operation ) ); - - return result; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result DeferredOperationKHR::getResult() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeferredOperationResultKHR && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkGetDeferredOperationResultKHR( static_cast( m_device ), static_cast( m_operation ) ); - - return static_cast( result ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Result DeferredOperationKHR::join() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDeferredOperationJoinKHR && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkDeferredOperationJoinKHR( static_cast( m_device ), static_cast( m_operation ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::DeferredOperationKHR::join", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eThreadDoneKHR, VULKAN_HPP_NAMESPACE::Result::eThreadIdleKHR } ); - - return static_cast( result ); - } - - //=== VK_KHR_pipeline_executable_properties === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getPipelineExecutablePropertiesKHR( const VULKAN_HPP_NAMESPACE::PipelineInfoKHR & pipelineInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPipelineExecutablePropertiesKHR && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t executableCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPipelineExecutablePropertiesKHR( - static_cast( m_device ), reinterpret_cast( &pipelineInfo ), &executableCount, nullptr ); - if ( ( result == VK_SUCCESS ) && executableCount ) - { - properties.resize( executableCount ); - result = getDispatcher()->vkGetPipelineExecutablePropertiesKHR( static_cast( m_device ), - reinterpret_cast( &pipelineInfo ), - &executableCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutablePropertiesKHR" ); - VULKAN_HPP_ASSERT( executableCount <= properties.size() ); - if ( executableCount < properties.size() ) - { - properties.resize( executableCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getPipelineExecutableStatisticsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPipelineExecutableStatisticsKHR && - "Function needs extension enabled!" ); - - std::vector statistics; - uint32_t statisticCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPipelineExecutableStatisticsKHR( - static_cast( m_device ), reinterpret_cast( &executableInfo ), &statisticCount, nullptr ); - if ( ( result == VK_SUCCESS ) && statisticCount ) - { - statistics.resize( statisticCount ); - result = getDispatcher()->vkGetPipelineExecutableStatisticsKHR( static_cast( m_device ), - reinterpret_cast( &executableInfo ), - &statisticCount, - reinterpret_cast( statistics.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableStatisticsKHR" ); - VULKAN_HPP_ASSERT( statisticCount <= statistics.size() ); - if ( statisticCount < statistics.size() ) - { - statistics.resize( statisticCount ); - } - return statistics; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getPipelineExecutableInternalRepresentationsKHR( const VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR & executableInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPipelineExecutableInternalRepresentationsKHR && - "Function needs extension enabled!" ); - - std::vector internalRepresentations; - uint32_t internalRepresentationCount; - VkResult result; - do - { - result = getDispatcher()->vkGetPipelineExecutableInternalRepresentationsKHR( - static_cast( m_device ), reinterpret_cast( &executableInfo ), &internalRepresentationCount, nullptr ); - if ( ( result == VK_SUCCESS ) && internalRepresentationCount ) - { - internalRepresentations.resize( internalRepresentationCount ); - result = getDispatcher()->vkGetPipelineExecutableInternalRepresentationsKHR( - static_cast( m_device ), - reinterpret_cast( &executableInfo ), - &internalRepresentationCount, - reinterpret_cast( internalRepresentations.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelineExecutableInternalRepresentationsKHR" ); - VULKAN_HPP_ASSERT( internalRepresentationCount <= internalRepresentations.size() ); - if ( internalRepresentationCount < internalRepresentations.size() ) - { - internalRepresentations.resize( internalRepresentationCount ); - } - return internalRepresentations; - } - - //=== VK_NV_device_generated_commands === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetGeneratedCommandsMemoryRequirementsNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetGeneratedCommandsMemoryRequirementsNV( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getGeneratedCommandsMemoryRequirementsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetGeneratedCommandsMemoryRequirementsNV && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetGeneratedCommandsMemoryRequirementsNV( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_INLINE void - CommandBuffer::preprocessGeneratedCommandsNV( const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdPreprocessGeneratedCommandsNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdPreprocessGeneratedCommandsNV( static_cast( m_commandBuffer ), - reinterpret_cast( &generatedCommandsInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::executeGeneratedCommandsNV( VULKAN_HPP_NAMESPACE::Bool32 isPreprocessed, - const VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV & generatedCommandsInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdExecuteGeneratedCommandsNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdExecuteGeneratedCommandsNV( static_cast( m_commandBuffer ), - static_cast( isPreprocessed ), - reinterpret_cast( &generatedCommandsInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::bindPipelineShaderGroupNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint, - VULKAN_HPP_NAMESPACE::Pipeline pipeline, - uint32_t groupIndex ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBindPipelineShaderGroupNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBindPipelineShaderGroupNV( static_cast( m_commandBuffer ), - static_cast( pipelineBindPoint ), - static_cast( pipeline ), - groupIndex ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::IndirectCommandsLayoutNV - Device::createIndirectCommandsLayoutNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::IndirectCommandsLayoutNV( *this, createInfo, allocator ); - } - - //=== VK_EXT_acquire_drm_display === - - VULKAN_HPP_INLINE void PhysicalDevice::acquireDrmDisplayEXT( int32_t drmFd, VULKAN_HPP_NAMESPACE::DisplayKHR display ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireDrmDisplayEXT && "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkAcquireDrmDisplayEXT( static_cast( m_physicalDevice ), drmFd, static_cast( display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::PhysicalDevice::acquireDrmDisplayEXT" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DisplayKHR PhysicalDevice::getDrmDisplayEXT( int32_t drmFd, uint32_t connectorId ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DisplayKHR( *this, drmFd, connectorId ); - } - - //=== VK_EXT_private_data === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot - Device::createPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::PrivateDataSlot( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void Device::destroyPrivateDataSlotEXT( VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - Optional allocator ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkDestroyPrivateDataSlotEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkDestroyPrivateDataSlotEXT( - static_cast( m_device ), - static_cast( privateDataSlot ), - reinterpret_cast( static_cast( allocator ) ) ); - } - - VULKAN_HPP_INLINE void Device::setPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot, - uint64_t data ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetPrivateDataEXT && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkSetPrivateDataEXT( - static_cast( m_device ), static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), data ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::setPrivateDataEXT" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE uint64_t Device::getPrivateDataEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle, - VULKAN_HPP_NAMESPACE::PrivateDataSlot privateDataSlot ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPrivateDataEXT && "Function needs extension enabled!" ); - - uint64_t data; - getDispatcher()->vkGetPrivateDataEXT( - static_cast( m_device ), static_cast( objectType_ ), objectHandle, static_cast( privateDataSlot ), &data ); - - return data; - } - -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - VULKAN_HPP_INLINE void CommandBuffer::encodeVideoKHR( const VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR & encodeInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdEncodeVideoKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdEncodeVideoKHR( static_cast( m_commandBuffer ), reinterpret_cast( &encodeInfo ) ); - } -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -# if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT Device::exportMetalObjectsEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkExportMetalObjectsEXT && "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT metalObjectsInfo; - getDispatcher()->vkExportMetalObjectsEXT( static_cast( m_device ), reinterpret_cast( &metalObjectsInfo ) ); - - return metalObjectsInfo; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain Device::exportMetalObjectsEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkExportMetalObjectsEXT && "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT & metalObjectsInfo = structureChain.template get(); - getDispatcher()->vkExportMetalObjectsEXT( static_cast( m_device ), reinterpret_cast( &metalObjectsInfo ) ); - - return structureChain; - } -# endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_synchronization2 === - - VULKAN_HPP_INLINE void CommandBuffer::setEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetEvent2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetEvent2KHR( - static_cast( m_commandBuffer ), static_cast( event ), reinterpret_cast( &dependencyInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resetEvent2KHR( VULKAN_HPP_NAMESPACE::Event event, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdResetEvent2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdResetEvent2KHR( - static_cast( m_commandBuffer ), static_cast( event ), static_cast( stageMask ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::waitEvents2KHR( ArrayProxy const & events, - ArrayProxy const & dependencyInfos ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWaitEvents2KHR && "Function needs extension enabled!" ); - if ( events.size() != dependencyInfos.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::CommandBuffer::waitEvents2KHR: events.size() != dependencyInfos.size()" ); - } - - getDispatcher()->vkCmdWaitEvents2KHR( static_cast( m_commandBuffer ), - events.size(), - reinterpret_cast( events.data() ), - reinterpret_cast( dependencyInfos.data() ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::pipelineBarrier2KHR( const VULKAN_HPP_NAMESPACE::DependencyInfo & dependencyInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdPipelineBarrier2KHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdPipelineBarrier2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( &dependencyInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::writeTimestamp2KHR( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::QueryPool queryPool, - uint32_t query ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWriteTimestamp2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdWriteTimestamp2KHR( - static_cast( m_commandBuffer ), static_cast( stage ), static_cast( queryPool ), query ); - } - - VULKAN_HPP_INLINE void Queue::submit2KHR( ArrayProxy const & submits, VULKAN_HPP_NAMESPACE::Fence fence ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkQueueSubmit2KHR && "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkQueueSubmit2KHR( - static_cast( m_queue ), submits.size(), reinterpret_cast( submits.data() ), static_cast( fence ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Queue::submit2KHR" ); - } - - VULKAN_HPP_INLINE void CommandBuffer::writeBufferMarker2AMD( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset, - uint32_t marker ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdWriteBufferMarker2AMD && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdWriteBufferMarker2AMD( static_cast( m_commandBuffer ), - static_cast( stage ), - static_cast( dstBuffer ), - static_cast( dstOffset ), - marker ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Queue::getCheckpointData2NV() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetQueueCheckpointData2NV && - "Function needs extension enabled!" ); - - std::vector checkpointData; - uint32_t checkpointDataCount; - getDispatcher()->vkGetQueueCheckpointData2NV( static_cast( m_queue ), &checkpointDataCount, nullptr ); - checkpointData.resize( checkpointDataCount ); - getDispatcher()->vkGetQueueCheckpointData2NV( - static_cast( m_queue ), &checkpointDataCount, reinterpret_cast( checkpointData.data() ) ); - - VULKAN_HPP_ASSERT( checkpointDataCount <= checkpointData.size() ); - if ( checkpointDataCount < checkpointData.size() ) - { - checkpointData.resize( checkpointDataCount ); - } - return checkpointData; - } - - //=== VK_NV_fragment_shading_rate_enums === - - VULKAN_HPP_INLINE void - CommandBuffer::setFragmentShadingRateEnumNV( VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate, - const VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR combinerOps[2] ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetFragmentShadingRateEnumNV && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetFragmentShadingRateEnumNV( static_cast( m_commandBuffer ), - static_cast( shadingRate ), - reinterpret_cast( combinerOps ) ); - } - - //=== VK_EXT_mesh_shader === - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksEXT( uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksEXT( static_cast( m_commandBuffer ), groupCountX, groupCountY, groupCountZ ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - uint32_t drawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksIndirectEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksIndirectEXT( - static_cast( m_commandBuffer ), static_cast( buffer ), static_cast( offset ), drawCount, stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawMeshTasksIndirectCountEXT( VULKAN_HPP_NAMESPACE::Buffer buffer, - VULKAN_HPP_NAMESPACE::DeviceSize offset, - VULKAN_HPP_NAMESPACE::Buffer countBuffer, - VULKAN_HPP_NAMESPACE::DeviceSize countBufferOffset, - uint32_t maxDrawCount, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMeshTasksIndirectCountEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMeshTasksIndirectCountEXT( static_cast( m_commandBuffer ), - static_cast( buffer ), - static_cast( offset ), - static_cast( countBuffer ), - static_cast( countBufferOffset ), - maxDrawCount, - stride ); - } - - //=== VK_KHR_copy_commands2 === - - VULKAN_HPP_INLINE void CommandBuffer::copyBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferInfo2 & copyBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyBuffer2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyBuffer2KHR( static_cast( m_commandBuffer ), reinterpret_cast( ©BufferInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::copyImage2KHR( const VULKAN_HPP_NAMESPACE::CopyImageInfo2 & copyImageInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyImage2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyImage2KHR( static_cast( m_commandBuffer ), reinterpret_cast( ©ImageInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::copyBufferToImage2KHR( const VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 & copyBufferToImageInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyBufferToImage2KHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyBufferToImage2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( ©BufferToImageInfo ) ); - } - - VULKAN_HPP_INLINE void - CommandBuffer::copyImageToBuffer2KHR( const VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 & copyImageToBufferInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdCopyImageToBuffer2KHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdCopyImageToBuffer2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( ©ImageToBufferInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::blitImage2KHR( const VULKAN_HPP_NAMESPACE::BlitImageInfo2 & blitImageInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBlitImage2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBlitImage2KHR( static_cast( m_commandBuffer ), reinterpret_cast( &blitImageInfo ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::resolveImage2KHR( const VULKAN_HPP_NAMESPACE::ResolveImageInfo2 & resolveImageInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdResolveImage2KHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdResolveImage2KHR( static_cast( m_commandBuffer ), - reinterpret_cast( &resolveImageInfo ) ); - } - - //=== VK_EXT_image_compression_control === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT - Image::getSubresourceLayout2EXT( const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageSubresourceLayout2EXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT layout; - getDispatcher()->vkGetImageSubresourceLayout2EXT( static_cast( m_device ), - static_cast( m_image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return layout; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Image::getSubresourceLayout2EXT( const VULKAN_HPP_NAMESPACE::ImageSubresource2EXT & subresource ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetImageSubresourceLayout2EXT && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT & layout = structureChain.template get(); - getDispatcher()->vkGetImageSubresourceLayout2EXT( static_cast( m_device ), - static_cast( m_image ), - reinterpret_cast( &subresource ), - reinterpret_cast( &layout ) ); - - return structureChain; - } - -# if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_NV_acquire_winrt_display === - - VULKAN_HPP_INLINE void DisplayKHR::acquireWinrtNV() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkAcquireWinrtDisplayNV && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkAcquireWinrtDisplayNV( static_cast( m_physicalDevice ), static_cast( m_display ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::DisplayKHR::acquireWinrtNV" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::DisplayKHR PhysicalDevice::getWinrtDisplayNV( uint32_t deviceRelativeId ) const - { - return VULKAN_HPP_RAII_NAMESPACE::DisplayKHR( *this, deviceRelativeId ); - } -# endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -# if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createDirectFBSurfaceEXT( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getDirectFBPresentationSupportEXT( uint32_t queueFamilyIndex, IDirectFB & dfb ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceDirectFBPresentationSupportEXT && - "Function needs extension enabled!" ); - - VkBool32 result = - getDispatcher()->vkGetPhysicalDeviceDirectFBPresentationSupportEXT( static_cast( m_physicalDevice ), queueFamilyIndex, &dfb ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - VULKAN_HPP_INLINE void CommandBuffer::traceRaysKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - uint32_t width, - uint32_t height, - uint32_t depth ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdTraceRaysKHR && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdTraceRaysKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &raygenShaderBindingTable ), - reinterpret_cast( &missShaderBindingTable ), - reinterpret_cast( &hitShaderBindingTable ), - reinterpret_cast( &callableShaderBindingTable ), - width, - height, - depth ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Device::createRayTracingPipelinesKHR( - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::ArrayProxy const & createInfos, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipelines( *this, deferredOperation, pipelineCache, createInfos, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::Pipeline Device::createRayTracingPipelineKHR( - VULKAN_HPP_NAMESPACE::Optional const & deferredOperation, - VULKAN_HPP_NAMESPACE::Optional const & pipelineCache, - VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::Pipeline( *this, deferredOperation, pipelineCache, createInfo, allocator ); - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Pipeline::getRayTracingShaderGroupHandlesKHR( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingShaderGroupHandlesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = getDispatcher()->vkGetRayTracingShaderGroupHandlesKHR( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingShaderGroupHandlesKHR" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DataType Pipeline::getRayTracingShaderGroupHandleKHR( uint32_t firstGroup, uint32_t groupCount ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingShaderGroupHandlesKHR && - "Function needs extension enabled!" ); - - DataType data; - VkResult result = getDispatcher()->vkGetRayTracingShaderGroupHandlesKHR( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - sizeof( DataType ), - reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingShaderGroupHandleKHR" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Pipeline::getRayTracingCaptureReplayShaderGroupHandlesKHR( uint32_t firstGroup, uint32_t groupCount, size_t dataSize ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_ASSERT( dataSize % sizeof( DataType ) == 0 ); - std::vector data( dataSize / sizeof( DataType ) ); - VkResult result = getDispatcher()->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - data.size() * sizeof( DataType ), - reinterpret_cast( data.data() ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingCaptureReplayShaderGroupHandlesKHR" ); - - return data; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE DataType Pipeline::getRayTracingCaptureReplayShaderGroupHandleKHR( uint32_t firstGroup, uint32_t groupCount ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR && - "Function needs extension enabled!" ); - - DataType data; - VkResult result = getDispatcher()->vkGetRayTracingCaptureReplayShaderGroupHandlesKHR( static_cast( m_device ), - static_cast( m_pipeline ), - firstGroup, - groupCount, - sizeof( DataType ), - reinterpret_cast( &data ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::Pipeline::getRayTracingCaptureReplayShaderGroupHandleKHR" ); - - return data; - } - - VULKAN_HPP_INLINE void CommandBuffer::traceRaysIndirectKHR( const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & raygenShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & missShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & hitShaderBindingTable, - const VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR & callableShaderBindingTable, - VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdTraceRaysIndirectKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdTraceRaysIndirectKHR( static_cast( m_commandBuffer ), - reinterpret_cast( &raygenShaderBindingTable ), - reinterpret_cast( &missShaderBindingTable ), - reinterpret_cast( &hitShaderBindingTable ), - reinterpret_cast( &callableShaderBindingTable ), - static_cast( indirectDeviceAddress ) ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DeviceSize - Pipeline::getRayTracingShaderGroupStackSizeKHR( uint32_t group, VULKAN_HPP_NAMESPACE::ShaderGroupShaderKHR groupShader ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetRayTracingShaderGroupStackSizeKHR && - "Function needs extension enabled!" ); - - VkDeviceSize result = getDispatcher()->vkGetRayTracingShaderGroupStackSizeKHR( - static_cast( m_device ), static_cast( m_pipeline ), group, static_cast( groupShader ) ); - - return static_cast( result ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setRayTracingPipelineStackSizeKHR( uint32_t pipelineStackSize ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetRayTracingPipelineStackSizeKHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetRayTracingPipelineStackSizeKHR( static_cast( m_commandBuffer ), pipelineStackSize ); - } - - //=== VK_EXT_vertex_input_dynamic_state === - - VULKAN_HPP_INLINE void CommandBuffer::setVertexInputEXT( - ArrayProxy const & vertexBindingDescriptions, - ArrayProxy const & vertexAttributeDescriptions ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetVertexInputEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetVertexInputEXT( static_cast( m_commandBuffer ), - vertexBindingDescriptions.size(), - reinterpret_cast( vertexBindingDescriptions.data() ), - vertexAttributeDescriptions.size(), - reinterpret_cast( vertexAttributeDescriptions.data() ) ); - } - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_memory === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE zx_handle_t - Device::getMemoryZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA & getZirconHandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryZirconHandleFUCHSIA && - "Function needs extension enabled!" ); - - zx_handle_t zirconHandle; - VkResult result = getDispatcher()->vkGetMemoryZirconHandleFUCHSIA( - static_cast( m_device ), reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandleFUCHSIA" ); - - return zirconHandle; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA - Device::getMemoryZirconHandlePropertiesFUCHSIA( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryZirconHandlePropertiesFUCHSIA && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA memoryZirconHandleProperties; - VkResult result = - getDispatcher()->vkGetMemoryZirconHandlePropertiesFUCHSIA( static_cast( m_device ), - static_cast( handleType ), - zirconHandle, - reinterpret_cast( &memoryZirconHandleProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryZirconHandlePropertiesFUCHSIA" ); - - return memoryZirconHandleProperties; - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_external_semaphore === - - VULKAN_HPP_INLINE void - Device::importSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA & importSemaphoreZirconHandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkImportSemaphoreZirconHandleFUCHSIA && - "Function needs extension enabled!" ); - - VkResult result = getDispatcher()->vkImportSemaphoreZirconHandleFUCHSIA( - static_cast( m_device ), reinterpret_cast( &importSemaphoreZirconHandleInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::importSemaphoreZirconHandleFUCHSIA" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE zx_handle_t - Device::getSemaphoreZirconHandleFUCHSIA( const VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA & getZirconHandleInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetSemaphoreZirconHandleFUCHSIA && - "Function needs extension enabled!" ); - - zx_handle_t zirconHandle; - VkResult result = getDispatcher()->vkGetSemaphoreZirconHandleFUCHSIA( - static_cast( m_device ), reinterpret_cast( &getZirconHandleInfo ), &zirconHandle ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getSemaphoreZirconHandleFUCHSIA" ); - - return zirconHandle; - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - -# if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::BufferCollectionFUCHSIA - Device::createBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::BufferCollectionFUCHSIA( *this, createInfo, allocator ); - } - - VULKAN_HPP_INLINE void BufferCollectionFUCHSIA::setImageConstraints( const VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA & imageConstraintsInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetBufferCollectionImageConstraintsFUCHSIA && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkSetBufferCollectionImageConstraintsFUCHSIA( static_cast( m_device ), - static_cast( m_collection ), - reinterpret_cast( &imageConstraintsInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::BufferCollectionFUCHSIA::setImageConstraints" ); - } - - VULKAN_HPP_INLINE void - BufferCollectionFUCHSIA::setBufferConstraints( const VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA & bufferConstraintsInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetBufferCollectionBufferConstraintsFUCHSIA && - "Function needs extension enabled!" ); - - VkResult result = - getDispatcher()->vkSetBufferCollectionBufferConstraintsFUCHSIA( static_cast( m_device ), - static_cast( m_collection ), - reinterpret_cast( &bufferConstraintsInfo ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::BufferCollectionFUCHSIA::setBufferConstraints" ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA BufferCollectionFUCHSIA::getProperties() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetBufferCollectionPropertiesFUCHSIA && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA properties; - VkResult result = getDispatcher()->vkGetBufferCollectionPropertiesFUCHSIA( static_cast( m_device ), - static_cast( m_collection ), - reinterpret_cast( &properties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::BufferCollectionFUCHSIA::getProperties" ); - - return properties; - } -# endif /*VK_USE_PLATFORM_FUCHSIA*/ - - //=== VK_HUAWEI_subpass_shading === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::pair - RenderPass::getSubpassShadingMaxWorkgroupSizeHUAWEI() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::Extent2D maxWorkgroupSize; - VkResult result = getDispatcher()->vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI( - static_cast( m_device ), static_cast( m_renderPass ), reinterpret_cast( &maxWorkgroupSize ) ); - resultCheck( static_cast( result ), - VULKAN_HPP_NAMESPACE_STRING "::RenderPass::getSubpassShadingMaxWorkgroupSizeHUAWEI", - { VULKAN_HPP_NAMESPACE::Result::eSuccess, VULKAN_HPP_NAMESPACE::Result::eIncomplete } ); - - return std::make_pair( static_cast( result ), maxWorkgroupSize ); - } - - VULKAN_HPP_INLINE void CommandBuffer::subpassShadingHUAWEI() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSubpassShadingHUAWEI && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSubpassShadingHUAWEI( static_cast( m_commandBuffer ) ); - } - - //=== VK_HUAWEI_invocation_mask === - - VULKAN_HPP_INLINE void CommandBuffer::bindInvocationMaskHUAWEI( VULKAN_HPP_NAMESPACE::ImageView imageView, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdBindInvocationMaskHUAWEI && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdBindInvocationMaskHUAWEI( - static_cast( m_commandBuffer ), static_cast( imageView ), static_cast( imageLayout ) ); - } - - //=== VK_NV_external_memory_rdma === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::RemoteAddressNV - Device::getMemoryRemoteAddressNV( const VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV & memoryGetRemoteAddressInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetMemoryRemoteAddressNV && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::RemoteAddressNV address; - VkResult result = getDispatcher()->vkGetMemoryRemoteAddressNV( static_cast( m_device ), - reinterpret_cast( &memoryGetRemoteAddressInfo ), - reinterpret_cast( &address ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getMemoryRemoteAddressNV" ); - - return address; - } - - //=== VK_EXT_pipeline_properties === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::BaseOutStructure - Device::getPipelinePropertiesEXT( const VULKAN_HPP_NAMESPACE::PipelineInfoEXT & pipelineInfo ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPipelinePropertiesEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::BaseOutStructure pipelineProperties; - VkResult result = getDispatcher()->vkGetPipelinePropertiesEXT( static_cast( m_device ), - reinterpret_cast( &pipelineInfo ), - reinterpret_cast( &pipelineProperties ) ); - resultCheck( static_cast( result ), VULKAN_HPP_NAMESPACE_STRING "::Device::getPipelinePropertiesEXT" ); - - return pipelineProperties; - } - - //=== VK_EXT_extended_dynamic_state2 === - - VULKAN_HPP_INLINE void CommandBuffer::setPatchControlPointsEXT( uint32_t patchControlPoints ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPatchControlPointsEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetPatchControlPointsEXT( static_cast( m_commandBuffer ), patchControlPoints ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setRasterizerDiscardEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetRasterizerDiscardEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetRasterizerDiscardEnableEXT( static_cast( m_commandBuffer ), static_cast( rasterizerDiscardEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setDepthBiasEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetDepthBiasEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetDepthBiasEnableEXT( static_cast( m_commandBuffer ), static_cast( depthBiasEnable ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setLogicOpEXT( VULKAN_HPP_NAMESPACE::LogicOp logicOp ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetLogicOpEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetLogicOpEXT( static_cast( m_commandBuffer ), static_cast( logicOp ) ); - } - - VULKAN_HPP_INLINE void CommandBuffer::setPrimitiveRestartEnableEXT( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetPrimitiveRestartEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetPrimitiveRestartEnableEXT( static_cast( m_commandBuffer ), static_cast( primitiveRestartEnable ) ); - } - -# if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR - Instance::createScreenSurfaceQNX( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX const & createInfo, - VULKAN_HPP_NAMESPACE::Optional allocator ) const - { - return VULKAN_HPP_RAII_NAMESPACE::SurfaceKHR( *this, createInfo, allocator ); - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::Bool32 - PhysicalDevice::getScreenPresentationSupportQNX( uint32_t queueFamilyIndex, struct _screen_window & window ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetPhysicalDeviceScreenPresentationSupportQNX && - "Function needs extension enabled!" ); - - VkBool32 result = - getDispatcher()->vkGetPhysicalDeviceScreenPresentationSupportQNX( static_cast( m_physicalDevice ), queueFamilyIndex, &window ); - - return static_cast( result ); - } -# endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_color_write_enable === - - VULKAN_HPP_INLINE void - CommandBuffer::setColorWriteEnableEXT( ArrayProxy const & colorWriteEnables ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdSetColorWriteEnableEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdSetColorWriteEnableEXT( - static_cast( m_commandBuffer ), colorWriteEnables.size(), reinterpret_cast( colorWriteEnables.data() ) ); - } - - //=== VK_KHR_ray_tracing_maintenance1 === - - VULKAN_HPP_INLINE void CommandBuffer::traceRaysIndirect2KHR( VULKAN_HPP_NAMESPACE::DeviceAddress indirectDeviceAddress ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdTraceRaysIndirect2KHR && - "Function needs extension enabled!" ); - - getDispatcher()->vkCmdTraceRaysIndirect2KHR( static_cast( m_commandBuffer ), static_cast( indirectDeviceAddress ) ); - } - - //=== VK_EXT_multi_draw === - - VULKAN_HPP_INLINE void CommandBuffer::drawMultiEXT( ArrayProxy const & vertexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMultiEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMultiEXT( static_cast( m_commandBuffer ), - vertexInfo.size(), - reinterpret_cast( vertexInfo.data() ), - instanceCount, - firstInstance, - stride ); - } - - VULKAN_HPP_INLINE void CommandBuffer::drawMultiIndexedEXT( ArrayProxy const & indexInfo, - uint32_t instanceCount, - uint32_t firstInstance, - uint32_t stride, - Optional vertexOffset ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkCmdDrawMultiIndexedEXT && "Function needs extension enabled!" ); - - getDispatcher()->vkCmdDrawMultiIndexedEXT( static_cast( m_commandBuffer ), - indexInfo.size(), - reinterpret_cast( indexInfo.data() ), - instanceCount, - firstInstance, - stride, - static_cast( vertexOffset ) ); - } - - //=== VK_EXT_pageable_device_local_memory === - - VULKAN_HPP_INLINE void DeviceMemory::setPriorityEXT( float priority ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkSetDeviceMemoryPriorityEXT && - "Function needs extension enabled!" ); - - getDispatcher()->vkSetDeviceMemoryPriorityEXT( static_cast( m_device ), static_cast( m_memory ), priority ); - } - - //=== VK_KHR_maintenance4 === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceBufferMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetDeviceBufferMemoryRequirementsKHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getBufferMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceBufferMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetDeviceBufferMemoryRequirementsKHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::MemoryRequirements2 - Device::getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceImageMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::MemoryRequirements2 memoryRequirements; - getDispatcher()->vkGetDeviceImageMemoryRequirementsKHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return memoryRequirements; - } - - template - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE StructureChain - Device::getImageMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceImageMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - StructureChain structureChain; - VULKAN_HPP_NAMESPACE::MemoryRequirements2 & memoryRequirements = structureChain.template get(); - getDispatcher()->vkGetDeviceImageMemoryRequirementsKHR( static_cast( m_device ), - reinterpret_cast( &info ), - reinterpret_cast( &memoryRequirements ) ); - - return structureChain; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector - Device::getImageSparseMemoryRequirementsKHR( const VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements & info ) const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR && - "Function needs extension enabled!" ); - - std::vector sparseMemoryRequirements; - uint32_t sparseMemoryRequirementCount; - getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR( - static_cast( m_device ), reinterpret_cast( &info ), &sparseMemoryRequirementCount, nullptr ); - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - getDispatcher()->vkGetDeviceImageSparseMemoryRequirementsKHR( static_cast( m_device ), - reinterpret_cast( &info ), - &sparseMemoryRequirementCount, - reinterpret_cast( sparseMemoryRequirements.data() ) ); - - VULKAN_HPP_ASSERT( sparseMemoryRequirementCount <= sparseMemoryRequirements.size() ); - if ( sparseMemoryRequirementCount < sparseMemoryRequirements.size() ) - { - sparseMemoryRequirements.resize( sparseMemoryRequirementCount ); - } - return sparseMemoryRequirements; - } - - //=== VK_VALVE_descriptor_set_host_mapping === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE Device::getDescriptorSetLayoutHostMappingInfoVALVE( - const VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE & bindingReference ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDescriptorSetLayoutHostMappingInfoVALVE && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE hostMapping; - getDispatcher()->vkGetDescriptorSetLayoutHostMappingInfoVALVE( static_cast( m_device ), - reinterpret_cast( &bindingReference ), - reinterpret_cast( &hostMapping ) ); - - return hostMapping; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE void * DescriptorSet::getHostMappingVALVE() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDescriptorSetHostMappingVALVE && - "Function needs extension enabled!" ); - - void * pData; - getDispatcher()->vkGetDescriptorSetHostMappingVALVE( static_cast( m_device ), static_cast( m_descriptorSet ), &pData ); - - return pData; - } - - //=== VK_EXT_shader_module_identifier === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT ShaderModule::getIdentifierEXT() const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetShaderModuleIdentifierEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT identifier; - getDispatcher()->vkGetShaderModuleIdentifierEXT( - static_cast( m_device ), static_cast( m_shaderModule ), reinterpret_cast( &identifier ) ); - - return identifier; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT - Device::getShaderModuleCreateInfoIdentifierEXT( const VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo & createInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetShaderModuleCreateInfoIdentifierEXT && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT identifier; - getDispatcher()->vkGetShaderModuleCreateInfoIdentifierEXT( static_cast( m_device ), - reinterpret_cast( &createInfo ), - reinterpret_cast( &identifier ) ); - - return identifier; - } - - //=== VK_QCOM_tile_properties === - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE std::vector Framebuffer::getTilePropertiesQCOM() const - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetFramebufferTilePropertiesQCOM && - "Function needs extension enabled!" ); - - std::vector properties; - uint32_t propertiesCount; - VkResult result; - do - { - result = getDispatcher()->vkGetFramebufferTilePropertiesQCOM( - static_cast( m_device ), static_cast( m_framebuffer ), &propertiesCount, nullptr ); - if ( ( result == VK_SUCCESS ) && propertiesCount ) - { - properties.resize( propertiesCount ); - result = getDispatcher()->vkGetFramebufferTilePropertiesQCOM( static_cast( m_device ), - static_cast( m_framebuffer ), - &propertiesCount, - reinterpret_cast( properties.data() ) ); - } - } while ( result == VK_INCOMPLETE ); - - VULKAN_HPP_ASSERT( propertiesCount <= properties.size() ); - if ( propertiesCount < properties.size() ) - { - properties.resize( propertiesCount ); - } - return properties; - } - - VULKAN_HPP_NODISCARD VULKAN_HPP_INLINE VULKAN_HPP_NAMESPACE::TilePropertiesQCOM - Device::getDynamicRenderingTilePropertiesQCOM( const VULKAN_HPP_NAMESPACE::RenderingInfo & renderingInfo ) const VULKAN_HPP_NOEXCEPT - { - VULKAN_HPP_ASSERT( getDispatcher()->vkGetDynamicRenderingTilePropertiesQCOM && - "Function needs extension enabled!" ); - - VULKAN_HPP_NAMESPACE::TilePropertiesQCOM properties; - getDispatcher()->vkGetDynamicRenderingTilePropertiesQCOM( static_cast( m_device ), - reinterpret_cast( &renderingInfo ), - reinterpret_cast( &properties ) ); - - return properties; - } - -#endif - } // namespace VULKAN_HPP_RAII_NAMESPACE -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_screen.h b/src/video/khronos/vulkan/vulkan_screen.h index f0ef40a6caff0..7e84d4d9656f1 100644 --- a/src/video/khronos/vulkan/vulkan_screen.h +++ b/src/video/khronos/vulkan/vulkan_screen.h @@ -2,7 +2,7 @@ #define VULKAN_SCREEN_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_QNX_screen_surface is a preprocessor guard. Do not pass it to API calls. #define VK_QNX_screen_surface 1 #define VK_QNX_SCREEN_SURFACE_SPEC_VERSION 1 #define VK_QNX_SCREEN_SURFACE_EXTENSION_NAME "VK_QNX_screen_surface" @@ -47,6 +48,59 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX( struct _screen_window* window); #endif + +// VK_QNX_external_memory_screen_buffer is a preprocessor guard. Do not pass it to API calls. +#define VK_QNX_external_memory_screen_buffer 1 +#define VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_SPEC_VERSION 1 +#define VK_QNX_EXTERNAL_MEMORY_SCREEN_BUFFER_EXTENSION_NAME "VK_QNX_external_memory_screen_buffer" +typedef struct VkScreenBufferPropertiesQNX { + VkStructureType sType; + void* pNext; + VkDeviceSize allocationSize; + uint32_t memoryTypeBits; +} VkScreenBufferPropertiesQNX; + +typedef struct VkScreenBufferFormatPropertiesQNX { + VkStructureType sType; + void* pNext; + VkFormat format; + uint64_t externalFormat; + uint64_t screenUsage; + VkFormatFeatureFlags formatFeatures; + VkComponentMapping samplerYcbcrConversionComponents; + VkSamplerYcbcrModelConversion suggestedYcbcrModel; + VkSamplerYcbcrRange suggestedYcbcrRange; + VkChromaLocation suggestedXChromaOffset; + VkChromaLocation suggestedYChromaOffset; +} VkScreenBufferFormatPropertiesQNX; + +typedef struct VkImportScreenBufferInfoQNX { + VkStructureType sType; + const void* pNext; + struct _screen_buffer* buffer; +} VkImportScreenBufferInfoQNX; + +typedef struct VkExternalFormatQNX { + VkStructureType sType; + void* pNext; + uint64_t externalFormat; +} VkExternalFormatQNX; + +typedef struct VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX { + VkStructureType sType; + void* pNext; + VkBool32 screenBufferImport; +} VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX; + +typedef VkResult (VKAPI_PTR *PFN_vkGetScreenBufferPropertiesQNX)(VkDevice device, const struct _screen_buffer* buffer, VkScreenBufferPropertiesQNX* pProperties); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkGetScreenBufferPropertiesQNX( + VkDevice device, + const struct _screen_buffer* buffer, + VkScreenBufferPropertiesQNX* pProperties); +#endif + #ifdef __cplusplus } #endif diff --git a/src/video/khronos/vulkan/vulkan_static_assertions.hpp b/src/video/khronos/vulkan/vulkan_static_assertions.hpp deleted file mode 100644 index da45d4a06bf56..0000000000000 --- a/src/video/khronos/vulkan/vulkan_static_assertions.hpp +++ /dev/null @@ -1,5847 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_STRUCTS_HPP -#define VULKAN_STRUCTS_HPP - -#include - -//========================= -//=== static_assertions === -//========================= - -//=== VK_VERSION_1_0 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Extent2D ) == sizeof( VkExtent2D ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Extent2D is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Extent3D ) == sizeof( VkExtent3D ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Extent3D is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Offset2D ) == sizeof( VkOffset2D ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Offset2D is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Offset3D ) == sizeof( VkOffset3D ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Offset3D is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Rect2D ) == sizeof( VkRect2D ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Rect2D is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BaseInStructure ) == sizeof( VkBaseInStructure ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BaseInStructure is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BaseOutStructure ) == sizeof( VkBaseOutStructure ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BaseOutStructure is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferMemoryBarrier ) == sizeof( VkBufferMemoryBarrier ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferMemoryBarrier is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DispatchIndirectCommand ) == sizeof( VkDispatchIndirectCommand ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DispatchIndirectCommand is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrawIndexedIndirectCommand ) == sizeof( VkDrawIndexedIndirectCommand ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrawIndexedIndirectCommand is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrawIndirectCommand ) == sizeof( VkDrawIndirectCommand ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrawIndirectCommand is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageMemoryBarrier ) == sizeof( VkImageMemoryBarrier ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageMemoryBarrier is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryBarrier ) == sizeof( VkMemoryBarrier ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "MemoryBarrier is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersionOne ) == sizeof( VkPipelineCacheHeaderVersionOne ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCacheHeaderVersionOne is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AllocationCallbacks ) == sizeof( VkAllocationCallbacks ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AllocationCallbacks is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ApplicationInfo ) == sizeof( VkApplicationInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ApplicationInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FormatProperties ) == sizeof( VkFormatProperties ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FormatProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageFormatProperties ) == sizeof( VkImageFormatProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageFormatProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Instance ) == sizeof( VkInstance ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Instance is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::InstanceCreateInfo ) == sizeof( VkInstanceCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "InstanceCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryHeap ) == sizeof( VkMemoryHeap ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "MemoryHeap is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryType ) == sizeof( VkMemoryType ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "MemoryType is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevice ) == sizeof( VkPhysicalDevice ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevice is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures ) == sizeof( VkPhysicalDeviceFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLimits ) == sizeof( VkPhysicalDeviceLimits ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceLimits is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties ) == sizeof( VkPhysicalDeviceMemoryProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMemoryProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties ) == sizeof( VkPhysicalDeviceProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseProperties ) == sizeof( VkPhysicalDeviceSparseProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSparseProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyProperties ) == sizeof( VkQueueFamilyProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Device ) == sizeof( VkDevice ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Device is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceCreateInfo ) == sizeof( VkDeviceCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceQueueCreateInfo ) == sizeof( VkDeviceQueueCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceQueueCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExtensionProperties ) == sizeof( VkExtensionProperties ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExtensionProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::LayerProperties ) == sizeof( VkLayerProperties ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "LayerProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Queue ) == sizeof( VkQueue ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Queue is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubmitInfo ) == sizeof( VkSubmitInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "SubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MappedMemoryRange ) == sizeof( VkMappedMemoryRange ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MappedMemoryRange is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryAllocateInfo ) == sizeof( VkMemoryAllocateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceMemory ) == sizeof( VkDeviceMemory ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "DeviceMemory is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryRequirements ) == sizeof( VkMemoryRequirements ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryRequirements is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindSparseInfo ) == sizeof( VkBindSparseInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindSparseInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSubresource ) == sizeof( VkImageSubresource ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSubresource is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseBufferMemoryBindInfo ) == sizeof( VkSparseBufferMemoryBindInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseBufferMemoryBindInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties ) == sizeof( VkSparseImageFormatProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageFormatProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageMemoryBind ) == sizeof( VkSparseImageMemoryBind ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageMemoryBind is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageMemoryBindInfo ) == sizeof( VkSparseImageMemoryBindInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageMemoryBindInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements ) == sizeof( VkSparseImageMemoryRequirements ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageMemoryRequirements is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageOpaqueMemoryBindInfo ) == sizeof( VkSparseImageOpaqueMemoryBindInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageOpaqueMemoryBindInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseMemoryBind ) == sizeof( VkSparseMemoryBind ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseMemoryBind is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Fence ) == sizeof( VkFence ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Fence is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FenceCreateInfo ) == sizeof( VkFenceCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FenceCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Semaphore ) == sizeof( VkSemaphore ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Semaphore is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreCreateInfo ) == sizeof( VkSemaphoreCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Event ) == sizeof( VkEvent ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Event is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::EventCreateInfo ) == sizeof( VkEventCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "EventCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueryPool ) == sizeof( VkQueryPool ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "QueryPool is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueryPoolCreateInfo ) == sizeof( VkQueryPoolCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueryPoolCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Buffer ) == sizeof( VkBuffer ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Buffer is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCreateInfo ) == sizeof( VkBufferCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferView ) == sizeof( VkBufferView ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "BufferView is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferViewCreateInfo ) == sizeof( VkBufferViewCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferViewCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Image ) == sizeof( VkImage ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Image is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageCreateInfo ) == sizeof( VkImageCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubresourceLayout ) == sizeof( VkSubresourceLayout ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubresourceLayout is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ComponentMapping ) == sizeof( VkComponentMapping ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ComponentMapping is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSubresourceRange ) == sizeof( VkImageSubresourceRange ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSubresourceRange is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageView ) == sizeof( VkImageView ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageView is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewCreateInfo ) == sizeof( VkImageViewCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderModule ) == sizeof( VkShaderModule ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ShaderModule is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderModuleCreateInfo ) == sizeof( VkShaderModuleCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShaderModuleCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCache ) == sizeof( VkPipelineCache ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "PipelineCache is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCacheCreateInfo ) == sizeof( VkPipelineCacheCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCacheCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ComputePipelineCreateInfo ) == sizeof( VkComputePipelineCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ComputePipelineCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GraphicsPipelineCreateInfo ) == sizeof( VkGraphicsPipelineCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GraphicsPipelineCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Pipeline ) == sizeof( VkPipeline ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Pipeline is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineColorBlendAttachmentState ) == sizeof( VkPipelineColorBlendAttachmentState ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineColorBlendAttachmentState is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo ) == sizeof( VkPipelineColorBlendStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineColorBlendStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo ) == sizeof( VkPipelineDepthStencilStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineDepthStencilStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo ) == sizeof( VkPipelineDynamicStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineDynamicStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo ) == sizeof( VkPipelineInputAssemblyStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineInputAssemblyStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo ) == sizeof( VkPipelineMultisampleStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineMultisampleStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo ) == sizeof( VkPipelineRasterizationStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo ) == sizeof( VkPipelineShaderStageCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineShaderStageCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo ) == sizeof( VkPipelineTessellationStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineTessellationStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo ) == sizeof( VkPipelineVertexInputStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineVertexInputStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo ) == sizeof( VkPipelineViewportStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SpecializationInfo ) == sizeof( VkSpecializationInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SpecializationInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SpecializationMapEntry ) == sizeof( VkSpecializationMapEntry ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SpecializationMapEntry is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::StencilOpState ) == sizeof( VkStencilOpState ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "StencilOpState is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription ) == sizeof( VkVertexInputAttributeDescription ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VertexInputAttributeDescription is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VertexInputBindingDescription ) == sizeof( VkVertexInputBindingDescription ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VertexInputBindingDescription is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Viewport ) == sizeof( VkViewport ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Viewport is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineLayout ) == sizeof( VkPipelineLayout ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineLayout is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateInfo ) == sizeof( VkPipelineLayoutCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineLayoutCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PushConstantRange ) == sizeof( VkPushConstantRange ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PushConstantRange is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Sampler ) == sizeof( VkSampler ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Sampler is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerCreateInfo ) == sizeof( VkSamplerCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyDescriptorSet ) == sizeof( VkCopyDescriptorSet ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyDescriptorSet is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorBufferInfo ) == sizeof( VkDescriptorBufferInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorBufferInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorImageInfo ) == sizeof( VkDescriptorImageInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorImageInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorPool ) == sizeof( VkDescriptorPool ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorPool is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateInfo ) == sizeof( VkDescriptorPoolCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorPoolCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorPoolSize ) == sizeof( VkDescriptorPoolSize ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorPoolSize is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSet ) == sizeof( VkDescriptorSet ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "DescriptorSet is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetAllocateInfo ) == sizeof( VkDescriptorSetAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayout ) == sizeof( VkDescriptorSetLayout ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayout is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBinding ) == sizeof( VkDescriptorSetLayoutBinding ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayoutBinding is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateInfo ) == sizeof( VkDescriptorSetLayoutCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayoutCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::WriteDescriptorSet ) == sizeof( VkWriteDescriptorSet ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "WriteDescriptorSet is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentDescription ) == sizeof( VkAttachmentDescription ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentDescription is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentReference ) == sizeof( VkAttachmentReference ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentReference is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Framebuffer ) == sizeof( VkFramebuffer ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "Framebuffer is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FramebufferCreateInfo ) == sizeof( VkFramebufferCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FramebufferCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPass ) == sizeof( VkRenderPass ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "RenderPass is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo ) == sizeof( VkRenderPassCreateInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassDependency ) == sizeof( VkSubpassDependency ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassDependency is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassDescription ) == sizeof( VkSubpassDescription ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassDescription is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandPool ) == sizeof( VkCommandPool ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "CommandPool is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandPoolCreateInfo ) == sizeof( VkCommandPoolCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandPoolCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBuffer ) == sizeof( VkCommandBuffer ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "CommandBuffer is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferAllocateInfo ) == sizeof( VkCommandBufferAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferBeginInfo ) == sizeof( VkCommandBufferBeginInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferBeginInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceInfo ) == sizeof( VkCommandBufferInheritanceInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferInheritanceInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCopy ) == sizeof( VkBufferCopy ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "BufferCopy is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferImageCopy ) == sizeof( VkBufferImageCopy ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferImageCopy is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ClearAttachment ) == sizeof( VkClearAttachment ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ClearAttachment is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ClearColorValue ) == sizeof( VkClearColorValue ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ClearColorValue is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ClearDepthStencilValue ) == sizeof( VkClearDepthStencilValue ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ClearDepthStencilValue is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ClearRect ) == sizeof( VkClearRect ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ClearRect is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ClearValue ) == sizeof( VkClearValue ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ClearValue is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageBlit ) == sizeof( VkImageBlit ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageBlit is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageCopy ) == sizeof( VkImageCopy ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageCopy is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageResolve ) == sizeof( VkImageResolve ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageResolve is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers ) == sizeof( VkImageSubresourceLayers ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSubresourceLayers is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassBeginInfo ) == sizeof( VkRenderPassBeginInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassBeginInfo is not nothrow_move_constructible!" ); - -//=== VK_VERSION_1_1 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupProperties ) == sizeof( VkPhysicalDeviceSubgroupProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubgroupProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindBufferMemoryInfo ) == sizeof( VkBindBufferMemoryInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindBufferMemoryInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindImageMemoryInfo ) == sizeof( VkBindImageMemoryInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindImageMemoryInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevice16BitStorageFeatures ) == sizeof( VkPhysicalDevice16BitStorageFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevice16BitStorageFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryDedicatedRequirements ) == sizeof( VkMemoryDedicatedRequirements ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryDedicatedRequirements is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryDedicatedAllocateInfo ) == sizeof( VkMemoryDedicatedAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryDedicatedAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryAllocateFlagsInfo ) == sizeof( VkMemoryAllocateFlagsInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryAllocateFlagsInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupRenderPassBeginInfo ) == sizeof( VkDeviceGroupRenderPassBeginInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupRenderPassBeginInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupCommandBufferBeginInfo ) == sizeof( VkDeviceGroupCommandBufferBeginInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupCommandBufferBeginInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupSubmitInfo ) == sizeof( VkDeviceGroupSubmitInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupSubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupBindSparseInfo ) == sizeof( VkDeviceGroupBindSparseInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupBindSparseInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindBufferMemoryDeviceGroupInfo ) == sizeof( VkBindBufferMemoryDeviceGroupInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindBufferMemoryDeviceGroupInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindImageMemoryDeviceGroupInfo ) == sizeof( VkBindImageMemoryDeviceGroupInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindImageMemoryDeviceGroupInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceGroupProperties ) == sizeof( VkPhysicalDeviceGroupProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceGroupProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupDeviceCreateInfo ) == sizeof( VkDeviceGroupDeviceCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupDeviceCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferMemoryRequirementsInfo2 ) == sizeof( VkBufferMemoryRequirementsInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferMemoryRequirementsInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageMemoryRequirementsInfo2 ) == sizeof( VkImageMemoryRequirementsInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageMemoryRequirementsInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSparseMemoryRequirementsInfo2 ) == sizeof( VkImageSparseMemoryRequirementsInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSparseMemoryRequirementsInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryRequirements2 ) == sizeof( VkMemoryRequirements2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryRequirements2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements2 ) == sizeof( VkSparseImageMemoryRequirements2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageMemoryRequirements2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures2 ) == sizeof( VkPhysicalDeviceFeatures2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFeatures2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties2 ) == sizeof( VkPhysicalDeviceProperties2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FormatProperties2 ) == sizeof( VkFormatProperties2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FormatProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageFormatProperties2 ) == sizeof( VkImageFormatProperties2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageFormatProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageFormatInfo2 ) == sizeof( VkPhysicalDeviceImageFormatInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageFormatInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyProperties2 ) == sizeof( VkQueueFamilyProperties2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties2 ) == sizeof( VkPhysicalDeviceMemoryProperties2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMemoryProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties2 ) == sizeof( VkSparseImageFormatProperties2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SparseImageFormatProperties2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseImageFormatInfo2 ) == sizeof( VkPhysicalDeviceSparseImageFormatInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSparseImageFormatInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePointClippingProperties ) == sizeof( VkPhysicalDevicePointClippingProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePointClippingProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassInputAttachmentAspectCreateInfo ) == sizeof( VkRenderPassInputAttachmentAspectCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassInputAttachmentAspectCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::InputAttachmentAspectReference ) == sizeof( VkInputAttachmentAspectReference ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "InputAttachmentAspectReference is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewUsageCreateInfo ) == sizeof( VkImageViewUsageCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewUsageCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineTessellationDomainOriginStateCreateInfo ) == - sizeof( VkPipelineTessellationDomainOriginStateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineTessellationDomainOriginStateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassMultiviewCreateInfo ) == sizeof( VkRenderPassMultiviewCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassMultiviewCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewFeatures ) == sizeof( VkPhysicalDeviceMultiviewFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultiviewFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewProperties ) == sizeof( VkPhysicalDeviceMultiviewProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultiviewProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVariablePointersFeatures ) == sizeof( VkPhysicalDeviceVariablePointersFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVariablePointersFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProtectedMemoryFeatures ) == sizeof( VkPhysicalDeviceProtectedMemoryFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProtectedMemoryFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProtectedMemoryProperties ) == sizeof( VkPhysicalDeviceProtectedMemoryProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProtectedMemoryProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceQueueInfo2 ) == sizeof( VkDeviceQueueInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceQueueInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ProtectedSubmitInfo ) == sizeof( VkProtectedSubmitInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ProtectedSubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionCreateInfo ) == sizeof( VkSamplerYcbcrConversionCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerYcbcrConversionCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionInfo ) == sizeof( VkSamplerYcbcrConversionInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerYcbcrConversionInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindImagePlaneMemoryInfo ) == sizeof( VkBindImagePlaneMemoryInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindImagePlaneMemoryInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImagePlaneMemoryRequirementsInfo ) == sizeof( VkImagePlaneMemoryRequirementsInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImagePlaneMemoryRequirementsInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSamplerYcbcrConversionFeatures ) == - sizeof( VkPhysicalDeviceSamplerYcbcrConversionFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSamplerYcbcrConversionFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversionImageFormatProperties ) == - sizeof( VkSamplerYcbcrConversionImageFormatProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerYcbcrConversionImageFormatProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion ) == sizeof( VkSamplerYcbcrConversion ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerYcbcrConversion is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplate ) == sizeof( VkDescriptorUpdateTemplate ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorUpdateTemplate is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateEntry ) == sizeof( VkDescriptorUpdateTemplateEntry ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorUpdateTemplateEntry is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateInfo ) == sizeof( VkDescriptorUpdateTemplateCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorUpdateTemplateCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalMemoryProperties ) == sizeof( VkExternalMemoryProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalMemoryProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalImageFormatInfo ) == sizeof( VkPhysicalDeviceExternalImageFormatInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalImageFormatInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalImageFormatProperties ) == sizeof( VkExternalImageFormatProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalImageFormatProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalBufferInfo ) == sizeof( VkPhysicalDeviceExternalBufferInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalBufferInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalBufferProperties ) == sizeof( VkExternalBufferProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalBufferProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceIDProperties ) == sizeof( VkPhysicalDeviceIDProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceIDProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalMemoryImageCreateInfo ) == sizeof( VkExternalMemoryImageCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalMemoryImageCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalMemoryBufferCreateInfo ) == sizeof( VkExternalMemoryBufferCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalMemoryBufferCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMemoryAllocateInfo ) == sizeof( VkExportMemoryAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMemoryAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalFenceInfo ) == sizeof( VkPhysicalDeviceExternalFenceInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalFenceInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalFenceProperties ) == sizeof( VkExternalFenceProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalFenceProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportFenceCreateInfo ) == sizeof( VkExportFenceCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportFenceCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportSemaphoreCreateInfo ) == sizeof( VkExportSemaphoreCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportSemaphoreCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalSemaphoreInfo ) == sizeof( VkPhysicalDeviceExternalSemaphoreInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalSemaphoreInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalSemaphoreProperties ) == sizeof( VkExternalSemaphoreProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalSemaphoreProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance3Properties ) == sizeof( VkPhysicalDeviceMaintenance3Properties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMaintenance3Properties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutSupport ) == sizeof( VkDescriptorSetLayoutSupport ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayoutSupport is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderDrawParametersFeatures ) == sizeof( VkPhysicalDeviceShaderDrawParametersFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderDrawParametersFeatures is not nothrow_move_constructible!" ); - -//=== VK_VERSION_1_2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan11Features ) == sizeof( VkPhysicalDeviceVulkan11Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan11Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan11Properties ) == sizeof( VkPhysicalDeviceVulkan11Properties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan11Properties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan12Features ) == sizeof( VkPhysicalDeviceVulkan12Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan12Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan12Properties ) == sizeof( VkPhysicalDeviceVulkan12Properties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan12Properties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageFormatListCreateInfo ) == sizeof( VkImageFormatListCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageFormatListCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassCreateInfo2 ) == sizeof( VkRenderPassCreateInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassCreateInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentDescription2 ) == sizeof( VkAttachmentDescription2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentDescription2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentReference2 ) == sizeof( VkAttachmentReference2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentReference2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassDescription2 ) == sizeof( VkSubpassDescription2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassDescription2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassDependency2 ) == sizeof( VkSubpassDependency2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassDependency2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassBeginInfo ) == sizeof( VkSubpassBeginInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassBeginInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassEndInfo ) == sizeof( VkSubpassEndInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassEndInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevice8BitStorageFeatures ) == sizeof( VkPhysicalDevice8BitStorageFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevice8BitStorageFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ConformanceVersion ) == sizeof( VkConformanceVersion ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ConformanceVersion is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDriverProperties ) == sizeof( VkPhysicalDeviceDriverProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDriverProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicInt64Features ) == sizeof( VkPhysicalDeviceShaderAtomicInt64Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderAtomicInt64Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderFloat16Int8Features ) == sizeof( VkPhysicalDeviceShaderFloat16Int8Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderFloat16Int8Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFloatControlsProperties ) == sizeof( VkPhysicalDeviceFloatControlsProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFloatControlsProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBindingFlagsCreateInfo ) == sizeof( VkDescriptorSetLayoutBindingFlagsCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayoutBindingFlagsCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorIndexingFeatures ) == sizeof( VkPhysicalDeviceDescriptorIndexingFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDescriptorIndexingFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorIndexingProperties ) == sizeof( VkPhysicalDeviceDescriptorIndexingProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDescriptorIndexingProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetVariableDescriptorCountAllocateInfo ) == - sizeof( VkDescriptorSetVariableDescriptorCountAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetVariableDescriptorCountAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetVariableDescriptorCountLayoutSupport ) == - sizeof( VkDescriptorSetVariableDescriptorCountLayoutSupport ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetVariableDescriptorCountLayoutSupport is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassDescriptionDepthStencilResolve ) == sizeof( VkSubpassDescriptionDepthStencilResolve ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassDescriptionDepthStencilResolve is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthStencilResolveProperties ) == - sizeof( VkPhysicalDeviceDepthStencilResolveProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDepthStencilResolveProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceScalarBlockLayoutFeatures ) == sizeof( VkPhysicalDeviceScalarBlockLayoutFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceScalarBlockLayoutFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageStencilUsageCreateInfo ) == sizeof( VkImageStencilUsageCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageStencilUsageCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerReductionModeCreateInfo ) == sizeof( VkSamplerReductionModeCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerReductionModeCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSamplerFilterMinmaxProperties ) == - sizeof( VkPhysicalDeviceSamplerFilterMinmaxProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSamplerFilterMinmaxProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkanMemoryModelFeatures ) == sizeof( VkPhysicalDeviceVulkanMemoryModelFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkanMemoryModelFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImagelessFramebufferFeatures ) == sizeof( VkPhysicalDeviceImagelessFramebufferFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImagelessFramebufferFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FramebufferAttachmentsCreateInfo ) == sizeof( VkFramebufferAttachmentsCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FramebufferAttachmentsCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo ) == sizeof( VkFramebufferAttachmentImageInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FramebufferAttachmentImageInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassAttachmentBeginInfo ) == sizeof( VkRenderPassAttachmentBeginInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassAttachmentBeginInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceUniformBufferStandardLayoutFeatures ) == - sizeof( VkPhysicalDeviceUniformBufferStandardLayoutFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceUniformBufferStandardLayoutFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSubgroupExtendedTypesFeatures ) == - sizeof( VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderSubgroupExtendedTypesFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSeparateDepthStencilLayoutsFeatures ) == - sizeof( VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSeparateDepthStencilLayoutsFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentReferenceStencilLayout ) == sizeof( VkAttachmentReferenceStencilLayout ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentReferenceStencilLayout is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentDescriptionStencilLayout ) == sizeof( VkAttachmentDescriptionStencilLayout ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentDescriptionStencilLayout is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceHostQueryResetFeatures ) == sizeof( VkPhysicalDeviceHostQueryResetFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceHostQueryResetFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTimelineSemaphoreFeatures ) == sizeof( VkPhysicalDeviceTimelineSemaphoreFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTimelineSemaphoreFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTimelineSemaphoreProperties ) == sizeof( VkPhysicalDeviceTimelineSemaphoreProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTimelineSemaphoreProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreTypeCreateInfo ) == sizeof( VkSemaphoreTypeCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreTypeCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TimelineSemaphoreSubmitInfo ) == sizeof( VkTimelineSemaphoreSubmitInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TimelineSemaphoreSubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreWaitInfo ) == sizeof( VkSemaphoreWaitInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreWaitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreSignalInfo ) == sizeof( VkSemaphoreSignalInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreSignalInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceBufferDeviceAddressFeatures ) == sizeof( VkPhysicalDeviceBufferDeviceAddressFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceBufferDeviceAddressFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferDeviceAddressInfo ) == sizeof( VkBufferDeviceAddressInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferDeviceAddressInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferOpaqueCaptureAddressCreateInfo ) == sizeof( VkBufferOpaqueCaptureAddressCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferOpaqueCaptureAddressCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryOpaqueCaptureAddressAllocateInfo ) == sizeof( VkMemoryOpaqueCaptureAddressAllocateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryOpaqueCaptureAddressAllocateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceMemoryOpaqueCaptureAddressInfo ) == sizeof( VkDeviceMemoryOpaqueCaptureAddressInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceMemoryOpaqueCaptureAddressInfo is not nothrow_move_constructible!" ); - -//=== VK_VERSION_1_3 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan13Features ) == sizeof( VkPhysicalDeviceVulkan13Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan13Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVulkan13Properties ) == sizeof( VkPhysicalDeviceVulkan13Properties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVulkan13Properties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCreationFeedbackCreateInfo ) == sizeof( VkPipelineCreationFeedbackCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCreationFeedbackCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCreationFeedback ) == sizeof( VkPipelineCreationFeedback ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCreationFeedback is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderTerminateInvocationFeatures ) == - sizeof( VkPhysicalDeviceShaderTerminateInvocationFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderTerminateInvocationFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceToolProperties ) == sizeof( VkPhysicalDeviceToolProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceToolProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderDemoteToHelperInvocationFeatures ) == - sizeof( VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderDemoteToHelperInvocationFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePrivateDataFeatures ) == sizeof( VkPhysicalDevicePrivateDataFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePrivateDataFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DevicePrivateDataCreateInfo ) == sizeof( VkDevicePrivateDataCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DevicePrivateDataCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateInfo ) == sizeof( VkPrivateDataSlotCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PrivateDataSlotCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PrivateDataSlot ) == sizeof( VkPrivateDataSlot ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PrivateDataSlot is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineCreationCacheControlFeatures ) == - sizeof( VkPhysicalDevicePipelineCreationCacheControlFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePipelineCreationCacheControlFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryBarrier2 ) == sizeof( VkMemoryBarrier2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryBarrier2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferMemoryBarrier2 ) == sizeof( VkBufferMemoryBarrier2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferMemoryBarrier2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageMemoryBarrier2 ) == sizeof( VkImageMemoryBarrier2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageMemoryBarrier2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DependencyInfo ) == sizeof( VkDependencyInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DependencyInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubmitInfo2 ) == sizeof( VkSubmitInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "SubmitInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo ) == sizeof( VkSemaphoreSubmitInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreSubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferSubmitInfo ) == sizeof( VkCommandBufferSubmitInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferSubmitInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSynchronization2Features ) == sizeof( VkPhysicalDeviceSynchronization2Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSynchronization2Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures ) == - sizeof( VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageRobustnessFeatures ) == sizeof( VkPhysicalDeviceImageRobustnessFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageRobustnessFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyBufferInfo2 ) == sizeof( VkCopyBufferInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyBufferInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyImageInfo2 ) == sizeof( VkCopyImageInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyImageInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyBufferToImageInfo2 ) == sizeof( VkCopyBufferToImageInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyBufferToImageInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyImageToBufferInfo2 ) == sizeof( VkCopyImageToBufferInfo2 ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyImageToBufferInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BlitImageInfo2 ) == sizeof( VkBlitImageInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BlitImageInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ResolveImageInfo2 ) == sizeof( VkResolveImageInfo2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ResolveImageInfo2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCopy2 ) == sizeof( VkBufferCopy2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "BufferCopy2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageCopy2 ) == sizeof( VkImageCopy2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageCopy2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageBlit2 ) == sizeof( VkImageBlit2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageBlit2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferImageCopy2 ) == sizeof( VkBufferImageCopy2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferImageCopy2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageResolve2 ) == sizeof( VkImageResolve2 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "ImageResolve2 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupSizeControlFeatures ) == sizeof( VkPhysicalDeviceSubgroupSizeControlFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubgroupSizeControlFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubgroupSizeControlProperties ) == - sizeof( VkPhysicalDeviceSubgroupSizeControlProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubgroupSizeControlProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineShaderStageRequiredSubgroupSizeCreateInfo ) == - sizeof( VkPipelineShaderStageRequiredSubgroupSizeCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineShaderStageRequiredSubgroupSizeCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceInlineUniformBlockFeatures ) == sizeof( VkPhysicalDeviceInlineUniformBlockFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceInlineUniformBlockFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceInlineUniformBlockProperties ) == sizeof( VkPhysicalDeviceInlineUniformBlockProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceInlineUniformBlockProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::WriteDescriptorSetInlineUniformBlock ) == sizeof( VkWriteDescriptorSetInlineUniformBlock ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "WriteDescriptorSetInlineUniformBlock is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorPoolInlineUniformBlockCreateInfo ) == sizeof( VkDescriptorPoolInlineUniformBlockCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorPoolInlineUniformBlockCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTextureCompressionASTCHDRFeatures ) == - sizeof( VkPhysicalDeviceTextureCompressionASTCHDRFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTextureCompressionASTCHDRFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderingInfo ) == sizeof( VkRenderingInfo ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "RenderingInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo ) == sizeof( VkRenderingAttachmentInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderingAttachmentInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRenderingCreateInfo ) == sizeof( VkPipelineRenderingCreateInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRenderingCreateInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDynamicRenderingFeatures ) == sizeof( VkPhysicalDeviceDynamicRenderingFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDynamicRenderingFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceRenderingInfo ) == sizeof( VkCommandBufferInheritanceRenderingInfo ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferInheritanceRenderingInfo is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerDotProductFeatures ) == - sizeof( VkPhysicalDeviceShaderIntegerDotProductFeatures ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderIntegerDotProductFeatures is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerDotProductProperties ) == - sizeof( VkPhysicalDeviceShaderIntegerDotProductProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderIntegerDotProductProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTexelBufferAlignmentProperties ) == - sizeof( VkPhysicalDeviceTexelBufferAlignmentProperties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTexelBufferAlignmentProperties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FormatProperties3 ) == sizeof( VkFormatProperties3 ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FormatProperties3 is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance4Features ) == sizeof( VkPhysicalDeviceMaintenance4Features ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMaintenance4Features is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMaintenance4Properties ) == sizeof( VkPhysicalDeviceMaintenance4Properties ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMaintenance4Properties is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceBufferMemoryRequirements ) == sizeof( VkDeviceBufferMemoryRequirements ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceBufferMemoryRequirements is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceImageMemoryRequirements ) == sizeof( VkDeviceImageMemoryRequirements ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceImageMemoryRequirements is not nothrow_move_constructible!" ); - -//=== VK_KHR_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceKHR ) == sizeof( VkSurfaceKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "SurfaceKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR ) == sizeof( VkSurfaceCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceFormatKHR ) == sizeof( VkSurfaceFormatKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceFormatKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_swapchain === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SwapchainCreateInfoKHR ) == sizeof( VkSwapchainCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SwapchainCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SwapchainKHR ) == sizeof( VkSwapchainKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "SwapchainKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentInfoKHR ) == sizeof( VkPresentInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSwapchainCreateInfoKHR ) == sizeof( VkImageSwapchainCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSwapchainCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindImageMemorySwapchainInfoKHR ) == sizeof( VkBindImageMemorySwapchainInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindImageMemorySwapchainInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AcquireNextImageInfoKHR ) == sizeof( VkAcquireNextImageInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AcquireNextImageInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupPresentCapabilitiesKHR ) == sizeof( VkDeviceGroupPresentCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupPresentCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupPresentInfoKHR ) == sizeof( VkDeviceGroupPresentInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupPresentInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceGroupSwapchainCreateInfoKHR ) == sizeof( VkDeviceGroupSwapchainCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceGroupSwapchainCreateInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_display === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayKHR ) == sizeof( VkDisplayKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "DisplayKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayModeCreateInfoKHR ) == sizeof( VkDisplayModeCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayModeCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayModeKHR ) == sizeof( VkDisplayModeKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayModeKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR ) == sizeof( VkDisplayModeParametersKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayModeParametersKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR ) == sizeof( VkDisplayModePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayModePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR ) == sizeof( VkDisplayPlaneCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPlaneCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR ) == sizeof( VkDisplayPlanePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPlanePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR ) == sizeof( VkDisplayPropertiesKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateInfoKHR ) == sizeof( VkDisplaySurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplaySurfaceCreateInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_display_swapchain === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPresentInfoKHR ) == sizeof( VkDisplayPresentInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPresentInfoKHR is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) -//=== VK_KHR_xlib_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateInfoKHR ) == sizeof( VkXlibSurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "XlibSurfaceCreateInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) -//=== VK_KHR_xcb_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateInfoKHR ) == sizeof( VkXcbSurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "XcbSurfaceCreateInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) -//=== VK_KHR_wayland_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateInfoKHR ) == sizeof( VkWaylandSurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "WaylandSurfaceCreateInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) -//=== VK_KHR_android_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateInfoKHR ) == sizeof( VkAndroidSurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AndroidSurfaceCreateInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_KHR_win32_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateInfoKHR ) == sizeof( VkWin32SurfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "Win32SurfaceCreateInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_EXT_debug_report === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugReportCallbackEXT ) == sizeof( VkDebugReportCallbackEXT ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugReportCallbackEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugReportCallbackCreateInfoEXT ) == sizeof( VkDebugReportCallbackCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugReportCallbackCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_AMD_rasterization_order === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateRasterizationOrderAMD ) == - sizeof( VkPipelineRasterizationStateRasterizationOrderAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationStateRasterizationOrderAMD is not nothrow_move_constructible!" ); - -//=== VK_EXT_debug_marker === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugMarkerObjectNameInfoEXT ) == sizeof( VkDebugMarkerObjectNameInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugMarkerObjectNameInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugMarkerObjectTagInfoEXT ) == sizeof( VkDebugMarkerObjectTagInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugMarkerObjectTagInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugMarkerMarkerInfoEXT ) == sizeof( VkDebugMarkerMarkerInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugMarkerMarkerInfoEXT is not nothrow_move_constructible!" ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_KHR_video_queue === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionKHR ) == sizeof( VkVideoSessionKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR ) == sizeof( VkVideoSessionParametersKHR ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionParametersKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyQueryResultStatusPropertiesKHR ) == sizeof( VkQueueFamilyQueryResultStatusPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyQueryResultStatusPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyVideoPropertiesKHR ) == sizeof( VkQueueFamilyVideoPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyVideoPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR ) == sizeof( VkVideoProfileInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoProfileInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoProfileListInfoKHR ) == sizeof( VkVideoProfileListInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoProfileListInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoCapabilitiesKHR ) == sizeof( VkVideoCapabilitiesKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVideoFormatInfoKHR ) == sizeof( VkPhysicalDeviceVideoFormatInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVideoFormatInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoFormatPropertiesKHR ) == sizeof( VkVideoFormatPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoFormatPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR ) == sizeof( VkVideoPictureResourceInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoPictureResourceInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR ) == sizeof( VkVideoReferenceSlotInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoReferenceSlotInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionMemoryRequirementsKHR ) == sizeof( VkVideoSessionMemoryRequirementsKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionMemoryRequirementsKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindVideoSessionMemoryInfoKHR ) == sizeof( VkBindVideoSessionMemoryInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindVideoSessionMemoryInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionCreateInfoKHR ) == sizeof( VkVideoSessionCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateInfoKHR ) == sizeof( VkVideoSessionParametersCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionParametersCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoSessionParametersUpdateInfoKHR ) == sizeof( VkVideoSessionParametersUpdateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoSessionParametersUpdateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoBeginCodingInfoKHR ) == sizeof( VkVideoBeginCodingInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoBeginCodingInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEndCodingInfoKHR ) == sizeof( VkVideoEndCodingInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEndCodingInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoCodingControlInfoKHR ) == sizeof( VkVideoCodingControlInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoCodingControlInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_KHR_video_decode_queue === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeCapabilitiesKHR ) == sizeof( VkVideoDecodeCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeUsageInfoKHR ) == sizeof( VkVideoDecodeUsageInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeUsageInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeInfoKHR ) == sizeof( VkVideoDecodeInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -//=== VK_NV_dedicated_allocation === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DedicatedAllocationImageCreateInfoNV ) == sizeof( VkDedicatedAllocationImageCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DedicatedAllocationImageCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DedicatedAllocationBufferCreateInfoNV ) == sizeof( VkDedicatedAllocationBufferCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DedicatedAllocationBufferCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DedicatedAllocationMemoryAllocateInfoNV ) == sizeof( VkDedicatedAllocationMemoryAllocateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DedicatedAllocationMemoryAllocateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_transform_feedback === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTransformFeedbackFeaturesEXT ) == sizeof( VkPhysicalDeviceTransformFeedbackFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTransformFeedbackFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTransformFeedbackPropertiesEXT ) == - sizeof( VkPhysicalDeviceTransformFeedbackPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTransformFeedbackPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateStreamCreateInfoEXT ) == - sizeof( VkPipelineRasterizationStateStreamCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationStateStreamCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_NVX_binary_import === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CuModuleNVX ) == sizeof( VkCuModuleNVX ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "CuModuleNVX is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CuFunctionNVX ) == sizeof( VkCuFunctionNVX ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "CuFunctionNVX is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CuModuleCreateInfoNVX ) == sizeof( VkCuModuleCreateInfoNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CuModuleCreateInfoNVX is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CuFunctionCreateInfoNVX ) == sizeof( VkCuFunctionCreateInfoNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CuFunctionCreateInfoNVX is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CuLaunchInfoNVX ) == sizeof( VkCuLaunchInfoNVX ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CuLaunchInfoNVX is not nothrow_move_constructible!" ); - -//=== VK_NVX_image_view_handle === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewHandleInfoNVX ) == sizeof( VkImageViewHandleInfoNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewHandleInfoNVX is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewAddressPropertiesNVX ) == sizeof( VkImageViewAddressPropertiesNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewAddressPropertiesNVX is not nothrow_move_constructible!" ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_EXT_video_encode_h264 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264CapabilitiesEXT ) == sizeof( VkVideoEncodeH264CapabilitiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264CapabilitiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersCreateInfoEXT ) == - sizeof( VkVideoEncodeH264SessionParametersCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264SessionParametersCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersAddInfoEXT ) == sizeof( VkVideoEncodeH264SessionParametersAddInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264SessionParametersAddInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264VclFrameInfoEXT ) == sizeof( VkVideoEncodeH264VclFrameInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264VclFrameInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT ) == sizeof( VkVideoEncodeH264ReferenceListsInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264ReferenceListsInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264EmitPictureParametersInfoEXT ) == - sizeof( VkVideoEncodeH264EmitPictureParametersInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264EmitPictureParametersInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT ) == sizeof( VkVideoEncodeH264DpbSlotInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264DpbSlotInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264NaluSliceInfoEXT ) == sizeof( VkVideoEncodeH264NaluSliceInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264NaluSliceInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264ProfileInfoEXT ) == sizeof( VkVideoEncodeH264ProfileInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264ProfileInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlInfoEXT ) == sizeof( VkVideoEncodeH264RateControlInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264RateControlInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlLayerInfoEXT ) == sizeof( VkVideoEncodeH264RateControlLayerInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264RateControlLayerInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT ) == sizeof( VkVideoEncodeH264QpEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264QpEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH264FrameSizeEXT ) == sizeof( VkVideoEncodeH264FrameSizeEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH264FrameSizeEXT is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_EXT_video_encode_h265 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265CapabilitiesEXT ) == sizeof( VkVideoEncodeH265CapabilitiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265CapabilitiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersCreateInfoEXT ) == - sizeof( VkVideoEncodeH265SessionParametersCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265SessionParametersCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersAddInfoEXT ) == sizeof( VkVideoEncodeH265SessionParametersAddInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265SessionParametersAddInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265VclFrameInfoEXT ) == sizeof( VkVideoEncodeH265VclFrameInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265VclFrameInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265EmitPictureParametersInfoEXT ) == - sizeof( VkVideoEncodeH265EmitPictureParametersInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265EmitPictureParametersInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT ) == sizeof( VkVideoEncodeH265DpbSlotInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265DpbSlotInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265NaluSliceSegmentInfoEXT ) == sizeof( VkVideoEncodeH265NaluSliceSegmentInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265NaluSliceSegmentInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265ProfileInfoEXT ) == sizeof( VkVideoEncodeH265ProfileInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265ProfileInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT ) == sizeof( VkVideoEncodeH265ReferenceListsInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265ReferenceListsInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlInfoEXT ) == sizeof( VkVideoEncodeH265RateControlInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265RateControlInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlLayerInfoEXT ) == sizeof( VkVideoEncodeH265RateControlLayerInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265RateControlLayerInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT ) == sizeof( VkVideoEncodeH265QpEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265QpEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeH265FrameSizeEXT ) == sizeof( VkVideoEncodeH265FrameSizeEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeH265FrameSizeEXT is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_EXT_video_decode_h264 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264ProfileInfoEXT ) == sizeof( VkVideoDecodeH264ProfileInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264ProfileInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264CapabilitiesEXT ) == sizeof( VkVideoDecodeH264CapabilitiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264CapabilitiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersCreateInfoEXT ) == - sizeof( VkVideoDecodeH264SessionParametersCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264SessionParametersCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersAddInfoEXT ) == sizeof( VkVideoDecodeH264SessionParametersAddInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264SessionParametersAddInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264PictureInfoEXT ) == sizeof( VkVideoDecodeH264PictureInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264PictureInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264MvcInfoEXT ) == sizeof( VkVideoDecodeH264MvcInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264MvcInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH264DpbSlotInfoEXT ) == sizeof( VkVideoDecodeH264DpbSlotInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH264DpbSlotInfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -//=== VK_AMD_texture_gather_bias_lod === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TextureLODGatherFormatPropertiesAMD ) == sizeof( VkTextureLODGatherFormatPropertiesAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TextureLODGatherFormatPropertiesAMD is not nothrow_move_constructible!" ); - -//=== VK_AMD_shader_info === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderResourceUsageAMD ) == sizeof( VkShaderResourceUsageAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShaderResourceUsageAMD is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderStatisticsInfoAMD ) == sizeof( VkShaderStatisticsInfoAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShaderStatisticsInfoAMD is not nothrow_move_constructible!" ); - -//=== VK_KHR_dynamic_rendering === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderingFragmentShadingRateAttachmentInfoKHR ) == - sizeof( VkRenderingFragmentShadingRateAttachmentInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderingFragmentShadingRateAttachmentInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderingFragmentDensityMapAttachmentInfoEXT ) == - sizeof( VkRenderingFragmentDensityMapAttachmentInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderingFragmentDensityMapAttachmentInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentSampleCountInfoAMD ) == sizeof( VkAttachmentSampleCountInfoAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentSampleCountInfoAMD is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MultiviewPerViewAttributesInfoNVX ) == sizeof( VkMultiviewPerViewAttributesInfoNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MultiviewPerViewAttributesInfoNVX is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_GGP ) -//=== VK_GGP_stream_descriptor_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateInfoGGP ) == sizeof( VkStreamDescriptorSurfaceCreateInfoGGP ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "StreamDescriptorSurfaceCreateInfoGGP is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_GGP*/ - -//=== VK_NV_corner_sampled_image === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCornerSampledImageFeaturesNV ) == sizeof( VkPhysicalDeviceCornerSampledImageFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCornerSampledImageFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_external_memory_capabilities === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalImageFormatPropertiesNV ) == sizeof( VkExternalImageFormatPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalImageFormatPropertiesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_external_memory === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalMemoryImageCreateInfoNV ) == sizeof( VkExternalMemoryImageCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalMemoryImageCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMemoryAllocateInfoNV ) == sizeof( VkExportMemoryAllocateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMemoryAllocateInfoNV is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_NV_external_memory_win32 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryWin32HandleInfoNV ) == sizeof( VkImportMemoryWin32HandleInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryWin32HandleInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMemoryWin32HandleInfoNV ) == sizeof( VkExportMemoryWin32HandleInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMemoryWin32HandleInfoNV is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_NV_win32_keyed_mutex === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Win32KeyedMutexAcquireReleaseInfoNV ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "Win32KeyedMutexAcquireReleaseInfoNV is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_EXT_validation_flags === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ValidationFlagsEXT ) == sizeof( VkValidationFlagsEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ValidationFlagsEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_VI_NN ) -//=== VK_NN_vi_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ViSurfaceCreateInfoNN ) == sizeof( VkViSurfaceCreateInfoNN ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ViSurfaceCreateInfoNN is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_VI_NN*/ - -//=== VK_EXT_astc_decode_mode === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewASTCDecodeModeEXT ) == sizeof( VkImageViewASTCDecodeModeEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewASTCDecodeModeEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceASTCDecodeFeaturesEXT ) == sizeof( VkPhysicalDeviceASTCDecodeFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceASTCDecodeFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_pipeline_robustness === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineRobustnessFeaturesEXT ) == - sizeof( VkPhysicalDevicePipelineRobustnessFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePipelineRobustnessFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineRobustnessPropertiesEXT ) == - sizeof( VkPhysicalDevicePipelineRobustnessPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePipelineRobustnessPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRobustnessCreateInfoEXT ) == sizeof( VkPipelineRobustnessCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRobustnessCreateInfoEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_KHR_external_memory_win32 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryWin32HandleInfoKHR ) == sizeof( VkImportMemoryWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMemoryWin32HandleInfoKHR ) == sizeof( VkExportMemoryWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMemoryWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryWin32HandlePropertiesKHR ) == sizeof( VkMemoryWin32HandlePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryWin32HandlePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryGetWin32HandleInfoKHR ) == sizeof( VkMemoryGetWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryGetWin32HandleInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_KHR_external_memory_fd === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryFdInfoKHR ) == sizeof( VkImportMemoryFdInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryFdInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryFdPropertiesKHR ) == sizeof( VkMemoryFdPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryFdPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryGetFdInfoKHR ) == sizeof( VkMemoryGetFdInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryGetFdInfoKHR is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_KHR_win32_keyed_mutex === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::Win32KeyedMutexAcquireReleaseInfoKHR ) == sizeof( VkWin32KeyedMutexAcquireReleaseInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "Win32KeyedMutexAcquireReleaseInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_KHR_external_semaphore_win32 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportSemaphoreWin32HandleInfoKHR ) == sizeof( VkImportSemaphoreWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportSemaphoreWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportSemaphoreWin32HandleInfoKHR ) == sizeof( VkExportSemaphoreWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportSemaphoreWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::D3D12FenceSubmitInfoKHR ) == sizeof( VkD3D12FenceSubmitInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "D3D12FenceSubmitInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreGetWin32HandleInfoKHR ) == sizeof( VkSemaphoreGetWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreGetWin32HandleInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_KHR_external_semaphore_fd === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportSemaphoreFdInfoKHR ) == sizeof( VkImportSemaphoreFdInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportSemaphoreFdInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreGetFdInfoKHR ) == sizeof( VkSemaphoreGetFdInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreGetFdInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_push_descriptor === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePushDescriptorPropertiesKHR ) == sizeof( VkPhysicalDevicePushDescriptorPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePushDescriptorPropertiesKHR is not nothrow_move_constructible!" ); - -//=== VK_EXT_conditional_rendering === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ConditionalRenderingBeginInfoEXT ) == sizeof( VkConditionalRenderingBeginInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ConditionalRenderingBeginInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceConditionalRenderingFeaturesEXT ) == - sizeof( VkPhysicalDeviceConditionalRenderingFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceConditionalRenderingFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceConditionalRenderingInfoEXT ) == - sizeof( VkCommandBufferInheritanceConditionalRenderingInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferInheritanceConditionalRenderingInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_incremental_present === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentRegionsKHR ) == sizeof( VkPresentRegionsKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentRegionsKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentRegionKHR ) == sizeof( VkPresentRegionKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentRegionKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RectLayerKHR ) == sizeof( VkRectLayerKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "RectLayerKHR is not nothrow_move_constructible!" ); - -//=== VK_NV_clip_space_w_scaling === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ViewportWScalingNV ) == sizeof( VkViewportWScalingNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ViewportWScalingNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportWScalingStateCreateInfoNV ) == sizeof( VkPipelineViewportWScalingStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportWScalingStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_display_surface_counter === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceCapabilities2EXT ) == sizeof( VkSurfaceCapabilities2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceCapabilities2EXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_display_control === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPowerInfoEXT ) == sizeof( VkDisplayPowerInfoEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPowerInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceEventInfoEXT ) == sizeof( VkDeviceEventInfoEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceEventInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayEventInfoEXT ) == sizeof( VkDisplayEventInfoEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayEventInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SwapchainCounterCreateInfoEXT ) == sizeof( VkSwapchainCounterCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SwapchainCounterCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_GOOGLE_display_timing === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RefreshCycleDurationGOOGLE ) == sizeof( VkRefreshCycleDurationGOOGLE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RefreshCycleDurationGOOGLE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PastPresentationTimingGOOGLE ) == sizeof( VkPastPresentationTimingGOOGLE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PastPresentationTimingGOOGLE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentTimesInfoGOOGLE ) == sizeof( VkPresentTimesInfoGOOGLE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentTimesInfoGOOGLE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentTimeGOOGLE ) == sizeof( VkPresentTimeGOOGLE ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentTimeGOOGLE is not nothrow_move_constructible!" ); - -//=== VK_NVX_multiview_per_view_attributes === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ) == - sizeof( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX is not nothrow_move_constructible!" ); - -//=== VK_NV_viewport_swizzle === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ViewportSwizzleNV ) == sizeof( VkViewportSwizzleNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ViewportSwizzleNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateInfoNV ) == sizeof( VkPipelineViewportSwizzleStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportSwizzleStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_discard_rectangles === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDiscardRectanglePropertiesEXT ) == - sizeof( VkPhysicalDeviceDiscardRectanglePropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDiscardRectanglePropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateInfoEXT ) == sizeof( VkPipelineDiscardRectangleStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineDiscardRectangleStateCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_conservative_rasterization === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceConservativeRasterizationPropertiesEXT ) == - sizeof( VkPhysicalDeviceConservativeRasterizationPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceConservativeRasterizationPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationConservativeStateCreateInfoEXT ) == - sizeof( VkPipelineRasterizationConservativeStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationConservativeStateCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_depth_clip_enable === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClipEnableFeaturesEXT ) == sizeof( VkPhysicalDeviceDepthClipEnableFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDepthClipEnableFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationDepthClipStateCreateInfoEXT ) == - sizeof( VkPipelineRasterizationDepthClipStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationDepthClipStateCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_hdr_metadata === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::HdrMetadataEXT ) == sizeof( VkHdrMetadataEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "HdrMetadataEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::XYColorEXT ) == sizeof( VkXYColorEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "XYColorEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_shared_presentable_image === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SharedPresentSurfaceCapabilitiesKHR ) == sizeof( VkSharedPresentSurfaceCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SharedPresentSurfaceCapabilitiesKHR is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_KHR_external_fence_win32 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportFenceWin32HandleInfoKHR ) == sizeof( VkImportFenceWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportFenceWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportFenceWin32HandleInfoKHR ) == sizeof( VkExportFenceWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportFenceWin32HandleInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FenceGetWin32HandleInfoKHR ) == sizeof( VkFenceGetWin32HandleInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FenceGetWin32HandleInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_KHR_external_fence_fd === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportFenceFdInfoKHR ) == sizeof( VkImportFenceFdInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportFenceFdInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FenceGetFdInfoKHR ) == sizeof( VkFenceGetFdInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FenceGetFdInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_performance_query === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePerformanceQueryFeaturesKHR ) == sizeof( VkPhysicalDevicePerformanceQueryFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePerformanceQueryFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePerformanceQueryPropertiesKHR ) == - sizeof( VkPhysicalDevicePerformanceQueryPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePerformanceQueryPropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceCounterKHR ) == sizeof( VkPerformanceCounterKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceCounterKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionKHR ) == sizeof( VkPerformanceCounterDescriptionKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceCounterDescriptionKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueryPoolPerformanceCreateInfoKHR ) == sizeof( VkQueryPoolPerformanceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueryPoolPerformanceCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceCounterResultKHR ) == sizeof( VkPerformanceCounterResultKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceCounterResultKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AcquireProfilingLockInfoKHR ) == sizeof( VkAcquireProfilingLockInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AcquireProfilingLockInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceQuerySubmitInfoKHR ) == sizeof( VkPerformanceQuerySubmitInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceQuerySubmitInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_get_surface_capabilities2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSurfaceInfo2KHR ) == sizeof( VkPhysicalDeviceSurfaceInfo2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSurfaceInfo2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceCapabilities2KHR ) == sizeof( VkSurfaceCapabilities2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceCapabilities2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceFormat2KHR ) == sizeof( VkSurfaceFormat2KHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceFormat2KHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_get_display_properties2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayProperties2KHR ) == sizeof( VkDisplayProperties2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayProperties2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPlaneProperties2KHR ) == sizeof( VkDisplayPlaneProperties2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPlaneProperties2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayModeProperties2KHR ) == sizeof( VkDisplayModeProperties2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayModeProperties2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPlaneInfo2KHR ) == sizeof( VkDisplayPlaneInfo2KHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPlaneInfo2KHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilities2KHR ) == sizeof( VkDisplayPlaneCapabilities2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayPlaneCapabilities2KHR is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_IOS_MVK ) -//=== VK_MVK_ios_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateInfoMVK ) == sizeof( VkIOSSurfaceCreateInfoMVK ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "IOSSurfaceCreateInfoMVK is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) -//=== VK_MVK_macos_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateInfoMVK ) == sizeof( VkMacOSSurfaceCreateInfoMVK ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MacOSSurfaceCreateInfoMVK is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - -//=== VK_EXT_debug_utils === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT ) == sizeof( VkDebugUtilsLabelEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsLabelEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataEXT ) == sizeof( VkDebugUtilsMessengerCallbackDataEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsMessengerCallbackDataEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateInfoEXT ) == sizeof( VkDebugUtilsMessengerCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsMessengerCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerEXT ) == sizeof( VkDebugUtilsMessengerEXT ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsMessengerEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT ) == sizeof( VkDebugUtilsObjectNameInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsObjectNameInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DebugUtilsObjectTagInfoEXT ) == sizeof( VkDebugUtilsObjectTagInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DebugUtilsObjectTagInfoEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) -//=== VK_ANDROID_external_memory_android_hardware_buffer === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferUsageANDROID ) == sizeof( VkAndroidHardwareBufferUsageANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AndroidHardwareBufferUsageANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferPropertiesANDROID ) == sizeof( VkAndroidHardwareBufferPropertiesANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AndroidHardwareBufferPropertiesANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatPropertiesANDROID ) == - sizeof( VkAndroidHardwareBufferFormatPropertiesANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AndroidHardwareBufferFormatPropertiesANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportAndroidHardwareBufferInfoANDROID ) == sizeof( VkImportAndroidHardwareBufferInfoANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportAndroidHardwareBufferInfoANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryGetAndroidHardwareBufferInfoANDROID ) == sizeof( VkMemoryGetAndroidHardwareBufferInfoANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryGetAndroidHardwareBufferInfoANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExternalFormatANDROID ) == sizeof( VkExternalFormatANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExternalFormatANDROID is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AndroidHardwareBufferFormatProperties2ANDROID ) == - sizeof( VkAndroidHardwareBufferFormatProperties2ANDROID ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AndroidHardwareBufferFormatProperties2ANDROID is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -//=== VK_EXT_sample_locations === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SampleLocationEXT ) == sizeof( VkSampleLocationEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SampleLocationEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT ) == sizeof( VkSampleLocationsInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SampleLocationsInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AttachmentSampleLocationsEXT ) == sizeof( VkAttachmentSampleLocationsEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AttachmentSampleLocationsEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassSampleLocationsEXT ) == sizeof( VkSubpassSampleLocationsEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassSampleLocationsEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassSampleLocationsBeginInfoEXT ) == sizeof( VkRenderPassSampleLocationsBeginInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassSampleLocationsBeginInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineSampleLocationsStateCreateInfoEXT ) == sizeof( VkPipelineSampleLocationsStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineSampleLocationsStateCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSampleLocationsPropertiesEXT ) == sizeof( VkPhysicalDeviceSampleLocationsPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSampleLocationsPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MultisamplePropertiesEXT ) == sizeof( VkMultisamplePropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MultisamplePropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_blend_operation_advanced === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceBlendOperationAdvancedFeaturesEXT ) == - sizeof( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceBlendOperationAdvancedFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceBlendOperationAdvancedPropertiesEXT ) == - sizeof( VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceBlendOperationAdvancedPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineColorBlendAdvancedStateCreateInfoEXT ) == - sizeof( VkPipelineColorBlendAdvancedStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineColorBlendAdvancedStateCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_NV_fragment_coverage_to_color === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCoverageToColorStateCreateInfoNV ) == sizeof( VkPipelineCoverageToColorStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCoverageToColorStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_KHR_acceleration_structure === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR ) == sizeof( VkDeviceOrHostAddressKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceOrHostAddressKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR ) == sizeof( VkDeviceOrHostAddressConstKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceOrHostAddressConstKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildRangeInfoKHR ) == sizeof( VkAccelerationStructureBuildRangeInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureBuildRangeInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AabbPositionsKHR ) == sizeof( VkAabbPositionsKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AabbPositionsKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryTrianglesDataKHR ) == - sizeof( VkAccelerationStructureGeometryTrianglesDataKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryTrianglesDataKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TransformMatrixKHR ) == sizeof( VkTransformMatrixKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TransformMatrixKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildGeometryInfoKHR ) == sizeof( VkAccelerationStructureBuildGeometryInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureBuildGeometryInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryAabbsDataKHR ) == sizeof( VkAccelerationStructureGeometryAabbsDataKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryAabbsDataKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureInstanceKHR ) == sizeof( VkAccelerationStructureInstanceKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureInstanceKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryInstancesDataKHR ) == - sizeof( VkAccelerationStructureGeometryInstancesDataKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryInstancesDataKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryDataKHR ) == sizeof( VkAccelerationStructureGeometryDataKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryDataKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR ) == sizeof( VkAccelerationStructureGeometryKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoKHR ) == sizeof( VkAccelerationStructureCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR ) == sizeof( VkAccelerationStructureKHR ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::WriteDescriptorSetAccelerationStructureKHR ) == sizeof( VkWriteDescriptorSetAccelerationStructureKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "WriteDescriptorSetAccelerationStructureKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceAccelerationStructureFeaturesKHR ) == - sizeof( VkPhysicalDeviceAccelerationStructureFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceAccelerationStructureFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceAccelerationStructurePropertiesKHR ) == - sizeof( VkPhysicalDeviceAccelerationStructurePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceAccelerationStructurePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureDeviceAddressInfoKHR ) == sizeof( VkAccelerationStructureDeviceAddressInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureDeviceAddressInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureVersionInfoKHR ) == sizeof( VkAccelerationStructureVersionInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureVersionInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureToMemoryInfoKHR ) == sizeof( VkCopyAccelerationStructureToMemoryInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyAccelerationStructureToMemoryInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyMemoryToAccelerationStructureInfoKHR ) == sizeof( VkCopyMemoryToAccelerationStructureInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyMemoryToAccelerationStructureInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureInfoKHR ) == sizeof( VkCopyAccelerationStructureInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyAccelerationStructureInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureBuildSizesInfoKHR ) == sizeof( VkAccelerationStructureBuildSizesInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureBuildSizesInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_NV_framebuffer_mixed_samples === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateInfoNV ) == - sizeof( VkPipelineCoverageModulationStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCoverageModulationStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_NV_shader_sm_builtins === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSMBuiltinsPropertiesNV ) == sizeof( VkPhysicalDeviceShaderSMBuiltinsPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderSMBuiltinsPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSMBuiltinsFeaturesNV ) == sizeof( VkPhysicalDeviceShaderSMBuiltinsFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderSMBuiltinsFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_image_drm_format_modifier === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesListEXT ) == sizeof( VkDrmFormatModifierPropertiesListEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrmFormatModifierPropertiesListEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesEXT ) == sizeof( VkDrmFormatModifierPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrmFormatModifierPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageDrmFormatModifierInfoEXT ) == - sizeof( VkPhysicalDeviceImageDrmFormatModifierInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageDrmFormatModifierInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierListCreateInfoEXT ) == sizeof( VkImageDrmFormatModifierListCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageDrmFormatModifierListCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierExplicitCreateInfoEXT ) == - sizeof( VkImageDrmFormatModifierExplicitCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageDrmFormatModifierExplicitCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageDrmFormatModifierPropertiesEXT ) == sizeof( VkImageDrmFormatModifierPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageDrmFormatModifierPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesList2EXT ) == sizeof( VkDrmFormatModifierPropertiesList2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrmFormatModifierPropertiesList2EXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrmFormatModifierProperties2EXT ) == sizeof( VkDrmFormatModifierProperties2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrmFormatModifierProperties2EXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_validation_cache === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ValidationCacheEXT ) == sizeof( VkValidationCacheEXT ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ValidationCacheEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ValidationCacheCreateInfoEXT ) == sizeof( VkValidationCacheCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ValidationCacheCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderModuleValidationCacheCreateInfoEXT ) == sizeof( VkShaderModuleValidationCacheCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShaderModuleValidationCacheCreateInfoEXT is not nothrow_move_constructible!" ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_KHR_portability_subset === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePortabilitySubsetFeaturesKHR ) == sizeof( VkPhysicalDevicePortabilitySubsetFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePortabilitySubsetFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePortabilitySubsetPropertiesKHR ) == - sizeof( VkPhysicalDevicePortabilitySubsetPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePortabilitySubsetPropertiesKHR is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -//=== VK_NV_shading_rate_image === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV ) == sizeof( VkShadingRatePaletteNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShadingRatePaletteNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportShadingRateImageStateCreateInfoNV ) == - sizeof( VkPipelineViewportShadingRateImageStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportShadingRateImageStateCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShadingRateImageFeaturesNV ) == sizeof( VkPhysicalDeviceShadingRateImageFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShadingRateImageFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShadingRateImagePropertiesNV ) == sizeof( VkPhysicalDeviceShadingRateImagePropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShadingRateImagePropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CoarseSampleLocationNV ) == sizeof( VkCoarseSampleLocationNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CoarseSampleLocationNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV ) == sizeof( VkCoarseSampleOrderCustomNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CoarseSampleOrderCustomNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportCoarseSampleOrderStateCreateInfoNV ) == - sizeof( VkPipelineViewportCoarseSampleOrderStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportCoarseSampleOrderStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_NV_ray_tracing === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoNV ) == sizeof( VkRayTracingShaderGroupCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RayTracingShaderGroupCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoNV ) == sizeof( VkRayTracingPipelineCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RayTracingPipelineCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeometryTrianglesNV ) == sizeof( VkGeometryTrianglesNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GeometryTrianglesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeometryAABBNV ) == sizeof( VkGeometryAABBNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GeometryAABBNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeometryDataNV ) == sizeof( VkGeometryDataNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GeometryDataNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeometryNV ) == sizeof( VkGeometryNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "GeometryNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV ) == sizeof( VkAccelerationStructureInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateInfoNV ) == sizeof( VkAccelerationStructureCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureNV ) == sizeof( VkAccelerationStructureNV ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindAccelerationStructureMemoryInfoNV ) == sizeof( VkBindAccelerationStructureMemoryInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindAccelerationStructureMemoryInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::WriteDescriptorSetAccelerationStructureNV ) == sizeof( VkWriteDescriptorSetAccelerationStructureNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "WriteDescriptorSetAccelerationStructureNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsInfoNV ) == - sizeof( VkAccelerationStructureMemoryRequirementsInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureMemoryRequirementsInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPropertiesNV ) == sizeof( VkPhysicalDeviceRayTracingPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayTracingPropertiesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_representative_fragment_test === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRepresentativeFragmentTestFeaturesNV ) == - sizeof( VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRepresentativeFragmentTestFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRepresentativeFragmentTestStateCreateInfoNV ) == - sizeof( VkPipelineRepresentativeFragmentTestStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRepresentativeFragmentTestStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_filter_cubic === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageViewImageFormatInfoEXT ) == sizeof( VkPhysicalDeviceImageViewImageFormatInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageViewImageFormatInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FilterCubicImageViewImageFormatPropertiesEXT ) == - sizeof( VkFilterCubicImageViewImageFormatPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FilterCubicImageViewImageFormatPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_external_memory_host === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryHostPointerInfoEXT ) == sizeof( VkImportMemoryHostPointerInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryHostPointerInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryHostPointerPropertiesEXT ) == sizeof( VkMemoryHostPointerPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryHostPointerPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalMemoryHostPropertiesEXT ) == - sizeof( VkPhysicalDeviceExternalMemoryHostPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalMemoryHostPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_shader_clock === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderClockFeaturesKHR ) == sizeof( VkPhysicalDeviceShaderClockFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderClockFeaturesKHR is not nothrow_move_constructible!" ); - -//=== VK_AMD_pipeline_compiler_control === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCompilerControlCreateInfoAMD ) == sizeof( VkPipelineCompilerControlCreateInfoAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCompilerControlCreateInfoAMD is not nothrow_move_constructible!" ); - -//=== VK_EXT_calibrated_timestamps === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CalibratedTimestampInfoEXT ) == sizeof( VkCalibratedTimestampInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CalibratedTimestampInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_AMD_shader_core_properties === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderCorePropertiesAMD ) == sizeof( VkPhysicalDeviceShaderCorePropertiesAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderCorePropertiesAMD is not nothrow_move_constructible!" ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_EXT_video_decode_h265 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265ProfileInfoEXT ) == sizeof( VkVideoDecodeH265ProfileInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265ProfileInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265CapabilitiesEXT ) == sizeof( VkVideoDecodeH265CapabilitiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265CapabilitiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersCreateInfoEXT ) == - sizeof( VkVideoDecodeH265SessionParametersCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265SessionParametersCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersAddInfoEXT ) == sizeof( VkVideoDecodeH265SessionParametersAddInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265SessionParametersAddInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265PictureInfoEXT ) == sizeof( VkVideoDecodeH265PictureInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265PictureInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoDecodeH265DpbSlotInfoEXT ) == sizeof( VkVideoDecodeH265DpbSlotInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoDecodeH265DpbSlotInfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -//=== VK_KHR_global_priority === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceQueueGlobalPriorityCreateInfoKHR ) == sizeof( VkDeviceQueueGlobalPriorityCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceQueueGlobalPriorityCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceGlobalPriorityQueryFeaturesKHR ) == - sizeof( VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceGlobalPriorityQueryFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyGlobalPriorityPropertiesKHR ) == sizeof( VkQueueFamilyGlobalPriorityPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyGlobalPriorityPropertiesKHR is not nothrow_move_constructible!" ); - -//=== VK_AMD_memory_overallocation_behavior === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceMemoryOverallocationCreateInfoAMD ) == sizeof( VkDeviceMemoryOverallocationCreateInfoAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceMemoryOverallocationCreateInfoAMD is not nothrow_move_constructible!" ); - -//=== VK_EXT_vertex_attribute_divisor === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexAttributeDivisorPropertiesEXT ) == - sizeof( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVertexAttributeDivisorPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VertexInputBindingDivisorDescriptionEXT ) == sizeof( VkVertexInputBindingDivisorDescriptionEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VertexInputBindingDivisorDescriptionEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineVertexInputDivisorStateCreateInfoEXT ) == - sizeof( VkPipelineVertexInputDivisorStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineVertexInputDivisorStateCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexAttributeDivisorFeaturesEXT ) == - sizeof( VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVertexAttributeDivisorFeaturesEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_GGP ) -//=== VK_GGP_frame_token === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentFrameTokenGGP ) == sizeof( VkPresentFrameTokenGGP ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PresentFrameTokenGGP is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_GGP*/ - -//=== VK_NV_compute_shader_derivatives === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceComputeShaderDerivativesFeaturesNV ) == - sizeof( VkPhysicalDeviceComputeShaderDerivativesFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceComputeShaderDerivativesFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_mesh_shader === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderFeaturesNV ) == sizeof( VkPhysicalDeviceMeshShaderFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMeshShaderFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderPropertiesNV ) == sizeof( VkPhysicalDeviceMeshShaderPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMeshShaderPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrawMeshTasksIndirectCommandNV ) == sizeof( VkDrawMeshTasksIndirectCommandNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrawMeshTasksIndirectCommandNV is not nothrow_move_constructible!" ); - -//=== VK_NV_shader_image_footprint === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderImageFootprintFeaturesNV ) == - sizeof( VkPhysicalDeviceShaderImageFootprintFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderImageFootprintFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_scissor_exclusive === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportExclusiveScissorStateCreateInfoNV ) == - sizeof( VkPipelineViewportExclusiveScissorStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportExclusiveScissorStateCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExclusiveScissorFeaturesNV ) == sizeof( VkPhysicalDeviceExclusiveScissorFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExclusiveScissorFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_device_diagnostic_checkpoints === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyCheckpointPropertiesNV ) == sizeof( VkQueueFamilyCheckpointPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyCheckpointPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CheckpointDataNV ) == sizeof( VkCheckpointDataNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CheckpointDataNV is not nothrow_move_constructible!" ); - -//=== VK_INTEL_shader_integer_functions2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL ) == - sizeof( VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL is not nothrow_move_constructible!" ); - -//=== VK_INTEL_performance_query === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceValueDataINTEL ) == sizeof( VkPerformanceValueDataINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceValueDataINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceValueINTEL ) == sizeof( VkPerformanceValueINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceValueINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::InitializePerformanceApiInfoINTEL ) == sizeof( VkInitializePerformanceApiInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "InitializePerformanceApiInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueryPoolPerformanceQueryCreateInfoINTEL ) == sizeof( VkQueryPoolPerformanceQueryCreateInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueryPoolPerformanceQueryCreateInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceMarkerInfoINTEL ) == sizeof( VkPerformanceMarkerInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceMarkerInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceStreamMarkerInfoINTEL ) == sizeof( VkPerformanceStreamMarkerInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceStreamMarkerInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceOverrideInfoINTEL ) == sizeof( VkPerformanceOverrideInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceOverrideInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceConfigurationAcquireInfoINTEL ) == sizeof( VkPerformanceConfigurationAcquireInfoINTEL ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceConfigurationAcquireInfoINTEL is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PerformanceConfigurationINTEL ) == sizeof( VkPerformanceConfigurationINTEL ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PerformanceConfigurationINTEL is not nothrow_move_constructible!" ); - -//=== VK_EXT_pci_bus_info === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePCIBusInfoPropertiesEXT ) == sizeof( VkPhysicalDevicePCIBusInfoPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePCIBusInfoPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_AMD_display_native_hdr === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DisplayNativeHdrSurfaceCapabilitiesAMD ) == sizeof( VkDisplayNativeHdrSurfaceCapabilitiesAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DisplayNativeHdrSurfaceCapabilitiesAMD is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SwapchainDisplayNativeHdrCreateInfoAMD ) == sizeof( VkSwapchainDisplayNativeHdrCreateInfoAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SwapchainDisplayNativeHdrCreateInfoAMD is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_FUCHSIA ) -//=== VK_FUCHSIA_imagepipe_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateInfoFUCHSIA ) == sizeof( VkImagePipeSurfaceCreateInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImagePipeSurfaceCreateInfoFUCHSIA is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) -//=== VK_EXT_metal_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateInfoEXT ) == sizeof( VkMetalSurfaceCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MetalSurfaceCreateInfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -//=== VK_EXT_fragment_density_map === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapFeaturesEXT ) == - sizeof( VkPhysicalDeviceFragmentDensityMapFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMapFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapPropertiesEXT ) == - sizeof( VkPhysicalDeviceFragmentDensityMapPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMapPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassFragmentDensityMapCreateInfoEXT ) == sizeof( VkRenderPassFragmentDensityMapCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassFragmentDensityMapCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_fragment_shading_rate === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FragmentShadingRateAttachmentInfoKHR ) == sizeof( VkFragmentShadingRateAttachmentInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FragmentShadingRateAttachmentInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineFragmentShadingRateStateCreateInfoKHR ) == - sizeof( VkPipelineFragmentShadingRateStateCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineFragmentShadingRateStateCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateFeaturesKHR ) == - sizeof( VkPhysicalDeviceFragmentShadingRateFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShadingRateFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRatePropertiesKHR ) == - sizeof( VkPhysicalDeviceFragmentShadingRatePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShadingRatePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateKHR ) == sizeof( VkPhysicalDeviceFragmentShadingRateKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShadingRateKHR is not nothrow_move_constructible!" ); - -//=== VK_AMD_shader_core_properties2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderCoreProperties2AMD ) == sizeof( VkPhysicalDeviceShaderCoreProperties2AMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderCoreProperties2AMD is not nothrow_move_constructible!" ); - -//=== VK_AMD_device_coherent_memory === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCoherentMemoryFeaturesAMD ) == sizeof( VkPhysicalDeviceCoherentMemoryFeaturesAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCoherentMemoryFeaturesAMD is not nothrow_move_constructible!" ); - -//=== VK_EXT_shader_image_atomic_int64 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderImageAtomicInt64FeaturesEXT ) == - sizeof( VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderImageAtomicInt64FeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_memory_budget === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryBudgetPropertiesEXT ) == sizeof( VkPhysicalDeviceMemoryBudgetPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMemoryBudgetPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_memory_priority === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryPriorityFeaturesEXT ) == sizeof( VkPhysicalDeviceMemoryPriorityFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMemoryPriorityFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryPriorityAllocateInfoEXT ) == sizeof( VkMemoryPriorityAllocateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryPriorityAllocateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_surface_protected_capabilities === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceProtectedCapabilitiesKHR ) == sizeof( VkSurfaceProtectedCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceProtectedCapabilitiesKHR is not nothrow_move_constructible!" ); - -//=== VK_NV_dedicated_allocation_image_aliasing === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV ) == - sizeof( VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_buffer_device_address === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceBufferDeviceAddressFeaturesEXT ) == - sizeof( VkPhysicalDeviceBufferDeviceAddressFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceBufferDeviceAddressFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferDeviceAddressCreateInfoEXT ) == sizeof( VkBufferDeviceAddressCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferDeviceAddressCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_validation_features === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ValidationFeaturesEXT ) == sizeof( VkValidationFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ValidationFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_present_wait === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePresentWaitFeaturesKHR ) == sizeof( VkPhysicalDevicePresentWaitFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePresentWaitFeaturesKHR is not nothrow_move_constructible!" ); - -//=== VK_NV_cooperative_matrix === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CooperativeMatrixPropertiesNV ) == sizeof( VkCooperativeMatrixPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CooperativeMatrixPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCooperativeMatrixFeaturesNV ) == sizeof( VkPhysicalDeviceCooperativeMatrixFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCooperativeMatrixFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCooperativeMatrixPropertiesNV ) == - sizeof( VkPhysicalDeviceCooperativeMatrixPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCooperativeMatrixPropertiesNV is not nothrow_move_constructible!" ); - -//=== VK_NV_coverage_reduction_mode === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCoverageReductionModeFeaturesNV ) == - sizeof( VkPhysicalDeviceCoverageReductionModeFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCoverageReductionModeFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineCoverageReductionStateCreateInfoNV ) == sizeof( VkPipelineCoverageReductionStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineCoverageReductionStateCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::FramebufferMixedSamplesCombinationNV ) == sizeof( VkFramebufferMixedSamplesCombinationNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "FramebufferMixedSamplesCombinationNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_fragment_shader_interlock === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderInterlockFeaturesEXT ) == - sizeof( VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShaderInterlockFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_ycbcr_image_arrays === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcrImageArraysFeaturesEXT ) == sizeof( VkPhysicalDeviceYcbcrImageArraysFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceYcbcrImageArraysFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_provoking_vertex === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProvokingVertexFeaturesEXT ) == sizeof( VkPhysicalDeviceProvokingVertexFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProvokingVertexFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceProvokingVertexPropertiesEXT ) == sizeof( VkPhysicalDeviceProvokingVertexPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceProvokingVertexPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationProvokingVertexStateCreateInfoEXT ) == - sizeof( VkPipelineRasterizationProvokingVertexStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationProvokingVertexStateCreateInfoEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) -//=== VK_EXT_full_screen_exclusive === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceFullScreenExclusiveInfoEXT ) == sizeof( VkSurfaceFullScreenExclusiveInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceFullScreenExclusiveInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesFullScreenExclusiveEXT ) == sizeof( VkSurfaceCapabilitiesFullScreenExclusiveEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceCapabilitiesFullScreenExclusiveEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SurfaceFullScreenExclusiveWin32InfoEXT ) == sizeof( VkSurfaceFullScreenExclusiveWin32InfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SurfaceFullScreenExclusiveWin32InfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -//=== VK_EXT_headless_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateInfoEXT ) == sizeof( VkHeadlessSurfaceCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "HeadlessSurfaceCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_line_rasterization === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLineRasterizationFeaturesEXT ) == sizeof( VkPhysicalDeviceLineRasterizationFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceLineRasterizationFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLineRasterizationPropertiesEXT ) == - sizeof( VkPhysicalDeviceLineRasterizationPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceLineRasterizationPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineRasterizationLineStateCreateInfoEXT ) == - sizeof( VkPipelineRasterizationLineStateCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineRasterizationLineStateCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_shader_atomic_float === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicFloatFeaturesEXT ) == sizeof( VkPhysicalDeviceShaderAtomicFloatFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderAtomicFloatFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_index_type_uint8 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceIndexTypeUint8FeaturesEXT ) == sizeof( VkPhysicalDeviceIndexTypeUint8FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceIndexTypeUint8FeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_extended_dynamic_state === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedDynamicStateFeaturesEXT ) == - sizeof( VkPhysicalDeviceExtendedDynamicStateFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExtendedDynamicStateFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_deferred_host_operations === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeferredOperationKHR ) == sizeof( VkDeferredOperationKHR ), "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeferredOperationKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_pipeline_executable_properties === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelineExecutablePropertiesFeaturesKHR ) == - sizeof( VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePipelineExecutablePropertiesFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineInfoKHR ) == sizeof( VkPipelineInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineExecutablePropertiesKHR ) == sizeof( VkPipelineExecutablePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineExecutablePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineExecutableInfoKHR ) == sizeof( VkPipelineExecutableInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineExecutableInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticValueKHR ) == sizeof( VkPipelineExecutableStatisticValueKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineExecutableStatisticValueKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticKHR ) == sizeof( VkPipelineExecutableStatisticKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineExecutableStatisticKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineExecutableInternalRepresentationKHR ) == - sizeof( VkPipelineExecutableInternalRepresentationKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineExecutableInternalRepresentationKHR is not nothrow_move_constructible!" ); - -//=== VK_EXT_shader_atomic_float2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderAtomicFloat2FeaturesEXT ) == - sizeof( VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderAtomicFloat2FeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_NV_device_generated_commands === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceGeneratedCommandsPropertiesNV ) == - sizeof( VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDeviceGeneratedCommandsPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceGeneratedCommandsFeaturesNV ) == - sizeof( VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDeviceGeneratedCommandsFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GraphicsShaderGroupCreateInfoNV ) == sizeof( VkGraphicsShaderGroupCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GraphicsShaderGroupCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GraphicsPipelineShaderGroupsCreateInfoNV ) == sizeof( VkGraphicsPipelineShaderGroupsCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GraphicsPipelineShaderGroupsCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindShaderGroupIndirectCommandNV ) == sizeof( VkBindShaderGroupIndirectCommandNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindShaderGroupIndirectCommandNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindIndexBufferIndirectCommandNV ) == sizeof( VkBindIndexBufferIndirectCommandNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindIndexBufferIndirectCommandNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BindVertexBufferIndirectCommandNV ) == sizeof( VkBindVertexBufferIndirectCommandNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BindVertexBufferIndirectCommandNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SetStateFlagsIndirectCommandNV ) == sizeof( VkSetStateFlagsIndirectCommandNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SetStateFlagsIndirectCommandNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV ) == sizeof( VkIndirectCommandsLayoutNV ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "IndirectCommandsLayoutNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::IndirectCommandsStreamNV ) == sizeof( VkIndirectCommandsStreamNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "IndirectCommandsStreamNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutTokenNV ) == sizeof( VkIndirectCommandsLayoutTokenNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "IndirectCommandsLayoutTokenNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutCreateInfoNV ) == sizeof( VkIndirectCommandsLayoutCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "IndirectCommandsLayoutCreateInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeneratedCommandsInfoNV ) == sizeof( VkGeneratedCommandsInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GeneratedCommandsInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GeneratedCommandsMemoryRequirementsInfoNV ) == sizeof( VkGeneratedCommandsMemoryRequirementsInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GeneratedCommandsMemoryRequirementsInfoNV is not nothrow_move_constructible!" ); - -//=== VK_NV_inherited_viewport_scissor === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceInheritedViewportScissorFeaturesNV ) == - sizeof( VkPhysicalDeviceInheritedViewportScissorFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceInheritedViewportScissorFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceViewportScissorInfoNV ) == - sizeof( VkCommandBufferInheritanceViewportScissorInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferInheritanceViewportScissorInfoNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_texel_buffer_alignment === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTexelBufferAlignmentFeaturesEXT ) == - sizeof( VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTexelBufferAlignmentFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_QCOM_render_pass_transform === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassTransformBeginInfoQCOM ) == sizeof( VkRenderPassTransformBeginInfoQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassTransformBeginInfoQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CommandBufferInheritanceRenderPassTransformInfoQCOM ) == - sizeof( VkCommandBufferInheritanceRenderPassTransformInfoQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CommandBufferInheritanceRenderPassTransformInfoQCOM is not nothrow_move_constructible!" ); - -//=== VK_EXT_device_memory_report === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDeviceMemoryReportFeaturesEXT ) == - sizeof( VkPhysicalDeviceDeviceMemoryReportFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDeviceMemoryReportFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceDeviceMemoryReportCreateInfoEXT ) == sizeof( VkDeviceDeviceMemoryReportCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceDeviceMemoryReportCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceMemoryReportCallbackDataEXT ) == sizeof( VkDeviceMemoryReportCallbackDataEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceMemoryReportCallbackDataEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_robustness2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRobustness2FeaturesEXT ) == sizeof( VkPhysicalDeviceRobustness2FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRobustness2FeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRobustness2PropertiesEXT ) == sizeof( VkPhysicalDeviceRobustness2PropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRobustness2PropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_custom_border_color === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerCustomBorderColorCreateInfoEXT ) == sizeof( VkSamplerCustomBorderColorCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerCustomBorderColorCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorPropertiesEXT ) == - sizeof( VkPhysicalDeviceCustomBorderColorPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCustomBorderColorPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceCustomBorderColorFeaturesEXT ) == sizeof( VkPhysicalDeviceCustomBorderColorFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceCustomBorderColorFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_pipeline_library === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR ) == sizeof( VkPipelineLibraryCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineLibraryCreateInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_present_id === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PresentIdKHR ) == sizeof( VkPresentIdKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "PresentIdKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePresentIdFeaturesKHR ) == sizeof( VkPhysicalDevicePresentIdFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePresentIdFeaturesKHR is not nothrow_move_constructible!" ); - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) -//=== VK_KHR_video_encode_queue === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeInfoKHR ) == sizeof( VkVideoEncodeInfoKHR ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeCapabilitiesKHR ) == sizeof( VkVideoEncodeCapabilitiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeCapabilitiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeUsageInfoKHR ) == sizeof( VkVideoEncodeUsageInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeUsageInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlInfoKHR ) == sizeof( VkVideoEncodeRateControlInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeRateControlInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlLayerInfoKHR ) == sizeof( VkVideoEncodeRateControlLayerInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VideoEncodeRateControlLayerInfoKHR is not nothrow_move_constructible!" ); -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -//=== VK_NV_device_diagnostics_config === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDiagnosticsConfigFeaturesNV ) == sizeof( VkPhysicalDeviceDiagnosticsConfigFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDiagnosticsConfigFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DeviceDiagnosticsConfigCreateInfoNV ) == sizeof( VkDeviceDiagnosticsConfigCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DeviceDiagnosticsConfigCreateInfoNV is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_METAL_EXT ) -//=== VK_EXT_metal_objects === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalObjectCreateInfoEXT ) == sizeof( VkExportMetalObjectCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalObjectCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalObjectsInfoEXT ) == sizeof( VkExportMetalObjectsInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalObjectsInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalDeviceInfoEXT ) == sizeof( VkExportMetalDeviceInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalDeviceInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalCommandQueueInfoEXT ) == sizeof( VkExportMetalCommandQueueInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalCommandQueueInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalBufferInfoEXT ) == sizeof( VkExportMetalBufferInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalBufferInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMetalBufferInfoEXT ) == sizeof( VkImportMetalBufferInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMetalBufferInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalTextureInfoEXT ) == sizeof( VkExportMetalTextureInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalTextureInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMetalTextureInfoEXT ) == sizeof( VkImportMetalTextureInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMetalTextureInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalIOSurfaceInfoEXT ) == sizeof( VkExportMetalIOSurfaceInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalIOSurfaceInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMetalIOSurfaceInfoEXT ) == sizeof( VkImportMetalIOSurfaceInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMetalIOSurfaceInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ExportMetalSharedEventInfoEXT ) == sizeof( VkExportMetalSharedEventInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ExportMetalSharedEventInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMetalSharedEventInfoEXT ) == sizeof( VkImportMetalSharedEventInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMetalSharedEventInfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -//=== VK_KHR_synchronization2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::QueueFamilyCheckpointProperties2NV ) == sizeof( VkQueueFamilyCheckpointProperties2NV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "QueueFamilyCheckpointProperties2NV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CheckpointData2NV ) == sizeof( VkCheckpointData2NV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CheckpointData2NV is not nothrow_move_constructible!" ); - -//=== VK_EXT_graphics_pipeline_library === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT ) == - sizeof( VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT ) == - sizeof( VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryCreateInfoEXT ) == sizeof( VkGraphicsPipelineLibraryCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "GraphicsPipelineLibraryCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_AMD_shader_early_and_late_fragment_tests === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD ) == - sizeof( VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD is not nothrow_move_constructible!" ); - -//=== VK_KHR_fragment_shader_barycentric === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderBarycentricFeaturesKHR ) == - sizeof( VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShaderBarycentricFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShaderBarycentricPropertiesKHR ) == - sizeof( VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShaderBarycentricPropertiesKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_shader_subgroup_uniform_control_flow === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR ) == - sizeof( VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR is not nothrow_move_constructible!" ); - -//=== VK_NV_fragment_shading_rate_enums === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateEnumsFeaturesNV ) == - sizeof( VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShadingRateEnumsFeaturesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentShadingRateEnumsPropertiesNV ) == - sizeof( VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentShadingRateEnumsPropertiesNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineFragmentShadingRateEnumStateCreateInfoNV ) == - sizeof( VkPipelineFragmentShadingRateEnumStateCreateInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineFragmentShadingRateEnumStateCreateInfoNV is not nothrow_move_constructible!" ); - -//=== VK_NV_ray_tracing_motion_blur === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryMotionTrianglesDataNV ) == - sizeof( VkAccelerationStructureGeometryMotionTrianglesDataNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureGeometryMotionTrianglesDataNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInfoNV ) == sizeof( VkAccelerationStructureMotionInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureMotionInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceNV ) == sizeof( VkAccelerationStructureMotionInstanceNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureMotionInstanceNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceDataNV ) == sizeof( VkAccelerationStructureMotionInstanceDataNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureMotionInstanceDataNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureMatrixMotionInstanceNV ) == - sizeof( VkAccelerationStructureMatrixMotionInstanceNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureMatrixMotionInstanceNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AccelerationStructureSRTMotionInstanceNV ) == sizeof( VkAccelerationStructureSRTMotionInstanceNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AccelerationStructureSRTMotionInstanceNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SRTDataNV ) == sizeof( VkSRTDataNV ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, "SRTDataNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingMotionBlurFeaturesNV ) == - sizeof( VkPhysicalDeviceRayTracingMotionBlurFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayTracingMotionBlurFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_mesh_shader === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderFeaturesEXT ) == sizeof( VkPhysicalDeviceMeshShaderFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMeshShaderFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMeshShaderPropertiesEXT ) == sizeof( VkPhysicalDeviceMeshShaderPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMeshShaderPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DrawMeshTasksIndirectCommandEXT ) == sizeof( VkDrawMeshTasksIndirectCommandEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DrawMeshTasksIndirectCommandEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_ycbcr_2plane_444_formats === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT ) == - sizeof( VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_fragment_density_map2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMap2FeaturesEXT ) == - sizeof( VkPhysicalDeviceFragmentDensityMap2FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMap2FeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMap2PropertiesEXT ) == - sizeof( VkPhysicalDeviceFragmentDensityMap2PropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMap2PropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_QCOM_rotated_copy_commands === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::CopyCommandTransformInfoQCOM ) == sizeof( VkCopyCommandTransformInfoQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "CopyCommandTransformInfoQCOM is not nothrow_move_constructible!" ); - -//=== VK_KHR_workgroup_memory_explicit_layout === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR ) == - sizeof( VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR is not nothrow_move_constructible!" ); - -//=== VK_EXT_image_compression_control === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageCompressionControlFeaturesEXT ) == - sizeof( VkPhysicalDeviceImageCompressionControlFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageCompressionControlFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageCompressionControlEXT ) == sizeof( VkImageCompressionControlEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageCompressionControlEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubresourceLayout2EXT ) == sizeof( VkSubresourceLayout2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubresourceLayout2EXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageSubresource2EXT ) == sizeof( VkImageSubresource2EXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageSubresource2EXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageCompressionPropertiesEXT ) == sizeof( VkImageCompressionPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageCompressionPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_attachment_feedback_loop_layout === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT ) == - sizeof( VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_4444_formats === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevice4444FormatsFeaturesEXT ) == sizeof( VkPhysicalDevice4444FormatsFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevice4444FormatsFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_rgba10x6_formats === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRGBA10X6FormatsFeaturesEXT ) == sizeof( VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRGBA10X6FormatsFeaturesEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) -//=== VK_EXT_directfb_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateInfoEXT ) == sizeof( VkDirectFBSurfaceCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DirectFBSurfaceCreateInfoEXT is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -//=== VK_KHR_ray_tracing_pipeline === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoKHR ) == sizeof( VkRayTracingShaderGroupCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RayTracingShaderGroupCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RayTracingPipelineCreateInfoKHR ) == sizeof( VkRayTracingPipelineCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RayTracingPipelineCreateInfoKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPipelineFeaturesKHR ) == - sizeof( VkPhysicalDeviceRayTracingPipelineFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayTracingPipelineFeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingPipelinePropertiesKHR ) == - sizeof( VkPhysicalDeviceRayTracingPipelinePropertiesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayTracingPipelinePropertiesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::StridedDeviceAddressRegionKHR ) == sizeof( VkStridedDeviceAddressRegionKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "StridedDeviceAddressRegionKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TraceRaysIndirectCommandKHR ) == sizeof( VkTraceRaysIndirectCommandKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TraceRaysIndirectCommandKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR ) == sizeof( VkRayTracingPipelineInterfaceCreateInfoKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RayTracingPipelineInterfaceCreateInfoKHR is not nothrow_move_constructible!" ); - -//=== VK_KHR_ray_query === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayQueryFeaturesKHR ) == sizeof( VkPhysicalDeviceRayQueryFeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayQueryFeaturesKHR is not nothrow_move_constructible!" ); - -//=== VK_VALVE_mutable_descriptor_type === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMutableDescriptorTypeFeaturesVALVE ) == - sizeof( VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMutableDescriptorTypeFeaturesVALVE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MutableDescriptorTypeListVALVE ) == sizeof( VkMutableDescriptorTypeListVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MutableDescriptorTypeListVALVE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MutableDescriptorTypeCreateInfoVALVE ) == sizeof( VkMutableDescriptorTypeCreateInfoVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MutableDescriptorTypeCreateInfoVALVE is not nothrow_move_constructible!" ); - -//=== VK_EXT_vertex_input_dynamic_state === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceVertexInputDynamicStateFeaturesEXT ) == - sizeof( VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceVertexInputDynamicStateFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VertexInputBindingDescription2EXT ) == sizeof( VkVertexInputBindingDescription2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VertexInputBindingDescription2EXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription2EXT ) == sizeof( VkVertexInputAttributeDescription2EXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "VertexInputAttributeDescription2EXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_physical_device_drm === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDrmPropertiesEXT ) == sizeof( VkPhysicalDeviceDrmPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDrmPropertiesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_depth_clip_control === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClipControlFeaturesEXT ) == sizeof( VkPhysicalDeviceDepthClipControlFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDepthClipControlFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineViewportDepthClipControlCreateInfoEXT ) == - sizeof( VkPipelineViewportDepthClipControlCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineViewportDepthClipControlCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_primitive_topology_list_restart === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT ) == - sizeof( VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_FUCHSIA ) -//=== VK_FUCHSIA_external_memory === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryZirconHandleInfoFUCHSIA ) == sizeof( VkImportMemoryZirconHandleInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryZirconHandleInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryZirconHandlePropertiesFUCHSIA ) == sizeof( VkMemoryZirconHandlePropertiesFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryZirconHandlePropertiesFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryGetZirconHandleInfoFUCHSIA ) == sizeof( VkMemoryGetZirconHandleInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryGetZirconHandleInfoFUCHSIA is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) -//=== VK_FUCHSIA_external_semaphore === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportSemaphoreZirconHandleInfoFUCHSIA ) == sizeof( VkImportSemaphoreZirconHandleInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportSemaphoreZirconHandleInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SemaphoreGetZirconHandleInfoFUCHSIA ) == sizeof( VkSemaphoreGetZirconHandleInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SemaphoreGetZirconHandleInfoFUCHSIA is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) -//=== VK_FUCHSIA_buffer_collection === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA ) == sizeof( VkBufferCollectionFUCHSIA ), - "handle and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionCreateInfoFUCHSIA ) == sizeof( VkBufferCollectionCreateInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionCreateInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImportMemoryBufferCollectionFUCHSIA ) == sizeof( VkImportMemoryBufferCollectionFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImportMemoryBufferCollectionFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionImageCreateInfoFUCHSIA ) == sizeof( VkBufferCollectionImageCreateInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionImageCreateInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferConstraintsInfoFUCHSIA ) == sizeof( VkBufferConstraintsInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferConstraintsInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionBufferCreateInfoFUCHSIA ) == sizeof( VkBufferCollectionBufferCreateInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionBufferCreateInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionPropertiesFUCHSIA ) == sizeof( VkBufferCollectionPropertiesFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionPropertiesFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA ) == sizeof( VkSysmemColorSpaceFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SysmemColorSpaceFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFUCHSIA ) == sizeof( VkImageConstraintsInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageConstraintsInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageFormatConstraintsInfoFUCHSIA ) == sizeof( VkImageFormatConstraintsInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageFormatConstraintsInfoFUCHSIA is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA ) == sizeof( VkBufferCollectionConstraintsInfoFUCHSIA ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "BufferCollectionConstraintsInfoFUCHSIA is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -//=== VK_HUAWEI_subpass_shading === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassShadingPipelineCreateInfoHUAWEI ) == sizeof( VkSubpassShadingPipelineCreateInfoHUAWEI ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassShadingPipelineCreateInfoHUAWEI is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassShadingFeaturesHUAWEI ) == sizeof( VkPhysicalDeviceSubpassShadingFeaturesHUAWEI ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubpassShadingFeaturesHUAWEI is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassShadingPropertiesHUAWEI ) == - sizeof( VkPhysicalDeviceSubpassShadingPropertiesHUAWEI ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubpassShadingPropertiesHUAWEI is not nothrow_move_constructible!" ); - -//=== VK_HUAWEI_invocation_mask === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceInvocationMaskFeaturesHUAWEI ) == sizeof( VkPhysicalDeviceInvocationMaskFeaturesHUAWEI ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceInvocationMaskFeaturesHUAWEI is not nothrow_move_constructible!" ); - -//=== VK_NV_external_memory_rdma === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MemoryGetRemoteAddressInfoNV ) == sizeof( VkMemoryGetRemoteAddressInfoNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MemoryGetRemoteAddressInfoNV is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExternalMemoryRDMAFeaturesNV ) == sizeof( VkPhysicalDeviceExternalMemoryRDMAFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExternalMemoryRDMAFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_pipeline_properties === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelinePropertiesIdentifierEXT ) == sizeof( VkPipelinePropertiesIdentifierEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelinePropertiesIdentifierEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePipelinePropertiesFeaturesEXT ) == - sizeof( VkPhysicalDevicePipelinePropertiesFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePipelinePropertiesFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_multisampled_render_to_single_sampled === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT ) == - sizeof( VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassResolvePerformanceQueryEXT ) == sizeof( VkSubpassResolvePerformanceQueryEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassResolvePerformanceQueryEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MultisampledRenderToSingleSampledInfoEXT ) == sizeof( VkMultisampledRenderToSingleSampledInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MultisampledRenderToSingleSampledInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_extended_dynamic_state2 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceExtendedDynamicState2FeaturesEXT ) == - sizeof( VkPhysicalDeviceExtendedDynamicState2FeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceExtendedDynamicState2FeaturesEXT is not nothrow_move_constructible!" ); - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) -//=== VK_QNX_screen_surface === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateInfoQNX ) == sizeof( VkScreenSurfaceCreateInfoQNX ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ScreenSurfaceCreateInfoQNX is not nothrow_move_constructible!" ); -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - -//=== VK_EXT_color_write_enable === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceColorWriteEnableFeaturesEXT ) == sizeof( VkPhysicalDeviceColorWriteEnableFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceColorWriteEnableFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineColorWriteCreateInfoEXT ) == sizeof( VkPipelineColorWriteCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineColorWriteCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_primitives_generated_query === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT ) == - sizeof( VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_KHR_ray_tracing_maintenance1 === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRayTracingMaintenance1FeaturesKHR ) == - sizeof( VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRayTracingMaintenance1FeaturesKHR is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TraceRaysIndirectCommand2KHR ) == sizeof( VkTraceRaysIndirectCommand2KHR ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TraceRaysIndirectCommand2KHR is not nothrow_move_constructible!" ); - -//=== VK_EXT_image_view_min_lod === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageViewMinLodFeaturesEXT ) == sizeof( VkPhysicalDeviceImageViewMinLodFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageViewMinLodFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewMinLodCreateInfoEXT ) == sizeof( VkImageViewMinLodCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewMinLodCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_multi_draw === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiDrawFeaturesEXT ) == sizeof( VkPhysicalDeviceMultiDrawFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultiDrawFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceMultiDrawPropertiesEXT ) == sizeof( VkPhysicalDeviceMultiDrawPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceMultiDrawPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MultiDrawInfoEXT ) == sizeof( VkMultiDrawInfoEXT ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MultiDrawInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::MultiDrawIndexedInfoEXT ) == sizeof( VkMultiDrawIndexedInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "MultiDrawIndexedInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_image_2d_view_of_3d === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImage2DViewOf3DFeaturesEXT ) == sizeof( VkPhysicalDeviceImage2DViewOf3DFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImage2DViewOf3DFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_border_color_swizzle === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceBorderColorSwizzleFeaturesEXT ) == - sizeof( VkPhysicalDeviceBorderColorSwizzleFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceBorderColorSwizzleFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SamplerBorderColorComponentMappingCreateInfoEXT ) == - sizeof( VkSamplerBorderColorComponentMappingCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SamplerBorderColorComponentMappingCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_pageable_device_local_memory === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT ) == - sizeof( VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_VALVE_descriptor_set_host_mapping === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE ) == - sizeof( VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetBindingReferenceVALVE ) == sizeof( VkDescriptorSetBindingReferenceVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetBindingReferenceVALVE is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutHostMappingInfoVALVE ) == sizeof( VkDescriptorSetLayoutHostMappingInfoVALVE ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "DescriptorSetLayoutHostMappingInfoVALVE is not nothrow_move_constructible!" ); - -//=== VK_EXT_depth_clamp_zero_one === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceDepthClampZeroOneFeaturesEXT ) == sizeof( VkPhysicalDeviceDepthClampZeroOneFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceDepthClampZeroOneFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_non_seamless_cube_map === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceNonSeamlessCubeMapFeaturesEXT ) == - sizeof( VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceNonSeamlessCubeMapFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_QCOM_fragment_density_map_offset === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM ) == - sizeof( VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM ) == - sizeof( VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::SubpassFragmentDensityMapOffsetEndInfoQCOM ) == sizeof( VkSubpassFragmentDensityMapOffsetEndInfoQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "SubpassFragmentDensityMapOffsetEndInfoQCOM is not nothrow_move_constructible!" ); - -//=== VK_NV_linear_color_attachment === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLinearColorAttachmentFeaturesNV ) == - sizeof( VkPhysicalDeviceLinearColorAttachmentFeaturesNV ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceLinearColorAttachmentFeaturesNV is not nothrow_move_constructible!" ); - -//=== VK_EXT_image_compression_control_swapchain === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT ) == - sizeof( VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_QCOM_image_processing === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ImageViewSampleWeightCreateInfoQCOM ) == sizeof( VkImageViewSampleWeightCreateInfoQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ImageViewSampleWeightCreateInfoQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingFeaturesQCOM ) == sizeof( VkPhysicalDeviceImageProcessingFeaturesQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageProcessingFeaturesQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceImageProcessingPropertiesQCOM ) == - sizeof( VkPhysicalDeviceImageProcessingPropertiesQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceImageProcessingPropertiesQCOM is not nothrow_move_constructible!" ); - -//=== VK_EXT_subpass_merge_feedback === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceSubpassMergeFeedbackFeaturesEXT ) == - sizeof( VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceSubpassMergeFeedbackFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassCreationControlEXT ) == sizeof( VkRenderPassCreationControlEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassCreationControlEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackInfoEXT ) == sizeof( VkRenderPassCreationFeedbackInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassCreationFeedbackInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackCreateInfoEXT ) == sizeof( VkRenderPassCreationFeedbackCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassCreationFeedbackCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackInfoEXT ) == sizeof( VkRenderPassSubpassFeedbackInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassSubpassFeedbackInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackCreateInfoEXT ) == sizeof( VkRenderPassSubpassFeedbackCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "RenderPassSubpassFeedbackCreateInfoEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_shader_module_identifier === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderModuleIdentifierFeaturesEXT ) == - sizeof( VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderModuleIdentifierFeaturesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceShaderModuleIdentifierPropertiesEXT ) == - sizeof( VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceShaderModuleIdentifierPropertiesEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PipelineShaderStageModuleIdentifierCreateInfoEXT ) == - sizeof( VkPipelineShaderStageModuleIdentifierCreateInfoEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PipelineShaderStageModuleIdentifierCreateInfoEXT is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::ShaderModuleIdentifierEXT ) == sizeof( VkShaderModuleIdentifierEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "ShaderModuleIdentifierEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_rasterization_order_attachment_access === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT ) == - sizeof( VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_EXT_legacy_dithering === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceLegacyDitheringFeaturesEXT ) == sizeof( VkPhysicalDeviceLegacyDitheringFeaturesEXT ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceLegacyDitheringFeaturesEXT is not nothrow_move_constructible!" ); - -//=== VK_QCOM_tile_properties === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceTilePropertiesFeaturesQCOM ) == sizeof( VkPhysicalDeviceTilePropertiesFeaturesQCOM ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceTilePropertiesFeaturesQCOM is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::TilePropertiesQCOM ) == sizeof( VkTilePropertiesQCOM ), "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "TilePropertiesQCOM is not nothrow_move_constructible!" ); - -//=== VK_SEC_amigo_profiling === - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::PhysicalDeviceAmigoProfilingFeaturesSEC ) == sizeof( VkPhysicalDeviceAmigoProfilingFeaturesSEC ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, - "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "PhysicalDeviceAmigoProfilingFeaturesSEC is not nothrow_move_constructible!" ); - -VULKAN_HPP_STATIC_ASSERT( sizeof( VULKAN_HPP_NAMESPACE::AmigoProfilingSubmitInfoSEC ) == sizeof( VkAmigoProfilingSubmitInfoSEC ), - "struct and wrapper have different size!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_standard_layout::value, "struct wrapper is not a standard layout!" ); -VULKAN_HPP_STATIC_ASSERT( std::is_nothrow_move_constructible::value, - "AmigoProfilingSubmitInfoSEC is not nothrow_move_constructible!" ); - -#endif diff --git a/src/video/khronos/vulkan/vulkan_structs.hpp b/src/video/khronos/vulkan/vulkan_structs.hpp deleted file mode 100644 index 3f75fafd9919e..0000000000000 --- a/src/video/khronos/vulkan/vulkan_structs.hpp +++ /dev/null @@ -1,99721 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_STRUCTS_HPP -#define VULKAN_STRUCTS_HPP - -#include // strcmp - -namespace VULKAN_HPP_NAMESPACE -{ - //=============== - //=== STRUCTS === - //=============== - - struct AabbPositionsKHR - { - using NativeType = VkAabbPositionsKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - AabbPositionsKHR( float minX_ = {}, float minY_ = {}, float minZ_ = {}, float maxX_ = {}, float maxY_ = {}, float maxZ_ = {} ) VULKAN_HPP_NOEXCEPT - : minX( minX_ ) - , minY( minY_ ) - , minZ( minZ_ ) - , maxX( maxX_ ) - , maxY( maxY_ ) - , maxZ( maxZ_ ) - { - } - - VULKAN_HPP_CONSTEXPR AabbPositionsKHR( AabbPositionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AabbPositionsKHR( VkAabbPositionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT : AabbPositionsKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AabbPositionsKHR & operator=( AabbPositionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AabbPositionsKHR & operator=( VkAabbPositionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMinX( float minX_ ) VULKAN_HPP_NOEXCEPT - { - minX = minX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMinY( float minY_ ) VULKAN_HPP_NOEXCEPT - { - minY = minY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMinZ( float minZ_ ) VULKAN_HPP_NOEXCEPT - { - minZ = minZ_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMaxX( float maxX_ ) VULKAN_HPP_NOEXCEPT - { - maxX = maxX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMaxY( float maxY_ ) VULKAN_HPP_NOEXCEPT - { - maxY = maxY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AabbPositionsKHR & setMaxZ( float maxZ_ ) VULKAN_HPP_NOEXCEPT - { - maxZ = maxZ_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAabbPositionsKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAabbPositionsKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( minX, minY, minZ, maxX, maxY, maxZ ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AabbPositionsKHR const & ) const = default; -#else - bool operator==( AabbPositionsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( minX == rhs.minX ) && ( minY == rhs.minY ) && ( minZ == rhs.minZ ) && ( maxX == rhs.maxX ) && ( maxY == rhs.maxY ) && ( maxZ == rhs.maxZ ); -# endif - } - - bool operator!=( AabbPositionsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float minX = {}; - float minY = {}; - float minZ = {}; - float maxX = {}; - float maxY = {}; - float maxZ = {}; - }; - using AabbPositionsNV = AabbPositionsKHR; - - union DeviceOrHostAddressConstKHR - { - using NativeType = VkDeviceOrHostAddressConstKHR; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressConstKHR( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {} ) : deviceAddress( deviceAddress_ ) {} - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressConstKHR( const void * hostAddress_ ) : hostAddress( hostAddress_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressConstKHR & setDeviceAddress( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - deviceAddress = deviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressConstKHR & setHostAddress( const void * hostAddress_ ) VULKAN_HPP_NOEXCEPT - { - hostAddress = hostAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkDeviceOrHostAddressConstKHR const &() const - { - return *reinterpret_cast( this ); - } - - operator VkDeviceOrHostAddressConstKHR &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress; - const void * hostAddress; -#else - VkDeviceAddress deviceAddress; - const void * hostAddress; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct AccelerationStructureGeometryTrianglesDataKHR - { - using NativeType = VkAccelerationStructureGeometryTrianglesDataKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureGeometryTrianglesDataKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureGeometryTrianglesDataKHR( VULKAN_HPP_NAMESPACE::Format vertexFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR vertexData_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize vertexStride_ = {}, - uint32_t maxVertex_ = {}, - VULKAN_HPP_NAMESPACE::IndexType indexType_ = VULKAN_HPP_NAMESPACE::IndexType::eUint16, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR indexData_ = {}, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR transformData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexFormat( vertexFormat_ ) - , vertexData( vertexData_ ) - , vertexStride( vertexStride_ ) - , maxVertex( maxVertex_ ) - , indexType( indexType_ ) - , indexData( indexData_ ) - , transformData( transformData_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureGeometryTrianglesDataKHR( AccelerationStructureGeometryTrianglesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryTrianglesDataKHR( VkAccelerationStructureGeometryTrianglesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureGeometryTrianglesDataKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureGeometryTrianglesDataKHR & operator=( AccelerationStructureGeometryTrianglesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryTrianglesDataKHR & operator=( VkAccelerationStructureGeometryTrianglesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & setVertexFormat( VULKAN_HPP_NAMESPACE::Format vertexFormat_ ) VULKAN_HPP_NOEXCEPT - { - vertexFormat = vertexFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & - setVertexData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & vertexData_ ) VULKAN_HPP_NOEXCEPT - { - vertexData = vertexData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & - setVertexStride( VULKAN_HPP_NAMESPACE::DeviceSize vertexStride_ ) VULKAN_HPP_NOEXCEPT - { - vertexStride = vertexStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & setMaxVertex( uint32_t maxVertex_ ) VULKAN_HPP_NOEXCEPT - { - maxVertex = maxVertex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & setIndexType( VULKAN_HPP_NAMESPACE::IndexType indexType_ ) VULKAN_HPP_NOEXCEPT - { - indexType = indexType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & - setIndexData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & indexData_ ) VULKAN_HPP_NOEXCEPT - { - indexData = indexData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryTrianglesDataKHR & - setTransformData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & transformData_ ) VULKAN_HPP_NOEXCEPT - { - transformData = transformData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureGeometryTrianglesDataKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryTrianglesDataKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vertexFormat, vertexData, vertexStride, maxVertex, indexType, indexData, transformData ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureGeometryTrianglesDataKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format vertexFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR vertexData = {}; - VULKAN_HPP_NAMESPACE::DeviceSize vertexStride = {}; - uint32_t maxVertex = {}; - VULKAN_HPP_NAMESPACE::IndexType indexType = VULKAN_HPP_NAMESPACE::IndexType::eUint16; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR indexData = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR transformData = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureGeometryTrianglesDataKHR; - }; - - struct AccelerationStructureGeometryAabbsDataKHR - { - using NativeType = VkAccelerationStructureGeometryAabbsDataKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureGeometryAabbsDataKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryAabbsDataKHR( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR data_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize stride_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , data( data_ ) - , stride( stride_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryAabbsDataKHR( AccelerationStructureGeometryAabbsDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryAabbsDataKHR( VkAccelerationStructureGeometryAabbsDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureGeometryAabbsDataKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureGeometryAabbsDataKHR & operator=( AccelerationStructureGeometryAabbsDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryAabbsDataKHR & operator=( VkAccelerationStructureGeometryAabbsDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryAabbsDataKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryAabbsDataKHR & - setData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & data_ ) VULKAN_HPP_NOEXCEPT - { - data = data_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryAabbsDataKHR & setStride( VULKAN_HPP_NAMESPACE::DeviceSize stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureGeometryAabbsDataKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryAabbsDataKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, data, stride ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureGeometryAabbsDataKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR data = {}; - VULKAN_HPP_NAMESPACE::DeviceSize stride = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureGeometryAabbsDataKHR; - }; - - struct AccelerationStructureGeometryInstancesDataKHR - { - using NativeType = VkAccelerationStructureGeometryInstancesDataKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureGeometryInstancesDataKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryInstancesDataKHR( VULKAN_HPP_NAMESPACE::Bool32 arrayOfPointers_ = {}, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR data_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , arrayOfPointers( arrayOfPointers_ ) - , data( data_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureGeometryInstancesDataKHR( AccelerationStructureGeometryInstancesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryInstancesDataKHR( VkAccelerationStructureGeometryInstancesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureGeometryInstancesDataKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureGeometryInstancesDataKHR & operator=( AccelerationStructureGeometryInstancesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryInstancesDataKHR & operator=( VkAccelerationStructureGeometryInstancesDataKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryInstancesDataKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryInstancesDataKHR & - setArrayOfPointers( VULKAN_HPP_NAMESPACE::Bool32 arrayOfPointers_ ) VULKAN_HPP_NOEXCEPT - { - arrayOfPointers = arrayOfPointers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryInstancesDataKHR & - setData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & data_ ) VULKAN_HPP_NOEXCEPT - { - data = data_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureGeometryInstancesDataKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryInstancesDataKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, arrayOfPointers, data ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureGeometryInstancesDataKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 arrayOfPointers = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR data = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureGeometryInstancesDataKHR; - }; - - union AccelerationStructureGeometryDataKHR - { - using NativeType = VkAccelerationStructureGeometryDataKHR; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryTrianglesDataKHR triangles_ = {} ) - : triangles( triangles_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryAabbsDataKHR aabbs_ ) : aabbs( aabbs_ ) {} - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryInstancesDataKHR instances_ ) - : instances( instances_ ) - { - } -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR & - setTriangles( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryTrianglesDataKHR const & triangles_ ) VULKAN_HPP_NOEXCEPT - { - triangles = triangles_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR & - setAabbs( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryAabbsDataKHR const & aabbs_ ) VULKAN_HPP_NOEXCEPT - { - aabbs = aabbs_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryDataKHR & - setInstances( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryInstancesDataKHR const & instances_ ) VULKAN_HPP_NOEXCEPT - { - instances = instances_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkAccelerationStructureGeometryDataKHR const &() const - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryDataKHR &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryTrianglesDataKHR triangles; - VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryAabbsDataKHR aabbs; - VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryInstancesDataKHR instances; -#else - VkAccelerationStructureGeometryTrianglesDataKHR triangles; - VkAccelerationStructureGeometryAabbsDataKHR aabbs; - VkAccelerationStructureGeometryInstancesDataKHR instances; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct AccelerationStructureGeometryKHR - { - using NativeType = VkAccelerationStructureGeometryKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureGeometryKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureGeometryKHR( VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType_ = VULKAN_HPP_NAMESPACE::GeometryTypeKHR::eTriangles, - VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryDataKHR geometry_ = {}, - VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , geometryType( geometryType_ ) - , geometry( geometry_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryKHR( AccelerationStructureGeometryKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryKHR( VkAccelerationStructureGeometryKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureGeometryKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureGeometryKHR & operator=( AccelerationStructureGeometryKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryKHR & operator=( VkAccelerationStructureGeometryKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryKHR & setGeometryType( VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType_ ) VULKAN_HPP_NOEXCEPT - { - geometryType = geometryType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryKHR & - setGeometry( VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryDataKHR const & geometry_ ) VULKAN_HPP_NOEXCEPT - { - geometry = geometry_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryKHR & setFlags( VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureGeometryKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, geometryType, geometry, flags ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureGeometryKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType = VULKAN_HPP_NAMESPACE::GeometryTypeKHR::eTriangles; - VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryDataKHR geometry = {}; - VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureGeometryKHR; - }; - - union DeviceOrHostAddressKHR - { - using NativeType = VkDeviceOrHostAddressKHR; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressKHR( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {} ) : deviceAddress( deviceAddress_ ) {} - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressKHR( void * hostAddress_ ) : hostAddress( hostAddress_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressKHR & setDeviceAddress( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - deviceAddress = deviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceOrHostAddressKHR & setHostAddress( void * hostAddress_ ) VULKAN_HPP_NOEXCEPT - { - hostAddress = hostAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkDeviceOrHostAddressKHR const &() const - { - return *reinterpret_cast( this ); - } - - operator VkDeviceOrHostAddressKHR &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress; - void * hostAddress; -#else - VkDeviceAddress deviceAddress; - void * hostAddress; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct AccelerationStructureBuildGeometryInfoKHR - { - using NativeType = VkAccelerationStructureBuildGeometryInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureBuildGeometryInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR( - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type_ = VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR::eTopLevel, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR mode_ = VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR::eBuild, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR srcAccelerationStructure_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dstAccelerationStructure_ = {}, - uint32_t geometryCount_ = {}, - const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * pGeometries_ = {}, - const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * const * ppGeometries_ = {}, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR scratchData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , flags( flags_ ) - , mode( mode_ ) - , srcAccelerationStructure( srcAccelerationStructure_ ) - , dstAccelerationStructure( dstAccelerationStructure_ ) - , geometryCount( geometryCount_ ) - , pGeometries( pGeometries_ ) - , ppGeometries( ppGeometries_ ) - , scratchData( scratchData_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR( AccelerationStructureBuildGeometryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildGeometryInfoKHR( VkAccelerationStructureBuildGeometryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureBuildGeometryInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AccelerationStructureBuildGeometryInfoKHR( - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type_, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsKHR flags_, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR mode_, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR srcAccelerationStructure_, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dstAccelerationStructure_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & geometries_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pGeometries_ = {}, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR scratchData_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , type( type_ ) - , flags( flags_ ) - , mode( mode_ ) - , srcAccelerationStructure( srcAccelerationStructure_ ) - , dstAccelerationStructure( dstAccelerationStructure_ ) - , geometryCount( static_cast( !geometries_.empty() ? geometries_.size() : pGeometries_.size() ) ) - , pGeometries( geometries_.data() ) - , ppGeometries( pGeometries_.data() ) - , scratchData( scratchData_ ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( ( !geometries_.empty() + !pGeometries_.empty() ) <= 1 ); -# else - if ( 1 < ( !geometries_.empty() + !pGeometries_.empty() ) ) - { - throw LogicError( - VULKAN_HPP_NAMESPACE_STRING - "::AccelerationStructureBuildGeometryInfoKHR::AccelerationStructureBuildGeometryInfoKHR: 1 < ( !geometries_.empty() + !pGeometries_.empty() )" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureBuildGeometryInfoKHR & operator=( AccelerationStructureBuildGeometryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildGeometryInfoKHR & operator=( VkAccelerationStructureBuildGeometryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & setType( VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setFlags( VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setMode( VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setSrcAccelerationStructure( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR srcAccelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - srcAccelerationStructure = srcAccelerationStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setDstAccelerationStructure( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dstAccelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - dstAccelerationStructure = dstAccelerationStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & setGeometryCount( uint32_t geometryCount_ ) VULKAN_HPP_NOEXCEPT - { - geometryCount = geometryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setPGeometries( const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * pGeometries_ ) VULKAN_HPP_NOEXCEPT - { - pGeometries = pGeometries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AccelerationStructureBuildGeometryInfoKHR & setGeometries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & geometries_ ) VULKAN_HPP_NOEXCEPT - { - geometryCount = static_cast( geometries_.size() ); - pGeometries = geometries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setPpGeometries( const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * const * ppGeometries_ ) VULKAN_HPP_NOEXCEPT - { - ppGeometries = ppGeometries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AccelerationStructureBuildGeometryInfoKHR & - setPGeometries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pGeometries_ ) - VULKAN_HPP_NOEXCEPT - { - geometryCount = static_cast( pGeometries_.size() ); - ppGeometries = pGeometries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildGeometryInfoKHR & - setScratchData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR const & scratchData_ ) VULKAN_HPP_NOEXCEPT - { - scratchData = scratchData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureBuildGeometryInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureBuildGeometryInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, type, flags, mode, srcAccelerationStructure, dstAccelerationStructure, geometryCount, pGeometries, ppGeometries, scratchData ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureBuildGeometryInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type = VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR::eTopLevel; - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR mode = VULKAN_HPP_NAMESPACE::BuildAccelerationStructureModeKHR::eBuild; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR srcAccelerationStructure = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dstAccelerationStructure = {}; - uint32_t geometryCount = {}; - const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * pGeometries = {}; - const VULKAN_HPP_NAMESPACE::AccelerationStructureGeometryKHR * const * ppGeometries = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR scratchData = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureBuildGeometryInfoKHR; - }; - - struct AccelerationStructureBuildRangeInfoKHR - { - using NativeType = VkAccelerationStructureBuildRangeInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureBuildRangeInfoKHR( uint32_t primitiveCount_ = {}, - uint32_t primitiveOffset_ = {}, - uint32_t firstVertex_ = {}, - uint32_t transformOffset_ = {} ) VULKAN_HPP_NOEXCEPT - : primitiveCount( primitiveCount_ ) - , primitiveOffset( primitiveOffset_ ) - , firstVertex( firstVertex_ ) - , transformOffset( transformOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureBuildRangeInfoKHR( AccelerationStructureBuildRangeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildRangeInfoKHR( VkAccelerationStructureBuildRangeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureBuildRangeInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureBuildRangeInfoKHR & operator=( AccelerationStructureBuildRangeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildRangeInfoKHR & operator=( VkAccelerationStructureBuildRangeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildRangeInfoKHR & setPrimitiveCount( uint32_t primitiveCount_ ) VULKAN_HPP_NOEXCEPT - { - primitiveCount = primitiveCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildRangeInfoKHR & setPrimitiveOffset( uint32_t primitiveOffset_ ) VULKAN_HPP_NOEXCEPT - { - primitiveOffset = primitiveOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildRangeInfoKHR & setFirstVertex( uint32_t firstVertex_ ) VULKAN_HPP_NOEXCEPT - { - firstVertex = firstVertex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildRangeInfoKHR & setTransformOffset( uint32_t transformOffset_ ) VULKAN_HPP_NOEXCEPT - { - transformOffset = transformOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureBuildRangeInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureBuildRangeInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( primitiveCount, primitiveOffset, firstVertex, transformOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureBuildRangeInfoKHR const & ) const = default; -#else - bool operator==( AccelerationStructureBuildRangeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( primitiveCount == rhs.primitiveCount ) && ( primitiveOffset == rhs.primitiveOffset ) && ( firstVertex == rhs.firstVertex ) && - ( transformOffset == rhs.transformOffset ); -# endif - } - - bool operator!=( AccelerationStructureBuildRangeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t primitiveCount = {}; - uint32_t primitiveOffset = {}; - uint32_t firstVertex = {}; - uint32_t transformOffset = {}; - }; - - struct AccelerationStructureBuildSizesInfoKHR - { - using NativeType = VkAccelerationStructureBuildSizesInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureBuildSizesInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureBuildSizesInfoKHR( VULKAN_HPP_NAMESPACE::DeviceSize accelerationStructureSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize updateScratchSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize buildScratchSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructureSize( accelerationStructureSize_ ) - , updateScratchSize( updateScratchSize_ ) - , buildScratchSize( buildScratchSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureBuildSizesInfoKHR( AccelerationStructureBuildSizesInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildSizesInfoKHR( VkAccelerationStructureBuildSizesInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureBuildSizesInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureBuildSizesInfoKHR & operator=( AccelerationStructureBuildSizesInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureBuildSizesInfoKHR & operator=( VkAccelerationStructureBuildSizesInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildSizesInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildSizesInfoKHR & - setAccelerationStructureSize( VULKAN_HPP_NAMESPACE::DeviceSize accelerationStructureSize_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureSize = accelerationStructureSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildSizesInfoKHR & - setUpdateScratchSize( VULKAN_HPP_NAMESPACE::DeviceSize updateScratchSize_ ) VULKAN_HPP_NOEXCEPT - { - updateScratchSize = updateScratchSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureBuildSizesInfoKHR & - setBuildScratchSize( VULKAN_HPP_NAMESPACE::DeviceSize buildScratchSize_ ) VULKAN_HPP_NOEXCEPT - { - buildScratchSize = buildScratchSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureBuildSizesInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureBuildSizesInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, accelerationStructureSize, updateScratchSize, buildScratchSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureBuildSizesInfoKHR const & ) const = default; -#else - bool operator==( AccelerationStructureBuildSizesInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructureSize == rhs.accelerationStructureSize ) && - ( updateScratchSize == rhs.updateScratchSize ) && ( buildScratchSize == rhs.buildScratchSize ); -# endif - } - - bool operator!=( AccelerationStructureBuildSizesInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureBuildSizesInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize accelerationStructureSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize updateScratchSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize buildScratchSize = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureBuildSizesInfoKHR; - }; - - struct AccelerationStructureCreateInfoKHR - { - using NativeType = VkAccelerationStructureCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureCreateInfoKHR( - VULKAN_HPP_NAMESPACE::AccelerationStructureCreateFlagsKHR createFlags_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type_ = VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR::eTopLevel, - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , createFlags( createFlags_ ) - , buffer( buffer_ ) - , offset( offset_ ) - , size( size_ ) - , type( type_ ) - , deviceAddress( deviceAddress_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureCreateInfoKHR( AccelerationStructureCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureCreateInfoKHR( VkAccelerationStructureCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureCreateInfoKHR & operator=( AccelerationStructureCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureCreateInfoKHR & operator=( VkAccelerationStructureCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & - setCreateFlags( VULKAN_HPP_NAMESPACE::AccelerationStructureCreateFlagsKHR createFlags_ ) VULKAN_HPP_NOEXCEPT - { - createFlags = createFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setType( VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoKHR & setDeviceAddress( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - deviceAddress = deviceAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, createFlags, buffer, offset, size, type, deviceAddress ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureCreateInfoKHR const & ) const = default; -#else - bool operator==( AccelerationStructureCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( createFlags == rhs.createFlags ) && ( buffer == rhs.buffer ) && ( offset == rhs.offset ) && - ( size == rhs.size ) && ( type == rhs.type ) && ( deviceAddress == rhs.deviceAddress ); -# endif - } - - bool operator!=( AccelerationStructureCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureCreateFlagsKHR createFlags = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR type = VULKAN_HPP_NAMESPACE::AccelerationStructureTypeKHR::eTopLevel; - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureCreateInfoKHR; - }; - - struct GeometryTrianglesNV - { - using NativeType = VkGeometryTrianglesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGeometryTrianglesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GeometryTrianglesNV( VULKAN_HPP_NAMESPACE::Buffer vertexData_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize vertexOffset_ = {}, - uint32_t vertexCount_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize vertexStride_ = {}, - VULKAN_HPP_NAMESPACE::Format vertexFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Buffer indexData_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize indexOffset_ = {}, - uint32_t indexCount_ = {}, - VULKAN_HPP_NAMESPACE::IndexType indexType_ = VULKAN_HPP_NAMESPACE::IndexType::eUint16, - VULKAN_HPP_NAMESPACE::Buffer transformData_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize transformOffset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexData( vertexData_ ) - , vertexOffset( vertexOffset_ ) - , vertexCount( vertexCount_ ) - , vertexStride( vertexStride_ ) - , vertexFormat( vertexFormat_ ) - , indexData( indexData_ ) - , indexOffset( indexOffset_ ) - , indexCount( indexCount_ ) - , indexType( indexType_ ) - , transformData( transformData_ ) - , transformOffset( transformOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeometryTrianglesNV( GeometryTrianglesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryTrianglesNV( VkGeometryTrianglesNV const & rhs ) VULKAN_HPP_NOEXCEPT : GeometryTrianglesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeometryTrianglesNV & operator=( GeometryTrianglesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryTrianglesNV & operator=( VkGeometryTrianglesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setVertexData( VULKAN_HPP_NAMESPACE::Buffer vertexData_ ) VULKAN_HPP_NOEXCEPT - { - vertexData = vertexData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setVertexOffset( VULKAN_HPP_NAMESPACE::DeviceSize vertexOffset_ ) VULKAN_HPP_NOEXCEPT - { - vertexOffset = vertexOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setVertexCount( uint32_t vertexCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexCount = vertexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setVertexStride( VULKAN_HPP_NAMESPACE::DeviceSize vertexStride_ ) VULKAN_HPP_NOEXCEPT - { - vertexStride = vertexStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setVertexFormat( VULKAN_HPP_NAMESPACE::Format vertexFormat_ ) VULKAN_HPP_NOEXCEPT - { - vertexFormat = vertexFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setIndexData( VULKAN_HPP_NAMESPACE::Buffer indexData_ ) VULKAN_HPP_NOEXCEPT - { - indexData = indexData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setIndexOffset( VULKAN_HPP_NAMESPACE::DeviceSize indexOffset_ ) VULKAN_HPP_NOEXCEPT - { - indexOffset = indexOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setIndexCount( uint32_t indexCount_ ) VULKAN_HPP_NOEXCEPT - { - indexCount = indexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setIndexType( VULKAN_HPP_NAMESPACE::IndexType indexType_ ) VULKAN_HPP_NOEXCEPT - { - indexType = indexType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setTransformData( VULKAN_HPP_NAMESPACE::Buffer transformData_ ) VULKAN_HPP_NOEXCEPT - { - transformData = transformData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryTrianglesNV & setTransformOffset( VULKAN_HPP_NAMESPACE::DeviceSize transformOffset_ ) VULKAN_HPP_NOEXCEPT - { - transformOffset = transformOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeometryTrianglesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeometryTrianglesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - vertexData, - vertexOffset, - vertexCount, - vertexStride, - vertexFormat, - indexData, - indexOffset, - indexCount, - indexType, - transformData, - transformOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeometryTrianglesNV const & ) const = default; -#else - bool operator==( GeometryTrianglesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vertexData == rhs.vertexData ) && ( vertexOffset == rhs.vertexOffset ) && - ( vertexCount == rhs.vertexCount ) && ( vertexStride == rhs.vertexStride ) && ( vertexFormat == rhs.vertexFormat ) && - ( indexData == rhs.indexData ) && ( indexOffset == rhs.indexOffset ) && ( indexCount == rhs.indexCount ) && ( indexType == rhs.indexType ) && - ( transformData == rhs.transformData ) && ( transformOffset == rhs.transformOffset ); -# endif - } - - bool operator!=( GeometryTrianglesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGeometryTrianglesNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer vertexData = {}; - VULKAN_HPP_NAMESPACE::DeviceSize vertexOffset = {}; - uint32_t vertexCount = {}; - VULKAN_HPP_NAMESPACE::DeviceSize vertexStride = {}; - VULKAN_HPP_NAMESPACE::Format vertexFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::Buffer indexData = {}; - VULKAN_HPP_NAMESPACE::DeviceSize indexOffset = {}; - uint32_t indexCount = {}; - VULKAN_HPP_NAMESPACE::IndexType indexType = VULKAN_HPP_NAMESPACE::IndexType::eUint16; - VULKAN_HPP_NAMESPACE::Buffer transformData = {}; - VULKAN_HPP_NAMESPACE::DeviceSize transformOffset = {}; - }; - - template <> - struct CppType - { - using Type = GeometryTrianglesNV; - }; - - struct GeometryAABBNV - { - using NativeType = VkGeometryAABBNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGeometryAabbNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GeometryAABBNV( VULKAN_HPP_NAMESPACE::Buffer aabbData_ = {}, - uint32_t numAABBs_ = {}, - uint32_t stride_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , aabbData( aabbData_ ) - , numAABBs( numAABBs_ ) - , stride( stride_ ) - , offset( offset_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeometryAABBNV( GeometryAABBNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryAABBNV( VkGeometryAABBNV const & rhs ) VULKAN_HPP_NOEXCEPT : GeometryAABBNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeometryAABBNV & operator=( GeometryAABBNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryAABBNV & operator=( VkGeometryAABBNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeometryAABBNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryAABBNV & setAabbData( VULKAN_HPP_NAMESPACE::Buffer aabbData_ ) VULKAN_HPP_NOEXCEPT - { - aabbData = aabbData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryAABBNV & setNumAABBs( uint32_t numAABBs_ ) VULKAN_HPP_NOEXCEPT - { - numAABBs = numAABBs_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryAABBNV & setStride( uint32_t stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryAABBNV & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeometryAABBNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeometryAABBNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, aabbData, numAABBs, stride, offset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeometryAABBNV const & ) const = default; -#else - bool operator==( GeometryAABBNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( aabbData == rhs.aabbData ) && ( numAABBs == rhs.numAABBs ) && ( stride == rhs.stride ) && - ( offset == rhs.offset ); -# endif - } - - bool operator!=( GeometryAABBNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGeometryAabbNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer aabbData = {}; - uint32_t numAABBs = {}; - uint32_t stride = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - }; - - template <> - struct CppType - { - using Type = GeometryAABBNV; - }; - - struct GeometryDataNV - { - using NativeType = VkGeometryDataNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GeometryDataNV( VULKAN_HPP_NAMESPACE::GeometryTrianglesNV triangles_ = {}, - VULKAN_HPP_NAMESPACE::GeometryAABBNV aabbs_ = {} ) VULKAN_HPP_NOEXCEPT - : triangles( triangles_ ) - , aabbs( aabbs_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeometryDataNV( GeometryDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryDataNV( VkGeometryDataNV const & rhs ) VULKAN_HPP_NOEXCEPT : GeometryDataNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeometryDataNV & operator=( GeometryDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryDataNV & operator=( VkGeometryDataNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeometryDataNV & setTriangles( VULKAN_HPP_NAMESPACE::GeometryTrianglesNV const & triangles_ ) VULKAN_HPP_NOEXCEPT - { - triangles = triangles_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryDataNV & setAabbs( VULKAN_HPP_NAMESPACE::GeometryAABBNV const & aabbs_ ) VULKAN_HPP_NOEXCEPT - { - aabbs = aabbs_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeometryDataNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeometryDataNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( triangles, aabbs ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeometryDataNV const & ) const = default; -#else - bool operator==( GeometryDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( triangles == rhs.triangles ) && ( aabbs == rhs.aabbs ); -# endif - } - - bool operator!=( GeometryDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::GeometryTrianglesNV triangles = {}; - VULKAN_HPP_NAMESPACE::GeometryAABBNV aabbs = {}; - }; - - struct GeometryNV - { - using NativeType = VkGeometryNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGeometryNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GeometryNV( VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType_ = VULKAN_HPP_NAMESPACE::GeometryTypeKHR::eTriangles, - VULKAN_HPP_NAMESPACE::GeometryDataNV geometry_ = {}, - VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , geometryType( geometryType_ ) - , geometry( geometry_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeometryNV( GeometryNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryNV( VkGeometryNV const & rhs ) VULKAN_HPP_NOEXCEPT : GeometryNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeometryNV & operator=( GeometryNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeometryNV & operator=( VkGeometryNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeometryNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryNV & setGeometryType( VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType_ ) VULKAN_HPP_NOEXCEPT - { - geometryType = geometryType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryNV & setGeometry( VULKAN_HPP_NAMESPACE::GeometryDataNV const & geometry_ ) VULKAN_HPP_NOEXCEPT - { - geometry = geometry_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeometryNV & setFlags( VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeometryNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeometryNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, geometryType, geometry, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeometryNV const & ) const = default; -#else - bool operator==( GeometryNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( geometryType == rhs.geometryType ) && ( geometry == rhs.geometry ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( GeometryNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGeometryNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::GeometryTypeKHR geometryType = VULKAN_HPP_NAMESPACE::GeometryTypeKHR::eTriangles; - VULKAN_HPP_NAMESPACE::GeometryDataNV geometry = {}; - VULKAN_HPP_NAMESPACE::GeometryFlagsKHR flags = {}; - }; - - template <> - struct CppType - { - using Type = GeometryNV; - }; - - struct AccelerationStructureInfoNV - { - using NativeType = VkAccelerationStructureInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureInfoNV( VULKAN_HPP_NAMESPACE::AccelerationStructureTypeNV type_ = {}, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsNV flags_ = {}, - uint32_t instanceCount_ = {}, - uint32_t geometryCount_ = {}, - const VULKAN_HPP_NAMESPACE::GeometryNV * pGeometries_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , flags( flags_ ) - , instanceCount( instanceCount_ ) - , geometryCount( geometryCount_ ) - , pGeometries( pGeometries_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureInfoNV( AccelerationStructureInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureInfoNV( VkAccelerationStructureInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AccelerationStructureInfoNV( VULKAN_HPP_NAMESPACE::AccelerationStructureTypeNV type_, - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsNV flags_, - uint32_t instanceCount_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & geometries_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , type( type_ ) - , flags( flags_ ) - , instanceCount( instanceCount_ ) - , geometryCount( static_cast( geometries_.size() ) ) - , pGeometries( geometries_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureInfoNV & operator=( AccelerationStructureInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureInfoNV & operator=( VkAccelerationStructureInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setType( VULKAN_HPP_NAMESPACE::AccelerationStructureTypeNV type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setFlags( VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setInstanceCount( uint32_t instanceCount_ ) VULKAN_HPP_NOEXCEPT - { - instanceCount = instanceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setGeometryCount( uint32_t geometryCount_ ) VULKAN_HPP_NOEXCEPT - { - geometryCount = geometryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInfoNV & setPGeometries( const VULKAN_HPP_NAMESPACE::GeometryNV * pGeometries_ ) VULKAN_HPP_NOEXCEPT - { - pGeometries = pGeometries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AccelerationStructureInfoNV & - setGeometries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & geometries_ ) VULKAN_HPP_NOEXCEPT - { - geometryCount = static_cast( geometries_.size() ); - pGeometries = geometries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type, flags, instanceCount, geometryCount, pGeometries ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureInfoNV const & ) const = default; -#else - bool operator==( AccelerationStructureInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ) && ( flags == rhs.flags ) && ( instanceCount == rhs.instanceCount ) && - ( geometryCount == rhs.geometryCount ) && ( pGeometries == rhs.pGeometries ); -# endif - } - - bool operator!=( AccelerationStructureInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureTypeNV type = {}; - VULKAN_HPP_NAMESPACE::BuildAccelerationStructureFlagsNV flags = {}; - uint32_t instanceCount = {}; - uint32_t geometryCount = {}; - const VULKAN_HPP_NAMESPACE::GeometryNV * pGeometries = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureInfoNV; - }; - - struct AccelerationStructureCreateInfoNV - { - using NativeType = VkAccelerationStructureCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureCreateInfoNV( VULKAN_HPP_NAMESPACE::DeviceSize compactedSize_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV info_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , compactedSize( compactedSize_ ) - , info( info_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureCreateInfoNV( AccelerationStructureCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureCreateInfoNV( VkAccelerationStructureCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureCreateInfoNV & operator=( AccelerationStructureCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureCreateInfoNV & operator=( VkAccelerationStructureCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoNV & setCompactedSize( VULKAN_HPP_NAMESPACE::DeviceSize compactedSize_ ) VULKAN_HPP_NOEXCEPT - { - compactedSize = compactedSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureCreateInfoNV & setInfo( VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV const & info_ ) VULKAN_HPP_NOEXCEPT - { - info = info_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, compactedSize, info ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureCreateInfoNV const & ) const = default; -#else - bool operator==( AccelerationStructureCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( compactedSize == rhs.compactedSize ) && ( info == rhs.info ); -# endif - } - - bool operator!=( AccelerationStructureCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize compactedSize = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureInfoNV info = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureCreateInfoNV; - }; - - struct AccelerationStructureDeviceAddressInfoKHR - { - using NativeType = VkAccelerationStructureDeviceAddressInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureDeviceAddressInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureDeviceAddressInfoKHR( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructure( accelerationStructure_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureDeviceAddressInfoKHR( AccelerationStructureDeviceAddressInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureDeviceAddressInfoKHR( VkAccelerationStructureDeviceAddressInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureDeviceAddressInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureDeviceAddressInfoKHR & operator=( AccelerationStructureDeviceAddressInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureDeviceAddressInfoKHR & operator=( VkAccelerationStructureDeviceAddressInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureDeviceAddressInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureDeviceAddressInfoKHR & - setAccelerationStructure( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructure = accelerationStructure_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureDeviceAddressInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureDeviceAddressInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, accelerationStructure ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureDeviceAddressInfoKHR const & ) const = default; -#else - bool operator==( AccelerationStructureDeviceAddressInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructure == rhs.accelerationStructure ); -# endif - } - - bool operator!=( AccelerationStructureDeviceAddressInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureDeviceAddressInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR accelerationStructure = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureDeviceAddressInfoKHR; - }; - - struct AccelerationStructureGeometryMotionTrianglesDataNV - { - using NativeType = VkAccelerationStructureGeometryMotionTrianglesDataNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureGeometryMotionTrianglesDataNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryMotionTrianglesDataNV( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR vertexData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexData( vertexData_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureGeometryMotionTrianglesDataNV( AccelerationStructureGeometryMotionTrianglesDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryMotionTrianglesDataNV( VkAccelerationStructureGeometryMotionTrianglesDataNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureGeometryMotionTrianglesDataNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureGeometryMotionTrianglesDataNV & - operator=( AccelerationStructureGeometryMotionTrianglesDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureGeometryMotionTrianglesDataNV & operator=( VkAccelerationStructureGeometryMotionTrianglesDataNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryMotionTrianglesDataNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureGeometryMotionTrianglesDataNV & - setVertexData( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & vertexData_ ) VULKAN_HPP_NOEXCEPT - { - vertexData = vertexData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureGeometryMotionTrianglesDataNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureGeometryMotionTrianglesDataNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vertexData ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureGeometryMotionTrianglesDataNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR vertexData = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureGeometryMotionTrianglesDataNV; - }; - - struct TransformMatrixKHR - { - using NativeType = VkTransformMatrixKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 TransformMatrixKHR( std::array, 3> const & matrix_ = {} ) VULKAN_HPP_NOEXCEPT : matrix( matrix_ ) {} - - VULKAN_HPP_CONSTEXPR_14 TransformMatrixKHR( TransformMatrixKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TransformMatrixKHR( VkTransformMatrixKHR const & rhs ) VULKAN_HPP_NOEXCEPT : TransformMatrixKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TransformMatrixKHR & operator=( TransformMatrixKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TransformMatrixKHR & operator=( VkTransformMatrixKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 TransformMatrixKHR & setMatrix( std::array, 3> matrix_ ) VULKAN_HPP_NOEXCEPT - { - matrix = matrix_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkTransformMatrixKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTransformMatrixKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( matrix ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TransformMatrixKHR const & ) const = default; -#else - bool operator==( TransformMatrixKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( matrix == rhs.matrix ); -# endif - } - - bool operator!=( TransformMatrixKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ArrayWrapper2D matrix = {}; - }; - using TransformMatrixNV = TransformMatrixKHR; - - struct AccelerationStructureInstanceKHR - { - using NativeType = VkAccelerationStructureInstanceKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR( VULKAN_HPP_NAMESPACE::TransformMatrixKHR transform_ = {}, - uint32_t instanceCustomIndex_ = {}, - uint32_t mask_ = {}, - uint32_t instanceShaderBindingTableRecordOffset_ = {}, - VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ = {}, - uint64_t accelerationStructureReference_ = {} ) VULKAN_HPP_NOEXCEPT - : transform( transform_ ) - , instanceCustomIndex( instanceCustomIndex_ ) - , mask( mask_ ) - , instanceShaderBindingTableRecordOffset( instanceShaderBindingTableRecordOffset_ ) - , flags( flags_ ) - , accelerationStructureReference( accelerationStructureReference_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR( AccelerationStructureInstanceKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureInstanceKHR( VkAccelerationStructureInstanceKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureInstanceKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureInstanceKHR & operator=( AccelerationStructureInstanceKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureInstanceKHR & operator=( VkAccelerationStructureInstanceKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR & setTransform( VULKAN_HPP_NAMESPACE::TransformMatrixKHR const & transform_ ) VULKAN_HPP_NOEXCEPT - { - transform = transform_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR & setInstanceCustomIndex( uint32_t instanceCustomIndex_ ) VULKAN_HPP_NOEXCEPT - { - instanceCustomIndex = instanceCustomIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR & setMask( uint32_t mask_ ) VULKAN_HPP_NOEXCEPT - { - mask = mask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR & - setInstanceShaderBindingTableRecordOffset( uint32_t instanceShaderBindingTableRecordOffset_ ) VULKAN_HPP_NOEXCEPT - { - instanceShaderBindingTableRecordOffset = instanceShaderBindingTableRecordOffset_; - return *this; - } - - AccelerationStructureInstanceKHR & setFlags( VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = *reinterpret_cast( &flags_ ); - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureInstanceKHR & setAccelerationStructureReference( uint64_t accelerationStructureReference_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureReference = accelerationStructureReference_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureInstanceKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureInstanceKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( transform, instanceCustomIndex, mask, instanceShaderBindingTableRecordOffset, flags, accelerationStructureReference ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureInstanceKHR const & ) const = default; -#else - bool operator==( AccelerationStructureInstanceKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( transform == rhs.transform ) && ( instanceCustomIndex == rhs.instanceCustomIndex ) && ( mask == rhs.mask ) && - ( instanceShaderBindingTableRecordOffset == rhs.instanceShaderBindingTableRecordOffset ) && ( flags == rhs.flags ) && - ( accelerationStructureReference == rhs.accelerationStructureReference ); -# endif - } - - bool operator!=( AccelerationStructureInstanceKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::TransformMatrixKHR transform = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; - uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; - uint64_t accelerationStructureReference = {}; - }; - using AccelerationStructureInstanceNV = AccelerationStructureInstanceKHR; - - struct AccelerationStructureMatrixMotionInstanceNV - { - using NativeType = VkAccelerationStructureMatrixMotionInstanceNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV( VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT0_ = {}, - VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT1_ = {}, - uint32_t instanceCustomIndex_ = {}, - uint32_t mask_ = {}, - uint32_t instanceShaderBindingTableRecordOffset_ = {}, - VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ = {}, - uint64_t accelerationStructureReference_ = {} ) VULKAN_HPP_NOEXCEPT - : transformT0( transformT0_ ) - , transformT1( transformT1_ ) - , instanceCustomIndex( instanceCustomIndex_ ) - , mask( mask_ ) - , instanceShaderBindingTableRecordOffset( instanceShaderBindingTableRecordOffset_ ) - , flags( flags_ ) - , accelerationStructureReference( accelerationStructureReference_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - AccelerationStructureMatrixMotionInstanceNV( AccelerationStructureMatrixMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMatrixMotionInstanceNV( VkAccelerationStructureMatrixMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureMatrixMotionInstanceNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureMatrixMotionInstanceNV & operator=( AccelerationStructureMatrixMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMatrixMotionInstanceNV & operator=( VkAccelerationStructureMatrixMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & - setTransformT0( VULKAN_HPP_NAMESPACE::TransformMatrixKHR const & transformT0_ ) VULKAN_HPP_NOEXCEPT - { - transformT0 = transformT0_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & - setTransformT1( VULKAN_HPP_NAMESPACE::TransformMatrixKHR const & transformT1_ ) VULKAN_HPP_NOEXCEPT - { - transformT1 = transformT1_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & setInstanceCustomIndex( uint32_t instanceCustomIndex_ ) VULKAN_HPP_NOEXCEPT - { - instanceCustomIndex = instanceCustomIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & setMask( uint32_t mask_ ) VULKAN_HPP_NOEXCEPT - { - mask = mask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & - setInstanceShaderBindingTableRecordOffset( uint32_t instanceShaderBindingTableRecordOffset_ ) VULKAN_HPP_NOEXCEPT - { - instanceShaderBindingTableRecordOffset = instanceShaderBindingTableRecordOffset_; - return *this; - } - - AccelerationStructureMatrixMotionInstanceNV & setFlags( VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = *reinterpret_cast( &flags_ ); - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMatrixMotionInstanceNV & - setAccelerationStructureReference( uint64_t accelerationStructureReference_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureReference = accelerationStructureReference_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureMatrixMotionInstanceNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureMatrixMotionInstanceNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( transformT0, transformT1, instanceCustomIndex, mask, instanceShaderBindingTableRecordOffset, flags, accelerationStructureReference ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureMatrixMotionInstanceNV const & ) const = default; -#else - bool operator==( AccelerationStructureMatrixMotionInstanceNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( transformT0 == rhs.transformT0 ) && ( transformT1 == rhs.transformT1 ) && ( instanceCustomIndex == rhs.instanceCustomIndex ) && - ( mask == rhs.mask ) && ( instanceShaderBindingTableRecordOffset == rhs.instanceShaderBindingTableRecordOffset ) && ( flags == rhs.flags ) && - ( accelerationStructureReference == rhs.accelerationStructureReference ); -# endif - } - - bool operator!=( AccelerationStructureMatrixMotionInstanceNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT0 = {}; - VULKAN_HPP_NAMESPACE::TransformMatrixKHR transformT1 = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; - uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; - uint64_t accelerationStructureReference = {}; - }; - - struct AccelerationStructureMemoryRequirementsInfoNV - { - using NativeType = VkAccelerationStructureMemoryRequirementsInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureMemoryRequirementsInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureMemoryRequirementsInfoNV( - VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsTypeNV type_ = VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsTypeNV::eObject, - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , accelerationStructure( accelerationStructure_ ) - { - } - - VULKAN_HPP_CONSTEXPR - AccelerationStructureMemoryRequirementsInfoNV( AccelerationStructureMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMemoryRequirementsInfoNV( VkAccelerationStructureMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureMemoryRequirementsInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureMemoryRequirementsInfoNV & operator=( AccelerationStructureMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMemoryRequirementsInfoNV & operator=( VkAccelerationStructureMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMemoryRequirementsInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMemoryRequirementsInfoNV & - setType( VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsTypeNV type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMemoryRequirementsInfoNV & - setAccelerationStructure( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructure = accelerationStructure_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureMemoryRequirementsInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureMemoryRequirementsInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type, accelerationStructure ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureMemoryRequirementsInfoNV const & ) const = default; -#else - bool operator==( AccelerationStructureMemoryRequirementsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ) && ( accelerationStructure == rhs.accelerationStructure ); -# endif - } - - bool operator!=( AccelerationStructureMemoryRequirementsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureMemoryRequirementsInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsTypeNV type = VULKAN_HPP_NAMESPACE::AccelerationStructureMemoryRequirementsTypeNV::eObject; - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureMemoryRequirementsInfoNV; - }; - - struct AccelerationStructureMotionInfoNV - { - using NativeType = VkAccelerationStructureMotionInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureMotionInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureMotionInfoNV( uint32_t maxInstances_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInfoFlagsNV flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxInstances( maxInstances_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureMotionInfoNV( AccelerationStructureMotionInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMotionInfoNV( VkAccelerationStructureMotionInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureMotionInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureMotionInfoNV & operator=( AccelerationStructureMotionInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMotionInfoNV & operator=( VkAccelerationStructureMotionInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInfoNV & setMaxInstances( uint32_t maxInstances_ ) VULKAN_HPP_NOEXCEPT - { - maxInstances = maxInstances_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInfoNV & - setFlags( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInfoFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureMotionInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureMotionInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxInstances, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureMotionInfoNV const & ) const = default; -#else - bool operator==( AccelerationStructureMotionInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxInstances == rhs.maxInstances ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( AccelerationStructureMotionInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureMotionInfoNV; - const void * pNext = {}; - uint32_t maxInstances = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInfoFlagsNV flags = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureMotionInfoNV; - }; - - struct SRTDataNV - { - using NativeType = VkSRTDataNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SRTDataNV( float sx_ = {}, - float a_ = {}, - float b_ = {}, - float pvx_ = {}, - float sy_ = {}, - float c_ = {}, - float pvy_ = {}, - float sz_ = {}, - float pvz_ = {}, - float qx_ = {}, - float qy_ = {}, - float qz_ = {}, - float qw_ = {}, - float tx_ = {}, - float ty_ = {}, - float tz_ = {} ) VULKAN_HPP_NOEXCEPT - : sx( sx_ ) - , a( a_ ) - , b( b_ ) - , pvx( pvx_ ) - , sy( sy_ ) - , c( c_ ) - , pvy( pvy_ ) - , sz( sz_ ) - , pvz( pvz_ ) - , qx( qx_ ) - , qy( qy_ ) - , qz( qz_ ) - , qw( qw_ ) - , tx( tx_ ) - , ty( ty_ ) - , tz( tz_ ) - { - } - - VULKAN_HPP_CONSTEXPR SRTDataNV( SRTDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SRTDataNV( VkSRTDataNV const & rhs ) VULKAN_HPP_NOEXCEPT : SRTDataNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SRTDataNV & operator=( SRTDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SRTDataNV & operator=( VkSRTDataNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setSx( float sx_ ) VULKAN_HPP_NOEXCEPT - { - sx = sx_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setA( float a_ ) VULKAN_HPP_NOEXCEPT - { - a = a_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setB( float b_ ) VULKAN_HPP_NOEXCEPT - { - b = b_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setPvx( float pvx_ ) VULKAN_HPP_NOEXCEPT - { - pvx = pvx_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setSy( float sy_ ) VULKAN_HPP_NOEXCEPT - { - sy = sy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setC( float c_ ) VULKAN_HPP_NOEXCEPT - { - c = c_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setPvy( float pvy_ ) VULKAN_HPP_NOEXCEPT - { - pvy = pvy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setSz( float sz_ ) VULKAN_HPP_NOEXCEPT - { - sz = sz_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setPvz( float pvz_ ) VULKAN_HPP_NOEXCEPT - { - pvz = pvz_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setQx( float qx_ ) VULKAN_HPP_NOEXCEPT - { - qx = qx_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setQy( float qy_ ) VULKAN_HPP_NOEXCEPT - { - qy = qy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setQz( float qz_ ) VULKAN_HPP_NOEXCEPT - { - qz = qz_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setQw( float qw_ ) VULKAN_HPP_NOEXCEPT - { - qw = qw_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setTx( float tx_ ) VULKAN_HPP_NOEXCEPT - { - tx = tx_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setTy( float ty_ ) VULKAN_HPP_NOEXCEPT - { - ty = ty_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SRTDataNV & setTz( float tz_ ) VULKAN_HPP_NOEXCEPT - { - tz = tz_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSRTDataNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSRTDataNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sx, a, b, pvx, sy, c, pvy, sz, pvz, qx, qy, qz, qw, tx, ty, tz ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SRTDataNV const & ) const = default; -#else - bool operator==( SRTDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sx == rhs.sx ) && ( a == rhs.a ) && ( b == rhs.b ) && ( pvx == rhs.pvx ) && ( sy == rhs.sy ) && ( c == rhs.c ) && ( pvy == rhs.pvy ) && - ( sz == rhs.sz ) && ( pvz == rhs.pvz ) && ( qx == rhs.qx ) && ( qy == rhs.qy ) && ( qz == rhs.qz ) && ( qw == rhs.qw ) && ( tx == rhs.tx ) && - ( ty == rhs.ty ) && ( tz == rhs.tz ); -# endif - } - - bool operator!=( SRTDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float sx = {}; - float a = {}; - float b = {}; - float pvx = {}; - float sy = {}; - float c = {}; - float pvy = {}; - float sz = {}; - float pvz = {}; - float qx = {}; - float qy = {}; - float qz = {}; - float qw = {}; - float tx = {}; - float ty = {}; - float tz = {}; - }; - - struct AccelerationStructureSRTMotionInstanceNV - { - using NativeType = VkAccelerationStructureSRTMotionInstanceNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureSRTMotionInstanceNV( VULKAN_HPP_NAMESPACE::SRTDataNV transformT0_ = {}, - VULKAN_HPP_NAMESPACE::SRTDataNV transformT1_ = {}, - uint32_t instanceCustomIndex_ = {}, - uint32_t mask_ = {}, - uint32_t instanceShaderBindingTableRecordOffset_ = {}, - VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ = {}, - uint64_t accelerationStructureReference_ = {} ) VULKAN_HPP_NOEXCEPT - : transformT0( transformT0_ ) - , transformT1( transformT1_ ) - , instanceCustomIndex( instanceCustomIndex_ ) - , mask( mask_ ) - , instanceShaderBindingTableRecordOffset( instanceShaderBindingTableRecordOffset_ ) - , flags( flags_ ) - , accelerationStructureReference( accelerationStructureReference_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureSRTMotionInstanceNV( AccelerationStructureSRTMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureSRTMotionInstanceNV( VkAccelerationStructureSRTMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureSRTMotionInstanceNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureSRTMotionInstanceNV & operator=( AccelerationStructureSRTMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureSRTMotionInstanceNV & operator=( VkAccelerationStructureSRTMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & - setTransformT0( VULKAN_HPP_NAMESPACE::SRTDataNV const & transformT0_ ) VULKAN_HPP_NOEXCEPT - { - transformT0 = transformT0_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & - setTransformT1( VULKAN_HPP_NAMESPACE::SRTDataNV const & transformT1_ ) VULKAN_HPP_NOEXCEPT - { - transformT1 = transformT1_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & setInstanceCustomIndex( uint32_t instanceCustomIndex_ ) VULKAN_HPP_NOEXCEPT - { - instanceCustomIndex = instanceCustomIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & setMask( uint32_t mask_ ) VULKAN_HPP_NOEXCEPT - { - mask = mask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & - setInstanceShaderBindingTableRecordOffset( uint32_t instanceShaderBindingTableRecordOffset_ ) VULKAN_HPP_NOEXCEPT - { - instanceShaderBindingTableRecordOffset = instanceShaderBindingTableRecordOffset_; - return *this; - } - - AccelerationStructureSRTMotionInstanceNV & setFlags( VULKAN_HPP_NAMESPACE::GeometryInstanceFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = *reinterpret_cast( &flags_ ); - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureSRTMotionInstanceNV & - setAccelerationStructureReference( uint64_t accelerationStructureReference_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureReference = accelerationStructureReference_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureSRTMotionInstanceNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureSRTMotionInstanceNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( transformT0, transformT1, instanceCustomIndex, mask, instanceShaderBindingTableRecordOffset, flags, accelerationStructureReference ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureSRTMotionInstanceNV const & ) const = default; -#else - bool operator==( AccelerationStructureSRTMotionInstanceNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( transformT0 == rhs.transformT0 ) && ( transformT1 == rhs.transformT1 ) && ( instanceCustomIndex == rhs.instanceCustomIndex ) && - ( mask == rhs.mask ) && ( instanceShaderBindingTableRecordOffset == rhs.instanceShaderBindingTableRecordOffset ) && ( flags == rhs.flags ) && - ( accelerationStructureReference == rhs.accelerationStructureReference ); -# endif - } - - bool operator!=( AccelerationStructureSRTMotionInstanceNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::SRTDataNV transformT0 = {}; - VULKAN_HPP_NAMESPACE::SRTDataNV transformT1 = {}; - uint32_t instanceCustomIndex : 24; - uint32_t mask : 8; - uint32_t instanceShaderBindingTableRecordOffset : 24; - VkGeometryInstanceFlagsKHR flags : 8; - uint64_t accelerationStructureReference = {}; - }; - - union AccelerationStructureMotionInstanceDataNV - { - using NativeType = VkAccelerationStructureMotionInstanceDataNV; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV( VULKAN_HPP_NAMESPACE::AccelerationStructureInstanceKHR staticInstance_ = {} ) - : staticInstance( staticInstance_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV( VULKAN_HPP_NAMESPACE::AccelerationStructureMatrixMotionInstanceNV matrixMotionInstance_ ) - : matrixMotionInstance( matrixMotionInstance_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV( VULKAN_HPP_NAMESPACE::AccelerationStructureSRTMotionInstanceNV srtMotionInstance_ ) - : srtMotionInstance( srtMotionInstance_ ) - { - } -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV & - setStaticInstance( VULKAN_HPP_NAMESPACE::AccelerationStructureInstanceKHR const & staticInstance_ ) VULKAN_HPP_NOEXCEPT - { - staticInstance = staticInstance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV & - setMatrixMotionInstance( VULKAN_HPP_NAMESPACE::AccelerationStructureMatrixMotionInstanceNV const & matrixMotionInstance_ ) VULKAN_HPP_NOEXCEPT - { - matrixMotionInstance = matrixMotionInstance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceDataNV & - setSrtMotionInstance( VULKAN_HPP_NAMESPACE::AccelerationStructureSRTMotionInstanceNV const & srtMotionInstance_ ) VULKAN_HPP_NOEXCEPT - { - srtMotionInstance = srtMotionInstance_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkAccelerationStructureMotionInstanceDataNV const &() const - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureMotionInstanceDataNV &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::AccelerationStructureInstanceKHR staticInstance; - VULKAN_HPP_NAMESPACE::AccelerationStructureMatrixMotionInstanceNV matrixMotionInstance; - VULKAN_HPP_NAMESPACE::AccelerationStructureSRTMotionInstanceNV srtMotionInstance; -#else - VkAccelerationStructureInstanceKHR staticInstance; - VkAccelerationStructureMatrixMotionInstanceNV matrixMotionInstance; - VkAccelerationStructureSRTMotionInstanceNV srtMotionInstance; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct AccelerationStructureMotionInstanceNV - { - using NativeType = VkAccelerationStructureMotionInstanceNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceNV( - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceTypeNV type_ = VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceTypeNV::eStatic, - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceFlagsNV flags_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceDataNV data_ = {} ) VULKAN_HPP_NOEXCEPT - : type( type_ ) - , flags( flags_ ) - , data( data_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceNV( AccelerationStructureMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMotionInstanceNV( VkAccelerationStructureMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureMotionInstanceNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureMotionInstanceNV & operator=( AccelerationStructureMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureMotionInstanceNV & operator=( VkAccelerationStructureMotionInstanceNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceNV & - setType( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceTypeNV type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceNV & - setFlags( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureMotionInstanceNV & - setData( VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceDataNV const & data_ ) VULKAN_HPP_NOEXCEPT - { - data = data_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureMotionInstanceNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureMotionInstanceNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( type, flags, data ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceTypeNV type = VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceTypeNV::eStatic; - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceFlagsNV flags = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureMotionInstanceDataNV data = {}; - }; - - struct AccelerationStructureVersionInfoKHR - { - using NativeType = VkAccelerationStructureVersionInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAccelerationStructureVersionInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AccelerationStructureVersionInfoKHR( const uint8_t * pVersionData_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pVersionData( pVersionData_ ) - { - } - - VULKAN_HPP_CONSTEXPR AccelerationStructureVersionInfoKHR( AccelerationStructureVersionInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureVersionInfoKHR( VkAccelerationStructureVersionInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AccelerationStructureVersionInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AccelerationStructureVersionInfoKHR & operator=( AccelerationStructureVersionInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AccelerationStructureVersionInfoKHR & operator=( VkAccelerationStructureVersionInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureVersionInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AccelerationStructureVersionInfoKHR & setPVersionData( const uint8_t * pVersionData_ ) VULKAN_HPP_NOEXCEPT - { - pVersionData = pVersionData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAccelerationStructureVersionInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAccelerationStructureVersionInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pVersionData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AccelerationStructureVersionInfoKHR const & ) const = default; -#else - bool operator==( AccelerationStructureVersionInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pVersionData == rhs.pVersionData ); -# endif - } - - bool operator!=( AccelerationStructureVersionInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAccelerationStructureVersionInfoKHR; - const void * pNext = {}; - const uint8_t * pVersionData = {}; - }; - - template <> - struct CppType - { - using Type = AccelerationStructureVersionInfoKHR; - }; - - struct AcquireNextImageInfoKHR - { - using NativeType = VkAcquireNextImageInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAcquireNextImageInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AcquireNextImageInfoKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ = {}, - uint64_t timeout_ = {}, - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::Fence fence_ = {}, - uint32_t deviceMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchain( swapchain_ ) - , timeout( timeout_ ) - , semaphore( semaphore_ ) - , fence( fence_ ) - , deviceMask( deviceMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR AcquireNextImageInfoKHR( AcquireNextImageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AcquireNextImageInfoKHR( VkAcquireNextImageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AcquireNextImageInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AcquireNextImageInfoKHR & operator=( AcquireNextImageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AcquireNextImageInfoKHR & operator=( VkAcquireNextImageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setSwapchain( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ ) VULKAN_HPP_NOEXCEPT - { - swapchain = swapchain_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setTimeout( uint64_t timeout_ ) VULKAN_HPP_NOEXCEPT - { - timeout = timeout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setFence( VULKAN_HPP_NAMESPACE::Fence fence_ ) VULKAN_HPP_NOEXCEPT - { - fence = fence_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireNextImageInfoKHR & setDeviceMask( uint32_t deviceMask_ ) VULKAN_HPP_NOEXCEPT - { - deviceMask = deviceMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAcquireNextImageInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAcquireNextImageInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchain, timeout, semaphore, fence, deviceMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AcquireNextImageInfoKHR const & ) const = default; -#else - bool operator==( AcquireNextImageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchain == rhs.swapchain ) && ( timeout == rhs.timeout ) && - ( semaphore == rhs.semaphore ) && ( fence == rhs.fence ) && ( deviceMask == rhs.deviceMask ); -# endif - } - - bool operator!=( AcquireNextImageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAcquireNextImageInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain = {}; - uint64_t timeout = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::Fence fence = {}; - uint32_t deviceMask = {}; - }; - - template <> - struct CppType - { - using Type = AcquireNextImageInfoKHR; - }; - - struct AcquireProfilingLockInfoKHR - { - using NativeType = VkAcquireProfilingLockInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAcquireProfilingLockInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AcquireProfilingLockInfoKHR( VULKAN_HPP_NAMESPACE::AcquireProfilingLockFlagsKHR flags_ = {}, - uint64_t timeout_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , timeout( timeout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AcquireProfilingLockInfoKHR( AcquireProfilingLockInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AcquireProfilingLockInfoKHR( VkAcquireProfilingLockInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AcquireProfilingLockInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AcquireProfilingLockInfoKHR & operator=( AcquireProfilingLockInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AcquireProfilingLockInfoKHR & operator=( VkAcquireProfilingLockInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AcquireProfilingLockInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireProfilingLockInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::AcquireProfilingLockFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AcquireProfilingLockInfoKHR & setTimeout( uint64_t timeout_ ) VULKAN_HPP_NOEXCEPT - { - timeout = timeout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAcquireProfilingLockInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAcquireProfilingLockInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, timeout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AcquireProfilingLockInfoKHR const & ) const = default; -#else - bool operator==( AcquireProfilingLockInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( timeout == rhs.timeout ); -# endif - } - - bool operator!=( AcquireProfilingLockInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAcquireProfilingLockInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AcquireProfilingLockFlagsKHR flags = {}; - uint64_t timeout = {}; - }; - - template <> - struct CppType - { - using Type = AcquireProfilingLockInfoKHR; - }; - - struct AllocationCallbacks - { - using NativeType = VkAllocationCallbacks; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AllocationCallbacks( void * pUserData_ = {}, - PFN_vkAllocationFunction pfnAllocation_ = {}, - PFN_vkReallocationFunction pfnReallocation_ = {}, - PFN_vkFreeFunction pfnFree_ = {}, - PFN_vkInternalAllocationNotification pfnInternalAllocation_ = {}, - PFN_vkInternalFreeNotification pfnInternalFree_ = {} ) VULKAN_HPP_NOEXCEPT - : pUserData( pUserData_ ) - , pfnAllocation( pfnAllocation_ ) - , pfnReallocation( pfnReallocation_ ) - , pfnFree( pfnFree_ ) - , pfnInternalAllocation( pfnInternalAllocation_ ) - , pfnInternalFree( pfnInternalFree_ ) - { - } - - VULKAN_HPP_CONSTEXPR AllocationCallbacks( AllocationCallbacks const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AllocationCallbacks( VkAllocationCallbacks const & rhs ) VULKAN_HPP_NOEXCEPT : AllocationCallbacks( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AllocationCallbacks & operator=( AllocationCallbacks const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AllocationCallbacks & operator=( VkAllocationCallbacks const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPUserData( void * pUserData_ ) VULKAN_HPP_NOEXCEPT - { - pUserData = pUserData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPfnAllocation( PFN_vkAllocationFunction pfnAllocation_ ) VULKAN_HPP_NOEXCEPT - { - pfnAllocation = pfnAllocation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPfnReallocation( PFN_vkReallocationFunction pfnReallocation_ ) VULKAN_HPP_NOEXCEPT - { - pfnReallocation = pfnReallocation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPfnFree( PFN_vkFreeFunction pfnFree_ ) VULKAN_HPP_NOEXCEPT - { - pfnFree = pfnFree_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPfnInternalAllocation( PFN_vkInternalAllocationNotification pfnInternalAllocation_ ) VULKAN_HPP_NOEXCEPT - { - pfnInternalAllocation = pfnInternalAllocation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AllocationCallbacks & setPfnInternalFree( PFN_vkInternalFreeNotification pfnInternalFree_ ) VULKAN_HPP_NOEXCEPT - { - pfnInternalFree = pfnInternalFree_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAllocationCallbacks const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAllocationCallbacks &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( pUserData, pfnAllocation, pfnReallocation, pfnFree, pfnInternalAllocation, pfnInternalFree ); - } -#endif - - bool operator==( AllocationCallbacks const & rhs ) const VULKAN_HPP_NOEXCEPT - { -#if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -#else - return ( pUserData == rhs.pUserData ) && ( pfnAllocation == rhs.pfnAllocation ) && ( pfnReallocation == rhs.pfnReallocation ) && - ( pfnFree == rhs.pfnFree ) && ( pfnInternalAllocation == rhs.pfnInternalAllocation ) && ( pfnInternalFree == rhs.pfnInternalFree ); -#endif - } - - bool operator!=( AllocationCallbacks const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - void * pUserData = {}; - PFN_vkAllocationFunction pfnAllocation = {}; - PFN_vkReallocationFunction pfnReallocation = {}; - PFN_vkFreeFunction pfnFree = {}; - PFN_vkInternalAllocationNotification pfnInternalAllocation = {}; - PFN_vkInternalFreeNotification pfnInternalFree = {}; - }; - - struct AmigoProfilingSubmitInfoSEC - { - using NativeType = VkAmigoProfilingSubmitInfoSEC; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAmigoProfilingSubmitInfoSEC; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - AmigoProfilingSubmitInfoSEC( uint64_t firstDrawTimestamp_ = {}, uint64_t swapBufferTimestamp_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , firstDrawTimestamp( firstDrawTimestamp_ ) - , swapBufferTimestamp( swapBufferTimestamp_ ) - { - } - - VULKAN_HPP_CONSTEXPR AmigoProfilingSubmitInfoSEC( AmigoProfilingSubmitInfoSEC const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AmigoProfilingSubmitInfoSEC( VkAmigoProfilingSubmitInfoSEC const & rhs ) VULKAN_HPP_NOEXCEPT - : AmigoProfilingSubmitInfoSEC( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AmigoProfilingSubmitInfoSEC & operator=( AmigoProfilingSubmitInfoSEC const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AmigoProfilingSubmitInfoSEC & operator=( VkAmigoProfilingSubmitInfoSEC const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AmigoProfilingSubmitInfoSEC & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AmigoProfilingSubmitInfoSEC & setFirstDrawTimestamp( uint64_t firstDrawTimestamp_ ) VULKAN_HPP_NOEXCEPT - { - firstDrawTimestamp = firstDrawTimestamp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AmigoProfilingSubmitInfoSEC & setSwapBufferTimestamp( uint64_t swapBufferTimestamp_ ) VULKAN_HPP_NOEXCEPT - { - swapBufferTimestamp = swapBufferTimestamp_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAmigoProfilingSubmitInfoSEC const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAmigoProfilingSubmitInfoSEC &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, firstDrawTimestamp, swapBufferTimestamp ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AmigoProfilingSubmitInfoSEC const & ) const = default; -#else - bool operator==( AmigoProfilingSubmitInfoSEC const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( firstDrawTimestamp == rhs.firstDrawTimestamp ) && - ( swapBufferTimestamp == rhs.swapBufferTimestamp ); -# endif - } - - bool operator!=( AmigoProfilingSubmitInfoSEC const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAmigoProfilingSubmitInfoSEC; - const void * pNext = {}; - uint64_t firstDrawTimestamp = {}; - uint64_t swapBufferTimestamp = {}; - }; - - template <> - struct CppType - { - using Type = AmigoProfilingSubmitInfoSEC; - }; - - struct ComponentMapping - { - using NativeType = VkComponentMapping; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ComponentMapping( VULKAN_HPP_NAMESPACE::ComponentSwizzle r_ = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity, - VULKAN_HPP_NAMESPACE::ComponentSwizzle g_ = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity, - VULKAN_HPP_NAMESPACE::ComponentSwizzle b_ = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity, - VULKAN_HPP_NAMESPACE::ComponentSwizzle a_ = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity ) VULKAN_HPP_NOEXCEPT - : r( r_ ) - , g( g_ ) - , b( b_ ) - , a( a_ ) - { - } - - VULKAN_HPP_CONSTEXPR ComponentMapping( ComponentMapping const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ComponentMapping( VkComponentMapping const & rhs ) VULKAN_HPP_NOEXCEPT : ComponentMapping( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ComponentMapping & operator=( ComponentMapping const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ComponentMapping & operator=( VkComponentMapping const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ComponentMapping & setR( VULKAN_HPP_NAMESPACE::ComponentSwizzle r_ ) VULKAN_HPP_NOEXCEPT - { - r = r_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComponentMapping & setG( VULKAN_HPP_NAMESPACE::ComponentSwizzle g_ ) VULKAN_HPP_NOEXCEPT - { - g = g_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComponentMapping & setB( VULKAN_HPP_NAMESPACE::ComponentSwizzle b_ ) VULKAN_HPP_NOEXCEPT - { - b = b_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComponentMapping & setA( VULKAN_HPP_NAMESPACE::ComponentSwizzle a_ ) VULKAN_HPP_NOEXCEPT - { - a = a_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkComponentMapping const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkComponentMapping &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( r, g, b, a ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ComponentMapping const & ) const = default; -#else - bool operator==( ComponentMapping const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( r == rhs.r ) && ( g == rhs.g ) && ( b == rhs.b ) && ( a == rhs.a ); -# endif - } - - bool operator!=( ComponentMapping const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ComponentSwizzle r = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity; - VULKAN_HPP_NAMESPACE::ComponentSwizzle g = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity; - VULKAN_HPP_NAMESPACE::ComponentSwizzle b = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity; - VULKAN_HPP_NAMESPACE::ComponentSwizzle a = VULKAN_HPP_NAMESPACE::ComponentSwizzle::eIdentity; - }; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct AndroidHardwareBufferFormatProperties2ANDROID - { - using NativeType = VkAndroidHardwareBufferFormatProperties2ANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidHardwareBufferFormatProperties2ANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferFormatProperties2ANDROID( - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - uint64_t externalFormat_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 formatFeatures_ = {}, - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents_ = {}, - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity, - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , externalFormat( externalFormat_ ) - , formatFeatures( formatFeatures_ ) - , samplerYcbcrConversionComponents( samplerYcbcrConversionComponents_ ) - , suggestedYcbcrModel( suggestedYcbcrModel_ ) - , suggestedYcbcrRange( suggestedYcbcrRange_ ) - , suggestedXChromaOffset( suggestedXChromaOffset_ ) - , suggestedYChromaOffset( suggestedYChromaOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR - AndroidHardwareBufferFormatProperties2ANDROID( AndroidHardwareBufferFormatProperties2ANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferFormatProperties2ANDROID( VkAndroidHardwareBufferFormatProperties2ANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : AndroidHardwareBufferFormatProperties2ANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AndroidHardwareBufferFormatProperties2ANDROID & operator=( AndroidHardwareBufferFormatProperties2ANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferFormatProperties2ANDROID & operator=( VkAndroidHardwareBufferFormatProperties2ANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkAndroidHardwareBufferFormatProperties2ANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAndroidHardwareBufferFormatProperties2ANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - format, - externalFormat, - formatFeatures, - samplerYcbcrConversionComponents, - suggestedYcbcrModel, - suggestedYcbcrRange, - suggestedXChromaOffset, - suggestedYChromaOffset ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AndroidHardwareBufferFormatProperties2ANDROID const & ) const = default; -# else - bool operator==( AndroidHardwareBufferFormatProperties2ANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( externalFormat == rhs.externalFormat ) && - ( formatFeatures == rhs.formatFeatures ) && ( samplerYcbcrConversionComponents == rhs.samplerYcbcrConversionComponents ) && - ( suggestedYcbcrModel == rhs.suggestedYcbcrModel ) && ( suggestedYcbcrRange == rhs.suggestedYcbcrRange ) && - ( suggestedXChromaOffset == rhs.suggestedXChromaOffset ) && ( suggestedYChromaOffset == rhs.suggestedYChromaOffset ); -# endif - } - - bool operator!=( AndroidHardwareBufferFormatProperties2ANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidHardwareBufferFormatProperties2ANDROID; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - uint64_t externalFormat = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 formatFeatures = {}; - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents = {}; - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity; - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - }; - - template <> - struct CppType - { - using Type = AndroidHardwareBufferFormatProperties2ANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct AndroidHardwareBufferFormatPropertiesANDROID - { - using NativeType = VkAndroidHardwareBufferFormatPropertiesANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidHardwareBufferFormatPropertiesANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferFormatPropertiesANDROID( - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - uint64_t externalFormat_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags formatFeatures_ = {}, - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents_ = {}, - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity, - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , externalFormat( externalFormat_ ) - , formatFeatures( formatFeatures_ ) - , samplerYcbcrConversionComponents( samplerYcbcrConversionComponents_ ) - , suggestedYcbcrModel( suggestedYcbcrModel_ ) - , suggestedYcbcrRange( suggestedYcbcrRange_ ) - , suggestedXChromaOffset( suggestedXChromaOffset_ ) - , suggestedYChromaOffset( suggestedYChromaOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferFormatPropertiesANDROID( AndroidHardwareBufferFormatPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferFormatPropertiesANDROID( VkAndroidHardwareBufferFormatPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : AndroidHardwareBufferFormatPropertiesANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AndroidHardwareBufferFormatPropertiesANDROID & operator=( AndroidHardwareBufferFormatPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferFormatPropertiesANDROID & operator=( VkAndroidHardwareBufferFormatPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkAndroidHardwareBufferFormatPropertiesANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAndroidHardwareBufferFormatPropertiesANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - format, - externalFormat, - formatFeatures, - samplerYcbcrConversionComponents, - suggestedYcbcrModel, - suggestedYcbcrRange, - suggestedXChromaOffset, - suggestedYChromaOffset ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AndroidHardwareBufferFormatPropertiesANDROID const & ) const = default; -# else - bool operator==( AndroidHardwareBufferFormatPropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( externalFormat == rhs.externalFormat ) && - ( formatFeatures == rhs.formatFeatures ) && ( samplerYcbcrConversionComponents == rhs.samplerYcbcrConversionComponents ) && - ( suggestedYcbcrModel == rhs.suggestedYcbcrModel ) && ( suggestedYcbcrRange == rhs.suggestedYcbcrRange ) && - ( suggestedXChromaOffset == rhs.suggestedXChromaOffset ) && ( suggestedYChromaOffset == rhs.suggestedYChromaOffset ); -# endif - } - - bool operator!=( AndroidHardwareBufferFormatPropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidHardwareBufferFormatPropertiesANDROID; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - uint64_t externalFormat = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags formatFeatures = {}; - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents = {}; - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity; - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - }; - - template <> - struct CppType - { - using Type = AndroidHardwareBufferFormatPropertiesANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct AndroidHardwareBufferPropertiesANDROID - { - using NativeType = VkAndroidHardwareBufferPropertiesANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidHardwareBufferPropertiesANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferPropertiesANDROID( VULKAN_HPP_NAMESPACE::DeviceSize allocationSize_ = {}, - uint32_t memoryTypeBits_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , allocationSize( allocationSize_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferPropertiesANDROID( AndroidHardwareBufferPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferPropertiesANDROID( VkAndroidHardwareBufferPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : AndroidHardwareBufferPropertiesANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AndroidHardwareBufferPropertiesANDROID & operator=( AndroidHardwareBufferPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferPropertiesANDROID & operator=( VkAndroidHardwareBufferPropertiesANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkAndroidHardwareBufferPropertiesANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAndroidHardwareBufferPropertiesANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, allocationSize, memoryTypeBits ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AndroidHardwareBufferPropertiesANDROID const & ) const = default; -# else - bool operator==( AndroidHardwareBufferPropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( allocationSize == rhs.allocationSize ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( AndroidHardwareBufferPropertiesANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidHardwareBufferPropertiesANDROID; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize allocationSize = {}; - uint32_t memoryTypeBits = {}; - }; - - template <> - struct CppType - { - using Type = AndroidHardwareBufferPropertiesANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct AndroidHardwareBufferUsageANDROID - { - using NativeType = VkAndroidHardwareBufferUsageANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidHardwareBufferUsageANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferUsageANDROID( uint64_t androidHardwareBufferUsage_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , androidHardwareBufferUsage( androidHardwareBufferUsage_ ) - { - } - - VULKAN_HPP_CONSTEXPR AndroidHardwareBufferUsageANDROID( AndroidHardwareBufferUsageANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferUsageANDROID( VkAndroidHardwareBufferUsageANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : AndroidHardwareBufferUsageANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AndroidHardwareBufferUsageANDROID & operator=( AndroidHardwareBufferUsageANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidHardwareBufferUsageANDROID & operator=( VkAndroidHardwareBufferUsageANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkAndroidHardwareBufferUsageANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAndroidHardwareBufferUsageANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, androidHardwareBufferUsage ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AndroidHardwareBufferUsageANDROID const & ) const = default; -# else - bool operator==( AndroidHardwareBufferUsageANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( androidHardwareBufferUsage == rhs.androidHardwareBufferUsage ); -# endif - } - - bool operator!=( AndroidHardwareBufferUsageANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidHardwareBufferUsageANDROID; - void * pNext = {}; - uint64_t androidHardwareBufferUsage = {}; - }; - - template <> - struct CppType - { - using Type = AndroidHardwareBufferUsageANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct AndroidSurfaceCreateInfoKHR - { - using NativeType = VkAndroidSurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAndroidSurfaceCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AndroidSurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateFlagsKHR flags_ = {}, - struct ANativeWindow * window_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , window( window_ ) - { - } - - VULKAN_HPP_CONSTEXPR AndroidSurfaceCreateInfoKHR( AndroidSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidSurfaceCreateInfoKHR( VkAndroidSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : AndroidSurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AndroidSurfaceCreateInfoKHR & operator=( AndroidSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AndroidSurfaceCreateInfoKHR & operator=( VkAndroidSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AndroidSurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AndroidSurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AndroidSurfaceCreateInfoKHR & setWindow( struct ANativeWindow * window_ ) VULKAN_HPP_NOEXCEPT - { - window = window_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAndroidSurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAndroidSurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, window ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AndroidSurfaceCreateInfoKHR const & ) const = default; -# else - bool operator==( AndroidSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( window == rhs.window ); -# endif - } - - bool operator!=( AndroidSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAndroidSurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AndroidSurfaceCreateFlagsKHR flags = {}; - struct ANativeWindow * window = {}; - }; - - template <> - struct CppType - { - using Type = AndroidSurfaceCreateInfoKHR; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - struct ApplicationInfo - { - using NativeType = VkApplicationInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eApplicationInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ApplicationInfo( const char * pApplicationName_ = {}, - uint32_t applicationVersion_ = {}, - const char * pEngineName_ = {}, - uint32_t engineVersion_ = {}, - uint32_t apiVersion_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pApplicationName( pApplicationName_ ) - , applicationVersion( applicationVersion_ ) - , pEngineName( pEngineName_ ) - , engineVersion( engineVersion_ ) - , apiVersion( apiVersion_ ) - { - } - - VULKAN_HPP_CONSTEXPR ApplicationInfo( ApplicationInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ApplicationInfo( VkApplicationInfo const & rhs ) VULKAN_HPP_NOEXCEPT : ApplicationInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ApplicationInfo & operator=( ApplicationInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ApplicationInfo & operator=( VkApplicationInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setPApplicationName( const char * pApplicationName_ ) VULKAN_HPP_NOEXCEPT - { - pApplicationName = pApplicationName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setApplicationVersion( uint32_t applicationVersion_ ) VULKAN_HPP_NOEXCEPT - { - applicationVersion = applicationVersion_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setPEngineName( const char * pEngineName_ ) VULKAN_HPP_NOEXCEPT - { - pEngineName = pEngineName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setEngineVersion( uint32_t engineVersion_ ) VULKAN_HPP_NOEXCEPT - { - engineVersion = engineVersion_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ApplicationInfo & setApiVersion( uint32_t apiVersion_ ) VULKAN_HPP_NOEXCEPT - { - apiVersion = apiVersion_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkApplicationInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkApplicationInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pApplicationName, applicationVersion, pEngineName, engineVersion, apiVersion ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( ApplicationInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( pApplicationName != rhs.pApplicationName ) - if ( auto cmp = strcmp( pApplicationName, rhs.pApplicationName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = applicationVersion <=> rhs.applicationVersion; cmp != 0 ) - return cmp; - if ( pEngineName != rhs.pEngineName ) - if ( auto cmp = strcmp( pEngineName, rhs.pEngineName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = engineVersion <=> rhs.engineVersion; cmp != 0 ) - return cmp; - if ( auto cmp = apiVersion <=> rhs.apiVersion; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( ApplicationInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && - ( ( pApplicationName == rhs.pApplicationName ) || ( strcmp( pApplicationName, rhs.pApplicationName ) == 0 ) ) && - ( applicationVersion == rhs.applicationVersion ) && ( ( pEngineName == rhs.pEngineName ) || ( strcmp( pEngineName, rhs.pEngineName ) == 0 ) ) && - ( engineVersion == rhs.engineVersion ) && ( apiVersion == rhs.apiVersion ); - } - - bool operator!=( ApplicationInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eApplicationInfo; - const void * pNext = {}; - const char * pApplicationName = {}; - uint32_t applicationVersion = {}; - const char * pEngineName = {}; - uint32_t engineVersion = {}; - uint32_t apiVersion = {}; - }; - - template <> - struct CppType - { - using Type = ApplicationInfo; - }; - - struct AttachmentDescription - { - using NativeType = VkAttachmentDescription; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - AttachmentDescription( VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad, - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore, - VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp_ = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad, - VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp_ = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore, - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageLayout finalLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined ) VULKAN_HPP_NOEXCEPT - : flags( flags_ ) - , format( format_ ) - , samples( samples_ ) - , loadOp( loadOp_ ) - , storeOp( storeOp_ ) - , stencilLoadOp( stencilLoadOp_ ) - , stencilStoreOp( stencilStoreOp_ ) - , initialLayout( initialLayout_ ) - , finalLayout( finalLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentDescription( AttachmentDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescription( VkAttachmentDescription const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentDescription( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentDescription & operator=( AttachmentDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescription & operator=( VkAttachmentDescription const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setFlags( VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ ) VULKAN_HPP_NOEXCEPT - { - samples = samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setLoadOp( VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ ) VULKAN_HPP_NOEXCEPT - { - loadOp = loadOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setStoreOp( VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ ) VULKAN_HPP_NOEXCEPT - { - storeOp = storeOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setStencilLoadOp( VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp_ ) VULKAN_HPP_NOEXCEPT - { - stencilLoadOp = stencilLoadOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setStencilStoreOp( VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp_ ) VULKAN_HPP_NOEXCEPT - { - stencilStoreOp = stencilStoreOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setInitialLayout( VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ ) VULKAN_HPP_NOEXCEPT - { - initialLayout = initialLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription & setFinalLayout( VULKAN_HPP_NAMESPACE::ImageLayout finalLayout_ ) VULKAN_HPP_NOEXCEPT - { - finalLayout = finalLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentDescription const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentDescription &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( flags, format, samples, loadOp, storeOp, stencilLoadOp, stencilStoreOp, initialLayout, finalLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentDescription const & ) const = default; -#else - bool operator==( AttachmentDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( flags == rhs.flags ) && ( format == rhs.format ) && ( samples == rhs.samples ) && ( loadOp == rhs.loadOp ) && ( storeOp == rhs.storeOp ) && - ( stencilLoadOp == rhs.stencilLoadOp ) && ( stencilStoreOp == rhs.stencilStoreOp ) && ( initialLayout == rhs.initialLayout ) && - ( finalLayout == rhs.finalLayout ); -# endif - } - - bool operator!=( AttachmentDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad; - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore; - VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad; - VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore; - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageLayout finalLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - struct AttachmentDescription2 - { - using NativeType = VkAttachmentDescription2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAttachmentDescription2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AttachmentDescription2( VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad, - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore, - VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp_ = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad, - VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp_ = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore, - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageLayout finalLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , format( format_ ) - , samples( samples_ ) - , loadOp( loadOp_ ) - , storeOp( storeOp_ ) - , stencilLoadOp( stencilLoadOp_ ) - , stencilStoreOp( stencilStoreOp_ ) - , initialLayout( initialLayout_ ) - , finalLayout( finalLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentDescription2( AttachmentDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescription2( VkAttachmentDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentDescription2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentDescription2 & operator=( AttachmentDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescription2 & operator=( VkAttachmentDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setFlags( VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ ) VULKAN_HPP_NOEXCEPT - { - samples = samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setLoadOp( VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ ) VULKAN_HPP_NOEXCEPT - { - loadOp = loadOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setStoreOp( VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ ) VULKAN_HPP_NOEXCEPT - { - storeOp = storeOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setStencilLoadOp( VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp_ ) VULKAN_HPP_NOEXCEPT - { - stencilLoadOp = stencilLoadOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setStencilStoreOp( VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp_ ) VULKAN_HPP_NOEXCEPT - { - stencilStoreOp = stencilStoreOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setInitialLayout( VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ ) VULKAN_HPP_NOEXCEPT - { - initialLayout = initialLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescription2 & setFinalLayout( VULKAN_HPP_NAMESPACE::ImageLayout finalLayout_ ) VULKAN_HPP_NOEXCEPT - { - finalLayout = finalLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentDescription2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentDescription2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, format, samples, loadOp, storeOp, stencilLoadOp, stencilStoreOp, initialLayout, finalLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentDescription2 const & ) const = default; -#else - bool operator==( AttachmentDescription2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( format == rhs.format ) && ( samples == rhs.samples ) && - ( loadOp == rhs.loadOp ) && ( storeOp == rhs.storeOp ) && ( stencilLoadOp == rhs.stencilLoadOp ) && ( stencilStoreOp == rhs.stencilStoreOp ) && - ( initialLayout == rhs.initialLayout ) && ( finalLayout == rhs.finalLayout ); -# endif - } - - bool operator!=( AttachmentDescription2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAttachmentDescription2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AttachmentDescriptionFlags flags = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad; - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore; - VULKAN_HPP_NAMESPACE::AttachmentLoadOp stencilLoadOp = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad; - VULKAN_HPP_NAMESPACE::AttachmentStoreOp stencilStoreOp = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore; - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageLayout finalLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - template <> - struct CppType - { - using Type = AttachmentDescription2; - }; - using AttachmentDescription2KHR = AttachmentDescription2; - - struct AttachmentDescriptionStencilLayout - { - using NativeType = VkAttachmentDescriptionStencilLayout; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAttachmentDescriptionStencilLayout; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - AttachmentDescriptionStencilLayout( VULKAN_HPP_NAMESPACE::ImageLayout stencilInitialLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageLayout stencilFinalLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stencilInitialLayout( stencilInitialLayout_ ) - , stencilFinalLayout( stencilFinalLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentDescriptionStencilLayout( AttachmentDescriptionStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescriptionStencilLayout( VkAttachmentDescriptionStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentDescriptionStencilLayout( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentDescriptionStencilLayout & operator=( AttachmentDescriptionStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentDescriptionStencilLayout & operator=( VkAttachmentDescriptionStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentDescriptionStencilLayout & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescriptionStencilLayout & - setStencilInitialLayout( VULKAN_HPP_NAMESPACE::ImageLayout stencilInitialLayout_ ) VULKAN_HPP_NOEXCEPT - { - stencilInitialLayout = stencilInitialLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentDescriptionStencilLayout & - setStencilFinalLayout( VULKAN_HPP_NAMESPACE::ImageLayout stencilFinalLayout_ ) VULKAN_HPP_NOEXCEPT - { - stencilFinalLayout = stencilFinalLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentDescriptionStencilLayout const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentDescriptionStencilLayout &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stencilInitialLayout, stencilFinalLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentDescriptionStencilLayout const & ) const = default; -#else - bool operator==( AttachmentDescriptionStencilLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stencilInitialLayout == rhs.stencilInitialLayout ) && - ( stencilFinalLayout == rhs.stencilFinalLayout ); -# endif - } - - bool operator!=( AttachmentDescriptionStencilLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAttachmentDescriptionStencilLayout; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageLayout stencilInitialLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageLayout stencilFinalLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - template <> - struct CppType - { - using Type = AttachmentDescriptionStencilLayout; - }; - using AttachmentDescriptionStencilLayoutKHR = AttachmentDescriptionStencilLayout; - - struct AttachmentReference - { - using NativeType = VkAttachmentReference; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AttachmentReference( uint32_t attachment_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout layout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined ) VULKAN_HPP_NOEXCEPT - : attachment( attachment_ ) - , layout( layout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentReference( AttachmentReference const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReference( VkAttachmentReference const & rhs ) VULKAN_HPP_NOEXCEPT : AttachmentReference( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentReference & operator=( AttachmentReference const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReference & operator=( VkAttachmentReference const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentReference & setAttachment( uint32_t attachment_ ) VULKAN_HPP_NOEXCEPT - { - attachment = attachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentReference & setLayout( VULKAN_HPP_NAMESPACE::ImageLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentReference const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentReference &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( attachment, layout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentReference const & ) const = default; -#else - bool operator==( AttachmentReference const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( attachment == rhs.attachment ) && ( layout == rhs.layout ); -# endif - } - - bool operator!=( AttachmentReference const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t attachment = {}; - VULKAN_HPP_NAMESPACE::ImageLayout layout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - struct AttachmentReference2 - { - using NativeType = VkAttachmentReference2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAttachmentReference2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AttachmentReference2( uint32_t attachment_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout layout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachment( attachment_ ) - , layout( layout_ ) - , aspectMask( aspectMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentReference2( AttachmentReference2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReference2( VkAttachmentReference2 const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentReference2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentReference2 & operator=( AttachmentReference2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReference2 & operator=( VkAttachmentReference2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentReference2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentReference2 & setAttachment( uint32_t attachment_ ) VULKAN_HPP_NOEXCEPT - { - attachment = attachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentReference2 & setLayout( VULKAN_HPP_NAMESPACE::ImageLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentReference2 & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentReference2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentReference2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, attachment, layout, aspectMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentReference2 const & ) const = default; -#else - bool operator==( AttachmentReference2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachment == rhs.attachment ) && ( layout == rhs.layout ) && - ( aspectMask == rhs.aspectMask ); -# endif - } - - bool operator!=( AttachmentReference2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAttachmentReference2; - const void * pNext = {}; - uint32_t attachment = {}; - VULKAN_HPP_NAMESPACE::ImageLayout layout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - }; - - template <> - struct CppType - { - using Type = AttachmentReference2; - }; - using AttachmentReference2KHR = AttachmentReference2; - - struct AttachmentReferenceStencilLayout - { - using NativeType = VkAttachmentReferenceStencilLayout; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAttachmentReferenceStencilLayout; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AttachmentReferenceStencilLayout( VULKAN_HPP_NAMESPACE::ImageLayout stencilLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stencilLayout( stencilLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentReferenceStencilLayout( AttachmentReferenceStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReferenceStencilLayout( VkAttachmentReferenceStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentReferenceStencilLayout( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentReferenceStencilLayout & operator=( AttachmentReferenceStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentReferenceStencilLayout & operator=( VkAttachmentReferenceStencilLayout const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentReferenceStencilLayout & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentReferenceStencilLayout & setStencilLayout( VULKAN_HPP_NAMESPACE::ImageLayout stencilLayout_ ) VULKAN_HPP_NOEXCEPT - { - stencilLayout = stencilLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentReferenceStencilLayout const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentReferenceStencilLayout &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stencilLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentReferenceStencilLayout const & ) const = default; -#else - bool operator==( AttachmentReferenceStencilLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stencilLayout == rhs.stencilLayout ); -# endif - } - - bool operator!=( AttachmentReferenceStencilLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAttachmentReferenceStencilLayout; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageLayout stencilLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - template <> - struct CppType - { - using Type = AttachmentReferenceStencilLayout; - }; - using AttachmentReferenceStencilLayoutKHR = AttachmentReferenceStencilLayout; - - struct AttachmentSampleCountInfoAMD - { - using NativeType = VkAttachmentSampleCountInfoAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eAttachmentSampleCountInfoAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - AttachmentSampleCountInfoAMD( uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::SampleCountFlagBits * pColorAttachmentSamples_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits depthStencilAttachmentSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachmentSamples( pColorAttachmentSamples_ ) - , depthStencilAttachmentSamples( depthStencilAttachmentSamples_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentSampleCountInfoAMD( AttachmentSampleCountInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentSampleCountInfoAMD( VkAttachmentSampleCountInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentSampleCountInfoAMD( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AttachmentSampleCountInfoAMD( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentSamples_, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits depthStencilAttachmentSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , colorAttachmentCount( static_cast( colorAttachmentSamples_.size() ) ) - , pColorAttachmentSamples( colorAttachmentSamples_.data() ) - , depthStencilAttachmentSamples( depthStencilAttachmentSamples_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentSampleCountInfoAMD & operator=( AttachmentSampleCountInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentSampleCountInfoAMD & operator=( VkAttachmentSampleCountInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleCountInfoAMD & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleCountInfoAMD & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleCountInfoAMD & - setPColorAttachmentSamples( const VULKAN_HPP_NAMESPACE::SampleCountFlagBits * pColorAttachmentSamples_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachmentSamples = pColorAttachmentSamples_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - AttachmentSampleCountInfoAMD & setColorAttachmentSamples( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentSamples_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachmentSamples_.size() ); - pColorAttachmentSamples = colorAttachmentSamples_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleCountInfoAMD & - setDepthStencilAttachmentSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits depthStencilAttachmentSamples_ ) VULKAN_HPP_NOEXCEPT - { - depthStencilAttachmentSamples = depthStencilAttachmentSamples_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentSampleCountInfoAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentSampleCountInfoAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, colorAttachmentCount, pColorAttachmentSamples, depthStencilAttachmentSamples ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentSampleCountInfoAMD const & ) const = default; -#else - bool operator==( AttachmentSampleCountInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( colorAttachmentCount == rhs.colorAttachmentCount ) && - ( pColorAttachmentSamples == rhs.pColorAttachmentSamples ) && ( depthStencilAttachmentSamples == rhs.depthStencilAttachmentSamples ); -# endif - } - - bool operator!=( AttachmentSampleCountInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eAttachmentSampleCountInfoAMD; - const void * pNext = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::SampleCountFlagBits * pColorAttachmentSamples = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits depthStencilAttachmentSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - }; - - template <> - struct CppType - { - using Type = AttachmentSampleCountInfoAMD; - }; - using AttachmentSampleCountInfoNV = AttachmentSampleCountInfoAMD; - - struct Extent2D - { - using NativeType = VkExtent2D; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Extent2D( uint32_t width_ = {}, uint32_t height_ = {} ) VULKAN_HPP_NOEXCEPT - : width( width_ ) - , height( height_ ) - { - } - - VULKAN_HPP_CONSTEXPR Extent2D( Extent2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Extent2D( VkExtent2D const & rhs ) VULKAN_HPP_NOEXCEPT : Extent2D( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Extent2D & operator=( Extent2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Extent2D & operator=( VkExtent2D const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Extent2D & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Extent2D & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExtent2D const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExtent2D &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( width, height ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Extent2D const & ) const = default; -#else - bool operator==( Extent2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( width == rhs.width ) && ( height == rhs.height ); -# endif - } - - bool operator!=( Extent2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t width = {}; - uint32_t height = {}; - }; - - struct SampleLocationEXT - { - using NativeType = VkSampleLocationEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SampleLocationEXT( float x_ = {}, float y_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - { - } - - VULKAN_HPP_CONSTEXPR SampleLocationEXT( SampleLocationEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SampleLocationEXT( VkSampleLocationEXT const & rhs ) VULKAN_HPP_NOEXCEPT : SampleLocationEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SampleLocationEXT & operator=( SampleLocationEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SampleLocationEXT & operator=( VkSampleLocationEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SampleLocationEXT & setX( float x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SampleLocationEXT & setY( float y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSampleLocationEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSampleLocationEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SampleLocationEXT const & ) const = default; -#else - bool operator==( SampleLocationEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ); -# endif - } - - bool operator!=( SampleLocationEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float x = {}; - float y = {}; - }; - - struct SampleLocationsInfoEXT - { - using NativeType = VkSampleLocationsInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSampleLocationsInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SampleLocationsInfoEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits sampleLocationsPerPixel_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::Extent2D sampleLocationGridSize_ = {}, - uint32_t sampleLocationsCount_ = {}, - const VULKAN_HPP_NAMESPACE::SampleLocationEXT * pSampleLocations_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sampleLocationsPerPixel( sampleLocationsPerPixel_ ) - , sampleLocationGridSize( sampleLocationGridSize_ ) - , sampleLocationsCount( sampleLocationsCount_ ) - , pSampleLocations( pSampleLocations_ ) - { - } - - VULKAN_HPP_CONSTEXPR SampleLocationsInfoEXT( SampleLocationsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SampleLocationsInfoEXT( VkSampleLocationsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SampleLocationsInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SampleLocationsInfoEXT( VULKAN_HPP_NAMESPACE::SampleCountFlagBits sampleLocationsPerPixel_, - VULKAN_HPP_NAMESPACE::Extent2D sampleLocationGridSize_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & sampleLocations_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , sampleLocationsPerPixel( sampleLocationsPerPixel_ ) - , sampleLocationGridSize( sampleLocationGridSize_ ) - , sampleLocationsCount( static_cast( sampleLocations_.size() ) ) - , pSampleLocations( sampleLocations_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SampleLocationsInfoEXT & operator=( SampleLocationsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SampleLocationsInfoEXT & operator=( VkSampleLocationsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SampleLocationsInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SampleLocationsInfoEXT & - setSampleLocationsPerPixel( VULKAN_HPP_NAMESPACE::SampleCountFlagBits sampleLocationsPerPixel_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsPerPixel = sampleLocationsPerPixel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SampleLocationsInfoEXT & - setSampleLocationGridSize( VULKAN_HPP_NAMESPACE::Extent2D const & sampleLocationGridSize_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationGridSize = sampleLocationGridSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SampleLocationsInfoEXT & setSampleLocationsCount( uint32_t sampleLocationsCount_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsCount = sampleLocationsCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SampleLocationsInfoEXT & - setPSampleLocations( const VULKAN_HPP_NAMESPACE::SampleLocationEXT * pSampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - pSampleLocations = pSampleLocations_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SampleLocationsInfoEXT & setSampleLocations( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & sampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsCount = static_cast( sampleLocations_.size() ); - pSampleLocations = sampleLocations_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSampleLocationsInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSampleLocationsInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, sampleLocationsPerPixel, sampleLocationGridSize, sampleLocationsCount, pSampleLocations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SampleLocationsInfoEXT const & ) const = default; -#else - bool operator==( SampleLocationsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sampleLocationsPerPixel == rhs.sampleLocationsPerPixel ) && - ( sampleLocationGridSize == rhs.sampleLocationGridSize ) && ( sampleLocationsCount == rhs.sampleLocationsCount ) && - ( pSampleLocations == rhs.pSampleLocations ); -# endif - } - - bool operator!=( SampleLocationsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSampleLocationsInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits sampleLocationsPerPixel = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::Extent2D sampleLocationGridSize = {}; - uint32_t sampleLocationsCount = {}; - const VULKAN_HPP_NAMESPACE::SampleLocationEXT * pSampleLocations = {}; - }; - - template <> - struct CppType - { - using Type = SampleLocationsInfoEXT; - }; - - struct AttachmentSampleLocationsEXT - { - using NativeType = VkAttachmentSampleLocationsEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR AttachmentSampleLocationsEXT( uint32_t attachmentIndex_ = {}, - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo_ = {} ) VULKAN_HPP_NOEXCEPT - : attachmentIndex( attachmentIndex_ ) - , sampleLocationsInfo( sampleLocationsInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR AttachmentSampleLocationsEXT( AttachmentSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentSampleLocationsEXT( VkAttachmentSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : AttachmentSampleLocationsEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - AttachmentSampleLocationsEXT & operator=( AttachmentSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - AttachmentSampleLocationsEXT & operator=( VkAttachmentSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleLocationsEXT & setAttachmentIndex( uint32_t attachmentIndex_ ) VULKAN_HPP_NOEXCEPT - { - attachmentIndex = attachmentIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 AttachmentSampleLocationsEXT & - setSampleLocationsInfo( VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT const & sampleLocationsInfo_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsInfo = sampleLocationsInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkAttachmentSampleLocationsEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkAttachmentSampleLocationsEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( attachmentIndex, sampleLocationsInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( AttachmentSampleLocationsEXT const & ) const = default; -#else - bool operator==( AttachmentSampleLocationsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( attachmentIndex == rhs.attachmentIndex ) && ( sampleLocationsInfo == rhs.sampleLocationsInfo ); -# endif - } - - bool operator!=( AttachmentSampleLocationsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t attachmentIndex = {}; - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo = {}; - }; - - struct BaseInStructure - { - using NativeType = VkBaseInStructure; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - BaseInStructure( VULKAN_HPP_NAMESPACE::StructureType sType_ = VULKAN_HPP_NAMESPACE::StructureType::eApplicationInfo, - const struct VULKAN_HPP_NAMESPACE::BaseInStructure * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : sType( sType_ ) - , pNext( pNext_ ) - { - } - - BaseInStructure( BaseInStructure const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BaseInStructure( VkBaseInStructure const & rhs ) VULKAN_HPP_NOEXCEPT : BaseInStructure( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BaseInStructure & operator=( BaseInStructure const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BaseInStructure & operator=( VkBaseInStructure const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BaseInStructure & setPNext( const struct VULKAN_HPP_NAMESPACE::BaseInStructure * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBaseInStructure const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBaseInStructure &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BaseInStructure const & ) const = default; -#else - bool operator==( BaseInStructure const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ); -# endif - } - - bool operator!=( BaseInStructure const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = VULKAN_HPP_NAMESPACE::StructureType::eApplicationInfo; - const struct VULKAN_HPP_NAMESPACE::BaseInStructure * pNext = {}; - }; - - struct BaseOutStructure - { - using NativeType = VkBaseOutStructure; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - BaseOutStructure( VULKAN_HPP_NAMESPACE::StructureType sType_ = VULKAN_HPP_NAMESPACE::StructureType::eApplicationInfo, - struct VULKAN_HPP_NAMESPACE::BaseOutStructure * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : sType( sType_ ) - , pNext( pNext_ ) - { - } - - BaseOutStructure( BaseOutStructure const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BaseOutStructure( VkBaseOutStructure const & rhs ) VULKAN_HPP_NOEXCEPT : BaseOutStructure( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BaseOutStructure & operator=( BaseOutStructure const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BaseOutStructure & operator=( VkBaseOutStructure const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BaseOutStructure & setPNext( struct VULKAN_HPP_NAMESPACE::BaseOutStructure * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBaseOutStructure const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBaseOutStructure &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BaseOutStructure const & ) const = default; -#else - bool operator==( BaseOutStructure const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ); -# endif - } - - bool operator!=( BaseOutStructure const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = VULKAN_HPP_NAMESPACE::StructureType::eApplicationInfo; - struct VULKAN_HPP_NAMESPACE::BaseOutStructure * pNext = {}; - }; - - struct BindAccelerationStructureMemoryInfoNV - { - using NativeType = VkBindAccelerationStructureMemoryInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindAccelerationStructureMemoryInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindAccelerationStructureMemoryInfoNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - uint32_t deviceIndexCount_ = {}, - const uint32_t * pDeviceIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructure( accelerationStructure_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - , deviceIndexCount( deviceIndexCount_ ) - , pDeviceIndices( pDeviceIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindAccelerationStructureMemoryInfoNV( BindAccelerationStructureMemoryInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindAccelerationStructureMemoryInfoNV( VkBindAccelerationStructureMemoryInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : BindAccelerationStructureMemoryInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindAccelerationStructureMemoryInfoNV( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure_, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , accelerationStructure( accelerationStructure_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - , deviceIndexCount( static_cast( deviceIndices_.size() ) ) - , pDeviceIndices( deviceIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindAccelerationStructureMemoryInfoNV & operator=( BindAccelerationStructureMemoryInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindAccelerationStructureMemoryInfoNV & operator=( VkBindAccelerationStructureMemoryInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & - setAccelerationStructure( VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructure = accelerationStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & setDeviceIndexCount( uint32_t deviceIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = deviceIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindAccelerationStructureMemoryInfoNV & setPDeviceIndices( const uint32_t * pDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - pDeviceIndices = pDeviceIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindAccelerationStructureMemoryInfoNV & - setDeviceIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = static_cast( deviceIndices_.size() ); - pDeviceIndices = deviceIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindAccelerationStructureMemoryInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindAccelerationStructureMemoryInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, accelerationStructure, memory, memoryOffset, deviceIndexCount, pDeviceIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindAccelerationStructureMemoryInfoNV const & ) const = default; -#else - bool operator==( BindAccelerationStructureMemoryInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructure == rhs.accelerationStructure ) && ( memory == rhs.memory ) && - ( memoryOffset == rhs.memoryOffset ) && ( deviceIndexCount == rhs.deviceIndexCount ) && ( pDeviceIndices == rhs.pDeviceIndices ); -# endif - } - - bool operator!=( BindAccelerationStructureMemoryInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindAccelerationStructureMemoryInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureNV accelerationStructure = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - uint32_t deviceIndexCount = {}; - const uint32_t * pDeviceIndices = {}; - }; - - template <> - struct CppType - { - using Type = BindAccelerationStructureMemoryInfoNV; - }; - - struct BindBufferMemoryDeviceGroupInfo - { - using NativeType = VkBindBufferMemoryDeviceGroupInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindBufferMemoryDeviceGroupInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindBufferMemoryDeviceGroupInfo( uint32_t deviceIndexCount_ = {}, - const uint32_t * pDeviceIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceIndexCount( deviceIndexCount_ ) - , pDeviceIndices( pDeviceIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindBufferMemoryDeviceGroupInfo( BindBufferMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindBufferMemoryDeviceGroupInfo( VkBindBufferMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BindBufferMemoryDeviceGroupInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindBufferMemoryDeviceGroupInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), deviceIndexCount( static_cast( deviceIndices_.size() ) ), pDeviceIndices( deviceIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindBufferMemoryDeviceGroupInfo & operator=( BindBufferMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindBufferMemoryDeviceGroupInfo & operator=( VkBindBufferMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryDeviceGroupInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryDeviceGroupInfo & setDeviceIndexCount( uint32_t deviceIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = deviceIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryDeviceGroupInfo & setPDeviceIndices( const uint32_t * pDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - pDeviceIndices = pDeviceIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindBufferMemoryDeviceGroupInfo & - setDeviceIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = static_cast( deviceIndices_.size() ); - pDeviceIndices = deviceIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindBufferMemoryDeviceGroupInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindBufferMemoryDeviceGroupInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceIndexCount, pDeviceIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindBufferMemoryDeviceGroupInfo const & ) const = default; -#else - bool operator==( BindBufferMemoryDeviceGroupInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceIndexCount == rhs.deviceIndexCount ) && ( pDeviceIndices == rhs.pDeviceIndices ); -# endif - } - - bool operator!=( BindBufferMemoryDeviceGroupInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindBufferMemoryDeviceGroupInfo; - const void * pNext = {}; - uint32_t deviceIndexCount = {}; - const uint32_t * pDeviceIndices = {}; - }; - - template <> - struct CppType - { - using Type = BindBufferMemoryDeviceGroupInfo; - }; - using BindBufferMemoryDeviceGroupInfoKHR = BindBufferMemoryDeviceGroupInfo; - - struct BindBufferMemoryInfo - { - using NativeType = VkBindBufferMemoryInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindBufferMemoryInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindBufferMemoryInfo( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , buffer( buffer_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindBufferMemoryInfo( BindBufferMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindBufferMemoryInfo( VkBindBufferMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BindBufferMemoryInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindBufferMemoryInfo & operator=( BindBufferMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindBufferMemoryInfo & operator=( VkBindBufferMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryInfo & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindBufferMemoryInfo & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindBufferMemoryInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindBufferMemoryInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, buffer, memory, memoryOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindBufferMemoryInfo const & ) const = default; -#else - bool operator==( BindBufferMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( buffer == rhs.buffer ) && ( memory == rhs.memory ) && ( memoryOffset == rhs.memoryOffset ); -# endif - } - - bool operator!=( BindBufferMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindBufferMemoryInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - }; - - template <> - struct CppType - { - using Type = BindBufferMemoryInfo; - }; - using BindBufferMemoryInfoKHR = BindBufferMemoryInfo; - - struct Offset2D - { - using NativeType = VkOffset2D; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Offset2D( int32_t x_ = {}, int32_t y_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - { - } - - VULKAN_HPP_CONSTEXPR Offset2D( Offset2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Offset2D( VkOffset2D const & rhs ) VULKAN_HPP_NOEXCEPT : Offset2D( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Offset2D & operator=( Offset2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Offset2D & operator=( VkOffset2D const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Offset2D & setX( int32_t x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Offset2D & setY( int32_t y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkOffset2D const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkOffset2D &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Offset2D const & ) const = default; -#else - bool operator==( Offset2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ); -# endif - } - - bool operator!=( Offset2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - int32_t x = {}; - int32_t y = {}; - }; - - struct Rect2D - { - using NativeType = VkRect2D; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Rect2D( VULKAN_HPP_NAMESPACE::Offset2D offset_ = {}, VULKAN_HPP_NAMESPACE::Extent2D extent_ = {} ) VULKAN_HPP_NOEXCEPT - : offset( offset_ ) - , extent( extent_ ) - { - } - - VULKAN_HPP_CONSTEXPR Rect2D( Rect2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Rect2D( VkRect2D const & rhs ) VULKAN_HPP_NOEXCEPT : Rect2D( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Rect2D & operator=( Rect2D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Rect2D & operator=( VkRect2D const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Rect2D & setOffset( VULKAN_HPP_NAMESPACE::Offset2D const & offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Rect2D & setExtent( VULKAN_HPP_NAMESPACE::Extent2D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRect2D const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRect2D &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( offset, extent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Rect2D const & ) const = default; -#else - bool operator==( Rect2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( offset == rhs.offset ) && ( extent == rhs.extent ); -# endif - } - - bool operator!=( Rect2D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Offset2D offset = {}; - VULKAN_HPP_NAMESPACE::Extent2D extent = {}; - }; - - struct BindImageMemoryDeviceGroupInfo - { - using NativeType = VkBindImageMemoryDeviceGroupInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindImageMemoryDeviceGroupInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindImageMemoryDeviceGroupInfo( uint32_t deviceIndexCount_ = {}, - const uint32_t * pDeviceIndices_ = {}, - uint32_t splitInstanceBindRegionCount_ = {}, - const VULKAN_HPP_NAMESPACE::Rect2D * pSplitInstanceBindRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceIndexCount( deviceIndexCount_ ) - , pDeviceIndices( pDeviceIndices_ ) - , splitInstanceBindRegionCount( splitInstanceBindRegionCount_ ) - , pSplitInstanceBindRegions( pSplitInstanceBindRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindImageMemoryDeviceGroupInfo( BindImageMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemoryDeviceGroupInfo( VkBindImageMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BindImageMemoryDeviceGroupInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindImageMemoryDeviceGroupInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & splitInstanceBindRegions_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , deviceIndexCount( static_cast( deviceIndices_.size() ) ) - , pDeviceIndices( deviceIndices_.data() ) - , splitInstanceBindRegionCount( static_cast( splitInstanceBindRegions_.size() ) ) - , pSplitInstanceBindRegions( splitInstanceBindRegions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindImageMemoryDeviceGroupInfo & operator=( BindImageMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemoryDeviceGroupInfo & operator=( VkBindImageMemoryDeviceGroupInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryDeviceGroupInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryDeviceGroupInfo & setDeviceIndexCount( uint32_t deviceIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = deviceIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryDeviceGroupInfo & setPDeviceIndices( const uint32_t * pDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - pDeviceIndices = pDeviceIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindImageMemoryDeviceGroupInfo & - setDeviceIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndexCount = static_cast( deviceIndices_.size() ); - pDeviceIndices = deviceIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryDeviceGroupInfo & setSplitInstanceBindRegionCount( uint32_t splitInstanceBindRegionCount_ ) VULKAN_HPP_NOEXCEPT - { - splitInstanceBindRegionCount = splitInstanceBindRegionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryDeviceGroupInfo & - setPSplitInstanceBindRegions( const VULKAN_HPP_NAMESPACE::Rect2D * pSplitInstanceBindRegions_ ) VULKAN_HPP_NOEXCEPT - { - pSplitInstanceBindRegions = pSplitInstanceBindRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindImageMemoryDeviceGroupInfo & setSplitInstanceBindRegions( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & splitInstanceBindRegions_ ) VULKAN_HPP_NOEXCEPT - { - splitInstanceBindRegionCount = static_cast( splitInstanceBindRegions_.size() ); - pSplitInstanceBindRegions = splitInstanceBindRegions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindImageMemoryDeviceGroupInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindImageMemoryDeviceGroupInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceIndexCount, pDeviceIndices, splitInstanceBindRegionCount, pSplitInstanceBindRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindImageMemoryDeviceGroupInfo const & ) const = default; -#else - bool operator==( BindImageMemoryDeviceGroupInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceIndexCount == rhs.deviceIndexCount ) && ( pDeviceIndices == rhs.pDeviceIndices ) && - ( splitInstanceBindRegionCount == rhs.splitInstanceBindRegionCount ) && ( pSplitInstanceBindRegions == rhs.pSplitInstanceBindRegions ); -# endif - } - - bool operator!=( BindImageMemoryDeviceGroupInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindImageMemoryDeviceGroupInfo; - const void * pNext = {}; - uint32_t deviceIndexCount = {}; - const uint32_t * pDeviceIndices = {}; - uint32_t splitInstanceBindRegionCount = {}; - const VULKAN_HPP_NAMESPACE::Rect2D * pSplitInstanceBindRegions = {}; - }; - - template <> - struct CppType - { - using Type = BindImageMemoryDeviceGroupInfo; - }; - using BindImageMemoryDeviceGroupInfoKHR = BindImageMemoryDeviceGroupInfo; - - struct BindImageMemoryInfo - { - using NativeType = VkBindImageMemoryInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindImageMemoryInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindImageMemoryInfo( VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindImageMemoryInfo( BindImageMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemoryInfo( VkBindImageMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT : BindImageMemoryInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindImageMemoryInfo & operator=( BindImageMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemoryInfo & operator=( VkBindImageMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryInfo & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryInfo & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemoryInfo & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindImageMemoryInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindImageMemoryInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image, memory, memoryOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindImageMemoryInfo const & ) const = default; -#else - bool operator==( BindImageMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ) && ( memory == rhs.memory ) && ( memoryOffset == rhs.memoryOffset ); -# endif - } - - bool operator!=( BindImageMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindImageMemoryInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - }; - - template <> - struct CppType - { - using Type = BindImageMemoryInfo; - }; - using BindImageMemoryInfoKHR = BindImageMemoryInfo; - - struct BindImageMemorySwapchainInfoKHR - { - using NativeType = VkBindImageMemorySwapchainInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindImageMemorySwapchainInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindImageMemorySwapchainInfoKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ = {}, - uint32_t imageIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchain( swapchain_ ) - , imageIndex( imageIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindImageMemorySwapchainInfoKHR( BindImageMemorySwapchainInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemorySwapchainInfoKHR( VkBindImageMemorySwapchainInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : BindImageMemorySwapchainInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindImageMemorySwapchainInfoKHR & operator=( BindImageMemorySwapchainInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImageMemorySwapchainInfoKHR & operator=( VkBindImageMemorySwapchainInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindImageMemorySwapchainInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemorySwapchainInfoKHR & setSwapchain( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ ) VULKAN_HPP_NOEXCEPT - { - swapchain = swapchain_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImageMemorySwapchainInfoKHR & setImageIndex( uint32_t imageIndex_ ) VULKAN_HPP_NOEXCEPT - { - imageIndex = imageIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindImageMemorySwapchainInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindImageMemorySwapchainInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchain, imageIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindImageMemorySwapchainInfoKHR const & ) const = default; -#else - bool operator==( BindImageMemorySwapchainInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchain == rhs.swapchain ) && ( imageIndex == rhs.imageIndex ); -# endif - } - - bool operator!=( BindImageMemorySwapchainInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindImageMemorySwapchainInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain = {}; - uint32_t imageIndex = {}; - }; - - template <> - struct CppType - { - using Type = BindImageMemorySwapchainInfoKHR; - }; - - struct BindImagePlaneMemoryInfo - { - using NativeType = VkBindImagePlaneMemoryInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindImagePlaneMemoryInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindImagePlaneMemoryInfo( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , planeAspect( planeAspect_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindImagePlaneMemoryInfo( BindImagePlaneMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImagePlaneMemoryInfo( VkBindImagePlaneMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BindImagePlaneMemoryInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindImagePlaneMemoryInfo & operator=( BindImagePlaneMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindImagePlaneMemoryInfo & operator=( VkBindImagePlaneMemoryInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindImagePlaneMemoryInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindImagePlaneMemoryInfo & setPlaneAspect( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ ) VULKAN_HPP_NOEXCEPT - { - planeAspect = planeAspect_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindImagePlaneMemoryInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindImagePlaneMemoryInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, planeAspect ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindImagePlaneMemoryInfo const & ) const = default; -#else - bool operator==( BindImagePlaneMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( planeAspect == rhs.planeAspect ); -# endif - } - - bool operator!=( BindImagePlaneMemoryInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindImagePlaneMemoryInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor; - }; - - template <> - struct CppType - { - using Type = BindImagePlaneMemoryInfo; - }; - using BindImagePlaneMemoryInfoKHR = BindImagePlaneMemoryInfo; - - struct BindIndexBufferIndirectCommandNV - { - using NativeType = VkBindIndexBufferIndirectCommandNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - BindIndexBufferIndirectCommandNV( VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress_ = {}, - uint32_t size_ = {}, - VULKAN_HPP_NAMESPACE::IndexType indexType_ = VULKAN_HPP_NAMESPACE::IndexType::eUint16 ) VULKAN_HPP_NOEXCEPT - : bufferAddress( bufferAddress_ ) - , size( size_ ) - , indexType( indexType_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindIndexBufferIndirectCommandNV( BindIndexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindIndexBufferIndirectCommandNV( VkBindIndexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - : BindIndexBufferIndirectCommandNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindIndexBufferIndirectCommandNV & operator=( BindIndexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindIndexBufferIndirectCommandNV & operator=( VkBindIndexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindIndexBufferIndirectCommandNV & setBufferAddress( VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress_ ) VULKAN_HPP_NOEXCEPT - { - bufferAddress = bufferAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindIndexBufferIndirectCommandNV & setSize( uint32_t size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindIndexBufferIndirectCommandNV & setIndexType( VULKAN_HPP_NAMESPACE::IndexType indexType_ ) VULKAN_HPP_NOEXCEPT - { - indexType = indexType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindIndexBufferIndirectCommandNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindIndexBufferIndirectCommandNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( bufferAddress, size, indexType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindIndexBufferIndirectCommandNV const & ) const = default; -#else - bool operator==( BindIndexBufferIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( bufferAddress == rhs.bufferAddress ) && ( size == rhs.size ) && ( indexType == rhs.indexType ); -# endif - } - - bool operator!=( BindIndexBufferIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress = {}; - uint32_t size = {}; - VULKAN_HPP_NAMESPACE::IndexType indexType = VULKAN_HPP_NAMESPACE::IndexType::eUint16; - }; - - struct BindShaderGroupIndirectCommandNV - { - using NativeType = VkBindShaderGroupIndirectCommandNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindShaderGroupIndirectCommandNV( uint32_t groupIndex_ = {} ) VULKAN_HPP_NOEXCEPT : groupIndex( groupIndex_ ) {} - - VULKAN_HPP_CONSTEXPR BindShaderGroupIndirectCommandNV( BindShaderGroupIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindShaderGroupIndirectCommandNV( VkBindShaderGroupIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - : BindShaderGroupIndirectCommandNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindShaderGroupIndirectCommandNV & operator=( BindShaderGroupIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindShaderGroupIndirectCommandNV & operator=( VkBindShaderGroupIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindShaderGroupIndirectCommandNV & setGroupIndex( uint32_t groupIndex_ ) VULKAN_HPP_NOEXCEPT - { - groupIndex = groupIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindShaderGroupIndirectCommandNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindShaderGroupIndirectCommandNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( groupIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindShaderGroupIndirectCommandNV const & ) const = default; -#else - bool operator==( BindShaderGroupIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( groupIndex == rhs.groupIndex ); -# endif - } - - bool operator!=( BindShaderGroupIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t groupIndex = {}; - }; - - struct SparseMemoryBind - { - using NativeType = VkSparseMemoryBind; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseMemoryBind( VULKAN_HPP_NAMESPACE::DeviceSize resourceOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags_ = {} ) VULKAN_HPP_NOEXCEPT - : resourceOffset( resourceOffset_ ) - , size( size_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseMemoryBind( SparseMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseMemoryBind( VkSparseMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT : SparseMemoryBind( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseMemoryBind & operator=( SparseMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseMemoryBind & operator=( VkSparseMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SparseMemoryBind & setResourceOffset( VULKAN_HPP_NAMESPACE::DeviceSize resourceOffset_ ) VULKAN_HPP_NOEXCEPT - { - resourceOffset = resourceOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseMemoryBind & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseMemoryBind & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseMemoryBind & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseMemoryBind & setFlags( VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSparseMemoryBind const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseMemoryBind &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( resourceOffset, size, memory, memoryOffset, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseMemoryBind const & ) const = default; -#else - bool operator==( SparseMemoryBind const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( resourceOffset == rhs.resourceOffset ) && ( size == rhs.size ) && ( memory == rhs.memory ) && ( memoryOffset == rhs.memoryOffset ) && - ( flags == rhs.flags ); -# endif - } - - bool operator!=( SparseMemoryBind const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize resourceOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags = {}; - }; - - struct SparseBufferMemoryBindInfo - { - using NativeType = VkSparseBufferMemoryBindInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseBufferMemoryBindInfo( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - uint32_t bindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds_ = {} ) VULKAN_HPP_NOEXCEPT - : buffer( buffer_ ) - , bindCount( bindCount_ ) - , pBinds( pBinds_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseBufferMemoryBindInfo( SparseBufferMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseBufferMemoryBindInfo( VkSparseBufferMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseBufferMemoryBindInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseBufferMemoryBindInfo( VULKAN_HPP_NAMESPACE::Buffer buffer_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) - : buffer( buffer_ ), bindCount( static_cast( binds_.size() ) ), pBinds( binds_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseBufferMemoryBindInfo & operator=( SparseBufferMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseBufferMemoryBindInfo & operator=( VkSparseBufferMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SparseBufferMemoryBindInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseBufferMemoryBindInfo & setBindCount( uint32_t bindCount_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = bindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseBufferMemoryBindInfo & setPBinds( const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds_ ) VULKAN_HPP_NOEXCEPT - { - pBinds = pBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseBufferMemoryBindInfo & - setBinds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = static_cast( binds_.size() ); - pBinds = binds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSparseBufferMemoryBindInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseBufferMemoryBindInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( buffer, bindCount, pBinds ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseBufferMemoryBindInfo const & ) const = default; -#else - bool operator==( SparseBufferMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( buffer == rhs.buffer ) && ( bindCount == rhs.bindCount ) && ( pBinds == rhs.pBinds ); -# endif - } - - bool operator!=( SparseBufferMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - uint32_t bindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds = {}; - }; - - struct SparseImageOpaqueMemoryBindInfo - { - using NativeType = VkSparseImageOpaqueMemoryBindInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageOpaqueMemoryBindInfo( VULKAN_HPP_NAMESPACE::Image image_ = {}, - uint32_t bindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds_ = {} ) VULKAN_HPP_NOEXCEPT - : image( image_ ) - , bindCount( bindCount_ ) - , pBinds( pBinds_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageOpaqueMemoryBindInfo( SparseImageOpaqueMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageOpaqueMemoryBindInfo( VkSparseImageOpaqueMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageOpaqueMemoryBindInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseImageOpaqueMemoryBindInfo( VULKAN_HPP_NAMESPACE::Image image_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) - : image( image_ ), bindCount( static_cast( binds_.size() ) ), pBinds( binds_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageOpaqueMemoryBindInfo & operator=( SparseImageOpaqueMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageOpaqueMemoryBindInfo & operator=( VkSparseImageOpaqueMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SparseImageOpaqueMemoryBindInfo & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageOpaqueMemoryBindInfo & setBindCount( uint32_t bindCount_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = bindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageOpaqueMemoryBindInfo & setPBinds( const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds_ ) VULKAN_HPP_NOEXCEPT - { - pBinds = pBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseImageOpaqueMemoryBindInfo & - setBinds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = static_cast( binds_.size() ); - pBinds = binds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSparseImageOpaqueMemoryBindInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageOpaqueMemoryBindInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( image, bindCount, pBinds ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageOpaqueMemoryBindInfo const & ) const = default; -#else - bool operator==( SparseImageOpaqueMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( image == rhs.image ) && ( bindCount == rhs.bindCount ) && ( pBinds == rhs.pBinds ); -# endif - } - - bool operator!=( SparseImageOpaqueMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Image image = {}; - uint32_t bindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseMemoryBind * pBinds = {}; - }; - - struct ImageSubresource - { - using NativeType = VkImageSubresource; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ImageSubresource( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, uint32_t mipLevel_ = {}, uint32_t arrayLayer_ = {} ) VULKAN_HPP_NOEXCEPT - : aspectMask( aspectMask_ ) - , mipLevel( mipLevel_ ) - , arrayLayer( arrayLayer_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSubresource( ImageSubresource const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresource( VkImageSubresource const & rhs ) VULKAN_HPP_NOEXCEPT : ImageSubresource( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSubresource & operator=( ImageSubresource const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresource & operator=( VkImageSubresource const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSubresource & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresource & setMipLevel( uint32_t mipLevel_ ) VULKAN_HPP_NOEXCEPT - { - mipLevel = mipLevel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresource & setArrayLayer( uint32_t arrayLayer_ ) VULKAN_HPP_NOEXCEPT - { - arrayLayer = arrayLayer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSubresource const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSubresource &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( aspectMask, mipLevel, arrayLayer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSubresource const & ) const = default; -#else - bool operator==( ImageSubresource const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( aspectMask == rhs.aspectMask ) && ( mipLevel == rhs.mipLevel ) && ( arrayLayer == rhs.arrayLayer ); -# endif - } - - bool operator!=( ImageSubresource const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - uint32_t mipLevel = {}; - uint32_t arrayLayer = {}; - }; - - struct Offset3D - { - using NativeType = VkOffset3D; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Offset3D( int32_t x_ = {}, int32_t y_ = {}, int32_t z_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - , z( z_ ) - { - } - - VULKAN_HPP_CONSTEXPR Offset3D( Offset3D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Offset3D( VkOffset3D const & rhs ) VULKAN_HPP_NOEXCEPT : Offset3D( *reinterpret_cast( &rhs ) ) {} - - explicit Offset3D( Offset2D const & offset2D, int32_t z_ = {} ) : x( offset2D.x ), y( offset2D.y ), z( z_ ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Offset3D & operator=( Offset3D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Offset3D & operator=( VkOffset3D const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Offset3D & setX( int32_t x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Offset3D & setY( int32_t y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Offset3D & setZ( int32_t z_ ) VULKAN_HPP_NOEXCEPT - { - z = z_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkOffset3D const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkOffset3D &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y, z ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Offset3D const & ) const = default; -#else - bool operator==( Offset3D const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ) && ( z == rhs.z ); -# endif - } - - bool operator!=( Offset3D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - int32_t x = {}; - int32_t y = {}; - int32_t z = {}; - }; - - struct Extent3D - { - using NativeType = VkExtent3D; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Extent3D( uint32_t width_ = {}, uint32_t height_ = {}, uint32_t depth_ = {} ) VULKAN_HPP_NOEXCEPT - : width( width_ ) - , height( height_ ) - , depth( depth_ ) - { - } - - VULKAN_HPP_CONSTEXPR Extent3D( Extent3D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Extent3D( VkExtent3D const & rhs ) VULKAN_HPP_NOEXCEPT : Extent3D( *reinterpret_cast( &rhs ) ) {} - - explicit Extent3D( Extent2D const & extent2D, uint32_t depth_ = {} ) : width( extent2D.width ), height( extent2D.height ), depth( depth_ ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Extent3D & operator=( Extent3D const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Extent3D & operator=( VkExtent3D const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Extent3D & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Extent3D & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Extent3D & setDepth( uint32_t depth_ ) VULKAN_HPP_NOEXCEPT - { - depth = depth_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExtent3D const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExtent3D &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( width, height, depth ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Extent3D const & ) const = default; -#else - bool operator==( Extent3D const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( width == rhs.width ) && ( height == rhs.height ) && ( depth == rhs.depth ); -# endif - } - - bool operator!=( Extent3D const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t width = {}; - uint32_t height = {}; - uint32_t depth = {}; - }; - - struct SparseImageMemoryBind - { - using NativeType = VkSparseImageMemoryBind; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageMemoryBind( VULKAN_HPP_NAMESPACE::ImageSubresource subresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D offset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags_ = {} ) VULKAN_HPP_NOEXCEPT - : subresource( subresource_ ) - , offset( offset_ ) - , extent( extent_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageMemoryBind( SparseImageMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryBind( VkSparseImageMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageMemoryBind( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageMemoryBind & operator=( SparseImageMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryBind & operator=( VkSparseImageMemoryBind const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setSubresource( VULKAN_HPP_NAMESPACE::ImageSubresource const & subresource_ ) VULKAN_HPP_NOEXCEPT - { - subresource = subresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setOffset( VULKAN_HPP_NAMESPACE::Offset3D const & offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBind & setFlags( VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSparseImageMemoryBind const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageMemoryBind &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( subresource, offset, extent, memory, memoryOffset, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageMemoryBind const & ) const = default; -#else - bool operator==( SparseImageMemoryBind const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( subresource == rhs.subresource ) && ( offset == rhs.offset ) && ( extent == rhs.extent ) && ( memory == rhs.memory ) && - ( memoryOffset == rhs.memoryOffset ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( SparseImageMemoryBind const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageSubresource subresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D offset = {}; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - VULKAN_HPP_NAMESPACE::SparseMemoryBindFlags flags = {}; - }; - - struct SparseImageMemoryBindInfo - { - using NativeType = VkSparseImageMemoryBindInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageMemoryBindInfo( VULKAN_HPP_NAMESPACE::Image image_ = {}, - uint32_t bindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseImageMemoryBind * pBinds_ = {} ) VULKAN_HPP_NOEXCEPT - : image( image_ ) - , bindCount( bindCount_ ) - , pBinds( pBinds_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageMemoryBindInfo( SparseImageMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryBindInfo( VkSparseImageMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageMemoryBindInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseImageMemoryBindInfo( VULKAN_HPP_NAMESPACE::Image image_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) - : image( image_ ), bindCount( static_cast( binds_.size() ) ), pBinds( binds_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageMemoryBindInfo & operator=( SparseImageMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryBindInfo & operator=( VkSparseImageMemoryBindInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBindInfo & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBindInfo & setBindCount( uint32_t bindCount_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = bindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SparseImageMemoryBindInfo & setPBinds( const VULKAN_HPP_NAMESPACE::SparseImageMemoryBind * pBinds_ ) VULKAN_HPP_NOEXCEPT - { - pBinds = pBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SparseImageMemoryBindInfo & - setBinds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & binds_ ) VULKAN_HPP_NOEXCEPT - { - bindCount = static_cast( binds_.size() ); - pBinds = binds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSparseImageMemoryBindInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageMemoryBindInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( image, bindCount, pBinds ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageMemoryBindInfo const & ) const = default; -#else - bool operator==( SparseImageMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( image == rhs.image ) && ( bindCount == rhs.bindCount ) && ( pBinds == rhs.pBinds ); -# endif - } - - bool operator!=( SparseImageMemoryBindInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Image image = {}; - uint32_t bindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseImageMemoryBind * pBinds = {}; - }; - - struct BindSparseInfo - { - using NativeType = VkBindSparseInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindSparseInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindSparseInfo( uint32_t waitSemaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ = {}, - uint32_t bufferBindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseBufferMemoryBindInfo * pBufferBinds_ = {}, - uint32_t imageOpaqueBindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds_ = {}, - uint32_t imageBindCount_ = {}, - const VULKAN_HPP_NAMESPACE::SparseImageMemoryBindInfo * pImageBinds_ = {}, - uint32_t signalSemaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphores( pWaitSemaphores_ ) - , bufferBindCount( bufferBindCount_ ) - , pBufferBinds( pBufferBinds_ ) - , imageOpaqueBindCount( imageOpaqueBindCount_ ) - , pImageOpaqueBinds( pImageOpaqueBinds_ ) - , imageBindCount( imageBindCount_ ) - , pImageBinds( pImageBinds_ ) - , signalSemaphoreCount( signalSemaphoreCount_ ) - , pSignalSemaphores( pSignalSemaphores_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindSparseInfo( BindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindSparseInfo( VkBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT : BindSparseInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferBinds_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageOpaqueBinds_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageBinds_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphores_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreCount( static_cast( waitSemaphores_.size() ) ) - , pWaitSemaphores( waitSemaphores_.data() ) - , bufferBindCount( static_cast( bufferBinds_.size() ) ) - , pBufferBinds( bufferBinds_.data() ) - , imageOpaqueBindCount( static_cast( imageOpaqueBinds_.size() ) ) - , pImageOpaqueBinds( imageOpaqueBinds_.data() ) - , imageBindCount( static_cast( imageBinds_.size() ) ) - , pImageBinds( imageBinds_.data() ) - , signalSemaphoreCount( static_cast( signalSemaphores_.size() ) ) - , pSignalSemaphores( signalSemaphores_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindSparseInfo & operator=( BindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindSparseInfo & operator=( VkBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setPWaitSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphores = pWaitSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo & - setWaitSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = static_cast( waitSemaphores_.size() ); - pWaitSemaphores = waitSemaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setBufferBindCount( uint32_t bufferBindCount_ ) VULKAN_HPP_NOEXCEPT - { - bufferBindCount = bufferBindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setPBufferBinds( const VULKAN_HPP_NAMESPACE::SparseBufferMemoryBindInfo * pBufferBinds_ ) VULKAN_HPP_NOEXCEPT - { - pBufferBinds = pBufferBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo & setBufferBinds( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferBinds_ ) VULKAN_HPP_NOEXCEPT - { - bufferBindCount = static_cast( bufferBinds_.size() ); - pBufferBinds = bufferBinds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setImageOpaqueBindCount( uint32_t imageOpaqueBindCount_ ) VULKAN_HPP_NOEXCEPT - { - imageOpaqueBindCount = imageOpaqueBindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & - setPImageOpaqueBinds( const VULKAN_HPP_NAMESPACE::SparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds_ ) VULKAN_HPP_NOEXCEPT - { - pImageOpaqueBinds = pImageOpaqueBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo & setImageOpaqueBinds( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageOpaqueBinds_ ) VULKAN_HPP_NOEXCEPT - { - imageOpaqueBindCount = static_cast( imageOpaqueBinds_.size() ); - pImageOpaqueBinds = imageOpaqueBinds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setImageBindCount( uint32_t imageBindCount_ ) VULKAN_HPP_NOEXCEPT - { - imageBindCount = imageBindCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setPImageBinds( const VULKAN_HPP_NAMESPACE::SparseImageMemoryBindInfo * pImageBinds_ ) VULKAN_HPP_NOEXCEPT - { - pImageBinds = pImageBinds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo & setImageBinds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageBinds_ ) - VULKAN_HPP_NOEXCEPT - { - imageBindCount = static_cast( imageBinds_.size() ); - pImageBinds = imageBinds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = signalSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindSparseInfo & setPSignalSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphores = pSignalSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BindSparseInfo & - setSignalSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = static_cast( signalSemaphores_.size() ); - pSignalSemaphores = signalSemaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindSparseInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindSparseInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - waitSemaphoreCount, - pWaitSemaphores, - bufferBindCount, - pBufferBinds, - imageOpaqueBindCount, - pImageOpaqueBinds, - imageBindCount, - pImageBinds, - signalSemaphoreCount, - pSignalSemaphores ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindSparseInfo const & ) const = default; -#else - bool operator==( BindSparseInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) && - ( pWaitSemaphores == rhs.pWaitSemaphores ) && ( bufferBindCount == rhs.bufferBindCount ) && ( pBufferBinds == rhs.pBufferBinds ) && - ( imageOpaqueBindCount == rhs.imageOpaqueBindCount ) && ( pImageOpaqueBinds == rhs.pImageOpaqueBinds ) && - ( imageBindCount == rhs.imageBindCount ) && ( pImageBinds == rhs.pImageBinds ) && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) && - ( pSignalSemaphores == rhs.pSignalSemaphores ); -# endif - } - - bool operator!=( BindSparseInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindSparseInfo; - const void * pNext = {}; - uint32_t waitSemaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores = {}; - uint32_t bufferBindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseBufferMemoryBindInfo * pBufferBinds = {}; - uint32_t imageOpaqueBindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds = {}; - uint32_t imageBindCount = {}; - const VULKAN_HPP_NAMESPACE::SparseImageMemoryBindInfo * pImageBinds = {}; - uint32_t signalSemaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores = {}; - }; - - template <> - struct CppType - { - using Type = BindSparseInfo; - }; - - struct BindVertexBufferIndirectCommandNV - { - using NativeType = VkBindVertexBufferIndirectCommandNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindVertexBufferIndirectCommandNV( VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress_ = {}, - uint32_t size_ = {}, - uint32_t stride_ = {} ) VULKAN_HPP_NOEXCEPT - : bufferAddress( bufferAddress_ ) - , size( size_ ) - , stride( stride_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindVertexBufferIndirectCommandNV( BindVertexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindVertexBufferIndirectCommandNV( VkBindVertexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - : BindVertexBufferIndirectCommandNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindVertexBufferIndirectCommandNV & operator=( BindVertexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindVertexBufferIndirectCommandNV & operator=( VkBindVertexBufferIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindVertexBufferIndirectCommandNV & setBufferAddress( VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress_ ) VULKAN_HPP_NOEXCEPT - { - bufferAddress = bufferAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVertexBufferIndirectCommandNV & setSize( uint32_t size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVertexBufferIndirectCommandNV & setStride( uint32_t stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindVertexBufferIndirectCommandNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindVertexBufferIndirectCommandNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( bufferAddress, size, stride ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindVertexBufferIndirectCommandNV const & ) const = default; -#else - bool operator==( BindVertexBufferIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( bufferAddress == rhs.bufferAddress ) && ( size == rhs.size ) && ( stride == rhs.stride ); -# endif - } - - bool operator!=( BindVertexBufferIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceAddress bufferAddress = {}; - uint32_t size = {}; - uint32_t stride = {}; - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct BindVideoSessionMemoryInfoKHR - { - using NativeType = VkBindVideoSessionMemoryInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBindVideoSessionMemoryInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BindVideoSessionMemoryInfoKHR( uint32_t memoryBindIndex_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize memorySize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryBindIndex( memoryBindIndex_ ) - , memory( memory_ ) - , memoryOffset( memoryOffset_ ) - , memorySize( memorySize_ ) - { - } - - VULKAN_HPP_CONSTEXPR BindVideoSessionMemoryInfoKHR( BindVideoSessionMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindVideoSessionMemoryInfoKHR( VkBindVideoSessionMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : BindVideoSessionMemoryInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BindVideoSessionMemoryInfoKHR & operator=( BindVideoSessionMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BindVideoSessionMemoryInfoKHR & operator=( VkBindVideoSessionMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BindVideoSessionMemoryInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVideoSessionMemoryInfoKHR & setMemoryBindIndex( uint32_t memoryBindIndex_ ) VULKAN_HPP_NOEXCEPT - { - memoryBindIndex = memoryBindIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVideoSessionMemoryInfoKHR & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVideoSessionMemoryInfoKHR & setMemoryOffset( VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset_ ) VULKAN_HPP_NOEXCEPT - { - memoryOffset = memoryOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BindVideoSessionMemoryInfoKHR & setMemorySize( VULKAN_HPP_NAMESPACE::DeviceSize memorySize_ ) VULKAN_HPP_NOEXCEPT - { - memorySize = memorySize_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBindVideoSessionMemoryInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBindVideoSessionMemoryInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryBindIndex, memory, memoryOffset, memorySize ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BindVideoSessionMemoryInfoKHR const & ) const = default; -# else - bool operator==( BindVideoSessionMemoryInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryBindIndex == rhs.memoryBindIndex ) && ( memory == rhs.memory ) && - ( memoryOffset == rhs.memoryOffset ) && ( memorySize == rhs.memorySize ); -# endif - } - - bool operator!=( BindVideoSessionMemoryInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBindVideoSessionMemoryInfoKHR; - const void * pNext = {}; - uint32_t memoryBindIndex = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memoryOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize memorySize = {}; - }; - - template <> - struct CppType - { - using Type = BindVideoSessionMemoryInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - struct ImageSubresourceLayers - { - using NativeType = VkImageSubresourceLayers; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageSubresourceLayers( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, - uint32_t mipLevel_ = {}, - uint32_t baseArrayLayer_ = {}, - uint32_t layerCount_ = {} ) VULKAN_HPP_NOEXCEPT - : aspectMask( aspectMask_ ) - , mipLevel( mipLevel_ ) - , baseArrayLayer( baseArrayLayer_ ) - , layerCount( layerCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSubresourceLayers( ImageSubresourceLayers const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresourceLayers( VkImageSubresourceLayers const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageSubresourceLayers( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSubresourceLayers & operator=( ImageSubresourceLayers const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresourceLayers & operator=( VkImageSubresourceLayers const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceLayers & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceLayers & setMipLevel( uint32_t mipLevel_ ) VULKAN_HPP_NOEXCEPT - { - mipLevel = mipLevel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceLayers & setBaseArrayLayer( uint32_t baseArrayLayer_ ) VULKAN_HPP_NOEXCEPT - { - baseArrayLayer = baseArrayLayer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceLayers & setLayerCount( uint32_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSubresourceLayers const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSubresourceLayers &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( aspectMask, mipLevel, baseArrayLayer, layerCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSubresourceLayers const & ) const = default; -#else - bool operator==( ImageSubresourceLayers const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( aspectMask == rhs.aspectMask ) && ( mipLevel == rhs.mipLevel ) && ( baseArrayLayer == rhs.baseArrayLayer ) && ( layerCount == rhs.layerCount ); -# endif - } - - bool operator!=( ImageSubresourceLayers const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - uint32_t mipLevel = {}; - uint32_t baseArrayLayer = {}; - uint32_t layerCount = {}; - }; - - struct ImageBlit2 - { - using NativeType = VkImageBlit2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageBlit2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ImageBlit2( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - std::array const & srcOffsets_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - std::array const & dstOffsets_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcSubresource( srcSubresource_ ) - , srcOffsets( srcOffsets_ ) - , dstSubresource( dstSubresource_ ) - , dstOffsets( dstOffsets_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit2( ImageBlit2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageBlit2( VkImageBlit2 const & rhs ) VULKAN_HPP_NOEXCEPT : ImageBlit2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageBlit2 & operator=( ImageBlit2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageBlit2 & operator=( VkImageBlit2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageBlit2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit2 & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit2 & setSrcOffsets( std::array const & srcOffsets_ ) VULKAN_HPP_NOEXCEPT - { - srcOffsets = srcOffsets_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit2 & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit2 & setDstOffsets( std::array const & dstOffsets_ ) VULKAN_HPP_NOEXCEPT - { - dstOffsets = dstOffsets_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageBlit2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageBlit2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcSubresource, srcOffsets, dstSubresource, dstOffsets ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageBlit2 const & ) const = default; -#else - bool operator==( ImageBlit2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcSubresource == rhs.srcSubresource ) && ( srcOffsets == rhs.srcOffsets ) && - ( dstSubresource == rhs.dstSubresource ) && ( dstOffsets == rhs.dstOffsets ); -# endif - } - - bool operator!=( ImageBlit2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageBlit2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D srcOffsets = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D dstOffsets = {}; - }; - - template <> - struct CppType - { - using Type = ImageBlit2; - }; - using ImageBlit2KHR = ImageBlit2; - - struct BlitImageInfo2 - { - using NativeType = VkBlitImageInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBlitImageInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::Image dstImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageBlit2 * pRegions_ = {}, - VULKAN_HPP_NAMESPACE::Filter filter_ = VULKAN_HPP_NAMESPACE::Filter::eNearest, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - , filter( filter_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2( BlitImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BlitImageInfo2( VkBlitImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : BlitImageInfo2( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BlitImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_, - VULKAN_HPP_NAMESPACE::Image dstImage_, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - VULKAN_HPP_NAMESPACE::Filter filter_ = VULKAN_HPP_NAMESPACE::Filter::eNearest, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( static_cast( regions_.size() ) ) - , pRegions( regions_.data() ) - , filter( filter_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BlitImageInfo2 & operator=( BlitImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BlitImageInfo2 & operator=( VkBlitImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setSrcImage( VULKAN_HPP_NAMESPACE::Image srcImage_ ) VULKAN_HPP_NOEXCEPT - { - srcImage = srcImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setSrcImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - srcImageLayout = srcImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setDstImage( VULKAN_HPP_NAMESPACE::Image dstImage_ ) VULKAN_HPP_NOEXCEPT - { - dstImage = dstImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setDstImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - dstImageLayout = dstImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::ImageBlit2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BlitImageInfo2 & setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 BlitImageInfo2 & setFilter( VULKAN_HPP_NAMESPACE::Filter filter_ ) VULKAN_HPP_NOEXCEPT - { - filter = filter_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBlitImageInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBlitImageInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions, filter ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BlitImageInfo2 const & ) const = default; -#else - bool operator==( BlitImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcImage == rhs.srcImage ) && ( srcImageLayout == rhs.srcImageLayout ) && - ( dstImage == rhs.dstImage ) && ( dstImageLayout == rhs.dstImageLayout ) && ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ) && - ( filter == rhs.filter ); -# endif - } - - bool operator!=( BlitImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBlitImageInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image srcImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::Image dstImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::ImageBlit2 * pRegions = {}; - VULKAN_HPP_NAMESPACE::Filter filter = VULKAN_HPP_NAMESPACE::Filter::eNearest; - }; - - template <> - struct CppType - { - using Type = BlitImageInfo2; - }; - using BlitImageInfo2KHR = BlitImageInfo2; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferCollectionBufferCreateInfoFUCHSIA - { - using NativeType = VkBufferCollectionBufferCreateInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCollectionBufferCreateInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCollectionBufferCreateInfoFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ = {}, - uint32_t index_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , collection( collection_ ) - , index( index_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCollectionBufferCreateInfoFUCHSIA( BufferCollectionBufferCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionBufferCreateInfoFUCHSIA( VkBufferCollectionBufferCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferCollectionBufferCreateInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCollectionBufferCreateInfoFUCHSIA & operator=( BufferCollectionBufferCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionBufferCreateInfoFUCHSIA & operator=( VkBufferCollectionBufferCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCollectionBufferCreateInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionBufferCreateInfoFUCHSIA & - setCollection( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ ) VULKAN_HPP_NOEXCEPT - { - collection = collection_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionBufferCreateInfoFUCHSIA & setIndex( uint32_t index_ ) VULKAN_HPP_NOEXCEPT - { - index = index_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCollectionBufferCreateInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCollectionBufferCreateInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, collection, index ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCollectionBufferCreateInfoFUCHSIA const & ) const = default; -# else - bool operator==( BufferCollectionBufferCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( collection == rhs.collection ) && ( index == rhs.index ); -# endif - } - - bool operator!=( BufferCollectionBufferCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCollectionBufferCreateInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection = {}; - uint32_t index = {}; - }; - - template <> - struct CppType - { - using Type = BufferCollectionBufferCreateInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferCollectionConstraintsInfoFUCHSIA - { - using NativeType = VkBufferCollectionConstraintsInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCollectionConstraintsInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCollectionConstraintsInfoFUCHSIA( uint32_t minBufferCount_ = {}, - uint32_t maxBufferCount_ = {}, - uint32_t minBufferCountForCamping_ = {}, - uint32_t minBufferCountForDedicatedSlack_ = {}, - uint32_t minBufferCountForSharedSlack_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minBufferCount( minBufferCount_ ) - , maxBufferCount( maxBufferCount_ ) - , minBufferCountForCamping( minBufferCountForCamping_ ) - , minBufferCountForDedicatedSlack( minBufferCountForDedicatedSlack_ ) - , minBufferCountForSharedSlack( minBufferCountForSharedSlack_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCollectionConstraintsInfoFUCHSIA( BufferCollectionConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionConstraintsInfoFUCHSIA( VkBufferCollectionConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferCollectionConstraintsInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCollectionConstraintsInfoFUCHSIA & operator=( BufferCollectionConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionConstraintsInfoFUCHSIA & operator=( VkBufferCollectionConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & setMinBufferCount( uint32_t minBufferCount_ ) VULKAN_HPP_NOEXCEPT - { - minBufferCount = minBufferCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & setMaxBufferCount( uint32_t maxBufferCount_ ) VULKAN_HPP_NOEXCEPT - { - maxBufferCount = maxBufferCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & setMinBufferCountForCamping( uint32_t minBufferCountForCamping_ ) VULKAN_HPP_NOEXCEPT - { - minBufferCountForCamping = minBufferCountForCamping_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & - setMinBufferCountForDedicatedSlack( uint32_t minBufferCountForDedicatedSlack_ ) VULKAN_HPP_NOEXCEPT - { - minBufferCountForDedicatedSlack = minBufferCountForDedicatedSlack_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionConstraintsInfoFUCHSIA & - setMinBufferCountForSharedSlack( uint32_t minBufferCountForSharedSlack_ ) VULKAN_HPP_NOEXCEPT - { - minBufferCountForSharedSlack = minBufferCountForSharedSlack_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCollectionConstraintsInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCollectionConstraintsInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minBufferCount, maxBufferCount, minBufferCountForCamping, minBufferCountForDedicatedSlack, minBufferCountForSharedSlack ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCollectionConstraintsInfoFUCHSIA const & ) const = default; -# else - bool operator==( BufferCollectionConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minBufferCount == rhs.minBufferCount ) && ( maxBufferCount == rhs.maxBufferCount ) && - ( minBufferCountForCamping == rhs.minBufferCountForCamping ) && ( minBufferCountForDedicatedSlack == rhs.minBufferCountForDedicatedSlack ) && - ( minBufferCountForSharedSlack == rhs.minBufferCountForSharedSlack ); -# endif - } - - bool operator!=( BufferCollectionConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCollectionConstraintsInfoFUCHSIA; - const void * pNext = {}; - uint32_t minBufferCount = {}; - uint32_t maxBufferCount = {}; - uint32_t minBufferCountForCamping = {}; - uint32_t minBufferCountForDedicatedSlack = {}; - uint32_t minBufferCountForSharedSlack = {}; - }; - - template <> - struct CppType - { - using Type = BufferCollectionConstraintsInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferCollectionCreateInfoFUCHSIA - { - using NativeType = VkBufferCollectionCreateInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCollectionCreateInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCollectionCreateInfoFUCHSIA( zx_handle_t collectionToken_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , collectionToken( collectionToken_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCollectionCreateInfoFUCHSIA( BufferCollectionCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionCreateInfoFUCHSIA( VkBufferCollectionCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferCollectionCreateInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCollectionCreateInfoFUCHSIA & operator=( BufferCollectionCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionCreateInfoFUCHSIA & operator=( VkBufferCollectionCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCollectionCreateInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionCreateInfoFUCHSIA & setCollectionToken( zx_handle_t collectionToken_ ) VULKAN_HPP_NOEXCEPT - { - collectionToken = collectionToken_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCollectionCreateInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCollectionCreateInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, collectionToken ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( BufferCollectionCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &collectionToken, &rhs.collectionToken, sizeof( zx_handle_t ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( BufferCollectionCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &collectionToken, &rhs.collectionToken, sizeof( zx_handle_t ) ) == 0 ); - } - - bool operator!=( BufferCollectionCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCollectionCreateInfoFUCHSIA; - const void * pNext = {}; - zx_handle_t collectionToken = {}; - }; - - template <> - struct CppType - { - using Type = BufferCollectionCreateInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferCollectionImageCreateInfoFUCHSIA - { - using NativeType = VkBufferCollectionImageCreateInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCollectionImageCreateInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCollectionImageCreateInfoFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ = {}, - uint32_t index_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , collection( collection_ ) - , index( index_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCollectionImageCreateInfoFUCHSIA( BufferCollectionImageCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionImageCreateInfoFUCHSIA( VkBufferCollectionImageCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferCollectionImageCreateInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCollectionImageCreateInfoFUCHSIA & operator=( BufferCollectionImageCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionImageCreateInfoFUCHSIA & operator=( VkBufferCollectionImageCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCollectionImageCreateInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionImageCreateInfoFUCHSIA & - setCollection( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ ) VULKAN_HPP_NOEXCEPT - { - collection = collection_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionImageCreateInfoFUCHSIA & setIndex( uint32_t index_ ) VULKAN_HPP_NOEXCEPT - { - index = index_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCollectionImageCreateInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCollectionImageCreateInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, collection, index ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCollectionImageCreateInfoFUCHSIA const & ) const = default; -# else - bool operator==( BufferCollectionImageCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( collection == rhs.collection ) && ( index == rhs.index ); -# endif - } - - bool operator!=( BufferCollectionImageCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCollectionImageCreateInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection = {}; - uint32_t index = {}; - }; - - template <> - struct CppType - { - using Type = BufferCollectionImageCreateInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct SysmemColorSpaceFUCHSIA - { - using NativeType = VkSysmemColorSpaceFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSysmemColorSpaceFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SysmemColorSpaceFUCHSIA( uint32_t colorSpace_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , colorSpace( colorSpace_ ) - { - } - - VULKAN_HPP_CONSTEXPR SysmemColorSpaceFUCHSIA( SysmemColorSpaceFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SysmemColorSpaceFUCHSIA( VkSysmemColorSpaceFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : SysmemColorSpaceFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SysmemColorSpaceFUCHSIA & operator=( SysmemColorSpaceFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SysmemColorSpaceFUCHSIA & operator=( VkSysmemColorSpaceFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SysmemColorSpaceFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SysmemColorSpaceFUCHSIA & setColorSpace( uint32_t colorSpace_ ) VULKAN_HPP_NOEXCEPT - { - colorSpace = colorSpace_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSysmemColorSpaceFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSysmemColorSpaceFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, colorSpace ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SysmemColorSpaceFUCHSIA const & ) const = default; -# else - bool operator==( SysmemColorSpaceFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( colorSpace == rhs.colorSpace ); -# endif - } - - bool operator!=( SysmemColorSpaceFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSysmemColorSpaceFUCHSIA; - const void * pNext = {}; - uint32_t colorSpace = {}; - }; - - template <> - struct CppType - { - using Type = SysmemColorSpaceFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferCollectionPropertiesFUCHSIA - { - using NativeType = VkBufferCollectionPropertiesFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCollectionPropertiesFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCollectionPropertiesFUCHSIA( - uint32_t memoryTypeBits_ = {}, - uint32_t bufferCount_ = {}, - uint32_t createInfoIndex_ = {}, - uint64_t sysmemPixelFormat_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags formatFeatures_ = {}, - VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA sysmemColorSpaceIndex_ = {}, - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents_ = {}, - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity, - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryTypeBits( memoryTypeBits_ ) - , bufferCount( bufferCount_ ) - , createInfoIndex( createInfoIndex_ ) - , sysmemPixelFormat( sysmemPixelFormat_ ) - , formatFeatures( formatFeatures_ ) - , sysmemColorSpaceIndex( sysmemColorSpaceIndex_ ) - , samplerYcbcrConversionComponents( samplerYcbcrConversionComponents_ ) - , suggestedYcbcrModel( suggestedYcbcrModel_ ) - , suggestedYcbcrRange( suggestedYcbcrRange_ ) - , suggestedXChromaOffset( suggestedXChromaOffset_ ) - , suggestedYChromaOffset( suggestedYChromaOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCollectionPropertiesFUCHSIA( BufferCollectionPropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionPropertiesFUCHSIA( VkBufferCollectionPropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferCollectionPropertiesFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCollectionPropertiesFUCHSIA & operator=( BufferCollectionPropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCollectionPropertiesFUCHSIA & operator=( VkBufferCollectionPropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & setMemoryTypeBits( uint32_t memoryTypeBits_ ) VULKAN_HPP_NOEXCEPT - { - memoryTypeBits = memoryTypeBits_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & setBufferCount( uint32_t bufferCount_ ) VULKAN_HPP_NOEXCEPT - { - bufferCount = bufferCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & setCreateInfoIndex( uint32_t createInfoIndex_ ) VULKAN_HPP_NOEXCEPT - { - createInfoIndex = createInfoIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & setSysmemPixelFormat( uint64_t sysmemPixelFormat_ ) VULKAN_HPP_NOEXCEPT - { - sysmemPixelFormat = sysmemPixelFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setFormatFeatures( VULKAN_HPP_NAMESPACE::FormatFeatureFlags formatFeatures_ ) VULKAN_HPP_NOEXCEPT - { - formatFeatures = formatFeatures_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSysmemColorSpaceIndex( VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA const & sysmemColorSpaceIndex_ ) VULKAN_HPP_NOEXCEPT - { - sysmemColorSpaceIndex = sysmemColorSpaceIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSamplerYcbcrConversionComponents( VULKAN_HPP_NAMESPACE::ComponentMapping const & samplerYcbcrConversionComponents_ ) VULKAN_HPP_NOEXCEPT - { - samplerYcbcrConversionComponents = samplerYcbcrConversionComponents_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSuggestedYcbcrModel( VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel_ ) VULKAN_HPP_NOEXCEPT - { - suggestedYcbcrModel = suggestedYcbcrModel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSuggestedYcbcrRange( VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange_ ) VULKAN_HPP_NOEXCEPT - { - suggestedYcbcrRange = suggestedYcbcrRange_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSuggestedXChromaOffset( VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset_ ) VULKAN_HPP_NOEXCEPT - { - suggestedXChromaOffset = suggestedXChromaOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCollectionPropertiesFUCHSIA & - setSuggestedYChromaOffset( VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset_ ) VULKAN_HPP_NOEXCEPT - { - suggestedYChromaOffset = suggestedYChromaOffset_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCollectionPropertiesFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCollectionPropertiesFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - memoryTypeBits, - bufferCount, - createInfoIndex, - sysmemPixelFormat, - formatFeatures, - sysmemColorSpaceIndex, - samplerYcbcrConversionComponents, - suggestedYcbcrModel, - suggestedYcbcrRange, - suggestedXChromaOffset, - suggestedYChromaOffset ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCollectionPropertiesFUCHSIA const & ) const = default; -# else - bool operator==( BufferCollectionPropertiesFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryTypeBits == rhs.memoryTypeBits ) && ( bufferCount == rhs.bufferCount ) && - ( createInfoIndex == rhs.createInfoIndex ) && ( sysmemPixelFormat == rhs.sysmemPixelFormat ) && ( formatFeatures == rhs.formatFeatures ) && - ( sysmemColorSpaceIndex == rhs.sysmemColorSpaceIndex ) && ( samplerYcbcrConversionComponents == rhs.samplerYcbcrConversionComponents ) && - ( suggestedYcbcrModel == rhs.suggestedYcbcrModel ) && ( suggestedYcbcrRange == rhs.suggestedYcbcrRange ) && - ( suggestedXChromaOffset == rhs.suggestedXChromaOffset ) && ( suggestedYChromaOffset == rhs.suggestedYChromaOffset ); -# endif - } - - bool operator!=( BufferCollectionPropertiesFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCollectionPropertiesFUCHSIA; - void * pNext = {}; - uint32_t memoryTypeBits = {}; - uint32_t bufferCount = {}; - uint32_t createInfoIndex = {}; - uint64_t sysmemPixelFormat = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags formatFeatures = {}; - VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA sysmemColorSpaceIndex = {}; - VULKAN_HPP_NAMESPACE::ComponentMapping samplerYcbcrConversionComponents = {}; - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion suggestedYcbcrModel = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity; - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange suggestedYcbcrRange = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedXChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - VULKAN_HPP_NAMESPACE::ChromaLocation suggestedYChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - }; - - template <> - struct CppType - { - using Type = BufferCollectionPropertiesFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct BufferCreateInfo - { - using NativeType = VkBufferCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCreateInfo( VULKAN_HPP_NAMESPACE::BufferCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::BufferUsageFlags usage_ = {}, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive, - uint32_t queueFamilyIndexCount_ = {}, - const uint32_t * pQueueFamilyIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , size( size_ ) - , usage( usage_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCreateInfo( BufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCreateInfo( VkBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : BufferCreateInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BufferCreateInfo( VULKAN_HPP_NAMESPACE::BufferCreateFlags flags_, - VULKAN_HPP_NAMESPACE::DeviceSize size_, - VULKAN_HPP_NAMESPACE::BufferUsageFlags usage_, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , size( size_ ) - , usage( usage_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( static_cast( queueFamilyIndices_.size() ) ) - , pQueueFamilyIndices( queueFamilyIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCreateInfo & operator=( BufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCreateInfo & operator=( VkBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::BufferCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setUsage( VULKAN_HPP_NAMESPACE::BufferUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setSharingMode( VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ ) VULKAN_HPP_NOEXCEPT - { - sharingMode = sharingMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCreateInfo & setPQueueFamilyIndices( const uint32_t * pQueueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - BufferCreateInfo & setQueueFamilyIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = static_cast( queueFamilyIndices_.size() ); - pQueueFamilyIndices = queueFamilyIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, size, usage, sharingMode, queueFamilyIndexCount, pQueueFamilyIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCreateInfo const & ) const = default; -#else - bool operator==( BufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( size == rhs.size ) && ( usage == rhs.usage ) && - ( sharingMode == rhs.sharingMode ) && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ); -# endif - } - - bool operator!=( BufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::BufferUsageFlags usage = {}; - VULKAN_HPP_NAMESPACE::SharingMode sharingMode = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive; - uint32_t queueFamilyIndexCount = {}; - const uint32_t * pQueueFamilyIndices = {}; - }; - - template <> - struct CppType - { - using Type = BufferCreateInfo; - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct BufferConstraintsInfoFUCHSIA - { - using NativeType = VkBufferConstraintsInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferConstraintsInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferConstraintsInfoFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCreateInfo createInfo_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures_ = {}, - VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , createInfo( createInfo_ ) - , requiredFormatFeatures( requiredFormatFeatures_ ) - , bufferCollectionConstraints( bufferCollectionConstraints_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferConstraintsInfoFUCHSIA( BufferConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferConstraintsInfoFUCHSIA( VkBufferConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferConstraintsInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferConstraintsInfoFUCHSIA & operator=( BufferConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferConstraintsInfoFUCHSIA & operator=( VkBufferConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferConstraintsInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferConstraintsInfoFUCHSIA & setCreateInfo( VULKAN_HPP_NAMESPACE::BufferCreateInfo const & createInfo_ ) VULKAN_HPP_NOEXCEPT - { - createInfo = createInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferConstraintsInfoFUCHSIA & - setRequiredFormatFeatures( VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures_ ) VULKAN_HPP_NOEXCEPT - { - requiredFormatFeatures = requiredFormatFeatures_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferConstraintsInfoFUCHSIA & - setBufferCollectionConstraints( VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA const & bufferCollectionConstraints_ ) VULKAN_HPP_NOEXCEPT - { - bufferCollectionConstraints = bufferCollectionConstraints_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferConstraintsInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferConstraintsInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, createInfo, requiredFormatFeatures, bufferCollectionConstraints ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferConstraintsInfoFUCHSIA const & ) const = default; -# else - bool operator==( BufferConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( createInfo == rhs.createInfo ) && ( requiredFormatFeatures == rhs.requiredFormatFeatures ) && - ( bufferCollectionConstraints == rhs.bufferCollectionConstraints ); -# endif - } - - bool operator!=( BufferConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferConstraintsInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCreateInfo createInfo = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints = {}; - }; - - template <> - struct CppType - { - using Type = BufferConstraintsInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct BufferCopy - { - using NativeType = VkBufferCopy; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCopy( VULKAN_HPP_NAMESPACE::DeviceSize srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {} ) VULKAN_HPP_NOEXCEPT - : srcOffset( srcOffset_ ) - , dstOffset( dstOffset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCopy( BufferCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCopy( VkBufferCopy const & rhs ) VULKAN_HPP_NOEXCEPT : BufferCopy( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCopy & operator=( BufferCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCopy & operator=( VkBufferCopy const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCopy & setSrcOffset( VULKAN_HPP_NAMESPACE::DeviceSize srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCopy & setDstOffset( VULKAN_HPP_NAMESPACE::DeviceSize dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCopy & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCopy const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCopy &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( srcOffset, dstOffset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCopy const & ) const = default; -#else - bool operator==( BufferCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( srcOffset == rhs.srcOffset ) && ( dstOffset == rhs.dstOffset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( BufferCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize srcOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - struct BufferCopy2 - { - using NativeType = VkBufferCopy2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferCopy2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferCopy2( VULKAN_HPP_NAMESPACE::DeviceSize srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcOffset( srcOffset_ ) - , dstOffset( dstOffset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferCopy2( BufferCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCopy2( VkBufferCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT : BufferCopy2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferCopy2 & operator=( BufferCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferCopy2 & operator=( VkBufferCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferCopy2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCopy2 & setSrcOffset( VULKAN_HPP_NAMESPACE::DeviceSize srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCopy2 & setDstOffset( VULKAN_HPP_NAMESPACE::DeviceSize dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferCopy2 & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferCopy2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferCopy2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcOffset, dstOffset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferCopy2 const & ) const = default; -#else - bool operator==( BufferCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcOffset == rhs.srcOffset ) && ( dstOffset == rhs.dstOffset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( BufferCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferCopy2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize srcOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize dstOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - template <> - struct CppType - { - using Type = BufferCopy2; - }; - using BufferCopy2KHR = BufferCopy2; - - struct BufferDeviceAddressCreateInfoEXT - { - using NativeType = VkBufferDeviceAddressCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferDeviceAddressCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferDeviceAddressCreateInfoEXT( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceAddress( deviceAddress_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferDeviceAddressCreateInfoEXT( BufferDeviceAddressCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferDeviceAddressCreateInfoEXT( VkBufferDeviceAddressCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferDeviceAddressCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferDeviceAddressCreateInfoEXT & operator=( BufferDeviceAddressCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferDeviceAddressCreateInfoEXT & operator=( VkBufferDeviceAddressCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferDeviceAddressCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferDeviceAddressCreateInfoEXT & setDeviceAddress( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - deviceAddress = deviceAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferDeviceAddressCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferDeviceAddressCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceAddress ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferDeviceAddressCreateInfoEXT const & ) const = default; -#else - bool operator==( BufferDeviceAddressCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceAddress == rhs.deviceAddress ); -# endif - } - - bool operator!=( BufferDeviceAddressCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferDeviceAddressCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress = {}; - }; - - template <> - struct CppType - { - using Type = BufferDeviceAddressCreateInfoEXT; - }; - - struct BufferDeviceAddressInfo - { - using NativeType = VkBufferDeviceAddressInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferDeviceAddressInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferDeviceAddressInfo( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , buffer( buffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferDeviceAddressInfo( BufferDeviceAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferDeviceAddressInfo( VkBufferDeviceAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferDeviceAddressInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferDeviceAddressInfo & operator=( BufferDeviceAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferDeviceAddressInfo & operator=( VkBufferDeviceAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferDeviceAddressInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferDeviceAddressInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferDeviceAddressInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferDeviceAddressInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, buffer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferDeviceAddressInfo const & ) const = default; -#else - bool operator==( BufferDeviceAddressInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( buffer == rhs.buffer ); -# endif - } - - bool operator!=( BufferDeviceAddressInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferDeviceAddressInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - }; - - template <> - struct CppType - { - using Type = BufferDeviceAddressInfo; - }; - using BufferDeviceAddressInfoEXT = BufferDeviceAddressInfo; - using BufferDeviceAddressInfoKHR = BufferDeviceAddressInfo; - - struct BufferImageCopy - { - using NativeType = VkBufferImageCopy; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferImageCopy( VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset_ = {}, - uint32_t bufferRowLength_ = {}, - uint32_t bufferImageHeight_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers imageSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D imageOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D imageExtent_ = {} ) VULKAN_HPP_NOEXCEPT - : bufferOffset( bufferOffset_ ) - , bufferRowLength( bufferRowLength_ ) - , bufferImageHeight( bufferImageHeight_ ) - , imageSubresource( imageSubresource_ ) - , imageOffset( imageOffset_ ) - , imageExtent( imageExtent_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferImageCopy( BufferImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferImageCopy( VkBufferImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT : BufferImageCopy( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferImageCopy & operator=( BufferImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferImageCopy & operator=( VkBufferImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setBufferOffset( VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset_ ) VULKAN_HPP_NOEXCEPT - { - bufferOffset = bufferOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setBufferRowLength( uint32_t bufferRowLength_ ) VULKAN_HPP_NOEXCEPT - { - bufferRowLength = bufferRowLength_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setBufferImageHeight( uint32_t bufferImageHeight_ ) VULKAN_HPP_NOEXCEPT - { - bufferImageHeight = bufferImageHeight_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setImageSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & imageSubresource_ ) VULKAN_HPP_NOEXCEPT - { - imageSubresource = imageSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setImageOffset( VULKAN_HPP_NAMESPACE::Offset3D const & imageOffset_ ) VULKAN_HPP_NOEXCEPT - { - imageOffset = imageOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy & setImageExtent( VULKAN_HPP_NAMESPACE::Extent3D const & imageExtent_ ) VULKAN_HPP_NOEXCEPT - { - imageExtent = imageExtent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferImageCopy const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferImageCopy &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( bufferOffset, bufferRowLength, bufferImageHeight, imageSubresource, imageOffset, imageExtent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferImageCopy const & ) const = default; -#else - bool operator==( BufferImageCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( bufferOffset == rhs.bufferOffset ) && ( bufferRowLength == rhs.bufferRowLength ) && ( bufferImageHeight == rhs.bufferImageHeight ) && - ( imageSubresource == rhs.imageSubresource ) && ( imageOffset == rhs.imageOffset ) && ( imageExtent == rhs.imageExtent ); -# endif - } - - bool operator!=( BufferImageCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset = {}; - uint32_t bufferRowLength = {}; - uint32_t bufferImageHeight = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers imageSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D imageOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D imageExtent = {}; - }; - - struct BufferImageCopy2 - { - using NativeType = VkBufferImageCopy2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferImageCopy2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferImageCopy2( VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset_ = {}, - uint32_t bufferRowLength_ = {}, - uint32_t bufferImageHeight_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers imageSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D imageOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D imageExtent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , bufferOffset( bufferOffset_ ) - , bufferRowLength( bufferRowLength_ ) - , bufferImageHeight( bufferImageHeight_ ) - , imageSubresource( imageSubresource_ ) - , imageOffset( imageOffset_ ) - , imageExtent( imageExtent_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferImageCopy2( BufferImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferImageCopy2( VkBufferImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT : BufferImageCopy2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferImageCopy2 & operator=( BufferImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferImageCopy2 & operator=( VkBufferImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setBufferOffset( VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset_ ) VULKAN_HPP_NOEXCEPT - { - bufferOffset = bufferOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setBufferRowLength( uint32_t bufferRowLength_ ) VULKAN_HPP_NOEXCEPT - { - bufferRowLength = bufferRowLength_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setBufferImageHeight( uint32_t bufferImageHeight_ ) VULKAN_HPP_NOEXCEPT - { - bufferImageHeight = bufferImageHeight_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setImageSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & imageSubresource_ ) VULKAN_HPP_NOEXCEPT - { - imageSubresource = imageSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setImageOffset( VULKAN_HPP_NAMESPACE::Offset3D const & imageOffset_ ) VULKAN_HPP_NOEXCEPT - { - imageOffset = imageOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferImageCopy2 & setImageExtent( VULKAN_HPP_NAMESPACE::Extent3D const & imageExtent_ ) VULKAN_HPP_NOEXCEPT - { - imageExtent = imageExtent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferImageCopy2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferImageCopy2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, bufferOffset, bufferRowLength, bufferImageHeight, imageSubresource, imageOffset, imageExtent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferImageCopy2 const & ) const = default; -#else - bool operator==( BufferImageCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( bufferOffset == rhs.bufferOffset ) && ( bufferRowLength == rhs.bufferRowLength ) && - ( bufferImageHeight == rhs.bufferImageHeight ) && ( imageSubresource == rhs.imageSubresource ) && ( imageOffset == rhs.imageOffset ) && - ( imageExtent == rhs.imageExtent ); -# endif - } - - bool operator!=( BufferImageCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferImageCopy2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize bufferOffset = {}; - uint32_t bufferRowLength = {}; - uint32_t bufferImageHeight = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers imageSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D imageOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D imageExtent = {}; - }; - - template <> - struct CppType - { - using Type = BufferImageCopy2; - }; - using BufferImageCopy2KHR = BufferImageCopy2; - - struct BufferMemoryBarrier - { - using NativeType = VkBufferMemoryBarrier; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferMemoryBarrier; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferMemoryBarrier( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ = {}, - uint32_t srcQueueFamilyIndex_ = {}, - uint32_t dstQueueFamilyIndex_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcAccessMask( srcAccessMask_ ) - , dstAccessMask( dstAccessMask_ ) - , srcQueueFamilyIndex( srcQueueFamilyIndex_ ) - , dstQueueFamilyIndex( dstQueueFamilyIndex_ ) - , buffer( buffer_ ) - , offset( offset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferMemoryBarrier( BufferMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryBarrier( VkBufferMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT : BufferMemoryBarrier( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferMemoryBarrier & operator=( BufferMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryBarrier & operator=( VkBufferMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setSrcQueueFamilyIndex( uint32_t srcQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - srcQueueFamilyIndex = srcQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setDstQueueFamilyIndex( uint32_t dstQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - dstQueueFamilyIndex = dstQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferMemoryBarrier const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferMemoryBarrier &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcAccessMask, dstAccessMask, srcQueueFamilyIndex, dstQueueFamilyIndex, buffer, offset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferMemoryBarrier const & ) const = default; -#else - bool operator==( BufferMemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcAccessMask == rhs.srcAccessMask ) && ( dstAccessMask == rhs.dstAccessMask ) && - ( srcQueueFamilyIndex == rhs.srcQueueFamilyIndex ) && ( dstQueueFamilyIndex == rhs.dstQueueFamilyIndex ) && ( buffer == rhs.buffer ) && - ( offset == rhs.offset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( BufferMemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferMemoryBarrier; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask = {}; - uint32_t srcQueueFamilyIndex = {}; - uint32_t dstQueueFamilyIndex = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - template <> - struct CppType - { - using Type = BufferMemoryBarrier; - }; - - struct BufferMemoryBarrier2 - { - using NativeType = VkBufferMemoryBarrier2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferMemoryBarrier2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferMemoryBarrier2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ = {}, - uint32_t srcQueueFamilyIndex_ = {}, - uint32_t dstQueueFamilyIndex_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcStageMask( srcStageMask_ ) - , srcAccessMask( srcAccessMask_ ) - , dstStageMask( dstStageMask_ ) - , dstAccessMask( dstAccessMask_ ) - , srcQueueFamilyIndex( srcQueueFamilyIndex_ ) - , dstQueueFamilyIndex( dstQueueFamilyIndex_ ) - , buffer( buffer_ ) - , offset( offset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferMemoryBarrier2( BufferMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryBarrier2( VkBufferMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferMemoryBarrier2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferMemoryBarrier2 & operator=( BufferMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryBarrier2 & operator=( VkBufferMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setSrcStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ ) VULKAN_HPP_NOEXCEPT - { - srcStageMask = srcStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setDstStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - dstStageMask = dstStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setSrcQueueFamilyIndex( uint32_t srcQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - srcQueueFamilyIndex = srcQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setDstQueueFamilyIndex( uint32_t dstQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - dstQueueFamilyIndex = dstQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryBarrier2 & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferMemoryBarrier2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferMemoryBarrier2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcStageMask, srcAccessMask, dstStageMask, dstAccessMask, srcQueueFamilyIndex, dstQueueFamilyIndex, buffer, offset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferMemoryBarrier2 const & ) const = default; -#else - bool operator==( BufferMemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcStageMask == rhs.srcStageMask ) && ( srcAccessMask == rhs.srcAccessMask ) && - ( dstStageMask == rhs.dstStageMask ) && ( dstAccessMask == rhs.dstAccessMask ) && ( srcQueueFamilyIndex == rhs.srcQueueFamilyIndex ) && - ( dstQueueFamilyIndex == rhs.dstQueueFamilyIndex ) && ( buffer == rhs.buffer ) && ( offset == rhs.offset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( BufferMemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferMemoryBarrier2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask = {}; - uint32_t srcQueueFamilyIndex = {}; - uint32_t dstQueueFamilyIndex = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - template <> - struct CppType - { - using Type = BufferMemoryBarrier2; - }; - using BufferMemoryBarrier2KHR = BufferMemoryBarrier2; - - struct BufferMemoryRequirementsInfo2 - { - using NativeType = VkBufferMemoryRequirementsInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferMemoryRequirementsInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferMemoryRequirementsInfo2( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , buffer( buffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferMemoryRequirementsInfo2( BufferMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryRequirementsInfo2( VkBufferMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferMemoryRequirementsInfo2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferMemoryRequirementsInfo2 & operator=( BufferMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferMemoryRequirementsInfo2 & operator=( VkBufferMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferMemoryRequirementsInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferMemoryRequirementsInfo2 & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferMemoryRequirementsInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferMemoryRequirementsInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, buffer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferMemoryRequirementsInfo2 const & ) const = default; -#else - bool operator==( BufferMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( buffer == rhs.buffer ); -# endif - } - - bool operator!=( BufferMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferMemoryRequirementsInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - }; - - template <> - struct CppType - { - using Type = BufferMemoryRequirementsInfo2; - }; - using BufferMemoryRequirementsInfo2KHR = BufferMemoryRequirementsInfo2; - - struct BufferOpaqueCaptureAddressCreateInfo - { - using NativeType = VkBufferOpaqueCaptureAddressCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferOpaqueCaptureAddressCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferOpaqueCaptureAddressCreateInfo( uint64_t opaqueCaptureAddress_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , opaqueCaptureAddress( opaqueCaptureAddress_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferOpaqueCaptureAddressCreateInfo( BufferOpaqueCaptureAddressCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferOpaqueCaptureAddressCreateInfo( VkBufferOpaqueCaptureAddressCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferOpaqueCaptureAddressCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferOpaqueCaptureAddressCreateInfo & operator=( BufferOpaqueCaptureAddressCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferOpaqueCaptureAddressCreateInfo & operator=( VkBufferOpaqueCaptureAddressCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferOpaqueCaptureAddressCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferOpaqueCaptureAddressCreateInfo & setOpaqueCaptureAddress( uint64_t opaqueCaptureAddress_ ) VULKAN_HPP_NOEXCEPT - { - opaqueCaptureAddress = opaqueCaptureAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferOpaqueCaptureAddressCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferOpaqueCaptureAddressCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, opaqueCaptureAddress ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferOpaqueCaptureAddressCreateInfo const & ) const = default; -#else - bool operator==( BufferOpaqueCaptureAddressCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( opaqueCaptureAddress == rhs.opaqueCaptureAddress ); -# endif - } - - bool operator!=( BufferOpaqueCaptureAddressCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferOpaqueCaptureAddressCreateInfo; - const void * pNext = {}; - uint64_t opaqueCaptureAddress = {}; - }; - - template <> - struct CppType - { - using Type = BufferOpaqueCaptureAddressCreateInfo; - }; - using BufferOpaqueCaptureAddressCreateInfoKHR = BufferOpaqueCaptureAddressCreateInfo; - - struct BufferViewCreateInfo - { - using NativeType = VkBufferViewCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eBufferViewCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR BufferViewCreateInfo( VULKAN_HPP_NAMESPACE::BufferViewCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize range_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , buffer( buffer_ ) - , format( format_ ) - , offset( offset_ ) - , range( range_ ) - { - } - - VULKAN_HPP_CONSTEXPR BufferViewCreateInfo( BufferViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferViewCreateInfo( VkBufferViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : BufferViewCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - BufferViewCreateInfo & operator=( BufferViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - BufferViewCreateInfo & operator=( VkBufferViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::BufferViewCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 BufferViewCreateInfo & setRange( VULKAN_HPP_NAMESPACE::DeviceSize range_ ) VULKAN_HPP_NOEXCEPT - { - range = range_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkBufferViewCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkBufferViewCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, buffer, format, offset, range ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( BufferViewCreateInfo const & ) const = default; -#else - bool operator==( BufferViewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( buffer == rhs.buffer ) && ( format == rhs.format ) && - ( offset == rhs.offset ) && ( range == rhs.range ); -# endif - } - - bool operator!=( BufferViewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eBufferViewCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferViewCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize range = {}; - }; - - template <> - struct CppType - { - using Type = BufferViewCreateInfo; - }; - - struct CalibratedTimestampInfoEXT - { - using NativeType = VkCalibratedTimestampInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCalibratedTimestampInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CalibratedTimestampInfoEXT( VULKAN_HPP_NAMESPACE::TimeDomainEXT timeDomain_ = VULKAN_HPP_NAMESPACE::TimeDomainEXT::eDevice, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , timeDomain( timeDomain_ ) - { - } - - VULKAN_HPP_CONSTEXPR CalibratedTimestampInfoEXT( CalibratedTimestampInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CalibratedTimestampInfoEXT( VkCalibratedTimestampInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : CalibratedTimestampInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CalibratedTimestampInfoEXT & operator=( CalibratedTimestampInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CalibratedTimestampInfoEXT & operator=( VkCalibratedTimestampInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CalibratedTimestampInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CalibratedTimestampInfoEXT & setTimeDomain( VULKAN_HPP_NAMESPACE::TimeDomainEXT timeDomain_ ) VULKAN_HPP_NOEXCEPT - { - timeDomain = timeDomain_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCalibratedTimestampInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCalibratedTimestampInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, timeDomain ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CalibratedTimestampInfoEXT const & ) const = default; -#else - bool operator==( CalibratedTimestampInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( timeDomain == rhs.timeDomain ); -# endif - } - - bool operator!=( CalibratedTimestampInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCalibratedTimestampInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::TimeDomainEXT timeDomain = VULKAN_HPP_NAMESPACE::TimeDomainEXT::eDevice; - }; - - template <> - struct CppType - { - using Type = CalibratedTimestampInfoEXT; - }; - - struct CheckpointData2NV - { - using NativeType = VkCheckpointData2NV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCheckpointData2NV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - CheckpointData2NV( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage_ = {}, void * pCheckpointMarker_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stage( stage_ ) - , pCheckpointMarker( pCheckpointMarker_ ) - { - } - - VULKAN_HPP_CONSTEXPR CheckpointData2NV( CheckpointData2NV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CheckpointData2NV( VkCheckpointData2NV const & rhs ) VULKAN_HPP_NOEXCEPT : CheckpointData2NV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CheckpointData2NV & operator=( CheckpointData2NV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CheckpointData2NV & operator=( VkCheckpointData2NV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkCheckpointData2NV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCheckpointData2NV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stage, pCheckpointMarker ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CheckpointData2NV const & ) const = default; -#else - bool operator==( CheckpointData2NV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stage == rhs.stage ) && ( pCheckpointMarker == rhs.pCheckpointMarker ); -# endif - } - - bool operator!=( CheckpointData2NV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCheckpointData2NV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stage = {}; - void * pCheckpointMarker = {}; - }; - - template <> - struct CppType - { - using Type = CheckpointData2NV; - }; - - struct CheckpointDataNV - { - using NativeType = VkCheckpointDataNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCheckpointDataNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CheckpointDataNV( VULKAN_HPP_NAMESPACE::PipelineStageFlagBits stage_ = VULKAN_HPP_NAMESPACE::PipelineStageFlagBits::eTopOfPipe, - void * pCheckpointMarker_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stage( stage_ ) - , pCheckpointMarker( pCheckpointMarker_ ) - { - } - - VULKAN_HPP_CONSTEXPR CheckpointDataNV( CheckpointDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CheckpointDataNV( VkCheckpointDataNV const & rhs ) VULKAN_HPP_NOEXCEPT : CheckpointDataNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CheckpointDataNV & operator=( CheckpointDataNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CheckpointDataNV & operator=( VkCheckpointDataNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkCheckpointDataNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCheckpointDataNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stage, pCheckpointMarker ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CheckpointDataNV const & ) const = default; -#else - bool operator==( CheckpointDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stage == rhs.stage ) && ( pCheckpointMarker == rhs.pCheckpointMarker ); -# endif - } - - bool operator!=( CheckpointDataNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCheckpointDataNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlagBits stage = VULKAN_HPP_NAMESPACE::PipelineStageFlagBits::eTopOfPipe; - void * pCheckpointMarker = {}; - }; - - template <> - struct CppType - { - using Type = CheckpointDataNV; - }; - - union ClearColorValue - { - using NativeType = VkClearColorValue; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & float32_ = {} ) : float32( float32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & int32_ ) : int32( int32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 ClearColorValue( const std::array & uint32_ ) : uint32( uint32_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ClearColorValue & setFloat32( std::array float32_ ) VULKAN_HPP_NOEXCEPT - { - float32 = float32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearColorValue & setInt32( std::array int32_ ) VULKAN_HPP_NOEXCEPT - { - int32 = int32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearColorValue & setUint32( std::array uint32_ ) VULKAN_HPP_NOEXCEPT - { - uint32 = uint32_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkClearColorValue const &() const - { - return *reinterpret_cast( this ); - } - - operator VkClearColorValue &() - { - return *reinterpret_cast( this ); - } - - VULKAN_HPP_NAMESPACE::ArrayWrapper1D float32; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D int32; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D uint32; - }; - - struct ClearDepthStencilValue - { - using NativeType = VkClearDepthStencilValue; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ClearDepthStencilValue( float depth_ = {}, uint32_t stencil_ = {} ) VULKAN_HPP_NOEXCEPT - : depth( depth_ ) - , stencil( stencil_ ) - { - } - - VULKAN_HPP_CONSTEXPR ClearDepthStencilValue( ClearDepthStencilValue const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearDepthStencilValue( VkClearDepthStencilValue const & rhs ) VULKAN_HPP_NOEXCEPT - : ClearDepthStencilValue( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ClearDepthStencilValue & operator=( ClearDepthStencilValue const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearDepthStencilValue & operator=( VkClearDepthStencilValue const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ClearDepthStencilValue & setDepth( float depth_ ) VULKAN_HPP_NOEXCEPT - { - depth = depth_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearDepthStencilValue & setStencil( uint32_t stencil_ ) VULKAN_HPP_NOEXCEPT - { - stencil = stencil_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkClearDepthStencilValue const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkClearDepthStencilValue &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( depth, stencil ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ClearDepthStencilValue const & ) const = default; -#else - bool operator==( ClearDepthStencilValue const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( depth == rhs.depth ) && ( stencil == rhs.stencil ); -# endif - } - - bool operator!=( ClearDepthStencilValue const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float depth = {}; - uint32_t stencil = {}; - }; - - union ClearValue - { - using NativeType = VkClearValue; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 ClearValue( VULKAN_HPP_NAMESPACE::ClearColorValue color_ = {} ) : color( color_ ) {} - - VULKAN_HPP_CONSTEXPR_14 ClearValue( VULKAN_HPP_NAMESPACE::ClearDepthStencilValue depthStencil_ ) : depthStencil( depthStencil_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ClearValue & setColor( VULKAN_HPP_NAMESPACE::ClearColorValue const & color_ ) VULKAN_HPP_NOEXCEPT - { - color = color_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearValue & setDepthStencil( VULKAN_HPP_NAMESPACE::ClearDepthStencilValue const & depthStencil_ ) VULKAN_HPP_NOEXCEPT - { - depthStencil = depthStencil_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkClearValue const &() const - { - return *reinterpret_cast( this ); - } - - operator VkClearValue &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::ClearColorValue color; - VULKAN_HPP_NAMESPACE::ClearDepthStencilValue depthStencil; -#else - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct ClearAttachment - { - using NativeType = VkClearAttachment; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ClearAttachment( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, - uint32_t colorAttachment_ = {}, - VULKAN_HPP_NAMESPACE::ClearValue clearValue_ = {} ) VULKAN_HPP_NOEXCEPT - : aspectMask( aspectMask_ ) - , colorAttachment( colorAttachment_ ) - , clearValue( clearValue_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ClearAttachment( ClearAttachment const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearAttachment( VkClearAttachment const & rhs ) VULKAN_HPP_NOEXCEPT : ClearAttachment( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ClearAttachment & operator=( ClearAttachment const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearAttachment & operator=( VkClearAttachment const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ClearAttachment & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearAttachment & setColorAttachment( uint32_t colorAttachment_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachment = colorAttachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearAttachment & setClearValue( VULKAN_HPP_NAMESPACE::ClearValue const & clearValue_ ) VULKAN_HPP_NOEXCEPT - { - clearValue = clearValue_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkClearAttachment const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkClearAttachment &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( aspectMask, colorAttachment, clearValue ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - uint32_t colorAttachment = {}; - VULKAN_HPP_NAMESPACE::ClearValue clearValue = {}; - }; - - struct ClearRect - { - using NativeType = VkClearRect; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ClearRect( VULKAN_HPP_NAMESPACE::Rect2D rect_ = {}, uint32_t baseArrayLayer_ = {}, uint32_t layerCount_ = {} ) VULKAN_HPP_NOEXCEPT - : rect( rect_ ) - , baseArrayLayer( baseArrayLayer_ ) - , layerCount( layerCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR ClearRect( ClearRect const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearRect( VkClearRect const & rhs ) VULKAN_HPP_NOEXCEPT : ClearRect( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ClearRect & operator=( ClearRect const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ClearRect & operator=( VkClearRect const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ClearRect & setRect( VULKAN_HPP_NAMESPACE::Rect2D const & rect_ ) VULKAN_HPP_NOEXCEPT - { - rect = rect_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearRect & setBaseArrayLayer( uint32_t baseArrayLayer_ ) VULKAN_HPP_NOEXCEPT - { - baseArrayLayer = baseArrayLayer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ClearRect & setLayerCount( uint32_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkClearRect const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkClearRect &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( rect, baseArrayLayer, layerCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ClearRect const & ) const = default; -#else - bool operator==( ClearRect const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( rect == rhs.rect ) && ( baseArrayLayer == rhs.baseArrayLayer ) && ( layerCount == rhs.layerCount ); -# endif - } - - bool operator!=( ClearRect const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Rect2D rect = {}; - uint32_t baseArrayLayer = {}; - uint32_t layerCount = {}; - }; - - struct CoarseSampleLocationNV - { - using NativeType = VkCoarseSampleLocationNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CoarseSampleLocationNV( uint32_t pixelX_ = {}, uint32_t pixelY_ = {}, uint32_t sample_ = {} ) VULKAN_HPP_NOEXCEPT - : pixelX( pixelX_ ) - , pixelY( pixelY_ ) - , sample( sample_ ) - { - } - - VULKAN_HPP_CONSTEXPR CoarseSampleLocationNV( CoarseSampleLocationNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CoarseSampleLocationNV( VkCoarseSampleLocationNV const & rhs ) VULKAN_HPP_NOEXCEPT - : CoarseSampleLocationNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CoarseSampleLocationNV & operator=( CoarseSampleLocationNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CoarseSampleLocationNV & operator=( VkCoarseSampleLocationNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CoarseSampleLocationNV & setPixelX( uint32_t pixelX_ ) VULKAN_HPP_NOEXCEPT - { - pixelX = pixelX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CoarseSampleLocationNV & setPixelY( uint32_t pixelY_ ) VULKAN_HPP_NOEXCEPT - { - pixelY = pixelY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CoarseSampleLocationNV & setSample( uint32_t sample_ ) VULKAN_HPP_NOEXCEPT - { - sample = sample_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCoarseSampleLocationNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCoarseSampleLocationNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( pixelX, pixelY, sample ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CoarseSampleLocationNV const & ) const = default; -#else - bool operator==( CoarseSampleLocationNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( pixelX == rhs.pixelX ) && ( pixelY == rhs.pixelY ) && ( sample == rhs.sample ); -# endif - } - - bool operator!=( CoarseSampleLocationNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t pixelX = {}; - uint32_t pixelY = {}; - uint32_t sample = {}; - }; - - struct CoarseSampleOrderCustomNV - { - using NativeType = VkCoarseSampleOrderCustomNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - CoarseSampleOrderCustomNV( VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV shadingRate_ = VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV::eNoInvocations, - uint32_t sampleCount_ = {}, - uint32_t sampleLocationCount_ = {}, - const VULKAN_HPP_NAMESPACE::CoarseSampleLocationNV * pSampleLocations_ = {} ) VULKAN_HPP_NOEXCEPT - : shadingRate( shadingRate_ ) - , sampleCount( sampleCount_ ) - , sampleLocationCount( sampleLocationCount_ ) - , pSampleLocations( pSampleLocations_ ) - { - } - - VULKAN_HPP_CONSTEXPR CoarseSampleOrderCustomNV( CoarseSampleOrderCustomNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CoarseSampleOrderCustomNV( VkCoarseSampleOrderCustomNV const & rhs ) VULKAN_HPP_NOEXCEPT - : CoarseSampleOrderCustomNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CoarseSampleOrderCustomNV( VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV shadingRate_, - uint32_t sampleCount_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & sampleLocations_ ) - : shadingRate( shadingRate_ ) - , sampleCount( sampleCount_ ) - , sampleLocationCount( static_cast( sampleLocations_.size() ) ) - , pSampleLocations( sampleLocations_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CoarseSampleOrderCustomNV & operator=( CoarseSampleOrderCustomNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CoarseSampleOrderCustomNV & operator=( VkCoarseSampleOrderCustomNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CoarseSampleOrderCustomNV & setShadingRate( VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV shadingRate_ ) VULKAN_HPP_NOEXCEPT - { - shadingRate = shadingRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CoarseSampleOrderCustomNV & setSampleCount( uint32_t sampleCount_ ) VULKAN_HPP_NOEXCEPT - { - sampleCount = sampleCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CoarseSampleOrderCustomNV & setSampleLocationCount( uint32_t sampleLocationCount_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationCount = sampleLocationCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CoarseSampleOrderCustomNV & - setPSampleLocations( const VULKAN_HPP_NAMESPACE::CoarseSampleLocationNV * pSampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - pSampleLocations = pSampleLocations_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CoarseSampleOrderCustomNV & setSampleLocations( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & sampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationCount = static_cast( sampleLocations_.size() ); - pSampleLocations = sampleLocations_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCoarseSampleOrderCustomNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCoarseSampleOrderCustomNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( shadingRate, sampleCount, sampleLocationCount, pSampleLocations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CoarseSampleOrderCustomNV const & ) const = default; -#else - bool operator==( CoarseSampleOrderCustomNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( shadingRate == rhs.shadingRate ) && ( sampleCount == rhs.sampleCount ) && ( sampleLocationCount == rhs.sampleLocationCount ) && - ( pSampleLocations == rhs.pSampleLocations ); -# endif - } - - bool operator!=( CoarseSampleOrderCustomNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV shadingRate = VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV::eNoInvocations; - uint32_t sampleCount = {}; - uint32_t sampleLocationCount = {}; - const VULKAN_HPP_NAMESPACE::CoarseSampleLocationNV * pSampleLocations = {}; - }; - - struct CommandBufferAllocateInfo - { - using NativeType = VkCommandBufferAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferAllocateInfo( VULKAN_HPP_NAMESPACE::CommandPool commandPool_ = {}, - VULKAN_HPP_NAMESPACE::CommandBufferLevel level_ = VULKAN_HPP_NAMESPACE::CommandBufferLevel::ePrimary, - uint32_t commandBufferCount_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , commandPool( commandPool_ ) - , level( level_ ) - , commandBufferCount( commandBufferCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandBufferAllocateInfo( CommandBufferAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferAllocateInfo( VkCommandBufferAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferAllocateInfo & operator=( CommandBufferAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferAllocateInfo & operator=( VkCommandBufferAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferAllocateInfo & setCommandPool( VULKAN_HPP_NAMESPACE::CommandPool commandPool_ ) VULKAN_HPP_NOEXCEPT - { - commandPool = commandPool_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferAllocateInfo & setLevel( VULKAN_HPP_NAMESPACE::CommandBufferLevel level_ ) VULKAN_HPP_NOEXCEPT - { - level = level_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferAllocateInfo & setCommandBufferCount( uint32_t commandBufferCount_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferCount = commandBufferCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, commandPool, level, commandBufferCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferAllocateInfo const & ) const = default; -#else - bool operator==( CommandBufferAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( commandPool == rhs.commandPool ) && ( level == rhs.level ) && - ( commandBufferCount == rhs.commandBufferCount ); -# endif - } - - bool operator!=( CommandBufferAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferAllocateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CommandPool commandPool = {}; - VULKAN_HPP_NAMESPACE::CommandBufferLevel level = VULKAN_HPP_NAMESPACE::CommandBufferLevel::ePrimary; - uint32_t commandBufferCount = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferAllocateInfo; - }; - - struct CommandBufferInheritanceInfo - { - using NativeType = VkCommandBufferInheritanceInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferInheritanceInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceInfo( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - uint32_t subpass_ = {}, - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryEnable_ = {}, - VULKAN_HPP_NAMESPACE::QueryControlFlags queryFlags_ = {}, - VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , renderPass( renderPass_ ) - , subpass( subpass_ ) - , framebuffer( framebuffer_ ) - , occlusionQueryEnable( occlusionQueryEnable_ ) - , queryFlags( queryFlags_ ) - , pipelineStatistics( pipelineStatistics_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceInfo( CommandBufferInheritanceInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceInfo( VkCommandBufferInheritanceInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferInheritanceInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferInheritanceInfo & operator=( CommandBufferInheritanceInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceInfo & operator=( VkCommandBufferInheritanceInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ ) VULKAN_HPP_NOEXCEPT - { - renderPass = renderPass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setSubpass( uint32_t subpass_ ) VULKAN_HPP_NOEXCEPT - { - subpass = subpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer_ ) VULKAN_HPP_NOEXCEPT - { - framebuffer = framebuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setOcclusionQueryEnable( VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryEnable_ ) VULKAN_HPP_NOEXCEPT - { - occlusionQueryEnable = occlusionQueryEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & setQueryFlags( VULKAN_HPP_NAMESPACE::QueryControlFlags queryFlags_ ) VULKAN_HPP_NOEXCEPT - { - queryFlags = queryFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceInfo & - setPipelineStatistics( VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics_ ) VULKAN_HPP_NOEXCEPT - { - pipelineStatistics = pipelineStatistics_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferInheritanceInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferInheritanceInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, renderPass, subpass, framebuffer, occlusionQueryEnable, queryFlags, pipelineStatistics ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferInheritanceInfo const & ) const = default; -#else - bool operator==( CommandBufferInheritanceInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( renderPass == rhs.renderPass ) && ( subpass == rhs.subpass ) && - ( framebuffer == rhs.framebuffer ) && ( occlusionQueryEnable == rhs.occlusionQueryEnable ) && ( queryFlags == rhs.queryFlags ) && - ( pipelineStatistics == rhs.pipelineStatistics ); -# endif - } - - bool operator!=( CommandBufferInheritanceInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferInheritanceInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPass renderPass = {}; - uint32_t subpass = {}; - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer = {}; - VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryEnable = {}; - VULKAN_HPP_NAMESPACE::QueryControlFlags queryFlags = {}; - VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferInheritanceInfo; - }; - - struct CommandBufferBeginInfo - { - using NativeType = VkCommandBufferBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferBeginInfo( VULKAN_HPP_NAMESPACE::CommandBufferUsageFlags flags_ = {}, - const VULKAN_HPP_NAMESPACE::CommandBufferInheritanceInfo * pInheritanceInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pInheritanceInfo( pInheritanceInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandBufferBeginInfo( CommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferBeginInfo( VkCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferBeginInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferBeginInfo & operator=( CommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferBeginInfo & operator=( VkCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferBeginInfo & setFlags( VULKAN_HPP_NAMESPACE::CommandBufferUsageFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferBeginInfo & - setPInheritanceInfo( const VULKAN_HPP_NAMESPACE::CommandBufferInheritanceInfo * pInheritanceInfo_ ) VULKAN_HPP_NOEXCEPT - { - pInheritanceInfo = pInheritanceInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pInheritanceInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferBeginInfo const & ) const = default; -#else - bool operator==( CommandBufferBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pInheritanceInfo == rhs.pInheritanceInfo ); -# endif - } - - bool operator!=( CommandBufferBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferBeginInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CommandBufferUsageFlags flags = {}; - const VULKAN_HPP_NAMESPACE::CommandBufferInheritanceInfo * pInheritanceInfo = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferBeginInfo; - }; - - struct CommandBufferInheritanceConditionalRenderingInfoEXT - { - using NativeType = VkCommandBufferInheritanceConditionalRenderingInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferInheritanceConditionalRenderingInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceConditionalRenderingInfoEXT( VULKAN_HPP_NAMESPACE::Bool32 conditionalRenderingEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , conditionalRenderingEnable( conditionalRenderingEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR - CommandBufferInheritanceConditionalRenderingInfoEXT( CommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceConditionalRenderingInfoEXT( VkCommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferInheritanceConditionalRenderingInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferInheritanceConditionalRenderingInfoEXT & - operator=( CommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceConditionalRenderingInfoEXT & operator=( VkCommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceConditionalRenderingInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceConditionalRenderingInfoEXT & - setConditionalRenderingEnable( VULKAN_HPP_NAMESPACE::Bool32 conditionalRenderingEnable_ ) VULKAN_HPP_NOEXCEPT - { - conditionalRenderingEnable = conditionalRenderingEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferInheritanceConditionalRenderingInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferInheritanceConditionalRenderingInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, conditionalRenderingEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferInheritanceConditionalRenderingInfoEXT const & ) const = default; -#else - bool operator==( CommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( conditionalRenderingEnable == rhs.conditionalRenderingEnable ); -# endif - } - - bool operator!=( CommandBufferInheritanceConditionalRenderingInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferInheritanceConditionalRenderingInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 conditionalRenderingEnable = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferInheritanceConditionalRenderingInfoEXT; - }; - - struct CommandBufferInheritanceRenderPassTransformInfoQCOM - { - using NativeType = VkCommandBufferInheritanceRenderPassTransformInfoQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferInheritanceRenderPassTransformInfoQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceRenderPassTransformInfoQCOM( - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - VULKAN_HPP_NAMESPACE::Rect2D renderArea_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , transform( transform_ ) - , renderArea( renderArea_ ) - { - } - - VULKAN_HPP_CONSTEXPR - CommandBufferInheritanceRenderPassTransformInfoQCOM( CommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceRenderPassTransformInfoQCOM( VkCommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferInheritanceRenderPassTransformInfoQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferInheritanceRenderPassTransformInfoQCOM & - operator=( CommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceRenderPassTransformInfoQCOM & operator=( VkCommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderPassTransformInfoQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderPassTransformInfoQCOM & - setTransform( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ ) VULKAN_HPP_NOEXCEPT - { - transform = transform_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderPassTransformInfoQCOM & - setRenderArea( VULKAN_HPP_NAMESPACE::Rect2D const & renderArea_ ) VULKAN_HPP_NOEXCEPT - { - renderArea = renderArea_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferInheritanceRenderPassTransformInfoQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferInheritanceRenderPassTransformInfoQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, transform, renderArea ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferInheritanceRenderPassTransformInfoQCOM const & ) const = default; -#else - bool operator==( CommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( transform == rhs.transform ) && ( renderArea == rhs.renderArea ); -# endif - } - - bool operator!=( CommandBufferInheritanceRenderPassTransformInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferInheritanceRenderPassTransformInfoQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - VULKAN_HPP_NAMESPACE::Rect2D renderArea = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferInheritanceRenderPassTransformInfoQCOM; - }; - - struct CommandBufferInheritanceRenderingInfo - { - using NativeType = VkCommandBufferInheritanceRenderingInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferInheritanceRenderingInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - CommandBufferInheritanceRenderingInfo( VULKAN_HPP_NAMESPACE::RenderingFlags flags_ = {}, - uint32_t viewMask_ = {}, - uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats_ = {}, - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachmentFormats( pColorAttachmentFormats_ ) - , depthAttachmentFormat( depthAttachmentFormat_ ) - , stencilAttachmentFormat( stencilAttachmentFormat_ ) - , rasterizationSamples( rasterizationSamples_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceRenderingInfo( CommandBufferInheritanceRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceRenderingInfo( VkCommandBufferInheritanceRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferInheritanceRenderingInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CommandBufferInheritanceRenderingInfo( VULKAN_HPP_NAMESPACE::RenderingFlags flags_, - uint32_t viewMask_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentFormats_, - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( static_cast( colorAttachmentFormats_.size() ) ) - , pColorAttachmentFormats( colorAttachmentFormats_.data() ) - , depthAttachmentFormat( depthAttachmentFormat_ ) - , stencilAttachmentFormat( stencilAttachmentFormat_ ) - , rasterizationSamples( rasterizationSamples_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferInheritanceRenderingInfo & operator=( CommandBufferInheritanceRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceRenderingInfo & operator=( VkCommandBufferInheritanceRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & setFlags( VULKAN_HPP_NAMESPACE::RenderingFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & setViewMask( uint32_t viewMask_ ) VULKAN_HPP_NOEXCEPT - { - viewMask = viewMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & - setPColorAttachmentFormats( const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachmentFormats = pColorAttachmentFormats_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CommandBufferInheritanceRenderingInfo & setColorAttachmentFormats( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentFormats_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachmentFormats_.size() ); - pColorAttachmentFormats = colorAttachmentFormats_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & - setDepthAttachmentFormat( VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ ) VULKAN_HPP_NOEXCEPT - { - depthAttachmentFormat = depthAttachmentFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & - setStencilAttachmentFormat( VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ ) VULKAN_HPP_NOEXCEPT - { - stencilAttachmentFormat = stencilAttachmentFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceRenderingInfo & - setRasterizationSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationSamples = rasterizationSamples_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferInheritanceRenderingInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferInheritanceRenderingInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, flags, viewMask, colorAttachmentCount, pColorAttachmentFormats, depthAttachmentFormat, stencilAttachmentFormat, rasterizationSamples ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferInheritanceRenderingInfo const & ) const = default; -#else - bool operator==( CommandBufferInheritanceRenderingInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( viewMask == rhs.viewMask ) && - ( colorAttachmentCount == rhs.colorAttachmentCount ) && ( pColorAttachmentFormats == rhs.pColorAttachmentFormats ) && - ( depthAttachmentFormat == rhs.depthAttachmentFormat ) && ( stencilAttachmentFormat == rhs.stencilAttachmentFormat ) && - ( rasterizationSamples == rhs.rasterizationSamples ); -# endif - } - - bool operator!=( CommandBufferInheritanceRenderingInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferInheritanceRenderingInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderingFlags flags = {}; - uint32_t viewMask = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats = {}; - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - }; - - template <> - struct CppType - { - using Type = CommandBufferInheritanceRenderingInfo; - }; - using CommandBufferInheritanceRenderingInfoKHR = CommandBufferInheritanceRenderingInfo; - - struct Viewport - { - using NativeType = VkViewport; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - Viewport( float x_ = {}, float y_ = {}, float width_ = {}, float height_ = {}, float minDepth_ = {}, float maxDepth_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - , width( width_ ) - , height( height_ ) - , minDepth( minDepth_ ) - , maxDepth( maxDepth_ ) - { - } - - VULKAN_HPP_CONSTEXPR Viewport( Viewport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Viewport( VkViewport const & rhs ) VULKAN_HPP_NOEXCEPT : Viewport( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Viewport & operator=( Viewport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Viewport & operator=( VkViewport const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Viewport & setX( float x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Viewport & setY( float y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Viewport & setWidth( float width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Viewport & setHeight( float height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Viewport & setMinDepth( float minDepth_ ) VULKAN_HPP_NOEXCEPT - { - minDepth = minDepth_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Viewport & setMaxDepth( float maxDepth_ ) VULKAN_HPP_NOEXCEPT - { - maxDepth = maxDepth_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkViewport const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkViewport &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y, width, height, minDepth, maxDepth ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Viewport const & ) const = default; -#else - bool operator==( Viewport const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ) && ( width == rhs.width ) && ( height == rhs.height ) && ( minDepth == rhs.minDepth ) && - ( maxDepth == rhs.maxDepth ); -# endif - } - - bool operator!=( Viewport const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float x = {}; - float y = {}; - float width = {}; - float height = {}; - float minDepth = {}; - float maxDepth = {}; - }; - - struct CommandBufferInheritanceViewportScissorInfoNV - { - using NativeType = VkCommandBufferInheritanceViewportScissorInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferInheritanceViewportScissorInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferInheritanceViewportScissorInfoNV( VULKAN_HPP_NAMESPACE::Bool32 viewportScissor2D_ = {}, - uint32_t viewportDepthCount_ = {}, - const VULKAN_HPP_NAMESPACE::Viewport * pViewportDepths_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , viewportScissor2D( viewportScissor2D_ ) - , viewportDepthCount( viewportDepthCount_ ) - , pViewportDepths( pViewportDepths_ ) - { - } - - VULKAN_HPP_CONSTEXPR - CommandBufferInheritanceViewportScissorInfoNV( CommandBufferInheritanceViewportScissorInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceViewportScissorInfoNV( VkCommandBufferInheritanceViewportScissorInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferInheritanceViewportScissorInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferInheritanceViewportScissorInfoNV & operator=( CommandBufferInheritanceViewportScissorInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferInheritanceViewportScissorInfoNV & operator=( VkCommandBufferInheritanceViewportScissorInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceViewportScissorInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceViewportScissorInfoNV & - setViewportScissor2D( VULKAN_HPP_NAMESPACE::Bool32 viewportScissor2D_ ) VULKAN_HPP_NOEXCEPT - { - viewportScissor2D = viewportScissor2D_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceViewportScissorInfoNV & setViewportDepthCount( uint32_t viewportDepthCount_ ) VULKAN_HPP_NOEXCEPT - { - viewportDepthCount = viewportDepthCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferInheritanceViewportScissorInfoNV & - setPViewportDepths( const VULKAN_HPP_NAMESPACE::Viewport * pViewportDepths_ ) VULKAN_HPP_NOEXCEPT - { - pViewportDepths = pViewportDepths_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferInheritanceViewportScissorInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferInheritanceViewportScissorInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, viewportScissor2D, viewportDepthCount, pViewportDepths ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferInheritanceViewportScissorInfoNV const & ) const = default; -#else - bool operator==( CommandBufferInheritanceViewportScissorInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( viewportScissor2D == rhs.viewportScissor2D ) && - ( viewportDepthCount == rhs.viewportDepthCount ) && ( pViewportDepths == rhs.pViewportDepths ); -# endif - } - - bool operator!=( CommandBufferInheritanceViewportScissorInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferInheritanceViewportScissorInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 viewportScissor2D = {}; - uint32_t viewportDepthCount = {}; - const VULKAN_HPP_NAMESPACE::Viewport * pViewportDepths = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferInheritanceViewportScissorInfoNV; - }; - - struct CommandBufferSubmitInfo - { - using NativeType = VkCommandBufferSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandBufferSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandBufferSubmitInfo( VULKAN_HPP_NAMESPACE::CommandBuffer commandBuffer_ = {}, - uint32_t deviceMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , commandBuffer( commandBuffer_ ) - , deviceMask( deviceMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandBufferSubmitInfo( CommandBufferSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferSubmitInfo( VkCommandBufferSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandBufferSubmitInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandBufferSubmitInfo & operator=( CommandBufferSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandBufferSubmitInfo & operator=( VkCommandBufferSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandBufferSubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferSubmitInfo & setCommandBuffer( VULKAN_HPP_NAMESPACE::CommandBuffer commandBuffer_ ) VULKAN_HPP_NOEXCEPT - { - commandBuffer = commandBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandBufferSubmitInfo & setDeviceMask( uint32_t deviceMask_ ) VULKAN_HPP_NOEXCEPT - { - deviceMask = deviceMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandBufferSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandBufferSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, commandBuffer, deviceMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandBufferSubmitInfo const & ) const = default; -#else - bool operator==( CommandBufferSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( commandBuffer == rhs.commandBuffer ) && ( deviceMask == rhs.deviceMask ); -# endif - } - - bool operator!=( CommandBufferSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandBufferSubmitInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CommandBuffer commandBuffer = {}; - uint32_t deviceMask = {}; - }; - - template <> - struct CppType - { - using Type = CommandBufferSubmitInfo; - }; - using CommandBufferSubmitInfoKHR = CommandBufferSubmitInfo; - - struct CommandPoolCreateInfo - { - using NativeType = VkCommandPoolCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCommandPoolCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CommandPoolCreateInfo( VULKAN_HPP_NAMESPACE::CommandPoolCreateFlags flags_ = {}, - uint32_t queueFamilyIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR CommandPoolCreateInfo( CommandPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandPoolCreateInfo( VkCommandPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : CommandPoolCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CommandPoolCreateInfo & operator=( CommandPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CommandPoolCreateInfo & operator=( VkCommandPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CommandPoolCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandPoolCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::CommandPoolCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CommandPoolCreateInfo & setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndex = queueFamilyIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCommandPoolCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCommandPoolCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, queueFamilyIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CommandPoolCreateInfo const & ) const = default; -#else - bool operator==( CommandPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( queueFamilyIndex == rhs.queueFamilyIndex ); -# endif - } - - bool operator!=( CommandPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCommandPoolCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CommandPoolCreateFlags flags = {}; - uint32_t queueFamilyIndex = {}; - }; - - template <> - struct CppType - { - using Type = CommandPoolCreateInfo; - }; - - struct SpecializationMapEntry - { - using NativeType = VkSpecializationMapEntry; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SpecializationMapEntry( uint32_t constantID_ = {}, uint32_t offset_ = {}, size_t size_ = {} ) VULKAN_HPP_NOEXCEPT - : constantID( constantID_ ) - , offset( offset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR SpecializationMapEntry( SpecializationMapEntry const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SpecializationMapEntry( VkSpecializationMapEntry const & rhs ) VULKAN_HPP_NOEXCEPT - : SpecializationMapEntry( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SpecializationMapEntry & operator=( SpecializationMapEntry const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SpecializationMapEntry & operator=( VkSpecializationMapEntry const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SpecializationMapEntry & setConstantID( uint32_t constantID_ ) VULKAN_HPP_NOEXCEPT - { - constantID = constantID_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SpecializationMapEntry & setOffset( uint32_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SpecializationMapEntry & setSize( size_t size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSpecializationMapEntry const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSpecializationMapEntry &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( constantID, offset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SpecializationMapEntry const & ) const = default; -#else - bool operator==( SpecializationMapEntry const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( constantID == rhs.constantID ) && ( offset == rhs.offset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( SpecializationMapEntry const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t constantID = {}; - uint32_t offset = {}; - size_t size = {}; - }; - - struct SpecializationInfo - { - using NativeType = VkSpecializationInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SpecializationInfo( uint32_t mapEntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::SpecializationMapEntry * pMapEntries_ = {}, - size_t dataSize_ = {}, - const void * pData_ = {} ) VULKAN_HPP_NOEXCEPT - : mapEntryCount( mapEntryCount_ ) - , pMapEntries( pMapEntries_ ) - , dataSize( dataSize_ ) - , pData( pData_ ) - { - } - - VULKAN_HPP_CONSTEXPR SpecializationInfo( SpecializationInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SpecializationInfo( VkSpecializationInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SpecializationInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - SpecializationInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & mapEntries_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_ = {} ) - : mapEntryCount( static_cast( mapEntries_.size() ) ) - , pMapEntries( mapEntries_.data() ) - , dataSize( data_.size() * sizeof( T ) ) - , pData( data_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SpecializationInfo & operator=( SpecializationInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SpecializationInfo & operator=( VkSpecializationInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SpecializationInfo & setMapEntryCount( uint32_t mapEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - mapEntryCount = mapEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SpecializationInfo & setPMapEntries( const VULKAN_HPP_NAMESPACE::SpecializationMapEntry * pMapEntries_ ) VULKAN_HPP_NOEXCEPT - { - pMapEntries = pMapEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SpecializationInfo & - setMapEntries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & mapEntries_ ) VULKAN_HPP_NOEXCEPT - { - mapEntryCount = static_cast( mapEntries_.size() ); - pMapEntries = mapEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SpecializationInfo & setDataSize( size_t dataSize_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = dataSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SpecializationInfo & setPData( const void * pData_ ) VULKAN_HPP_NOEXCEPT - { - pData = pData_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - SpecializationInfo & setData( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = data_.size() * sizeof( T ); - pData = data_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSpecializationInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSpecializationInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( mapEntryCount, pMapEntries, dataSize, pData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SpecializationInfo const & ) const = default; -#else - bool operator==( SpecializationInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( mapEntryCount == rhs.mapEntryCount ) && ( pMapEntries == rhs.pMapEntries ) && ( dataSize == rhs.dataSize ) && ( pData == rhs.pData ); -# endif - } - - bool operator!=( SpecializationInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t mapEntryCount = {}; - const VULKAN_HPP_NAMESPACE::SpecializationMapEntry * pMapEntries = {}; - size_t dataSize = {}; - const void * pData = {}; - }; - - struct PipelineShaderStageCreateInfo - { - using NativeType = VkPipelineShaderStageCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineShaderStageCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateInfo( VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits stage_ = VULKAN_HPP_NAMESPACE::ShaderStageFlagBits::eVertex, - VULKAN_HPP_NAMESPACE::ShaderModule module_ = {}, - const char * pName_ = {}, - const VULKAN_HPP_NAMESPACE::SpecializationInfo * pSpecializationInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , stage( stage_ ) - , module( module_ ) - , pName( pName_ ) - , pSpecializationInfo( pSpecializationInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineShaderStageCreateInfo( PipelineShaderStageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageCreateInfo( VkPipelineShaderStageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineShaderStageCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineShaderStageCreateInfo & operator=( PipelineShaderStageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageCreateInfo & operator=( VkPipelineShaderStageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & setStage( VULKAN_HPP_NAMESPACE::ShaderStageFlagBits stage_ ) VULKAN_HPP_NOEXCEPT - { - stage = stage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & setModule( VULKAN_HPP_NAMESPACE::ShaderModule module_ ) VULKAN_HPP_NOEXCEPT - { - module = module_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & setPName( const char * pName_ ) VULKAN_HPP_NOEXCEPT - { - pName = pName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageCreateInfo & - setPSpecializationInfo( const VULKAN_HPP_NAMESPACE::SpecializationInfo * pSpecializationInfo_ ) VULKAN_HPP_NOEXCEPT - { - pSpecializationInfo = pSpecializationInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineShaderStageCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineShaderStageCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, stage, module, pName, pSpecializationInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( PipelineShaderStageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = stage <=> rhs.stage; cmp != 0 ) - return cmp; - if ( auto cmp = module <=> rhs.module; cmp != 0 ) - return cmp; - if ( pName != rhs.pName ) - if ( auto cmp = strcmp( pName, rhs.pName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = pSpecializationInfo <=> rhs.pSpecializationInfo; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( PipelineShaderStageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( stage == rhs.stage ) && ( module == rhs.module ) && - ( ( pName == rhs.pName ) || ( strcmp( pName, rhs.pName ) == 0 ) ) && ( pSpecializationInfo == rhs.pSpecializationInfo ); - } - - bool operator!=( PipelineShaderStageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineShaderStageCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlagBits stage = VULKAN_HPP_NAMESPACE::ShaderStageFlagBits::eVertex; - VULKAN_HPP_NAMESPACE::ShaderModule module = {}; - const char * pName = {}; - const VULKAN_HPP_NAMESPACE::SpecializationInfo * pSpecializationInfo = {}; - }; - - template <> - struct CppType - { - using Type = PipelineShaderStageCreateInfo; - }; - - struct ComputePipelineCreateInfo - { - using NativeType = VkComputePipelineCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eComputePipelineCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ComputePipelineCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo stage_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , stage( stage_ ) - , layout( layout_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR ComputePipelineCreateInfo( ComputePipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ComputePipelineCreateInfo( VkComputePipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ComputePipelineCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ComputePipelineCreateInfo & operator=( ComputePipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ComputePipelineCreateInfo & operator=( VkComputePipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setStage( VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo const & stage_ ) VULKAN_HPP_NOEXCEPT - { - stage = stage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setLayout( VULKAN_HPP_NAMESPACE::PipelineLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setBasePipelineHandle( VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineHandle = basePipelineHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ComputePipelineCreateInfo & setBasePipelineIndex( int32_t basePipelineIndex_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineIndex = basePipelineIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkComputePipelineCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkComputePipelineCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, stage, layout, basePipelineHandle, basePipelineIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ComputePipelineCreateInfo const & ) const = default; -#else - bool operator==( ComputePipelineCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( stage == rhs.stage ) && ( layout == rhs.layout ) && - ( basePipelineHandle == rhs.basePipelineHandle ) && ( basePipelineIndex == rhs.basePipelineIndex ); -# endif - } - - bool operator!=( ComputePipelineCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eComputePipelineCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo stage = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout layout = {}; - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle = {}; - int32_t basePipelineIndex = {}; - }; - - template <> - struct CppType - { - using Type = ComputePipelineCreateInfo; - }; - - struct ConditionalRenderingBeginInfoEXT - { - using NativeType = VkConditionalRenderingBeginInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eConditionalRenderingBeginInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ConditionalRenderingBeginInfoEXT( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::ConditionalRenderingFlagsEXT flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , buffer( buffer_ ) - , offset( offset_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR ConditionalRenderingBeginInfoEXT( ConditionalRenderingBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ConditionalRenderingBeginInfoEXT( VkConditionalRenderingBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ConditionalRenderingBeginInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ConditionalRenderingBeginInfoEXT & operator=( ConditionalRenderingBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ConditionalRenderingBeginInfoEXT & operator=( VkConditionalRenderingBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ConditionalRenderingBeginInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConditionalRenderingBeginInfoEXT & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConditionalRenderingBeginInfoEXT & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConditionalRenderingBeginInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::ConditionalRenderingFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkConditionalRenderingBeginInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkConditionalRenderingBeginInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, buffer, offset, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ConditionalRenderingBeginInfoEXT const & ) const = default; -#else - bool operator==( ConditionalRenderingBeginInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( buffer == rhs.buffer ) && ( offset == rhs.offset ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( ConditionalRenderingBeginInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eConditionalRenderingBeginInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::ConditionalRenderingFlagsEXT flags = {}; - }; - - template <> - struct CppType - { - using Type = ConditionalRenderingBeginInfoEXT; - }; - - struct ConformanceVersion - { - using NativeType = VkConformanceVersion; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ConformanceVersion( uint8_t major_ = {}, uint8_t minor_ = {}, uint8_t subminor_ = {}, uint8_t patch_ = {} ) VULKAN_HPP_NOEXCEPT - : major( major_ ) - , minor( minor_ ) - , subminor( subminor_ ) - , patch( patch_ ) - { - } - - VULKAN_HPP_CONSTEXPR ConformanceVersion( ConformanceVersion const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ConformanceVersion( VkConformanceVersion const & rhs ) VULKAN_HPP_NOEXCEPT : ConformanceVersion( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ConformanceVersion & operator=( ConformanceVersion const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ConformanceVersion & operator=( VkConformanceVersion const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ConformanceVersion & setMajor( uint8_t major_ ) VULKAN_HPP_NOEXCEPT - { - major = major_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConformanceVersion & setMinor( uint8_t minor_ ) VULKAN_HPP_NOEXCEPT - { - minor = minor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConformanceVersion & setSubminor( uint8_t subminor_ ) VULKAN_HPP_NOEXCEPT - { - subminor = subminor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ConformanceVersion & setPatch( uint8_t patch_ ) VULKAN_HPP_NOEXCEPT - { - patch = patch_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkConformanceVersion const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkConformanceVersion &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( major, minor, subminor, patch ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ConformanceVersion const & ) const = default; -#else - bool operator==( ConformanceVersion const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( major == rhs.major ) && ( minor == rhs.minor ) && ( subminor == rhs.subminor ) && ( patch == rhs.patch ); -# endif - } - - bool operator!=( ConformanceVersion const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint8_t major = {}; - uint8_t minor = {}; - uint8_t subminor = {}; - uint8_t patch = {}; - }; - using ConformanceVersionKHR = ConformanceVersion; - - struct CooperativeMatrixPropertiesNV - { - using NativeType = VkCooperativeMatrixPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCooperativeMatrixPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CooperativeMatrixPropertiesNV( uint32_t MSize_ = {}, - uint32_t NSize_ = {}, - uint32_t KSize_ = {}, - VULKAN_HPP_NAMESPACE::ComponentTypeNV AType_ = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16, - VULKAN_HPP_NAMESPACE::ComponentTypeNV BType_ = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16, - VULKAN_HPP_NAMESPACE::ComponentTypeNV CType_ = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16, - VULKAN_HPP_NAMESPACE::ComponentTypeNV DType_ = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16, - VULKAN_HPP_NAMESPACE::ScopeNV scope_ = VULKAN_HPP_NAMESPACE::ScopeNV::eDevice, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , MSize( MSize_ ) - , NSize( NSize_ ) - , KSize( KSize_ ) - , AType( AType_ ) - , BType( BType_ ) - , CType( CType_ ) - , DType( DType_ ) - , scope( scope_ ) - { - } - - VULKAN_HPP_CONSTEXPR CooperativeMatrixPropertiesNV( CooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CooperativeMatrixPropertiesNV( VkCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : CooperativeMatrixPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CooperativeMatrixPropertiesNV & operator=( CooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CooperativeMatrixPropertiesNV & operator=( VkCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setMSize( uint32_t MSize_ ) VULKAN_HPP_NOEXCEPT - { - MSize = MSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setNSize( uint32_t NSize_ ) VULKAN_HPP_NOEXCEPT - { - NSize = NSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setKSize( uint32_t KSize_ ) VULKAN_HPP_NOEXCEPT - { - KSize = KSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setAType( VULKAN_HPP_NAMESPACE::ComponentTypeNV AType_ ) VULKAN_HPP_NOEXCEPT - { - AType = AType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setBType( VULKAN_HPP_NAMESPACE::ComponentTypeNV BType_ ) VULKAN_HPP_NOEXCEPT - { - BType = BType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setCType( VULKAN_HPP_NAMESPACE::ComponentTypeNV CType_ ) VULKAN_HPP_NOEXCEPT - { - CType = CType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setDType( VULKAN_HPP_NAMESPACE::ComponentTypeNV DType_ ) VULKAN_HPP_NOEXCEPT - { - DType = DType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CooperativeMatrixPropertiesNV & setScope( VULKAN_HPP_NAMESPACE::ScopeNV scope_ ) VULKAN_HPP_NOEXCEPT - { - scope = scope_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCooperativeMatrixPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCooperativeMatrixPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, MSize, NSize, KSize, AType, BType, CType, DType, scope ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CooperativeMatrixPropertiesNV const & ) const = default; -#else - bool operator==( CooperativeMatrixPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( MSize == rhs.MSize ) && ( NSize == rhs.NSize ) && ( KSize == rhs.KSize ) && - ( AType == rhs.AType ) && ( BType == rhs.BType ) && ( CType == rhs.CType ) && ( DType == rhs.DType ) && ( scope == rhs.scope ); -# endif - } - - bool operator!=( CooperativeMatrixPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCooperativeMatrixPropertiesNV; - void * pNext = {}; - uint32_t MSize = {}; - uint32_t NSize = {}; - uint32_t KSize = {}; - VULKAN_HPP_NAMESPACE::ComponentTypeNV AType = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16; - VULKAN_HPP_NAMESPACE::ComponentTypeNV BType = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16; - VULKAN_HPP_NAMESPACE::ComponentTypeNV CType = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16; - VULKAN_HPP_NAMESPACE::ComponentTypeNV DType = VULKAN_HPP_NAMESPACE::ComponentTypeNV::eFloat16; - VULKAN_HPP_NAMESPACE::ScopeNV scope = VULKAN_HPP_NAMESPACE::ScopeNV::eDevice; - }; - - template <> - struct CppType - { - using Type = CooperativeMatrixPropertiesNV; - }; - - struct CopyAccelerationStructureInfoKHR - { - using NativeType = VkCopyAccelerationStructureInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyAccelerationStructureInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyAccelerationStructureInfoKHR( - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst_ = {}, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , src( src_ ) - , dst( dst_ ) - , mode( mode_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyAccelerationStructureInfoKHR( CopyAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyAccelerationStructureInfoKHR( VkCopyAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyAccelerationStructureInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyAccelerationStructureInfoKHR & operator=( CopyAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyAccelerationStructureInfoKHR & operator=( VkCopyAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureInfoKHR & setSrc( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src_ ) VULKAN_HPP_NOEXCEPT - { - src = src_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureInfoKHR & setDst( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst_ ) VULKAN_HPP_NOEXCEPT - { - dst = dst_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureInfoKHR & setMode( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyAccelerationStructureInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyAccelerationStructureInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, src, dst, mode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyAccelerationStructureInfoKHR const & ) const = default; -#else - bool operator==( CopyAccelerationStructureInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( src == rhs.src ) && ( dst == rhs.dst ) && ( mode == rhs.mode ); -# endif - } - - bool operator!=( CopyAccelerationStructureInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyAccelerationStructureInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst = {}; - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone; - }; - - template <> - struct CppType - { - using Type = CopyAccelerationStructureInfoKHR; - }; - - struct CopyAccelerationStructureToMemoryInfoKHR - { - using NativeType = VkCopyAccelerationStructureToMemoryInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyAccelerationStructureToMemoryInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR( - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src_ = {}, - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR dst_ = {}, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , src( src_ ) - , dst( dst_ ) - , mode( mode_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR( CopyAccelerationStructureToMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyAccelerationStructureToMemoryInfoKHR( VkCopyAccelerationStructureToMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyAccelerationStructureToMemoryInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyAccelerationStructureToMemoryInfoKHR & operator=( CopyAccelerationStructureToMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyAccelerationStructureToMemoryInfoKHR & operator=( VkCopyAccelerationStructureToMemoryInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR & setSrc( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src_ ) VULKAN_HPP_NOEXCEPT - { - src = src_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR & setDst( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR const & dst_ ) VULKAN_HPP_NOEXCEPT - { - dst = dst_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyAccelerationStructureToMemoryInfoKHR & - setMode( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyAccelerationStructureToMemoryInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyAccelerationStructureToMemoryInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, src, dst, mode ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyAccelerationStructureToMemoryInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR src = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressKHR dst = {}; - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone; - }; - - template <> - struct CppType - { - using Type = CopyAccelerationStructureToMemoryInfoKHR; - }; - - struct CopyBufferInfo2 - { - using NativeType = VkCopyBufferInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyBufferInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyBufferInfo2( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ = {}, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer_ = {}, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::BufferCopy2 * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcBuffer( srcBuffer_ ) - , dstBuffer( dstBuffer_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyBufferInfo2( CopyBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyBufferInfo2( VkCopyBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : CopyBufferInfo2( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyBufferInfo2( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), srcBuffer( srcBuffer_ ), dstBuffer( dstBuffer_ ), regionCount( static_cast( regions_.size() ) ), pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyBufferInfo2 & operator=( CopyBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyBufferInfo2 & operator=( VkCopyBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyBufferInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferInfo2 & setSrcBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ ) VULKAN_HPP_NOEXCEPT - { - srcBuffer = srcBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferInfo2 & setDstBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer_ ) VULKAN_HPP_NOEXCEPT - { - dstBuffer = dstBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::BufferCopy2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyBufferInfo2 & setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyBufferInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyBufferInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcBuffer, dstBuffer, regionCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyBufferInfo2 const & ) const = default; -#else - bool operator==( CopyBufferInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcBuffer == rhs.srcBuffer ) && ( dstBuffer == rhs.dstBuffer ) && - ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( CopyBufferInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyBufferInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer srcBuffer = {}; - VULKAN_HPP_NAMESPACE::Buffer dstBuffer = {}; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::BufferCopy2 * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = CopyBufferInfo2; - }; - using CopyBufferInfo2KHR = CopyBufferInfo2; - - struct CopyBufferToImageInfo2 - { - using NativeType = VkCopyBufferToImageInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyBufferToImageInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyBufferToImageInfo2( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ = {}, - VULKAN_HPP_NAMESPACE::Image dstImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcBuffer( srcBuffer_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyBufferToImageInfo2( CopyBufferToImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyBufferToImageInfo2( VkCopyBufferToImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyBufferToImageInfo2( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyBufferToImageInfo2( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_, - VULKAN_HPP_NAMESPACE::Image dstImage_, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , srcBuffer( srcBuffer_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( static_cast( regions_.size() ) ) - , pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyBufferToImageInfo2 & operator=( CopyBufferToImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyBufferToImageInfo2 & operator=( VkCopyBufferToImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setSrcBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ ) VULKAN_HPP_NOEXCEPT - { - srcBuffer = srcBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setDstImage( VULKAN_HPP_NAMESPACE::Image dstImage_ ) VULKAN_HPP_NOEXCEPT - { - dstImage = dstImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setDstImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - dstImageLayout = dstImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyBufferToImageInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyBufferToImageInfo2 & - setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyBufferToImageInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyBufferToImageInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcBuffer, dstImage, dstImageLayout, regionCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyBufferToImageInfo2 const & ) const = default; -#else - bool operator==( CopyBufferToImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcBuffer == rhs.srcBuffer ) && ( dstImage == rhs.dstImage ) && - ( dstImageLayout == rhs.dstImageLayout ) && ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( CopyBufferToImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyBufferToImageInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Buffer srcBuffer = {}; - VULKAN_HPP_NAMESPACE::Image dstImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = CopyBufferToImageInfo2; - }; - using CopyBufferToImageInfo2KHR = CopyBufferToImageInfo2; - - struct CopyCommandTransformInfoQCOM - { - using NativeType = VkCopyCommandTransformInfoQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyCommandTransformInfoQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - CopyCommandTransformInfoQCOM( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , transform( transform_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyCommandTransformInfoQCOM( CopyCommandTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyCommandTransformInfoQCOM( VkCopyCommandTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyCommandTransformInfoQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyCommandTransformInfoQCOM & operator=( CopyCommandTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyCommandTransformInfoQCOM & operator=( VkCopyCommandTransformInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyCommandTransformInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyCommandTransformInfoQCOM & setTransform( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ ) VULKAN_HPP_NOEXCEPT - { - transform = transform_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyCommandTransformInfoQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyCommandTransformInfoQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, transform ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyCommandTransformInfoQCOM const & ) const = default; -#else - bool operator==( CopyCommandTransformInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( transform == rhs.transform ); -# endif - } - - bool operator!=( CopyCommandTransformInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyCommandTransformInfoQCOM; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - }; - - template <> - struct CppType - { - using Type = CopyCommandTransformInfoQCOM; - }; - - struct CopyDescriptorSet - { - using NativeType = VkCopyDescriptorSet; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyDescriptorSet; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyDescriptorSet( VULKAN_HPP_NAMESPACE::DescriptorSet srcSet_ = {}, - uint32_t srcBinding_ = {}, - uint32_t srcArrayElement_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorSet dstSet_ = {}, - uint32_t dstBinding_ = {}, - uint32_t dstArrayElement_ = {}, - uint32_t descriptorCount_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcSet( srcSet_ ) - , srcBinding( srcBinding_ ) - , srcArrayElement( srcArrayElement_ ) - , dstSet( dstSet_ ) - , dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyDescriptorSet( CopyDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyDescriptorSet( VkCopyDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT : CopyDescriptorSet( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyDescriptorSet & operator=( CopyDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyDescriptorSet & operator=( VkCopyDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setSrcSet( VULKAN_HPP_NAMESPACE::DescriptorSet srcSet_ ) VULKAN_HPP_NOEXCEPT - { - srcSet = srcSet_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setSrcBinding( uint32_t srcBinding_ ) VULKAN_HPP_NOEXCEPT - { - srcBinding = srcBinding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setSrcArrayElement( uint32_t srcArrayElement_ ) VULKAN_HPP_NOEXCEPT - { - srcArrayElement = srcArrayElement_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setDstSet( VULKAN_HPP_NAMESPACE::DescriptorSet dstSet_ ) VULKAN_HPP_NOEXCEPT - { - dstSet = dstSet_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setDstBinding( uint32_t dstBinding_ ) VULKAN_HPP_NOEXCEPT - { - dstBinding = dstBinding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setDstArrayElement( uint32_t dstArrayElement_ ) VULKAN_HPP_NOEXCEPT - { - dstArrayElement = dstArrayElement_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyDescriptorSet & setDescriptorCount( uint32_t descriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = descriptorCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyDescriptorSet const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyDescriptorSet &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcSet, srcBinding, srcArrayElement, dstSet, dstBinding, dstArrayElement, descriptorCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyDescriptorSet const & ) const = default; -#else - bool operator==( CopyDescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcSet == rhs.srcSet ) && ( srcBinding == rhs.srcBinding ) && - ( srcArrayElement == rhs.srcArrayElement ) && ( dstSet == rhs.dstSet ) && ( dstBinding == rhs.dstBinding ) && - ( dstArrayElement == rhs.dstArrayElement ) && ( descriptorCount == rhs.descriptorCount ); -# endif - } - - bool operator!=( CopyDescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyDescriptorSet; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorSet srcSet = {}; - uint32_t srcBinding = {}; - uint32_t srcArrayElement = {}; - VULKAN_HPP_NAMESPACE::DescriptorSet dstSet = {}; - uint32_t dstBinding = {}; - uint32_t dstArrayElement = {}; - uint32_t descriptorCount = {}; - }; - - template <> - struct CppType - { - using Type = CopyDescriptorSet; - }; - - struct ImageCopy2 - { - using NativeType = VkImageCopy2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageCopy2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageCopy2( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcSubresource( srcSubresource_ ) - , srcOffset( srcOffset_ ) - , dstSubresource( dstSubresource_ ) - , dstOffset( dstOffset_ ) - , extent( extent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageCopy2( ImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCopy2( VkImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT : ImageCopy2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageCopy2 & operator=( ImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCopy2 & operator=( VkImageCopy2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setSrcOffset( VULKAN_HPP_NAMESPACE::Offset3D const & srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setDstOffset( VULKAN_HPP_NAMESPACE::Offset3D const & dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy2 & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageCopy2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageCopy2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcSubresource, srcOffset, dstSubresource, dstOffset, extent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageCopy2 const & ) const = default; -#else - bool operator==( ImageCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcSubresource == rhs.srcSubresource ) && ( srcOffset == rhs.srcOffset ) && - ( dstSubresource == rhs.dstSubresource ) && ( dstOffset == rhs.dstOffset ) && ( extent == rhs.extent ); -# endif - } - - bool operator!=( ImageCopy2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageCopy2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D srcOffset = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D dstOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - }; - - template <> - struct CppType - { - using Type = ImageCopy2; - }; - using ImageCopy2KHR = ImageCopy2; - - struct CopyImageInfo2 - { - using NativeType = VkCopyImageInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyImageInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::Image dstImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageCopy2 * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyImageInfo2( CopyImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyImageInfo2( VkCopyImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : CopyImageInfo2( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_, - VULKAN_HPP_NAMESPACE::Image dstImage_, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( static_cast( regions_.size() ) ) - , pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyImageInfo2 & operator=( CopyImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyImageInfo2 & operator=( VkCopyImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setSrcImage( VULKAN_HPP_NAMESPACE::Image srcImage_ ) VULKAN_HPP_NOEXCEPT - { - srcImage = srcImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setSrcImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - srcImageLayout = srcImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setDstImage( VULKAN_HPP_NAMESPACE::Image dstImage_ ) VULKAN_HPP_NOEXCEPT - { - dstImage = dstImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setDstImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - dstImageLayout = dstImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::ImageCopy2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyImageInfo2 & setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyImageInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyImageInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyImageInfo2 const & ) const = default; -#else - bool operator==( CopyImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcImage == rhs.srcImage ) && ( srcImageLayout == rhs.srcImageLayout ) && - ( dstImage == rhs.dstImage ) && ( dstImageLayout == rhs.dstImageLayout ) && ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( CopyImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyImageInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image srcImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::Image dstImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::ImageCopy2 * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = CopyImageInfo2; - }; - using CopyImageInfo2KHR = CopyImageInfo2; - - struct CopyImageToBufferInfo2 - { - using NativeType = VkCopyImageToBufferInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyImageToBufferInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CopyImageToBufferInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer_ = {}, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstBuffer( dstBuffer_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR CopyImageToBufferInfo2( CopyImageToBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyImageToBufferInfo2( VkCopyImageToBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyImageToBufferInfo2( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyImageToBufferInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_, - VULKAN_HPP_NAMESPACE::Buffer dstBuffer_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstBuffer( dstBuffer_ ) - , regionCount( static_cast( regions_.size() ) ) - , pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyImageToBufferInfo2 & operator=( CopyImageToBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyImageToBufferInfo2 & operator=( VkCopyImageToBufferInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setSrcImage( VULKAN_HPP_NAMESPACE::Image srcImage_ ) VULKAN_HPP_NOEXCEPT - { - srcImage = srcImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setSrcImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - srcImageLayout = srcImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setDstBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBuffer_ ) VULKAN_HPP_NOEXCEPT - { - dstBuffer = dstBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyImageToBufferInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CopyImageToBufferInfo2 & - setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyImageToBufferInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyImageToBufferInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcImage, srcImageLayout, dstBuffer, regionCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CopyImageToBufferInfo2 const & ) const = default; -#else - bool operator==( CopyImageToBufferInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcImage == rhs.srcImage ) && ( srcImageLayout == rhs.srcImageLayout ) && - ( dstBuffer == rhs.dstBuffer ) && ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( CopyImageToBufferInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyImageToBufferInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image srcImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::Buffer dstBuffer = {}; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::BufferImageCopy2 * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = CopyImageToBufferInfo2; - }; - using CopyImageToBufferInfo2KHR = CopyImageToBufferInfo2; - - struct CopyMemoryToAccelerationStructureInfoKHR - { - using NativeType = VkCopyMemoryToAccelerationStructureInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCopyMemoryToAccelerationStructureInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR( - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR src_ = {}, - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst_ = {}, - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , src( src_ ) - , dst( dst_ ) - , mode( mode_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR( CopyMemoryToAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyMemoryToAccelerationStructureInfoKHR( VkCopyMemoryToAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : CopyMemoryToAccelerationStructureInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CopyMemoryToAccelerationStructureInfoKHR & operator=( CopyMemoryToAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CopyMemoryToAccelerationStructureInfoKHR & operator=( VkCopyMemoryToAccelerationStructureInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR & - setSrc( VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR const & src_ ) VULKAN_HPP_NOEXCEPT - { - src = src_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR & setDst( VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst_ ) VULKAN_HPP_NOEXCEPT - { - dst = dst_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CopyMemoryToAccelerationStructureInfoKHR & - setMode( VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCopyMemoryToAccelerationStructureInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCopyMemoryToAccelerationStructureInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, src, dst, mode ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCopyMemoryToAccelerationStructureInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceOrHostAddressConstKHR src = {}; - VULKAN_HPP_NAMESPACE::AccelerationStructureKHR dst = {}; - VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR mode = VULKAN_HPP_NAMESPACE::CopyAccelerationStructureModeKHR::eClone; - }; - - template <> - struct CppType - { - using Type = CopyMemoryToAccelerationStructureInfoKHR; - }; - - struct CuFunctionCreateInfoNVX - { - using NativeType = VkCuFunctionCreateInfoNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCuFunctionCreateInfoNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - CuFunctionCreateInfoNVX( VULKAN_HPP_NAMESPACE::CuModuleNVX module_ = {}, const char * pName_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , module( module_ ) - , pName( pName_ ) - { - } - - VULKAN_HPP_CONSTEXPR CuFunctionCreateInfoNVX( CuFunctionCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuFunctionCreateInfoNVX( VkCuFunctionCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : CuFunctionCreateInfoNVX( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CuFunctionCreateInfoNVX & operator=( CuFunctionCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuFunctionCreateInfoNVX & operator=( VkCuFunctionCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CuFunctionCreateInfoNVX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuFunctionCreateInfoNVX & setModule( VULKAN_HPP_NAMESPACE::CuModuleNVX module_ ) VULKAN_HPP_NOEXCEPT - { - module = module_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuFunctionCreateInfoNVX & setPName( const char * pName_ ) VULKAN_HPP_NOEXCEPT - { - pName = pName_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCuFunctionCreateInfoNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCuFunctionCreateInfoNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, module, pName ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( CuFunctionCreateInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = module <=> rhs.module; cmp != 0 ) - return cmp; - if ( pName != rhs.pName ) - if ( auto cmp = strcmp( pName, rhs.pName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( CuFunctionCreateInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( module == rhs.module ) && ( ( pName == rhs.pName ) || ( strcmp( pName, rhs.pName ) == 0 ) ); - } - - bool operator!=( CuFunctionCreateInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCuFunctionCreateInfoNVX; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CuModuleNVX module = {}; - const char * pName = {}; - }; - - template <> - struct CppType - { - using Type = CuFunctionCreateInfoNVX; - }; - - struct CuLaunchInfoNVX - { - using NativeType = VkCuLaunchInfoNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCuLaunchInfoNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CuLaunchInfoNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function_ = {}, - uint32_t gridDimX_ = {}, - uint32_t gridDimY_ = {}, - uint32_t gridDimZ_ = {}, - uint32_t blockDimX_ = {}, - uint32_t blockDimY_ = {}, - uint32_t blockDimZ_ = {}, - uint32_t sharedMemBytes_ = {}, - size_t paramCount_ = {}, - const void * const * pParams_ = {}, - size_t extraCount_ = {}, - const void * const * pExtras_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , function( function_ ) - , gridDimX( gridDimX_ ) - , gridDimY( gridDimY_ ) - , gridDimZ( gridDimZ_ ) - , blockDimX( blockDimX_ ) - , blockDimY( blockDimY_ ) - , blockDimZ( blockDimZ_ ) - , sharedMemBytes( sharedMemBytes_ ) - , paramCount( paramCount_ ) - , pParams( pParams_ ) - , extraCount( extraCount_ ) - , pExtras( pExtras_ ) - { - } - - VULKAN_HPP_CONSTEXPR CuLaunchInfoNVX( CuLaunchInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuLaunchInfoNVX( VkCuLaunchInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT : CuLaunchInfoNVX( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CuLaunchInfoNVX( VULKAN_HPP_NAMESPACE::CuFunctionNVX function_, - uint32_t gridDimX_, - uint32_t gridDimY_, - uint32_t gridDimZ_, - uint32_t blockDimX_, - uint32_t blockDimY_, - uint32_t blockDimZ_, - uint32_t sharedMemBytes_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & params_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & extras_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , function( function_ ) - , gridDimX( gridDimX_ ) - , gridDimY( gridDimY_ ) - , gridDimZ( gridDimZ_ ) - , blockDimX( blockDimX_ ) - , blockDimY( blockDimY_ ) - , blockDimZ( blockDimZ_ ) - , sharedMemBytes( sharedMemBytes_ ) - , paramCount( params_.size() ) - , pParams( params_.data() ) - , extraCount( extras_.size() ) - , pExtras( extras_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CuLaunchInfoNVX & operator=( CuLaunchInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuLaunchInfoNVX & operator=( VkCuLaunchInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setFunction( VULKAN_HPP_NAMESPACE::CuFunctionNVX function_ ) VULKAN_HPP_NOEXCEPT - { - function = function_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setGridDimX( uint32_t gridDimX_ ) VULKAN_HPP_NOEXCEPT - { - gridDimX = gridDimX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setGridDimY( uint32_t gridDimY_ ) VULKAN_HPP_NOEXCEPT - { - gridDimY = gridDimY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setGridDimZ( uint32_t gridDimZ_ ) VULKAN_HPP_NOEXCEPT - { - gridDimZ = gridDimZ_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setBlockDimX( uint32_t blockDimX_ ) VULKAN_HPP_NOEXCEPT - { - blockDimX = blockDimX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setBlockDimY( uint32_t blockDimY_ ) VULKAN_HPP_NOEXCEPT - { - blockDimY = blockDimY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setBlockDimZ( uint32_t blockDimZ_ ) VULKAN_HPP_NOEXCEPT - { - blockDimZ = blockDimZ_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setSharedMemBytes( uint32_t sharedMemBytes_ ) VULKAN_HPP_NOEXCEPT - { - sharedMemBytes = sharedMemBytes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setParamCount( size_t paramCount_ ) VULKAN_HPP_NOEXCEPT - { - paramCount = paramCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setPParams( const void * const * pParams_ ) VULKAN_HPP_NOEXCEPT - { - pParams = pParams_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CuLaunchInfoNVX & setParams( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & params_ ) VULKAN_HPP_NOEXCEPT - { - paramCount = params_.size(); - pParams = params_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setExtraCount( size_t extraCount_ ) VULKAN_HPP_NOEXCEPT - { - extraCount = extraCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuLaunchInfoNVX & setPExtras( const void * const * pExtras_ ) VULKAN_HPP_NOEXCEPT - { - pExtras = pExtras_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - CuLaunchInfoNVX & setExtras( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & extras_ ) VULKAN_HPP_NOEXCEPT - { - extraCount = extras_.size(); - pExtras = extras_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCuLaunchInfoNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCuLaunchInfoNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, function, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, paramCount, pParams, extraCount, pExtras ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CuLaunchInfoNVX const & ) const = default; -#else - bool operator==( CuLaunchInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( function == rhs.function ) && ( gridDimX == rhs.gridDimX ) && ( gridDimY == rhs.gridDimY ) && - ( gridDimZ == rhs.gridDimZ ) && ( blockDimX == rhs.blockDimX ) && ( blockDimY == rhs.blockDimY ) && ( blockDimZ == rhs.blockDimZ ) && - ( sharedMemBytes == rhs.sharedMemBytes ) && ( paramCount == rhs.paramCount ) && ( pParams == rhs.pParams ) && ( extraCount == rhs.extraCount ) && - ( pExtras == rhs.pExtras ); -# endif - } - - bool operator!=( CuLaunchInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCuLaunchInfoNVX; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CuFunctionNVX function = {}; - uint32_t gridDimX = {}; - uint32_t gridDimY = {}; - uint32_t gridDimZ = {}; - uint32_t blockDimX = {}; - uint32_t blockDimY = {}; - uint32_t blockDimZ = {}; - uint32_t sharedMemBytes = {}; - size_t paramCount = {}; - const void * const * pParams = {}; - size_t extraCount = {}; - const void * const * pExtras = {}; - }; - - template <> - struct CppType - { - using Type = CuLaunchInfoNVX; - }; - - struct CuModuleCreateInfoNVX - { - using NativeType = VkCuModuleCreateInfoNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eCuModuleCreateInfoNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR CuModuleCreateInfoNVX( size_t dataSize_ = {}, const void * pData_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dataSize( dataSize_ ) - , pData( pData_ ) - { - } - - VULKAN_HPP_CONSTEXPR CuModuleCreateInfoNVX( CuModuleCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuModuleCreateInfoNVX( VkCuModuleCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : CuModuleCreateInfoNVX( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - CuModuleCreateInfoNVX( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), dataSize( data_.size() * sizeof( T ) ), pData( data_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - CuModuleCreateInfoNVX & operator=( CuModuleCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - CuModuleCreateInfoNVX & operator=( VkCuModuleCreateInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 CuModuleCreateInfoNVX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuModuleCreateInfoNVX & setDataSize( size_t dataSize_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = dataSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 CuModuleCreateInfoNVX & setPData( const void * pData_ ) VULKAN_HPP_NOEXCEPT - { - pData = pData_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - CuModuleCreateInfoNVX & setData( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = data_.size() * sizeof( T ); - pData = data_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkCuModuleCreateInfoNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkCuModuleCreateInfoNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dataSize, pData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( CuModuleCreateInfoNVX const & ) const = default; -#else - bool operator==( CuModuleCreateInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dataSize == rhs.dataSize ) && ( pData == rhs.pData ); -# endif - } - - bool operator!=( CuModuleCreateInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eCuModuleCreateInfoNVX; - const void * pNext = {}; - size_t dataSize = {}; - const void * pData = {}; - }; - - template <> - struct CppType - { - using Type = CuModuleCreateInfoNVX; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct D3D12FenceSubmitInfoKHR - { - using NativeType = VkD3D12FenceSubmitInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eD3D12FenceSubmitInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR D3D12FenceSubmitInfoKHR( uint32_t waitSemaphoreValuesCount_ = {}, - const uint64_t * pWaitSemaphoreValues_ = {}, - uint32_t signalSemaphoreValuesCount_ = {}, - const uint64_t * pSignalSemaphoreValues_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreValuesCount( waitSemaphoreValuesCount_ ) - , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) - , signalSemaphoreValuesCount( signalSemaphoreValuesCount_ ) - , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) - { - } - - VULKAN_HPP_CONSTEXPR D3D12FenceSubmitInfoKHR( D3D12FenceSubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - D3D12FenceSubmitInfoKHR( VkD3D12FenceSubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : D3D12FenceSubmitInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - D3D12FenceSubmitInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreValues_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreValues_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreValuesCount( static_cast( waitSemaphoreValues_.size() ) ) - , pWaitSemaphoreValues( waitSemaphoreValues_.data() ) - , signalSemaphoreValuesCount( static_cast( signalSemaphoreValues_.size() ) ) - , pSignalSemaphoreValues( signalSemaphoreValues_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - D3D12FenceSubmitInfoKHR & operator=( D3D12FenceSubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - D3D12FenceSubmitInfoKHR & operator=( VkD3D12FenceSubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 D3D12FenceSubmitInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 D3D12FenceSubmitInfoKHR & setWaitSemaphoreValuesCount( uint32_t waitSemaphoreValuesCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreValuesCount = waitSemaphoreValuesCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 D3D12FenceSubmitInfoKHR & setPWaitSemaphoreValues( const uint64_t * pWaitSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphoreValues = pWaitSemaphoreValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - D3D12FenceSubmitInfoKHR & - setWaitSemaphoreValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreValuesCount = static_cast( waitSemaphoreValues_.size() ); - pWaitSemaphoreValues = waitSemaphoreValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 D3D12FenceSubmitInfoKHR & setSignalSemaphoreValuesCount( uint32_t signalSemaphoreValuesCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreValuesCount = signalSemaphoreValuesCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 D3D12FenceSubmitInfoKHR & setPSignalSemaphoreValues( const uint64_t * pSignalSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphoreValues = pSignalSemaphoreValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - D3D12FenceSubmitInfoKHR & - setSignalSemaphoreValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreValuesCount = static_cast( signalSemaphoreValues_.size() ); - pSignalSemaphoreValues = signalSemaphoreValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkD3D12FenceSubmitInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkD3D12FenceSubmitInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, waitSemaphoreValuesCount, pWaitSemaphoreValues, signalSemaphoreValuesCount, pSignalSemaphoreValues ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( D3D12FenceSubmitInfoKHR const & ) const = default; -# else - bool operator==( D3D12FenceSubmitInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreValuesCount == rhs.waitSemaphoreValuesCount ) && - ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) && ( signalSemaphoreValuesCount == rhs.signalSemaphoreValuesCount ) && - ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); -# endif - } - - bool operator!=( D3D12FenceSubmitInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eD3D12FenceSubmitInfoKHR; - const void * pNext = {}; - uint32_t waitSemaphoreValuesCount = {}; - const uint64_t * pWaitSemaphoreValues = {}; - uint32_t signalSemaphoreValuesCount = {}; - const uint64_t * pSignalSemaphoreValues = {}; - }; - - template <> - struct CppType - { - using Type = D3D12FenceSubmitInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct DebugMarkerMarkerInfoEXT - { - using NativeType = VkDebugMarkerMarkerInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugMarkerMarkerInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - DebugMarkerMarkerInfoEXT( const char * pMarkerName_ = {}, std::array const & color_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pMarkerName( pMarkerName_ ) - , color( color_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerMarkerInfoEXT( DebugMarkerMarkerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerMarkerInfoEXT( VkDebugMarkerMarkerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugMarkerMarkerInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugMarkerMarkerInfoEXT & operator=( DebugMarkerMarkerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerMarkerInfoEXT & operator=( VkDebugMarkerMarkerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugMarkerMarkerInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerMarkerInfoEXT & setPMarkerName( const char * pMarkerName_ ) VULKAN_HPP_NOEXCEPT - { - pMarkerName = pMarkerName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerMarkerInfoEXT & setColor( std::array color_ ) VULKAN_HPP_NOEXCEPT - { - color = color_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugMarkerMarkerInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugMarkerMarkerInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pMarkerName, color ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::partial_ordering operator<=>( DebugMarkerMarkerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( pMarkerName != rhs.pMarkerName ) - if ( auto cmp = strcmp( pMarkerName, rhs.pMarkerName ); cmp != 0 ) - return ( cmp < 0 ) ? std::partial_ordering::less : std::partial_ordering::greater; - if ( auto cmp = color <=> rhs.color; cmp != 0 ) - return cmp; - - return std::partial_ordering::equivalent; - } -#endif - - bool operator==( DebugMarkerMarkerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ( pMarkerName == rhs.pMarkerName ) || ( strcmp( pMarkerName, rhs.pMarkerName ) == 0 ) ) && - ( color == rhs.color ); - } - - bool operator!=( DebugMarkerMarkerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugMarkerMarkerInfoEXT; - const void * pNext = {}; - const char * pMarkerName = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D color = {}; - }; - - template <> - struct CppType - { - using Type = DebugMarkerMarkerInfoEXT; - }; - - struct DebugMarkerObjectNameInfoEXT - { - using NativeType = VkDebugMarkerObjectNameInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugMarkerObjectNameInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DebugMarkerObjectNameInfoEXT( VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_ = VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown, - uint64_t object_ = {}, - const char * pObjectName_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , objectType( objectType_ ) - , object( object_ ) - , pObjectName( pObjectName_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugMarkerObjectNameInfoEXT( DebugMarkerObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerObjectNameInfoEXT( VkDebugMarkerObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugMarkerObjectNameInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugMarkerObjectNameInfoEXT & operator=( DebugMarkerObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerObjectNameInfoEXT & operator=( VkDebugMarkerObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectNameInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectNameInfoEXT & setObjectType( VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_ ) VULKAN_HPP_NOEXCEPT - { - objectType = objectType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectNameInfoEXT & setObject( uint64_t object_ ) VULKAN_HPP_NOEXCEPT - { - object = object_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectNameInfoEXT & setPObjectName( const char * pObjectName_ ) VULKAN_HPP_NOEXCEPT - { - pObjectName = pObjectName_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugMarkerObjectNameInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugMarkerObjectNameInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, objectType, object, pObjectName ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( DebugMarkerObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = objectType <=> rhs.objectType; cmp != 0 ) - return cmp; - if ( auto cmp = object <=> rhs.object; cmp != 0 ) - return cmp; - if ( pObjectName != rhs.pObjectName ) - if ( auto cmp = strcmp( pObjectName, rhs.pObjectName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( DebugMarkerObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( objectType == rhs.objectType ) && ( object == rhs.object ) && - ( ( pObjectName == rhs.pObjectName ) || ( strcmp( pObjectName, rhs.pObjectName ) == 0 ) ); - } - - bool operator!=( DebugMarkerObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugMarkerObjectNameInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType = VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - uint64_t object = {}; - const char * pObjectName = {}; - }; - - template <> - struct CppType - { - using Type = DebugMarkerObjectNameInfoEXT; - }; - - struct DebugMarkerObjectTagInfoEXT - { - using NativeType = VkDebugMarkerObjectTagInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugMarkerObjectTagInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DebugMarkerObjectTagInfoEXT( VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_ = VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown, - uint64_t object_ = {}, - uint64_t tagName_ = {}, - size_t tagSize_ = {}, - const void * pTag_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , objectType( objectType_ ) - , object( object_ ) - , tagName( tagName_ ) - , tagSize( tagSize_ ) - , pTag( pTag_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugMarkerObjectTagInfoEXT( DebugMarkerObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerObjectTagInfoEXT( VkDebugMarkerObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugMarkerObjectTagInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - DebugMarkerObjectTagInfoEXT( VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_, - uint64_t object_, - uint64_t tagName_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tag_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), objectType( objectType_ ), object( object_ ), tagName( tagName_ ), tagSize( tag_.size() * sizeof( T ) ), pTag( tag_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugMarkerObjectTagInfoEXT & operator=( DebugMarkerObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugMarkerObjectTagInfoEXT & operator=( VkDebugMarkerObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setObjectType( VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType_ ) VULKAN_HPP_NOEXCEPT - { - objectType = objectType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setObject( uint64_t object_ ) VULKAN_HPP_NOEXCEPT - { - object = object_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setTagName( uint64_t tagName_ ) VULKAN_HPP_NOEXCEPT - { - tagName = tagName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setTagSize( size_t tagSize_ ) VULKAN_HPP_NOEXCEPT - { - tagSize = tagSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugMarkerObjectTagInfoEXT & setPTag( const void * pTag_ ) VULKAN_HPP_NOEXCEPT - { - pTag = pTag_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - DebugMarkerObjectTagInfoEXT & setTag( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tag_ ) VULKAN_HPP_NOEXCEPT - { - tagSize = tag_.size() * sizeof( T ); - pTag = tag_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugMarkerObjectTagInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugMarkerObjectTagInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, objectType, object, tagName, tagSize, pTag ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DebugMarkerObjectTagInfoEXT const & ) const = default; -#else - bool operator==( DebugMarkerObjectTagInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( objectType == rhs.objectType ) && ( object == rhs.object ) && ( tagName == rhs.tagName ) && - ( tagSize == rhs.tagSize ) && ( pTag == rhs.pTag ); -# endif - } - - bool operator!=( DebugMarkerObjectTagInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugMarkerObjectTagInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT objectType = VULKAN_HPP_NAMESPACE::DebugReportObjectTypeEXT::eUnknown; - uint64_t object = {}; - uint64_t tagName = {}; - size_t tagSize = {}; - const void * pTag = {}; - }; - - template <> - struct CppType - { - using Type = DebugMarkerObjectTagInfoEXT; - }; - - struct DebugReportCallbackCreateInfoEXT - { - using NativeType = VkDebugReportCallbackCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugReportCallbackCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DebugReportCallbackCreateInfoEXT( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags_ = {}, - PFN_vkDebugReportCallbackEXT pfnCallback_ = {}, - void * pUserData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pfnCallback( pfnCallback_ ) - , pUserData( pUserData_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugReportCallbackCreateInfoEXT( DebugReportCallbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugReportCallbackCreateInfoEXT( VkDebugReportCallbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugReportCallbackCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugReportCallbackCreateInfoEXT & operator=( DebugReportCallbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugReportCallbackCreateInfoEXT & operator=( VkDebugReportCallbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugReportCallbackCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugReportCallbackCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugReportCallbackCreateInfoEXT & setPfnCallback( PFN_vkDebugReportCallbackEXT pfnCallback_ ) VULKAN_HPP_NOEXCEPT - { - pfnCallback = pfnCallback_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugReportCallbackCreateInfoEXT & setPUserData( void * pUserData_ ) VULKAN_HPP_NOEXCEPT - { - pUserData = pUserData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugReportCallbackCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugReportCallbackCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pfnCallback, pUserData ); - } -#endif - - bool operator==( DebugReportCallbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -#if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -#else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pfnCallback == rhs.pfnCallback ) && ( pUserData == rhs.pUserData ); -#endif - } - - bool operator!=( DebugReportCallbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugReportCallbackCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DebugReportFlagsEXT flags = {}; - PFN_vkDebugReportCallbackEXT pfnCallback = {}; - void * pUserData = {}; - }; - - template <> - struct CppType - { - using Type = DebugReportCallbackCreateInfoEXT; - }; - - struct DebugUtilsLabelEXT - { - using NativeType = VkDebugUtilsLabelEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugUtilsLabelEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - DebugUtilsLabelEXT( const char * pLabelName_ = {}, std::array const & color_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pLabelName( pLabelName_ ) - , color( color_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsLabelEXT( DebugUtilsLabelEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsLabelEXT( VkDebugUtilsLabelEXT const & rhs ) VULKAN_HPP_NOEXCEPT : DebugUtilsLabelEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugUtilsLabelEXT & operator=( DebugUtilsLabelEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsLabelEXT & operator=( VkDebugUtilsLabelEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsLabelEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsLabelEXT & setPLabelName( const char * pLabelName_ ) VULKAN_HPP_NOEXCEPT - { - pLabelName = pLabelName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsLabelEXT & setColor( std::array color_ ) VULKAN_HPP_NOEXCEPT - { - color = color_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugUtilsLabelEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugUtilsLabelEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pLabelName, color ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::partial_ordering operator<=>( DebugUtilsLabelEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( pLabelName != rhs.pLabelName ) - if ( auto cmp = strcmp( pLabelName, rhs.pLabelName ); cmp != 0 ) - return ( cmp < 0 ) ? std::partial_ordering::less : std::partial_ordering::greater; - if ( auto cmp = color <=> rhs.color; cmp != 0 ) - return cmp; - - return std::partial_ordering::equivalent; - } -#endif - - bool operator==( DebugUtilsLabelEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ( pLabelName == rhs.pLabelName ) || ( strcmp( pLabelName, rhs.pLabelName ) == 0 ) ) && - ( color == rhs.color ); - } - - bool operator!=( DebugUtilsLabelEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugUtilsLabelEXT; - const void * pNext = {}; - const char * pLabelName = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D color = {}; - }; - - template <> - struct CppType - { - using Type = DebugUtilsLabelEXT; - }; - - struct DebugUtilsObjectNameInfoEXT - { - using NativeType = VkDebugUtilsObjectNameInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugUtilsObjectNameInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DebugUtilsObjectNameInfoEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_ = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown, - uint64_t objectHandle_ = {}, - const char * pObjectName_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , objectType( objectType_ ) - , objectHandle( objectHandle_ ) - , pObjectName( pObjectName_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugUtilsObjectNameInfoEXT( DebugUtilsObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsObjectNameInfoEXT( VkDebugUtilsObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugUtilsObjectNameInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugUtilsObjectNameInfoEXT & operator=( DebugUtilsObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsObjectNameInfoEXT & operator=( VkDebugUtilsObjectNameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectNameInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectNameInfoEXT & setObjectType( VULKAN_HPP_NAMESPACE::ObjectType objectType_ ) VULKAN_HPP_NOEXCEPT - { - objectType = objectType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectNameInfoEXT & setObjectHandle( uint64_t objectHandle_ ) VULKAN_HPP_NOEXCEPT - { - objectHandle = objectHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectNameInfoEXT & setPObjectName( const char * pObjectName_ ) VULKAN_HPP_NOEXCEPT - { - pObjectName = pObjectName_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugUtilsObjectNameInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugUtilsObjectNameInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, objectType, objectHandle, pObjectName ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( DebugUtilsObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = objectType <=> rhs.objectType; cmp != 0 ) - return cmp; - if ( auto cmp = objectHandle <=> rhs.objectHandle; cmp != 0 ) - return cmp; - if ( pObjectName != rhs.pObjectName ) - if ( auto cmp = strcmp( pObjectName, rhs.pObjectName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( DebugUtilsObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( objectType == rhs.objectType ) && ( objectHandle == rhs.objectHandle ) && - ( ( pObjectName == rhs.pObjectName ) || ( strcmp( pObjectName, rhs.pObjectName ) == 0 ) ); - } - - bool operator!=( DebugUtilsObjectNameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugUtilsObjectNameInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown; - uint64_t objectHandle = {}; - const char * pObjectName = {}; - }; - - template <> - struct CppType - { - using Type = DebugUtilsObjectNameInfoEXT; - }; - - struct DebugUtilsMessengerCallbackDataEXT - { - using NativeType = VkDebugUtilsMessengerCallbackDataEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugUtilsMessengerCallbackDataEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataFlagsEXT flags_ = {}, - const char * pMessageIdName_ = {}, - int32_t messageIdNumber_ = {}, - const char * pMessage_ = {}, - uint32_t queueLabelCount_ = {}, - const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pQueueLabels_ = {}, - uint32_t cmdBufLabelCount_ = {}, - const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pCmdBufLabels_ = {}, - uint32_t objectCount_ = {}, - const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT * pObjects_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pMessageIdName( pMessageIdName_ ) - , messageIdNumber( messageIdNumber_ ) - , pMessage( pMessage_ ) - , queueLabelCount( queueLabelCount_ ) - , pQueueLabels( pQueueLabels_ ) - , cmdBufLabelCount( cmdBufLabelCount_ ) - , pCmdBufLabels( pCmdBufLabels_ ) - , objectCount( objectCount_ ) - , pObjects( pObjects_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT( DebugUtilsMessengerCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsMessengerCallbackDataEXT( VkDebugUtilsMessengerCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugUtilsMessengerCallbackDataEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DebugUtilsMessengerCallbackDataEXT( - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataFlagsEXT flags_, - const char * pMessageIdName_, - int32_t messageIdNumber_, - const char * pMessage_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueLabels_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & cmdBufLabels_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & objects_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , pMessageIdName( pMessageIdName_ ) - , messageIdNumber( messageIdNumber_ ) - , pMessage( pMessage_ ) - , queueLabelCount( static_cast( queueLabels_.size() ) ) - , pQueueLabels( queueLabels_.data() ) - , cmdBufLabelCount( static_cast( cmdBufLabels_.size() ) ) - , pCmdBufLabels( cmdBufLabels_.data() ) - , objectCount( static_cast( objects_.size() ) ) - , pObjects( objects_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugUtilsMessengerCallbackDataEXT & operator=( DebugUtilsMessengerCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsMessengerCallbackDataEXT & operator=( VkDebugUtilsMessengerCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & - setFlags( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setPMessageIdName( const char * pMessageIdName_ ) VULKAN_HPP_NOEXCEPT - { - pMessageIdName = pMessageIdName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setMessageIdNumber( int32_t messageIdNumber_ ) VULKAN_HPP_NOEXCEPT - { - messageIdNumber = messageIdNumber_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setPMessage( const char * pMessage_ ) VULKAN_HPP_NOEXCEPT - { - pMessage = pMessage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setQueueLabelCount( uint32_t queueLabelCount_ ) VULKAN_HPP_NOEXCEPT - { - queueLabelCount = queueLabelCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & - setPQueueLabels( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pQueueLabels_ ) VULKAN_HPP_NOEXCEPT - { - pQueueLabels = pQueueLabels_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DebugUtilsMessengerCallbackDataEXT & - setQueueLabels( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueLabels_ ) VULKAN_HPP_NOEXCEPT - { - queueLabelCount = static_cast( queueLabels_.size() ); - pQueueLabels = queueLabels_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setCmdBufLabelCount( uint32_t cmdBufLabelCount_ ) VULKAN_HPP_NOEXCEPT - { - cmdBufLabelCount = cmdBufLabelCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & - setPCmdBufLabels( const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pCmdBufLabels_ ) VULKAN_HPP_NOEXCEPT - { - pCmdBufLabels = pCmdBufLabels_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DebugUtilsMessengerCallbackDataEXT & - setCmdBufLabels( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & cmdBufLabels_ ) VULKAN_HPP_NOEXCEPT - { - cmdBufLabelCount = static_cast( cmdBufLabels_.size() ); - pCmdBufLabels = cmdBufLabels_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & setObjectCount( uint32_t objectCount_ ) VULKAN_HPP_NOEXCEPT - { - objectCount = objectCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCallbackDataEXT & - setPObjects( const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT * pObjects_ ) VULKAN_HPP_NOEXCEPT - { - pObjects = pObjects_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DebugUtilsMessengerCallbackDataEXT & - setObjects( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & objects_ ) VULKAN_HPP_NOEXCEPT - { - objectCount = static_cast( objects_.size() ); - pObjects = objects_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugUtilsMessengerCallbackDataEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugUtilsMessengerCallbackDataEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, flags, pMessageIdName, messageIdNumber, pMessage, queueLabelCount, pQueueLabels, cmdBufLabelCount, pCmdBufLabels, objectCount, pObjects ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( DebugUtilsMessengerCallbackDataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( pMessageIdName != rhs.pMessageIdName ) - if ( auto cmp = strcmp( pMessageIdName, rhs.pMessageIdName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = messageIdNumber <=> rhs.messageIdNumber; cmp != 0 ) - return cmp; - if ( pMessage != rhs.pMessage ) - if ( auto cmp = strcmp( pMessage, rhs.pMessage ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = queueLabelCount <=> rhs.queueLabelCount; cmp != 0 ) - return cmp; - if ( auto cmp = pQueueLabels <=> rhs.pQueueLabels; cmp != 0 ) - return cmp; - if ( auto cmp = cmdBufLabelCount <=> rhs.cmdBufLabelCount; cmp != 0 ) - return cmp; - if ( auto cmp = pCmdBufLabels <=> rhs.pCmdBufLabels; cmp != 0 ) - return cmp; - if ( auto cmp = objectCount <=> rhs.objectCount; cmp != 0 ) - return cmp; - if ( auto cmp = pObjects <=> rhs.pObjects; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( DebugUtilsMessengerCallbackDataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( ( pMessageIdName == rhs.pMessageIdName ) || ( strcmp( pMessageIdName, rhs.pMessageIdName ) == 0 ) ) && - ( messageIdNumber == rhs.messageIdNumber ) && ( ( pMessage == rhs.pMessage ) || ( strcmp( pMessage, rhs.pMessage ) == 0 ) ) && - ( queueLabelCount == rhs.queueLabelCount ) && ( pQueueLabels == rhs.pQueueLabels ) && ( cmdBufLabelCount == rhs.cmdBufLabelCount ) && - ( pCmdBufLabels == rhs.pCmdBufLabels ) && ( objectCount == rhs.objectCount ) && ( pObjects == rhs.pObjects ); - } - - bool operator!=( DebugUtilsMessengerCallbackDataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugUtilsMessengerCallbackDataEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCallbackDataFlagsEXT flags = {}; - const char * pMessageIdName = {}; - int32_t messageIdNumber = {}; - const char * pMessage = {}; - uint32_t queueLabelCount = {}; - const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pQueueLabels = {}; - uint32_t cmdBufLabelCount = {}; - const VULKAN_HPP_NAMESPACE::DebugUtilsLabelEXT * pCmdBufLabels = {}; - uint32_t objectCount = {}; - const VULKAN_HPP_NAMESPACE::DebugUtilsObjectNameInfoEXT * pObjects = {}; - }; - - template <> - struct CppType - { - using Type = DebugUtilsMessengerCallbackDataEXT; - }; - - struct DebugUtilsMessengerCreateInfoEXT - { - using NativeType = VkDebugUtilsMessengerCreateInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugUtilsMessengerCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DebugUtilsMessengerCreateInfoEXT( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagsEXT messageSeverity_ = {}, - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageType_ = {}, - PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback_ = {}, - void * pUserData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , messageSeverity( messageSeverity_ ) - , messageType( messageType_ ) - , pfnUserCallback( pfnUserCallback_ ) - , pUserData( pUserData_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugUtilsMessengerCreateInfoEXT( DebugUtilsMessengerCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsMessengerCreateInfoEXT( VkDebugUtilsMessengerCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugUtilsMessengerCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugUtilsMessengerCreateInfoEXT & operator=( DebugUtilsMessengerCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsMessengerCreateInfoEXT & operator=( VkDebugUtilsMessengerCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & - setMessageSeverity( VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagsEXT messageSeverity_ ) VULKAN_HPP_NOEXCEPT - { - messageSeverity = messageSeverity_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & - setMessageType( VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageType_ ) VULKAN_HPP_NOEXCEPT - { - messageType = messageType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & setPfnUserCallback( PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback_ ) VULKAN_HPP_NOEXCEPT - { - pfnUserCallback = pfnUserCallback_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsMessengerCreateInfoEXT & setPUserData( void * pUserData_ ) VULKAN_HPP_NOEXCEPT - { - pUserData = pUserData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugUtilsMessengerCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugUtilsMessengerCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, messageSeverity, messageType, pfnUserCallback, pUserData ); - } -#endif - - bool operator==( DebugUtilsMessengerCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -#if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -#else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( messageSeverity == rhs.messageSeverity ) && - ( messageType == rhs.messageType ) && ( pfnUserCallback == rhs.pfnUserCallback ) && ( pUserData == rhs.pUserData ); -#endif - } - - bool operator!=( DebugUtilsMessengerCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugUtilsMessengerCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DebugUtilsMessengerCreateFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::DebugUtilsMessageSeverityFlagsEXT messageSeverity = {}; - VULKAN_HPP_NAMESPACE::DebugUtilsMessageTypeFlagsEXT messageType = {}; - PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback = {}; - void * pUserData = {}; - }; - - template <> - struct CppType - { - using Type = DebugUtilsMessengerCreateInfoEXT; - }; - - struct DebugUtilsObjectTagInfoEXT - { - using NativeType = VkDebugUtilsObjectTagInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDebugUtilsObjectTagInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DebugUtilsObjectTagInfoEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_ = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown, - uint64_t objectHandle_ = {}, - uint64_t tagName_ = {}, - size_t tagSize_ = {}, - const void * pTag_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , objectType( objectType_ ) - , objectHandle( objectHandle_ ) - , tagName( tagName_ ) - , tagSize( tagSize_ ) - , pTag( pTag_ ) - { - } - - VULKAN_HPP_CONSTEXPR DebugUtilsObjectTagInfoEXT( DebugUtilsObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsObjectTagInfoEXT( VkDebugUtilsObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DebugUtilsObjectTagInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - DebugUtilsObjectTagInfoEXT( VULKAN_HPP_NAMESPACE::ObjectType objectType_, - uint64_t objectHandle_, - uint64_t tagName_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tag_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , objectType( objectType_ ) - , objectHandle( objectHandle_ ) - , tagName( tagName_ ) - , tagSize( tag_.size() * sizeof( T ) ) - , pTag( tag_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DebugUtilsObjectTagInfoEXT & operator=( DebugUtilsObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DebugUtilsObjectTagInfoEXT & operator=( VkDebugUtilsObjectTagInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setObjectType( VULKAN_HPP_NAMESPACE::ObjectType objectType_ ) VULKAN_HPP_NOEXCEPT - { - objectType = objectType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setObjectHandle( uint64_t objectHandle_ ) VULKAN_HPP_NOEXCEPT - { - objectHandle = objectHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setTagName( uint64_t tagName_ ) VULKAN_HPP_NOEXCEPT - { - tagName = tagName_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setTagSize( size_t tagSize_ ) VULKAN_HPP_NOEXCEPT - { - tagSize = tagSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DebugUtilsObjectTagInfoEXT & setPTag( const void * pTag_ ) VULKAN_HPP_NOEXCEPT - { - pTag = pTag_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - DebugUtilsObjectTagInfoEXT & setTag( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tag_ ) VULKAN_HPP_NOEXCEPT - { - tagSize = tag_.size() * sizeof( T ); - pTag = tag_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDebugUtilsObjectTagInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDebugUtilsObjectTagInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, objectType, objectHandle, tagName, tagSize, pTag ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DebugUtilsObjectTagInfoEXT const & ) const = default; -#else - bool operator==( DebugUtilsObjectTagInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( objectType == rhs.objectType ) && ( objectHandle == rhs.objectHandle ) && - ( tagName == rhs.tagName ) && ( tagSize == rhs.tagSize ) && ( pTag == rhs.pTag ); -# endif - } - - bool operator!=( DebugUtilsObjectTagInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDebugUtilsObjectTagInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown; - uint64_t objectHandle = {}; - uint64_t tagName = {}; - size_t tagSize = {}; - const void * pTag = {}; - }; - - template <> - struct CppType - { - using Type = DebugUtilsObjectTagInfoEXT; - }; - - struct DedicatedAllocationBufferCreateInfoNV - { - using NativeType = VkDedicatedAllocationBufferCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDedicatedAllocationBufferCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DedicatedAllocationBufferCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dedicatedAllocation( dedicatedAllocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR DedicatedAllocationBufferCreateInfoNV( DedicatedAllocationBufferCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationBufferCreateInfoNV( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : DedicatedAllocationBufferCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DedicatedAllocationBufferCreateInfoNV & operator=( DedicatedAllocationBufferCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationBufferCreateInfoNV & operator=( VkDedicatedAllocationBufferCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationBufferCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationBufferCreateInfoNV & - setDedicatedAllocation( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation_ ) VULKAN_HPP_NOEXCEPT - { - dedicatedAllocation = dedicatedAllocation_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDedicatedAllocationBufferCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDedicatedAllocationBufferCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dedicatedAllocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DedicatedAllocationBufferCreateInfoNV const & ) const = default; -#else - bool operator==( DedicatedAllocationBufferCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dedicatedAllocation == rhs.dedicatedAllocation ); -# endif - } - - bool operator!=( DedicatedAllocationBufferCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDedicatedAllocationBufferCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation = {}; - }; - - template <> - struct CppType - { - using Type = DedicatedAllocationBufferCreateInfoNV; - }; - - struct DedicatedAllocationImageCreateInfoNV - { - using NativeType = VkDedicatedAllocationImageCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDedicatedAllocationImageCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DedicatedAllocationImageCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dedicatedAllocation( dedicatedAllocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR DedicatedAllocationImageCreateInfoNV( DedicatedAllocationImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationImageCreateInfoNV( VkDedicatedAllocationImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : DedicatedAllocationImageCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DedicatedAllocationImageCreateInfoNV & operator=( DedicatedAllocationImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationImageCreateInfoNV & operator=( VkDedicatedAllocationImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationImageCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationImageCreateInfoNV & - setDedicatedAllocation( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation_ ) VULKAN_HPP_NOEXCEPT - { - dedicatedAllocation = dedicatedAllocation_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDedicatedAllocationImageCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDedicatedAllocationImageCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dedicatedAllocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DedicatedAllocationImageCreateInfoNV const & ) const = default; -#else - bool operator==( DedicatedAllocationImageCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dedicatedAllocation == rhs.dedicatedAllocation ); -# endif - } - - bool operator!=( DedicatedAllocationImageCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDedicatedAllocationImageCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocation = {}; - }; - - template <> - struct CppType - { - using Type = DedicatedAllocationImageCreateInfoNV; - }; - - struct DedicatedAllocationMemoryAllocateInfoNV - { - using NativeType = VkDedicatedAllocationMemoryAllocateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDedicatedAllocationMemoryAllocateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DedicatedAllocationMemoryAllocateInfoNV( VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - , buffer( buffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR DedicatedAllocationMemoryAllocateInfoNV( DedicatedAllocationMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationMemoryAllocateInfoNV( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : DedicatedAllocationMemoryAllocateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DedicatedAllocationMemoryAllocateInfoNV & operator=( DedicatedAllocationMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DedicatedAllocationMemoryAllocateInfoNV & operator=( VkDedicatedAllocationMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationMemoryAllocateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationMemoryAllocateInfoNV & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DedicatedAllocationMemoryAllocateInfoNV & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDedicatedAllocationMemoryAllocateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDedicatedAllocationMemoryAllocateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image, buffer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DedicatedAllocationMemoryAllocateInfoNV const & ) const = default; -#else - bool operator==( DedicatedAllocationMemoryAllocateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ) && ( buffer == rhs.buffer ); -# endif - } - - bool operator!=( DedicatedAllocationMemoryAllocateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDedicatedAllocationMemoryAllocateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - }; - - template <> - struct CppType - { - using Type = DedicatedAllocationMemoryAllocateInfoNV; - }; - - struct MemoryBarrier2 - { - using NativeType = VkMemoryBarrier2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryBarrier2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryBarrier2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcStageMask( srcStageMask_ ) - , srcAccessMask( srcAccessMask_ ) - , dstStageMask( dstStageMask_ ) - , dstAccessMask( dstAccessMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryBarrier2( MemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryBarrier2( VkMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryBarrier2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryBarrier2 & operator=( MemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryBarrier2 & operator=( VkMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier2 & setSrcStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ ) VULKAN_HPP_NOEXCEPT - { - srcStageMask = srcStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier2 & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier2 & setDstStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - dstStageMask = dstStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier2 & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryBarrier2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryBarrier2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcStageMask, srcAccessMask, dstStageMask, dstAccessMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryBarrier2 const & ) const = default; -#else - bool operator==( MemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcStageMask == rhs.srcStageMask ) && ( srcAccessMask == rhs.srcAccessMask ) && - ( dstStageMask == rhs.dstStageMask ) && ( dstAccessMask == rhs.dstAccessMask ); -# endif - } - - bool operator!=( MemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryBarrier2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask = {}; - }; - - template <> - struct CppType - { - using Type = MemoryBarrier2; - }; - using MemoryBarrier2KHR = MemoryBarrier2; - - struct ImageSubresourceRange - { - using NativeType = VkImageSubresourceRange; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageSubresourceRange( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, - uint32_t baseMipLevel_ = {}, - uint32_t levelCount_ = {}, - uint32_t baseArrayLayer_ = {}, - uint32_t layerCount_ = {} ) VULKAN_HPP_NOEXCEPT - : aspectMask( aspectMask_ ) - , baseMipLevel( baseMipLevel_ ) - , levelCount( levelCount_ ) - , baseArrayLayer( baseArrayLayer_ ) - , layerCount( layerCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSubresourceRange( ImageSubresourceRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresourceRange( VkImageSubresourceRange const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageSubresourceRange( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSubresourceRange & operator=( ImageSubresourceRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresourceRange & operator=( VkImageSubresourceRange const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceRange & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceRange & setBaseMipLevel( uint32_t baseMipLevel_ ) VULKAN_HPP_NOEXCEPT - { - baseMipLevel = baseMipLevel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceRange & setLevelCount( uint32_t levelCount_ ) VULKAN_HPP_NOEXCEPT - { - levelCount = levelCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceRange & setBaseArrayLayer( uint32_t baseArrayLayer_ ) VULKAN_HPP_NOEXCEPT - { - baseArrayLayer = baseArrayLayer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresourceRange & setLayerCount( uint32_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSubresourceRange const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSubresourceRange &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( aspectMask, baseMipLevel, levelCount, baseArrayLayer, layerCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSubresourceRange const & ) const = default; -#else - bool operator==( ImageSubresourceRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( aspectMask == rhs.aspectMask ) && ( baseMipLevel == rhs.baseMipLevel ) && ( levelCount == rhs.levelCount ) && - ( baseArrayLayer == rhs.baseArrayLayer ) && ( layerCount == rhs.layerCount ); -# endif - } - - bool operator!=( ImageSubresourceRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - uint32_t baseMipLevel = {}; - uint32_t levelCount = {}; - uint32_t baseArrayLayer = {}; - uint32_t layerCount = {}; - }; - - struct ImageMemoryBarrier2 - { - using NativeType = VkImageMemoryBarrier2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageMemoryBarrier2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageMemoryBarrier2( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout oldLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageLayout newLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t srcQueueFamilyIndex_ = {}, - uint32_t dstQueueFamilyIndex_ = {}, - VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcStageMask( srcStageMask_ ) - , srcAccessMask( srcAccessMask_ ) - , dstStageMask( dstStageMask_ ) - , dstAccessMask( dstAccessMask_ ) - , oldLayout( oldLayout_ ) - , newLayout( newLayout_ ) - , srcQueueFamilyIndex( srcQueueFamilyIndex_ ) - , dstQueueFamilyIndex( dstQueueFamilyIndex_ ) - , image( image_ ) - , subresourceRange( subresourceRange_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageMemoryBarrier2( ImageMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryBarrier2( VkImageMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT : ImageMemoryBarrier2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageMemoryBarrier2 & operator=( ImageMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryBarrier2 & operator=( VkImageMemoryBarrier2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setSrcStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask_ ) VULKAN_HPP_NOEXCEPT - { - srcStageMask = srcStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setDstStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - dstStageMask = dstStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setOldLayout( VULKAN_HPP_NAMESPACE::ImageLayout oldLayout_ ) VULKAN_HPP_NOEXCEPT - { - oldLayout = oldLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setNewLayout( VULKAN_HPP_NAMESPACE::ImageLayout newLayout_ ) VULKAN_HPP_NOEXCEPT - { - newLayout = newLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setSrcQueueFamilyIndex( uint32_t srcQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - srcQueueFamilyIndex = srcQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setDstQueueFamilyIndex( uint32_t dstQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - dstQueueFamilyIndex = dstQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier2 & - setSubresourceRange( VULKAN_HPP_NAMESPACE::ImageSubresourceRange const & subresourceRange_ ) VULKAN_HPP_NOEXCEPT - { - subresourceRange = subresourceRange_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageMemoryBarrier2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageMemoryBarrier2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - srcStageMask, - srcAccessMask, - dstStageMask, - dstAccessMask, - oldLayout, - newLayout, - srcQueueFamilyIndex, - dstQueueFamilyIndex, - image, - subresourceRange ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageMemoryBarrier2 const & ) const = default; -#else - bool operator==( ImageMemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcStageMask == rhs.srcStageMask ) && ( srcAccessMask == rhs.srcAccessMask ) && - ( dstStageMask == rhs.dstStageMask ) && ( dstAccessMask == rhs.dstAccessMask ) && ( oldLayout == rhs.oldLayout ) && - ( newLayout == rhs.newLayout ) && ( srcQueueFamilyIndex == rhs.srcQueueFamilyIndex ) && ( dstQueueFamilyIndex == rhs.dstQueueFamilyIndex ) && - ( image == rhs.image ) && ( subresourceRange == rhs.subresourceRange ); -# endif - } - - bool operator!=( ImageMemoryBarrier2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageMemoryBarrier2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 srcStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 dstStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags2 dstAccessMask = {}; - VULKAN_HPP_NAMESPACE::ImageLayout oldLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageLayout newLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t srcQueueFamilyIndex = {}; - uint32_t dstQueueFamilyIndex = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange = {}; - }; - - template <> - struct CppType - { - using Type = ImageMemoryBarrier2; - }; - using ImageMemoryBarrier2KHR = ImageMemoryBarrier2; - - struct DependencyInfo - { - using NativeType = VkDependencyInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDependencyInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DependencyInfo( VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ = {}, - uint32_t memoryBarrierCount_ = {}, - const VULKAN_HPP_NAMESPACE::MemoryBarrier2 * pMemoryBarriers_ = {}, - uint32_t bufferMemoryBarrierCount_ = {}, - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier2 * pBufferMemoryBarriers_ = {}, - uint32_t imageMemoryBarrierCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier2 * pImageMemoryBarriers_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dependencyFlags( dependencyFlags_ ) - , memoryBarrierCount( memoryBarrierCount_ ) - , pMemoryBarriers( pMemoryBarriers_ ) - , bufferMemoryBarrierCount( bufferMemoryBarrierCount_ ) - , pBufferMemoryBarriers( pBufferMemoryBarriers_ ) - , imageMemoryBarrierCount( imageMemoryBarrierCount_ ) - , pImageMemoryBarriers( pImageMemoryBarriers_ ) - { - } - - VULKAN_HPP_CONSTEXPR DependencyInfo( DependencyInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DependencyInfo( VkDependencyInfo const & rhs ) VULKAN_HPP_NOEXCEPT : DependencyInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DependencyInfo( VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & memoryBarriers_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferMemoryBarriers_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageMemoryBarriers_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , dependencyFlags( dependencyFlags_ ) - , memoryBarrierCount( static_cast( memoryBarriers_.size() ) ) - , pMemoryBarriers( memoryBarriers_.data() ) - , bufferMemoryBarrierCount( static_cast( bufferMemoryBarriers_.size() ) ) - , pBufferMemoryBarriers( bufferMemoryBarriers_.data() ) - , imageMemoryBarrierCount( static_cast( imageMemoryBarriers_.size() ) ) - , pImageMemoryBarriers( imageMemoryBarriers_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DependencyInfo & operator=( DependencyInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DependencyInfo & operator=( VkDependencyInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setDependencyFlags( VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ ) VULKAN_HPP_NOEXCEPT - { - dependencyFlags = dependencyFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setMemoryBarrierCount( uint32_t memoryBarrierCount_ ) VULKAN_HPP_NOEXCEPT - { - memoryBarrierCount = memoryBarrierCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setPMemoryBarriers( const VULKAN_HPP_NAMESPACE::MemoryBarrier2 * pMemoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - pMemoryBarriers = pMemoryBarriers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DependencyInfo & - setMemoryBarriers( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & memoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - memoryBarrierCount = static_cast( memoryBarriers_.size() ); - pMemoryBarriers = memoryBarriers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setBufferMemoryBarrierCount( uint32_t bufferMemoryBarrierCount_ ) VULKAN_HPP_NOEXCEPT - { - bufferMemoryBarrierCount = bufferMemoryBarrierCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & - setPBufferMemoryBarriers( const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier2 * pBufferMemoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - pBufferMemoryBarriers = pBufferMemoryBarriers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DependencyInfo & setBufferMemoryBarriers( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferMemoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - bufferMemoryBarrierCount = static_cast( bufferMemoryBarriers_.size() ); - pBufferMemoryBarriers = bufferMemoryBarriers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & setImageMemoryBarrierCount( uint32_t imageMemoryBarrierCount_ ) VULKAN_HPP_NOEXCEPT - { - imageMemoryBarrierCount = imageMemoryBarrierCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DependencyInfo & - setPImageMemoryBarriers( const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier2 * pImageMemoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - pImageMemoryBarriers = pImageMemoryBarriers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DependencyInfo & setImageMemoryBarriers( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageMemoryBarriers_ ) VULKAN_HPP_NOEXCEPT - { - imageMemoryBarrierCount = static_cast( imageMemoryBarriers_.size() ); - pImageMemoryBarriers = imageMemoryBarriers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDependencyInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDependencyInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - dependencyFlags, - memoryBarrierCount, - pMemoryBarriers, - bufferMemoryBarrierCount, - pBufferMemoryBarriers, - imageMemoryBarrierCount, - pImageMemoryBarriers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DependencyInfo const & ) const = default; -#else - bool operator==( DependencyInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dependencyFlags == rhs.dependencyFlags ) && - ( memoryBarrierCount == rhs.memoryBarrierCount ) && ( pMemoryBarriers == rhs.pMemoryBarriers ) && - ( bufferMemoryBarrierCount == rhs.bufferMemoryBarrierCount ) && ( pBufferMemoryBarriers == rhs.pBufferMemoryBarriers ) && - ( imageMemoryBarrierCount == rhs.imageMemoryBarrierCount ) && ( pImageMemoryBarriers == rhs.pImageMemoryBarriers ); -# endif - } - - bool operator!=( DependencyInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDependencyInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags = {}; - uint32_t memoryBarrierCount = {}; - const VULKAN_HPP_NAMESPACE::MemoryBarrier2 * pMemoryBarriers = {}; - uint32_t bufferMemoryBarrierCount = {}; - const VULKAN_HPP_NAMESPACE::BufferMemoryBarrier2 * pBufferMemoryBarriers = {}; - uint32_t imageMemoryBarrierCount = {}; - const VULKAN_HPP_NAMESPACE::ImageMemoryBarrier2 * pImageMemoryBarriers = {}; - }; - - template <> - struct CppType - { - using Type = DependencyInfo; - }; - using DependencyInfoKHR = DependencyInfo; - - struct DescriptorBufferInfo - { - using NativeType = VkDescriptorBufferInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorBufferInfo( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize range_ = {} ) VULKAN_HPP_NOEXCEPT - : buffer( buffer_ ) - , offset( offset_ ) - , range( range_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorBufferInfo( DescriptorBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorBufferInfo( VkDescriptorBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorBufferInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorBufferInfo & operator=( DescriptorBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorBufferInfo & operator=( VkDescriptorBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorBufferInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorBufferInfo & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorBufferInfo & setRange( VULKAN_HPP_NAMESPACE::DeviceSize range_ ) VULKAN_HPP_NOEXCEPT - { - range = range_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorBufferInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorBufferInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( buffer, offset, range ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorBufferInfo const & ) const = default; -#else - bool operator==( DescriptorBufferInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( buffer == rhs.buffer ) && ( offset == rhs.offset ) && ( range == rhs.range ); -# endif - } - - bool operator!=( DescriptorBufferInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize range = {}; - }; - - struct DescriptorImageInfo - { - using NativeType = VkDescriptorImageInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DescriptorImageInfo( VULKAN_HPP_NAMESPACE::Sampler sampler_ = {}, - VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined ) VULKAN_HPP_NOEXCEPT - : sampler( sampler_ ) - , imageView( imageView_ ) - , imageLayout( imageLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorImageInfo( DescriptorImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorImageInfo( VkDescriptorImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT : DescriptorImageInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorImageInfo & operator=( DescriptorImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorImageInfo & operator=( VkDescriptorImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorImageInfo & setSampler( VULKAN_HPP_NAMESPACE::Sampler sampler_ ) VULKAN_HPP_NOEXCEPT - { - sampler = sampler_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorImageInfo & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorImageInfo & setImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ ) VULKAN_HPP_NOEXCEPT - { - imageLayout = imageLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorImageInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorImageInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sampler, imageView, imageLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorImageInfo const & ) const = default; -#else - bool operator==( DescriptorImageInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sampler == rhs.sampler ) && ( imageView == rhs.imageView ) && ( imageLayout == rhs.imageLayout ); -# endif - } - - bool operator!=( DescriptorImageInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Sampler sampler = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - struct DescriptorPoolSize - { - using NativeType = VkDescriptorPoolSize; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorPoolSize( VULKAN_HPP_NAMESPACE::DescriptorType type_ = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler, - uint32_t descriptorCount_ = {} ) VULKAN_HPP_NOEXCEPT - : type( type_ ) - , descriptorCount( descriptorCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorPoolSize( DescriptorPoolSize const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolSize( VkDescriptorPoolSize const & rhs ) VULKAN_HPP_NOEXCEPT : DescriptorPoolSize( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorPoolSize & operator=( DescriptorPoolSize const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolSize & operator=( VkDescriptorPoolSize const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolSize & setType( VULKAN_HPP_NAMESPACE::DescriptorType type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolSize & setDescriptorCount( uint32_t descriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = descriptorCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorPoolSize const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorPoolSize &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( type, descriptorCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorPoolSize const & ) const = default; -#else - bool operator==( DescriptorPoolSize const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( type == rhs.type ) && ( descriptorCount == rhs.descriptorCount ); -# endif - } - - bool operator!=( DescriptorPoolSize const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DescriptorType type = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler; - uint32_t descriptorCount = {}; - }; - - struct DescriptorPoolCreateInfo - { - using NativeType = VkDescriptorPoolCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorPoolCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorPoolCreateInfo( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateFlags flags_ = {}, - uint32_t maxSets_ = {}, - uint32_t poolSizeCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorPoolSize * pPoolSizes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , maxSets( maxSets_ ) - , poolSizeCount( poolSizeCount_ ) - , pPoolSizes( pPoolSizes_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorPoolCreateInfo( DescriptorPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolCreateInfo( VkDescriptorPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorPoolCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorPoolCreateInfo( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateFlags flags_, - uint32_t maxSets_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & poolSizes_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), maxSets( maxSets_ ), poolSizeCount( static_cast( poolSizes_.size() ) ), pPoolSizes( poolSizes_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorPoolCreateInfo & operator=( DescriptorPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolCreateInfo & operator=( VkDescriptorPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::DescriptorPoolCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolCreateInfo & setMaxSets( uint32_t maxSets_ ) VULKAN_HPP_NOEXCEPT - { - maxSets = maxSets_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolCreateInfo & setPoolSizeCount( uint32_t poolSizeCount_ ) VULKAN_HPP_NOEXCEPT - { - poolSizeCount = poolSizeCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolCreateInfo & setPPoolSizes( const VULKAN_HPP_NAMESPACE::DescriptorPoolSize * pPoolSizes_ ) VULKAN_HPP_NOEXCEPT - { - pPoolSizes = pPoolSizes_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorPoolCreateInfo & - setPoolSizes( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & poolSizes_ ) VULKAN_HPP_NOEXCEPT - { - poolSizeCount = static_cast( poolSizes_.size() ); - pPoolSizes = poolSizes_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorPoolCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorPoolCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, maxSets, poolSizeCount, pPoolSizes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorPoolCreateInfo const & ) const = default; -#else - bool operator==( DescriptorPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( maxSets == rhs.maxSets ) && - ( poolSizeCount == rhs.poolSizeCount ) && ( pPoolSizes == rhs.pPoolSizes ); -# endif - } - - bool operator!=( DescriptorPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorPoolCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorPoolCreateFlags flags = {}; - uint32_t maxSets = {}; - uint32_t poolSizeCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorPoolSize * pPoolSizes = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorPoolCreateInfo; - }; - - struct DescriptorPoolInlineUniformBlockCreateInfo - { - using NativeType = VkDescriptorPoolInlineUniformBlockCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorPoolInlineUniformBlockCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorPoolInlineUniformBlockCreateInfo( uint32_t maxInlineUniformBlockBindings_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxInlineUniformBlockBindings( maxInlineUniformBlockBindings_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorPoolInlineUniformBlockCreateInfo( DescriptorPoolInlineUniformBlockCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolInlineUniformBlockCreateInfo( VkDescriptorPoolInlineUniformBlockCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorPoolInlineUniformBlockCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorPoolInlineUniformBlockCreateInfo & operator=( DescriptorPoolInlineUniformBlockCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorPoolInlineUniformBlockCreateInfo & operator=( VkDescriptorPoolInlineUniformBlockCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolInlineUniformBlockCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorPoolInlineUniformBlockCreateInfo & - setMaxInlineUniformBlockBindings( uint32_t maxInlineUniformBlockBindings_ ) VULKAN_HPP_NOEXCEPT - { - maxInlineUniformBlockBindings = maxInlineUniformBlockBindings_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorPoolInlineUniformBlockCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorPoolInlineUniformBlockCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxInlineUniformBlockBindings ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorPoolInlineUniformBlockCreateInfo const & ) const = default; -#else - bool operator==( DescriptorPoolInlineUniformBlockCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxInlineUniformBlockBindings == rhs.maxInlineUniformBlockBindings ); -# endif - } - - bool operator!=( DescriptorPoolInlineUniformBlockCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorPoolInlineUniformBlockCreateInfo; - const void * pNext = {}; - uint32_t maxInlineUniformBlockBindings = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorPoolInlineUniformBlockCreateInfo; - }; - using DescriptorPoolInlineUniformBlockCreateInfoEXT = DescriptorPoolInlineUniformBlockCreateInfo; - - struct DescriptorSetAllocateInfo - { - using NativeType = VkDescriptorSetAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetAllocateInfo( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool_ = {}, - uint32_t descriptorSetCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , descriptorPool( descriptorPool_ ) - , descriptorSetCount( descriptorSetCount_ ) - , pSetLayouts( pSetLayouts_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetAllocateInfo( DescriptorSetAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetAllocateInfo( VkDescriptorSetAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetAllocateInfo( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & setLayouts_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), descriptorPool( descriptorPool_ ), descriptorSetCount( static_cast( setLayouts_.size() ) ), pSetLayouts( setLayouts_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetAllocateInfo & operator=( DescriptorSetAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetAllocateInfo & operator=( VkDescriptorSetAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetAllocateInfo & setDescriptorPool( VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool_ ) VULKAN_HPP_NOEXCEPT - { - descriptorPool = descriptorPool_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetAllocateInfo & setDescriptorSetCount( uint32_t descriptorSetCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetCount = descriptorSetCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetAllocateInfo & setPSetLayouts( const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts_ ) VULKAN_HPP_NOEXCEPT - { - pSetLayouts = pSetLayouts_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetAllocateInfo & - setSetLayouts( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & setLayouts_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetCount = static_cast( setLayouts_.size() ); - pSetLayouts = setLayouts_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, descriptorPool, descriptorSetCount, pSetLayouts ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetAllocateInfo const & ) const = default; -#else - bool operator==( DescriptorSetAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorPool == rhs.descriptorPool ) && ( descriptorSetCount == rhs.descriptorSetCount ) && - ( pSetLayouts == rhs.pSetLayouts ); -# endif - } - - bool operator!=( DescriptorSetAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetAllocateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorPool descriptorPool = {}; - uint32_t descriptorSetCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetAllocateInfo; - }; - - struct DescriptorSetBindingReferenceVALVE - { - using NativeType = VkDescriptorSetBindingReferenceVALVE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetBindingReferenceVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetBindingReferenceVALVE( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout_ = {}, - uint32_t binding_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , descriptorSetLayout( descriptorSetLayout_ ) - , binding( binding_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetBindingReferenceVALVE( DescriptorSetBindingReferenceVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetBindingReferenceVALVE( VkDescriptorSetBindingReferenceVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetBindingReferenceVALVE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetBindingReferenceVALVE & operator=( DescriptorSetBindingReferenceVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetBindingReferenceVALVE & operator=( VkDescriptorSetBindingReferenceVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetBindingReferenceVALVE & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetBindingReferenceVALVE & - setDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetLayout = descriptorSetLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetBindingReferenceVALVE & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetBindingReferenceVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetBindingReferenceVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, descriptorSetLayout, binding ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetBindingReferenceVALVE const & ) const = default; -#else - bool operator==( DescriptorSetBindingReferenceVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorSetLayout == rhs.descriptorSetLayout ) && ( binding == rhs.binding ); -# endif - } - - bool operator!=( DescriptorSetBindingReferenceVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetBindingReferenceVALVE; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout = {}; - uint32_t binding = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetBindingReferenceVALVE; - }; - - struct DescriptorSetLayoutBinding - { - using NativeType = VkDescriptorSetLayoutBinding; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutBinding( uint32_t binding_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler, - uint32_t descriptorCount_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags_ = {}, - const VULKAN_HPP_NAMESPACE::Sampler * pImmutableSamplers_ = {} ) VULKAN_HPP_NOEXCEPT - : binding( binding_ ) - , descriptorType( descriptorType_ ) - , descriptorCount( descriptorCount_ ) - , stageFlags( stageFlags_ ) - , pImmutableSamplers( pImmutableSamplers_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutBinding( DescriptorSetLayoutBinding const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutBinding( VkDescriptorSetLayoutBinding const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetLayoutBinding( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutBinding( uint32_t binding_, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_, - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & immutableSamplers_ ) - : binding( binding_ ) - , descriptorType( descriptorType_ ) - , descriptorCount( static_cast( immutableSamplers_.size() ) ) - , stageFlags( stageFlags_ ) - , pImmutableSamplers( immutableSamplers_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetLayoutBinding & operator=( DescriptorSetLayoutBinding const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutBinding & operator=( VkDescriptorSetLayoutBinding const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBinding & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBinding & setDescriptorType( VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ ) VULKAN_HPP_NOEXCEPT - { - descriptorType = descriptorType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBinding & setDescriptorCount( uint32_t descriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = descriptorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBinding & setStageFlags( VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags_ ) VULKAN_HPP_NOEXCEPT - { - stageFlags = stageFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBinding & setPImmutableSamplers( const VULKAN_HPP_NAMESPACE::Sampler * pImmutableSamplers_ ) VULKAN_HPP_NOEXCEPT - { - pImmutableSamplers = pImmutableSamplers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutBinding & - setImmutableSamplers( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & immutableSamplers_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = static_cast( immutableSamplers_.size() ); - pImmutableSamplers = immutableSamplers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetLayoutBinding const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetLayoutBinding &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( binding, descriptorType, descriptorCount, stageFlags, pImmutableSamplers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayoutBinding const & ) const = default; -#else - bool operator==( DescriptorSetLayoutBinding const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( binding == rhs.binding ) && ( descriptorType == rhs.descriptorType ) && ( descriptorCount == rhs.descriptorCount ) && - ( stageFlags == rhs.stageFlags ) && ( pImmutableSamplers == rhs.pImmutableSamplers ); -# endif - } - - bool operator!=( DescriptorSetLayoutBinding const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t binding = {}; - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler; - uint32_t descriptorCount = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags = {}; - const VULKAN_HPP_NAMESPACE::Sampler * pImmutableSamplers = {}; - }; - - struct DescriptorSetLayoutBindingFlagsCreateInfo - { - using NativeType = VkDescriptorSetLayoutBindingFlagsCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetLayoutBindingFlagsCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutBindingFlagsCreateInfo( uint32_t bindingCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorBindingFlags * pBindingFlags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , bindingCount( bindingCount_ ) - , pBindingFlags( pBindingFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutBindingFlagsCreateInfo( DescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutBindingFlagsCreateInfo( VkDescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetLayoutBindingFlagsCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutBindingFlagsCreateInfo( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bindingFlags_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), bindingCount( static_cast( bindingFlags_.size() ) ), pBindingFlags( bindingFlags_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetLayoutBindingFlagsCreateInfo & operator=( DescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutBindingFlagsCreateInfo & operator=( VkDescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBindingFlagsCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBindingFlagsCreateInfo & setBindingCount( uint32_t bindingCount_ ) VULKAN_HPP_NOEXCEPT - { - bindingCount = bindingCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutBindingFlagsCreateInfo & - setPBindingFlags( const VULKAN_HPP_NAMESPACE::DescriptorBindingFlags * pBindingFlags_ ) VULKAN_HPP_NOEXCEPT - { - pBindingFlags = pBindingFlags_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutBindingFlagsCreateInfo & setBindingFlags( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bindingFlags_ ) VULKAN_HPP_NOEXCEPT - { - bindingCount = static_cast( bindingFlags_.size() ); - pBindingFlags = bindingFlags_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetLayoutBindingFlagsCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetLayoutBindingFlagsCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, bindingCount, pBindingFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayoutBindingFlagsCreateInfo const & ) const = default; -#else - bool operator==( DescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( bindingCount == rhs.bindingCount ) && ( pBindingFlags == rhs.pBindingFlags ); -# endif - } - - bool operator!=( DescriptorSetLayoutBindingFlagsCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetLayoutBindingFlagsCreateInfo; - const void * pNext = {}; - uint32_t bindingCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorBindingFlags * pBindingFlags = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetLayoutBindingFlagsCreateInfo; - }; - using DescriptorSetLayoutBindingFlagsCreateInfoEXT = DescriptorSetLayoutBindingFlagsCreateInfo; - - struct DescriptorSetLayoutCreateInfo - { - using NativeType = VkDescriptorSetLayoutCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetLayoutCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateInfo( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateFlags flags_ = {}, - uint32_t bindingCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBinding * pBindings_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , bindingCount( bindingCount_ ) - , pBindings( pBindings_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutCreateInfo( DescriptorSetLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutCreateInfo( VkDescriptorSetLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetLayoutCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutCreateInfo( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bindings_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), bindingCount( static_cast( bindings_.size() ) ), pBindings( bindings_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetLayoutCreateInfo & operator=( DescriptorSetLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutCreateInfo & operator=( VkDescriptorSetLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutCreateInfo & setBindingCount( uint32_t bindingCount_ ) VULKAN_HPP_NOEXCEPT - { - bindingCount = bindingCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutCreateInfo & - setPBindings( const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBinding * pBindings_ ) VULKAN_HPP_NOEXCEPT - { - pBindings = pBindings_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetLayoutCreateInfo & - setBindings( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bindings_ ) VULKAN_HPP_NOEXCEPT - { - bindingCount = static_cast( bindings_.size() ); - pBindings = bindings_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetLayoutCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetLayoutCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, bindingCount, pBindings ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayoutCreateInfo const & ) const = default; -#else - bool operator==( DescriptorSetLayoutCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( bindingCount == rhs.bindingCount ) && - ( pBindings == rhs.pBindings ); -# endif - } - - bool operator!=( DescriptorSetLayoutCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetLayoutCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorSetLayoutCreateFlags flags = {}; - uint32_t bindingCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorSetLayoutBinding * pBindings = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetLayoutCreateInfo; - }; - - struct DescriptorSetLayoutHostMappingInfoVALVE - { - using NativeType = VkDescriptorSetLayoutHostMappingInfoVALVE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetLayoutHostMappingInfoVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DescriptorSetLayoutHostMappingInfoVALVE( size_t descriptorOffset_ = {}, uint32_t descriptorSize_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , descriptorOffset( descriptorOffset_ ) - , descriptorSize( descriptorSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutHostMappingInfoVALVE( DescriptorSetLayoutHostMappingInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutHostMappingInfoVALVE( VkDescriptorSetLayoutHostMappingInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetLayoutHostMappingInfoVALVE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetLayoutHostMappingInfoVALVE & operator=( DescriptorSetLayoutHostMappingInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutHostMappingInfoVALVE & operator=( VkDescriptorSetLayoutHostMappingInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutHostMappingInfoVALVE & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutHostMappingInfoVALVE & setDescriptorOffset( size_t descriptorOffset_ ) VULKAN_HPP_NOEXCEPT - { - descriptorOffset = descriptorOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetLayoutHostMappingInfoVALVE & setDescriptorSize( uint32_t descriptorSize_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSize = descriptorSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetLayoutHostMappingInfoVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetLayoutHostMappingInfoVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, descriptorOffset, descriptorSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayoutHostMappingInfoVALVE const & ) const = default; -#else - bool operator==( DescriptorSetLayoutHostMappingInfoVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorOffset == rhs.descriptorOffset ) && ( descriptorSize == rhs.descriptorSize ); -# endif - } - - bool operator!=( DescriptorSetLayoutHostMappingInfoVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetLayoutHostMappingInfoVALVE; - void * pNext = {}; - size_t descriptorOffset = {}; - uint32_t descriptorSize = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetLayoutHostMappingInfoVALVE; - }; - - struct DescriptorSetLayoutSupport - { - using NativeType = VkDescriptorSetLayoutSupport; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetLayoutSupport; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutSupport( VULKAN_HPP_NAMESPACE::Bool32 supported_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , supported( supported_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorSetLayoutSupport( DescriptorSetLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutSupport( VkDescriptorSetLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetLayoutSupport( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetLayoutSupport & operator=( DescriptorSetLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetLayoutSupport & operator=( VkDescriptorSetLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDescriptorSetLayoutSupport const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetLayoutSupport &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, supported ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetLayoutSupport const & ) const = default; -#else - bool operator==( DescriptorSetLayoutSupport const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( supported == rhs.supported ); -# endif - } - - bool operator!=( DescriptorSetLayoutSupport const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetLayoutSupport; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 supported = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetLayoutSupport; - }; - using DescriptorSetLayoutSupportKHR = DescriptorSetLayoutSupport; - - struct DescriptorSetVariableDescriptorCountAllocateInfo - { - using NativeType = VkDescriptorSetVariableDescriptorCountAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetVariableDescriptorCountAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetVariableDescriptorCountAllocateInfo( uint32_t descriptorSetCount_ = {}, - const uint32_t * pDescriptorCounts_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , descriptorSetCount( descriptorSetCount_ ) - , pDescriptorCounts( pDescriptorCounts_ ) - { - } - - VULKAN_HPP_CONSTEXPR - DescriptorSetVariableDescriptorCountAllocateInfo( DescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetVariableDescriptorCountAllocateInfo( VkDescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetVariableDescriptorCountAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetVariableDescriptorCountAllocateInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorCounts_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), descriptorSetCount( static_cast( descriptorCounts_.size() ) ), pDescriptorCounts( descriptorCounts_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetVariableDescriptorCountAllocateInfo & operator=( DescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetVariableDescriptorCountAllocateInfo & operator=( VkDescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorSetVariableDescriptorCountAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetVariableDescriptorCountAllocateInfo & setDescriptorSetCount( uint32_t descriptorSetCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetCount = descriptorSetCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorSetVariableDescriptorCountAllocateInfo & setPDescriptorCounts( const uint32_t * pDescriptorCounts_ ) VULKAN_HPP_NOEXCEPT - { - pDescriptorCounts = pDescriptorCounts_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorSetVariableDescriptorCountAllocateInfo & - setDescriptorCounts( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorCounts_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetCount = static_cast( descriptorCounts_.size() ); - pDescriptorCounts = descriptorCounts_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorSetVariableDescriptorCountAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetVariableDescriptorCountAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, descriptorSetCount, pDescriptorCounts ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetVariableDescriptorCountAllocateInfo const & ) const = default; -#else - bool operator==( DescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorSetCount == rhs.descriptorSetCount ) && - ( pDescriptorCounts == rhs.pDescriptorCounts ); -# endif - } - - bool operator!=( DescriptorSetVariableDescriptorCountAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetVariableDescriptorCountAllocateInfo; - const void * pNext = {}; - uint32_t descriptorSetCount = {}; - const uint32_t * pDescriptorCounts = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetVariableDescriptorCountAllocateInfo; - }; - using DescriptorSetVariableDescriptorCountAllocateInfoEXT = DescriptorSetVariableDescriptorCountAllocateInfo; - - struct DescriptorSetVariableDescriptorCountLayoutSupport - { - using NativeType = VkDescriptorSetVariableDescriptorCountLayoutSupport; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorSetVariableDescriptorCountLayoutSupport; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorSetVariableDescriptorCountLayoutSupport( uint32_t maxVariableDescriptorCount_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxVariableDescriptorCount( maxVariableDescriptorCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR - DescriptorSetVariableDescriptorCountLayoutSupport( DescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetVariableDescriptorCountLayoutSupport( VkDescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorSetVariableDescriptorCountLayoutSupport( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorSetVariableDescriptorCountLayoutSupport & - operator=( DescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorSetVariableDescriptorCountLayoutSupport & operator=( VkDescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDescriptorSetVariableDescriptorCountLayoutSupport const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorSetVariableDescriptorCountLayoutSupport &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxVariableDescriptorCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorSetVariableDescriptorCountLayoutSupport const & ) const = default; -#else - bool operator==( DescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxVariableDescriptorCount == rhs.maxVariableDescriptorCount ); -# endif - } - - bool operator!=( DescriptorSetVariableDescriptorCountLayoutSupport const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorSetVariableDescriptorCountLayoutSupport; - void * pNext = {}; - uint32_t maxVariableDescriptorCount = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorSetVariableDescriptorCountLayoutSupport; - }; - using DescriptorSetVariableDescriptorCountLayoutSupportEXT = DescriptorSetVariableDescriptorCountLayoutSupport; - - struct DescriptorUpdateTemplateEntry - { - using NativeType = VkDescriptorUpdateTemplateEntry; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplateEntry( uint32_t dstBinding_ = {}, - uint32_t dstArrayElement_ = {}, - uint32_t descriptorCount_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler, - size_t offset_ = {}, - size_t stride_ = {} ) VULKAN_HPP_NOEXCEPT - : dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) - , descriptorType( descriptorType_ ) - , offset( offset_ ) - , stride( stride_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplateEntry( DescriptorUpdateTemplateEntry const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorUpdateTemplateEntry( VkDescriptorUpdateTemplateEntry const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorUpdateTemplateEntry( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorUpdateTemplateEntry & operator=( DescriptorUpdateTemplateEntry const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorUpdateTemplateEntry & operator=( VkDescriptorUpdateTemplateEntry const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setDstBinding( uint32_t dstBinding_ ) VULKAN_HPP_NOEXCEPT - { - dstBinding = dstBinding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setDstArrayElement( uint32_t dstArrayElement_ ) VULKAN_HPP_NOEXCEPT - { - dstArrayElement = dstArrayElement_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setDescriptorCount( uint32_t descriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = descriptorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setDescriptorType( VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ ) VULKAN_HPP_NOEXCEPT - { - descriptorType = descriptorType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setOffset( size_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateEntry & setStride( size_t stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorUpdateTemplateEntry const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorUpdateTemplateEntry &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( dstBinding, dstArrayElement, descriptorCount, descriptorType, offset, stride ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorUpdateTemplateEntry const & ) const = default; -#else - bool operator==( DescriptorUpdateTemplateEntry const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( dstBinding == rhs.dstBinding ) && ( dstArrayElement == rhs.dstArrayElement ) && ( descriptorCount == rhs.descriptorCount ) && - ( descriptorType == rhs.descriptorType ) && ( offset == rhs.offset ) && ( stride == rhs.stride ); -# endif - } - - bool operator!=( DescriptorUpdateTemplateEntry const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t dstBinding = {}; - uint32_t dstArrayElement = {}; - uint32_t descriptorCount = {}; - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler; - size_t offset = {}; - size_t stride = {}; - }; - using DescriptorUpdateTemplateEntryKHR = DescriptorUpdateTemplateEntry; - - struct DescriptorUpdateTemplateCreateInfo - { - using NativeType = VkDescriptorUpdateTemplateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDescriptorUpdateTemplateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplateCreateInfo( - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateFlags flags_ = {}, - uint32_t descriptorUpdateEntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateEntry * pDescriptorUpdateEntries_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType templateType_ = VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType::eDescriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout_ = {}, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout_ = {}, - uint32_t set_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , descriptorUpdateEntryCount( descriptorUpdateEntryCount_ ) - , pDescriptorUpdateEntries( pDescriptorUpdateEntries_ ) - , templateType( templateType_ ) - , descriptorSetLayout( descriptorSetLayout_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipelineLayout( pipelineLayout_ ) - , set( set_ ) - { - } - - VULKAN_HPP_CONSTEXPR DescriptorUpdateTemplateCreateInfo( DescriptorUpdateTemplateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorUpdateTemplateCreateInfo( VkDescriptorUpdateTemplateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DescriptorUpdateTemplateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorUpdateTemplateCreateInfo( - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorUpdateEntries_, - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType templateType_ = VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType::eDescriptorSet, - VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout_ = {}, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout_ = {}, - uint32_t set_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , descriptorUpdateEntryCount( static_cast( descriptorUpdateEntries_.size() ) ) - , pDescriptorUpdateEntries( descriptorUpdateEntries_.data() ) - , templateType( templateType_ ) - , descriptorSetLayout( descriptorSetLayout_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipelineLayout( pipelineLayout_ ) - , set( set_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DescriptorUpdateTemplateCreateInfo & operator=( DescriptorUpdateTemplateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DescriptorUpdateTemplateCreateInfo & operator=( VkDescriptorUpdateTemplateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & setDescriptorUpdateEntryCount( uint32_t descriptorUpdateEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorUpdateEntryCount = descriptorUpdateEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & - setPDescriptorUpdateEntries( const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateEntry * pDescriptorUpdateEntries_ ) VULKAN_HPP_NOEXCEPT - { - pDescriptorUpdateEntries = pDescriptorUpdateEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DescriptorUpdateTemplateCreateInfo & setDescriptorUpdateEntries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorUpdateEntries_ ) - VULKAN_HPP_NOEXCEPT - { - descriptorUpdateEntryCount = static_cast( descriptorUpdateEntries_.size() ); - pDescriptorUpdateEntries = descriptorUpdateEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & - setTemplateType( VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType templateType_ ) VULKAN_HPP_NOEXCEPT - { - templateType = templateType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & - setDescriptorSetLayout( VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetLayout = descriptorSetLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & - setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & setPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout_ ) VULKAN_HPP_NOEXCEPT - { - pipelineLayout = pipelineLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DescriptorUpdateTemplateCreateInfo & setSet( uint32_t set_ ) VULKAN_HPP_NOEXCEPT - { - set = set_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDescriptorUpdateTemplateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDescriptorUpdateTemplateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, flags, descriptorUpdateEntryCount, pDescriptorUpdateEntries, templateType, descriptorSetLayout, pipelineBindPoint, pipelineLayout, set ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DescriptorUpdateTemplateCreateInfo const & ) const = default; -#else - bool operator==( DescriptorUpdateTemplateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( descriptorUpdateEntryCount == rhs.descriptorUpdateEntryCount ) && - ( pDescriptorUpdateEntries == rhs.pDescriptorUpdateEntries ) && ( templateType == rhs.templateType ) && - ( descriptorSetLayout == rhs.descriptorSetLayout ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && ( pipelineLayout == rhs.pipelineLayout ) && - ( set == rhs.set ); -# endif - } - - bool operator!=( DescriptorUpdateTemplateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDescriptorUpdateTemplateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateCreateFlags flags = {}; - uint32_t descriptorUpdateEntryCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateEntry * pDescriptorUpdateEntries = {}; - VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType templateType = VULKAN_HPP_NAMESPACE::DescriptorUpdateTemplateType::eDescriptorSet; - VULKAN_HPP_NAMESPACE::DescriptorSetLayout descriptorSetLayout = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - VULKAN_HPP_NAMESPACE::PipelineLayout pipelineLayout = {}; - uint32_t set = {}; - }; - - template <> - struct CppType - { - using Type = DescriptorUpdateTemplateCreateInfo; - }; - using DescriptorUpdateTemplateCreateInfoKHR = DescriptorUpdateTemplateCreateInfo; - - struct DeviceBufferMemoryRequirements - { - using NativeType = VkDeviceBufferMemoryRequirements; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceBufferMemoryRequirements; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceBufferMemoryRequirements( const VULKAN_HPP_NAMESPACE::BufferCreateInfo * pCreateInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pCreateInfo( pCreateInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceBufferMemoryRequirements( DeviceBufferMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceBufferMemoryRequirements( VkDeviceBufferMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceBufferMemoryRequirements( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceBufferMemoryRequirements & operator=( DeviceBufferMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceBufferMemoryRequirements & operator=( VkDeviceBufferMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceBufferMemoryRequirements & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceBufferMemoryRequirements & setPCreateInfo( const VULKAN_HPP_NAMESPACE::BufferCreateInfo * pCreateInfo_ ) VULKAN_HPP_NOEXCEPT - { - pCreateInfo = pCreateInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceBufferMemoryRequirements const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceBufferMemoryRequirements &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pCreateInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceBufferMemoryRequirements const & ) const = default; -#else - bool operator==( DeviceBufferMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pCreateInfo == rhs.pCreateInfo ); -# endif - } - - bool operator!=( DeviceBufferMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceBufferMemoryRequirements; - const void * pNext = {}; - const VULKAN_HPP_NAMESPACE::BufferCreateInfo * pCreateInfo = {}; - }; - - template <> - struct CppType - { - using Type = DeviceBufferMemoryRequirements; - }; - using DeviceBufferMemoryRequirementsKHR = DeviceBufferMemoryRequirements; - - struct DeviceQueueCreateInfo - { - using NativeType = VkDeviceQueueCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceQueueCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceQueueCreateInfo( VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags_ = {}, - uint32_t queueFamilyIndex_ = {}, - uint32_t queueCount_ = {}, - const float * pQueuePriorities_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , queueCount( queueCount_ ) - , pQueuePriorities( pQueuePriorities_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceQueueCreateInfo( DeviceQueueCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueCreateInfo( VkDeviceQueueCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceQueueCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceQueueCreateInfo( VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags_, - uint32_t queueFamilyIndex_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queuePriorities_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , queueCount( static_cast( queuePriorities_.size() ) ) - , pQueuePriorities( queuePriorities_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceQueueCreateInfo & operator=( DeviceQueueCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueCreateInfo & operator=( VkDeviceQueueCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceQueueCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueCreateInfo & setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndex = queueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueCreateInfo & setQueueCount( uint32_t queueCount_ ) VULKAN_HPP_NOEXCEPT - { - queueCount = queueCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueCreateInfo & setPQueuePriorities( const float * pQueuePriorities_ ) VULKAN_HPP_NOEXCEPT - { - pQueuePriorities = pQueuePriorities_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceQueueCreateInfo & setQueuePriorities( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queuePriorities_ ) VULKAN_HPP_NOEXCEPT - { - queueCount = static_cast( queuePriorities_.size() ); - pQueuePriorities = queuePriorities_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceQueueCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceQueueCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, queueFamilyIndex, queueCount, pQueuePriorities ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceQueueCreateInfo const & ) const = default; -#else - bool operator==( DeviceQueueCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( queueFamilyIndex == rhs.queueFamilyIndex ) && - ( queueCount == rhs.queueCount ) && ( pQueuePriorities == rhs.pQueuePriorities ); -# endif - } - - bool operator!=( DeviceQueueCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceQueueCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags = {}; - uint32_t queueFamilyIndex = {}; - uint32_t queueCount = {}; - const float * pQueuePriorities = {}; - }; - - template <> - struct CppType - { - using Type = DeviceQueueCreateInfo; - }; - - struct PhysicalDeviceFeatures - { - using NativeType = VkPhysicalDeviceFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFeatures( VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fullDrawIndexUint32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 imageCubeArray_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 independentBlend_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 geometryShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 tessellationShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sampleRateShading_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 dualSrcBlend_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 logicOp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiDrawIndirect_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 drawIndirectFirstInstance_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthClamp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthBiasClamp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fillModeNonSolid_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthBounds_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 wideLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 largePoints_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 alphaToOne_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiViewport_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 samplerAnisotropy_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionETC2_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_LDR_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionBC_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryPrecise_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 pipelineStatisticsQuery_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vertexPipelineStoresAndAtomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentStoresAndAtomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderTessellationAndGeometryPointSize_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderImageGatherExtended_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageExtendedFormats_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageMultisample_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageReadWithoutFormat_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageWriteWithoutFormat_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderClipDistance_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderCullDistance_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInt64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInt16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderResourceResidency_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderResourceMinLod_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseBinding_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyBuffer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage2D_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage3D_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency2Samples_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency4Samples_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency8Samples_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency16Samples_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyAliased_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 variableMultisampleRate_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 inheritedQueries_ = {} ) VULKAN_HPP_NOEXCEPT - : robustBufferAccess( robustBufferAccess_ ) - , fullDrawIndexUint32( fullDrawIndexUint32_ ) - , imageCubeArray( imageCubeArray_ ) - , independentBlend( independentBlend_ ) - , geometryShader( geometryShader_ ) - , tessellationShader( tessellationShader_ ) - , sampleRateShading( sampleRateShading_ ) - , dualSrcBlend( dualSrcBlend_ ) - , logicOp( logicOp_ ) - , multiDrawIndirect( multiDrawIndirect_ ) - , drawIndirectFirstInstance( drawIndirectFirstInstance_ ) - , depthClamp( depthClamp_ ) - , depthBiasClamp( depthBiasClamp_ ) - , fillModeNonSolid( fillModeNonSolid_ ) - , depthBounds( depthBounds_ ) - , wideLines( wideLines_ ) - , largePoints( largePoints_ ) - , alphaToOne( alphaToOne_ ) - , multiViewport( multiViewport_ ) - , samplerAnisotropy( samplerAnisotropy_ ) - , textureCompressionETC2( textureCompressionETC2_ ) - , textureCompressionASTC_LDR( textureCompressionASTC_LDR_ ) - , textureCompressionBC( textureCompressionBC_ ) - , occlusionQueryPrecise( occlusionQueryPrecise_ ) - , pipelineStatisticsQuery( pipelineStatisticsQuery_ ) - , vertexPipelineStoresAndAtomics( vertexPipelineStoresAndAtomics_ ) - , fragmentStoresAndAtomics( fragmentStoresAndAtomics_ ) - , shaderTessellationAndGeometryPointSize( shaderTessellationAndGeometryPointSize_ ) - , shaderImageGatherExtended( shaderImageGatherExtended_ ) - , shaderStorageImageExtendedFormats( shaderStorageImageExtendedFormats_ ) - , shaderStorageImageMultisample( shaderStorageImageMultisample_ ) - , shaderStorageImageReadWithoutFormat( shaderStorageImageReadWithoutFormat_ ) - , shaderStorageImageWriteWithoutFormat( shaderStorageImageWriteWithoutFormat_ ) - , shaderUniformBufferArrayDynamicIndexing( shaderUniformBufferArrayDynamicIndexing_ ) - , shaderSampledImageArrayDynamicIndexing( shaderSampledImageArrayDynamicIndexing_ ) - , shaderStorageBufferArrayDynamicIndexing( shaderStorageBufferArrayDynamicIndexing_ ) - , shaderStorageImageArrayDynamicIndexing( shaderStorageImageArrayDynamicIndexing_ ) - , shaderClipDistance( shaderClipDistance_ ) - , shaderCullDistance( shaderCullDistance_ ) - , shaderFloat64( shaderFloat64_ ) - , shaderInt64( shaderInt64_ ) - , shaderInt16( shaderInt16_ ) - , shaderResourceResidency( shaderResourceResidency_ ) - , shaderResourceMinLod( shaderResourceMinLod_ ) - , sparseBinding( sparseBinding_ ) - , sparseResidencyBuffer( sparseResidencyBuffer_ ) - , sparseResidencyImage2D( sparseResidencyImage2D_ ) - , sparseResidencyImage3D( sparseResidencyImage3D_ ) - , sparseResidency2Samples( sparseResidency2Samples_ ) - , sparseResidency4Samples( sparseResidency4Samples_ ) - , sparseResidency8Samples( sparseResidency8Samples_ ) - , sparseResidency16Samples( sparseResidency16Samples_ ) - , sparseResidencyAliased( sparseResidencyAliased_ ) - , variableMultisampleRate( variableMultisampleRate_ ) - , inheritedQueries( inheritedQueries_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFeatures( PhysicalDeviceFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFeatures( VkPhysicalDeviceFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFeatures & operator=( PhysicalDeviceFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFeatures & operator=( VkPhysicalDeviceFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setRobustBufferAccess( VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess_ ) VULKAN_HPP_NOEXCEPT - { - robustBufferAccess = robustBufferAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setFullDrawIndexUint32( VULKAN_HPP_NAMESPACE::Bool32 fullDrawIndexUint32_ ) VULKAN_HPP_NOEXCEPT - { - fullDrawIndexUint32 = fullDrawIndexUint32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setImageCubeArray( VULKAN_HPP_NAMESPACE::Bool32 imageCubeArray_ ) VULKAN_HPP_NOEXCEPT - { - imageCubeArray = imageCubeArray_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setIndependentBlend( VULKAN_HPP_NAMESPACE::Bool32 independentBlend_ ) VULKAN_HPP_NOEXCEPT - { - independentBlend = independentBlend_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setGeometryShader( VULKAN_HPP_NAMESPACE::Bool32 geometryShader_ ) VULKAN_HPP_NOEXCEPT - { - geometryShader = geometryShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setTessellationShader( VULKAN_HPP_NAMESPACE::Bool32 tessellationShader_ ) VULKAN_HPP_NOEXCEPT - { - tessellationShader = tessellationShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSampleRateShading( VULKAN_HPP_NAMESPACE::Bool32 sampleRateShading_ ) VULKAN_HPP_NOEXCEPT - { - sampleRateShading = sampleRateShading_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setDualSrcBlend( VULKAN_HPP_NAMESPACE::Bool32 dualSrcBlend_ ) VULKAN_HPP_NOEXCEPT - { - dualSrcBlend = dualSrcBlend_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setLogicOp( VULKAN_HPP_NAMESPACE::Bool32 logicOp_ ) VULKAN_HPP_NOEXCEPT - { - logicOp = logicOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setMultiDrawIndirect( VULKAN_HPP_NAMESPACE::Bool32 multiDrawIndirect_ ) VULKAN_HPP_NOEXCEPT - { - multiDrawIndirect = multiDrawIndirect_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setDrawIndirectFirstInstance( VULKAN_HPP_NAMESPACE::Bool32 drawIndirectFirstInstance_ ) VULKAN_HPP_NOEXCEPT - { - drawIndirectFirstInstance = drawIndirectFirstInstance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setDepthClamp( VULKAN_HPP_NAMESPACE::Bool32 depthClamp_ ) VULKAN_HPP_NOEXCEPT - { - depthClamp = depthClamp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setDepthBiasClamp( VULKAN_HPP_NAMESPACE::Bool32 depthBiasClamp_ ) VULKAN_HPP_NOEXCEPT - { - depthBiasClamp = depthBiasClamp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setFillModeNonSolid( VULKAN_HPP_NAMESPACE::Bool32 fillModeNonSolid_ ) VULKAN_HPP_NOEXCEPT - { - fillModeNonSolid = fillModeNonSolid_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setDepthBounds( VULKAN_HPP_NAMESPACE::Bool32 depthBounds_ ) VULKAN_HPP_NOEXCEPT - { - depthBounds = depthBounds_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setWideLines( VULKAN_HPP_NAMESPACE::Bool32 wideLines_ ) VULKAN_HPP_NOEXCEPT - { - wideLines = wideLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setLargePoints( VULKAN_HPP_NAMESPACE::Bool32 largePoints_ ) VULKAN_HPP_NOEXCEPT - { - largePoints = largePoints_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setAlphaToOne( VULKAN_HPP_NAMESPACE::Bool32 alphaToOne_ ) VULKAN_HPP_NOEXCEPT - { - alphaToOne = alphaToOne_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setMultiViewport( VULKAN_HPP_NAMESPACE::Bool32 multiViewport_ ) VULKAN_HPP_NOEXCEPT - { - multiViewport = multiViewport_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSamplerAnisotropy( VULKAN_HPP_NAMESPACE::Bool32 samplerAnisotropy_ ) VULKAN_HPP_NOEXCEPT - { - samplerAnisotropy = samplerAnisotropy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setTextureCompressionETC2( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionETC2_ ) VULKAN_HPP_NOEXCEPT - { - textureCompressionETC2 = textureCompressionETC2_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setTextureCompressionASTC_LDR( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_LDR_ ) VULKAN_HPP_NOEXCEPT - { - textureCompressionASTC_LDR = textureCompressionASTC_LDR_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setTextureCompressionBC( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionBC_ ) VULKAN_HPP_NOEXCEPT - { - textureCompressionBC = textureCompressionBC_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setOcclusionQueryPrecise( VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryPrecise_ ) VULKAN_HPP_NOEXCEPT - { - occlusionQueryPrecise = occlusionQueryPrecise_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setPipelineStatisticsQuery( VULKAN_HPP_NAMESPACE::Bool32 pipelineStatisticsQuery_ ) VULKAN_HPP_NOEXCEPT - { - pipelineStatisticsQuery = pipelineStatisticsQuery_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setVertexPipelineStoresAndAtomics( VULKAN_HPP_NAMESPACE::Bool32 vertexPipelineStoresAndAtomics_ ) VULKAN_HPP_NOEXCEPT - { - vertexPipelineStoresAndAtomics = vertexPipelineStoresAndAtomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setFragmentStoresAndAtomics( VULKAN_HPP_NAMESPACE::Bool32 fragmentStoresAndAtomics_ ) VULKAN_HPP_NOEXCEPT - { - fragmentStoresAndAtomics = fragmentStoresAndAtomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderTessellationAndGeometryPointSize( VULKAN_HPP_NAMESPACE::Bool32 shaderTessellationAndGeometryPointSize_ ) VULKAN_HPP_NOEXCEPT - { - shaderTessellationAndGeometryPointSize = shaderTessellationAndGeometryPointSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderImageGatherExtended( VULKAN_HPP_NAMESPACE::Bool32 shaderImageGatherExtended_ ) VULKAN_HPP_NOEXCEPT - { - shaderImageGatherExtended = shaderImageGatherExtended_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageImageExtendedFormats( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageExtendedFormats_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageExtendedFormats = shaderStorageImageExtendedFormats_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageImageMultisample( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageMultisample_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageMultisample = shaderStorageImageMultisample_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageImageReadWithoutFormat( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageReadWithoutFormat_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageReadWithoutFormat = shaderStorageImageReadWithoutFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageImageWriteWithoutFormat( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageWriteWithoutFormat_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageWriteWithoutFormat = shaderStorageImageWriteWithoutFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderUniformBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformBufferArrayDynamicIndexing = shaderUniformBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderSampledImageArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderSampledImageArrayDynamicIndexing = shaderSampledImageArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageBufferArrayDynamicIndexing = shaderStorageBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & - setShaderStorageImageArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageArrayDynamicIndexing = shaderStorageImageArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderClipDistance( VULKAN_HPP_NAMESPACE::Bool32 shaderClipDistance_ ) VULKAN_HPP_NOEXCEPT - { - shaderClipDistance = shaderClipDistance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderCullDistance( VULKAN_HPP_NAMESPACE::Bool32 shaderCullDistance_ ) VULKAN_HPP_NOEXCEPT - { - shaderCullDistance = shaderCullDistance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderFloat64( VULKAN_HPP_NAMESPACE::Bool32 shaderFloat64_ ) VULKAN_HPP_NOEXCEPT - { - shaderFloat64 = shaderFloat64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderInt64( VULKAN_HPP_NAMESPACE::Bool32 shaderInt64_ ) VULKAN_HPP_NOEXCEPT - { - shaderInt64 = shaderInt64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderInt16( VULKAN_HPP_NAMESPACE::Bool32 shaderInt16_ ) VULKAN_HPP_NOEXCEPT - { - shaderInt16 = shaderInt16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderResourceResidency( VULKAN_HPP_NAMESPACE::Bool32 shaderResourceResidency_ ) VULKAN_HPP_NOEXCEPT - { - shaderResourceResidency = shaderResourceResidency_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setShaderResourceMinLod( VULKAN_HPP_NAMESPACE::Bool32 shaderResourceMinLod_ ) VULKAN_HPP_NOEXCEPT - { - shaderResourceMinLod = shaderResourceMinLod_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseBinding( VULKAN_HPP_NAMESPACE::Bool32 sparseBinding_ ) VULKAN_HPP_NOEXCEPT - { - sparseBinding = sparseBinding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidencyBuffer( VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyBuffer_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidencyBuffer = sparseResidencyBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidencyImage2D( VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage2D_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidencyImage2D = sparseResidencyImage2D_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidencyImage3D( VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage3D_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidencyImage3D = sparseResidencyImage3D_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidency2Samples( VULKAN_HPP_NAMESPACE::Bool32 sparseResidency2Samples_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidency2Samples = sparseResidency2Samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidency4Samples( VULKAN_HPP_NAMESPACE::Bool32 sparseResidency4Samples_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidency4Samples = sparseResidency4Samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidency8Samples( VULKAN_HPP_NAMESPACE::Bool32 sparseResidency8Samples_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidency8Samples = sparseResidency8Samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidency16Samples( VULKAN_HPP_NAMESPACE::Bool32 sparseResidency16Samples_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidency16Samples = sparseResidency16Samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setSparseResidencyAliased( VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyAliased_ ) VULKAN_HPP_NOEXCEPT - { - sparseResidencyAliased = sparseResidencyAliased_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setVariableMultisampleRate( VULKAN_HPP_NAMESPACE::Bool32 variableMultisampleRate_ ) VULKAN_HPP_NOEXCEPT - { - variableMultisampleRate = variableMultisampleRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures & setInheritedQueries( VULKAN_HPP_NAMESPACE::Bool32 inheritedQueries_ ) VULKAN_HPP_NOEXCEPT - { - inheritedQueries = inheritedQueries_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( robustBufferAccess, - fullDrawIndexUint32, - imageCubeArray, - independentBlend, - geometryShader, - tessellationShader, - sampleRateShading, - dualSrcBlend, - logicOp, - multiDrawIndirect, - drawIndirectFirstInstance, - depthClamp, - depthBiasClamp, - fillModeNonSolid, - depthBounds, - wideLines, - largePoints, - alphaToOne, - multiViewport, - samplerAnisotropy, - textureCompressionETC2, - textureCompressionASTC_LDR, - textureCompressionBC, - occlusionQueryPrecise, - pipelineStatisticsQuery, - vertexPipelineStoresAndAtomics, - fragmentStoresAndAtomics, - shaderTessellationAndGeometryPointSize, - shaderImageGatherExtended, - shaderStorageImageExtendedFormats, - shaderStorageImageMultisample, - shaderStorageImageReadWithoutFormat, - shaderStorageImageWriteWithoutFormat, - shaderUniformBufferArrayDynamicIndexing, - shaderSampledImageArrayDynamicIndexing, - shaderStorageBufferArrayDynamicIndexing, - shaderStorageImageArrayDynamicIndexing, - shaderClipDistance, - shaderCullDistance, - shaderFloat64, - shaderInt64, - shaderInt16, - shaderResourceResidency, - shaderResourceMinLod, - sparseBinding, - sparseResidencyBuffer, - sparseResidencyImage2D, - sparseResidencyImage3D, - sparseResidency2Samples, - sparseResidency4Samples, - sparseResidency8Samples, - sparseResidency16Samples, - sparseResidencyAliased, - variableMultisampleRate, - inheritedQueries ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( robustBufferAccess == rhs.robustBufferAccess ) && ( fullDrawIndexUint32 == rhs.fullDrawIndexUint32 ) && - ( imageCubeArray == rhs.imageCubeArray ) && ( independentBlend == rhs.independentBlend ) && ( geometryShader == rhs.geometryShader ) && - ( tessellationShader == rhs.tessellationShader ) && ( sampleRateShading == rhs.sampleRateShading ) && ( dualSrcBlend == rhs.dualSrcBlend ) && - ( logicOp == rhs.logicOp ) && ( multiDrawIndirect == rhs.multiDrawIndirect ) && ( drawIndirectFirstInstance == rhs.drawIndirectFirstInstance ) && - ( depthClamp == rhs.depthClamp ) && ( depthBiasClamp == rhs.depthBiasClamp ) && ( fillModeNonSolid == rhs.fillModeNonSolid ) && - ( depthBounds == rhs.depthBounds ) && ( wideLines == rhs.wideLines ) && ( largePoints == rhs.largePoints ) && ( alphaToOne == rhs.alphaToOne ) && - ( multiViewport == rhs.multiViewport ) && ( samplerAnisotropy == rhs.samplerAnisotropy ) && - ( textureCompressionETC2 == rhs.textureCompressionETC2 ) && ( textureCompressionASTC_LDR == rhs.textureCompressionASTC_LDR ) && - ( textureCompressionBC == rhs.textureCompressionBC ) && ( occlusionQueryPrecise == rhs.occlusionQueryPrecise ) && - ( pipelineStatisticsQuery == rhs.pipelineStatisticsQuery ) && ( vertexPipelineStoresAndAtomics == rhs.vertexPipelineStoresAndAtomics ) && - ( fragmentStoresAndAtomics == rhs.fragmentStoresAndAtomics ) && - ( shaderTessellationAndGeometryPointSize == rhs.shaderTessellationAndGeometryPointSize ) && - ( shaderImageGatherExtended == rhs.shaderImageGatherExtended ) && ( shaderStorageImageExtendedFormats == rhs.shaderStorageImageExtendedFormats ) && - ( shaderStorageImageMultisample == rhs.shaderStorageImageMultisample ) && - ( shaderStorageImageReadWithoutFormat == rhs.shaderStorageImageReadWithoutFormat ) && - ( shaderStorageImageWriteWithoutFormat == rhs.shaderStorageImageWriteWithoutFormat ) && - ( shaderUniformBufferArrayDynamicIndexing == rhs.shaderUniformBufferArrayDynamicIndexing ) && - ( shaderSampledImageArrayDynamicIndexing == rhs.shaderSampledImageArrayDynamicIndexing ) && - ( shaderStorageBufferArrayDynamicIndexing == rhs.shaderStorageBufferArrayDynamicIndexing ) && - ( shaderStorageImageArrayDynamicIndexing == rhs.shaderStorageImageArrayDynamicIndexing ) && ( shaderClipDistance == rhs.shaderClipDistance ) && - ( shaderCullDistance == rhs.shaderCullDistance ) && ( shaderFloat64 == rhs.shaderFloat64 ) && ( shaderInt64 == rhs.shaderInt64 ) && - ( shaderInt16 == rhs.shaderInt16 ) && ( shaderResourceResidency == rhs.shaderResourceResidency ) && - ( shaderResourceMinLod == rhs.shaderResourceMinLod ) && ( sparseBinding == rhs.sparseBinding ) && - ( sparseResidencyBuffer == rhs.sparseResidencyBuffer ) && ( sparseResidencyImage2D == rhs.sparseResidencyImage2D ) && - ( sparseResidencyImage3D == rhs.sparseResidencyImage3D ) && ( sparseResidency2Samples == rhs.sparseResidency2Samples ) && - ( sparseResidency4Samples == rhs.sparseResidency4Samples ) && ( sparseResidency8Samples == rhs.sparseResidency8Samples ) && - ( sparseResidency16Samples == rhs.sparseResidency16Samples ) && ( sparseResidencyAliased == rhs.sparseResidencyAliased ) && - ( variableMultisampleRate == rhs.variableMultisampleRate ) && ( inheritedQueries == rhs.inheritedQueries ); -# endif - } - - bool operator!=( PhysicalDeviceFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 fullDrawIndexUint32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageCubeArray = {}; - VULKAN_HPP_NAMESPACE::Bool32 independentBlend = {}; - VULKAN_HPP_NAMESPACE::Bool32 geometryShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 tessellationShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 sampleRateShading = {}; - VULKAN_HPP_NAMESPACE::Bool32 dualSrcBlend = {}; - VULKAN_HPP_NAMESPACE::Bool32 logicOp = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiDrawIndirect = {}; - VULKAN_HPP_NAMESPACE::Bool32 drawIndirectFirstInstance = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClamp = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthBiasClamp = {}; - VULKAN_HPP_NAMESPACE::Bool32 fillModeNonSolid = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthBounds = {}; - VULKAN_HPP_NAMESPACE::Bool32 wideLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 largePoints = {}; - VULKAN_HPP_NAMESPACE::Bool32 alphaToOne = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiViewport = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerAnisotropy = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionETC2 = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_LDR = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionBC = {}; - VULKAN_HPP_NAMESPACE::Bool32 occlusionQueryPrecise = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineStatisticsQuery = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexPipelineStoresAndAtomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentStoresAndAtomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderTessellationAndGeometryPointSize = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderImageGatherExtended = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageExtendedFormats = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageMultisample = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageReadWithoutFormat = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageWriteWithoutFormat = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderClipDistance = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderCullDistance = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInt64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInt16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderResourceResidency = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderResourceMinLod = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseBinding = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyBuffer = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage2D = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyImage3D = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency2Samples = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency4Samples = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency8Samples = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidency16Samples = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseResidencyAliased = {}; - VULKAN_HPP_NAMESPACE::Bool32 variableMultisampleRate = {}; - VULKAN_HPP_NAMESPACE::Bool32 inheritedQueries = {}; - }; - - struct DeviceCreateInfo - { - using NativeType = VkDeviceCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceCreateInfo( VULKAN_HPP_NAMESPACE::DeviceCreateFlags flags_ = {}, - uint32_t queueCreateInfoCount_ = {}, - const VULKAN_HPP_NAMESPACE::DeviceQueueCreateInfo * pQueueCreateInfos_ = {}, - uint32_t enabledLayerCount_ = {}, - const char * const * ppEnabledLayerNames_ = {}, - uint32_t enabledExtensionCount_ = {}, - const char * const * ppEnabledExtensionNames_ = {}, - const VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pEnabledFeatures_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , queueCreateInfoCount( queueCreateInfoCount_ ) - , pQueueCreateInfos( pQueueCreateInfos_ ) - , enabledLayerCount( enabledLayerCount_ ) - , ppEnabledLayerNames( ppEnabledLayerNames_ ) - , enabledExtensionCount( enabledExtensionCount_ ) - , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) - , pEnabledFeatures( pEnabledFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceCreateInfo( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceCreateInfo( VkDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : DeviceCreateInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceCreateInfo( VULKAN_HPP_NAMESPACE::DeviceCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueCreateInfos_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledLayerNames_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledExtensionNames_ = {}, - const VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pEnabledFeatures_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , queueCreateInfoCount( static_cast( queueCreateInfos_.size() ) ) - , pQueueCreateInfos( queueCreateInfos_.data() ) - , enabledLayerCount( static_cast( pEnabledLayerNames_.size() ) ) - , ppEnabledLayerNames( pEnabledLayerNames_.data() ) - , enabledExtensionCount( static_cast( pEnabledExtensionNames_.size() ) ) - , ppEnabledExtensionNames( pEnabledExtensionNames_.data() ) - , pEnabledFeatures( pEnabledFeatures_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceCreateInfo & operator=( DeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceCreateInfo & operator=( VkDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::DeviceCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setQueueCreateInfoCount( uint32_t queueCreateInfoCount_ ) VULKAN_HPP_NOEXCEPT - { - queueCreateInfoCount = queueCreateInfoCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & - setPQueueCreateInfos( const VULKAN_HPP_NAMESPACE::DeviceQueueCreateInfo * pQueueCreateInfos_ ) VULKAN_HPP_NOEXCEPT - { - pQueueCreateInfos = pQueueCreateInfos_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceCreateInfo & setQueueCreateInfos( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueCreateInfos_ ) VULKAN_HPP_NOEXCEPT - { - queueCreateInfoCount = static_cast( queueCreateInfos_.size() ); - pQueueCreateInfos = queueCreateInfos_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setEnabledLayerCount( uint32_t enabledLayerCount_ ) VULKAN_HPP_NOEXCEPT - { - enabledLayerCount = enabledLayerCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setPpEnabledLayerNames( const char * const * ppEnabledLayerNames_ ) VULKAN_HPP_NOEXCEPT - { - ppEnabledLayerNames = ppEnabledLayerNames_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceCreateInfo & - setPEnabledLayerNames( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledLayerNames_ ) VULKAN_HPP_NOEXCEPT - { - enabledLayerCount = static_cast( pEnabledLayerNames_.size() ); - ppEnabledLayerNames = pEnabledLayerNames_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) VULKAN_HPP_NOEXCEPT - { - enabledExtensionCount = enabledExtensionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setPpEnabledExtensionNames( const char * const * ppEnabledExtensionNames_ ) VULKAN_HPP_NOEXCEPT - { - ppEnabledExtensionNames = ppEnabledExtensionNames_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceCreateInfo & - setPEnabledExtensionNames( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledExtensionNames_ ) VULKAN_HPP_NOEXCEPT - { - enabledExtensionCount = static_cast( pEnabledExtensionNames_.size() ); - ppEnabledExtensionNames = pEnabledExtensionNames_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceCreateInfo & setPEnabledFeatures( const VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pEnabledFeatures_ ) VULKAN_HPP_NOEXCEPT - { - pEnabledFeatures = pEnabledFeatures_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - queueCreateInfoCount, - pQueueCreateInfos, - enabledLayerCount, - ppEnabledLayerNames, - enabledExtensionCount, - ppEnabledExtensionNames, - pEnabledFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( DeviceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = queueCreateInfoCount <=> rhs.queueCreateInfoCount; cmp != 0 ) - return cmp; - if ( auto cmp = pQueueCreateInfos <=> rhs.pQueueCreateInfos; cmp != 0 ) - return cmp; - if ( auto cmp = enabledLayerCount <=> rhs.enabledLayerCount; cmp != 0 ) - return cmp; - for ( size_t i = 0; i < enabledLayerCount; ++i ) - { - if ( ppEnabledLayerNames[i] != rhs.ppEnabledLayerNames[i] ) - if ( auto cmp = strcmp( ppEnabledLayerNames[i], rhs.ppEnabledLayerNames[i] ); cmp != 0 ) - return cmp < 0 ? std::strong_ordering::less : std::strong_ordering::greater; - } - if ( auto cmp = enabledExtensionCount <=> rhs.enabledExtensionCount; cmp != 0 ) - return cmp; - for ( size_t i = 0; i < enabledExtensionCount; ++i ) - { - if ( ppEnabledExtensionNames[i] != rhs.ppEnabledExtensionNames[i] ) - if ( auto cmp = strcmp( ppEnabledExtensionNames[i], rhs.ppEnabledExtensionNames[i] ); cmp != 0 ) - return cmp < 0 ? std::strong_ordering::less : std::strong_ordering::greater; - } - if ( auto cmp = pEnabledFeatures <=> rhs.pEnabledFeatures; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( DeviceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( queueCreateInfoCount == rhs.queueCreateInfoCount ) && - ( pQueueCreateInfos == rhs.pQueueCreateInfos ) && ( enabledLayerCount == rhs.enabledLayerCount ) && - [this, rhs] - { - bool equal = true; - for ( size_t i = 0; equal && ( i < enabledLayerCount ); ++i ) - { - equal = ( ( ppEnabledLayerNames[i] == rhs.ppEnabledLayerNames[i] ) || ( strcmp( ppEnabledLayerNames[i], rhs.ppEnabledLayerNames[i] ) == 0 ) ); - } - return equal; - }() && ( enabledExtensionCount == rhs.enabledExtensionCount ) && - [this, rhs] - { - bool equal = true; - for ( size_t i = 0; equal && ( i < enabledExtensionCount ); ++i ) - { - equal = ( ( ppEnabledExtensionNames[i] == rhs.ppEnabledExtensionNames[i] ) || - ( strcmp( ppEnabledExtensionNames[i], rhs.ppEnabledExtensionNames[i] ) == 0 ) ); - } - return equal; - }() && ( pEnabledFeatures == rhs.pEnabledFeatures ); - } - - bool operator!=( DeviceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceCreateFlags flags = {}; - uint32_t queueCreateInfoCount = {}; - const VULKAN_HPP_NAMESPACE::DeviceQueueCreateInfo * pQueueCreateInfos = {}; - uint32_t enabledLayerCount = {}; - const char * const * ppEnabledLayerNames = {}; - uint32_t enabledExtensionCount = {}; - const char * const * ppEnabledExtensionNames = {}; - const VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures * pEnabledFeatures = {}; - }; - - template <> - struct CppType - { - using Type = DeviceCreateInfo; - }; - - struct DeviceDeviceMemoryReportCreateInfoEXT - { - using NativeType = VkDeviceDeviceMemoryReportCreateInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceDeviceMemoryReportCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceDeviceMemoryReportCreateInfoEXT( VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT flags_ = {}, - PFN_vkDeviceMemoryReportCallbackEXT pfnUserCallback_ = {}, - void * pUserData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pfnUserCallback( pfnUserCallback_ ) - , pUserData( pUserData_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceDeviceMemoryReportCreateInfoEXT( DeviceDeviceMemoryReportCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceDeviceMemoryReportCreateInfoEXT( VkDeviceDeviceMemoryReportCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceDeviceMemoryReportCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceDeviceMemoryReportCreateInfoEXT & operator=( DeviceDeviceMemoryReportCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceDeviceMemoryReportCreateInfoEXT & operator=( VkDeviceDeviceMemoryReportCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceDeviceMemoryReportCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceDeviceMemoryReportCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceDeviceMemoryReportCreateInfoEXT & - setPfnUserCallback( PFN_vkDeviceMemoryReportCallbackEXT pfnUserCallback_ ) VULKAN_HPP_NOEXCEPT - { - pfnUserCallback = pfnUserCallback_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceDeviceMemoryReportCreateInfoEXT & setPUserData( void * pUserData_ ) VULKAN_HPP_NOEXCEPT - { - pUserData = pUserData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceDeviceMemoryReportCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceDeviceMemoryReportCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pfnUserCallback, pUserData ); - } -#endif - - bool operator==( DeviceDeviceMemoryReportCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -#if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -#else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pfnUserCallback == rhs.pfnUserCallback ) && - ( pUserData == rhs.pUserData ); -#endif - } - - bool operator!=( DeviceDeviceMemoryReportCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceDeviceMemoryReportCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT flags = {}; - PFN_vkDeviceMemoryReportCallbackEXT pfnUserCallback = {}; - void * pUserData = {}; - }; - - template <> - struct CppType - { - using Type = DeviceDeviceMemoryReportCreateInfoEXT; - }; - - struct DeviceDiagnosticsConfigCreateInfoNV - { - using NativeType = VkDeviceDiagnosticsConfigCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceDiagnosticsConfigCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigCreateInfoNV( VULKAN_HPP_NAMESPACE::DeviceDiagnosticsConfigFlagsNV flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceDiagnosticsConfigCreateInfoNV( DeviceDiagnosticsConfigCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceDiagnosticsConfigCreateInfoNV( VkDeviceDiagnosticsConfigCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceDiagnosticsConfigCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceDiagnosticsConfigCreateInfoNV & operator=( DeviceDiagnosticsConfigCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceDiagnosticsConfigCreateInfoNV & operator=( VkDeviceDiagnosticsConfigCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceDiagnosticsConfigCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceDiagnosticsConfigCreateInfoNV & setFlags( VULKAN_HPP_NAMESPACE::DeviceDiagnosticsConfigFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceDiagnosticsConfigCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceDiagnosticsConfigCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceDiagnosticsConfigCreateInfoNV const & ) const = default; -#else - bool operator==( DeviceDiagnosticsConfigCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( DeviceDiagnosticsConfigCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceDiagnosticsConfigCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceDiagnosticsConfigFlagsNV flags = {}; - }; - - template <> - struct CppType - { - using Type = DeviceDiagnosticsConfigCreateInfoNV; - }; - - struct DeviceEventInfoEXT - { - using NativeType = VkDeviceEventInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceEventInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceEventInfoEXT( VULKAN_HPP_NAMESPACE::DeviceEventTypeEXT deviceEvent_ = VULKAN_HPP_NAMESPACE::DeviceEventTypeEXT::eDisplayHotplug, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceEvent( deviceEvent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceEventInfoEXT( DeviceEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceEventInfoEXT( VkDeviceEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT : DeviceEventInfoEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceEventInfoEXT & operator=( DeviceEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceEventInfoEXT & operator=( VkDeviceEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceEventInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceEventInfoEXT & setDeviceEvent( VULKAN_HPP_NAMESPACE::DeviceEventTypeEXT deviceEvent_ ) VULKAN_HPP_NOEXCEPT - { - deviceEvent = deviceEvent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceEventInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceEventInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceEvent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceEventInfoEXT const & ) const = default; -#else - bool operator==( DeviceEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceEvent == rhs.deviceEvent ); -# endif - } - - bool operator!=( DeviceEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceEventInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceEventTypeEXT deviceEvent = VULKAN_HPP_NAMESPACE::DeviceEventTypeEXT::eDisplayHotplug; - }; - - template <> - struct CppType - { - using Type = DeviceEventInfoEXT; - }; - - struct DeviceGroupBindSparseInfo - { - using NativeType = VkDeviceGroupBindSparseInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupBindSparseInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DeviceGroupBindSparseInfo( uint32_t resourceDeviceIndex_ = {}, uint32_t memoryDeviceIndex_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , resourceDeviceIndex( resourceDeviceIndex_ ) - , memoryDeviceIndex( memoryDeviceIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupBindSparseInfo( DeviceGroupBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupBindSparseInfo( VkDeviceGroupBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupBindSparseInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupBindSparseInfo & operator=( DeviceGroupBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupBindSparseInfo & operator=( VkDeviceGroupBindSparseInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupBindSparseInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupBindSparseInfo & setResourceDeviceIndex( uint32_t resourceDeviceIndex_ ) VULKAN_HPP_NOEXCEPT - { - resourceDeviceIndex = resourceDeviceIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupBindSparseInfo & setMemoryDeviceIndex( uint32_t memoryDeviceIndex_ ) VULKAN_HPP_NOEXCEPT - { - memoryDeviceIndex = memoryDeviceIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupBindSparseInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupBindSparseInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, resourceDeviceIndex, memoryDeviceIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupBindSparseInfo const & ) const = default; -#else - bool operator==( DeviceGroupBindSparseInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( resourceDeviceIndex == rhs.resourceDeviceIndex ) && - ( memoryDeviceIndex == rhs.memoryDeviceIndex ); -# endif - } - - bool operator!=( DeviceGroupBindSparseInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupBindSparseInfo; - const void * pNext = {}; - uint32_t resourceDeviceIndex = {}; - uint32_t memoryDeviceIndex = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupBindSparseInfo; - }; - using DeviceGroupBindSparseInfoKHR = DeviceGroupBindSparseInfo; - - struct DeviceGroupCommandBufferBeginInfo - { - using NativeType = VkDeviceGroupCommandBufferBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupCommandBufferBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupCommandBufferBeginInfo( uint32_t deviceMask_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceMask( deviceMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupCommandBufferBeginInfo( DeviceGroupCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupCommandBufferBeginInfo( VkDeviceGroupCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupCommandBufferBeginInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupCommandBufferBeginInfo & operator=( DeviceGroupCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupCommandBufferBeginInfo & operator=( VkDeviceGroupCommandBufferBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupCommandBufferBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupCommandBufferBeginInfo & setDeviceMask( uint32_t deviceMask_ ) VULKAN_HPP_NOEXCEPT - { - deviceMask = deviceMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupCommandBufferBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupCommandBufferBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupCommandBufferBeginInfo const & ) const = default; -#else - bool operator==( DeviceGroupCommandBufferBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceMask == rhs.deviceMask ); -# endif - } - - bool operator!=( DeviceGroupCommandBufferBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupCommandBufferBeginInfo; - const void * pNext = {}; - uint32_t deviceMask = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupCommandBufferBeginInfo; - }; - using DeviceGroupCommandBufferBeginInfoKHR = DeviceGroupCommandBufferBeginInfo; - - struct DeviceGroupDeviceCreateInfo - { - using NativeType = VkDeviceGroupDeviceCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupDeviceCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupDeviceCreateInfo( uint32_t physicalDeviceCount_ = {}, - const VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , physicalDeviceCount( physicalDeviceCount_ ) - , pPhysicalDevices( pPhysicalDevices_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupDeviceCreateInfo( DeviceGroupDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupDeviceCreateInfo( VkDeviceGroupDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupDeviceCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupDeviceCreateInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & physicalDevices_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), physicalDeviceCount( static_cast( physicalDevices_.size() ) ), pPhysicalDevices( physicalDevices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupDeviceCreateInfo & operator=( DeviceGroupDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupDeviceCreateInfo & operator=( VkDeviceGroupDeviceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupDeviceCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupDeviceCreateInfo & setPhysicalDeviceCount( uint32_t physicalDeviceCount_ ) VULKAN_HPP_NOEXCEPT - { - physicalDeviceCount = physicalDeviceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupDeviceCreateInfo & - setPPhysicalDevices( const VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices_ ) VULKAN_HPP_NOEXCEPT - { - pPhysicalDevices = pPhysicalDevices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupDeviceCreateInfo & setPhysicalDevices( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & physicalDevices_ ) VULKAN_HPP_NOEXCEPT - { - physicalDeviceCount = static_cast( physicalDevices_.size() ); - pPhysicalDevices = physicalDevices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupDeviceCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupDeviceCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, physicalDeviceCount, pPhysicalDevices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupDeviceCreateInfo const & ) const = default; -#else - bool operator==( DeviceGroupDeviceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( physicalDeviceCount == rhs.physicalDeviceCount ) && - ( pPhysicalDevices == rhs.pPhysicalDevices ); -# endif - } - - bool operator!=( DeviceGroupDeviceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupDeviceCreateInfo; - const void * pNext = {}; - uint32_t physicalDeviceCount = {}; - const VULKAN_HPP_NAMESPACE::PhysicalDevice * pPhysicalDevices = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupDeviceCreateInfo; - }; - using DeviceGroupDeviceCreateInfoKHR = DeviceGroupDeviceCreateInfo; - - struct DeviceGroupPresentCapabilitiesKHR - { - using NativeType = VkDeviceGroupPresentCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupPresentCapabilitiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentCapabilitiesKHR( std::array const & presentMask_ = {}, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , presentMask( presentMask_ ) - , modes( modes_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentCapabilitiesKHR( DeviceGroupPresentCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupPresentCapabilitiesKHR( VkDeviceGroupPresentCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupPresentCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupPresentCapabilitiesKHR & operator=( DeviceGroupPresentCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupPresentCapabilitiesKHR & operator=( VkDeviceGroupPresentCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDeviceGroupPresentCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupPresentCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, presentMask, modes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupPresentCapabilitiesKHR const & ) const = default; -#else - bool operator==( DeviceGroupPresentCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentMask == rhs.presentMask ) && ( modes == rhs.modes ); -# endif - } - - bool operator!=( DeviceGroupPresentCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupPresentCapabilitiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D presentMask = {}; - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupPresentCapabilitiesKHR; - }; - - struct DeviceGroupPresentInfoKHR - { - using NativeType = VkDeviceGroupPresentInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupPresentInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupPresentInfoKHR( - uint32_t swapchainCount_ = {}, - const uint32_t * pDeviceMasks_ = {}, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR mode_ = VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR::eLocal, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchainCount( swapchainCount_ ) - , pDeviceMasks( pDeviceMasks_ ) - , mode( mode_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupPresentInfoKHR( DeviceGroupPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupPresentInfoKHR( VkDeviceGroupPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupPresentInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupPresentInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceMasks_, - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR mode_ = VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR::eLocal, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), swapchainCount( static_cast( deviceMasks_.size() ) ), pDeviceMasks( deviceMasks_.data() ), mode( mode_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupPresentInfoKHR & operator=( DeviceGroupPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupPresentInfoKHR & operator=( VkDeviceGroupPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentInfoKHR & setSwapchainCount( uint32_t swapchainCount_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = swapchainCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentInfoKHR & setPDeviceMasks( const uint32_t * pDeviceMasks_ ) VULKAN_HPP_NOEXCEPT - { - pDeviceMasks = pDeviceMasks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupPresentInfoKHR & setDeviceMasks( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceMasks_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( deviceMasks_.size() ); - pDeviceMasks = deviceMasks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupPresentInfoKHR & setMode( VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupPresentInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupPresentInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchainCount, pDeviceMasks, mode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupPresentInfoKHR const & ) const = default; -#else - bool operator==( DeviceGroupPresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchainCount == rhs.swapchainCount ) && ( pDeviceMasks == rhs.pDeviceMasks ) && - ( mode == rhs.mode ); -# endif - } - - bool operator!=( DeviceGroupPresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupPresentInfoKHR; - const void * pNext = {}; - uint32_t swapchainCount = {}; - const uint32_t * pDeviceMasks = {}; - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR mode = VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagBitsKHR::eLocal; - }; - - template <> - struct CppType - { - using Type = DeviceGroupPresentInfoKHR; - }; - - struct DeviceGroupRenderPassBeginInfo - { - using NativeType = VkDeviceGroupRenderPassBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupRenderPassBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupRenderPassBeginInfo( uint32_t deviceMask_ = {}, - uint32_t deviceRenderAreaCount_ = {}, - const VULKAN_HPP_NAMESPACE::Rect2D * pDeviceRenderAreas_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceMask( deviceMask_ ) - , deviceRenderAreaCount( deviceRenderAreaCount_ ) - , pDeviceRenderAreas( pDeviceRenderAreas_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupRenderPassBeginInfo( DeviceGroupRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupRenderPassBeginInfo( VkDeviceGroupRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupRenderPassBeginInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupRenderPassBeginInfo( uint32_t deviceMask_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceRenderAreas_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , deviceMask( deviceMask_ ) - , deviceRenderAreaCount( static_cast( deviceRenderAreas_.size() ) ) - , pDeviceRenderAreas( deviceRenderAreas_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupRenderPassBeginInfo & operator=( DeviceGroupRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupRenderPassBeginInfo & operator=( VkDeviceGroupRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupRenderPassBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupRenderPassBeginInfo & setDeviceMask( uint32_t deviceMask_ ) VULKAN_HPP_NOEXCEPT - { - deviceMask = deviceMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupRenderPassBeginInfo & setDeviceRenderAreaCount( uint32_t deviceRenderAreaCount_ ) VULKAN_HPP_NOEXCEPT - { - deviceRenderAreaCount = deviceRenderAreaCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupRenderPassBeginInfo & - setPDeviceRenderAreas( const VULKAN_HPP_NAMESPACE::Rect2D * pDeviceRenderAreas_ ) VULKAN_HPP_NOEXCEPT - { - pDeviceRenderAreas = pDeviceRenderAreas_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupRenderPassBeginInfo & - setDeviceRenderAreas( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & deviceRenderAreas_ ) VULKAN_HPP_NOEXCEPT - { - deviceRenderAreaCount = static_cast( deviceRenderAreas_.size() ); - pDeviceRenderAreas = deviceRenderAreas_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupRenderPassBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupRenderPassBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceMask, deviceRenderAreaCount, pDeviceRenderAreas ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupRenderPassBeginInfo const & ) const = default; -#else - bool operator==( DeviceGroupRenderPassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceMask == rhs.deviceMask ) && ( deviceRenderAreaCount == rhs.deviceRenderAreaCount ) && - ( pDeviceRenderAreas == rhs.pDeviceRenderAreas ); -# endif - } - - bool operator!=( DeviceGroupRenderPassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupRenderPassBeginInfo; - const void * pNext = {}; - uint32_t deviceMask = {}; - uint32_t deviceRenderAreaCount = {}; - const VULKAN_HPP_NAMESPACE::Rect2D * pDeviceRenderAreas = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupRenderPassBeginInfo; - }; - using DeviceGroupRenderPassBeginInfoKHR = DeviceGroupRenderPassBeginInfo; - - struct DeviceGroupSubmitInfo - { - using NativeType = VkDeviceGroupSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupSubmitInfo( uint32_t waitSemaphoreCount_ = {}, - const uint32_t * pWaitSemaphoreDeviceIndices_ = {}, - uint32_t commandBufferCount_ = {}, - const uint32_t * pCommandBufferDeviceMasks_ = {}, - uint32_t signalSemaphoreCount_ = {}, - const uint32_t * pSignalSemaphoreDeviceIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphoreDeviceIndices( pWaitSemaphoreDeviceIndices_ ) - , commandBufferCount( commandBufferCount_ ) - , pCommandBufferDeviceMasks( pCommandBufferDeviceMasks_ ) - , signalSemaphoreCount( signalSemaphoreCount_ ) - , pSignalSemaphoreDeviceIndices( pSignalSemaphoreDeviceIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupSubmitInfo( DeviceGroupSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupSubmitInfo( VkDeviceGroupSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupSubmitInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupSubmitInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreDeviceIndices_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBufferDeviceMasks_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreDeviceIndices_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreCount( static_cast( waitSemaphoreDeviceIndices_.size() ) ) - , pWaitSemaphoreDeviceIndices( waitSemaphoreDeviceIndices_.data() ) - , commandBufferCount( static_cast( commandBufferDeviceMasks_.size() ) ) - , pCommandBufferDeviceMasks( commandBufferDeviceMasks_.data() ) - , signalSemaphoreCount( static_cast( signalSemaphoreDeviceIndices_.size() ) ) - , pSignalSemaphoreDeviceIndices( signalSemaphoreDeviceIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupSubmitInfo & operator=( DeviceGroupSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupSubmitInfo & operator=( VkDeviceGroupSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setPWaitSemaphoreDeviceIndices( const uint32_t * pWaitSemaphoreDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphoreDeviceIndices = pWaitSemaphoreDeviceIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupSubmitInfo & - setWaitSemaphoreDeviceIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = static_cast( waitSemaphoreDeviceIndices_.size() ); - pWaitSemaphoreDeviceIndices = waitSemaphoreDeviceIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setCommandBufferCount( uint32_t commandBufferCount_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferCount = commandBufferCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setPCommandBufferDeviceMasks( const uint32_t * pCommandBufferDeviceMasks_ ) VULKAN_HPP_NOEXCEPT - { - pCommandBufferDeviceMasks = pCommandBufferDeviceMasks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupSubmitInfo & - setCommandBufferDeviceMasks( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBufferDeviceMasks_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferCount = static_cast( commandBufferDeviceMasks_.size() ); - pCommandBufferDeviceMasks = commandBufferDeviceMasks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = signalSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSubmitInfo & setPSignalSemaphoreDeviceIndices( const uint32_t * pSignalSemaphoreDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphoreDeviceIndices = pSignalSemaphoreDeviceIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DeviceGroupSubmitInfo & - setSignalSemaphoreDeviceIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreDeviceIndices_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = static_cast( signalSemaphoreDeviceIndices_.size() ); - pSignalSemaphoreDeviceIndices = signalSemaphoreDeviceIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - waitSemaphoreCount, - pWaitSemaphoreDeviceIndices, - commandBufferCount, - pCommandBufferDeviceMasks, - signalSemaphoreCount, - pSignalSemaphoreDeviceIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupSubmitInfo const & ) const = default; -#else - bool operator==( DeviceGroupSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) && - ( pWaitSemaphoreDeviceIndices == rhs.pWaitSemaphoreDeviceIndices ) && ( commandBufferCount == rhs.commandBufferCount ) && - ( pCommandBufferDeviceMasks == rhs.pCommandBufferDeviceMasks ) && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) && - ( pSignalSemaphoreDeviceIndices == rhs.pSignalSemaphoreDeviceIndices ); -# endif - } - - bool operator!=( DeviceGroupSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupSubmitInfo; - const void * pNext = {}; - uint32_t waitSemaphoreCount = {}; - const uint32_t * pWaitSemaphoreDeviceIndices = {}; - uint32_t commandBufferCount = {}; - const uint32_t * pCommandBufferDeviceMasks = {}; - uint32_t signalSemaphoreCount = {}; - const uint32_t * pSignalSemaphoreDeviceIndices = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupSubmitInfo; - }; - using DeviceGroupSubmitInfoKHR = DeviceGroupSubmitInfo; - - struct DeviceGroupSwapchainCreateInfoKHR - { - using NativeType = VkDeviceGroupSwapchainCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceGroupSwapchainCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceGroupSwapchainCreateInfoKHR( VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , modes( modes_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceGroupSwapchainCreateInfoKHR( DeviceGroupSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupSwapchainCreateInfoKHR( VkDeviceGroupSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceGroupSwapchainCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceGroupSwapchainCreateInfoKHR & operator=( DeviceGroupSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceGroupSwapchainCreateInfoKHR & operator=( VkDeviceGroupSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSwapchainCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceGroupSwapchainCreateInfoKHR & setModes( VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes_ ) VULKAN_HPP_NOEXCEPT - { - modes = modes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceGroupSwapchainCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceGroupSwapchainCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, modes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceGroupSwapchainCreateInfoKHR const & ) const = default; -#else - bool operator==( DeviceGroupSwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( modes == rhs.modes ); -# endif - } - - bool operator!=( DeviceGroupSwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceGroupSwapchainCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceGroupPresentModeFlagsKHR modes = {}; - }; - - template <> - struct CppType - { - using Type = DeviceGroupSwapchainCreateInfoKHR; - }; - - struct ImageCreateInfo - { - using NativeType = VkImageCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageCreateInfo( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ImageType imageType_ = VULKAN_HPP_NAMESPACE::ImageType::e1D, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {}, - uint32_t mipLevels_ = {}, - uint32_t arrayLayers_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::ImageTiling tiling_ = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ = {}, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive, - uint32_t queueFamilyIndexCount_ = {}, - const uint32_t * pQueueFamilyIndices_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , imageType( imageType_ ) - , format( format_ ) - , extent( extent_ ) - , mipLevels( mipLevels_ ) - , arrayLayers( arrayLayers_ ) - , samples( samples_ ) - , tiling( tiling_ ) - , usage( usage_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - , initialLayout( initialLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageCreateInfo( ImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCreateInfo( VkImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : ImageCreateInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageCreateInfo( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ImageType imageType_, - VULKAN_HPP_NAMESPACE::Format format_, - VULKAN_HPP_NAMESPACE::Extent3D extent_, - uint32_t mipLevels_, - uint32_t arrayLayers_, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_, - VULKAN_HPP_NAMESPACE::ImageTiling tiling_, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_, - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , imageType( imageType_ ) - , format( format_ ) - , extent( extent_ ) - , mipLevels( mipLevels_ ) - , arrayLayers( arrayLayers_ ) - , samples( samples_ ) - , tiling( tiling_ ) - , usage( usage_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( static_cast( queueFamilyIndices_.size() ) ) - , pQueueFamilyIndices( queueFamilyIndices_.data() ) - , initialLayout( initialLayout_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageCreateInfo & operator=( ImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCreateInfo & operator=( VkImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setImageType( VULKAN_HPP_NAMESPACE::ImageType imageType_ ) VULKAN_HPP_NOEXCEPT - { - imageType = imageType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setMipLevels( uint32_t mipLevels_ ) VULKAN_HPP_NOEXCEPT - { - mipLevels = mipLevels_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setArrayLayers( uint32_t arrayLayers_ ) VULKAN_HPP_NOEXCEPT - { - arrayLayers = arrayLayers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ ) VULKAN_HPP_NOEXCEPT - { - samples = samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setTiling( VULKAN_HPP_NAMESPACE::ImageTiling tiling_ ) VULKAN_HPP_NOEXCEPT - { - tiling = tiling_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setSharingMode( VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ ) VULKAN_HPP_NOEXCEPT - { - sharingMode = sharingMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setPQueueFamilyIndices( const uint32_t * pQueueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageCreateInfo & setQueueFamilyIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = static_cast( queueFamilyIndices_.size() ); - pQueueFamilyIndices = queueFamilyIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 ImageCreateInfo & setInitialLayout( VULKAN_HPP_NAMESPACE::ImageLayout initialLayout_ ) VULKAN_HPP_NOEXCEPT - { - initialLayout = initialLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - imageType, - format, - extent, - mipLevels, - arrayLayers, - samples, - tiling, - usage, - sharingMode, - queueFamilyIndexCount, - pQueueFamilyIndices, - initialLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageCreateInfo const & ) const = default; -#else - bool operator==( ImageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( imageType == rhs.imageType ) && ( format == rhs.format ) && - ( extent == rhs.extent ) && ( mipLevels == rhs.mipLevels ) && ( arrayLayers == rhs.arrayLayers ) && ( samples == rhs.samples ) && - ( tiling == rhs.tiling ) && ( usage == rhs.usage ) && ( sharingMode == rhs.sharingMode ) && - ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) && - ( initialLayout == rhs.initialLayout ); -# endif - } - - bool operator!=( ImageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::ImageType imageType = VULKAN_HPP_NAMESPACE::ImageType::e1D; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - uint32_t mipLevels = {}; - uint32_t arrayLayers = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::ImageTiling tiling = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal; - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage = {}; - VULKAN_HPP_NAMESPACE::SharingMode sharingMode = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive; - uint32_t queueFamilyIndexCount = {}; - const uint32_t * pQueueFamilyIndices = {}; - VULKAN_HPP_NAMESPACE::ImageLayout initialLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - template <> - struct CppType - { - using Type = ImageCreateInfo; - }; - - struct DeviceImageMemoryRequirements - { - using NativeType = VkDeviceImageMemoryRequirements; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceImageMemoryRequirements; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DeviceImageMemoryRequirements( const VULKAN_HPP_NAMESPACE::ImageCreateInfo * pCreateInfo_ = {}, - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pCreateInfo( pCreateInfo_ ) - , planeAspect( planeAspect_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceImageMemoryRequirements( DeviceImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceImageMemoryRequirements( VkDeviceImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceImageMemoryRequirements( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceImageMemoryRequirements & operator=( DeviceImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceImageMemoryRequirements & operator=( VkDeviceImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceImageMemoryRequirements & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceImageMemoryRequirements & setPCreateInfo( const VULKAN_HPP_NAMESPACE::ImageCreateInfo * pCreateInfo_ ) VULKAN_HPP_NOEXCEPT - { - pCreateInfo = pCreateInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceImageMemoryRequirements & setPlaneAspect( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ ) VULKAN_HPP_NOEXCEPT - { - planeAspect = planeAspect_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceImageMemoryRequirements const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceImageMemoryRequirements &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pCreateInfo, planeAspect ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceImageMemoryRequirements const & ) const = default; -#else - bool operator==( DeviceImageMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pCreateInfo == rhs.pCreateInfo ) && ( planeAspect == rhs.planeAspect ); -# endif - } - - bool operator!=( DeviceImageMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceImageMemoryRequirements; - const void * pNext = {}; - const VULKAN_HPP_NAMESPACE::ImageCreateInfo * pCreateInfo = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor; - }; - - template <> - struct CppType - { - using Type = DeviceImageMemoryRequirements; - }; - using DeviceImageMemoryRequirementsKHR = DeviceImageMemoryRequirements; - - struct DeviceMemoryOpaqueCaptureAddressInfo - { - using NativeType = VkDeviceMemoryOpaqueCaptureAddressInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceMemoryOpaqueCaptureAddressInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceMemoryOpaqueCaptureAddressInfo( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceMemoryOpaqueCaptureAddressInfo( DeviceMemoryOpaqueCaptureAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryOpaqueCaptureAddressInfo( VkDeviceMemoryOpaqueCaptureAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceMemoryOpaqueCaptureAddressInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceMemoryOpaqueCaptureAddressInfo & operator=( DeviceMemoryOpaqueCaptureAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryOpaqueCaptureAddressInfo & operator=( VkDeviceMemoryOpaqueCaptureAddressInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceMemoryOpaqueCaptureAddressInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceMemoryOpaqueCaptureAddressInfo & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceMemoryOpaqueCaptureAddressInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceMemoryOpaqueCaptureAddressInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceMemoryOpaqueCaptureAddressInfo const & ) const = default; -#else - bool operator==( DeviceMemoryOpaqueCaptureAddressInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ); -# endif - } - - bool operator!=( DeviceMemoryOpaqueCaptureAddressInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceMemoryOpaqueCaptureAddressInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - }; - - template <> - struct CppType - { - using Type = DeviceMemoryOpaqueCaptureAddressInfo; - }; - using DeviceMemoryOpaqueCaptureAddressInfoKHR = DeviceMemoryOpaqueCaptureAddressInfo; - - struct DeviceMemoryOverallocationCreateInfoAMD - { - using NativeType = VkDeviceMemoryOverallocationCreateInfoAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceMemoryOverallocationCreateInfoAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceMemoryOverallocationCreateInfoAMD( - VULKAN_HPP_NAMESPACE::MemoryOverallocationBehaviorAMD overallocationBehavior_ = VULKAN_HPP_NAMESPACE::MemoryOverallocationBehaviorAMD::eDefault, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , overallocationBehavior( overallocationBehavior_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceMemoryOverallocationCreateInfoAMD( DeviceMemoryOverallocationCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryOverallocationCreateInfoAMD( VkDeviceMemoryOverallocationCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceMemoryOverallocationCreateInfoAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceMemoryOverallocationCreateInfoAMD & operator=( DeviceMemoryOverallocationCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryOverallocationCreateInfoAMD & operator=( VkDeviceMemoryOverallocationCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceMemoryOverallocationCreateInfoAMD & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceMemoryOverallocationCreateInfoAMD & - setOverallocationBehavior( VULKAN_HPP_NAMESPACE::MemoryOverallocationBehaviorAMD overallocationBehavior_ ) VULKAN_HPP_NOEXCEPT - { - overallocationBehavior = overallocationBehavior_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceMemoryOverallocationCreateInfoAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceMemoryOverallocationCreateInfoAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, overallocationBehavior ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceMemoryOverallocationCreateInfoAMD const & ) const = default; -#else - bool operator==( DeviceMemoryOverallocationCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( overallocationBehavior == rhs.overallocationBehavior ); -# endif - } - - bool operator!=( DeviceMemoryOverallocationCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceMemoryOverallocationCreateInfoAMD; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::MemoryOverallocationBehaviorAMD overallocationBehavior = VULKAN_HPP_NAMESPACE::MemoryOverallocationBehaviorAMD::eDefault; - }; - - template <> - struct CppType - { - using Type = DeviceMemoryOverallocationCreateInfoAMD; - }; - - struct DeviceMemoryReportCallbackDataEXT - { - using NativeType = VkDeviceMemoryReportCallbackDataEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceMemoryReportCallbackDataEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceMemoryReportCallbackDataEXT( - VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::DeviceMemoryReportEventTypeEXT type_ = VULKAN_HPP_NAMESPACE::DeviceMemoryReportEventTypeEXT::eAllocate, - uint64_t memoryObjectId_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::ObjectType objectType_ = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown, - uint64_t objectHandle_ = {}, - uint32_t heapIndex_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , type( type_ ) - , memoryObjectId( memoryObjectId_ ) - , size( size_ ) - , objectType( objectType_ ) - , objectHandle( objectHandle_ ) - , heapIndex( heapIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceMemoryReportCallbackDataEXT( DeviceMemoryReportCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryReportCallbackDataEXT( VkDeviceMemoryReportCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceMemoryReportCallbackDataEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceMemoryReportCallbackDataEXT & operator=( DeviceMemoryReportCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceMemoryReportCallbackDataEXT & operator=( VkDeviceMemoryReportCallbackDataEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDeviceMemoryReportCallbackDataEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceMemoryReportCallbackDataEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, type, memoryObjectId, size, objectType, objectHandle, heapIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceMemoryReportCallbackDataEXT const & ) const = default; -#else - bool operator==( DeviceMemoryReportCallbackDataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( type == rhs.type ) && ( memoryObjectId == rhs.memoryObjectId ) && - ( size == rhs.size ) && ( objectType == rhs.objectType ) && ( objectHandle == rhs.objectHandle ) && ( heapIndex == rhs.heapIndex ); -# endif - } - - bool operator!=( DeviceMemoryReportCallbackDataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceMemoryReportCallbackDataEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemoryReportFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::DeviceMemoryReportEventTypeEXT type = VULKAN_HPP_NAMESPACE::DeviceMemoryReportEventTypeEXT::eAllocate; - uint64_t memoryObjectId = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::ObjectType objectType = VULKAN_HPP_NAMESPACE::ObjectType::eUnknown; - uint64_t objectHandle = {}; - uint32_t heapIndex = {}; - }; - - template <> - struct CppType - { - using Type = DeviceMemoryReportCallbackDataEXT; - }; - - struct DevicePrivateDataCreateInfo - { - using NativeType = VkDevicePrivateDataCreateInfo; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDevicePrivateDataCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DevicePrivateDataCreateInfo( uint32_t privateDataSlotRequestCount_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , privateDataSlotRequestCount( privateDataSlotRequestCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR DevicePrivateDataCreateInfo( DevicePrivateDataCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DevicePrivateDataCreateInfo( VkDevicePrivateDataCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : DevicePrivateDataCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DevicePrivateDataCreateInfo & operator=( DevicePrivateDataCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DevicePrivateDataCreateInfo & operator=( VkDevicePrivateDataCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DevicePrivateDataCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DevicePrivateDataCreateInfo & setPrivateDataSlotRequestCount( uint32_t privateDataSlotRequestCount_ ) VULKAN_HPP_NOEXCEPT - { - privateDataSlotRequestCount = privateDataSlotRequestCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDevicePrivateDataCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDevicePrivateDataCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, privateDataSlotRequestCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DevicePrivateDataCreateInfo const & ) const = default; -#else - bool operator==( DevicePrivateDataCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( privateDataSlotRequestCount == rhs.privateDataSlotRequestCount ); -# endif - } - - bool operator!=( DevicePrivateDataCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDevicePrivateDataCreateInfo; - const void * pNext = {}; - uint32_t privateDataSlotRequestCount = {}; - }; - - template <> - struct CppType - { - using Type = DevicePrivateDataCreateInfo; - }; - using DevicePrivateDataCreateInfoEXT = DevicePrivateDataCreateInfo; - - struct DeviceQueueGlobalPriorityCreateInfoKHR - { - using NativeType = VkDeviceQueueGlobalPriorityCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceQueueGlobalPriorityCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DeviceQueueGlobalPriorityCreateInfoKHR( VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR globalPriority_ = VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , globalPriority( globalPriority_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceQueueGlobalPriorityCreateInfoKHR( DeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueGlobalPriorityCreateInfoKHR( VkDeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DeviceQueueGlobalPriorityCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceQueueGlobalPriorityCreateInfoKHR & operator=( DeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueGlobalPriorityCreateInfoKHR & operator=( VkDeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceQueueGlobalPriorityCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueGlobalPriorityCreateInfoKHR & - setGlobalPriority( VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR globalPriority_ ) VULKAN_HPP_NOEXCEPT - { - globalPriority = globalPriority_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceQueueGlobalPriorityCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceQueueGlobalPriorityCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, globalPriority ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceQueueGlobalPriorityCreateInfoKHR const & ) const = default; -#else - bool operator==( DeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( globalPriority == rhs.globalPriority ); -# endif - } - - bool operator!=( DeviceQueueGlobalPriorityCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceQueueGlobalPriorityCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR globalPriority = VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow; - }; - - template <> - struct CppType - { - using Type = DeviceQueueGlobalPriorityCreateInfoKHR; - }; - using DeviceQueueGlobalPriorityCreateInfoEXT = DeviceQueueGlobalPriorityCreateInfoKHR; - - struct DeviceQueueInfo2 - { - using NativeType = VkDeviceQueueInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDeviceQueueInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DeviceQueueInfo2( VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags_ = {}, - uint32_t queueFamilyIndex_ = {}, - uint32_t queueIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , queueIndex( queueIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR DeviceQueueInfo2( DeviceQueueInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueInfo2( VkDeviceQueueInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : DeviceQueueInfo2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DeviceQueueInfo2 & operator=( DeviceQueueInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DeviceQueueInfo2 & operator=( VkDeviceQueueInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DeviceQueueInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueInfo2 & setFlags( VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueInfo2 & setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndex = queueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DeviceQueueInfo2 & setQueueIndex( uint32_t queueIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueIndex = queueIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDeviceQueueInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDeviceQueueInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, queueFamilyIndex, queueIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DeviceQueueInfo2 const & ) const = default; -#else - bool operator==( DeviceQueueInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( queueFamilyIndex == rhs.queueFamilyIndex ) && - ( queueIndex == rhs.queueIndex ); -# endif - } - - bool operator!=( DeviceQueueInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDeviceQueueInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceQueueCreateFlags flags = {}; - uint32_t queueFamilyIndex = {}; - uint32_t queueIndex = {}; - }; - - template <> - struct CppType - { - using Type = DeviceQueueInfo2; - }; - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - struct DirectFBSurfaceCreateInfoEXT - { - using NativeType = VkDirectFBSurfaceCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDirectfbSurfaceCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DirectFBSurfaceCreateInfoEXT( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateFlagsEXT flags_ = {}, - IDirectFB * dfb_ = {}, - IDirectFBSurface * surface_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , dfb( dfb_ ) - , surface( surface_ ) - { - } - - VULKAN_HPP_CONSTEXPR DirectFBSurfaceCreateInfoEXT( DirectFBSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DirectFBSurfaceCreateInfoEXT( VkDirectFBSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DirectFBSurfaceCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DirectFBSurfaceCreateInfoEXT & operator=( DirectFBSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DirectFBSurfaceCreateInfoEXT & operator=( VkDirectFBSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DirectFBSurfaceCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DirectFBSurfaceCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DirectFBSurfaceCreateInfoEXT & setDfb( IDirectFB * dfb_ ) VULKAN_HPP_NOEXCEPT - { - dfb = dfb_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DirectFBSurfaceCreateInfoEXT & setSurface( IDirectFBSurface * surface_ ) VULKAN_HPP_NOEXCEPT - { - surface = surface_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDirectFBSurfaceCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDirectFBSurfaceCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, dfb, surface ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DirectFBSurfaceCreateInfoEXT const & ) const = default; -# else - bool operator==( DirectFBSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( dfb == rhs.dfb ) && ( surface == rhs.surface ); -# endif - } - - bool operator!=( DirectFBSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDirectfbSurfaceCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DirectFBSurfaceCreateFlagsEXT flags = {}; - IDirectFB * dfb = {}; - IDirectFBSurface * surface = {}; - }; - - template <> - struct CppType - { - using Type = DirectFBSurfaceCreateInfoEXT; - }; -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - struct DispatchIndirectCommand - { - using NativeType = VkDispatchIndirectCommand; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DispatchIndirectCommand( uint32_t x_ = {}, uint32_t y_ = {}, uint32_t z_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - , z( z_ ) - { - } - - VULKAN_HPP_CONSTEXPR DispatchIndirectCommand( DispatchIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DispatchIndirectCommand( VkDispatchIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT - : DispatchIndirectCommand( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DispatchIndirectCommand & operator=( DispatchIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DispatchIndirectCommand & operator=( VkDispatchIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DispatchIndirectCommand & setX( uint32_t x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DispatchIndirectCommand & setY( uint32_t y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DispatchIndirectCommand & setZ( uint32_t z_ ) VULKAN_HPP_NOEXCEPT - { - z = z_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDispatchIndirectCommand const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDispatchIndirectCommand &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y, z ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DispatchIndirectCommand const & ) const = default; -#else - bool operator==( DispatchIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ) && ( z == rhs.z ); -# endif - } - - bool operator!=( DispatchIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t x = {}; - uint32_t y = {}; - uint32_t z = {}; - }; - - struct DisplayEventInfoEXT - { - using NativeType = VkDisplayEventInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayEventInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DisplayEventInfoEXT( VULKAN_HPP_NAMESPACE::DisplayEventTypeEXT displayEvent_ = VULKAN_HPP_NAMESPACE::DisplayEventTypeEXT::eFirstPixelOut, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , displayEvent( displayEvent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayEventInfoEXT( DisplayEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayEventInfoEXT( VkDisplayEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT : DisplayEventInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayEventInfoEXT & operator=( DisplayEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayEventInfoEXT & operator=( VkDisplayEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayEventInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayEventInfoEXT & setDisplayEvent( VULKAN_HPP_NAMESPACE::DisplayEventTypeEXT displayEvent_ ) VULKAN_HPP_NOEXCEPT - { - displayEvent = displayEvent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayEventInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayEventInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, displayEvent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayEventInfoEXT const & ) const = default; -#else - bool operator==( DisplayEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( displayEvent == rhs.displayEvent ); -# endif - } - - bool operator!=( DisplayEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayEventInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayEventTypeEXT displayEvent = VULKAN_HPP_NAMESPACE::DisplayEventTypeEXT::eFirstPixelOut; - }; - - template <> - struct CppType - { - using Type = DisplayEventInfoEXT; - }; - - struct DisplayModeParametersKHR - { - using NativeType = VkDisplayModeParametersKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayModeParametersKHR( VULKAN_HPP_NAMESPACE::Extent2D visibleRegion_ = {}, uint32_t refreshRate_ = {} ) VULKAN_HPP_NOEXCEPT - : visibleRegion( visibleRegion_ ) - , refreshRate( refreshRate_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayModeParametersKHR( DisplayModeParametersKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeParametersKHR( VkDisplayModeParametersKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayModeParametersKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayModeParametersKHR & operator=( DisplayModeParametersKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeParametersKHR & operator=( VkDisplayModeParametersKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayModeParametersKHR & setVisibleRegion( VULKAN_HPP_NAMESPACE::Extent2D const & visibleRegion_ ) VULKAN_HPP_NOEXCEPT - { - visibleRegion = visibleRegion_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayModeParametersKHR & setRefreshRate( uint32_t refreshRate_ ) VULKAN_HPP_NOEXCEPT - { - refreshRate = refreshRate_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayModeParametersKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayModeParametersKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( visibleRegion, refreshRate ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayModeParametersKHR const & ) const = default; -#else - bool operator==( DisplayModeParametersKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( visibleRegion == rhs.visibleRegion ) && ( refreshRate == rhs.refreshRate ); -# endif - } - - bool operator!=( DisplayModeParametersKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Extent2D visibleRegion = {}; - uint32_t refreshRate = {}; - }; - - struct DisplayModeCreateInfoKHR - { - using NativeType = VkDisplayModeCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayModeCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayModeCreateInfoKHR( VULKAN_HPP_NAMESPACE::DisplayModeCreateFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR parameters_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , parameters( parameters_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayModeCreateInfoKHR( DisplayModeCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeCreateInfoKHR( VkDisplayModeCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayModeCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayModeCreateInfoKHR & operator=( DisplayModeCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeCreateInfoKHR & operator=( VkDisplayModeCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayModeCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayModeCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::DisplayModeCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayModeCreateInfoKHR & setParameters( VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR const & parameters_ ) VULKAN_HPP_NOEXCEPT - { - parameters = parameters_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayModeCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayModeCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, parameters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayModeCreateInfoKHR const & ) const = default; -#else - bool operator==( DisplayModeCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( parameters == rhs.parameters ); -# endif - } - - bool operator!=( DisplayModeCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayModeCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayModeCreateFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR parameters = {}; - }; - - template <> - struct CppType - { - using Type = DisplayModeCreateInfoKHR; - }; - - struct DisplayModePropertiesKHR - { - using NativeType = VkDisplayModePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayModePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayModeKHR displayMode_ = {}, - VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR parameters_ = {} ) VULKAN_HPP_NOEXCEPT - : displayMode( displayMode_ ) - , parameters( parameters_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayModePropertiesKHR( DisplayModePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModePropertiesKHR( VkDisplayModePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayModePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayModePropertiesKHR & operator=( DisplayModePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModePropertiesKHR & operator=( VkDisplayModePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayModePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayModePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( displayMode, parameters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayModePropertiesKHR const & ) const = default; -#else - bool operator==( DisplayModePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( displayMode == rhs.displayMode ) && ( parameters == rhs.parameters ); -# endif - } - - bool operator!=( DisplayModePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DisplayModeKHR displayMode = {}; - VULKAN_HPP_NAMESPACE::DisplayModeParametersKHR parameters = {}; - }; - - struct DisplayModeProperties2KHR - { - using NativeType = VkDisplayModeProperties2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayModeProperties2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayModeProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR displayModeProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , displayModeProperties( displayModeProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayModeProperties2KHR( DisplayModeProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeProperties2KHR( VkDisplayModeProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayModeProperties2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayModeProperties2KHR & operator=( DisplayModeProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayModeProperties2KHR & operator=( VkDisplayModeProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayModeProperties2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayModeProperties2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, displayModeProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayModeProperties2KHR const & ) const = default; -#else - bool operator==( DisplayModeProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( displayModeProperties == rhs.displayModeProperties ); -# endif - } - - bool operator!=( DisplayModeProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayModeProperties2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayModePropertiesKHR displayModeProperties = {}; - }; - - template <> - struct CppType - { - using Type = DisplayModeProperties2KHR; - }; - - struct DisplayNativeHdrSurfaceCapabilitiesAMD - { - using NativeType = VkDisplayNativeHdrSurfaceCapabilitiesAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayNativeHdrSurfaceCapabilitiesAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayNativeHdrSurfaceCapabilitiesAMD( VULKAN_HPP_NAMESPACE::Bool32 localDimmingSupport_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , localDimmingSupport( localDimmingSupport_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayNativeHdrSurfaceCapabilitiesAMD( DisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayNativeHdrSurfaceCapabilitiesAMD( VkDisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayNativeHdrSurfaceCapabilitiesAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayNativeHdrSurfaceCapabilitiesAMD & operator=( DisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayNativeHdrSurfaceCapabilitiesAMD & operator=( VkDisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayNativeHdrSurfaceCapabilitiesAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayNativeHdrSurfaceCapabilitiesAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, localDimmingSupport ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayNativeHdrSurfaceCapabilitiesAMD const & ) const = default; -#else - bool operator==( DisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( localDimmingSupport == rhs.localDimmingSupport ); -# endif - } - - bool operator!=( DisplayNativeHdrSurfaceCapabilitiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayNativeHdrSurfaceCapabilitiesAMD; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 localDimmingSupport = {}; - }; - - template <> - struct CppType - { - using Type = DisplayNativeHdrSurfaceCapabilitiesAMD; - }; - - struct DisplayPlaneCapabilitiesKHR - { - using NativeType = VkDisplayPlaneCapabilitiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPlaneCapabilitiesKHR( VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagsKHR supportedAlpha_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D minSrcPosition_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D maxSrcPosition_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D minSrcExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxSrcExtent_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D minDstPosition_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D maxDstPosition_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D minDstExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxDstExtent_ = {} ) VULKAN_HPP_NOEXCEPT - : supportedAlpha( supportedAlpha_ ) - , minSrcPosition( minSrcPosition_ ) - , maxSrcPosition( maxSrcPosition_ ) - , minSrcExtent( minSrcExtent_ ) - , maxSrcExtent( maxSrcExtent_ ) - , minDstPosition( minDstPosition_ ) - , maxDstPosition( maxDstPosition_ ) - , minDstExtent( minDstExtent_ ) - , maxDstExtent( maxDstExtent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPlaneCapabilitiesKHR( DisplayPlaneCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneCapabilitiesKHR( VkDisplayPlaneCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPlaneCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPlaneCapabilitiesKHR & operator=( DisplayPlaneCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneCapabilitiesKHR & operator=( VkDisplayPlaneCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayPlaneCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPlaneCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( supportedAlpha, minSrcPosition, maxSrcPosition, minSrcExtent, maxSrcExtent, minDstPosition, maxDstPosition, minDstExtent, maxDstExtent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPlaneCapabilitiesKHR const & ) const = default; -#else - bool operator==( DisplayPlaneCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( supportedAlpha == rhs.supportedAlpha ) && ( minSrcPosition == rhs.minSrcPosition ) && ( maxSrcPosition == rhs.maxSrcPosition ) && - ( minSrcExtent == rhs.minSrcExtent ) && ( maxSrcExtent == rhs.maxSrcExtent ) && ( minDstPosition == rhs.minDstPosition ) && - ( maxDstPosition == rhs.maxDstPosition ) && ( minDstExtent == rhs.minDstExtent ) && ( maxDstExtent == rhs.maxDstExtent ); -# endif - } - - bool operator!=( DisplayPlaneCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagsKHR supportedAlpha = {}; - VULKAN_HPP_NAMESPACE::Offset2D minSrcPosition = {}; - VULKAN_HPP_NAMESPACE::Offset2D maxSrcPosition = {}; - VULKAN_HPP_NAMESPACE::Extent2D minSrcExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxSrcExtent = {}; - VULKAN_HPP_NAMESPACE::Offset2D minDstPosition = {}; - VULKAN_HPP_NAMESPACE::Offset2D maxDstPosition = {}; - VULKAN_HPP_NAMESPACE::Extent2D minDstExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxDstExtent = {}; - }; - - struct DisplayPlaneCapabilities2KHR - { - using NativeType = VkDisplayPlaneCapabilities2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayPlaneCapabilities2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPlaneCapabilities2KHR( VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR capabilities_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , capabilities( capabilities_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPlaneCapabilities2KHR( DisplayPlaneCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneCapabilities2KHR( VkDisplayPlaneCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPlaneCapabilities2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPlaneCapabilities2KHR & operator=( DisplayPlaneCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneCapabilities2KHR & operator=( VkDisplayPlaneCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayPlaneCapabilities2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPlaneCapabilities2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, capabilities ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPlaneCapabilities2KHR const & ) const = default; -#else - bool operator==( DisplayPlaneCapabilities2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( capabilities == rhs.capabilities ); -# endif - } - - bool operator!=( DisplayPlaneCapabilities2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayPlaneCapabilities2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayPlaneCapabilitiesKHR capabilities = {}; - }; - - template <> - struct CppType - { - using Type = DisplayPlaneCapabilities2KHR; - }; - - struct DisplayPlaneInfo2KHR - { - using NativeType = VkDisplayPlaneInfo2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayPlaneInfo2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DisplayPlaneInfo2KHR( VULKAN_HPP_NAMESPACE::DisplayModeKHR mode_ = {}, uint32_t planeIndex_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mode( mode_ ) - , planeIndex( planeIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPlaneInfo2KHR( DisplayPlaneInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneInfo2KHR( VkDisplayPlaneInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPlaneInfo2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPlaneInfo2KHR & operator=( DisplayPlaneInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneInfo2KHR & operator=( VkDisplayPlaneInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayPlaneInfo2KHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPlaneInfo2KHR & setMode( VULKAN_HPP_NAMESPACE::DisplayModeKHR mode_ ) VULKAN_HPP_NOEXCEPT - { - mode = mode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPlaneInfo2KHR & setPlaneIndex( uint32_t planeIndex_ ) VULKAN_HPP_NOEXCEPT - { - planeIndex = planeIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayPlaneInfo2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPlaneInfo2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mode, planeIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPlaneInfo2KHR const & ) const = default; -#else - bool operator==( DisplayPlaneInfo2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mode == rhs.mode ) && ( planeIndex == rhs.planeIndex ); -# endif - } - - bool operator!=( DisplayPlaneInfo2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayPlaneInfo2KHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayModeKHR mode = {}; - uint32_t planeIndex = {}; - }; - - template <> - struct CppType - { - using Type = DisplayPlaneInfo2KHR; - }; - - struct DisplayPlanePropertiesKHR - { - using NativeType = VkDisplayPlanePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPlanePropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR currentDisplay_ = {}, - uint32_t currentStackIndex_ = {} ) VULKAN_HPP_NOEXCEPT - : currentDisplay( currentDisplay_ ) - , currentStackIndex( currentStackIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPlanePropertiesKHR( DisplayPlanePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlanePropertiesKHR( VkDisplayPlanePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPlanePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPlanePropertiesKHR & operator=( DisplayPlanePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlanePropertiesKHR & operator=( VkDisplayPlanePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayPlanePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPlanePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( currentDisplay, currentStackIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPlanePropertiesKHR const & ) const = default; -#else - bool operator==( DisplayPlanePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( currentDisplay == rhs.currentDisplay ) && ( currentStackIndex == rhs.currentStackIndex ); -# endif - } - - bool operator!=( DisplayPlanePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DisplayKHR currentDisplay = {}; - uint32_t currentStackIndex = {}; - }; - - struct DisplayPlaneProperties2KHR - { - using NativeType = VkDisplayPlaneProperties2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayPlaneProperties2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPlaneProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR displayPlaneProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , displayPlaneProperties( displayPlaneProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPlaneProperties2KHR( DisplayPlaneProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneProperties2KHR( VkDisplayPlaneProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPlaneProperties2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPlaneProperties2KHR & operator=( DisplayPlaneProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPlaneProperties2KHR & operator=( VkDisplayPlaneProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayPlaneProperties2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPlaneProperties2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, displayPlaneProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPlaneProperties2KHR const & ) const = default; -#else - bool operator==( DisplayPlaneProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( displayPlaneProperties == rhs.displayPlaneProperties ); -# endif - } - - bool operator!=( DisplayPlaneProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayPlaneProperties2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayPlanePropertiesKHR displayPlaneProperties = {}; - }; - - template <> - struct CppType - { - using Type = DisplayPlaneProperties2KHR; - }; - - struct DisplayPowerInfoEXT - { - using NativeType = VkDisplayPowerInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayPowerInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPowerInfoEXT( VULKAN_HPP_NAMESPACE::DisplayPowerStateEXT powerState_ = VULKAN_HPP_NAMESPACE::DisplayPowerStateEXT::eOff, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , powerState( powerState_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPowerInfoEXT( DisplayPowerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPowerInfoEXT( VkDisplayPowerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT : DisplayPowerInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPowerInfoEXT & operator=( DisplayPowerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPowerInfoEXT & operator=( VkDisplayPowerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayPowerInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPowerInfoEXT & setPowerState( VULKAN_HPP_NAMESPACE::DisplayPowerStateEXT powerState_ ) VULKAN_HPP_NOEXCEPT - { - powerState = powerState_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayPowerInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPowerInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, powerState ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPowerInfoEXT const & ) const = default; -#else - bool operator==( DisplayPowerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( powerState == rhs.powerState ); -# endif - } - - bool operator!=( DisplayPowerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayPowerInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayPowerStateEXT powerState = VULKAN_HPP_NAMESPACE::DisplayPowerStateEXT::eOff; - }; - - template <> - struct CppType - { - using Type = DisplayPowerInfoEXT; - }; - - struct DisplayPresentInfoKHR - { - using NativeType = VkDisplayPresentInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayPresentInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPresentInfoKHR( VULKAN_HPP_NAMESPACE::Rect2D srcRect_ = {}, - VULKAN_HPP_NAMESPACE::Rect2D dstRect_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 persistent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcRect( srcRect_ ) - , dstRect( dstRect_ ) - , persistent( persistent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPresentInfoKHR( DisplayPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPresentInfoKHR( VkDisplayPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPresentInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPresentInfoKHR & operator=( DisplayPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPresentInfoKHR & operator=( VkDisplayPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplayPresentInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPresentInfoKHR & setSrcRect( VULKAN_HPP_NAMESPACE::Rect2D const & srcRect_ ) VULKAN_HPP_NOEXCEPT - { - srcRect = srcRect_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPresentInfoKHR & setDstRect( VULKAN_HPP_NAMESPACE::Rect2D const & dstRect_ ) VULKAN_HPP_NOEXCEPT - { - dstRect = dstRect_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplayPresentInfoKHR & setPersistent( VULKAN_HPP_NAMESPACE::Bool32 persistent_ ) VULKAN_HPP_NOEXCEPT - { - persistent = persistent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplayPresentInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPresentInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcRect, dstRect, persistent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayPresentInfoKHR const & ) const = default; -#else - bool operator==( DisplayPresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcRect == rhs.srcRect ) && ( dstRect == rhs.dstRect ) && ( persistent == rhs.persistent ); -# endif - } - - bool operator!=( DisplayPresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayPresentInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Rect2D srcRect = {}; - VULKAN_HPP_NAMESPACE::Rect2D dstRect = {}; - VULKAN_HPP_NAMESPACE::Bool32 persistent = {}; - }; - - template <> - struct CppType - { - using Type = DisplayPresentInfoKHR; - }; - - struct DisplayPropertiesKHR - { - using NativeType = VkDisplayPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayPropertiesKHR( VULKAN_HPP_NAMESPACE::DisplayKHR display_ = {}, - const char * displayName_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D physicalDimensions_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D physicalResolution_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 planeReorderPossible_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 persistentContent_ = {} ) VULKAN_HPP_NOEXCEPT - : display( display_ ) - , displayName( displayName_ ) - , physicalDimensions( physicalDimensions_ ) - , physicalResolution( physicalResolution_ ) - , supportedTransforms( supportedTransforms_ ) - , planeReorderPossible( planeReorderPossible_ ) - , persistentContent( persistentContent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayPropertiesKHR( DisplayPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPropertiesKHR( VkDisplayPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayPropertiesKHR & operator=( DisplayPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayPropertiesKHR & operator=( VkDisplayPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( display, displayName, physicalDimensions, physicalResolution, supportedTransforms, planeReorderPossible, persistentContent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( DisplayPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = display <=> rhs.display; cmp != 0 ) - return cmp; - if ( displayName != rhs.displayName ) - if ( auto cmp = strcmp( displayName, rhs.displayName ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = physicalDimensions <=> rhs.physicalDimensions; cmp != 0 ) - return cmp; - if ( auto cmp = physicalResolution <=> rhs.physicalResolution; cmp != 0 ) - return cmp; - if ( auto cmp = supportedTransforms <=> rhs.supportedTransforms; cmp != 0 ) - return cmp; - if ( auto cmp = planeReorderPossible <=> rhs.planeReorderPossible; cmp != 0 ) - return cmp; - if ( auto cmp = persistentContent <=> rhs.persistentContent; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( DisplayPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( display == rhs.display ) && ( ( displayName == rhs.displayName ) || ( strcmp( displayName, rhs.displayName ) == 0 ) ) && - ( physicalDimensions == rhs.physicalDimensions ) && ( physicalResolution == rhs.physicalResolution ) && - ( supportedTransforms == rhs.supportedTransforms ) && ( planeReorderPossible == rhs.planeReorderPossible ) && - ( persistentContent == rhs.persistentContent ); - } - - bool operator!=( DisplayPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::DisplayKHR display = {}; - const char * displayName = {}; - VULKAN_HPP_NAMESPACE::Extent2D physicalDimensions = {}; - VULKAN_HPP_NAMESPACE::Extent2D physicalResolution = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms = {}; - VULKAN_HPP_NAMESPACE::Bool32 planeReorderPossible = {}; - VULKAN_HPP_NAMESPACE::Bool32 persistentContent = {}; - }; - - struct DisplayProperties2KHR - { - using NativeType = VkDisplayProperties2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplayProperties2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DisplayProperties2KHR( VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR displayProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , displayProperties( displayProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplayProperties2KHR( DisplayProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayProperties2KHR( VkDisplayProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplayProperties2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplayProperties2KHR & operator=( DisplayProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplayProperties2KHR & operator=( VkDisplayProperties2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDisplayProperties2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplayProperties2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, displayProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplayProperties2KHR const & ) const = default; -#else - bool operator==( DisplayProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( displayProperties == rhs.displayProperties ); -# endif - } - - bool operator!=( DisplayProperties2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplayProperties2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplayPropertiesKHR displayProperties = {}; - }; - - template <> - struct CppType - { - using Type = DisplayProperties2KHR; - }; - - struct DisplaySurfaceCreateInfoKHR - { - using NativeType = VkDisplaySurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDisplaySurfaceCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DisplaySurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::DisplayModeKHR displayMode_ = {}, - uint32_t planeIndex_ = {}, - uint32_t planeStackIndex_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - float globalAlpha_ = {}, - VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagBitsKHR alphaMode_ = VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagBitsKHR::eOpaque, - VULKAN_HPP_NAMESPACE::Extent2D imageExtent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , displayMode( displayMode_ ) - , planeIndex( planeIndex_ ) - , planeStackIndex( planeStackIndex_ ) - , transform( transform_ ) - , globalAlpha( globalAlpha_ ) - , alphaMode( alphaMode_ ) - , imageExtent( imageExtent_ ) - { - } - - VULKAN_HPP_CONSTEXPR DisplaySurfaceCreateInfoKHR( DisplaySurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplaySurfaceCreateInfoKHR( VkDisplaySurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : DisplaySurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DisplaySurfaceCreateInfoKHR & operator=( DisplaySurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DisplaySurfaceCreateInfoKHR & operator=( VkDisplaySurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setDisplayMode( VULKAN_HPP_NAMESPACE::DisplayModeKHR displayMode_ ) VULKAN_HPP_NOEXCEPT - { - displayMode = displayMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setPlaneIndex( uint32_t planeIndex_ ) VULKAN_HPP_NOEXCEPT - { - planeIndex = planeIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setPlaneStackIndex( uint32_t planeStackIndex_ ) VULKAN_HPP_NOEXCEPT - { - planeStackIndex = planeStackIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setTransform( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ ) VULKAN_HPP_NOEXCEPT - { - transform = transform_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setGlobalAlpha( float globalAlpha_ ) VULKAN_HPP_NOEXCEPT - { - globalAlpha = globalAlpha_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setAlphaMode( VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagBitsKHR alphaMode_ ) VULKAN_HPP_NOEXCEPT - { - alphaMode = alphaMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DisplaySurfaceCreateInfoKHR & setImageExtent( VULKAN_HPP_NAMESPACE::Extent2D const & imageExtent_ ) VULKAN_HPP_NOEXCEPT - { - imageExtent = imageExtent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDisplaySurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDisplaySurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, displayMode, planeIndex, planeStackIndex, transform, globalAlpha, alphaMode, imageExtent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DisplaySurfaceCreateInfoKHR const & ) const = default; -#else - bool operator==( DisplaySurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( displayMode == rhs.displayMode ) && - ( planeIndex == rhs.planeIndex ) && ( planeStackIndex == rhs.planeStackIndex ) && ( transform == rhs.transform ) && - ( globalAlpha == rhs.globalAlpha ) && ( alphaMode == rhs.alphaMode ) && ( imageExtent == rhs.imageExtent ); -# endif - } - - bool operator!=( DisplaySurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDisplaySurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DisplaySurfaceCreateFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::DisplayModeKHR displayMode = {}; - uint32_t planeIndex = {}; - uint32_t planeStackIndex = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - float globalAlpha = {}; - VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagBitsKHR alphaMode = VULKAN_HPP_NAMESPACE::DisplayPlaneAlphaFlagBitsKHR::eOpaque; - VULKAN_HPP_NAMESPACE::Extent2D imageExtent = {}; - }; - - template <> - struct CppType - { - using Type = DisplaySurfaceCreateInfoKHR; - }; - - struct DrawIndexedIndirectCommand - { - using NativeType = VkDrawIndexedIndirectCommand; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrawIndexedIndirectCommand( uint32_t indexCount_ = {}, - uint32_t instanceCount_ = {}, - uint32_t firstIndex_ = {}, - int32_t vertexOffset_ = {}, - uint32_t firstInstance_ = {} ) VULKAN_HPP_NOEXCEPT - : indexCount( indexCount_ ) - , instanceCount( instanceCount_ ) - , firstIndex( firstIndex_ ) - , vertexOffset( vertexOffset_ ) - , firstInstance( firstInstance_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrawIndexedIndirectCommand( DrawIndexedIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawIndexedIndirectCommand( VkDrawIndexedIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT - : DrawIndexedIndirectCommand( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrawIndexedIndirectCommand & operator=( DrawIndexedIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawIndexedIndirectCommand & operator=( VkDrawIndexedIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DrawIndexedIndirectCommand & setIndexCount( uint32_t indexCount_ ) VULKAN_HPP_NOEXCEPT - { - indexCount = indexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndexedIndirectCommand & setInstanceCount( uint32_t instanceCount_ ) VULKAN_HPP_NOEXCEPT - { - instanceCount = instanceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndexedIndirectCommand & setFirstIndex( uint32_t firstIndex_ ) VULKAN_HPP_NOEXCEPT - { - firstIndex = firstIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndexedIndirectCommand & setVertexOffset( int32_t vertexOffset_ ) VULKAN_HPP_NOEXCEPT - { - vertexOffset = vertexOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndexedIndirectCommand & setFirstInstance( uint32_t firstInstance_ ) VULKAN_HPP_NOEXCEPT - { - firstInstance = firstInstance_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDrawIndexedIndirectCommand const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrawIndexedIndirectCommand &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( indexCount, instanceCount, firstIndex, vertexOffset, firstInstance ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrawIndexedIndirectCommand const & ) const = default; -#else - bool operator==( DrawIndexedIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( indexCount == rhs.indexCount ) && ( instanceCount == rhs.instanceCount ) && ( firstIndex == rhs.firstIndex ) && - ( vertexOffset == rhs.vertexOffset ) && ( firstInstance == rhs.firstInstance ); -# endif - } - - bool operator!=( DrawIndexedIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t indexCount = {}; - uint32_t instanceCount = {}; - uint32_t firstIndex = {}; - int32_t vertexOffset = {}; - uint32_t firstInstance = {}; - }; - - struct DrawIndirectCommand - { - using NativeType = VkDrawIndirectCommand; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrawIndirectCommand( uint32_t vertexCount_ = {}, - uint32_t instanceCount_ = {}, - uint32_t firstVertex_ = {}, - uint32_t firstInstance_ = {} ) VULKAN_HPP_NOEXCEPT - : vertexCount( vertexCount_ ) - , instanceCount( instanceCount_ ) - , firstVertex( firstVertex_ ) - , firstInstance( firstInstance_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrawIndirectCommand( DrawIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawIndirectCommand( VkDrawIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT : DrawIndirectCommand( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrawIndirectCommand & operator=( DrawIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawIndirectCommand & operator=( VkDrawIndirectCommand const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DrawIndirectCommand & setVertexCount( uint32_t vertexCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexCount = vertexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndirectCommand & setInstanceCount( uint32_t instanceCount_ ) VULKAN_HPP_NOEXCEPT - { - instanceCount = instanceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndirectCommand & setFirstVertex( uint32_t firstVertex_ ) VULKAN_HPP_NOEXCEPT - { - firstVertex = firstVertex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawIndirectCommand & setFirstInstance( uint32_t firstInstance_ ) VULKAN_HPP_NOEXCEPT - { - firstInstance = firstInstance_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDrawIndirectCommand const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrawIndirectCommand &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( vertexCount, instanceCount, firstVertex, firstInstance ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrawIndirectCommand const & ) const = default; -#else - bool operator==( DrawIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( vertexCount == rhs.vertexCount ) && ( instanceCount == rhs.instanceCount ) && ( firstVertex == rhs.firstVertex ) && - ( firstInstance == rhs.firstInstance ); -# endif - } - - bool operator!=( DrawIndirectCommand const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t vertexCount = {}; - uint32_t instanceCount = {}; - uint32_t firstVertex = {}; - uint32_t firstInstance = {}; - }; - - struct DrawMeshTasksIndirectCommandEXT - { - using NativeType = VkDrawMeshTasksIndirectCommandEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - DrawMeshTasksIndirectCommandEXT( uint32_t groupCountX_ = {}, uint32_t groupCountY_ = {}, uint32_t groupCountZ_ = {} ) VULKAN_HPP_NOEXCEPT - : groupCountX( groupCountX_ ) - , groupCountY( groupCountY_ ) - , groupCountZ( groupCountZ_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrawMeshTasksIndirectCommandEXT( DrawMeshTasksIndirectCommandEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawMeshTasksIndirectCommandEXT( VkDrawMeshTasksIndirectCommandEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DrawMeshTasksIndirectCommandEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrawMeshTasksIndirectCommandEXT & operator=( DrawMeshTasksIndirectCommandEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawMeshTasksIndirectCommandEXT & operator=( VkDrawMeshTasksIndirectCommandEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DrawMeshTasksIndirectCommandEXT & setGroupCountX( uint32_t groupCountX_ ) VULKAN_HPP_NOEXCEPT - { - groupCountX = groupCountX_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawMeshTasksIndirectCommandEXT & setGroupCountY( uint32_t groupCountY_ ) VULKAN_HPP_NOEXCEPT - { - groupCountY = groupCountY_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawMeshTasksIndirectCommandEXT & setGroupCountZ( uint32_t groupCountZ_ ) VULKAN_HPP_NOEXCEPT - { - groupCountZ = groupCountZ_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDrawMeshTasksIndirectCommandEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrawMeshTasksIndirectCommandEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( groupCountX, groupCountY, groupCountZ ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrawMeshTasksIndirectCommandEXT const & ) const = default; -#else - bool operator==( DrawMeshTasksIndirectCommandEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( groupCountX == rhs.groupCountX ) && ( groupCountY == rhs.groupCountY ) && ( groupCountZ == rhs.groupCountZ ); -# endif - } - - bool operator!=( DrawMeshTasksIndirectCommandEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t groupCountX = {}; - uint32_t groupCountY = {}; - uint32_t groupCountZ = {}; - }; - - struct DrawMeshTasksIndirectCommandNV - { - using NativeType = VkDrawMeshTasksIndirectCommandNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrawMeshTasksIndirectCommandNV( uint32_t taskCount_ = {}, uint32_t firstTask_ = {} ) VULKAN_HPP_NOEXCEPT - : taskCount( taskCount_ ) - , firstTask( firstTask_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrawMeshTasksIndirectCommandNV( DrawMeshTasksIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawMeshTasksIndirectCommandNV( VkDrawMeshTasksIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - : DrawMeshTasksIndirectCommandNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrawMeshTasksIndirectCommandNV & operator=( DrawMeshTasksIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrawMeshTasksIndirectCommandNV & operator=( VkDrawMeshTasksIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 DrawMeshTasksIndirectCommandNV & setTaskCount( uint32_t taskCount_ ) VULKAN_HPP_NOEXCEPT - { - taskCount = taskCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 DrawMeshTasksIndirectCommandNV & setFirstTask( uint32_t firstTask_ ) VULKAN_HPP_NOEXCEPT - { - firstTask = firstTask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkDrawMeshTasksIndirectCommandNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrawMeshTasksIndirectCommandNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( taskCount, firstTask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrawMeshTasksIndirectCommandNV const & ) const = default; -#else - bool operator==( DrawMeshTasksIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( taskCount == rhs.taskCount ) && ( firstTask == rhs.firstTask ); -# endif - } - - bool operator!=( DrawMeshTasksIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t taskCount = {}; - uint32_t firstTask = {}; - }; - - struct DrmFormatModifierProperties2EXT - { - using NativeType = VkDrmFormatModifierProperties2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrmFormatModifierProperties2EXT( uint64_t drmFormatModifier_ = {}, - uint32_t drmFormatModifierPlaneCount_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 drmFormatModifierTilingFeatures_ = {} ) VULKAN_HPP_NOEXCEPT - : drmFormatModifier( drmFormatModifier_ ) - , drmFormatModifierPlaneCount( drmFormatModifierPlaneCount_ ) - , drmFormatModifierTilingFeatures( drmFormatModifierTilingFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrmFormatModifierProperties2EXT( DrmFormatModifierProperties2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierProperties2EXT( VkDrmFormatModifierProperties2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DrmFormatModifierProperties2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrmFormatModifierProperties2EXT & operator=( DrmFormatModifierProperties2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierProperties2EXT & operator=( VkDrmFormatModifierProperties2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDrmFormatModifierProperties2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrmFormatModifierProperties2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( drmFormatModifier, drmFormatModifierPlaneCount, drmFormatModifierTilingFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrmFormatModifierProperties2EXT const & ) const = default; -#else - bool operator==( DrmFormatModifierProperties2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( drmFormatModifier == rhs.drmFormatModifier ) && ( drmFormatModifierPlaneCount == rhs.drmFormatModifierPlaneCount ) && - ( drmFormatModifierTilingFeatures == rhs.drmFormatModifierTilingFeatures ); -# endif - } - - bool operator!=( DrmFormatModifierProperties2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint64_t drmFormatModifier = {}; - uint32_t drmFormatModifierPlaneCount = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 drmFormatModifierTilingFeatures = {}; - }; - - struct DrmFormatModifierPropertiesEXT - { - using NativeType = VkDrmFormatModifierPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesEXT( uint64_t drmFormatModifier_ = {}, - uint32_t drmFormatModifierPlaneCount_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags drmFormatModifierTilingFeatures_ = {} ) VULKAN_HPP_NOEXCEPT - : drmFormatModifier( drmFormatModifier_ ) - , drmFormatModifierPlaneCount( drmFormatModifierPlaneCount_ ) - , drmFormatModifierTilingFeatures( drmFormatModifierTilingFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesEXT( DrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesEXT( VkDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DrmFormatModifierPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrmFormatModifierPropertiesEXT & operator=( DrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesEXT & operator=( VkDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDrmFormatModifierPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrmFormatModifierPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( drmFormatModifier, drmFormatModifierPlaneCount, drmFormatModifierTilingFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrmFormatModifierPropertiesEXT const & ) const = default; -#else - bool operator==( DrmFormatModifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( drmFormatModifier == rhs.drmFormatModifier ) && ( drmFormatModifierPlaneCount == rhs.drmFormatModifierPlaneCount ) && - ( drmFormatModifierTilingFeatures == rhs.drmFormatModifierTilingFeatures ); -# endif - } - - bool operator!=( DrmFormatModifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint64_t drmFormatModifier = {}; - uint32_t drmFormatModifierPlaneCount = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags drmFormatModifierTilingFeatures = {}; - }; - - struct DrmFormatModifierPropertiesList2EXT - { - using NativeType = VkDrmFormatModifierPropertiesList2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDrmFormatModifierPropertiesList2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesList2EXT( uint32_t drmFormatModifierCount_ = {}, - VULKAN_HPP_NAMESPACE::DrmFormatModifierProperties2EXT * pDrmFormatModifierProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifierCount( drmFormatModifierCount_ ) - , pDrmFormatModifierProperties( pDrmFormatModifierProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesList2EXT( DrmFormatModifierPropertiesList2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesList2EXT( VkDrmFormatModifierPropertiesList2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DrmFormatModifierPropertiesList2EXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DrmFormatModifierPropertiesList2EXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & drmFormatModifierProperties_, - void * pNext_ = nullptr ) - : pNext( pNext_ ) - , drmFormatModifierCount( static_cast( drmFormatModifierProperties_.size() ) ) - , pDrmFormatModifierProperties( drmFormatModifierProperties_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrmFormatModifierPropertiesList2EXT & operator=( DrmFormatModifierPropertiesList2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesList2EXT & operator=( VkDrmFormatModifierPropertiesList2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDrmFormatModifierPropertiesList2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrmFormatModifierPropertiesList2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifierCount, pDrmFormatModifierProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrmFormatModifierPropertiesList2EXT const & ) const = default; -#else - bool operator==( DrmFormatModifierPropertiesList2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifierCount == rhs.drmFormatModifierCount ) && - ( pDrmFormatModifierProperties == rhs.pDrmFormatModifierProperties ); -# endif - } - - bool operator!=( DrmFormatModifierPropertiesList2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDrmFormatModifierPropertiesList2EXT; - void * pNext = {}; - uint32_t drmFormatModifierCount = {}; - VULKAN_HPP_NAMESPACE::DrmFormatModifierProperties2EXT * pDrmFormatModifierProperties = {}; - }; - - template <> - struct CppType - { - using Type = DrmFormatModifierPropertiesList2EXT; - }; - - struct DrmFormatModifierPropertiesListEXT - { - using NativeType = VkDrmFormatModifierPropertiesListEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eDrmFormatModifierPropertiesListEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesListEXT( uint32_t drmFormatModifierCount_ = {}, - VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesEXT * pDrmFormatModifierProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifierCount( drmFormatModifierCount_ ) - , pDrmFormatModifierProperties( pDrmFormatModifierProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR DrmFormatModifierPropertiesListEXT( DrmFormatModifierPropertiesListEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesListEXT( VkDrmFormatModifierPropertiesListEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : DrmFormatModifierPropertiesListEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - DrmFormatModifierPropertiesListEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & drmFormatModifierProperties_, - void * pNext_ = nullptr ) - : pNext( pNext_ ) - , drmFormatModifierCount( static_cast( drmFormatModifierProperties_.size() ) ) - , pDrmFormatModifierProperties( drmFormatModifierProperties_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - DrmFormatModifierPropertiesListEXT & operator=( DrmFormatModifierPropertiesListEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - DrmFormatModifierPropertiesListEXT & operator=( VkDrmFormatModifierPropertiesListEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkDrmFormatModifierPropertiesListEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkDrmFormatModifierPropertiesListEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifierCount, pDrmFormatModifierProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( DrmFormatModifierPropertiesListEXT const & ) const = default; -#else - bool operator==( DrmFormatModifierPropertiesListEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifierCount == rhs.drmFormatModifierCount ) && - ( pDrmFormatModifierProperties == rhs.pDrmFormatModifierProperties ); -# endif - } - - bool operator!=( DrmFormatModifierPropertiesListEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eDrmFormatModifierPropertiesListEXT; - void * pNext = {}; - uint32_t drmFormatModifierCount = {}; - VULKAN_HPP_NAMESPACE::DrmFormatModifierPropertiesEXT * pDrmFormatModifierProperties = {}; - }; - - template <> - struct CppType - { - using Type = DrmFormatModifierPropertiesListEXT; - }; - - struct EventCreateInfo - { - using NativeType = VkEventCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eEventCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR EventCreateInfo( VULKAN_HPP_NAMESPACE::EventCreateFlags flags_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR EventCreateInfo( EventCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - EventCreateInfo( VkEventCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : EventCreateInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - EventCreateInfo & operator=( EventCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - EventCreateInfo & operator=( VkEventCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 EventCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 EventCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::EventCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkEventCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkEventCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( EventCreateInfo const & ) const = default; -#else - bool operator==( EventCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( EventCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eEventCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::EventCreateFlags flags = {}; - }; - - template <> - struct CppType - { - using Type = EventCreateInfo; - }; - - struct ExportFenceCreateInfo - { - using NativeType = VkExportFenceCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportFenceCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportFenceCreateInfo( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportFenceCreateInfo( ExportFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportFenceCreateInfo( VkExportFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportFenceCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportFenceCreateInfo & operator=( ExportFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportFenceCreateInfo & operator=( VkExportFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportFenceCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportFenceCreateInfo & setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportFenceCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportFenceCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportFenceCreateInfo const & ) const = default; -#else - bool operator==( ExportFenceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExportFenceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportFenceCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExportFenceCreateInfo; - }; - using ExportFenceCreateInfoKHR = ExportFenceCreateInfo; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ExportFenceWin32HandleInfoKHR - { - using NativeType = VkExportFenceWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportFenceWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportFenceWin32HandleInfoKHR( const SECURITY_ATTRIBUTES * pAttributes_ = {}, - DWORD dwAccess_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportFenceWin32HandleInfoKHR( ExportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportFenceWin32HandleInfoKHR( VkExportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportFenceWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportFenceWin32HandleInfoKHR & operator=( ExportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportFenceWin32HandleInfoKHR & operator=( VkExportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportFenceWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportFenceWin32HandleInfoKHR & setPAttributes( const SECURITY_ATTRIBUTES * pAttributes_ ) VULKAN_HPP_NOEXCEPT - { - pAttributes = pAttributes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportFenceWin32HandleInfoKHR & setDwAccess( DWORD dwAccess_ ) VULKAN_HPP_NOEXCEPT - { - dwAccess = dwAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportFenceWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportFenceWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportFenceWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pAttributes, dwAccess, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportFenceWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ExportFenceWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pAttributes == rhs.pAttributes ) && ( dwAccess == rhs.dwAccess ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ExportFenceWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportFenceWin32HandleInfoKHR; - const void * pNext = {}; - const SECURITY_ATTRIBUTES * pAttributes = {}; - DWORD dwAccess = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ExportFenceWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct ExportMemoryAllocateInfo - { - using NativeType = VkExportMemoryAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMemoryAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMemoryAllocateInfo( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMemoryAllocateInfo( ExportMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryAllocateInfo( VkExportMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMemoryAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMemoryAllocateInfo & operator=( ExportMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryAllocateInfo & operator=( VkExportMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMemoryAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryAllocateInfo & setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMemoryAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMemoryAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMemoryAllocateInfo const & ) const = default; -#else - bool operator==( ExportMemoryAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExportMemoryAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMemoryAllocateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExportMemoryAllocateInfo; - }; - using ExportMemoryAllocateInfoKHR = ExportMemoryAllocateInfo; - - struct ExportMemoryAllocateInfoNV - { - using NativeType = VkExportMemoryAllocateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMemoryAllocateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMemoryAllocateInfoNV( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMemoryAllocateInfoNV( ExportMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryAllocateInfoNV( VkExportMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMemoryAllocateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMemoryAllocateInfoNV & operator=( ExportMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryAllocateInfoNV & operator=( VkExportMemoryAllocateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMemoryAllocateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryAllocateInfoNV & - setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMemoryAllocateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMemoryAllocateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMemoryAllocateInfoNV const & ) const = default; -#else - bool operator==( ExportMemoryAllocateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExportMemoryAllocateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMemoryAllocateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExportMemoryAllocateInfoNV; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ExportMemoryWin32HandleInfoKHR - { - using NativeType = VkExportMemoryWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMemoryWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMemoryWin32HandleInfoKHR( const SECURITY_ATTRIBUTES * pAttributes_ = {}, - DWORD dwAccess_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMemoryWin32HandleInfoKHR( ExportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryWin32HandleInfoKHR( VkExportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMemoryWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMemoryWin32HandleInfoKHR & operator=( ExportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryWin32HandleInfoKHR & operator=( VkExportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoKHR & setPAttributes( const SECURITY_ATTRIBUTES * pAttributes_ ) VULKAN_HPP_NOEXCEPT - { - pAttributes = pAttributes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoKHR & setDwAccess( DWORD dwAccess_ ) VULKAN_HPP_NOEXCEPT - { - dwAccess = dwAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMemoryWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMemoryWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pAttributes, dwAccess, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMemoryWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ExportMemoryWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pAttributes == rhs.pAttributes ) && ( dwAccess == rhs.dwAccess ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ExportMemoryWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMemoryWin32HandleInfoKHR; - const void * pNext = {}; - const SECURITY_ATTRIBUTES * pAttributes = {}; - DWORD dwAccess = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ExportMemoryWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ExportMemoryWin32HandleInfoNV - { - using NativeType = VkExportMemoryWin32HandleInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMemoryWin32HandleInfoNV; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ExportMemoryWin32HandleInfoNV( const SECURITY_ATTRIBUTES * pAttributes_ = {}, DWORD dwAccess_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMemoryWin32HandleInfoNV( ExportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryWin32HandleInfoNV( VkExportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMemoryWin32HandleInfoNV( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMemoryWin32HandleInfoNV & operator=( ExportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMemoryWin32HandleInfoNV & operator=( VkExportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoNV & setPAttributes( const SECURITY_ATTRIBUTES * pAttributes_ ) VULKAN_HPP_NOEXCEPT - { - pAttributes = pAttributes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMemoryWin32HandleInfoNV & setDwAccess( DWORD dwAccess_ ) VULKAN_HPP_NOEXCEPT - { - dwAccess = dwAccess_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMemoryWin32HandleInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMemoryWin32HandleInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pAttributes, dwAccess ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMemoryWin32HandleInfoNV const & ) const = default; -# else - bool operator==( ExportMemoryWin32HandleInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pAttributes == rhs.pAttributes ) && ( dwAccess == rhs.dwAccess ); -# endif - } - - bool operator!=( ExportMemoryWin32HandleInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMemoryWin32HandleInfoNV; - const void * pNext = {}; - const SECURITY_ATTRIBUTES * pAttributes = {}; - DWORD dwAccess = {}; - }; - - template <> - struct CppType - { - using Type = ExportMemoryWin32HandleInfoNV; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalBufferInfoEXT - { - using NativeType = VkExportMetalBufferInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalBufferInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalBufferInfoEXT( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - MTLBuffer_id mtlBuffer_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , mtlBuffer( mtlBuffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalBufferInfoEXT( ExportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalBufferInfoEXT( VkExportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalBufferInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalBufferInfoEXT & operator=( ExportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalBufferInfoEXT & operator=( VkExportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalBufferInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalBufferInfoEXT & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalBufferInfoEXT & setMtlBuffer( MTLBuffer_id mtlBuffer_ ) VULKAN_HPP_NOEXCEPT - { - mtlBuffer = mtlBuffer_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalBufferInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalBufferInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, mtlBuffer ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalBufferInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalBufferInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( mtlBuffer == rhs.mtlBuffer ); -# endif - } - - bool operator!=( ExportMetalBufferInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalBufferInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - MTLBuffer_id mtlBuffer = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalBufferInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalCommandQueueInfoEXT - { - using NativeType = VkExportMetalCommandQueueInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalCommandQueueInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalCommandQueueInfoEXT( VULKAN_HPP_NAMESPACE::Queue queue_ = {}, - MTLCommandQueue_id mtlCommandQueue_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , queue( queue_ ) - , mtlCommandQueue( mtlCommandQueue_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalCommandQueueInfoEXT( ExportMetalCommandQueueInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalCommandQueueInfoEXT( VkExportMetalCommandQueueInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalCommandQueueInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalCommandQueueInfoEXT & operator=( ExportMetalCommandQueueInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalCommandQueueInfoEXT & operator=( VkExportMetalCommandQueueInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalCommandQueueInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalCommandQueueInfoEXT & setQueue( VULKAN_HPP_NAMESPACE::Queue queue_ ) VULKAN_HPP_NOEXCEPT - { - queue = queue_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalCommandQueueInfoEXT & setMtlCommandQueue( MTLCommandQueue_id mtlCommandQueue_ ) VULKAN_HPP_NOEXCEPT - { - mtlCommandQueue = mtlCommandQueue_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalCommandQueueInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalCommandQueueInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, queue, mtlCommandQueue ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalCommandQueueInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalCommandQueueInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queue == rhs.queue ) && ( mtlCommandQueue == rhs.mtlCommandQueue ); -# endif - } - - bool operator!=( ExportMetalCommandQueueInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalCommandQueueInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Queue queue = {}; - MTLCommandQueue_id mtlCommandQueue = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalCommandQueueInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalDeviceInfoEXT - { - using NativeType = VkExportMetalDeviceInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalDeviceInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalDeviceInfoEXT( MTLDevice_id mtlDevice_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mtlDevice( mtlDevice_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalDeviceInfoEXT( ExportMetalDeviceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalDeviceInfoEXT( VkExportMetalDeviceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalDeviceInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalDeviceInfoEXT & operator=( ExportMetalDeviceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalDeviceInfoEXT & operator=( VkExportMetalDeviceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalDeviceInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalDeviceInfoEXT & setMtlDevice( MTLDevice_id mtlDevice_ ) VULKAN_HPP_NOEXCEPT - { - mtlDevice = mtlDevice_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalDeviceInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalDeviceInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mtlDevice ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalDeviceInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalDeviceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mtlDevice == rhs.mtlDevice ); -# endif - } - - bool operator!=( ExportMetalDeviceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalDeviceInfoEXT; - const void * pNext = {}; - MTLDevice_id mtlDevice = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalDeviceInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalIOSurfaceInfoEXT - { - using NativeType = VkExportMetalIOSurfaceInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalIoSurfaceInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ExportMetalIOSurfaceInfoEXT( VULKAN_HPP_NAMESPACE::Image image_ = {}, IOSurfaceRef ioSurface_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - , ioSurface( ioSurface_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalIOSurfaceInfoEXT( ExportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalIOSurfaceInfoEXT( VkExportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalIOSurfaceInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalIOSurfaceInfoEXT & operator=( ExportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalIOSurfaceInfoEXT & operator=( VkExportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalIOSurfaceInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalIOSurfaceInfoEXT & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalIOSurfaceInfoEXT & setIoSurface( IOSurfaceRef ioSurface_ ) VULKAN_HPP_NOEXCEPT - { - ioSurface = ioSurface_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalIOSurfaceInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalIOSurfaceInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image, ioSurface ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalIOSurfaceInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalIOSurfaceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ) && ( ioSurface == rhs.ioSurface ); -# endif - } - - bool operator!=( ExportMetalIOSurfaceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalIoSurfaceInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - IOSurfaceRef ioSurface = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalIOSurfaceInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalObjectCreateInfoEXT - { - using NativeType = VkExportMetalObjectCreateInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalObjectCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalObjectCreateInfoEXT( - VULKAN_HPP_NAMESPACE::ExportMetalObjectTypeFlagBitsEXT exportObjectType_ = VULKAN_HPP_NAMESPACE::ExportMetalObjectTypeFlagBitsEXT::eMetalDevice, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , exportObjectType( exportObjectType_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalObjectCreateInfoEXT( ExportMetalObjectCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalObjectCreateInfoEXT( VkExportMetalObjectCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalObjectCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalObjectCreateInfoEXT & operator=( ExportMetalObjectCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalObjectCreateInfoEXT & operator=( VkExportMetalObjectCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalObjectCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalObjectCreateInfoEXT & - setExportObjectType( VULKAN_HPP_NAMESPACE::ExportMetalObjectTypeFlagBitsEXT exportObjectType_ ) VULKAN_HPP_NOEXCEPT - { - exportObjectType = exportObjectType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalObjectCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalObjectCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, exportObjectType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalObjectCreateInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalObjectCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( exportObjectType == rhs.exportObjectType ); -# endif - } - - bool operator!=( ExportMetalObjectCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalObjectCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExportMetalObjectTypeFlagBitsEXT exportObjectType = VULKAN_HPP_NAMESPACE::ExportMetalObjectTypeFlagBitsEXT::eMetalDevice; - }; - - template <> - struct CppType - { - using Type = ExportMetalObjectCreateInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalObjectsInfoEXT - { - using NativeType = VkExportMetalObjectsInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalObjectsInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalObjectsInfoEXT( const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT : pNext( pNext_ ) {} - - VULKAN_HPP_CONSTEXPR ExportMetalObjectsInfoEXT( ExportMetalObjectsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalObjectsInfoEXT( VkExportMetalObjectsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalObjectsInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalObjectsInfoEXT & operator=( ExportMetalObjectsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalObjectsInfoEXT & operator=( VkExportMetalObjectsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalObjectsInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalObjectsInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalObjectsInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalObjectsInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalObjectsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ); -# endif - } - - bool operator!=( ExportMetalObjectsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalObjectsInfoEXT; - const void * pNext = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalObjectsInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalSharedEventInfoEXT - { - using NativeType = VkExportMetalSharedEventInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalSharedEventInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalSharedEventInfoEXT( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::Event event_ = {}, - MTLSharedEvent_id mtlSharedEvent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , event( event_ ) - , mtlSharedEvent( mtlSharedEvent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalSharedEventInfoEXT( ExportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalSharedEventInfoEXT( VkExportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalSharedEventInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalSharedEventInfoEXT & operator=( ExportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalSharedEventInfoEXT & operator=( VkExportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalSharedEventInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalSharedEventInfoEXT & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalSharedEventInfoEXT & setEvent( VULKAN_HPP_NAMESPACE::Event event_ ) VULKAN_HPP_NOEXCEPT - { - event = event_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalSharedEventInfoEXT & setMtlSharedEvent( MTLSharedEvent_id mtlSharedEvent_ ) VULKAN_HPP_NOEXCEPT - { - mtlSharedEvent = mtlSharedEvent_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalSharedEventInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalSharedEventInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, event, mtlSharedEvent ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalSharedEventInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalSharedEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( event == rhs.event ) && - ( mtlSharedEvent == rhs.mtlSharedEvent ); -# endif - } - - bool operator!=( ExportMetalSharedEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalSharedEventInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::Event event = {}; - MTLSharedEvent_id mtlSharedEvent = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalSharedEventInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ExportMetalTextureInfoEXT - { - using NativeType = VkExportMetalTextureInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportMetalTextureInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportMetalTextureInfoEXT( VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::BufferView bufferView_ = {}, - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane_ = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor, - MTLTexture_id mtlTexture_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - , imageView( imageView_ ) - , bufferView( bufferView_ ) - , plane( plane_ ) - , mtlTexture( mtlTexture_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportMetalTextureInfoEXT( ExportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalTextureInfoEXT( VkExportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportMetalTextureInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportMetalTextureInfoEXT & operator=( ExportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportMetalTextureInfoEXT & operator=( VkExportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setBufferView( VULKAN_HPP_NAMESPACE::BufferView bufferView_ ) VULKAN_HPP_NOEXCEPT - { - bufferView = bufferView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setPlane( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane_ ) VULKAN_HPP_NOEXCEPT - { - plane = plane_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportMetalTextureInfoEXT & setMtlTexture( MTLTexture_id mtlTexture_ ) VULKAN_HPP_NOEXCEPT - { - mtlTexture = mtlTexture_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportMetalTextureInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportMetalTextureInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image, imageView, bufferView, plane, mtlTexture ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportMetalTextureInfoEXT const & ) const = default; -# else - bool operator==( ExportMetalTextureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ) && ( imageView == rhs.imageView ) && ( bufferView == rhs.bufferView ) && - ( plane == rhs.plane ) && ( mtlTexture == rhs.mtlTexture ); -# endif - } - - bool operator!=( ExportMetalTextureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportMetalTextureInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::BufferView bufferView = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor; - MTLTexture_id mtlTexture = {}; - }; - - template <> - struct CppType - { - using Type = ExportMetalTextureInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - struct ExportSemaphoreCreateInfo - { - using NativeType = VkExportSemaphoreCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportSemaphoreCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportSemaphoreCreateInfo( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportSemaphoreCreateInfo( ExportSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportSemaphoreCreateInfo( VkExportSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportSemaphoreCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportSemaphoreCreateInfo & operator=( ExportSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportSemaphoreCreateInfo & operator=( VkExportSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreCreateInfo & - setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportSemaphoreCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportSemaphoreCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportSemaphoreCreateInfo const & ) const = default; -#else - bool operator==( ExportSemaphoreCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExportSemaphoreCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportSemaphoreCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExportSemaphoreCreateInfo; - }; - using ExportSemaphoreCreateInfoKHR = ExportSemaphoreCreateInfo; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ExportSemaphoreWin32HandleInfoKHR - { - using NativeType = VkExportSemaphoreWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExportSemaphoreWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExportSemaphoreWin32HandleInfoKHR( const SECURITY_ATTRIBUTES * pAttributes_ = {}, - DWORD dwAccess_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pAttributes( pAttributes_ ) - , dwAccess( dwAccess_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExportSemaphoreWin32HandleInfoKHR( ExportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportSemaphoreWin32HandleInfoKHR( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ExportSemaphoreWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExportSemaphoreWin32HandleInfoKHR & operator=( ExportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExportSemaphoreWin32HandleInfoKHR & operator=( VkExportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreWin32HandleInfoKHR & setPAttributes( const SECURITY_ATTRIBUTES * pAttributes_ ) VULKAN_HPP_NOEXCEPT - { - pAttributes = pAttributes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreWin32HandleInfoKHR & setDwAccess( DWORD dwAccess_ ) VULKAN_HPP_NOEXCEPT - { - dwAccess = dwAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExportSemaphoreWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExportSemaphoreWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExportSemaphoreWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pAttributes, dwAccess, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExportSemaphoreWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ExportSemaphoreWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pAttributes == rhs.pAttributes ) && ( dwAccess == rhs.dwAccess ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ExportSemaphoreWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExportSemaphoreWin32HandleInfoKHR; - const void * pNext = {}; - const SECURITY_ATTRIBUTES * pAttributes = {}; - DWORD dwAccess = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ExportSemaphoreWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct ExtensionProperties - { - using NativeType = VkExtensionProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ExtensionProperties( std::array const & extensionName_ = {}, - uint32_t specVersion_ = {} ) VULKAN_HPP_NOEXCEPT - : extensionName( extensionName_ ) - , specVersion( specVersion_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ExtensionProperties( ExtensionProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExtensionProperties( VkExtensionProperties const & rhs ) VULKAN_HPP_NOEXCEPT : ExtensionProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExtensionProperties & operator=( ExtensionProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExtensionProperties & operator=( VkExtensionProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExtensionProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExtensionProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, uint32_t const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( extensionName, specVersion ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExtensionProperties const & ) const = default; -#else - bool operator==( ExtensionProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( extensionName == rhs.extensionName ) && ( specVersion == rhs.specVersion ); -# endif - } - - bool operator!=( ExtensionProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ArrayWrapper1D extensionName = {}; - uint32_t specVersion = {}; - }; - - struct ExternalMemoryProperties - { - using NativeType = VkExternalMemoryProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalMemoryProperties( VULKAN_HPP_NAMESPACE::ExternalMemoryFeatureFlags externalMemoryFeatures_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags exportFromImportedHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags compatibleHandleTypes_ = {} ) VULKAN_HPP_NOEXCEPT - : externalMemoryFeatures( externalMemoryFeatures_ ) - , exportFromImportedHandleTypes( exportFromImportedHandleTypes_ ) - , compatibleHandleTypes( compatibleHandleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalMemoryProperties( ExternalMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryProperties( VkExternalMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalMemoryProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalMemoryProperties & operator=( ExternalMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryProperties & operator=( VkExternalMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalMemoryProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalMemoryProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( externalMemoryFeatures, exportFromImportedHandleTypes, compatibleHandleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalMemoryProperties const & ) const = default; -#else - bool operator==( ExternalMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( externalMemoryFeatures == rhs.externalMemoryFeatures ) && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) && - ( compatibleHandleTypes == rhs.compatibleHandleTypes ); -# endif - } - - bool operator!=( ExternalMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ExternalMemoryFeatureFlags externalMemoryFeatures = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags exportFromImportedHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags compatibleHandleTypes = {}; - }; - using ExternalMemoryPropertiesKHR = ExternalMemoryProperties; - - struct ExternalBufferProperties - { - using NativeType = VkExternalBufferProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalBufferProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalBufferProperties( VULKAN_HPP_NAMESPACE::ExternalMemoryProperties externalMemoryProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , externalMemoryProperties( externalMemoryProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalBufferProperties( ExternalBufferProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalBufferProperties( VkExternalBufferProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalBufferProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalBufferProperties & operator=( ExternalBufferProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalBufferProperties & operator=( VkExternalBufferProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalBufferProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalBufferProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, externalMemoryProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalBufferProperties const & ) const = default; -#else - bool operator==( ExternalBufferProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalMemoryProperties == rhs.externalMemoryProperties ); -# endif - } - - bool operator!=( ExternalBufferProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalBufferProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryProperties externalMemoryProperties = {}; - }; - - template <> - struct CppType - { - using Type = ExternalBufferProperties; - }; - using ExternalBufferPropertiesKHR = ExternalBufferProperties; - - struct ExternalFenceProperties - { - using NativeType = VkExternalFenceProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalFenceProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalFenceProperties( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags exportFromImportedHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags compatibleHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceFeatureFlags externalFenceFeatures_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , exportFromImportedHandleTypes( exportFromImportedHandleTypes_ ) - , compatibleHandleTypes( compatibleHandleTypes_ ) - , externalFenceFeatures( externalFenceFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalFenceProperties( ExternalFenceProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalFenceProperties( VkExternalFenceProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalFenceProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalFenceProperties & operator=( ExternalFenceProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalFenceProperties & operator=( VkExternalFenceProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalFenceProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalFenceProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, exportFromImportedHandleTypes, compatibleHandleTypes, externalFenceFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalFenceProperties const & ) const = default; -#else - bool operator==( ExternalFenceProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) && - ( compatibleHandleTypes == rhs.compatibleHandleTypes ) && ( externalFenceFeatures == rhs.externalFenceFeatures ); -# endif - } - - bool operator!=( ExternalFenceProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalFenceProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags exportFromImportedHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlags compatibleHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceFeatureFlags externalFenceFeatures = {}; - }; - - template <> - struct CppType - { - using Type = ExternalFenceProperties; - }; - using ExternalFencePropertiesKHR = ExternalFenceProperties; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct ExternalFormatANDROID - { - using NativeType = VkExternalFormatANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalFormatANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalFormatANDROID( uint64_t externalFormat_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , externalFormat( externalFormat_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalFormatANDROID( ExternalFormatANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalFormatANDROID( VkExternalFormatANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalFormatANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalFormatANDROID & operator=( ExternalFormatANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalFormatANDROID & operator=( VkExternalFormatANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExternalFormatANDROID & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExternalFormatANDROID & setExternalFormat( uint64_t externalFormat_ ) VULKAN_HPP_NOEXCEPT - { - externalFormat = externalFormat_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExternalFormatANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalFormatANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, externalFormat ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalFormatANDROID const & ) const = default; -# else - bool operator==( ExternalFormatANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalFormat == rhs.externalFormat ); -# endif - } - - bool operator!=( ExternalFormatANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalFormatANDROID; - void * pNext = {}; - uint64_t externalFormat = {}; - }; - - template <> - struct CppType - { - using Type = ExternalFormatANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - struct ExternalImageFormatProperties - { - using NativeType = VkExternalImageFormatProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalImageFormatProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalImageFormatProperties( VULKAN_HPP_NAMESPACE::ExternalMemoryProperties externalMemoryProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , externalMemoryProperties( externalMemoryProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalImageFormatProperties( ExternalImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalImageFormatProperties( VkExternalImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalImageFormatProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalImageFormatProperties & operator=( ExternalImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalImageFormatProperties & operator=( VkExternalImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalImageFormatProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalImageFormatProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, externalMemoryProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalImageFormatProperties const & ) const = default; -#else - bool operator==( ExternalImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalMemoryProperties == rhs.externalMemoryProperties ); -# endif - } - - bool operator!=( ExternalImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalImageFormatProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryProperties externalMemoryProperties = {}; - }; - - template <> - struct CppType - { - using Type = ExternalImageFormatProperties; - }; - using ExternalImageFormatPropertiesKHR = ExternalImageFormatProperties; - - struct ImageFormatProperties - { - using NativeType = VkImageFormatProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageFormatProperties( VULKAN_HPP_NAMESPACE::Extent3D maxExtent_ = {}, - uint32_t maxMipLevels_ = {}, - uint32_t maxArrayLayers_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags sampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize maxResourceSize_ = {} ) VULKAN_HPP_NOEXCEPT - : maxExtent( maxExtent_ ) - , maxMipLevels( maxMipLevels_ ) - , maxArrayLayers( maxArrayLayers_ ) - , sampleCounts( sampleCounts_ ) - , maxResourceSize( maxResourceSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageFormatProperties( ImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatProperties( VkImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageFormatProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageFormatProperties & operator=( ImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatProperties & operator=( VkImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkImageFormatProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageFormatProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( maxExtent, maxMipLevels, maxArrayLayers, sampleCounts, maxResourceSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageFormatProperties const & ) const = default; -#else - bool operator==( ImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( maxExtent == rhs.maxExtent ) && ( maxMipLevels == rhs.maxMipLevels ) && ( maxArrayLayers == rhs.maxArrayLayers ) && - ( sampleCounts == rhs.sampleCounts ) && ( maxResourceSize == rhs.maxResourceSize ); -# endif - } - - bool operator!=( ImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Extent3D maxExtent = {}; - uint32_t maxMipLevels = {}; - uint32_t maxArrayLayers = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampleCounts = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxResourceSize = {}; - }; - - struct ExternalImageFormatPropertiesNV - { - using NativeType = VkExternalImageFormatPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ExternalImageFormatPropertiesNV( VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryFeatureFlagsNV externalMemoryFeatures_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV compatibleHandleTypes_ = {} ) VULKAN_HPP_NOEXCEPT - : imageFormatProperties( imageFormatProperties_ ) - , externalMemoryFeatures( externalMemoryFeatures_ ) - , exportFromImportedHandleTypes( exportFromImportedHandleTypes_ ) - , compatibleHandleTypes( compatibleHandleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalImageFormatPropertiesNV( ExternalImageFormatPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalImageFormatPropertiesNV( VkExternalImageFormatPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalImageFormatPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalImageFormatPropertiesNV & operator=( ExternalImageFormatPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalImageFormatPropertiesNV & operator=( VkExternalImageFormatPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalImageFormatPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalImageFormatPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( imageFormatProperties, externalMemoryFeatures, exportFromImportedHandleTypes, compatibleHandleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalImageFormatPropertiesNV const & ) const = default; -#else - bool operator==( ExternalImageFormatPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( imageFormatProperties == rhs.imageFormatProperties ) && ( externalMemoryFeatures == rhs.externalMemoryFeatures ) && - ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) && ( compatibleHandleTypes == rhs.compatibleHandleTypes ); -# endif - } - - bool operator!=( ExternalImageFormatPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryFeatureFlagsNV externalMemoryFeatures = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV compatibleHandleTypes = {}; - }; - - struct ExternalMemoryBufferCreateInfo - { - using NativeType = VkExternalMemoryBufferCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalMemoryBufferCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalMemoryBufferCreateInfo( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalMemoryBufferCreateInfo( ExternalMemoryBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryBufferCreateInfo( VkExternalMemoryBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalMemoryBufferCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalMemoryBufferCreateInfo & operator=( ExternalMemoryBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryBufferCreateInfo & operator=( VkExternalMemoryBufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryBufferCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryBufferCreateInfo & - setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExternalMemoryBufferCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalMemoryBufferCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalMemoryBufferCreateInfo const & ) const = default; -#else - bool operator==( ExternalMemoryBufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExternalMemoryBufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalMemoryBufferCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExternalMemoryBufferCreateInfo; - }; - using ExternalMemoryBufferCreateInfoKHR = ExternalMemoryBufferCreateInfo; - - struct ExternalMemoryImageCreateInfo - { - using NativeType = VkExternalMemoryImageCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalMemoryImageCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalMemoryImageCreateInfo( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalMemoryImageCreateInfo( ExternalMemoryImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryImageCreateInfo( VkExternalMemoryImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalMemoryImageCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalMemoryImageCreateInfo & operator=( ExternalMemoryImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryImageCreateInfo & operator=( VkExternalMemoryImageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryImageCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryImageCreateInfo & - setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExternalMemoryImageCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalMemoryImageCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalMemoryImageCreateInfo const & ) const = default; -#else - bool operator==( ExternalMemoryImageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExternalMemoryImageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalMemoryImageCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlags handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExternalMemoryImageCreateInfo; - }; - using ExternalMemoryImageCreateInfoKHR = ExternalMemoryImageCreateInfo; - - struct ExternalMemoryImageCreateInfoNV - { - using NativeType = VkExternalMemoryImageCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalMemoryImageCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalMemoryImageCreateInfoNV( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleTypes( handleTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalMemoryImageCreateInfoNV( ExternalMemoryImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryImageCreateInfoNV( VkExternalMemoryImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalMemoryImageCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalMemoryImageCreateInfoNV & operator=( ExternalMemoryImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalMemoryImageCreateInfoNV & operator=( VkExternalMemoryImageCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryImageCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ExternalMemoryImageCreateInfoNV & - setHandleTypes( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes_ ) VULKAN_HPP_NOEXCEPT - { - handleTypes = handleTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkExternalMemoryImageCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalMemoryImageCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalMemoryImageCreateInfoNV const & ) const = default; -#else - bool operator==( ExternalMemoryImageCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleTypes == rhs.handleTypes ); -# endif - } - - bool operator!=( ExternalMemoryImageCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalMemoryImageCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleTypes = {}; - }; - - template <> - struct CppType - { - using Type = ExternalMemoryImageCreateInfoNV; - }; - - struct ExternalSemaphoreProperties - { - using NativeType = VkExternalSemaphoreProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eExternalSemaphoreProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ExternalSemaphoreProperties( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags compatibleHandleTypes_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreFeatureFlags externalSemaphoreFeatures_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , exportFromImportedHandleTypes( exportFromImportedHandleTypes_ ) - , compatibleHandleTypes( compatibleHandleTypes_ ) - , externalSemaphoreFeatures( externalSemaphoreFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR ExternalSemaphoreProperties( ExternalSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalSemaphoreProperties( VkExternalSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : ExternalSemaphoreProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ExternalSemaphoreProperties & operator=( ExternalSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ExternalSemaphoreProperties & operator=( VkExternalSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkExternalSemaphoreProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkExternalSemaphoreProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, exportFromImportedHandleTypes, compatibleHandleTypes, externalSemaphoreFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ExternalSemaphoreProperties const & ) const = default; -#else - bool operator==( ExternalSemaphoreProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( exportFromImportedHandleTypes == rhs.exportFromImportedHandleTypes ) && - ( compatibleHandleTypes == rhs.compatibleHandleTypes ) && ( externalSemaphoreFeatures == rhs.externalSemaphoreFeatures ); -# endif - } - - bool operator!=( ExternalSemaphoreProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eExternalSemaphoreProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlags compatibleHandleTypes = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreFeatureFlags externalSemaphoreFeatures = {}; - }; - - template <> - struct CppType - { - using Type = ExternalSemaphoreProperties; - }; - using ExternalSemaphorePropertiesKHR = ExternalSemaphoreProperties; - - struct FenceCreateInfo - { - using NativeType = VkFenceCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFenceCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FenceCreateInfo( VULKAN_HPP_NAMESPACE::FenceCreateFlags flags_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR FenceCreateInfo( FenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceCreateInfo( VkFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : FenceCreateInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FenceCreateInfo & operator=( FenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceCreateInfo & operator=( VkFenceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FenceCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FenceCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::FenceCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFenceCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFenceCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FenceCreateInfo const & ) const = default; -#else - bool operator==( FenceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( FenceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFenceCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::FenceCreateFlags flags = {}; - }; - - template <> - struct CppType - { - using Type = FenceCreateInfo; - }; - - struct FenceGetFdInfoKHR - { - using NativeType = VkFenceGetFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFenceGetFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - FenceGetFdInfoKHR( VULKAN_HPP_NAMESPACE::Fence fence_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fence( fence_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR FenceGetFdInfoKHR( FenceGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceGetFdInfoKHR( VkFenceGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : FenceGetFdInfoKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FenceGetFdInfoKHR & operator=( FenceGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceGetFdInfoKHR & operator=( VkFenceGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FenceGetFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FenceGetFdInfoKHR & setFence( VULKAN_HPP_NAMESPACE::Fence fence_ ) VULKAN_HPP_NOEXCEPT - { - fence = fence_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FenceGetFdInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFenceGetFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFenceGetFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fence, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FenceGetFdInfoKHR const & ) const = default; -#else - bool operator==( FenceGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fence == rhs.fence ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( FenceGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFenceGetFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Fence fence = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = FenceGetFdInfoKHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct FenceGetWin32HandleInfoKHR - { - using NativeType = VkFenceGetWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFenceGetWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FenceGetWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::Fence fence_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fence( fence_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR FenceGetWin32HandleInfoKHR( FenceGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceGetWin32HandleInfoKHR( VkFenceGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : FenceGetWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FenceGetWin32HandleInfoKHR & operator=( FenceGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FenceGetWin32HandleInfoKHR & operator=( VkFenceGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FenceGetWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FenceGetWin32HandleInfoKHR & setFence( VULKAN_HPP_NAMESPACE::Fence fence_ ) VULKAN_HPP_NOEXCEPT - { - fence = fence_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FenceGetWin32HandleInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFenceGetWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFenceGetWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fence, handleType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FenceGetWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( FenceGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fence == rhs.fence ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( FenceGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFenceGetWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Fence fence = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = FenceGetWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct FilterCubicImageViewImageFormatPropertiesEXT - { - using NativeType = VkFilterCubicImageViewImageFormatPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFilterCubicImageViewImageFormatPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FilterCubicImageViewImageFormatPropertiesEXT( VULKAN_HPP_NAMESPACE::Bool32 filterCubic_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 filterCubicMinmax_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , filterCubic( filterCubic_ ) - , filterCubicMinmax( filterCubicMinmax_ ) - { - } - - VULKAN_HPP_CONSTEXPR FilterCubicImageViewImageFormatPropertiesEXT( FilterCubicImageViewImageFormatPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FilterCubicImageViewImageFormatPropertiesEXT( VkFilterCubicImageViewImageFormatPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : FilterCubicImageViewImageFormatPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FilterCubicImageViewImageFormatPropertiesEXT & operator=( FilterCubicImageViewImageFormatPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FilterCubicImageViewImageFormatPropertiesEXT & operator=( VkFilterCubicImageViewImageFormatPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkFilterCubicImageViewImageFormatPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFilterCubicImageViewImageFormatPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, filterCubic, filterCubicMinmax ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FilterCubicImageViewImageFormatPropertiesEXT const & ) const = default; -#else - bool operator==( FilterCubicImageViewImageFormatPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( filterCubic == rhs.filterCubic ) && ( filterCubicMinmax == rhs.filterCubicMinmax ); -# endif - } - - bool operator!=( FilterCubicImageViewImageFormatPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFilterCubicImageViewImageFormatPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterCubic = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterCubicMinmax = {}; - }; - - template <> - struct CppType - { - using Type = FilterCubicImageViewImageFormatPropertiesEXT; - }; - - struct FormatProperties - { - using NativeType = VkFormatProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FormatProperties( VULKAN_HPP_NAMESPACE::FormatFeatureFlags linearTilingFeatures_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags optimalTilingFeatures_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags bufferFeatures_ = {} ) VULKAN_HPP_NOEXCEPT - : linearTilingFeatures( linearTilingFeatures_ ) - , optimalTilingFeatures( optimalTilingFeatures_ ) - , bufferFeatures( bufferFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR FormatProperties( FormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties( VkFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT : FormatProperties( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FormatProperties & operator=( FormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties & operator=( VkFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkFormatProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFormatProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( linearTilingFeatures, optimalTilingFeatures, bufferFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FormatProperties const & ) const = default; -#else - bool operator==( FormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( linearTilingFeatures == rhs.linearTilingFeatures ) && ( optimalTilingFeatures == rhs.optimalTilingFeatures ) && - ( bufferFeatures == rhs.bufferFeatures ); -# endif - } - - bool operator!=( FormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::FormatFeatureFlags linearTilingFeatures = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags optimalTilingFeatures = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags bufferFeatures = {}; - }; - - struct FormatProperties2 - { - using NativeType = VkFormatProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFormatProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FormatProperties2( VULKAN_HPP_NAMESPACE::FormatProperties formatProperties_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , formatProperties( formatProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR FormatProperties2( FormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties2( VkFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT : FormatProperties2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FormatProperties2 & operator=( FormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties2 & operator=( VkFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkFormatProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFormatProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, formatProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FormatProperties2 const & ) const = default; -#else - bool operator==( FormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( formatProperties == rhs.formatProperties ); -# endif - } - - bool operator!=( FormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFormatProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::FormatProperties formatProperties = {}; - }; - - template <> - struct CppType - { - using Type = FormatProperties2; - }; - using FormatProperties2KHR = FormatProperties2; - - struct FormatProperties3 - { - using NativeType = VkFormatProperties3; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFormatProperties3; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FormatProperties3( VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 linearTilingFeatures_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 optimalTilingFeatures_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 bufferFeatures_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , linearTilingFeatures( linearTilingFeatures_ ) - , optimalTilingFeatures( optimalTilingFeatures_ ) - , bufferFeatures( bufferFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR FormatProperties3( FormatProperties3 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties3( VkFormatProperties3 const & rhs ) VULKAN_HPP_NOEXCEPT : FormatProperties3( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FormatProperties3 & operator=( FormatProperties3 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FormatProperties3 & operator=( VkFormatProperties3 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkFormatProperties3 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFormatProperties3 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, linearTilingFeatures, optimalTilingFeatures, bufferFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FormatProperties3 const & ) const = default; -#else - bool operator==( FormatProperties3 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( linearTilingFeatures == rhs.linearTilingFeatures ) && - ( optimalTilingFeatures == rhs.optimalTilingFeatures ) && ( bufferFeatures == rhs.bufferFeatures ); -# endif - } - - bool operator!=( FormatProperties3 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFormatProperties3; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 linearTilingFeatures = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 optimalTilingFeatures = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags2 bufferFeatures = {}; - }; - - template <> - struct CppType - { - using Type = FormatProperties3; - }; - using FormatProperties3KHR = FormatProperties3; - - struct FragmentShadingRateAttachmentInfoKHR - { - using NativeType = VkFragmentShadingRateAttachmentInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFragmentShadingRateAttachmentInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FragmentShadingRateAttachmentInfoKHR( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pFragmentShadingRateAttachment_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D shadingRateAttachmentTexelSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pFragmentShadingRateAttachment( pFragmentShadingRateAttachment_ ) - , shadingRateAttachmentTexelSize( shadingRateAttachmentTexelSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR FragmentShadingRateAttachmentInfoKHR( FragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FragmentShadingRateAttachmentInfoKHR( VkFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : FragmentShadingRateAttachmentInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FragmentShadingRateAttachmentInfoKHR & operator=( FragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FragmentShadingRateAttachmentInfoKHR & operator=( VkFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FragmentShadingRateAttachmentInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FragmentShadingRateAttachmentInfoKHR & - setPFragmentShadingRateAttachment( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pFragmentShadingRateAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pFragmentShadingRateAttachment = pFragmentShadingRateAttachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FragmentShadingRateAttachmentInfoKHR & - setShadingRateAttachmentTexelSize( VULKAN_HPP_NAMESPACE::Extent2D const & shadingRateAttachmentTexelSize_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateAttachmentTexelSize = shadingRateAttachmentTexelSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFragmentShadingRateAttachmentInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFragmentShadingRateAttachmentInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pFragmentShadingRateAttachment, shadingRateAttachmentTexelSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FragmentShadingRateAttachmentInfoKHR const & ) const = default; -#else - bool operator==( FragmentShadingRateAttachmentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pFragmentShadingRateAttachment == rhs.pFragmentShadingRateAttachment ) && - ( shadingRateAttachmentTexelSize == rhs.shadingRateAttachmentTexelSize ); -# endif - } - - bool operator!=( FragmentShadingRateAttachmentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFragmentShadingRateAttachmentInfoKHR; - const void * pNext = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pFragmentShadingRateAttachment = {}; - VULKAN_HPP_NAMESPACE::Extent2D shadingRateAttachmentTexelSize = {}; - }; - - template <> - struct CppType - { - using Type = FragmentShadingRateAttachmentInfoKHR; - }; - - struct FramebufferAttachmentImageInfo - { - using NativeType = VkFramebufferAttachmentImageInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFramebufferAttachmentImageInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FramebufferAttachmentImageInfo( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ = {}, - uint32_t width_ = {}, - uint32_t height_ = {}, - uint32_t layerCount_ = {}, - uint32_t viewFormatCount_ = {}, - const VULKAN_HPP_NAMESPACE::Format * pViewFormats_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , usage( usage_ ) - , width( width_ ) - , height( height_ ) - , layerCount( layerCount_ ) - , viewFormatCount( viewFormatCount_ ) - , pViewFormats( pViewFormats_ ) - { - } - - VULKAN_HPP_CONSTEXPR FramebufferAttachmentImageInfo( FramebufferAttachmentImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferAttachmentImageInfo( VkFramebufferAttachmentImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : FramebufferAttachmentImageInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferAttachmentImageInfo( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_, - uint32_t width_, - uint32_t height_, - uint32_t layerCount_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewFormats_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , usage( usage_ ) - , width( width_ ) - , height( height_ ) - , layerCount( layerCount_ ) - , viewFormatCount( static_cast( viewFormats_.size() ) ) - , pViewFormats( viewFormats_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FramebufferAttachmentImageInfo & operator=( FramebufferAttachmentImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferAttachmentImageInfo & operator=( VkFramebufferAttachmentImageInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setFlags( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setLayerCount( uint32_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setViewFormatCount( uint32_t viewFormatCount_ ) VULKAN_HPP_NOEXCEPT - { - viewFormatCount = viewFormatCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentImageInfo & setPViewFormats( const VULKAN_HPP_NAMESPACE::Format * pViewFormats_ ) VULKAN_HPP_NOEXCEPT - { - pViewFormats = pViewFormats_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferAttachmentImageInfo & - setViewFormats( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewFormats_ ) VULKAN_HPP_NOEXCEPT - { - viewFormatCount = static_cast( viewFormats_.size() ); - pViewFormats = viewFormats_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFramebufferAttachmentImageInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFramebufferAttachmentImageInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, usage, width, height, layerCount, viewFormatCount, pViewFormats ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FramebufferAttachmentImageInfo const & ) const = default; -#else - bool operator==( FramebufferAttachmentImageInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( usage == rhs.usage ) && ( width == rhs.width ) && - ( height == rhs.height ) && ( layerCount == rhs.layerCount ) && ( viewFormatCount == rhs.viewFormatCount ) && ( pViewFormats == rhs.pViewFormats ); -# endif - } - - bool operator!=( FramebufferAttachmentImageInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFramebufferAttachmentImageInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage = {}; - uint32_t width = {}; - uint32_t height = {}; - uint32_t layerCount = {}; - uint32_t viewFormatCount = {}; - const VULKAN_HPP_NAMESPACE::Format * pViewFormats = {}; - }; - - template <> - struct CppType - { - using Type = FramebufferAttachmentImageInfo; - }; - using FramebufferAttachmentImageInfoKHR = FramebufferAttachmentImageInfo; - - struct FramebufferAttachmentsCreateInfo - { - using NativeType = VkFramebufferAttachmentsCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFramebufferAttachmentsCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FramebufferAttachmentsCreateInfo( uint32_t attachmentImageInfoCount_ = {}, - const VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo * pAttachmentImageInfos_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachmentImageInfoCount( attachmentImageInfoCount_ ) - , pAttachmentImageInfos( pAttachmentImageInfos_ ) - { - } - - VULKAN_HPP_CONSTEXPR FramebufferAttachmentsCreateInfo( FramebufferAttachmentsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferAttachmentsCreateInfo( VkFramebufferAttachmentsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : FramebufferAttachmentsCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferAttachmentsCreateInfo( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachmentImageInfos_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , attachmentImageInfoCount( static_cast( attachmentImageInfos_.size() ) ) - , pAttachmentImageInfos( attachmentImageInfos_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FramebufferAttachmentsCreateInfo & operator=( FramebufferAttachmentsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferAttachmentsCreateInfo & operator=( VkFramebufferAttachmentsCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentsCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentsCreateInfo & setAttachmentImageInfoCount( uint32_t attachmentImageInfoCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentImageInfoCount = attachmentImageInfoCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferAttachmentsCreateInfo & - setPAttachmentImageInfos( const VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo * pAttachmentImageInfos_ ) VULKAN_HPP_NOEXCEPT - { - pAttachmentImageInfos = pAttachmentImageInfos_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferAttachmentsCreateInfo & setAttachmentImageInfos( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachmentImageInfos_ ) - VULKAN_HPP_NOEXCEPT - { - attachmentImageInfoCount = static_cast( attachmentImageInfos_.size() ); - pAttachmentImageInfos = attachmentImageInfos_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFramebufferAttachmentsCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFramebufferAttachmentsCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, attachmentImageInfoCount, pAttachmentImageInfos ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FramebufferAttachmentsCreateInfo const & ) const = default; -#else - bool operator==( FramebufferAttachmentsCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachmentImageInfoCount == rhs.attachmentImageInfoCount ) && - ( pAttachmentImageInfos == rhs.pAttachmentImageInfos ); -# endif - } - - bool operator!=( FramebufferAttachmentsCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFramebufferAttachmentsCreateInfo; - const void * pNext = {}; - uint32_t attachmentImageInfoCount = {}; - const VULKAN_HPP_NAMESPACE::FramebufferAttachmentImageInfo * pAttachmentImageInfos = {}; - }; - - template <> - struct CppType - { - using Type = FramebufferAttachmentsCreateInfo; - }; - using FramebufferAttachmentsCreateInfoKHR = FramebufferAttachmentsCreateInfo; - - struct FramebufferCreateInfo - { - using NativeType = VkFramebufferCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFramebufferCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FramebufferCreateInfo( VULKAN_HPP_NAMESPACE::FramebufferCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageView * pAttachments_ = {}, - uint32_t width_ = {}, - uint32_t height_ = {}, - uint32_t layers_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , renderPass( renderPass_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , width( width_ ) - , height( height_ ) - , layers( layers_ ) - { - } - - VULKAN_HPP_CONSTEXPR FramebufferCreateInfo( FramebufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferCreateInfo( VkFramebufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : FramebufferCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferCreateInfo( VULKAN_HPP_NAMESPACE::FramebufferCreateFlags flags_, - VULKAN_HPP_NAMESPACE::RenderPass renderPass_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_, - uint32_t width_ = {}, - uint32_t height_ = {}, - uint32_t layers_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , renderPass( renderPass_ ) - , attachmentCount( static_cast( attachments_.size() ) ) - , pAttachments( attachments_.data() ) - , width( width_ ) - , height( height_ ) - , layers( layers_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FramebufferCreateInfo & operator=( FramebufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferCreateInfo & operator=( VkFramebufferCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::FramebufferCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ ) VULKAN_HPP_NOEXCEPT - { - renderPass = renderPass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setPAttachments( const VULKAN_HPP_NAMESPACE::ImageView * pAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pAttachments = pAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - FramebufferCreateInfo & - setAttachments( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( attachments_.size() ); - pAttachments = attachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 FramebufferCreateInfo & setLayers( uint32_t layers_ ) VULKAN_HPP_NOEXCEPT - { - layers = layers_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkFramebufferCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFramebufferCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, renderPass, attachmentCount, pAttachments, width, height, layers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FramebufferCreateInfo const & ) const = default; -#else - bool operator==( FramebufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( renderPass == rhs.renderPass ) && - ( attachmentCount == rhs.attachmentCount ) && ( pAttachments == rhs.pAttachments ) && ( width == rhs.width ) && ( height == rhs.height ) && - ( layers == rhs.layers ); -# endif - } - - bool operator!=( FramebufferCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFramebufferCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::FramebufferCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::RenderPass renderPass = {}; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::ImageView * pAttachments = {}; - uint32_t width = {}; - uint32_t height = {}; - uint32_t layers = {}; - }; - - template <> - struct CppType - { - using Type = FramebufferCreateInfo; - }; - - struct FramebufferMixedSamplesCombinationNV - { - using NativeType = VkFramebufferMixedSamplesCombinationNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eFramebufferMixedSamplesCombinationNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR FramebufferMixedSamplesCombinationNV( - VULKAN_HPP_NAMESPACE::CoverageReductionModeNV coverageReductionMode_ = VULKAN_HPP_NAMESPACE::CoverageReductionModeNV::eMerge, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::SampleCountFlags depthStencilSamples_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags colorSamples_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , coverageReductionMode( coverageReductionMode_ ) - , rasterizationSamples( rasterizationSamples_ ) - , depthStencilSamples( depthStencilSamples_ ) - , colorSamples( colorSamples_ ) - { - } - - VULKAN_HPP_CONSTEXPR FramebufferMixedSamplesCombinationNV( FramebufferMixedSamplesCombinationNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferMixedSamplesCombinationNV( VkFramebufferMixedSamplesCombinationNV const & rhs ) VULKAN_HPP_NOEXCEPT - : FramebufferMixedSamplesCombinationNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - FramebufferMixedSamplesCombinationNV & operator=( FramebufferMixedSamplesCombinationNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - FramebufferMixedSamplesCombinationNV & operator=( VkFramebufferMixedSamplesCombinationNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkFramebufferMixedSamplesCombinationNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkFramebufferMixedSamplesCombinationNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, coverageReductionMode, rasterizationSamples, depthStencilSamples, colorSamples ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( FramebufferMixedSamplesCombinationNV const & ) const = default; -#else - bool operator==( FramebufferMixedSamplesCombinationNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( coverageReductionMode == rhs.coverageReductionMode ) && - ( rasterizationSamples == rhs.rasterizationSamples ) && ( depthStencilSamples == rhs.depthStencilSamples ) && ( colorSamples == rhs.colorSamples ); -# endif - } - - bool operator!=( FramebufferMixedSamplesCombinationNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eFramebufferMixedSamplesCombinationNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::CoverageReductionModeNV coverageReductionMode = VULKAN_HPP_NAMESPACE::CoverageReductionModeNV::eMerge; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::SampleCountFlags depthStencilSamples = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags colorSamples = {}; - }; - - template <> - struct CppType - { - using Type = FramebufferMixedSamplesCombinationNV; - }; - - struct IndirectCommandsStreamNV - { - using NativeType = VkIndirectCommandsStreamNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR IndirectCommandsStreamNV( VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {} ) VULKAN_HPP_NOEXCEPT - : buffer( buffer_ ) - , offset( offset_ ) - { - } - - VULKAN_HPP_CONSTEXPR IndirectCommandsStreamNV( IndirectCommandsStreamNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsStreamNV( VkIndirectCommandsStreamNV const & rhs ) VULKAN_HPP_NOEXCEPT - : IndirectCommandsStreamNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - IndirectCommandsStreamNV & operator=( IndirectCommandsStreamNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsStreamNV & operator=( VkIndirectCommandsStreamNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsStreamNV & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsStreamNV & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkIndirectCommandsStreamNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkIndirectCommandsStreamNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( buffer, offset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( IndirectCommandsStreamNV const & ) const = default; -#else - bool operator==( IndirectCommandsStreamNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( buffer == rhs.buffer ) && ( offset == rhs.offset ); -# endif - } - - bool operator!=( IndirectCommandsStreamNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - }; - - struct GeneratedCommandsInfoNV - { - using NativeType = VkGeneratedCommandsInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGeneratedCommandsInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - GeneratedCommandsInfoNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - VULKAN_HPP_NAMESPACE::Pipeline pipeline_ = {}, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout_ = {}, - uint32_t streamCount_ = {}, - const VULKAN_HPP_NAMESPACE::IndirectCommandsStreamNV * pStreams_ = {}, - uint32_t sequencesCount_ = {}, - VULKAN_HPP_NAMESPACE::Buffer preprocessBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize preprocessOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize preprocessSize_ = {}, - VULKAN_HPP_NAMESPACE::Buffer sequencesCountBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize sequencesCountOffset_ = {}, - VULKAN_HPP_NAMESPACE::Buffer sequencesIndexBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize sequencesIndexOffset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipeline( pipeline_ ) - , indirectCommandsLayout( indirectCommandsLayout_ ) - , streamCount( streamCount_ ) - , pStreams( pStreams_ ) - , sequencesCount( sequencesCount_ ) - , preprocessBuffer( preprocessBuffer_ ) - , preprocessOffset( preprocessOffset_ ) - , preprocessSize( preprocessSize_ ) - , sequencesCountBuffer( sequencesCountBuffer_ ) - , sequencesCountOffset( sequencesCountOffset_ ) - , sequencesIndexBuffer( sequencesIndexBuffer_ ) - , sequencesIndexOffset( sequencesIndexOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeneratedCommandsInfoNV( GeneratedCommandsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeneratedCommandsInfoNV( VkGeneratedCommandsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : GeneratedCommandsInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GeneratedCommandsInfoNV( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_, - VULKAN_HPP_NAMESPACE::Pipeline pipeline_, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & streams_, - uint32_t sequencesCount_ = {}, - VULKAN_HPP_NAMESPACE::Buffer preprocessBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize preprocessOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize preprocessSize_ = {}, - VULKAN_HPP_NAMESPACE::Buffer sequencesCountBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize sequencesCountOffset_ = {}, - VULKAN_HPP_NAMESPACE::Buffer sequencesIndexBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize sequencesIndexOffset_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipeline( pipeline_ ) - , indirectCommandsLayout( indirectCommandsLayout_ ) - , streamCount( static_cast( streams_.size() ) ) - , pStreams( streams_.data() ) - , sequencesCount( sequencesCount_ ) - , preprocessBuffer( preprocessBuffer_ ) - , preprocessOffset( preprocessOffset_ ) - , preprocessSize( preprocessSize_ ) - , sequencesCountBuffer( sequencesCountBuffer_ ) - , sequencesCountOffset( sequencesCountOffset_ ) - , sequencesIndexBuffer( sequencesIndexBuffer_ ) - , sequencesIndexOffset( sequencesIndexOffset_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeneratedCommandsInfoNV & operator=( GeneratedCommandsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeneratedCommandsInfoNV & operator=( VkGeneratedCommandsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ ) VULKAN_HPP_NOEXCEPT - { - pipeline = pipeline_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & - setIndirectCommandsLayout( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout_ ) VULKAN_HPP_NOEXCEPT - { - indirectCommandsLayout = indirectCommandsLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setStreamCount( uint32_t streamCount_ ) VULKAN_HPP_NOEXCEPT - { - streamCount = streamCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPStreams( const VULKAN_HPP_NAMESPACE::IndirectCommandsStreamNV * pStreams_ ) VULKAN_HPP_NOEXCEPT - { - pStreams = pStreams_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GeneratedCommandsInfoNV & - setStreams( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & streams_ ) VULKAN_HPP_NOEXCEPT - { - streamCount = static_cast( streams_.size() ); - pStreams = streams_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setSequencesCount( uint32_t sequencesCount_ ) VULKAN_HPP_NOEXCEPT - { - sequencesCount = sequencesCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPreprocessBuffer( VULKAN_HPP_NAMESPACE::Buffer preprocessBuffer_ ) VULKAN_HPP_NOEXCEPT - { - preprocessBuffer = preprocessBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPreprocessOffset( VULKAN_HPP_NAMESPACE::DeviceSize preprocessOffset_ ) VULKAN_HPP_NOEXCEPT - { - preprocessOffset = preprocessOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setPreprocessSize( VULKAN_HPP_NAMESPACE::DeviceSize preprocessSize_ ) VULKAN_HPP_NOEXCEPT - { - preprocessSize = preprocessSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setSequencesCountBuffer( VULKAN_HPP_NAMESPACE::Buffer sequencesCountBuffer_ ) VULKAN_HPP_NOEXCEPT - { - sequencesCountBuffer = sequencesCountBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setSequencesCountOffset( VULKAN_HPP_NAMESPACE::DeviceSize sequencesCountOffset_ ) VULKAN_HPP_NOEXCEPT - { - sequencesCountOffset = sequencesCountOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setSequencesIndexBuffer( VULKAN_HPP_NAMESPACE::Buffer sequencesIndexBuffer_ ) VULKAN_HPP_NOEXCEPT - { - sequencesIndexBuffer = sequencesIndexBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsInfoNV & setSequencesIndexOffset( VULKAN_HPP_NAMESPACE::DeviceSize sequencesIndexOffset_ ) VULKAN_HPP_NOEXCEPT - { - sequencesIndexOffset = sequencesIndexOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeneratedCommandsInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeneratedCommandsInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - pipelineBindPoint, - pipeline, - indirectCommandsLayout, - streamCount, - pStreams, - sequencesCount, - preprocessBuffer, - preprocessOffset, - preprocessSize, - sequencesCountBuffer, - sequencesCountOffset, - sequencesIndexBuffer, - sequencesIndexOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeneratedCommandsInfoNV const & ) const = default; -#else - bool operator==( GeneratedCommandsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && ( pipeline == rhs.pipeline ) && - ( indirectCommandsLayout == rhs.indirectCommandsLayout ) && ( streamCount == rhs.streamCount ) && ( pStreams == rhs.pStreams ) && - ( sequencesCount == rhs.sequencesCount ) && ( preprocessBuffer == rhs.preprocessBuffer ) && ( preprocessOffset == rhs.preprocessOffset ) && - ( preprocessSize == rhs.preprocessSize ) && ( sequencesCountBuffer == rhs.sequencesCountBuffer ) && - ( sequencesCountOffset == rhs.sequencesCountOffset ) && ( sequencesIndexBuffer == rhs.sequencesIndexBuffer ) && - ( sequencesIndexOffset == rhs.sequencesIndexOffset ); -# endif - } - - bool operator!=( GeneratedCommandsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGeneratedCommandsInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - VULKAN_HPP_NAMESPACE::Pipeline pipeline = {}; - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout = {}; - uint32_t streamCount = {}; - const VULKAN_HPP_NAMESPACE::IndirectCommandsStreamNV * pStreams = {}; - uint32_t sequencesCount = {}; - VULKAN_HPP_NAMESPACE::Buffer preprocessBuffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize preprocessOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize preprocessSize = {}; - VULKAN_HPP_NAMESPACE::Buffer sequencesCountBuffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize sequencesCountOffset = {}; - VULKAN_HPP_NAMESPACE::Buffer sequencesIndexBuffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize sequencesIndexOffset = {}; - }; - - template <> - struct CppType - { - using Type = GeneratedCommandsInfoNV; - }; - - struct GeneratedCommandsMemoryRequirementsInfoNV - { - using NativeType = VkGeneratedCommandsMemoryRequirementsInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGeneratedCommandsMemoryRequirementsInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GeneratedCommandsMemoryRequirementsInfoNV( - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - VULKAN_HPP_NAMESPACE::Pipeline pipeline_ = {}, - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout_ = {}, - uint32_t maxSequencesCount_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , pipeline( pipeline_ ) - , indirectCommandsLayout( indirectCommandsLayout_ ) - , maxSequencesCount( maxSequencesCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR GeneratedCommandsMemoryRequirementsInfoNV( GeneratedCommandsMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeneratedCommandsMemoryRequirementsInfoNV( VkGeneratedCommandsMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : GeneratedCommandsMemoryRequirementsInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GeneratedCommandsMemoryRequirementsInfoNV & operator=( GeneratedCommandsMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GeneratedCommandsMemoryRequirementsInfoNV & operator=( VkGeneratedCommandsMemoryRequirementsInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsMemoryRequirementsInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsMemoryRequirementsInfoNV & - setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsMemoryRequirementsInfoNV & setPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ ) VULKAN_HPP_NOEXCEPT - { - pipeline = pipeline_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsMemoryRequirementsInfoNV & - setIndirectCommandsLayout( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout_ ) VULKAN_HPP_NOEXCEPT - { - indirectCommandsLayout = indirectCommandsLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GeneratedCommandsMemoryRequirementsInfoNV & setMaxSequencesCount( uint32_t maxSequencesCount_ ) VULKAN_HPP_NOEXCEPT - { - maxSequencesCount = maxSequencesCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGeneratedCommandsMemoryRequirementsInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGeneratedCommandsMemoryRequirementsInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineBindPoint, pipeline, indirectCommandsLayout, maxSequencesCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GeneratedCommandsMemoryRequirementsInfoNV const & ) const = default; -#else - bool operator==( GeneratedCommandsMemoryRequirementsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && ( pipeline == rhs.pipeline ) && - ( indirectCommandsLayout == rhs.indirectCommandsLayout ) && ( maxSequencesCount == rhs.maxSequencesCount ); -# endif - } - - bool operator!=( GeneratedCommandsMemoryRequirementsInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGeneratedCommandsMemoryRequirementsInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - VULKAN_HPP_NAMESPACE::Pipeline pipeline = {}; - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutNV indirectCommandsLayout = {}; - uint32_t maxSequencesCount = {}; - }; - - template <> - struct CppType - { - using Type = GeneratedCommandsMemoryRequirementsInfoNV; - }; - - struct VertexInputBindingDescription - { - using NativeType = VkVertexInputBindingDescription; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VertexInputBindingDescription( uint32_t binding_ = {}, - uint32_t stride_ = {}, - VULKAN_HPP_NAMESPACE::VertexInputRate inputRate_ = VULKAN_HPP_NAMESPACE::VertexInputRate::eVertex ) VULKAN_HPP_NOEXCEPT - : binding( binding_ ) - , stride( stride_ ) - , inputRate( inputRate_ ) - { - } - - VULKAN_HPP_CONSTEXPR VertexInputBindingDescription( VertexInputBindingDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDescription( VkVertexInputBindingDescription const & rhs ) VULKAN_HPP_NOEXCEPT - : VertexInputBindingDescription( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VertexInputBindingDescription & operator=( VertexInputBindingDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDescription & operator=( VkVertexInputBindingDescription const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription & setStride( uint32_t stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription & setInputRate( VULKAN_HPP_NAMESPACE::VertexInputRate inputRate_ ) VULKAN_HPP_NOEXCEPT - { - inputRate = inputRate_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVertexInputBindingDescription const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVertexInputBindingDescription &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( binding, stride, inputRate ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VertexInputBindingDescription const & ) const = default; -#else - bool operator==( VertexInputBindingDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( binding == rhs.binding ) && ( stride == rhs.stride ) && ( inputRate == rhs.inputRate ); -# endif - } - - bool operator!=( VertexInputBindingDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t binding = {}; - uint32_t stride = {}; - VULKAN_HPP_NAMESPACE::VertexInputRate inputRate = VULKAN_HPP_NAMESPACE::VertexInputRate::eVertex; - }; - - struct VertexInputAttributeDescription - { - using NativeType = VkVertexInputAttributeDescription; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VertexInputAttributeDescription( uint32_t location_ = {}, - uint32_t binding_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - uint32_t offset_ = {} ) VULKAN_HPP_NOEXCEPT - : location( location_ ) - , binding( binding_ ) - , format( format_ ) - , offset( offset_ ) - { - } - - VULKAN_HPP_CONSTEXPR VertexInputAttributeDescription( VertexInputAttributeDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputAttributeDescription( VkVertexInputAttributeDescription const & rhs ) VULKAN_HPP_NOEXCEPT - : VertexInputAttributeDescription( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VertexInputAttributeDescription & operator=( VertexInputAttributeDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputAttributeDescription & operator=( VkVertexInputAttributeDescription const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription & setLocation( uint32_t location_ ) VULKAN_HPP_NOEXCEPT - { - location = location_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription & setOffset( uint32_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVertexInputAttributeDescription const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVertexInputAttributeDescription &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( location, binding, format, offset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VertexInputAttributeDescription const & ) const = default; -#else - bool operator==( VertexInputAttributeDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( location == rhs.location ) && ( binding == rhs.binding ) && ( format == rhs.format ) && ( offset == rhs.offset ); -# endif - } - - bool operator!=( VertexInputAttributeDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t location = {}; - uint32_t binding = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - uint32_t offset = {}; - }; - - struct PipelineVertexInputStateCreateInfo - { - using NativeType = VkPipelineVertexInputStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineVertexInputStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineVertexInputStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateFlags flags_ = {}, - uint32_t vertexBindingDescriptionCount_ = {}, - const VULKAN_HPP_NAMESPACE::VertexInputBindingDescription * pVertexBindingDescriptions_ = {}, - uint32_t vertexAttributeDescriptionCount_ = {}, - const VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription * pVertexAttributeDescriptions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , vertexBindingDescriptionCount( vertexBindingDescriptionCount_ ) - , pVertexBindingDescriptions( pVertexBindingDescriptions_ ) - , vertexAttributeDescriptionCount( vertexAttributeDescriptionCount_ ) - , pVertexAttributeDescriptions( pVertexAttributeDescriptions_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineVertexInputStateCreateInfo( PipelineVertexInputStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineVertexInputStateCreateInfo( VkPipelineVertexInputStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineVertexInputStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineVertexInputStateCreateInfo( - VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexBindingDescriptions_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexAttributeDescriptions_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , vertexBindingDescriptionCount( static_cast( vertexBindingDescriptions_.size() ) ) - , pVertexBindingDescriptions( vertexBindingDescriptions_.data() ) - , vertexAttributeDescriptionCount( static_cast( vertexAttributeDescriptions_.size() ) ) - , pVertexAttributeDescriptions( vertexAttributeDescriptions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineVertexInputStateCreateInfo & operator=( PipelineVertexInputStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineVertexInputStateCreateInfo & operator=( VkPipelineVertexInputStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & setVertexBindingDescriptionCount( uint32_t vertexBindingDescriptionCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexBindingDescriptionCount = vertexBindingDescriptionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & - setPVertexBindingDescriptions( const VULKAN_HPP_NAMESPACE::VertexInputBindingDescription * pVertexBindingDescriptions_ ) VULKAN_HPP_NOEXCEPT - { - pVertexBindingDescriptions = pVertexBindingDescriptions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineVertexInputStateCreateInfo & setVertexBindingDescriptions( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexBindingDescriptions_ ) - VULKAN_HPP_NOEXCEPT - { - vertexBindingDescriptionCount = static_cast( vertexBindingDescriptions_.size() ); - pVertexBindingDescriptions = vertexBindingDescriptions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & - setVertexAttributeDescriptionCount( uint32_t vertexAttributeDescriptionCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexAttributeDescriptionCount = vertexAttributeDescriptionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputStateCreateInfo & - setPVertexAttributeDescriptions( const VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription * pVertexAttributeDescriptions_ ) VULKAN_HPP_NOEXCEPT - { - pVertexAttributeDescriptions = pVertexAttributeDescriptions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineVertexInputStateCreateInfo & setVertexAttributeDescriptions( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexAttributeDescriptions_ ) - VULKAN_HPP_NOEXCEPT - { - vertexAttributeDescriptionCount = static_cast( vertexAttributeDescriptions_.size() ); - pVertexAttributeDescriptions = vertexAttributeDescriptions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineVertexInputStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineVertexInputStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, flags, vertexBindingDescriptionCount, pVertexBindingDescriptions, vertexAttributeDescriptionCount, pVertexAttributeDescriptions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineVertexInputStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineVertexInputStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( vertexBindingDescriptionCount == rhs.vertexBindingDescriptionCount ) && ( pVertexBindingDescriptions == rhs.pVertexBindingDescriptions ) && - ( vertexAttributeDescriptionCount == rhs.vertexAttributeDescriptionCount ) && ( pVertexAttributeDescriptions == rhs.pVertexAttributeDescriptions ); -# endif - } - - bool operator!=( PipelineVertexInputStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineVertexInputStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateFlags flags = {}; - uint32_t vertexBindingDescriptionCount = {}; - const VULKAN_HPP_NAMESPACE::VertexInputBindingDescription * pVertexBindingDescriptions = {}; - uint32_t vertexAttributeDescriptionCount = {}; - const VULKAN_HPP_NAMESPACE::VertexInputAttributeDescription * pVertexAttributeDescriptions = {}; - }; - - template <> - struct CppType - { - using Type = PipelineVertexInputStateCreateInfo; - }; - - struct PipelineInputAssemblyStateCreateInfo - { - using NativeType = VkPipelineInputAssemblyStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineInputAssemblyStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PipelineInputAssemblyStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::PrimitiveTopology topology_ = VULKAN_HPP_NAMESPACE::PrimitiveTopology::ePointList, - VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , topology( topology_ ) - , primitiveRestartEnable( primitiveRestartEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineInputAssemblyStateCreateInfo( PipelineInputAssemblyStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineInputAssemblyStateCreateInfo( VkPipelineInputAssemblyStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineInputAssemblyStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineInputAssemblyStateCreateInfo & operator=( PipelineInputAssemblyStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineInputAssemblyStateCreateInfo & operator=( VkPipelineInputAssemblyStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineInputAssemblyStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineInputAssemblyStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineInputAssemblyStateCreateInfo & setTopology( VULKAN_HPP_NAMESPACE::PrimitiveTopology topology_ ) VULKAN_HPP_NOEXCEPT - { - topology = topology_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineInputAssemblyStateCreateInfo & - setPrimitiveRestartEnable( VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable_ ) VULKAN_HPP_NOEXCEPT - { - primitiveRestartEnable = primitiveRestartEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineInputAssemblyStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineInputAssemblyStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, topology, primitiveRestartEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineInputAssemblyStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineInputAssemblyStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( topology == rhs.topology ) && - ( primitiveRestartEnable == rhs.primitiveRestartEnable ); -# endif - } - - bool operator!=( PipelineInputAssemblyStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineInputAssemblyStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::PrimitiveTopology topology = VULKAN_HPP_NAMESPACE::PrimitiveTopology::ePointList; - VULKAN_HPP_NAMESPACE::Bool32 primitiveRestartEnable = {}; - }; - - template <> - struct CppType - { - using Type = PipelineInputAssemblyStateCreateInfo; - }; - - struct PipelineTessellationStateCreateInfo - { - using NativeType = VkPipelineTessellationStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineTessellationStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineTessellationStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateFlags flags_ = {}, - uint32_t patchControlPoints_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , patchControlPoints( patchControlPoints_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineTessellationStateCreateInfo( PipelineTessellationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineTessellationStateCreateInfo( VkPipelineTessellationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineTessellationStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineTessellationStateCreateInfo & operator=( PipelineTessellationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineTessellationStateCreateInfo & operator=( VkPipelineTessellationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineTessellationStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineTessellationStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineTessellationStateCreateInfo & setPatchControlPoints( uint32_t patchControlPoints_ ) VULKAN_HPP_NOEXCEPT - { - patchControlPoints = patchControlPoints_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineTessellationStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineTessellationStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, patchControlPoints ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineTessellationStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineTessellationStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( patchControlPoints == rhs.patchControlPoints ); -# endif - } - - bool operator!=( PipelineTessellationStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineTessellationStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateFlags flags = {}; - uint32_t patchControlPoints = {}; - }; - - template <> - struct CppType - { - using Type = PipelineTessellationStateCreateInfo; - }; - - struct PipelineViewportStateCreateInfo - { - using NativeType = VkPipelineViewportStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateFlags flags_ = {}, - uint32_t viewportCount_ = {}, - const VULKAN_HPP_NAMESPACE::Viewport * pViewports_ = {}, - uint32_t scissorCount_ = {}, - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , viewportCount( viewportCount_ ) - , pViewports( pViewports_ ) - , scissorCount( scissorCount_ ) - , pScissors( pScissors_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineViewportStateCreateInfo( PipelineViewportStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportStateCreateInfo( VkPipelineViewportStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewports_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & scissors_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , viewportCount( static_cast( viewports_.size() ) ) - , pViewports( viewports_.data() ) - , scissorCount( static_cast( scissors_.size() ) ) - , pScissors( scissors_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportStateCreateInfo & operator=( PipelineViewportStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportStateCreateInfo & operator=( VkPipelineViewportStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setViewportCount( uint32_t viewportCount_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = viewportCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setPViewports( const VULKAN_HPP_NAMESPACE::Viewport * pViewports_ ) VULKAN_HPP_NOEXCEPT - { - pViewports = pViewports_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportStateCreateInfo & - setViewports( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewports_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = static_cast( viewports_.size() ); - pViewports = viewports_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setScissorCount( uint32_t scissorCount_ ) VULKAN_HPP_NOEXCEPT - { - scissorCount = scissorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportStateCreateInfo & setPScissors( const VULKAN_HPP_NAMESPACE::Rect2D * pScissors_ ) VULKAN_HPP_NOEXCEPT - { - pScissors = pScissors_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportStateCreateInfo & - setScissors( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & scissors_ ) VULKAN_HPP_NOEXCEPT - { - scissorCount = static_cast( scissors_.size() ); - pScissors = scissors_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, viewportCount, pViewports, scissorCount, pScissors ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineViewportStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( viewportCount == rhs.viewportCount ) && - ( pViewports == rhs.pViewports ) && ( scissorCount == rhs.scissorCount ) && ( pScissors == rhs.pScissors ); -# endif - } - - bool operator!=( PipelineViewportStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateFlags flags = {}; - uint32_t viewportCount = {}; - const VULKAN_HPP_NAMESPACE::Viewport * pViewports = {}; - uint32_t scissorCount = {}; - const VULKAN_HPP_NAMESPACE::Rect2D * pScissors = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportStateCreateInfo; - }; - - struct PipelineRasterizationStateCreateInfo - { - using NativeType = VkPipelineRasterizationStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthClampEnable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable_ = {}, - VULKAN_HPP_NAMESPACE::PolygonMode polygonMode_ = VULKAN_HPP_NAMESPACE::PolygonMode::eFill, - VULKAN_HPP_NAMESPACE::CullModeFlags cullMode_ = {}, - VULKAN_HPP_NAMESPACE::FrontFace frontFace_ = VULKAN_HPP_NAMESPACE::FrontFace::eCounterClockwise, - VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable_ = {}, - float depthBiasConstantFactor_ = {}, - float depthBiasClamp_ = {}, - float depthBiasSlopeFactor_ = {}, - float lineWidth_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , depthClampEnable( depthClampEnable_ ) - , rasterizerDiscardEnable( rasterizerDiscardEnable_ ) - , polygonMode( polygonMode_ ) - , cullMode( cullMode_ ) - , frontFace( frontFace_ ) - , depthBiasEnable( depthBiasEnable_ ) - , depthBiasConstantFactor( depthBiasConstantFactor_ ) - , depthBiasClamp( depthBiasClamp_ ) - , depthBiasSlopeFactor( depthBiasSlopeFactor_ ) - , lineWidth( lineWidth_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineRasterizationStateCreateInfo( PipelineRasterizationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateCreateInfo( VkPipelineRasterizationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationStateCreateInfo & operator=( PipelineRasterizationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateCreateInfo & operator=( VkPipelineRasterizationStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setDepthClampEnable( VULKAN_HPP_NAMESPACE::Bool32 depthClampEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthClampEnable = depthClampEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & - setRasterizerDiscardEnable( VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable_ ) VULKAN_HPP_NOEXCEPT - { - rasterizerDiscardEnable = rasterizerDiscardEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setPolygonMode( VULKAN_HPP_NAMESPACE::PolygonMode polygonMode_ ) VULKAN_HPP_NOEXCEPT - { - polygonMode = polygonMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setCullMode( VULKAN_HPP_NAMESPACE::CullModeFlags cullMode_ ) VULKAN_HPP_NOEXCEPT - { - cullMode = cullMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setFrontFace( VULKAN_HPP_NAMESPACE::FrontFace frontFace_ ) VULKAN_HPP_NOEXCEPT - { - frontFace = frontFace_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setDepthBiasEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthBiasEnable = depthBiasEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setDepthBiasConstantFactor( float depthBiasConstantFactor_ ) VULKAN_HPP_NOEXCEPT - { - depthBiasConstantFactor = depthBiasConstantFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setDepthBiasClamp( float depthBiasClamp_ ) VULKAN_HPP_NOEXCEPT - { - depthBiasClamp = depthBiasClamp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setDepthBiasSlopeFactor( float depthBiasSlopeFactor_ ) VULKAN_HPP_NOEXCEPT - { - depthBiasSlopeFactor = depthBiasSlopeFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateCreateInfo & setLineWidth( float lineWidth_ ) VULKAN_HPP_NOEXCEPT - { - lineWidth = lineWidth_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - depthClampEnable, - rasterizerDiscardEnable, - polygonMode, - cullMode, - frontFace, - depthBiasEnable, - depthBiasConstantFactor, - depthBiasClamp, - depthBiasSlopeFactor, - lineWidth ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineRasterizationStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( depthClampEnable == rhs.depthClampEnable ) && - ( rasterizerDiscardEnable == rhs.rasterizerDiscardEnable ) && ( polygonMode == rhs.polygonMode ) && ( cullMode == rhs.cullMode ) && - ( frontFace == rhs.frontFace ) && ( depthBiasEnable == rhs.depthBiasEnable ) && ( depthBiasConstantFactor == rhs.depthBiasConstantFactor ) && - ( depthBiasClamp == rhs.depthBiasClamp ) && ( depthBiasSlopeFactor == rhs.depthBiasSlopeFactor ) && ( lineWidth == rhs.lineWidth ); -# endif - } - - bool operator!=( PipelineRasterizationStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClampEnable = {}; - VULKAN_HPP_NAMESPACE::Bool32 rasterizerDiscardEnable = {}; - VULKAN_HPP_NAMESPACE::PolygonMode polygonMode = VULKAN_HPP_NAMESPACE::PolygonMode::eFill; - VULKAN_HPP_NAMESPACE::CullModeFlags cullMode = {}; - VULKAN_HPP_NAMESPACE::FrontFace frontFace = VULKAN_HPP_NAMESPACE::FrontFace::eCounterClockwise; - VULKAN_HPP_NAMESPACE::Bool32 depthBiasEnable = {}; - float depthBiasConstantFactor = {}; - float depthBiasClamp = {}; - float depthBiasSlopeFactor = {}; - float lineWidth = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationStateCreateInfo; - }; - - struct PipelineMultisampleStateCreateInfo - { - using NativeType = VkPipelineMultisampleStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineMultisampleStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PipelineMultisampleStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::Bool32 sampleShadingEnable_ = {}, - float minSampleShading_ = {}, - const VULKAN_HPP_NAMESPACE::SampleMask * pSampleMask_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 alphaToCoverageEnable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 alphaToOneEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , rasterizationSamples( rasterizationSamples_ ) - , sampleShadingEnable( sampleShadingEnable_ ) - , minSampleShading( minSampleShading_ ) - , pSampleMask( pSampleMask_ ) - , alphaToCoverageEnable( alphaToCoverageEnable_ ) - , alphaToOneEnable( alphaToOneEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineMultisampleStateCreateInfo( PipelineMultisampleStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineMultisampleStateCreateInfo( VkPipelineMultisampleStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineMultisampleStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineMultisampleStateCreateInfo & operator=( PipelineMultisampleStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineMultisampleStateCreateInfo & operator=( VkPipelineMultisampleStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & - setRasterizationSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationSamples = rasterizationSamples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & setSampleShadingEnable( VULKAN_HPP_NAMESPACE::Bool32 sampleShadingEnable_ ) VULKAN_HPP_NOEXCEPT - { - sampleShadingEnable = sampleShadingEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & setMinSampleShading( float minSampleShading_ ) VULKAN_HPP_NOEXCEPT - { - minSampleShading = minSampleShading_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & setPSampleMask( const VULKAN_HPP_NAMESPACE::SampleMask * pSampleMask_ ) VULKAN_HPP_NOEXCEPT - { - pSampleMask = pSampleMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & - setAlphaToCoverageEnable( VULKAN_HPP_NAMESPACE::Bool32 alphaToCoverageEnable_ ) VULKAN_HPP_NOEXCEPT - { - alphaToCoverageEnable = alphaToCoverageEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineMultisampleStateCreateInfo & setAlphaToOneEnable( VULKAN_HPP_NAMESPACE::Bool32 alphaToOneEnable_ ) VULKAN_HPP_NOEXCEPT - { - alphaToOneEnable = alphaToOneEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineMultisampleStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineMultisampleStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, rasterizationSamples, sampleShadingEnable, minSampleShading, pSampleMask, alphaToCoverageEnable, alphaToOneEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineMultisampleStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineMultisampleStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( rasterizationSamples == rhs.rasterizationSamples ) && - ( sampleShadingEnable == rhs.sampleShadingEnable ) && ( minSampleShading == rhs.minSampleShading ) && ( pSampleMask == rhs.pSampleMask ) && - ( alphaToCoverageEnable == rhs.alphaToCoverageEnable ) && ( alphaToOneEnable == rhs.alphaToOneEnable ); -# endif - } - - bool operator!=( PipelineMultisampleStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineMultisampleStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::Bool32 sampleShadingEnable = {}; - float minSampleShading = {}; - const VULKAN_HPP_NAMESPACE::SampleMask * pSampleMask = {}; - VULKAN_HPP_NAMESPACE::Bool32 alphaToCoverageEnable = {}; - VULKAN_HPP_NAMESPACE::Bool32 alphaToOneEnable = {}; - }; - - template <> - struct CppType - { - using Type = PipelineMultisampleStateCreateInfo; - }; - - struct StencilOpState - { - using NativeType = VkStencilOpState; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR StencilOpState( VULKAN_HPP_NAMESPACE::StencilOp failOp_ = VULKAN_HPP_NAMESPACE::StencilOp::eKeep, - VULKAN_HPP_NAMESPACE::StencilOp passOp_ = VULKAN_HPP_NAMESPACE::StencilOp::eKeep, - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp_ = VULKAN_HPP_NAMESPACE::StencilOp::eKeep, - VULKAN_HPP_NAMESPACE::CompareOp compareOp_ = VULKAN_HPP_NAMESPACE::CompareOp::eNever, - uint32_t compareMask_ = {}, - uint32_t writeMask_ = {}, - uint32_t reference_ = {} ) VULKAN_HPP_NOEXCEPT - : failOp( failOp_ ) - , passOp( passOp_ ) - , depthFailOp( depthFailOp_ ) - , compareOp( compareOp_ ) - , compareMask( compareMask_ ) - , writeMask( writeMask_ ) - , reference( reference_ ) - { - } - - VULKAN_HPP_CONSTEXPR StencilOpState( StencilOpState const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StencilOpState( VkStencilOpState const & rhs ) VULKAN_HPP_NOEXCEPT : StencilOpState( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - StencilOpState & operator=( StencilOpState const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StencilOpState & operator=( VkStencilOpState const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setFailOp( VULKAN_HPP_NAMESPACE::StencilOp failOp_ ) VULKAN_HPP_NOEXCEPT - { - failOp = failOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setPassOp( VULKAN_HPP_NAMESPACE::StencilOp passOp_ ) VULKAN_HPP_NOEXCEPT - { - passOp = passOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setDepthFailOp( VULKAN_HPP_NAMESPACE::StencilOp depthFailOp_ ) VULKAN_HPP_NOEXCEPT - { - depthFailOp = depthFailOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setCompareOp( VULKAN_HPP_NAMESPACE::CompareOp compareOp_ ) VULKAN_HPP_NOEXCEPT - { - compareOp = compareOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setCompareMask( uint32_t compareMask_ ) VULKAN_HPP_NOEXCEPT - { - compareMask = compareMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setWriteMask( uint32_t writeMask_ ) VULKAN_HPP_NOEXCEPT - { - writeMask = writeMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StencilOpState & setReference( uint32_t reference_ ) VULKAN_HPP_NOEXCEPT - { - reference = reference_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkStencilOpState const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkStencilOpState &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( failOp, passOp, depthFailOp, compareOp, compareMask, writeMask, reference ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( StencilOpState const & ) const = default; -#else - bool operator==( StencilOpState const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( failOp == rhs.failOp ) && ( passOp == rhs.passOp ) && ( depthFailOp == rhs.depthFailOp ) && ( compareOp == rhs.compareOp ) && - ( compareMask == rhs.compareMask ) && ( writeMask == rhs.writeMask ) && ( reference == rhs.reference ); -# endif - } - - bool operator!=( StencilOpState const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StencilOp failOp = VULKAN_HPP_NAMESPACE::StencilOp::eKeep; - VULKAN_HPP_NAMESPACE::StencilOp passOp = VULKAN_HPP_NAMESPACE::StencilOp::eKeep; - VULKAN_HPP_NAMESPACE::StencilOp depthFailOp = VULKAN_HPP_NAMESPACE::StencilOp::eKeep; - VULKAN_HPP_NAMESPACE::CompareOp compareOp = VULKAN_HPP_NAMESPACE::CompareOp::eNever; - uint32_t compareMask = {}; - uint32_t writeMask = {}; - uint32_t reference = {}; - }; - - struct PipelineDepthStencilStateCreateInfo - { - using NativeType = VkPipelineDepthStencilStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineDepthStencilStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable_ = {}, - VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp_ = VULKAN_HPP_NAMESPACE::CompareOp::eNever, - VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable_ = {}, - VULKAN_HPP_NAMESPACE::StencilOpState front_ = {}, - VULKAN_HPP_NAMESPACE::StencilOpState back_ = {}, - float minDepthBounds_ = {}, - float maxDepthBounds_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , depthTestEnable( depthTestEnable_ ) - , depthWriteEnable( depthWriteEnable_ ) - , depthCompareOp( depthCompareOp_ ) - , depthBoundsTestEnable( depthBoundsTestEnable_ ) - , stencilTestEnable( stencilTestEnable_ ) - , front( front_ ) - , back( back_ ) - , minDepthBounds( minDepthBounds_ ) - , maxDepthBounds( maxDepthBounds_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineDepthStencilStateCreateInfo( PipelineDepthStencilStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDepthStencilStateCreateInfo( VkPipelineDepthStencilStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineDepthStencilStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineDepthStencilStateCreateInfo & operator=( PipelineDepthStencilStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDepthStencilStateCreateInfo & operator=( VkPipelineDepthStencilStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & - setFlags( VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setDepthTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthTestEnable = depthTestEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setDepthWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthWriteEnable = depthWriteEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setDepthCompareOp( VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp_ ) VULKAN_HPP_NOEXCEPT - { - depthCompareOp = depthCompareOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & - setDepthBoundsTestEnable( VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthBoundsTestEnable = depthBoundsTestEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setStencilTestEnable( VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable_ ) VULKAN_HPP_NOEXCEPT - { - stencilTestEnable = stencilTestEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setFront( VULKAN_HPP_NAMESPACE::StencilOpState const & front_ ) VULKAN_HPP_NOEXCEPT - { - front = front_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setBack( VULKAN_HPP_NAMESPACE::StencilOpState const & back_ ) VULKAN_HPP_NOEXCEPT - { - back = back_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setMinDepthBounds( float minDepthBounds_ ) VULKAN_HPP_NOEXCEPT - { - minDepthBounds = minDepthBounds_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDepthStencilStateCreateInfo & setMaxDepthBounds( float maxDepthBounds_ ) VULKAN_HPP_NOEXCEPT - { - maxDepthBounds = maxDepthBounds_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineDepthStencilStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineDepthStencilStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - depthTestEnable, - depthWriteEnable, - depthCompareOp, - depthBoundsTestEnable, - stencilTestEnable, - front, - back, - minDepthBounds, - maxDepthBounds ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineDepthStencilStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineDepthStencilStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( depthTestEnable == rhs.depthTestEnable ) && - ( depthWriteEnable == rhs.depthWriteEnable ) && ( depthCompareOp == rhs.depthCompareOp ) && - ( depthBoundsTestEnable == rhs.depthBoundsTestEnable ) && ( stencilTestEnable == rhs.stencilTestEnable ) && ( front == rhs.front ) && - ( back == rhs.back ) && ( minDepthBounds == rhs.minDepthBounds ) && ( maxDepthBounds == rhs.maxDepthBounds ); -# endif - } - - bool operator!=( PipelineDepthStencilStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineDepthStencilStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthTestEnable = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthWriteEnable = {}; - VULKAN_HPP_NAMESPACE::CompareOp depthCompareOp = VULKAN_HPP_NAMESPACE::CompareOp::eNever; - VULKAN_HPP_NAMESPACE::Bool32 depthBoundsTestEnable = {}; - VULKAN_HPP_NAMESPACE::Bool32 stencilTestEnable = {}; - VULKAN_HPP_NAMESPACE::StencilOpState front = {}; - VULKAN_HPP_NAMESPACE::StencilOpState back = {}; - float minDepthBounds = {}; - float maxDepthBounds = {}; - }; - - template <> - struct CppType - { - using Type = PipelineDepthStencilStateCreateInfo; - }; - - struct PipelineColorBlendAttachmentState - { - using NativeType = VkPipelineColorBlendAttachmentState; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineColorBlendAttachmentState( VULKAN_HPP_NAMESPACE::Bool32 blendEnable_ = {}, - VULKAN_HPP_NAMESPACE::BlendFactor srcColorBlendFactor_ = VULKAN_HPP_NAMESPACE::BlendFactor::eZero, - VULKAN_HPP_NAMESPACE::BlendFactor dstColorBlendFactor_ = VULKAN_HPP_NAMESPACE::BlendFactor::eZero, - VULKAN_HPP_NAMESPACE::BlendOp colorBlendOp_ = VULKAN_HPP_NAMESPACE::BlendOp::eAdd, - VULKAN_HPP_NAMESPACE::BlendFactor srcAlphaBlendFactor_ = VULKAN_HPP_NAMESPACE::BlendFactor::eZero, - VULKAN_HPP_NAMESPACE::BlendFactor dstAlphaBlendFactor_ = VULKAN_HPP_NAMESPACE::BlendFactor::eZero, - VULKAN_HPP_NAMESPACE::BlendOp alphaBlendOp_ = VULKAN_HPP_NAMESPACE::BlendOp::eAdd, - VULKAN_HPP_NAMESPACE::ColorComponentFlags colorWriteMask_ = {} ) VULKAN_HPP_NOEXCEPT - : blendEnable( blendEnable_ ) - , srcColorBlendFactor( srcColorBlendFactor_ ) - , dstColorBlendFactor( dstColorBlendFactor_ ) - , colorBlendOp( colorBlendOp_ ) - , srcAlphaBlendFactor( srcAlphaBlendFactor_ ) - , dstAlphaBlendFactor( dstAlphaBlendFactor_ ) - , alphaBlendOp( alphaBlendOp_ ) - , colorWriteMask( colorWriteMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineColorBlendAttachmentState( PipelineColorBlendAttachmentState const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendAttachmentState( VkPipelineColorBlendAttachmentState const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineColorBlendAttachmentState( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineColorBlendAttachmentState & operator=( PipelineColorBlendAttachmentState const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendAttachmentState & operator=( VkPipelineColorBlendAttachmentState const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & setBlendEnable( VULKAN_HPP_NAMESPACE::Bool32 blendEnable_ ) VULKAN_HPP_NOEXCEPT - { - blendEnable = blendEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & - setSrcColorBlendFactor( VULKAN_HPP_NAMESPACE::BlendFactor srcColorBlendFactor_ ) VULKAN_HPP_NOEXCEPT - { - srcColorBlendFactor = srcColorBlendFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & - setDstColorBlendFactor( VULKAN_HPP_NAMESPACE::BlendFactor dstColorBlendFactor_ ) VULKAN_HPP_NOEXCEPT - { - dstColorBlendFactor = dstColorBlendFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & setColorBlendOp( VULKAN_HPP_NAMESPACE::BlendOp colorBlendOp_ ) VULKAN_HPP_NOEXCEPT - { - colorBlendOp = colorBlendOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & - setSrcAlphaBlendFactor( VULKAN_HPP_NAMESPACE::BlendFactor srcAlphaBlendFactor_ ) VULKAN_HPP_NOEXCEPT - { - srcAlphaBlendFactor = srcAlphaBlendFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & - setDstAlphaBlendFactor( VULKAN_HPP_NAMESPACE::BlendFactor dstAlphaBlendFactor_ ) VULKAN_HPP_NOEXCEPT - { - dstAlphaBlendFactor = dstAlphaBlendFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & setAlphaBlendOp( VULKAN_HPP_NAMESPACE::BlendOp alphaBlendOp_ ) VULKAN_HPP_NOEXCEPT - { - alphaBlendOp = alphaBlendOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAttachmentState & - setColorWriteMask( VULKAN_HPP_NAMESPACE::ColorComponentFlags colorWriteMask_ ) VULKAN_HPP_NOEXCEPT - { - colorWriteMask = colorWriteMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineColorBlendAttachmentState const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineColorBlendAttachmentState &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - blendEnable, srcColorBlendFactor, dstColorBlendFactor, colorBlendOp, srcAlphaBlendFactor, dstAlphaBlendFactor, alphaBlendOp, colorWriteMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineColorBlendAttachmentState const & ) const = default; -#else - bool operator==( PipelineColorBlendAttachmentState const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( blendEnable == rhs.blendEnable ) && ( srcColorBlendFactor == rhs.srcColorBlendFactor ) && ( dstColorBlendFactor == rhs.dstColorBlendFactor ) && - ( colorBlendOp == rhs.colorBlendOp ) && ( srcAlphaBlendFactor == rhs.srcAlphaBlendFactor ) && ( dstAlphaBlendFactor == rhs.dstAlphaBlendFactor ) && - ( alphaBlendOp == rhs.alphaBlendOp ) && ( colorWriteMask == rhs.colorWriteMask ); -# endif - } - - bool operator!=( PipelineColorBlendAttachmentState const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Bool32 blendEnable = {}; - VULKAN_HPP_NAMESPACE::BlendFactor srcColorBlendFactor = VULKAN_HPP_NAMESPACE::BlendFactor::eZero; - VULKAN_HPP_NAMESPACE::BlendFactor dstColorBlendFactor = VULKAN_HPP_NAMESPACE::BlendFactor::eZero; - VULKAN_HPP_NAMESPACE::BlendOp colorBlendOp = VULKAN_HPP_NAMESPACE::BlendOp::eAdd; - VULKAN_HPP_NAMESPACE::BlendFactor srcAlphaBlendFactor = VULKAN_HPP_NAMESPACE::BlendFactor::eZero; - VULKAN_HPP_NAMESPACE::BlendFactor dstAlphaBlendFactor = VULKAN_HPP_NAMESPACE::BlendFactor::eZero; - VULKAN_HPP_NAMESPACE::BlendOp alphaBlendOp = VULKAN_HPP_NAMESPACE::BlendOp::eAdd; - VULKAN_HPP_NAMESPACE::ColorComponentFlags colorWriteMask = {}; - }; - - struct PipelineColorBlendStateCreateInfo - { - using NativeType = VkPipelineColorBlendStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineColorBlendStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 logicOpEnable_ = {}, - VULKAN_HPP_NAMESPACE::LogicOp logicOp_ = VULKAN_HPP_NAMESPACE::LogicOp::eClear, - uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineColorBlendAttachmentState * pAttachments_ = {}, - std::array const & blendConstants_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , logicOpEnable( logicOpEnable_ ) - , logicOp( logicOp_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , blendConstants( blendConstants_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo( PipelineColorBlendStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendStateCreateInfo( VkPipelineColorBlendStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineColorBlendStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineColorBlendStateCreateInfo( - VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags flags_, - VULKAN_HPP_NAMESPACE::Bool32 logicOpEnable_, - VULKAN_HPP_NAMESPACE::LogicOp logicOp_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_, - std::array const & blendConstants_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , logicOpEnable( logicOpEnable_ ) - , logicOp( logicOp_ ) - , attachmentCount( static_cast( attachments_.size() ) ) - , pAttachments( attachments_.data() ) - , blendConstants( blendConstants_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineColorBlendStateCreateInfo & operator=( PipelineColorBlendStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendStateCreateInfo & operator=( VkPipelineColorBlendStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setLogicOpEnable( VULKAN_HPP_NAMESPACE::Bool32 logicOpEnable_ ) VULKAN_HPP_NOEXCEPT - { - logicOpEnable = logicOpEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setLogicOp( VULKAN_HPP_NAMESPACE::LogicOp logicOp_ ) VULKAN_HPP_NOEXCEPT - { - logicOp = logicOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & - setPAttachments( const VULKAN_HPP_NAMESPACE::PipelineColorBlendAttachmentState * pAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pAttachments = pAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineColorBlendStateCreateInfo & setAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( attachments_.size() ); - pAttachments = attachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendStateCreateInfo & setBlendConstants( std::array blendConstants_ ) VULKAN_HPP_NOEXCEPT - { - blendConstants = blendConstants_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineColorBlendStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineColorBlendStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, logicOpEnable, logicOp, attachmentCount, pAttachments, blendConstants ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineColorBlendStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineColorBlendStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( logicOpEnable == rhs.logicOpEnable ) && - ( logicOp == rhs.logicOp ) && ( attachmentCount == rhs.attachmentCount ) && ( pAttachments == rhs.pAttachments ) && - ( blendConstants == rhs.blendConstants ); -# endif - } - - bool operator!=( PipelineColorBlendStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineColorBlendStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Bool32 logicOpEnable = {}; - VULKAN_HPP_NAMESPACE::LogicOp logicOp = VULKAN_HPP_NAMESPACE::LogicOp::eClear; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::PipelineColorBlendAttachmentState * pAttachments = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D blendConstants = {}; - }; - - template <> - struct CppType - { - using Type = PipelineColorBlendStateCreateInfo; - }; - - struct PipelineDynamicStateCreateInfo - { - using NativeType = VkPipelineDynamicStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineDynamicStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineDynamicStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlags flags_ = {}, - uint32_t dynamicStateCount_ = {}, - const VULKAN_HPP_NAMESPACE::DynamicState * pDynamicStates_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , dynamicStateCount( dynamicStateCount_ ) - , pDynamicStates( pDynamicStates_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineDynamicStateCreateInfo( PipelineDynamicStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDynamicStateCreateInfo( VkPipelineDynamicStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineDynamicStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineDynamicStateCreateInfo( VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dynamicStates_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), dynamicStateCount( static_cast( dynamicStates_.size() ) ), pDynamicStates( dynamicStates_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineDynamicStateCreateInfo & operator=( PipelineDynamicStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDynamicStateCreateInfo & operator=( VkPipelineDynamicStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineDynamicStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDynamicStateCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDynamicStateCreateInfo & setDynamicStateCount( uint32_t dynamicStateCount_ ) VULKAN_HPP_NOEXCEPT - { - dynamicStateCount = dynamicStateCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDynamicStateCreateInfo & setPDynamicStates( const VULKAN_HPP_NAMESPACE::DynamicState * pDynamicStates_ ) VULKAN_HPP_NOEXCEPT - { - pDynamicStates = pDynamicStates_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineDynamicStateCreateInfo & - setDynamicStates( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dynamicStates_ ) VULKAN_HPP_NOEXCEPT - { - dynamicStateCount = static_cast( dynamicStates_.size() ); - pDynamicStates = dynamicStates_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineDynamicStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineDynamicStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, dynamicStateCount, pDynamicStates ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineDynamicStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineDynamicStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( dynamicStateCount == rhs.dynamicStateCount ) && - ( pDynamicStates == rhs.pDynamicStates ); -# endif - } - - bool operator!=( PipelineDynamicStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineDynamicStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateFlags flags = {}; - uint32_t dynamicStateCount = {}; - const VULKAN_HPP_NAMESPACE::DynamicState * pDynamicStates = {}; - }; - - template <> - struct CppType - { - using Type = PipelineDynamicStateCreateInfo; - }; - - struct GraphicsPipelineCreateInfo - { - using NativeType = VkGraphicsPipelineCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGraphicsPipelineCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ = {}, - uint32_t stageCount_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo * pInputAssemblyState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo * pViewportState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo * pRasterizationState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo * pMultisampleState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo * pDepthStencilState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo * pColorBlendState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - uint32_t subpass_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( stageCount_ ) - , pStages( pStages_ ) - , pVertexInputState( pVertexInputState_ ) - , pInputAssemblyState( pInputAssemblyState_ ) - , pTessellationState( pTessellationState_ ) - , pViewportState( pViewportState_ ) - , pRasterizationState( pRasterizationState_ ) - , pMultisampleState( pMultisampleState_ ) - , pDepthStencilState( pDepthStencilState_ ) - , pColorBlendState( pColorBlendState_ ) - , pDynamicState( pDynamicState_ ) - , layout( layout_ ) - , renderPass( renderPass_ ) - , subpass( subpass_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo( GraphicsPipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineCreateInfo( VkGraphicsPipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : GraphicsPipelineCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsPipelineCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_, - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo * pInputAssemblyState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo * pViewportState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo * pRasterizationState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo * pMultisampleState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo * pDepthStencilState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo * pColorBlendState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - uint32_t subpass_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( static_cast( stages_.size() ) ) - , pStages( stages_.data() ) - , pVertexInputState( pVertexInputState_ ) - , pInputAssemblyState( pInputAssemblyState_ ) - , pTessellationState( pTessellationState_ ) - , pViewportState( pViewportState_ ) - , pRasterizationState( pRasterizationState_ ) - , pMultisampleState( pMultisampleState_ ) - , pDepthStencilState( pDepthStencilState_ ) - , pColorBlendState( pColorBlendState_ ) - , pDynamicState( pDynamicState_ ) - , layout( layout_ ) - , renderPass( renderPass_ ) - , subpass( subpass_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GraphicsPipelineCreateInfo & operator=( GraphicsPipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineCreateInfo & operator=( VkGraphicsPipelineCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setStageCount( uint32_t stageCount_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = stageCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setPStages( const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ ) VULKAN_HPP_NOEXCEPT - { - pStages = pStages_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsPipelineCreateInfo & - setStages( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = static_cast( stages_.size() ); - pStages = stages_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPVertexInputState( const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ ) VULKAN_HPP_NOEXCEPT - { - pVertexInputState = pVertexInputState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPInputAssemblyState( const VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo * pInputAssemblyState_ ) VULKAN_HPP_NOEXCEPT - { - pInputAssemblyState = pInputAssemblyState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPTessellationState( const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ ) VULKAN_HPP_NOEXCEPT - { - pTessellationState = pTessellationState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPViewportState( const VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo * pViewportState_ ) VULKAN_HPP_NOEXCEPT - { - pViewportState = pViewportState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPRasterizationState( const VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo * pRasterizationState_ ) VULKAN_HPP_NOEXCEPT - { - pRasterizationState = pRasterizationState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPMultisampleState( const VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo * pMultisampleState_ ) VULKAN_HPP_NOEXCEPT - { - pMultisampleState = pMultisampleState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPDepthStencilState( const VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo * pDepthStencilState_ ) VULKAN_HPP_NOEXCEPT - { - pDepthStencilState = pDepthStencilState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPColorBlendState( const VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo * pColorBlendState_ ) VULKAN_HPP_NOEXCEPT - { - pColorBlendState = pColorBlendState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & - setPDynamicState( const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ ) VULKAN_HPP_NOEXCEPT - { - pDynamicState = pDynamicState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setLayout( VULKAN_HPP_NAMESPACE::PipelineLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ ) VULKAN_HPP_NOEXCEPT - { - renderPass = renderPass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setSubpass( uint32_t subpass_ ) VULKAN_HPP_NOEXCEPT - { - subpass = subpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setBasePipelineHandle( VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineHandle = basePipelineHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineCreateInfo & setBasePipelineIndex( int32_t basePipelineIndex_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineIndex = basePipelineIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGraphicsPipelineCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGraphicsPipelineCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - stageCount, - pStages, - pVertexInputState, - pInputAssemblyState, - pTessellationState, - pViewportState, - pRasterizationState, - pMultisampleState, - pDepthStencilState, - pColorBlendState, - pDynamicState, - layout, - renderPass, - subpass, - basePipelineHandle, - basePipelineIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GraphicsPipelineCreateInfo const & ) const = default; -#else - bool operator==( GraphicsPipelineCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( stageCount == rhs.stageCount ) && ( pStages == rhs.pStages ) && - ( pVertexInputState == rhs.pVertexInputState ) && ( pInputAssemblyState == rhs.pInputAssemblyState ) && - ( pTessellationState == rhs.pTessellationState ) && ( pViewportState == rhs.pViewportState ) && - ( pRasterizationState == rhs.pRasterizationState ) && ( pMultisampleState == rhs.pMultisampleState ) && - ( pDepthStencilState == rhs.pDepthStencilState ) && ( pColorBlendState == rhs.pColorBlendState ) && ( pDynamicState == rhs.pDynamicState ) && - ( layout == rhs.layout ) && ( renderPass == rhs.renderPass ) && ( subpass == rhs.subpass ) && ( basePipelineHandle == rhs.basePipelineHandle ) && - ( basePipelineIndex == rhs.basePipelineIndex ); -# endif - } - - bool operator!=( GraphicsPipelineCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGraphicsPipelineCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags = {}; - uint32_t stageCount = {}; - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages = {}; - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState = {}; - const VULKAN_HPP_NAMESPACE::PipelineInputAssemblyStateCreateInfo * pInputAssemblyState = {}; - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState = {}; - const VULKAN_HPP_NAMESPACE::PipelineViewportStateCreateInfo * pViewportState = {}; - const VULKAN_HPP_NAMESPACE::PipelineRasterizationStateCreateInfo * pRasterizationState = {}; - const VULKAN_HPP_NAMESPACE::PipelineMultisampleStateCreateInfo * pMultisampleState = {}; - const VULKAN_HPP_NAMESPACE::PipelineDepthStencilStateCreateInfo * pDepthStencilState = {}; - const VULKAN_HPP_NAMESPACE::PipelineColorBlendStateCreateInfo * pColorBlendState = {}; - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout layout = {}; - VULKAN_HPP_NAMESPACE::RenderPass renderPass = {}; - uint32_t subpass = {}; - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle = {}; - int32_t basePipelineIndex = {}; - }; - - template <> - struct CppType - { - using Type = GraphicsPipelineCreateInfo; - }; - - struct GraphicsPipelineLibraryCreateInfoEXT - { - using NativeType = VkGraphicsPipelineLibraryCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGraphicsPipelineLibraryCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryCreateInfoEXT( VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryFlagsEXT flags_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR GraphicsPipelineLibraryCreateInfoEXT( GraphicsPipelineLibraryCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineLibraryCreateInfoEXT( VkGraphicsPipelineLibraryCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : GraphicsPipelineLibraryCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GraphicsPipelineLibraryCreateInfoEXT & operator=( GraphicsPipelineLibraryCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineLibraryCreateInfoEXT & operator=( VkGraphicsPipelineLibraryCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineLibraryCreateInfoEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineLibraryCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGraphicsPipelineLibraryCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGraphicsPipelineLibraryCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GraphicsPipelineLibraryCreateInfoEXT const & ) const = default; -#else - bool operator==( GraphicsPipelineLibraryCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( GraphicsPipelineLibraryCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGraphicsPipelineLibraryCreateInfoEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::GraphicsPipelineLibraryFlagsEXT flags = {}; - }; - - template <> - struct CppType - { - using Type = GraphicsPipelineLibraryCreateInfoEXT; - }; - - struct GraphicsShaderGroupCreateInfoNV - { - using NativeType = VkGraphicsShaderGroupCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGraphicsShaderGroupCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GraphicsShaderGroupCreateInfoNV( uint32_t stageCount_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stageCount( stageCount_ ) - , pStages( pStages_ ) - , pVertexInputState( pVertexInputState_ ) - , pTessellationState( pTessellationState_ ) - { - } - - VULKAN_HPP_CONSTEXPR GraphicsShaderGroupCreateInfoNV( GraphicsShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsShaderGroupCreateInfoNV( VkGraphicsShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : GraphicsShaderGroupCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsShaderGroupCreateInfoNV( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_, - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , stageCount( static_cast( stages_.size() ) ) - , pStages( stages_.data() ) - , pVertexInputState( pVertexInputState_ ) - , pTessellationState( pTessellationState_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GraphicsShaderGroupCreateInfoNV & operator=( GraphicsShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsShaderGroupCreateInfoNV & operator=( VkGraphicsShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GraphicsShaderGroupCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsShaderGroupCreateInfoNV & setStageCount( uint32_t stageCount_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = stageCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsShaderGroupCreateInfoNV & - setPStages( const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ ) VULKAN_HPP_NOEXCEPT - { - pStages = pStages_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsShaderGroupCreateInfoNV & - setStages( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = static_cast( stages_.size() ); - pStages = stages_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 GraphicsShaderGroupCreateInfoNV & - setPVertexInputState( const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState_ ) VULKAN_HPP_NOEXCEPT - { - pVertexInputState = pVertexInputState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsShaderGroupCreateInfoNV & - setPTessellationState( const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState_ ) VULKAN_HPP_NOEXCEPT - { - pTessellationState = pTessellationState_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGraphicsShaderGroupCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGraphicsShaderGroupCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stageCount, pStages, pVertexInputState, pTessellationState ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GraphicsShaderGroupCreateInfoNV const & ) const = default; -#else - bool operator==( GraphicsShaderGroupCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stageCount == rhs.stageCount ) && ( pStages == rhs.pStages ) && - ( pVertexInputState == rhs.pVertexInputState ) && ( pTessellationState == rhs.pTessellationState ); -# endif - } - - bool operator!=( GraphicsShaderGroupCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGraphicsShaderGroupCreateInfoNV; - const void * pNext = {}; - uint32_t stageCount = {}; - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages = {}; - const VULKAN_HPP_NAMESPACE::PipelineVertexInputStateCreateInfo * pVertexInputState = {}; - const VULKAN_HPP_NAMESPACE::PipelineTessellationStateCreateInfo * pTessellationState = {}; - }; - - template <> - struct CppType - { - using Type = GraphicsShaderGroupCreateInfoNV; - }; - - struct GraphicsPipelineShaderGroupsCreateInfoNV - { - using NativeType = VkGraphicsPipelineShaderGroupsCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eGraphicsPipelineShaderGroupsCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR GraphicsPipelineShaderGroupsCreateInfoNV( uint32_t groupCount_ = {}, - const VULKAN_HPP_NAMESPACE::GraphicsShaderGroupCreateInfoNV * pGroups_ = {}, - uint32_t pipelineCount_ = {}, - const VULKAN_HPP_NAMESPACE::Pipeline * pPipelines_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , groupCount( groupCount_ ) - , pGroups( pGroups_ ) - , pipelineCount( pipelineCount_ ) - , pPipelines( pPipelines_ ) - { - } - - VULKAN_HPP_CONSTEXPR GraphicsPipelineShaderGroupsCreateInfoNV( GraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineShaderGroupsCreateInfoNV( VkGraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : GraphicsPipelineShaderGroupsCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsPipelineShaderGroupsCreateInfoNV( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pipelines_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , groupCount( static_cast( groups_.size() ) ) - , pGroups( groups_.data() ) - , pipelineCount( static_cast( pipelines_.size() ) ) - , pPipelines( pipelines_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - GraphicsPipelineShaderGroupsCreateInfoNV & operator=( GraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - GraphicsPipelineShaderGroupsCreateInfoNV & operator=( VkGraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineShaderGroupsCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineShaderGroupsCreateInfoNV & setGroupCount( uint32_t groupCount_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = groupCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineShaderGroupsCreateInfoNV & - setPGroups( const VULKAN_HPP_NAMESPACE::GraphicsShaderGroupCreateInfoNV * pGroups_ ) VULKAN_HPP_NOEXCEPT - { - pGroups = pGroups_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsPipelineShaderGroupsCreateInfoNV & setGroups( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = static_cast( groups_.size() ); - pGroups = groups_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineShaderGroupsCreateInfoNV & setPipelineCount( uint32_t pipelineCount_ ) VULKAN_HPP_NOEXCEPT - { - pipelineCount = pipelineCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 GraphicsPipelineShaderGroupsCreateInfoNV & setPPipelines( const VULKAN_HPP_NAMESPACE::Pipeline * pPipelines_ ) VULKAN_HPP_NOEXCEPT - { - pPipelines = pPipelines_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - GraphicsPipelineShaderGroupsCreateInfoNV & - setPipelines( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pipelines_ ) VULKAN_HPP_NOEXCEPT - { - pipelineCount = static_cast( pipelines_.size() ); - pPipelines = pipelines_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkGraphicsPipelineShaderGroupsCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkGraphicsPipelineShaderGroupsCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, groupCount, pGroups, pipelineCount, pPipelines ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( GraphicsPipelineShaderGroupsCreateInfoNV const & ) const = default; -#else - bool operator==( GraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( groupCount == rhs.groupCount ) && ( pGroups == rhs.pGroups ) && - ( pipelineCount == rhs.pipelineCount ) && ( pPipelines == rhs.pPipelines ); -# endif - } - - bool operator!=( GraphicsPipelineShaderGroupsCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eGraphicsPipelineShaderGroupsCreateInfoNV; - const void * pNext = {}; - uint32_t groupCount = {}; - const VULKAN_HPP_NAMESPACE::GraphicsShaderGroupCreateInfoNV * pGroups = {}; - uint32_t pipelineCount = {}; - const VULKAN_HPP_NAMESPACE::Pipeline * pPipelines = {}; - }; - - template <> - struct CppType - { - using Type = GraphicsPipelineShaderGroupsCreateInfoNV; - }; - - struct XYColorEXT - { - using NativeType = VkXYColorEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR XYColorEXT( float x_ = {}, float y_ = {} ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - { - } - - VULKAN_HPP_CONSTEXPR XYColorEXT( XYColorEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XYColorEXT( VkXYColorEXT const & rhs ) VULKAN_HPP_NOEXCEPT : XYColorEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - XYColorEXT & operator=( XYColorEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XYColorEXT & operator=( VkXYColorEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 XYColorEXT & setX( float x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XYColorEXT & setY( float y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkXYColorEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkXYColorEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( XYColorEXT const & ) const = default; -#else - bool operator==( XYColorEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ); -# endif - } - - bool operator!=( XYColorEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float x = {}; - float y = {}; - }; - - struct HdrMetadataEXT - { - using NativeType = VkHdrMetadataEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eHdrMetadataEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR HdrMetadataEXT( VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryRed_ = {}, - VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryGreen_ = {}, - VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryBlue_ = {}, - VULKAN_HPP_NAMESPACE::XYColorEXT whitePoint_ = {}, - float maxLuminance_ = {}, - float minLuminance_ = {}, - float maxContentLightLevel_ = {}, - float maxFrameAverageLightLevel_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , displayPrimaryRed( displayPrimaryRed_ ) - , displayPrimaryGreen( displayPrimaryGreen_ ) - , displayPrimaryBlue( displayPrimaryBlue_ ) - , whitePoint( whitePoint_ ) - , maxLuminance( maxLuminance_ ) - , minLuminance( minLuminance_ ) - , maxContentLightLevel( maxContentLightLevel_ ) - , maxFrameAverageLightLevel( maxFrameAverageLightLevel_ ) - { - } - - VULKAN_HPP_CONSTEXPR HdrMetadataEXT( HdrMetadataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - HdrMetadataEXT( VkHdrMetadataEXT const & rhs ) VULKAN_HPP_NOEXCEPT : HdrMetadataEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - HdrMetadataEXT & operator=( HdrMetadataEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - HdrMetadataEXT & operator=( VkHdrMetadataEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setDisplayPrimaryRed( VULKAN_HPP_NAMESPACE::XYColorEXT const & displayPrimaryRed_ ) VULKAN_HPP_NOEXCEPT - { - displayPrimaryRed = displayPrimaryRed_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setDisplayPrimaryGreen( VULKAN_HPP_NAMESPACE::XYColorEXT const & displayPrimaryGreen_ ) VULKAN_HPP_NOEXCEPT - { - displayPrimaryGreen = displayPrimaryGreen_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setDisplayPrimaryBlue( VULKAN_HPP_NAMESPACE::XYColorEXT const & displayPrimaryBlue_ ) VULKAN_HPP_NOEXCEPT - { - displayPrimaryBlue = displayPrimaryBlue_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setWhitePoint( VULKAN_HPP_NAMESPACE::XYColorEXT const & whitePoint_ ) VULKAN_HPP_NOEXCEPT - { - whitePoint = whitePoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setMaxLuminance( float maxLuminance_ ) VULKAN_HPP_NOEXCEPT - { - maxLuminance = maxLuminance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setMinLuminance( float minLuminance_ ) VULKAN_HPP_NOEXCEPT - { - minLuminance = minLuminance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setMaxContentLightLevel( float maxContentLightLevel_ ) VULKAN_HPP_NOEXCEPT - { - maxContentLightLevel = maxContentLightLevel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HdrMetadataEXT & setMaxFrameAverageLightLevel( float maxFrameAverageLightLevel_ ) VULKAN_HPP_NOEXCEPT - { - maxFrameAverageLightLevel = maxFrameAverageLightLevel_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkHdrMetadataEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkHdrMetadataEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - displayPrimaryRed, - displayPrimaryGreen, - displayPrimaryBlue, - whitePoint, - maxLuminance, - minLuminance, - maxContentLightLevel, - maxFrameAverageLightLevel ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( HdrMetadataEXT const & ) const = default; -#else - bool operator==( HdrMetadataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( displayPrimaryRed == rhs.displayPrimaryRed ) && - ( displayPrimaryGreen == rhs.displayPrimaryGreen ) && ( displayPrimaryBlue == rhs.displayPrimaryBlue ) && ( whitePoint == rhs.whitePoint ) && - ( maxLuminance == rhs.maxLuminance ) && ( minLuminance == rhs.minLuminance ) && ( maxContentLightLevel == rhs.maxContentLightLevel ) && - ( maxFrameAverageLightLevel == rhs.maxFrameAverageLightLevel ); -# endif - } - - bool operator!=( HdrMetadataEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eHdrMetadataEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryRed = {}; - VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryGreen = {}; - VULKAN_HPP_NAMESPACE::XYColorEXT displayPrimaryBlue = {}; - VULKAN_HPP_NAMESPACE::XYColorEXT whitePoint = {}; - float maxLuminance = {}; - float minLuminance = {}; - float maxContentLightLevel = {}; - float maxFrameAverageLightLevel = {}; - }; - - template <> - struct CppType - { - using Type = HdrMetadataEXT; - }; - - struct HeadlessSurfaceCreateInfoEXT - { - using NativeType = VkHeadlessSurfaceCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eHeadlessSurfaceCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR HeadlessSurfaceCreateInfoEXT( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateFlagsEXT flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR HeadlessSurfaceCreateInfoEXT( HeadlessSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - HeadlessSurfaceCreateInfoEXT( VkHeadlessSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : HeadlessSurfaceCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - HeadlessSurfaceCreateInfoEXT & operator=( HeadlessSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - HeadlessSurfaceCreateInfoEXT & operator=( VkHeadlessSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 HeadlessSurfaceCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 HeadlessSurfaceCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkHeadlessSurfaceCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkHeadlessSurfaceCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( HeadlessSurfaceCreateInfoEXT const & ) const = default; -#else - bool operator==( HeadlessSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( HeadlessSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eHeadlessSurfaceCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::HeadlessSurfaceCreateFlagsEXT flags = {}; - }; - - template <> - struct CppType - { - using Type = HeadlessSurfaceCreateInfoEXT; - }; - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - struct IOSSurfaceCreateInfoMVK - { - using NativeType = VkIOSSurfaceCreateInfoMVK; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eIosSurfaceCreateInfoMVK; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR IOSSurfaceCreateInfoMVK( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateFlagsMVK flags_ = {}, - const void * pView_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pView( pView_ ) - { - } - - VULKAN_HPP_CONSTEXPR IOSSurfaceCreateInfoMVK( IOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IOSSurfaceCreateInfoMVK( VkIOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT - : IOSSurfaceCreateInfoMVK( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - IOSSurfaceCreateInfoMVK & operator=( IOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IOSSurfaceCreateInfoMVK & operator=( VkIOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 IOSSurfaceCreateInfoMVK & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IOSSurfaceCreateInfoMVK & setFlags( VULKAN_HPP_NAMESPACE::IOSSurfaceCreateFlagsMVK flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IOSSurfaceCreateInfoMVK & setPView( const void * pView_ ) VULKAN_HPP_NOEXCEPT - { - pView = pView_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkIOSSurfaceCreateInfoMVK const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkIOSSurfaceCreateInfoMVK &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pView ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( IOSSurfaceCreateInfoMVK const & ) const = default; -# else - bool operator==( IOSSurfaceCreateInfoMVK const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pView == rhs.pView ); -# endif - } - - bool operator!=( IOSSurfaceCreateInfoMVK const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eIosSurfaceCreateInfoMVK; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::IOSSurfaceCreateFlagsMVK flags = {}; - const void * pView = {}; - }; - - template <> - struct CppType - { - using Type = IOSSurfaceCreateInfoMVK; - }; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - - struct ImageBlit - { - using NativeType = VkImageBlit; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ImageBlit( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - std::array const & srcOffsets_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - std::array const & dstOffsets_ = {} ) VULKAN_HPP_NOEXCEPT - : srcSubresource( srcSubresource_ ) - , srcOffsets( srcOffsets_ ) - , dstSubresource( dstSubresource_ ) - , dstOffsets( dstOffsets_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit( ImageBlit const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageBlit( VkImageBlit const & rhs ) VULKAN_HPP_NOEXCEPT : ImageBlit( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageBlit & operator=( ImageBlit const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageBlit & operator=( VkImageBlit const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageBlit & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit & setSrcOffsets( std::array const & srcOffsets_ ) VULKAN_HPP_NOEXCEPT - { - srcOffsets = srcOffsets_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageBlit & setDstOffsets( std::array const & dstOffsets_ ) VULKAN_HPP_NOEXCEPT - { - dstOffsets = dstOffsets_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageBlit const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageBlit &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( srcSubresource, srcOffsets, dstSubresource, dstOffsets ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageBlit const & ) const = default; -#else - bool operator==( ImageBlit const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( srcSubresource == rhs.srcSubresource ) && ( srcOffsets == rhs.srcOffsets ) && ( dstSubresource == rhs.dstSubresource ) && - ( dstOffsets == rhs.dstOffsets ); -# endif - } - - bool operator!=( ImageBlit const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D srcOffsets = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D dstOffsets = {}; - }; - - struct ImageCompressionControlEXT - { - using NativeType = VkImageCompressionControlEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageCompressionControlEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageCompressionControlEXT( VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT flags_ = {}, - uint32_t compressionControlPlaneCount_ = {}, - VULKAN_HPP_NAMESPACE::ImageCompressionFixedRateFlagsEXT * pFixedRateFlags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , compressionControlPlaneCount( compressionControlPlaneCount_ ) - , pFixedRateFlags( pFixedRateFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageCompressionControlEXT( ImageCompressionControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCompressionControlEXT( VkImageCompressionControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageCompressionControlEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageCompressionControlEXT( VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & fixedRateFlags_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , compressionControlPlaneCount( static_cast( fixedRateFlags_.size() ) ) - , pFixedRateFlags( fixedRateFlags_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageCompressionControlEXT & operator=( ImageCompressionControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCompressionControlEXT & operator=( VkImageCompressionControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageCompressionControlEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCompressionControlEXT & setFlags( VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCompressionControlEXT & setCompressionControlPlaneCount( uint32_t compressionControlPlaneCount_ ) VULKAN_HPP_NOEXCEPT - { - compressionControlPlaneCount = compressionControlPlaneCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCompressionControlEXT & - setPFixedRateFlags( VULKAN_HPP_NAMESPACE::ImageCompressionFixedRateFlagsEXT * pFixedRateFlags_ ) VULKAN_HPP_NOEXCEPT - { - pFixedRateFlags = pFixedRateFlags_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageCompressionControlEXT & setFixedRateFlags( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & fixedRateFlags_ ) VULKAN_HPP_NOEXCEPT - { - compressionControlPlaneCount = static_cast( fixedRateFlags_.size() ); - pFixedRateFlags = fixedRateFlags_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageCompressionControlEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageCompressionControlEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, compressionControlPlaneCount, pFixedRateFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageCompressionControlEXT const & ) const = default; -#else - bool operator==( ImageCompressionControlEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( compressionControlPlaneCount == rhs.compressionControlPlaneCount ) && ( pFixedRateFlags == rhs.pFixedRateFlags ); -# endif - } - - bool operator!=( ImageCompressionControlEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageCompressionControlEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT flags = {}; - uint32_t compressionControlPlaneCount = {}; - VULKAN_HPP_NAMESPACE::ImageCompressionFixedRateFlagsEXT * pFixedRateFlags = {}; - }; - - template <> - struct CppType - { - using Type = ImageCompressionControlEXT; - }; - - struct ImageCompressionPropertiesEXT - { - using NativeType = VkImageCompressionPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageCompressionPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageCompressionPropertiesEXT( VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT imageCompressionFlags_ = {}, - VULKAN_HPP_NAMESPACE::ImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageCompressionFlags( imageCompressionFlags_ ) - , imageCompressionFixedRateFlags( imageCompressionFixedRateFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageCompressionPropertiesEXT( ImageCompressionPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCompressionPropertiesEXT( VkImageCompressionPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageCompressionPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageCompressionPropertiesEXT & operator=( ImageCompressionPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCompressionPropertiesEXT & operator=( VkImageCompressionPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkImageCompressionPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageCompressionPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageCompressionFlags, imageCompressionFixedRateFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageCompressionPropertiesEXT const & ) const = default; -#else - bool operator==( ImageCompressionPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageCompressionFlags == rhs.imageCompressionFlags ) && - ( imageCompressionFixedRateFlags == rhs.imageCompressionFixedRateFlags ); -# endif - } - - bool operator!=( ImageCompressionPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageCompressionPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageCompressionFlagsEXT imageCompressionFlags = {}; - VULKAN_HPP_NAMESPACE::ImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags = {}; - }; - - template <> - struct CppType - { - using Type = ImageCompressionPropertiesEXT; - }; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImageFormatConstraintsInfoFUCHSIA - { - using NativeType = VkImageFormatConstraintsInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageFormatConstraintsInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageFormatConstraintsInfoFUCHSIA( VULKAN_HPP_NAMESPACE::ImageCreateInfo imageCreateInfo_ = {}, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures_ = {}, - VULKAN_HPP_NAMESPACE::ImageFormatConstraintsFlagsFUCHSIA flags_ = {}, - uint64_t sysmemPixelFormat_ = {}, - uint32_t colorSpaceCount_ = {}, - const VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA * pColorSpaces_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageCreateInfo( imageCreateInfo_ ) - , requiredFormatFeatures( requiredFormatFeatures_ ) - , flags( flags_ ) - , sysmemPixelFormat( sysmemPixelFormat_ ) - , colorSpaceCount( colorSpaceCount_ ) - , pColorSpaces( pColorSpaces_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageFormatConstraintsInfoFUCHSIA( ImageFormatConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatConstraintsInfoFUCHSIA( VkImageFormatConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageFormatConstraintsInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageFormatConstraintsInfoFUCHSIA( VULKAN_HPP_NAMESPACE::ImageCreateInfo imageCreateInfo_, - VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures_, - VULKAN_HPP_NAMESPACE::ImageFormatConstraintsFlagsFUCHSIA flags_, - uint64_t sysmemPixelFormat_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorSpaces_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , imageCreateInfo( imageCreateInfo_ ) - , requiredFormatFeatures( requiredFormatFeatures_ ) - , flags( flags_ ) - , sysmemPixelFormat( sysmemPixelFormat_ ) - , colorSpaceCount( static_cast( colorSpaces_.size() ) ) - , pColorSpaces( colorSpaces_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageFormatConstraintsInfoFUCHSIA & operator=( ImageFormatConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatConstraintsInfoFUCHSIA & operator=( VkImageFormatConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & - setImageCreateInfo( VULKAN_HPP_NAMESPACE::ImageCreateInfo const & imageCreateInfo_ ) VULKAN_HPP_NOEXCEPT - { - imageCreateInfo = imageCreateInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & - setRequiredFormatFeatures( VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures_ ) VULKAN_HPP_NOEXCEPT - { - requiredFormatFeatures = requiredFormatFeatures_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & setFlags( VULKAN_HPP_NAMESPACE::ImageFormatConstraintsFlagsFUCHSIA flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & setSysmemPixelFormat( uint64_t sysmemPixelFormat_ ) VULKAN_HPP_NOEXCEPT - { - sysmemPixelFormat = sysmemPixelFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & setColorSpaceCount( uint32_t colorSpaceCount_ ) VULKAN_HPP_NOEXCEPT - { - colorSpaceCount = colorSpaceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatConstraintsInfoFUCHSIA & - setPColorSpaces( const VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA * pColorSpaces_ ) VULKAN_HPP_NOEXCEPT - { - pColorSpaces = pColorSpaces_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageFormatConstraintsInfoFUCHSIA & setColorSpaces( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorSpaces_ ) VULKAN_HPP_NOEXCEPT - { - colorSpaceCount = static_cast( colorSpaces_.size() ); - pColorSpaces = colorSpaces_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageFormatConstraintsInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageFormatConstraintsInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageCreateInfo, requiredFormatFeatures, flags, sysmemPixelFormat, colorSpaceCount, pColorSpaces ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageFormatConstraintsInfoFUCHSIA const & ) const = default; -# else - bool operator==( ImageFormatConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageCreateInfo == rhs.imageCreateInfo ) && - ( requiredFormatFeatures == rhs.requiredFormatFeatures ) && ( flags == rhs.flags ) && ( sysmemPixelFormat == rhs.sysmemPixelFormat ) && - ( colorSpaceCount == rhs.colorSpaceCount ) && ( pColorSpaces == rhs.pColorSpaces ); -# endif - } - - bool operator!=( ImageFormatConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageFormatConstraintsInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageCreateInfo imageCreateInfo = {}; - VULKAN_HPP_NAMESPACE::FormatFeatureFlags requiredFormatFeatures = {}; - VULKAN_HPP_NAMESPACE::ImageFormatConstraintsFlagsFUCHSIA flags = {}; - uint64_t sysmemPixelFormat = {}; - uint32_t colorSpaceCount = {}; - const VULKAN_HPP_NAMESPACE::SysmemColorSpaceFUCHSIA * pColorSpaces = {}; - }; - - template <> - struct CppType - { - using Type = ImageFormatConstraintsInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImageConstraintsInfoFUCHSIA - { - using NativeType = VkImageConstraintsInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageConstraintsInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFUCHSIA( uint32_t formatConstraintsCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageFormatConstraintsInfoFUCHSIA * pFormatConstraints_ = {}, - VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints_ = {}, - VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFlagsFUCHSIA flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , formatConstraintsCount( formatConstraintsCount_ ) - , pFormatConstraints( pFormatConstraints_ ) - , bufferCollectionConstraints( bufferCollectionConstraints_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageConstraintsInfoFUCHSIA( ImageConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageConstraintsInfoFUCHSIA( VkImageConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageConstraintsInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageConstraintsInfoFUCHSIA( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & formatConstraints_, - VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints_ = {}, - VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFlagsFUCHSIA flags_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , formatConstraintsCount( static_cast( formatConstraints_.size() ) ) - , pFormatConstraints( formatConstraints_.data() ) - , bufferCollectionConstraints( bufferCollectionConstraints_ ) - , flags( flags_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageConstraintsInfoFUCHSIA & operator=( ImageConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageConstraintsInfoFUCHSIA & operator=( VkImageConstraintsInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageConstraintsInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageConstraintsInfoFUCHSIA & setFormatConstraintsCount( uint32_t formatConstraintsCount_ ) VULKAN_HPP_NOEXCEPT - { - formatConstraintsCount = formatConstraintsCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageConstraintsInfoFUCHSIA & - setPFormatConstraints( const VULKAN_HPP_NAMESPACE::ImageFormatConstraintsInfoFUCHSIA * pFormatConstraints_ ) VULKAN_HPP_NOEXCEPT - { - pFormatConstraints = pFormatConstraints_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageConstraintsInfoFUCHSIA & setFormatConstraints( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & formatConstraints_ ) - VULKAN_HPP_NOEXCEPT - { - formatConstraintsCount = static_cast( formatConstraints_.size() ); - pFormatConstraints = formatConstraints_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 ImageConstraintsInfoFUCHSIA & - setBufferCollectionConstraints( VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA const & bufferCollectionConstraints_ ) VULKAN_HPP_NOEXCEPT - { - bufferCollectionConstraints = bufferCollectionConstraints_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageConstraintsInfoFUCHSIA & setFlags( VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFlagsFUCHSIA flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageConstraintsInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageConstraintsInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, formatConstraintsCount, pFormatConstraints, bufferCollectionConstraints, flags ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageConstraintsInfoFUCHSIA const & ) const = default; -# else - bool operator==( ImageConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( formatConstraintsCount == rhs.formatConstraintsCount ) && - ( pFormatConstraints == rhs.pFormatConstraints ) && ( bufferCollectionConstraints == rhs.bufferCollectionConstraints ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( ImageConstraintsInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageConstraintsInfoFUCHSIA; - const void * pNext = {}; - uint32_t formatConstraintsCount = {}; - const VULKAN_HPP_NAMESPACE::ImageFormatConstraintsInfoFUCHSIA * pFormatConstraints = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints = {}; - VULKAN_HPP_NAMESPACE::ImageConstraintsInfoFlagsFUCHSIA flags = {}; - }; - - template <> - struct CppType - { - using Type = ImageConstraintsInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct ImageCopy - { - using NativeType = VkImageCopy; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageCopy( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {} ) VULKAN_HPP_NOEXCEPT - : srcSubresource( srcSubresource_ ) - , srcOffset( srcOffset_ ) - , dstSubresource( dstSubresource_ ) - , dstOffset( dstOffset_ ) - , extent( extent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageCopy( ImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCopy( VkImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT : ImageCopy( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageCopy & operator=( ImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageCopy & operator=( VkImageCopy const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageCopy & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy & setSrcOffset( VULKAN_HPP_NAMESPACE::Offset3D const & srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy & setDstOffset( VULKAN_HPP_NAMESPACE::Offset3D const & dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageCopy & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageCopy const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageCopy &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( srcSubresource, srcOffset, dstSubresource, dstOffset, extent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageCopy const & ) const = default; -#else - bool operator==( ImageCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( srcSubresource == rhs.srcSubresource ) && ( srcOffset == rhs.srcOffset ) && ( dstSubresource == rhs.dstSubresource ) && - ( dstOffset == rhs.dstOffset ) && ( extent == rhs.extent ); -# endif - } - - bool operator!=( ImageCopy const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D srcOffset = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D dstOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - }; - - struct SubresourceLayout - { - using NativeType = VkSubresourceLayout; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubresourceLayout( VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize rowPitch_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize arrayPitch_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize depthPitch_ = {} ) VULKAN_HPP_NOEXCEPT - : offset( offset_ ) - , size( size_ ) - , rowPitch( rowPitch_ ) - , arrayPitch( arrayPitch_ ) - , depthPitch( depthPitch_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubresourceLayout( SubresourceLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubresourceLayout( VkSubresourceLayout const & rhs ) VULKAN_HPP_NOEXCEPT : SubresourceLayout( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubresourceLayout & operator=( SubresourceLayout const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubresourceLayout & operator=( VkSubresourceLayout const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSubresourceLayout const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubresourceLayout &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( offset, size, rowPitch, arrayPitch, depthPitch ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubresourceLayout const & ) const = default; -#else - bool operator==( SubresourceLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( offset == rhs.offset ) && ( size == rhs.size ) && ( rowPitch == rhs.rowPitch ) && ( arrayPitch == rhs.arrayPitch ) && - ( depthPitch == rhs.depthPitch ); -# endif - } - - bool operator!=( SubresourceLayout const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::DeviceSize rowPitch = {}; - VULKAN_HPP_NAMESPACE::DeviceSize arrayPitch = {}; - VULKAN_HPP_NAMESPACE::DeviceSize depthPitch = {}; - }; - - struct ImageDrmFormatModifierExplicitCreateInfoEXT - { - using NativeType = VkImageDrmFormatModifierExplicitCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageDrmFormatModifierExplicitCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierExplicitCreateInfoEXT( uint64_t drmFormatModifier_ = {}, - uint32_t drmFormatModifierPlaneCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubresourceLayout * pPlaneLayouts_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifier( drmFormatModifier_ ) - , drmFormatModifierPlaneCount( drmFormatModifierPlaneCount_ ) - , pPlaneLayouts( pPlaneLayouts_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierExplicitCreateInfoEXT( ImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierExplicitCreateInfoEXT( VkImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageDrmFormatModifierExplicitCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageDrmFormatModifierExplicitCreateInfoEXT( - uint64_t drmFormatModifier_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & planeLayouts_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , drmFormatModifier( drmFormatModifier_ ) - , drmFormatModifierPlaneCount( static_cast( planeLayouts_.size() ) ) - , pPlaneLayouts( planeLayouts_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageDrmFormatModifierExplicitCreateInfoEXT & operator=( ImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierExplicitCreateInfoEXT & operator=( VkImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierExplicitCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierExplicitCreateInfoEXT & setDrmFormatModifier( uint64_t drmFormatModifier_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifier = drmFormatModifier_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierExplicitCreateInfoEXT & - setDrmFormatModifierPlaneCount( uint32_t drmFormatModifierPlaneCount_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifierPlaneCount = drmFormatModifierPlaneCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierExplicitCreateInfoEXT & - setPPlaneLayouts( const VULKAN_HPP_NAMESPACE::SubresourceLayout * pPlaneLayouts_ ) VULKAN_HPP_NOEXCEPT - { - pPlaneLayouts = pPlaneLayouts_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageDrmFormatModifierExplicitCreateInfoEXT & - setPlaneLayouts( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & planeLayouts_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifierPlaneCount = static_cast( planeLayouts_.size() ); - pPlaneLayouts = planeLayouts_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageDrmFormatModifierExplicitCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageDrmFormatModifierExplicitCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifier, drmFormatModifierPlaneCount, pPlaneLayouts ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageDrmFormatModifierExplicitCreateInfoEXT const & ) const = default; -#else - bool operator==( ImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifier == rhs.drmFormatModifier ) && - ( drmFormatModifierPlaneCount == rhs.drmFormatModifierPlaneCount ) && ( pPlaneLayouts == rhs.pPlaneLayouts ); -# endif - } - - bool operator!=( ImageDrmFormatModifierExplicitCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageDrmFormatModifierExplicitCreateInfoEXT; - const void * pNext = {}; - uint64_t drmFormatModifier = {}; - uint32_t drmFormatModifierPlaneCount = {}; - const VULKAN_HPP_NAMESPACE::SubresourceLayout * pPlaneLayouts = {}; - }; - - template <> - struct CppType - { - using Type = ImageDrmFormatModifierExplicitCreateInfoEXT; - }; - - struct ImageDrmFormatModifierListCreateInfoEXT - { - using NativeType = VkImageDrmFormatModifierListCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageDrmFormatModifierListCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierListCreateInfoEXT( uint32_t drmFormatModifierCount_ = {}, - const uint64_t * pDrmFormatModifiers_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifierCount( drmFormatModifierCount_ ) - , pDrmFormatModifiers( pDrmFormatModifiers_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierListCreateInfoEXT( ImageDrmFormatModifierListCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierListCreateInfoEXT( VkImageDrmFormatModifierListCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageDrmFormatModifierListCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageDrmFormatModifierListCreateInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & drmFormatModifiers_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), drmFormatModifierCount( static_cast( drmFormatModifiers_.size() ) ), pDrmFormatModifiers( drmFormatModifiers_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageDrmFormatModifierListCreateInfoEXT & operator=( ImageDrmFormatModifierListCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierListCreateInfoEXT & operator=( VkImageDrmFormatModifierListCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierListCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierListCreateInfoEXT & setDrmFormatModifierCount( uint32_t drmFormatModifierCount_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifierCount = drmFormatModifierCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageDrmFormatModifierListCreateInfoEXT & setPDrmFormatModifiers( const uint64_t * pDrmFormatModifiers_ ) VULKAN_HPP_NOEXCEPT - { - pDrmFormatModifiers = pDrmFormatModifiers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageDrmFormatModifierListCreateInfoEXT & - setDrmFormatModifiers( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & drmFormatModifiers_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifierCount = static_cast( drmFormatModifiers_.size() ); - pDrmFormatModifiers = drmFormatModifiers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageDrmFormatModifierListCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageDrmFormatModifierListCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifierCount, pDrmFormatModifiers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageDrmFormatModifierListCreateInfoEXT const & ) const = default; -#else - bool operator==( ImageDrmFormatModifierListCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifierCount == rhs.drmFormatModifierCount ) && - ( pDrmFormatModifiers == rhs.pDrmFormatModifiers ); -# endif - } - - bool operator!=( ImageDrmFormatModifierListCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageDrmFormatModifierListCreateInfoEXT; - const void * pNext = {}; - uint32_t drmFormatModifierCount = {}; - const uint64_t * pDrmFormatModifiers = {}; - }; - - template <> - struct CppType - { - using Type = ImageDrmFormatModifierListCreateInfoEXT; - }; - - struct ImageDrmFormatModifierPropertiesEXT - { - using NativeType = VkImageDrmFormatModifierPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageDrmFormatModifierPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierPropertiesEXT( uint64_t drmFormatModifier_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifier( drmFormatModifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageDrmFormatModifierPropertiesEXT( ImageDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierPropertiesEXT( VkImageDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageDrmFormatModifierPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageDrmFormatModifierPropertiesEXT & operator=( ImageDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageDrmFormatModifierPropertiesEXT & operator=( VkImageDrmFormatModifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkImageDrmFormatModifierPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageDrmFormatModifierPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageDrmFormatModifierPropertiesEXT const & ) const = default; -#else - bool operator==( ImageDrmFormatModifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifier == rhs.drmFormatModifier ); -# endif - } - - bool operator!=( ImageDrmFormatModifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageDrmFormatModifierPropertiesEXT; - void * pNext = {}; - uint64_t drmFormatModifier = {}; - }; - - template <> - struct CppType - { - using Type = ImageDrmFormatModifierPropertiesEXT; - }; - - struct ImageFormatListCreateInfo - { - using NativeType = VkImageFormatListCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageFormatListCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageFormatListCreateInfo( uint32_t viewFormatCount_ = {}, - const VULKAN_HPP_NAMESPACE::Format * pViewFormats_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , viewFormatCount( viewFormatCount_ ) - , pViewFormats( pViewFormats_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageFormatListCreateInfo( ImageFormatListCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatListCreateInfo( VkImageFormatListCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageFormatListCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageFormatListCreateInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewFormats_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), viewFormatCount( static_cast( viewFormats_.size() ) ), pViewFormats( viewFormats_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageFormatListCreateInfo & operator=( ImageFormatListCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatListCreateInfo & operator=( VkImageFormatListCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageFormatListCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatListCreateInfo & setViewFormatCount( uint32_t viewFormatCount_ ) VULKAN_HPP_NOEXCEPT - { - viewFormatCount = viewFormatCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageFormatListCreateInfo & setPViewFormats( const VULKAN_HPP_NAMESPACE::Format * pViewFormats_ ) VULKAN_HPP_NOEXCEPT - { - pViewFormats = pViewFormats_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ImageFormatListCreateInfo & - setViewFormats( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewFormats_ ) VULKAN_HPP_NOEXCEPT - { - viewFormatCount = static_cast( viewFormats_.size() ); - pViewFormats = viewFormats_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageFormatListCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageFormatListCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, viewFormatCount, pViewFormats ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageFormatListCreateInfo const & ) const = default; -#else - bool operator==( ImageFormatListCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( viewFormatCount == rhs.viewFormatCount ) && ( pViewFormats == rhs.pViewFormats ); -# endif - } - - bool operator!=( ImageFormatListCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageFormatListCreateInfo; - const void * pNext = {}; - uint32_t viewFormatCount = {}; - const VULKAN_HPP_NAMESPACE::Format * pViewFormats = {}; - }; - - template <> - struct CppType - { - using Type = ImageFormatListCreateInfo; - }; - using ImageFormatListCreateInfoKHR = ImageFormatListCreateInfo; - - struct ImageFormatProperties2 - { - using NativeType = VkImageFormatProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageFormatProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageFormatProperties2( VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageFormatProperties( imageFormatProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageFormatProperties2( ImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatProperties2( VkImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageFormatProperties2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageFormatProperties2 & operator=( ImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageFormatProperties2 & operator=( VkImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkImageFormatProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageFormatProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageFormatProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageFormatProperties2 const & ) const = default; -#else - bool operator==( ImageFormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageFormatProperties == rhs.imageFormatProperties ); -# endif - } - - bool operator!=( ImageFormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageFormatProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageFormatProperties imageFormatProperties = {}; - }; - - template <> - struct CppType - { - using Type = ImageFormatProperties2; - }; - using ImageFormatProperties2KHR = ImageFormatProperties2; - - struct ImageMemoryBarrier - { - using NativeType = VkImageMemoryBarrier; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageMemoryBarrier; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageMemoryBarrier( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout oldLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ImageLayout newLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t srcQueueFamilyIndex_ = {}, - uint32_t dstQueueFamilyIndex_ = {}, - VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcAccessMask( srcAccessMask_ ) - , dstAccessMask( dstAccessMask_ ) - , oldLayout( oldLayout_ ) - , newLayout( newLayout_ ) - , srcQueueFamilyIndex( srcQueueFamilyIndex_ ) - , dstQueueFamilyIndex( dstQueueFamilyIndex_ ) - , image( image_ ) - , subresourceRange( subresourceRange_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageMemoryBarrier( ImageMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryBarrier( VkImageMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT : ImageMemoryBarrier( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageMemoryBarrier & operator=( ImageMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryBarrier & operator=( VkImageMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setOldLayout( VULKAN_HPP_NAMESPACE::ImageLayout oldLayout_ ) VULKAN_HPP_NOEXCEPT - { - oldLayout = oldLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setNewLayout( VULKAN_HPP_NAMESPACE::ImageLayout newLayout_ ) VULKAN_HPP_NOEXCEPT - { - newLayout = newLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setSrcQueueFamilyIndex( uint32_t srcQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - srcQueueFamilyIndex = srcQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setDstQueueFamilyIndex( uint32_t dstQueueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - dstQueueFamilyIndex = dstQueueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryBarrier & - setSubresourceRange( VULKAN_HPP_NAMESPACE::ImageSubresourceRange const & subresourceRange_ ) VULKAN_HPP_NOEXCEPT - { - subresourceRange = subresourceRange_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageMemoryBarrier const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageMemoryBarrier &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcAccessMask, dstAccessMask, oldLayout, newLayout, srcQueueFamilyIndex, dstQueueFamilyIndex, image, subresourceRange ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageMemoryBarrier const & ) const = default; -#else - bool operator==( ImageMemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcAccessMask == rhs.srcAccessMask ) && ( dstAccessMask == rhs.dstAccessMask ) && - ( oldLayout == rhs.oldLayout ) && ( newLayout == rhs.newLayout ) && ( srcQueueFamilyIndex == rhs.srcQueueFamilyIndex ) && - ( dstQueueFamilyIndex == rhs.dstQueueFamilyIndex ) && ( image == rhs.image ) && ( subresourceRange == rhs.subresourceRange ); -# endif - } - - bool operator!=( ImageMemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageMemoryBarrier; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask = {}; - VULKAN_HPP_NAMESPACE::ImageLayout oldLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ImageLayout newLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t srcQueueFamilyIndex = {}; - uint32_t dstQueueFamilyIndex = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange = {}; - }; - - template <> - struct CppType - { - using Type = ImageMemoryBarrier; - }; - - struct ImageMemoryRequirementsInfo2 - { - using NativeType = VkImageMemoryRequirementsInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageMemoryRequirementsInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageMemoryRequirementsInfo2( VULKAN_HPP_NAMESPACE::Image image_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageMemoryRequirementsInfo2( ImageMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryRequirementsInfo2( VkImageMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageMemoryRequirementsInfo2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageMemoryRequirementsInfo2 & operator=( ImageMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageMemoryRequirementsInfo2 & operator=( VkImageMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageMemoryRequirementsInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageMemoryRequirementsInfo2 & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageMemoryRequirementsInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageMemoryRequirementsInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageMemoryRequirementsInfo2 const & ) const = default; -#else - bool operator==( ImageMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ); -# endif - } - - bool operator!=( ImageMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageMemoryRequirementsInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - }; - - template <> - struct CppType - { - using Type = ImageMemoryRequirementsInfo2; - }; - using ImageMemoryRequirementsInfo2KHR = ImageMemoryRequirementsInfo2; - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImagePipeSurfaceCreateInfoFUCHSIA - { - using NativeType = VkImagePipeSurfaceCreateInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImagepipeSurfaceCreateInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImagePipeSurfaceCreateInfoFUCHSIA( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateFlagsFUCHSIA flags_ = {}, - zx_handle_t imagePipeHandle_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , imagePipeHandle( imagePipeHandle_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImagePipeSurfaceCreateInfoFUCHSIA( ImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImagePipeSurfaceCreateInfoFUCHSIA( VkImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImagePipeSurfaceCreateInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImagePipeSurfaceCreateInfoFUCHSIA & operator=( ImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImagePipeSurfaceCreateInfoFUCHSIA & operator=( VkImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImagePipeSurfaceCreateInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImagePipeSurfaceCreateInfoFUCHSIA & setFlags( VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateFlagsFUCHSIA flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImagePipeSurfaceCreateInfoFUCHSIA & setImagePipeHandle( zx_handle_t imagePipeHandle_ ) VULKAN_HPP_NOEXCEPT - { - imagePipeHandle = imagePipeHandle_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImagePipeSurfaceCreateInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImagePipeSurfaceCreateInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, imagePipeHandle ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( ImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &imagePipeHandle, &rhs.imagePipeHandle, sizeof( zx_handle_t ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( ImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( memcmp( &imagePipeHandle, &rhs.imagePipeHandle, sizeof( zx_handle_t ) ) == 0 ); - } - - bool operator!=( ImagePipeSurfaceCreateInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImagepipeSurfaceCreateInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImagePipeSurfaceCreateFlagsFUCHSIA flags = {}; - zx_handle_t imagePipeHandle = {}; - }; - - template <> - struct CppType - { - using Type = ImagePipeSurfaceCreateInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct ImagePlaneMemoryRequirementsInfo - { - using NativeType = VkImagePlaneMemoryRequirementsInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImagePlaneMemoryRequirementsInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ImagePlaneMemoryRequirementsInfo( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , planeAspect( planeAspect_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImagePlaneMemoryRequirementsInfo( ImagePlaneMemoryRequirementsInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImagePlaneMemoryRequirementsInfo( VkImagePlaneMemoryRequirementsInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ImagePlaneMemoryRequirementsInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImagePlaneMemoryRequirementsInfo & operator=( ImagePlaneMemoryRequirementsInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImagePlaneMemoryRequirementsInfo & operator=( VkImagePlaneMemoryRequirementsInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImagePlaneMemoryRequirementsInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImagePlaneMemoryRequirementsInfo & setPlaneAspect( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect_ ) VULKAN_HPP_NOEXCEPT - { - planeAspect = planeAspect_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImagePlaneMemoryRequirementsInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImagePlaneMemoryRequirementsInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, planeAspect ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImagePlaneMemoryRequirementsInfo const & ) const = default; -#else - bool operator==( ImagePlaneMemoryRequirementsInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( planeAspect == rhs.planeAspect ); -# endif - } - - bool operator!=( ImagePlaneMemoryRequirementsInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImagePlaneMemoryRequirementsInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits planeAspect = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor; - }; - - template <> - struct CppType - { - using Type = ImagePlaneMemoryRequirementsInfo; - }; - using ImagePlaneMemoryRequirementsInfoKHR = ImagePlaneMemoryRequirementsInfo; - - struct ImageResolve - { - using NativeType = VkImageResolve; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageResolve( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {} ) VULKAN_HPP_NOEXCEPT - : srcSubresource( srcSubresource_ ) - , srcOffset( srcOffset_ ) - , dstSubresource( dstSubresource_ ) - , dstOffset( dstOffset_ ) - , extent( extent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageResolve( ImageResolve const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageResolve( VkImageResolve const & rhs ) VULKAN_HPP_NOEXCEPT : ImageResolve( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageResolve & operator=( ImageResolve const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageResolve & operator=( VkImageResolve const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageResolve & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve & setSrcOffset( VULKAN_HPP_NAMESPACE::Offset3D const & srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve & setDstOffset( VULKAN_HPP_NAMESPACE::Offset3D const & dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageResolve const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageResolve &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( srcSubresource, srcOffset, dstSubresource, dstOffset, extent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageResolve const & ) const = default; -#else - bool operator==( ImageResolve const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( srcSubresource == rhs.srcSubresource ) && ( srcOffset == rhs.srcOffset ) && ( dstSubresource == rhs.dstSubresource ) && - ( dstOffset == rhs.dstOffset ) && ( extent == rhs.extent ); -# endif - } - - bool operator!=( ImageResolve const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D srcOffset = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D dstOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - }; - - struct ImageResolve2 - { - using NativeType = VkImageResolve2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageResolve2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageResolve2( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D srcOffset_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource_ = {}, - VULKAN_HPP_NAMESPACE::Offset3D dstOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D extent_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcSubresource( srcSubresource_ ) - , srcOffset( srcOffset_ ) - , dstSubresource( dstSubresource_ ) - , dstOffset( dstOffset_ ) - , extent( extent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageResolve2( ImageResolve2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageResolve2( VkImageResolve2 const & rhs ) VULKAN_HPP_NOEXCEPT : ImageResolve2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageResolve2 & operator=( ImageResolve2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageResolve2 & operator=( VkImageResolve2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setSrcSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & srcSubresource_ ) VULKAN_HPP_NOEXCEPT - { - srcSubresource = srcSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setSrcOffset( VULKAN_HPP_NAMESPACE::Offset3D const & srcOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcOffset = srcOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setDstSubresource( VULKAN_HPP_NAMESPACE::ImageSubresourceLayers const & dstSubresource_ ) VULKAN_HPP_NOEXCEPT - { - dstSubresource = dstSubresource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setDstOffset( VULKAN_HPP_NAMESPACE::Offset3D const & dstOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstOffset = dstOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageResolve2 & setExtent( VULKAN_HPP_NAMESPACE::Extent3D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageResolve2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageResolve2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcSubresource, srcOffset, dstSubresource, dstOffset, extent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageResolve2 const & ) const = default; -#else - bool operator==( ImageResolve2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcSubresource == rhs.srcSubresource ) && ( srcOffset == rhs.srcOffset ) && - ( dstSubresource == rhs.dstSubresource ) && ( dstOffset == rhs.dstOffset ) && ( extent == rhs.extent ); -# endif - } - - bool operator!=( ImageResolve2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageResolve2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers srcSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D srcOffset = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceLayers dstSubresource = {}; - VULKAN_HPP_NAMESPACE::Offset3D dstOffset = {}; - VULKAN_HPP_NAMESPACE::Extent3D extent = {}; - }; - - template <> - struct CppType - { - using Type = ImageResolve2; - }; - using ImageResolve2KHR = ImageResolve2; - - struct ImageSparseMemoryRequirementsInfo2 - { - using NativeType = VkImageSparseMemoryRequirementsInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageSparseMemoryRequirementsInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageSparseMemoryRequirementsInfo2( VULKAN_HPP_NAMESPACE::Image image_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSparseMemoryRequirementsInfo2( ImageSparseMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSparseMemoryRequirementsInfo2( VkImageSparseMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageSparseMemoryRequirementsInfo2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSparseMemoryRequirementsInfo2 & operator=( ImageSparseMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSparseMemoryRequirementsInfo2 & operator=( VkImageSparseMemoryRequirementsInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSparseMemoryRequirementsInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSparseMemoryRequirementsInfo2 & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSparseMemoryRequirementsInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSparseMemoryRequirementsInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSparseMemoryRequirementsInfo2 const & ) const = default; -#else - bool operator==( ImageSparseMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ); -# endif - } - - bool operator!=( ImageSparseMemoryRequirementsInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageSparseMemoryRequirementsInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - }; - - template <> - struct CppType - { - using Type = ImageSparseMemoryRequirementsInfo2; - }; - using ImageSparseMemoryRequirementsInfo2KHR = ImageSparseMemoryRequirementsInfo2; - - struct ImageStencilUsageCreateInfo - { - using NativeType = VkImageStencilUsageCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageStencilUsageCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageStencilUsageCreateInfo( VULKAN_HPP_NAMESPACE::ImageUsageFlags stencilUsage_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stencilUsage( stencilUsage_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageStencilUsageCreateInfo( ImageStencilUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageStencilUsageCreateInfo( VkImageStencilUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageStencilUsageCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageStencilUsageCreateInfo & operator=( ImageStencilUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageStencilUsageCreateInfo & operator=( VkImageStencilUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageStencilUsageCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageStencilUsageCreateInfo & setStencilUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags stencilUsage_ ) VULKAN_HPP_NOEXCEPT - { - stencilUsage = stencilUsage_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageStencilUsageCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageStencilUsageCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stencilUsage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageStencilUsageCreateInfo const & ) const = default; -#else - bool operator==( ImageStencilUsageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stencilUsage == rhs.stencilUsage ); -# endif - } - - bool operator!=( ImageStencilUsageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageStencilUsageCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags stencilUsage = {}; - }; - - template <> - struct CppType - { - using Type = ImageStencilUsageCreateInfo; - }; - using ImageStencilUsageCreateInfoEXT = ImageStencilUsageCreateInfo; - - struct ImageSubresource2EXT - { - using NativeType = VkImageSubresource2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageSubresource2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageSubresource2EXT( VULKAN_HPP_NAMESPACE::ImageSubresource imageSubresource_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageSubresource( imageSubresource_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSubresource2EXT( ImageSubresource2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresource2EXT( VkImageSubresource2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageSubresource2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSubresource2EXT & operator=( ImageSubresource2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSubresource2EXT & operator=( VkImageSubresource2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSubresource2EXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSubresource2EXT & setImageSubresource( VULKAN_HPP_NAMESPACE::ImageSubresource const & imageSubresource_ ) VULKAN_HPP_NOEXCEPT - { - imageSubresource = imageSubresource_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSubresource2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSubresource2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageSubresource ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSubresource2EXT const & ) const = default; -#else - bool operator==( ImageSubresource2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageSubresource == rhs.imageSubresource ); -# endif - } - - bool operator!=( ImageSubresource2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageSubresource2EXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageSubresource imageSubresource = {}; - }; - - template <> - struct CppType - { - using Type = ImageSubresource2EXT; - }; - - struct ImageSwapchainCreateInfoKHR - { - using NativeType = VkImageSwapchainCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageSwapchainCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageSwapchainCreateInfoKHR( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchain( swapchain_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageSwapchainCreateInfoKHR( ImageSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSwapchainCreateInfoKHR( VkImageSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageSwapchainCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageSwapchainCreateInfoKHR & operator=( ImageSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageSwapchainCreateInfoKHR & operator=( VkImageSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageSwapchainCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageSwapchainCreateInfoKHR & setSwapchain( VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain_ ) VULKAN_HPP_NOEXCEPT - { - swapchain = swapchain_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageSwapchainCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageSwapchainCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchain ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageSwapchainCreateInfoKHR const & ) const = default; -#else - bool operator==( ImageSwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchain == rhs.swapchain ); -# endif - } - - bool operator!=( ImageSwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageSwapchainCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SwapchainKHR swapchain = {}; - }; - - template <> - struct CppType - { - using Type = ImageSwapchainCreateInfoKHR; - }; - - struct ImageViewASTCDecodeModeEXT - { - using NativeType = VkImageViewASTCDecodeModeEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewAstcDecodeModeEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewASTCDecodeModeEXT( VULKAN_HPP_NAMESPACE::Format decodeMode_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , decodeMode( decodeMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewASTCDecodeModeEXT( ImageViewASTCDecodeModeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewASTCDecodeModeEXT( VkImageViewASTCDecodeModeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewASTCDecodeModeEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewASTCDecodeModeEXT & operator=( ImageViewASTCDecodeModeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewASTCDecodeModeEXT & operator=( VkImageViewASTCDecodeModeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewASTCDecodeModeEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewASTCDecodeModeEXT & setDecodeMode( VULKAN_HPP_NAMESPACE::Format decodeMode_ ) VULKAN_HPP_NOEXCEPT - { - decodeMode = decodeMode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewASTCDecodeModeEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewASTCDecodeModeEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, decodeMode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewASTCDecodeModeEXT const & ) const = default; -#else - bool operator==( ImageViewASTCDecodeModeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( decodeMode == rhs.decodeMode ); -# endif - } - - bool operator!=( ImageViewASTCDecodeModeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewAstcDecodeModeEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format decodeMode = VULKAN_HPP_NAMESPACE::Format::eUndefined; - }; - - template <> - struct CppType - { - using Type = ImageViewASTCDecodeModeEXT; - }; - - struct ImageViewAddressPropertiesNVX - { - using NativeType = VkImageViewAddressPropertiesNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewAddressPropertiesNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewAddressPropertiesNVX( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceAddress( deviceAddress_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewAddressPropertiesNVX( ImageViewAddressPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewAddressPropertiesNVX( VkImageViewAddressPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewAddressPropertiesNVX( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewAddressPropertiesNVX & operator=( ImageViewAddressPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewAddressPropertiesNVX & operator=( VkImageViewAddressPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkImageViewAddressPropertiesNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewAddressPropertiesNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceAddress, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewAddressPropertiesNVX const & ) const = default; -#else - bool operator==( ImageViewAddressPropertiesNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceAddress == rhs.deviceAddress ) && ( size == rhs.size ); -# endif - } - - bool operator!=( ImageViewAddressPropertiesNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewAddressPropertiesNVX; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewAddressPropertiesNVX; - }; - - struct ImageViewCreateInfo - { - using NativeType = VkImageViewCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewCreateInfo( VULKAN_HPP_NAMESPACE::ImageViewCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::ImageViewType viewType_ = VULKAN_HPP_NAMESPACE::ImageViewType::e1D, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ComponentMapping components_ = {}, - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , image( image_ ) - , viewType( viewType_ ) - , format( format_ ) - , components( components_ ) - , subresourceRange( subresourceRange_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewCreateInfo( ImageViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewCreateInfo( VkImageViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : ImageViewCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewCreateInfo & operator=( ImageViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewCreateInfo & operator=( VkImageViewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::ImageViewCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setViewType( VULKAN_HPP_NAMESPACE::ImageViewType viewType_ ) VULKAN_HPP_NOEXCEPT - { - viewType = viewType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & setComponents( VULKAN_HPP_NAMESPACE::ComponentMapping const & components_ ) VULKAN_HPP_NOEXCEPT - { - components = components_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewCreateInfo & - setSubresourceRange( VULKAN_HPP_NAMESPACE::ImageSubresourceRange const & subresourceRange_ ) VULKAN_HPP_NOEXCEPT - { - subresourceRange = subresourceRange_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, image, viewType, format, components, subresourceRange ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewCreateInfo const & ) const = default; -#else - bool operator==( ImageViewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( image == rhs.image ) && ( viewType == rhs.viewType ) && - ( format == rhs.format ) && ( components == rhs.components ) && ( subresourceRange == rhs.subresourceRange ); -# endif - } - - bool operator!=( ImageViewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageViewCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::ImageViewType viewType = VULKAN_HPP_NAMESPACE::ImageViewType::e1D; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ComponentMapping components = {}; - VULKAN_HPP_NAMESPACE::ImageSubresourceRange subresourceRange = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewCreateInfo; - }; - - struct ImageViewHandleInfoNVX - { - using NativeType = VkImageViewHandleInfoNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewHandleInfoNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewHandleInfoNVX( VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler, - VULKAN_HPP_NAMESPACE::Sampler sampler_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageView( imageView_ ) - , descriptorType( descriptorType_ ) - , sampler( sampler_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewHandleInfoNVX( ImageViewHandleInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewHandleInfoNVX( VkImageViewHandleInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewHandleInfoNVX( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewHandleInfoNVX & operator=( ImageViewHandleInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewHandleInfoNVX & operator=( VkImageViewHandleInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewHandleInfoNVX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewHandleInfoNVX & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewHandleInfoNVX & setDescriptorType( VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ ) VULKAN_HPP_NOEXCEPT - { - descriptorType = descriptorType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewHandleInfoNVX & setSampler( VULKAN_HPP_NAMESPACE::Sampler sampler_ ) VULKAN_HPP_NOEXCEPT - { - sampler = sampler_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewHandleInfoNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewHandleInfoNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageView, descriptorType, sampler ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewHandleInfoNVX const & ) const = default; -#else - bool operator==( ImageViewHandleInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageView == rhs.imageView ) && ( descriptorType == rhs.descriptorType ) && - ( sampler == rhs.sampler ); -# endif - } - - bool operator!=( ImageViewHandleInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewHandleInfoNVX; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler; - VULKAN_HPP_NAMESPACE::Sampler sampler = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewHandleInfoNVX; - }; - - struct ImageViewMinLodCreateInfoEXT - { - using NativeType = VkImageViewMinLodCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewMinLodCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewMinLodCreateInfoEXT( float minLod_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minLod( minLod_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewMinLodCreateInfoEXT( ImageViewMinLodCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewMinLodCreateInfoEXT( VkImageViewMinLodCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewMinLodCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewMinLodCreateInfoEXT & operator=( ImageViewMinLodCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewMinLodCreateInfoEXT & operator=( VkImageViewMinLodCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewMinLodCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewMinLodCreateInfoEXT & setMinLod( float minLod_ ) VULKAN_HPP_NOEXCEPT - { - minLod = minLod_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewMinLodCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewMinLodCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minLod ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewMinLodCreateInfoEXT const & ) const = default; -#else - bool operator==( ImageViewMinLodCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minLod == rhs.minLod ); -# endif - } - - bool operator!=( ImageViewMinLodCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewMinLodCreateInfoEXT; - const void * pNext = {}; - float minLod = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewMinLodCreateInfoEXT; - }; - - struct ImageViewSampleWeightCreateInfoQCOM - { - using NativeType = VkImageViewSampleWeightCreateInfoQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewSampleWeightCreateInfoQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewSampleWeightCreateInfoQCOM( VULKAN_HPP_NAMESPACE::Offset2D filterCenter_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D filterSize_ = {}, - uint32_t numPhases_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , filterCenter( filterCenter_ ) - , filterSize( filterSize_ ) - , numPhases( numPhases_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewSampleWeightCreateInfoQCOM( ImageViewSampleWeightCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewSampleWeightCreateInfoQCOM( VkImageViewSampleWeightCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewSampleWeightCreateInfoQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewSampleWeightCreateInfoQCOM & operator=( ImageViewSampleWeightCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewSampleWeightCreateInfoQCOM & operator=( VkImageViewSampleWeightCreateInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewSampleWeightCreateInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewSampleWeightCreateInfoQCOM & setFilterCenter( VULKAN_HPP_NAMESPACE::Offset2D const & filterCenter_ ) VULKAN_HPP_NOEXCEPT - { - filterCenter = filterCenter_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewSampleWeightCreateInfoQCOM & setFilterSize( VULKAN_HPP_NAMESPACE::Extent2D const & filterSize_ ) VULKAN_HPP_NOEXCEPT - { - filterSize = filterSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewSampleWeightCreateInfoQCOM & setNumPhases( uint32_t numPhases_ ) VULKAN_HPP_NOEXCEPT - { - numPhases = numPhases_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewSampleWeightCreateInfoQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewSampleWeightCreateInfoQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, filterCenter, filterSize, numPhases ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewSampleWeightCreateInfoQCOM const & ) const = default; -#else - bool operator==( ImageViewSampleWeightCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( filterCenter == rhs.filterCenter ) && ( filterSize == rhs.filterSize ) && - ( numPhases == rhs.numPhases ); -# endif - } - - bool operator!=( ImageViewSampleWeightCreateInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewSampleWeightCreateInfoQCOM; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Offset2D filterCenter = {}; - VULKAN_HPP_NAMESPACE::Extent2D filterSize = {}; - uint32_t numPhases = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewSampleWeightCreateInfoQCOM; - }; - - struct ImageViewUsageCreateInfo - { - using NativeType = VkImageViewUsageCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImageViewUsageCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImageViewUsageCreateInfo( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , usage( usage_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImageViewUsageCreateInfo( ImageViewUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewUsageCreateInfo( VkImageViewUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ImageViewUsageCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImageViewUsageCreateInfo & operator=( ImageViewUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImageViewUsageCreateInfo & operator=( VkImageViewUsageCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImageViewUsageCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImageViewUsageCreateInfo & setUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImageViewUsageCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImageViewUsageCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, usage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImageViewUsageCreateInfo const & ) const = default; -#else - bool operator==( ImageViewUsageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( usage == rhs.usage ); -# endif - } - - bool operator!=( ImageViewUsageCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImageViewUsageCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage = {}; - }; - - template <> - struct CppType - { - using Type = ImageViewUsageCreateInfo; - }; - using ImageViewUsageCreateInfoKHR = ImageViewUsageCreateInfo; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct ImportAndroidHardwareBufferInfoANDROID - { - using NativeType = VkImportAndroidHardwareBufferInfoANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportAndroidHardwareBufferInfoANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportAndroidHardwareBufferInfoANDROID( struct AHardwareBuffer * buffer_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , buffer( buffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportAndroidHardwareBufferInfoANDROID( ImportAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportAndroidHardwareBufferInfoANDROID( VkImportAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportAndroidHardwareBufferInfoANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportAndroidHardwareBufferInfoANDROID & operator=( ImportAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportAndroidHardwareBufferInfoANDROID & operator=( VkImportAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportAndroidHardwareBufferInfoANDROID & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportAndroidHardwareBufferInfoANDROID & setBuffer( struct AHardwareBuffer * buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportAndroidHardwareBufferInfoANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportAndroidHardwareBufferInfoANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, buffer ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportAndroidHardwareBufferInfoANDROID const & ) const = default; -# else - bool operator==( ImportAndroidHardwareBufferInfoANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( buffer == rhs.buffer ); -# endif - } - - bool operator!=( ImportAndroidHardwareBufferInfoANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportAndroidHardwareBufferInfoANDROID; - const void * pNext = {}; - struct AHardwareBuffer * buffer = {}; - }; - - template <> - struct CppType - { - using Type = ImportAndroidHardwareBufferInfoANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - struct ImportFenceFdInfoKHR - { - using NativeType = VkImportFenceFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportFenceFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportFenceFdInfoKHR( - VULKAN_HPP_NAMESPACE::Fence fence_ = {}, - VULKAN_HPP_NAMESPACE::FenceImportFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd, - int fd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fence( fence_ ) - , flags( flags_ ) - , handleType( handleType_ ) - , fd( fd_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportFenceFdInfoKHR( ImportFenceFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportFenceFdInfoKHR( VkImportFenceFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportFenceFdInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportFenceFdInfoKHR & operator=( ImportFenceFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportFenceFdInfoKHR & operator=( VkImportFenceFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportFenceFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceFdInfoKHR & setFence( VULKAN_HPP_NAMESPACE::Fence fence_ ) VULKAN_HPP_NOEXCEPT - { - fence = fence_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceFdInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::FenceImportFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceFdInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceFdInfoKHR & setFd( int fd_ ) VULKAN_HPP_NOEXCEPT - { - fd = fd_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportFenceFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportFenceFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fence, flags, handleType, fd ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportFenceFdInfoKHR const & ) const = default; -#else - bool operator==( ImportFenceFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fence == rhs.fence ) && ( flags == rhs.flags ) && ( handleType == rhs.handleType ) && - ( fd == rhs.fd ); -# endif - } - - bool operator!=( ImportFenceFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportFenceFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Fence fence = {}; - VULKAN_HPP_NAMESPACE::FenceImportFlags flags = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd; - int fd = {}; - }; - - template <> - struct CppType - { - using Type = ImportFenceFdInfoKHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ImportFenceWin32HandleInfoKHR - { - using NativeType = VkImportFenceWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportFenceWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportFenceWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::Fence fence_ = {}, - VULKAN_HPP_NAMESPACE::FenceImportFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd, - HANDLE handle_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fence( fence_ ) - , flags( flags_ ) - , handleType( handleType_ ) - , handle( handle_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportFenceWin32HandleInfoKHR( ImportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportFenceWin32HandleInfoKHR( VkImportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportFenceWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportFenceWin32HandleInfoKHR & operator=( ImportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportFenceWin32HandleInfoKHR & operator=( VkImportFenceWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & setFence( VULKAN_HPP_NAMESPACE::Fence fence_ ) VULKAN_HPP_NOEXCEPT - { - fence = fence_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::FenceImportFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & setHandle( HANDLE handle_ ) VULKAN_HPP_NOEXCEPT - { - handle = handle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportFenceWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportFenceWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportFenceWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fence, flags, handleType, handle, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportFenceWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ImportFenceWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fence == rhs.fence ) && ( flags == rhs.flags ) && ( handleType == rhs.handleType ) && - ( handle == rhs.handle ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ImportFenceWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportFenceWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Fence fence = {}; - VULKAN_HPP_NAMESPACE::FenceImportFlags flags = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd; - HANDLE handle = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ImportFenceWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImportMemoryBufferCollectionFUCHSIA - { - using NativeType = VkImportMemoryBufferCollectionFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryBufferCollectionFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryBufferCollectionFUCHSIA( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ = {}, - uint32_t index_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , collection( collection_ ) - , index( index_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryBufferCollectionFUCHSIA( ImportMemoryBufferCollectionFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryBufferCollectionFUCHSIA( VkImportMemoryBufferCollectionFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryBufferCollectionFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryBufferCollectionFUCHSIA & operator=( ImportMemoryBufferCollectionFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryBufferCollectionFUCHSIA & operator=( VkImportMemoryBufferCollectionFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryBufferCollectionFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryBufferCollectionFUCHSIA & setCollection( VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection_ ) VULKAN_HPP_NOEXCEPT - { - collection = collection_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryBufferCollectionFUCHSIA & setIndex( uint32_t index_ ) VULKAN_HPP_NOEXCEPT - { - index = index_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryBufferCollectionFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryBufferCollectionFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, collection, index ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMemoryBufferCollectionFUCHSIA const & ) const = default; -# else - bool operator==( ImportMemoryBufferCollectionFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( collection == rhs.collection ) && ( index == rhs.index ); -# endif - } - - bool operator!=( ImportMemoryBufferCollectionFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryBufferCollectionFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCollectionFUCHSIA collection = {}; - uint32_t index = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryBufferCollectionFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct ImportMemoryFdInfoKHR - { - using NativeType = VkImportMemoryFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryFdInfoKHR( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - int fd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - , fd( fd_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryFdInfoKHR( ImportMemoryFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryFdInfoKHR( VkImportMemoryFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryFdInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryFdInfoKHR & operator=( ImportMemoryFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryFdInfoKHR & operator=( VkImportMemoryFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryFdInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryFdInfoKHR & setFd( int fd_ ) VULKAN_HPP_NOEXCEPT - { - fd = fd_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType, fd ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMemoryFdInfoKHR const & ) const = default; -#else - bool operator==( ImportMemoryFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ) && ( fd == rhs.fd ); -# endif - } - - bool operator!=( ImportMemoryFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - int fd = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryFdInfoKHR; - }; - - struct ImportMemoryHostPointerInfoEXT - { - using NativeType = VkImportMemoryHostPointerInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryHostPointerInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryHostPointerInfoEXT( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - void * pHostPointer_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - , pHostPointer( pHostPointer_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryHostPointerInfoEXT( ImportMemoryHostPointerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryHostPointerInfoEXT( VkImportMemoryHostPointerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryHostPointerInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryHostPointerInfoEXT & operator=( ImportMemoryHostPointerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryHostPointerInfoEXT & operator=( VkImportMemoryHostPointerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryHostPointerInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryHostPointerInfoEXT & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryHostPointerInfoEXT & setPHostPointer( void * pHostPointer_ ) VULKAN_HPP_NOEXCEPT - { - pHostPointer = pHostPointer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryHostPointerInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryHostPointerInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType, pHostPointer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMemoryHostPointerInfoEXT const & ) const = default; -#else - bool operator==( ImportMemoryHostPointerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ) && ( pHostPointer == rhs.pHostPointer ); -# endif - } - - bool operator!=( ImportMemoryHostPointerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryHostPointerInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - void * pHostPointer = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryHostPointerInfoEXT; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ImportMemoryWin32HandleInfoKHR - { - using NativeType = VkImportMemoryWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - HANDLE handle_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - , handle( handle_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryWin32HandleInfoKHR( ImportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryWin32HandleInfoKHR( VkImportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryWin32HandleInfoKHR & operator=( ImportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryWin32HandleInfoKHR & operator=( VkImportMemoryWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoKHR & setHandle( HANDLE handle_ ) VULKAN_HPP_NOEXCEPT - { - handle = handle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType, handle, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMemoryWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ImportMemoryWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ) && ( handle == rhs.handle ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ImportMemoryWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - HANDLE handle = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ImportMemoryWin32HandleInfoNV - { - using NativeType = VkImportMemoryWin32HandleInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryWin32HandleInfoNV; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryWin32HandleInfoNV( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType_ = {}, - HANDLE handle_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - , handle( handle_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryWin32HandleInfoNV( ImportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryWin32HandleInfoNV( VkImportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryWin32HandleInfoNV( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryWin32HandleInfoNV & operator=( ImportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryWin32HandleInfoNV & operator=( VkImportMemoryWin32HandleInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoNV & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryWin32HandleInfoNV & setHandle( HANDLE handle_ ) VULKAN_HPP_NOEXCEPT - { - handle = handle_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryWin32HandleInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryWin32HandleInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType, handle ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMemoryWin32HandleInfoNV const & ) const = default; -# else - bool operator==( ImportMemoryWin32HandleInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ) && ( handle == rhs.handle ); -# endif - } - - bool operator!=( ImportMemoryWin32HandleInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryWin32HandleInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagsNV handleType = {}; - HANDLE handle = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryWin32HandleInfoNV; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImportMemoryZirconHandleInfoFUCHSIA - { - using NativeType = VkImportMemoryZirconHandleInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMemoryZirconHandleInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMemoryZirconHandleInfoFUCHSIA( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - zx_handle_t handle_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - , handle( handle_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMemoryZirconHandleInfoFUCHSIA( ImportMemoryZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryZirconHandleInfoFUCHSIA( VkImportMemoryZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMemoryZirconHandleInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMemoryZirconHandleInfoFUCHSIA & operator=( ImportMemoryZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMemoryZirconHandleInfoFUCHSIA & operator=( VkImportMemoryZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMemoryZirconHandleInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryZirconHandleInfoFUCHSIA & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMemoryZirconHandleInfoFUCHSIA & setHandle( zx_handle_t handle_ ) VULKAN_HPP_NOEXCEPT - { - handle = handle_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMemoryZirconHandleInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMemoryZirconHandleInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType, handle ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( ImportMemoryZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = handleType <=> rhs.handleType; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &handle, &rhs.handle, sizeof( zx_handle_t ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( ImportMemoryZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ) && - ( memcmp( &handle, &rhs.handle, sizeof( zx_handle_t ) ) == 0 ); - } - - bool operator!=( ImportMemoryZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMemoryZirconHandleInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - zx_handle_t handle = {}; - }; - - template <> - struct CppType - { - using Type = ImportMemoryZirconHandleInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ImportMetalBufferInfoEXT - { - using NativeType = VkImportMetalBufferInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMetalBufferInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMetalBufferInfoEXT( MTLBuffer_id mtlBuffer_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mtlBuffer( mtlBuffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMetalBufferInfoEXT( ImportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalBufferInfoEXT( VkImportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMetalBufferInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMetalBufferInfoEXT & operator=( ImportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalBufferInfoEXT & operator=( VkImportMetalBufferInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMetalBufferInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMetalBufferInfoEXT & setMtlBuffer( MTLBuffer_id mtlBuffer_ ) VULKAN_HPP_NOEXCEPT - { - mtlBuffer = mtlBuffer_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMetalBufferInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMetalBufferInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mtlBuffer ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMetalBufferInfoEXT const & ) const = default; -# else - bool operator==( ImportMetalBufferInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mtlBuffer == rhs.mtlBuffer ); -# endif - } - - bool operator!=( ImportMetalBufferInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMetalBufferInfoEXT; - const void * pNext = {}; - MTLBuffer_id mtlBuffer = {}; - }; - - template <> - struct CppType - { - using Type = ImportMetalBufferInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ImportMetalIOSurfaceInfoEXT - { - using NativeType = VkImportMetalIOSurfaceInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMetalIoSurfaceInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMetalIOSurfaceInfoEXT( IOSurfaceRef ioSurface_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , ioSurface( ioSurface_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMetalIOSurfaceInfoEXT( ImportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalIOSurfaceInfoEXT( VkImportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMetalIOSurfaceInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMetalIOSurfaceInfoEXT & operator=( ImportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalIOSurfaceInfoEXT & operator=( VkImportMetalIOSurfaceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMetalIOSurfaceInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMetalIOSurfaceInfoEXT & setIoSurface( IOSurfaceRef ioSurface_ ) VULKAN_HPP_NOEXCEPT - { - ioSurface = ioSurface_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMetalIOSurfaceInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMetalIOSurfaceInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, ioSurface ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMetalIOSurfaceInfoEXT const & ) const = default; -# else - bool operator==( ImportMetalIOSurfaceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ioSurface == rhs.ioSurface ); -# endif - } - - bool operator!=( ImportMetalIOSurfaceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMetalIoSurfaceInfoEXT; - const void * pNext = {}; - IOSurfaceRef ioSurface = {}; - }; - - template <> - struct CppType - { - using Type = ImportMetalIOSurfaceInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ImportMetalSharedEventInfoEXT - { - using NativeType = VkImportMetalSharedEventInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMetalSharedEventInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMetalSharedEventInfoEXT( MTLSharedEvent_id mtlSharedEvent_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mtlSharedEvent( mtlSharedEvent_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMetalSharedEventInfoEXT( ImportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalSharedEventInfoEXT( VkImportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMetalSharedEventInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMetalSharedEventInfoEXT & operator=( ImportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalSharedEventInfoEXT & operator=( VkImportMetalSharedEventInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMetalSharedEventInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMetalSharedEventInfoEXT & setMtlSharedEvent( MTLSharedEvent_id mtlSharedEvent_ ) VULKAN_HPP_NOEXCEPT - { - mtlSharedEvent = mtlSharedEvent_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMetalSharedEventInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMetalSharedEventInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mtlSharedEvent ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMetalSharedEventInfoEXT const & ) const = default; -# else - bool operator==( ImportMetalSharedEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mtlSharedEvent == rhs.mtlSharedEvent ); -# endif - } - - bool operator!=( ImportMetalSharedEventInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMetalSharedEventInfoEXT; - const void * pNext = {}; - MTLSharedEvent_id mtlSharedEvent = {}; - }; - - template <> - struct CppType - { - using Type = ImportMetalSharedEventInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct ImportMetalTextureInfoEXT - { - using NativeType = VkImportMetalTextureInfoEXT; - - static const bool allowDuplicate = true; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportMetalTextureInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportMetalTextureInfoEXT( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane_ = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor, - MTLTexture_id mtlTexture_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , plane( plane_ ) - , mtlTexture( mtlTexture_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportMetalTextureInfoEXT( ImportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalTextureInfoEXT( VkImportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportMetalTextureInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportMetalTextureInfoEXT & operator=( ImportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportMetalTextureInfoEXT & operator=( VkImportMetalTextureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportMetalTextureInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMetalTextureInfoEXT & setPlane( VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane_ ) VULKAN_HPP_NOEXCEPT - { - plane = plane_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportMetalTextureInfoEXT & setMtlTexture( MTLTexture_id mtlTexture_ ) VULKAN_HPP_NOEXCEPT - { - mtlTexture = mtlTexture_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportMetalTextureInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportMetalTextureInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, plane, mtlTexture ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportMetalTextureInfoEXT const & ) const = default; -# else - bool operator==( ImportMetalTextureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( plane == rhs.plane ) && ( mtlTexture == rhs.mtlTexture ); -# endif - } - - bool operator!=( ImportMetalTextureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportMetalTextureInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlagBits plane = VULKAN_HPP_NAMESPACE::ImageAspectFlagBits::eColor; - MTLTexture_id mtlTexture = {}; - }; - - template <> - struct CppType - { - using Type = ImportMetalTextureInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - struct ImportSemaphoreFdInfoKHR - { - using NativeType = VkImportSemaphoreFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportSemaphoreFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportSemaphoreFdInfoKHR( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - int fd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , flags( flags_ ) - , handleType( handleType_ ) - , fd( fd_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportSemaphoreFdInfoKHR( ImportSemaphoreFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreFdInfoKHR( VkImportSemaphoreFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportSemaphoreFdInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportSemaphoreFdInfoKHR & operator=( ImportSemaphoreFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreFdInfoKHR & operator=( VkImportSemaphoreFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreFdInfoKHR & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreFdInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreFdInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreFdInfoKHR & setFd( int fd_ ) VULKAN_HPP_NOEXCEPT - { - fd = fd_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportSemaphoreFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportSemaphoreFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, flags, handleType, fd ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportSemaphoreFdInfoKHR const & ) const = default; -#else - bool operator==( ImportSemaphoreFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( flags == rhs.flags ) && ( handleType == rhs.handleType ) && - ( fd == rhs.fd ); -# endif - } - - bool operator!=( ImportSemaphoreFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportSemaphoreFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - int fd = {}; - }; - - template <> - struct CppType - { - using Type = ImportSemaphoreFdInfoKHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct ImportSemaphoreWin32HandleInfoKHR - { - using NativeType = VkImportSemaphoreWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportSemaphoreWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportSemaphoreWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - HANDLE handle_ = {}, - LPCWSTR name_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , flags( flags_ ) - , handleType( handleType_ ) - , handle( handle_ ) - , name( name_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportSemaphoreWin32HandleInfoKHR( ImportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreWin32HandleInfoKHR( VkImportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportSemaphoreWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportSemaphoreWin32HandleInfoKHR & operator=( ImportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreWin32HandleInfoKHR & operator=( VkImportSemaphoreWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & setHandle( HANDLE handle_ ) VULKAN_HPP_NOEXCEPT - { - handle = handle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreWin32HandleInfoKHR & setName( LPCWSTR name_ ) VULKAN_HPP_NOEXCEPT - { - name = name_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportSemaphoreWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportSemaphoreWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, flags, handleType, handle, name ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ImportSemaphoreWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( ImportSemaphoreWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( flags == rhs.flags ) && ( handleType == rhs.handleType ) && - ( handle == rhs.handle ) && ( name == rhs.name ); -# endif - } - - bool operator!=( ImportSemaphoreWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportSemaphoreWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - HANDLE handle = {}; - LPCWSTR name = {}; - }; - - template <> - struct CppType - { - using Type = ImportSemaphoreWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct ImportSemaphoreZirconHandleInfoFUCHSIA - { - using NativeType = VkImportSemaphoreZirconHandleInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eImportSemaphoreZirconHandleInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ImportSemaphoreZirconHandleInfoFUCHSIA( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - zx_handle_t zirconHandle_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , flags( flags_ ) - , handleType( handleType_ ) - , zirconHandle( zirconHandle_ ) - { - } - - VULKAN_HPP_CONSTEXPR ImportSemaphoreZirconHandleInfoFUCHSIA( ImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreZirconHandleInfoFUCHSIA( VkImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : ImportSemaphoreZirconHandleInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ImportSemaphoreZirconHandleInfoFUCHSIA & operator=( ImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ImportSemaphoreZirconHandleInfoFUCHSIA & operator=( VkImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreZirconHandleInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreZirconHandleInfoFUCHSIA & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreZirconHandleInfoFUCHSIA & setFlags( VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreZirconHandleInfoFUCHSIA & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ImportSemaphoreZirconHandleInfoFUCHSIA & setZirconHandle( zx_handle_t zirconHandle_ ) VULKAN_HPP_NOEXCEPT - { - zirconHandle = zirconHandle_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkImportSemaphoreZirconHandleInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkImportSemaphoreZirconHandleInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, flags, handleType, zirconHandle ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( ImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = semaphore <=> rhs.semaphore; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = handleType <=> rhs.handleType; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &zirconHandle, &rhs.zirconHandle, sizeof( zx_handle_t ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( ImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( flags == rhs.flags ) && ( handleType == rhs.handleType ) && - ( memcmp( &zirconHandle, &rhs.zirconHandle, sizeof( zx_handle_t ) ) == 0 ); - } - - bool operator!=( ImportSemaphoreZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eImportSemaphoreZirconHandleInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::SemaphoreImportFlags flags = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - zx_handle_t zirconHandle = {}; - }; - - template <> - struct CppType - { - using Type = ImportSemaphoreZirconHandleInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct IndirectCommandsLayoutTokenNV - { - using NativeType = VkIndirectCommandsLayoutTokenNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eIndirectCommandsLayoutTokenNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutTokenNV( - VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV tokenType_ = VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV::eShaderGroup, - uint32_t stream_ = {}, - uint32_t offset_ = {}, - uint32_t vertexBindingUnit_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vertexDynamicStride_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout pushconstantPipelineLayout_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags pushconstantShaderStageFlags_ = {}, - uint32_t pushconstantOffset_ = {}, - uint32_t pushconstantSize_ = {}, - VULKAN_HPP_NAMESPACE::IndirectStateFlagsNV indirectStateFlags_ = {}, - uint32_t indexTypeCount_ = {}, - const VULKAN_HPP_NAMESPACE::IndexType * pIndexTypes_ = {}, - const uint32_t * pIndexTypeValues_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , tokenType( tokenType_ ) - , stream( stream_ ) - , offset( offset_ ) - , vertexBindingUnit( vertexBindingUnit_ ) - , vertexDynamicStride( vertexDynamicStride_ ) - , pushconstantPipelineLayout( pushconstantPipelineLayout_ ) - , pushconstantShaderStageFlags( pushconstantShaderStageFlags_ ) - , pushconstantOffset( pushconstantOffset_ ) - , pushconstantSize( pushconstantSize_ ) - , indirectStateFlags( indirectStateFlags_ ) - , indexTypeCount( indexTypeCount_ ) - , pIndexTypes( pIndexTypes_ ) - , pIndexTypeValues( pIndexTypeValues_ ) - { - } - - VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutTokenNV( IndirectCommandsLayoutTokenNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsLayoutTokenNV( VkIndirectCommandsLayoutTokenNV const & rhs ) VULKAN_HPP_NOEXCEPT - : IndirectCommandsLayoutTokenNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutTokenNV( VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV tokenType_, - uint32_t stream_, - uint32_t offset_, - uint32_t vertexBindingUnit_, - VULKAN_HPP_NAMESPACE::Bool32 vertexDynamicStride_, - VULKAN_HPP_NAMESPACE::PipelineLayout pushconstantPipelineLayout_, - VULKAN_HPP_NAMESPACE::ShaderStageFlags pushconstantShaderStageFlags_, - uint32_t pushconstantOffset_, - uint32_t pushconstantSize_, - VULKAN_HPP_NAMESPACE::IndirectStateFlagsNV indirectStateFlags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & indexTypes_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & indexTypeValues_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , tokenType( tokenType_ ) - , stream( stream_ ) - , offset( offset_ ) - , vertexBindingUnit( vertexBindingUnit_ ) - , vertexDynamicStride( vertexDynamicStride_ ) - , pushconstantPipelineLayout( pushconstantPipelineLayout_ ) - , pushconstantShaderStageFlags( pushconstantShaderStageFlags_ ) - , pushconstantOffset( pushconstantOffset_ ) - , pushconstantSize( pushconstantSize_ ) - , indirectStateFlags( indirectStateFlags_ ) - , indexTypeCount( static_cast( indexTypes_.size() ) ) - , pIndexTypes( indexTypes_.data() ) - , pIndexTypeValues( indexTypeValues_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( indexTypes_.size() == indexTypeValues_.size() ); -# else - if ( indexTypes_.size() != indexTypeValues_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::IndirectCommandsLayoutTokenNV::IndirectCommandsLayoutTokenNV: indexTypes_.size() != indexTypeValues_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - IndirectCommandsLayoutTokenNV & operator=( IndirectCommandsLayoutTokenNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsLayoutTokenNV & operator=( VkIndirectCommandsLayoutTokenNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setTokenType( VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV tokenType_ ) VULKAN_HPP_NOEXCEPT - { - tokenType = tokenType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setStream( uint32_t stream_ ) VULKAN_HPP_NOEXCEPT - { - stream = stream_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setOffset( uint32_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setVertexBindingUnit( uint32_t vertexBindingUnit_ ) VULKAN_HPP_NOEXCEPT - { - vertexBindingUnit = vertexBindingUnit_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setVertexDynamicStride( VULKAN_HPP_NAMESPACE::Bool32 vertexDynamicStride_ ) VULKAN_HPP_NOEXCEPT - { - vertexDynamicStride = vertexDynamicStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & - setPushconstantPipelineLayout( VULKAN_HPP_NAMESPACE::PipelineLayout pushconstantPipelineLayout_ ) VULKAN_HPP_NOEXCEPT - { - pushconstantPipelineLayout = pushconstantPipelineLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & - setPushconstantShaderStageFlags( VULKAN_HPP_NAMESPACE::ShaderStageFlags pushconstantShaderStageFlags_ ) VULKAN_HPP_NOEXCEPT - { - pushconstantShaderStageFlags = pushconstantShaderStageFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setPushconstantOffset( uint32_t pushconstantOffset_ ) VULKAN_HPP_NOEXCEPT - { - pushconstantOffset = pushconstantOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setPushconstantSize( uint32_t pushconstantSize_ ) VULKAN_HPP_NOEXCEPT - { - pushconstantSize = pushconstantSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & - setIndirectStateFlags( VULKAN_HPP_NAMESPACE::IndirectStateFlagsNV indirectStateFlags_ ) VULKAN_HPP_NOEXCEPT - { - indirectStateFlags = indirectStateFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setIndexTypeCount( uint32_t indexTypeCount_ ) VULKAN_HPP_NOEXCEPT - { - indexTypeCount = indexTypeCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setPIndexTypes( const VULKAN_HPP_NAMESPACE::IndexType * pIndexTypes_ ) VULKAN_HPP_NOEXCEPT - { - pIndexTypes = pIndexTypes_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutTokenNV & - setIndexTypes( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & indexTypes_ ) VULKAN_HPP_NOEXCEPT - { - indexTypeCount = static_cast( indexTypes_.size() ); - pIndexTypes = indexTypes_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutTokenNV & setPIndexTypeValues( const uint32_t * pIndexTypeValues_ ) VULKAN_HPP_NOEXCEPT - { - pIndexTypeValues = pIndexTypeValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutTokenNV & - setIndexTypeValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & indexTypeValues_ ) VULKAN_HPP_NOEXCEPT - { - indexTypeCount = static_cast( indexTypeValues_.size() ); - pIndexTypeValues = indexTypeValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkIndirectCommandsLayoutTokenNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkIndirectCommandsLayoutTokenNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - tokenType, - stream, - offset, - vertexBindingUnit, - vertexDynamicStride, - pushconstantPipelineLayout, - pushconstantShaderStageFlags, - pushconstantOffset, - pushconstantSize, - indirectStateFlags, - indexTypeCount, - pIndexTypes, - pIndexTypeValues ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( IndirectCommandsLayoutTokenNV const & ) const = default; -#else - bool operator==( IndirectCommandsLayoutTokenNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( tokenType == rhs.tokenType ) && ( stream == rhs.stream ) && ( offset == rhs.offset ) && - ( vertexBindingUnit == rhs.vertexBindingUnit ) && ( vertexDynamicStride == rhs.vertexDynamicStride ) && - ( pushconstantPipelineLayout == rhs.pushconstantPipelineLayout ) && ( pushconstantShaderStageFlags == rhs.pushconstantShaderStageFlags ) && - ( pushconstantOffset == rhs.pushconstantOffset ) && ( pushconstantSize == rhs.pushconstantSize ) && - ( indirectStateFlags == rhs.indirectStateFlags ) && ( indexTypeCount == rhs.indexTypeCount ) && ( pIndexTypes == rhs.pIndexTypes ) && - ( pIndexTypeValues == rhs.pIndexTypeValues ); -# endif - } - - bool operator!=( IndirectCommandsLayoutTokenNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eIndirectCommandsLayoutTokenNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV tokenType = VULKAN_HPP_NAMESPACE::IndirectCommandsTokenTypeNV::eShaderGroup; - uint32_t stream = {}; - uint32_t offset = {}; - uint32_t vertexBindingUnit = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexDynamicStride = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout pushconstantPipelineLayout = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags pushconstantShaderStageFlags = {}; - uint32_t pushconstantOffset = {}; - uint32_t pushconstantSize = {}; - VULKAN_HPP_NAMESPACE::IndirectStateFlagsNV indirectStateFlags = {}; - uint32_t indexTypeCount = {}; - const VULKAN_HPP_NAMESPACE::IndexType * pIndexTypes = {}; - const uint32_t * pIndexTypeValues = {}; - }; - - template <> - struct CppType - { - using Type = IndirectCommandsLayoutTokenNV; - }; - - struct IndirectCommandsLayoutCreateInfoNV - { - using NativeType = VkIndirectCommandsLayoutCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eIndirectCommandsLayoutCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - IndirectCommandsLayoutCreateInfoNV( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutUsageFlagsNV flags_ = {}, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - uint32_t tokenCount_ = {}, - const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutTokenNV * pTokens_ = {}, - uint32_t streamCount_ = {}, - const uint32_t * pStreamStrides_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , tokenCount( tokenCount_ ) - , pTokens( pTokens_ ) - , streamCount( streamCount_ ) - , pStreamStrides( pStreamStrides_ ) - { - } - - VULKAN_HPP_CONSTEXPR IndirectCommandsLayoutCreateInfoNV( IndirectCommandsLayoutCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsLayoutCreateInfoNV( VkIndirectCommandsLayoutCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : IndirectCommandsLayoutCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutCreateInfoNV( - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutUsageFlagsNV flags_, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tokens_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & streamStrides_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , tokenCount( static_cast( tokens_.size() ) ) - , pTokens( tokens_.data() ) - , streamCount( static_cast( streamStrides_.size() ) ) - , pStreamStrides( streamStrides_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - IndirectCommandsLayoutCreateInfoNV & operator=( IndirectCommandsLayoutCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - IndirectCommandsLayoutCreateInfoNV & operator=( VkIndirectCommandsLayoutCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & setFlags( VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutUsageFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & - setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & setTokenCount( uint32_t tokenCount_ ) VULKAN_HPP_NOEXCEPT - { - tokenCount = tokenCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & - setPTokens( const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutTokenNV * pTokens_ ) VULKAN_HPP_NOEXCEPT - { - pTokens = pTokens_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutCreateInfoNV & - setTokens( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & tokens_ ) VULKAN_HPP_NOEXCEPT - { - tokenCount = static_cast( tokens_.size() ); - pTokens = tokens_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & setStreamCount( uint32_t streamCount_ ) VULKAN_HPP_NOEXCEPT - { - streamCount = streamCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 IndirectCommandsLayoutCreateInfoNV & setPStreamStrides( const uint32_t * pStreamStrides_ ) VULKAN_HPP_NOEXCEPT - { - pStreamStrides = pStreamStrides_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - IndirectCommandsLayoutCreateInfoNV & - setStreamStrides( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & streamStrides_ ) VULKAN_HPP_NOEXCEPT - { - streamCount = static_cast( streamStrides_.size() ); - pStreamStrides = streamStrides_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkIndirectCommandsLayoutCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkIndirectCommandsLayoutCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pipelineBindPoint, tokenCount, pTokens, streamCount, pStreamStrides ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( IndirectCommandsLayoutCreateInfoNV const & ) const = default; -#else - bool operator==( IndirectCommandsLayoutCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && - ( tokenCount == rhs.tokenCount ) && ( pTokens == rhs.pTokens ) && ( streamCount == rhs.streamCount ) && ( pStreamStrides == rhs.pStreamStrides ); -# endif - } - - bool operator!=( IndirectCommandsLayoutCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eIndirectCommandsLayoutCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutUsageFlagsNV flags = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - uint32_t tokenCount = {}; - const VULKAN_HPP_NAMESPACE::IndirectCommandsLayoutTokenNV * pTokens = {}; - uint32_t streamCount = {}; - const uint32_t * pStreamStrides = {}; - }; - - template <> - struct CppType - { - using Type = IndirectCommandsLayoutCreateInfoNV; - }; - - struct InitializePerformanceApiInfoINTEL - { - using NativeType = VkInitializePerformanceApiInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eInitializePerformanceApiInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR InitializePerformanceApiInfoINTEL( void * pUserData_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pUserData( pUserData_ ) - { - } - - VULKAN_HPP_CONSTEXPR InitializePerformanceApiInfoINTEL( InitializePerformanceApiInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InitializePerformanceApiInfoINTEL( VkInitializePerformanceApiInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : InitializePerformanceApiInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - InitializePerformanceApiInfoINTEL & operator=( InitializePerformanceApiInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InitializePerformanceApiInfoINTEL & operator=( VkInitializePerformanceApiInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 InitializePerformanceApiInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InitializePerformanceApiInfoINTEL & setPUserData( void * pUserData_ ) VULKAN_HPP_NOEXCEPT - { - pUserData = pUserData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkInitializePerformanceApiInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkInitializePerformanceApiInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pUserData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( InitializePerformanceApiInfoINTEL const & ) const = default; -#else - bool operator==( InitializePerformanceApiInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pUserData == rhs.pUserData ); -# endif - } - - bool operator!=( InitializePerformanceApiInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eInitializePerformanceApiInfoINTEL; - const void * pNext = {}; - void * pUserData = {}; - }; - - template <> - struct CppType - { - using Type = InitializePerformanceApiInfoINTEL; - }; - - struct InputAttachmentAspectReference - { - using NativeType = VkInputAttachmentAspectReference; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR InputAttachmentAspectReference( uint32_t subpass_ = {}, - uint32_t inputAttachmentIndex_ = {}, - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {} ) VULKAN_HPP_NOEXCEPT - : subpass( subpass_ ) - , inputAttachmentIndex( inputAttachmentIndex_ ) - , aspectMask( aspectMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR InputAttachmentAspectReference( InputAttachmentAspectReference const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InputAttachmentAspectReference( VkInputAttachmentAspectReference const & rhs ) VULKAN_HPP_NOEXCEPT - : InputAttachmentAspectReference( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - InputAttachmentAspectReference & operator=( InputAttachmentAspectReference const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InputAttachmentAspectReference & operator=( VkInputAttachmentAspectReference const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 InputAttachmentAspectReference & setSubpass( uint32_t subpass_ ) VULKAN_HPP_NOEXCEPT - { - subpass = subpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InputAttachmentAspectReference & setInputAttachmentIndex( uint32_t inputAttachmentIndex_ ) VULKAN_HPP_NOEXCEPT - { - inputAttachmentIndex = inputAttachmentIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InputAttachmentAspectReference & setAspectMask( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ ) VULKAN_HPP_NOEXCEPT - { - aspectMask = aspectMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkInputAttachmentAspectReference const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkInputAttachmentAspectReference &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( subpass, inputAttachmentIndex, aspectMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( InputAttachmentAspectReference const & ) const = default; -#else - bool operator==( InputAttachmentAspectReference const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( subpass == rhs.subpass ) && ( inputAttachmentIndex == rhs.inputAttachmentIndex ) && ( aspectMask == rhs.aspectMask ); -# endif - } - - bool operator!=( InputAttachmentAspectReference const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t subpass = {}; - uint32_t inputAttachmentIndex = {}; - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - }; - using InputAttachmentAspectReferenceKHR = InputAttachmentAspectReference; - - struct InstanceCreateInfo - { - using NativeType = VkInstanceCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eInstanceCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR InstanceCreateInfo( VULKAN_HPP_NAMESPACE::InstanceCreateFlags flags_ = {}, - const VULKAN_HPP_NAMESPACE::ApplicationInfo * pApplicationInfo_ = {}, - uint32_t enabledLayerCount_ = {}, - const char * const * ppEnabledLayerNames_ = {}, - uint32_t enabledExtensionCount_ = {}, - const char * const * ppEnabledExtensionNames_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pApplicationInfo( pApplicationInfo_ ) - , enabledLayerCount( enabledLayerCount_ ) - , ppEnabledLayerNames( ppEnabledLayerNames_ ) - , enabledExtensionCount( enabledExtensionCount_ ) - , ppEnabledExtensionNames( ppEnabledExtensionNames_ ) - { - } - - VULKAN_HPP_CONSTEXPR InstanceCreateInfo( InstanceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InstanceCreateInfo( VkInstanceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : InstanceCreateInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - InstanceCreateInfo( VULKAN_HPP_NAMESPACE::InstanceCreateFlags flags_, - const VULKAN_HPP_NAMESPACE::ApplicationInfo * pApplicationInfo_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledLayerNames_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledExtensionNames_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , pApplicationInfo( pApplicationInfo_ ) - , enabledLayerCount( static_cast( pEnabledLayerNames_.size() ) ) - , ppEnabledLayerNames( pEnabledLayerNames_.data() ) - , enabledExtensionCount( static_cast( pEnabledExtensionNames_.size() ) ) - , ppEnabledExtensionNames( pEnabledExtensionNames_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - InstanceCreateInfo & operator=( InstanceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - InstanceCreateInfo & operator=( VkInstanceCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::InstanceCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setPApplicationInfo( const VULKAN_HPP_NAMESPACE::ApplicationInfo * pApplicationInfo_ ) VULKAN_HPP_NOEXCEPT - { - pApplicationInfo = pApplicationInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setEnabledLayerCount( uint32_t enabledLayerCount_ ) VULKAN_HPP_NOEXCEPT - { - enabledLayerCount = enabledLayerCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setPpEnabledLayerNames( const char * const * ppEnabledLayerNames_ ) VULKAN_HPP_NOEXCEPT - { - ppEnabledLayerNames = ppEnabledLayerNames_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - InstanceCreateInfo & - setPEnabledLayerNames( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledLayerNames_ ) VULKAN_HPP_NOEXCEPT - { - enabledLayerCount = static_cast( pEnabledLayerNames_.size() ); - ppEnabledLayerNames = pEnabledLayerNames_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setEnabledExtensionCount( uint32_t enabledExtensionCount_ ) VULKAN_HPP_NOEXCEPT - { - enabledExtensionCount = enabledExtensionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 InstanceCreateInfo & setPpEnabledExtensionNames( const char * const * ppEnabledExtensionNames_ ) VULKAN_HPP_NOEXCEPT - { - ppEnabledExtensionNames = ppEnabledExtensionNames_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - InstanceCreateInfo & - setPEnabledExtensionNames( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pEnabledExtensionNames_ ) VULKAN_HPP_NOEXCEPT - { - enabledExtensionCount = static_cast( pEnabledExtensionNames_.size() ); - ppEnabledExtensionNames = pEnabledExtensionNames_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkInstanceCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkInstanceCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pApplicationInfo, enabledLayerCount, ppEnabledLayerNames, enabledExtensionCount, ppEnabledExtensionNames ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( InstanceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = pApplicationInfo <=> rhs.pApplicationInfo; cmp != 0 ) - return cmp; - if ( auto cmp = enabledLayerCount <=> rhs.enabledLayerCount; cmp != 0 ) - return cmp; - for ( size_t i = 0; i < enabledLayerCount; ++i ) - { - if ( ppEnabledLayerNames[i] != rhs.ppEnabledLayerNames[i] ) - if ( auto cmp = strcmp( ppEnabledLayerNames[i], rhs.ppEnabledLayerNames[i] ); cmp != 0 ) - return cmp < 0 ? std::strong_ordering::less : std::strong_ordering::greater; - } - if ( auto cmp = enabledExtensionCount <=> rhs.enabledExtensionCount; cmp != 0 ) - return cmp; - for ( size_t i = 0; i < enabledExtensionCount; ++i ) - { - if ( ppEnabledExtensionNames[i] != rhs.ppEnabledExtensionNames[i] ) - if ( auto cmp = strcmp( ppEnabledExtensionNames[i], rhs.ppEnabledExtensionNames[i] ); cmp != 0 ) - return cmp < 0 ? std::strong_ordering::less : std::strong_ordering::greater; - } - - return std::strong_ordering::equivalent; - } -#endif - - bool operator==( InstanceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pApplicationInfo == rhs.pApplicationInfo ) && - ( enabledLayerCount == rhs.enabledLayerCount ) && - [this, rhs] - { - bool equal = true; - for ( size_t i = 0; equal && ( i < enabledLayerCount ); ++i ) - { - equal = ( ( ppEnabledLayerNames[i] == rhs.ppEnabledLayerNames[i] ) || ( strcmp( ppEnabledLayerNames[i], rhs.ppEnabledLayerNames[i] ) == 0 ) ); - } - return equal; - }() && ( enabledExtensionCount == rhs.enabledExtensionCount ) && - [this, rhs] - { - bool equal = true; - for ( size_t i = 0; equal && ( i < enabledExtensionCount ); ++i ) - { - equal = ( ( ppEnabledExtensionNames[i] == rhs.ppEnabledExtensionNames[i] ) || - ( strcmp( ppEnabledExtensionNames[i], rhs.ppEnabledExtensionNames[i] ) == 0 ) ); - } - return equal; - }(); - } - - bool operator!=( InstanceCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eInstanceCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::InstanceCreateFlags flags = {}; - const VULKAN_HPP_NAMESPACE::ApplicationInfo * pApplicationInfo = {}; - uint32_t enabledLayerCount = {}; - const char * const * ppEnabledLayerNames = {}; - uint32_t enabledExtensionCount = {}; - const char * const * ppEnabledExtensionNames = {}; - }; - - template <> - struct CppType - { - using Type = InstanceCreateInfo; - }; - - struct LayerProperties - { - using NativeType = VkLayerProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 LayerProperties( std::array const & layerName_ = {}, - uint32_t specVersion_ = {}, - uint32_t implementationVersion_ = {}, - std::array const & description_ = {} ) VULKAN_HPP_NOEXCEPT - : layerName( layerName_ ) - , specVersion( specVersion_ ) - , implementationVersion( implementationVersion_ ) - , description( description_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 LayerProperties( LayerProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - LayerProperties( VkLayerProperties const & rhs ) VULKAN_HPP_NOEXCEPT : LayerProperties( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - LayerProperties & operator=( LayerProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - LayerProperties & operator=( VkLayerProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkLayerProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkLayerProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( layerName, specVersion, implementationVersion, description ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( LayerProperties const & ) const = default; -#else - bool operator==( LayerProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( layerName == rhs.layerName ) && ( specVersion == rhs.specVersion ) && ( implementationVersion == rhs.implementationVersion ) && - ( description == rhs.description ); -# endif - } - - bool operator!=( LayerProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ArrayWrapper1D layerName = {}; - uint32_t specVersion = {}; - uint32_t implementationVersion = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - }; - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - struct MacOSSurfaceCreateInfoMVK - { - using NativeType = VkMacOSSurfaceCreateInfoMVK; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMacosSurfaceCreateInfoMVK; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MacOSSurfaceCreateInfoMVK( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateFlagsMVK flags_ = {}, - const void * pView_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pView( pView_ ) - { - } - - VULKAN_HPP_CONSTEXPR MacOSSurfaceCreateInfoMVK( MacOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MacOSSurfaceCreateInfoMVK( VkMacOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT - : MacOSSurfaceCreateInfoMVK( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MacOSSurfaceCreateInfoMVK & operator=( MacOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MacOSSurfaceCreateInfoMVK & operator=( VkMacOSSurfaceCreateInfoMVK const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MacOSSurfaceCreateInfoMVK & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MacOSSurfaceCreateInfoMVK & setFlags( VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateFlagsMVK flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MacOSSurfaceCreateInfoMVK & setPView( const void * pView_ ) VULKAN_HPP_NOEXCEPT - { - pView = pView_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMacOSSurfaceCreateInfoMVK const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMacOSSurfaceCreateInfoMVK &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pView ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MacOSSurfaceCreateInfoMVK const & ) const = default; -# else - bool operator==( MacOSSurfaceCreateInfoMVK const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pView == rhs.pView ); -# endif - } - - bool operator!=( MacOSSurfaceCreateInfoMVK const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMacosSurfaceCreateInfoMVK; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::MacOSSurfaceCreateFlagsMVK flags = {}; - const void * pView = {}; - }; - - template <> - struct CppType - { - using Type = MacOSSurfaceCreateInfoMVK; - }; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - struct MappedMemoryRange - { - using NativeType = VkMappedMemoryRange; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMappedMemoryRange; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MappedMemoryRange( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize offset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , offset( offset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR MappedMemoryRange( MappedMemoryRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MappedMemoryRange( VkMappedMemoryRange const & rhs ) VULKAN_HPP_NOEXCEPT : MappedMemoryRange( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MappedMemoryRange & operator=( MappedMemoryRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MappedMemoryRange & operator=( VkMappedMemoryRange const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MappedMemoryRange & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MappedMemoryRange & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MappedMemoryRange & setOffset( VULKAN_HPP_NAMESPACE::DeviceSize offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MappedMemoryRange & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMappedMemoryRange const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMappedMemoryRange &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, offset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MappedMemoryRange const & ) const = default; -#else - bool operator==( MappedMemoryRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( offset == rhs.offset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( MappedMemoryRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMappedMemoryRange; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::DeviceSize offset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - template <> - struct CppType - { - using Type = MappedMemoryRange; - }; - - struct MemoryAllocateFlagsInfo - { - using NativeType = VkMemoryAllocateFlagsInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryAllocateFlagsInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryAllocateFlagsInfo( VULKAN_HPP_NAMESPACE::MemoryAllocateFlags flags_ = {}, - uint32_t deviceMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , deviceMask( deviceMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryAllocateFlagsInfo( MemoryAllocateFlagsInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryAllocateFlagsInfo( VkMemoryAllocateFlagsInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryAllocateFlagsInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryAllocateFlagsInfo & operator=( MemoryAllocateFlagsInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryAllocateFlagsInfo & operator=( VkMemoryAllocateFlagsInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateFlagsInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateFlagsInfo & setFlags( VULKAN_HPP_NAMESPACE::MemoryAllocateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateFlagsInfo & setDeviceMask( uint32_t deviceMask_ ) VULKAN_HPP_NOEXCEPT - { - deviceMask = deviceMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryAllocateFlagsInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryAllocateFlagsInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, deviceMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryAllocateFlagsInfo const & ) const = default; -#else - bool operator==( MemoryAllocateFlagsInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( deviceMask == rhs.deviceMask ); -# endif - } - - bool operator!=( MemoryAllocateFlagsInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryAllocateFlagsInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::MemoryAllocateFlags flags = {}; - uint32_t deviceMask = {}; - }; - - template <> - struct CppType - { - using Type = MemoryAllocateFlagsInfo; - }; - using MemoryAllocateFlagsInfoKHR = MemoryAllocateFlagsInfo; - - struct MemoryAllocateInfo - { - using NativeType = VkMemoryAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryAllocateInfo( VULKAN_HPP_NAMESPACE::DeviceSize allocationSize_ = {}, - uint32_t memoryTypeIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , allocationSize( allocationSize_ ) - , memoryTypeIndex( memoryTypeIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryAllocateInfo( MemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryAllocateInfo( VkMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryAllocateInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryAllocateInfo & operator=( MemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryAllocateInfo & operator=( VkMemoryAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateInfo & setAllocationSize( VULKAN_HPP_NAMESPACE::DeviceSize allocationSize_ ) VULKAN_HPP_NOEXCEPT - { - allocationSize = allocationSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryAllocateInfo & setMemoryTypeIndex( uint32_t memoryTypeIndex_ ) VULKAN_HPP_NOEXCEPT - { - memoryTypeIndex = memoryTypeIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, allocationSize, memoryTypeIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryAllocateInfo const & ) const = default; -#else - bool operator==( MemoryAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( allocationSize == rhs.allocationSize ) && ( memoryTypeIndex == rhs.memoryTypeIndex ); -# endif - } - - bool operator!=( MemoryAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryAllocateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize allocationSize = {}; - uint32_t memoryTypeIndex = {}; - }; - - template <> - struct CppType - { - using Type = MemoryAllocateInfo; - }; - - struct MemoryBarrier - { - using NativeType = VkMemoryBarrier; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryBarrier; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryBarrier( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcAccessMask( srcAccessMask_ ) - , dstAccessMask( dstAccessMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryBarrier( MemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryBarrier( VkMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryBarrier( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryBarrier & operator=( MemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryBarrier & operator=( VkMemoryBarrier const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryBarrier & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryBarrier const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryBarrier &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcAccessMask, dstAccessMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryBarrier const & ) const = default; -#else - bool operator==( MemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcAccessMask == rhs.srcAccessMask ) && ( dstAccessMask == rhs.dstAccessMask ); -# endif - } - - bool operator!=( MemoryBarrier const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryBarrier; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask = {}; - }; - - template <> - struct CppType - { - using Type = MemoryBarrier; - }; - - struct MemoryDedicatedAllocateInfo - { - using NativeType = VkMemoryDedicatedAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryDedicatedAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryDedicatedAllocateInfo( VULKAN_HPP_NAMESPACE::Image image_ = {}, - VULKAN_HPP_NAMESPACE::Buffer buffer_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image( image_ ) - , buffer( buffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryDedicatedAllocateInfo( MemoryDedicatedAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryDedicatedAllocateInfo( VkMemoryDedicatedAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryDedicatedAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryDedicatedAllocateInfo & operator=( MemoryDedicatedAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryDedicatedAllocateInfo & operator=( VkMemoryDedicatedAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryDedicatedAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryDedicatedAllocateInfo & setImage( VULKAN_HPP_NAMESPACE::Image image_ ) VULKAN_HPP_NOEXCEPT - { - image = image_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryDedicatedAllocateInfo & setBuffer( VULKAN_HPP_NAMESPACE::Buffer buffer_ ) VULKAN_HPP_NOEXCEPT - { - buffer = buffer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryDedicatedAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryDedicatedAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image, buffer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryDedicatedAllocateInfo const & ) const = default; -#else - bool operator==( MemoryDedicatedAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image == rhs.image ) && ( buffer == rhs.buffer ); -# endif - } - - bool operator!=( MemoryDedicatedAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryDedicatedAllocateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image image = {}; - VULKAN_HPP_NAMESPACE::Buffer buffer = {}; - }; - - template <> - struct CppType - { - using Type = MemoryDedicatedAllocateInfo; - }; - using MemoryDedicatedAllocateInfoKHR = MemoryDedicatedAllocateInfo; - - struct MemoryDedicatedRequirements - { - using NativeType = VkMemoryDedicatedRequirements; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryDedicatedRequirements; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryDedicatedRequirements( VULKAN_HPP_NAMESPACE::Bool32 prefersDedicatedAllocation_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 requiresDedicatedAllocation_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , prefersDedicatedAllocation( prefersDedicatedAllocation_ ) - , requiresDedicatedAllocation( requiresDedicatedAllocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryDedicatedRequirements( MemoryDedicatedRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryDedicatedRequirements( VkMemoryDedicatedRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryDedicatedRequirements( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryDedicatedRequirements & operator=( MemoryDedicatedRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryDedicatedRequirements & operator=( VkMemoryDedicatedRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryDedicatedRequirements const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryDedicatedRequirements &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, prefersDedicatedAllocation, requiresDedicatedAllocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryDedicatedRequirements const & ) const = default; -#else - bool operator==( MemoryDedicatedRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( prefersDedicatedAllocation == rhs.prefersDedicatedAllocation ) && - ( requiresDedicatedAllocation == rhs.requiresDedicatedAllocation ); -# endif - } - - bool operator!=( MemoryDedicatedRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryDedicatedRequirements; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 prefersDedicatedAllocation = {}; - VULKAN_HPP_NAMESPACE::Bool32 requiresDedicatedAllocation = {}; - }; - - template <> - struct CppType - { - using Type = MemoryDedicatedRequirements; - }; - using MemoryDedicatedRequirementsKHR = MemoryDedicatedRequirements; - - struct MemoryFdPropertiesKHR - { - using NativeType = VkMemoryFdPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryFdPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryFdPropertiesKHR( uint32_t memoryTypeBits_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryFdPropertiesKHR( MemoryFdPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryFdPropertiesKHR( VkMemoryFdPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryFdPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryFdPropertiesKHR & operator=( MemoryFdPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryFdPropertiesKHR & operator=( VkMemoryFdPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryFdPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryFdPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryTypeBits ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryFdPropertiesKHR const & ) const = default; -#else - bool operator==( MemoryFdPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( MemoryFdPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryFdPropertiesKHR; - void * pNext = {}; - uint32_t memoryTypeBits = {}; - }; - - template <> - struct CppType - { - using Type = MemoryFdPropertiesKHR; - }; - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - struct MemoryGetAndroidHardwareBufferInfoANDROID - { - using NativeType = VkMemoryGetAndroidHardwareBufferInfoANDROID; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryGetAndroidHardwareBufferInfoANDROID; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryGetAndroidHardwareBufferInfoANDROID( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryGetAndroidHardwareBufferInfoANDROID( MemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetAndroidHardwareBufferInfoANDROID( VkMemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryGetAndroidHardwareBufferInfoANDROID( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryGetAndroidHardwareBufferInfoANDROID & operator=( MemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetAndroidHardwareBufferInfoANDROID & operator=( VkMemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryGetAndroidHardwareBufferInfoANDROID & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetAndroidHardwareBufferInfoANDROID & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryGetAndroidHardwareBufferInfoANDROID const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryGetAndroidHardwareBufferInfoANDROID &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryGetAndroidHardwareBufferInfoANDROID const & ) const = default; -# else - bool operator==( MemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ); -# endif - } - - bool operator!=( MemoryGetAndroidHardwareBufferInfoANDROID const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryGetAndroidHardwareBufferInfoANDROID; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - }; - - template <> - struct CppType - { - using Type = MemoryGetAndroidHardwareBufferInfoANDROID; - }; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - - struct MemoryGetFdInfoKHR - { - using NativeType = VkMemoryGetFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryGetFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryGetFdInfoKHR( - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryGetFdInfoKHR( MemoryGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetFdInfoKHR( VkMemoryGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryGetFdInfoKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryGetFdInfoKHR & operator=( MemoryGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetFdInfoKHR & operator=( VkMemoryGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryGetFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetFdInfoKHR & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetFdInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryGetFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryGetFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryGetFdInfoKHR const & ) const = default; -#else - bool operator==( MemoryGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( MemoryGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryGetFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = MemoryGetFdInfoKHR; - }; - - struct MemoryGetRemoteAddressInfoNV - { - using NativeType = VkMemoryGetRemoteAddressInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryGetRemoteAddressInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryGetRemoteAddressInfoNV( - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryGetRemoteAddressInfoNV( MemoryGetRemoteAddressInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetRemoteAddressInfoNV( VkMemoryGetRemoteAddressInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryGetRemoteAddressInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryGetRemoteAddressInfoNV & operator=( MemoryGetRemoteAddressInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetRemoteAddressInfoNV & operator=( VkMemoryGetRemoteAddressInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryGetRemoteAddressInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetRemoteAddressInfoNV & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetRemoteAddressInfoNV & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryGetRemoteAddressInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryGetRemoteAddressInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryGetRemoteAddressInfoNV const & ) const = default; -#else - bool operator==( MemoryGetRemoteAddressInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( MemoryGetRemoteAddressInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryGetRemoteAddressInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = MemoryGetRemoteAddressInfoNV; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct MemoryGetWin32HandleInfoKHR - { - using NativeType = VkMemoryGetWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryGetWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryGetWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryGetWin32HandleInfoKHR( MemoryGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetWin32HandleInfoKHR( VkMemoryGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryGetWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryGetWin32HandleInfoKHR & operator=( MemoryGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetWin32HandleInfoKHR & operator=( VkMemoryGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryGetWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetWin32HandleInfoKHR & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetWin32HandleInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryGetWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryGetWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, handleType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryGetWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( MemoryGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( MemoryGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryGetWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = MemoryGetWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct MemoryGetZirconHandleInfoFUCHSIA - { - using NativeType = VkMemoryGetZirconHandleInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryGetZirconHandleInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryGetZirconHandleInfoFUCHSIA( - VULKAN_HPP_NAMESPACE::DeviceMemory memory_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memory( memory_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryGetZirconHandleInfoFUCHSIA( MemoryGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetZirconHandleInfoFUCHSIA( VkMemoryGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryGetZirconHandleInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryGetZirconHandleInfoFUCHSIA & operator=( MemoryGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryGetZirconHandleInfoFUCHSIA & operator=( VkMemoryGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryGetZirconHandleInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetZirconHandleInfoFUCHSIA & setMemory( VULKAN_HPP_NAMESPACE::DeviceMemory memory_ ) VULKAN_HPP_NOEXCEPT - { - memory = memory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryGetZirconHandleInfoFUCHSIA & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryGetZirconHandleInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryGetZirconHandleInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memory, handleType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryGetZirconHandleInfoFUCHSIA const & ) const = default; -# else - bool operator==( MemoryGetZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memory == rhs.memory ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( MemoryGetZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryGetZirconHandleInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceMemory memory = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = MemoryGetZirconHandleInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct MemoryHeap - { - using NativeType = VkMemoryHeap; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryHeap( VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, VULKAN_HPP_NAMESPACE::MemoryHeapFlags flags_ = {} ) VULKAN_HPP_NOEXCEPT - : size( size_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryHeap( MemoryHeap const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryHeap( VkMemoryHeap const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryHeap( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryHeap & operator=( MemoryHeap const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryHeap & operator=( VkMemoryHeap const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryHeap const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryHeap &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( size, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryHeap const & ) const = default; -#else - bool operator==( MemoryHeap const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( size == rhs.size ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( MemoryHeap const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::MemoryHeapFlags flags = {}; - }; - - struct MemoryHostPointerPropertiesEXT - { - using NativeType = VkMemoryHostPointerPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryHostPointerPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryHostPointerPropertiesEXT( uint32_t memoryTypeBits_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryHostPointerPropertiesEXT( MemoryHostPointerPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryHostPointerPropertiesEXT( VkMemoryHostPointerPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryHostPointerPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryHostPointerPropertiesEXT & operator=( MemoryHostPointerPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryHostPointerPropertiesEXT & operator=( VkMemoryHostPointerPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryHostPointerPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryHostPointerPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryTypeBits ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryHostPointerPropertiesEXT const & ) const = default; -#else - bool operator==( MemoryHostPointerPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( MemoryHostPointerPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryHostPointerPropertiesEXT; - void * pNext = {}; - uint32_t memoryTypeBits = {}; - }; - - template <> - struct CppType - { - using Type = MemoryHostPointerPropertiesEXT; - }; - - struct MemoryOpaqueCaptureAddressAllocateInfo - { - using NativeType = VkMemoryOpaqueCaptureAddressAllocateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryOpaqueCaptureAddressAllocateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryOpaqueCaptureAddressAllocateInfo( uint64_t opaqueCaptureAddress_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , opaqueCaptureAddress( opaqueCaptureAddress_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryOpaqueCaptureAddressAllocateInfo( MemoryOpaqueCaptureAddressAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryOpaqueCaptureAddressAllocateInfo( VkMemoryOpaqueCaptureAddressAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryOpaqueCaptureAddressAllocateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryOpaqueCaptureAddressAllocateInfo & operator=( MemoryOpaqueCaptureAddressAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryOpaqueCaptureAddressAllocateInfo & operator=( VkMemoryOpaqueCaptureAddressAllocateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryOpaqueCaptureAddressAllocateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryOpaqueCaptureAddressAllocateInfo & setOpaqueCaptureAddress( uint64_t opaqueCaptureAddress_ ) VULKAN_HPP_NOEXCEPT - { - opaqueCaptureAddress = opaqueCaptureAddress_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryOpaqueCaptureAddressAllocateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryOpaqueCaptureAddressAllocateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, opaqueCaptureAddress ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryOpaqueCaptureAddressAllocateInfo const & ) const = default; -#else - bool operator==( MemoryOpaqueCaptureAddressAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( opaqueCaptureAddress == rhs.opaqueCaptureAddress ); -# endif - } - - bool operator!=( MemoryOpaqueCaptureAddressAllocateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryOpaqueCaptureAddressAllocateInfo; - const void * pNext = {}; - uint64_t opaqueCaptureAddress = {}; - }; - - template <> - struct CppType - { - using Type = MemoryOpaqueCaptureAddressAllocateInfo; - }; - using MemoryOpaqueCaptureAddressAllocateInfoKHR = MemoryOpaqueCaptureAddressAllocateInfo; - - struct MemoryPriorityAllocateInfoEXT - { - using NativeType = VkMemoryPriorityAllocateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryPriorityAllocateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryPriorityAllocateInfoEXT( float priority_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , priority( priority_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryPriorityAllocateInfoEXT( MemoryPriorityAllocateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryPriorityAllocateInfoEXT( VkMemoryPriorityAllocateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryPriorityAllocateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryPriorityAllocateInfoEXT & operator=( MemoryPriorityAllocateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryPriorityAllocateInfoEXT & operator=( VkMemoryPriorityAllocateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MemoryPriorityAllocateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MemoryPriorityAllocateInfoEXT & setPriority( float priority_ ) VULKAN_HPP_NOEXCEPT - { - priority = priority_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMemoryPriorityAllocateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryPriorityAllocateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, priority ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryPriorityAllocateInfoEXT const & ) const = default; -#else - bool operator==( MemoryPriorityAllocateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( priority == rhs.priority ); -# endif - } - - bool operator!=( MemoryPriorityAllocateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryPriorityAllocateInfoEXT; - const void * pNext = {}; - float priority = {}; - }; - - template <> - struct CppType - { - using Type = MemoryPriorityAllocateInfoEXT; - }; - - struct MemoryRequirements - { - using NativeType = VkMemoryRequirements; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryRequirements( VULKAN_HPP_NAMESPACE::DeviceSize size_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize alignment_ = {}, - uint32_t memoryTypeBits_ = {} ) VULKAN_HPP_NOEXCEPT - : size( size_ ) - , alignment( alignment_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryRequirements( MemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryRequirements( VkMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryRequirements( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryRequirements & operator=( MemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryRequirements & operator=( VkMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryRequirements const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryRequirements &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( size, alignment, memoryTypeBits ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryRequirements const & ) const = default; -#else - bool operator==( MemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( size == rhs.size ) && ( alignment == rhs.alignment ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( MemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - VULKAN_HPP_NAMESPACE::DeviceSize alignment = {}; - uint32_t memoryTypeBits = {}; - }; - - struct MemoryRequirements2 - { - using NativeType = VkMemoryRequirements2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryRequirements2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryRequirements2( VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryRequirements( memoryRequirements_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryRequirements2( MemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryRequirements2( VkMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryRequirements2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryRequirements2 & operator=( MemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryRequirements2 & operator=( VkMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryRequirements2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryRequirements2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryRequirements ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryRequirements2 const & ) const = default; -#else - bool operator==( MemoryRequirements2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryRequirements == rhs.memoryRequirements ); -# endif - } - - bool operator!=( MemoryRequirements2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryRequirements2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements = {}; - }; - - template <> - struct CppType - { - using Type = MemoryRequirements2; - }; - using MemoryRequirements2KHR = MemoryRequirements2; - - struct MemoryType - { - using NativeType = VkMemoryType; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryType( VULKAN_HPP_NAMESPACE::MemoryPropertyFlags propertyFlags_ = {}, uint32_t heapIndex_ = {} ) VULKAN_HPP_NOEXCEPT - : propertyFlags( propertyFlags_ ) - , heapIndex( heapIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryType( MemoryType const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryType( VkMemoryType const & rhs ) VULKAN_HPP_NOEXCEPT : MemoryType( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryType & operator=( MemoryType const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryType & operator=( VkMemoryType const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryType const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryType &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( propertyFlags, heapIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryType const & ) const = default; -#else - bool operator==( MemoryType const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( propertyFlags == rhs.propertyFlags ) && ( heapIndex == rhs.heapIndex ); -# endif - } - - bool operator!=( MemoryType const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::MemoryPropertyFlags propertyFlags = {}; - uint32_t heapIndex = {}; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct MemoryWin32HandlePropertiesKHR - { - using NativeType = VkMemoryWin32HandlePropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryWin32HandlePropertiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryWin32HandlePropertiesKHR( uint32_t memoryTypeBits_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryWin32HandlePropertiesKHR( MemoryWin32HandlePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryWin32HandlePropertiesKHR( VkMemoryWin32HandlePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryWin32HandlePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryWin32HandlePropertiesKHR & operator=( MemoryWin32HandlePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryWin32HandlePropertiesKHR & operator=( VkMemoryWin32HandlePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryWin32HandlePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryWin32HandlePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryTypeBits ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryWin32HandlePropertiesKHR const & ) const = default; -# else - bool operator==( MemoryWin32HandlePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( MemoryWin32HandlePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryWin32HandlePropertiesKHR; - void * pNext = {}; - uint32_t memoryTypeBits = {}; - }; - - template <> - struct CppType - { - using Type = MemoryWin32HandlePropertiesKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct MemoryZirconHandlePropertiesFUCHSIA - { - using NativeType = VkMemoryZirconHandlePropertiesFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMemoryZirconHandlePropertiesFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MemoryZirconHandlePropertiesFUCHSIA( uint32_t memoryTypeBits_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryTypeBits( memoryTypeBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR MemoryZirconHandlePropertiesFUCHSIA( MemoryZirconHandlePropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryZirconHandlePropertiesFUCHSIA( VkMemoryZirconHandlePropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : MemoryZirconHandlePropertiesFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MemoryZirconHandlePropertiesFUCHSIA & operator=( MemoryZirconHandlePropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MemoryZirconHandlePropertiesFUCHSIA & operator=( VkMemoryZirconHandlePropertiesFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMemoryZirconHandlePropertiesFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMemoryZirconHandlePropertiesFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryTypeBits ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MemoryZirconHandlePropertiesFUCHSIA const & ) const = default; -# else - bool operator==( MemoryZirconHandlePropertiesFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryTypeBits == rhs.memoryTypeBits ); -# endif - } - - bool operator!=( MemoryZirconHandlePropertiesFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMemoryZirconHandlePropertiesFUCHSIA; - void * pNext = {}; - uint32_t memoryTypeBits = {}; - }; - - template <> - struct CppType - { - using Type = MemoryZirconHandlePropertiesFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - struct MetalSurfaceCreateInfoEXT - { - using NativeType = VkMetalSurfaceCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMetalSurfaceCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MetalSurfaceCreateInfoEXT( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateFlagsEXT flags_ = {}, - const CAMetalLayer * pLayer_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pLayer( pLayer_ ) - { - } - - VULKAN_HPP_CONSTEXPR MetalSurfaceCreateInfoEXT( MetalSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MetalSurfaceCreateInfoEXT( VkMetalSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MetalSurfaceCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MetalSurfaceCreateInfoEXT & operator=( MetalSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MetalSurfaceCreateInfoEXT & operator=( VkMetalSurfaceCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MetalSurfaceCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MetalSurfaceCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::MetalSurfaceCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MetalSurfaceCreateInfoEXT & setPLayer( const CAMetalLayer * pLayer_ ) VULKAN_HPP_NOEXCEPT - { - pLayer = pLayer_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMetalSurfaceCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMetalSurfaceCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, pLayer ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MetalSurfaceCreateInfoEXT const & ) const = default; -# else - bool operator==( MetalSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pLayer == rhs.pLayer ); -# endif - } - - bool operator!=( MetalSurfaceCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMetalSurfaceCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::MetalSurfaceCreateFlagsEXT flags = {}; - const CAMetalLayer * pLayer = {}; - }; - - template <> - struct CppType - { - using Type = MetalSurfaceCreateInfoEXT; - }; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - struct MultiDrawIndexedInfoEXT - { - using NativeType = VkMultiDrawIndexedInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MultiDrawIndexedInfoEXT( uint32_t firstIndex_ = {}, uint32_t indexCount_ = {}, int32_t vertexOffset_ = {} ) VULKAN_HPP_NOEXCEPT - : firstIndex( firstIndex_ ) - , indexCount( indexCount_ ) - , vertexOffset( vertexOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR MultiDrawIndexedInfoEXT( MultiDrawIndexedInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiDrawIndexedInfoEXT( VkMultiDrawIndexedInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MultiDrawIndexedInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MultiDrawIndexedInfoEXT & operator=( MultiDrawIndexedInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiDrawIndexedInfoEXT & operator=( VkMultiDrawIndexedInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MultiDrawIndexedInfoEXT & setFirstIndex( uint32_t firstIndex_ ) VULKAN_HPP_NOEXCEPT - { - firstIndex = firstIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultiDrawIndexedInfoEXT & setIndexCount( uint32_t indexCount_ ) VULKAN_HPP_NOEXCEPT - { - indexCount = indexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultiDrawIndexedInfoEXT & setVertexOffset( int32_t vertexOffset_ ) VULKAN_HPP_NOEXCEPT - { - vertexOffset = vertexOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMultiDrawIndexedInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMultiDrawIndexedInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( firstIndex, indexCount, vertexOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MultiDrawIndexedInfoEXT const & ) const = default; -#else - bool operator==( MultiDrawIndexedInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( firstIndex == rhs.firstIndex ) && ( indexCount == rhs.indexCount ) && ( vertexOffset == rhs.vertexOffset ); -# endif - } - - bool operator!=( MultiDrawIndexedInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t firstIndex = {}; - uint32_t indexCount = {}; - int32_t vertexOffset = {}; - }; - - struct MultiDrawInfoEXT - { - using NativeType = VkMultiDrawInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MultiDrawInfoEXT( uint32_t firstVertex_ = {}, uint32_t vertexCount_ = {} ) VULKAN_HPP_NOEXCEPT - : firstVertex( firstVertex_ ) - , vertexCount( vertexCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR MultiDrawInfoEXT( MultiDrawInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiDrawInfoEXT( VkMultiDrawInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT : MultiDrawInfoEXT( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MultiDrawInfoEXT & operator=( MultiDrawInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiDrawInfoEXT & operator=( VkMultiDrawInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MultiDrawInfoEXT & setFirstVertex( uint32_t firstVertex_ ) VULKAN_HPP_NOEXCEPT - { - firstVertex = firstVertex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultiDrawInfoEXT & setVertexCount( uint32_t vertexCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexCount = vertexCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMultiDrawInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMultiDrawInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( firstVertex, vertexCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MultiDrawInfoEXT const & ) const = default; -#else - bool operator==( MultiDrawInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( firstVertex == rhs.firstVertex ) && ( vertexCount == rhs.vertexCount ); -# endif - } - - bool operator!=( MultiDrawInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t firstVertex = {}; - uint32_t vertexCount = {}; - }; - - struct MultisamplePropertiesEXT - { - using NativeType = VkMultisamplePropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMultisamplePropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MultisamplePropertiesEXT( VULKAN_HPP_NAMESPACE::Extent2D maxSampleLocationGridSize_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxSampleLocationGridSize( maxSampleLocationGridSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR MultisamplePropertiesEXT( MultisamplePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultisamplePropertiesEXT( VkMultisamplePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MultisamplePropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MultisamplePropertiesEXT & operator=( MultisamplePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultisamplePropertiesEXT & operator=( VkMultisamplePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkMultisamplePropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMultisamplePropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxSampleLocationGridSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MultisamplePropertiesEXT const & ) const = default; -#else - bool operator==( MultisamplePropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxSampleLocationGridSize == rhs.maxSampleLocationGridSize ); -# endif - } - - bool operator!=( MultisamplePropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMultisamplePropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxSampleLocationGridSize = {}; - }; - - template <> - struct CppType - { - using Type = MultisamplePropertiesEXT; - }; - - struct MultisampledRenderToSingleSampledInfoEXT - { - using NativeType = VkMultisampledRenderToSingleSampledInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMultisampledRenderToSingleSampledInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - MultisampledRenderToSingleSampledInfoEXT( VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampledEnable_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , multisampledRenderToSingleSampledEnable( multisampledRenderToSingleSampledEnable_ ) - , rasterizationSamples( rasterizationSamples_ ) - { - } - - VULKAN_HPP_CONSTEXPR MultisampledRenderToSingleSampledInfoEXT( MultisampledRenderToSingleSampledInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultisampledRenderToSingleSampledInfoEXT( VkMultisampledRenderToSingleSampledInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : MultisampledRenderToSingleSampledInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MultisampledRenderToSingleSampledInfoEXT & operator=( MultisampledRenderToSingleSampledInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultisampledRenderToSingleSampledInfoEXT & operator=( VkMultisampledRenderToSingleSampledInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MultisampledRenderToSingleSampledInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultisampledRenderToSingleSampledInfoEXT & - setMultisampledRenderToSingleSampledEnable( VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampledEnable_ ) VULKAN_HPP_NOEXCEPT - { - multisampledRenderToSingleSampledEnable = multisampledRenderToSingleSampledEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultisampledRenderToSingleSampledInfoEXT & - setRasterizationSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationSamples = rasterizationSamples_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMultisampledRenderToSingleSampledInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMultisampledRenderToSingleSampledInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, multisampledRenderToSingleSampledEnable, rasterizationSamples ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MultisampledRenderToSingleSampledInfoEXT const & ) const = default; -#else - bool operator==( MultisampledRenderToSingleSampledInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( multisampledRenderToSingleSampledEnable == rhs.multisampledRenderToSingleSampledEnable ) && - ( rasterizationSamples == rhs.rasterizationSamples ); -# endif - } - - bool operator!=( MultisampledRenderToSingleSampledInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMultisampledRenderToSingleSampledInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampledEnable = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits rasterizationSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - }; - - template <> - struct CppType - { - using Type = MultisampledRenderToSingleSampledInfoEXT; - }; - - struct MultiviewPerViewAttributesInfoNVX - { - using NativeType = VkMultiviewPerViewAttributesInfoNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMultiviewPerViewAttributesInfoNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MultiviewPerViewAttributesInfoNVX( VULKAN_HPP_NAMESPACE::Bool32 perViewAttributes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 perViewAttributesPositionXOnly_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , perViewAttributes( perViewAttributes_ ) - , perViewAttributesPositionXOnly( perViewAttributesPositionXOnly_ ) - { - } - - VULKAN_HPP_CONSTEXPR MultiviewPerViewAttributesInfoNVX( MultiviewPerViewAttributesInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiviewPerViewAttributesInfoNVX( VkMultiviewPerViewAttributesInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : MultiviewPerViewAttributesInfoNVX( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MultiviewPerViewAttributesInfoNVX & operator=( MultiviewPerViewAttributesInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MultiviewPerViewAttributesInfoNVX & operator=( VkMultiviewPerViewAttributesInfoNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MultiviewPerViewAttributesInfoNVX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultiviewPerViewAttributesInfoNVX & setPerViewAttributes( VULKAN_HPP_NAMESPACE::Bool32 perViewAttributes_ ) VULKAN_HPP_NOEXCEPT - { - perViewAttributes = perViewAttributes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MultiviewPerViewAttributesInfoNVX & - setPerViewAttributesPositionXOnly( VULKAN_HPP_NAMESPACE::Bool32 perViewAttributesPositionXOnly_ ) VULKAN_HPP_NOEXCEPT - { - perViewAttributesPositionXOnly = perViewAttributesPositionXOnly_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMultiviewPerViewAttributesInfoNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMultiviewPerViewAttributesInfoNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, perViewAttributes, perViewAttributesPositionXOnly ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MultiviewPerViewAttributesInfoNVX const & ) const = default; -#else - bool operator==( MultiviewPerViewAttributesInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( perViewAttributes == rhs.perViewAttributes ) && - ( perViewAttributesPositionXOnly == rhs.perViewAttributesPositionXOnly ); -# endif - } - - bool operator!=( MultiviewPerViewAttributesInfoNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMultiviewPerViewAttributesInfoNVX; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 perViewAttributes = {}; - VULKAN_HPP_NAMESPACE::Bool32 perViewAttributesPositionXOnly = {}; - }; - - template <> - struct CppType - { - using Type = MultiviewPerViewAttributesInfoNVX; - }; - - struct MutableDescriptorTypeListVALVE - { - using NativeType = VkMutableDescriptorTypeListVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MutableDescriptorTypeListVALVE( uint32_t descriptorTypeCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorType * pDescriptorTypes_ = {} ) VULKAN_HPP_NOEXCEPT - : descriptorTypeCount( descriptorTypeCount_ ) - , pDescriptorTypes( pDescriptorTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR MutableDescriptorTypeListVALVE( MutableDescriptorTypeListVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MutableDescriptorTypeListVALVE( VkMutableDescriptorTypeListVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : MutableDescriptorTypeListVALVE( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - MutableDescriptorTypeListVALVE( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorTypes_ ) - : descriptorTypeCount( static_cast( descriptorTypes_.size() ) ), pDescriptorTypes( descriptorTypes_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MutableDescriptorTypeListVALVE & operator=( MutableDescriptorTypeListVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MutableDescriptorTypeListVALVE & operator=( VkMutableDescriptorTypeListVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MutableDescriptorTypeListVALVE & setDescriptorTypeCount( uint32_t descriptorTypeCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorTypeCount = descriptorTypeCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MutableDescriptorTypeListVALVE & - setPDescriptorTypes( const VULKAN_HPP_NAMESPACE::DescriptorType * pDescriptorTypes_ ) VULKAN_HPP_NOEXCEPT - { - pDescriptorTypes = pDescriptorTypes_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - MutableDescriptorTypeListVALVE & setDescriptorTypes( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & descriptorTypes_ ) VULKAN_HPP_NOEXCEPT - { - descriptorTypeCount = static_cast( descriptorTypes_.size() ); - pDescriptorTypes = descriptorTypes_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMutableDescriptorTypeListVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMutableDescriptorTypeListVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( descriptorTypeCount, pDescriptorTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MutableDescriptorTypeListVALVE const & ) const = default; -#else - bool operator==( MutableDescriptorTypeListVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( descriptorTypeCount == rhs.descriptorTypeCount ) && ( pDescriptorTypes == rhs.pDescriptorTypes ); -# endif - } - - bool operator!=( MutableDescriptorTypeListVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t descriptorTypeCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorType * pDescriptorTypes = {}; - }; - - struct MutableDescriptorTypeCreateInfoVALVE - { - using NativeType = VkMutableDescriptorTypeCreateInfoVALVE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eMutableDescriptorTypeCreateInfoVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR MutableDescriptorTypeCreateInfoVALVE( uint32_t mutableDescriptorTypeListCount_ = {}, - const VULKAN_HPP_NAMESPACE::MutableDescriptorTypeListVALVE * pMutableDescriptorTypeLists_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mutableDescriptorTypeListCount( mutableDescriptorTypeListCount_ ) - , pMutableDescriptorTypeLists( pMutableDescriptorTypeLists_ ) - { - } - - VULKAN_HPP_CONSTEXPR MutableDescriptorTypeCreateInfoVALVE( MutableDescriptorTypeCreateInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MutableDescriptorTypeCreateInfoVALVE( VkMutableDescriptorTypeCreateInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : MutableDescriptorTypeCreateInfoVALVE( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - MutableDescriptorTypeCreateInfoVALVE( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & mutableDescriptorTypeLists_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , mutableDescriptorTypeListCount( static_cast( mutableDescriptorTypeLists_.size() ) ) - , pMutableDescriptorTypeLists( mutableDescriptorTypeLists_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - MutableDescriptorTypeCreateInfoVALVE & operator=( MutableDescriptorTypeCreateInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - MutableDescriptorTypeCreateInfoVALVE & operator=( VkMutableDescriptorTypeCreateInfoVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 MutableDescriptorTypeCreateInfoVALVE & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MutableDescriptorTypeCreateInfoVALVE & - setMutableDescriptorTypeListCount( uint32_t mutableDescriptorTypeListCount_ ) VULKAN_HPP_NOEXCEPT - { - mutableDescriptorTypeListCount = mutableDescriptorTypeListCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 MutableDescriptorTypeCreateInfoVALVE & - setPMutableDescriptorTypeLists( const VULKAN_HPP_NAMESPACE::MutableDescriptorTypeListVALVE * pMutableDescriptorTypeLists_ ) VULKAN_HPP_NOEXCEPT - { - pMutableDescriptorTypeLists = pMutableDescriptorTypeLists_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - MutableDescriptorTypeCreateInfoVALVE & setMutableDescriptorTypeLists( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & mutableDescriptorTypeLists_ ) - VULKAN_HPP_NOEXCEPT - { - mutableDescriptorTypeListCount = static_cast( mutableDescriptorTypeLists_.size() ); - pMutableDescriptorTypeLists = mutableDescriptorTypeLists_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkMutableDescriptorTypeCreateInfoVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkMutableDescriptorTypeCreateInfoVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mutableDescriptorTypeListCount, pMutableDescriptorTypeLists ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( MutableDescriptorTypeCreateInfoVALVE const & ) const = default; -#else - bool operator==( MutableDescriptorTypeCreateInfoVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mutableDescriptorTypeListCount == rhs.mutableDescriptorTypeListCount ) && - ( pMutableDescriptorTypeLists == rhs.pMutableDescriptorTypeLists ); -# endif - } - - bool operator!=( MutableDescriptorTypeCreateInfoVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eMutableDescriptorTypeCreateInfoVALVE; - const void * pNext = {}; - uint32_t mutableDescriptorTypeListCount = {}; - const VULKAN_HPP_NAMESPACE::MutableDescriptorTypeListVALVE * pMutableDescriptorTypeLists = {}; - }; - - template <> - struct CppType - { - using Type = MutableDescriptorTypeCreateInfoVALVE; - }; - - struct PastPresentationTimingGOOGLE - { - using NativeType = VkPastPresentationTimingGOOGLE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PastPresentationTimingGOOGLE( uint32_t presentID_ = {}, - uint64_t desiredPresentTime_ = {}, - uint64_t actualPresentTime_ = {}, - uint64_t earliestPresentTime_ = {}, - uint64_t presentMargin_ = {} ) VULKAN_HPP_NOEXCEPT - : presentID( presentID_ ) - , desiredPresentTime( desiredPresentTime_ ) - , actualPresentTime( actualPresentTime_ ) - , earliestPresentTime( earliestPresentTime_ ) - , presentMargin( presentMargin_ ) - { - } - - VULKAN_HPP_CONSTEXPR PastPresentationTimingGOOGLE( PastPresentationTimingGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PastPresentationTimingGOOGLE( VkPastPresentationTimingGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - : PastPresentationTimingGOOGLE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PastPresentationTimingGOOGLE & operator=( PastPresentationTimingGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PastPresentationTimingGOOGLE & operator=( VkPastPresentationTimingGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPastPresentationTimingGOOGLE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPastPresentationTimingGOOGLE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( presentID, desiredPresentTime, actualPresentTime, earliestPresentTime, presentMargin ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PastPresentationTimingGOOGLE const & ) const = default; -#else - bool operator==( PastPresentationTimingGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( presentID == rhs.presentID ) && ( desiredPresentTime == rhs.desiredPresentTime ) && ( actualPresentTime == rhs.actualPresentTime ) && - ( earliestPresentTime == rhs.earliestPresentTime ) && ( presentMargin == rhs.presentMargin ); -# endif - } - - bool operator!=( PastPresentationTimingGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t presentID = {}; - uint64_t desiredPresentTime = {}; - uint64_t actualPresentTime = {}; - uint64_t earliestPresentTime = {}; - uint64_t presentMargin = {}; - }; - - struct PerformanceConfigurationAcquireInfoINTEL - { - using NativeType = VkPerformanceConfigurationAcquireInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceConfigurationAcquireInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PerformanceConfigurationAcquireInfoINTEL( VULKAN_HPP_NAMESPACE::PerformanceConfigurationTypeINTEL type_ = - VULKAN_HPP_NAMESPACE::PerformanceConfigurationTypeINTEL::eCommandQueueMetricsDiscoveryActivated, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - { - } - - VULKAN_HPP_CONSTEXPR PerformanceConfigurationAcquireInfoINTEL( PerformanceConfigurationAcquireInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceConfigurationAcquireInfoINTEL( VkPerformanceConfigurationAcquireInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceConfigurationAcquireInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceConfigurationAcquireInfoINTEL & operator=( PerformanceConfigurationAcquireInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceConfigurationAcquireInfoINTEL & operator=( VkPerformanceConfigurationAcquireInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceConfigurationAcquireInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceConfigurationAcquireInfoINTEL & - setType( VULKAN_HPP_NAMESPACE::PerformanceConfigurationTypeINTEL type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceConfigurationAcquireInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceConfigurationAcquireInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceConfigurationAcquireInfoINTEL const & ) const = default; -#else - bool operator==( PerformanceConfigurationAcquireInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ); -# endif - } - - bool operator!=( PerformanceConfigurationAcquireInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceConfigurationAcquireInfoINTEL; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PerformanceConfigurationTypeINTEL type = - VULKAN_HPP_NAMESPACE::PerformanceConfigurationTypeINTEL::eCommandQueueMetricsDiscoveryActivated; - }; - - template <> - struct CppType - { - using Type = PerformanceConfigurationAcquireInfoINTEL; - }; - - struct PerformanceCounterDescriptionKHR - { - using NativeType = VkPerformanceCounterDescriptionKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceCounterDescriptionKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterDescriptionKHR( VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionFlagsKHR flags_ = {}, - std::array const & name_ = {}, - std::array const & category_ = {}, - std::array const & description_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , name( name_ ) - , category( category_ ) - , description( description_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterDescriptionKHR( PerformanceCounterDescriptionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceCounterDescriptionKHR( VkPerformanceCounterDescriptionKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceCounterDescriptionKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceCounterDescriptionKHR & operator=( PerformanceCounterDescriptionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceCounterDescriptionKHR & operator=( VkPerformanceCounterDescriptionKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPerformanceCounterDescriptionKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceCounterDescriptionKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, name, category, description ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceCounterDescriptionKHR const & ) const = default; -#else - bool operator==( PerformanceCounterDescriptionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( name == rhs.name ) && ( category == rhs.category ) && - ( description == rhs.description ); -# endif - } - - bool operator!=( PerformanceCounterDescriptionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceCounterDescriptionKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PerformanceCounterDescriptionFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D name = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D category = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceCounterDescriptionKHR; - }; - - struct PerformanceCounterKHR - { - using NativeType = VkPerformanceCounterKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceCounterKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PerformanceCounterKHR( VULKAN_HPP_NAMESPACE::PerformanceCounterUnitKHR unit_ = VULKAN_HPP_NAMESPACE::PerformanceCounterUnitKHR::eGeneric, - VULKAN_HPP_NAMESPACE::PerformanceCounterScopeKHR scope_ = VULKAN_HPP_NAMESPACE::PerformanceCounterScopeKHR::eCommandBuffer, - VULKAN_HPP_NAMESPACE::PerformanceCounterStorageKHR storage_ = VULKAN_HPP_NAMESPACE::PerformanceCounterStorageKHR::eInt32, - std::array const & uuid_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , unit( unit_ ) - , scope( scope_ ) - , storage( storage_ ) - , uuid( uuid_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterKHR( PerformanceCounterKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceCounterKHR( VkPerformanceCounterKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceCounterKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceCounterKHR & operator=( PerformanceCounterKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceCounterKHR & operator=( VkPerformanceCounterKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPerformanceCounterKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceCounterKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, unit, scope, storage, uuid ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceCounterKHR const & ) const = default; -#else - bool operator==( PerformanceCounterKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( unit == rhs.unit ) && ( scope == rhs.scope ) && ( storage == rhs.storage ) && - ( uuid == rhs.uuid ); -# endif - } - - bool operator!=( PerformanceCounterKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceCounterKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PerformanceCounterUnitKHR unit = VULKAN_HPP_NAMESPACE::PerformanceCounterUnitKHR::eGeneric; - VULKAN_HPP_NAMESPACE::PerformanceCounterScopeKHR scope = VULKAN_HPP_NAMESPACE::PerformanceCounterScopeKHR::eCommandBuffer; - VULKAN_HPP_NAMESPACE::PerformanceCounterStorageKHR storage = VULKAN_HPP_NAMESPACE::PerformanceCounterStorageKHR::eInt32; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D uuid = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceCounterKHR; - }; - - union PerformanceCounterResultKHR - { - using NativeType = VkPerformanceCounterResultKHR; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( int32_t int32_ = {} ) : int32( int32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( int64_t int64_ ) : int64( int64_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( uint32_t uint32_ ) : uint32( uint32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( uint64_t uint64_ ) : uint64( uint64_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( float float32_ ) : float32( float32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR( double float64_ ) : float64( float64_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setInt32( int32_t int32_ ) VULKAN_HPP_NOEXCEPT - { - int32 = int32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setInt64( int64_t int64_ ) VULKAN_HPP_NOEXCEPT - { - int64 = int64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setUint32( uint32_t uint32_ ) VULKAN_HPP_NOEXCEPT - { - uint32 = uint32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setUint64( uint64_t uint64_ ) VULKAN_HPP_NOEXCEPT - { - uint64 = uint64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setFloat32( float float32_ ) VULKAN_HPP_NOEXCEPT - { - float32 = float32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceCounterResultKHR & setFloat64( double float64_ ) VULKAN_HPP_NOEXCEPT - { - float64 = float64_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkPerformanceCounterResultKHR const &() const - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceCounterResultKHR &() - { - return *reinterpret_cast( this ); - } - - int32_t int32; - int64_t int64; - uint32_t uint32; - uint64_t uint64; - float float32; - double float64; - }; - - struct PerformanceMarkerInfoINTEL - { - using NativeType = VkPerformanceMarkerInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceMarkerInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PerformanceMarkerInfoINTEL( uint64_t marker_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , marker( marker_ ) - { - } - - VULKAN_HPP_CONSTEXPR PerformanceMarkerInfoINTEL( PerformanceMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceMarkerInfoINTEL( VkPerformanceMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceMarkerInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceMarkerInfoINTEL & operator=( PerformanceMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceMarkerInfoINTEL & operator=( VkPerformanceMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceMarkerInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceMarkerInfoINTEL & setMarker( uint64_t marker_ ) VULKAN_HPP_NOEXCEPT - { - marker = marker_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceMarkerInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceMarkerInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, marker ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceMarkerInfoINTEL const & ) const = default; -#else - bool operator==( PerformanceMarkerInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( marker == rhs.marker ); -# endif - } - - bool operator!=( PerformanceMarkerInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceMarkerInfoINTEL; - const void * pNext = {}; - uint64_t marker = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceMarkerInfoINTEL; - }; - - struct PerformanceOverrideInfoINTEL - { - using NativeType = VkPerformanceOverrideInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceOverrideInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PerformanceOverrideInfoINTEL( - VULKAN_HPP_NAMESPACE::PerformanceOverrideTypeINTEL type_ = VULKAN_HPP_NAMESPACE::PerformanceOverrideTypeINTEL::eNullHardware, - VULKAN_HPP_NAMESPACE::Bool32 enable_ = {}, - uint64_t parameter_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , enable( enable_ ) - , parameter( parameter_ ) - { - } - - VULKAN_HPP_CONSTEXPR PerformanceOverrideInfoINTEL( PerformanceOverrideInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceOverrideInfoINTEL( VkPerformanceOverrideInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceOverrideInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceOverrideInfoINTEL & operator=( PerformanceOverrideInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceOverrideInfoINTEL & operator=( VkPerformanceOverrideInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceOverrideInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceOverrideInfoINTEL & setType( VULKAN_HPP_NAMESPACE::PerformanceOverrideTypeINTEL type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceOverrideInfoINTEL & setEnable( VULKAN_HPP_NAMESPACE::Bool32 enable_ ) VULKAN_HPP_NOEXCEPT - { - enable = enable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceOverrideInfoINTEL & setParameter( uint64_t parameter_ ) VULKAN_HPP_NOEXCEPT - { - parameter = parameter_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceOverrideInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceOverrideInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type, enable, parameter ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceOverrideInfoINTEL const & ) const = default; -#else - bool operator==( PerformanceOverrideInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ) && ( enable == rhs.enable ) && ( parameter == rhs.parameter ); -# endif - } - - bool operator!=( PerformanceOverrideInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceOverrideInfoINTEL; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PerformanceOverrideTypeINTEL type = VULKAN_HPP_NAMESPACE::PerformanceOverrideTypeINTEL::eNullHardware; - VULKAN_HPP_NAMESPACE::Bool32 enable = {}; - uint64_t parameter = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceOverrideInfoINTEL; - }; - - struct PerformanceQuerySubmitInfoKHR - { - using NativeType = VkPerformanceQuerySubmitInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceQuerySubmitInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PerformanceQuerySubmitInfoKHR( uint32_t counterPassIndex_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , counterPassIndex( counterPassIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR PerformanceQuerySubmitInfoKHR( PerformanceQuerySubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceQuerySubmitInfoKHR( VkPerformanceQuerySubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceQuerySubmitInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceQuerySubmitInfoKHR & operator=( PerformanceQuerySubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceQuerySubmitInfoKHR & operator=( VkPerformanceQuerySubmitInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceQuerySubmitInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceQuerySubmitInfoKHR & setCounterPassIndex( uint32_t counterPassIndex_ ) VULKAN_HPP_NOEXCEPT - { - counterPassIndex = counterPassIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceQuerySubmitInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceQuerySubmitInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, counterPassIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceQuerySubmitInfoKHR const & ) const = default; -#else - bool operator==( PerformanceQuerySubmitInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( counterPassIndex == rhs.counterPassIndex ); -# endif - } - - bool operator!=( PerformanceQuerySubmitInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceQuerySubmitInfoKHR; - const void * pNext = {}; - uint32_t counterPassIndex = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceQuerySubmitInfoKHR; - }; - - struct PerformanceStreamMarkerInfoINTEL - { - using NativeType = VkPerformanceStreamMarkerInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePerformanceStreamMarkerInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PerformanceStreamMarkerInfoINTEL( uint32_t marker_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , marker( marker_ ) - { - } - - VULKAN_HPP_CONSTEXPR PerformanceStreamMarkerInfoINTEL( PerformanceStreamMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceStreamMarkerInfoINTEL( VkPerformanceStreamMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceStreamMarkerInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceStreamMarkerInfoINTEL & operator=( PerformanceStreamMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceStreamMarkerInfoINTEL & operator=( VkPerformanceStreamMarkerInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceStreamMarkerInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceStreamMarkerInfoINTEL & setMarker( uint32_t marker_ ) VULKAN_HPP_NOEXCEPT - { - marker = marker_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceStreamMarkerInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceStreamMarkerInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, marker ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PerformanceStreamMarkerInfoINTEL const & ) const = default; -#else - bool operator==( PerformanceStreamMarkerInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( marker == rhs.marker ); -# endif - } - - bool operator!=( PerformanceStreamMarkerInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePerformanceStreamMarkerInfoINTEL; - const void * pNext = {}; - uint32_t marker = {}; - }; - - template <> - struct CppType - { - using Type = PerformanceStreamMarkerInfoINTEL; - }; - - union PerformanceValueDataINTEL - { - using NativeType = VkPerformanceValueDataINTEL; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL( uint32_t value32_ = {} ) : value32( value32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL( uint64_t value64_ ) : value64( value64_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL( float valueFloat_ ) : valueFloat( valueFloat_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL( const char * valueString_ ) : valueString( valueString_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL & setValue32( uint32_t value32_ ) VULKAN_HPP_NOEXCEPT - { - value32 = value32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL & setValue64( uint64_t value64_ ) VULKAN_HPP_NOEXCEPT - { - value64 = value64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL & setValueFloat( float valueFloat_ ) VULKAN_HPP_NOEXCEPT - { - valueFloat = valueFloat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL & setValueBool( VULKAN_HPP_NAMESPACE::Bool32 valueBool_ ) VULKAN_HPP_NOEXCEPT - { - valueBool = valueBool_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueDataINTEL & setValueString( const char * valueString_ ) VULKAN_HPP_NOEXCEPT - { - valueString = valueString_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkPerformanceValueDataINTEL const &() const - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceValueDataINTEL &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - uint32_t value32; - uint64_t value64; - float valueFloat; - VULKAN_HPP_NAMESPACE::Bool32 valueBool; - const char * valueString; -#else - uint32_t value32; - uint64_t value64; - float valueFloat; - VkBool32 valueBool; - const char * valueString; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct PerformanceValueINTEL - { - using NativeType = VkPerformanceValueINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PerformanceValueINTEL( VULKAN_HPP_NAMESPACE::PerformanceValueTypeINTEL type_ = VULKAN_HPP_NAMESPACE::PerformanceValueTypeINTEL::eUint32, - VULKAN_HPP_NAMESPACE::PerformanceValueDataINTEL data_ = {} ) VULKAN_HPP_NOEXCEPT - : type( type_ ) - , data( data_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueINTEL( PerformanceValueINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceValueINTEL( VkPerformanceValueINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PerformanceValueINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PerformanceValueINTEL & operator=( PerformanceValueINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PerformanceValueINTEL & operator=( VkPerformanceValueINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PerformanceValueINTEL & setType( VULKAN_HPP_NAMESPACE::PerformanceValueTypeINTEL type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PerformanceValueINTEL & setData( VULKAN_HPP_NAMESPACE::PerformanceValueDataINTEL const & data_ ) VULKAN_HPP_NOEXCEPT - { - data = data_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPerformanceValueINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPerformanceValueINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( type, data ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::PerformanceValueTypeINTEL type = VULKAN_HPP_NAMESPACE::PerformanceValueTypeINTEL::eUint32; - VULKAN_HPP_NAMESPACE::PerformanceValueDataINTEL data = {}; - }; - - struct PhysicalDevice16BitStorageFeatures - { - using NativeType = VkPhysicalDevice16BitStorageFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevice16BitStorageFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevice16BitStorageFeatures( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , storageBuffer16BitAccess( storageBuffer16BitAccess_ ) - , uniformAndStorageBuffer16BitAccess( uniformAndStorageBuffer16BitAccess_ ) - , storagePushConstant16( storagePushConstant16_ ) - , storageInputOutput16( storageInputOutput16_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevice16BitStorageFeatures( PhysicalDevice16BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice16BitStorageFeatures( VkPhysicalDevice16BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevice16BitStorageFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevice16BitStorageFeatures & operator=( PhysicalDevice16BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice16BitStorageFeatures & operator=( VkPhysicalDevice16BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice16BitStorageFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice16BitStorageFeatures & - setStorageBuffer16BitAccess( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - storageBuffer16BitAccess = storageBuffer16BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice16BitStorageFeatures & - setUniformAndStorageBuffer16BitAccess( VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - uniformAndStorageBuffer16BitAccess = uniformAndStorageBuffer16BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice16BitStorageFeatures & - setStoragePushConstant16( VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16_ ) VULKAN_HPP_NOEXCEPT - { - storagePushConstant16 = storagePushConstant16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice16BitStorageFeatures & - setStorageInputOutput16( VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16_ ) VULKAN_HPP_NOEXCEPT - { - storageInputOutput16 = storageInputOutput16_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevice16BitStorageFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevice16BitStorageFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, storageBuffer16BitAccess, uniformAndStorageBuffer16BitAccess, storagePushConstant16, storageInputOutput16 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevice16BitStorageFeatures const & ) const = default; -#else - bool operator==( PhysicalDevice16BitStorageFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( storageBuffer16BitAccess == rhs.storageBuffer16BitAccess ) && - ( uniformAndStorageBuffer16BitAccess == rhs.uniformAndStorageBuffer16BitAccess ) && ( storagePushConstant16 == rhs.storagePushConstant16 ) && - ( storageInputOutput16 == rhs.storageInputOutput16 ); -# endif - } - - bool operator!=( PhysicalDevice16BitStorageFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevice16BitStorageFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevice16BitStorageFeatures; - }; - using PhysicalDevice16BitStorageFeaturesKHR = PhysicalDevice16BitStorageFeatures; - - struct PhysicalDevice4444FormatsFeaturesEXT - { - using NativeType = VkPhysicalDevice4444FormatsFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevice4444FormatsFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevice4444FormatsFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 formatA4R4G4B4_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 formatA4B4G4R4_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , formatA4R4G4B4( formatA4R4G4B4_ ) - , formatA4B4G4R4( formatA4B4G4R4_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevice4444FormatsFeaturesEXT( PhysicalDevice4444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice4444FormatsFeaturesEXT( VkPhysicalDevice4444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevice4444FormatsFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevice4444FormatsFeaturesEXT & operator=( PhysicalDevice4444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice4444FormatsFeaturesEXT & operator=( VkPhysicalDevice4444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice4444FormatsFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice4444FormatsFeaturesEXT & setFormatA4R4G4B4( VULKAN_HPP_NAMESPACE::Bool32 formatA4R4G4B4_ ) VULKAN_HPP_NOEXCEPT - { - formatA4R4G4B4 = formatA4R4G4B4_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice4444FormatsFeaturesEXT & setFormatA4B4G4R4( VULKAN_HPP_NAMESPACE::Bool32 formatA4B4G4R4_ ) VULKAN_HPP_NOEXCEPT - { - formatA4B4G4R4 = formatA4B4G4R4_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevice4444FormatsFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevice4444FormatsFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, formatA4R4G4B4, formatA4B4G4R4 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevice4444FormatsFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevice4444FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( formatA4R4G4B4 == rhs.formatA4R4G4B4 ) && ( formatA4B4G4R4 == rhs.formatA4B4G4R4 ); -# endif - } - - bool operator!=( PhysicalDevice4444FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevice4444FormatsFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 formatA4R4G4B4 = {}; - VULKAN_HPP_NAMESPACE::Bool32 formatA4B4G4R4 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevice4444FormatsFeaturesEXT; - }; - - struct PhysicalDevice8BitStorageFeatures - { - using NativeType = VkPhysicalDevice8BitStorageFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevice8BitStorageFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevice8BitStorageFeatures( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , storageBuffer8BitAccess( storageBuffer8BitAccess_ ) - , uniformAndStorageBuffer8BitAccess( uniformAndStorageBuffer8BitAccess_ ) - , storagePushConstant8( storagePushConstant8_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevice8BitStorageFeatures( PhysicalDevice8BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice8BitStorageFeatures( VkPhysicalDevice8BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevice8BitStorageFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevice8BitStorageFeatures & operator=( PhysicalDevice8BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevice8BitStorageFeatures & operator=( VkPhysicalDevice8BitStorageFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice8BitStorageFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice8BitStorageFeatures & - setStorageBuffer8BitAccess( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - storageBuffer8BitAccess = storageBuffer8BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice8BitStorageFeatures & - setUniformAndStorageBuffer8BitAccess( VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - uniformAndStorageBuffer8BitAccess = uniformAndStorageBuffer8BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevice8BitStorageFeatures & - setStoragePushConstant8( VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8_ ) VULKAN_HPP_NOEXCEPT - { - storagePushConstant8 = storagePushConstant8_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevice8BitStorageFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevice8BitStorageFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, storageBuffer8BitAccess, uniformAndStorageBuffer8BitAccess, storagePushConstant8 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevice8BitStorageFeatures const & ) const = default; -#else - bool operator==( PhysicalDevice8BitStorageFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( storageBuffer8BitAccess == rhs.storageBuffer8BitAccess ) && - ( uniformAndStorageBuffer8BitAccess == rhs.uniformAndStorageBuffer8BitAccess ) && ( storagePushConstant8 == rhs.storagePushConstant8 ); -# endif - } - - bool operator!=( PhysicalDevice8BitStorageFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevice8BitStorageFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevice8BitStorageFeatures; - }; - using PhysicalDevice8BitStorageFeaturesKHR = PhysicalDevice8BitStorageFeatures; - - struct PhysicalDeviceASTCDecodeFeaturesEXT - { - using NativeType = VkPhysicalDeviceASTCDecodeFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceAstcDecodeFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceASTCDecodeFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 decodeModeSharedExponent_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , decodeModeSharedExponent( decodeModeSharedExponent_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceASTCDecodeFeaturesEXT( PhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceASTCDecodeFeaturesEXT( VkPhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceASTCDecodeFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceASTCDecodeFeaturesEXT & operator=( PhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceASTCDecodeFeaturesEXT & operator=( VkPhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceASTCDecodeFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceASTCDecodeFeaturesEXT & - setDecodeModeSharedExponent( VULKAN_HPP_NAMESPACE::Bool32 decodeModeSharedExponent_ ) VULKAN_HPP_NOEXCEPT - { - decodeModeSharedExponent = decodeModeSharedExponent_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceASTCDecodeFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceASTCDecodeFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, decodeModeSharedExponent ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceASTCDecodeFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( decodeModeSharedExponent == rhs.decodeModeSharedExponent ); -# endif - } - - bool operator!=( PhysicalDeviceASTCDecodeFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceAstcDecodeFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 decodeModeSharedExponent = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceASTCDecodeFeaturesEXT; - }; - - struct PhysicalDeviceAccelerationStructureFeaturesKHR - { - using NativeType = VkPhysicalDeviceAccelerationStructureFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceAccelerationStructureFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceAccelerationStructureFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 accelerationStructure_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureCaptureReplay_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureIndirectBuild_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureHostCommands_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingAccelerationStructureUpdateAfterBind_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructure( accelerationStructure_ ) - , accelerationStructureCaptureReplay( accelerationStructureCaptureReplay_ ) - , accelerationStructureIndirectBuild( accelerationStructureIndirectBuild_ ) - , accelerationStructureHostCommands( accelerationStructureHostCommands_ ) - , descriptorBindingAccelerationStructureUpdateAfterBind( descriptorBindingAccelerationStructureUpdateAfterBind_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceAccelerationStructureFeaturesKHR( PhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAccelerationStructureFeaturesKHR( VkPhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceAccelerationStructureFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceAccelerationStructureFeaturesKHR & operator=( PhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAccelerationStructureFeaturesKHR & operator=( VkPhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & - setAccelerationStructure( VULKAN_HPP_NAMESPACE::Bool32 accelerationStructure_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructure = accelerationStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & - setAccelerationStructureCaptureReplay( VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureCaptureReplay_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureCaptureReplay = accelerationStructureCaptureReplay_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & - setAccelerationStructureIndirectBuild( VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureIndirectBuild_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureIndirectBuild = accelerationStructureIndirectBuild_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & - setAccelerationStructureHostCommands( VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureHostCommands_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureHostCommands = accelerationStructureHostCommands_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAccelerationStructureFeaturesKHR & setDescriptorBindingAccelerationStructureUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingAccelerationStructureUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingAccelerationStructureUpdateAfterBind = descriptorBindingAccelerationStructureUpdateAfterBind_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceAccelerationStructureFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceAccelerationStructureFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - accelerationStructure, - accelerationStructureCaptureReplay, - accelerationStructureIndirectBuild, - accelerationStructureHostCommands, - descriptorBindingAccelerationStructureUpdateAfterBind ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceAccelerationStructureFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructure == rhs.accelerationStructure ) && - ( accelerationStructureCaptureReplay == rhs.accelerationStructureCaptureReplay ) && - ( accelerationStructureIndirectBuild == rhs.accelerationStructureIndirectBuild ) && - ( accelerationStructureHostCommands == rhs.accelerationStructureHostCommands ) && - ( descriptorBindingAccelerationStructureUpdateAfterBind == rhs.descriptorBindingAccelerationStructureUpdateAfterBind ); -# endif - } - - bool operator!=( PhysicalDeviceAccelerationStructureFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceAccelerationStructureFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructure = {}; - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureCaptureReplay = {}; - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureIndirectBuild = {}; - VULKAN_HPP_NAMESPACE::Bool32 accelerationStructureHostCommands = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingAccelerationStructureUpdateAfterBind = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceAccelerationStructureFeaturesKHR; - }; - - struct PhysicalDeviceAccelerationStructurePropertiesKHR - { - using NativeType = VkPhysicalDeviceAccelerationStructurePropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceAccelerationStructurePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceAccelerationStructurePropertiesKHR( uint64_t maxGeometryCount_ = {}, - uint64_t maxInstanceCount_ = {}, - uint64_t maxPrimitiveCount_ = {}, - uint32_t maxPerStageDescriptorAccelerationStructures_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures_ = {}, - uint32_t maxDescriptorSetAccelerationStructures_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures_ = {}, - uint32_t minAccelerationStructureScratchOffsetAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxGeometryCount( maxGeometryCount_ ) - , maxInstanceCount( maxInstanceCount_ ) - , maxPrimitiveCount( maxPrimitiveCount_ ) - , maxPerStageDescriptorAccelerationStructures( maxPerStageDescriptorAccelerationStructures_ ) - , maxPerStageDescriptorUpdateAfterBindAccelerationStructures( maxPerStageDescriptorUpdateAfterBindAccelerationStructures_ ) - , maxDescriptorSetAccelerationStructures( maxDescriptorSetAccelerationStructures_ ) - , maxDescriptorSetUpdateAfterBindAccelerationStructures( maxDescriptorSetUpdateAfterBindAccelerationStructures_ ) - , minAccelerationStructureScratchOffsetAlignment( minAccelerationStructureScratchOffsetAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceAccelerationStructurePropertiesKHR( PhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAccelerationStructurePropertiesKHR( VkPhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceAccelerationStructurePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceAccelerationStructurePropertiesKHR & operator=( PhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAccelerationStructurePropertiesKHR & operator=( VkPhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceAccelerationStructurePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceAccelerationStructurePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxGeometryCount, - maxInstanceCount, - maxPrimitiveCount, - maxPerStageDescriptorAccelerationStructures, - maxPerStageDescriptorUpdateAfterBindAccelerationStructures, - maxDescriptorSetAccelerationStructures, - maxDescriptorSetUpdateAfterBindAccelerationStructures, - minAccelerationStructureScratchOffsetAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceAccelerationStructurePropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxGeometryCount == rhs.maxGeometryCount ) && ( maxInstanceCount == rhs.maxInstanceCount ) && - ( maxPrimitiveCount == rhs.maxPrimitiveCount ) && - ( maxPerStageDescriptorAccelerationStructures == rhs.maxPerStageDescriptorAccelerationStructures ) && - ( maxPerStageDescriptorUpdateAfterBindAccelerationStructures == rhs.maxPerStageDescriptorUpdateAfterBindAccelerationStructures ) && - ( maxDescriptorSetAccelerationStructures == rhs.maxDescriptorSetAccelerationStructures ) && - ( maxDescriptorSetUpdateAfterBindAccelerationStructures == rhs.maxDescriptorSetUpdateAfterBindAccelerationStructures ) && - ( minAccelerationStructureScratchOffsetAlignment == rhs.minAccelerationStructureScratchOffsetAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceAccelerationStructurePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceAccelerationStructurePropertiesKHR; - void * pNext = {}; - uint64_t maxGeometryCount = {}; - uint64_t maxInstanceCount = {}; - uint64_t maxPrimitiveCount = {}; - uint32_t maxPerStageDescriptorAccelerationStructures = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindAccelerationStructures = {}; - uint32_t maxDescriptorSetAccelerationStructures = {}; - uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures = {}; - uint32_t minAccelerationStructureScratchOffsetAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceAccelerationStructurePropertiesKHR; - }; - - struct PhysicalDeviceAmigoProfilingFeaturesSEC - { - using NativeType = VkPhysicalDeviceAmigoProfilingFeaturesSEC; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceAmigoProfilingFeaturesSEC; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceAmigoProfilingFeaturesSEC( VULKAN_HPP_NAMESPACE::Bool32 amigoProfiling_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , amigoProfiling( amigoProfiling_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceAmigoProfilingFeaturesSEC( PhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAmigoProfilingFeaturesSEC( VkPhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceAmigoProfilingFeaturesSEC( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceAmigoProfilingFeaturesSEC & operator=( PhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAmigoProfilingFeaturesSEC & operator=( VkPhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAmigoProfilingFeaturesSEC & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAmigoProfilingFeaturesSEC & setAmigoProfiling( VULKAN_HPP_NAMESPACE::Bool32 amigoProfiling_ ) VULKAN_HPP_NOEXCEPT - { - amigoProfiling = amigoProfiling_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceAmigoProfilingFeaturesSEC const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceAmigoProfilingFeaturesSEC &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, amigoProfiling ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceAmigoProfilingFeaturesSEC const & ) const = default; -#else - bool operator==( PhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( amigoProfiling == rhs.amigoProfiling ); -# endif - } - - bool operator!=( PhysicalDeviceAmigoProfilingFeaturesSEC const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceAmigoProfilingFeaturesSEC; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 amigoProfiling = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceAmigoProfilingFeaturesSEC; - }; - - struct PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT - { - using NativeType = VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 attachmentFeedbackLoopLayout_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachmentFeedbackLoopLayout( attachmentFeedbackLoopLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT( VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT & - operator=( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT & operator=( VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT & - setAttachmentFeedbackLoopLayout( VULKAN_HPP_NAMESPACE::Bool32 attachmentFeedbackLoopLayout_ ) VULKAN_HPP_NOEXCEPT - { - attachmentFeedbackLoopLayout = attachmentFeedbackLoopLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, attachmentFeedbackLoopLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachmentFeedbackLoopLayout == rhs.attachmentFeedbackLoopLayout ); -# endif - } - - bool operator!=( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 attachmentFeedbackLoopLayout = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT; - }; - - struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT - { - using NativeType = VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceBlendOperationAdvancedFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 advancedBlendCoherentOperations_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , advancedBlendCoherentOperations( advancedBlendCoherentOperations_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceBlendOperationAdvancedFeaturesEXT( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBlendOperationAdvancedFeaturesEXT( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceBlendOperationAdvancedFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceBlendOperationAdvancedFeaturesEXT & operator=( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBlendOperationAdvancedFeaturesEXT & operator=( VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBlendOperationAdvancedFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBlendOperationAdvancedFeaturesEXT & - setAdvancedBlendCoherentOperations( VULKAN_HPP_NAMESPACE::Bool32 advancedBlendCoherentOperations_ ) VULKAN_HPP_NOEXCEPT - { - advancedBlendCoherentOperations = advancedBlendCoherentOperations_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, advancedBlendCoherentOperations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( advancedBlendCoherentOperations == rhs.advancedBlendCoherentOperations ); -# endif - } - - bool operator!=( PhysicalDeviceBlendOperationAdvancedFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendCoherentOperations = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceBlendOperationAdvancedFeaturesEXT; - }; - - struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT - { - using NativeType = VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceBlendOperationAdvancedPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceBlendOperationAdvancedPropertiesEXT( uint32_t advancedBlendMaxColorAttachments_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendIndependentBlend_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendNonPremultipliedSrcColor_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendNonPremultipliedDstColor_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendCorrelatedOverlap_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendAllOperations_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , advancedBlendMaxColorAttachments( advancedBlendMaxColorAttachments_ ) - , advancedBlendIndependentBlend( advancedBlendIndependentBlend_ ) - , advancedBlendNonPremultipliedSrcColor( advancedBlendNonPremultipliedSrcColor_ ) - , advancedBlendNonPremultipliedDstColor( advancedBlendNonPremultipliedDstColor_ ) - , advancedBlendCorrelatedOverlap( advancedBlendCorrelatedOverlap_ ) - , advancedBlendAllOperations( advancedBlendAllOperations_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceBlendOperationAdvancedPropertiesEXT( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBlendOperationAdvancedPropertiesEXT( VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceBlendOperationAdvancedPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceBlendOperationAdvancedPropertiesEXT & - operator=( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBlendOperationAdvancedPropertiesEXT & operator=( VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - advancedBlendMaxColorAttachments, - advancedBlendIndependentBlend, - advancedBlendNonPremultipliedSrcColor, - advancedBlendNonPremultipliedDstColor, - advancedBlendCorrelatedOverlap, - advancedBlendAllOperations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( advancedBlendMaxColorAttachments == rhs.advancedBlendMaxColorAttachments ) && - ( advancedBlendIndependentBlend == rhs.advancedBlendIndependentBlend ) && - ( advancedBlendNonPremultipliedSrcColor == rhs.advancedBlendNonPremultipliedSrcColor ) && - ( advancedBlendNonPremultipliedDstColor == rhs.advancedBlendNonPremultipliedDstColor ) && - ( advancedBlendCorrelatedOverlap == rhs.advancedBlendCorrelatedOverlap ) && ( advancedBlendAllOperations == rhs.advancedBlendAllOperations ); -# endif - } - - bool operator!=( PhysicalDeviceBlendOperationAdvancedPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceBlendOperationAdvancedPropertiesEXT; - void * pNext = {}; - uint32_t advancedBlendMaxColorAttachments = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendIndependentBlend = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendNonPremultipliedSrcColor = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendNonPremultipliedDstColor = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendCorrelatedOverlap = {}; - VULKAN_HPP_NAMESPACE::Bool32 advancedBlendAllOperations = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceBlendOperationAdvancedPropertiesEXT; - }; - - struct PhysicalDeviceBorderColorSwizzleFeaturesEXT - { - using NativeType = VkPhysicalDeviceBorderColorSwizzleFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceBorderColorSwizzleFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceBorderColorSwizzleFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzle_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzleFromImage_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , borderColorSwizzle( borderColorSwizzle_ ) - , borderColorSwizzleFromImage( borderColorSwizzleFromImage_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceBorderColorSwizzleFeaturesEXT( PhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBorderColorSwizzleFeaturesEXT( VkPhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceBorderColorSwizzleFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceBorderColorSwizzleFeaturesEXT & operator=( PhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBorderColorSwizzleFeaturesEXT & operator=( VkPhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBorderColorSwizzleFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBorderColorSwizzleFeaturesEXT & - setBorderColorSwizzle( VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzle_ ) VULKAN_HPP_NOEXCEPT - { - borderColorSwizzle = borderColorSwizzle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBorderColorSwizzleFeaturesEXT & - setBorderColorSwizzleFromImage( VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzleFromImage_ ) VULKAN_HPP_NOEXCEPT - { - borderColorSwizzleFromImage = borderColorSwizzleFromImage_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceBorderColorSwizzleFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceBorderColorSwizzleFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, borderColorSwizzle, borderColorSwizzleFromImage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceBorderColorSwizzleFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( borderColorSwizzle == rhs.borderColorSwizzle ) && - ( borderColorSwizzleFromImage == rhs.borderColorSwizzleFromImage ); -# endif - } - - bool operator!=( PhysicalDeviceBorderColorSwizzleFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceBorderColorSwizzleFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzle = {}; - VULKAN_HPP_NAMESPACE::Bool32 borderColorSwizzleFromImage = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceBorderColorSwizzleFeaturesEXT; - }; - - struct PhysicalDeviceBufferDeviceAddressFeatures - { - using NativeType = VkPhysicalDeviceBufferDeviceAddressFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceBufferDeviceAddressFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceBufferDeviceAddressFeatures( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , bufferDeviceAddress( bufferDeviceAddress_ ) - , bufferDeviceAddressCaptureReplay( bufferDeviceAddressCaptureReplay_ ) - , bufferDeviceAddressMultiDevice( bufferDeviceAddressMultiDevice_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceBufferDeviceAddressFeatures( PhysicalDeviceBufferDeviceAddressFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBufferDeviceAddressFeatures( VkPhysicalDeviceBufferDeviceAddressFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceBufferDeviceAddressFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceBufferDeviceAddressFeatures & operator=( PhysicalDeviceBufferDeviceAddressFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBufferDeviceAddressFeatures & operator=( VkPhysicalDeviceBufferDeviceAddressFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeatures & - setBufferDeviceAddress( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddress = bufferDeviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeatures & - setBufferDeviceAddressCaptureReplay( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressCaptureReplay = bufferDeviceAddressCaptureReplay_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeatures & - setBufferDeviceAddressMultiDevice( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressMultiDevice = bufferDeviceAddressMultiDevice_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceBufferDeviceAddressFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceBufferDeviceAddressFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, bufferDeviceAddress, bufferDeviceAddressCaptureReplay, bufferDeviceAddressMultiDevice ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceBufferDeviceAddressFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceBufferDeviceAddressFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( bufferDeviceAddress == rhs.bufferDeviceAddress ) && - ( bufferDeviceAddressCaptureReplay == rhs.bufferDeviceAddressCaptureReplay ) && - ( bufferDeviceAddressMultiDevice == rhs.bufferDeviceAddressMultiDevice ); -# endif - } - - bool operator!=( PhysicalDeviceBufferDeviceAddressFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceBufferDeviceAddressFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceBufferDeviceAddressFeatures; - }; - using PhysicalDeviceBufferDeviceAddressFeaturesKHR = PhysicalDeviceBufferDeviceAddressFeatures; - - struct PhysicalDeviceBufferDeviceAddressFeaturesEXT - { - using NativeType = VkPhysicalDeviceBufferDeviceAddressFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceBufferDeviceAddressFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceBufferDeviceAddressFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , bufferDeviceAddress( bufferDeviceAddress_ ) - , bufferDeviceAddressCaptureReplay( bufferDeviceAddressCaptureReplay_ ) - , bufferDeviceAddressMultiDevice( bufferDeviceAddressMultiDevice_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceBufferDeviceAddressFeaturesEXT( PhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBufferDeviceAddressFeaturesEXT( VkPhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceBufferDeviceAddressFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceBufferDeviceAddressFeaturesEXT & operator=( PhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceBufferDeviceAddressFeaturesEXT & operator=( VkPhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeaturesEXT & - setBufferDeviceAddress( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddress = bufferDeviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeaturesEXT & - setBufferDeviceAddressCaptureReplay( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressCaptureReplay = bufferDeviceAddressCaptureReplay_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceBufferDeviceAddressFeaturesEXT & - setBufferDeviceAddressMultiDevice( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressMultiDevice = bufferDeviceAddressMultiDevice_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceBufferDeviceAddressFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceBufferDeviceAddressFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, bufferDeviceAddress, bufferDeviceAddressCaptureReplay, bufferDeviceAddressMultiDevice ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceBufferDeviceAddressFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( bufferDeviceAddress == rhs.bufferDeviceAddress ) && - ( bufferDeviceAddressCaptureReplay == rhs.bufferDeviceAddressCaptureReplay ) && - ( bufferDeviceAddressMultiDevice == rhs.bufferDeviceAddressMultiDevice ); -# endif - } - - bool operator!=( PhysicalDeviceBufferDeviceAddressFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceBufferDeviceAddressFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceBufferDeviceAddressFeaturesEXT; - }; - using PhysicalDeviceBufferAddressFeaturesEXT = PhysicalDeviceBufferDeviceAddressFeaturesEXT; - - struct PhysicalDeviceCoherentMemoryFeaturesAMD - { - using NativeType = VkPhysicalDeviceCoherentMemoryFeaturesAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCoherentMemoryFeaturesAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCoherentMemoryFeaturesAMD( VULKAN_HPP_NAMESPACE::Bool32 deviceCoherentMemory_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceCoherentMemory( deviceCoherentMemory_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCoherentMemoryFeaturesAMD( PhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCoherentMemoryFeaturesAMD( VkPhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCoherentMemoryFeaturesAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCoherentMemoryFeaturesAMD & operator=( PhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCoherentMemoryFeaturesAMD & operator=( VkPhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCoherentMemoryFeaturesAMD & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCoherentMemoryFeaturesAMD & - setDeviceCoherentMemory( VULKAN_HPP_NAMESPACE::Bool32 deviceCoherentMemory_ ) VULKAN_HPP_NOEXCEPT - { - deviceCoherentMemory = deviceCoherentMemory_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceCoherentMemoryFeaturesAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCoherentMemoryFeaturesAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceCoherentMemory ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCoherentMemoryFeaturesAMD const & ) const = default; -#else - bool operator==( PhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceCoherentMemory == rhs.deviceCoherentMemory ); -# endif - } - - bool operator!=( PhysicalDeviceCoherentMemoryFeaturesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCoherentMemoryFeaturesAMD; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 deviceCoherentMemory = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCoherentMemoryFeaturesAMD; - }; - - struct PhysicalDeviceColorWriteEnableFeaturesEXT - { - using NativeType = VkPhysicalDeviceColorWriteEnableFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceColorWriteEnableFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceColorWriteEnableFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 colorWriteEnable_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , colorWriteEnable( colorWriteEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceColorWriteEnableFeaturesEXT( PhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceColorWriteEnableFeaturesEXT( VkPhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceColorWriteEnableFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceColorWriteEnableFeaturesEXT & operator=( PhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceColorWriteEnableFeaturesEXT & operator=( VkPhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceColorWriteEnableFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceColorWriteEnableFeaturesEXT & - setColorWriteEnable( VULKAN_HPP_NAMESPACE::Bool32 colorWriteEnable_ ) VULKAN_HPP_NOEXCEPT - { - colorWriteEnable = colorWriteEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceColorWriteEnableFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceColorWriteEnableFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, colorWriteEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceColorWriteEnableFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( colorWriteEnable == rhs.colorWriteEnable ); -# endif - } - - bool operator!=( PhysicalDeviceColorWriteEnableFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceColorWriteEnableFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 colorWriteEnable = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceColorWriteEnableFeaturesEXT; - }; - - struct PhysicalDeviceComputeShaderDerivativesFeaturesNV - { - using NativeType = VkPhysicalDeviceComputeShaderDerivativesFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceComputeShaderDerivativesFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceComputeShaderDerivativesFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupQuads_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupLinear_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , computeDerivativeGroupQuads( computeDerivativeGroupQuads_ ) - , computeDerivativeGroupLinear( computeDerivativeGroupLinear_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceComputeShaderDerivativesFeaturesNV( PhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceComputeShaderDerivativesFeaturesNV( VkPhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceComputeShaderDerivativesFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceComputeShaderDerivativesFeaturesNV & operator=( PhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceComputeShaderDerivativesFeaturesNV & operator=( VkPhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceComputeShaderDerivativesFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceComputeShaderDerivativesFeaturesNV & - setComputeDerivativeGroupQuads( VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupQuads_ ) VULKAN_HPP_NOEXCEPT - { - computeDerivativeGroupQuads = computeDerivativeGroupQuads_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceComputeShaderDerivativesFeaturesNV & - setComputeDerivativeGroupLinear( VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupLinear_ ) VULKAN_HPP_NOEXCEPT - { - computeDerivativeGroupLinear = computeDerivativeGroupLinear_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceComputeShaderDerivativesFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceComputeShaderDerivativesFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, computeDerivativeGroupQuads, computeDerivativeGroupLinear ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceComputeShaderDerivativesFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( computeDerivativeGroupQuads == rhs.computeDerivativeGroupQuads ) && - ( computeDerivativeGroupLinear == rhs.computeDerivativeGroupLinear ); -# endif - } - - bool operator!=( PhysicalDeviceComputeShaderDerivativesFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceComputeShaderDerivativesFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupQuads = {}; - VULKAN_HPP_NAMESPACE::Bool32 computeDerivativeGroupLinear = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceComputeShaderDerivativesFeaturesNV; - }; - - struct PhysicalDeviceConditionalRenderingFeaturesEXT - { - using NativeType = VkPhysicalDeviceConditionalRenderingFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceConditionalRenderingFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceConditionalRenderingFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 conditionalRendering_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 inheritedConditionalRendering_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , conditionalRendering( conditionalRendering_ ) - , inheritedConditionalRendering( inheritedConditionalRendering_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceConditionalRenderingFeaturesEXT( PhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceConditionalRenderingFeaturesEXT( VkPhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceConditionalRenderingFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceConditionalRenderingFeaturesEXT & operator=( PhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceConditionalRenderingFeaturesEXT & operator=( VkPhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceConditionalRenderingFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceConditionalRenderingFeaturesEXT & - setConditionalRendering( VULKAN_HPP_NAMESPACE::Bool32 conditionalRendering_ ) VULKAN_HPP_NOEXCEPT - { - conditionalRendering = conditionalRendering_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceConditionalRenderingFeaturesEXT & - setInheritedConditionalRendering( VULKAN_HPP_NAMESPACE::Bool32 inheritedConditionalRendering_ ) VULKAN_HPP_NOEXCEPT - { - inheritedConditionalRendering = inheritedConditionalRendering_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceConditionalRenderingFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceConditionalRenderingFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, conditionalRendering, inheritedConditionalRendering ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceConditionalRenderingFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( conditionalRendering == rhs.conditionalRendering ) && - ( inheritedConditionalRendering == rhs.inheritedConditionalRendering ); -# endif - } - - bool operator!=( PhysicalDeviceConditionalRenderingFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceConditionalRenderingFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 conditionalRendering = {}; - VULKAN_HPP_NAMESPACE::Bool32 inheritedConditionalRendering = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceConditionalRenderingFeaturesEXT; - }; - - struct PhysicalDeviceConservativeRasterizationPropertiesEXT - { - using NativeType = VkPhysicalDeviceConservativeRasterizationPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceConservativeRasterizationPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceConservativeRasterizationPropertiesEXT( float primitiveOverestimationSize_ = {}, - float maxExtraPrimitiveOverestimationSize_ = {}, - float extraPrimitiveOverestimationSizeGranularity_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitiveUnderestimation_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 conservativePointAndLineRasterization_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 degenerateTrianglesRasterized_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 degenerateLinesRasterized_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fullyCoveredFragmentShaderInputVariable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 conservativeRasterizationPostDepthCoverage_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , primitiveOverestimationSize( primitiveOverestimationSize_ ) - , maxExtraPrimitiveOverestimationSize( maxExtraPrimitiveOverestimationSize_ ) - , extraPrimitiveOverestimationSizeGranularity( extraPrimitiveOverestimationSizeGranularity_ ) - , primitiveUnderestimation( primitiveUnderestimation_ ) - , conservativePointAndLineRasterization( conservativePointAndLineRasterization_ ) - , degenerateTrianglesRasterized( degenerateTrianglesRasterized_ ) - , degenerateLinesRasterized( degenerateLinesRasterized_ ) - , fullyCoveredFragmentShaderInputVariable( fullyCoveredFragmentShaderInputVariable_ ) - , conservativeRasterizationPostDepthCoverage( conservativeRasterizationPostDepthCoverage_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceConservativeRasterizationPropertiesEXT( PhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceConservativeRasterizationPropertiesEXT( VkPhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceConservativeRasterizationPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceConservativeRasterizationPropertiesEXT & - operator=( PhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceConservativeRasterizationPropertiesEXT & operator=( VkPhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceConservativeRasterizationPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceConservativeRasterizationPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - primitiveOverestimationSize, - maxExtraPrimitiveOverestimationSize, - extraPrimitiveOverestimationSizeGranularity, - primitiveUnderestimation, - conservativePointAndLineRasterization, - degenerateTrianglesRasterized, - degenerateLinesRasterized, - fullyCoveredFragmentShaderInputVariable, - conservativeRasterizationPostDepthCoverage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceConservativeRasterizationPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( primitiveOverestimationSize == rhs.primitiveOverestimationSize ) && - ( maxExtraPrimitiveOverestimationSize == rhs.maxExtraPrimitiveOverestimationSize ) && - ( extraPrimitiveOverestimationSizeGranularity == rhs.extraPrimitiveOverestimationSizeGranularity ) && - ( primitiveUnderestimation == rhs.primitiveUnderestimation ) && - ( conservativePointAndLineRasterization == rhs.conservativePointAndLineRasterization ) && - ( degenerateTrianglesRasterized == rhs.degenerateTrianglesRasterized ) && ( degenerateLinesRasterized == rhs.degenerateLinesRasterized ) && - ( fullyCoveredFragmentShaderInputVariable == rhs.fullyCoveredFragmentShaderInputVariable ) && - ( conservativeRasterizationPostDepthCoverage == rhs.conservativeRasterizationPostDepthCoverage ); -# endif - } - - bool operator!=( PhysicalDeviceConservativeRasterizationPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceConservativeRasterizationPropertiesEXT; - void * pNext = {}; - float primitiveOverestimationSize = {}; - float maxExtraPrimitiveOverestimationSize = {}; - float extraPrimitiveOverestimationSizeGranularity = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveUnderestimation = {}; - VULKAN_HPP_NAMESPACE::Bool32 conservativePointAndLineRasterization = {}; - VULKAN_HPP_NAMESPACE::Bool32 degenerateTrianglesRasterized = {}; - VULKAN_HPP_NAMESPACE::Bool32 degenerateLinesRasterized = {}; - VULKAN_HPP_NAMESPACE::Bool32 fullyCoveredFragmentShaderInputVariable = {}; - VULKAN_HPP_NAMESPACE::Bool32 conservativeRasterizationPostDepthCoverage = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceConservativeRasterizationPropertiesEXT; - }; - - struct PhysicalDeviceCooperativeMatrixFeaturesNV - { - using NativeType = VkPhysicalDeviceCooperativeMatrixFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCooperativeMatrixFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCooperativeMatrixFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrix_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrixRobustBufferAccess_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , cooperativeMatrix( cooperativeMatrix_ ) - , cooperativeMatrixRobustBufferAccess( cooperativeMatrixRobustBufferAccess_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCooperativeMatrixFeaturesNV( PhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCooperativeMatrixFeaturesNV( VkPhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCooperativeMatrixFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCooperativeMatrixFeaturesNV & operator=( PhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCooperativeMatrixFeaturesNV & operator=( VkPhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCooperativeMatrixFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCooperativeMatrixFeaturesNV & - setCooperativeMatrix( VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrix_ ) VULKAN_HPP_NOEXCEPT - { - cooperativeMatrix = cooperativeMatrix_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCooperativeMatrixFeaturesNV & - setCooperativeMatrixRobustBufferAccess( VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrixRobustBufferAccess_ ) VULKAN_HPP_NOEXCEPT - { - cooperativeMatrixRobustBufferAccess = cooperativeMatrixRobustBufferAccess_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceCooperativeMatrixFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCooperativeMatrixFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, cooperativeMatrix, cooperativeMatrixRobustBufferAccess ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCooperativeMatrixFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cooperativeMatrix == rhs.cooperativeMatrix ) && - ( cooperativeMatrixRobustBufferAccess == rhs.cooperativeMatrixRobustBufferAccess ); -# endif - } - - bool operator!=( PhysicalDeviceCooperativeMatrixFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCooperativeMatrixFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrix = {}; - VULKAN_HPP_NAMESPACE::Bool32 cooperativeMatrixRobustBufferAccess = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCooperativeMatrixFeaturesNV; - }; - - struct PhysicalDeviceCooperativeMatrixPropertiesNV - { - using NativeType = VkPhysicalDeviceCooperativeMatrixPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCooperativeMatrixPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCooperativeMatrixPropertiesNV( VULKAN_HPP_NAMESPACE::ShaderStageFlags cooperativeMatrixSupportedStages_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , cooperativeMatrixSupportedStages( cooperativeMatrixSupportedStages_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCooperativeMatrixPropertiesNV( PhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCooperativeMatrixPropertiesNV( VkPhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCooperativeMatrixPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCooperativeMatrixPropertiesNV & operator=( PhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCooperativeMatrixPropertiesNV & operator=( VkPhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceCooperativeMatrixPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCooperativeMatrixPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, cooperativeMatrixSupportedStages ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCooperativeMatrixPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cooperativeMatrixSupportedStages == rhs.cooperativeMatrixSupportedStages ); -# endif - } - - bool operator!=( PhysicalDeviceCooperativeMatrixPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCooperativeMatrixPropertiesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags cooperativeMatrixSupportedStages = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCooperativeMatrixPropertiesNV; - }; - - struct PhysicalDeviceCornerSampledImageFeaturesNV - { - using NativeType = VkPhysicalDeviceCornerSampledImageFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCornerSampledImageFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCornerSampledImageFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 cornerSampledImage_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , cornerSampledImage( cornerSampledImage_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCornerSampledImageFeaturesNV( PhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCornerSampledImageFeaturesNV( VkPhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCornerSampledImageFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCornerSampledImageFeaturesNV & operator=( PhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCornerSampledImageFeaturesNV & operator=( VkPhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCornerSampledImageFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCornerSampledImageFeaturesNV & - setCornerSampledImage( VULKAN_HPP_NAMESPACE::Bool32 cornerSampledImage_ ) VULKAN_HPP_NOEXCEPT - { - cornerSampledImage = cornerSampledImage_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceCornerSampledImageFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCornerSampledImageFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, cornerSampledImage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCornerSampledImageFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( cornerSampledImage == rhs.cornerSampledImage ); -# endif - } - - bool operator!=( PhysicalDeviceCornerSampledImageFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCornerSampledImageFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 cornerSampledImage = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCornerSampledImageFeaturesNV; - }; - - struct PhysicalDeviceCoverageReductionModeFeaturesNV - { - using NativeType = VkPhysicalDeviceCoverageReductionModeFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCoverageReductionModeFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCoverageReductionModeFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 coverageReductionMode_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , coverageReductionMode( coverageReductionMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceCoverageReductionModeFeaturesNV( PhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCoverageReductionModeFeaturesNV( VkPhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCoverageReductionModeFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCoverageReductionModeFeaturesNV & operator=( PhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCoverageReductionModeFeaturesNV & operator=( VkPhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCoverageReductionModeFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCoverageReductionModeFeaturesNV & - setCoverageReductionMode( VULKAN_HPP_NAMESPACE::Bool32 coverageReductionMode_ ) VULKAN_HPP_NOEXCEPT - { - coverageReductionMode = coverageReductionMode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceCoverageReductionModeFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCoverageReductionModeFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, coverageReductionMode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCoverageReductionModeFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( coverageReductionMode == rhs.coverageReductionMode ); -# endif - } - - bool operator!=( PhysicalDeviceCoverageReductionModeFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCoverageReductionModeFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 coverageReductionMode = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCoverageReductionModeFeaturesNV; - }; - - struct PhysicalDeviceCustomBorderColorFeaturesEXT - { - using NativeType = VkPhysicalDeviceCustomBorderColorFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCustomBorderColorFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCustomBorderColorFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 customBorderColors_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 customBorderColorWithoutFormat_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , customBorderColors( customBorderColors_ ) - , customBorderColorWithoutFormat( customBorderColorWithoutFormat_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCustomBorderColorFeaturesEXT( PhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCustomBorderColorFeaturesEXT( VkPhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCustomBorderColorFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCustomBorderColorFeaturesEXT & operator=( PhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCustomBorderColorFeaturesEXT & operator=( VkPhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCustomBorderColorFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCustomBorderColorFeaturesEXT & - setCustomBorderColors( VULKAN_HPP_NAMESPACE::Bool32 customBorderColors_ ) VULKAN_HPP_NOEXCEPT - { - customBorderColors = customBorderColors_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceCustomBorderColorFeaturesEXT & - setCustomBorderColorWithoutFormat( VULKAN_HPP_NAMESPACE::Bool32 customBorderColorWithoutFormat_ ) VULKAN_HPP_NOEXCEPT - { - customBorderColorWithoutFormat = customBorderColorWithoutFormat_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceCustomBorderColorFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCustomBorderColorFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, customBorderColors, customBorderColorWithoutFormat ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCustomBorderColorFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( customBorderColors == rhs.customBorderColors ) && - ( customBorderColorWithoutFormat == rhs.customBorderColorWithoutFormat ); -# endif - } - - bool operator!=( PhysicalDeviceCustomBorderColorFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCustomBorderColorFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 customBorderColors = {}; - VULKAN_HPP_NAMESPACE::Bool32 customBorderColorWithoutFormat = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCustomBorderColorFeaturesEXT; - }; - - struct PhysicalDeviceCustomBorderColorPropertiesEXT - { - using NativeType = VkPhysicalDeviceCustomBorderColorPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceCustomBorderColorPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceCustomBorderColorPropertiesEXT( uint32_t maxCustomBorderColorSamplers_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxCustomBorderColorSamplers( maxCustomBorderColorSamplers_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceCustomBorderColorPropertiesEXT( PhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCustomBorderColorPropertiesEXT( VkPhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceCustomBorderColorPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceCustomBorderColorPropertiesEXT & operator=( PhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceCustomBorderColorPropertiesEXT & operator=( VkPhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceCustomBorderColorPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceCustomBorderColorPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxCustomBorderColorSamplers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceCustomBorderColorPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxCustomBorderColorSamplers == rhs.maxCustomBorderColorSamplers ); -# endif - } - - bool operator!=( PhysicalDeviceCustomBorderColorPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceCustomBorderColorPropertiesEXT; - void * pNext = {}; - uint32_t maxCustomBorderColorSamplers = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceCustomBorderColorPropertiesEXT; - }; - - struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV - { - using NativeType = VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocationImageAliasing_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dedicatedAllocationImageAliasing( dedicatedAllocationImageAliasing_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV( VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV & - operator=( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV & - operator=( VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV & - setDedicatedAllocationImageAliasing( VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocationImageAliasing_ ) VULKAN_HPP_NOEXCEPT - { - dedicatedAllocationImageAliasing = dedicatedAllocationImageAliasing_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dedicatedAllocationImageAliasing ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dedicatedAllocationImageAliasing == rhs.dedicatedAllocationImageAliasing ); -# endif - } - - bool operator!=( PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 dedicatedAllocationImageAliasing = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; - }; - - struct PhysicalDeviceDepthClampZeroOneFeaturesEXT - { - using NativeType = VkPhysicalDeviceDepthClampZeroOneFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDepthClampZeroOneFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClampZeroOneFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 depthClampZeroOne_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , depthClampZeroOne( depthClampZeroOne_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClampZeroOneFeaturesEXT( PhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClampZeroOneFeaturesEXT( VkPhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDepthClampZeroOneFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDepthClampZeroOneFeaturesEXT & operator=( PhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClampZeroOneFeaturesEXT & operator=( VkPhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClampZeroOneFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClampZeroOneFeaturesEXT & - setDepthClampZeroOne( VULKAN_HPP_NAMESPACE::Bool32 depthClampZeroOne_ ) VULKAN_HPP_NOEXCEPT - { - depthClampZeroOne = depthClampZeroOne_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDepthClampZeroOneFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDepthClampZeroOneFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, depthClampZeroOne ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDepthClampZeroOneFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( depthClampZeroOne == rhs.depthClampZeroOne ); -# endif - } - - bool operator!=( PhysicalDeviceDepthClampZeroOneFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDepthClampZeroOneFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClampZeroOne = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDepthClampZeroOneFeaturesEXT; - }; - - struct PhysicalDeviceDepthClipControlFeaturesEXT - { - using NativeType = VkPhysicalDeviceDepthClipControlFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDepthClipControlFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClipControlFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 depthClipControl_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , depthClipControl( depthClipControl_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClipControlFeaturesEXT( PhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClipControlFeaturesEXT( VkPhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDepthClipControlFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDepthClipControlFeaturesEXT & operator=( PhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClipControlFeaturesEXT & operator=( VkPhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClipControlFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClipControlFeaturesEXT & - setDepthClipControl( VULKAN_HPP_NAMESPACE::Bool32 depthClipControl_ ) VULKAN_HPP_NOEXCEPT - { - depthClipControl = depthClipControl_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDepthClipControlFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDepthClipControlFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, depthClipControl ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDepthClipControlFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( depthClipControl == rhs.depthClipControl ); -# endif - } - - bool operator!=( PhysicalDeviceDepthClipControlFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDepthClipControlFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClipControl = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDepthClipControlFeaturesEXT; - }; - - struct PhysicalDeviceDepthClipEnableFeaturesEXT - { - using NativeType = VkPhysicalDeviceDepthClipEnableFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDepthClipEnableFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClipEnableFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , depthClipEnable( depthClipEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthClipEnableFeaturesEXT( PhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClipEnableFeaturesEXT( VkPhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDepthClipEnableFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDepthClipEnableFeaturesEXT & operator=( PhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthClipEnableFeaturesEXT & operator=( VkPhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClipEnableFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDepthClipEnableFeaturesEXT & setDepthClipEnable( VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthClipEnable = depthClipEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDepthClipEnableFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDepthClipEnableFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, depthClipEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDepthClipEnableFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( depthClipEnable == rhs.depthClipEnable ); -# endif - } - - bool operator!=( PhysicalDeviceDepthClipEnableFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDepthClipEnableFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDepthClipEnableFeaturesEXT; - }; - - struct PhysicalDeviceDepthStencilResolveProperties - { - using NativeType = VkPhysicalDeviceDepthStencilResolveProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDepthStencilResolveProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthStencilResolveProperties( VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedDepthResolveModes_ = {}, - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedStencilResolveModes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 independentResolveNone_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 independentResolve_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , supportedDepthResolveModes( supportedDepthResolveModes_ ) - , supportedStencilResolveModes( supportedStencilResolveModes_ ) - , independentResolveNone( independentResolveNone_ ) - , independentResolve( independentResolve_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDepthStencilResolveProperties( PhysicalDeviceDepthStencilResolveProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthStencilResolveProperties( VkPhysicalDeviceDepthStencilResolveProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDepthStencilResolveProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDepthStencilResolveProperties & operator=( PhysicalDeviceDepthStencilResolveProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDepthStencilResolveProperties & operator=( VkPhysicalDeviceDepthStencilResolveProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDepthStencilResolveProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDepthStencilResolveProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, supportedDepthResolveModes, supportedStencilResolveModes, independentResolveNone, independentResolve ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDepthStencilResolveProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceDepthStencilResolveProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( supportedDepthResolveModes == rhs.supportedDepthResolveModes ) && - ( supportedStencilResolveModes == rhs.supportedStencilResolveModes ) && ( independentResolveNone == rhs.independentResolveNone ) && - ( independentResolve == rhs.independentResolve ); -# endif - } - - bool operator!=( PhysicalDeviceDepthStencilResolveProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDepthStencilResolveProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedDepthResolveModes = {}; - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedStencilResolveModes = {}; - VULKAN_HPP_NAMESPACE::Bool32 independentResolveNone = {}; - VULKAN_HPP_NAMESPACE::Bool32 independentResolve = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDepthStencilResolveProperties; - }; - using PhysicalDeviceDepthStencilResolvePropertiesKHR = PhysicalDeviceDepthStencilResolveProperties; - - struct PhysicalDeviceDescriptorIndexingFeatures - { - using NativeType = VkPhysicalDeviceDescriptorIndexingFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDescriptorIndexingFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorIndexingFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderInputAttachmentArrayDynamicIndexing( shaderInputAttachmentArrayDynamicIndexing_ ) - , shaderUniformTexelBufferArrayDynamicIndexing( shaderUniformTexelBufferArrayDynamicIndexing_ ) - , shaderStorageTexelBufferArrayDynamicIndexing( shaderStorageTexelBufferArrayDynamicIndexing_ ) - , shaderUniformBufferArrayNonUniformIndexing( shaderUniformBufferArrayNonUniformIndexing_ ) - , shaderSampledImageArrayNonUniformIndexing( shaderSampledImageArrayNonUniformIndexing_ ) - , shaderStorageBufferArrayNonUniformIndexing( shaderStorageBufferArrayNonUniformIndexing_ ) - , shaderStorageImageArrayNonUniformIndexing( shaderStorageImageArrayNonUniformIndexing_ ) - , shaderInputAttachmentArrayNonUniformIndexing( shaderInputAttachmentArrayNonUniformIndexing_ ) - , shaderUniformTexelBufferArrayNonUniformIndexing( shaderUniformTexelBufferArrayNonUniformIndexing_ ) - , shaderStorageTexelBufferArrayNonUniformIndexing( shaderStorageTexelBufferArrayNonUniformIndexing_ ) - , descriptorBindingUniformBufferUpdateAfterBind( descriptorBindingUniformBufferUpdateAfterBind_ ) - , descriptorBindingSampledImageUpdateAfterBind( descriptorBindingSampledImageUpdateAfterBind_ ) - , descriptorBindingStorageImageUpdateAfterBind( descriptorBindingStorageImageUpdateAfterBind_ ) - , descriptorBindingStorageBufferUpdateAfterBind( descriptorBindingStorageBufferUpdateAfterBind_ ) - , descriptorBindingUniformTexelBufferUpdateAfterBind( descriptorBindingUniformTexelBufferUpdateAfterBind_ ) - , descriptorBindingStorageTexelBufferUpdateAfterBind( descriptorBindingStorageTexelBufferUpdateAfterBind_ ) - , descriptorBindingUpdateUnusedWhilePending( descriptorBindingUpdateUnusedWhilePending_ ) - , descriptorBindingPartiallyBound( descriptorBindingPartiallyBound_ ) - , descriptorBindingVariableDescriptorCount( descriptorBindingVariableDescriptorCount_ ) - , runtimeDescriptorArray( runtimeDescriptorArray_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorIndexingFeatures( PhysicalDeviceDescriptorIndexingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorIndexingFeatures( VkPhysicalDeviceDescriptorIndexingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDescriptorIndexingFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDescriptorIndexingFeatures & operator=( PhysicalDeviceDescriptorIndexingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorIndexingFeatures & operator=( VkPhysicalDeviceDescriptorIndexingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderInputAttachmentArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderInputAttachmentArrayDynamicIndexing = shaderInputAttachmentArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderUniformTexelBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformTexelBufferArrayDynamicIndexing = shaderUniformTexelBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderStorageTexelBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageTexelBufferArrayDynamicIndexing = shaderStorageTexelBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderUniformBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformBufferArrayNonUniformIndexing = shaderUniformBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderSampledImageArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderSampledImageArrayNonUniformIndexing = shaderSampledImageArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderStorageBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageBufferArrayNonUniformIndexing = shaderStorageBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderStorageImageArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageArrayNonUniformIndexing = shaderStorageImageArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderInputAttachmentArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderInputAttachmentArrayNonUniformIndexing = shaderInputAttachmentArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderUniformTexelBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformTexelBufferArrayNonUniformIndexing = shaderUniformTexelBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setShaderStorageTexelBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageTexelBufferArrayNonUniformIndexing = shaderStorageTexelBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingUniformBufferUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUniformBufferUpdateAfterBind = descriptorBindingUniformBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingSampledImageUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingSampledImageUpdateAfterBind = descriptorBindingSampledImageUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingStorageImageUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageImageUpdateAfterBind = descriptorBindingStorageImageUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingStorageBufferUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageBufferUpdateAfterBind = descriptorBindingStorageBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & setDescriptorBindingUniformTexelBufferUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUniformTexelBufferUpdateAfterBind = descriptorBindingUniformTexelBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & setDescriptorBindingStorageTexelBufferUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageTexelBufferUpdateAfterBind = descriptorBindingStorageTexelBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingUpdateUnusedWhilePending( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUpdateUnusedWhilePending = descriptorBindingUpdateUnusedWhilePending_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingPartiallyBound( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingPartiallyBound = descriptorBindingPartiallyBound_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setDescriptorBindingVariableDescriptorCount( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingVariableDescriptorCount = descriptorBindingVariableDescriptorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorIndexingFeatures & - setRuntimeDescriptorArray( VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray_ ) VULKAN_HPP_NOEXCEPT - { - runtimeDescriptorArray = runtimeDescriptorArray_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDescriptorIndexingFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDescriptorIndexingFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderInputAttachmentArrayDynamicIndexing, - shaderUniformTexelBufferArrayDynamicIndexing, - shaderStorageTexelBufferArrayDynamicIndexing, - shaderUniformBufferArrayNonUniformIndexing, - shaderSampledImageArrayNonUniformIndexing, - shaderStorageBufferArrayNonUniformIndexing, - shaderStorageImageArrayNonUniformIndexing, - shaderInputAttachmentArrayNonUniformIndexing, - shaderUniformTexelBufferArrayNonUniformIndexing, - shaderStorageTexelBufferArrayNonUniformIndexing, - descriptorBindingUniformBufferUpdateAfterBind, - descriptorBindingSampledImageUpdateAfterBind, - descriptorBindingStorageImageUpdateAfterBind, - descriptorBindingStorageBufferUpdateAfterBind, - descriptorBindingUniformTexelBufferUpdateAfterBind, - descriptorBindingStorageTexelBufferUpdateAfterBind, - descriptorBindingUpdateUnusedWhilePending, - descriptorBindingPartiallyBound, - descriptorBindingVariableDescriptorCount, - runtimeDescriptorArray ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDescriptorIndexingFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceDescriptorIndexingFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && - ( shaderInputAttachmentArrayDynamicIndexing == rhs.shaderInputAttachmentArrayDynamicIndexing ) && - ( shaderUniformTexelBufferArrayDynamicIndexing == rhs.shaderUniformTexelBufferArrayDynamicIndexing ) && - ( shaderStorageTexelBufferArrayDynamicIndexing == rhs.shaderStorageTexelBufferArrayDynamicIndexing ) && - ( shaderUniformBufferArrayNonUniformIndexing == rhs.shaderUniformBufferArrayNonUniformIndexing ) && - ( shaderSampledImageArrayNonUniformIndexing == rhs.shaderSampledImageArrayNonUniformIndexing ) && - ( shaderStorageBufferArrayNonUniformIndexing == rhs.shaderStorageBufferArrayNonUniformIndexing ) && - ( shaderStorageImageArrayNonUniformIndexing == rhs.shaderStorageImageArrayNonUniformIndexing ) && - ( shaderInputAttachmentArrayNonUniformIndexing == rhs.shaderInputAttachmentArrayNonUniformIndexing ) && - ( shaderUniformTexelBufferArrayNonUniformIndexing == rhs.shaderUniformTexelBufferArrayNonUniformIndexing ) && - ( shaderStorageTexelBufferArrayNonUniformIndexing == rhs.shaderStorageTexelBufferArrayNonUniformIndexing ) && - ( descriptorBindingUniformBufferUpdateAfterBind == rhs.descriptorBindingUniformBufferUpdateAfterBind ) && - ( descriptorBindingSampledImageUpdateAfterBind == rhs.descriptorBindingSampledImageUpdateAfterBind ) && - ( descriptorBindingStorageImageUpdateAfterBind == rhs.descriptorBindingStorageImageUpdateAfterBind ) && - ( descriptorBindingStorageBufferUpdateAfterBind == rhs.descriptorBindingStorageBufferUpdateAfterBind ) && - ( descriptorBindingUniformTexelBufferUpdateAfterBind == rhs.descriptorBindingUniformTexelBufferUpdateAfterBind ) && - ( descriptorBindingStorageTexelBufferUpdateAfterBind == rhs.descriptorBindingStorageTexelBufferUpdateAfterBind ) && - ( descriptorBindingUpdateUnusedWhilePending == rhs.descriptorBindingUpdateUnusedWhilePending ) && - ( descriptorBindingPartiallyBound == rhs.descriptorBindingPartiallyBound ) && - ( descriptorBindingVariableDescriptorCount == rhs.descriptorBindingVariableDescriptorCount ) && - ( runtimeDescriptorArray == rhs.runtimeDescriptorArray ); -# endif - } - - bool operator!=( PhysicalDeviceDescriptorIndexingFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDescriptorIndexingFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount = {}; - VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDescriptorIndexingFeatures; - }; - using PhysicalDeviceDescriptorIndexingFeaturesEXT = PhysicalDeviceDescriptorIndexingFeatures; - - struct PhysicalDeviceDescriptorIndexingProperties - { - using NativeType = VkPhysicalDeviceDescriptorIndexingProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDescriptorIndexingProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorIndexingProperties( uint32_t maxUpdateAfterBindDescriptorsInAllPools_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccessUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 quadDivergentImplicitLod_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments_ = {}, - uint32_t maxPerStageUpdateAfterBindResources_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindSamplers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindSampledImages_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageImages_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxUpdateAfterBindDescriptorsInAllPools( maxUpdateAfterBindDescriptorsInAllPools_ ) - , shaderUniformBufferArrayNonUniformIndexingNative( shaderUniformBufferArrayNonUniformIndexingNative_ ) - , shaderSampledImageArrayNonUniformIndexingNative( shaderSampledImageArrayNonUniformIndexingNative_ ) - , shaderStorageBufferArrayNonUniformIndexingNative( shaderStorageBufferArrayNonUniformIndexingNative_ ) - , shaderStorageImageArrayNonUniformIndexingNative( shaderStorageImageArrayNonUniformIndexingNative_ ) - , shaderInputAttachmentArrayNonUniformIndexingNative( shaderInputAttachmentArrayNonUniformIndexingNative_ ) - , robustBufferAccessUpdateAfterBind( robustBufferAccessUpdateAfterBind_ ) - , quadDivergentImplicitLod( quadDivergentImplicitLod_ ) - , maxPerStageDescriptorUpdateAfterBindSamplers( maxPerStageDescriptorUpdateAfterBindSamplers_ ) - , maxPerStageDescriptorUpdateAfterBindUniformBuffers( maxPerStageDescriptorUpdateAfterBindUniformBuffers_ ) - , maxPerStageDescriptorUpdateAfterBindStorageBuffers( maxPerStageDescriptorUpdateAfterBindStorageBuffers_ ) - , maxPerStageDescriptorUpdateAfterBindSampledImages( maxPerStageDescriptorUpdateAfterBindSampledImages_ ) - , maxPerStageDescriptorUpdateAfterBindStorageImages( maxPerStageDescriptorUpdateAfterBindStorageImages_ ) - , maxPerStageDescriptorUpdateAfterBindInputAttachments( maxPerStageDescriptorUpdateAfterBindInputAttachments_ ) - , maxPerStageUpdateAfterBindResources( maxPerStageUpdateAfterBindResources_ ) - , maxDescriptorSetUpdateAfterBindSamplers( maxDescriptorSetUpdateAfterBindSamplers_ ) - , maxDescriptorSetUpdateAfterBindUniformBuffers( maxDescriptorSetUpdateAfterBindUniformBuffers_ ) - , maxDescriptorSetUpdateAfterBindUniformBuffersDynamic( maxDescriptorSetUpdateAfterBindUniformBuffersDynamic_ ) - , maxDescriptorSetUpdateAfterBindStorageBuffers( maxDescriptorSetUpdateAfterBindStorageBuffers_ ) - , maxDescriptorSetUpdateAfterBindStorageBuffersDynamic( maxDescriptorSetUpdateAfterBindStorageBuffersDynamic_ ) - , maxDescriptorSetUpdateAfterBindSampledImages( maxDescriptorSetUpdateAfterBindSampledImages_ ) - , maxDescriptorSetUpdateAfterBindStorageImages( maxDescriptorSetUpdateAfterBindStorageImages_ ) - , maxDescriptorSetUpdateAfterBindInputAttachments( maxDescriptorSetUpdateAfterBindInputAttachments_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorIndexingProperties( PhysicalDeviceDescriptorIndexingProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorIndexingProperties( VkPhysicalDeviceDescriptorIndexingProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDescriptorIndexingProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDescriptorIndexingProperties & operator=( PhysicalDeviceDescriptorIndexingProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorIndexingProperties & operator=( VkPhysicalDeviceDescriptorIndexingProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDescriptorIndexingProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDescriptorIndexingProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxUpdateAfterBindDescriptorsInAllPools, - shaderUniformBufferArrayNonUniformIndexingNative, - shaderSampledImageArrayNonUniformIndexingNative, - shaderStorageBufferArrayNonUniformIndexingNative, - shaderStorageImageArrayNonUniformIndexingNative, - shaderInputAttachmentArrayNonUniformIndexingNative, - robustBufferAccessUpdateAfterBind, - quadDivergentImplicitLod, - maxPerStageDescriptorUpdateAfterBindSamplers, - maxPerStageDescriptorUpdateAfterBindUniformBuffers, - maxPerStageDescriptorUpdateAfterBindStorageBuffers, - maxPerStageDescriptorUpdateAfterBindSampledImages, - maxPerStageDescriptorUpdateAfterBindStorageImages, - maxPerStageDescriptorUpdateAfterBindInputAttachments, - maxPerStageUpdateAfterBindResources, - maxDescriptorSetUpdateAfterBindSamplers, - maxDescriptorSetUpdateAfterBindUniformBuffers, - maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, - maxDescriptorSetUpdateAfterBindStorageBuffers, - maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, - maxDescriptorSetUpdateAfterBindSampledImages, - maxDescriptorSetUpdateAfterBindStorageImages, - maxDescriptorSetUpdateAfterBindInputAttachments ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDescriptorIndexingProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceDescriptorIndexingProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxUpdateAfterBindDescriptorsInAllPools == rhs.maxUpdateAfterBindDescriptorsInAllPools ) && - ( shaderUniformBufferArrayNonUniformIndexingNative == rhs.shaderUniformBufferArrayNonUniformIndexingNative ) && - ( shaderSampledImageArrayNonUniformIndexingNative == rhs.shaderSampledImageArrayNonUniformIndexingNative ) && - ( shaderStorageBufferArrayNonUniformIndexingNative == rhs.shaderStorageBufferArrayNonUniformIndexingNative ) && - ( shaderStorageImageArrayNonUniformIndexingNative == rhs.shaderStorageImageArrayNonUniformIndexingNative ) && - ( shaderInputAttachmentArrayNonUniformIndexingNative == rhs.shaderInputAttachmentArrayNonUniformIndexingNative ) && - ( robustBufferAccessUpdateAfterBind == rhs.robustBufferAccessUpdateAfterBind ) && ( quadDivergentImplicitLod == rhs.quadDivergentImplicitLod ) && - ( maxPerStageDescriptorUpdateAfterBindSamplers == rhs.maxPerStageDescriptorUpdateAfterBindSamplers ) && - ( maxPerStageDescriptorUpdateAfterBindUniformBuffers == rhs.maxPerStageDescriptorUpdateAfterBindUniformBuffers ) && - ( maxPerStageDescriptorUpdateAfterBindStorageBuffers == rhs.maxPerStageDescriptorUpdateAfterBindStorageBuffers ) && - ( maxPerStageDescriptorUpdateAfterBindSampledImages == rhs.maxPerStageDescriptorUpdateAfterBindSampledImages ) && - ( maxPerStageDescriptorUpdateAfterBindStorageImages == rhs.maxPerStageDescriptorUpdateAfterBindStorageImages ) && - ( maxPerStageDescriptorUpdateAfterBindInputAttachments == rhs.maxPerStageDescriptorUpdateAfterBindInputAttachments ) && - ( maxPerStageUpdateAfterBindResources == rhs.maxPerStageUpdateAfterBindResources ) && - ( maxDescriptorSetUpdateAfterBindSamplers == rhs.maxDescriptorSetUpdateAfterBindSamplers ) && - ( maxDescriptorSetUpdateAfterBindUniformBuffers == rhs.maxDescriptorSetUpdateAfterBindUniformBuffers ) && - ( maxDescriptorSetUpdateAfterBindUniformBuffersDynamic == rhs.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ) && - ( maxDescriptorSetUpdateAfterBindStorageBuffers == rhs.maxDescriptorSetUpdateAfterBindStorageBuffers ) && - ( maxDescriptorSetUpdateAfterBindStorageBuffersDynamic == rhs.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ) && - ( maxDescriptorSetUpdateAfterBindSampledImages == rhs.maxDescriptorSetUpdateAfterBindSampledImages ) && - ( maxDescriptorSetUpdateAfterBindStorageImages == rhs.maxDescriptorSetUpdateAfterBindStorageImages ) && - ( maxDescriptorSetUpdateAfterBindInputAttachments == rhs.maxDescriptorSetUpdateAfterBindInputAttachments ); -# endif - } - - bool operator!=( PhysicalDeviceDescriptorIndexingProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDescriptorIndexingProperties; - void * pNext = {}; - uint32_t maxUpdateAfterBindDescriptorsInAllPools = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccessUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 quadDivergentImplicitLod = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments = {}; - uint32_t maxPerStageUpdateAfterBindResources = {}; - uint32_t maxDescriptorSetUpdateAfterBindSamplers = {}; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers = {}; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = {}; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages = {}; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDescriptorIndexingProperties; - }; - using PhysicalDeviceDescriptorIndexingPropertiesEXT = PhysicalDeviceDescriptorIndexingProperties; - - struct PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE - { - using NativeType = VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE( VULKAN_HPP_NAMESPACE::Bool32 descriptorSetHostMapping_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , descriptorSetHostMapping( descriptorSetHostMapping_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE( PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE( VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE & - operator=( PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE & operator=( VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE & - setDescriptorSetHostMapping( VULKAN_HPP_NAMESPACE::Bool32 descriptorSetHostMapping_ ) VULKAN_HPP_NOEXCEPT - { - descriptorSetHostMapping = descriptorSetHostMapping_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, descriptorSetHostMapping ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & ) const = default; -#else - bool operator==( PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( descriptorSetHostMapping == rhs.descriptorSetHostMapping ); -# endif - } - - bool operator!=( PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorSetHostMapping = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE; - }; - - struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV - { - using NativeType = VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDeviceGeneratedCommandsFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 deviceGeneratedCommands_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceGeneratedCommands( deviceGeneratedCommands_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceDeviceGeneratedCommandsFeaturesNV( PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceGeneratedCommandsFeaturesNV( VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDeviceGeneratedCommandsFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDeviceGeneratedCommandsFeaturesNV & operator=( PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceGeneratedCommandsFeaturesNV & operator=( VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDeviceGeneratedCommandsFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDeviceGeneratedCommandsFeaturesNV & - setDeviceGeneratedCommands( VULKAN_HPP_NAMESPACE::Bool32 deviceGeneratedCommands_ ) VULKAN_HPP_NOEXCEPT - { - deviceGeneratedCommands = deviceGeneratedCommands_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceGeneratedCommands ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceGeneratedCommands == rhs.deviceGeneratedCommands ); -# endif - } - - bool operator!=( PhysicalDeviceDeviceGeneratedCommandsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 deviceGeneratedCommands = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDeviceGeneratedCommandsFeaturesNV; - }; - - struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV - { - using NativeType = VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDeviceGeneratedCommandsPropertiesNV( uint32_t maxGraphicsShaderGroupCount_ = {}, - uint32_t maxIndirectSequenceCount_ = {}, - uint32_t maxIndirectCommandsTokenCount_ = {}, - uint32_t maxIndirectCommandsStreamCount_ = {}, - uint32_t maxIndirectCommandsTokenOffset_ = {}, - uint32_t maxIndirectCommandsStreamStride_ = {}, - uint32_t minSequencesCountBufferOffsetAlignment_ = {}, - uint32_t minSequencesIndexBufferOffsetAlignment_ = {}, - uint32_t minIndirectCommandsBufferOffsetAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxGraphicsShaderGroupCount( maxGraphicsShaderGroupCount_ ) - , maxIndirectSequenceCount( maxIndirectSequenceCount_ ) - , maxIndirectCommandsTokenCount( maxIndirectCommandsTokenCount_ ) - , maxIndirectCommandsStreamCount( maxIndirectCommandsStreamCount_ ) - , maxIndirectCommandsTokenOffset( maxIndirectCommandsTokenOffset_ ) - , maxIndirectCommandsStreamStride( maxIndirectCommandsStreamStride_ ) - , minSequencesCountBufferOffsetAlignment( minSequencesCountBufferOffsetAlignment_ ) - , minSequencesIndexBufferOffsetAlignment( minSequencesIndexBufferOffsetAlignment_ ) - , minIndirectCommandsBufferOffsetAlignment( minIndirectCommandsBufferOffsetAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceDeviceGeneratedCommandsPropertiesNV( PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceGeneratedCommandsPropertiesNV( VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDeviceGeneratedCommandsPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDeviceGeneratedCommandsPropertiesNV & - operator=( PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceGeneratedCommandsPropertiesNV & operator=( VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxGraphicsShaderGroupCount, - maxIndirectSequenceCount, - maxIndirectCommandsTokenCount, - maxIndirectCommandsStreamCount, - maxIndirectCommandsTokenOffset, - maxIndirectCommandsStreamStride, - minSequencesCountBufferOffsetAlignment, - minSequencesIndexBufferOffsetAlignment, - minIndirectCommandsBufferOffsetAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxGraphicsShaderGroupCount == rhs.maxGraphicsShaderGroupCount ) && - ( maxIndirectSequenceCount == rhs.maxIndirectSequenceCount ) && ( maxIndirectCommandsTokenCount == rhs.maxIndirectCommandsTokenCount ) && - ( maxIndirectCommandsStreamCount == rhs.maxIndirectCommandsStreamCount ) && - ( maxIndirectCommandsTokenOffset == rhs.maxIndirectCommandsTokenOffset ) && - ( maxIndirectCommandsStreamStride == rhs.maxIndirectCommandsStreamStride ) && - ( minSequencesCountBufferOffsetAlignment == rhs.minSequencesCountBufferOffsetAlignment ) && - ( minSequencesIndexBufferOffsetAlignment == rhs.minSequencesIndexBufferOffsetAlignment ) && - ( minIndirectCommandsBufferOffsetAlignment == rhs.minIndirectCommandsBufferOffsetAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceDeviceGeneratedCommandsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - void * pNext = {}; - uint32_t maxGraphicsShaderGroupCount = {}; - uint32_t maxIndirectSequenceCount = {}; - uint32_t maxIndirectCommandsTokenCount = {}; - uint32_t maxIndirectCommandsStreamCount = {}; - uint32_t maxIndirectCommandsTokenOffset = {}; - uint32_t maxIndirectCommandsStreamStride = {}; - uint32_t minSequencesCountBufferOffsetAlignment = {}; - uint32_t minSequencesIndexBufferOffsetAlignment = {}; - uint32_t minIndirectCommandsBufferOffsetAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDeviceGeneratedCommandsPropertiesNV; - }; - - struct PhysicalDeviceDeviceMemoryReportFeaturesEXT - { - using NativeType = VkPhysicalDeviceDeviceMemoryReportFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDeviceMemoryReportFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDeviceMemoryReportFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 deviceMemoryReport_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceMemoryReport( deviceMemoryReport_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDeviceMemoryReportFeaturesEXT( PhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceMemoryReportFeaturesEXT( VkPhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDeviceMemoryReportFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDeviceMemoryReportFeaturesEXT & operator=( PhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDeviceMemoryReportFeaturesEXT & operator=( VkPhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDeviceMemoryReportFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDeviceMemoryReportFeaturesEXT & - setDeviceMemoryReport( VULKAN_HPP_NAMESPACE::Bool32 deviceMemoryReport_ ) VULKAN_HPP_NOEXCEPT - { - deviceMemoryReport = deviceMemoryReport_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDeviceMemoryReportFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDeviceMemoryReportFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceMemoryReport ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDeviceMemoryReportFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceMemoryReport == rhs.deviceMemoryReport ); -# endif - } - - bool operator!=( PhysicalDeviceDeviceMemoryReportFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDeviceMemoryReportFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 deviceMemoryReport = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDeviceMemoryReportFeaturesEXT; - }; - - struct PhysicalDeviceDiagnosticsConfigFeaturesNV - { - using NativeType = VkPhysicalDeviceDiagnosticsConfigFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDiagnosticsConfigFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDiagnosticsConfigFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 diagnosticsConfig_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , diagnosticsConfig( diagnosticsConfig_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDiagnosticsConfigFeaturesNV( PhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDiagnosticsConfigFeaturesNV( VkPhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDiagnosticsConfigFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDiagnosticsConfigFeaturesNV & operator=( PhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDiagnosticsConfigFeaturesNV & operator=( VkPhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDiagnosticsConfigFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDiagnosticsConfigFeaturesNV & - setDiagnosticsConfig( VULKAN_HPP_NAMESPACE::Bool32 diagnosticsConfig_ ) VULKAN_HPP_NOEXCEPT - { - diagnosticsConfig = diagnosticsConfig_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDiagnosticsConfigFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDiagnosticsConfigFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, diagnosticsConfig ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDiagnosticsConfigFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( diagnosticsConfig == rhs.diagnosticsConfig ); -# endif - } - - bool operator!=( PhysicalDeviceDiagnosticsConfigFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDiagnosticsConfigFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 diagnosticsConfig = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDiagnosticsConfigFeaturesNV; - }; - - struct PhysicalDeviceDiscardRectanglePropertiesEXT - { - using NativeType = VkPhysicalDeviceDiscardRectanglePropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDiscardRectanglePropertiesEXT( uint32_t maxDiscardRectangles_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxDiscardRectangles( maxDiscardRectangles_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDiscardRectanglePropertiesEXT( PhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDiscardRectanglePropertiesEXT( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDiscardRectanglePropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDiscardRectanglePropertiesEXT & operator=( PhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDiscardRectanglePropertiesEXT & operator=( VkPhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDiscardRectanglePropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDiscardRectanglePropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxDiscardRectangles ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDiscardRectanglePropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxDiscardRectangles == rhs.maxDiscardRectangles ); -# endif - } - - bool operator!=( PhysicalDeviceDiscardRectanglePropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT; - void * pNext = {}; - uint32_t maxDiscardRectangles = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDiscardRectanglePropertiesEXT; - }; - - struct PhysicalDeviceDriverProperties - { - using NativeType = VkPhysicalDeviceDriverProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDriverProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDriverProperties( VULKAN_HPP_NAMESPACE::DriverId driverID_ = VULKAN_HPP_NAMESPACE::DriverId::eAmdProprietary, - std::array const & driverName_ = {}, - std::array const & driverInfo_ = {}, - VULKAN_HPP_NAMESPACE::ConformanceVersion conformanceVersion_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , driverID( driverID_ ) - , driverName( driverName_ ) - , driverInfo( driverInfo_ ) - , conformanceVersion( conformanceVersion_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDriverProperties( PhysicalDeviceDriverProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDriverProperties( VkPhysicalDeviceDriverProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDriverProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDriverProperties & operator=( PhysicalDeviceDriverProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDriverProperties & operator=( VkPhysicalDeviceDriverProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDriverProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDriverProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ConformanceVersion const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, driverID, driverName, driverInfo, conformanceVersion ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDriverProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceDriverProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( driverID == rhs.driverID ) && ( driverName == rhs.driverName ) && - ( driverInfo == rhs.driverInfo ) && ( conformanceVersion == rhs.conformanceVersion ); -# endif - } - - bool operator!=( PhysicalDeviceDriverProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDriverProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DriverId driverID = VULKAN_HPP_NAMESPACE::DriverId::eAmdProprietary; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverName = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverInfo = {}; - VULKAN_HPP_NAMESPACE::ConformanceVersion conformanceVersion = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDriverProperties; - }; - using PhysicalDeviceDriverPropertiesKHR = PhysicalDeviceDriverProperties; - - struct PhysicalDeviceDrmPropertiesEXT - { - using NativeType = VkPhysicalDeviceDrmPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDrmPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDrmPropertiesEXT( VULKAN_HPP_NAMESPACE::Bool32 hasPrimary_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 hasRender_ = {}, - int64_t primaryMajor_ = {}, - int64_t primaryMinor_ = {}, - int64_t renderMajor_ = {}, - int64_t renderMinor_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , hasPrimary( hasPrimary_ ) - , hasRender( hasRender_ ) - , primaryMajor( primaryMajor_ ) - , primaryMinor( primaryMinor_ ) - , renderMajor( renderMajor_ ) - , renderMinor( renderMinor_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDrmPropertiesEXT( PhysicalDeviceDrmPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDrmPropertiesEXT( VkPhysicalDeviceDrmPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDrmPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDrmPropertiesEXT & operator=( PhysicalDeviceDrmPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDrmPropertiesEXT & operator=( VkPhysicalDeviceDrmPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceDrmPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDrmPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, hasPrimary, hasRender, primaryMajor, primaryMinor, renderMajor, renderMinor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDrmPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceDrmPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( hasPrimary == rhs.hasPrimary ) && ( hasRender == rhs.hasRender ) && - ( primaryMajor == rhs.primaryMajor ) && ( primaryMinor == rhs.primaryMinor ) && ( renderMajor == rhs.renderMajor ) && - ( renderMinor == rhs.renderMinor ); -# endif - } - - bool operator!=( PhysicalDeviceDrmPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDrmPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 hasPrimary = {}; - VULKAN_HPP_NAMESPACE::Bool32 hasRender = {}; - int64_t primaryMajor = {}; - int64_t primaryMinor = {}; - int64_t renderMajor = {}; - int64_t renderMinor = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDrmPropertiesEXT; - }; - - struct PhysicalDeviceDynamicRenderingFeatures - { - using NativeType = VkPhysicalDeviceDynamicRenderingFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceDynamicRenderingFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceDynamicRenderingFeatures( VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dynamicRendering( dynamicRendering_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceDynamicRenderingFeatures( PhysicalDeviceDynamicRenderingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDynamicRenderingFeatures( VkPhysicalDeviceDynamicRenderingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceDynamicRenderingFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceDynamicRenderingFeatures & operator=( PhysicalDeviceDynamicRenderingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceDynamicRenderingFeatures & operator=( VkPhysicalDeviceDynamicRenderingFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDynamicRenderingFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceDynamicRenderingFeatures & setDynamicRendering( VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering_ ) VULKAN_HPP_NOEXCEPT - { - dynamicRendering = dynamicRendering_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceDynamicRenderingFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceDynamicRenderingFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dynamicRendering ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceDynamicRenderingFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceDynamicRenderingFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dynamicRendering == rhs.dynamicRendering ); -# endif - } - - bool operator!=( PhysicalDeviceDynamicRenderingFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceDynamicRenderingFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceDynamicRenderingFeatures; - }; - using PhysicalDeviceDynamicRenderingFeaturesKHR = PhysicalDeviceDynamicRenderingFeatures; - - struct PhysicalDeviceExclusiveScissorFeaturesNV - { - using NativeType = VkPhysicalDeviceExclusiveScissorFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExclusiveScissorFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExclusiveScissorFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 exclusiveScissor_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , exclusiveScissor( exclusiveScissor_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExclusiveScissorFeaturesNV( PhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExclusiveScissorFeaturesNV( VkPhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExclusiveScissorFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExclusiveScissorFeaturesNV & operator=( PhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExclusiveScissorFeaturesNV & operator=( VkPhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExclusiveScissorFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExclusiveScissorFeaturesNV & setExclusiveScissor( VULKAN_HPP_NAMESPACE::Bool32 exclusiveScissor_ ) VULKAN_HPP_NOEXCEPT - { - exclusiveScissor = exclusiveScissor_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExclusiveScissorFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExclusiveScissorFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, exclusiveScissor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExclusiveScissorFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( exclusiveScissor == rhs.exclusiveScissor ); -# endif - } - - bool operator!=( PhysicalDeviceExclusiveScissorFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExclusiveScissorFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 exclusiveScissor = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExclusiveScissorFeaturesNV; - }; - - struct PhysicalDeviceExtendedDynamicState2FeaturesEXT - { - using NativeType = VkPhysicalDeviceExtendedDynamicState2FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExtendedDynamicState2FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExtendedDynamicState2FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2LogicOp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2PatchControlPoints_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , extendedDynamicState2( extendedDynamicState2_ ) - , extendedDynamicState2LogicOp( extendedDynamicState2LogicOp_ ) - , extendedDynamicState2PatchControlPoints( extendedDynamicState2PatchControlPoints_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceExtendedDynamicState2FeaturesEXT( PhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExtendedDynamicState2FeaturesEXT( VkPhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExtendedDynamicState2FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExtendedDynamicState2FeaturesEXT & operator=( PhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExtendedDynamicState2FeaturesEXT & operator=( VkPhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicState2FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicState2FeaturesEXT & - setExtendedDynamicState2( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2_ ) VULKAN_HPP_NOEXCEPT - { - extendedDynamicState2 = extendedDynamicState2_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicState2FeaturesEXT & - setExtendedDynamicState2LogicOp( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2LogicOp_ ) VULKAN_HPP_NOEXCEPT - { - extendedDynamicState2LogicOp = extendedDynamicState2LogicOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicState2FeaturesEXT & - setExtendedDynamicState2PatchControlPoints( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2PatchControlPoints_ ) VULKAN_HPP_NOEXCEPT - { - extendedDynamicState2PatchControlPoints = extendedDynamicState2PatchControlPoints_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExtendedDynamicState2FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExtendedDynamicState2FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, extendedDynamicState2, extendedDynamicState2LogicOp, extendedDynamicState2PatchControlPoints ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExtendedDynamicState2FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( extendedDynamicState2 == rhs.extendedDynamicState2 ) && - ( extendedDynamicState2LogicOp == rhs.extendedDynamicState2LogicOp ) && - ( extendedDynamicState2PatchControlPoints == rhs.extendedDynamicState2PatchControlPoints ); -# endif - } - - bool operator!=( PhysicalDeviceExtendedDynamicState2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExtendedDynamicState2FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2 = {}; - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2LogicOp = {}; - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState2PatchControlPoints = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExtendedDynamicState2FeaturesEXT; - }; - - struct PhysicalDeviceExtendedDynamicStateFeaturesEXT - { - using NativeType = VkPhysicalDeviceExtendedDynamicStateFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExtendedDynamicStateFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExtendedDynamicStateFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , extendedDynamicState( extendedDynamicState_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceExtendedDynamicStateFeaturesEXT( PhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExtendedDynamicStateFeaturesEXT( VkPhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExtendedDynamicStateFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExtendedDynamicStateFeaturesEXT & operator=( PhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExtendedDynamicStateFeaturesEXT & operator=( VkPhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicStateFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExtendedDynamicStateFeaturesEXT & - setExtendedDynamicState( VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState_ ) VULKAN_HPP_NOEXCEPT - { - extendedDynamicState = extendedDynamicState_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExtendedDynamicStateFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExtendedDynamicStateFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, extendedDynamicState ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExtendedDynamicStateFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( extendedDynamicState == rhs.extendedDynamicState ); -# endif - } - - bool operator!=( PhysicalDeviceExtendedDynamicStateFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExtendedDynamicStateFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 extendedDynamicState = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExtendedDynamicStateFeaturesEXT; - }; - - struct PhysicalDeviceExternalBufferInfo - { - using NativeType = VkPhysicalDeviceExternalBufferInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalBufferInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalBufferInfo( - VULKAN_HPP_NAMESPACE::BufferCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::BufferUsageFlags usage_ = {}, - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , usage( usage_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalBufferInfo( PhysicalDeviceExternalBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalBufferInfo( VkPhysicalDeviceExternalBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalBufferInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalBufferInfo & operator=( PhysicalDeviceExternalBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalBufferInfo & operator=( VkPhysicalDeviceExternalBufferInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalBufferInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalBufferInfo & setFlags( VULKAN_HPP_NAMESPACE::BufferCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalBufferInfo & setUsage( VULKAN_HPP_NAMESPACE::BufferUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalBufferInfo & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExternalBufferInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalBufferInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, usage, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalBufferInfo const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalBufferInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( usage == rhs.usage ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( PhysicalDeviceExternalBufferInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalBufferInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::BufferCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::BufferUsageFlags usage = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalBufferInfo; - }; - using PhysicalDeviceExternalBufferInfoKHR = PhysicalDeviceExternalBufferInfo; - - struct PhysicalDeviceExternalFenceInfo - { - using NativeType = VkPhysicalDeviceExternalFenceInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalFenceInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalFenceInfo( - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalFenceInfo( PhysicalDeviceExternalFenceInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalFenceInfo( VkPhysicalDeviceExternalFenceInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalFenceInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalFenceInfo & operator=( PhysicalDeviceExternalFenceInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalFenceInfo & operator=( VkPhysicalDeviceExternalFenceInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalFenceInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalFenceInfo & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExternalFenceInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalFenceInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalFenceInfo const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalFenceInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( PhysicalDeviceExternalFenceInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalFenceInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalFenceHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalFenceInfo; - }; - using PhysicalDeviceExternalFenceInfoKHR = PhysicalDeviceExternalFenceInfo; - - struct PhysicalDeviceExternalImageFormatInfo - { - using NativeType = VkPhysicalDeviceExternalImageFormatInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalImageFormatInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalImageFormatInfo( - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalImageFormatInfo( PhysicalDeviceExternalImageFormatInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalImageFormatInfo( VkPhysicalDeviceExternalImageFormatInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalImageFormatInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalImageFormatInfo & operator=( PhysicalDeviceExternalImageFormatInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalImageFormatInfo & operator=( VkPhysicalDeviceExternalImageFormatInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalImageFormatInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalImageFormatInfo & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExternalImageFormatInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalImageFormatInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalImageFormatInfo const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalImageFormatInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( PhysicalDeviceExternalImageFormatInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalImageFormatInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalMemoryHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalImageFormatInfo; - }; - using PhysicalDeviceExternalImageFormatInfoKHR = PhysicalDeviceExternalImageFormatInfo; - - struct PhysicalDeviceExternalMemoryHostPropertiesEXT - { - using NativeType = VkPhysicalDeviceExternalMemoryHostPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalMemoryHostPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalMemoryHostPropertiesEXT( VULKAN_HPP_NAMESPACE::DeviceSize minImportedHostPointerAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minImportedHostPointerAlignment( minImportedHostPointerAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceExternalMemoryHostPropertiesEXT( PhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalMemoryHostPropertiesEXT( VkPhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalMemoryHostPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalMemoryHostPropertiesEXT & operator=( PhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalMemoryHostPropertiesEXT & operator=( VkPhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceExternalMemoryHostPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalMemoryHostPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minImportedHostPointerAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalMemoryHostPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minImportedHostPointerAlignment == rhs.minImportedHostPointerAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceExternalMemoryHostPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalMemoryHostPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minImportedHostPointerAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalMemoryHostPropertiesEXT; - }; - - struct PhysicalDeviceExternalMemoryRDMAFeaturesNV - { - using NativeType = VkPhysicalDeviceExternalMemoryRDMAFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalMemoryRdmaFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalMemoryRDMAFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 externalMemoryRDMA_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , externalMemoryRDMA( externalMemoryRDMA_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalMemoryRDMAFeaturesNV( PhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalMemoryRDMAFeaturesNV( VkPhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalMemoryRDMAFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalMemoryRDMAFeaturesNV & operator=( PhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalMemoryRDMAFeaturesNV & operator=( VkPhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalMemoryRDMAFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalMemoryRDMAFeaturesNV & - setExternalMemoryRDMA( VULKAN_HPP_NAMESPACE::Bool32 externalMemoryRDMA_ ) VULKAN_HPP_NOEXCEPT - { - externalMemoryRDMA = externalMemoryRDMA_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExternalMemoryRDMAFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalMemoryRDMAFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, externalMemoryRDMA ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalMemoryRDMAFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( externalMemoryRDMA == rhs.externalMemoryRDMA ); -# endif - } - - bool operator!=( PhysicalDeviceExternalMemoryRDMAFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalMemoryRdmaFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 externalMemoryRDMA = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalMemoryRDMAFeaturesNV; - }; - - struct PhysicalDeviceExternalSemaphoreInfo - { - using NativeType = VkPhysicalDeviceExternalSemaphoreInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceExternalSemaphoreInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalSemaphoreInfo( - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceExternalSemaphoreInfo( PhysicalDeviceExternalSemaphoreInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalSemaphoreInfo( VkPhysicalDeviceExternalSemaphoreInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceExternalSemaphoreInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceExternalSemaphoreInfo & operator=( PhysicalDeviceExternalSemaphoreInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceExternalSemaphoreInfo & operator=( VkPhysicalDeviceExternalSemaphoreInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalSemaphoreInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceExternalSemaphoreInfo & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceExternalSemaphoreInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceExternalSemaphoreInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceExternalSemaphoreInfo const & ) const = default; -#else - bool operator==( PhysicalDeviceExternalSemaphoreInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( PhysicalDeviceExternalSemaphoreInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceExternalSemaphoreInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceExternalSemaphoreInfo; - }; - using PhysicalDeviceExternalSemaphoreInfoKHR = PhysicalDeviceExternalSemaphoreInfo; - - struct PhysicalDeviceFeatures2 - { - using NativeType = VkPhysicalDeviceFeatures2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFeatures2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFeatures2( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures features_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , features( features_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFeatures2( PhysicalDeviceFeatures2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFeatures2( VkPhysicalDeviceFeatures2 const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFeatures2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFeatures2 & operator=( PhysicalDeviceFeatures2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFeatures2 & operator=( VkPhysicalDeviceFeatures2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures2 & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFeatures2 & setFeatures( VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures const & features_ ) VULKAN_HPP_NOEXCEPT - { - features = features_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFeatures2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFeatures2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, features ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFeatures2 const & ) const = default; -#else - bool operator==( PhysicalDeviceFeatures2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( features == rhs.features ); -# endif - } - - bool operator!=( PhysicalDeviceFeatures2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFeatures2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceFeatures features = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFeatures2; - }; - using PhysicalDeviceFeatures2KHR = PhysicalDeviceFeatures2; - - struct PhysicalDeviceFloatControlsProperties - { - using NativeType = VkPhysicalDeviceFloatControlsProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFloatControlsProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFloatControlsProperties( - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence denormBehaviorIndependence_ = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly, - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence roundingModeIndependence_ = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat64_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , denormBehaviorIndependence( denormBehaviorIndependence_ ) - , roundingModeIndependence( roundingModeIndependence_ ) - , shaderSignedZeroInfNanPreserveFloat16( shaderSignedZeroInfNanPreserveFloat16_ ) - , shaderSignedZeroInfNanPreserveFloat32( shaderSignedZeroInfNanPreserveFloat32_ ) - , shaderSignedZeroInfNanPreserveFloat64( shaderSignedZeroInfNanPreserveFloat64_ ) - , shaderDenormPreserveFloat16( shaderDenormPreserveFloat16_ ) - , shaderDenormPreserveFloat32( shaderDenormPreserveFloat32_ ) - , shaderDenormPreserveFloat64( shaderDenormPreserveFloat64_ ) - , shaderDenormFlushToZeroFloat16( shaderDenormFlushToZeroFloat16_ ) - , shaderDenormFlushToZeroFloat32( shaderDenormFlushToZeroFloat32_ ) - , shaderDenormFlushToZeroFloat64( shaderDenormFlushToZeroFloat64_ ) - , shaderRoundingModeRTEFloat16( shaderRoundingModeRTEFloat16_ ) - , shaderRoundingModeRTEFloat32( shaderRoundingModeRTEFloat32_ ) - , shaderRoundingModeRTEFloat64( shaderRoundingModeRTEFloat64_ ) - , shaderRoundingModeRTZFloat16( shaderRoundingModeRTZFloat16_ ) - , shaderRoundingModeRTZFloat32( shaderRoundingModeRTZFloat32_ ) - , shaderRoundingModeRTZFloat64( shaderRoundingModeRTZFloat64_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFloatControlsProperties( PhysicalDeviceFloatControlsProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFloatControlsProperties( VkPhysicalDeviceFloatControlsProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFloatControlsProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFloatControlsProperties & operator=( PhysicalDeviceFloatControlsProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFloatControlsProperties & operator=( VkPhysicalDeviceFloatControlsProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFloatControlsProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFloatControlsProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - denormBehaviorIndependence, - roundingModeIndependence, - shaderSignedZeroInfNanPreserveFloat16, - shaderSignedZeroInfNanPreserveFloat32, - shaderSignedZeroInfNanPreserveFloat64, - shaderDenormPreserveFloat16, - shaderDenormPreserveFloat32, - shaderDenormPreserveFloat64, - shaderDenormFlushToZeroFloat16, - shaderDenormFlushToZeroFloat32, - shaderDenormFlushToZeroFloat64, - shaderRoundingModeRTEFloat16, - shaderRoundingModeRTEFloat32, - shaderRoundingModeRTEFloat64, - shaderRoundingModeRTZFloat16, - shaderRoundingModeRTZFloat32, - shaderRoundingModeRTZFloat64 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFloatControlsProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceFloatControlsProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( denormBehaviorIndependence == rhs.denormBehaviorIndependence ) && - ( roundingModeIndependence == rhs.roundingModeIndependence ) && - ( shaderSignedZeroInfNanPreserveFloat16 == rhs.shaderSignedZeroInfNanPreserveFloat16 ) && - ( shaderSignedZeroInfNanPreserveFloat32 == rhs.shaderSignedZeroInfNanPreserveFloat32 ) && - ( shaderSignedZeroInfNanPreserveFloat64 == rhs.shaderSignedZeroInfNanPreserveFloat64 ) && - ( shaderDenormPreserveFloat16 == rhs.shaderDenormPreserveFloat16 ) && ( shaderDenormPreserveFloat32 == rhs.shaderDenormPreserveFloat32 ) && - ( shaderDenormPreserveFloat64 == rhs.shaderDenormPreserveFloat64 ) && ( shaderDenormFlushToZeroFloat16 == rhs.shaderDenormFlushToZeroFloat16 ) && - ( shaderDenormFlushToZeroFloat32 == rhs.shaderDenormFlushToZeroFloat32 ) && - ( shaderDenormFlushToZeroFloat64 == rhs.shaderDenormFlushToZeroFloat64 ) && ( shaderRoundingModeRTEFloat16 == rhs.shaderRoundingModeRTEFloat16 ) && - ( shaderRoundingModeRTEFloat32 == rhs.shaderRoundingModeRTEFloat32 ) && ( shaderRoundingModeRTEFloat64 == rhs.shaderRoundingModeRTEFloat64 ) && - ( shaderRoundingModeRTZFloat16 == rhs.shaderRoundingModeRTZFloat16 ) && ( shaderRoundingModeRTZFloat32 == rhs.shaderRoundingModeRTZFloat32 ) && - ( shaderRoundingModeRTZFloat64 == rhs.shaderRoundingModeRTZFloat64 ); -# endif - } - - bool operator!=( PhysicalDeviceFloatControlsProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFloatControlsProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence denormBehaviorIndependence = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly; - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence roundingModeIndependence = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat64 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFloatControlsProperties; - }; - using PhysicalDeviceFloatControlsPropertiesKHR = PhysicalDeviceFloatControlsProperties; - - struct PhysicalDeviceFragmentDensityMap2FeaturesEXT - { - using NativeType = VkPhysicalDeviceFragmentDensityMap2FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMap2FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMap2FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDeferred_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityMapDeferred( fragmentDensityMapDeferred_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMap2FeaturesEXT( PhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMap2FeaturesEXT( VkPhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMap2FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMap2FeaturesEXT & operator=( PhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMap2FeaturesEXT & operator=( VkPhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMap2FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMap2FeaturesEXT & - setFragmentDensityMapDeferred( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDeferred_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMapDeferred = fragmentDensityMapDeferred_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentDensityMap2FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMap2FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityMapDeferred ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMap2FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityMapDeferred == rhs.fragmentDensityMapDeferred ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMap2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMap2FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDeferred = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMap2FeaturesEXT; - }; - - struct PhysicalDeviceFragmentDensityMap2PropertiesEXT - { - using NativeType = VkPhysicalDeviceFragmentDensityMap2PropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMap2PropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMap2PropertiesEXT( VULKAN_HPP_NAMESPACE::Bool32 subsampledLoads_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 subsampledCoarseReconstructionEarlyAccess_ = {}, - uint32_t maxSubsampledArrayLayers_ = {}, - uint32_t maxDescriptorSetSubsampledSamplers_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subsampledLoads( subsampledLoads_ ) - , subsampledCoarseReconstructionEarlyAccess( subsampledCoarseReconstructionEarlyAccess_ ) - , maxSubsampledArrayLayers( maxSubsampledArrayLayers_ ) - , maxDescriptorSetSubsampledSamplers( maxDescriptorSetSubsampledSamplers_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentDensityMap2PropertiesEXT( PhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMap2PropertiesEXT( VkPhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMap2PropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMap2PropertiesEXT & operator=( PhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMap2PropertiesEXT & operator=( VkPhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentDensityMap2PropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMap2PropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subsampledLoads, subsampledCoarseReconstructionEarlyAccess, maxSubsampledArrayLayers, maxDescriptorSetSubsampledSamplers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMap2PropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subsampledLoads == rhs.subsampledLoads ) && - ( subsampledCoarseReconstructionEarlyAccess == rhs.subsampledCoarseReconstructionEarlyAccess ) && - ( maxSubsampledArrayLayers == rhs.maxSubsampledArrayLayers ) && ( maxDescriptorSetSubsampledSamplers == rhs.maxDescriptorSetSubsampledSamplers ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMap2PropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMap2PropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 subsampledLoads = {}; - VULKAN_HPP_NAMESPACE::Bool32 subsampledCoarseReconstructionEarlyAccess = {}; - uint32_t maxSubsampledArrayLayers = {}; - uint32_t maxDescriptorSetSubsampledSamplers = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMap2PropertiesEXT; - }; - - struct PhysicalDeviceFragmentDensityMapFeaturesEXT - { - using NativeType = VkPhysicalDeviceFragmentDensityMapFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMapFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMapFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMap_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDynamic_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapNonSubsampledImages_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityMap( fragmentDensityMap_ ) - , fragmentDensityMapDynamic( fragmentDensityMapDynamic_ ) - , fragmentDensityMapNonSubsampledImages( fragmentDensityMapNonSubsampledImages_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMapFeaturesEXT( PhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapFeaturesEXT( VkPhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMapFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMapFeaturesEXT & operator=( PhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapFeaturesEXT & operator=( VkPhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapFeaturesEXT & - setFragmentDensityMap( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMap_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMap = fragmentDensityMap_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapFeaturesEXT & - setFragmentDensityMapDynamic( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDynamic_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMapDynamic = fragmentDensityMapDynamic_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapFeaturesEXT & - setFragmentDensityMapNonSubsampledImages( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapNonSubsampledImages_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMapNonSubsampledImages = fragmentDensityMapNonSubsampledImages_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentDensityMapFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMapFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityMap, fragmentDensityMapDynamic, fragmentDensityMapNonSubsampledImages ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMapFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityMap == rhs.fragmentDensityMap ) && - ( fragmentDensityMapDynamic == rhs.fragmentDensityMapDynamic ) && - ( fragmentDensityMapNonSubsampledImages == rhs.fragmentDensityMapNonSubsampledImages ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMapFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMapFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMap = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapDynamic = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapNonSubsampledImages = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMapFeaturesEXT; - }; - - struct PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM - { - using NativeType = VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapOffset_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityMapOffset( fragmentDensityMapOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM( VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM & - operator=( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM & operator=( VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM & - setFragmentDensityMapOffset( VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapOffset_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMapOffset = fragmentDensityMapOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityMapOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityMapOffset == rhs.fragmentDensityMapOffset ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityMapOffset = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM; - }; - - struct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM - { - using NativeType = VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM( VULKAN_HPP_NAMESPACE::Extent2D fragmentDensityOffsetGranularity_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityOffsetGranularity( fragmentDensityOffsetGranularity_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM( PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM( VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM & - operator=( PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM & operator=( VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityOffsetGranularity ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityOffsetGranularity == rhs.fragmentDensityOffsetGranularity ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D fragmentDensityOffsetGranularity = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM; - }; - - struct PhysicalDeviceFragmentDensityMapPropertiesEXT - { - using NativeType = VkPhysicalDeviceFragmentDensityMapPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentDensityMapPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentDensityMapPropertiesEXT( VULKAN_HPP_NAMESPACE::Extent2D minFragmentDensityTexelSize_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentDensityTexelSize_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityInvocations_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minFragmentDensityTexelSize( minFragmentDensityTexelSize_ ) - , maxFragmentDensityTexelSize( maxFragmentDensityTexelSize_ ) - , fragmentDensityInvocations( fragmentDensityInvocations_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentDensityMapPropertiesEXT( PhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapPropertiesEXT( VkPhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentDensityMapPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentDensityMapPropertiesEXT & operator=( PhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentDensityMapPropertiesEXT & operator=( VkPhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentDensityMapPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentDensityMapPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minFragmentDensityTexelSize, maxFragmentDensityTexelSize, fragmentDensityInvocations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentDensityMapPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minFragmentDensityTexelSize == rhs.minFragmentDensityTexelSize ) && - ( maxFragmentDensityTexelSize == rhs.maxFragmentDensityTexelSize ) && ( fragmentDensityInvocations == rhs.fragmentDensityInvocations ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentDensityMapPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentDensityMapPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D minFragmentDensityTexelSize = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentDensityTexelSize = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentDensityInvocations = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentDensityMapPropertiesEXT; - }; - - struct PhysicalDeviceFragmentShaderBarycentricFeaturesKHR - { - using NativeType = VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShaderBarycentricFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderBarycentric_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentShaderBarycentric( fragmentShaderBarycentric_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShaderBarycentricFeaturesKHR( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderBarycentricFeaturesKHR( VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShaderBarycentricFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShaderBarycentricFeaturesKHR & - operator=( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderBarycentricFeaturesKHR & operator=( VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderBarycentricFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderBarycentricFeaturesKHR & - setFragmentShaderBarycentric( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderBarycentric_ ) VULKAN_HPP_NOEXCEPT - { - fragmentShaderBarycentric = fragmentShaderBarycentric_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentShaderBarycentric ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentShaderBarycentric == rhs.fragmentShaderBarycentric ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShaderBarycentricFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderBarycentric = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - }; - using PhysicalDeviceFragmentShaderBarycentricFeaturesNV = PhysicalDeviceFragmentShaderBarycentricFeaturesKHR; - - struct PhysicalDeviceFragmentShaderBarycentricPropertiesKHR - { - using NativeType = VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShaderBarycentricPropertiesKHR( VULKAN_HPP_NAMESPACE::Bool32 triStripVertexOrderIndependentOfProvokingVertex_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , triStripVertexOrderIndependentOfProvokingVertex( triStripVertexOrderIndependentOfProvokingVertex_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShaderBarycentricPropertiesKHR( PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderBarycentricPropertiesKHR( VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShaderBarycentricPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShaderBarycentricPropertiesKHR & - operator=( PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderBarycentricPropertiesKHR & operator=( VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, triStripVertexOrderIndependentOfProvokingVertex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && - ( triStripVertexOrderIndependentOfProvokingVertex == rhs.triStripVertexOrderIndependentOfProvokingVertex ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShaderBarycentricPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 triStripVertexOrderIndependentOfProvokingVertex = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShaderBarycentricPropertiesKHR; - }; - - struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT - { - using NativeType = VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShaderInterlockFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShaderInterlockFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderSampleInterlock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderPixelInterlock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderShadingRateInterlock_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentShaderSampleInterlock( fragmentShaderSampleInterlock_ ) - , fragmentShaderPixelInterlock( fragmentShaderPixelInterlock_ ) - , fragmentShaderShadingRateInterlock( fragmentShaderShadingRateInterlock_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShaderInterlockFeaturesEXT( PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderInterlockFeaturesEXT( VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShaderInterlockFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShaderInterlockFeaturesEXT & operator=( PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShaderInterlockFeaturesEXT & operator=( VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderInterlockFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderInterlockFeaturesEXT & - setFragmentShaderSampleInterlock( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderSampleInterlock_ ) VULKAN_HPP_NOEXCEPT - { - fragmentShaderSampleInterlock = fragmentShaderSampleInterlock_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderInterlockFeaturesEXT & - setFragmentShaderPixelInterlock( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderPixelInterlock_ ) VULKAN_HPP_NOEXCEPT - { - fragmentShaderPixelInterlock = fragmentShaderPixelInterlock_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShaderInterlockFeaturesEXT & - setFragmentShaderShadingRateInterlock( VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderShadingRateInterlock_ ) VULKAN_HPP_NOEXCEPT - { - fragmentShaderShadingRateInterlock = fragmentShaderShadingRateInterlock_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentShaderSampleInterlock, fragmentShaderPixelInterlock, fragmentShaderShadingRateInterlock ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentShaderSampleInterlock == rhs.fragmentShaderSampleInterlock ) && - ( fragmentShaderPixelInterlock == rhs.fragmentShaderPixelInterlock ) && - ( fragmentShaderShadingRateInterlock == rhs.fragmentShaderShadingRateInterlock ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShaderInterlockFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShaderInterlockFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderSampleInterlock = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderPixelInterlock = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShaderShadingRateInterlock = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShaderInterlockFeaturesEXT; - }; - - struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV - { - using NativeType = VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateEnumsFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateEnums_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 supersampleFragmentShadingRates_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 noInvocationFragmentShadingRates_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentShadingRateEnums( fragmentShadingRateEnums_ ) - , supersampleFragmentShadingRates( supersampleFragmentShadingRates_ ) - , noInvocationFragmentShadingRates( noInvocationFragmentShadingRates_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShadingRateEnumsFeaturesNV( PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateEnumsFeaturesNV( VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShadingRateEnumsFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & operator=( PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & operator=( VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & - setFragmentShadingRateEnums( VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateEnums_ ) VULKAN_HPP_NOEXCEPT - { - fragmentShadingRateEnums = fragmentShadingRateEnums_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & - setSupersampleFragmentShadingRates( VULKAN_HPP_NAMESPACE::Bool32 supersampleFragmentShadingRates_ ) VULKAN_HPP_NOEXCEPT - { - supersampleFragmentShadingRates = supersampleFragmentShadingRates_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsFeaturesNV & - setNoInvocationFragmentShadingRates( VULKAN_HPP_NAMESPACE::Bool32 noInvocationFragmentShadingRates_ ) VULKAN_HPP_NOEXCEPT - { - noInvocationFragmentShadingRates = noInvocationFragmentShadingRates_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentShadingRateEnums, supersampleFragmentShadingRates, noInvocationFragmentShadingRates ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentShadingRateEnums == rhs.fragmentShadingRateEnums ) && - ( supersampleFragmentShadingRates == rhs.supersampleFragmentShadingRates ) && - ( noInvocationFragmentShadingRates == rhs.noInvocationFragmentShadingRates ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShadingRateEnumsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateEnums = {}; - VULKAN_HPP_NAMESPACE::Bool32 supersampleFragmentShadingRates = {}; - VULKAN_HPP_NAMESPACE::Bool32 noInvocationFragmentShadingRates = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShadingRateEnumsFeaturesNV; - }; - - struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV - { - using NativeType = VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateEnumsPropertiesNV( - VULKAN_HPP_NAMESPACE::SampleCountFlagBits maxFragmentShadingRateInvocationCount_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxFragmentShadingRateInvocationCount( maxFragmentShadingRateInvocationCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShadingRateEnumsPropertiesNV( PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateEnumsPropertiesNV( VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShadingRateEnumsPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShadingRateEnumsPropertiesNV & - operator=( PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateEnumsPropertiesNV & operator=( VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsPropertiesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateEnumsPropertiesNV & - setMaxFragmentShadingRateInvocationCount( VULKAN_HPP_NAMESPACE::SampleCountFlagBits maxFragmentShadingRateInvocationCount_ ) VULKAN_HPP_NOEXCEPT - { - maxFragmentShadingRateInvocationCount = maxFragmentShadingRateInvocationCount_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxFragmentShadingRateInvocationCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxFragmentShadingRateInvocationCount == rhs.maxFragmentShadingRateInvocationCount ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShadingRateEnumsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits maxFragmentShadingRateInvocationCount = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShadingRateEnumsPropertiesNV; - }; - - struct PhysicalDeviceFragmentShadingRateFeaturesKHR - { - using NativeType = VkPhysicalDeviceFragmentShadingRateFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShadingRateFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 pipelineFragmentShadingRate_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRate_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 attachmentFragmentShadingRate_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineFragmentShadingRate( pipelineFragmentShadingRate_ ) - , primitiveFragmentShadingRate( primitiveFragmentShadingRate_ ) - , attachmentFragmentShadingRate( attachmentFragmentShadingRate_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateFeaturesKHR( PhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateFeaturesKHR( VkPhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShadingRateFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShadingRateFeaturesKHR & operator=( PhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateFeaturesKHR & operator=( VkPhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateFeaturesKHR & - setPipelineFragmentShadingRate( VULKAN_HPP_NAMESPACE::Bool32 pipelineFragmentShadingRate_ ) VULKAN_HPP_NOEXCEPT - { - pipelineFragmentShadingRate = pipelineFragmentShadingRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateFeaturesKHR & - setPrimitiveFragmentShadingRate( VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRate_ ) VULKAN_HPP_NOEXCEPT - { - primitiveFragmentShadingRate = primitiveFragmentShadingRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceFragmentShadingRateFeaturesKHR & - setAttachmentFragmentShadingRate( VULKAN_HPP_NAMESPACE::Bool32 attachmentFragmentShadingRate_ ) VULKAN_HPP_NOEXCEPT - { - attachmentFragmentShadingRate = attachmentFragmentShadingRate_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceFragmentShadingRateFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShadingRateFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineFragmentShadingRate, primitiveFragmentShadingRate, attachmentFragmentShadingRate ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShadingRateFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineFragmentShadingRate == rhs.pipelineFragmentShadingRate ) && - ( primitiveFragmentShadingRate == rhs.primitiveFragmentShadingRate ) && ( attachmentFragmentShadingRate == rhs.attachmentFragmentShadingRate ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShadingRateFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShadingRateFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineFragmentShadingRate = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRate = {}; - VULKAN_HPP_NAMESPACE::Bool32 attachmentFragmentShadingRate = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShadingRateFeaturesKHR; - }; - - struct PhysicalDeviceFragmentShadingRateKHR - { - using NativeType = VkPhysicalDeviceFragmentShadingRateKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShadingRateKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateKHR( VULKAN_HPP_NAMESPACE::SampleCountFlags sampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D fragmentSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sampleCounts( sampleCounts_ ) - , fragmentSize( fragmentSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRateKHR( PhysicalDeviceFragmentShadingRateKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateKHR( VkPhysicalDeviceFragmentShadingRateKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShadingRateKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShadingRateKHR & operator=( PhysicalDeviceFragmentShadingRateKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRateKHR & operator=( VkPhysicalDeviceFragmentShadingRateKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentShadingRateKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShadingRateKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, sampleCounts, fragmentSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShadingRateKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShadingRateKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sampleCounts == rhs.sampleCounts ) && ( fragmentSize == rhs.fragmentSize ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShadingRateKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShadingRateKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampleCounts = {}; - VULKAN_HPP_NAMESPACE::Extent2D fragmentSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShadingRateKHR; - }; - - struct PhysicalDeviceFragmentShadingRatePropertiesKHR - { - using NativeType = VkPhysicalDeviceFragmentShadingRatePropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceFragmentShadingRatePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceFragmentShadingRatePropertiesKHR( - VULKAN_HPP_NAMESPACE::Extent2D minFragmentShadingRateAttachmentTexelSize_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentShadingRateAttachmentTexelSize_ = {}, - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRateWithMultipleViewports_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 layeredShadingRateAttachments_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateNonTrivialCombinerOps_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentSize_ = {}, - uint32_t maxFragmentSizeAspectRatio_ = {}, - uint32_t maxFragmentShadingRateCoverageSamples_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits maxFragmentShadingRateRasterizationSamples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithShaderDepthStencilWrites_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithSampleMask_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithShaderSampleMask_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithConservativeRasterization_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithFragmentShaderInterlock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithCustomSampleLocations_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateStrictMultiplyCombiner_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minFragmentShadingRateAttachmentTexelSize( minFragmentShadingRateAttachmentTexelSize_ ) - , maxFragmentShadingRateAttachmentTexelSize( maxFragmentShadingRateAttachmentTexelSize_ ) - , maxFragmentShadingRateAttachmentTexelSizeAspectRatio( maxFragmentShadingRateAttachmentTexelSizeAspectRatio_ ) - , primitiveFragmentShadingRateWithMultipleViewports( primitiveFragmentShadingRateWithMultipleViewports_ ) - , layeredShadingRateAttachments( layeredShadingRateAttachments_ ) - , fragmentShadingRateNonTrivialCombinerOps( fragmentShadingRateNonTrivialCombinerOps_ ) - , maxFragmentSize( maxFragmentSize_ ) - , maxFragmentSizeAspectRatio( maxFragmentSizeAspectRatio_ ) - , maxFragmentShadingRateCoverageSamples( maxFragmentShadingRateCoverageSamples_ ) - , maxFragmentShadingRateRasterizationSamples( maxFragmentShadingRateRasterizationSamples_ ) - , fragmentShadingRateWithShaderDepthStencilWrites( fragmentShadingRateWithShaderDepthStencilWrites_ ) - , fragmentShadingRateWithSampleMask( fragmentShadingRateWithSampleMask_ ) - , fragmentShadingRateWithShaderSampleMask( fragmentShadingRateWithShaderSampleMask_ ) - , fragmentShadingRateWithConservativeRasterization( fragmentShadingRateWithConservativeRasterization_ ) - , fragmentShadingRateWithFragmentShaderInterlock( fragmentShadingRateWithFragmentShaderInterlock_ ) - , fragmentShadingRateWithCustomSampleLocations( fragmentShadingRateWithCustomSampleLocations_ ) - , fragmentShadingRateStrictMultiplyCombiner( fragmentShadingRateStrictMultiplyCombiner_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceFragmentShadingRatePropertiesKHR( PhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRatePropertiesKHR( VkPhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceFragmentShadingRatePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceFragmentShadingRatePropertiesKHR & operator=( PhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceFragmentShadingRatePropertiesKHR & operator=( VkPhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceFragmentShadingRatePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceFragmentShadingRatePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - minFragmentShadingRateAttachmentTexelSize, - maxFragmentShadingRateAttachmentTexelSize, - maxFragmentShadingRateAttachmentTexelSizeAspectRatio, - primitiveFragmentShadingRateWithMultipleViewports, - layeredShadingRateAttachments, - fragmentShadingRateNonTrivialCombinerOps, - maxFragmentSize, - maxFragmentSizeAspectRatio, - maxFragmentShadingRateCoverageSamples, - maxFragmentShadingRateRasterizationSamples, - fragmentShadingRateWithShaderDepthStencilWrites, - fragmentShadingRateWithSampleMask, - fragmentShadingRateWithShaderSampleMask, - fragmentShadingRateWithConservativeRasterization, - fragmentShadingRateWithFragmentShaderInterlock, - fragmentShadingRateWithCustomSampleLocations, - fragmentShadingRateStrictMultiplyCombiner ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceFragmentShadingRatePropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && - ( minFragmentShadingRateAttachmentTexelSize == rhs.minFragmentShadingRateAttachmentTexelSize ) && - ( maxFragmentShadingRateAttachmentTexelSize == rhs.maxFragmentShadingRateAttachmentTexelSize ) && - ( maxFragmentShadingRateAttachmentTexelSizeAspectRatio == rhs.maxFragmentShadingRateAttachmentTexelSizeAspectRatio ) && - ( primitiveFragmentShadingRateWithMultipleViewports == rhs.primitiveFragmentShadingRateWithMultipleViewports ) && - ( layeredShadingRateAttachments == rhs.layeredShadingRateAttachments ) && - ( fragmentShadingRateNonTrivialCombinerOps == rhs.fragmentShadingRateNonTrivialCombinerOps ) && ( maxFragmentSize == rhs.maxFragmentSize ) && - ( maxFragmentSizeAspectRatio == rhs.maxFragmentSizeAspectRatio ) && - ( maxFragmentShadingRateCoverageSamples == rhs.maxFragmentShadingRateCoverageSamples ) && - ( maxFragmentShadingRateRasterizationSamples == rhs.maxFragmentShadingRateRasterizationSamples ) && - ( fragmentShadingRateWithShaderDepthStencilWrites == rhs.fragmentShadingRateWithShaderDepthStencilWrites ) && - ( fragmentShadingRateWithSampleMask == rhs.fragmentShadingRateWithSampleMask ) && - ( fragmentShadingRateWithShaderSampleMask == rhs.fragmentShadingRateWithShaderSampleMask ) && - ( fragmentShadingRateWithConservativeRasterization == rhs.fragmentShadingRateWithConservativeRasterization ) && - ( fragmentShadingRateWithFragmentShaderInterlock == rhs.fragmentShadingRateWithFragmentShaderInterlock ) && - ( fragmentShadingRateWithCustomSampleLocations == rhs.fragmentShadingRateWithCustomSampleLocations ) && - ( fragmentShadingRateStrictMultiplyCombiner == rhs.fragmentShadingRateStrictMultiplyCombiner ); -# endif - } - - bool operator!=( PhysicalDeviceFragmentShadingRatePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceFragmentShadingRatePropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D minFragmentShadingRateAttachmentTexelSize = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentShadingRateAttachmentTexelSize = {}; - uint32_t maxFragmentShadingRateAttachmentTexelSizeAspectRatio = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRateWithMultipleViewports = {}; - VULKAN_HPP_NAMESPACE::Bool32 layeredShadingRateAttachments = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateNonTrivialCombinerOps = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxFragmentSize = {}; - uint32_t maxFragmentSizeAspectRatio = {}; - uint32_t maxFragmentShadingRateCoverageSamples = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits maxFragmentShadingRateRasterizationSamples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithShaderDepthStencilWrites = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithSampleMask = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithShaderSampleMask = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithConservativeRasterization = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithFragmentShaderInterlock = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateWithCustomSampleLocations = {}; - VULKAN_HPP_NAMESPACE::Bool32 fragmentShadingRateStrictMultiplyCombiner = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceFragmentShadingRatePropertiesKHR; - }; - - struct PhysicalDeviceGlobalPriorityQueryFeaturesKHR - { - using NativeType = VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceGlobalPriorityQueryFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceGlobalPriorityQueryFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 globalPriorityQuery_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , globalPriorityQuery( globalPriorityQuery_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceGlobalPriorityQueryFeaturesKHR( PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGlobalPriorityQueryFeaturesKHR( VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceGlobalPriorityQueryFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceGlobalPriorityQueryFeaturesKHR & operator=( PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGlobalPriorityQueryFeaturesKHR & operator=( VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGlobalPriorityQueryFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGlobalPriorityQueryFeaturesKHR & - setGlobalPriorityQuery( VULKAN_HPP_NAMESPACE::Bool32 globalPriorityQuery_ ) VULKAN_HPP_NOEXCEPT - { - globalPriorityQuery = globalPriorityQuery_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, globalPriorityQuery ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( globalPriorityQuery == rhs.globalPriorityQuery ); -# endif - } - - bool operator!=( PhysicalDeviceGlobalPriorityQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceGlobalPriorityQueryFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 globalPriorityQuery = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceGlobalPriorityQueryFeaturesKHR; - }; - using PhysicalDeviceGlobalPriorityQueryFeaturesEXT = PhysicalDeviceGlobalPriorityQueryFeaturesKHR; - - struct PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT - { - using NativeType = VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibrary_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , graphicsPipelineLibrary( graphicsPipelineLibrary_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT( PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT( VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT & operator=( PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT & operator=( VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT & - setGraphicsPipelineLibrary( VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibrary_ ) VULKAN_HPP_NOEXCEPT - { - graphicsPipelineLibrary = graphicsPipelineLibrary_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, graphicsPipelineLibrary ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( graphicsPipelineLibrary == rhs.graphicsPipelineLibrary ); -# endif - } - - bool operator!=( PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibrary = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT; - }; - - struct PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT - { - using NativeType = VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT( VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryFastLinking_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryIndependentInterpolationDecoration_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , graphicsPipelineLibraryFastLinking( graphicsPipelineLibraryFastLinking_ ) - , graphicsPipelineLibraryIndependentInterpolationDecoration( graphicsPipelineLibraryIndependentInterpolationDecoration_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT( PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT( VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & - operator=( PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & operator=( VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & - setGraphicsPipelineLibraryFastLinking( VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryFastLinking_ ) VULKAN_HPP_NOEXCEPT - { - graphicsPipelineLibraryFastLinking = graphicsPipelineLibraryFastLinking_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT & setGraphicsPipelineLibraryIndependentInterpolationDecoration( - VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryIndependentInterpolationDecoration_ ) VULKAN_HPP_NOEXCEPT - { - graphicsPipelineLibraryIndependentInterpolationDecoration = graphicsPipelineLibraryIndependentInterpolationDecoration_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, graphicsPipelineLibraryFastLinking, graphicsPipelineLibraryIndependentInterpolationDecoration ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( graphicsPipelineLibraryFastLinking == rhs.graphicsPipelineLibraryFastLinking ) && - ( graphicsPipelineLibraryIndependentInterpolationDecoration == rhs.graphicsPipelineLibraryIndependentInterpolationDecoration ); -# endif - } - - bool operator!=( PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryFastLinking = {}; - VULKAN_HPP_NAMESPACE::Bool32 graphicsPipelineLibraryIndependentInterpolationDecoration = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT; - }; - - struct PhysicalDeviceGroupProperties - { - using NativeType = VkPhysicalDeviceGroupProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceGroupProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PhysicalDeviceGroupProperties( uint32_t physicalDeviceCount_ = {}, - std::array const & physicalDevices_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 subsetAllocation_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , physicalDeviceCount( physicalDeviceCount_ ) - , physicalDevices( physicalDevices_ ) - , subsetAllocation( subsetAllocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceGroupProperties( PhysicalDeviceGroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGroupProperties( VkPhysicalDeviceGroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceGroupProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceGroupProperties & operator=( PhysicalDeviceGroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceGroupProperties & operator=( VkPhysicalDeviceGroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceGroupProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceGroupProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::Bool32 const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, physicalDeviceCount, physicalDevices, subsetAllocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceGroupProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceGroupProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( physicalDeviceCount == rhs.physicalDeviceCount ) && - ( physicalDevices == rhs.physicalDevices ) && ( subsetAllocation == rhs.subsetAllocation ); -# endif - } - - bool operator!=( PhysicalDeviceGroupProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceGroupProperties; - void * pNext = {}; - uint32_t physicalDeviceCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D physicalDevices = {}; - VULKAN_HPP_NAMESPACE::Bool32 subsetAllocation = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceGroupProperties; - }; - using PhysicalDeviceGroupPropertiesKHR = PhysicalDeviceGroupProperties; - - struct PhysicalDeviceHostQueryResetFeatures - { - using NativeType = VkPhysicalDeviceHostQueryResetFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceHostQueryResetFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceHostQueryResetFeatures( VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , hostQueryReset( hostQueryReset_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceHostQueryResetFeatures( PhysicalDeviceHostQueryResetFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceHostQueryResetFeatures( VkPhysicalDeviceHostQueryResetFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceHostQueryResetFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceHostQueryResetFeatures & operator=( PhysicalDeviceHostQueryResetFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceHostQueryResetFeatures & operator=( VkPhysicalDeviceHostQueryResetFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceHostQueryResetFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceHostQueryResetFeatures & setHostQueryReset( VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset_ ) VULKAN_HPP_NOEXCEPT - { - hostQueryReset = hostQueryReset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceHostQueryResetFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceHostQueryResetFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, hostQueryReset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceHostQueryResetFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceHostQueryResetFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( hostQueryReset == rhs.hostQueryReset ); -# endif - } - - bool operator!=( PhysicalDeviceHostQueryResetFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceHostQueryResetFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceHostQueryResetFeatures; - }; - using PhysicalDeviceHostQueryResetFeaturesEXT = PhysicalDeviceHostQueryResetFeatures; - - struct PhysicalDeviceIDProperties - { - using NativeType = VkPhysicalDeviceIDProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceIdProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceIDProperties( std::array const & deviceUUID_ = {}, - std::array const & driverUUID_ = {}, - std::array const & deviceLUID_ = {}, - uint32_t deviceNodeMask_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 deviceLUIDValid_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceUUID( deviceUUID_ ) - , driverUUID( driverUUID_ ) - , deviceLUID( deviceLUID_ ) - , deviceNodeMask( deviceNodeMask_ ) - , deviceLUIDValid( deviceLUIDValid_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceIDProperties( PhysicalDeviceIDProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceIDProperties( VkPhysicalDeviceIDProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceIDProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceIDProperties & operator=( PhysicalDeviceIDProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceIDProperties & operator=( VkPhysicalDeviceIDProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceIDProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceIDProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, deviceUUID, driverUUID, deviceLUID, deviceNodeMask, deviceLUIDValid ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceIDProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceIDProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceUUID == rhs.deviceUUID ) && ( driverUUID == rhs.driverUUID ) && - ( deviceLUID == rhs.deviceLUID ) && ( deviceNodeMask == rhs.deviceNodeMask ) && ( deviceLUIDValid == rhs.deviceLUIDValid ); -# endif - } - - bool operator!=( PhysicalDeviceIDProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceIdProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D deviceUUID = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverUUID = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D deviceLUID = {}; - uint32_t deviceNodeMask = {}; - VULKAN_HPP_NAMESPACE::Bool32 deviceLUIDValid = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceIDProperties; - }; - using PhysicalDeviceIDPropertiesKHR = PhysicalDeviceIDProperties; - - struct PhysicalDeviceImage2DViewOf3DFeaturesEXT - { - using NativeType = VkPhysicalDeviceImage2DViewOf3DFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImage2DViewOf3DFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImage2DViewOf3DFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 image2DViewOf3D_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sampler2DViewOf3D_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , image2DViewOf3D( image2DViewOf3D_ ) - , sampler2DViewOf3D( sampler2DViewOf3D_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImage2DViewOf3DFeaturesEXT( PhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImage2DViewOf3DFeaturesEXT( VkPhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImage2DViewOf3DFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImage2DViewOf3DFeaturesEXT & operator=( PhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImage2DViewOf3DFeaturesEXT & operator=( VkPhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImage2DViewOf3DFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImage2DViewOf3DFeaturesEXT & setImage2DViewOf3D( VULKAN_HPP_NAMESPACE::Bool32 image2DViewOf3D_ ) VULKAN_HPP_NOEXCEPT - { - image2DViewOf3D = image2DViewOf3D_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImage2DViewOf3DFeaturesEXT & - setSampler2DViewOf3D( VULKAN_HPP_NAMESPACE::Bool32 sampler2DViewOf3D_ ) VULKAN_HPP_NOEXCEPT - { - sampler2DViewOf3D = sampler2DViewOf3D_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImage2DViewOf3DFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImage2DViewOf3DFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, image2DViewOf3D, sampler2DViewOf3D ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImage2DViewOf3DFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( image2DViewOf3D == rhs.image2DViewOf3D ) && ( sampler2DViewOf3D == rhs.sampler2DViewOf3D ); -# endif - } - - bool operator!=( PhysicalDeviceImage2DViewOf3DFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImage2DViewOf3DFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 image2DViewOf3D = {}; - VULKAN_HPP_NAMESPACE::Bool32 sampler2DViewOf3D = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImage2DViewOf3DFeaturesEXT; - }; - - struct PhysicalDeviceImageCompressionControlFeaturesEXT - { - using NativeType = VkPhysicalDeviceImageCompressionControlFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageCompressionControlFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageCompressionControlFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControl_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageCompressionControl( imageCompressionControl_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceImageCompressionControlFeaturesEXT( PhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageCompressionControlFeaturesEXT( VkPhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageCompressionControlFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageCompressionControlFeaturesEXT & operator=( PhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageCompressionControlFeaturesEXT & operator=( VkPhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageCompressionControlFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageCompressionControlFeaturesEXT & - setImageCompressionControl( VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControl_ ) VULKAN_HPP_NOEXCEPT - { - imageCompressionControl = imageCompressionControl_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageCompressionControlFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageCompressionControlFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageCompressionControl ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageCompressionControlFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageCompressionControl == rhs.imageCompressionControl ); -# endif - } - - bool operator!=( PhysicalDeviceImageCompressionControlFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageCompressionControlFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControl = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageCompressionControlFeaturesEXT; - }; - - struct PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT - { - using NativeType = VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControlSwapchain_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageCompressionControlSwapchain( imageCompressionControlSwapchain_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT( PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT( VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT( - *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT & - operator=( PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT & - operator=( VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT & - setImageCompressionControlSwapchain( VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControlSwapchain_ ) VULKAN_HPP_NOEXCEPT - { - imageCompressionControlSwapchain = imageCompressionControlSwapchain_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageCompressionControlSwapchain ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageCompressionControlSwapchain == rhs.imageCompressionControlSwapchain ); -# endif - } - - bool operator!=( PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageCompressionControlSwapchain = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT; - }; - - struct PhysicalDeviceImageDrmFormatModifierInfoEXT - { - using NativeType = VkPhysicalDeviceImageDrmFormatModifierInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageDrmFormatModifierInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceImageDrmFormatModifierInfoEXT( uint64_t drmFormatModifier_ = {}, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive, - uint32_t queueFamilyIndexCount_ = {}, - const uint32_t * pQueueFamilyIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , drmFormatModifier( drmFormatModifier_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageDrmFormatModifierInfoEXT( PhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageDrmFormatModifierInfoEXT( VkPhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageDrmFormatModifierInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PhysicalDeviceImageDrmFormatModifierInfoEXT( uint64_t drmFormatModifier_, - VULKAN_HPP_NAMESPACE::SharingMode sharingMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , drmFormatModifier( drmFormatModifier_ ) - , sharingMode( sharingMode_ ) - , queueFamilyIndexCount( static_cast( queueFamilyIndices_.size() ) ) - , pQueueFamilyIndices( queueFamilyIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageDrmFormatModifierInfoEXT & operator=( PhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageDrmFormatModifierInfoEXT & operator=( VkPhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageDrmFormatModifierInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageDrmFormatModifierInfoEXT & setDrmFormatModifier( uint64_t drmFormatModifier_ ) VULKAN_HPP_NOEXCEPT - { - drmFormatModifier = drmFormatModifier_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageDrmFormatModifierInfoEXT & setSharingMode( VULKAN_HPP_NAMESPACE::SharingMode sharingMode_ ) VULKAN_HPP_NOEXCEPT - { - sharingMode = sharingMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageDrmFormatModifierInfoEXT & setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageDrmFormatModifierInfoEXT & setPQueueFamilyIndices( const uint32_t * pQueueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PhysicalDeviceImageDrmFormatModifierInfoEXT & - setQueueFamilyIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = static_cast( queueFamilyIndices_.size() ); - pQueueFamilyIndices = queueFamilyIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageDrmFormatModifierInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageDrmFormatModifierInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, drmFormatModifier, sharingMode, queueFamilyIndexCount, pQueueFamilyIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageDrmFormatModifierInfoEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( drmFormatModifier == rhs.drmFormatModifier ) && ( sharingMode == rhs.sharingMode ) && - ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) && ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ); -# endif - } - - bool operator!=( PhysicalDeviceImageDrmFormatModifierInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageDrmFormatModifierInfoEXT; - const void * pNext = {}; - uint64_t drmFormatModifier = {}; - VULKAN_HPP_NAMESPACE::SharingMode sharingMode = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive; - uint32_t queueFamilyIndexCount = {}; - const uint32_t * pQueueFamilyIndices = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageDrmFormatModifierInfoEXT; - }; - - struct PhysicalDeviceImageFormatInfo2 - { - using NativeType = VkPhysicalDeviceImageFormatInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageFormatInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageFormatInfo2( VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ImageType type_ = VULKAN_HPP_NAMESPACE::ImageType::e1D, - VULKAN_HPP_NAMESPACE::ImageTiling tiling_ = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ = {}, - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , type( type_ ) - , tiling( tiling_ ) - , usage( usage_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageFormatInfo2( PhysicalDeviceImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageFormatInfo2( VkPhysicalDeviceImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageFormatInfo2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageFormatInfo2 & operator=( PhysicalDeviceImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageFormatInfo2 & operator=( VkPhysicalDeviceImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setType( VULKAN_HPP_NAMESPACE::ImageType type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setTiling( VULKAN_HPP_NAMESPACE::ImageTiling tiling_ ) VULKAN_HPP_NOEXCEPT - { - tiling = tiling_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageFormatInfo2 & setFlags( VULKAN_HPP_NAMESPACE::ImageCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageFormatInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageFormatInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, format, type, tiling, usage, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageFormatInfo2 const & ) const = default; -#else - bool operator==( PhysicalDeviceImageFormatInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( type == rhs.type ) && ( tiling == rhs.tiling ) && - ( usage == rhs.usage ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( PhysicalDeviceImageFormatInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageFormatInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ImageType type = VULKAN_HPP_NAMESPACE::ImageType::e1D; - VULKAN_HPP_NAMESPACE::ImageTiling tiling = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal; - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage = {}; - VULKAN_HPP_NAMESPACE::ImageCreateFlags flags = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageFormatInfo2; - }; - using PhysicalDeviceImageFormatInfo2KHR = PhysicalDeviceImageFormatInfo2; - - struct PhysicalDeviceImageProcessingFeaturesQCOM - { - using NativeType = VkPhysicalDeviceImageProcessingFeaturesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageProcessingFeaturesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessingFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 textureSampleWeighted_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureBoxFilter_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , textureSampleWeighted( textureSampleWeighted_ ) - , textureBoxFilter( textureBoxFilter_ ) - , textureBlockMatch( textureBlockMatch_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessingFeaturesQCOM( PhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageProcessingFeaturesQCOM( VkPhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageProcessingFeaturesQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageProcessingFeaturesQCOM & operator=( PhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageProcessingFeaturesQCOM & operator=( VkPhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessingFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessingFeaturesQCOM & - setTextureSampleWeighted( VULKAN_HPP_NAMESPACE::Bool32 textureSampleWeighted_ ) VULKAN_HPP_NOEXCEPT - { - textureSampleWeighted = textureSampleWeighted_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessingFeaturesQCOM & - setTextureBoxFilter( VULKAN_HPP_NAMESPACE::Bool32 textureBoxFilter_ ) VULKAN_HPP_NOEXCEPT - { - textureBoxFilter = textureBoxFilter_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageProcessingFeaturesQCOM & - setTextureBlockMatch( VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch_ ) VULKAN_HPP_NOEXCEPT - { - textureBlockMatch = textureBlockMatch_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageProcessingFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageProcessingFeaturesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, textureSampleWeighted, textureBoxFilter, textureBlockMatch ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageProcessingFeaturesQCOM const & ) const = default; -#else - bool operator==( PhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( textureSampleWeighted == rhs.textureSampleWeighted ) && - ( textureBoxFilter == rhs.textureBoxFilter ) && ( textureBlockMatch == rhs.textureBlockMatch ); -# endif - } - - bool operator!=( PhysicalDeviceImageProcessingFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageProcessingFeaturesQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureSampleWeighted = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureBoxFilter = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureBlockMatch = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageProcessingFeaturesQCOM; - }; - - struct PhysicalDeviceImageProcessingPropertiesQCOM - { - using NativeType = VkPhysicalDeviceImageProcessingPropertiesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageProcessingPropertiesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessingPropertiesQCOM( uint32_t maxWeightFilterPhases_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxWeightFilterDimension_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxBlockMatchRegion_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxBoxFilterBlockSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxWeightFilterPhases( maxWeightFilterPhases_ ) - , maxWeightFilterDimension( maxWeightFilterDimension_ ) - , maxBlockMatchRegion( maxBlockMatchRegion_ ) - , maxBoxFilterBlockSize( maxBoxFilterBlockSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageProcessingPropertiesQCOM( PhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageProcessingPropertiesQCOM( VkPhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageProcessingPropertiesQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageProcessingPropertiesQCOM & operator=( PhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageProcessingPropertiesQCOM & operator=( VkPhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceImageProcessingPropertiesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageProcessingPropertiesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxWeightFilterPhases, maxWeightFilterDimension, maxBlockMatchRegion, maxBoxFilterBlockSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageProcessingPropertiesQCOM const & ) const = default; -#else - bool operator==( PhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxWeightFilterPhases == rhs.maxWeightFilterPhases ) && - ( maxWeightFilterDimension == rhs.maxWeightFilterDimension ) && ( maxBlockMatchRegion == rhs.maxBlockMatchRegion ) && - ( maxBoxFilterBlockSize == rhs.maxBoxFilterBlockSize ); -# endif - } - - bool operator!=( PhysicalDeviceImageProcessingPropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageProcessingPropertiesQCOM; - void * pNext = {}; - uint32_t maxWeightFilterPhases = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxWeightFilterDimension = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxBlockMatchRegion = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxBoxFilterBlockSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageProcessingPropertiesQCOM; - }; - - struct PhysicalDeviceImageRobustnessFeatures - { - using NativeType = VkPhysicalDeviceImageRobustnessFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageRobustnessFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageRobustnessFeatures( VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , robustImageAccess( robustImageAccess_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageRobustnessFeatures( PhysicalDeviceImageRobustnessFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageRobustnessFeatures( VkPhysicalDeviceImageRobustnessFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageRobustnessFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageRobustnessFeatures & operator=( PhysicalDeviceImageRobustnessFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageRobustnessFeatures & operator=( VkPhysicalDeviceImageRobustnessFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageRobustnessFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageRobustnessFeatures & setRobustImageAccess( VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess_ ) VULKAN_HPP_NOEXCEPT - { - robustImageAccess = robustImageAccess_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageRobustnessFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageRobustnessFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, robustImageAccess ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageRobustnessFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceImageRobustnessFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( robustImageAccess == rhs.robustImageAccess ); -# endif - } - - bool operator!=( PhysicalDeviceImageRobustnessFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageRobustnessFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageRobustnessFeatures; - }; - using PhysicalDeviceImageRobustnessFeaturesEXT = PhysicalDeviceImageRobustnessFeatures; - - struct PhysicalDeviceImageViewImageFormatInfoEXT - { - using NativeType = VkPhysicalDeviceImageViewImageFormatInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageViewImageFormatInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceImageViewImageFormatInfoEXT( VULKAN_HPP_NAMESPACE::ImageViewType imageViewType_ = VULKAN_HPP_NAMESPACE::ImageViewType::e1D, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageViewType( imageViewType_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageViewImageFormatInfoEXT( PhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageViewImageFormatInfoEXT( VkPhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageViewImageFormatInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageViewImageFormatInfoEXT & operator=( PhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageViewImageFormatInfoEXT & operator=( VkPhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageViewImageFormatInfoEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageViewImageFormatInfoEXT & - setImageViewType( VULKAN_HPP_NAMESPACE::ImageViewType imageViewType_ ) VULKAN_HPP_NOEXCEPT - { - imageViewType = imageViewType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageViewImageFormatInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageViewImageFormatInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageViewType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageViewImageFormatInfoEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageViewType == rhs.imageViewType ); -# endif - } - - bool operator!=( PhysicalDeviceImageViewImageFormatInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageViewImageFormatInfoEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageViewType imageViewType = VULKAN_HPP_NAMESPACE::ImageViewType::e1D; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageViewImageFormatInfoEXT; - }; - - struct PhysicalDeviceImageViewMinLodFeaturesEXT - { - using NativeType = VkPhysicalDeviceImageViewMinLodFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImageViewMinLodFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageViewMinLodFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 minLod_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minLod( minLod_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImageViewMinLodFeaturesEXT( PhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageViewMinLodFeaturesEXT( VkPhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImageViewMinLodFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImageViewMinLodFeaturesEXT & operator=( PhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImageViewMinLodFeaturesEXT & operator=( VkPhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageViewMinLodFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImageViewMinLodFeaturesEXT & setMinLod( VULKAN_HPP_NAMESPACE::Bool32 minLod_ ) VULKAN_HPP_NOEXCEPT - { - minLod = minLod_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImageViewMinLodFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImageViewMinLodFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minLod ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImageViewMinLodFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minLod == rhs.minLod ); -# endif - } - - bool operator!=( PhysicalDeviceImageViewMinLodFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImageViewMinLodFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 minLod = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImageViewMinLodFeaturesEXT; - }; - - struct PhysicalDeviceImagelessFramebufferFeatures - { - using NativeType = VkPhysicalDeviceImagelessFramebufferFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceImagelessFramebufferFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceImagelessFramebufferFeatures( VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imagelessFramebuffer( imagelessFramebuffer_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceImagelessFramebufferFeatures( PhysicalDeviceImagelessFramebufferFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImagelessFramebufferFeatures( VkPhysicalDeviceImagelessFramebufferFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceImagelessFramebufferFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceImagelessFramebufferFeatures & operator=( PhysicalDeviceImagelessFramebufferFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceImagelessFramebufferFeatures & operator=( VkPhysicalDeviceImagelessFramebufferFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImagelessFramebufferFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceImagelessFramebufferFeatures & - setImagelessFramebuffer( VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer_ ) VULKAN_HPP_NOEXCEPT - { - imagelessFramebuffer = imagelessFramebuffer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceImagelessFramebufferFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceImagelessFramebufferFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imagelessFramebuffer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceImagelessFramebufferFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceImagelessFramebufferFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imagelessFramebuffer == rhs.imagelessFramebuffer ); -# endif - } - - bool operator!=( PhysicalDeviceImagelessFramebufferFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceImagelessFramebufferFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceImagelessFramebufferFeatures; - }; - using PhysicalDeviceImagelessFramebufferFeaturesKHR = PhysicalDeviceImagelessFramebufferFeatures; - - struct PhysicalDeviceIndexTypeUint8FeaturesEXT - { - using NativeType = VkPhysicalDeviceIndexTypeUint8FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceIndexTypeUint8FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceIndexTypeUint8FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 indexTypeUint8_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , indexTypeUint8( indexTypeUint8_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceIndexTypeUint8FeaturesEXT( PhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceIndexTypeUint8FeaturesEXT( VkPhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceIndexTypeUint8FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceIndexTypeUint8FeaturesEXT & operator=( PhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceIndexTypeUint8FeaturesEXT & operator=( VkPhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceIndexTypeUint8FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceIndexTypeUint8FeaturesEXT & setIndexTypeUint8( VULKAN_HPP_NAMESPACE::Bool32 indexTypeUint8_ ) VULKAN_HPP_NOEXCEPT - { - indexTypeUint8 = indexTypeUint8_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceIndexTypeUint8FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceIndexTypeUint8FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, indexTypeUint8 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceIndexTypeUint8FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( indexTypeUint8 == rhs.indexTypeUint8 ); -# endif - } - - bool operator!=( PhysicalDeviceIndexTypeUint8FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceIndexTypeUint8FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 indexTypeUint8 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceIndexTypeUint8FeaturesEXT; - }; - - struct PhysicalDeviceInheritedViewportScissorFeaturesNV - { - using NativeType = VkPhysicalDeviceInheritedViewportScissorFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceInheritedViewportScissorFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceInheritedViewportScissorFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 inheritedViewportScissor2D_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , inheritedViewportScissor2D( inheritedViewportScissor2D_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceInheritedViewportScissorFeaturesNV( PhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInheritedViewportScissorFeaturesNV( VkPhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceInheritedViewportScissorFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceInheritedViewportScissorFeaturesNV & operator=( PhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInheritedViewportScissorFeaturesNV & operator=( VkPhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInheritedViewportScissorFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInheritedViewportScissorFeaturesNV & - setInheritedViewportScissor2D( VULKAN_HPP_NAMESPACE::Bool32 inheritedViewportScissor2D_ ) VULKAN_HPP_NOEXCEPT - { - inheritedViewportScissor2D = inheritedViewportScissor2D_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceInheritedViewportScissorFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceInheritedViewportScissorFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, inheritedViewportScissor2D ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceInheritedViewportScissorFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( inheritedViewportScissor2D == rhs.inheritedViewportScissor2D ); -# endif - } - - bool operator!=( PhysicalDeviceInheritedViewportScissorFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceInheritedViewportScissorFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 inheritedViewportScissor2D = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceInheritedViewportScissorFeaturesNV; - }; - - struct PhysicalDeviceInlineUniformBlockFeatures - { - using NativeType = VkPhysicalDeviceInlineUniformBlockFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceInlineUniformBlockFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceInlineUniformBlockFeatures( VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , inlineUniformBlock( inlineUniformBlock_ ) - , descriptorBindingInlineUniformBlockUpdateAfterBind( descriptorBindingInlineUniformBlockUpdateAfterBind_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceInlineUniformBlockFeatures( PhysicalDeviceInlineUniformBlockFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInlineUniformBlockFeatures( VkPhysicalDeviceInlineUniformBlockFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceInlineUniformBlockFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceInlineUniformBlockFeatures & operator=( PhysicalDeviceInlineUniformBlockFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInlineUniformBlockFeatures & operator=( VkPhysicalDeviceInlineUniformBlockFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInlineUniformBlockFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInlineUniformBlockFeatures & - setInlineUniformBlock( VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock_ ) VULKAN_HPP_NOEXCEPT - { - inlineUniformBlock = inlineUniformBlock_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInlineUniformBlockFeatures & setDescriptorBindingInlineUniformBlockUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingInlineUniformBlockUpdateAfterBind = descriptorBindingInlineUniformBlockUpdateAfterBind_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceInlineUniformBlockFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceInlineUniformBlockFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, inlineUniformBlock, descriptorBindingInlineUniformBlockUpdateAfterBind ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceInlineUniformBlockFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceInlineUniformBlockFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( inlineUniformBlock == rhs.inlineUniformBlock ) && - ( descriptorBindingInlineUniformBlockUpdateAfterBind == rhs.descriptorBindingInlineUniformBlockUpdateAfterBind ); -# endif - } - - bool operator!=( PhysicalDeviceInlineUniformBlockFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceInlineUniformBlockFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceInlineUniformBlockFeatures; - }; - using PhysicalDeviceInlineUniformBlockFeaturesEXT = PhysicalDeviceInlineUniformBlockFeatures; - - struct PhysicalDeviceInlineUniformBlockProperties - { - using NativeType = VkPhysicalDeviceInlineUniformBlockProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceInlineUniformBlockProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceInlineUniformBlockProperties( uint32_t maxInlineUniformBlockSize_ = {}, - uint32_t maxPerStageDescriptorInlineUniformBlocks_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks_ = {}, - uint32_t maxDescriptorSetInlineUniformBlocks_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxInlineUniformBlockSize( maxInlineUniformBlockSize_ ) - , maxPerStageDescriptorInlineUniformBlocks( maxPerStageDescriptorInlineUniformBlocks_ ) - , maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks( maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks_ ) - , maxDescriptorSetInlineUniformBlocks( maxDescriptorSetInlineUniformBlocks_ ) - , maxDescriptorSetUpdateAfterBindInlineUniformBlocks( maxDescriptorSetUpdateAfterBindInlineUniformBlocks_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceInlineUniformBlockProperties( PhysicalDeviceInlineUniformBlockProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInlineUniformBlockProperties( VkPhysicalDeviceInlineUniformBlockProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceInlineUniformBlockProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceInlineUniformBlockProperties & operator=( PhysicalDeviceInlineUniformBlockProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInlineUniformBlockProperties & operator=( VkPhysicalDeviceInlineUniformBlockProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceInlineUniformBlockProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceInlineUniformBlockProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxInlineUniformBlockSize, - maxPerStageDescriptorInlineUniformBlocks, - maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, - maxDescriptorSetInlineUniformBlocks, - maxDescriptorSetUpdateAfterBindInlineUniformBlocks ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceInlineUniformBlockProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceInlineUniformBlockProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxInlineUniformBlockSize == rhs.maxInlineUniformBlockSize ) && - ( maxPerStageDescriptorInlineUniformBlocks == rhs.maxPerStageDescriptorInlineUniformBlocks ) && - ( maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks == rhs.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ) && - ( maxDescriptorSetInlineUniformBlocks == rhs.maxDescriptorSetInlineUniformBlocks ) && - ( maxDescriptorSetUpdateAfterBindInlineUniformBlocks == rhs.maxDescriptorSetUpdateAfterBindInlineUniformBlocks ); -# endif - } - - bool operator!=( PhysicalDeviceInlineUniformBlockProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceInlineUniformBlockProperties; - void * pNext = {}; - uint32_t maxInlineUniformBlockSize = {}; - uint32_t maxPerStageDescriptorInlineUniformBlocks = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = {}; - uint32_t maxDescriptorSetInlineUniformBlocks = {}; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceInlineUniformBlockProperties; - }; - using PhysicalDeviceInlineUniformBlockPropertiesEXT = PhysicalDeviceInlineUniformBlockProperties; - - struct PhysicalDeviceInvocationMaskFeaturesHUAWEI - { - using NativeType = VkPhysicalDeviceInvocationMaskFeaturesHUAWEI; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceInvocationMaskFeaturesHUAWEI; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceInvocationMaskFeaturesHUAWEI( VULKAN_HPP_NAMESPACE::Bool32 invocationMask_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , invocationMask( invocationMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceInvocationMaskFeaturesHUAWEI( PhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInvocationMaskFeaturesHUAWEI( VkPhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceInvocationMaskFeaturesHUAWEI( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceInvocationMaskFeaturesHUAWEI & operator=( PhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceInvocationMaskFeaturesHUAWEI & operator=( VkPhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInvocationMaskFeaturesHUAWEI & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceInvocationMaskFeaturesHUAWEI & setInvocationMask( VULKAN_HPP_NAMESPACE::Bool32 invocationMask_ ) VULKAN_HPP_NOEXCEPT - { - invocationMask = invocationMask_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceInvocationMaskFeaturesHUAWEI const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceInvocationMaskFeaturesHUAWEI &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, invocationMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceInvocationMaskFeaturesHUAWEI const & ) const = default; -#else - bool operator==( PhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( invocationMask == rhs.invocationMask ); -# endif - } - - bool operator!=( PhysicalDeviceInvocationMaskFeaturesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceInvocationMaskFeaturesHUAWEI; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 invocationMask = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceInvocationMaskFeaturesHUAWEI; - }; - - struct PhysicalDeviceLegacyDitheringFeaturesEXT - { - using NativeType = VkPhysicalDeviceLegacyDitheringFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceLegacyDitheringFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceLegacyDitheringFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 legacyDithering_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , legacyDithering( legacyDithering_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceLegacyDitheringFeaturesEXT( PhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLegacyDitheringFeaturesEXT( VkPhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceLegacyDitheringFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceLegacyDitheringFeaturesEXT & operator=( PhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLegacyDitheringFeaturesEXT & operator=( VkPhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLegacyDitheringFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLegacyDitheringFeaturesEXT & setLegacyDithering( VULKAN_HPP_NAMESPACE::Bool32 legacyDithering_ ) VULKAN_HPP_NOEXCEPT - { - legacyDithering = legacyDithering_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceLegacyDitheringFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceLegacyDitheringFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, legacyDithering ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceLegacyDitheringFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( legacyDithering == rhs.legacyDithering ); -# endif - } - - bool operator!=( PhysicalDeviceLegacyDitheringFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceLegacyDitheringFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 legacyDithering = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceLegacyDitheringFeaturesEXT; - }; - - struct PhysicalDeviceLimits - { - using NativeType = VkPhysicalDeviceLimits; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLimits( uint32_t maxImageDimension1D_ = {}, - uint32_t maxImageDimension2D_ = {}, - uint32_t maxImageDimension3D_ = {}, - uint32_t maxImageDimensionCube_ = {}, - uint32_t maxImageArrayLayers_ = {}, - uint32_t maxTexelBufferElements_ = {}, - uint32_t maxUniformBufferRange_ = {}, - uint32_t maxStorageBufferRange_ = {}, - uint32_t maxPushConstantsSize_ = {}, - uint32_t maxMemoryAllocationCount_ = {}, - uint32_t maxSamplerAllocationCount_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize bufferImageGranularity_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize sparseAddressSpaceSize_ = {}, - uint32_t maxBoundDescriptorSets_ = {}, - uint32_t maxPerStageDescriptorSamplers_ = {}, - uint32_t maxPerStageDescriptorUniformBuffers_ = {}, - uint32_t maxPerStageDescriptorStorageBuffers_ = {}, - uint32_t maxPerStageDescriptorSampledImages_ = {}, - uint32_t maxPerStageDescriptorStorageImages_ = {}, - uint32_t maxPerStageDescriptorInputAttachments_ = {}, - uint32_t maxPerStageResources_ = {}, - uint32_t maxDescriptorSetSamplers_ = {}, - uint32_t maxDescriptorSetUniformBuffers_ = {}, - uint32_t maxDescriptorSetUniformBuffersDynamic_ = {}, - uint32_t maxDescriptorSetStorageBuffers_ = {}, - uint32_t maxDescriptorSetStorageBuffersDynamic_ = {}, - uint32_t maxDescriptorSetSampledImages_ = {}, - uint32_t maxDescriptorSetStorageImages_ = {}, - uint32_t maxDescriptorSetInputAttachments_ = {}, - uint32_t maxVertexInputAttributes_ = {}, - uint32_t maxVertexInputBindings_ = {}, - uint32_t maxVertexInputAttributeOffset_ = {}, - uint32_t maxVertexInputBindingStride_ = {}, - uint32_t maxVertexOutputComponents_ = {}, - uint32_t maxTessellationGenerationLevel_ = {}, - uint32_t maxTessellationPatchSize_ = {}, - uint32_t maxTessellationControlPerVertexInputComponents_ = {}, - uint32_t maxTessellationControlPerVertexOutputComponents_ = {}, - uint32_t maxTessellationControlPerPatchOutputComponents_ = {}, - uint32_t maxTessellationControlTotalOutputComponents_ = {}, - uint32_t maxTessellationEvaluationInputComponents_ = {}, - uint32_t maxTessellationEvaluationOutputComponents_ = {}, - uint32_t maxGeometryShaderInvocations_ = {}, - uint32_t maxGeometryInputComponents_ = {}, - uint32_t maxGeometryOutputComponents_ = {}, - uint32_t maxGeometryOutputVertices_ = {}, - uint32_t maxGeometryTotalOutputComponents_ = {}, - uint32_t maxFragmentInputComponents_ = {}, - uint32_t maxFragmentOutputAttachments_ = {}, - uint32_t maxFragmentDualSrcAttachments_ = {}, - uint32_t maxFragmentCombinedOutputResources_ = {}, - uint32_t maxComputeSharedMemorySize_ = {}, - std::array const & maxComputeWorkGroupCount_ = {}, - uint32_t maxComputeWorkGroupInvocations_ = {}, - std::array const & maxComputeWorkGroupSize_ = {}, - uint32_t subPixelPrecisionBits_ = {}, - uint32_t subTexelPrecisionBits_ = {}, - uint32_t mipmapPrecisionBits_ = {}, - uint32_t maxDrawIndexedIndexValue_ = {}, - uint32_t maxDrawIndirectCount_ = {}, - float maxSamplerLodBias_ = {}, - float maxSamplerAnisotropy_ = {}, - uint32_t maxViewports_ = {}, - std::array const & maxViewportDimensions_ = {}, - std::array const & viewportBoundsRange_ = {}, - uint32_t viewportSubPixelBits_ = {}, - size_t minMemoryMapAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize minTexelBufferOffsetAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize minUniformBufferOffsetAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize minStorageBufferOffsetAlignment_ = {}, - int32_t minTexelOffset_ = {}, - uint32_t maxTexelOffset_ = {}, - int32_t minTexelGatherOffset_ = {}, - uint32_t maxTexelGatherOffset_ = {}, - float minInterpolationOffset_ = {}, - float maxInterpolationOffset_ = {}, - uint32_t subPixelInterpolationOffsetBits_ = {}, - uint32_t maxFramebufferWidth_ = {}, - uint32_t maxFramebufferHeight_ = {}, - uint32_t maxFramebufferLayers_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferColorSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferDepthSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferStencilSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferNoAttachmentsSampleCounts_ = {}, - uint32_t maxColorAttachments_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageColorSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageIntegerSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageDepthSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageStencilSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags storageImageSampleCounts_ = {}, - uint32_t maxSampleMaskWords_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 timestampComputeAndGraphics_ = {}, - float timestampPeriod_ = {}, - uint32_t maxClipDistances_ = {}, - uint32_t maxCullDistances_ = {}, - uint32_t maxCombinedClipAndCullDistances_ = {}, - uint32_t discreteQueuePriorities_ = {}, - std::array const & pointSizeRange_ = {}, - std::array const & lineWidthRange_ = {}, - float pointSizeGranularity_ = {}, - float lineWidthGranularity_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 strictLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 standardSampleLocations_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize optimalBufferCopyOffsetAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize optimalBufferCopyRowPitchAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize nonCoherentAtomSize_ = {} ) VULKAN_HPP_NOEXCEPT - : maxImageDimension1D( maxImageDimension1D_ ) - , maxImageDimension2D( maxImageDimension2D_ ) - , maxImageDimension3D( maxImageDimension3D_ ) - , maxImageDimensionCube( maxImageDimensionCube_ ) - , maxImageArrayLayers( maxImageArrayLayers_ ) - , maxTexelBufferElements( maxTexelBufferElements_ ) - , maxUniformBufferRange( maxUniformBufferRange_ ) - , maxStorageBufferRange( maxStorageBufferRange_ ) - , maxPushConstantsSize( maxPushConstantsSize_ ) - , maxMemoryAllocationCount( maxMemoryAllocationCount_ ) - , maxSamplerAllocationCount( maxSamplerAllocationCount_ ) - , bufferImageGranularity( bufferImageGranularity_ ) - , sparseAddressSpaceSize( sparseAddressSpaceSize_ ) - , maxBoundDescriptorSets( maxBoundDescriptorSets_ ) - , maxPerStageDescriptorSamplers( maxPerStageDescriptorSamplers_ ) - , maxPerStageDescriptorUniformBuffers( maxPerStageDescriptorUniformBuffers_ ) - , maxPerStageDescriptorStorageBuffers( maxPerStageDescriptorStorageBuffers_ ) - , maxPerStageDescriptorSampledImages( maxPerStageDescriptorSampledImages_ ) - , maxPerStageDescriptorStorageImages( maxPerStageDescriptorStorageImages_ ) - , maxPerStageDescriptorInputAttachments( maxPerStageDescriptorInputAttachments_ ) - , maxPerStageResources( maxPerStageResources_ ) - , maxDescriptorSetSamplers( maxDescriptorSetSamplers_ ) - , maxDescriptorSetUniformBuffers( maxDescriptorSetUniformBuffers_ ) - , maxDescriptorSetUniformBuffersDynamic( maxDescriptorSetUniformBuffersDynamic_ ) - , maxDescriptorSetStorageBuffers( maxDescriptorSetStorageBuffers_ ) - , maxDescriptorSetStorageBuffersDynamic( maxDescriptorSetStorageBuffersDynamic_ ) - , maxDescriptorSetSampledImages( maxDescriptorSetSampledImages_ ) - , maxDescriptorSetStorageImages( maxDescriptorSetStorageImages_ ) - , maxDescriptorSetInputAttachments( maxDescriptorSetInputAttachments_ ) - , maxVertexInputAttributes( maxVertexInputAttributes_ ) - , maxVertexInputBindings( maxVertexInputBindings_ ) - , maxVertexInputAttributeOffset( maxVertexInputAttributeOffset_ ) - , maxVertexInputBindingStride( maxVertexInputBindingStride_ ) - , maxVertexOutputComponents( maxVertexOutputComponents_ ) - , maxTessellationGenerationLevel( maxTessellationGenerationLevel_ ) - , maxTessellationPatchSize( maxTessellationPatchSize_ ) - , maxTessellationControlPerVertexInputComponents( maxTessellationControlPerVertexInputComponents_ ) - , maxTessellationControlPerVertexOutputComponents( maxTessellationControlPerVertexOutputComponents_ ) - , maxTessellationControlPerPatchOutputComponents( maxTessellationControlPerPatchOutputComponents_ ) - , maxTessellationControlTotalOutputComponents( maxTessellationControlTotalOutputComponents_ ) - , maxTessellationEvaluationInputComponents( maxTessellationEvaluationInputComponents_ ) - , maxTessellationEvaluationOutputComponents( maxTessellationEvaluationOutputComponents_ ) - , maxGeometryShaderInvocations( maxGeometryShaderInvocations_ ) - , maxGeometryInputComponents( maxGeometryInputComponents_ ) - , maxGeometryOutputComponents( maxGeometryOutputComponents_ ) - , maxGeometryOutputVertices( maxGeometryOutputVertices_ ) - , maxGeometryTotalOutputComponents( maxGeometryTotalOutputComponents_ ) - , maxFragmentInputComponents( maxFragmentInputComponents_ ) - , maxFragmentOutputAttachments( maxFragmentOutputAttachments_ ) - , maxFragmentDualSrcAttachments( maxFragmentDualSrcAttachments_ ) - , maxFragmentCombinedOutputResources( maxFragmentCombinedOutputResources_ ) - , maxComputeSharedMemorySize( maxComputeSharedMemorySize_ ) - , maxComputeWorkGroupCount( maxComputeWorkGroupCount_ ) - , maxComputeWorkGroupInvocations( maxComputeWorkGroupInvocations_ ) - , maxComputeWorkGroupSize( maxComputeWorkGroupSize_ ) - , subPixelPrecisionBits( subPixelPrecisionBits_ ) - , subTexelPrecisionBits( subTexelPrecisionBits_ ) - , mipmapPrecisionBits( mipmapPrecisionBits_ ) - , maxDrawIndexedIndexValue( maxDrawIndexedIndexValue_ ) - , maxDrawIndirectCount( maxDrawIndirectCount_ ) - , maxSamplerLodBias( maxSamplerLodBias_ ) - , maxSamplerAnisotropy( maxSamplerAnisotropy_ ) - , maxViewports( maxViewports_ ) - , maxViewportDimensions( maxViewportDimensions_ ) - , viewportBoundsRange( viewportBoundsRange_ ) - , viewportSubPixelBits( viewportSubPixelBits_ ) - , minMemoryMapAlignment( minMemoryMapAlignment_ ) - , minTexelBufferOffsetAlignment( minTexelBufferOffsetAlignment_ ) - , minUniformBufferOffsetAlignment( minUniformBufferOffsetAlignment_ ) - , minStorageBufferOffsetAlignment( minStorageBufferOffsetAlignment_ ) - , minTexelOffset( minTexelOffset_ ) - , maxTexelOffset( maxTexelOffset_ ) - , minTexelGatherOffset( minTexelGatherOffset_ ) - , maxTexelGatherOffset( maxTexelGatherOffset_ ) - , minInterpolationOffset( minInterpolationOffset_ ) - , maxInterpolationOffset( maxInterpolationOffset_ ) - , subPixelInterpolationOffsetBits( subPixelInterpolationOffsetBits_ ) - , maxFramebufferWidth( maxFramebufferWidth_ ) - , maxFramebufferHeight( maxFramebufferHeight_ ) - , maxFramebufferLayers( maxFramebufferLayers_ ) - , framebufferColorSampleCounts( framebufferColorSampleCounts_ ) - , framebufferDepthSampleCounts( framebufferDepthSampleCounts_ ) - , framebufferStencilSampleCounts( framebufferStencilSampleCounts_ ) - , framebufferNoAttachmentsSampleCounts( framebufferNoAttachmentsSampleCounts_ ) - , maxColorAttachments( maxColorAttachments_ ) - , sampledImageColorSampleCounts( sampledImageColorSampleCounts_ ) - , sampledImageIntegerSampleCounts( sampledImageIntegerSampleCounts_ ) - , sampledImageDepthSampleCounts( sampledImageDepthSampleCounts_ ) - , sampledImageStencilSampleCounts( sampledImageStencilSampleCounts_ ) - , storageImageSampleCounts( storageImageSampleCounts_ ) - , maxSampleMaskWords( maxSampleMaskWords_ ) - , timestampComputeAndGraphics( timestampComputeAndGraphics_ ) - , timestampPeriod( timestampPeriod_ ) - , maxClipDistances( maxClipDistances_ ) - , maxCullDistances( maxCullDistances_ ) - , maxCombinedClipAndCullDistances( maxCombinedClipAndCullDistances_ ) - , discreteQueuePriorities( discreteQueuePriorities_ ) - , pointSizeRange( pointSizeRange_ ) - , lineWidthRange( lineWidthRange_ ) - , pointSizeGranularity( pointSizeGranularity_ ) - , lineWidthGranularity( lineWidthGranularity_ ) - , strictLines( strictLines_ ) - , standardSampleLocations( standardSampleLocations_ ) - , optimalBufferCopyOffsetAlignment( optimalBufferCopyOffsetAlignment_ ) - , optimalBufferCopyRowPitchAlignment( optimalBufferCopyRowPitchAlignment_ ) - , nonCoherentAtomSize( nonCoherentAtomSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLimits( PhysicalDeviceLimits const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLimits( VkPhysicalDeviceLimits const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceLimits( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceLimits & operator=( PhysicalDeviceLimits const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLimits & operator=( VkPhysicalDeviceLimits const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceLimits const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceLimits &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - float const &, - float const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - size_t const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &, - int32_t const &, - uint32_t const &, - int32_t const &, - uint32_t const &, - float const &, - float const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - float const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - float const &, - float const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( maxImageDimension1D, - maxImageDimension2D, - maxImageDimension3D, - maxImageDimensionCube, - maxImageArrayLayers, - maxTexelBufferElements, - maxUniformBufferRange, - maxStorageBufferRange, - maxPushConstantsSize, - maxMemoryAllocationCount, - maxSamplerAllocationCount, - bufferImageGranularity, - sparseAddressSpaceSize, - maxBoundDescriptorSets, - maxPerStageDescriptorSamplers, - maxPerStageDescriptorUniformBuffers, - maxPerStageDescriptorStorageBuffers, - maxPerStageDescriptorSampledImages, - maxPerStageDescriptorStorageImages, - maxPerStageDescriptorInputAttachments, - maxPerStageResources, - maxDescriptorSetSamplers, - maxDescriptorSetUniformBuffers, - maxDescriptorSetUniformBuffersDynamic, - maxDescriptorSetStorageBuffers, - maxDescriptorSetStorageBuffersDynamic, - maxDescriptorSetSampledImages, - maxDescriptorSetStorageImages, - maxDescriptorSetInputAttachments, - maxVertexInputAttributes, - maxVertexInputBindings, - maxVertexInputAttributeOffset, - maxVertexInputBindingStride, - maxVertexOutputComponents, - maxTessellationGenerationLevel, - maxTessellationPatchSize, - maxTessellationControlPerVertexInputComponents, - maxTessellationControlPerVertexOutputComponents, - maxTessellationControlPerPatchOutputComponents, - maxTessellationControlTotalOutputComponents, - maxTessellationEvaluationInputComponents, - maxTessellationEvaluationOutputComponents, - maxGeometryShaderInvocations, - maxGeometryInputComponents, - maxGeometryOutputComponents, - maxGeometryOutputVertices, - maxGeometryTotalOutputComponents, - maxFragmentInputComponents, - maxFragmentOutputAttachments, - maxFragmentDualSrcAttachments, - maxFragmentCombinedOutputResources, - maxComputeSharedMemorySize, - maxComputeWorkGroupCount, - maxComputeWorkGroupInvocations, - maxComputeWorkGroupSize, - subPixelPrecisionBits, - subTexelPrecisionBits, - mipmapPrecisionBits, - maxDrawIndexedIndexValue, - maxDrawIndirectCount, - maxSamplerLodBias, - maxSamplerAnisotropy, - maxViewports, - maxViewportDimensions, - viewportBoundsRange, - viewportSubPixelBits, - minMemoryMapAlignment, - minTexelBufferOffsetAlignment, - minUniformBufferOffsetAlignment, - minStorageBufferOffsetAlignment, - minTexelOffset, - maxTexelOffset, - minTexelGatherOffset, - maxTexelGatherOffset, - minInterpolationOffset, - maxInterpolationOffset, - subPixelInterpolationOffsetBits, - maxFramebufferWidth, - maxFramebufferHeight, - maxFramebufferLayers, - framebufferColorSampleCounts, - framebufferDepthSampleCounts, - framebufferStencilSampleCounts, - framebufferNoAttachmentsSampleCounts, - maxColorAttachments, - sampledImageColorSampleCounts, - sampledImageIntegerSampleCounts, - sampledImageDepthSampleCounts, - sampledImageStencilSampleCounts, - storageImageSampleCounts, - maxSampleMaskWords, - timestampComputeAndGraphics, - timestampPeriod, - maxClipDistances, - maxCullDistances, - maxCombinedClipAndCullDistances, - discreteQueuePriorities, - pointSizeRange, - lineWidthRange, - pointSizeGranularity, - lineWidthGranularity, - strictLines, - standardSampleLocations, - optimalBufferCopyOffsetAlignment, - optimalBufferCopyRowPitchAlignment, - nonCoherentAtomSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceLimits const & ) const = default; -#else - bool operator==( PhysicalDeviceLimits const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( maxImageDimension1D == rhs.maxImageDimension1D ) && ( maxImageDimension2D == rhs.maxImageDimension2D ) && - ( maxImageDimension3D == rhs.maxImageDimension3D ) && ( maxImageDimensionCube == rhs.maxImageDimensionCube ) && - ( maxImageArrayLayers == rhs.maxImageArrayLayers ) && ( maxTexelBufferElements == rhs.maxTexelBufferElements ) && - ( maxUniformBufferRange == rhs.maxUniformBufferRange ) && ( maxStorageBufferRange == rhs.maxStorageBufferRange ) && - ( maxPushConstantsSize == rhs.maxPushConstantsSize ) && ( maxMemoryAllocationCount == rhs.maxMemoryAllocationCount ) && - ( maxSamplerAllocationCount == rhs.maxSamplerAllocationCount ) && ( bufferImageGranularity == rhs.bufferImageGranularity ) && - ( sparseAddressSpaceSize == rhs.sparseAddressSpaceSize ) && ( maxBoundDescriptorSets == rhs.maxBoundDescriptorSets ) && - ( maxPerStageDescriptorSamplers == rhs.maxPerStageDescriptorSamplers ) && - ( maxPerStageDescriptorUniformBuffers == rhs.maxPerStageDescriptorUniformBuffers ) && - ( maxPerStageDescriptorStorageBuffers == rhs.maxPerStageDescriptorStorageBuffers ) && - ( maxPerStageDescriptorSampledImages == rhs.maxPerStageDescriptorSampledImages ) && - ( maxPerStageDescriptorStorageImages == rhs.maxPerStageDescriptorStorageImages ) && - ( maxPerStageDescriptorInputAttachments == rhs.maxPerStageDescriptorInputAttachments ) && ( maxPerStageResources == rhs.maxPerStageResources ) && - ( maxDescriptorSetSamplers == rhs.maxDescriptorSetSamplers ) && ( maxDescriptorSetUniformBuffers == rhs.maxDescriptorSetUniformBuffers ) && - ( maxDescriptorSetUniformBuffersDynamic == rhs.maxDescriptorSetUniformBuffersDynamic ) && - ( maxDescriptorSetStorageBuffers == rhs.maxDescriptorSetStorageBuffers ) && - ( maxDescriptorSetStorageBuffersDynamic == rhs.maxDescriptorSetStorageBuffersDynamic ) && - ( maxDescriptorSetSampledImages == rhs.maxDescriptorSetSampledImages ) && ( maxDescriptorSetStorageImages == rhs.maxDescriptorSetStorageImages ) && - ( maxDescriptorSetInputAttachments == rhs.maxDescriptorSetInputAttachments ) && ( maxVertexInputAttributes == rhs.maxVertexInputAttributes ) && - ( maxVertexInputBindings == rhs.maxVertexInputBindings ) && ( maxVertexInputAttributeOffset == rhs.maxVertexInputAttributeOffset ) && - ( maxVertexInputBindingStride == rhs.maxVertexInputBindingStride ) && ( maxVertexOutputComponents == rhs.maxVertexOutputComponents ) && - ( maxTessellationGenerationLevel == rhs.maxTessellationGenerationLevel ) && ( maxTessellationPatchSize == rhs.maxTessellationPatchSize ) && - ( maxTessellationControlPerVertexInputComponents == rhs.maxTessellationControlPerVertexInputComponents ) && - ( maxTessellationControlPerVertexOutputComponents == rhs.maxTessellationControlPerVertexOutputComponents ) && - ( maxTessellationControlPerPatchOutputComponents == rhs.maxTessellationControlPerPatchOutputComponents ) && - ( maxTessellationControlTotalOutputComponents == rhs.maxTessellationControlTotalOutputComponents ) && - ( maxTessellationEvaluationInputComponents == rhs.maxTessellationEvaluationInputComponents ) && - ( maxTessellationEvaluationOutputComponents == rhs.maxTessellationEvaluationOutputComponents ) && - ( maxGeometryShaderInvocations == rhs.maxGeometryShaderInvocations ) && ( maxGeometryInputComponents == rhs.maxGeometryInputComponents ) && - ( maxGeometryOutputComponents == rhs.maxGeometryOutputComponents ) && ( maxGeometryOutputVertices == rhs.maxGeometryOutputVertices ) && - ( maxGeometryTotalOutputComponents == rhs.maxGeometryTotalOutputComponents ) && ( maxFragmentInputComponents == rhs.maxFragmentInputComponents ) && - ( maxFragmentOutputAttachments == rhs.maxFragmentOutputAttachments ) && ( maxFragmentDualSrcAttachments == rhs.maxFragmentDualSrcAttachments ) && - ( maxFragmentCombinedOutputResources == rhs.maxFragmentCombinedOutputResources ) && - ( maxComputeSharedMemorySize == rhs.maxComputeSharedMemorySize ) && ( maxComputeWorkGroupCount == rhs.maxComputeWorkGroupCount ) && - ( maxComputeWorkGroupInvocations == rhs.maxComputeWorkGroupInvocations ) && ( maxComputeWorkGroupSize == rhs.maxComputeWorkGroupSize ) && - ( subPixelPrecisionBits == rhs.subPixelPrecisionBits ) && ( subTexelPrecisionBits == rhs.subTexelPrecisionBits ) && - ( mipmapPrecisionBits == rhs.mipmapPrecisionBits ) && ( maxDrawIndexedIndexValue == rhs.maxDrawIndexedIndexValue ) && - ( maxDrawIndirectCount == rhs.maxDrawIndirectCount ) && ( maxSamplerLodBias == rhs.maxSamplerLodBias ) && - ( maxSamplerAnisotropy == rhs.maxSamplerAnisotropy ) && ( maxViewports == rhs.maxViewports ) && - ( maxViewportDimensions == rhs.maxViewportDimensions ) && ( viewportBoundsRange == rhs.viewportBoundsRange ) && - ( viewportSubPixelBits == rhs.viewportSubPixelBits ) && ( minMemoryMapAlignment == rhs.minMemoryMapAlignment ) && - ( minTexelBufferOffsetAlignment == rhs.minTexelBufferOffsetAlignment ) && - ( minUniformBufferOffsetAlignment == rhs.minUniformBufferOffsetAlignment ) && - ( minStorageBufferOffsetAlignment == rhs.minStorageBufferOffsetAlignment ) && ( minTexelOffset == rhs.minTexelOffset ) && - ( maxTexelOffset == rhs.maxTexelOffset ) && ( minTexelGatherOffset == rhs.minTexelGatherOffset ) && - ( maxTexelGatherOffset == rhs.maxTexelGatherOffset ) && ( minInterpolationOffset == rhs.minInterpolationOffset ) && - ( maxInterpolationOffset == rhs.maxInterpolationOffset ) && ( subPixelInterpolationOffsetBits == rhs.subPixelInterpolationOffsetBits ) && - ( maxFramebufferWidth == rhs.maxFramebufferWidth ) && ( maxFramebufferHeight == rhs.maxFramebufferHeight ) && - ( maxFramebufferLayers == rhs.maxFramebufferLayers ) && ( framebufferColorSampleCounts == rhs.framebufferColorSampleCounts ) && - ( framebufferDepthSampleCounts == rhs.framebufferDepthSampleCounts ) && ( framebufferStencilSampleCounts == rhs.framebufferStencilSampleCounts ) && - ( framebufferNoAttachmentsSampleCounts == rhs.framebufferNoAttachmentsSampleCounts ) && ( maxColorAttachments == rhs.maxColorAttachments ) && - ( sampledImageColorSampleCounts == rhs.sampledImageColorSampleCounts ) && - ( sampledImageIntegerSampleCounts == rhs.sampledImageIntegerSampleCounts ) && - ( sampledImageDepthSampleCounts == rhs.sampledImageDepthSampleCounts ) && - ( sampledImageStencilSampleCounts == rhs.sampledImageStencilSampleCounts ) && ( storageImageSampleCounts == rhs.storageImageSampleCounts ) && - ( maxSampleMaskWords == rhs.maxSampleMaskWords ) && ( timestampComputeAndGraphics == rhs.timestampComputeAndGraphics ) && - ( timestampPeriod == rhs.timestampPeriod ) && ( maxClipDistances == rhs.maxClipDistances ) && ( maxCullDistances == rhs.maxCullDistances ) && - ( maxCombinedClipAndCullDistances == rhs.maxCombinedClipAndCullDistances ) && ( discreteQueuePriorities == rhs.discreteQueuePriorities ) && - ( pointSizeRange == rhs.pointSizeRange ) && ( lineWidthRange == rhs.lineWidthRange ) && ( pointSizeGranularity == rhs.pointSizeGranularity ) && - ( lineWidthGranularity == rhs.lineWidthGranularity ) && ( strictLines == rhs.strictLines ) && - ( standardSampleLocations == rhs.standardSampleLocations ) && ( optimalBufferCopyOffsetAlignment == rhs.optimalBufferCopyOffsetAlignment ) && - ( optimalBufferCopyRowPitchAlignment == rhs.optimalBufferCopyRowPitchAlignment ) && ( nonCoherentAtomSize == rhs.nonCoherentAtomSize ); -# endif - } - - bool operator!=( PhysicalDeviceLimits const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t maxImageDimension1D = {}; - uint32_t maxImageDimension2D = {}; - uint32_t maxImageDimension3D = {}; - uint32_t maxImageDimensionCube = {}; - uint32_t maxImageArrayLayers = {}; - uint32_t maxTexelBufferElements = {}; - uint32_t maxUniformBufferRange = {}; - uint32_t maxStorageBufferRange = {}; - uint32_t maxPushConstantsSize = {}; - uint32_t maxMemoryAllocationCount = {}; - uint32_t maxSamplerAllocationCount = {}; - VULKAN_HPP_NAMESPACE::DeviceSize bufferImageGranularity = {}; - VULKAN_HPP_NAMESPACE::DeviceSize sparseAddressSpaceSize = {}; - uint32_t maxBoundDescriptorSets = {}; - uint32_t maxPerStageDescriptorSamplers = {}; - uint32_t maxPerStageDescriptorUniformBuffers = {}; - uint32_t maxPerStageDescriptorStorageBuffers = {}; - uint32_t maxPerStageDescriptorSampledImages = {}; - uint32_t maxPerStageDescriptorStorageImages = {}; - uint32_t maxPerStageDescriptorInputAttachments = {}; - uint32_t maxPerStageResources = {}; - uint32_t maxDescriptorSetSamplers = {}; - uint32_t maxDescriptorSetUniformBuffers = {}; - uint32_t maxDescriptorSetUniformBuffersDynamic = {}; - uint32_t maxDescriptorSetStorageBuffers = {}; - uint32_t maxDescriptorSetStorageBuffersDynamic = {}; - uint32_t maxDescriptorSetSampledImages = {}; - uint32_t maxDescriptorSetStorageImages = {}; - uint32_t maxDescriptorSetInputAttachments = {}; - uint32_t maxVertexInputAttributes = {}; - uint32_t maxVertexInputBindings = {}; - uint32_t maxVertexInputAttributeOffset = {}; - uint32_t maxVertexInputBindingStride = {}; - uint32_t maxVertexOutputComponents = {}; - uint32_t maxTessellationGenerationLevel = {}; - uint32_t maxTessellationPatchSize = {}; - uint32_t maxTessellationControlPerVertexInputComponents = {}; - uint32_t maxTessellationControlPerVertexOutputComponents = {}; - uint32_t maxTessellationControlPerPatchOutputComponents = {}; - uint32_t maxTessellationControlTotalOutputComponents = {}; - uint32_t maxTessellationEvaluationInputComponents = {}; - uint32_t maxTessellationEvaluationOutputComponents = {}; - uint32_t maxGeometryShaderInvocations = {}; - uint32_t maxGeometryInputComponents = {}; - uint32_t maxGeometryOutputComponents = {}; - uint32_t maxGeometryOutputVertices = {}; - uint32_t maxGeometryTotalOutputComponents = {}; - uint32_t maxFragmentInputComponents = {}; - uint32_t maxFragmentOutputAttachments = {}; - uint32_t maxFragmentDualSrcAttachments = {}; - uint32_t maxFragmentCombinedOutputResources = {}; - uint32_t maxComputeSharedMemorySize = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxComputeWorkGroupCount = {}; - uint32_t maxComputeWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxComputeWorkGroupSize = {}; - uint32_t subPixelPrecisionBits = {}; - uint32_t subTexelPrecisionBits = {}; - uint32_t mipmapPrecisionBits = {}; - uint32_t maxDrawIndexedIndexValue = {}; - uint32_t maxDrawIndirectCount = {}; - float maxSamplerLodBias = {}; - float maxSamplerAnisotropy = {}; - uint32_t maxViewports = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxViewportDimensions = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D viewportBoundsRange = {}; - uint32_t viewportSubPixelBits = {}; - size_t minMemoryMapAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minTexelBufferOffsetAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minUniformBufferOffsetAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minStorageBufferOffsetAlignment = {}; - int32_t minTexelOffset = {}; - uint32_t maxTexelOffset = {}; - int32_t minTexelGatherOffset = {}; - uint32_t maxTexelGatherOffset = {}; - float minInterpolationOffset = {}; - float maxInterpolationOffset = {}; - uint32_t subPixelInterpolationOffsetBits = {}; - uint32_t maxFramebufferWidth = {}; - uint32_t maxFramebufferHeight = {}; - uint32_t maxFramebufferLayers = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferColorSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferDepthSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferStencilSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferNoAttachmentsSampleCounts = {}; - uint32_t maxColorAttachments = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageColorSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageIntegerSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageDepthSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampledImageStencilSampleCounts = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags storageImageSampleCounts = {}; - uint32_t maxSampleMaskWords = {}; - VULKAN_HPP_NAMESPACE::Bool32 timestampComputeAndGraphics = {}; - float timestampPeriod = {}; - uint32_t maxClipDistances = {}; - uint32_t maxCullDistances = {}; - uint32_t maxCombinedClipAndCullDistances = {}; - uint32_t discreteQueuePriorities = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D pointSizeRange = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D lineWidthRange = {}; - float pointSizeGranularity = {}; - float lineWidthGranularity = {}; - VULKAN_HPP_NAMESPACE::Bool32 strictLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 standardSampleLocations = {}; - VULKAN_HPP_NAMESPACE::DeviceSize optimalBufferCopyOffsetAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize optimalBufferCopyRowPitchAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize nonCoherentAtomSize = {}; - }; - - struct PhysicalDeviceLineRasterizationFeaturesEXT - { - using NativeType = VkPhysicalDeviceLineRasterizationFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceLineRasterizationFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceLineRasterizationFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 rectangularLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bresenhamLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 smoothLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 stippledRectangularLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 stippledBresenhamLines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 stippledSmoothLines_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rectangularLines( rectangularLines_ ) - , bresenhamLines( bresenhamLines_ ) - , smoothLines( smoothLines_ ) - , stippledRectangularLines( stippledRectangularLines_ ) - , stippledBresenhamLines( stippledBresenhamLines_ ) - , stippledSmoothLines( stippledSmoothLines_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceLineRasterizationFeaturesEXT( PhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLineRasterizationFeaturesEXT( VkPhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceLineRasterizationFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceLineRasterizationFeaturesEXT & operator=( PhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLineRasterizationFeaturesEXT & operator=( VkPhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & - setRectangularLines( VULKAN_HPP_NAMESPACE::Bool32 rectangularLines_ ) VULKAN_HPP_NOEXCEPT - { - rectangularLines = rectangularLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & setBresenhamLines( VULKAN_HPP_NAMESPACE::Bool32 bresenhamLines_ ) VULKAN_HPP_NOEXCEPT - { - bresenhamLines = bresenhamLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & setSmoothLines( VULKAN_HPP_NAMESPACE::Bool32 smoothLines_ ) VULKAN_HPP_NOEXCEPT - { - smoothLines = smoothLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & - setStippledRectangularLines( VULKAN_HPP_NAMESPACE::Bool32 stippledRectangularLines_ ) VULKAN_HPP_NOEXCEPT - { - stippledRectangularLines = stippledRectangularLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & - setStippledBresenhamLines( VULKAN_HPP_NAMESPACE::Bool32 stippledBresenhamLines_ ) VULKAN_HPP_NOEXCEPT - { - stippledBresenhamLines = stippledBresenhamLines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLineRasterizationFeaturesEXT & - setStippledSmoothLines( VULKAN_HPP_NAMESPACE::Bool32 stippledSmoothLines_ ) VULKAN_HPP_NOEXCEPT - { - stippledSmoothLines = stippledSmoothLines_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceLineRasterizationFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceLineRasterizationFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, rectangularLines, bresenhamLines, smoothLines, stippledRectangularLines, stippledBresenhamLines, stippledSmoothLines ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceLineRasterizationFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rectangularLines == rhs.rectangularLines ) && ( bresenhamLines == rhs.bresenhamLines ) && - ( smoothLines == rhs.smoothLines ) && ( stippledRectangularLines == rhs.stippledRectangularLines ) && - ( stippledBresenhamLines == rhs.stippledBresenhamLines ) && ( stippledSmoothLines == rhs.stippledSmoothLines ); -# endif - } - - bool operator!=( PhysicalDeviceLineRasterizationFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceLineRasterizationFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rectangularLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 bresenhamLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 smoothLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 stippledRectangularLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 stippledBresenhamLines = {}; - VULKAN_HPP_NAMESPACE::Bool32 stippledSmoothLines = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceLineRasterizationFeaturesEXT; - }; - - struct PhysicalDeviceLineRasterizationPropertiesEXT - { - using NativeType = VkPhysicalDeviceLineRasterizationPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceLineRasterizationPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceLineRasterizationPropertiesEXT( uint32_t lineSubPixelPrecisionBits_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , lineSubPixelPrecisionBits( lineSubPixelPrecisionBits_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceLineRasterizationPropertiesEXT( PhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLineRasterizationPropertiesEXT( VkPhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceLineRasterizationPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceLineRasterizationPropertiesEXT & operator=( PhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLineRasterizationPropertiesEXT & operator=( VkPhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceLineRasterizationPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceLineRasterizationPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, lineSubPixelPrecisionBits ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceLineRasterizationPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( lineSubPixelPrecisionBits == rhs.lineSubPixelPrecisionBits ); -# endif - } - - bool operator!=( PhysicalDeviceLineRasterizationPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceLineRasterizationPropertiesEXT; - void * pNext = {}; - uint32_t lineSubPixelPrecisionBits = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceLineRasterizationPropertiesEXT; - }; - - struct PhysicalDeviceLinearColorAttachmentFeaturesNV - { - using NativeType = VkPhysicalDeviceLinearColorAttachmentFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceLinearColorAttachmentFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceLinearColorAttachmentFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 linearColorAttachment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , linearColorAttachment( linearColorAttachment_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceLinearColorAttachmentFeaturesNV( PhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLinearColorAttachmentFeaturesNV( VkPhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceLinearColorAttachmentFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceLinearColorAttachmentFeaturesNV & operator=( PhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceLinearColorAttachmentFeaturesNV & operator=( VkPhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLinearColorAttachmentFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceLinearColorAttachmentFeaturesNV & - setLinearColorAttachment( VULKAN_HPP_NAMESPACE::Bool32 linearColorAttachment_ ) VULKAN_HPP_NOEXCEPT - { - linearColorAttachment = linearColorAttachment_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceLinearColorAttachmentFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceLinearColorAttachmentFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, linearColorAttachment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceLinearColorAttachmentFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( linearColorAttachment == rhs.linearColorAttachment ); -# endif - } - - bool operator!=( PhysicalDeviceLinearColorAttachmentFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceLinearColorAttachmentFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 linearColorAttachment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceLinearColorAttachmentFeaturesNV; - }; - - struct PhysicalDeviceMaintenance3Properties - { - using NativeType = VkPhysicalDeviceMaintenance3Properties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMaintenance3Properties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance3Properties( uint32_t maxPerSetDescriptors_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize maxMemoryAllocationSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxPerSetDescriptors( maxPerSetDescriptors_ ) - , maxMemoryAllocationSize( maxMemoryAllocationSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance3Properties( PhysicalDeviceMaintenance3Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance3Properties( VkPhysicalDeviceMaintenance3Properties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMaintenance3Properties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMaintenance3Properties & operator=( PhysicalDeviceMaintenance3Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance3Properties & operator=( VkPhysicalDeviceMaintenance3Properties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMaintenance3Properties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMaintenance3Properties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxPerSetDescriptors, maxMemoryAllocationSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMaintenance3Properties const & ) const = default; -#else - bool operator==( PhysicalDeviceMaintenance3Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxPerSetDescriptors == rhs.maxPerSetDescriptors ) && - ( maxMemoryAllocationSize == rhs.maxMemoryAllocationSize ); -# endif - } - - bool operator!=( PhysicalDeviceMaintenance3Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMaintenance3Properties; - void * pNext = {}; - uint32_t maxPerSetDescriptors = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxMemoryAllocationSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMaintenance3Properties; - }; - using PhysicalDeviceMaintenance3PropertiesKHR = PhysicalDeviceMaintenance3Properties; - - struct PhysicalDeviceMaintenance4Features - { - using NativeType = VkPhysicalDeviceMaintenance4Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMaintenance4Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance4Features( VULKAN_HPP_NAMESPACE::Bool32 maintenance4_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maintenance4( maintenance4_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance4Features( PhysicalDeviceMaintenance4Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance4Features( VkPhysicalDeviceMaintenance4Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMaintenance4Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMaintenance4Features & operator=( PhysicalDeviceMaintenance4Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance4Features & operator=( VkPhysicalDeviceMaintenance4Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMaintenance4Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMaintenance4Features & setMaintenance4( VULKAN_HPP_NAMESPACE::Bool32 maintenance4_ ) VULKAN_HPP_NOEXCEPT - { - maintenance4 = maintenance4_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMaintenance4Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMaintenance4Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maintenance4 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMaintenance4Features const & ) const = default; -#else - bool operator==( PhysicalDeviceMaintenance4Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maintenance4 == rhs.maintenance4 ); -# endif - } - - bool operator!=( PhysicalDeviceMaintenance4Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMaintenance4Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 maintenance4 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMaintenance4Features; - }; - using PhysicalDeviceMaintenance4FeaturesKHR = PhysicalDeviceMaintenance4Features; - - struct PhysicalDeviceMaintenance4Properties - { - using NativeType = VkPhysicalDeviceMaintenance4Properties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMaintenance4Properties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance4Properties( VULKAN_HPP_NAMESPACE::DeviceSize maxBufferSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxBufferSize( maxBufferSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMaintenance4Properties( PhysicalDeviceMaintenance4Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance4Properties( VkPhysicalDeviceMaintenance4Properties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMaintenance4Properties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMaintenance4Properties & operator=( PhysicalDeviceMaintenance4Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMaintenance4Properties & operator=( VkPhysicalDeviceMaintenance4Properties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMaintenance4Properties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMaintenance4Properties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxBufferSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMaintenance4Properties const & ) const = default; -#else - bool operator==( PhysicalDeviceMaintenance4Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxBufferSize == rhs.maxBufferSize ); -# endif - } - - bool operator!=( PhysicalDeviceMaintenance4Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMaintenance4Properties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxBufferSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMaintenance4Properties; - }; - using PhysicalDeviceMaintenance4PropertiesKHR = PhysicalDeviceMaintenance4Properties; - - struct PhysicalDeviceMemoryBudgetPropertiesEXT - { - using NativeType = VkPhysicalDeviceMemoryBudgetPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMemoryBudgetPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryBudgetPropertiesEXT( std::array const & heapBudget_ = {}, - std::array const & heapUsage_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , heapBudget( heapBudget_ ) - , heapUsage( heapUsage_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryBudgetPropertiesEXT( PhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryBudgetPropertiesEXT( VkPhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMemoryBudgetPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMemoryBudgetPropertiesEXT & operator=( PhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryBudgetPropertiesEXT & operator=( VkPhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMemoryBudgetPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMemoryBudgetPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, heapBudget, heapUsage ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMemoryBudgetPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( heapBudget == rhs.heapBudget ) && ( heapUsage == rhs.heapUsage ); -# endif - } - - bool operator!=( PhysicalDeviceMemoryBudgetPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMemoryBudgetPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D heapBudget = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D heapUsage = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMemoryBudgetPropertiesEXT; - }; - - struct PhysicalDeviceMemoryPriorityFeaturesEXT - { - using NativeType = VkPhysicalDeviceMemoryPriorityFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMemoryPriorityFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMemoryPriorityFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 memoryPriority_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryPriority( memoryPriority_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMemoryPriorityFeaturesEXT( PhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryPriorityFeaturesEXT( VkPhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMemoryPriorityFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMemoryPriorityFeaturesEXT & operator=( PhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryPriorityFeaturesEXT & operator=( VkPhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryPriorityFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryPriorityFeaturesEXT & setMemoryPriority( VULKAN_HPP_NAMESPACE::Bool32 memoryPriority_ ) VULKAN_HPP_NOEXCEPT - { - memoryPriority = memoryPriority_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMemoryPriorityFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMemoryPriorityFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryPriority ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMemoryPriorityFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryPriority == rhs.memoryPriority ); -# endif - } - - bool operator!=( PhysicalDeviceMemoryPriorityFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMemoryPriorityFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 memoryPriority = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMemoryPriorityFeaturesEXT; - }; - - struct PhysicalDeviceMemoryProperties - { - using NativeType = VkPhysicalDeviceMemoryProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PhysicalDeviceMemoryProperties( uint32_t memoryTypeCount_ = {}, - std::array const & memoryTypes_ = {}, - uint32_t memoryHeapCount_ = {}, - std::array const & memoryHeaps_ = {} ) VULKAN_HPP_NOEXCEPT - : memoryTypeCount( memoryTypeCount_ ) - , memoryTypes( memoryTypes_ ) - , memoryHeapCount( memoryHeapCount_ ) - , memoryHeaps( memoryHeaps_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryProperties( PhysicalDeviceMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryProperties( VkPhysicalDeviceMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMemoryProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMemoryProperties & operator=( PhysicalDeviceMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryProperties & operator=( VkPhysicalDeviceMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMemoryProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMemoryProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( memoryTypeCount, memoryTypes, memoryHeapCount, memoryHeaps ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMemoryProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( memoryTypeCount == rhs.memoryTypeCount ) && ( memoryTypes == rhs.memoryTypes ) && ( memoryHeapCount == rhs.memoryHeapCount ) && - ( memoryHeaps == rhs.memoryHeaps ); -# endif - } - - bool operator!=( PhysicalDeviceMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t memoryTypeCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D memoryTypes = {}; - uint32_t memoryHeapCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D memoryHeaps = {}; - }; - - struct PhysicalDeviceMemoryProperties2 - { - using NativeType = VkPhysicalDeviceMemoryProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMemoryProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties memoryProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryProperties( memoryProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMemoryProperties2( PhysicalDeviceMemoryProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryProperties2( VkPhysicalDeviceMemoryProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMemoryProperties2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMemoryProperties2 & operator=( PhysicalDeviceMemoryProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMemoryProperties2 & operator=( VkPhysicalDeviceMemoryProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMemoryProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMemoryProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMemoryProperties2 const & ) const = default; -#else - bool operator==( PhysicalDeviceMemoryProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryProperties == rhs.memoryProperties ); -# endif - } - - bool operator!=( PhysicalDeviceMemoryProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMemoryProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceMemoryProperties memoryProperties = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMemoryProperties2; - }; - using PhysicalDeviceMemoryProperties2KHR = PhysicalDeviceMemoryProperties2; - - struct PhysicalDeviceMeshShaderFeaturesEXT - { - using NativeType = VkPhysicalDeviceMeshShaderFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMeshShaderFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMeshShaderFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 taskShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 meshShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiviewMeshShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRateMeshShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 meshShaderQueries_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , taskShader( taskShader_ ) - , meshShader( meshShader_ ) - , multiviewMeshShader( multiviewMeshShader_ ) - , primitiveFragmentShadingRateMeshShader( primitiveFragmentShadingRateMeshShader_ ) - , meshShaderQueries( meshShaderQueries_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMeshShaderFeaturesEXT( PhysicalDeviceMeshShaderFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderFeaturesEXT( VkPhysicalDeviceMeshShaderFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMeshShaderFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMeshShaderFeaturesEXT & operator=( PhysicalDeviceMeshShaderFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderFeaturesEXT & operator=( VkPhysicalDeviceMeshShaderFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & setTaskShader( VULKAN_HPP_NAMESPACE::Bool32 taskShader_ ) VULKAN_HPP_NOEXCEPT - { - taskShader = taskShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & setMeshShader( VULKAN_HPP_NAMESPACE::Bool32 meshShader_ ) VULKAN_HPP_NOEXCEPT - { - meshShader = meshShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & - setMultiviewMeshShader( VULKAN_HPP_NAMESPACE::Bool32 multiviewMeshShader_ ) VULKAN_HPP_NOEXCEPT - { - multiviewMeshShader = multiviewMeshShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & - setPrimitiveFragmentShadingRateMeshShader( VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRateMeshShader_ ) VULKAN_HPP_NOEXCEPT - { - primitiveFragmentShadingRateMeshShader = primitiveFragmentShadingRateMeshShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesEXT & setMeshShaderQueries( VULKAN_HPP_NAMESPACE::Bool32 meshShaderQueries_ ) VULKAN_HPP_NOEXCEPT - { - meshShaderQueries = meshShaderQueries_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMeshShaderFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMeshShaderFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, taskShader, meshShader, multiviewMeshShader, primitiveFragmentShadingRateMeshShader, meshShaderQueries ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMeshShaderFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMeshShaderFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( taskShader == rhs.taskShader ) && ( meshShader == rhs.meshShader ) && - ( multiviewMeshShader == rhs.multiviewMeshShader ) && ( primitiveFragmentShadingRateMeshShader == rhs.primitiveFragmentShadingRateMeshShader ) && - ( meshShaderQueries == rhs.meshShaderQueries ); -# endif - } - - bool operator!=( PhysicalDeviceMeshShaderFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMeshShaderFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 taskShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 meshShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiviewMeshShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveFragmentShadingRateMeshShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 meshShaderQueries = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMeshShaderFeaturesEXT; - }; - - struct PhysicalDeviceMeshShaderFeaturesNV - { - using NativeType = VkPhysicalDeviceMeshShaderFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMeshShaderFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMeshShaderFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 taskShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 meshShader_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , taskShader( taskShader_ ) - , meshShader( meshShader_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMeshShaderFeaturesNV( PhysicalDeviceMeshShaderFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderFeaturesNV( VkPhysicalDeviceMeshShaderFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMeshShaderFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMeshShaderFeaturesNV & operator=( PhysicalDeviceMeshShaderFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderFeaturesNV & operator=( VkPhysicalDeviceMeshShaderFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesNV & setTaskShader( VULKAN_HPP_NAMESPACE::Bool32 taskShader_ ) VULKAN_HPP_NOEXCEPT - { - taskShader = taskShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderFeaturesNV & setMeshShader( VULKAN_HPP_NAMESPACE::Bool32 meshShader_ ) VULKAN_HPP_NOEXCEPT - { - meshShader = meshShader_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMeshShaderFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMeshShaderFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, taskShader, meshShader ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMeshShaderFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceMeshShaderFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( taskShader == rhs.taskShader ) && ( meshShader == rhs.meshShader ); -# endif - } - - bool operator!=( PhysicalDeviceMeshShaderFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMeshShaderFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 taskShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 meshShader = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMeshShaderFeaturesNV; - }; - - struct PhysicalDeviceMeshShaderPropertiesEXT - { - using NativeType = VkPhysicalDeviceMeshShaderPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMeshShaderPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderPropertiesEXT( uint32_t maxTaskWorkGroupTotalCount_ = {}, - std::array const & maxTaskWorkGroupCount_ = {}, - uint32_t maxTaskWorkGroupInvocations_ = {}, - std::array const & maxTaskWorkGroupSize_ = {}, - uint32_t maxTaskPayloadSize_ = {}, - uint32_t maxTaskSharedMemorySize_ = {}, - uint32_t maxTaskPayloadAndSharedMemorySize_ = {}, - uint32_t maxMeshWorkGroupTotalCount_ = {}, - std::array const & maxMeshWorkGroupCount_ = {}, - uint32_t maxMeshWorkGroupInvocations_ = {}, - std::array const & maxMeshWorkGroupSize_ = {}, - uint32_t maxMeshSharedMemorySize_ = {}, - uint32_t maxMeshPayloadAndSharedMemorySize_ = {}, - uint32_t maxMeshOutputMemorySize_ = {}, - uint32_t maxMeshPayloadAndOutputMemorySize_ = {}, - uint32_t maxMeshOutputComponents_ = {}, - uint32_t maxMeshOutputVertices_ = {}, - uint32_t maxMeshOutputPrimitives_ = {}, - uint32_t maxMeshOutputLayers_ = {}, - uint32_t maxMeshMultiviewViewCount_ = {}, - uint32_t meshOutputPerVertexGranularity_ = {}, - uint32_t meshOutputPerPrimitiveGranularity_ = {}, - uint32_t maxPreferredTaskWorkGroupInvocations_ = {}, - uint32_t maxPreferredMeshWorkGroupInvocations_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 prefersLocalInvocationVertexOutput_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 prefersLocalInvocationPrimitiveOutput_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 prefersCompactVertexOutput_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 prefersCompactPrimitiveOutput_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxTaskWorkGroupTotalCount( maxTaskWorkGroupTotalCount_ ) - , maxTaskWorkGroupCount( maxTaskWorkGroupCount_ ) - , maxTaskWorkGroupInvocations( maxTaskWorkGroupInvocations_ ) - , maxTaskWorkGroupSize( maxTaskWorkGroupSize_ ) - , maxTaskPayloadSize( maxTaskPayloadSize_ ) - , maxTaskSharedMemorySize( maxTaskSharedMemorySize_ ) - , maxTaskPayloadAndSharedMemorySize( maxTaskPayloadAndSharedMemorySize_ ) - , maxMeshWorkGroupTotalCount( maxMeshWorkGroupTotalCount_ ) - , maxMeshWorkGroupCount( maxMeshWorkGroupCount_ ) - , maxMeshWorkGroupInvocations( maxMeshWorkGroupInvocations_ ) - , maxMeshWorkGroupSize( maxMeshWorkGroupSize_ ) - , maxMeshSharedMemorySize( maxMeshSharedMemorySize_ ) - , maxMeshPayloadAndSharedMemorySize( maxMeshPayloadAndSharedMemorySize_ ) - , maxMeshOutputMemorySize( maxMeshOutputMemorySize_ ) - , maxMeshPayloadAndOutputMemorySize( maxMeshPayloadAndOutputMemorySize_ ) - , maxMeshOutputComponents( maxMeshOutputComponents_ ) - , maxMeshOutputVertices( maxMeshOutputVertices_ ) - , maxMeshOutputPrimitives( maxMeshOutputPrimitives_ ) - , maxMeshOutputLayers( maxMeshOutputLayers_ ) - , maxMeshMultiviewViewCount( maxMeshMultiviewViewCount_ ) - , meshOutputPerVertexGranularity( meshOutputPerVertexGranularity_ ) - , meshOutputPerPrimitiveGranularity( meshOutputPerPrimitiveGranularity_ ) - , maxPreferredTaskWorkGroupInvocations( maxPreferredTaskWorkGroupInvocations_ ) - , maxPreferredMeshWorkGroupInvocations( maxPreferredMeshWorkGroupInvocations_ ) - , prefersLocalInvocationVertexOutput( prefersLocalInvocationVertexOutput_ ) - , prefersLocalInvocationPrimitiveOutput( prefersLocalInvocationPrimitiveOutput_ ) - , prefersCompactVertexOutput( prefersCompactVertexOutput_ ) - , prefersCompactPrimitiveOutput( prefersCompactPrimitiveOutput_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderPropertiesEXT( PhysicalDeviceMeshShaderPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderPropertiesEXT( VkPhysicalDeviceMeshShaderPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMeshShaderPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMeshShaderPropertiesEXT & operator=( PhysicalDeviceMeshShaderPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderPropertiesEXT & operator=( VkPhysicalDeviceMeshShaderPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMeshShaderPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMeshShaderPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxTaskWorkGroupTotalCount, - maxTaskWorkGroupCount, - maxTaskWorkGroupInvocations, - maxTaskWorkGroupSize, - maxTaskPayloadSize, - maxTaskSharedMemorySize, - maxTaskPayloadAndSharedMemorySize, - maxMeshWorkGroupTotalCount, - maxMeshWorkGroupCount, - maxMeshWorkGroupInvocations, - maxMeshWorkGroupSize, - maxMeshSharedMemorySize, - maxMeshPayloadAndSharedMemorySize, - maxMeshOutputMemorySize, - maxMeshPayloadAndOutputMemorySize, - maxMeshOutputComponents, - maxMeshOutputVertices, - maxMeshOutputPrimitives, - maxMeshOutputLayers, - maxMeshMultiviewViewCount, - meshOutputPerVertexGranularity, - meshOutputPerPrimitiveGranularity, - maxPreferredTaskWorkGroupInvocations, - maxPreferredMeshWorkGroupInvocations, - prefersLocalInvocationVertexOutput, - prefersLocalInvocationPrimitiveOutput, - prefersCompactVertexOutput, - prefersCompactPrimitiveOutput ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMeshShaderPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMeshShaderPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxTaskWorkGroupTotalCount == rhs.maxTaskWorkGroupTotalCount ) && - ( maxTaskWorkGroupCount == rhs.maxTaskWorkGroupCount ) && ( maxTaskWorkGroupInvocations == rhs.maxTaskWorkGroupInvocations ) && - ( maxTaskWorkGroupSize == rhs.maxTaskWorkGroupSize ) && ( maxTaskPayloadSize == rhs.maxTaskPayloadSize ) && - ( maxTaskSharedMemorySize == rhs.maxTaskSharedMemorySize ) && ( maxTaskPayloadAndSharedMemorySize == rhs.maxTaskPayloadAndSharedMemorySize ) && - ( maxMeshWorkGroupTotalCount == rhs.maxMeshWorkGroupTotalCount ) && ( maxMeshWorkGroupCount == rhs.maxMeshWorkGroupCount ) && - ( maxMeshWorkGroupInvocations == rhs.maxMeshWorkGroupInvocations ) && ( maxMeshWorkGroupSize == rhs.maxMeshWorkGroupSize ) && - ( maxMeshSharedMemorySize == rhs.maxMeshSharedMemorySize ) && ( maxMeshPayloadAndSharedMemorySize == rhs.maxMeshPayloadAndSharedMemorySize ) && - ( maxMeshOutputMemorySize == rhs.maxMeshOutputMemorySize ) && ( maxMeshPayloadAndOutputMemorySize == rhs.maxMeshPayloadAndOutputMemorySize ) && - ( maxMeshOutputComponents == rhs.maxMeshOutputComponents ) && ( maxMeshOutputVertices == rhs.maxMeshOutputVertices ) && - ( maxMeshOutputPrimitives == rhs.maxMeshOutputPrimitives ) && ( maxMeshOutputLayers == rhs.maxMeshOutputLayers ) && - ( maxMeshMultiviewViewCount == rhs.maxMeshMultiviewViewCount ) && ( meshOutputPerVertexGranularity == rhs.meshOutputPerVertexGranularity ) && - ( meshOutputPerPrimitiveGranularity == rhs.meshOutputPerPrimitiveGranularity ) && - ( maxPreferredTaskWorkGroupInvocations == rhs.maxPreferredTaskWorkGroupInvocations ) && - ( maxPreferredMeshWorkGroupInvocations == rhs.maxPreferredMeshWorkGroupInvocations ) && - ( prefersLocalInvocationVertexOutput == rhs.prefersLocalInvocationVertexOutput ) && - ( prefersLocalInvocationPrimitiveOutput == rhs.prefersLocalInvocationPrimitiveOutput ) && - ( prefersCompactVertexOutput == rhs.prefersCompactVertexOutput ) && ( prefersCompactPrimitiveOutput == rhs.prefersCompactPrimitiveOutput ); -# endif - } - - bool operator!=( PhysicalDeviceMeshShaderPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMeshShaderPropertiesEXT; - void * pNext = {}; - uint32_t maxTaskWorkGroupTotalCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxTaskWorkGroupCount = {}; - uint32_t maxTaskWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxTaskWorkGroupSize = {}; - uint32_t maxTaskPayloadSize = {}; - uint32_t maxTaskSharedMemorySize = {}; - uint32_t maxTaskPayloadAndSharedMemorySize = {}; - uint32_t maxMeshWorkGroupTotalCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxMeshWorkGroupCount = {}; - uint32_t maxMeshWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxMeshWorkGroupSize = {}; - uint32_t maxMeshSharedMemorySize = {}; - uint32_t maxMeshPayloadAndSharedMemorySize = {}; - uint32_t maxMeshOutputMemorySize = {}; - uint32_t maxMeshPayloadAndOutputMemorySize = {}; - uint32_t maxMeshOutputComponents = {}; - uint32_t maxMeshOutputVertices = {}; - uint32_t maxMeshOutputPrimitives = {}; - uint32_t maxMeshOutputLayers = {}; - uint32_t maxMeshMultiviewViewCount = {}; - uint32_t meshOutputPerVertexGranularity = {}; - uint32_t meshOutputPerPrimitiveGranularity = {}; - uint32_t maxPreferredTaskWorkGroupInvocations = {}; - uint32_t maxPreferredMeshWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::Bool32 prefersLocalInvocationVertexOutput = {}; - VULKAN_HPP_NAMESPACE::Bool32 prefersLocalInvocationPrimitiveOutput = {}; - VULKAN_HPP_NAMESPACE::Bool32 prefersCompactVertexOutput = {}; - VULKAN_HPP_NAMESPACE::Bool32 prefersCompactPrimitiveOutput = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMeshShaderPropertiesEXT; - }; - - struct PhysicalDeviceMeshShaderPropertiesNV - { - using NativeType = VkPhysicalDeviceMeshShaderPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMeshShaderPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderPropertiesNV( uint32_t maxDrawMeshTasksCount_ = {}, - uint32_t maxTaskWorkGroupInvocations_ = {}, - std::array const & maxTaskWorkGroupSize_ = {}, - uint32_t maxTaskTotalMemorySize_ = {}, - uint32_t maxTaskOutputCount_ = {}, - uint32_t maxMeshWorkGroupInvocations_ = {}, - std::array const & maxMeshWorkGroupSize_ = {}, - uint32_t maxMeshTotalMemorySize_ = {}, - uint32_t maxMeshOutputVertices_ = {}, - uint32_t maxMeshOutputPrimitives_ = {}, - uint32_t maxMeshMultiviewViewCount_ = {}, - uint32_t meshOutputPerVertexGranularity_ = {}, - uint32_t meshOutputPerPrimitiveGranularity_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxDrawMeshTasksCount( maxDrawMeshTasksCount_ ) - , maxTaskWorkGroupInvocations( maxTaskWorkGroupInvocations_ ) - , maxTaskWorkGroupSize( maxTaskWorkGroupSize_ ) - , maxTaskTotalMemorySize( maxTaskTotalMemorySize_ ) - , maxTaskOutputCount( maxTaskOutputCount_ ) - , maxMeshWorkGroupInvocations( maxMeshWorkGroupInvocations_ ) - , maxMeshWorkGroupSize( maxMeshWorkGroupSize_ ) - , maxMeshTotalMemorySize( maxMeshTotalMemorySize_ ) - , maxMeshOutputVertices( maxMeshOutputVertices_ ) - , maxMeshOutputPrimitives( maxMeshOutputPrimitives_ ) - , maxMeshMultiviewViewCount( maxMeshMultiviewViewCount_ ) - , meshOutputPerVertexGranularity( meshOutputPerVertexGranularity_ ) - , meshOutputPerPrimitiveGranularity( meshOutputPerPrimitiveGranularity_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMeshShaderPropertiesNV( PhysicalDeviceMeshShaderPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderPropertiesNV( VkPhysicalDeviceMeshShaderPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMeshShaderPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMeshShaderPropertiesNV & operator=( PhysicalDeviceMeshShaderPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMeshShaderPropertiesNV & operator=( VkPhysicalDeviceMeshShaderPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMeshShaderPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMeshShaderPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxDrawMeshTasksCount, - maxTaskWorkGroupInvocations, - maxTaskWorkGroupSize, - maxTaskTotalMemorySize, - maxTaskOutputCount, - maxMeshWorkGroupInvocations, - maxMeshWorkGroupSize, - maxMeshTotalMemorySize, - maxMeshOutputVertices, - maxMeshOutputPrimitives, - maxMeshMultiviewViewCount, - meshOutputPerVertexGranularity, - meshOutputPerPrimitiveGranularity ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMeshShaderPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceMeshShaderPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxDrawMeshTasksCount == rhs.maxDrawMeshTasksCount ) && - ( maxTaskWorkGroupInvocations == rhs.maxTaskWorkGroupInvocations ) && ( maxTaskWorkGroupSize == rhs.maxTaskWorkGroupSize ) && - ( maxTaskTotalMemorySize == rhs.maxTaskTotalMemorySize ) && ( maxTaskOutputCount == rhs.maxTaskOutputCount ) && - ( maxMeshWorkGroupInvocations == rhs.maxMeshWorkGroupInvocations ) && ( maxMeshWorkGroupSize == rhs.maxMeshWorkGroupSize ) && - ( maxMeshTotalMemorySize == rhs.maxMeshTotalMemorySize ) && ( maxMeshOutputVertices == rhs.maxMeshOutputVertices ) && - ( maxMeshOutputPrimitives == rhs.maxMeshOutputPrimitives ) && ( maxMeshMultiviewViewCount == rhs.maxMeshMultiviewViewCount ) && - ( meshOutputPerVertexGranularity == rhs.meshOutputPerVertexGranularity ) && - ( meshOutputPerPrimitiveGranularity == rhs.meshOutputPerPrimitiveGranularity ); -# endif - } - - bool operator!=( PhysicalDeviceMeshShaderPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMeshShaderPropertiesNV; - void * pNext = {}; - uint32_t maxDrawMeshTasksCount = {}; - uint32_t maxTaskWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxTaskWorkGroupSize = {}; - uint32_t maxTaskTotalMemorySize = {}; - uint32_t maxTaskOutputCount = {}; - uint32_t maxMeshWorkGroupInvocations = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D maxMeshWorkGroupSize = {}; - uint32_t maxMeshTotalMemorySize = {}; - uint32_t maxMeshOutputVertices = {}; - uint32_t maxMeshOutputPrimitives = {}; - uint32_t maxMeshMultiviewViewCount = {}; - uint32_t meshOutputPerVertexGranularity = {}; - uint32_t meshOutputPerPrimitiveGranularity = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMeshShaderPropertiesNV; - }; - - struct PhysicalDeviceMultiDrawFeaturesEXT - { - using NativeType = VkPhysicalDeviceMultiDrawFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultiDrawFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiDrawFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 multiDraw_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , multiDraw( multiDraw_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiDrawFeaturesEXT( PhysicalDeviceMultiDrawFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiDrawFeaturesEXT( VkPhysicalDeviceMultiDrawFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultiDrawFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultiDrawFeaturesEXT & operator=( PhysicalDeviceMultiDrawFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiDrawFeaturesEXT & operator=( VkPhysicalDeviceMultiDrawFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiDrawFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiDrawFeaturesEXT & setMultiDraw( VULKAN_HPP_NAMESPACE::Bool32 multiDraw_ ) VULKAN_HPP_NOEXCEPT - { - multiDraw = multiDraw_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMultiDrawFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultiDrawFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, multiDraw ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultiDrawFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMultiDrawFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( multiDraw == rhs.multiDraw ); -# endif - } - - bool operator!=( PhysicalDeviceMultiDrawFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultiDrawFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiDraw = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultiDrawFeaturesEXT; - }; - - struct PhysicalDeviceMultiDrawPropertiesEXT - { - using NativeType = VkPhysicalDeviceMultiDrawPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultiDrawPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiDrawPropertiesEXT( uint32_t maxMultiDrawCount_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxMultiDrawCount( maxMultiDrawCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiDrawPropertiesEXT( PhysicalDeviceMultiDrawPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiDrawPropertiesEXT( VkPhysicalDeviceMultiDrawPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultiDrawPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultiDrawPropertiesEXT & operator=( PhysicalDeviceMultiDrawPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiDrawPropertiesEXT & operator=( VkPhysicalDeviceMultiDrawPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMultiDrawPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultiDrawPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxMultiDrawCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultiDrawPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMultiDrawPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxMultiDrawCount == rhs.maxMultiDrawCount ); -# endif - } - - bool operator!=( PhysicalDeviceMultiDrawPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultiDrawPropertiesEXT; - void * pNext = {}; - uint32_t maxMultiDrawCount = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultiDrawPropertiesEXT; - }; - - struct PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT - { - using NativeType = VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampled_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , multisampledRenderToSingleSampled( multisampledRenderToSingleSampled_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT( PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT( VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT( - *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT & - operator=( PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT & - operator=( VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT & - setMultisampledRenderToSingleSampled( VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampled_ ) VULKAN_HPP_NOEXCEPT - { - multisampledRenderToSingleSampled = multisampledRenderToSingleSampled_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, multisampledRenderToSingleSampled ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( multisampledRenderToSingleSampled == rhs.multisampledRenderToSingleSampled ); -# endif - } - - bool operator!=( PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 multisampledRenderToSingleSampled = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT; - }; - - struct PhysicalDeviceMultiviewFeatures - { - using NativeType = VkPhysicalDeviceMultiviewFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultiviewFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiviewFeatures( VULKAN_HPP_NAMESPACE::Bool32 multiview_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , multiview( multiview_ ) - , multiviewGeometryShader( multiviewGeometryShader_ ) - , multiviewTessellationShader( multiviewTessellationShader_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiviewFeatures( PhysicalDeviceMultiviewFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewFeatures( VkPhysicalDeviceMultiviewFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultiviewFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultiviewFeatures & operator=( PhysicalDeviceMultiviewFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewFeatures & operator=( VkPhysicalDeviceMultiviewFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiviewFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiviewFeatures & setMultiview( VULKAN_HPP_NAMESPACE::Bool32 multiview_ ) VULKAN_HPP_NOEXCEPT - { - multiview = multiview_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiviewFeatures & - setMultiviewGeometryShader( VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader_ ) VULKAN_HPP_NOEXCEPT - { - multiviewGeometryShader = multiviewGeometryShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMultiviewFeatures & - setMultiviewTessellationShader( VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader_ ) VULKAN_HPP_NOEXCEPT - { - multiviewTessellationShader = multiviewTessellationShader_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMultiviewFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultiviewFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, multiview, multiviewGeometryShader, multiviewTessellationShader ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultiviewFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceMultiviewFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( multiview == rhs.multiview ) && ( multiviewGeometryShader == rhs.multiviewGeometryShader ) && - ( multiviewTessellationShader == rhs.multiviewTessellationShader ); -# endif - } - - bool operator!=( PhysicalDeviceMultiviewFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultiviewFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiview = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultiviewFeatures; - }; - using PhysicalDeviceMultiviewFeaturesKHR = PhysicalDeviceMultiviewFeatures; - - struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX - { - using NativeType = VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX( VULKAN_HPP_NAMESPACE::Bool32 perViewPositionAllComponents_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , perViewPositionAllComponents( perViewPositionAllComponents_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX & - operator=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX & operator=( VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, perViewPositionAllComponents ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & ) const = default; -#else - bool operator==( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( perViewPositionAllComponents == rhs.perViewPositionAllComponents ); -# endif - } - - bool operator!=( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 perViewPositionAllComponents = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX; - }; - - struct PhysicalDeviceMultiviewProperties - { - using NativeType = VkPhysicalDeviceMultiviewProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMultiviewProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiviewProperties( uint32_t maxMultiviewViewCount_ = {}, - uint32_t maxMultiviewInstanceIndex_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxMultiviewViewCount( maxMultiviewViewCount_ ) - , maxMultiviewInstanceIndex( maxMultiviewInstanceIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceMultiviewProperties( PhysicalDeviceMultiviewProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewProperties( VkPhysicalDeviceMultiviewProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMultiviewProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMultiviewProperties & operator=( PhysicalDeviceMultiviewProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMultiviewProperties & operator=( VkPhysicalDeviceMultiviewProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceMultiviewProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMultiviewProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxMultiviewViewCount, maxMultiviewInstanceIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMultiviewProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceMultiviewProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) && - ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ); -# endif - } - - bool operator!=( PhysicalDeviceMultiviewProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMultiviewProperties; - void * pNext = {}; - uint32_t maxMultiviewViewCount = {}; - uint32_t maxMultiviewInstanceIndex = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMultiviewProperties; - }; - using PhysicalDeviceMultiviewPropertiesKHR = PhysicalDeviceMultiviewProperties; - - struct PhysicalDeviceMutableDescriptorTypeFeaturesVALVE - { - using NativeType = VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceMutableDescriptorTypeFeaturesVALVE( VULKAN_HPP_NAMESPACE::Bool32 mutableDescriptorType_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mutableDescriptorType( mutableDescriptorType_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceMutableDescriptorTypeFeaturesVALVE( PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMutableDescriptorTypeFeaturesVALVE( VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceMutableDescriptorTypeFeaturesVALVE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceMutableDescriptorTypeFeaturesVALVE & operator=( PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceMutableDescriptorTypeFeaturesVALVE & operator=( VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMutableDescriptorTypeFeaturesVALVE & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceMutableDescriptorTypeFeaturesVALVE & - setMutableDescriptorType( VULKAN_HPP_NAMESPACE::Bool32 mutableDescriptorType_ ) VULKAN_HPP_NOEXCEPT - { - mutableDescriptorType = mutableDescriptorType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mutableDescriptorType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & ) const = default; -#else - bool operator==( PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mutableDescriptorType == rhs.mutableDescriptorType ); -# endif - } - - bool operator!=( PhysicalDeviceMutableDescriptorTypeFeaturesVALVE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 mutableDescriptorType = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceMutableDescriptorTypeFeaturesVALVE; - }; - - struct PhysicalDeviceNonSeamlessCubeMapFeaturesEXT - { - using NativeType = VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceNonSeamlessCubeMapFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 nonSeamlessCubeMap_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , nonSeamlessCubeMap( nonSeamlessCubeMap_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceNonSeamlessCubeMapFeaturesEXT( PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceNonSeamlessCubeMapFeaturesEXT( VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceNonSeamlessCubeMapFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceNonSeamlessCubeMapFeaturesEXT & operator=( PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceNonSeamlessCubeMapFeaturesEXT & operator=( VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNonSeamlessCubeMapFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceNonSeamlessCubeMapFeaturesEXT & - setNonSeamlessCubeMap( VULKAN_HPP_NAMESPACE::Bool32 nonSeamlessCubeMap_ ) VULKAN_HPP_NOEXCEPT - { - nonSeamlessCubeMap = nonSeamlessCubeMap_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, nonSeamlessCubeMap ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( nonSeamlessCubeMap == rhs.nonSeamlessCubeMap ); -# endif - } - - bool operator!=( PhysicalDeviceNonSeamlessCubeMapFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 nonSeamlessCubeMap = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceNonSeamlessCubeMapFeaturesEXT; - }; - - struct PhysicalDevicePCIBusInfoPropertiesEXT - { - using NativeType = VkPhysicalDevicePCIBusInfoPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePciBusInfoPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePCIBusInfoPropertiesEXT( - uint32_t pciDomain_ = {}, uint32_t pciBus_ = {}, uint32_t pciDevice_ = {}, uint32_t pciFunction_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pciDomain( pciDomain_ ) - , pciBus( pciBus_ ) - , pciDevice( pciDevice_ ) - , pciFunction( pciFunction_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePCIBusInfoPropertiesEXT( PhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePCIBusInfoPropertiesEXT( VkPhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePCIBusInfoPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePCIBusInfoPropertiesEXT & operator=( PhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePCIBusInfoPropertiesEXT & operator=( VkPhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDevicePCIBusInfoPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePCIBusInfoPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pciDomain, pciBus, pciDevice, pciFunction ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePCIBusInfoPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pciDomain == rhs.pciDomain ) && ( pciBus == rhs.pciBus ) && ( pciDevice == rhs.pciDevice ) && - ( pciFunction == rhs.pciFunction ); -# endif - } - - bool operator!=( PhysicalDevicePCIBusInfoPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePciBusInfoPropertiesEXT; - void * pNext = {}; - uint32_t pciDomain = {}; - uint32_t pciBus = {}; - uint32_t pciDevice = {}; - uint32_t pciFunction = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePCIBusInfoPropertiesEXT; - }; - - struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT - { - using NativeType = VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 pageableDeviceLocalMemory_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pageableDeviceLocalMemory( pageableDeviceLocalMemory_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT( PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT( VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT & - operator=( PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT & operator=( VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT & - setPageableDeviceLocalMemory( VULKAN_HPP_NAMESPACE::Bool32 pageableDeviceLocalMemory_ ) VULKAN_HPP_NOEXCEPT - { - pageableDeviceLocalMemory = pageableDeviceLocalMemory_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pageableDeviceLocalMemory ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pageableDeviceLocalMemory == rhs.pageableDeviceLocalMemory ); -# endif - } - - bool operator!=( PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pageableDeviceLocalMemory = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT; - }; - - struct PhysicalDevicePerformanceQueryFeaturesKHR - { - using NativeType = VkPhysicalDevicePerformanceQueryFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePerformanceQueryFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePerformanceQueryFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 performanceCounterQueryPools_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 performanceCounterMultipleQueryPools_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , performanceCounterQueryPools( performanceCounterQueryPools_ ) - , performanceCounterMultipleQueryPools( performanceCounterMultipleQueryPools_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePerformanceQueryFeaturesKHR( PhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePerformanceQueryFeaturesKHR( VkPhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePerformanceQueryFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePerformanceQueryFeaturesKHR & operator=( PhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePerformanceQueryFeaturesKHR & operator=( VkPhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePerformanceQueryFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePerformanceQueryFeaturesKHR & - setPerformanceCounterQueryPools( VULKAN_HPP_NAMESPACE::Bool32 performanceCounterQueryPools_ ) VULKAN_HPP_NOEXCEPT - { - performanceCounterQueryPools = performanceCounterQueryPools_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePerformanceQueryFeaturesKHR & - setPerformanceCounterMultipleQueryPools( VULKAN_HPP_NAMESPACE::Bool32 performanceCounterMultipleQueryPools_ ) VULKAN_HPP_NOEXCEPT - { - performanceCounterMultipleQueryPools = performanceCounterMultipleQueryPools_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePerformanceQueryFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePerformanceQueryFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, performanceCounterQueryPools, performanceCounterMultipleQueryPools ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePerformanceQueryFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( performanceCounterQueryPools == rhs.performanceCounterQueryPools ) && - ( performanceCounterMultipleQueryPools == rhs.performanceCounterMultipleQueryPools ); -# endif - } - - bool operator!=( PhysicalDevicePerformanceQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePerformanceQueryFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 performanceCounterQueryPools = {}; - VULKAN_HPP_NAMESPACE::Bool32 performanceCounterMultipleQueryPools = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePerformanceQueryFeaturesKHR; - }; - - struct PhysicalDevicePerformanceQueryPropertiesKHR - { - using NativeType = VkPhysicalDevicePerformanceQueryPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePerformanceQueryPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePerformanceQueryPropertiesKHR( VULKAN_HPP_NAMESPACE::Bool32 allowCommandBufferQueryCopies_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , allowCommandBufferQueryCopies( allowCommandBufferQueryCopies_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePerformanceQueryPropertiesKHR( PhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePerformanceQueryPropertiesKHR( VkPhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePerformanceQueryPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePerformanceQueryPropertiesKHR & operator=( PhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePerformanceQueryPropertiesKHR & operator=( VkPhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDevicePerformanceQueryPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePerformanceQueryPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, allowCommandBufferQueryCopies ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePerformanceQueryPropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( allowCommandBufferQueryCopies == rhs.allowCommandBufferQueryCopies ); -# endif - } - - bool operator!=( PhysicalDevicePerformanceQueryPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePerformanceQueryPropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 allowCommandBufferQueryCopies = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePerformanceQueryPropertiesKHR; - }; - - struct PhysicalDevicePipelineCreationCacheControlFeatures - { - using NativeType = VkPhysicalDevicePipelineCreationCacheControlFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePipelineCreationCacheControlFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelineCreationCacheControlFeatures( VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineCreationCacheControl( pipelineCreationCacheControl_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePipelineCreationCacheControlFeatures( PhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineCreationCacheControlFeatures( VkPhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePipelineCreationCacheControlFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePipelineCreationCacheControlFeatures & - operator=( PhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineCreationCacheControlFeatures & operator=( VkPhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineCreationCacheControlFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineCreationCacheControlFeatures & - setPipelineCreationCacheControl( VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl_ ) VULKAN_HPP_NOEXCEPT - { - pipelineCreationCacheControl = pipelineCreationCacheControl_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePipelineCreationCacheControlFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePipelineCreationCacheControlFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineCreationCacheControl ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePipelineCreationCacheControlFeatures const & ) const = default; -#else - bool operator==( PhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineCreationCacheControl == rhs.pipelineCreationCacheControl ); -# endif - } - - bool operator!=( PhysicalDevicePipelineCreationCacheControlFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePipelineCreationCacheControlFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePipelineCreationCacheControlFeatures; - }; - using PhysicalDevicePipelineCreationCacheControlFeaturesEXT = PhysicalDevicePipelineCreationCacheControlFeatures; - - struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR - { - using NativeType = VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelineExecutablePropertiesFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 pipelineExecutableInfo_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineExecutableInfo( pipelineExecutableInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePipelineExecutablePropertiesFeaturesKHR( PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineExecutablePropertiesFeaturesKHR( VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePipelineExecutablePropertiesFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePipelineExecutablePropertiesFeaturesKHR & - operator=( PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineExecutablePropertiesFeaturesKHR & operator=( VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineExecutablePropertiesFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineExecutablePropertiesFeaturesKHR & - setPipelineExecutableInfo( VULKAN_HPP_NAMESPACE::Bool32 pipelineExecutableInfo_ ) VULKAN_HPP_NOEXCEPT - { - pipelineExecutableInfo = pipelineExecutableInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineExecutableInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineExecutableInfo == rhs.pipelineExecutableInfo ); -# endif - } - - bool operator!=( PhysicalDevicePipelineExecutablePropertiesFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineExecutableInfo = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePipelineExecutablePropertiesFeaturesKHR; - }; - - struct PhysicalDevicePipelinePropertiesFeaturesEXT - { - using NativeType = VkPhysicalDevicePipelinePropertiesFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePipelinePropertiesFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelinePropertiesFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 pipelinePropertiesIdentifier_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelinePropertiesIdentifier( pipelinePropertiesIdentifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelinePropertiesFeaturesEXT( PhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelinePropertiesFeaturesEXT( VkPhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePipelinePropertiesFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePipelinePropertiesFeaturesEXT & operator=( PhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelinePropertiesFeaturesEXT & operator=( VkPhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelinePropertiesFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelinePropertiesFeaturesEXT & - setPipelinePropertiesIdentifier( VULKAN_HPP_NAMESPACE::Bool32 pipelinePropertiesIdentifier_ ) VULKAN_HPP_NOEXCEPT - { - pipelinePropertiesIdentifier = pipelinePropertiesIdentifier_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePipelinePropertiesFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePipelinePropertiesFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelinePropertiesIdentifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePipelinePropertiesFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelinePropertiesIdentifier == rhs.pipelinePropertiesIdentifier ); -# endif - } - - bool operator!=( PhysicalDevicePipelinePropertiesFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePipelinePropertiesFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelinePropertiesIdentifier = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePipelinePropertiesFeaturesEXT; - }; - - struct PhysicalDevicePipelineRobustnessFeaturesEXT - { - using NativeType = VkPhysicalDevicePipelineRobustnessFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePipelineRobustnessFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelineRobustnessFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 pipelineRobustness_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineRobustness( pipelineRobustness_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePipelineRobustnessFeaturesEXT( PhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineRobustnessFeaturesEXT( VkPhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePipelineRobustnessFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePipelineRobustnessFeaturesEXT & operator=( PhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineRobustnessFeaturesEXT & operator=( VkPhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineRobustnessFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePipelineRobustnessFeaturesEXT & - setPipelineRobustness( VULKAN_HPP_NAMESPACE::Bool32 pipelineRobustness_ ) VULKAN_HPP_NOEXCEPT - { - pipelineRobustness = pipelineRobustness_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePipelineRobustnessFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePipelineRobustnessFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineRobustness ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePipelineRobustnessFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineRobustness == rhs.pipelineRobustness ); -# endif - } - - bool operator!=( PhysicalDevicePipelineRobustnessFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePipelineRobustnessFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineRobustness = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePipelineRobustnessFeaturesEXT; - }; - - struct PhysicalDevicePipelineRobustnessPropertiesEXT - { - using NativeType = VkPhysicalDevicePipelineRobustnessPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePipelineRobustnessPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDevicePipelineRobustnessPropertiesEXT( VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers_ = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers_ = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs_ = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT defaultRobustnessImages_ = - VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT::eDeviceDefault, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , defaultRobustnessStorageBuffers( defaultRobustnessStorageBuffers_ ) - , defaultRobustnessUniformBuffers( defaultRobustnessUniformBuffers_ ) - , defaultRobustnessVertexInputs( defaultRobustnessVertexInputs_ ) - , defaultRobustnessImages( defaultRobustnessImages_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePipelineRobustnessPropertiesEXT( PhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineRobustnessPropertiesEXT( VkPhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePipelineRobustnessPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePipelineRobustnessPropertiesEXT & operator=( PhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePipelineRobustnessPropertiesEXT & operator=( VkPhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDevicePipelineRobustnessPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePipelineRobustnessPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, defaultRobustnessStorageBuffers, defaultRobustnessUniformBuffers, defaultRobustnessVertexInputs, defaultRobustnessImages ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePipelineRobustnessPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( defaultRobustnessStorageBuffers == rhs.defaultRobustnessStorageBuffers ) && - ( defaultRobustnessUniformBuffers == rhs.defaultRobustnessUniformBuffers ) && - ( defaultRobustnessVertexInputs == rhs.defaultRobustnessVertexInputs ) && ( defaultRobustnessImages == rhs.defaultRobustnessImages ); -# endif - } - - bool operator!=( PhysicalDevicePipelineRobustnessPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePipelineRobustnessPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs = - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT defaultRobustnessImages = VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT::eDeviceDefault; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePipelineRobustnessPropertiesEXT; - }; - - struct PhysicalDevicePointClippingProperties - { - using NativeType = VkPhysicalDevicePointClippingProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePointClippingProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePointClippingProperties( - VULKAN_HPP_NAMESPACE::PointClippingBehavior pointClippingBehavior_ = VULKAN_HPP_NAMESPACE::PointClippingBehavior::eAllClipPlanes, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pointClippingBehavior( pointClippingBehavior_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePointClippingProperties( PhysicalDevicePointClippingProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePointClippingProperties( VkPhysicalDevicePointClippingProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePointClippingProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePointClippingProperties & operator=( PhysicalDevicePointClippingProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePointClippingProperties & operator=( VkPhysicalDevicePointClippingProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDevicePointClippingProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePointClippingProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pointClippingBehavior ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePointClippingProperties const & ) const = default; -#else - bool operator==( PhysicalDevicePointClippingProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pointClippingBehavior == rhs.pointClippingBehavior ); -# endif - } - - bool operator!=( PhysicalDevicePointClippingProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePointClippingProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PointClippingBehavior pointClippingBehavior = VULKAN_HPP_NAMESPACE::PointClippingBehavior::eAllClipPlanes; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePointClippingProperties; - }; - using PhysicalDevicePointClippingPropertiesKHR = PhysicalDevicePointClippingProperties; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct PhysicalDevicePortabilitySubsetFeaturesKHR - { - using NativeType = VkPhysicalDevicePortabilitySubsetFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePortabilitySubsetFeaturesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePortabilitySubsetFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 constantAlphaColorBlendFactors_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 events_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatReinterpretation_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatSwizzle_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 imageView2DOn3DImage_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multisampleArrayImage_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 mutableComparisonSamplers_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 pointPolygons_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 samplerMipLodBias_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 separateStencilMaskRef_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampleRateInterpolationFunctions_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 tessellationIsolines_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 tessellationPointMode_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 triangleFans_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeAccessBeyondStride_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , constantAlphaColorBlendFactors( constantAlphaColorBlendFactors_ ) - , events( events_ ) - , imageViewFormatReinterpretation( imageViewFormatReinterpretation_ ) - , imageViewFormatSwizzle( imageViewFormatSwizzle_ ) - , imageView2DOn3DImage( imageView2DOn3DImage_ ) - , multisampleArrayImage( multisampleArrayImage_ ) - , mutableComparisonSamplers( mutableComparisonSamplers_ ) - , pointPolygons( pointPolygons_ ) - , samplerMipLodBias( samplerMipLodBias_ ) - , separateStencilMaskRef( separateStencilMaskRef_ ) - , shaderSampleRateInterpolationFunctions( shaderSampleRateInterpolationFunctions_ ) - , tessellationIsolines( tessellationIsolines_ ) - , tessellationPointMode( tessellationPointMode_ ) - , triangleFans( triangleFans_ ) - , vertexAttributeAccessBeyondStride( vertexAttributeAccessBeyondStride_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePortabilitySubsetFeaturesKHR( PhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePortabilitySubsetFeaturesKHR( VkPhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePortabilitySubsetFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePortabilitySubsetFeaturesKHR & operator=( PhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePortabilitySubsetFeaturesKHR & operator=( VkPhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setConstantAlphaColorBlendFactors( VULKAN_HPP_NAMESPACE::Bool32 constantAlphaColorBlendFactors_ ) VULKAN_HPP_NOEXCEPT - { - constantAlphaColorBlendFactors = constantAlphaColorBlendFactors_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & setEvents( VULKAN_HPP_NAMESPACE::Bool32 events_ ) VULKAN_HPP_NOEXCEPT - { - events = events_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setImageViewFormatReinterpretation( VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatReinterpretation_ ) VULKAN_HPP_NOEXCEPT - { - imageViewFormatReinterpretation = imageViewFormatReinterpretation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setImageViewFormatSwizzle( VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatSwizzle_ ) VULKAN_HPP_NOEXCEPT - { - imageViewFormatSwizzle = imageViewFormatSwizzle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setImageView2DOn3DImage( VULKAN_HPP_NAMESPACE::Bool32 imageView2DOn3DImage_ ) VULKAN_HPP_NOEXCEPT - { - imageView2DOn3DImage = imageView2DOn3DImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setMultisampleArrayImage( VULKAN_HPP_NAMESPACE::Bool32 multisampleArrayImage_ ) VULKAN_HPP_NOEXCEPT - { - multisampleArrayImage = multisampleArrayImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setMutableComparisonSamplers( VULKAN_HPP_NAMESPACE::Bool32 mutableComparisonSamplers_ ) VULKAN_HPP_NOEXCEPT - { - mutableComparisonSamplers = mutableComparisonSamplers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & setPointPolygons( VULKAN_HPP_NAMESPACE::Bool32 pointPolygons_ ) VULKAN_HPP_NOEXCEPT - { - pointPolygons = pointPolygons_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setSamplerMipLodBias( VULKAN_HPP_NAMESPACE::Bool32 samplerMipLodBias_ ) VULKAN_HPP_NOEXCEPT - { - samplerMipLodBias = samplerMipLodBias_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setSeparateStencilMaskRef( VULKAN_HPP_NAMESPACE::Bool32 separateStencilMaskRef_ ) VULKAN_HPP_NOEXCEPT - { - separateStencilMaskRef = separateStencilMaskRef_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setShaderSampleRateInterpolationFunctions( VULKAN_HPP_NAMESPACE::Bool32 shaderSampleRateInterpolationFunctions_ ) VULKAN_HPP_NOEXCEPT - { - shaderSampleRateInterpolationFunctions = shaderSampleRateInterpolationFunctions_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setTessellationIsolines( VULKAN_HPP_NAMESPACE::Bool32 tessellationIsolines_ ) VULKAN_HPP_NOEXCEPT - { - tessellationIsolines = tessellationIsolines_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setTessellationPointMode( VULKAN_HPP_NAMESPACE::Bool32 tessellationPointMode_ ) VULKAN_HPP_NOEXCEPT - { - tessellationPointMode = tessellationPointMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & setTriangleFans( VULKAN_HPP_NAMESPACE::Bool32 triangleFans_ ) VULKAN_HPP_NOEXCEPT - { - triangleFans = triangleFans_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetFeaturesKHR & - setVertexAttributeAccessBeyondStride( VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeAccessBeyondStride_ ) VULKAN_HPP_NOEXCEPT - { - vertexAttributeAccessBeyondStride = vertexAttributeAccessBeyondStride_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePortabilitySubsetFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePortabilitySubsetFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - constantAlphaColorBlendFactors, - events, - imageViewFormatReinterpretation, - imageViewFormatSwizzle, - imageView2DOn3DImage, - multisampleArrayImage, - mutableComparisonSamplers, - pointPolygons, - samplerMipLodBias, - separateStencilMaskRef, - shaderSampleRateInterpolationFunctions, - tessellationIsolines, - tessellationPointMode, - triangleFans, - vertexAttributeAccessBeyondStride ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePortabilitySubsetFeaturesKHR const & ) const = default; -# else - bool operator==( PhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( constantAlphaColorBlendFactors == rhs.constantAlphaColorBlendFactors ) && - ( events == rhs.events ) && ( imageViewFormatReinterpretation == rhs.imageViewFormatReinterpretation ) && - ( imageViewFormatSwizzle == rhs.imageViewFormatSwizzle ) && ( imageView2DOn3DImage == rhs.imageView2DOn3DImage ) && - ( multisampleArrayImage == rhs.multisampleArrayImage ) && ( mutableComparisonSamplers == rhs.mutableComparisonSamplers ) && - ( pointPolygons == rhs.pointPolygons ) && ( samplerMipLodBias == rhs.samplerMipLodBias ) && - ( separateStencilMaskRef == rhs.separateStencilMaskRef ) && - ( shaderSampleRateInterpolationFunctions == rhs.shaderSampleRateInterpolationFunctions ) && ( tessellationIsolines == rhs.tessellationIsolines ) && - ( tessellationPointMode == rhs.tessellationPointMode ) && ( triangleFans == rhs.triangleFans ) && - ( vertexAttributeAccessBeyondStride == rhs.vertexAttributeAccessBeyondStride ); -# endif - } - - bool operator!=( PhysicalDevicePortabilitySubsetFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePortabilitySubsetFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 constantAlphaColorBlendFactors = {}; - VULKAN_HPP_NAMESPACE::Bool32 events = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatReinterpretation = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageViewFormatSwizzle = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageView2DOn3DImage = {}; - VULKAN_HPP_NAMESPACE::Bool32 multisampleArrayImage = {}; - VULKAN_HPP_NAMESPACE::Bool32 mutableComparisonSamplers = {}; - VULKAN_HPP_NAMESPACE::Bool32 pointPolygons = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerMipLodBias = {}; - VULKAN_HPP_NAMESPACE::Bool32 separateStencilMaskRef = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampleRateInterpolationFunctions = {}; - VULKAN_HPP_NAMESPACE::Bool32 tessellationIsolines = {}; - VULKAN_HPP_NAMESPACE::Bool32 tessellationPointMode = {}; - VULKAN_HPP_NAMESPACE::Bool32 triangleFans = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeAccessBeyondStride = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePortabilitySubsetFeaturesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct PhysicalDevicePortabilitySubsetPropertiesKHR - { - using NativeType = VkPhysicalDevicePortabilitySubsetPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePortabilitySubsetPropertiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePortabilitySubsetPropertiesKHR( uint32_t minVertexInputBindingStrideAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minVertexInputBindingStrideAlignment( minVertexInputBindingStrideAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePortabilitySubsetPropertiesKHR( PhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePortabilitySubsetPropertiesKHR( VkPhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePortabilitySubsetPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePortabilitySubsetPropertiesKHR & operator=( PhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePortabilitySubsetPropertiesKHR & operator=( VkPhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetPropertiesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePortabilitySubsetPropertiesKHR & - setMinVertexInputBindingStrideAlignment( uint32_t minVertexInputBindingStrideAlignment_ ) VULKAN_HPP_NOEXCEPT - { - minVertexInputBindingStrideAlignment = minVertexInputBindingStrideAlignment_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePortabilitySubsetPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePortabilitySubsetPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minVertexInputBindingStrideAlignment ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePortabilitySubsetPropertiesKHR const & ) const = default; -# else - bool operator==( PhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minVertexInputBindingStrideAlignment == rhs.minVertexInputBindingStrideAlignment ); -# endif - } - - bool operator!=( PhysicalDevicePortabilitySubsetPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePortabilitySubsetPropertiesKHR; - void * pNext = {}; - uint32_t minVertexInputBindingStrideAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePortabilitySubsetPropertiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - struct PhysicalDevicePresentIdFeaturesKHR - { - using NativeType = VkPhysicalDevicePresentIdFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePresentIdFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePresentIdFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 presentId_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , presentId( presentId_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePresentIdFeaturesKHR( PhysicalDevicePresentIdFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePresentIdFeaturesKHR( VkPhysicalDevicePresentIdFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePresentIdFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePresentIdFeaturesKHR & operator=( PhysicalDevicePresentIdFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePresentIdFeaturesKHR & operator=( VkPhysicalDevicePresentIdFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePresentIdFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePresentIdFeaturesKHR & setPresentId( VULKAN_HPP_NAMESPACE::Bool32 presentId_ ) VULKAN_HPP_NOEXCEPT - { - presentId = presentId_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePresentIdFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePresentIdFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, presentId ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePresentIdFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePresentIdFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentId == rhs.presentId ); -# endif - } - - bool operator!=( PhysicalDevicePresentIdFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePresentIdFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 presentId = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePresentIdFeaturesKHR; - }; - - struct PhysicalDevicePresentWaitFeaturesKHR - { - using NativeType = VkPhysicalDevicePresentWaitFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePresentWaitFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePresentWaitFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 presentWait_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , presentWait( presentWait_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePresentWaitFeaturesKHR( PhysicalDevicePresentWaitFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePresentWaitFeaturesKHR( VkPhysicalDevicePresentWaitFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePresentWaitFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePresentWaitFeaturesKHR & operator=( PhysicalDevicePresentWaitFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePresentWaitFeaturesKHR & operator=( VkPhysicalDevicePresentWaitFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePresentWaitFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePresentWaitFeaturesKHR & setPresentWait( VULKAN_HPP_NAMESPACE::Bool32 presentWait_ ) VULKAN_HPP_NOEXCEPT - { - presentWait = presentWait_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePresentWaitFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePresentWaitFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, presentWait ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePresentWaitFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePresentWaitFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( presentWait == rhs.presentWait ); -# endif - } - - bool operator!=( PhysicalDevicePresentWaitFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePresentWaitFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 presentWait = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePresentWaitFeaturesKHR; - }; - - struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT - { - using NativeType = VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyListRestart_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyPatchListRestart_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , primitiveTopologyListRestart( primitiveTopologyListRestart_ ) - , primitiveTopologyPatchListRestart( primitiveTopologyPatchListRestart_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT( PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT( VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT & - operator=( PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT & operator=( VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT & - setPrimitiveTopologyListRestart( VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyListRestart_ ) VULKAN_HPP_NOEXCEPT - { - primitiveTopologyListRestart = primitiveTopologyListRestart_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT & - setPrimitiveTopologyPatchListRestart( VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyPatchListRestart_ ) VULKAN_HPP_NOEXCEPT - { - primitiveTopologyPatchListRestart = primitiveTopologyPatchListRestart_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, primitiveTopologyListRestart, primitiveTopologyPatchListRestart ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( primitiveTopologyListRestart == rhs.primitiveTopologyListRestart ) && - ( primitiveTopologyPatchListRestart == rhs.primitiveTopologyPatchListRestart ); -# endif - } - - bool operator!=( PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyListRestart = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitiveTopologyPatchListRestart = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT; - }; - - struct PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT - { - using NativeType = VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQuery_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithRasterizerDiscard_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithNonZeroStreams_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , primitivesGeneratedQuery( primitivesGeneratedQuery_ ) - , primitivesGeneratedQueryWithRasterizerDiscard( primitivesGeneratedQueryWithRasterizerDiscard_ ) - , primitivesGeneratedQueryWithNonZeroStreams( primitivesGeneratedQueryWithNonZeroStreams_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT( PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT( VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & - operator=( PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & operator=( VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & - setPrimitivesGeneratedQuery( VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQuery_ ) VULKAN_HPP_NOEXCEPT - { - primitivesGeneratedQuery = primitivesGeneratedQuery_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & - setPrimitivesGeneratedQueryWithRasterizerDiscard( VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithRasterizerDiscard_ ) VULKAN_HPP_NOEXCEPT - { - primitivesGeneratedQueryWithRasterizerDiscard = primitivesGeneratedQueryWithRasterizerDiscard_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT & - setPrimitivesGeneratedQueryWithNonZeroStreams( VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithNonZeroStreams_ ) VULKAN_HPP_NOEXCEPT - { - primitivesGeneratedQueryWithNonZeroStreams = primitivesGeneratedQueryWithNonZeroStreams_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, primitivesGeneratedQuery, primitivesGeneratedQueryWithRasterizerDiscard, primitivesGeneratedQueryWithNonZeroStreams ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( primitivesGeneratedQuery == rhs.primitivesGeneratedQuery ) && - ( primitivesGeneratedQueryWithRasterizerDiscard == rhs.primitivesGeneratedQueryWithRasterizerDiscard ) && - ( primitivesGeneratedQueryWithNonZeroStreams == rhs.primitivesGeneratedQueryWithNonZeroStreams ); -# endif - } - - bool operator!=( PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQuery = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithRasterizerDiscard = {}; - VULKAN_HPP_NAMESPACE::Bool32 primitivesGeneratedQueryWithNonZeroStreams = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT; - }; - - struct PhysicalDevicePrivateDataFeatures - { - using NativeType = VkPhysicalDevicePrivateDataFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePrivateDataFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePrivateDataFeatures( VULKAN_HPP_NAMESPACE::Bool32 privateData_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , privateData( privateData_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePrivateDataFeatures( PhysicalDevicePrivateDataFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrivateDataFeatures( VkPhysicalDevicePrivateDataFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePrivateDataFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePrivateDataFeatures & operator=( PhysicalDevicePrivateDataFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePrivateDataFeatures & operator=( VkPhysicalDevicePrivateDataFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrivateDataFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDevicePrivateDataFeatures & setPrivateData( VULKAN_HPP_NAMESPACE::Bool32 privateData_ ) VULKAN_HPP_NOEXCEPT - { - privateData = privateData_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDevicePrivateDataFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePrivateDataFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, privateData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePrivateDataFeatures const & ) const = default; -#else - bool operator==( PhysicalDevicePrivateDataFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( privateData == rhs.privateData ); -# endif - } - - bool operator!=( PhysicalDevicePrivateDataFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePrivateDataFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 privateData = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePrivateDataFeatures; - }; - using PhysicalDevicePrivateDataFeaturesEXT = PhysicalDevicePrivateDataFeatures; - - struct PhysicalDeviceSparseProperties - { - using NativeType = VkPhysicalDeviceSparseProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSparseProperties( VULKAN_HPP_NAMESPACE::Bool32 residencyStandard2DBlockShape_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 residencyStandard2DMultisampleBlockShape_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 residencyStandard3DBlockShape_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 residencyAlignedMipSize_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 residencyNonResidentStrict_ = {} ) VULKAN_HPP_NOEXCEPT - : residencyStandard2DBlockShape( residencyStandard2DBlockShape_ ) - , residencyStandard2DMultisampleBlockShape( residencyStandard2DMultisampleBlockShape_ ) - , residencyStandard3DBlockShape( residencyStandard3DBlockShape_ ) - , residencyAlignedMipSize( residencyAlignedMipSize_ ) - , residencyNonResidentStrict( residencyNonResidentStrict_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSparseProperties( PhysicalDeviceSparseProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSparseProperties( VkPhysicalDeviceSparseProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSparseProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSparseProperties & operator=( PhysicalDeviceSparseProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSparseProperties & operator=( VkPhysicalDeviceSparseProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSparseProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSparseProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( residencyStandard2DBlockShape, - residencyStandard2DMultisampleBlockShape, - residencyStandard3DBlockShape, - residencyAlignedMipSize, - residencyNonResidentStrict ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSparseProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceSparseProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( residencyStandard2DBlockShape == rhs.residencyStandard2DBlockShape ) && - ( residencyStandard2DMultisampleBlockShape == rhs.residencyStandard2DMultisampleBlockShape ) && - ( residencyStandard3DBlockShape == rhs.residencyStandard3DBlockShape ) && ( residencyAlignedMipSize == rhs.residencyAlignedMipSize ) && - ( residencyNonResidentStrict == rhs.residencyNonResidentStrict ); -# endif - } - - bool operator!=( PhysicalDeviceSparseProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Bool32 residencyStandard2DBlockShape = {}; - VULKAN_HPP_NAMESPACE::Bool32 residencyStandard2DMultisampleBlockShape = {}; - VULKAN_HPP_NAMESPACE::Bool32 residencyStandard3DBlockShape = {}; - VULKAN_HPP_NAMESPACE::Bool32 residencyAlignedMipSize = {}; - VULKAN_HPP_NAMESPACE::Bool32 residencyNonResidentStrict = {}; - }; - - struct PhysicalDeviceProperties - { - using NativeType = VkPhysicalDeviceProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProperties( uint32_t apiVersion_ = {}, - uint32_t driverVersion_ = {}, - uint32_t vendorID_ = {}, - uint32_t deviceID_ = {}, - VULKAN_HPP_NAMESPACE::PhysicalDeviceType deviceType_ = VULKAN_HPP_NAMESPACE::PhysicalDeviceType::eOther, - std::array const & deviceName_ = {}, - std::array const & pipelineCacheUUID_ = {}, - VULKAN_HPP_NAMESPACE::PhysicalDeviceLimits limits_ = {}, - VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseProperties sparseProperties_ = {} ) VULKAN_HPP_NOEXCEPT - : apiVersion( apiVersion_ ) - , driverVersion( driverVersion_ ) - , vendorID( vendorID_ ) - , deviceID( deviceID_ ) - , deviceType( deviceType_ ) - , deviceName( deviceName_ ) - , pipelineCacheUUID( pipelineCacheUUID_ ) - , limits( limits_ ) - , sparseProperties( sparseProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProperties( PhysicalDeviceProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProperties( VkPhysicalDeviceProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProperties & operator=( PhysicalDeviceProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProperties & operator=( VkPhysicalDeviceProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::PhysicalDeviceLimits const &, - VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseProperties const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( apiVersion, driverVersion, vendorID, deviceID, deviceType, deviceName, pipelineCacheUUID, limits, sparseProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( apiVersion == rhs.apiVersion ) && ( driverVersion == rhs.driverVersion ) && ( vendorID == rhs.vendorID ) && ( deviceID == rhs.deviceID ) && - ( deviceType == rhs.deviceType ) && ( deviceName == rhs.deviceName ) && ( pipelineCacheUUID == rhs.pipelineCacheUUID ) && - ( limits == rhs.limits ) && ( sparseProperties == rhs.sparseProperties ); -# endif - } - - bool operator!=( PhysicalDeviceProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t apiVersion = {}; - uint32_t driverVersion = {}; - uint32_t vendorID = {}; - uint32_t deviceID = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceType deviceType = VULKAN_HPP_NAMESPACE::PhysicalDeviceType::eOther; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D deviceName = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D pipelineCacheUUID = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceLimits limits = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceSparseProperties sparseProperties = {}; - }; - - struct PhysicalDeviceProperties2 - { - using NativeType = VkPhysicalDeviceProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProperties2( VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties properties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , properties( properties_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProperties2( PhysicalDeviceProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProperties2( VkPhysicalDeviceProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProperties2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProperties2 & operator=( PhysicalDeviceProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProperties2 & operator=( VkPhysicalDeviceProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, properties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProperties2 const & ) const = default; -#else - bool operator==( PhysicalDeviceProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( properties == rhs.properties ); -# endif - } - - bool operator!=( PhysicalDeviceProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PhysicalDeviceProperties properties = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceProperties2; - }; - using PhysicalDeviceProperties2KHR = PhysicalDeviceProperties2; - - struct PhysicalDeviceProtectedMemoryFeatures - { - using NativeType = VkPhysicalDeviceProtectedMemoryFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceProtectedMemoryFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceProtectedMemoryFeatures( VULKAN_HPP_NAMESPACE::Bool32 protectedMemory_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , protectedMemory( protectedMemory_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceProtectedMemoryFeatures( PhysicalDeviceProtectedMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProtectedMemoryFeatures( VkPhysicalDeviceProtectedMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProtectedMemoryFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProtectedMemoryFeatures & operator=( PhysicalDeviceProtectedMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProtectedMemoryFeatures & operator=( VkPhysicalDeviceProtectedMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProtectedMemoryFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProtectedMemoryFeatures & setProtectedMemory( VULKAN_HPP_NAMESPACE::Bool32 protectedMemory_ ) VULKAN_HPP_NOEXCEPT - { - protectedMemory = protectedMemory_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceProtectedMemoryFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProtectedMemoryFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, protectedMemory ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProtectedMemoryFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceProtectedMemoryFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( protectedMemory == rhs.protectedMemory ); -# endif - } - - bool operator!=( PhysicalDeviceProtectedMemoryFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceProtectedMemoryFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 protectedMemory = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceProtectedMemoryFeatures; - }; - - struct PhysicalDeviceProtectedMemoryProperties - { - using NativeType = VkPhysicalDeviceProtectedMemoryProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceProtectedMemoryProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceProtectedMemoryProperties( VULKAN_HPP_NAMESPACE::Bool32 protectedNoFault_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , protectedNoFault( protectedNoFault_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceProtectedMemoryProperties( PhysicalDeviceProtectedMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProtectedMemoryProperties( VkPhysicalDeviceProtectedMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProtectedMemoryProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProtectedMemoryProperties & operator=( PhysicalDeviceProtectedMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProtectedMemoryProperties & operator=( VkPhysicalDeviceProtectedMemoryProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceProtectedMemoryProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProtectedMemoryProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, protectedNoFault ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProtectedMemoryProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceProtectedMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( protectedNoFault == rhs.protectedNoFault ); -# endif - } - - bool operator!=( PhysicalDeviceProtectedMemoryProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceProtectedMemoryProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 protectedNoFault = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceProtectedMemoryProperties; - }; - - struct PhysicalDeviceProvokingVertexFeaturesEXT - { - using NativeType = VkPhysicalDeviceProvokingVertexFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceProvokingVertexFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceProvokingVertexFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 provokingVertexLast_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackPreservesProvokingVertex_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , provokingVertexLast( provokingVertexLast_ ) - , transformFeedbackPreservesProvokingVertex( transformFeedbackPreservesProvokingVertex_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceProvokingVertexFeaturesEXT( PhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProvokingVertexFeaturesEXT( VkPhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProvokingVertexFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProvokingVertexFeaturesEXT & operator=( PhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProvokingVertexFeaturesEXT & operator=( VkPhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProvokingVertexFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProvokingVertexFeaturesEXT & - setProvokingVertexLast( VULKAN_HPP_NAMESPACE::Bool32 provokingVertexLast_ ) VULKAN_HPP_NOEXCEPT - { - provokingVertexLast = provokingVertexLast_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceProvokingVertexFeaturesEXT & - setTransformFeedbackPreservesProvokingVertex( VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackPreservesProvokingVertex_ ) VULKAN_HPP_NOEXCEPT - { - transformFeedbackPreservesProvokingVertex = transformFeedbackPreservesProvokingVertex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceProvokingVertexFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProvokingVertexFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, provokingVertexLast, transformFeedbackPreservesProvokingVertex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProvokingVertexFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( provokingVertexLast == rhs.provokingVertexLast ) && - ( transformFeedbackPreservesProvokingVertex == rhs.transformFeedbackPreservesProvokingVertex ); -# endif - } - - bool operator!=( PhysicalDeviceProvokingVertexFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceProvokingVertexFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 provokingVertexLast = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackPreservesProvokingVertex = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceProvokingVertexFeaturesEXT; - }; - - struct PhysicalDeviceProvokingVertexPropertiesEXT - { - using NativeType = VkPhysicalDeviceProvokingVertexPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceProvokingVertexPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceProvokingVertexPropertiesEXT( VULKAN_HPP_NAMESPACE::Bool32 provokingVertexModePerPipeline_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackPreservesTriangleFanProvokingVertex_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , provokingVertexModePerPipeline( provokingVertexModePerPipeline_ ) - , transformFeedbackPreservesTriangleFanProvokingVertex( transformFeedbackPreservesTriangleFanProvokingVertex_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceProvokingVertexPropertiesEXT( PhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProvokingVertexPropertiesEXT( VkPhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceProvokingVertexPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceProvokingVertexPropertiesEXT & operator=( PhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceProvokingVertexPropertiesEXT & operator=( VkPhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceProvokingVertexPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceProvokingVertexPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, provokingVertexModePerPipeline, transformFeedbackPreservesTriangleFanProvokingVertex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceProvokingVertexPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( provokingVertexModePerPipeline == rhs.provokingVertexModePerPipeline ) && - ( transformFeedbackPreservesTriangleFanProvokingVertex == rhs.transformFeedbackPreservesTriangleFanProvokingVertex ); -# endif - } - - bool operator!=( PhysicalDeviceProvokingVertexPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceProvokingVertexPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 provokingVertexModePerPipeline = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackPreservesTriangleFanProvokingVertex = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceProvokingVertexPropertiesEXT; - }; - - struct PhysicalDevicePushDescriptorPropertiesKHR - { - using NativeType = VkPhysicalDevicePushDescriptorPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDevicePushDescriptorPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDevicePushDescriptorPropertiesKHR( uint32_t maxPushDescriptors_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxPushDescriptors( maxPushDescriptors_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDevicePushDescriptorPropertiesKHR( PhysicalDevicePushDescriptorPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePushDescriptorPropertiesKHR( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDevicePushDescriptorPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDevicePushDescriptorPropertiesKHR & operator=( PhysicalDevicePushDescriptorPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDevicePushDescriptorPropertiesKHR & operator=( VkPhysicalDevicePushDescriptorPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDevicePushDescriptorPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDevicePushDescriptorPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxPushDescriptors ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDevicePushDescriptorPropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDevicePushDescriptorPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxPushDescriptors == rhs.maxPushDescriptors ); -# endif - } - - bool operator!=( PhysicalDevicePushDescriptorPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDevicePushDescriptorPropertiesKHR; - void * pNext = {}; - uint32_t maxPushDescriptors = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDevicePushDescriptorPropertiesKHR; - }; - - struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT - { - using NativeType = VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRgba10X6FormatsFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRGBA10X6FormatsFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 formatRgba10x6WithoutYCbCrSampler_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , formatRgba10x6WithoutYCbCrSampler( formatRgba10x6WithoutYCbCrSampler_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRGBA10X6FormatsFeaturesEXT( PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRGBA10X6FormatsFeaturesEXT( VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRGBA10X6FormatsFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRGBA10X6FormatsFeaturesEXT & operator=( PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRGBA10X6FormatsFeaturesEXT & operator=( VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRGBA10X6FormatsFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRGBA10X6FormatsFeaturesEXT & - setFormatRgba10x6WithoutYCbCrSampler( VULKAN_HPP_NAMESPACE::Bool32 formatRgba10x6WithoutYCbCrSampler_ ) VULKAN_HPP_NOEXCEPT - { - formatRgba10x6WithoutYCbCrSampler = formatRgba10x6WithoutYCbCrSampler_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, formatRgba10x6WithoutYCbCrSampler ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( formatRgba10x6WithoutYCbCrSampler == rhs.formatRgba10x6WithoutYCbCrSampler ); -# endif - } - - bool operator!=( PhysicalDeviceRGBA10X6FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRgba10X6FormatsFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 formatRgba10x6WithoutYCbCrSampler = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRGBA10X6FormatsFeaturesEXT; - }; - - struct PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT - { - using NativeType = VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderColorAttachmentAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderDepthAttachmentAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderStencilAttachmentAccess_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rasterizationOrderColorAttachmentAccess( rasterizationOrderColorAttachmentAccess_ ) - , rasterizationOrderDepthAttachmentAccess( rasterizationOrderDepthAttachmentAccess_ ) - , rasterizationOrderStencilAttachmentAccess( rasterizationOrderStencilAttachmentAccess_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT( PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT( VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT( - *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & - operator=( PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & - operator=( VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & - setRasterizationOrderColorAttachmentAccess( VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderColorAttachmentAccess_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationOrderColorAttachmentAccess = rasterizationOrderColorAttachmentAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & - setRasterizationOrderDepthAttachmentAccess( VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderDepthAttachmentAccess_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationOrderDepthAttachmentAccess = rasterizationOrderDepthAttachmentAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT & - setRasterizationOrderStencilAttachmentAccess( VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderStencilAttachmentAccess_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationOrderStencilAttachmentAccess = rasterizationOrderStencilAttachmentAccess_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, rasterizationOrderColorAttachmentAccess, rasterizationOrderDepthAttachmentAccess, rasterizationOrderStencilAttachmentAccess ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rasterizationOrderColorAttachmentAccess == rhs.rasterizationOrderColorAttachmentAccess ) && - ( rasterizationOrderDepthAttachmentAccess == rhs.rasterizationOrderDepthAttachmentAccess ) && - ( rasterizationOrderStencilAttachmentAccess == rhs.rasterizationOrderStencilAttachmentAccess ); -# endif - } - - bool operator!=( PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderColorAttachmentAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderDepthAttachmentAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 rasterizationOrderStencilAttachmentAccess = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - }; - using PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM = PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT; - - struct PhysicalDeviceRayQueryFeaturesKHR - { - using NativeType = VkPhysicalDeviceRayQueryFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayQueryFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayQueryFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 rayQuery_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rayQuery( rayQuery_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayQueryFeaturesKHR( PhysicalDeviceRayQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayQueryFeaturesKHR( VkPhysicalDeviceRayQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayQueryFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayQueryFeaturesKHR & operator=( PhysicalDeviceRayQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayQueryFeaturesKHR & operator=( VkPhysicalDeviceRayQueryFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayQueryFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayQueryFeaturesKHR & setRayQuery( VULKAN_HPP_NAMESPACE::Bool32 rayQuery_ ) VULKAN_HPP_NOEXCEPT - { - rayQuery = rayQuery_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRayQueryFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayQueryFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, rayQuery ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayQueryFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceRayQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rayQuery == rhs.rayQuery ); -# endif - } - - bool operator!=( PhysicalDeviceRayQueryFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayQueryFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayQuery = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayQueryFeaturesKHR; - }; - - struct PhysicalDeviceRayTracingMaintenance1FeaturesKHR - { - using NativeType = VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayTracingMaintenance1FeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingMaintenance1FeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 rayTracingMaintenance1_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect2_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rayTracingMaintenance1( rayTracingMaintenance1_ ) - , rayTracingPipelineTraceRaysIndirect2( rayTracingPipelineTraceRaysIndirect2_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceRayTracingMaintenance1FeaturesKHR( PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingMaintenance1FeaturesKHR( VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayTracingMaintenance1FeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayTracingMaintenance1FeaturesKHR & operator=( PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingMaintenance1FeaturesKHR & operator=( VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMaintenance1FeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMaintenance1FeaturesKHR & - setRayTracingMaintenance1( VULKAN_HPP_NAMESPACE::Bool32 rayTracingMaintenance1_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingMaintenance1 = rayTracingMaintenance1_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMaintenance1FeaturesKHR & - setRayTracingPipelineTraceRaysIndirect2( VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect2_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingPipelineTraceRaysIndirect2 = rayTracingPipelineTraceRaysIndirect2_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, rayTracingMaintenance1, rayTracingPipelineTraceRaysIndirect2 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rayTracingMaintenance1 == rhs.rayTracingMaintenance1 ) && - ( rayTracingPipelineTraceRaysIndirect2 == rhs.rayTracingPipelineTraceRaysIndirect2 ); -# endif - } - - bool operator!=( PhysicalDeviceRayTracingMaintenance1FeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayTracingMaintenance1FeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingMaintenance1 = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect2 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayTracingMaintenance1FeaturesKHR; - }; - - struct PhysicalDeviceRayTracingMotionBlurFeaturesNV - { - using NativeType = VkPhysicalDeviceRayTracingMotionBlurFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayTracingMotionBlurFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingMotionBlurFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlur_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlurPipelineTraceRaysIndirect_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rayTracingMotionBlur( rayTracingMotionBlur_ ) - , rayTracingMotionBlurPipelineTraceRaysIndirect( rayTracingMotionBlurPipelineTraceRaysIndirect_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingMotionBlurFeaturesNV( PhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingMotionBlurFeaturesNV( VkPhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayTracingMotionBlurFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayTracingMotionBlurFeaturesNV & operator=( PhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingMotionBlurFeaturesNV & operator=( VkPhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMotionBlurFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMotionBlurFeaturesNV & - setRayTracingMotionBlur( VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlur_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingMotionBlur = rayTracingMotionBlur_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingMotionBlurFeaturesNV & - setRayTracingMotionBlurPipelineTraceRaysIndirect( VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlurPipelineTraceRaysIndirect_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingMotionBlurPipelineTraceRaysIndirect = rayTracingMotionBlurPipelineTraceRaysIndirect_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRayTracingMotionBlurFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayTracingMotionBlurFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, rayTracingMotionBlur, rayTracingMotionBlurPipelineTraceRaysIndirect ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayTracingMotionBlurFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rayTracingMotionBlur == rhs.rayTracingMotionBlur ) && - ( rayTracingMotionBlurPipelineTraceRaysIndirect == rhs.rayTracingMotionBlurPipelineTraceRaysIndirect ); -# endif - } - - bool operator!=( PhysicalDeviceRayTracingMotionBlurFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayTracingMotionBlurFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlur = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingMotionBlurPipelineTraceRaysIndirect = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayTracingMotionBlurFeaturesNV; - }; - - struct PhysicalDeviceRayTracingPipelineFeaturesKHR - { - using NativeType = VkPhysicalDeviceRayTracingPipelineFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayTracingPipelineFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingPipelineFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipeline_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplay_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 rayTraversalPrimitiveCulling_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rayTracingPipeline( rayTracingPipeline_ ) - , rayTracingPipelineShaderGroupHandleCaptureReplay( rayTracingPipelineShaderGroupHandleCaptureReplay_ ) - , rayTracingPipelineShaderGroupHandleCaptureReplayMixed( rayTracingPipelineShaderGroupHandleCaptureReplayMixed_ ) - , rayTracingPipelineTraceRaysIndirect( rayTracingPipelineTraceRaysIndirect_ ) - , rayTraversalPrimitiveCulling( rayTraversalPrimitiveCulling_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingPipelineFeaturesKHR( PhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPipelineFeaturesKHR( VkPhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayTracingPipelineFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayTracingPipelineFeaturesKHR & operator=( PhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPipelineFeaturesKHR & operator=( VkPhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & - setRayTracingPipeline( VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipeline_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingPipeline = rayTracingPipeline_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & - setRayTracingPipelineShaderGroupHandleCaptureReplay( VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplay_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingPipelineShaderGroupHandleCaptureReplay = rayTracingPipelineShaderGroupHandleCaptureReplay_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & setRayTracingPipelineShaderGroupHandleCaptureReplayMixed( - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingPipelineShaderGroupHandleCaptureReplayMixed = rayTracingPipelineShaderGroupHandleCaptureReplayMixed_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & - setRayTracingPipelineTraceRaysIndirect( VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect_ ) VULKAN_HPP_NOEXCEPT - { - rayTracingPipelineTraceRaysIndirect = rayTracingPipelineTraceRaysIndirect_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRayTracingPipelineFeaturesKHR & - setRayTraversalPrimitiveCulling( VULKAN_HPP_NAMESPACE::Bool32 rayTraversalPrimitiveCulling_ ) VULKAN_HPP_NOEXCEPT - { - rayTraversalPrimitiveCulling = rayTraversalPrimitiveCulling_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRayTracingPipelineFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayTracingPipelineFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - rayTracingPipeline, - rayTracingPipelineShaderGroupHandleCaptureReplay, - rayTracingPipelineShaderGroupHandleCaptureReplayMixed, - rayTracingPipelineTraceRaysIndirect, - rayTraversalPrimitiveCulling ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayTracingPipelineFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rayTracingPipeline == rhs.rayTracingPipeline ) && - ( rayTracingPipelineShaderGroupHandleCaptureReplay == rhs.rayTracingPipelineShaderGroupHandleCaptureReplay ) && - ( rayTracingPipelineShaderGroupHandleCaptureReplayMixed == rhs.rayTracingPipelineShaderGroupHandleCaptureReplayMixed ) && - ( rayTracingPipelineTraceRaysIndirect == rhs.rayTracingPipelineTraceRaysIndirect ) && - ( rayTraversalPrimitiveCulling == rhs.rayTraversalPrimitiveCulling ); -# endif - } - - bool operator!=( PhysicalDeviceRayTracingPipelineFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayTracingPipelineFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipeline = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplay = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineShaderGroupHandleCaptureReplayMixed = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTracingPipelineTraceRaysIndirect = {}; - VULKAN_HPP_NAMESPACE::Bool32 rayTraversalPrimitiveCulling = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayTracingPipelineFeaturesKHR; - }; - - struct PhysicalDeviceRayTracingPipelinePropertiesKHR - { - using NativeType = VkPhysicalDeviceRayTracingPipelinePropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayTracingPipelinePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingPipelinePropertiesKHR( uint32_t shaderGroupHandleSize_ = {}, - uint32_t maxRayRecursionDepth_ = {}, - uint32_t maxShaderGroupStride_ = {}, - uint32_t shaderGroupBaseAlignment_ = {}, - uint32_t shaderGroupHandleCaptureReplaySize_ = {}, - uint32_t maxRayDispatchInvocationCount_ = {}, - uint32_t shaderGroupHandleAlignment_ = {}, - uint32_t maxRayHitAttributeSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderGroupHandleSize( shaderGroupHandleSize_ ) - , maxRayRecursionDepth( maxRayRecursionDepth_ ) - , maxShaderGroupStride( maxShaderGroupStride_ ) - , shaderGroupBaseAlignment( shaderGroupBaseAlignment_ ) - , shaderGroupHandleCaptureReplaySize( shaderGroupHandleCaptureReplaySize_ ) - , maxRayDispatchInvocationCount( maxRayDispatchInvocationCount_ ) - , shaderGroupHandleAlignment( shaderGroupHandleAlignment_ ) - , maxRayHitAttributeSize( maxRayHitAttributeSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceRayTracingPipelinePropertiesKHR( PhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPipelinePropertiesKHR( VkPhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayTracingPipelinePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayTracingPipelinePropertiesKHR & operator=( PhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPipelinePropertiesKHR & operator=( VkPhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceRayTracingPipelinePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayTracingPipelinePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderGroupHandleSize, - maxRayRecursionDepth, - maxShaderGroupStride, - shaderGroupBaseAlignment, - shaderGroupHandleCaptureReplaySize, - maxRayDispatchInvocationCount, - shaderGroupHandleAlignment, - maxRayHitAttributeSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayTracingPipelinePropertiesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderGroupHandleSize == rhs.shaderGroupHandleSize ) && - ( maxRayRecursionDepth == rhs.maxRayRecursionDepth ) && ( maxShaderGroupStride == rhs.maxShaderGroupStride ) && - ( shaderGroupBaseAlignment == rhs.shaderGroupBaseAlignment ) && ( shaderGroupHandleCaptureReplaySize == rhs.shaderGroupHandleCaptureReplaySize ) && - ( maxRayDispatchInvocationCount == rhs.maxRayDispatchInvocationCount ) && ( shaderGroupHandleAlignment == rhs.shaderGroupHandleAlignment ) && - ( maxRayHitAttributeSize == rhs.maxRayHitAttributeSize ); -# endif - } - - bool operator!=( PhysicalDeviceRayTracingPipelinePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayTracingPipelinePropertiesKHR; - void * pNext = {}; - uint32_t shaderGroupHandleSize = {}; - uint32_t maxRayRecursionDepth = {}; - uint32_t maxShaderGroupStride = {}; - uint32_t shaderGroupBaseAlignment = {}; - uint32_t shaderGroupHandleCaptureReplaySize = {}; - uint32_t maxRayDispatchInvocationCount = {}; - uint32_t shaderGroupHandleAlignment = {}; - uint32_t maxRayHitAttributeSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayTracingPipelinePropertiesKHR; - }; - - struct PhysicalDeviceRayTracingPropertiesNV - { - using NativeType = VkPhysicalDeviceRayTracingPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRayTracingPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingPropertiesNV( uint32_t shaderGroupHandleSize_ = {}, - uint32_t maxRecursionDepth_ = {}, - uint32_t maxShaderGroupStride_ = {}, - uint32_t shaderGroupBaseAlignment_ = {}, - uint64_t maxGeometryCount_ = {}, - uint64_t maxInstanceCount_ = {}, - uint64_t maxTriangleCount_ = {}, - uint32_t maxDescriptorSetAccelerationStructures_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderGroupHandleSize( shaderGroupHandleSize_ ) - , maxRecursionDepth( maxRecursionDepth_ ) - , maxShaderGroupStride( maxShaderGroupStride_ ) - , shaderGroupBaseAlignment( shaderGroupBaseAlignment_ ) - , maxGeometryCount( maxGeometryCount_ ) - , maxInstanceCount( maxInstanceCount_ ) - , maxTriangleCount( maxTriangleCount_ ) - , maxDescriptorSetAccelerationStructures( maxDescriptorSetAccelerationStructures_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRayTracingPropertiesNV( PhysicalDeviceRayTracingPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPropertiesNV( VkPhysicalDeviceRayTracingPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRayTracingPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRayTracingPropertiesNV & operator=( PhysicalDeviceRayTracingPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRayTracingPropertiesNV & operator=( VkPhysicalDeviceRayTracingPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceRayTracingPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRayTracingPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderGroupHandleSize, - maxRecursionDepth, - maxShaderGroupStride, - shaderGroupBaseAlignment, - maxGeometryCount, - maxInstanceCount, - maxTriangleCount, - maxDescriptorSetAccelerationStructures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRayTracingPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceRayTracingPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderGroupHandleSize == rhs.shaderGroupHandleSize ) && - ( maxRecursionDepth == rhs.maxRecursionDepth ) && ( maxShaderGroupStride == rhs.maxShaderGroupStride ) && - ( shaderGroupBaseAlignment == rhs.shaderGroupBaseAlignment ) && ( maxGeometryCount == rhs.maxGeometryCount ) && - ( maxInstanceCount == rhs.maxInstanceCount ) && ( maxTriangleCount == rhs.maxTriangleCount ) && - ( maxDescriptorSetAccelerationStructures == rhs.maxDescriptorSetAccelerationStructures ); -# endif - } - - bool operator!=( PhysicalDeviceRayTracingPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRayTracingPropertiesNV; - void * pNext = {}; - uint32_t shaderGroupHandleSize = {}; - uint32_t maxRecursionDepth = {}; - uint32_t maxShaderGroupStride = {}; - uint32_t shaderGroupBaseAlignment = {}; - uint64_t maxGeometryCount = {}; - uint64_t maxInstanceCount = {}; - uint64_t maxTriangleCount = {}; - uint32_t maxDescriptorSetAccelerationStructures = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRayTracingPropertiesNV; - }; - - struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV - { - using NativeType = VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRepresentativeFragmentTestFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRepresentativeFragmentTestFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTest_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , representativeFragmentTest( representativeFragmentTest_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceRepresentativeFragmentTestFeaturesNV( PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRepresentativeFragmentTestFeaturesNV( VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRepresentativeFragmentTestFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRepresentativeFragmentTestFeaturesNV & - operator=( PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRepresentativeFragmentTestFeaturesNV & operator=( VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRepresentativeFragmentTestFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRepresentativeFragmentTestFeaturesNV & - setRepresentativeFragmentTest( VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTest_ ) VULKAN_HPP_NOEXCEPT - { - representativeFragmentTest = representativeFragmentTest_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, representativeFragmentTest ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( representativeFragmentTest == rhs.representativeFragmentTest ); -# endif - } - - bool operator!=( PhysicalDeviceRepresentativeFragmentTestFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRepresentativeFragmentTestFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTest = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRepresentativeFragmentTestFeaturesNV; - }; - - struct PhysicalDeviceRobustness2FeaturesEXT - { - using NativeType = VkPhysicalDeviceRobustness2FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRobustness2FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRobustness2FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess2_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess2_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 nullDescriptor_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , robustBufferAccess2( robustBufferAccess2_ ) - , robustImageAccess2( robustImageAccess2_ ) - , nullDescriptor( nullDescriptor_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRobustness2FeaturesEXT( PhysicalDeviceRobustness2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRobustness2FeaturesEXT( VkPhysicalDeviceRobustness2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRobustness2FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRobustness2FeaturesEXT & operator=( PhysicalDeviceRobustness2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRobustness2FeaturesEXT & operator=( VkPhysicalDeviceRobustness2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRobustness2FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRobustness2FeaturesEXT & - setRobustBufferAccess2( VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess2_ ) VULKAN_HPP_NOEXCEPT - { - robustBufferAccess2 = robustBufferAccess2_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRobustness2FeaturesEXT & setRobustImageAccess2( VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess2_ ) VULKAN_HPP_NOEXCEPT - { - robustImageAccess2 = robustImageAccess2_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceRobustness2FeaturesEXT & setNullDescriptor( VULKAN_HPP_NAMESPACE::Bool32 nullDescriptor_ ) VULKAN_HPP_NOEXCEPT - { - nullDescriptor = nullDescriptor_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceRobustness2FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRobustness2FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, robustBufferAccess2, robustImageAccess2, nullDescriptor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRobustness2FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceRobustness2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( robustBufferAccess2 == rhs.robustBufferAccess2 ) && - ( robustImageAccess2 == rhs.robustImageAccess2 ) && ( nullDescriptor == rhs.nullDescriptor ); -# endif - } - - bool operator!=( PhysicalDeviceRobustness2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRobustness2FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccess2 = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess2 = {}; - VULKAN_HPP_NAMESPACE::Bool32 nullDescriptor = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRobustness2FeaturesEXT; - }; - - struct PhysicalDeviceRobustness2PropertiesEXT - { - using NativeType = VkPhysicalDeviceRobustness2PropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceRobustness2PropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceRobustness2PropertiesEXT( VULKAN_HPP_NAMESPACE::DeviceSize robustStorageBufferAccessSizeAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize robustUniformBufferAccessSizeAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , robustStorageBufferAccessSizeAlignment( robustStorageBufferAccessSizeAlignment_ ) - , robustUniformBufferAccessSizeAlignment( robustUniformBufferAccessSizeAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceRobustness2PropertiesEXT( PhysicalDeviceRobustness2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRobustness2PropertiesEXT( VkPhysicalDeviceRobustness2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceRobustness2PropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceRobustness2PropertiesEXT & operator=( PhysicalDeviceRobustness2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceRobustness2PropertiesEXT & operator=( VkPhysicalDeviceRobustness2PropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceRobustness2PropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceRobustness2PropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, robustStorageBufferAccessSizeAlignment, robustUniformBufferAccessSizeAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceRobustness2PropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceRobustness2PropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( robustStorageBufferAccessSizeAlignment == rhs.robustStorageBufferAccessSizeAlignment ) && - ( robustUniformBufferAccessSizeAlignment == rhs.robustUniformBufferAccessSizeAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceRobustness2PropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceRobustness2PropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize robustStorageBufferAccessSizeAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize robustUniformBufferAccessSizeAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceRobustness2PropertiesEXT; - }; - - struct PhysicalDeviceSampleLocationsPropertiesEXT - { - using NativeType = VkPhysicalDeviceSampleLocationsPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSampleLocationsPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSampleLocationsPropertiesEXT( VULKAN_HPP_NAMESPACE::SampleCountFlags sampleLocationSampleCounts_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxSampleLocationGridSize_ = {}, - std::array const & sampleLocationCoordinateRange_ = {}, - uint32_t sampleLocationSubPixelBits_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 variableSampleLocations_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sampleLocationSampleCounts( sampleLocationSampleCounts_ ) - , maxSampleLocationGridSize( maxSampleLocationGridSize_ ) - , sampleLocationCoordinateRange( sampleLocationCoordinateRange_ ) - , sampleLocationSubPixelBits( sampleLocationSubPixelBits_ ) - , variableSampleLocations( variableSampleLocations_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSampleLocationsPropertiesEXT( PhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSampleLocationsPropertiesEXT( VkPhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSampleLocationsPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSampleLocationsPropertiesEXT & operator=( PhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSampleLocationsPropertiesEXT & operator=( VkPhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSampleLocationsPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSampleLocationsPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - sampleLocationSampleCounts, - maxSampleLocationGridSize, - sampleLocationCoordinateRange, - sampleLocationSubPixelBits, - variableSampleLocations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSampleLocationsPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sampleLocationSampleCounts == rhs.sampleLocationSampleCounts ) && - ( maxSampleLocationGridSize == rhs.maxSampleLocationGridSize ) && ( sampleLocationCoordinateRange == rhs.sampleLocationCoordinateRange ) && - ( sampleLocationSubPixelBits == rhs.sampleLocationSubPixelBits ) && ( variableSampleLocations == rhs.variableSampleLocations ); -# endif - } - - bool operator!=( PhysicalDeviceSampleLocationsPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSampleLocationsPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags sampleLocationSampleCounts = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxSampleLocationGridSize = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D sampleLocationCoordinateRange = {}; - uint32_t sampleLocationSubPixelBits = {}; - VULKAN_HPP_NAMESPACE::Bool32 variableSampleLocations = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSampleLocationsPropertiesEXT; - }; - - struct PhysicalDeviceSamplerFilterMinmaxProperties - { - using NativeType = VkPhysicalDeviceSamplerFilterMinmaxProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSamplerFilterMinmaxProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSamplerFilterMinmaxProperties( VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxSingleComponentFormats_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxImageComponentMapping_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , filterMinmaxSingleComponentFormats( filterMinmaxSingleComponentFormats_ ) - , filterMinmaxImageComponentMapping( filterMinmaxImageComponentMapping_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSamplerFilterMinmaxProperties( PhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSamplerFilterMinmaxProperties( VkPhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSamplerFilterMinmaxProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSamplerFilterMinmaxProperties & operator=( PhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSamplerFilterMinmaxProperties & operator=( VkPhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSamplerFilterMinmaxProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSamplerFilterMinmaxProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, filterMinmaxSingleComponentFormats, filterMinmaxImageComponentMapping ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSamplerFilterMinmaxProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( filterMinmaxSingleComponentFormats == rhs.filterMinmaxSingleComponentFormats ) && - ( filterMinmaxImageComponentMapping == rhs.filterMinmaxImageComponentMapping ); -# endif - } - - bool operator!=( PhysicalDeviceSamplerFilterMinmaxProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSamplerFilterMinmaxProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxSingleComponentFormats = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxImageComponentMapping = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSamplerFilterMinmaxProperties; - }; - using PhysicalDeviceSamplerFilterMinmaxPropertiesEXT = PhysicalDeviceSamplerFilterMinmaxProperties; - - struct PhysicalDeviceSamplerYcbcrConversionFeatures - { - using NativeType = VkPhysicalDeviceSamplerYcbcrConversionFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSamplerYcbcrConversionFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSamplerYcbcrConversionFeatures( VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , samplerYcbcrConversion( samplerYcbcrConversion_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSamplerYcbcrConversionFeatures( PhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSamplerYcbcrConversionFeatures( VkPhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSamplerYcbcrConversionFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSamplerYcbcrConversionFeatures & operator=( PhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSamplerYcbcrConversionFeatures & operator=( VkPhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSamplerYcbcrConversionFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSamplerYcbcrConversionFeatures & - setSamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion_ ) VULKAN_HPP_NOEXCEPT - { - samplerYcbcrConversion = samplerYcbcrConversion_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSamplerYcbcrConversionFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSamplerYcbcrConversionFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, samplerYcbcrConversion ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSamplerYcbcrConversionFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( samplerYcbcrConversion == rhs.samplerYcbcrConversion ); -# endif - } - - bool operator!=( PhysicalDeviceSamplerYcbcrConversionFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSamplerYcbcrConversionFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSamplerYcbcrConversionFeatures; - }; - using PhysicalDeviceSamplerYcbcrConversionFeaturesKHR = PhysicalDeviceSamplerYcbcrConversionFeatures; - - struct PhysicalDeviceScalarBlockLayoutFeatures - { - using NativeType = VkPhysicalDeviceScalarBlockLayoutFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceScalarBlockLayoutFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceScalarBlockLayoutFeatures( VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , scalarBlockLayout( scalarBlockLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceScalarBlockLayoutFeatures( PhysicalDeviceScalarBlockLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceScalarBlockLayoutFeatures( VkPhysicalDeviceScalarBlockLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceScalarBlockLayoutFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceScalarBlockLayoutFeatures & operator=( PhysicalDeviceScalarBlockLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceScalarBlockLayoutFeatures & operator=( VkPhysicalDeviceScalarBlockLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceScalarBlockLayoutFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceScalarBlockLayoutFeatures & - setScalarBlockLayout( VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout_ ) VULKAN_HPP_NOEXCEPT - { - scalarBlockLayout = scalarBlockLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceScalarBlockLayoutFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceScalarBlockLayoutFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, scalarBlockLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceScalarBlockLayoutFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceScalarBlockLayoutFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( scalarBlockLayout == rhs.scalarBlockLayout ); -# endif - } - - bool operator!=( PhysicalDeviceScalarBlockLayoutFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceScalarBlockLayoutFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceScalarBlockLayoutFeatures; - }; - using PhysicalDeviceScalarBlockLayoutFeaturesEXT = PhysicalDeviceScalarBlockLayoutFeatures; - - struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures - { - using NativeType = VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSeparateDepthStencilLayoutsFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSeparateDepthStencilLayoutsFeatures( VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , separateDepthStencilLayouts( separateDepthStencilLayouts_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceSeparateDepthStencilLayoutsFeatures( PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSeparateDepthStencilLayoutsFeatures( VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSeparateDepthStencilLayoutsFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSeparateDepthStencilLayoutsFeatures & - operator=( PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSeparateDepthStencilLayoutsFeatures & operator=( VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSeparateDepthStencilLayoutsFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSeparateDepthStencilLayoutsFeatures & - setSeparateDepthStencilLayouts( VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts_ ) VULKAN_HPP_NOEXCEPT - { - separateDepthStencilLayouts = separateDepthStencilLayouts_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, separateDepthStencilLayouts ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( separateDepthStencilLayouts == rhs.separateDepthStencilLayouts ); -# endif - } - - bool operator!=( PhysicalDeviceSeparateDepthStencilLayoutsFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSeparateDepthStencilLayoutsFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSeparateDepthStencilLayoutsFeatures; - }; - using PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR = PhysicalDeviceSeparateDepthStencilLayoutsFeatures; - - struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT - { - using NativeType = VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderAtomicFloat2FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicFloat2FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicMinMax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicMinMax_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderBufferFloat16Atomics( shaderBufferFloat16Atomics_ ) - , shaderBufferFloat16AtomicAdd( shaderBufferFloat16AtomicAdd_ ) - , shaderBufferFloat16AtomicMinMax( shaderBufferFloat16AtomicMinMax_ ) - , shaderBufferFloat32AtomicMinMax( shaderBufferFloat32AtomicMinMax_ ) - , shaderBufferFloat64AtomicMinMax( shaderBufferFloat64AtomicMinMax_ ) - , shaderSharedFloat16Atomics( shaderSharedFloat16Atomics_ ) - , shaderSharedFloat16AtomicAdd( shaderSharedFloat16AtomicAdd_ ) - , shaderSharedFloat16AtomicMinMax( shaderSharedFloat16AtomicMinMax_ ) - , shaderSharedFloat32AtomicMinMax( shaderSharedFloat32AtomicMinMax_ ) - , shaderSharedFloat64AtomicMinMax( shaderSharedFloat64AtomicMinMax_ ) - , shaderImageFloat32AtomicMinMax( shaderImageFloat32AtomicMinMax_ ) - , sparseImageFloat32AtomicMinMax( sparseImageFloat32AtomicMinMax_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicFloat2FeaturesEXT( PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicFloat2FeaturesEXT( VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderAtomicFloat2FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderAtomicFloat2FeaturesEXT & operator=( PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicFloat2FeaturesEXT & operator=( VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderBufferFloat16Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat16Atomics = shaderBufferFloat16Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderBufferFloat16AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat16AtomicAdd = shaderBufferFloat16AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderBufferFloat16AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat16AtomicMinMax = shaderBufferFloat16AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderBufferFloat32AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat32AtomicMinMax = shaderBufferFloat32AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderBufferFloat64AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat64AtomicMinMax = shaderBufferFloat64AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderSharedFloat16Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat16Atomics = shaderSharedFloat16Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderSharedFloat16AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat16AtomicAdd = shaderSharedFloat16AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderSharedFloat16AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat16AtomicMinMax = shaderSharedFloat16AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderSharedFloat32AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat32AtomicMinMax = shaderSharedFloat32AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderSharedFloat64AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat64AtomicMinMax = shaderSharedFloat64AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setShaderImageFloat32AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - shaderImageFloat32AtomicMinMax = shaderImageFloat32AtomicMinMax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloat2FeaturesEXT & - setSparseImageFloat32AtomicMinMax( VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicMinMax_ ) VULKAN_HPP_NOEXCEPT - { - sparseImageFloat32AtomicMinMax = sparseImageFloat32AtomicMinMax_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderBufferFloat16Atomics, - shaderBufferFloat16AtomicAdd, - shaderBufferFloat16AtomicMinMax, - shaderBufferFloat32AtomicMinMax, - shaderBufferFloat64AtomicMinMax, - shaderSharedFloat16Atomics, - shaderSharedFloat16AtomicAdd, - shaderSharedFloat16AtomicMinMax, - shaderSharedFloat32AtomicMinMax, - shaderSharedFloat64AtomicMinMax, - shaderImageFloat32AtomicMinMax, - sparseImageFloat32AtomicMinMax ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderBufferFloat16Atomics == rhs.shaderBufferFloat16Atomics ) && - ( shaderBufferFloat16AtomicAdd == rhs.shaderBufferFloat16AtomicAdd ) && - ( shaderBufferFloat16AtomicMinMax == rhs.shaderBufferFloat16AtomicMinMax ) && - ( shaderBufferFloat32AtomicMinMax == rhs.shaderBufferFloat32AtomicMinMax ) && - ( shaderBufferFloat64AtomicMinMax == rhs.shaderBufferFloat64AtomicMinMax ) && ( shaderSharedFloat16Atomics == rhs.shaderSharedFloat16Atomics ) && - ( shaderSharedFloat16AtomicAdd == rhs.shaderSharedFloat16AtomicAdd ) && - ( shaderSharedFloat16AtomicMinMax == rhs.shaderSharedFloat16AtomicMinMax ) && - ( shaderSharedFloat32AtomicMinMax == rhs.shaderSharedFloat32AtomicMinMax ) && - ( shaderSharedFloat64AtomicMinMax == rhs.shaderSharedFloat64AtomicMinMax ) && - ( shaderImageFloat32AtomicMinMax == rhs.shaderImageFloat32AtomicMinMax ) && - ( sparseImageFloat32AtomicMinMax == rhs.sparseImageFloat32AtomicMinMax ); -# endif - } - - bool operator!=( PhysicalDeviceShaderAtomicFloat2FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderAtomicFloat2FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat16AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat16AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicMinMax = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicMinMax = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderAtomicFloat2FeaturesEXT; - }; - - struct PhysicalDeviceShaderAtomicFloatFeaturesEXT - { - using NativeType = VkPhysicalDeviceShaderAtomicFloatFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderAtomicFloatFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicFloatFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicAdd_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicAdd_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderBufferFloat32Atomics( shaderBufferFloat32Atomics_ ) - , shaderBufferFloat32AtomicAdd( shaderBufferFloat32AtomicAdd_ ) - , shaderBufferFloat64Atomics( shaderBufferFloat64Atomics_ ) - , shaderBufferFloat64AtomicAdd( shaderBufferFloat64AtomicAdd_ ) - , shaderSharedFloat32Atomics( shaderSharedFloat32Atomics_ ) - , shaderSharedFloat32AtomicAdd( shaderSharedFloat32AtomicAdd_ ) - , shaderSharedFloat64Atomics( shaderSharedFloat64Atomics_ ) - , shaderSharedFloat64AtomicAdd( shaderSharedFloat64AtomicAdd_ ) - , shaderImageFloat32Atomics( shaderImageFloat32Atomics_ ) - , shaderImageFloat32AtomicAdd( shaderImageFloat32AtomicAdd_ ) - , sparseImageFloat32Atomics( sparseImageFloat32Atomics_ ) - , sparseImageFloat32AtomicAdd( sparseImageFloat32AtomicAdd_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicFloatFeaturesEXT( PhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicFloatFeaturesEXT( VkPhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderAtomicFloatFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderAtomicFloatFeaturesEXT & operator=( PhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicFloatFeaturesEXT & operator=( VkPhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderBufferFloat32Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat32Atomics = shaderBufferFloat32Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderBufferFloat32AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat32AtomicAdd = shaderBufferFloat32AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderBufferFloat64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat64Atomics = shaderBufferFloat64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderBufferFloat64AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferFloat64AtomicAdd = shaderBufferFloat64AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderSharedFloat32Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat32Atomics = shaderSharedFloat32Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderSharedFloat32AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat32AtomicAdd = shaderSharedFloat32AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderSharedFloat64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat64Atomics = shaderSharedFloat64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderSharedFloat64AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedFloat64AtomicAdd = shaderSharedFloat64AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderImageFloat32Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderImageFloat32Atomics = shaderImageFloat32Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setShaderImageFloat32AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - shaderImageFloat32AtomicAdd = shaderImageFloat32AtomicAdd_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setSparseImageFloat32Atomics( VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32Atomics_ ) VULKAN_HPP_NOEXCEPT - { - sparseImageFloat32Atomics = sparseImageFloat32Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicFloatFeaturesEXT & - setSparseImageFloat32AtomicAdd( VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicAdd_ ) VULKAN_HPP_NOEXCEPT - { - sparseImageFloat32AtomicAdd = sparseImageFloat32AtomicAdd_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderAtomicFloatFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderAtomicFloatFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderBufferFloat32Atomics, - shaderBufferFloat32AtomicAdd, - shaderBufferFloat64Atomics, - shaderBufferFloat64AtomicAdd, - shaderSharedFloat32Atomics, - shaderSharedFloat32AtomicAdd, - shaderSharedFloat64Atomics, - shaderSharedFloat64AtomicAdd, - shaderImageFloat32Atomics, - shaderImageFloat32AtomicAdd, - sparseImageFloat32Atomics, - sparseImageFloat32AtomicAdd ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderAtomicFloatFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderBufferFloat32Atomics == rhs.shaderBufferFloat32Atomics ) && - ( shaderBufferFloat32AtomicAdd == rhs.shaderBufferFloat32AtomicAdd ) && ( shaderBufferFloat64Atomics == rhs.shaderBufferFloat64Atomics ) && - ( shaderBufferFloat64AtomicAdd == rhs.shaderBufferFloat64AtomicAdd ) && ( shaderSharedFloat32Atomics == rhs.shaderSharedFloat32Atomics ) && - ( shaderSharedFloat32AtomicAdd == rhs.shaderSharedFloat32AtomicAdd ) && ( shaderSharedFloat64Atomics == rhs.shaderSharedFloat64Atomics ) && - ( shaderSharedFloat64AtomicAdd == rhs.shaderSharedFloat64AtomicAdd ) && ( shaderImageFloat32Atomics == rhs.shaderImageFloat32Atomics ) && - ( shaderImageFloat32AtomicAdd == rhs.shaderImageFloat32AtomicAdd ) && ( sparseImageFloat32Atomics == rhs.sparseImageFloat32Atomics ) && - ( sparseImageFloat32AtomicAdd == rhs.sparseImageFloat32AtomicAdd ); -# endif - } - - bool operator!=( PhysicalDeviceShaderAtomicFloatFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderAtomicFloatFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat32AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferFloat64AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat32AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedFloat64AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderImageFloat32AtomicAdd = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseImageFloat32AtomicAdd = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderAtomicFloatFeaturesEXT; - }; - - struct PhysicalDeviceShaderAtomicInt64Features - { - using NativeType = VkPhysicalDeviceShaderAtomicInt64Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderAtomicInt64Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicInt64Features( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderBufferInt64Atomics( shaderBufferInt64Atomics_ ) - , shaderSharedInt64Atomics( shaderSharedInt64Atomics_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderAtomicInt64Features( PhysicalDeviceShaderAtomicInt64Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicInt64Features( VkPhysicalDeviceShaderAtomicInt64Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderAtomicInt64Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderAtomicInt64Features & operator=( PhysicalDeviceShaderAtomicInt64Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderAtomicInt64Features & operator=( VkPhysicalDeviceShaderAtomicInt64Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicInt64Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicInt64Features & - setShaderBufferInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferInt64Atomics = shaderBufferInt64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderAtomicInt64Features & - setShaderSharedInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedInt64Atomics = shaderSharedInt64Atomics_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderAtomicInt64Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderAtomicInt64Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderBufferInt64Atomics, shaderSharedInt64Atomics ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderAtomicInt64Features const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderAtomicInt64Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderBufferInt64Atomics == rhs.shaderBufferInt64Atomics ) && - ( shaderSharedInt64Atomics == rhs.shaderSharedInt64Atomics ); -# endif - } - - bool operator!=( PhysicalDeviceShaderAtomicInt64Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderAtomicInt64Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderAtomicInt64Features; - }; - using PhysicalDeviceShaderAtomicInt64FeaturesKHR = PhysicalDeviceShaderAtomicInt64Features; - - struct PhysicalDeviceShaderClockFeaturesKHR - { - using NativeType = VkPhysicalDeviceShaderClockFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderClockFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderClockFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupClock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDeviceClock_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderSubgroupClock( shaderSubgroupClock_ ) - , shaderDeviceClock( shaderDeviceClock_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderClockFeaturesKHR( PhysicalDeviceShaderClockFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderClockFeaturesKHR( VkPhysicalDeviceShaderClockFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderClockFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderClockFeaturesKHR & operator=( PhysicalDeviceShaderClockFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderClockFeaturesKHR & operator=( VkPhysicalDeviceShaderClockFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderClockFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderClockFeaturesKHR & - setShaderSubgroupClock( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupClock_ ) VULKAN_HPP_NOEXCEPT - { - shaderSubgroupClock = shaderSubgroupClock_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderClockFeaturesKHR & setShaderDeviceClock( VULKAN_HPP_NAMESPACE::Bool32 shaderDeviceClock_ ) VULKAN_HPP_NOEXCEPT - { - shaderDeviceClock = shaderDeviceClock_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderClockFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderClockFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderSubgroupClock, shaderDeviceClock ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderClockFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderClockFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderSubgroupClock == rhs.shaderSubgroupClock ) && - ( shaderDeviceClock == rhs.shaderDeviceClock ); -# endif - } - - bool operator!=( PhysicalDeviceShaderClockFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderClockFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupClock = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDeviceClock = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderClockFeaturesKHR; - }; - - struct PhysicalDeviceShaderCoreProperties2AMD - { - using NativeType = VkPhysicalDeviceShaderCoreProperties2AMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderCoreProperties2AMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderCoreProperties2AMD( VULKAN_HPP_NAMESPACE::ShaderCorePropertiesFlagsAMD shaderCoreFeatures_ = {}, - uint32_t activeComputeUnitCount_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderCoreFeatures( shaderCoreFeatures_ ) - , activeComputeUnitCount( activeComputeUnitCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderCoreProperties2AMD( PhysicalDeviceShaderCoreProperties2AMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderCoreProperties2AMD( VkPhysicalDeviceShaderCoreProperties2AMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderCoreProperties2AMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderCoreProperties2AMD & operator=( PhysicalDeviceShaderCoreProperties2AMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderCoreProperties2AMD & operator=( VkPhysicalDeviceShaderCoreProperties2AMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShaderCoreProperties2AMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderCoreProperties2AMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderCoreFeatures, activeComputeUnitCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderCoreProperties2AMD const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderCoreProperties2AMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderCoreFeatures == rhs.shaderCoreFeatures ) && - ( activeComputeUnitCount == rhs.activeComputeUnitCount ); -# endif - } - - bool operator!=( PhysicalDeviceShaderCoreProperties2AMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderCoreProperties2AMD; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ShaderCorePropertiesFlagsAMD shaderCoreFeatures = {}; - uint32_t activeComputeUnitCount = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderCoreProperties2AMD; - }; - - struct PhysicalDeviceShaderCorePropertiesAMD - { - using NativeType = VkPhysicalDeviceShaderCorePropertiesAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderCorePropertiesAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderCorePropertiesAMD( uint32_t shaderEngineCount_ = {}, - uint32_t shaderArraysPerEngineCount_ = {}, - uint32_t computeUnitsPerShaderArray_ = {}, - uint32_t simdPerComputeUnit_ = {}, - uint32_t wavefrontsPerSimd_ = {}, - uint32_t wavefrontSize_ = {}, - uint32_t sgprsPerSimd_ = {}, - uint32_t minSgprAllocation_ = {}, - uint32_t maxSgprAllocation_ = {}, - uint32_t sgprAllocationGranularity_ = {}, - uint32_t vgprsPerSimd_ = {}, - uint32_t minVgprAllocation_ = {}, - uint32_t maxVgprAllocation_ = {}, - uint32_t vgprAllocationGranularity_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderEngineCount( shaderEngineCount_ ) - , shaderArraysPerEngineCount( shaderArraysPerEngineCount_ ) - , computeUnitsPerShaderArray( computeUnitsPerShaderArray_ ) - , simdPerComputeUnit( simdPerComputeUnit_ ) - , wavefrontsPerSimd( wavefrontsPerSimd_ ) - , wavefrontSize( wavefrontSize_ ) - , sgprsPerSimd( sgprsPerSimd_ ) - , minSgprAllocation( minSgprAllocation_ ) - , maxSgprAllocation( maxSgprAllocation_ ) - , sgprAllocationGranularity( sgprAllocationGranularity_ ) - , vgprsPerSimd( vgprsPerSimd_ ) - , minVgprAllocation( minVgprAllocation_ ) - , maxVgprAllocation( maxVgprAllocation_ ) - , vgprAllocationGranularity( vgprAllocationGranularity_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderCorePropertiesAMD( PhysicalDeviceShaderCorePropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderCorePropertiesAMD( VkPhysicalDeviceShaderCorePropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderCorePropertiesAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderCorePropertiesAMD & operator=( PhysicalDeviceShaderCorePropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderCorePropertiesAMD & operator=( VkPhysicalDeviceShaderCorePropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShaderCorePropertiesAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderCorePropertiesAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - shaderEngineCount, - shaderArraysPerEngineCount, - computeUnitsPerShaderArray, - simdPerComputeUnit, - wavefrontsPerSimd, - wavefrontSize, - sgprsPerSimd, - minSgprAllocation, - maxSgprAllocation, - sgprAllocationGranularity, - vgprsPerSimd, - minVgprAllocation, - maxVgprAllocation, - vgprAllocationGranularity ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderCorePropertiesAMD const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderCorePropertiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderEngineCount == rhs.shaderEngineCount ) && - ( shaderArraysPerEngineCount == rhs.shaderArraysPerEngineCount ) && ( computeUnitsPerShaderArray == rhs.computeUnitsPerShaderArray ) && - ( simdPerComputeUnit == rhs.simdPerComputeUnit ) && ( wavefrontsPerSimd == rhs.wavefrontsPerSimd ) && ( wavefrontSize == rhs.wavefrontSize ) && - ( sgprsPerSimd == rhs.sgprsPerSimd ) && ( minSgprAllocation == rhs.minSgprAllocation ) && ( maxSgprAllocation == rhs.maxSgprAllocation ) && - ( sgprAllocationGranularity == rhs.sgprAllocationGranularity ) && ( vgprsPerSimd == rhs.vgprsPerSimd ) && - ( minVgprAllocation == rhs.minVgprAllocation ) && ( maxVgprAllocation == rhs.maxVgprAllocation ) && - ( vgprAllocationGranularity == rhs.vgprAllocationGranularity ); -# endif - } - - bool operator!=( PhysicalDeviceShaderCorePropertiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderCorePropertiesAMD; - void * pNext = {}; - uint32_t shaderEngineCount = {}; - uint32_t shaderArraysPerEngineCount = {}; - uint32_t computeUnitsPerShaderArray = {}; - uint32_t simdPerComputeUnit = {}; - uint32_t wavefrontsPerSimd = {}; - uint32_t wavefrontSize = {}; - uint32_t sgprsPerSimd = {}; - uint32_t minSgprAllocation = {}; - uint32_t maxSgprAllocation = {}; - uint32_t sgprAllocationGranularity = {}; - uint32_t vgprsPerSimd = {}; - uint32_t minVgprAllocation = {}; - uint32_t maxVgprAllocation = {}; - uint32_t vgprAllocationGranularity = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderCorePropertiesAMD; - }; - - struct PhysicalDeviceShaderDemoteToHelperInvocationFeatures - { - using NativeType = VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderDemoteToHelperInvocationFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderDemoteToHelperInvocationFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderDemoteToHelperInvocation( shaderDemoteToHelperInvocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderDemoteToHelperInvocationFeatures( PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderDemoteToHelperInvocationFeatures( VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderDemoteToHelperInvocationFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderDemoteToHelperInvocationFeatures & - operator=( PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderDemoteToHelperInvocationFeatures & operator=( VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderDemoteToHelperInvocationFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderDemoteToHelperInvocationFeatures & - setShaderDemoteToHelperInvocation( VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation_ ) VULKAN_HPP_NOEXCEPT - { - shaderDemoteToHelperInvocation = shaderDemoteToHelperInvocation_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderDemoteToHelperInvocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderDemoteToHelperInvocation == rhs.shaderDemoteToHelperInvocation ); -# endif - } - - bool operator!=( PhysicalDeviceShaderDemoteToHelperInvocationFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderDemoteToHelperInvocationFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderDemoteToHelperInvocationFeatures; - }; - using PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT = PhysicalDeviceShaderDemoteToHelperInvocationFeatures; - - struct PhysicalDeviceShaderDrawParametersFeatures - { - using NativeType = VkPhysicalDeviceShaderDrawParametersFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderDrawParametersFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderDrawParametersFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderDrawParameters( shaderDrawParameters_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderDrawParametersFeatures( PhysicalDeviceShaderDrawParametersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderDrawParametersFeatures( VkPhysicalDeviceShaderDrawParametersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderDrawParametersFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderDrawParametersFeatures & operator=( PhysicalDeviceShaderDrawParametersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderDrawParametersFeatures & operator=( VkPhysicalDeviceShaderDrawParametersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderDrawParametersFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderDrawParametersFeatures & - setShaderDrawParameters( VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters_ ) VULKAN_HPP_NOEXCEPT - { - shaderDrawParameters = shaderDrawParameters_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderDrawParametersFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderDrawParametersFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderDrawParameters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderDrawParametersFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderDrawParametersFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderDrawParameters == rhs.shaderDrawParameters ); -# endif - } - - bool operator!=( PhysicalDeviceShaderDrawParametersFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderDrawParametersFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderDrawParametersFeatures; - }; - using PhysicalDeviceShaderDrawParameterFeatures = PhysicalDeviceShaderDrawParametersFeatures; - - struct PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD - { - using NativeType = VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD( VULKAN_HPP_NAMESPACE::Bool32 shaderEarlyAndLateFragmentTests_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderEarlyAndLateFragmentTests( shaderEarlyAndLateFragmentTests_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD( PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD( VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD & - operator=( PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD & - operator=( VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD & - setShaderEarlyAndLateFragmentTests( VULKAN_HPP_NAMESPACE::Bool32 shaderEarlyAndLateFragmentTests_ ) VULKAN_HPP_NOEXCEPT - { - shaderEarlyAndLateFragmentTests = shaderEarlyAndLateFragmentTests_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderEarlyAndLateFragmentTests ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderEarlyAndLateFragmentTests == rhs.shaderEarlyAndLateFragmentTests ); -# endif - } - - bool operator!=( PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderEarlyAndLateFragmentTests = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD; - }; - - struct PhysicalDeviceShaderFloat16Int8Features - { - using NativeType = VkPhysicalDeviceShaderFloat16Int8Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderFloat16Int8Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderFloat16Int8Features( VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInt8_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderFloat16( shaderFloat16_ ) - , shaderInt8( shaderInt8_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderFloat16Int8Features( PhysicalDeviceShaderFloat16Int8Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderFloat16Int8Features( VkPhysicalDeviceShaderFloat16Int8Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderFloat16Int8Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderFloat16Int8Features & operator=( PhysicalDeviceShaderFloat16Int8Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderFloat16Int8Features & operator=( VkPhysicalDeviceShaderFloat16Int8Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderFloat16Int8Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderFloat16Int8Features & setShaderFloat16( VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16_ ) VULKAN_HPP_NOEXCEPT - { - shaderFloat16 = shaderFloat16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderFloat16Int8Features & setShaderInt8( VULKAN_HPP_NAMESPACE::Bool32 shaderInt8_ ) VULKAN_HPP_NOEXCEPT - { - shaderInt8 = shaderInt8_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderFloat16Int8Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderFloat16Int8Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderFloat16, shaderInt8 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderFloat16Int8Features const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderFloat16Int8Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderFloat16 == rhs.shaderFloat16 ) && ( shaderInt8 == rhs.shaderInt8 ); -# endif - } - - bool operator!=( PhysicalDeviceShaderFloat16Int8Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderFloat16Int8Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInt8 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderFloat16Int8Features; - }; - using PhysicalDeviceFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; - using PhysicalDeviceShaderFloat16Int8FeaturesKHR = PhysicalDeviceShaderFloat16Int8Features; - - struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT - { - using NativeType = VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderImageAtomicInt64FeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 shaderImageInt64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 sparseImageInt64Atomics_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderImageInt64Atomics( shaderImageInt64Atomics_ ) - , sparseImageInt64Atomics( sparseImageInt64Atomics_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderImageAtomicInt64FeaturesEXT( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderImageAtomicInt64FeaturesEXT( VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderImageAtomicInt64FeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderImageAtomicInt64FeaturesEXT & operator=( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderImageAtomicInt64FeaturesEXT & operator=( VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderImageAtomicInt64FeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderImageAtomicInt64FeaturesEXT & - setShaderImageInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderImageInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderImageInt64Atomics = shaderImageInt64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderImageAtomicInt64FeaturesEXT & - setSparseImageInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 sparseImageInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - sparseImageInt64Atomics = sparseImageInt64Atomics_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderImageInt64Atomics, sparseImageInt64Atomics ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderImageInt64Atomics == rhs.shaderImageInt64Atomics ) && - ( sparseImageInt64Atomics == rhs.sparseImageInt64Atomics ); -# endif - } - - bool operator!=( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderImageInt64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 sparseImageInt64Atomics = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderImageAtomicInt64FeaturesEXT; - }; - - struct PhysicalDeviceShaderImageFootprintFeaturesNV - { - using NativeType = VkPhysicalDeviceShaderImageFootprintFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderImageFootprintFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderImageFootprintFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 imageFootprint_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageFootprint( imageFootprint_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderImageFootprintFeaturesNV( PhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderImageFootprintFeaturesNV( VkPhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderImageFootprintFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderImageFootprintFeaturesNV & operator=( PhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderImageFootprintFeaturesNV & operator=( VkPhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderImageFootprintFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderImageFootprintFeaturesNV & setImageFootprint( VULKAN_HPP_NAMESPACE::Bool32 imageFootprint_ ) VULKAN_HPP_NOEXCEPT - { - imageFootprint = imageFootprint_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderImageFootprintFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderImageFootprintFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageFootprint ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderImageFootprintFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageFootprint == rhs.imageFootprint ); -# endif - } - - bool operator!=( PhysicalDeviceShaderImageFootprintFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderImageFootprintFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 imageFootprint = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderImageFootprintFeaturesNV; - }; - - struct PhysicalDeviceShaderIntegerDotProductFeatures - { - using NativeType = VkPhysicalDeviceShaderIntegerDotProductFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderIntegerDotProductFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderIntegerDotProductFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderIntegerDotProduct( shaderIntegerDotProduct_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderIntegerDotProductFeatures( PhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerDotProductFeatures( VkPhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderIntegerDotProductFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderIntegerDotProductFeatures & operator=( PhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerDotProductFeatures & operator=( VkPhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderIntegerDotProductFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderIntegerDotProductFeatures & - setShaderIntegerDotProduct( VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct_ ) VULKAN_HPP_NOEXCEPT - { - shaderIntegerDotProduct = shaderIntegerDotProduct_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderIntegerDotProductFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderIntegerDotProductFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderIntegerDotProduct ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderIntegerDotProductFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderIntegerDotProduct == rhs.shaderIntegerDotProduct ); -# endif - } - - bool operator!=( PhysicalDeviceShaderIntegerDotProductFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderIntegerDotProductFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderIntegerDotProductFeatures; - }; - using PhysicalDeviceShaderIntegerDotProductFeaturesKHR = PhysicalDeviceShaderIntegerDotProductFeatures; - - struct PhysicalDeviceShaderIntegerDotProductProperties - { - using NativeType = VkPhysicalDeviceShaderIntegerDotProductProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderIntegerDotProductProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderIntegerDotProductProperties( - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , integerDotProduct8BitUnsignedAccelerated( integerDotProduct8BitUnsignedAccelerated_ ) - , integerDotProduct8BitSignedAccelerated( integerDotProduct8BitSignedAccelerated_ ) - , integerDotProduct8BitMixedSignednessAccelerated( integerDotProduct8BitMixedSignednessAccelerated_ ) - , integerDotProduct4x8BitPackedUnsignedAccelerated( integerDotProduct4x8BitPackedUnsignedAccelerated_ ) - , integerDotProduct4x8BitPackedSignedAccelerated( integerDotProduct4x8BitPackedSignedAccelerated_ ) - , integerDotProduct4x8BitPackedMixedSignednessAccelerated( integerDotProduct4x8BitPackedMixedSignednessAccelerated_ ) - , integerDotProduct16BitUnsignedAccelerated( integerDotProduct16BitUnsignedAccelerated_ ) - , integerDotProduct16BitSignedAccelerated( integerDotProduct16BitSignedAccelerated_ ) - , integerDotProduct16BitMixedSignednessAccelerated( integerDotProduct16BitMixedSignednessAccelerated_ ) - , integerDotProduct32BitUnsignedAccelerated( integerDotProduct32BitUnsignedAccelerated_ ) - , integerDotProduct32BitSignedAccelerated( integerDotProduct32BitSignedAccelerated_ ) - , integerDotProduct32BitMixedSignednessAccelerated( integerDotProduct32BitMixedSignednessAccelerated_ ) - , integerDotProduct64BitUnsignedAccelerated( integerDotProduct64BitUnsignedAccelerated_ ) - , integerDotProduct64BitSignedAccelerated( integerDotProduct64BitSignedAccelerated_ ) - , integerDotProduct64BitMixedSignednessAccelerated( integerDotProduct64BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitUnsignedAccelerated( integerDotProductAccumulatingSaturating8BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitSignedAccelerated( integerDotProductAccumulatingSaturating8BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated( integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated( integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated( - integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitUnsignedAccelerated( integerDotProductAccumulatingSaturating16BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitSignedAccelerated( integerDotProductAccumulatingSaturating16BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitUnsignedAccelerated( integerDotProductAccumulatingSaturating32BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitSignedAccelerated( integerDotProductAccumulatingSaturating32BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitUnsignedAccelerated( integerDotProductAccumulatingSaturating64BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitSignedAccelerated( integerDotProductAccumulatingSaturating64BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderIntegerDotProductProperties( PhysicalDeviceShaderIntegerDotProductProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerDotProductProperties( VkPhysicalDeviceShaderIntegerDotProductProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderIntegerDotProductProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderIntegerDotProductProperties & operator=( PhysicalDeviceShaderIntegerDotProductProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerDotProductProperties & operator=( VkPhysicalDeviceShaderIntegerDotProductProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShaderIntegerDotProductProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderIntegerDotProductProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - integerDotProduct8BitUnsignedAccelerated, - integerDotProduct8BitSignedAccelerated, - integerDotProduct8BitMixedSignednessAccelerated, - integerDotProduct4x8BitPackedUnsignedAccelerated, - integerDotProduct4x8BitPackedSignedAccelerated, - integerDotProduct4x8BitPackedMixedSignednessAccelerated, - integerDotProduct16BitUnsignedAccelerated, - integerDotProduct16BitSignedAccelerated, - integerDotProduct16BitMixedSignednessAccelerated, - integerDotProduct32BitUnsignedAccelerated, - integerDotProduct32BitSignedAccelerated, - integerDotProduct32BitMixedSignednessAccelerated, - integerDotProduct64BitUnsignedAccelerated, - integerDotProduct64BitSignedAccelerated, - integerDotProduct64BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating8BitSignedAccelerated, - integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating16BitSignedAccelerated, - integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating32BitSignedAccelerated, - integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating64BitSignedAccelerated, - integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderIntegerDotProductProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderIntegerDotProductProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( integerDotProduct8BitUnsignedAccelerated == rhs.integerDotProduct8BitUnsignedAccelerated ) && - ( integerDotProduct8BitSignedAccelerated == rhs.integerDotProduct8BitSignedAccelerated ) && - ( integerDotProduct8BitMixedSignednessAccelerated == rhs.integerDotProduct8BitMixedSignednessAccelerated ) && - ( integerDotProduct4x8BitPackedUnsignedAccelerated == rhs.integerDotProduct4x8BitPackedUnsignedAccelerated ) && - ( integerDotProduct4x8BitPackedSignedAccelerated == rhs.integerDotProduct4x8BitPackedSignedAccelerated ) && - ( integerDotProduct4x8BitPackedMixedSignednessAccelerated == rhs.integerDotProduct4x8BitPackedMixedSignednessAccelerated ) && - ( integerDotProduct16BitUnsignedAccelerated == rhs.integerDotProduct16BitUnsignedAccelerated ) && - ( integerDotProduct16BitSignedAccelerated == rhs.integerDotProduct16BitSignedAccelerated ) && - ( integerDotProduct16BitMixedSignednessAccelerated == rhs.integerDotProduct16BitMixedSignednessAccelerated ) && - ( integerDotProduct32BitUnsignedAccelerated == rhs.integerDotProduct32BitUnsignedAccelerated ) && - ( integerDotProduct32BitSignedAccelerated == rhs.integerDotProduct32BitSignedAccelerated ) && - ( integerDotProduct32BitMixedSignednessAccelerated == rhs.integerDotProduct32BitMixedSignednessAccelerated ) && - ( integerDotProduct64BitUnsignedAccelerated == rhs.integerDotProduct64BitUnsignedAccelerated ) && - ( integerDotProduct64BitSignedAccelerated == rhs.integerDotProduct64BitSignedAccelerated ) && - ( integerDotProduct64BitMixedSignednessAccelerated == rhs.integerDotProduct64BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating8BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating16BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating32BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating64BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated ); -# endif - } - - bool operator!=( PhysicalDeviceShaderIntegerDotProductProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderIntegerDotProductProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderIntegerDotProductProperties; - }; - using PhysicalDeviceShaderIntegerDotProductPropertiesKHR = PhysicalDeviceShaderIntegerDotProductProperties; - - struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL - { - using NativeType = VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL( VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerFunctions2_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderIntegerFunctions2( shaderIntegerFunctions2_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL( PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL( VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL & - operator=( PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL & operator=( VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL & - setShaderIntegerFunctions2( VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerFunctions2_ ) VULKAN_HPP_NOEXCEPT - { - shaderIntegerFunctions2 = shaderIntegerFunctions2_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderIntegerFunctions2 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderIntegerFunctions2 == rhs.shaderIntegerFunctions2 ); -# endif - } - - bool operator!=( PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerFunctions2 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL; - }; - - struct PhysicalDeviceShaderModuleIdentifierFeaturesEXT - { - using NativeType = VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderModuleIdentifierFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderModuleIdentifierFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 shaderModuleIdentifier_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderModuleIdentifier( shaderModuleIdentifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderModuleIdentifierFeaturesEXT( PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderModuleIdentifierFeaturesEXT( VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderModuleIdentifierFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderModuleIdentifierFeaturesEXT & operator=( PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderModuleIdentifierFeaturesEXT & operator=( VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderModuleIdentifierFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderModuleIdentifierFeaturesEXT & - setShaderModuleIdentifier( VULKAN_HPP_NAMESPACE::Bool32 shaderModuleIdentifier_ ) VULKAN_HPP_NOEXCEPT - { - shaderModuleIdentifier = shaderModuleIdentifier_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderModuleIdentifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderModuleIdentifier == rhs.shaderModuleIdentifier ); -# endif - } - - bool operator!=( PhysicalDeviceShaderModuleIdentifierFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderModuleIdentifierFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderModuleIdentifier = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderModuleIdentifierFeaturesEXT; - }; - - struct PhysicalDeviceShaderModuleIdentifierPropertiesEXT - { - using NativeType = VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderModuleIdentifierPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PhysicalDeviceShaderModuleIdentifierPropertiesEXT( std::array const & shaderModuleIdentifierAlgorithmUUID_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderModuleIdentifierAlgorithmUUID( shaderModuleIdentifierAlgorithmUUID_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - PhysicalDeviceShaderModuleIdentifierPropertiesEXT( PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderModuleIdentifierPropertiesEXT( VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderModuleIdentifierPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderModuleIdentifierPropertiesEXT & - operator=( PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderModuleIdentifierPropertiesEXT & operator=( VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderModuleIdentifierAlgorithmUUID ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderModuleIdentifierAlgorithmUUID == rhs.shaderModuleIdentifierAlgorithmUUID ); -# endif - } - - bool operator!=( PhysicalDeviceShaderModuleIdentifierPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderModuleIdentifierPropertiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D shaderModuleIdentifierAlgorithmUUID = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderModuleIdentifierPropertiesEXT; - }; - - struct PhysicalDeviceShaderSMBuiltinsFeaturesNV - { - using NativeType = VkPhysicalDeviceShaderSMBuiltinsFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderSmBuiltinsFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSMBuiltinsFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 shaderSMBuiltins_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderSMBuiltins( shaderSMBuiltins_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSMBuiltinsFeaturesNV( PhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSMBuiltinsFeaturesNV( VkPhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderSMBuiltinsFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderSMBuiltinsFeaturesNV & operator=( PhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSMBuiltinsFeaturesNV & operator=( VkPhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSMBuiltinsFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSMBuiltinsFeaturesNV & setShaderSMBuiltins( VULKAN_HPP_NAMESPACE::Bool32 shaderSMBuiltins_ ) VULKAN_HPP_NOEXCEPT - { - shaderSMBuiltins = shaderSMBuiltins_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderSMBuiltinsFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderSMBuiltinsFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderSMBuiltins ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderSMBuiltinsFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderSMBuiltins == rhs.shaderSMBuiltins ); -# endif - } - - bool operator!=( PhysicalDeviceShaderSMBuiltinsFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderSmBuiltinsFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSMBuiltins = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderSMBuiltinsFeaturesNV; - }; - - struct PhysicalDeviceShaderSMBuiltinsPropertiesNV - { - using NativeType = VkPhysicalDeviceShaderSMBuiltinsPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderSmBuiltinsPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderSMBuiltinsPropertiesNV( uint32_t shaderSMCount_ = {}, uint32_t shaderWarpsPerSM_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderSMCount( shaderSMCount_ ) - , shaderWarpsPerSM( shaderWarpsPerSM_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSMBuiltinsPropertiesNV( PhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSMBuiltinsPropertiesNV( VkPhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderSMBuiltinsPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderSMBuiltinsPropertiesNV & operator=( PhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSMBuiltinsPropertiesNV & operator=( VkPhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShaderSMBuiltinsPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderSMBuiltinsPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderSMCount, shaderWarpsPerSM ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderSMBuiltinsPropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderSMCount == rhs.shaderSMCount ) && ( shaderWarpsPerSM == rhs.shaderWarpsPerSM ); -# endif - } - - bool operator!=( PhysicalDeviceShaderSMBuiltinsPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderSmBuiltinsPropertiesNV; - void * pNext = {}; - uint32_t shaderSMCount = {}; - uint32_t shaderWarpsPerSM = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderSMBuiltinsPropertiesNV; - }; - - struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures - { - using NativeType = VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderSubgroupExtendedTypesFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSubgroupExtendedTypesFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderSubgroupExtendedTypes( shaderSubgroupExtendedTypes_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderSubgroupExtendedTypesFeatures( PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSubgroupExtendedTypesFeatures( VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderSubgroupExtendedTypesFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderSubgroupExtendedTypesFeatures & - operator=( PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSubgroupExtendedTypesFeatures & operator=( VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSubgroupExtendedTypesFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSubgroupExtendedTypesFeatures & - setShaderSubgroupExtendedTypes( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes_ ) VULKAN_HPP_NOEXCEPT - { - shaderSubgroupExtendedTypes = shaderSubgroupExtendedTypes_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderSubgroupExtendedTypes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderSubgroupExtendedTypes == rhs.shaderSubgroupExtendedTypes ); -# endif - } - - bool operator!=( PhysicalDeviceShaderSubgroupExtendedTypesFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderSubgroupExtendedTypesFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderSubgroupExtendedTypesFeatures; - }; - using PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR = PhysicalDeviceShaderSubgroupExtendedTypesFeatures; - - struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR - { - using NativeType = VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupUniformControlFlow_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderSubgroupUniformControlFlow( shaderSubgroupUniformControlFlow_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR( PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR( VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR( - *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR & - operator=( PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR & - operator=( VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR & - setShaderSubgroupUniformControlFlow( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupUniformControlFlow_ ) VULKAN_HPP_NOEXCEPT - { - shaderSubgroupUniformControlFlow = shaderSubgroupUniformControlFlow_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderSubgroupUniformControlFlow ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderSubgroupUniformControlFlow == rhs.shaderSubgroupUniformControlFlow ); -# endif - } - - bool operator!=( PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupUniformControlFlow = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR; - }; - - struct PhysicalDeviceShaderTerminateInvocationFeatures - { - using NativeType = VkPhysicalDeviceShaderTerminateInvocationFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShaderTerminateInvocationFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShaderTerminateInvocationFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderTerminateInvocation( shaderTerminateInvocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceShaderTerminateInvocationFeatures( PhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderTerminateInvocationFeatures( VkPhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShaderTerminateInvocationFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShaderTerminateInvocationFeatures & operator=( PhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShaderTerminateInvocationFeatures & operator=( VkPhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderTerminateInvocationFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShaderTerminateInvocationFeatures & - setShaderTerminateInvocation( VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation_ ) VULKAN_HPP_NOEXCEPT - { - shaderTerminateInvocation = shaderTerminateInvocation_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShaderTerminateInvocationFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShaderTerminateInvocationFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderTerminateInvocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShaderTerminateInvocationFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderTerminateInvocation == rhs.shaderTerminateInvocation ); -# endif - } - - bool operator!=( PhysicalDeviceShaderTerminateInvocationFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShaderTerminateInvocationFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShaderTerminateInvocationFeatures; - }; - using PhysicalDeviceShaderTerminateInvocationFeaturesKHR = PhysicalDeviceShaderTerminateInvocationFeatures; - - struct PhysicalDeviceShadingRateImageFeaturesNV - { - using NativeType = VkPhysicalDeviceShadingRateImageFeaturesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShadingRateImageFeaturesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShadingRateImageFeaturesNV( VULKAN_HPP_NAMESPACE::Bool32 shadingRateImage_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shadingRateCoarseSampleOrder_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shadingRateImage( shadingRateImage_ ) - , shadingRateCoarseSampleOrder( shadingRateCoarseSampleOrder_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShadingRateImageFeaturesNV( PhysicalDeviceShadingRateImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShadingRateImageFeaturesNV( VkPhysicalDeviceShadingRateImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShadingRateImageFeaturesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShadingRateImageFeaturesNV & operator=( PhysicalDeviceShadingRateImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShadingRateImageFeaturesNV & operator=( VkPhysicalDeviceShadingRateImageFeaturesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShadingRateImageFeaturesNV & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShadingRateImageFeaturesNV & setShadingRateImage( VULKAN_HPP_NAMESPACE::Bool32 shadingRateImage_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateImage = shadingRateImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceShadingRateImageFeaturesNV & - setShadingRateCoarseSampleOrder( VULKAN_HPP_NAMESPACE::Bool32 shadingRateCoarseSampleOrder_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateCoarseSampleOrder = shadingRateCoarseSampleOrder_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceShadingRateImageFeaturesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShadingRateImageFeaturesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shadingRateImage, shadingRateCoarseSampleOrder ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShadingRateImageFeaturesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceShadingRateImageFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shadingRateImage == rhs.shadingRateImage ) && - ( shadingRateCoarseSampleOrder == rhs.shadingRateCoarseSampleOrder ); -# endif - } - - bool operator!=( PhysicalDeviceShadingRateImageFeaturesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShadingRateImageFeaturesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shadingRateImage = {}; - VULKAN_HPP_NAMESPACE::Bool32 shadingRateCoarseSampleOrder = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShadingRateImageFeaturesNV; - }; - - struct PhysicalDeviceShadingRateImagePropertiesNV - { - using NativeType = VkPhysicalDeviceShadingRateImagePropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceShadingRateImagePropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceShadingRateImagePropertiesNV( VULKAN_HPP_NAMESPACE::Extent2D shadingRateTexelSize_ = {}, - uint32_t shadingRatePaletteSize_ = {}, - uint32_t shadingRateMaxCoarseSamples_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shadingRateTexelSize( shadingRateTexelSize_ ) - , shadingRatePaletteSize( shadingRatePaletteSize_ ) - , shadingRateMaxCoarseSamples( shadingRateMaxCoarseSamples_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceShadingRateImagePropertiesNV( PhysicalDeviceShadingRateImagePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShadingRateImagePropertiesNV( VkPhysicalDeviceShadingRateImagePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceShadingRateImagePropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceShadingRateImagePropertiesNV & operator=( PhysicalDeviceShadingRateImagePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceShadingRateImagePropertiesNV & operator=( VkPhysicalDeviceShadingRateImagePropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceShadingRateImagePropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceShadingRateImagePropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shadingRateTexelSize, shadingRatePaletteSize, shadingRateMaxCoarseSamples ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceShadingRateImagePropertiesNV const & ) const = default; -#else - bool operator==( PhysicalDeviceShadingRateImagePropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shadingRateTexelSize == rhs.shadingRateTexelSize ) && - ( shadingRatePaletteSize == rhs.shadingRatePaletteSize ) && ( shadingRateMaxCoarseSamples == rhs.shadingRateMaxCoarseSamples ); -# endif - } - - bool operator!=( PhysicalDeviceShadingRateImagePropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceShadingRateImagePropertiesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D shadingRateTexelSize = {}; - uint32_t shadingRatePaletteSize = {}; - uint32_t shadingRateMaxCoarseSamples = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceShadingRateImagePropertiesNV; - }; - - struct PhysicalDeviceSparseImageFormatInfo2 - { - using NativeType = VkPhysicalDeviceSparseImageFormatInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSparseImageFormatInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceSparseImageFormatInfo2( VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ImageType type_ = VULKAN_HPP_NAMESPACE::ImageType::e1D, - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1, - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ = {}, - VULKAN_HPP_NAMESPACE::ImageTiling tiling_ = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , type( type_ ) - , samples( samples_ ) - , usage( usage_ ) - , tiling( tiling_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSparseImageFormatInfo2( PhysicalDeviceSparseImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSparseImageFormatInfo2( VkPhysicalDeviceSparseImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSparseImageFormatInfo2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSparseImageFormatInfo2 & operator=( PhysicalDeviceSparseImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSparseImageFormatInfo2 & operator=( VkPhysicalDeviceSparseImageFormatInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setType( VULKAN_HPP_NAMESPACE::ImageType type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setSamples( VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples_ ) VULKAN_HPP_NOEXCEPT - { - samples = samples_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags usage_ ) VULKAN_HPP_NOEXCEPT - { - usage = usage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSparseImageFormatInfo2 & setTiling( VULKAN_HPP_NAMESPACE::ImageTiling tiling_ ) VULKAN_HPP_NOEXCEPT - { - tiling = tiling_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSparseImageFormatInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSparseImageFormatInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, format, type, samples, usage, tiling ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSparseImageFormatInfo2 const & ) const = default; -#else - bool operator==( PhysicalDeviceSparseImageFormatInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( type == rhs.type ) && ( samples == rhs.samples ) && - ( usage == rhs.usage ) && ( tiling == rhs.tiling ); -# endif - } - - bool operator!=( PhysicalDeviceSparseImageFormatInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSparseImageFormatInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ImageType type = VULKAN_HPP_NAMESPACE::ImageType::e1D; - VULKAN_HPP_NAMESPACE::SampleCountFlagBits samples = VULKAN_HPP_NAMESPACE::SampleCountFlagBits::e1; - VULKAN_HPP_NAMESPACE::ImageUsageFlags usage = {}; - VULKAN_HPP_NAMESPACE::ImageTiling tiling = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSparseImageFormatInfo2; - }; - using PhysicalDeviceSparseImageFormatInfo2KHR = PhysicalDeviceSparseImageFormatInfo2; - - struct PhysicalDeviceSubgroupProperties - { - using NativeType = VkPhysicalDeviceSubgroupProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubgroupProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupProperties( uint32_t subgroupSize_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags supportedStages_ = {}, - VULKAN_HPP_NAMESPACE::SubgroupFeatureFlags supportedOperations_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 quadOperationsInAllStages_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subgroupSize( subgroupSize_ ) - , supportedStages( supportedStages_ ) - , supportedOperations( supportedOperations_ ) - , quadOperationsInAllStages( quadOperationsInAllStages_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupProperties( PhysicalDeviceSubgroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupProperties( VkPhysicalDeviceSubgroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubgroupProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubgroupProperties & operator=( PhysicalDeviceSubgroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupProperties & operator=( VkPhysicalDeviceSubgroupProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSubgroupProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubgroupProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subgroupSize, supportedStages, supportedOperations, quadOperationsInAllStages ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubgroupProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceSubgroupProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subgroupSize == rhs.subgroupSize ) && ( supportedStages == rhs.supportedStages ) && - ( supportedOperations == rhs.supportedOperations ) && ( quadOperationsInAllStages == rhs.quadOperationsInAllStages ); -# endif - } - - bool operator!=( PhysicalDeviceSubgroupProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubgroupProperties; - void * pNext = {}; - uint32_t subgroupSize = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags supportedStages = {}; - VULKAN_HPP_NAMESPACE::SubgroupFeatureFlags supportedOperations = {}; - VULKAN_HPP_NAMESPACE::Bool32 quadOperationsInAllStages = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubgroupProperties; - }; - - struct PhysicalDeviceSubgroupSizeControlFeatures - { - using NativeType = VkPhysicalDeviceSubgroupSizeControlFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubgroupSizeControlFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupSizeControlFeatures( VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subgroupSizeControl( subgroupSizeControl_ ) - , computeFullSubgroups( computeFullSubgroups_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupSizeControlFeatures( PhysicalDeviceSubgroupSizeControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupSizeControlFeatures( VkPhysicalDeviceSubgroupSizeControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubgroupSizeControlFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubgroupSizeControlFeatures & operator=( PhysicalDeviceSubgroupSizeControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupSizeControlFeatures & operator=( VkPhysicalDeviceSubgroupSizeControlFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubgroupSizeControlFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubgroupSizeControlFeatures & - setSubgroupSizeControl( VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl_ ) VULKAN_HPP_NOEXCEPT - { - subgroupSizeControl = subgroupSizeControl_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubgroupSizeControlFeatures & - setComputeFullSubgroups( VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups_ ) VULKAN_HPP_NOEXCEPT - { - computeFullSubgroups = computeFullSubgroups_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSubgroupSizeControlFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubgroupSizeControlFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subgroupSizeControl, computeFullSubgroups ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubgroupSizeControlFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceSubgroupSizeControlFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subgroupSizeControl == rhs.subgroupSizeControl ) && - ( computeFullSubgroups == rhs.computeFullSubgroups ); -# endif - } - - bool operator!=( PhysicalDeviceSubgroupSizeControlFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubgroupSizeControlFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl = {}; - VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubgroupSizeControlFeatures; - }; - using PhysicalDeviceSubgroupSizeControlFeaturesEXT = PhysicalDeviceSubgroupSizeControlFeatures; - - struct PhysicalDeviceSubgroupSizeControlProperties - { - using NativeType = VkPhysicalDeviceSubgroupSizeControlProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubgroupSizeControlProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupSizeControlProperties( uint32_t minSubgroupSize_ = {}, - uint32_t maxSubgroupSize_ = {}, - uint32_t maxComputeWorkgroupSubgroups_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags requiredSubgroupSizeStages_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minSubgroupSize( minSubgroupSize_ ) - , maxSubgroupSize( maxSubgroupSize_ ) - , maxComputeWorkgroupSubgroups( maxComputeWorkgroupSubgroups_ ) - , requiredSubgroupSizeStages( requiredSubgroupSizeStages_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubgroupSizeControlProperties( PhysicalDeviceSubgroupSizeControlProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupSizeControlProperties( VkPhysicalDeviceSubgroupSizeControlProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubgroupSizeControlProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubgroupSizeControlProperties & operator=( PhysicalDeviceSubgroupSizeControlProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubgroupSizeControlProperties & operator=( VkPhysicalDeviceSubgroupSizeControlProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSubgroupSizeControlProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubgroupSizeControlProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, minSubgroupSize, maxSubgroupSize, maxComputeWorkgroupSubgroups, requiredSubgroupSizeStages ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubgroupSizeControlProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceSubgroupSizeControlProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minSubgroupSize == rhs.minSubgroupSize ) && ( maxSubgroupSize == rhs.maxSubgroupSize ) && - ( maxComputeWorkgroupSubgroups == rhs.maxComputeWorkgroupSubgroups ) && ( requiredSubgroupSizeStages == rhs.requiredSubgroupSizeStages ); -# endif - } - - bool operator!=( PhysicalDeviceSubgroupSizeControlProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubgroupSizeControlProperties; - void * pNext = {}; - uint32_t minSubgroupSize = {}; - uint32_t maxSubgroupSize = {}; - uint32_t maxComputeWorkgroupSubgroups = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags requiredSubgroupSizeStages = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubgroupSizeControlProperties; - }; - using PhysicalDeviceSubgroupSizeControlPropertiesEXT = PhysicalDeviceSubgroupSizeControlProperties; - - struct PhysicalDeviceSubpassMergeFeedbackFeaturesEXT - { - using NativeType = VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubpassMergeFeedbackFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 subpassMergeFeedback_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subpassMergeFeedback( subpassMergeFeedback_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceSubpassMergeFeedbackFeaturesEXT( PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassMergeFeedbackFeaturesEXT( VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubpassMergeFeedbackFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubpassMergeFeedbackFeaturesEXT & operator=( PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassMergeFeedbackFeaturesEXT & operator=( VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubpassMergeFeedbackFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubpassMergeFeedbackFeaturesEXT & - setSubpassMergeFeedback( VULKAN_HPP_NAMESPACE::Bool32 subpassMergeFeedback_ ) VULKAN_HPP_NOEXCEPT - { - subpassMergeFeedback = subpassMergeFeedback_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subpassMergeFeedback ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subpassMergeFeedback == rhs.subpassMergeFeedback ); -# endif - } - - bool operator!=( PhysicalDeviceSubpassMergeFeedbackFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 subpassMergeFeedback = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubpassMergeFeedbackFeaturesEXT; - }; - - struct PhysicalDeviceSubpassShadingFeaturesHUAWEI - { - using NativeType = VkPhysicalDeviceSubpassShadingFeaturesHUAWEI; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubpassShadingFeaturesHUAWEI; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubpassShadingFeaturesHUAWEI( VULKAN_HPP_NAMESPACE::Bool32 subpassShading_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subpassShading( subpassShading_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubpassShadingFeaturesHUAWEI( PhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassShadingFeaturesHUAWEI( VkPhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubpassShadingFeaturesHUAWEI( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubpassShadingFeaturesHUAWEI & operator=( PhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassShadingFeaturesHUAWEI & operator=( VkPhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubpassShadingFeaturesHUAWEI & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSubpassShadingFeaturesHUAWEI & setSubpassShading( VULKAN_HPP_NAMESPACE::Bool32 subpassShading_ ) VULKAN_HPP_NOEXCEPT - { - subpassShading = subpassShading_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSubpassShadingFeaturesHUAWEI const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubpassShadingFeaturesHUAWEI &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subpassShading ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubpassShadingFeaturesHUAWEI const & ) const = default; -#else - bool operator==( PhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subpassShading == rhs.subpassShading ); -# endif - } - - bool operator!=( PhysicalDeviceSubpassShadingFeaturesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubpassShadingFeaturesHUAWEI; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 subpassShading = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubpassShadingFeaturesHUAWEI; - }; - - struct PhysicalDeviceSubpassShadingPropertiesHUAWEI - { - using NativeType = VkPhysicalDeviceSubpassShadingPropertiesHUAWEI; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSubpassShadingPropertiesHUAWEI; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubpassShadingPropertiesHUAWEI( uint32_t maxSubpassShadingWorkgroupSizeAspectRatio_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxSubpassShadingWorkgroupSizeAspectRatio( maxSubpassShadingWorkgroupSizeAspectRatio_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSubpassShadingPropertiesHUAWEI( PhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassShadingPropertiesHUAWEI( VkPhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSubpassShadingPropertiesHUAWEI( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSubpassShadingPropertiesHUAWEI & operator=( PhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSubpassShadingPropertiesHUAWEI & operator=( VkPhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceSubpassShadingPropertiesHUAWEI const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSubpassShadingPropertiesHUAWEI &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxSubpassShadingWorkgroupSizeAspectRatio ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSubpassShadingPropertiesHUAWEI const & ) const = default; -#else - bool operator==( PhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxSubpassShadingWorkgroupSizeAspectRatio == rhs.maxSubpassShadingWorkgroupSizeAspectRatio ); -# endif - } - - bool operator!=( PhysicalDeviceSubpassShadingPropertiesHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSubpassShadingPropertiesHUAWEI; - void * pNext = {}; - uint32_t maxSubpassShadingWorkgroupSizeAspectRatio = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSubpassShadingPropertiesHUAWEI; - }; - - struct PhysicalDeviceSurfaceInfo2KHR - { - using NativeType = VkPhysicalDeviceSurfaceInfo2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSurfaceInfo2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSurfaceInfo2KHR( VULKAN_HPP_NAMESPACE::SurfaceKHR surface_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , surface( surface_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSurfaceInfo2KHR( PhysicalDeviceSurfaceInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSurfaceInfo2KHR( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSurfaceInfo2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSurfaceInfo2KHR & operator=( PhysicalDeviceSurfaceInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSurfaceInfo2KHR & operator=( VkPhysicalDeviceSurfaceInfo2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSurfaceInfo2KHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSurfaceInfo2KHR & setSurface( VULKAN_HPP_NAMESPACE::SurfaceKHR surface_ ) VULKAN_HPP_NOEXCEPT - { - surface = surface_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSurfaceInfo2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSurfaceInfo2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, surface ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSurfaceInfo2KHR const & ) const = default; -#else - bool operator==( PhysicalDeviceSurfaceInfo2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( surface == rhs.surface ); -# endif - } - - bool operator!=( PhysicalDeviceSurfaceInfo2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSurfaceInfo2KHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceKHR surface = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSurfaceInfo2KHR; - }; - - struct PhysicalDeviceSynchronization2Features - { - using NativeType = VkPhysicalDeviceSynchronization2Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceSynchronization2Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceSynchronization2Features( VULKAN_HPP_NAMESPACE::Bool32 synchronization2_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , synchronization2( synchronization2_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceSynchronization2Features( PhysicalDeviceSynchronization2Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSynchronization2Features( VkPhysicalDeviceSynchronization2Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceSynchronization2Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceSynchronization2Features & operator=( PhysicalDeviceSynchronization2Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceSynchronization2Features & operator=( VkPhysicalDeviceSynchronization2Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSynchronization2Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceSynchronization2Features & setSynchronization2( VULKAN_HPP_NAMESPACE::Bool32 synchronization2_ ) VULKAN_HPP_NOEXCEPT - { - synchronization2 = synchronization2_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceSynchronization2Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceSynchronization2Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, synchronization2 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceSynchronization2Features const & ) const = default; -#else - bool operator==( PhysicalDeviceSynchronization2Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( synchronization2 == rhs.synchronization2 ); -# endif - } - - bool operator!=( PhysicalDeviceSynchronization2Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceSynchronization2Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 synchronization2 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceSynchronization2Features; - }; - using PhysicalDeviceSynchronization2FeaturesKHR = PhysicalDeviceSynchronization2Features; - - struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT - { - using NativeType = VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTexelBufferAlignmentFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTexelBufferAlignmentFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 texelBufferAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , texelBufferAlignment( texelBufferAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceTexelBufferAlignmentFeaturesEXT( PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTexelBufferAlignmentFeaturesEXT( VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTexelBufferAlignmentFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTexelBufferAlignmentFeaturesEXT & operator=( PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTexelBufferAlignmentFeaturesEXT & operator=( VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTexelBufferAlignmentFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTexelBufferAlignmentFeaturesEXT & - setTexelBufferAlignment( VULKAN_HPP_NAMESPACE::Bool32 texelBufferAlignment_ ) VULKAN_HPP_NOEXCEPT - { - texelBufferAlignment = texelBufferAlignment_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, texelBufferAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( texelBufferAlignment == rhs.texelBufferAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceTexelBufferAlignmentFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTexelBufferAlignmentFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 texelBufferAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTexelBufferAlignmentFeaturesEXT; - }; - - struct PhysicalDeviceTexelBufferAlignmentProperties - { - using NativeType = VkPhysicalDeviceTexelBufferAlignmentProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTexelBufferAlignmentProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTexelBufferAlignmentProperties( VULKAN_HPP_NAMESPACE::DeviceSize storageTexelBufferOffsetAlignmentBytes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storageTexelBufferOffsetSingleTexelAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize uniformTexelBufferOffsetAlignmentBytes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformTexelBufferOffsetSingleTexelAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , storageTexelBufferOffsetAlignmentBytes( storageTexelBufferOffsetAlignmentBytes_ ) - , storageTexelBufferOffsetSingleTexelAlignment( storageTexelBufferOffsetSingleTexelAlignment_ ) - , uniformTexelBufferOffsetAlignmentBytes( uniformTexelBufferOffsetAlignmentBytes_ ) - , uniformTexelBufferOffsetSingleTexelAlignment( uniformTexelBufferOffsetSingleTexelAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTexelBufferAlignmentProperties( PhysicalDeviceTexelBufferAlignmentProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTexelBufferAlignmentProperties( VkPhysicalDeviceTexelBufferAlignmentProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTexelBufferAlignmentProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTexelBufferAlignmentProperties & operator=( PhysicalDeviceTexelBufferAlignmentProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTexelBufferAlignmentProperties & operator=( VkPhysicalDeviceTexelBufferAlignmentProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceTexelBufferAlignmentProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTexelBufferAlignmentProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - storageTexelBufferOffsetAlignmentBytes, - storageTexelBufferOffsetSingleTexelAlignment, - uniformTexelBufferOffsetAlignmentBytes, - uniformTexelBufferOffsetSingleTexelAlignment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTexelBufferAlignmentProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceTexelBufferAlignmentProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( storageTexelBufferOffsetAlignmentBytes == rhs.storageTexelBufferOffsetAlignmentBytes ) && - ( storageTexelBufferOffsetSingleTexelAlignment == rhs.storageTexelBufferOffsetSingleTexelAlignment ) && - ( uniformTexelBufferOffsetAlignmentBytes == rhs.uniformTexelBufferOffsetAlignmentBytes ) && - ( uniformTexelBufferOffsetSingleTexelAlignment == rhs.uniformTexelBufferOffsetSingleTexelAlignment ); -# endif - } - - bool operator!=( PhysicalDeviceTexelBufferAlignmentProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTexelBufferAlignmentProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DeviceSize storageTexelBufferOffsetAlignmentBytes = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageTexelBufferOffsetSingleTexelAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize uniformTexelBufferOffsetAlignmentBytes = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformTexelBufferOffsetSingleTexelAlignment = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTexelBufferAlignmentProperties; - }; - using PhysicalDeviceTexelBufferAlignmentPropertiesEXT = PhysicalDeviceTexelBufferAlignmentProperties; - - struct PhysicalDeviceTextureCompressionASTCHDRFeatures - { - using NativeType = VkPhysicalDeviceTextureCompressionASTCHDRFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTextureCompressionAstcHdrFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTextureCompressionASTCHDRFeatures( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , textureCompressionASTC_HDR( textureCompressionASTC_HDR_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceTextureCompressionASTCHDRFeatures( PhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTextureCompressionASTCHDRFeatures( VkPhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTextureCompressionASTCHDRFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTextureCompressionASTCHDRFeatures & operator=( PhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTextureCompressionASTCHDRFeatures & operator=( VkPhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTextureCompressionASTCHDRFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTextureCompressionASTCHDRFeatures & - setTextureCompressionASTC_HDR( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR_ ) VULKAN_HPP_NOEXCEPT - { - textureCompressionASTC_HDR = textureCompressionASTC_HDR_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceTextureCompressionASTCHDRFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTextureCompressionASTCHDRFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, textureCompressionASTC_HDR ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTextureCompressionASTCHDRFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( textureCompressionASTC_HDR == rhs.textureCompressionASTC_HDR ); -# endif - } - - bool operator!=( PhysicalDeviceTextureCompressionASTCHDRFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTextureCompressionAstcHdrFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTextureCompressionASTCHDRFeatures; - }; - using PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT = PhysicalDeviceTextureCompressionASTCHDRFeatures; - - struct PhysicalDeviceTilePropertiesFeaturesQCOM - { - using NativeType = VkPhysicalDeviceTilePropertiesFeaturesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTilePropertiesFeaturesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTilePropertiesFeaturesQCOM( VULKAN_HPP_NAMESPACE::Bool32 tileProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , tileProperties( tileProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTilePropertiesFeaturesQCOM( PhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTilePropertiesFeaturesQCOM( VkPhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTilePropertiesFeaturesQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTilePropertiesFeaturesQCOM & operator=( PhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTilePropertiesFeaturesQCOM & operator=( VkPhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTilePropertiesFeaturesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTilePropertiesFeaturesQCOM & setTileProperties( VULKAN_HPP_NAMESPACE::Bool32 tileProperties_ ) VULKAN_HPP_NOEXCEPT - { - tileProperties = tileProperties_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceTilePropertiesFeaturesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTilePropertiesFeaturesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, tileProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTilePropertiesFeaturesQCOM const & ) const = default; -#else - bool operator==( PhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( tileProperties == rhs.tileProperties ); -# endif - } - - bool operator!=( PhysicalDeviceTilePropertiesFeaturesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTilePropertiesFeaturesQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 tileProperties = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTilePropertiesFeaturesQCOM; - }; - - struct PhysicalDeviceTimelineSemaphoreFeatures - { - using NativeType = VkPhysicalDeviceTimelineSemaphoreFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTimelineSemaphoreFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTimelineSemaphoreFeatures( VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , timelineSemaphore( timelineSemaphore_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTimelineSemaphoreFeatures( PhysicalDeviceTimelineSemaphoreFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTimelineSemaphoreFeatures( VkPhysicalDeviceTimelineSemaphoreFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTimelineSemaphoreFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTimelineSemaphoreFeatures & operator=( PhysicalDeviceTimelineSemaphoreFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTimelineSemaphoreFeatures & operator=( VkPhysicalDeviceTimelineSemaphoreFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTimelineSemaphoreFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTimelineSemaphoreFeatures & - setTimelineSemaphore( VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore_ ) VULKAN_HPP_NOEXCEPT - { - timelineSemaphore = timelineSemaphore_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceTimelineSemaphoreFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTimelineSemaphoreFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, timelineSemaphore ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTimelineSemaphoreFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceTimelineSemaphoreFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( timelineSemaphore == rhs.timelineSemaphore ); -# endif - } - - bool operator!=( PhysicalDeviceTimelineSemaphoreFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTimelineSemaphoreFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTimelineSemaphoreFeatures; - }; - using PhysicalDeviceTimelineSemaphoreFeaturesKHR = PhysicalDeviceTimelineSemaphoreFeatures; - - struct PhysicalDeviceTimelineSemaphoreProperties - { - using NativeType = VkPhysicalDeviceTimelineSemaphoreProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTimelineSemaphoreProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTimelineSemaphoreProperties( uint64_t maxTimelineSemaphoreValueDifference_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxTimelineSemaphoreValueDifference( maxTimelineSemaphoreValueDifference_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTimelineSemaphoreProperties( PhysicalDeviceTimelineSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTimelineSemaphoreProperties( VkPhysicalDeviceTimelineSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTimelineSemaphoreProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTimelineSemaphoreProperties & operator=( PhysicalDeviceTimelineSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTimelineSemaphoreProperties & operator=( VkPhysicalDeviceTimelineSemaphoreProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceTimelineSemaphoreProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTimelineSemaphoreProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxTimelineSemaphoreValueDifference ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTimelineSemaphoreProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceTimelineSemaphoreProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxTimelineSemaphoreValueDifference == rhs.maxTimelineSemaphoreValueDifference ); -# endif - } - - bool operator!=( PhysicalDeviceTimelineSemaphoreProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTimelineSemaphoreProperties; - void * pNext = {}; - uint64_t maxTimelineSemaphoreValueDifference = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTimelineSemaphoreProperties; - }; - using PhysicalDeviceTimelineSemaphorePropertiesKHR = PhysicalDeviceTimelineSemaphoreProperties; - - struct PhysicalDeviceToolProperties - { - using NativeType = VkPhysicalDeviceToolProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceToolProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceToolProperties( std::array const & name_ = {}, - std::array const & version_ = {}, - VULKAN_HPP_NAMESPACE::ToolPurposeFlags purposes_ = {}, - std::array const & description_ = {}, - std::array const & layer_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , name( name_ ) - , version( version_ ) - , purposes( purposes_ ) - , description( description_ ) - , layer( layer_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceToolProperties( PhysicalDeviceToolProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceToolProperties( VkPhysicalDeviceToolProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceToolProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceToolProperties & operator=( PhysicalDeviceToolProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceToolProperties & operator=( VkPhysicalDeviceToolProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceToolProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceToolProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ToolPurposeFlags const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, name, version, purposes, description, layer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceToolProperties const & ) const = default; -#else - bool operator==( PhysicalDeviceToolProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( name == rhs.name ) && ( version == rhs.version ) && ( purposes == rhs.purposes ) && - ( description == rhs.description ) && ( layer == rhs.layer ); -# endif - } - - bool operator!=( PhysicalDeviceToolProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceToolProperties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D name = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D version = {}; - VULKAN_HPP_NAMESPACE::ToolPurposeFlags purposes = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D layer = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceToolProperties; - }; - using PhysicalDeviceToolPropertiesEXT = PhysicalDeviceToolProperties; - - struct PhysicalDeviceTransformFeedbackFeaturesEXT - { - using NativeType = VkPhysicalDeviceTransformFeedbackFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTransformFeedbackFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTransformFeedbackFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 transformFeedback_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 geometryStreams_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , transformFeedback( transformFeedback_ ) - , geometryStreams( geometryStreams_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTransformFeedbackFeaturesEXT( PhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTransformFeedbackFeaturesEXT( VkPhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTransformFeedbackFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTransformFeedbackFeaturesEXT & operator=( PhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTransformFeedbackFeaturesEXT & operator=( VkPhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTransformFeedbackFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTransformFeedbackFeaturesEXT & - setTransformFeedback( VULKAN_HPP_NAMESPACE::Bool32 transformFeedback_ ) VULKAN_HPP_NOEXCEPT - { - transformFeedback = transformFeedback_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceTransformFeedbackFeaturesEXT & setGeometryStreams( VULKAN_HPP_NAMESPACE::Bool32 geometryStreams_ ) VULKAN_HPP_NOEXCEPT - { - geometryStreams = geometryStreams_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceTransformFeedbackFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTransformFeedbackFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, transformFeedback, geometryStreams ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTransformFeedbackFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( transformFeedback == rhs.transformFeedback ) && ( geometryStreams == rhs.geometryStreams ); -# endif - } - - bool operator!=( PhysicalDeviceTransformFeedbackFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTransformFeedbackFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedback = {}; - VULKAN_HPP_NAMESPACE::Bool32 geometryStreams = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTransformFeedbackFeaturesEXT; - }; - - struct PhysicalDeviceTransformFeedbackPropertiesEXT - { - using NativeType = VkPhysicalDeviceTransformFeedbackPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceTransformFeedbackPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceTransformFeedbackPropertiesEXT( uint32_t maxTransformFeedbackStreams_ = {}, - uint32_t maxTransformFeedbackBuffers_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize maxTransformFeedbackBufferSize_ = {}, - uint32_t maxTransformFeedbackStreamDataSize_ = {}, - uint32_t maxTransformFeedbackBufferDataSize_ = {}, - uint32_t maxTransformFeedbackBufferDataStride_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackQueries_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackStreamsLinesTriangles_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackRasterizationStreamSelect_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackDraw_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxTransformFeedbackStreams( maxTransformFeedbackStreams_ ) - , maxTransformFeedbackBuffers( maxTransformFeedbackBuffers_ ) - , maxTransformFeedbackBufferSize( maxTransformFeedbackBufferSize_ ) - , maxTransformFeedbackStreamDataSize( maxTransformFeedbackStreamDataSize_ ) - , maxTransformFeedbackBufferDataSize( maxTransformFeedbackBufferDataSize_ ) - , maxTransformFeedbackBufferDataStride( maxTransformFeedbackBufferDataStride_ ) - , transformFeedbackQueries( transformFeedbackQueries_ ) - , transformFeedbackStreamsLinesTriangles( transformFeedbackStreamsLinesTriangles_ ) - , transformFeedbackRasterizationStreamSelect( transformFeedbackRasterizationStreamSelect_ ) - , transformFeedbackDraw( transformFeedbackDraw_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceTransformFeedbackPropertiesEXT( PhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTransformFeedbackPropertiesEXT( VkPhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceTransformFeedbackPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceTransformFeedbackPropertiesEXT & operator=( PhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceTransformFeedbackPropertiesEXT & operator=( VkPhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceTransformFeedbackPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceTransformFeedbackPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - maxTransformFeedbackStreams, - maxTransformFeedbackBuffers, - maxTransformFeedbackBufferSize, - maxTransformFeedbackStreamDataSize, - maxTransformFeedbackBufferDataSize, - maxTransformFeedbackBufferDataStride, - transformFeedbackQueries, - transformFeedbackStreamsLinesTriangles, - transformFeedbackRasterizationStreamSelect, - transformFeedbackDraw ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceTransformFeedbackPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxTransformFeedbackStreams == rhs.maxTransformFeedbackStreams ) && - ( maxTransformFeedbackBuffers == rhs.maxTransformFeedbackBuffers ) && ( maxTransformFeedbackBufferSize == rhs.maxTransformFeedbackBufferSize ) && - ( maxTransformFeedbackStreamDataSize == rhs.maxTransformFeedbackStreamDataSize ) && - ( maxTransformFeedbackBufferDataSize == rhs.maxTransformFeedbackBufferDataSize ) && - ( maxTransformFeedbackBufferDataStride == rhs.maxTransformFeedbackBufferDataStride ) && - ( transformFeedbackQueries == rhs.transformFeedbackQueries ) && - ( transformFeedbackStreamsLinesTriangles == rhs.transformFeedbackStreamsLinesTriangles ) && - ( transformFeedbackRasterizationStreamSelect == rhs.transformFeedbackRasterizationStreamSelect ) && - ( transformFeedbackDraw == rhs.transformFeedbackDraw ); -# endif - } - - bool operator!=( PhysicalDeviceTransformFeedbackPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceTransformFeedbackPropertiesEXT; - void * pNext = {}; - uint32_t maxTransformFeedbackStreams = {}; - uint32_t maxTransformFeedbackBuffers = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxTransformFeedbackBufferSize = {}; - uint32_t maxTransformFeedbackStreamDataSize = {}; - uint32_t maxTransformFeedbackBufferDataSize = {}; - uint32_t maxTransformFeedbackBufferDataStride = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackQueries = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackStreamsLinesTriangles = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackRasterizationStreamSelect = {}; - VULKAN_HPP_NAMESPACE::Bool32 transformFeedbackDraw = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceTransformFeedbackPropertiesEXT; - }; - - struct PhysicalDeviceUniformBufferStandardLayoutFeatures - { - using NativeType = VkPhysicalDeviceUniformBufferStandardLayoutFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceUniformBufferStandardLayoutFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceUniformBufferStandardLayoutFeatures( VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , uniformBufferStandardLayout( uniformBufferStandardLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceUniformBufferStandardLayoutFeatures( PhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceUniformBufferStandardLayoutFeatures( VkPhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceUniformBufferStandardLayoutFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceUniformBufferStandardLayoutFeatures & - operator=( PhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceUniformBufferStandardLayoutFeatures & operator=( VkPhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceUniformBufferStandardLayoutFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceUniformBufferStandardLayoutFeatures & - setUniformBufferStandardLayout( VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout_ ) VULKAN_HPP_NOEXCEPT - { - uniformBufferStandardLayout = uniformBufferStandardLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceUniformBufferStandardLayoutFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceUniformBufferStandardLayoutFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, uniformBufferStandardLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceUniformBufferStandardLayoutFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( uniformBufferStandardLayout == rhs.uniformBufferStandardLayout ); -# endif - } - - bool operator!=( PhysicalDeviceUniformBufferStandardLayoutFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceUniformBufferStandardLayoutFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceUniformBufferStandardLayoutFeatures; - }; - using PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR = PhysicalDeviceUniformBufferStandardLayoutFeatures; - - struct PhysicalDeviceVariablePointersFeatures - { - using NativeType = VkPhysicalDeviceVariablePointersFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVariablePointersFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVariablePointersFeatures( VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 variablePointers_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , variablePointersStorageBuffer( variablePointersStorageBuffer_ ) - , variablePointers( variablePointers_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVariablePointersFeatures( PhysicalDeviceVariablePointersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVariablePointersFeatures( VkPhysicalDeviceVariablePointersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVariablePointersFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVariablePointersFeatures & operator=( PhysicalDeviceVariablePointersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVariablePointersFeatures & operator=( VkPhysicalDeviceVariablePointersFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVariablePointersFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVariablePointersFeatures & - setVariablePointersStorageBuffer( VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer_ ) VULKAN_HPP_NOEXCEPT - { - variablePointersStorageBuffer = variablePointersStorageBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVariablePointersFeatures & setVariablePointers( VULKAN_HPP_NAMESPACE::Bool32 variablePointers_ ) VULKAN_HPP_NOEXCEPT - { - variablePointers = variablePointers_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVariablePointersFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVariablePointersFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, variablePointersStorageBuffer, variablePointers ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVariablePointersFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceVariablePointersFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( variablePointersStorageBuffer == rhs.variablePointersStorageBuffer ) && - ( variablePointers == rhs.variablePointers ); -# endif - } - - bool operator!=( PhysicalDeviceVariablePointersFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVariablePointersFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer = {}; - VULKAN_HPP_NAMESPACE::Bool32 variablePointers = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVariablePointersFeatures; - }; - using PhysicalDeviceVariablePointerFeatures = PhysicalDeviceVariablePointersFeatures; - using PhysicalDeviceVariablePointerFeaturesKHR = PhysicalDeviceVariablePointersFeatures; - using PhysicalDeviceVariablePointersFeaturesKHR = PhysicalDeviceVariablePointersFeatures; - - struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT - { - using NativeType = VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVertexAttributeDivisorFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVertexAttributeDivisorFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateDivisor_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateZeroDivisor_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexAttributeInstanceRateDivisor( vertexAttributeInstanceRateDivisor_ ) - , vertexAttributeInstanceRateZeroDivisor( vertexAttributeInstanceRateZeroDivisor_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceVertexAttributeDivisorFeaturesEXT( PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexAttributeDivisorFeaturesEXT( VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVertexAttributeDivisorFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVertexAttributeDivisorFeaturesEXT & operator=( PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexAttributeDivisorFeaturesEXT & operator=( VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVertexAttributeDivisorFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVertexAttributeDivisorFeaturesEXT & - setVertexAttributeInstanceRateDivisor( VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateDivisor_ ) VULKAN_HPP_NOEXCEPT - { - vertexAttributeInstanceRateDivisor = vertexAttributeInstanceRateDivisor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVertexAttributeDivisorFeaturesEXT & - setVertexAttributeInstanceRateZeroDivisor( VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateZeroDivisor_ ) VULKAN_HPP_NOEXCEPT - { - vertexAttributeInstanceRateZeroDivisor = vertexAttributeInstanceRateZeroDivisor_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vertexAttributeInstanceRateDivisor, vertexAttributeInstanceRateZeroDivisor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vertexAttributeInstanceRateDivisor == rhs.vertexAttributeInstanceRateDivisor ) && - ( vertexAttributeInstanceRateZeroDivisor == rhs.vertexAttributeInstanceRateZeroDivisor ); -# endif - } - - bool operator!=( PhysicalDeviceVertexAttributeDivisorFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVertexAttributeDivisorFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateDivisor = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexAttributeInstanceRateZeroDivisor = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVertexAttributeDivisorFeaturesEXT; - }; - - struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT - { - using NativeType = VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVertexAttributeDivisorPropertiesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVertexAttributeDivisorPropertiesEXT( uint32_t maxVertexAttribDivisor_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxVertexAttribDivisor( maxVertexAttribDivisor_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceVertexAttributeDivisorPropertiesEXT( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexAttributeDivisorPropertiesEXT( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVertexAttributeDivisorPropertiesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVertexAttributeDivisorPropertiesEXT & - operator=( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexAttributeDivisorPropertiesEXT & operator=( VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxVertexAttribDivisor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxVertexAttribDivisor == rhs.maxVertexAttribDivisor ); -# endif - } - - bool operator!=( PhysicalDeviceVertexAttributeDivisorPropertiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVertexAttributeDivisorPropertiesEXT; - void * pNext = {}; - uint32_t maxVertexAttribDivisor = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVertexAttributeDivisorPropertiesEXT; - }; - - struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT - { - using NativeType = VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVertexInputDynamicStateFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVertexInputDynamicStateFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 vertexInputDynamicState_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexInputDynamicState( vertexInputDynamicState_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceVertexInputDynamicStateFeaturesEXT( PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexInputDynamicStateFeaturesEXT( VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVertexInputDynamicStateFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVertexInputDynamicStateFeaturesEXT & operator=( PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVertexInputDynamicStateFeaturesEXT & operator=( VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVertexInputDynamicStateFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVertexInputDynamicStateFeaturesEXT & - setVertexInputDynamicState( VULKAN_HPP_NAMESPACE::Bool32 vertexInputDynamicState_ ) VULKAN_HPP_NOEXCEPT - { - vertexInputDynamicState = vertexInputDynamicState_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vertexInputDynamicState ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vertexInputDynamicState == rhs.vertexInputDynamicState ); -# endif - } - - bool operator!=( PhysicalDeviceVertexInputDynamicStateFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVertexInputDynamicStateFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 vertexInputDynamicState = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVertexInputDynamicStateFeaturesEXT; - }; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct PhysicalDeviceVideoFormatInfoKHR - { - using NativeType = VkPhysicalDeviceVideoFormatInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVideoFormatInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVideoFormatInfoKHR( VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageUsage( imageUsage_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVideoFormatInfoKHR( PhysicalDeviceVideoFormatInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVideoFormatInfoKHR( VkPhysicalDeviceVideoFormatInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVideoFormatInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVideoFormatInfoKHR & operator=( PhysicalDeviceVideoFormatInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVideoFormatInfoKHR & operator=( VkPhysicalDeviceVideoFormatInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVideoFormatInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVideoFormatInfoKHR & setImageUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage_ ) VULKAN_HPP_NOEXCEPT - { - imageUsage = imageUsage_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVideoFormatInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVideoFormatInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageUsage ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVideoFormatInfoKHR const & ) const = default; -# else - bool operator==( PhysicalDeviceVideoFormatInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageUsage == rhs.imageUsage ); -# endif - } - - bool operator!=( PhysicalDeviceVideoFormatInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVideoFormatInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVideoFormatInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - struct PhysicalDeviceVulkan11Features - { - using NativeType = VkPhysicalDeviceVulkan11Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan11Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan11Features( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiview_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 variablePointers_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 protectedMemory_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , storageBuffer16BitAccess( storageBuffer16BitAccess_ ) - , uniformAndStorageBuffer16BitAccess( uniformAndStorageBuffer16BitAccess_ ) - , storagePushConstant16( storagePushConstant16_ ) - , storageInputOutput16( storageInputOutput16_ ) - , multiview( multiview_ ) - , multiviewGeometryShader( multiviewGeometryShader_ ) - , multiviewTessellationShader( multiviewTessellationShader_ ) - , variablePointersStorageBuffer( variablePointersStorageBuffer_ ) - , variablePointers( variablePointers_ ) - , protectedMemory( protectedMemory_ ) - , samplerYcbcrConversion( samplerYcbcrConversion_ ) - , shaderDrawParameters( shaderDrawParameters_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan11Features( PhysicalDeviceVulkan11Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan11Features( VkPhysicalDeviceVulkan11Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan11Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan11Features & operator=( PhysicalDeviceVulkan11Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan11Features & operator=( VkPhysicalDeviceVulkan11Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setStorageBuffer16BitAccess( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - storageBuffer16BitAccess = storageBuffer16BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setUniformAndStorageBuffer16BitAccess( VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - uniformAndStorageBuffer16BitAccess = uniformAndStorageBuffer16BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setStoragePushConstant16( VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16_ ) VULKAN_HPP_NOEXCEPT - { - storagePushConstant16 = storagePushConstant16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setStorageInputOutput16( VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16_ ) VULKAN_HPP_NOEXCEPT - { - storageInputOutput16 = storageInputOutput16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setMultiview( VULKAN_HPP_NAMESPACE::Bool32 multiview_ ) VULKAN_HPP_NOEXCEPT - { - multiview = multiview_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setMultiviewGeometryShader( VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader_ ) VULKAN_HPP_NOEXCEPT - { - multiviewGeometryShader = multiviewGeometryShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setMultiviewTessellationShader( VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader_ ) VULKAN_HPP_NOEXCEPT - { - multiviewTessellationShader = multiviewTessellationShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setVariablePointersStorageBuffer( VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer_ ) VULKAN_HPP_NOEXCEPT - { - variablePointersStorageBuffer = variablePointersStorageBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setVariablePointers( VULKAN_HPP_NAMESPACE::Bool32 variablePointers_ ) VULKAN_HPP_NOEXCEPT - { - variablePointers = variablePointers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setProtectedMemory( VULKAN_HPP_NAMESPACE::Bool32 protectedMemory_ ) VULKAN_HPP_NOEXCEPT - { - protectedMemory = protectedMemory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & - setSamplerYcbcrConversion( VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion_ ) VULKAN_HPP_NOEXCEPT - { - samplerYcbcrConversion = samplerYcbcrConversion_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Features & setShaderDrawParameters( VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters_ ) VULKAN_HPP_NOEXCEPT - { - shaderDrawParameters = shaderDrawParameters_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVulkan11Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan11Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - storageBuffer16BitAccess, - uniformAndStorageBuffer16BitAccess, - storagePushConstant16, - storageInputOutput16, - multiview, - multiviewGeometryShader, - multiviewTessellationShader, - variablePointersStorageBuffer, - variablePointers, - protectedMemory, - samplerYcbcrConversion, - shaderDrawParameters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan11Features const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan11Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( storageBuffer16BitAccess == rhs.storageBuffer16BitAccess ) && - ( uniformAndStorageBuffer16BitAccess == rhs.uniformAndStorageBuffer16BitAccess ) && ( storagePushConstant16 == rhs.storagePushConstant16 ) && - ( storageInputOutput16 == rhs.storageInputOutput16 ) && ( multiview == rhs.multiview ) && - ( multiviewGeometryShader == rhs.multiviewGeometryShader ) && ( multiviewTessellationShader == rhs.multiviewTessellationShader ) && - ( variablePointersStorageBuffer == rhs.variablePointersStorageBuffer ) && ( variablePointers == rhs.variablePointers ) && - ( protectedMemory == rhs.protectedMemory ) && ( samplerYcbcrConversion == rhs.samplerYcbcrConversion ) && - ( shaderDrawParameters == rhs.shaderDrawParameters ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan11Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan11Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageBuffer16BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer16BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageInputOutput16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiview = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiviewGeometryShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 multiviewTessellationShader = {}; - VULKAN_HPP_NAMESPACE::Bool32 variablePointersStorageBuffer = {}; - VULKAN_HPP_NAMESPACE::Bool32 variablePointers = {}; - VULKAN_HPP_NAMESPACE::Bool32 protectedMemory = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerYcbcrConversion = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDrawParameters = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan11Features; - }; - - struct PhysicalDeviceVulkan11Properties - { - using NativeType = VkPhysicalDeviceVulkan11Properties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan11Properties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Properties( - std::array const & deviceUUID_ = {}, - std::array const & driverUUID_ = {}, - std::array const & deviceLUID_ = {}, - uint32_t deviceNodeMask_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 deviceLUIDValid_ = {}, - uint32_t subgroupSize_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags subgroupSupportedStages_ = {}, - VULKAN_HPP_NAMESPACE::SubgroupFeatureFlags subgroupSupportedOperations_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 subgroupQuadOperationsInAllStages_ = {}, - VULKAN_HPP_NAMESPACE::PointClippingBehavior pointClippingBehavior_ = VULKAN_HPP_NAMESPACE::PointClippingBehavior::eAllClipPlanes, - uint32_t maxMultiviewViewCount_ = {}, - uint32_t maxMultiviewInstanceIndex_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 protectedNoFault_ = {}, - uint32_t maxPerSetDescriptors_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize maxMemoryAllocationSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , deviceUUID( deviceUUID_ ) - , driverUUID( driverUUID_ ) - , deviceLUID( deviceLUID_ ) - , deviceNodeMask( deviceNodeMask_ ) - , deviceLUIDValid( deviceLUIDValid_ ) - , subgroupSize( subgroupSize_ ) - , subgroupSupportedStages( subgroupSupportedStages_ ) - , subgroupSupportedOperations( subgroupSupportedOperations_ ) - , subgroupQuadOperationsInAllStages( subgroupQuadOperationsInAllStages_ ) - , pointClippingBehavior( pointClippingBehavior_ ) - , maxMultiviewViewCount( maxMultiviewViewCount_ ) - , maxMultiviewInstanceIndex( maxMultiviewInstanceIndex_ ) - , protectedNoFault( protectedNoFault_ ) - , maxPerSetDescriptors( maxPerSetDescriptors_ ) - , maxMemoryAllocationSize( maxMemoryAllocationSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan11Properties( PhysicalDeviceVulkan11Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan11Properties( VkPhysicalDeviceVulkan11Properties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan11Properties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan11Properties & operator=( PhysicalDeviceVulkan11Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan11Properties & operator=( VkPhysicalDeviceVulkan11Properties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceVulkan11Properties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan11Properties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ShaderStageFlags const &, - VULKAN_HPP_NAMESPACE::SubgroupFeatureFlags const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::PointClippingBehavior const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::DeviceSize const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - deviceUUID, - driverUUID, - deviceLUID, - deviceNodeMask, - deviceLUIDValid, - subgroupSize, - subgroupSupportedStages, - subgroupSupportedOperations, - subgroupQuadOperationsInAllStages, - pointClippingBehavior, - maxMultiviewViewCount, - maxMultiviewInstanceIndex, - protectedNoFault, - maxPerSetDescriptors, - maxMemoryAllocationSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan11Properties const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan11Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( deviceUUID == rhs.deviceUUID ) && ( driverUUID == rhs.driverUUID ) && - ( deviceLUID == rhs.deviceLUID ) && ( deviceNodeMask == rhs.deviceNodeMask ) && ( deviceLUIDValid == rhs.deviceLUIDValid ) && - ( subgroupSize == rhs.subgroupSize ) && ( subgroupSupportedStages == rhs.subgroupSupportedStages ) && - ( subgroupSupportedOperations == rhs.subgroupSupportedOperations ) && - ( subgroupQuadOperationsInAllStages == rhs.subgroupQuadOperationsInAllStages ) && ( pointClippingBehavior == rhs.pointClippingBehavior ) && - ( maxMultiviewViewCount == rhs.maxMultiviewViewCount ) && ( maxMultiviewInstanceIndex == rhs.maxMultiviewInstanceIndex ) && - ( protectedNoFault == rhs.protectedNoFault ) && ( maxPerSetDescriptors == rhs.maxPerSetDescriptors ) && - ( maxMemoryAllocationSize == rhs.maxMemoryAllocationSize ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan11Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan11Properties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D deviceUUID = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverUUID = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D deviceLUID = {}; - uint32_t deviceNodeMask = {}; - VULKAN_HPP_NAMESPACE::Bool32 deviceLUIDValid = {}; - uint32_t subgroupSize = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags subgroupSupportedStages = {}; - VULKAN_HPP_NAMESPACE::SubgroupFeatureFlags subgroupSupportedOperations = {}; - VULKAN_HPP_NAMESPACE::Bool32 subgroupQuadOperationsInAllStages = {}; - VULKAN_HPP_NAMESPACE::PointClippingBehavior pointClippingBehavior = VULKAN_HPP_NAMESPACE::PointClippingBehavior::eAllClipPlanes; - uint32_t maxMultiviewViewCount = {}; - uint32_t maxMultiviewInstanceIndex = {}; - VULKAN_HPP_NAMESPACE::Bool32 protectedNoFault = {}; - uint32_t maxPerSetDescriptors = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxMemoryAllocationSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan11Properties; - }; - - struct PhysicalDeviceVulkan12Features - { - using NativeType = VkPhysicalDeviceVulkan12Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan12Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan12Features( VULKAN_HPP_NAMESPACE::Bool32 samplerMirrorClampToEdge_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 drawIndirectCount_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInt8_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 samplerFilterMinmax_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderOutputViewportIndex_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderOutputLayer_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 subgroupBroadcastDynamicId_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , samplerMirrorClampToEdge( samplerMirrorClampToEdge_ ) - , drawIndirectCount( drawIndirectCount_ ) - , storageBuffer8BitAccess( storageBuffer8BitAccess_ ) - , uniformAndStorageBuffer8BitAccess( uniformAndStorageBuffer8BitAccess_ ) - , storagePushConstant8( storagePushConstant8_ ) - , shaderBufferInt64Atomics( shaderBufferInt64Atomics_ ) - , shaderSharedInt64Atomics( shaderSharedInt64Atomics_ ) - , shaderFloat16( shaderFloat16_ ) - , shaderInt8( shaderInt8_ ) - , descriptorIndexing( descriptorIndexing_ ) - , shaderInputAttachmentArrayDynamicIndexing( shaderInputAttachmentArrayDynamicIndexing_ ) - , shaderUniformTexelBufferArrayDynamicIndexing( shaderUniformTexelBufferArrayDynamicIndexing_ ) - , shaderStorageTexelBufferArrayDynamicIndexing( shaderStorageTexelBufferArrayDynamicIndexing_ ) - , shaderUniformBufferArrayNonUniformIndexing( shaderUniformBufferArrayNonUniformIndexing_ ) - , shaderSampledImageArrayNonUniformIndexing( shaderSampledImageArrayNonUniformIndexing_ ) - , shaderStorageBufferArrayNonUniformIndexing( shaderStorageBufferArrayNonUniformIndexing_ ) - , shaderStorageImageArrayNonUniformIndexing( shaderStorageImageArrayNonUniformIndexing_ ) - , shaderInputAttachmentArrayNonUniformIndexing( shaderInputAttachmentArrayNonUniformIndexing_ ) - , shaderUniformTexelBufferArrayNonUniformIndexing( shaderUniformTexelBufferArrayNonUniformIndexing_ ) - , shaderStorageTexelBufferArrayNonUniformIndexing( shaderStorageTexelBufferArrayNonUniformIndexing_ ) - , descriptorBindingUniformBufferUpdateAfterBind( descriptorBindingUniformBufferUpdateAfterBind_ ) - , descriptorBindingSampledImageUpdateAfterBind( descriptorBindingSampledImageUpdateAfterBind_ ) - , descriptorBindingStorageImageUpdateAfterBind( descriptorBindingStorageImageUpdateAfterBind_ ) - , descriptorBindingStorageBufferUpdateAfterBind( descriptorBindingStorageBufferUpdateAfterBind_ ) - , descriptorBindingUniformTexelBufferUpdateAfterBind( descriptorBindingUniformTexelBufferUpdateAfterBind_ ) - , descriptorBindingStorageTexelBufferUpdateAfterBind( descriptorBindingStorageTexelBufferUpdateAfterBind_ ) - , descriptorBindingUpdateUnusedWhilePending( descriptorBindingUpdateUnusedWhilePending_ ) - , descriptorBindingPartiallyBound( descriptorBindingPartiallyBound_ ) - , descriptorBindingVariableDescriptorCount( descriptorBindingVariableDescriptorCount_ ) - , runtimeDescriptorArray( runtimeDescriptorArray_ ) - , samplerFilterMinmax( samplerFilterMinmax_ ) - , scalarBlockLayout( scalarBlockLayout_ ) - , imagelessFramebuffer( imagelessFramebuffer_ ) - , uniformBufferStandardLayout( uniformBufferStandardLayout_ ) - , shaderSubgroupExtendedTypes( shaderSubgroupExtendedTypes_ ) - , separateDepthStencilLayouts( separateDepthStencilLayouts_ ) - , hostQueryReset( hostQueryReset_ ) - , timelineSemaphore( timelineSemaphore_ ) - , bufferDeviceAddress( bufferDeviceAddress_ ) - , bufferDeviceAddressCaptureReplay( bufferDeviceAddressCaptureReplay_ ) - , bufferDeviceAddressMultiDevice( bufferDeviceAddressMultiDevice_ ) - , vulkanMemoryModel( vulkanMemoryModel_ ) - , vulkanMemoryModelDeviceScope( vulkanMemoryModelDeviceScope_ ) - , vulkanMemoryModelAvailabilityVisibilityChains( vulkanMemoryModelAvailabilityVisibilityChains_ ) - , shaderOutputViewportIndex( shaderOutputViewportIndex_ ) - , shaderOutputLayer( shaderOutputLayer_ ) - , subgroupBroadcastDynamicId( subgroupBroadcastDynamicId_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan12Features( PhysicalDeviceVulkan12Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan12Features( VkPhysicalDeviceVulkan12Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan12Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan12Features & operator=( PhysicalDeviceVulkan12Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan12Features & operator=( VkPhysicalDeviceVulkan12Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setSamplerMirrorClampToEdge( VULKAN_HPP_NAMESPACE::Bool32 samplerMirrorClampToEdge_ ) VULKAN_HPP_NOEXCEPT - { - samplerMirrorClampToEdge = samplerMirrorClampToEdge_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setDrawIndirectCount( VULKAN_HPP_NAMESPACE::Bool32 drawIndirectCount_ ) VULKAN_HPP_NOEXCEPT - { - drawIndirectCount = drawIndirectCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setStorageBuffer8BitAccess( VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - storageBuffer8BitAccess = storageBuffer8BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setUniformAndStorageBuffer8BitAccess( VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - uniformAndStorageBuffer8BitAccess = uniformAndStorageBuffer8BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setStoragePushConstant8( VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8_ ) VULKAN_HPP_NOEXCEPT - { - storagePushConstant8 = storagePushConstant8_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderBufferInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderBufferInt64Atomics = shaderBufferInt64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderSharedInt64Atomics( VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics_ ) VULKAN_HPP_NOEXCEPT - { - shaderSharedInt64Atomics = shaderSharedInt64Atomics_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setShaderFloat16( VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16_ ) VULKAN_HPP_NOEXCEPT - { - shaderFloat16 = shaderFloat16_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setShaderInt8( VULKAN_HPP_NAMESPACE::Bool32 shaderInt8_ ) VULKAN_HPP_NOEXCEPT - { - shaderInt8 = shaderInt8_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setDescriptorIndexing( VULKAN_HPP_NAMESPACE::Bool32 descriptorIndexing_ ) VULKAN_HPP_NOEXCEPT - { - descriptorIndexing = descriptorIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderInputAttachmentArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderInputAttachmentArrayDynamicIndexing = shaderInputAttachmentArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderUniformTexelBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformTexelBufferArrayDynamicIndexing = shaderUniformTexelBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderStorageTexelBufferArrayDynamicIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageTexelBufferArrayDynamicIndexing = shaderStorageTexelBufferArrayDynamicIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderUniformBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformBufferArrayNonUniformIndexing = shaderUniformBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderSampledImageArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderSampledImageArrayNonUniformIndexing = shaderSampledImageArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderStorageBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageBufferArrayNonUniformIndexing = shaderStorageBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderStorageImageArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageImageArrayNonUniformIndexing = shaderStorageImageArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderInputAttachmentArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderInputAttachmentArrayNonUniformIndexing = shaderInputAttachmentArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderUniformTexelBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderUniformTexelBufferArrayNonUniformIndexing = shaderUniformTexelBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderStorageTexelBufferArrayNonUniformIndexing( VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing_ ) VULKAN_HPP_NOEXCEPT - { - shaderStorageTexelBufferArrayNonUniformIndexing = shaderStorageTexelBufferArrayNonUniformIndexing_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingUniformBufferUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUniformBufferUpdateAfterBind = descriptorBindingUniformBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingSampledImageUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingSampledImageUpdateAfterBind = descriptorBindingSampledImageUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingStorageImageUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageImageUpdateAfterBind = descriptorBindingStorageImageUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingStorageBufferUpdateAfterBind( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageBufferUpdateAfterBind = descriptorBindingStorageBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setDescriptorBindingUniformTexelBufferUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUniformTexelBufferUpdateAfterBind = descriptorBindingUniformTexelBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setDescriptorBindingStorageTexelBufferUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingStorageTexelBufferUpdateAfterBind = descriptorBindingStorageTexelBufferUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingUpdateUnusedWhilePending( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingUpdateUnusedWhilePending = descriptorBindingUpdateUnusedWhilePending_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingPartiallyBound( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingPartiallyBound = descriptorBindingPartiallyBound_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setDescriptorBindingVariableDescriptorCount( VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingVariableDescriptorCount = descriptorBindingVariableDescriptorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setRuntimeDescriptorArray( VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray_ ) VULKAN_HPP_NOEXCEPT - { - runtimeDescriptorArray = runtimeDescriptorArray_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setSamplerFilterMinmax( VULKAN_HPP_NAMESPACE::Bool32 samplerFilterMinmax_ ) VULKAN_HPP_NOEXCEPT - { - samplerFilterMinmax = samplerFilterMinmax_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setScalarBlockLayout( VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout_ ) VULKAN_HPP_NOEXCEPT - { - scalarBlockLayout = scalarBlockLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setImagelessFramebuffer( VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer_ ) VULKAN_HPP_NOEXCEPT - { - imagelessFramebuffer = imagelessFramebuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setUniformBufferStandardLayout( VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout_ ) VULKAN_HPP_NOEXCEPT - { - uniformBufferStandardLayout = uniformBufferStandardLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderSubgroupExtendedTypes( VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes_ ) VULKAN_HPP_NOEXCEPT - { - shaderSubgroupExtendedTypes = shaderSubgroupExtendedTypes_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setSeparateDepthStencilLayouts( VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts_ ) VULKAN_HPP_NOEXCEPT - { - separateDepthStencilLayouts = separateDepthStencilLayouts_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setHostQueryReset( VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset_ ) VULKAN_HPP_NOEXCEPT - { - hostQueryReset = hostQueryReset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setTimelineSemaphore( VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore_ ) VULKAN_HPP_NOEXCEPT - { - timelineSemaphore = timelineSemaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setBufferDeviceAddress( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddress = bufferDeviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setBufferDeviceAddressCaptureReplay( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressCaptureReplay = bufferDeviceAddressCaptureReplay_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setBufferDeviceAddressMultiDevice( VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice_ ) VULKAN_HPP_NOEXCEPT - { - bufferDeviceAddressMultiDevice = bufferDeviceAddressMultiDevice_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setVulkanMemoryModel( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModel = vulkanMemoryModel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setVulkanMemoryModelDeviceScope( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModelDeviceScope = vulkanMemoryModelDeviceScope_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setVulkanMemoryModelAvailabilityVisibilityChains( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModelAvailabilityVisibilityChains = vulkanMemoryModelAvailabilityVisibilityChains_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setShaderOutputViewportIndex( VULKAN_HPP_NAMESPACE::Bool32 shaderOutputViewportIndex_ ) VULKAN_HPP_NOEXCEPT - { - shaderOutputViewportIndex = shaderOutputViewportIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & setShaderOutputLayer( VULKAN_HPP_NAMESPACE::Bool32 shaderOutputLayer_ ) VULKAN_HPP_NOEXCEPT - { - shaderOutputLayer = shaderOutputLayer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Features & - setSubgroupBroadcastDynamicId( VULKAN_HPP_NAMESPACE::Bool32 subgroupBroadcastDynamicId_ ) VULKAN_HPP_NOEXCEPT - { - subgroupBroadcastDynamicId = subgroupBroadcastDynamicId_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVulkan12Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan12Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - samplerMirrorClampToEdge, - drawIndirectCount, - storageBuffer8BitAccess, - uniformAndStorageBuffer8BitAccess, - storagePushConstant8, - shaderBufferInt64Atomics, - shaderSharedInt64Atomics, - shaderFloat16, - shaderInt8, - descriptorIndexing, - shaderInputAttachmentArrayDynamicIndexing, - shaderUniformTexelBufferArrayDynamicIndexing, - shaderStorageTexelBufferArrayDynamicIndexing, - shaderUniformBufferArrayNonUniformIndexing, - shaderSampledImageArrayNonUniformIndexing, - shaderStorageBufferArrayNonUniformIndexing, - shaderStorageImageArrayNonUniformIndexing, - shaderInputAttachmentArrayNonUniformIndexing, - shaderUniformTexelBufferArrayNonUniformIndexing, - shaderStorageTexelBufferArrayNonUniformIndexing, - descriptorBindingUniformBufferUpdateAfterBind, - descriptorBindingSampledImageUpdateAfterBind, - descriptorBindingStorageImageUpdateAfterBind, - descriptorBindingStorageBufferUpdateAfterBind, - descriptorBindingUniformTexelBufferUpdateAfterBind, - descriptorBindingStorageTexelBufferUpdateAfterBind, - descriptorBindingUpdateUnusedWhilePending, - descriptorBindingPartiallyBound, - descriptorBindingVariableDescriptorCount, - runtimeDescriptorArray, - samplerFilterMinmax, - scalarBlockLayout, - imagelessFramebuffer, - uniformBufferStandardLayout, - shaderSubgroupExtendedTypes, - separateDepthStencilLayouts, - hostQueryReset, - timelineSemaphore, - bufferDeviceAddress, - bufferDeviceAddressCaptureReplay, - bufferDeviceAddressMultiDevice, - vulkanMemoryModel, - vulkanMemoryModelDeviceScope, - vulkanMemoryModelAvailabilityVisibilityChains, - shaderOutputViewportIndex, - shaderOutputLayer, - subgroupBroadcastDynamicId ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan12Features const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan12Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( samplerMirrorClampToEdge == rhs.samplerMirrorClampToEdge ) && - ( drawIndirectCount == rhs.drawIndirectCount ) && ( storageBuffer8BitAccess == rhs.storageBuffer8BitAccess ) && - ( uniformAndStorageBuffer8BitAccess == rhs.uniformAndStorageBuffer8BitAccess ) && ( storagePushConstant8 == rhs.storagePushConstant8 ) && - ( shaderBufferInt64Atomics == rhs.shaderBufferInt64Atomics ) && ( shaderSharedInt64Atomics == rhs.shaderSharedInt64Atomics ) && - ( shaderFloat16 == rhs.shaderFloat16 ) && ( shaderInt8 == rhs.shaderInt8 ) && ( descriptorIndexing == rhs.descriptorIndexing ) && - ( shaderInputAttachmentArrayDynamicIndexing == rhs.shaderInputAttachmentArrayDynamicIndexing ) && - ( shaderUniformTexelBufferArrayDynamicIndexing == rhs.shaderUniformTexelBufferArrayDynamicIndexing ) && - ( shaderStorageTexelBufferArrayDynamicIndexing == rhs.shaderStorageTexelBufferArrayDynamicIndexing ) && - ( shaderUniformBufferArrayNonUniformIndexing == rhs.shaderUniformBufferArrayNonUniformIndexing ) && - ( shaderSampledImageArrayNonUniformIndexing == rhs.shaderSampledImageArrayNonUniformIndexing ) && - ( shaderStorageBufferArrayNonUniformIndexing == rhs.shaderStorageBufferArrayNonUniformIndexing ) && - ( shaderStorageImageArrayNonUniformIndexing == rhs.shaderStorageImageArrayNonUniformIndexing ) && - ( shaderInputAttachmentArrayNonUniformIndexing == rhs.shaderInputAttachmentArrayNonUniformIndexing ) && - ( shaderUniformTexelBufferArrayNonUniformIndexing == rhs.shaderUniformTexelBufferArrayNonUniformIndexing ) && - ( shaderStorageTexelBufferArrayNonUniformIndexing == rhs.shaderStorageTexelBufferArrayNonUniformIndexing ) && - ( descriptorBindingUniformBufferUpdateAfterBind == rhs.descriptorBindingUniformBufferUpdateAfterBind ) && - ( descriptorBindingSampledImageUpdateAfterBind == rhs.descriptorBindingSampledImageUpdateAfterBind ) && - ( descriptorBindingStorageImageUpdateAfterBind == rhs.descriptorBindingStorageImageUpdateAfterBind ) && - ( descriptorBindingStorageBufferUpdateAfterBind == rhs.descriptorBindingStorageBufferUpdateAfterBind ) && - ( descriptorBindingUniformTexelBufferUpdateAfterBind == rhs.descriptorBindingUniformTexelBufferUpdateAfterBind ) && - ( descriptorBindingStorageTexelBufferUpdateAfterBind == rhs.descriptorBindingStorageTexelBufferUpdateAfterBind ) && - ( descriptorBindingUpdateUnusedWhilePending == rhs.descriptorBindingUpdateUnusedWhilePending ) && - ( descriptorBindingPartiallyBound == rhs.descriptorBindingPartiallyBound ) && - ( descriptorBindingVariableDescriptorCount == rhs.descriptorBindingVariableDescriptorCount ) && - ( runtimeDescriptorArray == rhs.runtimeDescriptorArray ) && ( samplerFilterMinmax == rhs.samplerFilterMinmax ) && - ( scalarBlockLayout == rhs.scalarBlockLayout ) && ( imagelessFramebuffer == rhs.imagelessFramebuffer ) && - ( uniformBufferStandardLayout == rhs.uniformBufferStandardLayout ) && ( shaderSubgroupExtendedTypes == rhs.shaderSubgroupExtendedTypes ) && - ( separateDepthStencilLayouts == rhs.separateDepthStencilLayouts ) && ( hostQueryReset == rhs.hostQueryReset ) && - ( timelineSemaphore == rhs.timelineSemaphore ) && ( bufferDeviceAddress == rhs.bufferDeviceAddress ) && - ( bufferDeviceAddressCaptureReplay == rhs.bufferDeviceAddressCaptureReplay ) && - ( bufferDeviceAddressMultiDevice == rhs.bufferDeviceAddressMultiDevice ) && ( vulkanMemoryModel == rhs.vulkanMemoryModel ) && - ( vulkanMemoryModelDeviceScope == rhs.vulkanMemoryModelDeviceScope ) && - ( vulkanMemoryModelAvailabilityVisibilityChains == rhs.vulkanMemoryModelAvailabilityVisibilityChains ) && - ( shaderOutputViewportIndex == rhs.shaderOutputViewportIndex ) && ( shaderOutputLayer == rhs.shaderOutputLayer ) && - ( subgroupBroadcastDynamicId == rhs.subgroupBroadcastDynamicId ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan12Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan12Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerMirrorClampToEdge = {}; - VULKAN_HPP_NAMESPACE::Bool32 drawIndirectCount = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageBuffer8BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformAndStorageBuffer8BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 storagePushConstant8 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderBufferInt64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSharedInt64Atomics = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInt8 = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayDynamicIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformTexelBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageTexelBufferArrayNonUniformIndexing = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingSampledImageUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageImageUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUniformTexelBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingStorageTexelBufferUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingUpdateUnusedWhilePending = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingPartiallyBound = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingVariableDescriptorCount = {}; - VULKAN_HPP_NAMESPACE::Bool32 runtimeDescriptorArray = {}; - VULKAN_HPP_NAMESPACE::Bool32 samplerFilterMinmax = {}; - VULKAN_HPP_NAMESPACE::Bool32 scalarBlockLayout = {}; - VULKAN_HPP_NAMESPACE::Bool32 imagelessFramebuffer = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformBufferStandardLayout = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSubgroupExtendedTypes = {}; - VULKAN_HPP_NAMESPACE::Bool32 separateDepthStencilLayouts = {}; - VULKAN_HPP_NAMESPACE::Bool32 hostQueryReset = {}; - VULKAN_HPP_NAMESPACE::Bool32 timelineSemaphore = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddress = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressCaptureReplay = {}; - VULKAN_HPP_NAMESPACE::Bool32 bufferDeviceAddressMultiDevice = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderOutputViewportIndex = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderOutputLayer = {}; - VULKAN_HPP_NAMESPACE::Bool32 subgroupBroadcastDynamicId = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan12Features; - }; - - struct PhysicalDeviceVulkan12Properties - { - using NativeType = VkPhysicalDeviceVulkan12Properties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan12Properties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Properties( - VULKAN_HPP_NAMESPACE::DriverId driverID_ = VULKAN_HPP_NAMESPACE::DriverId::eAmdProprietary, - std::array const & driverName_ = {}, - std::array const & driverInfo_ = {}, - VULKAN_HPP_NAMESPACE::ConformanceVersion conformanceVersion_ = {}, - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence denormBehaviorIndependence_ = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly, - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence roundingModeIndependence_ = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat64_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat16_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat32_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat64_ = {}, - uint32_t maxUpdateAfterBindDescriptorsInAllPools_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexingNative_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccessUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 quadDivergentImplicitLod_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments_ = {}, - uint32_t maxPerStageUpdateAfterBindResources_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindSamplers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindSampledImages_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindStorageImages_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments_ = {}, - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedDepthResolveModes_ = {}, - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedStencilResolveModes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 independentResolveNone_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 independentResolve_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxSingleComponentFormats_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxImageComponentMapping_ = {}, - uint64_t maxTimelineSemaphoreValueDifference_ = {}, - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferIntegerColorSampleCounts_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , driverID( driverID_ ) - , driverName( driverName_ ) - , driverInfo( driverInfo_ ) - , conformanceVersion( conformanceVersion_ ) - , denormBehaviorIndependence( denormBehaviorIndependence_ ) - , roundingModeIndependence( roundingModeIndependence_ ) - , shaderSignedZeroInfNanPreserveFloat16( shaderSignedZeroInfNanPreserveFloat16_ ) - , shaderSignedZeroInfNanPreserveFloat32( shaderSignedZeroInfNanPreserveFloat32_ ) - , shaderSignedZeroInfNanPreserveFloat64( shaderSignedZeroInfNanPreserveFloat64_ ) - , shaderDenormPreserveFloat16( shaderDenormPreserveFloat16_ ) - , shaderDenormPreserveFloat32( shaderDenormPreserveFloat32_ ) - , shaderDenormPreserveFloat64( shaderDenormPreserveFloat64_ ) - , shaderDenormFlushToZeroFloat16( shaderDenormFlushToZeroFloat16_ ) - , shaderDenormFlushToZeroFloat32( shaderDenormFlushToZeroFloat32_ ) - , shaderDenormFlushToZeroFloat64( shaderDenormFlushToZeroFloat64_ ) - , shaderRoundingModeRTEFloat16( shaderRoundingModeRTEFloat16_ ) - , shaderRoundingModeRTEFloat32( shaderRoundingModeRTEFloat32_ ) - , shaderRoundingModeRTEFloat64( shaderRoundingModeRTEFloat64_ ) - , shaderRoundingModeRTZFloat16( shaderRoundingModeRTZFloat16_ ) - , shaderRoundingModeRTZFloat32( shaderRoundingModeRTZFloat32_ ) - , shaderRoundingModeRTZFloat64( shaderRoundingModeRTZFloat64_ ) - , maxUpdateAfterBindDescriptorsInAllPools( maxUpdateAfterBindDescriptorsInAllPools_ ) - , shaderUniformBufferArrayNonUniformIndexingNative( shaderUniformBufferArrayNonUniformIndexingNative_ ) - , shaderSampledImageArrayNonUniformIndexingNative( shaderSampledImageArrayNonUniformIndexingNative_ ) - , shaderStorageBufferArrayNonUniformIndexingNative( shaderStorageBufferArrayNonUniformIndexingNative_ ) - , shaderStorageImageArrayNonUniformIndexingNative( shaderStorageImageArrayNonUniformIndexingNative_ ) - , shaderInputAttachmentArrayNonUniformIndexingNative( shaderInputAttachmentArrayNonUniformIndexingNative_ ) - , robustBufferAccessUpdateAfterBind( robustBufferAccessUpdateAfterBind_ ) - , quadDivergentImplicitLod( quadDivergentImplicitLod_ ) - , maxPerStageDescriptorUpdateAfterBindSamplers( maxPerStageDescriptorUpdateAfterBindSamplers_ ) - , maxPerStageDescriptorUpdateAfterBindUniformBuffers( maxPerStageDescriptorUpdateAfterBindUniformBuffers_ ) - , maxPerStageDescriptorUpdateAfterBindStorageBuffers( maxPerStageDescriptorUpdateAfterBindStorageBuffers_ ) - , maxPerStageDescriptorUpdateAfterBindSampledImages( maxPerStageDescriptorUpdateAfterBindSampledImages_ ) - , maxPerStageDescriptorUpdateAfterBindStorageImages( maxPerStageDescriptorUpdateAfterBindStorageImages_ ) - , maxPerStageDescriptorUpdateAfterBindInputAttachments( maxPerStageDescriptorUpdateAfterBindInputAttachments_ ) - , maxPerStageUpdateAfterBindResources( maxPerStageUpdateAfterBindResources_ ) - , maxDescriptorSetUpdateAfterBindSamplers( maxDescriptorSetUpdateAfterBindSamplers_ ) - , maxDescriptorSetUpdateAfterBindUniformBuffers( maxDescriptorSetUpdateAfterBindUniformBuffers_ ) - , maxDescriptorSetUpdateAfterBindUniformBuffersDynamic( maxDescriptorSetUpdateAfterBindUniformBuffersDynamic_ ) - , maxDescriptorSetUpdateAfterBindStorageBuffers( maxDescriptorSetUpdateAfterBindStorageBuffers_ ) - , maxDescriptorSetUpdateAfterBindStorageBuffersDynamic( maxDescriptorSetUpdateAfterBindStorageBuffersDynamic_ ) - , maxDescriptorSetUpdateAfterBindSampledImages( maxDescriptorSetUpdateAfterBindSampledImages_ ) - , maxDescriptorSetUpdateAfterBindStorageImages( maxDescriptorSetUpdateAfterBindStorageImages_ ) - , maxDescriptorSetUpdateAfterBindInputAttachments( maxDescriptorSetUpdateAfterBindInputAttachments_ ) - , supportedDepthResolveModes( supportedDepthResolveModes_ ) - , supportedStencilResolveModes( supportedStencilResolveModes_ ) - , independentResolveNone( independentResolveNone_ ) - , independentResolve( independentResolve_ ) - , filterMinmaxSingleComponentFormats( filterMinmaxSingleComponentFormats_ ) - , filterMinmaxImageComponentMapping( filterMinmaxImageComponentMapping_ ) - , maxTimelineSemaphoreValueDifference( maxTimelineSemaphoreValueDifference_ ) - , framebufferIntegerColorSampleCounts( framebufferIntegerColorSampleCounts_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan12Properties( PhysicalDeviceVulkan12Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan12Properties( VkPhysicalDeviceVulkan12Properties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan12Properties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan12Properties & operator=( PhysicalDeviceVulkan12Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan12Properties & operator=( VkPhysicalDeviceVulkan12Properties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceVulkan12Properties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan12Properties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::ConformanceVersion const &, - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence const &, - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - uint32_t const &, - VULKAN_HPP_NAMESPACE::ResolveModeFlags const &, - VULKAN_HPP_NAMESPACE::ResolveModeFlags const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - uint64_t const &, - VULKAN_HPP_NAMESPACE::SampleCountFlags const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - driverID, - driverName, - driverInfo, - conformanceVersion, - denormBehaviorIndependence, - roundingModeIndependence, - shaderSignedZeroInfNanPreserveFloat16, - shaderSignedZeroInfNanPreserveFloat32, - shaderSignedZeroInfNanPreserveFloat64, - shaderDenormPreserveFloat16, - shaderDenormPreserveFloat32, - shaderDenormPreserveFloat64, - shaderDenormFlushToZeroFloat16, - shaderDenormFlushToZeroFloat32, - shaderDenormFlushToZeroFloat64, - shaderRoundingModeRTEFloat16, - shaderRoundingModeRTEFloat32, - shaderRoundingModeRTEFloat64, - shaderRoundingModeRTZFloat16, - shaderRoundingModeRTZFloat32, - shaderRoundingModeRTZFloat64, - maxUpdateAfterBindDescriptorsInAllPools, - shaderUniformBufferArrayNonUniformIndexingNative, - shaderSampledImageArrayNonUniformIndexingNative, - shaderStorageBufferArrayNonUniformIndexingNative, - shaderStorageImageArrayNonUniformIndexingNative, - shaderInputAttachmentArrayNonUniformIndexingNative, - robustBufferAccessUpdateAfterBind, - quadDivergentImplicitLod, - maxPerStageDescriptorUpdateAfterBindSamplers, - maxPerStageDescriptorUpdateAfterBindUniformBuffers, - maxPerStageDescriptorUpdateAfterBindStorageBuffers, - maxPerStageDescriptorUpdateAfterBindSampledImages, - maxPerStageDescriptorUpdateAfterBindStorageImages, - maxPerStageDescriptorUpdateAfterBindInputAttachments, - maxPerStageUpdateAfterBindResources, - maxDescriptorSetUpdateAfterBindSamplers, - maxDescriptorSetUpdateAfterBindUniformBuffers, - maxDescriptorSetUpdateAfterBindUniformBuffersDynamic, - maxDescriptorSetUpdateAfterBindStorageBuffers, - maxDescriptorSetUpdateAfterBindStorageBuffersDynamic, - maxDescriptorSetUpdateAfterBindSampledImages, - maxDescriptorSetUpdateAfterBindStorageImages, - maxDescriptorSetUpdateAfterBindInputAttachments, - supportedDepthResolveModes, - supportedStencilResolveModes, - independentResolveNone, - independentResolve, - filterMinmaxSingleComponentFormats, - filterMinmaxImageComponentMapping, - maxTimelineSemaphoreValueDifference, - framebufferIntegerColorSampleCounts ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan12Properties const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan12Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( driverID == rhs.driverID ) && ( driverName == rhs.driverName ) && - ( driverInfo == rhs.driverInfo ) && ( conformanceVersion == rhs.conformanceVersion ) && - ( denormBehaviorIndependence == rhs.denormBehaviorIndependence ) && ( roundingModeIndependence == rhs.roundingModeIndependence ) && - ( shaderSignedZeroInfNanPreserveFloat16 == rhs.shaderSignedZeroInfNanPreserveFloat16 ) && - ( shaderSignedZeroInfNanPreserveFloat32 == rhs.shaderSignedZeroInfNanPreserveFloat32 ) && - ( shaderSignedZeroInfNanPreserveFloat64 == rhs.shaderSignedZeroInfNanPreserveFloat64 ) && - ( shaderDenormPreserveFloat16 == rhs.shaderDenormPreserveFloat16 ) && ( shaderDenormPreserveFloat32 == rhs.shaderDenormPreserveFloat32 ) && - ( shaderDenormPreserveFloat64 == rhs.shaderDenormPreserveFloat64 ) && ( shaderDenormFlushToZeroFloat16 == rhs.shaderDenormFlushToZeroFloat16 ) && - ( shaderDenormFlushToZeroFloat32 == rhs.shaderDenormFlushToZeroFloat32 ) && - ( shaderDenormFlushToZeroFloat64 == rhs.shaderDenormFlushToZeroFloat64 ) && ( shaderRoundingModeRTEFloat16 == rhs.shaderRoundingModeRTEFloat16 ) && - ( shaderRoundingModeRTEFloat32 == rhs.shaderRoundingModeRTEFloat32 ) && ( shaderRoundingModeRTEFloat64 == rhs.shaderRoundingModeRTEFloat64 ) && - ( shaderRoundingModeRTZFloat16 == rhs.shaderRoundingModeRTZFloat16 ) && ( shaderRoundingModeRTZFloat32 == rhs.shaderRoundingModeRTZFloat32 ) && - ( shaderRoundingModeRTZFloat64 == rhs.shaderRoundingModeRTZFloat64 ) && - ( maxUpdateAfterBindDescriptorsInAllPools == rhs.maxUpdateAfterBindDescriptorsInAllPools ) && - ( shaderUniformBufferArrayNonUniformIndexingNative == rhs.shaderUniformBufferArrayNonUniformIndexingNative ) && - ( shaderSampledImageArrayNonUniformIndexingNative == rhs.shaderSampledImageArrayNonUniformIndexingNative ) && - ( shaderStorageBufferArrayNonUniformIndexingNative == rhs.shaderStorageBufferArrayNonUniformIndexingNative ) && - ( shaderStorageImageArrayNonUniformIndexingNative == rhs.shaderStorageImageArrayNonUniformIndexingNative ) && - ( shaderInputAttachmentArrayNonUniformIndexingNative == rhs.shaderInputAttachmentArrayNonUniformIndexingNative ) && - ( robustBufferAccessUpdateAfterBind == rhs.robustBufferAccessUpdateAfterBind ) && ( quadDivergentImplicitLod == rhs.quadDivergentImplicitLod ) && - ( maxPerStageDescriptorUpdateAfterBindSamplers == rhs.maxPerStageDescriptorUpdateAfterBindSamplers ) && - ( maxPerStageDescriptorUpdateAfterBindUniformBuffers == rhs.maxPerStageDescriptorUpdateAfterBindUniformBuffers ) && - ( maxPerStageDescriptorUpdateAfterBindStorageBuffers == rhs.maxPerStageDescriptorUpdateAfterBindStorageBuffers ) && - ( maxPerStageDescriptorUpdateAfterBindSampledImages == rhs.maxPerStageDescriptorUpdateAfterBindSampledImages ) && - ( maxPerStageDescriptorUpdateAfterBindStorageImages == rhs.maxPerStageDescriptorUpdateAfterBindStorageImages ) && - ( maxPerStageDescriptorUpdateAfterBindInputAttachments == rhs.maxPerStageDescriptorUpdateAfterBindInputAttachments ) && - ( maxPerStageUpdateAfterBindResources == rhs.maxPerStageUpdateAfterBindResources ) && - ( maxDescriptorSetUpdateAfterBindSamplers == rhs.maxDescriptorSetUpdateAfterBindSamplers ) && - ( maxDescriptorSetUpdateAfterBindUniformBuffers == rhs.maxDescriptorSetUpdateAfterBindUniformBuffers ) && - ( maxDescriptorSetUpdateAfterBindUniformBuffersDynamic == rhs.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic ) && - ( maxDescriptorSetUpdateAfterBindStorageBuffers == rhs.maxDescriptorSetUpdateAfterBindStorageBuffers ) && - ( maxDescriptorSetUpdateAfterBindStorageBuffersDynamic == rhs.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic ) && - ( maxDescriptorSetUpdateAfterBindSampledImages == rhs.maxDescriptorSetUpdateAfterBindSampledImages ) && - ( maxDescriptorSetUpdateAfterBindStorageImages == rhs.maxDescriptorSetUpdateAfterBindStorageImages ) && - ( maxDescriptorSetUpdateAfterBindInputAttachments == rhs.maxDescriptorSetUpdateAfterBindInputAttachments ) && - ( supportedDepthResolveModes == rhs.supportedDepthResolveModes ) && ( supportedStencilResolveModes == rhs.supportedStencilResolveModes ) && - ( independentResolveNone == rhs.independentResolveNone ) && ( independentResolve == rhs.independentResolve ) && - ( filterMinmaxSingleComponentFormats == rhs.filterMinmaxSingleComponentFormats ) && - ( filterMinmaxImageComponentMapping == rhs.filterMinmaxImageComponentMapping ) && - ( maxTimelineSemaphoreValueDifference == rhs.maxTimelineSemaphoreValueDifference ) && - ( framebufferIntegerColorSampleCounts == rhs.framebufferIntegerColorSampleCounts ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan12Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan12Properties; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::DriverId driverID = VULKAN_HPP_NAMESPACE::DriverId::eAmdProprietary; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverName = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D driverInfo = {}; - VULKAN_HPP_NAMESPACE::ConformanceVersion conformanceVersion = {}; - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence denormBehaviorIndependence = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly; - VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence roundingModeIndependence = VULKAN_HPP_NAMESPACE::ShaderFloatControlsIndependence::e32BitOnly; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSignedZeroInfNanPreserveFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormPreserveFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDenormFlushToZeroFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTEFloat64 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat16 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat32 = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderRoundingModeRTZFloat64 = {}; - uint32_t maxUpdateAfterBindDescriptorsInAllPools = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderUniformBufferArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderSampledImageArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageBufferArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderStorageImageArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderInputAttachmentArrayNonUniformIndexingNative = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustBufferAccessUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 quadDivergentImplicitLod = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindSamplers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments = {}; - uint32_t maxPerStageUpdateAfterBindResources = {}; - uint32_t maxDescriptorSetUpdateAfterBindSamplers = {}; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers = {}; - uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = {}; - uint32_t maxDescriptorSetUpdateAfterBindSampledImages = {}; - uint32_t maxDescriptorSetUpdateAfterBindStorageImages = {}; - uint32_t maxDescriptorSetUpdateAfterBindInputAttachments = {}; - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedDepthResolveModes = {}; - VULKAN_HPP_NAMESPACE::ResolveModeFlags supportedStencilResolveModes = {}; - VULKAN_HPP_NAMESPACE::Bool32 independentResolveNone = {}; - VULKAN_HPP_NAMESPACE::Bool32 independentResolve = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxSingleComponentFormats = {}; - VULKAN_HPP_NAMESPACE::Bool32 filterMinmaxImageComponentMapping = {}; - uint64_t maxTimelineSemaphoreValueDifference = {}; - VULKAN_HPP_NAMESPACE::SampleCountFlags framebufferIntegerColorSampleCounts = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan12Properties; - }; - - struct PhysicalDeviceVulkan13Features - { - using NativeType = VkPhysicalDeviceVulkan13Features; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan13Features; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan13Features( VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 privateData_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 synchronization2_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 maintenance4_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , robustImageAccess( robustImageAccess_ ) - , inlineUniformBlock( inlineUniformBlock_ ) - , descriptorBindingInlineUniformBlockUpdateAfterBind( descriptorBindingInlineUniformBlockUpdateAfterBind_ ) - , pipelineCreationCacheControl( pipelineCreationCacheControl_ ) - , privateData( privateData_ ) - , shaderDemoteToHelperInvocation( shaderDemoteToHelperInvocation_ ) - , shaderTerminateInvocation( shaderTerminateInvocation_ ) - , subgroupSizeControl( subgroupSizeControl_ ) - , computeFullSubgroups( computeFullSubgroups_ ) - , synchronization2( synchronization2_ ) - , textureCompressionASTC_HDR( textureCompressionASTC_HDR_ ) - , shaderZeroInitializeWorkgroupMemory( shaderZeroInitializeWorkgroupMemory_ ) - , dynamicRendering( dynamicRendering_ ) - , shaderIntegerDotProduct( shaderIntegerDotProduct_ ) - , maintenance4( maintenance4_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan13Features( PhysicalDeviceVulkan13Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan13Features( VkPhysicalDeviceVulkan13Features const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan13Features( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan13Features & operator=( PhysicalDeviceVulkan13Features const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan13Features & operator=( VkPhysicalDeviceVulkan13Features const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setRobustImageAccess( VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess_ ) VULKAN_HPP_NOEXCEPT - { - robustImageAccess = robustImageAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setInlineUniformBlock( VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock_ ) VULKAN_HPP_NOEXCEPT - { - inlineUniformBlock = inlineUniformBlock_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setDescriptorBindingInlineUniformBlockUpdateAfterBind( - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind_ ) VULKAN_HPP_NOEXCEPT - { - descriptorBindingInlineUniformBlockUpdateAfterBind = descriptorBindingInlineUniformBlockUpdateAfterBind_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setPipelineCreationCacheControl( VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl_ ) VULKAN_HPP_NOEXCEPT - { - pipelineCreationCacheControl = pipelineCreationCacheControl_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setPrivateData( VULKAN_HPP_NAMESPACE::Bool32 privateData_ ) VULKAN_HPP_NOEXCEPT - { - privateData = privateData_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setShaderDemoteToHelperInvocation( VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation_ ) VULKAN_HPP_NOEXCEPT - { - shaderDemoteToHelperInvocation = shaderDemoteToHelperInvocation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setShaderTerminateInvocation( VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation_ ) VULKAN_HPP_NOEXCEPT - { - shaderTerminateInvocation = shaderTerminateInvocation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setSubgroupSizeControl( VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl_ ) VULKAN_HPP_NOEXCEPT - { - subgroupSizeControl = subgroupSizeControl_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setComputeFullSubgroups( VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups_ ) VULKAN_HPP_NOEXCEPT - { - computeFullSubgroups = computeFullSubgroups_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setSynchronization2( VULKAN_HPP_NAMESPACE::Bool32 synchronization2_ ) VULKAN_HPP_NOEXCEPT - { - synchronization2 = synchronization2_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setTextureCompressionASTC_HDR( VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR_ ) VULKAN_HPP_NOEXCEPT - { - textureCompressionASTC_HDR = textureCompressionASTC_HDR_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setShaderZeroInitializeWorkgroupMemory( VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory_ ) VULKAN_HPP_NOEXCEPT - { - shaderZeroInitializeWorkgroupMemory = shaderZeroInitializeWorkgroupMemory_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setDynamicRendering( VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering_ ) VULKAN_HPP_NOEXCEPT - { - dynamicRendering = dynamicRendering_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & - setShaderIntegerDotProduct( VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct_ ) VULKAN_HPP_NOEXCEPT - { - shaderIntegerDotProduct = shaderIntegerDotProduct_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkan13Features & setMaintenance4( VULKAN_HPP_NAMESPACE::Bool32 maintenance4_ ) VULKAN_HPP_NOEXCEPT - { - maintenance4 = maintenance4_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVulkan13Features const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan13Features &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - robustImageAccess, - inlineUniformBlock, - descriptorBindingInlineUniformBlockUpdateAfterBind, - pipelineCreationCacheControl, - privateData, - shaderDemoteToHelperInvocation, - shaderTerminateInvocation, - subgroupSizeControl, - computeFullSubgroups, - synchronization2, - textureCompressionASTC_HDR, - shaderZeroInitializeWorkgroupMemory, - dynamicRendering, - shaderIntegerDotProduct, - maintenance4 ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan13Features const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan13Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( robustImageAccess == rhs.robustImageAccess ) && - ( inlineUniformBlock == rhs.inlineUniformBlock ) && - ( descriptorBindingInlineUniformBlockUpdateAfterBind == rhs.descriptorBindingInlineUniformBlockUpdateAfterBind ) && - ( pipelineCreationCacheControl == rhs.pipelineCreationCacheControl ) && ( privateData == rhs.privateData ) && - ( shaderDemoteToHelperInvocation == rhs.shaderDemoteToHelperInvocation ) && ( shaderTerminateInvocation == rhs.shaderTerminateInvocation ) && - ( subgroupSizeControl == rhs.subgroupSizeControl ) && ( computeFullSubgroups == rhs.computeFullSubgroups ) && - ( synchronization2 == rhs.synchronization2 ) && ( textureCompressionASTC_HDR == rhs.textureCompressionASTC_HDR ) && - ( shaderZeroInitializeWorkgroupMemory == rhs.shaderZeroInitializeWorkgroupMemory ) && ( dynamicRendering == rhs.dynamicRendering ) && - ( shaderIntegerDotProduct == rhs.shaderIntegerDotProduct ) && ( maintenance4 == rhs.maintenance4 ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan13Features const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan13Features; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 robustImageAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 inlineUniformBlock = {}; - VULKAN_HPP_NAMESPACE::Bool32 descriptorBindingInlineUniformBlockUpdateAfterBind = {}; - VULKAN_HPP_NAMESPACE::Bool32 pipelineCreationCacheControl = {}; - VULKAN_HPP_NAMESPACE::Bool32 privateData = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderDemoteToHelperInvocation = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderTerminateInvocation = {}; - VULKAN_HPP_NAMESPACE::Bool32 subgroupSizeControl = {}; - VULKAN_HPP_NAMESPACE::Bool32 computeFullSubgroups = {}; - VULKAN_HPP_NAMESPACE::Bool32 synchronization2 = {}; - VULKAN_HPP_NAMESPACE::Bool32 textureCompressionASTC_HDR = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory = {}; - VULKAN_HPP_NAMESPACE::Bool32 dynamicRendering = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderIntegerDotProduct = {}; - VULKAN_HPP_NAMESPACE::Bool32 maintenance4 = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan13Features; - }; - - struct PhysicalDeviceVulkan13Properties - { - using NativeType = VkPhysicalDeviceVulkan13Properties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkan13Properties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceVulkan13Properties( uint32_t minSubgroupSize_ = {}, - uint32_t maxSubgroupSize_ = {}, - uint32_t maxComputeWorkgroupSubgroups_ = {}, - VULKAN_HPP_NAMESPACE::ShaderStageFlags requiredSubgroupSizeStages_ = {}, - uint32_t maxInlineUniformBlockSize_ = {}, - uint32_t maxPerStageDescriptorInlineUniformBlocks_ = {}, - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks_ = {}, - uint32_t maxDescriptorSetInlineUniformBlocks_ = {}, - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks_ = {}, - uint32_t maxInlineUniformTotalSize_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize storageTexelBufferOffsetAlignmentBytes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 storageTexelBufferOffsetSingleTexelAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize uniformTexelBufferOffsetAlignmentBytes_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 uniformTexelBufferOffsetSingleTexelAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize maxBufferSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minSubgroupSize( minSubgroupSize_ ) - , maxSubgroupSize( maxSubgroupSize_ ) - , maxComputeWorkgroupSubgroups( maxComputeWorkgroupSubgroups_ ) - , requiredSubgroupSizeStages( requiredSubgroupSizeStages_ ) - , maxInlineUniformBlockSize( maxInlineUniformBlockSize_ ) - , maxPerStageDescriptorInlineUniformBlocks( maxPerStageDescriptorInlineUniformBlocks_ ) - , maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks( maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks_ ) - , maxDescriptorSetInlineUniformBlocks( maxDescriptorSetInlineUniformBlocks_ ) - , maxDescriptorSetUpdateAfterBindInlineUniformBlocks( maxDescriptorSetUpdateAfterBindInlineUniformBlocks_ ) - , maxInlineUniformTotalSize( maxInlineUniformTotalSize_ ) - , integerDotProduct8BitUnsignedAccelerated( integerDotProduct8BitUnsignedAccelerated_ ) - , integerDotProduct8BitSignedAccelerated( integerDotProduct8BitSignedAccelerated_ ) - , integerDotProduct8BitMixedSignednessAccelerated( integerDotProduct8BitMixedSignednessAccelerated_ ) - , integerDotProduct4x8BitPackedUnsignedAccelerated( integerDotProduct4x8BitPackedUnsignedAccelerated_ ) - , integerDotProduct4x8BitPackedSignedAccelerated( integerDotProduct4x8BitPackedSignedAccelerated_ ) - , integerDotProduct4x8BitPackedMixedSignednessAccelerated( integerDotProduct4x8BitPackedMixedSignednessAccelerated_ ) - , integerDotProduct16BitUnsignedAccelerated( integerDotProduct16BitUnsignedAccelerated_ ) - , integerDotProduct16BitSignedAccelerated( integerDotProduct16BitSignedAccelerated_ ) - , integerDotProduct16BitMixedSignednessAccelerated( integerDotProduct16BitMixedSignednessAccelerated_ ) - , integerDotProduct32BitUnsignedAccelerated( integerDotProduct32BitUnsignedAccelerated_ ) - , integerDotProduct32BitSignedAccelerated( integerDotProduct32BitSignedAccelerated_ ) - , integerDotProduct32BitMixedSignednessAccelerated( integerDotProduct32BitMixedSignednessAccelerated_ ) - , integerDotProduct64BitUnsignedAccelerated( integerDotProduct64BitUnsignedAccelerated_ ) - , integerDotProduct64BitSignedAccelerated( integerDotProduct64BitSignedAccelerated_ ) - , integerDotProduct64BitMixedSignednessAccelerated( integerDotProduct64BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitUnsignedAccelerated( integerDotProductAccumulatingSaturating8BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitSignedAccelerated( integerDotProductAccumulatingSaturating8BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated( integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated( integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated( - integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitUnsignedAccelerated( integerDotProductAccumulatingSaturating16BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitSignedAccelerated( integerDotProductAccumulatingSaturating16BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitUnsignedAccelerated( integerDotProductAccumulatingSaturating32BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitSignedAccelerated( integerDotProductAccumulatingSaturating32BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitUnsignedAccelerated( integerDotProductAccumulatingSaturating64BitUnsignedAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitSignedAccelerated( integerDotProductAccumulatingSaturating64BitSignedAccelerated_ ) - , integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated( integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated_ ) - , storageTexelBufferOffsetAlignmentBytes( storageTexelBufferOffsetAlignmentBytes_ ) - , storageTexelBufferOffsetSingleTexelAlignment( storageTexelBufferOffsetSingleTexelAlignment_ ) - , uniformTexelBufferOffsetAlignmentBytes( uniformTexelBufferOffsetAlignmentBytes_ ) - , uniformTexelBufferOffsetSingleTexelAlignment( uniformTexelBufferOffsetSingleTexelAlignment_ ) - , maxBufferSize( maxBufferSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkan13Properties( PhysicalDeviceVulkan13Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan13Properties( VkPhysicalDeviceVulkan13Properties const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkan13Properties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkan13Properties & operator=( PhysicalDeviceVulkan13Properties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkan13Properties & operator=( VkPhysicalDeviceVulkan13Properties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPhysicalDeviceVulkan13Properties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkan13Properties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - minSubgroupSize, - maxSubgroupSize, - maxComputeWorkgroupSubgroups, - requiredSubgroupSizeStages, - maxInlineUniformBlockSize, - maxPerStageDescriptorInlineUniformBlocks, - maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks, - maxDescriptorSetInlineUniformBlocks, - maxDescriptorSetUpdateAfterBindInlineUniformBlocks, - maxInlineUniformTotalSize, - integerDotProduct8BitUnsignedAccelerated, - integerDotProduct8BitSignedAccelerated, - integerDotProduct8BitMixedSignednessAccelerated, - integerDotProduct4x8BitPackedUnsignedAccelerated, - integerDotProduct4x8BitPackedSignedAccelerated, - integerDotProduct4x8BitPackedMixedSignednessAccelerated, - integerDotProduct16BitUnsignedAccelerated, - integerDotProduct16BitSignedAccelerated, - integerDotProduct16BitMixedSignednessAccelerated, - integerDotProduct32BitUnsignedAccelerated, - integerDotProduct32BitSignedAccelerated, - integerDotProduct32BitMixedSignednessAccelerated, - integerDotProduct64BitUnsignedAccelerated, - integerDotProduct64BitSignedAccelerated, - integerDotProduct64BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating8BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating8BitSignedAccelerated, - integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated, - integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating16BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating16BitSignedAccelerated, - integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating32BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating32BitSignedAccelerated, - integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated, - integerDotProductAccumulatingSaturating64BitUnsignedAccelerated, - integerDotProductAccumulatingSaturating64BitSignedAccelerated, - integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated, - storageTexelBufferOffsetAlignmentBytes, - storageTexelBufferOffsetSingleTexelAlignment, - uniformTexelBufferOffsetAlignmentBytes, - uniformTexelBufferOffsetSingleTexelAlignment, - maxBufferSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkan13Properties const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkan13Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minSubgroupSize == rhs.minSubgroupSize ) && ( maxSubgroupSize == rhs.maxSubgroupSize ) && - ( maxComputeWorkgroupSubgroups == rhs.maxComputeWorkgroupSubgroups ) && ( requiredSubgroupSizeStages == rhs.requiredSubgroupSizeStages ) && - ( maxInlineUniformBlockSize == rhs.maxInlineUniformBlockSize ) && - ( maxPerStageDescriptorInlineUniformBlocks == rhs.maxPerStageDescriptorInlineUniformBlocks ) && - ( maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks == rhs.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks ) && - ( maxDescriptorSetInlineUniformBlocks == rhs.maxDescriptorSetInlineUniformBlocks ) && - ( maxDescriptorSetUpdateAfterBindInlineUniformBlocks == rhs.maxDescriptorSetUpdateAfterBindInlineUniformBlocks ) && - ( maxInlineUniformTotalSize == rhs.maxInlineUniformTotalSize ) && - ( integerDotProduct8BitUnsignedAccelerated == rhs.integerDotProduct8BitUnsignedAccelerated ) && - ( integerDotProduct8BitSignedAccelerated == rhs.integerDotProduct8BitSignedAccelerated ) && - ( integerDotProduct8BitMixedSignednessAccelerated == rhs.integerDotProduct8BitMixedSignednessAccelerated ) && - ( integerDotProduct4x8BitPackedUnsignedAccelerated == rhs.integerDotProduct4x8BitPackedUnsignedAccelerated ) && - ( integerDotProduct4x8BitPackedSignedAccelerated == rhs.integerDotProduct4x8BitPackedSignedAccelerated ) && - ( integerDotProduct4x8BitPackedMixedSignednessAccelerated == rhs.integerDotProduct4x8BitPackedMixedSignednessAccelerated ) && - ( integerDotProduct16BitUnsignedAccelerated == rhs.integerDotProduct16BitUnsignedAccelerated ) && - ( integerDotProduct16BitSignedAccelerated == rhs.integerDotProduct16BitSignedAccelerated ) && - ( integerDotProduct16BitMixedSignednessAccelerated == rhs.integerDotProduct16BitMixedSignednessAccelerated ) && - ( integerDotProduct32BitUnsignedAccelerated == rhs.integerDotProduct32BitUnsignedAccelerated ) && - ( integerDotProduct32BitSignedAccelerated == rhs.integerDotProduct32BitSignedAccelerated ) && - ( integerDotProduct32BitMixedSignednessAccelerated == rhs.integerDotProduct32BitMixedSignednessAccelerated ) && - ( integerDotProduct64BitUnsignedAccelerated == rhs.integerDotProduct64BitUnsignedAccelerated ) && - ( integerDotProduct64BitSignedAccelerated == rhs.integerDotProduct64BitSignedAccelerated ) && - ( integerDotProduct64BitMixedSignednessAccelerated == rhs.integerDotProduct64BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating8BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating8BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating16BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating16BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating32BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating32BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitUnsignedAccelerated == rhs.integerDotProductAccumulatingSaturating64BitUnsignedAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitSignedAccelerated == rhs.integerDotProductAccumulatingSaturating64BitSignedAccelerated ) && - ( integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated == - rhs.integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated ) && - ( storageTexelBufferOffsetAlignmentBytes == rhs.storageTexelBufferOffsetAlignmentBytes ) && - ( storageTexelBufferOffsetSingleTexelAlignment == rhs.storageTexelBufferOffsetSingleTexelAlignment ) && - ( uniformTexelBufferOffsetAlignmentBytes == rhs.uniformTexelBufferOffsetAlignmentBytes ) && - ( uniformTexelBufferOffsetSingleTexelAlignment == rhs.uniformTexelBufferOffsetSingleTexelAlignment ) && ( maxBufferSize == rhs.maxBufferSize ); -# endif - } - - bool operator!=( PhysicalDeviceVulkan13Properties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkan13Properties; - void * pNext = {}; - uint32_t minSubgroupSize = {}; - uint32_t maxSubgroupSize = {}; - uint32_t maxComputeWorkgroupSubgroups = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags requiredSubgroupSizeStages = {}; - uint32_t maxInlineUniformBlockSize = {}; - uint32_t maxPerStageDescriptorInlineUniformBlocks = {}; - uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = {}; - uint32_t maxDescriptorSetInlineUniformBlocks = {}; - uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks = {}; - uint32_t maxInlineUniformTotalSize = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct8BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct16BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct32BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProduct64BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated = {}; - VULKAN_HPP_NAMESPACE::Bool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated = {}; - VULKAN_HPP_NAMESPACE::DeviceSize storageTexelBufferOffsetAlignmentBytes = {}; - VULKAN_HPP_NAMESPACE::Bool32 storageTexelBufferOffsetSingleTexelAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize uniformTexelBufferOffsetAlignmentBytes = {}; - VULKAN_HPP_NAMESPACE::Bool32 uniformTexelBufferOffsetSingleTexelAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize maxBufferSize = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkan13Properties; - }; - - struct PhysicalDeviceVulkanMemoryModelFeatures - { - using NativeType = VkPhysicalDeviceVulkanMemoryModelFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceVulkanMemoryModelFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkanMemoryModelFeatures( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vulkanMemoryModel( vulkanMemoryModel_ ) - , vulkanMemoryModelDeviceScope( vulkanMemoryModelDeviceScope_ ) - , vulkanMemoryModelAvailabilityVisibilityChains( vulkanMemoryModelAvailabilityVisibilityChains_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceVulkanMemoryModelFeatures( PhysicalDeviceVulkanMemoryModelFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkanMemoryModelFeatures( VkPhysicalDeviceVulkanMemoryModelFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceVulkanMemoryModelFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceVulkanMemoryModelFeatures & operator=( PhysicalDeviceVulkanMemoryModelFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceVulkanMemoryModelFeatures & operator=( VkPhysicalDeviceVulkanMemoryModelFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkanMemoryModelFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkanMemoryModelFeatures & - setVulkanMemoryModel( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModel = vulkanMemoryModel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkanMemoryModelFeatures & - setVulkanMemoryModelDeviceScope( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModelDeviceScope = vulkanMemoryModelDeviceScope_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceVulkanMemoryModelFeatures & - setVulkanMemoryModelAvailabilityVisibilityChains( VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains_ ) VULKAN_HPP_NOEXCEPT - { - vulkanMemoryModelAvailabilityVisibilityChains = vulkanMemoryModelAvailabilityVisibilityChains_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceVulkanMemoryModelFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceVulkanMemoryModelFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vulkanMemoryModel, vulkanMemoryModelDeviceScope, vulkanMemoryModelAvailabilityVisibilityChains ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceVulkanMemoryModelFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceVulkanMemoryModelFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vulkanMemoryModel == rhs.vulkanMemoryModel ) && - ( vulkanMemoryModelDeviceScope == rhs.vulkanMemoryModelDeviceScope ) && - ( vulkanMemoryModelAvailabilityVisibilityChains == rhs.vulkanMemoryModelAvailabilityVisibilityChains ); -# endif - } - - bool operator!=( PhysicalDeviceVulkanMemoryModelFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceVulkanMemoryModelFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModel = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelDeviceScope = {}; - VULKAN_HPP_NAMESPACE::Bool32 vulkanMemoryModelAvailabilityVisibilityChains = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceVulkanMemoryModelFeatures; - }; - using PhysicalDeviceVulkanMemoryModelFeaturesKHR = PhysicalDeviceVulkanMemoryModelFeatures; - - struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR - { - using NativeType = VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR( VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayoutScalarBlockLayout_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout8BitAccess_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout16BitAccess_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , workgroupMemoryExplicitLayout( workgroupMemoryExplicitLayout_ ) - , workgroupMemoryExplicitLayoutScalarBlockLayout( workgroupMemoryExplicitLayoutScalarBlockLayout_ ) - , workgroupMemoryExplicitLayout8BitAccess( workgroupMemoryExplicitLayout8BitAccess_ ) - , workgroupMemoryExplicitLayout16BitAccess( workgroupMemoryExplicitLayout16BitAccess_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR( VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - operator=( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - operator=( VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - setWorkgroupMemoryExplicitLayout( VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout_ ) VULKAN_HPP_NOEXCEPT - { - workgroupMemoryExplicitLayout = workgroupMemoryExplicitLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - setWorkgroupMemoryExplicitLayoutScalarBlockLayout( VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayoutScalarBlockLayout_ ) VULKAN_HPP_NOEXCEPT - { - workgroupMemoryExplicitLayoutScalarBlockLayout = workgroupMemoryExplicitLayoutScalarBlockLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - setWorkgroupMemoryExplicitLayout8BitAccess( VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout8BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - workgroupMemoryExplicitLayout8BitAccess = workgroupMemoryExplicitLayout8BitAccess_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR & - setWorkgroupMemoryExplicitLayout16BitAccess( VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout16BitAccess_ ) VULKAN_HPP_NOEXCEPT - { - workgroupMemoryExplicitLayout16BitAccess = workgroupMemoryExplicitLayout16BitAccess_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - workgroupMemoryExplicitLayout, - workgroupMemoryExplicitLayoutScalarBlockLayout, - workgroupMemoryExplicitLayout8BitAccess, - workgroupMemoryExplicitLayout16BitAccess ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & ) const = default; -#else - bool operator==( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( workgroupMemoryExplicitLayout == rhs.workgroupMemoryExplicitLayout ) && - ( workgroupMemoryExplicitLayoutScalarBlockLayout == rhs.workgroupMemoryExplicitLayoutScalarBlockLayout ) && - ( workgroupMemoryExplicitLayout8BitAccess == rhs.workgroupMemoryExplicitLayout8BitAccess ) && - ( workgroupMemoryExplicitLayout16BitAccess == rhs.workgroupMemoryExplicitLayout16BitAccess ); -# endif - } - - bool operator!=( PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout = {}; - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayoutScalarBlockLayout = {}; - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout8BitAccess = {}; - VULKAN_HPP_NAMESPACE::Bool32 workgroupMemoryExplicitLayout16BitAccess = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR; - }; - - struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT - { - using NativeType = VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 ycbcr2plane444Formats_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , ycbcr2plane444Formats( ycbcr2plane444Formats_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT( PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT( VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT & operator=( PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT & operator=( VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT & - setYcbcr2plane444Formats( VULKAN_HPP_NAMESPACE::Bool32 ycbcr2plane444Formats_ ) VULKAN_HPP_NOEXCEPT - { - ycbcr2plane444Formats = ycbcr2plane444Formats_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, ycbcr2plane444Formats ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ycbcr2plane444Formats == rhs.ycbcr2plane444Formats ); -# endif - } - - bool operator!=( PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 ycbcr2plane444Formats = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT; - }; - - struct PhysicalDeviceYcbcrImageArraysFeaturesEXT - { - using NativeType = VkPhysicalDeviceYcbcrImageArraysFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceYcbcrImageArraysFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceYcbcrImageArraysFeaturesEXT( VULKAN_HPP_NAMESPACE::Bool32 ycbcrImageArrays_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , ycbcrImageArrays( ycbcrImageArrays_ ) - { - } - - VULKAN_HPP_CONSTEXPR PhysicalDeviceYcbcrImageArraysFeaturesEXT( PhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceYcbcrImageArraysFeaturesEXT( VkPhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceYcbcrImageArraysFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceYcbcrImageArraysFeaturesEXT & operator=( PhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceYcbcrImageArraysFeaturesEXT & operator=( VkPhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcrImageArraysFeaturesEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceYcbcrImageArraysFeaturesEXT & - setYcbcrImageArrays( VULKAN_HPP_NAMESPACE::Bool32 ycbcrImageArrays_ ) VULKAN_HPP_NOEXCEPT - { - ycbcrImageArrays = ycbcrImageArrays_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceYcbcrImageArraysFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceYcbcrImageArraysFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, ycbcrImageArrays ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceYcbcrImageArraysFeaturesEXT const & ) const = default; -#else - bool operator==( PhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ycbcrImageArrays == rhs.ycbcrImageArrays ); -# endif - } - - bool operator!=( PhysicalDeviceYcbcrImageArraysFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceYcbcrImageArraysFeaturesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 ycbcrImageArrays = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceYcbcrImageArraysFeaturesEXT; - }; - - struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures - { - using NativeType = VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures( VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shaderZeroInitializeWorkgroupMemory( shaderZeroInitializeWorkgroupMemory_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures( PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures( VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - : PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures & - operator=( PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures & operator=( VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures & - setShaderZeroInitializeWorkgroupMemory( VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory_ ) VULKAN_HPP_NOEXCEPT - { - shaderZeroInitializeWorkgroupMemory = shaderZeroInitializeWorkgroupMemory_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shaderZeroInitializeWorkgroupMemory ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & ) const = default; -#else - bool operator==( PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shaderZeroInitializeWorkgroupMemory == rhs.shaderZeroInitializeWorkgroupMemory ); -# endif - } - - bool operator!=( PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shaderZeroInitializeWorkgroupMemory = {}; - }; - - template <> - struct CppType - { - using Type = PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - }; - using PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR = PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures; - - struct PipelineCacheCreateInfo - { - using NativeType = VkPipelineCacheCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCacheCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCacheCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags flags_ = {}, - size_t initialDataSize_ = {}, - const void * pInitialData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , initialDataSize( initialDataSize_ ) - , pInitialData( pInitialData_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCacheCreateInfo( PipelineCacheCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCacheCreateInfo( VkPipelineCacheCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCacheCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - PipelineCacheCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & initialData_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), initialDataSize( initialData_.size() * sizeof( T ) ), pInitialData( initialData_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCacheCreateInfo & operator=( PipelineCacheCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCacheCreateInfo & operator=( VkPipelineCacheCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCacheCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheCreateInfo & setInitialDataSize( size_t initialDataSize_ ) VULKAN_HPP_NOEXCEPT - { - initialDataSize = initialDataSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheCreateInfo & setPInitialData( const void * pInitialData_ ) VULKAN_HPP_NOEXCEPT - { - pInitialData = pInitialData_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - PipelineCacheCreateInfo & setInitialData( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & initialData_ ) VULKAN_HPP_NOEXCEPT - { - initialDataSize = initialData_.size() * sizeof( T ); - pInitialData = initialData_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCacheCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCacheCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, initialDataSize, pInitialData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCacheCreateInfo const & ) const = default; -#else - bool operator==( PipelineCacheCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( initialDataSize == rhs.initialDataSize ) && - ( pInitialData == rhs.pInitialData ); -# endif - } - - bool operator!=( PipelineCacheCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCacheCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCacheCreateFlags flags = {}; - size_t initialDataSize = {}; - const void * pInitialData = {}; - }; - - template <> - struct CppType - { - using Type = PipelineCacheCreateInfo; - }; - - struct PipelineCacheHeaderVersionOne - { - using NativeType = VkPipelineCacheHeaderVersionOne; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - PipelineCacheHeaderVersionOne( uint32_t headerSize_ = {}, - VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion headerVersion_ = VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion::eOne, - uint32_t vendorID_ = {}, - uint32_t deviceID_ = {}, - std::array const & pipelineCacheUUID_ = {} ) VULKAN_HPP_NOEXCEPT - : headerSize( headerSize_ ) - , headerVersion( headerVersion_ ) - , vendorID( vendorID_ ) - , deviceID( deviceID_ ) - , pipelineCacheUUID( pipelineCacheUUID_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne( PipelineCacheHeaderVersionOne const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCacheHeaderVersionOne( VkPipelineCacheHeaderVersionOne const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCacheHeaderVersionOne( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCacheHeaderVersionOne & operator=( PipelineCacheHeaderVersionOne const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCacheHeaderVersionOne & operator=( VkPipelineCacheHeaderVersionOne const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne & setHeaderSize( uint32_t headerSize_ ) VULKAN_HPP_NOEXCEPT - { - headerSize = headerSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne & - setHeaderVersion( VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion headerVersion_ ) VULKAN_HPP_NOEXCEPT - { - headerVersion = headerVersion_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne & setVendorID( uint32_t vendorID_ ) VULKAN_HPP_NOEXCEPT - { - vendorID = vendorID_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne & setDeviceID( uint32_t deviceID_ ) VULKAN_HPP_NOEXCEPT - { - deviceID = deviceID_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCacheHeaderVersionOne & setPipelineCacheUUID( std::array pipelineCacheUUID_ ) VULKAN_HPP_NOEXCEPT - { - pipelineCacheUUID = pipelineCacheUUID_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCacheHeaderVersionOne const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCacheHeaderVersionOne &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( headerSize, headerVersion, vendorID, deviceID, pipelineCacheUUID ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCacheHeaderVersionOne const & ) const = default; -#else - bool operator==( PipelineCacheHeaderVersionOne const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( headerSize == rhs.headerSize ) && ( headerVersion == rhs.headerVersion ) && ( vendorID == rhs.vendorID ) && ( deviceID == rhs.deviceID ) && - ( pipelineCacheUUID == rhs.pipelineCacheUUID ); -# endif - } - - bool operator!=( PipelineCacheHeaderVersionOne const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t headerSize = {}; - VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion headerVersion = VULKAN_HPP_NAMESPACE::PipelineCacheHeaderVersion::eOne; - uint32_t vendorID = {}; - uint32_t deviceID = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D pipelineCacheUUID = {}; - }; - - struct PipelineColorBlendAdvancedStateCreateInfoEXT - { - using NativeType = VkPipelineColorBlendAdvancedStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PipelineColorBlendAdvancedStateCreateInfoEXT( VULKAN_HPP_NAMESPACE::Bool32 srcPremultiplied_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 dstPremultiplied_ = {}, - VULKAN_HPP_NAMESPACE::BlendOverlapEXT blendOverlap_ = VULKAN_HPP_NAMESPACE::BlendOverlapEXT::eUncorrelated, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcPremultiplied( srcPremultiplied_ ) - , dstPremultiplied( dstPremultiplied_ ) - , blendOverlap( blendOverlap_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineColorBlendAdvancedStateCreateInfoEXT( PipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendAdvancedStateCreateInfoEXT( VkPipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineColorBlendAdvancedStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineColorBlendAdvancedStateCreateInfoEXT & operator=( PipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorBlendAdvancedStateCreateInfoEXT & operator=( VkPipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAdvancedStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAdvancedStateCreateInfoEXT & - setSrcPremultiplied( VULKAN_HPP_NAMESPACE::Bool32 srcPremultiplied_ ) VULKAN_HPP_NOEXCEPT - { - srcPremultiplied = srcPremultiplied_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAdvancedStateCreateInfoEXT & - setDstPremultiplied( VULKAN_HPP_NAMESPACE::Bool32 dstPremultiplied_ ) VULKAN_HPP_NOEXCEPT - { - dstPremultiplied = dstPremultiplied_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorBlendAdvancedStateCreateInfoEXT & - setBlendOverlap( VULKAN_HPP_NAMESPACE::BlendOverlapEXT blendOverlap_ ) VULKAN_HPP_NOEXCEPT - { - blendOverlap = blendOverlap_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineColorBlendAdvancedStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineColorBlendAdvancedStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcPremultiplied, dstPremultiplied, blendOverlap ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineColorBlendAdvancedStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcPremultiplied == rhs.srcPremultiplied ) && ( dstPremultiplied == rhs.dstPremultiplied ) && - ( blendOverlap == rhs.blendOverlap ); -# endif - } - - bool operator!=( PipelineColorBlendAdvancedStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 srcPremultiplied = {}; - VULKAN_HPP_NAMESPACE::Bool32 dstPremultiplied = {}; - VULKAN_HPP_NAMESPACE::BlendOverlapEXT blendOverlap = VULKAN_HPP_NAMESPACE::BlendOverlapEXT::eUncorrelated; - }; - - template <> - struct CppType - { - using Type = PipelineColorBlendAdvancedStateCreateInfoEXT; - }; - - struct PipelineColorWriteCreateInfoEXT - { - using NativeType = VkPipelineColorWriteCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineColorWriteCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineColorWriteCreateInfoEXT( uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::Bool32 * pColorWriteEnables_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachmentCount( attachmentCount_ ) - , pColorWriteEnables( pColorWriteEnables_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineColorWriteCreateInfoEXT( PipelineColorWriteCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorWriteCreateInfoEXT( VkPipelineColorWriteCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineColorWriteCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineColorWriteCreateInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorWriteEnables_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), attachmentCount( static_cast( colorWriteEnables_.size() ) ), pColorWriteEnables( colorWriteEnables_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineColorWriteCreateInfoEXT & operator=( PipelineColorWriteCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineColorWriteCreateInfoEXT & operator=( VkPipelineColorWriteCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineColorWriteCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorWriteCreateInfoEXT & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineColorWriteCreateInfoEXT & - setPColorWriteEnables( const VULKAN_HPP_NAMESPACE::Bool32 * pColorWriteEnables_ ) VULKAN_HPP_NOEXCEPT - { - pColorWriteEnables = pColorWriteEnables_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineColorWriteCreateInfoEXT & - setColorWriteEnables( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorWriteEnables_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( colorWriteEnables_.size() ); - pColorWriteEnables = colorWriteEnables_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineColorWriteCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineColorWriteCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, attachmentCount, pColorWriteEnables ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineColorWriteCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineColorWriteCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachmentCount == rhs.attachmentCount ) && ( pColorWriteEnables == rhs.pColorWriteEnables ); -# endif - } - - bool operator!=( PipelineColorWriteCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineColorWriteCreateInfoEXT; - const void * pNext = {}; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::Bool32 * pColorWriteEnables = {}; - }; - - template <> - struct CppType - { - using Type = PipelineColorWriteCreateInfoEXT; - }; - - struct PipelineCompilerControlCreateInfoAMD - { - using NativeType = VkPipelineCompilerControlCreateInfoAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCompilerControlCreateInfoAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCompilerControlCreateInfoAMD( VULKAN_HPP_NAMESPACE::PipelineCompilerControlFlagsAMD compilerControlFlags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , compilerControlFlags( compilerControlFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCompilerControlCreateInfoAMD( PipelineCompilerControlCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCompilerControlCreateInfoAMD( VkPipelineCompilerControlCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCompilerControlCreateInfoAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCompilerControlCreateInfoAMD & operator=( PipelineCompilerControlCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCompilerControlCreateInfoAMD & operator=( VkPipelineCompilerControlCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCompilerControlCreateInfoAMD & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCompilerControlCreateInfoAMD & - setCompilerControlFlags( VULKAN_HPP_NAMESPACE::PipelineCompilerControlFlagsAMD compilerControlFlags_ ) VULKAN_HPP_NOEXCEPT - { - compilerControlFlags = compilerControlFlags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCompilerControlCreateInfoAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCompilerControlCreateInfoAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, compilerControlFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCompilerControlCreateInfoAMD const & ) const = default; -#else - bool operator==( PipelineCompilerControlCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( compilerControlFlags == rhs.compilerControlFlags ); -# endif - } - - bool operator!=( PipelineCompilerControlCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCompilerControlCreateInfoAMD; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCompilerControlFlagsAMD compilerControlFlags = {}; - }; - - template <> - struct CppType - { - using Type = PipelineCompilerControlCreateInfoAMD; - }; - - struct PipelineCoverageModulationStateCreateInfoNV - { - using NativeType = VkPipelineCoverageModulationStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCoverageModulationStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCoverageModulationStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateFlagsNV flags_ = {}, - VULKAN_HPP_NAMESPACE::CoverageModulationModeNV coverageModulationMode_ = VULKAN_HPP_NAMESPACE::CoverageModulationModeNV::eNone, - VULKAN_HPP_NAMESPACE::Bool32 coverageModulationTableEnable_ = {}, - uint32_t coverageModulationTableCount_ = {}, - const float * pCoverageModulationTable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , coverageModulationMode( coverageModulationMode_ ) - , coverageModulationTableEnable( coverageModulationTableEnable_ ) - , coverageModulationTableCount( coverageModulationTableCount_ ) - , pCoverageModulationTable( pCoverageModulationTable_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCoverageModulationStateCreateInfoNV( PipelineCoverageModulationStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageModulationStateCreateInfoNV( VkPipelineCoverageModulationStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCoverageModulationStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineCoverageModulationStateCreateInfoNV( VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateFlagsNV flags_, - VULKAN_HPP_NAMESPACE::CoverageModulationModeNV coverageModulationMode_, - VULKAN_HPP_NAMESPACE::Bool32 coverageModulationTableEnable_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & coverageModulationTable_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , coverageModulationMode( coverageModulationMode_ ) - , coverageModulationTableEnable( coverageModulationTableEnable_ ) - , coverageModulationTableCount( static_cast( coverageModulationTable_.size() ) ) - , pCoverageModulationTable( coverageModulationTable_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCoverageModulationStateCreateInfoNV & operator=( PipelineCoverageModulationStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageModulationStateCreateInfoNV & operator=( VkPipelineCoverageModulationStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & - setFlags( VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & - setCoverageModulationMode( VULKAN_HPP_NAMESPACE::CoverageModulationModeNV coverageModulationMode_ ) VULKAN_HPP_NOEXCEPT - { - coverageModulationMode = coverageModulationMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & - setCoverageModulationTableEnable( VULKAN_HPP_NAMESPACE::Bool32 coverageModulationTableEnable_ ) VULKAN_HPP_NOEXCEPT - { - coverageModulationTableEnable = coverageModulationTableEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & - setCoverageModulationTableCount( uint32_t coverageModulationTableCount_ ) VULKAN_HPP_NOEXCEPT - { - coverageModulationTableCount = coverageModulationTableCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageModulationStateCreateInfoNV & - setPCoverageModulationTable( const float * pCoverageModulationTable_ ) VULKAN_HPP_NOEXCEPT - { - pCoverageModulationTable = pCoverageModulationTable_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineCoverageModulationStateCreateInfoNV & - setCoverageModulationTable( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & coverageModulationTable_ ) VULKAN_HPP_NOEXCEPT - { - coverageModulationTableCount = static_cast( coverageModulationTable_.size() ); - pCoverageModulationTable = coverageModulationTable_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCoverageModulationStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCoverageModulationStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, coverageModulationMode, coverageModulationTableEnable, coverageModulationTableCount, pCoverageModulationTable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCoverageModulationStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineCoverageModulationStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( coverageModulationMode == rhs.coverageModulationMode ) && - ( coverageModulationTableEnable == rhs.coverageModulationTableEnable ) && ( coverageModulationTableCount == rhs.coverageModulationTableCount ) && - ( pCoverageModulationTable == rhs.pCoverageModulationTable ); -# endif - } - - bool operator!=( PipelineCoverageModulationStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCoverageModulationStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCoverageModulationStateCreateFlagsNV flags = {}; - VULKAN_HPP_NAMESPACE::CoverageModulationModeNV coverageModulationMode = VULKAN_HPP_NAMESPACE::CoverageModulationModeNV::eNone; - VULKAN_HPP_NAMESPACE::Bool32 coverageModulationTableEnable = {}; - uint32_t coverageModulationTableCount = {}; - const float * pCoverageModulationTable = {}; - }; - - template <> - struct CppType - { - using Type = PipelineCoverageModulationStateCreateInfoNV; - }; - - struct PipelineCoverageReductionStateCreateInfoNV - { - using NativeType = VkPipelineCoverageReductionStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCoverageReductionStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCoverageReductionStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::PipelineCoverageReductionStateCreateFlagsNV flags_ = {}, - VULKAN_HPP_NAMESPACE::CoverageReductionModeNV coverageReductionMode_ = VULKAN_HPP_NAMESPACE::CoverageReductionModeNV::eMerge, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , coverageReductionMode( coverageReductionMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCoverageReductionStateCreateInfoNV( PipelineCoverageReductionStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageReductionStateCreateInfoNV( VkPipelineCoverageReductionStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCoverageReductionStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCoverageReductionStateCreateInfoNV & operator=( PipelineCoverageReductionStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageReductionStateCreateInfoNV & operator=( VkPipelineCoverageReductionStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageReductionStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageReductionStateCreateInfoNV & - setFlags( VULKAN_HPP_NAMESPACE::PipelineCoverageReductionStateCreateFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageReductionStateCreateInfoNV & - setCoverageReductionMode( VULKAN_HPP_NAMESPACE::CoverageReductionModeNV coverageReductionMode_ ) VULKAN_HPP_NOEXCEPT - { - coverageReductionMode = coverageReductionMode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCoverageReductionStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCoverageReductionStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, coverageReductionMode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCoverageReductionStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineCoverageReductionStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( coverageReductionMode == rhs.coverageReductionMode ); -# endif - } - - bool operator!=( PipelineCoverageReductionStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCoverageReductionStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCoverageReductionStateCreateFlagsNV flags = {}; - VULKAN_HPP_NAMESPACE::CoverageReductionModeNV coverageReductionMode = VULKAN_HPP_NAMESPACE::CoverageReductionModeNV::eMerge; - }; - - template <> - struct CppType - { - using Type = PipelineCoverageReductionStateCreateInfoNV; - }; - - struct PipelineCoverageToColorStateCreateInfoNV - { - using NativeType = VkPipelineCoverageToColorStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCoverageToColorStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCoverageToColorStateCreateInfoNV( VULKAN_HPP_NAMESPACE::PipelineCoverageToColorStateCreateFlagsNV flags_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 coverageToColorEnable_ = {}, - uint32_t coverageToColorLocation_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , coverageToColorEnable( coverageToColorEnable_ ) - , coverageToColorLocation( coverageToColorLocation_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCoverageToColorStateCreateInfoNV( PipelineCoverageToColorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageToColorStateCreateInfoNV( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCoverageToColorStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCoverageToColorStateCreateInfoNV & operator=( PipelineCoverageToColorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCoverageToColorStateCreateInfoNV & operator=( VkPipelineCoverageToColorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageToColorStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageToColorStateCreateInfoNV & - setFlags( VULKAN_HPP_NAMESPACE::PipelineCoverageToColorStateCreateFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageToColorStateCreateInfoNV & - setCoverageToColorEnable( VULKAN_HPP_NAMESPACE::Bool32 coverageToColorEnable_ ) VULKAN_HPP_NOEXCEPT - { - coverageToColorEnable = coverageToColorEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCoverageToColorStateCreateInfoNV & setCoverageToColorLocation( uint32_t coverageToColorLocation_ ) VULKAN_HPP_NOEXCEPT - { - coverageToColorLocation = coverageToColorLocation_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCoverageToColorStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCoverageToColorStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, coverageToColorEnable, coverageToColorLocation ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCoverageToColorStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineCoverageToColorStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( coverageToColorEnable == rhs.coverageToColorEnable ) && - ( coverageToColorLocation == rhs.coverageToColorLocation ); -# endif - } - - bool operator!=( PipelineCoverageToColorStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCoverageToColorStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCoverageToColorStateCreateFlagsNV flags = {}; - VULKAN_HPP_NAMESPACE::Bool32 coverageToColorEnable = {}; - uint32_t coverageToColorLocation = {}; - }; - - template <> - struct CppType - { - using Type = PipelineCoverageToColorStateCreateInfoNV; - }; - - struct PipelineCreationFeedback - { - using NativeType = VkPipelineCreationFeedback; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCreationFeedback( VULKAN_HPP_NAMESPACE::PipelineCreationFeedbackFlags flags_ = {}, - uint64_t duration_ = {} ) VULKAN_HPP_NOEXCEPT - : flags( flags_ ) - , duration( duration_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCreationFeedback( PipelineCreationFeedback const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCreationFeedback( VkPipelineCreationFeedback const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCreationFeedback( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCreationFeedback & operator=( PipelineCreationFeedback const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCreationFeedback & operator=( VkPipelineCreationFeedback const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPipelineCreationFeedback const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCreationFeedback &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( flags, duration ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCreationFeedback const & ) const = default; -#else - bool operator==( PipelineCreationFeedback const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( flags == rhs.flags ) && ( duration == rhs.duration ); -# endif - } - - bool operator!=( PipelineCreationFeedback const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::PipelineCreationFeedbackFlags flags = {}; - uint64_t duration = {}; - }; - using PipelineCreationFeedbackEXT = PipelineCreationFeedback; - - struct PipelineCreationFeedbackCreateInfo - { - using NativeType = VkPipelineCreationFeedbackCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineCreationFeedbackCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackCreateInfo( VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineCreationFeedback_ = {}, - uint32_t pipelineStageCreationFeedbackCount_ = {}, - VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineStageCreationFeedbacks_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pPipelineCreationFeedback( pPipelineCreationFeedback_ ) - , pipelineStageCreationFeedbackCount( pipelineStageCreationFeedbackCount_ ) - , pPipelineStageCreationFeedbacks( pPipelineStageCreationFeedbacks_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineCreationFeedbackCreateInfo( PipelineCreationFeedbackCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCreationFeedbackCreateInfo( VkPipelineCreationFeedbackCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineCreationFeedbackCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineCreationFeedbackCreateInfo( - VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineCreationFeedback_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pipelineStageCreationFeedbacks_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pPipelineCreationFeedback( pPipelineCreationFeedback_ ) - , pipelineStageCreationFeedbackCount( static_cast( pipelineStageCreationFeedbacks_.size() ) ) - , pPipelineStageCreationFeedbacks( pipelineStageCreationFeedbacks_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineCreationFeedbackCreateInfo & operator=( PipelineCreationFeedbackCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineCreationFeedbackCreateInfo & operator=( VkPipelineCreationFeedbackCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineCreationFeedbackCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCreationFeedbackCreateInfo & - setPPipelineCreationFeedback( VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineCreationFeedback_ ) VULKAN_HPP_NOEXCEPT - { - pPipelineCreationFeedback = pPipelineCreationFeedback_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCreationFeedbackCreateInfo & - setPipelineStageCreationFeedbackCount( uint32_t pipelineStageCreationFeedbackCount_ ) VULKAN_HPP_NOEXCEPT - { - pipelineStageCreationFeedbackCount = pipelineStageCreationFeedbackCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineCreationFeedbackCreateInfo & - setPPipelineStageCreationFeedbacks( VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineStageCreationFeedbacks_ ) VULKAN_HPP_NOEXCEPT - { - pPipelineStageCreationFeedbacks = pPipelineStageCreationFeedbacks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineCreationFeedbackCreateInfo & setPipelineStageCreationFeedbacks( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pipelineStageCreationFeedbacks_ ) - VULKAN_HPP_NOEXCEPT - { - pipelineStageCreationFeedbackCount = static_cast( pipelineStageCreationFeedbacks_.size() ); - pPipelineStageCreationFeedbacks = pipelineStageCreationFeedbacks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineCreationFeedbackCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineCreationFeedbackCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pPipelineCreationFeedback, pipelineStageCreationFeedbackCount, pPipelineStageCreationFeedbacks ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineCreationFeedbackCreateInfo const & ) const = default; -#else - bool operator==( PipelineCreationFeedbackCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pPipelineCreationFeedback == rhs.pPipelineCreationFeedback ) && - ( pipelineStageCreationFeedbackCount == rhs.pipelineStageCreationFeedbackCount ) && - ( pPipelineStageCreationFeedbacks == rhs.pPipelineStageCreationFeedbacks ); -# endif - } - - bool operator!=( PipelineCreationFeedbackCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineCreationFeedbackCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineCreationFeedback = {}; - uint32_t pipelineStageCreationFeedbackCount = {}; - VULKAN_HPP_NAMESPACE::PipelineCreationFeedback * pPipelineStageCreationFeedbacks = {}; - }; - - template <> - struct CppType - { - using Type = PipelineCreationFeedbackCreateInfo; - }; - using PipelineCreationFeedbackCreateInfoEXT = PipelineCreationFeedbackCreateInfo; - - struct PipelineDiscardRectangleStateCreateInfoEXT - { - using NativeType = VkPipelineDiscardRectangleStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineDiscardRectangleStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineDiscardRectangleStateCreateInfoEXT( - VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT discardRectangleMode_ = VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT::eInclusive, - uint32_t discardRectangleCount_ = {}, - const VULKAN_HPP_NAMESPACE::Rect2D * pDiscardRectangles_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , discardRectangleMode( discardRectangleMode_ ) - , discardRectangleCount( discardRectangleCount_ ) - , pDiscardRectangles( pDiscardRectangles_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineDiscardRectangleStateCreateInfoEXT( PipelineDiscardRectangleStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDiscardRectangleStateCreateInfoEXT( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineDiscardRectangleStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineDiscardRectangleStateCreateInfoEXT( VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateFlagsEXT flags_, - VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT discardRectangleMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & discardRectangles_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , discardRectangleMode( discardRectangleMode_ ) - , discardRectangleCount( static_cast( discardRectangles_.size() ) ) - , pDiscardRectangles( discardRectangles_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineDiscardRectangleStateCreateInfoEXT & operator=( PipelineDiscardRectangleStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineDiscardRectangleStateCreateInfoEXT & operator=( VkPipelineDiscardRectangleStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineDiscardRectangleStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDiscardRectangleStateCreateInfoEXT & - setFlags( VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDiscardRectangleStateCreateInfoEXT & - setDiscardRectangleMode( VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT discardRectangleMode_ ) VULKAN_HPP_NOEXCEPT - { - discardRectangleMode = discardRectangleMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDiscardRectangleStateCreateInfoEXT & setDiscardRectangleCount( uint32_t discardRectangleCount_ ) VULKAN_HPP_NOEXCEPT - { - discardRectangleCount = discardRectangleCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineDiscardRectangleStateCreateInfoEXT & - setPDiscardRectangles( const VULKAN_HPP_NAMESPACE::Rect2D * pDiscardRectangles_ ) VULKAN_HPP_NOEXCEPT - { - pDiscardRectangles = pDiscardRectangles_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineDiscardRectangleStateCreateInfoEXT & - setDiscardRectangles( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & discardRectangles_ ) VULKAN_HPP_NOEXCEPT - { - discardRectangleCount = static_cast( discardRectangles_.size() ); - pDiscardRectangles = discardRectangles_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineDiscardRectangleStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineDiscardRectangleStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, discardRectangleMode, discardRectangleCount, pDiscardRectangles ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineDiscardRectangleStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineDiscardRectangleStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( discardRectangleMode == rhs.discardRectangleMode ) && - ( discardRectangleCount == rhs.discardRectangleCount ) && ( pDiscardRectangles == rhs.pDiscardRectangles ); -# endif - } - - bool operator!=( PipelineDiscardRectangleStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineDiscardRectangleStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineDiscardRectangleStateCreateFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT discardRectangleMode = VULKAN_HPP_NAMESPACE::DiscardRectangleModeEXT::eInclusive; - uint32_t discardRectangleCount = {}; - const VULKAN_HPP_NAMESPACE::Rect2D * pDiscardRectangles = {}; - }; - - template <> - struct CppType - { - using Type = PipelineDiscardRectangleStateCreateInfoEXT; - }; - - struct PipelineExecutableInfoKHR - { - using NativeType = VkPipelineExecutableInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineExecutableInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineExecutableInfoKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ = {}, - uint32_t executableIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipeline( pipeline_ ) - , executableIndex( executableIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineExecutableInfoKHR( PipelineExecutableInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableInfoKHR( VkPipelineExecutableInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineExecutableInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineExecutableInfoKHR & operator=( PipelineExecutableInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableInfoKHR & operator=( VkPipelineExecutableInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableInfoKHR & setPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ ) VULKAN_HPP_NOEXCEPT - { - pipeline = pipeline_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableInfoKHR & setExecutableIndex( uint32_t executableIndex_ ) VULKAN_HPP_NOEXCEPT - { - executableIndex = executableIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineExecutableInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineExecutableInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipeline, executableIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineExecutableInfoKHR const & ) const = default; -#else - bool operator==( PipelineExecutableInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipeline == rhs.pipeline ) && ( executableIndex == rhs.executableIndex ); -# endif - } - - bool operator!=( PipelineExecutableInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineExecutableInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Pipeline pipeline = {}; - uint32_t executableIndex = {}; - }; - - template <> - struct CppType - { - using Type = PipelineExecutableInfoKHR; - }; - - struct PipelineExecutableInternalRepresentationKHR - { - using NativeType = VkPipelineExecutableInternalRepresentationKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineExecutableInternalRepresentationKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableInternalRepresentationKHR( std::array const & name_ = {}, - std::array const & description_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 isText_ = {}, - size_t dataSize_ = {}, - void * pData_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , name( name_ ) - , description( description_ ) - , isText( isText_ ) - , dataSize( dataSize_ ) - , pData( pData_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - PipelineExecutableInternalRepresentationKHR( PipelineExecutableInternalRepresentationKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableInternalRepresentationKHR( VkPipelineExecutableInternalRepresentationKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineExecutableInternalRepresentationKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - PipelineExecutableInternalRepresentationKHR( std::array const & name_, - std::array const & description_, - VULKAN_HPP_NAMESPACE::Bool32 isText_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_, - void * pNext_ = nullptr ) - : pNext( pNext_ ), name( name_ ), description( description_ ), isText( isText_ ), dataSize( data_.size() * sizeof( T ) ), pData( data_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineExecutableInternalRepresentationKHR & operator=( PipelineExecutableInternalRepresentationKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableInternalRepresentationKHR & operator=( VkPipelineExecutableInternalRepresentationKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPipelineExecutableInternalRepresentationKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineExecutableInternalRepresentationKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::Bool32 const &, - size_t const &, - void * const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, name, description, isText, dataSize, pData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineExecutableInternalRepresentationKHR const & ) const = default; -#else - bool operator==( PipelineExecutableInternalRepresentationKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( name == rhs.name ) && ( description == rhs.description ) && ( isText == rhs.isText ) && - ( dataSize == rhs.dataSize ) && ( pData == rhs.pData ); -# endif - } - - bool operator!=( PipelineExecutableInternalRepresentationKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineExecutableInternalRepresentationKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D name = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - VULKAN_HPP_NAMESPACE::Bool32 isText = {}; - size_t dataSize = {}; - void * pData = {}; - }; - - template <> - struct CppType - { - using Type = PipelineExecutableInternalRepresentationKHR; - }; - - struct PipelineExecutablePropertiesKHR - { - using NativeType = VkPipelineExecutablePropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineExecutablePropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineExecutablePropertiesKHR( VULKAN_HPP_NAMESPACE::ShaderStageFlags stages_ = {}, - std::array const & name_ = {}, - std::array const & description_ = {}, - uint32_t subgroupSize_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stages( stages_ ) - , name( name_ ) - , description( description_ ) - , subgroupSize( subgroupSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutablePropertiesKHR( PipelineExecutablePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutablePropertiesKHR( VkPipelineExecutablePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineExecutablePropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineExecutablePropertiesKHR & operator=( PipelineExecutablePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutablePropertiesKHR & operator=( VkPipelineExecutablePropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPipelineExecutablePropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineExecutablePropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - uint32_t const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stages, name, description, subgroupSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineExecutablePropertiesKHR const & ) const = default; -#else - bool operator==( PipelineExecutablePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( stages == rhs.stages ) && ( name == rhs.name ) && ( description == rhs.description ) && - ( subgroupSize == rhs.subgroupSize ); -# endif - } - - bool operator!=( PipelineExecutablePropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineExecutablePropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ShaderStageFlags stages = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D name = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - uint32_t subgroupSize = {}; - }; - - template <> - struct CppType - { - using Type = PipelineExecutablePropertiesKHR; - }; - - union PipelineExecutableStatisticValueKHR - { - using NativeType = VkPipelineExecutableStatisticValueKHR; -#if !defined( VULKAN_HPP_NO_UNION_CONSTRUCTORS ) - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR( VULKAN_HPP_NAMESPACE::Bool32 b32_ = {} ) : b32( b32_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR( int64_t i64_ ) : i64( i64_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR( uint64_t u64_ ) : u64( u64_ ) {} - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR( double f64_ ) : f64( f64_ ) {} -#endif /*VULKAN_HPP_NO_UNION_CONSTRUCTORS*/ - -#if !defined( VULKAN_HPP_NO_UNION_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR & setB32( VULKAN_HPP_NAMESPACE::Bool32 b32_ ) VULKAN_HPP_NOEXCEPT - { - b32 = b32_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR & setI64( int64_t i64_ ) VULKAN_HPP_NOEXCEPT - { - i64 = i64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR & setU64( uint64_t u64_ ) VULKAN_HPP_NOEXCEPT - { - u64 = u64_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticValueKHR & setF64( double f64_ ) VULKAN_HPP_NOEXCEPT - { - f64 = f64_; - return *this; - } -#endif /*VULKAN_HPP_NO_UNION_SETTERS*/ - - operator VkPipelineExecutableStatisticValueKHR const &() const - { - return *reinterpret_cast( this ); - } - - operator VkPipelineExecutableStatisticValueKHR &() - { - return *reinterpret_cast( this ); - } - -#ifdef VULKAN_HPP_HAS_UNRESTRICTED_UNIONS - VULKAN_HPP_NAMESPACE::Bool32 b32; - int64_t i64; - uint64_t u64; - double f64; -#else - VkBool32 b32; - int64_t i64; - uint64_t u64; - double f64; -#endif /*VULKAN_HPP_HAS_UNRESTRICTED_UNIONS*/ - }; - - struct PipelineExecutableStatisticKHR - { - using NativeType = VkPipelineExecutableStatisticKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineExecutableStatisticKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticKHR( - std::array const & name_ = {}, - std::array const & description_ = {}, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticFormatKHR format_ = VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticFormatKHR::eBool32, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticValueKHR value_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , name( name_ ) - , description( description_ ) - , format( format_ ) - , value( value_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PipelineExecutableStatisticKHR( PipelineExecutableStatisticKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableStatisticKHR( VkPipelineExecutableStatisticKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineExecutableStatisticKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineExecutableStatisticKHR & operator=( PipelineExecutableStatisticKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineExecutableStatisticKHR & operator=( VkPipelineExecutableStatisticKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPipelineExecutableStatisticKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineExecutableStatisticKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &, - VULKAN_HPP_NAMESPACE::ArrayWrapper1D const &, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticFormatKHR const &, - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticValueKHR const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, name, description, format, value ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineExecutableStatisticKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D name = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticFormatKHR format = VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticFormatKHR::eBool32; - VULKAN_HPP_NAMESPACE::PipelineExecutableStatisticValueKHR value = {}; - }; - - template <> - struct CppType - { - using Type = PipelineExecutableStatisticKHR; - }; - - struct PipelineFragmentShadingRateEnumStateCreateInfoNV - { - using NativeType = VkPipelineFragmentShadingRateEnumStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineFragmentShadingRateEnumStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateEnumStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::FragmentShadingRateTypeNV shadingRateType_ = VULKAN_HPP_NAMESPACE::FragmentShadingRateTypeNV::eFragmentSize, - VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate_ = VULKAN_HPP_NAMESPACE::FragmentShadingRateNV::e1InvocationPerPixel, - std::array const & - combinerOps_ = { { VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR::eKeep, VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR::eKeep } }, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shadingRateType( shadingRateType_ ) - , shadingRate( shadingRate_ ) - , combinerOps( combinerOps_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - PipelineFragmentShadingRateEnumStateCreateInfoNV( PipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineFragmentShadingRateEnumStateCreateInfoNV( VkPipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineFragmentShadingRateEnumStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineFragmentShadingRateEnumStateCreateInfoNV & operator=( PipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineFragmentShadingRateEnumStateCreateInfoNV & operator=( VkPipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateEnumStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateEnumStateCreateInfoNV & - setShadingRateType( VULKAN_HPP_NAMESPACE::FragmentShadingRateTypeNV shadingRateType_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateType = shadingRateType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateEnumStateCreateInfoNV & - setShadingRate( VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate_ ) VULKAN_HPP_NOEXCEPT - { - shadingRate = shadingRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateEnumStateCreateInfoNV & - setCombinerOps( std::array combinerOps_ ) VULKAN_HPP_NOEXCEPT - { - combinerOps = combinerOps_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineFragmentShadingRateEnumStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineFragmentShadingRateEnumStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shadingRateType, shadingRate, combinerOps ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineFragmentShadingRateEnumStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shadingRateType == rhs.shadingRateType ) && ( shadingRate == rhs.shadingRate ) && - ( combinerOps == rhs.combinerOps ); -# endif - } - - bool operator!=( PipelineFragmentShadingRateEnumStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineFragmentShadingRateEnumStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::FragmentShadingRateTypeNV shadingRateType = VULKAN_HPP_NAMESPACE::FragmentShadingRateTypeNV::eFragmentSize; - VULKAN_HPP_NAMESPACE::FragmentShadingRateNV shadingRate = VULKAN_HPP_NAMESPACE::FragmentShadingRateNV::e1InvocationPerPixel; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D combinerOps = {}; - }; - - template <> - struct CppType - { - using Type = PipelineFragmentShadingRateEnumStateCreateInfoNV; - }; - - struct PipelineFragmentShadingRateStateCreateInfoKHR - { - using NativeType = VkPipelineFragmentShadingRateStateCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineFragmentShadingRateStateCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateStateCreateInfoKHR( - VULKAN_HPP_NAMESPACE::Extent2D fragmentSize_ = {}, - std::array const & - combinerOps_ = { { VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR::eKeep, VULKAN_HPP_NAMESPACE::FragmentShadingRateCombinerOpKHR::eKeep } }, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentSize( fragmentSize_ ) - , combinerOps( combinerOps_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 - PipelineFragmentShadingRateStateCreateInfoKHR( PipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineFragmentShadingRateStateCreateInfoKHR( VkPipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineFragmentShadingRateStateCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineFragmentShadingRateStateCreateInfoKHR & operator=( PipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineFragmentShadingRateStateCreateInfoKHR & operator=( VkPipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateStateCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateStateCreateInfoKHR & - setFragmentSize( VULKAN_HPP_NAMESPACE::Extent2D const & fragmentSize_ ) VULKAN_HPP_NOEXCEPT - { - fragmentSize = fragmentSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineFragmentShadingRateStateCreateInfoKHR & - setCombinerOps( std::array combinerOps_ ) VULKAN_HPP_NOEXCEPT - { - combinerOps = combinerOps_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineFragmentShadingRateStateCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineFragmentShadingRateStateCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentSize, combinerOps ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineFragmentShadingRateStateCreateInfoKHR const & ) const = default; -#else - bool operator==( PipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentSize == rhs.fragmentSize ) && ( combinerOps == rhs.combinerOps ); -# endif - } - - bool operator!=( PipelineFragmentShadingRateStateCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineFragmentShadingRateStateCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent2D fragmentSize = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D combinerOps = {}; - }; - - template <> - struct CppType - { - using Type = PipelineFragmentShadingRateStateCreateInfoKHR; - }; - - struct PipelineInfoKHR - { - using NativeType = VkPipelineInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineInfoKHR( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipeline( pipeline_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineInfoKHR( PipelineInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineInfoKHR( VkPipelineInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : PipelineInfoKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineInfoKHR & operator=( PipelineInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineInfoKHR & operator=( VkPipelineInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineInfoKHR & setPipeline( VULKAN_HPP_NAMESPACE::Pipeline pipeline_ ) VULKAN_HPP_NOEXCEPT - { - pipeline = pipeline_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipeline ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineInfoKHR const & ) const = default; -#else - bool operator==( PipelineInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipeline == rhs.pipeline ); -# endif - } - - bool operator!=( PipelineInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Pipeline pipeline = {}; - }; - - template <> - struct CppType - { - using Type = PipelineInfoKHR; - }; - using PipelineInfoEXT = PipelineInfoKHR; - - struct PushConstantRange - { - using NativeType = VkPushConstantRange; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PushConstantRange( VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags_ = {}, uint32_t offset_ = {}, uint32_t size_ = {} ) VULKAN_HPP_NOEXCEPT - : stageFlags( stageFlags_ ) - , offset( offset_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR PushConstantRange( PushConstantRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PushConstantRange( VkPushConstantRange const & rhs ) VULKAN_HPP_NOEXCEPT : PushConstantRange( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PushConstantRange & operator=( PushConstantRange const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PushConstantRange & operator=( VkPushConstantRange const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PushConstantRange & setStageFlags( VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags_ ) VULKAN_HPP_NOEXCEPT - { - stageFlags = stageFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PushConstantRange & setOffset( uint32_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PushConstantRange & setSize( uint32_t size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPushConstantRange const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPushConstantRange &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( stageFlags, offset, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PushConstantRange const & ) const = default; -#else - bool operator==( PushConstantRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( stageFlags == rhs.stageFlags ) && ( offset == rhs.offset ) && ( size == rhs.size ); -# endif - } - - bool operator!=( PushConstantRange const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ShaderStageFlags stageFlags = {}; - uint32_t offset = {}; - uint32_t size = {}; - }; - - struct PipelineLayoutCreateInfo - { - using NativeType = VkPipelineLayoutCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineLayoutCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineLayoutCreateInfo( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags flags_ = {}, - uint32_t setLayoutCount_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts_ = {}, - uint32_t pushConstantRangeCount_ = {}, - const VULKAN_HPP_NAMESPACE::PushConstantRange * pPushConstantRanges_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , setLayoutCount( setLayoutCount_ ) - , pSetLayouts( pSetLayouts_ ) - , pushConstantRangeCount( pushConstantRangeCount_ ) - , pPushConstantRanges( pPushConstantRanges_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineLayoutCreateInfo( PipelineLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineLayoutCreateInfo( VkPipelineLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineLayoutCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineLayoutCreateInfo( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & setLayouts_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pushConstantRanges_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , setLayoutCount( static_cast( setLayouts_.size() ) ) - , pSetLayouts( setLayouts_.data() ) - , pushConstantRangeCount( static_cast( pushConstantRanges_.size() ) ) - , pPushConstantRanges( pushConstantRanges_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineLayoutCreateInfo & operator=( PipelineLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineLayoutCreateInfo & operator=( VkPipelineLayoutCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & setSetLayoutCount( uint32_t setLayoutCount_ ) VULKAN_HPP_NOEXCEPT - { - setLayoutCount = setLayoutCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & setPSetLayouts( const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts_ ) VULKAN_HPP_NOEXCEPT - { - pSetLayouts = pSetLayouts_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineLayoutCreateInfo & - setSetLayouts( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & setLayouts_ ) VULKAN_HPP_NOEXCEPT - { - setLayoutCount = static_cast( setLayouts_.size() ); - pSetLayouts = setLayouts_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & setPushConstantRangeCount( uint32_t pushConstantRangeCount_ ) VULKAN_HPP_NOEXCEPT - { - pushConstantRangeCount = pushConstantRangeCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLayoutCreateInfo & - setPPushConstantRanges( const VULKAN_HPP_NAMESPACE::PushConstantRange * pPushConstantRanges_ ) VULKAN_HPP_NOEXCEPT - { - pPushConstantRanges = pPushConstantRanges_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineLayoutCreateInfo & setPushConstantRanges( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & pushConstantRanges_ ) VULKAN_HPP_NOEXCEPT - { - pushConstantRangeCount = static_cast( pushConstantRanges_.size() ); - pPushConstantRanges = pushConstantRanges_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineLayoutCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineLayoutCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, setLayoutCount, pSetLayouts, pushConstantRangeCount, pPushConstantRanges ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineLayoutCreateInfo const & ) const = default; -#else - bool operator==( PipelineLayoutCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( setLayoutCount == rhs.setLayoutCount ) && - ( pSetLayouts == rhs.pSetLayouts ) && ( pushConstantRangeCount == rhs.pushConstantRangeCount ) && - ( pPushConstantRanges == rhs.pPushConstantRanges ); -# endif - } - - bool operator!=( PipelineLayoutCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineLayoutCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineLayoutCreateFlags flags = {}; - uint32_t setLayoutCount = {}; - const VULKAN_HPP_NAMESPACE::DescriptorSetLayout * pSetLayouts = {}; - uint32_t pushConstantRangeCount = {}; - const VULKAN_HPP_NAMESPACE::PushConstantRange * pPushConstantRanges = {}; - }; - - template <> - struct CppType - { - using Type = PipelineLayoutCreateInfo; - }; - - struct PipelineLibraryCreateInfoKHR - { - using NativeType = VkPipelineLibraryCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineLibraryCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineLibraryCreateInfoKHR( uint32_t libraryCount_ = {}, - const VULKAN_HPP_NAMESPACE::Pipeline * pLibraries_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , libraryCount( libraryCount_ ) - , pLibraries( pLibraries_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineLibraryCreateInfoKHR( PipelineLibraryCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineLibraryCreateInfoKHR( VkPipelineLibraryCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineLibraryCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineLibraryCreateInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & libraries_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), libraryCount( static_cast( libraries_.size() ) ), pLibraries( libraries_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineLibraryCreateInfoKHR & operator=( PipelineLibraryCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineLibraryCreateInfoKHR & operator=( VkPipelineLibraryCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineLibraryCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLibraryCreateInfoKHR & setLibraryCount( uint32_t libraryCount_ ) VULKAN_HPP_NOEXCEPT - { - libraryCount = libraryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineLibraryCreateInfoKHR & setPLibraries( const VULKAN_HPP_NAMESPACE::Pipeline * pLibraries_ ) VULKAN_HPP_NOEXCEPT - { - pLibraries = pLibraries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineLibraryCreateInfoKHR & - setLibraries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & libraries_ ) VULKAN_HPP_NOEXCEPT - { - libraryCount = static_cast( libraries_.size() ); - pLibraries = libraries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineLibraryCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineLibraryCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, libraryCount, pLibraries ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineLibraryCreateInfoKHR const & ) const = default; -#else - bool operator==( PipelineLibraryCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( libraryCount == rhs.libraryCount ) && ( pLibraries == rhs.pLibraries ); -# endif - } - - bool operator!=( PipelineLibraryCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineLibraryCreateInfoKHR; - const void * pNext = {}; - uint32_t libraryCount = {}; - const VULKAN_HPP_NAMESPACE::Pipeline * pLibraries = {}; - }; - - template <> - struct CppType - { - using Type = PipelineLibraryCreateInfoKHR; - }; - - struct PipelinePropertiesIdentifierEXT - { - using NativeType = VkPipelinePropertiesIdentifierEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelinePropertiesIdentifierEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 PipelinePropertiesIdentifierEXT( std::array const & pipelineIdentifier_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pipelineIdentifier( pipelineIdentifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 PipelinePropertiesIdentifierEXT( PipelinePropertiesIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelinePropertiesIdentifierEXT( VkPipelinePropertiesIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelinePropertiesIdentifierEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelinePropertiesIdentifierEXT & operator=( PipelinePropertiesIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelinePropertiesIdentifierEXT & operator=( VkPipelinePropertiesIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelinePropertiesIdentifierEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelinePropertiesIdentifierEXT & setPipelineIdentifier( std::array pipelineIdentifier_ ) VULKAN_HPP_NOEXCEPT - { - pipelineIdentifier = pipelineIdentifier_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelinePropertiesIdentifierEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelinePropertiesIdentifierEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pipelineIdentifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelinePropertiesIdentifierEXT const & ) const = default; -#else - bool operator==( PipelinePropertiesIdentifierEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pipelineIdentifier == rhs.pipelineIdentifier ); -# endif - } - - bool operator!=( PipelinePropertiesIdentifierEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelinePropertiesIdentifierEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D pipelineIdentifier = {}; - }; - - template <> - struct CppType - { - using Type = PipelinePropertiesIdentifierEXT; - }; - - struct PipelineRasterizationConservativeStateCreateInfoEXT - { - using NativeType = VkPipelineRasterizationConservativeStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationConservativeStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationConservativeStateCreateInfoEXT( - VULKAN_HPP_NAMESPACE::PipelineRasterizationConservativeStateCreateFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::ConservativeRasterizationModeEXT conservativeRasterizationMode_ = VULKAN_HPP_NAMESPACE::ConservativeRasterizationModeEXT::eDisabled, - float extraPrimitiveOverestimationSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , conservativeRasterizationMode( conservativeRasterizationMode_ ) - , extraPrimitiveOverestimationSize( extraPrimitiveOverestimationSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineRasterizationConservativeStateCreateInfoEXT( PipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationConservativeStateCreateInfoEXT( VkPipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationConservativeStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationConservativeStateCreateInfoEXT & - operator=( PipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationConservativeStateCreateInfoEXT & operator=( VkPipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationConservativeStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationConservativeStateCreateInfoEXT & - setFlags( VULKAN_HPP_NAMESPACE::PipelineRasterizationConservativeStateCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationConservativeStateCreateInfoEXT & - setConservativeRasterizationMode( VULKAN_HPP_NAMESPACE::ConservativeRasterizationModeEXT conservativeRasterizationMode_ ) VULKAN_HPP_NOEXCEPT - { - conservativeRasterizationMode = conservativeRasterizationMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationConservativeStateCreateInfoEXT & - setExtraPrimitiveOverestimationSize( float extraPrimitiveOverestimationSize_ ) VULKAN_HPP_NOEXCEPT - { - extraPrimitiveOverestimationSize = extraPrimitiveOverestimationSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationConservativeStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationConservativeStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, conservativeRasterizationMode, extraPrimitiveOverestimationSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationConservativeStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( conservativeRasterizationMode == rhs.conservativeRasterizationMode ) && - ( extraPrimitiveOverestimationSize == rhs.extraPrimitiveOverestimationSize ); -# endif - } - - bool operator!=( PipelineRasterizationConservativeStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationConservativeStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRasterizationConservativeStateCreateFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::ConservativeRasterizationModeEXT conservativeRasterizationMode = VULKAN_HPP_NAMESPACE::ConservativeRasterizationModeEXT::eDisabled; - float extraPrimitiveOverestimationSize = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationConservativeStateCreateInfoEXT; - }; - - struct PipelineRasterizationDepthClipStateCreateInfoEXT - { - using NativeType = VkPipelineRasterizationDepthClipStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationDepthClipStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationDepthClipStateCreateInfoEXT( VULKAN_HPP_NAMESPACE::PipelineRasterizationDepthClipStateCreateFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , depthClipEnable( depthClipEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineRasterizationDepthClipStateCreateInfoEXT( PipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationDepthClipStateCreateInfoEXT( VkPipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationDepthClipStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationDepthClipStateCreateInfoEXT & operator=( PipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationDepthClipStateCreateInfoEXT & operator=( VkPipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationDepthClipStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationDepthClipStateCreateInfoEXT & - setFlags( VULKAN_HPP_NAMESPACE::PipelineRasterizationDepthClipStateCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationDepthClipStateCreateInfoEXT & - setDepthClipEnable( VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable_ ) VULKAN_HPP_NOEXCEPT - { - depthClipEnable = depthClipEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationDepthClipStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationDepthClipStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, depthClipEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationDepthClipStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( depthClipEnable == rhs.depthClipEnable ); -# endif - } - - bool operator!=( PipelineRasterizationDepthClipStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationDepthClipStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRasterizationDepthClipStateCreateFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::Bool32 depthClipEnable = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationDepthClipStateCreateInfoEXT; - }; - - struct PipelineRasterizationLineStateCreateInfoEXT - { - using NativeType = VkPipelineRasterizationLineStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationLineStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationLineStateCreateInfoEXT( - VULKAN_HPP_NAMESPACE::LineRasterizationModeEXT lineRasterizationMode_ = VULKAN_HPP_NAMESPACE::LineRasterizationModeEXT::eDefault, - VULKAN_HPP_NAMESPACE::Bool32 stippledLineEnable_ = {}, - uint32_t lineStippleFactor_ = {}, - uint16_t lineStipplePattern_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , lineRasterizationMode( lineRasterizationMode_ ) - , stippledLineEnable( stippledLineEnable_ ) - , lineStippleFactor( lineStippleFactor_ ) - , lineStipplePattern( lineStipplePattern_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineRasterizationLineStateCreateInfoEXT( PipelineRasterizationLineStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationLineStateCreateInfoEXT( VkPipelineRasterizationLineStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationLineStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationLineStateCreateInfoEXT & operator=( PipelineRasterizationLineStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationLineStateCreateInfoEXT & operator=( VkPipelineRasterizationLineStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationLineStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationLineStateCreateInfoEXT & - setLineRasterizationMode( VULKAN_HPP_NAMESPACE::LineRasterizationModeEXT lineRasterizationMode_ ) VULKAN_HPP_NOEXCEPT - { - lineRasterizationMode = lineRasterizationMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationLineStateCreateInfoEXT & - setStippledLineEnable( VULKAN_HPP_NAMESPACE::Bool32 stippledLineEnable_ ) VULKAN_HPP_NOEXCEPT - { - stippledLineEnable = stippledLineEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationLineStateCreateInfoEXT & setLineStippleFactor( uint32_t lineStippleFactor_ ) VULKAN_HPP_NOEXCEPT - { - lineStippleFactor = lineStippleFactor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationLineStateCreateInfoEXT & setLineStipplePattern( uint16_t lineStipplePattern_ ) VULKAN_HPP_NOEXCEPT - { - lineStipplePattern = lineStipplePattern_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationLineStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationLineStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, lineRasterizationMode, stippledLineEnable, lineStippleFactor, lineStipplePattern ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationLineStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRasterizationLineStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( lineRasterizationMode == rhs.lineRasterizationMode ) && - ( stippledLineEnable == rhs.stippledLineEnable ) && ( lineStippleFactor == rhs.lineStippleFactor ) && - ( lineStipplePattern == rhs.lineStipplePattern ); -# endif - } - - bool operator!=( PipelineRasterizationLineStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationLineStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::LineRasterizationModeEXT lineRasterizationMode = VULKAN_HPP_NAMESPACE::LineRasterizationModeEXT::eDefault; - VULKAN_HPP_NAMESPACE::Bool32 stippledLineEnable = {}; - uint32_t lineStippleFactor = {}; - uint16_t lineStipplePattern = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationLineStateCreateInfoEXT; - }; - - struct PipelineRasterizationProvokingVertexStateCreateInfoEXT - { - using NativeType = VkPipelineRasterizationProvokingVertexStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationProvokingVertexStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationProvokingVertexStateCreateInfoEXT( - VULKAN_HPP_NAMESPACE::ProvokingVertexModeEXT provokingVertexMode_ = VULKAN_HPP_NAMESPACE::ProvokingVertexModeEXT::eFirstVertex, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , provokingVertexMode( provokingVertexMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineRasterizationProvokingVertexStateCreateInfoEXT( PipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) - VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationProvokingVertexStateCreateInfoEXT( VkPipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationProvokingVertexStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationProvokingVertexStateCreateInfoEXT & - operator=( PipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationProvokingVertexStateCreateInfoEXT & - operator=( VkPipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationProvokingVertexStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationProvokingVertexStateCreateInfoEXT & - setProvokingVertexMode( VULKAN_HPP_NAMESPACE::ProvokingVertexModeEXT provokingVertexMode_ ) VULKAN_HPP_NOEXCEPT - { - provokingVertexMode = provokingVertexMode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationProvokingVertexStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationProvokingVertexStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, provokingVertexMode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationProvokingVertexStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( provokingVertexMode == rhs.provokingVertexMode ); -# endif - } - - bool operator!=( PipelineRasterizationProvokingVertexStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationProvokingVertexStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ProvokingVertexModeEXT provokingVertexMode = VULKAN_HPP_NAMESPACE::ProvokingVertexModeEXT::eFirstVertex; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationProvokingVertexStateCreateInfoEXT; - }; - - struct PipelineRasterizationStateRasterizationOrderAMD - { - using NativeType = VkPipelineRasterizationStateRasterizationOrderAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationStateRasterizationOrderAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationStateRasterizationOrderAMD( - VULKAN_HPP_NAMESPACE::RasterizationOrderAMD rasterizationOrder_ = VULKAN_HPP_NAMESPACE::RasterizationOrderAMD::eStrict, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , rasterizationOrder( rasterizationOrder_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineRasterizationStateRasterizationOrderAMD( PipelineRasterizationStateRasterizationOrderAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateRasterizationOrderAMD( VkPipelineRasterizationStateRasterizationOrderAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationStateRasterizationOrderAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationStateRasterizationOrderAMD & operator=( PipelineRasterizationStateRasterizationOrderAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateRasterizationOrderAMD & operator=( VkPipelineRasterizationStateRasterizationOrderAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateRasterizationOrderAMD & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateRasterizationOrderAMD & - setRasterizationOrder( VULKAN_HPP_NAMESPACE::RasterizationOrderAMD rasterizationOrder_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationOrder = rasterizationOrder_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationStateRasterizationOrderAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationStateRasterizationOrderAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, rasterizationOrder ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationStateRasterizationOrderAMD const & ) const = default; -#else - bool operator==( PipelineRasterizationStateRasterizationOrderAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( rasterizationOrder == rhs.rasterizationOrder ); -# endif - } - - bool operator!=( PipelineRasterizationStateRasterizationOrderAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationStateRasterizationOrderAMD; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RasterizationOrderAMD rasterizationOrder = VULKAN_HPP_NAMESPACE::RasterizationOrderAMD::eStrict; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationStateRasterizationOrderAMD; - }; - - struct PipelineRasterizationStateStreamCreateInfoEXT - { - using NativeType = VkPipelineRasterizationStateStreamCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRasterizationStateStreamCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRasterizationStateStreamCreateInfoEXT( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateStreamCreateFlagsEXT flags_ = {}, - uint32_t rasterizationStream_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , rasterizationStream( rasterizationStream_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineRasterizationStateStreamCreateInfoEXT( PipelineRasterizationStateStreamCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateStreamCreateInfoEXT( VkPipelineRasterizationStateStreamCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRasterizationStateStreamCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRasterizationStateStreamCreateInfoEXT & operator=( PipelineRasterizationStateStreamCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRasterizationStateStreamCreateInfoEXT & operator=( VkPipelineRasterizationStateStreamCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateStreamCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateStreamCreateInfoEXT & - setFlags( VULKAN_HPP_NAMESPACE::PipelineRasterizationStateStreamCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRasterizationStateStreamCreateInfoEXT & setRasterizationStream( uint32_t rasterizationStream_ ) VULKAN_HPP_NOEXCEPT - { - rasterizationStream = rasterizationStream_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRasterizationStateStreamCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRasterizationStateStreamCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, rasterizationStream ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRasterizationStateStreamCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRasterizationStateStreamCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( rasterizationStream == rhs.rasterizationStream ); -# endif - } - - bool operator!=( PipelineRasterizationStateStreamCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRasterizationStateStreamCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRasterizationStateStreamCreateFlagsEXT flags = {}; - uint32_t rasterizationStream = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRasterizationStateStreamCreateInfoEXT; - }; - - struct PipelineRenderingCreateInfo - { - using NativeType = VkPipelineRenderingCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRenderingCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRenderingCreateInfo( uint32_t viewMask_ = {}, - uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats_ = {}, - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachmentFormats( pColorAttachmentFormats_ ) - , depthAttachmentFormat( depthAttachmentFormat_ ) - , stencilAttachmentFormat( stencilAttachmentFormat_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineRenderingCreateInfo( PipelineRenderingCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRenderingCreateInfo( VkPipelineRenderingCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRenderingCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineRenderingCreateInfo( uint32_t viewMask_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentFormats_, - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( static_cast( colorAttachmentFormats_.size() ) ) - , pColorAttachmentFormats( colorAttachmentFormats_.data() ) - , depthAttachmentFormat( depthAttachmentFormat_ ) - , stencilAttachmentFormat( stencilAttachmentFormat_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRenderingCreateInfo & operator=( PipelineRenderingCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRenderingCreateInfo & operator=( VkPipelineRenderingCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & setViewMask( uint32_t viewMask_ ) VULKAN_HPP_NOEXCEPT - { - viewMask = viewMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & - setPColorAttachmentFormats( const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachmentFormats = pColorAttachmentFormats_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineRenderingCreateInfo & setColorAttachmentFormats( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachmentFormats_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachmentFormats_.size() ); - pColorAttachmentFormats = colorAttachmentFormats_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & setDepthAttachmentFormat( VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat_ ) VULKAN_HPP_NOEXCEPT - { - depthAttachmentFormat = depthAttachmentFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRenderingCreateInfo & - setStencilAttachmentFormat( VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat_ ) VULKAN_HPP_NOEXCEPT - { - stencilAttachmentFormat = stencilAttachmentFormat_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRenderingCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRenderingCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, viewMask, colorAttachmentCount, pColorAttachmentFormats, depthAttachmentFormat, stencilAttachmentFormat ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRenderingCreateInfo const & ) const = default; -#else - bool operator==( PipelineRenderingCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( viewMask == rhs.viewMask ) && ( colorAttachmentCount == rhs.colorAttachmentCount ) && - ( pColorAttachmentFormats == rhs.pColorAttachmentFormats ) && ( depthAttachmentFormat == rhs.depthAttachmentFormat ) && - ( stencilAttachmentFormat == rhs.stencilAttachmentFormat ); -# endif - } - - bool operator!=( PipelineRenderingCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRenderingCreateInfo; - const void * pNext = {}; - uint32_t viewMask = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::Format * pColorAttachmentFormats = {}; - VULKAN_HPP_NAMESPACE::Format depthAttachmentFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::Format stencilAttachmentFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - }; - - template <> - struct CppType - { - using Type = PipelineRenderingCreateInfo; - }; - using PipelineRenderingCreateInfoKHR = PipelineRenderingCreateInfo; - - struct PipelineRepresentativeFragmentTestStateCreateInfoNV - { - using NativeType = VkPipelineRepresentativeFragmentTestStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRepresentativeFragmentTestStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRepresentativeFragmentTestStateCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTestEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , representativeFragmentTestEnable( representativeFragmentTestEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineRepresentativeFragmentTestStateCreateInfoNV( PipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRepresentativeFragmentTestStateCreateInfoNV( VkPipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRepresentativeFragmentTestStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRepresentativeFragmentTestStateCreateInfoNV & - operator=( PipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRepresentativeFragmentTestStateCreateInfoNV & operator=( VkPipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRepresentativeFragmentTestStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRepresentativeFragmentTestStateCreateInfoNV & - setRepresentativeFragmentTestEnable( VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTestEnable_ ) VULKAN_HPP_NOEXCEPT - { - representativeFragmentTestEnable = representativeFragmentTestEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRepresentativeFragmentTestStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRepresentativeFragmentTestStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, representativeFragmentTestEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRepresentativeFragmentTestStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( representativeFragmentTestEnable == rhs.representativeFragmentTestEnable ); -# endif - } - - bool operator!=( PipelineRepresentativeFragmentTestStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRepresentativeFragmentTestStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 representativeFragmentTestEnable = {}; - }; - - template <> - struct CppType - { - using Type = PipelineRepresentativeFragmentTestStateCreateInfoNV; - }; - - struct PipelineRobustnessCreateInfoEXT - { - using NativeType = VkPipelineRobustnessCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineRobustnessCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineRobustnessCreateInfoEXT( - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT storageBuffers_ = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT uniformBuffers_ = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT vertexInputs_ = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault, - VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT images_ = VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT::eDeviceDefault, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , storageBuffers( storageBuffers_ ) - , uniformBuffers( uniformBuffers_ ) - , vertexInputs( vertexInputs_ ) - , images( images_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineRobustnessCreateInfoEXT( PipelineRobustnessCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRobustnessCreateInfoEXT( VkPipelineRobustnessCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineRobustnessCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineRobustnessCreateInfoEXT & operator=( PipelineRobustnessCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineRobustnessCreateInfoEXT & operator=( VkPipelineRobustnessCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineRobustnessCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRobustnessCreateInfoEXT & - setStorageBuffers( VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT storageBuffers_ ) VULKAN_HPP_NOEXCEPT - { - storageBuffers = storageBuffers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRobustnessCreateInfoEXT & - setUniformBuffers( VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT uniformBuffers_ ) VULKAN_HPP_NOEXCEPT - { - uniformBuffers = uniformBuffers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRobustnessCreateInfoEXT & - setVertexInputs( VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT vertexInputs_ ) VULKAN_HPP_NOEXCEPT - { - vertexInputs = vertexInputs_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineRobustnessCreateInfoEXT & setImages( VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT images_ ) VULKAN_HPP_NOEXCEPT - { - images = images_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineRobustnessCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineRobustnessCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, storageBuffers, uniformBuffers, vertexInputs, images ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineRobustnessCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineRobustnessCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( storageBuffers == rhs.storageBuffers ) && ( uniformBuffers == rhs.uniformBuffers ) && - ( vertexInputs == rhs.vertexInputs ) && ( images == rhs.images ); -# endif - } - - bool operator!=( PipelineRobustnessCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineRobustnessCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT storageBuffers = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT uniformBuffers = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT vertexInputs = VULKAN_HPP_NAMESPACE::PipelineRobustnessBufferBehaviorEXT::eDeviceDefault; - VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT images = VULKAN_HPP_NAMESPACE::PipelineRobustnessImageBehaviorEXT::eDeviceDefault; - }; - - template <> - struct CppType - { - using Type = PipelineRobustnessCreateInfoEXT; - }; - - struct PipelineSampleLocationsStateCreateInfoEXT - { - using NativeType = VkPipelineSampleLocationsStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineSampleLocationsStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineSampleLocationsStateCreateInfoEXT( VULKAN_HPP_NAMESPACE::Bool32 sampleLocationsEnable_ = {}, - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sampleLocationsEnable( sampleLocationsEnable_ ) - , sampleLocationsInfo( sampleLocationsInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineSampleLocationsStateCreateInfoEXT( PipelineSampleLocationsStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineSampleLocationsStateCreateInfoEXT( VkPipelineSampleLocationsStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineSampleLocationsStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineSampleLocationsStateCreateInfoEXT & operator=( PipelineSampleLocationsStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineSampleLocationsStateCreateInfoEXT & operator=( VkPipelineSampleLocationsStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineSampleLocationsStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineSampleLocationsStateCreateInfoEXT & - setSampleLocationsEnable( VULKAN_HPP_NAMESPACE::Bool32 sampleLocationsEnable_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsEnable = sampleLocationsEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineSampleLocationsStateCreateInfoEXT & - setSampleLocationsInfo( VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT const & sampleLocationsInfo_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsInfo = sampleLocationsInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineSampleLocationsStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineSampleLocationsStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, sampleLocationsEnable, sampleLocationsInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineSampleLocationsStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineSampleLocationsStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sampleLocationsEnable == rhs.sampleLocationsEnable ) && - ( sampleLocationsInfo == rhs.sampleLocationsInfo ); -# endif - } - - bool operator!=( PipelineSampleLocationsStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineSampleLocationsStateCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 sampleLocationsEnable = {}; - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo = {}; - }; - - template <> - struct CppType - { - using Type = PipelineSampleLocationsStateCreateInfoEXT; - }; - - struct PipelineShaderStageModuleIdentifierCreateInfoEXT - { - using NativeType = VkPipelineShaderStageModuleIdentifierCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineShaderStageModuleIdentifierCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineShaderStageModuleIdentifierCreateInfoEXT( uint32_t identifierSize_ = {}, - const uint8_t * pIdentifier_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , identifierSize( identifierSize_ ) - , pIdentifier( pIdentifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineShaderStageModuleIdentifierCreateInfoEXT( PipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageModuleIdentifierCreateInfoEXT( VkPipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineShaderStageModuleIdentifierCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineShaderStageModuleIdentifierCreateInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & identifier_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), identifierSize( static_cast( identifier_.size() ) ), pIdentifier( identifier_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineShaderStageModuleIdentifierCreateInfoEXT & operator=( PipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageModuleIdentifierCreateInfoEXT & operator=( VkPipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageModuleIdentifierCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageModuleIdentifierCreateInfoEXT & setIdentifierSize( uint32_t identifierSize_ ) VULKAN_HPP_NOEXCEPT - { - identifierSize = identifierSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineShaderStageModuleIdentifierCreateInfoEXT & setPIdentifier( const uint8_t * pIdentifier_ ) VULKAN_HPP_NOEXCEPT - { - pIdentifier = pIdentifier_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineShaderStageModuleIdentifierCreateInfoEXT & - setIdentifier( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & identifier_ ) VULKAN_HPP_NOEXCEPT - { - identifierSize = static_cast( identifier_.size() ); - pIdentifier = identifier_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineShaderStageModuleIdentifierCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineShaderStageModuleIdentifierCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, identifierSize, pIdentifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineShaderStageModuleIdentifierCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( identifierSize == rhs.identifierSize ) && ( pIdentifier == rhs.pIdentifier ); -# endif - } - - bool operator!=( PipelineShaderStageModuleIdentifierCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineShaderStageModuleIdentifierCreateInfoEXT; - const void * pNext = {}; - uint32_t identifierSize = {}; - const uint8_t * pIdentifier = {}; - }; - - template <> - struct CppType - { - using Type = PipelineShaderStageModuleIdentifierCreateInfoEXT; - }; - - struct PipelineShaderStageRequiredSubgroupSizeCreateInfo - { - using NativeType = VkPipelineShaderStageRequiredSubgroupSizeCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineShaderStageRequiredSubgroupSizeCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineShaderStageRequiredSubgroupSizeCreateInfo( uint32_t requiredSubgroupSize_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , requiredSubgroupSize( requiredSubgroupSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineShaderStageRequiredSubgroupSizeCreateInfo( PipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageRequiredSubgroupSizeCreateInfo( VkPipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineShaderStageRequiredSubgroupSizeCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineShaderStageRequiredSubgroupSizeCreateInfo & - operator=( PipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineShaderStageRequiredSubgroupSizeCreateInfo & operator=( VkPipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkPipelineShaderStageRequiredSubgroupSizeCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineShaderStageRequiredSubgroupSizeCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, requiredSubgroupSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineShaderStageRequiredSubgroupSizeCreateInfo const & ) const = default; -#else - bool operator==( PipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( requiredSubgroupSize == rhs.requiredSubgroupSize ); -# endif - } - - bool operator!=( PipelineShaderStageRequiredSubgroupSizeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineShaderStageRequiredSubgroupSizeCreateInfo; - void * pNext = {}; - uint32_t requiredSubgroupSize = {}; - }; - - template <> - struct CppType - { - using Type = PipelineShaderStageRequiredSubgroupSizeCreateInfo; - }; - using PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT = PipelineShaderStageRequiredSubgroupSizeCreateInfo; - - struct PipelineTessellationDomainOriginStateCreateInfo - { - using NativeType = VkPipelineTessellationDomainOriginStateCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineTessellationDomainOriginStateCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineTessellationDomainOriginStateCreateInfo( - VULKAN_HPP_NAMESPACE::TessellationDomainOrigin domainOrigin_ = VULKAN_HPP_NAMESPACE::TessellationDomainOrigin::eUpperLeft, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , domainOrigin( domainOrigin_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineTessellationDomainOriginStateCreateInfo( PipelineTessellationDomainOriginStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineTessellationDomainOriginStateCreateInfo( VkPipelineTessellationDomainOriginStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineTessellationDomainOriginStateCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineTessellationDomainOriginStateCreateInfo & operator=( PipelineTessellationDomainOriginStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineTessellationDomainOriginStateCreateInfo & operator=( VkPipelineTessellationDomainOriginStateCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineTessellationDomainOriginStateCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineTessellationDomainOriginStateCreateInfo & - setDomainOrigin( VULKAN_HPP_NAMESPACE::TessellationDomainOrigin domainOrigin_ ) VULKAN_HPP_NOEXCEPT - { - domainOrigin = domainOrigin_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineTessellationDomainOriginStateCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineTessellationDomainOriginStateCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, domainOrigin ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineTessellationDomainOriginStateCreateInfo const & ) const = default; -#else - bool operator==( PipelineTessellationDomainOriginStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( domainOrigin == rhs.domainOrigin ); -# endif - } - - bool operator!=( PipelineTessellationDomainOriginStateCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineTessellationDomainOriginStateCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::TessellationDomainOrigin domainOrigin = VULKAN_HPP_NAMESPACE::TessellationDomainOrigin::eUpperLeft; - }; - - template <> - struct CppType - { - using Type = PipelineTessellationDomainOriginStateCreateInfo; - }; - using PipelineTessellationDomainOriginStateCreateInfoKHR = PipelineTessellationDomainOriginStateCreateInfo; - - struct VertexInputBindingDivisorDescriptionEXT - { - using NativeType = VkVertexInputBindingDivisorDescriptionEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VertexInputBindingDivisorDescriptionEXT( uint32_t binding_ = {}, uint32_t divisor_ = {} ) VULKAN_HPP_NOEXCEPT - : binding( binding_ ) - , divisor( divisor_ ) - { - } - - VULKAN_HPP_CONSTEXPR VertexInputBindingDivisorDescriptionEXT( VertexInputBindingDivisorDescriptionEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDivisorDescriptionEXT( VkVertexInputBindingDivisorDescriptionEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VertexInputBindingDivisorDescriptionEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VertexInputBindingDivisorDescriptionEXT & operator=( VertexInputBindingDivisorDescriptionEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDivisorDescriptionEXT & operator=( VkVertexInputBindingDivisorDescriptionEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDivisorDescriptionEXT & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDivisorDescriptionEXT & setDivisor( uint32_t divisor_ ) VULKAN_HPP_NOEXCEPT - { - divisor = divisor_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVertexInputBindingDivisorDescriptionEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVertexInputBindingDivisorDescriptionEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( binding, divisor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VertexInputBindingDivisorDescriptionEXT const & ) const = default; -#else - bool operator==( VertexInputBindingDivisorDescriptionEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( binding == rhs.binding ) && ( divisor == rhs.divisor ); -# endif - } - - bool operator!=( VertexInputBindingDivisorDescriptionEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t binding = {}; - uint32_t divisor = {}; - }; - - struct PipelineVertexInputDivisorStateCreateInfoEXT - { - using NativeType = VkPipelineVertexInputDivisorStateCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineVertexInputDivisorStateCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - PipelineVertexInputDivisorStateCreateInfoEXT( uint32_t vertexBindingDivisorCount_ = {}, - const VULKAN_HPP_NAMESPACE::VertexInputBindingDivisorDescriptionEXT * pVertexBindingDivisors_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vertexBindingDivisorCount( vertexBindingDivisorCount_ ) - , pVertexBindingDivisors( pVertexBindingDivisors_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineVertexInputDivisorStateCreateInfoEXT( PipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineVertexInputDivisorStateCreateInfoEXT( VkPipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineVertexInputDivisorStateCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineVertexInputDivisorStateCreateInfoEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexBindingDivisors_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , vertexBindingDivisorCount( static_cast( vertexBindingDivisors_.size() ) ) - , pVertexBindingDivisors( vertexBindingDivisors_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineVertexInputDivisorStateCreateInfoEXT & operator=( PipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineVertexInputDivisorStateCreateInfoEXT & operator=( VkPipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputDivisorStateCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputDivisorStateCreateInfoEXT & - setVertexBindingDivisorCount( uint32_t vertexBindingDivisorCount_ ) VULKAN_HPP_NOEXCEPT - { - vertexBindingDivisorCount = vertexBindingDivisorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineVertexInputDivisorStateCreateInfoEXT & - setPVertexBindingDivisors( const VULKAN_HPP_NAMESPACE::VertexInputBindingDivisorDescriptionEXT * pVertexBindingDivisors_ ) VULKAN_HPP_NOEXCEPT - { - pVertexBindingDivisors = pVertexBindingDivisors_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineVertexInputDivisorStateCreateInfoEXT & setVertexBindingDivisors( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vertexBindingDivisors_ ) - VULKAN_HPP_NOEXCEPT - { - vertexBindingDivisorCount = static_cast( vertexBindingDivisors_.size() ); - pVertexBindingDivisors = vertexBindingDivisors_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineVertexInputDivisorStateCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineVertexInputDivisorStateCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vertexBindingDivisorCount, pVertexBindingDivisors ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineVertexInputDivisorStateCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vertexBindingDivisorCount == rhs.vertexBindingDivisorCount ) && - ( pVertexBindingDivisors == rhs.pVertexBindingDivisors ); -# endif - } - - bool operator!=( PipelineVertexInputDivisorStateCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineVertexInputDivisorStateCreateInfoEXT; - const void * pNext = {}; - uint32_t vertexBindingDivisorCount = {}; - const VULKAN_HPP_NAMESPACE::VertexInputBindingDivisorDescriptionEXT * pVertexBindingDivisors = {}; - }; - - template <> - struct CppType - { - using Type = PipelineVertexInputDivisorStateCreateInfoEXT; - }; - - struct PipelineViewportCoarseSampleOrderStateCreateInfoNV - { - using NativeType = VkPipelineViewportCoarseSampleOrderStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportCoarseSampleOrderStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportCoarseSampleOrderStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType_ = VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV::eDefault, - uint32_t customSampleOrderCount_ = {}, - const VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV * pCustomSampleOrders_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sampleOrderType( sampleOrderType_ ) - , customSampleOrderCount( customSampleOrderCount_ ) - , pCustomSampleOrders( pCustomSampleOrders_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineViewportCoarseSampleOrderStateCreateInfoNV( PipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportCoarseSampleOrderStateCreateInfoNV( VkPipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportCoarseSampleOrderStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportCoarseSampleOrderStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & customSampleOrders_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , sampleOrderType( sampleOrderType_ ) - , customSampleOrderCount( static_cast( customSampleOrders_.size() ) ) - , pCustomSampleOrders( customSampleOrders_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportCoarseSampleOrderStateCreateInfoNV & - operator=( PipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportCoarseSampleOrderStateCreateInfoNV & operator=( VkPipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportCoarseSampleOrderStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportCoarseSampleOrderStateCreateInfoNV & - setSampleOrderType( VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType_ ) VULKAN_HPP_NOEXCEPT - { - sampleOrderType = sampleOrderType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportCoarseSampleOrderStateCreateInfoNV & - setCustomSampleOrderCount( uint32_t customSampleOrderCount_ ) VULKAN_HPP_NOEXCEPT - { - customSampleOrderCount = customSampleOrderCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportCoarseSampleOrderStateCreateInfoNV & - setPCustomSampleOrders( const VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV * pCustomSampleOrders_ ) VULKAN_HPP_NOEXCEPT - { - pCustomSampleOrders = pCustomSampleOrders_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportCoarseSampleOrderStateCreateInfoNV & setCustomSampleOrders( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & customSampleOrders_ ) VULKAN_HPP_NOEXCEPT - { - customSampleOrderCount = static_cast( customSampleOrders_.size() ); - pCustomSampleOrders = customSampleOrders_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportCoarseSampleOrderStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportCoarseSampleOrderStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, sampleOrderType, customSampleOrderCount, pCustomSampleOrders ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportCoarseSampleOrderStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sampleOrderType == rhs.sampleOrderType ) && - ( customSampleOrderCount == rhs.customSampleOrderCount ) && ( pCustomSampleOrders == rhs.pCustomSampleOrders ); -# endif - } - - bool operator!=( PipelineViewportCoarseSampleOrderStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportCoarseSampleOrderStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV sampleOrderType = VULKAN_HPP_NAMESPACE::CoarseSampleOrderTypeNV::eDefault; - uint32_t customSampleOrderCount = {}; - const VULKAN_HPP_NAMESPACE::CoarseSampleOrderCustomNV * pCustomSampleOrders = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportCoarseSampleOrderStateCreateInfoNV; - }; - - struct PipelineViewportDepthClipControlCreateInfoEXT - { - using NativeType = VkPipelineViewportDepthClipControlCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportDepthClipControlCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportDepthClipControlCreateInfoEXT( VULKAN_HPP_NAMESPACE::Bool32 negativeOneToOne_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , negativeOneToOne( negativeOneToOne_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineViewportDepthClipControlCreateInfoEXT( PipelineViewportDepthClipControlCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportDepthClipControlCreateInfoEXT( VkPipelineViewportDepthClipControlCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportDepthClipControlCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportDepthClipControlCreateInfoEXT & operator=( PipelineViewportDepthClipControlCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportDepthClipControlCreateInfoEXT & operator=( VkPipelineViewportDepthClipControlCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportDepthClipControlCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportDepthClipControlCreateInfoEXT & - setNegativeOneToOne( VULKAN_HPP_NAMESPACE::Bool32 negativeOneToOne_ ) VULKAN_HPP_NOEXCEPT - { - negativeOneToOne = negativeOneToOne_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportDepthClipControlCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportDepthClipControlCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, negativeOneToOne ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportDepthClipControlCreateInfoEXT const & ) const = default; -#else - bool operator==( PipelineViewportDepthClipControlCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( negativeOneToOne == rhs.negativeOneToOne ); -# endif - } - - bool operator!=( PipelineViewportDepthClipControlCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportDepthClipControlCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 negativeOneToOne = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportDepthClipControlCreateInfoEXT; - }; - - struct PipelineViewportExclusiveScissorStateCreateInfoNV - { - using NativeType = VkPipelineViewportExclusiveScissorStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportExclusiveScissorStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportExclusiveScissorStateCreateInfoNV( uint32_t exclusiveScissorCount_ = {}, - const VULKAN_HPP_NAMESPACE::Rect2D * pExclusiveScissors_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , exclusiveScissorCount( exclusiveScissorCount_ ) - , pExclusiveScissors( pExclusiveScissors_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineViewportExclusiveScissorStateCreateInfoNV( PipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportExclusiveScissorStateCreateInfoNV( VkPipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportExclusiveScissorStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportExclusiveScissorStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & exclusiveScissors_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), exclusiveScissorCount( static_cast( exclusiveScissors_.size() ) ), pExclusiveScissors( exclusiveScissors_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportExclusiveScissorStateCreateInfoNV & - operator=( PipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportExclusiveScissorStateCreateInfoNV & operator=( VkPipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportExclusiveScissorStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportExclusiveScissorStateCreateInfoNV & setExclusiveScissorCount( uint32_t exclusiveScissorCount_ ) VULKAN_HPP_NOEXCEPT - { - exclusiveScissorCount = exclusiveScissorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportExclusiveScissorStateCreateInfoNV & - setPExclusiveScissors( const VULKAN_HPP_NAMESPACE::Rect2D * pExclusiveScissors_ ) VULKAN_HPP_NOEXCEPT - { - pExclusiveScissors = pExclusiveScissors_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportExclusiveScissorStateCreateInfoNV & - setExclusiveScissors( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & exclusiveScissors_ ) VULKAN_HPP_NOEXCEPT - { - exclusiveScissorCount = static_cast( exclusiveScissors_.size() ); - pExclusiveScissors = exclusiveScissors_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportExclusiveScissorStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportExclusiveScissorStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, exclusiveScissorCount, pExclusiveScissors ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportExclusiveScissorStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( exclusiveScissorCount == rhs.exclusiveScissorCount ) && - ( pExclusiveScissors == rhs.pExclusiveScissors ); -# endif - } - - bool operator!=( PipelineViewportExclusiveScissorStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportExclusiveScissorStateCreateInfoNV; - const void * pNext = {}; - uint32_t exclusiveScissorCount = {}; - const VULKAN_HPP_NAMESPACE::Rect2D * pExclusiveScissors = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportExclusiveScissorStateCreateInfoNV; - }; - - struct ShadingRatePaletteNV - { - using NativeType = VkShadingRatePaletteNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ShadingRatePaletteNV( uint32_t shadingRatePaletteEntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV * pShadingRatePaletteEntries_ = {} ) VULKAN_HPP_NOEXCEPT - : shadingRatePaletteEntryCount( shadingRatePaletteEntryCount_ ) - , pShadingRatePaletteEntries( pShadingRatePaletteEntries_ ) - { - } - - VULKAN_HPP_CONSTEXPR ShadingRatePaletteNV( ShadingRatePaletteNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShadingRatePaletteNV( VkShadingRatePaletteNV const & rhs ) VULKAN_HPP_NOEXCEPT - : ShadingRatePaletteNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ShadingRatePaletteNV( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & shadingRatePaletteEntries_ ) - : shadingRatePaletteEntryCount( static_cast( shadingRatePaletteEntries_.size() ) ) - , pShadingRatePaletteEntries( shadingRatePaletteEntries_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShadingRatePaletteNV & operator=( ShadingRatePaletteNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShadingRatePaletteNV & operator=( VkShadingRatePaletteNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ShadingRatePaletteNV & setShadingRatePaletteEntryCount( uint32_t shadingRatePaletteEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - shadingRatePaletteEntryCount = shadingRatePaletteEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ShadingRatePaletteNV & - setPShadingRatePaletteEntries( const VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV * pShadingRatePaletteEntries_ ) VULKAN_HPP_NOEXCEPT - { - pShadingRatePaletteEntries = pShadingRatePaletteEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ShadingRatePaletteNV & setShadingRatePaletteEntries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & shadingRatePaletteEntries_ ) - VULKAN_HPP_NOEXCEPT - { - shadingRatePaletteEntryCount = static_cast( shadingRatePaletteEntries_.size() ); - pShadingRatePaletteEntries = shadingRatePaletteEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkShadingRatePaletteNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShadingRatePaletteNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( shadingRatePaletteEntryCount, pShadingRatePaletteEntries ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShadingRatePaletteNV const & ) const = default; -#else - bool operator==( ShadingRatePaletteNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( shadingRatePaletteEntryCount == rhs.shadingRatePaletteEntryCount ) && ( pShadingRatePaletteEntries == rhs.pShadingRatePaletteEntries ); -# endif - } - - bool operator!=( ShadingRatePaletteNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t shadingRatePaletteEntryCount = {}; - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteEntryNV * pShadingRatePaletteEntries = {}; - }; - - struct PipelineViewportShadingRateImageStateCreateInfoNV - { - using NativeType = VkPipelineViewportShadingRateImageStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportShadingRateImageStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportShadingRateImageStateCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 shadingRateImageEnable_ = {}, - uint32_t viewportCount_ = {}, - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV * pShadingRatePalettes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , shadingRateImageEnable( shadingRateImageEnable_ ) - , viewportCount( viewportCount_ ) - , pShadingRatePalettes( pShadingRatePalettes_ ) - { - } - - VULKAN_HPP_CONSTEXPR - PipelineViewportShadingRateImageStateCreateInfoNV( PipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportShadingRateImageStateCreateInfoNV( VkPipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportShadingRateImageStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportShadingRateImageStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::Bool32 shadingRateImageEnable_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & shadingRatePalettes_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , shadingRateImageEnable( shadingRateImageEnable_ ) - , viewportCount( static_cast( shadingRatePalettes_.size() ) ) - , pShadingRatePalettes( shadingRatePalettes_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportShadingRateImageStateCreateInfoNV & - operator=( PipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportShadingRateImageStateCreateInfoNV & operator=( VkPipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportShadingRateImageStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportShadingRateImageStateCreateInfoNV & - setShadingRateImageEnable( VULKAN_HPP_NAMESPACE::Bool32 shadingRateImageEnable_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateImageEnable = shadingRateImageEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportShadingRateImageStateCreateInfoNV & setViewportCount( uint32_t viewportCount_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = viewportCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportShadingRateImageStateCreateInfoNV & - setPShadingRatePalettes( const VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV * pShadingRatePalettes_ ) VULKAN_HPP_NOEXCEPT - { - pShadingRatePalettes = pShadingRatePalettes_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportShadingRateImageStateCreateInfoNV & setShadingRatePalettes( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & shadingRatePalettes_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = static_cast( shadingRatePalettes_.size() ); - pShadingRatePalettes = shadingRatePalettes_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportShadingRateImageStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportShadingRateImageStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, shadingRateImageEnable, viewportCount, pShadingRatePalettes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportShadingRateImageStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( shadingRateImageEnable == rhs.shadingRateImageEnable ) && - ( viewportCount == rhs.viewportCount ) && ( pShadingRatePalettes == rhs.pShadingRatePalettes ); -# endif - } - - bool operator!=( PipelineViewportShadingRateImageStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportShadingRateImageStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 shadingRateImageEnable = {}; - uint32_t viewportCount = {}; - const VULKAN_HPP_NAMESPACE::ShadingRatePaletteNV * pShadingRatePalettes = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportShadingRateImageStateCreateInfoNV; - }; - - struct ViewportSwizzleNV - { - using NativeType = VkViewportSwizzleNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ViewportSwizzleNV( - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV x_ = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX, - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV y_ = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX, - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV z_ = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX, - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV w_ = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX ) VULKAN_HPP_NOEXCEPT - : x( x_ ) - , y( y_ ) - , z( z_ ) - , w( w_ ) - { - } - - VULKAN_HPP_CONSTEXPR ViewportSwizzleNV( ViewportSwizzleNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViewportSwizzleNV( VkViewportSwizzleNV const & rhs ) VULKAN_HPP_NOEXCEPT : ViewportSwizzleNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ViewportSwizzleNV & operator=( ViewportSwizzleNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViewportSwizzleNV & operator=( VkViewportSwizzleNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ViewportSwizzleNV & setX( VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV x_ ) VULKAN_HPP_NOEXCEPT - { - x = x_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViewportSwizzleNV & setY( VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV y_ ) VULKAN_HPP_NOEXCEPT - { - y = y_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViewportSwizzleNV & setZ( VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV z_ ) VULKAN_HPP_NOEXCEPT - { - z = z_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViewportSwizzleNV & setW( VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV w_ ) VULKAN_HPP_NOEXCEPT - { - w = w_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkViewportSwizzleNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkViewportSwizzleNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( x, y, z, w ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ViewportSwizzleNV const & ) const = default; -#else - bool operator==( ViewportSwizzleNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( x == rhs.x ) && ( y == rhs.y ) && ( z == rhs.z ) && ( w == rhs.w ); -# endif - } - - bool operator!=( ViewportSwizzleNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV x = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX; - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV y = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX; - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV z = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX; - VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV w = VULKAN_HPP_NAMESPACE::ViewportCoordinateSwizzleNV::ePositiveX; - }; - - struct PipelineViewportSwizzleStateCreateInfoNV - { - using NativeType = VkPipelineViewportSwizzleStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportSwizzleStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportSwizzleStateCreateInfoNV( VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateFlagsNV flags_ = {}, - uint32_t viewportCount_ = {}, - const VULKAN_HPP_NAMESPACE::ViewportSwizzleNV * pViewportSwizzles_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , viewportCount( viewportCount_ ) - , pViewportSwizzles( pViewportSwizzles_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineViewportSwizzleStateCreateInfoNV( PipelineViewportSwizzleStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportSwizzleStateCreateInfoNV( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportSwizzleStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportSwizzleStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateFlagsNV flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewportSwizzles_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), viewportCount( static_cast( viewportSwizzles_.size() ) ), pViewportSwizzles( viewportSwizzles_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportSwizzleStateCreateInfoNV & operator=( PipelineViewportSwizzleStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportSwizzleStateCreateInfoNV & operator=( VkPipelineViewportSwizzleStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportSwizzleStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportSwizzleStateCreateInfoNV & - setFlags( VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateFlagsNV flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportSwizzleStateCreateInfoNV & setViewportCount( uint32_t viewportCount_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = viewportCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportSwizzleStateCreateInfoNV & - setPViewportSwizzles( const VULKAN_HPP_NAMESPACE::ViewportSwizzleNV * pViewportSwizzles_ ) VULKAN_HPP_NOEXCEPT - { - pViewportSwizzles = pViewportSwizzles_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportSwizzleStateCreateInfoNV & setViewportSwizzles( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewportSwizzles_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = static_cast( viewportSwizzles_.size() ); - pViewportSwizzles = viewportSwizzles_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportSwizzleStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportSwizzleStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, viewportCount, pViewportSwizzles ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportSwizzleStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineViewportSwizzleStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( viewportCount == rhs.viewportCount ) && - ( pViewportSwizzles == rhs.pViewportSwizzles ); -# endif - } - - bool operator!=( PipelineViewportSwizzleStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportSwizzleStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineViewportSwizzleStateCreateFlagsNV flags = {}; - uint32_t viewportCount = {}; - const VULKAN_HPP_NAMESPACE::ViewportSwizzleNV * pViewportSwizzles = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportSwizzleStateCreateInfoNV; - }; - - struct ViewportWScalingNV - { - using NativeType = VkViewportWScalingNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ViewportWScalingNV( float xcoeff_ = {}, float ycoeff_ = {} ) VULKAN_HPP_NOEXCEPT - : xcoeff( xcoeff_ ) - , ycoeff( ycoeff_ ) - { - } - - VULKAN_HPP_CONSTEXPR ViewportWScalingNV( ViewportWScalingNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViewportWScalingNV( VkViewportWScalingNV const & rhs ) VULKAN_HPP_NOEXCEPT : ViewportWScalingNV( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ViewportWScalingNV & operator=( ViewportWScalingNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViewportWScalingNV & operator=( VkViewportWScalingNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ViewportWScalingNV & setXcoeff( float xcoeff_ ) VULKAN_HPP_NOEXCEPT - { - xcoeff = xcoeff_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViewportWScalingNV & setYcoeff( float ycoeff_ ) VULKAN_HPP_NOEXCEPT - { - ycoeff = ycoeff_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkViewportWScalingNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkViewportWScalingNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( xcoeff, ycoeff ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ViewportWScalingNV const & ) const = default; -#else - bool operator==( ViewportWScalingNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( xcoeff == rhs.xcoeff ) && ( ycoeff == rhs.ycoeff ); -# endif - } - - bool operator!=( ViewportWScalingNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - float xcoeff = {}; - float ycoeff = {}; - }; - - struct PipelineViewportWScalingStateCreateInfoNV - { - using NativeType = VkPipelineViewportWScalingStateCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePipelineViewportWScalingStateCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PipelineViewportWScalingStateCreateInfoNV( VULKAN_HPP_NAMESPACE::Bool32 viewportWScalingEnable_ = {}, - uint32_t viewportCount_ = {}, - const VULKAN_HPP_NAMESPACE::ViewportWScalingNV * pViewportWScalings_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , viewportWScalingEnable( viewportWScalingEnable_ ) - , viewportCount( viewportCount_ ) - , pViewportWScalings( pViewportWScalings_ ) - { - } - - VULKAN_HPP_CONSTEXPR PipelineViewportWScalingStateCreateInfoNV( PipelineViewportWScalingStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportWScalingStateCreateInfoNV( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : PipelineViewportWScalingStateCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportWScalingStateCreateInfoNV( - VULKAN_HPP_NAMESPACE::Bool32 viewportWScalingEnable_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewportWScalings_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , viewportWScalingEnable( viewportWScalingEnable_ ) - , viewportCount( static_cast( viewportWScalings_.size() ) ) - , pViewportWScalings( viewportWScalings_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PipelineViewportWScalingStateCreateInfoNV & operator=( PipelineViewportWScalingStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PipelineViewportWScalingStateCreateInfoNV & operator=( VkPipelineViewportWScalingStateCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PipelineViewportWScalingStateCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportWScalingStateCreateInfoNV & - setViewportWScalingEnable( VULKAN_HPP_NAMESPACE::Bool32 viewportWScalingEnable_ ) VULKAN_HPP_NOEXCEPT - { - viewportWScalingEnable = viewportWScalingEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportWScalingStateCreateInfoNV & setViewportCount( uint32_t viewportCount_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = viewportCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PipelineViewportWScalingStateCreateInfoNV & - setPViewportWScalings( const VULKAN_HPP_NAMESPACE::ViewportWScalingNV * pViewportWScalings_ ) VULKAN_HPP_NOEXCEPT - { - pViewportWScalings = pViewportWScalings_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PipelineViewportWScalingStateCreateInfoNV & setViewportWScalings( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewportWScalings_ ) VULKAN_HPP_NOEXCEPT - { - viewportCount = static_cast( viewportWScalings_.size() ); - pViewportWScalings = viewportWScalings_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPipelineViewportWScalingStateCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPipelineViewportWScalingStateCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, viewportWScalingEnable, viewportCount, pViewportWScalings ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PipelineViewportWScalingStateCreateInfoNV const & ) const = default; -#else - bool operator==( PipelineViewportWScalingStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( viewportWScalingEnable == rhs.viewportWScalingEnable ) && - ( viewportCount == rhs.viewportCount ) && ( pViewportWScalings == rhs.pViewportWScalings ); -# endif - } - - bool operator!=( PipelineViewportWScalingStateCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePipelineViewportWScalingStateCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 viewportWScalingEnable = {}; - uint32_t viewportCount = {}; - const VULKAN_HPP_NAMESPACE::ViewportWScalingNV * pViewportWScalings = {}; - }; - - template <> - struct CppType - { - using Type = PipelineViewportWScalingStateCreateInfoNV; - }; - -#if defined( VK_USE_PLATFORM_GGP ) - struct PresentFrameTokenGGP - { - using NativeType = VkPresentFrameTokenGGP; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePresentFrameTokenGGP; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentFrameTokenGGP( GgpFrameToken frameToken_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , frameToken( frameToken_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentFrameTokenGGP( PresentFrameTokenGGP const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentFrameTokenGGP( VkPresentFrameTokenGGP const & rhs ) VULKAN_HPP_NOEXCEPT - : PresentFrameTokenGGP( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentFrameTokenGGP & operator=( PresentFrameTokenGGP const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentFrameTokenGGP & operator=( VkPresentFrameTokenGGP const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentFrameTokenGGP & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentFrameTokenGGP & setFrameToken( GgpFrameToken frameToken_ ) VULKAN_HPP_NOEXCEPT - { - frameToken = frameToken_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentFrameTokenGGP const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentFrameTokenGGP &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, frameToken ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( PresentFrameTokenGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &frameToken, &rhs.frameToken, sizeof( GgpFrameToken ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( PresentFrameTokenGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &frameToken, &rhs.frameToken, sizeof( GgpFrameToken ) ) == 0 ); - } - - bool operator!=( PresentFrameTokenGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePresentFrameTokenGGP; - const void * pNext = {}; - GgpFrameToken frameToken = {}; - }; - - template <> - struct CppType - { - using Type = PresentFrameTokenGGP; - }; -#endif /*VK_USE_PLATFORM_GGP*/ - - struct PresentIdKHR - { - using NativeType = VkPresentIdKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePresentIdKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentIdKHR( uint32_t swapchainCount_ = {}, const uint64_t * pPresentIds_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchainCount( swapchainCount_ ) - , pPresentIds( pPresentIds_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentIdKHR( PresentIdKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentIdKHR( VkPresentIdKHR const & rhs ) VULKAN_HPP_NOEXCEPT : PresentIdKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentIdKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & presentIds_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), swapchainCount( static_cast( presentIds_.size() ) ), pPresentIds( presentIds_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentIdKHR & operator=( PresentIdKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentIdKHR & operator=( VkPresentIdKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentIdKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentIdKHR & setSwapchainCount( uint32_t swapchainCount_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = swapchainCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentIdKHR & setPPresentIds( const uint64_t * pPresentIds_ ) VULKAN_HPP_NOEXCEPT - { - pPresentIds = pPresentIds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentIdKHR & setPresentIds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & presentIds_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( presentIds_.size() ); - pPresentIds = presentIds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentIdKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentIdKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchainCount, pPresentIds ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentIdKHR const & ) const = default; -#else - bool operator==( PresentIdKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchainCount == rhs.swapchainCount ) && ( pPresentIds == rhs.pPresentIds ); -# endif - } - - bool operator!=( PresentIdKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePresentIdKHR; - const void * pNext = {}; - uint32_t swapchainCount = {}; - const uint64_t * pPresentIds = {}; - }; - - template <> - struct CppType - { - using Type = PresentIdKHR; - }; - - struct PresentInfoKHR - { - using NativeType = VkPresentInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePresentInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentInfoKHR( uint32_t waitSemaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ = {}, - uint32_t swapchainCount_ = {}, - const VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains_ = {}, - const uint32_t * pImageIndices_ = {}, - VULKAN_HPP_NAMESPACE::Result * pResults_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphores( pWaitSemaphores_ ) - , swapchainCount( swapchainCount_ ) - , pSwapchains( pSwapchains_ ) - , pImageIndices( pImageIndices_ ) - , pResults( pResults_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentInfoKHR( PresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentInfoKHR( VkPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : PresentInfoKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & swapchains_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageIndices_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & results_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreCount( static_cast( waitSemaphores_.size() ) ) - , pWaitSemaphores( waitSemaphores_.data() ) - , swapchainCount( static_cast( swapchains_.size() ) ) - , pSwapchains( swapchains_.data() ) - , pImageIndices( imageIndices_.data() ) - , pResults( results_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( swapchains_.size() == imageIndices_.size() ); - VULKAN_HPP_ASSERT( results_.empty() || ( swapchains_.size() == results_.size() ) ); - VULKAN_HPP_ASSERT( results_.empty() || ( imageIndices_.size() == results_.size() ) ); -# else - if ( swapchains_.size() != imageIndices_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::PresentInfoKHR::PresentInfoKHR: swapchains_.size() != imageIndices_.size()" ); - } - if ( !results_.empty() && ( swapchains_.size() != results_.size() ) ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::PresentInfoKHR::PresentInfoKHR: !results_.empty() && ( swapchains_.size() != results_.size() )" ); - } - if ( !results_.empty() && ( imageIndices_.size() != results_.size() ) ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::PresentInfoKHR::PresentInfoKHR: !results_.empty() && ( imageIndices_.size() != results_.size() )" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentInfoKHR & operator=( PresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentInfoKHR & operator=( VkPresentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setPWaitSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphores = pWaitSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentInfoKHR & - setWaitSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = static_cast( waitSemaphores_.size() ); - pWaitSemaphores = waitSemaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setSwapchainCount( uint32_t swapchainCount_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = swapchainCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setPSwapchains( const VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains_ ) VULKAN_HPP_NOEXCEPT - { - pSwapchains = pSwapchains_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentInfoKHR & - setSwapchains( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & swapchains_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( swapchains_.size() ); - pSwapchains = swapchains_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setPImageIndices( const uint32_t * pImageIndices_ ) VULKAN_HPP_NOEXCEPT - { - pImageIndices = pImageIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentInfoKHR & setImageIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageIndices_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( imageIndices_.size() ); - pImageIndices = imageIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 PresentInfoKHR & setPResults( VULKAN_HPP_NAMESPACE::Result * pResults_ ) VULKAN_HPP_NOEXCEPT - { - pResults = pResults_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentInfoKHR & setResults( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & results_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( results_.size() ); - pResults = results_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, waitSemaphoreCount, pWaitSemaphores, swapchainCount, pSwapchains, pImageIndices, pResults ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentInfoKHR const & ) const = default; -#else - bool operator==( PresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) && - ( pWaitSemaphores == rhs.pWaitSemaphores ) && ( swapchainCount == rhs.swapchainCount ) && ( pSwapchains == rhs.pSwapchains ) && - ( pImageIndices == rhs.pImageIndices ) && ( pResults == rhs.pResults ); -# endif - } - - bool operator!=( PresentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePresentInfoKHR; - const void * pNext = {}; - uint32_t waitSemaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores = {}; - uint32_t swapchainCount = {}; - const VULKAN_HPP_NAMESPACE::SwapchainKHR * pSwapchains = {}; - const uint32_t * pImageIndices = {}; - VULKAN_HPP_NAMESPACE::Result * pResults = {}; - }; - - template <> - struct CppType - { - using Type = PresentInfoKHR; - }; - - struct RectLayerKHR - { - using NativeType = VkRectLayerKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - RectLayerKHR( VULKAN_HPP_NAMESPACE::Offset2D offset_ = {}, VULKAN_HPP_NAMESPACE::Extent2D extent_ = {}, uint32_t layer_ = {} ) VULKAN_HPP_NOEXCEPT - : offset( offset_ ) - , extent( extent_ ) - , layer( layer_ ) - { - } - - VULKAN_HPP_CONSTEXPR RectLayerKHR( RectLayerKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RectLayerKHR( VkRectLayerKHR const & rhs ) VULKAN_HPP_NOEXCEPT : RectLayerKHR( *reinterpret_cast( &rhs ) ) {} - - explicit RectLayerKHR( Rect2D const & rect2D, uint32_t layer_ = {} ) : offset( rect2D.offset ), extent( rect2D.extent ), layer( layer_ ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RectLayerKHR & operator=( RectLayerKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RectLayerKHR & operator=( VkRectLayerKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RectLayerKHR & setOffset( VULKAN_HPP_NAMESPACE::Offset2D const & offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RectLayerKHR & setExtent( VULKAN_HPP_NAMESPACE::Extent2D const & extent_ ) VULKAN_HPP_NOEXCEPT - { - extent = extent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RectLayerKHR & setLayer( uint32_t layer_ ) VULKAN_HPP_NOEXCEPT - { - layer = layer_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRectLayerKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRectLayerKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( offset, extent, layer ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RectLayerKHR const & ) const = default; -#else - bool operator==( RectLayerKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( offset == rhs.offset ) && ( extent == rhs.extent ) && ( layer == rhs.layer ); -# endif - } - - bool operator!=( RectLayerKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Offset2D offset = {}; - VULKAN_HPP_NAMESPACE::Extent2D extent = {}; - uint32_t layer = {}; - }; - - struct PresentRegionKHR - { - using NativeType = VkPresentRegionKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentRegionKHR( uint32_t rectangleCount_ = {}, const VULKAN_HPP_NAMESPACE::RectLayerKHR * pRectangles_ = {} ) VULKAN_HPP_NOEXCEPT - : rectangleCount( rectangleCount_ ) - , pRectangles( pRectangles_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentRegionKHR( PresentRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentRegionKHR( VkPresentRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT : PresentRegionKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentRegionKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & rectangles_ ) - : rectangleCount( static_cast( rectangles_.size() ) ), pRectangles( rectangles_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentRegionKHR & operator=( PresentRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentRegionKHR & operator=( VkPresentRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentRegionKHR & setRectangleCount( uint32_t rectangleCount_ ) VULKAN_HPP_NOEXCEPT - { - rectangleCount = rectangleCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentRegionKHR & setPRectangles( const VULKAN_HPP_NAMESPACE::RectLayerKHR * pRectangles_ ) VULKAN_HPP_NOEXCEPT - { - pRectangles = pRectangles_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentRegionKHR & - setRectangles( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & rectangles_ ) VULKAN_HPP_NOEXCEPT - { - rectangleCount = static_cast( rectangles_.size() ); - pRectangles = rectangles_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentRegionKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentRegionKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( rectangleCount, pRectangles ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentRegionKHR const & ) const = default; -#else - bool operator==( PresentRegionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( rectangleCount == rhs.rectangleCount ) && ( pRectangles == rhs.pRectangles ); -# endif - } - - bool operator!=( PresentRegionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t rectangleCount = {}; - const VULKAN_HPP_NAMESPACE::RectLayerKHR * pRectangles = {}; - }; - - struct PresentRegionsKHR - { - using NativeType = VkPresentRegionsKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePresentRegionsKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentRegionsKHR( uint32_t swapchainCount_ = {}, - const VULKAN_HPP_NAMESPACE::PresentRegionKHR * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchainCount( swapchainCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentRegionsKHR( PresentRegionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentRegionsKHR( VkPresentRegionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT : PresentRegionsKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentRegionsKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), swapchainCount( static_cast( regions_.size() ) ), pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentRegionsKHR & operator=( PresentRegionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentRegionsKHR & operator=( VkPresentRegionsKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentRegionsKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentRegionsKHR & setSwapchainCount( uint32_t swapchainCount_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = swapchainCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentRegionsKHR & setPRegions( const VULKAN_HPP_NAMESPACE::PresentRegionKHR * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentRegionsKHR & - setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentRegionsKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentRegionsKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchainCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentRegionsKHR const & ) const = default; -#else - bool operator==( PresentRegionsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchainCount == rhs.swapchainCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( PresentRegionsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePresentRegionsKHR; - const void * pNext = {}; - uint32_t swapchainCount = {}; - const VULKAN_HPP_NAMESPACE::PresentRegionKHR * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = PresentRegionsKHR; - }; - - struct PresentTimeGOOGLE - { - using NativeType = VkPresentTimeGOOGLE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentTimeGOOGLE( uint32_t presentID_ = {}, uint64_t desiredPresentTime_ = {} ) VULKAN_HPP_NOEXCEPT - : presentID( presentID_ ) - , desiredPresentTime( desiredPresentTime_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentTimeGOOGLE( PresentTimeGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentTimeGOOGLE( VkPresentTimeGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT : PresentTimeGOOGLE( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentTimeGOOGLE & operator=( PresentTimeGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentTimeGOOGLE & operator=( VkPresentTimeGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentTimeGOOGLE & setPresentID( uint32_t presentID_ ) VULKAN_HPP_NOEXCEPT - { - presentID = presentID_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentTimeGOOGLE & setDesiredPresentTime( uint64_t desiredPresentTime_ ) VULKAN_HPP_NOEXCEPT - { - desiredPresentTime = desiredPresentTime_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentTimeGOOGLE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentTimeGOOGLE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( presentID, desiredPresentTime ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentTimeGOOGLE const & ) const = default; -#else - bool operator==( PresentTimeGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( presentID == rhs.presentID ) && ( desiredPresentTime == rhs.desiredPresentTime ); -# endif - } - - bool operator!=( PresentTimeGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t presentID = {}; - uint64_t desiredPresentTime = {}; - }; - - struct PresentTimesInfoGOOGLE - { - using NativeType = VkPresentTimesInfoGOOGLE; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePresentTimesInfoGOOGLE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PresentTimesInfoGOOGLE( uint32_t swapchainCount_ = {}, - const VULKAN_HPP_NAMESPACE::PresentTimeGOOGLE * pTimes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , swapchainCount( swapchainCount_ ) - , pTimes( pTimes_ ) - { - } - - VULKAN_HPP_CONSTEXPR PresentTimesInfoGOOGLE( PresentTimesInfoGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentTimesInfoGOOGLE( VkPresentTimesInfoGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - : PresentTimesInfoGOOGLE( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentTimesInfoGOOGLE( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & times_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), swapchainCount( static_cast( times_.size() ) ), pTimes( times_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PresentTimesInfoGOOGLE & operator=( PresentTimesInfoGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PresentTimesInfoGOOGLE & operator=( VkPresentTimesInfoGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PresentTimesInfoGOOGLE & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentTimesInfoGOOGLE & setSwapchainCount( uint32_t swapchainCount_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = swapchainCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PresentTimesInfoGOOGLE & setPTimes( const VULKAN_HPP_NAMESPACE::PresentTimeGOOGLE * pTimes_ ) VULKAN_HPP_NOEXCEPT - { - pTimes = pTimes_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - PresentTimesInfoGOOGLE & - setTimes( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & times_ ) VULKAN_HPP_NOEXCEPT - { - swapchainCount = static_cast( times_.size() ); - pTimes = times_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPresentTimesInfoGOOGLE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPresentTimesInfoGOOGLE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, swapchainCount, pTimes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PresentTimesInfoGOOGLE const & ) const = default; -#else - bool operator==( PresentTimesInfoGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( swapchainCount == rhs.swapchainCount ) && ( pTimes == rhs.pTimes ); -# endif - } - - bool operator!=( PresentTimesInfoGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePresentTimesInfoGOOGLE; - const void * pNext = {}; - uint32_t swapchainCount = {}; - const VULKAN_HPP_NAMESPACE::PresentTimeGOOGLE * pTimes = {}; - }; - - template <> - struct CppType - { - using Type = PresentTimesInfoGOOGLE; - }; - - struct PrivateDataSlotCreateInfo - { - using NativeType = VkPrivateDataSlotCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::ePrivateDataSlotCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR PrivateDataSlotCreateInfo( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateFlags flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR PrivateDataSlotCreateInfo( PrivateDataSlotCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PrivateDataSlotCreateInfo( VkPrivateDataSlotCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : PrivateDataSlotCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - PrivateDataSlotCreateInfo & operator=( PrivateDataSlotCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - PrivateDataSlotCreateInfo & operator=( VkPrivateDataSlotCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 PrivateDataSlotCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 PrivateDataSlotCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkPrivateDataSlotCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkPrivateDataSlotCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( PrivateDataSlotCreateInfo const & ) const = default; -#else - bool operator==( PrivateDataSlotCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( PrivateDataSlotCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::ePrivateDataSlotCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PrivateDataSlotCreateFlags flags = {}; - }; - - template <> - struct CppType - { - using Type = PrivateDataSlotCreateInfo; - }; - using PrivateDataSlotCreateInfoEXT = PrivateDataSlotCreateInfo; - - struct ProtectedSubmitInfo - { - using NativeType = VkProtectedSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eProtectedSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ProtectedSubmitInfo( VULKAN_HPP_NAMESPACE::Bool32 protectedSubmit_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , protectedSubmit( protectedSubmit_ ) - { - } - - VULKAN_HPP_CONSTEXPR ProtectedSubmitInfo( ProtectedSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ProtectedSubmitInfo( VkProtectedSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT : ProtectedSubmitInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ProtectedSubmitInfo & operator=( ProtectedSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ProtectedSubmitInfo & operator=( VkProtectedSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ProtectedSubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ProtectedSubmitInfo & setProtectedSubmit( VULKAN_HPP_NAMESPACE::Bool32 protectedSubmit_ ) VULKAN_HPP_NOEXCEPT - { - protectedSubmit = protectedSubmit_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkProtectedSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkProtectedSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, protectedSubmit ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ProtectedSubmitInfo const & ) const = default; -#else - bool operator==( ProtectedSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( protectedSubmit == rhs.protectedSubmit ); -# endif - } - - bool operator!=( ProtectedSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eProtectedSubmitInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 protectedSubmit = {}; - }; - - template <> - struct CppType - { - using Type = ProtectedSubmitInfo; - }; - - struct QueryPoolCreateInfo - { - using NativeType = VkQueryPoolCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueryPoolCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueryPoolCreateInfo( VULKAN_HPP_NAMESPACE::QueryPoolCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::QueryType queryType_ = VULKAN_HPP_NAMESPACE::QueryType::eOcclusion, - uint32_t queryCount_ = {}, - VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , queryType( queryType_ ) - , queryCount( queryCount_ ) - , pipelineStatistics( pipelineStatistics_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueryPoolCreateInfo( QueryPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolCreateInfo( VkQueryPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : QueryPoolCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueryPoolCreateInfo & operator=( QueryPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolCreateInfo & operator=( VkQueryPoolCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueryPoolCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::QueryPoolCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolCreateInfo & setQueryType( VULKAN_HPP_NAMESPACE::QueryType queryType_ ) VULKAN_HPP_NOEXCEPT - { - queryType = queryType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolCreateInfo & setQueryCount( uint32_t queryCount_ ) VULKAN_HPP_NOEXCEPT - { - queryCount = queryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolCreateInfo & - setPipelineStatistics( VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics_ ) VULKAN_HPP_NOEXCEPT - { - pipelineStatistics = pipelineStatistics_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueryPoolCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueryPoolCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, queryType, queryCount, pipelineStatistics ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueryPoolCreateInfo const & ) const = default; -#else - bool operator==( QueryPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( queryType == rhs.queryType ) && ( queryCount == rhs.queryCount ) && - ( pipelineStatistics == rhs.pipelineStatistics ); -# endif - } - - bool operator!=( QueryPoolCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueryPoolCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::QueryPoolCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::QueryType queryType = VULKAN_HPP_NAMESPACE::QueryType::eOcclusion; - uint32_t queryCount = {}; - VULKAN_HPP_NAMESPACE::QueryPipelineStatisticFlags pipelineStatistics = {}; - }; - - template <> - struct CppType - { - using Type = QueryPoolCreateInfo; - }; - - struct QueryPoolPerformanceCreateInfoKHR - { - using NativeType = VkQueryPoolPerformanceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueryPoolPerformanceCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueryPoolPerformanceCreateInfoKHR( uint32_t queueFamilyIndex_ = {}, - uint32_t counterIndexCount_ = {}, - const uint32_t * pCounterIndices_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , counterIndexCount( counterIndexCount_ ) - , pCounterIndices( pCounterIndices_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueryPoolPerformanceCreateInfoKHR( QueryPoolPerformanceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolPerformanceCreateInfoKHR( VkQueryPoolPerformanceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : QueryPoolPerformanceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - QueryPoolPerformanceCreateInfoKHR( uint32_t queueFamilyIndex_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & counterIndices_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , counterIndexCount( static_cast( counterIndices_.size() ) ) - , pCounterIndices( counterIndices_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueryPoolPerformanceCreateInfoKHR & operator=( QueryPoolPerformanceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolPerformanceCreateInfoKHR & operator=( VkQueryPoolPerformanceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceCreateInfoKHR & setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndex = queueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceCreateInfoKHR & setCounterIndexCount( uint32_t counterIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - counterIndexCount = counterIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceCreateInfoKHR & setPCounterIndices( const uint32_t * pCounterIndices_ ) VULKAN_HPP_NOEXCEPT - { - pCounterIndices = pCounterIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - QueryPoolPerformanceCreateInfoKHR & - setCounterIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & counterIndices_ ) VULKAN_HPP_NOEXCEPT - { - counterIndexCount = static_cast( counterIndices_.size() ); - pCounterIndices = counterIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueryPoolPerformanceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueryPoolPerformanceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, queueFamilyIndex, counterIndexCount, pCounterIndices ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueryPoolPerformanceCreateInfoKHR const & ) const = default; -#else - bool operator==( QueryPoolPerformanceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queueFamilyIndex == rhs.queueFamilyIndex ) && - ( counterIndexCount == rhs.counterIndexCount ) && ( pCounterIndices == rhs.pCounterIndices ); -# endif - } - - bool operator!=( QueryPoolPerformanceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueryPoolPerformanceCreateInfoKHR; - const void * pNext = {}; - uint32_t queueFamilyIndex = {}; - uint32_t counterIndexCount = {}; - const uint32_t * pCounterIndices = {}; - }; - - template <> - struct CppType - { - using Type = QueryPoolPerformanceCreateInfoKHR; - }; - - struct QueryPoolPerformanceQueryCreateInfoINTEL - { - using NativeType = VkQueryPoolPerformanceQueryCreateInfoINTEL; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueryPoolPerformanceQueryCreateInfoINTEL; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueryPoolPerformanceQueryCreateInfoINTEL( - VULKAN_HPP_NAMESPACE::QueryPoolSamplingModeINTEL performanceCountersSampling_ = VULKAN_HPP_NAMESPACE::QueryPoolSamplingModeINTEL::eManual, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , performanceCountersSampling( performanceCountersSampling_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueryPoolPerformanceQueryCreateInfoINTEL( QueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolPerformanceQueryCreateInfoINTEL( VkQueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - : QueryPoolPerformanceQueryCreateInfoINTEL( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueryPoolPerformanceQueryCreateInfoINTEL & operator=( QueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueryPoolPerformanceQueryCreateInfoINTEL & operator=( VkQueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceQueryCreateInfoINTEL & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueryPoolPerformanceQueryCreateInfoINTEL & - setPerformanceCountersSampling( VULKAN_HPP_NAMESPACE::QueryPoolSamplingModeINTEL performanceCountersSampling_ ) VULKAN_HPP_NOEXCEPT - { - performanceCountersSampling = performanceCountersSampling_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueryPoolPerformanceQueryCreateInfoINTEL const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueryPoolPerformanceQueryCreateInfoINTEL &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, performanceCountersSampling ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueryPoolPerformanceQueryCreateInfoINTEL const & ) const = default; -#else - bool operator==( QueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( performanceCountersSampling == rhs.performanceCountersSampling ); -# endif - } - - bool operator!=( QueryPoolPerformanceQueryCreateInfoINTEL const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueryPoolPerformanceQueryCreateInfoINTEL; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::QueryPoolSamplingModeINTEL performanceCountersSampling = VULKAN_HPP_NAMESPACE::QueryPoolSamplingModeINTEL::eManual; - }; - - template <> - struct CppType - { - using Type = QueryPoolPerformanceQueryCreateInfoINTEL; - }; - using QueryPoolCreateInfoINTEL = QueryPoolPerformanceQueryCreateInfoINTEL; - - struct QueueFamilyCheckpointProperties2NV - { - using NativeType = VkQueueFamilyCheckpointProperties2NV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyCheckpointProperties2NV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyCheckpointProperties2NV( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 checkpointExecutionStageMask_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , checkpointExecutionStageMask( checkpointExecutionStageMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyCheckpointProperties2NV( QueueFamilyCheckpointProperties2NV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyCheckpointProperties2NV( VkQueueFamilyCheckpointProperties2NV const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyCheckpointProperties2NV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyCheckpointProperties2NV & operator=( QueueFamilyCheckpointProperties2NV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyCheckpointProperties2NV & operator=( VkQueueFamilyCheckpointProperties2NV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkQueueFamilyCheckpointProperties2NV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyCheckpointProperties2NV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, checkpointExecutionStageMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyCheckpointProperties2NV const & ) const = default; -#else - bool operator==( QueueFamilyCheckpointProperties2NV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( checkpointExecutionStageMask == rhs.checkpointExecutionStageMask ); -# endif - } - - bool operator!=( QueueFamilyCheckpointProperties2NV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyCheckpointProperties2NV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 checkpointExecutionStageMask = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyCheckpointProperties2NV; - }; - - struct QueueFamilyCheckpointPropertiesNV - { - using NativeType = VkQueueFamilyCheckpointPropertiesNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyCheckpointPropertiesNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyCheckpointPropertiesNV( VULKAN_HPP_NAMESPACE::PipelineStageFlags checkpointExecutionStageMask_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , checkpointExecutionStageMask( checkpointExecutionStageMask_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyCheckpointPropertiesNV( QueueFamilyCheckpointPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyCheckpointPropertiesNV( VkQueueFamilyCheckpointPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyCheckpointPropertiesNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyCheckpointPropertiesNV & operator=( QueueFamilyCheckpointPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyCheckpointPropertiesNV & operator=( VkQueueFamilyCheckpointPropertiesNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkQueueFamilyCheckpointPropertiesNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyCheckpointPropertiesNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, checkpointExecutionStageMask ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyCheckpointPropertiesNV const & ) const = default; -#else - bool operator==( QueueFamilyCheckpointPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( checkpointExecutionStageMask == rhs.checkpointExecutionStageMask ); -# endif - } - - bool operator!=( QueueFamilyCheckpointPropertiesNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyCheckpointPropertiesNV; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags checkpointExecutionStageMask = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyCheckpointPropertiesNV; - }; - - struct QueueFamilyGlobalPriorityPropertiesKHR - { - using NativeType = VkQueueFamilyGlobalPriorityPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyGlobalPriorityPropertiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - QueueFamilyGlobalPriorityPropertiesKHR( uint32_t priorityCount_ = {}, - std::array const & - priorities_ = { { VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow, - VULKAN_HPP_NAMESPACE::QueueGlobalPriorityKHR::eLow } }, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , priorityCount( priorityCount_ ) - , priorities( priorities_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 QueueFamilyGlobalPriorityPropertiesKHR( QueueFamilyGlobalPriorityPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyGlobalPriorityPropertiesKHR( VkQueueFamilyGlobalPriorityPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyGlobalPriorityPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyGlobalPriorityPropertiesKHR & operator=( QueueFamilyGlobalPriorityPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyGlobalPriorityPropertiesKHR & operator=( VkQueueFamilyGlobalPriorityPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueueFamilyGlobalPriorityPropertiesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueueFamilyGlobalPriorityPropertiesKHR & setPriorityCount( uint32_t priorityCount_ ) VULKAN_HPP_NOEXCEPT - { - priorityCount = priorityCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueueFamilyGlobalPriorityPropertiesKHR & - setPriorities( std::array priorities_ ) VULKAN_HPP_NOEXCEPT - { - priorities = priorities_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueueFamilyGlobalPriorityPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyGlobalPriorityPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, priorityCount, priorities ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyGlobalPriorityPropertiesKHR const & ) const = default; -#else - bool operator==( QueueFamilyGlobalPriorityPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( priorityCount == rhs.priorityCount ) && ( priorities == rhs.priorities ); -# endif - } - - bool operator!=( QueueFamilyGlobalPriorityPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyGlobalPriorityPropertiesKHR; - void * pNext = {}; - uint32_t priorityCount = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D priorities = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyGlobalPriorityPropertiesKHR; - }; - using QueueFamilyGlobalPriorityPropertiesEXT = QueueFamilyGlobalPriorityPropertiesKHR; - - struct QueueFamilyProperties - { - using NativeType = VkQueueFamilyProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyProperties( VULKAN_HPP_NAMESPACE::QueueFlags queueFlags_ = {}, - uint32_t queueCount_ = {}, - uint32_t timestampValidBits_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D minImageTransferGranularity_ = {} ) VULKAN_HPP_NOEXCEPT - : queueFlags( queueFlags_ ) - , queueCount( queueCount_ ) - , timestampValidBits( timestampValidBits_ ) - , minImageTransferGranularity( minImageTransferGranularity_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyProperties( QueueFamilyProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyProperties( VkQueueFamilyProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyProperties & operator=( QueueFamilyProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyProperties & operator=( VkQueueFamilyProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkQueueFamilyProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( queueFlags, queueCount, timestampValidBits, minImageTransferGranularity ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyProperties const & ) const = default; -#else - bool operator==( QueueFamilyProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( queueFlags == rhs.queueFlags ) && ( queueCount == rhs.queueCount ) && ( timestampValidBits == rhs.timestampValidBits ) && - ( minImageTransferGranularity == rhs.minImageTransferGranularity ); -# endif - } - - bool operator!=( QueueFamilyProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::QueueFlags queueFlags = {}; - uint32_t queueCount = {}; - uint32_t timestampValidBits = {}; - VULKAN_HPP_NAMESPACE::Extent3D minImageTransferGranularity = {}; - }; - - struct QueueFamilyProperties2 - { - using NativeType = VkQueueFamilyProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyProperties2( VULKAN_HPP_NAMESPACE::QueueFamilyProperties queueFamilyProperties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , queueFamilyProperties( queueFamilyProperties_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyProperties2( QueueFamilyProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyProperties2( VkQueueFamilyProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyProperties2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyProperties2 & operator=( QueueFamilyProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyProperties2 & operator=( VkQueueFamilyProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkQueueFamilyProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, queueFamilyProperties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyProperties2 const & ) const = default; -#else - bool operator==( QueueFamilyProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queueFamilyProperties == rhs.queueFamilyProperties ); -# endif - } - - bool operator!=( QueueFamilyProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::QueueFamilyProperties queueFamilyProperties = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyProperties2; - }; - using QueueFamilyProperties2KHR = QueueFamilyProperties2; - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct QueueFamilyQueryResultStatusPropertiesKHR - { - using NativeType = VkQueueFamilyQueryResultStatusPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyQueryResultStatusPropertiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyQueryResultStatusPropertiesKHR( VULKAN_HPP_NAMESPACE::Bool32 queryResultStatusSupport_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , queryResultStatusSupport( queryResultStatusSupport_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyQueryResultStatusPropertiesKHR( QueueFamilyQueryResultStatusPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyQueryResultStatusPropertiesKHR( VkQueueFamilyQueryResultStatusPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyQueryResultStatusPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyQueryResultStatusPropertiesKHR & operator=( QueueFamilyQueryResultStatusPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyQueryResultStatusPropertiesKHR & operator=( VkQueueFamilyQueryResultStatusPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueueFamilyQueryResultStatusPropertiesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueueFamilyQueryResultStatusPropertiesKHR & - setQueryResultStatusSupport( VULKAN_HPP_NAMESPACE::Bool32 queryResultStatusSupport_ ) VULKAN_HPP_NOEXCEPT - { - queryResultStatusSupport = queryResultStatusSupport_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueueFamilyQueryResultStatusPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyQueryResultStatusPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, queryResultStatusSupport ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyQueryResultStatusPropertiesKHR const & ) const = default; -# else - bool operator==( QueueFamilyQueryResultStatusPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queryResultStatusSupport == rhs.queryResultStatusSupport ); -# endif - } - - bool operator!=( QueueFamilyQueryResultStatusPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyQueryResultStatusPropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 queryResultStatusSupport = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyQueryResultStatusPropertiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct QueueFamilyVideoPropertiesKHR - { - using NativeType = VkQueueFamilyVideoPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eQueueFamilyVideoPropertiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR QueueFamilyVideoPropertiesKHR( VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagsKHR videoCodecOperations_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , videoCodecOperations( videoCodecOperations_ ) - { - } - - VULKAN_HPP_CONSTEXPR QueueFamilyVideoPropertiesKHR( QueueFamilyVideoPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyVideoPropertiesKHR( VkQueueFamilyVideoPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : QueueFamilyVideoPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - QueueFamilyVideoPropertiesKHR & operator=( QueueFamilyVideoPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - QueueFamilyVideoPropertiesKHR & operator=( VkQueueFamilyVideoPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 QueueFamilyVideoPropertiesKHR & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 QueueFamilyVideoPropertiesKHR & - setVideoCodecOperations( VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagsKHR videoCodecOperations_ ) VULKAN_HPP_NOEXCEPT - { - videoCodecOperations = videoCodecOperations_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkQueueFamilyVideoPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkQueueFamilyVideoPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, videoCodecOperations ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( QueueFamilyVideoPropertiesKHR const & ) const = default; -# else - bool operator==( QueueFamilyVideoPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( videoCodecOperations == rhs.videoCodecOperations ); -# endif - } - - bool operator!=( QueueFamilyVideoPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eQueueFamilyVideoPropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagsKHR videoCodecOperations = {}; - }; - - template <> - struct CppType - { - using Type = QueueFamilyVideoPropertiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - struct RayTracingShaderGroupCreateInfoKHR - { - using NativeType = VkRayTracingShaderGroupCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRayTracingShaderGroupCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoKHR( - VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral, - uint32_t generalShader_ = {}, - uint32_t closestHitShader_ = {}, - uint32_t anyHitShader_ = {}, - uint32_t intersectionShader_ = {}, - const void * pShaderGroupCaptureReplayHandle_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , generalShader( generalShader_ ) - , closestHitShader( closestHitShader_ ) - , anyHitShader( anyHitShader_ ) - , intersectionShader( intersectionShader_ ) - , pShaderGroupCaptureReplayHandle( pShaderGroupCaptureReplayHandle_ ) - { - } - - VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoKHR( RayTracingShaderGroupCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingShaderGroupCreateInfoKHR( VkRayTracingShaderGroupCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : RayTracingShaderGroupCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RayTracingShaderGroupCreateInfoKHR & operator=( RayTracingShaderGroupCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingShaderGroupCreateInfoKHR & operator=( VkRayTracingShaderGroupCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setType( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setGeneralShader( uint32_t generalShader_ ) VULKAN_HPP_NOEXCEPT - { - generalShader = generalShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setClosestHitShader( uint32_t closestHitShader_ ) VULKAN_HPP_NOEXCEPT - { - closestHitShader = closestHitShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setAnyHitShader( uint32_t anyHitShader_ ) VULKAN_HPP_NOEXCEPT - { - anyHitShader = anyHitShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & setIntersectionShader( uint32_t intersectionShader_ ) VULKAN_HPP_NOEXCEPT - { - intersectionShader = intersectionShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoKHR & - setPShaderGroupCaptureReplayHandle( const void * pShaderGroupCaptureReplayHandle_ ) VULKAN_HPP_NOEXCEPT - { - pShaderGroupCaptureReplayHandle = pShaderGroupCaptureReplayHandle_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRayTracingShaderGroupCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRayTracingShaderGroupCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type, generalShader, closestHitShader, anyHitShader, intersectionShader, pShaderGroupCaptureReplayHandle ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RayTracingShaderGroupCreateInfoKHR const & ) const = default; -#else - bool operator==( RayTracingShaderGroupCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ) && ( generalShader == rhs.generalShader ) && - ( closestHitShader == rhs.closestHitShader ) && ( anyHitShader == rhs.anyHitShader ) && ( intersectionShader == rhs.intersectionShader ) && - ( pShaderGroupCaptureReplayHandle == rhs.pShaderGroupCaptureReplayHandle ); -# endif - } - - bool operator!=( RayTracingShaderGroupCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingShaderGroupCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral; - uint32_t generalShader = {}; - uint32_t closestHitShader = {}; - uint32_t anyHitShader = {}; - uint32_t intersectionShader = {}; - const void * pShaderGroupCaptureReplayHandle = {}; - }; - - template <> - struct CppType - { - using Type = RayTracingShaderGroupCreateInfoKHR; - }; - - struct RayTracingPipelineInterfaceCreateInfoKHR - { - using NativeType = VkRayTracingPipelineInterfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRayTracingPipelineInterfaceCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RayTracingPipelineInterfaceCreateInfoKHR( uint32_t maxPipelineRayPayloadSize_ = {}, - uint32_t maxPipelineRayHitAttributeSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxPipelineRayPayloadSize( maxPipelineRayPayloadSize_ ) - , maxPipelineRayHitAttributeSize( maxPipelineRayHitAttributeSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR RayTracingPipelineInterfaceCreateInfoKHR( RayTracingPipelineInterfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineInterfaceCreateInfoKHR( VkRayTracingPipelineInterfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : RayTracingPipelineInterfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RayTracingPipelineInterfaceCreateInfoKHR & operator=( RayTracingPipelineInterfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineInterfaceCreateInfoKHR & operator=( VkRayTracingPipelineInterfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineInterfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineInterfaceCreateInfoKHR & setMaxPipelineRayPayloadSize( uint32_t maxPipelineRayPayloadSize_ ) VULKAN_HPP_NOEXCEPT - { - maxPipelineRayPayloadSize = maxPipelineRayPayloadSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineInterfaceCreateInfoKHR & - setMaxPipelineRayHitAttributeSize( uint32_t maxPipelineRayHitAttributeSize_ ) VULKAN_HPP_NOEXCEPT - { - maxPipelineRayHitAttributeSize = maxPipelineRayHitAttributeSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRayTracingPipelineInterfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRayTracingPipelineInterfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxPipelineRayPayloadSize, maxPipelineRayHitAttributeSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RayTracingPipelineInterfaceCreateInfoKHR const & ) const = default; -#else - bool operator==( RayTracingPipelineInterfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxPipelineRayPayloadSize == rhs.maxPipelineRayPayloadSize ) && - ( maxPipelineRayHitAttributeSize == rhs.maxPipelineRayHitAttributeSize ); -# endif - } - - bool operator!=( RayTracingPipelineInterfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingPipelineInterfaceCreateInfoKHR; - const void * pNext = {}; - uint32_t maxPipelineRayPayloadSize = {}; - uint32_t maxPipelineRayHitAttributeSize = {}; - }; - - template <> - struct CppType - { - using Type = RayTracingPipelineInterfaceCreateInfoKHR; - }; - - struct RayTracingPipelineCreateInfoKHR - { - using NativeType = VkRayTracingPipelineCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRayTracingPipelineCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RayTracingPipelineCreateInfoKHR( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ = {}, - uint32_t stageCount_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ = {}, - uint32_t groupCount_ = {}, - const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoKHR * pGroups_ = {}, - uint32_t maxPipelineRayRecursionDepth_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR * pLibraryInfo_ = {}, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR * pLibraryInterface_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( stageCount_ ) - , pStages( pStages_ ) - , groupCount( groupCount_ ) - , pGroups( pGroups_ ) - , maxPipelineRayRecursionDepth( maxPipelineRayRecursionDepth_ ) - , pLibraryInfo( pLibraryInfo_ ) - , pLibraryInterface( pLibraryInterface_ ) - , pDynamicState( pDynamicState_ ) - , layout( layout_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR RayTracingPipelineCreateInfoKHR( RayTracingPipelineCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineCreateInfoKHR( VkRayTracingPipelineCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : RayTracingPipelineCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoKHR( - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_ = {}, - uint32_t maxPipelineRayRecursionDepth_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR * pLibraryInfo_ = {}, - const VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR * pLibraryInterface_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( static_cast( stages_.size() ) ) - , pStages( stages_.data() ) - , groupCount( static_cast( groups_.size() ) ) - , pGroups( groups_.data() ) - , maxPipelineRayRecursionDepth( maxPipelineRayRecursionDepth_ ) - , pLibraryInfo( pLibraryInfo_ ) - , pLibraryInterface( pLibraryInterface_ ) - , pDynamicState( pDynamicState_ ) - , layout( layout_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RayTracingPipelineCreateInfoKHR & operator=( RayTracingPipelineCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineCreateInfoKHR & operator=( VkRayTracingPipelineCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setStageCount( uint32_t stageCount_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = stageCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & - setPStages( const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ ) VULKAN_HPP_NOEXCEPT - { - pStages = pStages_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoKHR & - setStages( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = static_cast( stages_.size() ); - pStages = stages_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setGroupCount( uint32_t groupCount_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = groupCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & - setPGroups( const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoKHR * pGroups_ ) VULKAN_HPP_NOEXCEPT - { - pGroups = pGroups_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoKHR & setGroups( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = static_cast( groups_.size() ); - pGroups = groups_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setMaxPipelineRayRecursionDepth( uint32_t maxPipelineRayRecursionDepth_ ) VULKAN_HPP_NOEXCEPT - { - maxPipelineRayRecursionDepth = maxPipelineRayRecursionDepth_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & - setPLibraryInfo( const VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR * pLibraryInfo_ ) VULKAN_HPP_NOEXCEPT - { - pLibraryInfo = pLibraryInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & - setPLibraryInterface( const VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR * pLibraryInterface_ ) VULKAN_HPP_NOEXCEPT - { - pLibraryInterface = pLibraryInterface_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & - setPDynamicState( const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState_ ) VULKAN_HPP_NOEXCEPT - { - pDynamicState = pDynamicState_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setLayout( VULKAN_HPP_NAMESPACE::PipelineLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setBasePipelineHandle( VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineHandle = basePipelineHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoKHR & setBasePipelineIndex( int32_t basePipelineIndex_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineIndex = basePipelineIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRayTracingPipelineCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRayTracingPipelineCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - stageCount, - pStages, - groupCount, - pGroups, - maxPipelineRayRecursionDepth, - pLibraryInfo, - pLibraryInterface, - pDynamicState, - layout, - basePipelineHandle, - basePipelineIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RayTracingPipelineCreateInfoKHR const & ) const = default; -#else - bool operator==( RayTracingPipelineCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( stageCount == rhs.stageCount ) && ( pStages == rhs.pStages ) && - ( groupCount == rhs.groupCount ) && ( pGroups == rhs.pGroups ) && ( maxPipelineRayRecursionDepth == rhs.maxPipelineRayRecursionDepth ) && - ( pLibraryInfo == rhs.pLibraryInfo ) && ( pLibraryInterface == rhs.pLibraryInterface ) && ( pDynamicState == rhs.pDynamicState ) && - ( layout == rhs.layout ) && ( basePipelineHandle == rhs.basePipelineHandle ) && ( basePipelineIndex == rhs.basePipelineIndex ); -# endif - } - - bool operator!=( RayTracingPipelineCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingPipelineCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags = {}; - uint32_t stageCount = {}; - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages = {}; - uint32_t groupCount = {}; - const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoKHR * pGroups = {}; - uint32_t maxPipelineRayRecursionDepth = {}; - const VULKAN_HPP_NAMESPACE::PipelineLibraryCreateInfoKHR * pLibraryInfo = {}; - const VULKAN_HPP_NAMESPACE::RayTracingPipelineInterfaceCreateInfoKHR * pLibraryInterface = {}; - const VULKAN_HPP_NAMESPACE::PipelineDynamicStateCreateInfo * pDynamicState = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout layout = {}; - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle = {}; - int32_t basePipelineIndex = {}; - }; - - template <> - struct CppType - { - using Type = RayTracingPipelineCreateInfoKHR; - }; - - struct RayTracingShaderGroupCreateInfoNV - { - using NativeType = VkRayTracingShaderGroupCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRayTracingShaderGroupCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoNV( - VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral, - uint32_t generalShader_ = {}, - uint32_t closestHitShader_ = {}, - uint32_t anyHitShader_ = {}, - uint32_t intersectionShader_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , type( type_ ) - , generalShader( generalShader_ ) - , closestHitShader( closestHitShader_ ) - , anyHitShader( anyHitShader_ ) - , intersectionShader( intersectionShader_ ) - { - } - - VULKAN_HPP_CONSTEXPR RayTracingShaderGroupCreateInfoNV( RayTracingShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingShaderGroupCreateInfoNV( VkRayTracingShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : RayTracingShaderGroupCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RayTracingShaderGroupCreateInfoNV & operator=( RayTracingShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingShaderGroupCreateInfoNV & operator=( VkRayTracingShaderGroupCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setType( VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type_ ) VULKAN_HPP_NOEXCEPT - { - type = type_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setGeneralShader( uint32_t generalShader_ ) VULKAN_HPP_NOEXCEPT - { - generalShader = generalShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setClosestHitShader( uint32_t closestHitShader_ ) VULKAN_HPP_NOEXCEPT - { - closestHitShader = closestHitShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setAnyHitShader( uint32_t anyHitShader_ ) VULKAN_HPP_NOEXCEPT - { - anyHitShader = anyHitShader_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingShaderGroupCreateInfoNV & setIntersectionShader( uint32_t intersectionShader_ ) VULKAN_HPP_NOEXCEPT - { - intersectionShader = intersectionShader_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRayTracingShaderGroupCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRayTracingShaderGroupCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, type, generalShader, closestHitShader, anyHitShader, intersectionShader ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RayTracingShaderGroupCreateInfoNV const & ) const = default; -#else - bool operator==( RayTracingShaderGroupCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( type == rhs.type ) && ( generalShader == rhs.generalShader ) && - ( closestHitShader == rhs.closestHitShader ) && ( anyHitShader == rhs.anyHitShader ) && ( intersectionShader == rhs.intersectionShader ); -# endif - } - - bool operator!=( RayTracingShaderGroupCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingShaderGroupCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR type = VULKAN_HPP_NAMESPACE::RayTracingShaderGroupTypeKHR::eGeneral; - uint32_t generalShader = {}; - uint32_t closestHitShader = {}; - uint32_t anyHitShader = {}; - uint32_t intersectionShader = {}; - }; - - template <> - struct CppType - { - using Type = RayTracingShaderGroupCreateInfoNV; - }; - - struct RayTracingPipelineCreateInfoNV - { - using NativeType = VkRayTracingPipelineCreateInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRayTracingPipelineCreateInfoNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RayTracingPipelineCreateInfoNV( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ = {}, - uint32_t stageCount_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ = {}, - uint32_t groupCount_ = {}, - const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoNV * pGroups_ = {}, - uint32_t maxRecursionDepth_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( stageCount_ ) - , pStages( pStages_ ) - , groupCount( groupCount_ ) - , pGroups( pGroups_ ) - , maxRecursionDepth( maxRecursionDepth_ ) - , layout( layout_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR RayTracingPipelineCreateInfoNV( RayTracingPipelineCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineCreateInfoNV( VkRayTracingPipelineCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : RayTracingPipelineCreateInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoNV( - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_ = {}, - uint32_t maxRecursionDepth_ = {}, - VULKAN_HPP_NAMESPACE::PipelineLayout layout_ = {}, - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ = {}, - int32_t basePipelineIndex_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , stageCount( static_cast( stages_.size() ) ) - , pStages( stages_.data() ) - , groupCount( static_cast( groups_.size() ) ) - , pGroups( groups_.data() ) - , maxRecursionDepth( maxRecursionDepth_ ) - , layout( layout_ ) - , basePipelineHandle( basePipelineHandle_ ) - , basePipelineIndex( basePipelineIndex_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RayTracingPipelineCreateInfoNV & operator=( RayTracingPipelineCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RayTracingPipelineCreateInfoNV & operator=( VkRayTracingPipelineCreateInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setFlags( VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setStageCount( uint32_t stageCount_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = stageCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & - setPStages( const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages_ ) VULKAN_HPP_NOEXCEPT - { - pStages = pStages_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoNV & - setStages( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & stages_ ) VULKAN_HPP_NOEXCEPT - { - stageCount = static_cast( stages_.size() ); - pStages = stages_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setGroupCount( uint32_t groupCount_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = groupCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & - setPGroups( const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoNV * pGroups_ ) VULKAN_HPP_NOEXCEPT - { - pGroups = pGroups_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RayTracingPipelineCreateInfoNV & setGroups( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & groups_ ) VULKAN_HPP_NOEXCEPT - { - groupCount = static_cast( groups_.size() ); - pGroups = groups_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setMaxRecursionDepth( uint32_t maxRecursionDepth_ ) VULKAN_HPP_NOEXCEPT - { - maxRecursionDepth = maxRecursionDepth_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setLayout( VULKAN_HPP_NAMESPACE::PipelineLayout layout_ ) VULKAN_HPP_NOEXCEPT - { - layout = layout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setBasePipelineHandle( VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineHandle = basePipelineHandle_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RayTracingPipelineCreateInfoNV & setBasePipelineIndex( int32_t basePipelineIndex_ ) VULKAN_HPP_NOEXCEPT - { - basePipelineIndex = basePipelineIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRayTracingPipelineCreateInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRayTracingPipelineCreateInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, stageCount, pStages, groupCount, pGroups, maxRecursionDepth, layout, basePipelineHandle, basePipelineIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RayTracingPipelineCreateInfoNV const & ) const = default; -#else - bool operator==( RayTracingPipelineCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( stageCount == rhs.stageCount ) && ( pStages == rhs.pStages ) && - ( groupCount == rhs.groupCount ) && ( pGroups == rhs.pGroups ) && ( maxRecursionDepth == rhs.maxRecursionDepth ) && ( layout == rhs.layout ) && - ( basePipelineHandle == rhs.basePipelineHandle ) && ( basePipelineIndex == rhs.basePipelineIndex ); -# endif - } - - bool operator!=( RayTracingPipelineCreateInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRayTracingPipelineCreateInfoNV; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::PipelineCreateFlags flags = {}; - uint32_t stageCount = {}; - const VULKAN_HPP_NAMESPACE::PipelineShaderStageCreateInfo * pStages = {}; - uint32_t groupCount = {}; - const VULKAN_HPP_NAMESPACE::RayTracingShaderGroupCreateInfoNV * pGroups = {}; - uint32_t maxRecursionDepth = {}; - VULKAN_HPP_NAMESPACE::PipelineLayout layout = {}; - VULKAN_HPP_NAMESPACE::Pipeline basePipelineHandle = {}; - int32_t basePipelineIndex = {}; - }; - - template <> - struct CppType - { - using Type = RayTracingPipelineCreateInfoNV; - }; - - struct RefreshCycleDurationGOOGLE - { - using NativeType = VkRefreshCycleDurationGOOGLE; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RefreshCycleDurationGOOGLE( uint64_t refreshDuration_ = {} ) VULKAN_HPP_NOEXCEPT : refreshDuration( refreshDuration_ ) {} - - VULKAN_HPP_CONSTEXPR RefreshCycleDurationGOOGLE( RefreshCycleDurationGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RefreshCycleDurationGOOGLE( VkRefreshCycleDurationGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - : RefreshCycleDurationGOOGLE( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RefreshCycleDurationGOOGLE & operator=( RefreshCycleDurationGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RefreshCycleDurationGOOGLE & operator=( VkRefreshCycleDurationGOOGLE const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkRefreshCycleDurationGOOGLE const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRefreshCycleDurationGOOGLE &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( refreshDuration ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RefreshCycleDurationGOOGLE const & ) const = default; -#else - bool operator==( RefreshCycleDurationGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( refreshDuration == rhs.refreshDuration ); -# endif - } - - bool operator!=( RefreshCycleDurationGOOGLE const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint64_t refreshDuration = {}; - }; - - struct RenderPassAttachmentBeginInfo - { - using NativeType = VkRenderPassAttachmentBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassAttachmentBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassAttachmentBeginInfo( uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageView * pAttachments_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassAttachmentBeginInfo( RenderPassAttachmentBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassAttachmentBeginInfo( VkRenderPassAttachmentBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassAttachmentBeginInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassAttachmentBeginInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), attachmentCount( static_cast( attachments_.size() ) ), pAttachments( attachments_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassAttachmentBeginInfo & operator=( RenderPassAttachmentBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassAttachmentBeginInfo & operator=( VkRenderPassAttachmentBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassAttachmentBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassAttachmentBeginInfo & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassAttachmentBeginInfo & setPAttachments( const VULKAN_HPP_NAMESPACE::ImageView * pAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pAttachments = pAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassAttachmentBeginInfo & - setAttachments( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( attachments_.size() ); - pAttachments = attachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassAttachmentBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassAttachmentBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, attachmentCount, pAttachments ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassAttachmentBeginInfo const & ) const = default; -#else - bool operator==( RenderPassAttachmentBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachmentCount == rhs.attachmentCount ) && ( pAttachments == rhs.pAttachments ); -# endif - } - - bool operator!=( RenderPassAttachmentBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassAttachmentBeginInfo; - const void * pNext = {}; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::ImageView * pAttachments = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassAttachmentBeginInfo; - }; - using RenderPassAttachmentBeginInfoKHR = RenderPassAttachmentBeginInfo; - - struct RenderPassBeginInfo - { - using NativeType = VkRenderPassBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer_ = {}, - VULKAN_HPP_NAMESPACE::Rect2D renderArea_ = {}, - uint32_t clearValueCount_ = {}, - const VULKAN_HPP_NAMESPACE::ClearValue * pClearValues_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , renderPass( renderPass_ ) - , framebuffer( framebuffer_ ) - , renderArea( renderArea_ ) - , clearValueCount( clearValueCount_ ) - , pClearValues( pClearValues_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo( RenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassBeginInfo( VkRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT : RenderPassBeginInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassBeginInfo( VULKAN_HPP_NAMESPACE::RenderPass renderPass_, - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer_, - VULKAN_HPP_NAMESPACE::Rect2D renderArea_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & clearValues_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , renderPass( renderPass_ ) - , framebuffer( framebuffer_ ) - , renderArea( renderArea_ ) - , clearValueCount( static_cast( clearValues_.size() ) ) - , pClearValues( clearValues_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassBeginInfo & operator=( RenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassBeginInfo & operator=( VkRenderPassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setRenderPass( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ ) VULKAN_HPP_NOEXCEPT - { - renderPass = renderPass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setFramebuffer( VULKAN_HPP_NAMESPACE::Framebuffer framebuffer_ ) VULKAN_HPP_NOEXCEPT - { - framebuffer = framebuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setRenderArea( VULKAN_HPP_NAMESPACE::Rect2D const & renderArea_ ) VULKAN_HPP_NOEXCEPT - { - renderArea = renderArea_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setClearValueCount( uint32_t clearValueCount_ ) VULKAN_HPP_NOEXCEPT - { - clearValueCount = clearValueCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassBeginInfo & setPClearValues( const VULKAN_HPP_NAMESPACE::ClearValue * pClearValues_ ) VULKAN_HPP_NOEXCEPT - { - pClearValues = pClearValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassBeginInfo & - setClearValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & clearValues_ ) VULKAN_HPP_NOEXCEPT - { - clearValueCount = static_cast( clearValues_.size() ); - pClearValues = clearValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, renderPass, framebuffer, renderArea, clearValueCount, pClearValues ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassBeginInfo const & ) const = default; -#else - bool operator==( RenderPassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( renderPass == rhs.renderPass ) && ( framebuffer == rhs.framebuffer ) && - ( renderArea == rhs.renderArea ) && ( clearValueCount == rhs.clearValueCount ) && ( pClearValues == rhs.pClearValues ); -# endif - } - - bool operator!=( RenderPassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassBeginInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPass renderPass = {}; - VULKAN_HPP_NAMESPACE::Framebuffer framebuffer = {}; - VULKAN_HPP_NAMESPACE::Rect2D renderArea = {}; - uint32_t clearValueCount = {}; - const VULKAN_HPP_NAMESPACE::ClearValue * pClearValues = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassBeginInfo; - }; - - struct SubpassDescription - { - using NativeType = VkSubpassDescription; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassDescription( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - uint32_t inputAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference * pInputAttachments_ = {}, - uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference * pColorAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference * pResolveAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference * pDepthStencilAttachment_ = {}, - uint32_t preserveAttachmentCount_ = {}, - const uint32_t * pPreserveAttachments_ = {} ) VULKAN_HPP_NOEXCEPT - : flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , inputAttachmentCount( inputAttachmentCount_ ) - , pInputAttachments( pInputAttachments_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachments( pColorAttachments_ ) - , pResolveAttachments( pResolveAttachments_ ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( preserveAttachmentCount_ ) - , pPreserveAttachments( pPreserveAttachments_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassDescription( SubpassDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescription( VkSubpassDescription const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassDescription( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & inputAttachments_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & resolveAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference * pDepthStencilAttachment_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & preserveAttachments_ = {} ) - : flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , inputAttachmentCount( static_cast( inputAttachments_.size() ) ) - , pInputAttachments( inputAttachments_.data() ) - , colorAttachmentCount( static_cast( colorAttachments_.size() ) ) - , pColorAttachments( colorAttachments_.data() ) - , pResolveAttachments( resolveAttachments_.data() ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( static_cast( preserveAttachments_.size() ) ) - , pPreserveAttachments( preserveAttachments_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( resolveAttachments_.empty() || ( colorAttachments_.size() == resolveAttachments_.size() ) ); -# else - if ( !resolveAttachments_.empty() && ( colorAttachments_.size() != resolveAttachments_.size() ) ) - { - throw LogicError( - VULKAN_HPP_NAMESPACE_STRING - "::SubpassDescription::SubpassDescription: !resolveAttachments_.empty() && ( colorAttachments_.size() != resolveAttachments_.size() )" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassDescription & operator=( SubpassDescription const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescription & operator=( VkSubpassDescription const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setFlags( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setInputAttachmentCount( uint32_t inputAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - inputAttachmentCount = inputAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & - setPInputAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference * pInputAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pInputAttachments = pInputAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription & setInputAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & inputAttachments_ ) VULKAN_HPP_NOEXCEPT - { - inputAttachmentCount = static_cast( inputAttachments_.size() ); - pInputAttachments = inputAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & - setPColorAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference * pColorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachments = pColorAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription & setColorAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachments_.size() ); - pColorAttachments = colorAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & - setPResolveAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference * pResolveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pResolveAttachments = pResolveAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription & setResolveAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & resolveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( resolveAttachments_.size() ); - pResolveAttachments = resolveAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & - setPDepthStencilAttachment( const VULKAN_HPP_NAMESPACE::AttachmentReference * pDepthStencilAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pDepthStencilAttachment = pDepthStencilAttachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - preserveAttachmentCount = preserveAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription & setPPreserveAttachments( const uint32_t * pPreserveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pPreserveAttachments = pPreserveAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription & - setPreserveAttachments( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & preserveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - preserveAttachmentCount = static_cast( preserveAttachments_.size() ); - pPreserveAttachments = preserveAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassDescription const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassDescription &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( flags, - pipelineBindPoint, - inputAttachmentCount, - pInputAttachments, - colorAttachmentCount, - pColorAttachments, - pResolveAttachments, - pDepthStencilAttachment, - preserveAttachmentCount, - pPreserveAttachments ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassDescription const & ) const = default; -#else - bool operator==( SubpassDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( flags == rhs.flags ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && ( inputAttachmentCount == rhs.inputAttachmentCount ) && - ( pInputAttachments == rhs.pInputAttachments ) && ( colorAttachmentCount == rhs.colorAttachmentCount ) && - ( pColorAttachments == rhs.pColorAttachments ) && ( pResolveAttachments == rhs.pResolveAttachments ) && - ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) && ( preserveAttachmentCount == rhs.preserveAttachmentCount ) && - ( pPreserveAttachments == rhs.pPreserveAttachments ); -# endif - } - - bool operator!=( SubpassDescription const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - uint32_t inputAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference * pInputAttachments = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference * pColorAttachments = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference * pResolveAttachments = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference * pDepthStencilAttachment = {}; - uint32_t preserveAttachmentCount = {}; - const uint32_t * pPreserveAttachments = {}; - }; - - struct SubpassDependency - { - using NativeType = VkSubpassDependency; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassDependency( uint32_t srcSubpass_ = {}, - uint32_t dstSubpass_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ = {} ) VULKAN_HPP_NOEXCEPT - : srcSubpass( srcSubpass_ ) - , dstSubpass( dstSubpass_ ) - , srcStageMask( srcStageMask_ ) - , dstStageMask( dstStageMask_ ) - , srcAccessMask( srcAccessMask_ ) - , dstAccessMask( dstAccessMask_ ) - , dependencyFlags( dependencyFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassDependency( SubpassDependency const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDependency( VkSubpassDependency const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassDependency( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassDependency & operator=( SubpassDependency const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDependency & operator=( VkSubpassDependency const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setSrcSubpass( uint32_t srcSubpass_ ) VULKAN_HPP_NOEXCEPT - { - srcSubpass = srcSubpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setDstSubpass( uint32_t dstSubpass_ ) VULKAN_HPP_NOEXCEPT - { - dstSubpass = dstSubpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setSrcStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask_ ) VULKAN_HPP_NOEXCEPT - { - srcStageMask = srcStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setDstStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - dstStageMask = dstStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency & setDependencyFlags( VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ ) VULKAN_HPP_NOEXCEPT - { - dependencyFlags = dependencyFlags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassDependency const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassDependency &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( srcSubpass, dstSubpass, srcStageMask, dstStageMask, srcAccessMask, dstAccessMask, dependencyFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassDependency const & ) const = default; -#else - bool operator==( SubpassDependency const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( srcSubpass == rhs.srcSubpass ) && ( dstSubpass == rhs.dstSubpass ) && ( srcStageMask == rhs.srcStageMask ) && - ( dstStageMask == rhs.dstStageMask ) && ( srcAccessMask == rhs.srcAccessMask ) && ( dstAccessMask == rhs.dstAccessMask ) && - ( dependencyFlags == rhs.dependencyFlags ); -# endif - } - - bool operator!=( SubpassDependency const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t srcSubpass = {}; - uint32_t dstSubpass = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask = {}; - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags = {}; - }; - - struct RenderPassCreateInfo - { - using NativeType = VkRenderPassCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassCreateInfo( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_ = {}, - uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentDescription * pAttachments_ = {}, - uint32_t subpassCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubpassDescription * pSubpasses_ = {}, - uint32_t dependencyCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubpassDependency * pDependencies_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , subpassCount( subpassCount_ ) - , pSubpasses( pSubpasses_ ) - , dependencyCount( dependencyCount_ ) - , pDependencies( pDependencies_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassCreateInfo( RenderPassCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreateInfo( VkRenderPassCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & subpasses_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dependencies_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , attachmentCount( static_cast( attachments_.size() ) ) - , pAttachments( attachments_.data() ) - , subpassCount( static_cast( subpasses_.size() ) ) - , pSubpasses( subpasses_.data() ) - , dependencyCount( static_cast( dependencies_.size() ) ) - , pDependencies( dependencies_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassCreateInfo & operator=( RenderPassCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreateInfo & operator=( VkRenderPassCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setPAttachments( const VULKAN_HPP_NAMESPACE::AttachmentDescription * pAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pAttachments = pAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo & setAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( attachments_.size() ); - pAttachments = attachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setSubpassCount( uint32_t subpassCount_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = subpassCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setPSubpasses( const VULKAN_HPP_NAMESPACE::SubpassDescription * pSubpasses_ ) VULKAN_HPP_NOEXCEPT - { - pSubpasses = pSubpasses_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo & - setSubpasses( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & subpasses_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = static_cast( subpasses_.size() ); - pSubpasses = subpasses_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setDependencyCount( uint32_t dependencyCount_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = dependencyCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo & setPDependencies( const VULKAN_HPP_NAMESPACE::SubpassDependency * pDependencies_ ) VULKAN_HPP_NOEXCEPT - { - pDependencies = pDependencies_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo & - setDependencies( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dependencies_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = static_cast( dependencies_.size() ); - pDependencies = dependencies_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, attachmentCount, pAttachments, subpassCount, pSubpasses, dependencyCount, pDependencies ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassCreateInfo const & ) const = default; -#else - bool operator==( RenderPassCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( attachmentCount == rhs.attachmentCount ) && - ( pAttachments == rhs.pAttachments ) && ( subpassCount == rhs.subpassCount ) && ( pSubpasses == rhs.pSubpasses ) && - ( dependencyCount == rhs.dependencyCount ) && ( pDependencies == rhs.pDependencies ); -# endif - } - - bool operator!=( RenderPassCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags = {}; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentDescription * pAttachments = {}; - uint32_t subpassCount = {}; - const VULKAN_HPP_NAMESPACE::SubpassDescription * pSubpasses = {}; - uint32_t dependencyCount = {}; - const VULKAN_HPP_NAMESPACE::SubpassDependency * pDependencies = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassCreateInfo; - }; - - struct SubpassDescription2 - { - using NativeType = VkSubpassDescription2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassDescription2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassDescription2( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics, - uint32_t viewMask_ = {}, - uint32_t inputAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pInputAttachments_ = {}, - uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pColorAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pResolveAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilAttachment_ = {}, - uint32_t preserveAttachmentCount_ = {}, - const uint32_t * pPreserveAttachments_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , viewMask( viewMask_ ) - , inputAttachmentCount( inputAttachmentCount_ ) - , pInputAttachments( pInputAttachments_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachments( pColorAttachments_ ) - , pResolveAttachments( pResolveAttachments_ ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( preserveAttachmentCount_ ) - , pPreserveAttachments( pPreserveAttachments_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassDescription2( SubpassDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescription2( VkSubpassDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassDescription2( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription2( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_, - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_, - uint32_t viewMask_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & inputAttachments_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & resolveAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilAttachment_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & preserveAttachments_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , pipelineBindPoint( pipelineBindPoint_ ) - , viewMask( viewMask_ ) - , inputAttachmentCount( static_cast( inputAttachments_.size() ) ) - , pInputAttachments( inputAttachments_.data() ) - , colorAttachmentCount( static_cast( colorAttachments_.size() ) ) - , pColorAttachments( colorAttachments_.data() ) - , pResolveAttachments( resolveAttachments_.data() ) - , pDepthStencilAttachment( pDepthStencilAttachment_ ) - , preserveAttachmentCount( static_cast( preserveAttachments_.size() ) ) - , pPreserveAttachments( preserveAttachments_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( resolveAttachments_.empty() || ( colorAttachments_.size() == resolveAttachments_.size() ) ); -# else - if ( !resolveAttachments_.empty() && ( colorAttachments_.size() != resolveAttachments_.size() ) ) - { - throw LogicError( - VULKAN_HPP_NAMESPACE_STRING - "::SubpassDescription2::SubpassDescription2: !resolveAttachments_.empty() && ( colorAttachments_.size() != resolveAttachments_.size() )" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassDescription2 & operator=( SubpassDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescription2 & operator=( VkSubpassDescription2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setFlags( VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setPipelineBindPoint( VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint_ ) VULKAN_HPP_NOEXCEPT - { - pipelineBindPoint = pipelineBindPoint_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setViewMask( uint32_t viewMask_ ) VULKAN_HPP_NOEXCEPT - { - viewMask = viewMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setInputAttachmentCount( uint32_t inputAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - inputAttachmentCount = inputAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & - setPInputAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pInputAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pInputAttachments = pInputAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription2 & setInputAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & inputAttachments_ ) VULKAN_HPP_NOEXCEPT - { - inputAttachmentCount = static_cast( inputAttachments_.size() ); - pInputAttachments = inputAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & - setPColorAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pColorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachments = pColorAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription2 & setColorAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachments_.size() ); - pColorAttachments = colorAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & - setPResolveAttachments( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pResolveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pResolveAttachments = pResolveAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription2 & setResolveAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & resolveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( resolveAttachments_.size() ); - pResolveAttachments = resolveAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & - setPDepthStencilAttachment( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pDepthStencilAttachment = pDepthStencilAttachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setPreserveAttachmentCount( uint32_t preserveAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - preserveAttachmentCount = preserveAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescription2 & setPPreserveAttachments( const uint32_t * pPreserveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pPreserveAttachments = pPreserveAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassDescription2 & - setPreserveAttachments( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & preserveAttachments_ ) VULKAN_HPP_NOEXCEPT - { - preserveAttachmentCount = static_cast( preserveAttachments_.size() ); - pPreserveAttachments = preserveAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassDescription2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassDescription2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - pipelineBindPoint, - viewMask, - inputAttachmentCount, - pInputAttachments, - colorAttachmentCount, - pColorAttachments, - pResolveAttachments, - pDepthStencilAttachment, - preserveAttachmentCount, - pPreserveAttachments ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassDescription2 const & ) const = default; -#else - bool operator==( SubpassDescription2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( pipelineBindPoint == rhs.pipelineBindPoint ) && - ( viewMask == rhs.viewMask ) && ( inputAttachmentCount == rhs.inputAttachmentCount ) && ( pInputAttachments == rhs.pInputAttachments ) && - ( colorAttachmentCount == rhs.colorAttachmentCount ) && ( pColorAttachments == rhs.pColorAttachments ) && - ( pResolveAttachments == rhs.pResolveAttachments ) && ( pDepthStencilAttachment == rhs.pDepthStencilAttachment ) && - ( preserveAttachmentCount == rhs.preserveAttachmentCount ) && ( pPreserveAttachments == rhs.pPreserveAttachments ); -# endif - } - - bool operator!=( SubpassDescription2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassDescription2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SubpassDescriptionFlags flags = {}; - VULKAN_HPP_NAMESPACE::PipelineBindPoint pipelineBindPoint = VULKAN_HPP_NAMESPACE::PipelineBindPoint::eGraphics; - uint32_t viewMask = {}; - uint32_t inputAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pInputAttachments = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pColorAttachments = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pResolveAttachments = {}; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilAttachment = {}; - uint32_t preserveAttachmentCount = {}; - const uint32_t * pPreserveAttachments = {}; - }; - - template <> - struct CppType - { - using Type = SubpassDescription2; - }; - using SubpassDescription2KHR = SubpassDescription2; - - struct SubpassDependency2 - { - using NativeType = VkSubpassDependency2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassDependency2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassDependency2( uint32_t srcSubpass_ = {}, - uint32_t dstSubpass_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ = {}, - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ = {}, - int32_t viewOffset_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcSubpass( srcSubpass_ ) - , dstSubpass( dstSubpass_ ) - , srcStageMask( srcStageMask_ ) - , dstStageMask( dstStageMask_ ) - , srcAccessMask( srcAccessMask_ ) - , dstAccessMask( dstAccessMask_ ) - , dependencyFlags( dependencyFlags_ ) - , viewOffset( viewOffset_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassDependency2( SubpassDependency2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDependency2( VkSubpassDependency2 const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassDependency2( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassDependency2 & operator=( SubpassDependency2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDependency2 & operator=( VkSubpassDependency2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setSrcSubpass( uint32_t srcSubpass_ ) VULKAN_HPP_NOEXCEPT - { - srcSubpass = srcSubpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setDstSubpass( uint32_t dstSubpass_ ) VULKAN_HPP_NOEXCEPT - { - dstSubpass = dstSubpass_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setSrcStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask_ ) VULKAN_HPP_NOEXCEPT - { - srcStageMask = srcStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setDstStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - dstStageMask = dstStageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setSrcAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - srcAccessMask = srcAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setDstAccessMask( VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask_ ) VULKAN_HPP_NOEXCEPT - { - dstAccessMask = dstAccessMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setDependencyFlags( VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags_ ) VULKAN_HPP_NOEXCEPT - { - dependencyFlags = dependencyFlags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDependency2 & setViewOffset( int32_t viewOffset_ ) VULKAN_HPP_NOEXCEPT - { - viewOffset = viewOffset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassDependency2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassDependency2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcSubpass, dstSubpass, srcStageMask, dstStageMask, srcAccessMask, dstAccessMask, dependencyFlags, viewOffset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassDependency2 const & ) const = default; -#else - bool operator==( SubpassDependency2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcSubpass == rhs.srcSubpass ) && ( dstSubpass == rhs.dstSubpass ) && - ( srcStageMask == rhs.srcStageMask ) && ( dstStageMask == rhs.dstStageMask ) && ( srcAccessMask == rhs.srcAccessMask ) && - ( dstAccessMask == rhs.dstAccessMask ) && ( dependencyFlags == rhs.dependencyFlags ) && ( viewOffset == rhs.viewOffset ); -# endif - } - - bool operator!=( SubpassDependency2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassDependency2; - const void * pNext = {}; - uint32_t srcSubpass = {}; - uint32_t dstSubpass = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags srcStageMask = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags dstStageMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags srcAccessMask = {}; - VULKAN_HPP_NAMESPACE::AccessFlags dstAccessMask = {}; - VULKAN_HPP_NAMESPACE::DependencyFlags dependencyFlags = {}; - int32_t viewOffset = {}; - }; - - template <> - struct CppType - { - using Type = SubpassDependency2; - }; - using SubpassDependency2KHR = SubpassDependency2; - - struct RenderPassCreateInfo2 - { - using NativeType = VkRenderPassCreateInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassCreateInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassCreateInfo2( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_ = {}, - uint32_t attachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentDescription2 * pAttachments_ = {}, - uint32_t subpassCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubpassDescription2 * pSubpasses_ = {}, - uint32_t dependencyCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubpassDependency2 * pDependencies_ = {}, - uint32_t correlatedViewMaskCount_ = {}, - const uint32_t * pCorrelatedViewMasks_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , attachmentCount( attachmentCount_ ) - , pAttachments( pAttachments_ ) - , subpassCount( subpassCount_ ) - , pSubpasses( pSubpasses_ ) - , dependencyCount( dependencyCount_ ) - , pDependencies( pDependencies_ ) - , correlatedViewMaskCount( correlatedViewMaskCount_ ) - , pCorrelatedViewMasks( pCorrelatedViewMasks_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassCreateInfo2( RenderPassCreateInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreateInfo2( VkRenderPassCreateInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassCreateInfo2( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo2( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & subpasses_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dependencies_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & correlatedViewMasks_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , attachmentCount( static_cast( attachments_.size() ) ) - , pAttachments( attachments_.data() ) - , subpassCount( static_cast( subpasses_.size() ) ) - , pSubpasses( subpasses_.data() ) - , dependencyCount( static_cast( dependencies_.size() ) ) - , pDependencies( dependencies_.data() ) - , correlatedViewMaskCount( static_cast( correlatedViewMasks_.size() ) ) - , pCorrelatedViewMasks( correlatedViewMasks_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassCreateInfo2 & operator=( RenderPassCreateInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreateInfo2 & operator=( VkRenderPassCreateInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setFlags( VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setAttachmentCount( uint32_t attachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = attachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setPAttachments( const VULKAN_HPP_NAMESPACE::AttachmentDescription2 * pAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pAttachments = pAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo2 & setAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachments_ ) VULKAN_HPP_NOEXCEPT - { - attachmentCount = static_cast( attachments_.size() ); - pAttachments = attachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setSubpassCount( uint32_t subpassCount_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = subpassCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setPSubpasses( const VULKAN_HPP_NAMESPACE::SubpassDescription2 * pSubpasses_ ) VULKAN_HPP_NOEXCEPT - { - pSubpasses = pSubpasses_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo2 & - setSubpasses( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & subpasses_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = static_cast( subpasses_.size() ); - pSubpasses = subpasses_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setDependencyCount( uint32_t dependencyCount_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = dependencyCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setPDependencies( const VULKAN_HPP_NAMESPACE::SubpassDependency2 * pDependencies_ ) VULKAN_HPP_NOEXCEPT - { - pDependencies = pDependencies_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo2 & - setDependencies( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & dependencies_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = static_cast( dependencies_.size() ); - pDependencies = dependencies_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setCorrelatedViewMaskCount( uint32_t correlatedViewMaskCount_ ) VULKAN_HPP_NOEXCEPT - { - correlatedViewMaskCount = correlatedViewMaskCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreateInfo2 & setPCorrelatedViewMasks( const uint32_t * pCorrelatedViewMasks_ ) VULKAN_HPP_NOEXCEPT - { - pCorrelatedViewMasks = pCorrelatedViewMasks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassCreateInfo2 & - setCorrelatedViewMasks( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & correlatedViewMasks_ ) VULKAN_HPP_NOEXCEPT - { - correlatedViewMaskCount = static_cast( correlatedViewMasks_.size() ); - pCorrelatedViewMasks = correlatedViewMasks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassCreateInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassCreateInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - attachmentCount, - pAttachments, - subpassCount, - pSubpasses, - dependencyCount, - pDependencies, - correlatedViewMaskCount, - pCorrelatedViewMasks ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassCreateInfo2 const & ) const = default; -#else - bool operator==( RenderPassCreateInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( attachmentCount == rhs.attachmentCount ) && - ( pAttachments == rhs.pAttachments ) && ( subpassCount == rhs.subpassCount ) && ( pSubpasses == rhs.pSubpasses ) && - ( dependencyCount == rhs.dependencyCount ) && ( pDependencies == rhs.pDependencies ) && - ( correlatedViewMaskCount == rhs.correlatedViewMaskCount ) && ( pCorrelatedViewMasks == rhs.pCorrelatedViewMasks ); -# endif - } - - bool operator!=( RenderPassCreateInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassCreateInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPassCreateFlags flags = {}; - uint32_t attachmentCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentDescription2 * pAttachments = {}; - uint32_t subpassCount = {}; - const VULKAN_HPP_NAMESPACE::SubpassDescription2 * pSubpasses = {}; - uint32_t dependencyCount = {}; - const VULKAN_HPP_NAMESPACE::SubpassDependency2 * pDependencies = {}; - uint32_t correlatedViewMaskCount = {}; - const uint32_t * pCorrelatedViewMasks = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassCreateInfo2; - }; - using RenderPassCreateInfo2KHR = RenderPassCreateInfo2; - - struct RenderPassCreationControlEXT - { - using NativeType = VkRenderPassCreationControlEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassCreationControlEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassCreationControlEXT( VULKAN_HPP_NAMESPACE::Bool32 disallowMerging_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , disallowMerging( disallowMerging_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassCreationControlEXT( RenderPassCreationControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationControlEXT( VkRenderPassCreationControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassCreationControlEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassCreationControlEXT & operator=( RenderPassCreationControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationControlEXT & operator=( VkRenderPassCreationControlEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassCreationControlEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreationControlEXT & setDisallowMerging( VULKAN_HPP_NAMESPACE::Bool32 disallowMerging_ ) VULKAN_HPP_NOEXCEPT - { - disallowMerging = disallowMerging_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassCreationControlEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassCreationControlEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, disallowMerging ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassCreationControlEXT const & ) const = default; -#else - bool operator==( RenderPassCreationControlEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( disallowMerging == rhs.disallowMerging ); -# endif - } - - bool operator!=( RenderPassCreationControlEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassCreationControlEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 disallowMerging = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassCreationControlEXT; - }; - - struct RenderPassCreationFeedbackInfoEXT - { - using NativeType = VkRenderPassCreationFeedbackInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassCreationFeedbackInfoEXT( uint32_t postMergeSubpassCount_ = {} ) VULKAN_HPP_NOEXCEPT - : postMergeSubpassCount( postMergeSubpassCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassCreationFeedbackInfoEXT( RenderPassCreationFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationFeedbackInfoEXT( VkRenderPassCreationFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassCreationFeedbackInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassCreationFeedbackInfoEXT & operator=( RenderPassCreationFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationFeedbackInfoEXT & operator=( VkRenderPassCreationFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkRenderPassCreationFeedbackInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassCreationFeedbackInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( postMergeSubpassCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassCreationFeedbackInfoEXT const & ) const = default; -#else - bool operator==( RenderPassCreationFeedbackInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( postMergeSubpassCount == rhs.postMergeSubpassCount ); -# endif - } - - bool operator!=( RenderPassCreationFeedbackInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t postMergeSubpassCount = {}; - }; - - struct RenderPassCreationFeedbackCreateInfoEXT - { - using NativeType = VkRenderPassCreationFeedbackCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassCreationFeedbackCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassCreationFeedbackCreateInfoEXT( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackInfoEXT * pRenderPassFeedback_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pRenderPassFeedback( pRenderPassFeedback_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassCreationFeedbackCreateInfoEXT( RenderPassCreationFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationFeedbackCreateInfoEXT( VkRenderPassCreationFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassCreationFeedbackCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassCreationFeedbackCreateInfoEXT & operator=( RenderPassCreationFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassCreationFeedbackCreateInfoEXT & operator=( VkRenderPassCreationFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassCreationFeedbackCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassCreationFeedbackCreateInfoEXT & - setPRenderPassFeedback( VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackInfoEXT * pRenderPassFeedback_ ) VULKAN_HPP_NOEXCEPT - { - pRenderPassFeedback = pRenderPassFeedback_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassCreationFeedbackCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassCreationFeedbackCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pRenderPassFeedback ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassCreationFeedbackCreateInfoEXT const & ) const = default; -#else - bool operator==( RenderPassCreationFeedbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pRenderPassFeedback == rhs.pRenderPassFeedback ); -# endif - } - - bool operator!=( RenderPassCreationFeedbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassCreationFeedbackCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPassCreationFeedbackInfoEXT * pRenderPassFeedback = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassCreationFeedbackCreateInfoEXT; - }; - - struct RenderPassFragmentDensityMapCreateInfoEXT - { - using NativeType = VkRenderPassFragmentDensityMapCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassFragmentDensityMapCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassFragmentDensityMapCreateInfoEXT( VULKAN_HPP_NAMESPACE::AttachmentReference fragmentDensityMapAttachment_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityMapAttachment( fragmentDensityMapAttachment_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassFragmentDensityMapCreateInfoEXT( RenderPassFragmentDensityMapCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassFragmentDensityMapCreateInfoEXT( VkRenderPassFragmentDensityMapCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassFragmentDensityMapCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassFragmentDensityMapCreateInfoEXT & operator=( RenderPassFragmentDensityMapCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassFragmentDensityMapCreateInfoEXT & operator=( VkRenderPassFragmentDensityMapCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassFragmentDensityMapCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassFragmentDensityMapCreateInfoEXT & - setFragmentDensityMapAttachment( VULKAN_HPP_NAMESPACE::AttachmentReference const & fragmentDensityMapAttachment_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityMapAttachment = fragmentDensityMapAttachment_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassFragmentDensityMapCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassFragmentDensityMapCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityMapAttachment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassFragmentDensityMapCreateInfoEXT const & ) const = default; -#else - bool operator==( RenderPassFragmentDensityMapCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityMapAttachment == rhs.fragmentDensityMapAttachment ); -# endif - } - - bool operator!=( RenderPassFragmentDensityMapCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassFragmentDensityMapCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::AttachmentReference fragmentDensityMapAttachment = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassFragmentDensityMapCreateInfoEXT; - }; - - struct RenderPassInputAttachmentAspectCreateInfo - { - using NativeType = VkRenderPassInputAttachmentAspectCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassInputAttachmentAspectCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassInputAttachmentAspectCreateInfo( uint32_t aspectReferenceCount_ = {}, - const VULKAN_HPP_NAMESPACE::InputAttachmentAspectReference * pAspectReferences_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , aspectReferenceCount( aspectReferenceCount_ ) - , pAspectReferences( pAspectReferences_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassInputAttachmentAspectCreateInfo( RenderPassInputAttachmentAspectCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassInputAttachmentAspectCreateInfo( VkRenderPassInputAttachmentAspectCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassInputAttachmentAspectCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassInputAttachmentAspectCreateInfo( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & aspectReferences_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), aspectReferenceCount( static_cast( aspectReferences_.size() ) ), pAspectReferences( aspectReferences_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassInputAttachmentAspectCreateInfo & operator=( RenderPassInputAttachmentAspectCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassInputAttachmentAspectCreateInfo & operator=( VkRenderPassInputAttachmentAspectCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassInputAttachmentAspectCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassInputAttachmentAspectCreateInfo & setAspectReferenceCount( uint32_t aspectReferenceCount_ ) VULKAN_HPP_NOEXCEPT - { - aspectReferenceCount = aspectReferenceCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassInputAttachmentAspectCreateInfo & - setPAspectReferences( const VULKAN_HPP_NAMESPACE::InputAttachmentAspectReference * pAspectReferences_ ) VULKAN_HPP_NOEXCEPT - { - pAspectReferences = pAspectReferences_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassInputAttachmentAspectCreateInfo & setAspectReferences( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & aspectReferences_ ) VULKAN_HPP_NOEXCEPT - { - aspectReferenceCount = static_cast( aspectReferences_.size() ); - pAspectReferences = aspectReferences_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassInputAttachmentAspectCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassInputAttachmentAspectCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, aspectReferenceCount, pAspectReferences ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassInputAttachmentAspectCreateInfo const & ) const = default; -#else - bool operator==( RenderPassInputAttachmentAspectCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( aspectReferenceCount == rhs.aspectReferenceCount ) && - ( pAspectReferences == rhs.pAspectReferences ); -# endif - } - - bool operator!=( RenderPassInputAttachmentAspectCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassInputAttachmentAspectCreateInfo; - const void * pNext = {}; - uint32_t aspectReferenceCount = {}; - const VULKAN_HPP_NAMESPACE::InputAttachmentAspectReference * pAspectReferences = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassInputAttachmentAspectCreateInfo; - }; - using RenderPassInputAttachmentAspectCreateInfoKHR = RenderPassInputAttachmentAspectCreateInfo; - - struct RenderPassMultiviewCreateInfo - { - using NativeType = VkRenderPassMultiviewCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassMultiviewCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassMultiviewCreateInfo( uint32_t subpassCount_ = {}, - const uint32_t * pViewMasks_ = {}, - uint32_t dependencyCount_ = {}, - const int32_t * pViewOffsets_ = {}, - uint32_t correlationMaskCount_ = {}, - const uint32_t * pCorrelationMasks_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subpassCount( subpassCount_ ) - , pViewMasks( pViewMasks_ ) - , dependencyCount( dependencyCount_ ) - , pViewOffsets( pViewOffsets_ ) - , correlationMaskCount( correlationMaskCount_ ) - , pCorrelationMasks( pCorrelationMasks_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassMultiviewCreateInfo( RenderPassMultiviewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassMultiviewCreateInfo( VkRenderPassMultiviewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassMultiviewCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassMultiviewCreateInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewMasks_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewOffsets_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & correlationMasks_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , subpassCount( static_cast( viewMasks_.size() ) ) - , pViewMasks( viewMasks_.data() ) - , dependencyCount( static_cast( viewOffsets_.size() ) ) - , pViewOffsets( viewOffsets_.data() ) - , correlationMaskCount( static_cast( correlationMasks_.size() ) ) - , pCorrelationMasks( correlationMasks_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassMultiviewCreateInfo & operator=( RenderPassMultiviewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassMultiviewCreateInfo & operator=( VkRenderPassMultiviewCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setSubpassCount( uint32_t subpassCount_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = subpassCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setPViewMasks( const uint32_t * pViewMasks_ ) VULKAN_HPP_NOEXCEPT - { - pViewMasks = pViewMasks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassMultiviewCreateInfo & setViewMasks( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewMasks_ ) VULKAN_HPP_NOEXCEPT - { - subpassCount = static_cast( viewMasks_.size() ); - pViewMasks = viewMasks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setDependencyCount( uint32_t dependencyCount_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = dependencyCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setPViewOffsets( const int32_t * pViewOffsets_ ) VULKAN_HPP_NOEXCEPT - { - pViewOffsets = pViewOffsets_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassMultiviewCreateInfo & setViewOffsets( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & viewOffsets_ ) VULKAN_HPP_NOEXCEPT - { - dependencyCount = static_cast( viewOffsets_.size() ); - pViewOffsets = viewOffsets_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setCorrelationMaskCount( uint32_t correlationMaskCount_ ) VULKAN_HPP_NOEXCEPT - { - correlationMaskCount = correlationMaskCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassMultiviewCreateInfo & setPCorrelationMasks( const uint32_t * pCorrelationMasks_ ) VULKAN_HPP_NOEXCEPT - { - pCorrelationMasks = pCorrelationMasks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassMultiviewCreateInfo & - setCorrelationMasks( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & correlationMasks_ ) VULKAN_HPP_NOEXCEPT - { - correlationMaskCount = static_cast( correlationMasks_.size() ); - pCorrelationMasks = correlationMasks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassMultiviewCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassMultiviewCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subpassCount, pViewMasks, dependencyCount, pViewOffsets, correlationMaskCount, pCorrelationMasks ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassMultiviewCreateInfo const & ) const = default; -#else - bool operator==( RenderPassMultiviewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subpassCount == rhs.subpassCount ) && ( pViewMasks == rhs.pViewMasks ) && - ( dependencyCount == rhs.dependencyCount ) && ( pViewOffsets == rhs.pViewOffsets ) && ( correlationMaskCount == rhs.correlationMaskCount ) && - ( pCorrelationMasks == rhs.pCorrelationMasks ); -# endif - } - - bool operator!=( RenderPassMultiviewCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassMultiviewCreateInfo; - const void * pNext = {}; - uint32_t subpassCount = {}; - const uint32_t * pViewMasks = {}; - uint32_t dependencyCount = {}; - const int32_t * pViewOffsets = {}; - uint32_t correlationMaskCount = {}; - const uint32_t * pCorrelationMasks = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassMultiviewCreateInfo; - }; - using RenderPassMultiviewCreateInfoKHR = RenderPassMultiviewCreateInfo; - - struct SubpassSampleLocationsEXT - { - using NativeType = VkSubpassSampleLocationsEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassSampleLocationsEXT( uint32_t subpassIndex_ = {}, - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo_ = {} ) VULKAN_HPP_NOEXCEPT - : subpassIndex( subpassIndex_ ) - , sampleLocationsInfo( sampleLocationsInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassSampleLocationsEXT( SubpassSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassSampleLocationsEXT( VkSubpassSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SubpassSampleLocationsEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassSampleLocationsEXT & operator=( SubpassSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassSampleLocationsEXT & operator=( VkSubpassSampleLocationsEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassSampleLocationsEXT & setSubpassIndex( uint32_t subpassIndex_ ) VULKAN_HPP_NOEXCEPT - { - subpassIndex = subpassIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassSampleLocationsEXT & - setSampleLocationsInfo( VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT const & sampleLocationsInfo_ ) VULKAN_HPP_NOEXCEPT - { - sampleLocationsInfo = sampleLocationsInfo_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassSampleLocationsEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassSampleLocationsEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( subpassIndex, sampleLocationsInfo ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassSampleLocationsEXT const & ) const = default; -#else - bool operator==( SubpassSampleLocationsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( subpassIndex == rhs.subpassIndex ) && ( sampleLocationsInfo == rhs.sampleLocationsInfo ); -# endif - } - - bool operator!=( SubpassSampleLocationsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t subpassIndex = {}; - VULKAN_HPP_NAMESPACE::SampleLocationsInfoEXT sampleLocationsInfo = {}; - }; - - struct RenderPassSampleLocationsBeginInfoEXT - { - using NativeType = VkRenderPassSampleLocationsBeginInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassSampleLocationsBeginInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - RenderPassSampleLocationsBeginInfoEXT( uint32_t attachmentInitialSampleLocationsCount_ = {}, - const VULKAN_HPP_NAMESPACE::AttachmentSampleLocationsEXT * pAttachmentInitialSampleLocations_ = {}, - uint32_t postSubpassSampleLocationsCount_ = {}, - const VULKAN_HPP_NAMESPACE::SubpassSampleLocationsEXT * pPostSubpassSampleLocations_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , attachmentInitialSampleLocationsCount( attachmentInitialSampleLocationsCount_ ) - , pAttachmentInitialSampleLocations( pAttachmentInitialSampleLocations_ ) - , postSubpassSampleLocationsCount( postSubpassSampleLocationsCount_ ) - , pPostSubpassSampleLocations( pPostSubpassSampleLocations_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassSampleLocationsBeginInfoEXT( RenderPassSampleLocationsBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSampleLocationsBeginInfoEXT( VkRenderPassSampleLocationsBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassSampleLocationsBeginInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassSampleLocationsBeginInfoEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachmentInitialSampleLocations_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & postSubpassSampleLocations_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , attachmentInitialSampleLocationsCount( static_cast( attachmentInitialSampleLocations_.size() ) ) - , pAttachmentInitialSampleLocations( attachmentInitialSampleLocations_.data() ) - , postSubpassSampleLocationsCount( static_cast( postSubpassSampleLocations_.size() ) ) - , pPostSubpassSampleLocations( postSubpassSampleLocations_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassSampleLocationsBeginInfoEXT & operator=( RenderPassSampleLocationsBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSampleLocationsBeginInfoEXT & operator=( VkRenderPassSampleLocationsBeginInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassSampleLocationsBeginInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSampleLocationsBeginInfoEXT & - setAttachmentInitialSampleLocationsCount( uint32_t attachmentInitialSampleLocationsCount_ ) VULKAN_HPP_NOEXCEPT - { - attachmentInitialSampleLocationsCount = attachmentInitialSampleLocationsCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSampleLocationsBeginInfoEXT & - setPAttachmentInitialSampleLocations( const VULKAN_HPP_NAMESPACE::AttachmentSampleLocationsEXT * pAttachmentInitialSampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - pAttachmentInitialSampleLocations = pAttachmentInitialSampleLocations_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassSampleLocationsBeginInfoEXT & setAttachmentInitialSampleLocations( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & attachmentInitialSampleLocations_ ) - VULKAN_HPP_NOEXCEPT - { - attachmentInitialSampleLocationsCount = static_cast( attachmentInitialSampleLocations_.size() ); - pAttachmentInitialSampleLocations = attachmentInitialSampleLocations_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderPassSampleLocationsBeginInfoEXT & - setPostSubpassSampleLocationsCount( uint32_t postSubpassSampleLocationsCount_ ) VULKAN_HPP_NOEXCEPT - { - postSubpassSampleLocationsCount = postSubpassSampleLocationsCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSampleLocationsBeginInfoEXT & - setPPostSubpassSampleLocations( const VULKAN_HPP_NAMESPACE::SubpassSampleLocationsEXT * pPostSubpassSampleLocations_ ) VULKAN_HPP_NOEXCEPT - { - pPostSubpassSampleLocations = pPostSubpassSampleLocations_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderPassSampleLocationsBeginInfoEXT & setPostSubpassSampleLocations( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & postSubpassSampleLocations_ ) - VULKAN_HPP_NOEXCEPT - { - postSubpassSampleLocationsCount = static_cast( postSubpassSampleLocations_.size() ); - pPostSubpassSampleLocations = postSubpassSampleLocations_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassSampleLocationsBeginInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassSampleLocationsBeginInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, attachmentInitialSampleLocationsCount, pAttachmentInitialSampleLocations, postSubpassSampleLocationsCount, pPostSubpassSampleLocations ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassSampleLocationsBeginInfoEXT const & ) const = default; -#else - bool operator==( RenderPassSampleLocationsBeginInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( attachmentInitialSampleLocationsCount == rhs.attachmentInitialSampleLocationsCount ) && - ( pAttachmentInitialSampleLocations == rhs.pAttachmentInitialSampleLocations ) && - ( postSubpassSampleLocationsCount == rhs.postSubpassSampleLocationsCount ) && ( pPostSubpassSampleLocations == rhs.pPostSubpassSampleLocations ); -# endif - } - - bool operator!=( RenderPassSampleLocationsBeginInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassSampleLocationsBeginInfoEXT; - const void * pNext = {}; - uint32_t attachmentInitialSampleLocationsCount = {}; - const VULKAN_HPP_NAMESPACE::AttachmentSampleLocationsEXT * pAttachmentInitialSampleLocations = {}; - uint32_t postSubpassSampleLocationsCount = {}; - const VULKAN_HPP_NAMESPACE::SubpassSampleLocationsEXT * pPostSubpassSampleLocations = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassSampleLocationsBeginInfoEXT; - }; - - struct RenderPassSubpassFeedbackInfoEXT - { - using NativeType = VkRenderPassSubpassFeedbackInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 - RenderPassSubpassFeedbackInfoEXT( VULKAN_HPP_NAMESPACE::SubpassMergeStatusEXT subpassMergeStatus_ = VULKAN_HPP_NAMESPACE::SubpassMergeStatusEXT::eMerged, - std::array const & description_ = {}, - uint32_t postMergeIndex_ = {} ) VULKAN_HPP_NOEXCEPT - : subpassMergeStatus( subpassMergeStatus_ ) - , description( description_ ) - , postMergeIndex( postMergeIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSubpassFeedbackInfoEXT( RenderPassSubpassFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSubpassFeedbackInfoEXT( VkRenderPassSubpassFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassSubpassFeedbackInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassSubpassFeedbackInfoEXT & operator=( RenderPassSubpassFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSubpassFeedbackInfoEXT & operator=( VkRenderPassSubpassFeedbackInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkRenderPassSubpassFeedbackInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassSubpassFeedbackInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple const &, uint32_t const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( subpassMergeStatus, description, postMergeIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassSubpassFeedbackInfoEXT const & ) const = default; -#else - bool operator==( RenderPassSubpassFeedbackInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( subpassMergeStatus == rhs.subpassMergeStatus ) && ( description == rhs.description ) && ( postMergeIndex == rhs.postMergeIndex ); -# endif - } - - bool operator!=( RenderPassSubpassFeedbackInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::SubpassMergeStatusEXT subpassMergeStatus = VULKAN_HPP_NAMESPACE::SubpassMergeStatusEXT::eMerged; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D description = {}; - uint32_t postMergeIndex = {}; - }; - - struct RenderPassSubpassFeedbackCreateInfoEXT - { - using NativeType = VkRenderPassSubpassFeedbackCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassSubpassFeedbackCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassSubpassFeedbackCreateInfoEXT( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackInfoEXT * pSubpassFeedback_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pSubpassFeedback( pSubpassFeedback_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSubpassFeedbackCreateInfoEXT( RenderPassSubpassFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSubpassFeedbackCreateInfoEXT( VkRenderPassSubpassFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassSubpassFeedbackCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassSubpassFeedbackCreateInfoEXT & operator=( RenderPassSubpassFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassSubpassFeedbackCreateInfoEXT & operator=( VkRenderPassSubpassFeedbackCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassSubpassFeedbackCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassSubpassFeedbackCreateInfoEXT & - setPSubpassFeedback( VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackInfoEXT * pSubpassFeedback_ ) VULKAN_HPP_NOEXCEPT - { - pSubpassFeedback = pSubpassFeedback_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassSubpassFeedbackCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassSubpassFeedbackCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pSubpassFeedback ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassSubpassFeedbackCreateInfoEXT const & ) const = default; -#else - bool operator==( RenderPassSubpassFeedbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pSubpassFeedback == rhs.pSubpassFeedback ); -# endif - } - - bool operator!=( RenderPassSubpassFeedbackCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassSubpassFeedbackCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPassSubpassFeedbackInfoEXT * pSubpassFeedback = {}; - }; - - template <> - struct CppType - { - using Type = RenderPassSubpassFeedbackCreateInfoEXT; - }; - - struct RenderPassTransformBeginInfoQCOM - { - using NativeType = VkRenderPassTransformBeginInfoQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderPassTransformBeginInfoQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR RenderPassTransformBeginInfoQCOM( - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , transform( transform_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderPassTransformBeginInfoQCOM( RenderPassTransformBeginInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassTransformBeginInfoQCOM( VkRenderPassTransformBeginInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderPassTransformBeginInfoQCOM( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderPassTransformBeginInfoQCOM & operator=( RenderPassTransformBeginInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderPassTransformBeginInfoQCOM & operator=( VkRenderPassTransformBeginInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderPassTransformBeginInfoQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderPassTransformBeginInfoQCOM & setTransform( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform_ ) VULKAN_HPP_NOEXCEPT - { - transform = transform_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderPassTransformBeginInfoQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderPassTransformBeginInfoQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, transform ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderPassTransformBeginInfoQCOM const & ) const = default; -#else - bool operator==( RenderPassTransformBeginInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( transform == rhs.transform ); -# endif - } - - bool operator!=( RenderPassTransformBeginInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderPassTransformBeginInfoQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR transform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - }; - - template <> - struct CppType - { - using Type = RenderPassTransformBeginInfoQCOM; - }; - - struct RenderingAttachmentInfo - { - using NativeType = VkRenderingAttachmentInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderingAttachmentInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo( VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::ResolveModeFlagBits resolveMode_ = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone, - VULKAN_HPP_NAMESPACE::ImageView resolveImageView_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout resolveImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad, - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore, - VULKAN_HPP_NAMESPACE::ClearValue clearValue_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageView( imageView_ ) - , imageLayout( imageLayout_ ) - , resolveMode( resolveMode_ ) - , resolveImageView( resolveImageView_ ) - , resolveImageLayout( resolveImageLayout_ ) - , loadOp( loadOp_ ) - , storeOp( storeOp_ ) - , clearValue( clearValue_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo( RenderingAttachmentInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingAttachmentInfo( VkRenderingAttachmentInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderingAttachmentInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderingAttachmentInfo & operator=( RenderingAttachmentInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingAttachmentInfo & operator=( VkRenderingAttachmentInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ ) VULKAN_HPP_NOEXCEPT - { - imageLayout = imageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setResolveMode( VULKAN_HPP_NAMESPACE::ResolveModeFlagBits resolveMode_ ) VULKAN_HPP_NOEXCEPT - { - resolveMode = resolveMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setResolveImageView( VULKAN_HPP_NAMESPACE::ImageView resolveImageView_ ) VULKAN_HPP_NOEXCEPT - { - resolveImageView = resolveImageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setResolveImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout resolveImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - resolveImageLayout = resolveImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setLoadOp( VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp_ ) VULKAN_HPP_NOEXCEPT - { - loadOp = loadOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setStoreOp( VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp_ ) VULKAN_HPP_NOEXCEPT - { - storeOp = storeOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingAttachmentInfo & setClearValue( VULKAN_HPP_NAMESPACE::ClearValue const & clearValue_ ) VULKAN_HPP_NOEXCEPT - { - clearValue = clearValue_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderingAttachmentInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderingAttachmentInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageView, imageLayout, resolveMode, resolveImageView, resolveImageLayout, loadOp, storeOp, clearValue ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderingAttachmentInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::ResolveModeFlagBits resolveMode = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone; - VULKAN_HPP_NAMESPACE::ImageView resolveImageView = {}; - VULKAN_HPP_NAMESPACE::ImageLayout resolveImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::AttachmentLoadOp loadOp = VULKAN_HPP_NAMESPACE::AttachmentLoadOp::eLoad; - VULKAN_HPP_NAMESPACE::AttachmentStoreOp storeOp = VULKAN_HPP_NAMESPACE::AttachmentStoreOp::eStore; - VULKAN_HPP_NAMESPACE::ClearValue clearValue = {}; - }; - - template <> - struct CppType - { - using Type = RenderingAttachmentInfo; - }; - using RenderingAttachmentInfoKHR = RenderingAttachmentInfo; - - struct RenderingFragmentDensityMapAttachmentInfoEXT - { - using NativeType = VkRenderingFragmentDensityMapAttachmentInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderingFragmentDensityMapAttachmentInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - RenderingFragmentDensityMapAttachmentInfoEXT( VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageView( imageView_ ) - , imageLayout( imageLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR RenderingFragmentDensityMapAttachmentInfoEXT( RenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingFragmentDensityMapAttachmentInfoEXT( VkRenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderingFragmentDensityMapAttachmentInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderingFragmentDensityMapAttachmentInfoEXT & operator=( RenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingFragmentDensityMapAttachmentInfoEXT & operator=( VkRenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentDensityMapAttachmentInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentDensityMapAttachmentInfoEXT & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentDensityMapAttachmentInfoEXT & setImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ ) VULKAN_HPP_NOEXCEPT - { - imageLayout = imageLayout_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderingFragmentDensityMapAttachmentInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderingFragmentDensityMapAttachmentInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageView, imageLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderingFragmentDensityMapAttachmentInfoEXT const & ) const = default; -#else - bool operator==( RenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageView == rhs.imageView ) && ( imageLayout == rhs.imageLayout ); -# endif - } - - bool operator!=( RenderingFragmentDensityMapAttachmentInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderingFragmentDensityMapAttachmentInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - }; - - template <> - struct CppType - { - using Type = RenderingFragmentDensityMapAttachmentInfoEXT; - }; - - struct RenderingFragmentShadingRateAttachmentInfoKHR - { - using NativeType = VkRenderingFragmentShadingRateAttachmentInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderingFragmentShadingRateAttachmentInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - RenderingFragmentShadingRateAttachmentInfoKHR( VULKAN_HPP_NAMESPACE::ImageView imageView_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::Extent2D shadingRateAttachmentTexelSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , imageView( imageView_ ) - , imageLayout( imageLayout_ ) - , shadingRateAttachmentTexelSize( shadingRateAttachmentTexelSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR - RenderingFragmentShadingRateAttachmentInfoKHR( RenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingFragmentShadingRateAttachmentInfoKHR( VkRenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : RenderingFragmentShadingRateAttachmentInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderingFragmentShadingRateAttachmentInfoKHR & operator=( RenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingFragmentShadingRateAttachmentInfoKHR & operator=( VkRenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentShadingRateAttachmentInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentShadingRateAttachmentInfoKHR & setImageView( VULKAN_HPP_NAMESPACE::ImageView imageView_ ) VULKAN_HPP_NOEXCEPT - { - imageView = imageView_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentShadingRateAttachmentInfoKHR & setImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout imageLayout_ ) VULKAN_HPP_NOEXCEPT - { - imageLayout = imageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingFragmentShadingRateAttachmentInfoKHR & - setShadingRateAttachmentTexelSize( VULKAN_HPP_NAMESPACE::Extent2D const & shadingRateAttachmentTexelSize_ ) VULKAN_HPP_NOEXCEPT - { - shadingRateAttachmentTexelSize = shadingRateAttachmentTexelSize_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderingFragmentShadingRateAttachmentInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderingFragmentShadingRateAttachmentInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, imageView, imageLayout, shadingRateAttachmentTexelSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderingFragmentShadingRateAttachmentInfoKHR const & ) const = default; -#else - bool operator==( RenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( imageView == rhs.imageView ) && ( imageLayout == rhs.imageLayout ) && - ( shadingRateAttachmentTexelSize == rhs.shadingRateAttachmentTexelSize ); -# endif - } - - bool operator!=( RenderingFragmentShadingRateAttachmentInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderingFragmentShadingRateAttachmentInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageView imageView = {}; - VULKAN_HPP_NAMESPACE::ImageLayout imageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::Extent2D shadingRateAttachmentTexelSize = {}; - }; - - template <> - struct CppType - { - using Type = RenderingFragmentShadingRateAttachmentInfoKHR; - }; - - struct RenderingInfo - { - using NativeType = VkRenderingInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eRenderingInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 RenderingInfo( VULKAN_HPP_NAMESPACE::RenderingFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Rect2D renderArea_ = {}, - uint32_t layerCount_ = {}, - uint32_t viewMask_ = {}, - uint32_t colorAttachmentCount_ = {}, - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pColorAttachments_ = {}, - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pDepthAttachment_ = {}, - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pStencilAttachment_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , renderArea( renderArea_ ) - , layerCount( layerCount_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( colorAttachmentCount_ ) - , pColorAttachments( pColorAttachments_ ) - , pDepthAttachment( pDepthAttachment_ ) - , pStencilAttachment( pStencilAttachment_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo( RenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingInfo( VkRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT : RenderingInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderingInfo( VULKAN_HPP_NAMESPACE::RenderingFlags flags_, - VULKAN_HPP_NAMESPACE::Rect2D renderArea_, - uint32_t layerCount_, - uint32_t viewMask_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_, - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pDepthAttachment_ = {}, - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pStencilAttachment_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , renderArea( renderArea_ ) - , layerCount( layerCount_ ) - , viewMask( viewMask_ ) - , colorAttachmentCount( static_cast( colorAttachments_.size() ) ) - , pColorAttachments( colorAttachments_.data() ) - , pDepthAttachment( pDepthAttachment_ ) - , pStencilAttachment( pStencilAttachment_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - RenderingInfo & operator=( RenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - RenderingInfo & operator=( VkRenderingInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setFlags( VULKAN_HPP_NAMESPACE::RenderingFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setRenderArea( VULKAN_HPP_NAMESPACE::Rect2D const & renderArea_ ) VULKAN_HPP_NOEXCEPT - { - renderArea = renderArea_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setLayerCount( uint32_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setViewMask( uint32_t viewMask_ ) VULKAN_HPP_NOEXCEPT - { - viewMask = viewMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setColorAttachmentCount( uint32_t colorAttachmentCount_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = colorAttachmentCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setPColorAttachments( const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pColorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - pColorAttachments = pColorAttachments_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - RenderingInfo & setColorAttachments( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & colorAttachments_ ) VULKAN_HPP_NOEXCEPT - { - colorAttachmentCount = static_cast( colorAttachments_.size() ); - pColorAttachments = colorAttachments_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & setPDepthAttachment( const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pDepthAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pDepthAttachment = pDepthAttachment_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 RenderingInfo & - setPStencilAttachment( const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pStencilAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pStencilAttachment = pStencilAttachment_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkRenderingInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkRenderingInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, renderArea, layerCount, viewMask, colorAttachmentCount, pColorAttachments, pDepthAttachment, pStencilAttachment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( RenderingInfo const & ) const = default; -#else - bool operator==( RenderingInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( renderArea == rhs.renderArea ) && - ( layerCount == rhs.layerCount ) && ( viewMask == rhs.viewMask ) && ( colorAttachmentCount == rhs.colorAttachmentCount ) && - ( pColorAttachments == rhs.pColorAttachments ) && ( pDepthAttachment == rhs.pDepthAttachment ) && ( pStencilAttachment == rhs.pStencilAttachment ); -# endif - } - - bool operator!=( RenderingInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eRenderingInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderingFlags flags = {}; - VULKAN_HPP_NAMESPACE::Rect2D renderArea = {}; - uint32_t layerCount = {}; - uint32_t viewMask = {}; - uint32_t colorAttachmentCount = {}; - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pColorAttachments = {}; - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pDepthAttachment = {}; - const VULKAN_HPP_NAMESPACE::RenderingAttachmentInfo * pStencilAttachment = {}; - }; - - template <> - struct CppType - { - using Type = RenderingInfo; - }; - using RenderingInfoKHR = RenderingInfo; - - struct ResolveImageInfo2 - { - using NativeType = VkResolveImageInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eResolveImageInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ResolveImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - VULKAN_HPP_NAMESPACE::Image dstImage_ = {}, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined, - uint32_t regionCount_ = {}, - const VULKAN_HPP_NAMESPACE::ImageResolve2 * pRegions_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( regionCount_ ) - , pRegions( pRegions_ ) - { - } - - VULKAN_HPP_CONSTEXPR ResolveImageInfo2( ResolveImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ResolveImageInfo2( VkResolveImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : ResolveImageInfo2( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ResolveImageInfo2( VULKAN_HPP_NAMESPACE::Image srcImage_, - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_, - VULKAN_HPP_NAMESPACE::Image dstImage_, - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , srcImage( srcImage_ ) - , srcImageLayout( srcImageLayout_ ) - , dstImage( dstImage_ ) - , dstImageLayout( dstImageLayout_ ) - , regionCount( static_cast( regions_.size() ) ) - , pRegions( regions_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ResolveImageInfo2 & operator=( ResolveImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ResolveImageInfo2 & operator=( VkResolveImageInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setSrcImage( VULKAN_HPP_NAMESPACE::Image srcImage_ ) VULKAN_HPP_NOEXCEPT - { - srcImage = srcImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setSrcImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - srcImageLayout = srcImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setDstImage( VULKAN_HPP_NAMESPACE::Image dstImage_ ) VULKAN_HPP_NOEXCEPT - { - dstImage = dstImage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setDstImageLayout( VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout_ ) VULKAN_HPP_NOEXCEPT - { - dstImageLayout = dstImageLayout_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setRegionCount( uint32_t regionCount_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = regionCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ResolveImageInfo2 & setPRegions( const VULKAN_HPP_NAMESPACE::ImageResolve2 * pRegions_ ) VULKAN_HPP_NOEXCEPT - { - pRegions = pRegions_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ResolveImageInfo2 & - setRegions( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & regions_ ) VULKAN_HPP_NOEXCEPT - { - regionCount = static_cast( regions_.size() ); - pRegions = regions_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkResolveImageInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkResolveImageInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, srcImage, srcImageLayout, dstImage, dstImageLayout, regionCount, pRegions ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ResolveImageInfo2 const & ) const = default; -#else - bool operator==( ResolveImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( srcImage == rhs.srcImage ) && ( srcImageLayout == rhs.srcImageLayout ) && - ( dstImage == rhs.dstImage ) && ( dstImageLayout == rhs.dstImageLayout ) && ( regionCount == rhs.regionCount ) && ( pRegions == rhs.pRegions ); -# endif - } - - bool operator!=( ResolveImageInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eResolveImageInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Image srcImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout srcImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - VULKAN_HPP_NAMESPACE::Image dstImage = {}; - VULKAN_HPP_NAMESPACE::ImageLayout dstImageLayout = VULKAN_HPP_NAMESPACE::ImageLayout::eUndefined; - uint32_t regionCount = {}; - const VULKAN_HPP_NAMESPACE::ImageResolve2 * pRegions = {}; - }; - - template <> - struct CppType - { - using Type = ResolveImageInfo2; - }; - using ResolveImageInfo2KHR = ResolveImageInfo2; - - struct SamplerBorderColorComponentMappingCreateInfoEXT - { - using NativeType = VkSamplerBorderColorComponentMappingCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerBorderColorComponentMappingCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SamplerBorderColorComponentMappingCreateInfoEXT( VULKAN_HPP_NAMESPACE::ComponentMapping components_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 srgb_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , components( components_ ) - , srgb( srgb_ ) - { - } - - VULKAN_HPP_CONSTEXPR - SamplerBorderColorComponentMappingCreateInfoEXT( SamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerBorderColorComponentMappingCreateInfoEXT( VkSamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerBorderColorComponentMappingCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerBorderColorComponentMappingCreateInfoEXT & operator=( SamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerBorderColorComponentMappingCreateInfoEXT & operator=( VkSamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerBorderColorComponentMappingCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerBorderColorComponentMappingCreateInfoEXT & - setComponents( VULKAN_HPP_NAMESPACE::ComponentMapping const & components_ ) VULKAN_HPP_NOEXCEPT - { - components = components_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerBorderColorComponentMappingCreateInfoEXT & setSrgb( VULKAN_HPP_NAMESPACE::Bool32 srgb_ ) VULKAN_HPP_NOEXCEPT - { - srgb = srgb_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerBorderColorComponentMappingCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerBorderColorComponentMappingCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, components, srgb ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerBorderColorComponentMappingCreateInfoEXT const & ) const = default; -#else - bool operator==( SamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( components == rhs.components ) && ( srgb == rhs.srgb ); -# endif - } - - bool operator!=( SamplerBorderColorComponentMappingCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerBorderColorComponentMappingCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ComponentMapping components = {}; - VULKAN_HPP_NAMESPACE::Bool32 srgb = {}; - }; - - template <> - struct CppType - { - using Type = SamplerBorderColorComponentMappingCreateInfoEXT; - }; - - struct SamplerCreateInfo - { - using NativeType = VkSamplerCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SamplerCreateInfo( VULKAN_HPP_NAMESPACE::SamplerCreateFlags flags_ = {}, - VULKAN_HPP_NAMESPACE::Filter magFilter_ = VULKAN_HPP_NAMESPACE::Filter::eNearest, - VULKAN_HPP_NAMESPACE::Filter minFilter_ = VULKAN_HPP_NAMESPACE::Filter::eNearest, - VULKAN_HPP_NAMESPACE::SamplerMipmapMode mipmapMode_ = VULKAN_HPP_NAMESPACE::SamplerMipmapMode::eNearest, - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeU_ = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat, - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeV_ = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat, - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeW_ = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat, - float mipLodBias_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 anisotropyEnable_ = {}, - float maxAnisotropy_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 compareEnable_ = {}, - VULKAN_HPP_NAMESPACE::CompareOp compareOp_ = VULKAN_HPP_NAMESPACE::CompareOp::eNever, - float minLod_ = {}, - float maxLod_ = {}, - VULKAN_HPP_NAMESPACE::BorderColor borderColor_ = VULKAN_HPP_NAMESPACE::BorderColor::eFloatTransparentBlack, - VULKAN_HPP_NAMESPACE::Bool32 unnormalizedCoordinates_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , magFilter( magFilter_ ) - , minFilter( minFilter_ ) - , mipmapMode( mipmapMode_ ) - , addressModeU( addressModeU_ ) - , addressModeV( addressModeV_ ) - , addressModeW( addressModeW_ ) - , mipLodBias( mipLodBias_ ) - , anisotropyEnable( anisotropyEnable_ ) - , maxAnisotropy( maxAnisotropy_ ) - , compareEnable( compareEnable_ ) - , compareOp( compareOp_ ) - , minLod( minLod_ ) - , maxLod( maxLod_ ) - , borderColor( borderColor_ ) - , unnormalizedCoordinates( unnormalizedCoordinates_ ) - { - } - - VULKAN_HPP_CONSTEXPR SamplerCreateInfo( SamplerCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerCreateInfo( VkSamplerCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SamplerCreateInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerCreateInfo & operator=( SamplerCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerCreateInfo & operator=( VkSamplerCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::SamplerCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMagFilter( VULKAN_HPP_NAMESPACE::Filter magFilter_ ) VULKAN_HPP_NOEXCEPT - { - magFilter = magFilter_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMinFilter( VULKAN_HPP_NAMESPACE::Filter minFilter_ ) VULKAN_HPP_NOEXCEPT - { - minFilter = minFilter_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMipmapMode( VULKAN_HPP_NAMESPACE::SamplerMipmapMode mipmapMode_ ) VULKAN_HPP_NOEXCEPT - { - mipmapMode = mipmapMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setAddressModeU( VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeU_ ) VULKAN_HPP_NOEXCEPT - { - addressModeU = addressModeU_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setAddressModeV( VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeV_ ) VULKAN_HPP_NOEXCEPT - { - addressModeV = addressModeV_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setAddressModeW( VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeW_ ) VULKAN_HPP_NOEXCEPT - { - addressModeW = addressModeW_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMipLodBias( float mipLodBias_ ) VULKAN_HPP_NOEXCEPT - { - mipLodBias = mipLodBias_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setAnisotropyEnable( VULKAN_HPP_NAMESPACE::Bool32 anisotropyEnable_ ) VULKAN_HPP_NOEXCEPT - { - anisotropyEnable = anisotropyEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMaxAnisotropy( float maxAnisotropy_ ) VULKAN_HPP_NOEXCEPT - { - maxAnisotropy = maxAnisotropy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setCompareEnable( VULKAN_HPP_NAMESPACE::Bool32 compareEnable_ ) VULKAN_HPP_NOEXCEPT - { - compareEnable = compareEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setCompareOp( VULKAN_HPP_NAMESPACE::CompareOp compareOp_ ) VULKAN_HPP_NOEXCEPT - { - compareOp = compareOp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMinLod( float minLod_ ) VULKAN_HPP_NOEXCEPT - { - minLod = minLod_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setMaxLod( float maxLod_ ) VULKAN_HPP_NOEXCEPT - { - maxLod = maxLod_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setBorderColor( VULKAN_HPP_NAMESPACE::BorderColor borderColor_ ) VULKAN_HPP_NOEXCEPT - { - borderColor = borderColor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCreateInfo & setUnnormalizedCoordinates( VULKAN_HPP_NAMESPACE::Bool32 unnormalizedCoordinates_ ) VULKAN_HPP_NOEXCEPT - { - unnormalizedCoordinates = unnormalizedCoordinates_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - magFilter, - minFilter, - mipmapMode, - addressModeU, - addressModeV, - addressModeW, - mipLodBias, - anisotropyEnable, - maxAnisotropy, - compareEnable, - compareOp, - minLod, - maxLod, - borderColor, - unnormalizedCoordinates ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerCreateInfo const & ) const = default; -#else - bool operator==( SamplerCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( magFilter == rhs.magFilter ) && ( minFilter == rhs.minFilter ) && - ( mipmapMode == rhs.mipmapMode ) && ( addressModeU == rhs.addressModeU ) && ( addressModeV == rhs.addressModeV ) && - ( addressModeW == rhs.addressModeW ) && ( mipLodBias == rhs.mipLodBias ) && ( anisotropyEnable == rhs.anisotropyEnable ) && - ( maxAnisotropy == rhs.maxAnisotropy ) && ( compareEnable == rhs.compareEnable ) && ( compareOp == rhs.compareOp ) && ( minLod == rhs.minLod ) && - ( maxLod == rhs.maxLod ) && ( borderColor == rhs.borderColor ) && ( unnormalizedCoordinates == rhs.unnormalizedCoordinates ); -# endif - } - - bool operator!=( SamplerCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SamplerCreateFlags flags = {}; - VULKAN_HPP_NAMESPACE::Filter magFilter = VULKAN_HPP_NAMESPACE::Filter::eNearest; - VULKAN_HPP_NAMESPACE::Filter minFilter = VULKAN_HPP_NAMESPACE::Filter::eNearest; - VULKAN_HPP_NAMESPACE::SamplerMipmapMode mipmapMode = VULKAN_HPP_NAMESPACE::SamplerMipmapMode::eNearest; - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeU = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat; - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeV = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat; - VULKAN_HPP_NAMESPACE::SamplerAddressMode addressModeW = VULKAN_HPP_NAMESPACE::SamplerAddressMode::eRepeat; - float mipLodBias = {}; - VULKAN_HPP_NAMESPACE::Bool32 anisotropyEnable = {}; - float maxAnisotropy = {}; - VULKAN_HPP_NAMESPACE::Bool32 compareEnable = {}; - VULKAN_HPP_NAMESPACE::CompareOp compareOp = VULKAN_HPP_NAMESPACE::CompareOp::eNever; - float minLod = {}; - float maxLod = {}; - VULKAN_HPP_NAMESPACE::BorderColor borderColor = VULKAN_HPP_NAMESPACE::BorderColor::eFloatTransparentBlack; - VULKAN_HPP_NAMESPACE::Bool32 unnormalizedCoordinates = {}; - }; - - template <> - struct CppType - { - using Type = SamplerCreateInfo; - }; - - struct SamplerCustomBorderColorCreateInfoEXT - { - using NativeType = VkSamplerCustomBorderColorCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerCustomBorderColorCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 SamplerCustomBorderColorCreateInfoEXT( VULKAN_HPP_NAMESPACE::ClearColorValue customBorderColor_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , customBorderColor( customBorderColor_ ) - , format( format_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCustomBorderColorCreateInfoEXT( SamplerCustomBorderColorCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerCustomBorderColorCreateInfoEXT( VkSamplerCustomBorderColorCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerCustomBorderColorCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerCustomBorderColorCreateInfoEXT & operator=( SamplerCustomBorderColorCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerCustomBorderColorCreateInfoEXT & operator=( VkSamplerCustomBorderColorCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerCustomBorderColorCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCustomBorderColorCreateInfoEXT & - setCustomBorderColor( VULKAN_HPP_NAMESPACE::ClearColorValue const & customBorderColor_ ) VULKAN_HPP_NOEXCEPT - { - customBorderColor = customBorderColor_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerCustomBorderColorCreateInfoEXT & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerCustomBorderColorCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerCustomBorderColorCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, customBorderColor, format ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerCustomBorderColorCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ClearColorValue customBorderColor = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - }; - - template <> - struct CppType - { - using Type = SamplerCustomBorderColorCreateInfoEXT; - }; - - struct SamplerReductionModeCreateInfo - { - using NativeType = VkSamplerReductionModeCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerReductionModeCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SamplerReductionModeCreateInfo( VULKAN_HPP_NAMESPACE::SamplerReductionMode reductionMode_ = VULKAN_HPP_NAMESPACE::SamplerReductionMode::eWeightedAverage, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , reductionMode( reductionMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR SamplerReductionModeCreateInfo( SamplerReductionModeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerReductionModeCreateInfo( VkSamplerReductionModeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerReductionModeCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerReductionModeCreateInfo & operator=( SamplerReductionModeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerReductionModeCreateInfo & operator=( VkSamplerReductionModeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerReductionModeCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerReductionModeCreateInfo & setReductionMode( VULKAN_HPP_NAMESPACE::SamplerReductionMode reductionMode_ ) VULKAN_HPP_NOEXCEPT - { - reductionMode = reductionMode_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerReductionModeCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerReductionModeCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, reductionMode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerReductionModeCreateInfo const & ) const = default; -#else - bool operator==( SamplerReductionModeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( reductionMode == rhs.reductionMode ); -# endif - } - - bool operator!=( SamplerReductionModeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerReductionModeCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SamplerReductionMode reductionMode = VULKAN_HPP_NAMESPACE::SamplerReductionMode::eWeightedAverage; - }; - - template <> - struct CppType - { - using Type = SamplerReductionModeCreateInfo; - }; - using SamplerReductionModeCreateInfoEXT = SamplerReductionModeCreateInfo; - - struct SamplerYcbcrConversionCreateInfo - { - using NativeType = VkSamplerYcbcrConversionCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerYcbcrConversionCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionCreateInfo( - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion ycbcrModel_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity, - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange ycbcrRange_ = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull, - VULKAN_HPP_NAMESPACE::ComponentMapping components_ = {}, - VULKAN_HPP_NAMESPACE::ChromaLocation xChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - VULKAN_HPP_NAMESPACE::ChromaLocation yChromaOffset_ = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven, - VULKAN_HPP_NAMESPACE::Filter chromaFilter_ = VULKAN_HPP_NAMESPACE::Filter::eNearest, - VULKAN_HPP_NAMESPACE::Bool32 forceExplicitReconstruction_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , ycbcrModel( ycbcrModel_ ) - , ycbcrRange( ycbcrRange_ ) - , components( components_ ) - , xChromaOffset( xChromaOffset_ ) - , yChromaOffset( yChromaOffset_ ) - , chromaFilter( chromaFilter_ ) - , forceExplicitReconstruction( forceExplicitReconstruction_ ) - { - } - - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionCreateInfo( SamplerYcbcrConversionCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionCreateInfo( VkSamplerYcbcrConversionCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerYcbcrConversionCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerYcbcrConversionCreateInfo & operator=( SamplerYcbcrConversionCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionCreateInfo & operator=( VkSamplerYcbcrConversionCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & - setYcbcrModel( VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion ycbcrModel_ ) VULKAN_HPP_NOEXCEPT - { - ycbcrModel = ycbcrModel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setYcbcrRange( VULKAN_HPP_NAMESPACE::SamplerYcbcrRange ycbcrRange_ ) VULKAN_HPP_NOEXCEPT - { - ycbcrRange = ycbcrRange_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setComponents( VULKAN_HPP_NAMESPACE::ComponentMapping const & components_ ) VULKAN_HPP_NOEXCEPT - { - components = components_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setXChromaOffset( VULKAN_HPP_NAMESPACE::ChromaLocation xChromaOffset_ ) VULKAN_HPP_NOEXCEPT - { - xChromaOffset = xChromaOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setYChromaOffset( VULKAN_HPP_NAMESPACE::ChromaLocation yChromaOffset_ ) VULKAN_HPP_NOEXCEPT - { - yChromaOffset = yChromaOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & setChromaFilter( VULKAN_HPP_NAMESPACE::Filter chromaFilter_ ) VULKAN_HPP_NOEXCEPT - { - chromaFilter = chromaFilter_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionCreateInfo & - setForceExplicitReconstruction( VULKAN_HPP_NAMESPACE::Bool32 forceExplicitReconstruction_ ) VULKAN_HPP_NOEXCEPT - { - forceExplicitReconstruction = forceExplicitReconstruction_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerYcbcrConversionCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerYcbcrConversionCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, format, ycbcrModel, ycbcrRange, components, xChromaOffset, yChromaOffset, chromaFilter, forceExplicitReconstruction ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerYcbcrConversionCreateInfo const & ) const = default; -#else - bool operator==( SamplerYcbcrConversionCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( ycbcrModel == rhs.ycbcrModel ) && - ( ycbcrRange == rhs.ycbcrRange ) && ( components == rhs.components ) && ( xChromaOffset == rhs.xChromaOffset ) && - ( yChromaOffset == rhs.yChromaOffset ) && ( chromaFilter == rhs.chromaFilter ) && - ( forceExplicitReconstruction == rhs.forceExplicitReconstruction ); -# endif - } - - bool operator!=( SamplerYcbcrConversionCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerYcbcrConversionCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion ycbcrModel = VULKAN_HPP_NAMESPACE::SamplerYcbcrModelConversion::eRgbIdentity; - VULKAN_HPP_NAMESPACE::SamplerYcbcrRange ycbcrRange = VULKAN_HPP_NAMESPACE::SamplerYcbcrRange::eItuFull; - VULKAN_HPP_NAMESPACE::ComponentMapping components = {}; - VULKAN_HPP_NAMESPACE::ChromaLocation xChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - VULKAN_HPP_NAMESPACE::ChromaLocation yChromaOffset = VULKAN_HPP_NAMESPACE::ChromaLocation::eCositedEven; - VULKAN_HPP_NAMESPACE::Filter chromaFilter = VULKAN_HPP_NAMESPACE::Filter::eNearest; - VULKAN_HPP_NAMESPACE::Bool32 forceExplicitReconstruction = {}; - }; - - template <> - struct CppType - { - using Type = SamplerYcbcrConversionCreateInfo; - }; - using SamplerYcbcrConversionCreateInfoKHR = SamplerYcbcrConversionCreateInfo; - - struct SamplerYcbcrConversionImageFormatProperties - { - using NativeType = VkSamplerYcbcrConversionImageFormatProperties; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerYcbcrConversionImageFormatProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionImageFormatProperties( uint32_t combinedImageSamplerDescriptorCount_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , combinedImageSamplerDescriptorCount( combinedImageSamplerDescriptorCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionImageFormatProperties( SamplerYcbcrConversionImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionImageFormatProperties( VkSamplerYcbcrConversionImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerYcbcrConversionImageFormatProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerYcbcrConversionImageFormatProperties & operator=( SamplerYcbcrConversionImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionImageFormatProperties & operator=( VkSamplerYcbcrConversionImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSamplerYcbcrConversionImageFormatProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerYcbcrConversionImageFormatProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, combinedImageSamplerDescriptorCount ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerYcbcrConversionImageFormatProperties const & ) const = default; -#else - bool operator==( SamplerYcbcrConversionImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( combinedImageSamplerDescriptorCount == rhs.combinedImageSamplerDescriptorCount ); -# endif - } - - bool operator!=( SamplerYcbcrConversionImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerYcbcrConversionImageFormatProperties; - void * pNext = {}; - uint32_t combinedImageSamplerDescriptorCount = {}; - }; - - template <> - struct CppType - { - using Type = SamplerYcbcrConversionImageFormatProperties; - }; - using SamplerYcbcrConversionImageFormatPropertiesKHR = SamplerYcbcrConversionImageFormatProperties; - - struct SamplerYcbcrConversionInfo - { - using NativeType = VkSamplerYcbcrConversionInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSamplerYcbcrConversionInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionInfo( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion conversion_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , conversion( conversion_ ) - { - } - - VULKAN_HPP_CONSTEXPR SamplerYcbcrConversionInfo( SamplerYcbcrConversionInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionInfo( VkSamplerYcbcrConversionInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SamplerYcbcrConversionInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SamplerYcbcrConversionInfo & operator=( SamplerYcbcrConversionInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SamplerYcbcrConversionInfo & operator=( VkSamplerYcbcrConversionInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SamplerYcbcrConversionInfo & setConversion( VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion conversion_ ) VULKAN_HPP_NOEXCEPT - { - conversion = conversion_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSamplerYcbcrConversionInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSamplerYcbcrConversionInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, conversion ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SamplerYcbcrConversionInfo const & ) const = default; -#else - bool operator==( SamplerYcbcrConversionInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( conversion == rhs.conversion ); -# endif - } - - bool operator!=( SamplerYcbcrConversionInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSamplerYcbcrConversionInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SamplerYcbcrConversion conversion = {}; - }; - - template <> - struct CppType - { - using Type = SamplerYcbcrConversionInfo; - }; - using SamplerYcbcrConversionInfoKHR = SamplerYcbcrConversionInfo; - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - struct ScreenSurfaceCreateInfoQNX - { - using NativeType = VkScreenSurfaceCreateInfoQNX; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eScreenSurfaceCreateInfoQNX; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ScreenSurfaceCreateInfoQNX( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateFlagsQNX flags_ = {}, - struct _screen_context * context_ = {}, - struct _screen_window * window_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , context( context_ ) - , window( window_ ) - { - } - - VULKAN_HPP_CONSTEXPR ScreenSurfaceCreateInfoQNX( ScreenSurfaceCreateInfoQNX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ScreenSurfaceCreateInfoQNX( VkScreenSurfaceCreateInfoQNX const & rhs ) VULKAN_HPP_NOEXCEPT - : ScreenSurfaceCreateInfoQNX( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ScreenSurfaceCreateInfoQNX & operator=( ScreenSurfaceCreateInfoQNX const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ScreenSurfaceCreateInfoQNX & operator=( VkScreenSurfaceCreateInfoQNX const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ScreenSurfaceCreateInfoQNX & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ScreenSurfaceCreateInfoQNX & setFlags( VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateFlagsQNX flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ScreenSurfaceCreateInfoQNX & setContext( struct _screen_context * context_ ) VULKAN_HPP_NOEXCEPT - { - context = context_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ScreenSurfaceCreateInfoQNX & setWindow( struct _screen_window * window_ ) VULKAN_HPP_NOEXCEPT - { - window = window_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkScreenSurfaceCreateInfoQNX const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkScreenSurfaceCreateInfoQNX &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, context, window ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ScreenSurfaceCreateInfoQNX const & ) const = default; -# else - bool operator==( ScreenSurfaceCreateInfoQNX const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( context == rhs.context ) && ( window == rhs.window ); -# endif - } - - bool operator!=( ScreenSurfaceCreateInfoQNX const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eScreenSurfaceCreateInfoQNX; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ScreenSurfaceCreateFlagsQNX flags = {}; - struct _screen_context * context = {}; - struct _screen_window * window = {}; - }; - - template <> - struct CppType - { - using Type = ScreenSurfaceCreateInfoQNX; - }; -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - struct SemaphoreCreateInfo - { - using NativeType = VkSemaphoreCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreCreateInfo( VULKAN_HPP_NAMESPACE::SemaphoreCreateFlags flags_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreCreateInfo( SemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreCreateInfo( VkSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SemaphoreCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreCreateInfo & operator=( SemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreCreateInfo & operator=( VkSemaphoreCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::SemaphoreCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreCreateInfo const & ) const = default; -#else - bool operator==( SemaphoreCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( SemaphoreCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SemaphoreCreateFlags flags = {}; - }; - - template <> - struct CppType - { - using Type = SemaphoreCreateInfo; - }; - - struct SemaphoreGetFdInfoKHR - { - using NativeType = VkSemaphoreGetFdInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreGetFdInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreGetFdInfoKHR( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreGetFdInfoKHR( SemaphoreGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetFdInfoKHR( VkSemaphoreGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SemaphoreGetFdInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreGetFdInfoKHR & operator=( SemaphoreGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetFdInfoKHR & operator=( VkSemaphoreGetFdInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetFdInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetFdInfoKHR & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetFdInfoKHR & setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreGetFdInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreGetFdInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, handleType ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreGetFdInfoKHR const & ) const = default; -#else - bool operator==( SemaphoreGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( SemaphoreGetFdInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreGetFdInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = SemaphoreGetFdInfoKHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct SemaphoreGetWin32HandleInfoKHR - { - using NativeType = VkSemaphoreGetWin32HandleInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreGetWin32HandleInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreGetWin32HandleInfoKHR( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreGetWin32HandleInfoKHR( SemaphoreGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetWin32HandleInfoKHR( VkSemaphoreGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SemaphoreGetWin32HandleInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreGetWin32HandleInfoKHR & operator=( SemaphoreGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetWin32HandleInfoKHR & operator=( VkSemaphoreGetWin32HandleInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetWin32HandleInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetWin32HandleInfoKHR & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetWin32HandleInfoKHR & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreGetWin32HandleInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreGetWin32HandleInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, handleType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreGetWin32HandleInfoKHR const & ) const = default; -# else - bool operator==( SemaphoreGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( SemaphoreGetWin32HandleInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreGetWin32HandleInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = SemaphoreGetWin32HandleInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - struct SemaphoreGetZirconHandleInfoFUCHSIA - { - using NativeType = VkSemaphoreGetZirconHandleInfoFUCHSIA; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreGetZirconHandleInfoFUCHSIA; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreGetZirconHandleInfoFUCHSIA( - VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , handleType( handleType_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreGetZirconHandleInfoFUCHSIA( SemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetZirconHandleInfoFUCHSIA( VkSemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - : SemaphoreGetZirconHandleInfoFUCHSIA( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreGetZirconHandleInfoFUCHSIA & operator=( SemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreGetZirconHandleInfoFUCHSIA & operator=( VkSemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetZirconHandleInfoFUCHSIA & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetZirconHandleInfoFUCHSIA & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreGetZirconHandleInfoFUCHSIA & - setHandleType( VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType_ ) VULKAN_HPP_NOEXCEPT - { - handleType = handleType_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreGetZirconHandleInfoFUCHSIA const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreGetZirconHandleInfoFUCHSIA &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, handleType ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreGetZirconHandleInfoFUCHSIA const & ) const = default; -# else - bool operator==( SemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( handleType == rhs.handleType ); -# endif - } - - bool operator!=( SemaphoreGetZirconHandleInfoFUCHSIA const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreGetZirconHandleInfoFUCHSIA; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits handleType = VULKAN_HPP_NAMESPACE::ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd; - }; - - template <> - struct CppType - { - using Type = SemaphoreGetZirconHandleInfoFUCHSIA; - }; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - struct SemaphoreSignalInfo - { - using NativeType = VkSemaphoreSignalInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreSignalInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SemaphoreSignalInfo( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, uint64_t value_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , value( value_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreSignalInfo( SemaphoreSignalInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreSignalInfo( VkSemaphoreSignalInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SemaphoreSignalInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreSignalInfo & operator=( SemaphoreSignalInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreSignalInfo & operator=( VkSemaphoreSignalInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreSignalInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSignalInfo & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSignalInfo & setValue( uint64_t value_ ) VULKAN_HPP_NOEXCEPT - { - value = value_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreSignalInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreSignalInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, value ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreSignalInfo const & ) const = default; -#else - bool operator==( SemaphoreSignalInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( value == rhs.value ); -# endif - } - - bool operator!=( SemaphoreSignalInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreSignalInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - uint64_t value = {}; - }; - - template <> - struct CppType - { - using Type = SemaphoreSignalInfo; - }; - using SemaphoreSignalInfoKHR = SemaphoreSignalInfo; - - struct SemaphoreSubmitInfo - { - using NativeType = VkSemaphoreSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreSubmitInfo( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ = {}, - uint64_t value_ = {}, - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask_ = {}, - uint32_t deviceIndex_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphore( semaphore_ ) - , value( value_ ) - , stageMask( stageMask_ ) - , deviceIndex( deviceIndex_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreSubmitInfo( SemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreSubmitInfo( VkSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SemaphoreSubmitInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreSubmitInfo & operator=( SemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreSubmitInfo & operator=( VkSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreSubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSubmitInfo & setSemaphore( VULKAN_HPP_NAMESPACE::Semaphore semaphore_ ) VULKAN_HPP_NOEXCEPT - { - semaphore = semaphore_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSubmitInfo & setValue( uint64_t value_ ) VULKAN_HPP_NOEXCEPT - { - value = value_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSubmitInfo & setStageMask( VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask_ ) VULKAN_HPP_NOEXCEPT - { - stageMask = stageMask_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreSubmitInfo & setDeviceIndex( uint32_t deviceIndex_ ) VULKAN_HPP_NOEXCEPT - { - deviceIndex = deviceIndex_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphore, value, stageMask, deviceIndex ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreSubmitInfo const & ) const = default; -#else - bool operator==( SemaphoreSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphore == rhs.semaphore ) && ( value == rhs.value ) && ( stageMask == rhs.stageMask ) && - ( deviceIndex == rhs.deviceIndex ); -# endif - } - - bool operator!=( SemaphoreSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreSubmitInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Semaphore semaphore = {}; - uint64_t value = {}; - VULKAN_HPP_NAMESPACE::PipelineStageFlags2 stageMask = {}; - uint32_t deviceIndex = {}; - }; - - template <> - struct CppType - { - using Type = SemaphoreSubmitInfo; - }; - using SemaphoreSubmitInfoKHR = SemaphoreSubmitInfo; - - struct SemaphoreTypeCreateInfo - { - using NativeType = VkSemaphoreTypeCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreTypeCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreTypeCreateInfo( VULKAN_HPP_NAMESPACE::SemaphoreType semaphoreType_ = VULKAN_HPP_NAMESPACE::SemaphoreType::eBinary, - uint64_t initialValue_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , semaphoreType( semaphoreType_ ) - , initialValue( initialValue_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreTypeCreateInfo( SemaphoreTypeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreTypeCreateInfo( VkSemaphoreTypeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : SemaphoreTypeCreateInfo( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreTypeCreateInfo & operator=( SemaphoreTypeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreTypeCreateInfo & operator=( VkSemaphoreTypeCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreTypeCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreTypeCreateInfo & setSemaphoreType( VULKAN_HPP_NAMESPACE::SemaphoreType semaphoreType_ ) VULKAN_HPP_NOEXCEPT - { - semaphoreType = semaphoreType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreTypeCreateInfo & setInitialValue( uint64_t initialValue_ ) VULKAN_HPP_NOEXCEPT - { - initialValue = initialValue_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreTypeCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreTypeCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, semaphoreType, initialValue ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreTypeCreateInfo const & ) const = default; -#else - bool operator==( SemaphoreTypeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( semaphoreType == rhs.semaphoreType ) && ( initialValue == rhs.initialValue ); -# endif - } - - bool operator!=( SemaphoreTypeCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreTypeCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SemaphoreType semaphoreType = VULKAN_HPP_NAMESPACE::SemaphoreType::eBinary; - uint64_t initialValue = {}; - }; - - template <> - struct CppType - { - using Type = SemaphoreTypeCreateInfo; - }; - using SemaphoreTypeCreateInfoKHR = SemaphoreTypeCreateInfo; - - struct SemaphoreWaitInfo - { - using NativeType = VkSemaphoreWaitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSemaphoreWaitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SemaphoreWaitInfo( VULKAN_HPP_NAMESPACE::SemaphoreWaitFlags flags_ = {}, - uint32_t semaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pSemaphores_ = {}, - const uint64_t * pValues_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , semaphoreCount( semaphoreCount_ ) - , pSemaphores( pSemaphores_ ) - , pValues( pValues_ ) - { - } - - VULKAN_HPP_CONSTEXPR SemaphoreWaitInfo( SemaphoreWaitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreWaitInfo( VkSemaphoreWaitInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SemaphoreWaitInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SemaphoreWaitInfo( VULKAN_HPP_NAMESPACE::SemaphoreWaitFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & semaphores_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & values_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , semaphoreCount( static_cast( semaphores_.size() ) ) - , pSemaphores( semaphores_.data() ) - , pValues( values_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( semaphores_.size() == values_.size() ); -# else - if ( semaphores_.size() != values_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::SemaphoreWaitInfo::SemaphoreWaitInfo: semaphores_.size() != values_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SemaphoreWaitInfo & operator=( SemaphoreWaitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SemaphoreWaitInfo & operator=( VkSemaphoreWaitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SemaphoreWaitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreWaitInfo & setFlags( VULKAN_HPP_NAMESPACE::SemaphoreWaitFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreWaitInfo & setSemaphoreCount( uint32_t semaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - semaphoreCount = semaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SemaphoreWaitInfo & setPSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pSemaphores = pSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SemaphoreWaitInfo & - setSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & semaphores_ ) VULKAN_HPP_NOEXCEPT - { - semaphoreCount = static_cast( semaphores_.size() ); - pSemaphores = semaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SemaphoreWaitInfo & setPValues( const uint64_t * pValues_ ) VULKAN_HPP_NOEXCEPT - { - pValues = pValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SemaphoreWaitInfo & setValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & values_ ) VULKAN_HPP_NOEXCEPT - { - semaphoreCount = static_cast( values_.size() ); - pValues = values_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSemaphoreWaitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSemaphoreWaitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, semaphoreCount, pSemaphores, pValues ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SemaphoreWaitInfo const & ) const = default; -#else - bool operator==( SemaphoreWaitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( semaphoreCount == rhs.semaphoreCount ) && - ( pSemaphores == rhs.pSemaphores ) && ( pValues == rhs.pValues ); -# endif - } - - bool operator!=( SemaphoreWaitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSemaphoreWaitInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SemaphoreWaitFlags flags = {}; - uint32_t semaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pSemaphores = {}; - const uint64_t * pValues = {}; - }; - - template <> - struct CppType - { - using Type = SemaphoreWaitInfo; - }; - using SemaphoreWaitInfoKHR = SemaphoreWaitInfo; - - struct SetStateFlagsIndirectCommandNV - { - using NativeType = VkSetStateFlagsIndirectCommandNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SetStateFlagsIndirectCommandNV( uint32_t data_ = {} ) VULKAN_HPP_NOEXCEPT : data( data_ ) {} - - VULKAN_HPP_CONSTEXPR SetStateFlagsIndirectCommandNV( SetStateFlagsIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SetStateFlagsIndirectCommandNV( VkSetStateFlagsIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - : SetStateFlagsIndirectCommandNV( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SetStateFlagsIndirectCommandNV & operator=( SetStateFlagsIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SetStateFlagsIndirectCommandNV & operator=( VkSetStateFlagsIndirectCommandNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SetStateFlagsIndirectCommandNV & setData( uint32_t data_ ) VULKAN_HPP_NOEXCEPT - { - data = data_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSetStateFlagsIndirectCommandNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSetStateFlagsIndirectCommandNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( data ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SetStateFlagsIndirectCommandNV const & ) const = default; -#else - bool operator==( SetStateFlagsIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( data == rhs.data ); -# endif - } - - bool operator!=( SetStateFlagsIndirectCommandNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t data = {}; - }; - - struct ShaderModuleCreateInfo - { - using NativeType = VkShaderModuleCreateInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eShaderModuleCreateInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ShaderModuleCreateInfo( VULKAN_HPP_NAMESPACE::ShaderModuleCreateFlags flags_ = {}, - size_t codeSize_ = {}, - const uint32_t * pCode_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , codeSize( codeSize_ ) - , pCode( pCode_ ) - { - } - - VULKAN_HPP_CONSTEXPR ShaderModuleCreateInfo( ShaderModuleCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleCreateInfo( VkShaderModuleCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : ShaderModuleCreateInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ShaderModuleCreateInfo( VULKAN_HPP_NAMESPACE::ShaderModuleCreateFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & code_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), codeSize( code_.size() * 4 ), pCode( code_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShaderModuleCreateInfo & operator=( ShaderModuleCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleCreateInfo & operator=( VkShaderModuleCreateInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ShaderModuleCreateInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ShaderModuleCreateInfo & setFlags( VULKAN_HPP_NAMESPACE::ShaderModuleCreateFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ShaderModuleCreateInfo & setCodeSize( size_t codeSize_ ) VULKAN_HPP_NOEXCEPT - { - codeSize = codeSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ShaderModuleCreateInfo & setPCode( const uint32_t * pCode_ ) VULKAN_HPP_NOEXCEPT - { - pCode = pCode_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ShaderModuleCreateInfo & setCode( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & code_ ) VULKAN_HPP_NOEXCEPT - { - codeSize = code_.size() * 4; - pCode = code_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkShaderModuleCreateInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShaderModuleCreateInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, codeSize, pCode ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderModuleCreateInfo const & ) const = default; -#else - bool operator==( ShaderModuleCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( codeSize == rhs.codeSize ) && ( pCode == rhs.pCode ); -# endif - } - - bool operator!=( ShaderModuleCreateInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eShaderModuleCreateInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ShaderModuleCreateFlags flags = {}; - size_t codeSize = {}; - const uint32_t * pCode = {}; - }; - - template <> - struct CppType - { - using Type = ShaderModuleCreateInfo; - }; - - struct ShaderModuleIdentifierEXT - { - using NativeType = VkShaderModuleIdentifierEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eShaderModuleIdentifierEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ShaderModuleIdentifierEXT( uint32_t identifierSize_ = {}, - std::array const & identifier_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , identifierSize( identifierSize_ ) - , identifier( identifier_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ShaderModuleIdentifierEXT( ShaderModuleIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleIdentifierEXT( VkShaderModuleIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ShaderModuleIdentifierEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShaderModuleIdentifierEXT & operator=( ShaderModuleIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleIdentifierEXT & operator=( VkShaderModuleIdentifierEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkShaderModuleIdentifierEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShaderModuleIdentifierEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, identifierSize, identifier ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderModuleIdentifierEXT const & ) const = default; -#else - bool operator==( ShaderModuleIdentifierEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( identifierSize == rhs.identifierSize ) && ( identifier == rhs.identifier ); -# endif - } - - bool operator!=( ShaderModuleIdentifierEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eShaderModuleIdentifierEXT; - void * pNext = {}; - uint32_t identifierSize = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D identifier = {}; - }; - - template <> - struct CppType - { - using Type = ShaderModuleIdentifierEXT; - }; - - struct ShaderModuleValidationCacheCreateInfoEXT - { - using NativeType = VkShaderModuleValidationCacheCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eShaderModuleValidationCacheCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ShaderModuleValidationCacheCreateInfoEXT( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , validationCache( validationCache_ ) - { - } - - VULKAN_HPP_CONSTEXPR ShaderModuleValidationCacheCreateInfoEXT( ShaderModuleValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleValidationCacheCreateInfoEXT( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ShaderModuleValidationCacheCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShaderModuleValidationCacheCreateInfoEXT & operator=( ShaderModuleValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderModuleValidationCacheCreateInfoEXT & operator=( VkShaderModuleValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ShaderModuleValidationCacheCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ShaderModuleValidationCacheCreateInfoEXT & - setValidationCache( VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache_ ) VULKAN_HPP_NOEXCEPT - { - validationCache = validationCache_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkShaderModuleValidationCacheCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShaderModuleValidationCacheCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, validationCache ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderModuleValidationCacheCreateInfoEXT const & ) const = default; -#else - bool operator==( ShaderModuleValidationCacheCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( validationCache == rhs.validationCache ); -# endif - } - - bool operator!=( ShaderModuleValidationCacheCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eShaderModuleValidationCacheCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ValidationCacheEXT validationCache = {}; - }; - - template <> - struct CppType - { - using Type = ShaderModuleValidationCacheCreateInfoEXT; - }; - - struct ShaderResourceUsageAMD - { - using NativeType = VkShaderResourceUsageAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ShaderResourceUsageAMD( uint32_t numUsedVgprs_ = {}, - uint32_t numUsedSgprs_ = {}, - uint32_t ldsSizePerLocalWorkGroup_ = {}, - size_t ldsUsageSizeInBytes_ = {}, - size_t scratchMemUsageInBytes_ = {} ) VULKAN_HPP_NOEXCEPT - : numUsedVgprs( numUsedVgprs_ ) - , numUsedSgprs( numUsedSgprs_ ) - , ldsSizePerLocalWorkGroup( ldsSizePerLocalWorkGroup_ ) - , ldsUsageSizeInBytes( ldsUsageSizeInBytes_ ) - , scratchMemUsageInBytes( scratchMemUsageInBytes_ ) - { - } - - VULKAN_HPP_CONSTEXPR ShaderResourceUsageAMD( ShaderResourceUsageAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderResourceUsageAMD( VkShaderResourceUsageAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : ShaderResourceUsageAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShaderResourceUsageAMD & operator=( ShaderResourceUsageAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderResourceUsageAMD & operator=( VkShaderResourceUsageAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkShaderResourceUsageAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShaderResourceUsageAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( numUsedVgprs, numUsedSgprs, ldsSizePerLocalWorkGroup, ldsUsageSizeInBytes, scratchMemUsageInBytes ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderResourceUsageAMD const & ) const = default; -#else - bool operator==( ShaderResourceUsageAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( numUsedVgprs == rhs.numUsedVgprs ) && ( numUsedSgprs == rhs.numUsedSgprs ) && ( ldsSizePerLocalWorkGroup == rhs.ldsSizePerLocalWorkGroup ) && - ( ldsUsageSizeInBytes == rhs.ldsUsageSizeInBytes ) && ( scratchMemUsageInBytes == rhs.scratchMemUsageInBytes ); -# endif - } - - bool operator!=( ShaderResourceUsageAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t numUsedVgprs = {}; - uint32_t numUsedSgprs = {}; - uint32_t ldsSizePerLocalWorkGroup = {}; - size_t ldsUsageSizeInBytes = {}; - size_t scratchMemUsageInBytes = {}; - }; - - struct ShaderStatisticsInfoAMD - { - using NativeType = VkShaderStatisticsInfoAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 ShaderStatisticsInfoAMD( VULKAN_HPP_NAMESPACE::ShaderStageFlags shaderStageMask_ = {}, - VULKAN_HPP_NAMESPACE::ShaderResourceUsageAMD resourceUsage_ = {}, - uint32_t numPhysicalVgprs_ = {}, - uint32_t numPhysicalSgprs_ = {}, - uint32_t numAvailableVgprs_ = {}, - uint32_t numAvailableSgprs_ = {}, - std::array const & computeWorkGroupSize_ = {} ) VULKAN_HPP_NOEXCEPT - : shaderStageMask( shaderStageMask_ ) - , resourceUsage( resourceUsage_ ) - , numPhysicalVgprs( numPhysicalVgprs_ ) - , numPhysicalSgprs( numPhysicalSgprs_ ) - , numAvailableVgprs( numAvailableVgprs_ ) - , numAvailableSgprs( numAvailableSgprs_ ) - , computeWorkGroupSize( computeWorkGroupSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 ShaderStatisticsInfoAMD( ShaderStatisticsInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderStatisticsInfoAMD( VkShaderStatisticsInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : ShaderStatisticsInfoAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ShaderStatisticsInfoAMD & operator=( ShaderStatisticsInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ShaderStatisticsInfoAMD & operator=( VkShaderStatisticsInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkShaderStatisticsInfoAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkShaderStatisticsInfoAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple const &> -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( shaderStageMask, resourceUsage, numPhysicalVgprs, numPhysicalSgprs, numAvailableVgprs, numAvailableSgprs, computeWorkGroupSize ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ShaderStatisticsInfoAMD const & ) const = default; -#else - bool operator==( ShaderStatisticsInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( shaderStageMask == rhs.shaderStageMask ) && ( resourceUsage == rhs.resourceUsage ) && ( numPhysicalVgprs == rhs.numPhysicalVgprs ) && - ( numPhysicalSgprs == rhs.numPhysicalSgprs ) && ( numAvailableVgprs == rhs.numAvailableVgprs ) && ( numAvailableSgprs == rhs.numAvailableSgprs ) && - ( computeWorkGroupSize == rhs.computeWorkGroupSize ); -# endif - } - - bool operator!=( ShaderStatisticsInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ShaderStageFlags shaderStageMask = {}; - VULKAN_HPP_NAMESPACE::ShaderResourceUsageAMD resourceUsage = {}; - uint32_t numPhysicalVgprs = {}; - uint32_t numPhysicalSgprs = {}; - uint32_t numAvailableVgprs = {}; - uint32_t numAvailableSgprs = {}; - VULKAN_HPP_NAMESPACE::ArrayWrapper1D computeWorkGroupSize = {}; - }; - - struct SharedPresentSurfaceCapabilitiesKHR - { - using NativeType = VkSharedPresentSurfaceCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSharedPresentSurfaceCapabilitiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SharedPresentSurfaceCapabilitiesKHR( VULKAN_HPP_NAMESPACE::ImageUsageFlags sharedPresentSupportedUsageFlags_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , sharedPresentSupportedUsageFlags( sharedPresentSupportedUsageFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SharedPresentSurfaceCapabilitiesKHR( SharedPresentSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SharedPresentSurfaceCapabilitiesKHR( VkSharedPresentSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SharedPresentSurfaceCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SharedPresentSurfaceCapabilitiesKHR & operator=( SharedPresentSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SharedPresentSurfaceCapabilitiesKHR & operator=( VkSharedPresentSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSharedPresentSurfaceCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSharedPresentSurfaceCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, sharedPresentSupportedUsageFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SharedPresentSurfaceCapabilitiesKHR const & ) const = default; -#else - bool operator==( SharedPresentSurfaceCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( sharedPresentSupportedUsageFlags == rhs.sharedPresentSupportedUsageFlags ); -# endif - } - - bool operator!=( SharedPresentSurfaceCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSharedPresentSurfaceCapabilitiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags sharedPresentSupportedUsageFlags = {}; - }; - - template <> - struct CppType - { - using Type = SharedPresentSurfaceCapabilitiesKHR; - }; - - struct SparseImageFormatProperties - { - using NativeType = VkSparseImageFormatProperties; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageFormatProperties( VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask_ = {}, - VULKAN_HPP_NAMESPACE::Extent3D imageGranularity_ = {}, - VULKAN_HPP_NAMESPACE::SparseImageFormatFlags flags_ = {} ) VULKAN_HPP_NOEXCEPT - : aspectMask( aspectMask_ ) - , imageGranularity( imageGranularity_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageFormatProperties( SparseImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageFormatProperties( VkSparseImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageFormatProperties( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageFormatProperties & operator=( SparseImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageFormatProperties & operator=( VkSparseImageFormatProperties const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSparseImageFormatProperties const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageFormatProperties &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( aspectMask, imageGranularity, flags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageFormatProperties const & ) const = default; -#else - bool operator==( SparseImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( aspectMask == rhs.aspectMask ) && ( imageGranularity == rhs.imageGranularity ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( SparseImageFormatProperties const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::ImageAspectFlags aspectMask = {}; - VULKAN_HPP_NAMESPACE::Extent3D imageGranularity = {}; - VULKAN_HPP_NAMESPACE::SparseImageFormatFlags flags = {}; - }; - - struct SparseImageFormatProperties2 - { - using NativeType = VkSparseImageFormatProperties2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSparseImageFormatProperties2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageFormatProperties2( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties properties_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , properties( properties_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageFormatProperties2( SparseImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageFormatProperties2( VkSparseImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageFormatProperties2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageFormatProperties2 & operator=( SparseImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageFormatProperties2 & operator=( VkSparseImageFormatProperties2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSparseImageFormatProperties2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageFormatProperties2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, properties ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageFormatProperties2 const & ) const = default; -#else - bool operator==( SparseImageFormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( properties == rhs.properties ); -# endif - } - - bool operator!=( SparseImageFormatProperties2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSparseImageFormatProperties2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties properties = {}; - }; - - template <> - struct CppType - { - using Type = SparseImageFormatProperties2; - }; - using SparseImageFormatProperties2KHR = SparseImageFormatProperties2; - - struct SparseImageMemoryRequirements - { - using NativeType = VkSparseImageMemoryRequirements; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageMemoryRequirements( VULKAN_HPP_NAMESPACE::SparseImageFormatProperties formatProperties_ = {}, - uint32_t imageMipTailFirstLod_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailStride_ = {} ) VULKAN_HPP_NOEXCEPT - : formatProperties( formatProperties_ ) - , imageMipTailFirstLod( imageMipTailFirstLod_ ) - , imageMipTailSize( imageMipTailSize_ ) - , imageMipTailOffset( imageMipTailOffset_ ) - , imageMipTailStride( imageMipTailStride_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageMemoryRequirements( SparseImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryRequirements( VkSparseImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageMemoryRequirements( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageMemoryRequirements & operator=( SparseImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryRequirements & operator=( VkSparseImageMemoryRequirements const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSparseImageMemoryRequirements const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageMemoryRequirements &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( formatProperties, imageMipTailFirstLod, imageMipTailSize, imageMipTailOffset, imageMipTailStride ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageMemoryRequirements const & ) const = default; -#else - bool operator==( SparseImageMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( formatProperties == rhs.formatProperties ) && ( imageMipTailFirstLod == rhs.imageMipTailFirstLod ) && - ( imageMipTailSize == rhs.imageMipTailSize ) && ( imageMipTailOffset == rhs.imageMipTailOffset ) && - ( imageMipTailStride == rhs.imageMipTailStride ); -# endif - } - - bool operator!=( SparseImageMemoryRequirements const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::SparseImageFormatProperties formatProperties = {}; - uint32_t imageMipTailFirstLod = {}; - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize imageMipTailStride = {}; - }; - - struct SparseImageMemoryRequirements2 - { - using NativeType = VkSparseImageMemoryRequirements2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSparseImageMemoryRequirements2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SparseImageMemoryRequirements2( VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements memoryRequirements_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryRequirements( memoryRequirements_ ) - { - } - - VULKAN_HPP_CONSTEXPR SparseImageMemoryRequirements2( SparseImageMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryRequirements2( VkSparseImageMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT - : SparseImageMemoryRequirements2( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SparseImageMemoryRequirements2 & operator=( SparseImageMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SparseImageMemoryRequirements2 & operator=( VkSparseImageMemoryRequirements2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSparseImageMemoryRequirements2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSparseImageMemoryRequirements2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryRequirements ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SparseImageMemoryRequirements2 const & ) const = default; -#else - bool operator==( SparseImageMemoryRequirements2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryRequirements == rhs.memoryRequirements ); -# endif - } - - bool operator!=( SparseImageMemoryRequirements2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSparseImageMemoryRequirements2; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SparseImageMemoryRequirements memoryRequirements = {}; - }; - - template <> - struct CppType - { - using Type = SparseImageMemoryRequirements2; - }; - using SparseImageMemoryRequirements2KHR = SparseImageMemoryRequirements2; - -#if defined( VK_USE_PLATFORM_GGP ) - struct StreamDescriptorSurfaceCreateInfoGGP - { - using NativeType = VkStreamDescriptorSurfaceCreateInfoGGP; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eStreamDescriptorSurfaceCreateInfoGGP; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR StreamDescriptorSurfaceCreateInfoGGP( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateFlagsGGP flags_ = {}, - GgpStreamDescriptor streamDescriptor_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , streamDescriptor( streamDescriptor_ ) - { - } - - VULKAN_HPP_CONSTEXPR StreamDescriptorSurfaceCreateInfoGGP( StreamDescriptorSurfaceCreateInfoGGP const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StreamDescriptorSurfaceCreateInfoGGP( VkStreamDescriptorSurfaceCreateInfoGGP const & rhs ) VULKAN_HPP_NOEXCEPT - : StreamDescriptorSurfaceCreateInfoGGP( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - StreamDescriptorSurfaceCreateInfoGGP & operator=( StreamDescriptorSurfaceCreateInfoGGP const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StreamDescriptorSurfaceCreateInfoGGP & operator=( VkStreamDescriptorSurfaceCreateInfoGGP const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 StreamDescriptorSurfaceCreateInfoGGP & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StreamDescriptorSurfaceCreateInfoGGP & - setFlags( VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateFlagsGGP flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StreamDescriptorSurfaceCreateInfoGGP & setStreamDescriptor( GgpStreamDescriptor streamDescriptor_ ) VULKAN_HPP_NOEXCEPT - { - streamDescriptor = streamDescriptor_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkStreamDescriptorSurfaceCreateInfoGGP const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkStreamDescriptorSurfaceCreateInfoGGP &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, streamDescriptor ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( StreamDescriptorSurfaceCreateInfoGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &streamDescriptor, &rhs.streamDescriptor, sizeof( GgpStreamDescriptor ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( StreamDescriptorSurfaceCreateInfoGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( memcmp( &streamDescriptor, &rhs.streamDescriptor, sizeof( GgpStreamDescriptor ) ) == 0 ); - } - - bool operator!=( StreamDescriptorSurfaceCreateInfoGGP const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eStreamDescriptorSurfaceCreateInfoGGP; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::StreamDescriptorSurfaceCreateFlagsGGP flags = {}; - GgpStreamDescriptor streamDescriptor = {}; - }; - - template <> - struct CppType - { - using Type = StreamDescriptorSurfaceCreateInfoGGP; - }; -#endif /*VK_USE_PLATFORM_GGP*/ - - struct StridedDeviceAddressRegionKHR - { - using NativeType = VkStridedDeviceAddressRegionKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR StridedDeviceAddressRegionKHR( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize stride_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize size_ = {} ) VULKAN_HPP_NOEXCEPT - : deviceAddress( deviceAddress_ ) - , stride( stride_ ) - , size( size_ ) - { - } - - VULKAN_HPP_CONSTEXPR StridedDeviceAddressRegionKHR( StridedDeviceAddressRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StridedDeviceAddressRegionKHR( VkStridedDeviceAddressRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : StridedDeviceAddressRegionKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - StridedDeviceAddressRegionKHR & operator=( StridedDeviceAddressRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - StridedDeviceAddressRegionKHR & operator=( VkStridedDeviceAddressRegionKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 StridedDeviceAddressRegionKHR & setDeviceAddress( VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress_ ) VULKAN_HPP_NOEXCEPT - { - deviceAddress = deviceAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StridedDeviceAddressRegionKHR & setStride( VULKAN_HPP_NAMESPACE::DeviceSize stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 StridedDeviceAddressRegionKHR & setSize( VULKAN_HPP_NAMESPACE::DeviceSize size_ ) VULKAN_HPP_NOEXCEPT - { - size = size_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkStridedDeviceAddressRegionKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkStridedDeviceAddressRegionKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( deviceAddress, stride, size ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( StridedDeviceAddressRegionKHR const & ) const = default; -#else - bool operator==( StridedDeviceAddressRegionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( deviceAddress == rhs.deviceAddress ) && ( stride == rhs.stride ) && ( size == rhs.size ); -# endif - } - - bool operator!=( StridedDeviceAddressRegionKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceAddress deviceAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize stride = {}; - VULKAN_HPP_NAMESPACE::DeviceSize size = {}; - }; - - struct SubmitInfo - { - using NativeType = VkSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubmitInfo( uint32_t waitSemaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ = {}, - const VULKAN_HPP_NAMESPACE::PipelineStageFlags * pWaitDstStageMask_ = {}, - uint32_t commandBufferCount_ = {}, - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers_ = {}, - uint32_t signalSemaphoreCount_ = {}, - const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreCount( waitSemaphoreCount_ ) - , pWaitSemaphores( pWaitSemaphores_ ) - , pWaitDstStageMask( pWaitDstStageMask_ ) - , commandBufferCount( commandBufferCount_ ) - , pCommandBuffers( pCommandBuffers_ ) - , signalSemaphoreCount( signalSemaphoreCount_ ) - , pSignalSemaphores( pSignalSemaphores_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubmitInfo( SubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubmitInfo( VkSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SubmitInfo( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitDstStageMask_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBuffers_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphores_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreCount( static_cast( waitSemaphores_.size() ) ) - , pWaitSemaphores( waitSemaphores_.data() ) - , pWaitDstStageMask( waitDstStageMask_.data() ) - , commandBufferCount( static_cast( commandBuffers_.size() ) ) - , pCommandBuffers( commandBuffers_.data() ) - , signalSemaphoreCount( static_cast( signalSemaphores_.size() ) ) - , pSignalSemaphores( signalSemaphores_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( waitSemaphores_.size() == waitDstStageMask_.size() ); -# else - if ( waitSemaphores_.size() != waitDstStageMask_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING "::SubmitInfo::SubmitInfo: waitSemaphores_.size() != waitDstStageMask_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubmitInfo & operator=( SubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubmitInfo & operator=( VkSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setWaitSemaphoreCount( uint32_t waitSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = waitSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setPWaitSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphores = pWaitSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo & - setWaitSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = static_cast( waitSemaphores_.size() ); - pWaitSemaphores = waitSemaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setPWaitDstStageMask( const VULKAN_HPP_NAMESPACE::PipelineStageFlags * pWaitDstStageMask_ ) VULKAN_HPP_NOEXCEPT - { - pWaitDstStageMask = pWaitDstStageMask_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo & setWaitDstStageMask( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitDstStageMask_ ) - VULKAN_HPP_NOEXCEPT - { - waitSemaphoreCount = static_cast( waitDstStageMask_.size() ); - pWaitDstStageMask = waitDstStageMask_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setCommandBufferCount( uint32_t commandBufferCount_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferCount = commandBufferCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setPCommandBuffers( const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers_ ) VULKAN_HPP_NOEXCEPT - { - pCommandBuffers = pCommandBuffers_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo & - setCommandBuffers( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBuffers_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferCount = static_cast( commandBuffers_.size() ); - pCommandBuffers = commandBuffers_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setSignalSemaphoreCount( uint32_t signalSemaphoreCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = signalSemaphoreCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo & setPSignalSemaphores( const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphores = pSignalSemaphores_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo & - setSignalSemaphores( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphores_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreCount = static_cast( signalSemaphores_.size() ); - pSignalSemaphores = signalSemaphores_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, waitSemaphoreCount, pWaitSemaphores, pWaitDstStageMask, commandBufferCount, pCommandBuffers, signalSemaphoreCount, pSignalSemaphores ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubmitInfo const & ) const = default; -#else - bool operator==( SubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreCount == rhs.waitSemaphoreCount ) && - ( pWaitSemaphores == rhs.pWaitSemaphores ) && ( pWaitDstStageMask == rhs.pWaitDstStageMask ) && ( commandBufferCount == rhs.commandBufferCount ) && - ( pCommandBuffers == rhs.pCommandBuffers ) && ( signalSemaphoreCount == rhs.signalSemaphoreCount ) && - ( pSignalSemaphores == rhs.pSignalSemaphores ); -# endif - } - - bool operator!=( SubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubmitInfo; - const void * pNext = {}; - uint32_t waitSemaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pWaitSemaphores = {}; - const VULKAN_HPP_NAMESPACE::PipelineStageFlags * pWaitDstStageMask = {}; - uint32_t commandBufferCount = {}; - const VULKAN_HPP_NAMESPACE::CommandBuffer * pCommandBuffers = {}; - uint32_t signalSemaphoreCount = {}; - const VULKAN_HPP_NAMESPACE::Semaphore * pSignalSemaphores = {}; - }; - - template <> - struct CppType - { - using Type = SubmitInfo; - }; - - struct SubmitInfo2 - { - using NativeType = VkSubmitInfo2; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubmitInfo2; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubmitInfo2( VULKAN_HPP_NAMESPACE::SubmitFlags flags_ = {}, - uint32_t waitSemaphoreInfoCount_ = {}, - const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pWaitSemaphoreInfos_ = {}, - uint32_t commandBufferInfoCount_ = {}, - const VULKAN_HPP_NAMESPACE::CommandBufferSubmitInfo * pCommandBufferInfos_ = {}, - uint32_t signalSemaphoreInfoCount_ = {}, - const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pSignalSemaphoreInfos_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , waitSemaphoreInfoCount( waitSemaphoreInfoCount_ ) - , pWaitSemaphoreInfos( pWaitSemaphoreInfos_ ) - , commandBufferInfoCount( commandBufferInfoCount_ ) - , pCommandBufferInfos( pCommandBufferInfos_ ) - , signalSemaphoreInfoCount( signalSemaphoreInfoCount_ ) - , pSignalSemaphoreInfos( pSignalSemaphoreInfos_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubmitInfo2( SubmitInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubmitInfo2( VkSubmitInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT : SubmitInfo2( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo2( VULKAN_HPP_NAMESPACE::SubmitFlags flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreInfos_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBufferInfos_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreInfos_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , waitSemaphoreInfoCount( static_cast( waitSemaphoreInfos_.size() ) ) - , pWaitSemaphoreInfos( waitSemaphoreInfos_.data() ) - , commandBufferInfoCount( static_cast( commandBufferInfos_.size() ) ) - , pCommandBufferInfos( commandBufferInfos_.data() ) - , signalSemaphoreInfoCount( static_cast( signalSemaphoreInfos_.size() ) ) - , pSignalSemaphoreInfos( signalSemaphoreInfos_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubmitInfo2 & operator=( SubmitInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubmitInfo2 & operator=( VkSubmitInfo2 const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setFlags( VULKAN_HPP_NAMESPACE::SubmitFlags flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setWaitSemaphoreInfoCount( uint32_t waitSemaphoreInfoCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreInfoCount = waitSemaphoreInfoCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setPWaitSemaphoreInfos( const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pWaitSemaphoreInfos_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphoreInfos = pWaitSemaphoreInfos_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo2 & setWaitSemaphoreInfos( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreInfos_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreInfoCount = static_cast( waitSemaphoreInfos_.size() ); - pWaitSemaphoreInfos = waitSemaphoreInfos_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setCommandBufferInfoCount( uint32_t commandBufferInfoCount_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferInfoCount = commandBufferInfoCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & - setPCommandBufferInfos( const VULKAN_HPP_NAMESPACE::CommandBufferSubmitInfo * pCommandBufferInfos_ ) VULKAN_HPP_NOEXCEPT - { - pCommandBufferInfos = pCommandBufferInfos_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo2 & setCommandBufferInfos( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & commandBufferInfos_ ) VULKAN_HPP_NOEXCEPT - { - commandBufferInfoCount = static_cast( commandBufferInfos_.size() ); - pCommandBufferInfos = commandBufferInfos_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & setSignalSemaphoreInfoCount( uint32_t signalSemaphoreInfoCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreInfoCount = signalSemaphoreInfoCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubmitInfo2 & - setPSignalSemaphoreInfos( const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pSignalSemaphoreInfos_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphoreInfos = pSignalSemaphoreInfos_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubmitInfo2 & setSignalSemaphoreInfos( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreInfos_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreInfoCount = static_cast( signalSemaphoreInfos_.size() ); - pSignalSemaphoreInfos = signalSemaphoreInfos_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubmitInfo2 const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubmitInfo2 &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - waitSemaphoreInfoCount, - pWaitSemaphoreInfos, - commandBufferInfoCount, - pCommandBufferInfos, - signalSemaphoreInfoCount, - pSignalSemaphoreInfos ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubmitInfo2 const & ) const = default; -#else - bool operator==( SubmitInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( waitSemaphoreInfoCount == rhs.waitSemaphoreInfoCount ) && - ( pWaitSemaphoreInfos == rhs.pWaitSemaphoreInfos ) && ( commandBufferInfoCount == rhs.commandBufferInfoCount ) && - ( pCommandBufferInfos == rhs.pCommandBufferInfos ) && ( signalSemaphoreInfoCount == rhs.signalSemaphoreInfoCount ) && - ( pSignalSemaphoreInfos == rhs.pSignalSemaphoreInfos ); -# endif - } - - bool operator!=( SubmitInfo2 const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubmitInfo2; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SubmitFlags flags = {}; - uint32_t waitSemaphoreInfoCount = {}; - const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pWaitSemaphoreInfos = {}; - uint32_t commandBufferInfoCount = {}; - const VULKAN_HPP_NAMESPACE::CommandBufferSubmitInfo * pCommandBufferInfos = {}; - uint32_t signalSemaphoreInfoCount = {}; - const VULKAN_HPP_NAMESPACE::SemaphoreSubmitInfo * pSignalSemaphoreInfos = {}; - }; - - template <> - struct CppType - { - using Type = SubmitInfo2; - }; - using SubmitInfo2KHR = SubmitInfo2; - - struct SubpassBeginInfo - { - using NativeType = VkSubpassBeginInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassBeginInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassBeginInfo( VULKAN_HPP_NAMESPACE::SubpassContents contents_ = VULKAN_HPP_NAMESPACE::SubpassContents::eInline, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , contents( contents_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassBeginInfo( SubpassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassBeginInfo( VkSubpassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassBeginInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassBeginInfo & operator=( SubpassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassBeginInfo & operator=( VkSubpassBeginInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassBeginInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassBeginInfo & setContents( VULKAN_HPP_NAMESPACE::SubpassContents contents_ ) VULKAN_HPP_NOEXCEPT - { - contents = contents_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassBeginInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassBeginInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, contents ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassBeginInfo const & ) const = default; -#else - bool operator==( SubpassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( contents == rhs.contents ); -# endif - } - - bool operator!=( SubpassBeginInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassBeginInfo; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SubpassContents contents = VULKAN_HPP_NAMESPACE::SubpassContents::eInline; - }; - - template <> - struct CppType - { - using Type = SubpassBeginInfo; - }; - using SubpassBeginInfoKHR = SubpassBeginInfo; - - struct SubpassDescriptionDepthStencilResolve - { - using NativeType = VkSubpassDescriptionDepthStencilResolve; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassDescriptionDepthStencilResolve; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SubpassDescriptionDepthStencilResolve( VULKAN_HPP_NAMESPACE::ResolveModeFlagBits depthResolveMode_ = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone, - VULKAN_HPP_NAMESPACE::ResolveModeFlagBits stencilResolveMode_ = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone, - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilResolveAttachment_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , depthResolveMode( depthResolveMode_ ) - , stencilResolveMode( stencilResolveMode_ ) - , pDepthStencilResolveAttachment( pDepthStencilResolveAttachment_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassDescriptionDepthStencilResolve( SubpassDescriptionDepthStencilResolve const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescriptionDepthStencilResolve( VkSubpassDescriptionDepthStencilResolve const & rhs ) VULKAN_HPP_NOEXCEPT - : SubpassDescriptionDepthStencilResolve( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassDescriptionDepthStencilResolve & operator=( SubpassDescriptionDepthStencilResolve const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassDescriptionDepthStencilResolve & operator=( VkSubpassDescriptionDepthStencilResolve const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassDescriptionDepthStencilResolve & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescriptionDepthStencilResolve & - setDepthResolveMode( VULKAN_HPP_NAMESPACE::ResolveModeFlagBits depthResolveMode_ ) VULKAN_HPP_NOEXCEPT - { - depthResolveMode = depthResolveMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescriptionDepthStencilResolve & - setStencilResolveMode( VULKAN_HPP_NAMESPACE::ResolveModeFlagBits stencilResolveMode_ ) VULKAN_HPP_NOEXCEPT - { - stencilResolveMode = stencilResolveMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassDescriptionDepthStencilResolve & - setPDepthStencilResolveAttachment( const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilResolveAttachment_ ) VULKAN_HPP_NOEXCEPT - { - pDepthStencilResolveAttachment = pDepthStencilResolveAttachment_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassDescriptionDepthStencilResolve const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassDescriptionDepthStencilResolve &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, depthResolveMode, stencilResolveMode, pDepthStencilResolveAttachment ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassDescriptionDepthStencilResolve const & ) const = default; -#else - bool operator==( SubpassDescriptionDepthStencilResolve const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( depthResolveMode == rhs.depthResolveMode ) && - ( stencilResolveMode == rhs.stencilResolveMode ) && ( pDepthStencilResolveAttachment == rhs.pDepthStencilResolveAttachment ); -# endif - } - - bool operator!=( SubpassDescriptionDepthStencilResolve const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassDescriptionDepthStencilResolve; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ResolveModeFlagBits depthResolveMode = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone; - VULKAN_HPP_NAMESPACE::ResolveModeFlagBits stencilResolveMode = VULKAN_HPP_NAMESPACE::ResolveModeFlagBits::eNone; - const VULKAN_HPP_NAMESPACE::AttachmentReference2 * pDepthStencilResolveAttachment = {}; - }; - - template <> - struct CppType - { - using Type = SubpassDescriptionDepthStencilResolve; - }; - using SubpassDescriptionDepthStencilResolveKHR = SubpassDescriptionDepthStencilResolve; - - struct SubpassEndInfo - { - using NativeType = VkSubpassEndInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassEndInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassEndInfo( const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT : pNext( pNext_ ) {} - - VULKAN_HPP_CONSTEXPR SubpassEndInfo( SubpassEndInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassEndInfo( VkSubpassEndInfo const & rhs ) VULKAN_HPP_NOEXCEPT : SubpassEndInfo( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassEndInfo & operator=( SubpassEndInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassEndInfo & operator=( VkSubpassEndInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassEndInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassEndInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassEndInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassEndInfo const & ) const = default; -#else - bool operator==( SubpassEndInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ); -# endif - } - - bool operator!=( SubpassEndInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassEndInfo; - const void * pNext = {}; - }; - - template <> - struct CppType - { - using Type = SubpassEndInfo; - }; - using SubpassEndInfoKHR = SubpassEndInfo; - - struct SubpassFragmentDensityMapOffsetEndInfoQCOM - { - using NativeType = VkSubpassFragmentDensityMapOffsetEndInfoQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassFragmentDensityMapOffsetEndInfoQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassFragmentDensityMapOffsetEndInfoQCOM( uint32_t fragmentDensityOffsetCount_ = {}, - const VULKAN_HPP_NAMESPACE::Offset2D * pFragmentDensityOffsets_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fragmentDensityOffsetCount( fragmentDensityOffsetCount_ ) - , pFragmentDensityOffsets( pFragmentDensityOffsets_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassFragmentDensityMapOffsetEndInfoQCOM( SubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassFragmentDensityMapOffsetEndInfoQCOM( VkSubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - : SubpassFragmentDensityMapOffsetEndInfoQCOM( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassFragmentDensityMapOffsetEndInfoQCOM( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & fragmentDensityOffsets_, const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , fragmentDensityOffsetCount( static_cast( fragmentDensityOffsets_.size() ) ) - , pFragmentDensityOffsets( fragmentDensityOffsets_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassFragmentDensityMapOffsetEndInfoQCOM & operator=( SubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassFragmentDensityMapOffsetEndInfoQCOM & operator=( VkSubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SubpassFragmentDensityMapOffsetEndInfoQCOM & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassFragmentDensityMapOffsetEndInfoQCOM & - setFragmentDensityOffsetCount( uint32_t fragmentDensityOffsetCount_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityOffsetCount = fragmentDensityOffsetCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SubpassFragmentDensityMapOffsetEndInfoQCOM & - setPFragmentDensityOffsets( const VULKAN_HPP_NAMESPACE::Offset2D * pFragmentDensityOffsets_ ) VULKAN_HPP_NOEXCEPT - { - pFragmentDensityOffsets = pFragmentDensityOffsets_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SubpassFragmentDensityMapOffsetEndInfoQCOM & setFragmentDensityOffsets( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & fragmentDensityOffsets_ ) VULKAN_HPP_NOEXCEPT - { - fragmentDensityOffsetCount = static_cast( fragmentDensityOffsets_.size() ); - pFragmentDensityOffsets = fragmentDensityOffsets_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSubpassFragmentDensityMapOffsetEndInfoQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassFragmentDensityMapOffsetEndInfoQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fragmentDensityOffsetCount, pFragmentDensityOffsets ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassFragmentDensityMapOffsetEndInfoQCOM const & ) const = default; -#else - bool operator==( SubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fragmentDensityOffsetCount == rhs.fragmentDensityOffsetCount ) && - ( pFragmentDensityOffsets == rhs.pFragmentDensityOffsets ); -# endif - } - - bool operator!=( SubpassFragmentDensityMapOffsetEndInfoQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassFragmentDensityMapOffsetEndInfoQCOM; - const void * pNext = {}; - uint32_t fragmentDensityOffsetCount = {}; - const VULKAN_HPP_NAMESPACE::Offset2D * pFragmentDensityOffsets = {}; - }; - - template <> - struct CppType - { - using Type = SubpassFragmentDensityMapOffsetEndInfoQCOM; - }; - - struct SubpassResolvePerformanceQueryEXT - { - using NativeType = VkSubpassResolvePerformanceQueryEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassResolvePerformanceQueryEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassResolvePerformanceQueryEXT( VULKAN_HPP_NAMESPACE::Bool32 optimal_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , optimal( optimal_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassResolvePerformanceQueryEXT( SubpassResolvePerformanceQueryEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassResolvePerformanceQueryEXT( VkSubpassResolvePerformanceQueryEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SubpassResolvePerformanceQueryEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassResolvePerformanceQueryEXT & operator=( SubpassResolvePerformanceQueryEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassResolvePerformanceQueryEXT & operator=( VkSubpassResolvePerformanceQueryEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSubpassResolvePerformanceQueryEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassResolvePerformanceQueryEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, optimal ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassResolvePerformanceQueryEXT const & ) const = default; -#else - bool operator==( SubpassResolvePerformanceQueryEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( optimal == rhs.optimal ); -# endif - } - - bool operator!=( SubpassResolvePerformanceQueryEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassResolvePerformanceQueryEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 optimal = {}; - }; - - template <> - struct CppType - { - using Type = SubpassResolvePerformanceQueryEXT; - }; - - struct SubpassShadingPipelineCreateInfoHUAWEI - { - using NativeType = VkSubpassShadingPipelineCreateInfoHUAWEI; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubpassShadingPipelineCreateInfoHUAWEI; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubpassShadingPipelineCreateInfoHUAWEI( VULKAN_HPP_NAMESPACE::RenderPass renderPass_ = {}, - uint32_t subpass_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , renderPass( renderPass_ ) - , subpass( subpass_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubpassShadingPipelineCreateInfoHUAWEI( SubpassShadingPipelineCreateInfoHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassShadingPipelineCreateInfoHUAWEI( VkSubpassShadingPipelineCreateInfoHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - : SubpassShadingPipelineCreateInfoHUAWEI( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubpassShadingPipelineCreateInfoHUAWEI & operator=( SubpassShadingPipelineCreateInfoHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubpassShadingPipelineCreateInfoHUAWEI & operator=( VkSubpassShadingPipelineCreateInfoHUAWEI const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSubpassShadingPipelineCreateInfoHUAWEI const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubpassShadingPipelineCreateInfoHUAWEI &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, renderPass, subpass ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubpassShadingPipelineCreateInfoHUAWEI const & ) const = default; -#else - bool operator==( SubpassShadingPipelineCreateInfoHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( renderPass == rhs.renderPass ) && ( subpass == rhs.subpass ); -# endif - } - - bool operator!=( SubpassShadingPipelineCreateInfoHUAWEI const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubpassShadingPipelineCreateInfoHUAWEI; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::RenderPass renderPass = {}; - uint32_t subpass = {}; - }; - - template <> - struct CppType - { - using Type = SubpassShadingPipelineCreateInfoHUAWEI; - }; - - struct SubresourceLayout2EXT - { - using NativeType = VkSubresourceLayout2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSubresourceLayout2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SubresourceLayout2EXT( VULKAN_HPP_NAMESPACE::SubresourceLayout subresourceLayout_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , subresourceLayout( subresourceLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR SubresourceLayout2EXT( SubresourceLayout2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubresourceLayout2EXT( VkSubresourceLayout2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SubresourceLayout2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SubresourceLayout2EXT & operator=( SubresourceLayout2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SubresourceLayout2EXT & operator=( VkSubresourceLayout2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSubresourceLayout2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSubresourceLayout2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, subresourceLayout ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SubresourceLayout2EXT const & ) const = default; -#else - bool operator==( SubresourceLayout2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( subresourceLayout == rhs.subresourceLayout ); -# endif - } - - bool operator!=( SubresourceLayout2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSubresourceLayout2EXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SubresourceLayout subresourceLayout = {}; - }; - - template <> - struct CppType - { - using Type = SubresourceLayout2EXT; - }; - - struct SurfaceCapabilities2EXT - { - using NativeType = VkSurfaceCapabilities2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceCapabilities2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceCapabilities2EXT( - uint32_t minImageCount_ = {}, - uint32_t maxImageCount_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D currentExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D minImageExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxImageExtent_ = {}, - uint32_t maxImageArrayLayers_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR currentTransform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagsKHR supportedCompositeAlpha_ = {}, - VULKAN_HPP_NAMESPACE::ImageUsageFlags supportedUsageFlags_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagsEXT supportedSurfaceCounters_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , minImageCount( minImageCount_ ) - , maxImageCount( maxImageCount_ ) - , currentExtent( currentExtent_ ) - , minImageExtent( minImageExtent_ ) - , maxImageExtent( maxImageExtent_ ) - , maxImageArrayLayers( maxImageArrayLayers_ ) - , supportedTransforms( supportedTransforms_ ) - , currentTransform( currentTransform_ ) - , supportedCompositeAlpha( supportedCompositeAlpha_ ) - , supportedUsageFlags( supportedUsageFlags_ ) - , supportedSurfaceCounters( supportedSurfaceCounters_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceCapabilities2EXT( SurfaceCapabilities2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilities2EXT( VkSurfaceCapabilities2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceCapabilities2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceCapabilities2EXT & operator=( SurfaceCapabilities2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilities2EXT & operator=( VkSurfaceCapabilities2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSurfaceCapabilities2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceCapabilities2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - minImageCount, - maxImageCount, - currentExtent, - minImageExtent, - maxImageExtent, - maxImageArrayLayers, - supportedTransforms, - currentTransform, - supportedCompositeAlpha, - supportedUsageFlags, - supportedSurfaceCounters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceCapabilities2EXT const & ) const = default; -#else - bool operator==( SurfaceCapabilities2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( minImageCount == rhs.minImageCount ) && ( maxImageCount == rhs.maxImageCount ) && - ( currentExtent == rhs.currentExtent ) && ( minImageExtent == rhs.minImageExtent ) && ( maxImageExtent == rhs.maxImageExtent ) && - ( maxImageArrayLayers == rhs.maxImageArrayLayers ) && ( supportedTransforms == rhs.supportedTransforms ) && - ( currentTransform == rhs.currentTransform ) && ( supportedCompositeAlpha == rhs.supportedCompositeAlpha ) && - ( supportedUsageFlags == rhs.supportedUsageFlags ) && ( supportedSurfaceCounters == rhs.supportedSurfaceCounters ); -# endif - } - - bool operator!=( SurfaceCapabilities2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceCapabilities2EXT; - void * pNext = {}; - uint32_t minImageCount = {}; - uint32_t maxImageCount = {}; - VULKAN_HPP_NAMESPACE::Extent2D currentExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D minImageExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxImageExtent = {}; - uint32_t maxImageArrayLayers = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR currentTransform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagsKHR supportedCompositeAlpha = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags supportedUsageFlags = {}; - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagsEXT supportedSurfaceCounters = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceCapabilities2EXT; - }; - - struct SurfaceCapabilitiesKHR - { - using NativeType = VkSurfaceCapabilitiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceCapabilitiesKHR( - uint32_t minImageCount_ = {}, - uint32_t maxImageCount_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D currentExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D minImageExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxImageExtent_ = {}, - uint32_t maxImageArrayLayers_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR currentTransform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagsKHR supportedCompositeAlpha_ = {}, - VULKAN_HPP_NAMESPACE::ImageUsageFlags supportedUsageFlags_ = {} ) VULKAN_HPP_NOEXCEPT - : minImageCount( minImageCount_ ) - , maxImageCount( maxImageCount_ ) - , currentExtent( currentExtent_ ) - , minImageExtent( minImageExtent_ ) - , maxImageExtent( maxImageExtent_ ) - , maxImageArrayLayers( maxImageArrayLayers_ ) - , supportedTransforms( supportedTransforms_ ) - , currentTransform( currentTransform_ ) - , supportedCompositeAlpha( supportedCompositeAlpha_ ) - , supportedUsageFlags( supportedUsageFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceCapabilitiesKHR( SurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilitiesKHR( VkSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceCapabilitiesKHR & operator=( SurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilitiesKHR & operator=( VkSurfaceCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSurfaceCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( minImageCount, - maxImageCount, - currentExtent, - minImageExtent, - maxImageExtent, - maxImageArrayLayers, - supportedTransforms, - currentTransform, - supportedCompositeAlpha, - supportedUsageFlags ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceCapabilitiesKHR const & ) const = default; -#else - bool operator==( SurfaceCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( minImageCount == rhs.minImageCount ) && ( maxImageCount == rhs.maxImageCount ) && ( currentExtent == rhs.currentExtent ) && - ( minImageExtent == rhs.minImageExtent ) && ( maxImageExtent == rhs.maxImageExtent ) && ( maxImageArrayLayers == rhs.maxImageArrayLayers ) && - ( supportedTransforms == rhs.supportedTransforms ) && ( currentTransform == rhs.currentTransform ) && - ( supportedCompositeAlpha == rhs.supportedCompositeAlpha ) && ( supportedUsageFlags == rhs.supportedUsageFlags ); -# endif - } - - bool operator!=( SurfaceCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t minImageCount = {}; - uint32_t maxImageCount = {}; - VULKAN_HPP_NAMESPACE::Extent2D currentExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D minImageExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxImageExtent = {}; - uint32_t maxImageArrayLayers = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagsKHR supportedTransforms = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR currentTransform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagsKHR supportedCompositeAlpha = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags supportedUsageFlags = {}; - }; - - struct SurfaceCapabilities2KHR - { - using NativeType = VkSurfaceCapabilities2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceCapabilities2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceCapabilities2KHR( VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR surfaceCapabilities_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , surfaceCapabilities( surfaceCapabilities_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceCapabilities2KHR( SurfaceCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilities2KHR( VkSurfaceCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceCapabilities2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceCapabilities2KHR & operator=( SurfaceCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilities2KHR & operator=( VkSurfaceCapabilities2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSurfaceCapabilities2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceCapabilities2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, surfaceCapabilities ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceCapabilities2KHR const & ) const = default; -#else - bool operator==( SurfaceCapabilities2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( surfaceCapabilities == rhs.surfaceCapabilities ); -# endif - } - - bool operator!=( SurfaceCapabilities2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceCapabilities2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceCapabilitiesKHR surfaceCapabilities = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceCapabilities2KHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct SurfaceCapabilitiesFullScreenExclusiveEXT - { - using NativeType = VkSurfaceCapabilitiesFullScreenExclusiveEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceCapabilitiesFullScreenExclusiveEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceCapabilitiesFullScreenExclusiveEXT( VULKAN_HPP_NAMESPACE::Bool32 fullScreenExclusiveSupported_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fullScreenExclusiveSupported( fullScreenExclusiveSupported_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceCapabilitiesFullScreenExclusiveEXT( SurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilitiesFullScreenExclusiveEXT( VkSurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceCapabilitiesFullScreenExclusiveEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceCapabilitiesFullScreenExclusiveEXT & operator=( SurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceCapabilitiesFullScreenExclusiveEXT & operator=( VkSurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SurfaceCapabilitiesFullScreenExclusiveEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SurfaceCapabilitiesFullScreenExclusiveEXT & - setFullScreenExclusiveSupported( VULKAN_HPP_NAMESPACE::Bool32 fullScreenExclusiveSupported_ ) VULKAN_HPP_NOEXCEPT - { - fullScreenExclusiveSupported = fullScreenExclusiveSupported_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSurfaceCapabilitiesFullScreenExclusiveEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceCapabilitiesFullScreenExclusiveEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fullScreenExclusiveSupported ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceCapabilitiesFullScreenExclusiveEXT const & ) const = default; -# else - bool operator==( SurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fullScreenExclusiveSupported == rhs.fullScreenExclusiveSupported ); -# endif - } - - bool operator!=( SurfaceCapabilitiesFullScreenExclusiveEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceCapabilitiesFullScreenExclusiveEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 fullScreenExclusiveSupported = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceCapabilitiesFullScreenExclusiveEXT; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct SurfaceFormatKHR - { - using NativeType = VkSurfaceFormatKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SurfaceFormatKHR( VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ColorSpaceKHR colorSpace_ = VULKAN_HPP_NAMESPACE::ColorSpaceKHR::eSrgbNonlinear ) VULKAN_HPP_NOEXCEPT - : format( format_ ) - , colorSpace( colorSpace_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceFormatKHR( SurfaceFormatKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFormatKHR( VkSurfaceFormatKHR const & rhs ) VULKAN_HPP_NOEXCEPT : SurfaceFormatKHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceFormatKHR & operator=( SurfaceFormatKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFormatKHR & operator=( VkSurfaceFormatKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSurfaceFormatKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceFormatKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( format, colorSpace ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceFormatKHR const & ) const = default; -#else - bool operator==( SurfaceFormatKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( format == rhs.format ) && ( colorSpace == rhs.colorSpace ); -# endif - } - - bool operator!=( SurfaceFormatKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ColorSpaceKHR colorSpace = VULKAN_HPP_NAMESPACE::ColorSpaceKHR::eSrgbNonlinear; - }; - - struct SurfaceFormat2KHR - { - using NativeType = VkSurfaceFormat2KHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceFormat2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceFormat2KHR( VULKAN_HPP_NAMESPACE::SurfaceFormatKHR surfaceFormat_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , surfaceFormat( surfaceFormat_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceFormat2KHR( SurfaceFormat2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFormat2KHR( VkSurfaceFormat2KHR const & rhs ) VULKAN_HPP_NOEXCEPT : SurfaceFormat2KHR( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceFormat2KHR & operator=( SurfaceFormat2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFormat2KHR & operator=( VkSurfaceFormat2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkSurfaceFormat2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceFormat2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, surfaceFormat ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceFormat2KHR const & ) const = default; -#else - bool operator==( SurfaceFormat2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( surfaceFormat == rhs.surfaceFormat ); -# endif - } - - bool operator!=( SurfaceFormat2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceFormat2KHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceFormatKHR surfaceFormat = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceFormat2KHR; - }; - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct SurfaceFullScreenExclusiveInfoEXT - { - using NativeType = VkSurfaceFullScreenExclusiveInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceFullScreenExclusiveInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceFullScreenExclusiveInfoEXT( - VULKAN_HPP_NAMESPACE::FullScreenExclusiveEXT fullScreenExclusive_ = VULKAN_HPP_NAMESPACE::FullScreenExclusiveEXT::eDefault, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , fullScreenExclusive( fullScreenExclusive_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceFullScreenExclusiveInfoEXT( SurfaceFullScreenExclusiveInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFullScreenExclusiveInfoEXT( VkSurfaceFullScreenExclusiveInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceFullScreenExclusiveInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceFullScreenExclusiveInfoEXT & operator=( SurfaceFullScreenExclusiveInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFullScreenExclusiveInfoEXT & operator=( VkSurfaceFullScreenExclusiveInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SurfaceFullScreenExclusiveInfoEXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SurfaceFullScreenExclusiveInfoEXT & - setFullScreenExclusive( VULKAN_HPP_NAMESPACE::FullScreenExclusiveEXT fullScreenExclusive_ ) VULKAN_HPP_NOEXCEPT - { - fullScreenExclusive = fullScreenExclusive_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSurfaceFullScreenExclusiveInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceFullScreenExclusiveInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, fullScreenExclusive ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceFullScreenExclusiveInfoEXT const & ) const = default; -# else - bool operator==( SurfaceFullScreenExclusiveInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( fullScreenExclusive == rhs.fullScreenExclusive ); -# endif - } - - bool operator!=( SurfaceFullScreenExclusiveInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceFullScreenExclusiveInfoEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::FullScreenExclusiveEXT fullScreenExclusive = VULKAN_HPP_NAMESPACE::FullScreenExclusiveEXT::eDefault; - }; - - template <> - struct CppType - { - using Type = SurfaceFullScreenExclusiveInfoEXT; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct SurfaceFullScreenExclusiveWin32InfoEXT - { - using NativeType = VkSurfaceFullScreenExclusiveWin32InfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceFullScreenExclusiveWin32InfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceFullScreenExclusiveWin32InfoEXT( HMONITOR hmonitor_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , hmonitor( hmonitor_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceFullScreenExclusiveWin32InfoEXT( SurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFullScreenExclusiveWin32InfoEXT( VkSurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceFullScreenExclusiveWin32InfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceFullScreenExclusiveWin32InfoEXT & operator=( SurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceFullScreenExclusiveWin32InfoEXT & operator=( VkSurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SurfaceFullScreenExclusiveWin32InfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SurfaceFullScreenExclusiveWin32InfoEXT & setHmonitor( HMONITOR hmonitor_ ) VULKAN_HPP_NOEXCEPT - { - hmonitor = hmonitor_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSurfaceFullScreenExclusiveWin32InfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceFullScreenExclusiveWin32InfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, hmonitor ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceFullScreenExclusiveWin32InfoEXT const & ) const = default; -# else - bool operator==( SurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( hmonitor == rhs.hmonitor ); -# endif - } - - bool operator!=( SurfaceFullScreenExclusiveWin32InfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceFullScreenExclusiveWin32InfoEXT; - const void * pNext = {}; - HMONITOR hmonitor = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceFullScreenExclusiveWin32InfoEXT; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct SurfaceProtectedCapabilitiesKHR - { - using NativeType = VkSurfaceProtectedCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSurfaceProtectedCapabilitiesKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SurfaceProtectedCapabilitiesKHR( VULKAN_HPP_NAMESPACE::Bool32 supportsProtected_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , supportsProtected( supportsProtected_ ) - { - } - - VULKAN_HPP_CONSTEXPR SurfaceProtectedCapabilitiesKHR( SurfaceProtectedCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceProtectedCapabilitiesKHR( VkSurfaceProtectedCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SurfaceProtectedCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SurfaceProtectedCapabilitiesKHR & operator=( SurfaceProtectedCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SurfaceProtectedCapabilitiesKHR & operator=( VkSurfaceProtectedCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SurfaceProtectedCapabilitiesKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SurfaceProtectedCapabilitiesKHR & setSupportsProtected( VULKAN_HPP_NAMESPACE::Bool32 supportsProtected_ ) VULKAN_HPP_NOEXCEPT - { - supportsProtected = supportsProtected_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSurfaceProtectedCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSurfaceProtectedCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, supportsProtected ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SurfaceProtectedCapabilitiesKHR const & ) const = default; -#else - bool operator==( SurfaceProtectedCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( supportsProtected == rhs.supportsProtected ); -# endif - } - - bool operator!=( SurfaceProtectedCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSurfaceProtectedCapabilitiesKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 supportsProtected = {}; - }; - - template <> - struct CppType - { - using Type = SurfaceProtectedCapabilitiesKHR; - }; - - struct SwapchainCounterCreateInfoEXT - { - using NativeType = VkSwapchainCounterCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSwapchainCounterCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SwapchainCounterCreateInfoEXT( VULKAN_HPP_NAMESPACE::SurfaceCounterFlagsEXT surfaceCounters_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , surfaceCounters( surfaceCounters_ ) - { - } - - VULKAN_HPP_CONSTEXPR SwapchainCounterCreateInfoEXT( SwapchainCounterCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainCounterCreateInfoEXT( VkSwapchainCounterCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : SwapchainCounterCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SwapchainCounterCreateInfoEXT & operator=( SwapchainCounterCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainCounterCreateInfoEXT & operator=( VkSwapchainCounterCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SwapchainCounterCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCounterCreateInfoEXT & - setSurfaceCounters( VULKAN_HPP_NAMESPACE::SurfaceCounterFlagsEXT surfaceCounters_ ) VULKAN_HPP_NOEXCEPT - { - surfaceCounters = surfaceCounters_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSwapchainCounterCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSwapchainCounterCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, surfaceCounters ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SwapchainCounterCreateInfoEXT const & ) const = default; -#else - bool operator==( SwapchainCounterCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( surfaceCounters == rhs.surfaceCounters ); -# endif - } - - bool operator!=( SwapchainCounterCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSwapchainCounterCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SurfaceCounterFlagsEXT surfaceCounters = {}; - }; - - template <> - struct CppType - { - using Type = SwapchainCounterCreateInfoEXT; - }; - - struct SwapchainCreateInfoKHR - { - using NativeType = VkSwapchainCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSwapchainCreateInfoKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - SwapchainCreateInfoKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceKHR surface_ = {}, - uint32_t minImageCount_ = {}, - VULKAN_HPP_NAMESPACE::Format imageFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ColorSpaceKHR imageColorSpace_ = VULKAN_HPP_NAMESPACE::ColorSpaceKHR::eSrgbNonlinear, - VULKAN_HPP_NAMESPACE::Extent2D imageExtent_ = {}, - uint32_t imageArrayLayers_ = {}, - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage_ = {}, - VULKAN_HPP_NAMESPACE::SharingMode imageSharingMode_ = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive, - uint32_t queueFamilyIndexCount_ = {}, - const uint32_t * pQueueFamilyIndices_ = {}, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR preTransform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR compositeAlpha_ = VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR::eOpaque, - VULKAN_HPP_NAMESPACE::PresentModeKHR presentMode_ = VULKAN_HPP_NAMESPACE::PresentModeKHR::eImmediate, - VULKAN_HPP_NAMESPACE::Bool32 clipped_ = {}, - VULKAN_HPP_NAMESPACE::SwapchainKHR oldSwapchain_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , surface( surface_ ) - , minImageCount( minImageCount_ ) - , imageFormat( imageFormat_ ) - , imageColorSpace( imageColorSpace_ ) - , imageExtent( imageExtent_ ) - , imageArrayLayers( imageArrayLayers_ ) - , imageUsage( imageUsage_ ) - , imageSharingMode( imageSharingMode_ ) - , queueFamilyIndexCount( queueFamilyIndexCount_ ) - , pQueueFamilyIndices( pQueueFamilyIndices_ ) - , preTransform( preTransform_ ) - , compositeAlpha( compositeAlpha_ ) - , presentMode( presentMode_ ) - , clipped( clipped_ ) - , oldSwapchain( oldSwapchain_ ) - { - } - - VULKAN_HPP_CONSTEXPR SwapchainCreateInfoKHR( SwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainCreateInfoKHR( VkSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : SwapchainCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SwapchainCreateInfoKHR( VULKAN_HPP_NAMESPACE::SwapchainCreateFlagsKHR flags_, - VULKAN_HPP_NAMESPACE::SurfaceKHR surface_, - uint32_t minImageCount_, - VULKAN_HPP_NAMESPACE::Format imageFormat_, - VULKAN_HPP_NAMESPACE::ColorSpaceKHR imageColorSpace_, - VULKAN_HPP_NAMESPACE::Extent2D imageExtent_, - uint32_t imageArrayLayers_, - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage_, - VULKAN_HPP_NAMESPACE::SharingMode imageSharingMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_, - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR preTransform_ = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity, - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR compositeAlpha_ = VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR::eOpaque, - VULKAN_HPP_NAMESPACE::PresentModeKHR presentMode_ = VULKAN_HPP_NAMESPACE::PresentModeKHR::eImmediate, - VULKAN_HPP_NAMESPACE::Bool32 clipped_ = {}, - VULKAN_HPP_NAMESPACE::SwapchainKHR oldSwapchain_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , surface( surface_ ) - , minImageCount( minImageCount_ ) - , imageFormat( imageFormat_ ) - , imageColorSpace( imageColorSpace_ ) - , imageExtent( imageExtent_ ) - , imageArrayLayers( imageArrayLayers_ ) - , imageUsage( imageUsage_ ) - , imageSharingMode( imageSharingMode_ ) - , queueFamilyIndexCount( static_cast( queueFamilyIndices_.size() ) ) - , pQueueFamilyIndices( queueFamilyIndices_.data() ) - , preTransform( preTransform_ ) - , compositeAlpha( compositeAlpha_ ) - , presentMode( presentMode_ ) - , clipped( clipped_ ) - , oldSwapchain( oldSwapchain_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SwapchainCreateInfoKHR & operator=( SwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainCreateInfoKHR & operator=( VkSwapchainCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::SwapchainCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setSurface( VULKAN_HPP_NAMESPACE::SurfaceKHR surface_ ) VULKAN_HPP_NOEXCEPT - { - surface = surface_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setMinImageCount( uint32_t minImageCount_ ) VULKAN_HPP_NOEXCEPT - { - minImageCount = minImageCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageFormat( VULKAN_HPP_NAMESPACE::Format imageFormat_ ) VULKAN_HPP_NOEXCEPT - { - imageFormat = imageFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageColorSpace( VULKAN_HPP_NAMESPACE::ColorSpaceKHR imageColorSpace_ ) VULKAN_HPP_NOEXCEPT - { - imageColorSpace = imageColorSpace_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageExtent( VULKAN_HPP_NAMESPACE::Extent2D const & imageExtent_ ) VULKAN_HPP_NOEXCEPT - { - imageExtent = imageExtent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageArrayLayers( uint32_t imageArrayLayers_ ) VULKAN_HPP_NOEXCEPT - { - imageArrayLayers = imageArrayLayers_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageUsage( VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage_ ) VULKAN_HPP_NOEXCEPT - { - imageUsage = imageUsage_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setImageSharingMode( VULKAN_HPP_NAMESPACE::SharingMode imageSharingMode_ ) VULKAN_HPP_NOEXCEPT - { - imageSharingMode = imageSharingMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setQueueFamilyIndexCount( uint32_t queueFamilyIndexCount_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = queueFamilyIndexCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setPQueueFamilyIndices( const uint32_t * pQueueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - pQueueFamilyIndices = pQueueFamilyIndices_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - SwapchainCreateInfoKHR & - setQueueFamilyIndices( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & queueFamilyIndices_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndexCount = static_cast( queueFamilyIndices_.size() ); - pQueueFamilyIndices = queueFamilyIndices_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setPreTransform( VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR preTransform_ ) VULKAN_HPP_NOEXCEPT - { - preTransform = preTransform_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setCompositeAlpha( VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR compositeAlpha_ ) VULKAN_HPP_NOEXCEPT - { - compositeAlpha = compositeAlpha_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setPresentMode( VULKAN_HPP_NAMESPACE::PresentModeKHR presentMode_ ) VULKAN_HPP_NOEXCEPT - { - presentMode = presentMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setClipped( VULKAN_HPP_NAMESPACE::Bool32 clipped_ ) VULKAN_HPP_NOEXCEPT - { - clipped = clipped_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainCreateInfoKHR & setOldSwapchain( VULKAN_HPP_NAMESPACE::SwapchainKHR oldSwapchain_ ) VULKAN_HPP_NOEXCEPT - { - oldSwapchain = oldSwapchain_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSwapchainCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSwapchainCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - surface, - minImageCount, - imageFormat, - imageColorSpace, - imageExtent, - imageArrayLayers, - imageUsage, - imageSharingMode, - queueFamilyIndexCount, - pQueueFamilyIndices, - preTransform, - compositeAlpha, - presentMode, - clipped, - oldSwapchain ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SwapchainCreateInfoKHR const & ) const = default; -#else - bool operator==( SwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( surface == rhs.surface ) && - ( minImageCount == rhs.minImageCount ) && ( imageFormat == rhs.imageFormat ) && ( imageColorSpace == rhs.imageColorSpace ) && - ( imageExtent == rhs.imageExtent ) && ( imageArrayLayers == rhs.imageArrayLayers ) && ( imageUsage == rhs.imageUsage ) && - ( imageSharingMode == rhs.imageSharingMode ) && ( queueFamilyIndexCount == rhs.queueFamilyIndexCount ) && - ( pQueueFamilyIndices == rhs.pQueueFamilyIndices ) && ( preTransform == rhs.preTransform ) && ( compositeAlpha == rhs.compositeAlpha ) && - ( presentMode == rhs.presentMode ) && ( clipped == rhs.clipped ) && ( oldSwapchain == rhs.oldSwapchain ); -# endif - } - - bool operator!=( SwapchainCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSwapchainCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::SwapchainCreateFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::SurfaceKHR surface = {}; - uint32_t minImageCount = {}; - VULKAN_HPP_NAMESPACE::Format imageFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ColorSpaceKHR imageColorSpace = VULKAN_HPP_NAMESPACE::ColorSpaceKHR::eSrgbNonlinear; - VULKAN_HPP_NAMESPACE::Extent2D imageExtent = {}; - uint32_t imageArrayLayers = {}; - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsage = {}; - VULKAN_HPP_NAMESPACE::SharingMode imageSharingMode = VULKAN_HPP_NAMESPACE::SharingMode::eExclusive; - uint32_t queueFamilyIndexCount = {}; - const uint32_t * pQueueFamilyIndices = {}; - VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR preTransform = VULKAN_HPP_NAMESPACE::SurfaceTransformFlagBitsKHR::eIdentity; - VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR compositeAlpha = VULKAN_HPP_NAMESPACE::CompositeAlphaFlagBitsKHR::eOpaque; - VULKAN_HPP_NAMESPACE::PresentModeKHR presentMode = VULKAN_HPP_NAMESPACE::PresentModeKHR::eImmediate; - VULKAN_HPP_NAMESPACE::Bool32 clipped = {}; - VULKAN_HPP_NAMESPACE::SwapchainKHR oldSwapchain = {}; - }; - - template <> - struct CppType - { - using Type = SwapchainCreateInfoKHR; - }; - - struct SwapchainDisplayNativeHdrCreateInfoAMD - { - using NativeType = VkSwapchainDisplayNativeHdrCreateInfoAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eSwapchainDisplayNativeHdrCreateInfoAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR SwapchainDisplayNativeHdrCreateInfoAMD( VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , localDimmingEnable( localDimmingEnable_ ) - { - } - - VULKAN_HPP_CONSTEXPR SwapchainDisplayNativeHdrCreateInfoAMD( SwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainDisplayNativeHdrCreateInfoAMD( VkSwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : SwapchainDisplayNativeHdrCreateInfoAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - SwapchainDisplayNativeHdrCreateInfoAMD & operator=( SwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - SwapchainDisplayNativeHdrCreateInfoAMD & operator=( VkSwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 SwapchainDisplayNativeHdrCreateInfoAMD & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 SwapchainDisplayNativeHdrCreateInfoAMD & - setLocalDimmingEnable( VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable_ ) VULKAN_HPP_NOEXCEPT - { - localDimmingEnable = localDimmingEnable_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkSwapchainDisplayNativeHdrCreateInfoAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkSwapchainDisplayNativeHdrCreateInfoAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, localDimmingEnable ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( SwapchainDisplayNativeHdrCreateInfoAMD const & ) const = default; -#else - bool operator==( SwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( localDimmingEnable == rhs.localDimmingEnable ); -# endif - } - - bool operator!=( SwapchainDisplayNativeHdrCreateInfoAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eSwapchainDisplayNativeHdrCreateInfoAMD; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 localDimmingEnable = {}; - }; - - template <> - struct CppType - { - using Type = SwapchainDisplayNativeHdrCreateInfoAMD; - }; - - struct TextureLODGatherFormatPropertiesAMD - { - using NativeType = VkTextureLODGatherFormatPropertiesAMD; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eTextureLodGatherFormatPropertiesAMD; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR TextureLODGatherFormatPropertiesAMD( VULKAN_HPP_NAMESPACE::Bool32 supportsTextureGatherLODBiasAMD_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , supportsTextureGatherLODBiasAMD( supportsTextureGatherLODBiasAMD_ ) - { - } - - VULKAN_HPP_CONSTEXPR TextureLODGatherFormatPropertiesAMD( TextureLODGatherFormatPropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TextureLODGatherFormatPropertiesAMD( VkTextureLODGatherFormatPropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - : TextureLODGatherFormatPropertiesAMD( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TextureLODGatherFormatPropertiesAMD & operator=( TextureLODGatherFormatPropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TextureLODGatherFormatPropertiesAMD & operator=( VkTextureLODGatherFormatPropertiesAMD const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkTextureLODGatherFormatPropertiesAMD const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTextureLODGatherFormatPropertiesAMD &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, supportsTextureGatherLODBiasAMD ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TextureLODGatherFormatPropertiesAMD const & ) const = default; -#else - bool operator==( TextureLODGatherFormatPropertiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( supportsTextureGatherLODBiasAMD == rhs.supportsTextureGatherLODBiasAMD ); -# endif - } - - bool operator!=( TextureLODGatherFormatPropertiesAMD const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eTextureLodGatherFormatPropertiesAMD; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Bool32 supportsTextureGatherLODBiasAMD = {}; - }; - - template <> - struct CppType - { - using Type = TextureLODGatherFormatPropertiesAMD; - }; - - struct TilePropertiesQCOM - { - using NativeType = VkTilePropertiesQCOM; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eTilePropertiesQCOM; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR TilePropertiesQCOM( VULKAN_HPP_NAMESPACE::Extent3D tileSize_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D apronSize_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D origin_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , tileSize( tileSize_ ) - , apronSize( apronSize_ ) - , origin( origin_ ) - { - } - - VULKAN_HPP_CONSTEXPR TilePropertiesQCOM( TilePropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TilePropertiesQCOM( VkTilePropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT : TilePropertiesQCOM( *reinterpret_cast( &rhs ) ) {} -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TilePropertiesQCOM & operator=( TilePropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TilePropertiesQCOM & operator=( VkTilePropertiesQCOM const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 TilePropertiesQCOM & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TilePropertiesQCOM & setTileSize( VULKAN_HPP_NAMESPACE::Extent3D const & tileSize_ ) VULKAN_HPP_NOEXCEPT - { - tileSize = tileSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TilePropertiesQCOM & setApronSize( VULKAN_HPP_NAMESPACE::Extent2D const & apronSize_ ) VULKAN_HPP_NOEXCEPT - { - apronSize = apronSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TilePropertiesQCOM & setOrigin( VULKAN_HPP_NAMESPACE::Offset2D const & origin_ ) VULKAN_HPP_NOEXCEPT - { - origin = origin_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkTilePropertiesQCOM const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTilePropertiesQCOM &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, tileSize, apronSize, origin ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TilePropertiesQCOM const & ) const = default; -#else - bool operator==( TilePropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( tileSize == rhs.tileSize ) && ( apronSize == rhs.apronSize ) && ( origin == rhs.origin ); -# endif - } - - bool operator!=( TilePropertiesQCOM const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eTilePropertiesQCOM; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Extent3D tileSize = {}; - VULKAN_HPP_NAMESPACE::Extent2D apronSize = {}; - VULKAN_HPP_NAMESPACE::Offset2D origin = {}; - }; - - template <> - struct CppType - { - using Type = TilePropertiesQCOM; - }; - - struct TimelineSemaphoreSubmitInfo - { - using NativeType = VkTimelineSemaphoreSubmitInfo; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eTimelineSemaphoreSubmitInfo; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR TimelineSemaphoreSubmitInfo( uint32_t waitSemaphoreValueCount_ = {}, - const uint64_t * pWaitSemaphoreValues_ = {}, - uint32_t signalSemaphoreValueCount_ = {}, - const uint64_t * pSignalSemaphoreValues_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , waitSemaphoreValueCount( waitSemaphoreValueCount_ ) - , pWaitSemaphoreValues( pWaitSemaphoreValues_ ) - , signalSemaphoreValueCount( signalSemaphoreValueCount_ ) - , pSignalSemaphoreValues( pSignalSemaphoreValues_ ) - { - } - - VULKAN_HPP_CONSTEXPR TimelineSemaphoreSubmitInfo( TimelineSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TimelineSemaphoreSubmitInfo( VkTimelineSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - : TimelineSemaphoreSubmitInfo( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - TimelineSemaphoreSubmitInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreValues_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreValues_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , waitSemaphoreValueCount( static_cast( waitSemaphoreValues_.size() ) ) - , pWaitSemaphoreValues( waitSemaphoreValues_.data() ) - , signalSemaphoreValueCount( static_cast( signalSemaphoreValues_.size() ) ) - , pSignalSemaphoreValues( signalSemaphoreValues_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TimelineSemaphoreSubmitInfo & operator=( TimelineSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TimelineSemaphoreSubmitInfo & operator=( VkTimelineSemaphoreSubmitInfo const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 TimelineSemaphoreSubmitInfo & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TimelineSemaphoreSubmitInfo & setWaitSemaphoreValueCount( uint32_t waitSemaphoreValueCount_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreValueCount = waitSemaphoreValueCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TimelineSemaphoreSubmitInfo & setPWaitSemaphoreValues( const uint64_t * pWaitSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - pWaitSemaphoreValues = pWaitSemaphoreValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - TimelineSemaphoreSubmitInfo & - setWaitSemaphoreValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & waitSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - waitSemaphoreValueCount = static_cast( waitSemaphoreValues_.size() ); - pWaitSemaphoreValues = waitSemaphoreValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 TimelineSemaphoreSubmitInfo & setSignalSemaphoreValueCount( uint32_t signalSemaphoreValueCount_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreValueCount = signalSemaphoreValueCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TimelineSemaphoreSubmitInfo & setPSignalSemaphoreValues( const uint64_t * pSignalSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - pSignalSemaphoreValues = pSignalSemaphoreValues_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - TimelineSemaphoreSubmitInfo & - setSignalSemaphoreValues( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & signalSemaphoreValues_ ) VULKAN_HPP_NOEXCEPT - { - signalSemaphoreValueCount = static_cast( signalSemaphoreValues_.size() ); - pSignalSemaphoreValues = signalSemaphoreValues_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkTimelineSemaphoreSubmitInfo const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTimelineSemaphoreSubmitInfo &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, waitSemaphoreValueCount, pWaitSemaphoreValues, signalSemaphoreValueCount, pSignalSemaphoreValues ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TimelineSemaphoreSubmitInfo const & ) const = default; -#else - bool operator==( TimelineSemaphoreSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( waitSemaphoreValueCount == rhs.waitSemaphoreValueCount ) && - ( pWaitSemaphoreValues == rhs.pWaitSemaphoreValues ) && ( signalSemaphoreValueCount == rhs.signalSemaphoreValueCount ) && - ( pSignalSemaphoreValues == rhs.pSignalSemaphoreValues ); -# endif - } - - bool operator!=( TimelineSemaphoreSubmitInfo const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eTimelineSemaphoreSubmitInfo; - const void * pNext = {}; - uint32_t waitSemaphoreValueCount = {}; - const uint64_t * pWaitSemaphoreValues = {}; - uint32_t signalSemaphoreValueCount = {}; - const uint64_t * pSignalSemaphoreValues = {}; - }; - - template <> - struct CppType - { - using Type = TimelineSemaphoreSubmitInfo; - }; - using TimelineSemaphoreSubmitInfoKHR = TimelineSemaphoreSubmitInfo; - - struct TraceRaysIndirectCommand2KHR - { - using NativeType = VkTraceRaysIndirectCommand2KHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR TraceRaysIndirectCommand2KHR( VULKAN_HPP_NAMESPACE::DeviceAddress raygenShaderRecordAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderRecordSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceAddress missShaderBindingTableAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableStride_ = {}, - VULKAN_HPP_NAMESPACE::DeviceAddress hitShaderBindingTableAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableStride_ = {}, - VULKAN_HPP_NAMESPACE::DeviceAddress callableShaderBindingTableAddress_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableSize_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableStride_ = {}, - uint32_t width_ = {}, - uint32_t height_ = {}, - uint32_t depth_ = {} ) VULKAN_HPP_NOEXCEPT - : raygenShaderRecordAddress( raygenShaderRecordAddress_ ) - , raygenShaderRecordSize( raygenShaderRecordSize_ ) - , missShaderBindingTableAddress( missShaderBindingTableAddress_ ) - , missShaderBindingTableSize( missShaderBindingTableSize_ ) - , missShaderBindingTableStride( missShaderBindingTableStride_ ) - , hitShaderBindingTableAddress( hitShaderBindingTableAddress_ ) - , hitShaderBindingTableSize( hitShaderBindingTableSize_ ) - , hitShaderBindingTableStride( hitShaderBindingTableStride_ ) - , callableShaderBindingTableAddress( callableShaderBindingTableAddress_ ) - , callableShaderBindingTableSize( callableShaderBindingTableSize_ ) - , callableShaderBindingTableStride( callableShaderBindingTableStride_ ) - , width( width_ ) - , height( height_ ) - , depth( depth_ ) - { - } - - VULKAN_HPP_CONSTEXPR TraceRaysIndirectCommand2KHR( TraceRaysIndirectCommand2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TraceRaysIndirectCommand2KHR( VkTraceRaysIndirectCommand2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - : TraceRaysIndirectCommand2KHR( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TraceRaysIndirectCommand2KHR & operator=( TraceRaysIndirectCommand2KHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TraceRaysIndirectCommand2KHR & operator=( VkTraceRaysIndirectCommand2KHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setRaygenShaderRecordAddress( VULKAN_HPP_NAMESPACE::DeviceAddress raygenShaderRecordAddress_ ) VULKAN_HPP_NOEXCEPT - { - raygenShaderRecordAddress = raygenShaderRecordAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setRaygenShaderRecordSize( VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderRecordSize_ ) VULKAN_HPP_NOEXCEPT - { - raygenShaderRecordSize = raygenShaderRecordSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setMissShaderBindingTableAddress( VULKAN_HPP_NAMESPACE::DeviceAddress missShaderBindingTableAddress_ ) VULKAN_HPP_NOEXCEPT - { - missShaderBindingTableAddress = missShaderBindingTableAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setMissShaderBindingTableSize( VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableSize_ ) VULKAN_HPP_NOEXCEPT - { - missShaderBindingTableSize = missShaderBindingTableSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setMissShaderBindingTableStride( VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableStride_ ) VULKAN_HPP_NOEXCEPT - { - missShaderBindingTableStride = missShaderBindingTableStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setHitShaderBindingTableAddress( VULKAN_HPP_NAMESPACE::DeviceAddress hitShaderBindingTableAddress_ ) VULKAN_HPP_NOEXCEPT - { - hitShaderBindingTableAddress = hitShaderBindingTableAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setHitShaderBindingTableSize( VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableSize_ ) VULKAN_HPP_NOEXCEPT - { - hitShaderBindingTableSize = hitShaderBindingTableSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setHitShaderBindingTableStride( VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableStride_ ) VULKAN_HPP_NOEXCEPT - { - hitShaderBindingTableStride = hitShaderBindingTableStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setCallableShaderBindingTableAddress( VULKAN_HPP_NAMESPACE::DeviceAddress callableShaderBindingTableAddress_ ) VULKAN_HPP_NOEXCEPT - { - callableShaderBindingTableAddress = callableShaderBindingTableAddress_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setCallableShaderBindingTableSize( VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableSize_ ) VULKAN_HPP_NOEXCEPT - { - callableShaderBindingTableSize = callableShaderBindingTableSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & - setCallableShaderBindingTableStride( VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableStride_ ) VULKAN_HPP_NOEXCEPT - { - callableShaderBindingTableStride = callableShaderBindingTableStride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommand2KHR & setDepth( uint32_t depth_ ) VULKAN_HPP_NOEXCEPT - { - depth = depth_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkTraceRaysIndirectCommand2KHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTraceRaysIndirectCommand2KHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( raygenShaderRecordAddress, - raygenShaderRecordSize, - missShaderBindingTableAddress, - missShaderBindingTableSize, - missShaderBindingTableStride, - hitShaderBindingTableAddress, - hitShaderBindingTableSize, - hitShaderBindingTableStride, - callableShaderBindingTableAddress, - callableShaderBindingTableSize, - callableShaderBindingTableStride, - width, - height, - depth ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TraceRaysIndirectCommand2KHR const & ) const = default; -#else - bool operator==( TraceRaysIndirectCommand2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( raygenShaderRecordAddress == rhs.raygenShaderRecordAddress ) && ( raygenShaderRecordSize == rhs.raygenShaderRecordSize ) && - ( missShaderBindingTableAddress == rhs.missShaderBindingTableAddress ) && ( missShaderBindingTableSize == rhs.missShaderBindingTableSize ) && - ( missShaderBindingTableStride == rhs.missShaderBindingTableStride ) && ( hitShaderBindingTableAddress == rhs.hitShaderBindingTableAddress ) && - ( hitShaderBindingTableSize == rhs.hitShaderBindingTableSize ) && ( hitShaderBindingTableStride == rhs.hitShaderBindingTableStride ) && - ( callableShaderBindingTableAddress == rhs.callableShaderBindingTableAddress ) && - ( callableShaderBindingTableSize == rhs.callableShaderBindingTableSize ) && - ( callableShaderBindingTableStride == rhs.callableShaderBindingTableStride ) && ( width == rhs.width ) && ( height == rhs.height ) && - ( depth == rhs.depth ); -# endif - } - - bool operator!=( TraceRaysIndirectCommand2KHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::DeviceAddress raygenShaderRecordAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize raygenShaderRecordSize = {}; - VULKAN_HPP_NAMESPACE::DeviceAddress missShaderBindingTableAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize missShaderBindingTableStride = {}; - VULKAN_HPP_NAMESPACE::DeviceAddress hitShaderBindingTableAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize hitShaderBindingTableStride = {}; - VULKAN_HPP_NAMESPACE::DeviceAddress callableShaderBindingTableAddress = {}; - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableSize = {}; - VULKAN_HPP_NAMESPACE::DeviceSize callableShaderBindingTableStride = {}; - uint32_t width = {}; - uint32_t height = {}; - uint32_t depth = {}; - }; - - struct TraceRaysIndirectCommandKHR - { - using NativeType = VkTraceRaysIndirectCommandKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR TraceRaysIndirectCommandKHR( uint32_t width_ = {}, uint32_t height_ = {}, uint32_t depth_ = {} ) VULKAN_HPP_NOEXCEPT - : width( width_ ) - , height( height_ ) - , depth( depth_ ) - { - } - - VULKAN_HPP_CONSTEXPR TraceRaysIndirectCommandKHR( TraceRaysIndirectCommandKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TraceRaysIndirectCommandKHR( VkTraceRaysIndirectCommandKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : TraceRaysIndirectCommandKHR( *reinterpret_cast( &rhs ) ) - { - } - - explicit TraceRaysIndirectCommandKHR( Extent2D const & extent2D, uint32_t depth_ = {} ) - : width( extent2D.width ), height( extent2D.height ), depth( depth_ ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - TraceRaysIndirectCommandKHR & operator=( TraceRaysIndirectCommandKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - TraceRaysIndirectCommandKHR & operator=( VkTraceRaysIndirectCommandKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommandKHR & setWidth( uint32_t width_ ) VULKAN_HPP_NOEXCEPT - { - width = width_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommandKHR & setHeight( uint32_t height_ ) VULKAN_HPP_NOEXCEPT - { - height = height_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 TraceRaysIndirectCommandKHR & setDepth( uint32_t depth_ ) VULKAN_HPP_NOEXCEPT - { - depth = depth_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkTraceRaysIndirectCommandKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkTraceRaysIndirectCommandKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( width, height, depth ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( TraceRaysIndirectCommandKHR const & ) const = default; -#else - bool operator==( TraceRaysIndirectCommandKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( width == rhs.width ) && ( height == rhs.height ) && ( depth == rhs.depth ); -# endif - } - - bool operator!=( TraceRaysIndirectCommandKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - uint32_t width = {}; - uint32_t height = {}; - uint32_t depth = {}; - }; - - struct ValidationCacheCreateInfoEXT - { - using NativeType = VkValidationCacheCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eValidationCacheCreateInfoEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ValidationCacheCreateInfoEXT( VULKAN_HPP_NAMESPACE::ValidationCacheCreateFlagsEXT flags_ = {}, - size_t initialDataSize_ = {}, - const void * pInitialData_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , initialDataSize( initialDataSize_ ) - , pInitialData( pInitialData_ ) - { - } - - VULKAN_HPP_CONSTEXPR ValidationCacheCreateInfoEXT( ValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationCacheCreateInfoEXT( VkValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ValidationCacheCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - ValidationCacheCreateInfoEXT( VULKAN_HPP_NAMESPACE::ValidationCacheCreateFlagsEXT flags_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & initialData_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), flags( flags_ ), initialDataSize( initialData_.size() * sizeof( T ) ), pInitialData( initialData_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ValidationCacheCreateInfoEXT & operator=( ValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationCacheCreateInfoEXT & operator=( VkValidationCacheCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ValidationCacheCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationCacheCreateInfoEXT & setFlags( VULKAN_HPP_NAMESPACE::ValidationCacheCreateFlagsEXT flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationCacheCreateInfoEXT & setInitialDataSize( size_t initialDataSize_ ) VULKAN_HPP_NOEXCEPT - { - initialDataSize = initialDataSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationCacheCreateInfoEXT & setPInitialData( const void * pInitialData_ ) VULKAN_HPP_NOEXCEPT - { - pInitialData = pInitialData_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - ValidationCacheCreateInfoEXT & setInitialData( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & initialData_ ) VULKAN_HPP_NOEXCEPT - { - initialDataSize = initialData_.size() * sizeof( T ); - pInitialData = initialData_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkValidationCacheCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkValidationCacheCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, initialDataSize, pInitialData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ValidationCacheCreateInfoEXT const & ) const = default; -#else - bool operator==( ValidationCacheCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( initialDataSize == rhs.initialDataSize ) && - ( pInitialData == rhs.pInitialData ); -# endif - } - - bool operator!=( ValidationCacheCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eValidationCacheCreateInfoEXT; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ValidationCacheCreateFlagsEXT flags = {}; - size_t initialDataSize = {}; - const void * pInitialData = {}; - }; - - template <> - struct CppType - { - using Type = ValidationCacheCreateInfoEXT; - }; - - struct ValidationFeaturesEXT - { - using NativeType = VkValidationFeaturesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eValidationFeaturesEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ValidationFeaturesEXT( uint32_t enabledValidationFeatureCount_ = {}, - const VULKAN_HPP_NAMESPACE::ValidationFeatureEnableEXT * pEnabledValidationFeatures_ = {}, - uint32_t disabledValidationFeatureCount_ = {}, - const VULKAN_HPP_NAMESPACE::ValidationFeatureDisableEXT * pDisabledValidationFeatures_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , enabledValidationFeatureCount( enabledValidationFeatureCount_ ) - , pEnabledValidationFeatures( pEnabledValidationFeatures_ ) - , disabledValidationFeatureCount( disabledValidationFeatureCount_ ) - , pDisabledValidationFeatures( pDisabledValidationFeatures_ ) - { - } - - VULKAN_HPP_CONSTEXPR ValidationFeaturesEXT( ValidationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationFeaturesEXT( VkValidationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : ValidationFeaturesEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ValidationFeaturesEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & enabledValidationFeatures_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & disabledValidationFeatures_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , enabledValidationFeatureCount( static_cast( enabledValidationFeatures_.size() ) ) - , pEnabledValidationFeatures( enabledValidationFeatures_.data() ) - , disabledValidationFeatureCount( static_cast( disabledValidationFeatures_.size() ) ) - , pDisabledValidationFeatures( disabledValidationFeatures_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ValidationFeaturesEXT & operator=( ValidationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationFeaturesEXT & operator=( VkValidationFeaturesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ValidationFeaturesEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationFeaturesEXT & setEnabledValidationFeatureCount( uint32_t enabledValidationFeatureCount_ ) VULKAN_HPP_NOEXCEPT - { - enabledValidationFeatureCount = enabledValidationFeatureCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationFeaturesEXT & - setPEnabledValidationFeatures( const VULKAN_HPP_NAMESPACE::ValidationFeatureEnableEXT * pEnabledValidationFeatures_ ) VULKAN_HPP_NOEXCEPT - { - pEnabledValidationFeatures = pEnabledValidationFeatures_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ValidationFeaturesEXT & setEnabledValidationFeatures( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & enabledValidationFeatures_ ) - VULKAN_HPP_NOEXCEPT - { - enabledValidationFeatureCount = static_cast( enabledValidationFeatures_.size() ); - pEnabledValidationFeatures = enabledValidationFeatures_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 ValidationFeaturesEXT & setDisabledValidationFeatureCount( uint32_t disabledValidationFeatureCount_ ) VULKAN_HPP_NOEXCEPT - { - disabledValidationFeatureCount = disabledValidationFeatureCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationFeaturesEXT & - setPDisabledValidationFeatures( const VULKAN_HPP_NAMESPACE::ValidationFeatureDisableEXT * pDisabledValidationFeatures_ ) VULKAN_HPP_NOEXCEPT - { - pDisabledValidationFeatures = pDisabledValidationFeatures_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ValidationFeaturesEXT & setDisabledValidationFeatures( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & disabledValidationFeatures_ ) - VULKAN_HPP_NOEXCEPT - { - disabledValidationFeatureCount = static_cast( disabledValidationFeatures_.size() ); - pDisabledValidationFeatures = disabledValidationFeatures_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkValidationFeaturesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkValidationFeaturesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, enabledValidationFeatureCount, pEnabledValidationFeatures, disabledValidationFeatureCount, pDisabledValidationFeatures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ValidationFeaturesEXT const & ) const = default; -#else - bool operator==( ValidationFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( enabledValidationFeatureCount == rhs.enabledValidationFeatureCount ) && - ( pEnabledValidationFeatures == rhs.pEnabledValidationFeatures ) && ( disabledValidationFeatureCount == rhs.disabledValidationFeatureCount ) && - ( pDisabledValidationFeatures == rhs.pDisabledValidationFeatures ); -# endif - } - - bool operator!=( ValidationFeaturesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eValidationFeaturesEXT; - const void * pNext = {}; - uint32_t enabledValidationFeatureCount = {}; - const VULKAN_HPP_NAMESPACE::ValidationFeatureEnableEXT * pEnabledValidationFeatures = {}; - uint32_t disabledValidationFeatureCount = {}; - const VULKAN_HPP_NAMESPACE::ValidationFeatureDisableEXT * pDisabledValidationFeatures = {}; - }; - - template <> - struct CppType - { - using Type = ValidationFeaturesEXT; - }; - - struct ValidationFlagsEXT - { - using NativeType = VkValidationFlagsEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eValidationFlagsEXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR ValidationFlagsEXT( uint32_t disabledValidationCheckCount_ = {}, - const VULKAN_HPP_NAMESPACE::ValidationCheckEXT * pDisabledValidationChecks_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , disabledValidationCheckCount( disabledValidationCheckCount_ ) - , pDisabledValidationChecks( pDisabledValidationChecks_ ) - { - } - - VULKAN_HPP_CONSTEXPR ValidationFlagsEXT( ValidationFlagsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationFlagsEXT( VkValidationFlagsEXT const & rhs ) VULKAN_HPP_NOEXCEPT : ValidationFlagsEXT( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ValidationFlagsEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & disabledValidationChecks_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , disabledValidationCheckCount( static_cast( disabledValidationChecks_.size() ) ) - , pDisabledValidationChecks( disabledValidationChecks_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ValidationFlagsEXT & operator=( ValidationFlagsEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ValidationFlagsEXT & operator=( VkValidationFlagsEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ValidationFlagsEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationFlagsEXT & setDisabledValidationCheckCount( uint32_t disabledValidationCheckCount_ ) VULKAN_HPP_NOEXCEPT - { - disabledValidationCheckCount = disabledValidationCheckCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ValidationFlagsEXT & - setPDisabledValidationChecks( const VULKAN_HPP_NAMESPACE::ValidationCheckEXT * pDisabledValidationChecks_ ) VULKAN_HPP_NOEXCEPT - { - pDisabledValidationChecks = pDisabledValidationChecks_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - ValidationFlagsEXT & setDisabledValidationChecks( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & disabledValidationChecks_ ) VULKAN_HPP_NOEXCEPT - { - disabledValidationCheckCount = static_cast( disabledValidationChecks_.size() ); - pDisabledValidationChecks = disabledValidationChecks_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkValidationFlagsEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkValidationFlagsEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, disabledValidationCheckCount, pDisabledValidationChecks ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ValidationFlagsEXT const & ) const = default; -#else - bool operator==( ValidationFlagsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( disabledValidationCheckCount == rhs.disabledValidationCheckCount ) && - ( pDisabledValidationChecks == rhs.pDisabledValidationChecks ); -# endif - } - - bool operator!=( ValidationFlagsEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eValidationFlagsEXT; - const void * pNext = {}; - uint32_t disabledValidationCheckCount = {}; - const VULKAN_HPP_NAMESPACE::ValidationCheckEXT * pDisabledValidationChecks = {}; - }; - - template <> - struct CppType - { - using Type = ValidationFlagsEXT; - }; - - struct VertexInputAttributeDescription2EXT - { - using NativeType = VkVertexInputAttributeDescription2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVertexInputAttributeDescription2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VertexInputAttributeDescription2EXT( uint32_t location_ = {}, - uint32_t binding_ = {}, - VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - uint32_t offset_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , location( location_ ) - , binding( binding_ ) - , format( format_ ) - , offset( offset_ ) - { - } - - VULKAN_HPP_CONSTEXPR VertexInputAttributeDescription2EXT( VertexInputAttributeDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputAttributeDescription2EXT( VkVertexInputAttributeDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VertexInputAttributeDescription2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VertexInputAttributeDescription2EXT & operator=( VertexInputAttributeDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputAttributeDescription2EXT & operator=( VkVertexInputAttributeDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription2EXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription2EXT & setLocation( uint32_t location_ ) VULKAN_HPP_NOEXCEPT - { - location = location_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription2EXT & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription2EXT & setFormat( VULKAN_HPP_NAMESPACE::Format format_ ) VULKAN_HPP_NOEXCEPT - { - format = format_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputAttributeDescription2EXT & setOffset( uint32_t offset_ ) VULKAN_HPP_NOEXCEPT - { - offset = offset_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVertexInputAttributeDescription2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVertexInputAttributeDescription2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, location, binding, format, offset ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VertexInputAttributeDescription2EXT const & ) const = default; -#else - bool operator==( VertexInputAttributeDescription2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( location == rhs.location ) && ( binding == rhs.binding ) && ( format == rhs.format ) && - ( offset == rhs.offset ); -# endif - } - - bool operator!=( VertexInputAttributeDescription2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVertexInputAttributeDescription2EXT; - void * pNext = {}; - uint32_t location = {}; - uint32_t binding = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - uint32_t offset = {}; - }; - - template <> - struct CppType - { - using Type = VertexInputAttributeDescription2EXT; - }; - - struct VertexInputBindingDescription2EXT - { - using NativeType = VkVertexInputBindingDescription2EXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVertexInputBindingDescription2EXT; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VertexInputBindingDescription2EXT( uint32_t binding_ = {}, - uint32_t stride_ = {}, - VULKAN_HPP_NAMESPACE::VertexInputRate inputRate_ = VULKAN_HPP_NAMESPACE::VertexInputRate::eVertex, - uint32_t divisor_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , binding( binding_ ) - , stride( stride_ ) - , inputRate( inputRate_ ) - , divisor( divisor_ ) - { - } - - VULKAN_HPP_CONSTEXPR VertexInputBindingDescription2EXT( VertexInputBindingDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDescription2EXT( VkVertexInputBindingDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VertexInputBindingDescription2EXT( *reinterpret_cast( &rhs ) ) - { - } -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VertexInputBindingDescription2EXT & operator=( VertexInputBindingDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VertexInputBindingDescription2EXT & operator=( VkVertexInputBindingDescription2EXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription2EXT & setPNext( void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription2EXT & setBinding( uint32_t binding_ ) VULKAN_HPP_NOEXCEPT - { - binding = binding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription2EXT & setStride( uint32_t stride_ ) VULKAN_HPP_NOEXCEPT - { - stride = stride_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription2EXT & setInputRate( VULKAN_HPP_NAMESPACE::VertexInputRate inputRate_ ) VULKAN_HPP_NOEXCEPT - { - inputRate = inputRate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VertexInputBindingDescription2EXT & setDivisor( uint32_t divisor_ ) VULKAN_HPP_NOEXCEPT - { - divisor = divisor_; - return *this; - } -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVertexInputBindingDescription2EXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVertexInputBindingDescription2EXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, binding, stride, inputRate, divisor ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VertexInputBindingDescription2EXT const & ) const = default; -#else - bool operator==( VertexInputBindingDescription2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( binding == rhs.binding ) && ( stride == rhs.stride ) && ( inputRate == rhs.inputRate ) && - ( divisor == rhs.divisor ); -# endif - } - - bool operator!=( VertexInputBindingDescription2EXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVertexInputBindingDescription2EXT; - void * pNext = {}; - uint32_t binding = {}; - uint32_t stride = {}; - VULKAN_HPP_NAMESPACE::VertexInputRate inputRate = VULKAN_HPP_NAMESPACE::VertexInputRate::eVertex; - uint32_t divisor = {}; - }; - - template <> - struct CppType - { - using Type = VertexInputBindingDescription2EXT; - }; - -#if defined( VK_USE_PLATFORM_VI_NN ) - struct ViSurfaceCreateInfoNN - { - using NativeType = VkViSurfaceCreateInfoNN; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eViSurfaceCreateInfoNN; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - ViSurfaceCreateInfoNN( VULKAN_HPP_NAMESPACE::ViSurfaceCreateFlagsNN flags_ = {}, void * window_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , window( window_ ) - { - } - - VULKAN_HPP_CONSTEXPR ViSurfaceCreateInfoNN( ViSurfaceCreateInfoNN const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViSurfaceCreateInfoNN( VkViSurfaceCreateInfoNN const & rhs ) VULKAN_HPP_NOEXCEPT - : ViSurfaceCreateInfoNN( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - ViSurfaceCreateInfoNN & operator=( ViSurfaceCreateInfoNN const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - ViSurfaceCreateInfoNN & operator=( VkViSurfaceCreateInfoNN const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 ViSurfaceCreateInfoNN & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViSurfaceCreateInfoNN & setFlags( VULKAN_HPP_NAMESPACE::ViSurfaceCreateFlagsNN flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 ViSurfaceCreateInfoNN & setWindow( void * window_ ) VULKAN_HPP_NOEXCEPT - { - window = window_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkViSurfaceCreateInfoNN const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkViSurfaceCreateInfoNN &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, window ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( ViSurfaceCreateInfoNN const & ) const = default; -# else - bool operator==( ViSurfaceCreateInfoNN const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( window == rhs.window ); -# endif - } - - bool operator!=( ViSurfaceCreateInfoNN const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eViSurfaceCreateInfoNN; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::ViSurfaceCreateFlagsNN flags = {}; - void * window = {}; - }; - - template <> - struct CppType - { - using Type = ViSurfaceCreateInfoNN; - }; -#endif /*VK_USE_PLATFORM_VI_NN*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoPictureResourceInfoKHR - { - using NativeType = VkVideoPictureResourceInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoPictureResourceInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoPictureResourceInfoKHR( VULKAN_HPP_NAMESPACE::Offset2D codedOffset_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D codedExtent_ = {}, - uint32_t baseArrayLayer_ = {}, - VULKAN_HPP_NAMESPACE::ImageView imageViewBinding_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , codedOffset( codedOffset_ ) - , codedExtent( codedExtent_ ) - , baseArrayLayer( baseArrayLayer_ ) - , imageViewBinding( imageViewBinding_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoPictureResourceInfoKHR( VideoPictureResourceInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoPictureResourceInfoKHR( VkVideoPictureResourceInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoPictureResourceInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoPictureResourceInfoKHR & operator=( VideoPictureResourceInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoPictureResourceInfoKHR & operator=( VkVideoPictureResourceInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoPictureResourceInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoPictureResourceInfoKHR & setCodedOffset( VULKAN_HPP_NAMESPACE::Offset2D const & codedOffset_ ) VULKAN_HPP_NOEXCEPT - { - codedOffset = codedOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoPictureResourceInfoKHR & setCodedExtent( VULKAN_HPP_NAMESPACE::Extent2D const & codedExtent_ ) VULKAN_HPP_NOEXCEPT - { - codedExtent = codedExtent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoPictureResourceInfoKHR & setBaseArrayLayer( uint32_t baseArrayLayer_ ) VULKAN_HPP_NOEXCEPT - { - baseArrayLayer = baseArrayLayer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoPictureResourceInfoKHR & setImageViewBinding( VULKAN_HPP_NAMESPACE::ImageView imageViewBinding_ ) VULKAN_HPP_NOEXCEPT - { - imageViewBinding = imageViewBinding_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoPictureResourceInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoPictureResourceInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, codedOffset, codedExtent, baseArrayLayer, imageViewBinding ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoPictureResourceInfoKHR const & ) const = default; -# else - bool operator==( VideoPictureResourceInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( codedOffset == rhs.codedOffset ) && ( codedExtent == rhs.codedExtent ) && - ( baseArrayLayer == rhs.baseArrayLayer ) && ( imageViewBinding == rhs.imageViewBinding ); -# endif - } - - bool operator!=( VideoPictureResourceInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoPictureResourceInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Offset2D codedOffset = {}; - VULKAN_HPP_NAMESPACE::Extent2D codedExtent = {}; - uint32_t baseArrayLayer = {}; - VULKAN_HPP_NAMESPACE::ImageView imageViewBinding = {}; - }; - - template <> - struct CppType - { - using Type = VideoPictureResourceInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoReferenceSlotInfoKHR - { - using NativeType = VkVideoReferenceSlotInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoReferenceSlotInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoReferenceSlotInfoKHR( int8_t slotIndex_ = {}, - const VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR * pPictureResource_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , slotIndex( slotIndex_ ) - , pPictureResource( pPictureResource_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoReferenceSlotInfoKHR( VideoReferenceSlotInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoReferenceSlotInfoKHR( VkVideoReferenceSlotInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoReferenceSlotInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoReferenceSlotInfoKHR & operator=( VideoReferenceSlotInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoReferenceSlotInfoKHR & operator=( VkVideoReferenceSlotInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoReferenceSlotInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoReferenceSlotInfoKHR & setSlotIndex( int8_t slotIndex_ ) VULKAN_HPP_NOEXCEPT - { - slotIndex = slotIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoReferenceSlotInfoKHR & - setPPictureResource( const VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR * pPictureResource_ ) VULKAN_HPP_NOEXCEPT - { - pPictureResource = pPictureResource_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoReferenceSlotInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoReferenceSlotInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, slotIndex, pPictureResource ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoReferenceSlotInfoKHR const & ) const = default; -# else - bool operator==( VideoReferenceSlotInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( slotIndex == rhs.slotIndex ) && ( pPictureResource == rhs.pPictureResource ); -# endif - } - - bool operator!=( VideoReferenceSlotInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoReferenceSlotInfoKHR; - const void * pNext = {}; - int8_t slotIndex = {}; - const VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR * pPictureResource = {}; - }; - - template <> - struct CppType - { - using Type = VideoReferenceSlotInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoBeginCodingInfoKHR - { - using NativeType = VkVideoBeginCodingInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoBeginCodingInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoBeginCodingInfoKHR( VULKAN_HPP_NAMESPACE::VideoBeginCodingFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession_ = {}, - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters_ = {}, - uint32_t referenceSlotCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , videoSession( videoSession_ ) - , videoSessionParameters( videoSessionParameters_ ) - , referenceSlotCount( referenceSlotCount_ ) - , pReferenceSlots( pReferenceSlots_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoBeginCodingInfoKHR( VideoBeginCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoBeginCodingInfoKHR( VkVideoBeginCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoBeginCodingInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoBeginCodingInfoKHR( VULKAN_HPP_NAMESPACE::VideoBeginCodingFlagsKHR flags_, - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession_, - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , videoSession( videoSession_ ) - , videoSessionParameters( videoSessionParameters_ ) - , referenceSlotCount( static_cast( referenceSlots_.size() ) ) - , pReferenceSlots( referenceSlots_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoBeginCodingInfoKHR & operator=( VideoBeginCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoBeginCodingInfoKHR & operator=( VkVideoBeginCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoBeginCodingFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & setVideoSession( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession_ ) VULKAN_HPP_NOEXCEPT - { - videoSession = videoSession_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & - setVideoSessionParameters( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters_ ) VULKAN_HPP_NOEXCEPT - { - videoSessionParameters = videoSessionParameters_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & setReferenceSlotCount( uint32_t referenceSlotCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = referenceSlotCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoBeginCodingInfoKHR & - setPReferenceSlots( const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceSlots = pReferenceSlots_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoBeginCodingInfoKHR & setReferenceSlots( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = static_cast( referenceSlots_.size() ); - pReferenceSlots = referenceSlots_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoBeginCodingInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoBeginCodingInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, videoSession, videoSessionParameters, referenceSlotCount, pReferenceSlots ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoBeginCodingInfoKHR const & ) const = default; -# else - bool operator==( VideoBeginCodingInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( videoSession == rhs.videoSession ) && - ( videoSessionParameters == rhs.videoSessionParameters ) && ( referenceSlotCount == rhs.referenceSlotCount ) && - ( pReferenceSlots == rhs.pReferenceSlots ); -# endif - } - - bool operator!=( VideoBeginCodingInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoBeginCodingInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoBeginCodingFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession = {}; - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParameters = {}; - uint32_t referenceSlotCount = {}; - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots = {}; - }; - - template <> - struct CppType - { - using Type = VideoBeginCodingInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoCapabilitiesKHR - { - using NativeType = VkVideoCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoCapabilitiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 VideoCapabilitiesKHR( VULKAN_HPP_NAMESPACE::VideoCapabilityFlagsKHR capabilityFlags_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize minBitstreamBufferOffsetAlignment_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize minBitstreamBufferSizeAlignment_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D videoPictureExtentGranularity_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D minExtent_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D maxExtent_ = {}, - uint32_t maxReferencePicturesSlotsCount_ = {}, - uint32_t maxReferencePicturesActiveCount_ = {}, - VULKAN_HPP_NAMESPACE::ExtensionProperties stdHeaderVersion_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , capabilityFlags( capabilityFlags_ ) - , minBitstreamBufferOffsetAlignment( minBitstreamBufferOffsetAlignment_ ) - , minBitstreamBufferSizeAlignment( minBitstreamBufferSizeAlignment_ ) - , videoPictureExtentGranularity( videoPictureExtentGranularity_ ) - , minExtent( minExtent_ ) - , maxExtent( maxExtent_ ) - , maxReferencePicturesSlotsCount( maxReferencePicturesSlotsCount_ ) - , maxReferencePicturesActiveCount( maxReferencePicturesActiveCount_ ) - , stdHeaderVersion( stdHeaderVersion_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 VideoCapabilitiesKHR( VideoCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoCapabilitiesKHR( VkVideoCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoCapabilitiesKHR & operator=( VideoCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoCapabilitiesKHR & operator=( VkVideoCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - capabilityFlags, - minBitstreamBufferOffsetAlignment, - minBitstreamBufferSizeAlignment, - videoPictureExtentGranularity, - minExtent, - maxExtent, - maxReferencePicturesSlotsCount, - maxReferencePicturesActiveCount, - stdHeaderVersion ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoCapabilitiesKHR const & ) const = default; -# else - bool operator==( VideoCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( capabilityFlags == rhs.capabilityFlags ) && - ( minBitstreamBufferOffsetAlignment == rhs.minBitstreamBufferOffsetAlignment ) && - ( minBitstreamBufferSizeAlignment == rhs.minBitstreamBufferSizeAlignment ) && - ( videoPictureExtentGranularity == rhs.videoPictureExtentGranularity ) && ( minExtent == rhs.minExtent ) && ( maxExtent == rhs.maxExtent ) && - ( maxReferencePicturesSlotsCount == rhs.maxReferencePicturesSlotsCount ) && - ( maxReferencePicturesActiveCount == rhs.maxReferencePicturesActiveCount ) && ( stdHeaderVersion == rhs.stdHeaderVersion ); -# endif - } - - bool operator!=( VideoCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoCapabilitiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoCapabilityFlagsKHR capabilityFlags = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minBitstreamBufferOffsetAlignment = {}; - VULKAN_HPP_NAMESPACE::DeviceSize minBitstreamBufferSizeAlignment = {}; - VULKAN_HPP_NAMESPACE::Extent2D videoPictureExtentGranularity = {}; - VULKAN_HPP_NAMESPACE::Extent2D minExtent = {}; - VULKAN_HPP_NAMESPACE::Extent2D maxExtent = {}; - uint32_t maxReferencePicturesSlotsCount = {}; - uint32_t maxReferencePicturesActiveCount = {}; - VULKAN_HPP_NAMESPACE::ExtensionProperties stdHeaderVersion = {}; - }; - - template <> - struct CppType - { - using Type = VideoCapabilitiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoCodingControlInfoKHR - { - using NativeType = VkVideoCodingControlInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoCodingControlInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoCodingControlInfoKHR( VULKAN_HPP_NAMESPACE::VideoCodingControlFlagsKHR flags_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoCodingControlInfoKHR( VideoCodingControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoCodingControlInfoKHR( VkVideoCodingControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoCodingControlInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoCodingControlInfoKHR & operator=( VideoCodingControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoCodingControlInfoKHR & operator=( VkVideoCodingControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoCodingControlInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoCodingControlInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoCodingControlFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoCodingControlInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoCodingControlInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoCodingControlInfoKHR const & ) const = default; -# else - bool operator==( VideoCodingControlInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( VideoCodingControlInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoCodingControlInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoCodingControlFlagsKHR flags = {}; - }; - - template <> - struct CppType - { - using Type = VideoCodingControlInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeCapabilitiesKHR - { - using NativeType = VkVideoDecodeCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeCapabilitiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeCapabilitiesKHR( VULKAN_HPP_NAMESPACE::VideoDecodeCapabilityFlagsKHR flags_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeCapabilitiesKHR( VideoDecodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeCapabilitiesKHR( VkVideoDecodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeCapabilitiesKHR & operator=( VideoDecodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeCapabilitiesKHR & operator=( VkVideoDecodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoDecodeCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeCapabilitiesKHR const & ) const = default; -# else - bool operator==( VideoDecodeCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( VideoDecodeCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeCapabilitiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoDecodeCapabilityFlagsKHR flags = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeCapabilitiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264CapabilitiesEXT - { - using NativeType = VkVideoDecodeH264CapabilitiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264CapabilitiesEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264CapabilitiesEXT( StdVideoH264Level maxLevel_ = {}, - VULKAN_HPP_NAMESPACE::Offset2D fieldOffsetGranularity_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxLevel( maxLevel_ ) - , fieldOffsetGranularity( fieldOffsetGranularity_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264CapabilitiesEXT( VideoDecodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264CapabilitiesEXT( VkVideoDecodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264CapabilitiesEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264CapabilitiesEXT & operator=( VideoDecodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264CapabilitiesEXT & operator=( VkVideoDecodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoDecodeH264CapabilitiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264CapabilitiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxLevel, fieldOffsetGranularity ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoDecodeH264CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &maxLevel, &rhs.maxLevel, sizeof( StdVideoH264Level ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = fieldOffsetGranularity <=> rhs.fieldOffsetGranularity; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoDecodeH264CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &maxLevel, &rhs.maxLevel, sizeof( StdVideoH264Level ) ) == 0 ) && - ( fieldOffsetGranularity == rhs.fieldOffsetGranularity ); - } - - bool operator!=( VideoDecodeH264CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264CapabilitiesEXT; - void * pNext = {}; - StdVideoH264Level maxLevel = {}; - VULKAN_HPP_NAMESPACE::Offset2D fieldOffsetGranularity = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264CapabilitiesEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264DpbSlotInfoEXT - { - using NativeType = VkVideoDecodeH264DpbSlotInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264DpbSlotInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264DpbSlotInfoEXT( const StdVideoDecodeH264ReferenceInfo * pStdReferenceInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pStdReferenceInfo( pStdReferenceInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264DpbSlotInfoEXT( VideoDecodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264DpbSlotInfoEXT( VkVideoDecodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264DpbSlotInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264DpbSlotInfoEXT & operator=( VideoDecodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264DpbSlotInfoEXT & operator=( VkVideoDecodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264DpbSlotInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264DpbSlotInfoEXT & - setPStdReferenceInfo( const StdVideoDecodeH264ReferenceInfo * pStdReferenceInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdReferenceInfo = pStdReferenceInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264DpbSlotInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264DpbSlotInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pStdReferenceInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH264DpbSlotInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH264DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pStdReferenceInfo == rhs.pStdReferenceInfo ); -# endif - } - - bool operator!=( VideoDecodeH264DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264DpbSlotInfoEXT; - const void * pNext = {}; - const StdVideoDecodeH264ReferenceInfo * pStdReferenceInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264DpbSlotInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264MvcInfoEXT - { - using NativeType = VkVideoDecodeH264MvcInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264MvcInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264MvcInfoEXT( const StdVideoDecodeH264Mvc * pStdMvc_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pStdMvc( pStdMvc_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264MvcInfoEXT( VideoDecodeH264MvcInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264MvcInfoEXT( VkVideoDecodeH264MvcInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264MvcInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264MvcInfoEXT & operator=( VideoDecodeH264MvcInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264MvcInfoEXT & operator=( VkVideoDecodeH264MvcInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264MvcInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264MvcInfoEXT & setPStdMvc( const StdVideoDecodeH264Mvc * pStdMvc_ ) VULKAN_HPP_NOEXCEPT - { - pStdMvc = pStdMvc_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264MvcInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264MvcInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pStdMvc ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH264MvcInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH264MvcInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pStdMvc == rhs.pStdMvc ); -# endif - } - - bool operator!=( VideoDecodeH264MvcInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264MvcInfoEXT; - const void * pNext = {}; - const StdVideoDecodeH264Mvc * pStdMvc = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264MvcInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264PictureInfoEXT - { - using NativeType = VkVideoDecodeH264PictureInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264PictureInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureInfoEXT( const StdVideoDecodeH264PictureInfo * pStdPictureInfo_ = {}, - uint32_t slicesCount_ = {}, - const uint32_t * pSlicesDataOffsets_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pStdPictureInfo( pStdPictureInfo_ ) - , slicesCount( slicesCount_ ) - , pSlicesDataOffsets( pSlicesDataOffsets_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264PictureInfoEXT( VideoDecodeH264PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264PictureInfoEXT( VkVideoDecodeH264PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264PictureInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH264PictureInfoEXT( const StdVideoDecodeH264PictureInfo * pStdPictureInfo_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & slicesDataOffsets_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pStdPictureInfo( pStdPictureInfo_ ) - , slicesCount( static_cast( slicesDataOffsets_.size() ) ) - , pSlicesDataOffsets( slicesDataOffsets_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264PictureInfoEXT & operator=( VideoDecodeH264PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264PictureInfoEXT & operator=( VkVideoDecodeH264PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264PictureInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264PictureInfoEXT & setPStdPictureInfo( const StdVideoDecodeH264PictureInfo * pStdPictureInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdPictureInfo = pStdPictureInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264PictureInfoEXT & setSlicesCount( uint32_t slicesCount_ ) VULKAN_HPP_NOEXCEPT - { - slicesCount = slicesCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264PictureInfoEXT & setPSlicesDataOffsets( const uint32_t * pSlicesDataOffsets_ ) VULKAN_HPP_NOEXCEPT - { - pSlicesDataOffsets = pSlicesDataOffsets_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH264PictureInfoEXT & - setSlicesDataOffsets( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & slicesDataOffsets_ ) VULKAN_HPP_NOEXCEPT - { - slicesCount = static_cast( slicesDataOffsets_.size() ); - pSlicesDataOffsets = slicesDataOffsets_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264PictureInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264PictureInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pStdPictureInfo, slicesCount, pSlicesDataOffsets ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH264PictureInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH264PictureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pStdPictureInfo == rhs.pStdPictureInfo ) && ( slicesCount == rhs.slicesCount ) && - ( pSlicesDataOffsets == rhs.pSlicesDataOffsets ); -# endif - } - - bool operator!=( VideoDecodeH264PictureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264PictureInfoEXT; - const void * pNext = {}; - const StdVideoDecodeH264PictureInfo * pStdPictureInfo = {}; - uint32_t slicesCount = {}; - const uint32_t * pSlicesDataOffsets = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264PictureInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264ProfileInfoEXT - { - using NativeType = VkVideoDecodeH264ProfileInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264ProfileInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264ProfileInfoEXT( StdVideoH264ProfileIdc stdProfileIdc_ = {}, - VULKAN_HPP_NAMESPACE::VideoDecodeH264PictureLayoutFlagsEXT pictureLayout_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stdProfileIdc( stdProfileIdc_ ) - , pictureLayout( pictureLayout_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264ProfileInfoEXT( VideoDecodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264ProfileInfoEXT( VkVideoDecodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264ProfileInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264ProfileInfoEXT & operator=( VideoDecodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264ProfileInfoEXT & operator=( VkVideoDecodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264ProfileInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264ProfileInfoEXT & setStdProfileIdc( StdVideoH264ProfileIdc stdProfileIdc_ ) VULKAN_HPP_NOEXCEPT - { - stdProfileIdc = stdProfileIdc_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264ProfileInfoEXT & - setPictureLayout( VULKAN_HPP_NAMESPACE::VideoDecodeH264PictureLayoutFlagsEXT pictureLayout_ ) VULKAN_HPP_NOEXCEPT - { - pictureLayout = pictureLayout_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264ProfileInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264ProfileInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stdProfileIdc, pictureLayout ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoDecodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH264ProfileIdc ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - if ( auto cmp = pictureLayout <=> rhs.pictureLayout; cmp != 0 ) - return cmp; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoDecodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH264ProfileIdc ) ) == 0 ) && - ( pictureLayout == rhs.pictureLayout ); - } - - bool operator!=( VideoDecodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264ProfileInfoEXT; - const void * pNext = {}; - StdVideoH264ProfileIdc stdProfileIdc = {}; - VULKAN_HPP_NAMESPACE::VideoDecodeH264PictureLayoutFlagsEXT pictureLayout = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264ProfileInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264SessionParametersAddInfoEXT - { - using NativeType = VkVideoDecodeH264SessionParametersAddInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264SessionParametersAddInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH264SessionParametersAddInfoEXT( uint32_t spsStdCount_ = {}, - const StdVideoH264SequenceParameterSet * pSpsStd_ = {}, - uint32_t ppsStdCount_ = {}, - const StdVideoH264PictureParameterSet * pPpsStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , spsStdCount( spsStdCount_ ) - , pSpsStd( pSpsStd_ ) - , ppsStdCount( ppsStdCount_ ) - , pPpsStd( pPpsStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH264SessionParametersAddInfoEXT( VideoDecodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264SessionParametersAddInfoEXT( VkVideoDecodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264SessionParametersAddInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH264SessionParametersAddInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , spsStdCount( static_cast( spsStd_.size() ) ) - , pSpsStd( spsStd_.data() ) - , ppsStdCount( static_cast( ppsStd_.size() ) ) - , pPpsStd( ppsStd_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264SessionParametersAddInfoEXT & operator=( VideoDecodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264SessionParametersAddInfoEXT & operator=( VkVideoDecodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersAddInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersAddInfoEXT & setSpsStdCount( uint32_t spsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = spsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersAddInfoEXT & setPSpsStd( const StdVideoH264SequenceParameterSet * pSpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pSpsStd = pSpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH264SessionParametersAddInfoEXT & - setSpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = static_cast( spsStd_.size() ); - pSpsStd = spsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersAddInfoEXT & setPpsStdCount( uint32_t ppsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = ppsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersAddInfoEXT & setPPpsStd( const StdVideoH264PictureParameterSet * pPpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pPpsStd = pPpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH264SessionParametersAddInfoEXT & - setPpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = static_cast( ppsStd_.size() ); - pPpsStd = ppsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264SessionParametersAddInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264SessionParametersAddInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, spsStdCount, pSpsStd, ppsStdCount, pPpsStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH264SessionParametersAddInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH264SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( spsStdCount == rhs.spsStdCount ) && ( pSpsStd == rhs.pSpsStd ) && - ( ppsStdCount == rhs.ppsStdCount ) && ( pPpsStd == rhs.pPpsStd ); -# endif - } - - bool operator!=( VideoDecodeH264SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264SessionParametersAddInfoEXT; - const void * pNext = {}; - uint32_t spsStdCount = {}; - const StdVideoH264SequenceParameterSet * pSpsStd = {}; - uint32_t ppsStdCount = {}; - const StdVideoH264PictureParameterSet * pPpsStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264SessionParametersAddInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH264SessionParametersCreateInfoEXT - { - using NativeType = VkVideoDecodeH264SessionParametersCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH264SessionParametersCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VideoDecodeH264SessionParametersCreateInfoEXT( uint32_t maxSpsStdCount_ = {}, - uint32_t maxPpsStdCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersAddInfoEXT * pParametersAddInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxSpsStdCount( maxSpsStdCount_ ) - , maxPpsStdCount( maxPpsStdCount_ ) - , pParametersAddInfo( pParametersAddInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR - VideoDecodeH264SessionParametersCreateInfoEXT( VideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264SessionParametersCreateInfoEXT( VkVideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH264SessionParametersCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH264SessionParametersCreateInfoEXT & operator=( VideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH264SessionParametersCreateInfoEXT & operator=( VkVideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersCreateInfoEXT & setMaxSpsStdCount( uint32_t maxSpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxSpsStdCount = maxSpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersCreateInfoEXT & setMaxPpsStdCount( uint32_t maxPpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxPpsStdCount = maxPpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH264SessionParametersCreateInfoEXT & - setPParametersAddInfo( const VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersAddInfoEXT * pParametersAddInfo_ ) VULKAN_HPP_NOEXCEPT - { - pParametersAddInfo = pParametersAddInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH264SessionParametersCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH264SessionParametersCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxSpsStdCount, maxPpsStdCount, pParametersAddInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH264SessionParametersCreateInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxSpsStdCount == rhs.maxSpsStdCount ) && ( maxPpsStdCount == rhs.maxPpsStdCount ) && - ( pParametersAddInfo == rhs.pParametersAddInfo ); -# endif - } - - bool operator!=( VideoDecodeH264SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH264SessionParametersCreateInfoEXT; - const void * pNext = {}; - uint32_t maxSpsStdCount = {}; - uint32_t maxPpsStdCount = {}; - const VULKAN_HPP_NAMESPACE::VideoDecodeH264SessionParametersAddInfoEXT * pParametersAddInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH264SessionParametersCreateInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265CapabilitiesEXT - { - using NativeType = VkVideoDecodeH265CapabilitiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265CapabilitiesEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH265CapabilitiesEXT( StdVideoH265Level maxLevel_ = {}, void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxLevel( maxLevel_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH265CapabilitiesEXT( VideoDecodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265CapabilitiesEXT( VkVideoDecodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265CapabilitiesEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265CapabilitiesEXT & operator=( VideoDecodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265CapabilitiesEXT & operator=( VkVideoDecodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoDecodeH265CapabilitiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265CapabilitiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxLevel ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoDecodeH265CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &maxLevel, &rhs.maxLevel, sizeof( StdVideoH265Level ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoDecodeH265CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &maxLevel, &rhs.maxLevel, sizeof( StdVideoH265Level ) ) == 0 ); - } - - bool operator!=( VideoDecodeH265CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265CapabilitiesEXT; - void * pNext = {}; - StdVideoH265Level maxLevel = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265CapabilitiesEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265DpbSlotInfoEXT - { - using NativeType = VkVideoDecodeH265DpbSlotInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265DpbSlotInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH265DpbSlotInfoEXT( const StdVideoDecodeH265ReferenceInfo * pStdReferenceInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pStdReferenceInfo( pStdReferenceInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH265DpbSlotInfoEXT( VideoDecodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265DpbSlotInfoEXT( VkVideoDecodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265DpbSlotInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265DpbSlotInfoEXT & operator=( VideoDecodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265DpbSlotInfoEXT & operator=( VkVideoDecodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265DpbSlotInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265DpbSlotInfoEXT & - setPStdReferenceInfo( const StdVideoDecodeH265ReferenceInfo * pStdReferenceInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdReferenceInfo = pStdReferenceInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH265DpbSlotInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265DpbSlotInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pStdReferenceInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH265DpbSlotInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH265DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pStdReferenceInfo == rhs.pStdReferenceInfo ); -# endif - } - - bool operator!=( VideoDecodeH265DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265DpbSlotInfoEXT; - const void * pNext = {}; - const StdVideoDecodeH265ReferenceInfo * pStdReferenceInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265DpbSlotInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265PictureInfoEXT - { - using NativeType = VkVideoDecodeH265PictureInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265PictureInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH265PictureInfoEXT( StdVideoDecodeH265PictureInfo * pStdPictureInfo_ = {}, - uint32_t slicesCount_ = {}, - const uint32_t * pSlicesDataOffsets_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pStdPictureInfo( pStdPictureInfo_ ) - , slicesCount( slicesCount_ ) - , pSlicesDataOffsets( pSlicesDataOffsets_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH265PictureInfoEXT( VideoDecodeH265PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265PictureInfoEXT( VkVideoDecodeH265PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265PictureInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265PictureInfoEXT( StdVideoDecodeH265PictureInfo * pStdPictureInfo_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & slicesDataOffsets_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pStdPictureInfo( pStdPictureInfo_ ) - , slicesCount( static_cast( slicesDataOffsets_.size() ) ) - , pSlicesDataOffsets( slicesDataOffsets_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265PictureInfoEXT & operator=( VideoDecodeH265PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265PictureInfoEXT & operator=( VkVideoDecodeH265PictureInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265PictureInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265PictureInfoEXT & setPStdPictureInfo( StdVideoDecodeH265PictureInfo * pStdPictureInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdPictureInfo = pStdPictureInfo_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265PictureInfoEXT & setSlicesCount( uint32_t slicesCount_ ) VULKAN_HPP_NOEXCEPT - { - slicesCount = slicesCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265PictureInfoEXT & setPSlicesDataOffsets( const uint32_t * pSlicesDataOffsets_ ) VULKAN_HPP_NOEXCEPT - { - pSlicesDataOffsets = pSlicesDataOffsets_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265PictureInfoEXT & - setSlicesDataOffsets( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & slicesDataOffsets_ ) VULKAN_HPP_NOEXCEPT - { - slicesCount = static_cast( slicesDataOffsets_.size() ); - pSlicesDataOffsets = slicesDataOffsets_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH265PictureInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265PictureInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pStdPictureInfo, slicesCount, pSlicesDataOffsets ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH265PictureInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH265PictureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pStdPictureInfo == rhs.pStdPictureInfo ) && ( slicesCount == rhs.slicesCount ) && - ( pSlicesDataOffsets == rhs.pSlicesDataOffsets ); -# endif - } - - bool operator!=( VideoDecodeH265PictureInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265PictureInfoEXT; - const void * pNext = {}; - StdVideoDecodeH265PictureInfo * pStdPictureInfo = {}; - uint32_t slicesCount = {}; - const uint32_t * pSlicesDataOffsets = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265PictureInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265ProfileInfoEXT - { - using NativeType = VkVideoDecodeH265ProfileInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265ProfileInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH265ProfileInfoEXT( StdVideoH265ProfileIdc stdProfileIdc_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stdProfileIdc( stdProfileIdc_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH265ProfileInfoEXT( VideoDecodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265ProfileInfoEXT( VkVideoDecodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265ProfileInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265ProfileInfoEXT & operator=( VideoDecodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265ProfileInfoEXT & operator=( VkVideoDecodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265ProfileInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265ProfileInfoEXT & setStdProfileIdc( StdVideoH265ProfileIdc stdProfileIdc_ ) VULKAN_HPP_NOEXCEPT - { - stdProfileIdc = stdProfileIdc_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH265ProfileInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265ProfileInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stdProfileIdc ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoDecodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH265ProfileIdc ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoDecodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH265ProfileIdc ) ) == 0 ); - } - - bool operator!=( VideoDecodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265ProfileInfoEXT; - const void * pNext = {}; - StdVideoH265ProfileIdc stdProfileIdc = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265ProfileInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265SessionParametersAddInfoEXT - { - using NativeType = VkVideoDecodeH265SessionParametersAddInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265SessionParametersAddInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeH265SessionParametersAddInfoEXT( uint32_t vpsStdCount_ = {}, - const StdVideoH265VideoParameterSet * pVpsStd_ = {}, - uint32_t spsStdCount_ = {}, - const StdVideoH265SequenceParameterSet * pSpsStd_ = {}, - uint32_t ppsStdCount_ = {}, - const StdVideoH265PictureParameterSet * pPpsStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vpsStdCount( vpsStdCount_ ) - , pVpsStd( pVpsStd_ ) - , spsStdCount( spsStdCount_ ) - , pSpsStd( pSpsStd_ ) - , ppsStdCount( ppsStdCount_ ) - , pPpsStd( pPpsStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeH265SessionParametersAddInfoEXT( VideoDecodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265SessionParametersAddInfoEXT( VkVideoDecodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265SessionParametersAddInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265SessionParametersAddInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vpsStd_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , vpsStdCount( static_cast( vpsStd_.size() ) ) - , pVpsStd( vpsStd_.data() ) - , spsStdCount( static_cast( spsStd_.size() ) ) - , pSpsStd( spsStd_.data() ) - , ppsStdCount( static_cast( ppsStd_.size() ) ) - , pPpsStd( ppsStd_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265SessionParametersAddInfoEXT & operator=( VideoDecodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265SessionParametersAddInfoEXT & operator=( VkVideoDecodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setVpsStdCount( uint32_t vpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - vpsStdCount = vpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setPVpsStd( const StdVideoH265VideoParameterSet * pVpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pVpsStd = pVpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265SessionParametersAddInfoEXT & - setVpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vpsStd_ ) VULKAN_HPP_NOEXCEPT - { - vpsStdCount = static_cast( vpsStd_.size() ); - pVpsStd = vpsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setSpsStdCount( uint32_t spsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = spsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setPSpsStd( const StdVideoH265SequenceParameterSet * pSpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pSpsStd = pSpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265SessionParametersAddInfoEXT & - setSpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = static_cast( spsStd_.size() ); - pSpsStd = spsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setPpsStdCount( uint32_t ppsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = ppsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersAddInfoEXT & setPPpsStd( const StdVideoH265PictureParameterSet * pPpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pPpsStd = pPpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeH265SessionParametersAddInfoEXT & - setPpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = static_cast( ppsStd_.size() ); - pPpsStd = ppsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH265SessionParametersAddInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265SessionParametersAddInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vpsStdCount, pVpsStd, spsStdCount, pSpsStd, ppsStdCount, pPpsStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH265SessionParametersAddInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH265SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vpsStdCount == rhs.vpsStdCount ) && ( pVpsStd == rhs.pVpsStd ) && - ( spsStdCount == rhs.spsStdCount ) && ( pSpsStd == rhs.pSpsStd ) && ( ppsStdCount == rhs.ppsStdCount ) && ( pPpsStd == rhs.pPpsStd ); -# endif - } - - bool operator!=( VideoDecodeH265SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265SessionParametersAddInfoEXT; - const void * pNext = {}; - uint32_t vpsStdCount = {}; - const StdVideoH265VideoParameterSet * pVpsStd = {}; - uint32_t spsStdCount = {}; - const StdVideoH265SequenceParameterSet * pSpsStd = {}; - uint32_t ppsStdCount = {}; - const StdVideoH265PictureParameterSet * pPpsStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265SessionParametersAddInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeH265SessionParametersCreateInfoEXT - { - using NativeType = VkVideoDecodeH265SessionParametersCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeH265SessionParametersCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VideoDecodeH265SessionParametersCreateInfoEXT( uint32_t maxVpsStdCount_ = {}, - uint32_t maxSpsStdCount_ = {}, - uint32_t maxPpsStdCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersAddInfoEXT * pParametersAddInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxVpsStdCount( maxVpsStdCount_ ) - , maxSpsStdCount( maxSpsStdCount_ ) - , maxPpsStdCount( maxPpsStdCount_ ) - , pParametersAddInfo( pParametersAddInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR - VideoDecodeH265SessionParametersCreateInfoEXT( VideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265SessionParametersCreateInfoEXT( VkVideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeH265SessionParametersCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeH265SessionParametersCreateInfoEXT & operator=( VideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeH265SessionParametersCreateInfoEXT & operator=( VkVideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersCreateInfoEXT & setMaxVpsStdCount( uint32_t maxVpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxVpsStdCount = maxVpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersCreateInfoEXT & setMaxSpsStdCount( uint32_t maxSpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxSpsStdCount = maxSpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersCreateInfoEXT & setMaxPpsStdCount( uint32_t maxPpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxPpsStdCount = maxPpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeH265SessionParametersCreateInfoEXT & - setPParametersAddInfo( const VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersAddInfoEXT * pParametersAddInfo_ ) VULKAN_HPP_NOEXCEPT - { - pParametersAddInfo = pParametersAddInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeH265SessionParametersCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeH265SessionParametersCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxVpsStdCount, maxSpsStdCount, maxPpsStdCount, pParametersAddInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeH265SessionParametersCreateInfoEXT const & ) const = default; -# else - bool operator==( VideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxVpsStdCount == rhs.maxVpsStdCount ) && ( maxSpsStdCount == rhs.maxSpsStdCount ) && - ( maxPpsStdCount == rhs.maxPpsStdCount ) && ( pParametersAddInfo == rhs.pParametersAddInfo ); -# endif - } - - bool operator!=( VideoDecodeH265SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeH265SessionParametersCreateInfoEXT; - const void * pNext = {}; - uint32_t maxVpsStdCount = {}; - uint32_t maxSpsStdCount = {}; - uint32_t maxPpsStdCount = {}; - const VULKAN_HPP_NAMESPACE::VideoDecodeH265SessionParametersAddInfoEXT * pParametersAddInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeH265SessionParametersCreateInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeInfoKHR - { - using NativeType = VkVideoDecodeInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeInfoKHR( VULKAN_HPP_NAMESPACE::VideoDecodeFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferRange_ = {}, - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR dstPictureResource_ = {}, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_ = {}, - uint32_t referenceSlotCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , srcBuffer( srcBuffer_ ) - , srcBufferOffset( srcBufferOffset_ ) - , srcBufferRange( srcBufferRange_ ) - , dstPictureResource( dstPictureResource_ ) - , pSetupReferenceSlot( pSetupReferenceSlot_ ) - , referenceSlotCount( referenceSlotCount_ ) - , pReferenceSlots( pReferenceSlots_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeInfoKHR( VideoDecodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeInfoKHR( VkVideoDecodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : VideoDecodeInfoKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeInfoKHR( VULKAN_HPP_NAMESPACE::VideoDecodeFlagsKHR flags_, - VULKAN_HPP_NAMESPACE::Buffer srcBuffer_, - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferOffset_, - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferRange_, - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR dstPictureResource_, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , srcBuffer( srcBuffer_ ) - , srcBufferOffset( srcBufferOffset_ ) - , srcBufferRange( srcBufferRange_ ) - , dstPictureResource( dstPictureResource_ ) - , pSetupReferenceSlot( pSetupReferenceSlot_ ) - , referenceSlotCount( static_cast( referenceSlots_.size() ) ) - , pReferenceSlots( referenceSlots_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeInfoKHR & operator=( VideoDecodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeInfoKHR & operator=( VkVideoDecodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoDecodeFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setSrcBuffer( VULKAN_HPP_NAMESPACE::Buffer srcBuffer_ ) VULKAN_HPP_NOEXCEPT - { - srcBuffer = srcBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setSrcBufferOffset( VULKAN_HPP_NAMESPACE::DeviceSize srcBufferOffset_ ) VULKAN_HPP_NOEXCEPT - { - srcBufferOffset = srcBufferOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setSrcBufferRange( VULKAN_HPP_NAMESPACE::DeviceSize srcBufferRange_ ) VULKAN_HPP_NOEXCEPT - { - srcBufferRange = srcBufferRange_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & - setDstPictureResource( VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR const & dstPictureResource_ ) VULKAN_HPP_NOEXCEPT - { - dstPictureResource = dstPictureResource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & - setPSetupReferenceSlot( const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_ ) VULKAN_HPP_NOEXCEPT - { - pSetupReferenceSlot = pSetupReferenceSlot_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & setReferenceSlotCount( uint32_t referenceSlotCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = referenceSlotCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeInfoKHR & - setPReferenceSlots( const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceSlots = pReferenceSlots_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoDecodeInfoKHR & setReferenceSlots( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = static_cast( referenceSlots_.size() ); - pReferenceSlots = referenceSlots_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, flags, srcBuffer, srcBufferOffset, srcBufferRange, dstPictureResource, pSetupReferenceSlot, referenceSlotCount, pReferenceSlots ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeInfoKHR const & ) const = default; -# else - bool operator==( VideoDecodeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( srcBuffer == rhs.srcBuffer ) && - ( srcBufferOffset == rhs.srcBufferOffset ) && ( srcBufferRange == rhs.srcBufferRange ) && ( dstPictureResource == rhs.dstPictureResource ) && - ( pSetupReferenceSlot == rhs.pSetupReferenceSlot ) && ( referenceSlotCount == rhs.referenceSlotCount ) && - ( pReferenceSlots == rhs.pReferenceSlots ); -# endif - } - - bool operator!=( VideoDecodeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoDecodeFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::Buffer srcBuffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize srcBufferRange = {}; - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR dstPictureResource = {}; - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot = {}; - uint32_t referenceSlotCount = {}; - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoDecodeUsageInfoKHR - { - using NativeType = VkVideoDecodeUsageInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoDecodeUsageInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoDecodeUsageInfoKHR( VULKAN_HPP_NAMESPACE::VideoDecodeUsageFlagsKHR videoUsageHints_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , videoUsageHints( videoUsageHints_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoDecodeUsageInfoKHR( VideoDecodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeUsageInfoKHR( VkVideoDecodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoDecodeUsageInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoDecodeUsageInfoKHR & operator=( VideoDecodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoDecodeUsageInfoKHR & operator=( VkVideoDecodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoDecodeUsageInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoDecodeUsageInfoKHR & setVideoUsageHints( VULKAN_HPP_NAMESPACE::VideoDecodeUsageFlagsKHR videoUsageHints_ ) VULKAN_HPP_NOEXCEPT - { - videoUsageHints = videoUsageHints_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoDecodeUsageInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoDecodeUsageInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, videoUsageHints ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoDecodeUsageInfoKHR const & ) const = default; -# else - bool operator==( VideoDecodeUsageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( videoUsageHints == rhs.videoUsageHints ); -# endif - } - - bool operator!=( VideoDecodeUsageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoDecodeUsageInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoDecodeUsageFlagsKHR videoUsageHints = {}; - }; - - template <> - struct CppType - { - using Type = VideoDecodeUsageInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeCapabilitiesKHR - { - using NativeType = VkVideoEncodeCapabilitiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeCapabilitiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeCapabilitiesKHR( VULKAN_HPP_NAMESPACE::VideoEncodeCapabilityFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagsKHR rateControlModes_ = {}, - uint8_t rateControlLayerCount_ = {}, - uint8_t qualityLevelCount_ = {}, - VULKAN_HPP_NAMESPACE::Extent2D inputImageDataFillAlignment_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , rateControlModes( rateControlModes_ ) - , rateControlLayerCount( rateControlLayerCount_ ) - , qualityLevelCount( qualityLevelCount_ ) - , inputImageDataFillAlignment( inputImageDataFillAlignment_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeCapabilitiesKHR( VideoEncodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeCapabilitiesKHR( VkVideoEncodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeCapabilitiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeCapabilitiesKHR & operator=( VideoEncodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeCapabilitiesKHR & operator=( VkVideoEncodeCapabilitiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoEncodeCapabilitiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeCapabilitiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, rateControlModes, rateControlLayerCount, qualityLevelCount, inputImageDataFillAlignment ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeCapabilitiesKHR const & ) const = default; -# else - bool operator==( VideoEncodeCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( rateControlModes == rhs.rateControlModes ) && - ( rateControlLayerCount == rhs.rateControlLayerCount ) && ( qualityLevelCount == rhs.qualityLevelCount ) && - ( inputImageDataFillAlignment == rhs.inputImageDataFillAlignment ); -# endif - } - - bool operator!=( VideoEncodeCapabilitiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeCapabilitiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeCapabilityFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagsKHR rateControlModes = {}; - uint8_t rateControlLayerCount = {}; - uint8_t qualityLevelCount = {}; - VULKAN_HPP_NAMESPACE::Extent2D inputImageDataFillAlignment = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeCapabilitiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264CapabilitiesEXT - { - using NativeType = VkVideoEncodeH264CapabilitiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264CapabilitiesEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilitiesEXT( VULKAN_HPP_NAMESPACE::VideoEncodeH264CapabilityFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264InputModeFlagsEXT inputModeFlags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264OutputModeFlagsEXT outputModeFlags_ = {}, - uint8_t maxPPictureL0ReferenceCount_ = {}, - uint8_t maxBPictureL0ReferenceCount_ = {}, - uint8_t maxL1ReferenceCount_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 motionVectorsOverPicBoundariesFlag_ = {}, - uint32_t maxBytesPerPicDenom_ = {}, - uint32_t maxBitsPerMbDenom_ = {}, - uint32_t log2MaxMvLengthHorizontal_ = {}, - uint32_t log2MaxMvLengthVertical_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , inputModeFlags( inputModeFlags_ ) - , outputModeFlags( outputModeFlags_ ) - , maxPPictureL0ReferenceCount( maxPPictureL0ReferenceCount_ ) - , maxBPictureL0ReferenceCount( maxBPictureL0ReferenceCount_ ) - , maxL1ReferenceCount( maxL1ReferenceCount_ ) - , motionVectorsOverPicBoundariesFlag( motionVectorsOverPicBoundariesFlag_ ) - , maxBytesPerPicDenom( maxBytesPerPicDenom_ ) - , maxBitsPerMbDenom( maxBitsPerMbDenom_ ) - , log2MaxMvLengthHorizontal( log2MaxMvLengthHorizontal_ ) - , log2MaxMvLengthVertical( log2MaxMvLengthVertical_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264CapabilitiesEXT( VideoEncodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264CapabilitiesEXT( VkVideoEncodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264CapabilitiesEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264CapabilitiesEXT & operator=( VideoEncodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264CapabilitiesEXT & operator=( VkVideoEncodeH264CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoEncodeH264CapabilitiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264CapabilitiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - inputModeFlags, - outputModeFlags, - maxPPictureL0ReferenceCount, - maxBPictureL0ReferenceCount, - maxL1ReferenceCount, - motionVectorsOverPicBoundariesFlag, - maxBytesPerPicDenom, - maxBitsPerMbDenom, - log2MaxMvLengthHorizontal, - log2MaxMvLengthVertical ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264CapabilitiesEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( inputModeFlags == rhs.inputModeFlags ) && - ( outputModeFlags == rhs.outputModeFlags ) && ( maxPPictureL0ReferenceCount == rhs.maxPPictureL0ReferenceCount ) && - ( maxBPictureL0ReferenceCount == rhs.maxBPictureL0ReferenceCount ) && ( maxL1ReferenceCount == rhs.maxL1ReferenceCount ) && - ( motionVectorsOverPicBoundariesFlag == rhs.motionVectorsOverPicBoundariesFlag ) && ( maxBytesPerPicDenom == rhs.maxBytesPerPicDenom ) && - ( maxBitsPerMbDenom == rhs.maxBitsPerMbDenom ) && ( log2MaxMvLengthHorizontal == rhs.log2MaxMvLengthHorizontal ) && - ( log2MaxMvLengthVertical == rhs.log2MaxMvLengthVertical ); -# endif - } - - bool operator!=( VideoEncodeH264CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264CapabilitiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264CapabilityFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264InputModeFlagsEXT inputModeFlags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264OutputModeFlagsEXT outputModeFlags = {}; - uint8_t maxPPictureL0ReferenceCount = {}; - uint8_t maxBPictureL0ReferenceCount = {}; - uint8_t maxL1ReferenceCount = {}; - VULKAN_HPP_NAMESPACE::Bool32 motionVectorsOverPicBoundariesFlag = {}; - uint32_t maxBytesPerPicDenom = {}; - uint32_t maxBitsPerMbDenom = {}; - uint32_t log2MaxMvLengthHorizontal = {}; - uint32_t log2MaxMvLengthVertical = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264CapabilitiesEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264DpbSlotInfoEXT - { - using NativeType = VkVideoEncodeH264DpbSlotInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264DpbSlotInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264DpbSlotInfoEXT( int8_t slotIndex_ = {}, - const StdVideoEncodeH264ReferenceInfo * pStdReferenceInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , slotIndex( slotIndex_ ) - , pStdReferenceInfo( pStdReferenceInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264DpbSlotInfoEXT( VideoEncodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264DpbSlotInfoEXT( VkVideoEncodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264DpbSlotInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264DpbSlotInfoEXT & operator=( VideoEncodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264DpbSlotInfoEXT & operator=( VkVideoEncodeH264DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264DpbSlotInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264DpbSlotInfoEXT & setSlotIndex( int8_t slotIndex_ ) VULKAN_HPP_NOEXCEPT - { - slotIndex = slotIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264DpbSlotInfoEXT & - setPStdReferenceInfo( const StdVideoEncodeH264ReferenceInfo * pStdReferenceInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdReferenceInfo = pStdReferenceInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264DpbSlotInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264DpbSlotInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, slotIndex, pStdReferenceInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264DpbSlotInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( slotIndex == rhs.slotIndex ) && ( pStdReferenceInfo == rhs.pStdReferenceInfo ); -# endif - } - - bool operator!=( VideoEncodeH264DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264DpbSlotInfoEXT; - const void * pNext = {}; - int8_t slotIndex = {}; - const StdVideoEncodeH264ReferenceInfo * pStdReferenceInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264DpbSlotInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264EmitPictureParametersInfoEXT - { - using NativeType = VkVideoEncodeH264EmitPictureParametersInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264EmitPictureParametersInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264EmitPictureParametersInfoEXT( uint8_t spsId_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_ = {}, - uint32_t ppsIdEntryCount_ = {}, - const uint8_t * ppsIdEntries_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , spsId( spsId_ ) - , emitSpsEnable( emitSpsEnable_ ) - , ppsIdEntryCount( ppsIdEntryCount_ ) - , ppsIdEntries( ppsIdEntries_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264EmitPictureParametersInfoEXT( VideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264EmitPictureParametersInfoEXT( VkVideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264EmitPictureParametersInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264EmitPictureParametersInfoEXT( uint8_t spsId_, - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & psIdEntries_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , spsId( spsId_ ) - , emitSpsEnable( emitSpsEnable_ ) - , ppsIdEntryCount( static_cast( psIdEntries_.size() ) ) - , ppsIdEntries( psIdEntries_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264EmitPictureParametersInfoEXT & operator=( VideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264EmitPictureParametersInfoEXT & operator=( VkVideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264EmitPictureParametersInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264EmitPictureParametersInfoEXT & setSpsId( uint8_t spsId_ ) VULKAN_HPP_NOEXCEPT - { - spsId = spsId_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264EmitPictureParametersInfoEXT & setEmitSpsEnable( VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_ ) VULKAN_HPP_NOEXCEPT - { - emitSpsEnable = emitSpsEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264EmitPictureParametersInfoEXT & setPpsIdEntryCount( uint32_t ppsIdEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntryCount = ppsIdEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264EmitPictureParametersInfoEXT & setPpsIdEntries( const uint8_t * ppsIdEntries_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntries = ppsIdEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264EmitPictureParametersInfoEXT & - setPsIdEntries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & psIdEntries_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntryCount = static_cast( psIdEntries_.size() ); - ppsIdEntries = psIdEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264EmitPictureParametersInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264EmitPictureParametersInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, spsId, emitSpsEnable, ppsIdEntryCount, ppsIdEntries ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264EmitPictureParametersInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( spsId == rhs.spsId ) && ( emitSpsEnable == rhs.emitSpsEnable ) && - ( ppsIdEntryCount == rhs.ppsIdEntryCount ) && ( ppsIdEntries == rhs.ppsIdEntries ); -# endif - } - - bool operator!=( VideoEncodeH264EmitPictureParametersInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264EmitPictureParametersInfoEXT; - const void * pNext = {}; - uint8_t spsId = {}; - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable = {}; - uint32_t ppsIdEntryCount = {}; - const uint8_t * ppsIdEntries = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264EmitPictureParametersInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264FrameSizeEXT - { - using NativeType = VkVideoEncodeH264FrameSizeEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264FrameSizeEXT( uint32_t frameISize_ = {}, uint32_t framePSize_ = {}, uint32_t frameBSize_ = {} ) VULKAN_HPP_NOEXCEPT - : frameISize( frameISize_ ) - , framePSize( framePSize_ ) - , frameBSize( frameBSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264FrameSizeEXT( VideoEncodeH264FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264FrameSizeEXT( VkVideoEncodeH264FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264FrameSizeEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264FrameSizeEXT & operator=( VideoEncodeH264FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264FrameSizeEXT & operator=( VkVideoEncodeH264FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264FrameSizeEXT & setFrameISize( uint32_t frameISize_ ) VULKAN_HPP_NOEXCEPT - { - frameISize = frameISize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264FrameSizeEXT & setFramePSize( uint32_t framePSize_ ) VULKAN_HPP_NOEXCEPT - { - framePSize = framePSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264FrameSizeEXT & setFrameBSize( uint32_t frameBSize_ ) VULKAN_HPP_NOEXCEPT - { - frameBSize = frameBSize_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264FrameSizeEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264FrameSizeEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( frameISize, framePSize, frameBSize ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264FrameSizeEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264FrameSizeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( frameISize == rhs.frameISize ) && ( framePSize == rhs.framePSize ) && ( frameBSize == rhs.frameBSize ); -# endif - } - - bool operator!=( VideoEncodeH264FrameSizeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - uint32_t frameISize = {}; - uint32_t framePSize = {}; - uint32_t frameBSize = {}; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264ReferenceListsInfoEXT - { - using NativeType = VkVideoEncodeH264ReferenceListsInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264ReferenceListsInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264ReferenceListsInfoEXT( uint8_t referenceList0EntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList0Entries_ = {}, - uint8_t referenceList1EntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList1Entries_ = {}, - const StdVideoEncodeH264RefMemMgmtCtrlOperations * pMemMgmtCtrlOperations_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , referenceList0EntryCount( referenceList0EntryCount_ ) - , pReferenceList0Entries( pReferenceList0Entries_ ) - , referenceList1EntryCount( referenceList1EntryCount_ ) - , pReferenceList1Entries( pReferenceList1Entries_ ) - , pMemMgmtCtrlOperations( pMemMgmtCtrlOperations_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264ReferenceListsInfoEXT( VideoEncodeH264ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264ReferenceListsInfoEXT( VkVideoEncodeH264ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264ReferenceListsInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264ReferenceListsInfoEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList0Entries_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList1Entries_ = {}, - const StdVideoEncodeH264RefMemMgmtCtrlOperations * pMemMgmtCtrlOperations_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , referenceList0EntryCount( static_cast( referenceList0Entries_.size() ) ) - , pReferenceList0Entries( referenceList0Entries_.data() ) - , referenceList1EntryCount( static_cast( referenceList1Entries_.size() ) ) - , pReferenceList1Entries( referenceList1Entries_.data() ) - , pMemMgmtCtrlOperations( pMemMgmtCtrlOperations_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264ReferenceListsInfoEXT & operator=( VideoEncodeH264ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264ReferenceListsInfoEXT & operator=( VkVideoEncodeH264ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & setReferenceList0EntryCount( uint8_t referenceList0EntryCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceList0EntryCount = referenceList0EntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & - setPReferenceList0Entries( const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList0Entries_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceList0Entries = pReferenceList0Entries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264ReferenceListsInfoEXT & setReferenceList0Entries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList0Entries_ ) - VULKAN_HPP_NOEXCEPT - { - referenceList0EntryCount = static_cast( referenceList0Entries_.size() ); - pReferenceList0Entries = referenceList0Entries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & setReferenceList1EntryCount( uint8_t referenceList1EntryCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceList1EntryCount = referenceList1EntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & - setPReferenceList1Entries( const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList1Entries_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceList1Entries = pReferenceList1Entries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264ReferenceListsInfoEXT & setReferenceList1Entries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList1Entries_ ) - VULKAN_HPP_NOEXCEPT - { - referenceList1EntryCount = static_cast( referenceList1Entries_.size() ); - pReferenceList1Entries = referenceList1Entries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ReferenceListsInfoEXT & - setPMemMgmtCtrlOperations( const StdVideoEncodeH264RefMemMgmtCtrlOperations * pMemMgmtCtrlOperations_ ) VULKAN_HPP_NOEXCEPT - { - pMemMgmtCtrlOperations = pMemMgmtCtrlOperations_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264ReferenceListsInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264ReferenceListsInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, referenceList0EntryCount, pReferenceList0Entries, referenceList1EntryCount, pReferenceList1Entries, pMemMgmtCtrlOperations ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264ReferenceListsInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264ReferenceListsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( referenceList0EntryCount == rhs.referenceList0EntryCount ) && - ( pReferenceList0Entries == rhs.pReferenceList0Entries ) && ( referenceList1EntryCount == rhs.referenceList1EntryCount ) && - ( pReferenceList1Entries == rhs.pReferenceList1Entries ) && ( pMemMgmtCtrlOperations == rhs.pMemMgmtCtrlOperations ); -# endif - } - - bool operator!=( VideoEncodeH264ReferenceListsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264ReferenceListsInfoEXT; - const void * pNext = {}; - uint8_t referenceList0EntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList0Entries = {}; - uint8_t referenceList1EntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264DpbSlotInfoEXT * pReferenceList1Entries = {}; - const StdVideoEncodeH264RefMemMgmtCtrlOperations * pMemMgmtCtrlOperations = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264ReferenceListsInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264NaluSliceInfoEXT - { - using NativeType = VkVideoEncodeH264NaluSliceInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264NaluSliceInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264NaluSliceInfoEXT( uint32_t mbCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists_ = {}, - const StdVideoEncodeH264SliceHeader * pSliceHeaderStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , mbCount( mbCount_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , pSliceHeaderStd( pSliceHeaderStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264NaluSliceInfoEXT( VideoEncodeH264NaluSliceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264NaluSliceInfoEXT( VkVideoEncodeH264NaluSliceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264NaluSliceInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264NaluSliceInfoEXT & operator=( VideoEncodeH264NaluSliceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264NaluSliceInfoEXT & operator=( VkVideoEncodeH264NaluSliceInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264NaluSliceInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264NaluSliceInfoEXT & setMbCount( uint32_t mbCount_ ) VULKAN_HPP_NOEXCEPT - { - mbCount = mbCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264NaluSliceInfoEXT & - setPReferenceFinalLists( const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceFinalLists = pReferenceFinalLists_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264NaluSliceInfoEXT & setPSliceHeaderStd( const StdVideoEncodeH264SliceHeader * pSliceHeaderStd_ ) VULKAN_HPP_NOEXCEPT - { - pSliceHeaderStd = pSliceHeaderStd_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264NaluSliceInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264NaluSliceInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, mbCount, pReferenceFinalLists, pSliceHeaderStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264NaluSliceInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264NaluSliceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( mbCount == rhs.mbCount ) && ( pReferenceFinalLists == rhs.pReferenceFinalLists ) && - ( pSliceHeaderStd == rhs.pSliceHeaderStd ); -# endif - } - - bool operator!=( VideoEncodeH264NaluSliceInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264NaluSliceInfoEXT; - const void * pNext = {}; - uint32_t mbCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists = {}; - const StdVideoEncodeH264SliceHeader * pSliceHeaderStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264NaluSliceInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264ProfileInfoEXT - { - using NativeType = VkVideoEncodeH264ProfileInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264ProfileInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264ProfileInfoEXT( StdVideoH264ProfileIdc stdProfileIdc_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stdProfileIdc( stdProfileIdc_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264ProfileInfoEXT( VideoEncodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264ProfileInfoEXT( VkVideoEncodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264ProfileInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264ProfileInfoEXT & operator=( VideoEncodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264ProfileInfoEXT & operator=( VkVideoEncodeH264ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ProfileInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264ProfileInfoEXT & setStdProfileIdc( StdVideoH264ProfileIdc stdProfileIdc_ ) VULKAN_HPP_NOEXCEPT - { - stdProfileIdc = stdProfileIdc_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264ProfileInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264ProfileInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stdProfileIdc ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoEncodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH264ProfileIdc ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoEncodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH264ProfileIdc ) ) == 0 ); - } - - bool operator!=( VideoEncodeH264ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264ProfileInfoEXT; - const void * pNext = {}; - StdVideoH264ProfileIdc stdProfileIdc = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264ProfileInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264QpEXT - { - using NativeType = VkVideoEncodeH264QpEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264QpEXT( int32_t qpI_ = {}, int32_t qpP_ = {}, int32_t qpB_ = {} ) VULKAN_HPP_NOEXCEPT - : qpI( qpI_ ) - , qpP( qpP_ ) - , qpB( qpB_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264QpEXT( VideoEncodeH264QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264QpEXT( VkVideoEncodeH264QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264QpEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264QpEXT & operator=( VideoEncodeH264QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264QpEXT & operator=( VkVideoEncodeH264QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264QpEXT & setQpI( int32_t qpI_ ) VULKAN_HPP_NOEXCEPT - { - qpI = qpI_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264QpEXT & setQpP( int32_t qpP_ ) VULKAN_HPP_NOEXCEPT - { - qpP = qpP_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264QpEXT & setQpB( int32_t qpB_ ) VULKAN_HPP_NOEXCEPT - { - qpB = qpB_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264QpEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264QpEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( qpI, qpP, qpB ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264QpEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264QpEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( qpI == rhs.qpI ) && ( qpP == rhs.qpP ) && ( qpB == rhs.qpB ); -# endif - } - - bool operator!=( VideoEncodeH264QpEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - int32_t qpI = {}; - int32_t qpP = {}; - int32_t qpB = {}; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264RateControlInfoEXT - { - using NativeType = VkVideoEncodeH264RateControlInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264RateControlInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264RateControlInfoEXT( uint32_t gopFrameCount_ = {}, - uint32_t idrPeriod_ = {}, - uint32_t consecutiveBFrameCount_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlStructureEXT rateControlStructure_ = - VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlStructureEXT::eUnknown, - uint8_t temporalLayerCount_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , gopFrameCount( gopFrameCount_ ) - , idrPeriod( idrPeriod_ ) - , consecutiveBFrameCount( consecutiveBFrameCount_ ) - , rateControlStructure( rateControlStructure_ ) - , temporalLayerCount( temporalLayerCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264RateControlInfoEXT( VideoEncodeH264RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264RateControlInfoEXT( VkVideoEncodeH264RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264RateControlInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264RateControlInfoEXT & operator=( VideoEncodeH264RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264RateControlInfoEXT & operator=( VkVideoEncodeH264RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & setGopFrameCount( uint32_t gopFrameCount_ ) VULKAN_HPP_NOEXCEPT - { - gopFrameCount = gopFrameCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & setIdrPeriod( uint32_t idrPeriod_ ) VULKAN_HPP_NOEXCEPT - { - idrPeriod = idrPeriod_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & setConsecutiveBFrameCount( uint32_t consecutiveBFrameCount_ ) VULKAN_HPP_NOEXCEPT - { - consecutiveBFrameCount = consecutiveBFrameCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & - setRateControlStructure( VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlStructureEXT rateControlStructure_ ) VULKAN_HPP_NOEXCEPT - { - rateControlStructure = rateControlStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlInfoEXT & setTemporalLayerCount( uint8_t temporalLayerCount_ ) VULKAN_HPP_NOEXCEPT - { - temporalLayerCount = temporalLayerCount_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264RateControlInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264RateControlInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, gopFrameCount, idrPeriod, consecutiveBFrameCount, rateControlStructure, temporalLayerCount ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264RateControlInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264RateControlInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( gopFrameCount == rhs.gopFrameCount ) && ( idrPeriod == rhs.idrPeriod ) && - ( consecutiveBFrameCount == rhs.consecutiveBFrameCount ) && ( rateControlStructure == rhs.rateControlStructure ) && - ( temporalLayerCount == rhs.temporalLayerCount ); -# endif - } - - bool operator!=( VideoEncodeH264RateControlInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264RateControlInfoEXT; - const void * pNext = {}; - uint32_t gopFrameCount = {}; - uint32_t idrPeriod = {}; - uint32_t consecutiveBFrameCount = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlStructureEXT rateControlStructure = VULKAN_HPP_NAMESPACE::VideoEncodeH264RateControlStructureEXT::eUnknown; - uint8_t temporalLayerCount = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264RateControlInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264RateControlLayerInfoEXT - { - using NativeType = VkVideoEncodeH264RateControlLayerInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264RateControlLayerInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264RateControlLayerInfoEXT( uint8_t temporalLayerId_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT initialRcQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMinQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT minQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMaxQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT maxQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH264FrameSizeEXT maxFrameSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , temporalLayerId( temporalLayerId_ ) - , useInitialRcQp( useInitialRcQp_ ) - , initialRcQp( initialRcQp_ ) - , useMinQp( useMinQp_ ) - , minQp( minQp_ ) - , useMaxQp( useMaxQp_ ) - , maxQp( maxQp_ ) - , useMaxFrameSize( useMaxFrameSize_ ) - , maxFrameSize( maxFrameSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264RateControlLayerInfoEXT( VideoEncodeH264RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264RateControlLayerInfoEXT( VkVideoEncodeH264RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264RateControlLayerInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264RateControlLayerInfoEXT & operator=( VideoEncodeH264RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264RateControlLayerInfoEXT & operator=( VkVideoEncodeH264RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setTemporalLayerId( uint8_t temporalLayerId_ ) VULKAN_HPP_NOEXCEPT - { - temporalLayerId = temporalLayerId_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setUseInitialRcQp( VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp_ ) VULKAN_HPP_NOEXCEPT - { - useInitialRcQp = useInitialRcQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & - setInitialRcQp( VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT const & initialRcQp_ ) VULKAN_HPP_NOEXCEPT - { - initialRcQp = initialRcQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setUseMinQp( VULKAN_HPP_NAMESPACE::Bool32 useMinQp_ ) VULKAN_HPP_NOEXCEPT - { - useMinQp = useMinQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setMinQp( VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT const & minQp_ ) VULKAN_HPP_NOEXCEPT - { - minQp = minQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setUseMaxQp( VULKAN_HPP_NAMESPACE::Bool32 useMaxQp_ ) VULKAN_HPP_NOEXCEPT - { - useMaxQp = useMaxQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setMaxQp( VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT const & maxQp_ ) VULKAN_HPP_NOEXCEPT - { - maxQp = maxQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & setUseMaxFrameSize( VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize_ ) VULKAN_HPP_NOEXCEPT - { - useMaxFrameSize = useMaxFrameSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264RateControlLayerInfoEXT & - setMaxFrameSize( VULKAN_HPP_NAMESPACE::VideoEncodeH264FrameSizeEXT const & maxFrameSize_ ) VULKAN_HPP_NOEXCEPT - { - maxFrameSize = maxFrameSize_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264RateControlLayerInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264RateControlLayerInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, temporalLayerId, useInitialRcQp, initialRcQp, useMinQp, minQp, useMaxQp, maxQp, useMaxFrameSize, maxFrameSize ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264RateControlLayerInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264RateControlLayerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( temporalLayerId == rhs.temporalLayerId ) && ( useInitialRcQp == rhs.useInitialRcQp ) && - ( initialRcQp == rhs.initialRcQp ) && ( useMinQp == rhs.useMinQp ) && ( minQp == rhs.minQp ) && ( useMaxQp == rhs.useMaxQp ) && - ( maxQp == rhs.maxQp ) && ( useMaxFrameSize == rhs.useMaxFrameSize ) && ( maxFrameSize == rhs.maxFrameSize ); -# endif - } - - bool operator!=( VideoEncodeH264RateControlLayerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264RateControlLayerInfoEXT; - const void * pNext = {}; - uint8_t temporalLayerId = {}; - VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT initialRcQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMinQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT minQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMaxQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264QpEXT maxQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH264FrameSizeEXT maxFrameSize = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264RateControlLayerInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264SessionParametersAddInfoEXT - { - using NativeType = VkVideoEncodeH264SessionParametersAddInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264SessionParametersAddInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264SessionParametersAddInfoEXT( uint32_t spsStdCount_ = {}, - const StdVideoH264SequenceParameterSet * pSpsStd_ = {}, - uint32_t ppsStdCount_ = {}, - const StdVideoH264PictureParameterSet * pPpsStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , spsStdCount( spsStdCount_ ) - , pSpsStd( pSpsStd_ ) - , ppsStdCount( ppsStdCount_ ) - , pPpsStd( pPpsStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264SessionParametersAddInfoEXT( VideoEncodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264SessionParametersAddInfoEXT( VkVideoEncodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264SessionParametersAddInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264SessionParametersAddInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , spsStdCount( static_cast( spsStd_.size() ) ) - , pSpsStd( spsStd_.data() ) - , ppsStdCount( static_cast( ppsStd_.size() ) ) - , pPpsStd( ppsStd_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264SessionParametersAddInfoEXT & operator=( VideoEncodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264SessionParametersAddInfoEXT & operator=( VkVideoEncodeH264SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersAddInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersAddInfoEXT & setSpsStdCount( uint32_t spsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = spsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersAddInfoEXT & setPSpsStd( const StdVideoH264SequenceParameterSet * pSpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pSpsStd = pSpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264SessionParametersAddInfoEXT & - setSpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = static_cast( spsStd_.size() ); - pSpsStd = spsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersAddInfoEXT & setPpsStdCount( uint32_t ppsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = ppsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersAddInfoEXT & setPPpsStd( const StdVideoH264PictureParameterSet * pPpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pPpsStd = pPpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264SessionParametersAddInfoEXT & - setPpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = static_cast( ppsStd_.size() ); - pPpsStd = ppsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264SessionParametersAddInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264SessionParametersAddInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, spsStdCount, pSpsStd, ppsStdCount, pPpsStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264SessionParametersAddInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( spsStdCount == rhs.spsStdCount ) && ( pSpsStd == rhs.pSpsStd ) && - ( ppsStdCount == rhs.ppsStdCount ) && ( pPpsStd == rhs.pPpsStd ); -# endif - } - - bool operator!=( VideoEncodeH264SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264SessionParametersAddInfoEXT; - const void * pNext = {}; - uint32_t spsStdCount = {}; - const StdVideoH264SequenceParameterSet * pSpsStd = {}; - uint32_t ppsStdCount = {}; - const StdVideoH264PictureParameterSet * pPpsStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264SessionParametersAddInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264SessionParametersCreateInfoEXT - { - using NativeType = VkVideoEncodeH264SessionParametersCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264SessionParametersCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VideoEncodeH264SessionParametersCreateInfoEXT( uint32_t maxSpsStdCount_ = {}, - uint32_t maxPpsStdCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersAddInfoEXT * pParametersAddInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxSpsStdCount( maxSpsStdCount_ ) - , maxPpsStdCount( maxPpsStdCount_ ) - , pParametersAddInfo( pParametersAddInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR - VideoEncodeH264SessionParametersCreateInfoEXT( VideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264SessionParametersCreateInfoEXT( VkVideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264SessionParametersCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264SessionParametersCreateInfoEXT & operator=( VideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264SessionParametersCreateInfoEXT & operator=( VkVideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersCreateInfoEXT & setMaxSpsStdCount( uint32_t maxSpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxSpsStdCount = maxSpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersCreateInfoEXT & setMaxPpsStdCount( uint32_t maxPpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxPpsStdCount = maxPpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264SessionParametersCreateInfoEXT & - setPParametersAddInfo( const VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersAddInfoEXT * pParametersAddInfo_ ) VULKAN_HPP_NOEXCEPT - { - pParametersAddInfo = pParametersAddInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264SessionParametersCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264SessionParametersCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxSpsStdCount, maxPpsStdCount, pParametersAddInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264SessionParametersCreateInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxSpsStdCount == rhs.maxSpsStdCount ) && ( maxPpsStdCount == rhs.maxPpsStdCount ) && - ( pParametersAddInfo == rhs.pParametersAddInfo ); -# endif - } - - bool operator!=( VideoEncodeH264SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264SessionParametersCreateInfoEXT; - const void * pNext = {}; - uint32_t maxSpsStdCount = {}; - uint32_t maxPpsStdCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264SessionParametersAddInfoEXT * pParametersAddInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264SessionParametersCreateInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH264VclFrameInfoEXT - { - using NativeType = VkVideoEncodeH264VclFrameInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH264VclFrameInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH264VclFrameInfoEXT( const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists_ = {}, - uint32_t naluSliceEntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH264NaluSliceInfoEXT * pNaluSliceEntries_ = {}, - const StdVideoEncodeH264PictureInfo * pCurrentPictureInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , naluSliceEntryCount( naluSliceEntryCount_ ) - , pNaluSliceEntries( pNaluSliceEntries_ ) - , pCurrentPictureInfo( pCurrentPictureInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH264VclFrameInfoEXT( VideoEncodeH264VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264VclFrameInfoEXT( VkVideoEncodeH264VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH264VclFrameInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264VclFrameInfoEXT( - const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & naluSliceEntries_, - const StdVideoEncodeH264PictureInfo * pCurrentPictureInfo_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , naluSliceEntryCount( static_cast( naluSliceEntries_.size() ) ) - , pNaluSliceEntries( naluSliceEntries_.data() ) - , pCurrentPictureInfo( pCurrentPictureInfo_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH264VclFrameInfoEXT & operator=( VideoEncodeH264VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH264VclFrameInfoEXT & operator=( VkVideoEncodeH264VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264VclFrameInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264VclFrameInfoEXT & - setPReferenceFinalLists( const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceFinalLists = pReferenceFinalLists_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264VclFrameInfoEXT & setNaluSliceEntryCount( uint32_t naluSliceEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - naluSliceEntryCount = naluSliceEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264VclFrameInfoEXT & - setPNaluSliceEntries( const VULKAN_HPP_NAMESPACE::VideoEncodeH264NaluSliceInfoEXT * pNaluSliceEntries_ ) VULKAN_HPP_NOEXCEPT - { - pNaluSliceEntries = pNaluSliceEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH264VclFrameInfoEXT & setNaluSliceEntries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & naluSliceEntries_ ) VULKAN_HPP_NOEXCEPT - { - naluSliceEntryCount = static_cast( naluSliceEntries_.size() ); - pNaluSliceEntries = naluSliceEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH264VclFrameInfoEXT & - setPCurrentPictureInfo( const StdVideoEncodeH264PictureInfo * pCurrentPictureInfo_ ) VULKAN_HPP_NOEXCEPT - { - pCurrentPictureInfo = pCurrentPictureInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH264VclFrameInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH264VclFrameInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pReferenceFinalLists, naluSliceEntryCount, pNaluSliceEntries, pCurrentPictureInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH264VclFrameInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH264VclFrameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pReferenceFinalLists == rhs.pReferenceFinalLists ) && - ( naluSliceEntryCount == rhs.naluSliceEntryCount ) && ( pNaluSliceEntries == rhs.pNaluSliceEntries ) && - ( pCurrentPictureInfo == rhs.pCurrentPictureInfo ); -# endif - } - - bool operator!=( VideoEncodeH264VclFrameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH264VclFrameInfoEXT; - const void * pNext = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264ReferenceListsInfoEXT * pReferenceFinalLists = {}; - uint32_t naluSliceEntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH264NaluSliceInfoEXT * pNaluSliceEntries = {}; - const StdVideoEncodeH264PictureInfo * pCurrentPictureInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH264VclFrameInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265CapabilitiesEXT - { - using NativeType = VkVideoEncodeH265CapabilitiesEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265CapabilitiesEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilitiesEXT( VULKAN_HPP_NAMESPACE::VideoEncodeH265CapabilityFlagsEXT flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265InputModeFlagsEXT inputModeFlags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265OutputModeFlagsEXT outputModeFlags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265CtbSizeFlagsEXT ctbSizes_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes_ = {}, - uint8_t maxPPictureL0ReferenceCount_ = {}, - uint8_t maxBPictureL0ReferenceCount_ = {}, - uint8_t maxL1ReferenceCount_ = {}, - uint8_t maxSubLayersCount_ = {}, - uint8_t minLog2MinLumaCodingBlockSizeMinus3_ = {}, - uint8_t maxLog2MinLumaCodingBlockSizeMinus3_ = {}, - uint8_t minLog2MinLumaTransformBlockSizeMinus2_ = {}, - uint8_t maxLog2MinLumaTransformBlockSizeMinus2_ = {}, - uint8_t minMaxTransformHierarchyDepthInter_ = {}, - uint8_t maxMaxTransformHierarchyDepthInter_ = {}, - uint8_t minMaxTransformHierarchyDepthIntra_ = {}, - uint8_t maxMaxTransformHierarchyDepthIntra_ = {}, - uint8_t maxDiffCuQpDeltaDepth_ = {}, - uint8_t minMaxNumMergeCand_ = {}, - uint8_t maxMaxNumMergeCand_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , inputModeFlags( inputModeFlags_ ) - , outputModeFlags( outputModeFlags_ ) - , ctbSizes( ctbSizes_ ) - , transformBlockSizes( transformBlockSizes_ ) - , maxPPictureL0ReferenceCount( maxPPictureL0ReferenceCount_ ) - , maxBPictureL0ReferenceCount( maxBPictureL0ReferenceCount_ ) - , maxL1ReferenceCount( maxL1ReferenceCount_ ) - , maxSubLayersCount( maxSubLayersCount_ ) - , minLog2MinLumaCodingBlockSizeMinus3( minLog2MinLumaCodingBlockSizeMinus3_ ) - , maxLog2MinLumaCodingBlockSizeMinus3( maxLog2MinLumaCodingBlockSizeMinus3_ ) - , minLog2MinLumaTransformBlockSizeMinus2( minLog2MinLumaTransformBlockSizeMinus2_ ) - , maxLog2MinLumaTransformBlockSizeMinus2( maxLog2MinLumaTransformBlockSizeMinus2_ ) - , minMaxTransformHierarchyDepthInter( minMaxTransformHierarchyDepthInter_ ) - , maxMaxTransformHierarchyDepthInter( maxMaxTransformHierarchyDepthInter_ ) - , minMaxTransformHierarchyDepthIntra( minMaxTransformHierarchyDepthIntra_ ) - , maxMaxTransformHierarchyDepthIntra( maxMaxTransformHierarchyDepthIntra_ ) - , maxDiffCuQpDeltaDepth( maxDiffCuQpDeltaDepth_ ) - , minMaxNumMergeCand( minMaxNumMergeCand_ ) - , maxMaxNumMergeCand( maxMaxNumMergeCand_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265CapabilitiesEXT( VideoEncodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265CapabilitiesEXT( VkVideoEncodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265CapabilitiesEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265CapabilitiesEXT & operator=( VideoEncodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265CapabilitiesEXT & operator=( VkVideoEncodeH265CapabilitiesEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoEncodeH265CapabilitiesEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265CapabilitiesEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - inputModeFlags, - outputModeFlags, - ctbSizes, - transformBlockSizes, - maxPPictureL0ReferenceCount, - maxBPictureL0ReferenceCount, - maxL1ReferenceCount, - maxSubLayersCount, - minLog2MinLumaCodingBlockSizeMinus3, - maxLog2MinLumaCodingBlockSizeMinus3, - minLog2MinLumaTransformBlockSizeMinus2, - maxLog2MinLumaTransformBlockSizeMinus2, - minMaxTransformHierarchyDepthInter, - maxMaxTransformHierarchyDepthInter, - minMaxTransformHierarchyDepthIntra, - maxMaxTransformHierarchyDepthIntra, - maxDiffCuQpDeltaDepth, - minMaxNumMergeCand, - maxMaxNumMergeCand ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265CapabilitiesEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( inputModeFlags == rhs.inputModeFlags ) && - ( outputModeFlags == rhs.outputModeFlags ) && ( ctbSizes == rhs.ctbSizes ) && ( transformBlockSizes == rhs.transformBlockSizes ) && - ( maxPPictureL0ReferenceCount == rhs.maxPPictureL0ReferenceCount ) && ( maxBPictureL0ReferenceCount == rhs.maxBPictureL0ReferenceCount ) && - ( maxL1ReferenceCount == rhs.maxL1ReferenceCount ) && ( maxSubLayersCount == rhs.maxSubLayersCount ) && - ( minLog2MinLumaCodingBlockSizeMinus3 == rhs.minLog2MinLumaCodingBlockSizeMinus3 ) && - ( maxLog2MinLumaCodingBlockSizeMinus3 == rhs.maxLog2MinLumaCodingBlockSizeMinus3 ) && - ( minLog2MinLumaTransformBlockSizeMinus2 == rhs.minLog2MinLumaTransformBlockSizeMinus2 ) && - ( maxLog2MinLumaTransformBlockSizeMinus2 == rhs.maxLog2MinLumaTransformBlockSizeMinus2 ) && - ( minMaxTransformHierarchyDepthInter == rhs.minMaxTransformHierarchyDepthInter ) && - ( maxMaxTransformHierarchyDepthInter == rhs.maxMaxTransformHierarchyDepthInter ) && - ( minMaxTransformHierarchyDepthIntra == rhs.minMaxTransformHierarchyDepthIntra ) && - ( maxMaxTransformHierarchyDepthIntra == rhs.maxMaxTransformHierarchyDepthIntra ) && ( maxDiffCuQpDeltaDepth == rhs.maxDiffCuQpDeltaDepth ) && - ( minMaxNumMergeCand == rhs.minMaxNumMergeCand ) && ( maxMaxNumMergeCand == rhs.maxMaxNumMergeCand ); -# endif - } - - bool operator!=( VideoEncodeH265CapabilitiesEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265CapabilitiesEXT; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265CapabilityFlagsEXT flags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265InputModeFlagsEXT inputModeFlags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265OutputModeFlagsEXT outputModeFlags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265CtbSizeFlagsEXT ctbSizes = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes = {}; - uint8_t maxPPictureL0ReferenceCount = {}; - uint8_t maxBPictureL0ReferenceCount = {}; - uint8_t maxL1ReferenceCount = {}; - uint8_t maxSubLayersCount = {}; - uint8_t minLog2MinLumaCodingBlockSizeMinus3 = {}; - uint8_t maxLog2MinLumaCodingBlockSizeMinus3 = {}; - uint8_t minLog2MinLumaTransformBlockSizeMinus2 = {}; - uint8_t maxLog2MinLumaTransformBlockSizeMinus2 = {}; - uint8_t minMaxTransformHierarchyDepthInter = {}; - uint8_t maxMaxTransformHierarchyDepthInter = {}; - uint8_t minMaxTransformHierarchyDepthIntra = {}; - uint8_t maxMaxTransformHierarchyDepthIntra = {}; - uint8_t maxDiffCuQpDeltaDepth = {}; - uint8_t minMaxNumMergeCand = {}; - uint8_t maxMaxNumMergeCand = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265CapabilitiesEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265DpbSlotInfoEXT - { - using NativeType = VkVideoEncodeH265DpbSlotInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265DpbSlotInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265DpbSlotInfoEXT( int8_t slotIndex_ = {}, - const StdVideoEncodeH265ReferenceInfo * pStdReferenceInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , slotIndex( slotIndex_ ) - , pStdReferenceInfo( pStdReferenceInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265DpbSlotInfoEXT( VideoEncodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265DpbSlotInfoEXT( VkVideoEncodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265DpbSlotInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265DpbSlotInfoEXT & operator=( VideoEncodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265DpbSlotInfoEXT & operator=( VkVideoEncodeH265DpbSlotInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265DpbSlotInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265DpbSlotInfoEXT & setSlotIndex( int8_t slotIndex_ ) VULKAN_HPP_NOEXCEPT - { - slotIndex = slotIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265DpbSlotInfoEXT & - setPStdReferenceInfo( const StdVideoEncodeH265ReferenceInfo * pStdReferenceInfo_ ) VULKAN_HPP_NOEXCEPT - { - pStdReferenceInfo = pStdReferenceInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265DpbSlotInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265DpbSlotInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, slotIndex, pStdReferenceInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265DpbSlotInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( slotIndex == rhs.slotIndex ) && ( pStdReferenceInfo == rhs.pStdReferenceInfo ); -# endif - } - - bool operator!=( VideoEncodeH265DpbSlotInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265DpbSlotInfoEXT; - const void * pNext = {}; - int8_t slotIndex = {}; - const StdVideoEncodeH265ReferenceInfo * pStdReferenceInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265DpbSlotInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265EmitPictureParametersInfoEXT - { - using NativeType = VkVideoEncodeH265EmitPictureParametersInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265EmitPictureParametersInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265EmitPictureParametersInfoEXT( uint8_t vpsId_ = {}, - uint8_t spsId_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 emitVpsEnable_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_ = {}, - uint32_t ppsIdEntryCount_ = {}, - const uint8_t * ppsIdEntries_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vpsId( vpsId_ ) - , spsId( spsId_ ) - , emitVpsEnable( emitVpsEnable_ ) - , emitSpsEnable( emitSpsEnable_ ) - , ppsIdEntryCount( ppsIdEntryCount_ ) - , ppsIdEntries( ppsIdEntries_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265EmitPictureParametersInfoEXT( VideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265EmitPictureParametersInfoEXT( VkVideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265EmitPictureParametersInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265EmitPictureParametersInfoEXT( uint8_t vpsId_, - uint8_t spsId_, - VULKAN_HPP_NAMESPACE::Bool32 emitVpsEnable_, - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & psIdEntries_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , vpsId( vpsId_ ) - , spsId( spsId_ ) - , emitVpsEnable( emitVpsEnable_ ) - , emitSpsEnable( emitSpsEnable_ ) - , ppsIdEntryCount( static_cast( psIdEntries_.size() ) ) - , ppsIdEntries( psIdEntries_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265EmitPictureParametersInfoEXT & operator=( VideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265EmitPictureParametersInfoEXT & operator=( VkVideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setVpsId( uint8_t vpsId_ ) VULKAN_HPP_NOEXCEPT - { - vpsId = vpsId_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setSpsId( uint8_t spsId_ ) VULKAN_HPP_NOEXCEPT - { - spsId = spsId_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setEmitVpsEnable( VULKAN_HPP_NAMESPACE::Bool32 emitVpsEnable_ ) VULKAN_HPP_NOEXCEPT - { - emitVpsEnable = emitVpsEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setEmitSpsEnable( VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable_ ) VULKAN_HPP_NOEXCEPT - { - emitSpsEnable = emitSpsEnable_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setPpsIdEntryCount( uint32_t ppsIdEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntryCount = ppsIdEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265EmitPictureParametersInfoEXT & setPpsIdEntries( const uint8_t * ppsIdEntries_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntries = ppsIdEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265EmitPictureParametersInfoEXT & - setPsIdEntries( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & psIdEntries_ ) VULKAN_HPP_NOEXCEPT - { - ppsIdEntryCount = static_cast( psIdEntries_.size() ); - ppsIdEntries = psIdEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265EmitPictureParametersInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265EmitPictureParametersInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vpsId, spsId, emitVpsEnable, emitSpsEnable, ppsIdEntryCount, ppsIdEntries ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265EmitPictureParametersInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vpsId == rhs.vpsId ) && ( spsId == rhs.spsId ) && ( emitVpsEnable == rhs.emitVpsEnable ) && - ( emitSpsEnable == rhs.emitSpsEnable ) && ( ppsIdEntryCount == rhs.ppsIdEntryCount ) && ( ppsIdEntries == rhs.ppsIdEntries ); -# endif - } - - bool operator!=( VideoEncodeH265EmitPictureParametersInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265EmitPictureParametersInfoEXT; - const void * pNext = {}; - uint8_t vpsId = {}; - uint8_t spsId = {}; - VULKAN_HPP_NAMESPACE::Bool32 emitVpsEnable = {}; - VULKAN_HPP_NAMESPACE::Bool32 emitSpsEnable = {}; - uint32_t ppsIdEntryCount = {}; - const uint8_t * ppsIdEntries = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265EmitPictureParametersInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265FrameSizeEXT - { - using NativeType = VkVideoEncodeH265FrameSizeEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265FrameSizeEXT( uint32_t frameISize_ = {}, uint32_t framePSize_ = {}, uint32_t frameBSize_ = {} ) VULKAN_HPP_NOEXCEPT - : frameISize( frameISize_ ) - , framePSize( framePSize_ ) - , frameBSize( frameBSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265FrameSizeEXT( VideoEncodeH265FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265FrameSizeEXT( VkVideoEncodeH265FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265FrameSizeEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265FrameSizeEXT & operator=( VideoEncodeH265FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265FrameSizeEXT & operator=( VkVideoEncodeH265FrameSizeEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265FrameSizeEXT & setFrameISize( uint32_t frameISize_ ) VULKAN_HPP_NOEXCEPT - { - frameISize = frameISize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265FrameSizeEXT & setFramePSize( uint32_t framePSize_ ) VULKAN_HPP_NOEXCEPT - { - framePSize = framePSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265FrameSizeEXT & setFrameBSize( uint32_t frameBSize_ ) VULKAN_HPP_NOEXCEPT - { - frameBSize = frameBSize_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265FrameSizeEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265FrameSizeEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( frameISize, framePSize, frameBSize ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265FrameSizeEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265FrameSizeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( frameISize == rhs.frameISize ) && ( framePSize == rhs.framePSize ) && ( frameBSize == rhs.frameBSize ); -# endif - } - - bool operator!=( VideoEncodeH265FrameSizeEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - uint32_t frameISize = {}; - uint32_t framePSize = {}; - uint32_t frameBSize = {}; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265ReferenceListsInfoEXT - { - using NativeType = VkVideoEncodeH265ReferenceListsInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265ReferenceListsInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265ReferenceListsInfoEXT( uint8_t referenceList0EntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList0Entries_ = {}, - uint8_t referenceList1EntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList1Entries_ = {}, - const StdVideoEncodeH265ReferenceModifications * pReferenceModifications_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , referenceList0EntryCount( referenceList0EntryCount_ ) - , pReferenceList0Entries( pReferenceList0Entries_ ) - , referenceList1EntryCount( referenceList1EntryCount_ ) - , pReferenceList1Entries( pReferenceList1Entries_ ) - , pReferenceModifications( pReferenceModifications_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265ReferenceListsInfoEXT( VideoEncodeH265ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265ReferenceListsInfoEXT( VkVideoEncodeH265ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265ReferenceListsInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265ReferenceListsInfoEXT( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList0Entries_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList1Entries_ = {}, - const StdVideoEncodeH265ReferenceModifications * pReferenceModifications_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , referenceList0EntryCount( static_cast( referenceList0Entries_.size() ) ) - , pReferenceList0Entries( referenceList0Entries_.data() ) - , referenceList1EntryCount( static_cast( referenceList1Entries_.size() ) ) - , pReferenceList1Entries( referenceList1Entries_.data() ) - , pReferenceModifications( pReferenceModifications_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265ReferenceListsInfoEXT & operator=( VideoEncodeH265ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265ReferenceListsInfoEXT & operator=( VkVideoEncodeH265ReferenceListsInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & setReferenceList0EntryCount( uint8_t referenceList0EntryCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceList0EntryCount = referenceList0EntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & - setPReferenceList0Entries( const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList0Entries_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceList0Entries = pReferenceList0Entries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265ReferenceListsInfoEXT & setReferenceList0Entries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList0Entries_ ) - VULKAN_HPP_NOEXCEPT - { - referenceList0EntryCount = static_cast( referenceList0Entries_.size() ); - pReferenceList0Entries = referenceList0Entries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & setReferenceList1EntryCount( uint8_t referenceList1EntryCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceList1EntryCount = referenceList1EntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & - setPReferenceList1Entries( const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList1Entries_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceList1Entries = pReferenceList1Entries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265ReferenceListsInfoEXT & setReferenceList1Entries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceList1Entries_ ) - VULKAN_HPP_NOEXCEPT - { - referenceList1EntryCount = static_cast( referenceList1Entries_.size() ); - pReferenceList1Entries = referenceList1Entries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ReferenceListsInfoEXT & - setPReferenceModifications( const StdVideoEncodeH265ReferenceModifications * pReferenceModifications_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceModifications = pReferenceModifications_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265ReferenceListsInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265ReferenceListsInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, referenceList0EntryCount, pReferenceList0Entries, referenceList1EntryCount, pReferenceList1Entries, pReferenceModifications ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265ReferenceListsInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265ReferenceListsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( referenceList0EntryCount == rhs.referenceList0EntryCount ) && - ( pReferenceList0Entries == rhs.pReferenceList0Entries ) && ( referenceList1EntryCount == rhs.referenceList1EntryCount ) && - ( pReferenceList1Entries == rhs.pReferenceList1Entries ) && ( pReferenceModifications == rhs.pReferenceModifications ); -# endif - } - - bool operator!=( VideoEncodeH265ReferenceListsInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265ReferenceListsInfoEXT; - const void * pNext = {}; - uint8_t referenceList0EntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList0Entries = {}; - uint8_t referenceList1EntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265DpbSlotInfoEXT * pReferenceList1Entries = {}; - const StdVideoEncodeH265ReferenceModifications * pReferenceModifications = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265ReferenceListsInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265NaluSliceSegmentInfoEXT - { - using NativeType = VkVideoEncodeH265NaluSliceSegmentInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265NaluSliceSegmentInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265NaluSliceSegmentInfoEXT( uint32_t ctbCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists_ = {}, - const StdVideoEncodeH265SliceSegmentHeader * pSliceSegmentHeaderStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , ctbCount( ctbCount_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , pSliceSegmentHeaderStd( pSliceSegmentHeaderStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265NaluSliceSegmentInfoEXT( VideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265NaluSliceSegmentInfoEXT( VkVideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265NaluSliceSegmentInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265NaluSliceSegmentInfoEXT & operator=( VideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265NaluSliceSegmentInfoEXT & operator=( VkVideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265NaluSliceSegmentInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265NaluSliceSegmentInfoEXT & setCtbCount( uint32_t ctbCount_ ) VULKAN_HPP_NOEXCEPT - { - ctbCount = ctbCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265NaluSliceSegmentInfoEXT & - setPReferenceFinalLists( const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceFinalLists = pReferenceFinalLists_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265NaluSliceSegmentInfoEXT & - setPSliceSegmentHeaderStd( const StdVideoEncodeH265SliceSegmentHeader * pSliceSegmentHeaderStd_ ) VULKAN_HPP_NOEXCEPT - { - pSliceSegmentHeaderStd = pSliceSegmentHeaderStd_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265NaluSliceSegmentInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265NaluSliceSegmentInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, ctbCount, pReferenceFinalLists, pSliceSegmentHeaderStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265NaluSliceSegmentInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( ctbCount == rhs.ctbCount ) && ( pReferenceFinalLists == rhs.pReferenceFinalLists ) && - ( pSliceSegmentHeaderStd == rhs.pSliceSegmentHeaderStd ); -# endif - } - - bool operator!=( VideoEncodeH265NaluSliceSegmentInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265NaluSliceSegmentInfoEXT; - const void * pNext = {}; - uint32_t ctbCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists = {}; - const StdVideoEncodeH265SliceSegmentHeader * pSliceSegmentHeaderStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265NaluSliceSegmentInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265ProfileInfoEXT - { - using NativeType = VkVideoEncodeH265ProfileInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265ProfileInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265ProfileInfoEXT( StdVideoH265ProfileIdc stdProfileIdc_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , stdProfileIdc( stdProfileIdc_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265ProfileInfoEXT( VideoEncodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265ProfileInfoEXT( VkVideoEncodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265ProfileInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265ProfileInfoEXT & operator=( VideoEncodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265ProfileInfoEXT & operator=( VkVideoEncodeH265ProfileInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ProfileInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265ProfileInfoEXT & setStdProfileIdc( StdVideoH265ProfileIdc stdProfileIdc_ ) VULKAN_HPP_NOEXCEPT - { - stdProfileIdc = stdProfileIdc_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265ProfileInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265ProfileInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, stdProfileIdc ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( VideoEncodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH265ProfileIdc ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( VideoEncodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memcmp( &stdProfileIdc, &rhs.stdProfileIdc, sizeof( StdVideoH265ProfileIdc ) ) == 0 ); - } - - bool operator!=( VideoEncodeH265ProfileInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265ProfileInfoEXT; - const void * pNext = {}; - StdVideoH265ProfileIdc stdProfileIdc = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265ProfileInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265QpEXT - { - using NativeType = VkVideoEncodeH265QpEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265QpEXT( int32_t qpI_ = {}, int32_t qpP_ = {}, int32_t qpB_ = {} ) VULKAN_HPP_NOEXCEPT - : qpI( qpI_ ) - , qpP( qpP_ ) - , qpB( qpB_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265QpEXT( VideoEncodeH265QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265QpEXT( VkVideoEncodeH265QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265QpEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265QpEXT & operator=( VideoEncodeH265QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265QpEXT & operator=( VkVideoEncodeH265QpEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265QpEXT & setQpI( int32_t qpI_ ) VULKAN_HPP_NOEXCEPT - { - qpI = qpI_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265QpEXT & setQpP( int32_t qpP_ ) VULKAN_HPP_NOEXCEPT - { - qpP = qpP_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265QpEXT & setQpB( int32_t qpB_ ) VULKAN_HPP_NOEXCEPT - { - qpB = qpB_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265QpEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265QpEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( qpI, qpP, qpB ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265QpEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265QpEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( qpI == rhs.qpI ) && ( qpP == rhs.qpP ) && ( qpB == rhs.qpB ); -# endif - } - - bool operator!=( VideoEncodeH265QpEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - int32_t qpI = {}; - int32_t qpP = {}; - int32_t qpB = {}; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265RateControlInfoEXT - { - using NativeType = VkVideoEncodeH265RateControlInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265RateControlInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265RateControlInfoEXT( uint32_t gopFrameCount_ = {}, - uint32_t idrPeriod_ = {}, - uint32_t consecutiveBFrameCount_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlStructureEXT rateControlStructure_ = - VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlStructureEXT::eUnknown, - uint8_t subLayerCount_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , gopFrameCount( gopFrameCount_ ) - , idrPeriod( idrPeriod_ ) - , consecutiveBFrameCount( consecutiveBFrameCount_ ) - , rateControlStructure( rateControlStructure_ ) - , subLayerCount( subLayerCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265RateControlInfoEXT( VideoEncodeH265RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265RateControlInfoEXT( VkVideoEncodeH265RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265RateControlInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265RateControlInfoEXT & operator=( VideoEncodeH265RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265RateControlInfoEXT & operator=( VkVideoEncodeH265RateControlInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & setGopFrameCount( uint32_t gopFrameCount_ ) VULKAN_HPP_NOEXCEPT - { - gopFrameCount = gopFrameCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & setIdrPeriod( uint32_t idrPeriod_ ) VULKAN_HPP_NOEXCEPT - { - idrPeriod = idrPeriod_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & setConsecutiveBFrameCount( uint32_t consecutiveBFrameCount_ ) VULKAN_HPP_NOEXCEPT - { - consecutiveBFrameCount = consecutiveBFrameCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & - setRateControlStructure( VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlStructureEXT rateControlStructure_ ) VULKAN_HPP_NOEXCEPT - { - rateControlStructure = rateControlStructure_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlInfoEXT & setSubLayerCount( uint8_t subLayerCount_ ) VULKAN_HPP_NOEXCEPT - { - subLayerCount = subLayerCount_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265RateControlInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265RateControlInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, gopFrameCount, idrPeriod, consecutiveBFrameCount, rateControlStructure, subLayerCount ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265RateControlInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265RateControlInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( gopFrameCount == rhs.gopFrameCount ) && ( idrPeriod == rhs.idrPeriod ) && - ( consecutiveBFrameCount == rhs.consecutiveBFrameCount ) && ( rateControlStructure == rhs.rateControlStructure ) && - ( subLayerCount == rhs.subLayerCount ); -# endif - } - - bool operator!=( VideoEncodeH265RateControlInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265RateControlInfoEXT; - const void * pNext = {}; - uint32_t gopFrameCount = {}; - uint32_t idrPeriod = {}; - uint32_t consecutiveBFrameCount = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlStructureEXT rateControlStructure = VULKAN_HPP_NAMESPACE::VideoEncodeH265RateControlStructureEXT::eUnknown; - uint8_t subLayerCount = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265RateControlInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265RateControlLayerInfoEXT - { - using NativeType = VkVideoEncodeH265RateControlLayerInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265RateControlLayerInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265RateControlLayerInfoEXT( uint8_t temporalId_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT initialRcQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMinQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT minQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMaxQp_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT maxQp_ = {}, - VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeH265FrameSizeEXT maxFrameSize_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , temporalId( temporalId_ ) - , useInitialRcQp( useInitialRcQp_ ) - , initialRcQp( initialRcQp_ ) - , useMinQp( useMinQp_ ) - , minQp( minQp_ ) - , useMaxQp( useMaxQp_ ) - , maxQp( maxQp_ ) - , useMaxFrameSize( useMaxFrameSize_ ) - , maxFrameSize( maxFrameSize_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265RateControlLayerInfoEXT( VideoEncodeH265RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265RateControlLayerInfoEXT( VkVideoEncodeH265RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265RateControlLayerInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265RateControlLayerInfoEXT & operator=( VideoEncodeH265RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265RateControlLayerInfoEXT & operator=( VkVideoEncodeH265RateControlLayerInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setTemporalId( uint8_t temporalId_ ) VULKAN_HPP_NOEXCEPT - { - temporalId = temporalId_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setUseInitialRcQp( VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp_ ) VULKAN_HPP_NOEXCEPT - { - useInitialRcQp = useInitialRcQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & - setInitialRcQp( VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT const & initialRcQp_ ) VULKAN_HPP_NOEXCEPT - { - initialRcQp = initialRcQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setUseMinQp( VULKAN_HPP_NAMESPACE::Bool32 useMinQp_ ) VULKAN_HPP_NOEXCEPT - { - useMinQp = useMinQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setMinQp( VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT const & minQp_ ) VULKAN_HPP_NOEXCEPT - { - minQp = minQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setUseMaxQp( VULKAN_HPP_NAMESPACE::Bool32 useMaxQp_ ) VULKAN_HPP_NOEXCEPT - { - useMaxQp = useMaxQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setMaxQp( VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT const & maxQp_ ) VULKAN_HPP_NOEXCEPT - { - maxQp = maxQp_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & setUseMaxFrameSize( VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize_ ) VULKAN_HPP_NOEXCEPT - { - useMaxFrameSize = useMaxFrameSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265RateControlLayerInfoEXT & - setMaxFrameSize( VULKAN_HPP_NAMESPACE::VideoEncodeH265FrameSizeEXT const & maxFrameSize_ ) VULKAN_HPP_NOEXCEPT - { - maxFrameSize = maxFrameSize_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265RateControlLayerInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265RateControlLayerInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, temporalId, useInitialRcQp, initialRcQp, useMinQp, minQp, useMaxQp, maxQp, useMaxFrameSize, maxFrameSize ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265RateControlLayerInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265RateControlLayerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( temporalId == rhs.temporalId ) && ( useInitialRcQp == rhs.useInitialRcQp ) && - ( initialRcQp == rhs.initialRcQp ) && ( useMinQp == rhs.useMinQp ) && ( minQp == rhs.minQp ) && ( useMaxQp == rhs.useMaxQp ) && - ( maxQp == rhs.maxQp ) && ( useMaxFrameSize == rhs.useMaxFrameSize ) && ( maxFrameSize == rhs.maxFrameSize ); -# endif - } - - bool operator!=( VideoEncodeH265RateControlLayerInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265RateControlLayerInfoEXT; - const void * pNext = {}; - uint8_t temporalId = {}; - VULKAN_HPP_NAMESPACE::Bool32 useInitialRcQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT initialRcQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMinQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT minQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMaxQp = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265QpEXT maxQp = {}; - VULKAN_HPP_NAMESPACE::Bool32 useMaxFrameSize = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeH265FrameSizeEXT maxFrameSize = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265RateControlLayerInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265SessionParametersAddInfoEXT - { - using NativeType = VkVideoEncodeH265SessionParametersAddInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265SessionParametersAddInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265SessionParametersAddInfoEXT( uint32_t vpsStdCount_ = {}, - const StdVideoH265VideoParameterSet * pVpsStd_ = {}, - uint32_t spsStdCount_ = {}, - const StdVideoH265SequenceParameterSet * pSpsStd_ = {}, - uint32_t ppsStdCount_ = {}, - const StdVideoH265PictureParameterSet * pPpsStd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , vpsStdCount( vpsStdCount_ ) - , pVpsStd( pVpsStd_ ) - , spsStdCount( spsStdCount_ ) - , pSpsStd( pSpsStd_ ) - , ppsStdCount( ppsStdCount_ ) - , pPpsStd( pPpsStd_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265SessionParametersAddInfoEXT( VideoEncodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265SessionParametersAddInfoEXT( VkVideoEncodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265SessionParametersAddInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265SessionParametersAddInfoEXT( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vpsStd_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , vpsStdCount( static_cast( vpsStd_.size() ) ) - , pVpsStd( vpsStd_.data() ) - , spsStdCount( static_cast( spsStd_.size() ) ) - , pSpsStd( spsStd_.data() ) - , ppsStdCount( static_cast( ppsStd_.size() ) ) - , pPpsStd( ppsStd_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265SessionParametersAddInfoEXT & operator=( VideoEncodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265SessionParametersAddInfoEXT & operator=( VkVideoEncodeH265SessionParametersAddInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setVpsStdCount( uint32_t vpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - vpsStdCount = vpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setPVpsStd( const StdVideoH265VideoParameterSet * pVpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pVpsStd = pVpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265SessionParametersAddInfoEXT & - setVpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & vpsStd_ ) VULKAN_HPP_NOEXCEPT - { - vpsStdCount = static_cast( vpsStd_.size() ); - pVpsStd = vpsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setSpsStdCount( uint32_t spsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = spsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setPSpsStd( const StdVideoH265SequenceParameterSet * pSpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pSpsStd = pSpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265SessionParametersAddInfoEXT & - setSpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & spsStd_ ) VULKAN_HPP_NOEXCEPT - { - spsStdCount = static_cast( spsStd_.size() ); - pSpsStd = spsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setPpsStdCount( uint32_t ppsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = ppsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersAddInfoEXT & setPPpsStd( const StdVideoH265PictureParameterSet * pPpsStd_ ) VULKAN_HPP_NOEXCEPT - { - pPpsStd = pPpsStd_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265SessionParametersAddInfoEXT & - setPpsStd( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & ppsStd_ ) VULKAN_HPP_NOEXCEPT - { - ppsStdCount = static_cast( ppsStd_.size() ); - pPpsStd = ppsStd_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265SessionParametersAddInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265SessionParametersAddInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, vpsStdCount, pVpsStd, spsStdCount, pSpsStd, ppsStdCount, pPpsStd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265SessionParametersAddInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( vpsStdCount == rhs.vpsStdCount ) && ( pVpsStd == rhs.pVpsStd ) && - ( spsStdCount == rhs.spsStdCount ) && ( pSpsStd == rhs.pSpsStd ) && ( ppsStdCount == rhs.ppsStdCount ) && ( pPpsStd == rhs.pPpsStd ); -# endif - } - - bool operator!=( VideoEncodeH265SessionParametersAddInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265SessionParametersAddInfoEXT; - const void * pNext = {}; - uint32_t vpsStdCount = {}; - const StdVideoH265VideoParameterSet * pVpsStd = {}; - uint32_t spsStdCount = {}; - const StdVideoH265SequenceParameterSet * pSpsStd = {}; - uint32_t ppsStdCount = {}; - const StdVideoH265PictureParameterSet * pPpsStd = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265SessionParametersAddInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265SessionParametersCreateInfoEXT - { - using NativeType = VkVideoEncodeH265SessionParametersCreateInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265SessionParametersCreateInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VideoEncodeH265SessionParametersCreateInfoEXT( uint32_t maxVpsStdCount_ = {}, - uint32_t maxSpsStdCount_ = {}, - uint32_t maxPpsStdCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersAddInfoEXT * pParametersAddInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , maxVpsStdCount( maxVpsStdCount_ ) - , maxSpsStdCount( maxSpsStdCount_ ) - , maxPpsStdCount( maxPpsStdCount_ ) - , pParametersAddInfo( pParametersAddInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR - VideoEncodeH265SessionParametersCreateInfoEXT( VideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265SessionParametersCreateInfoEXT( VkVideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265SessionParametersCreateInfoEXT( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265SessionParametersCreateInfoEXT & operator=( VideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265SessionParametersCreateInfoEXT & operator=( VkVideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersCreateInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersCreateInfoEXT & setMaxVpsStdCount( uint32_t maxVpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxVpsStdCount = maxVpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersCreateInfoEXT & setMaxSpsStdCount( uint32_t maxSpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxSpsStdCount = maxSpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersCreateInfoEXT & setMaxPpsStdCount( uint32_t maxPpsStdCount_ ) VULKAN_HPP_NOEXCEPT - { - maxPpsStdCount = maxPpsStdCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265SessionParametersCreateInfoEXT & - setPParametersAddInfo( const VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersAddInfoEXT * pParametersAddInfo_ ) VULKAN_HPP_NOEXCEPT - { - pParametersAddInfo = pParametersAddInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265SessionParametersCreateInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265SessionParametersCreateInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, maxVpsStdCount, maxSpsStdCount, maxPpsStdCount, pParametersAddInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265SessionParametersCreateInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( maxVpsStdCount == rhs.maxVpsStdCount ) && ( maxSpsStdCount == rhs.maxSpsStdCount ) && - ( maxPpsStdCount == rhs.maxPpsStdCount ) && ( pParametersAddInfo == rhs.pParametersAddInfo ); -# endif - } - - bool operator!=( VideoEncodeH265SessionParametersCreateInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265SessionParametersCreateInfoEXT; - const void * pNext = {}; - uint32_t maxVpsStdCount = {}; - uint32_t maxSpsStdCount = {}; - uint32_t maxPpsStdCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265SessionParametersAddInfoEXT * pParametersAddInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265SessionParametersCreateInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeH265VclFrameInfoEXT - { - using NativeType = VkVideoEncodeH265VclFrameInfoEXT; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeH265VclFrameInfoEXT; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeH265VclFrameInfoEXT( const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists_ = {}, - uint32_t naluSliceSegmentEntryCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeH265NaluSliceSegmentInfoEXT * pNaluSliceSegmentEntries_ = {}, - const StdVideoEncodeH265PictureInfo * pCurrentPictureInfo_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , naluSliceSegmentEntryCount( naluSliceSegmentEntryCount_ ) - , pNaluSliceSegmentEntries( pNaluSliceSegmentEntries_ ) - , pCurrentPictureInfo( pCurrentPictureInfo_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeH265VclFrameInfoEXT( VideoEncodeH265VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265VclFrameInfoEXT( VkVideoEncodeH265VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeH265VclFrameInfoEXT( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265VclFrameInfoEXT( - const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & naluSliceSegmentEntries_, - const StdVideoEncodeH265PictureInfo * pCurrentPictureInfo_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , pReferenceFinalLists( pReferenceFinalLists_ ) - , naluSliceSegmentEntryCount( static_cast( naluSliceSegmentEntries_.size() ) ) - , pNaluSliceSegmentEntries( naluSliceSegmentEntries_.data() ) - , pCurrentPictureInfo( pCurrentPictureInfo_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeH265VclFrameInfoEXT & operator=( VideoEncodeH265VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeH265VclFrameInfoEXT & operator=( VkVideoEncodeH265VclFrameInfoEXT const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265VclFrameInfoEXT & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265VclFrameInfoEXT & - setPReferenceFinalLists( const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceFinalLists = pReferenceFinalLists_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265VclFrameInfoEXT & setNaluSliceSegmentEntryCount( uint32_t naluSliceSegmentEntryCount_ ) VULKAN_HPP_NOEXCEPT - { - naluSliceSegmentEntryCount = naluSliceSegmentEntryCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265VclFrameInfoEXT & - setPNaluSliceSegmentEntries( const VULKAN_HPP_NAMESPACE::VideoEncodeH265NaluSliceSegmentInfoEXT * pNaluSliceSegmentEntries_ ) VULKAN_HPP_NOEXCEPT - { - pNaluSliceSegmentEntries = pNaluSliceSegmentEntries_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeH265VclFrameInfoEXT & setNaluSliceSegmentEntries( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & naluSliceSegmentEntries_ ) - VULKAN_HPP_NOEXCEPT - { - naluSliceSegmentEntryCount = static_cast( naluSliceSegmentEntries_.size() ); - pNaluSliceSegmentEntries = naluSliceSegmentEntries_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeH265VclFrameInfoEXT & - setPCurrentPictureInfo( const StdVideoEncodeH265PictureInfo * pCurrentPictureInfo_ ) VULKAN_HPP_NOEXCEPT - { - pCurrentPictureInfo = pCurrentPictureInfo_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeH265VclFrameInfoEXT const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeH265VclFrameInfoEXT &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, pReferenceFinalLists, naluSliceSegmentEntryCount, pNaluSliceSegmentEntries, pCurrentPictureInfo ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeH265VclFrameInfoEXT const & ) const = default; -# else - bool operator==( VideoEncodeH265VclFrameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( pReferenceFinalLists == rhs.pReferenceFinalLists ) && - ( naluSliceSegmentEntryCount == rhs.naluSliceSegmentEntryCount ) && ( pNaluSliceSegmentEntries == rhs.pNaluSliceSegmentEntries ) && - ( pCurrentPictureInfo == rhs.pCurrentPictureInfo ); -# endif - } - - bool operator!=( VideoEncodeH265VclFrameInfoEXT const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeH265VclFrameInfoEXT; - const void * pNext = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265ReferenceListsInfoEXT * pReferenceFinalLists = {}; - uint32_t naluSliceSegmentEntryCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeH265NaluSliceSegmentInfoEXT * pNaluSliceSegmentEntries = {}; - const StdVideoEncodeH265PictureInfo * pCurrentPictureInfo = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeH265VclFrameInfoEXT; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeInfoKHR - { - using NativeType = VkVideoEncodeInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeInfoKHR( VULKAN_HPP_NAMESPACE::VideoEncodeFlagsKHR flags_ = {}, - uint32_t qualityLevel_ = {}, - VULKAN_HPP_NAMESPACE::Buffer dstBitstreamBuffer_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferOffset_ = {}, - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferMaxRange_ = {}, - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR srcPictureResource_ = {}, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_ = {}, - uint32_t referenceSlotCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ = {}, - uint32_t precedingExternallyEncodedBytes_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , qualityLevel( qualityLevel_ ) - , dstBitstreamBuffer( dstBitstreamBuffer_ ) - , dstBitstreamBufferOffset( dstBitstreamBufferOffset_ ) - , dstBitstreamBufferMaxRange( dstBitstreamBufferMaxRange_ ) - , srcPictureResource( srcPictureResource_ ) - , pSetupReferenceSlot( pSetupReferenceSlot_ ) - , referenceSlotCount( referenceSlotCount_ ) - , pReferenceSlots( pReferenceSlots_ ) - , precedingExternallyEncodedBytes( precedingExternallyEncodedBytes_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeInfoKHR( VideoEncodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeInfoKHR( VkVideoEncodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : VideoEncodeInfoKHR( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeInfoKHR( VULKAN_HPP_NAMESPACE::VideoEncodeFlagsKHR flags_, - uint32_t qualityLevel_, - VULKAN_HPP_NAMESPACE::Buffer dstBitstreamBuffer_, - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferOffset_, - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferMaxRange_, - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR srcPictureResource_, - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_, - uint32_t precedingExternallyEncodedBytes_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , qualityLevel( qualityLevel_ ) - , dstBitstreamBuffer( dstBitstreamBuffer_ ) - , dstBitstreamBufferOffset( dstBitstreamBufferOffset_ ) - , dstBitstreamBufferMaxRange( dstBitstreamBufferMaxRange_ ) - , srcPictureResource( srcPictureResource_ ) - , pSetupReferenceSlot( pSetupReferenceSlot_ ) - , referenceSlotCount( static_cast( referenceSlots_.size() ) ) - , pReferenceSlots( referenceSlots_.data() ) - , precedingExternallyEncodedBytes( precedingExternallyEncodedBytes_ ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeInfoKHR & operator=( VideoEncodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeInfoKHR & operator=( VkVideoEncodeInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoEncodeFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setQualityLevel( uint32_t qualityLevel_ ) VULKAN_HPP_NOEXCEPT - { - qualityLevel = qualityLevel_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setDstBitstreamBuffer( VULKAN_HPP_NAMESPACE::Buffer dstBitstreamBuffer_ ) VULKAN_HPP_NOEXCEPT - { - dstBitstreamBuffer = dstBitstreamBuffer_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setDstBitstreamBufferOffset( VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferOffset_ ) VULKAN_HPP_NOEXCEPT - { - dstBitstreamBufferOffset = dstBitstreamBufferOffset_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & - setDstBitstreamBufferMaxRange( VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferMaxRange_ ) VULKAN_HPP_NOEXCEPT - { - dstBitstreamBufferMaxRange = dstBitstreamBufferMaxRange_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & - setSrcPictureResource( VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR const & srcPictureResource_ ) VULKAN_HPP_NOEXCEPT - { - srcPictureResource = srcPictureResource_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & - setPSetupReferenceSlot( const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot_ ) VULKAN_HPP_NOEXCEPT - { - pSetupReferenceSlot = pSetupReferenceSlot_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setReferenceSlotCount( uint32_t referenceSlotCount_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = referenceSlotCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & - setPReferenceSlots( const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - pReferenceSlots = pReferenceSlots_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeInfoKHR & setReferenceSlots( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & referenceSlots_ ) VULKAN_HPP_NOEXCEPT - { - referenceSlotCount = static_cast( referenceSlots_.size() ); - pReferenceSlots = referenceSlots_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeInfoKHR & setPrecedingExternallyEncodedBytes( uint32_t precedingExternallyEncodedBytes_ ) VULKAN_HPP_NOEXCEPT - { - precedingExternallyEncodedBytes = precedingExternallyEncodedBytes_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - flags, - qualityLevel, - dstBitstreamBuffer, - dstBitstreamBufferOffset, - dstBitstreamBufferMaxRange, - srcPictureResource, - pSetupReferenceSlot, - referenceSlotCount, - pReferenceSlots, - precedingExternallyEncodedBytes ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeInfoKHR const & ) const = default; -# else - bool operator==( VideoEncodeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( qualityLevel == rhs.qualityLevel ) && - ( dstBitstreamBuffer == rhs.dstBitstreamBuffer ) && ( dstBitstreamBufferOffset == rhs.dstBitstreamBufferOffset ) && - ( dstBitstreamBufferMaxRange == rhs.dstBitstreamBufferMaxRange ) && ( srcPictureResource == rhs.srcPictureResource ) && - ( pSetupReferenceSlot == rhs.pSetupReferenceSlot ) && ( referenceSlotCount == rhs.referenceSlotCount ) && - ( pReferenceSlots == rhs.pReferenceSlots ) && ( precedingExternallyEncodedBytes == rhs.precedingExternallyEncodedBytes ); -# endif - } - - bool operator!=( VideoEncodeInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeFlagsKHR flags = {}; - uint32_t qualityLevel = {}; - VULKAN_HPP_NAMESPACE::Buffer dstBitstreamBuffer = {}; - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferOffset = {}; - VULKAN_HPP_NAMESPACE::DeviceSize dstBitstreamBufferMaxRange = {}; - VULKAN_HPP_NAMESPACE::VideoPictureResourceInfoKHR srcPictureResource = {}; - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pSetupReferenceSlot = {}; - uint32_t referenceSlotCount = {}; - const VULKAN_HPP_NAMESPACE::VideoReferenceSlotInfoKHR * pReferenceSlots = {}; - uint32_t precedingExternallyEncodedBytes = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeRateControlLayerInfoKHR - { - using NativeType = VkVideoEncodeRateControlLayerInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeRateControlLayerInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeRateControlLayerInfoKHR( uint32_t averageBitrate_ = {}, - uint32_t maxBitrate_ = {}, - uint32_t frameRateNumerator_ = {}, - uint32_t frameRateDenominator_ = {}, - uint32_t virtualBufferSizeInMs_ = {}, - uint32_t initialVirtualBufferSizeInMs_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , averageBitrate( averageBitrate_ ) - , maxBitrate( maxBitrate_ ) - , frameRateNumerator( frameRateNumerator_ ) - , frameRateDenominator( frameRateDenominator_ ) - , virtualBufferSizeInMs( virtualBufferSizeInMs_ ) - , initialVirtualBufferSizeInMs( initialVirtualBufferSizeInMs_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeRateControlLayerInfoKHR( VideoEncodeRateControlLayerInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeRateControlLayerInfoKHR( VkVideoEncodeRateControlLayerInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeRateControlLayerInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeRateControlLayerInfoKHR & operator=( VideoEncodeRateControlLayerInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeRateControlLayerInfoKHR & operator=( VkVideoEncodeRateControlLayerInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setAverageBitrate( uint32_t averageBitrate_ ) VULKAN_HPP_NOEXCEPT - { - averageBitrate = averageBitrate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setMaxBitrate( uint32_t maxBitrate_ ) VULKAN_HPP_NOEXCEPT - { - maxBitrate = maxBitrate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setFrameRateNumerator( uint32_t frameRateNumerator_ ) VULKAN_HPP_NOEXCEPT - { - frameRateNumerator = frameRateNumerator_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setFrameRateDenominator( uint32_t frameRateDenominator_ ) VULKAN_HPP_NOEXCEPT - { - frameRateDenominator = frameRateDenominator_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setVirtualBufferSizeInMs( uint32_t virtualBufferSizeInMs_ ) VULKAN_HPP_NOEXCEPT - { - virtualBufferSizeInMs = virtualBufferSizeInMs_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlLayerInfoKHR & setInitialVirtualBufferSizeInMs( uint32_t initialVirtualBufferSizeInMs_ ) VULKAN_HPP_NOEXCEPT - { - initialVirtualBufferSizeInMs = initialVirtualBufferSizeInMs_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeRateControlLayerInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeRateControlLayerInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( - sType, pNext, averageBitrate, maxBitrate, frameRateNumerator, frameRateDenominator, virtualBufferSizeInMs, initialVirtualBufferSizeInMs ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeRateControlLayerInfoKHR const & ) const = default; -# else - bool operator==( VideoEncodeRateControlLayerInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( averageBitrate == rhs.averageBitrate ) && ( maxBitrate == rhs.maxBitrate ) && - ( frameRateNumerator == rhs.frameRateNumerator ) && ( frameRateDenominator == rhs.frameRateDenominator ) && - ( virtualBufferSizeInMs == rhs.virtualBufferSizeInMs ) && ( initialVirtualBufferSizeInMs == rhs.initialVirtualBufferSizeInMs ); -# endif - } - - bool operator!=( VideoEncodeRateControlLayerInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeRateControlLayerInfoKHR; - const void * pNext = {}; - uint32_t averageBitrate = {}; - uint32_t maxBitrate = {}; - uint32_t frameRateNumerator = {}; - uint32_t frameRateDenominator = {}; - uint32_t virtualBufferSizeInMs = {}; - uint32_t initialVirtualBufferSizeInMs = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeRateControlLayerInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeRateControlInfoKHR - { - using NativeType = VkVideoEncodeRateControlInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeRateControlInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEncodeRateControlInfoKHR( - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR rateControlMode_ = VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR::eNone, - uint8_t layerCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoEncodeRateControlLayerInfoKHR * pLayerConfigs_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , rateControlMode( rateControlMode_ ) - , layerCount( layerCount_ ) - , pLayerConfigs( pLayerConfigs_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeRateControlInfoKHR( VideoEncodeRateControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeRateControlInfoKHR( VkVideoEncodeRateControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeRateControlInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeRateControlInfoKHR( - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlFlagsKHR flags_, - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR rateControlMode_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & layerConfigs_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , flags( flags_ ) - , rateControlMode( rateControlMode_ ) - , layerCount( static_cast( layerConfigs_.size() ) ) - , pLayerConfigs( layerConfigs_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeRateControlInfoKHR & operator=( VideoEncodeRateControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeRateControlInfoKHR & operator=( VkVideoEncodeRateControlInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlInfoKHR & - setRateControlMode( VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR rateControlMode_ ) VULKAN_HPP_NOEXCEPT - { - rateControlMode = rateControlMode_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlInfoKHR & setLayerCount( uint8_t layerCount_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = layerCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeRateControlInfoKHR & - setPLayerConfigs( const VULKAN_HPP_NAMESPACE::VideoEncodeRateControlLayerInfoKHR * pLayerConfigs_ ) VULKAN_HPP_NOEXCEPT - { - pLayerConfigs = pLayerConfigs_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoEncodeRateControlInfoKHR & setLayerConfigs( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & layerConfigs_ ) VULKAN_HPP_NOEXCEPT - { - layerCount = static_cast( layerConfigs_.size() ); - pLayerConfigs = layerConfigs_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeRateControlInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeRateControlInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, rateControlMode, layerCount, pLayerConfigs ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeRateControlInfoKHR const & ) const = default; -# else - bool operator==( VideoEncodeRateControlInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( rateControlMode == rhs.rateControlMode ) && - ( layerCount == rhs.layerCount ) && ( pLayerConfigs == rhs.pLayerConfigs ); -# endif - } - - bool operator!=( VideoEncodeRateControlInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeRateControlInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR rateControlMode = VULKAN_HPP_NAMESPACE::VideoEncodeRateControlModeFlagBitsKHR::eNone; - uint8_t layerCount = {}; - const VULKAN_HPP_NAMESPACE::VideoEncodeRateControlLayerInfoKHR * pLayerConfigs = {}; - }; - - template <> - struct CppType - { - using Type = VideoEncodeRateControlInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEncodeUsageInfoKHR - { - using NativeType = VkVideoEncodeUsageInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEncodeUsageInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - VideoEncodeUsageInfoKHR( VULKAN_HPP_NAMESPACE::VideoEncodeUsageFlagsKHR videoUsageHints_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeContentFlagsKHR videoContentHints_ = {}, - VULKAN_HPP_NAMESPACE::VideoEncodeTuningModeKHR tuningMode_ = VULKAN_HPP_NAMESPACE::VideoEncodeTuningModeKHR::eDefault, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , videoUsageHints( videoUsageHints_ ) - , videoContentHints( videoContentHints_ ) - , tuningMode( tuningMode_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEncodeUsageInfoKHR( VideoEncodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeUsageInfoKHR( VkVideoEncodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEncodeUsageInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEncodeUsageInfoKHR & operator=( VideoEncodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEncodeUsageInfoKHR & operator=( VkVideoEncodeUsageInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEncodeUsageInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeUsageInfoKHR & setVideoUsageHints( VULKAN_HPP_NAMESPACE::VideoEncodeUsageFlagsKHR videoUsageHints_ ) VULKAN_HPP_NOEXCEPT - { - videoUsageHints = videoUsageHints_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeUsageInfoKHR & - setVideoContentHints( VULKAN_HPP_NAMESPACE::VideoEncodeContentFlagsKHR videoContentHints_ ) VULKAN_HPP_NOEXCEPT - { - videoContentHints = videoContentHints_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEncodeUsageInfoKHR & setTuningMode( VULKAN_HPP_NAMESPACE::VideoEncodeTuningModeKHR tuningMode_ ) VULKAN_HPP_NOEXCEPT - { - tuningMode = tuningMode_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEncodeUsageInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEncodeUsageInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, videoUsageHints, videoContentHints, tuningMode ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEncodeUsageInfoKHR const & ) const = default; -# else - bool operator==( VideoEncodeUsageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( videoUsageHints == rhs.videoUsageHints ) && ( videoContentHints == rhs.videoContentHints ) && - ( tuningMode == rhs.tuningMode ); -# endif - } - - bool operator!=( VideoEncodeUsageInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEncodeUsageInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeUsageFlagsKHR videoUsageHints = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeContentFlagsKHR videoContentHints = {}; - VULKAN_HPP_NAMESPACE::VideoEncodeTuningModeKHR tuningMode = VULKAN_HPP_NAMESPACE::VideoEncodeTuningModeKHR::eDefault; - }; - - template <> - struct CppType - { - using Type = VideoEncodeUsageInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoEndCodingInfoKHR - { - using NativeType = VkVideoEndCodingInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoEndCodingInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoEndCodingInfoKHR( VULKAN_HPP_NAMESPACE::VideoEndCodingFlagsKHR flags_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoEndCodingInfoKHR( VideoEndCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEndCodingInfoKHR( VkVideoEndCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoEndCodingInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoEndCodingInfoKHR & operator=( VideoEndCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoEndCodingInfoKHR & operator=( VkVideoEndCodingInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoEndCodingInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoEndCodingInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoEndCodingFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoEndCodingInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoEndCodingInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoEndCodingInfoKHR const & ) const = default; -# else - bool operator==( VideoEndCodingInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ); -# endif - } - - bool operator!=( VideoEndCodingInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoEndCodingInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoEndCodingFlagsKHR flags = {}; - }; - - template <> - struct CppType - { - using Type = VideoEndCodingInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoFormatPropertiesKHR - { - using NativeType = VkVideoFormatPropertiesKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoFormatPropertiesKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoFormatPropertiesKHR( VULKAN_HPP_NAMESPACE::Format format_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::ComponentMapping componentMapping_ = {}, - VULKAN_HPP_NAMESPACE::ImageCreateFlags imageCreateFlags_ = {}, - VULKAN_HPP_NAMESPACE::ImageType imageType_ = VULKAN_HPP_NAMESPACE::ImageType::e1D, - VULKAN_HPP_NAMESPACE::ImageTiling imageTiling_ = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal, - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsageFlags_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , format( format_ ) - , componentMapping( componentMapping_ ) - , imageCreateFlags( imageCreateFlags_ ) - , imageType( imageType_ ) - , imageTiling( imageTiling_ ) - , imageUsageFlags( imageUsageFlags_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoFormatPropertiesKHR( VideoFormatPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoFormatPropertiesKHR( VkVideoFormatPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoFormatPropertiesKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoFormatPropertiesKHR & operator=( VideoFormatPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoFormatPropertiesKHR & operator=( VkVideoFormatPropertiesKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoFormatPropertiesKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoFormatPropertiesKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, format, componentMapping, imageCreateFlags, imageType, imageTiling, imageUsageFlags ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoFormatPropertiesKHR const & ) const = default; -# else - bool operator==( VideoFormatPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( format == rhs.format ) && ( componentMapping == rhs.componentMapping ) && - ( imageCreateFlags == rhs.imageCreateFlags ) && ( imageType == rhs.imageType ) && ( imageTiling == rhs.imageTiling ) && - ( imageUsageFlags == rhs.imageUsageFlags ); -# endif - } - - bool operator!=( VideoFormatPropertiesKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoFormatPropertiesKHR; - void * pNext = {}; - VULKAN_HPP_NAMESPACE::Format format = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::ComponentMapping componentMapping = {}; - VULKAN_HPP_NAMESPACE::ImageCreateFlags imageCreateFlags = {}; - VULKAN_HPP_NAMESPACE::ImageType imageType = VULKAN_HPP_NAMESPACE::ImageType::e1D; - VULKAN_HPP_NAMESPACE::ImageTiling imageTiling = VULKAN_HPP_NAMESPACE::ImageTiling::eOptimal; - VULKAN_HPP_NAMESPACE::ImageUsageFlags imageUsageFlags = {}; - }; - - template <> - struct CppType - { - using Type = VideoFormatPropertiesKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoProfileInfoKHR - { - using NativeType = VkVideoProfileInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoProfileInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoProfileInfoKHR( - VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagBitsKHR videoCodecOperation_ = VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagBitsKHR::eNone, - VULKAN_HPP_NAMESPACE::VideoChromaSubsamplingFlagsKHR chromaSubsampling_ = {}, - VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR lumaBitDepth_ = {}, - VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR chromaBitDepth_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , videoCodecOperation( videoCodecOperation_ ) - , chromaSubsampling( chromaSubsampling_ ) - , lumaBitDepth( lumaBitDepth_ ) - , chromaBitDepth( chromaBitDepth_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoProfileInfoKHR( VideoProfileInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoProfileInfoKHR( VkVideoProfileInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT : VideoProfileInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoProfileInfoKHR & operator=( VideoProfileInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoProfileInfoKHR & operator=( VkVideoProfileInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoProfileInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileInfoKHR & - setVideoCodecOperation( VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagBitsKHR videoCodecOperation_ ) VULKAN_HPP_NOEXCEPT - { - videoCodecOperation = videoCodecOperation_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileInfoKHR & - setChromaSubsampling( VULKAN_HPP_NAMESPACE::VideoChromaSubsamplingFlagsKHR chromaSubsampling_ ) VULKAN_HPP_NOEXCEPT - { - chromaSubsampling = chromaSubsampling_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileInfoKHR & setLumaBitDepth( VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR lumaBitDepth_ ) VULKAN_HPP_NOEXCEPT - { - lumaBitDepth = lumaBitDepth_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileInfoKHR & setChromaBitDepth( VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR chromaBitDepth_ ) VULKAN_HPP_NOEXCEPT - { - chromaBitDepth = chromaBitDepth_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoProfileInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoProfileInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, videoCodecOperation, chromaSubsampling, lumaBitDepth, chromaBitDepth ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoProfileInfoKHR const & ) const = default; -# else - bool operator==( VideoProfileInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( videoCodecOperation == rhs.videoCodecOperation ) && - ( chromaSubsampling == rhs.chromaSubsampling ) && ( lumaBitDepth == rhs.lumaBitDepth ) && ( chromaBitDepth == rhs.chromaBitDepth ); -# endif - } - - bool operator!=( VideoProfileInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoProfileInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagBitsKHR videoCodecOperation = VULKAN_HPP_NAMESPACE::VideoCodecOperationFlagBitsKHR::eNone; - VULKAN_HPP_NAMESPACE::VideoChromaSubsamplingFlagsKHR chromaSubsampling = {}; - VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR lumaBitDepth = {}; - VULKAN_HPP_NAMESPACE::VideoComponentBitDepthFlagsKHR chromaBitDepth = {}; - }; - - template <> - struct CppType - { - using Type = VideoProfileInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoProfileListInfoKHR - { - using NativeType = VkVideoProfileListInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoProfileListInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoProfileListInfoKHR( uint32_t profileCount_ = {}, - const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pProfiles_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , profileCount( profileCount_ ) - , pProfiles( pProfiles_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoProfileListInfoKHR( VideoProfileListInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoProfileListInfoKHR( VkVideoProfileListInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoProfileListInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoProfileListInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & profiles_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ), profileCount( static_cast( profiles_.size() ) ), pProfiles( profiles_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoProfileListInfoKHR & operator=( VideoProfileListInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoProfileListInfoKHR & operator=( VkVideoProfileListInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoProfileListInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileListInfoKHR & setProfileCount( uint32_t profileCount_ ) VULKAN_HPP_NOEXCEPT - { - profileCount = profileCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoProfileListInfoKHR & setPProfiles( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pProfiles_ ) VULKAN_HPP_NOEXCEPT - { - pProfiles = pProfiles_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - VideoProfileListInfoKHR & - setProfiles( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & profiles_ ) VULKAN_HPP_NOEXCEPT - { - profileCount = static_cast( profiles_.size() ); - pProfiles = profiles_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoProfileListInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoProfileListInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, profileCount, pProfiles ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoProfileListInfoKHR const & ) const = default; -# else - bool operator==( VideoProfileListInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( profileCount == rhs.profileCount ) && ( pProfiles == rhs.pProfiles ); -# endif - } - - bool operator!=( VideoProfileListInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoProfileListInfoKHR; - const void * pNext = {}; - uint32_t profileCount = {}; - const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pProfiles = {}; - }; - - template <> - struct CppType - { - using Type = VideoProfileListInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoSessionCreateInfoKHR - { - using NativeType = VkVideoSessionCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoSessionCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR( uint32_t queueFamilyIndex_ = {}, - VULKAN_HPP_NAMESPACE::VideoSessionCreateFlagsKHR flags_ = {}, - const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pVideoProfile_ = {}, - VULKAN_HPP_NAMESPACE::Format pictureFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - VULKAN_HPP_NAMESPACE::Extent2D maxCodedExtent_ = {}, - VULKAN_HPP_NAMESPACE::Format referencePicturesFormat_ = VULKAN_HPP_NAMESPACE::Format::eUndefined, - uint32_t maxReferencePicturesSlotsCount_ = {}, - uint32_t maxReferencePicturesActiveCount_ = {}, - const VULKAN_HPP_NAMESPACE::ExtensionProperties * pStdHeaderVersion_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , queueFamilyIndex( queueFamilyIndex_ ) - , flags( flags_ ) - , pVideoProfile( pVideoProfile_ ) - , pictureFormat( pictureFormat_ ) - , maxCodedExtent( maxCodedExtent_ ) - , referencePicturesFormat( referencePicturesFormat_ ) - , maxReferencePicturesSlotsCount( maxReferencePicturesSlotsCount_ ) - , maxReferencePicturesActiveCount( maxReferencePicturesActiveCount_ ) - , pStdHeaderVersion( pStdHeaderVersion_ ) - { - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR( VideoSessionCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionCreateInfoKHR( VkVideoSessionCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoSessionCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoSessionCreateInfoKHR & operator=( VideoSessionCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionCreateInfoKHR & operator=( VkVideoSessionCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setQueueFamilyIndex( uint32_t queueFamilyIndex_ ) VULKAN_HPP_NOEXCEPT - { - queueFamilyIndex = queueFamilyIndex_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::VideoSessionCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setPVideoProfile( const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pVideoProfile_ ) VULKAN_HPP_NOEXCEPT - { - pVideoProfile = pVideoProfile_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setPictureFormat( VULKAN_HPP_NAMESPACE::Format pictureFormat_ ) VULKAN_HPP_NOEXCEPT - { - pictureFormat = pictureFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setMaxCodedExtent( VULKAN_HPP_NAMESPACE::Extent2D const & maxCodedExtent_ ) VULKAN_HPP_NOEXCEPT - { - maxCodedExtent = maxCodedExtent_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setReferencePicturesFormat( VULKAN_HPP_NAMESPACE::Format referencePicturesFormat_ ) VULKAN_HPP_NOEXCEPT - { - referencePicturesFormat = referencePicturesFormat_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setMaxReferencePicturesSlotsCount( uint32_t maxReferencePicturesSlotsCount_ ) VULKAN_HPP_NOEXCEPT - { - maxReferencePicturesSlotsCount = maxReferencePicturesSlotsCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & setMaxReferencePicturesActiveCount( uint32_t maxReferencePicturesActiveCount_ ) VULKAN_HPP_NOEXCEPT - { - maxReferencePicturesActiveCount = maxReferencePicturesActiveCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionCreateInfoKHR & - setPStdHeaderVersion( const VULKAN_HPP_NAMESPACE::ExtensionProperties * pStdHeaderVersion_ ) VULKAN_HPP_NOEXCEPT - { - pStdHeaderVersion = pStdHeaderVersion_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoSessionCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoSessionCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, - pNext, - queueFamilyIndex, - flags, - pVideoProfile, - pictureFormat, - maxCodedExtent, - referencePicturesFormat, - maxReferencePicturesSlotsCount, - maxReferencePicturesActiveCount, - pStdHeaderVersion ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionCreateInfoKHR const & ) const = default; -# else - bool operator==( VideoSessionCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( queueFamilyIndex == rhs.queueFamilyIndex ) && ( flags == rhs.flags ) && - ( pVideoProfile == rhs.pVideoProfile ) && ( pictureFormat == rhs.pictureFormat ) && ( maxCodedExtent == rhs.maxCodedExtent ) && - ( referencePicturesFormat == rhs.referencePicturesFormat ) && ( maxReferencePicturesSlotsCount == rhs.maxReferencePicturesSlotsCount ) && - ( maxReferencePicturesActiveCount == rhs.maxReferencePicturesActiveCount ) && ( pStdHeaderVersion == rhs.pStdHeaderVersion ); -# endif - } - - bool operator!=( VideoSessionCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoSessionCreateInfoKHR; - const void * pNext = {}; - uint32_t queueFamilyIndex = {}; - VULKAN_HPP_NAMESPACE::VideoSessionCreateFlagsKHR flags = {}; - const VULKAN_HPP_NAMESPACE::VideoProfileInfoKHR * pVideoProfile = {}; - VULKAN_HPP_NAMESPACE::Format pictureFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - VULKAN_HPP_NAMESPACE::Extent2D maxCodedExtent = {}; - VULKAN_HPP_NAMESPACE::Format referencePicturesFormat = VULKAN_HPP_NAMESPACE::Format::eUndefined; - uint32_t maxReferencePicturesSlotsCount = {}; - uint32_t maxReferencePicturesActiveCount = {}; - const VULKAN_HPP_NAMESPACE::ExtensionProperties * pStdHeaderVersion = {}; - }; - - template <> - struct CppType - { - using Type = VideoSessionCreateInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoSessionMemoryRequirementsKHR - { - using NativeType = VkVideoSessionMemoryRequirementsKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoSessionMemoryRequirementsKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoSessionMemoryRequirementsKHR( uint32_t memoryBindIndex_ = {}, - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements_ = {}, - void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , memoryBindIndex( memoryBindIndex_ ) - , memoryRequirements( memoryRequirements_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoSessionMemoryRequirementsKHR( VideoSessionMemoryRequirementsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionMemoryRequirementsKHR( VkVideoSessionMemoryRequirementsKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoSessionMemoryRequirementsKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoSessionMemoryRequirementsKHR & operator=( VideoSessionMemoryRequirementsKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionMemoryRequirementsKHR & operator=( VkVideoSessionMemoryRequirementsKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - - operator VkVideoSessionMemoryRequirementsKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoSessionMemoryRequirementsKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, memoryBindIndex, memoryRequirements ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionMemoryRequirementsKHR const & ) const = default; -# else - bool operator==( VideoSessionMemoryRequirementsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( memoryBindIndex == rhs.memoryBindIndex ) && ( memoryRequirements == rhs.memoryRequirements ); -# endif - } - - bool operator!=( VideoSessionMemoryRequirementsKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoSessionMemoryRequirementsKHR; - void * pNext = {}; - uint32_t memoryBindIndex = {}; - VULKAN_HPP_NAMESPACE::MemoryRequirements memoryRequirements = {}; - }; - - template <> - struct CppType - { - using Type = VideoSessionMemoryRequirementsKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoSessionParametersCreateInfoKHR - { - using NativeType = VkVideoSessionParametersCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoSessionParametersCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoSessionParametersCreateInfoKHR( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateFlagsKHR flags_ = {}, - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParametersTemplate_ = {}, - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , videoSessionParametersTemplate( videoSessionParametersTemplate_ ) - , videoSession( videoSession_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoSessionParametersCreateInfoKHR( VideoSessionParametersCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionParametersCreateInfoKHR( VkVideoSessionParametersCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoSessionParametersCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoSessionParametersCreateInfoKHR & operator=( VideoSessionParametersCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionParametersCreateInfoKHR & operator=( VkVideoSessionParametersCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersCreateInfoKHR & - setFlags( VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersCreateInfoKHR & - setVideoSessionParametersTemplate( VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParametersTemplate_ ) VULKAN_HPP_NOEXCEPT - { - videoSessionParametersTemplate = videoSessionParametersTemplate_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersCreateInfoKHR & setVideoSession( VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession_ ) VULKAN_HPP_NOEXCEPT - { - videoSession = videoSession_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoSessionParametersCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoSessionParametersCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, videoSessionParametersTemplate, videoSession ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionParametersCreateInfoKHR const & ) const = default; -# else - bool operator==( VideoSessionParametersCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && - ( videoSessionParametersTemplate == rhs.videoSessionParametersTemplate ) && ( videoSession == rhs.videoSession ); -# endif - } - - bool operator!=( VideoSessionParametersCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoSessionParametersCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::VideoSessionParametersCreateFlagsKHR flags = {}; - VULKAN_HPP_NAMESPACE::VideoSessionParametersKHR videoSessionParametersTemplate = {}; - VULKAN_HPP_NAMESPACE::VideoSessionKHR videoSession = {}; - }; - - template <> - struct CppType - { - using Type = VideoSessionParametersCreateInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - struct VideoSessionParametersUpdateInfoKHR - { - using NativeType = VkVideoSessionParametersUpdateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eVideoSessionParametersUpdateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR VideoSessionParametersUpdateInfoKHR( uint32_t updateSequenceCount_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , updateSequenceCount( updateSequenceCount_ ) - { - } - - VULKAN_HPP_CONSTEXPR VideoSessionParametersUpdateInfoKHR( VideoSessionParametersUpdateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionParametersUpdateInfoKHR( VkVideoSessionParametersUpdateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : VideoSessionParametersUpdateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - VideoSessionParametersUpdateInfoKHR & operator=( VideoSessionParametersUpdateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - VideoSessionParametersUpdateInfoKHR & operator=( VkVideoSessionParametersUpdateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersUpdateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 VideoSessionParametersUpdateInfoKHR & setUpdateSequenceCount( uint32_t updateSequenceCount_ ) VULKAN_HPP_NOEXCEPT - { - updateSequenceCount = updateSequenceCount_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkVideoSessionParametersUpdateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkVideoSessionParametersUpdateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, updateSequenceCount ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( VideoSessionParametersUpdateInfoKHR const & ) const = default; -# else - bool operator==( VideoSessionParametersUpdateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( updateSequenceCount == rhs.updateSequenceCount ); -# endif - } - - bool operator!=( VideoSessionParametersUpdateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eVideoSessionParametersUpdateInfoKHR; - const void * pNext = {}; - uint32_t updateSequenceCount = {}; - }; - - template <> - struct CppType - { - using Type = VideoSessionParametersUpdateInfoKHR; - }; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - struct WaylandSurfaceCreateInfoKHR - { - using NativeType = VkWaylandSurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWaylandSurfaceCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR WaylandSurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateFlagsKHR flags_ = {}, - struct wl_display * display_ = {}, - struct wl_surface * surface_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , display( display_ ) - , surface( surface_ ) - { - } - - VULKAN_HPP_CONSTEXPR WaylandSurfaceCreateInfoKHR( WaylandSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WaylandSurfaceCreateInfoKHR( VkWaylandSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : WaylandSurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - WaylandSurfaceCreateInfoKHR & operator=( WaylandSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WaylandSurfaceCreateInfoKHR & operator=( VkWaylandSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 WaylandSurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WaylandSurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WaylandSurfaceCreateInfoKHR & setDisplay( struct wl_display * display_ ) VULKAN_HPP_NOEXCEPT - { - display = display_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WaylandSurfaceCreateInfoKHR & setSurface( struct wl_surface * surface_ ) VULKAN_HPP_NOEXCEPT - { - surface = surface_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWaylandSurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWaylandSurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, display, surface ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( WaylandSurfaceCreateInfoKHR const & ) const = default; -# else - bool operator==( WaylandSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( display == rhs.display ) && ( surface == rhs.surface ); -# endif - } - - bool operator!=( WaylandSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWaylandSurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::WaylandSurfaceCreateFlagsKHR flags = {}; - struct wl_display * display = {}; - struct wl_surface * surface = {}; - }; - - template <> - struct CppType - { - using Type = WaylandSurfaceCreateInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct Win32KeyedMutexAcquireReleaseInfoKHR - { - using NativeType = VkWin32KeyedMutexAcquireReleaseInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Win32KeyedMutexAcquireReleaseInfoKHR( uint32_t acquireCount_ = {}, - const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs_ = {}, - const uint64_t * pAcquireKeys_ = {}, - const uint32_t * pAcquireTimeouts_ = {}, - uint32_t releaseCount_ = {}, - const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs_ = {}, - const uint64_t * pReleaseKeys_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , acquireCount( acquireCount_ ) - , pAcquireSyncs( pAcquireSyncs_ ) - , pAcquireKeys( pAcquireKeys_ ) - , pAcquireTimeouts( pAcquireTimeouts_ ) - , releaseCount( releaseCount_ ) - , pReleaseSyncs( pReleaseSyncs_ ) - , pReleaseKeys( pReleaseKeys_ ) - { - } - - VULKAN_HPP_CONSTEXPR Win32KeyedMutexAcquireReleaseInfoKHR( Win32KeyedMutexAcquireReleaseInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32KeyedMutexAcquireReleaseInfoKHR( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : Win32KeyedMutexAcquireReleaseInfoKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireSyncs_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireKeys_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireTimeouts_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseSyncs_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseKeys_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , acquireCount( static_cast( acquireSyncs_.size() ) ) - , pAcquireSyncs( acquireSyncs_.data() ) - , pAcquireKeys( acquireKeys_.data() ) - , pAcquireTimeouts( acquireTimeouts_.data() ) - , releaseCount( static_cast( releaseSyncs_.size() ) ) - , pReleaseSyncs( releaseSyncs_.data() ) - , pReleaseKeys( releaseKeys_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( acquireSyncs_.size() == acquireKeys_.size() ); - VULKAN_HPP_ASSERT( acquireSyncs_.size() == acquireTimeouts_.size() ); - VULKAN_HPP_ASSERT( acquireKeys_.size() == acquireTimeouts_.size() ); -# else - if ( acquireSyncs_.size() != acquireKeys_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoKHR::Win32KeyedMutexAcquireReleaseInfoKHR: acquireSyncs_.size() != acquireKeys_.size()" ); - } - if ( acquireSyncs_.size() != acquireTimeouts_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoKHR::Win32KeyedMutexAcquireReleaseInfoKHR: acquireSyncs_.size() != acquireTimeouts_.size()" ); - } - if ( acquireKeys_.size() != acquireTimeouts_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoKHR::Win32KeyedMutexAcquireReleaseInfoKHR: acquireKeys_.size() != acquireTimeouts_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( releaseSyncs_.size() == releaseKeys_.size() ); -# else - if ( releaseSyncs_.size() != releaseKeys_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoKHR::Win32KeyedMutexAcquireReleaseInfoKHR: releaseSyncs_.size() != releaseKeys_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Win32KeyedMutexAcquireReleaseInfoKHR & operator=( Win32KeyedMutexAcquireReleaseInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32KeyedMutexAcquireReleaseInfoKHR & operator=( VkWin32KeyedMutexAcquireReleaseInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setAcquireCount( uint32_t acquireCount_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = acquireCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & - setPAcquireSyncs( const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireSyncs = pAcquireSyncs_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR & - setAcquireSyncs( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireSyncs_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireSyncs_.size() ); - pAcquireSyncs = acquireSyncs_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setPAcquireKeys( const uint64_t * pAcquireKeys_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireKeys = pAcquireKeys_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR & - setAcquireKeys( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireKeys_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireKeys_.size() ); - pAcquireKeys = acquireKeys_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setPAcquireTimeouts( const uint32_t * pAcquireTimeouts_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireTimeouts = pAcquireTimeouts_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR & - setAcquireTimeouts( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireTimeouts_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireTimeouts_.size() ); - pAcquireTimeouts = acquireTimeouts_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setReleaseCount( uint32_t releaseCount_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = releaseCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & - setPReleaseSyncs( const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs_ ) VULKAN_HPP_NOEXCEPT - { - pReleaseSyncs = pReleaseSyncs_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR & - setReleaseSyncs( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseSyncs_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = static_cast( releaseSyncs_.size() ); - pReleaseSyncs = releaseSyncs_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoKHR & setPReleaseKeys( const uint64_t * pReleaseKeys_ ) VULKAN_HPP_NOEXCEPT - { - pReleaseKeys = pReleaseKeys_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoKHR & - setReleaseKeys( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseKeys_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = static_cast( releaseKeys_.size() ); - pReleaseKeys = releaseKeys_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWin32KeyedMutexAcquireReleaseInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWin32KeyedMutexAcquireReleaseInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, acquireCount, pAcquireSyncs, pAcquireKeys, pAcquireTimeouts, releaseCount, pReleaseSyncs, pReleaseKeys ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Win32KeyedMutexAcquireReleaseInfoKHR const & ) const = default; -# else - bool operator==( Win32KeyedMutexAcquireReleaseInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( acquireCount == rhs.acquireCount ) && ( pAcquireSyncs == rhs.pAcquireSyncs ) && - ( pAcquireKeys == rhs.pAcquireKeys ) && ( pAcquireTimeouts == rhs.pAcquireTimeouts ) && ( releaseCount == rhs.releaseCount ) && - ( pReleaseSyncs == rhs.pReleaseSyncs ) && ( pReleaseKeys == rhs.pReleaseKeys ); -# endif - } - - bool operator!=( Win32KeyedMutexAcquireReleaseInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR; - const void * pNext = {}; - uint32_t acquireCount = {}; - const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs = {}; - const uint64_t * pAcquireKeys = {}; - const uint32_t * pAcquireTimeouts = {}; - uint32_t releaseCount = {}; - const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs = {}; - const uint64_t * pReleaseKeys = {}; - }; - - template <> - struct CppType - { - using Type = Win32KeyedMutexAcquireReleaseInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct Win32KeyedMutexAcquireReleaseInfoNV - { - using NativeType = VkWin32KeyedMutexAcquireReleaseInfoNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWin32KeyedMutexAcquireReleaseInfoNV; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Win32KeyedMutexAcquireReleaseInfoNV( uint32_t acquireCount_ = {}, - const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs_ = {}, - const uint64_t * pAcquireKeys_ = {}, - const uint32_t * pAcquireTimeoutMilliseconds_ = {}, - uint32_t releaseCount_ = {}, - const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs_ = {}, - const uint64_t * pReleaseKeys_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , acquireCount( acquireCount_ ) - , pAcquireSyncs( pAcquireSyncs_ ) - , pAcquireKeys( pAcquireKeys_ ) - , pAcquireTimeoutMilliseconds( pAcquireTimeoutMilliseconds_ ) - , releaseCount( releaseCount_ ) - , pReleaseSyncs( pReleaseSyncs_ ) - , pReleaseKeys( pReleaseKeys_ ) - { - } - - VULKAN_HPP_CONSTEXPR Win32KeyedMutexAcquireReleaseInfoNV( Win32KeyedMutexAcquireReleaseInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32KeyedMutexAcquireReleaseInfoNV( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - : Win32KeyedMutexAcquireReleaseInfoNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireSyncs_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireKeys_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireTimeoutMilliseconds_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseSyncs_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseKeys_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , acquireCount( static_cast( acquireSyncs_.size() ) ) - , pAcquireSyncs( acquireSyncs_.data() ) - , pAcquireKeys( acquireKeys_.data() ) - , pAcquireTimeoutMilliseconds( acquireTimeoutMilliseconds_.data() ) - , releaseCount( static_cast( releaseSyncs_.size() ) ) - , pReleaseSyncs( releaseSyncs_.data() ) - , pReleaseKeys( releaseKeys_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( acquireSyncs_.size() == acquireKeys_.size() ); - VULKAN_HPP_ASSERT( acquireSyncs_.size() == acquireTimeoutMilliseconds_.size() ); - VULKAN_HPP_ASSERT( acquireKeys_.size() == acquireTimeoutMilliseconds_.size() ); -# else - if ( acquireSyncs_.size() != acquireKeys_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoNV::Win32KeyedMutexAcquireReleaseInfoNV: acquireSyncs_.size() != acquireKeys_.size()" ); - } - if ( acquireSyncs_.size() != acquireTimeoutMilliseconds_.size() ) - { - throw LogicError( - VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoNV::Win32KeyedMutexAcquireReleaseInfoNV: acquireSyncs_.size() != acquireTimeoutMilliseconds_.size()" ); - } - if ( acquireKeys_.size() != acquireTimeoutMilliseconds_.size() ) - { - throw LogicError( - VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoNV::Win32KeyedMutexAcquireReleaseInfoNV: acquireKeys_.size() != acquireTimeoutMilliseconds_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( releaseSyncs_.size() == releaseKeys_.size() ); -# else - if ( releaseSyncs_.size() != releaseKeys_.size() ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::Win32KeyedMutexAcquireReleaseInfoNV::Win32KeyedMutexAcquireReleaseInfoNV: releaseSyncs_.size() != releaseKeys_.size()" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Win32KeyedMutexAcquireReleaseInfoNV & operator=( Win32KeyedMutexAcquireReleaseInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32KeyedMutexAcquireReleaseInfoNV & operator=( VkWin32KeyedMutexAcquireReleaseInfoNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & setAcquireCount( uint32_t acquireCount_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = acquireCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & - setPAcquireSyncs( const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireSyncs = pAcquireSyncs_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV & - setAcquireSyncs( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireSyncs_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireSyncs_.size() ); - pAcquireSyncs = acquireSyncs_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & setPAcquireKeys( const uint64_t * pAcquireKeys_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireKeys = pAcquireKeys_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV & - setAcquireKeys( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireKeys_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireKeys_.size() ); - pAcquireKeys = acquireKeys_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & - setPAcquireTimeoutMilliseconds( const uint32_t * pAcquireTimeoutMilliseconds_ ) VULKAN_HPP_NOEXCEPT - { - pAcquireTimeoutMilliseconds = pAcquireTimeoutMilliseconds_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV & - setAcquireTimeoutMilliseconds( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & acquireTimeoutMilliseconds_ ) VULKAN_HPP_NOEXCEPT - { - acquireCount = static_cast( acquireTimeoutMilliseconds_.size() ); - pAcquireTimeoutMilliseconds = acquireTimeoutMilliseconds_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & setReleaseCount( uint32_t releaseCount_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = releaseCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & - setPReleaseSyncs( const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs_ ) VULKAN_HPP_NOEXCEPT - { - pReleaseSyncs = pReleaseSyncs_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV & - setReleaseSyncs( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseSyncs_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = static_cast( releaseSyncs_.size() ); - pReleaseSyncs = releaseSyncs_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 Win32KeyedMutexAcquireReleaseInfoNV & setPReleaseKeys( const uint64_t * pReleaseKeys_ ) VULKAN_HPP_NOEXCEPT - { - pReleaseKeys = pReleaseKeys_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - Win32KeyedMutexAcquireReleaseInfoNV & - setReleaseKeys( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & releaseKeys_ ) VULKAN_HPP_NOEXCEPT - { - releaseCount = static_cast( releaseKeys_.size() ); - pReleaseKeys = releaseKeys_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWin32KeyedMutexAcquireReleaseInfoNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWin32KeyedMutexAcquireReleaseInfoNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, acquireCount, pAcquireSyncs, pAcquireKeys, pAcquireTimeoutMilliseconds, releaseCount, pReleaseSyncs, pReleaseKeys ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Win32KeyedMutexAcquireReleaseInfoNV const & ) const = default; -# else - bool operator==( Win32KeyedMutexAcquireReleaseInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( acquireCount == rhs.acquireCount ) && ( pAcquireSyncs == rhs.pAcquireSyncs ) && - ( pAcquireKeys == rhs.pAcquireKeys ) && ( pAcquireTimeoutMilliseconds == rhs.pAcquireTimeoutMilliseconds ) && - ( releaseCount == rhs.releaseCount ) && ( pReleaseSyncs == rhs.pReleaseSyncs ) && ( pReleaseKeys == rhs.pReleaseKeys ); -# endif - } - - bool operator!=( Win32KeyedMutexAcquireReleaseInfoNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWin32KeyedMutexAcquireReleaseInfoNV; - const void * pNext = {}; - uint32_t acquireCount = {}; - const VULKAN_HPP_NAMESPACE::DeviceMemory * pAcquireSyncs = {}; - const uint64_t * pAcquireKeys = {}; - const uint32_t * pAcquireTimeoutMilliseconds = {}; - uint32_t releaseCount = {}; - const VULKAN_HPP_NAMESPACE::DeviceMemory * pReleaseSyncs = {}; - const uint64_t * pReleaseKeys = {}; - }; - - template <> - struct CppType - { - using Type = Win32KeyedMutexAcquireReleaseInfoNV; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - struct Win32SurfaceCreateInfoKHR - { - using NativeType = VkWin32SurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWin32SurfaceCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR Win32SurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateFlagsKHR flags_ = {}, - HINSTANCE hinstance_ = {}, - HWND hwnd_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , hinstance( hinstance_ ) - , hwnd( hwnd_ ) - { - } - - VULKAN_HPP_CONSTEXPR Win32SurfaceCreateInfoKHR( Win32SurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32SurfaceCreateInfoKHR( VkWin32SurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : Win32SurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - Win32SurfaceCreateInfoKHR & operator=( Win32SurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - Win32SurfaceCreateInfoKHR & operator=( VkWin32SurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 Win32SurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32SurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::Win32SurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32SurfaceCreateInfoKHR & setHinstance( HINSTANCE hinstance_ ) VULKAN_HPP_NOEXCEPT - { - hinstance = hinstance_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 Win32SurfaceCreateInfoKHR & setHwnd( HWND hwnd_ ) VULKAN_HPP_NOEXCEPT - { - hwnd = hwnd_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWin32SurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWin32SurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, hinstance, hwnd ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( Win32SurfaceCreateInfoKHR const & ) const = default; -# else - bool operator==( Win32SurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( hinstance == rhs.hinstance ) && ( hwnd == rhs.hwnd ); -# endif - } - - bool operator!=( Win32SurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -# endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWin32SurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::Win32SurfaceCreateFlagsKHR flags = {}; - HINSTANCE hinstance = {}; - HWND hwnd = {}; - }; - - template <> - struct CppType - { - using Type = Win32SurfaceCreateInfoKHR; - }; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - struct WriteDescriptorSet - { - using NativeType = VkWriteDescriptorSet; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWriteDescriptorSet; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR WriteDescriptorSet( VULKAN_HPP_NAMESPACE::DescriptorSet dstSet_ = {}, - uint32_t dstBinding_ = {}, - uint32_t dstArrayElement_ = {}, - uint32_t descriptorCount_ = {}, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler, - const VULKAN_HPP_NAMESPACE::DescriptorImageInfo * pImageInfo_ = {}, - const VULKAN_HPP_NAMESPACE::DescriptorBufferInfo * pBufferInfo_ = {}, - const VULKAN_HPP_NAMESPACE::BufferView * pTexelBufferView_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dstSet( dstSet_ ) - , dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( descriptorCount_ ) - , descriptorType( descriptorType_ ) - , pImageInfo( pImageInfo_ ) - , pBufferInfo( pBufferInfo_ ) - , pTexelBufferView( pTexelBufferView_ ) - { - } - - VULKAN_HPP_CONSTEXPR WriteDescriptorSet( WriteDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSet( VkWriteDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT : WriteDescriptorSet( *reinterpret_cast( &rhs ) ) {} - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSet( VULKAN_HPP_NAMESPACE::DescriptorSet dstSet_, - uint32_t dstBinding_, - uint32_t dstArrayElement_, - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageInfo_, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferInfo_ = {}, - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & texelBufferView_ = {}, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , dstSet( dstSet_ ) - , dstBinding( dstBinding_ ) - , dstArrayElement( dstArrayElement_ ) - , descriptorCount( static_cast( !imageInfo_.empty() ? imageInfo_.size() - : !bufferInfo_.empty() ? bufferInfo_.size() - : texelBufferView_.size() ) ) - , descriptorType( descriptorType_ ) - , pImageInfo( imageInfo_.data() ) - , pBufferInfo( bufferInfo_.data() ) - , pTexelBufferView( texelBufferView_.data() ) - { -# ifdef VULKAN_HPP_NO_EXCEPTIONS - VULKAN_HPP_ASSERT( ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) <= 1 ); -# else - if ( 1 < ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() ) ) - { - throw LogicError( VULKAN_HPP_NAMESPACE_STRING - "::WriteDescriptorSet::WriteDescriptorSet: 1 < ( !imageInfo_.empty() + !bufferInfo_.empty() + !texelBufferView_.empty() )" ); - } -# endif /*VULKAN_HPP_NO_EXCEPTIONS*/ - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - WriteDescriptorSet & operator=( WriteDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSet & operator=( VkWriteDescriptorSet const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setDstSet( VULKAN_HPP_NAMESPACE::DescriptorSet dstSet_ ) VULKAN_HPP_NOEXCEPT - { - dstSet = dstSet_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setDstBinding( uint32_t dstBinding_ ) VULKAN_HPP_NOEXCEPT - { - dstBinding = dstBinding_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setDstArrayElement( uint32_t dstArrayElement_ ) VULKAN_HPP_NOEXCEPT - { - dstArrayElement = dstArrayElement_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setDescriptorCount( uint32_t descriptorCount_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = descriptorCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setDescriptorType( VULKAN_HPP_NAMESPACE::DescriptorType descriptorType_ ) VULKAN_HPP_NOEXCEPT - { - descriptorType = descriptorType_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setPImageInfo( const VULKAN_HPP_NAMESPACE::DescriptorImageInfo * pImageInfo_ ) VULKAN_HPP_NOEXCEPT - { - pImageInfo = pImageInfo_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSet & - setImageInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & imageInfo_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = static_cast( imageInfo_.size() ); - pImageInfo = imageInfo_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setPBufferInfo( const VULKAN_HPP_NAMESPACE::DescriptorBufferInfo * pBufferInfo_ ) VULKAN_HPP_NOEXCEPT - { - pBufferInfo = pBufferInfo_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSet & - setBufferInfo( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & bufferInfo_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = static_cast( bufferInfo_.size() ); - pBufferInfo = bufferInfo_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSet & setPTexelBufferView( const VULKAN_HPP_NAMESPACE::BufferView * pTexelBufferView_ ) VULKAN_HPP_NOEXCEPT - { - pTexelBufferView = pTexelBufferView_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSet & - setTexelBufferView( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & texelBufferView_ ) VULKAN_HPP_NOEXCEPT - { - descriptorCount = static_cast( texelBufferView_.size() ); - pTexelBufferView = texelBufferView_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWriteDescriptorSet const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWriteDescriptorSet &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dstSet, dstBinding, dstArrayElement, descriptorCount, descriptorType, pImageInfo, pBufferInfo, pTexelBufferView ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( WriteDescriptorSet const & ) const = default; -#else - bool operator==( WriteDescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dstSet == rhs.dstSet ) && ( dstBinding == rhs.dstBinding ) && - ( dstArrayElement == rhs.dstArrayElement ) && ( descriptorCount == rhs.descriptorCount ) && ( descriptorType == rhs.descriptorType ) && - ( pImageInfo == rhs.pImageInfo ) && ( pBufferInfo == rhs.pBufferInfo ) && ( pTexelBufferView == rhs.pTexelBufferView ); -# endif - } - - bool operator!=( WriteDescriptorSet const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWriteDescriptorSet; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::DescriptorSet dstSet = {}; - uint32_t dstBinding = {}; - uint32_t dstArrayElement = {}; - uint32_t descriptorCount = {}; - VULKAN_HPP_NAMESPACE::DescriptorType descriptorType = VULKAN_HPP_NAMESPACE::DescriptorType::eSampler; - const VULKAN_HPP_NAMESPACE::DescriptorImageInfo * pImageInfo = {}; - const VULKAN_HPP_NAMESPACE::DescriptorBufferInfo * pBufferInfo = {}; - const VULKAN_HPP_NAMESPACE::BufferView * pTexelBufferView = {}; - }; - - template <> - struct CppType - { - using Type = WriteDescriptorSet; - }; - - struct WriteDescriptorSetAccelerationStructureKHR - { - using NativeType = VkWriteDescriptorSetAccelerationStructureKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWriteDescriptorSetAccelerationStructureKHR; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR WriteDescriptorSetAccelerationStructureKHR( uint32_t accelerationStructureCount_ = {}, - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructureCount( accelerationStructureCount_ ) - , pAccelerationStructures( pAccelerationStructures_ ) - { - } - - VULKAN_HPP_CONSTEXPR WriteDescriptorSetAccelerationStructureKHR( WriteDescriptorSetAccelerationStructureKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetAccelerationStructureKHR( VkWriteDescriptorSetAccelerationStructureKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : WriteDescriptorSetAccelerationStructureKHR( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSetAccelerationStructureKHR( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & accelerationStructures_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , accelerationStructureCount( static_cast( accelerationStructures_.size() ) ) - , pAccelerationStructures( accelerationStructures_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - WriteDescriptorSetAccelerationStructureKHR & operator=( WriteDescriptorSetAccelerationStructureKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetAccelerationStructureKHR & operator=( VkWriteDescriptorSetAccelerationStructureKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureKHR & - setAccelerationStructureCount( uint32_t accelerationStructureCount_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureCount = accelerationStructureCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureKHR & - setPAccelerationStructures( const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures_ ) VULKAN_HPP_NOEXCEPT - { - pAccelerationStructures = pAccelerationStructures_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSetAccelerationStructureKHR & setAccelerationStructures( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & accelerationStructures_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureCount = static_cast( accelerationStructures_.size() ); - pAccelerationStructures = accelerationStructures_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWriteDescriptorSetAccelerationStructureKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWriteDescriptorSetAccelerationStructureKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, accelerationStructureCount, pAccelerationStructures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( WriteDescriptorSetAccelerationStructureKHR const & ) const = default; -#else - bool operator==( WriteDescriptorSetAccelerationStructureKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructureCount == rhs.accelerationStructureCount ) && - ( pAccelerationStructures == rhs.pAccelerationStructures ); -# endif - } - - bool operator!=( WriteDescriptorSetAccelerationStructureKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWriteDescriptorSetAccelerationStructureKHR; - const void * pNext = {}; - uint32_t accelerationStructureCount = {}; - const VULKAN_HPP_NAMESPACE::AccelerationStructureKHR * pAccelerationStructures = {}; - }; - - template <> - struct CppType - { - using Type = WriteDescriptorSetAccelerationStructureKHR; - }; - - struct WriteDescriptorSetAccelerationStructureNV - { - using NativeType = VkWriteDescriptorSetAccelerationStructureNV; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWriteDescriptorSetAccelerationStructureNV; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR WriteDescriptorSetAccelerationStructureNV( uint32_t accelerationStructureCount_ = {}, - const VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructures_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , accelerationStructureCount( accelerationStructureCount_ ) - , pAccelerationStructures( pAccelerationStructures_ ) - { - } - - VULKAN_HPP_CONSTEXPR WriteDescriptorSetAccelerationStructureNV( WriteDescriptorSetAccelerationStructureNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetAccelerationStructureNV( VkWriteDescriptorSetAccelerationStructureNV const & rhs ) VULKAN_HPP_NOEXCEPT - : WriteDescriptorSetAccelerationStructureNV( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSetAccelerationStructureNV( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & accelerationStructures_, - const void * pNext_ = nullptr ) - : pNext( pNext_ ) - , accelerationStructureCount( static_cast( accelerationStructures_.size() ) ) - , pAccelerationStructures( accelerationStructures_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - WriteDescriptorSetAccelerationStructureNV & operator=( WriteDescriptorSetAccelerationStructureNV const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetAccelerationStructureNV & operator=( VkWriteDescriptorSetAccelerationStructureNV const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureNV & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureNV & - setAccelerationStructureCount( uint32_t accelerationStructureCount_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureCount = accelerationStructureCount_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetAccelerationStructureNV & - setPAccelerationStructures( const VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructures_ ) VULKAN_HPP_NOEXCEPT - { - pAccelerationStructures = pAccelerationStructures_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - WriteDescriptorSetAccelerationStructureNV & setAccelerationStructures( - VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & accelerationStructures_ ) VULKAN_HPP_NOEXCEPT - { - accelerationStructureCount = static_cast( accelerationStructures_.size() ); - pAccelerationStructures = accelerationStructures_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWriteDescriptorSetAccelerationStructureNV const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWriteDescriptorSetAccelerationStructureNV &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std:: - tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, accelerationStructureCount, pAccelerationStructures ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( WriteDescriptorSetAccelerationStructureNV const & ) const = default; -#else - bool operator==( WriteDescriptorSetAccelerationStructureNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( accelerationStructureCount == rhs.accelerationStructureCount ) && - ( pAccelerationStructures == rhs.pAccelerationStructures ); -# endif - } - - bool operator!=( WriteDescriptorSetAccelerationStructureNV const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWriteDescriptorSetAccelerationStructureNV; - const void * pNext = {}; - uint32_t accelerationStructureCount = {}; - const VULKAN_HPP_NAMESPACE::AccelerationStructureNV * pAccelerationStructures = {}; - }; - - template <> - struct CppType - { - using Type = WriteDescriptorSetAccelerationStructureNV; - }; - - struct WriteDescriptorSetInlineUniformBlock - { - using NativeType = VkWriteDescriptorSetInlineUniformBlock; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eWriteDescriptorSetInlineUniformBlock; - -#if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR - WriteDescriptorSetInlineUniformBlock( uint32_t dataSize_ = {}, const void * pData_ = {}, const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , dataSize( dataSize_ ) - , pData( pData_ ) - { - } - - VULKAN_HPP_CONSTEXPR WriteDescriptorSetInlineUniformBlock( WriteDescriptorSetInlineUniformBlock const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetInlineUniformBlock( VkWriteDescriptorSetInlineUniformBlock const & rhs ) VULKAN_HPP_NOEXCEPT - : WriteDescriptorSetInlineUniformBlock( *reinterpret_cast( &rhs ) ) - { - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - WriteDescriptorSetInlineUniformBlock( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_, const void * pNext_ = nullptr ) - : pNext( pNext_ ), dataSize( static_cast( data_.size() * sizeof( T ) ) ), pData( data_.data() ) - { - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - WriteDescriptorSetInlineUniformBlock & operator=( WriteDescriptorSetInlineUniformBlock const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - WriteDescriptorSetInlineUniformBlock & operator=( VkWriteDescriptorSetInlineUniformBlock const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -#if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetInlineUniformBlock & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetInlineUniformBlock & setDataSize( uint32_t dataSize_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = dataSize_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 WriteDescriptorSetInlineUniformBlock & setPData( const void * pData_ ) VULKAN_HPP_NOEXCEPT - { - pData = pData_; - return *this; - } - -# if !defined( VULKAN_HPP_DISABLE_ENHANCED_MODE ) - template - WriteDescriptorSetInlineUniformBlock & setData( VULKAN_HPP_NAMESPACE::ArrayProxyNoTemporaries const & data_ ) VULKAN_HPP_NOEXCEPT - { - dataSize = static_cast( data_.size() * sizeof( T ) ); - pData = data_.data(); - return *this; - } -# endif /*VULKAN_HPP_DISABLE_ENHANCED_MODE*/ -#endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkWriteDescriptorSetInlineUniformBlock const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkWriteDescriptorSetInlineUniformBlock &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -#if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, dataSize, pData ); - } -#endif - -#if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - auto operator<=>( WriteDescriptorSetInlineUniformBlock const & ) const = default; -#else - bool operator==( WriteDescriptorSetInlineUniformBlock const & rhs ) const VULKAN_HPP_NOEXCEPT - { -# if defined( VULKAN_HPP_USE_REFLECT ) - return this->reflect() == rhs.reflect(); -# else - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( dataSize == rhs.dataSize ) && ( pData == rhs.pData ); -# endif - } - - bool operator!=( WriteDescriptorSetInlineUniformBlock const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } -#endif - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eWriteDescriptorSetInlineUniformBlock; - const void * pNext = {}; - uint32_t dataSize = {}; - const void * pData = {}; - }; - - template <> - struct CppType - { - using Type = WriteDescriptorSetInlineUniformBlock; - }; - using WriteDescriptorSetInlineUniformBlockEXT = WriteDescriptorSetInlineUniformBlock; - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - struct XcbSurfaceCreateInfoKHR - { - using NativeType = VkXcbSurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eXcbSurfaceCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR XcbSurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateFlagsKHR flags_ = {}, - xcb_connection_t * connection_ = {}, - xcb_window_t window_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , connection( connection_ ) - , window( window_ ) - { - } - - VULKAN_HPP_CONSTEXPR XcbSurfaceCreateInfoKHR( XcbSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XcbSurfaceCreateInfoKHR( VkXcbSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : XcbSurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - XcbSurfaceCreateInfoKHR & operator=( XcbSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XcbSurfaceCreateInfoKHR & operator=( VkXcbSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 XcbSurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XcbSurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::XcbSurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XcbSurfaceCreateInfoKHR & setConnection( xcb_connection_t * connection_ ) VULKAN_HPP_NOEXCEPT - { - connection = connection_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XcbSurfaceCreateInfoKHR & setWindow( xcb_window_t window_ ) VULKAN_HPP_NOEXCEPT - { - window = window_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkXcbSurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkXcbSurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, connection, window ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( XcbSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = connection <=> rhs.connection; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &window, &rhs.window, sizeof( xcb_window_t ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( XcbSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( connection == rhs.connection ) && - ( memcmp( &window, &rhs.window, sizeof( xcb_window_t ) ) == 0 ); - } - - bool operator!=( XcbSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eXcbSurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::XcbSurfaceCreateFlagsKHR flags = {}; - xcb_connection_t * connection = {}; - xcb_window_t window = {}; - }; - - template <> - struct CppType - { - using Type = XcbSurfaceCreateInfoKHR; - }; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - struct XlibSurfaceCreateInfoKHR - { - using NativeType = VkXlibSurfaceCreateInfoKHR; - - static const bool allowDuplicate = false; - static VULKAN_HPP_CONST_OR_CONSTEXPR StructureType structureType = StructureType::eXlibSurfaceCreateInfoKHR; - -# if !defined( VULKAN_HPP_NO_STRUCT_CONSTRUCTORS ) - VULKAN_HPP_CONSTEXPR XlibSurfaceCreateInfoKHR( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateFlagsKHR flags_ = {}, - Display * dpy_ = {}, - Window window_ = {}, - const void * pNext_ = nullptr ) VULKAN_HPP_NOEXCEPT - : pNext( pNext_ ) - , flags( flags_ ) - , dpy( dpy_ ) - , window( window_ ) - { - } - - VULKAN_HPP_CONSTEXPR XlibSurfaceCreateInfoKHR( XlibSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XlibSurfaceCreateInfoKHR( VkXlibSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - : XlibSurfaceCreateInfoKHR( *reinterpret_cast( &rhs ) ) - { - } -# endif /*VULKAN_HPP_NO_STRUCT_CONSTRUCTORS*/ - - XlibSurfaceCreateInfoKHR & operator=( XlibSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT = default; - - XlibSurfaceCreateInfoKHR & operator=( VkXlibSurfaceCreateInfoKHR const & rhs ) VULKAN_HPP_NOEXCEPT - { - *this = *reinterpret_cast( &rhs ); - return *this; - } - -# if !defined( VULKAN_HPP_NO_STRUCT_SETTERS ) - VULKAN_HPP_CONSTEXPR_14 XlibSurfaceCreateInfoKHR & setPNext( const void * pNext_ ) VULKAN_HPP_NOEXCEPT - { - pNext = pNext_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XlibSurfaceCreateInfoKHR & setFlags( VULKAN_HPP_NAMESPACE::XlibSurfaceCreateFlagsKHR flags_ ) VULKAN_HPP_NOEXCEPT - { - flags = flags_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XlibSurfaceCreateInfoKHR & setDpy( Display * dpy_ ) VULKAN_HPP_NOEXCEPT - { - dpy = dpy_; - return *this; - } - - VULKAN_HPP_CONSTEXPR_14 XlibSurfaceCreateInfoKHR & setWindow( Window window_ ) VULKAN_HPP_NOEXCEPT - { - window = window_; - return *this; - } -# endif /*VULKAN_HPP_NO_STRUCT_SETTERS*/ - - operator VkXlibSurfaceCreateInfoKHR const &() const VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - - operator VkXlibSurfaceCreateInfoKHR &() VULKAN_HPP_NOEXCEPT - { - return *reinterpret_cast( this ); - } - -# if defined( VULKAN_HPP_USE_REFLECT ) -# if 14 <= VULKAN_HPP_CPP_VERSION - auto -# else - std::tuple -# endif - reflect() const VULKAN_HPP_NOEXCEPT - { - return std::tie( sType, pNext, flags, dpy, window ); - } -# endif - -# if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) - std::strong_ordering operator<=>( XlibSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - if ( auto cmp = sType <=> rhs.sType; cmp != 0 ) - return cmp; - if ( auto cmp = pNext <=> rhs.pNext; cmp != 0 ) - return cmp; - if ( auto cmp = flags <=> rhs.flags; cmp != 0 ) - return cmp; - if ( auto cmp = dpy <=> rhs.dpy; cmp != 0 ) - return cmp; - if ( auto cmp = memcmp( &window, &rhs.window, sizeof( Window ) ); cmp != 0 ) - return ( cmp < 0 ) ? std::strong_ordering::less : std::strong_ordering::greater; - - return std::strong_ordering::equivalent; - } -# endif - - bool operator==( XlibSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return ( sType == rhs.sType ) && ( pNext == rhs.pNext ) && ( flags == rhs.flags ) && ( dpy == rhs.dpy ) && - ( memcmp( &window, &rhs.window, sizeof( Window ) ) == 0 ); - } - - bool operator!=( XlibSurfaceCreateInfoKHR const & rhs ) const VULKAN_HPP_NOEXCEPT - { - return !operator==( rhs ); - } - - public: - VULKAN_HPP_NAMESPACE::StructureType sType = StructureType::eXlibSurfaceCreateInfoKHR; - const void * pNext = {}; - VULKAN_HPP_NAMESPACE::XlibSurfaceCreateFlagsKHR flags = {}; - Display * dpy = {}; - Window window = {}; - }; - - template <> - struct CppType - { - using Type = XlibSurfaceCreateInfoKHR; - }; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_to_string.hpp b/src/video/khronos/vulkan/vulkan_to_string.hpp deleted file mode 100644 index 9a0c69b238816..0000000000000 --- a/src/video/khronos/vulkan/vulkan_to_string.hpp +++ /dev/null @@ -1,7732 +0,0 @@ -// Copyright 2015-2022 The Khronos Group Inc. -// -// SPDX-License-Identifier: Apache-2.0 OR MIT -// - -// This header is generated from the Khronos Vulkan XML API Registry. - -#ifndef VULKAN_TO_STRING_HPP -#define VULKAN_TO_STRING_HPP - -#include - -#if __cpp_lib_format -# include // std::format -#else -# include // std::stringstream -#endif - -namespace VULKAN_HPP_NAMESPACE -{ - //========================== - //=== BITMASKs to_string === - //========================== - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_INLINE std::string to_string( FormatFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & FormatFeatureFlagBits::eSampledImage ) - result += "SampledImage | "; - if ( value & FormatFeatureFlagBits::eStorageImage ) - result += "StorageImage | "; - if ( value & FormatFeatureFlagBits::eStorageImageAtomic ) - result += "StorageImageAtomic | "; - if ( value & FormatFeatureFlagBits::eUniformTexelBuffer ) - result += "UniformTexelBuffer | "; - if ( value & FormatFeatureFlagBits::eStorageTexelBuffer ) - result += "StorageTexelBuffer | "; - if ( value & FormatFeatureFlagBits::eStorageTexelBufferAtomic ) - result += "StorageTexelBufferAtomic | "; - if ( value & FormatFeatureFlagBits::eVertexBuffer ) - result += "VertexBuffer | "; - if ( value & FormatFeatureFlagBits::eColorAttachment ) - result += "ColorAttachment | "; - if ( value & FormatFeatureFlagBits::eColorAttachmentBlend ) - result += "ColorAttachmentBlend | "; - if ( value & FormatFeatureFlagBits::eDepthStencilAttachment ) - result += "DepthStencilAttachment | "; - if ( value & FormatFeatureFlagBits::eBlitSrc ) - result += "BlitSrc | "; - if ( value & FormatFeatureFlagBits::eBlitDst ) - result += "BlitDst | "; - if ( value & FormatFeatureFlagBits::eSampledImageFilterLinear ) - result += "SampledImageFilterLinear | "; - if ( value & FormatFeatureFlagBits::eTransferSrc ) - result += "TransferSrc | "; - if ( value & FormatFeatureFlagBits::eTransferDst ) - result += "TransferDst | "; - if ( value & FormatFeatureFlagBits::eMidpointChromaSamples ) - result += "MidpointChromaSamples | "; - if ( value & FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilter ) - result += "SampledImageYcbcrConversionLinearFilter | "; - if ( value & FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilter ) - result += "SampledImageYcbcrConversionSeparateReconstructionFilter | "; - if ( value & FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicit ) - result += "SampledImageYcbcrConversionChromaReconstructionExplicit | "; - if ( value & FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable ) - result += "SampledImageYcbcrConversionChromaReconstructionExplicitForceable | "; - if ( value & FormatFeatureFlagBits::eDisjoint ) - result += "Disjoint | "; - if ( value & FormatFeatureFlagBits::eCositedChromaSamples ) - result += "CositedChromaSamples | "; - if ( value & FormatFeatureFlagBits::eSampledImageFilterMinmax ) - result += "SampledImageFilterMinmax | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & FormatFeatureFlagBits::eVideoDecodeOutputKHR ) - result += "VideoDecodeOutputKHR | "; - if ( value & FormatFeatureFlagBits::eVideoDecodeDpbKHR ) - result += "VideoDecodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & FormatFeatureFlagBits::eAccelerationStructureVertexBufferKHR ) - result += "AccelerationStructureVertexBufferKHR | "; - if ( value & FormatFeatureFlagBits::eSampledImageFilterCubicEXT ) - result += "SampledImageFilterCubicEXT | "; - if ( value & FormatFeatureFlagBits::eFragmentDensityMapEXT ) - result += "FragmentDensityMapEXT | "; - if ( value & FormatFeatureFlagBits::eFragmentShadingRateAttachmentKHR ) - result += "FragmentShadingRateAttachmentKHR | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & FormatFeatureFlagBits::eVideoEncodeInputKHR ) - result += "VideoEncodeInputKHR | "; - if ( value & FormatFeatureFlagBits::eVideoEncodeDpbKHR ) - result += "VideoEncodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageCreateFlagBits::eSparseBinding ) - result += "SparseBinding | "; - if ( value & ImageCreateFlagBits::eSparseResidency ) - result += "SparseResidency | "; - if ( value & ImageCreateFlagBits::eSparseAliased ) - result += "SparseAliased | "; - if ( value & ImageCreateFlagBits::eMutableFormat ) - result += "MutableFormat | "; - if ( value & ImageCreateFlagBits::eCubeCompatible ) - result += "CubeCompatible | "; - if ( value & ImageCreateFlagBits::eAlias ) - result += "Alias | "; - if ( value & ImageCreateFlagBits::eSplitInstanceBindRegions ) - result += "SplitInstanceBindRegions | "; - if ( value & ImageCreateFlagBits::e2DArrayCompatible ) - result += "2DArrayCompatible | "; - if ( value & ImageCreateFlagBits::eBlockTexelViewCompatible ) - result += "BlockTexelViewCompatible | "; - if ( value & ImageCreateFlagBits::eExtendedUsage ) - result += "ExtendedUsage | "; - if ( value & ImageCreateFlagBits::eProtected ) - result += "Protected | "; - if ( value & ImageCreateFlagBits::eDisjoint ) - result += "Disjoint | "; - if ( value & ImageCreateFlagBits::eCornerSampledNV ) - result += "CornerSampledNV | "; - if ( value & ImageCreateFlagBits::eSampleLocationsCompatibleDepthEXT ) - result += "SampleLocationsCompatibleDepthEXT | "; - if ( value & ImageCreateFlagBits::eSubsampledEXT ) - result += "SubsampledEXT | "; - if ( value & ImageCreateFlagBits::eMultisampledRenderToSingleSampledEXT ) - result += "MultisampledRenderToSingleSampledEXT | "; - if ( value & ImageCreateFlagBits::e2DViewCompatibleEXT ) - result += "2DViewCompatibleEXT | "; - if ( value & ImageCreateFlagBits::eFragmentDensityMapOffsetQCOM ) - result += "FragmentDensityMapOffsetQCOM | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageUsageFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageUsageFlagBits::eTransferSrc ) - result += "TransferSrc | "; - if ( value & ImageUsageFlagBits::eTransferDst ) - result += "TransferDst | "; - if ( value & ImageUsageFlagBits::eSampled ) - result += "Sampled | "; - if ( value & ImageUsageFlagBits::eStorage ) - result += "Storage | "; - if ( value & ImageUsageFlagBits::eColorAttachment ) - result += "ColorAttachment | "; - if ( value & ImageUsageFlagBits::eDepthStencilAttachment ) - result += "DepthStencilAttachment | "; - if ( value & ImageUsageFlagBits::eTransientAttachment ) - result += "TransientAttachment | "; - if ( value & ImageUsageFlagBits::eInputAttachment ) - result += "InputAttachment | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & ImageUsageFlagBits::eVideoDecodeDstKHR ) - result += "VideoDecodeDstKHR | "; - if ( value & ImageUsageFlagBits::eVideoDecodeSrcKHR ) - result += "VideoDecodeSrcKHR | "; - if ( value & ImageUsageFlagBits::eVideoDecodeDpbKHR ) - result += "VideoDecodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & ImageUsageFlagBits::eFragmentDensityMapEXT ) - result += "FragmentDensityMapEXT | "; - if ( value & ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR ) - result += "FragmentShadingRateAttachmentKHR | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & ImageUsageFlagBits::eVideoEncodeDstKHR ) - result += "VideoEncodeDstKHR | "; - if ( value & ImageUsageFlagBits::eVideoEncodeSrcKHR ) - result += "VideoEncodeSrcKHR | "; - if ( value & ImageUsageFlagBits::eVideoEncodeDpbKHR ) - result += "VideoEncodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & ImageUsageFlagBits::eAttachmentFeedbackLoopEXT ) - result += "AttachmentFeedbackLoopEXT | "; - if ( value & ImageUsageFlagBits::eInvocationMaskHUAWEI ) - result += "InvocationMaskHUAWEI | "; - if ( value & ImageUsageFlagBits::eSampleWeightQCOM ) - result += "SampleWeightQCOM | "; - if ( value & ImageUsageFlagBits::eSampleBlockMatchQCOM ) - result += "SampleBlockMatchQCOM | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( InstanceCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & InstanceCreateFlagBits::eEnumeratePortabilityKHR ) - result += "EnumeratePortabilityKHR | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( MemoryHeapFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & MemoryHeapFlagBits::eDeviceLocal ) - result += "DeviceLocal | "; - if ( value & MemoryHeapFlagBits::eMultiInstance ) - result += "MultiInstance | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( MemoryPropertyFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & MemoryPropertyFlagBits::eDeviceLocal ) - result += "DeviceLocal | "; - if ( value & MemoryPropertyFlagBits::eHostVisible ) - result += "HostVisible | "; - if ( value & MemoryPropertyFlagBits::eHostCoherent ) - result += "HostCoherent | "; - if ( value & MemoryPropertyFlagBits::eHostCached ) - result += "HostCached | "; - if ( value & MemoryPropertyFlagBits::eLazilyAllocated ) - result += "LazilyAllocated | "; - if ( value & MemoryPropertyFlagBits::eProtected ) - result += "Protected | "; - if ( value & MemoryPropertyFlagBits::eDeviceCoherentAMD ) - result += "DeviceCoherentAMD | "; - if ( value & MemoryPropertyFlagBits::eDeviceUncachedAMD ) - result += "DeviceUncachedAMD | "; - if ( value & MemoryPropertyFlagBits::eRdmaCapableNV ) - result += "RdmaCapableNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( QueueFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & QueueFlagBits::eGraphics ) - result += "Graphics | "; - if ( value & QueueFlagBits::eCompute ) - result += "Compute | "; - if ( value & QueueFlagBits::eTransfer ) - result += "Transfer | "; - if ( value & QueueFlagBits::eSparseBinding ) - result += "SparseBinding | "; - if ( value & QueueFlagBits::eProtected ) - result += "Protected | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & QueueFlagBits::eVideoDecodeKHR ) - result += "VideoDecodeKHR | "; - if ( value & QueueFlagBits::eVideoEncodeKHR ) - result += "VideoEncodeKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SampleCountFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SampleCountFlagBits::e1 ) - result += "1 | "; - if ( value & SampleCountFlagBits::e2 ) - result += "2 | "; - if ( value & SampleCountFlagBits::e4 ) - result += "4 | "; - if ( value & SampleCountFlagBits::e8 ) - result += "8 | "; - if ( value & SampleCountFlagBits::e16 ) - result += "16 | "; - if ( value & SampleCountFlagBits::e32 ) - result += "32 | "; - if ( value & SampleCountFlagBits::e64 ) - result += "64 | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DeviceCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( DeviceQueueCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DeviceQueueCreateFlagBits::eProtected ) - result += "Protected | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineStageFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineStageFlagBits::eTopOfPipe ) - result += "TopOfPipe | "; - if ( value & PipelineStageFlagBits::eDrawIndirect ) - result += "DrawIndirect | "; - if ( value & PipelineStageFlagBits::eVertexInput ) - result += "VertexInput | "; - if ( value & PipelineStageFlagBits::eVertexShader ) - result += "VertexShader | "; - if ( value & PipelineStageFlagBits::eTessellationControlShader ) - result += "TessellationControlShader | "; - if ( value & PipelineStageFlagBits::eTessellationEvaluationShader ) - result += "TessellationEvaluationShader | "; - if ( value & PipelineStageFlagBits::eGeometryShader ) - result += "GeometryShader | "; - if ( value & PipelineStageFlagBits::eFragmentShader ) - result += "FragmentShader | "; - if ( value & PipelineStageFlagBits::eEarlyFragmentTests ) - result += "EarlyFragmentTests | "; - if ( value & PipelineStageFlagBits::eLateFragmentTests ) - result += "LateFragmentTests | "; - if ( value & PipelineStageFlagBits::eColorAttachmentOutput ) - result += "ColorAttachmentOutput | "; - if ( value & PipelineStageFlagBits::eComputeShader ) - result += "ComputeShader | "; - if ( value & PipelineStageFlagBits::eTransfer ) - result += "Transfer | "; - if ( value & PipelineStageFlagBits::eBottomOfPipe ) - result += "BottomOfPipe | "; - if ( value & PipelineStageFlagBits::eHost ) - result += "Host | "; - if ( value & PipelineStageFlagBits::eAllGraphics ) - result += "AllGraphics | "; - if ( value & PipelineStageFlagBits::eAllCommands ) - result += "AllCommands | "; - if ( value & PipelineStageFlagBits::eTransformFeedbackEXT ) - result += "TransformFeedbackEXT | "; - if ( value & PipelineStageFlagBits::eConditionalRenderingEXT ) - result += "ConditionalRenderingEXT | "; - if ( value & PipelineStageFlagBits::eAccelerationStructureBuildKHR ) - result += "AccelerationStructureBuildKHR | "; - if ( value & PipelineStageFlagBits::eRayTracingShaderKHR ) - result += "RayTracingShaderKHR | "; - if ( value & PipelineStageFlagBits::eFragmentDensityProcessEXT ) - result += "FragmentDensityProcessEXT | "; - if ( value & PipelineStageFlagBits::eFragmentShadingRateAttachmentKHR ) - result += "FragmentShadingRateAttachmentKHR | "; - if ( value & PipelineStageFlagBits::eCommandPreprocessNV ) - result += "CommandPreprocessNV | "; - if ( value & PipelineStageFlagBits::eTaskShaderEXT ) - result += "TaskShaderEXT | "; - if ( value & PipelineStageFlagBits::eMeshShaderEXT ) - result += "MeshShaderEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( MemoryMapFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageAspectFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageAspectFlagBits::eColor ) - result += "Color | "; - if ( value & ImageAspectFlagBits::eDepth ) - result += "Depth | "; - if ( value & ImageAspectFlagBits::eStencil ) - result += "Stencil | "; - if ( value & ImageAspectFlagBits::eMetadata ) - result += "Metadata | "; - if ( value & ImageAspectFlagBits::ePlane0 ) - result += "Plane0 | "; - if ( value & ImageAspectFlagBits::ePlane1 ) - result += "Plane1 | "; - if ( value & ImageAspectFlagBits::ePlane2 ) - result += "Plane2 | "; - if ( value & ImageAspectFlagBits::eMemoryPlane0EXT ) - result += "MemoryPlane0EXT | "; - if ( value & ImageAspectFlagBits::eMemoryPlane1EXT ) - result += "MemoryPlane1EXT | "; - if ( value & ImageAspectFlagBits::eMemoryPlane2EXT ) - result += "MemoryPlane2EXT | "; - if ( value & ImageAspectFlagBits::eMemoryPlane3EXT ) - result += "MemoryPlane3EXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SparseImageFormatFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SparseImageFormatFlagBits::eSingleMiptail ) - result += "SingleMiptail | "; - if ( value & SparseImageFormatFlagBits::eAlignedMipSize ) - result += "AlignedMipSize | "; - if ( value & SparseImageFormatFlagBits::eNonstandardBlockSize ) - result += "NonstandardBlockSize | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SparseMemoryBindFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SparseMemoryBindFlagBits::eMetadata ) - result += "Metadata | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( FenceCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & FenceCreateFlagBits::eSignaled ) - result += "Signaled | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( EventCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & EventCreateFlagBits::eDeviceOnly ) - result += "DeviceOnly | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( QueryPipelineStatisticFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & QueryPipelineStatisticFlagBits::eInputAssemblyVertices ) - result += "InputAssemblyVertices | "; - if ( value & QueryPipelineStatisticFlagBits::eInputAssemblyPrimitives ) - result += "InputAssemblyPrimitives | "; - if ( value & QueryPipelineStatisticFlagBits::eVertexShaderInvocations ) - result += "VertexShaderInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eGeometryShaderInvocations ) - result += "GeometryShaderInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eGeometryShaderPrimitives ) - result += "GeometryShaderPrimitives | "; - if ( value & QueryPipelineStatisticFlagBits::eClippingInvocations ) - result += "ClippingInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eClippingPrimitives ) - result += "ClippingPrimitives | "; - if ( value & QueryPipelineStatisticFlagBits::eFragmentShaderInvocations ) - result += "FragmentShaderInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eTessellationControlShaderPatches ) - result += "TessellationControlShaderPatches | "; - if ( value & QueryPipelineStatisticFlagBits::eTessellationEvaluationShaderInvocations ) - result += "TessellationEvaluationShaderInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eComputeShaderInvocations ) - result += "ComputeShaderInvocations | "; - if ( value & QueryPipelineStatisticFlagBits::eTaskShaderInvocationsEXT ) - result += "TaskShaderInvocationsEXT | "; - if ( value & QueryPipelineStatisticFlagBits::eMeshShaderInvocationsEXT ) - result += "MeshShaderInvocationsEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( QueryPoolCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( QueryResultFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & QueryResultFlagBits::e64 ) - result += "64 | "; - if ( value & QueryResultFlagBits::eWait ) - result += "Wait | "; - if ( value & QueryResultFlagBits::eWithAvailability ) - result += "WithAvailability | "; - if ( value & QueryResultFlagBits::ePartial ) - result += "Partial | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & QueryResultFlagBits::eWithStatusKHR ) - result += "WithStatusKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( BufferCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & BufferCreateFlagBits::eSparseBinding ) - result += "SparseBinding | "; - if ( value & BufferCreateFlagBits::eSparseResidency ) - result += "SparseResidency | "; - if ( value & BufferCreateFlagBits::eSparseAliased ) - result += "SparseAliased | "; - if ( value & BufferCreateFlagBits::eProtected ) - result += "Protected | "; - if ( value & BufferCreateFlagBits::eDeviceAddressCaptureReplay ) - result += "DeviceAddressCaptureReplay | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( BufferUsageFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & BufferUsageFlagBits::eTransferSrc ) - result += "TransferSrc | "; - if ( value & BufferUsageFlagBits::eTransferDst ) - result += "TransferDst | "; - if ( value & BufferUsageFlagBits::eUniformTexelBuffer ) - result += "UniformTexelBuffer | "; - if ( value & BufferUsageFlagBits::eStorageTexelBuffer ) - result += "StorageTexelBuffer | "; - if ( value & BufferUsageFlagBits::eUniformBuffer ) - result += "UniformBuffer | "; - if ( value & BufferUsageFlagBits::eStorageBuffer ) - result += "StorageBuffer | "; - if ( value & BufferUsageFlagBits::eIndexBuffer ) - result += "IndexBuffer | "; - if ( value & BufferUsageFlagBits::eVertexBuffer ) - result += "VertexBuffer | "; - if ( value & BufferUsageFlagBits::eIndirectBuffer ) - result += "IndirectBuffer | "; - if ( value & BufferUsageFlagBits::eShaderDeviceAddress ) - result += "ShaderDeviceAddress | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & BufferUsageFlagBits::eVideoDecodeSrcKHR ) - result += "VideoDecodeSrcKHR | "; - if ( value & BufferUsageFlagBits::eVideoDecodeDstKHR ) - result += "VideoDecodeDstKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & BufferUsageFlagBits::eTransformFeedbackBufferEXT ) - result += "TransformFeedbackBufferEXT | "; - if ( value & BufferUsageFlagBits::eTransformFeedbackCounterBufferEXT ) - result += "TransformFeedbackCounterBufferEXT | "; - if ( value & BufferUsageFlagBits::eConditionalRenderingEXT ) - result += "ConditionalRenderingEXT | "; - if ( value & BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR ) - result += "AccelerationStructureBuildInputReadOnlyKHR | "; - if ( value & BufferUsageFlagBits::eAccelerationStructureStorageKHR ) - result += "AccelerationStructureStorageKHR | "; - if ( value & BufferUsageFlagBits::eShaderBindingTableKHR ) - result += "ShaderBindingTableKHR | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & BufferUsageFlagBits::eVideoEncodeDstKHR ) - result += "VideoEncodeDstKHR | "; - if ( value & BufferUsageFlagBits::eVideoEncodeSrcKHR ) - result += "VideoEncodeSrcKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( BufferViewCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageViewCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageViewCreateFlagBits::eFragmentDensityMapDynamicEXT ) - result += "FragmentDensityMapDynamicEXT | "; - if ( value & ImageViewCreateFlagBits::eFragmentDensityMapDeferredEXT ) - result += "FragmentDensityMapDeferredEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ShaderModuleCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCacheCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineCacheCreateFlagBits::eExternallySynchronized ) - result += "ExternallySynchronized | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ColorComponentFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ColorComponentFlagBits::eR ) - result += "R | "; - if ( value & ColorComponentFlagBits::eG ) - result += "G | "; - if ( value & ColorComponentFlagBits::eB ) - result += "B | "; - if ( value & ColorComponentFlagBits::eA ) - result += "A | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CullModeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CullModeFlagBits::eFront ) - result += "Front | "; - if ( value & CullModeFlagBits::eBack ) - result += "Back | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT ) - result += "RasterizationOrderAttachmentAccessEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineCreateFlagBits::eDisableOptimization ) - result += "DisableOptimization | "; - if ( value & PipelineCreateFlagBits::eAllowDerivatives ) - result += "AllowDerivatives | "; - if ( value & PipelineCreateFlagBits::eDerivative ) - result += "Derivative | "; - if ( value & PipelineCreateFlagBits::eViewIndexFromDeviceIndex ) - result += "ViewIndexFromDeviceIndex | "; - if ( value & PipelineCreateFlagBits::eDispatchBase ) - result += "DispatchBase | "; - if ( value & PipelineCreateFlagBits::eFailOnPipelineCompileRequired ) - result += "FailOnPipelineCompileRequired | "; - if ( value & PipelineCreateFlagBits::eEarlyReturnOnFailure ) - result += "EarlyReturnOnFailure | "; - if ( value & PipelineCreateFlagBits::eRenderingFragmentShadingRateAttachmentKHR ) - result += "RenderingFragmentShadingRateAttachmentKHR | "; - if ( value & PipelineCreateFlagBits::eRenderingFragmentDensityMapAttachmentEXT ) - result += "RenderingFragmentDensityMapAttachmentEXT | "; - if ( value & PipelineCreateFlagBits::eRayTracingNoNullAnyHitShadersKHR ) - result += "RayTracingNoNullAnyHitShadersKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingNoNullClosestHitShadersKHR ) - result += "RayTracingNoNullClosestHitShadersKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingNoNullMissShadersKHR ) - result += "RayTracingNoNullMissShadersKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingNoNullIntersectionShadersKHR ) - result += "RayTracingNoNullIntersectionShadersKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingSkipTrianglesKHR ) - result += "RayTracingSkipTrianglesKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingSkipAabbsKHR ) - result += "RayTracingSkipAabbsKHR | "; - if ( value & PipelineCreateFlagBits::eRayTracingShaderGroupHandleCaptureReplayKHR ) - result += "RayTracingShaderGroupHandleCaptureReplayKHR | "; - if ( value & PipelineCreateFlagBits::eDeferCompileNV ) - result += "DeferCompileNV | "; - if ( value & PipelineCreateFlagBits::eCaptureStatisticsKHR ) - result += "CaptureStatisticsKHR | "; - if ( value & PipelineCreateFlagBits::eCaptureInternalRepresentationsKHR ) - result += "CaptureInternalRepresentationsKHR | "; - if ( value & PipelineCreateFlagBits::eIndirectBindableNV ) - result += "IndirectBindableNV | "; - if ( value & PipelineCreateFlagBits::eLibraryKHR ) - result += "LibraryKHR | "; - if ( value & PipelineCreateFlagBits::eRetainLinkTimeOptimizationInfoEXT ) - result += "RetainLinkTimeOptimizationInfoEXT | "; - if ( value & PipelineCreateFlagBits::eLinkTimeOptimizationEXT ) - result += "LinkTimeOptimizationEXT | "; - if ( value & PipelineCreateFlagBits::eRayTracingAllowMotionNV ) - result += "RayTracingAllowMotionNV | "; - if ( value & PipelineCreateFlagBits::eColorAttachmentFeedbackLoopEXT ) - result += "ColorAttachmentFeedbackLoopEXT | "; - if ( value & PipelineCreateFlagBits::eDepthStencilAttachmentFeedbackLoopEXT ) - result += "DepthStencilAttachmentFeedbackLoopEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT ) - result += "RasterizationOrderAttachmentDepthAccessEXT | "; - if ( value & PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT ) - result += "RasterizationOrderAttachmentStencilAccessEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDynamicStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineInputAssemblyStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineLayoutCreateFlagBits::eIndependentSetsEXT ) - result += "IndependentSetsEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineMultisampleStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineShaderStageCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineShaderStageCreateFlagBits::eAllowVaryingSubgroupSize ) - result += "AllowVaryingSubgroupSize | "; - if ( value & PipelineShaderStageCreateFlagBits::eRequireFullSubgroups ) - result += "RequireFullSubgroups | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineTessellationStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineVertexInputStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineViewportStateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( ShaderStageFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ShaderStageFlagBits::eVertex ) - result += "Vertex | "; - if ( value & ShaderStageFlagBits::eTessellationControl ) - result += "TessellationControl | "; - if ( value & ShaderStageFlagBits::eTessellationEvaluation ) - result += "TessellationEvaluation | "; - if ( value & ShaderStageFlagBits::eGeometry ) - result += "Geometry | "; - if ( value & ShaderStageFlagBits::eFragment ) - result += "Fragment | "; - if ( value & ShaderStageFlagBits::eCompute ) - result += "Compute | "; - if ( value & ShaderStageFlagBits::eRaygenKHR ) - result += "RaygenKHR | "; - if ( value & ShaderStageFlagBits::eAnyHitKHR ) - result += "AnyHitKHR | "; - if ( value & ShaderStageFlagBits::eClosestHitKHR ) - result += "ClosestHitKHR | "; - if ( value & ShaderStageFlagBits::eMissKHR ) - result += "MissKHR | "; - if ( value & ShaderStageFlagBits::eIntersectionKHR ) - result += "IntersectionKHR | "; - if ( value & ShaderStageFlagBits::eCallableKHR ) - result += "CallableKHR | "; - if ( value & ShaderStageFlagBits::eTaskEXT ) - result += "TaskEXT | "; - if ( value & ShaderStageFlagBits::eMeshEXT ) - result += "MeshEXT | "; - if ( value & ShaderStageFlagBits::eSubpassShadingHUAWEI ) - result += "SubpassShadingHUAWEI | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SamplerCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SamplerCreateFlagBits::eSubsampledEXT ) - result += "SubsampledEXT | "; - if ( value & SamplerCreateFlagBits::eSubsampledCoarseReconstructionEXT ) - result += "SubsampledCoarseReconstructionEXT | "; - if ( value & SamplerCreateFlagBits::eNonSeamlessCubeMapEXT ) - result += "NonSeamlessCubeMapEXT | "; - if ( value & SamplerCreateFlagBits::eImageProcessingQCOM ) - result += "ImageProcessingQCOM | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorPoolCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DescriptorPoolCreateFlagBits::eFreeDescriptorSet ) - result += "FreeDescriptorSet | "; - if ( value & DescriptorPoolCreateFlagBits::eUpdateAfterBind ) - result += "UpdateAfterBind | "; - if ( value & DescriptorPoolCreateFlagBits::eHostOnlyVALVE ) - result += "HostOnlyVALVE | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorPoolResetFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorSetLayoutCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPool ) - result += "UpdateAfterBindPool | "; - if ( value & DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR ) - result += "PushDescriptorKHR | "; - if ( value & DescriptorSetLayoutCreateFlagBits::eHostOnlyPoolVALVE ) - result += "HostOnlyPoolVALVE | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( AccessFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & AccessFlagBits::eIndirectCommandRead ) - result += "IndirectCommandRead | "; - if ( value & AccessFlagBits::eIndexRead ) - result += "IndexRead | "; - if ( value & AccessFlagBits::eVertexAttributeRead ) - result += "VertexAttributeRead | "; - if ( value & AccessFlagBits::eUniformRead ) - result += "UniformRead | "; - if ( value & AccessFlagBits::eInputAttachmentRead ) - result += "InputAttachmentRead | "; - if ( value & AccessFlagBits::eShaderRead ) - result += "ShaderRead | "; - if ( value & AccessFlagBits::eShaderWrite ) - result += "ShaderWrite | "; - if ( value & AccessFlagBits::eColorAttachmentRead ) - result += "ColorAttachmentRead | "; - if ( value & AccessFlagBits::eColorAttachmentWrite ) - result += "ColorAttachmentWrite | "; - if ( value & AccessFlagBits::eDepthStencilAttachmentRead ) - result += "DepthStencilAttachmentRead | "; - if ( value & AccessFlagBits::eDepthStencilAttachmentWrite ) - result += "DepthStencilAttachmentWrite | "; - if ( value & AccessFlagBits::eTransferRead ) - result += "TransferRead | "; - if ( value & AccessFlagBits::eTransferWrite ) - result += "TransferWrite | "; - if ( value & AccessFlagBits::eHostRead ) - result += "HostRead | "; - if ( value & AccessFlagBits::eHostWrite ) - result += "HostWrite | "; - if ( value & AccessFlagBits::eMemoryRead ) - result += "MemoryRead | "; - if ( value & AccessFlagBits::eMemoryWrite ) - result += "MemoryWrite | "; - if ( value & AccessFlagBits::eTransformFeedbackWriteEXT ) - result += "TransformFeedbackWriteEXT | "; - if ( value & AccessFlagBits::eTransformFeedbackCounterReadEXT ) - result += "TransformFeedbackCounterReadEXT | "; - if ( value & AccessFlagBits::eTransformFeedbackCounterWriteEXT ) - result += "TransformFeedbackCounterWriteEXT | "; - if ( value & AccessFlagBits::eConditionalRenderingReadEXT ) - result += "ConditionalRenderingReadEXT | "; - if ( value & AccessFlagBits::eColorAttachmentReadNoncoherentEXT ) - result += "ColorAttachmentReadNoncoherentEXT | "; - if ( value & AccessFlagBits::eAccelerationStructureReadKHR ) - result += "AccelerationStructureReadKHR | "; - if ( value & AccessFlagBits::eAccelerationStructureWriteKHR ) - result += "AccelerationStructureWriteKHR | "; - if ( value & AccessFlagBits::eFragmentDensityMapReadEXT ) - result += "FragmentDensityMapReadEXT | "; - if ( value & AccessFlagBits::eFragmentShadingRateAttachmentReadKHR ) - result += "FragmentShadingRateAttachmentReadKHR | "; - if ( value & AccessFlagBits::eCommandPreprocessReadNV ) - result += "CommandPreprocessReadNV | "; - if ( value & AccessFlagBits::eCommandPreprocessWriteNV ) - result += "CommandPreprocessWriteNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( AttachmentDescriptionFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & AttachmentDescriptionFlagBits::eMayAlias ) - result += "MayAlias | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DependencyFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DependencyFlagBits::eByRegion ) - result += "ByRegion | "; - if ( value & DependencyFlagBits::eDeviceGroup ) - result += "DeviceGroup | "; - if ( value & DependencyFlagBits::eViewLocal ) - result += "ViewLocal | "; - if ( value & DependencyFlagBits::eFeedbackLoopEXT ) - result += "FeedbackLoopEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( FramebufferCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & FramebufferCreateFlagBits::eImageless ) - result += "Imageless | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( RenderPassCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & RenderPassCreateFlagBits::eTransformQCOM ) - result += "TransformQCOM | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SubpassDescriptionFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SubpassDescriptionFlagBits::ePerViewAttributesNVX ) - result += "PerViewAttributesNVX | "; - if ( value & SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX ) - result += "PerViewPositionXOnlyNVX | "; - if ( value & SubpassDescriptionFlagBits::eFragmentRegionQCOM ) - result += "FragmentRegionQCOM | "; - if ( value & SubpassDescriptionFlagBits::eShaderResolveQCOM ) - result += "ShaderResolveQCOM | "; - if ( value & SubpassDescriptionFlagBits::eRasterizationOrderAttachmentColorAccessEXT ) - result += "RasterizationOrderAttachmentColorAccessEXT | "; - if ( value & SubpassDescriptionFlagBits::eRasterizationOrderAttachmentDepthAccessEXT ) - result += "RasterizationOrderAttachmentDepthAccessEXT | "; - if ( value & SubpassDescriptionFlagBits::eRasterizationOrderAttachmentStencilAccessEXT ) - result += "RasterizationOrderAttachmentStencilAccessEXT | "; - if ( value & SubpassDescriptionFlagBits::eEnableLegacyDitheringEXT ) - result += "EnableLegacyDitheringEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolCreateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CommandPoolCreateFlagBits::eTransient ) - result += "Transient | "; - if ( value & CommandPoolCreateFlagBits::eResetCommandBuffer ) - result += "ResetCommandBuffer | "; - if ( value & CommandPoolCreateFlagBits::eProtected ) - result += "Protected | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolResetFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CommandPoolResetFlagBits::eReleaseResources ) - result += "ReleaseResources | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CommandBufferResetFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CommandBufferResetFlagBits::eReleaseResources ) - result += "ReleaseResources | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CommandBufferUsageFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CommandBufferUsageFlagBits::eOneTimeSubmit ) - result += "OneTimeSubmit | "; - if ( value & CommandBufferUsageFlagBits::eRenderPassContinue ) - result += "RenderPassContinue | "; - if ( value & CommandBufferUsageFlagBits::eSimultaneousUse ) - result += "SimultaneousUse | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( QueryControlFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & QueryControlFlagBits::ePrecise ) - result += "Precise | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( StencilFaceFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & StencilFaceFlagBits::eFront ) - result += "Front | "; - if ( value & StencilFaceFlagBits::eBack ) - result += "Back | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_INLINE std::string to_string( SubgroupFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SubgroupFeatureFlagBits::eBasic ) - result += "Basic | "; - if ( value & SubgroupFeatureFlagBits::eVote ) - result += "Vote | "; - if ( value & SubgroupFeatureFlagBits::eArithmetic ) - result += "Arithmetic | "; - if ( value & SubgroupFeatureFlagBits::eBallot ) - result += "Ballot | "; - if ( value & SubgroupFeatureFlagBits::eShuffle ) - result += "Shuffle | "; - if ( value & SubgroupFeatureFlagBits::eShuffleRelative ) - result += "ShuffleRelative | "; - if ( value & SubgroupFeatureFlagBits::eClustered ) - result += "Clustered | "; - if ( value & SubgroupFeatureFlagBits::eQuad ) - result += "Quad | "; - if ( value & SubgroupFeatureFlagBits::ePartitionedNV ) - result += "PartitionedNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PeerMemoryFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PeerMemoryFeatureFlagBits::eCopySrc ) - result += "CopySrc | "; - if ( value & PeerMemoryFeatureFlagBits::eCopyDst ) - result += "CopyDst | "; - if ( value & PeerMemoryFeatureFlagBits::eGenericSrc ) - result += "GenericSrc | "; - if ( value & PeerMemoryFeatureFlagBits::eGenericDst ) - result += "GenericDst | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( MemoryAllocateFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & MemoryAllocateFlagBits::eDeviceMask ) - result += "DeviceMask | "; - if ( value & MemoryAllocateFlagBits::eDeviceAddress ) - result += "DeviceAddress | "; - if ( value & MemoryAllocateFlagBits::eDeviceAddressCaptureReplay ) - result += "DeviceAddressCaptureReplay | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolTrimFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorUpdateTemplateCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryHandleTypeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalMemoryHandleTypeFlagBits::eOpaqueFd ) - result += "OpaqueFd | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eOpaqueWin32 ) - result += "OpaqueWin32 | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eOpaqueWin32Kmt ) - result += "OpaqueWin32Kmt | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eD3D11Texture ) - result += "D3D11Texture | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eD3D11TextureKmt ) - result += "D3D11TextureKmt | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eD3D12Heap ) - result += "D3D12Heap | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eD3D12Resource ) - result += "D3D12Resource | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eDmaBufEXT ) - result += "DmaBufEXT | "; -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - if ( value & ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID ) - result += "AndroidHardwareBufferANDROID | "; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - if ( value & ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT ) - result += "HostAllocationEXT | "; - if ( value & ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT ) - result += "HostMappedForeignMemoryEXT | "; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - if ( value & ExternalMemoryHandleTypeFlagBits::eZirconVmoFUCHSIA ) - result += "ZirconVmoFUCHSIA | "; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - if ( value & ExternalMemoryHandleTypeFlagBits::eRdmaAddressNV ) - result += "RdmaAddressNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalMemoryFeatureFlagBits::eDedicatedOnly ) - result += "DedicatedOnly | "; - if ( value & ExternalMemoryFeatureFlagBits::eExportable ) - result += "Exportable | "; - if ( value & ExternalMemoryFeatureFlagBits::eImportable ) - result += "Importable | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalFenceHandleTypeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalFenceHandleTypeFlagBits::eOpaqueFd ) - result += "OpaqueFd | "; - if ( value & ExternalFenceHandleTypeFlagBits::eOpaqueWin32 ) - result += "OpaqueWin32 | "; - if ( value & ExternalFenceHandleTypeFlagBits::eOpaqueWin32Kmt ) - result += "OpaqueWin32Kmt | "; - if ( value & ExternalFenceHandleTypeFlagBits::eSyncFd ) - result += "SyncFd | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalFenceFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalFenceFeatureFlagBits::eExportable ) - result += "Exportable | "; - if ( value & ExternalFenceFeatureFlagBits::eImportable ) - result += "Importable | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( FenceImportFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & FenceImportFlagBits::eTemporary ) - result += "Temporary | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreImportFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SemaphoreImportFlagBits::eTemporary ) - result += "Temporary | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalSemaphoreHandleTypeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd ) - result += "OpaqueFd | "; - if ( value & ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32 ) - result += "OpaqueWin32 | "; - if ( value & ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32Kmt ) - result += "OpaqueWin32Kmt | "; - if ( value & ExternalSemaphoreHandleTypeFlagBits::eD3D12Fence ) - result += "D3D12Fence | "; - if ( value & ExternalSemaphoreHandleTypeFlagBits::eSyncFd ) - result += "SyncFd | "; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - if ( value & ExternalSemaphoreHandleTypeFlagBits::eZirconEventFUCHSIA ) - result += "ZirconEventFUCHSIA | "; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalSemaphoreFeatureFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalSemaphoreFeatureFlagBits::eExportable ) - result += "Exportable | "; - if ( value & ExternalSemaphoreFeatureFlagBits::eImportable ) - result += "Importable | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_VERSION_1_2 === - - VULKAN_HPP_INLINE std::string to_string( DescriptorBindingFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DescriptorBindingFlagBits::eUpdateAfterBind ) - result += "UpdateAfterBind | "; - if ( value & DescriptorBindingFlagBits::eUpdateUnusedWhilePending ) - result += "UpdateUnusedWhilePending | "; - if ( value & DescriptorBindingFlagBits::ePartiallyBound ) - result += "PartiallyBound | "; - if ( value & DescriptorBindingFlagBits::eVariableDescriptorCount ) - result += "VariableDescriptorCount | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ResolveModeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ResolveModeFlagBits::eSampleZero ) - result += "SampleZero | "; - if ( value & ResolveModeFlagBits::eAverage ) - result += "Average | "; - if ( value & ResolveModeFlagBits::eMin ) - result += "Min | "; - if ( value & ResolveModeFlagBits::eMax ) - result += "Max | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreWaitFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SemaphoreWaitFlagBits::eAny ) - result += "Any | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_VERSION_1_3 === - - VULKAN_HPP_INLINE std::string to_string( PipelineCreationFeedbackFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineCreationFeedbackFlagBits::eValid ) - result += "Valid | "; - if ( value & PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit ) - result += "ApplicationPipelineCacheHit | "; - if ( value & PipelineCreationFeedbackFlagBits::eBasePipelineAcceleration ) - result += "BasePipelineAcceleration | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ToolPurposeFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ToolPurposeFlagBits::eValidation ) - result += "Validation | "; - if ( value & ToolPurposeFlagBits::eProfiling ) - result += "Profiling | "; - if ( value & ToolPurposeFlagBits::eTracing ) - result += "Tracing | "; - if ( value & ToolPurposeFlagBits::eAdditionalFeatures ) - result += "AdditionalFeatures | "; - if ( value & ToolPurposeFlagBits::eModifyingFeatures ) - result += "ModifyingFeatures | "; - if ( value & ToolPurposeFlagBits::eDebugReportingEXT ) - result += "DebugReportingEXT | "; - if ( value & ToolPurposeFlagBits::eDebugMarkersEXT ) - result += "DebugMarkersEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( PrivateDataSlotCreateFlags ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineStageFlags2 value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PipelineStageFlagBits2::eTopOfPipe ) - result += "TopOfPipe | "; - if ( value & PipelineStageFlagBits2::eDrawIndirect ) - result += "DrawIndirect | "; - if ( value & PipelineStageFlagBits2::eVertexInput ) - result += "VertexInput | "; - if ( value & PipelineStageFlagBits2::eVertexShader ) - result += "VertexShader | "; - if ( value & PipelineStageFlagBits2::eTessellationControlShader ) - result += "TessellationControlShader | "; - if ( value & PipelineStageFlagBits2::eTessellationEvaluationShader ) - result += "TessellationEvaluationShader | "; - if ( value & PipelineStageFlagBits2::eGeometryShader ) - result += "GeometryShader | "; - if ( value & PipelineStageFlagBits2::eFragmentShader ) - result += "FragmentShader | "; - if ( value & PipelineStageFlagBits2::eEarlyFragmentTests ) - result += "EarlyFragmentTests | "; - if ( value & PipelineStageFlagBits2::eLateFragmentTests ) - result += "LateFragmentTests | "; - if ( value & PipelineStageFlagBits2::eColorAttachmentOutput ) - result += "ColorAttachmentOutput | "; - if ( value & PipelineStageFlagBits2::eComputeShader ) - result += "ComputeShader | "; - if ( value & PipelineStageFlagBits2::eAllTransfer ) - result += "AllTransfer | "; - if ( value & PipelineStageFlagBits2::eBottomOfPipe ) - result += "BottomOfPipe | "; - if ( value & PipelineStageFlagBits2::eHost ) - result += "Host | "; - if ( value & PipelineStageFlagBits2::eAllGraphics ) - result += "AllGraphics | "; - if ( value & PipelineStageFlagBits2::eAllCommands ) - result += "AllCommands | "; - if ( value & PipelineStageFlagBits2::eCopy ) - result += "Copy | "; - if ( value & PipelineStageFlagBits2::eResolve ) - result += "Resolve | "; - if ( value & PipelineStageFlagBits2::eBlit ) - result += "Blit | "; - if ( value & PipelineStageFlagBits2::eClear ) - result += "Clear | "; - if ( value & PipelineStageFlagBits2::eIndexInput ) - result += "IndexInput | "; - if ( value & PipelineStageFlagBits2::eVertexAttributeInput ) - result += "VertexAttributeInput | "; - if ( value & PipelineStageFlagBits2::ePreRasterizationShaders ) - result += "PreRasterizationShaders | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & PipelineStageFlagBits2::eVideoDecodeKHR ) - result += "VideoDecodeKHR | "; - if ( value & PipelineStageFlagBits2::eVideoEncodeKHR ) - result += "VideoEncodeKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & PipelineStageFlagBits2::eTransformFeedbackEXT ) - result += "TransformFeedbackEXT | "; - if ( value & PipelineStageFlagBits2::eConditionalRenderingEXT ) - result += "ConditionalRenderingEXT | "; - if ( value & PipelineStageFlagBits2::eCommandPreprocessNV ) - result += "CommandPreprocessNV | "; - if ( value & PipelineStageFlagBits2::eFragmentShadingRateAttachmentKHR ) - result += "FragmentShadingRateAttachmentKHR | "; - if ( value & PipelineStageFlagBits2::eAccelerationStructureBuildKHR ) - result += "AccelerationStructureBuildKHR | "; - if ( value & PipelineStageFlagBits2::eRayTracingShaderKHR ) - result += "RayTracingShaderKHR | "; - if ( value & PipelineStageFlagBits2::eFragmentDensityProcessEXT ) - result += "FragmentDensityProcessEXT | "; - if ( value & PipelineStageFlagBits2::eTaskShaderEXT ) - result += "TaskShaderEXT | "; - if ( value & PipelineStageFlagBits2::eMeshShaderEXT ) - result += "MeshShaderEXT | "; - if ( value & PipelineStageFlagBits2::eSubpassShadingHUAWEI ) - result += "SubpassShadingHUAWEI | "; - if ( value & PipelineStageFlagBits2::eInvocationMaskHUAWEI ) - result += "InvocationMaskHUAWEI | "; - if ( value & PipelineStageFlagBits2::eAccelerationStructureCopyKHR ) - result += "AccelerationStructureCopyKHR | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( AccessFlags2 value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & AccessFlagBits2::eIndirectCommandRead ) - result += "IndirectCommandRead | "; - if ( value & AccessFlagBits2::eIndexRead ) - result += "IndexRead | "; - if ( value & AccessFlagBits2::eVertexAttributeRead ) - result += "VertexAttributeRead | "; - if ( value & AccessFlagBits2::eUniformRead ) - result += "UniformRead | "; - if ( value & AccessFlagBits2::eInputAttachmentRead ) - result += "InputAttachmentRead | "; - if ( value & AccessFlagBits2::eShaderRead ) - result += "ShaderRead | "; - if ( value & AccessFlagBits2::eShaderWrite ) - result += "ShaderWrite | "; - if ( value & AccessFlagBits2::eColorAttachmentRead ) - result += "ColorAttachmentRead | "; - if ( value & AccessFlagBits2::eColorAttachmentWrite ) - result += "ColorAttachmentWrite | "; - if ( value & AccessFlagBits2::eDepthStencilAttachmentRead ) - result += "DepthStencilAttachmentRead | "; - if ( value & AccessFlagBits2::eDepthStencilAttachmentWrite ) - result += "DepthStencilAttachmentWrite | "; - if ( value & AccessFlagBits2::eTransferRead ) - result += "TransferRead | "; - if ( value & AccessFlagBits2::eTransferWrite ) - result += "TransferWrite | "; - if ( value & AccessFlagBits2::eHostRead ) - result += "HostRead | "; - if ( value & AccessFlagBits2::eHostWrite ) - result += "HostWrite | "; - if ( value & AccessFlagBits2::eMemoryRead ) - result += "MemoryRead | "; - if ( value & AccessFlagBits2::eMemoryWrite ) - result += "MemoryWrite | "; - if ( value & AccessFlagBits2::eShaderSampledRead ) - result += "ShaderSampledRead | "; - if ( value & AccessFlagBits2::eShaderStorageRead ) - result += "ShaderStorageRead | "; - if ( value & AccessFlagBits2::eShaderStorageWrite ) - result += "ShaderStorageWrite | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & AccessFlagBits2::eVideoDecodeReadKHR ) - result += "VideoDecodeReadKHR | "; - if ( value & AccessFlagBits2::eVideoDecodeWriteKHR ) - result += "VideoDecodeWriteKHR | "; - if ( value & AccessFlagBits2::eVideoEncodeReadKHR ) - result += "VideoEncodeReadKHR | "; - if ( value & AccessFlagBits2::eVideoEncodeWriteKHR ) - result += "VideoEncodeWriteKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & AccessFlagBits2::eTransformFeedbackWriteEXT ) - result += "TransformFeedbackWriteEXT | "; - if ( value & AccessFlagBits2::eTransformFeedbackCounterReadEXT ) - result += "TransformFeedbackCounterReadEXT | "; - if ( value & AccessFlagBits2::eTransformFeedbackCounterWriteEXT ) - result += "TransformFeedbackCounterWriteEXT | "; - if ( value & AccessFlagBits2::eConditionalRenderingReadEXT ) - result += "ConditionalRenderingReadEXT | "; - if ( value & AccessFlagBits2::eCommandPreprocessReadNV ) - result += "CommandPreprocessReadNV | "; - if ( value & AccessFlagBits2::eCommandPreprocessWriteNV ) - result += "CommandPreprocessWriteNV | "; - if ( value & AccessFlagBits2::eFragmentShadingRateAttachmentReadKHR ) - result += "FragmentShadingRateAttachmentReadKHR | "; - if ( value & AccessFlagBits2::eAccelerationStructureReadKHR ) - result += "AccelerationStructureReadKHR | "; - if ( value & AccessFlagBits2::eAccelerationStructureWriteKHR ) - result += "AccelerationStructureWriteKHR | "; - if ( value & AccessFlagBits2::eFragmentDensityMapReadEXT ) - result += "FragmentDensityMapReadEXT | "; - if ( value & AccessFlagBits2::eColorAttachmentReadNoncoherentEXT ) - result += "ColorAttachmentReadNoncoherentEXT | "; - if ( value & AccessFlagBits2::eInvocationMaskReadHUAWEI ) - result += "InvocationMaskReadHUAWEI | "; - if ( value & AccessFlagBits2::eShaderBindingTableReadKHR ) - result += "ShaderBindingTableReadKHR | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( SubmitFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SubmitFlagBits::eProtected ) - result += "Protected | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( RenderingFlags value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & RenderingFlagBits::eContentsSecondaryCommandBuffers ) - result += "ContentsSecondaryCommandBuffers | "; - if ( value & RenderingFlagBits::eSuspending ) - result += "Suspending | "; - if ( value & RenderingFlagBits::eResuming ) - result += "Resuming | "; - if ( value & RenderingFlagBits::eEnableLegacyDitheringEXT ) - result += "EnableLegacyDitheringEXT | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( FormatFeatureFlags2 value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & FormatFeatureFlagBits2::eSampledImage ) - result += "SampledImage | "; - if ( value & FormatFeatureFlagBits2::eStorageImage ) - result += "StorageImage | "; - if ( value & FormatFeatureFlagBits2::eStorageImageAtomic ) - result += "StorageImageAtomic | "; - if ( value & FormatFeatureFlagBits2::eUniformTexelBuffer ) - result += "UniformTexelBuffer | "; - if ( value & FormatFeatureFlagBits2::eStorageTexelBuffer ) - result += "StorageTexelBuffer | "; - if ( value & FormatFeatureFlagBits2::eStorageTexelBufferAtomic ) - result += "StorageTexelBufferAtomic | "; - if ( value & FormatFeatureFlagBits2::eVertexBuffer ) - result += "VertexBuffer | "; - if ( value & FormatFeatureFlagBits2::eColorAttachment ) - result += "ColorAttachment | "; - if ( value & FormatFeatureFlagBits2::eColorAttachmentBlend ) - result += "ColorAttachmentBlend | "; - if ( value & FormatFeatureFlagBits2::eDepthStencilAttachment ) - result += "DepthStencilAttachment | "; - if ( value & FormatFeatureFlagBits2::eBlitSrc ) - result += "BlitSrc | "; - if ( value & FormatFeatureFlagBits2::eBlitDst ) - result += "BlitDst | "; - if ( value & FormatFeatureFlagBits2::eSampledImageFilterLinear ) - result += "SampledImageFilterLinear | "; - if ( value & FormatFeatureFlagBits2::eSampledImageFilterCubic ) - result += "SampledImageFilterCubic | "; - if ( value & FormatFeatureFlagBits2::eTransferSrc ) - result += "TransferSrc | "; - if ( value & FormatFeatureFlagBits2::eTransferDst ) - result += "TransferDst | "; - if ( value & FormatFeatureFlagBits2::eSampledImageFilterMinmax ) - result += "SampledImageFilterMinmax | "; - if ( value & FormatFeatureFlagBits2::eMidpointChromaSamples ) - result += "MidpointChromaSamples | "; - if ( value & FormatFeatureFlagBits2::eSampledImageYcbcrConversionLinearFilter ) - result += "SampledImageYcbcrConversionLinearFilter | "; - if ( value & FormatFeatureFlagBits2::eSampledImageYcbcrConversionSeparateReconstructionFilter ) - result += "SampledImageYcbcrConversionSeparateReconstructionFilter | "; - if ( value & FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicit ) - result += "SampledImageYcbcrConversionChromaReconstructionExplicit | "; - if ( value & FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable ) - result += "SampledImageYcbcrConversionChromaReconstructionExplicitForceable | "; - if ( value & FormatFeatureFlagBits2::eDisjoint ) - result += "Disjoint | "; - if ( value & FormatFeatureFlagBits2::eCositedChromaSamples ) - result += "CositedChromaSamples | "; - if ( value & FormatFeatureFlagBits2::eStorageReadWithoutFormat ) - result += "StorageReadWithoutFormat | "; - if ( value & FormatFeatureFlagBits2::eStorageWriteWithoutFormat ) - result += "StorageWriteWithoutFormat | "; - if ( value & FormatFeatureFlagBits2::eSampledImageDepthComparison ) - result += "SampledImageDepthComparison | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & FormatFeatureFlagBits2::eVideoDecodeOutputKHR ) - result += "VideoDecodeOutputKHR | "; - if ( value & FormatFeatureFlagBits2::eVideoDecodeDpbKHR ) - result += "VideoDecodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & FormatFeatureFlagBits2::eAccelerationStructureVertexBufferKHR ) - result += "AccelerationStructureVertexBufferKHR | "; - if ( value & FormatFeatureFlagBits2::eFragmentDensityMapEXT ) - result += "FragmentDensityMapEXT | "; - if ( value & FormatFeatureFlagBits2::eFragmentShadingRateAttachmentKHR ) - result += "FragmentShadingRateAttachmentKHR | "; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & FormatFeatureFlagBits2::eVideoEncodeInputKHR ) - result += "VideoEncodeInputKHR | "; - if ( value & FormatFeatureFlagBits2::eVideoEncodeDpbKHR ) - result += "VideoEncodeDpbKHR | "; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - if ( value & FormatFeatureFlagBits2::eLinearColorAttachmentNV ) - result += "LinearColorAttachmentNV | "; - if ( value & FormatFeatureFlagBits2::eWeightImageQCOM ) - result += "WeightImageQCOM | "; - if ( value & FormatFeatureFlagBits2::eWeightSampledImageQCOM ) - result += "WeightSampledImageQCOM | "; - if ( value & FormatFeatureFlagBits2::eBlockMatchingQCOM ) - result += "BlockMatchingQCOM | "; - if ( value & FormatFeatureFlagBits2::eBoxFilterSampledQCOM ) - result += "BoxFilterSampledQCOM | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_KHR_surface === - - VULKAN_HPP_INLINE std::string to_string( CompositeAlphaFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & CompositeAlphaFlagBitsKHR::eOpaque ) - result += "Opaque | "; - if ( value & CompositeAlphaFlagBitsKHR::ePreMultiplied ) - result += "PreMultiplied | "; - if ( value & CompositeAlphaFlagBitsKHR::ePostMultiplied ) - result += "PostMultiplied | "; - if ( value & CompositeAlphaFlagBitsKHR::eInherit ) - result += "Inherit | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_KHR_swapchain === - - VULKAN_HPP_INLINE std::string to_string( SwapchainCreateFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions ) - result += "SplitInstanceBindRegions | "; - if ( value & SwapchainCreateFlagBitsKHR::eProtected ) - result += "Protected | "; - if ( value & SwapchainCreateFlagBitsKHR::eMutableFormat ) - result += "MutableFormat | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DeviceGroupPresentModeFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DeviceGroupPresentModeFlagBitsKHR::eLocal ) - result += "Local | "; - if ( value & DeviceGroupPresentModeFlagBitsKHR::eRemote ) - result += "Remote | "; - if ( value & DeviceGroupPresentModeFlagBitsKHR::eSum ) - result += "Sum | "; - if ( value & DeviceGroupPresentModeFlagBitsKHR::eLocalMultiDevice ) - result += "LocalMultiDevice | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_KHR_display === - - VULKAN_HPP_INLINE std::string to_string( DisplayModeCreateFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( DisplayPlaneAlphaFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DisplayPlaneAlphaFlagBitsKHR::eOpaque ) - result += "Opaque | "; - if ( value & DisplayPlaneAlphaFlagBitsKHR::eGlobal ) - result += "Global | "; - if ( value & DisplayPlaneAlphaFlagBitsKHR::ePerPixel ) - result += "PerPixel | "; - if ( value & DisplayPlaneAlphaFlagBitsKHR::ePerPixelPremultiplied ) - result += "PerPixelPremultiplied | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DisplaySurfaceCreateFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( SurfaceTransformFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SurfaceTransformFlagBitsKHR::eIdentity ) - result += "Identity | "; - if ( value & SurfaceTransformFlagBitsKHR::eRotate90 ) - result += "Rotate90 | "; - if ( value & SurfaceTransformFlagBitsKHR::eRotate180 ) - result += "Rotate180 | "; - if ( value & SurfaceTransformFlagBitsKHR::eRotate270 ) - result += "Rotate270 | "; - if ( value & SurfaceTransformFlagBitsKHR::eHorizontalMirror ) - result += "HorizontalMirror | "; - if ( value & SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate90 ) - result += "HorizontalMirrorRotate90 | "; - if ( value & SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate180 ) - result += "HorizontalMirrorRotate180 | "; - if ( value & SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate270 ) - result += "HorizontalMirrorRotate270 | "; - if ( value & SurfaceTransformFlagBitsKHR::eInherit ) - result += "Inherit | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VULKAN_HPP_INLINE std::string to_string( XlibSurfaceCreateFlagsKHR ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VULKAN_HPP_INLINE std::string to_string( XcbSurfaceCreateFlagsKHR ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VULKAN_HPP_INLINE std::string to_string( WaylandSurfaceCreateFlagsKHR ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - VULKAN_HPP_INLINE std::string to_string( AndroidSurfaceCreateFlagsKHR ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VULKAN_HPP_INLINE std::string to_string( Win32SurfaceCreateFlagsKHR ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - VULKAN_HPP_INLINE std::string to_string( DebugReportFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DebugReportFlagBitsEXT::eInformation ) - result += "Information | "; - if ( value & DebugReportFlagBitsEXT::eWarning ) - result += "Warning | "; - if ( value & DebugReportFlagBitsEXT::ePerformanceWarning ) - result += "PerformanceWarning | "; - if ( value & DebugReportFlagBitsEXT::eError ) - result += "Error | "; - if ( value & DebugReportFlagBitsEXT::eDebug ) - result += "Debug | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoCodecOperationFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & VideoCodecOperationFlagBitsKHR::eEncodeH264EXT ) - result += "EncodeH264EXT | "; - if ( value & VideoCodecOperationFlagBitsKHR::eEncodeH265EXT ) - result += "EncodeH265EXT | "; - if ( value & VideoCodecOperationFlagBitsKHR::eDecodeH264EXT ) - result += "DecodeH264EXT | "; - if ( value & VideoCodecOperationFlagBitsKHR::eDecodeH265EXT ) - result += "DecodeH265EXT | "; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoChromaSubsamplingFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoChromaSubsamplingFlagBitsKHR::eMonochrome ) - result += "Monochrome | "; - if ( value & VideoChromaSubsamplingFlagBitsKHR::e420 ) - result += "420 | "; - if ( value & VideoChromaSubsamplingFlagBitsKHR::e422 ) - result += "422 | "; - if ( value & VideoChromaSubsamplingFlagBitsKHR::e444 ) - result += "444 | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoComponentBitDepthFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoComponentBitDepthFlagBitsKHR::e8 ) - result += "8 | "; - if ( value & VideoComponentBitDepthFlagBitsKHR::e10 ) - result += "10 | "; - if ( value & VideoComponentBitDepthFlagBitsKHR::e12 ) - result += "12 | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoCapabilityFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoCapabilityFlagBitsKHR::eProtectedContent ) - result += "ProtectedContent | "; - if ( value & VideoCapabilityFlagBitsKHR::eSeparateReferenceImages ) - result += "SeparateReferenceImages | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoSessionCreateFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoSessionCreateFlagBitsKHR::eProtectedContent ) - result += "ProtectedContent | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoSessionParametersCreateFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoBeginCodingFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEndCodingFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoCodingControlFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoCodingControlFlagBitsKHR::eReset ) - result += "Reset | "; -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - if ( value & VideoCodingControlFlagBitsKHR::eEncodeRateControl ) - result += "EncodeRateControl | "; - if ( value & VideoCodingControlFlagBitsKHR::eEncodeRateControlLayer ) - result += "EncodeRateControlLayer | "; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeCapabilityFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputCoincide ) - result += "DpbAndOutputCoincide | "; - if ( value & VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputDistinct ) - result += "DpbAndOutputDistinct | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeUsageFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoDecodeUsageFlagBitsKHR::eTranscoding ) - result += "Transcoding | "; - if ( value & VideoDecodeUsageFlagBitsKHR::eOffline ) - result += "Offline | "; - if ( value & VideoDecodeUsageFlagBitsKHR::eStreaming ) - result += "Streaming | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeFlagsKHR ) - { - return "{}"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateStreamCreateFlagsEXT ) - { - return "{}"; - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264CapabilityFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceEnabled ) - result += "Direct8X8InferenceEnabled | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceDisabled ) - result += "Direct8X8InferenceDisabled | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eSeparateColourPlane ) - result += "SeparateColourPlane | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eQpprimeYZeroTransformBypass ) - result += "QpprimeYZeroTransformBypass | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eScalingLists ) - result += "ScalingLists | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eHrdCompliance ) - result += "HrdCompliance | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eChromaQpOffset ) - result += "ChromaQpOffset | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eSecondChromaQpOffset ) - result += "SecondChromaQpOffset | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::ePicInitQpMinus26 ) - result += "PicInitQpMinus26 | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPred ) - result += "WeightedPred | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredExplicit ) - result += "WeightedBipredExplicit | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredImplicit ) - result += "WeightedBipredImplicit | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPredNoTable ) - result += "WeightedPredNoTable | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eTransform8X8 ) - result += "Transform8X8 | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eCabac ) - result += "Cabac | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eCavlc ) - result += "Cavlc | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterDisabled ) - result += "DeblockingFilterDisabled | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterEnabled ) - result += "DeblockingFilterEnabled | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterPartial ) - result += "DeblockingFilterPartial | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDisableDirectSpatialMvPred ) - result += "DisableDirectSpatialMvPred | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eMultipleSlicePerFrame ) - result += "MultipleSlicePerFrame | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eSliceMbCount ) - result += "SliceMbCount | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eRowUnalignedSlice ) - result += "RowUnalignedSlice | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eDifferentSliceType ) - result += "DifferentSliceType | "; - if ( value & VideoEncodeH264CapabilityFlagBitsEXT::eBFrameInL1List ) - result += "BFrameInL1List | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264InputModeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH264InputModeFlagBitsEXT::eFrame ) - result += "Frame | "; - if ( value & VideoEncodeH264InputModeFlagBitsEXT::eSlice ) - result += "Slice | "; - if ( value & VideoEncodeH264InputModeFlagBitsEXT::eNonVcl ) - result += "NonVcl | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264OutputModeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH264OutputModeFlagBitsEXT::eFrame ) - result += "Frame | "; - if ( value & VideoEncodeH264OutputModeFlagBitsEXT::eSlice ) - result += "Slice | "; - if ( value & VideoEncodeH264OutputModeFlagBitsEXT::eNonVcl ) - result += "NonVcl | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265CapabilityFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eSeparateColourPlane ) - result += "SeparateColourPlane | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eScalingLists ) - result += "ScalingLists | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eSampleAdaptiveOffsetEnabled ) - result += "SampleAdaptiveOffsetEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::ePcmEnable ) - result += "PcmEnable | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eSpsTemporalMvpEnabled ) - result += "SpsTemporalMvpEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eHrdCompliance ) - result += "HrdCompliance | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eInitQpMinus26 ) - result += "InitQpMinus26 | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eLog2ParallelMergeLevelMinus2 ) - result += "Log2ParallelMergeLevelMinus2 | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eSignDataHidingEnabled ) - result += "SignDataHidingEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipEnabled ) - result += "TransformSkipEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipDisabled ) - result += "TransformSkipDisabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::ePpsSliceChromaQpOffsetsPresent ) - result += "PpsSliceChromaQpOffsetsPresent | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPred ) - result += "WeightedPred | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eWeightedBipred ) - result += "WeightedBipred | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPredNoTable ) - result += "WeightedPredNoTable | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eTransquantBypassEnabled ) - result += "TransquantBypassEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eEntropyCodingSyncEnabled ) - result += "EntropyCodingSyncEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eDeblockingFilterOverrideEnabled ) - result += "DeblockingFilterOverrideEnabled | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerFrame ) - result += "MultipleTilePerFrame | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eMultipleSlicePerTile ) - result += "MultipleSlicePerTile | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerSlice ) - result += "MultipleTilePerSlice | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eSliceSegmentCtbCount ) - result += "SliceSegmentCtbCount | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eRowUnalignedSliceSegment ) - result += "RowUnalignedSliceSegment | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eDependentSliceSegment ) - result += "DependentSliceSegment | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eDifferentSliceType ) - result += "DifferentSliceType | "; - if ( value & VideoEncodeH265CapabilityFlagBitsEXT::eBFrameInL1List ) - result += "BFrameInL1List | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265InputModeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH265InputModeFlagBitsEXT::eFrame ) - result += "Frame | "; - if ( value & VideoEncodeH265InputModeFlagBitsEXT::eSliceSegment ) - result += "SliceSegment | "; - if ( value & VideoEncodeH265InputModeFlagBitsEXT::eNonVcl ) - result += "NonVcl | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265OutputModeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH265OutputModeFlagBitsEXT::eFrame ) - result += "Frame | "; - if ( value & VideoEncodeH265OutputModeFlagBitsEXT::eSliceSegment ) - result += "SliceSegment | "; - if ( value & VideoEncodeH265OutputModeFlagBitsEXT::eNonVcl ) - result += "NonVcl | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265CtbSizeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH265CtbSizeFlagBitsEXT::e16 ) - result += "16 | "; - if ( value & VideoEncodeH265CtbSizeFlagBitsEXT::e32 ) - result += "32 | "; - if ( value & VideoEncodeH265CtbSizeFlagBitsEXT::e64 ) - result += "64 | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265TransformBlockSizeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeH265TransformBlockSizeFlagBitsEXT::e4 ) - result += "4 | "; - if ( value & VideoEncodeH265TransformBlockSizeFlagBitsEXT::e8 ) - result += "8 | "; - if ( value & VideoEncodeH265TransformBlockSizeFlagBitsEXT::e16 ) - result += "16 | "; - if ( value & VideoEncodeH265TransformBlockSizeFlagBitsEXT::e32 ) - result += "32 | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeH264PictureLayoutFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedInterleavedLines ) - result += "InterlacedInterleavedLines | "; - if ( value & VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedSeparatePlanes ) - result += "InterlacedSeparatePlanes | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - VULKAN_HPP_INLINE std::string to_string( StreamDescriptorSurfaceCreateFlagsGGP ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryHandleTypeFlagsNV value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32 ) - result += "OpaqueWin32 | "; - if ( value & ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32Kmt ) - result += "OpaqueWin32Kmt | "; - if ( value & ExternalMemoryHandleTypeFlagBitsNV::eD3D11Image ) - result += "D3D11Image | "; - if ( value & ExternalMemoryHandleTypeFlagBitsNV::eD3D11ImageKmt ) - result += "D3D11ImageKmt | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryFeatureFlagsNV value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExternalMemoryFeatureFlagBitsNV::eDedicatedOnly ) - result += "DedicatedOnly | "; - if ( value & ExternalMemoryFeatureFlagBitsNV::eExportable ) - result += "Exportable | "; - if ( value & ExternalMemoryFeatureFlagBitsNV::eImportable ) - result += "Importable | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - VULKAN_HPP_INLINE std::string to_string( ViSurfaceCreateFlagsNN ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_EXT_conditional_rendering === - - VULKAN_HPP_INLINE std::string to_string( ConditionalRenderingFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ConditionalRenderingFlagBitsEXT::eInverted ) - result += "Inverted | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_EXT_display_surface_counter === - - VULKAN_HPP_INLINE std::string to_string( SurfaceCounterFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & SurfaceCounterFlagBitsEXT::eVblank ) - result += "Vblank | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_NV_viewport_swizzle === - - VULKAN_HPP_INLINE std::string to_string( PipelineViewportSwizzleStateCreateFlagsNV ) - { - return "{}"; - } - - //=== VK_EXT_discard_rectangles === - - VULKAN_HPP_INLINE std::string to_string( PipelineDiscardRectangleStateCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_EXT_conservative_rasterization === - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationConservativeStateCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_EXT_depth_clip_enable === - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationDepthClipStateCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_KHR_performance_query === - - VULKAN_HPP_INLINE std::string to_string( PerformanceCounterDescriptionFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & PerformanceCounterDescriptionFlagBitsKHR::ePerformanceImpacting ) - result += "PerformanceImpacting | "; - if ( value & PerformanceCounterDescriptionFlagBitsKHR::eConcurrentlyImpacted ) - result += "ConcurrentlyImpacted | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( AcquireProfilingLockFlagsKHR ) - { - return "{}"; - } - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - VULKAN_HPP_INLINE std::string to_string( IOSSurfaceCreateFlagsMVK ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - VULKAN_HPP_INLINE std::string to_string( MacOSSurfaceCreateFlagsMVK ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessageSeverityFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DebugUtilsMessageSeverityFlagBitsEXT::eVerbose ) - result += "Verbose | "; - if ( value & DebugUtilsMessageSeverityFlagBitsEXT::eInfo ) - result += "Info | "; - if ( value & DebugUtilsMessageSeverityFlagBitsEXT::eWarning ) - result += "Warning | "; - if ( value & DebugUtilsMessageSeverityFlagBitsEXT::eError ) - result += "Error | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessageTypeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DebugUtilsMessageTypeFlagBitsEXT::eGeneral ) - result += "General | "; - if ( value & DebugUtilsMessageTypeFlagBitsEXT::eValidation ) - result += "Validation | "; - if ( value & DebugUtilsMessageTypeFlagBitsEXT::ePerformance ) - result += "Performance | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessengerCallbackDataFlagsEXT ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessengerCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_NV_fragment_coverage_to_color === - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageToColorStateCreateFlagsNV ) - { - return "{}"; - } - - //=== VK_KHR_acceleration_structure === - - VULKAN_HPP_INLINE std::string to_string( GeometryFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & GeometryFlagBitsKHR::eOpaque ) - result += "Opaque | "; - if ( value & GeometryFlagBitsKHR::eNoDuplicateAnyHitInvocation ) - result += "NoDuplicateAnyHitInvocation | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( GeometryInstanceFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & GeometryInstanceFlagBitsKHR::eTriangleFacingCullDisable ) - result += "TriangleFacingCullDisable | "; - if ( value & GeometryInstanceFlagBitsKHR::eTriangleFlipFacing ) - result += "TriangleFlipFacing | "; - if ( value & GeometryInstanceFlagBitsKHR::eForceOpaque ) - result += "ForceOpaque | "; - if ( value & GeometryInstanceFlagBitsKHR::eForceNoOpaque ) - result += "ForceNoOpaque | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( BuildAccelerationStructureFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & BuildAccelerationStructureFlagBitsKHR::eAllowUpdate ) - result += "AllowUpdate | "; - if ( value & BuildAccelerationStructureFlagBitsKHR::eAllowCompaction ) - result += "AllowCompaction | "; - if ( value & BuildAccelerationStructureFlagBitsKHR::ePreferFastTrace ) - result += "PreferFastTrace | "; - if ( value & BuildAccelerationStructureFlagBitsKHR::ePreferFastBuild ) - result += "PreferFastBuild | "; - if ( value & BuildAccelerationStructureFlagBitsKHR::eLowMemory ) - result += "LowMemory | "; - if ( value & BuildAccelerationStructureFlagBitsKHR::eMotionNV ) - result += "MotionNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureCreateFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & AccelerationStructureCreateFlagBitsKHR::eDeviceAddressCaptureReplay ) - result += "DeviceAddressCaptureReplay | "; - if ( value & AccelerationStructureCreateFlagBitsKHR::eMotionNV ) - result += "MotionNV | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_NV_framebuffer_mixed_samples === - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageModulationStateCreateFlagsNV ) - { - return "{}"; - } - - //=== VK_EXT_validation_cache === - - VULKAN_HPP_INLINE std::string to_string( ValidationCacheCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_AMD_pipeline_compiler_control === - - VULKAN_HPP_INLINE std::string to_string( PipelineCompilerControlFlagsAMD ) - { - return "{}"; - } - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - VULKAN_HPP_INLINE std::string to_string( ImagePipeSurfaceCreateFlagsFUCHSIA ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - VULKAN_HPP_INLINE std::string to_string( MetalSurfaceCreateFlagsEXT ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_AMD_shader_core_properties2 === - - VULKAN_HPP_INLINE std::string to_string( ShaderCorePropertiesFlagsAMD ) - { - return "{}"; - } - - //=== VK_NV_coverage_reduction_mode === - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageReductionStateCreateFlagsNV ) - { - return "{}"; - } - - //=== VK_EXT_headless_surface === - - VULKAN_HPP_INLINE std::string to_string( HeadlessSurfaceCreateFlagsEXT ) - { - return "{}"; - } - - //=== VK_NV_device_generated_commands === - - VULKAN_HPP_INLINE std::string to_string( IndirectStateFlagsNV value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & IndirectStateFlagBitsNV::eFlagFrontface ) - result += "FlagFrontface | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( IndirectCommandsLayoutUsageFlagsNV value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & IndirectCommandsLayoutUsageFlagBitsNV::eExplicitPreprocess ) - result += "ExplicitPreprocess | "; - if ( value & IndirectCommandsLayoutUsageFlagBitsNV::eIndexedSequences ) - result += "IndexedSequences | "; - if ( value & IndirectCommandsLayoutUsageFlagBitsNV::eUnorderedSequences ) - result += "UnorderedSequences | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_EXT_device_memory_report === - - VULKAN_HPP_INLINE std::string to_string( DeviceMemoryReportFlagsEXT ) - { - return "{}"; - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeCapabilityFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes ) - result += "PrecedingExternallyEncodedBytes | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeUsageFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeUsageFlagBitsKHR::eTranscoding ) - result += "Transcoding | "; - if ( value & VideoEncodeUsageFlagBitsKHR::eStreaming ) - result += "Streaming | "; - if ( value & VideoEncodeUsageFlagBitsKHR::eRecording ) - result += "Recording | "; - if ( value & VideoEncodeUsageFlagBitsKHR::eConferencing ) - result += "Conferencing | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeContentFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & VideoEncodeContentFlagBitsKHR::eCamera ) - result += "Camera | "; - if ( value & VideoEncodeContentFlagBitsKHR::eDesktop ) - result += "Desktop | "; - if ( value & VideoEncodeContentFlagBitsKHR::eRendered ) - result += "Rendered | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeRateControlFlagsKHR ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeRateControlModeFlagsKHR value ) - { - if ( !value ) - return "{}"; - - std::string result; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - - VULKAN_HPP_INLINE std::string to_string( DeviceDiagnosticsConfigFlagsNV value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderDebugInfo ) - result += "EnableShaderDebugInfo | "; - if ( value & DeviceDiagnosticsConfigFlagBitsNV::eEnableResourceTracking ) - result += "EnableResourceTracking | "; - if ( value & DeviceDiagnosticsConfigFlagBitsNV::eEnableAutomaticCheckpoints ) - result += "EnableAutomaticCheckpoints | "; - if ( value & DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderErrorReporting ) - result += "EnableShaderErrorReporting | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - VULKAN_HPP_INLINE std::string to_string( ExportMetalObjectTypeFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalDevice ) - result += "MetalDevice | "; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalCommandQueue ) - result += "MetalCommandQueue | "; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalBuffer ) - result += "MetalBuffer | "; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalTexture ) - result += "MetalTexture | "; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalIosurface ) - result += "MetalIosurface | "; - if ( value & ExportMetalObjectTypeFlagBitsEXT::eMetalSharedEvent ) - result += "MetalSharedEvent | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_graphics_pipeline_library === - - VULKAN_HPP_INLINE std::string to_string( GraphicsPipelineLibraryFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & GraphicsPipelineLibraryFlagBitsEXT::eVertexInputInterface ) - result += "VertexInputInterface | "; - if ( value & GraphicsPipelineLibraryFlagBitsEXT::ePreRasterizationShaders ) - result += "PreRasterizationShaders | "; - if ( value & GraphicsPipelineLibraryFlagBitsEXT::eFragmentShader ) - result += "FragmentShader | "; - if ( value & GraphicsPipelineLibraryFlagBitsEXT::eFragmentOutputInterface ) - result += "FragmentOutputInterface | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - //=== VK_NV_ray_tracing_motion_blur === - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMotionInfoFlagsNV ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMotionInstanceFlagsNV ) - { - return "{}"; - } - - //=== VK_EXT_image_compression_control === - - VULKAN_HPP_INLINE std::string to_string( ImageCompressionFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageCompressionFlagBitsEXT::eFixedRateDefault ) - result += "FixedRateDefault | "; - if ( value & ImageCompressionFlagBitsEXT::eFixedRateExplicit ) - result += "FixedRateExplicit | "; - if ( value & ImageCompressionFlagBitsEXT::eDisabled ) - result += "Disabled | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageCompressionFixedRateFlagsEXT value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e1Bpc ) - result += "1Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e2Bpc ) - result += "2Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e3Bpc ) - result += "3Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e4Bpc ) - result += "4Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e5Bpc ) - result += "5Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e6Bpc ) - result += "6Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e7Bpc ) - result += "7Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e8Bpc ) - result += "8Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e9Bpc ) - result += "9Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e10Bpc ) - result += "10Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e11Bpc ) - result += "11Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e12Bpc ) - result += "12Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e13Bpc ) - result += "13Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e14Bpc ) - result += "14Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e15Bpc ) - result += "15Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e16Bpc ) - result += "16Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e17Bpc ) - result += "17Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e18Bpc ) - result += "18Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e19Bpc ) - result += "19Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e20Bpc ) - result += "20Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e21Bpc ) - result += "21Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e22Bpc ) - result += "22Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e23Bpc ) - result += "23Bpc | "; - if ( value & ImageCompressionFixedRateFlagBitsEXT::e24Bpc ) - result += "24Bpc | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VULKAN_HPP_INLINE std::string to_string( DirectFBSurfaceCreateFlagsEXT ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - VULKAN_HPP_INLINE std::string to_string( ImageFormatConstraintsFlagsFUCHSIA ) - { - return "{}"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageConstraintsInfoFlagsFUCHSIA value ) - { - if ( !value ) - return "{}"; - - std::string result; - if ( value & ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadRarely ) - result += "CpuReadRarely | "; - if ( value & ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadOften ) - result += "CpuReadOften | "; - if ( value & ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteRarely ) - result += "CpuWriteRarely | "; - if ( value & ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteOften ) - result += "CpuWriteOften | "; - if ( value & ImageConstraintsInfoFlagBitsFUCHSIA::eProtectedOptional ) - result += "ProtectedOptional | "; - - return "{ " + result.substr( 0, result.size() - 3 ) + " }"; - } -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VULKAN_HPP_INLINE std::string to_string( ScreenSurfaceCreateFlagsQNX ) - { - return "{}"; - } -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //======================= - //=== ENUMs to_string === - //======================= - - VULKAN_HPP_INLINE std::string toHexString( uint32_t value ) - { -#if __cpp_lib_format - return std::format( "{:x}", value ); -#else - std::stringstream stream; - stream << std::hex << value; - return stream.str(); -#endif - } - - //=== VK_VERSION_1_0 === - - VULKAN_HPP_INLINE std::string to_string( Result value ) - { - switch ( value ) - { - case Result::eSuccess: return "Success"; - case Result::eNotReady: return "NotReady"; - case Result::eTimeout: return "Timeout"; - case Result::eEventSet: return "EventSet"; - case Result::eEventReset: return "EventReset"; - case Result::eIncomplete: return "Incomplete"; - case Result::eErrorOutOfHostMemory: return "ErrorOutOfHostMemory"; - case Result::eErrorOutOfDeviceMemory: return "ErrorOutOfDeviceMemory"; - case Result::eErrorInitializationFailed: return "ErrorInitializationFailed"; - case Result::eErrorDeviceLost: return "ErrorDeviceLost"; - case Result::eErrorMemoryMapFailed: return "ErrorMemoryMapFailed"; - case Result::eErrorLayerNotPresent: return "ErrorLayerNotPresent"; - case Result::eErrorExtensionNotPresent: return "ErrorExtensionNotPresent"; - case Result::eErrorFeatureNotPresent: return "ErrorFeatureNotPresent"; - case Result::eErrorIncompatibleDriver: return "ErrorIncompatibleDriver"; - case Result::eErrorTooManyObjects: return "ErrorTooManyObjects"; - case Result::eErrorFormatNotSupported: return "ErrorFormatNotSupported"; - case Result::eErrorFragmentedPool: return "ErrorFragmentedPool"; - case Result::eErrorUnknown: return "ErrorUnknown"; - case Result::eErrorOutOfPoolMemory: return "ErrorOutOfPoolMemory"; - case Result::eErrorInvalidExternalHandle: return "ErrorInvalidExternalHandle"; - case Result::eErrorFragmentation: return "ErrorFragmentation"; - case Result::eErrorInvalidOpaqueCaptureAddress: return "ErrorInvalidOpaqueCaptureAddress"; - case Result::ePipelineCompileRequired: return "PipelineCompileRequired"; - case Result::eErrorSurfaceLostKHR: return "ErrorSurfaceLostKHR"; - case Result::eErrorNativeWindowInUseKHR: return "ErrorNativeWindowInUseKHR"; - case Result::eSuboptimalKHR: return "SuboptimalKHR"; - case Result::eErrorOutOfDateKHR: return "ErrorOutOfDateKHR"; - case Result::eErrorIncompatibleDisplayKHR: return "ErrorIncompatibleDisplayKHR"; - case Result::eErrorValidationFailedEXT: return "ErrorValidationFailedEXT"; - case Result::eErrorInvalidShaderNV: return "ErrorInvalidShaderNV"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case Result::eErrorImageUsageNotSupportedKHR: return "ErrorImageUsageNotSupportedKHR"; - case Result::eErrorVideoPictureLayoutNotSupportedKHR: return "ErrorVideoPictureLayoutNotSupportedKHR"; - case Result::eErrorVideoProfileOperationNotSupportedKHR: return "ErrorVideoProfileOperationNotSupportedKHR"; - case Result::eErrorVideoProfileFormatNotSupportedKHR: return "ErrorVideoProfileFormatNotSupportedKHR"; - case Result::eErrorVideoProfileCodecNotSupportedKHR: return "ErrorVideoProfileCodecNotSupportedKHR"; - case Result::eErrorVideoStdVersionNotSupportedKHR: return "ErrorVideoStdVersionNotSupportedKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case Result::eErrorInvalidDrmFormatModifierPlaneLayoutEXT: return "ErrorInvalidDrmFormatModifierPlaneLayoutEXT"; - case Result::eErrorNotPermittedKHR: return "ErrorNotPermittedKHR"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case Result::eErrorFullScreenExclusiveModeLostEXT: return "ErrorFullScreenExclusiveModeLostEXT"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case Result::eThreadIdleKHR: return "ThreadIdleKHR"; - case Result::eThreadDoneKHR: return "ThreadDoneKHR"; - case Result::eOperationDeferredKHR: return "OperationDeferredKHR"; - case Result::eOperationNotDeferredKHR: return "OperationNotDeferredKHR"; - case Result::eErrorCompressionExhaustedEXT: return "ErrorCompressionExhaustedEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( StructureType value ) - { - switch ( value ) - { - case StructureType::eApplicationInfo: return "ApplicationInfo"; - case StructureType::eInstanceCreateInfo: return "InstanceCreateInfo"; - case StructureType::eDeviceQueueCreateInfo: return "DeviceQueueCreateInfo"; - case StructureType::eDeviceCreateInfo: return "DeviceCreateInfo"; - case StructureType::eSubmitInfo: return "SubmitInfo"; - case StructureType::eMemoryAllocateInfo: return "MemoryAllocateInfo"; - case StructureType::eMappedMemoryRange: return "MappedMemoryRange"; - case StructureType::eBindSparseInfo: return "BindSparseInfo"; - case StructureType::eFenceCreateInfo: return "FenceCreateInfo"; - case StructureType::eSemaphoreCreateInfo: return "SemaphoreCreateInfo"; - case StructureType::eEventCreateInfo: return "EventCreateInfo"; - case StructureType::eQueryPoolCreateInfo: return "QueryPoolCreateInfo"; - case StructureType::eBufferCreateInfo: return "BufferCreateInfo"; - case StructureType::eBufferViewCreateInfo: return "BufferViewCreateInfo"; - case StructureType::eImageCreateInfo: return "ImageCreateInfo"; - case StructureType::eImageViewCreateInfo: return "ImageViewCreateInfo"; - case StructureType::eShaderModuleCreateInfo: return "ShaderModuleCreateInfo"; - case StructureType::ePipelineCacheCreateInfo: return "PipelineCacheCreateInfo"; - case StructureType::ePipelineShaderStageCreateInfo: return "PipelineShaderStageCreateInfo"; - case StructureType::ePipelineVertexInputStateCreateInfo: return "PipelineVertexInputStateCreateInfo"; - case StructureType::ePipelineInputAssemblyStateCreateInfo: return "PipelineInputAssemblyStateCreateInfo"; - case StructureType::ePipelineTessellationStateCreateInfo: return "PipelineTessellationStateCreateInfo"; - case StructureType::ePipelineViewportStateCreateInfo: return "PipelineViewportStateCreateInfo"; - case StructureType::ePipelineRasterizationStateCreateInfo: return "PipelineRasterizationStateCreateInfo"; - case StructureType::ePipelineMultisampleStateCreateInfo: return "PipelineMultisampleStateCreateInfo"; - case StructureType::ePipelineDepthStencilStateCreateInfo: return "PipelineDepthStencilStateCreateInfo"; - case StructureType::ePipelineColorBlendStateCreateInfo: return "PipelineColorBlendStateCreateInfo"; - case StructureType::ePipelineDynamicStateCreateInfo: return "PipelineDynamicStateCreateInfo"; - case StructureType::eGraphicsPipelineCreateInfo: return "GraphicsPipelineCreateInfo"; - case StructureType::eComputePipelineCreateInfo: return "ComputePipelineCreateInfo"; - case StructureType::ePipelineLayoutCreateInfo: return "PipelineLayoutCreateInfo"; - case StructureType::eSamplerCreateInfo: return "SamplerCreateInfo"; - case StructureType::eDescriptorSetLayoutCreateInfo: return "DescriptorSetLayoutCreateInfo"; - case StructureType::eDescriptorPoolCreateInfo: return "DescriptorPoolCreateInfo"; - case StructureType::eDescriptorSetAllocateInfo: return "DescriptorSetAllocateInfo"; - case StructureType::eWriteDescriptorSet: return "WriteDescriptorSet"; - case StructureType::eCopyDescriptorSet: return "CopyDescriptorSet"; - case StructureType::eFramebufferCreateInfo: return "FramebufferCreateInfo"; - case StructureType::eRenderPassCreateInfo: return "RenderPassCreateInfo"; - case StructureType::eCommandPoolCreateInfo: return "CommandPoolCreateInfo"; - case StructureType::eCommandBufferAllocateInfo: return "CommandBufferAllocateInfo"; - case StructureType::eCommandBufferInheritanceInfo: return "CommandBufferInheritanceInfo"; - case StructureType::eCommandBufferBeginInfo: return "CommandBufferBeginInfo"; - case StructureType::eRenderPassBeginInfo: return "RenderPassBeginInfo"; - case StructureType::eBufferMemoryBarrier: return "BufferMemoryBarrier"; - case StructureType::eImageMemoryBarrier: return "ImageMemoryBarrier"; - case StructureType::eMemoryBarrier: return "MemoryBarrier"; - case StructureType::eLoaderInstanceCreateInfo: return "LoaderInstanceCreateInfo"; - case StructureType::eLoaderDeviceCreateInfo: return "LoaderDeviceCreateInfo"; - case StructureType::ePhysicalDeviceSubgroupProperties: return "PhysicalDeviceSubgroupProperties"; - case StructureType::eBindBufferMemoryInfo: return "BindBufferMemoryInfo"; - case StructureType::eBindImageMemoryInfo: return "BindImageMemoryInfo"; - case StructureType::ePhysicalDevice16BitStorageFeatures: return "PhysicalDevice16BitStorageFeatures"; - case StructureType::eMemoryDedicatedRequirements: return "MemoryDedicatedRequirements"; - case StructureType::eMemoryDedicatedAllocateInfo: return "MemoryDedicatedAllocateInfo"; - case StructureType::eMemoryAllocateFlagsInfo: return "MemoryAllocateFlagsInfo"; - case StructureType::eDeviceGroupRenderPassBeginInfo: return "DeviceGroupRenderPassBeginInfo"; - case StructureType::eDeviceGroupCommandBufferBeginInfo: return "DeviceGroupCommandBufferBeginInfo"; - case StructureType::eDeviceGroupSubmitInfo: return "DeviceGroupSubmitInfo"; - case StructureType::eDeviceGroupBindSparseInfo: return "DeviceGroupBindSparseInfo"; - case StructureType::eBindBufferMemoryDeviceGroupInfo: return "BindBufferMemoryDeviceGroupInfo"; - case StructureType::eBindImageMemoryDeviceGroupInfo: return "BindImageMemoryDeviceGroupInfo"; - case StructureType::ePhysicalDeviceGroupProperties: return "PhysicalDeviceGroupProperties"; - case StructureType::eDeviceGroupDeviceCreateInfo: return "DeviceGroupDeviceCreateInfo"; - case StructureType::eBufferMemoryRequirementsInfo2: return "BufferMemoryRequirementsInfo2"; - case StructureType::eImageMemoryRequirementsInfo2: return "ImageMemoryRequirementsInfo2"; - case StructureType::eImageSparseMemoryRequirementsInfo2: return "ImageSparseMemoryRequirementsInfo2"; - case StructureType::eMemoryRequirements2: return "MemoryRequirements2"; - case StructureType::eSparseImageMemoryRequirements2: return "SparseImageMemoryRequirements2"; - case StructureType::ePhysicalDeviceFeatures2: return "PhysicalDeviceFeatures2"; - case StructureType::ePhysicalDeviceProperties2: return "PhysicalDeviceProperties2"; - case StructureType::eFormatProperties2: return "FormatProperties2"; - case StructureType::eImageFormatProperties2: return "ImageFormatProperties2"; - case StructureType::ePhysicalDeviceImageFormatInfo2: return "PhysicalDeviceImageFormatInfo2"; - case StructureType::eQueueFamilyProperties2: return "QueueFamilyProperties2"; - case StructureType::ePhysicalDeviceMemoryProperties2: return "PhysicalDeviceMemoryProperties2"; - case StructureType::eSparseImageFormatProperties2: return "SparseImageFormatProperties2"; - case StructureType::ePhysicalDeviceSparseImageFormatInfo2: return "PhysicalDeviceSparseImageFormatInfo2"; - case StructureType::ePhysicalDevicePointClippingProperties: return "PhysicalDevicePointClippingProperties"; - case StructureType::eRenderPassInputAttachmentAspectCreateInfo: return "RenderPassInputAttachmentAspectCreateInfo"; - case StructureType::eImageViewUsageCreateInfo: return "ImageViewUsageCreateInfo"; - case StructureType::ePipelineTessellationDomainOriginStateCreateInfo: return "PipelineTessellationDomainOriginStateCreateInfo"; - case StructureType::eRenderPassMultiviewCreateInfo: return "RenderPassMultiviewCreateInfo"; - case StructureType::ePhysicalDeviceMultiviewFeatures: return "PhysicalDeviceMultiviewFeatures"; - case StructureType::ePhysicalDeviceMultiviewProperties: return "PhysicalDeviceMultiviewProperties"; - case StructureType::ePhysicalDeviceVariablePointersFeatures: return "PhysicalDeviceVariablePointersFeatures"; - case StructureType::eProtectedSubmitInfo: return "ProtectedSubmitInfo"; - case StructureType::ePhysicalDeviceProtectedMemoryFeatures: return "PhysicalDeviceProtectedMemoryFeatures"; - case StructureType::ePhysicalDeviceProtectedMemoryProperties: return "PhysicalDeviceProtectedMemoryProperties"; - case StructureType::eDeviceQueueInfo2: return "DeviceQueueInfo2"; - case StructureType::eSamplerYcbcrConversionCreateInfo: return "SamplerYcbcrConversionCreateInfo"; - case StructureType::eSamplerYcbcrConversionInfo: return "SamplerYcbcrConversionInfo"; - case StructureType::eBindImagePlaneMemoryInfo: return "BindImagePlaneMemoryInfo"; - case StructureType::eImagePlaneMemoryRequirementsInfo: return "ImagePlaneMemoryRequirementsInfo"; - case StructureType::ePhysicalDeviceSamplerYcbcrConversionFeatures: return "PhysicalDeviceSamplerYcbcrConversionFeatures"; - case StructureType::eSamplerYcbcrConversionImageFormatProperties: return "SamplerYcbcrConversionImageFormatProperties"; - case StructureType::eDescriptorUpdateTemplateCreateInfo: return "DescriptorUpdateTemplateCreateInfo"; - case StructureType::ePhysicalDeviceExternalImageFormatInfo: return "PhysicalDeviceExternalImageFormatInfo"; - case StructureType::eExternalImageFormatProperties: return "ExternalImageFormatProperties"; - case StructureType::ePhysicalDeviceExternalBufferInfo: return "PhysicalDeviceExternalBufferInfo"; - case StructureType::eExternalBufferProperties: return "ExternalBufferProperties"; - case StructureType::ePhysicalDeviceIdProperties: return "PhysicalDeviceIdProperties"; - case StructureType::eExternalMemoryBufferCreateInfo: return "ExternalMemoryBufferCreateInfo"; - case StructureType::eExternalMemoryImageCreateInfo: return "ExternalMemoryImageCreateInfo"; - case StructureType::eExportMemoryAllocateInfo: return "ExportMemoryAllocateInfo"; - case StructureType::ePhysicalDeviceExternalFenceInfo: return "PhysicalDeviceExternalFenceInfo"; - case StructureType::eExternalFenceProperties: return "ExternalFenceProperties"; - case StructureType::eExportFenceCreateInfo: return "ExportFenceCreateInfo"; - case StructureType::eExportSemaphoreCreateInfo: return "ExportSemaphoreCreateInfo"; - case StructureType::ePhysicalDeviceExternalSemaphoreInfo: return "PhysicalDeviceExternalSemaphoreInfo"; - case StructureType::eExternalSemaphoreProperties: return "ExternalSemaphoreProperties"; - case StructureType::ePhysicalDeviceMaintenance3Properties: return "PhysicalDeviceMaintenance3Properties"; - case StructureType::eDescriptorSetLayoutSupport: return "DescriptorSetLayoutSupport"; - case StructureType::ePhysicalDeviceShaderDrawParametersFeatures: return "PhysicalDeviceShaderDrawParametersFeatures"; - case StructureType::ePhysicalDeviceVulkan11Features: return "PhysicalDeviceVulkan11Features"; - case StructureType::ePhysicalDeviceVulkan11Properties: return "PhysicalDeviceVulkan11Properties"; - case StructureType::ePhysicalDeviceVulkan12Features: return "PhysicalDeviceVulkan12Features"; - case StructureType::ePhysicalDeviceVulkan12Properties: return "PhysicalDeviceVulkan12Properties"; - case StructureType::eImageFormatListCreateInfo: return "ImageFormatListCreateInfo"; - case StructureType::eAttachmentDescription2: return "AttachmentDescription2"; - case StructureType::eAttachmentReference2: return "AttachmentReference2"; - case StructureType::eSubpassDescription2: return "SubpassDescription2"; - case StructureType::eSubpassDependency2: return "SubpassDependency2"; - case StructureType::eRenderPassCreateInfo2: return "RenderPassCreateInfo2"; - case StructureType::eSubpassBeginInfo: return "SubpassBeginInfo"; - case StructureType::eSubpassEndInfo: return "SubpassEndInfo"; - case StructureType::ePhysicalDevice8BitStorageFeatures: return "PhysicalDevice8BitStorageFeatures"; - case StructureType::ePhysicalDeviceDriverProperties: return "PhysicalDeviceDriverProperties"; - case StructureType::ePhysicalDeviceShaderAtomicInt64Features: return "PhysicalDeviceShaderAtomicInt64Features"; - case StructureType::ePhysicalDeviceShaderFloat16Int8Features: return "PhysicalDeviceShaderFloat16Int8Features"; - case StructureType::ePhysicalDeviceFloatControlsProperties: return "PhysicalDeviceFloatControlsProperties"; - case StructureType::eDescriptorSetLayoutBindingFlagsCreateInfo: return "DescriptorSetLayoutBindingFlagsCreateInfo"; - case StructureType::ePhysicalDeviceDescriptorIndexingFeatures: return "PhysicalDeviceDescriptorIndexingFeatures"; - case StructureType::ePhysicalDeviceDescriptorIndexingProperties: return "PhysicalDeviceDescriptorIndexingProperties"; - case StructureType::eDescriptorSetVariableDescriptorCountAllocateInfo: return "DescriptorSetVariableDescriptorCountAllocateInfo"; - case StructureType::eDescriptorSetVariableDescriptorCountLayoutSupport: return "DescriptorSetVariableDescriptorCountLayoutSupport"; - case StructureType::ePhysicalDeviceDepthStencilResolveProperties: return "PhysicalDeviceDepthStencilResolveProperties"; - case StructureType::eSubpassDescriptionDepthStencilResolve: return "SubpassDescriptionDepthStencilResolve"; - case StructureType::ePhysicalDeviceScalarBlockLayoutFeatures: return "PhysicalDeviceScalarBlockLayoutFeatures"; - case StructureType::eImageStencilUsageCreateInfo: return "ImageStencilUsageCreateInfo"; - case StructureType::ePhysicalDeviceSamplerFilterMinmaxProperties: return "PhysicalDeviceSamplerFilterMinmaxProperties"; - case StructureType::eSamplerReductionModeCreateInfo: return "SamplerReductionModeCreateInfo"; - case StructureType::ePhysicalDeviceVulkanMemoryModelFeatures: return "PhysicalDeviceVulkanMemoryModelFeatures"; - case StructureType::ePhysicalDeviceImagelessFramebufferFeatures: return "PhysicalDeviceImagelessFramebufferFeatures"; - case StructureType::eFramebufferAttachmentsCreateInfo: return "FramebufferAttachmentsCreateInfo"; - case StructureType::eFramebufferAttachmentImageInfo: return "FramebufferAttachmentImageInfo"; - case StructureType::eRenderPassAttachmentBeginInfo: return "RenderPassAttachmentBeginInfo"; - case StructureType::ePhysicalDeviceUniformBufferStandardLayoutFeatures: return "PhysicalDeviceUniformBufferStandardLayoutFeatures"; - case StructureType::ePhysicalDeviceShaderSubgroupExtendedTypesFeatures: return "PhysicalDeviceShaderSubgroupExtendedTypesFeatures"; - case StructureType::ePhysicalDeviceSeparateDepthStencilLayoutsFeatures: return "PhysicalDeviceSeparateDepthStencilLayoutsFeatures"; - case StructureType::eAttachmentReferenceStencilLayout: return "AttachmentReferenceStencilLayout"; - case StructureType::eAttachmentDescriptionStencilLayout: return "AttachmentDescriptionStencilLayout"; - case StructureType::ePhysicalDeviceHostQueryResetFeatures: return "PhysicalDeviceHostQueryResetFeatures"; - case StructureType::ePhysicalDeviceTimelineSemaphoreFeatures: return "PhysicalDeviceTimelineSemaphoreFeatures"; - case StructureType::ePhysicalDeviceTimelineSemaphoreProperties: return "PhysicalDeviceTimelineSemaphoreProperties"; - case StructureType::eSemaphoreTypeCreateInfo: return "SemaphoreTypeCreateInfo"; - case StructureType::eTimelineSemaphoreSubmitInfo: return "TimelineSemaphoreSubmitInfo"; - case StructureType::eSemaphoreWaitInfo: return "SemaphoreWaitInfo"; - case StructureType::eSemaphoreSignalInfo: return "SemaphoreSignalInfo"; - case StructureType::ePhysicalDeviceBufferDeviceAddressFeatures: return "PhysicalDeviceBufferDeviceAddressFeatures"; - case StructureType::eBufferDeviceAddressInfo: return "BufferDeviceAddressInfo"; - case StructureType::eBufferOpaqueCaptureAddressCreateInfo: return "BufferOpaqueCaptureAddressCreateInfo"; - case StructureType::eMemoryOpaqueCaptureAddressAllocateInfo: return "MemoryOpaqueCaptureAddressAllocateInfo"; - case StructureType::eDeviceMemoryOpaqueCaptureAddressInfo: return "DeviceMemoryOpaqueCaptureAddressInfo"; - case StructureType::ePhysicalDeviceVulkan13Features: return "PhysicalDeviceVulkan13Features"; - case StructureType::ePhysicalDeviceVulkan13Properties: return "PhysicalDeviceVulkan13Properties"; - case StructureType::ePipelineCreationFeedbackCreateInfo: return "PipelineCreationFeedbackCreateInfo"; - case StructureType::ePhysicalDeviceShaderTerminateInvocationFeatures: return "PhysicalDeviceShaderTerminateInvocationFeatures"; - case StructureType::ePhysicalDeviceToolProperties: return "PhysicalDeviceToolProperties"; - case StructureType::ePhysicalDeviceShaderDemoteToHelperInvocationFeatures: return "PhysicalDeviceShaderDemoteToHelperInvocationFeatures"; - case StructureType::ePhysicalDevicePrivateDataFeatures: return "PhysicalDevicePrivateDataFeatures"; - case StructureType::eDevicePrivateDataCreateInfo: return "DevicePrivateDataCreateInfo"; - case StructureType::ePrivateDataSlotCreateInfo: return "PrivateDataSlotCreateInfo"; - case StructureType::ePhysicalDevicePipelineCreationCacheControlFeatures: return "PhysicalDevicePipelineCreationCacheControlFeatures"; - case StructureType::eMemoryBarrier2: return "MemoryBarrier2"; - case StructureType::eBufferMemoryBarrier2: return "BufferMemoryBarrier2"; - case StructureType::eImageMemoryBarrier2: return "ImageMemoryBarrier2"; - case StructureType::eDependencyInfo: return "DependencyInfo"; - case StructureType::eSubmitInfo2: return "SubmitInfo2"; - case StructureType::eSemaphoreSubmitInfo: return "SemaphoreSubmitInfo"; - case StructureType::eCommandBufferSubmitInfo: return "CommandBufferSubmitInfo"; - case StructureType::ePhysicalDeviceSynchronization2Features: return "PhysicalDeviceSynchronization2Features"; - case StructureType::ePhysicalDeviceZeroInitializeWorkgroupMemoryFeatures: return "PhysicalDeviceZeroInitializeWorkgroupMemoryFeatures"; - case StructureType::ePhysicalDeviceImageRobustnessFeatures: return "PhysicalDeviceImageRobustnessFeatures"; - case StructureType::eCopyBufferInfo2: return "CopyBufferInfo2"; - case StructureType::eCopyImageInfo2: return "CopyImageInfo2"; - case StructureType::eCopyBufferToImageInfo2: return "CopyBufferToImageInfo2"; - case StructureType::eCopyImageToBufferInfo2: return "CopyImageToBufferInfo2"; - case StructureType::eBlitImageInfo2: return "BlitImageInfo2"; - case StructureType::eResolveImageInfo2: return "ResolveImageInfo2"; - case StructureType::eBufferCopy2: return "BufferCopy2"; - case StructureType::eImageCopy2: return "ImageCopy2"; - case StructureType::eImageBlit2: return "ImageBlit2"; - case StructureType::eBufferImageCopy2: return "BufferImageCopy2"; - case StructureType::eImageResolve2: return "ImageResolve2"; - case StructureType::ePhysicalDeviceSubgroupSizeControlProperties: return "PhysicalDeviceSubgroupSizeControlProperties"; - case StructureType::ePipelineShaderStageRequiredSubgroupSizeCreateInfo: return "PipelineShaderStageRequiredSubgroupSizeCreateInfo"; - case StructureType::ePhysicalDeviceSubgroupSizeControlFeatures: return "PhysicalDeviceSubgroupSizeControlFeatures"; - case StructureType::ePhysicalDeviceInlineUniformBlockFeatures: return "PhysicalDeviceInlineUniformBlockFeatures"; - case StructureType::ePhysicalDeviceInlineUniformBlockProperties: return "PhysicalDeviceInlineUniformBlockProperties"; - case StructureType::eWriteDescriptorSetInlineUniformBlock: return "WriteDescriptorSetInlineUniformBlock"; - case StructureType::eDescriptorPoolInlineUniformBlockCreateInfo: return "DescriptorPoolInlineUniformBlockCreateInfo"; - case StructureType::ePhysicalDeviceTextureCompressionAstcHdrFeatures: return "PhysicalDeviceTextureCompressionAstcHdrFeatures"; - case StructureType::eRenderingInfo: return "RenderingInfo"; - case StructureType::eRenderingAttachmentInfo: return "RenderingAttachmentInfo"; - case StructureType::ePipelineRenderingCreateInfo: return "PipelineRenderingCreateInfo"; - case StructureType::ePhysicalDeviceDynamicRenderingFeatures: return "PhysicalDeviceDynamicRenderingFeatures"; - case StructureType::eCommandBufferInheritanceRenderingInfo: return "CommandBufferInheritanceRenderingInfo"; - case StructureType::ePhysicalDeviceShaderIntegerDotProductFeatures: return "PhysicalDeviceShaderIntegerDotProductFeatures"; - case StructureType::ePhysicalDeviceShaderIntegerDotProductProperties: return "PhysicalDeviceShaderIntegerDotProductProperties"; - case StructureType::ePhysicalDeviceTexelBufferAlignmentProperties: return "PhysicalDeviceTexelBufferAlignmentProperties"; - case StructureType::eFormatProperties3: return "FormatProperties3"; - case StructureType::ePhysicalDeviceMaintenance4Features: return "PhysicalDeviceMaintenance4Features"; - case StructureType::ePhysicalDeviceMaintenance4Properties: return "PhysicalDeviceMaintenance4Properties"; - case StructureType::eDeviceBufferMemoryRequirements: return "DeviceBufferMemoryRequirements"; - case StructureType::eDeviceImageMemoryRequirements: return "DeviceImageMemoryRequirements"; - case StructureType::eSwapchainCreateInfoKHR: return "SwapchainCreateInfoKHR"; - case StructureType::ePresentInfoKHR: return "PresentInfoKHR"; - case StructureType::eDeviceGroupPresentCapabilitiesKHR: return "DeviceGroupPresentCapabilitiesKHR"; - case StructureType::eImageSwapchainCreateInfoKHR: return "ImageSwapchainCreateInfoKHR"; - case StructureType::eBindImageMemorySwapchainInfoKHR: return "BindImageMemorySwapchainInfoKHR"; - case StructureType::eAcquireNextImageInfoKHR: return "AcquireNextImageInfoKHR"; - case StructureType::eDeviceGroupPresentInfoKHR: return "DeviceGroupPresentInfoKHR"; - case StructureType::eDeviceGroupSwapchainCreateInfoKHR: return "DeviceGroupSwapchainCreateInfoKHR"; - case StructureType::eDisplayModeCreateInfoKHR: return "DisplayModeCreateInfoKHR"; - case StructureType::eDisplaySurfaceCreateInfoKHR: return "DisplaySurfaceCreateInfoKHR"; - case StructureType::eDisplayPresentInfoKHR: return "DisplayPresentInfoKHR"; -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - case StructureType::eXlibSurfaceCreateInfoKHR: return "XlibSurfaceCreateInfoKHR"; -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ -#if defined( VK_USE_PLATFORM_XCB_KHR ) - case StructureType::eXcbSurfaceCreateInfoKHR: return "XcbSurfaceCreateInfoKHR"; -#endif /*VK_USE_PLATFORM_XCB_KHR*/ -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - case StructureType::eWaylandSurfaceCreateInfoKHR: return "WaylandSurfaceCreateInfoKHR"; -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - case StructureType::eAndroidSurfaceCreateInfoKHR: return "AndroidSurfaceCreateInfoKHR"; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eWin32SurfaceCreateInfoKHR: return "Win32SurfaceCreateInfoKHR"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eDebugReportCallbackCreateInfoEXT: return "DebugReportCallbackCreateInfoEXT"; - case StructureType::ePipelineRasterizationStateRasterizationOrderAMD: return "PipelineRasterizationStateRasterizationOrderAMD"; - case StructureType::eDebugMarkerObjectNameInfoEXT: return "DebugMarkerObjectNameInfoEXT"; - case StructureType::eDebugMarkerObjectTagInfoEXT: return "DebugMarkerObjectTagInfoEXT"; - case StructureType::eDebugMarkerMarkerInfoEXT: return "DebugMarkerMarkerInfoEXT"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case StructureType::eVideoProfileInfoKHR: return "VideoProfileInfoKHR"; - case StructureType::eVideoCapabilitiesKHR: return "VideoCapabilitiesKHR"; - case StructureType::eVideoPictureResourceInfoKHR: return "VideoPictureResourceInfoKHR"; - case StructureType::eVideoSessionMemoryRequirementsKHR: return "VideoSessionMemoryRequirementsKHR"; - case StructureType::eBindVideoSessionMemoryInfoKHR: return "BindVideoSessionMemoryInfoKHR"; - case StructureType::eVideoSessionCreateInfoKHR: return "VideoSessionCreateInfoKHR"; - case StructureType::eVideoSessionParametersCreateInfoKHR: return "VideoSessionParametersCreateInfoKHR"; - case StructureType::eVideoSessionParametersUpdateInfoKHR: return "VideoSessionParametersUpdateInfoKHR"; - case StructureType::eVideoBeginCodingInfoKHR: return "VideoBeginCodingInfoKHR"; - case StructureType::eVideoEndCodingInfoKHR: return "VideoEndCodingInfoKHR"; - case StructureType::eVideoCodingControlInfoKHR: return "VideoCodingControlInfoKHR"; - case StructureType::eVideoReferenceSlotInfoKHR: return "VideoReferenceSlotInfoKHR"; - case StructureType::eQueueFamilyVideoPropertiesKHR: return "QueueFamilyVideoPropertiesKHR"; - case StructureType::eVideoProfileListInfoKHR: return "VideoProfileListInfoKHR"; - case StructureType::ePhysicalDeviceVideoFormatInfoKHR: return "PhysicalDeviceVideoFormatInfoKHR"; - case StructureType::eVideoFormatPropertiesKHR: return "VideoFormatPropertiesKHR"; - case StructureType::eQueueFamilyQueryResultStatusPropertiesKHR: return "QueueFamilyQueryResultStatusPropertiesKHR"; - case StructureType::eVideoDecodeInfoKHR: return "VideoDecodeInfoKHR"; - case StructureType::eVideoDecodeCapabilitiesKHR: return "VideoDecodeCapabilitiesKHR"; - case StructureType::eVideoDecodeUsageInfoKHR: return "VideoDecodeUsageInfoKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case StructureType::eDedicatedAllocationImageCreateInfoNV: return "DedicatedAllocationImageCreateInfoNV"; - case StructureType::eDedicatedAllocationBufferCreateInfoNV: return "DedicatedAllocationBufferCreateInfoNV"; - case StructureType::eDedicatedAllocationMemoryAllocateInfoNV: return "DedicatedAllocationMemoryAllocateInfoNV"; - case StructureType::ePhysicalDeviceTransformFeedbackFeaturesEXT: return "PhysicalDeviceTransformFeedbackFeaturesEXT"; - case StructureType::ePhysicalDeviceTransformFeedbackPropertiesEXT: return "PhysicalDeviceTransformFeedbackPropertiesEXT"; - case StructureType::ePipelineRasterizationStateStreamCreateInfoEXT: return "PipelineRasterizationStateStreamCreateInfoEXT"; - case StructureType::eCuModuleCreateInfoNVX: return "CuModuleCreateInfoNVX"; - case StructureType::eCuFunctionCreateInfoNVX: return "CuFunctionCreateInfoNVX"; - case StructureType::eCuLaunchInfoNVX: return "CuLaunchInfoNVX"; - case StructureType::eImageViewHandleInfoNVX: return "ImageViewHandleInfoNVX"; - case StructureType::eImageViewAddressPropertiesNVX: return "ImageViewAddressPropertiesNVX"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case StructureType::eVideoEncodeH264CapabilitiesEXT: return "VideoEncodeH264CapabilitiesEXT"; - case StructureType::eVideoEncodeH264SessionParametersCreateInfoEXT: return "VideoEncodeH264SessionParametersCreateInfoEXT"; - case StructureType::eVideoEncodeH264SessionParametersAddInfoEXT: return "VideoEncodeH264SessionParametersAddInfoEXT"; - case StructureType::eVideoEncodeH264VclFrameInfoEXT: return "VideoEncodeH264VclFrameInfoEXT"; - case StructureType::eVideoEncodeH264DpbSlotInfoEXT: return "VideoEncodeH264DpbSlotInfoEXT"; - case StructureType::eVideoEncodeH264NaluSliceInfoEXT: return "VideoEncodeH264NaluSliceInfoEXT"; - case StructureType::eVideoEncodeH264EmitPictureParametersInfoEXT: return "VideoEncodeH264EmitPictureParametersInfoEXT"; - case StructureType::eVideoEncodeH264ProfileInfoEXT: return "VideoEncodeH264ProfileInfoEXT"; - case StructureType::eVideoEncodeH264RateControlInfoEXT: return "VideoEncodeH264RateControlInfoEXT"; - case StructureType::eVideoEncodeH264RateControlLayerInfoEXT: return "VideoEncodeH264RateControlLayerInfoEXT"; - case StructureType::eVideoEncodeH264ReferenceListsInfoEXT: return "VideoEncodeH264ReferenceListsInfoEXT"; - case StructureType::eVideoEncodeH265CapabilitiesEXT: return "VideoEncodeH265CapabilitiesEXT"; - case StructureType::eVideoEncodeH265SessionParametersCreateInfoEXT: return "VideoEncodeH265SessionParametersCreateInfoEXT"; - case StructureType::eVideoEncodeH265SessionParametersAddInfoEXT: return "VideoEncodeH265SessionParametersAddInfoEXT"; - case StructureType::eVideoEncodeH265VclFrameInfoEXT: return "VideoEncodeH265VclFrameInfoEXT"; - case StructureType::eVideoEncodeH265DpbSlotInfoEXT: return "VideoEncodeH265DpbSlotInfoEXT"; - case StructureType::eVideoEncodeH265NaluSliceSegmentInfoEXT: return "VideoEncodeH265NaluSliceSegmentInfoEXT"; - case StructureType::eVideoEncodeH265EmitPictureParametersInfoEXT: return "VideoEncodeH265EmitPictureParametersInfoEXT"; - case StructureType::eVideoEncodeH265ProfileInfoEXT: return "VideoEncodeH265ProfileInfoEXT"; - case StructureType::eVideoEncodeH265ReferenceListsInfoEXT: return "VideoEncodeH265ReferenceListsInfoEXT"; - case StructureType::eVideoEncodeH265RateControlInfoEXT: return "VideoEncodeH265RateControlInfoEXT"; - case StructureType::eVideoEncodeH265RateControlLayerInfoEXT: return "VideoEncodeH265RateControlLayerInfoEXT"; - case StructureType::eVideoDecodeH264CapabilitiesEXT: return "VideoDecodeH264CapabilitiesEXT"; - case StructureType::eVideoDecodeH264PictureInfoEXT: return "VideoDecodeH264PictureInfoEXT"; - case StructureType::eVideoDecodeH264MvcInfoEXT: return "VideoDecodeH264MvcInfoEXT"; - case StructureType::eVideoDecodeH264ProfileInfoEXT: return "VideoDecodeH264ProfileInfoEXT"; - case StructureType::eVideoDecodeH264SessionParametersCreateInfoEXT: return "VideoDecodeH264SessionParametersCreateInfoEXT"; - case StructureType::eVideoDecodeH264SessionParametersAddInfoEXT: return "VideoDecodeH264SessionParametersAddInfoEXT"; - case StructureType::eVideoDecodeH264DpbSlotInfoEXT: return "VideoDecodeH264DpbSlotInfoEXT"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case StructureType::eTextureLodGatherFormatPropertiesAMD: return "TextureLodGatherFormatPropertiesAMD"; - case StructureType::eRenderingFragmentShadingRateAttachmentInfoKHR: return "RenderingFragmentShadingRateAttachmentInfoKHR"; - case StructureType::eRenderingFragmentDensityMapAttachmentInfoEXT: return "RenderingFragmentDensityMapAttachmentInfoEXT"; - case StructureType::eAttachmentSampleCountInfoAMD: return "AttachmentSampleCountInfoAMD"; - case StructureType::eMultiviewPerViewAttributesInfoNVX: return "MultiviewPerViewAttributesInfoNVX"; -#if defined( VK_USE_PLATFORM_GGP ) - case StructureType::eStreamDescriptorSurfaceCreateInfoGGP: return "StreamDescriptorSurfaceCreateInfoGGP"; -#endif /*VK_USE_PLATFORM_GGP*/ - case StructureType::ePhysicalDeviceCornerSampledImageFeaturesNV: return "PhysicalDeviceCornerSampledImageFeaturesNV"; - case StructureType::eExternalMemoryImageCreateInfoNV: return "ExternalMemoryImageCreateInfoNV"; - case StructureType::eExportMemoryAllocateInfoNV: return "ExportMemoryAllocateInfoNV"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eImportMemoryWin32HandleInfoNV: return "ImportMemoryWin32HandleInfoNV"; - case StructureType::eExportMemoryWin32HandleInfoNV: return "ExportMemoryWin32HandleInfoNV"; - case StructureType::eWin32KeyedMutexAcquireReleaseInfoNV: return "Win32KeyedMutexAcquireReleaseInfoNV"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eValidationFlagsEXT: return "ValidationFlagsEXT"; -#if defined( VK_USE_PLATFORM_VI_NN ) - case StructureType::eViSurfaceCreateInfoNN: return "ViSurfaceCreateInfoNN"; -#endif /*VK_USE_PLATFORM_VI_NN*/ - case StructureType::eImageViewAstcDecodeModeEXT: return "ImageViewAstcDecodeModeEXT"; - case StructureType::ePhysicalDeviceAstcDecodeFeaturesEXT: return "PhysicalDeviceAstcDecodeFeaturesEXT"; - case StructureType::ePipelineRobustnessCreateInfoEXT: return "PipelineRobustnessCreateInfoEXT"; - case StructureType::ePhysicalDevicePipelineRobustnessFeaturesEXT: return "PhysicalDevicePipelineRobustnessFeaturesEXT"; - case StructureType::ePhysicalDevicePipelineRobustnessPropertiesEXT: return "PhysicalDevicePipelineRobustnessPropertiesEXT"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eImportMemoryWin32HandleInfoKHR: return "ImportMemoryWin32HandleInfoKHR"; - case StructureType::eExportMemoryWin32HandleInfoKHR: return "ExportMemoryWin32HandleInfoKHR"; - case StructureType::eMemoryWin32HandlePropertiesKHR: return "MemoryWin32HandlePropertiesKHR"; - case StructureType::eMemoryGetWin32HandleInfoKHR: return "MemoryGetWin32HandleInfoKHR"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eImportMemoryFdInfoKHR: return "ImportMemoryFdInfoKHR"; - case StructureType::eMemoryFdPropertiesKHR: return "MemoryFdPropertiesKHR"; - case StructureType::eMemoryGetFdInfoKHR: return "MemoryGetFdInfoKHR"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eWin32KeyedMutexAcquireReleaseInfoKHR: return "Win32KeyedMutexAcquireReleaseInfoKHR"; - case StructureType::eImportSemaphoreWin32HandleInfoKHR: return "ImportSemaphoreWin32HandleInfoKHR"; - case StructureType::eExportSemaphoreWin32HandleInfoKHR: return "ExportSemaphoreWin32HandleInfoKHR"; - case StructureType::eD3D12FenceSubmitInfoKHR: return "D3D12FenceSubmitInfoKHR"; - case StructureType::eSemaphoreGetWin32HandleInfoKHR: return "SemaphoreGetWin32HandleInfoKHR"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eImportSemaphoreFdInfoKHR: return "ImportSemaphoreFdInfoKHR"; - case StructureType::eSemaphoreGetFdInfoKHR: return "SemaphoreGetFdInfoKHR"; - case StructureType::ePhysicalDevicePushDescriptorPropertiesKHR: return "PhysicalDevicePushDescriptorPropertiesKHR"; - case StructureType::eCommandBufferInheritanceConditionalRenderingInfoEXT: return "CommandBufferInheritanceConditionalRenderingInfoEXT"; - case StructureType::ePhysicalDeviceConditionalRenderingFeaturesEXT: return "PhysicalDeviceConditionalRenderingFeaturesEXT"; - case StructureType::eConditionalRenderingBeginInfoEXT: return "ConditionalRenderingBeginInfoEXT"; - case StructureType::ePresentRegionsKHR: return "PresentRegionsKHR"; - case StructureType::ePipelineViewportWScalingStateCreateInfoNV: return "PipelineViewportWScalingStateCreateInfoNV"; - case StructureType::eSurfaceCapabilities2EXT: return "SurfaceCapabilities2EXT"; - case StructureType::eDisplayPowerInfoEXT: return "DisplayPowerInfoEXT"; - case StructureType::eDeviceEventInfoEXT: return "DeviceEventInfoEXT"; - case StructureType::eDisplayEventInfoEXT: return "DisplayEventInfoEXT"; - case StructureType::eSwapchainCounterCreateInfoEXT: return "SwapchainCounterCreateInfoEXT"; - case StructureType::ePresentTimesInfoGOOGLE: return "PresentTimesInfoGOOGLE"; - case StructureType::ePhysicalDeviceMultiviewPerViewAttributesPropertiesNVX: return "PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX"; - case StructureType::ePipelineViewportSwizzleStateCreateInfoNV: return "PipelineViewportSwizzleStateCreateInfoNV"; - case StructureType::ePhysicalDeviceDiscardRectanglePropertiesEXT: return "PhysicalDeviceDiscardRectanglePropertiesEXT"; - case StructureType::ePipelineDiscardRectangleStateCreateInfoEXT: return "PipelineDiscardRectangleStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceConservativeRasterizationPropertiesEXT: return "PhysicalDeviceConservativeRasterizationPropertiesEXT"; - case StructureType::ePipelineRasterizationConservativeStateCreateInfoEXT: return "PipelineRasterizationConservativeStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceDepthClipEnableFeaturesEXT: return "PhysicalDeviceDepthClipEnableFeaturesEXT"; - case StructureType::ePipelineRasterizationDepthClipStateCreateInfoEXT: return "PipelineRasterizationDepthClipStateCreateInfoEXT"; - case StructureType::eHdrMetadataEXT: return "HdrMetadataEXT"; - case StructureType::eSharedPresentSurfaceCapabilitiesKHR: return "SharedPresentSurfaceCapabilitiesKHR"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eImportFenceWin32HandleInfoKHR: return "ImportFenceWin32HandleInfoKHR"; - case StructureType::eExportFenceWin32HandleInfoKHR: return "ExportFenceWin32HandleInfoKHR"; - case StructureType::eFenceGetWin32HandleInfoKHR: return "FenceGetWin32HandleInfoKHR"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eImportFenceFdInfoKHR: return "ImportFenceFdInfoKHR"; - case StructureType::eFenceGetFdInfoKHR: return "FenceGetFdInfoKHR"; - case StructureType::ePhysicalDevicePerformanceQueryFeaturesKHR: return "PhysicalDevicePerformanceQueryFeaturesKHR"; - case StructureType::ePhysicalDevicePerformanceQueryPropertiesKHR: return "PhysicalDevicePerformanceQueryPropertiesKHR"; - case StructureType::eQueryPoolPerformanceCreateInfoKHR: return "QueryPoolPerformanceCreateInfoKHR"; - case StructureType::ePerformanceQuerySubmitInfoKHR: return "PerformanceQuerySubmitInfoKHR"; - case StructureType::eAcquireProfilingLockInfoKHR: return "AcquireProfilingLockInfoKHR"; - case StructureType::ePerformanceCounterKHR: return "PerformanceCounterKHR"; - case StructureType::ePerformanceCounterDescriptionKHR: return "PerformanceCounterDescriptionKHR"; - case StructureType::ePhysicalDeviceSurfaceInfo2KHR: return "PhysicalDeviceSurfaceInfo2KHR"; - case StructureType::eSurfaceCapabilities2KHR: return "SurfaceCapabilities2KHR"; - case StructureType::eSurfaceFormat2KHR: return "SurfaceFormat2KHR"; - case StructureType::eDisplayProperties2KHR: return "DisplayProperties2KHR"; - case StructureType::eDisplayPlaneProperties2KHR: return "DisplayPlaneProperties2KHR"; - case StructureType::eDisplayModeProperties2KHR: return "DisplayModeProperties2KHR"; - case StructureType::eDisplayPlaneInfo2KHR: return "DisplayPlaneInfo2KHR"; - case StructureType::eDisplayPlaneCapabilities2KHR: return "DisplayPlaneCapabilities2KHR"; -#if defined( VK_USE_PLATFORM_IOS_MVK ) - case StructureType::eIosSurfaceCreateInfoMVK: return "IosSurfaceCreateInfoMVK"; -#endif /*VK_USE_PLATFORM_IOS_MVK*/ -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - case StructureType::eMacosSurfaceCreateInfoMVK: return "MacosSurfaceCreateInfoMVK"; -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - case StructureType::eDebugUtilsObjectNameInfoEXT: return "DebugUtilsObjectNameInfoEXT"; - case StructureType::eDebugUtilsObjectTagInfoEXT: return "DebugUtilsObjectTagInfoEXT"; - case StructureType::eDebugUtilsLabelEXT: return "DebugUtilsLabelEXT"; - case StructureType::eDebugUtilsMessengerCallbackDataEXT: return "DebugUtilsMessengerCallbackDataEXT"; - case StructureType::eDebugUtilsMessengerCreateInfoEXT: return "DebugUtilsMessengerCreateInfoEXT"; -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - case StructureType::eAndroidHardwareBufferUsageANDROID: return "AndroidHardwareBufferUsageANDROID"; - case StructureType::eAndroidHardwareBufferPropertiesANDROID: return "AndroidHardwareBufferPropertiesANDROID"; - case StructureType::eAndroidHardwareBufferFormatPropertiesANDROID: return "AndroidHardwareBufferFormatPropertiesANDROID"; - case StructureType::eImportAndroidHardwareBufferInfoANDROID: return "ImportAndroidHardwareBufferInfoANDROID"; - case StructureType::eMemoryGetAndroidHardwareBufferInfoANDROID: return "MemoryGetAndroidHardwareBufferInfoANDROID"; - case StructureType::eExternalFormatANDROID: return "ExternalFormatANDROID"; - case StructureType::eAndroidHardwareBufferFormatProperties2ANDROID: return "AndroidHardwareBufferFormatProperties2ANDROID"; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - case StructureType::eSampleLocationsInfoEXT: return "SampleLocationsInfoEXT"; - case StructureType::eRenderPassSampleLocationsBeginInfoEXT: return "RenderPassSampleLocationsBeginInfoEXT"; - case StructureType::ePipelineSampleLocationsStateCreateInfoEXT: return "PipelineSampleLocationsStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceSampleLocationsPropertiesEXT: return "PhysicalDeviceSampleLocationsPropertiesEXT"; - case StructureType::eMultisamplePropertiesEXT: return "MultisamplePropertiesEXT"; - case StructureType::ePhysicalDeviceBlendOperationAdvancedFeaturesEXT: return "PhysicalDeviceBlendOperationAdvancedFeaturesEXT"; - case StructureType::ePhysicalDeviceBlendOperationAdvancedPropertiesEXT: return "PhysicalDeviceBlendOperationAdvancedPropertiesEXT"; - case StructureType::ePipelineColorBlendAdvancedStateCreateInfoEXT: return "PipelineColorBlendAdvancedStateCreateInfoEXT"; - case StructureType::ePipelineCoverageToColorStateCreateInfoNV: return "PipelineCoverageToColorStateCreateInfoNV"; - case StructureType::eWriteDescriptorSetAccelerationStructureKHR: return "WriteDescriptorSetAccelerationStructureKHR"; - case StructureType::eAccelerationStructureBuildGeometryInfoKHR: return "AccelerationStructureBuildGeometryInfoKHR"; - case StructureType::eAccelerationStructureDeviceAddressInfoKHR: return "AccelerationStructureDeviceAddressInfoKHR"; - case StructureType::eAccelerationStructureGeometryAabbsDataKHR: return "AccelerationStructureGeometryAabbsDataKHR"; - case StructureType::eAccelerationStructureGeometryInstancesDataKHR: return "AccelerationStructureGeometryInstancesDataKHR"; - case StructureType::eAccelerationStructureGeometryTrianglesDataKHR: return "AccelerationStructureGeometryTrianglesDataKHR"; - case StructureType::eAccelerationStructureGeometryKHR: return "AccelerationStructureGeometryKHR"; - case StructureType::eAccelerationStructureVersionInfoKHR: return "AccelerationStructureVersionInfoKHR"; - case StructureType::eCopyAccelerationStructureInfoKHR: return "CopyAccelerationStructureInfoKHR"; - case StructureType::eCopyAccelerationStructureToMemoryInfoKHR: return "CopyAccelerationStructureToMemoryInfoKHR"; - case StructureType::eCopyMemoryToAccelerationStructureInfoKHR: return "CopyMemoryToAccelerationStructureInfoKHR"; - case StructureType::ePhysicalDeviceAccelerationStructureFeaturesKHR: return "PhysicalDeviceAccelerationStructureFeaturesKHR"; - case StructureType::ePhysicalDeviceAccelerationStructurePropertiesKHR: return "PhysicalDeviceAccelerationStructurePropertiesKHR"; - case StructureType::eAccelerationStructureCreateInfoKHR: return "AccelerationStructureCreateInfoKHR"; - case StructureType::eAccelerationStructureBuildSizesInfoKHR: return "AccelerationStructureBuildSizesInfoKHR"; - case StructureType::ePhysicalDeviceRayTracingPipelineFeaturesKHR: return "PhysicalDeviceRayTracingPipelineFeaturesKHR"; - case StructureType::ePhysicalDeviceRayTracingPipelinePropertiesKHR: return "PhysicalDeviceRayTracingPipelinePropertiesKHR"; - case StructureType::eRayTracingPipelineCreateInfoKHR: return "RayTracingPipelineCreateInfoKHR"; - case StructureType::eRayTracingShaderGroupCreateInfoKHR: return "RayTracingShaderGroupCreateInfoKHR"; - case StructureType::eRayTracingPipelineInterfaceCreateInfoKHR: return "RayTracingPipelineInterfaceCreateInfoKHR"; - case StructureType::ePhysicalDeviceRayQueryFeaturesKHR: return "PhysicalDeviceRayQueryFeaturesKHR"; - case StructureType::ePipelineCoverageModulationStateCreateInfoNV: return "PipelineCoverageModulationStateCreateInfoNV"; - case StructureType::ePhysicalDeviceShaderSmBuiltinsFeaturesNV: return "PhysicalDeviceShaderSmBuiltinsFeaturesNV"; - case StructureType::ePhysicalDeviceShaderSmBuiltinsPropertiesNV: return "PhysicalDeviceShaderSmBuiltinsPropertiesNV"; - case StructureType::eDrmFormatModifierPropertiesListEXT: return "DrmFormatModifierPropertiesListEXT"; - case StructureType::ePhysicalDeviceImageDrmFormatModifierInfoEXT: return "PhysicalDeviceImageDrmFormatModifierInfoEXT"; - case StructureType::eImageDrmFormatModifierListCreateInfoEXT: return "ImageDrmFormatModifierListCreateInfoEXT"; - case StructureType::eImageDrmFormatModifierExplicitCreateInfoEXT: return "ImageDrmFormatModifierExplicitCreateInfoEXT"; - case StructureType::eImageDrmFormatModifierPropertiesEXT: return "ImageDrmFormatModifierPropertiesEXT"; - case StructureType::eDrmFormatModifierPropertiesList2EXT: return "DrmFormatModifierPropertiesList2EXT"; - case StructureType::eValidationCacheCreateInfoEXT: return "ValidationCacheCreateInfoEXT"; - case StructureType::eShaderModuleValidationCacheCreateInfoEXT: return "ShaderModuleValidationCacheCreateInfoEXT"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case StructureType::ePhysicalDevicePortabilitySubsetFeaturesKHR: return "PhysicalDevicePortabilitySubsetFeaturesKHR"; - case StructureType::ePhysicalDevicePortabilitySubsetPropertiesKHR: return "PhysicalDevicePortabilitySubsetPropertiesKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case StructureType::ePipelineViewportShadingRateImageStateCreateInfoNV: return "PipelineViewportShadingRateImageStateCreateInfoNV"; - case StructureType::ePhysicalDeviceShadingRateImageFeaturesNV: return "PhysicalDeviceShadingRateImageFeaturesNV"; - case StructureType::ePhysicalDeviceShadingRateImagePropertiesNV: return "PhysicalDeviceShadingRateImagePropertiesNV"; - case StructureType::ePipelineViewportCoarseSampleOrderStateCreateInfoNV: return "PipelineViewportCoarseSampleOrderStateCreateInfoNV"; - case StructureType::eRayTracingPipelineCreateInfoNV: return "RayTracingPipelineCreateInfoNV"; - case StructureType::eAccelerationStructureCreateInfoNV: return "AccelerationStructureCreateInfoNV"; - case StructureType::eGeometryNV: return "GeometryNV"; - case StructureType::eGeometryTrianglesNV: return "GeometryTrianglesNV"; - case StructureType::eGeometryAabbNV: return "GeometryAabbNV"; - case StructureType::eBindAccelerationStructureMemoryInfoNV: return "BindAccelerationStructureMemoryInfoNV"; - case StructureType::eWriteDescriptorSetAccelerationStructureNV: return "WriteDescriptorSetAccelerationStructureNV"; - case StructureType::eAccelerationStructureMemoryRequirementsInfoNV: return "AccelerationStructureMemoryRequirementsInfoNV"; - case StructureType::ePhysicalDeviceRayTracingPropertiesNV: return "PhysicalDeviceRayTracingPropertiesNV"; - case StructureType::eRayTracingShaderGroupCreateInfoNV: return "RayTracingShaderGroupCreateInfoNV"; - case StructureType::eAccelerationStructureInfoNV: return "AccelerationStructureInfoNV"; - case StructureType::ePhysicalDeviceRepresentativeFragmentTestFeaturesNV: return "PhysicalDeviceRepresentativeFragmentTestFeaturesNV"; - case StructureType::ePipelineRepresentativeFragmentTestStateCreateInfoNV: return "PipelineRepresentativeFragmentTestStateCreateInfoNV"; - case StructureType::ePhysicalDeviceImageViewImageFormatInfoEXT: return "PhysicalDeviceImageViewImageFormatInfoEXT"; - case StructureType::eFilterCubicImageViewImageFormatPropertiesEXT: return "FilterCubicImageViewImageFormatPropertiesEXT"; - case StructureType::eImportMemoryHostPointerInfoEXT: return "ImportMemoryHostPointerInfoEXT"; - case StructureType::eMemoryHostPointerPropertiesEXT: return "MemoryHostPointerPropertiesEXT"; - case StructureType::ePhysicalDeviceExternalMemoryHostPropertiesEXT: return "PhysicalDeviceExternalMemoryHostPropertiesEXT"; - case StructureType::ePhysicalDeviceShaderClockFeaturesKHR: return "PhysicalDeviceShaderClockFeaturesKHR"; - case StructureType::ePipelineCompilerControlCreateInfoAMD: return "PipelineCompilerControlCreateInfoAMD"; - case StructureType::eCalibratedTimestampInfoEXT: return "CalibratedTimestampInfoEXT"; - case StructureType::ePhysicalDeviceShaderCorePropertiesAMD: return "PhysicalDeviceShaderCorePropertiesAMD"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case StructureType::eVideoDecodeH265CapabilitiesEXT: return "VideoDecodeH265CapabilitiesEXT"; - case StructureType::eVideoDecodeH265SessionParametersCreateInfoEXT: return "VideoDecodeH265SessionParametersCreateInfoEXT"; - case StructureType::eVideoDecodeH265SessionParametersAddInfoEXT: return "VideoDecodeH265SessionParametersAddInfoEXT"; - case StructureType::eVideoDecodeH265ProfileInfoEXT: return "VideoDecodeH265ProfileInfoEXT"; - case StructureType::eVideoDecodeH265PictureInfoEXT: return "VideoDecodeH265PictureInfoEXT"; - case StructureType::eVideoDecodeH265DpbSlotInfoEXT: return "VideoDecodeH265DpbSlotInfoEXT"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case StructureType::eDeviceQueueGlobalPriorityCreateInfoKHR: return "DeviceQueueGlobalPriorityCreateInfoKHR"; - case StructureType::ePhysicalDeviceGlobalPriorityQueryFeaturesKHR: return "PhysicalDeviceGlobalPriorityQueryFeaturesKHR"; - case StructureType::eQueueFamilyGlobalPriorityPropertiesKHR: return "QueueFamilyGlobalPriorityPropertiesKHR"; - case StructureType::eDeviceMemoryOverallocationCreateInfoAMD: return "DeviceMemoryOverallocationCreateInfoAMD"; - case StructureType::ePhysicalDeviceVertexAttributeDivisorPropertiesEXT: return "PhysicalDeviceVertexAttributeDivisorPropertiesEXT"; - case StructureType::ePipelineVertexInputDivisorStateCreateInfoEXT: return "PipelineVertexInputDivisorStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceVertexAttributeDivisorFeaturesEXT: return "PhysicalDeviceVertexAttributeDivisorFeaturesEXT"; -#if defined( VK_USE_PLATFORM_GGP ) - case StructureType::ePresentFrameTokenGGP: return "PresentFrameTokenGGP"; -#endif /*VK_USE_PLATFORM_GGP*/ - case StructureType::ePhysicalDeviceComputeShaderDerivativesFeaturesNV: return "PhysicalDeviceComputeShaderDerivativesFeaturesNV"; - case StructureType::ePhysicalDeviceMeshShaderFeaturesNV: return "PhysicalDeviceMeshShaderFeaturesNV"; - case StructureType::ePhysicalDeviceMeshShaderPropertiesNV: return "PhysicalDeviceMeshShaderPropertiesNV"; - case StructureType::ePhysicalDeviceShaderImageFootprintFeaturesNV: return "PhysicalDeviceShaderImageFootprintFeaturesNV"; - case StructureType::ePipelineViewportExclusiveScissorStateCreateInfoNV: return "PipelineViewportExclusiveScissorStateCreateInfoNV"; - case StructureType::ePhysicalDeviceExclusiveScissorFeaturesNV: return "PhysicalDeviceExclusiveScissorFeaturesNV"; - case StructureType::eCheckpointDataNV: return "CheckpointDataNV"; - case StructureType::eQueueFamilyCheckpointPropertiesNV: return "QueueFamilyCheckpointPropertiesNV"; - case StructureType::ePhysicalDeviceShaderIntegerFunctions2FeaturesINTEL: return "PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL"; - case StructureType::eQueryPoolPerformanceQueryCreateInfoINTEL: return "QueryPoolPerformanceQueryCreateInfoINTEL"; - case StructureType::eInitializePerformanceApiInfoINTEL: return "InitializePerformanceApiInfoINTEL"; - case StructureType::ePerformanceMarkerInfoINTEL: return "PerformanceMarkerInfoINTEL"; - case StructureType::ePerformanceStreamMarkerInfoINTEL: return "PerformanceStreamMarkerInfoINTEL"; - case StructureType::ePerformanceOverrideInfoINTEL: return "PerformanceOverrideInfoINTEL"; - case StructureType::ePerformanceConfigurationAcquireInfoINTEL: return "PerformanceConfigurationAcquireInfoINTEL"; - case StructureType::ePhysicalDevicePciBusInfoPropertiesEXT: return "PhysicalDevicePciBusInfoPropertiesEXT"; - case StructureType::eDisplayNativeHdrSurfaceCapabilitiesAMD: return "DisplayNativeHdrSurfaceCapabilitiesAMD"; - case StructureType::eSwapchainDisplayNativeHdrCreateInfoAMD: return "SwapchainDisplayNativeHdrCreateInfoAMD"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case StructureType::eImagepipeSurfaceCreateInfoFUCHSIA: return "ImagepipeSurfaceCreateInfoFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ -#if defined( VK_USE_PLATFORM_METAL_EXT ) - case StructureType::eMetalSurfaceCreateInfoEXT: return "MetalSurfaceCreateInfoEXT"; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - case StructureType::ePhysicalDeviceFragmentDensityMapFeaturesEXT: return "PhysicalDeviceFragmentDensityMapFeaturesEXT"; - case StructureType::ePhysicalDeviceFragmentDensityMapPropertiesEXT: return "PhysicalDeviceFragmentDensityMapPropertiesEXT"; - case StructureType::eRenderPassFragmentDensityMapCreateInfoEXT: return "RenderPassFragmentDensityMapCreateInfoEXT"; - case StructureType::eFragmentShadingRateAttachmentInfoKHR: return "FragmentShadingRateAttachmentInfoKHR"; - case StructureType::ePipelineFragmentShadingRateStateCreateInfoKHR: return "PipelineFragmentShadingRateStateCreateInfoKHR"; - case StructureType::ePhysicalDeviceFragmentShadingRatePropertiesKHR: return "PhysicalDeviceFragmentShadingRatePropertiesKHR"; - case StructureType::ePhysicalDeviceFragmentShadingRateFeaturesKHR: return "PhysicalDeviceFragmentShadingRateFeaturesKHR"; - case StructureType::ePhysicalDeviceFragmentShadingRateKHR: return "PhysicalDeviceFragmentShadingRateKHR"; - case StructureType::ePhysicalDeviceShaderCoreProperties2AMD: return "PhysicalDeviceShaderCoreProperties2AMD"; - case StructureType::ePhysicalDeviceCoherentMemoryFeaturesAMD: return "PhysicalDeviceCoherentMemoryFeaturesAMD"; - case StructureType::ePhysicalDeviceShaderImageAtomicInt64FeaturesEXT: return "PhysicalDeviceShaderImageAtomicInt64FeaturesEXT"; - case StructureType::ePhysicalDeviceMemoryBudgetPropertiesEXT: return "PhysicalDeviceMemoryBudgetPropertiesEXT"; - case StructureType::ePhysicalDeviceMemoryPriorityFeaturesEXT: return "PhysicalDeviceMemoryPriorityFeaturesEXT"; - case StructureType::eMemoryPriorityAllocateInfoEXT: return "MemoryPriorityAllocateInfoEXT"; - case StructureType::eSurfaceProtectedCapabilitiesKHR: return "SurfaceProtectedCapabilitiesKHR"; - case StructureType::ePhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV: return "PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV"; - case StructureType::ePhysicalDeviceBufferDeviceAddressFeaturesEXT: return "PhysicalDeviceBufferDeviceAddressFeaturesEXT"; - case StructureType::eBufferDeviceAddressCreateInfoEXT: return "BufferDeviceAddressCreateInfoEXT"; - case StructureType::eValidationFeaturesEXT: return "ValidationFeaturesEXT"; - case StructureType::ePhysicalDevicePresentWaitFeaturesKHR: return "PhysicalDevicePresentWaitFeaturesKHR"; - case StructureType::ePhysicalDeviceCooperativeMatrixFeaturesNV: return "PhysicalDeviceCooperativeMatrixFeaturesNV"; - case StructureType::eCooperativeMatrixPropertiesNV: return "CooperativeMatrixPropertiesNV"; - case StructureType::ePhysicalDeviceCooperativeMatrixPropertiesNV: return "PhysicalDeviceCooperativeMatrixPropertiesNV"; - case StructureType::ePhysicalDeviceCoverageReductionModeFeaturesNV: return "PhysicalDeviceCoverageReductionModeFeaturesNV"; - case StructureType::ePipelineCoverageReductionStateCreateInfoNV: return "PipelineCoverageReductionStateCreateInfoNV"; - case StructureType::eFramebufferMixedSamplesCombinationNV: return "FramebufferMixedSamplesCombinationNV"; - case StructureType::ePhysicalDeviceFragmentShaderInterlockFeaturesEXT: return "PhysicalDeviceFragmentShaderInterlockFeaturesEXT"; - case StructureType::ePhysicalDeviceYcbcrImageArraysFeaturesEXT: return "PhysicalDeviceYcbcrImageArraysFeaturesEXT"; - case StructureType::ePhysicalDeviceProvokingVertexFeaturesEXT: return "PhysicalDeviceProvokingVertexFeaturesEXT"; - case StructureType::ePipelineRasterizationProvokingVertexStateCreateInfoEXT: return "PipelineRasterizationProvokingVertexStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceProvokingVertexPropertiesEXT: return "PhysicalDeviceProvokingVertexPropertiesEXT"; -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - case StructureType::eSurfaceFullScreenExclusiveInfoEXT: return "SurfaceFullScreenExclusiveInfoEXT"; - case StructureType::eSurfaceCapabilitiesFullScreenExclusiveEXT: return "SurfaceCapabilitiesFullScreenExclusiveEXT"; - case StructureType::eSurfaceFullScreenExclusiveWin32InfoEXT: return "SurfaceFullScreenExclusiveWin32InfoEXT"; -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - case StructureType::eHeadlessSurfaceCreateInfoEXT: return "HeadlessSurfaceCreateInfoEXT"; - case StructureType::ePhysicalDeviceLineRasterizationFeaturesEXT: return "PhysicalDeviceLineRasterizationFeaturesEXT"; - case StructureType::ePipelineRasterizationLineStateCreateInfoEXT: return "PipelineRasterizationLineStateCreateInfoEXT"; - case StructureType::ePhysicalDeviceLineRasterizationPropertiesEXT: return "PhysicalDeviceLineRasterizationPropertiesEXT"; - case StructureType::ePhysicalDeviceShaderAtomicFloatFeaturesEXT: return "PhysicalDeviceShaderAtomicFloatFeaturesEXT"; - case StructureType::ePhysicalDeviceIndexTypeUint8FeaturesEXT: return "PhysicalDeviceIndexTypeUint8FeaturesEXT"; - case StructureType::ePhysicalDeviceExtendedDynamicStateFeaturesEXT: return "PhysicalDeviceExtendedDynamicStateFeaturesEXT"; - case StructureType::ePhysicalDevicePipelineExecutablePropertiesFeaturesKHR: return "PhysicalDevicePipelineExecutablePropertiesFeaturesKHR"; - case StructureType::ePipelineInfoKHR: return "PipelineInfoKHR"; - case StructureType::ePipelineExecutablePropertiesKHR: return "PipelineExecutablePropertiesKHR"; - case StructureType::ePipelineExecutableInfoKHR: return "PipelineExecutableInfoKHR"; - case StructureType::ePipelineExecutableStatisticKHR: return "PipelineExecutableStatisticKHR"; - case StructureType::ePipelineExecutableInternalRepresentationKHR: return "PipelineExecutableInternalRepresentationKHR"; - case StructureType::ePhysicalDeviceShaderAtomicFloat2FeaturesEXT: return "PhysicalDeviceShaderAtomicFloat2FeaturesEXT"; - case StructureType::ePhysicalDeviceDeviceGeneratedCommandsPropertiesNV: return "PhysicalDeviceDeviceGeneratedCommandsPropertiesNV"; - case StructureType::eGraphicsShaderGroupCreateInfoNV: return "GraphicsShaderGroupCreateInfoNV"; - case StructureType::eGraphicsPipelineShaderGroupsCreateInfoNV: return "GraphicsPipelineShaderGroupsCreateInfoNV"; - case StructureType::eIndirectCommandsLayoutTokenNV: return "IndirectCommandsLayoutTokenNV"; - case StructureType::eIndirectCommandsLayoutCreateInfoNV: return "IndirectCommandsLayoutCreateInfoNV"; - case StructureType::eGeneratedCommandsInfoNV: return "GeneratedCommandsInfoNV"; - case StructureType::eGeneratedCommandsMemoryRequirementsInfoNV: return "GeneratedCommandsMemoryRequirementsInfoNV"; - case StructureType::ePhysicalDeviceDeviceGeneratedCommandsFeaturesNV: return "PhysicalDeviceDeviceGeneratedCommandsFeaturesNV"; - case StructureType::ePhysicalDeviceInheritedViewportScissorFeaturesNV: return "PhysicalDeviceInheritedViewportScissorFeaturesNV"; - case StructureType::eCommandBufferInheritanceViewportScissorInfoNV: return "CommandBufferInheritanceViewportScissorInfoNV"; - case StructureType::ePhysicalDeviceTexelBufferAlignmentFeaturesEXT: return "PhysicalDeviceTexelBufferAlignmentFeaturesEXT"; - case StructureType::eCommandBufferInheritanceRenderPassTransformInfoQCOM: return "CommandBufferInheritanceRenderPassTransformInfoQCOM"; - case StructureType::eRenderPassTransformBeginInfoQCOM: return "RenderPassTransformBeginInfoQCOM"; - case StructureType::ePhysicalDeviceDeviceMemoryReportFeaturesEXT: return "PhysicalDeviceDeviceMemoryReportFeaturesEXT"; - case StructureType::eDeviceDeviceMemoryReportCreateInfoEXT: return "DeviceDeviceMemoryReportCreateInfoEXT"; - case StructureType::eDeviceMemoryReportCallbackDataEXT: return "DeviceMemoryReportCallbackDataEXT"; - case StructureType::ePhysicalDeviceRobustness2FeaturesEXT: return "PhysicalDeviceRobustness2FeaturesEXT"; - case StructureType::ePhysicalDeviceRobustness2PropertiesEXT: return "PhysicalDeviceRobustness2PropertiesEXT"; - case StructureType::eSamplerCustomBorderColorCreateInfoEXT: return "SamplerCustomBorderColorCreateInfoEXT"; - case StructureType::ePhysicalDeviceCustomBorderColorPropertiesEXT: return "PhysicalDeviceCustomBorderColorPropertiesEXT"; - case StructureType::ePhysicalDeviceCustomBorderColorFeaturesEXT: return "PhysicalDeviceCustomBorderColorFeaturesEXT"; - case StructureType::ePipelineLibraryCreateInfoKHR: return "PipelineLibraryCreateInfoKHR"; - case StructureType::ePresentIdKHR: return "PresentIdKHR"; - case StructureType::ePhysicalDevicePresentIdFeaturesKHR: return "PhysicalDevicePresentIdFeaturesKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case StructureType::eVideoEncodeInfoKHR: return "VideoEncodeInfoKHR"; - case StructureType::eVideoEncodeRateControlInfoKHR: return "VideoEncodeRateControlInfoKHR"; - case StructureType::eVideoEncodeRateControlLayerInfoKHR: return "VideoEncodeRateControlLayerInfoKHR"; - case StructureType::eVideoEncodeCapabilitiesKHR: return "VideoEncodeCapabilitiesKHR"; - case StructureType::eVideoEncodeUsageInfoKHR: return "VideoEncodeUsageInfoKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case StructureType::ePhysicalDeviceDiagnosticsConfigFeaturesNV: return "PhysicalDeviceDiagnosticsConfigFeaturesNV"; - case StructureType::eDeviceDiagnosticsConfigCreateInfoNV: return "DeviceDiagnosticsConfigCreateInfoNV"; -#if defined( VK_USE_PLATFORM_METAL_EXT ) - case StructureType::eExportMetalObjectCreateInfoEXT: return "ExportMetalObjectCreateInfoEXT"; - case StructureType::eExportMetalObjectsInfoEXT: return "ExportMetalObjectsInfoEXT"; - case StructureType::eExportMetalDeviceInfoEXT: return "ExportMetalDeviceInfoEXT"; - case StructureType::eExportMetalCommandQueueInfoEXT: return "ExportMetalCommandQueueInfoEXT"; - case StructureType::eExportMetalBufferInfoEXT: return "ExportMetalBufferInfoEXT"; - case StructureType::eImportMetalBufferInfoEXT: return "ImportMetalBufferInfoEXT"; - case StructureType::eExportMetalTextureInfoEXT: return "ExportMetalTextureInfoEXT"; - case StructureType::eImportMetalTextureInfoEXT: return "ImportMetalTextureInfoEXT"; - case StructureType::eExportMetalIoSurfaceInfoEXT: return "ExportMetalIoSurfaceInfoEXT"; - case StructureType::eImportMetalIoSurfaceInfoEXT: return "ImportMetalIoSurfaceInfoEXT"; - case StructureType::eExportMetalSharedEventInfoEXT: return "ExportMetalSharedEventInfoEXT"; - case StructureType::eImportMetalSharedEventInfoEXT: return "ImportMetalSharedEventInfoEXT"; -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - case StructureType::eQueueFamilyCheckpointProperties2NV: return "QueueFamilyCheckpointProperties2NV"; - case StructureType::eCheckpointData2NV: return "CheckpointData2NV"; - case StructureType::ePhysicalDeviceGraphicsPipelineLibraryFeaturesEXT: return "PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT"; - case StructureType::ePhysicalDeviceGraphicsPipelineLibraryPropertiesEXT: return "PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT"; - case StructureType::eGraphicsPipelineLibraryCreateInfoEXT: return "GraphicsPipelineLibraryCreateInfoEXT"; - case StructureType::ePhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD: return "PhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD"; - case StructureType::ePhysicalDeviceFragmentShaderBarycentricFeaturesKHR: return "PhysicalDeviceFragmentShaderBarycentricFeaturesKHR"; - case StructureType::ePhysicalDeviceFragmentShaderBarycentricPropertiesKHR: return "PhysicalDeviceFragmentShaderBarycentricPropertiesKHR"; - case StructureType::ePhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR: return "PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR"; - case StructureType::ePhysicalDeviceFragmentShadingRateEnumsPropertiesNV: return "PhysicalDeviceFragmentShadingRateEnumsPropertiesNV"; - case StructureType::ePhysicalDeviceFragmentShadingRateEnumsFeaturesNV: return "PhysicalDeviceFragmentShadingRateEnumsFeaturesNV"; - case StructureType::ePipelineFragmentShadingRateEnumStateCreateInfoNV: return "PipelineFragmentShadingRateEnumStateCreateInfoNV"; - case StructureType::eAccelerationStructureGeometryMotionTrianglesDataNV: return "AccelerationStructureGeometryMotionTrianglesDataNV"; - case StructureType::ePhysicalDeviceRayTracingMotionBlurFeaturesNV: return "PhysicalDeviceRayTracingMotionBlurFeaturesNV"; - case StructureType::eAccelerationStructureMotionInfoNV: return "AccelerationStructureMotionInfoNV"; - case StructureType::ePhysicalDeviceMeshShaderFeaturesEXT: return "PhysicalDeviceMeshShaderFeaturesEXT"; - case StructureType::ePhysicalDeviceMeshShaderPropertiesEXT: return "PhysicalDeviceMeshShaderPropertiesEXT"; - case StructureType::ePhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT: return "PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT"; - case StructureType::ePhysicalDeviceFragmentDensityMap2FeaturesEXT: return "PhysicalDeviceFragmentDensityMap2FeaturesEXT"; - case StructureType::ePhysicalDeviceFragmentDensityMap2PropertiesEXT: return "PhysicalDeviceFragmentDensityMap2PropertiesEXT"; - case StructureType::eCopyCommandTransformInfoQCOM: return "CopyCommandTransformInfoQCOM"; - case StructureType::ePhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR: return "PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR"; - case StructureType::ePhysicalDeviceImageCompressionControlFeaturesEXT: return "PhysicalDeviceImageCompressionControlFeaturesEXT"; - case StructureType::eImageCompressionControlEXT: return "ImageCompressionControlEXT"; - case StructureType::eSubresourceLayout2EXT: return "SubresourceLayout2EXT"; - case StructureType::eImageSubresource2EXT: return "ImageSubresource2EXT"; - case StructureType::eImageCompressionPropertiesEXT: return "ImageCompressionPropertiesEXT"; - case StructureType::ePhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT: return "PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT"; - case StructureType::ePhysicalDevice4444FormatsFeaturesEXT: return "PhysicalDevice4444FormatsFeaturesEXT"; - case StructureType::ePhysicalDeviceRgba10X6FormatsFeaturesEXT: return "PhysicalDeviceRgba10X6FormatsFeaturesEXT"; -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - case StructureType::eDirectfbSurfaceCreateInfoEXT: return "DirectfbSurfaceCreateInfoEXT"; -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - case StructureType::ePhysicalDeviceMutableDescriptorTypeFeaturesVALVE: return "PhysicalDeviceMutableDescriptorTypeFeaturesVALVE"; - case StructureType::eMutableDescriptorTypeCreateInfoVALVE: return "MutableDescriptorTypeCreateInfoVALVE"; - case StructureType::ePhysicalDeviceVertexInputDynamicStateFeaturesEXT: return "PhysicalDeviceVertexInputDynamicStateFeaturesEXT"; - case StructureType::eVertexInputBindingDescription2EXT: return "VertexInputBindingDescription2EXT"; - case StructureType::eVertexInputAttributeDescription2EXT: return "VertexInputAttributeDescription2EXT"; - case StructureType::ePhysicalDeviceDrmPropertiesEXT: return "PhysicalDeviceDrmPropertiesEXT"; - case StructureType::ePhysicalDeviceDepthClipControlFeaturesEXT: return "PhysicalDeviceDepthClipControlFeaturesEXT"; - case StructureType::ePipelineViewportDepthClipControlCreateInfoEXT: return "PipelineViewportDepthClipControlCreateInfoEXT"; - case StructureType::ePhysicalDevicePrimitiveTopologyListRestartFeaturesEXT: return "PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case StructureType::eImportMemoryZirconHandleInfoFUCHSIA: return "ImportMemoryZirconHandleInfoFUCHSIA"; - case StructureType::eMemoryZirconHandlePropertiesFUCHSIA: return "MemoryZirconHandlePropertiesFUCHSIA"; - case StructureType::eMemoryGetZirconHandleInfoFUCHSIA: return "MemoryGetZirconHandleInfoFUCHSIA"; - case StructureType::eImportSemaphoreZirconHandleInfoFUCHSIA: return "ImportSemaphoreZirconHandleInfoFUCHSIA"; - case StructureType::eSemaphoreGetZirconHandleInfoFUCHSIA: return "SemaphoreGetZirconHandleInfoFUCHSIA"; - case StructureType::eBufferCollectionCreateInfoFUCHSIA: return "BufferCollectionCreateInfoFUCHSIA"; - case StructureType::eImportMemoryBufferCollectionFUCHSIA: return "ImportMemoryBufferCollectionFUCHSIA"; - case StructureType::eBufferCollectionImageCreateInfoFUCHSIA: return "BufferCollectionImageCreateInfoFUCHSIA"; - case StructureType::eBufferCollectionPropertiesFUCHSIA: return "BufferCollectionPropertiesFUCHSIA"; - case StructureType::eBufferConstraintsInfoFUCHSIA: return "BufferConstraintsInfoFUCHSIA"; - case StructureType::eBufferCollectionBufferCreateInfoFUCHSIA: return "BufferCollectionBufferCreateInfoFUCHSIA"; - case StructureType::eImageConstraintsInfoFUCHSIA: return "ImageConstraintsInfoFUCHSIA"; - case StructureType::eImageFormatConstraintsInfoFUCHSIA: return "ImageFormatConstraintsInfoFUCHSIA"; - case StructureType::eSysmemColorSpaceFUCHSIA: return "SysmemColorSpaceFUCHSIA"; - case StructureType::eBufferCollectionConstraintsInfoFUCHSIA: return "BufferCollectionConstraintsInfoFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - case StructureType::eSubpassShadingPipelineCreateInfoHUAWEI: return "SubpassShadingPipelineCreateInfoHUAWEI"; - case StructureType::ePhysicalDeviceSubpassShadingFeaturesHUAWEI: return "PhysicalDeviceSubpassShadingFeaturesHUAWEI"; - case StructureType::ePhysicalDeviceSubpassShadingPropertiesHUAWEI: return "PhysicalDeviceSubpassShadingPropertiesHUAWEI"; - case StructureType::ePhysicalDeviceInvocationMaskFeaturesHUAWEI: return "PhysicalDeviceInvocationMaskFeaturesHUAWEI"; - case StructureType::eMemoryGetRemoteAddressInfoNV: return "MemoryGetRemoteAddressInfoNV"; - case StructureType::ePhysicalDeviceExternalMemoryRdmaFeaturesNV: return "PhysicalDeviceExternalMemoryRdmaFeaturesNV"; - case StructureType::ePipelinePropertiesIdentifierEXT: return "PipelinePropertiesIdentifierEXT"; - case StructureType::ePhysicalDevicePipelinePropertiesFeaturesEXT: return "PhysicalDevicePipelinePropertiesFeaturesEXT"; - case StructureType::ePhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT: return "PhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT"; - case StructureType::eSubpassResolvePerformanceQueryEXT: return "SubpassResolvePerformanceQueryEXT"; - case StructureType::eMultisampledRenderToSingleSampledInfoEXT: return "MultisampledRenderToSingleSampledInfoEXT"; - case StructureType::ePhysicalDeviceExtendedDynamicState2FeaturesEXT: return "PhysicalDeviceExtendedDynamicState2FeaturesEXT"; -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - case StructureType::eScreenSurfaceCreateInfoQNX: return "ScreenSurfaceCreateInfoQNX"; -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - case StructureType::ePhysicalDeviceColorWriteEnableFeaturesEXT: return "PhysicalDeviceColorWriteEnableFeaturesEXT"; - case StructureType::ePipelineColorWriteCreateInfoEXT: return "PipelineColorWriteCreateInfoEXT"; - case StructureType::ePhysicalDevicePrimitivesGeneratedQueryFeaturesEXT: return "PhysicalDevicePrimitivesGeneratedQueryFeaturesEXT"; - case StructureType::ePhysicalDeviceRayTracingMaintenance1FeaturesKHR: return "PhysicalDeviceRayTracingMaintenance1FeaturesKHR"; - case StructureType::ePhysicalDeviceImageViewMinLodFeaturesEXT: return "PhysicalDeviceImageViewMinLodFeaturesEXT"; - case StructureType::eImageViewMinLodCreateInfoEXT: return "ImageViewMinLodCreateInfoEXT"; - case StructureType::ePhysicalDeviceMultiDrawFeaturesEXT: return "PhysicalDeviceMultiDrawFeaturesEXT"; - case StructureType::ePhysicalDeviceMultiDrawPropertiesEXT: return "PhysicalDeviceMultiDrawPropertiesEXT"; - case StructureType::ePhysicalDeviceImage2DViewOf3DFeaturesEXT: return "PhysicalDeviceImage2DViewOf3DFeaturesEXT"; - case StructureType::ePhysicalDeviceBorderColorSwizzleFeaturesEXT: return "PhysicalDeviceBorderColorSwizzleFeaturesEXT"; - case StructureType::eSamplerBorderColorComponentMappingCreateInfoEXT: return "SamplerBorderColorComponentMappingCreateInfoEXT"; - case StructureType::ePhysicalDevicePageableDeviceLocalMemoryFeaturesEXT: return "PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT"; - case StructureType::ePhysicalDeviceDescriptorSetHostMappingFeaturesVALVE: return "PhysicalDeviceDescriptorSetHostMappingFeaturesVALVE"; - case StructureType::eDescriptorSetBindingReferenceVALVE: return "DescriptorSetBindingReferenceVALVE"; - case StructureType::eDescriptorSetLayoutHostMappingInfoVALVE: return "DescriptorSetLayoutHostMappingInfoVALVE"; - case StructureType::ePhysicalDeviceDepthClampZeroOneFeaturesEXT: return "PhysicalDeviceDepthClampZeroOneFeaturesEXT"; - case StructureType::ePhysicalDeviceNonSeamlessCubeMapFeaturesEXT: return "PhysicalDeviceNonSeamlessCubeMapFeaturesEXT"; - case StructureType::ePhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM: return "PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM"; - case StructureType::ePhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM: return "PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM"; - case StructureType::eSubpassFragmentDensityMapOffsetEndInfoQCOM: return "SubpassFragmentDensityMapOffsetEndInfoQCOM"; - case StructureType::ePhysicalDeviceLinearColorAttachmentFeaturesNV: return "PhysicalDeviceLinearColorAttachmentFeaturesNV"; - case StructureType::ePhysicalDeviceImageCompressionControlSwapchainFeaturesEXT: return "PhysicalDeviceImageCompressionControlSwapchainFeaturesEXT"; - case StructureType::ePhysicalDeviceImageProcessingFeaturesQCOM: return "PhysicalDeviceImageProcessingFeaturesQCOM"; - case StructureType::ePhysicalDeviceImageProcessingPropertiesQCOM: return "PhysicalDeviceImageProcessingPropertiesQCOM"; - case StructureType::eImageViewSampleWeightCreateInfoQCOM: return "ImageViewSampleWeightCreateInfoQCOM"; - case StructureType::ePhysicalDeviceSubpassMergeFeedbackFeaturesEXT: return "PhysicalDeviceSubpassMergeFeedbackFeaturesEXT"; - case StructureType::eRenderPassCreationControlEXT: return "RenderPassCreationControlEXT"; - case StructureType::eRenderPassCreationFeedbackCreateInfoEXT: return "RenderPassCreationFeedbackCreateInfoEXT"; - case StructureType::eRenderPassSubpassFeedbackCreateInfoEXT: return "RenderPassSubpassFeedbackCreateInfoEXT"; - case StructureType::ePhysicalDeviceShaderModuleIdentifierFeaturesEXT: return "PhysicalDeviceShaderModuleIdentifierFeaturesEXT"; - case StructureType::ePhysicalDeviceShaderModuleIdentifierPropertiesEXT: return "PhysicalDeviceShaderModuleIdentifierPropertiesEXT"; - case StructureType::ePipelineShaderStageModuleIdentifierCreateInfoEXT: return "PipelineShaderStageModuleIdentifierCreateInfoEXT"; - case StructureType::eShaderModuleIdentifierEXT: return "ShaderModuleIdentifierEXT"; - case StructureType::ePhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT: return "PhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT"; - case StructureType::ePhysicalDeviceLegacyDitheringFeaturesEXT: return "PhysicalDeviceLegacyDitheringFeaturesEXT"; - case StructureType::ePhysicalDeviceTilePropertiesFeaturesQCOM: return "PhysicalDeviceTilePropertiesFeaturesQCOM"; - case StructureType::eTilePropertiesQCOM: return "TilePropertiesQCOM"; - case StructureType::ePhysicalDeviceAmigoProfilingFeaturesSEC: return "PhysicalDeviceAmigoProfilingFeaturesSEC"; - case StructureType::eAmigoProfilingSubmitInfoSEC: return "AmigoProfilingSubmitInfoSEC"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCacheHeaderVersion value ) - { - switch ( value ) - { - case PipelineCacheHeaderVersion::eOne: return "One"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ObjectType value ) - { - switch ( value ) - { - case ObjectType::eUnknown: return "Unknown"; - case ObjectType::eInstance: return "Instance"; - case ObjectType::ePhysicalDevice: return "PhysicalDevice"; - case ObjectType::eDevice: return "Device"; - case ObjectType::eQueue: return "Queue"; - case ObjectType::eSemaphore: return "Semaphore"; - case ObjectType::eCommandBuffer: return "CommandBuffer"; - case ObjectType::eFence: return "Fence"; - case ObjectType::eDeviceMemory: return "DeviceMemory"; - case ObjectType::eBuffer: return "Buffer"; - case ObjectType::eImage: return "Image"; - case ObjectType::eEvent: return "Event"; - case ObjectType::eQueryPool: return "QueryPool"; - case ObjectType::eBufferView: return "BufferView"; - case ObjectType::eImageView: return "ImageView"; - case ObjectType::eShaderModule: return "ShaderModule"; - case ObjectType::ePipelineCache: return "PipelineCache"; - case ObjectType::ePipelineLayout: return "PipelineLayout"; - case ObjectType::eRenderPass: return "RenderPass"; - case ObjectType::ePipeline: return "Pipeline"; - case ObjectType::eDescriptorSetLayout: return "DescriptorSetLayout"; - case ObjectType::eSampler: return "Sampler"; - case ObjectType::eDescriptorPool: return "DescriptorPool"; - case ObjectType::eDescriptorSet: return "DescriptorSet"; - case ObjectType::eFramebuffer: return "Framebuffer"; - case ObjectType::eCommandPool: return "CommandPool"; - case ObjectType::eSamplerYcbcrConversion: return "SamplerYcbcrConversion"; - case ObjectType::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate"; - case ObjectType::ePrivateDataSlot: return "PrivateDataSlot"; - case ObjectType::eSurfaceKHR: return "SurfaceKHR"; - case ObjectType::eSwapchainKHR: return "SwapchainKHR"; - case ObjectType::eDisplayKHR: return "DisplayKHR"; - case ObjectType::eDisplayModeKHR: return "DisplayModeKHR"; - case ObjectType::eDebugReportCallbackEXT: return "DebugReportCallbackEXT"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case ObjectType::eVideoSessionKHR: return "VideoSessionKHR"; - case ObjectType::eVideoSessionParametersKHR: return "VideoSessionParametersKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case ObjectType::eCuModuleNVX: return "CuModuleNVX"; - case ObjectType::eCuFunctionNVX: return "CuFunctionNVX"; - case ObjectType::eDebugUtilsMessengerEXT: return "DebugUtilsMessengerEXT"; - case ObjectType::eAccelerationStructureKHR: return "AccelerationStructureKHR"; - case ObjectType::eValidationCacheEXT: return "ValidationCacheEXT"; - case ObjectType::eAccelerationStructureNV: return "AccelerationStructureNV"; - case ObjectType::ePerformanceConfigurationINTEL: return "PerformanceConfigurationINTEL"; - case ObjectType::eDeferredOperationKHR: return "DeferredOperationKHR"; - case ObjectType::eIndirectCommandsLayoutNV: return "IndirectCommandsLayoutNV"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case ObjectType::eBufferCollectionFUCHSIA: return "BufferCollectionFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VendorId value ) - { - switch ( value ) - { - case VendorId::eVIV: return "VIV"; - case VendorId::eVSI: return "VSI"; - case VendorId::eKazan: return "Kazan"; - case VendorId::eCodeplay: return "Codeplay"; - case VendorId::eMESA: return "MESA"; - case VendorId::ePocl: return "Pocl"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( Format value ) - { - switch ( value ) - { - case Format::eUndefined: return "Undefined"; - case Format::eR4G4UnormPack8: return "R4G4UnormPack8"; - case Format::eR4G4B4A4UnormPack16: return "R4G4B4A4UnormPack16"; - case Format::eB4G4R4A4UnormPack16: return "B4G4R4A4UnormPack16"; - case Format::eR5G6B5UnormPack16: return "R5G6B5UnormPack16"; - case Format::eB5G6R5UnormPack16: return "B5G6R5UnormPack16"; - case Format::eR5G5B5A1UnormPack16: return "R5G5B5A1UnormPack16"; - case Format::eB5G5R5A1UnormPack16: return "B5G5R5A1UnormPack16"; - case Format::eA1R5G5B5UnormPack16: return "A1R5G5B5UnormPack16"; - case Format::eR8Unorm: return "R8Unorm"; - case Format::eR8Snorm: return "R8Snorm"; - case Format::eR8Uscaled: return "R8Uscaled"; - case Format::eR8Sscaled: return "R8Sscaled"; - case Format::eR8Uint: return "R8Uint"; - case Format::eR8Sint: return "R8Sint"; - case Format::eR8Srgb: return "R8Srgb"; - case Format::eR8G8Unorm: return "R8G8Unorm"; - case Format::eR8G8Snorm: return "R8G8Snorm"; - case Format::eR8G8Uscaled: return "R8G8Uscaled"; - case Format::eR8G8Sscaled: return "R8G8Sscaled"; - case Format::eR8G8Uint: return "R8G8Uint"; - case Format::eR8G8Sint: return "R8G8Sint"; - case Format::eR8G8Srgb: return "R8G8Srgb"; - case Format::eR8G8B8Unorm: return "R8G8B8Unorm"; - case Format::eR8G8B8Snorm: return "R8G8B8Snorm"; - case Format::eR8G8B8Uscaled: return "R8G8B8Uscaled"; - case Format::eR8G8B8Sscaled: return "R8G8B8Sscaled"; - case Format::eR8G8B8Uint: return "R8G8B8Uint"; - case Format::eR8G8B8Sint: return "R8G8B8Sint"; - case Format::eR8G8B8Srgb: return "R8G8B8Srgb"; - case Format::eB8G8R8Unorm: return "B8G8R8Unorm"; - case Format::eB8G8R8Snorm: return "B8G8R8Snorm"; - case Format::eB8G8R8Uscaled: return "B8G8R8Uscaled"; - case Format::eB8G8R8Sscaled: return "B8G8R8Sscaled"; - case Format::eB8G8R8Uint: return "B8G8R8Uint"; - case Format::eB8G8R8Sint: return "B8G8R8Sint"; - case Format::eB8G8R8Srgb: return "B8G8R8Srgb"; - case Format::eR8G8B8A8Unorm: return "R8G8B8A8Unorm"; - case Format::eR8G8B8A8Snorm: return "R8G8B8A8Snorm"; - case Format::eR8G8B8A8Uscaled: return "R8G8B8A8Uscaled"; - case Format::eR8G8B8A8Sscaled: return "R8G8B8A8Sscaled"; - case Format::eR8G8B8A8Uint: return "R8G8B8A8Uint"; - case Format::eR8G8B8A8Sint: return "R8G8B8A8Sint"; - case Format::eR8G8B8A8Srgb: return "R8G8B8A8Srgb"; - case Format::eB8G8R8A8Unorm: return "B8G8R8A8Unorm"; - case Format::eB8G8R8A8Snorm: return "B8G8R8A8Snorm"; - case Format::eB8G8R8A8Uscaled: return "B8G8R8A8Uscaled"; - case Format::eB8G8R8A8Sscaled: return "B8G8R8A8Sscaled"; - case Format::eB8G8R8A8Uint: return "B8G8R8A8Uint"; - case Format::eB8G8R8A8Sint: return "B8G8R8A8Sint"; - case Format::eB8G8R8A8Srgb: return "B8G8R8A8Srgb"; - case Format::eA8B8G8R8UnormPack32: return "A8B8G8R8UnormPack32"; - case Format::eA8B8G8R8SnormPack32: return "A8B8G8R8SnormPack32"; - case Format::eA8B8G8R8UscaledPack32: return "A8B8G8R8UscaledPack32"; - case Format::eA8B8G8R8SscaledPack32: return "A8B8G8R8SscaledPack32"; - case Format::eA8B8G8R8UintPack32: return "A8B8G8R8UintPack32"; - case Format::eA8B8G8R8SintPack32: return "A8B8G8R8SintPack32"; - case Format::eA8B8G8R8SrgbPack32: return "A8B8G8R8SrgbPack32"; - case Format::eA2R10G10B10UnormPack32: return "A2R10G10B10UnormPack32"; - case Format::eA2R10G10B10SnormPack32: return "A2R10G10B10SnormPack32"; - case Format::eA2R10G10B10UscaledPack32: return "A2R10G10B10UscaledPack32"; - case Format::eA2R10G10B10SscaledPack32: return "A2R10G10B10SscaledPack32"; - case Format::eA2R10G10B10UintPack32: return "A2R10G10B10UintPack32"; - case Format::eA2R10G10B10SintPack32: return "A2R10G10B10SintPack32"; - case Format::eA2B10G10R10UnormPack32: return "A2B10G10R10UnormPack32"; - case Format::eA2B10G10R10SnormPack32: return "A2B10G10R10SnormPack32"; - case Format::eA2B10G10R10UscaledPack32: return "A2B10G10R10UscaledPack32"; - case Format::eA2B10G10R10SscaledPack32: return "A2B10G10R10SscaledPack32"; - case Format::eA2B10G10R10UintPack32: return "A2B10G10R10UintPack32"; - case Format::eA2B10G10R10SintPack32: return "A2B10G10R10SintPack32"; - case Format::eR16Unorm: return "R16Unorm"; - case Format::eR16Snorm: return "R16Snorm"; - case Format::eR16Uscaled: return "R16Uscaled"; - case Format::eR16Sscaled: return "R16Sscaled"; - case Format::eR16Uint: return "R16Uint"; - case Format::eR16Sint: return "R16Sint"; - case Format::eR16Sfloat: return "R16Sfloat"; - case Format::eR16G16Unorm: return "R16G16Unorm"; - case Format::eR16G16Snorm: return "R16G16Snorm"; - case Format::eR16G16Uscaled: return "R16G16Uscaled"; - case Format::eR16G16Sscaled: return "R16G16Sscaled"; - case Format::eR16G16Uint: return "R16G16Uint"; - case Format::eR16G16Sint: return "R16G16Sint"; - case Format::eR16G16Sfloat: return "R16G16Sfloat"; - case Format::eR16G16B16Unorm: return "R16G16B16Unorm"; - case Format::eR16G16B16Snorm: return "R16G16B16Snorm"; - case Format::eR16G16B16Uscaled: return "R16G16B16Uscaled"; - case Format::eR16G16B16Sscaled: return "R16G16B16Sscaled"; - case Format::eR16G16B16Uint: return "R16G16B16Uint"; - case Format::eR16G16B16Sint: return "R16G16B16Sint"; - case Format::eR16G16B16Sfloat: return "R16G16B16Sfloat"; - case Format::eR16G16B16A16Unorm: return "R16G16B16A16Unorm"; - case Format::eR16G16B16A16Snorm: return "R16G16B16A16Snorm"; - case Format::eR16G16B16A16Uscaled: return "R16G16B16A16Uscaled"; - case Format::eR16G16B16A16Sscaled: return "R16G16B16A16Sscaled"; - case Format::eR16G16B16A16Uint: return "R16G16B16A16Uint"; - case Format::eR16G16B16A16Sint: return "R16G16B16A16Sint"; - case Format::eR16G16B16A16Sfloat: return "R16G16B16A16Sfloat"; - case Format::eR32Uint: return "R32Uint"; - case Format::eR32Sint: return "R32Sint"; - case Format::eR32Sfloat: return "R32Sfloat"; - case Format::eR32G32Uint: return "R32G32Uint"; - case Format::eR32G32Sint: return "R32G32Sint"; - case Format::eR32G32Sfloat: return "R32G32Sfloat"; - case Format::eR32G32B32Uint: return "R32G32B32Uint"; - case Format::eR32G32B32Sint: return "R32G32B32Sint"; - case Format::eR32G32B32Sfloat: return "R32G32B32Sfloat"; - case Format::eR32G32B32A32Uint: return "R32G32B32A32Uint"; - case Format::eR32G32B32A32Sint: return "R32G32B32A32Sint"; - case Format::eR32G32B32A32Sfloat: return "R32G32B32A32Sfloat"; - case Format::eR64Uint: return "R64Uint"; - case Format::eR64Sint: return "R64Sint"; - case Format::eR64Sfloat: return "R64Sfloat"; - case Format::eR64G64Uint: return "R64G64Uint"; - case Format::eR64G64Sint: return "R64G64Sint"; - case Format::eR64G64Sfloat: return "R64G64Sfloat"; - case Format::eR64G64B64Uint: return "R64G64B64Uint"; - case Format::eR64G64B64Sint: return "R64G64B64Sint"; - case Format::eR64G64B64Sfloat: return "R64G64B64Sfloat"; - case Format::eR64G64B64A64Uint: return "R64G64B64A64Uint"; - case Format::eR64G64B64A64Sint: return "R64G64B64A64Sint"; - case Format::eR64G64B64A64Sfloat: return "R64G64B64A64Sfloat"; - case Format::eB10G11R11UfloatPack32: return "B10G11R11UfloatPack32"; - case Format::eE5B9G9R9UfloatPack32: return "E5B9G9R9UfloatPack32"; - case Format::eD16Unorm: return "D16Unorm"; - case Format::eX8D24UnormPack32: return "X8D24UnormPack32"; - case Format::eD32Sfloat: return "D32Sfloat"; - case Format::eS8Uint: return "S8Uint"; - case Format::eD16UnormS8Uint: return "D16UnormS8Uint"; - case Format::eD24UnormS8Uint: return "D24UnormS8Uint"; - case Format::eD32SfloatS8Uint: return "D32SfloatS8Uint"; - case Format::eBc1RgbUnormBlock: return "Bc1RgbUnormBlock"; - case Format::eBc1RgbSrgbBlock: return "Bc1RgbSrgbBlock"; - case Format::eBc1RgbaUnormBlock: return "Bc1RgbaUnormBlock"; - case Format::eBc1RgbaSrgbBlock: return "Bc1RgbaSrgbBlock"; - case Format::eBc2UnormBlock: return "Bc2UnormBlock"; - case Format::eBc2SrgbBlock: return "Bc2SrgbBlock"; - case Format::eBc3UnormBlock: return "Bc3UnormBlock"; - case Format::eBc3SrgbBlock: return "Bc3SrgbBlock"; - case Format::eBc4UnormBlock: return "Bc4UnormBlock"; - case Format::eBc4SnormBlock: return "Bc4SnormBlock"; - case Format::eBc5UnormBlock: return "Bc5UnormBlock"; - case Format::eBc5SnormBlock: return "Bc5SnormBlock"; - case Format::eBc6HUfloatBlock: return "Bc6HUfloatBlock"; - case Format::eBc6HSfloatBlock: return "Bc6HSfloatBlock"; - case Format::eBc7UnormBlock: return "Bc7UnormBlock"; - case Format::eBc7SrgbBlock: return "Bc7SrgbBlock"; - case Format::eEtc2R8G8B8UnormBlock: return "Etc2R8G8B8UnormBlock"; - case Format::eEtc2R8G8B8SrgbBlock: return "Etc2R8G8B8SrgbBlock"; - case Format::eEtc2R8G8B8A1UnormBlock: return "Etc2R8G8B8A1UnormBlock"; - case Format::eEtc2R8G8B8A1SrgbBlock: return "Etc2R8G8B8A1SrgbBlock"; - case Format::eEtc2R8G8B8A8UnormBlock: return "Etc2R8G8B8A8UnormBlock"; - case Format::eEtc2R8G8B8A8SrgbBlock: return "Etc2R8G8B8A8SrgbBlock"; - case Format::eEacR11UnormBlock: return "EacR11UnormBlock"; - case Format::eEacR11SnormBlock: return "EacR11SnormBlock"; - case Format::eEacR11G11UnormBlock: return "EacR11G11UnormBlock"; - case Format::eEacR11G11SnormBlock: return "EacR11G11SnormBlock"; - case Format::eAstc4x4UnormBlock: return "Astc4x4UnormBlock"; - case Format::eAstc4x4SrgbBlock: return "Astc4x4SrgbBlock"; - case Format::eAstc5x4UnormBlock: return "Astc5x4UnormBlock"; - case Format::eAstc5x4SrgbBlock: return "Astc5x4SrgbBlock"; - case Format::eAstc5x5UnormBlock: return "Astc5x5UnormBlock"; - case Format::eAstc5x5SrgbBlock: return "Astc5x5SrgbBlock"; - case Format::eAstc6x5UnormBlock: return "Astc6x5UnormBlock"; - case Format::eAstc6x5SrgbBlock: return "Astc6x5SrgbBlock"; - case Format::eAstc6x6UnormBlock: return "Astc6x6UnormBlock"; - case Format::eAstc6x6SrgbBlock: return "Astc6x6SrgbBlock"; - case Format::eAstc8x5UnormBlock: return "Astc8x5UnormBlock"; - case Format::eAstc8x5SrgbBlock: return "Astc8x5SrgbBlock"; - case Format::eAstc8x6UnormBlock: return "Astc8x6UnormBlock"; - case Format::eAstc8x6SrgbBlock: return "Astc8x6SrgbBlock"; - case Format::eAstc8x8UnormBlock: return "Astc8x8UnormBlock"; - case Format::eAstc8x8SrgbBlock: return "Astc8x8SrgbBlock"; - case Format::eAstc10x5UnormBlock: return "Astc10x5UnormBlock"; - case Format::eAstc10x5SrgbBlock: return "Astc10x5SrgbBlock"; - case Format::eAstc10x6UnormBlock: return "Astc10x6UnormBlock"; - case Format::eAstc10x6SrgbBlock: return "Astc10x6SrgbBlock"; - case Format::eAstc10x8UnormBlock: return "Astc10x8UnormBlock"; - case Format::eAstc10x8SrgbBlock: return "Astc10x8SrgbBlock"; - case Format::eAstc10x10UnormBlock: return "Astc10x10UnormBlock"; - case Format::eAstc10x10SrgbBlock: return "Astc10x10SrgbBlock"; - case Format::eAstc12x10UnormBlock: return "Astc12x10UnormBlock"; - case Format::eAstc12x10SrgbBlock: return "Astc12x10SrgbBlock"; - case Format::eAstc12x12UnormBlock: return "Astc12x12UnormBlock"; - case Format::eAstc12x12SrgbBlock: return "Astc12x12SrgbBlock"; - case Format::eG8B8G8R8422Unorm: return "G8B8G8R8422Unorm"; - case Format::eB8G8R8G8422Unorm: return "B8G8R8G8422Unorm"; - case Format::eG8B8R83Plane420Unorm: return "G8B8R83Plane420Unorm"; - case Format::eG8B8R82Plane420Unorm: return "G8B8R82Plane420Unorm"; - case Format::eG8B8R83Plane422Unorm: return "G8B8R83Plane422Unorm"; - case Format::eG8B8R82Plane422Unorm: return "G8B8R82Plane422Unorm"; - case Format::eG8B8R83Plane444Unorm: return "G8B8R83Plane444Unorm"; - case Format::eR10X6UnormPack16: return "R10X6UnormPack16"; - case Format::eR10X6G10X6Unorm2Pack16: return "R10X6G10X6Unorm2Pack16"; - case Format::eR10X6G10X6B10X6A10X6Unorm4Pack16: return "R10X6G10X6B10X6A10X6Unorm4Pack16"; - case Format::eG10X6B10X6G10X6R10X6422Unorm4Pack16: return "G10X6B10X6G10X6R10X6422Unorm4Pack16"; - case Format::eB10X6G10X6R10X6G10X6422Unorm4Pack16: return "B10X6G10X6R10X6G10X6422Unorm4Pack16"; - case Format::eG10X6B10X6R10X63Plane420Unorm3Pack16: return "G10X6B10X6R10X63Plane420Unorm3Pack16"; - case Format::eG10X6B10X6R10X62Plane420Unorm3Pack16: return "G10X6B10X6R10X62Plane420Unorm3Pack16"; - case Format::eG10X6B10X6R10X63Plane422Unorm3Pack16: return "G10X6B10X6R10X63Plane422Unorm3Pack16"; - case Format::eG10X6B10X6R10X62Plane422Unorm3Pack16: return "G10X6B10X6R10X62Plane422Unorm3Pack16"; - case Format::eG10X6B10X6R10X63Plane444Unorm3Pack16: return "G10X6B10X6R10X63Plane444Unorm3Pack16"; - case Format::eR12X4UnormPack16: return "R12X4UnormPack16"; - case Format::eR12X4G12X4Unorm2Pack16: return "R12X4G12X4Unorm2Pack16"; - case Format::eR12X4G12X4B12X4A12X4Unorm4Pack16: return "R12X4G12X4B12X4A12X4Unorm4Pack16"; - case Format::eG12X4B12X4G12X4R12X4422Unorm4Pack16: return "G12X4B12X4G12X4R12X4422Unorm4Pack16"; - case Format::eB12X4G12X4R12X4G12X4422Unorm4Pack16: return "B12X4G12X4R12X4G12X4422Unorm4Pack16"; - case Format::eG12X4B12X4R12X43Plane420Unorm3Pack16: return "G12X4B12X4R12X43Plane420Unorm3Pack16"; - case Format::eG12X4B12X4R12X42Plane420Unorm3Pack16: return "G12X4B12X4R12X42Plane420Unorm3Pack16"; - case Format::eG12X4B12X4R12X43Plane422Unorm3Pack16: return "G12X4B12X4R12X43Plane422Unorm3Pack16"; - case Format::eG12X4B12X4R12X42Plane422Unorm3Pack16: return "G12X4B12X4R12X42Plane422Unorm3Pack16"; - case Format::eG12X4B12X4R12X43Plane444Unorm3Pack16: return "G12X4B12X4R12X43Plane444Unorm3Pack16"; - case Format::eG16B16G16R16422Unorm: return "G16B16G16R16422Unorm"; - case Format::eB16G16R16G16422Unorm: return "B16G16R16G16422Unorm"; - case Format::eG16B16R163Plane420Unorm: return "G16B16R163Plane420Unorm"; - case Format::eG16B16R162Plane420Unorm: return "G16B16R162Plane420Unorm"; - case Format::eG16B16R163Plane422Unorm: return "G16B16R163Plane422Unorm"; - case Format::eG16B16R162Plane422Unorm: return "G16B16R162Plane422Unorm"; - case Format::eG16B16R163Plane444Unorm: return "G16B16R163Plane444Unorm"; - case Format::eG8B8R82Plane444Unorm: return "G8B8R82Plane444Unorm"; - case Format::eG10X6B10X6R10X62Plane444Unorm3Pack16: return "G10X6B10X6R10X62Plane444Unorm3Pack16"; - case Format::eG12X4B12X4R12X42Plane444Unorm3Pack16: return "G12X4B12X4R12X42Plane444Unorm3Pack16"; - case Format::eG16B16R162Plane444Unorm: return "G16B16R162Plane444Unorm"; - case Format::eA4R4G4B4UnormPack16: return "A4R4G4B4UnormPack16"; - case Format::eA4B4G4R4UnormPack16: return "A4B4G4R4UnormPack16"; - case Format::eAstc4x4SfloatBlock: return "Astc4x4SfloatBlock"; - case Format::eAstc5x4SfloatBlock: return "Astc5x4SfloatBlock"; - case Format::eAstc5x5SfloatBlock: return "Astc5x5SfloatBlock"; - case Format::eAstc6x5SfloatBlock: return "Astc6x5SfloatBlock"; - case Format::eAstc6x6SfloatBlock: return "Astc6x6SfloatBlock"; - case Format::eAstc8x5SfloatBlock: return "Astc8x5SfloatBlock"; - case Format::eAstc8x6SfloatBlock: return "Astc8x6SfloatBlock"; - case Format::eAstc8x8SfloatBlock: return "Astc8x8SfloatBlock"; - case Format::eAstc10x5SfloatBlock: return "Astc10x5SfloatBlock"; - case Format::eAstc10x6SfloatBlock: return "Astc10x6SfloatBlock"; - case Format::eAstc10x8SfloatBlock: return "Astc10x8SfloatBlock"; - case Format::eAstc10x10SfloatBlock: return "Astc10x10SfloatBlock"; - case Format::eAstc12x10SfloatBlock: return "Astc12x10SfloatBlock"; - case Format::eAstc12x12SfloatBlock: return "Astc12x12SfloatBlock"; - case Format::ePvrtc12BppUnormBlockIMG: return "Pvrtc12BppUnormBlockIMG"; - case Format::ePvrtc14BppUnormBlockIMG: return "Pvrtc14BppUnormBlockIMG"; - case Format::ePvrtc22BppUnormBlockIMG: return "Pvrtc22BppUnormBlockIMG"; - case Format::ePvrtc24BppUnormBlockIMG: return "Pvrtc24BppUnormBlockIMG"; - case Format::ePvrtc12BppSrgbBlockIMG: return "Pvrtc12BppSrgbBlockIMG"; - case Format::ePvrtc14BppSrgbBlockIMG: return "Pvrtc14BppSrgbBlockIMG"; - case Format::ePvrtc22BppSrgbBlockIMG: return "Pvrtc22BppSrgbBlockIMG"; - case Format::ePvrtc24BppSrgbBlockIMG: return "Pvrtc24BppSrgbBlockIMG"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FormatFeatureFlagBits value ) - { - switch ( value ) - { - case FormatFeatureFlagBits::eSampledImage: return "SampledImage"; - case FormatFeatureFlagBits::eStorageImage: return "StorageImage"; - case FormatFeatureFlagBits::eStorageImageAtomic: return "StorageImageAtomic"; - case FormatFeatureFlagBits::eUniformTexelBuffer: return "UniformTexelBuffer"; - case FormatFeatureFlagBits::eStorageTexelBuffer: return "StorageTexelBuffer"; - case FormatFeatureFlagBits::eStorageTexelBufferAtomic: return "StorageTexelBufferAtomic"; - case FormatFeatureFlagBits::eVertexBuffer: return "VertexBuffer"; - case FormatFeatureFlagBits::eColorAttachment: return "ColorAttachment"; - case FormatFeatureFlagBits::eColorAttachmentBlend: return "ColorAttachmentBlend"; - case FormatFeatureFlagBits::eDepthStencilAttachment: return "DepthStencilAttachment"; - case FormatFeatureFlagBits::eBlitSrc: return "BlitSrc"; - case FormatFeatureFlagBits::eBlitDst: return "BlitDst"; - case FormatFeatureFlagBits::eSampledImageFilterLinear: return "SampledImageFilterLinear"; - case FormatFeatureFlagBits::eTransferSrc: return "TransferSrc"; - case FormatFeatureFlagBits::eTransferDst: return "TransferDst"; - case FormatFeatureFlagBits::eMidpointChromaSamples: return "MidpointChromaSamples"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionLinearFilter: return "SampledImageYcbcrConversionLinearFilter"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionSeparateReconstructionFilter: return "SampledImageYcbcrConversionSeparateReconstructionFilter"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicit: return "SampledImageYcbcrConversionChromaReconstructionExplicit"; - case FormatFeatureFlagBits::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable: - return "SampledImageYcbcrConversionChromaReconstructionExplicitForceable"; - case FormatFeatureFlagBits::eDisjoint: return "Disjoint"; - case FormatFeatureFlagBits::eCositedChromaSamples: return "CositedChromaSamples"; - case FormatFeatureFlagBits::eSampledImageFilterMinmax: return "SampledImageFilterMinmax"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case FormatFeatureFlagBits::eVideoDecodeOutputKHR: return "VideoDecodeOutputKHR"; - case FormatFeatureFlagBits::eVideoDecodeDpbKHR: return "VideoDecodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case FormatFeatureFlagBits::eAccelerationStructureVertexBufferKHR: return "AccelerationStructureVertexBufferKHR"; - case FormatFeatureFlagBits::eSampledImageFilterCubicEXT: return "SampledImageFilterCubicEXT"; - case FormatFeatureFlagBits::eFragmentDensityMapEXT: return "FragmentDensityMapEXT"; - case FormatFeatureFlagBits::eFragmentShadingRateAttachmentKHR: return "FragmentShadingRateAttachmentKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case FormatFeatureFlagBits::eVideoEncodeInputKHR: return "VideoEncodeInputKHR"; - case FormatFeatureFlagBits::eVideoEncodeDpbKHR: return "VideoEncodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageCreateFlagBits value ) - { - switch ( value ) - { - case ImageCreateFlagBits::eSparseBinding: return "SparseBinding"; - case ImageCreateFlagBits::eSparseResidency: return "SparseResidency"; - case ImageCreateFlagBits::eSparseAliased: return "SparseAliased"; - case ImageCreateFlagBits::eMutableFormat: return "MutableFormat"; - case ImageCreateFlagBits::eCubeCompatible: return "CubeCompatible"; - case ImageCreateFlagBits::eAlias: return "Alias"; - case ImageCreateFlagBits::eSplitInstanceBindRegions: return "SplitInstanceBindRegions"; - case ImageCreateFlagBits::e2DArrayCompatible: return "2DArrayCompatible"; - case ImageCreateFlagBits::eBlockTexelViewCompatible: return "BlockTexelViewCompatible"; - case ImageCreateFlagBits::eExtendedUsage: return "ExtendedUsage"; - case ImageCreateFlagBits::eProtected: return "Protected"; - case ImageCreateFlagBits::eDisjoint: return "Disjoint"; - case ImageCreateFlagBits::eCornerSampledNV: return "CornerSampledNV"; - case ImageCreateFlagBits::eSampleLocationsCompatibleDepthEXT: return "SampleLocationsCompatibleDepthEXT"; - case ImageCreateFlagBits::eSubsampledEXT: return "SubsampledEXT"; - case ImageCreateFlagBits::eMultisampledRenderToSingleSampledEXT: return "MultisampledRenderToSingleSampledEXT"; - case ImageCreateFlagBits::e2DViewCompatibleEXT: return "2DViewCompatibleEXT"; - case ImageCreateFlagBits::eFragmentDensityMapOffsetQCOM: return "FragmentDensityMapOffsetQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageTiling value ) - { - switch ( value ) - { - case ImageTiling::eOptimal: return "Optimal"; - case ImageTiling::eLinear: return "Linear"; - case ImageTiling::eDrmFormatModifierEXT: return "DrmFormatModifierEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageType value ) - { - switch ( value ) - { - case ImageType::e1D: return "1D"; - case ImageType::e2D: return "2D"; - case ImageType::e3D: return "3D"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageUsageFlagBits value ) - { - switch ( value ) - { - case ImageUsageFlagBits::eTransferSrc: return "TransferSrc"; - case ImageUsageFlagBits::eTransferDst: return "TransferDst"; - case ImageUsageFlagBits::eSampled: return "Sampled"; - case ImageUsageFlagBits::eStorage: return "Storage"; - case ImageUsageFlagBits::eColorAttachment: return "ColorAttachment"; - case ImageUsageFlagBits::eDepthStencilAttachment: return "DepthStencilAttachment"; - case ImageUsageFlagBits::eTransientAttachment: return "TransientAttachment"; - case ImageUsageFlagBits::eInputAttachment: return "InputAttachment"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case ImageUsageFlagBits::eVideoDecodeDstKHR: return "VideoDecodeDstKHR"; - case ImageUsageFlagBits::eVideoDecodeSrcKHR: return "VideoDecodeSrcKHR"; - case ImageUsageFlagBits::eVideoDecodeDpbKHR: return "VideoDecodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case ImageUsageFlagBits::eFragmentDensityMapEXT: return "FragmentDensityMapEXT"; - case ImageUsageFlagBits::eFragmentShadingRateAttachmentKHR: return "FragmentShadingRateAttachmentKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case ImageUsageFlagBits::eVideoEncodeDstKHR: return "VideoEncodeDstKHR"; - case ImageUsageFlagBits::eVideoEncodeSrcKHR: return "VideoEncodeSrcKHR"; - case ImageUsageFlagBits::eVideoEncodeDpbKHR: return "VideoEncodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case ImageUsageFlagBits::eAttachmentFeedbackLoopEXT: return "AttachmentFeedbackLoopEXT"; - case ImageUsageFlagBits::eInvocationMaskHUAWEI: return "InvocationMaskHUAWEI"; - case ImageUsageFlagBits::eSampleWeightQCOM: return "SampleWeightQCOM"; - case ImageUsageFlagBits::eSampleBlockMatchQCOM: return "SampleBlockMatchQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( InstanceCreateFlagBits value ) - { - switch ( value ) - { - case InstanceCreateFlagBits::eEnumeratePortabilityKHR: return "EnumeratePortabilityKHR"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( InternalAllocationType value ) - { - switch ( value ) - { - case InternalAllocationType::eExecutable: return "Executable"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( MemoryHeapFlagBits value ) - { - switch ( value ) - { - case MemoryHeapFlagBits::eDeviceLocal: return "DeviceLocal"; - case MemoryHeapFlagBits::eMultiInstance: return "MultiInstance"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( MemoryPropertyFlagBits value ) - { - switch ( value ) - { - case MemoryPropertyFlagBits::eDeviceLocal: return "DeviceLocal"; - case MemoryPropertyFlagBits::eHostVisible: return "HostVisible"; - case MemoryPropertyFlagBits::eHostCoherent: return "HostCoherent"; - case MemoryPropertyFlagBits::eHostCached: return "HostCached"; - case MemoryPropertyFlagBits::eLazilyAllocated: return "LazilyAllocated"; - case MemoryPropertyFlagBits::eProtected: return "Protected"; - case MemoryPropertyFlagBits::eDeviceCoherentAMD: return "DeviceCoherentAMD"; - case MemoryPropertyFlagBits::eDeviceUncachedAMD: return "DeviceUncachedAMD"; - case MemoryPropertyFlagBits::eRdmaCapableNV: return "RdmaCapableNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PhysicalDeviceType value ) - { - switch ( value ) - { - case PhysicalDeviceType::eOther: return "Other"; - case PhysicalDeviceType::eIntegratedGpu: return "IntegratedGpu"; - case PhysicalDeviceType::eDiscreteGpu: return "DiscreteGpu"; - case PhysicalDeviceType::eVirtualGpu: return "VirtualGpu"; - case PhysicalDeviceType::eCpu: return "Cpu"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueueFlagBits value ) - { - switch ( value ) - { - case QueueFlagBits::eGraphics: return "Graphics"; - case QueueFlagBits::eCompute: return "Compute"; - case QueueFlagBits::eTransfer: return "Transfer"; - case QueueFlagBits::eSparseBinding: return "SparseBinding"; - case QueueFlagBits::eProtected: return "Protected"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case QueueFlagBits::eVideoDecodeKHR: return "VideoDecodeKHR"; - case QueueFlagBits::eVideoEncodeKHR: return "VideoEncodeKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SampleCountFlagBits value ) - { - switch ( value ) - { - case SampleCountFlagBits::e1: return "1"; - case SampleCountFlagBits::e2: return "2"; - case SampleCountFlagBits::e4: return "4"; - case SampleCountFlagBits::e8: return "8"; - case SampleCountFlagBits::e16: return "16"; - case SampleCountFlagBits::e32: return "32"; - case SampleCountFlagBits::e64: return "64"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SystemAllocationScope value ) - { - switch ( value ) - { - case SystemAllocationScope::eCommand: return "Command"; - case SystemAllocationScope::eObject: return "Object"; - case SystemAllocationScope::eCache: return "Cache"; - case SystemAllocationScope::eDevice: return "Device"; - case SystemAllocationScope::eInstance: return "Instance"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DeviceCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineStageFlagBits value ) - { - switch ( value ) - { - case PipelineStageFlagBits::eTopOfPipe: return "TopOfPipe"; - case PipelineStageFlagBits::eDrawIndirect: return "DrawIndirect"; - case PipelineStageFlagBits::eVertexInput: return "VertexInput"; - case PipelineStageFlagBits::eVertexShader: return "VertexShader"; - case PipelineStageFlagBits::eTessellationControlShader: return "TessellationControlShader"; - case PipelineStageFlagBits::eTessellationEvaluationShader: return "TessellationEvaluationShader"; - case PipelineStageFlagBits::eGeometryShader: return "GeometryShader"; - case PipelineStageFlagBits::eFragmentShader: return "FragmentShader"; - case PipelineStageFlagBits::eEarlyFragmentTests: return "EarlyFragmentTests"; - case PipelineStageFlagBits::eLateFragmentTests: return "LateFragmentTests"; - case PipelineStageFlagBits::eColorAttachmentOutput: return "ColorAttachmentOutput"; - case PipelineStageFlagBits::eComputeShader: return "ComputeShader"; - case PipelineStageFlagBits::eTransfer: return "Transfer"; - case PipelineStageFlagBits::eBottomOfPipe: return "BottomOfPipe"; - case PipelineStageFlagBits::eHost: return "Host"; - case PipelineStageFlagBits::eAllGraphics: return "AllGraphics"; - case PipelineStageFlagBits::eAllCommands: return "AllCommands"; - case PipelineStageFlagBits::eNone: return "None"; - case PipelineStageFlagBits::eTransformFeedbackEXT: return "TransformFeedbackEXT"; - case PipelineStageFlagBits::eConditionalRenderingEXT: return "ConditionalRenderingEXT"; - case PipelineStageFlagBits::eAccelerationStructureBuildKHR: return "AccelerationStructureBuildKHR"; - case PipelineStageFlagBits::eRayTracingShaderKHR: return "RayTracingShaderKHR"; - case PipelineStageFlagBits::eFragmentDensityProcessEXT: return "FragmentDensityProcessEXT"; - case PipelineStageFlagBits::eFragmentShadingRateAttachmentKHR: return "FragmentShadingRateAttachmentKHR"; - case PipelineStageFlagBits::eCommandPreprocessNV: return "CommandPreprocessNV"; - case PipelineStageFlagBits::eTaskShaderEXT: return "TaskShaderEXT"; - case PipelineStageFlagBits::eMeshShaderEXT: return "MeshShaderEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( MemoryMapFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageAspectFlagBits value ) - { - switch ( value ) - { - case ImageAspectFlagBits::eColor: return "Color"; - case ImageAspectFlagBits::eDepth: return "Depth"; - case ImageAspectFlagBits::eStencil: return "Stencil"; - case ImageAspectFlagBits::eMetadata: return "Metadata"; - case ImageAspectFlagBits::ePlane0: return "Plane0"; - case ImageAspectFlagBits::ePlane1: return "Plane1"; - case ImageAspectFlagBits::ePlane2: return "Plane2"; - case ImageAspectFlagBits::eNone: return "None"; - case ImageAspectFlagBits::eMemoryPlane0EXT: return "MemoryPlane0EXT"; - case ImageAspectFlagBits::eMemoryPlane1EXT: return "MemoryPlane1EXT"; - case ImageAspectFlagBits::eMemoryPlane2EXT: return "MemoryPlane2EXT"; - case ImageAspectFlagBits::eMemoryPlane3EXT: return "MemoryPlane3EXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SparseImageFormatFlagBits value ) - { - switch ( value ) - { - case SparseImageFormatFlagBits::eSingleMiptail: return "SingleMiptail"; - case SparseImageFormatFlagBits::eAlignedMipSize: return "AlignedMipSize"; - case SparseImageFormatFlagBits::eNonstandardBlockSize: return "NonstandardBlockSize"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SparseMemoryBindFlagBits value ) - { - switch ( value ) - { - case SparseMemoryBindFlagBits::eMetadata: return "Metadata"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FenceCreateFlagBits value ) - { - switch ( value ) - { - case FenceCreateFlagBits::eSignaled: return "Signaled"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( EventCreateFlagBits value ) - { - switch ( value ) - { - case EventCreateFlagBits::eDeviceOnly: return "DeviceOnly"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryPipelineStatisticFlagBits value ) - { - switch ( value ) - { - case QueryPipelineStatisticFlagBits::eInputAssemblyVertices: return "InputAssemblyVertices"; - case QueryPipelineStatisticFlagBits::eInputAssemblyPrimitives: return "InputAssemblyPrimitives"; - case QueryPipelineStatisticFlagBits::eVertexShaderInvocations: return "VertexShaderInvocations"; - case QueryPipelineStatisticFlagBits::eGeometryShaderInvocations: return "GeometryShaderInvocations"; - case QueryPipelineStatisticFlagBits::eGeometryShaderPrimitives: return "GeometryShaderPrimitives"; - case QueryPipelineStatisticFlagBits::eClippingInvocations: return "ClippingInvocations"; - case QueryPipelineStatisticFlagBits::eClippingPrimitives: return "ClippingPrimitives"; - case QueryPipelineStatisticFlagBits::eFragmentShaderInvocations: return "FragmentShaderInvocations"; - case QueryPipelineStatisticFlagBits::eTessellationControlShaderPatches: return "TessellationControlShaderPatches"; - case QueryPipelineStatisticFlagBits::eTessellationEvaluationShaderInvocations: return "TessellationEvaluationShaderInvocations"; - case QueryPipelineStatisticFlagBits::eComputeShaderInvocations: return "ComputeShaderInvocations"; - case QueryPipelineStatisticFlagBits::eTaskShaderInvocationsEXT: return "TaskShaderInvocationsEXT"; - case QueryPipelineStatisticFlagBits::eMeshShaderInvocationsEXT: return "MeshShaderInvocationsEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryResultFlagBits value ) - { - switch ( value ) - { - case QueryResultFlagBits::e64: return "64"; - case QueryResultFlagBits::eWait: return "Wait"; - case QueryResultFlagBits::eWithAvailability: return "WithAvailability"; - case QueryResultFlagBits::ePartial: return "Partial"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case QueryResultFlagBits::eWithStatusKHR: return "WithStatusKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryType value ) - { - switch ( value ) - { - case QueryType::eOcclusion: return "Occlusion"; - case QueryType::ePipelineStatistics: return "PipelineStatistics"; - case QueryType::eTimestamp: return "Timestamp"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case QueryType::eResultStatusOnlyKHR: return "ResultStatusOnlyKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case QueryType::eTransformFeedbackStreamEXT: return "TransformFeedbackStreamEXT"; - case QueryType::ePerformanceQueryKHR: return "PerformanceQueryKHR"; - case QueryType::eAccelerationStructureCompactedSizeKHR: return "AccelerationStructureCompactedSizeKHR"; - case QueryType::eAccelerationStructureSerializationSizeKHR: return "AccelerationStructureSerializationSizeKHR"; - case QueryType::eAccelerationStructureCompactedSizeNV: return "AccelerationStructureCompactedSizeNV"; - case QueryType::ePerformanceQueryINTEL: return "PerformanceQueryINTEL"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case QueryType::eVideoEncodeBitstreamBufferRangeKHR: return "VideoEncodeBitstreamBufferRangeKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case QueryType::eMeshPrimitivesGeneratedEXT: return "MeshPrimitivesGeneratedEXT"; - case QueryType::ePrimitivesGeneratedEXT: return "PrimitivesGeneratedEXT"; - case QueryType::eAccelerationStructureSerializationBottomLevelPointersKHR: return "AccelerationStructureSerializationBottomLevelPointersKHR"; - case QueryType::eAccelerationStructureSizeKHR: return "AccelerationStructureSizeKHR"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryPoolCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( BufferCreateFlagBits value ) - { - switch ( value ) - { - case BufferCreateFlagBits::eSparseBinding: return "SparseBinding"; - case BufferCreateFlagBits::eSparseResidency: return "SparseResidency"; - case BufferCreateFlagBits::eSparseAliased: return "SparseAliased"; - case BufferCreateFlagBits::eProtected: return "Protected"; - case BufferCreateFlagBits::eDeviceAddressCaptureReplay: return "DeviceAddressCaptureReplay"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( BufferUsageFlagBits value ) - { - switch ( value ) - { - case BufferUsageFlagBits::eTransferSrc: return "TransferSrc"; - case BufferUsageFlagBits::eTransferDst: return "TransferDst"; - case BufferUsageFlagBits::eUniformTexelBuffer: return "UniformTexelBuffer"; - case BufferUsageFlagBits::eStorageTexelBuffer: return "StorageTexelBuffer"; - case BufferUsageFlagBits::eUniformBuffer: return "UniformBuffer"; - case BufferUsageFlagBits::eStorageBuffer: return "StorageBuffer"; - case BufferUsageFlagBits::eIndexBuffer: return "IndexBuffer"; - case BufferUsageFlagBits::eVertexBuffer: return "VertexBuffer"; - case BufferUsageFlagBits::eIndirectBuffer: return "IndirectBuffer"; - case BufferUsageFlagBits::eShaderDeviceAddress: return "ShaderDeviceAddress"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case BufferUsageFlagBits::eVideoDecodeSrcKHR: return "VideoDecodeSrcKHR"; - case BufferUsageFlagBits::eVideoDecodeDstKHR: return "VideoDecodeDstKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case BufferUsageFlagBits::eTransformFeedbackBufferEXT: return "TransformFeedbackBufferEXT"; - case BufferUsageFlagBits::eTransformFeedbackCounterBufferEXT: return "TransformFeedbackCounterBufferEXT"; - case BufferUsageFlagBits::eConditionalRenderingEXT: return "ConditionalRenderingEXT"; - case BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR: return "AccelerationStructureBuildInputReadOnlyKHR"; - case BufferUsageFlagBits::eAccelerationStructureStorageKHR: return "AccelerationStructureStorageKHR"; - case BufferUsageFlagBits::eShaderBindingTableKHR: return "ShaderBindingTableKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case BufferUsageFlagBits::eVideoEncodeDstKHR: return "VideoEncodeDstKHR"; - case BufferUsageFlagBits::eVideoEncodeSrcKHR: return "VideoEncodeSrcKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SharingMode value ) - { - switch ( value ) - { - case SharingMode::eExclusive: return "Exclusive"; - case SharingMode::eConcurrent: return "Concurrent"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( BufferViewCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( ImageLayout value ) - { - switch ( value ) - { - case ImageLayout::eUndefined: return "Undefined"; - case ImageLayout::eGeneral: return "General"; - case ImageLayout::eColorAttachmentOptimal: return "ColorAttachmentOptimal"; - case ImageLayout::eDepthStencilAttachmentOptimal: return "DepthStencilAttachmentOptimal"; - case ImageLayout::eDepthStencilReadOnlyOptimal: return "DepthStencilReadOnlyOptimal"; - case ImageLayout::eShaderReadOnlyOptimal: return "ShaderReadOnlyOptimal"; - case ImageLayout::eTransferSrcOptimal: return "TransferSrcOptimal"; - case ImageLayout::eTransferDstOptimal: return "TransferDstOptimal"; - case ImageLayout::ePreinitialized: return "Preinitialized"; - case ImageLayout::eDepthReadOnlyStencilAttachmentOptimal: return "DepthReadOnlyStencilAttachmentOptimal"; - case ImageLayout::eDepthAttachmentStencilReadOnlyOptimal: return "DepthAttachmentStencilReadOnlyOptimal"; - case ImageLayout::eDepthAttachmentOptimal: return "DepthAttachmentOptimal"; - case ImageLayout::eDepthReadOnlyOptimal: return "DepthReadOnlyOptimal"; - case ImageLayout::eStencilAttachmentOptimal: return "StencilAttachmentOptimal"; - case ImageLayout::eStencilReadOnlyOptimal: return "StencilReadOnlyOptimal"; - case ImageLayout::eReadOnlyOptimal: return "ReadOnlyOptimal"; - case ImageLayout::eAttachmentOptimal: return "AttachmentOptimal"; - case ImageLayout::ePresentSrcKHR: return "PresentSrcKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case ImageLayout::eVideoDecodeDstKHR: return "VideoDecodeDstKHR"; - case ImageLayout::eVideoDecodeSrcKHR: return "VideoDecodeSrcKHR"; - case ImageLayout::eVideoDecodeDpbKHR: return "VideoDecodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case ImageLayout::eSharedPresentKHR: return "SharedPresentKHR"; - case ImageLayout::eFragmentDensityMapOptimalEXT: return "FragmentDensityMapOptimalEXT"; - case ImageLayout::eFragmentShadingRateAttachmentOptimalKHR: return "FragmentShadingRateAttachmentOptimalKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case ImageLayout::eVideoEncodeDstKHR: return "VideoEncodeDstKHR"; - case ImageLayout::eVideoEncodeSrcKHR: return "VideoEncodeSrcKHR"; - case ImageLayout::eVideoEncodeDpbKHR: return "VideoEncodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case ImageLayout::eAttachmentFeedbackLoopOptimalEXT: return "AttachmentFeedbackLoopOptimalEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ComponentSwizzle value ) - { - switch ( value ) - { - case ComponentSwizzle::eIdentity: return "Identity"; - case ComponentSwizzle::eZero: return "Zero"; - case ComponentSwizzle::eOne: return "One"; - case ComponentSwizzle::eR: return "R"; - case ComponentSwizzle::eG: return "G"; - case ComponentSwizzle::eB: return "B"; - case ComponentSwizzle::eA: return "A"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageViewCreateFlagBits value ) - { - switch ( value ) - { - case ImageViewCreateFlagBits::eFragmentDensityMapDynamicEXT: return "FragmentDensityMapDynamicEXT"; - case ImageViewCreateFlagBits::eFragmentDensityMapDeferredEXT: return "FragmentDensityMapDeferredEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageViewType value ) - { - switch ( value ) - { - case ImageViewType::e1D: return "1D"; - case ImageViewType::e2D: return "2D"; - case ImageViewType::e3D: return "3D"; - case ImageViewType::eCube: return "Cube"; - case ImageViewType::e1DArray: return "1DArray"; - case ImageViewType::e2DArray: return "2DArray"; - case ImageViewType::eCubeArray: return "CubeArray"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ShaderModuleCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( BlendFactor value ) - { - switch ( value ) - { - case BlendFactor::eZero: return "Zero"; - case BlendFactor::eOne: return "One"; - case BlendFactor::eSrcColor: return "SrcColor"; - case BlendFactor::eOneMinusSrcColor: return "OneMinusSrcColor"; - case BlendFactor::eDstColor: return "DstColor"; - case BlendFactor::eOneMinusDstColor: return "OneMinusDstColor"; - case BlendFactor::eSrcAlpha: return "SrcAlpha"; - case BlendFactor::eOneMinusSrcAlpha: return "OneMinusSrcAlpha"; - case BlendFactor::eDstAlpha: return "DstAlpha"; - case BlendFactor::eOneMinusDstAlpha: return "OneMinusDstAlpha"; - case BlendFactor::eConstantColor: return "ConstantColor"; - case BlendFactor::eOneMinusConstantColor: return "OneMinusConstantColor"; - case BlendFactor::eConstantAlpha: return "ConstantAlpha"; - case BlendFactor::eOneMinusConstantAlpha: return "OneMinusConstantAlpha"; - case BlendFactor::eSrcAlphaSaturate: return "SrcAlphaSaturate"; - case BlendFactor::eSrc1Color: return "Src1Color"; - case BlendFactor::eOneMinusSrc1Color: return "OneMinusSrc1Color"; - case BlendFactor::eSrc1Alpha: return "Src1Alpha"; - case BlendFactor::eOneMinusSrc1Alpha: return "OneMinusSrc1Alpha"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( BlendOp value ) - { - switch ( value ) - { - case BlendOp::eAdd: return "Add"; - case BlendOp::eSubtract: return "Subtract"; - case BlendOp::eReverseSubtract: return "ReverseSubtract"; - case BlendOp::eMin: return "Min"; - case BlendOp::eMax: return "Max"; - case BlendOp::eZeroEXT: return "ZeroEXT"; - case BlendOp::eSrcEXT: return "SrcEXT"; - case BlendOp::eDstEXT: return "DstEXT"; - case BlendOp::eSrcOverEXT: return "SrcOverEXT"; - case BlendOp::eDstOverEXT: return "DstOverEXT"; - case BlendOp::eSrcInEXT: return "SrcInEXT"; - case BlendOp::eDstInEXT: return "DstInEXT"; - case BlendOp::eSrcOutEXT: return "SrcOutEXT"; - case BlendOp::eDstOutEXT: return "DstOutEXT"; - case BlendOp::eSrcAtopEXT: return "SrcAtopEXT"; - case BlendOp::eDstAtopEXT: return "DstAtopEXT"; - case BlendOp::eXorEXT: return "XorEXT"; - case BlendOp::eMultiplyEXT: return "MultiplyEXT"; - case BlendOp::eScreenEXT: return "ScreenEXT"; - case BlendOp::eOverlayEXT: return "OverlayEXT"; - case BlendOp::eDarkenEXT: return "DarkenEXT"; - case BlendOp::eLightenEXT: return "LightenEXT"; - case BlendOp::eColordodgeEXT: return "ColordodgeEXT"; - case BlendOp::eColorburnEXT: return "ColorburnEXT"; - case BlendOp::eHardlightEXT: return "HardlightEXT"; - case BlendOp::eSoftlightEXT: return "SoftlightEXT"; - case BlendOp::eDifferenceEXT: return "DifferenceEXT"; - case BlendOp::eExclusionEXT: return "ExclusionEXT"; - case BlendOp::eInvertEXT: return "InvertEXT"; - case BlendOp::eInvertRgbEXT: return "InvertRgbEXT"; - case BlendOp::eLineardodgeEXT: return "LineardodgeEXT"; - case BlendOp::eLinearburnEXT: return "LinearburnEXT"; - case BlendOp::eVividlightEXT: return "VividlightEXT"; - case BlendOp::eLinearlightEXT: return "LinearlightEXT"; - case BlendOp::ePinlightEXT: return "PinlightEXT"; - case BlendOp::eHardmixEXT: return "HardmixEXT"; - case BlendOp::eHslHueEXT: return "HslHueEXT"; - case BlendOp::eHslSaturationEXT: return "HslSaturationEXT"; - case BlendOp::eHslColorEXT: return "HslColorEXT"; - case BlendOp::eHslLuminosityEXT: return "HslLuminosityEXT"; - case BlendOp::ePlusEXT: return "PlusEXT"; - case BlendOp::ePlusClampedEXT: return "PlusClampedEXT"; - case BlendOp::ePlusClampedAlphaEXT: return "PlusClampedAlphaEXT"; - case BlendOp::ePlusDarkerEXT: return "PlusDarkerEXT"; - case BlendOp::eMinusEXT: return "MinusEXT"; - case BlendOp::eMinusClampedEXT: return "MinusClampedEXT"; - case BlendOp::eContrastEXT: return "ContrastEXT"; - case BlendOp::eInvertOvgEXT: return "InvertOvgEXT"; - case BlendOp::eRedEXT: return "RedEXT"; - case BlendOp::eGreenEXT: return "GreenEXT"; - case BlendOp::eBlueEXT: return "BlueEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ColorComponentFlagBits value ) - { - switch ( value ) - { - case ColorComponentFlagBits::eR: return "R"; - case ColorComponentFlagBits::eG: return "G"; - case ColorComponentFlagBits::eB: return "B"; - case ColorComponentFlagBits::eA: return "A"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CompareOp value ) - { - switch ( value ) - { - case CompareOp::eNever: return "Never"; - case CompareOp::eLess: return "Less"; - case CompareOp::eEqual: return "Equal"; - case CompareOp::eLessOrEqual: return "LessOrEqual"; - case CompareOp::eGreater: return "Greater"; - case CompareOp::eNotEqual: return "NotEqual"; - case CompareOp::eGreaterOrEqual: return "GreaterOrEqual"; - case CompareOp::eAlways: return "Always"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CullModeFlagBits value ) - { - switch ( value ) - { - case CullModeFlagBits::eNone: return "None"; - case CullModeFlagBits::eFront: return "Front"; - case CullModeFlagBits::eBack: return "Back"; - case CullModeFlagBits::eFrontAndBack: return "FrontAndBack"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DynamicState value ) - { - switch ( value ) - { - case DynamicState::eViewport: return "Viewport"; - case DynamicState::eScissor: return "Scissor"; - case DynamicState::eLineWidth: return "LineWidth"; - case DynamicState::eDepthBias: return "DepthBias"; - case DynamicState::eBlendConstants: return "BlendConstants"; - case DynamicState::eDepthBounds: return "DepthBounds"; - case DynamicState::eStencilCompareMask: return "StencilCompareMask"; - case DynamicState::eStencilWriteMask: return "StencilWriteMask"; - case DynamicState::eStencilReference: return "StencilReference"; - case DynamicState::eCullMode: return "CullMode"; - case DynamicState::eFrontFace: return "FrontFace"; - case DynamicState::ePrimitiveTopology: return "PrimitiveTopology"; - case DynamicState::eViewportWithCount: return "ViewportWithCount"; - case DynamicState::eScissorWithCount: return "ScissorWithCount"; - case DynamicState::eVertexInputBindingStride: return "VertexInputBindingStride"; - case DynamicState::eDepthTestEnable: return "DepthTestEnable"; - case DynamicState::eDepthWriteEnable: return "DepthWriteEnable"; - case DynamicState::eDepthCompareOp: return "DepthCompareOp"; - case DynamicState::eDepthBoundsTestEnable: return "DepthBoundsTestEnable"; - case DynamicState::eStencilTestEnable: return "StencilTestEnable"; - case DynamicState::eStencilOp: return "StencilOp"; - case DynamicState::eRasterizerDiscardEnable: return "RasterizerDiscardEnable"; - case DynamicState::eDepthBiasEnable: return "DepthBiasEnable"; - case DynamicState::ePrimitiveRestartEnable: return "PrimitiveRestartEnable"; - case DynamicState::eViewportWScalingNV: return "ViewportWScalingNV"; - case DynamicState::eDiscardRectangleEXT: return "DiscardRectangleEXT"; - case DynamicState::eSampleLocationsEXT: return "SampleLocationsEXT"; - case DynamicState::eRayTracingPipelineStackSizeKHR: return "RayTracingPipelineStackSizeKHR"; - case DynamicState::eViewportShadingRatePaletteNV: return "ViewportShadingRatePaletteNV"; - case DynamicState::eViewportCoarseSampleOrderNV: return "ViewportCoarseSampleOrderNV"; - case DynamicState::eExclusiveScissorNV: return "ExclusiveScissorNV"; - case DynamicState::eFragmentShadingRateKHR: return "FragmentShadingRateKHR"; - case DynamicState::eLineStippleEXT: return "LineStippleEXT"; - case DynamicState::eVertexInputEXT: return "VertexInputEXT"; - case DynamicState::ePatchControlPointsEXT: return "PatchControlPointsEXT"; - case DynamicState::eLogicOpEXT: return "LogicOpEXT"; - case DynamicState::eColorWriteEnableEXT: return "ColorWriteEnableEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FrontFace value ) - { - switch ( value ) - { - case FrontFace::eCounterClockwise: return "CounterClockwise"; - case FrontFace::eClockwise: return "Clockwise"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( LogicOp value ) - { - switch ( value ) - { - case LogicOp::eClear: return "Clear"; - case LogicOp::eAnd: return "And"; - case LogicOp::eAndReverse: return "AndReverse"; - case LogicOp::eCopy: return "Copy"; - case LogicOp::eAndInverted: return "AndInverted"; - case LogicOp::eNoOp: return "NoOp"; - case LogicOp::eXor: return "Xor"; - case LogicOp::eOr: return "Or"; - case LogicOp::eNor: return "Nor"; - case LogicOp::eEquivalent: return "Equivalent"; - case LogicOp::eInvert: return "Invert"; - case LogicOp::eOrReverse: return "OrReverse"; - case LogicOp::eCopyInverted: return "CopyInverted"; - case LogicOp::eOrInverted: return "OrInverted"; - case LogicOp::eNand: return "Nand"; - case LogicOp::eSet: return "Set"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCreateFlagBits value ) - { - switch ( value ) - { - case PipelineCreateFlagBits::eDisableOptimization: return "DisableOptimization"; - case PipelineCreateFlagBits::eAllowDerivatives: return "AllowDerivatives"; - case PipelineCreateFlagBits::eDerivative: return "Derivative"; - case PipelineCreateFlagBits::eViewIndexFromDeviceIndex: return "ViewIndexFromDeviceIndex"; - case PipelineCreateFlagBits::eDispatchBase: return "DispatchBase"; - case PipelineCreateFlagBits::eFailOnPipelineCompileRequired: return "FailOnPipelineCompileRequired"; - case PipelineCreateFlagBits::eEarlyReturnOnFailure: return "EarlyReturnOnFailure"; - case PipelineCreateFlagBits::eRenderingFragmentShadingRateAttachmentKHR: return "RenderingFragmentShadingRateAttachmentKHR"; - case PipelineCreateFlagBits::eRenderingFragmentDensityMapAttachmentEXT: return "RenderingFragmentDensityMapAttachmentEXT"; - case PipelineCreateFlagBits::eRayTracingNoNullAnyHitShadersKHR: return "RayTracingNoNullAnyHitShadersKHR"; - case PipelineCreateFlagBits::eRayTracingNoNullClosestHitShadersKHR: return "RayTracingNoNullClosestHitShadersKHR"; - case PipelineCreateFlagBits::eRayTracingNoNullMissShadersKHR: return "RayTracingNoNullMissShadersKHR"; - case PipelineCreateFlagBits::eRayTracingNoNullIntersectionShadersKHR: return "RayTracingNoNullIntersectionShadersKHR"; - case PipelineCreateFlagBits::eRayTracingSkipTrianglesKHR: return "RayTracingSkipTrianglesKHR"; - case PipelineCreateFlagBits::eRayTracingSkipAabbsKHR: return "RayTracingSkipAabbsKHR"; - case PipelineCreateFlagBits::eRayTracingShaderGroupHandleCaptureReplayKHR: return "RayTracingShaderGroupHandleCaptureReplayKHR"; - case PipelineCreateFlagBits::eDeferCompileNV: return "DeferCompileNV"; - case PipelineCreateFlagBits::eCaptureStatisticsKHR: return "CaptureStatisticsKHR"; - case PipelineCreateFlagBits::eCaptureInternalRepresentationsKHR: return "CaptureInternalRepresentationsKHR"; - case PipelineCreateFlagBits::eIndirectBindableNV: return "IndirectBindableNV"; - case PipelineCreateFlagBits::eLibraryKHR: return "LibraryKHR"; - case PipelineCreateFlagBits::eRetainLinkTimeOptimizationInfoEXT: return "RetainLinkTimeOptimizationInfoEXT"; - case PipelineCreateFlagBits::eLinkTimeOptimizationEXT: return "LinkTimeOptimizationEXT"; - case PipelineCreateFlagBits::eRayTracingAllowMotionNV: return "RayTracingAllowMotionNV"; - case PipelineCreateFlagBits::eColorAttachmentFeedbackLoopEXT: return "ColorAttachmentFeedbackLoopEXT"; - case PipelineCreateFlagBits::eDepthStencilAttachmentFeedbackLoopEXT: return "DepthStencilAttachmentFeedbackLoopEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineShaderStageCreateFlagBits value ) - { - switch ( value ) - { - case PipelineShaderStageCreateFlagBits::eAllowVaryingSubgroupSize: return "AllowVaryingSubgroupSize"; - case PipelineShaderStageCreateFlagBits::eRequireFullSubgroups: return "RequireFullSubgroups"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PolygonMode value ) - { - switch ( value ) - { - case PolygonMode::eFill: return "Fill"; - case PolygonMode::eLine: return "Line"; - case PolygonMode::ePoint: return "Point"; - case PolygonMode::eFillRectangleNV: return "FillRectangleNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PrimitiveTopology value ) - { - switch ( value ) - { - case PrimitiveTopology::ePointList: return "PointList"; - case PrimitiveTopology::eLineList: return "LineList"; - case PrimitiveTopology::eLineStrip: return "LineStrip"; - case PrimitiveTopology::eTriangleList: return "TriangleList"; - case PrimitiveTopology::eTriangleStrip: return "TriangleStrip"; - case PrimitiveTopology::eTriangleFan: return "TriangleFan"; - case PrimitiveTopology::eLineListWithAdjacency: return "LineListWithAdjacency"; - case PrimitiveTopology::eLineStripWithAdjacency: return "LineStripWithAdjacency"; - case PrimitiveTopology::eTriangleListWithAdjacency: return "TriangleListWithAdjacency"; - case PrimitiveTopology::eTriangleStripWithAdjacency: return "TriangleStripWithAdjacency"; - case PrimitiveTopology::ePatchList: return "PatchList"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ShaderStageFlagBits value ) - { - switch ( value ) - { - case ShaderStageFlagBits::eVertex: return "Vertex"; - case ShaderStageFlagBits::eTessellationControl: return "TessellationControl"; - case ShaderStageFlagBits::eTessellationEvaluation: return "TessellationEvaluation"; - case ShaderStageFlagBits::eGeometry: return "Geometry"; - case ShaderStageFlagBits::eFragment: return "Fragment"; - case ShaderStageFlagBits::eCompute: return "Compute"; - case ShaderStageFlagBits::eAllGraphics: return "AllGraphics"; - case ShaderStageFlagBits::eAll: return "All"; - case ShaderStageFlagBits::eRaygenKHR: return "RaygenKHR"; - case ShaderStageFlagBits::eAnyHitKHR: return "AnyHitKHR"; - case ShaderStageFlagBits::eClosestHitKHR: return "ClosestHitKHR"; - case ShaderStageFlagBits::eMissKHR: return "MissKHR"; - case ShaderStageFlagBits::eIntersectionKHR: return "IntersectionKHR"; - case ShaderStageFlagBits::eCallableKHR: return "CallableKHR"; - case ShaderStageFlagBits::eTaskEXT: return "TaskEXT"; - case ShaderStageFlagBits::eMeshEXT: return "MeshEXT"; - case ShaderStageFlagBits::eSubpassShadingHUAWEI: return "SubpassShadingHUAWEI"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( StencilOp value ) - { - switch ( value ) - { - case StencilOp::eKeep: return "Keep"; - case StencilOp::eZero: return "Zero"; - case StencilOp::eReplace: return "Replace"; - case StencilOp::eIncrementAndClamp: return "IncrementAndClamp"; - case StencilOp::eDecrementAndClamp: return "DecrementAndClamp"; - case StencilOp::eInvert: return "Invert"; - case StencilOp::eIncrementAndWrap: return "IncrementAndWrap"; - case StencilOp::eDecrementAndWrap: return "DecrementAndWrap"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VertexInputRate value ) - { - switch ( value ) - { - case VertexInputRate::eVertex: return "Vertex"; - case VertexInputRate::eInstance: return "Instance"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDynamicStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineInputAssemblyStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineMultisampleStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineTessellationStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineVertexInputStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineViewportStateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( BorderColor value ) - { - switch ( value ) - { - case BorderColor::eFloatTransparentBlack: return "FloatTransparentBlack"; - case BorderColor::eIntTransparentBlack: return "IntTransparentBlack"; - case BorderColor::eFloatOpaqueBlack: return "FloatOpaqueBlack"; - case BorderColor::eIntOpaqueBlack: return "IntOpaqueBlack"; - case BorderColor::eFloatOpaqueWhite: return "FloatOpaqueWhite"; - case BorderColor::eIntOpaqueWhite: return "IntOpaqueWhite"; - case BorderColor::eFloatCustomEXT: return "FloatCustomEXT"; - case BorderColor::eIntCustomEXT: return "IntCustomEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( Filter value ) - { - switch ( value ) - { - case Filter::eNearest: return "Nearest"; - case Filter::eLinear: return "Linear"; - case Filter::eCubicEXT: return "CubicEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerAddressMode value ) - { - switch ( value ) - { - case SamplerAddressMode::eRepeat: return "Repeat"; - case SamplerAddressMode::eMirroredRepeat: return "MirroredRepeat"; - case SamplerAddressMode::eClampToEdge: return "ClampToEdge"; - case SamplerAddressMode::eClampToBorder: return "ClampToBorder"; - case SamplerAddressMode::eMirrorClampToEdge: return "MirrorClampToEdge"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerCreateFlagBits value ) - { - switch ( value ) - { - case SamplerCreateFlagBits::eSubsampledEXT: return "SubsampledEXT"; - case SamplerCreateFlagBits::eSubsampledCoarseReconstructionEXT: return "SubsampledCoarseReconstructionEXT"; - case SamplerCreateFlagBits::eNonSeamlessCubeMapEXT: return "NonSeamlessCubeMapEXT"; - case SamplerCreateFlagBits::eImageProcessingQCOM: return "ImageProcessingQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerMipmapMode value ) - { - switch ( value ) - { - case SamplerMipmapMode::eNearest: return "Nearest"; - case SamplerMipmapMode::eLinear: return "Linear"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorPoolCreateFlagBits value ) - { - switch ( value ) - { - case DescriptorPoolCreateFlagBits::eFreeDescriptorSet: return "FreeDescriptorSet"; - case DescriptorPoolCreateFlagBits::eUpdateAfterBind: return "UpdateAfterBind"; - case DescriptorPoolCreateFlagBits::eHostOnlyVALVE: return "HostOnlyVALVE"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorSetLayoutCreateFlagBits value ) - { - switch ( value ) - { - case DescriptorSetLayoutCreateFlagBits::eUpdateAfterBindPool: return "UpdateAfterBindPool"; - case DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR: return "PushDescriptorKHR"; - case DescriptorSetLayoutCreateFlagBits::eHostOnlyPoolVALVE: return "HostOnlyPoolVALVE"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorType value ) - { - switch ( value ) - { - case DescriptorType::eSampler: return "Sampler"; - case DescriptorType::eCombinedImageSampler: return "CombinedImageSampler"; - case DescriptorType::eSampledImage: return "SampledImage"; - case DescriptorType::eStorageImage: return "StorageImage"; - case DescriptorType::eUniformTexelBuffer: return "UniformTexelBuffer"; - case DescriptorType::eStorageTexelBuffer: return "StorageTexelBuffer"; - case DescriptorType::eUniformBuffer: return "UniformBuffer"; - case DescriptorType::eStorageBuffer: return "StorageBuffer"; - case DescriptorType::eUniformBufferDynamic: return "UniformBufferDynamic"; - case DescriptorType::eStorageBufferDynamic: return "StorageBufferDynamic"; - case DescriptorType::eInputAttachment: return "InputAttachment"; - case DescriptorType::eInlineUniformBlock: return "InlineUniformBlock"; - case DescriptorType::eAccelerationStructureKHR: return "AccelerationStructureKHR"; - case DescriptorType::eAccelerationStructureNV: return "AccelerationStructureNV"; - case DescriptorType::eMutableVALVE: return "MutableVALVE"; - case DescriptorType::eSampleWeightImageQCOM: return "SampleWeightImageQCOM"; - case DescriptorType::eBlockMatchImageQCOM: return "BlockMatchImageQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorPoolResetFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( AccessFlagBits value ) - { - switch ( value ) - { - case AccessFlagBits::eIndirectCommandRead: return "IndirectCommandRead"; - case AccessFlagBits::eIndexRead: return "IndexRead"; - case AccessFlagBits::eVertexAttributeRead: return "VertexAttributeRead"; - case AccessFlagBits::eUniformRead: return "UniformRead"; - case AccessFlagBits::eInputAttachmentRead: return "InputAttachmentRead"; - case AccessFlagBits::eShaderRead: return "ShaderRead"; - case AccessFlagBits::eShaderWrite: return "ShaderWrite"; - case AccessFlagBits::eColorAttachmentRead: return "ColorAttachmentRead"; - case AccessFlagBits::eColorAttachmentWrite: return "ColorAttachmentWrite"; - case AccessFlagBits::eDepthStencilAttachmentRead: return "DepthStencilAttachmentRead"; - case AccessFlagBits::eDepthStencilAttachmentWrite: return "DepthStencilAttachmentWrite"; - case AccessFlagBits::eTransferRead: return "TransferRead"; - case AccessFlagBits::eTransferWrite: return "TransferWrite"; - case AccessFlagBits::eHostRead: return "HostRead"; - case AccessFlagBits::eHostWrite: return "HostWrite"; - case AccessFlagBits::eMemoryRead: return "MemoryRead"; - case AccessFlagBits::eMemoryWrite: return "MemoryWrite"; - case AccessFlagBits::eNone: return "None"; - case AccessFlagBits::eTransformFeedbackWriteEXT: return "TransformFeedbackWriteEXT"; - case AccessFlagBits::eTransformFeedbackCounterReadEXT: return "TransformFeedbackCounterReadEXT"; - case AccessFlagBits::eTransformFeedbackCounterWriteEXT: return "TransformFeedbackCounterWriteEXT"; - case AccessFlagBits::eConditionalRenderingReadEXT: return "ConditionalRenderingReadEXT"; - case AccessFlagBits::eColorAttachmentReadNoncoherentEXT: return "ColorAttachmentReadNoncoherentEXT"; - case AccessFlagBits::eAccelerationStructureReadKHR: return "AccelerationStructureReadKHR"; - case AccessFlagBits::eAccelerationStructureWriteKHR: return "AccelerationStructureWriteKHR"; - case AccessFlagBits::eFragmentDensityMapReadEXT: return "FragmentDensityMapReadEXT"; - case AccessFlagBits::eFragmentShadingRateAttachmentReadKHR: return "FragmentShadingRateAttachmentReadKHR"; - case AccessFlagBits::eCommandPreprocessReadNV: return "CommandPreprocessReadNV"; - case AccessFlagBits::eCommandPreprocessWriteNV: return "CommandPreprocessWriteNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AttachmentDescriptionFlagBits value ) - { - switch ( value ) - { - case AttachmentDescriptionFlagBits::eMayAlias: return "MayAlias"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AttachmentLoadOp value ) - { - switch ( value ) - { - case AttachmentLoadOp::eLoad: return "Load"; - case AttachmentLoadOp::eClear: return "Clear"; - case AttachmentLoadOp::eDontCare: return "DontCare"; - case AttachmentLoadOp::eNoneEXT: return "NoneEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AttachmentStoreOp value ) - { - switch ( value ) - { - case AttachmentStoreOp::eStore: return "Store"; - case AttachmentStoreOp::eDontCare: return "DontCare"; - case AttachmentStoreOp::eNone: return "None"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DependencyFlagBits value ) - { - switch ( value ) - { - case DependencyFlagBits::eByRegion: return "ByRegion"; - case DependencyFlagBits::eDeviceGroup: return "DeviceGroup"; - case DependencyFlagBits::eViewLocal: return "ViewLocal"; - case DependencyFlagBits::eFeedbackLoopEXT: return "FeedbackLoopEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FramebufferCreateFlagBits value ) - { - switch ( value ) - { - case FramebufferCreateFlagBits::eImageless: return "Imageless"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineBindPoint value ) - { - switch ( value ) - { - case PipelineBindPoint::eGraphics: return "Graphics"; - case PipelineBindPoint::eCompute: return "Compute"; - case PipelineBindPoint::eRayTracingKHR: return "RayTracingKHR"; - case PipelineBindPoint::eSubpassShadingHUAWEI: return "SubpassShadingHUAWEI"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( RenderPassCreateFlagBits value ) - { - switch ( value ) - { - case RenderPassCreateFlagBits::eTransformQCOM: return "TransformQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SubpassDescriptionFlagBits value ) - { - switch ( value ) - { - case SubpassDescriptionFlagBits::ePerViewAttributesNVX: return "PerViewAttributesNVX"; - case SubpassDescriptionFlagBits::ePerViewPositionXOnlyNVX: return "PerViewPositionXOnlyNVX"; - case SubpassDescriptionFlagBits::eFragmentRegionQCOM: return "FragmentRegionQCOM"; - case SubpassDescriptionFlagBits::eShaderResolveQCOM: return "ShaderResolveQCOM"; - case SubpassDescriptionFlagBits::eRasterizationOrderAttachmentColorAccessEXT: return "RasterizationOrderAttachmentColorAccessEXT"; - case SubpassDescriptionFlagBits::eRasterizationOrderAttachmentDepthAccessEXT: return "RasterizationOrderAttachmentDepthAccessEXT"; - case SubpassDescriptionFlagBits::eRasterizationOrderAttachmentStencilAccessEXT: return "RasterizationOrderAttachmentStencilAccessEXT"; - case SubpassDescriptionFlagBits::eEnableLegacyDitheringEXT: return "EnableLegacyDitheringEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolCreateFlagBits value ) - { - switch ( value ) - { - case CommandPoolCreateFlagBits::eTransient: return "Transient"; - case CommandPoolCreateFlagBits::eResetCommandBuffer: return "ResetCommandBuffer"; - case CommandPoolCreateFlagBits::eProtected: return "Protected"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolResetFlagBits value ) - { - switch ( value ) - { - case CommandPoolResetFlagBits::eReleaseResources: return "ReleaseResources"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandBufferLevel value ) - { - switch ( value ) - { - case CommandBufferLevel::ePrimary: return "Primary"; - case CommandBufferLevel::eSecondary: return "Secondary"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandBufferResetFlagBits value ) - { - switch ( value ) - { - case CommandBufferResetFlagBits::eReleaseResources: return "ReleaseResources"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandBufferUsageFlagBits value ) - { - switch ( value ) - { - case CommandBufferUsageFlagBits::eOneTimeSubmit: return "OneTimeSubmit"; - case CommandBufferUsageFlagBits::eRenderPassContinue: return "RenderPassContinue"; - case CommandBufferUsageFlagBits::eSimultaneousUse: return "SimultaneousUse"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryControlFlagBits value ) - { - switch ( value ) - { - case QueryControlFlagBits::ePrecise: return "Precise"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( IndexType value ) - { - switch ( value ) - { - case IndexType::eUint16: return "Uint16"; - case IndexType::eUint32: return "Uint32"; - case IndexType::eNoneKHR: return "NoneKHR"; - case IndexType::eUint8EXT: return "Uint8EXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( StencilFaceFlagBits value ) - { - switch ( value ) - { - case StencilFaceFlagBits::eFront: return "Front"; - case StencilFaceFlagBits::eBack: return "Back"; - case StencilFaceFlagBits::eFrontAndBack: return "FrontAndBack"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SubpassContents value ) - { - switch ( value ) - { - case SubpassContents::eInline: return "Inline"; - case SubpassContents::eSecondaryCommandBuffers: return "SecondaryCommandBuffers"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_VERSION_1_1 === - - VULKAN_HPP_INLINE std::string to_string( SubgroupFeatureFlagBits value ) - { - switch ( value ) - { - case SubgroupFeatureFlagBits::eBasic: return "Basic"; - case SubgroupFeatureFlagBits::eVote: return "Vote"; - case SubgroupFeatureFlagBits::eArithmetic: return "Arithmetic"; - case SubgroupFeatureFlagBits::eBallot: return "Ballot"; - case SubgroupFeatureFlagBits::eShuffle: return "Shuffle"; - case SubgroupFeatureFlagBits::eShuffleRelative: return "ShuffleRelative"; - case SubgroupFeatureFlagBits::eClustered: return "Clustered"; - case SubgroupFeatureFlagBits::eQuad: return "Quad"; - case SubgroupFeatureFlagBits::ePartitionedNV: return "PartitionedNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PeerMemoryFeatureFlagBits value ) - { - switch ( value ) - { - case PeerMemoryFeatureFlagBits::eCopySrc: return "CopySrc"; - case PeerMemoryFeatureFlagBits::eCopyDst: return "CopyDst"; - case PeerMemoryFeatureFlagBits::eGenericSrc: return "GenericSrc"; - case PeerMemoryFeatureFlagBits::eGenericDst: return "GenericDst"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( MemoryAllocateFlagBits value ) - { - switch ( value ) - { - case MemoryAllocateFlagBits::eDeviceMask: return "DeviceMask"; - case MemoryAllocateFlagBits::eDeviceAddress: return "DeviceAddress"; - case MemoryAllocateFlagBits::eDeviceAddressCaptureReplay: return "DeviceAddressCaptureReplay"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CommandPoolTrimFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PointClippingBehavior value ) - { - switch ( value ) - { - case PointClippingBehavior::eAllClipPlanes: return "AllClipPlanes"; - case PointClippingBehavior::eUserClipPlanesOnly: return "UserClipPlanesOnly"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( TessellationDomainOrigin value ) - { - switch ( value ) - { - case TessellationDomainOrigin::eUpperLeft: return "UpperLeft"; - case TessellationDomainOrigin::eLowerLeft: return "LowerLeft"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DeviceQueueCreateFlagBits value ) - { - switch ( value ) - { - case DeviceQueueCreateFlagBits::eProtected: return "Protected"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerYcbcrModelConversion value ) - { - switch ( value ) - { - case SamplerYcbcrModelConversion::eRgbIdentity: return "RgbIdentity"; - case SamplerYcbcrModelConversion::eYcbcrIdentity: return "YcbcrIdentity"; - case SamplerYcbcrModelConversion::eYcbcr709: return "Ycbcr709"; - case SamplerYcbcrModelConversion::eYcbcr601: return "Ycbcr601"; - case SamplerYcbcrModelConversion::eYcbcr2020: return "Ycbcr2020"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerYcbcrRange value ) - { - switch ( value ) - { - case SamplerYcbcrRange::eItuFull: return "ItuFull"; - case SamplerYcbcrRange::eItuNarrow: return "ItuNarrow"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ChromaLocation value ) - { - switch ( value ) - { - case ChromaLocation::eCositedEven: return "CositedEven"; - case ChromaLocation::eMidpoint: return "Midpoint"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorUpdateTemplateType value ) - { - switch ( value ) - { - case DescriptorUpdateTemplateType::eDescriptorSet: return "DescriptorSet"; - case DescriptorUpdateTemplateType::ePushDescriptorsKHR: return "PushDescriptorsKHR"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorUpdateTemplateCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryHandleTypeFlagBits value ) - { - switch ( value ) - { - case ExternalMemoryHandleTypeFlagBits::eOpaqueFd: return "OpaqueFd"; - case ExternalMemoryHandleTypeFlagBits::eOpaqueWin32: return "OpaqueWin32"; - case ExternalMemoryHandleTypeFlagBits::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalMemoryHandleTypeFlagBits::eD3D11Texture: return "D3D11Texture"; - case ExternalMemoryHandleTypeFlagBits::eD3D11TextureKmt: return "D3D11TextureKmt"; - case ExternalMemoryHandleTypeFlagBits::eD3D12Heap: return "D3D12Heap"; - case ExternalMemoryHandleTypeFlagBits::eD3D12Resource: return "D3D12Resource"; - case ExternalMemoryHandleTypeFlagBits::eDmaBufEXT: return "DmaBufEXT"; -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - case ExternalMemoryHandleTypeFlagBits::eAndroidHardwareBufferANDROID: return "AndroidHardwareBufferANDROID"; -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - case ExternalMemoryHandleTypeFlagBits::eHostAllocationEXT: return "HostAllocationEXT"; - case ExternalMemoryHandleTypeFlagBits::eHostMappedForeignMemoryEXT: return "HostMappedForeignMemoryEXT"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case ExternalMemoryHandleTypeFlagBits::eZirconVmoFUCHSIA: return "ZirconVmoFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - case ExternalMemoryHandleTypeFlagBits::eRdmaAddressNV: return "RdmaAddressNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryFeatureFlagBits value ) - { - switch ( value ) - { - case ExternalMemoryFeatureFlagBits::eDedicatedOnly: return "DedicatedOnly"; - case ExternalMemoryFeatureFlagBits::eExportable: return "Exportable"; - case ExternalMemoryFeatureFlagBits::eImportable: return "Importable"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalFenceHandleTypeFlagBits value ) - { - switch ( value ) - { - case ExternalFenceHandleTypeFlagBits::eOpaqueFd: return "OpaqueFd"; - case ExternalFenceHandleTypeFlagBits::eOpaqueWin32: return "OpaqueWin32"; - case ExternalFenceHandleTypeFlagBits::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalFenceHandleTypeFlagBits::eSyncFd: return "SyncFd"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalFenceFeatureFlagBits value ) - { - switch ( value ) - { - case ExternalFenceFeatureFlagBits::eExportable: return "Exportable"; - case ExternalFenceFeatureFlagBits::eImportable: return "Importable"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FenceImportFlagBits value ) - { - switch ( value ) - { - case FenceImportFlagBits::eTemporary: return "Temporary"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreImportFlagBits value ) - { - switch ( value ) - { - case SemaphoreImportFlagBits::eTemporary: return "Temporary"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalSemaphoreHandleTypeFlagBits value ) - { - switch ( value ) - { - case ExternalSemaphoreHandleTypeFlagBits::eOpaqueFd: return "OpaqueFd"; - case ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32: return "OpaqueWin32"; - case ExternalSemaphoreHandleTypeFlagBits::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalSemaphoreHandleTypeFlagBits::eD3D12Fence: return "D3D12Fence"; - case ExternalSemaphoreHandleTypeFlagBits::eSyncFd: return "SyncFd"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case ExternalSemaphoreHandleTypeFlagBits::eZirconEventFUCHSIA: return "ZirconEventFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalSemaphoreFeatureFlagBits value ) - { - switch ( value ) - { - case ExternalSemaphoreFeatureFlagBits::eExportable: return "Exportable"; - case ExternalSemaphoreFeatureFlagBits::eImportable: return "Importable"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_VERSION_1_2 === - - VULKAN_HPP_INLINE std::string to_string( DriverId value ) - { - switch ( value ) - { - case DriverId::eAmdProprietary: return "AmdProprietary"; - case DriverId::eAmdOpenSource: return "AmdOpenSource"; - case DriverId::eMesaRadv: return "MesaRadv"; - case DriverId::eNvidiaProprietary: return "NvidiaProprietary"; - case DriverId::eIntelProprietaryWindows: return "IntelProprietaryWindows"; - case DriverId::eIntelOpenSourceMESA: return "IntelOpenSourceMESA"; - case DriverId::eImaginationProprietary: return "ImaginationProprietary"; - case DriverId::eQualcommProprietary: return "QualcommProprietary"; - case DriverId::eArmProprietary: return "ArmProprietary"; - case DriverId::eGoogleSwiftshader: return "GoogleSwiftshader"; - case DriverId::eGgpProprietary: return "GgpProprietary"; - case DriverId::eBroadcomProprietary: return "BroadcomProprietary"; - case DriverId::eMesaLlvmpipe: return "MesaLlvmpipe"; - case DriverId::eMoltenvk: return "Moltenvk"; - case DriverId::eCoreaviProprietary: return "CoreaviProprietary"; - case DriverId::eJuiceProprietary: return "JuiceProprietary"; - case DriverId::eVerisiliconProprietary: return "VerisiliconProprietary"; - case DriverId::eMesaTurnip: return "MesaTurnip"; - case DriverId::eMesaV3Dv: return "MesaV3Dv"; - case DriverId::eMesaPanvk: return "MesaPanvk"; - case DriverId::eSamsungProprietary: return "SamsungProprietary"; - case DriverId::eMesaVenus: return "MesaVenus"; - case DriverId::eMesaDozen: return "MesaDozen"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ShaderFloatControlsIndependence value ) - { - switch ( value ) - { - case ShaderFloatControlsIndependence::e32BitOnly: return "32BitOnly"; - case ShaderFloatControlsIndependence::eAll: return "All"; - case ShaderFloatControlsIndependence::eNone: return "None"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DescriptorBindingFlagBits value ) - { - switch ( value ) - { - case DescriptorBindingFlagBits::eUpdateAfterBind: return "UpdateAfterBind"; - case DescriptorBindingFlagBits::eUpdateUnusedWhilePending: return "UpdateUnusedWhilePending"; - case DescriptorBindingFlagBits::ePartiallyBound: return "PartiallyBound"; - case DescriptorBindingFlagBits::eVariableDescriptorCount: return "VariableDescriptorCount"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ResolveModeFlagBits value ) - { - switch ( value ) - { - case ResolveModeFlagBits::eNone: return "None"; - case ResolveModeFlagBits::eSampleZero: return "SampleZero"; - case ResolveModeFlagBits::eAverage: return "Average"; - case ResolveModeFlagBits::eMin: return "Min"; - case ResolveModeFlagBits::eMax: return "Max"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SamplerReductionMode value ) - { - switch ( value ) - { - case SamplerReductionMode::eWeightedAverage: return "WeightedAverage"; - case SamplerReductionMode::eMin: return "Min"; - case SamplerReductionMode::eMax: return "Max"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreType value ) - { - switch ( value ) - { - case SemaphoreType::eBinary: return "Binary"; - case SemaphoreType::eTimeline: return "Timeline"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SemaphoreWaitFlagBits value ) - { - switch ( value ) - { - case SemaphoreWaitFlagBits::eAny: return "Any"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_VERSION_1_3 === - - VULKAN_HPP_INLINE std::string to_string( PipelineCreationFeedbackFlagBits value ) - { - switch ( value ) - { - case PipelineCreationFeedbackFlagBits::eValid: return "Valid"; - case PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit: return "ApplicationPipelineCacheHit"; - case PipelineCreationFeedbackFlagBits::eBasePipelineAcceleration: return "BasePipelineAcceleration"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ToolPurposeFlagBits value ) - { - switch ( value ) - { - case ToolPurposeFlagBits::eValidation: return "Validation"; - case ToolPurposeFlagBits::eProfiling: return "Profiling"; - case ToolPurposeFlagBits::eTracing: return "Tracing"; - case ToolPurposeFlagBits::eAdditionalFeatures: return "AdditionalFeatures"; - case ToolPurposeFlagBits::eModifyingFeatures: return "ModifyingFeatures"; - case ToolPurposeFlagBits::eDebugReportingEXT: return "DebugReportingEXT"; - case ToolPurposeFlagBits::eDebugMarkersEXT: return "DebugMarkersEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PrivateDataSlotCreateFlagBits ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( PipelineStageFlagBits2 value ) - { - switch ( value ) - { - case PipelineStageFlagBits2::eNone: return "None"; - case PipelineStageFlagBits2::eTopOfPipe: return "TopOfPipe"; - case PipelineStageFlagBits2::eDrawIndirect: return "DrawIndirect"; - case PipelineStageFlagBits2::eVertexInput: return "VertexInput"; - case PipelineStageFlagBits2::eVertexShader: return "VertexShader"; - case PipelineStageFlagBits2::eTessellationControlShader: return "TessellationControlShader"; - case PipelineStageFlagBits2::eTessellationEvaluationShader: return "TessellationEvaluationShader"; - case PipelineStageFlagBits2::eGeometryShader: return "GeometryShader"; - case PipelineStageFlagBits2::eFragmentShader: return "FragmentShader"; - case PipelineStageFlagBits2::eEarlyFragmentTests: return "EarlyFragmentTests"; - case PipelineStageFlagBits2::eLateFragmentTests: return "LateFragmentTests"; - case PipelineStageFlagBits2::eColorAttachmentOutput: return "ColorAttachmentOutput"; - case PipelineStageFlagBits2::eComputeShader: return "ComputeShader"; - case PipelineStageFlagBits2::eAllTransfer: return "AllTransfer"; - case PipelineStageFlagBits2::eBottomOfPipe: return "BottomOfPipe"; - case PipelineStageFlagBits2::eHost: return "Host"; - case PipelineStageFlagBits2::eAllGraphics: return "AllGraphics"; - case PipelineStageFlagBits2::eAllCommands: return "AllCommands"; - case PipelineStageFlagBits2::eCopy: return "Copy"; - case PipelineStageFlagBits2::eResolve: return "Resolve"; - case PipelineStageFlagBits2::eBlit: return "Blit"; - case PipelineStageFlagBits2::eClear: return "Clear"; - case PipelineStageFlagBits2::eIndexInput: return "IndexInput"; - case PipelineStageFlagBits2::eVertexAttributeInput: return "VertexAttributeInput"; - case PipelineStageFlagBits2::ePreRasterizationShaders: return "PreRasterizationShaders"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case PipelineStageFlagBits2::eVideoDecodeKHR: return "VideoDecodeKHR"; - case PipelineStageFlagBits2::eVideoEncodeKHR: return "VideoEncodeKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case PipelineStageFlagBits2::eTransformFeedbackEXT: return "TransformFeedbackEXT"; - case PipelineStageFlagBits2::eConditionalRenderingEXT: return "ConditionalRenderingEXT"; - case PipelineStageFlagBits2::eCommandPreprocessNV: return "CommandPreprocessNV"; - case PipelineStageFlagBits2::eFragmentShadingRateAttachmentKHR: return "FragmentShadingRateAttachmentKHR"; - case PipelineStageFlagBits2::eAccelerationStructureBuildKHR: return "AccelerationStructureBuildKHR"; - case PipelineStageFlagBits2::eRayTracingShaderKHR: return "RayTracingShaderKHR"; - case PipelineStageFlagBits2::eFragmentDensityProcessEXT: return "FragmentDensityProcessEXT"; - case PipelineStageFlagBits2::eTaskShaderEXT: return "TaskShaderEXT"; - case PipelineStageFlagBits2::eMeshShaderEXT: return "MeshShaderEXT"; - case PipelineStageFlagBits2::eSubpassShadingHUAWEI: return "SubpassShadingHUAWEI"; - case PipelineStageFlagBits2::eInvocationMaskHUAWEI: return "InvocationMaskHUAWEI"; - case PipelineStageFlagBits2::eAccelerationStructureCopyKHR: return "AccelerationStructureCopyKHR"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AccessFlagBits2 value ) - { - switch ( value ) - { - case AccessFlagBits2::eNone: return "None"; - case AccessFlagBits2::eIndirectCommandRead: return "IndirectCommandRead"; - case AccessFlagBits2::eIndexRead: return "IndexRead"; - case AccessFlagBits2::eVertexAttributeRead: return "VertexAttributeRead"; - case AccessFlagBits2::eUniformRead: return "UniformRead"; - case AccessFlagBits2::eInputAttachmentRead: return "InputAttachmentRead"; - case AccessFlagBits2::eShaderRead: return "ShaderRead"; - case AccessFlagBits2::eShaderWrite: return "ShaderWrite"; - case AccessFlagBits2::eColorAttachmentRead: return "ColorAttachmentRead"; - case AccessFlagBits2::eColorAttachmentWrite: return "ColorAttachmentWrite"; - case AccessFlagBits2::eDepthStencilAttachmentRead: return "DepthStencilAttachmentRead"; - case AccessFlagBits2::eDepthStencilAttachmentWrite: return "DepthStencilAttachmentWrite"; - case AccessFlagBits2::eTransferRead: return "TransferRead"; - case AccessFlagBits2::eTransferWrite: return "TransferWrite"; - case AccessFlagBits2::eHostRead: return "HostRead"; - case AccessFlagBits2::eHostWrite: return "HostWrite"; - case AccessFlagBits2::eMemoryRead: return "MemoryRead"; - case AccessFlagBits2::eMemoryWrite: return "MemoryWrite"; - case AccessFlagBits2::eShaderSampledRead: return "ShaderSampledRead"; - case AccessFlagBits2::eShaderStorageRead: return "ShaderStorageRead"; - case AccessFlagBits2::eShaderStorageWrite: return "ShaderStorageWrite"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case AccessFlagBits2::eVideoDecodeReadKHR: return "VideoDecodeReadKHR"; - case AccessFlagBits2::eVideoDecodeWriteKHR: return "VideoDecodeWriteKHR"; - case AccessFlagBits2::eVideoEncodeReadKHR: return "VideoEncodeReadKHR"; - case AccessFlagBits2::eVideoEncodeWriteKHR: return "VideoEncodeWriteKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case AccessFlagBits2::eTransformFeedbackWriteEXT: return "TransformFeedbackWriteEXT"; - case AccessFlagBits2::eTransformFeedbackCounterReadEXT: return "TransformFeedbackCounterReadEXT"; - case AccessFlagBits2::eTransformFeedbackCounterWriteEXT: return "TransformFeedbackCounterWriteEXT"; - case AccessFlagBits2::eConditionalRenderingReadEXT: return "ConditionalRenderingReadEXT"; - case AccessFlagBits2::eCommandPreprocessReadNV: return "CommandPreprocessReadNV"; - case AccessFlagBits2::eCommandPreprocessWriteNV: return "CommandPreprocessWriteNV"; - case AccessFlagBits2::eFragmentShadingRateAttachmentReadKHR: return "FragmentShadingRateAttachmentReadKHR"; - case AccessFlagBits2::eAccelerationStructureReadKHR: return "AccelerationStructureReadKHR"; - case AccessFlagBits2::eAccelerationStructureWriteKHR: return "AccelerationStructureWriteKHR"; - case AccessFlagBits2::eFragmentDensityMapReadEXT: return "FragmentDensityMapReadEXT"; - case AccessFlagBits2::eColorAttachmentReadNoncoherentEXT: return "ColorAttachmentReadNoncoherentEXT"; - case AccessFlagBits2::eInvocationMaskReadHUAWEI: return "InvocationMaskReadHUAWEI"; - case AccessFlagBits2::eShaderBindingTableReadKHR: return "ShaderBindingTableReadKHR"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( SubmitFlagBits value ) - { - switch ( value ) - { - case SubmitFlagBits::eProtected: return "Protected"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( RenderingFlagBits value ) - { - switch ( value ) - { - case RenderingFlagBits::eContentsSecondaryCommandBuffers: return "ContentsSecondaryCommandBuffers"; - case RenderingFlagBits::eSuspending: return "Suspending"; - case RenderingFlagBits::eResuming: return "Resuming"; - case RenderingFlagBits::eEnableLegacyDitheringEXT: return "EnableLegacyDitheringEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FormatFeatureFlagBits2 value ) - { - switch ( value ) - { - case FormatFeatureFlagBits2::eSampledImage: return "SampledImage"; - case FormatFeatureFlagBits2::eStorageImage: return "StorageImage"; - case FormatFeatureFlagBits2::eStorageImageAtomic: return "StorageImageAtomic"; - case FormatFeatureFlagBits2::eUniformTexelBuffer: return "UniformTexelBuffer"; - case FormatFeatureFlagBits2::eStorageTexelBuffer: return "StorageTexelBuffer"; - case FormatFeatureFlagBits2::eStorageTexelBufferAtomic: return "StorageTexelBufferAtomic"; - case FormatFeatureFlagBits2::eVertexBuffer: return "VertexBuffer"; - case FormatFeatureFlagBits2::eColorAttachment: return "ColorAttachment"; - case FormatFeatureFlagBits2::eColorAttachmentBlend: return "ColorAttachmentBlend"; - case FormatFeatureFlagBits2::eDepthStencilAttachment: return "DepthStencilAttachment"; - case FormatFeatureFlagBits2::eBlitSrc: return "BlitSrc"; - case FormatFeatureFlagBits2::eBlitDst: return "BlitDst"; - case FormatFeatureFlagBits2::eSampledImageFilterLinear: return "SampledImageFilterLinear"; - case FormatFeatureFlagBits2::eSampledImageFilterCubic: return "SampledImageFilterCubic"; - case FormatFeatureFlagBits2::eTransferSrc: return "TransferSrc"; - case FormatFeatureFlagBits2::eTransferDst: return "TransferDst"; - case FormatFeatureFlagBits2::eSampledImageFilterMinmax: return "SampledImageFilterMinmax"; - case FormatFeatureFlagBits2::eMidpointChromaSamples: return "MidpointChromaSamples"; - case FormatFeatureFlagBits2::eSampledImageYcbcrConversionLinearFilter: return "SampledImageYcbcrConversionLinearFilter"; - case FormatFeatureFlagBits2::eSampledImageYcbcrConversionSeparateReconstructionFilter: return "SampledImageYcbcrConversionSeparateReconstructionFilter"; - case FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicit: return "SampledImageYcbcrConversionChromaReconstructionExplicit"; - case FormatFeatureFlagBits2::eSampledImageYcbcrConversionChromaReconstructionExplicitForceable: - return "SampledImageYcbcrConversionChromaReconstructionExplicitForceable"; - case FormatFeatureFlagBits2::eDisjoint: return "Disjoint"; - case FormatFeatureFlagBits2::eCositedChromaSamples: return "CositedChromaSamples"; - case FormatFeatureFlagBits2::eStorageReadWithoutFormat: return "StorageReadWithoutFormat"; - case FormatFeatureFlagBits2::eStorageWriteWithoutFormat: return "StorageWriteWithoutFormat"; - case FormatFeatureFlagBits2::eSampledImageDepthComparison: return "SampledImageDepthComparison"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case FormatFeatureFlagBits2::eVideoDecodeOutputKHR: return "VideoDecodeOutputKHR"; - case FormatFeatureFlagBits2::eVideoDecodeDpbKHR: return "VideoDecodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case FormatFeatureFlagBits2::eAccelerationStructureVertexBufferKHR: return "AccelerationStructureVertexBufferKHR"; - case FormatFeatureFlagBits2::eFragmentDensityMapEXT: return "FragmentDensityMapEXT"; - case FormatFeatureFlagBits2::eFragmentShadingRateAttachmentKHR: return "FragmentShadingRateAttachmentKHR"; -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - case FormatFeatureFlagBits2::eVideoEncodeInputKHR: return "VideoEncodeInputKHR"; - case FormatFeatureFlagBits2::eVideoEncodeDpbKHR: return "VideoEncodeDpbKHR"; -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - case FormatFeatureFlagBits2::eLinearColorAttachmentNV: return "LinearColorAttachmentNV"; - case FormatFeatureFlagBits2::eWeightImageQCOM: return "WeightImageQCOM"; - case FormatFeatureFlagBits2::eWeightSampledImageQCOM: return "WeightSampledImageQCOM"; - case FormatFeatureFlagBits2::eBlockMatchingQCOM: return "BlockMatchingQCOM"; - case FormatFeatureFlagBits2::eBoxFilterSampledQCOM: return "BoxFilterSampledQCOM"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_KHR_surface === - - VULKAN_HPP_INLINE std::string to_string( SurfaceTransformFlagBitsKHR value ) - { - switch ( value ) - { - case SurfaceTransformFlagBitsKHR::eIdentity: return "Identity"; - case SurfaceTransformFlagBitsKHR::eRotate90: return "Rotate90"; - case SurfaceTransformFlagBitsKHR::eRotate180: return "Rotate180"; - case SurfaceTransformFlagBitsKHR::eRotate270: return "Rotate270"; - case SurfaceTransformFlagBitsKHR::eHorizontalMirror: return "HorizontalMirror"; - case SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate90: return "HorizontalMirrorRotate90"; - case SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate180: return "HorizontalMirrorRotate180"; - case SurfaceTransformFlagBitsKHR::eHorizontalMirrorRotate270: return "HorizontalMirrorRotate270"; - case SurfaceTransformFlagBitsKHR::eInherit: return "Inherit"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PresentModeKHR value ) - { - switch ( value ) - { - case PresentModeKHR::eImmediate: return "Immediate"; - case PresentModeKHR::eMailbox: return "Mailbox"; - case PresentModeKHR::eFifo: return "Fifo"; - case PresentModeKHR::eFifoRelaxed: return "FifoRelaxed"; - case PresentModeKHR::eSharedDemandRefresh: return "SharedDemandRefresh"; - case PresentModeKHR::eSharedContinuousRefresh: return "SharedContinuousRefresh"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ColorSpaceKHR value ) - { - switch ( value ) - { - case ColorSpaceKHR::eSrgbNonlinear: return "SrgbNonlinear"; - case ColorSpaceKHR::eDisplayP3NonlinearEXT: return "DisplayP3NonlinearEXT"; - case ColorSpaceKHR::eExtendedSrgbLinearEXT: return "ExtendedSrgbLinearEXT"; - case ColorSpaceKHR::eDisplayP3LinearEXT: return "DisplayP3LinearEXT"; - case ColorSpaceKHR::eDciP3NonlinearEXT: return "DciP3NonlinearEXT"; - case ColorSpaceKHR::eBt709LinearEXT: return "Bt709LinearEXT"; - case ColorSpaceKHR::eBt709NonlinearEXT: return "Bt709NonlinearEXT"; - case ColorSpaceKHR::eBt2020LinearEXT: return "Bt2020LinearEXT"; - case ColorSpaceKHR::eHdr10St2084EXT: return "Hdr10St2084EXT"; - case ColorSpaceKHR::eDolbyvisionEXT: return "DolbyvisionEXT"; - case ColorSpaceKHR::eHdr10HlgEXT: return "Hdr10HlgEXT"; - case ColorSpaceKHR::eAdobergbLinearEXT: return "AdobergbLinearEXT"; - case ColorSpaceKHR::eAdobergbNonlinearEXT: return "AdobergbNonlinearEXT"; - case ColorSpaceKHR::ePassThroughEXT: return "PassThroughEXT"; - case ColorSpaceKHR::eExtendedSrgbNonlinearEXT: return "ExtendedSrgbNonlinearEXT"; - case ColorSpaceKHR::eDisplayNativeAMD: return "DisplayNativeAMD"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CompositeAlphaFlagBitsKHR value ) - { - switch ( value ) - { - case CompositeAlphaFlagBitsKHR::eOpaque: return "Opaque"; - case CompositeAlphaFlagBitsKHR::ePreMultiplied: return "PreMultiplied"; - case CompositeAlphaFlagBitsKHR::ePostMultiplied: return "PostMultiplied"; - case CompositeAlphaFlagBitsKHR::eInherit: return "Inherit"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_KHR_swapchain === - - VULKAN_HPP_INLINE std::string to_string( SwapchainCreateFlagBitsKHR value ) - { - switch ( value ) - { - case SwapchainCreateFlagBitsKHR::eSplitInstanceBindRegions: return "SplitInstanceBindRegions"; - case SwapchainCreateFlagBitsKHR::eProtected: return "Protected"; - case SwapchainCreateFlagBitsKHR::eMutableFormat: return "MutableFormat"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DeviceGroupPresentModeFlagBitsKHR value ) - { - switch ( value ) - { - case DeviceGroupPresentModeFlagBitsKHR::eLocal: return "Local"; - case DeviceGroupPresentModeFlagBitsKHR::eRemote: return "Remote"; - case DeviceGroupPresentModeFlagBitsKHR::eSum: return "Sum"; - case DeviceGroupPresentModeFlagBitsKHR::eLocalMultiDevice: return "LocalMultiDevice"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_KHR_display === - - VULKAN_HPP_INLINE std::string to_string( DisplayPlaneAlphaFlagBitsKHR value ) - { - switch ( value ) - { - case DisplayPlaneAlphaFlagBitsKHR::eOpaque: return "Opaque"; - case DisplayPlaneAlphaFlagBitsKHR::eGlobal: return "Global"; - case DisplayPlaneAlphaFlagBitsKHR::ePerPixel: return "PerPixel"; - case DisplayPlaneAlphaFlagBitsKHR::ePerPixelPremultiplied: return "PerPixelPremultiplied"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DisplayModeCreateFlagBitsKHR ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( DisplaySurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } - -#if defined( VK_USE_PLATFORM_XLIB_KHR ) - //=== VK_KHR_xlib_surface === - - VULKAN_HPP_INLINE std::string to_string( XlibSurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_XLIB_KHR*/ - -#if defined( VK_USE_PLATFORM_XCB_KHR ) - //=== VK_KHR_xcb_surface === - - VULKAN_HPP_INLINE std::string to_string( XcbSurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_XCB_KHR*/ - -#if defined( VK_USE_PLATFORM_WAYLAND_KHR ) - //=== VK_KHR_wayland_surface === - - VULKAN_HPP_INLINE std::string to_string( WaylandSurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_WAYLAND_KHR*/ - -#if defined( VK_USE_PLATFORM_ANDROID_KHR ) - //=== VK_KHR_android_surface === - - VULKAN_HPP_INLINE std::string to_string( AndroidSurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_ANDROID_KHR*/ - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_KHR_win32_surface === - - VULKAN_HPP_INLINE std::string to_string( Win32SurfaceCreateFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_debug_report === - - VULKAN_HPP_INLINE std::string to_string( DebugReportFlagBitsEXT value ) - { - switch ( value ) - { - case DebugReportFlagBitsEXT::eInformation: return "Information"; - case DebugReportFlagBitsEXT::eWarning: return "Warning"; - case DebugReportFlagBitsEXT::ePerformanceWarning: return "PerformanceWarning"; - case DebugReportFlagBitsEXT::eError: return "Error"; - case DebugReportFlagBitsEXT::eDebug: return "Debug"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DebugReportObjectTypeEXT value ) - { - switch ( value ) - { - case DebugReportObjectTypeEXT::eUnknown: return "Unknown"; - case DebugReportObjectTypeEXT::eInstance: return "Instance"; - case DebugReportObjectTypeEXT::ePhysicalDevice: return "PhysicalDevice"; - case DebugReportObjectTypeEXT::eDevice: return "Device"; - case DebugReportObjectTypeEXT::eQueue: return "Queue"; - case DebugReportObjectTypeEXT::eSemaphore: return "Semaphore"; - case DebugReportObjectTypeEXT::eCommandBuffer: return "CommandBuffer"; - case DebugReportObjectTypeEXT::eFence: return "Fence"; - case DebugReportObjectTypeEXT::eDeviceMemory: return "DeviceMemory"; - case DebugReportObjectTypeEXT::eBuffer: return "Buffer"; - case DebugReportObjectTypeEXT::eImage: return "Image"; - case DebugReportObjectTypeEXT::eEvent: return "Event"; - case DebugReportObjectTypeEXT::eQueryPool: return "QueryPool"; - case DebugReportObjectTypeEXT::eBufferView: return "BufferView"; - case DebugReportObjectTypeEXT::eImageView: return "ImageView"; - case DebugReportObjectTypeEXT::eShaderModule: return "ShaderModule"; - case DebugReportObjectTypeEXT::ePipelineCache: return "PipelineCache"; - case DebugReportObjectTypeEXT::ePipelineLayout: return "PipelineLayout"; - case DebugReportObjectTypeEXT::eRenderPass: return "RenderPass"; - case DebugReportObjectTypeEXT::ePipeline: return "Pipeline"; - case DebugReportObjectTypeEXT::eDescriptorSetLayout: return "DescriptorSetLayout"; - case DebugReportObjectTypeEXT::eSampler: return "Sampler"; - case DebugReportObjectTypeEXT::eDescriptorPool: return "DescriptorPool"; - case DebugReportObjectTypeEXT::eDescriptorSet: return "DescriptorSet"; - case DebugReportObjectTypeEXT::eFramebuffer: return "Framebuffer"; - case DebugReportObjectTypeEXT::eCommandPool: return "CommandPool"; - case DebugReportObjectTypeEXT::eSurfaceKHR: return "SurfaceKHR"; - case DebugReportObjectTypeEXT::eSwapchainKHR: return "SwapchainKHR"; - case DebugReportObjectTypeEXT::eDebugReportCallbackEXT: return "DebugReportCallbackEXT"; - case DebugReportObjectTypeEXT::eDisplayKHR: return "DisplayKHR"; - case DebugReportObjectTypeEXT::eDisplayModeKHR: return "DisplayModeKHR"; - case DebugReportObjectTypeEXT::eValidationCacheEXT: return "ValidationCacheEXT"; - case DebugReportObjectTypeEXT::eSamplerYcbcrConversion: return "SamplerYcbcrConversion"; - case DebugReportObjectTypeEXT::eDescriptorUpdateTemplate: return "DescriptorUpdateTemplate"; - case DebugReportObjectTypeEXT::eCuModuleNVX: return "CuModuleNVX"; - case DebugReportObjectTypeEXT::eCuFunctionNVX: return "CuFunctionNVX"; - case DebugReportObjectTypeEXT::eAccelerationStructureKHR: return "AccelerationStructureKHR"; - case DebugReportObjectTypeEXT::eAccelerationStructureNV: return "AccelerationStructureNV"; -#if defined( VK_USE_PLATFORM_FUCHSIA ) - case DebugReportObjectTypeEXT::eBufferCollectionFUCHSIA: return "BufferCollectionFUCHSIA"; -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_AMD_rasterization_order === - - VULKAN_HPP_INLINE std::string to_string( RasterizationOrderAMD value ) - { - switch ( value ) - { - case RasterizationOrderAMD::eStrict: return "Strict"; - case RasterizationOrderAMD::eRelaxed: return "Relaxed"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoCodecOperationFlagBitsKHR value ) - { - switch ( value ) - { - case VideoCodecOperationFlagBitsKHR::eNone: return "None"; -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case VideoCodecOperationFlagBitsKHR::eEncodeH264EXT: return "EncodeH264EXT"; - case VideoCodecOperationFlagBitsKHR::eEncodeH265EXT: return "EncodeH265EXT"; - case VideoCodecOperationFlagBitsKHR::eDecodeH264EXT: return "DecodeH264EXT"; - case VideoCodecOperationFlagBitsKHR::eDecodeH265EXT: return "DecodeH265EXT"; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoChromaSubsamplingFlagBitsKHR value ) - { - switch ( value ) - { - case VideoChromaSubsamplingFlagBitsKHR::eInvalid: return "Invalid"; - case VideoChromaSubsamplingFlagBitsKHR::eMonochrome: return "Monochrome"; - case VideoChromaSubsamplingFlagBitsKHR::e420: return "420"; - case VideoChromaSubsamplingFlagBitsKHR::e422: return "422"; - case VideoChromaSubsamplingFlagBitsKHR::e444: return "444"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoComponentBitDepthFlagBitsKHR value ) - { - switch ( value ) - { - case VideoComponentBitDepthFlagBitsKHR::eInvalid: return "Invalid"; - case VideoComponentBitDepthFlagBitsKHR::e8: return "8"; - case VideoComponentBitDepthFlagBitsKHR::e10: return "10"; - case VideoComponentBitDepthFlagBitsKHR::e12: return "12"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoCapabilityFlagBitsKHR value ) - { - switch ( value ) - { - case VideoCapabilityFlagBitsKHR::eProtectedContent: return "ProtectedContent"; - case VideoCapabilityFlagBitsKHR::eSeparateReferenceImages: return "SeparateReferenceImages"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoSessionCreateFlagBitsKHR value ) - { - switch ( value ) - { - case VideoSessionCreateFlagBitsKHR::eProtectedContent: return "ProtectedContent"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoCodingControlFlagBitsKHR value ) - { - switch ( value ) - { - case VideoCodingControlFlagBitsKHR::eReset: return "Reset"; -# if defined( VK_ENABLE_BETA_EXTENSIONS ) - case VideoCodingControlFlagBitsKHR::eEncodeRateControl: return "EncodeRateControl"; - case VideoCodingControlFlagBitsKHR::eEncodeRateControlLayer: return "EncodeRateControlLayer"; -# endif /*VK_ENABLE_BETA_EXTENSIONS*/ - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryResultStatusKHR value ) - { - switch ( value ) - { - case QueryResultStatusKHR::eError: return "Error"; - case QueryResultStatusKHR::eNotReady: return "NotReady"; - case QueryResultStatusKHR::eComplete: return "Complete"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoSessionParametersCreateFlagBitsKHR ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoBeginCodingFlagBitsKHR ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEndCodingFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_decode_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeCapabilityFlagBitsKHR value ) - { - switch ( value ) - { - case VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputCoincide: return "DpbAndOutputCoincide"; - case VideoDecodeCapabilityFlagBitsKHR::eDpbAndOutputDistinct: return "DpbAndOutputDistinct"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeUsageFlagBitsKHR value ) - { - switch ( value ) - { - case VideoDecodeUsageFlagBitsKHR::eDefault: return "Default"; - case VideoDecodeUsageFlagBitsKHR::eTranscoding: return "Transcoding"; - case VideoDecodeUsageFlagBitsKHR::eOffline: return "Offline"; - case VideoDecodeUsageFlagBitsKHR::eStreaming: return "Streaming"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_EXT_transform_feedback === - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationStateStreamCreateFlagBitsEXT ) - { - return "(void)"; - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h264 === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264CapabilityFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceEnabled: return "Direct8X8InferenceEnabled"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDirect8X8InferenceDisabled: return "Direct8X8InferenceDisabled"; - case VideoEncodeH264CapabilityFlagBitsEXT::eSeparateColourPlane: return "SeparateColourPlane"; - case VideoEncodeH264CapabilityFlagBitsEXT::eQpprimeYZeroTransformBypass: return "QpprimeYZeroTransformBypass"; - case VideoEncodeH264CapabilityFlagBitsEXT::eScalingLists: return "ScalingLists"; - case VideoEncodeH264CapabilityFlagBitsEXT::eHrdCompliance: return "HrdCompliance"; - case VideoEncodeH264CapabilityFlagBitsEXT::eChromaQpOffset: return "ChromaQpOffset"; - case VideoEncodeH264CapabilityFlagBitsEXT::eSecondChromaQpOffset: return "SecondChromaQpOffset"; - case VideoEncodeH264CapabilityFlagBitsEXT::ePicInitQpMinus26: return "PicInitQpMinus26"; - case VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPred: return "WeightedPred"; - case VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredExplicit: return "WeightedBipredExplicit"; - case VideoEncodeH264CapabilityFlagBitsEXT::eWeightedBipredImplicit: return "WeightedBipredImplicit"; - case VideoEncodeH264CapabilityFlagBitsEXT::eWeightedPredNoTable: return "WeightedPredNoTable"; - case VideoEncodeH264CapabilityFlagBitsEXT::eTransform8X8: return "Transform8X8"; - case VideoEncodeH264CapabilityFlagBitsEXT::eCabac: return "Cabac"; - case VideoEncodeH264CapabilityFlagBitsEXT::eCavlc: return "Cavlc"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterDisabled: return "DeblockingFilterDisabled"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterEnabled: return "DeblockingFilterEnabled"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDeblockingFilterPartial: return "DeblockingFilterPartial"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDisableDirectSpatialMvPred: return "DisableDirectSpatialMvPred"; - case VideoEncodeH264CapabilityFlagBitsEXT::eMultipleSlicePerFrame: return "MultipleSlicePerFrame"; - case VideoEncodeH264CapabilityFlagBitsEXT::eSliceMbCount: return "SliceMbCount"; - case VideoEncodeH264CapabilityFlagBitsEXT::eRowUnalignedSlice: return "RowUnalignedSlice"; - case VideoEncodeH264CapabilityFlagBitsEXT::eDifferentSliceType: return "DifferentSliceType"; - case VideoEncodeH264CapabilityFlagBitsEXT::eBFrameInL1List: return "BFrameInL1List"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264InputModeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH264InputModeFlagBitsEXT::eFrame: return "Frame"; - case VideoEncodeH264InputModeFlagBitsEXT::eSlice: return "Slice"; - case VideoEncodeH264InputModeFlagBitsEXT::eNonVcl: return "NonVcl"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264OutputModeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH264OutputModeFlagBitsEXT::eFrame: return "Frame"; - case VideoEncodeH264OutputModeFlagBitsEXT::eSlice: return "Slice"; - case VideoEncodeH264OutputModeFlagBitsEXT::eNonVcl: return "NonVcl"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH264RateControlStructureEXT value ) - { - switch ( value ) - { - case VideoEncodeH264RateControlStructureEXT::eUnknown: return "Unknown"; - case VideoEncodeH264RateControlStructureEXT::eFlat: return "Flat"; - case VideoEncodeH264RateControlStructureEXT::eDyadic: return "Dyadic"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_encode_h265 === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265CapabilityFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH265CapabilityFlagBitsEXT::eSeparateColourPlane: return "SeparateColourPlane"; - case VideoEncodeH265CapabilityFlagBitsEXT::eScalingLists: return "ScalingLists"; - case VideoEncodeH265CapabilityFlagBitsEXT::eSampleAdaptiveOffsetEnabled: return "SampleAdaptiveOffsetEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::ePcmEnable: return "PcmEnable"; - case VideoEncodeH265CapabilityFlagBitsEXT::eSpsTemporalMvpEnabled: return "SpsTemporalMvpEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eHrdCompliance: return "HrdCompliance"; - case VideoEncodeH265CapabilityFlagBitsEXT::eInitQpMinus26: return "InitQpMinus26"; - case VideoEncodeH265CapabilityFlagBitsEXT::eLog2ParallelMergeLevelMinus2: return "Log2ParallelMergeLevelMinus2"; - case VideoEncodeH265CapabilityFlagBitsEXT::eSignDataHidingEnabled: return "SignDataHidingEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipEnabled: return "TransformSkipEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eTransformSkipDisabled: return "TransformSkipDisabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::ePpsSliceChromaQpOffsetsPresent: return "PpsSliceChromaQpOffsetsPresent"; - case VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPred: return "WeightedPred"; - case VideoEncodeH265CapabilityFlagBitsEXT::eWeightedBipred: return "WeightedBipred"; - case VideoEncodeH265CapabilityFlagBitsEXT::eWeightedPredNoTable: return "WeightedPredNoTable"; - case VideoEncodeH265CapabilityFlagBitsEXT::eTransquantBypassEnabled: return "TransquantBypassEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eEntropyCodingSyncEnabled: return "EntropyCodingSyncEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eDeblockingFilterOverrideEnabled: return "DeblockingFilterOverrideEnabled"; - case VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerFrame: return "MultipleTilePerFrame"; - case VideoEncodeH265CapabilityFlagBitsEXT::eMultipleSlicePerTile: return "MultipleSlicePerTile"; - case VideoEncodeH265CapabilityFlagBitsEXT::eMultipleTilePerSlice: return "MultipleTilePerSlice"; - case VideoEncodeH265CapabilityFlagBitsEXT::eSliceSegmentCtbCount: return "SliceSegmentCtbCount"; - case VideoEncodeH265CapabilityFlagBitsEXT::eRowUnalignedSliceSegment: return "RowUnalignedSliceSegment"; - case VideoEncodeH265CapabilityFlagBitsEXT::eDependentSliceSegment: return "DependentSliceSegment"; - case VideoEncodeH265CapabilityFlagBitsEXT::eDifferentSliceType: return "DifferentSliceType"; - case VideoEncodeH265CapabilityFlagBitsEXT::eBFrameInL1List: return "BFrameInL1List"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265InputModeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH265InputModeFlagBitsEXT::eFrame: return "Frame"; - case VideoEncodeH265InputModeFlagBitsEXT::eSliceSegment: return "SliceSegment"; - case VideoEncodeH265InputModeFlagBitsEXT::eNonVcl: return "NonVcl"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265OutputModeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH265OutputModeFlagBitsEXT::eFrame: return "Frame"; - case VideoEncodeH265OutputModeFlagBitsEXT::eSliceSegment: return "SliceSegment"; - case VideoEncodeH265OutputModeFlagBitsEXT::eNonVcl: return "NonVcl"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265CtbSizeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH265CtbSizeFlagBitsEXT::e16: return "16"; - case VideoEncodeH265CtbSizeFlagBitsEXT::e32: return "32"; - case VideoEncodeH265CtbSizeFlagBitsEXT::e64: return "64"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265TransformBlockSizeFlagBitsEXT value ) - { - switch ( value ) - { - case VideoEncodeH265TransformBlockSizeFlagBitsEXT::e4: return "4"; - case VideoEncodeH265TransformBlockSizeFlagBitsEXT::e8: return "8"; - case VideoEncodeH265TransformBlockSizeFlagBitsEXT::e16: return "16"; - case VideoEncodeH265TransformBlockSizeFlagBitsEXT::e32: return "32"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeH265RateControlStructureEXT value ) - { - switch ( value ) - { - case VideoEncodeH265RateControlStructureEXT::eUnknown: return "Unknown"; - case VideoEncodeH265RateControlStructureEXT::eFlat: return "Flat"; - case VideoEncodeH265RateControlStructureEXT::eDyadic: return "Dyadic"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_EXT_video_decode_h264 === - - VULKAN_HPP_INLINE std::string to_string( VideoDecodeH264PictureLayoutFlagBitsEXT value ) - { - switch ( value ) - { - case VideoDecodeH264PictureLayoutFlagBitsEXT::eProgressive: return "Progressive"; - case VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedInterleavedLines: return "InterlacedInterleavedLines"; - case VideoDecodeH264PictureLayoutFlagBitsEXT::eInterlacedSeparatePlanes: return "InterlacedSeparatePlanes"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_AMD_shader_info === - - VULKAN_HPP_INLINE std::string to_string( ShaderInfoTypeAMD value ) - { - switch ( value ) - { - case ShaderInfoTypeAMD::eStatistics: return "Statistics"; - case ShaderInfoTypeAMD::eBinary: return "Binary"; - case ShaderInfoTypeAMD::eDisassembly: return "Disassembly"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_GGP ) - //=== VK_GGP_stream_descriptor_surface === - - VULKAN_HPP_INLINE std::string to_string( StreamDescriptorSurfaceCreateFlagBitsGGP ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_GGP*/ - - //=== VK_NV_external_memory_capabilities === - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryHandleTypeFlagBitsNV value ) - { - switch ( value ) - { - case ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32: return "OpaqueWin32"; - case ExternalMemoryHandleTypeFlagBitsNV::eOpaqueWin32Kmt: return "OpaqueWin32Kmt"; - case ExternalMemoryHandleTypeFlagBitsNV::eD3D11Image: return "D3D11Image"; - case ExternalMemoryHandleTypeFlagBitsNV::eD3D11ImageKmt: return "D3D11ImageKmt"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ExternalMemoryFeatureFlagBitsNV value ) - { - switch ( value ) - { - case ExternalMemoryFeatureFlagBitsNV::eDedicatedOnly: return "DedicatedOnly"; - case ExternalMemoryFeatureFlagBitsNV::eExportable: return "Exportable"; - case ExternalMemoryFeatureFlagBitsNV::eImportable: return "Importable"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_validation_flags === - - VULKAN_HPP_INLINE std::string to_string( ValidationCheckEXT value ) - { - switch ( value ) - { - case ValidationCheckEXT::eAll: return "All"; - case ValidationCheckEXT::eShaders: return "Shaders"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_VI_NN ) - //=== VK_NN_vi_surface === - - VULKAN_HPP_INLINE std::string to_string( ViSurfaceCreateFlagBitsNN ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_VI_NN*/ - - //=== VK_EXT_pipeline_robustness === - - VULKAN_HPP_INLINE std::string to_string( PipelineRobustnessBufferBehaviorEXT value ) - { - switch ( value ) - { - case PipelineRobustnessBufferBehaviorEXT::eDeviceDefault: return "DeviceDefault"; - case PipelineRobustnessBufferBehaviorEXT::eDisabled: return "Disabled"; - case PipelineRobustnessBufferBehaviorEXT::eRobustBufferAccess: return "RobustBufferAccess"; - case PipelineRobustnessBufferBehaviorEXT::eRobustBufferAccess2: return "RobustBufferAccess2"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineRobustnessImageBehaviorEXT value ) - { - switch ( value ) - { - case PipelineRobustnessImageBehaviorEXT::eDeviceDefault: return "DeviceDefault"; - case PipelineRobustnessImageBehaviorEXT::eDisabled: return "Disabled"; - case PipelineRobustnessImageBehaviorEXT::eRobustImageAccess: return "RobustImageAccess"; - case PipelineRobustnessImageBehaviorEXT::eRobustImageAccess2: return "RobustImageAccess2"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_conditional_rendering === - - VULKAN_HPP_INLINE std::string to_string( ConditionalRenderingFlagBitsEXT value ) - { - switch ( value ) - { - case ConditionalRenderingFlagBitsEXT::eInverted: return "Inverted"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_display_surface_counter === - - VULKAN_HPP_INLINE std::string to_string( SurfaceCounterFlagBitsEXT value ) - { - switch ( value ) - { - case SurfaceCounterFlagBitsEXT::eVblank: return "Vblank"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_display_control === - - VULKAN_HPP_INLINE std::string to_string( DisplayPowerStateEXT value ) - { - switch ( value ) - { - case DisplayPowerStateEXT::eOff: return "Off"; - case DisplayPowerStateEXT::eSuspend: return "Suspend"; - case DisplayPowerStateEXT::eOn: return "On"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DeviceEventTypeEXT value ) - { - switch ( value ) - { - case DeviceEventTypeEXT::eDisplayHotplug: return "DisplayHotplug"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DisplayEventTypeEXT value ) - { - switch ( value ) - { - case DisplayEventTypeEXT::eFirstPixelOut: return "FirstPixelOut"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_viewport_swizzle === - - VULKAN_HPP_INLINE std::string to_string( ViewportCoordinateSwizzleNV value ) - { - switch ( value ) - { - case ViewportCoordinateSwizzleNV::ePositiveX: return "PositiveX"; - case ViewportCoordinateSwizzleNV::eNegativeX: return "NegativeX"; - case ViewportCoordinateSwizzleNV::ePositiveY: return "PositiveY"; - case ViewportCoordinateSwizzleNV::eNegativeY: return "NegativeY"; - case ViewportCoordinateSwizzleNV::ePositiveZ: return "PositiveZ"; - case ViewportCoordinateSwizzleNV::eNegativeZ: return "NegativeZ"; - case ViewportCoordinateSwizzleNV::ePositiveW: return "PositiveW"; - case ViewportCoordinateSwizzleNV::eNegativeW: return "NegativeW"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineViewportSwizzleStateCreateFlagBitsNV ) - { - return "(void)"; - } - - //=== VK_EXT_discard_rectangles === - - VULKAN_HPP_INLINE std::string to_string( DiscardRectangleModeEXT value ) - { - switch ( value ) - { - case DiscardRectangleModeEXT::eInclusive: return "Inclusive"; - case DiscardRectangleModeEXT::eExclusive: return "Exclusive"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDiscardRectangleStateCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_EXT_conservative_rasterization === - - VULKAN_HPP_INLINE std::string to_string( ConservativeRasterizationModeEXT value ) - { - switch ( value ) - { - case ConservativeRasterizationModeEXT::eDisabled: return "Disabled"; - case ConservativeRasterizationModeEXT::eOverestimate: return "Overestimate"; - case ConservativeRasterizationModeEXT::eUnderestimate: return "Underestimate"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationConservativeStateCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_EXT_depth_clip_enable === - - VULKAN_HPP_INLINE std::string to_string( PipelineRasterizationDepthClipStateCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_KHR_performance_query === - - VULKAN_HPP_INLINE std::string to_string( PerformanceCounterDescriptionFlagBitsKHR value ) - { - switch ( value ) - { - case PerformanceCounterDescriptionFlagBitsKHR::ePerformanceImpacting: return "PerformanceImpacting"; - case PerformanceCounterDescriptionFlagBitsKHR::eConcurrentlyImpacted: return "ConcurrentlyImpacted"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceCounterScopeKHR value ) - { - switch ( value ) - { - case PerformanceCounterScopeKHR::eCommandBuffer: return "CommandBuffer"; - case PerformanceCounterScopeKHR::eRenderPass: return "RenderPass"; - case PerformanceCounterScopeKHR::eCommand: return "Command"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceCounterStorageKHR value ) - { - switch ( value ) - { - case PerformanceCounterStorageKHR::eInt32: return "Int32"; - case PerformanceCounterStorageKHR::eInt64: return "Int64"; - case PerformanceCounterStorageKHR::eUint32: return "Uint32"; - case PerformanceCounterStorageKHR::eUint64: return "Uint64"; - case PerformanceCounterStorageKHR::eFloat32: return "Float32"; - case PerformanceCounterStorageKHR::eFloat64: return "Float64"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceCounterUnitKHR value ) - { - switch ( value ) - { - case PerformanceCounterUnitKHR::eGeneric: return "Generic"; - case PerformanceCounterUnitKHR::ePercentage: return "Percentage"; - case PerformanceCounterUnitKHR::eNanoseconds: return "Nanoseconds"; - case PerformanceCounterUnitKHR::eBytes: return "Bytes"; - case PerformanceCounterUnitKHR::eBytesPerSecond: return "BytesPerSecond"; - case PerformanceCounterUnitKHR::eKelvin: return "Kelvin"; - case PerformanceCounterUnitKHR::eWatts: return "Watts"; - case PerformanceCounterUnitKHR::eVolts: return "Volts"; - case PerformanceCounterUnitKHR::eAmps: return "Amps"; - case PerformanceCounterUnitKHR::eHertz: return "Hertz"; - case PerformanceCounterUnitKHR::eCycles: return "Cycles"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AcquireProfilingLockFlagBitsKHR ) - { - return "(void)"; - } - -#if defined( VK_USE_PLATFORM_IOS_MVK ) - //=== VK_MVK_ios_surface === - - VULKAN_HPP_INLINE std::string to_string( IOSSurfaceCreateFlagBitsMVK ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_IOS_MVK*/ - -#if defined( VK_USE_PLATFORM_MACOS_MVK ) - //=== VK_MVK_macos_surface === - - VULKAN_HPP_INLINE std::string to_string( MacOSSurfaceCreateFlagBitsMVK ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_MACOS_MVK*/ - - //=== VK_EXT_debug_utils === - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessageSeverityFlagBitsEXT value ) - { - switch ( value ) - { - case DebugUtilsMessageSeverityFlagBitsEXT::eVerbose: return "Verbose"; - case DebugUtilsMessageSeverityFlagBitsEXT::eInfo: return "Info"; - case DebugUtilsMessageSeverityFlagBitsEXT::eWarning: return "Warning"; - case DebugUtilsMessageSeverityFlagBitsEXT::eError: return "Error"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessageTypeFlagBitsEXT value ) - { - switch ( value ) - { - case DebugUtilsMessageTypeFlagBitsEXT::eGeneral: return "General"; - case DebugUtilsMessageTypeFlagBitsEXT::eValidation: return "Validation"; - case DebugUtilsMessageTypeFlagBitsEXT::ePerformance: return "Performance"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessengerCallbackDataFlagBitsEXT ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( DebugUtilsMessengerCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_EXT_blend_operation_advanced === - - VULKAN_HPP_INLINE std::string to_string( BlendOverlapEXT value ) - { - switch ( value ) - { - case BlendOverlapEXT::eUncorrelated: return "Uncorrelated"; - case BlendOverlapEXT::eDisjoint: return "Disjoint"; - case BlendOverlapEXT::eConjoint: return "Conjoint"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_fragment_coverage_to_color === - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageToColorStateCreateFlagBitsNV ) - { - return "(void)"; - } - - //=== VK_KHR_acceleration_structure === - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureTypeKHR value ) - { - switch ( value ) - { - case AccelerationStructureTypeKHR::eTopLevel: return "TopLevel"; - case AccelerationStructureTypeKHR::eBottomLevel: return "BottomLevel"; - case AccelerationStructureTypeKHR::eGeneric: return "Generic"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureBuildTypeKHR value ) - { - switch ( value ) - { - case AccelerationStructureBuildTypeKHR::eHost: return "Host"; - case AccelerationStructureBuildTypeKHR::eDevice: return "Device"; - case AccelerationStructureBuildTypeKHR::eHostOrDevice: return "HostOrDevice"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( GeometryFlagBitsKHR value ) - { - switch ( value ) - { - case GeometryFlagBitsKHR::eOpaque: return "Opaque"; - case GeometryFlagBitsKHR::eNoDuplicateAnyHitInvocation: return "NoDuplicateAnyHitInvocation"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( GeometryInstanceFlagBitsKHR value ) - { - switch ( value ) - { - case GeometryInstanceFlagBitsKHR::eTriangleFacingCullDisable: return "TriangleFacingCullDisable"; - case GeometryInstanceFlagBitsKHR::eTriangleFlipFacing: return "TriangleFlipFacing"; - case GeometryInstanceFlagBitsKHR::eForceOpaque: return "ForceOpaque"; - case GeometryInstanceFlagBitsKHR::eForceNoOpaque: return "ForceNoOpaque"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( BuildAccelerationStructureFlagBitsKHR value ) - { - switch ( value ) - { - case BuildAccelerationStructureFlagBitsKHR::eAllowUpdate: return "AllowUpdate"; - case BuildAccelerationStructureFlagBitsKHR::eAllowCompaction: return "AllowCompaction"; - case BuildAccelerationStructureFlagBitsKHR::ePreferFastTrace: return "PreferFastTrace"; - case BuildAccelerationStructureFlagBitsKHR::ePreferFastBuild: return "PreferFastBuild"; - case BuildAccelerationStructureFlagBitsKHR::eLowMemory: return "LowMemory"; - case BuildAccelerationStructureFlagBitsKHR::eMotionNV: return "MotionNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CopyAccelerationStructureModeKHR value ) - { - switch ( value ) - { - case CopyAccelerationStructureModeKHR::eClone: return "Clone"; - case CopyAccelerationStructureModeKHR::eCompact: return "Compact"; - case CopyAccelerationStructureModeKHR::eSerialize: return "Serialize"; - case CopyAccelerationStructureModeKHR::eDeserialize: return "Deserialize"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( GeometryTypeKHR value ) - { - switch ( value ) - { - case GeometryTypeKHR::eTriangles: return "Triangles"; - case GeometryTypeKHR::eAabbs: return "Aabbs"; - case GeometryTypeKHR::eInstances: return "Instances"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureCompatibilityKHR value ) - { - switch ( value ) - { - case AccelerationStructureCompatibilityKHR::eCompatible: return "Compatible"; - case AccelerationStructureCompatibilityKHR::eIncompatible: return "Incompatible"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureCreateFlagBitsKHR value ) - { - switch ( value ) - { - case AccelerationStructureCreateFlagBitsKHR::eDeviceAddressCaptureReplay: return "DeviceAddressCaptureReplay"; - case AccelerationStructureCreateFlagBitsKHR::eMotionNV: return "MotionNV"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( BuildAccelerationStructureModeKHR value ) - { - switch ( value ) - { - case BuildAccelerationStructureModeKHR::eBuild: return "Build"; - case BuildAccelerationStructureModeKHR::eUpdate: return "Update"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_framebuffer_mixed_samples === - - VULKAN_HPP_INLINE std::string to_string( CoverageModulationModeNV value ) - { - switch ( value ) - { - case CoverageModulationModeNV::eNone: return "None"; - case CoverageModulationModeNV::eRgb: return "Rgb"; - case CoverageModulationModeNV::eAlpha: return "Alpha"; - case CoverageModulationModeNV::eRgba: return "Rgba"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageModulationStateCreateFlagBitsNV ) - { - return "(void)"; - } - - //=== VK_EXT_validation_cache === - - VULKAN_HPP_INLINE std::string to_string( ValidationCacheHeaderVersionEXT value ) - { - switch ( value ) - { - case ValidationCacheHeaderVersionEXT::eOne: return "One"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ValidationCacheCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_NV_shading_rate_image === - - VULKAN_HPP_INLINE std::string to_string( ShadingRatePaletteEntryNV value ) - { - switch ( value ) - { - case ShadingRatePaletteEntryNV::eNoInvocations: return "NoInvocations"; - case ShadingRatePaletteEntryNV::e16InvocationsPerPixel: return "16InvocationsPerPixel"; - case ShadingRatePaletteEntryNV::e8InvocationsPerPixel: return "8InvocationsPerPixel"; - case ShadingRatePaletteEntryNV::e4InvocationsPerPixel: return "4InvocationsPerPixel"; - case ShadingRatePaletteEntryNV::e2InvocationsPerPixel: return "2InvocationsPerPixel"; - case ShadingRatePaletteEntryNV::e1InvocationPerPixel: return "1InvocationPerPixel"; - case ShadingRatePaletteEntryNV::e1InvocationPer2X1Pixels: return "1InvocationPer2X1Pixels"; - case ShadingRatePaletteEntryNV::e1InvocationPer1X2Pixels: return "1InvocationPer1X2Pixels"; - case ShadingRatePaletteEntryNV::e1InvocationPer2X2Pixels: return "1InvocationPer2X2Pixels"; - case ShadingRatePaletteEntryNV::e1InvocationPer4X2Pixels: return "1InvocationPer4X2Pixels"; - case ShadingRatePaletteEntryNV::e1InvocationPer2X4Pixels: return "1InvocationPer2X4Pixels"; - case ShadingRatePaletteEntryNV::e1InvocationPer4X4Pixels: return "1InvocationPer4X4Pixels"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( CoarseSampleOrderTypeNV value ) - { - switch ( value ) - { - case CoarseSampleOrderTypeNV::eDefault: return "Default"; - case CoarseSampleOrderTypeNV::eCustom: return "Custom"; - case CoarseSampleOrderTypeNV::ePixelMajor: return "PixelMajor"; - case CoarseSampleOrderTypeNV::eSampleMajor: return "SampleMajor"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_ray_tracing === - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMemoryRequirementsTypeNV value ) - { - switch ( value ) - { - case AccelerationStructureMemoryRequirementsTypeNV::eObject: return "Object"; - case AccelerationStructureMemoryRequirementsTypeNV::eBuildScratch: return "BuildScratch"; - case AccelerationStructureMemoryRequirementsTypeNV::eUpdateScratch: return "UpdateScratch"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_AMD_pipeline_compiler_control === - - VULKAN_HPP_INLINE std::string to_string( PipelineCompilerControlFlagBitsAMD ) - { - return "(void)"; - } - - //=== VK_EXT_calibrated_timestamps === - - VULKAN_HPP_INLINE std::string to_string( TimeDomainEXT value ) - { - switch ( value ) - { - case TimeDomainEXT::eDevice: return "Device"; - case TimeDomainEXT::eClockMonotonic: return "ClockMonotonic"; - case TimeDomainEXT::eClockMonotonicRaw: return "ClockMonotonicRaw"; - case TimeDomainEXT::eQueryPerformanceCounter: return "QueryPerformanceCounter"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_KHR_global_priority === - - VULKAN_HPP_INLINE std::string to_string( QueueGlobalPriorityKHR value ) - { - switch ( value ) - { - case QueueGlobalPriorityKHR::eLow: return "Low"; - case QueueGlobalPriorityKHR::eMedium: return "Medium"; - case QueueGlobalPriorityKHR::eHigh: return "High"; - case QueueGlobalPriorityKHR::eRealtime: return "Realtime"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_AMD_memory_overallocation_behavior === - - VULKAN_HPP_INLINE std::string to_string( MemoryOverallocationBehaviorAMD value ) - { - switch ( value ) - { - case MemoryOverallocationBehaviorAMD::eDefault: return "Default"; - case MemoryOverallocationBehaviorAMD::eAllowed: return "Allowed"; - case MemoryOverallocationBehaviorAMD::eDisallowed: return "Disallowed"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_INTEL_performance_query === - - VULKAN_HPP_INLINE std::string to_string( PerformanceConfigurationTypeINTEL value ) - { - switch ( value ) - { - case PerformanceConfigurationTypeINTEL::eCommandQueueMetricsDiscoveryActivated: return "CommandQueueMetricsDiscoveryActivated"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( QueryPoolSamplingModeINTEL value ) - { - switch ( value ) - { - case QueryPoolSamplingModeINTEL::eManual: return "Manual"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceOverrideTypeINTEL value ) - { - switch ( value ) - { - case PerformanceOverrideTypeINTEL::eNullHardware: return "NullHardware"; - case PerformanceOverrideTypeINTEL::eFlushGpuCaches: return "FlushGpuCaches"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceParameterTypeINTEL value ) - { - switch ( value ) - { - case PerformanceParameterTypeINTEL::eHwCountersSupported: return "HwCountersSupported"; - case PerformanceParameterTypeINTEL::eStreamMarkerValidBits: return "StreamMarkerValidBits"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PerformanceValueTypeINTEL value ) - { - switch ( value ) - { - case PerformanceValueTypeINTEL::eUint32: return "Uint32"; - case PerformanceValueTypeINTEL::eUint64: return "Uint64"; - case PerformanceValueTypeINTEL::eFloat: return "Float"; - case PerformanceValueTypeINTEL::eBool: return "Bool"; - case PerformanceValueTypeINTEL::eString: return "String"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_imagepipe_surface === - - VULKAN_HPP_INLINE std::string to_string( ImagePipeSurfaceCreateFlagBitsFUCHSIA ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_surface === - - VULKAN_HPP_INLINE std::string to_string( MetalSurfaceCreateFlagBitsEXT ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_KHR_fragment_shading_rate === - - VULKAN_HPP_INLINE std::string to_string( FragmentShadingRateCombinerOpKHR value ) - { - switch ( value ) - { - case FragmentShadingRateCombinerOpKHR::eKeep: return "Keep"; - case FragmentShadingRateCombinerOpKHR::eReplace: return "Replace"; - case FragmentShadingRateCombinerOpKHR::eMin: return "Min"; - case FragmentShadingRateCombinerOpKHR::eMax: return "Max"; - case FragmentShadingRateCombinerOpKHR::eMul: return "Mul"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_AMD_shader_core_properties2 === - - VULKAN_HPP_INLINE std::string to_string( ShaderCorePropertiesFlagBitsAMD ) - { - return "(void)"; - } - - //=== VK_EXT_validation_features === - - VULKAN_HPP_INLINE std::string to_string( ValidationFeatureEnableEXT value ) - { - switch ( value ) - { - case ValidationFeatureEnableEXT::eGpuAssisted: return "GpuAssisted"; - case ValidationFeatureEnableEXT::eGpuAssistedReserveBindingSlot: return "GpuAssistedReserveBindingSlot"; - case ValidationFeatureEnableEXT::eBestPractices: return "BestPractices"; - case ValidationFeatureEnableEXT::eDebugPrintf: return "DebugPrintf"; - case ValidationFeatureEnableEXT::eSynchronizationValidation: return "SynchronizationValidation"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ValidationFeatureDisableEXT value ) - { - switch ( value ) - { - case ValidationFeatureDisableEXT::eAll: return "All"; - case ValidationFeatureDisableEXT::eShaders: return "Shaders"; - case ValidationFeatureDisableEXT::eThreadSafety: return "ThreadSafety"; - case ValidationFeatureDisableEXT::eApiParameters: return "ApiParameters"; - case ValidationFeatureDisableEXT::eObjectLifetimes: return "ObjectLifetimes"; - case ValidationFeatureDisableEXT::eCoreChecks: return "CoreChecks"; - case ValidationFeatureDisableEXT::eUniqueHandles: return "UniqueHandles"; - case ValidationFeatureDisableEXT::eShaderValidationCache: return "ShaderValidationCache"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_cooperative_matrix === - - VULKAN_HPP_INLINE std::string to_string( ScopeNV value ) - { - switch ( value ) - { - case ScopeNV::eDevice: return "Device"; - case ScopeNV::eWorkgroup: return "Workgroup"; - case ScopeNV::eSubgroup: return "Subgroup"; - case ScopeNV::eQueueFamily: return "QueueFamily"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ComponentTypeNV value ) - { - switch ( value ) - { - case ComponentTypeNV::eFloat16: return "Float16"; - case ComponentTypeNV::eFloat32: return "Float32"; - case ComponentTypeNV::eFloat64: return "Float64"; - case ComponentTypeNV::eSint8: return "Sint8"; - case ComponentTypeNV::eSint16: return "Sint16"; - case ComponentTypeNV::eSint32: return "Sint32"; - case ComponentTypeNV::eSint64: return "Sint64"; - case ComponentTypeNV::eUint8: return "Uint8"; - case ComponentTypeNV::eUint16: return "Uint16"; - case ComponentTypeNV::eUint32: return "Uint32"; - case ComponentTypeNV::eUint64: return "Uint64"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_coverage_reduction_mode === - - VULKAN_HPP_INLINE std::string to_string( CoverageReductionModeNV value ) - { - switch ( value ) - { - case CoverageReductionModeNV::eMerge: return "Merge"; - case CoverageReductionModeNV::eTruncate: return "Truncate"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineCoverageReductionStateCreateFlagBitsNV ) - { - return "(void)"; - } - - //=== VK_EXT_provoking_vertex === - - VULKAN_HPP_INLINE std::string to_string( ProvokingVertexModeEXT value ) - { - switch ( value ) - { - case ProvokingVertexModeEXT::eFirstVertex: return "FirstVertex"; - case ProvokingVertexModeEXT::eLastVertex: return "LastVertex"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_WIN32_KHR ) - //=== VK_EXT_full_screen_exclusive === - - VULKAN_HPP_INLINE std::string to_string( FullScreenExclusiveEXT value ) - { - switch ( value ) - { - case FullScreenExclusiveEXT::eDefault: return "Default"; - case FullScreenExclusiveEXT::eAllowed: return "Allowed"; - case FullScreenExclusiveEXT::eDisallowed: return "Disallowed"; - case FullScreenExclusiveEXT::eApplicationControlled: return "ApplicationControlled"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } -#endif /*VK_USE_PLATFORM_WIN32_KHR*/ - - //=== VK_EXT_headless_surface === - - VULKAN_HPP_INLINE std::string to_string( HeadlessSurfaceCreateFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_EXT_line_rasterization === - - VULKAN_HPP_INLINE std::string to_string( LineRasterizationModeEXT value ) - { - switch ( value ) - { - case LineRasterizationModeEXT::eDefault: return "Default"; - case LineRasterizationModeEXT::eRectangular: return "Rectangular"; - case LineRasterizationModeEXT::eBresenham: return "Bresenham"; - case LineRasterizationModeEXT::eRectangularSmooth: return "RectangularSmooth"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_KHR_pipeline_executable_properties === - - VULKAN_HPP_INLINE std::string to_string( PipelineExecutableStatisticFormatKHR value ) - { - switch ( value ) - { - case PipelineExecutableStatisticFormatKHR::eBool32: return "Bool32"; - case PipelineExecutableStatisticFormatKHR::eInt64: return "Int64"; - case PipelineExecutableStatisticFormatKHR::eUint64: return "Uint64"; - case PipelineExecutableStatisticFormatKHR::eFloat64: return "Float64"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_device_generated_commands === - - VULKAN_HPP_INLINE std::string to_string( IndirectStateFlagBitsNV value ) - { - switch ( value ) - { - case IndirectStateFlagBitsNV::eFlagFrontface: return "FlagFrontface"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( IndirectCommandsTokenTypeNV value ) - { - switch ( value ) - { - case IndirectCommandsTokenTypeNV::eShaderGroup: return "ShaderGroup"; - case IndirectCommandsTokenTypeNV::eStateFlags: return "StateFlags"; - case IndirectCommandsTokenTypeNV::eIndexBuffer: return "IndexBuffer"; - case IndirectCommandsTokenTypeNV::eVertexBuffer: return "VertexBuffer"; - case IndirectCommandsTokenTypeNV::ePushConstant: return "PushConstant"; - case IndirectCommandsTokenTypeNV::eDrawIndexed: return "DrawIndexed"; - case IndirectCommandsTokenTypeNV::eDraw: return "Draw"; - case IndirectCommandsTokenTypeNV::eDrawTasks: return "DrawTasks"; - case IndirectCommandsTokenTypeNV::eDrawMeshTasks: return "DrawMeshTasks"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( IndirectCommandsLayoutUsageFlagBitsNV value ) - { - switch ( value ) - { - case IndirectCommandsLayoutUsageFlagBitsNV::eExplicitPreprocess: return "ExplicitPreprocess"; - case IndirectCommandsLayoutUsageFlagBitsNV::eIndexedSequences: return "IndexedSequences"; - case IndirectCommandsLayoutUsageFlagBitsNV::eUnorderedSequences: return "UnorderedSequences"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_device_memory_report === - - VULKAN_HPP_INLINE std::string to_string( DeviceMemoryReportEventTypeEXT value ) - { - switch ( value ) - { - case DeviceMemoryReportEventTypeEXT::eAllocate: return "Allocate"; - case DeviceMemoryReportEventTypeEXT::eFree: return "Free"; - case DeviceMemoryReportEventTypeEXT::eImport: return "Import"; - case DeviceMemoryReportEventTypeEXT::eUnimport: return "Unimport"; - case DeviceMemoryReportEventTypeEXT::eAllocationFailed: return "AllocationFailed"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( DeviceMemoryReportFlagBitsEXT ) - { - return "(void)"; - } - - //=== VK_EXT_pipeline_creation_cache_control === - - VULKAN_HPP_INLINE std::string to_string( PipelineCacheCreateFlagBits value ) - { - switch ( value ) - { - case PipelineCacheCreateFlagBits::eExternallySynchronized: return "ExternallySynchronized"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_ENABLE_BETA_EXTENSIONS ) - //=== VK_KHR_video_encode_queue === - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeCapabilityFlagBitsKHR value ) - { - switch ( value ) - { - case VideoEncodeCapabilityFlagBitsKHR::ePrecedingExternallyEncodedBytes: return "PrecedingExternallyEncodedBytes"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeUsageFlagBitsKHR value ) - { - switch ( value ) - { - case VideoEncodeUsageFlagBitsKHR::eDefault: return "Default"; - case VideoEncodeUsageFlagBitsKHR::eTranscoding: return "Transcoding"; - case VideoEncodeUsageFlagBitsKHR::eStreaming: return "Streaming"; - case VideoEncodeUsageFlagBitsKHR::eRecording: return "Recording"; - case VideoEncodeUsageFlagBitsKHR::eConferencing: return "Conferencing"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeContentFlagBitsKHR value ) - { - switch ( value ) - { - case VideoEncodeContentFlagBitsKHR::eDefault: return "Default"; - case VideoEncodeContentFlagBitsKHR::eCamera: return "Camera"; - case VideoEncodeContentFlagBitsKHR::eDesktop: return "Desktop"; - case VideoEncodeContentFlagBitsKHR::eRendered: return "Rendered"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeTuningModeKHR value ) - { - switch ( value ) - { - case VideoEncodeTuningModeKHR::eDefault: return "Default"; - case VideoEncodeTuningModeKHR::eHighQuality: return "HighQuality"; - case VideoEncodeTuningModeKHR::eLowLatency: return "LowLatency"; - case VideoEncodeTuningModeKHR::eUltraLowLatency: return "UltraLowLatency"; - case VideoEncodeTuningModeKHR::eLossless: return "Lossless"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeRateControlModeFlagBitsKHR value ) - { - switch ( value ) - { - case VideoEncodeRateControlModeFlagBitsKHR::eNone: return "None"; - case VideoEncodeRateControlModeFlagBitsKHR::eCbr: return "Cbr"; - case VideoEncodeRateControlModeFlagBitsKHR::eVbr: return "Vbr"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeFlagBitsKHR ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( VideoEncodeRateControlFlagBitsKHR ) - { - return "(void)"; - } -#endif /*VK_ENABLE_BETA_EXTENSIONS*/ - - //=== VK_NV_device_diagnostics_config === - - VULKAN_HPP_INLINE std::string to_string( DeviceDiagnosticsConfigFlagBitsNV value ) - { - switch ( value ) - { - case DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderDebugInfo: return "EnableShaderDebugInfo"; - case DeviceDiagnosticsConfigFlagBitsNV::eEnableResourceTracking: return "EnableResourceTracking"; - case DeviceDiagnosticsConfigFlagBitsNV::eEnableAutomaticCheckpoints: return "EnableAutomaticCheckpoints"; - case DeviceDiagnosticsConfigFlagBitsNV::eEnableShaderErrorReporting: return "EnableShaderErrorReporting"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_METAL_EXT ) - //=== VK_EXT_metal_objects === - - VULKAN_HPP_INLINE std::string to_string( ExportMetalObjectTypeFlagBitsEXT value ) - { - switch ( value ) - { - case ExportMetalObjectTypeFlagBitsEXT::eMetalDevice: return "MetalDevice"; - case ExportMetalObjectTypeFlagBitsEXT::eMetalCommandQueue: return "MetalCommandQueue"; - case ExportMetalObjectTypeFlagBitsEXT::eMetalBuffer: return "MetalBuffer"; - case ExportMetalObjectTypeFlagBitsEXT::eMetalTexture: return "MetalTexture"; - case ExportMetalObjectTypeFlagBitsEXT::eMetalIosurface: return "MetalIosurface"; - case ExportMetalObjectTypeFlagBitsEXT::eMetalSharedEvent: return "MetalSharedEvent"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } -#endif /*VK_USE_PLATFORM_METAL_EXT*/ - - //=== VK_EXT_graphics_pipeline_library === - - VULKAN_HPP_INLINE std::string to_string( GraphicsPipelineLibraryFlagBitsEXT value ) - { - switch ( value ) - { - case GraphicsPipelineLibraryFlagBitsEXT::eVertexInputInterface: return "VertexInputInterface"; - case GraphicsPipelineLibraryFlagBitsEXT::ePreRasterizationShaders: return "PreRasterizationShaders"; - case GraphicsPipelineLibraryFlagBitsEXT::eFragmentShader: return "FragmentShader"; - case GraphicsPipelineLibraryFlagBitsEXT::eFragmentOutputInterface: return "FragmentOutputInterface"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineLayoutCreateFlagBits value ) - { - switch ( value ) - { - case PipelineLayoutCreateFlagBits::eIndependentSetsEXT: return "IndependentSetsEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_fragment_shading_rate_enums === - - VULKAN_HPP_INLINE std::string to_string( FragmentShadingRateNV value ) - { - switch ( value ) - { - case FragmentShadingRateNV::e1InvocationPerPixel: return "1InvocationPerPixel"; - case FragmentShadingRateNV::e1InvocationPer1X2Pixels: return "1InvocationPer1X2Pixels"; - case FragmentShadingRateNV::e1InvocationPer2X1Pixels: return "1InvocationPer2X1Pixels"; - case FragmentShadingRateNV::e1InvocationPer2X2Pixels: return "1InvocationPer2X2Pixels"; - case FragmentShadingRateNV::e1InvocationPer2X4Pixels: return "1InvocationPer2X4Pixels"; - case FragmentShadingRateNV::e1InvocationPer4X2Pixels: return "1InvocationPer4X2Pixels"; - case FragmentShadingRateNV::e1InvocationPer4X4Pixels: return "1InvocationPer4X4Pixels"; - case FragmentShadingRateNV::e2InvocationsPerPixel: return "2InvocationsPerPixel"; - case FragmentShadingRateNV::e4InvocationsPerPixel: return "4InvocationsPerPixel"; - case FragmentShadingRateNV::e8InvocationsPerPixel: return "8InvocationsPerPixel"; - case FragmentShadingRateNV::e16InvocationsPerPixel: return "16InvocationsPerPixel"; - case FragmentShadingRateNV::eNoInvocations: return "NoInvocations"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( FragmentShadingRateTypeNV value ) - { - switch ( value ) - { - case FragmentShadingRateTypeNV::eFragmentSize: return "FragmentSize"; - case FragmentShadingRateTypeNV::eEnums: return "Enums"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_NV_ray_tracing_motion_blur === - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMotionInstanceTypeNV value ) - { - switch ( value ) - { - case AccelerationStructureMotionInstanceTypeNV::eStatic: return "Static"; - case AccelerationStructureMotionInstanceTypeNV::eMatrixMotion: return "MatrixMotion"; - case AccelerationStructureMotionInstanceTypeNV::eSrtMotion: return "SrtMotion"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMotionInfoFlagBitsNV ) - { - return "(void)"; - } - - VULKAN_HPP_INLINE std::string to_string( AccelerationStructureMotionInstanceFlagBitsNV ) - { - return "(void)"; - } - - //=== VK_EXT_image_compression_control === - - VULKAN_HPP_INLINE std::string to_string( ImageCompressionFlagBitsEXT value ) - { - switch ( value ) - { - case ImageCompressionFlagBitsEXT::eDefault: return "Default"; - case ImageCompressionFlagBitsEXT::eFixedRateDefault: return "FixedRateDefault"; - case ImageCompressionFlagBitsEXT::eFixedRateExplicit: return "FixedRateExplicit"; - case ImageCompressionFlagBitsEXT::eDisabled: return "Disabled"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageCompressionFixedRateFlagBitsEXT value ) - { - switch ( value ) - { - case ImageCompressionFixedRateFlagBitsEXT::eNone: return "None"; - case ImageCompressionFixedRateFlagBitsEXT::e1Bpc: return "1Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e2Bpc: return "2Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e3Bpc: return "3Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e4Bpc: return "4Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e5Bpc: return "5Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e6Bpc: return "6Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e7Bpc: return "7Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e8Bpc: return "8Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e9Bpc: return "9Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e10Bpc: return "10Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e11Bpc: return "11Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e12Bpc: return "12Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e13Bpc: return "13Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e14Bpc: return "14Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e15Bpc: return "15Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e16Bpc: return "16Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e17Bpc: return "17Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e18Bpc: return "18Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e19Bpc: return "19Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e20Bpc: return "20Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e21Bpc: return "21Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e22Bpc: return "22Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e23Bpc: return "23Bpc"; - case ImageCompressionFixedRateFlagBitsEXT::e24Bpc: return "24Bpc"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_DIRECTFB_EXT ) - //=== VK_EXT_directfb_surface === - - VULKAN_HPP_INLINE std::string to_string( DirectFBSurfaceCreateFlagBitsEXT ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_DIRECTFB_EXT*/ - - //=== VK_KHR_ray_tracing_pipeline === - - VULKAN_HPP_INLINE std::string to_string( RayTracingShaderGroupTypeKHR value ) - { - switch ( value ) - { - case RayTracingShaderGroupTypeKHR::eGeneral: return "General"; - case RayTracingShaderGroupTypeKHR::eTrianglesHitGroup: return "TrianglesHitGroup"; - case RayTracingShaderGroupTypeKHR::eProceduralHitGroup: return "ProceduralHitGroup"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ShaderGroupShaderKHR value ) - { - switch ( value ) - { - case ShaderGroupShaderKHR::eGeneral: return "General"; - case ShaderGroupShaderKHR::eClosestHit: return "ClosestHit"; - case ShaderGroupShaderKHR::eAnyHit: return "AnyHit"; - case ShaderGroupShaderKHR::eIntersection: return "Intersection"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -#if defined( VK_USE_PLATFORM_FUCHSIA ) - //=== VK_FUCHSIA_buffer_collection === - - VULKAN_HPP_INLINE std::string to_string( ImageConstraintsInfoFlagBitsFUCHSIA value ) - { - switch ( value ) - { - case ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadRarely: return "CpuReadRarely"; - case ImageConstraintsInfoFlagBitsFUCHSIA::eCpuReadOften: return "CpuReadOften"; - case ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteRarely: return "CpuWriteRarely"; - case ImageConstraintsInfoFlagBitsFUCHSIA::eCpuWriteOften: return "CpuWriteOften"; - case ImageConstraintsInfoFlagBitsFUCHSIA::eProtectedOptional: return "ProtectedOptional"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( ImageFormatConstraintsFlagBitsFUCHSIA ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_FUCHSIA*/ - -#if defined( VK_USE_PLATFORM_SCREEN_QNX ) - //=== VK_QNX_screen_surface === - - VULKAN_HPP_INLINE std::string to_string( ScreenSurfaceCreateFlagBitsQNX ) - { - return "(void)"; - } -#endif /*VK_USE_PLATFORM_SCREEN_QNX*/ - - //=== VK_EXT_subpass_merge_feedback === - - VULKAN_HPP_INLINE std::string to_string( SubpassMergeStatusEXT value ) - { - switch ( value ) - { - case SubpassMergeStatusEXT::eMerged: return "Merged"; - case SubpassMergeStatusEXT::eDisallowed: return "Disallowed"; - case SubpassMergeStatusEXT::eNotMergedSideEffects: return "NotMergedSideEffects"; - case SubpassMergeStatusEXT::eNotMergedSamplesMismatch: return "NotMergedSamplesMismatch"; - case SubpassMergeStatusEXT::eNotMergedViewsMismatch: return "NotMergedViewsMismatch"; - case SubpassMergeStatusEXT::eNotMergedAliasing: return "NotMergedAliasing"; - case SubpassMergeStatusEXT::eNotMergedDependencies: return "NotMergedDependencies"; - case SubpassMergeStatusEXT::eNotMergedIncompatibleInputAttachment: return "NotMergedIncompatibleInputAttachment"; - case SubpassMergeStatusEXT::eNotMergedTooManyAttachments: return "NotMergedTooManyAttachments"; - case SubpassMergeStatusEXT::eNotMergedInsufficientStorage: return "NotMergedInsufficientStorage"; - case SubpassMergeStatusEXT::eNotMergedDepthStencilCount: return "NotMergedDepthStencilCount"; - case SubpassMergeStatusEXT::eNotMergedResolveAttachmentReuse: return "NotMergedResolveAttachmentReuse"; - case SubpassMergeStatusEXT::eNotMergedSingleSubpass: return "NotMergedSingleSubpass"; - case SubpassMergeStatusEXT::eNotMergedUnspecified: return "NotMergedUnspecified"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - //=== VK_EXT_rasterization_order_attachment_access === - - VULKAN_HPP_INLINE std::string to_string( PipelineColorBlendStateCreateFlagBits value ) - { - switch ( value ) - { - case PipelineColorBlendStateCreateFlagBits::eRasterizationOrderAttachmentAccessEXT: return "RasterizationOrderAttachmentAccessEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - - VULKAN_HPP_INLINE std::string to_string( PipelineDepthStencilStateCreateFlagBits value ) - { - switch ( value ) - { - case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentDepthAccessEXT: return "RasterizationOrderAttachmentDepthAccessEXT"; - case PipelineDepthStencilStateCreateFlagBits::eRasterizationOrderAttachmentStencilAccessEXT: return "RasterizationOrderAttachmentStencilAccessEXT"; - default: return "invalid ( " + VULKAN_HPP_NAMESPACE::toHexString( static_cast( value ) ) + " )"; - } - } - -} // namespace VULKAN_HPP_NAMESPACE -#endif diff --git a/src/video/khronos/vulkan/vulkan_vi.h b/src/video/khronos/vulkan/vulkan_vi.h index 0355e7a162ca6..c145f4a800faf 100644 --- a/src/video/khronos/vulkan/vulkan_vi.h +++ b/src/video/khronos/vulkan/vulkan_vi.h @@ -2,7 +2,7 @@ #define VULKAN_VI_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_NN_vi_surface is a preprocessor guard. Do not pass it to API calls. #define VK_NN_vi_surface 1 #define VK_NN_VI_SURFACE_SPEC_VERSION 1 #define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" diff --git a/src/video/khronos/vulkan/vulkan_wayland.h b/src/video/khronos/vulkan/vulkan_wayland.h index 9afd0b76d5f12..ec706a114b512 100644 --- a/src/video/khronos/vulkan/vulkan_wayland.h +++ b/src/video/khronos/vulkan/vulkan_wayland.h @@ -2,7 +2,7 @@ #define VULKAN_WAYLAND_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_KHR_wayland_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_wayland_surface 1 #define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 #define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" diff --git a/src/video/khronos/vulkan/vulkan_win32.h b/src/video/khronos/vulkan/vulkan_win32.h index affe0c02aefb6..d7a0b2bab4f17 100644 --- a/src/video/khronos/vulkan/vulkan_win32.h +++ b/src/video/khronos/vulkan/vulkan_win32.h @@ -2,7 +2,7 @@ #define VULKAN_WIN32_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_KHR_win32_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_win32_surface 1 #define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6 #define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface" @@ -47,6 +48,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( #endif +// VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_memory_win32 1 #define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32" @@ -96,6 +98,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( #endif +// VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_win32_keyed_mutex 1 #define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1 #define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex" @@ -113,6 +116,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR { +// VK_KHR_external_semaphore_win32 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_semaphore_win32 1 #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32" @@ -165,6 +169,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( #endif +// VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_external_fence_win32 1 #define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1 #define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32" @@ -208,6 +213,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( #endif +// VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls. #define VK_NV_external_memory_win32 1 #define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1 #define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32" @@ -236,6 +242,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( #endif +// VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls. #define VK_NV_win32_keyed_mutex 1 #define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 2 #define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex" @@ -253,6 +260,7 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV { +// VK_EXT_full_screen_exclusive is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_full_screen_exclusive 1 #define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 4 #define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive" @@ -308,6 +316,25 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT( VkDeviceGroupPresentModeFlagsKHR* pModes); #endif + +// VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls. +#define VK_NV_acquire_winrt_display 1 +#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1 +#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display" +typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display); +typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay); + +#ifndef VK_NO_PROTOTYPES +VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + VkDisplayKHR display); + +VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV( + VkPhysicalDevice physicalDevice, + uint32_t deviceRelativeId, + VkDisplayKHR* pDisplay); +#endif + #ifdef __cplusplus } #endif diff --git a/src/video/khronos/vulkan/vulkan_xcb.h b/src/video/khronos/vulkan/vulkan_xcb.h index 68e61b88f0dc0..cdf6b5269f14b 100644 --- a/src/video/khronos/vulkan/vulkan_xcb.h +++ b/src/video/khronos/vulkan/vulkan_xcb.h @@ -2,7 +2,7 @@ #define VULKAN_XCB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_KHR_xcb_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_xcb_surface 1 #define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 #define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" diff --git a/src/video/khronos/vulkan/vulkan_xlib.h b/src/video/khronos/vulkan/vulkan_xlib.h index ea5360ab647ba..b3c3e27d77758 100644 --- a/src/video/khronos/vulkan/vulkan_xlib.h +++ b/src/video/khronos/vulkan/vulkan_xlib.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_KHR_xlib_surface is a preprocessor guard. Do not pass it to API calls. #define VK_KHR_xlib_surface 1 #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" diff --git a/src/video/khronos/vulkan/vulkan_xlib_xrandr.h b/src/video/khronos/vulkan/vulkan_xlib_xrandr.h index 8fc35cfc56e4b..8e99190b4ffe4 100644 --- a/src/video/khronos/vulkan/vulkan_xlib_xrandr.h +++ b/src/video/khronos/vulkan/vulkan_xlib_xrandr.h @@ -2,7 +2,7 @@ #define VULKAN_XLIB_XRANDR_H_ 1 /* -** Copyright 2015-2022 The Khronos Group Inc. +** Copyright 2015-2024 The Khronos Group Inc. ** ** SPDX-License-Identifier: Apache-2.0 */ @@ -19,6 +19,7 @@ extern "C" { +// VK_EXT_acquire_xlib_display is a preprocessor guard. Do not pass it to API calls. #define VK_EXT_acquire_xlib_display 1 #define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 #define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" diff --git a/src/video/kmsdrm/SDL_kmsdrmdyn.c b/src/video/kmsdrm/SDL_kmsdrmdyn.c index bf3ff2e3e8a14..294739405dc5a 100644 --- a/src/video/kmsdrm/SDL_kmsdrmdyn.c +++ b/src/video/kmsdrm/SDL_kmsdrmdyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM #define DEBUG_DYNAMIC_KMSDRM 0 @@ -38,40 +38,38 @@ typedef struct const char *libname; } kmsdrmdynlib; -#ifndef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC -#define SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC NULL -#endif #ifndef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM #define SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM NULL #endif static kmsdrmdynlib kmsdrmlibs[] = { - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM}, - {NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC} + { NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM }, + { NULL, SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC } }; -static void * -KMSDRM_GetSym(const char *fnname, int *pHasModule) +static void *KMSDRM_GetSym(const char *fnname, int *pHasModule, SDL_bool required) { int i; void *fn = NULL; for (i = 0; i < SDL_TABLESIZE(kmsdrmlibs); i++) { - if (kmsdrmlibs[i].lib != NULL) { + if (kmsdrmlibs[i].lib) { fn = SDL_LoadFunction(kmsdrmlibs[i].lib, fnname); - if (fn != NULL) + if (fn) { break; + } } } #if DEBUG_DYNAMIC_KMSDRM - if (fn != NULL) + if (fn) SDL_Log("KMSDRM: Found '%s' in %s (%p)\n", fnname, kmsdrmlibs[i].libname, fn); else SDL_Log("KMSDRM: Symbol '%s' NOT FOUND!\n", fnname); #endif - if (fn == NULL) - *pHasModule = 0; /* kill this module. */ + if (!fn && required) { + *pHasModule = 0; /* kill this module. */ + } return fn; } @@ -79,15 +77,15 @@ KMSDRM_GetSym(const char *fnname, int *pHasModule) #endif /* SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC */ /* Define all the function pointers and wrappers... */ -#define SDL_KMSDRM_MODULE(modname) int SDL_KMSDRM_HAVE_##modname = 0; -#define SDL_KMSDRM_SYM(rc,fn,params) SDL_DYNKMSDRMFN_##fn KMSDRM_##fn = NULL; -#define SDL_KMSDRM_SYM_CONST(type,name) SDL_DYNKMSDRMCONST_##name KMSDRM_##name = NULL; +#define SDL_KMSDRM_MODULE(modname) int SDL_KMSDRM_HAVE_##modname = 0; +#define SDL_KMSDRM_SYM(rc, fn, params) SDL_DYNKMSDRMFN_##fn KMSDRM_##fn = NULL; +#define SDL_KMSDRM_SYM_CONST(type, name) SDL_DYNKMSDRMCONST_##name KMSDRM_##name = NULL; +#define SDL_KMSDRM_SYM_OPT(rc, fn, params) SDL_DYNKMSDRMFN_##fn KMSDRM_##fn = NULL; #include "SDL_kmsdrmsym.h" static int kmsdrm_load_refcount = 0; -void -SDL_KMSDRM_UnloadSymbols(void) +void SDL_KMSDRM_UnloadSymbols(void) { /* Don't actually unload if more than one module is using the libs... */ if (kmsdrm_load_refcount > 0) { @@ -97,15 +95,15 @@ SDL_KMSDRM_UnloadSymbols(void) #endif /* set all the function pointers to NULL. */ -#define SDL_KMSDRM_MODULE(modname) SDL_KMSDRM_HAVE_##modname = 0; -#define SDL_KMSDRM_SYM(rc,fn,params) KMSDRM_##fn = NULL; -#define SDL_KMSDRM_SYM_CONST(type,name) KMSDRM_##name = NULL; +#define SDL_KMSDRM_MODULE(modname) SDL_KMSDRM_HAVE_##modname = 0; +#define SDL_KMSDRM_SYM(rc, fn, params) KMSDRM_##fn = NULL; +#define SDL_KMSDRM_SYM_CONST(type, name) KMSDRM_##name = NULL; +#define SDL_KMSDRM_SYM_OPT(rc, fn, params) KMSDRM_##fn = NULL; #include "SDL_kmsdrmsym.h" - #ifdef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC for (i = 0; i < SDL_TABLESIZE(kmsdrmlibs); i++) { - if (kmsdrmlibs[i].lib != NULL) { + if (kmsdrmlibs[i].lib) { SDL_UnloadObject(kmsdrmlibs[i].lib); kmsdrmlibs[i].lib = NULL; } @@ -116,10 +114,9 @@ SDL_KMSDRM_UnloadSymbols(void) } /* returns non-zero if all needed symbols were loaded. */ -int -SDL_KMSDRM_LoadSymbols(void) +int SDL_KMSDRM_LoadSymbols(void) { - int rc = 1; /* always succeed if not using Dynamic KMSDRM stuff. */ + int rc = 1; /* always succeed if not using Dynamic KMSDRM stuff. */ /* deal with multiple modules needing these symbols... */ if (kmsdrm_load_refcount++ == 0) { @@ -127,7 +124,7 @@ SDL_KMSDRM_LoadSymbols(void) int i; int *thismod = NULL; for (i = 0; i < SDL_TABLESIZE(kmsdrmlibs); i++) { - if (kmsdrmlibs[i].libname != NULL) { + if (kmsdrmlibs[i].libname) { kmsdrmlibs[i].lib = SDL_LoadObject(kmsdrmlibs[i].libname); } } @@ -135,9 +132,10 @@ SDL_KMSDRM_LoadSymbols(void) #define SDL_KMSDRM_MODULE(modname) SDL_KMSDRM_HAVE_##modname = 1; /* default yes */ #include "SDL_kmsdrmsym.h" -#define SDL_KMSDRM_MODULE(modname) thismod = &SDL_KMSDRM_HAVE_##modname; -#define SDL_KMSDRM_SYM(rc,fn,params) KMSDRM_##fn = (SDL_DYNKMSDRMFN_##fn) KMSDRM_GetSym(#fn,thismod); -#define SDL_KMSDRM_SYM_CONST(type,name) KMSDRM_##name = *(SDL_DYNKMSDRMCONST_##name*) KMSDRM_GetSym(#name,thismod); +#define SDL_KMSDRM_MODULE(modname) thismod = &SDL_KMSDRM_HAVE_##modname; +#define SDL_KMSDRM_SYM(rc, fn, params) KMSDRM_##fn = (SDL_DYNKMSDRMFN_##fn)KMSDRM_GetSym(#fn, thismod, SDL_TRUE); +#define SDL_KMSDRM_SYM_CONST(type, name) KMSDRM_##name = *(SDL_DYNKMSDRMCONST_##name *)KMSDRM_GetSym(#name, thismod, SDL_TRUE); +#define SDL_KMSDRM_SYM_OPT(rc, fn, params) KMSDRM_##fn = (SDL_DYNKMSDRMFN_##fn)KMSDRM_GetSym(#fn, thismod, SDL_FALSE); #include "SDL_kmsdrmsym.h" if ((SDL_KMSDRM_HAVE_LIBDRM) && (SDL_KMSDRM_HAVE_GBM)) { @@ -149,11 +147,12 @@ SDL_KMSDRM_LoadSymbols(void) rc = 0; } -#else /* no dynamic KMSDRM */ +#else /* no dynamic KMSDRM */ -#define SDL_KMSDRM_MODULE(modname) SDL_KMSDRM_HAVE_##modname = 1; /* default yes */ -#define SDL_KMSDRM_SYM(rc,fn,params) KMSDRM_##fn = fn; -#define SDL_KMSDRM_SYM_CONST(type,name) KMSDRM_##name = name; +#define SDL_KMSDRM_MODULE(modname) SDL_KMSDRM_HAVE_##modname = 1; /* default yes */ +#define SDL_KMSDRM_SYM(rc, fn, params) KMSDRM_##fn = fn; +#define SDL_KMSDRM_SYM_CONST(type, name) KMSDRM_##name = name; +#define SDL_KMSDRM_SYM_OPT(rc, fn, params) KMSDRM_##fn = fn; #include "SDL_kmsdrmsym.h" #endif diff --git a/src/video/kmsdrm/SDL_kmsdrmdyn.h b/src/video/kmsdrm/SDL_kmsdrmdyn.h index 65de02e1b42f0..63f39a64c95f6 100644 --- a/src/video/kmsdrm/SDL_kmsdrmdyn.h +++ b/src/video/kmsdrm/SDL_kmsdrmdyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -36,12 +36,15 @@ int SDL_KMSDRM_LoadSymbols(void); void SDL_KMSDRM_UnloadSymbols(void); /* Declare all the function pointers and wrappers... */ -#define SDL_KMSDRM_SYM(rc,fn,params) \ - typedef rc (*SDL_DYNKMSDRMFN_##fn) params; \ +#define SDL_KMSDRM_SYM(rc, fn, params) \ + typedef rc(*SDL_DYNKMSDRMFN_##fn) params; \ extern SDL_DYNKMSDRMFN_##fn KMSDRM_##fn; -#define SDL_KMSDRM_SYM_CONST(type, name) \ +#define SDL_KMSDRM_SYM_CONST(type, name) \ typedef type SDL_DYNKMSDRMCONST_##name; \ extern SDL_DYNKMSDRMCONST_##name KMSDRM_##name; +#define SDL_KMSDRM_SYM_OPT(rc, fn, params) \ + typedef rc(*SDL_DYNKMSDRMFN_##fn) params; \ + extern SDL_DYNKMSDRMFN_##fn KMSDRM_##fn; #include "SDL_kmsdrmsym.h" #ifdef __cplusplus diff --git a/src/video/kmsdrm/SDL_kmsdrmevents.c b/src/video/kmsdrm/SDL_kmsdrmevents.c index 10773a760777d..39216ed16c617 100644 --- a/src/video/kmsdrm/SDL_kmsdrmevents.c +++ b/src/video/kmsdrm/SDL_kmsdrmevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM #include "SDL_kmsdrmvideo.h" #include "SDL_kmsdrmevents.h" @@ -39,8 +39,6 @@ void KMSDRM_PumpEvents(_THIS) #elif defined SDL_INPUT_WSCONS SDL_WSCONS_PumpEvents(); #endif - } #endif /* SDL_VIDEO_DRIVER_KMSDRM */ - diff --git a/src/video/kmsdrm/SDL_kmsdrmevents.h b/src/video/kmsdrm/SDL_kmsdrmevents.h index c327f032ffb1d..b9c99fcee0286 100644 --- a/src/video/kmsdrm/SDL_kmsdrmevents.h +++ b/src/video/kmsdrm/SDL_kmsdrmevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,5 @@ #define SDL_kmsdrmevents_h_ extern void KMSDRM_PumpEvents(_THIS); -extern void KMSDRM_EventInit(_THIS); -extern void KMSDRM_EventQuit(_THIS); #endif /* SDL_kmsdrmevents_h_ */ diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 5722e041a0d61..c589476632c54 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM #include "SDL_kmsdrmvideo.h" #include "SDL_kmsdrmmouse.h" @@ -33,11 +33,11 @@ #include "../SDL_pixels_c.h" static SDL_Cursor *KMSDRM_CreateDefaultCursor(void); -static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y); -static int KMSDRM_ShowCursor(SDL_Cursor * cursor); -static void KMSDRM_MoveCursor(SDL_Cursor * cursor); -static void KMSDRM_FreeCursor(SDL_Cursor * cursor); -static void KMSDRM_WarpMouse(SDL_Window * window, int x, int y); +static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y); +static int KMSDRM_ShowCursor(SDL_Cursor *cursor); +static void KMSDRM_MoveCursor(SDL_Cursor *cursor); +static void KMSDRM_FreeCursor(SDL_Cursor *cursor); +static void KMSDRM_WarpMouse(SDL_Window *window, int x, int y); static int KMSDRM_WarpMouseGlobal(int x, int y); /**************************************************************************************/ @@ -55,8 +55,7 @@ static int KMSDRM_WarpMouseGlobal(int x, int y); /* and mouse->cursor_shown is 1. */ /**************************************************************************************/ -static SDL_Cursor * -KMSDRM_CreateDefaultCursor(void) +static SDL_Cursor *KMSDRM_CreateDefaultCursor(void) { return SDL_CreateCursor(default_cdata, default_cmask, DEFAULT_CWIDTH, DEFAULT_CHEIGHT, DEFAULT_CHOTX, DEFAULT_CHOTY); } @@ -64,11 +63,10 @@ KMSDRM_CreateDefaultCursor(void) /* Given a display's driverdata, destroy the cursor BO for it. To be called from KMSDRM_DestroyWindow(), as that's where we destroy the driverdata for the window's display. */ -void -KMSDRM_DestroyCursorBO (_THIS, SDL_VideoDisplay *display) +void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display) { - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; - + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; + /* Destroy the curso GBM BO. */ if (dispdata->cursor_bo) { KMSDRM_gbm_bo_destroy(dispdata->cursor_bo); @@ -80,26 +78,24 @@ KMSDRM_DestroyCursorBO (_THIS, SDL_VideoDisplay *display) /* Given a display's driverdata, create the cursor BO for it. To be called from KMSDRM_CreateWindow(), as that's where we build a window and assign a display to it. */ -void -KMSDRM_CreateCursorBO (SDL_VideoDisplay *display) { +void KMSDRM_CreateCursorBO(SDL_VideoDisplay *display) +{ SDL_VideoDevice *dev = SDL_GetVideoDevice(); SDL_VideoData *viddata = ((SDL_VideoData *)dev->driverdata); - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm_dev, - GBM_FORMAT_ARGB8888, - GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) - { + GBM_FORMAT_ARGB8888, + GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) { SDL_SetError("Unsupported pixel format for cursor"); return; } if (KMSDRM_drmGetCap(viddata->drm_fd, - DRM_CAP_CURSOR_WIDTH, &dispdata->cursor_w) || - KMSDRM_drmGetCap(viddata->drm_fd, DRM_CAP_CURSOR_HEIGHT, - &dispdata->cursor_h)) - { + DRM_CAP_CURSOR_WIDTH, &dispdata->cursor_w) || + KMSDRM_drmGetCap(viddata->drm_fd, DRM_CAP_CURSOR_HEIGHT, + &dispdata->cursor_h)) { SDL_SetError("Could not get the recommended GBM cursor size"); return; } @@ -110,8 +106,8 @@ KMSDRM_CreateCursorBO (SDL_VideoDisplay *display) { } dispdata->cursor_bo = KMSDRM_gbm_bo_create(viddata->gbm_dev, - dispdata->cursor_w, dispdata->cursor_h, - GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE | GBM_BO_USE_LINEAR); + dispdata->cursor_w, dispdata->cursor_h, + GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE | GBM_BO_USE_LINEAR); if (!dispdata->cursor_bo) { SDL_SetError("Could not create GBM cursor BO"); @@ -119,19 +115,18 @@ KMSDRM_CreateCursorBO (SDL_VideoDisplay *display) { } dispdata->cursor_bo_drm_fd = viddata->drm_fd; -} +} /* Remove a cursor buffer from a display's DRM cursor BO. */ -static int -KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display) +static int KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display) { int ret = 0; - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; SDL_VideoDevice *video_device = SDL_GetVideoDevice(); SDL_VideoData *viddata = ((SDL_VideoData *)video_device->driverdata); ret = KMSDRM_drmModeSetCursor(viddata->drm_fd, - dispdata->crtc->crtc_id, 0, 0, 0); + dispdata->crtc->crtc_id, 0, 0, 0); if (ret) { ret = SDL_SetError("Could not hide current cursor with drmModeSetCursor()."); @@ -141,11 +136,10 @@ KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display) } /* Dump a cursor buffer to a display's DRM cursor BO. */ -static int -KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) +static int KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) { - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; - KMSDRM_CursorData *curdata = (KMSDRM_CursorData *) cursor->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; + KMSDRM_CursorData *curdata = (KMSDRM_CursorData *)cursor->driverdata; SDL_VideoDevice *video_device = SDL_GetVideoDevice(); SDL_VideoData *viddata = ((SDL_VideoData *)video_device->driverdata); @@ -167,7 +161,7 @@ KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) bo_stride = KMSDRM_gbm_bo_get_stride(dispdata->cursor_bo); bufsize = bo_stride * dispdata->cursor_h; - ready_buffer = (uint8_t*)SDL_calloc(1, bufsize); + ready_buffer = (uint8_t *)SDL_calloc(1, bufsize); if (!ready_buffer) { ret = SDL_OutOfMemory(); @@ -176,8 +170,8 @@ KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) /* Copy from the cursor buffer to a buffer that we can dump to the GBM BO. */ for (i = 0; i < curdata->h; i++) { - src_row = &((uint8_t*)curdata->buffer)[i * curdata->w * 4]; - SDL_memcpy(ready_buffer + (i * bo_stride), src_row, 4 * curdata->w); + src_row = &((uint8_t *)curdata->buffer)[i * curdata->w * 4]; + SDL_memcpy(ready_buffer + (i * bo_stride), src_row, (size_t)4 * curdata->w); } /* Dump the cursor buffer to our GBM BO. */ @@ -190,10 +184,10 @@ KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) bo_handle = KMSDRM_gbm_bo_get_handle(dispdata->cursor_bo).u32; if (curdata->hot_x == 0 && curdata->hot_y == 0) { ret = KMSDRM_drmModeSetCursor(viddata->drm_fd, dispdata->crtc->crtc_id, - bo_handle, dispdata->cursor_w, dispdata->cursor_h); + bo_handle, dispdata->cursor_w, dispdata->cursor_h); } else { ret = KMSDRM_drmModeSetCursor2(viddata->drm_fd, dispdata->crtc->crtc_id, - bo_handle, dispdata->cursor_w, dispdata->cursor_h, curdata->hot_x, curdata->hot_y); + bo_handle, dispdata->cursor_w, dispdata->cursor_h, curdata->hot_x, curdata->hot_y); } if (ret) { @@ -215,14 +209,13 @@ KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) } /* This is only for freeing the SDL_cursor.*/ -static void -KMSDRM_FreeCursor(SDL_Cursor * cursor) +static void KMSDRM_FreeCursor(SDL_Cursor *cursor) { KMSDRM_CursorData *curdata; /* Even if the cursor is not ours, free it. */ if (cursor) { - curdata = (KMSDRM_CursorData *) cursor->driverdata; + curdata = (KMSDRM_CursorData *)cursor->driverdata; /* Free cursor buffer */ if (curdata->buffer) { SDL_free(curdata->buffer); @@ -239,8 +232,7 @@ KMSDRM_FreeCursor(SDL_Cursor * cursor) /* This simply gets the cursor soft-buffer ready. We don't copy it to a GBO BO until ShowCursor() because the cusor GBM BO (living in dispata) is destroyed and recreated when we recreate windows, etc. */ -static SDL_Cursor * -KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { KMSDRM_CursorData *curdata; SDL_Cursor *cursor, *ret; @@ -248,12 +240,12 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) curdata = NULL; ret = NULL; - cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); + cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); if (!cursor) { SDL_OutOfMemory(); goto cleanup; } - curdata = (KMSDRM_CursorData *) SDL_calloc(1, sizeof(*curdata)); + curdata = (KMSDRM_CursorData *)SDL_calloc(1, sizeof(*curdata)); if (!curdata) { SDL_OutOfMemory(); goto cleanup; @@ -269,8 +261,8 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) /* Configure the cursor buffer info. This buffer has the original size of the cursor surface we are given. */ curdata->buffer_pitch = surface->w; - curdata->buffer_size = surface->w * surface->h * 4; - curdata->buffer = (uint32_t*)SDL_malloc(curdata->buffer_size); + curdata->buffer_size = (size_t)surface->w * surface->h * 4; + curdata->buffer = (uint32_t *)SDL_malloc(curdata->buffer_size); if (!curdata->buffer) { SDL_OutOfMemory(); @@ -280,7 +272,7 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) /* All code below assumes ARGB8888 format for the cursor surface, like other backends do. Also, the GBM BO pixels have to be alpha-premultiplied, but the SDL surface we receive has - straight-alpha pixels, so we always have to convert. */ + straight-alpha pixels, so we always have to convert. */ SDL_PremultiplyAlpha(surface->w, surface->h, surface->format->format, surface->pixels, surface->pitch, SDL_PIXELFORMAT_ARGB8888, curdata->buffer, surface->w * 4); @@ -290,7 +282,7 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) ret = cursor; cleanup: - if (ret == NULL) { + if (!ret) { if (curdata) { if (curdata->buffer) { SDL_free(curdata->buffer); @@ -306,8 +298,7 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) } /* Show the specified cursor, or hide if cursor is NULL or has no focus. */ -static int -KMSDRM_ShowCursor(SDL_Cursor * cursor) +static int KMSDRM_ShowCursor(SDL_Cursor *cursor) { SDL_VideoDisplay *display; SDL_Window *window; @@ -327,20 +318,20 @@ KMSDRM_ShowCursor(SDL_Cursor * cursor) if (!window || !cursor) { - /* If no window is focused by mouse or cursor is NULL, - since we have no window (no mouse->focus) and hence - we have no display, we simply hide mouse on all displays. - This happens on video quit, where we get here after - the mouse focus has been unset, yet SDL wants to - restore the system default cursor (makes no sense here). */ + /* If no window is focused by mouse or cursor is NULL, + since we have no window (no mouse->focus) and hence + we have no display, we simply hide mouse on all displays. + This happens on video quit, where we get here after + the mouse focus has been unset, yet SDL wants to + restore the system default cursor (makes no sense here). */ - num_displays = SDL_GetNumVideoDisplays(); + num_displays = SDL_GetNumVideoDisplays(); - /* Iterate on the displays hidding the cursor. */ - for (i = 0; i < num_displays; i++) { - display = SDL_GetDisplay(i); - ret = KMSDRM_RemoveCursorFromBO(display); - } + /* Iterate on the displays hidding the cursor. */ + for (i = 0; i < num_displays; i++) { + display = SDL_GetDisplay(i); + ret = KMSDRM_RemoveCursorFromBO(display); + } } else { @@ -357,30 +348,28 @@ KMSDRM_ShowCursor(SDL_Cursor * cursor) /* Hide the cursor on that display. */ ret = KMSDRM_RemoveCursorFromBO(display); } - } + } } return ret; } /* Warp the mouse to (x,y) */ -static void -KMSDRM_WarpMouse(SDL_Window * window, int x, int y) +static void KMSDRM_WarpMouse(SDL_Window *window, int x, int y) { /* Only one global/fullscreen window is supported */ KMSDRM_WarpMouseGlobal(x, y); } /* Warp the mouse to (x,y) */ -static int -KMSDRM_WarpMouseGlobal(int x, int y) +static int KMSDRM_WarpMouseGlobal(int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse && mouse->cur_cursor && mouse->focus) { SDL_Window *window = mouse->focus; - SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; /* Update internal mouse position. */ SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); @@ -406,11 +395,10 @@ KMSDRM_WarpMouseGlobal(int x, int y) } } -void -KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) +void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) { SDL_Mouse *mouse = SDL_GetMouse(); - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; mouse->CreateCursor = KMSDRM_CreateCursor; mouse->ShowCursor = KMSDRM_ShowCursor; @@ -427,15 +415,13 @@ KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) } } -void -KMSDRM_QuitMouse(_THIS) +void KMSDRM_QuitMouse(_THIS) { /* TODO: ? */ } /* This is called when a mouse motion event occurs */ -static void -KMSDRM_MoveCursor(SDL_Cursor * cursor) +static void KMSDRM_MoveCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); int ret = 0; @@ -445,7 +431,7 @@ KMSDRM_MoveCursor(SDL_Cursor * cursor) if (mouse && mouse->cur_cursor && mouse->focus) { SDL_Window *window = mouse->focus; - SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; if (!dispdata->cursor_bo) { SDL_SetError("Cursor not initialized properly."); diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.h b/src/video/kmsdrm/SDL_kmsdrmmouse.h index 3879f7a06a509..b060dd3fb49d2 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.h +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,12 +31,12 @@ typedef struct _KMSDRM_CursorData { - int hot_x, hot_y; - int w, h; + int hot_x, hot_y; + int w, h; /* The buffer where we store the mouse bitmap ready to be used. We get it ready and filled in CreateCursor(), and copy it - to a GBM BO in ShowCursor().*/ + to a GBM BO in ShowCursor().*/ uint32_t *buffer; size_t buffer_size; size_t buffer_pitch; diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index 253e34ecdbcee..311586278b665 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,9 +21,10 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM #include "SDL_log.h" +#include "SDL_timer.h" #include "SDL_kmsdrmvideo.h" #include "SDL_kmsdrmopengles.h" @@ -36,20 +37,19 @@ /* EGL implementation of SDL OpenGL support */ -void -KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) +void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) { /* if SDL was _also_ built with the Raspberry Pi driver (so we're definitely a Pi device), default to GLES2. */ -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI *mask = SDL_GL_CONTEXT_PROFILE_ES; *major = 2; *minor = 0; #endif } -int -KMSDRM_GLES_LoadLibrary(_THIS, const char *path) { +int KMSDRM_GLES_LoadLibrary(_THIS, const char *path) +{ /* Just pretend you do this here, but don't do it until KMSDRM_CreateWindow(), where we do the same library load we would normally do here. because this gets called by SDL_CreateWindow() before KMSDR_CreateWindow(), @@ -62,15 +62,16 @@ KMSDRM_GLES_LoadLibrary(_THIS, const char *path) { return 0; } -void -KMSDRM_GLES_UnloadLibrary(_THIS) { +void KMSDRM_GLES_UnloadLibrary(_THIS) +{ /* As with KMSDRM_GLES_LoadLibrary(), we define our own "dummy" unloading function so we manually unload the library whenever we want. */ } SDL_EGL_CreateContext_impl(KMSDRM) -int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) { + int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) +{ if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); @@ -85,10 +86,10 @@ int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) { return 0; } -int -KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { - SDL_WindowData *windata = ((SDL_WindowData *) window->driverdata); - SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; +int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window) +{ + SDL_WindowData *windata = ((SDL_WindowData *)window->driverdata); + SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); KMSDRM_FBInfo *fb_info; int ret = 0; @@ -97,6 +98,13 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { even if you do async flips. */ uint32_t flip_flags = DRM_MODE_PAGE_FLIP_EVENT; + /* Skip the swap if we've switched away to another VT */ + if (windata->egl_surface == EGL_NO_SURFACE) { + /* Wait a bit, throttling to ~100 FPS */ + SDL_Delay(10); + return 0; + } + /* Recreate the GBM / EGL surfaces if the display mode has changed */ if (windata->egl_surface_dirty) { KMSDRM_CreateSurfaces(_this, window); @@ -117,10 +125,10 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { windata->bo = windata->next_bo; - /* Mark a buffer to becume the next front buffer. + /* Mark a buffer to become the next front buffer. This won't happen until pagelip completes. */ if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, - windata->egl_surface))) { + windata->egl_surface))) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed"); return 0; } @@ -146,8 +154,8 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { drmModePageFlip can be used the CRTC has to be configured to use the current connector and mode with drmModeSetCrtc */ ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, - dispdata->crtc->crtc_id, fb_info->fb_id, 0, 0, - &dispdata->connector->connector_id, 1, &dispdata->mode); + dispdata->crtc->crtc_id, fb_info->fb_id, 0, 0, + &dispdata->connector->connector_id, 1, &dispdata->mode); if (ret) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not set videomode on CRTC."); @@ -171,7 +179,7 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { } ret = KMSDRM_drmModePageFlip(viddata->drm_fd, dispdata->crtc->crtc_id, - fb_info->fb_id, flip_flags, &windata->waiting_for_flip); + fb_info->fb_id, flip_flags, &windata->waiting_for_flip); if (ret == 0) { windata->waiting_for_flip = SDL_TRUE; @@ -186,7 +194,7 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) { we have waited here, there won't be a pending pageflip so the WaitPageflip at the beginning of this function will be a no-op. Just leave it here and don't worry. - Run your SDL2 program with "SDL_KMSDRM_DOUBLE_BUFFER=1 " + Run your SDL2 program with "SDL_VIDEO_DOUBLE_BUFFER=1 " to enable this. */ if (windata->double_buffer) { if (!KMSDRM_WaitPageflip(_this, windata)) { @@ -203,4 +211,4 @@ SDL_EGL_MakeCurrent_impl(KMSDRM) #endif /* SDL_VIDEO_DRIVER_KMSDRM */ -/* vi: set ts=4 sw=4 expandtab: */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.h b/src/video/kmsdrm/SDL_kmsdrmopengles.h index a762ab0f3744f..9307066e3c962 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.h +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_kmsdrmopengles_h_ #define SDL_kmsdrmopengles_h_ -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -37,9 +37,9 @@ extern void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor); extern int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); extern int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window * window); -extern int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); +extern int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); #endif /* SDL_VIDEO_DRIVER_KMSDRM */ diff --git a/src/video/kmsdrm/SDL_kmsdrmsym.h b/src/video/kmsdrm/SDL_kmsdrmsym.h index 4fdce52927c17..b0be627f1b5ed 100644 --- a/src/video/kmsdrm/SDL_kmsdrmsym.h +++ b/src/video/kmsdrm/SDL_kmsdrmsym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,6 +33,10 @@ #define SDL_KMSDRM_SYM_CONST(type, name) #endif +#ifndef SDL_KMSDRM_SYM_OPT +#define SDL_KMSDRM_SYM_OPT(rc,fn,params) +#endif + SDL_KMSDRM_MODULE(LIBDRM) SDL_KMSDRM_SYM(void,drmModeFreeResources,(drmModeResPtr ptr)) @@ -42,17 +46,23 @@ SDL_KMSDRM_SYM(void,drmModeFreeConnector,(drmModeConnectorPtr ptr)) SDL_KMSDRM_SYM(void,drmModeFreeEncoder,(drmModeEncoderPtr ptr)) SDL_KMSDRM_SYM(int,drmGetCap,(int fd, uint64_t capability, uint64_t *value)) SDL_KMSDRM_SYM(int,drmSetMaster,(int fd)) +SDL_KMSDRM_SYM(int,drmDropMaster,(int fd)) SDL_KMSDRM_SYM(int,drmAuthMagic,(int fd, drm_magic_t magic)) SDL_KMSDRM_SYM(drmModeResPtr,drmModeGetResources,(int fd)) SDL_KMSDRM_SYM(int,drmModeAddFB,(int fd, uint32_t width, uint32_t height, uint8_t depth, uint8_t bpp, uint32_t pitch, uint32_t bo_handle, uint32_t *buf_id)) -SDL_KMSDRM_SYM(int,drmModeAddFB2,(int fd, uint32_t width, uint32_t height, +SDL_KMSDRM_SYM_OPT(int,drmModeAddFB2,(int fd, uint32_t width, uint32_t height, uint32_t pixel_format, const uint32_t bo_handles[4], const uint32_t pitches[4], const uint32_t offsets[4], uint32_t *buf_id, uint32_t flags)) +SDL_KMSDRM_SYM_OPT(int,drmModeAddFB2WithModifiers,(int fd, uint32_t width, + uint32_t height, uint32_t pixel_format, const uint32_t bo_handles[4], + const uint32_t pitches[4], const uint32_t offsets[4], + const uint64_t modifier[4], uint32_t *buf_id, uint32_t flags)) + SDL_KMSDRM_SYM(int,drmModeRmFB,(int fd, uint32_t bufferId)) SDL_KMSDRM_SYM(drmModeFBPtr,drmModeGetFB,(int fd, uint32_t buf)) SDL_KMSDRM_SYM(drmModeCrtcPtr,drmModeGetCrtc,(int fd, uint32_t crtcId)) @@ -62,7 +72,7 @@ SDL_KMSDRM_SYM(int,drmModeSetCrtc,(int fd, uint32_t crtcId, uint32_t bufferId, SDL_KMSDRM_SYM(int,drmModeCrtcGetGamma,(int fd, uint32_t crtc_id, uint32_t size, uint16_t *red, uint16_t *green, uint16_t *blue)) SDL_KMSDRM_SYM(int,drmModeCrtcSetGamma,(int fd, uint32_t crtc_id, uint32_t size, - uint16_t *red, uint16_t *green, uint16_t *blue)) + const uint16_t *red, const uint16_t *green, const uint16_t *blue)) SDL_KMSDRM_SYM(int,drmModeSetCursor,(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height)) SDL_KMSDRM_SYM(int,drmModeSetCursor2,(int fd, uint32_t crtcId, uint32_t bo_handle, @@ -123,10 +133,16 @@ SDL_KMSDRM_SYM(void,gbm_surface_destroy,(struct gbm_surface *surf)) SDL_KMSDRM_SYM(struct gbm_bo *,gbm_surface_lock_front_buffer,(struct gbm_surface *surf)) SDL_KMSDRM_SYM(void,gbm_surface_release_buffer,(struct gbm_surface *surf, struct gbm_bo *bo)) +SDL_KMSDRM_SYM_OPT(uint64_t,gbm_bo_get_modifier,(struct gbm_bo *bo)) +SDL_KMSDRM_SYM_OPT(int,gbm_bo_get_plane_count,(struct gbm_bo *bo)) +SDL_KMSDRM_SYM_OPT(uint32_t,gbm_bo_get_offset,(struct gbm_bo *bo, int plane)) +SDL_KMSDRM_SYM_OPT(uint32_t,gbm_bo_get_stride_for_plane,(struct gbm_bo *bo, int plane)) +SDL_KMSDRM_SYM_OPT(union gbm_bo_handle,gbm_bo_get_handle_for_plane,(struct gbm_bo *bo, int plane)) #undef SDL_KMSDRM_MODULE #undef SDL_KMSDRM_SYM #undef SDL_KMSDRM_SYM_CONST +#undef SDL_KMSDRM_SYM_OPT /* *INDENT-ON* */ /* clang-format on */ diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 6c05bbd9bfd38..ba293f202949e 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_KMSDRM +#ifdef SDL_VIDEO_DRIVER_KMSDRM /* SDL internals */ #include "../SDL_sysvideo.h" @@ -68,8 +68,7 @@ static char kmsdrm_dri_cardpath[32]; #define EGL_PLATFORM_GBM_MESA 0x31D7 #endif -static int -get_driindex(void) +static int get_driindex(void) { int available = -ENOENT; char device[sizeof(kmsdrm_dri_cardpath)]; @@ -78,13 +77,14 @@ get_driindex(void) int devindex = -1; DIR *folder; const char *hint; + struct dirent *res; hint = SDL_GetHint(SDL_HINT_KMSDRM_DEVICE_INDEX); if (hint && *hint) { char *endptr = NULL; - const int idx = (int) SDL_strtol(hint, &endptr, 10); - if ((*endptr == '\0') && (idx >= 0)) { /* *endptr==0 means "whole string was a valid number" */ - return idx; /* we'll take the user's request here. */ + const int idx = (int)SDL_strtol(hint, &endptr, 10); + if ((*endptr == '\0') && (idx >= 0)) { /* *endptr==0 means "whole string was a valid number" */ + return idx; /* we'll take the user's request here. */ } } @@ -96,8 +96,8 @@ get_driindex(void) } SDL_strlcpy(device + kmsdrm_dri_pathsize, kmsdrm_dri_devname, - sizeof(device) - kmsdrm_dri_devnamesize); - for (struct dirent *res; (res = readdir(folder));) { + sizeof(device) - kmsdrm_dri_pathsize); + while((res = readdir(folder)) != NULL && available < 0) { if (SDL_memcmp(res->d_name, kmsdrm_dri_devname, kmsdrm_dri_devnamesize) == 0) { SDL_strlcpy(device + kmsdrm_dri_pathsize + kmsdrm_dri_devnamesize, @@ -123,7 +123,7 @@ get_driindex(void) resources->count_encoders > 0 && resources->count_crtcs > 0) { available = -ENOENT; - for (i = 0; i < resources->count_connectors; i++) { + for (i = 0; i < resources->count_connectors && available < 0; i++) { drmModeConnector *conn = KMSDRM_drmModeGetConnector( drm_fd, resources->connectors[i]); @@ -134,20 +134,21 @@ get_driindex(void) if (conn->connection == DRM_MODE_CONNECTED && conn->count_modes) { + SDL_bool access_denied = SDL_FALSE; if (SDL_GetHintBoolean( SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER, SDL_TRUE)) { /* Skip this device if we can't obtain * DRM master */ KMSDRM_drmSetMaster(drm_fd); - if (KMSDRM_drmAuthMagic(drm_fd, 0) == - -EACCES) { - continue; + if (KMSDRM_drmAuthMagic(drm_fd, 0) == -EACCES) { + access_denied = SDL_TRUE; } } - available = devindex; - break; + if (!access_denied) { + available = devindex; + } } KMSDRM_drmModeFreeConnector(conn); @@ -158,11 +159,10 @@ get_driindex(void) SDL_KMSDRM_UnloadSymbols(); } close(drm_fd); + } else { + SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, + "Failed to open KMSDRM device %s, errno: %d\n", device, errno); } - - SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, - "Failed to open KMSDRM device %s, errno: %d\n", device, - errno); } } @@ -171,8 +171,7 @@ get_driindex(void) return available; } -static int -KMSDRM_Available(void) +static int KMSDRM_Available(void) { #ifdef __OpenBSD__ struct utsname nameofsystem; @@ -199,8 +198,8 @@ KMSDRM_Available(void) kmsdrm_dri_pathsize = SDL_strlen(kmsdrm_dri_path); kmsdrm_dri_devnamesize = SDL_strlen(kmsdrm_dri_devname); - SDL_snprintf(kmsdrm_dri_cardpath, sizeof(kmsdrm_dri_cardpath), "%s%s", - kmsdrm_dri_path, kmsdrm_dri_devname); + (void)SDL_snprintf(kmsdrm_dri_cardpath, sizeof(kmsdrm_dri_cardpath), "%s%s", + kmsdrm_dri_path, kmsdrm_dri_devname); ret = get_driindex(); if (ret >= 0) { @@ -210,8 +209,7 @@ KMSDRM_Available(void) return ret; } -static void -KMSDRM_DeleteDevice(SDL_VideoDevice * device) +static void KMSDRM_DeleteDevice(SDL_VideoDevice *device) { if (device->driverdata) { SDL_free(device->driverdata); @@ -223,8 +221,7 @@ KMSDRM_DeleteDevice(SDL_VideoDevice * device) SDL_KMSDRM_UnloadSymbols(); } -static SDL_VideoDevice * -KMSDRM_CreateDevice(void) +static SDL_VideoDevice *KMSDRM_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *viddata; @@ -244,13 +241,13 @@ KMSDRM_CreateDevice(void) return NULL; } - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); return NULL; } - viddata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); + viddata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!viddata) { SDL_OutOfMemory(); goto cleanup; @@ -294,7 +291,7 @@ KMSDRM_CreateDevice(void) device->GL_DeleteContext = KMSDRM_GLES_DeleteContext; device->GL_DefaultProfileConfig = KMSDRM_GLES_DefaultProfileConfig; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = KMSDRM_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = KMSDRM_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = KMSDRM_Vulkan_GetInstanceExtensions; @@ -310,19 +307,20 @@ KMSDRM_CreateDevice(void) cleanup: SDL_free(device); - if (viddata) + if (viddata) { SDL_free(viddata); + } return NULL; } VideoBootStrap KMSDRM_bootstrap = { "KMSDRM", "KMS/DRM Video Driver", - KMSDRM_CreateDevice + KMSDRM_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; -static void -KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) +static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) { KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)data; @@ -334,13 +332,15 @@ KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) SDL_free(fb_info); } -KMSDRM_FBInfo * -KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) +KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); - unsigned w,h; - int ret; - Uint32 stride, handle; + unsigned w, h; + int rc = -1; + int num_planes = 0; + int i; + uint32_t format, strides[4] = { 0 }, handles[4] = { 0 }, offsets[4] = { 0 }, flags = 0; + uint64_t modifiers[4] = { 0 }; /* Check for an existing framebuffer */ KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)KMSDRM_gbm_bo_get_user_data(bo); @@ -360,20 +360,48 @@ KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) fb_info->drm_fd = viddata->drm_fd; - /* Create framebuffer object for the buffer */ + /* Create framebuffer object for the buffer using the modifiers requested by GBM. + Use of the modifiers is necessary on some platforms. */ w = KMSDRM_gbm_bo_get_width(bo); h = KMSDRM_gbm_bo_get_height(bo); - stride = KMSDRM_gbm_bo_get_stride(bo); - handle = KMSDRM_gbm_bo_get_handle(bo).u32; - ret = KMSDRM_drmModeAddFB(viddata->drm_fd, w, h, 24, 32, stride, handle, - &fb_info->fb_id); - if (ret) { - SDL_free(fb_info); - return NULL; + format = KMSDRM_gbm_bo_get_format(bo); + + if (KMSDRM_drmModeAddFB2WithModifiers && + KMSDRM_gbm_bo_get_modifier && + KMSDRM_gbm_bo_get_plane_count && + KMSDRM_gbm_bo_get_offset && + KMSDRM_gbm_bo_get_stride_for_plane && + KMSDRM_gbm_bo_get_handle_for_plane) { + + modifiers[0] = KMSDRM_gbm_bo_get_modifier(bo); + num_planes = KMSDRM_gbm_bo_get_plane_count(bo); + for (i = 0; i < num_planes; i++) { + strides[i] = KMSDRM_gbm_bo_get_stride_for_plane(bo, i); + handles[i] = KMSDRM_gbm_bo_get_handle_for_plane(bo, i).u32; + offsets[i] = KMSDRM_gbm_bo_get_offset(bo, i); + modifiers[i] = modifiers[0]; + } + + if (modifiers[0] && modifiers[0] != DRM_FORMAT_MOD_INVALID) { + flags = DRM_MODE_FB_MODIFIERS; + } + + rc = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags); } - SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "New DRM FB (%u): %ux%u, stride %u from BO %p", - fb_info->fb_id, w, h, stride, (void *)bo); + if (rc < 0) { + strides[0] = KMSDRM_gbm_bo_get_stride(bo); + handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32; + rc = KMSDRM_drmModeAddFB(viddata->drm_fd, w, h, 24, 32, strides[0], handles[0], &fb_info->fb_id); + } + + if (rc < 0) { + SDL_free(fb_info); + return NULL; + } + + SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "New DRM FB (%u): %ux%u, from BO %p", + fb_info->fb_id, w, h, (void *)bo); /* Associate our DRM framebuffer with this buffer object */ KMSDRM_gbm_bo_set_user_data(bo, fb_info, KMSDRM_FBDestroyCallback); @@ -381,18 +409,17 @@ KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) return fb_info; } -static void -KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) +static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { - *((SDL_bool *) data) = SDL_FALSE; + *((SDL_bool *)data) = SDL_FALSE; } -SDL_bool -KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) { +SDL_bool KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) +{ SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); - drmEventContext ev = {0}; - struct pollfd pfd = {0}; + drmEventContext ev = { 0 }; + struct pollfd pfd = { 0 }; int ret; ev.version = DRM_EVENT_CONTEXT_VERSION; @@ -454,7 +481,7 @@ KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) { If it's not, we keep iterating on the loop. */ KMSDRM_drmHandleEvent(viddata->drm_fd, &ev); } - + /* If we got to this point in the loop, we may iterate or exit the loop: -A legit (non-error) event arrived, and it was a POLLING event, and it was consumed by drmHandleEvent(). @@ -464,8 +491,7 @@ KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) { iterare back to polling. -A legit (non-error) event arrived, but it's not a POLLIN event, so it hasn't to be consumed by drmHandleEvent(), so waiting_for_flip isn't set and we iterate back - to polling. */ - + to polling. */ } return SDL_TRUE; @@ -475,11 +501,11 @@ KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) { available on the DRM connector of the display. We use the SDL mode list (which we filled in KMSDRM_GetDisplayModes) because it's ordered, while the list on the connector is mostly random.*/ -static drmModeModeInfo* -KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay * display, -uint32_t width, uint32_t height, uint32_t refresh_rate){ +static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, + uint32_t width, uint32_t height, uint32_t refresh_rate) +{ - SDL_DisplayData *dispdata = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; drmModeConnector *connector = dispdata->connector; SDL_DisplayMode target, closest; @@ -505,10 +531,23 @@ uint32_t width, uint32_t height, uint32_t refresh_rate){ /* _this is a SDL_VideoDevice * */ /*****************************************************************************/ -/* Deinitializes the driverdata of the SDL Displays in the SDL display list. */ -static void -KMSDRM_DeinitDisplays (_THIS) { +static SDL_bool KMSDRM_DropMaster(_THIS) +{ + SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); + + /* Check if we have DRM master to begin with */ + if (KMSDRM_drmAuthMagic(viddata->drm_fd, 0) == -EACCES) { + /* Nope, nothing to do then */ + return SDL_TRUE; + } + + return KMSDRM_drmDropMaster(viddata->drm_fd) < 0 ? SDL_FALSE : SDL_TRUE; +} +/* Deinitializes the driverdata of the SDL Displays in the SDL display list. */ +static void KMSDRM_DeinitDisplays(_THIS) +{ + SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); SDL_DisplayData *dispdata; int num_displays, i; @@ -516,8 +555,8 @@ KMSDRM_DeinitDisplays (_THIS) { /* Iterate on the SDL Display list. */ for (i = 0; i < num_displays; i++) { - - /* Get the driverdata for this display */ + + /* Get the driverdata for this display */ dispdata = (SDL_DisplayData *)SDL_GetDisplayDriverData(i); /* Free connector */ @@ -532,124 +571,134 @@ KMSDRM_DeinitDisplays (_THIS) { dispdata->crtc = NULL; } } + + if (viddata->drm_fd >= 0) { + close(viddata->drm_fd); + viddata->drm_fd = -1; + } } -static uint32_t -KMSDRM_CrtcGetPropId(uint32_t drm_fd, - drmModeObjectPropertiesPtr props, - char const* name) +static uint32_t KMSDRM_CrtcGetPropId(uint32_t drm_fd, + drmModeObjectPropertiesPtr props, + char const *name) { uint32_t i, prop_id = 0; for (i = 0; !prop_id && i < props->count_props; ++i) { drmModePropertyPtr drm_prop = - KMSDRM_drmModeGetProperty(drm_fd, props->props[i]); + KMSDRM_drmModeGetProperty(drm_fd, props->props[i]); - if (!drm_prop) + if (!drm_prop) { continue; + } - if (strcmp(drm_prop->name, name) == 0) + if (SDL_strcmp(drm_prop->name, name) == 0) { prop_id = drm_prop->prop_id; + } KMSDRM_drmModeFreeProperty(drm_prop); - } + } return prop_id; } -static SDL_bool KMSDRM_VrrPropId(uint32_t drm_fd, uint32_t crtc_id, uint32_t *vrr_prop_id) { +static SDL_bool KMSDRM_VrrPropId(uint32_t drm_fd, uint32_t crtc_id, uint32_t *vrr_prop_id) +{ drmModeObjectPropertiesPtr drm_props; drm_props = KMSDRM_drmModeObjectGetProperties(drm_fd, - crtc_id, - DRM_MODE_OBJECT_CRTC); + crtc_id, + DRM_MODE_OBJECT_CRTC); - if (!drm_props) + if (!drm_props) { return SDL_FALSE; + } *vrr_prop_id = KMSDRM_CrtcGetPropId(drm_fd, - drm_props, - "VRR_ENABLED"); + drm_props, + "VRR_ENABLED"); KMSDRM_drmModeFreeObjectProperties(drm_props); return SDL_TRUE; } -static SDL_bool -KMSDRM_ConnectorCheckVrrCapable(uint32_t drm_fd, - uint32_t output_id, - char const* name) +static SDL_bool KMSDRM_ConnectorCheckVrrCapable(uint32_t drm_fd, + uint32_t output_id, + char const *name) { uint32_t i; SDL_bool found = SDL_FALSE; uint64_t prop_value = 0; - drmModeObjectPropertiesPtr props = KMSDRM_drmModeObjectGetProperties(drm_fd, - output_id, - DRM_MODE_OBJECT_CONNECTOR); + output_id, + DRM_MODE_OBJECT_CONNECTOR); - if(!props) + if (!props) { return SDL_FALSE; + } for (i = 0; !found && i < props->count_props; ++i) { drmModePropertyPtr drm_prop = KMSDRM_drmModeGetProperty(drm_fd, props->props[i]); - if (!drm_prop) + if (!drm_prop) { continue; + } - if (strcasecmp(drm_prop->name, name) == 0) { + if (SDL_strcasecmp(drm_prop->name, name) == 0) { prop_value = props->prop_values[i]; found = SDL_TRUE; } KMSDRM_drmModeFreeProperty(drm_prop); } - if(found) - return prop_value ? SDL_TRUE: SDL_FALSE; + if (found) { + return prop_value ? SDL_TRUE : SDL_FALSE; + } return SDL_FALSE; } -void -KMSDRM_CrtcSetVrr(uint32_t drm_fd, uint32_t crtc_id, SDL_bool enabled) +void KMSDRM_CrtcSetVrr(uint32_t drm_fd, uint32_t crtc_id, SDL_bool enabled) { uint32_t vrr_prop_id; - if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) + if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) { return; + } KMSDRM_drmModeObjectSetProperty(drm_fd, - crtc_id, - DRM_MODE_OBJECT_CRTC, - vrr_prop_id, - enabled); + crtc_id, + DRM_MODE_OBJECT_CRTC, + vrr_prop_id, + enabled); } -static SDL_bool -KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id) +static SDL_bool KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id) { uint32_t object_prop_id, vrr_prop_id; drmModeObjectPropertiesPtr props; SDL_bool object_prop_value; int i; - if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) + if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) { return SDL_FALSE; - + } props = KMSDRM_drmModeObjectGetProperties(drm_fd, - crtc_id, - DRM_MODE_OBJECT_CRTC); + crtc_id, + DRM_MODE_OBJECT_CRTC); - if(!props) + if (!props) { return SDL_FALSE; + } for (i = 0; i < props->count_props; ++i) { drmModePropertyPtr drm_prop = KMSDRM_drmModeGetProperty(drm_fd, props->props[i]); - if (!drm_prop) + if (!drm_prop) { continue; + } object_prop_id = drm_prop->prop_id; object_prop_value = props->prop_values[i] ? SDL_TRUE : SDL_FALSE; @@ -665,12 +714,11 @@ KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id) /* Gets a DRM connector, builds an SDL_Display with it, and adds it to the list of SDL Displays in _this->displays[] */ -static void -KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) +static void KMSDRM_AddDisplay(_THIS, drmModeConnector *connector, drmModeRes *resources) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); SDL_DisplayData *dispdata = NULL; - SDL_VideoDisplay display = {0}; + SDL_VideoDisplay display = { 0 }; SDL_DisplayModeData *modedata = NULL; drmModeEncoder *encoder = NULL; drmModeCrtc *crtc = NULL; @@ -679,7 +727,7 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) int ret = 0; /* Reserve memory for the new display's driverdata. */ - dispdata = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData)); + dispdata = (SDL_DisplayData *)SDL_calloc(1, sizeof(SDL_DisplayData)); if (!dispdata) { ret = SDL_OutOfMemory(); goto cleanup; @@ -702,7 +750,7 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) encoder = KMSDRM_drmModeGetEncoder(viddata->drm_fd, resources->encoders[i]); if (!encoder) { - continue; + continue; } if (encoder->encoder_id == connector->encoder_id) { @@ -717,7 +765,7 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) /* No encoder was connected, find the first supported one */ for (i = 0; i < resources->count_encoders; i++) { encoder = KMSDRM_drmModeGetEncoder(viddata->drm_fd, - resources->encoders[i]); + resources->encoders[i]); if (!encoder) { continue; @@ -818,7 +866,7 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) dispdata->original_mode = crtc->mode; dispdata->fullscreen_mode = crtc->mode; - if (dispdata->mode.hdisplay == 0 || dispdata->mode.vdisplay == 0 ) { + if (dispdata->mode.hdisplay == 0 || dispdata->mode.vdisplay == 0) { ret = SDL_SetError("Couldn't get a valid connector videomode."); goto cleanup; } @@ -830,7 +878,7 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) /* save previous vrr state */ dispdata->saved_vrr = KMSDRM_CrtcGetVrr(viddata->drm_fd, crtc->crtc_id); /* try to enable vrr */ - if(KMSDRM_ConnectorCheckVrrCapable(viddata->drm_fd, connector->connector_id, "VRR_CAPABLE")) { + if (KMSDRM_ConnectorCheckVrrCapable(viddata->drm_fd, connector->connector_id, "VRR_CAPABLE")) { SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Enabling VRR"); KMSDRM_CrtcSetVrr(viddata->drm_fd, crtc->crtc_id, SDL_TRUE); } @@ -862,8 +910,9 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) SDL_AddVideoDisplay(&display, SDL_FALSE); cleanup: - if (encoder) + if (encoder) { KMSDRM_drmModeFreeEncoder(encoder); + } if (ret) { /* Error (complete) cleanup */ if (dispdata) { @@ -878,16 +927,14 @@ KMSDRM_AddDisplay (_THIS, drmModeConnector *connector, drmModeRes *resources) SDL_free(dispdata); } } -} +} /* NOLINT(clang-analyzer-unix.Malloc): If no error `dispdata` is saved in the display */ /* Initializes the list of SDL displays: we build a new display for each connecter connector we find. - Inoffeensive for VK compatibility, except we must leave the drm_fd - closed when we get to the end of this function. This is to be called early, in VideoInit(), because it gets us the videomode information, which SDL needs immediately after VideoInit(). */ -static int -KMSDRM_InitDisplays (_THIS) { +static int KMSDRM_InitDisplays(_THIS) +{ SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); drmModeRes *resources = NULL; @@ -897,8 +944,8 @@ KMSDRM_InitDisplays (_THIS) { int i; /* Open /dev/dri/cardNN (/dev/drmN if on OpenBSD version less than 6.9) */ - SDL_snprintf(viddata->devpath, sizeof(viddata->devpath), "%s%d", - kmsdrm_dri_cardpath, viddata->devindex); + (void)SDL_snprintf(viddata->devpath, sizeof(viddata->devpath), "%s%d", + kmsdrm_dri_cardpath, viddata->devindex); SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Opening device %s", viddata->devpath); viddata->drm_fd = open(viddata->devpath, O_RDWR | O_CLOEXEC); @@ -921,7 +968,7 @@ KMSDRM_InitDisplays (_THIS) { we create an SDL_Display and add it to the list of SDL Displays. */ for (i = 0; i < resources->count_connectors; i++) { drmModeConnector *connector = KMSDRM_drmModeGetConnector(viddata->drm_fd, - resources->connectors[i]); + resources->connectors[i]); if (!connector) { continue; @@ -933,8 +980,7 @@ KMSDRM_InitDisplays (_THIS) { so if it fails (no encoder for connector, no valid video mode for connector etc...) we can keep looking for connected connectors. */ KMSDRM_AddDisplay(_this, connector, resources); - } - else { + } else { /* If it's not, free it now. */ KMSDRM_drmModeFreeConnector(connector); } @@ -957,14 +1003,18 @@ KMSDRM_InitDisplays (_THIS) { /* Block for Vulkan compatibility. */ /***********************************/ - /* THIS IS FOR VULKAN! Leave the FD closed, so VK can work. - Will reopen this in CreateWindow, but only if requested a non-VK window. */ - close (viddata->drm_fd); - viddata->drm_fd = -1; + /* Vulkan requires DRM master on its own FD to work, so try to drop master + on our FD. This will only work without root on kernels v5.8 and later. + If it doesn't work, just close the FD and we'll reopen it later. */ + if (!KMSDRM_DropMaster(_this)) { + close(viddata->drm_fd); + viddata->drm_fd = -1; + } cleanup: - if (resources) + if (resources) { KMSDRM_drmModeFreeResources(resources); + } if (ret) { if (viddata->drm_fd >= 0) { close(viddata->drm_fd); @@ -982,16 +1032,20 @@ KMSDRM_InitDisplays (_THIS) { These things are incompatible with Vulkan, which accesses the same resources internally so they must be free when trying to build a Vulkan surface. */ -static int -KMSDRM_GBMInit (_THIS, SDL_DisplayData *dispdata) +static int KMSDRM_GBMInit(_THIS, SDL_DisplayData *dispdata) { SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; int ret = 0; - /* Reopen the FD! */ - viddata->drm_fd = open(viddata->devpath, O_RDWR | O_CLOEXEC); + /* Reopen the FD if we weren't able to drop master on the original one */ + if (viddata->drm_fd < 0) { + viddata->drm_fd = open(viddata->devpath, O_RDWR | O_CLOEXEC); + if (viddata->drm_fd < 0) { + return SDL_SetError("Could not reopen %s", viddata->devpath); + } + } - /* Set the FD we just opened as current DRM master. */ + /* Set the FD as current DRM master. */ KMSDRM_drmSetMaster(viddata->drm_fd); /* Create the GBM device. */ @@ -1006,8 +1060,7 @@ KMSDRM_GBMInit (_THIS, SDL_DisplayData *dispdata) } /* Deinit the Vulkan-incompatible KMSDRM stuff. */ -static void -KMSDRM_GBMDeinit (_THIS, SDL_DisplayData *dispdata) +static void KMSDRM_GBMDeinit(_THIS, SDL_DisplayData *dispdata) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); @@ -1018,8 +1071,9 @@ KMSDRM_GBMDeinit (_THIS, SDL_DisplayData *dispdata) viddata->gbm_dev = NULL; } - /* Finally close DRM FD. May be reopen on next non-vulkan window creation. */ - if (viddata->drm_fd >= 0) { + /* Finally drop DRM master if possible, otherwise close DRM FD. + May be reopened on next non-vulkan window creation. */ + if (viddata->drm_fd >= 0 && !KMSDRM_DropMaster(_this)) { close(viddata->drm_fd); viddata->drm_fd = -1; } @@ -1027,12 +1081,11 @@ KMSDRM_GBMDeinit (_THIS, SDL_DisplayData *dispdata) viddata->gbm_init = SDL_FALSE; } -static void -KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) +static void KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); - SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; - SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_WindowData *windata = (SDL_WindowData *)window->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; int ret; /**********************************************/ @@ -1046,17 +1099,17 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) /***********************************************************************/ ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, dispdata->crtc->crtc_id, - dispdata->crtc->buffer_id, 0, 0, &dispdata->connector->connector_id, 1, - &dispdata->original_mode); + dispdata->crtc->buffer_id, 0, 0, &dispdata->connector->connector_id, 1, + &dispdata->original_mode); /* If we failed to set the original mode, try to set the connector prefered mode. */ if (ret && (dispdata->crtc->mode_valid == 0)) { ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, dispdata->crtc->crtc_id, - dispdata->crtc->buffer_id, 0, 0, &dispdata->connector->connector_id, 1, - &dispdata->original_mode); + dispdata->crtc->buffer_id, 0, 0, &dispdata->connector->connector_id, 1, + &dispdata->original_mode); } - if(ret) { + if (ret) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not restore CRTC"); } @@ -1095,8 +1148,8 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) } } -static void -KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) { +static void KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) +{ SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *dispdata = (SDL_DisplayData *)display->driverdata; @@ -1106,7 +1159,7 @@ KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) { drmModeModeInfo *mode; mode = KMSDRM_GetClosestDisplayMode(display, - window->windowed.w, window->windowed.h, 0); + window->windowed.w, window->windowed.h, 0); if (mode) { *out_mode = *mode; @@ -1116,8 +1169,8 @@ KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) { } } -static void -KMSDRM_DirtySurfaces(SDL_Window *window) { +static void KMSDRM_DirtySurfaces(SDL_Window *window) +{ SDL_WindowData *windata = (SDL_WindowData *)window->driverdata; drmModeModeInfo mode; @@ -1134,8 +1187,7 @@ KMSDRM_DirtySurfaces(SDL_Window *window) { /* This determines the size of the fb, which comes from the GBM surface that we create here. */ -int -KMSDRM_CreateSurfaces(_THIS, SDL_Window * window) +int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); SDL_WindowData *windata = (SDL_WindowData *)window->driverdata; @@ -1155,9 +1207,9 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window) } if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm_dev, - surface_fmt, surface_flags)) { + surface_fmt, surface_flags)) { SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, - "GBM surface format not supported. Trying anyway."); + "GBM surface format not supported. Trying anyway."); } /* The KMSDRM backend doesn't always set the mode the higher-level code in @@ -1171,8 +1223,8 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window) display->current_mode.format = SDL_PIXELFORMAT_ARGB8888; windata->gs = KMSDRM_gbm_surface_create(viddata->gbm_dev, - dispdata->mode.hdisplay, dispdata->mode.vdisplay, - surface_fmt, surface_flags); + dispdata->mode.hdisplay, dispdata->mode.vdisplay, + surface_fmt, surface_flags); if (!windata->gs) { return SDL_SetError("Could not create GBM surface"); @@ -1212,8 +1264,39 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window) return ret; } -int -KMSDRM_VideoInit(_THIS) +#ifdef SDL_INPUT_LINUXEV +static void KMSDRM_ReleaseVT(void *userdata) +{ + SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata; + SDL_VideoData *viddata = _this->driverdata; + int i; + + for (i = 0; i < viddata->num_windows; i++) { + SDL_Window *window = viddata->windows[i]; + if (!(window->flags & SDL_WINDOW_VULKAN)) { + KMSDRM_DestroySurfaces(_this, window); + } + } + KMSDRM_drmDropMaster(viddata->drm_fd); +} + +static void KMSDRM_AcquireVT(void *userdata) +{ + SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata; + SDL_VideoData *viddata = _this->driverdata; + int i; + + KMSDRM_drmSetMaster(viddata->drm_fd); + for (i = 0; i < viddata->num_windows; i++) { + SDL_Window *window = viddata->windows[i]; + if (!(window->flags & SDL_WINDOW_VULKAN)) { + KMSDRM_CreateSurfaces(_this, window); + } + } +} +#endif /* defined SDL_INPUT_LINUXEV */ + +int KMSDRM_VideoInit(_THIS) { int ret = 0; @@ -1233,6 +1316,7 @@ KMSDRM_VideoInit(_THIS) #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Init(); + SDL_EVDEV_SetVTSwitchCallbacks(KMSDRM_ReleaseVT, _this, KMSDRM_AcquireVT, _this); #elif defined(SDL_INPUT_WSCONS) SDL_WSCONS_Init(); #endif @@ -1244,14 +1328,14 @@ KMSDRM_VideoInit(_THIS) /* The driverdata pointers, like dispdata, viddata, windata, etc... are freed by SDL internals, so not our job. */ -void -KMSDRM_VideoQuit(_THIS) +void KMSDRM_VideoQuit(_THIS) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); KMSDRM_DeinitDisplays(_this); #ifdef SDL_INPUT_LINUXEV + SDL_EVDEV_SetVTSwitchCallbacks(NULL, NULL, NULL, NULL); SDL_EVDEV_Quit(); #elif defined(SDL_INPUT_WSCONS) SDL_WSCONS_Quit(); @@ -1266,8 +1350,7 @@ KMSDRM_VideoQuit(_THIS) } /* Read modes from the connector modes, and store them in display->display_modes. */ -void -KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { SDL_DisplayData *dispdata = display->driverdata; drmModeConnector *conn = dispdata->connector; @@ -1293,8 +1376,7 @@ KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay * display) } } -int -KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { /* Set the dispdata->mode to the new mode and leave actual modesetting pending to be done on SwapWindow() via drmModeSetCrtc() */ @@ -1325,11 +1407,10 @@ KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) return 0; } -void -KMSDRM_DestroyWindow(_THIS, SDL_Window *window) +void KMSDRM_DestroyWindow(_THIS, SDL_Window *window) { - SDL_WindowData *windata = (SDL_WindowData *) window->driverdata; - SDL_DisplayData *dispdata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_WindowData *windata = (SDL_WindowData *)window->driverdata; + SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; SDL_VideoData *viddata; SDL_bool is_vulkan = window->flags & SDL_WINDOW_VULKAN; /* Is this a VK window? */ unsigned int i, j; @@ -1343,7 +1424,7 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window) viddata = windata->viddata; - if ( !is_vulkan && viddata->gbm_init) { + if (!is_vulkan && viddata->gbm_init) { /* Destroy cursor GBM BO of the display of this window. */ KMSDRM_DestroyCursorBO(_this, SDL_GetDisplayForWindow(window)); @@ -1358,15 +1439,15 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window) added to the windows list. */ if (viddata->num_windows <= 1) { - /* Unload EGL/GL library and free egl_data. */ - if (_this->egl_data) { - SDL_EGL_UnloadLibrary(_this); - _this->gl_config.driver_loaded = 0; - } + /* Unload EGL/GL library and free egl_data. */ + if (_this->egl_data) { + SDL_EGL_UnloadLibrary(_this); + _this->gl_config.driver_loaded = 0; + } - /* Free display plane, and destroy GBM device. */ - KMSDRM_GBMDeinit(_this, dispdata); - } + /* Free display plane, and destroy GBM device. */ + KMSDRM_GBMDeinit(_this, dispdata); + } } else { @@ -1403,16 +1484,15 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window) /* We simply IGNORE if it's a fullscreen window, window->flags don't */ /* reflect it: if it's fullscreen, KMSDRM_SetWindwoFullscreen() will */ /* be called by SDL later, and we can manage it there. */ -/**********************************************************************/ -int -KMSDRM_CreateWindow(_THIS, SDL_Window * window) +/**********************************************************************/ +int KMSDRM_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *windata = NULL; SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *dispdata = display->driverdata; SDL_bool is_vulkan = window->flags & SDL_WINDOW_VULKAN; /* Is this a VK window? */ - SDL_bool vulkan_mode = viddata->vulkan_mode; /* Do we have any Vulkan windows? */ + SDL_bool vulkan_mode = viddata->vulkan_mode; /* Do we have any Vulkan windows? */ NativeDisplayType egl_display; drmModeModeInfo *mode; int ret = 0; @@ -1420,13 +1500,19 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) /* Allocate window internal data */ windata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); if (!windata) { - return(SDL_OutOfMemory()); + return SDL_OutOfMemory(); } /* Setup driver data for this window */ windata->viddata = viddata; window->driverdata = windata; + /* Do we want a double buffering scheme to get low video lag? */ + windata->double_buffer = SDL_FALSE; + if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) { + windata->double_buffer = SDL_TRUE; + } + if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */ /* Maybe you didn't ask for an OPENGL window, but that's what you will get. @@ -1438,7 +1524,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) /* After SDL_CreateWindow, most SDL2 programs will do SDL_CreateRenderer(), which will in turn call GL_CreateRenderer() or GLES2_CreateRenderer(). In order for the GL_CreateRenderer() or GLES2_CreateRenderer() call to - succeed without an unnecessary window re-creation, we must: + succeed without an unnecessary window re-creation, we must: -Mark the window as being OPENGL -Load the GL library (which can't be done until the GBM device has been created, so we have to do it here instead of doing it on VideoInit()) @@ -1451,8 +1537,9 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) /* Reopen FD, create gbm dev, setup display plane, etc,. but only when we come here for the first time, and only if it's not a VK window. */ - if ((ret = KMSDRM_GBMInit(_this, dispdata))) { - return (SDL_SetError("Can't init GBM on window creation.")); + ret = KMSDRM_GBMInit(_this, dispdata); + if (ret != 0) { + return SDL_SetError("Can't init GBM on window creation."); } } @@ -1469,12 +1556,11 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) _this->gl_config.major_version = 2; _this->gl_config.minor_version = 0; if (SDL_EGL_LoadLibrary(_this, NULL, egl_display, EGL_PLATFORM_GBM_MESA) < 0) { - return (SDL_SetError("Can't load EGL/GL library on window creation.")); + return SDL_SetError("Can't load EGL/GL library on window creation."); } } _this->gl_config.driver_loaded = 1; - } /* Create the cursor BO for the display of this window, @@ -1491,7 +1577,7 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) If a window is fullscreen, SDL internals will call KMSDRM_SetWindowFullscreen() to reconfigure it if necessary. */ mode = KMSDRM_GetClosestDisplayMode(display, - window->windowed.w, window->windowed.h, 0 ); + window->windowed.w, window->windowed.h, 0); if (mode) { dispdata->fullscreen_mode = *mode; @@ -1501,8 +1587,9 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) /* Create the window surfaces with the size we have just chosen. Needs the window diverdata in place. */ - if ((ret = KMSDRM_CreateSurfaces(_this, window))) { - return (SDL_SetError("Can't window GBM/EGL surfaces on window creation.")); + ret = KMSDRM_CreateSurfaces(_this, window); + if (ret != 0) { + return SDL_SetError("Can't window GBM/EGL surfaces on window creation."); } } /* NON-Vulkan block ends. */ @@ -1512,11 +1599,11 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) if (viddata->num_windows >= viddata->max_windows) { unsigned int new_max_windows = viddata->max_windows + 1; viddata->windows = (SDL_Window **)SDL_realloc(viddata->windows, - new_max_windows * sizeof(SDL_Window *)); + new_max_windows * sizeof(SDL_Window *)); viddata->max_windows = new_max_windows; if (!viddata->windows) { - return (SDL_OutOfMemory()); + return SDL_OutOfMemory(); } } @@ -1531,16 +1618,20 @@ KMSDRM_CreateWindow(_THIS, SDL_Window * window) SDL_SetKeyboardFocus(window); /* Tell the app that the window has moved to top-left. */ - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, 0, 0); + { + SDL_Rect display_bounds; + SDL_zero(display_bounds); + SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, display_bounds.x, display_bounds.y); + } /* Allocated windata will be freed in KMSDRM_DestroyWindow, and KMSDRM_DestroyWindow() will be called by SDL_CreateWindow() - if we return error on any of the previous returns of the function. */ + if we return error on any of the previous returns of the function. */ return ret; } -int -KMSDRM_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) +int KMSDRM_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) { SDL_WindowData *windata = (SDL_WindowData*)window->driverdata; SDL_VideoData *viddata = (SDL_VideoData*)windata->viddata; @@ -1553,15 +1644,14 @@ KMSDRM_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) return 0; } -int -KMSDRM_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) +int KMSDRM_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) { SDL_WindowData *windata = (SDL_WindowData*)window->driverdata; SDL_VideoData *viddata = (SDL_VideoData*)windata->viddata; SDL_VideoDisplay *disp = SDL_GetDisplayForWindow(window); SDL_DisplayData* dispdata = (SDL_DisplayData*)disp->driverdata; Uint16* tempRamp = SDL_calloc(3 * sizeof(Uint16), 256); - if (tempRamp == NULL) + if (!tempRamp) { return SDL_OutOfMemory(); } @@ -1575,34 +1665,28 @@ KMSDRM_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) return 0; } -int -KMSDRM_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int KMSDRM_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { return -1; } -void -KMSDRM_SetWindowTitle(_THIS, SDL_Window * window) +void KMSDRM_SetWindowTitle(_THIS, SDL_Window *window) { } -void -KMSDRM_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void KMSDRM_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { } -void -KMSDRM_SetWindowPosition(_THIS, SDL_Window * window) +void KMSDRM_SetWindowPosition(_THIS, SDL_Window *window) { } -void -KMSDRM_SetWindowSize(_THIS, SDL_Window * window) +void KMSDRM_SetWindowSize(_THIS, SDL_Window *window) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); if (!viddata->vulkan_mode) { KMSDRM_DirtySurfaces(window); } } -void -KMSDRM_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); @@ -1610,36 +1694,29 @@ KMSDRM_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * displa KMSDRM_DirtySurfaces(window); } } -void -KMSDRM_ShowWindow(_THIS, SDL_Window * window) +void KMSDRM_ShowWindow(_THIS, SDL_Window *window) { } -void -KMSDRM_HideWindow(_THIS, SDL_Window * window) +void KMSDRM_HideWindow(_THIS, SDL_Window *window) { } -void -KMSDRM_RaiseWindow(_THIS, SDL_Window * window) +void KMSDRM_RaiseWindow(_THIS, SDL_Window *window) { } -void -KMSDRM_MaximizeWindow(_THIS, SDL_Window * window) +void KMSDRM_MaximizeWindow(_THIS, SDL_Window *window) { } -void -KMSDRM_MinimizeWindow(_THIS, SDL_Window * window) +void KMSDRM_MinimizeWindow(_THIS, SDL_Window *window) { } -void -KMSDRM_RestoreWindow(_THIS, SDL_Window * window) +void KMSDRM_RestoreWindow(_THIS, SDL_Window *window) { } /*****************************************************************************/ /* SDL Window Manager function */ /*****************************************************************************/ -SDL_bool -KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata); const Uint32 version = SDL_VERSIONNUM((Uint32)info->version.major, @@ -1651,10 +1728,10 @@ KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) return SDL_FALSE; } - info->subsystem = SDL_SYSWM_KMSDRM; - info->info.kmsdrm.dev_index = viddata->devindex; - info->info.kmsdrm.drm_fd = viddata->drm_fd; - info->info.kmsdrm.gbm_dev = viddata->gbm_dev; + info->subsystem = SDL_SYSWM_KMSDRM; + info->info.kmsdrm.dev_index = viddata->devindex; + info->info.kmsdrm.drm_fd = viddata->drm_fd; + info->info.kmsdrm.gbm_dev = viddata->gbm_dev; return SDL_TRUE; } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index b3e719cc586a9..16431435d6fd1 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,17 +33,56 @@ #include #include +#ifndef DRM_FORMAT_MOD_INVALID +#define DRM_FORMAT_MOD_INVALID 0x00ffffffffffffffULL +#endif + +#ifndef DRM_MODE_FB_MODIFIERS +#define DRM_MODE_FB_MODIFIERS 2 +#endif + +#ifndef DRM_MODE_PAGE_FLIP_ASYNC +#define DRM_MODE_PAGE_FLIP_ASYNC 2 +#endif + +#ifndef DRM_MODE_OBJECT_CONNECTOR +#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 +#endif + +#ifndef DRM_MODE_OBJECT_CRTC +#define DRM_MODE_OBJECT_CRTC 0xcccccccc +#endif + +#ifndef DRM_CAP_ASYNC_PAGE_FLIP +#define DRM_CAP_ASYNC_PAGE_FLIP 7 +#endif + +#ifndef DRM_CAP_CURSOR_WIDTH +#define DRM_CAP_CURSOR_WIDTH 8 +#endif + +#ifndef DRM_CAP_CURSOR_HEIGHT +#define DRM_CAP_CURSOR_HEIGHT 9 +#endif + +#ifndef GBM_FORMAT_ARGB8888 +#define GBM_FORMAT_ARGB8888 ((uint32_t)('A') | ((uint32_t)('R') << 8) | ((uint32_t)('2') << 16) | ((uint32_t)('4') << 24)) +#define GBM_BO_USE_CURSOR (1 << 1) +#define GBM_BO_USE_WRITE (1 << 3) +#define GBM_BO_USE_LINEAR (1 << 4) +#endif + typedef struct SDL_VideoData { - int devindex; /* device index that was passed on creation */ - int drm_fd; /* DRM file desc */ - char devpath[32]; /* DRM dev path. */ + int devindex; /* device index that was passed on creation */ + int drm_fd; /* DRM file desc */ + char devpath[32]; /* DRM dev path. */ struct gbm_device *gbm_dev; SDL_bool video_init; /* Has VideoInit succeeded? */ SDL_bool vulkan_mode; /* Are we in Vulkan mode? One VK window is enough to be. */ - SDL_bool async_pageflip_support; /* Does the hardware support async. pageflips? */ + SDL_bool async_pageflip_support; /* Does the hardware support async. pageflips? */ SDL_Window **windows; int max_windows; @@ -55,13 +94,11 @@ typedef struct SDL_VideoData } SDL_VideoData; - typedef struct SDL_DisplayModeData { int mode_index; } SDL_DisplayModeData; - typedef struct SDL_DisplayData { drmModeConnector *connector; @@ -70,7 +107,7 @@ typedef struct SDL_DisplayData drmModeModeInfo original_mode; drmModeModeInfo fullscreen_mode; - drmModeCrtc *saved_crtc; /* CRTC to restore on quit */ + drmModeCrtc *saved_crtc; /* CRTC to restore on quit */ SDL_bool saved_vrr; /* DRM & GBM cursor stuff lives here, not in an SDL_Cursor's driverdata struct, @@ -104,12 +141,12 @@ typedef struct SDL_WindowData typedef struct KMSDRM_FBInfo { - int drm_fd; /* DRM file desc */ - uint32_t fb_id; /* DRM framebuffer ID */ + int drm_fd; /* DRM file desc */ + uint32_t fb_id; /* DRM framebuffer ID */ } KMSDRM_FBInfo; /* Helper functions */ -int KMSDRM_CreateSurfaces(_THIS, SDL_Window * window); +int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window); KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo); KMSDRM_FBInfo *KMSDRM_FBFromBO2(_THIS, struct gbm_bo *bo, int w, int h); SDL_bool KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata); @@ -148,11 +185,11 @@ SDL_bool KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); void *KMSDRM_GLES_GetProcAddress(_THIS, const char *proc); void KMSDRM_GLES_UnloadLibrary(_THIS); -SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window * window); -int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); +int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); int KMSDRM_GLES_GetSwapInterval(_THIS); -int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window); +int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); void KMSDRM_GLES_DeleteContext(_THIS, SDL_GLContext context); #endif /* __SDL_KMSDRMVIDEO_H__ */ diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.c b/src/video/kmsdrm/SDL_kmsdrmvulkan.c index d404fd80221ec..5190b7721d1ff 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.c +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_KMSDRM +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_KMSDRM) #include "SDL_kmsdrmvideo.h" #include "SDL_kmsdrmdyn.h" @@ -38,9 +38,9 @@ #include "sys/ioctl.h" #if defined(__OpenBSD__) -#define DEFAULT_VULKAN "libvulkan.so" +#define DEFAULT_VULKAN "libvulkan.so" #else -#define DEFAULT_VULKAN "libvulkan.so.1" +#define DEFAULT_VULKAN "libvulkan.so.1" #endif int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) @@ -51,19 +51,23 @@ int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasDisplayExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) + } + if (!path) { path = DEFAULT_VULKAN; + } _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); @@ -71,45 +75,43 @@ int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; + } - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasDisplayExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else if(!hasDisplayExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_DISPLAY_EXTENSION_NAME "extension"); + } else if (!hasDisplayExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_DISPLAY_EXTENSION_NAME "extension"); goto fail; } @@ -123,8 +125,7 @@ int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) void KMSDRM_Vulkan_UnloadLibrary(_THIS) { - if(_this->vulkan_config.loader_handle) - { + if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } @@ -141,21 +142,20 @@ void KMSDRM_Vulkan_UnloadLibrary(_THIS) /* vkCreateInstance(). */ /*********************************************************************/ SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names) + SDL_Window *window, + unsigned *count, + const char **names) { static const char *const extensionsForKMSDRM[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME }; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } return SDL_Vulkan_GetInstanceExtensions_Helper( - count, names, SDL_arraysize(extensionsForKMSDRM), - extensionsForKMSDRM); + count, names, SDL_arraysize(extensionsForKMSDRM), + extensionsForKMSDRM); } void KMSDRM_Vulkan_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h) @@ -175,12 +175,12 @@ void KMSDRM_Vulkan_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h) /* and we get it here, ready to use. */ /* Extensions specific for this platform are activated in */ /* KMSDRM_Vulkan_GetInstanceExtensions(), like we do with */ -/* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */ +/* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */ /***********************************************************************/ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface) + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface) { VkPhysicalDevice gpu = NULL; uint32_t gpu_count; @@ -202,8 +202,8 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, VkExtent2D image_size; VkDisplayKHR display; VkDisplayModeKHR display_mode = (VkDisplayModeKHR)0; - VkDisplayModePropertiesKHR display_mode_props = {0}; - VkDisplayModeParametersKHR new_mode_parameters = { {0, 0}, 0}; + VkDisplayModePropertiesKHR display_mode_props = { 0 }; + VkDisplayModeParametersKHR new_mode_parameters = { { 0, 0 }, 0 }; /* Prefer a plane that supports per-pixel alpha. */ VkDisplayPlaneAlphaFlagBitsKHR alpha_mode = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR; @@ -257,8 +257,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, (PFN_vkCreateDisplayModeKHR)vkGetInstanceProcAddr( instance, "vkCreateDisplayModeKHR"); - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); goto clean; } @@ -272,8 +271,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, /* that the VK_KHR_Display extension is active on the instance. */ /* That's the central extension we need for x-less VK! */ /****************************************************************/ - if(!vkCreateDisplayPlaneSurfaceKHR) - { + if (!vkCreateDisplayPlaneSurfaceKHR) { SDL_SetError(VK_KHR_DISPLAY_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); goto clean; @@ -306,13 +304,11 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, /* Get the physical device properties. */ vkGetPhysicalDeviceProperties( physical_devices[i], - device_props - ); + device_props); /* Is this device a real GPU that supports API version 1 at least? */ - if (device_props->apiVersion >= 1 && - (device_props->deviceType == 1 || device_props->deviceType == 2)) - { + if (device_props->apiVersion >= 1 && + (device_props->deviceType == 1 || device_props->deviceType == 2)) { gpu = physical_devices[i]; valid_gpu = SDL_TRUE; break; @@ -334,29 +330,29 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, } /* Get the props of the displays of the physical device. */ - display_props = (VkDisplayPropertiesKHR *) SDL_malloc(display_count * sizeof(*display_props)); + display_props = (VkDisplayPropertiesKHR *)SDL_malloc(display_count * sizeof(*display_props)); vkGetPhysicalDeviceDisplayPropertiesKHR(gpu, - &display_count, - display_props); + &display_count, + display_props); /* Get the chosen display based on the display index. */ display = display_props[display_index].display; /* Get the list of the display videomodes. */ vkGetDisplayModePropertiesKHR(gpu, - display, - &mode_count, NULL); + display, + &mode_count, NULL); if (mode_count == 0) { SDL_SetError("Vulkan can't find any video modes for display %i (%s)\n", 0, - display_props[display_index].displayName); + display_props[display_index].displayName); goto clean; } - mode_props = (VkDisplayModePropertiesKHR *) SDL_malloc(mode_count * sizeof(*mode_props)); + mode_props = (VkDisplayModePropertiesKHR *)SDL_malloc(mode_count * sizeof(*mode_props)); vkGetDisplayModePropertiesKHR(gpu, - display, - &mode_count, mode_props); + display, + &mode_count, mode_props); /* Get a video mode equal to the window size among the predefined ones, if possible. @@ -366,8 +362,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, buffer, and Vulkan would give us a confusing VK_ERROR_SURFACE_LOST_KHR). */ for (i = 0; i < mode_count; i++) { if (mode_props[i].parameters.visibleRegion.width == window->w && - mode_props[i].parameters.visibleRegion.height == window->h) - { + mode_props[i].parameters.visibleRegion.height == window->h) { display_mode_props = mode_props[i]; mode_found = SDL_TRUE; break; @@ -376,7 +371,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, if (mode_found && display_mode_props.parameters.visibleRegion.width > 0 && - display_mode_props.parameters.visibleRegion.height > 0 ) { + display_mode_props.parameters.visibleRegion.height > 0) { /* Found a suitable mode among the predefined ones. Use that. */ display_mode = display_mode_props.displayMode; } else { @@ -406,8 +401,8 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, /* Just in case we get here without a display_mode. */ if (!display_mode) { - SDL_SetError("Vulkan couldn't get a display mode."); - goto clean; + SDL_SetError("Vulkan couldn't get a display mode."); + goto clean; } /* Get the list of the physical device planes. */ @@ -427,7 +422,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, for (i = 0; i < plane_count; i++) { uint32_t supported_displays_count = 0; - VkDisplayKHR* supported_displays; + VkDisplayKHR *supported_displays; /* See if the plane is compatible with the current display. */ vkGetDisplayPlaneSupportedDisplaysKHR(gpu, i, &supported_displays_count, NULL); @@ -437,15 +432,15 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, } /* Get the list of displays supported by this plane. */ - supported_displays = (VkDisplayKHR*)SDL_malloc(sizeof(VkDisplayKHR) * supported_displays_count); + supported_displays = (VkDisplayKHR *)SDL_malloc(sizeof(VkDisplayKHR) * supported_displays_count); vkGetDisplayPlaneSupportedDisplaysKHR(gpu, i, - &supported_displays_count, supported_displays); + &supported_displays_count, supported_displays); /* The plane must be bound to the chosen display, or not in use. If none of these is true, iterate to another plane. */ - if (!((plane_props[i].currentDisplay == display) || - (plane_props[i].currentDisplay == VK_NULL_HANDLE))) + if (!((plane_props[i].currentDisplay == display) || (plane_props[i].currentDisplay == VK_NULL_HANDLE))) { continue; + } /* Iterate the list of displays supported by this plane in order to find out if the chosen display is among them. */ @@ -488,7 +483,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, image_size.width = window->w; image_size.height = window->h; - + SDL_zero(display_plane_surface_create_info); display_plane_surface_create_info.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR; display_plane_surface_create_info.displayMode = display_mode; @@ -497,29 +492,33 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, display_plane_surface_create_info.transform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; display_plane_surface_create_info.alphaMode = alpha_mode; result = vkCreateDisplayPlaneSurfaceKHR(instance, - &display_plane_surface_create_info, - NULL, - surface); - if(result != VK_SUCCESS) - { + &display_plane_surface_create_info, + NULL, + surface); + if (result != VK_SUCCESS) { SDL_SetError("vkCreateDisplayPlaneSurfaceKHR failed: %s", - SDL_Vulkan_GetResultString(result)); + SDL_Vulkan_GetResultString(result)); goto clean; } ret = SDL_TRUE; clean: - if (physical_devices) - SDL_free (physical_devices); - if (display_props) - SDL_free (display_props); - if (device_props) - SDL_free (device_props); - if (plane_props) - SDL_free (plane_props); - if (mode_props) - SDL_free (mode_props); + if (physical_devices) { + SDL_free(physical_devices); + } + if (display_props) { + SDL_free(display_props); + } + if (device_props) { + SDL_free(device_props); + } + if (plane_props) { + SDL_free(plane_props); + } + if (mode_props) { + SDL_free(mode_props); + } return ret; } diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.h b/src/video/kmsdrm/SDL_kmsdrmvulkan.h index 92d08732cb9c8..1c2a48e6ce6df 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.h +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,19 +32,19 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_KMSDRM +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_KMSDRM) int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path); void KMSDRM_Vulkan_UnloadLibrary(_THIS); SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names); + SDL_Window *window, + unsigned *count, + const char **names); void KMSDRM_Vulkan_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h); SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface); + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface); #endif diff --git a/src/video/n3ds/SDL_n3dsevents.c b/src/video/n3ds/SDL_n3dsevents.c index 6b2126b1b237e..5c6b9ce050ed8 100644 --- a/src/video/n3ds/SDL_n3dsevents.c +++ b/src/video/n3ds/SDL_n3dsevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,11 +28,10 @@ #include "SDL_n3dsevents_c.h" #include "SDL_n3dstouch.h" -void -N3DS_PumpEvents(_THIS) +void N3DS_PumpEvents(_THIS) { hidScanInput(); - N3DS_PollTouch(); + N3DS_PollTouch(_this); if (!aptMainLoop()) { SDL_Event ev; diff --git a/src/video/n3ds/SDL_n3dsevents_c.h b/src/video/n3ds/SDL_n3dsevents_c.h index 418368c2b6754..f05cc7c7460fa 100644 --- a/src/video/n3ds/SDL_n3dsevents_c.h +++ b/src/video/n3ds/SDL_n3dsevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index ba4ec51bfa21b..d093b442275e8 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,85 +33,107 @@ typedef struct int width, height; } Dimensions; -SDL_FORCE_INLINE void FreePreviousWindowFramebuffer(SDL_Window *window); -SDL_FORCE_INLINE SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window); -SDL_FORCE_INLINE void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim); +SDL_FORCE_INLINE void CopyFramebuffertoN3DS_16(u16 *dest, const Dimensions dest_dim, const u16 *source, const Dimensions source_dim); +SDL_FORCE_INLINE void CopyFramebuffertoN3DS_24(u8 *dest, const Dimensions dest_dim, const u8 *source, const Dimensions source_dim); +SDL_FORCE_INLINE void CopyFramebuffertoN3DS_32(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim); SDL_FORCE_INLINE int GetDestOffset(int x, int y, int dest_width); SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width); SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); -int -SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +int SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *framebuffer; + SDL_DisplayMode mode; + int w, h; - FreePreviousWindowFramebuffer(window); - framebuffer = CreateNewWindowFramebuffer(window); + SDL_N3DS_DestroyWindowFramebuffer(_this, window); + + SDL_GetCurrentDisplayMode(SDL_GetWindowDisplayIndex(window), &mode); + SDL_GetWindowSizeInPixels(window, &w, &h); + framebuffer = SDL_CreateRGBSurfaceWithFormat(0, w, h, SDL_BYTESPERPIXEL(mode.format), mode.format); if (!framebuffer) { return SDL_OutOfMemory(); } SDL_SetWindowData(window, N3DS_SURFACE, framebuffer); - *format = FRAMEBUFFER_FORMAT; + *format = mode.format; *pixels = framebuffer->pixels; *pitch = framebuffer->pitch; return 0; } -SDL_FORCE_INLINE void -FreePreviousWindowFramebuffer(SDL_Window *window) -{ - SDL_Surface *surface = (SDL_Surface *) SDL_GetWindowData(window, N3DS_SURFACE); - SDL_FreeSurface(surface); -} - -SDL_FORCE_INLINE SDL_Surface * -CreateNewWindowFramebuffer(SDL_Window *window) +int SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { - int w, h, bpp; - Uint32 Rmask, Gmask, Bmask, Amask; - SDL_PixelFormatEnumToMasks(FRAMEBUFFER_FORMAT, &bpp, &Rmask, &Gmask, &Bmask, &Amask); - SDL_GetWindowSize(window, &w, &h); - return SDL_CreateRGBSurface(0, w, h, bpp, Rmask, Gmask, Bmask, Amask); -} - -int -SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) -{ - SDL_WindowData *drv_data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *drv_data = (SDL_WindowData *)window->driverdata; SDL_Surface *surface; u16 width, height; - u32 *framebuffer; + void *framebuffer; u32 bufsize; - surface = (SDL_Surface *) SDL_GetWindowData(window, N3DS_SURFACE); + surface = (SDL_Surface *)SDL_GetWindowData(window, N3DS_SURFACE); if (!surface) { return SDL_SetError("%s: Unable to get the window surface.", __func__); } /* Get the N3DS internal framebuffer and its size */ - framebuffer = (u32 *) gfxGetFramebuffer(drv_data->screen, GFX_LEFT, &width, &height); + framebuffer = gfxGetFramebuffer(drv_data->screen, GFX_LEFT, &width, &height); bufsize = width * height * 4; - CopyFramebuffertoN3DS(framebuffer, (Dimensions){ width, height }, - surface->pixels, (Dimensions){ surface->w, surface->h }); + if (surface->format->BytesPerPixel == 2) + CopyFramebuffertoN3DS_16(framebuffer, (Dimensions){ width, height }, + surface->pixels, (Dimensions){ surface->w, surface->h }); + else if (surface->format->BytesPerPixel == 3) + CopyFramebuffertoN3DS_24(framebuffer, (Dimensions){ width, height }, + surface->pixels, (Dimensions){ surface->w, surface->h }); + else + CopyFramebuffertoN3DS_32(framebuffer, (Dimensions){ width, height }, + surface->pixels, (Dimensions){ surface->w, surface->h }); FlushN3DSBuffer(framebuffer, bufsize, drv_data->screen); return 0; } SDL_FORCE_INLINE void -CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim) +CopyFramebuffertoN3DS_16(u16 *dest, const Dimensions dest_dim, const u16 *source, const Dimensions source_dim) +{ + int rows = SDL_min(dest_dim.width, source_dim.height); + int cols = SDL_min(dest_dim.height, source_dim.width); + for (int y = 0; y < rows; ++y) { + for (int x = 0; x < cols; ++x) { + const u16 *s = source + GetSourceOffset(x, y, source_dim.width); + u16 *d = dest + GetDestOffset(x, y, dest_dim.width); + *d = *s; + } + } +} + +SDL_FORCE_INLINE void +CopyFramebuffertoN3DS_24(u8 *dest, const Dimensions dest_dim, const u8 *source, const Dimensions source_dim) +{ + int rows = SDL_min(dest_dim.width, source_dim.height); + int cols = SDL_min(dest_dim.height, source_dim.width); + for (int y = 0; y < rows; ++y) { + for (int x = 0; x < cols; ++x) { + const u8 *s = source + GetSourceOffset(x, y, source_dim.width) * 3; + u8 *d = dest + GetDestOffset(x, y, dest_dim.width) * 3; + d[0] = s[0]; + d[1] = s[1]; + d[2] = s[2]; + } + } +} + +SDL_FORCE_INLINE void +CopyFramebuffertoN3DS_32(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim) { int rows = SDL_min(dest_dim.width, source_dim.height); int cols = SDL_min(dest_dim.height, source_dim.width); for (int y = 0; y < rows; ++y) { for (int x = 0; x < cols; ++x) { - SDL_memcpy( - dest + GetDestOffset(x, y, dest_dim.width), - source + GetSourceOffset(x, y, source_dim.width), - 4); + const u32 *s = source + GetSourceOffset(x, y, source_dim.width); + u32 *d = dest + GetDestOffset(x, y, dest_dim.width); + *d = *s; } } } @@ -135,11 +157,10 @@ FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen) gfxScreenSwapBuffers(screen, false); } -void -SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +void SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { SDL_Surface *surface; - surface = (SDL_Surface *) SDL_SetWindowData(window, N3DS_SURFACE, NULL); + surface = (SDL_Surface *)SDL_SetWindowData(window, N3DS_SURFACE, NULL); SDL_FreeSurface(surface); } diff --git a/src/video/n3ds/SDL_n3dsframebuffer_c.h b/src/video/n3ds/SDL_n3dsframebuffer_c.h index 3a4750c9d3265..bbcfd4c9b71f0 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer_c.h +++ b/src/video/n3ds/SDL_n3dsframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/n3ds/SDL_n3dsswkb.c b/src/video/n3ds/SDL_n3dsswkb.c index b577a3639ff0e..af1d8fc8efdfd 100644 --- a/src/video/n3ds/SDL_n3dsswkb.c +++ b/src/video/n3ds/SDL_n3dsswkb.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,32 +30,27 @@ static SwkbdState sw_keyboard; const static size_t BUFFER_SIZE = 256; -void -N3DS_SwkbInit() +void N3DS_SwkbInit(void) { swkbdInit(&sw_keyboard, SWKBD_TYPE_NORMAL, 2, -1); } -void -N3DS_SwkbPoll() +void N3DS_SwkbPoll(void) { return; } -void -N3DS_SwkbQuit() +void N3DS_SwkbQuit(void) { return; } -SDL_bool -N3DS_HasScreenKeyboardSupport(_THIS) +SDL_bool N3DS_HasScreenKeyboardSupport(_THIS) { return SDL_TRUE; } -void -N3DS_StartTextInput(_THIS) +void N3DS_StartTextInput(_THIS) { char buffer[BUFFER_SIZE]; SwkbdButton button_pressed; @@ -65,8 +60,7 @@ N3DS_StartTextInput(_THIS) } } -void -N3DS_StopTextInput(_THIS) +void N3DS_StopTextInput(_THIS) { return; } diff --git a/src/video/n3ds/SDL_n3dsswkb.h b/src/video/n3ds/SDL_n3dsswkb.h index 6a48ae8dedca8..196f7de24b0b3 100644 --- a/src/video/n3ds/SDL_n3dsswkb.h +++ b/src/video/n3ds/SDL_n3dsswkb.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/n3ds/SDL_n3dstouch.c b/src/video/n3ds/SDL_n3dstouch.c index fca0ae30f9a96..0b3f06ab559a5 100644 --- a/src/video/n3ds/SDL_n3dstouch.c +++ b/src/video/n3ds/SDL_n3dstouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,9 +26,11 @@ #include <3ds.h> #include "../../events/SDL_touch_c.h" +#include "../SDL_sysvideo.h" #include "SDL_n3dstouch.h" +#include "SDL_n3dsvideo.h" -#define N3DS_TOUCH_ID 0 +#define N3DS_TOUCH_ID 1 /* Factors used to convert touchscreen coordinates to @@ -39,32 +41,35 @@ #define TOUCHSCREEN_SCALE_X 1.0f / GSP_SCREEN_HEIGHT_BOTTOM #define TOUCHSCREEN_SCALE_Y 1.0f / GSP_SCREEN_WIDTH -void -N3DS_InitTouch(void) +void N3DS_InitTouch(void) { SDL_AddTouch(N3DS_TOUCH_ID, SDL_TOUCH_DEVICE_DIRECT, "Touchscreen"); } -void -N3DS_QuitTouch(void) +void N3DS_QuitTouch(void) { SDL_DelTouch(N3DS_TOUCH_ID); } -void -N3DS_PollTouch(void) +void N3DS_PollTouch(_THIS) { + SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; touchPosition touch; + SDL_Window *window; + SDL_VideoDisplay *display; static SDL_bool was_pressed = SDL_FALSE; SDL_bool pressed; hidTouchRead(&touch); pressed = (touch.px != 0 || touch.py != 0); + display = SDL_GetDisplay(driverdata->touch_display); + window = display ? display->fullscreen_window : NULL; + if (pressed != was_pressed) { was_pressed = pressed; SDL_SendTouch(N3DS_TOUCH_ID, 0, - NULL, + window, pressed, touch.px * TOUCHSCREEN_SCALE_X, touch.py * TOUCHSCREEN_SCALE_Y, @@ -72,7 +77,7 @@ N3DS_PollTouch(void) } else if (pressed) { SDL_SendTouchMotion(N3DS_TOUCH_ID, 0, - NULL, + window, touch.px * TOUCHSCREEN_SCALE_X, touch.py * TOUCHSCREEN_SCALE_Y, 1.0f); diff --git a/src/video/n3ds/SDL_n3dstouch.h b/src/video/n3ds/SDL_n3dstouch.h index 4cc7a053337bf..3d95fafcc3257 100644 --- a/src/video/n3ds/SDL_n3dstouch.h +++ b/src/video/n3ds/SDL_n3dstouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ void N3DS_InitTouch(void); void N3DS_QuitTouch(void); -void N3DS_PollTouch(void); +void N3DS_PollTouch(_THIS); #endif /* SDL_n3dstouch_h_ */ diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index d4a46ad065d9c..bb80f9c18d5dc 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,11 +31,12 @@ #define N3DSVID_DRIVER_NAME "n3ds" -SDL_FORCE_INLINE void AddN3DSDisplay(gfxScreen_t screen); +SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen); static int N3DS_VideoInit(_THIS); static void N3DS_VideoQuit(_THIS); static void N3DS_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +static int N3DS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); static int N3DS_CreateWindow(_THIS, SDL_Window *window); static void N3DS_DestroyWindow(_THIS, SDL_Window *window); @@ -45,29 +46,59 @@ typedef struct gfxScreen_t screen; } DisplayDriverData; +typedef struct +{ + GSPGPU_FramebufferFormat fmt; +} ModeDriverData; + +static const struct +{ + SDL_PixelFormatEnum pixfmt; + GSPGPU_FramebufferFormat gspfmt; +} format_map[] = { + { SDL_PIXELFORMAT_RGBA8888, GSP_RGBA8_OES }, + { SDL_PIXELFORMAT_BGR24, GSP_BGR8_OES }, + { SDL_PIXELFORMAT_RGB565, GSP_RGB565_OES }, + { SDL_PIXELFORMAT_RGBA5551, GSP_RGB5_A1_OES }, + { SDL_PIXELFORMAT_RGBA4444, GSP_RGBA4_OES } +}; + /* N3DS driver bootstrap functions */ -static void -N3DS_DeleteDevice(SDL_VideoDevice *device) +static void N3DS_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device->displays); SDL_free(device->driverdata); SDL_free(device); } -static SDL_VideoDevice * -N3DS_CreateDevice(void) +static SDL_VideoDevice *N3DS_CreateDevice(void) { - SDL_VideoDevice *device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + SDL_VideoDevice *device; + SDL_VideoData *phdata; + + /* Initialize all variables that we clean on shutdown */ + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } + /* Initialize internal data */ + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { + SDL_OutOfMemory(); + SDL_free(device); + return NULL; + } + + device->driverdata = phdata; + device->VideoInit = N3DS_VideoInit; device->VideoQuit = N3DS_VideoQuit; device->GetDisplayModes = N3DS_GetDisplayModes; + device->SetDisplayMode = N3DS_SetDisplayMode; device->GetDisplayBounds = N3DS_GetDisplayBounds; device->CreateSDLWindow = N3DS_CreateWindow; @@ -85,19 +116,22 @@ N3DS_CreateDevice(void) device->free = N3DS_DeleteDevice; + device->quirk_flags = VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY; + return device; } -VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS_CreateDevice }; +VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS_CreateDevice, NULL /* no ShowMessageBox implementation */ }; -static int -N3DS_VideoInit(_THIS) +static int N3DS_VideoInit(_THIS) { + SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; + gfxInit(GSP_RGBA8_OES, GSP_RGBA8_OES, false); hidInit(); - AddN3DSDisplay(GFX_TOP); - AddN3DSDisplay(GFX_BOTTOM); + driverdata->top_display = AddN3DSDisplay(GFX_TOP); + driverdata->touch_display = AddN3DSDisplay(GFX_BOTTOM); N3DS_InitTouch(); N3DS_SwkbInit(); @@ -105,15 +139,15 @@ N3DS_VideoInit(_THIS) return 0; } -SDL_FORCE_INLINE void +SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen) { SDL_DisplayMode mode; + ModeDriverData *modedata; SDL_VideoDisplay display; DisplayDriverData *display_driver_data = SDL_calloc(1, sizeof(DisplayDriverData)); - if (display_driver_data == NULL) { - SDL_OutOfMemory(); - return; + if (!display_driver_data) { + return SDL_OutOfMemory(); } SDL_zero(mode); @@ -121,22 +155,27 @@ AddN3DSDisplay(gfxScreen_t screen) display_driver_data->screen = screen; + modedata = SDL_malloc(sizeof(ModeDriverData)); + if (!modedata) { + return SDL_OutOfMemory(); + } + mode.w = (screen == GFX_TOP) ? GSP_SCREEN_HEIGHT_TOP : GSP_SCREEN_HEIGHT_BOTTOM; mode.h = GSP_SCREEN_WIDTH; mode.refresh_rate = 60; - mode.format = FRAMEBUFFER_FORMAT; - mode.driverdata = NULL; + mode.format = SDL_PIXELFORMAT_RGBA8888; + mode.driverdata = modedata; + modedata->fmt = GSP_RGBA8_OES; display.name = (screen == GFX_TOP) ? "N3DS top screen" : "N3DS bottom screen"; display.desktop_mode = mode; display.current_mode = mode; display.driverdata = display_driver_data; - SDL_AddVideoDisplay(&display, SDL_FALSE); + return SDL_AddVideoDisplay(&display, SDL_FALSE); } -static void -N3DS_VideoQuit(_THIS) +static void N3DS_VideoQuit(_THIS) { N3DS_SwkbQuit(); N3DS_QuitTouch(); @@ -145,18 +184,45 @@ N3DS_VideoQuit(_THIS) gfxExit(); } -static void -N3DS_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +static void N3DS_GetDisplayModes(_THIS, SDL_VideoDisplay *display) +{ + DisplayDriverData *displaydata = display->driverdata; + ModeDriverData *modedata; + SDL_DisplayMode mode; + int i; + + for (i = 0; i < SDL_arraysize(format_map); i++) { + modedata = SDL_malloc(sizeof(ModeDriverData)); + if (!modedata) + continue; + + SDL_zero(mode); + mode.w = (displaydata->screen == GFX_TOP) ? GSP_SCREEN_HEIGHT_TOP : GSP_SCREEN_HEIGHT_BOTTOM; + mode.h = GSP_SCREEN_WIDTH; + mode.refresh_rate = 60; + mode.format = format_map[i].pixfmt; + mode.driverdata = modedata; + modedata->fmt = format_map[i].gspfmt; + + if (!SDL_AddDisplayMode(display, &mode)) { + SDL_free(modedata); + } + } +} + +static int N3DS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - /* Each display only has a single mode */ - SDL_AddDisplayMode(display, &display->current_mode); + DisplayDriverData *displaydata = display->driverdata; + ModeDriverData *modedata = mode->driverdata; + + gfxSetScreenFormat(displaydata->screen, modedata->fmt); + return 0; } -static int -N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { - DisplayDriverData *driver_data = (DisplayDriverData *) display->driverdata; - if (driver_data == NULL) { + DisplayDriverData *driver_data = (DisplayDriverData *)display->driverdata; + if (!driver_data) { return -1; } rect->x = 0; @@ -167,25 +233,23 @@ N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) return 0; } -static int -N3DS_CreateWindow(_THIS, SDL_Window *window) +static int N3DS_CreateWindow(_THIS, SDL_Window *window) { DisplayDriverData *display_data; - SDL_WindowData *window_data = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (window_data == NULL) { + SDL_WindowData *window_data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!window_data) { return SDL_OutOfMemory(); } - display_data = (DisplayDriverData *) SDL_GetDisplayDriverData(window->display_index); + display_data = (DisplayDriverData *)SDL_GetDisplayDriverData(window->display_index); window_data->screen = display_data->screen; window->driverdata = window_data; SDL_SetKeyboardFocus(window); return 0; } -static void -N3DS_DestroyWindow(_THIS, SDL_Window *window) +static void N3DS_DestroyWindow(_THIS, SDL_Window *window) { - if (window == NULL) { + if (!window) { return; } SDL_free(window->driverdata); diff --git a/src/video/n3ds/SDL_n3dsvideo.h b/src/video/n3ds/SDL_n3dsvideo.h index c1b15f712fbc9..205f7d270f868 100644 --- a/src/video/n3ds/SDL_n3dsvideo.h +++ b/src/video/n3ds/SDL_n3dsvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,13 +26,18 @@ #include <3ds.h> #include "../SDL_sysvideo.h" + +typedef struct SDL_VideoData +{ + int top_display; + int touch_display; +} SDL_VideoData; + typedef struct SDL_WindowData { gfxScreen_t screen; /**< Keeps track of which N3DS screen is targetted */ } SDL_WindowData; -#define FRAMEBUFFER_FORMAT SDL_PIXELFORMAT_RGBA8888 - #endif /* SDL_n3dsvideo_h_ */ /* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/src/video/nacl/SDL_naclevents.c b/src/video/nacl/SDL_naclevents.c index dbfce081b3718..08cba118109b5 100644 --- a/src/video/nacl/SDL_naclevents.c +++ b/src/video/nacl/SDL_naclevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL #include "SDL.h" #include "../../events/SDL_events_c.h" @@ -305,8 +305,7 @@ static Uint8 SDL_NACL_translate_mouse_button(int32_t button) { } } -static SDL_Scancode -SDL_NACL_translate_keycode(int keycode) +static SDL_Scancode SDL_NACL_translate_keycode(int keycode) { SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; diff --git a/src/video/nacl/SDL_naclevents_c.h b/src/video/nacl/SDL_naclevents_c.h index e8d44f41b7638..1b01e99a5311d 100644 --- a/src/video/nacl/SDL_naclevents_c.h +++ b/src/video/nacl/SDL_naclevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/nacl/SDL_naclglue.c b/src/video/nacl/SDL_naclglue.c index ac1e16029685b..7ba6db31bea30 100644 --- a/src/video/nacl/SDL_naclglue.c +++ b/src/video/nacl/SDL_naclglue.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,5 +20,5 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL #endif /* SDL_VIDEO_DRIVER_NACL */ diff --git a/src/video/nacl/SDL_naclopengles.c b/src/video/nacl/SDL_naclopengles.c index ca5b75f992b33..f1fa7976d703d 100644 --- a/src/video/nacl/SDL_naclopengles.c +++ b/src/video/nacl/SDL_naclopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL /* NaCl SDL video GLES 2 driver implementation */ @@ -35,15 +35,13 @@ #include "ppapi_simple/ps.h" /* GL functions */ -int -NACL_GLES_LoadLibrary(_THIS, const char *path) +int NACL_GLES_LoadLibrary(_THIS, const char *path) { /* FIXME: Support dynamic linking when PNACL supports it */ return glInitializePPAPI(PSGetInterface) == 0; } -void * -NACL_GLES_GetProcAddress(_THIS, const char *proc) +void *NACL_GLES_GetProcAddress(_THIS, const char *proc) { #ifdef HAVE_DLOPEN return dlsym( 0 /* RTLD_DEFAULT */, proc); @@ -52,15 +50,13 @@ NACL_GLES_GetProcAddress(_THIS, const char *proc) #endif } -void -NACL_GLES_UnloadLibrary(_THIS) +void NACL_GLES_UnloadLibrary(_THIS) { /* FIXME: Support dynamic linking when PNACL supports it */ glTerminatePPAPI(); } -int -NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext sdl_context) +int NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext sdl_context) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; /* FIXME: Check threading issues...otherwise use a hardcoded _this->context across all threads */ @@ -69,21 +65,20 @@ NACL_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext sdl_context) return 0; } -SDL_GLContext -NACL_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext NACL_GLES_CreateContext(_THIS, SDL_Window * window) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; PP_Resource context, share_context = 0; /* 64 seems nice. */ Sint32 attribs[64]; int i = 0; - + if (_this->gl_config.share_with_current_context) { share_context = (PP_Resource) SDL_GL_GetCurrentContext(); } /* FIXME: Some ATTRIBS from PP_Graphics3DAttrib are not set here */ - + attribs[i++] = PP_GRAPHICS3DATTRIB_WIDTH; attribs[i++] = window->w; attribs[i++] = PP_GRAPHICS3DATTRIB_HEIGHT; @@ -94,65 +89,62 @@ NACL_GLES_CreateContext(_THIS, SDL_Window * window) attribs[i++] = _this->gl_config.green_size; attribs[i++] = PP_GRAPHICS3DATTRIB_BLUE_SIZE; attribs[i++] = _this->gl_config.blue_size; - + if (_this->gl_config.alpha_size) { attribs[i++] = PP_GRAPHICS3DATTRIB_ALPHA_SIZE; attribs[i++] = _this->gl_config.alpha_size; } - + /*if (_this->gl_config.buffer_size) { attribs[i++] = EGL_BUFFER_SIZE; attribs[i++] = _this->gl_config.buffer_size; }*/ - + attribs[i++] = PP_GRAPHICS3DATTRIB_DEPTH_SIZE; attribs[i++] = _this->gl_config.depth_size; - + if (_this->gl_config.stencil_size) { attribs[i++] = PP_GRAPHICS3DATTRIB_STENCIL_SIZE; attribs[i++] = _this->gl_config.stencil_size; } - + if (_this->gl_config.multisamplebuffers) { attribs[i++] = PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS; attribs[i++] = _this->gl_config.multisamplebuffers; } - + if (_this->gl_config.multisamplesamples) { attribs[i++] = PP_GRAPHICS3DATTRIB_SAMPLES; attribs[i++] = _this->gl_config.multisamplesamples; } - + attribs[i++] = PP_GRAPHICS3DATTRIB_NONE; - + context = driverdata->ppb_graphics->Create(driverdata->instance, share_context, attribs); if (context) { /* We need to make the context current, otherwise nothing works */ SDL_GL_MakeCurrent(window, (SDL_GLContext) context); } - + return (SDL_GLContext) context; } -int -NACL_GLES_SetSwapInterval(_THIS, int interval) +int NACL_GLES_SetSwapInterval(_THIS, int interval) { /* STUB */ return SDL_Unsupported(); } -int -NACL_GLES_GetSwapInterval(_THIS) +int NACL_GLES_GetSwapInterval(_THIS) { /* STUB */ return 0; } -int -NACL_GLES_SwapWindow(_THIS, SDL_Window * window) +int NACL_GLES_SwapWindow(_THIS, SDL_Window * window) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; struct PP_CompletionCallback callback = { NULL, 0, PP_COMPLETIONCALLBACK_FLAG_NONE }; @@ -162,8 +154,7 @@ NACL_GLES_SwapWindow(_THIS, SDL_Window * window) return 0; } -void -NACL_GLES_DeleteContext(_THIS, SDL_GLContext context) +void NACL_GLES_DeleteContext(_THIS, SDL_GLContext context) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; driverdata->ppb_core->ReleaseResource((PP_Resource) context); diff --git a/src/video/nacl/SDL_naclopengles.h b/src/video/nacl/SDL_naclopengles.h index a3fee1f5b2037..026eaa6ed7696 100644 --- a/src/video/nacl/SDL_naclopengles.h +++ b/src/video/nacl/SDL_naclopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/nacl/SDL_naclvideo.c b/src/video/nacl/SDL_naclvideo.c index 986bfb31261a4..f7f35e73a1bd8 100644 --- a/src/video/nacl/SDL_naclvideo.c +++ b/src/video/nacl/SDL_naclvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL #include "ppapi/c/pp_errors.h" #include "ppapi/c/pp_instance.h" @@ -32,34 +32,33 @@ #include "SDL_naclvideo.h" #include "SDL_naclwindow.h" #include "SDL_naclevents_c.h" -#include "SDL_naclopengles.h" +#include "SDL_naclopengles.h" #include "SDL_video.h" #include "../SDL_sysvideo.h" #include "../../events/SDL_events_c.h" #define NACLVID_DRIVER_NAME "nacl" -/* Static init required because NACL_SetScreenResolution +/* Static init required because NACL_SetScreenResolution * may appear even before SDL starts and we want to remember * the window width and height */ static SDL_VideoData nacl = {0}; -void -NACL_SetScreenResolution(int width, int height, Uint32 format) +void NACL_SetScreenResolution(int width, int height, Uint32 format) { PP_Resource context; - + nacl.w = width; - nacl.h = height; + nacl.h = height; nacl.format = format; - + if (nacl.window) { nacl.window->w = width; nacl.window->h = height; SDL_SendWindowEvent(nacl.window, SDL_WINDOWEVENT_RESIZED, width, height); } - + /* FIXME: Check threading issues...otherwise use a hardcoded _this->context across all threads */ context = (PP_Resource) SDL_GL_GetCurrentContext(); if (context) { @@ -85,19 +84,18 @@ static void NACL_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device); } -static int -NACL_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int NACL_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { return 0; } static SDL_VideoDevice *NACL_CreateDevice(void) { SDL_VideoDevice *device; - + if (!NACL_Available()) { return NULL; } - + /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { @@ -105,20 +103,20 @@ static SDL_VideoDevice *NACL_CreateDevice(void) { return NULL; } device->driverdata = &nacl; - + /* Set the function pointers */ device->VideoInit = NACL_VideoInit; device->VideoQuit = NACL_VideoQuit; device->PumpEvents = NACL_PumpEvents; - + device->CreateSDLWindow = NACL_CreateWindow; device->SetWindowTitle = NACL_SetWindowTitle; device->DestroyWindow = NACL_DestroyWindow; - + device->SetDisplayMode = NACL_SetDisplayMode; - + device->free = NACL_DeleteDevice; - + /* GL pointers */ device->GL_LoadLibrary = NACL_GLES_LoadLibrary; device->GL_GetProcAddress = NACL_GLES_GetProcAddress; @@ -129,14 +127,16 @@ static SDL_VideoDevice *NACL_CreateDevice(void) { device->GL_GetSwapInterval = NACL_GLES_GetSwapInterval; device->GL_SwapWindow = NACL_GLES_SwapWindow; device->GL_DeleteContext = NACL_GLES_DeleteContext; - - + + device->quirk_flags = VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY; + return device; } VideoBootStrap NACL_bootstrap = { NACLVID_DRIVER_NAME, "SDL Native Client Video Driver", - NACL_CreateDevice + NACL_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; int NACL_VideoInit(_THIS) { @@ -154,7 +154,7 @@ int NACL_VideoInit(_THIS) { } SDL_AddDisplayMode(&_this->displays[0], &mode); - + PSInterfaceInit(); driverdata->instance = PSGetInstanceId(); driverdata->ppb_graphics = PSInterfaceGraphics3D(); @@ -170,12 +170,12 @@ int NACL_VideoInit(_THIS) { driverdata->ppb_mouse_input_event = (PPB_MouseInputEvent*) PSGetInterface(PPB_MOUSE_INPUT_EVENT_INTERFACE); driverdata->ppb_wheel_input_event = (PPB_WheelInputEvent*) PSGetInterface(PPB_WHEEL_INPUT_EVENT_INTERFACE); driverdata->ppb_touch_input_event = (PPB_TouchInputEvent*) PSGetInterface(PPB_TOUCH_INPUT_EVENT_INTERFACE); - - + + driverdata->message_loop = driverdata->ppb_message_loop->Create(driverdata->instance); - + PSEventSetFilter(PSE_ALL); - + /* We're done! */ return 0; } diff --git a/src/video/nacl/SDL_naclvideo.h b/src/video/nacl/SDL_naclvideo.h index 3b08920493b6c..8be165f2448eb 100644 --- a/src/video/nacl/SDL_naclvideo.h +++ b/src/video/nacl/SDL_naclvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/nacl/SDL_naclwindow.c b/src/video/nacl/SDL_naclwindow.c index f0245aef256f2..072e4a8100c12 100644 --- a/src/video/nacl/SDL_naclwindow.c +++ b/src/video/nacl/SDL_naclwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NACL +#ifdef SDL_VIDEO_DRIVER_NACL #include "../SDL_sysvideo.h" @@ -29,11 +29,10 @@ #include "SDL_naclvideo.h" #include "SDL_naclwindow.h" -int -NACL_CreateWindow(_THIS, SDL_Window * window) +int NACL_CreateWindow(_THIS, SDL_Window * window) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; - + if (driverdata->window) { return SDL_SetError("NaCl only supports one window"); } @@ -46,26 +45,23 @@ NACL_CreateWindow(_THIS, SDL_Window * window) window->h = driverdata->h; window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */ - window->flags |= SDL_WINDOW_FULLSCREEN; /* window is always fullscreen */ window->flags &= ~SDL_WINDOW_HIDDEN; window->flags |= SDL_WINDOW_SHOWN; /* only one window on NaCl */ - window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ + window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */ window->flags |= SDL_WINDOW_OPENGL; - + SDL_SetMouseFocus(window); SDL_SetKeyboardFocus(window); - + return 0; } -void -NACL_SetWindowTitle(_THIS, SDL_Window * window) +void NACL_SetWindowTitle(_THIS, SDL_Window * window) { /* TODO */ } -void -NACL_DestroyWindow(_THIS, SDL_Window * window) +void NACL_DestroyWindow(_THIS, SDL_Window * window) { SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; if (window == driverdata->window) { diff --git a/src/video/nacl/SDL_naclwindow.h b/src/video/nacl/SDL_naclwindow.h index 65757c4120a9e..d2d5521f0d280 100644 --- a/src/video/nacl/SDL_naclwindow.h +++ b/src/video/nacl/SDL_naclwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/ngage/SDL_ngageevents.cpp b/src/video/ngage/SDL_ngageevents.cpp index a136333764a7c..983536426397a 100644 --- a/src/video/ngage/SDL_ngageevents.cpp +++ b/src/video/ngage/SDL_ngageevents.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NGAGE +#ifdef SDL_VIDEO_DRIVER_NGAGE /* Being a ngage driver, there's no event stream. We just define stubs for most of the API. */ @@ -40,15 +40,13 @@ extern "C" { #include "SDL_ngagevideo.h" #include "SDL_ngageevents_c.h" -int HandleWsEvent(_THIS, const TWsEvent& aWsEvent); +int HandleWsEvent(_THIS, const TWsEvent &aWsEvent); -void -NGAGE_PumpEvents(_THIS) +void NGAGE_PumpEvents(_THIS) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; - while (phdata->NGAGE_WsEventStatus != KRequestPending) - { + while (phdata->NGAGE_WsEventStatus != KRequestPending) { phdata->NGAGE_WsSession.GetEvent(phdata->NGAGE_WsEvent); HandleWsEvent(_this, phdata->NGAGE_WsEvent); @@ -74,123 +72,121 @@ static SDL_Scancode ConvertScancode(_THIS, int key) { SDL_Keycode keycode; - switch(key) - { - case EStdKeyBackspace: // Clear key - keycode = SDLK_BACKSPACE; - break; - case 0x31: // 1 - keycode = SDLK_1; - break; - case 0x32: // 2 - keycode = SDLK_2; - break; - case 0x33: // 3 - keycode = SDLK_3; - break; - case 0x34: // 4 - keycode = SDLK_4; - break; - case 0x35: // 5 - keycode = SDLK_5; - break; - case 0x36: // 6 - keycode = SDLK_6; - break; - case 0x37: // 7 - keycode = SDLK_7; - break; - case 0x38: // 8 - keycode = SDLK_8; - break; - case 0x39: // 9 - keycode = SDLK_9; - break; - case 0x30: // 0 - keycode = SDLK_0; - break; - case 0x2a: // Asterisk - keycode = SDLK_ASTERISK; - break; - case EStdKeyHash: // Hash - keycode = SDLK_HASH; - break; - case EStdKeyDevice0: // Left softkey - keycode = SDLK_SOFTLEFT; - break; - case EStdKeyDevice1: // Right softkey - keycode = SDLK_SOFTRIGHT; - break; - case EStdKeyApplication0: // Call softkey - keycode = SDLK_CALL; - break; - case EStdKeyApplication1: // End call softkey - keycode = SDLK_ENDCALL; - break; - case EStdKeyDevice3: // Middle softkey - keycode = SDLK_SELECT; - break; - case EStdKeyUpArrow: // Up arrow - keycode = SDLK_UP; - break; - case EStdKeyDownArrow: // Down arrow - keycode = SDLK_DOWN; - break; - case EStdKeyLeftArrow: // Left arrow - keycode = SDLK_LEFT; - break; - case EStdKeyRightArrow: // Right arrow - keycode = SDLK_RIGHT; - break; - default: - keycode = SDLK_UNKNOWN; - break; + switch (key) { + case EStdKeyBackspace: // Clear key + keycode = SDLK_BACKSPACE; + break; + case 0x31: // 1 + keycode = SDLK_1; + break; + case 0x32: // 2 + keycode = SDLK_2; + break; + case 0x33: // 3 + keycode = SDLK_3; + break; + case 0x34: // 4 + keycode = SDLK_4; + break; + case 0x35: // 5 + keycode = SDLK_5; + break; + case 0x36: // 6 + keycode = SDLK_6; + break; + case 0x37: // 7 + keycode = SDLK_7; + break; + case 0x38: // 8 + keycode = SDLK_8; + break; + case 0x39: // 9 + keycode = SDLK_9; + break; + case 0x30: // 0 + keycode = SDLK_0; + break; + case 0x2a: // Asterisk + keycode = SDLK_ASTERISK; + break; + case EStdKeyHash: // Hash + keycode = SDLK_HASH; + break; + case EStdKeyDevice0: // Left softkey + keycode = SDLK_SOFTLEFT; + break; + case EStdKeyDevice1: // Right softkey + keycode = SDLK_SOFTRIGHT; + break; + case EStdKeyApplication0: // Call softkey + keycode = SDLK_CALL; + break; + case EStdKeyApplication1: // End call softkey + keycode = SDLK_ENDCALL; + break; + case EStdKeyDevice3: // Middle softkey + keycode = SDLK_SELECT; + break; + case EStdKeyUpArrow: // Up arrow + keycode = SDLK_UP; + break; + case EStdKeyDownArrow: // Down arrow + keycode = SDLK_DOWN; + break; + case EStdKeyLeftArrow: // Left arrow + keycode = SDLK_LEFT; + break; + case EStdKeyRightArrow: // Right arrow + keycode = SDLK_RIGHT; + break; + default: + keycode = SDLK_UNKNOWN; + break; } return SDL_GetScancodeFromKey(keycode); } -int HandleWsEvent(_THIS, const TWsEvent& aWsEvent) +int HandleWsEvent(_THIS, const TWsEvent &aWsEvent) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - int posted = 0; - - switch (aWsEvent.Type()) + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + int posted = 0; + + switch (aWsEvent.Type()) { + case EEventKeyDown: /* Key events */ + SDL_SendKeyboardKey(SDL_PRESSED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); + break; + case EEventKeyUp: /* Key events */ + SDL_SendKeyboardKey(SDL_RELEASED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); + break; + case EEventFocusGained: /* SDL window got focus */ + phdata->NGAGE_IsWindowFocused = ETrue; + /* Draw window background and screen buffer */ + DisableKeyBlocking(_this); + RedrawWindowL(_this); + break; + case EEventFocusLost: /* SDL window lost focus */ { - case EEventKeyDown: /* Key events */ - SDL_SendKeyboardKey(SDL_PRESSED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); - break; - case EEventKeyUp: /* Key events */ - SDL_SendKeyboardKey(SDL_RELEASED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); - break; - case EEventFocusGained: /* SDL window got focus */ - phdata->NGAGE_IsWindowFocused = ETrue; - /* Draw window background and screen buffer */ - DisableKeyBlocking(_this); - RedrawWindowL(_this); - break; - case EEventFocusLost: /* SDL window lost focus */ - { - phdata->NGAGE_IsWindowFocused = EFalse; - RWsSession s; - s.Connect(); - RWindowGroup g(s); - g.Construct(TUint32(&g), EFalse); - g.EnableReceiptOfFocus(EFalse); - RWindow w(s); - w.Construct(g, TUint32(&w)); - w.SetExtent(TPoint(0, 0), phdata->NGAGE_WsWindow.Size()); - w.SetOrdinalPosition(0); - w.Activate(); - w.Close(); - g.Close(); - s.Close(); - break; - } - case EEventModifiersChanged: - break; - default: - break; + phdata->NGAGE_IsWindowFocused = EFalse; + RWsSession s; + s.Connect(); + RWindowGroup g(s); + g.Construct(TUint32(&g), EFalse); + g.EnableReceiptOfFocus(EFalse); + RWindow w(s); + w.Construct(g, TUint32(&w)); + w.SetExtent(TPoint(0, 0), phdata->NGAGE_WsWindow.Size()); + w.SetOrdinalPosition(0); + w.Activate(); + w.Close(); + g.Close(); + s.Close(); + break; + } + case EEventModifiersChanged: + break; + default: + break; } return posted; } diff --git a/src/video/ngage/SDL_ngageevents_c.h b/src/video/ngage/SDL_ngageevents_c.h index c7b58ce403b98..45a3588d94979 100644 --- a/src/video/ngage/SDL_ngageevents_c.h +++ b/src/video/ngage/SDL_ngageevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp index 98ff9ff71ad19..09753872bae22 100644 --- a/src/video/ngage/SDL_ngageframebuffer.cpp +++ b/src/video/ngage/SDL_ngageframebuffer.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NGAGE +#ifdef SDL_VIDEO_DRIVER_NGAGE #include @@ -38,26 +38,26 @@ */ static TUint32 NGAGE_HWPalette_256_to_Screen[256]; -int GetBpp(TDisplayMode displaymode); +int GetBpp(TDisplayMode displaymode); void DirectUpdate(_THIS, int numrects, SDL_Rect *rects); void DrawBackground(_THIS); -void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer); +void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer); void RedrawWindowL(_THIS); -int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - SDL_Surface *surface; - const Uint32 surface_format = SDL_PIXELFORMAT_RGB444; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + SDL_Surface *surface; + const Uint32 surface_format = SDL_PIXELFORMAT_RGB444; int w, h; /* Free the old framebuffer surface */ SDL_NGAGE_DestroyWindowFramebuffer(_this, window); /* Create a new one */ - SDL_GetWindowSize(window, &w, &h); + SDL_GetWindowSizeInPixels(window, &w, &h); surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 0, surface_format); - if (! surface) { + if (!surface) { return -1; } @@ -65,24 +65,24 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma SDL_SetWindowData(window, NGAGE_SURFACE, surface); *format = surface_format; *pixels = surface->pixels; - *pitch = surface->pitch; + *pitch = surface->pitch; /* Initialise Epoc frame buffer */ - TDisplayMode displayMode = phdata->NGAGE_WsScreen->DisplayMode(); + TDisplayMode displayMode = phdata->NGAGE_WsScreen->DisplayMode(); - TScreenInfoV01 screenInfo; + TScreenInfoV01 screenInfo; TPckg sInfo(screenInfo); UserSvr::ScreenInfo(sInfo); - phdata->NGAGE_ScreenSize = screenInfo.iScreenSize; - phdata->NGAGE_DisplayMode = displayMode; - phdata->NGAGE_HasFrameBuffer = screenInfo.iScreenAddressValid; - phdata->NGAGE_FrameBuffer = phdata->NGAGE_HasFrameBuffer ? (TUint8*) screenInfo.iScreenAddress : NULL; - phdata->NGAGE_BytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1; + phdata->NGAGE_ScreenSize = screenInfo.iScreenSize; + phdata->NGAGE_DisplayMode = displayMode; + phdata->NGAGE_HasFrameBuffer = screenInfo.iScreenAddressValid; + phdata->NGAGE_FrameBuffer = phdata->NGAGE_HasFrameBuffer ? (TUint8 *)screenInfo.iScreenAddress : NULL; + phdata->NGAGE_BytesPerPixel = ((GetBpp(displayMode) - 1) / 8) + 1; phdata->NGAGE_BytesPerScanLine = screenInfo.iScreenSize.iWidth * phdata->NGAGE_BytesPerPixel; - phdata->NGAGE_BytesPerScreen = phdata->NGAGE_BytesPerScanLine * phdata->NGAGE_ScreenSize.iHeight; + phdata->NGAGE_BytesPerScreen = phdata->NGAGE_BytesPerScanLine * phdata->NGAGE_ScreenSize.iHeight; SDL_Log("Screen width %d", screenInfo.iScreenSize.iWidth); SDL_Log("Screen height %d", screenInfo.iScreenSize.iHeight); @@ -98,24 +98,19 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma * * In 12 bpp machines the table has 16 entries. */ - if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 8) - { + if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 8) { phdata->NGAGE_FrameBuffer += 512; - } - else - { + } else { phdata->NGAGE_FrameBuffer += 32; } - #if 0 - if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 12) - { +#if 0 + if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 12) { phdata->NGAGE_FrameBuffer += 16 * 2; } - if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 16) - { + if (phdata->NGAGE_HasFrameBuffer && GetBpp(displayMode) == 16) { phdata->NGAGE_FrameBuffer += 16 * 2; } - #endif +#endif // Get draw device for updating the screen TScreenInfoV01 screenInfo2; @@ -148,36 +143,34 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * forma return 0; } -int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { - static int frame_number; + static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *) SDL_GetWindowData(window, NGAGE_SURFACE); - if (! surface) - { + surface = (SDL_Surface *)SDL_GetWindowData(window, NGAGE_SURFACE); + if (!surface) { return SDL_SetError("Couldn't find ngage surface for window"); } /* Send the data to the display */ - if (SDL_getenv("SDL_VIDEO_NGAGE_SAVE_FRAMES")) - { + if (SDL_getenv("SDL_VIDEO_NGAGE_SAVE_FRAMES")) { char file[128]; SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp", (int)SDL_GetWindowID(window), ++frame_number); SDL_SaveBMP(surface, file); } - DirectUpdate(_this, numrects, (SDL_Rect*)rects); + DirectUpdate(_this, numrects, (SDL_Rect *)rects); return 0; } -void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { SDL_Surface *surface; - surface = (SDL_Surface *) SDL_SetWindowData(window, NGAGE_SURFACE, NULL); + surface = (SDL_Surface *)SDL_SetWindowData(window, NGAGE_SURFACE, NULL); SDL_FreeSurface(surface); } @@ -189,7 +182,7 @@ void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window * window) #include #include -EXPORT_C void NGAGE_Runtime::GetScreenInfo(TScreenInfoV01& screenInfo2) +EXPORT_C void NGAGE_Runtime::GetScreenInfo(TScreenInfoV01 &screenInfo2) { TPckg sInfo2(screenInfo2); UserSvr::ScreenInfo(sInfo2); @@ -206,42 +199,40 @@ int GetBpp(TDisplayMode displaymode) void DrawBackground(_THIS) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; /* Draw background */ - TUint16* screenBuffer = (TUint16*)phdata->NGAGE_FrameBuffer; + TUint16 *screenBuffer = (TUint16 *)phdata->NGAGE_FrameBuffer; /* Draw black background */ Mem::FillZ(screenBuffer, phdata->NGAGE_BytesPerScreen); } -void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer) +void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - SDL_Surface *screen = (SDL_Surface*)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); TInt i; - TDisplayMode displayMode = phdata->NGAGE_DisplayMode; - const TInt sourceNumBytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1; + TDisplayMode displayMode = phdata->NGAGE_DisplayMode; + const TInt sourceNumBytesPerPixel = ((GetBpp(displayMode) - 1) / 8) + 1; - const TPoint fixedOffset = phdata->NGAGE_ScreenOffset; - const TInt screenW = screen->w; - const TInt screenH = screen->h; - const TInt sourceScanlineLength = screenW; - const TInt targetScanlineLength = phdata->NGAGE_ScreenSize.iWidth; + const TPoint fixedOffset = phdata->NGAGE_ScreenOffset; + const TInt screenW = screen->w; + const TInt screenH = screen->h; + const TInt sourceScanlineLength = screenW; + const TInt targetScanlineLength = phdata->NGAGE_ScreenSize.iWidth; /* Render the rectangles in the list */ - for (i = 0; i < numrects; ++i) - { - const SDL_Rect& currentRect = rects[i]; - SDL_Rect rect2; + for (i = 0; i < numrects; ++i) { + const SDL_Rect ¤tRect = rects[i]; + SDL_Rect rect2; rect2.x = currentRect.x; rect2.y = currentRect.y; rect2.w = currentRect.w; rect2.h = currentRect.h; - if (rect2.w <= 0 || rect2.h <= 0) /* Sanity check */ - { + if (rect2.w <= 0 || rect2.h <= 0) /* Sanity check */ { continue; } @@ -250,118 +241,101 @@ void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer) /* Check rects validity, i.e. upper and lower bounds */ TInt maxX = Min(screenW - 1, rect2.x + rect2.w - 1); TInt maxY = Min(screenH - 1, rect2.y + rect2.h - 1); - if (maxX < 0 || maxY < 0) /* sanity check */ - { + if (maxX < 0 || maxY < 0) /* sanity check */ { continue; } /* Clip from bottom */ - maxY = Min(maxY, phdata->NGAGE_ScreenSize.iHeight-1); + maxY = Min(maxY, phdata->NGAGE_ScreenSize.iHeight - 1); /* TODO: Clip from the right side */ - const TInt sourceRectWidth = maxX - rect2.x + 1; - const TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel; - const TInt sourceRectHeight = maxY - rect2.y + 1; - const TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength; - const TUint skipValue = 1; /* 1 = No skip */ + const TInt sourceRectWidth = maxX - rect2.x + 1; + const TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel; + const TInt sourceRectHeight = maxY - rect2.y + 1; + const TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength; + const TUint skipValue = 1; /* 1 = No skip */ - TInt targetStartOffset = fixedOffset.iX + rect2.x + (fixedOffset.iY +rect2.y) * targetScanlineLength; + TInt targetStartOffset = fixedOffset.iX + rect2.x + (fixedOffset.iY + rect2.y) * targetScanlineLength; - switch (screen->format->BitsPerPixel) + switch (screen->format->BitsPerPixel) { + case 12: { - case 12: - { - TUint16* bitmapLine = (TUint16*)screen->pixels + sourceStartOffset; - TUint16* screenMemory = screenBuffer + targetStartOffset; - - if (skipValue == 1) - { - for(TInt y = 0 ; y < sourceRectHeight ; y++) - { - Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes); - bitmapLine += sourceScanlineLength; - screenMemory += targetScanlineLength; - } + TUint16 *bitmapLine = (TUint16 *)screen->pixels + sourceStartOffset; + TUint16 *screenMemory = screenBuffer + targetStartOffset; + + if (skipValue == 1) { + for (TInt y = 0; y < sourceRectHeight; y++) { + Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes); + bitmapLine += sourceScanlineLength; + screenMemory += targetScanlineLength; } - else - { - for(TInt y = 0 ; y < sourceRectHeight ; y++) - { - TUint16* bitmapPos = bitmapLine; /* 2 bytes per pixel */ - TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ - for(TInt x = 0 ; x < sourceRectWidth ; x++) - { - __ASSERT_DEBUG(screenMemory < (screenBuffer + phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(screenMemory >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapLine < ((TUint16*)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapLine >= (TUint16*)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); - - *screenMemoryLinePos++ = *bitmapPos; - bitmapPos += skipValue; - } - bitmapLine += sourceScanlineLength; - screenMemory += targetScanlineLength; + } else { + for (TInt y = 0; y < sourceRectHeight; y++) { + TUint16 *bitmapPos = bitmapLine; /* 2 bytes per pixel */ + TUint16 *screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ + for (TInt x = 0; x < sourceRectWidth; x++) { + __ASSERT_DEBUG(screenMemory < (screenBuffer + phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(screenMemory >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapLine < ((TUint16 *)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapLine >= (TUint16 *)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); + + *screenMemoryLinePos++ = *bitmapPos; + bitmapPos += skipValue; } + bitmapLine += sourceScanlineLength; + screenMemory += targetScanlineLength; } } - break; - // 256 color paletted mode: 8 bpp --> 12 bpp - default: - { - if(phdata->NGAGE_BytesPerPixel <= 2) - { - TUint8* bitmapLine = (TUint8*)screen->pixels + sourceStartOffset; - TUint16* screenMemory = screenBuffer + targetStartOffset; - - for(TInt y = 0 ; y < sourceRectHeight ; y++) - { - TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */ - TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ - /* Convert each pixel from 256 palette to 4k color values */ - for(TInt x = 0 ; x < sourceRectWidth ; x++) - { - __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer + (phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapPos < ((TUint8*)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapPos >= (TUint8*)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); - *screenMemoryLinePos++ = NGAGE_HWPalette_256_to_Screen[*bitmapPos++]; - } - bitmapLine += sourceScanlineLength; - screenMemory += targetScanlineLength; + } break; + // 256 color paletted mode: 8 bpp --> 12 bpp + default: + { + if (phdata->NGAGE_BytesPerPixel <= 2) { + TUint8 *bitmapLine = (TUint8 *)screen->pixels + sourceStartOffset; + TUint16 *screenMemory = screenBuffer + targetStartOffset; + + for (TInt y = 0; y < sourceRectHeight; y++) { + TUint8 *bitmapPos = bitmapLine; /* 1 byte per pixel */ + TUint16 *screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ + /* Convert each pixel from 256 palette to 4k color values */ + for (TInt x = 0; x < sourceRectWidth; x++) { + __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer + (phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapPos < ((TUint8 *)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapPos >= (TUint8 *)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); + *screenMemoryLinePos++ = NGAGE_HWPalette_256_to_Screen[*bitmapPos++]; } + bitmapLine += sourceScanlineLength; + screenMemory += targetScanlineLength; } - else - { - TUint8* bitmapLine = (TUint8*)screen->pixels + sourceStartOffset; - TUint32* screenMemory = reinterpret_cast(screenBuffer + targetStartOffset); - for(TInt y = 0 ; y < sourceRectHeight ; y++) - { - TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */ - TUint32* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ - /* Convert each pixel from 256 palette to 4k color values */ - for(TInt x = 0 ; x < sourceRectWidth ; x++) - { - __ASSERT_DEBUG(screenMemoryLinePos < (reinterpret_cast(screenBuffer) + (phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(screenMemoryLinePos >= reinterpret_cast(screenBuffer), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapPos < ((TUint8*)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); - __ASSERT_DEBUG(bitmapPos >= (TUint8*)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); - *screenMemoryLinePos++ = NGAGE_HWPalette_256_to_Screen[*bitmapPos++]; - } - bitmapLine += sourceScanlineLength; - screenMemory += targetScanlineLength; + } else { + TUint8 *bitmapLine = (TUint8 *)screen->pixels + sourceStartOffset; + TUint32 *screenMemory = reinterpret_cast(screenBuffer + targetStartOffset); + for (TInt y = 0; y < sourceRectHeight; y++) { + TUint8 *bitmapPos = bitmapLine; /* 1 byte per pixel */ + TUint32 *screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */ + /* Convert each pixel from 256 palette to 4k color values */ + for (TInt x = 0; x < sourceRectWidth; x++) { + __ASSERT_DEBUG(screenMemoryLinePos < (reinterpret_cast(screenBuffer) + (phdata->NGAGE_ScreenSize.iWidth * phdata->NGAGE_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(screenMemoryLinePos >= reinterpret_cast(screenBuffer), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapPos < ((TUint8 *)screen->pixels + (screen->w * screen->h)), User::Panic(_L("SDL"), KErrCorrupt)); + __ASSERT_DEBUG(bitmapPos >= (TUint8 *)screen->pixels, User::Panic(_L("SDL"), KErrCorrupt)); + *screenMemoryLinePos++ = NGAGE_HWPalette_256_to_Screen[*bitmapPos++]; } + bitmapLine += sourceScanlineLength; + screenMemory += targetScanlineLength; } } } + } } } void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; - if (! phdata->NGAGE_IsWindowFocused) - { + if (!phdata->NGAGE_IsWindowFocused) { SDL_PauseAudio(1); SDL_Delay(1000); return; @@ -369,25 +343,22 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) SDL_PauseAudio(0); - TUint16* screenBuffer = (TUint16*)phdata->NGAGE_FrameBuffer; + TUint16 *screenBuffer = (TUint16 *)phdata->NGAGE_FrameBuffer; #if 0 - if (phdata->NGAGE_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270) - { + if (phdata->NGAGE_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270) { // ... - } - else + } else #endif { DirectDraw(_this, numrects, rects, screenBuffer); } - for (int i = 0; i < numrects; ++i) - { - TInt aAx = rects[i].x; - TInt aAy = rects[i].y; - TInt aBx = rects[i].w; - TInt aBy = rects[i].h; + for (int i = 0; i < numrects; ++i) { + TInt aAx = rects[i].x; + TInt aAy = rects[i].y; + TInt aBx = rects[i].w; + TInt aBy = rects[i].h; TRect rect2 = TRect(aAx, aAy, aBx, aBy); phdata->NGAGE_DrawDevice->UpdateRegion(rect2); /* Should we update rects parameter area only? */ @@ -397,8 +368,8 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) void RedrawWindowL(_THIS) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - SDL_Surface *screen = (SDL_Surface*)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); int w = screen->w; int h = screen->h; @@ -406,13 +377,12 @@ void RedrawWindowL(_THIS) w = screen->h; h = screen->w; } - if ((w < phdata->NGAGE_ScreenSize.iWidth) - || (h < phdata->NGAGE_ScreenSize.iHeight)) { + if ((w < phdata->NGAGE_ScreenSize.iWidth) || (h < phdata->NGAGE_ScreenSize.iHeight)) { DrawBackground(_this); } /* Tell the system that something has been drawn */ - TRect rect = TRect(phdata->NGAGE_WsWindow.Size()); + TRect rect = TRect(phdata->NGAGE_WsWindow.Size()); phdata->NGAGE_WsWindow.Invalidate(rect); /* Draw current buffer */ diff --git a/src/video/ngage/SDL_ngageframebuffer_c.h b/src/video/ngage/SDL_ngageframebuffer_c.h index c2f0768cacb2e..57e8f3ab1a371 100644 --- a/src/video/ngage/SDL_ngageframebuffer_c.h +++ b/src/video/ngage/SDL_ngageframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,9 +21,9 @@ #include "../../SDL_internal.h" -extern int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window); /****************************************************************************/ /* Runtime */ @@ -31,8 +31,8 @@ extern void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window * window); class NGAGE_Runtime { -public: - IMPORT_C static void GetScreenInfo(TScreenInfoV01& screenInfo2); + public: + IMPORT_C static void GetScreenInfo(TScreenInfoV01 &screenInfo2); }; /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/ngage/SDL_ngagevideo.cpp b/src/video/ngage/SDL_ngagevideo.cpp index d0ed05f2093dc..752f3dffd9971 100644 --- a/src/video/ngage/SDL_ngagevideo.cpp +++ b/src/video/ngage/SDL_ngagevideo.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #endif #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NGAGE +#ifdef SDL_VIDEO_DRIVER_NGAGE #ifdef __cplusplus extern "C" { @@ -48,40 +48,34 @@ extern "C" { #define NGAGEVID_DRIVER_NAME "ngage" /* Initialization/Query functions */ -static int NGAGE_VideoInit(_THIS); -static int NGAGE_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +static int NGAGE_VideoInit(_THIS); +static int NGAGE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static void NGAGE_VideoQuit(_THIS); /* NGAGE driver bootstrap functions */ -static void -NGAGE_DeleteDevice(SDL_VideoDevice * device) +static void NGAGE_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *phdata = (SDL_VideoData*)device->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)device->driverdata; - if (phdata) - { + if (phdata) { /* Free Epoc resources */ /* Disable events for me */ - if (phdata->NGAGE_WsEventStatus != KRequestPending) - { + if (phdata->NGAGE_WsEventStatus != KRequestPending) { phdata->NGAGE_WsSession.EventReadyCancel(); } - if (phdata->NGAGE_RedrawEventStatus != KRequestPending) - { + if (phdata->NGAGE_RedrawEventStatus != KRequestPending) { phdata->NGAGE_WsSession.RedrawReadyCancel(); } free(phdata->NGAGE_DrawDevice); - if (phdata->NGAGE_WsWindow.WsHandle()) - { + if (phdata->NGAGE_WsWindow.WsHandle()) { phdata->NGAGE_WsWindow.Close(); } - if (phdata->NGAGE_WsWindowGroup.WsHandle()) - { + if (phdata->NGAGE_WsWindowGroup.WsHandle()) { phdata->NGAGE_WsWindowGroup.Close(); } @@ -91,8 +85,7 @@ NGAGE_DeleteDevice(SDL_VideoDevice * device) delete phdata->NGAGE_WsScreen; phdata->NGAGE_WsScreen = NULL; - if (phdata->NGAGE_WsSession.WsHandle()) - { + if (phdata->NGAGE_WsSession.WsHandle()) { phdata->NGAGE_WsSession.Close(); } @@ -100,48 +93,45 @@ NGAGE_DeleteDevice(SDL_VideoDevice * device) phdata = NULL; } - if (device) - { + if (device) { SDL_free(device); device = NULL; } } -static SDL_VideoDevice * -NGAGE_CreateDevice(void) +static SDL_VideoDevice *NGAGE_CreateDevice(void) { SDL_VideoDevice *device; - SDL_VideoData *phdata; + SDL_VideoData *phdata; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } /* Initialize internal N-Gage specific data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (! phdata) - { + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); - return (0); + return 0; } /* General video */ - device->VideoInit = NGAGE_VideoInit; - device->VideoQuit = NGAGE_VideoQuit; - device->SetDisplayMode = NGAGE_SetDisplayMode; - device->PumpEvents = NGAGE_PumpEvents; - device->CreateWindowFramebuffer = SDL_NGAGE_CreateWindowFramebuffer; - device->UpdateWindowFramebuffer = SDL_NGAGE_UpdateWindowFramebuffer; + device->VideoInit = NGAGE_VideoInit; + device->VideoQuit = NGAGE_VideoQuit; + device->SetDisplayMode = NGAGE_SetDisplayMode; + device->PumpEvents = NGAGE_PumpEvents; + device->CreateWindowFramebuffer = SDL_NGAGE_CreateWindowFramebuffer; + device->UpdateWindowFramebuffer = SDL_NGAGE_UpdateWindowFramebuffer; device->DestroyWindowFramebuffer = SDL_NGAGE_DestroyWindowFramebuffer; - device->free = NGAGE_DeleteDevice; + device->free = NGAGE_DeleteDevice; /* "Window" */ device->CreateSDLWindow = NGAGE_CreateWindow; - device->DestroyWindow = NGAGE_DestroyWindow; + device->DestroyWindow = NGAGE_DestroyWindow; /* N-Gage specific data */ device->driverdata = phdata; @@ -151,20 +141,20 @@ NGAGE_CreateDevice(void) VideoBootStrap NGAGE_bootstrap = { NGAGEVID_DRIVER_NAME, "SDL ngage video driver", - NGAGE_CreateDevice + NGAGE_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; -int -NGAGE_VideoInit(_THIS) +int NGAGE_VideoInit(_THIS) { SDL_DisplayMode mode; /* Use 12-bpp desktop mode */ - mode.format = SDL_PIXELFORMAT_RGB444; - mode.w = 176; - mode.h = 208; + mode.format = SDL_PIXELFORMAT_RGB444; + mode.w = 176; + mode.h = 208; mode.refresh_rate = 0; - mode.driverdata = NULL; + mode.driverdata = NULL; if (SDL_AddBasicVideoDisplay(&mode) < 0) { return -1; } @@ -176,14 +166,12 @@ NGAGE_VideoInit(_THIS) return 0; } -static int -NGAGE_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int NGAGE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void -NGAGE_VideoQuit(_THIS) +void NGAGE_VideoQuit(_THIS) { } diff --git a/src/video/ngage/SDL_ngagevideo.h b/src/video/ngage/SDL_ngagevideo.h index af8e8d857a3e8..a56b2500f888e 100644 --- a/src/video/ngage/SDL_ngagevideo.h +++ b/src/video/ngage/SDL_ngagevideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,43 +30,34 @@ #include #include #include - -class CFbsDrawDevice : public CBase -{ -public: -public: - IMPORT_C static CFbsDrawDevice* NewScreenDeviceL(TScreenInfoV01 aInfo,TDisplayMode aDispMode); -public: - virtual void Update() {} - virtual void UpdateRegion(const TRect&) {} -}; +#include "bitdraw.h" // CFbsDrawDevice #define _THIS SDL_VideoDevice *_this typedef struct SDL_VideoData { /* Epoc window server info */ - RWsSession NGAGE_WsSession; - RWindowGroup NGAGE_WsWindowGroup; - TInt NGAGE_WsWindowGroupID; - RWindow NGAGE_WsWindow; - CWsScreenDevice* NGAGE_WsScreen; - CWindowGc* NGAGE_WindowGc; - TRequestStatus NGAGE_WsEventStatus; - TRequestStatus NGAGE_RedrawEventStatus; - TWsEvent NGAGE_WsEvent; - CFbsDrawDevice* NGAGE_DrawDevice; - TBool NGAGE_IsWindowFocused; /* Not used yet */ + RWsSession NGAGE_WsSession; + RWindowGroup NGAGE_WsWindowGroup; + TInt NGAGE_WsWindowGroupID; + RWindow NGAGE_WsWindow; + CWsScreenDevice *NGAGE_WsScreen; + CWindowGc *NGAGE_WindowGc; + TRequestStatus NGAGE_WsEventStatus; + TRequestStatus NGAGE_RedrawEventStatus; + TWsEvent NGAGE_WsEvent; + CFbsDrawDevice *NGAGE_DrawDevice; + TBool NGAGE_IsWindowFocused; /* Not used yet */ /* Screen hardware frame buffer info */ - TBool NGAGE_HasFrameBuffer; - TInt NGAGE_BytesPerPixel; - TInt NGAGE_BytesPerScanLine; - TInt NGAGE_BytesPerScreen; - TDisplayMode NGAGE_DisplayMode; - TSize NGAGE_ScreenSize; - TUint8* NGAGE_FrameBuffer; - TPoint NGAGE_ScreenOffset; + TBool NGAGE_HasFrameBuffer; + TInt NGAGE_BytesPerPixel; + TInt NGAGE_BytesPerScanLine; + TInt NGAGE_BytesPerScreen; + TDisplayMode NGAGE_DisplayMode; + TSize NGAGE_ScreenSize; + TUint8 *NGAGE_FrameBuffer; + TPoint NGAGE_ScreenOffset; CFbsBitGc::TGraphicsOrientation NGAGE_ScreenOrientation; diff --git a/src/video/ngage/SDL_ngagewindow.cpp b/src/video/ngage/SDL_ngagewindow.cpp index 5b0682b29fef4..3aa5d22540e73 100644 --- a/src/video/ngage/SDL_ngagewindow.cpp +++ b/src/video/ngage/SDL_ngagewindow.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_NGAGE +#ifdef SDL_VIDEO_DRIVER_NGAGE #include "../SDL_sysvideo.h" @@ -32,10 +32,9 @@ const TUint32 WindowClientHandle = 9210; void DisableKeyBlocking(_THIS); void ConstructWindowL(_THIS); -int -NGAGE_CreateWindow(_THIS, SDL_Window* window) +int NGAGE_CreateWindow(_THIS, SDL_Window *window) { - NGAGE_Window* ngage_window = (NGAGE_Window*)SDL_calloc(1, sizeof(NGAGE_Window)); + NGAGE_Window *ngage_window = (NGAGE_Window *)SDL_calloc(1, sizeof(NGAGE_Window)); if (!ngage_window) { return SDL_OutOfMemory(); @@ -58,10 +57,9 @@ NGAGE_CreateWindow(_THIS, SDL_Window* window) return 0; } -void -NGAGE_DestroyWindow(_THIS, SDL_Window* window) +void NGAGE_DestroyWindow(_THIS, SDL_Window *window) { - NGAGE_Window* ngage_window = (NGAGE_Window*)window->driverdata; + NGAGE_Window *ngage_window = (NGAGE_Window *)window->driverdata; if (ngage_window) { SDL_free(ngage_window); @@ -76,8 +74,8 @@ NGAGE_DestroyWindow(_THIS, SDL_Window* window) void DisableKeyBlocking(_THIS) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - TRawEvent event; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + TRawEvent event; event.Set((TRawEvent::TType) /*EDisableKeyBlock*/ 51); phdata->NGAGE_WsSession.SimulateRawEvent(event); @@ -85,34 +83,34 @@ void DisableKeyBlocking(_THIS) void ConstructWindowL(_THIS) { - SDL_VideoData *phdata = (SDL_VideoData*)_this->driverdata; - TInt error; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; + TInt error; error = phdata->NGAGE_WsSession.Connect(); User::LeaveIfError(error); - phdata->NGAGE_WsScreen=new(ELeave) CWsScreenDevice(phdata->NGAGE_WsSession); + phdata->NGAGE_WsScreen = new (ELeave) CWsScreenDevice(phdata->NGAGE_WsSession); User::LeaveIfError(phdata->NGAGE_WsScreen->Construct()); User::LeaveIfError(phdata->NGAGE_WsScreen->CreateContext(phdata->NGAGE_WindowGc)); - phdata->NGAGE_WsWindowGroup=RWindowGroup(phdata->NGAGE_WsSession); + phdata->NGAGE_WsWindowGroup = RWindowGroup(phdata->NGAGE_WsSession); User::LeaveIfError(phdata->NGAGE_WsWindowGroup.Construct(WindowClientHandle)); phdata->NGAGE_WsWindowGroup.SetOrdinalPosition(0); RProcess thisProcess; - TParse exeName; + TParse exeName; exeName.Set(thisProcess.FileName(), NULL, NULL); TBuf<32> winGroupName; winGroupName.Append(0); winGroupName.Append(0); - winGroupName.Append(0); // UID + winGroupName.Append(0); // UID winGroupName.Append(0); winGroupName.Append(exeName.Name()); // Caption winGroupName.Append(0); - winGroupName.Append(0); // DOC name + winGroupName.Append(0); // DOC name phdata->NGAGE_WsWindowGroup.SetName(winGroupName); - phdata->NGAGE_WsWindow=RWindow(phdata->NGAGE_WsSession); - User::LeaveIfError(phdata->NGAGE_WsWindow.Construct(phdata->NGAGE_WsWindowGroup,WindowClientHandle - 1)); + phdata->NGAGE_WsWindow = RWindow(phdata->NGAGE_WsSession); + User::LeaveIfError(phdata->NGAGE_WsWindow.Construct(phdata->NGAGE_WsWindowGroup, WindowClientHandle - 1)); phdata->NGAGE_WsWindow.SetBackgroundColor(KRgbWhite); phdata->NGAGE_WsWindow.Activate(); phdata->NGAGE_WsWindow.SetSize(phdata->NGAGE_WsScreen->SizeInPixels()); diff --git a/src/video/ngage/SDL_ngagewindow.h b/src/video/ngage/SDL_ngagewindow.h index 148c79986fef1..76b4e4d704e48 100644 --- a/src/video/ngage/SDL_ngagewindow.h +++ b/src/video/ngage/SDL_ngagewindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,19 +27,18 @@ #include "SDL_ngagevideo.h" -typedef struct { - SDL_Window* sdl_window; +typedef struct +{ + SDL_Window *sdl_window; } NGAGE_Window; - extern int -NGAGE_CreateWindow(_THIS, SDL_Window* window); +NGAGE_CreateWindow(_THIS, SDL_Window *window); extern void -NGAGE_DestroyWindow(_THIS, SDL_Window* window); +NGAGE_DestroyWindow(_THIS, SDL_Window *window); #endif /* _SDL_ngagewindow */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/offscreen/SDL_offscreenevents.c b/src/video/offscreen/SDL_offscreenevents.c index 092f19b2b27ee..ef9cd0fcfc134 100644 --- a/src/video/offscreen/SDL_offscreenevents.c +++ b/src/video/offscreen/SDL_offscreenevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OFFSCREEN +#ifdef SDL_VIDEO_DRIVER_OFFSCREEN /* Being a offscreen driver, there's no event stream. We just define stubs for most of the API. */ @@ -30,8 +30,7 @@ #include "SDL_offscreenvideo.h" #include "SDL_offscreenevents_c.h" -void -OFFSCREEN_PumpEvents(_THIS) +void OFFSCREEN_PumpEvents(_THIS) { /* do nothing. */ } diff --git a/src/video/offscreen/SDL_offscreenevents_c.h b/src/video/offscreen/SDL_offscreenevents_c.h index 6768d3dda987c..201b432d03394 100644 --- a/src/video/offscreen/SDL_offscreenevents_c.h +++ b/src/video/offscreen/SDL_offscreenevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/offscreen/SDL_offscreenframebuffer.c b/src/video/offscreen/SDL_offscreenframebuffer.c index 376058856be82..ef0c1e3875d26 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer.c +++ b/src/video/offscreen/SDL_offscreenframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OFFSCREEN +#ifdef SDL_VIDEO_DRIVER_OFFSCREEN #include "../SDL_sysvideo.h" #include "SDL_offscreenframebuffer_c.h" +#define OFFSCREEN_SURFACE "_SDL_DummySurface" -#define OFFSCREEN_SURFACE "_SDL_DummySurface" - -int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { SDL_Surface *surface; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; @@ -38,7 +37,7 @@ int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * f SDL_OFFSCREEN_DestroyWindowFramebuffer(_this, window); /* Create a new one */ - SDL_GetWindowSize(window, &w, &h); + SDL_GetWindowSizeInPixels(window, &w, &h); surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 0, surface_format); if (!surface) { return -1; @@ -49,15 +48,16 @@ int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * f *format = surface_format; *pixels = surface->pixels; *pitch = surface->pitch; + return 0; } -int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *) SDL_GetWindowData(window, OFFSCREEN_SURFACE); + surface = (SDL_Surface *)SDL_GetWindowData(window, OFFSCREEN_SURFACE); if (!surface) { return SDL_SetError("Couldn't find offscreen surface for window"); } @@ -65,18 +65,18 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_ /* Send the data to the display */ if (SDL_getenv("SDL_VIDEO_OFFSCREEN_SAVE_FRAMES")) { char file[128]; - SDL_snprintf(file, sizeof(file), "SDL_window%d-%8.8d.bmp", - (int)SDL_GetWindowID(window), ++frame_number); + (void)SDL_snprintf(file, sizeof(file), "SDL_window%" SDL_PRIu32 "-%8.8d.bmp", + SDL_GetWindowID(window), ++frame_number); SDL_SaveBMP(surface, file); } return 0; } -void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { SDL_Surface *surface; - surface = (SDL_Surface *) SDL_SetWindowData(window, OFFSCREEN_SURFACE, NULL); + surface = (SDL_Surface *)SDL_SetWindowData(window, OFFSCREEN_SURFACE, NULL); SDL_FreeSurface(surface); } diff --git a/src/video/offscreen/SDL_offscreenframebuffer_c.h b/src/video/offscreen/SDL_offscreenframebuffer_c.h index ae1ad7ba943eb..72840a27aeb94 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer_c.h +++ b/src/video/offscreen/SDL_offscreenframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,8 @@ */ #include "../../SDL_internal.h" -extern int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/offscreen/SDL_offscreenopengles.c b/src/video/offscreen/SDL_offscreenopengles.c index a379ad7b01309..95413d74e8a09 100644 --- a/src/video/offscreen/SDL_offscreenopengles.c +++ b/src/video/offscreen/SDL_offscreenopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_OFFSCREEN) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_offscreenopengles.h" #include "SDL_offscreenvideo.h" @@ -28,8 +28,7 @@ /* EGL implementation of SDL OpenGL support */ -int -OFFSCREEN_GLES_LoadLibrary(_THIS, const char* path) +int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path) { int ret = SDL_EGL_LoadLibraryOnly(_this, path); if (ret != 0) { @@ -55,10 +54,9 @@ OFFSCREEN_GLES_LoadLibrary(_THIS, const char* path) return 0; } -SDL_GLContext -OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window* window) +SDL_GLContext OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window) { - OFFSCREEN_Window* offscreen_window = window->driverdata; + OFFSCREEN_Window *offscreen_window = window->driverdata; SDL_GLContext context; context = SDL_EGL_CreateContext(_this, offscreen_window->egl_surface); @@ -66,21 +64,19 @@ OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window* window) return context; } -int -OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window* window, SDL_GLContext context) +int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { if (window) { - EGLSurface egl_surface = ((OFFSCREEN_Window*)window->driverdata)->egl_surface; + EGLSurface egl_surface = ((OFFSCREEN_Window *)window->driverdata)->egl_surface; return SDL_EGL_MakeCurrent(_this, egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); } } -int -OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window* window) +int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window) { - OFFSCREEN_Window* offscreen_wind = window->driverdata; + OFFSCREEN_Window *offscreen_wind = window->driverdata; return SDL_EGL_SwapBuffers(_this, offscreen_wind->egl_surface); } diff --git a/src/video/offscreen/SDL_offscreenopengles.h b/src/video/offscreen/SDL_offscreenopengles.h index 6c9e518200252..15f7ecdeeb3a4 100644 --- a/src/video/offscreen/SDL_offscreenopengles.h +++ b/src/video/offscreen/SDL_offscreenopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef _SDL_offscreenopengles_h #define _SDL_offscreenopengles_h -#if SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_OFFSCREEN) && defined(SDL_VIDEO_OPENGL_EGL) #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -44,4 +44,3 @@ extern int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window); #endif /* _SDL_offscreenopengles_h */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/offscreen/SDL_offscreenvideo.c b/src/video/offscreen/SDL_offscreenvideo.c index 8e62e88fb1727..d9e31e5ebd667 100644 --- a/src/video/offscreen/SDL_offscreenvideo.c +++ b/src/video/offscreen/SDL_offscreenvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OFFSCREEN +#ifdef SDL_VIDEO_DRIVER_OFFSCREEN /* Offscreen video driver is similar to dummy driver, however its purpose * is enabling applications to use some of the SDL video functionality @@ -42,27 +42,25 @@ /* Initialization/Query functions */ static int OFFSCREEN_VideoInit(_THIS); -static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static void OFFSCREEN_VideoQuit(_THIS); /* OFFSCREEN driver bootstrap functions */ -static void -OFFSCREEN_DeleteDevice(SDL_VideoDevice * device) +static void OFFSCREEN_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device); } -static SDL_VideoDevice * -OFFSCREEN_CreateDevice(void) +static SDL_VideoDevice *OFFSCREEN_CreateDevice(void) { SDL_VideoDevice *device; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } /* General video */ @@ -75,7 +73,7 @@ OFFSCREEN_CreateDevice(void) device->DestroyWindowFramebuffer = SDL_OFFSCREEN_DestroyWindowFramebuffer; device->free = OFFSCREEN_DeleteDevice; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* GL context */ device->GL_SwapWindow = OFFSCREEN_GLES_SwapWindow; device->GL_MakeCurrent = OFFSCREEN_GLES_MakeCurrent; @@ -97,11 +95,11 @@ OFFSCREEN_CreateDevice(void) VideoBootStrap OFFSCREEN_bootstrap = { OFFSCREENVID_DRIVER_NAME, "SDL offscreen video driver", - OFFSCREEN_CreateDevice + OFFSCREEN_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; -int -OFFSCREEN_VideoInit(_THIS) +int OFFSCREEN_VideoInit(_THIS) { SDL_DisplayMode mode; @@ -122,14 +120,12 @@ OFFSCREEN_VideoInit(_THIS) return 0; } -static int -OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void -OFFSCREEN_VideoQuit(_THIS) +void OFFSCREEN_VideoQuit(_THIS) { } diff --git a/src/video/offscreen/SDL_offscreenvideo.h b/src/video/offscreen/SDL_offscreenvideo.h index b943a82468754..17fc936f7fdce 100644 --- a/src/video/offscreen/SDL_offscreenvideo.h +++ b/src/video/offscreen/SDL_offscreenvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/offscreen/SDL_offscreenwindow.c b/src/video/offscreen/SDL_offscreenwindow.c index fd85f77e5eda4..bc0d121d4154a 100644 --- a/src/video/offscreen/SDL_offscreenwindow.c +++ b/src/video/offscreen/SDL_offscreenwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OFFSCREEN +#ifdef SDL_VIDEO_DRIVER_OFFSCREEN #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" #include "SDL_offscreenwindow.h" -int -OFFSCREEN_CreateWindow(_THIS, SDL_Window* window) +int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window) { OFFSCREEN_Window *offscreen_window = SDL_calloc(1, sizeof(OFFSCREEN_Window)); @@ -48,7 +47,7 @@ OFFSCREEN_CreateWindow(_THIS, SDL_Window* window) offscreen_window->sdl_window = window; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { if (!_this->egl_data) { @@ -69,13 +68,12 @@ OFFSCREEN_CreateWindow(_THIS, SDL_Window* window) return 0; } -void -OFFSCREEN_DestroyWindow(_THIS, SDL_Window* window) +void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window) { - OFFSCREEN_Window* offscreen_window = window->driverdata; + OFFSCREEN_Window *offscreen_window = window->driverdata; if (offscreen_window) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL SDL_EGL_DestroySurface(_this, offscreen_window->egl_surface); #endif SDL_free(offscreen_window); diff --git a/src/video/offscreen/SDL_offscreenwindow.h b/src/video/offscreen/SDL_offscreenwindow.h index 5540794543728..08acba2a0ed60 100644 --- a/src/video/offscreen/SDL_offscreenwindow.h +++ b/src/video/offscreen/SDL_offscreenwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,19 +25,18 @@ #include "SDL_offscreenvideo.h" -typedef struct { - SDL_Window* sdl_window; -#if SDL_VIDEO_OPENGL_EGL +typedef struct +{ + SDL_Window *sdl_window; +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif } OFFSCREEN_Window; - extern int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window); extern void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window); #endif /* _SDL_offscreenwindow */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/os2/SDL_os2dive.c b/src/video/os2/SDL_os2dive.c index 56cfde1b3be0c..66b3257bc82c3 100644 --- a/src/video/os2/SDL_os2dive.c +++ b/src/video/os2/SDL_os2dive.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -101,7 +101,7 @@ PVODATA voOpen(void) { PVODATA pVOData = SDL_calloc(1, sizeof(VODATA)); - if (pVOData == NULL) { + if (!pVOData) { SDL_OutOfMemory(); return NULL; } @@ -277,7 +277,7 @@ static VOID voVideoBufFree(PVODATA pVOData) pVOData->ulDIVEBufNum = 0; } - if (pVOData->pBuffer != NULL) { + if (pVOData->pBuffer) { ulRC = DosFreeMem(pVOData->pBuffer); if (ulRC != NO_ERROR) { debug_os2("DosFreeMem(), rc = %u", ulRC); @@ -296,11 +296,11 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, return FALSE; } - if (pSDLRects != NULL) { + if (pSDLRects) { PBYTE pbLineMask; pbLineMask = SDL_stack_alloc(BYTE, pVOData->ulHeight); - if (pbLineMask == NULL) { + if (!pbLineMask) { debug_os2("Not enough stack size"); return FALSE; } diff --git a/src/video/os2/SDL_os2messagebox.c b/src/video/os2/SDL_os2messagebox.c index c904fa5cbd7a8..cf24b0879d453 100644 --- a/src/video/os2/SDL_os2messagebox.c +++ b/src/video/os2/SDL_os2messagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OS2 +#ifdef SDL_VIDEO_DRIVER_OS2 /* Display a OS/2 message box */ @@ -206,9 +206,9 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) ULONG cSDLBtnData = messageboxdata->numbuttons; PSZ pszTitle = OS2_UTF8ToSys(messageboxdata->title); - ULONG cbTitle = (pszTitle == NULL)? 1 : (SDL_strlen(pszTitle) + 1); + ULONG cbTitle = (!pszTitle)? 1 : (SDL_strlen(pszTitle) + 1); PSZ pszText = OS2_UTF8ToSys(messageboxdata->message); - ULONG cbText = (pszText == NULL)? 1 : (SDL_strlen(pszText) + 1); + ULONG cbText = (!pszText)? 1 : (SDL_strlen(pszText) + 1); PDLGTEMPLATE pTemplate; ULONG cbTemplate; @@ -219,7 +219,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) ULONG cbBtnText; HWND hwnd; - const SDL_MessageBoxColor* pSDLColors = (messageboxdata->colorScheme == NULL)? + const SDL_MessageBoxColor* pSDLColors = (!messageboxdata->colorScheme)? NULL : messageboxdata->colorScheme->colors; const SDL_MessageBoxColor* pSDLColor; @@ -237,11 +237,11 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) /* Button items datas - text for buttons. */ for (ulIdx = 0; ulIdx < cSDLBtnData; ulIdx++) { pszBtnText = (PSZ)pSDLBtnData[ulIdx].text; - cbTemplate += (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1); + cbTemplate += (!pszBtnText)? 1 : (SDL_strlen(pszBtnText) + 1); } /* Presentation parameter space. */ - if (pSDLColors != NULL) { + if (pSDLColors) { cbTemplate += 26 /* PP for frame. */ + 26 /* PP for static text. */ + (48 * cSDLBtnData); /* PP for buttons. */ @@ -284,14 +284,14 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) } pcDlgData += pDlgItem->cchText; - pDlgItem->flStyle = WS_GROUP | WS_VISIBLE | WS_CLIPSIBLINGS | + pDlgItem->flStyle = WS_GROUP | WS_VISIBLE | WS_CLIPSIBLINGS | FS_DLGBORDER | WS_SAVEBITS; pDlgItem->x = 100; pDlgItem->y = 100; pDlgItem->cx = 175; pDlgItem->cy = 65; pDlgItem->id = DID_OK; /* An ID value? */ - if (pSDLColors == NULL) + if (!pSDLColors) pDlgItem->offPresParams = 0; else { /* Presentation parameter for the frame - dialog colors. */ @@ -346,7 +346,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) pDlgItem->cy = 62; /* It will be used. */ pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */ - if (pSDLColors == NULL) + if (!pSDLColors) pDlgItem->offPresParams = 0; else { /* Presentation parameter for the static text - dialog colors. */ @@ -407,7 +407,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) pDlgItem->offClassName = (USHORT)WC_BUTTON; pszBtnText = OS2_UTF8ToSys(pSDLBtnData[ulIdx].text); - cbBtnText = (pszBtnText == NULL)? 1 : (SDL_strlen(pszBtnText) + 1); + cbBtnText = (!pszBtnText)? 1 : (SDL_strlen(pszBtnText) + 1); pDlgItem->cchText = cbBtnText; pDlgItem->offText = pcDlgData - (PCHAR)pTemplate; /* Offset to the text. */ /* Copy text for the button into the dialog template. */ @@ -435,7 +435,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) pDlgItem->cy = 15; pDlgItem->id = IDD_PB_FIRST + ulIdx; /* an ID value */ - if (pSDLColors == NULL) + if (!pSDLColors) pDlgItem->offPresParams = 0; else { /* Presentation parameter for the button - dialog colors. */ @@ -473,7 +473,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata) /* Create the dialog from template. */ stDlgData.cb = sizeof(MSGBOXDLGDATA); - stDlgData.hwndUnder = (messageboxdata->window != NULL && messageboxdata->window->driverdata != NULL)? + stDlgData.hwndUnder = (messageboxdata->window && messageboxdata->window->driverdata)? ((WINDATA *)messageboxdata->window->driverdata)->hwnd : HWND_DESKTOP; hwnd = WinCreateDlg(HWND_DESKTOP, /* Parent is desktop. */ diff --git a/src/video/os2/SDL_os2messagebox.h b/src/video/os2/SDL_os2messagebox.h index c3b8969df795a..f8fdd7f425d98 100644 --- a/src/video/os2/SDL_os2messagebox.h +++ b/src/video/os2/SDL_os2messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OS2 +#ifdef SDL_VIDEO_DRIVER_OS2 extern int OS2_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/os2/SDL_os2mouse.c b/src/video/os2/SDL_os2mouse.c index dd0b7c19303be..4842cbe27e085 100644 --- a/src/video/os2/SDL_os2mouse.c +++ b/src/video/os2/SDL_os2mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OS2 +#ifdef SDL_VIDEO_DRIVER_OS2 #include "SDL_os2video.h" #include "../../events/SDL_mouse_c.h" @@ -46,7 +46,7 @@ static SDL_Cursor* OS2_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) return NULL; pSDLCursor = SDL_calloc(1, sizeof(SDL_Cursor)); - if (pSDLCursor == NULL) { + if (!pSDLCursor) { WinDestroyPointer(hptr); SDL_OutOfMemory(); return NULL; @@ -91,7 +91,7 @@ static SDL_Cursor* OS2_CreateSystemCursor(SDL_SystemCursor id) } pSDLCursor = SDL_calloc(1, sizeof(SDL_Cursor)); - if (pSDLCursor == NULL) { + if (!pSDLCursor) { WinDestroyPointer(hptr); SDL_OutOfMemory(); return NULL; @@ -111,7 +111,7 @@ static void OS2_FreeCursor(SDL_Cursor *cursor) static int OS2_ShowCursor(SDL_Cursor *cursor) { - hptrCursor = (cursor != NULL)? (HPOINTER)cursor->driverdata : NULLHANDLE; + hptrCursor = (cursor)? (HPOINTER)cursor->driverdata : NULLHANDLE; return ((SDL_GetMouseFocus() == NULL) || WinSetPointer(HWND_DESKTOP, hptrCursor))? 0 : -1; } @@ -122,10 +122,10 @@ static void OS2_WarpMouse(SDL_Window * window, int x, int y) POINTL pointl; pointl.x = x; - pointl.y = window->h - y; + pointl.y = window->h - y - 1; WinMapWindowPoints(pWinData->hwnd, HWND_DESKTOP, &pointl, 1); -/* pWinData->lSkipWMMouseMove++; ???*/ WinSetPointerPos(HWND_DESKTOP, pointl.x, pointl.y); + SDL_SendMouseMotion(window, SDL_GetMouse()->mouseID, 0, x, y); } static int OS2_WarpMouseGlobal(int x, int y) @@ -137,7 +137,7 @@ static int OS2_WarpMouseGlobal(int x, int y) static int OS2_CaptureMouse(SDL_Window *window) { - return WinSetCapture(HWND_DESKTOP, (window == NULL)? NULLHANDLE : + return WinSetCapture(HWND_DESKTOP, (!window)? NULLHANDLE : ((WINDATA *)window->driverdata)->hwnd)? 0 : -1; } @@ -182,7 +182,7 @@ void OS2_QuitMouse(_THIS) { SDL_Mouse *pSDLMouse = SDL_GetMouse(); - if (pSDLMouse->def_cursor != NULL) { + if (pSDLMouse->def_cursor) { SDL_free(pSDLMouse->def_cursor); pSDLMouse->def_cursor = NULL; pSDLMouse->cur_cursor = NULL; diff --git a/src/video/os2/SDL_os2mouse.h b/src/video/os2/SDL_os2mouse.h index 52f5ba3f736eb..5ab8e01900b6e 100644 --- a/src/video/os2/SDL_os2mouse.h +++ b/src/video/os2/SDL_os2mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/os2/SDL_os2output.h b/src/video/os2/SDL_os2output.h index 7ded650e9cb95..5f94d3144f44e 100644 --- a/src/video/os2/SDL_os2output.h +++ b/src/video/os2/SDL_os2output.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/os2/SDL_os2util.c b/src/video/os2/SDL_os2util.c index bcc6c54e8558b..70aa293756dc2 100644 --- a/src/video/os2/SDL_os2util.c +++ b/src/video/os2/SDL_os2util.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OS2 +#ifdef SDL_VIDEO_DRIVER_OS2 #include "SDL_os2util.h" @@ -41,7 +41,7 @@ HPOINTER utilCreatePointer(SDL_Surface *surface, ULONG ulHotX, ULONG ulHotY) } pulBitmap = (PULONG) SDL_malloc(surface->h * surface->w * 2 * sizeof(ULONG)); - if (pulBitmap == NULL) { + if (!pulBitmap) { SDL_OutOfMemory(); return NULLHANDLE; } diff --git a/src/video/os2/SDL_os2util.h b/src/video/os2/SDL_os2util.h index 9379dec5434b2..e612846212422 100644 --- a/src/video/os2/SDL_os2util.h +++ b/src/video/os2/SDL_os2util.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/os2/SDL_os2video.c b/src/video/os2/SDL_os2video.c index 599384edf6c42..a5dd3f6017428 100644 --- a/src/video/os2/SDL_os2video.c +++ b/src/video/os2/SDL_os2video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_OS2 +#ifdef SDL_VIDEO_DRIVER_OS2 #include "SDL_video.h" #include "SDL_mouse.h" @@ -31,6 +31,7 @@ #include "SDL_os2video.h" #include "SDL_syswm.h" #include "SDL_os2util.h" +#include "SDL_os2messagebox.h" #define __MEERROR_H__ #define _MEERROR_H_ @@ -171,7 +172,7 @@ static SDL_DisplayMode *_getDisplayModeForSDLWindow(SDL_Window *window) { SDL_VideoDisplay *pSDLDisplay = SDL_GetDisplayForWindow(window); - if (pSDLDisplay == NULL) { + if (!pSDLDisplay) { debug_os2("No display for the window"); return FALSE; } @@ -201,19 +202,19 @@ static VOID _setVisibleRegion(WINDATA *pWinData, BOOL fVisible) { SDL_VideoDisplay *pSDLDisplay; - if (! pWinData->pVOData) + if (!pWinData->pVOData) return; pSDLDisplay = (fVisible)? SDL_GetDisplayForWindow(pWinData->window) : NULL; pWinData->pOutput->SetVisibleRegion(pWinData->pVOData, pWinData->hwnd, - (pSDLDisplay == NULL) ? - NULL : &pSDLDisplay->current_mode, + (!pSDLDisplay) ? + NULL : &pSDLDisplay->current_mode, pWinData->hrgnShape, fVisible); } static VOID _wmPaint(WINDATA *pWinData, HWND hwnd) { - if (pWinData->pVOData == NULL || + if (!pWinData->pVOData || !pWinData->pOutput->Update(pWinData->pVOData, hwnd, NULL, 0)) { RECTL rectl; HPS hps; @@ -438,7 +439,7 @@ static MRESULT EXPENTRY wndFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp HWND hwndClient = WinQueryWindow(hwnd, QW_BOTTOM); WINDATA * pWinData = (WINDATA *)WinQueryWindowULong(hwndClient, 0); - if (pWinData == NULL) + if (!pWinData) return WinDefWindowProc(hwnd, msg, mp1, mp2); /* Send a SDL_SYSWMEVENT if the application wants them */ @@ -544,7 +545,7 @@ static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { WINDATA *pWinData = (WINDATA *)WinQueryWindowULong(hwnd, 0); - if (pWinData == NULL) + if (!pWinData) return WinDefWindowProc(hwnd, msg, mp1, mp2); /* Send a SDL_SYSWMEVENT if the application wants them */ @@ -565,7 +566,7 @@ static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) case WM_CLOSE: case WM_QUIT: SDL_SendWindowEvent(pWinData->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - if (pWinData->fnUserWndProc == NULL) + if (!pWinData->fnUserWndProc) return (MRESULT)FALSE; break; @@ -642,7 +643,7 @@ static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) case WM_TRANSLATEACCEL: /* ALT and acceleration keys not allowed (must be processed in WM_CHAR) */ - if (mp1 == NULL || ((PQMSG)mp1)->msg != WM_CHAR) + if (!mp1 || ((PQMSG)mp1)->msg != WM_CHAR) break; return (MRESULT)FALSE; @@ -690,7 +691,7 @@ static MRESULT EXPENTRY wndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) return _wmDrop(pWinData, (PDRAGINFO)PVOIDFROMMP(mp1)); } - return (pWinData->fnUserWndProc != NULL)? + return (pWinData->fnUserWndProc)? pWinData->fnUserWndProc(hwnd, msg, mp1, mp2) : WinDefWindowProc(hwnd, msg, mp1, mp2); } @@ -715,7 +716,7 @@ static WINDATA *_setupWindow(_THIS, SDL_Window *window, HWND hwndFrame, SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; WINDATA *pWinData = SDL_calloc(1, sizeof(WINDATA)); - if (pWinData == NULL) { + if (!pWinData) { SDL_OutOfMemory(); return NULL; } @@ -745,7 +746,7 @@ static int OS2_CreateWindow(_THIS, SDL_Window *window) ULONG ulSWPFlags = SWP_SIZE | SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE; WINDATA *pWinData; - if (pSDLDisplayMode == NULL) + if (!pSDLDisplayMode) return -1; /* Create a PM window */ @@ -766,7 +767,7 @@ static int OS2_CreateWindow(_THIS, SDL_Window *window) /* Setup window data and frame window procedure */ pWinData = _setupWindow(_this, window, hwndFrame, hwnd); - if (pWinData == NULL) { + if (!pWinData) { WinDestroyWindow(hwndFrame); return -1; } @@ -809,7 +810,7 @@ static int OS2_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) POINTL pointl; debug_os2("Enter"); - if (pSDLDisplayMode == NULL) + if (!pSDLDisplayMode) return -1; /* User can accept client OR frame window handle. @@ -892,7 +893,7 @@ static int OS2_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) /* Setup window data and frame window procedure */ pWinData = _setupWindow(_this, window, hwndFrame, hwnd); - if (pWinData == NULL) { + if (!pWinData) { SDL_free(window->title); window->title = NULL; return -1; @@ -911,7 +912,7 @@ static void OS2_DestroyWindow(_THIS, SDL_Window * window) WINDATA *pWinData = (WINDATA *)window->driverdata; debug_os2("Enter"); - if (pWinData == NULL) + if (!pWinData) return; if (pWinData->hrgnShape != NULLHANDLE) { @@ -925,7 +926,7 @@ static void OS2_DestroyWindow(_THIS, SDL_Window * window) window->shaper = NULL; } - if (pWinData->fnUserWndProc == NULL) { + if (!pWinData->fnUserWndProc) { /* Window was created by SDL (OS2_CreateWindow()), * not by user (OS2_CreateWindowFrom()) */ WinDestroyWindow(pWinData->hwndFrame); @@ -933,7 +934,7 @@ static void OS2_DestroyWindow(_THIS, SDL_Window * window) WinSetWindowULong(pWinData->hwnd, 0, 0); } - if ((pVData != NULL) && (pWinData->pVOData != NULL)) { + if ((pVData) && (pWinData->pVOData)) { pVData->pOutput->Close(pWinData->pVOData); pWinData->pVOData = NULL; } @@ -949,7 +950,7 @@ static void OS2_DestroyWindow(_THIS, SDL_Window * window) static void OS2_SetWindowTitle(_THIS, SDL_Window *window) { - PSZ pszTitle = (window->title == NULL)? NULL : OS2_UTF8ToSys(window->title); + PSZ pszTitle = (!window->title)? NULL : OS2_UTF8ToSys(window->title); WinSetWindowText(((WINDATA *)window->driverdata)->hwndFrame, pszTitle); SDL_free(pszTitle); @@ -982,7 +983,7 @@ static void OS2_SetWindowPosition(_THIS, SDL_Window *window) SDL_DisplayMode *pSDLDisplayMode = _getDisplayModeForSDLWindow(window); debug_os2("Enter"); - if (pSDLDisplayMode == NULL) + if (!pSDLDisplayMode) return; rectl.xLeft = 0; @@ -1102,7 +1103,7 @@ static void OS2_SetWindowFullscreen(_THIS, SDL_Window *window, debug_os2("Enter, fullscreen: %u", fullscreen); - if (pSDLDisplayMode == NULL) + if (!pSDLDisplayMode) return; if (SDL_ShouldAllowTopmost() && @@ -1189,7 +1190,7 @@ static void _combineRectRegions(SDL_ShapeTree *node, void *closure) /* Expand rectangles list */ if ((pShapeRects->cRects & 0x0F) == 0) { pRect = SDL_realloc(pShapeRects->pRects, (pShapeRects->cRects + 0x10) * sizeof(RECTL)); - if (pRect == NULL) + if (!pRect) return; pShapeRects->pRects = pRect; } @@ -1235,13 +1236,13 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, HPS hps; debug_os2("Enter"); - if (shaper == NULL || shape == NULL || + if (!shaper || !shape || (shape->format->Amask == 0 && shape_mode->mode != ShapeModeColorKey) || shape->w != shaper->window->w || shape->h != shaper->window->h) { return SDL_INVALID_SHAPE_ARGUMENT; } - if (shaper->driverdata != NULL) + if (shaper->driverdata) SDL_FreeShapeTree((SDL_ShapeTree **)&shaper->driverdata); pShapeTree = SDL_CalculateShapeTree(*shape_mode, shape); @@ -1257,7 +1258,7 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, if (pWinData->hrgnShape != NULLHANDLE) GpiDestroyRegion(hps, pWinData->hrgnShape); - pWinData->hrgnShape = (stShapeRects.pRects == NULL) ? NULLHANDLE : + pWinData->hrgnShape = (!stShapeRects.pRects) ? NULLHANDLE : GpiCreateRegion(hps, stShapeRects.cRects, stShapeRects.pRects); WinReleasePS(hps); @@ -1270,11 +1271,11 @@ static int OS2_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, static int OS2_ResizeWindowShape(SDL_Window *window) { debug_os2("Enter"); - if (window == NULL) + if (!window) return -1; if (window->x != -1000) { - if (window->shaper->driverdata != NULL) + if (window->shaper->driverdata) SDL_FreeShapeTree((SDL_ShapeTree **)window->shaper->driverdata); if (window->shaper->hasshape == SDL_TRUE) { @@ -1295,7 +1296,7 @@ static void OS2_DestroyWindowFramebuffer(_THIS, SDL_Window *window) WINDATA *pWinData = (WINDATA *)window->driverdata; debug_os2("Enter"); - if (pWinData != NULL && pWinData->pVOData != NULL) + if (pWinData && pWinData->pVOData) pWinData->pOutput->VideoBufFree(pWinData->pVOData); } @@ -1310,14 +1311,14 @@ static int OS2_CreateWindowFramebuffer(_THIS, SDL_Window *window, ULONG ulWidth, ulHeight; debug_os2("Enter"); - if (pSDLDisplay == NULL) { + if (!pSDLDisplay) { debug_os2("No display for the window"); return -1; } pSDLDisplayMode = &pSDLDisplay->current_mode; pModeData = (MODEDATA *)pSDLDisplayMode->driverdata; - if (pModeData == NULL) + if (!pModeData) return SDL_SetError("No mode data for the display"); SDL_GetWindowSize(window, (int *)&ulWidth, (int *)&ulHeight); @@ -1326,7 +1327,7 @@ static int OS2_CreateWindowFramebuffer(_THIS, SDL_Window *window, *pixels = pWinData->pOutput->VideoBufAlloc( pWinData->pVOData, ulWidth, ulHeight, pModeData->ulDepth, pModeData->fccColorEncoding, (PULONG)pitch); - if (*pixels == NULL) + if (!*pixels) return -1; *format = pSDLDisplayMode->format; @@ -1353,13 +1354,13 @@ static int OS2_SetClipboardText(_THIS, const char *text) { SDL_VideoData *pVData = (SDL_VideoData *)_this->driverdata; PSZ pszClipboard; - PSZ pszText = (text == NULL)? NULL : OS2_UTF8ToSys(text); + PSZ pszText = (!text)? NULL : OS2_UTF8ToSys(text); ULONG cbText; ULONG ulRC; BOOL fSuccess; debug_os2("Enter"); - if (pszText == NULL) + if (!pszText) return -1; cbText = SDL_strlen(pszText) + 1; @@ -1408,7 +1409,7 @@ static char *OS2_GetClipboardText(_THIS) WinCloseClipbrd(pVData->hab); } - return (pszClipboard == NULL) ? SDL_strdup("") : pszClipboard; + return (!pszClipboard) ? SDL_strdup("") : pszClipboard; } static SDL_bool OS2_HasClipboardText(_THIS) @@ -1438,7 +1439,7 @@ static int OS2_VideoInit(_THIS) /* Create SDL video driver private data */ pVData = SDL_calloc(1, sizeof(SDL_VideoData)); - if (pVData == NULL) + if (!pVData) return SDL_OutOfMemory(); /* Change process type code for use Win* API from VIO session */ @@ -1493,7 +1494,7 @@ static int OS2_VideoInit(_THIS) stSDLDisplayMode.driverdata = NULL; pModeData = SDL_malloc(sizeof(MODEDATA)); - if (pModeData != NULL) { + if (pModeData) { pModeData->ulDepth = stVOInfo.ulBPP; pModeData->fccColorEncoding = stVOInfo.fccColorEncoding; pModeData->ulScanLineBytes = stVOInfo.ulScanLineSize; @@ -1507,7 +1508,7 @@ static int OS2_VideoInit(_THIS) stSDLDisplay.num_display_modes = 0; pDisplayData = SDL_malloc(sizeof(DISPLAYDATA)); - if (pDisplayData != NULL) { + if (pDisplayData) { HPS hps = WinGetPS(HWND_DESKTOP); HDC hdc = GpiQueryDevice(hps); @@ -1566,14 +1567,14 @@ static int OS2_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, DISPLAYDATA *pDisplayData = (DISPLAYDATA *)display->driverdata; debug_os2("Enter"); - if (pDisplayData == NULL) + if (!pDisplayData) return -1; - if (ddpi != NULL) + if (ddpi) *hdpi = pDisplayData->ulDPIDiag; - if (hdpi != NULL) + if (hdpi) *hdpi = pDisplayData->ulDPIHor; - if (vdpi != NULL) + if (vdpi) *vdpi = pDisplayData->ulDPIVer; return 0; @@ -1683,12 +1684,14 @@ static SDL_VideoDevice *OS2VMAN_CreateDevice(void) VideoBootStrap OS2DIVE_bootstrap = { OS2DRIVER_NAME_DIVE, "OS/2 video driver", - OS2DIVE_CreateDevice + OS2DIVE_CreateDevice, + OS2_ShowMessageBox }; VideoBootStrap OS2VMAN_bootstrap = { OS2DRIVER_NAME_VMAN, "OS/2 video driver", - OS2VMAN_CreateDevice + OS2VMAN_CreateDevice, + OS2_ShowMessageBox }; #endif /* SDL_VIDEO_DRIVER_OS2 */ diff --git a/src/video/os2/SDL_os2video.h b/src/video/os2/SDL_os2video.h index 688410c68a2d3..e2aaa269e8e9f 100644 --- a/src/video/os2/SDL_os2video.h +++ b/src/video/os2/SDL_os2video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/os2/SDL_os2vman.c b/src/video/os2/SDL_os2vman.c index acb9200613a5d..0412ee02e3a0e 100644 --- a/src/video/os2/SDL_os2vman.c +++ b/src/video/os2/SDL_os2vman.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -143,7 +143,7 @@ static PRECTL _getRectlArray(PVODATA pVOData, ULONG cRects) return pVOData->pRectl; pRectl = SDL_realloc(pVOData->pRectl, cRects * sizeof(RECTL)); - if (pRectl == NULL) + if (!pRectl) return NULL; pVOData->pRectl = pRectl; @@ -159,7 +159,7 @@ static PBLTRECT _getBltRectArray(PVODATA pVOData, ULONG cRects) return pVOData->pBltRect; pBltRect = SDL_realloc(pVOData->pBltRect, cRects * sizeof(BLTRECT)); - if (pBltRect == NULL) + if (!pBltRect) return NULL; pVOData->pBltRect = pBltRect; @@ -200,7 +200,7 @@ static PVODATA voOpen(void) return NULL; pVOData = SDL_calloc(1, sizeof(VODATA)); - if (pVOData == NULL) { + if (!pVOData) { SDL_OutOfMemory(); return NULL; } @@ -210,10 +210,10 @@ static PVODATA voOpen(void) static VOID voClose(PVODATA pVOData) { - if (pVOData->pRectl != NULL) + if (pVOData->pRectl) SDL_free(pVOData->pRectl); - if (pVOData->pBltRect != NULL) + if (pVOData->pBltRect) SDL_free(pVOData->pBltRect); voVideoBufFree(pVOData); @@ -253,7 +253,7 @@ static BOOL voSetVisibleRegion(PVODATA pVOData, HWND hwnd, WinQueryWindowRect(hwnd, &pVOData->rectlWin); WinMapWindowPoints(hwnd, HWND_DESKTOP, (PPOINTL)&pVOData->rectlWin, 2); - if (pSDLDisplayMode != NULL) { + if (pSDLDisplayMode) { pVOData->ulScreenHeight = pSDLDisplayMode->h; pVOData->ulScreenBytesPerLine = ((MODEDATA *)pSDLDisplayMode->driverdata)->ulScanLineBytes; @@ -302,7 +302,7 @@ static VOID voVideoBufFree(PVODATA pVOData) { ULONG ulRC; - if (pVOData->pBuffer == NULL) + if (!pVOData->pBuffer) return; ulRC = DosFreeMem(pVOData->pBuffer); @@ -329,7 +329,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, BITBLTINFO sBitbltInfo; ULONG ulIdx; - if (pVOData->pBuffer == NULL) + if (!pVOData->pBuffer) return FALSE; if (pVOData->hrgnVisible == NULLHANDLE) @@ -366,7 +366,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, /* Make list of destination rectangles (prectlDst) list from the source * list (prectl). */ prectlDst = _getRectlArray(pVOData, cSDLRects); - if (prectlDst == NULL) { + if (!prectlDst) { debug_os2("Not enough memory"); return FALSE; } @@ -400,7 +400,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, } /* We don't need prectlDst, use it again to store update regions */ prectlDst = _getRectlArray(pVOData, rgnCtl.crcReturned); - if (prectlDst == NULL) { + if (!prectlDst) { debug_os2("Not enough memory"); GpiDestroyRegion(hps, hrgnUpdate); WinReleasePS(hps); @@ -418,7 +418,7 @@ static BOOL voUpdate(PVODATA pVOData, HWND hwnd, SDL_Rect *pSDLRects, /* Make lists for blitting from update regions */ pbrDst = _getBltRectArray(pVOData, cSDLRects); - if (pbrDst == NULL) { + if (!pbrDst) { debug_os2("Not enough memory"); return FALSE; } diff --git a/src/video/pandora/SDL_pandora.c b/src/video/pandora/SDL_pandora.c index 834083838a08f..03712b4af4f11 100644 --- a/src/video/pandora/SDL_pandora.c +++ b/src/video/pandora/SDL_pandora.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PANDORA +#ifdef SDL_VIDEO_DRIVER_PANDORA /* SDL internals */ #include "../SDL_sysvideo.h" @@ -41,46 +41,30 @@ static NativeWindowType hNativeWnd = 0; /* A handle to the window we will create. */ #endif -static int -PND_available(void) +static void PND_destroy(SDL_VideoDevice * device) { - return 1; -} - -static void -PND_destroy(SDL_VideoDevice * device) -{ - if (device->driverdata != NULL) { + if (device->driverdata) { SDL_free(device->driverdata); device->driverdata = NULL; } SDL_free(device); } -static SDL_VideoDevice * -PND_create() +static SDL_VideoDevice *PND_create(void) { SDL_VideoDevice *device; SDL_VideoData *phdata; - int status; - - /* Check if pandora could be initialized */ - status = PND_available(); - if (status == 0) { - /* PND could not be used */ - return NULL; - } /* Initialize SDL_VideoDevice structure */ device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + if (!device) { SDL_OutOfMemory(); return NULL; } /* Initialize internal Pandora specific data */ phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); return NULL; @@ -142,15 +126,14 @@ VideoBootStrap PND_bootstrap = { "pandora", "SDL Pandora Video Driver", #endif - PND_available, - PND_create + PND_create, + NULL /* no ShowMessageBox implementation */ }; /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -int -PND_videoinit(_THIS) +int PND_videoinit(_THIS) { SDL_VideoDisplay display; SDL_DisplayMode current_mode; @@ -177,26 +160,22 @@ PND_videoinit(_THIS) return 1; } -void -PND_videoquit(_THIS) +void PND_videoquit(_THIS) { } -void -PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display) +void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display) { } -int -PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { return 0; } -int -PND_createwindow(_THIS, SDL_Window * window) +int PND_createwindow(_THIS, SDL_Window * window) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; @@ -204,7 +183,7 @@ PND_createwindow(_THIS, SDL_Window * window) /* Allocate window internal data */ wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { + if (!wdata) { return SDL_OutOfMemory(); } @@ -239,54 +218,42 @@ PND_createwindow(_THIS, SDL_Window * window) return 0; } -int -PND_createwindowfrom(_THIS, SDL_Window * window, const void *data) +int PND_createwindowfrom(_THIS, SDL_Window * window, const void *data) { return -1; } -void -PND_setwindowtitle(_THIS, SDL_Window * window) +void PND_setwindowtitle(_THIS, SDL_Window * window) { } -void -PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon) +void PND_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon) { } -void -PND_setwindowposition(_THIS, SDL_Window * window) +void PND_setwindowposition(_THIS, SDL_Window * window) { } -void -PND_setwindowsize(_THIS, SDL_Window * window) +void PND_setwindowsize(_THIS, SDL_Window * window) { } -void -PND_showwindow(_THIS, SDL_Window * window) +void PND_showwindow(_THIS, SDL_Window * window) { } -void -PND_hidewindow(_THIS, SDL_Window * window) +void PND_hidewindow(_THIS, SDL_Window * window) { } -void -PND_raisewindow(_THIS, SDL_Window * window) +void PND_raisewindow(_THIS, SDL_Window * window) { } -void -PND_maximizewindow(_THIS, SDL_Window * window) +void PND_maximizewindow(_THIS, SDL_Window * window) { } -void -PND_minimizewindow(_THIS, SDL_Window * window) +void PND_minimizewindow(_THIS, SDL_Window * window) { } -void -PND_restorewindow(_THIS, SDL_Window * window) +void PND_restorewindow(_THIS, SDL_Window * window) { } -void -PND_destroywindow(_THIS, SDL_Window * window) +void PND_destroywindow(_THIS, SDL_Window * window) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; eglTerminate(phdata->egl_display); @@ -296,8 +263,7 @@ PND_destroywindow(_THIS, SDL_Window * window) /* SDL Window Manager function */ /*****************************************************************************/ #if 0 -SDL_bool -PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { if (info->version.major <= SDL_MAJOR_VERSION) { return SDL_TRUE; @@ -315,19 +281,18 @@ PND_getwindowwminfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) /*****************************************************************************/ /* SDL OpenGL/OpenGL ES functions */ /*****************************************************************************/ -int -PND_gl_loadlibrary(_THIS, const char *path) +int PND_gl_loadlibrary(_THIS, const char *path) { /* Check if OpenGL ES library is specified for GF driver */ - if (path == NULL) { + if (!path) { path = SDL_getenv("SDL_OPENGL_LIBRARY"); - if (path == NULL) { + if (!path) { path = SDL_getenv("SDL_OPENGLES_LIBRARY"); } } /* Check if default library loading requested */ - if (path == NULL) { + if (!path) { /* Already linked with GF library which provides egl* subset of */ /* functions, use Common profile of OpenGL ES library by default */ #ifdef WIZ_GLES_LITE @@ -352,14 +317,13 @@ PND_gl_loadlibrary(_THIS, const char *path) return 0; } -void * -PND_gl_getprocaddres(_THIS, const char *proc) +void *PND_gl_getprocaddres(_THIS, const char *proc) { void *function_address; /* Try to get function address through the egl interface */ function_address = eglGetProcAddress(proc); - if (function_address != NULL) { + if (function_address) { return function_address; } @@ -367,7 +331,7 @@ PND_gl_getprocaddres(_THIS, const char *proc) if (_this->gl_config.dll_handle) { function_address = SDL_LoadFunction(_this->gl_config.dll_handle, proc); - if (function_address != NULL) { + if (function_address) { return function_address; } } @@ -377,8 +341,7 @@ PND_gl_getprocaddres(_THIS, const char *proc) return NULL; } -void -PND_gl_unloadlibrary(_THIS) +void PND_gl_unloadlibrary(_THIS) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; @@ -393,8 +356,7 @@ PND_gl_unloadlibrary(_THIS) } } -SDL_GLContext -PND_gl_createcontext(_THIS, SDL_Window * window) +SDL_GLContext PND_gl_createcontext(_THIS, SDL_Window * window) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; @@ -611,16 +573,16 @@ PND_gl_createcontext(_THIS, SDL_Window * window) } #ifdef WIZ_GLES_LITE - if( !hNativeWnd ) { - hNativeWnd = (NativeWindowType)SDL_malloc(16*1024); - - if(!hNativeWnd) - printf( "Error: Wiz framebuffer allocatation failed\n" ); - else - printf( "SDL: Wiz framebuffer allocated: %X\n", hNativeWnd ); + if (!hNativeWnd) { + hNativeWnd = (NativeWindowType)SDL_malloc(16*1024); + if (!hNativeWnd) { + printf("Error: Wiz framebuffer allocatation failed\n"); + } else { + printf("SDL: Wiz framebuffer allocated: %X\n", hNativeWnd); + } } else { - printf( "SDL: Wiz framebuffer already allocated: %X\n", hNativeWnd ); + printf("SDL: Wiz framebuffer already allocated: %X\n", hNativeWnd); } wdata->gles_surface = @@ -698,8 +660,7 @@ PND_gl_createcontext(_THIS, SDL_Window * window) return wdata->gles_context; } -int -PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; SDL_WindowData *wdata; @@ -709,7 +670,7 @@ PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) return SDL_SetError("PND: GF initialization failed, no OpenGL ES support"); } - if ((window == NULL) && (context == NULL)) { + if ((!window) && (!context)) { status = eglMakeCurrent(phdata->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); @@ -742,8 +703,7 @@ PND_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context) return 0; } -int -PND_gl_setswapinterval(_THIS, int interval) +int PND_gl_setswapinterval(_THIS, int interval) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; EGLBoolean status; @@ -767,14 +727,12 @@ PND_gl_setswapinterval(_THIS, int interval) return SDL_SetError("PND: Cannot set swap interval"); } -int -PND_gl_getswapinterval(_THIS) +int PND_gl_getswapinterval(_THIS) { return ((SDL_VideoData *) _this->driverdata)->swapinterval; } -int -PND_gl_swapwindow(_THIS, SDL_Window * window) +int PND_gl_swapwindow(_THIS, SDL_Window * window) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; @@ -793,8 +751,7 @@ PND_gl_swapwindow(_THIS, SDL_Window * window) return 0; } -void -PND_gl_deletecontext(_THIS, SDL_GLContext context) +void PND_gl_deletecontext(_THIS, SDL_GLContext context) { SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; EGLBoolean status; @@ -817,11 +774,10 @@ PND_gl_deletecontext(_THIS, SDL_GLContext context) } #ifdef WIZ_GLES_LITE - if( hNativeWnd != 0 ) - { + if (hNativeWnd != 0) { SDL_free(hNativeWnd); hNativeWnd = 0; - printf( "SDL: Wiz framebuffer released\n" ); + printf("SDL: Wiz framebuffer released\n"); } #endif diff --git a/src/video/pandora/SDL_pandora.h b/src/video/pandora/SDL_pandora.h index 0954cd3af96c5..307a12c5fbe03 100644 --- a/src/video/pandora/SDL_pandora.h +++ b/src/video/pandora/SDL_pandora.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/pandora/SDL_pandora_events.c b/src/video/pandora/SDL_pandora_events.c index ab077d5dd8428..372c0b79cd929 100644 --- a/src/video/pandora/SDL_pandora_events.c +++ b/src/video/pandora/SDL_pandora_events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PANDORA +#ifdef SDL_VIDEO_DRIVER_PANDORA /* Being a null driver, there's no event stream. We just define stubs for most of the API. */ #include "../../events/SDL_events_c.h" -void -PND_PumpEvents(_THIS) +void PND_PumpEvents(_THIS) { /* Not implemented. */ } diff --git a/src/video/pandora/SDL_pandora_events.h b/src/video/pandora/SDL_pandora_events.h index 8ad8e355dc841..d4e2e76533b7f 100644 --- a/src/video/pandora/SDL_pandora_events.h +++ b/src/video/pandora/SDL_pandora_events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/ps2/SDL_ps2video.c b/src/video/ps2/SDL_ps2video.c index 9ada4edaf952c..c80fc7081353b 100644 --- a/src/video/ps2/SDL_ps2video.c +++ b/src/video/ps2/SDL_ps2video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PS2 +#ifdef SDL_VIDEO_DRIVER_PS2 /* PS2 SDL video driver implementation; this is just enough to make an * SDL-based application THINK it's got a working video driver, for @@ -48,17 +48,17 @@ /* PS2 driver bootstrap functions */ -static int PS2_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int PS2_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -static void PS2_DeleteDevice(SDL_VideoDevice * device) +static void PS2_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device); } -static int PS2_CreateWindow(_THIS, SDL_Window * window) +static int PS2_CreateWindow(_THIS, SDL_Window *window) { SDL_SetKeyboardFocus(window); @@ -76,7 +76,7 @@ static int PS2_VideoInit(_THIS) current_mode.w = 640; current_mode.h = 480; current_mode.refresh_rate = 60; - + /* 32 bpp for default */ current_mode.format = SDL_PIXELFORMAT_ABGR8888; current_mode.driverdata = NULL; @@ -94,7 +94,6 @@ static int PS2_VideoInit(_THIS) static void PS2_VideoQuit(_THIS) { - } static void PS2_PumpEvents(_THIS) @@ -107,10 +106,10 @@ static SDL_VideoDevice *PS2_CreateDevice(void) SDL_VideoDevice *device; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } /* Set the function pointers */ @@ -125,9 +124,10 @@ static SDL_VideoDevice *PS2_CreateDevice(void) } VideoBootStrap PS2_bootstrap = { - "PS2", + "PS2", "PS2 Video Driver", - PS2_CreateDevice + PS2_CreateDevice, + NULL /* no ShowMessageBox implementation */ }; #endif /* SDL_VIDEO_DRIVER_PS2 */ diff --git a/src/video/ps2/SDL_ps2video.h b/src/video/ps2/SDL_ps2video.h index 7f981bf00093e..8c7166696ca24 100644 --- a/src/video/ps2/SDL_ps2video.h +++ b/src/video/ps2/SDL_ps2video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index dd2c67f1721d3..3c4ae391e9980 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PSP +#ifdef SDL_VIDEO_DRIVER_PSP /* Being a null driver, there's no event stream. We just define stubs for most of the API. */ @@ -40,7 +40,7 @@ #include #include -#define IRKBD_CONFIG_FILE NULL /* this will take ms0:/seplugins/pspirkeyb.ini */ +#define IRKBD_CONFIG_FILE NULL /* this will take ms0:/seplugins/pspirkeyb.ini */ static int irkbd_ready = 0; static SDL_Keycode keymap[256]; @@ -50,24 +50,24 @@ static enum PspHprmKeys hprm = 0; static SDL_sem *event_sem = NULL; static SDL_Thread *thread = NULL; static int running = 0; -static struct { +static struct +{ enum PspHprmKeys id; SDL_Keycode sym; } keymap_psp[] = { { PSP_HPRM_PLAYPAUSE, SDLK_F10 }, - { PSP_HPRM_FORWARD, SDLK_F11 }, - { PSP_HPRM_BACK, SDLK_F12 }, - { PSP_HPRM_VOL_UP, SDLK_F13 }, - { PSP_HPRM_VOL_DOWN, SDLK_F14 }, - { PSP_HPRM_HOLD, SDLK_F15 } + { PSP_HPRM_FORWARD, SDLK_F11 }, + { PSP_HPRM_BACK, SDLK_F12 }, + { PSP_HPRM_VOL_UP, SDLK_F13 }, + { PSP_HPRM_VOL_DOWN, SDLK_F14 }, + { PSP_HPRM_HOLD, SDLK_F15 } }; -int -EventUpdate(void *data) +int EventUpdate(void *data) { while (running) { SDL_SemWait(event_sem); - sceHprmPeekCurrentKey((u32 *) &hprm); + sceHprmPeekCurrentKey((u32 *)&hprm); SDL_SemPost(event_sem); /* Delay 1/60th of a second */ sceKernelDelayThread(1000000 / 60); @@ -89,36 +89,33 @@ void PSP_PumpEvents(_THIS) /* HPRM Keyboard */ changed = old_keys ^ keys; old_keys = keys; - if(changed) { - for(i=0; i= 0) { - if((length % sizeof(SIrKeybScanCodeData)) == 0){ - count = length / sizeof(SIrKeybScanCodeData); - for( i=0; i < count; i++ ) { - unsigned char raw, pressed; - scanData=(SIrKeybScanCodeData*) buffer+i; - raw = scanData->raw; - pressed = scanData->pressed; - sym.scancode = raw; - sym.sym = keymap[raw]; - /* not tested */ - /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ - SDL_SendKeyboardKey((keys & keymap_psp[i].id) ? - SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw])); - + if (pspIrKeybReadinput(buffer, &length) >= 0) { + if ((length % sizeof(SIrKeybScanCodeData)) == 0) { + count = length / sizeof(SIrKeybScanCodeData); + for (i = 0; i < count; i++) { + unsigned char raw, pressed; + scanData = (SIrKeybScanCodeData *)buffer + i; + raw = scanData->raw; + pressed = scanData->pressed; + sym.scancode = raw; + sym.sym = keymap[raw]; + /* not tested */ + /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ + SDL_SendKeyboardKey((keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw])); } } } @@ -133,8 +130,9 @@ void PSP_InitOSKeymap(_THIS) { #ifdef PSPIRKEYB int i; - for (i=0; i + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,6 +23,7 @@ extern void PSP_InitOSKeymap(_THIS); extern void PSP_PumpEvents(_THIS); +extern int PSP_EventInit(_THIS); +extern void PSP_EventQuit(_THIS); /* end of SDL_pspevents_c.h ... */ - diff --git a/src/video/psp/SDL_pspgl.c b/src/video/psp/SDL_pspgl.c index ca55ea2513a25..381e8322d5d40 100644 --- a/src/video/psp/SDL_pspgl.c +++ b/src/video/psp/SDL_pspgl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PSP +#ifdef SDL_VIDEO_DRIVER_PSP #include #include @@ -32,22 +32,21 @@ /*****************************************************************************/ /* SDL OpenGL/OpenGL ES functions */ /*****************************************************************************/ -#define EGLCHK(stmt) \ - do { \ - EGLint err; \ - \ - stmt; \ - err = eglGetError(); \ - if (err != EGL_SUCCESS) { \ - SDL_SetError("EGL error %d", err); \ - return 0; \ - } \ +#define EGLCHK(stmt) \ + do { \ + EGLint err; \ + \ + stmt; \ + err = eglGetError(); \ + if (err != EGL_SUCCESS) { \ + SDL_SetError("EGL error %d", err); \ + return 0; \ + } \ } while (0) -int -PSP_GL_LoadLibrary(_THIS, const char *path) +int PSP_GL_LoadLibrary(_THIS, const char *path) { - return 0; + return 0; } /* pspgl doesn't provide this call, so stub it out since SDL requires it. @@ -56,102 +55,91 @@ PSP_GL_LoadLibrary(_THIS, const char *path) GLSTUB(glOrtho,(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)) */ -void * -PSP_GL_GetProcAddress(_THIS, const char *proc) +void *PSP_GL_GetProcAddress(_THIS, const char *proc) { - return eglGetProcAddress(proc); + return eglGetProcAddress(proc); } -void -PSP_GL_UnloadLibrary(_THIS) +void PSP_GL_UnloadLibrary(_THIS) { - eglTerminate(_this->gl_data->display); + eglTerminate(_this->gl_data->display); } static EGLint width = 480; static EGLint height = 272; -SDL_GLContext -PSP_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window) { - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; - - EGLint attribs[32]; - EGLDisplay display; - EGLContext context; - EGLSurface surface; - EGLConfig config; - EGLint num_configs; - int i; + SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata; + EGLint attribs[32]; + EGLDisplay display; + EGLContext context; + EGLSurface surface; + EGLConfig config; + EGLint num_configs; + int i; /* EGL init taken from glutCreateWindow() in PSPGL's glut.c. */ - EGLCHK(display = eglGetDisplay(0)); - EGLCHK(eglInitialize(display, NULL, NULL)); + EGLCHK(display = eglGetDisplay(0)); + EGLCHK(eglInitialize(display, NULL, NULL)); wdata->uses_gles = SDL_TRUE; - window->flags |= SDL_WINDOW_FULLSCREEN; - - /* Setup the config based on SDL's current values. */ - i = 0; - attribs[i++] = EGL_RED_SIZE; - attribs[i++] = _this->gl_config.red_size; - attribs[i++] = EGL_GREEN_SIZE; - attribs[i++] = _this->gl_config.green_size; - attribs[i++] = EGL_BLUE_SIZE; - attribs[i++] = _this->gl_config.blue_size; - attribs[i++] = EGL_DEPTH_SIZE; - attribs[i++] = _this->gl_config.depth_size; - - if (_this->gl_config.alpha_size) - { - attribs[i++] = EGL_ALPHA_SIZE; - attribs[i++] = _this->gl_config.alpha_size; - } - if (_this->gl_config.stencil_size) - { - attribs[i++] = EGL_STENCIL_SIZE; - attribs[i++] = _this->gl_config.stencil_size; - } - - attribs[i++] = EGL_NONE; + window->flags |= SDL_WINDOW_FULLSCREEN; + + /* Setup the config based on SDL's current values. */ + i = 0; + attribs[i++] = EGL_RED_SIZE; + attribs[i++] = _this->gl_config.red_size; + attribs[i++] = EGL_GREEN_SIZE; + attribs[i++] = _this->gl_config.green_size; + attribs[i++] = EGL_BLUE_SIZE; + attribs[i++] = _this->gl_config.blue_size; + attribs[i++] = EGL_DEPTH_SIZE; + attribs[i++] = _this->gl_config.depth_size; + + if (_this->gl_config.alpha_size) { + attribs[i++] = EGL_ALPHA_SIZE; + attribs[i++] = _this->gl_config.alpha_size; + } + if (_this->gl_config.stencil_size) { + attribs[i++] = EGL_STENCIL_SIZE; + attribs[i++] = _this->gl_config.stencil_size; + } - EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs)); + attribs[i++] = EGL_NONE; - if (num_configs == 0) - { - SDL_SetError("No valid EGL configs for requested mode"); - return 0; - } + EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs)); - EGLCHK(eglGetConfigAttrib(display, config, EGL_WIDTH, &width)); - EGLCHK(eglGetConfigAttrib(display, config, EGL_HEIGHT, &height)); + if (num_configs == 0) { + SDL_SetError("No valid EGL configs for requested mode"); + return 0; + } - EGLCHK(context = eglCreateContext(display, config, NULL, NULL)); - EGLCHK(surface = eglCreateWindowSurface(display, config, 0, NULL)); - EGLCHK(eglMakeCurrent(display, surface, surface, context)); + EGLCHK(eglGetConfigAttrib(display, config, EGL_WIDTH, &width)); + EGLCHK(eglGetConfigAttrib(display, config, EGL_HEIGHT, &height)); - _this->gl_data->display = display; - _this->gl_data->context = context; - _this->gl_data->surface = surface; + EGLCHK(context = eglCreateContext(display, config, NULL, NULL)); + EGLCHK(surface = eglCreateWindowSurface(display, config, 0, NULL)); + EGLCHK(eglMakeCurrent(display, surface, surface, context)); + _this->gl_data->display = display; + _this->gl_data->context = context; + _this->gl_data->surface = surface; return context; } -int -PSP_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { - if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, - _this->gl_data->surface, _this->gl_data->context)) - { - return SDL_SetError("Unable to make EGL context current"); - } + if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, + _this->gl_data->surface, _this->gl_data->context)) { + return SDL_SetError("Unable to make EGL context current"); + } return 0; } -int -PSP_GL_SetSwapInterval(_THIS, int interval) +int PSP_GL_SetSwapInterval(_THIS, int interval) { EGLBoolean status; status = eglSwapInterval(_this->gl_data->display, interval); @@ -164,14 +152,12 @@ PSP_GL_SetSwapInterval(_THIS, int interval) return SDL_SetError("Unable to set the EGL swap interval"); } -int -PSP_GL_GetSwapInterval(_THIS) +int PSP_GL_GetSwapInterval(_THIS) { return _this->gl_data->swapinterval; } -int -PSP_GL_SwapWindow(_THIS, SDL_Window * window) +int PSP_GL_SwapWindow(_THIS, SDL_Window *window) { if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) { return SDL_SetError("eglSwapBuffers() failed"); @@ -179,10 +165,9 @@ PSP_GL_SwapWindow(_THIS, SDL_Window * window) return 0; } -void -PSP_GL_DeleteContext(_THIS, SDL_GLContext context) +void PSP_GL_DeleteContext(_THIS, SDL_GLContext context) { - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; EGLBoolean status; if (phdata->egl_initialized != SDL_TRUE) { diff --git a/src/video/psp/SDL_pspgl_c.h b/src/video/psp/SDL_pspgl_c.h index 06822f37e2287..e51aabc913db3 100644 --- a/src/video/psp/SDL_pspgl_c.h +++ b/src/video/psp/SDL_pspgl_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,33 +22,31 @@ #ifndef SDL_pspgl_c_h_ #define SDL_pspgl_c_h_ - #include #include #include "SDL_pspvideo.h" - -typedef struct SDL_GLDriverData { - EGLDisplay display; - EGLContext context; - EGLSurface surface; +typedef struct SDL_GLDriverData +{ + EGLDisplay display; + EGLContext context; + EGLSurface surface; uint32_t swapinterval; -}SDL_GLDriverData; +} SDL_GLDriverData; -extern void * PSP_GL_GetProcAddress(_THIS, const char *proc); -extern int PSP_GL_MakeCurrent(_THIS,SDL_Window * window, SDL_GLContext context); +extern void *PSP_GL_GetProcAddress(_THIS, const char *proc); +extern int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void PSP_GL_SwapBuffers(_THIS); -extern int PSP_GL_SwapWindow(_THIS, SDL_Window * window); -extern SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window * window); +extern int PSP_GL_SwapWindow(_THIS, SDL_Window *window); +extern SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window); extern int PSP_GL_LoadLibrary(_THIS, const char *path); extern void PSP_GL_UnloadLibrary(_THIS); extern int PSP_GL_SetSwapInterval(_THIS, int interval); extern int PSP_GL_GetSwapInterval(_THIS); - #endif /* SDL_pspgl_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/psp/SDL_pspmouse.c b/src/video/psp/SDL_pspmouse.c index 926f639774c12..ce7658c107672 100644 --- a/src/video/psp/SDL_pspmouse.c +++ b/src/video/psp/SDL_pspmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PSP +#ifdef SDL_VIDEO_DRIVER_PSP #include @@ -30,9 +30,9 @@ #include "SDL_pspmouse_c.h" - /* The implementation dependent data for the window manager cursor */ -struct WMcursor { +struct WMcursor +{ int unused; }; diff --git a/src/video/psp/SDL_pspmouse_c.h b/src/video/psp/SDL_pspmouse_c.h index 7ffee6f920712..7abe075a3aded 100644 --- a/src/video/psp/SDL_pspmouse_c.h +++ b/src/video/psp/SDL_pspmouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index de31a201214bf..bcf5491829b11 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_PSP +#ifdef SDL_VIDEO_DRIVER_PSP /* SDL internals */ #include "../SDL_sysvideo.h" @@ -29,9 +29,10 @@ #include "SDL_syswm.h" #include "SDL_loadso.h" #include "SDL_events.h" +#include "SDL_render.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_keyboard_c.h" - +#include "../../render/SDL_sysrender.h" /* PSP declarations */ @@ -39,44 +40,159 @@ #include "SDL_pspevents_c.h" #include "SDL_pspgl_c.h" +#include +#include +#include +#include +#include "../../render/psp/SDL_render_psp.h" + +#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData" + +typedef struct +{ + SDL_Renderer *renderer; + SDL_Texture *texture; + void *pixels; + int pitch; + int bytes_per_pixel; +} SDL_WindowTextureData; + +int PSP_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) +{ + SDL_RendererInfo info; + SDL_WindowTextureData *data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + int i, w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); + + if (w != PSP_SCREEN_WIDTH) { + return SDL_SetError("Unexpected window size"); + } + + if (!data) { + SDL_Renderer *renderer = NULL; + for (i = 0; i < SDL_GetNumRenderDrivers(); ++i) { + SDL_GetRenderDriverInfo(i, &info); + if (SDL_strcmp(info.name, "software") != 0) { + renderer = SDL_CreateRenderer(window, i, 0); + if (renderer && (SDL_GetRendererInfo(renderer, &info) == 0) && (info.flags & SDL_RENDERER_ACCELERATED)) { + break; /* this will work. */ + } + if (renderer) { /* wasn't accelerated, etc, skip it. */ + SDL_DestroyRenderer(renderer); + renderer = NULL; + } + } + } + if (!renderer) { + return SDL_SetError("No hardware accelerated renderers available"); + } + + SDL_assert(renderer != NULL); /* should have explicitly checked this above. */ + + /* Create the data after we successfully create the renderer (bug #1116) */ + data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data)); + + if (!data) { + SDL_DestroyRenderer(renderer); + return SDL_OutOfMemory(); + } + + SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data); + data->renderer = renderer; + } else { + if (SDL_GetRendererInfo(data->renderer, &info) == -1) { + return -1; + } + } + + /* Find the first format without an alpha channel */ + *format = info.texture_formats[0]; + + for (i = 0; i < (int)info.num_texture_formats; ++i) { + if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) && + !SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) { + *format = info.texture_formats[i]; + break; + } + } + + /* get the PSP renderer's "private" data */ + SDL_PSP_RenderGetProp(data->renderer, SDL_PSP_RENDERPROPS_FRONTBUFFER, &data->pixels); + + /* Create framebuffer data */ + data->bytes_per_pixel = SDL_BYTESPERPIXEL(*format); + /* since we point directly to VRAM's frontbuffer, we have to use + the upscaled pitch of 512 width - since PSP requires all textures to be + powers of 2. */ + data->pitch = 512 * data->bytes_per_pixel; + *pixels = data->pixels; + *pitch = data->pitch; + + /* Make sure we're not double-scaling the viewport */ + SDL_RenderSetViewport(data->renderer, NULL); + + return 0; +} + +int PSP_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) +{ + SDL_WindowTextureData *data; + data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data || !data->renderer || !window->surface) { + return -1; + } + data->renderer->RenderPresent(data->renderer); + SDL_PSP_RenderGetProp(data->renderer, SDL_PSP_RENDERPROPS_BACKBUFFER, &window->surface->pixels); + return 0; +} + +void PSP_DestroyWindowFramebuffer(_THIS, SDL_Window *window) +{ + SDL_WindowTextureData *data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA); + if (!data || !data->renderer) { + return; + } + SDL_DestroyRenderer(data->renderer); + data->renderer = NULL; +} + /* unused static SDL_bool PSP_initialized = SDL_FALSE; */ -static void -PSP_Destroy(SDL_VideoDevice * device) +static void PSP_Destroy(SDL_VideoDevice *device) { -/* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ + /* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ - if (device->driverdata != NULL) { + if (device->driverdata) { device->driverdata = NULL; } } -static SDL_VideoDevice * -PSP_Create() +static SDL_VideoDevice *PSP_Create() { SDL_VideoDevice *device; SDL_VideoData *phdata; SDL_GLDriverData *gldata; /* Initialize SDL_VideoDevice structure */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); + if (!device) { SDL_OutOfMemory(); return NULL; } /* Initialize internal PSP specific data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); return NULL; } - gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData)); - if (gldata == NULL) { + gldata = (SDL_GLDriverData *)SDL_calloc(1, sizeof(SDL_GLDriverData)); + if (!gldata) { SDL_OutOfMemory(); SDL_free(device); SDL_free(phdata); @@ -88,7 +204,6 @@ PSP_Create() phdata->egl_initialized = SDL_TRUE; - /* Setup amount of available displays */ device->num_displays = 0; @@ -132,28 +247,179 @@ PSP_Create() device->PumpEvents = PSP_PumpEvents; + /* backend to use VRAM directly as a framebuffer using + SDL_GetWindowSurface() API. */ + device->checked_texture_framebuffer = 1; + device->CreateWindowFramebuffer = PSP_CreateWindowFramebuffer; + device->UpdateWindowFramebuffer = PSP_UpdateWindowFramebuffer; + device->DestroyWindowFramebuffer = PSP_DestroyWindowFramebuffer; + return device; } +static void configure_dialog(pspUtilityMsgDialogParams *dialog, size_t dialog_size) +{ + /* clear structure and setup size */ + SDL_memset(dialog, 0, dialog_size); + dialog->base.size = dialog_size; + + /* set language */ + sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &dialog->base.language); + + /* set X/O swap */ + sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &dialog->base.buttonSwap); + + /* set thread priorities */ + /* TODO: understand how these work */ + dialog->base.soundThread = 0x10; + dialog->base.graphicsThread = 0x11; + dialog->base.fontThread = 0x12; + dialog->base.accessThread = 0x13; +} + +static void *setup_temporal_gu(void *list) +{ + // Using GU_PSM_8888 for the framebuffer + int bpp = 4; + + void *doublebuffer = vramalloc(PSP_FRAME_BUFFER_SIZE * bpp * 2); + void *backbuffer = doublebuffer; + void *frontbuffer = ((uint8_t *)doublebuffer) + PSP_FRAME_BUFFER_SIZE * bpp; + + sceGuInit(); + + sceGuStart(GU_DIRECT,list); + sceGuDrawBuffer(GU_PSM_8888, vrelptr(frontbuffer), PSP_FRAME_BUFFER_WIDTH); + sceGuDispBuffer(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT, vrelptr(backbuffer), PSP_FRAME_BUFFER_WIDTH); + + sceGuOffset(2048 - (PSP_SCREEN_WIDTH >> 1), 2048 - (PSP_SCREEN_HEIGHT >> 1)); + sceGuViewport(2048, 2048, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); + + sceGuDisable(GU_DEPTH_TEST); + + /* Scissoring */ + sceGuScissor(0, 0, PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT); + sceGuEnable(GU_SCISSOR_TEST); + + sceGuFinish(); + sceGuSync(0,0); + + sceDisplayWaitVblankStart(); + sceGuDisplay(GU_TRUE); + + return doublebuffer; +} + +static void term_temporal_gu(void *guBuffer) +{ + sceGuTerm(); + vfree(guBuffer); + sceDisplayWaitVblankStart(); +} + +int PSP_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +{ + unsigned char list[64] __attribute__((aligned(64))); + pspUtilityMsgDialogParams dialog; + int status; + void *guBuffer = NULL; + + /* check if it's possible to use existing video context */ + if (SDL_GetFocusWindow() == NULL) { + guBuffer = setup_temporal_gu(list); + } + + /* configure dialog */ + configure_dialog(&dialog, sizeof(dialog)); + + /* setup dialog options for text */ + dialog.mode = PSP_UTILITY_MSGDIALOG_MODE_TEXT; + dialog.options = PSP_UTILITY_MSGDIALOG_OPTION_TEXT; + + /* copy the message in, 512 bytes max */ + SDL_snprintf(dialog.message, sizeof(dialog.message), "%s\r\n\r\n%s", messageboxdata->title, messageboxdata->message); + + /* too many buttons */ + if (messageboxdata->numbuttons > 2) + return SDL_SetError("messageboxdata->numbuttons valid values are 0, 1, 2"); + + /* we only have two options, "yes/no" or "ok" */ + if (messageboxdata->numbuttons == 2) + dialog.options |= PSP_UTILITY_MSGDIALOG_OPTION_YESNO_BUTTONS | PSP_UTILITY_MSGDIALOG_OPTION_DEFAULT_NO; + + /* start dialog */ + if (sceUtilityMsgDialogInitStart(&dialog) != 0) + return SDL_SetError("sceUtilityMsgDialogInitStart() failed for some reason"); + + /* loop while the dialog is active */ + status = PSP_UTILITY_DIALOG_NONE; + do + { + sceGuStart(GU_DIRECT, list); + sceGuClearColor(0); + sceGuClearDepth(0); + sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT); + sceGuFinish(); + sceGuSync(0,0); + + status = sceUtilityMsgDialogGetStatus(); + + switch (status) + { + case PSP_UTILITY_DIALOG_VISIBLE: + sceUtilityMsgDialogUpdate(1); + break; + + case PSP_UTILITY_DIALOG_QUIT: + sceUtilityMsgDialogShutdownStart(); + break; + } + + sceDisplayWaitVblankStart(); + sceGuSwapBuffers(); + + } while (status != PSP_UTILITY_DIALOG_NONE); + + /* cleanup */ + if (guBuffer) + { + term_temporal_gu(guBuffer); + } + + /* success */ + if (dialog.buttonPressed == PSP_UTILITY_MSGDIALOG_RESULT_YES) + *buttonid = messageboxdata->buttons[0].buttonid; + else if (dialog.buttonPressed == PSP_UTILITY_MSGDIALOG_RESULT_NO) + *buttonid = messageboxdata->buttons[1].buttonid; + else + *buttonid = messageboxdata->buttons[0].buttonid; + + return 0; +} + VideoBootStrap PSP_bootstrap = { "PSP", "PSP Video Driver", - PSP_Create + PSP_Create, + PSP_ShowMessageBox }; /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -int -PSP_VideoInit(_THIS) +int PSP_VideoInit(_THIS) { SDL_VideoDisplay display; SDL_DisplayMode current_mode; + if (PSP_EventInit(_this) == -1) { + return -1; /* error string would already be set */ + } + SDL_zero(current_mode); - current_mode.w = 480; - current_mode.h = 272; + current_mode.w = PSP_SCREEN_WIDTH; + current_mode.h = PSP_SCREEN_HEIGHT; current_mode.refresh_rate = 60; /* 32 bpp for default */ @@ -174,46 +440,42 @@ PSP_VideoInit(_THIS) SDL_AddDisplayMode(&display, ¤t_mode); SDL_AddVideoDisplay(&display, SDL_FALSE); - return 1; + + return 0; } -void -PSP_VideoQuit(_THIS) +void PSP_VideoQuit(_THIS) { - + PSP_EventQuit(_this); } -void -PSP_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void PSP_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { - } -int -PSP_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -#define EGLCHK(stmt) \ - do { \ - EGLint err; \ - \ - stmt; \ - err = eglGetError(); \ - if (err != EGL_SUCCESS) { \ - SDL_SetError("EGL error %d", err); \ - return 0; \ - } \ +#define EGLCHK(stmt) \ + do { \ + EGLint err; \ + \ + stmt; \ + err = eglGetError(); \ + if (err != EGL_SUCCESS) { \ + SDL_SetError("EGL error %d", err); \ + return 0; \ + } \ } while (0) -int -PSP_CreateWindow(_THIS, SDL_Window * window) +int PSP_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *wdata; /* Allocate window internal data */ - wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { + wdata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!wdata) { return SDL_OutOfMemory(); } @@ -226,54 +488,42 @@ PSP_CreateWindow(_THIS, SDL_Window * window) return 0; } -int -PSP_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int PSP_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) { return SDL_Unsupported(); } -void -PSP_SetWindowTitle(_THIS, SDL_Window * window) +void PSP_SetWindowTitle(_THIS, SDL_Window *window) { } -void -PSP_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void PSP_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { } -void -PSP_SetWindowPosition(_THIS, SDL_Window * window) +void PSP_SetWindowPosition(_THIS, SDL_Window *window) { } -void -PSP_SetWindowSize(_THIS, SDL_Window * window) +void PSP_SetWindowSize(_THIS, SDL_Window *window) { } -void -PSP_ShowWindow(_THIS, SDL_Window * window) +void PSP_ShowWindow(_THIS, SDL_Window *window) { } -void -PSP_HideWindow(_THIS, SDL_Window * window) +void PSP_HideWindow(_THIS, SDL_Window *window) { } -void -PSP_RaiseWindow(_THIS, SDL_Window * window) +void PSP_RaiseWindow(_THIS, SDL_Window *window) { } -void -PSP_MaximizeWindow(_THIS, SDL_Window * window) +void PSP_MaximizeWindow(_THIS, SDL_Window *window) { } -void -PSP_MinimizeWindow(_THIS, SDL_Window * window) +void PSP_MinimizeWindow(_THIS, SDL_Window *window) { } -void -PSP_RestoreWindow(_THIS, SDL_Window * window) +void PSP_RestoreWindow(_THIS, SDL_Window *window) { } -void -PSP_DestroyWindow(_THIS, SDL_Window * window) +void PSP_DestroyWindow(_THIS, SDL_Window *window) { } @@ -281,8 +531,7 @@ PSP_DestroyWindow(_THIS, SDL_Window * window) /* SDL Window Manager function */ /*****************************************************************************/ #if 0 -SDL_bool -PSP_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool PSP_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { if (info->version.major <= SDL_MAJOR_VERSION) { return SDL_TRUE; @@ -298,13 +547,79 @@ PSP_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) #endif -/* TO Write Me */ -SDL_bool PSP_HasScreenKeyboardSupport(_THIS) + +SDL_bool PSP_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { - return SDL_FALSE; + return SDL_TRUE; } -void PSP_ShowScreenKeyboard(_THIS, SDL_Window *window) + +void PSP_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { + char list[0x20000] __attribute__((aligned(64))); // Needed for sceGuStart to work + int i; + int done = 0; + int input_text_length = 32; // SDL_SendKeyboardText supports up to 32 characters per event + unsigned short outtext[input_text_length]; + char text_string[input_text_length]; + + SceUtilityOskData data; + SceUtilityOskParams params; + + SDL_memset(outtext, 0, input_text_length * sizeof(unsigned short)); + + data.language = PSP_UTILITY_OSK_LANGUAGE_DEFAULT; + data.lines = 1; + data.unk_24 = 1; + data.inputtype = PSP_UTILITY_OSK_INPUTTYPE_ALL; + data.desc = NULL; + data.intext = NULL; + data.outtextlength = input_text_length; + data.outtextlimit = input_text_length; + data.outtext = outtext; + + params.base.size = sizeof(params); + sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, ¶ms.base.language); + sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, ¶ms.base.buttonSwap); + params.base.graphicsThread = 17; + params.base.accessThread = 19; + params.base.fontThread = 18; + params.base.soundThread = 16; + params.datacount = 1; + params.data = &data; + + sceUtilityOskInitStart(¶ms); + + while(!done) { + sceGuStart(GU_DIRECT, list); + sceGuClearColor(0); + sceGuClearDepth(0); + sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT); + sceGuFinish(); + sceGuSync(0,0); + + switch(sceUtilityOskGetStatus()) + { + case PSP_UTILITY_DIALOG_VISIBLE: + sceUtilityOskUpdate(1); + break; + case PSP_UTILITY_DIALOG_QUIT: + sceUtilityOskShutdownStart(); + break; + case PSP_UTILITY_DIALOG_NONE: + done = 1; + break; + default : + break; + } + sceDisplayWaitVblankStart(); + sceGuSwapBuffers(); + } + + // Convert input list to string + for (i = 0; i < input_text_length; i++) { + text_string[i] = outtext[i]; + } + SDL_SendKeyboardText((const char *) text_string); } void PSP_HideScreenKeyboard(_THIS, SDL_Window *window) { @@ -314,7 +629,6 @@ SDL_bool PSP_IsScreenKeyboardShown(_THIS, SDL_Window *window) return SDL_FALSE; } - #endif /* SDL_VIDEO_DRIVER_PSP */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/psp/SDL_pspvideo.h b/src/video/psp/SDL_pspvideo.h index e046c891ef713..ee150c6309b15 100644 --- a/src/video/psp/SDL_pspvideo.h +++ b/src/video/psp/SDL_pspvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,29 +29,22 @@ typedef struct SDL_VideoData { - SDL_bool egl_initialized; /* OpenGL ES device initialization status */ - uint32_t egl_refcount; /* OpenGL ES reference count */ - - + SDL_bool egl_initialized; /* OpenGL ES device initialization status */ + uint32_t egl_refcount; /* OpenGL ES reference count */ } SDL_VideoData; - typedef struct SDL_DisplayData { } SDL_DisplayData; - typedef struct SDL_WindowData { - SDL_bool uses_gles; /* if true window must support OpenGL ES */ + SDL_bool uses_gles; /* if true window must support OpenGL ES */ } SDL_WindowData; - - - /****************************************************************************/ /* SDL_VideoDevice functions declaration */ /****************************************************************************/ @@ -59,21 +52,29 @@ typedef struct SDL_WindowData /* Display and window functions */ int PSP_VideoInit(_THIS); void PSP_VideoQuit(_THIS); -void PSP_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int PSP_CreateWindow(_THIS, SDL_Window * window); -int PSP_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); -void PSP_SetWindowTitle(_THIS, SDL_Window * window); -void PSP_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); -void PSP_SetWindowPosition(_THIS, SDL_Window * window); -void PSP_SetWindowSize(_THIS, SDL_Window * window); -void PSP_ShowWindow(_THIS, SDL_Window * window); -void PSP_HideWindow(_THIS, SDL_Window * window); -void PSP_RaiseWindow(_THIS, SDL_Window * window); -void PSP_MaximizeWindow(_THIS, SDL_Window * window); -void PSP_MinimizeWindow(_THIS, SDL_Window * window); -void PSP_RestoreWindow(_THIS, SDL_Window * window); -void PSP_DestroyWindow(_THIS, SDL_Window * window); +void PSP_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +int PSP_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int PSP_CreateWindow(_THIS, SDL_Window *window); +int PSP_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); +void PSP_SetWindowTitle(_THIS, SDL_Window *window); +void PSP_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); +void PSP_SetWindowPosition(_THIS, SDL_Window *window); +void PSP_SetWindowSize(_THIS, SDL_Window *window); +void PSP_ShowWindow(_THIS, SDL_Window *window); +void PSP_HideWindow(_THIS, SDL_Window *window); +void PSP_RaiseWindow(_THIS, SDL_Window *window); +void PSP_MaximizeWindow(_THIS, SDL_Window *window); +void PSP_MinimizeWindow(_THIS, SDL_Window *window); +void PSP_RestoreWindow(_THIS, SDL_Window *window); +void PSP_DestroyWindow(_THIS, SDL_Window *window); + +/* "methods" aka callbacks for SDL_WindowSurface API */ +int PSP_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, + void **pixels, int *pitch); +int PSP_UpdateWindowFramebuffer(_THIS, SDL_Window *window, +const SDL_Rect *rects, int numrects); +void PSP_DestroyWindowFramebuffer(_THIS, SDL_Window *window); + /* Window manager function */ SDL_bool PSP_GetWindowWMInfo(_THIS, SDL_Window * window, @@ -83,11 +84,11 @@ SDL_bool PSP_GetWindowWMInfo(_THIS, SDL_Window * window, int PSP_GL_LoadLibrary(_THIS, const char *path); void *PSP_GL_GetProcAddress(_THIS, const char *proc); void PSP_GL_UnloadLibrary(_THIS); -SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window * window); -int PSP_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +SDL_GLContext PSP_GL_CreateContext(_THIS, SDL_Window *window); +int PSP_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int PSP_GL_SetSwapInterval(_THIS, int interval); int PSP_GL_GetSwapInterval(_THIS); -int PSP_GL_SwapWindow(_THIS, SDL_Window * window); +int PSP_GL_SwapWindow(_THIS, SDL_Window *window); void PSP_GL_DeleteContext(_THIS, SDL_GLContext context); /* PSP on screen keyboard */ diff --git a/src/video/qnx/gl.c b/src/video/qnx/gl.c index 1862ab425f5ca..e6e999a60712b 100644 --- a/src/video/qnx/gl.c +++ b/src/video/qnx/gl.c @@ -30,8 +30,7 @@ static EGLDisplay egl_disp; * @param egl_conf EGL configuration to use * @return A SCREEN_FORMAT* constant for the pixel format to use */ -static int -chooseFormat(EGLConfig egl_conf) +static int chooseFormat(EGLConfig egl_conf) { EGLint buffer_bit_depth; EGLint alpha_bit_depth; @@ -64,8 +63,7 @@ chooseFormat(EGLConfig egl_conf) * @param[out] pformat The chosen pixel format * @return 0 if successful, -1 on error */ -int -glGetConfig(EGLConfig *pconf, int *pformat) +int glGetConfig(EGLConfig *pconf, int *pformat) { EGLConfig egl_conf = (EGLConfig)0; EGLConfig *egl_configs; @@ -86,7 +84,7 @@ glGetConfig(EGLConfig *pconf, int *pformat) // Allocate enough memory for all configurations. egl_configs = SDL_malloc(egl_num_configs * sizeof(*egl_configs)); - if (egl_configs == NULL) { + if (!egl_configs) { return -1; } @@ -132,8 +130,7 @@ glGetConfig(EGLConfig *pconf, int *pformat) * @param name unused * @return 0 if successful, -1 on error */ -int -glLoadLibrary(_THIS, const char *name) +int glLoadLibrary(_THIS, const char *name) { EGLNativeDisplayType disp_id = EGL_DEFAULT_DISPLAY; @@ -154,8 +151,7 @@ glLoadLibrary(_THIS, const char *name) * @param proc Function name * @return Function address */ -void * -glGetProcAddress(_THIS, const char *proc) +void *glGetProcAddress(_THIS, const char *proc) { return eglGetProcAddress(proc); } @@ -167,8 +163,7 @@ glGetProcAddress(_THIS, const char *proc) * @param window The SDL window to create the context for * @return A pointer to the created context, if successful, NULL on error */ -SDL_GLContext -glCreateContext(_THIS, SDL_Window *window) +SDL_GLContext glCreateContext(_THIS, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; EGLContext context; @@ -214,8 +209,7 @@ glCreateContext(_THIS, SDL_Window *window) * @param interval New interval value * @return 0 if successful, -1 on error */ -int -glSetSwapInterval(_THIS, int interval) +int glSetSwapInterval(_THIS, int interval) { if (eglSwapInterval(egl_disp, interval) != EGL_TRUE) { return -1; @@ -230,8 +224,7 @@ glSetSwapInterval(_THIS, int interval) * @param window Window to swap buffers for * @return 0 if successful, -1 on error */ -int -glSwapWindow(_THIS, SDL_Window *window) +int glSwapWindow(_THIS, SDL_Window *window) { /* !!! FIXME: should we migrate this all over to use SDL_egl.c? */ window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -245,8 +238,7 @@ glSwapWindow(_THIS, SDL_Window *window) * @param context The context to activate * @return 0 if successful, -1 on error */ -int -glMakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) +int glMakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { window_impl_t *impl; EGLSurface surface = NULL; @@ -268,8 +260,7 @@ glMakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) * @param _THIS * @param context The context to destroy */ -void -glDeleteContext(_THIS, SDL_GLContext context) +void glDeleteContext(_THIS, SDL_GLContext context) { eglDestroyContext(egl_disp, context); } @@ -278,8 +269,7 @@ glDeleteContext(_THIS, SDL_GLContext context) * Terminates access to the EGL library. * @param _THIS */ -void -glUnloadLibrary(_THIS) +void glUnloadLibrary(_THIS) { eglTerminate(egl_disp); } diff --git a/src/video/qnx/keyboard.c b/src/video/qnx/keyboard.c index 86c6395bafed1..9ec289d4431d7 100644 --- a/src/video/qnx/keyboard.c +++ b/src/video/qnx/keyboard.c @@ -95,8 +95,7 @@ static int key_to_sdl[] = { * Translates the event such that it can be handled by SDL. * @param event Screen keyboard event */ -void -handleKeyboardEvent(screen_event_t event) +void handleKeyboardEvent(screen_event_t event) { int val; SDL_Scancode scancode; diff --git a/src/video/qnx/video.c b/src/video/qnx/video.c index 049d814040bf5..924eaa3078deb 100644 --- a/src/video/qnx/video.c +++ b/src/video/qnx/video.c @@ -32,8 +32,7 @@ static screen_event_t event; * @param _THIS * @return 0 if successful, -1 on error */ -static int -videoInit(_THIS) +static int videoInit(_THIS) { SDL_VideoDisplay display; @@ -55,8 +54,7 @@ videoInit(_THIS) return 0; } -static void -videoQuit(_THIS) +static void videoQuit(_THIS) { } @@ -67,8 +65,7 @@ videoQuit(_THIS) * @param window SDL window to initialize * @return 0 if successful, -1 on error */ -static int -createWindow(_THIS, SDL_Window *window) +static int createWindow(_THIS, SDL_Window *window) { window_impl_t *impl; int size[2]; @@ -77,7 +74,7 @@ createWindow(_THIS, SDL_Window *window) int usage; impl = SDL_calloc(1, sizeof(*impl)); - if (impl == NULL) { + if (!impl) { return -1; } @@ -150,8 +147,7 @@ createWindow(_THIS, SDL_Window *window) * @param[out] pitch Holds the number of bytes per line * @return 0 if successful, -1 on error */ -static int -createWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, +static int createWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -186,8 +182,7 @@ createWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, * @param numrects Rect array length * @return 0 if successful, -1 on error */ -static int -updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, +static int updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -207,8 +202,7 @@ updateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, * Runs the main event loop. * @param _THIS */ -static void -pumpEvents(_THIS) +static void pumpEvents(_THIS) { int type; @@ -242,8 +236,7 @@ pumpEvents(_THIS) * @param _THIS * @param window SDL window to update */ -static void -setWindowSize(_THIS, SDL_Window *window) +static void setWindowSize(_THIS, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; int size[2]; @@ -261,8 +254,7 @@ setWindowSize(_THIS, SDL_Window *window) * @param _THIS * @param window SDL window to update */ -static void -showWindow(_THIS, SDL_Window *window) +static void showWindow(_THIS, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 1; @@ -276,8 +268,7 @@ showWindow(_THIS, SDL_Window *window) * @param _THIS * @param window SDL window to update */ -static void -hideWindow(_THIS, SDL_Window *window) +static void hideWindow(_THIS, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; const int visible = 0; @@ -291,8 +282,7 @@ hideWindow(_THIS, SDL_Window *window) * @param _THIS * @param window SDL window that is being destroyed */ -static void -destroyWindow(_THIS, SDL_Window *window) +static void destroyWindow(_THIS, SDL_Window *window) { window_impl_t *impl = (window_impl_t *)window->driverdata; @@ -306,8 +296,7 @@ destroyWindow(_THIS, SDL_Window *window) * Frees the plugin object created by createDevice(). * @param device Plugin object to free */ -static void -deleteDevice(SDL_VideoDevice *device) +static void deleteDevice(SDL_VideoDevice *device) { SDL_free(device); } @@ -317,13 +306,12 @@ deleteDevice(SDL_VideoDevice *device) * @param devindex Unused * @return Initialized device if successful, NULL otherwise */ -static SDL_VideoDevice * -createDevice(int devindex) +static SDL_VideoDevice *createDevice(int devindex) { SDL_VideoDevice *device; device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + if (!device) { return NULL; } @@ -354,5 +342,6 @@ createDevice(int devindex) VideoBootStrap QNX_bootstrap = { "qnx", "QNX Screen", - createDevice + createDevice, + NULL /* no ShowMessageBox implementation */ }; diff --git a/src/video/raspberry/SDL_rpievents.c b/src/video/raspberry/SDL_rpievents.c index c1c7bb7240c09..d97fb83660e28 100644 --- a/src/video/raspberry/SDL_rpievents.c +++ b/src/video/raspberry/SDL_rpievents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI #include "../../events/SDL_events_c.h" #include "../../events/SDL_keyboard_c.h" @@ -38,8 +38,6 @@ void RPI_PumpEvents(_THIS) #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Poll(); #endif - } #endif /* SDL_VIDEO_DRIVER_RPI */ - diff --git a/src/video/raspberry/SDL_rpievents_c.h b/src/video/raspberry/SDL_rpievents_c.h index 9bec91529ca42..7f8aec29044f8 100644 --- a/src/video/raspberry/SDL_rpievents_c.h +++ b/src/video/raspberry/SDL_rpievents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,5 @@ #include "SDL_rpivideo.h" void RPI_PumpEvents(_THIS); -void RPI_EventInit(_THIS); -void RPI_EventQuit(_THIS); #endif /* SDL_rpievents_c_h_ */ diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index 7614fb8c0c955..ea390490e67c4 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI #include "SDL_surface.h" #include "SDL_hints.h" @@ -34,50 +34,48 @@ /* Copied from vc_vchi_dispmanx.h which is bugged and tries to include a non existing file */ /* Attributes changes flag mask */ -#define ELEMENT_CHANGE_LAYER (1<<0) -#define ELEMENT_CHANGE_OPACITY (1<<1) -#define ELEMENT_CHANGE_DEST_RECT (1<<2) -#define ELEMENT_CHANGE_SRC_RECT (1<<3) -#define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) -#define ELEMENT_CHANGE_TRANSFORM (1<<5) +#define ELEMENT_CHANGE_LAYER (1 << 0) +#define ELEMENT_CHANGE_OPACITY (1 << 1) +#define ELEMENT_CHANGE_DEST_RECT (1 << 2) +#define ELEMENT_CHANGE_SRC_RECT (1 << 3) +#define ELEMENT_CHANGE_MASK_RESOURCE (1 << 4) +#define ELEMENT_CHANGE_TRANSFORM (1 << 5) /* End copied from vc_vchi_dispmanx.h */ static SDL_Cursor *RPI_CreateDefaultCursor(void); -static SDL_Cursor *RPI_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y); -static int RPI_ShowCursor(SDL_Cursor * cursor); -static void RPI_MoveCursor(SDL_Cursor * cursor); -static void RPI_FreeCursor(SDL_Cursor * cursor); -static void RPI_WarpMouse(SDL_Window * window, int x, int y); +static SDL_Cursor *RPI_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y); +static int RPI_ShowCursor(SDL_Cursor *cursor); +static void RPI_MoveCursor(SDL_Cursor *cursor); +static void RPI_FreeCursor(SDL_Cursor *cursor); +static void RPI_WarpMouse(SDL_Window *window, int x, int y); static int RPI_WarpMouseGlobal(int x, int y); static SDL_Cursor *global_cursor; -static SDL_Cursor * -RPI_CreateDefaultCursor(void) +static SDL_Cursor *RPI_CreateDefaultCursor(void) { return SDL_CreateCursor(default_cdata, default_cmask, DEFAULT_CWIDTH, DEFAULT_CHEIGHT, DEFAULT_CHOTX, DEFAULT_CHOTY); } /* Create a cursor from a surface */ -static SDL_Cursor * -RPI_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *RPI_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { RPI_CursorData *curdata; SDL_Cursor *cursor; int ret; VC_RECT_T dst_rect; Uint32 dummy; - + SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); - - cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); - if (cursor == NULL) { + + cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); + if (!cursor) { SDL_OutOfMemory(); return NULL; } - curdata = (RPI_CursorData *) SDL_calloc(1, sizeof(*curdata)); - if (curdata == NULL) { + curdata = (RPI_CursorData *)SDL_calloc(1, sizeof(*curdata)); + if (!curdata) { SDL_OutOfMemory(); SDL_free(cursor); return NULL; @@ -87,29 +85,27 @@ RPI_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) curdata->hot_y = hot_y; curdata->w = surface->w; curdata->h = surface->h; - + /* This usage is inspired by Wayland/Weston RPI code, how they figured this out is anyone's guess */ curdata->resource = vc_dispmanx_resource_create(VC_IMAGE_ARGB8888, surface->w | (surface->pitch << 16), surface->h | (surface->h << 16), &dummy); SDL_assert(curdata->resource); vc_dispmanx_rect_set(&dst_rect, 0, 0, curdata->w, curdata->h); - /* A note from Weston: + /* A note from Weston: * vc_dispmanx_resource_write_data() ignores ifmt, * rect.x, rect.width, and uses stride only for computing * the size of the transfer as rect.height * stride. * Therefore we can only write rows starting at x=0. */ ret = vc_dispmanx_resource_write_data(curdata->resource, VC_IMAGE_ARGB8888, surface->pitch, surface->pixels, &dst_rect); - SDL_assert (ret == DISPMANX_SUCCESS); - + SDL_assert(ret == DISPMANX_SUCCESS); + cursor->driverdata = curdata; - - return cursor; + return cursor; } /* Show the specified cursor, or hide if cursor is NULL */ -static int -RPI_ShowCursor(SDL_Cursor * cursor) +static int RPI_ShowCursor(SDL_Cursor *cursor) { int ret; DISPMANX_UPDATE_HANDLE_T update; @@ -118,18 +114,18 @@ RPI_ShowCursor(SDL_Cursor * cursor) SDL_Mouse *mouse; SDL_VideoDisplay *display; SDL_DisplayData *data; - VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE /* flags */ , 255 /*opacity 0->255*/, 0 /* mask */ }; + VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE /* flags */, 255 /*opacity 0->255*/, 0 /* mask */ }; uint32_t layer = SDL_RPI_MOUSELAYER; const char *env; mouse = SDL_GetMouse(); - if (mouse == NULL) { + if (!mouse) { return -1; } - + if (cursor != global_cursor) { - if (global_cursor != NULL) { - curdata = (RPI_CursorData *) global_cursor->driverdata; + if (global_cursor) { + curdata = (RPI_CursorData *)global_cursor->driverdata; if (curdata && curdata->element > DISPMANX_NO_HANDLE) { update = vc_dispmanx_update_start(0); SDL_assert(update); @@ -143,33 +139,33 @@ RPI_ShowCursor(SDL_Cursor * cursor) global_cursor = cursor; } - if (cursor == NULL) { + if (!cursor) { return 0; } - - curdata = (RPI_CursorData *) cursor->driverdata; - if (curdata == NULL) { + + curdata = (RPI_CursorData *)cursor->driverdata; + if (!curdata) { return -1; } - - if (mouse->focus == NULL) { + + if (!mouse->focus) { return -1; } display = SDL_GetDisplayForWindow(mouse->focus); - if (display == NULL) { + if (!display) { return -1; } - - data = (SDL_DisplayData*) display->driverdata; - if (data == NULL) { + + data = (SDL_DisplayData *)display->driverdata; + if (!data) { return -1; } - + if (curdata->element == DISPMANX_NO_HANDLE) { vc_dispmanx_rect_set(&src_rect, 0, 0, curdata->w << 16, curdata->h << 16); vc_dispmanx_rect_set(&dst_rect, mouse->x - curdata->hot_x, mouse->y - curdata->hot_y, curdata->w, curdata->h); - + update = vc_dispmanx_update_start(0); SDL_assert(update); @@ -179,35 +175,34 @@ RPI_ShowCursor(SDL_Cursor * cursor) } curdata->element = vc_dispmanx_element_add(update, - data->dispman_display, - layer, - &dst_rect, - curdata->resource, - &src_rect, - DISPMANX_PROTECTION_NONE, - &alpha, - DISPMANX_NO_HANDLE, // clamp - DISPMANX_NO_ROTATE); + data->dispman_display, + layer, + &dst_rect, + curdata->resource, + &src_rect, + DISPMANX_PROTECTION_NONE, + &alpha, + DISPMANX_NO_HANDLE, // clamp + DISPMANX_NO_ROTATE); SDL_assert(curdata->element > DISPMANX_NO_HANDLE); ret = vc_dispmanx_update_submit_sync(update); SDL_assert(ret == DISPMANX_SUCCESS); } - + return 0; } /* Free a window manager cursor */ -static void -RPI_FreeCursor(SDL_Cursor * cursor) +static void RPI_FreeCursor(SDL_Cursor *cursor) { int ret; DISPMANX_UPDATE_HANDLE_T update; RPI_CursorData *curdata; - - if (cursor != NULL) { - curdata = (RPI_CursorData *) cursor->driverdata; - - if (curdata != NULL) { + + if (cursor) { + curdata = (RPI_CursorData *)cursor->driverdata; + + if (curdata) { if (curdata->element != DISPMANX_NO_HANDLE) { update = vc_dispmanx_update_start(0); SDL_assert(update); @@ -216,12 +211,12 @@ RPI_FreeCursor(SDL_Cursor * cursor) ret = vc_dispmanx_update_submit_sync(update); SDL_assert(ret == DISPMANX_SUCCESS); } - + if (curdata->resource != DISPMANX_NO_HANDLE) { ret = vc_dispmanx_resource_delete(curdata->resource); SDL_assert(ret == DISPMANX_SUCCESS); } - + SDL_free(cursor->driverdata); } SDL_free(cursor); @@ -232,15 +227,13 @@ RPI_FreeCursor(SDL_Cursor * cursor) } /* Warp the mouse to (x,y) */ -static void -RPI_WarpMouse(SDL_Window * window, int x, int y) +static void RPI_WarpMouse(SDL_Window *window, int x, int y) { RPI_WarpMouseGlobal(x, y); } /* Warp the mouse to (x,y) */ -static int -RPI_WarpMouseGlobal(int x, int y) +static int RPI_WarpMouseGlobal(int x, int y) { RPI_CursorData *curdata; DISPMANX_UPDATE_HANDLE_T update; @@ -248,15 +241,15 @@ RPI_WarpMouseGlobal(int x, int y) VC_RECT_T dst_rect; VC_RECT_T src_rect; SDL_Mouse *mouse = SDL_GetMouse(); - - if (mouse == NULL || mouse->cur_cursor == NULL || mouse->cur_cursor->driverdata == NULL) { + + if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) { return 0; } /* Update internal mouse position. */ SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 0, x, y); - curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata; + curdata = (RPI_CursorData *)mouse->cur_cursor->driverdata; if (curdata->element == DISPMANX_NO_HANDLE) { return 0; } @@ -268,11 +261,11 @@ RPI_WarpMouseGlobal(int x, int y) src_rect.x = 0; src_rect.y = 0; - src_rect.width = curdata->w << 16; + src_rect.width = curdata->w << 16; src_rect.height = curdata->h << 16; dst_rect.x = x - curdata->hot_x; dst_rect.y = y - curdata->hot_y; - dst_rect.width = curdata->w; + dst_rect.width = curdata->w; dst_rect.height = curdata->h; ret = vc_dispmanx_element_change_attributes( @@ -298,8 +291,7 @@ RPI_WarpMouseGlobal(int x, int y) } /* Warp the mouse to (x,y) */ -static int -RPI_WarpMouseGlobalGraphicOnly(int x, int y) +static int RPI_WarpMouseGlobalGraphicOnly(int x, int y) { RPI_CursorData *curdata; DISPMANX_UPDATE_HANDLE_T update; @@ -307,12 +299,12 @@ RPI_WarpMouseGlobalGraphicOnly(int x, int y) VC_RECT_T dst_rect; VC_RECT_T src_rect; SDL_Mouse *mouse = SDL_GetMouse(); - - if (mouse == NULL || mouse->cur_cursor == NULL || mouse->cur_cursor->driverdata == NULL) { + + if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) { return 0; } - curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata; + curdata = (RPI_CursorData *)mouse->cur_cursor->driverdata; if (curdata->element == DISPMANX_NO_HANDLE) { return 0; } @@ -324,11 +316,11 @@ RPI_WarpMouseGlobalGraphicOnly(int x, int y) src_rect.x = 0; src_rect.y = 0; - src_rect.width = curdata->w << 16; + src_rect.width = curdata->w << 16; src_rect.height = curdata->h << 16; dst_rect.x = x - curdata->hot_x; dst_rect.y = y - curdata->hot_y; - dst_rect.width = curdata->w; + dst_rect.width = curdata->w; dst_rect.height = curdata->h; ret = vc_dispmanx_element_change_attributes( @@ -353,10 +345,9 @@ RPI_WarpMouseGlobalGraphicOnly(int x, int y) return 0; } -void -RPI_InitMouse(_THIS) +void RPI_InitMouse(_THIS) { - /* FIXME: Using UDEV it should be possible to scan all mice + /* FIXME: Using UDEV it should be possible to scan all mice * but there's no point in doing so as there's no multimice support...yet! */ SDL_Mouse *mouse = SDL_GetMouse(); @@ -371,17 +362,15 @@ RPI_InitMouse(_THIS) SDL_SetDefaultCursor(RPI_CreateDefaultCursor()); } -void -RPI_QuitMouse(_THIS) +void RPI_QuitMouse(_THIS) { } /* This is called when a mouse motion event occurs */ -static void -RPI_MoveCursor(SDL_Cursor * cursor) +static void RPI_MoveCursor(SDL_Cursor *cursor) { SDL_Mouse *mouse = SDL_GetMouse(); - /* We must NOT call SDL_SendMouseMotion() on the next call or we will enter recursivity, + /* We must NOT call SDL_SendMouseMotion() on the next call or we will enter recursivity, * so we create a version of WarpMouseGlobal without it. */ RPI_WarpMouseGlobalGraphicOnly(mouse->x, mouse->y); } diff --git a/src/video/raspberry/SDL_rpimouse.h b/src/video/raspberry/SDL_rpimouse.h index 40701e126a6f9..717b6b4f9b3d8 100644 --- a/src/video/raspberry/SDL_rpimouse.h +++ b/src/video/raspberry/SDL_rpimouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,13 +27,13 @@ typedef struct _RPI_CursorData RPI_CursorData; struct _RPI_CursorData { - DISPMANX_RESOURCE_HANDLE_T resource; - DISPMANX_ELEMENT_HANDLE_T element; - int hot_x, hot_y; - int w, h; + DISPMANX_RESOURCE_HANDLE_T resource; + DISPMANX_ELEMENT_HANDLE_T element; + int hot_x, hot_y; + int w, h; }; -#define SDL_RPI_CURSORDATA(curs) RPI_CursorData *curdata = (RPI_CursorData *) ((curs) ? (curs)->driverdata : NULL) +#define SDL_RPI_CURSORDATA(curs) RPI_CursorData *curdata = (RPI_CursorData *)((curs) ? (curs)->driverdata : NULL) extern void RPI_InitMouse(_THIS); extern void RPI_QuitMouse(_THIS); diff --git a/src/video/raspberry/SDL_rpiopengles.c b/src/video/raspberry/SDL_rpiopengles.c index 7b62b3e43907a..91fe9f807d316 100644 --- a/src/video/raspberry/SDL_rpiopengles.c +++ b/src/video/raspberry/SDL_rpiopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,29 +22,28 @@ #include "SDL_hints.h" -#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_RPI) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_rpivideo.h" #include "SDL_rpiopengles.h" /* EGL implementation of SDL OpenGL support */ -void -RPI_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) +void RPI_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) { *mask = SDL_GL_CONTEXT_PROFILE_ES; *major = 2; *minor = 0; } -int -RPI_GLES_LoadLibrary(_THIS, const char *path) { +int RPI_GLES_LoadLibrary(_THIS, const char *path) +{ return SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY, 0); } -int -RPI_GLES_SwapWindow(_THIS, SDL_Window * window) { - SDL_WindowData *wdata = ((SDL_WindowData *) window->driverdata); +int RPI_GLES_SwapWindow(_THIS, SDL_Window *window) +{ + SDL_WindowData *wdata = ((SDL_WindowData *)window->driverdata); if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed."); @@ -63,9 +62,8 @@ RPI_GLES_SwapWindow(_THIS, SDL_Window * window) { } SDL_EGL_CreateContext_impl(RPI) -SDL_EGL_MakeCurrent_impl(RPI) + SDL_EGL_MakeCurrent_impl(RPI) #endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */ -/* vi: set ts=4 sw=4 expandtab: */ - + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/raspberry/SDL_rpiopengles.h b/src/video/raspberry/SDL_rpiopengles.h index 2cdf0fdcf8274..73f064237cd47 100644 --- a/src/video/raspberry/SDL_rpiopengles.h +++ b/src/video/raspberry/SDL_rpiopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_rpiopengles_h_ #define SDL_rpiopengles_h_ -#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_RPI) && defined(SDL_VIDEO_OPENGL_EGL) #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -34,12 +34,12 @@ #define RPI_GLES_UnloadLibrary SDL_EGL_UnloadLibrary #define RPI_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define RPI_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define RPI_GLES_DeleteContext SDL_EGL_DeleteContext +#define RPI_GLES_DeleteContext SDL_EGL_DeleteContext extern int RPI_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window); -extern int RPI_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window *window); +extern int RPI_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int RPI_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void RPI_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor); #endif /* SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/raspberry/SDL_rpivideo.c b/src/video/raspberry/SDL_rpivideo.c index 4503f56df0882..1604adb611f98 100644 --- a/src/video/raspberry/SDL_rpivideo.c +++ b/src/video/raspberry/SDL_rpivideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RPI +#ifdef SDL_VIDEO_DRIVER_RPI /* References * http://elinux.org/RPi_VideoCore_APIs @@ -50,46 +50,41 @@ #include "SDL_rpiopengles.h" #include "SDL_rpimouse.h" -static void -RPI_Destroy(SDL_VideoDevice * device) +static void RPI_Destroy(SDL_VideoDevice *device) { SDL_free(device->driverdata); SDL_free(device); } -static int -RPI_GetRefreshRate() +static int RPI_GetRefreshRate(void) { TV_DISPLAY_STATE_T tvstate; - if (vc_tv_get_display_state( &tvstate ) == 0) { - //The width/height parameters are in the same position in the union - //for HDMI and SDTV + if (vc_tv_get_display_state(&tvstate) == 0) { + // The width/height parameters are in the same position in the union + // for HDMI and SDTV HDMI_PROPERTY_PARAM_T property; property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; vc_tv_hdmi_get_property(&property); - return property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? - tvstate.display.hdmi.frame_rate * (1000.0f/1001.0f) : - tvstate.display.hdmi.frame_rate; - } - return 60; /* Failed to get display state, default to 60 */ + return property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tvstate.display.hdmi.frame_rate * (1000.0f / 1001.0f) : tvstate.display.hdmi.frame_rate; + } + return 60; /* Failed to get display state, default to 60 */ } -static SDL_VideoDevice * -RPI_Create() +static SDL_VideoDevice *RPI_Create() { SDL_VideoDevice *device; SDL_VideoData *phdata; /* Initialize SDL_VideoDevice structure */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); + if (!device) { SDL_OutOfMemory(); return NULL; } /* Initialize internal data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); return NULL; @@ -143,16 +138,15 @@ RPI_Create() VideoBootStrap RPI_bootstrap = { "RPI", "RPI Video Driver", - RPI_Create + RPI_Create, + NULL /* no ShowMessageBox implementation */ }; - /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -static void -AddDispManXDisplay(const int display_id) +static void AddDispManXDisplay(const int display_id) { DISPMANX_MODEINFO_T modeinfo; DISPMANX_DISPLAY_HANDLE_T handle; @@ -162,7 +156,7 @@ AddDispManXDisplay(const int display_id) handle = vc_dispmanx_display_open(display_id); if (!handle) { - return; /* this display isn't available */ + return; /* this display isn't available */ } if (vc_dispmanx_display_get_info(handle, &modeinfo) < 0) { @@ -185,10 +179,10 @@ AddDispManXDisplay(const int display_id) display.current_mode = current_mode; /* Allocate display internal data */ - data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData)); - if (data == NULL) { + data = (SDL_DisplayData *)SDL_calloc(1, sizeof(SDL_DisplayData)); + if (!data) { vc_dispmanx_display_close(handle); - return; /* oh well */ + return; /* oh well */ } data->dispman_display = handle; @@ -198,82 +192,76 @@ AddDispManXDisplay(const int display_id) SDL_AddVideoDisplay(&display, SDL_FALSE); } -int -RPI_VideoInit(_THIS) +int RPI_VideoInit(_THIS) { /* Initialize BCM Host */ bcm_host_init(); - AddDispManXDisplay(DISPMANX_ID_MAIN_LCD); /* your default display */ - AddDispManXDisplay(DISPMANX_ID_FORCE_OTHER); /* an "other" display...maybe DSI-connected screen while HDMI is your main */ + AddDispManXDisplay(DISPMANX_ID_MAIN_LCD); /* your default display */ + AddDispManXDisplay(DISPMANX_ID_FORCE_OTHER); /* an "other" display...maybe DSI-connected screen while HDMI is your main */ -#ifdef SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV if (SDL_EVDEV_Init() < 0) { return -1; } -#endif - +#endif + RPI_InitMouse(_this); return 1; } -void -RPI_VideoQuit(_THIS) +void RPI_VideoQuit(_THIS) { -#ifdef SDL_INPUT_LINUXEV +#ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Quit(); -#endif +#endif } -void -RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void RPI_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { /* Only one display mode available, the current one */ SDL_AddDisplayMode(display, &display->current_mode); } -int -RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -static void -RPI_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data) +static void RPI_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data) { - SDL_WindowData *wdata = ((SDL_WindowData *) data); + SDL_WindowData *wdata = ((SDL_WindowData *)data); - SDL_LockMutex(wdata->vsync_cond_mutex); - SDL_CondSignal(wdata->vsync_cond); - SDL_UnlockMutex(wdata->vsync_cond_mutex); + SDL_LockMutex(wdata->vsync_cond_mutex); + SDL_CondSignal(wdata->vsync_cond); + SDL_UnlockMutex(wdata->vsync_cond_mutex); } -int -RPI_CreateWindow(_THIS, SDL_Window * window) +int RPI_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *wdata; SDL_VideoDisplay *display; SDL_DisplayData *displaydata; VC_RECT_T dst_rect; VC_RECT_T src_rect; - VC_DISPMANX_ALPHA_T dispman_alpha; + VC_DISPMANX_ALPHA_T dispman_alpha; DISPMANX_UPDATE_HANDLE_T dispman_update; uint32_t layer = SDL_RPI_VIDEOLAYER; const char *env; /* Disable alpha, otherwise the app looks composed with whatever dispman is showing (X11, console,etc) */ - dispman_alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; - dispman_alpha.opacity = 0xFF; + dispman_alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; + dispman_alpha.opacity = 0xFF; dispman_alpha.mask = 0; /* Allocate window internal data */ - wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { + wdata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!wdata) { return SDL_OutOfMemory(); } display = SDL_GetDisplayForWindow(window); - displaydata = (SDL_DisplayData *) display->driverdata; + displaydata = (SDL_DisplayData *)display->driverdata; /* Windows have one size for now */ window->w = display->desktop_mode.w; @@ -298,27 +286,27 @@ RPI_CreateWindow(_THIS, SDL_Window * window) layer = SDL_atoi(env); } - dispman_update = vc_dispmanx_update_start( 0 ); - wdata->dispman_window.element = vc_dispmanx_element_add (dispman_update, - displaydata->dispman_display, - layer /* layer */, - &dst_rect, - 0 /*src*/, - &src_rect, - DISPMANX_PROTECTION_NONE, - &dispman_alpha /*alpha*/, - 0 /*clamp*/, - 0 /*transform*/); + dispman_update = vc_dispmanx_update_start(0); + wdata->dispman_window.element = vc_dispmanx_element_add(dispman_update, + displaydata->dispman_display, + layer /* layer */, + &dst_rect, + 0 /*src*/, + &src_rect, + DISPMANX_PROTECTION_NONE, + &dispman_alpha /*alpha*/, + 0 /*clamp*/, + 0 /*transform*/); wdata->dispman_window.width = window->w; wdata->dispman_window.height = window->h; vc_dispmanx_update_submit_sync(dispman_update); - + if (!_this->egl_data) { if (SDL_GL_LoadLibrary(NULL) < 0) { return -1; } } - wdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) &wdata->dispman_window); + wdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)&wdata->dispman_window); if (wdata->egl_surface == EGL_NO_SURFACE) { return SDL_SetError("Could not create GLES window surface"); @@ -330,7 +318,7 @@ RPI_CreateWindow(_THIS, SDL_Window * window) wdata->vsync_cond = SDL_CreateCond(); wdata->vsync_cond_mutex = SDL_CreateMutex(); wdata->double_buffer = SDL_TRUE; - vc_dispmanx_vsync_callback(displaydata->dispman_display, RPI_vsync_callback, (void*)wdata); + vc_dispmanx_vsync_callback(displaydata->dispman_display, RPI_vsync_callback, (void *)wdata); } /* Setup driver data for this window */ @@ -344,14 +332,13 @@ RPI_CreateWindow(_THIS, SDL_Window * window) return 0; } -void -RPI_DestroyWindow(_THIS, SDL_Window * window) +void RPI_DestroyWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; - if(data) { + if (data) { if (data->double_buffer) { /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */ SDL_LockMutex(data->vsync_cond_mutex); @@ -364,7 +351,7 @@ RPI_DestroyWindow(_THIS, SDL_Window * window) SDL_DestroyMutex(data->vsync_cond_mutex); } -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); } @@ -374,50 +361,39 @@ RPI_DestroyWindow(_THIS, SDL_Window * window) } } -int -RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int RPI_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) { return -1; } -void -RPI_SetWindowTitle(_THIS, SDL_Window * window) +void RPI_SetWindowTitle(_THIS, SDL_Window *window) { } -void -RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void RPI_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { } -void -RPI_SetWindowPosition(_THIS, SDL_Window * window) +void RPI_SetWindowPosition(_THIS, SDL_Window *window) { } -void -RPI_SetWindowSize(_THIS, SDL_Window * window) +void RPI_SetWindowSize(_THIS, SDL_Window *window) { } -void -RPI_ShowWindow(_THIS, SDL_Window * window) +void RPI_ShowWindow(_THIS, SDL_Window *window) { } -void -RPI_HideWindow(_THIS, SDL_Window * window) +void RPI_HideWindow(_THIS, SDL_Window *window) { } -void -RPI_RaiseWindow(_THIS, SDL_Window * window) +void RPI_RaiseWindow(_THIS, SDL_Window *window) { } -void -RPI_MaximizeWindow(_THIS, SDL_Window * window) +void RPI_MaximizeWindow(_THIS, SDL_Window *window) { } -void -RPI_MinimizeWindow(_THIS, SDL_Window * window) +void RPI_MinimizeWindow(_THIS, SDL_Window *window) { } -void -RPI_RestoreWindow(_THIS, SDL_Window * window) +void RPI_RestoreWindow(_THIS, SDL_Window *window) { } @@ -425,8 +401,7 @@ RPI_RestoreWindow(_THIS, SDL_Window * window) /* SDL Window Manager function */ /*****************************************************************************/ #if 0 -SDL_bool -RPI_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool RPI_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { if (info->version.major <= SDL_MAJOR_VERSION) { return SDL_TRUE; diff --git a/src/video/raspberry/SDL_rpivideo.h b/src/video/raspberry/SDL_rpivideo.h index 2b5f40f4d096f..66ea28ff9ed65 100644 --- a/src/video/raspberry/SDL_rpivideo.h +++ b/src/video/raspberry/SDL_rpivideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,27 +30,33 @@ #include "EGL/egl.h" #include "EGL/eglext.h" +/* This must match the definition of EGL_DISPMANX_WINDOW_T in EGL/eglplatform.h, + and is defined here to allow compiling with standard headers. */ +typedef struct { + DISPMANX_ELEMENT_HANDLE_T element; + int width; + int height; +} SDL_EGL_DISPMANX_WINDOW_T; + typedef struct SDL_VideoData { - uint32_t egl_refcount; /* OpenGL ES reference count */ + uint32_t egl_refcount; /* OpenGL ES reference count */ } SDL_VideoData; - typedef struct SDL_DisplayData { DISPMANX_DISPLAY_HANDLE_T dispman_display; } SDL_DisplayData; - typedef struct SDL_WindowData { - EGL_DISPMANX_WINDOW_T dispman_window; -#if SDL_VIDEO_OPENGL_EGL + SDL_EGL_DISPMANX_WINDOW_T dispman_window; +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; -#endif +#endif /* Vsync callback cond and mutex */ - SDL_cond *vsync_cond; + SDL_cond *vsync_cond; SDL_mutex *vsync_cond_mutex; SDL_bool double_buffer; @@ -59,7 +65,6 @@ typedef struct SDL_WindowData #define SDL_RPI_VIDEOLAYER 10000 /* High enough so to occlude everything */ #define SDL_RPI_MOUSELAYER SDL_RPI_VIDEOLAYER + 1 - /****************************************************************************/ /* SDL_VideoDevice functions declaration */ /****************************************************************************/ @@ -67,21 +72,21 @@ typedef struct SDL_WindowData /* Display and window functions */ int RPI_VideoInit(_THIS); void RPI_VideoQuit(_THIS); -void RPI_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int RPI_CreateWindow(_THIS, SDL_Window * window); -int RPI_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); -void RPI_SetWindowTitle(_THIS, SDL_Window * window); -void RPI_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); -void RPI_SetWindowPosition(_THIS, SDL_Window * window); -void RPI_SetWindowSize(_THIS, SDL_Window * window); -void RPI_ShowWindow(_THIS, SDL_Window * window); -void RPI_HideWindow(_THIS, SDL_Window * window); -void RPI_RaiseWindow(_THIS, SDL_Window * window); -void RPI_MaximizeWindow(_THIS, SDL_Window * window); -void RPI_MinimizeWindow(_THIS, SDL_Window * window); -void RPI_RestoreWindow(_THIS, SDL_Window * window); -void RPI_DestroyWindow(_THIS, SDL_Window * window); +void RPI_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int RPI_CreateWindow(_THIS, SDL_Window *window); +int RPI_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); +void RPI_SetWindowTitle(_THIS, SDL_Window *window); +void RPI_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); +void RPI_SetWindowPosition(_THIS, SDL_Window *window); +void RPI_SetWindowSize(_THIS, SDL_Window *window); +void RPI_ShowWindow(_THIS, SDL_Window *window); +void RPI_HideWindow(_THIS, SDL_Window *window); +void RPI_RaiseWindow(_THIS, SDL_Window *window); +void RPI_MaximizeWindow(_THIS, SDL_Window *window); +void RPI_MinimizeWindow(_THIS, SDL_Window *window); +void RPI_RestoreWindow(_THIS, SDL_Window *window); +void RPI_DestroyWindow(_THIS, SDL_Window *window); /* Window manager function */ SDL_bool RPI_GetWindowWMInfo(_THIS, SDL_Window * window, @@ -91,11 +96,11 @@ SDL_bool RPI_GetWindowWMInfo(_THIS, SDL_Window * window, int RPI_GLES_LoadLibrary(_THIS, const char *path); void *RPI_GLES_GetProcAddress(_THIS, const char *proc); void RPI_GLES_UnloadLibrary(_THIS); -SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window * window); -int RPI_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +SDL_GLContext RPI_GLES_CreateContext(_THIS, SDL_Window *window); +int RPI_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int RPI_GLES_SetSwapInterval(_THIS, int interval); int RPI_GLES_GetSwapInterval(_THIS); -int RPI_GLES_SwapWindow(_THIS, SDL_Window * window); +int RPI_GLES_SwapWindow(_THIS, SDL_Window *window); void RPI_GLES_DeleteContext(_THIS, SDL_GLContext context); #endif /* __SDL_RPIVIDEO_H__ */ diff --git a/src/video/riscos/SDL_riscosdefs.h b/src/video/riscos/SDL_riscosdefs.h index 89a51f2b8ea10..03a6af118be72 100644 --- a/src/video/riscos/SDL_riscosdefs.h +++ b/src/video/riscos/SDL_riscosdefs.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,8 @@ #ifndef SDL_riscosdefs_h_ #define SDL_riscosdefs_h_ -typedef struct sprite_area { +typedef struct sprite_area +{ int size; /* +0 */ int count; /* +4 */ int start; /* +8 */ @@ -32,7 +33,8 @@ typedef struct sprite_area { SDL_COMPILE_TIME_ASSERT(sprite_area, sizeof(sprite_area) == 16); -typedef struct sprite_header { +typedef struct sprite_header +{ int next; /* +0 */ char name[12]; /* +4 */ int width; /* +16 */ diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c index fcca4701146ce..f959f77540786 100644 --- a/src/video/riscos/SDL_riscosevents.c +++ b/src/video/riscos/SDL_riscosevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "../../events/SDL_events_c.h" @@ -32,8 +32,7 @@ #include #include -static SDL_Scancode -SDL_RISCOS_translate_keycode(int keycode) +static SDL_Scancode SDL_RISCOS_translate_keycode(int keycode) { SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; @@ -50,8 +49,7 @@ SDL_RISCOS_translate_keycode(int keycode) return scancode; } -void -RISCOS_PollKeyboard(_THIS) +void RISCOS_PollKeyboard(_THIS) { SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; Uint8 key = 2; @@ -111,8 +109,7 @@ static const Uint8 mouse_button_map[] = { SDL_BUTTON_X2 + 3 }; -void -RISCOS_PollMouse(_THIS) +void RISCOS_PollMouse(_THIS) { SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; SDL_Mouse *mouse = SDL_GetMouse(); @@ -141,20 +138,20 @@ RISCOS_PollMouse(_THIS) } } -int -RISCOS_InitEvents(_THIS) +int RISCOS_InitEvents(_THIS) { - SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; _kernel_swi_regs regs; int i, status; - for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) + for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { driverdata->key_pressed[i] = 255; + } status = (_kernel_osbyte(202, 0, 255) & 0xFF); - SDL_ToggleModState(KMOD_NUM, (status & (1 << 2)) == 0); - SDL_ToggleModState(KMOD_CAPS, (status & (1 << 4)) == 0); - SDL_ToggleModState(KMOD_SCROLL, (status & (1 << 1)) != 0); + SDL_ToggleModState(KMOD_NUM, (status & (1 << 2)) ? SDL_FALSE : SDL_TRUE); + SDL_ToggleModState(KMOD_CAPS, (status & (1 << 4)) ? SDL_FALSE : SDL_TRUE); + SDL_ToggleModState(KMOD_SCROLL, (status & (1 << 1)) ? SDL_TRUE : SDL_FALSE); _kernel_swi(OS_Mouse, ®s, ®s); driverdata->last_mouse_buttons = regs.r[2]; @@ -165,15 +162,13 @@ RISCOS_InitEvents(_THIS) return 0; } -void -RISCOS_PumpEvents(_THIS) +void RISCOS_PumpEvents(_THIS) { RISCOS_PollMouse(_this); RISCOS_PollKeyboard(_this); } -void -RISCOS_QuitEvents(_THIS) +void RISCOS_QuitEvents(_THIS) { /* Re-enable escape. */ _kernel_osbyte(229, 0, 0); diff --git a/src/video/riscos/SDL_riscosevents_c.h b/src/video/riscos/SDL_riscosevents_c.h index 6b4341111d0b8..3b53d2575aca0 100644 --- a/src/video/riscos/SDL_riscosevents_c.h +++ b/src/video/riscos/SDL_riscosevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/riscos/SDL_riscosframebuffer.c b/src/video/riscos/SDL_riscosframebuffer.c index 59841992f7430..72bb8f91d21b9 100644 --- a/src/video/riscos/SDL_riscosframebuffer.c +++ b/src/video/riscos/SDL_riscosframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "../SDL_sysvideo.h" #include "SDL_riscosframebuffer_c.h" @@ -30,15 +30,18 @@ #include #include -int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { - SDL_WindowData *driverdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; const char *sprite_name = "display"; unsigned int sprite_mode; _kernel_oserror *error; _kernel_swi_regs regs; SDL_DisplayMode mode; int size; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); /* Free the old framebuffer surface */ RISCOS_DestroyWindowFramebuffer(_this, window); @@ -54,30 +57,30 @@ int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } /* Calculate pitch */ - *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); + *pitch = (((w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); /* Allocate the sprite area */ - size = sizeof(sprite_area) + sizeof(sprite_header) + ((*pitch) * window->h); + size = sizeof(sprite_area) + sizeof(sprite_header) + ((*pitch) * h); driverdata->fb_area = SDL_malloc(size); if (!driverdata->fb_area) { return SDL_OutOfMemory(); } - driverdata->fb_area->size = size; + driverdata->fb_area->size = size; driverdata->fb_area->count = 0; driverdata->fb_area->start = 16; - driverdata->fb_area->end = 16; + driverdata->fb_area->end = 16; /* Create the actual image */ - regs.r[0] = 256+15; + regs.r[0] = 256 + 15; regs.r[1] = (int)driverdata->fb_area; regs.r[2] = (int)sprite_name; regs.r[3] = 0; - regs.r[4] = window->w; - regs.r[5] = window->h; + regs.r[4] = w; + regs.r[5] = h; regs.r[6] = sprite_mode; error = _kernel_swi(OS_SpriteOp, ®s, ®s); - if (error != NULL) { + if (error) { SDL_free(driverdata->fb_area); return SDL_SetError("Unable to create sprite: %s (%i)", error->errmess, error->errnum); } @@ -88,13 +91,13 @@ int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, return 0; } -int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *driverdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; _kernel_swi_regs regs; _kernel_oserror *error; - regs.r[0] = 512+52; + regs.r[0] = 512 + 52; regs.r[1] = (int)driverdata->fb_area; regs.r[2] = (int)driverdata->fb_sprite; regs.r[3] = 0; /* window->x << 1; */ @@ -103,16 +106,16 @@ int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * regs.r[6] = 0; regs.r[7] = 0; error = _kernel_swi(OS_SpriteOp, ®s, ®s); - if (error != NULL) { + if (error) { return SDL_SetError("OS_SpriteOp 52 failed: %s (%i)", error->errmess, error->errnum); } return 0; } -void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - SDL_WindowData *driverdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; if (driverdata->fb_area) { SDL_free(driverdata->fb_area); diff --git a/src/video/riscos/SDL_riscosframebuffer_c.h b/src/video/riscos/SDL_riscosframebuffer_c.h index 1004616080af9..61aa991452293 100644 --- a/src/video/riscos/SDL_riscosframebuffer_c.h +++ b/src/video/riscos/SDL_riscosframebuffer_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,9 @@ #include "../../SDL_internal.h" -extern int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int RISCOS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int RISCOS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void RISCOS_DestroyWindowFramebuffer(_THIS, SDL_Window *window); #endif /* SDL_riscosframebuffer_c_h_ */ diff --git a/src/video/riscos/SDL_riscosmessagebox.c b/src/video/riscos/SDL_riscosmessagebox.c index 8144a9df69e6c..e7dd11916d2cf 100644 --- a/src/video/riscos/SDL_riscosmessagebox.c +++ b/src/video/riscos/SDL_riscosmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "SDL_messagebox.h" #include "SDL_riscosmessagebox.h" @@ -28,8 +28,7 @@ #include #include -int -RISCOS_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int RISCOS_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { _kernel_swi_regs regs; _kernel_oserror error; @@ -41,19 +40,22 @@ RISCOS_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) regs.r[0] = (unsigned int)&error; regs.r[1] = (1 << 8) | (1 << 4); - if (messageboxdata->flags == SDL_MESSAGEBOX_INFORMATION) + if (messageboxdata->flags == SDL_MESSAGEBOX_INFORMATION) { regs.r[1] |= (1 << 9); - else if (messageboxdata->flags == SDL_MESSAGEBOX_WARNING) + } else if (messageboxdata->flags == SDL_MESSAGEBOX_WARNING) { regs.r[1] |= (2 << 9); + } + regs.r[2] = (unsigned int)messageboxdata->title; regs.r[3] = 0; regs.r[4] = 0; - SDL_strlcpy(buttonstring, "" , 1024); + SDL_strlcpy(buttonstring, "", 1024); for (i = 0; i < messageboxdata->numbuttons; i++) { SDL_strlcat(buttonstring, messageboxdata->buttons[i].text, 1024); - if (i + 1 < messageboxdata->numbuttons) + if (i + 1 < messageboxdata->numbuttons) { SDL_strlcat(buttonstring, ",", 1024); + } } regs.r[5] = (unsigned int)buttonstring; diff --git a/src/video/riscos/SDL_riscosmessagebox.h b/src/video/riscos/SDL_riscosmessagebox.h index 3f6c259e8ee2d..d56a64c4274cc 100644 --- a/src/video/riscos/SDL_riscosmessagebox.h +++ b/src/video/riscos/SDL_riscosmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS extern int RISCOS_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 9500b2229762c..4975d04af595b 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "../SDL_sysvideo.h" #include "../../events/SDL_mouse_c.h" @@ -31,7 +31,8 @@ #include #include -enum { +enum +{ MODE_FLAG_565 = 1 << 7, MODE_FLAG_COLOUR_SPACE = 0xF << 12, @@ -42,7 +43,8 @@ enum { MODE_FLAG_ARGB = MODE_FLAG_TRGB | MODE_FLAG_ABGR }; -static const struct { +static const struct +{ SDL_PixelFormatEnum pixel_format; int modeflags, ncolour, log2bpp; } mode_to_pixelformat[] = { @@ -50,33 +52,32 @@ static const struct { /* { SDL_PIXELFORMAT_INDEX2LSB, 0, 3, 1 }, */ /* { SDL_PIXELFORMAT_INDEX4LSB, 0, 15, 2 }, */ /* { SDL_PIXELFORMAT_INDEX8, MODE_FLAG_565, 255, 3 }, */ - { SDL_PIXELFORMAT_XBGR1555, MODE_FLAG_TBGR, 65535, 4 }, - { SDL_PIXELFORMAT_XRGB1555, MODE_FLAG_TRGB, 65535, 4 }, - { SDL_PIXELFORMAT_ABGR1555, MODE_FLAG_ABGR, 65535, 4 }, - { SDL_PIXELFORMAT_ARGB1555, MODE_FLAG_ARGB, 65535, 4 }, - { SDL_PIXELFORMAT_XBGR4444, MODE_FLAG_TBGR, 4095, 4 }, - { SDL_PIXELFORMAT_XRGB4444, MODE_FLAG_TRGB, 4095, 4 }, - { SDL_PIXELFORMAT_ABGR4444, MODE_FLAG_ABGR, 4095, 4 }, - { SDL_PIXELFORMAT_ARGB4444, MODE_FLAG_ARGB, 4095, 4 }, - { SDL_PIXELFORMAT_BGR565, MODE_FLAG_TBGR | MODE_FLAG_565, 65535, 4 }, - { SDL_PIXELFORMAT_RGB565, MODE_FLAG_TRGB | MODE_FLAG_565, 65535, 4 }, - { SDL_PIXELFORMAT_BGR24, MODE_FLAG_TBGR, 16777215, 6 }, - { SDL_PIXELFORMAT_RGB24, MODE_FLAG_TRGB, 16777215, 6 }, - { SDL_PIXELFORMAT_XBGR8888, MODE_FLAG_TBGR, -1, 5 }, - { SDL_PIXELFORMAT_XRGB8888, MODE_FLAG_TRGB, -1, 5 }, - { SDL_PIXELFORMAT_ABGR8888, MODE_FLAG_ABGR, -1, 5 }, - { SDL_PIXELFORMAT_ARGB8888, MODE_FLAG_ARGB, -1, 5 } + { SDL_PIXELFORMAT_XBGR1555, MODE_FLAG_TBGR, 65535, 4 }, + { SDL_PIXELFORMAT_XRGB1555, MODE_FLAG_TRGB, 65535, 4 }, + { SDL_PIXELFORMAT_ABGR1555, MODE_FLAG_ABGR, 65535, 4 }, + { SDL_PIXELFORMAT_ARGB1555, MODE_FLAG_ARGB, 65535, 4 }, + { SDL_PIXELFORMAT_XBGR4444, MODE_FLAG_TBGR, 4095, 4 }, + { SDL_PIXELFORMAT_XRGB4444, MODE_FLAG_TRGB, 4095, 4 }, + { SDL_PIXELFORMAT_ABGR4444, MODE_FLAG_ABGR, 4095, 4 }, + { SDL_PIXELFORMAT_ARGB4444, MODE_FLAG_ARGB, 4095, 4 }, + { SDL_PIXELFORMAT_BGR565, MODE_FLAG_TBGR | MODE_FLAG_565, 65535, 4 }, + { SDL_PIXELFORMAT_RGB565, MODE_FLAG_TRGB | MODE_FLAG_565, 65535, 4 }, + { SDL_PIXELFORMAT_BGR24, MODE_FLAG_TBGR, 16777215, 6 }, + { SDL_PIXELFORMAT_RGB24, MODE_FLAG_TRGB, 16777215, 6 }, + { SDL_PIXELFORMAT_XBGR8888, MODE_FLAG_TBGR, -1, 5 }, + { SDL_PIXELFORMAT_XRGB8888, MODE_FLAG_TRGB, -1, 5 }, + { SDL_PIXELFORMAT_ABGR8888, MODE_FLAG_ABGR, -1, 5 }, + { SDL_PIXELFORMAT_ARGB8888, MODE_FLAG_ARGB, -1, 5 } }; -static SDL_PixelFormatEnum -RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp) +static SDL_PixelFormatEnum RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp) { int i; for (i = 0; i < SDL_arraysize(mode_to_pixelformat); i++) { if (log2bpp == mode_to_pixelformat[i].log2bpp && - (ncolour == mode_to_pixelformat[i].ncolour || ncolour == 0) && - (modeflags & (MODE_FLAG_565 | MODE_FLAG_COLOUR_SPACE)) == mode_to_pixelformat[i].modeflags) { + (ncolour == mode_to_pixelformat[i].ncolour || ncolour == 0) && + (modeflags & (MODE_FLAG_565 | MODE_FLAG_COLOUR_SPACE)) == mode_to_pixelformat[i].modeflags) { return mode_to_pixelformat[i].pixel_format; } } @@ -84,11 +85,10 @@ RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp) return SDL_PIXELFORMAT_UNKNOWN; } -static size_t -measure_mode_block(const int *block) +static size_t measure_mode_block(const int *block) { size_t blockSize = ((block[0] & 0xFF) == 3) ? 7 : 5; - while(block[blockSize] != -1) { + while (block[blockSize] != -1) { blockSize += 2; } blockSize++; @@ -96,8 +96,7 @@ measure_mode_block(const int *block) return blockSize * 4; } -static int -read_mode_variable(int *block, int var) +static int read_mode_variable(int *block, int var) { _kernel_swi_regs regs; regs.r[0] = (int)block; @@ -106,8 +105,7 @@ read_mode_variable(int *block, int var) return regs.r[2]; } -static SDL_bool -read_mode_block(int *block, SDL_DisplayMode *mode, SDL_bool extended) +static SDL_bool read_mode_block(int *block, SDL_DisplayMode *mode, SDL_bool extended) { int xres, yres, ncolour, modeflags, log2bpp, rate; @@ -145,8 +143,7 @@ read_mode_block(int *block, SDL_DisplayMode *mode, SDL_bool extended) return SDL_TRUE; } -static void * -convert_mode_block(const int *block) +static void *convert_mode_block(const int *block) { int xres, yres, log2bpp, rate, ncolour = 0, modeflags = 0; size_t pos = 0; @@ -191,8 +188,7 @@ convert_mode_block(const int *block) return dst; } -static void * -copy_memory(const void *src, size_t size, size_t alloc) +static void *copy_memory(const void *src, size_t size, size_t alloc) { void *dst = SDL_malloc(alloc); if (dst) { @@ -201,8 +197,7 @@ copy_memory(const void *src, size_t size, size_t alloc) return dst; } -int -RISCOS_InitModes(_THIS) +int RISCOS_InitModes(_THIS) { SDL_DisplayMode mode; int *current_mode; @@ -212,7 +207,7 @@ RISCOS_InitModes(_THIS) regs.r[0] = 1; error = _kernel_swi(OS_ScreenMode, ®s, ®s); - if (error != NULL) { + if (error) { return SDL_SetError("Unable to retrieve the current screen mode: %s (%i)", error->errmess, error->errnum); } @@ -230,8 +225,7 @@ RISCOS_InitModes(_THIS) return SDL_AddBasicVideoDisplay(&mode); } -void -RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { SDL_DisplayMode mode; _kernel_swi_regs regs; @@ -243,7 +237,7 @@ RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display) regs.r[6] = 0; regs.r[7] = 0; error = _kernel_swi(OS_ScreenMode, ®s, ®s); - if (error != NULL) { + if (error) { SDL_SetError("Unable to enumerate screen modes: %s (%i)", error->errmess, error->errnum); return; } @@ -257,7 +251,7 @@ RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display) regs.r[6] = (int)block; regs.r[7] = -regs.r[7]; error = _kernel_swi(OS_ScreenMode, ®s, ®s); - if (error != NULL) { + if (error) { SDL_free(block); SDL_SetError("Unable to enumerate screen modes: %s (%i)", error->errmess, error->errnum); return; @@ -268,8 +262,9 @@ RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display) continue; } - if (mode.format == SDL_PIXELFORMAT_UNKNOWN) + if (mode.format == SDL_PIXELFORMAT_UNKNOWN) { continue; + } mode.driverdata = convert_mode_block(pos + 4); if (!mode.driverdata) { @@ -285,8 +280,7 @@ RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_free(block); } -int -RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { const char disable_cursor[] = { 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; _kernel_swi_regs regs; @@ -296,7 +290,7 @@ RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) regs.r[0] = 0; regs.r[1] = (int)mode->driverdata; error = _kernel_swi(OS_ScreenMode, ®s, ®s); - if (error != NULL) { + if (error) { return SDL_SetError("Unable to set the current screen mode: %s (%i)", error->errmess, error->errnum); } diff --git a/src/video/riscos/SDL_riscosmodes.h b/src/video/riscos/SDL_riscosmodes.h index eb5347286914e..c5347e01d2bd4 100644 --- a/src/video/riscos/SDL_riscosmodes.h +++ b/src/video/riscos/SDL_riscosmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,9 @@ #define SDL_riscosmodes_h_ extern int RISCOS_InitModes(_THIS); -extern void RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -extern int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay * display, - SDL_DisplayMode * mode); +extern void RISCOS_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +extern int RISCOS_SetDisplayMode(_THIS, SDL_VideoDisplay *display, + SDL_DisplayMode *mode); #endif /* SDL_riscosmodes_h_ */ diff --git a/src/video/riscos/SDL_riscosmouse.c b/src/video/riscos/SDL_riscosmouse.c index 072f8a7a1f0ac..c1cd0942ac0bd 100644 --- a/src/video/riscos/SDL_riscosmouse.c +++ b/src/video/riscos/SDL_riscosmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "../../events/SDL_mouse_c.h" #include - -static SDL_Cursor * -RISCOS_CreateDefaultCursor() +static SDL_Cursor *RISCOS_CreateDefaultCursor() { SDL_Cursor *cursor; @@ -43,14 +41,12 @@ RISCOS_CreateDefaultCursor() return cursor; } -static void -RISCOS_FreeCursor(SDL_Cursor * cursor) +static void RISCOS_FreeCursor(SDL_Cursor *cursor) { SDL_free(cursor); } -static int -RISCOS_ShowCursor(SDL_Cursor * cursor) +static int RISCOS_ShowCursor(SDL_Cursor *cursor) { if (cursor) { /* Turn the mouse pointer on */ @@ -63,8 +59,7 @@ RISCOS_ShowCursor(SDL_Cursor * cursor) return 0; } -int -RISCOS_InitMouse(_THIS) +int RISCOS_InitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); diff --git a/src/video/riscos/SDL_riscosmouse.h b/src/video/riscos/SDL_riscosmouse.h index 3048d7d2c4393..5c124148a2309 100644 --- a/src/video/riscos/SDL_riscosmouse.h +++ b/src/video/riscos/SDL_riscosmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c index 476301100b437..4e51ea0e3258d 100644 --- a/src/video/riscos/SDL_riscosvideo.c +++ b/src/video/riscos/SDL_riscosvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "SDL_video.h" #include "SDL_mouse.h" @@ -34,6 +34,7 @@ #include "SDL_riscosmouse.h" #include "SDL_riscosmodes.h" #include "SDL_riscoswindow.h" +#include "SDL_riscosmessagebox.h" #define RISCOSVID_DRIVER_NAME "riscos" @@ -43,29 +44,27 @@ static void RISCOS_VideoQuit(_THIS); /* RISC OS driver bootstrap functions */ -static void -RISCOS_DeleteDevice(SDL_VideoDevice * device) +static void RISCOS_DeleteDevice(SDL_VideoDevice *device) { SDL_free(device->driverdata); SDL_free(device); } -static SDL_VideoDevice * -RISCOS_CreateDevice(void) +static SDL_VideoDevice *RISCOS_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *phdata; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } /* Initialize internal data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); return NULL; @@ -91,16 +90,19 @@ RISCOS_CreateDevice(void) device->free = RISCOS_DeleteDevice; + /* TODO: Support windowed mode */ + device->quirk_flags = VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY; + return device; } VideoBootStrap RISCOS_bootstrap = { RISCOSVID_DRIVER_NAME, "SDL RISC OS video driver", - RISCOS_CreateDevice + RISCOS_CreateDevice, + RISCOS_ShowMessageBox }; -static int -RISCOS_VideoInit(_THIS) +static int RISCOS_VideoInit(_THIS) { if (RISCOS_InitEvents(_this) < 0) { return -1; @@ -118,8 +120,7 @@ RISCOS_VideoInit(_THIS) return 0; } -static void -RISCOS_VideoQuit(_THIS) +static void RISCOS_VideoQuit(_THIS) { RISCOS_QuitEvents(_this); } diff --git a/src/video/riscos/SDL_riscosvideo.h b/src/video/riscos/SDL_riscosvideo.h index db6c86e49dcd1..0734be2cdaf86 100644 --- a/src/video/riscos/SDL_riscosvideo.h +++ b/src/video/riscos/SDL_riscosvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/riscos/SDL_riscoswindow.c b/src/video/riscos/SDL_riscoswindow.c index f47d33ad7f874..5792d2f544f7d 100644 --- a/src/video/riscos/SDL_riscoswindow.c +++ b/src/video/riscos/SDL_riscoswindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_RISCOS +#ifdef SDL_VIDEO_DRIVER_RISCOS #include "SDL_version.h" #include "SDL_syswm.h" @@ -31,19 +31,16 @@ #include "SDL_riscosvideo.h" #include "SDL_riscoswindow.h" -int -RISCOS_CreateWindow(_THIS, SDL_Window * window) +int RISCOS_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *driverdata; - driverdata = (SDL_WindowData *) SDL_calloc(1, sizeof(*driverdata)); + driverdata = (SDL_WindowData *)SDL_calloc(1, sizeof(*driverdata)); if (!driverdata) { return SDL_OutOfMemory(); } driverdata->window = window; - window->flags |= SDL_WINDOW_FULLSCREEN; - SDL_SetMouseFocus(window); /* All done! */ @@ -51,20 +48,19 @@ RISCOS_CreateWindow(_THIS, SDL_Window * window) return 0; } -void -RISCOS_DestroyWindow(_THIS, SDL_Window * window) +void RISCOS_DestroyWindow(_THIS, SDL_Window *window) { - SDL_WindowData *driverdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; - if (!driverdata) + if (!driverdata) { return; + } SDL_free(driverdata); window->driverdata = NULL; } -SDL_bool -RISCOS_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool RISCOS_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { if (info->version.major == SDL_MAJOR_VERSION) { info->subsystem = SDL_SYSWM_RISCOS; diff --git a/src/video/riscos/SDL_riscoswindow.h b/src/video/riscos/SDL_riscoswindow.h index d713b7aebaf22..59cb501750591 100644 --- a/src/video/riscos/SDL_riscoswindow.h +++ b/src/video/riscos/SDL_riscoswindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/riscos/scancodes_riscos.h b/src/video/riscos/scancodes_riscos.h index dbba9d1a1a34e..79ed14686083c 100644 --- a/src/video/riscos/scancodes_riscos.h +++ b/src/video/riscos/scancodes_riscos.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl index de07b19e55ca5..59774488c66b4 100755 --- a/src/video/sdlgenblit.pl +++ b/src/video/sdlgenblit.pl @@ -92,7 +92,7 @@ sub open_file { /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -392,17 +392,6 @@ sub output_copycore ${d}B = ((${s}B * ${d}B) + (${d}B * (255 - ${s}A))) / 255; if (${d}B > 255) ${d}B = 255; __EOF__ } - if ( $dst_has_alpha ) { - if ($A_is_const_FF) { - print FILE <<__EOF__; - ${d}A = 0xFF; -__EOF__ - } else { - print FILE <<__EOF__; - ${d}A = ((${s}A * ${d}A) + (${d}A * (255 - ${s}A))) / 255; if (${d}A > 255) ${d}A = 255; -__EOF__ - } - } print FILE <<__EOF__; break; @@ -426,7 +415,7 @@ sub output_copyfunc my $dst_has_alpha = ($dst =~ /A/) ? 1 : 0; my $ignore_dst_alpha = !$dst_has_alpha && !$blend; - + my $src_has_alpha = ($src =~ /A/) ? 1 : 0; my $is_modulateA_done = 0; @@ -529,15 +518,15 @@ sub output_copyfunc } if ( $scale ) { print FILE <<__EOF__; - int srcy, srcx; - Uint32 posy, posx; - int incy, incx; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; __EOF__ print FILE <<__EOF__; - incy = (info->src_h << 16) / info->dst_h; - incx = (info->src_w << 16) / info->dst_w; + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; posy = incy / 2; while (info->dst_h--) { diff --git a/src/video/uikit/SDL_uikitappdelegate.h b/src/video/uikit/SDL_uikitappdelegate.h index ee2b5b6a8c097..df3ff0fb962c1 100644 --- a/src/video/uikit/SDL_uikitappdelegate.h +++ b/src/video/uikit/SDL_uikitappdelegate.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 3186cc6e8a97b..31b114a934005 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "../SDL_sysvideo.h" #include "SDL_hints.h" @@ -87,8 +87,7 @@ int SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction) #if !TARGET_OS_TV /* Load a launch image using the old UILaunchImageFile-era naming rules. */ -static UIImage * -SDL_LoadLaunchImageNamed(NSString *name, int screenh) +static UIImage *SDL_LoadLaunchImageNamed(NSString *name, int screenh) { UIInterfaceOrientation curorient = [UIApplication sharedApplication].statusBarOrientation; UIUserInterfaceIdiom idiom = [UIDevice currentDevice].userInterfaceIdiom; @@ -190,12 +189,14 @@ - (instancetype)init - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + NSString *screenname; + NSBundle *bundle; if (!(self = [super initWithNibName:nil bundle:nil])) { return nil; } - NSString *screenname = nibNameOrNil; - NSBundle *bundle = nibBundleOrNil; + screenname = nibNameOrNil; + bundle = nibBundleOrNil; /* A launch screen may not exist. Fall back to launch images in that case. */ if (screenname) { @@ -231,6 +232,10 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB /* Xcode 5 introduced a dictionary of launch images in Info.plist. */ if (launchimages) { for (NSDictionary *dict in launchimages) { +#if !TARGET_OS_TV + UIInterfaceOrientationMask orientmask; + NSString *orientstring; +#endif NSString *minversion = dict[@"UILaunchImageMinimumOSVersion"]; NSString *sizestring = dict[@"UILaunchImageSize"]; @@ -248,8 +253,8 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB } #if !TARGET_OS_TV - UIInterfaceOrientationMask orientmask = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; - NSString *orientstring = dict[@"UILaunchImageOrientation"]; + orientmask = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; + orientstring = dict[@"UILaunchImageOrientation"]; if (orientstring) { if ([orientstring isEqualToString:@"PortraitUpsideDown"]) { @@ -409,7 +414,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { NSBundle *bundle = [NSBundle mainBundle]; -#if SDL_IPHONE_LAUNCHSCREEN +#ifdef SDL_IPHONE_LAUNCHSCREEN /* The normal launch screen is displayed until didFinishLaunching returns, * but SDL_main is called after that happens and there may be a noticeable * delay between the start of SDL_main and when the first real frame is diff --git a/src/video/uikit/SDL_uikitclipboard.h b/src/video/uikit/SDL_uikitclipboard.h index 5e6b81497203c..e3e8fcc61f66d 100644 --- a/src/video/uikit/SDL_uikitclipboard.h +++ b/src/video/uikit/SDL_uikitclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitclipboard.m b/src/video/uikit/SDL_uikitclipboard.m index dde939dfb3beb..8bd3f978214f5 100644 --- a/src/video/uikit/SDL_uikitclipboard.m +++ b/src/video/uikit/SDL_uikitclipboard.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL_uikitvideo.h" #include "../../events/SDL_clipboardevents_c.h" #import -int -UIKit_SetClipboardText(_THIS, const char *text) +int UIKit_SetClipboardText(_THIS, const char *text) { #if TARGET_OS_TV return SDL_SetError("The clipboard is not available on tvOS"); @@ -40,8 +39,7 @@ #endif } -char * -UIKit_GetClipboardText(_THIS) +char *UIKit_GetClipboardText(_THIS) { #if TARGET_OS_TV return SDL_strdup(""); // Unsupported. @@ -59,8 +57,7 @@ #endif } -SDL_bool -UIKit_HasClipboardText(_THIS) +SDL_bool UIKit_HasClipboardText(_THIS) { @autoreleasepool { #if !TARGET_OS_TV @@ -72,8 +69,7 @@ } } -void -UIKit_InitClipboard(_THIS) +void UIKit_InitClipboard(_THIS) { #if !TARGET_OS_TV @autoreleasepool { @@ -92,8 +88,7 @@ #endif } -void -UIKit_QuitClipboard(_THIS) +void UIKit_QuitClipboard(_THIS) { @autoreleasepool { SDL_VideoData *data = (__bridge SDL_VideoData *) _this->driverdata; diff --git a/src/video/uikit/SDL_uikitevents.h b/src/video/uikit/SDL_uikitevents.h index 083e431ce6b9d..dda1944fb2971 100644 --- a/src/video/uikit/SDL_uikitevents.h +++ b/src/video/uikit/SDL_uikitevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index e1bc5a29e67b0..0a96c6821e305 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "../../events/SDL_events_c.h" @@ -108,26 +108,21 @@ - (void)applicationDidChangeStatusBarOrientation @end -void -SDL_iPhoneSetEventPump(SDL_bool enabled) +void SDL_iPhoneSetEventPump(SDL_bool enabled) { - UIKit_EventPumpEnabled = enabled; - static SDL_LifecycleObserver *lifecycleObserver; static dispatch_once_t onceToken; + + UIKit_EventPumpEnabled = enabled; + dispatch_once(&onceToken, ^{ lifecycleObserver = [SDL_LifecycleObserver new]; }); [lifecycleObserver eventPumpChanged]; } -void -UIKit_PumpEvents(_THIS) +void UIKit_PumpEvents(_THIS) { - if (!UIKit_EventPumpEnabled) { - return; - } - /* Let the run loop run for a short amount of time: long enough for touch events to get processed (which is important to get certain elements of Game Center's GKLeaderboardViewController to respond @@ -135,9 +130,12 @@ touch events to get processed (which is important to get certain delay in the rest of the app. */ const CFTimeInterval seconds = 0.000002; + SInt32 result; + if (!UIKit_EventPumpEnabled) { + return; + } /* Pump most event types. */ - SInt32 result; do { result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE); } while (result == kCFRunLoopRunHandledSource); @@ -148,7 +146,7 @@ touch events to get processed (which is important to get certain } while(result == kCFRunLoopRunHandledSource); /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) UIKit_GL_RestoreCurrentContext(); #endif } @@ -161,13 +159,14 @@ touch events to get processed (which is important to get certain static void OnGCKeyboardConnected(GCKeyboard *keyboard) API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) { + dispatch_queue_t queue; keyboard_connected = SDL_TRUE; keyboard.keyboardInput.keyChangedHandler = ^(GCKeyboardInput *kbrd, GCControllerButtonInput *key, GCKeyCode keyCode, BOOL pressed) { SDL_SendKeyboardKey(pressed ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)keyCode); }; - dispatch_queue_t queue = dispatch_queue_create( "org.libsdl.input.keyboard", DISPATCH_QUEUE_SERIAL ); + queue = dispatch_queue_create( "org.libsdl.input.keyboard", DISPATCH_QUEUE_SERIAL ); dispatch_set_target_queue( queue, dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_HIGH, 0 ) ); keyboard.handlerQueue = queue; } @@ -259,8 +258,33 @@ void SDL_QuitGCKeyboard(void) static id mouse_connect_observer = nil; static id mouse_disconnect_observer = nil; static bool mouse_relative_mode = SDL_FALSE; +static SDL_MouseWheelDirection mouse_scroll_direction = SDL_MOUSEWHEEL_NORMAL; + +static void UpdateScrollDirection(void) +{ +#if 0 /* This code doesn't work for some reason */ + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + if ([userDefaults boolForKey:@"com.apple.swipescrolldirection"]) { + mouse_scroll_direction = SDL_MOUSEWHEEL_FLIPPED; + } else { + mouse_scroll_direction = SDL_MOUSEWHEEL_NORMAL; + } +#else + Boolean keyExistsAndHasValidFormat = NO; + Boolean naturalScrollDirection = CFPreferencesGetAppBooleanValue(CFSTR("com.apple.swipescrolldirection"), kCFPreferencesAnyApplication, &keyExistsAndHasValidFormat); + if (!keyExistsAndHasValidFormat) { + /* Couldn't read the preference, assume natural scrolling direction */ + naturalScrollDirection = YES; + } + if (naturalScrollDirection) { + mouse_scroll_direction = SDL_MOUSEWHEEL_FLIPPED; + } else { + mouse_scroll_direction = SDL_MOUSEWHEEL_NORMAL; + } +#endif +} -static void UpdatePointerLock() +static void UpdatePointerLock(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; @@ -284,6 +308,8 @@ static void OnGCMouseButtonChanged(SDL_MouseID mouseID, Uint8 button, BOOL press static void OnGCMouseConnected(GCMouse *mouse) API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) { + int auxiliary_button; + dispatch_queue_t queue; SDL_MouseID mouseID = mice_connected; mouse.mouseInput.leftButton.pressedChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed) @@ -299,7 +325,7 @@ static void OnGCMouseConnected(GCMouse *mouse) API_AVAILABLE(macos(11.0), ios(14 OnGCMouseButtonChanged(mouseID, SDL_BUTTON_RIGHT, pressed); }; - int auxiliary_button = SDL_BUTTON_X1; + auxiliary_button = SDL_BUTTON_X1; for (GCControllerButtonInput *btn in mouse.mouseInput.auxiliaryButtons) { btn.pressedChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed) { @@ -315,12 +341,24 @@ static void OnGCMouseConnected(GCMouse *mouse) API_AVAILABLE(macos(11.0), ios(14 } }; - mouse.mouseInput.scroll.valueChangedHandler = ^(GCControllerDirectionPad *dpad, float xValue, float yValue) - { - SDL_SendMouseWheel(SDL_GetMouseFocus(), 0, xValue, yValue, SDL_MOUSEWHEEL_NORMAL); + mouse.mouseInput.scroll.valueChangedHandler = ^(GCControllerDirectionPad *dpad, float xValue, float yValue) { + /* Raw scroll values come in here, vertical values in the first axis, horizontal values in the second axis. + * The vertical values are negative moving the mouse wheel up and positive moving it down. + * The horizontal values are negative moving the mouse wheel left and positive moving it right. + * The vertical values are inverted compared to SDL, and the horizontal values are as expected. + */ + float vertical = -xValue; + float horizontal = yValue; + if (mouse_scroll_direction == SDL_MOUSEWHEEL_FLIPPED) { + /* Since these are raw values, we need to flip them ourselves */ + vertical = -vertical; + horizontal = -horizontal; + } + SDL_SendMouseWheel(SDL_GetMouseFocus(), mouseID, horizontal, vertical, mouse_scroll_direction); }; + UpdateScrollDirection(); - dispatch_queue_t queue = dispatch_queue_create( "org.libsdl.input.mouse", DISPATCH_QUEUE_SERIAL ); + queue = dispatch_queue_create( "org.libsdl.input.mouse", DISPATCH_QUEUE_SERIAL ); dispatch_set_target_queue( queue, dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_HIGH, 0 ) ); mouse.handlerQueue = queue; diff --git a/src/video/uikit/SDL_uikitmessagebox.h b/src/video/uikit/SDL_uikitmessagebox.h index 9904ccf3b085a..4a9a4dc98668b 100644 --- a/src/video/uikit/SDL_uikitmessagebox.h +++ b/src/video/uikit/SDL_uikitmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT extern SDL_bool UIKit_ShowingMessageBox(void); diff --git a/src/video/uikit/SDL_uikitmessagebox.m b/src/video/uikit/SDL_uikitmessagebox.m index 2c42ba7463d6c..a28f1cf980200 100644 --- a/src/video/uikit/SDL_uikitmessagebox.m +++ b/src/video/uikit/SDL_uikitmessagebox.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL.h" #include "SDL_uikitvideo.h" @@ -30,14 +30,12 @@ static SDL_bool s_showingMessageBox = SDL_FALSE; -SDL_bool -UIKit_ShowingMessageBox(void) +SDL_bool UIKit_ShowingMessageBox(void) { return s_showingMessageBox; } -static void -UIKit_WaitUntilMessageBoxClosed(const SDL_MessageBoxData *messageboxdata, int *clickedindex) +static void UIKit_WaitUntilMessageBoxClosed(const SDL_MessageBoxData *messageboxdata, int *clickedindex) { *clickedindex = messageboxdata->numbuttons; @@ -52,19 +50,18 @@ } } -static BOOL -UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, int *buttonid) +static BOOL UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, int *buttonid) { int i; int __block clickedindex = messageboxdata->numbuttons; UIWindow *window = nil; UIWindow *alertwindow = nil; + UIAlertController *alert; if (![UIAlertController class]) { return NO; } - UIAlertController *alert; alert = [UIAlertController alertControllerWithTitle:@(messageboxdata->title) message:@(messageboxdata->message) preferredStyle:UIAlertControllerStyleAlert]; @@ -124,8 +121,7 @@ return YES; } -static void -UIKit_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid, int *returnValue) +static void UIKit_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid, int *returnValue) { @autoreleasepool { if (UIKit_ShowMessageBoxAlertController(messageboxdata, buttonid)) { @@ -135,8 +131,7 @@ } }} -int -UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { @autoreleasepool { __block int returnValue = 0; diff --git a/src/video/uikit/SDL_uikitmetalview.h b/src/video/uikit/SDL_uikitmetalview.h index a4d7026d811a2..acc10fb9a3f28 100644 --- a/src/video/uikit/SDL_uikitmetalview.h +++ b/src/video/uikit/SDL_uikitmetalview.h @@ -1,15 +1,15 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - + Copyright (C) 1997-2025 Sam Lantinga + This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - + Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - + 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be @@ -32,7 +32,7 @@ #include "../SDL_sysvideo.h" #include "SDL_uikitwindow.h" -#if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) +#if defined(SDL_VIDEO_DRIVER_UIKIT) && (defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)) #import #import diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index 8bc3380955e87..7c17d8d5d79ef 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -1,15 +1,15 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga - + Copyright (C) 1997-2025 Sam Lantinga + This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - + Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - + 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be @@ -28,7 +28,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) +#if defined(SDL_VIDEO_DRIVER_UIKIT) && (defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)) #include "SDL_syswm.h" #include "../SDL_sysvideo.h" @@ -74,8 +74,7 @@ - (void)updateDrawableSize @end -SDL_MetalView -UIKit_Metal_CreateView(_THIS, SDL_Window * window) +SDL_MetalView UIKit_Metal_CreateView(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; CGFloat scale = 1.0; @@ -92,13 +91,17 @@ - (void)updateDrawableSize metalview = [[SDL_uikitmetalview alloc] initWithFrame:data.uiwindow.bounds scale:scale]; + if (metalview == nil) { + SDL_OutOfMemory(); + return NULL; + } + [metalview setSDLWindow:window]; return (void*)CFBridgingRetain(metalview); }} -void -UIKit_Metal_DestroyView(_THIS, SDL_MetalView view) +void UIKit_Metal_DestroyView(_THIS, SDL_MetalView view) { @autoreleasepool { SDL_uikitmetalview *metalview = CFBridgingRelease(view); @@ -107,15 +110,13 @@ - (void)updateDrawableSize } }} -void * -UIKit_Metal_GetLayer(_THIS, SDL_MetalView view) +void *UIKit_Metal_GetLayer(_THIS, SDL_MetalView view) { @autoreleasepool { SDL_uikitview *uiview = (__bridge SDL_uikitview *)view; return (__bridge void *)uiview.layer; }} -void -UIKit_Metal_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) +void UIKit_Metal_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; diff --git a/src/video/uikit/SDL_uikitmodes.h b/src/video/uikit/SDL_uikitmodes.h index d4f3b20ef7f1a..e5b103a38a255 100644 --- a/src/video/uikit/SDL_uikitmodes.h +++ b/src/video/uikit/SDL_uikitmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 322240d18ac67..97c59c250a16a 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL_system.h" #include "SDL_uikitmodes.h" @@ -34,13 +34,17 @@ @implementation SDL_DisplayData - (instancetype)initWithScreen:(UIScreen*)screen { if (self = [super init]) { + NSDictionary* devices; + struct utsname systemInfo; + NSString* deviceName; + id foundDPI; self.uiscreen = screen; /* * A well up to date list of device info can be found here: * https://github.com/lmirosevic/GBDeviceInfo/blob/master/GBDeviceInfo/GBDeviceInfo_iOS.m */ - NSDictionary* devices = @{ + devices = @{ @"iPhone1,1": @163, @"iPhone1,2": @163, @"iPhone2,1": @163, @@ -138,11 +142,10 @@ - (instancetype)initWithScreen:(UIScreen*)screen @"iPod9,1": @326, }; - struct utsname systemInfo; uname(&systemInfo); - NSString* deviceName = + deviceName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; - id foundDPI = devices[deviceName]; + foundDPI = devices[deviceName]; if (foundDPI) { self.screenDPI = (float)[foundDPI integerValue]; } else { @@ -215,9 +218,7 @@ + (void)screenDisconnected:(NSNotification*)notification @end -static int -UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode, - UIScreenMode * uiscreenmode) +static int UIKit_AllocateDisplayModeData(SDL_DisplayMode * mode, UIScreenMode * uiscreenmode) { SDL_DisplayModeData *data = nil; @@ -236,8 +237,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -static void -UIKit_FreeDisplayModeData(SDL_DisplayMode * mode) +static void UIKit_FreeDisplayModeData(SDL_DisplayMode * mode) { if (mode->driverdata != NULL) { CFRelease(mode->driverdata); @@ -245,8 +245,7 @@ + (void)screenDisconnected:(NSNotification*)notification } } -static NSUInteger -UIKit_GetDisplayModeRefreshRate(UIScreen *uiscreen) +static NSUInteger UIKit_GetDisplayModeRefreshRate(UIScreen *uiscreen) { #ifdef __IPHONE_10_3 if ([uiscreen respondsToSelector:@selector(maximumFramesPerSecond)]) { @@ -256,9 +255,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -static int -UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h, - UIScreen * uiscreen, UIScreenMode * uiscreenmode) +static int UIKit_AddSingleDisplayMode(SDL_VideoDisplay * display, int w, int h, UIScreen * uiscreen, UIScreenMode * uiscreenmode) { SDL_DisplayMode mode; SDL_zero(mode); @@ -280,9 +277,7 @@ + (void)screenDisconnected:(NSNotification*)notification } } -static int -UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, UIScreen * uiscreen, - UIScreenMode * uiscreenmode, SDL_bool addRotation) +static int UIKit_AddDisplayMode(SDL_VideoDisplay * display, int w, int h, UIScreen * uiscreen, UIScreenMode * uiscreenmode, SDL_bool addRotation) { if (UIKit_AddSingleDisplayMode(display, w, h, uiscreen, uiscreenmode) < 0) { return -1; @@ -298,13 +293,13 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -int -UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event) +int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event) { UIScreenMode *uiscreenmode = uiscreen.currentMode; CGSize size = uiscreen.bounds.size; SDL_VideoDisplay display; SDL_DisplayMode mode; + SDL_DisplayData *data; SDL_zero(mode); /* Make sure the width/height are oriented correctly */ @@ -328,7 +323,7 @@ + (void)screenDisconnected:(NSNotification*)notification display.current_mode = mode; /* Allocate the display data */ - SDL_DisplayData *data = [[SDL_DisplayData alloc] initWithScreen:uiscreen]; + data = [[SDL_DisplayData alloc] initWithScreen:uiscreen]; if (!data) { UIKit_FreeDisplayModeData(&display.desktop_mode); return SDL_OutOfMemory(); @@ -340,8 +335,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -void -UIKit_DelDisplay(UIScreen *uiscreen) +void UIKit_DelDisplay(UIScreen *uiscreen) { int i; @@ -350,14 +344,14 @@ + (void)screenDisconnected:(NSNotification*)notification if (data && data.uiscreen == uiscreen) { CFRelease(SDL_GetDisplayDriverData(i)); + SDL_GetDisplay(i)->driverdata = NULL; SDL_DelVideoDisplay(i); return; } } } -SDL_bool -UIKit_IsDisplayLandscape(UIScreen *uiscreen) +SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen) { #if !TARGET_OS_TV if (uiscreen == [UIScreen mainScreen]) { @@ -370,8 +364,7 @@ + (void)screenDisconnected:(NSNotification*)notification } } -int -UIKit_InitModes(_THIS) +int UIKit_InitModes(_THIS) { @autoreleasepool { for (UIScreen *uiscreen in [UIScreen screens]) { @@ -389,8 +382,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -void -UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay * display) { @autoreleasepool { SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; @@ -434,8 +426,7 @@ + (void)screenDisconnected:(NSNotification*)notification } } -int -UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi) +int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi) { @autoreleasepool { SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; @@ -455,8 +446,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -int -UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) { @autoreleasepool { SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; @@ -485,8 +475,7 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -int -UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) { @autoreleasepool { int displayIndex = (int) (display - _this->displays); @@ -508,13 +497,13 @@ + (void)screenDisconnected:(NSNotification*)notification return 0; } -void -UIKit_QuitModes(_THIS) +void UIKit_QuitModes(_THIS) { + int i, j; + [SDL_DisplayWatch stop]; /* Release Objective-C objects, so higher level doesn't free() them. */ - int i, j; @autoreleasepool { for (i = 0; i < _this->num_displays; i++) { SDL_VideoDisplay *display = &_this->displays[i]; @@ -534,7 +523,7 @@ + (void)screenDisconnected:(NSNotification*)notification } #if !TARGET_OS_TV -void SDL_OnApplicationDidChangeStatusBarOrientation() +void SDL_OnApplicationDidChangeStatusBarOrientation(void) { BOOL isLandscape = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); SDL_VideoDisplay *display = SDL_GetDisplay(0); diff --git a/src/video/uikit/SDL_uikitopengles.h b/src/video/uikit/SDL_uikitopengles.h index c2e6d571c7061..0533f6970eca2 100644 --- a/src/video/uikit/SDL_uikitopengles.h +++ b/src/video/uikit/SDL_uikitopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #ifndef SDL_uikitopengles_ #define SDL_uikitopengles_ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) #include "../SDL_sysvideo.h" @@ -37,7 +37,7 @@ extern int UIKit_GL_LoadLibrary(_THIS, const char *path); extern void UIKit_GL_RestoreCurrentContext(void); -#endif // SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#endif // SDL_VIDEO_OPENGL_ES || defined(SDL_VIDEO_OPENGL_ES2) #endif /* SDL_uikitopengles_ */ diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index 15ea2e350cb77..988966d06461d 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2) +#if defined(SDL_VIDEO_DRIVER_UIKIT) && (defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)) #include "SDL_uikitopengles.h" #import "SDL_uikitopenglview.h" @@ -52,8 +52,7 @@ - (void)dealloc @end -void * -UIKit_GL_GetProcAddress(_THIS, const char *proc) +void *UIKit_GL_GetProcAddress(_THIS, const char *proc) { /* Look through all SO's for the proc symbol. Here's why: * -Looking for the path to the OpenGL Library seems not to work in the iOS Simulator. @@ -64,8 +63,7 @@ - (void)dealloc /* note that SDL_GL_DeleteContext makes it current without passing the window */ -int -UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int UIKit_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { @autoreleasepool { SDLEAGLContext *eaglcontext = (__bridge SDLEAGLContext *) context; @@ -82,8 +80,7 @@ - (void)dealloc return 0; } -void -UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) +void UIKit_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; @@ -102,8 +99,7 @@ - (void)dealloc } } -int -UIKit_GL_LoadLibrary(_THIS, const char *path) +int UIKit_GL_LoadLibrary(_THIS, const char *path) { /* We shouldn't pass a path to this function, since we've already loaded the * library. */ @@ -118,7 +114,7 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) @autoreleasepool { SDLEAGLContext *context = (__bridge SDLEAGLContext *) SDL_GL_GetCurrentContext(); -#if SDL_POWER_UIKIT +#ifdef SDL_POWER_UIKIT /* Check once a frame to see if we should turn off the battery monitor. */ SDL_UIKit_UpdateBatteryMonitoring(); #endif @@ -132,8 +128,7 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) return 0; } -SDL_GLContext -UIKit_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window) { @autoreleasepool { SDLEAGLContext *context = nil; @@ -210,8 +205,7 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) } } -void -UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) +void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context) { @autoreleasepool { /* The context was retained in SDL_GL_CreateContext, so we release it @@ -221,8 +215,7 @@ int UIKit_GL_SwapWindow(_THIS, SDL_Window * window) } } -void -UIKit_GL_RestoreCurrentContext(void) +void UIKit_GL_RestoreCurrentContext(void) { @autoreleasepool { /* Some iOS system functionality (such as Dictation on the on-screen diff --git a/src/video/uikit/SDL_uikitopenglview.h b/src/video/uikit/SDL_uikitopenglview.h index df659a1f199e9..70abdc9cd1147 100644 --- a/src/video/uikit/SDL_uikitopenglview.h +++ b/src/video/uikit/SDL_uikitopenglview.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) #import #import diff --git a/src/video/uikit/SDL_uikitopenglview.m b/src/video/uikit/SDL_uikitopenglview.m index ea4db411a8c13..c36f0601fa48b 100644 --- a/src/video/uikit/SDL_uikitopenglview.m +++ b/src/video/uikit/SDL_uikitopenglview.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT && (SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2) +#if defined(SDL_VIDEO_DRIVER_UIKIT) && (defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)) #include #include @@ -74,6 +74,7 @@ - (instancetype)initWithFrame:(CGRect)frame const BOOL useStencilBuffer = (stencilBits != 0); const BOOL useDepthBuffer = (depthBits != 0); NSString *colorFormat = nil; + CAEAGLLayer *eaglLayer; context = glcontext; samples = multisamples; @@ -105,7 +106,7 @@ - (instancetype)initWithFrame:(CGRect)frame colorBufferFormat = GL_RGB565; } - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; + eaglLayer = (CAEAGLLayer *)self.layer; eaglLayer.opaque = YES; eaglLayer.drawableProperties = @{ @@ -315,10 +316,13 @@ - (void)swapBuffers - (void)layoutSubviews { + int width; + int height; + [super layoutSubviews]; - int width = (int) (self.bounds.size.width * self.contentScaleFactor); - int height = (int) (self.bounds.size.height * self.contentScaleFactor); + width = (int) (self.bounds.size.width * self.contentScaleFactor); + height = (int) (self.bounds.size.height * self.contentScaleFactor); /* Update the color and depth buffer storage if the layer size has changed. */ if (width != backingWidth || height != backingHeight) { diff --git a/src/video/uikit/SDL_uikitvideo.h b/src/video/uikit/SDL_uikitvideo.h index b684e23a8caf8..4d3b81a938fc6 100644 --- a/src/video/uikit/SDL_uikitvideo.h +++ b/src/video/uikit/SDL_uikitvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 4e8a577551498..f7aa3fd1279b9 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #import @@ -39,6 +39,7 @@ #include "SDL_uikitclipboard.h" #include "SDL_uikitvulkan.h" #include "SDL_uikitmetalview.h" +#include "SDL_uikitmessagebox.h" #define UIKITVID_DRIVER_NAME "uikit" @@ -60,8 +61,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) } } -static SDL_VideoDevice * -UIKit_CreateDevice(void) +static SDL_VideoDevice *UIKit_CreateDevice(void) { @autoreleasepool { SDL_VideoDevice *device; @@ -100,7 +100,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) device->GetDisplayDPI = UIKit_GetDisplayDPI; device->GetWindowSizeInPixels = UIKit_GetWindowSizeInPixels; -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport; device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard; device->HideScreenKeyboard = UIKit_HideScreenKeyboard; @@ -113,7 +113,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) device->HasClipboardText = UIKit_HasClipboardText; /* OpenGL (ES) functions */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) device->GL_MakeCurrent = UIKit_GL_MakeCurrent; device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize; device->GL_SwapWindow = UIKit_GL_SwapWindow; @@ -124,7 +124,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) #endif device->free = UIKit_DeleteDevice; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = UIKit_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = UIKit_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions @@ -133,7 +133,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) device->Vulkan_GetDrawableSize = UIKit_Vulkan_GetDrawableSize; #endif -#if SDL_VIDEO_METAL +#ifdef SDL_VIDEO_METAL device->Metal_CreateView = UIKit_Metal_CreateView; device->Metal_DestroyView = UIKit_Metal_DestroyView; device->Metal_GetLayer = UIKit_Metal_GetLayer; @@ -148,12 +148,12 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) VideoBootStrap UIKIT_bootstrap = { UIKITVID_DRIVER_NAME, "SDL UIKit video driver", - UIKit_CreateDevice + UIKit_CreateDevice, + UIKit_ShowMessageBox }; -int -UIKit_VideoInit(_THIS) +int UIKit_VideoInit(_THIS) { _this->gl_config.driver_loaded = 1; @@ -167,8 +167,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) return 0; } -void -UIKit_VideoQuit(_THIS) +void UIKit_VideoQuit(_THIS) { SDL_QuitGCKeyboard(); SDL_QuitGCMouse(); @@ -176,8 +175,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) UIKit_QuitModes(_this); } -void -UIKit_SuspendScreenSaver(_THIS) +void UIKit_SuspendScreenSaver(_THIS) { @autoreleasepool { /* Ignore ScreenSaver API calls if the idle timer hint has been set. */ @@ -191,17 +189,20 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) } } -SDL_bool -UIKit_IsSystemVersionAtLeast(double version) +SDL_bool UIKit_IsSystemVersionAtLeast(double version) { return [[UIDevice currentDevice].systemVersion doubleValue] >= version; } -CGRect -UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) +CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; CGRect frame = screen.bounds; +#if !TARGET_OS_TV + UIInterfaceOrientation orient; + BOOL landscape; + BOOL fullscreen; +#endif /* Use the UIWindow bounds instead of the UIScreen bounds, when possible. * The uiwindow bounds may be smaller than the screen bounds when Split View @@ -219,9 +220,10 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) * https://bugzilla.libsdl.org/show_bug.cgi?id=3505 * https://bugzilla.libsdl.org/show_bug.cgi?id=3465 * https://forums.developer.apple.com/thread/65337 */ - UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation; - BOOL landscape = UIInterfaceOrientationIsLandscape(orient); - BOOL fullscreen = CGRectEqualToRect(screen.bounds, frame); + orient = [UIApplication sharedApplication].statusBarOrientation; + landscape = UIInterfaceOrientationIsLandscape(orient) || + !(UIKit_GetSupportedOrientations(window) & (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown)); + fullscreen = CGRectEqualToRect(screen.bounds, frame); /* The orientation flip doesn't make sense when the window is smaller * than the screen (iPad Split View, for example). */ @@ -235,8 +237,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) return frame; } -void -UIKit_ForceUpdateHomeIndicator() +void UIKit_ForceUpdateHomeIndicator(void) { #if !TARGET_OS_TV /* Force the main SDL window to re-evaluate home indicator state */ diff --git a/src/video/uikit/SDL_uikitview.h b/src/video/uikit/SDL_uikitview.h index dcd63c7a5645a..9c35e639e606c 100644 --- a/src/video/uikit/SDL_uikitview.h +++ b/src/video/uikit/SDL_uikitview.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 8c48cfa503b90..676fedbdab49e 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL_uikitview.h" @@ -38,7 +38,7 @@ #define MAX_MOUSE_BUTTONS 5 /* This is defined in SDL_sysjoystick.m */ -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED extern int SDL_AppleTVRemoteOpenedAsJoystick; #endif @@ -53,20 +53,25 @@ - (instancetype)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { #if TARGET_OS_TV + UISwipeGestureRecognizer *swipeUp; + UISwipeGestureRecognizer *swipeDown; + UISwipeGestureRecognizer *swipeLeft; + UISwipeGestureRecognizer *swipeRight; + /* Apple TV Remote touchpad swipe gestures. */ - UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; + swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; swipeUp.direction = UISwipeGestureRecognizerDirectionUp; [self addGestureRecognizer:swipeUp]; - UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; + swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; swipeDown.direction = UISwipeGestureRecognizerDirectionDown; [self addGestureRecognizer:swipeDown]; - UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; + swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft; [self addGestureRecognizer:swipeLeft]; - UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; + swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeGesture:)]; swipeRight.direction = UISwipeGestureRecognizerDirectionRight; [self addGestureRecognizer:swipeRight]; #endif @@ -231,7 +236,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event int i; for (i = 1; i <= MAX_MOUSE_BUTTONS; ++i) { - if ((event.buttonMask & SDL_BUTTON(i)) != 0) { + if (event.buttonMask & SDL_BUTTON(i)) { Uint8 button; switch (i) { @@ -257,6 +262,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event } #endif if (!handled) { + CGPoint locationInView; SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; SDL_TouchID touchId = [self touchIdForType:touchType]; float pressure = [self pressureForTouch:touch]; @@ -267,7 +273,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */ - CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; + locationInView = [self touchLocation:touch shouldNormalize:YES]; SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), sdlwindow, SDL_TRUE, locationInView.x, locationInView.y, pressure); } @@ -286,7 +292,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event int i; for (i = 1; i <= MAX_MOUSE_BUTTONS; ++i) { - if ((event.buttonMask & SDL_BUTTON(i)) != 0) { + if (event.buttonMask & SDL_BUTTON(i)) { Uint8 button; switch (i) { @@ -312,6 +318,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event } #endif if (!handled) { + CGPoint locationInView; SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; SDL_TouchID touchId = [self touchIdForType:touchType]; float pressure = [self pressureForTouch:touch]; @@ -322,7 +329,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */ - CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; + locationInView = [self touchLocation:touch shouldNormalize:YES]; SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), sdlwindow, SDL_FALSE, locationInView.x, locationInView.y, pressure); } @@ -348,6 +355,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event } #endif if (!handled) { + CGPoint locationInView; SDL_TouchDeviceType touchType = [self touchTypeForTouch:touch]; SDL_TouchID touchId = [self touchIdForType:touchType]; float pressure = [self pressureForTouch:touch]; @@ -356,7 +364,7 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event continue; } - CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES]; + locationInView = [self touchLocation:touch shouldNormalize:YES]; SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch), sdlwindow, locationInView.x, locationInView.y, pressure); } @@ -374,7 +382,7 @@ - (SDL_Scancode)scancodeFromPress:(UIPress*)press } #endif -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED /* Presses from Apple TV remote */ if (!SDL_AppleTVRemoteOpenedAsJoystick) { switch (press.type) { @@ -412,7 +420,9 @@ - (void)pressesBegan:(NSSet *)presses withEvent:(UIPressesEvent *)eve SDL_SendKeyboardKey(SDL_PRESSED, scancode); } } - [super pressesBegan:presses withEvent:event]; + if (SDL_IsTextInputActive()) { + [super pressesBegan:presses withEvent:event]; + } } - (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)event @@ -423,7 +433,9 @@ - (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)eve SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } - [super pressesEnded:presses withEvent:event]; + if (SDL_IsTextInputActive()) { + [super pressesEnded:presses withEvent:event]; + } } - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent *)event @@ -434,13 +446,17 @@ - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent * SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } - [super pressesCancelled:presses withEvent:event]; + if (SDL_IsTextInputActive()) { + [super pressesCancelled:presses withEvent:event]; + } } - (void)pressesChanged:(NSSet *)presses withEvent:(UIPressesEvent *)event { /* This is only called when the force of a press changes. */ - [super pressesChanged:presses withEvent:event]; + if (SDL_IsTextInputActive()) { + [super pressesChanged:presses withEvent:event]; + } } #endif /* TARGET_OS_TV || defined(__IPHONE_9_1) */ @@ -450,7 +466,7 @@ -(void)swipeGesture:(UISwipeGestureRecognizer *)gesture { /* Swipe gestures don't trigger begin states. */ if (gesture.state == UIGestureRecognizerStateEnded) { -#if !SDL_JOYSTICK_DISABLED +#ifndef SDL_JOYSTICK_DISABLED if (!SDL_AppleTVRemoteOpenedAsJoystick) { /* Send arrow key presses for now, as we don't have an external API * which better maps to swipe gestures. */ diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h index 2e64a5279da55..1ae4633556eec 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.h +++ b/src/video/uikit/SDL_uikitviewcontroller.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,11 @@ #define SDLRootViewController UIViewController #endif -#if SDL_IPHONE_KEYBOARD +@interface SDLUITextField : UITextField +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender; +@end + +#ifdef SDL_IPHONE_KEYBOARD @interface SDL_uikitviewcontroller : SDLRootViewController #else @interface SDL_uikitviewcontroller : SDLRootViewController @@ -64,7 +68,7 @@ @property (nonatomic, assign) int homeIndicatorHidden; #endif -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD - (void)showKeyboard; - (void)hideKeyboard; - (void)initKeyboard; @@ -82,7 +86,7 @@ @end -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD SDL_bool UIKit_HasScreenKeyboardSupport(_THIS); void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window); void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window); diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index ee7ee83b0db80..dee4b197238d9 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL_video.h" #include "SDL_hints.h" @@ -64,16 +64,28 @@ } #endif +@implementation SDLUITextField : UITextField +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender +{ + if (action == @selector(paste:)) { + return NO; + } + + return [super canPerformAction:action withSender:sender]; +} +@end + @implementation SDL_uikitviewcontroller { CADisplayLink *displayLink; int animationInterval; void (*animationCallback)(void*); void *animationCallbackParam; -#if SDL_IPHONE_KEYBOARD - UITextField *textField; +#ifdef SDL_IPHONE_KEYBOARD + SDLUITextField *textField; BOOL hardwareKeyboard; BOOL showingKeyboard; + BOOL hidingKeyboard; BOOL rotatingOrientation; NSString *committedText; NSString *obligateForBackspace; @@ -87,10 +99,11 @@ - (instancetype)initWithSDLWindow:(SDL_Window *)_window if (self = [super initWithNibName:nil bundle:nil]) { self.window = _window; -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD [self initKeyboard]; hardwareKeyboard = NO; showingKeyboard = NO; + hidingKeyboard = NO; rotatingOrientation = NO; #endif @@ -105,13 +118,27 @@ - (instancetype)initWithSDLWindow:(SDL_Window *)_window SDL_HideHomeIndicatorHintChanged, (__bridge void *) self); #endif + + /* Enable high refresh rates on iOS + * To enable this on phones, you should add the following line to Info.plist: + * CADisableMinimumFrameDurationOnPhone + */ + if (@available(iOS 15.0, tvOS 15.0, *)) { + SDL_DisplayMode mode; + if (SDL_GetDesktopDisplayMode(0, &mode) == 0 && mode.refresh_rate > 60.0f) { + int frame_rate = (int)mode.refresh_rate; + displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(doLoop:)]; + displayLink.preferredFrameRateRange = CAFrameRateRangeMake((frame_rate * 2) / 3, frame_rate, frame_rate); + [displayLink addToRunLoop:NSRunLoop.currentRunLoop forMode:NSDefaultRunLoopMode]; + } + } } return self; } - (void)dealloc { -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD [self deinitKeyboard]; #endif @@ -134,6 +161,9 @@ - (void)setAnimationCallback:(int)interval { [self stopAnimation]; + if (interval <= 0) { + interval = 1; + } animationInterval = interval; animationCallback = callback; animationCallbackParam = callbackParam; @@ -145,10 +175,14 @@ - (void)setAnimationCallback:(int)interval - (void)startAnimation { +#ifdef __IPHONE_10_3 + SDL_WindowData *data; +#endif + displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(doLoop:)]; #ifdef __IPHONE_10_3 - SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; + data = (__bridge SDL_WindowData *) window->driverdata; if ([displayLink respondsToSelector:@selector(preferredFramesPerSecond)] && data != nil && data.uiwindow != nil @@ -174,9 +208,9 @@ - (void)stopAnimation - (void)doLoop:(CADisplayLink*)sender { /* Don't run the game loop while a messagebox is up */ - if (!UIKit_ShowingMessageBox()) { + if (animationCallback && !UIKit_ShowingMessageBox()) { /* See the comment in the function definition. */ -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) UIKit_GL_RestoreCurrentContext(); #endif @@ -247,7 +281,7 @@ - (BOOL)prefersPointerLocked /* ---- Keyboard related functionality below this line ---- */ -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD @synthesize textInputRect; @synthesize keyboardHeight; @@ -256,8 +290,9 @@ - (BOOL)prefersPointerLocked /* Set ourselves up as a UITextFieldDelegate */ - (void)initKeyboard { + NSNotificationCenter *center; obligateForBackspace = @" "; /* 64 space */ - textField = [[UITextField alloc] initWithFrame:CGRectZero]; + textField = [[SDLUITextField alloc] initWithFrame:CGRectZero]; textField.delegate = self; /* placeholder so there is something to delete! */ textField.text = obligateForBackspace; @@ -275,10 +310,24 @@ - (void)initKeyboard textField.hidden = YES; keyboardVisible = NO; - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + center = [NSNotificationCenter defaultCenter]; #if !TARGET_OS_TV - [center addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; + [center addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + [center addObserver:self + selector:@selector(keyboardDidShow:) + name:UIKeyboardDidShowNotification + object:nil]; + [center addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + [center addObserver:self + selector:@selector(keyboardDidHide:) + name:UIKeyboardDidHideNotification + object:nil]; #endif [center addObserver:self selector:@selector(textFieldTextDidChange:) name:UITextFieldTextDidChangeNotification object:nil]; } @@ -341,8 +390,18 @@ - (void)deinitKeyboard { NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; #if !TARGET_OS_TV - [center removeObserver:self name:UIKeyboardWillShowNotification object:nil]; - [center removeObserver:self name:UIKeyboardWillHideNotification object:nil]; + [center removeObserver:self + name:UIKeyboardWillShowNotification + object:nil]; + [center removeObserver:self + name:UIKeyboardDidShowNotification + object:nil]; + [center removeObserver:self + name:UIKeyboardWillHideNotification + object:nil]; + [center removeObserver:self + name:UIKeyboardDidHideNotification + object:nil]; #endif [center removeObserver:self name:UITextFieldTextDidChangeNotification object:nil]; } @@ -350,25 +409,45 @@ - (void)deinitKeyboard /* reveal onscreen virtual keyboard */ - (void)showKeyboard { + if (keyboardVisible) { + return; + } + keyboardVisible = YES; if (textField.window) { showingKeyboard = YES; [textField becomeFirstResponder]; - showingKeyboard = NO; } } /* hide onscreen virtual keyboard */ - (void)hideKeyboard { + if (!keyboardVisible) { + return; + } + keyboardVisible = NO; - [textField resignFirstResponder]; + if (textField.window) { + hidingKeyboard = YES; + [textField resignFirstResponder]; + } } - (void)keyboardWillShow:(NSNotification *)notification { + BOOL shouldStartTextInput = NO; #if !TARGET_OS_TV - CGRect kbrect = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect kbrect; +#endif + + if (!SDL_IsTextInputActive() && !hidingKeyboard && !rotatingOrientation) { + shouldStartTextInput = YES; + } + + showingKeyboard = YES; +#if !TARGET_OS_TV + kbrect = [[notification userInfo][UIKeyboardFrameEndUserInfoKey] CGRectValue]; /* The keyboard rect is in the coordinate space of the screen/window, but we * want its height in the coordinate space of the view. */ @@ -376,14 +455,36 @@ - (void)keyboardWillShow:(NSNotification *)notification [self setKeyboardHeight:(int)kbrect.size.height]; #endif + + if (shouldStartTextInput) { + SDL_StartTextInput(); + } +} + +- (void)keyboardDidShow:(NSNotification *)notification +{ + showingKeyboard = NO; } - (void)keyboardWillHide:(NSNotification *)notification { - if (!showingKeyboard && !rotatingOrientation) { - SDL_StopTextInput(); + BOOL shouldStopTextInput = NO; + + if (SDL_IsTextInputActive() && !showingKeyboard && !rotatingOrientation) { + shouldStopTextInput = YES; } + + hidingKeyboard = YES; [self setKeyboardHeight:0]; + + if (shouldStopTextInput) { + SDL_StopTextInput(); + } +} + +- (void)keyboardDidHide:(NSNotification *)notification +{ + hidingKeyboard = NO; } - (void)textFieldTextDidChange:(NSNotification *)notification @@ -402,8 +503,8 @@ - (void)textFieldTextDidChange:(NSNotification *)notification size_t deleteLength = SDL_utf8strlen([[committedText substringFromIndex:matchLength] UTF8String]); while (deleteLength > 0) { /* Send distinct down and up events for each backspace action */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE); + SDL_SendVirtualKeyboardKey(SDL_PRESSED, SDL_SCANCODE_BACKSPACE); + SDL_SendVirtualKeyboardKey(SDL_RELEASED, SDL_SCANCODE_BACKSPACE); --deleteLength; } } @@ -426,9 +527,11 @@ - (void)textFieldTextDidChange:(NSNotification *)notification - (void)updateKeyboard { + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + CGAffineTransform t = self.view.transform; CGPoint offset = CGPointMake(0.0, 0.0); - CGRect frame = UIKit_ComputeViewFrame(window, self.view.window.screen); + CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); if (self.keyboardHeight) { int rectbottom = self.textInputRect.y + self.textInputRect.h; @@ -486,29 +589,27 @@ - (BOOL)textFieldShouldReturn:(UITextField*)_textField @end /* iPhone keyboard addition functions */ -#if SDL_IPHONE_KEYBOARD +#ifdef SDL_IPHONE_KEYBOARD -static SDL_uikitviewcontroller * -GetWindowViewController(SDL_Window * window) +static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window * window) { + SDL_WindowData *data; if (!window || !window->driverdata) { SDL_SetError("Invalid window"); return nil; } - SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; + data = (__bridge SDL_WindowData *)window->driverdata; return data.viewcontroller; } -SDL_bool -UIKit_HasScreenKeyboardSupport(_THIS) +SDL_bool UIKit_HasScreenKeyboardSupport(_THIS) { return SDL_TRUE; } -void -UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) +void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -516,8 +617,7 @@ - (BOOL)textFieldShouldReturn:(UITextField*)_textField } } -void -UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) +void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -525,8 +625,7 @@ - (BOOL)textFieldShouldReturn:(UITextField*)_textField } } -SDL_bool -UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); @@ -537,8 +636,7 @@ - (BOOL)textFieldShouldReturn:(UITextField*)_textField } } -void -UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect) +void UIKit_SetTextInputRect(_THIS, const SDL_Rect *rect) { if (!rect) { SDL_InvalidParamError("rect"); diff --git a/src/video/uikit/SDL_uikitvulkan.h b/src/video/uikit/SDL_uikitvulkan.h index cc8f777eb59c7..af436c4645e1a 100644 --- a/src/video/uikit/SDL_uikitvulkan.h +++ b/src/video/uikit/SDL_uikitvulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_UIKIT +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_UIKIT) int UIKit_Vulkan_LoadLibrary(_THIS, const char *path); void UIKit_Vulkan_UnloadLibrary(_THIS); diff --git a/src/video/uikit/SDL_uikitvulkan.m b/src/video/uikit/SDL_uikitvulkan.m index 52a1ceddb007c..01cfd7ecf839b 100644 --- a/src/video/uikit/SDL_uikitvulkan.m +++ b/src/video/uikit/SDL_uikitvulkan.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_UIKIT +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_UIKIT) #include "SDL_uikitvideo.h" #include "SDL_uikitwindow.h" diff --git a/src/video/uikit/SDL_uikitwindow.h b/src/video/uikit/SDL_uikitwindow.h index 7ca9b475ed227..7dd90acd53efb 100644 --- a/src/video/uikit/SDL_uikitwindow.h +++ b/src/video/uikit/SDL_uikitwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 7b8dfff56e838..0e0ea0577e673 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #include "SDL_hints.h" #include "SDL_mouse.h" @@ -84,8 +84,7 @@ - (void)layoutSubviews @end -static int -SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) +static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata; @@ -115,14 +114,6 @@ - (void)layoutSubviews #if !TARGET_OS_TV if (displaydata.uiscreen == [UIScreen mainScreen]) { - /* SDL_CreateWindow sets the window w&h to the display's bounds if the - * fullscreen flag is set. But the display bounds orientation might not - * match what we want, and GetSupportedOrientations call below uses the - * window w&h. They're overridden below anyway, so we'll just set them - * to the requested size for the purposes of determining orientation. */ - window->w = window->windowed.w; - window->h = window->windowed.h; - NSUInteger orients = UIKit_GetSupportedOrientations(window); BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0; BOOL supportsPortrait = (orients & (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown)) != 0; @@ -158,13 +149,16 @@ - (void)layoutSubviews return 0; } -int -UIKit_CreateWindow(_THIS, SDL_Window *window) +int UIKit_CreateWindow(_THIS, SDL_Window *window) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata; SDL_Window *other; + UIWindow *uiwindow; +#if !TARGET_OS_TV + const CGSize origsize = data.uiscreen.currentMode.size; +#endif /* We currently only handle a single window per display on iOS */ for (other = _this->windows; other; other = other->next) { @@ -177,14 +171,13 @@ - (void)layoutSubviews * user, so it's in standby), try to force the display to a resolution * that most closely matches the desired window size. */ #if !TARGET_OS_TV - const CGSize origsize = data.uiscreen.currentMode.size; if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) { + int i; + const SDL_DisplayMode *bestmode = NULL; if (display->num_display_modes == 0) { _this->GetDisplayModes(_this, display); } - int i; - const SDL_DisplayMode *bestmode = NULL; for (i = display->num_display_modes; i >= 0; i--) { const SDL_DisplayMode *mode = &display->display_modes[i]; if ((mode->w >= window->w) && (mode->h >= window->h)) { @@ -214,7 +207,7 @@ - (void)layoutSubviews /* ignore the size user requested, and make a fullscreen window */ /* !!! FIXME: can we have a smaller view? */ - UIWindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds]; + uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds]; /* put the window on an external display if appropriate. */ if (data.uiscreen != [UIScreen mainScreen]) { @@ -229,8 +222,7 @@ - (void)layoutSubviews return 1; } -void -UIKit_SetWindowTitle(_THIS, SDL_Window * window) +void UIKit_SetWindowTitle(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -238,16 +230,17 @@ - (void)layoutSubviews } } -void -UIKit_ShowWindow(_THIS, SDL_Window * window) +void UIKit_ShowWindow(_THIS, SDL_Window * window) { @autoreleasepool { + SDL_VideoDisplay *display; + SDL_DisplayData *displaydata; SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; [data.uiwindow makeKeyAndVisible]; /* Make this window the current mouse focus for touch input */ - SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata; + display = SDL_GetDisplayForWindow(window); + displaydata = (__bridge SDL_DisplayData *) display->driverdata; if (displaydata.uiscreen == [UIScreen mainScreen]) { SDL_SetMouseFocus(window); SDL_SetKeyboardFocus(window); @@ -255,8 +248,7 @@ - (void)layoutSubviews } } -void -UIKit_HideWindow(_THIS, SDL_Window * window) +void UIKit_HideWindow(_THIS, SDL_Window * window) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -264,8 +256,7 @@ - (void)layoutSubviews } } -void -UIKit_RaiseWindow(_THIS, SDL_Window * window) +void UIKit_RaiseWindow(_THIS, SDL_Window * window) { /* We don't currently offer a concept of "raising" the SDL window, since * we only allow one per display, in the iOS fashion. @@ -274,8 +265,7 @@ - (void)layoutSubviews _this->GL_MakeCurrent(_this, _this->current_glwin, _this->current_glctx); } -static void -UIKit_UpdateWindowBorder(_THIS, SDL_Window * window) +static void UIKit_UpdateWindowBorder(_THIS, SDL_Window * window) { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; @@ -304,30 +294,26 @@ - (void)layoutSubviews [viewcontroller.view layoutIfNeeded]; } -void -UIKit_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +void UIKit_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) { @autoreleasepool { UIKit_UpdateWindowBorder(_this, window); } } -void -UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) { @autoreleasepool { UIKit_UpdateWindowBorder(_this, window); } } -void -UIKit_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void UIKit_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { /* There really isn't a concept of window grab or cursor confinement on iOS */ } -void -UIKit_UpdatePointerLock(_THIS, SDL_Window * window) +void UIKit_UpdatePointerLock(_THIS, SDL_Window * window) { #if !TARGET_OS_TV #if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 @@ -342,12 +328,11 @@ - (void)layoutSubviews #endif /* !TARGET_OS_TV */ } -void -UIKit_DestroyWindow(_THIS, SDL_Window * window) +void UIKit_DestroyWindow(_THIS, SDL_Window * window) { @autoreleasepool { if (window->driverdata != NULL) { - SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata); + SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata; NSArray *views = nil; [data.viewcontroller stopAnimation]; @@ -366,13 +351,14 @@ - (void)layoutSubviews * SDL window. */ data.uiwindow.rootViewController = nil; data.uiwindow.hidden = YES; + + CFRelease(window->driverdata); + window->driverdata = NULL; } } - window->driverdata = NULL; } -void -UIKit_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) +void UIKit_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) { @autoreleasepool { SDL_WindowData *windata = (__bridge SDL_WindowData *) window->driverdata; @@ -390,8 +376,7 @@ - (void)layoutSubviews *h = size.height * scale; }} -SDL_bool -UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { @autoreleasepool { SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata; @@ -404,7 +389,7 @@ - (void)layoutSubviews /* These struct members were added in SDL 2.0.4. */ if (versionnum >= SDL_VERSIONNUM(2,0,4)) { -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) if ([data.viewcontroller.view isKindOfClass:[SDL_uikitopenglview class]]) { SDL_uikitopenglview *glview = (SDL_uikitopenglview *)data.viewcontroller.view; info->info.uikit.framebuffer = glview.drawableFramebuffer; @@ -430,8 +415,7 @@ - (void)layoutSubviews } #if !TARGET_OS_TV -NSUInteger -UIKit_GetSupportedOrientations(SDL_Window * window) +NSUInteger UIKit_GetSupportedOrientations(SDL_Window * window) { const char *hint = SDL_GetHint(SDL_HINT_ORIENTATIONS); NSUInteger validOrientations = UIInterfaceOrientationMaskAll; @@ -472,10 +456,10 @@ - (void)layoutSubviews } if (orientationMask == 0) { - if (window->w >= window->h) { + if (window->windowed.w >= window->windowed.h) { orientationMask |= UIInterfaceOrientationMaskLandscape; } - if (window->h >= window->w) { + if (window->windowed.h >= window->windowed.w) { orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); } } @@ -497,8 +481,7 @@ - (void)layoutSubviews } #endif /* !TARGET_OS_TV */ -int -SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam) +int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { if (!window || !window->driverdata) { return SDL_SetError("Invalid window"); diff --git a/src/video/vita/SDL_vitaframebuffer.c b/src/video/vita/SDL_vitaframebuffer.c index 1c558486b3d54..c0f9d9e8cd969 100644 --- a/src/video/vita/SDL_vitaframebuffer.c +++ b/src/video/vita/SDL_vitaframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,15 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #include "SDL_vitavideo.h" #include -#define SCREEN_W 960 -#define SCREEN_H 544 -#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) +#define SCREEN_W 960 +#define SCREEN_H 544 +#define ALIGN(x, a) (((x) + ((a)-1)) & ~((a)-1)) #define DISPLAY_PIXEL_FORMAT SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 void *vita_gpu_alloc(unsigned int type, unsigned int size, SceUID *uid) @@ -36,18 +36,20 @@ void *vita_gpu_alloc(unsigned int type, unsigned int size, SceUID *uid) void *mem; if (type == SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW) { - size = ALIGN(size, 256*1024); + size = ALIGN(size, 256 * 1024); } else { - size = ALIGN(size, 4*1024); + size = ALIGN(size, 4 * 1024); } *uid = sceKernelAllocMemBlock("gpu_mem", type, size, NULL); - if (*uid < 0) + if (*uid < 0) { return NULL; + } - if (sceKernelGetMemBlockBase(*uid, &mem) < 0) + if (sceKernelGetMemBlockBase(*uid, &mem) < 0) { return NULL; + } return mem; } @@ -55,14 +57,15 @@ void *vita_gpu_alloc(unsigned int type, unsigned int size, SceUID *uid) void vita_gpu_free(SceUID uid) { void *mem = NULL; - if (sceKernelGetMemBlockBase(uid, &mem) < 0) + if (sceKernelGetMemBlockBase(uid, &mem) < 0) { return; + } sceKernelFreeMemBlock(uid); } -int VITA_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int VITA_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SceDisplayFrameBuf framebuf; *format = SDL_PIXELFORMAT_ABGR8888; @@ -71,19 +74,18 @@ int VITA_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, vo data->buffer = vita_gpu_alloc( SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW, 4 * SCREEN_W * SCREEN_H, - &data->buffer_uid - ); + &data->buffer_uid); // SDL_memset the buffer to black - SDL_memset(data->buffer, 0x0, SCREEN_W*SCREEN_H*4); + SDL_memset(data->buffer, 0x0, SCREEN_W * SCREEN_H * 4); SDL_memset(&framebuf, 0x00, sizeof(SceDisplayFrameBuf)); - framebuf.size = sizeof(SceDisplayFrameBuf); - framebuf.base = data->buffer; - framebuf.pitch = SCREEN_W; + framebuf.size = sizeof(SceDisplayFrameBuf); + framebuf.base = data->buffer; + framebuf.pitch = SCREEN_W; framebuf.pixelformat = DISPLAY_PIXEL_FORMAT; - framebuf.width = SCREEN_W; - framebuf.height = SCREEN_H; + framebuf.width = SCREEN_W; + framebuf.height = SCREEN_H; sceDisplaySetFrameBuf(&framebuf, SCE_DISPLAY_SETBUF_NEXTFRAME); *pixels = data->buffer; @@ -91,15 +93,15 @@ int VITA_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, vo return 0; } -int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { // do nothing return 0; } -void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (!data) { /* The window wasn't fully initialized */ diff --git a/src/video/vita/SDL_vitaframebuffer.h b/src/video/vita/SDL_vitaframebuffer.h index f2d1e1b9405d1..cb6d317c121bb 100644 --- a/src/video/vita/SDL_vitaframebuffer.h +++ b/src/video/vita/SDL_vitaframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,8 @@ */ #include "../../SDL_internal.h" -extern int VITA_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int VITA_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int VITA_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void VITA_DestroyWindowFramebuffer(_THIS, SDL_Window *window); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c index d51150c03ce05..f9845776ab19a 100644 --- a/src/video/vita/SDL_vitagl_pvr.c +++ b/src/video/vita/SDL_vitagl_pvr.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PVR && SDL_VIDEO_VITA_PVR_OGL +#if defined(SDL_VIDEO_DRIVER_VITA) && defined(SDL_VIDEO_VITA_PVR) && defined(SDL_VIDEO_VITA_PVR_OGL) #include #include #include @@ -45,20 +45,17 @@ void getFBSize(int *width, int *height) *height = FB_HEIGHT; } -int -VITA_GL_LoadLibrary(_THIS, const char *path) +int VITA_GL_LoadLibrary(_THIS, const char *path) { PVRSRV_PSP2_APPHINT hint; - char* override = SDL_getenv("VITA_MODULE_PATH"); - char* skip_init = SDL_getenv("VITA_PVR_SKIP_INIT"); - char* default_path = "app0:module"; + char *override = SDL_getenv("VITA_MODULE_PATH"); + char *skip_init = SDL_getenv("VITA_PVR_SKIP_INIT"); + char *default_path = "app0:module"; char target_path[MAX_PATH]; - if (skip_init == NULL) // we don't care about actual value - { - if (override != NULL) - { - default_path = override; + if (!skip_init) { // we don't care about actual value + if (override) { + default_path = override; } sceKernelLoadStartModule("vs0:sys/external/libfios2.suprx", 0, NULL, 0, NULL, NULL); @@ -82,11 +79,10 @@ VITA_GL_LoadLibrary(_THIS, const char *path) PVRSRVCreateVirtualAppHint(&hint); } - return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0, 0); + return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } -SDL_GLContext -VITA_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window *window) { char gl_version[3]; SDL_GLContext context = NULL; @@ -99,10 +95,9 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window) _this->gl_config.minor_version = 0; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; - context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); - if (context != NULL) - { + if (context != NULL) { FB_WIDTH = window->w; FB_HEIGHT = window->h; set_getprocaddress((void *(*)(const char *))eglGetProcAddress); @@ -121,8 +116,7 @@ VITA_GL_CreateContext(_THIS, SDL_Window * window) return context; } -void * -VITA_GL_GetProcAddress(_THIS, const char *proc) +void *VITA_GL_GetProcAddress(_THIS, const char *proc) { return gl4es_GetProcAddress(proc); } diff --git a/src/video/vita/SDL_vitagl_pvr_c.h b/src/video/vita/SDL_vitagl_pvr_c.h index 2329d472b6dff..083ebac706ad2 100644 --- a/src/video/vita/SDL_vitagl_pvr_c.h +++ b/src/video/vita/SDL_vitagl_pvr_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,11 +24,10 @@ #include "SDL_vitavideo.h" -extern SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window * window); +extern SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window *window); extern int VITA_GL_LoadLibrary(_THIS, const char *path); extern void *VITA_GL_GetProcAddress(_THIS, const char *proc); - #endif /* SDL_vitagl_pvr_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitagles.c b/src/video/vita/SDL_vitagles.c index 18ca7d57bfd81..d3edcecd53d6a 100644 --- a/src/video/vita/SDL_vitagles.c +++ b/src/video/vita/SDL_vitagles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PIB +#if defined(SDL_VIDEO_DRIVER_VITA) && defined(SDL_VIDEO_VITA_PIB) #include #include @@ -32,20 +32,19 @@ /*****************************************************************************/ /* SDL OpenGL/OpenGL ES functions */ /*****************************************************************************/ -#define EGLCHK(stmt) \ - do { \ - EGLint err; \ - \ - stmt; \ - err = eglGetError(); \ - if (err != EGL_SUCCESS) { \ - SDL_SetError("EGL error %d", err); \ - return 0; \ - } \ +#define EGLCHK(stmt) \ + do { \ + EGLint err; \ + \ + stmt; \ + err = eglGetError(); \ + if (err != EGL_SUCCESS) { \ + SDL_SetError("EGL error %d", err); \ + return 0; \ + } \ } while (0) -void -VITA_GLES_KeyboardCallback(ScePigletPreSwapData *data) +void VITA_GLES_KeyboardCallback(ScePigletPreSwapData *data) { SceCommonDialogUpdateParam commonDialogParam; SDL_zero(commonDialogParam); @@ -61,21 +60,18 @@ VITA_GLES_KeyboardCallback(ScePigletPreSwapData *data) sceCommonDialogUpdate(&commonDialogParam); } -int -VITA_GLES_LoadLibrary(_THIS, const char *path) +int VITA_GLES_LoadLibrary(_THIS, const char *path) { - pibInit(PIB_SHACCCG | PIB_GET_PROC_ADDR_CORE); - return 0; + pibInit(PIB_SHACCCG | PIB_GET_PROC_ADDR_CORE); + return 0; } -void * -VITA_GLES_GetProcAddress(_THIS, const char *proc) +void *VITA_GLES_GetProcAddress(_THIS, const char *proc) { return eglGetProcAddress(proc); } -void -VITA_GLES_UnloadLibrary(_THIS) +void VITA_GLES_UnloadLibrary(_THIS) { eglTerminate(_this->gl_data->display); } @@ -83,11 +79,10 @@ VITA_GLES_UnloadLibrary(_THIS) static EGLint width = 960; static EGLint height = 544; -SDL_GLContext -VITA_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window) { - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata; EGLint attribs[32]; EGLDisplay display; @@ -138,13 +133,11 @@ VITA_GLES_CreateContext(_THIS, SDL_Window * window) EGLCHK(eglChooseConfig(display, attribs, &config, 1, &num_configs)); - if (num_configs == 0) - { + if (num_configs == 0) { SDL_SetError("No valid EGL configs for requested mode"); return 0; } - EGLCHK(surface = eglCreateWindowSurface(display, config, VITA_WINDOW_960X544, NULL)); EGLCHK(context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs)); @@ -158,25 +151,22 @@ VITA_GLES_CreateContext(_THIS, SDL_Window * window) _this->gl_data->context = context; _this->gl_data->surface = surface; - preSwapCallback = (PFNEGLPIGLETVITASETPRESWAPCALLBACKSCEPROC) eglGetProcAddress("eglPigletVitaSetPreSwapCallbackSCE"); + preSwapCallback = (PFNEGLPIGLETVITASETPRESWAPCALLBACKSCEPROC)eglGetProcAddress("eglPigletVitaSetPreSwapCallbackSCE"); preSwapCallback(VITA_GLES_KeyboardCallback); return context; } -int -VITA_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { - if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, - _this->gl_data->surface, _this->gl_data->context)) - { - return SDL_SetError("Unable to make EGL context current"); - } + if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface, + _this->gl_data->surface, _this->gl_data->context)) { + return SDL_SetError("Unable to make EGL context current"); + } return 0; } -int -VITA_GLES_SetSwapInterval(_THIS, int interval) +int VITA_GLES_SetSwapInterval(_THIS, int interval) { EGLBoolean status; status = eglSwapInterval(_this->gl_data->display, interval); @@ -189,14 +179,12 @@ VITA_GLES_SetSwapInterval(_THIS, int interval) return SDL_SetError("Unable to set the EGL swap interval"); } -int -VITA_GLES_GetSwapInterval(_THIS) +int VITA_GLES_GetSwapInterval(_THIS) { return _this->gl_data->swapinterval; } -int -VITA_GLES_SwapWindow(_THIS, SDL_Window * window) +int VITA_GLES_SwapWindow(_THIS, SDL_Window *window) { if (!eglSwapBuffers(_this->gl_data->display, _this->gl_data->surface)) { return SDL_SetError("eglSwapBuffers() failed"); @@ -204,10 +192,9 @@ VITA_GLES_SwapWindow(_THIS, SDL_Window * window) return 0; } -void -VITA_GLES_DeleteContext(_THIS, SDL_GLContext context) +void VITA_GLES_DeleteContext(_THIS, SDL_GLContext context) { - SDL_VideoData *phdata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *phdata = (SDL_VideoData *)_this->driverdata; EGLBoolean status; if (phdata->egl_initialized != SDL_TRUE) { diff --git a/src/video/vita/SDL_vitagles_c.h b/src/video/vita/SDL_vitagles_c.h index 10fd8533a01f7..a86e43b31ed1e 100644 --- a/src/video/vita/SDL_vitagles_c.h +++ b/src/video/vita/SDL_vitagles_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,6 @@ #ifndef SDL_vitagles_c_h_ #define SDL_vitagles_c_h_ - #include #include #include @@ -31,27 +30,26 @@ #include "SDL_vitavideo.h" - -typedef struct SDL_GLDriverData { - EGLDisplay display; - EGLContext context; - EGLSurface surface; +typedef struct SDL_GLDriverData +{ + EGLDisplay display; + EGLContext context; + EGLSurface surface; uint32_t swapinterval; -}SDL_GLDriverData; +} SDL_GLDriverData; -extern void * VITA_GLES_GetProcAddress(_THIS, const char *proc); -extern int VITA_GLES_MakeCurrent(_THIS,SDL_Window * window, SDL_GLContext context); +extern void *VITA_GLES_GetProcAddress(_THIS, const char *proc); +extern int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void VITA_GLES_SwapBuffers(_THIS); -extern int VITA_GLES_SwapWindow(_THIS, SDL_Window * window); -extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window * window); +extern int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); +extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); extern int VITA_GLES_LoadLibrary(_THIS, const char *path); extern void VITA_GLES_UnloadLibrary(_THIS); extern int VITA_GLES_SetSwapInterval(_THIS, int interval); extern int VITA_GLES_GetSwapInterval(_THIS); - #endif /* SDL_vitagles_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitagles_pvr.c b/src/video/vita/SDL_vitagles_pvr.c index bb06d2946b333..066e466a9dcd0 100644 --- a/src/video/vita/SDL_vitagles_pvr.c +++ b/src/video/vita/SDL_vitagles_pvr.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PVR +#if defined(SDL_VIDEO_DRIVER_VITA) && defined(SDL_VIDEO_VITA_PVR) #include #include #include @@ -34,20 +34,18 @@ #define MAX_PATH 256 // vita limits are somehow wrong -int -VITA_GLES_LoadLibrary(_THIS, const char *path) +int VITA_GLES_LoadLibrary(_THIS, const char *path) { PVRSRV_PSP2_APPHINT hint; - char* override = SDL_getenv("VITA_MODULE_PATH"); - char* skip_init = SDL_getenv("VITA_PVR_SKIP_INIT"); - char* default_path = "app0:module"; + char *override = SDL_getenv("VITA_MODULE_PATH"); + char *skip_init = SDL_getenv("VITA_PVR_SKIP_INIT"); + char *default_path = "app0:module"; char target_path[MAX_PATH]; - if (skip_init == NULL) // we don't care about actual value - { - if (override != NULL) - { - default_path = override; + if (!skip_init) { // we don't care about actual value + + if (override) { + default_path = override; } sceKernelLoadStartModule("vs0:sys/external/libfios2.suprx", 0, NULL, 0, NULL, NULL); @@ -68,36 +66,32 @@ VITA_GLES_LoadLibrary(_THIS, const char *path) PVRSRVCreateVirtualAppHint(&hint); } - return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) 0, 0); + return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); } -SDL_GLContext -VITA_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window) { - return SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + return SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); } -int -VITA_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { if (window && context) { - return SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *) window->driverdata)->egl_surface, context); + return SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *)window->driverdata)->egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); } } -int -VITA_GLES_SwapWindow(_THIS, SDL_Window * window) +int VITA_GLES_SwapWindow(_THIS, SDL_Window *window) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; if (videodata->ime_active) { sceImeUpdate(); } - return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); + return SDL_EGL_SwapBuffers(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); } - #endif /* SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PVR */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitagles_pvr_c.h b/src/video/vita/SDL_vitagles_pvr_c.h index c3a13c4362a48..53788657dac75 100644 --- a/src/video/vita/SDL_vitagles_pvr_c.h +++ b/src/video/vita/SDL_vitagles_pvr_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,12 +24,11 @@ #include "SDL_vitavideo.h" -extern int VITA_GLES_MakeCurrent(_THIS,SDL_Window * window, SDL_GLContext context); -extern int VITA_GLES_SwapWindow(_THIS, SDL_Window * window); -extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window * window); +extern int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); +extern int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); +extern SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); extern int VITA_GLES_LoadLibrary(_THIS, const char *path); - #endif /* SDL_vitagles_pvr_c_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitakeyboard.c b/src/video/vita/SDL_vitakeyboard.c index 409d424b1f914..a110661ae9c8e 100644 --- a/src/video/vita/SDL_vitakeyboard.c +++ b/src/video/vita/SDL_vitakeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #include #include @@ -34,13 +34,12 @@ SceHidKeyboardReport k_reports[SCE_HID_MAX_REPORT]; int keyboard_hid_handle = 0; -Uint8 prev_keys[6] = {0}; +Uint8 prev_keys[6] = { 0 }; Uint8 prev_modifiers = 0; Uint8 locks = 0; Uint8 lock_key_down = 0; -void -VITA_InitKeyboard(void) +void VITA_InitKeyboard(void) { #if defined(SDL_VIDEO_VITA_PVR) sceSysmoduleLoadModule(SCE_SYSMODULE_IME); /** For PVR OSK Support **/ @@ -48,21 +47,19 @@ VITA_InitKeyboard(void) sceHidKeyboardEnumerate(&keyboard_hid_handle, 1); } -void -VITA_PollKeyboard(void) +void VITA_PollKeyboard(void) { // We skip polling keyboard if no window is created - if (Vita_Window == NULL) + if (!Vita_Window) { return; + } - if (keyboard_hid_handle > 0) - { - int numReports = sceHidKeyboardRead(keyboard_hid_handle, (SceHidKeyboardReport**)&k_reports, SCE_HID_MAX_REPORT); + if (keyboard_hid_handle > 0) { + int numReports = sceHidKeyboardRead(keyboard_hid_handle, (SceHidKeyboardReport **)&k_reports, SCE_HID_MAX_REPORT); if (numReports < 0) { keyboard_hid_handle = 0; - } - else if (numReports) { + } else if (numReports) { // Numlock and Capslock state changes only on a SDL_PRESSED event // The k_report only reports the state of the LED if (k_reports[numReports - 1].modifiers[1] & 0x1) { @@ -70,8 +67,7 @@ VITA_PollKeyboard(void) SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); locks |= 0x1; } - } - else { + } else { if (locks & 0x1) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); @@ -85,8 +81,7 @@ VITA_PollKeyboard(void) SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); locks |= 0x2; } - } - else { + } else { if (locks & 0x2) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); @@ -100,8 +95,7 @@ VITA_PollKeyboard(void) SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_SCROLLLOCK); locks |= 0x4; } - } - else { + } else { if (locks & 0x4) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_SCROLLLOCK); locks &= ~0x4; @@ -114,64 +108,56 @@ VITA_PollKeyboard(void) if (changed_modifiers & 0x01) { if (prev_modifiers & 0x01) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LCTRL); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LCTRL); } } if (changed_modifiers & 0x02) { if (prev_modifiers & 0x02) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); } } if (changed_modifiers & 0x04) { if (prev_modifiers & 0x04) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LALT); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LALT); } } if (changed_modifiers & 0x08) { if (prev_modifiers & 0x08) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LGUI); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LGUI); } } if (changed_modifiers & 0x10) { if (prev_modifiers & 0x10) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RCTRL); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RCTRL); } - } + } if (changed_modifiers & 0x20) { if (prev_modifiers & 0x20) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RSHIFT); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RSHIFT); } } if (changed_modifiers & 0x40) { if (prev_modifiers & 0x40) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RALT); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RALT); } } if (changed_modifiers & 0x80) { if (prev_modifiers & 0x80) { SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RGUI); - } - else { + } else { SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RGUI); } } diff --git a/src/video/vita/SDL_vitakeyboard.h b/src/video/vita/SDL_vitakeyboard.h index 419cba7a3fdff..d63e77cf5cb5f 100644 --- a/src/video/vita/SDL_vitakeyboard.h +++ b/src/video/vita/SDL_vitakeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/vita/SDL_vitamessagebox.c b/src/video/vita/SDL_vitamessagebox.c index 4921139868a8c..f78c9700bc5e2 100644 --- a/src/video/vita/SDL_vitamessagebox.c +++ b/src/video/vita/SDL_vitamessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #include "SDL_vitavideo.h" #include "SDL_vitamessagebox.h" @@ -43,8 +43,7 @@ int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) SceCommonDialogErrorCode init_result; SDL_bool setup_minimal_gxm = SDL_FALSE; - if (messageboxdata->numbuttons > 3) - { + if (messageboxdata->numbuttons > 3) { return -1; } @@ -55,23 +54,18 @@ int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) SDL_zero(msgParam); SDL_snprintf(message, sizeof(message), "%s\r\n\r\n%s", messageboxdata->title, messageboxdata->message); - msgParam.msg = (const SceChar8*)message; + msgParam.msg = (const SceChar8 *)message; SDL_zero(buttonParam); - if (messageboxdata->numbuttons == 3) - { + if (messageboxdata->numbuttons == 3) { msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS; msgParam.buttonParam = &buttonParam; buttonParam.msg1 = messageboxdata->buttons[0].text; buttonParam.msg2 = messageboxdata->buttons[1].text; buttonParam.msg3 = messageboxdata->buttons[2].text; - } - else if (messageboxdata->numbuttons == 2) - { + } else if (messageboxdata->numbuttons == 2) { msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_YESNO; - } - else if (messageboxdata->numbuttons == 1) - { + } else if (messageboxdata->numbuttons == 1) { msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_OK; } param.userMsgParam = &msgParam; @@ -81,8 +75,7 @@ int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) init_result = sceMsgDialogInit(¶m); // Setup display if it hasn't been initialized before - if (init_result == SCE_COMMON_DIALOG_ERROR_GXM_IS_UNINITIALIZED) - { + if (init_result == SCE_COMMON_DIALOG_ERROR_GXM_IS_UNINITIALIZED) { gxm_minimal_init_for_common_dialog(); init_result = sceMsgDialogInit(¶m); setup_minimal_gxm = SDL_TRUE; @@ -90,50 +83,34 @@ int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) gxm_init_for_common_dialog(); - if (init_result >= 0) - { - while (sceMsgDialogGetStatus() == SCE_COMMON_DIALOG_STATUS_RUNNING) - { + if (init_result >= 0) { + while (sceMsgDialogGetStatus() == SCE_COMMON_DIALOG_STATUS_RUNNING) { gxm_swap_for_common_dialog(); } SDL_zero(dialog_result); sceMsgDialogGetResult(&dialog_result); - if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON1) - { + if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON1) { *buttonid = messageboxdata->buttons[0].buttonid; - } - else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON2) - { + } else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON2) { *buttonid = messageboxdata->buttons[1].buttonid; - } - else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON3) - { + } else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_BUTTON3) { *buttonid = messageboxdata->buttons[2].buttonid; - } - else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_YES) - { + } else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_YES) { *buttonid = messageboxdata->buttons[0].buttonid; - } - else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_NO) - { + } else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_NO) { *buttonid = messageboxdata->buttons[1].buttonid; - } - else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_OK) - { + } else if (dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_OK) { *buttonid = messageboxdata->buttons[0].buttonid; } sceMsgDialogTerm(); - } - else - { + } else { return -1; } gxm_term_for_common_dialog(); - if (setup_minimal_gxm) - { + if (setup_minimal_gxm) { gxm_minimal_term_for_common_dialog(); } diff --git a/src/video/vita/SDL_vitamessagebox.h b/src/video/vita/SDL_vitamessagebox.h index 445636010f489..5d54168972abb 100644 --- a/src/video/vita/SDL_vitamessagebox.h +++ b/src/video/vita/SDL_vitamessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_vitamessagebox_h_ #define SDL_vitamessagebox_h_ -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA extern int VITA_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/vita/SDL_vitamouse.c b/src/video/vita/SDL_vitamouse.c index 398a19483d1fe..4c53406ff9f28 100644 --- a/src/video/vita/SDL_vitamouse.c +++ b/src/video/vita/SDL_vitamouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #include #include @@ -37,26 +37,22 @@ SceHidMouseReport m_reports[SCE_HID_MAX_REPORT]; int mouse_hid_handle = 0; Uint8 prev_buttons = 0; -void -VITA_InitMouse(void) +void VITA_InitMouse(void) { sceHidMouseEnumerate(&mouse_hid_handle, 1); } -void -VITA_PollMouse(void) +void VITA_PollMouse(void) { // We skip polling mouse if no window is created - if (Vita_Window == NULL) + if (!Vita_Window) { return; + } - if (mouse_hid_handle > 0) - { - int numReports = sceHidMouseRead(mouse_hid_handle, (SceHidMouseReport**)&m_reports, SCE_HID_MAX_REPORT); - if (numReports > 0) - { - for (int i = 0; i <= numReports - 1; i++) - { + if (mouse_hid_handle > 0) { + int numReports = sceHidMouseRead(mouse_hid_handle, (SceHidMouseReport **)&m_reports, SCE_HID_MAX_REPORT); + if (numReports > 0) { + for (int i = 0; i <= numReports - 1; i++) { Uint8 changed_buttons = m_reports[i].buttons ^ prev_buttons; if (changed_buttons & 0x1) { @@ -77,13 +73,28 @@ VITA_PollMouse(void) else SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_MIDDLE); } + if (changed_buttons & 0x8) { + if (prev_buttons & 0x8) + SDL_SendMouseButton(Vita_Window, 0, SDL_RELEASED, SDL_BUTTON_X1); + else + SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_X1); + } + if (changed_buttons & 0x10) { + if (prev_buttons & 0x10) + SDL_SendMouseButton(Vita_Window, 0, SDL_RELEASED, SDL_BUTTON_X2); + else + SDL_SendMouseButton(Vita_Window, 0, SDL_PRESSED, SDL_BUTTON_X2); + } prev_buttons = m_reports[i].buttons; - if (m_reports[i].rel_x || m_reports[i].rel_y) - { + if (m_reports[i].rel_x || m_reports[i].rel_y) { SDL_SendMouseMotion(Vita_Window, 0, 1, m_reports[i].rel_x, m_reports[i].rel_y); } + + if (m_reports[i].tilt != 0 || m_reports[i].wheel != 0) { + SDL_SendMouseWheel(Vita_Window, 0, m_reports[i].tilt, m_reports[i].wheel, SDL_MOUSEWHEEL_NORMAL); + } } } } diff --git a/src/video/vita/SDL_vitamouse_c.h b/src/video/vita/SDL_vitamouse_c.h index 3549da1023f49..4104eb6fd9a0a 100644 --- a/src/video/vita/SDL_vitamouse_c.h +++ b/src/video/vita/SDL_vitamouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/vita/SDL_vitatouch.c b/src/video/vita/SDL_vitatouch.c index 43a3ecbd21947..62d297716fde3 100644 --- a/src/video/vita/SDL_vitatouch.c +++ b/src/video/vita/SDL_vitatouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #include #include @@ -37,16 +37,16 @@ SceTouchData touch[SCE_TOUCH_PORT_MAX_NUM]; SDL_FRect area_info[SCE_TOUCH_PORT_MAX_NUM]; -struct{ +struct +{ float min; float range; } force_info[SCE_TOUCH_PORT_MAX_NUM]; -char* disableFrontPoll = NULL; -char* disableBackPoll = NULL; +char *disableFrontPoll = NULL; +char *disableBackPoll = NULL; -void -VITA_InitTouch(void) +void VITA_InitTouch(void) { disableFrontPoll = SDL_getenv("VITA_DISABLE_TOUCH_FRONT"); disableBackPoll = SDL_getenv("VITA_DISABLE_TOUCH_BACK"); @@ -56,51 +56,50 @@ VITA_InitTouch(void) sceTouchEnableTouchForce(SCE_TOUCH_PORT_FRONT); sceTouchEnableTouchForce(SCE_TOUCH_PORT_BACK); - for(int port = 0; port < SCE_TOUCH_PORT_MAX_NUM; port++) { + for (int port = 0; port < SCE_TOUCH_PORT_MAX_NUM; port++) { SceTouchPanelInfo panelinfo; sceTouchGetPanelInfo(port, &panelinfo); - area_info[port].x = (float)panelinfo.minAaX; - area_info[port].y = (float)panelinfo.minAaY; - area_info[port].w = (float)(panelinfo.maxAaX - panelinfo.minAaX); - area_info[port].h = (float)(panelinfo.maxAaY - panelinfo.minAaY); + area_info[port].x = (float)panelinfo.minAaX; + area_info[port].y = (float)panelinfo.minAaY; + area_info[port].w = (float)(panelinfo.maxAaX - panelinfo.minAaX); + area_info[port].h = (float)(panelinfo.maxAaY - panelinfo.minAaY); force_info[port].min = (float)panelinfo.minForce; force_info[port].range = (float)(panelinfo.maxForce - panelinfo.minForce); } // Support passing both front and back touch devices in events - SDL_AddTouch((SDL_TouchID)0, SDL_TOUCH_DEVICE_DIRECT, "Front"); - SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, "Back"); + SDL_AddTouch((SDL_TouchID)1, SDL_TOUCH_DEVICE_DIRECT, "Front"); + SDL_AddTouch((SDL_TouchID)2, SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, "Back"); } -void -VITA_QuitTouch(void){ +void VITA_QuitTouch(void) +{ sceTouchDisableTouchForce(SCE_TOUCH_PORT_FRONT); sceTouchDisableTouchForce(SCE_TOUCH_PORT_BACK); } -void -VITA_PollTouch(void) +void VITA_PollTouch(void) { SDL_FingerID finger_id = 0; int port; // We skip polling touch if no window is created - if (Vita_Window == NULL) + if (!Vita_Window) { return; + } SDL_memcpy(touch_old, touch, sizeof(touch_old)); - for(port = 0; port < SCE_TOUCH_PORT_MAX_NUM; port++) { + for (port = 0; port < SCE_TOUCH_PORT_MAX_NUM; port++) { /** Skip polling of Touch Device if environment variable is set **/ if (((port == 0) && disableFrontPoll) || ((port == 1) && disableBackPoll)) { continue; } sceTouchPeek(port, &touch[port], 1); if (touch[port].reportNum > 0) { - for (int i = 0; i < touch[port].reportNum; i++) - { + for (int i = 0; i < touch[port].reportNum; i++) { // adjust coordinates and forces to return normalized values // for the front, screen area is used as a reference (for direct touch) // e.g. touch_x = 1.0 corresponds to screen_x = 960 @@ -112,34 +111,34 @@ VITA_PollTouch(void) if (touch_old[port].reportNum > 0) { for (int j = 0; j < touch_old[port].reportNum; j++) { - if (touch[port].report[i].id == touch_old[port].report[j].id ) { + if (touch[port].report[i].id == touch_old[port].report[j].id) { finger_down = 1; } } } - + VITA_ConvertTouchXYToSDLXY(&x, &y, touch[port].report[i].x, touch[port].report[i].y, port); - finger_id = (SDL_FingerID) touch[port].report[i].id; + finger_id = (SDL_FingerID)touch[port].report[i].id; // Skip if finger was already previously down - if(!finger_down) { + if (!finger_down) { // Send an initial touch - SDL_SendTouch((SDL_TouchID)port, - finger_id, - Vita_Window, - SDL_TRUE, - x, - y, - force); + SDL_SendTouch((SDL_TouchID)(port + 1), + finger_id, + Vita_Window, + SDL_TRUE, + x, + y, + force); } // Always send the motion - SDL_SendTouchMotion((SDL_TouchID)port, - finger_id, - Vita_Window, - x, - y, - force); + SDL_SendTouchMotion((SDL_TouchID)(port + 1), + finger_id, + Vita_Window, + x, + y, + force); } } @@ -149,7 +148,7 @@ VITA_PollTouch(void) int finger_up = 1; if (touch[port].reportNum > 0) { for (int j = 0; j < touch[port].reportNum; j++) { - if (touch[port].report[j].id == touch_old[port].report[i].id ) { + if (touch[port].report[j].id == touch_old[port].report[i].id) { finger_up = 0; } } @@ -159,22 +158,23 @@ VITA_PollTouch(void) float y = 0; float force = (touch_old[port].report[i].force - force_info[port].min) / force_info[port].range; VITA_ConvertTouchXYToSDLXY(&x, &y, touch_old[port].report[i].x, touch_old[port].report[i].y, port); - finger_id = (SDL_FingerID) touch_old[port].report[i].id; + finger_id = (SDL_FingerID)touch_old[port].report[i].id; // Finger released from screen - SDL_SendTouch((SDL_TouchID)port, - finger_id, - Vita_Window, - SDL_FALSE, - x, - y, - force); + SDL_SendTouch((SDL_TouchID)(port + 1), + finger_id, + Vita_Window, + SDL_FALSE, + x, + y, + force); } } } } } -void VITA_ConvertTouchXYToSDLXY(float *sdl_x, float *sdl_y, int vita_x, int vita_y, int port) { +void VITA_ConvertTouchXYToSDLXY(float *sdl_x, float *sdl_y, int vita_x, int vita_y, int port) +{ float x = (vita_x - area_info[port].x) / area_info[port].w; float y = (vita_y - area_info[port].y) / area_info[port].h; @@ -188,7 +188,6 @@ void VITA_ConvertTouchXYToSDLXY(float *sdl_x, float *sdl_y, int vita_x, int vita *sdl_y = y; } - #endif /* SDL_VIDEO_DRIVER_VITA */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vita/SDL_vitatouch.h b/src/video/vita/SDL_vitatouch.h index 02f31bc429a16..62cd28d7f5ebe 100644 --- a/src/video/vita/SDL_vitatouch.h +++ b/src/video/vita/SDL_vitatouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c index 33758d691c28b..afa9b54a61f20 100644 --- a/src/video/vita/SDL_vitavideo.c +++ b/src/video/vita/SDL_vitavideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA /* SDL internals */ #include "../SDL_sysvideo.h" @@ -39,13 +39,14 @@ #include "SDL_vitakeyboard.h" #include "SDL_vitamouse_c.h" #include "SDL_vitaframebuffer.h" +#include "SDL_vitamessagebox.h" #if defined(SDL_VIDEO_VITA_PIB) - #include "SDL_vitagles_c.h" +#include "SDL_vitagles_c.h" #elif defined(SDL_VIDEO_VITA_PVR) - #include "SDL_vitagles_pvr_c.h" +#include "SDL_vitagles_pvr_c.h" #if defined(SDL_VIDEO_VITA_PVR_OGL) - #include "SDL_vitagl_pvr_c.h" +#include "SDL_vitagl_pvr_c.h" #endif #define VITA_GLES_GetProcAddress SDL_EGL_GetProcAddress #define VITA_GLES_UnloadLibrary SDL_EGL_UnloadLibrary @@ -56,44 +57,42 @@ SDL_Window *Vita_Window; -static void -VITA_Destroy(SDL_VideoDevice * device) +static void VITA_Destroy(SDL_VideoDevice *device) { -/* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ + /* SDL_VideoData *phdata = (SDL_VideoData *) device->driverdata; */ SDL_free(device->driverdata); SDL_free(device); -// if (device->driverdata != NULL) { -// device->driverdata = NULL; -// } + // if (device->driverdata != NULL) { + // device->driverdata = NULL; + // } } -static SDL_VideoDevice * -VITA_Create() +static SDL_VideoDevice *VITA_Create() { SDL_VideoDevice *device; SDL_VideoData *phdata; -#if SDL_VIDEO_VITA_PIB +#ifdef SDL_VIDEO_VITA_PIB SDL_GLDriverData *gldata; #endif /* Initialize SDL_VideoDevice structure */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); + if (!device) { SDL_OutOfMemory(); return NULL; } /* Initialize internal VITA specific data */ - phdata = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (phdata == NULL) { + phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!phdata) { SDL_OutOfMemory(); SDL_free(device); return NULL; } -#if SDL_VIDEO_VITA_PIB +#ifdef SDL_VIDEO_VITA_PIB - gldata = (SDL_GLDriverData *) SDL_calloc(1, sizeof(SDL_GLDriverData)); - if (gldata == NULL) { + gldata = (SDL_GLDriverData *)SDL_calloc(1, sizeof(SDL_GLDriverData)); + if (!gldata) { SDL_OutOfMemory(); SDL_free(device); SDL_free(phdata); @@ -134,26 +133,26 @@ VITA_Create() device->DestroyWindow = VITA_DestroyWindow; device->GetWindowWMInfo = VITA_GetWindowWMInfo; -/* - // Disabled, causes issues on high-framerate updates. SDL still emulates this. - device->CreateWindowFramebuffer = VITA_CreateWindowFramebuffer; - device->UpdateWindowFramebuffer = VITA_UpdateWindowFramebuffer; - device->DestroyWindowFramebuffer = VITA_DestroyWindowFramebuffer; -*/ + /* + // Disabled, causes issues on high-framerate updates. SDL still emulates this. + device->CreateWindowFramebuffer = VITA_CreateWindowFramebuffer; + device->UpdateWindowFramebuffer = VITA_UpdateWindowFramebuffer; + device->DestroyWindowFramebuffer = VITA_DestroyWindowFramebuffer; + */ #if defined(SDL_VIDEO_VITA_PIB) || defined(SDL_VIDEO_VITA_PVR) #if defined(SDL_VIDEO_VITA_PVR_OGL) -if(SDL_getenv("VITA_PVR_OGL") != NULL) { - device->GL_LoadLibrary = VITA_GL_LoadLibrary; - device->GL_CreateContext = VITA_GL_CreateContext; - device->GL_GetProcAddress = VITA_GL_GetProcAddress; -} else { + if (SDL_getenv("VITA_PVR_OGL") != NULL) { + device->GL_LoadLibrary = VITA_GL_LoadLibrary; + device->GL_CreateContext = VITA_GL_CreateContext; + device->GL_GetProcAddress = VITA_GL_GetProcAddress; + } else { #endif - device->GL_LoadLibrary = VITA_GLES_LoadLibrary; - device->GL_CreateContext = VITA_GLES_CreateContext; - device->GL_GetProcAddress = VITA_GLES_GetProcAddress; + device->GL_LoadLibrary = VITA_GLES_LoadLibrary; + device->GL_CreateContext = VITA_GLES_CreateContext; + device->GL_GetProcAddress = VITA_GLES_GetProcAddress; #if defined(SDL_VIDEO_VITA_PVR_OGL) -} + } #endif device->GL_UnloadLibrary = VITA_GLES_UnloadLibrary; @@ -177,19 +176,19 @@ if(SDL_getenv("VITA_PVR_OGL") != NULL) { VideoBootStrap VITA_bootstrap = { "VITA", "VITA Video Driver", - VITA_Create + VITA_Create, + VITA_ShowMessageBox }; /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -int -VITA_VideoInit(_THIS) +int VITA_VideoInit(_THIS) { SDL_VideoDisplay display; SDL_DisplayMode current_mode; #if defined(SDL_VIDEO_VITA_PVR) - char* res = SDL_getenv("VITA_RESOLUTION"); + char *res = SDL_getenv("VITA_RESOLUTION"); #endif SDL_zero(current_mode); @@ -234,26 +233,22 @@ VITA_VideoInit(_THIS) return 1; } -void -VITA_VideoQuit(_THIS) +void VITA_VideoQuit(_THIS) { VITA_QuitTouch(); } -void -VITA_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void VITA_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { SDL_AddDisplayMode(display, &display->current_mode); } -int -VITA_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int VITA_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -int -VITA_CreateWindow(_THIS, SDL_Window * window) +int VITA_CreateWindow(_THIS, SDL_Window *window) { SDL_WindowData *wdata; #if defined(SDL_VIDEO_VITA_PVR) @@ -264,8 +259,8 @@ VITA_CreateWindow(_THIS, SDL_Window * window) #endif /* Allocate window internal data */ - wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (wdata == NULL) { + wdata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!wdata) { return SDL_OutOfMemory(); } @@ -273,8 +268,7 @@ VITA_CreateWindow(_THIS, SDL_Window * window) window->driverdata = wdata; // Vita can only have one window - if (Vita_Window != NULL) - { + if (Vita_Window) { return SDL_SetError("Only one window supported"); } @@ -297,27 +291,27 @@ VITA_CreateWindow(_THIS, SDL_Window * window) else { win.windowSize = PSP2_WINDOW_960X544; } - if ((window->flags & SDL_WINDOW_OPENGL) != 0) { - if(SDL_getenv("VITA_PVR_OGL") != NULL) { - /* Set version to 2.1 and PROFILE to ES */ - temp_major = _this->gl_config.major_version; - temp_minor = _this->gl_config.minor_version; - temp_profile = _this->gl_config.profile_mask; - - _this->gl_config.major_version = 2; - _this->gl_config.minor_version = 1; - _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; - } - wdata->egl_surface = SDL_EGL_CreateSurface(_this, &win); - if (wdata->egl_surface == EGL_NO_SURFACE) { - return SDL_SetError("Could not create GLES window surface"); - } - if(SDL_getenv("VITA_PVR_OGL") != NULL) { - /* Revert */ - _this->gl_config.major_version = temp_major; - _this->gl_config.minor_version = temp_minor; - _this->gl_config.profile_mask = temp_profile; - } + if (window->flags & SDL_WINDOW_OPENGL) { + if (SDL_getenv("VITA_PVR_OGL") != NULL) { + /* Set version to 2.1 and PROFILE to ES */ + temp_major = _this->gl_config.major_version; + temp_minor = _this->gl_config.minor_version; + temp_profile = _this->gl_config.profile_mask; + + _this->gl_config.major_version = 2; + _this->gl_config.minor_version = 1; + _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; + } + wdata->egl_surface = SDL_EGL_CreateSurface(_this, &win); + if (wdata->egl_surface == EGL_NO_SURFACE) { + return SDL_SetError("Could not create GLES window surface"); + } + if (SDL_getenv("VITA_PVR_OGL") != NULL) { + /* Revert */ + _this->gl_config.major_version = temp_major; + _this->gl_config.minor_version = temp_minor; + _this->gl_config.profile_mask = temp_profile; + } } #endif @@ -328,61 +322,48 @@ VITA_CreateWindow(_THIS, SDL_Window * window) return 0; } -int -VITA_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int VITA_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) { return -1; } -void -VITA_SetWindowTitle(_THIS, SDL_Window * window) +void VITA_SetWindowTitle(_THIS, SDL_Window *window) { } -void -VITA_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void VITA_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { } -void -VITA_SetWindowPosition(_THIS, SDL_Window * window) +void VITA_SetWindowPosition(_THIS, SDL_Window *window) { } -void -VITA_SetWindowSize(_THIS, SDL_Window * window) +void VITA_SetWindowSize(_THIS, SDL_Window *window) { } -void -VITA_ShowWindow(_THIS, SDL_Window * window) +void VITA_ShowWindow(_THIS, SDL_Window *window) { } -void -VITA_HideWindow(_THIS, SDL_Window * window) +void VITA_HideWindow(_THIS, SDL_Window *window) { } -void -VITA_RaiseWindow(_THIS, SDL_Window * window) +void VITA_RaiseWindow(_THIS, SDL_Window *window) { } -void -VITA_MaximizeWindow(_THIS, SDL_Window * window) +void VITA_MaximizeWindow(_THIS, SDL_Window *window) { } -void -VITA_MinimizeWindow(_THIS, SDL_Window * window) +void VITA_MinimizeWindow(_THIS, SDL_Window *window) { } -void -VITA_RestoreWindow(_THIS, SDL_Window * window) +void VITA_RestoreWindow(_THIS, SDL_Window *window) { } -void -VITA_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void VITA_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { } -void -VITA_DestroyWindow(_THIS, SDL_Window * window) +void VITA_DestroyWindow(_THIS, SDL_Window *window) { -// SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + // SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_WindowData *data; data = window->driverdata; @@ -398,8 +379,7 @@ VITA_DestroyWindow(_THIS, SDL_Window * window) /*****************************************************************************/ /* SDL Window Manager function */ /*****************************************************************************/ -SDL_bool -VITA_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool VITA_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) { if (info->version.major <= SDL_MAJOR_VERSION) { return SDL_TRUE; @@ -422,31 +402,32 @@ SDL_bool VITA_HasScreenKeyboardSupport(_THIS) #define SCE_IME_LANGUAGE_ENGLISH_US SCE_IME_LANGUAGE_ENGLISH #endif -static void utf16_to_utf8(const uint16_t *src, uint8_t *dst) { - int i; - for (i = 0; src[i]; i++) { - if ((src[i] & 0xFF80) == 0) { - *(dst++) = src[i] & 0xFF; - } else if((src[i] & 0xF800) == 0) { - *(dst++) = ((src[i] >> 6) & 0xFF) | 0xC0; - *(dst++) = (src[i] & 0x3F) | 0x80; - } else if((src[i] & 0xFC00) == 0xD800 && (src[i + 1] & 0xFC00) == 0xDC00) { - *(dst++) = (((src[i] + 64) >> 8) & 0x3) | 0xF0; - *(dst++) = (((src[i] >> 2) + 16) & 0x3F) | 0x80; - *(dst++) = ((src[i] >> 4) & 0x30) | 0x80 | ((src[i + 1] << 2) & 0xF); - *(dst++) = (src[i + 1] & 0x3F) | 0x80; - i += 1; - } else { - *(dst++) = ((src[i] >> 12) & 0xF) | 0xE0; - *(dst++) = ((src[i] >> 6) & 0x3F) | 0x80; - *(dst++) = (src[i] & 0x3F) | 0x80; +static void utf16_to_utf8(const uint16_t *src, uint8_t *dst) +{ + int i; + for (i = 0; src[i]; i++) { + if (!(src[i] & 0xFF80)) { + *(dst++) = src[i] & 0xFF; + } else if (!(src[i] & 0xF800)) { + *(dst++) = ((src[i] >> 6) & 0xFF) | 0xC0; + *(dst++) = (src[i] & 0x3F) | 0x80; + } else if ((src[i] & 0xFC00) == 0xD800 && (src[i + 1] & 0xFC00) == 0xDC00) { + *(dst++) = (((src[i] + 64) >> 8) & 0x3) | 0xF0; + *(dst++) = (((src[i] >> 2) + 16) & 0x3F) | 0x80; + *(dst++) = ((src[i] >> 4) & 0x30) | 0x80 | ((src[i + 1] << 2) & 0xF); + *(dst++) = (src[i + 1] & 0x3F) | 0x80; + i += 1; + } else { + *(dst++) = ((src[i] >> 12) & 0xF) | 0xE0; + *(dst++) = ((src[i] >> 6) & 0x3F) | 0x80; + *(dst++) = (src[i] & 0x3F) | 0x80; + } } - } - *dst = '\0'; + *dst = '\0'; } -#if defined (SDL_VIDEO_VITA_PVR) +#if defined(SDL_VIDEO_VITA_PVR) SceWChar16 libime_out[SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1]; char libime_initval[8] = { 1 }; SceImeCaret caret_rev; @@ -461,15 +442,13 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e) if (e->param.text.caretIndex == 0) { SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_BACKSPACE); sceImeSetText((SceWChar16 *)libime_initval, 4); - } - else { + } else { scancode = SDL_GetScancodeFromKey(*(SceWChar16 *)&libime_out[1]); if (scancode == SDL_SCANCODE_SPACE) { SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_SPACE); - } - else { + } else { utf16_to_utf8((SceWChar16 *)&libime_out[1], utf8_buffer); - SDL_SendKeyboardText((const char*)utf8_buffer); + SDL_SendKeyboardText((const char *)utf8_buffer); } SDL_memset(&caret_rev, 0, sizeof(SceImeCaret)); SDL_memset(libime_out, 0, ((SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1) * sizeof(SceWChar16))); @@ -557,13 +536,13 @@ void VITA_HideScreenKeyboard(_THIS, SDL_Window *window) SceCommonDialogStatus dialogStatus = sceImeDialogGetStatus(); switch (dialogStatus) { - default: - case SCE_COMMON_DIALOG_STATUS_NONE: - case SCE_COMMON_DIALOG_STATUS_RUNNING: - break; - case SCE_COMMON_DIALOG_STATUS_FINISHED: - sceImeDialogTerm(); - break; + default: + case SCE_COMMON_DIALOG_STATUS_NONE: + case SCE_COMMON_DIALOG_STATUS_RUNNING: + break; + case SCE_COMMON_DIALOG_STATUS_FINISHED: + sceImeDialogTerm(); + break; } videodata->ime_active = SDL_FALSE; @@ -577,7 +556,7 @@ SDL_bool VITA_IsScreenKeyboardShown(_THIS, SDL_Window *window) return videodata->ime_active; #else SceCommonDialogStatus dialogStatus = sceImeDialogGetStatus(); - return (dialogStatus == SCE_COMMON_DIALOG_STATUS_RUNNING); + return dialogStatus == SCE_COMMON_DIALOG_STATUS_RUNNING; #endif } @@ -600,7 +579,7 @@ void VITA_PumpEvents(_THIS) if (videodata->ime_active == SDL_TRUE) { // update IME status. Terminate, if finished SceCommonDialogStatus dialogStatus = sceImeDialogGetStatus(); - if (dialogStatus == SCE_COMMON_DIALOG_STATUS_FINISHED) { + if (dialogStatus == SCE_COMMON_DIALOG_STATUS_FINISHED) { uint8_t utf8_buffer[SCE_IME_DIALOG_MAX_TEXT_LENGTH]; SceImeDialogResult result; @@ -611,17 +590,17 @@ void VITA_PumpEvents(_THIS) utf16_to_utf8(videodata->ime_buffer, utf8_buffer); // Send SDL event - SDL_SendKeyboardText((const char*)utf8_buffer); + SDL_SendKeyboardText((const char *)utf8_buffer); // Send enter key only on enter - if (result.button == SCE_IME_DIALOG_BUTTON_ENTER) + if (result.button == SCE_IME_DIALOG_BUTTON_ENTER) { SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_RETURN); + } sceImeDialogTerm(); videodata->ime_active = SDL_FALSE; } - } #endif } @@ -629,4 +608,3 @@ void VITA_PumpEvents(_THIS) #endif /* SDL_VIDEO_DRIVER_VITA */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/vita/SDL_vitavideo.h b/src/video/vita/SDL_vitavideo.h index 9fdf7e69ce9f8..defc5458b8a06 100644 --- a/src/video/vita/SDL_vitavideo.h +++ b/src/video/vita/SDL_vitavideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,33 +33,30 @@ typedef struct SDL_VideoData { - SDL_bool egl_initialized; /* OpenGL device initialization status */ - uint32_t egl_refcount; /* OpenGL reference count */ + SDL_bool egl_initialized; /* OpenGL device initialization status */ + uint32_t egl_refcount; /* OpenGL reference count */ SceWChar16 ime_buffer[SCE_IME_DIALOG_MAX_TEXT_LENGTH]; SDL_bool ime_active; } SDL_VideoData; - typedef struct SDL_DisplayData { } SDL_DisplayData; - typedef struct SDL_WindowData { SDL_bool uses_gles; SceUID buffer_uid; - void* buffer; + void *buffer; #if defined(SDL_VIDEO_VITA_PVR) EGLSurface egl_surface; EGLContext egl_context; #endif } SDL_WindowData; -extern SDL_Window * Vita_Window; - +extern SDL_Window *Vita_Window; /****************************************************************************/ /* SDL_VideoDevice functions declaration */ @@ -68,32 +65,32 @@ extern SDL_Window * Vita_Window; /* Display and window functions */ int VITA_VideoInit(_THIS); void VITA_VideoQuit(_THIS); -void VITA_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -int VITA_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int VITA_CreateWindow(_THIS, SDL_Window * window); -int VITA_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); -void VITA_SetWindowTitle(_THIS, SDL_Window * window); -void VITA_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); -void VITA_SetWindowPosition(_THIS, SDL_Window * window); -void VITA_SetWindowSize(_THIS, SDL_Window * window); -void VITA_ShowWindow(_THIS, SDL_Window * window); -void VITA_HideWindow(_THIS, SDL_Window * window); -void VITA_RaiseWindow(_THIS, SDL_Window * window); -void VITA_MaximizeWindow(_THIS, SDL_Window * window); -void VITA_MinimizeWindow(_THIS, SDL_Window * window); -void VITA_RestoreWindow(_THIS, SDL_Window * window); -void VITA_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed); -void VITA_DestroyWindow(_THIS, SDL_Window * window); +void VITA_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +int VITA_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int VITA_CreateWindow(_THIS, SDL_Window *window); +int VITA_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); +void VITA_SetWindowTitle(_THIS, SDL_Window *window); +void VITA_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); +void VITA_SetWindowPosition(_THIS, SDL_Window *window); +void VITA_SetWindowSize(_THIS, SDL_Window *window); +void VITA_ShowWindow(_THIS, SDL_Window *window); +void VITA_HideWindow(_THIS, SDL_Window *window); +void VITA_RaiseWindow(_THIS, SDL_Window *window); +void VITA_MaximizeWindow(_THIS, SDL_Window *window); +void VITA_MinimizeWindow(_THIS, SDL_Window *window); +void VITA_RestoreWindow(_THIS, SDL_Window *window); +void VITA_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed); +void VITA_DestroyWindow(_THIS, SDL_Window *window); /* Window manager function */ SDL_bool VITA_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info); -#if SDL_VIDEO_DRIVER_VITA +#ifdef SDL_VIDEO_DRIVER_VITA #if defined(SDL_VIDEO_VITA_PVR_OGL) /* OpenGL functions */ int VITA_GL_LoadLibrary(_THIS, const char *path); -SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window * window); +SDL_GLContext VITA_GL_CreateContext(_THIS, SDL_Window *window); void *VITA_GL_GetProcAddress(_THIS, const char *proc); #endif @@ -101,11 +98,11 @@ void *VITA_GL_GetProcAddress(_THIS, const char *proc); int VITA_GLES_LoadLibrary(_THIS, const char *path); void *VITA_GLES_GetProcAddress(_THIS, const char *proc); void VITA_GLES_UnloadLibrary(_THIS); -SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window * window); -int VITA_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +SDL_GLContext VITA_GLES_CreateContext(_THIS, SDL_Window *window); +int VITA_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int VITA_GLES_SetSwapInterval(_THIS, int interval); int VITA_GLES_GetSwapInterval(_THIS); -int VITA_GLES_SwapWindow(_THIS, SDL_Window * window); +int VITA_GLES_SwapWindow(_THIS, SDL_Window *window); void VITA_GLES_DeleteContext(_THIS, SDL_GLContext context); #endif diff --git a/src/video/vivante/SDL_vivanteopengles.c b/src/video/vivante/SDL_vivanteopengles.c index 42888d6a850db..1939c74a8f202 100644 --- a/src/video/vivante/SDL_vivanteopengles.c +++ b/src/video/vivante/SDL_vivanteopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_VIVANTE) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_vivanteopengles.h" #include "SDL_vivantevideo.h" /* EGL implementation of SDL OpenGL support */ -int -VIVANTE_GLES_LoadLibrary(_THIS, const char *path) +int VIVANTE_GLES_LoadLibrary(_THIS, const char *path) { SDL_DisplayData *displaydata; @@ -38,10 +37,9 @@ VIVANTE_GLES_LoadLibrary(_THIS, const char *path) } SDL_EGL_CreateContext_impl(VIVANTE) -SDL_EGL_SwapWindow_impl(VIVANTE) -SDL_EGL_MakeCurrent_impl(VIVANTE) + SDL_EGL_SwapWindow_impl(VIVANTE) + SDL_EGL_MakeCurrent_impl(VIVANTE) #endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */ -/* vi: set ts=4 sw=4 expandtab: */ - + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/vivante/SDL_vivanteopengles.h b/src/video/vivante/SDL_vivanteopengles.h index dce74ae6bb39d..d302bc836e79d 100644 --- a/src/video/vivante/SDL_vivanteopengles.h +++ b/src/video/vivante/SDL_vivanteopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_vivanteopengles_h_ #define SDL_vivanteopengles_h_ -#if SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_VIVANTE) && defined(SDL_VIDEO_OPENGL_EGL) #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -34,12 +34,12 @@ #define VIVANTE_GLES_UnloadLibrary SDL_EGL_UnloadLibrary #define VIVANTE_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define VIVANTE_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define VIVANTE_GLES_DeleteContext SDL_EGL_DeleteContext +#define VIVANTE_GLES_DeleteContext SDL_EGL_DeleteContext extern int VIVANTE_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window * window); -extern int VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window *window); +extern int VIVANTE_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); #endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/vivante/SDL_vivanteplatform.c b/src/video/vivante/SDL_vivanteplatform.c index 36d6822b45464..7c1788980466c 100644 --- a/src/video/vivante/SDL_vivanteplatform.c +++ b/src/video/vivante/SDL_vivanteplatform.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VIVANTE +#ifdef SDL_VIDEO_DRIVER_VIVANTE #include "SDL_vivanteplatform.h" #ifdef VIVANTE_PLATFORM_GENERIC -int -VIVANTE_SetupPlatform(_THIS) +int VIVANTE_SetupPlatform(_THIS) { return 0; } @@ -37,13 +36,11 @@ char *VIVANTE_GetDisplayName(_THIS) return NULL; } -void -VIVANTE_UpdateDisplayScale(_THIS) +void VIVANTE_UpdateDisplayScale(_THIS) { } -void -VIVANTE_CleanupPlatform(_THIS) +void VIVANTE_CleanupPlatform(_THIS) { } diff --git a/src/video/vivante/SDL_vivanteplatform.h b/src/video/vivante/SDL_vivanteplatform.h index b1621d323e3a1..bcf7c8d6fe933 100644 --- a/src/video/vivante/SDL_vivanteplatform.h +++ b/src/video/vivante/SDL_vivanteplatform.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_vivanteplatform_h_ #define SDL_vivanteplatform_h_ -#if SDL_VIDEO_DRIVER_VIVANTE +#ifdef SDL_VIDEO_DRIVER_VIVANTE #include "SDL_vivantevideo.h" diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index 3b18b7db84ddd..bcfa365fdc46c 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_VIVANTE +#ifdef SDL_VIDEO_DRIVER_VIVANTE /* SDL internals */ #include "../SDL_sysvideo.h" @@ -39,32 +39,29 @@ #include "SDL_vivanteopengles.h" #include "SDL_vivantevulkan.h" - -static void -VIVANTE_Destroy(SDL_VideoDevice * device) +static void VIVANTE_Destroy(SDL_VideoDevice *device) { - if (device->driverdata != NULL) { + if (device->driverdata) { SDL_free(device->driverdata); device->driverdata = NULL; } } -static SDL_VideoDevice * -VIVANTE_Create() +static SDL_VideoDevice *VIVANTE_Create() { SDL_VideoDevice *device; SDL_VideoData *data; /* Initialize SDL_VideoDevice structure */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (device == NULL) { + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); + if (!device) { SDL_OutOfMemory(); return NULL; } /* Initialize internal data */ - data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); - if (data == NULL) { + data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); + if (!data) { SDL_OutOfMemory(); SDL_free(device); return NULL; @@ -92,7 +89,7 @@ VIVANTE_Create() device->DestroyWindow = VIVANTE_DestroyWindow; device->GetWindowWMInfo = VIVANTE_GetWindowWMInfo; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL device->GL_LoadLibrary = VIVANTE_GLES_LoadLibrary; device->GL_GetProcAddress = VIVANTE_GLES_GetProcAddress; device->GL_UnloadLibrary = VIVANTE_GLES_UnloadLibrary; @@ -104,7 +101,7 @@ VIVANTE_Create() device->GL_DeleteContext = VIVANTE_GLES_DeleteContext; #endif -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = VIVANTE_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = VIVANTE_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = VIVANTE_Vulkan_GetInstanceExtensions; @@ -119,15 +116,15 @@ VIVANTE_Create() VideoBootStrap VIVANTE_bootstrap = { "vivante", "Vivante EGL Video Driver", - VIVANTE_Create + VIVANTE_Create, + NULL /* no ShowMessageBox implementation */ }; /*****************************************************************************/ /* SDL Video and Display initialization/handling functions */ /*****************************************************************************/ -static int -VIVANTE_AddVideoDisplays(_THIS) +static int VIVANTE_AddVideoDisplays(_THIS) { SDL_VideoData *videodata = _this->driverdata; SDL_VideoDisplay display; @@ -136,13 +133,13 @@ VIVANTE_AddVideoDisplays(_THIS) int pitch = 0, bpp = 0; unsigned long pixels = 0; - data = (SDL_DisplayData *) SDL_calloc(1, sizeof(SDL_DisplayData)); - if (data == NULL) { + data = (SDL_DisplayData *)SDL_calloc(1, sizeof(SDL_DisplayData)); + if (!data) { return SDL_OutOfMemory(); } SDL_zero(current_mode); -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK data->native_display = vdkGetDisplay(videodata->vdk_private); vdkGetDisplayInfo(data->native_display, ¤t_mode.w, ¤t_mode.h, &pixels, &pitch, &bpp); @@ -152,8 +149,7 @@ VIVANTE_AddVideoDisplays(_THIS) videodata->fbGetDisplayInfo(data->native_display, ¤t_mode.w, ¤t_mode.h, &pixels, &pitch, &bpp); #endif /* SDL_VIDEO_DRIVER_VIVANTE_VDK */ - switch (bpp) - { + switch (bpp) { default: /* Is another format used? */ case 32: current_mode.format = SDL_PIXELFORMAT_ARGB8888; @@ -174,12 +170,11 @@ VIVANTE_AddVideoDisplays(_THIS) return 0; } -int -VIVANTE_VideoInit(_THIS) +int VIVANTE_VideoInit(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK videodata->vdk_private = vdkInitialize(); if (!videodata->vdk_private) { return SDL_SetError("vdkInitialize() failed"); @@ -192,9 +187,10 @@ VIVANTE_VideoInit(_THIS) return -1; } } -#define LOAD_FUNC(NAME) \ +#define LOAD_FUNC(NAME) \ videodata->NAME = SDL_LoadFunction(videodata->egl_handle, #NAME); \ - if (!videodata->NAME) return -1; + if (!videodata->NAME) \ + return -1; LOAD_FUNC(fbGetDisplay); LOAD_FUNC(fbGetDisplayByIndex); @@ -226,8 +222,7 @@ VIVANTE_VideoInit(_THIS) return 0; } -void -VIVANTE_VideoQuit(_THIS) +void VIVANTE_VideoQuit(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; @@ -237,7 +232,7 @@ VIVANTE_VideoQuit(_THIS) VIVANTE_CleanupPlatform(_this); -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK if (videodata->vdk_private) { vdkExit(videodata->vdk_private); videodata->vdk_private = NULL; @@ -250,21 +245,18 @@ VIVANTE_VideoQuit(_THIS) #endif } -void -VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { /* Only one display mode available, the current one */ SDL_AddDisplayMode(display, &display->current_mode); } -int -VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -int -VIVANTE_CreateWindow(_THIS, SDL_Window * window) +int VIVANTE_CreateWindow(_THIS, SDL_Window *window) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_DisplayData *displaydata; @@ -273,15 +265,15 @@ VIVANTE_CreateWindow(_THIS, SDL_Window * window) displaydata = SDL_GetDisplayDriverData(0); /* Allocate window internal data */ - data = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData)); - if (data == NULL) { + data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); + if (!data) { return SDL_OutOfMemory(); } /* Setup driver data for this window */ window->driverdata = data; -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK data->native_window = vdkCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h); #else data->native_window = videodata->fbCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h); @@ -290,7 +282,7 @@ VIVANTE_CreateWindow(_THIS, SDL_Window * window) return SDL_SetError("VIVANTE: Can't create native window"); } -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { data->egl_surface = SDL_EGL_CreateSurface(_this, data->native_window); if (data->egl_surface == EGL_NO_SURFACE) { @@ -305,22 +297,21 @@ VIVANTE_CreateWindow(_THIS, SDL_Window * window) return 0; } -void -VIVANTE_DestroyWindow(_THIS, SDL_Window * window) +void VIVANTE_DestroyWindow(_THIS, SDL_Window *window) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_WindowData *data; data = window->driverdata; if (data) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { SDL_EGL_DestroySurface(_this, data->egl_surface); } #endif if (data->native_window) { -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK vdkDestroyWindow(data->native_window); #else videodata->fbDestroyWindow(data->native_window); @@ -332,31 +323,27 @@ VIVANTE_DestroyWindow(_THIS, SDL_Window * window) window->driverdata = NULL; } -void -VIVANTE_SetWindowTitle(_THIS, SDL_Window * window) +void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; vdkSetWindowTitle(data->native_window, window->title); #endif } -void -VIVANTE_SetWindowPosition(_THIS, SDL_Window * window) +void VIVANTE_SetWindowPosition(_THIS, SDL_Window *window) { /* FIXME */ } -void -VIVANTE_SetWindowSize(_THIS, SDL_Window * window) +void VIVANTE_SetWindowSize(_THIS, SDL_Window *window) { /* FIXME */ } -void -VIVANTE_ShowWindow(_THIS, SDL_Window * window) +void VIVANTE_ShowWindow(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; vdkShowWindow(data->native_window); #endif @@ -364,22 +351,22 @@ VIVANTE_ShowWindow(_THIS, SDL_Window * window) SDL_SetKeyboardFocus(window); } -void -VIVANTE_HideWindow(_THIS, SDL_Window * window) +void VIVANTE_HideWindow(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK SDL_WindowData *data = window->driverdata; vdkHideWindow(data->native_window); #endif + SDL_SetMouseFocus(NULL); + SDL_SetKeyboardFocus(NULL); } /*****************************************************************************/ /* SDL Window Manager function */ /*****************************************************************************/ -SDL_bool -VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info) +SDL_bool VIVANTE_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0); if (info->version.major == SDL_MAJOR_VERSION) { diff --git a/src/video/vivante/SDL_vivantevideo.h b/src/video/vivante/SDL_vivantevideo.h index ae4a8e142e745..dc1bab0e7d99a 100644 --- a/src/video/vivante/SDL_vivantevideo.h +++ b/src/video/vivante/SDL_vivantevideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "SDL_egl.h" -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK #include #else #include @@ -35,19 +35,19 @@ typedef struct SDL_VideoData { -#if SDL_VIDEO_DRIVER_VIVANTE_VDK +#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK vdkPrivate vdk_private; #else void *egl_handle; /* EGL shared library handle */ - EGLNativeDisplayType (EGLAPIENTRY *fbGetDisplay)(void *context); - EGLNativeDisplayType (EGLAPIENTRY *fbGetDisplayByIndex)(int DisplayIndex); - void (EGLAPIENTRY *fbGetDisplayGeometry)(EGLNativeDisplayType Display, int *Width, int *Height); - void (EGLAPIENTRY *fbGetDisplayInfo)(EGLNativeDisplayType Display, int *Width, int *Height, unsigned long *Physical, int *Stride, int *BitsPerPixel); - void (EGLAPIENTRY *fbDestroyDisplay)(EGLNativeDisplayType Display); - EGLNativeWindowType (EGLAPIENTRY *fbCreateWindow)(EGLNativeDisplayType Display, int X, int Y, int Width, int Height); - void (EGLAPIENTRY *fbGetWindowGeometry)(EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height); - void (EGLAPIENTRY *fbGetWindowInfo)(EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height, int *BitsPerPixel, unsigned int *Offset); - void (EGLAPIENTRY *fbDestroyWindow)(EGLNativeWindowType Window); + EGLNativeDisplayType(EGLAPIENTRY *fbGetDisplay)(void *context); + EGLNativeDisplayType(EGLAPIENTRY *fbGetDisplayByIndex)(int DisplayIndex); + void(EGLAPIENTRY *fbGetDisplayGeometry)(EGLNativeDisplayType Display, int *Width, int *Height); + void(EGLAPIENTRY *fbGetDisplayInfo)(EGLNativeDisplayType Display, int *Width, int *Height, unsigned long *Physical, int *Stride, int *BitsPerPixel); + void(EGLAPIENTRY *fbDestroyDisplay)(EGLNativeDisplayType Display); + EGLNativeWindowType(EGLAPIENTRY *fbCreateWindow)(EGLNativeDisplayType Display, int X, int Y, int Width, int Height); + void(EGLAPIENTRY *fbGetWindowGeometry)(EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height); + void(EGLAPIENTRY *fbGetWindowInfo)(EGLNativeWindowType Window, int *X, int *Y, int *Width, int *Height, int *BitsPerPixel, unsigned int *Offset); + void(EGLAPIENTRY *fbDestroyWindow)(EGLNativeWindowType Window); #endif } SDL_VideoData; @@ -69,15 +69,15 @@ typedef struct SDL_WindowData /* Display and window functions */ int VIVANTE_VideoInit(_THIS); void VIVANTE_VideoQuit(_THIS); -void VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int VIVANTE_CreateWindow(_THIS, SDL_Window * window); -void VIVANTE_SetWindowTitle(_THIS, SDL_Window * window); -void VIVANTE_SetWindowPosition(_THIS, SDL_Window * window); -void VIVANTE_SetWindowSize(_THIS, SDL_Window * window); -void VIVANTE_ShowWindow(_THIS, SDL_Window * window); -void VIVANTE_HideWindow(_THIS, SDL_Window * window); -void VIVANTE_DestroyWindow(_THIS, SDL_Window * window); +void VIVANTE_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +int VIVANTE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); +int VIVANTE_CreateWindow(_THIS, SDL_Window *window); +void VIVANTE_SetWindowTitle(_THIS, SDL_Window *window); +void VIVANTE_SetWindowPosition(_THIS, SDL_Window *window); +void VIVANTE_SetWindowSize(_THIS, SDL_Window *window); +void VIVANTE_ShowWindow(_THIS, SDL_Window *window); +void VIVANTE_HideWindow(_THIS, SDL_Window *window); +void VIVANTE_DestroyWindow(_THIS, SDL_Window *window); /* Window manager function */ SDL_bool VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, diff --git a/src/video/vivante/SDL_vivantevulkan.c b/src/video/vivante/SDL_vivantevulkan.c index fe6a6b0aef23d..f53b31401a461 100644 --- a/src/video/vivante/SDL_vivantevulkan.c +++ b/src/video/vivante/SDL_vivantevulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_VIVANTE +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_VIVANTE) #include "SDL_vivantevideo.h" @@ -42,19 +42,19 @@ int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasSurfaceExtension = SDL_FALSE; SDL_bool hasDisplayExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan loader library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) - { + } + if (!path) { /* If no path set, try Vivante fb vulkan driver explicitly */ path = "libvulkan-fb.so"; _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { /* If that couldn't be loaded, fall back to default name */ path = "libvulkan.so"; _this->vulkan_config.loader_handle = SDL_LoadObject(path); @@ -62,45 +62,44 @@ int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path) } else { _this->vulkan_config.loader_handle = SDL_LoadObject(path); } - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vivante: Loaded vulkan driver %s", path); vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_DISPLAY_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasDisplayExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else if(!hasDisplayExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_DISPLAY_EXTENSION_NAME "extension"); + } else if (!hasDisplayExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_DISPLAY_EXTENSION_NAME "extension"); goto fail; } return 0; @@ -113,38 +112,35 @@ int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path) void VIVANTE_Vulkan_UnloadLibrary(_THIS) { - if(_this->vulkan_config.loader_handle) - { + if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } } SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names) + SDL_Window *window, + unsigned *count, + const char **names) { static const char *const extensionsForVivante[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME }; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } return SDL_Vulkan_GetInstanceExtensions_Helper( - count, names, SDL_arraysize(extensionsForVivante), - extensionsForVivante); + count, names, SDL_arraysize(extensionsForVivante), + extensionsForVivante); } SDL_bool VIVANTE_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface) + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface) { - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } @@ -154,4 +150,3 @@ SDL_bool VIVANTE_Vulkan_CreateSurface(_THIS, #endif /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/vivante/SDL_vivantevulkan.h b/src/video/vivante/SDL_vivantevulkan.h index 0be68fae780e5..e1763358a89c9 100644 --- a/src/video/vivante/SDL_vivantevulkan.h +++ b/src/video/vivante/SDL_vivantevulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,22 +32,21 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_VIVANTE +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_VIVANTE) int VIVANTE_Vulkan_LoadLibrary(_THIS, const char *path); void VIVANTE_Vulkan_UnloadLibrary(_THIS); SDL_bool VIVANTE_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names); + SDL_Window *window, + unsigned *count, + const char **names); SDL_bool VIVANTE_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface); + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface); #endif #endif /* SDL_vivantevulkan_h_ */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/wayland/SDL_waylandclipboard.c b/src/video/wayland/SDL_waylandclipboard.c index ff19639f7e3e9..38f4549876812 100644 --- a/src/video/wayland/SDL_waylandclipboard.c +++ b/src/video/wayland/SDL_waylandclipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,28 +20,27 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "SDL_waylanddatamanager.h" #include "SDL_waylandevents_c.h" #include "SDL_waylandclipboard.h" -int -Wayland_SetClipboardText(_THIS, const char *text) +int Wayland_SetClipboardText(_THIS, const char *text) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; int status = 0; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { status = SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->data_device != NULL) { + if (video_data->input && video_data->input->data_device) { data_device = video_data->input->data_device; if (text[0] != '\0') { - SDL_WaylandDataSource* source = Wayland_data_source_create(_this); + SDL_WaylandDataSource *source = Wayland_data_source_create(_this); Wayland_data_source_add_data(source, TEXT_MIME, text, SDL_strlen(text)); @@ -58,22 +57,21 @@ Wayland_SetClipboardText(_THIS, const char *text) return status; } -int -Wayland_SetPrimarySelectionText(_THIS, const char *text) +int Wayland_SetPrimarySelectionText(_THIS, const char *text) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; int status = 0; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { status = SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->primary_selection_device != NULL) { + if (video_data->input && video_data->input->primary_selection_device) { primary_selection_device = video_data->input->primary_selection_device; if (text[0] != '\0') { - SDL_WaylandPrimarySelectionSource* source = Wayland_primary_selection_source_create(_this); + SDL_WaylandPrimarySelectionSource *source = Wayland_primary_selection_source_create(_this); Wayland_primary_selection_source_add_data(source, TEXT_MIME, text, SDL_strlen(text)); @@ -91,8 +89,7 @@ Wayland_SetPrimarySelectionText(_THIS, const char *text) return status; } -char * -Wayland_GetClipboardText(_THIS) +char *Wayland_GetClipboardText(_THIS) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; @@ -100,11 +97,11 @@ Wayland_GetClipboardText(_THIS) char *text = NULL; size_t length = 0; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->data_device != NULL) { + if (video_data->input && video_data->input->data_device) { data_device = video_data->input->data_device; /* Prefer own selection, if not canceled */ if (Wayland_data_source_has_mime( @@ -112,22 +109,21 @@ Wayland_GetClipboardText(_THIS) text = Wayland_data_source_get_data(data_device->selection_source, &length, TEXT_MIME, SDL_TRUE); } else if (Wayland_data_offer_has_mime( - data_device->selection_offer, TEXT_MIME)) { + data_device->selection_offer, TEXT_MIME)) { text = Wayland_data_offer_receive(data_device->selection_offer, &length, TEXT_MIME, SDL_TRUE); } } } - if (text == NULL) { + if (!text) { text = SDL_strdup(""); } return text; } -char * -Wayland_GetPrimarySelectionText(_THIS) +char *Wayland_GetPrimarySelectionText(_THIS) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; @@ -135,11 +131,11 @@ Wayland_GetPrimarySelectionText(_THIS) char *text = NULL; size_t length = 0; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->primary_selection_device != NULL) { + if (video_data->input && video_data->input->primary_selection_device) { primary_selection_device = video_data->input->primary_selection_device; /* Prefer own selection, if not canceled */ if (Wayland_primary_selection_source_has_mime( @@ -147,32 +143,31 @@ Wayland_GetPrimarySelectionText(_THIS) text = Wayland_primary_selection_source_get_data(primary_selection_device->selection_source, &length, TEXT_MIME, SDL_TRUE); } else if (Wayland_primary_selection_offer_has_mime( - primary_selection_device->selection_offer, TEXT_MIME)) { + primary_selection_device->selection_offer, TEXT_MIME)) { text = Wayland_primary_selection_offer_receive(primary_selection_device->selection_offer, &length, TEXT_MIME, SDL_TRUE); } } } - if (text == NULL) { + if (!text) { text = SDL_strdup(""); } return text; } -SDL_bool -Wayland_HasClipboardText(_THIS) +SDL_bool Wayland_HasClipboardText(_THIS) { SDL_VideoData *video_data = NULL; SDL_WaylandDataDevice *data_device = NULL; SDL_bool result = SDL_FALSE; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->data_device != NULL) { + if (video_data->input && video_data->input->data_device) { data_device = video_data->input->data_device; result = result || Wayland_data_source_has_mime(data_device->selection_source, TEXT_MIME) || @@ -182,18 +177,17 @@ Wayland_HasClipboardText(_THIS) return result; } -SDL_bool -Wayland_HasPrimarySelectionText(_THIS) +SDL_bool Wayland_HasPrimarySelectionText(_THIS) { SDL_VideoData *video_data = NULL; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; SDL_bool result = SDL_FALSE; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { video_data = _this->driverdata; - if (video_data->input != NULL && video_data->input->primary_selection_device != NULL) { + if (video_data->input && video_data->input->primary_selection_device) { primary_selection_device = video_data->input->primary_selection_device; result = result || Wayland_primary_selection_source_has_mime( diff --git a/src/video/wayland/SDL_waylandclipboard.h b/src/video/wayland/SDL_waylandclipboard.h index b0e443d955f4d..64c33ab193055 100644 --- a/src/video/wayland/SDL_waylandclipboard.h +++ b/src/video/wayland/SDL_waylandclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/wayland/SDL_waylanddatamanager.c b/src/video/wayland/SDL_waylanddatamanager.c index 63e9d489ce175..cece2427ec975 100644 --- a/src/video/wayland/SDL_waylanddatamanager.c +++ b/src/video/wayland/SDL_waylanddatamanager.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include #include @@ -40,8 +40,49 @@ */ #define PIPE_MS_TIMEOUT 14 -static ssize_t -write_pipe(int fd, const void* buffer, size_t total_length, size_t *pos) +/* sigtimedwait() is an optional part of POSIX.1-2001, and OpenBSD doesn't implement it. + * Based on https://comp.unix.programmer.narkive.com/rEDH0sPT/sigtimedwait-implementation + */ +#ifndef HAVE_SIGTIMEDWAIT +#include +#include +static int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout) +{ + struct timespec elapsed = { 0 }, rem = { 0 }; + sigset_t pending; + int signo; + do { + /* Check the pending signals, and call sigwait if there is at least one of interest in the set. */ + sigpending(&pending); + for (signo = 1; signo < NSIG; ++signo) { + if (sigismember(set, signo) && sigismember(&pending, signo)) { + if (!sigwait(set, &signo)) { + if (info) { + SDL_memset(info, 0, sizeof *info); + info->si_signo = signo; + } + return signo; + } else { + return -1; + } + } + } + + if (timeout->tv_sec || timeout->tv_nsec) { + long ns = 20000000L; // 2/100ths of a second + nanosleep(&(struct timespec){ 0, ns }, &rem); + ns -= rem.tv_nsec; + elapsed.tv_sec += (elapsed.tv_nsec + ns) / 1000000000L; + elapsed.tv_nsec = (elapsed.tv_nsec + ns) % 1000000000L; + } + } while (elapsed.tv_sec < timeout->tv_sec || (elapsed.tv_sec == timeout->tv_sec && elapsed.tv_nsec < timeout->tv_nsec)); + + errno = EAGAIN; + return -1; +} +#endif + +static ssize_t write_pipe(int fd, const void *buffer, size_t total_length, size_t *pos) { int ready = 0; ssize_t bytes_written = 0; @@ -49,14 +90,14 @@ write_pipe(int fd, const void* buffer, size_t total_length, size_t *pos) sigset_t sig_set; sigset_t old_sig_set; - struct timespec zerotime = {0}; + struct timespec zerotime = { 0 }; ready = SDL_IOReady(fd, SDL_IOR_WRITE, PIPE_MS_TIMEOUT); sigemptyset(&sig_set); sigaddset(&sig_set, SIGPIPE); -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED sigprocmask(SIG_BLOCK, &sig_set, &old_sig_set); #else pthread_sigmask(SIG_BLOCK, &sig_set, &old_sig_set); @@ -68,7 +109,7 @@ write_pipe(int fd, const void* buffer, size_t total_length, size_t *pos) bytes_written = SDL_SetError("Pipe select error"); } else { if (length > 0) { - bytes_written = write(fd, (Uint8*)buffer + *pos, SDL_min(length, PIPE_BUF)); + bytes_written = write(fd, (Uint8 *)buffer + *pos, SDL_min(length, PIPE_BUF)); } if (bytes_written > 0) { @@ -76,9 +117,9 @@ write_pipe(int fd, const void* buffer, size_t total_length, size_t *pos) } } - sigtimedwait(&sig_set, 0, &zerotime); + sigtimedwait(&sig_set, NULL, &zerotime); -#if SDL_THREADS_DISABLED +#ifdef SDL_THREADS_DISABLED sigprocmask(SIG_SETMASK, &old_sig_set, NULL); #else pthread_sigmask(SIG_SETMASK, &old_sig_set, NULL); @@ -87,11 +128,10 @@ write_pipe(int fd, const void* buffer, size_t total_length, size_t *pos) return bytes_written; } -static ssize_t -read_pipe(int fd, void** buffer, size_t* total_length, SDL_bool null_terminate) +static ssize_t read_pipe(int fd, void **buffer, size_t *total_length, SDL_bool null_terminate) { int ready = 0; - void* output_buffer = NULL; + void *output_buffer = NULL; char temp[PIPE_BUF]; size_t new_buffer_length = 0; ssize_t bytes_read = 0; @@ -117,19 +157,19 @@ read_pipe(int fd, void** buffer, size_t* total_length, SDL_bool null_terminate) new_buffer_length = *total_length; } - if (*buffer == NULL) { + if (!*buffer) { output_buffer = SDL_malloc(new_buffer_length); } else { output_buffer = SDL_realloc(*buffer, new_buffer_length); } - if (output_buffer == NULL) { + if (!output_buffer) { bytes_read = SDL_OutOfMemory(); } else { - SDL_memcpy((Uint8*)output_buffer + pos, temp, bytes_read); + SDL_memcpy((Uint8 *)output_buffer + pos, temp, bytes_read); if (null_terminate == SDL_TRUE) { - SDL_memset((Uint8*)output_buffer + (new_buffer_length - 1), 0, 1); + SDL_memset((Uint8 *)output_buffer + (new_buffer_length - 1), 0, 1); } *buffer = output_buffer; @@ -141,15 +181,14 @@ read_pipe(int fd, void** buffer, size_t* total_length, SDL_bool null_terminate) #define MIME_LIST_SIZE 4 -static const char* mime_conversion_list[MIME_LIST_SIZE][2] = { - {"text/plain", TEXT_MIME}, - {"TEXT", TEXT_MIME}, - {"UTF8_STRING", TEXT_MIME}, - {"STRING", TEXT_MIME} +static const char *mime_conversion_list[MIME_LIST_SIZE][2] = { + { "text/plain", TEXT_MIME }, + { "TEXT", TEXT_MIME }, + { "UTF8_STRING", TEXT_MIME }, + { "STRING", TEXT_MIME } }; -const char* -Wayland_convert_mime_type(const char *mime_type) +const char *Wayland_convert_mime_type(const char *mime_type) { const char *found = mime_type; @@ -165,14 +204,13 @@ Wayland_convert_mime_type(const char *mime_type) return found; } -static SDL_MimeDataList* -mime_data_list_find(struct wl_list* list, - const char* mime_type) +static SDL_MimeDataList *mime_data_list_find(struct wl_list *list, + const char *mime_type) { SDL_MimeDataList *found = NULL; SDL_MimeDataList *mime_list = NULL; - wl_list_for_each(mime_list, list, link) { + wl_list_for_each (mime_list, list, link) { if (SDL_strcmp(mime_list->mime_type, mime_type) == 0) { found = mime_list; break; @@ -181,19 +219,18 @@ mime_data_list_find(struct wl_list* list, return found; } -static int -mime_data_list_add(struct wl_list* list, - const char* mime_type, - const void* buffer, size_t length) +static int mime_data_list_add(struct wl_list *list, + const char *mime_type, + const void *buffer, size_t length) { int status = 0; size_t mime_type_length = 0; SDL_MimeDataList *mime_data = NULL; void *internal_buffer = NULL; - if (buffer != NULL) { + if (buffer) { internal_buffer = SDL_malloc(length); - if (internal_buffer == NULL) { + if (!internal_buffer) { return SDL_OutOfMemory(); } SDL_memcpy(internal_buffer, buffer, length); @@ -201,16 +238,16 @@ mime_data_list_add(struct wl_list* list, mime_data = mime_data_list_find(list, mime_type); - if (mime_data == NULL) { + if (!mime_data) { mime_data = SDL_calloc(1, sizeof(*mime_data)); - if (mime_data == NULL) { + if (!mime_data) { status = SDL_OutOfMemory(); } else { WAYLAND_wl_list_insert(list, &(mime_data->link)); mime_type_length = SDL_strlen(mime_type) + 1; mime_data->mime_type = SDL_malloc(mime_type_length); - if (mime_data->mime_type == NULL) { + if (!mime_data->mime_type) { status = SDL_OutOfMemory(); } else { SDL_memcpy(mime_data->mime_type, mime_type, mime_type_length); @@ -218,8 +255,8 @@ mime_data_list_add(struct wl_list* list, } } - if (mime_data != NULL && buffer != NULL && length > 0) { - if (mime_data->data != NULL) { + if (mime_data && buffer && length > 0) { + if (mime_data->data) { SDL_free(mime_data->data); } mime_data->data = internal_buffer; @@ -231,63 +268,61 @@ mime_data_list_add(struct wl_list* list, return status; } -static void -mime_data_list_free(struct wl_list *list) +static void mime_data_list_free(struct wl_list *list) { SDL_MimeDataList *mime_data = NULL; SDL_MimeDataList *next = NULL; - wl_list_for_each_safe(mime_data, next, list, link) { - if (mime_data->data != NULL) { + wl_list_for_each_safe(mime_data, next, list, link) + { + if (mime_data->data) { SDL_free(mime_data->data); } - if (mime_data->mime_type != NULL) { + if (mime_data->mime_type) { SDL_free(mime_data->mime_type); } SDL_free(mime_data); } } -static ssize_t -Wayland_source_send(SDL_MimeDataList *mime_data, const char *mime_type, int fd) +static ssize_t Wayland_source_send(SDL_MimeDataList *mime_data, const char *mime_type, int fd) { size_t written_bytes = 0; ssize_t status = 0; - if (mime_data == NULL || mime_data->data == NULL) { + if (!mime_data || !mime_data->data) { status = SDL_SetError("Invalid mime type"); close(fd); } else { - while (write_pipe(fd, mime_data->data, mime_data->length, - &written_bytes) > 0); + while (write_pipe(fd, + mime_data->data, + mime_data->length, + &written_bytes) > 0) { + } close(fd); status = written_bytes; } return status; } -ssize_t -Wayland_data_source_send(SDL_WaylandDataSource *source, - const char *mime_type, int fd) +ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd) { SDL_MimeDataList *mime_data = NULL; mime_type = Wayland_convert_mime_type(mime_type); mime_data = mime_data_list_find(&source->mimes, - mime_type); + mime_type); return Wayland_source_send(mime_data, mime_type, fd); } -ssize_t -Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, - const char *mime_type, int fd) +ssize_t Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, const char *mime_type, int fd) { SDL_MimeDataList *mime_data = NULL; mime_type = Wayland_convert_mime_type(mime_type); mime_data = mime_data_list_find(&source->mimes, - mime_type); + mime_type); return Wayland_source_send(mime_data, mime_type, fd); } @@ -308,45 +343,42 @@ int Wayland_primary_selection_source_add_data(SDL_WaylandPrimarySelectionSource return mime_data_list_add(&source->mimes, mime_type, buffer, length); } -SDL_bool -Wayland_data_source_has_mime(SDL_WaylandDataSource *source, - const char *mime_type) +SDL_bool Wayland_data_source_has_mime(SDL_WaylandDataSource *source, + const char *mime_type) { SDL_bool found = SDL_FALSE; - if (source != NULL) { + if (source) { found = mime_data_list_find(&source->mimes, mime_type) != NULL; } return found; } -SDL_bool -Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source, - const char *mime_type) +SDL_bool Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source, + const char *mime_type) { SDL_bool found = SDL_FALSE; - if (source != NULL) { + if (source) { found = mime_data_list_find(&source->mimes, mime_type) != NULL; } return found; } -static void* -Wayland_source_get_data(SDL_MimeDataList *mime_data, - size_t *length, - SDL_bool null_terminate) +static void *Wayland_source_get_data(SDL_MimeDataList *mime_data, + size_t *length, + SDL_bool null_terminate) { void *buffer = NULL; - if (mime_data != NULL && mime_data->length > 0) { + if (mime_data && mime_data->length > 0) { size_t buffer_length = mime_data->length; if (null_terminate == SDL_TRUE) { ++buffer_length; } buffer = SDL_malloc(buffer_length); - if (buffer == NULL) { + if (!buffer) { *length = SDL_OutOfMemory(); } else { *length = mime_data->length; @@ -360,16 +392,15 @@ Wayland_source_get_data(SDL_MimeDataList *mime_data, return buffer; } -void* -Wayland_data_source_get_data(SDL_WaylandDataSource *source, - size_t *length, const char* mime_type, - SDL_bool null_terminate) +void *Wayland_data_source_get_data(SDL_WaylandDataSource *source, + size_t *length, const char *mime_type, + SDL_bool null_terminate) { SDL_MimeDataList *mime_data = NULL; void *buffer = NULL; *length = 0; - if (source == NULL) { + if (!source) { SDL_SetError("Invalid data source"); } else { mime_data = mime_data_list_find(&source->mimes, mime_type); @@ -379,16 +410,15 @@ Wayland_data_source_get_data(SDL_WaylandDataSource *source, return buffer; } -void* -Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source, - size_t *length, const char* mime_type, - SDL_bool null_terminate) +void *Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source, + size_t *length, const char *mime_type, + SDL_bool null_terminate) { SDL_MimeDataList *mime_data = NULL; void *buffer = NULL; *length = 0; - if (source == NULL) { + if (!source) { SDL_SetError("Invalid primary selection source"); } else { mime_data = mime_data_list_find(&source->mimes, mime_type); @@ -398,11 +428,10 @@ Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *sou return buffer; } -void -Wayland_data_source_destroy(SDL_WaylandDataSource *source) +void Wayland_data_source_destroy(SDL_WaylandDataSource *source) { - if (source != NULL) { - SDL_WaylandDataDevice *data_device = (SDL_WaylandDataDevice *) source->data_device; + if (source) { + SDL_WaylandDataDevice *data_device = (SDL_WaylandDataDevice *)source->data_device; if (data_device && (data_device->selection_source == source)) { data_device->selection_source = NULL; } @@ -412,11 +441,10 @@ Wayland_data_source_destroy(SDL_WaylandDataSource *source) } } -void -Wayland_primary_selection_source_destroy(SDL_WaylandPrimarySelectionSource *source) +void Wayland_primary_selection_source_destroy(SDL_WaylandPrimarySelectionSource *source) { - if (source != NULL) { - SDL_WaylandPrimarySelectionDevice *primary_selection_device = (SDL_WaylandPrimarySelectionDevice *) source->primary_selection_device; + if (source) { + SDL_WaylandPrimarySelectionDevice *primary_selection_device = (SDL_WaylandPrimarySelectionDevice *)source->primary_selection_device; if (primary_selection_device && (primary_selection_device->selection_source == source)) { primary_selection_device->selection_source = NULL; } @@ -426,10 +454,9 @@ Wayland_primary_selection_source_destroy(SDL_WaylandPrimarySelectionSource *sour } } -void* -Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, - size_t *length, const char* mime_type, - SDL_bool null_terminate) +void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, + size_t *length, const char *mime_type, + SDL_bool null_terminate) { SDL_WaylandDataDevice *data_device = NULL; @@ -437,11 +464,14 @@ Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, void *buffer = NULL; *length = 0; - if (offer == NULL) { + if (!offer) { SDL_SetError("Invalid data offer"); - } else if ((data_device = offer->data_device) == NULL) { + return NULL; + } + data_device = offer->data_device; + if (!data_device) { SDL_SetError("Data device not initialized"); - } else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) { + } else if (pipe2(pipefd, O_CLOEXEC | O_NONBLOCK) == -1) { SDL_SetError("Could not read pipe"); } else { wl_data_offer_receive(offer->offer, mime_type, pipefd[1]); @@ -451,16 +481,16 @@ Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, close(pipefd[1]); - while (read_pipe(pipefd[0], &buffer, length, null_terminate) > 0); + while (read_pipe(pipefd[0], &buffer, length, null_terminate) > 0) { + } close(pipefd[0]); } return buffer; } -void* -Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, - size_t *length, const char* mime_type, - SDL_bool null_terminate) +void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, + size_t *length, const char *mime_type, + SDL_bool null_terminate) { SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; @@ -468,11 +498,14 @@ Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, void *buffer = NULL; *length = 0; - if (offer == NULL) { + if (!offer) { SDL_SetError("Invalid data offer"); - } else if ((primary_selection_device = offer->primary_selection_device) == NULL) { + return NULL; + } + primary_selection_device = offer->primary_selection_device; + if (!primary_selection_device) { SDL_SetError("Primary selection device not initialized"); - } else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) { + } else if (pipe2(pipefd, O_CLOEXEC | O_NONBLOCK) == -1) { SDL_SetError("Could not read pipe"); } else { zwp_primary_selection_offer_v1_receive(offer->offer, mime_type, pipefd[1]); @@ -482,78 +515,72 @@ Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, close(pipefd[1]); - while (read_pipe(pipefd[0], &buffer, length, null_terminate) > 0); + while (read_pipe(pipefd[0], &buffer, length, null_terminate) > 0) { + } close(pipefd[0]); } return buffer; } -int -Wayland_data_offer_add_mime(SDL_WaylandDataOffer *offer, - const char* mime_type) +int Wayland_data_offer_add_mime(SDL_WaylandDataOffer *offer, + const char *mime_type) { return mime_data_list_add(&offer->mimes, mime_type, NULL, 0); } -int -Wayland_primary_selection_offer_add_mime(SDL_WaylandPrimarySelectionOffer *offer, - const char* mime_type) +int Wayland_primary_selection_offer_add_mime(SDL_WaylandPrimarySelectionOffer *offer, + const char *mime_type) { return mime_data_list_add(&offer->mimes, mime_type, NULL, 0); } -SDL_bool -Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer, - const char *mime_type) +SDL_bool Wayland_data_offer_has_mime(SDL_WaylandDataOffer *offer, + const char *mime_type) { SDL_bool found = SDL_FALSE; - if (offer != NULL) { + if (offer) { found = mime_data_list_find(&offer->mimes, mime_type) != NULL; } return found; } -SDL_bool -Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer, - const char *mime_type) +SDL_bool Wayland_primary_selection_offer_has_mime(SDL_WaylandPrimarySelectionOffer *offer, + const char *mime_type) { SDL_bool found = SDL_FALSE; - if (offer != NULL) { + if (offer) { found = mime_data_list_find(&offer->mimes, mime_type) != NULL; } return found; } -void -Wayland_data_offer_destroy(SDL_WaylandDataOffer *offer) +void Wayland_data_offer_destroy(SDL_WaylandDataOffer *offer) { - if (offer != NULL) { + if (offer) { wl_data_offer_destroy(offer->offer); mime_data_list_free(&offer->mimes); SDL_free(offer); } } -void -Wayland_primary_selection_offer_destroy(SDL_WaylandPrimarySelectionOffer *offer) +void Wayland_primary_selection_offer_destroy(SDL_WaylandPrimarySelectionOffer *offer) { - if (offer != NULL) { + if (offer) { zwp_primary_selection_offer_v1_destroy(offer->offer); mime_data_list_free(&offer->mimes); SDL_free(offer); } } -int -Wayland_data_device_clear_selection(SDL_WaylandDataDevice *data_device) +int Wayland_data_device_clear_selection(SDL_WaylandDataDevice *data_device) { int status = 0; - if (data_device == NULL || data_device->data_device == NULL) { + if (!data_device || !data_device->data_device) { status = SDL_SetError("Invalid Data Device"); - } else if (data_device->selection_source != NULL) { + } else if (data_device->selection_source) { wl_data_device_set_selection(data_device->data_device, NULL, 0); Wayland_data_source_destroy(data_device->selection_source); data_device->selection_source = NULL; @@ -561,14 +588,13 @@ Wayland_data_device_clear_selection(SDL_WaylandDataDevice *data_device) return status; } -int -Wayland_primary_selection_device_clear_selection(SDL_WaylandPrimarySelectionDevice *primary_selection_device) +int Wayland_primary_selection_device_clear_selection(SDL_WaylandPrimarySelectionDevice *primary_selection_device) { int status = 0; - if (primary_selection_device == NULL || primary_selection_device->primary_selection_device == NULL) { + if (!primary_selection_device || !primary_selection_device->primary_selection_device) { status = SDL_SetError("Invalid Primary Selection Device"); - } else if (primary_selection_device->selection_source != NULL) { + } else if (primary_selection_device->selection_source) { zwp_primary_selection_device_v1_set_selection(primary_selection_device->primary_selection_device, NULL, 0); Wayland_primary_selection_source_destroy(primary_selection_device->selection_source); @@ -577,22 +603,21 @@ Wayland_primary_selection_device_clear_selection(SDL_WaylandPrimarySelectionDevi return status; } -int -Wayland_data_device_set_selection(SDL_WaylandDataDevice *data_device, - SDL_WaylandDataSource *source) +int Wayland_data_device_set_selection(SDL_WaylandDataDevice *data_device, + SDL_WaylandDataSource *source) { int status = 0; size_t num_offers = 0; size_t index = 0; - if (data_device == NULL) { + if (!data_device) { status = SDL_SetError("Invalid Data Device"); - } else if (source == NULL) { + } else if (!source) { status = SDL_SetError("Invalid source"); } else { SDL_MimeDataList *mime_data = NULL; - wl_list_for_each(mime_data, &(source->mimes), link) { + wl_list_for_each (mime_data, &(source->mimes), link) { wl_data_source_offer(source->source, mime_data->mime_type); @@ -601,7 +626,7 @@ Wayland_data_device_set_selection(SDL_WaylandDataDevice *data_device, if (SDL_strcmp(mime_conversion_list[index][1], mime_data->mime_type) == 0) { wl_data_source_offer(source->source, mime_conversion_list[index][0]); - } + } } /* */ @@ -618,7 +643,7 @@ Wayland_data_device_set_selection(SDL_WaylandDataDevice *data_device, source->source, data_device->selection_serial); } - if (data_device->selection_source != NULL) { + if (data_device->selection_source) { Wayland_data_source_destroy(data_device->selection_source); } data_device->selection_source = source; @@ -629,31 +654,30 @@ Wayland_data_device_set_selection(SDL_WaylandDataDevice *data_device, return status; } -int -Wayland_primary_selection_device_set_selection(SDL_WaylandPrimarySelectionDevice *primary_selection_device, - SDL_WaylandPrimarySelectionSource *source) +int Wayland_primary_selection_device_set_selection(SDL_WaylandPrimarySelectionDevice *primary_selection_device, + SDL_WaylandPrimarySelectionSource *source) { int status = 0; size_t num_offers = 0; size_t index = 0; - if (primary_selection_device == NULL) { + if (!primary_selection_device) { status = SDL_SetError("Invalid Primary Selection Device"); - } else if (source == NULL) { + } else if (!source) { status = SDL_SetError("Invalid source"); } else { SDL_MimeDataList *mime_data = NULL; - wl_list_for_each(mime_data, &(source->mimes), link) { + wl_list_for_each (mime_data, &(source->mimes), link) { zwp_primary_selection_source_v1_offer(source->source, mime_data->mime_type); /* TODO - Improve system for multiple mime types to same data */ for (index = 0; index < MIME_LIST_SIZE; ++index) { if (SDL_strcmp(mime_conversion_list[index][1], mime_data->mime_type) == 0) { - zwp_primary_selection_source_v1_offer(source->source, - mime_conversion_list[index][0]); - } + zwp_primary_selection_source_v1_offer(source->source, + mime_conversion_list[index][0]); + } } /* */ @@ -670,7 +694,7 @@ Wayland_primary_selection_device_set_selection(SDL_WaylandPrimarySelectionDevice source->source, primary_selection_device->selection_serial); } - if (primary_selection_device->selection_source != NULL) { + if (primary_selection_device->selection_source) { Wayland_primary_selection_source_destroy(primary_selection_device->selection_source); } primary_selection_device->selection_source = source; @@ -681,17 +705,15 @@ Wayland_primary_selection_device_set_selection(SDL_WaylandPrimarySelectionDevice return status; } -int -Wayland_data_device_set_serial(SDL_WaylandDataDevice *data_device, - uint32_t serial) +int Wayland_data_device_set_serial(SDL_WaylandDataDevice *data_device, + uint32_t serial) { int status = -1; - if (data_device != NULL) { + if (data_device) { status = 0; /* If there was no serial and there is a pending selection set it now. */ - if (data_device->selection_serial == 0 - && data_device->selection_source != NULL) { + if (data_device->selection_serial == 0 && data_device->selection_source) { wl_data_device_set_selection(data_device->data_device, data_device->selection_source->source, data_device->selection_serial); @@ -703,17 +725,15 @@ Wayland_data_device_set_serial(SDL_WaylandDataDevice *data_device, return status; } -int -Wayland_primary_selection_device_set_serial(SDL_WaylandPrimarySelectionDevice *primary_selection_device, - uint32_t serial) +int Wayland_primary_selection_device_set_serial(SDL_WaylandPrimarySelectionDevice *primary_selection_device, + uint32_t serial) { int status = -1; - if (primary_selection_device != NULL) { + if (primary_selection_device) { status = 0; /* If there was no serial and there is a pending selection set it now. */ - if (primary_selection_device->selection_serial == 0 - && primary_selection_device->selection_source != NULL) { + if (primary_selection_device->selection_serial == 0 && primary_selection_device->selection_source) { zwp_primary_selection_device_v1_set_selection(primary_selection_device->primary_selection_device, primary_selection_device->selection_source->source, primary_selection_device->selection_serial); diff --git a/src/video/wayland/SDL_waylanddatamanager.h b/src/video/wayland/SDL_waylanddatamanager.h index 3e1aa0349c6ed..f48bb82e7f0ec 100644 --- a/src/video/wayland/SDL_waylanddatamanager.h +++ b/src/video/wayland/SDL_waylanddatamanager.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,39 +29,46 @@ #define TEXT_MIME "text/plain;charset=utf-8" #define FILE_MIME "text/uri-list" +#define FILE_PORTAL_MIME "application/vnd.portal.filetransfer" -typedef struct { +typedef struct +{ char *mime_type; void *data; size_t length; struct wl_list link; } SDL_MimeDataList; -typedef struct { +typedef struct +{ struct wl_data_source *source; struct wl_list mimes; void *data_device; } SDL_WaylandDataSource; -typedef struct { +typedef struct +{ struct zwp_primary_selection_source_v1 *source; struct wl_list mimes; void *primary_selection_device; } SDL_WaylandPrimarySelectionSource; -typedef struct { +typedef struct +{ struct wl_data_offer *offer; struct wl_list mimes; void *data_device; } SDL_WaylandDataOffer; -typedef struct { +typedef struct +{ struct zwp_primary_selection_offer_v1 *offer; struct wl_list mimes; void *primary_selection_device; } SDL_WaylandPrimarySelectionOffer; -typedef struct { +typedef struct +{ struct wl_data_device *data_device; SDL_VideoData *video_data; @@ -69,13 +76,15 @@ typedef struct { uint32_t drag_serial; SDL_WaylandDataOffer *drag_offer; SDL_WaylandDataOffer *selection_offer; + SDL_Window *dnd_window; /* Clipboard and Primary Selection */ uint32_t selection_serial; SDL_WaylandDataSource *selection_source; } SDL_WaylandDataDevice; -typedef struct { +typedef struct +{ struct zwp_primary_selection_device_v1 *primary_selection_device; SDL_VideoData *video_data; @@ -84,11 +93,11 @@ typedef struct { SDL_WaylandPrimarySelectionOffer *selection_offer; } SDL_WaylandPrimarySelectionDevice; -extern const char* Wayland_convert_mime_type(const char *mime_type); +extern const char *Wayland_convert_mime_type(const char *mime_type); /* Wayland Data Source / Primary Selection Source - (Sending) */ -extern SDL_WaylandDataSource* Wayland_data_source_create(_THIS); -extern SDL_WaylandPrimarySelectionSource* Wayland_primary_selection_source_create(_THIS); +extern SDL_WaylandDataSource *Wayland_data_source_create(_THIS); +extern SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS); extern ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd); extern ssize_t Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, @@ -105,11 +114,11 @@ extern SDL_bool Wayland_data_source_has_mime(SDL_WaylandDataSource *source, const char *mime_type); extern SDL_bool Wayland_primary_selection_source_has_mime(SDL_WaylandPrimarySelectionSource *source, const char *mime_type); -extern void* Wayland_data_source_get_data(SDL_WaylandDataSource *source, +extern void *Wayland_data_source_get_data(SDL_WaylandDataSource *source, size_t *length, const char *mime_type, SDL_bool null_terminate); -extern void* Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source, +extern void *Wayland_primary_selection_source_get_data(SDL_WaylandPrimarySelectionSource *source, size_t *length, const char *mime_type, SDL_bool null_terminate); @@ -117,11 +126,11 @@ extern void Wayland_data_source_destroy(SDL_WaylandDataSource *source); extern void Wayland_primary_selection_source_destroy(SDL_WaylandPrimarySelectionSource *source); /* Wayland Data / Primary Selection Offer - (Receiving) */ -extern void* Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, +extern void *Wayland_data_offer_receive(SDL_WaylandDataOffer *offer, size_t *length, const char *mime_type, SDL_bool null_terminate); -extern void* Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, +extern void *Wayland_primary_selection_offer_receive(SDL_WaylandPrimarySelectionOffer *offer, size_t *length, const char *mime_type, SDL_bool null_terminate); @@ -142,7 +151,7 @@ extern int Wayland_primary_selection_device_clear_selection(SDL_WaylandPrimarySe extern int Wayland_data_device_set_selection(SDL_WaylandDataDevice *device, SDL_WaylandDataSource *source); extern int Wayland_primary_selection_device_set_selection(SDL_WaylandPrimarySelectionDevice *device, - SDL_WaylandPrimarySelectionSource *source); + SDL_WaylandPrimarySelectionSource *source); extern int Wayland_data_device_set_serial(SDL_WaylandDataDevice *device, uint32_t serial); extern int Wayland_primary_selection_device_set_serial(SDL_WaylandPrimarySelectionDevice *device, @@ -150,4 +159,3 @@ extern int Wayland_primary_selection_device_set_serial(SDL_WaylandPrimarySelecti #endif /* SDL_waylanddatamanager_h_ */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/wayland/SDL_waylanddyn.c b/src/video/wayland/SDL_waylanddyn.c index 6c91e0bcf102d..81f7904d908f8 100644 --- a/src/video/wayland/SDL_waylanddyn.c +++ b/src/video/wayland/SDL_waylanddyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,13 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #define DEBUG_DYNAMIC_WAYLAND 0 #include "SDL_waylanddyn.h" - #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC #include "SDL_name.h" @@ -38,49 +37,47 @@ typedef struct const char *libname; } waylanddynlib; -#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL -#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL NULL +static waylanddynlib waylandlibs[] = { + { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC }, +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL + { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL }, #endif -#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR -#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR NULL +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR + { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR }, #endif -#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON -#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON NULL +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON + { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON }, #endif -#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR -#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR NULL +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR + { NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR }, #endif - -static waylanddynlib waylandlibs[] = { - {NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC}, - {NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL}, - {NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR}, - {NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON}, - {NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR} + { NULL, NULL } }; -static void * -WAYLAND_GetSym(const char *fnname, int *pHasModule) +static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required) { - int i; void *fn = NULL; - for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) { - if (waylandlibs[i].lib != NULL) { - fn = SDL_LoadFunction(waylandlibs[i].lib, fnname); - if (fn != NULL) + waylanddynlib *dynlib; + for (dynlib = waylandlibs; dynlib->libname; dynlib++) { + if (dynlib->lib) { + fn = SDL_LoadFunction(dynlib->lib, fnname); + if (fn) { break; + } } } #if DEBUG_DYNAMIC_WAYLAND - if (fn != NULL) - SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, waylandlibs[i].libname, fn); - else + if (fn) { + SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, dynlib->libname, fn); + } else { SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname); + } #endif - if (fn == NULL) - *pHasModule = 0; /* kill this module. */ + if (!fn && required) { + *pHasModule = 0; /* kill this module. */ + } return fn; } @@ -92,33 +89,33 @@ WAYLAND_GetSym(const char *fnname, int *pHasModule) #endif /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */ /* Define all the function pointers and wrappers... */ -#define SDL_WAYLAND_MODULE(modname) int SDL_WAYLAND_HAVE_##modname = 0; -#define SDL_WAYLAND_SYM(rc,fn,params) SDL_DYNWAYLANDFN_##fn WAYLAND_##fn = NULL; -#define SDL_WAYLAND_INTERFACE(iface) const struct wl_interface *WAYLAND_##iface = NULL; +#define SDL_WAYLAND_MODULE(modname) int SDL_WAYLAND_HAVE_##modname = 0; +#define SDL_WAYLAND_SYM(rc, fn, params) SDL_DYNWAYLANDFN_##fn WAYLAND_##fn = NULL; +#define SDL_WAYLAND_SYM_OPT(rc, fn, params) SDL_DYNWAYLANDFN_##fn WAYLAND_##fn = NULL; +#define SDL_WAYLAND_INTERFACE(iface) const struct wl_interface *WAYLAND_##iface = NULL; #include "SDL_waylandsym.h" static int wayland_load_refcount = 0; -void -SDL_WAYLAND_UnloadSymbols(void) +void SDL_WAYLAND_UnloadSymbols(void) { /* Don't actually unload if more than one module is using the libs... */ if (wayland_load_refcount > 0) { if (--wayland_load_refcount == 0) { -#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC +#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC int i; #endif - + /* set all the function pointers to NULL. */ -#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 0; -#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = NULL; -#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = NULL; +#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 0; +#define SDL_WAYLAND_SYM(rc, fn, params) WAYLAND_##fn = NULL; +#define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = NULL; +#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = NULL; #include "SDL_waylandsym.h" - #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) { - if (waylandlibs[i].lib != NULL) { + if (waylandlibs[i].lib) { SDL_UnloadObject(waylandlibs[i].lib); waylandlibs[i].lib = NULL; } @@ -129,10 +126,9 @@ SDL_WAYLAND_UnloadSymbols(void) } /* returns non-zero if all needed symbols were loaded. */ -int -SDL_WAYLAND_LoadSymbols(void) +int SDL_WAYLAND_LoadSymbols(void) { - int rc = 1; /* always succeed if not using Dynamic WAYLAND stuff. */ + int rc = 1; /* always succeed if not using Dynamic WAYLAND stuff. */ /* deal with multiple modules (dga, wayland, etc) needing these symbols... */ if (wayland_load_refcount++ == 0) { @@ -140,7 +136,7 @@ SDL_WAYLAND_LoadSymbols(void) int i; int *thismod = NULL; for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) { - if (waylandlibs[i].libname != NULL) { + if (waylandlibs[i].libname) { waylandlibs[i].lib = SDL_LoadObject(waylandlibs[i].libname); } } @@ -148,9 +144,10 @@ SDL_WAYLAND_LoadSymbols(void) #define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 1; /* default yes */ #include "SDL_waylandsym.h" -#define SDL_WAYLAND_MODULE(modname) thismod = &SDL_WAYLAND_HAVE_##modname; -#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn) WAYLAND_GetSym(#fn,thismod); -#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = (struct wl_interface *) WAYLAND_GetSym(#iface,thismod); +#define SDL_WAYLAND_MODULE(modname) thismod = &SDL_WAYLAND_HAVE_##modname; +#define SDL_WAYLAND_SYM(rc, fn, params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn)WAYLAND_GetSym(#fn, thismod, SDL_TRUE); +#define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = (SDL_DYNWAYLANDFN_##fn)WAYLAND_GetSym(#fn, thismod, SDL_FALSE); +#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = (struct wl_interface *)WAYLAND_GetSym(#iface, thismod, SDL_TRUE); #include "SDL_waylandsym.h" if (SDL_WAYLAND_HAVE_WAYLAND_CLIENT) { @@ -162,11 +159,12 @@ SDL_WAYLAND_LoadSymbols(void) rc = 0; } -#else /* no dynamic WAYLAND */ +#else /* no dynamic WAYLAND */ -#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 1; /* default yes */ -#define SDL_WAYLAND_SYM(rc,fn,params) WAYLAND_##fn = fn; -#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = &iface; +#define SDL_WAYLAND_MODULE(modname) SDL_WAYLAND_HAVE_##modname = 1; /* default yes */ +#define SDL_WAYLAND_SYM(rc, fn, params) WAYLAND_##fn = fn; +#define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = fn; +#define SDL_WAYLAND_INTERFACE(iface) WAYLAND_##iface = &iface; #include "SDL_waylandsym.h" #endif diff --git a/src/video/wayland/SDL_waylanddyn.h b/src/video/wayland/SDL_waylanddyn.h index 12341e16f763a..e86375ac943bb 100644 --- a/src/video/wayland/SDL_waylanddyn.h +++ b/src/video/wayland/SDL_waylanddyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -55,22 +55,24 @@ enum libdecor_window_state; /* Must be included before our #defines, see Bugzilla #4957 */ #include "wayland-client-core.h" -#define SDL_WAYLAND_CHECK_VERSION(x, y, z) \ - (WAYLAND_VERSION_MAJOR > x || \ - (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR > y) || \ - (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR == y && WAYLAND_VERSION_MICRO >= z)) +#define SDL_WAYLAND_CHECK_VERSION(x, y, z) \ + (WAYLAND_VERSION_MAJOR > x || \ + (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR > y) || \ + (WAYLAND_VERSION_MAJOR == x && WAYLAND_VERSION_MINOR == y && WAYLAND_VERSION_MICRO >= z)) #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif int SDL_WAYLAND_LoadSymbols(void); void SDL_WAYLAND_UnloadSymbols(void); #define SDL_WAYLAND_MODULE(modname) extern int SDL_WAYLAND_HAVE_##modname; -#define SDL_WAYLAND_SYM(rc,fn,params) \ - typedef rc (*SDL_DYNWAYLANDFN_##fn) params; \ +#define SDL_WAYLAND_SYM(rc, fn, params) \ + typedef rc(*SDL_DYNWAYLANDFN_##fn) params; \ + extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn; +#define SDL_WAYLAND_SYM_OPT(rc, fn, params) \ + typedef rc(*SDL_DYNWAYLANDFN_##fn) params; \ extern SDL_DYNWAYLANDFN_##fn WAYLAND_##fn; #define SDL_WAYLAND_INTERFACE(iface) extern const struct wl_interface *WAYLAND_##iface; #include "SDL_waylandsym.h" @@ -89,35 +91,35 @@ void SDL_WAYLAND_UnloadSymbols(void); * has inline functions that require these to be defined in dynamic loading mode */ -#define wl_proxy_create (*WAYLAND_wl_proxy_create) -#define wl_proxy_destroy (*WAYLAND_wl_proxy_destroy) -#define wl_proxy_marshal (*WAYLAND_wl_proxy_marshal) -#define wl_proxy_set_user_data (*WAYLAND_wl_proxy_set_user_data) -#define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data) -#define wl_proxy_get_version (*WAYLAND_wl_proxy_get_version) -#define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener) -#define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor) +#define wl_proxy_create (*WAYLAND_wl_proxy_create) +#define wl_proxy_destroy (*WAYLAND_wl_proxy_destroy) +#define wl_proxy_marshal (*WAYLAND_wl_proxy_marshal) +#define wl_proxy_set_user_data (*WAYLAND_wl_proxy_set_user_data) +#define wl_proxy_get_user_data (*WAYLAND_wl_proxy_get_user_data) +#define wl_proxy_get_version (*WAYLAND_wl_proxy_get_version) +#define wl_proxy_add_listener (*WAYLAND_wl_proxy_add_listener) +#define wl_proxy_marshal_constructor (*WAYLAND_wl_proxy_marshal_constructor) #define wl_proxy_marshal_constructor_versioned (*WAYLAND_wl_proxy_marshal_constructor_versioned) -#define wl_proxy_set_tag (*WAYLAND_wl_proxy_set_tag) -#define wl_proxy_get_tag (*WAYLAND_wl_proxy_get_tag) -#define wl_proxy_marshal_flags (*WAYLAND_wl_proxy_marshal_flags) -#define wl_proxy_marshal_array_flags (*WAYLAND_wl_proxy_marshal_array_flags) -#define wl_display_reconnect (*WAYLAND_wl_display_reconnect) - -#define wl_seat_interface (*WAYLAND_wl_seat_interface) -#define wl_surface_interface (*WAYLAND_wl_surface_interface) -#define wl_shm_pool_interface (*WAYLAND_wl_shm_pool_interface) -#define wl_buffer_interface (*WAYLAND_wl_buffer_interface) -#define wl_registry_interface (*WAYLAND_wl_registry_interface) -#define wl_region_interface (*WAYLAND_wl_region_interface) -#define wl_pointer_interface (*WAYLAND_wl_pointer_interface) -#define wl_keyboard_interface (*WAYLAND_wl_keyboard_interface) -#define wl_compositor_interface (*WAYLAND_wl_compositor_interface) -#define wl_output_interface (*WAYLAND_wl_output_interface) -#define wl_shm_interface (*WAYLAND_wl_shm_interface) -#define wl_data_device_interface (*WAYLAND_wl_data_device_interface) -#define wl_data_offer_interface (*WAYLAND_wl_data_offer_interface) -#define wl_data_source_interface (*WAYLAND_wl_data_source_interface) +#define wl_proxy_set_tag (*WAYLAND_wl_proxy_set_tag) +#define wl_proxy_get_tag (*WAYLAND_wl_proxy_get_tag) +#define wl_proxy_marshal_flags (*WAYLAND_wl_proxy_marshal_flags) +#define wl_proxy_marshal_array_flags (*WAYLAND_wl_proxy_marshal_array_flags) +#define wl_display_reconnect (*WAYLAND_wl_display_reconnect) + +#define wl_seat_interface (*WAYLAND_wl_seat_interface) +#define wl_surface_interface (*WAYLAND_wl_surface_interface) +#define wl_shm_pool_interface (*WAYLAND_wl_shm_pool_interface) +#define wl_buffer_interface (*WAYLAND_wl_buffer_interface) +#define wl_registry_interface (*WAYLAND_wl_registry_interface) +#define wl_region_interface (*WAYLAND_wl_region_interface) +#define wl_pointer_interface (*WAYLAND_wl_pointer_interface) +#define wl_keyboard_interface (*WAYLAND_wl_keyboard_interface) +#define wl_compositor_interface (*WAYLAND_wl_compositor_interface) +#define wl_output_interface (*WAYLAND_wl_output_interface) +#define wl_shm_interface (*WAYLAND_wl_shm_interface) +#define wl_data_device_interface (*WAYLAND_wl_data_device_interface) +#define wl_data_offer_interface (*WAYLAND_wl_data_offer_interface) +#define wl_data_source_interface (*WAYLAND_wl_data_source_interface) #define wl_data_device_manager_interface (*WAYLAND_wl_data_device_manager_interface) /* @@ -131,41 +133,50 @@ void SDL_WAYLAND_UnloadSymbols(void); /* Must be included before our defines */ #include -#define libdecor_unref (*WAYLAND_libdecor_unref) -#define libdecor_new (*WAYLAND_libdecor_new) -#define libdecor_decorate (*WAYLAND_libdecor_decorate) -#define libdecor_frame_unref (*WAYLAND_libdecor_frame_unref) -#define libdecor_frame_set_title (*WAYLAND_libdecor_frame_set_title) -#define libdecor_frame_set_app_id (*WAYLAND_libdecor_frame_set_app_id) -#define libdecor_frame_set_max_content_size (*WAYLAND_libdecor_frame_set_max_content_size) -#define libdecor_frame_set_min_content_size (*WAYLAND_libdecor_frame_set_min_content_size) -#define libdecor_frame_resize (*WAYLAND_libdecor_frame_resize) -#define libdecor_frame_move (*WAYLAND_libdecor_frame_move) -#define libdecor_frame_commit (*WAYLAND_libdecor_frame_commit) -#define libdecor_frame_set_minimized (*WAYLAND_libdecor_frame_set_minimized) -#define libdecor_frame_set_maximized (*WAYLAND_libdecor_frame_set_maximized) -#define libdecor_frame_unset_maximized (*WAYLAND_libdecor_frame_unset_maximized) -#define libdecor_frame_set_fullscreen (*WAYLAND_libdecor_frame_set_fullscreen) -#define libdecor_frame_unset_fullscreen (*WAYLAND_libdecor_frame_unset_fullscreen) -#define libdecor_frame_set_capabilities (*WAYLAND_libdecor_frame_set_capabilities) -#define libdecor_frame_unset_capabilities (*WAYLAND_libdecor_frame_unset_capabilities) -#define libdecor_frame_has_capability (*WAYLAND_libdecor_frame_has_capability) -#define libdecor_frame_set_visibility (*WAYLAND_libdecor_frame_set_visibility) -#define libdecor_frame_is_visible (*WAYLAND_libdecor_frame_is_visible) -#define libdecor_frame_is_floating (*WAYLAND_libdecor_frame_is_floating) -#define libdecor_frame_set_parent (*WAYLAND_libdecor_frame_set_parent) -#define libdecor_frame_get_xdg_surface (*WAYLAND_libdecor_frame_get_xdg_surface) -#define libdecor_frame_get_xdg_toplevel (*WAYLAND_libdecor_frame_get_xdg_toplevel) -#define libdecor_frame_map (*WAYLAND_libdecor_frame_map) -#define libdecor_state_new (*WAYLAND_libdecor_state_new) -#define libdecor_state_free (*WAYLAND_libdecor_state_free) +#define libdecor_unref (*WAYLAND_libdecor_unref) +#define libdecor_new (*WAYLAND_libdecor_new) +#define libdecor_decorate (*WAYLAND_libdecor_decorate) +#define libdecor_frame_unref (*WAYLAND_libdecor_frame_unref) +#define libdecor_frame_set_title (*WAYLAND_libdecor_frame_set_title) +#define libdecor_frame_set_app_id (*WAYLAND_libdecor_frame_set_app_id) +#define libdecor_frame_set_max_content_size (*WAYLAND_libdecor_frame_set_max_content_size) +#define libdecor_frame_get_max_content_size (*WAYLAND_libdecor_frame_get_max_content_size) +#define libdecor_frame_set_min_content_size (*WAYLAND_libdecor_frame_set_min_content_size) +#define libdecor_frame_get_min_content_size (*WAYLAND_libdecor_frame_get_min_content_size) +#define libdecor_frame_resize (*WAYLAND_libdecor_frame_resize) +#define libdecor_frame_move (*WAYLAND_libdecor_frame_move) +#define libdecor_frame_commit (*WAYLAND_libdecor_frame_commit) +#define libdecor_frame_set_minimized (*WAYLAND_libdecor_frame_set_minimized) +#define libdecor_frame_set_maximized (*WAYLAND_libdecor_frame_set_maximized) +#define libdecor_frame_unset_maximized (*WAYLAND_libdecor_frame_unset_maximized) +#define libdecor_frame_set_fullscreen (*WAYLAND_libdecor_frame_set_fullscreen) +#define libdecor_frame_unset_fullscreen (*WAYLAND_libdecor_frame_unset_fullscreen) +#define libdecor_frame_set_capabilities (*WAYLAND_libdecor_frame_set_capabilities) +#define libdecor_frame_unset_capabilities (*WAYLAND_libdecor_frame_unset_capabilities) +#define libdecor_frame_has_capability (*WAYLAND_libdecor_frame_has_capability) +#define libdecor_frame_set_visibility (*WAYLAND_libdecor_frame_set_visibility) +#define libdecor_frame_is_visible (*WAYLAND_libdecor_frame_is_visible) +#define libdecor_frame_is_floating (*WAYLAND_libdecor_frame_is_floating) +#define libdecor_frame_set_parent (*WAYLAND_libdecor_frame_set_parent) +#define libdecor_frame_get_xdg_surface (*WAYLAND_libdecor_frame_get_xdg_surface) +#define libdecor_frame_get_xdg_toplevel (*WAYLAND_libdecor_frame_get_xdg_toplevel) +#define libdecor_frame_map (*WAYLAND_libdecor_frame_map) +#define libdecor_state_new (*WAYLAND_libdecor_state_new) +#define libdecor_state_free (*WAYLAND_libdecor_state_free) #define libdecor_configuration_get_content_size (*WAYLAND_libdecor_configuration_get_content_size) #define libdecor_configuration_get_window_state (*WAYLAND_libdecor_configuration_get_window_state) -#define libdecor_dispatch (*WAYLAND_libdecor_dispatch) +#define libdecor_dispatch (*WAYLAND_libdecor_dispatch) #endif #else /* SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC */ +/* + * These must be included before libdecor.h, otherwise the libdecor header + * pulls in the system Wayland protocol headers instead of ours. + */ +#include "wayland-client-protocol.h" +#include "wayland-egl.h" + #ifdef HAVE_LIBDECOR_H #include #endif diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 5ccffd9dd5e69..189798a91e21e 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "SDL_stdinc.h" #include "SDL_timer.h" @@ -51,11 +51,11 @@ #ifdef SDL_INPUT_LINUXEV #include #else -#define BTN_LEFT (0x110) -#define BTN_RIGHT (0x111) -#define BTN_MIDDLE (0x112) -#define BTN_SIDE (0x113) -#define BTN_EXTRA (0x114) +#define BTN_LEFT (0x110) +#define BTN_RIGHT (0x111) +#define BTN_MIDDLE (0x112) +#define BTN_SIDE (0x113) +#define BTN_EXTRA (0x114) #endif #include #include @@ -64,6 +64,7 @@ #include #include "../../events/imKStoUCS.h" #include "../../events/SDL_keysym_to_scancode_c.h" +#include "cursor-shape-v1-client-protocol.h" /* Clamp the wl_seat version on older versions of libwayland. */ #if SDL_WAYLAND_CHECK_VERSION(1, 21, 0) @@ -75,27 +76,28 @@ /* Weston uses a ratio of 10 units per scroll tick */ #define WAYLAND_WHEEL_AXIS_UNIT 10 -struct SDL_WaylandTouchPoint { +struct SDL_WaylandTouchPoint +{ SDL_TouchID id; - float x; - float y; - struct wl_surface* surface; + wl_fixed_t x; + wl_fixed_t y; + struct wl_surface *surface; - struct SDL_WaylandTouchPoint* prev; - struct SDL_WaylandTouchPoint* next; + struct SDL_WaylandTouchPoint *prev; + struct SDL_WaylandTouchPoint *next; }; -struct SDL_WaylandTouchPointList { - struct SDL_WaylandTouchPoint* head; - struct SDL_WaylandTouchPoint* tail; +struct SDL_WaylandTouchPointList +{ + struct SDL_WaylandTouchPoint *head; + struct SDL_WaylandTouchPoint *tail; }; -static struct SDL_WaylandTouchPointList touch_points = {NULL, NULL}; +static struct SDL_WaylandTouchPointList touch_points = { NULL, NULL }; -static void -touch_add(SDL_TouchID id, float x, float y, struct wl_surface *surface) +static void touch_add(SDL_TouchID id, wl_fixed_t x, wl_fixed_t y, struct wl_surface *surface) { - struct SDL_WaylandTouchPoint* tp = SDL_malloc(sizeof(struct SDL_WaylandTouchPoint)); + struct SDL_WaylandTouchPoint *tp = SDL_malloc(sizeof(struct SDL_WaylandTouchPoint)); tp->id = id; tp->x = x; @@ -114,25 +116,24 @@ touch_add(SDL_TouchID id, float x, float y, struct wl_surface *surface) tp->next = NULL; } -static void -touch_update(SDL_TouchID id, float x, float y) +static void touch_update(SDL_TouchID id, wl_fixed_t x, wl_fixed_t y, struct wl_surface **surface) { - struct SDL_WaylandTouchPoint* tp = touch_points.head; + struct SDL_WaylandTouchPoint *tp = touch_points.head; while (tp) { if (tp->id == id) { tp->x = x; tp->y = y; + *surface = tp->surface; } tp = tp->next; } } -static void -touch_del(SDL_TouchID id, float* x, float* y, struct wl_surface **surface) +static void touch_del(SDL_TouchID id, wl_fixed_t *x, wl_fixed_t *y, struct wl_surface **surface) { - struct SDL_WaylandTouchPoint* tp = touch_points.head; + struct SDL_WaylandTouchPoint *tp = touch_points.head; while (tp) { if (tp->id == id) { @@ -163,25 +164,34 @@ touch_del(SDL_TouchID id, float* x, float* y, struct wl_surface **surface) } } -static struct wl_surface* -touch_surface(SDL_TouchID id) +static SDL_bool Wayland_SurfaceHasActiveTouches(struct wl_surface *surface) { - struct SDL_WaylandTouchPoint* tp = touch_points.head; + struct SDL_WaylandTouchPoint *tp = touch_points.head; while (tp) { - if (tp->id == id) { - return tp->surface; + if (tp->surface == surface) { + return SDL_TRUE; } tp = tp->next; } - return NULL; + return SDL_FALSE; +} + +void Wayland_CreateCursorShapeDevice(struct SDL_WaylandInput *input) +{ + SDL_VideoData *viddata = input->display; + + if (viddata->cursor_shape_manager) { + if (input->pointer && !input->cursor_shape) { + input->cursor_shape = wp_cursor_shape_manager_v1_get_pointer(viddata->cursor_shape_manager, input->pointer); + } + } } /* Returns SDL_TRUE if a key repeat event was due */ -static SDL_bool -keyboard_repeat_handle(SDL_WaylandKeyboardRepeat* repeat_info, uint32_t elapsed) +static SDL_bool keyboard_repeat_handle(SDL_WaylandKeyboardRepeat *repeat_info, uint32_t elapsed) { SDL_bool ret = SDL_FALSE; while ((elapsed - repeat_info->next_repeat_ms) < 0x80000000U) { @@ -197,17 +207,17 @@ keyboard_repeat_handle(SDL_WaylandKeyboardRepeat* repeat_info, uint32_t elapsed) return ret; } -static void -keyboard_repeat_clear(SDL_WaylandKeyboardRepeat* repeat_info) { +static void keyboard_repeat_clear(SDL_WaylandKeyboardRepeat *repeat_info) +{ if (!repeat_info->is_initialized) { return; } repeat_info->is_key_down = SDL_FALSE; } -static void -keyboard_repeat_set(SDL_WaylandKeyboardRepeat* repeat_info, uint32_t key, uint32_t wl_press_time, - uint32_t scancode, SDL_bool has_text, char text[8]) { +static void keyboard_repeat_set(SDL_WaylandKeyboardRepeat *repeat_info, uint32_t key, uint32_t wl_press_time, + uint32_t scancode, SDL_bool has_text, char text[8]) +{ if (!repeat_info->is_initialized || !repeat_info->repeat_rate) { return; } @@ -224,8 +234,7 @@ keyboard_repeat_set(SDL_WaylandKeyboardRepeat* repeat_info, uint32_t key, uint32 } } -static uint32_t -keyboard_repeat_get_key(SDL_WaylandKeyboardRepeat *repeat_info) +static uint32_t keyboard_repeat_get_key(SDL_WaylandKeyboardRepeat *repeat_info) { if (repeat_info->is_initialized && repeat_info->is_key_down) { return repeat_info->key; @@ -234,34 +243,46 @@ keyboard_repeat_get_key(SDL_WaylandKeyboardRepeat *repeat_info) return 0; } -static void -keyboard_repeat_set_text(SDL_WaylandKeyboardRepeat *repeat_info, const char text[8]) +static void keyboard_repeat_set_text(SDL_WaylandKeyboardRepeat *repeat_info, const char text[8]) { if (repeat_info->is_initialized) { SDL_memcpy(repeat_info->text, text, 8); } } -static SDL_bool keyboard_repeat_is_set(SDL_WaylandKeyboardRepeat* repeat_info) { +static SDL_bool keyboard_repeat_is_set(SDL_WaylandKeyboardRepeat *repeat_info) +{ return repeat_info->is_initialized && repeat_info->is_key_down; } -static SDL_bool keyboard_repeat_key_is_set(SDL_WaylandKeyboardRepeat* repeat_info, uint32_t key) { +static SDL_bool keyboard_repeat_key_is_set(SDL_WaylandKeyboardRepeat *repeat_info, uint32_t key) +{ return repeat_info->is_initialized && repeat_info->is_key_down && key == repeat_info->key; } -void -Wayland_SendWakeupEvent(_THIS, SDL_Window *window) +static void sync_done_handler(void *data, struct wl_callback *callback, uint32_t callback_data) +{ + /* Nothing to do, just destroy the callback */ + wl_callback_destroy(callback); +} + +static struct wl_callback_listener sync_listener = { + sync_done_handler +}; + +void Wayland_SendWakeupEvent(_THIS, SDL_Window *window) { SDL_VideoData *d = _this->driverdata; - /* TODO: Maybe use a pipe to avoid the compositor roundtrip? */ - wl_display_sync(d->display); + /* Queue a sync event to unblock the event queue fd if it's empty and being waited on. + * TODO: Maybe use a pipe to avoid the compositor roundtrip? + */ + struct wl_callback *cb = wl_display_sync(d->display); + wl_callback_add_listener(cb, &sync_listener, NULL); WAYLAND_wl_display_flush(d->display); } -static int -dispatch_queued_events(SDL_VideoData *viddata) +static int dispatch_queued_events(SDL_VideoData *viddata) { int ret; @@ -279,8 +300,7 @@ dispatch_queued_events(SDL_VideoData *viddata) return ret >= 0 ? 1 : ret; } -int -Wayland_WaitEventTimeout(_THIS, int timeout) +int Wayland_WaitEventTimeout(_THIS, int timeout) { SDL_VideoData *d = _this->driverdata; struct SDL_WaylandInput *input = d->input; @@ -289,7 +309,7 @@ Wayland_WaitEventTimeout(_THIS, int timeout) WAYLAND_wl_display_flush(d->display); #ifdef SDL_USE_IME - if (d->text_input_manager == NULL && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { + if (!d->text_input_manager && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { SDL_IME_PumpEvents(); } #endif @@ -351,15 +371,14 @@ Wayland_WaitEventTimeout(_THIS, int timeout) } } -void -Wayland_PumpEvents(_THIS) +void Wayland_PumpEvents(_THIS) { SDL_VideoData *d = _this->driverdata; struct SDL_WaylandInput *input = d->input; int err; #ifdef SDL_USE_IME - if (d->text_input_manager == NULL && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { + if (!d->text_input_manager && SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { SDL_IME_PumpEvents(); } #endif @@ -408,9 +427,8 @@ Wayland_PumpEvents(_THIS) } } -static void -pointer_handle_motion(void *data, struct wl_pointer *pointer, - uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) +static void pointer_handle_motion(void *data, struct wl_pointer *pointer, + uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct SDL_WaylandInput *input = data; SDL_WindowData *window = input->pointer_focus; @@ -419,16 +437,15 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer, if (input->pointer_focus) { const float sx_f = (float)wl_fixed_to_double(sx_w); const float sy_f = (float)wl_fixed_to_double(sy_w); - const int sx = (int)SDL_floorf(sx_f * window->pointer_scale_x); - const int sy = (int)SDL_floorf(sy_f * window->pointer_scale_y); + const int sx = (int)SDL_floorf(sx_f * window->pointer_scale_x); + const int sy = (int)SDL_floorf(sy_f * window->pointer_scale_y); SDL_SendMouseMotion(window->sdlwindow, 0, 0, sx, sy); } } -static void -pointer_handle_enter(void *data, struct wl_pointer *pointer, - uint32_t serial, struct wl_surface *surface, - wl_fixed_t sx_w, wl_fixed_t sy_w) +static void pointer_handle_enter(void *data, struct wl_pointer *pointer, + uint32_t serial, struct wl_surface *surface, + wl_fixed_t sx_w, wl_fixed_t sy_w) { struct SDL_WaylandInput *input = data; SDL_WindowData *window; @@ -466,9 +483,8 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, } } -static void -pointer_handle_leave(void *data, struct wl_pointer *pointer, - uint32_t serial, struct wl_surface *surface) +static void pointer_handle_leave(void *data, struct wl_pointer *pointer, + uint32_t serial, struct wl_surface *surface) { struct SDL_WaylandInput *input = data; @@ -477,13 +493,17 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer, } if (input->pointer_focus) { - SDL_SetMouseFocus(NULL); + /* A pointer leave event may be emitted if the compositor hides the pointer in response to receiving a touch event. + * Don't relinquish focus if the surface has active touches, as the compositor is just transitioning from mouse to touch mode. + */ + if (!Wayland_SurfaceHasActiveTouches(surface)) { + SDL_SetMouseFocus(NULL); + } input->pointer_focus = NULL; } } -static SDL_bool -ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial) +static SDL_bool ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial) { SDL_WindowData *window_data = input->pointer_focus; SDL_Window *window = window_data->sdlwindow; @@ -509,58 +529,58 @@ ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial) #endif switch (rc) { - case SDL_HITTEST_DRAGGABLE: + case SDL_HITTEST_DRAGGABLE: #ifdef HAVE_LIBDECOR_H - if (window_data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (window_data->shell_surface.libdecor.frame) { - libdecor_frame_move(window_data->shell_surface.libdecor.frame, input->seat, serial); - } - } else + if (window_data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { + if (window_data->shell_surface.libdecor.frame) { + libdecor_frame_move(window_data->shell_surface.libdecor.frame, input->seat, serial); + } + } else #endif if (window_data->shell_surface_type == WAYLAND_SURFACE_XDG_TOPLEVEL) { - if (window_data->shell_surface.xdg.roleobj.toplevel) { - xdg_toplevel_move(window_data->shell_surface.xdg.roleobj.toplevel, - input->seat, - serial); - } + if (window_data->shell_surface.xdg.roleobj.toplevel) { + xdg_toplevel_move(window_data->shell_surface.xdg.roleobj.toplevel, + input->seat, + serial); } - return SDL_TRUE; - - case SDL_HITTEST_RESIZE_TOPLEFT: - case SDL_HITTEST_RESIZE_TOP: - case SDL_HITTEST_RESIZE_TOPRIGHT: - case SDL_HITTEST_RESIZE_RIGHT: - case SDL_HITTEST_RESIZE_BOTTOMRIGHT: - case SDL_HITTEST_RESIZE_BOTTOM: - case SDL_HITTEST_RESIZE_BOTTOMLEFT: - case SDL_HITTEST_RESIZE_LEFT: + } + return SDL_TRUE; + + case SDL_HITTEST_RESIZE_TOPLEFT: + case SDL_HITTEST_RESIZE_TOP: + case SDL_HITTEST_RESIZE_TOPRIGHT: + case SDL_HITTEST_RESIZE_RIGHT: + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: + case SDL_HITTEST_RESIZE_BOTTOM: + case SDL_HITTEST_RESIZE_BOTTOMLEFT: + case SDL_HITTEST_RESIZE_LEFT: #ifdef HAVE_LIBDECOR_H - if (window_data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (window_data->shell_surface.libdecor.frame) { - libdecor_frame_resize(window_data->shell_surface.libdecor.frame, input->seat, serial, directions_libdecor[rc - SDL_HITTEST_RESIZE_TOPLEFT]); - } - } else + if (window_data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { + if (window_data->shell_surface.libdecor.frame) { + libdecor_frame_resize(window_data->shell_surface.libdecor.frame, input->seat, serial, directions_libdecor[rc - SDL_HITTEST_RESIZE_TOPLEFT]); + } + } else #endif if (window_data->shell_surface_type == WAYLAND_SURFACE_XDG_TOPLEVEL) { - if (window_data->shell_surface.xdg.roleobj.toplevel) { - xdg_toplevel_resize(window_data->shell_surface.xdg.roleobj.toplevel, - input->seat, - serial, - directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); - } + if (window_data->shell_surface.xdg.roleobj.toplevel) { + xdg_toplevel_resize(window_data->shell_surface.xdg.roleobj.toplevel, + input->seat, + serial, + directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); } - return SDL_TRUE; + } + return SDL_TRUE; - default: return SDL_FALSE; + default: + return SDL_FALSE; } } return SDL_FALSE; } -static void -pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, - uint32_t time, uint32_t button, uint32_t state_w) +static void pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, + uint32_t time, uint32_t button, uint32_t state_w) { SDL_WindowData *window = input->pointer_focus; enum wl_pointer_button_state state = state_w; @@ -569,26 +589,26 @@ pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, if (window) { SDL_VideoData *viddata = window->waylandData; switch (button) { - case BTN_LEFT: - sdl_button = SDL_BUTTON_LEFT; - if (ProcessHitTest(input, serial)) { - return; /* don't pass this event on to app. */ - } - break; - case BTN_MIDDLE: - sdl_button = SDL_BUTTON_MIDDLE; - break; - case BTN_RIGHT: - sdl_button = SDL_BUTTON_RIGHT; - break; - case BTN_SIDE: - sdl_button = SDL_BUTTON_X1; - break; - case BTN_EXTRA: - sdl_button = SDL_BUTTON_X2; - break; - default: - return; + case BTN_LEFT: + sdl_button = SDL_BUTTON_LEFT; + if (ProcessHitTest(input, serial)) { + return; /* don't pass this event on to app. */ + } + break; + case BTN_MIDDLE: + sdl_button = SDL_BUTTON_MIDDLE; + break; + case BTN_RIGHT: + sdl_button = SDL_BUTTON_RIGHT; + break; + case BTN_SIDE: + sdl_button = SDL_BUTTON_X1; + break; + case BTN_EXTRA: + sdl_button = SDL_BUTTON_X2; + break; + default: + return; } /* Wayland won't let you "capture" the mouse, but it will @@ -596,7 +616,7 @@ pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, drag outside of it, until you let go of all buttons (even if you add or remove presses outside the window, as long as any button is still down, the capture remains) */ - if (state) { /* update our mask of currently-pressed buttons */ + if (state) { /* update our mask of currently-pressed buttons */ input->buttons_pressed |= SDL_BUTTON(sdl_button); } else { input->buttons_pressed &= ~(SDL_BUTTON(sdl_button)); @@ -619,18 +639,16 @@ pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_t serial, } } -static void -pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, - uint32_t time, uint32_t button, uint32_t state_w) +static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, + uint32_t time, uint32_t button, uint32_t state_w) { struct SDL_WaylandInput *input = data; pointer_handle_button_common(input, serial, time, button, state_w); } -static void -pointer_handle_axis_common_v1(struct SDL_WaylandInput *input, - uint32_t time, uint32_t axis, wl_fixed_t value) +static void pointer_handle_axis_common_v1(struct SDL_WaylandInput *input, + uint32_t time, uint32_t axis, wl_fixed_t value) { SDL_WindowData *window = input->pointer_focus; enum wl_pointer_axis a = axis; @@ -638,16 +656,16 @@ pointer_handle_axis_common_v1(struct SDL_WaylandInput *input, if (input->pointer_focus) { switch (a) { - case WL_POINTER_AXIS_VERTICAL_SCROLL: - x = 0; - y = 0 - (float)wl_fixed_to_double(value); - break; - case WL_POINTER_AXIS_HORIZONTAL_SCROLL: - x = (float)wl_fixed_to_double(value); - y = 0; - break; - default: - return; + case WL_POINTER_AXIS_VERTICAL_SCROLL: + x = 0; + y = 0 - (float)wl_fixed_to_double(value); + break; + case WL_POINTER_AXIS_HORIZONTAL_SCROLL: + x = (float)wl_fixed_to_double(value); + y = 0; + break; + default: + return; } x /= WAYLAND_WHEEL_AXIS_UNIT; @@ -657,9 +675,8 @@ pointer_handle_axis_common_v1(struct SDL_WaylandInput *input, } } -static void -pointer_handle_axis_common(struct SDL_WaylandInput *input, enum SDL_WaylandAxisEvent type, - uint32_t axis, wl_fixed_t value) +static void pointer_handle_axis_common(struct SDL_WaylandInput *input, enum SDL_WaylandAxisEvent type, + uint32_t axis, wl_fixed_t value) { enum wl_pointer_axis a = axis; @@ -731,26 +748,25 @@ pointer_handle_axis_common(struct SDL_WaylandInput *input, enum SDL_WaylandAxisE } } -static void -pointer_handle_axis(void *data, struct wl_pointer *pointer, - uint32_t time, uint32_t axis, wl_fixed_t value) +static void pointer_handle_axis(void *data, struct wl_pointer *pointer, + uint32_t time, uint32_t axis, wl_fixed_t value) { struct SDL_WaylandInput *input = data; - if(wl_seat_get_version(input->seat) >= 5) + if (wl_seat_get_version(input->seat) >= 5) { pointer_handle_axis_common(input, AXIS_EVENT_CONTINUOUS, axis, value); - else + } else { pointer_handle_axis_common_v1(input, time, axis, value); + } } -static void -pointer_handle_frame(void *data, struct wl_pointer *pointer) +static void pointer_handle_frame(void *data, struct wl_pointer *pointer) { struct SDL_WaylandInput *input = data; SDL_WindowData *window = input->pointer_focus; float x, y; - switch(input->pointer_curr_axis_info.x_axis_type) { + switch (input->pointer_curr_axis_info.x_axis_type) { case AXIS_EVENT_CONTINUOUS: x = input->pointer_curr_axis_info.x / WAYLAND_WHEEL_AXIS_UNIT; break; @@ -765,7 +781,7 @@ pointer_handle_frame(void *data, struct wl_pointer *pointer) break; } - switch(input->pointer_curr_axis_info.y_axis_type) { + switch (input->pointer_curr_axis_info.y_axis_type) { case AXIS_EVENT_CONTINUOUS: y = input->pointer_curr_axis_info.y / WAYLAND_WHEEL_AXIS_UNIT; break; @@ -781,39 +797,35 @@ pointer_handle_frame(void *data, struct wl_pointer *pointer) } /* clear pointer_curr_axis_info for next frame */ - SDL_memset(&input->pointer_curr_axis_info, 0, sizeof input->pointer_curr_axis_info); + SDL_memset(&input->pointer_curr_axis_info, 0, sizeof(input->pointer_curr_axis_info)); if (x != 0.0f || y != 0.0f) { SDL_SendMouseWheel(window->sdlwindow, 0, x, y, SDL_MOUSEWHEEL_NORMAL); } } -static void -pointer_handle_axis_source(void *data, struct wl_pointer *pointer, - uint32_t axis_source) +static void pointer_handle_axis_source(void *data, struct wl_pointer *pointer, + uint32_t axis_source) { /* unimplemented */ } -static void -pointer_handle_axis_stop(void *data, struct wl_pointer *pointer, - uint32_t time, uint32_t axis) +static void pointer_handle_axis_stop(void *data, struct wl_pointer *pointer, + uint32_t time, uint32_t axis) { /* unimplemented */ } -static void -pointer_handle_axis_discrete(void *data, struct wl_pointer *pointer, - uint32_t axis, int32_t discrete) +static void pointer_handle_axis_discrete(void *data, struct wl_pointer *pointer, + uint32_t axis, int32_t discrete) { struct SDL_WaylandInput *input = data; pointer_handle_axis_common(input, AXIS_EVENT_DISCRETE, axis, wl_fixed_from_int(discrete)); } -static void -pointer_handle_axis_value120(void *data, struct wl_pointer *pointer, - uint32_t axis, int32_t value120) +static void pointer_handle_axis_value120(void *data, struct wl_pointer *pointer, + uint32_t axis, int32_t value120) { struct SDL_WaylandInput *input = data; @@ -826,71 +838,122 @@ static const struct wl_pointer_listener pointer_listener = { pointer_handle_motion, pointer_handle_button, pointer_handle_axis, - pointer_handle_frame, /* Version 5 */ - pointer_handle_axis_source, /* Version 5 */ - pointer_handle_axis_stop, /* Version 5 */ - pointer_handle_axis_discrete, /* Version 5 */ - pointer_handle_axis_value120 /* Version 8 */ + pointer_handle_frame, /* Version 5 */ + pointer_handle_axis_source, /* Version 5 */ + pointer_handle_axis_stop, /* Version 5 */ + pointer_handle_axis_discrete, /* Version 5 */ + pointer_handle_axis_value120 /* Version 8 */ }; -static void -touch_handler_down(void *data, struct wl_touch *touch, unsigned int serial, - unsigned int timestamp, struct wl_surface *surface, - int id, wl_fixed_t fx, wl_fixed_t fy) +static void touch_handler_down(void *data, struct wl_touch *touch, uint32_t serial, + uint32_t timestamp, struct wl_surface *surface, + int id, wl_fixed_t fx, wl_fixed_t fy) { - SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(surface); - const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; - const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; - const float x = dblx / window_data->sdlwindow->w; - const float y = dbly / window_data->sdlwindow->h; + SDL_WindowData *window_data; + + /* Check that this surface belongs to one of the SDL windows */ + if (!SDL_WAYLAND_own_surface(surface)) { + return; + } - touch_add(id, x, y, surface); + touch_add(id, fx, fy, surface); + window_data = (SDL_WindowData *)wl_surface_get_user_data(surface); - SDL_SendTouch((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, window_data->sdlwindow, SDL_TRUE, x, y, 1.0f); + if (window_data) { + const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; + const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; + const float x = dblx / window_data->sdlwindow->w; + const float y = dbly / window_data->sdlwindow->h; + + SDL_SetMouseFocus(window_data->sdlwindow); + + SDL_SendTouch((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, + window_data->sdlwindow, SDL_TRUE, x, y, 1.0f); + } } -static void -touch_handler_up(void *data, struct wl_touch *touch, unsigned int serial, - unsigned int timestamp, int id) +static void touch_handler_up(void *data, struct wl_touch *touch, uint32_t serial, + uint32_t timestamp, int id) { - float x = 0, y = 0; + wl_fixed_t fx = 0, fy = 0; + struct SDL_WaylandInput *input = (struct SDL_WaylandInput *)data; struct wl_surface *surface = NULL; - SDL_Window *window = NULL; - touch_del(id, &x, &y, &surface); + touch_del(id, &fx, &fy, &surface); if (surface) { SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(surface); - window = window_data->sdlwindow; - } - SDL_SendTouch((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, window, SDL_FALSE, x, y, 0.0f); + if (window_data) { + const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; + const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; + const float x = dblx / window_data->sdlwindow->w; + const float y = dbly / window_data->sdlwindow->h; + + SDL_SendTouch((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, + window_data->sdlwindow, SDL_FALSE, x, y, 1.0f); + + /* If the seat lacks pointer focus, the seat's keyboard focus is another window or NULL, this window curently + * has mouse focus, and the surface has no active touch events, consider mouse focus to be lost. + */ + if (!input->pointer_focus && input->keyboard_focus != window_data && + SDL_GetMouseFocus() == window_data->sdlwindow && !Wayland_SurfaceHasActiveTouches(surface)) { + SDL_SetMouseFocus(NULL); + } + } + } } -static void -touch_handler_motion(void *data, struct wl_touch *touch, unsigned int timestamp, - int id, wl_fixed_t fx, wl_fixed_t fy) +static void touch_handler_motion(void *data, struct wl_touch *touch, uint32_t timestamp, + int id, wl_fixed_t fx, wl_fixed_t fy) { - SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(touch_surface(id)); - const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; - const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; - const float x = dblx / window_data->sdlwindow->w; - const float y = dbly / window_data->sdlwindow->h; + struct wl_surface *surface = NULL; + + touch_update(id, fx, fy, &surface); - touch_update(id, x, y); - SDL_SendTouchMotion((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, window_data->sdlwindow, x, y, 1.0f); + if (surface) { + SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(surface); + + if (window_data) { + const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; + const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; + const float x = dblx / window_data->sdlwindow->w; + const float y = dbly / window_data->sdlwindow->h; + + SDL_SendTouchMotion((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, + window_data->sdlwindow, x, y, 1.0f); + } + } } -static void -touch_handler_frame(void *data, struct wl_touch *touch) +static void touch_handler_frame(void *data, struct wl_touch *touch) { - } -static void -touch_handler_cancel(void *data, struct wl_touch *touch) +static void touch_handler_cancel(void *data, struct wl_touch *touch) { + struct SDL_WaylandTouchPoint *tp; + while ((tp = touch_points.head)) { + wl_fixed_t fx = 0, fy = 0; + struct wl_surface *surface = NULL; + int id = tp->id; + touch_del(id, &fx, &fy, &surface); + + if (surface) { + SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(surface); + + if (window_data) { + const double dblx = wl_fixed_to_double(fx) * window_data->pointer_scale_x; + const double dbly = wl_fixed_to_double(fy) * window_data->pointer_scale_y; + const float x = dblx / window_data->sdlwindow->w; + const float y = dbly / window_data->sdlwindow->h; + + SDL_SendTouch((SDL_TouchID)(intptr_t)touch, (SDL_FingerID)id, + window_data->sdlwindow, SDL_FALSE, x, y, 1.0f); + } + } + } } static const struct wl_touch_listener touch_listener = { @@ -909,8 +972,7 @@ typedef struct Wayland_Keymap SDL_Keycode keymap[SDL_NUM_SCANCODES]; } Wayland_Keymap; -static void -Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) +static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) { const xkb_keysym_t *syms; Wayland_Keymap *sdlKeymap = (Wayland_Keymap *)data; @@ -956,9 +1018,8 @@ Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) } } -static void -keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, - uint32_t format, int fd, uint32_t size) +static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, + uint32_t format, int fd, uint32_t size) { struct SDL_WaylandInput *input = data; char *map_str; @@ -980,6 +1041,13 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, return; } + if (input->xkb.keymap != NULL) { + /* if there's already a keymap loaded, throw it away rather than leaking it before + * parsing the new one + */ + WAYLAND_xkb_keymap_unref(input->xkb.keymap); + input->xkb.keymap = NULL; + } input->xkb.keymap = WAYLAND_xkb_keymap_new_from_string(input->display->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, @@ -1002,6 +1070,13 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, input->xkb.idx_caps = 1 << GET_MOD_INDEX(CAPS); #undef GET_MOD_INDEX + if (input->xkb.state != NULL) { + /* if there's already a state, throw it away rather than leaking it before + * trying to create a new one with the new keymap. + */ + WAYLAND_xkb_state_unref(input->xkb.state); + input->xkb.state = NULL; + } input->xkb.state = WAYLAND_xkb_state_new(input->xkb.keymap); if (!input->xkb.state) { SDL_SetError("failed to create XKB state\n"); @@ -1035,19 +1110,30 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, */ /* Look up the preferred locale, falling back to "C" as default */ - if (!(locale = SDL_getenv("LC_ALL"))) { - if (!(locale = SDL_getenv("LC_CTYPE"))) { - if (!(locale = SDL_getenv("LANG"))) { + locale = SDL_getenv("LC_ALL"); + if (!locale) { + locale = SDL_getenv("LC_CTYPE"); + if (!locale) { + locale = SDL_getenv("LANG"); + if (!locale) { locale = "C"; } } } /* Set up XKB compose table */ + if (input->xkb.compose_table != NULL) { + WAYLAND_xkb_compose_table_unref(input->xkb.compose_table); + input->xkb.compose_table = NULL; + } input->xkb.compose_table = WAYLAND_xkb_compose_table_new_from_locale(input->display->xkb_context, locale, XKB_COMPOSE_COMPILE_NO_FLAGS); if (input->xkb.compose_table) { /* Set up XKB compose state */ + if (input->xkb.compose_state != NULL) { + WAYLAND_xkb_compose_state_unref(input->xkb.compose_state); + input->xkb.compose_state = NULL; + } input->xkb.compose_state = WAYLAND_xkb_compose_state_new(input->xkb.compose_table, XKB_COMPOSE_STATE_NO_FLAGS); if (!input->xkb.compose_state) { @@ -1062,8 +1148,7 @@ keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, * Virtual keyboards can have arbitrary layouts, arbitrary scancodes/keycodes, etc... * Key presses from these devices must be looked up by their keysym value. */ -static SDL_Scancode -Wayland_get_scancode_from_key(struct SDL_WaylandInput *input, uint32_t key) +static SDL_Scancode Wayland_get_scancode_from_key(struct SDL_WaylandInput *input, uint32_t key) { SDL_Scancode scancode = SDL_SCANCODE_UNKNOWN; @@ -1079,10 +1164,9 @@ Wayland_get_scancode_from_key(struct SDL_WaylandInput *input, uint32_t key) return scancode; } -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_enter(void *data, struct wl_keyboard *keyboard, + uint32_t serial, struct wl_surface *surface, + struct wl_array *keys) { /* Caps Lock not included because it only makes sense to consider modifiers * that get held down, for the case where a user clicks on an unfocused @@ -1129,7 +1213,8 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, const SDL_Scancode scancode = Wayland_get_scancode_from_key(input, *key + 8); if (scancode != SDL_SCANCODE_UNKNOWN) { - for (uint32_t i = 0; i < sizeof mod_scancodes / sizeof *mod_scancodes; ++i) { + uint32_t i; + for (i = 0; i < SDL_arraysize(mod_scancodes); ++i) { if (mod_scancodes[i] == scancode) { SDL_SendKeyboardKey(SDL_PRESSED, scancode); break; @@ -1139,20 +1224,22 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, } } -static void -keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, - uint32_t serial, struct wl_surface *surface) +static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, + uint32_t serial, struct wl_surface *surface) { struct SDL_WaylandInput *input = data; - SDL_WindowData *window; + SDL_WindowData *wind; + SDL_Window *window = NULL; if (!surface || !SDL_WAYLAND_own_surface(surface)) { return; } - window = wl_surface_get_user_data(surface); - if (window) { - window->sdlwindow->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; + wind = wl_surface_get_user_data(surface); + if (wind) { + wind->keyboard_device = NULL; + window = wind->sdlwindow; + window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; } /* Stop key repeat before clearing keyboard focus */ @@ -1160,16 +1247,23 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, /* This will release any keys still pressed */ SDL_SetKeyboardFocus(NULL); + input->keyboard_focus = NULL; #ifdef SDL_USE_IME if (!input->text_input) { SDL_IME_SetFocus(SDL_FALSE); } #endif + + /* If the surface had a pointer leave event while still having active touch events, it retained mouse focus. + * Clear it now if all touch events are raised. + */ + if (!input->pointer_focus && SDL_GetMouseFocus() == window && !Wayland_SurfaceHasActiveTouches(surface)) { + SDL_SetMouseFocus(NULL); + } } -static SDL_bool -keyboard_input_get_text(char text[8], const struct SDL_WaylandInput *input, uint32_t key, Uint8 state, SDL_bool *handled_by_ime) +static SDL_bool keyboard_input_get_text(char text[8], const struct SDL_WaylandInput *input, uint32_t key, Uint8 state, SDL_bool *handled_by_ime) { SDL_WindowData *window = input->keyboard_focus; const xkb_keysym_t *syms; @@ -1199,31 +1293,30 @@ keyboard_input_get_text(char text[8], const struct SDL_WaylandInput *input, uint } if (input->xkb.compose_state && WAYLAND_xkb_compose_state_feed(input->xkb.compose_state, sym) == XKB_COMPOSE_FEED_ACCEPTED) { - switch(WAYLAND_xkb_compose_state_get_status(input->xkb.compose_state)) { - case XKB_COMPOSE_COMPOSING: - if (handled_by_ime) { - *handled_by_ime = SDL_TRUE; - } - return SDL_TRUE; - case XKB_COMPOSE_CANCELLED: - default: - sym = XKB_KEY_NoSymbol; - break; - case XKB_COMPOSE_NOTHING: - break; - case XKB_COMPOSE_COMPOSED: - sym = WAYLAND_xkb_compose_state_get_one_sym(input->xkb.compose_state); - break; + switch (WAYLAND_xkb_compose_state_get_status(input->xkb.compose_state)) { + case XKB_COMPOSE_COMPOSING: + if (handled_by_ime) { + *handled_by_ime = SDL_TRUE; + } + return SDL_TRUE; + case XKB_COMPOSE_CANCELLED: + default: + sym = XKB_KEY_NoSymbol; + break; + case XKB_COMPOSE_NOTHING: + break; + case XKB_COMPOSE_COMPOSED: + sym = WAYLAND_xkb_compose_state_get_one_sym(input->xkb.compose_state); + break; } } return WAYLAND_xkb_keysym_to_utf8(sym, text, 8) > 0; } -static void -keyboard_handle_key(void *data, struct wl_keyboard *keyboard, - uint32_t serial, uint32_t time, uint32_t key, - uint32_t state_w) +static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, + uint32_t serial, uint32_t time, uint32_t key, + uint32_t state_w) { struct SDL_WaylandInput *input = data; enum wl_keyboard_key_state state = state_w; @@ -1247,15 +1340,14 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, keyboard_input_get_text(text, input, key, SDL_RELEASED, &handled_by_ime); } - if (!handled_by_ime) { - scancode = Wayland_get_scancode_from_key(input, key + 8); - SDL_SendKeyboardKey(state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED, scancode); - } + scancode = Wayland_get_scancode_from_key(input, key + 8); + SDL_SendKeyboardKey(state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED, scancode); + + Wayland_data_device_set_serial(input->data_device, serial); + Wayland_primary_selection_device_set_serial(input->primary_selection_device, serial); if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (has_text && !(SDL_GetModState() & KMOD_CTRL)) { - Wayland_data_device_set_serial(input->data_device, serial); - Wayland_primary_selection_device_set_serial(input->primary_selection_device, serial); if (!handled_by_ime) { SDL_SendKeyboardText(text); } @@ -1266,18 +1358,26 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard, } } -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 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) { struct SDL_WaylandInput *input = data; Wayland_Keymap keymap; const uint32_t modstate = (mods_depressed | mods_latched | mods_locked); + if (input->xkb.state == NULL) { + /* if we get a modifier notification before the keymap, there's nothing we can do with the information + */ + return; + } + WAYLAND_xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched, - mods_locked, 0, 0, group); + mods_locked, 0, 0, group); + + SDL_ToggleModState(KMOD_NUM, modstate & input->xkb.idx_num); + SDL_ToggleModState(KMOD_CAPS, modstate & input->xkb.idx_caps); /* Toggle the modifier states for virtual keyboards, as they may not send key presses. */ if (input->keyboard_is_virtual) { @@ -1285,12 +1385,10 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, SDL_ToggleModState(KMOD_CTRL, modstate & input->xkb.idx_ctrl); SDL_ToggleModState(KMOD_ALT, modstate & input->xkb.idx_alt); SDL_ToggleModState(KMOD_GUI, modstate & input->xkb.idx_gui); - SDL_ToggleModState(KMOD_NUM, modstate & input->xkb.idx_num); - SDL_ToggleModState(KMOD_CAPS, modstate & input->xkb.idx_caps); } /* If a key is repeating, update the text to apply the modifier. */ - if(keyboard_repeat_is_set(&input->keyboard_repeat)) { + if (keyboard_repeat_is_set(&input->keyboard_repeat)) { char text[8]; const uint32_t key = keyboard_repeat_get_key(&input->keyboard_repeat); @@ -1315,9 +1413,8 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); } -static void -keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, - int32_t rate, int32_t delay) +static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, + int32_t rate, int32_t delay) { struct SDL_WaylandInput *input = data; input->keyboard_repeat.repeat_rate = SDL_clamp(rate, 0, 1000); @@ -1331,23 +1428,27 @@ static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, - keyboard_handle_repeat_info, /* Version 4 */ + keyboard_handle_repeat_info, /* Version 4 */ }; -static void -seat_handle_capabilities(void *data, struct wl_seat *seat, - enum wl_seat_capability caps) +static void seat_handle_capabilities(void *data, struct wl_seat *seat, + enum wl_seat_capability caps) { struct SDL_WaylandInput *input = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { input->pointer = wl_seat_get_pointer(seat); - SDL_memset(&input->pointer_curr_axis_info, 0, sizeof input->pointer_curr_axis_info); + SDL_memset(&input->pointer_curr_axis_info, 0, sizeof(input->pointer_curr_axis_info)); input->display->pointer = input->pointer; + Wayland_CreateCursorShapeDevice(input); wl_pointer_set_user_data(input->pointer, input); wl_pointer_add_listener(input->pointer, &pointer_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { + if (input->cursor_shape) { + wp_cursor_shape_device_v1_destroy(input->cursor_shape); + input->cursor_shape = NULL; + } wl_pointer_destroy(input->pointer); input->pointer = NULL; input->display->pointer = NULL; @@ -1358,7 +1459,7 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, SDL_AddTouch((SDL_TouchID)(intptr_t)input->touch, SDL_TOUCH_DEVICE_DIRECT, "wayland_touch"); wl_touch_set_user_data(input->touch, input); wl_touch_add_listener(input->touch, &touch_listener, - input); + input); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { SDL_DelTouch((SDL_TouchID)(intptr_t)input->touch); wl_touch_destroy(input->touch); @@ -1376,49 +1477,42 @@ seat_handle_capabilities(void *data, struct wl_seat *seat, } } -static void -seat_handle_name(void *data, struct wl_seat *wl_seat, const char *name) +static void seat_handle_name(void *data, struct wl_seat *wl_seat, const char *name) { /* unimplemented */ } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, - seat_handle_name, /* Version 2 */ + seat_handle_name, /* Version 2 */ }; -static void -data_source_handle_target(void *data, struct wl_data_source *wl_data_source, - const char *mime_type) +static void data_source_handle_target(void *data, struct wl_data_source *wl_data_source, + const char *mime_type) { } -static void -data_source_handle_send(void *data, struct wl_data_source *wl_data_source, - const char *mime_type, int32_t fd) +static void data_source_handle_send(void *data, struct wl_data_source *wl_data_source, + const char *mime_type, int32_t fd) { Wayland_data_source_send((SDL_WaylandDataSource *)data, mime_type, fd); } -static void -data_source_handle_cancelled(void *data, struct wl_data_source *wl_data_source) +static void data_source_handle_cancelled(void *data, struct wl_data_source *wl_data_source) { Wayland_data_source_destroy(data); } -static void -data_source_handle_dnd_drop_performed(void *data, struct wl_data_source *wl_data_source) +static void data_source_handle_dnd_drop_performed(void *data, struct wl_data_source *wl_data_source) { } -static void -data_source_handle_dnd_finished(void *data, struct wl_data_source *wl_data_source) +static void data_source_handle_dnd_finished(void *data, struct wl_data_source *wl_data_source) { } -static void -data_source_handle_action(void *data, struct wl_data_source *wl_data_source, - uint32_t dnd_action) +static void data_source_handle_action(void *data, struct wl_data_source *wl_data_source, + uint32_t dnd_action) { } @@ -1431,16 +1525,14 @@ static const struct wl_data_source_listener data_source_listener = { data_source_handle_action, /* Version 3 */ }; -static void -primary_selection_source_send(void *data, struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1, - const char *mime_type, int32_t fd) +static void primary_selection_source_send(void *data, struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1, + const char *mime_type, int32_t fd) { Wayland_primary_selection_source_send((SDL_WaylandPrimarySelectionSource *)data, mime_type, fd); } -static void -primary_selection_source_cancelled(void *data, struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1) +static void primary_selection_source_cancelled(void *data, struct zwp_primary_selection_source_v1 *zwp_primary_selection_source_v1) { Wayland_primary_selection_source_destroy(data); } @@ -1450,28 +1542,27 @@ static const struct zwp_primary_selection_source_v1_listener primary_selection_s primary_selection_source_cancelled, }; -SDL_WaylandDataSource* -Wayland_data_source_create(_THIS) +SDL_WaylandDataSource *Wayland_data_source_create(_THIS) { SDL_WaylandDataSource *data_source = NULL; SDL_VideoData *driver_data = NULL; struct wl_data_source *id = NULL; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { driver_data = _this->driverdata; - if (driver_data->data_device_manager != NULL) { + if (driver_data->data_device_manager) { id = wl_data_device_manager_create_data_source( - driver_data->data_device_manager); + driver_data->data_device_manager); } - if (id == NULL) { + if (!id) { SDL_SetError("Wayland unable to create data source"); } else { - data_source = SDL_calloc(1, sizeof *data_source); - if (data_source == NULL) { + data_source = SDL_calloc(1, sizeof(*data_source)); + if (!data_source) { SDL_OutOfMemory(); wl_data_source_destroy(id); } else { @@ -1486,58 +1577,54 @@ Wayland_data_source_create(_THIS) return data_source; } -SDL_WaylandPrimarySelectionSource* -Wayland_primary_selection_source_create(_THIS) +SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(_THIS) { SDL_WaylandPrimarySelectionSource *primary_selection_source = NULL; SDL_VideoData *driver_data = NULL; struct zwp_primary_selection_source_v1 *id = NULL; - if (_this == NULL || _this->driverdata == NULL) { + if (!_this || !_this->driverdata) { SDL_SetError("Video driver uninitialized"); } else { driver_data = _this->driverdata; - if (driver_data->primary_selection_device_manager != NULL) { + if (driver_data->primary_selection_device_manager) { id = zwp_primary_selection_device_manager_v1_create_source( - driver_data->primary_selection_device_manager); + driver_data->primary_selection_device_manager); } - if (id == NULL) { + if (!id) { SDL_SetError("Wayland unable to create primary selection source"); } else { - primary_selection_source = SDL_calloc(1, sizeof *primary_selection_source); - if (primary_selection_source == NULL) { + primary_selection_source = SDL_calloc(1, sizeof(*primary_selection_source)); + if (!primary_selection_source) { SDL_OutOfMemory(); zwp_primary_selection_source_v1_destroy(id); } else { WAYLAND_wl_list_init(&(primary_selection_source->mimes)); primary_selection_source->source = id; zwp_primary_selection_source_v1_add_listener(id, &primary_selection_source_listener, - primary_selection_source); + primary_selection_source); } } } return primary_selection_source; } -static void -data_offer_handle_offer(void *data, struct wl_data_offer *wl_data_offer, - const char *mime_type) +static void data_offer_handle_offer(void *data, struct wl_data_offer *wl_data_offer, + const char *mime_type) { SDL_WaylandDataOffer *offer = data; Wayland_data_offer_add_mime(offer, mime_type); } -static void -data_offer_handle_source_actions(void *data, struct wl_data_offer *wl_data_offer, - uint32_t source_actions) +static void data_offer_handle_source_actions(void *data, struct wl_data_offer *wl_data_offer, + uint32_t source_actions) { } -static void -data_offer_handle_actions(void *data, struct wl_data_offer *wl_data_offer, - uint32_t dnd_action) +static void data_offer_handle_actions(void *data, struct wl_data_offer *wl_data_offer, + uint32_t dnd_action) { } @@ -1547,9 +1634,8 @@ static const struct wl_data_offer_listener data_offer_listener = { data_offer_handle_actions, /* Version 3 */ }; -static void -primary_selection_offer_handle_offer(void *data, struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1, - const char *mime_type) +static void primary_selection_offer_handle_offer(void *data, struct zwp_primary_selection_offer_v1 *zwp_primary_selection_offer_v1, + const char *mime_type) { SDL_WaylandPrimarySelectionOffer *offer = data; Wayland_primary_selection_offer_add_mime(offer, mime_type); @@ -1559,14 +1645,13 @@ static const struct zwp_primary_selection_offer_v1_listener primary_selection_of primary_selection_offer_handle_offer, }; -static void -data_device_handle_data_offer(void *data, struct wl_data_device *wl_data_device, - struct wl_data_offer *id) +static void data_device_handle_data_offer(void *data, struct wl_data_device *wl_data_device, + struct wl_data_offer *id) { SDL_WaylandDataOffer *data_offer = NULL; - data_offer = SDL_calloc(1, sizeof *data_offer); - if (data_offer == NULL) { + data_offer = SDL_calloc(1, sizeof(*data_offer)); + if (!data_offer) { SDL_OutOfMemory(); } else { data_offer->offer = id; @@ -1577,10 +1662,9 @@ data_device_handle_data_offer(void *data, struct wl_data_device *wl_data_device, } } -static void -data_device_handle_enter(void *data, struct wl_data_device *wl_data_device, - uint32_t serial, struct wl_surface *surface, - wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id) +static void data_device_handle_enter(void *data, struct wl_data_device *wl_data_device, + uint32_t serial, struct wl_surface *surface, + wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id) { SDL_WaylandDataDevice *data_device = data; SDL_bool has_mime = SDL_FALSE; @@ -1588,43 +1672,55 @@ data_device_handle_enter(void *data, struct wl_data_device *wl_data_device, data_device->drag_serial = serial; - if (id != NULL) { + if (id) { data_device->drag_offer = wl_data_offer_get_user_data(id); /* TODO: SDL Support more mime types */ - has_mime = Wayland_data_offer_has_mime( - data_device->drag_offer, FILE_MIME); - - /* If drag_mime is NULL this will decline the offer */ - wl_data_offer_accept(id, serial, - (has_mime == SDL_TRUE) ? FILE_MIME : NULL); +#ifdef SDL_USE_LIBDBUS + if (Wayland_data_offer_has_mime(data_device->drag_offer, FILE_PORTAL_MIME)) { + has_mime = SDL_TRUE; + wl_data_offer_accept(id, serial, FILE_PORTAL_MIME); + } +#endif + if (Wayland_data_offer_has_mime(data_device->drag_offer, FILE_MIME)) { + has_mime = SDL_TRUE; + wl_data_offer_accept(id, serial, FILE_MIME); + } /* SDL only supports "copy" style drag and drop */ - if (has_mime == SDL_TRUE) { + if (has_mime) { dnd_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY; + } else { + /* drag_mime is NULL this will decline the offer */ + wl_data_offer_accept(id, serial, NULL); } if (wl_data_offer_get_version(data_device->drag_offer->offer) >= 3) { wl_data_offer_set_actions(data_device->drag_offer->offer, dnd_action, dnd_action); } + + /* find the current window */ + if (surface && SDL_WAYLAND_own_surface(surface)) { + SDL_WindowData *window = (SDL_WindowData *)wl_surface_get_user_data(surface); + if (window) { + data_device->dnd_window = window->sdlwindow; + } + } } } -static void -data_device_handle_leave(void *data, struct wl_data_device *wl_data_device) +static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_device) { SDL_WaylandDataDevice *data_device = data; - SDL_WaylandDataOffer *offer = NULL; - if (data_device->selection_offer != NULL) { - data_device->selection_offer = NULL; - Wayland_data_offer_destroy(offer); + if (data_device->drag_offer) { + Wayland_data_offer_destroy(data_device->drag_offer); + data_device->drag_offer = NULL; } } -static void -data_device_handle_motion(void *data, struct wl_data_device *wl_data_device, - uint32_t time, wl_fixed_t x, wl_fixed_t y) +static void data_device_handle_motion(void *data, struct wl_data_device *wl_data_device, + uint32_t time, wl_fixed_t x, wl_fixed_t y) { } @@ -1643,10 +1739,11 @@ data_device_handle_motion(void *data, struct wl_data_device *wl_data_device, * * FIXME: This was shamelessly copied from SDL_x11events.c */ -static int Wayland_URIDecode(char *buf, int len) { +static int Wayland_URIDecode(char *buf, int len) +{ int ri, wi, di; char decode = '\0'; - if (buf == NULL || len < 0) { + if (!buf || len < 0) { errno = EINVAL; return -1; } @@ -1708,76 +1805,119 @@ static int Wayland_URIDecode(char *buf, int len) { * * FIXME: This was shamelessly copied from SDL_x11events.c */ -static char* Wayland_URIToLocal(char* uri) { +static char *Wayland_URIToLocal(char *uri) +{ char *file = NULL; SDL_bool local; - if (SDL_memcmp(uri,"file:/",6) == 0) uri += 6; /* local file? */ - else if (SDL_strstr(uri,":/") != NULL) return file; /* wrong scheme */ + if (SDL_memcmp(uri, "file:/", 6) == 0) { + uri += 6; /* local file? */ + } else if (SDL_strstr(uri, ":/") != NULL) { + return file; /* wrong scheme */ + } local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); /* got a hostname? */ if (!local && uri[0] == '/' && uri[2] != '/') { - char* hostname_end = SDL_strchr(uri+1, '/'); - if (hostname_end != NULL) { - char hostname[ 257 ]; - if (gethostname(hostname, 255) == 0) { - hostname[ 256 ] = '\0'; - if (SDL_memcmp(uri+1, hostname, hostname_end - (uri+1)) == 0) { - uri = hostname_end + 1; - local = SDL_TRUE; + char *hostname_end = SDL_strchr(uri + 1, '/'); + if (hostname_end) { + char hostname[257]; + if (gethostname(hostname, 255) == 0) { + hostname[256] = '\0'; + if (SDL_memcmp(uri + 1, hostname, hostname_end - (uri + 1)) == 0) { + uri = hostname_end + 1; + local = SDL_TRUE; + } } - } - } + } } if (local) { - file = uri; - /* Convert URI escape sequences to real characters */ - Wayland_URIDecode(file, 0); - if (uri[1] == '/') { - file++; - } else { - file--; - } + file = uri; + /* Convert URI escape sequences to real characters */ + Wayland_URIDecode(file, 0); + if (uri[1] == '/') { + file++; + } else { + file--; + } } return file; } -static void -data_device_handle_drop(void *data, struct wl_data_device *wl_data_device) +static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_device) { SDL_WaylandDataDevice *data_device = data; - if (data_device->drag_offer != NULL) { + if (data_device->drag_offer) { /* TODO: SDL Support more mime types */ size_t length; - void *buffer = Wayland_data_offer_receive(data_device->drag_offer, - &length, FILE_MIME, SDL_TRUE); - if (buffer) { - char *saveptr = NULL; - char *token = SDL_strtokr((char *) buffer, "\r\n", &saveptr); - while (token != NULL) { - char *fn = Wayland_URIToLocal(token); - if (fn) { - SDL_SendDropFile(NULL, fn); /* FIXME: Window? */ + SDL_bool drop_handled = SDL_FALSE; +#ifdef SDL_USE_LIBDBUS + if (Wayland_data_offer_has_mime( + data_device->drag_offer, FILE_PORTAL_MIME)) { + void *buffer = Wayland_data_offer_receive(data_device->drag_offer, + &length, FILE_PORTAL_MIME, SDL_TRUE); + if (buffer) { + SDL_DBusContext *dbus = SDL_DBus_GetContext(); + if (dbus) { + int path_count = 0; + char **paths = SDL_DBus_DocumentsPortalRetrieveFiles(buffer, &path_count); + /* If dropped files contain a directory the list is empty */ + if (paths && path_count > 0) { + int i; + for (i = 0; i < path_count; i++) { + SDL_SendDropFile(data_device->dnd_window, paths[i]); + } + dbus->free_string_array(paths); + SDL_SendDropComplete(data_device->dnd_window); + drop_handled = SDL_TRUE; + } + } + SDL_free(buffer); + } + } +#endif + /* If XDG document portal fails fallback. + * When running a flatpak sandbox this will most likely be a list of + * non paths that are not visible to the application + */ + if (!drop_handled && Wayland_data_offer_has_mime( + data_device->drag_offer, FILE_MIME)) { + void *buffer = Wayland_data_offer_receive(data_device->drag_offer, + &length, FILE_MIME, SDL_TRUE); + if (buffer) { + char *saveptr = NULL; + char *token = SDL_strtokr((char *)buffer, "\r\n", &saveptr); + while (token) { + char *fn = Wayland_URIToLocal(token); + if (fn) { + SDL_SendDropFile(data_device->dnd_window, fn); + } + token = SDL_strtokr(NULL, "\r\n", &saveptr); } - token = SDL_strtokr(NULL, "\r\n", &saveptr); + SDL_SendDropComplete(data_device->dnd_window); + SDL_free(buffer); + drop_handled = SDL_TRUE; } - SDL_SendDropComplete(NULL); /* FIXME: Window? */ - SDL_free(buffer); } + + if (drop_handled && wl_data_offer_get_version(data_device->drag_offer->offer) >= + WL_DATA_OFFER_FINISH_SINCE_VERSION) { + wl_data_offer_finish(data_device->drag_offer->offer); + } + Wayland_data_offer_destroy(data_device->drag_offer); + data_device->drag_offer = NULL; } } -static void -data_device_handle_selection(void *data, struct wl_data_device *wl_data_device, - struct wl_data_offer *id) +static void data_device_handle_selection(void *data, struct wl_data_device *wl_data_device, + struct wl_data_offer *id) { SDL_WaylandDataDevice *data_device = data; SDL_WaylandDataOffer *offer = NULL; - if (id != NULL) { + if (id) { offer = wl_data_offer_get_user_data(id); } @@ -1798,14 +1938,13 @@ static const struct wl_data_device_listener data_device_listener = { data_device_handle_selection }; -static void -primary_selection_device_handle_offer(void *data, struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, - struct zwp_primary_selection_offer_v1 *id) +static void primary_selection_device_handle_offer(void *data, struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, + struct zwp_primary_selection_offer_v1 *id) { SDL_WaylandPrimarySelectionOffer *primary_selection_offer = NULL; - primary_selection_offer = SDL_calloc(1, sizeof *primary_selection_offer); - if (primary_selection_offer == NULL) { + primary_selection_offer = SDL_calloc(1, sizeof(*primary_selection_offer)); + if (!primary_selection_offer) { SDL_OutOfMemory(); } else { primary_selection_offer->offer = id; @@ -1816,14 +1955,13 @@ primary_selection_device_handle_offer(void *data, struct zwp_primary_selection_d } } -static void -primary_selection_device_handle_selection(void *data, struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, - struct zwp_primary_selection_offer_v1 *id) +static void primary_selection_device_handle_selection(void *data, struct zwp_primary_selection_device_v1 *zwp_primary_selection_device_v1, + struct zwp_primary_selection_offer_v1 *id) { SDL_WaylandPrimarySelectionDevice *primary_selection_device = data; SDL_WaylandPrimarySelectionOffer *offer = NULL; - if (id != NULL) { + if (id) { offer = zwp_primary_selection_offer_v1_get_user_data(id); } @@ -1840,28 +1978,25 @@ static const struct zwp_primary_selection_device_v1_listener primary_selection_d primary_selection_device_handle_selection }; -static void -text_input_enter(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - struct wl_surface *surface) +static void text_input_enter(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + struct wl_surface *surface) { /* No-op */ } -static void -text_input_leave(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - struct wl_surface *surface) +static void text_input_leave(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + struct wl_surface *surface) { /* No-op */ } -static void -text_input_preedit_string(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - const char *text, - int32_t cursor_begin, - int32_t cursor_end) +static void text_input_preedit_string(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + const char *text, + int32_t cursor_begin, + int32_t cursor_end) { SDL_WaylandTextInput *text_input = data; char buf[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; @@ -1885,7 +2020,7 @@ text_input_preedit_string(void *data, int text_bytes = (int)SDL_strlen(text), i = 0; int cursor = 0; do { - const int sz = (int)SDL_utf8strlcpy(buf, text+i, sizeof(buf)); + const int sz = (int)SDL_utf8strlcpy(buf, text + i, sizeof(buf)); const int chars = (int)SDL_utf8strlen(buf); SDL_SendEditingText(buf, cursor, chars); @@ -1900,17 +2035,16 @@ text_input_preedit_string(void *data, } } -static void -text_input_commit_string(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - const char *text) +static void text_input_commit_string(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + const char *text) { if (text && *text) { char buf[SDL_TEXTINPUTEVENT_TEXT_SIZE]; size_t text_bytes = SDL_strlen(text), i = 0; while (i < text_bytes) { - size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf)); + size_t sz = SDL_utf8strlcpy(buf, text + i, sizeof(buf)); SDL_SendKeyboardText(buf); i += sz; @@ -1918,19 +2052,17 @@ text_input_commit_string(void *data, } } -static void -text_input_delete_surrounding_text(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - uint32_t before_length, - uint32_t after_length) +static void text_input_delete_surrounding_text(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + uint32_t before_length, + uint32_t after_length) { /* FIXME: Do we care about this event? */ } -static void -text_input_done(void *data, - struct zwp_text_input_v3 *zwp_text_input_v3, - uint32_t serial) +static void text_input_done(void *data, + struct zwp_text_input_v3 *zwp_text_input_v3, + uint32_t serial) { SDL_WaylandTextInput *text_input = data; if (!text_input->has_preedit) { @@ -1948,22 +2080,25 @@ static const struct zwp_text_input_v3_listener text_input_listener = { text_input_done }; -static void -Wayland_create_data_device(SDL_VideoData *d) +static void Wayland_create_data_device(SDL_VideoData *d) { SDL_WaylandDataDevice *data_device = NULL; - data_device = SDL_calloc(1, sizeof *data_device); - if (data_device == NULL) { + if (!d->input->seat) { + /* No seat yet, will be initialized later. */ + return; + } + + data_device = SDL_calloc(1, sizeof(*data_device)); + if (!data_device) { return; } data_device->data_device = wl_data_device_manager_get_data_device( - d->data_device_manager, d->input->seat - ); + d->data_device_manager, d->input->seat); data_device->video_data = d; - if (data_device->data_device == NULL) { + if (!data_device->data_device) { SDL_free(data_device); } else { wl_data_device_set_user_data(data_device->data_device, data_device); @@ -1973,22 +2108,25 @@ Wayland_create_data_device(SDL_VideoData *d) } } -static void -Wayland_create_primary_selection_device(SDL_VideoData *d) +static void Wayland_create_primary_selection_device(SDL_VideoData *d) { SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; - primary_selection_device = SDL_calloc(1, sizeof *primary_selection_device); - if (primary_selection_device == NULL) { + if (!d->input->seat) { + /* No seat yet, will be initialized later. */ + return; + } + + primary_selection_device = SDL_calloc(1, sizeof(*primary_selection_device)); + if (!primary_selection_device) { return; } primary_selection_device->primary_selection_device = zwp_primary_selection_device_manager_v1_get_device( - d->primary_selection_device_manager, d->input->seat - ); + d->primary_selection_device_manager, d->input->seat); primary_selection_device->video_data = d; - if (primary_selection_device->primary_selection_device == NULL) { + if (!primary_selection_device->primary_selection_device) { SDL_free(primary_selection_device); } else { zwp_primary_selection_device_v1_set_user_data(primary_selection_device->primary_selection_device, @@ -1999,21 +2137,24 @@ Wayland_create_primary_selection_device(SDL_VideoData *d) } } -static void -Wayland_create_text_input(SDL_VideoData *d) +static void Wayland_create_text_input(SDL_VideoData *d) { SDL_WaylandTextInput *text_input = NULL; - text_input = SDL_calloc(1, sizeof *text_input); - if (text_input == NULL) { + if (!d->input->seat) { + /* No seat yet, will be initialized later. */ + return; + } + + text_input = SDL_calloc(1, sizeof(*text_input)); + if (!text_input) { return; } text_input->text_input = zwp_text_input_manager_v3_get_text_input( - d->text_input_manager, d->input->seat - ); + d->text_input_manager, d->input->seat); - if (text_input->text_input == NULL) { + if (!text_input->text_input) { SDL_free(text_input); } else { zwp_text_input_v3_set_user_data(text_input->text_input, text_input); @@ -2023,77 +2164,79 @@ Wayland_create_text_input(SDL_VideoData *d) } } -void -Wayland_add_data_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version) +void Wayland_add_data_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version) { d->data_device_manager = wl_registry_bind(d->registry, id, &wl_data_device_manager_interface, SDL_min(3, version)); - if (d->input != NULL) { + if (d->input) { Wayland_create_data_device(d); } } -void -Wayland_add_primary_selection_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version) +void Wayland_add_primary_selection_device_manager(SDL_VideoData *d, uint32_t id, uint32_t version) { d->primary_selection_device_manager = wl_registry_bind(d->registry, id, &zwp_primary_selection_device_manager_v1_interface, 1); - if (d->input != NULL) { + if (d->input) { Wayland_create_primary_selection_device(d); } } -void -Wayland_add_text_input_manager(SDL_VideoData *d, uint32_t id, uint32_t version) +void Wayland_add_text_input_manager(SDL_VideoData *d, uint32_t id, uint32_t version) { +#ifdef HAVE_FCITX + const char *im_module = SDL_getenv("SDL_IM_MODULE"); + if (im_module && SDL_strcmp(im_module, "fcitx") == 0) { + /* Override the Wayland text-input protocol when Fcitx is enabled, like how GTK_IM_MODULE does. + * + * The Fcitx wiki discourages enabling it under Wayland via SDL_IM_MODULE, so its presence must + * be intentional, and this workaround is needed for fixing key repeat detection. + */ + return; + } +#endif + d->text_input_manager = wl_registry_bind(d->registry, id, &zwp_text_input_manager_v3_interface, 1); - if (d->input != NULL) { + if (d->input) { Wayland_create_text_input(d); } } -static void -tablet_tool_handle_type(void* data, struct zwp_tablet_tool_v2* tool, uint32_t type) +static void tablet_tool_handle_type(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t type) { /* unimplemented */ } -static void -tablet_tool_handle_hardware_serial(void* data, struct zwp_tablet_tool_v2* tool, uint32_t serial_hi, uint32_t serial_lo) +static void tablet_tool_handle_hardware_serial(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial_hi, uint32_t serial_lo) { /* unimplemented */ } -static void -tablet_tool_handle_hardware_id_wacom(void* data, struct zwp_tablet_tool_v2* tool, uint32_t id_hi, uint32_t id_lo) +static void tablet_tool_handle_hardware_id_wacom(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t id_hi, uint32_t id_lo) { /* unimplemented */ } -static void -tablet_tool_handle_capability(void* data, struct zwp_tablet_tool_v2* tool, uint32_t capability) +static void tablet_tool_handle_capability(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t capability) { /* unimplemented */ } -static void -tablet_tool_handle_done(void* data, struct zwp_tablet_tool_v2* tool) +static void tablet_tool_handle_done(void *data, struct zwp_tablet_tool_v2 *tool) { /* unimplemented */ } -static void -tablet_tool_handle_removed(void* data, struct zwp_tablet_tool_v2* tool) +static void tablet_tool_handle_removed(void *data, struct zwp_tablet_tool_v2 *tool) { /* unimplemented */ } -static void -tablet_tool_handle_proximity_in(void* data, struct zwp_tablet_tool_v2* tool, uint32_t serial, struct zwp_tablet_v2* tablet, struct wl_surface* surface) +static void tablet_tool_handle_proximity_in(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial, struct zwp_tablet_v2 *tablet, struct wl_surface *surface) { - struct SDL_WaylandTabletInput* input = data; - SDL_WindowData* window; + struct SDL_WaylandTabletInput *input = data; + SDL_WindowData *window; if (!surface) { return; @@ -2103,7 +2246,7 @@ tablet_tool_handle_proximity_in(void* data, struct zwp_tablet_tool_v2* tool, uin return; } - window = (SDL_WindowData*)wl_surface_get_user_data(surface); + window = (SDL_WindowData *)wl_surface_get_user_data(surface); if (window) { input->tool_focus = window; @@ -2120,10 +2263,9 @@ tablet_tool_handle_proximity_in(void* data, struct zwp_tablet_tool_v2* tool, uin } } -static void -tablet_tool_handle_proximity_out(void* data, struct zwp_tablet_tool_v2* tool) +static void tablet_tool_handle_proximity_out(void *data, struct zwp_tablet_tool_v2 *tool) { - struct SDL_WaylandTabletInput* input = data; + struct SDL_WaylandTabletInput *input = data; if (input->tool_focus) { SDL_SetMouseFocus(NULL); @@ -2131,29 +2273,27 @@ tablet_tool_handle_proximity_out(void* data, struct zwp_tablet_tool_v2* tool) } } -uint32_t -tablet_tool_btn_to_sdl_button(struct SDL_WaylandTabletInput* input) +uint32_t tablet_tool_btn_to_sdl_button(struct SDL_WaylandTabletInput *input) { unsigned int tool_btn = input->btn_stylus3 << 2 | input->btn_stylus2 << 1 | input->btn_stylus << 0; switch (tool_btn) { - case 0b000: - return SDL_BUTTON_LEFT; - case 0b001: - return SDL_BUTTON_RIGHT; - case 0b010: - return SDL_BUTTON_MIDDLE; - case 0b100: - return SDL_BUTTON_X1; - default: - return SDL_BUTTON_LEFT; + case 0b000: + return SDL_BUTTON_LEFT; + case 0b001: + return SDL_BUTTON_RIGHT; + case 0b010: + return SDL_BUTTON_MIDDLE; + case 0b100: + return SDL_BUTTON_X1; + default: + return SDL_BUTTON_LEFT; } } -static void -tablet_tool_handle_down(void* data, struct zwp_tablet_tool_v2* tool, uint32_t serial) +static void tablet_tool_handle_down(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial) { - struct SDL_WaylandTabletInput* input = data; - SDL_WindowData* window = input->tool_focus; + struct SDL_WaylandTabletInput *input = data; + SDL_WindowData *window = input->tool_focus; input->is_down = SDL_TRUE; if (!window) { /* tablet_tool_handle_proximity_out gets called when moving over the libdecoration csd. @@ -2166,11 +2306,10 @@ tablet_tool_handle_down(void* data, struct zwp_tablet_tool_v2* tool, uint32_t se SDL_SendMouseButton(window->sdlwindow, 0, SDL_PRESSED, tablet_tool_btn_to_sdl_button(input)); } -static void -tablet_tool_handle_up(void* data, struct zwp_tablet_tool_v2* tool) +static void tablet_tool_handle_up(void *data, struct zwp_tablet_tool_v2 *tool) { - struct SDL_WaylandTabletInput* input = data; - SDL_WindowData* window = input->tool_focus; + struct SDL_WaylandTabletInput *input = data; + SDL_WindowData *window = input->tool_focus; input->is_down = SDL_FALSE; @@ -2185,45 +2324,40 @@ tablet_tool_handle_up(void* data, struct zwp_tablet_tool_v2* tool) SDL_SendMouseButton(window->sdlwindow, 0, SDL_RELEASED, tablet_tool_btn_to_sdl_button(input)); } -static void -tablet_tool_handle_motion(void* data, struct zwp_tablet_tool_v2* tool, wl_fixed_t sx_w, wl_fixed_t sy_w) +static void tablet_tool_handle_motion(void *data, struct zwp_tablet_tool_v2 *tool, wl_fixed_t sx_w, wl_fixed_t sy_w) { - struct SDL_WaylandTabletInput* input = data; - SDL_WindowData* window = input->tool_focus; + struct SDL_WaylandTabletInput *input = data; + SDL_WindowData *window = input->tool_focus; input->sx_w = sx_w; input->sy_w = sy_w; if (input->tool_focus) { const float sx_f = (float)wl_fixed_to_double(sx_w); const float sy_f = (float)wl_fixed_to_double(sy_w); - const int sx = (int)SDL_floorf(sx_f * window->pointer_scale_x); - const int sy = (int)SDL_floorf(sy_f * window->pointer_scale_y); + const int sx = (int)SDL_floorf(sx_f * window->pointer_scale_x); + const int sy = (int)SDL_floorf(sy_f * window->pointer_scale_y); SDL_SendMouseMotion(window->sdlwindow, 0, 0, sx, sy); } } -static void -tablet_tool_handle_pressure(void* data, struct zwp_tablet_tool_v2* tool, uint32_t pressure) +static void tablet_tool_handle_pressure(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t pressure) { /* unimplemented */ } -static void -tablet_tool_handle_distance(void* data, struct zwp_tablet_tool_v2* tool, uint32_t distance) +static void tablet_tool_handle_distance(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t distance) { /* unimplemented */ } -static void -tablet_tool_handle_tilt(void* data, struct zwp_tablet_tool_v2* tool, wl_fixed_t xtilt, wl_fixed_t ytilt) +static void tablet_tool_handle_tilt(void *data, struct zwp_tablet_tool_v2 *tool, wl_fixed_t xtilt, wl_fixed_t ytilt) { /* unimplemented */ } -static void -tablet_tool_handle_button(void* data, struct zwp_tablet_tool_v2* tool, uint32_t serial, uint32_t button, uint32_t state) +static void tablet_tool_handle_button(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t serial, uint32_t button, uint32_t state) { - struct SDL_WaylandTabletInput* input = data; + struct SDL_WaylandTabletInput *input = data; if (input->is_down) { tablet_tool_handle_up(data, tool); @@ -2231,16 +2365,16 @@ tablet_tool_handle_button(void* data, struct zwp_tablet_tool_v2* tool, uint32_t } switch (button) { - /* see %{_includedir}/linux/input-event-codes.h */ - case 0x14b: /* BTN_STYLUS */ - input->btn_stylus = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; - break; - case 0x14c: /* BTN_STYLUS2 */ - input->btn_stylus2 = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; - break; - case 0x149: /* BTN_STYLUS3 */ - input->btn_stylus3 = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; - break; + /* see %{_includedir}/linux/input-event-codes.h */ + case 0x14b: /* BTN_STYLUS */ + input->btn_stylus = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; + break; + case 0x14c: /* BTN_STYLUS2 */ + input->btn_stylus2 = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; + break; + case 0x149: /* BTN_STYLUS3 */ + input->btn_stylus3 = state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED ? SDL_TRUE : SDL_FALSE; + break; } if (input->is_down) { @@ -2248,31 +2382,26 @@ tablet_tool_handle_button(void* data, struct zwp_tablet_tool_v2* tool, uint32_t } } -static void -tablet_tool_handle_rotation(void* data, struct zwp_tablet_tool_v2* tool, wl_fixed_t degrees) +static void tablet_tool_handle_rotation(void *data, struct zwp_tablet_tool_v2 *tool, wl_fixed_t degrees) { /* unimplemented */ } -static void -tablet_tool_handle_slider(void* data, struct zwp_tablet_tool_v2* tool, int32_t position) +static void tablet_tool_handle_slider(void *data, struct zwp_tablet_tool_v2 *tool, int32_t position) { /* unimplemented */ } -static void -tablet_tool_handle_wheel(void* data, struct zwp_tablet_tool_v2* tool, int32_t degrees, int32_t clicks) +static void tablet_tool_handle_wheel(void *data, struct zwp_tablet_tool_v2 *tool, int32_t degrees, int32_t clicks) { /* unimplemented */ } -static void -tablet_tool_handle_frame(void* data, struct zwp_tablet_tool_v2* tool, uint32_t time) +static void tablet_tool_handle_frame(void *data, struct zwp_tablet_tool_v2 *tool, uint32_t time) { /* unimplemented */ } - static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { tablet_tool_handle_type, tablet_tool_handle_hardware_serial, @@ -2295,13 +2424,12 @@ static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = { tablet_tool_handle_frame }; -struct SDL_WaylandTabletObjectListNode* -tablet_object_list_new_node(void* object) +struct SDL_WaylandTabletObjectListNode *tablet_object_list_new_node(void *object) { - struct SDL_WaylandTabletObjectListNode* node; + struct SDL_WaylandTabletObjectListNode *node; - node = SDL_calloc(1, sizeof *node); - if (node == NULL) { + node = SDL_calloc(1, sizeof(*node)); + if (!node) { return NULL; } @@ -2311,9 +2439,9 @@ tablet_object_list_new_node(void* object) return node; } -void tablet_object_list_append(struct SDL_WaylandTabletObjectListNode* head, void* object) +void tablet_object_list_append(struct SDL_WaylandTabletObjectListNode *head, void *object) { - if (head->object == NULL) { + if (!head->object) { head->object = object; return; } @@ -2325,10 +2453,10 @@ void tablet_object_list_append(struct SDL_WaylandTabletObjectListNode* head, voi head->next = tablet_object_list_new_node(object); } -void tablet_object_list_destroy(struct SDL_WaylandTabletObjectListNode* head, void (*deleter)(void* object)) +void tablet_object_list_destroy(struct SDL_WaylandTabletObjectListNode *head, void (*deleter)(void *object)) { while (head) { - struct SDL_WaylandTabletObjectListNode* next = head->next; + struct SDL_WaylandTabletObjectListNode *next = head->next; if (head->object) { (*deleter)(head->object); } @@ -2337,19 +2465,16 @@ void tablet_object_list_destroy(struct SDL_WaylandTabletObjectListNode* head, vo } } - -static void -tablet_seat_handle_tablet_added(void* data, struct zwp_tablet_seat_v2* seat, struct zwp_tablet_v2* tablet) +static void tablet_seat_handle_tablet_added(void *data, struct zwp_tablet_seat_v2 *seat, struct zwp_tablet_v2 *tablet) { - struct SDL_WaylandTabletInput* input = data; + struct SDL_WaylandTabletInput *input = data; tablet_object_list_append(input->tablets, tablet); } -static void -tablet_seat_handle_tool_added(void* data, struct zwp_tablet_seat_v2* seat, struct zwp_tablet_tool_v2* tool) +static void tablet_seat_handle_tool_added(void *data, struct zwp_tablet_seat_v2 *seat, struct zwp_tablet_tool_v2 *tool) { - struct SDL_WaylandTabletInput* input = data; + struct SDL_WaylandTabletInput *input = data; zwp_tablet_tool_v2_add_listener(tool, &tablet_tool_listener, data); zwp_tablet_tool_v2_set_user_data(tool, data); @@ -2357,10 +2482,9 @@ tablet_seat_handle_tool_added(void* data, struct zwp_tablet_seat_v2* seat, struc tablet_object_list_append(input->tools, tool); } -static void -tablet_seat_handle_pad_added(void* data, struct zwp_tablet_seat_v2* seat, struct zwp_tablet_pad_v2* pad) +static void tablet_seat_handle_pad_added(void *data, struct zwp_tablet_seat_v2 *seat, struct zwp_tablet_pad_v2 *pad) { - struct SDL_WaylandTabletInput* input = data; + struct SDL_WaylandTabletInput *input = data; tablet_object_list_append(input->pads, pad); } @@ -2371,68 +2495,56 @@ static const struct zwp_tablet_seat_v2_listener tablet_seat_listener = { tablet_seat_handle_pad_added }; -void -Wayland_input_add_tablet(struct SDL_WaylandInput *input, struct SDL_WaylandTabletManager* tablet_manager) +void Wayland_input_add_tablet(struct SDL_WaylandInput *input, struct SDL_WaylandTabletManager *tablet_manager) { - struct SDL_WaylandTabletInput* tablet_input; + struct SDL_WaylandTabletInput *tablet_input; - if (!tablet_manager || !input || !input->seat) { + if (!tablet_manager || !input->seat) { return; } - tablet_input = SDL_calloc(1, sizeof *tablet_input); - if (tablet_input == NULL) { + tablet_input = SDL_calloc(1, sizeof(*tablet_input)); + if (!tablet_input) { return; } input->tablet = tablet_input; - tablet_input->seat = (struct SDL_WaylandTabletSeat*)zwp_tablet_manager_v2_get_tablet_seat((struct zwp_tablet_manager_v2*)tablet_manager, input->seat); + tablet_input->seat = (struct SDL_WaylandTabletSeat *)zwp_tablet_manager_v2_get_tablet_seat((struct zwp_tablet_manager_v2 *)tablet_manager, input->seat); tablet_input->tablets = tablet_object_list_new_node(NULL); tablet_input->tools = tablet_object_list_new_node(NULL); tablet_input->pads = tablet_object_list_new_node(NULL); - zwp_tablet_seat_v2_add_listener((struct zwp_tablet_seat_v2*)tablet_input->seat, &tablet_seat_listener, tablet_input); + zwp_tablet_seat_v2_add_listener((struct zwp_tablet_seat_v2 *)tablet_input->seat, &tablet_seat_listener, tablet_input); } -#define TABLET_OBJECT_LIST_DELETER(fun) (void (*)(void*))fun -void -Wayland_input_destroy_tablet(struct SDL_WaylandInput* input) +#define TABLET_OBJECT_LIST_DELETER(fun) (void (*)(void *)) fun +void Wayland_input_destroy_tablet(struct SDL_WaylandInput *input) { tablet_object_list_destroy(input->tablet->pads, TABLET_OBJECT_LIST_DELETER(zwp_tablet_pad_v2_destroy)); tablet_object_list_destroy(input->tablet->tools, TABLET_OBJECT_LIST_DELETER(zwp_tablet_tool_v2_destroy)); tablet_object_list_destroy(input->tablet->tablets, TABLET_OBJECT_LIST_DELETER(zwp_tablet_v2_destroy)); - zwp_tablet_seat_v2_destroy((struct zwp_tablet_seat_v2*)input->tablet->seat); + zwp_tablet_seat_v2_destroy((struct zwp_tablet_seat_v2 *)input->tablet->seat); SDL_free(input->tablet); input->tablet = NULL; } -void -Wayland_display_add_input(SDL_VideoData *d, uint32_t id, uint32_t version) +void Wayland_display_add_input(SDL_VideoData *d, uint32_t id, uint32_t version) { - struct SDL_WaylandInput *input; - - input = SDL_calloc(1, sizeof *input); - if (input == NULL) - return; + struct SDL_WaylandInput *input = d->input; - input->display = d; input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, SDL_min(SDL_WL_SEAT_VERSION, version)); - input->sx_w = wl_fixed_from_int(0); - input->sy_w = wl_fixed_from_int(0); - input->xkb.current_group = XKB_GROUP_INVALID; - d->input = input; - if (d->data_device_manager != NULL) { + if (d->data_device_manager) { Wayland_create_data_device(d); } - if (d->primary_selection_device_manager != NULL) { + if (d->primary_selection_device_manager) { Wayland_create_primary_selection_device(d); } - if (d->text_input_manager != NULL) { + if (d->text_input_manager) { Wayland_create_text_input(d); } @@ -2450,33 +2562,50 @@ void Wayland_display_destroy_input(SDL_VideoData *d) { struct SDL_WaylandInput *input = d->input; - if (!input) + if (!input) { return; + } - if (input->data_device != NULL) { + if (input->data_device) { Wayland_data_device_clear_selection(input->data_device); - if (input->data_device->selection_offer != NULL) { + if (input->data_device->selection_offer) { Wayland_data_offer_destroy(input->data_device->selection_offer); } - if (input->data_device->drag_offer != NULL) { + if (input->data_device->drag_offer) { Wayland_data_offer_destroy(input->data_device->drag_offer); } - if (input->data_device->data_device != NULL) { + if (input->data_device->data_device) { wl_data_device_release(input->data_device->data_device); } SDL_free(input->data_device); } - if (input->text_input != NULL) { + if (input->primary_selection_device) { + if (input->primary_selection_device->selection_offer) { + Wayland_primary_selection_offer_destroy(input->primary_selection_device->selection_offer); + } + if (input->primary_selection_device->primary_selection_device) { + zwp_primary_selection_device_v1_destroy(input->primary_selection_device->primary_selection_device); + } + SDL_free(input->primary_selection_device); + } + + if (input->text_input) { zwp_text_input_v3_destroy(input->text_input->text_input); SDL_free(input->text_input); } - if (input->keyboard) + if (input->keyboard) { wl_keyboard_destroy(input->keyboard); + } - if (input->pointer) + if (input->cursor_shape) { + wp_cursor_shape_device_v1_destroy(input->cursor_shape); + } + + if (input->pointer) { wl_pointer_destroy(input->pointer); + } if (input->touch) { SDL_DelTouch(1); @@ -2487,20 +2616,25 @@ void Wayland_display_destroy_input(SDL_VideoData *d) Wayland_input_destroy_tablet(input); } - if (input->seat) + if (input->seat) { wl_seat_destroy(input->seat); + } - if (input->xkb.compose_state) + if (input->xkb.compose_state) { WAYLAND_xkb_compose_state_unref(input->xkb.compose_state); + } - if (input->xkb.compose_table) + if (input->xkb.compose_table) { WAYLAND_xkb_compose_table_unref(input->xkb.compose_table); + } - if (input->xkb.state) + if (input->xkb.state) { WAYLAND_xkb_state_unref(input->xkb.state); + } - if (input->xkb.keymap) + if (input->xkb.keymap) { WAYLAND_xkb_keymap_unref(input->xkb.keymap); + } SDL_free(input); d->input = NULL; @@ -2516,8 +2650,9 @@ void Wayland_display_add_relative_pointer_manager(SDL_VideoData *d, uint32_t id) void Wayland_display_destroy_relative_pointer_manager(SDL_VideoData *d) { - if (d->relative_pointer_manager) + if (d->relative_pointer_manager) { zwp_relative_pointer_manager_v1_destroy(d->relative_pointer_manager); + } } void Wayland_display_add_pointer_constraints(SDL_VideoData *d, uint32_t id) @@ -2529,40 +2664,45 @@ void Wayland_display_add_pointer_constraints(SDL_VideoData *d, uint32_t id) void Wayland_display_destroy_pointer_constraints(SDL_VideoData *d) { - if (d->pointer_constraints) + if (d->pointer_constraints) { zwp_pointer_constraints_v1_destroy(d->pointer_constraints); + } } -static void -relative_pointer_handle_relative_motion(void *data, - struct zwp_relative_pointer_v1 *pointer, - uint32_t time_hi, - uint32_t time_lo, - wl_fixed_t dx_w, - wl_fixed_t dy_w, - wl_fixed_t dx_unaccel_w, - wl_fixed_t dy_unaccel_w) +static void relative_pointer_handle_relative_motion(void *data, + struct zwp_relative_pointer_v1 *pointer, + uint32_t time_hi, + uint32_t time_lo, + wl_fixed_t dx_w, + wl_fixed_t dy_w, + wl_fixed_t dx_unaccel_w, + wl_fixed_t dy_unaccel_w) { struct SDL_WaylandInput *input = data; SDL_VideoData *d = input->display; SDL_WindowData *window = input->pointer_focus; - double dx_unaccel; - double dy_unaccel; double dx; double dy; + double dx_mod; + double dy_mod; - dx_unaccel = wl_fixed_to_double(dx_unaccel_w); - dy_unaccel = wl_fixed_to_double(dy_unaccel_w); + if (!d->relative_mode_accelerated) { + dx = wl_fixed_to_double(dx_unaccel_w); + dy = wl_fixed_to_double(dy_unaccel_w); + } else { + dx = wl_fixed_to_double(dx_w) * (window ? window->pointer_scale_x : 1.0); + dy = wl_fixed_to_double(dy_w) * (window ? window->pointer_scale_y : 1.0); + } /* Add left over fraction from last event. */ - dx_unaccel += input->dx_frac; - dy_unaccel += input->dy_frac; + dx += input->dx_frac; + dy += input->dy_frac; - input->dx_frac = modf(dx_unaccel, &dx); - input->dy_frac = modf(dy_unaccel, &dy); + input->dx_frac = modf(dx, &dx_mod); + input->dy_frac = modf(dy, &dy_mod); if (input->pointer_focus && d->relative_mouse_mode) { - SDL_SendMouseMotion(window->sdlwindow, 0, 1, (int)dx, (int)dy); + SDL_SendMouseMotion(window->sdlwindow, 0, 1, (int)dx_mod, (int)dy_mod); } } @@ -2570,15 +2710,13 @@ static const struct zwp_relative_pointer_v1_listener relative_pointer_listener = relative_pointer_handle_relative_motion, }; -static void -locked_pointer_locked(void *data, - struct zwp_locked_pointer_v1 *locked_pointer) +static void locked_pointer_locked(void *data, + struct zwp_locked_pointer_v1 *locked_pointer) { } -static void -locked_pointer_unlocked(void *data, - struct zwp_locked_pointer_v1 *locked_pointer) +static void locked_pointer_unlocked(void *data, + struct zwp_locked_pointer_v1 *locked_pointer) { } @@ -2587,16 +2725,20 @@ static const struct zwp_locked_pointer_v1_listener locked_pointer_listener = { locked_pointer_unlocked, }; -static void -lock_pointer_to_window(SDL_Window *window, - struct SDL_WaylandInput *input) +static void lock_pointer_to_window(SDL_Window *window, + struct SDL_WaylandInput *input) { SDL_WindowData *w = window->driverdata; SDL_VideoData *d = input->display; struct zwp_locked_pointer_v1 *locked_pointer; - if (w->locked_pointer) + if (!d->pointer_constraints || !input->pointer) { return; + } + + if (w->locked_pointer) { + return; + } locked_pointer = zwp_pointer_constraints_v1_lock_pointer(d->pointer_constraints, @@ -2627,20 +2769,24 @@ int Wayland_input_lock_pointer(struct SDL_WaylandInput *input) SDL_Window *window; struct zwp_relative_pointer_v1 *relative_pointer; - if (!d->relative_pointer_manager) + if (!d->relative_pointer_manager) { return -1; + } - if (!d->pointer_constraints) + if (!d->pointer_constraints) { return -1; + } - if (!input->pointer) + if (!input->pointer) { return -1; + } /* If we have a pointer confine active, we must destroy it here because * creating a locked pointer otherwise would be a protocol error. */ - for (window = vd->windows; window; window = window->next) + for (window = vd->windows; window; window = window->next) { pointer_confine_destroy(window); + } if (!input->relative_pointer) { relative_pointer = @@ -2653,8 +2799,9 @@ int Wayland_input_lock_pointer(struct SDL_WaylandInput *input) input->relative_pointer = relative_pointer; } - for (window = vd->windows; window; window = window->next) + for (window = vd->windows; window; window = window->next) { lock_pointer_to_window(window, input); + } d->relative_mouse_mode = 1; @@ -2670,31 +2817,33 @@ int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input) for (window = vd->windows; window; window = window->next) { w = window->driverdata; - if (w->locked_pointer) + if (w->locked_pointer) { zwp_locked_pointer_v1_destroy(w->locked_pointer); + } w->locked_pointer = NULL; } - zwp_relative_pointer_v1_destroy(input->relative_pointer); - input->relative_pointer = NULL; + if (input->relative_pointer) { + zwp_relative_pointer_v1_destroy(input->relative_pointer); + input->relative_pointer = NULL; + } d->relative_mouse_mode = 0; - for (window = vd->windows; window; window = window->next) + for (window = vd->windows; window; window = window->next) { Wayland_input_confine_pointer(input, window); + } return 0; } -static void -confined_pointer_confined(void *data, - struct zwp_confined_pointer_v1 *confined_pointer) +static void confined_pointer_confined(void *data, + struct zwp_confined_pointer_v1 *confined_pointer) { } -static void -confined_pointer_unconfined(void *data, - struct zwp_confined_pointer_v1 *confined_pointer) +static void confined_pointer_unconfined(void *data, + struct zwp_confined_pointer_v1 *confined_pointer) { } @@ -2710,11 +2859,13 @@ int Wayland_input_confine_pointer(struct SDL_WaylandInput *input, SDL_Window *wi struct zwp_confined_pointer_v1 *confined_pointer; struct wl_region *confine_rect; - if (!d->pointer_constraints) + if (!d->pointer_constraints) { return -1; + } - if (!input->pointer) + if (!input->pointer) { return -1; + } /* A confine may already be active, in which case we should destroy it and * create a new one. @@ -2724,12 +2875,14 @@ int Wayland_input_confine_pointer(struct SDL_WaylandInput *input, SDL_Window *wi /* We cannot create a confine if the pointer is already locked. Defer until * the pointer is unlocked. */ - if (d->relative_mouse_mode) + if (d->relative_mouse_mode) { return 0; + } /* Don't confine the pointer if it shouldn't be confined. */ - if (SDL_RectEmpty(&window->mouse_rect) && !(window->flags & SDL_WINDOW_MOUSE_GRABBED)) + if (SDL_RectEmpty(&window->mouse_rect) && !(window->flags & SDL_WINDOW_MOUSE_GRABBED)) { return 0; + } if (SDL_RectEmpty(&window->mouse_rect)) { confine_rect = NULL; @@ -2759,7 +2912,7 @@ int Wayland_input_confine_pointer(struct SDL_WaylandInput *input, SDL_Window *wi &confined_pointer_listener, window); - if (confine_rect != NULL) { + if (confine_rect) { wl_region_destroy(confine_rect); } @@ -2778,11 +2931,13 @@ int Wayland_input_grab_keyboard(SDL_Window *window, struct SDL_WaylandInput *inp SDL_WindowData *w = window->driverdata; SDL_VideoData *d = input->display; - if (!d->key_inhibitor_manager) + if (!d->key_inhibitor_manager) { return -1; + } - if (w->key_inhibitor) + if (w->key_inhibitor) { return 0; + } w->key_inhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(d->key_inhibitor_manager, diff --git a/src/video/wayland/SDL_waylandevents_c.h b/src/video/wayland/SDL_waylandevents_c.h index aab2abf4361a4..b2b7890f0ae70 100644 --- a/src/video/wayland/SDL_waylandevents_c.h +++ b/src/video/wayland/SDL_waylandevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,17 +38,19 @@ enum SDL_WaylandAxisEvent struct SDL_WaylandTabletSeat; -struct SDL_WaylandTabletObjectListNode { - void* object; - struct SDL_WaylandTabletObjectListNode* next; +struct SDL_WaylandTabletObjectListNode +{ + void *object; + struct SDL_WaylandTabletObjectListNode *next; }; -struct SDL_WaylandTabletInput { - struct SDL_WaylandTabletSeat* seat; +struct SDL_WaylandTabletInput +{ + struct SDL_WaylandTabletSeat *seat; - struct SDL_WaylandTabletObjectListNode* tablets; - struct SDL_WaylandTabletObjectListNode* tools; - struct SDL_WaylandTabletObjectListNode* pads; + struct SDL_WaylandTabletObjectListNode *tablets; + struct SDL_WaylandTabletObjectListNode *tools; + struct SDL_WaylandTabletObjectListNode *pads; SDL_WindowData *tool_focus; uint32_t tool_prox_serial; @@ -64,7 +66,8 @@ struct SDL_WaylandTabletInput { SDL_bool btn_stylus3; }; -typedef struct { +typedef struct +{ // repeat_rate in range of [1, 1000] int32_t repeat_rate; int32_t repeat_delay; @@ -72,14 +75,15 @@ typedef struct { SDL_bool is_key_down; uint32_t key; - uint32_t wl_press_time; // Key press time as reported by the Wayland API + uint32_t wl_press_time; // Key press time as reported by the Wayland API uint32_t sdl_press_time; // Key press time expressed in SDL ticks uint32_t next_repeat_ms; uint32_t scancode; char text[8]; } SDL_WaylandKeyboardRepeat; -struct SDL_WaylandInput { +struct SDL_WaylandInput +{ SDL_VideoData *display; struct wl_seat *seat; struct wl_pointer *pointer; @@ -88,6 +92,7 @@ struct SDL_WaylandInput { SDL_WaylandDataDevice *data_device; SDL_WaylandPrimarySelectionDevice *primary_selection_device; SDL_WaylandTextInput *text_input; + struct wp_cursor_shape_device_v1 *cursor_shape; struct zwp_relative_pointer_v1 *relative_pointer; SDL_WindowData *pointer_focus; SDL_WindowData *keyboard_focus; @@ -102,7 +107,8 @@ struct SDL_WaylandInput { double dx_frac; double dy_frac; - struct { + struct + { struct xkb_keymap *keymap; struct xkb_state *state; struct xkb_compose_table *compose_table; @@ -121,7 +127,8 @@ struct SDL_WaylandInput { } xkb; /* information about axis events on current frame */ - struct { + struct + { enum SDL_WaylandAxisEvent x_axis_type; float x; @@ -131,7 +138,7 @@ struct SDL_WaylandInput { SDL_WaylandKeyboardRepeat keyboard_repeat; - struct SDL_WaylandTabletInput* tablet; + struct SDL_WaylandTabletInput *tablet; /* are we forcing relative mouse mode? */ SDL_bool cursor_visible; @@ -166,9 +173,11 @@ extern void Wayland_display_destroy_relative_pointer_manager(SDL_VideoData *d); extern int Wayland_input_grab_keyboard(SDL_Window *window, struct SDL_WaylandInput *input); extern int Wayland_input_ungrab_keyboard(SDL_Window *window); -extern void Wayland_input_add_tablet(struct SDL_WaylandInput *input, struct SDL_WaylandTabletManager* tablet_manager); +extern void Wayland_input_add_tablet(struct SDL_WaylandInput *input, struct SDL_WaylandTabletManager *tablet_manager); extern void Wayland_input_destroy_tablet(struct SDL_WaylandInput *input); +extern void Wayland_CreateCursorShapeDevice(struct SDL_WaylandInput *input); + #endif /* SDL_waylandevents_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index 5cea5effcb4de..46ac0528a9dd0 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,59 +20,47 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "../SDL_sysvideo.h" #include "SDL_waylandvideo.h" #include "SDL_waylandevents_c.h" +#include "../../events/SDL_keyboard_c.h" #include "text-input-unstable-v3-client-protocol.h" -int -Wayland_InitKeyboard(_THIS) +int Wayland_InitKeyboard(_THIS) { #ifdef SDL_USE_IME SDL_VideoData *driverdata = _this->driverdata; - if (driverdata->text_input_manager == NULL) { + if (!driverdata->text_input_manager) { SDL_IME_Init(); } #endif + SDL_SetScancodeName(SDL_SCANCODE_APPLICATION, "Menu"); return 0; } -void -Wayland_QuitKeyboard(_THIS) +void Wayland_QuitKeyboard(_THIS) { #ifdef SDL_USE_IME SDL_VideoData *driverdata = _this->driverdata; - if (driverdata->text_input_manager == NULL) { + if (!driverdata->text_input_manager) { SDL_IME_Quit(); } #endif } -void -Wayland_StartTextInput(_THIS) +void Wayland_StartTextInput(_THIS) { SDL_VideoData *driverdata = _this->driverdata; + struct SDL_WaylandInput *input = driverdata->input; if (driverdata->text_input_manager) { - struct SDL_WaylandInput *input = driverdata->input; - if (input != NULL && input->text_input) { + if (input && input->text_input) { const SDL_Rect *rect = &input->text_input->cursor_rect; - /* Don't re-enable if we're already enabled. */ - if (input->text_input->is_enabled) - return; - - /* For some reason this has to be done twice, it appears to be a - * bug in mutter? Maybe? - * -flibit - */ - zwp_text_input_v3_enable(input->text_input->text_input); - zwp_text_input_v3_commit(input->text_input->text_input); zwp_text_input_v3_enable(input->text_input->text_input); - zwp_text_input_v3_commit(input->text_input->text_input); /* Now that it's enabled, set the input properties */ zwp_text_input_v3_set_content_type(input->text_input->text_input, @@ -87,34 +75,39 @@ Wayland_StartTextInput(_THIS) rect->h); } zwp_text_input_v3_commit(input->text_input->text_input); - input->text_input->is_enabled = SDL_TRUE; } } + + if (input && input->xkb.compose_state) { + /* Reset compose state so composite and dead keys don't carry over */ + WAYLAND_xkb_compose_state_reset(input->xkb.compose_state); + } } -void -Wayland_StopTextInput(_THIS) +void Wayland_StopTextInput(_THIS) { SDL_VideoData *driverdata = _this->driverdata; + struct SDL_WaylandInput *input = driverdata->input; if (driverdata->text_input_manager) { - struct SDL_WaylandInput *input = driverdata->input; - if (input != NULL && input->text_input) { + if (input && input->text_input) { zwp_text_input_v3_disable(input->text_input->text_input); zwp_text_input_v3_commit(input->text_input->text_input); - input->text_input->is_enabled = SDL_FALSE; } } - #ifdef SDL_USE_IME else { SDL_IME_Reset(); } #endif + + if (input && input->xkb.compose_state) { + /* Reset compose state so composite and dead keys don't carry over */ + WAYLAND_xkb_compose_state_reset(input->xkb.compose_state); + } } -void -Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) +void Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) { SDL_VideoData *driverdata = _this->driverdata; @@ -125,9 +118,8 @@ Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) if (driverdata->text_input_manager) { struct SDL_WaylandInput *input = driverdata->input; - if (input != NULL && input->text_input) { - if (!SDL_RectEquals(rect, &input->text_input->cursor_rect)) - { + if (input && input->text_input) { + if (!SDL_RectEquals(rect, &input->text_input->cursor_rect)) { SDL_copyp(&input->text_input->cursor_rect, rect); zwp_text_input_v3_set_cursor_rectangle(input->text_input->text_input, rect->x, @@ -146,8 +138,7 @@ Wayland_SetTextInputRect(_THIS, const SDL_Rect *rect) #endif } -SDL_bool -Wayland_HasScreenKeyboardSupport(_THIS) +SDL_bool Wayland_HasScreenKeyboardSupport(_THIS) { /* In reality we just want to return true when the screen keyboard is the * _only_ way to get text input. So, in addition to checking for the text @@ -156,7 +147,7 @@ Wayland_HasScreenKeyboardSupport(_THIS) SDL_VideoData *driverdata = _this->driverdata; SDL_bool haskeyboard = (driverdata->input != NULL) && (driverdata->input->keyboard != NULL); SDL_bool hastextmanager = (driverdata->text_input_manager != NULL); - return (!haskeyboard && hastextmanager); + return !haskeyboard && hastextmanager; } #endif /* SDL_VIDEO_DRIVER_WAYLAND */ diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h index a56ccba6d841b..8fb7448c05d73 100644 --- a/src/video/wayland/SDL_waylandkeyboard.h +++ b/src/video/wayland/SDL_waylandkeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,7 +28,6 @@ typedef struct SDL_WaylandTextInput struct zwp_text_input_v3 *text_input; SDL_Rect cursor_rect; SDL_bool has_preedit; - SDL_bool is_enabled; } SDL_WaylandTextInput; extern int Wayland_InitKeyboard(_THIS); diff --git a/src/video/wayland/SDL_waylandmessagebox.c b/src/video/wayland/SDL_waylandmessagebox.c index fe66c61fdb147..1744dbda85835 100644 --- a/src/video/wayland/SDL_waylandmessagebox.c +++ b/src/video/wayland/SDL_waylandmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,173 +21,230 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "SDL.h" #include /* fgets */ #include /* FILE, STDOUT_FILENO, fdopen, fclose */ #include /* pid_t, pipe, fork, close, dup2, execvp, _exit */ #include /* waitpid, WIFEXITED, WEXITSTATUS */ -#include /* strerr */ +#include /* strerr */ #include #include "SDL_waylandmessagebox.h" -#define MAX_BUTTONS 8 /* Maximum number of buttons supported */ +#define ZENITY_VERSION_LEN 32 /* Number of bytes to read from zenity --version (including NUL)*/ -int -Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) -{ - int fd_pipe[2]; /* fd_pipe[0]: read end of pipe, fd_pipe[1]: write end of pipe */ +#define MAX_BUTTONS 8 /* Maximum number of buttons supported */ + +static int run_zenity(const char **args, int fd_pipe[2]) { + int status; pid_t pid1; + pid1 = fork(); + if (pid1 == 0) { /* child process */ + close(fd_pipe[0]); /* no reading from pipe */ + /* write stdout in pipe */ + if (dup2(fd_pipe[1], STDOUT_FILENO) == -1) { + _exit(128); + } + + /* const casting argv is fine: + * https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html -> rational + */ + execvp("zenity", (char **)args); + _exit(129); + } else if (pid1 < 0) { /* fork() failed */ + return SDL_SetError("fork() failed: %s", strerror(errno)); + } else { /* parent process */ + close(fd_pipe[1]); /* no writing to the pipe */ + if (waitpid(pid1, &status, 0) != pid1) { + return SDL_SetError("Waiting on zenity failed: %s", strerror(errno)); + } + + if (!WIFEXITED(status)) { + return SDL_SetError("zenity failed for some reason"); + } + + if (WEXITSTATUS(status) >= 128) { + return SDL_SetError("zenity reported error or failed to launch: %d", WEXITSTATUS(status)); + } + + return 0; /* success! */ + } +} + +static int get_zenity_version(int *major, int *minor) { + int fd_pipe[2]; /* fd_pipe[0]: read end of pipe, fd_pipe[1]: write end of pipe */ + const char *argv[] = { "zenity", "--version", NULL }; + + if (pipe(fd_pipe) != 0) { /* create a pipe */ + return SDL_SetError("pipe() failed: %s", strerror(errno)); + } + + if (run_zenity(argv, fd_pipe) == 0) { + FILE *outputfp = NULL; + char version_str[ZENITY_VERSION_LEN]; + char *version_ptr = NULL, *end_ptr = NULL; + int tmp; + + outputfp = fdopen(fd_pipe[0], "r"); + if (!outputfp) { + close(fd_pipe[0]); + return SDL_SetError("failed to open pipe for reading: %s", strerror(errno)); + } + + version_ptr = fgets(version_str, ZENITY_VERSION_LEN, outputfp); + (void)fclose(outputfp); /* will close underlying fd */ + + /* we expect the version string is in the form of MAJOR.MINOR.MICRO + * as described in meson.build. We'll ignore everything after that. + */ + tmp = (int) SDL_strtol(version_ptr, &end_ptr, 10); + if (tmp == 0 && end_ptr == version_ptr) { + return SDL_SetError("failed to get zenity major version number"); + } + *major = tmp; + + version_ptr = end_ptr + 1; /* skip the dot */ + tmp = (int) SDL_strtol(version_ptr, &end_ptr, 10); + if (tmp == 0 && end_ptr == version_ptr) { + return SDL_SetError("failed to get zenity minor version number"); + } + *minor = tmp; + + return 0; /* success */ + } + + close(fd_pipe[0]); + close(fd_pipe[1]); + return -1; /* run_zenity should've called SDL_SetError() */ +} + +int Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { + int fd_pipe[2]; /* fd_pipe[0]: read end of pipe, fd_pipe[1]: write end of pipe */ + int zenity_major = 0, zenity_minor = 0, output_len = 0; + int argc = 5, i; + const char *argv[5 + 2 /* icon name */ + 2 /* title */ + 2 /* message */ + 2 * MAX_BUTTONS + 1 /* NULL */] = { + "zenity", "--question", "--switch", "--no-wrap", "--no-markup" + }; + if (messageboxdata->numbuttons > MAX_BUTTONS) { return SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS); } + /* get zenity version so we know which arg to use */ + if (get_zenity_version(&zenity_major, &zenity_minor) != 0) { + return -1; /* get_zenity_version() calls SDL_SetError(), so message is already set */ + } + if (pipe(fd_pipe) != 0) { /* create a pipe */ return SDL_SetError("pipe() failed: %s", strerror(errno)); } - pid1 = fork(); - if (pid1 == 0) { /* child process */ - int argc = 5, i; - const char* argv[5 + 2/* icon name */ + 2/* title */ + 2/* message */ + 2*MAX_BUTTONS + 1/* NULL */] = { - "zenity", "--question", "--switch", "--no-wrap", "--no-markup" - }; + /* https://gitlab.gnome.org/GNOME/zenity/-/commit/c686bdb1b45e95acf010efd9ca0c75527fbb4dea + * This commit removed --icon-name without adding a deprecation notice. + * We need to handle it gracefully, otherwise no message box will be shown. + */ + argv[argc++] = zenity_major > 3 || (zenity_major == 3 && zenity_minor >= 90) ? "--icon" : "--icon-name"; + switch (messageboxdata->flags) { + case SDL_MESSAGEBOX_ERROR: + argv[argc++] = "dialog-error"; + break; + case SDL_MESSAGEBOX_WARNING: + argv[argc++] = "dialog-warning"; + break; + case SDL_MESSAGEBOX_INFORMATION: + default: + argv[argc++] = "dialog-information"; + break; + } - close(fd_pipe[0]); /* no reading from pipe */ - /* write stdout in pipe */ - if (dup2(fd_pipe[1], STDOUT_FILENO) == -1) { - _exit(128); + if (messageboxdata->title && messageboxdata->title[0]) { + argv[argc++] = "--title"; + argv[argc++] = messageboxdata->title; + } else { + argv[argc++] = "--title=\"\""; + } + + if (messageboxdata->message && messageboxdata->message[0]) { + argv[argc++] = "--text"; + argv[argc++] = messageboxdata->message; + } else { + argv[argc++] = "--text=\"\""; + } + + for (i = 0; i < messageboxdata->numbuttons; ++i) { + if (messageboxdata->buttons[i].text && messageboxdata->buttons[i].text[0]) { + int len = SDL_strlen(messageboxdata->buttons[i].text); + if (len > output_len) { + output_len = len; + } + + argv[argc++] = "--extra-button"; + argv[argc++] = messageboxdata->buttons[i].text; + } else { + argv[argc++] = "--extra-button=\"\""; } + } + argv[argc] = NULL; - argv[argc++] = "--icon-name"; - switch (messageboxdata->flags) { - case SDL_MESSAGEBOX_ERROR: - argv[argc++] = "dialog-error"; - break; - case SDL_MESSAGEBOX_WARNING: - argv[argc++] = "dialog-warning"; - break; - case SDL_MESSAGEBOX_INFORMATION: - default: - argv[argc++] = "dialog-information"; - break; + if (run_zenity(argv, fd_pipe) == 0) { + FILE *outputfp = NULL; + char *output = NULL; + char *tmp = NULL; + + if (!buttonid) { + /* if we don't need buttonid, we can return immediately */ + close(fd_pipe[0]); + return 0; /* success */ } + *buttonid = -1; - if (messageboxdata->title && messageboxdata->title[0]) { - argv[argc++] = "--title"; - argv[argc++] = messageboxdata->title; - } else { - argv[argc++] = "--title=\"\""; + output = SDL_malloc(output_len + 1); + if (!output) { + close(fd_pipe[0]); + return SDL_OutOfMemory(); } + output[0] = '\0'; - if (messageboxdata->message && messageboxdata->message[0]) { - argv[argc++] = "--text"; - argv[argc++] = messageboxdata->message; - } else { - argv[argc++] = "--text=\"\""; + outputfp = fdopen(fd_pipe[0], "r"); + if (!outputfp) { + SDL_free(output); + close(fd_pipe[0]); + return SDL_SetError("Couldn't open pipe for reading: %s", strerror(errno)); } + tmp = fgets(output, output_len + 1, outputfp); + (void)fclose(outputfp); - for (i = 0; i < messageboxdata->numbuttons; ++i) { - if (messageboxdata->buttons[i].text && messageboxdata->buttons[i].text[0]) { - argv[argc++] = "--extra-button"; - argv[argc++] = messageboxdata->buttons[i].text; - } else { - argv[argc++] = "--extra-button=\"\""; - } + if ((!tmp) || (*tmp == '\0') || (*tmp == '\n')) { + SDL_free(output); + return 0; /* User simply closed the dialog */ } - argv[argc] = NULL; - /* const casting argv is fine: - * https://pubs.opengroup.org/onlinepubs/9699919799/functions/fexecve.html -> rational - */ - execvp("zenity", (char **)argv); - _exit(129); - } else if (pid1 < 0) { - close(fd_pipe[0]); - close(fd_pipe[1]); - return SDL_SetError("fork() failed: %s", strerror(errno)); - } else { - int status; - if (waitpid(pid1, &status, 0) == pid1) { - if (WIFEXITED(status)) { - if (WEXITSTATUS(status) < 128) { - int i; - size_t output_len = 1; - char* output = NULL; - char* tmp = NULL; - FILE* outputfp = NULL; - - close(fd_pipe[1]); /* no writing to pipe */ - /* At this point, if no button ID is needed, we can just bail as soon as the - * process has completed. - */ - if (buttonid == NULL) { - close(fd_pipe[0]); - return 0; - } - *buttonid = -1; - - /* find button with longest text */ - for (i = 0; i < messageboxdata->numbuttons; ++i) { - if (messageboxdata->buttons[i].text != NULL) { - const size_t button_len = SDL_strlen(messageboxdata->buttons[i].text); - if (button_len > output_len) { - output_len = button_len; - } - } - } - output = SDL_malloc(output_len + 1); - if (!output) { - close(fd_pipe[0]); - return SDL_OutOfMemory(); - } - output[0] = '\0'; - - outputfp = fdopen(fd_pipe[0], "r"); - if (!outputfp) { - SDL_free(output); - close(fd_pipe[0]); - return SDL_SetError("Couldn't open pipe for reading: %s", strerror(errno)); - } - tmp = fgets(output, output_len + 1, outputfp); - fclose(outputfp); - - if ((tmp == NULL) || (*tmp == '\0') || (*tmp == '\n')) { - SDL_free(output); - return 0; /* User simply closed the dialog */ - } - - /* It likes to add a newline... */ - tmp = SDL_strrchr(output, '\n'); - if (tmp != NULL) { - *tmp = '\0'; - } - - /* Check which button got pressed */ - for (i = 0; i < messageboxdata->numbuttons; i += 1) { - if (messageboxdata->buttons[i].text != NULL) { - if (SDL_strcmp(output, messageboxdata->buttons[i].text) == 0) { - *buttonid = messageboxdata->buttons[i].buttonid; - break; - } - } - } - - SDL_free(output); - return 0; /* success! */ - } else { - return SDL_SetError("zenity reported error or failed to launch: %d", WEXITSTATUS(status)); + /* It likes to add a newline... */ + tmp = SDL_strrchr(output, '\n'); + if (tmp) { + *tmp = '\0'; + } + + /* Check which button got pressed */ + for (i = 0; i < messageboxdata->numbuttons; i += 1) { + if (messageboxdata->buttons[i].text) { + if (SDL_strcmp(output, messageboxdata->buttons[i].text) == 0) { + *buttonid = messageboxdata->buttons[i].buttonid; + break; } - } else { - return SDL_SetError("zenity failed for some reason"); } - } else { - return SDL_SetError("Waiting on zenity failed: %s", strerror(errno)); } + + SDL_free(output); + return 0; /* success! */ } + + close(fd_pipe[0]); + close(fd_pipe[1]); + return -1; /* run_zenity() calls SDL_SetError(), so message is already set */ } #endif /* SDL_VIDEO_DRIVER_WAYLAND */ diff --git a/src/video/wayland/SDL_waylandmessagebox.h b/src/video/wayland/SDL_waylandmessagebox.h index 7404520a797b7..87284d2c42ca4 100644 --- a/src/video/wayland/SDL_waylandmessagebox.h +++ b/src/video/wayland/SDL_waylandmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_waylandmessagebox_h_ #define SDL_waylandmessagebox_h_ -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND extern int Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index 20c5efca00ce7..89fb301d18abc 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,13 +21,11 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND -#include #include #include -#include -#include +#include #include "../SDL_sysvideo.h" @@ -39,33 +37,34 @@ #include "wayland-cursor.h" #include "SDL_waylandmouse.h" +#include "SDL_waylandshmbuffer.h" + +#include "cursor-shape-v1-client-protocol.h" #include "SDL_hints.h" #include "../../SDL_hints_c.h" -static int -Wayland_SetRelativeMouseMode(SDL_bool enabled); +static int Wayland_SetRelativeMouseMode(SDL_bool enabled); -typedef struct { - struct wl_buffer *buffer; - struct wl_surface *surface; +typedef struct +{ + struct Wayland_SHMBuffer shmBuffer; + struct wl_surface *surface; - int hot_x, hot_y; - int w, h; + int hot_x, hot_y; + int w, h; /* shm_data is non-NULL for custom cursors. * When shm_data is NULL, system_cursor must be valid */ - SDL_SystemCursor system_cursor; - void *shm_data; + SDL_SystemCursor system_cursor; } Wayland_CursorData; #ifdef SDL_USE_LIBDBUS #include "../../core/linux/SDL_dbus.h" -static DBusMessage* -wayland_read_dbus_setting(SDL_DBusContext *dbus, const char *key) +static DBusMessage *wayland_read_dbus_setting(SDL_DBusContext *dbus, const char *key) { static const char *iface = "org.gnome.desktop.interface"; @@ -73,7 +72,7 @@ wayland_read_dbus_setting(SDL_DBusContext *dbus, const char *key) DBusMessage *msg = dbus->message_new_method_call("org.freedesktop.portal.Desktop", /* Node */ "/org/freedesktop/portal/desktop", /* Path */ "org.freedesktop.portal.Settings", /* Interface */ - "Read"); /* Method */ + "Read"); /* Method */ if (msg) { if (dbus->message_append_args(msg, DBUS_TYPE_STRING, &iface, DBUS_TYPE_STRING, &key, DBUS_TYPE_INVALID)) { @@ -85,8 +84,7 @@ wayland_read_dbus_setting(SDL_DBusContext *dbus, const char *key) return reply; } -static SDL_bool -wayland_parse_dbus_reply(SDL_DBusContext *dbus, DBusMessage *reply, int type, void *value) +static SDL_bool wayland_parse_dbus_reply(SDL_DBusContext *dbus, DBusMessage *reply, int type, void *value) { DBusMessageIter iter[3]; @@ -110,8 +108,7 @@ wayland_parse_dbus_reply(SDL_DBusContext *dbus, DBusMessage *reply, int type, vo return SDL_TRUE; } -static SDL_bool -wayland_dbus_read_cursor_size(int *size) +static SDL_bool wayland_dbus_read_cursor_size(int *size) { static const char *cursor_size_value = "cursor-size"; @@ -133,8 +130,7 @@ wayland_dbus_read_cursor_size(int *size) return SDL_FALSE; } -static SDL_bool -wayland_dbus_read_cursor_theme(char **theme) +static SDL_bool wayland_dbus_read_cursor_theme(char **theme) { static const char *cursor_theme_value = "cursor-theme"; @@ -160,17 +156,40 @@ wayland_dbus_read_cursor_theme(char **theme) #endif -static SDL_bool -wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float *scale) + +static const char *GetLegacyCursorName(SDL_SystemCursor system_cursor) +{ + switch (system_cursor) { + case SDL_SYSTEM_CURSOR_ARROW: return "left_ptr"; + case SDL_SYSTEM_CURSOR_IBEAM: return "xterm"; + case SDL_SYSTEM_CURSOR_WAIT: return "watch"; + case SDL_SYSTEM_CURSOR_CROSSHAIR: return "tcross"; + case SDL_SYSTEM_CURSOR_WAITARROW: return "watch"; + case SDL_SYSTEM_CURSOR_SIZENWSE: return "top_left_corner"; + case SDL_SYSTEM_CURSOR_SIZENESW: return "top_right_corner"; + case SDL_SYSTEM_CURSOR_SIZEWE: return "sb_h_double_arrow"; + case SDL_SYSTEM_CURSOR_SIZENS: return "sb_v_double_arrow"; + case SDL_SYSTEM_CURSOR_SIZEALL: return "fleur"; + case SDL_SYSTEM_CURSOR_NO: return "pirate"; + case SDL_SYSTEM_CURSOR_HAND: return "hand2"; + case SDL_NUM_SYSTEM_CURSORS: break; /* so the compiler might notice if an enum value is missing here. */ + } + + SDL_assert(0); + return NULL; +} + +static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float *scale) { struct wl_cursor_theme *theme = NULL; struct wl_cursor *cursor; + const char *cssname = NULL; + const char *fallback_name = NULL; char *xcursor_size; int size = 0; SDL_Window *focus; - SDL_WindowData *focusdata; int i; /* @@ -184,7 +203,7 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float if ((xcursor_size = SDL_getenv("XCURSOR_SIZE"))) { size = SDL_atoi(xcursor_size); } -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS if (size <= 0) { wayland_dbus_read_cursor_size(&size); } @@ -194,34 +213,35 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float } /* First, find the appropriate theme based on the current scale... */ focus = SDL_GetMouse()->focus; - if (focus == NULL) { - /* Nothing to see here, bail. */ - return SDL_FALSE; + if (focus) { + SDL_WindowData *focusdata = (SDL_WindowData*)focus->driverdata; + + /* Cursors use integer scaling. */ + *scale = SDL_ceilf(focusdata->scale_factor); + } else { + *scale = 1.0f; } - focusdata = focus->driverdata; - /* Cursors use integer scaling. */ - *scale = SDL_ceilf(focusdata->scale_factor); - size *= *scale; - for (i = 0; i < vdata->num_cursor_themes; i += 1) { + size *= (int)*scale; + for (i = 0; i < vdata->num_cursor_themes; ++i) { if (vdata->cursor_themes[i].size == size) { theme = vdata->cursor_themes[i].theme; break; } } - if (theme == NULL) { + if (!theme) { char *xcursor_theme = NULL; SDL_bool free_theme_str = SDL_FALSE; vdata->cursor_themes = SDL_realloc(vdata->cursor_themes, sizeof(SDL_WaylandCursorTheme) * (vdata->num_cursor_themes + 1)); - if (vdata->cursor_themes == NULL) { + if (!vdata->cursor_themes) { SDL_OutOfMemory(); return SDL_FALSE; } xcursor_theme = SDL_getenv("XCURSOR_THEME"); -#if SDL_USE_LIBDBUS - if (xcursor_theme == NULL) { +#ifdef SDL_USE_LIBDBUS + if (!xcursor_theme) { /* Allocates the string with SDL_strdup, which must be freed. */ free_theme_str = wayland_dbus_read_cursor_theme(&xcursor_theme); } @@ -236,51 +256,32 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float } /* Next, find the cursor from the theme... */ - switch(cdata->system_cursor) - { - case SDL_SYSTEM_CURSOR_ARROW: + cssname = SDL_GetCSSCursorName(cdata->system_cursor, &fallback_name); + + cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, cssname); + if (!cursor && fallback_name) { + cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, fallback_name); + } + + /* try the legacy name if the fancy new CSS name doesn't work... */ + if (!cursor) { + cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, GetLegacyCursorName(cdata->system_cursor)); + } + + /* Fallback to the default cursor if the chosen one wasn't found */ + if (!cursor) { + cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "default"); + } + /* Try the old X11 name as a last resort */ + if (!cursor) { cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "left_ptr"); - break; - case SDL_SYSTEM_CURSOR_IBEAM: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "xterm"); - break; - case SDL_SYSTEM_CURSOR_WAIT: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "watch"); - break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "tcross"); - break; - case SDL_SYSTEM_CURSOR_WAITARROW: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "watch"); - break; - case SDL_SYSTEM_CURSOR_SIZENWSE: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "top_left_corner"); - break; - case SDL_SYSTEM_CURSOR_SIZENESW: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "top_right_corner"); - break; - case SDL_SYSTEM_CURSOR_SIZEWE: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "sb_h_double_arrow"); - break; - case SDL_SYSTEM_CURSOR_SIZENS: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "sb_v_double_arrow"); - break; - case SDL_SYSTEM_CURSOR_SIZEALL: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "fleur"); - break; - case SDL_SYSTEM_CURSOR_NO: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "pirate"); - break; - case SDL_SYSTEM_CURSOR_HAND: - cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, "hand2"); - break; - default: - SDL_assert(0); + } + if (!cursor) { return SDL_FALSE; } /* ... Set the cursor data, finally. */ - cdata->buffer = WAYLAND_wl_cursor_image_get_buffer(cursor->images[0]); + cdata->shmBuffer.wl_buffer = WAYLAND_wl_cursor_image_get_buffer(cursor->images[0]); cdata->hot_x = cursor->images[0]->hotspot_x; cdata->hot_y = cursor->images[0]->hotspot_y; cdata->w = cursor->images[0]->width; @@ -288,127 +289,35 @@ wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorData *cdata, float return SDL_TRUE; } -static int -wayland_create_tmp_file(off_t size) -{ - static const char template[] = "/sdl-shared-XXXXXX"; - char *xdg_path; - char tmp_path[PATH_MAX]; - int fd; - - xdg_path = SDL_getenv("XDG_RUNTIME_DIR"); - if (!xdg_path) { - return -1; - } - - SDL_strlcpy(tmp_path, xdg_path, PATH_MAX); - SDL_strlcat(tmp_path, template, PATH_MAX); - - fd = mkostemp(tmp_path, O_CLOEXEC); - if (fd < 0) - return -1; - - if (ftruncate(fd, size) < 0) { - close(fd); - return -1; - } - - return fd; -} - -static void -mouse_buffer_release(void *data, struct wl_buffer *buffer) -{ -} - -static const struct wl_buffer_listener mouse_buffer_listener = { - mouse_buffer_release -}; - -static int -create_buffer_from_shm(Wayland_CursorData *d, - int width, - int height, - uint32_t format) -{ - SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *data = (SDL_VideoData *) vd->driverdata; - struct wl_shm_pool *shm_pool; - - int stride = width * 4; - int size = stride * height; - - int shm_fd; - - shm_fd = wayland_create_tmp_file(size); - if (shm_fd < 0) - { - return SDL_SetError("Creating mouse cursor buffer failed."); - } - - d->shm_data = mmap(NULL, - size, - PROT_READ | PROT_WRITE, - MAP_SHARED, - shm_fd, - 0); - if (d->shm_data == MAP_FAILED) { - d->shm_data = NULL; - close (shm_fd); - return SDL_SetError("mmap() failed."); - } - - SDL_assert(d->shm_data != NULL); - - shm_pool = wl_shm_create_pool(data->shm, shm_fd, size); - d->buffer = wl_shm_pool_create_buffer(shm_pool, - 0, - width, - height, - stride, - format); - wl_buffer_add_listener(d->buffer, - &mouse_buffer_listener, - d); - - wl_shm_pool_destroy (shm_pool); - close (shm_fd); - - return 0; -} - -static SDL_Cursor * -Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) +static SDL_Cursor *Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { SDL_Cursor *cursor; - cursor = SDL_calloc(1, sizeof (*cursor)); + cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - SDL_VideoDevice *vd = SDL_GetVideoDevice (); - SDL_VideoData *wd = (SDL_VideoData *) vd->driverdata; - Wayland_CursorData *data = SDL_calloc (1, sizeof (Wayland_CursorData)); + SDL_VideoDevice *vd = SDL_GetVideoDevice(); + SDL_VideoData *wd = (SDL_VideoData *)vd->driverdata; + Wayland_CursorData *data = SDL_calloc(1, sizeof(Wayland_CursorData)); if (!data) { SDL_OutOfMemory(); SDL_free(cursor); return NULL; } - cursor->driverdata = (void *) data; + cursor->driverdata = (void *)data; /* Allocate shared memory buffer for this cursor */ - if (create_buffer_from_shm (data, - surface->w, - surface->h, - WL_SHM_FORMAT_ARGB8888) < 0) - { - SDL_free (cursor->driverdata); - SDL_free (cursor); + if (Wayland_AllocSHMBuffer(surface->w, + surface->h, + &data->shmBuffer) < 0) { + SDL_free(cursor->driverdata); + SDL_free(cursor); return NULL; } /* Wayland requires premultiplied alpha for its surfaces. */ SDL_PremultiplyAlpha(surface->w, surface->h, surface->format->format, surface->pixels, surface->pitch, - SDL_PIXELFORMAT_ARGB8888, data->shm_data, surface->w * 4); + SDL_PIXELFORMAT_ARGB8888, data->shmBuffer.shm_data, surface->w * 4); data->surface = wl_compositor_create_surface(wd->compositor); wl_surface_set_user_data(data->surface, NULL); @@ -424,24 +333,25 @@ Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) return cursor; } -static SDL_Cursor * -Wayland_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *Wayland_CreateSystemCursor(SDL_SystemCursor id) { SDL_VideoData *data = SDL_GetVideoDevice()->driverdata; SDL_Cursor *cursor; - cursor = SDL_calloc(1, sizeof (*cursor)); + cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - Wayland_CursorData *cdata = SDL_calloc (1, sizeof (Wayland_CursorData)); + Wayland_CursorData *cdata = SDL_calloc(1, sizeof(Wayland_CursorData)); if (!cdata) { SDL_OutOfMemory(); SDL_free(cursor); return NULL; } - cursor->driverdata = (void *) cdata; + cursor->driverdata = (void *)cdata; - cdata->surface = wl_compositor_create_surface(data->compositor); - wl_surface_set_user_data(cdata->surface, NULL); + if (!data->cursor_shape_manager) { + cdata->surface = wl_compositor_create_surface(data->compositor); + wl_surface_set_user_data(cdata->surface, NULL); + } /* Note that we can't actually set any other cursor properties, as this * is output-specific. See wayland_get_system_cursor for the rest! @@ -454,20 +364,17 @@ Wayland_CreateSystemCursor(SDL_SystemCursor id) return cursor; } -static SDL_Cursor * -Wayland_CreateDefaultCursor() +static SDL_Cursor *Wayland_CreateDefaultCursor() { return Wayland_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW); } -static void -Wayland_FreeCursorData(Wayland_CursorData *d) +static void Wayland_FreeCursorData(Wayland_CursorData *d) { - if (d->buffer) { - if (d->shm_data) { - wl_buffer_destroy(d->buffer); - } - d->buffer = NULL; + if (d->shmBuffer.shm_data) { + Wayland_ReleaseSHMBuffer(&d->shmBuffer); + } else { + d->shmBuffer.wl_buffer = NULL; } if (d->surface) { @@ -476,8 +383,7 @@ Wayland_FreeCursorData(Wayland_CursorData *d) } } -static void -Wayland_FreeCursor(SDL_Cursor *cursor) +static void Wayland_FreeCursor(SDL_Cursor *cursor) { if (!cursor) { return; @@ -488,15 +394,62 @@ Wayland_FreeCursor(SDL_Cursor *cursor) return; } - Wayland_FreeCursorData((Wayland_CursorData *) cursor->driverdata); + Wayland_FreeCursorData((Wayland_CursorData *)cursor->driverdata); - /* Not sure what's meant to happen to shm_data */ SDL_free(cursor->driverdata); SDL_free(cursor); } -static int -Wayland_ShowCursor(SDL_Cursor *cursor) +static void Wayland_SetSystemCursorShape(struct SDL_WaylandInput *input, SDL_SystemCursor id) +{ + Uint32 shape; + + switch (id) { + case SDL_SYSTEM_CURSOR_ARROW: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT; + break; + case SDL_SYSTEM_CURSOR_IBEAM: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT; + break; + case SDL_SYSTEM_CURSOR_WAIT: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT; + break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR; + break; + case SDL_SYSTEM_CURSOR_WAITARROW: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS; + break; + case SDL_SYSTEM_CURSOR_SIZENWSE: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE; + break; + case SDL_SYSTEM_CURSOR_SIZENESW: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE; + break; + case SDL_SYSTEM_CURSOR_SIZEWE: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE; + break; + case SDL_SYSTEM_CURSOR_SIZENS: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE; + break; + case SDL_SYSTEM_CURSOR_SIZEALL: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL; + break; + case SDL_SYSTEM_CURSOR_NO: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED; + break; + case SDL_SYSTEM_CURSOR_HAND: + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER; + break; + default: + SDL_assert(0); /* Should never be here... */ + shape = WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT; + } + + wp_cursor_shape_device_v1_set_shape(input->cursor_shape, input->pointer_enter_serial, shape); +} + +static int Wayland_ShowCursor(SDL_Cursor *cursor) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); SDL_VideoData *d = vd->driverdata; @@ -504,16 +457,27 @@ Wayland_ShowCursor(SDL_Cursor *cursor) struct wl_pointer *pointer = d->pointer; float scale = 1.0f; - if (!pointer) + if (!pointer) { return -1; + } - if (cursor) - { + if (cursor) { Wayland_CursorData *data = cursor->driverdata; /* TODO: High-DPI custom cursors? -flibit */ - if (data->shm_data == NULL) { - if (!wayland_get_system_cursor(d, data, &scale)) { + if (!data->shmBuffer.shm_data) { + if (input->cursor_shape) { + Wayland_SetSystemCursorShape(input, data->system_cursor); + + input->cursor_visible = SDL_TRUE; + + if (input->relative_mode_override) { + Wayland_input_unlock_pointer(input); + input->relative_mode_override = SDL_FALSE; + } + + return 0; + } else if (!wayland_get_system_cursor(d, data, &scale)) { return -1; } } @@ -524,7 +488,7 @@ Wayland_ShowCursor(SDL_Cursor *cursor) data->surface, data->hot_x / scale, data->hot_y / scale); - wl_surface_attach(data->surface, data->buffer, 0, 0); + wl_surface_attach(data->surface, data->shmBuffer.wl_buffer, 0, 0); wl_surface_damage(data->surface, 0, 0, data->w, data->h); wl_surface_commit(data->surface); @@ -534,19 +498,16 @@ Wayland_ShowCursor(SDL_Cursor *cursor) Wayland_input_unlock_pointer(input); input->relative_mode_override = SDL_FALSE; } - - } - else - { + + } else { input->cursor_visible = SDL_FALSE; wl_pointer_set_cursor(pointer, input->pointer_enter_serial, NULL, 0, 0); } - + return 0; } -static void -Wayland_WarpMouse(SDL_Window *window, int x, int y) +static void Wayland_WarpMouse(SDL_Window *window, int x, int y) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); SDL_VideoData *d = vd->driverdata; @@ -561,26 +522,28 @@ Wayland_WarpMouse(SDL_Window *window, int x, int y) Wayland_input_lock_pointer(input); input->relative_mode_override = SDL_TRUE; } + SDL_SendMouseMotion(window, 0, 0, x, y); } } -static int -Wayland_WarpMouseGlobal(int x, int y) +static int Wayland_WarpMouseGlobal(int x, int y) { return SDL_Unsupported(); } -static int -Wayland_SetRelativeMouseMode(SDL_bool enabled) +static int Wayland_SetRelativeMouseMode(SDL_bool enabled) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *data = (SDL_VideoData *) vd->driverdata; - + SDL_VideoData *data = (SDL_VideoData *)vd->driverdata; if (enabled) { + /* Clients use relative warp mode to get accelerated motion deltas, which Wayland delivers internally. */ + data->relative_mode_accelerated = SDL_GetHintBoolean(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, SDL_FALSE); + /* Disable mouse warp emulation if it's enabled. */ - if (data->input->relative_mode_override) + if (data->input->relative_mode_override) { data->input->relative_mode_override = SDL_FALSE; + } /* If the app has used relative mode before, it probably shouldn't * also be emulating it using repeated mouse warps, so disable @@ -593,17 +556,15 @@ Wayland_SetRelativeMouseMode(SDL_bool enabled) } } -static void SDLCALL -Wayland_EmulateMouseWarpChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL Wayland_EmulateMouseWarpChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { struct SDL_WaylandInput *input = (struct SDL_WaylandInput *)userdata; input->warp_emulation_prohibited = !SDL_GetStringBoolean(hint, !input->warp_emulation_prohibited); } -#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ -static void -Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) +#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ +static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) { Wayland_CursorData *cdata = (Wayland_CursorData *) cursor->driverdata; @@ -627,8 +588,7 @@ Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) wl_surface_set_user_data(cdata->surface, NULL); } -void -Wayland_RecreateCursors(void) +void Wayland_RecreateCursors(void) { SDL_Cursor *cursor; SDL_Mouse *mouse = SDL_GetMouse(); @@ -659,8 +619,7 @@ Wayland_RecreateCursors(void) } #endif /* 0 */ -void -Wayland_InitMouse(void) +void Wayland_InitMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_VideoDevice *vd = SDL_GetVideoDevice(); @@ -680,12 +639,11 @@ Wayland_InitMouse(void) SDL_SetDefaultCursor(Wayland_CreateDefaultCursor()); - SDL_AddHintCallback(SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP, + SDL_AddHintCallback(SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP, Wayland_EmulateMouseWarpChanged, input); } -void -Wayland_FiniMouse(SDL_VideoData *data) +void Wayland_FiniMouse(SDL_VideoData *data) { struct SDL_WaylandInput *input = data->input; int i; @@ -696,10 +654,10 @@ Wayland_FiniMouse(SDL_VideoData *data) SDL_free(data->cursor_themes); data->cursor_themes = NULL; - SDL_DelHintCallback(SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP, + SDL_DelHintCallback(SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP, Wayland_EmulateMouseWarpChanged, input); } -#endif /* SDL_VIDEO_DRIVER_WAYLAND */ +#endif /* SDL_VIDEO_DRIVER_WAYLAND */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/wayland/SDL_waylandmouse.h b/src/video/wayland/SDL_waylandmouse.h index 00a56af43517e..e5c95a4871b4e 100644 --- a/src/video/wayland/SDL_waylandmouse.h +++ b/src/video/wayland/SDL_waylandmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,11 +23,11 @@ #include "SDL_mouse.h" #include "SDL_waylandvideo.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND extern void Wayland_InitMouse(void); extern void Wayland_FiniMouse(SDL_VideoData *data); -#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ +#if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ extern void Wayland_RecreateCursors(void); #endif /* 0 */ diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c index a0af3f5a4b880..f271ac7ce5be9 100644 --- a/src/video/wayland/SDL_waylandopengles.c +++ b/src/video/wayland/SDL_waylandopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_WAYLAND) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_timer.h" #include "../../core/unix/SDL_poll.h" @@ -35,10 +35,10 @@ /* EGL implementation of SDL OpenGL ES support */ -int -Wayland_GLES_LoadLibrary(_THIS, const char *path) { +int Wayland_GLES_LoadLibrary(_THIS, const char *path) +{ int ret; - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, 0); @@ -48,13 +48,11 @@ Wayland_GLES_LoadLibrary(_THIS, const char *path) { return ret; } - -SDL_GLContext -Wayland_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window) { SDL_GLContext context; - context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *) window->driverdata)->egl_surface); - WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display ); + context = SDL_EGL_CreateContext(_this, ((SDL_WindowData *)window->driverdata)->egl_surface); + WAYLAND_wl_display_flush(((SDL_VideoData *)_this->driverdata)->display); return context; } @@ -73,13 +71,12 @@ Wayland_GLES_CreateContext(_THIS, SDL_Window * window) libretro, Wayland, probably others...it feels like we're eventually going to have to give in with a future SDL API revision, since we can bend the other APIs to this style, but this style is much harder to bend the other way. :/ */ -int -Wayland_GLES_SetSwapInterval(_THIS, int interval) +int Wayland_GLES_SetSwapInterval(_THIS, int interval) { if (!_this->egl_data) { return SDL_SetError("EGL not initialized"); } - + /* technically, this is _all_ adaptive vsync (-1), because we can't actually wait for the _next_ vsync if you set 1, but things that request 1 probably won't care _that_ much. I hope. No matter what @@ -96,8 +93,7 @@ Wayland_GLES_SetSwapInterval(_THIS, int interval) return 0; } -int -Wayland_GLES_GetSwapInterval(_THIS) +int Wayland_GLES_GetSwapInterval(_THIS) { if (!_this->egl_data) { SDL_SetError("EGL not initialized"); @@ -107,10 +103,9 @@ Wayland_GLES_GetSwapInterval(_THIS) return _this->egl_data->egl_swapinterval; } -int -Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) +int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; const int swap_interval = _this->egl_data->egl_swapinterval; /* For windows that we know are hidden, skip swaps entirely, if we don't do @@ -125,14 +120,27 @@ Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) return 0; } + /* By default, we wait for Wayland frame callback and then issue pageflip (eglSwapBuffers), + * but if we want low latency (double buffer scheme), we issue the pageflip + * and then wait immediately for Wayland frame callback. + */ + + if (data->double_buffer) { + /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ + if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { + return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); + } + + WAYLAND_wl_display_flush(data->waylandData->display); + } + /* Control swap interval ourselves. See comments on Wayland_GLES_SetSwapInterval */ if (swap_interval != 0) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; struct wl_display *display = videodata->display; SDL_VideoDisplay *sdldisplay = SDL_GetDisplayForWindow(window); - /* ~10 frames (or 1 sec), so we'll progress even if throttled to zero. */ - const Uint32 max_wait = SDL_GetTicks() + (sdldisplay->current_mode.refresh_rate ? - (10000 / sdldisplay->current_mode.refresh_rate) : 1000); + /* 1/3 speed (or 20hz), so we'll progress even if throttled to zero. */ + const Uint32 max_wait = SDL_GetTicks() + (sdldisplay && sdldisplay->current_mode.refresh_rate ? (3000 / sdldisplay->current_mode.refresh_rate) : 50); while (SDL_AtomicGet(&data->swap_interval_ready) == 0) { Uint32 now; @@ -168,40 +176,39 @@ Wayland_GLES_SwapWindow(_THIS, SDL_Window *window) SDL_AtomicSet(&data->swap_interval_ready, 0); } - /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ - if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { - return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); - } + if (!data->double_buffer) { + /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ + if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { + return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); + } - WAYLAND_wl_display_flush( data->waylandData->display ); + WAYLAND_wl_display_flush(data->waylandData->display); + } return 0; } -int -Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { int ret; if (window && context) { - ret = SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *) window->driverdata)->egl_surface, context); - } - else { + ret = SDL_EGL_MakeCurrent(_this, ((SDL_WindowData *)window->driverdata)->egl_surface, context); + } else { ret = SDL_EGL_MakeCurrent(_this, NULL, NULL); } - WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display ); + WAYLAND_wl_display_flush(((SDL_VideoData *)_this->driverdata)->display); - _this->egl_data->eglSwapInterval(_this->egl_data->egl_display, 0); /* see comments on Wayland_GLES_SetSwapInterval. */ + _this->egl_data->eglSwapInterval(_this->egl_data->egl_display, 0); /* see comments on Wayland_GLES_SetSwapInterval. */ return ret; } -void -Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context) +void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context) { SDL_EGL_DeleteContext(_this, context); - WAYLAND_wl_display_flush( ((SDL_VideoData*)_this->driverdata)->display ); + WAYLAND_wl_display_flush(((SDL_VideoData *)_this->driverdata)->display); } #endif /* SDL_VIDEO_DRIVER_WAYLAND && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/wayland/SDL_waylandopengles.h b/src/video/wayland/SDL_waylandopengles.h index b9500b9f1aa7b..580591850c94f 100644 --- a/src/video/wayland/SDL_waylandopengles.h +++ b/src/video/wayland/SDL_waylandopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ typedef struct SDL_PrivateGLESData #define Wayland_GLES_UnloadLibrary SDL_EGL_UnloadLibrary extern int Wayland_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window * window); +extern SDL_GLContext Wayland_GLES_CreateContext(_THIS, SDL_Window *window); extern int Wayland_GLES_SetSwapInterval(_THIS, int interval); extern int Wayland_GLES_GetSwapInterval(_THIS); -extern int Wayland_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int Wayland_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int Wayland_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void Wayland_GLES_DeleteContext(_THIS, SDL_GLContext context); #endif /* SDL_waylandopengles_h_ */ diff --git a/src/video/wayland/SDL_waylandshmbuffer.c b/src/video/wayland/SDL_waylandshmbuffer.c new file mode 100644 index 0000000000000..a64c7c3501a37 --- /dev/null +++ b/src/video/wayland/SDL_waylandshmbuffer.c @@ -0,0 +1,172 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../../SDL_internal.h" + +#ifdef SDL_VIDEO_DRIVER_WAYLAND + +#include +#include +#include +#include +#include +#include + +#include "SDL_waylandshmbuffer.h" +#include "SDL_waylandvideo.h" + +static int SetTempFileSize(int fd, off_t size) +{ +#ifdef HAVE_POSIX_FALLOCATE + sigset_t set, old_set; + int ret; + + /* SIGALRM can potentially block a large posix_fallocate() operation + * from succeeding, so block it. + */ + sigemptyset(&set); + sigaddset(&set, SIGALRM); + sigprocmask(SIG_BLOCK, &set, &old_set); + + do { + ret = posix_fallocate(fd, 0, size); + } while (ret == EINTR); + + sigprocmask(SIG_SETMASK, &old_set, NULL); + + if (ret == 0) { + return 0; + } else if (ret != EINVAL && errno != EOPNOTSUPP) { + return -1; + } +#endif + + if (ftruncate(fd, size) < 0) { + return -1; + } + return 0; +} + +static int CreateTempFD(off_t size) +{ + int fd; + +#ifdef HAVE_MEMFD_CREATE + fd = memfd_create("SDL", MFD_CLOEXEC | MFD_ALLOW_SEALING); + if (fd >= 0) { + fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL); + } else +#endif + { + static const char template[] = "/sdl-shared-XXXXXX"; + char *xdg_path; + char tmp_path[PATH_MAX]; + + xdg_path = SDL_getenv("XDG_RUNTIME_DIR"); + if (!xdg_path) { + return -1; + } + + SDL_strlcpy(tmp_path, xdg_path, PATH_MAX); + SDL_strlcat(tmp_path, template, PATH_MAX); + + fd = mkostemp(tmp_path, O_CLOEXEC); + if (fd < 0) { + return -1; + } + + /* Need to manually unlink the temp files, or they can persist after close and fill up the temp storage. */ + unlink(tmp_path); + } + + if (SetTempFileSize(fd, size) < 0) { + close(fd); + return -1; + } + + return fd; +} + +static void buffer_handle_release(void *data, struct wl_buffer *wl_buffer) +{ + /* NOP */ +} + +static struct wl_buffer_listener buffer_listener = { + buffer_handle_release +}; + +int Wayland_AllocSHMBuffer(int width, int height, struct Wayland_SHMBuffer *shmBuffer) +{ + SDL_VideoDevice *vd = SDL_GetVideoDevice(); + SDL_VideoData *data = vd->driverdata; + struct wl_shm_pool *shm_pool; + int shm_fd; + int stride; + const Uint32 SHM_FMT = WL_SHM_FORMAT_ARGB8888; + + if (!shmBuffer) { + return SDL_InvalidParamError("shmBuffer"); + } + + stride = width * 4; + shmBuffer->shm_data_size = stride * height; + + shm_fd = CreateTempFD(shmBuffer->shm_data_size); + if (shm_fd < 0) { + return SDL_SetError("Creating SHM buffer failed."); + } + + shmBuffer->shm_data = mmap(NULL, shmBuffer->shm_data_size, PROT_READ | PROT_WRITE, MAP_SHARED, shm_fd, 0); + if (shmBuffer->shm_data == MAP_FAILED) { + shmBuffer->shm_data = NULL; + close(shm_fd); + return SDL_SetError("mmap() failed."); + } + + SDL_assert(shmBuffer->shm_data != NULL); + + shm_pool = wl_shm_create_pool(data->shm, shm_fd, shmBuffer->shm_data_size); + shmBuffer->wl_buffer = wl_shm_pool_create_buffer(shm_pool, 0, width, height, stride, SHM_FMT); + wl_buffer_add_listener(shmBuffer->wl_buffer, &buffer_listener, shmBuffer); + + wl_shm_pool_destroy(shm_pool); + close(shm_fd); + + return 0; +} + +void Wayland_ReleaseSHMBuffer(struct Wayland_SHMBuffer *shmBuffer) +{ + if (shmBuffer) { + if (shmBuffer->wl_buffer) { + wl_buffer_destroy(shmBuffer->wl_buffer); + shmBuffer->wl_buffer = NULL; + } + if (shmBuffer->shm_data) { + munmap(shmBuffer->shm_data, shmBuffer->shm_data_size); + shmBuffer->shm_data = NULL; + } + shmBuffer->shm_data_size = 0; + } +} + +#endif \ No newline at end of file diff --git a/src/video/wayland/SDL_waylandshmbuffer.h b/src/video/wayland/SDL_waylandshmbuffer.h new file mode 100644 index 0000000000000..fb6649a08dfa6 --- /dev/null +++ b/src/video/wayland/SDL_waylandshmbuffer.h @@ -0,0 +1,34 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2025 Sam Lantinga + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "../../SDL_internal.h" + +#ifndef SDL_waylandshmbuffer_h_ +#define SDL_waylandshmbuffer_h_ + +struct Wayland_SHMBuffer +{ + struct wl_buffer *wl_buffer; + void *shm_data; + int shm_data_size; +}; + +/* Allocates an SHM buffer with the format WL_SHM_FORMAT_ARGB8888 */ +extern int Wayland_AllocSHMBuffer(int width, int height, struct Wayland_SHMBuffer *shmBuffer); +extern void Wayland_ReleaseSHMBuffer(struct Wayland_SHMBuffer *shmBuffer); + +#endif \ No newline at end of file diff --git a/src/video/wayland/SDL_waylandsym.h b/src/video/wayland/SDL_waylandsym.h index 8b31d8cac67ba..13fc0d8a7f3d4 100644 --- a/src/video/wayland/SDL_waylandsym.h +++ b/src/video/wayland/SDL_waylandsym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,6 +29,10 @@ #define SDL_WAYLAND_SYM(rc,fn,params) #endif +#ifndef SDL_WAYLAND_SYM_OPT +#define SDL_WAYLAND_SYM_OPT(rc,fn,params) +#endif + #ifndef SDL_WAYLAND_INTERFACE #define SDL_WAYLAND_INTERFACE(iface) #endif @@ -142,6 +146,7 @@ SDL_WAYLAND_SYM(struct xkb_compose_table *, xkb_compose_table_new_from_locale, ( const char *locale, enum xkb_compose_compile_flags) ) SDL_WAYLAND_SYM(void, xkb_compose_table_unref, (struct xkb_compose_table *) ) SDL_WAYLAND_SYM(struct xkb_compose_state *, xkb_compose_state_new, (struct xkb_compose_table *, enum xkb_compose_state_flags) ) +SDL_WAYLAND_SYM(void, xkb_compose_state_reset, (struct xkb_compose_state *) ) SDL_WAYLAND_SYM(void, xkb_compose_state_unref, (struct xkb_compose_state *) ) SDL_WAYLAND_SYM(enum xkb_compose_feed_result, xkb_compose_state_feed, (struct xkb_compose_state *, xkb_keysym_t) ) SDL_WAYLAND_SYM(enum xkb_compose_status, xkb_compose_state_get_status, (struct xkb_compose_state *) ) @@ -211,11 +216,23 @@ SDL_WAYLAND_SYM(bool, libdecor_configuration_get_content_size, (struct libdecor_ int *)) SDL_WAYLAND_SYM(bool, libdecor_configuration_get_window_state, (struct libdecor_configuration *,\ enum libdecor_window_state *)) -SDL_WAYLAND_SYM(bool, libdecor_dispatch, (struct libdecor *, int)) +SDL_WAYLAND_SYM(int, libdecor_dispatch, (struct libdecor *, int)) + +#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) || defined(SDL_HAVE_LIBDECOR_GET_MIN_MAX) +/* Only found in libdecor 0.1.1 or higher, so failure to load them is not fatal. */ +SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_min_content_size, (const struct libdecor_frame *,\ + int *,\ + int *)) +SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_max_content_size, (const struct libdecor_frame *,\ + int *,\ + int *)) +#endif + #endif #undef SDL_WAYLAND_MODULE #undef SDL_WAYLAND_SYM +#undef SDL_WAYLAND_SYM_OPT #undef SDL_WAYLAND_INTERFACE /* *INDENT-ON* */ /* clang-format on */ diff --git a/src/video/wayland/SDL_waylandtouch.c b/src/video/wayland/SDL_waylandtouch.c index b3879f176484f..73a431a855ece 100644 --- a/src/video/wayland/SDL_waylandtouch.c +++ b/src/video/wayland/SDL_waylandtouch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,42 +30,42 @@ #include "SDL_waylandtouch.h" #include "../../events/SDL_touch_c.h" -struct SDL_WaylandTouch { +struct SDL_WaylandTouch +{ struct qt_touch_extension *touch_extension; }; - /** * Qt TouchPointState * adapted from qtbase/src/corelib/global/qnamespace.h **/ -enum QtWaylandTouchPointState { - QtWaylandTouchPointPressed = 0x01, - QtWaylandTouchPointMoved = 0x02, +enum QtWaylandTouchPointState +{ + QtWaylandTouchPointPressed = 0x01, + QtWaylandTouchPointMoved = 0x02, /* Never sent by the server: QtWaylandTouchPointStationary = 0x04, */ - QtWaylandTouchPointReleased = 0x08, + QtWaylandTouchPointReleased = 0x08, }; -static void -touch_handle_touch(void *data, - struct qt_touch_extension *qt_touch_extension, - uint32_t time, - uint32_t id, - uint32_t state, - int32_t x, - int32_t y, - int32_t normalized_x, - int32_t normalized_y, - int32_t width, - int32_t height, - uint32_t pressure, - int32_t velocity_x, - int32_t velocity_y, - uint32_t flags, - struct wl_array *rawdata) +static void touch_handle_touch(void *data, + struct qt_touch_extension *qt_touch_extension, + uint32_t time, + uint32_t id, + uint32_t state, + int32_t x, + int32_t y, + int32_t normalized_x, + int32_t normalized_y, + int32_t width, + int32_t height, + uint32_t pressure, + int32_t velocity_x, + int32_t velocity_y, + uint32_t flags, + struct wl_array *rawdata) { /** * Event is assembled in QtWayland in TouchExtensionGlobal::postTouchEvent @@ -89,44 +89,42 @@ touch_handle_touch(void *data, uint32_t capabilities = flags >> 16; */ - SDL_Window* window = NULL; + SDL_Window *window = NULL; SDL_TouchID deviceId = 1; if (SDL_AddTouch(deviceId, SDL_TOUCH_DEVICE_DIRECT, "qt_touch_extension") < 0) { - SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); + SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__); } /* FIXME: This should be the window the given wayland surface is associated * with, but how do we get the wayland surface? */ window = SDL_GetMouseFocus(); - if (window == NULL) { + if (!window) { window = SDL_GetKeyboardFocus(); } switch (touchState) { - case QtWaylandTouchPointPressed: - case QtWaylandTouchPointReleased: - SDL_SendTouch(deviceId, (SDL_FingerID)id, window, - (touchState == QtWaylandTouchPointPressed) ? SDL_TRUE : SDL_FALSE, - xf, yf, pressuref); - break; - case QtWaylandTouchPointMoved: - SDL_SendTouchMotion(deviceId, (SDL_FingerID)id, window, xf, yf, pressuref); - break; - default: - /* Should not happen */ - break; + case QtWaylandTouchPointPressed: + case QtWaylandTouchPointReleased: + SDL_SendTouch(deviceId, (SDL_FingerID)id, window, + (touchState == QtWaylandTouchPointPressed) ? SDL_TRUE : SDL_FALSE, + xf, yf, pressuref); + break; + case QtWaylandTouchPointMoved: + SDL_SendTouchMotion(deviceId, (SDL_FingerID)id, window, xf, yf, pressuref); + break; + default: + /* Should not happen */ + break; } } -static void -touch_handle_configure(void *data, - struct qt_touch_extension *qt_touch_extension, - uint32_t flags) +static void touch_handle_configure(void *data, + struct qt_touch_extension *qt_touch_extension, + uint32_t flags) { } - /* wayland-qt-touch-extension.c BEGINS */ static const struct qt_touch_extension_listener touch_listener = { @@ -161,9 +159,12 @@ static const struct wl_message qt_touch_extension_events[] = { }; const struct wl_interface qt_touch_extension_interface = { - "qt_touch_extension", 1, - 1, qt_touch_extension_requests, - 2, qt_touch_extension_events, + "qt_touch_extension", + 1, + 1, + qt_touch_extension_requests, + 2, + qt_touch_extension_events, }; /* wayland-qt-touch-extension.c ENDS */ @@ -184,9 +185,12 @@ static const struct wl_message qt_windowmanager_events[] = { }; const struct wl_interface qt_windowmanager_interface = { - "qt_windowmanager", 1, - 1, qt_windowmanager_requests, - 2, qt_windowmanager_events, + "qt_windowmanager", + 1, + 1, + qt_windowmanager_requests, + 2, + qt_windowmanager_events, }; /* wayland-qt-windowmanager.c ENDS */ @@ -200,14 +204,14 @@ static const struct wl_interface *qt_surface_extension_types[] = { NULL, &qt_extended_surface_interface, #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC - /* FIXME: Set this dynamically to (*WAYLAND_wl_surface_interface) ? - * The value comes from auto generated code and does + /* FIXME: Set this dynamically to (*WAYLAND_wl_surface_interface) ? + * The value comes from auto generated code and does * not appear to actually be used anywhere */ - NULL, + NULL, #else &wl_surface_interface, -#endif +#endif }; static const struct wl_message qt_surface_extension_requests[] = { @@ -215,9 +219,12 @@ static const struct wl_message qt_surface_extension_requests[] = { }; const struct wl_interface qt_surface_extension_interface = { - "qt_surface_extension", 1, - 1, qt_surface_extension_requests, - 0, NULL, + "qt_surface_extension", + 1, + 1, + qt_surface_extension_requests, + 0, + NULL, }; static const struct wl_message qt_extended_surface_requests[] = { @@ -233,15 +240,17 @@ static const struct wl_message qt_extended_surface_events[] = { }; const struct wl_interface qt_extended_surface_interface = { - "qt_extended_surface", 1, - 3, qt_extended_surface_requests, - 3, qt_extended_surface_events, + "qt_extended_surface", + 1, + 3, + qt_extended_surface_requests, + 3, + qt_extended_surface_events, }; /* wayland-qt-surface-extension.c ENDS */ -void -Wayland_touch_create(SDL_VideoData *data, uint32_t id) +void Wayland_touch_create(SDL_VideoData *data, uint32_t id) { struct SDL_WaylandTouch *touch; @@ -257,8 +266,7 @@ Wayland_touch_create(SDL_VideoData *data, uint32_t id) qt_touch_extension_add_listener(touch->touch_extension, &touch_listener, data); } -void -Wayland_touch_destroy(SDL_VideoData *data) +void Wayland_touch_destroy(SDL_VideoData *data) { if (data->touch) { struct SDL_WaylandTouch *touch = data->touch; diff --git a/src/video/wayland/SDL_waylandtouch.h b/src/video/wayland/SDL_waylandtouch.h index e4436f9f4f258..57563487b43ff 100644 --- a/src/video/wayland/SDL_waylandtouch.h +++ b/src/video/wayland/SDL_waylandtouch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,7 +31,6 @@ #include #include "wayland-util.h" - void Wayland_touch_create(SDL_VideoData *data, uint32_t id); void Wayland_touch_destroy(SDL_VideoData *data); @@ -72,45 +71,42 @@ struct qt_extended_surface; extern const struct wl_interface qt_surface_extension_interface; extern const struct wl_interface qt_extended_surface_interface; -#define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE 0 +#define QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE 0 -static inline void -qt_surface_extension_set_user_data(struct qt_surface_extension *qt_surface_extension, void *user_data) +static inline void qt_surface_extension_set_user_data(struct qt_surface_extension *qt_surface_extension, void *user_data) { - wl_proxy_set_user_data((struct wl_proxy *) qt_surface_extension, user_data); + wl_proxy_set_user_data((struct wl_proxy *)qt_surface_extension, user_data); } -static inline void * -qt_surface_extension_get_user_data(struct qt_surface_extension *qt_surface_extension) +static inline void *qt_surface_extension_get_user_data(struct qt_surface_extension *qt_surface_extension) { - return wl_proxy_get_user_data((struct wl_proxy *) qt_surface_extension); + return wl_proxy_get_user_data((struct wl_proxy *)qt_surface_extension); } -static inline void -qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension) +static inline void qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension) { - WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_surface_extension); + WAYLAND_wl_proxy_destroy((struct wl_proxy *)qt_surface_extension); } -static inline struct qt_extended_surface * -qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface) +static inline struct qt_extended_surface *qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface) { struct wl_proxy *id; - id = wl_proxy_create((struct wl_proxy *) qt_surface_extension, - &qt_extended_surface_interface); + id = wl_proxy_create((struct wl_proxy *)qt_surface_extension, + &qt_extended_surface_interface); if (!id) return NULL; - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_surface_extension, - QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, id, surface); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_surface_extension, + QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, id, surface); - return (struct qt_extended_surface *) id; + return (struct qt_extended_surface *)id; } #ifndef QT_EXTENDED_SURFACE_ORIENTATION_ENUM #define QT_EXTENDED_SURFACE_ORIENTATION_ENUM -enum qt_extended_surface_orientation { +enum qt_extended_surface_orientation +{ QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION = 0, QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION = 1, QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION = 2, @@ -121,85 +117,80 @@ enum qt_extended_surface_orientation { #ifndef QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM #define QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM -enum qt_extended_surface_windowflag { +enum qt_extended_surface_windowflag +{ QT_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES = 1, QT_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP = 2, }; #endif /* QT_EXTENDED_SURFACE_WINDOWFLAG_ENUM */ -struct qt_extended_surface_listener { +struct qt_extended_surface_listener +{ /** * onscreen_visibility - (none) * @visible: (none) */ void (*onscreen_visibility)(void *data, - struct qt_extended_surface *qt_extended_surface, - int32_t visible); + struct qt_extended_surface *qt_extended_surface, + int32_t visible); /** * set_generic_property - (none) * @name: (none) * @value: (none) */ void (*set_generic_property)(void *data, - struct qt_extended_surface *qt_extended_surface, - const char *name, - struct wl_array *value); + struct qt_extended_surface *qt_extended_surface, + const char *name, + struct wl_array *value); /** * close - (none) */ void (*close)(void *data, - struct qt_extended_surface *qt_extended_surface); + struct qt_extended_surface *qt_extended_surface); }; -static inline int -qt_extended_surface_add_listener(struct qt_extended_surface *qt_extended_surface, - const struct qt_extended_surface_listener *listener, void *data) +static inline int qt_extended_surface_add_listener(struct qt_extended_surface *qt_extended_surface, + const struct qt_extended_surface_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) qt_extended_surface, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)qt_extended_surface, + (void (**)(void))listener, data); } #define QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY 0 #define QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION 1 -#define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS 2 +#define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS 2 -static inline void -qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data) +static inline void qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data) { - WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data); + WAYLAND_wl_proxy_set_user_data((struct wl_proxy *)qt_extended_surface, user_data); } -static inline void * -qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface) +static inline void *qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface) { - return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface); + return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *)qt_extended_surface); } -static inline void -qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface) +static inline void qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface) { - WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_extended_surface); + WAYLAND_wl_proxy_destroy((struct wl_proxy *)qt_extended_surface); } -static inline void -qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value) +static inline void qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value) { - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, - QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_extended_surface, + QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value); } -static inline void -qt_extended_surface_set_content_orientation(struct qt_extended_surface *qt_extended_surface, int32_t orientation) +static inline void qt_extended_surface_set_content_orientation(struct qt_extended_surface *qt_extended_surface, int32_t orientation) { - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, - QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION, orientation); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_extended_surface, + QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION, orientation); } -static inline void -qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags) +static inline void qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags) { - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface, - QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_extended_surface, + QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags); } /* wayland-qt-touch-extension.h */ @@ -208,12 +199,14 @@ extern const struct wl_interface qt_touch_extension_interface; #ifndef QT_TOUCH_EXTENSION_FLAGS_ENUM #define QT_TOUCH_EXTENSION_FLAGS_ENUM -enum qt_touch_extension_flags { +enum qt_touch_extension_flags +{ QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH = 0x1, }; #endif /* QT_TOUCH_EXTENSION_FLAGS_ENUM */ -struct qt_touch_extension_listener { +struct qt_touch_extension_listener +{ /** * touch - (none) * @time: (none) @@ -232,118 +225,108 @@ struct qt_touch_extension_listener { * @rawdata: (none) */ void (*touch)(void *data, - struct qt_touch_extension *qt_touch_extension, - uint32_t time, - uint32_t id, - uint32_t state, - int32_t x, - int32_t y, - int32_t normalized_x, - int32_t normalized_y, - int32_t width, - int32_t height, - uint32_t pressure, - int32_t velocity_x, - int32_t velocity_y, - uint32_t flags, - struct wl_array *rawdata); + struct qt_touch_extension *qt_touch_extension, + uint32_t time, + uint32_t id, + uint32_t state, + int32_t x, + int32_t y, + int32_t normalized_x, + int32_t normalized_y, + int32_t width, + int32_t height, + uint32_t pressure, + int32_t velocity_x, + int32_t velocity_y, + uint32_t flags, + struct wl_array *rawdata); /** * configure - (none) * @flags: (none) */ void (*configure)(void *data, - struct qt_touch_extension *qt_touch_extension, - uint32_t flags); + struct qt_touch_extension *qt_touch_extension, + uint32_t flags); }; -static inline int -qt_touch_extension_add_listener(struct qt_touch_extension *qt_touch_extension, - const struct qt_touch_extension_listener *listener, void *data) +static inline int qt_touch_extension_add_listener(struct qt_touch_extension *qt_touch_extension, + const struct qt_touch_extension_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) qt_touch_extension, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)qt_touch_extension, + (void (**)(void))listener, data); } -#define QT_TOUCH_EXTENSION_DUMMY 0 +#define QT_TOUCH_EXTENSION_DUMMY 0 -static inline void -qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data) +static inline void qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data) { - WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data); + WAYLAND_wl_proxy_set_user_data((struct wl_proxy *)qt_touch_extension, user_data); } -static inline void * -qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension) +static inline void *qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension) { - return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension); + return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *)qt_touch_extension); } -static inline void -qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension) +static inline void qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension) { - WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_touch_extension); + WAYLAND_wl_proxy_destroy((struct wl_proxy *)qt_touch_extension); } -static inline void -qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension) +static inline void qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension) { - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_touch_extension, - QT_TOUCH_EXTENSION_DUMMY); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_touch_extension, + QT_TOUCH_EXTENSION_DUMMY); } - /* wayland-qt-windowmanager.h */ extern const struct wl_interface qt_windowmanager_interface; -struct qt_windowmanager_listener { +struct qt_windowmanager_listener +{ /** * hints - (none) * @show_is_fullscreen: (none) */ void (*hints)(void *data, - struct qt_windowmanager *qt_windowmanager, - int32_t show_is_fullscreen); + struct qt_windowmanager *qt_windowmanager, + int32_t show_is_fullscreen); /** * quit - (none) */ void (*quit)(void *data, - struct qt_windowmanager *qt_windowmanager); + struct qt_windowmanager *qt_windowmanager); }; -static inline int -qt_windowmanager_add_listener(struct qt_windowmanager *qt_windowmanager, - const struct qt_windowmanager_listener *listener, void *data) +static inline int qt_windowmanager_add_listener(struct qt_windowmanager *qt_windowmanager, + const struct qt_windowmanager_listener *listener, void *data) { - return wl_proxy_add_listener((struct wl_proxy *) qt_windowmanager, - (void (**)(void)) listener, data); + return wl_proxy_add_listener((struct wl_proxy *)qt_windowmanager, + (void (**)(void))listener, data); } -#define QT_WINDOWMANAGER_OPEN_URL 0 +#define QT_WINDOWMANAGER_OPEN_URL 0 -static inline void -qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data) +static inline void qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data) { - WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data); + WAYLAND_wl_proxy_set_user_data((struct wl_proxy *)qt_windowmanager, user_data); } -static inline void * -qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager) +static inline void *qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager) { - return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager); + return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *)qt_windowmanager); } -static inline void -qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager) +static inline void qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager) { - WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_windowmanager); + WAYLAND_wl_proxy_destroy((struct wl_proxy *)qt_windowmanager); } -static inline void -qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url) +static inline void qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url) { - WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_windowmanager, - QT_WINDOWMANAGER_OPEN_URL, remaining, url); + WAYLAND_wl_proxy_marshal((struct wl_proxy *)qt_windowmanager, + QT_WINDOWMANAGER_OPEN_URL, remaining, url); } #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 76b93cd0952b5..0549520d61acd 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "SDL_video.h" #include "SDL_mouse.h" @@ -37,6 +37,7 @@ #include "SDL_waylandtouch.h" #include "SDL_waylandclipboard.h" #include "SDL_waylandvulkan.h" +#include "SDL_waylandmessagebox.h" #include "SDL_hints.h" #include @@ -56,6 +57,9 @@ #include "xdg-output-unstable-v1-client-protocol.h" #include "viewporter-client-protocol.h" #include "primary-selection-unstable-v1-client-protocol.h" +#include "fractional-scale-v1-client-protocol.h" +#include "cursor-shape-v1-client-protocol.h" +#include "xdg-toplevel-icon-v1-client-protocol.h" #ifdef HAVE_LIBDECOR_H #include @@ -63,32 +67,26 @@ #define WAYLANDVID_DRIVER_NAME "wayland" -static void -display_handle_done(void *data, struct wl_output *output); +static void display_handle_done(void *data, struct wl_output *output); /* Initialization/Query functions */ -static int -Wayland_VideoInit(_THIS); +static int Wayland_VideoInit(_THIS); -static int -Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); -static int -Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi); +static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); -static void -Wayland_VideoQuit(_THIS); +static void Wayland_VideoQuit(_THIS); /* Find out what class name we should use * Based on src/video/x11/SDL_x11video.c */ -static char * -get_classname() +static char *get_classname(void) { -/* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec: - "The surface class identifies the general class of applications - to which the surface belongs. A common convention is to use the - file name (or the full path if it is a non-standard location) of - the application's .desktop file as the class." */ + /* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec: + "The surface class identifies the general class of applications + to which the surface belongs. A common convention is to use the + file name (or the full path if it is a non-standard location) of + the application's .desktop file as the class." */ char *spot; #if defined(__LINUX__) || defined(__FREEBSD__) @@ -112,10 +110,9 @@ get_classname() /* Next look at the application's executable name */ #if defined(__LINUX__) || defined(__FREEBSD__) #if defined(__LINUX__) - SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); + (void)SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); #elif defined(__FREEBSD__) - SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", - getpid()); + (void)SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid()); #else #error Where can we find the executable name? #endif @@ -150,62 +147,82 @@ void SDL_WAYLAND_register_output(struct wl_output *output) SDL_bool SDL_WAYLAND_own_surface(struct wl_surface *surface) { - return wl_proxy_get_tag((struct wl_proxy *) surface) == &SDL_WAYLAND_surface_tag; + return wl_proxy_get_tag((struct wl_proxy *)surface) == &SDL_WAYLAND_surface_tag; } SDL_bool SDL_WAYLAND_own_output(struct wl_output *output) { - return wl_proxy_get_tag((struct wl_proxy *) output) == &SDL_WAYLAND_output_tag; + return wl_proxy_get_tag((struct wl_proxy *)output) == &SDL_WAYLAND_output_tag; } -static void -Wayland_DeleteDevice(SDL_VideoDevice *device) +static void Wayland_DeleteDevice(SDL_VideoDevice *device) { SDL_VideoData *data = (SDL_VideoData *)device->driverdata; if (data->display) { WAYLAND_wl_display_flush(data->display); WAYLAND_wl_display_disconnect(data->display); } - if (device->wakeup_lock) { - SDL_DestroyMutex(device->wakeup_lock); - } SDL_free(data); SDL_free(device); SDL_WAYLAND_UnloadSymbols(); } -static SDL_VideoDevice * -Wayland_CreateDevice(void) +static SDL_VideoDevice *Wayland_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *data; + struct SDL_WaylandInput *input; struct wl_display *display; + /* Are we trying to connect to or are currently in a Wayland session? */ + if (!getenv("WAYLAND_DISPLAY")) { + const char *session = getenv("XDG_SESSION_TYPE"); + if (session && SDL_strcasecmp(session, "wayland")) { + return NULL; + } + } + if (!SDL_WAYLAND_LoadSymbols()) { return NULL; } display = WAYLAND_wl_display_connect(NULL); - if (display == NULL) { + if (!display) { SDL_WAYLAND_UnloadSymbols(); return NULL; } data = SDL_calloc(1, sizeof(*data)); - if (data == NULL) { + if (!data) { + WAYLAND_wl_display_disconnect(display); + SDL_WAYLAND_UnloadSymbols(); + SDL_OutOfMemory(); + return NULL; + } + + input = SDL_calloc(1, sizeof(*input)); + if (!input) { + SDL_free(data); WAYLAND_wl_display_disconnect(display); SDL_WAYLAND_UnloadSymbols(); SDL_OutOfMemory(); return NULL; } + input->display = data; + input->sx_w = wl_fixed_from_int(0); + input->sy_w = wl_fixed_from_int(0); + input->xkb.current_group = XKB_GROUP_INVALID; + data->initializing = SDL_TRUE; data->display = display; + data->input = input; /* Initialize all variables that we clean on shutdown */ device = SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_free(data); + SDL_free(input); WAYLAND_wl_display_disconnect(display); SDL_WAYLAND_UnloadSymbols(); SDL_OutOfMemory(); @@ -213,7 +230,6 @@ Wayland_CreateDevice(void) } device->driverdata = data; - device->wakeup_lock = SDL_CreateMutex(); /* Set the function pointers */ device->VideoInit = Wayland_VideoInit; @@ -227,7 +243,7 @@ Wayland_CreateDevice(void) device->WaitEventTimeout = Wayland_WaitEventTimeout; device->SendWakeupEvent = Wayland_SendWakeupEvent; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL device->GL_SwapWindow = Wayland_GLES_SwapWindow; device->GL_GetSwapInterval = Wayland_GLES_GetSwapInterval; device->GL_SetSwapInterval = Wayland_GLES_SetSwapInterval; @@ -257,6 +273,7 @@ Wayland_CreateDevice(void) device->SetWindowMaximumSize = Wayland_SetWindowMaximumSize; device->SetWindowModalFor = Wayland_SetWindowModalFor; device->SetWindowTitle = Wayland_SetWindowTitle; + device->SetWindowIcon = Wayland_SetWindowIcon; device->GetWindowSizeInPixels = Wayland_GetWindowSizeInPixels; device->DestroyWindow = Wayland_DestroyWindow; device->SetWindowHitTest = Wayland_SetWindowHitTest; @@ -273,7 +290,7 @@ Wayland_CreateDevice(void) device->StopTextInput = Wayland_StopTextInput; device->SetTextInputRect = Wayland_SetTextInputRect; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = Wayland_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = Wayland_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = Wayland_Vulkan_GetInstanceExtensions; @@ -290,25 +307,24 @@ Wayland_CreateDevice(void) VideoBootStrap Wayland_bootstrap = { WAYLANDVID_DRIVER_NAME, "SDL Wayland video driver", - Wayland_CreateDevice + Wayland_CreateDevice, + Wayland_ShowMessageBox }; -static void -xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *xdg_output, - int32_t x, int32_t y) +static void xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *xdg_output, + int32_t x, int32_t y) { - SDL_WaylandOutputData* driverdata = data; + SDL_WaylandOutputData *driverdata = data; driverdata->x = x; driverdata->y = y; driverdata->has_logical_position = SDL_TRUE; } -static void -xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, - int32_t width, int32_t height) +static void xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, + int32_t width, int32_t height) { - SDL_WaylandOutputData* driverdata = data; + SDL_WaylandOutputData *driverdata = data; if (driverdata->width != 0 && driverdata->height != 0) { /* FIXME: GNOME has a bug where the logical size does not account for @@ -319,12 +335,11 @@ xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, * detected otherwise), then override if necessary. * -flibit */ - const float scale = (float) driverdata->width / (float) width; + const float scale = (float)driverdata->width / (float)width; if ((scale == 1.0f) && (driverdata->scale_factor != 1.0f)) { SDL_LogWarn( SDL_LOG_CATEGORY_VIDEO, - "xdg_output scale did not match, overriding with wl_output scale" - ); + "xdg_output scale did not match, overriding with wl_output scale"); return; } } @@ -334,10 +349,9 @@ xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, driverdata->has_logical_size = SDL_TRUE; } -static void -xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) +static void xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) { - SDL_WaylandOutputData* driverdata = data; + SDL_WaylandOutputData *driverdata = data; /* * xdg-output.done events are deprecated and only apply below version 3 of the protocol. @@ -348,21 +362,19 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) } } -static void -xdg_output_handle_name(void *data, struct zxdg_output_v1 *xdg_output, - const char *name) +static void xdg_output_handle_name(void *data, struct zxdg_output_v1 *xdg_output, + const char *name) { } -static void -xdg_output_handle_description(void *data, struct zxdg_output_v1 *xdg_output, - const char *description) +static void xdg_output_handle_description(void *data, struct zxdg_output_v1 *xdg_output, + const char *description) { - SDL_WaylandOutputData* driverdata = data; + SDL_WaylandOutputData *driverdata = data; if (driverdata->index == -1) { /* xdg-output descriptions, if available, supersede wl-output model names. */ - if (driverdata->placeholder.name != NULL) { + if (driverdata->placeholder.name) { SDL_free(driverdata->placeholder.name); } @@ -371,15 +383,14 @@ xdg_output_handle_description(void *data, struct zxdg_output_v1 *xdg_output, } static const struct zxdg_output_v1_listener xdg_output_listener = { - xdg_output_handle_logical_position, - xdg_output_handle_logical_size, - xdg_output_handle_done, - xdg_output_handle_name, - xdg_output_handle_description, + xdg_output_handle_logical_position, + xdg_output_handle_logical_size, + xdg_output_handle_done, + xdg_output_handle_name, + xdg_output_handle_description, }; -static void -AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90) +static void AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90) { struct EmulatedMode { @@ -431,7 +442,7 @@ AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90) int i; SDL_DisplayMode mode; - const int native_width = dpy->display_modes->w; + const int native_width = dpy->display_modes->w; const int native_height = dpy->display_modes->h; for (i = 0; i < SDL_arraysize(mode_list); ++i) { @@ -454,30 +465,20 @@ AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90) } } -static void -display_handle_geometry(void *data, - struct wl_output *output, - int x, int y, - int physical_width, - int physical_height, - int subpixel, - const char *make, - const char *model, - int transform) +static void display_handle_geometry(void *data, + struct wl_output *output, + int x, int y, + int physical_width, + int physical_height, + int subpixel, + const char *make, + const char *model, + int transform) { SDL_WaylandOutputData *driverdata = data; - SDL_VideoDisplay *display; - int i; if (driverdata->wl_output_done_count) { - /* Clear the wl_output ref so Reset doesn't free it */ - display = SDL_GetDisplay(driverdata->index); - for (i = 0; i < display->num_display_modes; i += 1) { - display->display_modes[i].driverdata = NULL; - } - - /* Okay, now it's safe to reset */ SDL_ResetDisplayModes(driverdata->index); /* The display has officially started over. */ @@ -493,15 +494,15 @@ display_handle_geometry(void *data, driverdata->physical_height = physical_height; /* The output name is only set if xdg-output hasn't provided a description. */ - if (driverdata->index == -1 && driverdata->placeholder.name == NULL) { + if (driverdata->index == -1 && !driverdata->placeholder.name) { driverdata->placeholder.name = SDL_strdup(model); } driverdata->transform = transform; - #define TF_CASE(in, out) \ - case WL_OUTPUT_TRANSFORM_##in: \ - driverdata->orientation = SDL_ORIENTATION_##out; \ - break; +#define TF_CASE(in, out) \ + case WL_OUTPUT_TRANSFORM_##in: \ + driverdata->orientation = SDL_ORIENTATION_##out; \ + break; if (driverdata->physical_width >= driverdata->physical_height) { switch (transform) { TF_CASE(NORMAL, LANDSCAPE) @@ -525,21 +526,20 @@ display_handle_geometry(void *data, TF_CASE(FLIPPED_270, LANDSCAPE) } } - #undef TF_CASE +#undef TF_CASE } -static void -display_handle_mode(void *data, - struct wl_output *output, - uint32_t flags, - int width, - int height, - int refresh) +static void display_handle_mode(void *data, + struct wl_output *output, + uint32_t flags, + int width, + int height, + int refresh) { - SDL_WaylandOutputData* driverdata = data; + SDL_WaylandOutputData *driverdata = data; if (flags & WL_OUTPUT_MODE_CURRENT) { - driverdata->native_width = width; + driverdata->native_width = width; driverdata->native_height = height; /* @@ -547,7 +547,7 @@ display_handle_mode(void *data, * handle_done and xdg-output coordinates are pre-transformed. */ if (!driverdata->has_logical_size) { - driverdata->width = width; + driverdata->width = width; driverdata->height = height; } @@ -555,12 +555,11 @@ display_handle_mode(void *data, } } -static void -display_handle_done(void *data, - struct wl_output *output) +static void display_handle_done(void *data, + struct wl_output *output) { - SDL_WaylandOutputData* driverdata = data; - SDL_VideoData* video = driverdata->videodata; + SDL_WaylandOutputData *driverdata = data; + SDL_VideoData *video = driverdata->videodata; SDL_DisplayMode native_mode, desktop_mode; SDL_VideoDisplay *dpy; const SDL_bool mode_emulation_enabled = SDL_GetHintBoolean(SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION, SDL_TRUE); @@ -591,7 +590,6 @@ display_handle_done(void *data, native_mode.h = driverdata->native_height; } native_mode.refresh_rate = (int)SDL_round(driverdata->refresh / 1000.0); /* mHz to Hz */ - native_mode.driverdata = driverdata->output; /* The scaled desktop mode */ SDL_zero(desktop_mode); @@ -599,7 +597,7 @@ display_handle_done(void *data, if (driverdata->has_logical_size) { /* If xdg-output is present, calculate the true scale of the desktop */ driverdata->scale_factor = (float)native_mode.w / (float)driverdata->width; - } else { /* Scale the desktop coordinates, if xdg-output isn't present */ + } else { /* Scale the desktop coordinates, if xdg-output isn't present */ driverdata->width /= driverdata->scale_factor; driverdata->height /= driverdata->scale_factor; } @@ -613,13 +611,12 @@ display_handle_done(void *data, desktop_mode.h = driverdata->width; } desktop_mode.refresh_rate = (int)SDL_round(driverdata->refresh / 1000.0); /* mHz to Hz */ - desktop_mode.driverdata = driverdata->output; /* * The native display mode is only exposed separately from the desktop size if the * desktop is scaled and the wp_viewporter protocol is supported. */ - if (driverdata->scale_factor > 1.0f && video->viewporter != NULL) { + if (driverdata->scale_factor > 1.0f && video->viewporter) { if (driverdata->index > -1) { SDL_AddDisplayMode(SDL_GetDisplay(driverdata->index), &native_mode); } else { @@ -629,31 +626,28 @@ display_handle_done(void *data, /* Calculate the display DPI */ if (driverdata->transform & WL_OUTPUT_TRANSFORM_90) { - driverdata->hdpi = driverdata->physical_height ? - (((float) driverdata->height) * 25.4f / driverdata->physical_height) : - 0.0f; - driverdata->vdpi = driverdata->physical_width ? - (((float) driverdata->width) * 25.4f / driverdata->physical_width) : - 0.0f; - driverdata->ddpi = SDL_ComputeDiagonalDPI(driverdata->height, - driverdata->width, - ((float) driverdata->physical_height) / 25.4f, - ((float) driverdata->physical_width) / 25.4f); + driverdata->hdpi = driverdata->physical_height ? (((float)driverdata->native_height) * 25.4f / driverdata->physical_height) : 0.0f; + driverdata->vdpi = driverdata->physical_width ? (((float)driverdata->native_width) * 25.4f / driverdata->physical_width) : 0.0f; + driverdata->ddpi = SDL_ComputeDiagonalDPI(driverdata->native_height, + driverdata->native_width, + ((float)driverdata->physical_height) / 25.4f, + ((float)driverdata->physical_width) / 25.4f); } else { - driverdata->hdpi = driverdata->physical_width ? - (((float) driverdata->width) * 25.4f / driverdata->physical_width) : - 0.0f; - driverdata->vdpi = driverdata->physical_height ? - (((float) driverdata->height) * 25.4f / driverdata->physical_height) : - 0.0f; - driverdata->ddpi = SDL_ComputeDiagonalDPI(driverdata->width, - driverdata->height, - ((float) driverdata->physical_width) / 25.4f, - ((float) driverdata->physical_height) / 25.4f); + driverdata->hdpi = driverdata->physical_width ? (((float)driverdata->native_width) * 25.4f / driverdata->physical_width) : 0.0f; + driverdata->vdpi = driverdata->physical_height ? (((float)driverdata->native_height) * 25.4f / driverdata->physical_height) : 0.0f; + driverdata->ddpi = SDL_ComputeDiagonalDPI(driverdata->native_width, + driverdata->native_height, + ((float)driverdata->physical_width) / 25.4f, + ((float)driverdata->physical_height) / 25.4f); } if (driverdata->index > -1) { dpy = SDL_GetDisplay(driverdata->index); + + /* XXX: This can never happen, but jump threading during aggressive LTO can generate a warning without this check. */ + if (!dpy) { + dpy = &driverdata->placeholder; + } } else { dpy = &driverdata->placeholder; } @@ -664,7 +658,7 @@ display_handle_done(void *data, /* Add emulated modes if wp_viewporter is supported and mode emulation is enabled. */ if (video->viewporter && mode_emulation_enabled) { - const SDL_bool rot_90 = ((driverdata->transform & WL_OUTPUT_TRANSFORM_90) != 0) || + const SDL_bool rot_90 = (driverdata->transform & WL_OUTPUT_TRANSFORM_90) || (driverdata->width < driverdata->height); AddEmulatedModes(dpy, rot_90); } @@ -682,10 +676,9 @@ display_handle_done(void *data, } } -static void -display_handle_scale(void *data, - struct wl_output *output, - int32_t factor) +static void display_handle_scale(void *data, + struct wl_output *output, + int32_t factor) { SDL_WaylandOutputData *driverdata = data; driverdata->scale_factor = factor; @@ -698,8 +691,7 @@ static const struct wl_output_listener output_listener = { display_handle_scale }; -static void -Wayland_add_display(SDL_VideoData *d, uint32_t id) +static void Wayland_add_display(SDL_VideoData *d, uint32_t id) { struct wl_output *output; SDL_WaylandOutputData *data; @@ -709,7 +701,7 @@ Wayland_add_display(SDL_VideoData *d, uint32_t id) SDL_SetError("Failed to retrieve output."); return; } - data = SDL_malloc(sizeof *data); + data = (SDL_WaylandOutputData *)SDL_malloc(sizeof(*data)); SDL_zerop(data); data->videodata = d; data->output = output; @@ -721,16 +713,16 @@ Wayland_add_display(SDL_VideoData *d, uint32_t id) SDL_WAYLAND_register_output(output); /* Keep a list of outputs for deferred xdg-output initialization. */ - if (d->output_list != NULL) { - SDL_WaylandOutputData *node = (SDL_WaylandOutputData*)d->output_list; + if (d->output_list) { + SDL_WaylandOutputData *node = d->output_list; - while (node->next != NULL) { - node = (SDL_WaylandOutputData*)node->next; + while (node->next) { + node = node->next; } - node->next = (struct SDL_WaylandOutputData*)data; + node->next = (struct SDL_WaylandOutputData *)data; } else { - d->output_list = (struct SDL_WaylandOutputData*)data; + d->output_list = (struct SDL_WaylandOutputData *)data; } if (data->videodata->xdg_output_manager) { @@ -739,43 +731,50 @@ Wayland_add_display(SDL_VideoData *d, uint32_t id) } } -static void -Wayland_free_display(SDL_VideoData *d, uint32_t id) +static void Wayland_free_display(SDL_VideoData *d, uint32_t id) { int num_displays = SDL_GetNumVideoDisplays(); SDL_VideoDisplay *display; SDL_WaylandOutputData *data; + SDL_Window *window; int i; for (i = 0; i < num_displays; i += 1) { display = SDL_GetDisplay(i); - data = (SDL_WaylandOutputData *) display->driverdata; + data = (SDL_WaylandOutputData *)display->driverdata; if (data->registry_id == id) { - if (d->output_list != NULL) { + if (d->output_list) { SDL_WaylandOutputData *node = d->output_list; if (node == data) { d->output_list = node->next; } else { - while (node->next != data && node->next != NULL) { + while (node->next != data && node->next) { node = node->next; } - if (node->next != NULL) { + if (node->next) { node->next = node->next->next; } } } - SDL_DelVideoDisplay(i); + + /* Surface leave events may be implicit when an output is destroyed, so make sure that + * no windows retain a reference to a destroyed output. + */ + for (window = SDL_GetVideoDevice()->windows; window; window = window->next) { + Wayland_RemoveOutputFromWindow(window->driverdata, data->output); + } + if (data->xdg_output) { zxdg_output_v1_destroy(data->xdg_output); } wl_output_destroy(data->output); - SDL_free(data); + SDL_DelVideoDisplay(i); /* Update the index for all remaining displays */ num_displays -= 1; for (; i < num_displays; i += 1) { display = SDL_GetDisplay(i); - data = (SDL_WaylandOutputData *) display->driverdata; + data = (SDL_WaylandOutputData *)display->driverdata; data->index -= 1; } @@ -784,25 +783,22 @@ Wayland_free_display(SDL_VideoData *d, uint32_t id) } } -static void -Wayland_init_xdg_output(SDL_VideoData *d) +static void Wayland_init_xdg_output(SDL_VideoData *d) { SDL_WaylandOutputData *node; - for (node = d->output_list; node != NULL; node = node->next) { + for (node = d->output_list; node; node = node->next) { node->xdg_output = zxdg_output_manager_v1_get_xdg_output(node->videodata->xdg_output_manager, node->output); zxdg_output_v1_add_listener(node->xdg_output, &xdg_output_listener, node); } } #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH -static void -windowmanager_hints(void *data, struct qt_windowmanager *qt_windowmanager, - int32_t show_is_fullscreen) +static void windowmanager_hints(void *data, struct qt_windowmanager *qt_windowmanager, + int32_t show_is_fullscreen) { } -static void -windowmanager_quit(void *data, struct qt_windowmanager *qt_windowmanager) +static void windowmanager_quit(void *data, struct qt_windowmanager *qt_windowmanager) { SDL_SendQuit(); } @@ -813,8 +809,7 @@ static const struct qt_windowmanager_listener windowmanager_listener = { }; #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ -static void -handle_ping_xdg_wm_base(void *data, struct xdg_wm_base *xdg, uint32_t serial) +static void handle_ping_xdg_wm_base(void *data, struct xdg_wm_base *xdg, uint32_t serial) { xdg_wm_base_pong(xdg, serial); } @@ -823,12 +818,10 @@ static const struct xdg_wm_base_listener shell_listener_xdg = { handle_ping_xdg_wm_base }; - #ifdef HAVE_LIBDECOR_H -static void -libdecor_error(struct libdecor *context, - enum libdecor_error error, - const char *message) +static void libdecor_error(struct libdecor *context, + enum libdecor_error error, + const char *message) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "libdecor error (%d): %s\n", error, message); } @@ -838,10 +831,8 @@ static struct libdecor_interface libdecor_interface = { }; #endif - -static void -display_handle_global(void *data, struct wl_registry *registry, uint32_t id, - const char *interface, uint32_t version) +static void display_handle_global(void *data, struct wl_registry *registry, uint32_t id, + const char *interface, uint32_t version) { SDL_VideoData *d = data; @@ -854,7 +845,7 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id, } else if (SDL_strcmp(interface, "wl_seat") == 0) { Wayland_display_add_input(d, id, version); } else if (SDL_strcmp(interface, "xdg_wm_base") == 0) { - d->shell.xdg = wl_registry_bind(d->registry, id, &xdg_wm_base_interface, SDL_min(version, 3)); + d->shell.xdg = wl_registry_bind(d->registry, id, &xdg_wm_base_interface, SDL_min(version, 5)); xdg_wm_base_add_listener(d->shell.xdg, &shell_listener_xdg, NULL); } else if (SDL_strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); @@ -878,32 +869,37 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id, d->decoration_manager = wl_registry_bind(d->registry, id, &zxdg_decoration_manager_v1_interface, 1); } else if (SDL_strcmp(interface, "zwp_tablet_manager_v2") == 0) { d->tablet_manager = wl_registry_bind(d->registry, id, &zwp_tablet_manager_v2_interface, 1); - if (d->input) { - Wayland_input_add_tablet(d->input, d->tablet_manager); - } + Wayland_input_add_tablet(d->input, d->tablet_manager); } else if (SDL_strcmp(interface, "zxdg_output_manager_v1") == 0) { version = SDL_min(version, 3); /* Versions 1 through 3 are supported. */ d->xdg_output_manager = wl_registry_bind(d->registry, id, &zxdg_output_manager_v1_interface, version); Wayland_init_xdg_output(d); } else if (SDL_strcmp(interface, "wp_viewporter") == 0) { d->viewporter = wl_registry_bind(d->registry, id, &wp_viewporter_interface, 1); - + } else if (SDL_strcmp(interface, "wp_fractional_scale_manager_v1") == 0) { + d->fractional_scale_manager = wl_registry_bind(d->registry, id, &wp_fractional_scale_manager_v1_interface, 1); + } else if (SDL_strcmp(interface, "wp_cursor_shape_manager_v1") == 0) { + d->cursor_shape_manager = wl_registry_bind(d->registry, id, &wp_cursor_shape_manager_v1_interface, 1); + if (d->input) { + Wayland_CreateCursorShapeDevice(d->input); + } + } else if (SDL_strcmp(interface, "xdg_toplevel_icon_manager_v1") == 0) { + d->xdg_toplevel_icon_manager_v1 = wl_registry_bind(d->registry, id, &xdg_toplevel_icon_manager_v1_interface, 1); #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH } else if (SDL_strcmp(interface, "qt_touch_extension") == 0) { Wayland_touch_create(d, id); } else if (SDL_strcmp(interface, "qt_surface_extension") == 0) { d->surface_extension = wl_registry_bind(registry, id, - &qt_surface_extension_interface, 1); + &qt_surface_extension_interface, 1); } else if (SDL_strcmp(interface, "qt_windowmanager") == 0) { d->windowmanager = wl_registry_bind(registry, id, - &qt_windowmanager_interface, 1); + &qt_windowmanager_interface, 1); qt_windowmanager_add_listener(d->windowmanager, &windowmanager_listener, d); #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ } } -static void -display_remove_global(void *data, struct wl_registry *registry, uint32_t id) +static void display_remove_global(void *data, struct wl_registry *registry, uint32_t id) { SDL_VideoData *d = data; /* We don't get an interface, just an ID, so assume it's a wl_output :shrug: */ @@ -942,8 +938,7 @@ static SDL_bool should_use_libdecor(SDL_VideoData *data, SDL_bool ignore_xdg) } #endif -SDL_bool -Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg) +SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg) { #ifdef HAVE_LIBDECOR_H if (data->shell.libdecor != NULL) { @@ -957,10 +952,9 @@ Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg) return SDL_FALSE; } -int -Wayland_VideoInit(_THIS) +int Wayland_VideoInit(_THIS) { - SDL_VideoData *data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; data->xkb_context = WAYLAND_xkb_context_new(0); if (!data->xkb_context) { @@ -968,7 +962,7 @@ Wayland_VideoInit(_THIS) } data->registry = wl_display_get_registry(data->display); - if (data->registry == NULL) { + if (!data->registry) { return SDL_SetError("Failed to get the Wayland registry"); } @@ -998,8 +992,7 @@ Wayland_VideoInit(_THIS) return 0; } -static int -Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) +static int Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { SDL_WaylandOutputData *driverdata = (SDL_WaylandOutputData *)display->driverdata; rect->x = driverdata->x; @@ -1009,8 +1002,7 @@ Wayland_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) return 0; } -static int -Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi) +static int Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) { SDL_WaylandOutputData *driverdata = (SDL_WaylandOutputData *)sdl_display->driverdata; @@ -1027,11 +1019,10 @@ Wayland_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float return driverdata->ddpi != 0.0f ? 0 : SDL_SetError("Couldn't get DPI"); } -static void -Wayland_VideoCleanup(_THIS) +static void Wayland_VideoCleanup(_THIS) { SDL_VideoData *data = _this->driverdata; - int i, j; + int i; Wayland_QuitWin(data); Wayland_FiniMouse(data); @@ -1039,18 +1030,11 @@ Wayland_VideoCleanup(_THIS) for (i = _this->num_displays - 1; i >= 0; --i) { SDL_VideoDisplay *display = &_this->displays[i]; - if (((SDL_WaylandOutputData*)display->driverdata)->xdg_output) { - zxdg_output_v1_destroy(((SDL_WaylandOutputData*)display->driverdata)->xdg_output); + if (((SDL_WaylandOutputData *)display->driverdata)->xdg_output) { + zxdg_output_v1_destroy(((SDL_WaylandOutputData *)display->driverdata)->xdg_output); } - wl_output_destroy(((SDL_WaylandOutputData*)display->driverdata)->output); - SDL_free(display->driverdata); - display->driverdata = NULL; - - for (j = display->num_display_modes; j--;) { - display->display_modes[j].driverdata = NULL; - } - display->desktop_mode.driverdata = NULL; + wl_output_destroy(((SDL_WaylandOutputData *)display->driverdata)->output); SDL_DelVideoDisplay(i); } data->output_list = NULL; @@ -1100,7 +1084,7 @@ Wayland_VideoCleanup(_THIS) #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ if (data->tablet_manager) { - zwp_tablet_manager_v2_destroy((struct zwp_tablet_manager_v2*)data->tablet_manager); + zwp_tablet_manager_v2_destroy((struct zwp_tablet_manager_v2 *)data->tablet_manager); data->tablet_manager = NULL; } @@ -1139,6 +1123,21 @@ Wayland_VideoCleanup(_THIS) data->primary_selection_device_manager = NULL; } + if (data->fractional_scale_manager) { + wp_fractional_scale_manager_v1_destroy(data->fractional_scale_manager); + data->fractional_scale_manager = NULL; + } + + if (data->cursor_shape_manager) { + wp_cursor_shape_manager_v1_destroy(data->cursor_shape_manager); + data->cursor_shape_manager = NULL; + } + + if (data->xdg_toplevel_icon_manager_v1) { + xdg_toplevel_icon_manager_v1_destroy(data->xdg_toplevel_icon_manager_v1); + data->xdg_toplevel_icon_manager_v1 = NULL; + } + if (data->compositor) { wl_compositor_destroy(data->compositor); data->compositor = NULL; @@ -1150,8 +1149,7 @@ Wayland_VideoCleanup(_THIS) } } -SDL_bool -Wayland_VideoReconnect(_THIS) +SDL_bool Wayland_VideoReconnect(_THIS) { #if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */ SDL_VideoData *data = _this->driverdata; @@ -1198,8 +1196,7 @@ Wayland_VideoReconnect(_THIS) #endif /* 0 */ } -void -Wayland_VideoQuit(_THIS) +void Wayland_VideoQuit(_THIS) { SDL_VideoData *data = _this->driverdata; diff --git a/src/video/wayland/SDL_waylandvideo.h b/src/video/wayland/SDL_waylandvideo.h index e7f66fe2dea17..c8464f397ae41 100644 --- a/src/video/wayland/SDL_waylandvideo.h +++ b/src/video/wayland/SDL_waylandvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,14 +42,16 @@ struct qt_surface_extension; struct qt_windowmanager; #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ -typedef struct { +typedef struct +{ struct wl_cursor_theme *theme; int size; } SDL_WaylandCursorTheme; typedef struct SDL_WaylandOutputData SDL_WaylandOutputData; -typedef struct { +typedef struct +{ SDL_bool initializing; struct wl_display *display; int display_disconnected; @@ -59,7 +61,8 @@ typedef struct { SDL_WaylandCursorTheme *cursor_themes; int num_cursor_themes; struct wl_pointer *pointer; - struct { + struct + { struct xdg_wm_base *xdg; #ifdef HAVE_LIBDECOR_H struct libdecor *libdecor; @@ -67,6 +70,7 @@ typedef struct { } shell; struct zwp_relative_pointer_manager_v1 *relative_pointer_manager; struct zwp_pointer_constraints_v1 *pointer_constraints; + struct wp_cursor_shape_manager_v1 *cursor_shape_manager; struct wl_data_device_manager *data_device_manager; struct zwp_primary_selection_device_manager_v1 *primary_selection_device_manager; struct zxdg_decoration_manager_v1 *decoration_manager; @@ -74,8 +78,10 @@ typedef struct { struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager; struct xdg_activation_v1 *activation_manager; struct zwp_text_input_manager_v3 *text_input_manager; + struct xdg_toplevel_icon_manager_v1 *xdg_toplevel_icon_manager_v1; struct zxdg_output_manager_v1 *xdg_output_manager; struct wp_viewporter *viewporter; + struct wp_fractional_scale_manager_v1 *fractional_scale_manager; EGLDisplay edpy; EGLContext context; @@ -95,10 +101,12 @@ typedef struct { char *classname; int relative_mouse_mode; + int relative_mode_accelerated; SDL_bool egl_transparency_enabled; } SDL_VideoData; -struct SDL_WaylandOutputData { +struct SDL_WaylandOutputData +{ SDL_VideoData *videodata; struct wl_output *output; struct zxdg_output_v1 *xdg_output; diff --git a/src/video/wayland/SDL_waylandvulkan.c b/src/video/wayland/SDL_waylandvulkan.c index f76efd0946707..0c39d1b622a7e 100644 --- a/src/video/wayland/SDL_waylandvulkan.c +++ b/src/video/wayland/SDL_waylandvulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WAYLAND +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WAYLAND) #include "SDL_waylandvideo.h" #include "SDL_waylandwindow.h" @@ -36,9 +36,9 @@ #include "SDL_syswm.h" #if defined(__OpenBSD__) -#define DEFAULT_VULKAN "libvulkan.so" +#define DEFAULT_VULKAN "libvulkan.so" #else -#define DEFAULT_VULKAN "libvulkan.so.1" +#define DEFAULT_VULKAN "libvulkan.so.1" #endif int Wayland_Vulkan_LoadLibrary(_THIS, const char *path) @@ -48,53 +48,55 @@ int Wayland_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasSurfaceExtension = SDL_FALSE; SDL_bool hasWaylandSurfaceExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan loader library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) + } + if (!path) { path = DEFAULT_VULKAN; + } _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasWaylandSurfaceExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else if(!hasWaylandSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "extension"); + } else if (!hasWaylandSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "extension"); goto fail; } return 0; @@ -107,54 +109,50 @@ int Wayland_Vulkan_LoadLibrary(_THIS, const char *path) void Wayland_Vulkan_UnloadLibrary(_THIS) { - if(_this->vulkan_config.loader_handle) - { + if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } } SDL_bool Wayland_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names) + SDL_Window *window, + unsigned *count, + const char **names) { static const char *const extensionsForWayland[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME }; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } return SDL_Vulkan_GetInstanceExtensions_Helper( - count, names, SDL_arraysize(extensionsForWayland), - extensionsForWayland); + count, names, SDL_arraysize(extensionsForWayland), + extensionsForWayland); } SDL_bool Wayland_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface) + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface) { SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR)vkGetInstanceProcAddr( - instance, - "vkCreateWaylandSurfaceKHR"); + instance, + "vkCreateWaylandSurfaceKHR"); VkWaylandSurfaceCreateInfoKHR createInfo; VkResult result; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } - if(!vkCreateWaylandSurfaceKHR) - { + if (!vkCreateWaylandSurfaceKHR) { SDL_SetError(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); return SDL_FALSE; @@ -164,11 +162,10 @@ SDL_bool Wayland_Vulkan_CreateSurface(_THIS, createInfo.pNext = NULL; createInfo.flags = 0; createInfo.display = windowData->waylandData->display; - createInfo.surface = windowData->surface; + createInfo.surface = windowData->surface; result = vkCreateWaylandSurfaceKHR(instance, &createInfo, NULL, surface); - if(result != VK_SUCCESS) - { + if (result != VK_SUCCESS) { SDL_SetError("vkCreateWaylandSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); return SDL_FALSE; diff --git a/src/video/wayland/SDL_waylandvulkan.h b/src/video/wayland/SDL_waylandvulkan.h index 7ef4658bf3878..9e0a0d043a7d0 100644 --- a/src/video/wayland/SDL_waylandvulkan.h +++ b/src/video/wayland/SDL_waylandvulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,18 +32,18 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WAYLAND +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WAYLAND) int Wayland_Vulkan_LoadLibrary(_THIS, const char *path); void Wayland_Vulkan_UnloadLibrary(_THIS); SDL_bool Wayland_Vulkan_GetInstanceExtensions(_THIS, - SDL_Window *window, - unsigned *count, - const char **names); + SDL_Window *window, + unsigned *count, + const char **names); SDL_bool Wayland_Vulkan_CreateSurface(_THIS, - SDL_Window *window, - VkInstance instance, - VkSurfaceKHR *surface); + SDL_Window *window, + VkInstance instance, + VkSurfaceKHR *surface); #endif diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index a31f6baf6e9d8..d208c1ab268a4 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WAYLAND +#ifdef SDL_VIDEO_DRIVER_WAYLAND #include "../SDL_sysvideo.h" #include "../../events/SDL_windowevents_c.h" @@ -31,6 +31,7 @@ #include "SDL_waylandwindow.h" #include "SDL_waylandvideo.h" #include "SDL_waylandtouch.h" +#include "SDL_waylandshmbuffer.h" #include "SDL_hints.h" #include "../../SDL_hints_c.h" #include "SDL_events.h" @@ -40,6 +41,8 @@ #include "idle-inhibit-unstable-v1-client-protocol.h" #include "xdg-activation-v1-client-protocol.h" #include "viewporter-client-protocol.h" +#include "fractional-scale-v1-client-protocol.h" +#include "xdg-toplevel-icon-v1-client-protocol.h" #ifdef HAVE_LIBDECOR_H #include @@ -47,25 +50,24 @@ #define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP) -SDL_FORCE_INLINE SDL_bool -FloatEqual(float a, float b) +SDL_FORCE_INLINE SDL_bool FloatEqual(float a, float b) { - const float diff = SDL_fabsf(a - b); + const float diff = SDL_fabsf(a - b); const float largest = SDL_max(SDL_fabsf(a), SDL_fabsf(b)); return diff <= largest * SDL_FLT_EPSILON; } -static void -GetFullScreenDimensions(SDL_Window *window, int *width, int *height, int *drawable_width, int *drawable_height) +static void GetFullScreenDimensions(SDL_Window *window, int *width, int *height, int *drawable_width, int *drawable_height) { - SDL_WindowData *wind = (SDL_WindowData *) window->driverdata; - SDL_WaylandOutputData *output = (SDL_WaylandOutputData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + SDL_WaylandOutputData *output = display ? (SDL_WaylandOutputData *)display->driverdata : NULL; int fs_width, fs_height; int buf_width, buf_height; - const int output_width = wind->fs_output_width ? wind->fs_output_width : output->width; - const int output_height = wind->fs_output_height ? wind->fs_output_height : output->height; + const int output_width = wind->fs_output_width ? wind->fs_output_width : (output ? output->width : wind->window_width); + const int output_height = wind->fs_output_height ? wind->fs_output_height : (output ? output->height : wind->window_height); /* * Fullscreen desktop mandates a desktop sized window, so that's what applications will get. @@ -73,15 +75,15 @@ GetFullScreenDimensions(SDL_Window *window, int *width, int *height, int *drawab * differently sized window and backbuffer spaces on its own. */ if ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) { - fs_width = output_width; + fs_width = output_width; fs_height = output_height; /* If the application is DPI aware, we can expose the true backbuffer size */ if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { - buf_width = output->native_width; + buf_width = output->native_width; buf_height = output->native_height; } else { - buf_width = fs_width; + buf_width = fs_width; buf_height = fs_height; } } else { @@ -90,17 +92,17 @@ GetFullScreenDimensions(SDL_Window *window, int *width, int *height, int *drawab * for DPI aware apps and the desktop size for legacy apps. */ if (window->fullscreen_mode.w != 0 && window->fullscreen_mode.h != 0) { - fs_width = window->fullscreen_mode.w; + fs_width = window->fullscreen_mode.w; fs_height = window->fullscreen_mode.h; } else if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { - fs_width = output->native_width; + fs_width = output->native_width; fs_height = output->native_height; } else { - fs_width = output_width; + fs_width = output_width; fs_height = output_height; } - buf_width = fs_width; + buf_width = fs_width; buf_height = fs_height; } @@ -118,70 +120,31 @@ GetFullScreenDimensions(SDL_Window *window, int *width, int *height, int *drawab } } -SDL_FORCE_INLINE SDL_bool -SurfaceScaleIsFractional(SDL_Window *window) -{ - SDL_WindowData *data = window->driverdata; - return !FloatEqual(SDL_roundf(data->scale_factor), data->scale_factor); -} - -SDL_FORCE_INLINE SDL_bool -FullscreenModeEmulation(SDL_Window *window) +SDL_FORCE_INLINE SDL_bool FullscreenModeEmulation(SDL_Window *window) { return (window->flags & SDL_WINDOW_FULLSCREEN) && ((window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != SDL_WINDOW_FULLSCREEN_DESKTOP); } -static SDL_bool -NeedViewport(SDL_Window *window) -{ - SDL_WindowData *wind = window->driverdata; - SDL_VideoData *video = wind->waylandData; - SDL_WaylandOutputData *output = ((SDL_WaylandOutputData *)SDL_GetDisplayForWindow(window)->driverdata); - int fs_width, fs_height; - - /* - * A viewport is only required when scaling is enabled and: - * - A fullscreen mode is being emulated and the mode does not match the logical desktop dimensions. - * - The desktop uses fractional scaling and the high-DPI flag is set. - */ - if (video->viewporter != NULL) { - if (FullscreenModeEmulation(window)) { - GetFullScreenDimensions(window, &fs_width, &fs_height, NULL, NULL); - if (fs_width != output->width || fs_height != output->height) { - return SDL_TRUE; - } - } else if (SurfaceScaleIsFractional(window) && (window->flags & SDL_WINDOW_ALLOW_HIGHDPI)) { - return SDL_TRUE; - } - } - - return SDL_FALSE; -} - -static void -GetBufferSize(SDL_Window *window, int *width, int *height) +static void GetBufferSize(SDL_Window *window, int *width, int *height) { SDL_WindowData *data = window->driverdata; - int buf_width; - int buf_height; + int buf_width; + int buf_height; if (FullscreenModeEmulation(window)) { GetFullScreenDimensions(window, NULL, NULL, &buf_width, &buf_height); - } else if (NeedViewport(window)) { + } else if (data->draw_viewport) { /* Round fractional backbuffer sizes halfway away from zero. */ - buf_width = (int)SDL_lroundf(window->w * data->scale_factor); + buf_width = (int)SDL_lroundf(window->w * data->scale_factor); buf_height = (int)SDL_lroundf(window->h * data->scale_factor); } else { - /* - * Integer scaled windowed or fullscreen with no viewport - * - * Round the scale factor up in the unlikely scenario of a compositor + /* Round the scale factor up in the unlikely scenario of a compositor * that supports fractional scaling, but not viewports. */ int scale_factor = (int)SDL_ceilf(data->scale_factor); - buf_width = window->w * scale_factor; + buf_width = window->w * scale_factor; buf_height = window->h * scale_factor; } @@ -193,44 +156,17 @@ GetBufferSize(SDL_Window *window, int *width, int *height) } } -static void -SetDrawSurfaceViewport(SDL_Window *window, int src_width, int src_height, int dst_width, int dst_height) -{ - SDL_WindowData *wind = window->driverdata; - SDL_VideoData *video = wind->waylandData; - - if (video->viewporter) { - if (wind->draw_viewport == NULL) { - wind->draw_viewport = wp_viewporter_get_viewport(video->viewporter, wind->surface); - } - - wp_viewport_set_source(wind->draw_viewport, wl_fixed_from_int(0), wl_fixed_from_int(0), wl_fixed_from_int(src_width), wl_fixed_from_int(src_height)); - wp_viewport_set_destination(wind->draw_viewport, dst_width, dst_height); - } -} - -static void -UnsetDrawSurfaceViewport(SDL_Window *window) -{ - SDL_WindowData *wind = window->driverdata; - - if (wind->draw_viewport) { - wp_viewport_destroy(wind->draw_viewport); - wind->draw_viewport = NULL; - } -} - -static void -ConfigureWindowGeometry(SDL_Window *window) +static void ConfigureWindowGeometry(SDL_Window *window) { - SDL_WindowData *data = window->driverdata; - SDL_VideoData *viddata = data->waylandData; - SDL_WaylandOutputData *output = (SDL_WaylandOutputData *)SDL_GetDisplayForWindow(window)->driverdata; - struct wl_region *region; - const int old_dw = data->drawable_width; - const int old_dh = data->drawable_height; - SDL_bool window_size_changed; - SDL_bool drawable_size_changed; + SDL_WindowData *data = window->driverdata; + SDL_VideoData *viddata = data->waylandData; + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); + SDL_WaylandOutputData *output = display ? (SDL_WaylandOutputData *)display->driverdata : NULL; + struct wl_region *region; + const int old_dw = data->drawable_width; + const int old_dh = data->drawable_height; + SDL_bool window_size_changed; + SDL_bool drawable_size_changed; /* Set the drawable backbuffer size. */ GetBufferSize(window, &data->drawable_width, &data->drawable_height); @@ -243,10 +179,10 @@ ConfigureWindowGeometry(SDL_Window *window) 0, 0); } - if (FullscreenModeEmulation(window) && NeedViewport(window)) { + if (FullscreenModeEmulation(window) && data->draw_viewport) { int fs_width, fs_height; - const int output_width = data->fs_output_width ? data->fs_output_width : output->width; - const int output_height = data->fs_output_height ? data->fs_output_height : output->height; + const int output_width = data->fs_output_width ? data->fs_output_width : (output ? output->width : data->window_width); + const int output_height = data->fs_output_height ? data->fs_output_height : (output ? output->height : data->window_height); window_size_changed = data->window_width != output_width || data->window_height != output_height; @@ -255,31 +191,33 @@ ConfigureWindowGeometry(SDL_Window *window) /* Set the buffer scale to 1 since a viewport will be used. */ wl_surface_set_buffer_scale(data->surface, 1); - SetDrawSurfaceViewport(window, data->drawable_width, data->drawable_height, - output_width, output_height); + wp_viewport_set_destination(data->draw_viewport, output_width, output_height); - data->window_width = output_width; + data->window_width = output_width; data->window_height = output_height; - data->pointer_scale_x = (float) fs_width / (float) output_width; - data->pointer_scale_y = (float) fs_height / (float) output_height; + data->pointer_scale_x = (float)fs_width / (float)output_width; + data->pointer_scale_y = (float)fs_height / (float)output_height; } } else { window_size_changed = data->window_width != window->w || data->window_height != window->h; if (window_size_changed || drawable_size_changed) { - if (NeedViewport(window)) { + if (data->draw_viewport) { wl_surface_set_buffer_scale(data->surface, 1); - SetDrawSurfaceViewport(window, data->drawable_width, data->drawable_height, window->w, window->h); + wp_viewport_set_destination(data->draw_viewport, window->w, window->h); } else { - UnsetDrawSurfaceViewport(window); - - /* Round to the next integer in case of a fractional value. */ - wl_surface_set_buffer_scale(data->surface, (int32_t) SDL_ceilf(data->scale_factor)); + if (!FullscreenModeEmulation(window)) { + /* Round to the next integer in case of a fractional value. */ + wl_surface_set_buffer_scale(data->surface, (int32_t)SDL_ceilf(data->scale_factor)); + } else { + wl_surface_set_buffer_scale(data->surface, 1); + } } - data->window_width = window->w; - data->window_height = window->h; + /* Clamp the physical window size to the system minimum required size. */ + data->window_width = SDL_max(window->w, data->system_min_required_width); + data->window_height = SDL_max(window->h, data->system_min_required_height); data->pointer_scale_x = 1.0f; data->pointer_scale_y = 1.0f; @@ -287,10 +225,19 @@ ConfigureWindowGeometry(SDL_Window *window) } /* - * The opaque and pointer confinement regions only need to be recalculated - * if the output size has changed. + * The surface geometry, opaque region and pointer confinement region only + * need to be recalculated if the output size has changed. */ if (window_size_changed) { + /* XXX: This is a hack and only set on the xdg-toplevel path when viewports + * aren't supported to avoid a potential protocol violation if a buffer + * with an old size is committed. + */ + if (!data->draw_viewport && data->shell_surface_type == WAYLAND_SURFACE_XDG_TOPLEVEL && + viddata->shell.xdg && data->shell_surface.xdg.surface) { + xdg_surface_set_window_geometry(data->shell_surface.xdg.surface, 0, 0, data->window_width, data->window_height); + } + if (!viddata->egl_transparency_enabled) { region = wl_compositor_create_region(viddata->compositor); wl_region_add(region, 0, 0, @@ -305,11 +252,10 @@ ConfigureWindowGeometry(SDL_Window *window) } } -static void -CommitLibdecorFrame(SDL_Window *window) +static void CommitLibdecorFrame(SDL_Window *window) { #ifdef HAVE_LIBDECOR_H - SDL_WindowData *wind = (SDL_WindowData *) window->driverdata; + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR && wind->shell_surface.libdecor.frame) { struct libdecor_state *state = libdecor_state_new(wind->window_width, wind->window_height); @@ -319,8 +265,7 @@ CommitLibdecorFrame(SDL_Window *window) #endif } -static void -SetMinMaxDimensions(SDL_Window *window, SDL_bool commit) +static void SetMinMaxDimensions(SDL_Window *window, SDL_bool commit) { SDL_WindowData *wind = window->driverdata; SDL_VideoData *viddata = wind->waylandData; @@ -354,7 +299,7 @@ SetMinMaxDimensions(SDL_Window *window, SDL_bool commit) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } libdecor_frame_set_min_content_size(wind->shell_surface.libdecor.frame, @@ -370,7 +315,7 @@ SetMinMaxDimensions(SDL_Window *window, SDL_bool commit) } } else #endif - if (viddata->shell.xdg) { + if (viddata->shell.xdg) { if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { return; /* Can't do anything yet, wait for ShowWindow */ } @@ -386,8 +331,7 @@ SetMinMaxDimensions(SDL_Window *window, SDL_bool commit) } } -static void -SetFullscreen(SDL_Window *window, struct wl_output *output) +static void SetFullscreen(SDL_Window *window, struct wl_output *output) { SDL_WindowData *wind = window->driverdata; SDL_VideoData *viddata = wind->waylandData; @@ -399,7 +343,7 @@ SetFullscreen(SDL_Window *window, struct wl_output *output) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } if (output) { @@ -429,7 +373,7 @@ SetFullscreen(SDL_Window *window, struct wl_output *output) } } else #endif - if (viddata->shell.xdg) { + if (viddata->shell.xdg) { if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { return; /* Can't do anything yet, wait for ShowWindow */ } @@ -444,10 +388,9 @@ SetFullscreen(SDL_Window *window, struct wl_output *output) } } -static void -UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) +static void UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) { - SDL_WindowData *wind = (SDL_WindowData*)window->driverdata; + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; if (fullscreen) { if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { @@ -493,8 +436,7 @@ UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) static const struct wl_callback_listener surface_damage_frame_listener; -static void -surface_damage_frame_done(void *data, struct wl_callback *cb, uint32_t time) +static void surface_damage_frame_done(void *data, struct wl_callback *cb, uint32_t time) { SDL_WindowData *wind = (SDL_WindowData *)data; @@ -521,11 +463,10 @@ static const struct wl_callback_listener surface_damage_frame_listener = { static const struct wl_callback_listener gles_swap_frame_listener; -static void -gles_swap_frame_done(void *data, struct wl_callback *cb, uint32_t time) +static void gles_swap_frame_done(void *data, struct wl_callback *cb, uint32_t time) { - SDL_WindowData *wind = (SDL_WindowData *) data; - SDL_AtomicSet(&wind->swap_interval_ready, 1); /* mark window as ready to present again. */ + SDL_WindowData *wind = (SDL_WindowData *)data; + SDL_AtomicSet(&wind->swap_interval_ready, 1); /* mark window as ready to present again. */ /* reset this callback to fire again once a new frame was presented and compositor wants the next one. */ wind->gles_swap_frame_callback = wl_surface_frame(wind->gles_swap_frame_surface_wrapper); @@ -537,11 +478,9 @@ static const struct wl_callback_listener gles_swap_frame_listener = { gles_swap_frame_done }; - static void Wayland_HandleResize(SDL_Window *window, int width, int height, float scale); -static void -handle_configure_xdg_shell_surface(void *data, struct xdg_surface *xdg, uint32_t serial) +static void handle_configure_xdg_shell_surface(void *data, struct xdg_surface *xdg, uint32_t serial) { SDL_WindowData *wind = (SDL_WindowData *)data; SDL_Window *window = wind->sdlwindow; @@ -556,22 +495,20 @@ static const struct xdg_surface_listener shell_surface_listener_xdg = { handle_configure_xdg_shell_surface }; -static void -handle_configure_xdg_toplevel(void *data, - struct xdg_toplevel *xdg_toplevel, - int32_t width, - int32_t height, - struct wl_array *states) +static void handle_configure_xdg_toplevel(void *data, + struct xdg_toplevel *xdg_toplevel, + int32_t width, + int32_t height, + struct wl_array *states) { SDL_WindowData *wind = (SDL_WindowData *)data; SDL_Window *window = wind->sdlwindow; - SDL_WaylandOutputData *driverdata; enum xdg_toplevel_state *state; SDL_bool fullscreen = SDL_FALSE; SDL_bool maximized = SDL_FALSE; SDL_bool floating = SDL_TRUE; - wl_array_for_each(state, states) { + wl_array_for_each (state, states) { switch (*state) { case XDG_TOPLEVEL_STATE_FULLSCREEN: fullscreen = SDL_TRUE; @@ -592,8 +529,6 @@ handle_configure_xdg_toplevel(void *data, } } - driverdata = (SDL_WaylandOutputData *) SDL_GetDisplayForWindow(window)->driverdata; - UpdateWindowFullscreen(window, fullscreen); if (!fullscreen) { @@ -603,12 +538,19 @@ handle_configure_xdg_toplevel(void *data, */ width = wind->floating_width; height = wind->floating_height; + + /* Clamp resizable windows to the toplevel bounds when mapping, if any were sent. */ + if ((window->flags & (SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE)) && + wind->toplevel_bounds_width && wind->toplevel_bounds_height) { + width = SDL_min(width, wind->toplevel_bounds_width); + height = SDL_min(height, wind->toplevel_bounds_height); + } } /* xdg_toplevel spec states that this is a suggestion. Ignore if less than or greater than max/min size. */ - if ((window->flags & SDL_WINDOW_RESIZABLE)) { + if (window->flags & SDL_WINDOW_RESIZABLE) { if (window->max_w > 0) { width = SDL_min(width, window->max_w); } @@ -632,9 +574,7 @@ handle_configure_xdg_toplevel(void *data, * No, we do not get minimize events from xdg-shell. */ SDL_SendWindowEvent(window, - maximized ? - SDL_WINDOWEVENT_MAXIMIZED : - SDL_WINDOWEVENT_RESTORED, + maximized ? SDL_WINDOWEVENT_MAXIMIZED : SDL_WINDOWEVENT_RESTORED, 0, 0); /* Store current floating dimensions for restoring */ @@ -672,49 +612,58 @@ handle_configure_xdg_toplevel(void *data, window->h = height; wind->needs_resize_event = SDL_TRUE; } - - /* This part is good though. */ - if ((window->flags & SDL_WINDOW_ALLOW_HIGHDPI) && !FloatEqual(wind->scale_factor, driverdata->scale_factor)) { - wind->scale_factor = driverdata->scale_factor; - wind->needs_resize_event = SDL_TRUE; - } } } -static void -handle_close_xdg_toplevel(void *data, struct xdg_toplevel *xdg_toplevel) +static void handle_close_xdg_toplevel(void *data, struct xdg_toplevel *xdg_toplevel) { SDL_WindowData *window = (SDL_WindowData *)data; SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0); } +static void handle_xdg_toplevel_configure_bounds(void *data, + struct xdg_toplevel *xdg_toplevel, + int32_t width, + int32_t height) +{ + SDL_WindowData *window = (SDL_WindowData *)data; + window->toplevel_bounds_width = width; + window->toplevel_bounds_height = height; +} + +static void handle_xdg_toplevel_wm_capabilities(void *data, + struct xdg_toplevel *xdg_toplevel, + struct wl_array *capabilities) +{ + /* NOP */ +} + static const struct xdg_toplevel_listener toplevel_listener_xdg = { handle_configure_xdg_toplevel, - handle_close_xdg_toplevel + handle_close_xdg_toplevel, + handle_xdg_toplevel_configure_bounds, + handle_xdg_toplevel_wm_capabilities }; -static void -handle_configure_xdg_popup(void *data, - struct xdg_popup *xdg_popup, - int32_t x, - int32_t y, - int32_t width, - int32_t height) +static void handle_configure_xdg_popup(void *data, + struct xdg_popup *xdg_popup, + int32_t x, + int32_t y, + int32_t width, + int32_t height) { /* No-op, we don't use x/y and width/height are fixed-size */ } -static void -handle_done_xdg_popup(void *data, struct xdg_popup *xdg_popup) +static void handle_done_xdg_popup(void *data, struct xdg_popup *xdg_popup) { SDL_WindowData *window = (SDL_WindowData *)data; SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0); } -static void -handle_repositioned_xdg_popup(void *data, - struct xdg_popup *xdg_popup, - uint32_t token) +static void handle_repositioned_xdg_popup(void *data, + struct xdg_popup *xdg_popup, + uint32_t token) { /* No-op, configure does all the work we care about */ } @@ -727,11 +676,10 @@ static const struct xdg_popup_listener popup_listener_xdg = { #define TOOLTIP_CURSOR_OFFSET 8 /* FIXME: Arbitrary, eyeballed from X tooltip */ -static int -Wayland_PopupWatch(void *data, SDL_Event *event) +static int Wayland_PopupWatch(void *data, SDL_Event *event) { if (event->type == SDL_MOUSEMOTION) { - SDL_Window *window = (SDL_Window *) data; + SDL_Window *window = (SDL_Window *)data; SDL_WindowData *wind = window->driverdata; /* Coordinates might be relative to the popup, which we don't want */ @@ -747,13 +695,12 @@ Wayland_PopupWatch(void *data, SDL_Event *event) return 1; } -static void -handle_configure_zxdg_decoration(void *data, - struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, - uint32_t mode) +static void handle_configure_zxdg_decoration(void *data, + struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, + uint32_t mode) { - SDL_Window *window = (SDL_Window *) data; - SDL_WindowData *driverdata = (SDL_WindowData *) window->driverdata; + SDL_Window *window = (SDL_Window *)data; + SDL_WindowData *driverdata = (SDL_WindowData *)window->driverdata; SDL_VideoDevice *device = SDL_GetVideoDevice(); /* If the compositor tries to force CSD anyway, bail on direct XDG support @@ -773,11 +720,10 @@ handle_configure_zxdg_decoration(void *data, WAYLAND_wl_display_roundtrip(driverdata->waylandData->display); Wayland_HideWindow(device, window); + SDL_zero(driverdata->shell_surface); driverdata->shell_surface_type = WAYLAND_SURFACE_LIBDECOR; - if (!window->is_hiding && !(window->flags & SDL_WINDOW_HIDDEN)) { - Wayland_ShowWindow(device, window); - } + Wayland_ShowWindow(device, window); } } @@ -786,19 +732,57 @@ static const struct zxdg_toplevel_decoration_v1_listener decoration_listener = { }; #ifdef HAVE_LIBDECOR_H -static void -decoration_frame_configure(struct libdecor_frame *frame, - struct libdecor_configuration *configuration, - void *user_data) +/* + * XXX: Hack for older versions of libdecor that lack the function to query the + * minimum content size limit. The internal limits must always be overridden + * to ensure that very small windows don't cause errors or crashes. + * + * On versions of libdecor that expose the function to get the minimum content + * size limit, this function is a no-op. + * + * Can be removed if the minimum required version of libdecor is raised + * to a version that guarantees the availability of this function. + */ +static void OverrideLibdecorLimits(SDL_Window *window) +{ +#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) + if (!libdecor_frame_get_min_content_size) { + SetMinMaxDimensions(window, SDL_FALSE); + } +#elif !defined(SDL_HAVE_LIBDECOR_GET_MIN_MAX) + SetMinMaxDimensions(window, SDL_FALSE); +#endif +} + +/* + * NOTE: Retrieves the minimum content size limits, if the function for doing so is available. + * On versions of libdecor that lack the minimum content size retrieval function, this + * function is a no-op. + * + * Can be replaced with a direct call if the minimum required version of libdecor is raised + * to a version that guarantees the availability of this function. + */ +static void LibdecorGetMinContentSize(struct libdecor_frame *frame, int *min_w, int *min_h) +{ +#if defined(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR) + if (libdecor_frame_get_min_content_size != NULL) { + libdecor_frame_get_min_content_size(frame, min_w, min_h); + } +#elif defined(SDL_HAVE_LIBDECOR_GET_MIN_MAX) + libdecor_frame_get_min_content_size(frame, min_w, min_h); +#endif +} + +static void decoration_frame_configure(struct libdecor_frame *frame, + struct libdecor_configuration *configuration, + void *user_data) { SDL_WindowData *wind = (SDL_WindowData *)user_data; SDL_Window *window = wind->sdlwindow; - SDL_WaylandOutputData *driverdata; struct libdecor_state *state; enum libdecor_window_state window_state; int width, height; - float scale_factor = wind->scale_factor; SDL_bool focused = SDL_FALSE; SDL_bool fullscreen = SDL_FALSE; @@ -806,10 +790,8 @@ decoration_frame_configure(struct libdecor_frame *frame, SDL_bool tiled = SDL_FALSE; SDL_bool floating; - static const enum libdecor_window_state tiled_states = ( - LIBDECOR_WINDOW_STATE_TILED_LEFT | LIBDECOR_WINDOW_STATE_TILED_RIGHT | - LIBDECOR_WINDOW_STATE_TILED_TOP | LIBDECOR_WINDOW_STATE_TILED_BOTTOM - ); + static const enum libdecor_window_state tiled_states = (LIBDECOR_WINDOW_STATE_TILED_LEFT | LIBDECOR_WINDOW_STATE_TILED_RIGHT | + LIBDECOR_WINDOW_STATE_TILED_TOP | LIBDECOR_WINDOW_STATE_TILED_BOTTOM); /* Window State */ if (libdecor_configuration_get_window_state(configuration, &window_state)) { @@ -820,8 +802,6 @@ decoration_frame_configure(struct libdecor_frame *frame, } floating = !(fullscreen || maximized || tiled); - driverdata = (SDL_WaylandOutputData *) SDL_GetDisplayForWindow(window)->driverdata; - UpdateWindowFullscreen(window, fullscreen); if (!fullscreen) { @@ -831,17 +811,13 @@ decoration_frame_configure(struct libdecor_frame *frame, * No, we do not get minimize events from libdecor. */ SDL_SendWindowEvent(window, - maximized ? - SDL_WINDOWEVENT_MAXIMIZED : - SDL_WINDOWEVENT_RESTORED, + maximized ? SDL_WINDOWEVENT_MAXIMIZED : SDL_WINDOWEVENT_RESTORED, 0, 0); } /* Similar to maximized/restore events above, send focus events too! */ SDL_SendWindowEvent(window, - focused ? - SDL_WINDOWEVENT_FOCUS_GAINED : - SDL_WINDOWEVENT_FOCUS_LOST, + focused ? SDL_WINDOWEVENT_FOCUS_GAINED : SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); /* For fullscreen or fixed-size windows we know our size. @@ -854,7 +830,7 @@ decoration_frame_configure(struct libdecor_frame *frame, * told to do this. */ if (libdecor_configuration_get_content_size(configuration, frame, - &width, &height)) { + &width, &height)) { wind->fs_output_width = width; wind->fs_output_height = height; } else { @@ -867,15 +843,12 @@ decoration_frame_configure(struct libdecor_frame *frame, if (FullscreenModeEmulation(window)) { GetFullScreenDimensions(window, &width, &height, NULL, NULL); } - - /* This part is good though. */ - if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { - scale_factor = driverdata->scale_factor; - } } else if (!(window->flags & SDL_WINDOW_RESIZABLE) || (floating && wind->floating_resize_pending)) { width = window->windowed.w; height = window->windowed.h; wind->floating_resize_pending = SDL_FALSE; + + OverrideLibdecorLimits(window); } else { /* * XXX: libdecor can send bogus content sizes that are +/- the height @@ -914,14 +887,18 @@ decoration_frame_configure(struct libdecor_frame *frame, wind->was_floating = floating; /* Do the resize on the SDL side (this will set window->w/h)... */ - Wayland_HandleResize(window, width, height, scale_factor); - wind->shell_surface.libdecor.initial_configure_seen = SDL_TRUE; + Wayland_HandleResize(window, width, height, wind->scale_factor); /* ... then commit the changes on the libdecor side. */ state = libdecor_state_new(wind->window_width, wind->window_height); libdecor_frame_commit(frame, state, configuration); libdecor_state_free(state); + if (!wind->shell_surface.libdecor.initial_configure_seen) { + LibdecorGetMinContentSize(frame, &wind->system_min_required_width, &wind->system_min_required_height); + wind->shell_surface.libdecor.initial_configure_seen = SDL_TRUE; + } + /* Update the resize capability. Since this will change the capabilities and * commit a new frame state with the last known content dimension, this has * to be called after the new state has been committed and the new content @@ -931,14 +908,12 @@ decoration_frame_configure(struct libdecor_frame *frame, window->flags & SDL_WINDOW_RESIZABLE); } -static void -decoration_frame_close(struct libdecor_frame *frame, void *user_data) +static void decoration_frame_close(struct libdecor_frame *frame, void *user_data) { SDL_SendWindowEvent(((SDL_WindowData *)user_data)->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0); } -static void -decoration_frame_commit(struct libdecor_frame *frame, void *user_data) +static void decoration_frame_commit(struct libdecor_frame *frame, void *user_data) { SDL_WindowData *wind = user_data; @@ -953,21 +928,18 @@ static struct libdecor_frame_interface libdecor_frame_interface = { #endif #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH -static void -handle_onscreen_visibility(void *data, - struct qt_extended_surface *qt_extended_surface, int32_t visible) +static void handle_onscreen_visibility(void *data, + struct qt_extended_surface *qt_extended_surface, int32_t visible) { } -static void -handle_set_generic_property(void *data, - struct qt_extended_surface *qt_extended_surface, const char *name, - struct wl_array *value) +static void handle_set_generic_property(void *data, + struct qt_extended_surface *qt_extended_surface, const char *name, + struct wl_array *value) { } -static void -handle_close(void *data, struct qt_extended_surface *qt_extended_surface) +static void handle_close(void *data, struct qt_extended_surface *qt_extended_surface) { SDL_WindowData *window = (SDL_WindowData *)data; SDL_SendWindowEvent(window->sdlwindow, SDL_WINDOWEVENT_CLOSE, 0, 0); @@ -980,10 +952,9 @@ static const struct qt_extended_surface_listener extended_surface_listener = { }; #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ -static void -update_scale_factor(SDL_WindowData *window) +static void update_scale_factor(SDL_WindowData *window) { - float old_factor = window->scale_factor; + const float old_factor = window->scale_factor; float new_factor; int i; @@ -992,19 +963,23 @@ update_scale_factor(SDL_WindowData *window) return; } - if (FULLSCREEN_VISIBLE(window->sdlwindow)) { + if (window->num_outputs == 0) { + /* No display connected, just fall back. */ + new_factor = old_factor; + } else if (FULLSCREEN_VISIBLE(window->sdlwindow)) { /* For fullscreen, use the active display's scale factor */ SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window->sdlwindow); - SDL_WaylandOutputData* driverdata = display->driverdata; - new_factor = driverdata->scale_factor; - } else if (window->num_outputs == 0) { - /* No monitor (somehow)? Just fall back. */ - new_factor = old_factor; + if (display) { + SDL_WaylandOutputData *driverdata = display->driverdata; + new_factor = driverdata->scale_factor; + } else { + new_factor = old_factor; + } } else { /* Check every display's factor, use the highest */ new_factor = 0.0f; for (i = 0; i < window->num_outputs; i++) { - SDL_WaylandOutputData* driverdata = window->outputs[i]; + SDL_WaylandOutputData *driverdata = window->outputs[i]; new_factor = SDL_max(new_factor, driverdata->scale_factor); } } @@ -1018,11 +993,10 @@ update_scale_factor(SDL_WindowData *window) * what monitor we're on, so let's send move events that put the window at the * center of the whatever display the wl_surface_listener events give us. */ -static void -Wayland_move_window(SDL_Window *window, - SDL_WaylandOutputData *driverdata) +static void Wayland_move_window(SDL_Window *window, + SDL_WaylandOutputData *driverdata) { - SDL_WindowData *wind = (SDL_WindowData*)window->driverdata; + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; SDL_VideoDisplay *display; SDL_bool fs_display_changed = SDL_FALSE; int i, j; @@ -1089,47 +1063,20 @@ Wayland_move_window(SDL_Window *window, } } -static void -handle_surface_enter(void *data, struct wl_surface *surface, - struct wl_output *output) -{ - SDL_WindowData *window = data; - SDL_WaylandOutputData *driverdata = wl_output_get_user_data(output); - - if (!SDL_WAYLAND_own_output(output) || !SDL_WAYLAND_own_surface(surface)) { - return; - } - - window->outputs = SDL_realloc(window->outputs, - sizeof(SDL_WaylandOutputData*) * (window->num_outputs + 1)); - window->outputs[window->num_outputs++] = driverdata; - - /* Update the scale factor after the move so that fullscreen outputs are updated. */ - Wayland_move_window(window->sdlwindow, driverdata); - update_scale_factor(window); -} - -static void -handle_surface_leave(void *data, struct wl_surface *surface, - struct wl_output *output) +void Wayland_RemoveOutputFromWindow(SDL_WindowData *window, struct wl_output *output) { - SDL_WindowData *window = data; int i, send_move_event = 0; SDL_WaylandOutputData *driverdata = wl_output_get_user_data(output); - if (!SDL_WAYLAND_own_output(output) || !SDL_WAYLAND_own_surface(surface)) { - return; - } - for (i = 0; i < window->num_outputs; i++) { - if (window->outputs[i] == driverdata) { /* remove this one */ - if (i == (window->num_outputs-1)) { + if (window->outputs[i] == driverdata) { /* remove this one */ + if (i == (window->num_outputs - 1)) { window->outputs[i] = NULL; send_move_event = 1; } else { SDL_memmove(&window->outputs[i], &window->outputs[i + 1], - sizeof(SDL_WaylandOutputData*) * ((window->num_outputs - i) - 1)); + sizeof(SDL_WaylandOutputData *) * ((window->num_outputs - i) - 1)); } window->num_outputs--; i--; @@ -1144,7 +1091,43 @@ handle_surface_leave(void *data, struct wl_surface *surface, window->outputs[window->num_outputs - 1]); } - update_scale_factor(window); + if (!window->fractional_scale) { + update_scale_factor(window); + } +} + +static void handle_surface_enter(void *data, struct wl_surface *surface, + struct wl_output *output) +{ + SDL_WindowData *window = data; + SDL_WaylandOutputData *driverdata = wl_output_get_user_data(output); + + if (!SDL_WAYLAND_own_output(output) || !SDL_WAYLAND_own_surface(surface)) { + return; + } + + window->outputs = SDL_realloc(window->outputs, + sizeof(SDL_WaylandOutputData *) * (window->num_outputs + 1)); + window->outputs[window->num_outputs++] = driverdata; + + /* Update the scale factor after the move so that fullscreen outputs are updated. */ + Wayland_move_window(window->sdlwindow, driverdata); + + if (!window->fractional_scale) { + update_scale_factor(window); + } +} + +static void handle_surface_leave(void *data, struct wl_surface *surface, + struct wl_output *output) +{ + SDL_WindowData *window = (SDL_WindowData *)data; + + if (!SDL_WAYLAND_own_output(output) || !SDL_WAYLAND_own_surface(surface)) { + return; + } + + Wayland_RemoveOutputFromWindow(window, output); } static const struct wl_surface_listener surface_listener = { @@ -1152,8 +1135,7 @@ static const struct wl_surface_listener surface_listener = { handle_surface_leave }; -static void -Wayland_FillEmptyShellInfo(SDL_SysWMinfo * info, const Uint32 version) +static void Wayland_FillEmptyShellInfo(SDL_SysWMinfo * info, const Uint32 version) { info->info.wl.xdg_surface = NULL; if (version >= SDL_VERSIONNUM(2, 0, 17)) { @@ -1165,8 +1147,7 @@ Wayland_FillEmptyShellInfo(SDL_SysWMinfo * info, const Uint32 version) } } -SDL_bool -Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; SDL_WindowData *data = (SDL_WindowData *) window->driverdata; @@ -1198,7 +1179,7 @@ Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) #ifdef HAVE_LIBDECOR_H if (data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (data->shell_surface.libdecor.frame != NULL) { + if (data->shell_surface.libdecor.frame) { info->info.wl.xdg_surface = libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame); if (version >= SDL_VERSIONNUM(2, 0, 17)) { info->info.wl.xdg_toplevel = libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame); @@ -1213,7 +1194,7 @@ Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) } } else #endif - if (viddata->shell.xdg && data->shell_surface.xdg.surface != NULL) { + if (viddata->shell.xdg && data->shell_surface.xdg.surface) { info->info.wl.xdg_surface = data->shell_surface.xdg.surface; if (version >= SDL_VERSIONNUM(2, 0, 17)) { SDL_bool popup = data->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP; @@ -1242,16 +1223,14 @@ Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) return SDL_TRUE; } -int -Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) +int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) { - return 0; /* just succeed, the real work is done elsewhere. */ + return 0; /* just succeed, the real work is done elsewhere. */ } -int -Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window) +int Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; SDL_WindowData *modal_data = modal_window->driverdata; SDL_WindowData *parent_data = parent_window->driverdata; @@ -1261,17 +1240,17 @@ Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_wi #ifdef HAVE_LIBDECOR_H if (viddata->shell.libdecor) { - if (modal_data->shell_surface.libdecor.frame == NULL) { + if (!modal_data->shell_surface.libdecor.frame) { return SDL_SetError("Modal window was hidden"); } - if (parent_data->shell_surface.libdecor.frame == NULL) { + if (!parent_data->shell_surface.libdecor.frame) { return SDL_SetError("Parent window was hidden"); } libdecor_frame_set_parent(modal_data->shell_surface.libdecor.frame, parent_data->shell_surface.libdecor.frame); } else #endif - if (viddata->shell.xdg) { + if (viddata->shell.xdg) { if (modal_data->shell_surface.xdg.roleobj.toplevel == NULL) { return SDL_SetError("Modal window was hidden"); } @@ -1313,25 +1292,25 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) /* Create the shell surface and map the toplevel/popup */ #ifdef HAVE_LIBDECOR_H if (data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (data->shell_surface.libdecor.frame) { - /* If the frame already exists, just set the visibility. */ - libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, true); - libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname); + data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor, + data->surface, + &libdecor_frame_interface, + data); + if (!data->shell_surface.libdecor.frame) { + SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!"); } else { - data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor, - data->surface, - &libdecor_frame_interface, - data); - if (data->shell_surface.libdecor.frame == NULL) { - SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!"); - } else { - libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname); - libdecor_frame_map(data->shell_surface.libdecor.frame); + libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname); + libdecor_frame_map(data->shell_surface.libdecor.frame); + + if (c->xdg_toplevel_icon_manager_v1 && data->xdg_toplevel_icon_v1) { + xdg_toplevel_icon_manager_v1_set_icon(c->xdg_toplevel_icon_manager_v1, + libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame), + data->xdg_toplevel_icon_v1); } } } else #endif - if (c->shell.xdg) { + if (c->shell.xdg) { data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface); xdg_surface_set_user_data(data->shell_surface.xdg.surface, data); xdg_surface_add_listener(data->shell_surface.xdg.surface, &shell_surface_listener_xdg, data); @@ -1371,6 +1350,14 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) data->shell_surface.xdg.roleobj.toplevel = xdg_surface_get_toplevel(data->shell_surface.xdg.surface); xdg_toplevel_set_app_id(data->shell_surface.xdg.roleobj.toplevel, c->classname); xdg_toplevel_add_listener(data->shell_surface.xdg.roleobj.toplevel, &toplevel_listener_xdg, data); + + if (c->xdg_toplevel_icon_manager_v1 && data->xdg_toplevel_icon_v1) { + xdg_toplevel_icon_manager_v1_set_icon(c->xdg_toplevel_icon_manager_v1, + data->shell_surface.xdg.roleobj.toplevel, + data->xdg_toplevel_icon_v1); + } + + SetMinMaxDimensions(window, SDL_FALSE); } } @@ -1396,7 +1383,13 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) } } else #endif - if (c->shell.xdg) { + if (c->shell.xdg) { + /* Create the window decorations */ + if (data->shell_surface_type != WAYLAND_SURFACE_XDG_POPUP && data->shell_surface.xdg.roleobj.toplevel && c->decoration_manager) { + data->server_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(c->decoration_manager, data->shell_surface.xdg.roleobj.toplevel); + zxdg_toplevel_decoration_v1_add_listener(data->server_decoration, &decoration_listener, window); + } + /* Unlike libdecor we need to call this explicitly to prevent a deadlock. * libdecor will call this as part of their configure event! * -flibit @@ -1408,14 +1401,6 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) WAYLAND_wl_display_dispatch(c->display); } } - - /* Create the window decorations */ - if (data->shell_surface_type != WAYLAND_SURFACE_XDG_POPUP && data->shell_surface.xdg.roleobj.toplevel && c->decoration_manager) { - data->server_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(c->decoration_manager, data->shell_surface.xdg.roleobj.toplevel); - zxdg_toplevel_decoration_v1_add_listener(data->server_decoration, - &decoration_listener, - window); - } } else { /* Nothing to see here, just commit. */ wl_surface_commit(data->surface); @@ -1433,6 +1418,20 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) if (data->shell_surface.libdecor.frame && window->flags & SDL_WINDOW_BORDERLESS) { Wayland_SetWindowBordered(_this, window, SDL_FALSE); } + + /* Libdecor plugins can enforce minimum window sizes, so adjust if the initial window size is too small. */ + if (window->windowed.w < data->system_min_required_width || + window->windowed.h < data->system_min_required_height) { + + /* Warn if the window frame will be larger than the content surface. */ + SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, + "Window dimensions (%i, %i) are smaller than the system enforced minimum (%i, %i); window borders will be larger than the content surface.", + window->windowed.w, window->windowed.h, data->system_min_required_width, data->system_min_required_height); + + data->window_width = SDL_max(window->windowed.w, data->system_min_required_width); + data->window_height = SDL_max(window->windowed.h, data->system_min_required_height); + CommitLibdecorFrame(window); + } } else #endif { @@ -1460,19 +1459,21 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window) * HideWindow was called immediately before ShowWindow. */ WAYLAND_wl_display_roundtrip(c->display); + + /* Send an exposure event to signal that the client should draw. */ + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_EXPOSED, 0, 0); } -static void -Wayland_ReleasePopup(_THIS, SDL_Window *popup) +static void Wayland_ReleasePopup(_THIS, SDL_Window *popup) { SDL_WindowData *popupdata; /* Basic sanity checks to weed out the weird popup closures */ - if (popup == NULL || popup->magic != &_this->window_magic) { + if (!popup || popup->magic != &_this->window_magic) { return; } popupdata = popup->driverdata; - if (popupdata == NULL) { + if (!popupdata) { return; } @@ -1504,8 +1505,8 @@ void Wayland_HideWindow(_THIS, SDL_Window *window) SDL_WindowData *wind = window->driverdata; if (wind->server_decoration) { - zxdg_toplevel_decoration_v1_destroy(wind->server_decoration); - wind->server_decoration = NULL; + zxdg_toplevel_decoration_v1_destroy(wind->server_decoration); + wind->server_decoration = NULL; } /* Be sure to detach after this is done, otherwise ShowWindow crashes! */ @@ -1515,12 +1516,12 @@ void Wayland_HideWindow(_THIS, SDL_Window *window) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { if (wind->shell_surface.libdecor.frame) { - libdecor_frame_set_visibility(wind->shell_surface.libdecor.frame, false); - libdecor_frame_set_app_id(wind->shell_surface.libdecor.frame, data->classname); + libdecor_frame_unref(wind->shell_surface.libdecor.frame); + wind->shell_surface.libdecor.frame = NULL; } } else #endif - if (data->shell.xdg) { + if (data->shell.xdg) { if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { Wayland_ReleasePopup(_this, window); } else if (wind->shell_surface.xdg.roleobj.toplevel) { @@ -1540,10 +1541,9 @@ void Wayland_HideWindow(_THIS, SDL_Window *window) WAYLAND_wl_display_roundtrip(data->display); } -static void -handle_xdg_activation_done(void *data, - struct xdg_activation_token_v1 *xdg_activation_token_v1, - const char *token) +static void handle_xdg_activation_done(void *data, + struct xdg_activation_token_v1 *xdg_activation_token_v1, + const char *token) { SDL_WindowData *window = data; if (xdg_activation_token_v1 == window->activation_token) { @@ -1579,13 +1579,12 @@ static const struct xdg_activation_token_v1_listener activation_listener_xdg = { * * -flibit */ -static void -Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *wind, - struct wl_surface *surface, - uint32_t serial, struct wl_seat *seat) +static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *wind, + struct wl_surface *surface, + uint32_t serial, struct wl_seat *seat) { if (data->activation_manager) { - if (wind->activation_token != NULL) { + if (wind->activation_token) { /* We're about to overwrite this with a new request */ xdg_activation_token_v1_destroy(wind->activation_token); } @@ -1602,18 +1601,17 @@ Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *wind, * * -flibit */ - if (surface != NULL) { + if (surface) { xdg_activation_token_v1_set_surface(wind->activation_token, surface); } - if (seat != NULL) { + if (seat) { xdg_activation_token_v1_set_serial(wind->activation_token, serial, seat); } xdg_activation_token_v1_commit(wind->activation_token); } } -void -Wayland_RaiseWindow(_THIS, SDL_Window *window) +void Wayland_RaiseWindow(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; @@ -1630,8 +1628,7 @@ Wayland_RaiseWindow(_THIS, SDL_Window *window) NULL); } -int -Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) +int Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) { Wayland_activate_window(_this->driverdata, window->driverdata, @@ -1641,15 +1638,37 @@ Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) return 0; } +void handle_preferred_scale_changed(void *data, + struct wp_fractional_scale_v1 *wp_fractional_scale_v1, + uint preferred_scale) +{ + SDL_WindowData *window = data; + float old_factor = window->scale_factor; + float new_factor = preferred_scale / 120.; /* 120 is a magic number defined in the spec as a common denominator*/ + + if (!(window->sdlwindow->flags & SDL_WINDOW_ALLOW_HIGHDPI)) { + /* Scale will always be 1, just ignore this */ + return; + } + + if (!FloatEqual(new_factor, old_factor)) { + Wayland_HandleResize(window->sdlwindow, window->sdlwindow->w, window->sdlwindow->h, new_factor); + } +} + +static const struct wp_fractional_scale_v1_listener fractional_scale_listener = { + handle_preferred_scale_changed +}; + #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH -static void SDLCALL -QtExtendedSurface_OnHintChanged(void *userdata, const char *name, - const char *oldValue, const char *newValue) +static void SDLCALL QtExtendedSurface_OnHintChanged(void *userdata, const char *name, + const char *oldValue, const char *newValue) { struct qt_extended_surface *qt_extended_surface = userdata; int i; - static struct { + static struct + { const char *name; int32_t value; } orientations[] = { @@ -1659,18 +1678,20 @@ QtExtendedSurface_OnHintChanged(void *userdata, const char *name, { "inverted-landscape", QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION } }; - if (name == NULL) { + if (!name) { return; } if (SDL_strcmp(name, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION) == 0) { int32_t orientation = QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION; - if (newValue != NULL) { + if (newValue) { const char *value_attempt = newValue; - while (value_attempt != NULL && *value_attempt != 0) { + + orientation = 0; + while (value_attempt && *value_attempt != 0) { const char *value_attempt_end = SDL_strchr(value_attempt, ','); - size_t value_attempt_len = (value_attempt_end != NULL) ? (value_attempt_end - value_attempt) + size_t value_attempt_len = (value_attempt_end) ? (value_attempt_end - value_attempt) : SDL_strlen(value_attempt); for (i = 0; i < SDL_arraysize(orientations); i += 1) { @@ -1681,7 +1702,7 @@ QtExtendedSurface_OnHintChanged(void *userdata, const char *name, } } - value_attempt = (value_attempt_end != NULL) ? (value_attempt_end + 1) : NULL; + value_attempt = (value_attempt_end) ? (value_attempt_end + 1) : NULL; } } @@ -1689,7 +1710,7 @@ QtExtendedSurface_OnHintChanged(void *userdata, const char *name, } else if (SDL_strcmp(name, SDL_HINT_QTWAYLAND_WINDOW_FLAGS) == 0) { uint32_t flags = 0; - if (newValue != NULL) { + if (newValue) { char *tmp = SDL_strdup(newValue); char *saveptr = NULL; @@ -1725,13 +1746,12 @@ static void QtExtendedSurface_Unsubscribe(struct qt_extended_surface *surface, c } #endif /* SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH */ -void -Wayland_SetWindowFullscreen(_THIS, SDL_Window * window, - SDL_VideoDisplay * _display, SDL_bool fullscreen) +void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, + SDL_VideoDisplay *_display, SDL_bool fullscreen) { - SDL_WindowData *wind = (SDL_WindowData*) window->driverdata; - struct wl_output *output = ((SDL_WaylandOutputData*) _display->driverdata)->output; - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; + struct wl_output *output = ((SDL_WaylandOutputData *)_display->driverdata)->output; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; /* Called from within a configure event or the window is a popup, drop it. */ if (wind->in_fullscreen_transition || wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { @@ -1764,11 +1784,10 @@ Wayland_SetWindowFullscreen(_THIS, SDL_Window * window, } } -void -Wayland_RestoreWindow(_THIS, SDL_Window * window) +void Wayland_RestoreWindow(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { return; @@ -1781,28 +1800,27 @@ Wayland_RestoreWindow(_THIS, SDL_Window * window) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } libdecor_frame_unset_maximized(wind->shell_surface.libdecor.frame); } else #endif - /* Note that xdg-shell does NOT provide a way to unset minimize! */ - if (viddata->shell.xdg) { - if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { - return; /* Can't do anything yet, wait for ShowWindow */ + /* Note that xdg-shell does NOT provide a way to unset minimize! */ + if (viddata->shell.xdg) { + if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { + return; /* Can't do anything yet, wait for ShowWindow */ + } + xdg_toplevel_unset_maximized(wind->shell_surface.xdg.roleobj.toplevel); } - xdg_toplevel_unset_maximized(wind->shell_surface.xdg.roleobj.toplevel); - } - WAYLAND_wl_display_flush( viddata->display ); + WAYLAND_wl_display_roundtrip(viddata->display); } -void -Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +void Wayland_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) { SDL_WindowData *wind = window->driverdata; - const SDL_VideoData *viddata = (const SDL_VideoData *) _this->driverdata; + const SDL_VideoData *viddata = (const SDL_VideoData *)_this->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { return; @@ -1815,20 +1833,19 @@ Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) } } else #endif - if ((viddata->decoration_manager) && (wind->server_decoration)) { + if ((viddata->decoration_manager) && (wind->server_decoration)) { const enum zxdg_toplevel_decoration_v1_mode mode = bordered ? ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE : ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE; zxdg_toplevel_decoration_v1_set_mode(wind->server_decoration, mode); } } -void -Wayland_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) +void Wayland_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) { #ifdef HAVE_LIBDECOR_H const SDL_WindowData *wind = window->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } if (resizable) { @@ -1843,11 +1860,10 @@ Wayland_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) } } -void -Wayland_MaximizeWindow(_THIS, SDL_Window * window) +void Wayland_MaximizeWindow(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { return; @@ -1864,27 +1880,26 @@ Wayland_MaximizeWindow(_THIS, SDL_Window * window) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } libdecor_frame_set_maximized(wind->shell_surface.libdecor.frame); } else #endif - if (viddata->shell.xdg) { + if (viddata->shell.xdg) { if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { return; /* Can't do anything yet, wait for ShowWindow */ } xdg_toplevel_set_maximized(wind->shell_surface.xdg.roleobj.toplevel); } - WAYLAND_wl_display_flush(viddata->display); + WAYLAND_wl_display_roundtrip(viddata->display); } -void -Wayland_MinimizeWindow(_THIS, SDL_Window * window) +void Wayland_MinimizeWindow(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { return; @@ -1892,13 +1907,13 @@ Wayland_MinimizeWindow(_THIS, SDL_Window * window) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } libdecor_frame_set_minimized(wind->shell_surface.libdecor.frame); } else #endif - if (viddata->shell.xdg) { + if (viddata->shell.xdg) { if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { return; /* Can't do anything yet, wait for ShowWindow */ } @@ -1908,10 +1923,9 @@ Wayland_MinimizeWindow(_THIS, SDL_Window * window) WAYLAND_wl_display_flush(viddata->display); } -void -Wayland_SetWindowMouseRect(_THIS, SDL_Window *window) +void Wayland_SetWindowMouseRect(_THIS, SDL_Window *window) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; /* This may look suspiciously like SetWindowGrab, despite SetMouseRect not * implicitly doing a grab. And you're right! Wayland doesn't let us mess @@ -1928,10 +1942,9 @@ Wayland_SetWindowMouseRect(_THIS, SDL_Window *window) } } -void -Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (grabbed) { Wayland_input_confine_pointer(data->input, window); @@ -1940,10 +1953,9 @@ Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) } } -void -Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) +void Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (grabbed) { Wayland_input_grab_keyboard(window, data->input); @@ -1957,20 +1969,14 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) SDL_WindowData *data; SDL_VideoData *c; - data = SDL_calloc(1, sizeof *data); - if (data == NULL) + data = SDL_calloc(1, sizeof(*data)); + if (!data) { return SDL_OutOfMemory(); + } c = _this->driverdata; window->driverdata = data; - if (!(window->flags & SDL_WINDOW_VULKAN)) { - if (!(window->flags & SDL_WINDOW_OPENGL)) { - SDL_GL_LoadLibrary(NULL); - window->flags |= SDL_WINDOW_OPENGL; - } - } - if (window->x == SDL_WINDOWPOS_UNDEFINED) { window->x = 0; } @@ -1985,12 +1991,17 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { int i; - for (i=0; i < SDL_GetVideoDevice()->num_displays; i++) { - float scale = ((SDL_WaylandOutputData*)SDL_GetVideoDevice()->displays[i].driverdata)->scale_factor; + for (i = 0; i < SDL_GetVideoDevice()->num_displays; i++) { + float scale = ((SDL_WaylandOutputData *)SDL_GetVideoDevice()->displays[i].driverdata)->scale_factor; data->scale_factor = SDL_max(data->scale_factor, scale); } } + data->double_buffer = SDL_FALSE; + if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) { + data->double_buffer = SDL_TRUE; + } + data->outputs = NULL; data->num_outputs = 0; @@ -2003,6 +2014,13 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) SDL_WAYLAND_register_surface(data->surface); + if (c->viewporter) { + data->draw_viewport = wp_viewporter_get_viewport(c->viewporter, data->surface); + wp_viewport_set_source(data->draw_viewport, + wl_fixed_from_int(-1), wl_fixed_from_int(-1), + wl_fixed_from_int(-1), wl_fixed_from_int(-1)); + } + /* Must be called before EGL configuration to set the drawable backbuffer size. */ ConfigureWindowGeometry(window); @@ -2026,7 +2044,7 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH if (c->surface_extension) { data->extended_surface = qt_surface_extension_get_extended_surface( - c->surface_extension, data->surface); + c->surface_extension, data->surface); QtExtendedSurface_Subscribe(data->extended_surface, SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION); QtExtendedSurface_Subscribe(data->extended_surface, SDL_HINT_QTWAYLAND_WINDOW_FLAGS); @@ -2036,12 +2054,12 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) if (window->flags & SDL_WINDOW_OPENGL) { data->egl_window = WAYLAND_wl_egl_window_create(data->surface, data->drawable_width, data->drawable_height); -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Create the GLES window surface */ - data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) data->egl_window); + data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)data->egl_window); if (data->egl_surface == EGL_NO_SURFACE) { - return -1; /* SDL_EGL_CreateSurface should have set error */ + return -1; /* SDL_EGL_CreateSurface should have set error */ } #endif } @@ -2058,36 +2076,40 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) Wayland_input_lock_pointer(c->input); } + if (c->fractional_scale_manager) { + data->fractional_scale = wp_fractional_scale_manager_v1_get_fractional_scale(c->fractional_scale_manager, data->surface); + wp_fractional_scale_v1_add_listener(data->fractional_scale, + &fractional_scale_listener, data); + } + /* Moved this call to ShowWindow: wl_surface_commit(data->surface); */ WAYLAND_wl_display_flush(c->display); /* We may need to create an idle inhibitor for this new window */ Wayland_SuspendScreenSaver(_this); - #define IS_POPUP(window) \ - (window->flags & (SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU)) +#define IS_POPUP(window) \ + (window->flags & (SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU)) #ifdef HAVE_LIBDECOR_H if (c->shell.libdecor && !IS_POPUP(window)) { data->shell_surface_type = WAYLAND_SURFACE_LIBDECOR; } else #endif - if (c->shell.xdg) { + if (c->shell.xdg) { if (IS_POPUP(window)) { data->shell_surface_type = WAYLAND_SURFACE_XDG_POPUP; } else { data->shell_surface_type = WAYLAND_SURFACE_XDG_TOPLEVEL; } } /* All other cases will be WAYLAND_SURFACE_UNKNOWN */ - #undef IS_POPUP +#undef IS_POPUP return 0; } - -static void -Wayland_HandleResize(SDL_Window *window, int width, int height, float scale) +static void Wayland_HandleResize(SDL_Window *window, int width, int height, float scale) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; const int old_w = window->w, old_h = window->h; const int old_drawable_width = data->drawable_width; const int old_drawable_height = data->drawable_height; @@ -2106,36 +2128,38 @@ Wayland_HandleResize(SDL_Window *window, int width, int height, float scale) window->w = 0; window->h = 0; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_EXPOSED, 0, 0); window->w = width; window->h = height; data->needs_resize_event = SDL_FALSE; } } -void -Wayland_SetWindowMinimumSize(_THIS, SDL_Window * window) +void Wayland_SetWindowMinimumSize(_THIS, SDL_Window *window) { SetMinMaxDimensions(window, SDL_TRUE); } -void -Wayland_SetWindowMaximumSize(_THIS, SDL_Window * window) +void Wayland_SetWindowMaximumSize(_THIS, SDL_Window *window) { SetMinMaxDimensions(window, SDL_TRUE); } -void Wayland_SetWindowSize(_THIS, SDL_Window * window) +void Wayland_SetWindowSize(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; #ifdef HAVE_LIBDECOR_H /* we must not resize the window while we have a static (non-floating) size */ - if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR && - wind->shell_surface.libdecor.frame && - !libdecor_frame_is_floating(wind->shell_surface.libdecor.frame)) { + if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { + if (wind->shell_surface.libdecor.frame && + !libdecor_frame_is_floating(wind->shell_surface.libdecor.frame)) { /* Commit the resize when we re-enter floating state */ wind->floating_resize_pending = SDL_TRUE; return; + } + + OverrideLibdecorLimits(window); } #endif @@ -2148,17 +2172,17 @@ void Wayland_SetWindowSize(_THIS, SDL_Window * window) wind->floating_height = window->windowed.h; } -void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) +void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) { SDL_WindowData *data; if (window->driverdata) { - data = (SDL_WindowData *) window->driverdata; + data = (SDL_WindowData *)window->driverdata; *w = data->drawable_width; *h = data->drawable_height; } } -void Wayland_SetWindowTitle(_THIS, SDL_Window * window) +void Wayland_SetWindowTitle(_THIS, SDL_Window *window) { SDL_WindowData *wind = window->driverdata; SDL_VideoData *viddata = _this->driverdata; @@ -2170,7 +2194,7 @@ void Wayland_SetWindowTitle(_THIS, SDL_Window * window) #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { - if (wind->shell_surface.libdecor.frame == NULL) { + if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } libdecor_frame_set_title(wind->shell_surface.libdecor.frame, title); @@ -2186,12 +2210,51 @@ void Wayland_SetWindowTitle(_THIS, SDL_Window * window) WAYLAND_wl_display_flush(viddata->display); } -void -Wayland_SuspendScreenSaver(_THIS) +void Wayland_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) +{ + SDL_WindowData *wind = window->driverdata; + SDL_VideoData *viddata = _this->driverdata; + struct xdg_toplevel *toplevel = NULL; + + if (!viddata->xdg_toplevel_icon_manager_v1) { + SDL_SetError("wayland: cannot set icon; xdg_toplevel_icon_v1 protocol not supported"); + return; + } + if (icon->w != icon->h) { + SDL_SetError("wayland: icon width and height must be equal, got %ix%i", icon->w, icon->h); + return; + } + if (wind->xdg_toplevel_icon_v1) { + xdg_toplevel_icon_v1_destroy(wind->xdg_toplevel_icon_v1); + wind->xdg_toplevel_icon_v1 = NULL; + } + + Wayland_ReleaseSHMBuffer(&wind->icon); + if (Wayland_AllocSHMBuffer(icon->w, icon->h, &wind->icon) != 0) { + SDL_SetError("wayland: failed to allocate SHM buffer for the icon"); + return; + } + SDL_PremultiplyAlpha(icon->w, icon->h, icon->format->format, icon->pixels, icon->pitch, SDL_PIXELFORMAT_ARGB8888, wind->icon.shm_data, icon->w * 4); + wind->xdg_toplevel_icon_v1 = xdg_toplevel_icon_manager_v1_create_icon(viddata->xdg_toplevel_icon_manager_v1); + xdg_toplevel_icon_v1_add_buffer(wind->xdg_toplevel_icon_v1, wind->icon.wl_buffer, 1); +#ifdef HAVE_LIBDECOR_H + if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR && wind->shell_surface.libdecor.frame) { + toplevel = libdecor_frame_get_xdg_toplevel(wind->shell_surface.libdecor.frame); + } else +#endif + if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_TOPLEVEL && wind->shell_surface.xdg.roleobj.toplevel) { + toplevel = wind->shell_surface.xdg.roleobj.toplevel; + } + if (toplevel) { + xdg_toplevel_icon_manager_v1_set_icon(viddata->xdg_toplevel_icon_manager_v1, toplevel, wind->xdg_toplevel_icon_v1); + } +} + +void Wayland_SuspendScreenSaver(_THIS) { SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) { return; } @@ -2230,7 +2293,7 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window) SDL_WindowData *wind = window->driverdata; if (data) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (wind->egl_surface) { SDL_EGL_DestroySurface(_this, wind->egl_surface); } @@ -2251,12 +2314,22 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window) wp_viewport_destroy(wind->draw_viewport); } + if (wind->fractional_scale) { + wp_fractional_scale_v1_destroy(wind->fractional_scale); + } + + if (wind->xdg_toplevel_icon_v1) { + xdg_toplevel_icon_v1_destroy(wind->xdg_toplevel_icon_v1); + } + + Wayland_ReleaseSHMBuffer(&wind->icon); + SDL_free(wind->outputs); if (wind->gles_swap_frame_callback) { - WAYLAND_wl_event_queue_destroy(wind->gles_swap_frame_event_queue); - WAYLAND_wl_proxy_wrapper_destroy(wind->gles_swap_frame_surface_wrapper); wl_callback_destroy(wind->gles_swap_frame_callback); + WAYLAND_wl_proxy_wrapper_destroy(wind->gles_swap_frame_surface_wrapper); + WAYLAND_wl_event_queue_destroy(wind->gles_swap_frame_event_queue); } if (wind->surface_damage_frame_callback) { @@ -2278,23 +2351,22 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window) window->driverdata = NULL; } -static void -EGLTransparencyChangedCallback(void *userdata, const char *name, const char *oldValue, const char *newValue) +static void EGLTransparencyChangedCallback(void *userdata, const char *name, const char *oldValue, const char *newValue) { const SDL_bool oldval = SDL_GetStringBoolean(oldValue, SDL_FALSE); const SDL_bool newval = SDL_GetStringBoolean(newValue, SDL_FALSE); if (oldval != newval) { - SDL_Window *window; - SDL_VideoData *viddata = (SDL_VideoData *) userdata; - SDL_VideoDevice *dev = SDL_GetVideoDevice(); + SDL_Window *window; + SDL_VideoData *viddata = (SDL_VideoData *)userdata; + SDL_VideoDevice *dev = SDL_GetVideoDevice(); viddata->egl_transparency_enabled = newval; /* Iterate over all windows and update the surface opaque regions */ - for (window = dev->windows; window != NULL; window = window->next) { - SDL_WindowData *wind = (SDL_WindowData *) window->driverdata; - + for (window = dev->windows; window; window = window->next) { + SDL_WindowData *wind = (SDL_WindowData *)window->driverdata; + if (!newval) { struct wl_region *region = wl_compositor_create_region(wind->waylandData->compositor); wl_region_add(region, 0, 0, wind->window_width, wind->window_height); @@ -2307,15 +2379,13 @@ EGLTransparencyChangedCallback(void *userdata, const char *name, const char *old } } -void -Wayland_InitWin(SDL_VideoData *data) +void Wayland_InitWin(SDL_VideoData *data) { data->egl_transparency_enabled = SDL_GetHintBoolean(SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY, SDL_FALSE); SDL_AddHintCallback(SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY, EGLTransparencyChangedCallback, data); } -void -Wayland_QuitWin(SDL_VideoData *data) +void Wayland_QuitWin(SDL_VideoData *data) { SDL_DelHintCallback(SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY, EGLTransparencyChangedCallback, data); } diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index 6e270104877e8..618fd21cf181c 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,10 +29,12 @@ #include "../../events/SDL_touch_c.h" #include "SDL_waylandvideo.h" +#include "SDL_waylandshmbuffer.h" struct SDL_WaylandInput; -typedef struct { +typedef struct +{ SDL_Window *sdlwindow; SDL_VideoData *waylandData; struct wl_surface *surface; @@ -41,18 +43,23 @@ typedef struct { struct wl_surface *gles_swap_frame_surface_wrapper; struct wl_callback *surface_damage_frame_callback; - union { + union + { #ifdef HAVE_LIBDECOR_H - struct { + struct + { struct libdecor_frame *frame; SDL_bool initial_configure_seen; } libdecor; #endif - struct { + struct + { struct xdg_surface *surface; - union { + union + { struct xdg_toplevel *toplevel; - struct { + struct + { struct xdg_popup *popup; struct xdg_positioner *positioner; Uint32 parentID; @@ -62,7 +69,8 @@ typedef struct { SDL_bool initial_configure_seen; } xdg; } shell_surface; - enum { + enum + { WAYLAND_SURFACE_UNKNOWN = 0, WAYLAND_SURFACE_XDG_TOPLEVEL, WAYLAND_SURFACE_XDG_POPUP, @@ -71,7 +79,7 @@ typedef struct { struct wl_egl_window *egl_window; struct SDL_WaylandInput *keyboard_device; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif struct zwp_locked_pointer_v1 *locked_pointer; @@ -81,6 +89,10 @@ typedef struct { struct zwp_idle_inhibitor_v1 *idle_inhibitor; struct xdg_activation_token_v1 *activation_token; struct wp_viewport *draw_viewport; + struct wp_fractional_scale_v1 *fractional_scale; + struct xdg_toplevel_icon_v1 *xdg_toplevel_icon_v1; + + struct Wayland_SHMBuffer icon; /* floating dimensions for restoring from maximized and fullscreen */ int floating_width, floating_height; @@ -100,42 +112,49 @@ typedef struct { int drawable_width, drawable_height; int fs_output_width, fs_output_height; int window_width, window_height; + int system_min_required_width; + int system_min_required_height; + int toplevel_bounds_width; + int toplevel_bounds_height; SDL_bool needs_resize_event; SDL_bool floating_resize_pending; SDL_bool was_floating; SDL_bool is_fullscreen; SDL_bool in_fullscreen_transition; Uint32 fullscreen_flags; + SDL_bool double_buffer; } SDL_WindowData; extern void Wayland_ShowWindow(_THIS, SDL_Window *window); extern void Wayland_HideWindow(_THIS, SDL_Window *window); extern void Wayland_RaiseWindow(_THIS, SDL_Window *window); -extern void Wayland_SetWindowFullscreen(_THIS, SDL_Window * window, - SDL_VideoDisplay * _display, +extern void Wayland_SetWindowFullscreen(_THIS, SDL_Window *window, + SDL_VideoDisplay *_display, SDL_bool fullscreen); -extern void Wayland_MaximizeWindow(_THIS, SDL_Window * window); -extern void Wayland_MinimizeWindow(_THIS, SDL_Window * window); -extern void Wayland_SetWindowMouseRect(_THIS, SDL_Window * window); -extern void Wayland_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed); +extern void Wayland_MaximizeWindow(_THIS, SDL_Window *window); +extern void Wayland_MinimizeWindow(_THIS, SDL_Window *window); +extern void Wayland_SetWindowMouseRect(_THIS, SDL_Window *window); +extern void Wayland_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); extern void Wayland_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); -extern void Wayland_RestoreWindow(_THIS, SDL_Window * window); -extern void Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered); -extern void Wayland_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable); +extern void Wayland_RestoreWindow(_THIS, SDL_Window *window); +extern void Wayland_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); +extern void Wayland_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); extern int Wayland_CreateWindow(_THIS, SDL_Window *window); -extern void Wayland_SetWindowSize(_THIS, SDL_Window * window); -extern void Wayland_SetWindowMinimumSize(_THIS, SDL_Window * window); -extern void Wayland_SetWindowMaximumSize(_THIS, SDL_Window * window); -extern void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h); -extern int Wayland_SetWindowModalFor(_THIS, SDL_Window * modal_window, SDL_Window * parent_window); -extern void Wayland_SetWindowTitle(_THIS, SDL_Window * window); +extern void Wayland_SetWindowSize(_THIS, SDL_Window *window); +extern void Wayland_SetWindowMinimumSize(_THIS, SDL_Window *window); +extern void Wayland_SetWindowMaximumSize(_THIS, SDL_Window *window); +extern void Wayland_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); +extern int Wayland_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window); +extern void Wayland_SetWindowTitle(_THIS, SDL_Window *window); extern void Wayland_DestroyWindow(_THIS, SDL_Window *window); extern void Wayland_SuspendScreenSaver(_THIS); +extern void Wayland_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); extern SDL_bool Wayland_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info); extern int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); -extern int Wayland_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation); +extern int Wayland_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); +extern void Wayland_RemoveOutputFromWindow(SDL_WindowData *window, struct wl_output *output); extern void Wayland_InitWin(SDL_VideoData *data); extern void Wayland_QuitWin(SDL_VideoData *data); diff --git a/src/video/windows/SDL_msctf.h b/src/video/windows/SDL_msctf.h index 9fa80785d60ca..fbe02720cecc8 100644 --- a/src/video/windows/SDL_msctf.h +++ b/src/video/windows/SDL_msctf.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,9 +24,11 @@ #include -#define TF_INVALID_COOKIE (0xffffffff) -#define TF_IPSINK_FLAG_ACTIVE 0x0001 -#define TF_TMAE_UIELEMENTENABLEDONLY 0x00000004 +#define TF_INVALID_COOKIE (0xffffffff) +#define TF_IPSINK_FLAG_ACTIVE 0x0001 +#define TF_TMAE_UIELEMENTENABLEDONLY 0x00000004 + +/* *INDENT-OFF* */ /* clang-format off */ typedef struct ITfThreadMgr ITfThreadMgr; typedef struct ITfDocumentMgr ITfDocumentMgr; @@ -239,4 +241,6 @@ struct ITfSource const struct ITfSourceVtbl *lpVtbl; }; +/* *INDENT-ON* */ /* clang-format on */ + #endif /* SDL_msctf_h_ */ diff --git a/src/video/windows/SDL_vkeys.h b/src/video/windows/SDL_vkeys.h index 3b0c41929e3e0..2aaa9eff28c97 100644 --- a/src/video/windows/SDL_vkeys.h +++ b/src/video/windows/SDL_vkeys.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,57 +20,57 @@ */ #ifndef VK_0 -#define VK_0 '0' -#define VK_1 '1' -#define VK_2 '2' -#define VK_3 '3' -#define VK_4 '4' -#define VK_5 '5' -#define VK_6 '6' -#define VK_7 '7' -#define VK_8 '8' -#define VK_9 '9' -#define VK_A 'A' -#define VK_B 'B' -#define VK_C 'C' -#define VK_D 'D' -#define VK_E 'E' -#define VK_F 'F' -#define VK_G 'G' -#define VK_H 'H' -#define VK_I 'I' -#define VK_J 'J' -#define VK_K 'K' -#define VK_L 'L' -#define VK_M 'M' -#define VK_N 'N' -#define VK_O 'O' -#define VK_P 'P' -#define VK_Q 'Q' -#define VK_R 'R' -#define VK_S 'S' -#define VK_T 'T' -#define VK_U 'U' -#define VK_V 'V' -#define VK_W 'W' -#define VK_X 'X' -#define VK_Y 'Y' -#define VK_Z 'Z' +#define VK_0 '0' +#define VK_1 '1' +#define VK_2 '2' +#define VK_3 '3' +#define VK_4 '4' +#define VK_5 '5' +#define VK_6 '6' +#define VK_7 '7' +#define VK_8 '8' +#define VK_9 '9' +#define VK_A 'A' +#define VK_B 'B' +#define VK_C 'C' +#define VK_D 'D' +#define VK_E 'E' +#define VK_F 'F' +#define VK_G 'G' +#define VK_H 'H' +#define VK_I 'I' +#define VK_J 'J' +#define VK_K 'K' +#define VK_L 'L' +#define VK_M 'M' +#define VK_N 'N' +#define VK_O 'O' +#define VK_P 'P' +#define VK_Q 'Q' +#define VK_R 'R' +#define VK_S 'S' +#define VK_T 'T' +#define VK_U 'U' +#define VK_V 'V' +#define VK_W 'W' +#define VK_X 'X' +#define VK_Y 'Y' +#define VK_Z 'Z' #endif /* VK_0 */ /* These keys haven't been defined, but were experimentally determined */ -#define VK_SEMICOLON 0xBA -#define VK_EQUALS 0xBB -#define VK_COMMA 0xBC -#define VK_MINUS 0xBD -#define VK_PERIOD 0xBE -#define VK_SLASH 0xBF -#define VK_GRAVE 0xC0 -#define VK_LBRACKET 0xDB -#define VK_BACKSLASH 0xDC -#define VK_RBRACKET 0xDD -#define VK_APOSTROPHE 0xDE -#define VK_BACKTICK 0xDF -#define VK_OEM_102 0xE2 +#define VK_SEMICOLON 0xBA +#define VK_EQUALS 0xBB +#define VK_COMMA 0xBC +#define VK_MINUS 0xBD +#define VK_PERIOD 0xBE +#define VK_SLASH 0xBF +#define VK_GRAVE 0xC0 +#define VK_LBRACKET 0xDB +#define VK_BACKSLASH 0xDC +#define VK_RBRACKET 0xDD +#define VK_APOSTROPHE 0xDE +#define VK_BACKTICK 0xDF +#define VK_OEM_102 0xE2 /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_windowsclipboard.c b/src/video/windows/SDL_windowsclipboard.c index e961a2be4df59..29593d3692ee1 100644 --- a/src/video/windows/SDL_windowsclipboard.c +++ b/src/video/windows/SDL_windowsclipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,37 +20,34 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" #include "SDL_windowswindow.h" +#include "SDL_timer.h" #include "../../events/SDL_clipboardevents_c.h" - #ifdef UNICODE -#define TEXT_FORMAT CF_UNICODETEXT +#define TEXT_FORMAT CF_UNICODETEXT #else -#define TEXT_FORMAT CF_TEXT +#define TEXT_FORMAT CF_TEXT #endif - /* Get any application owned window handle for clipboard association */ -static HWND -GetWindowHandle(_THIS) +static HWND GetWindowHandle(_THIS) { SDL_Window *window; window = _this->windows; if (window) { - return ((SDL_WindowData *) window->driverdata)->hwnd; + return ((SDL_WindowData *)window->driverdata)->hwnd; } return NULL; } -int -WIN_SetClipboardText(_THIS, const char *text) +int WIN_SetClipboardText(_THIS, const char *text) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int result = 0; if (OpenClipboard(GetWindowHandle(_this))) { @@ -66,12 +63,12 @@ WIN_SetClipboardText(_THIS, const char *text) /* Find out the size of the data */ for (size = 0, i = 0; tstr[i]; ++i, ++size) { - if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) { + if (tstr[i] == '\n' && (i == 0 || tstr[i - 1] != '\r')) { /* We're going to insert a carriage return */ ++size; } } - size = (size+1)*sizeof(*tstr); + size = (size + 1) * sizeof(*tstr); /* Save the data to the clipboard */ hMem = GlobalAlloc(GMEM_MOVEABLE, size); @@ -80,7 +77,7 @@ WIN_SetClipboardText(_THIS, const char *text) if (dst) { /* Copy the text over, adding carriage returns as necessary */ for (i = 0; tstr[i]; ++i) { - if (tstr[i] == '\n' && (i == 0 || tstr[i-1] != '\r')) { + if (tstr[i] == '\n' && (i == 0 || tstr[i - 1] != '\r')) { *dst++ = '\r'; } *dst++ = tstr[i]; @@ -104,26 +101,33 @@ WIN_SetClipboardText(_THIS, const char *text) return result; } -char * -WIN_GetClipboardText(_THIS) +char *WIN_GetClipboardText(_THIS) { - char *text; - - text = NULL; - if (IsClipboardFormatAvailable(TEXT_FORMAT) && - OpenClipboard(GetWindowHandle(_this))) { - HANDLE hMem; - LPTSTR tstr; - - hMem = GetClipboardData(TEXT_FORMAT); - if (hMem) { - tstr = (LPTSTR)GlobalLock(hMem); - text = WIN_StringToUTF8(tstr); - GlobalUnlock(hMem); - } else { - WIN_SetError("Couldn't get clipboard data"); + char *text = NULL; + + if (IsClipboardFormatAvailable(TEXT_FORMAT)) { + /* Retry to open the clipboard in case another application has it open */ + const int MAX_ATTEMPTS = 3; + int attempt; + + for (attempt = 0; attempt < MAX_ATTEMPTS; ++attempt) { + if (OpenClipboard(GetWindowHandle(_this))) { + HANDLE hMem; + LPTSTR tstr; + + hMem = GetClipboardData(TEXT_FORMAT); + if (hMem) { + tstr = (LPTSTR)GlobalLock(hMem); + text = WIN_StringToUTF8(tstr); + GlobalUnlock(hMem); + } else { + WIN_SetError("Couldn't get clipboard data"); + } + CloseClipboard(); + break; + } + SDL_Delay(10); } - CloseClipboard(); } if (!text) { text = SDL_strdup(""); @@ -131,8 +135,7 @@ WIN_GetClipboardText(_THIS) return text; } -SDL_bool -WIN_HasClipboardText(_THIS) +SDL_bool WIN_HasClipboardText(_THIS) { SDL_bool result = SDL_FALSE; char *text = WIN_GetClipboardText(_this); @@ -143,8 +146,7 @@ WIN_HasClipboardText(_THIS) return result; } -void -WIN_CheckClipboardUpdate(struct SDL_VideoData * data) +void WIN_CheckClipboardUpdate(struct SDL_VideoData *data) { const DWORD count = GetClipboardSequenceNumber(); if (count != data->clipboard_count) { diff --git a/src/video/windows/SDL_windowsclipboard.h b/src/video/windows/SDL_windowsclipboard.h index 5cdcdfcab1126..66b3ae7e8ffc7 100644 --- a/src/video/windows/SDL_windowsclipboard.h +++ b/src/video/windows/SDL_windowsclipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ struct SDL_VideoData; extern int WIN_SetClipboardText(_THIS, const char *text); extern char *WIN_GetClipboardText(_THIS); extern SDL_bool WIN_HasClipboardText(_THIS); -extern void WIN_CheckClipboardUpdate(struct SDL_VideoData * data); +extern void WIN_CheckClipboardUpdate(struct SDL_VideoData *data); #endif /* SDL_windowsclipboard_h_ */ diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 7370f9e5ca8cd..bb45f122b16c3 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS #include "SDL_windowsvideo.h" #include "SDL_windowsshape.h" @@ -43,7 +43,7 @@ #include /* For WM_TABLET_QUERYSYSTEMGESTURESTATUS et. al. */ -#if HAVE_TPCSHRD_H +#ifdef HAVE_TPCSHRD_H #include #endif /* HAVE_TPCSHRD_H */ @@ -60,10 +60,10 @@ /* #define HIGHDPI_DEBUG */ /* Masks for processing the windows KEYDOWN and KEYUP messages */ -#define REPEATED_KEYMASK (1<<30) -#define EXTENDED_KEYMASK (1<<24) +#define REPEATED_KEYMASK (1 << 30) +#define EXTENDED_KEYMASK (1 << 24) -#define VK_ENTER 10 /* Keypad Enter ... no VKEY defined? */ +#define VK_ENTER 10 /* Keypad Enter ... no VKEY defined? */ #ifndef VK_OEM_NEC_EQUAL #define VK_OEM_NEC_EQUAL 0x92 #endif @@ -99,89 +99,150 @@ #ifndef WM_GETDPISCALEDSIZE #define WM_GETDPISCALEDSIZE 0x02E4 #endif +#ifndef TOUCHEVENTF_PEN +#define TOUCHEVENTF_PEN 0x0040 +#endif #ifndef IS_HIGH_SURROGATE -#define IS_HIGH_SURROGATE(x) (((x) >= 0xd800) && ((x) <= 0xdbff)) +#define IS_HIGH_SURROGATE(x) (((x) >= 0xd800) && ((x) <= 0xdbff)) #endif #ifndef IS_LOW_SURROGATE -#define IS_LOW_SURROGATE(x) (((x) >= 0xdc00) && ((x) <= 0xdfff)) +#define IS_LOW_SURROGATE(x) (((x) >= 0xdc00) && ((x) <= 0xdfff)) #endif #ifndef IS_SURROGATE_PAIR -#define IS_SURROGATE_PAIR(h,l) (IS_HIGH_SURROGATE(h) && IS_LOW_SURROGATE(l)) +#define IS_SURROGATE_PAIR(h, l) (IS_HIGH_SURROGATE(h) && IS_LOW_SURROGATE(l)) +#endif + +#ifndef USER_TIMER_MINIMUM +#define USER_TIMER_MINIMUM 0x0000000A #endif -static SDL_Scancode -VKeytoScancodeFallback(WPARAM vkey) +static SDL_Scancode VKeytoScancodeFallback(WPARAM vkey) { switch (vkey) { - case VK_LEFT: return SDL_SCANCODE_LEFT; - case VK_UP: return SDL_SCANCODE_UP; - case VK_RIGHT: return SDL_SCANCODE_RIGHT; - case VK_DOWN: return SDL_SCANCODE_DOWN; + case VK_LEFT: + return SDL_SCANCODE_LEFT; + case VK_UP: + return SDL_SCANCODE_UP; + case VK_RIGHT: + return SDL_SCANCODE_RIGHT; + case VK_DOWN: + return SDL_SCANCODE_DOWN; + case VK_CONTROL: + return SDL_SCANCODE_LCTRL; + case VK_V: + return SDL_SCANCODE_V; - default: return SDL_SCANCODE_UNKNOWN; + default: + return SDL_SCANCODE_UNKNOWN; } } -static SDL_Scancode -VKeytoScancode(WPARAM vkey) +static SDL_Scancode VKeytoScancode(WPARAM vkey) { switch (vkey) { - case VK_MODECHANGE: return SDL_SCANCODE_MODE; - case VK_SELECT: return SDL_SCANCODE_SELECT; - case VK_EXECUTE: return SDL_SCANCODE_EXECUTE; - case VK_HELP: return SDL_SCANCODE_HELP; - case VK_PAUSE: return SDL_SCANCODE_PAUSE; - case VK_NUMLOCK: return SDL_SCANCODE_NUMLOCKCLEAR; - - case VK_F13: return SDL_SCANCODE_F13; - case VK_F14: return SDL_SCANCODE_F14; - case VK_F15: return SDL_SCANCODE_F15; - case VK_F16: return SDL_SCANCODE_F16; - case VK_F17: return SDL_SCANCODE_F17; - case VK_F18: return SDL_SCANCODE_F18; - case VK_F19: return SDL_SCANCODE_F19; - case VK_F20: return SDL_SCANCODE_F20; - case VK_F21: return SDL_SCANCODE_F21; - case VK_F22: return SDL_SCANCODE_F22; - case VK_F23: return SDL_SCANCODE_F23; - case VK_F24: return SDL_SCANCODE_F24; - - case VK_OEM_NEC_EQUAL: return SDL_SCANCODE_KP_EQUALS; - case VK_BROWSER_BACK: return SDL_SCANCODE_AC_BACK; - case VK_BROWSER_FORWARD: return SDL_SCANCODE_AC_FORWARD; - case VK_BROWSER_REFRESH: return SDL_SCANCODE_AC_REFRESH; - case VK_BROWSER_STOP: return SDL_SCANCODE_AC_STOP; - case VK_BROWSER_SEARCH: return SDL_SCANCODE_AC_SEARCH; - case VK_BROWSER_FAVORITES: return SDL_SCANCODE_AC_BOOKMARKS; - case VK_BROWSER_HOME: return SDL_SCANCODE_AC_HOME; - case VK_VOLUME_MUTE: return SDL_SCANCODE_AUDIOMUTE; - case VK_VOLUME_DOWN: return SDL_SCANCODE_VOLUMEDOWN; - case VK_VOLUME_UP: return SDL_SCANCODE_VOLUMEUP; - - case VK_MEDIA_NEXT_TRACK: return SDL_SCANCODE_AUDIONEXT; - case VK_MEDIA_PREV_TRACK: return SDL_SCANCODE_AUDIOPREV; - case VK_MEDIA_STOP: return SDL_SCANCODE_AUDIOSTOP; - case VK_MEDIA_PLAY_PAUSE: return SDL_SCANCODE_AUDIOPLAY; - case VK_LAUNCH_MAIL: return SDL_SCANCODE_MAIL; - case VK_LAUNCH_MEDIA_SELECT: return SDL_SCANCODE_MEDIASELECT; - - case VK_OEM_102: return SDL_SCANCODE_NONUSBACKSLASH; - - case VK_ATTN: return SDL_SCANCODE_SYSREQ; - case VK_CRSEL: return SDL_SCANCODE_CRSEL; - case VK_EXSEL: return SDL_SCANCODE_EXSEL; - case VK_OEM_CLEAR: return SDL_SCANCODE_CLEAR; - - case VK_LAUNCH_APP1: return SDL_SCANCODE_APP1; - case VK_LAUNCH_APP2: return SDL_SCANCODE_APP2; - - default: return SDL_SCANCODE_UNKNOWN; + case VK_BACK: + return SDL_SCANCODE_BACKSPACE; + case VK_CAPITAL: + return SDL_SCANCODE_CAPSLOCK; + + case VK_MODECHANGE: + return SDL_SCANCODE_MODE; + case VK_SELECT: + return SDL_SCANCODE_SELECT; + case VK_EXECUTE: + return SDL_SCANCODE_EXECUTE; + case VK_HELP: + return SDL_SCANCODE_HELP; + case VK_PAUSE: + return SDL_SCANCODE_PAUSE; + case VK_NUMLOCK: + return SDL_SCANCODE_NUMLOCKCLEAR; + + case VK_F13: + return SDL_SCANCODE_F13; + case VK_F14: + return SDL_SCANCODE_F14; + case VK_F15: + return SDL_SCANCODE_F15; + case VK_F16: + return SDL_SCANCODE_F16; + case VK_F17: + return SDL_SCANCODE_F17; + case VK_F18: + return SDL_SCANCODE_F18; + case VK_F19: + return SDL_SCANCODE_F19; + case VK_F20: + return SDL_SCANCODE_F20; + case VK_F21: + return SDL_SCANCODE_F21; + case VK_F22: + return SDL_SCANCODE_F22; + case VK_F23: + return SDL_SCANCODE_F23; + case VK_F24: + return SDL_SCANCODE_F24; + + case VK_OEM_NEC_EQUAL: + return SDL_SCANCODE_KP_EQUALS; + case VK_BROWSER_BACK: + return SDL_SCANCODE_AC_BACK; + case VK_BROWSER_FORWARD: + return SDL_SCANCODE_AC_FORWARD; + case VK_BROWSER_REFRESH: + return SDL_SCANCODE_AC_REFRESH; + case VK_BROWSER_STOP: + return SDL_SCANCODE_AC_STOP; + case VK_BROWSER_SEARCH: + return SDL_SCANCODE_AC_SEARCH; + case VK_BROWSER_FAVORITES: + return SDL_SCANCODE_AC_BOOKMARKS; + case VK_BROWSER_HOME: + return SDL_SCANCODE_AC_HOME; + case VK_VOLUME_MUTE: + return SDL_SCANCODE_MUTE; + case VK_VOLUME_DOWN: + return SDL_SCANCODE_VOLUMEDOWN; + case VK_VOLUME_UP: + return SDL_SCANCODE_VOLUMEUP; + + case VK_MEDIA_NEXT_TRACK: + return SDL_SCANCODE_AUDIONEXT; + case VK_MEDIA_PREV_TRACK: + return SDL_SCANCODE_AUDIOPREV; + case VK_MEDIA_STOP: + return SDL_SCANCODE_AUDIOSTOP; + case VK_MEDIA_PLAY_PAUSE: + return SDL_SCANCODE_AUDIOPLAY; + case VK_LAUNCH_MAIL: + return SDL_SCANCODE_MAIL; + case VK_LAUNCH_MEDIA_SELECT: + return SDL_SCANCODE_MEDIASELECT; + + case VK_OEM_102: + return SDL_SCANCODE_NONUSBACKSLASH; + + case VK_ATTN: + return SDL_SCANCODE_SYSREQ; + case VK_CRSEL: + return SDL_SCANCODE_CRSEL; + case VK_EXSEL: + return SDL_SCANCODE_EXSEL; + case VK_OEM_CLEAR: + return SDL_SCANCODE_CLEAR; + + case VK_LAUNCH_APP1: + return SDL_SCANCODE_APP1; + case VK_LAUNCH_APP2: + return SDL_SCANCODE_APP2; + + default: + return SDL_SCANCODE_UNKNOWN; } } -static SDL_Scancode -WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam) +static SDL_Scancode WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam) { SDL_Scancode code; int nScanCode = (lParam >> 16) & 0xFF; @@ -257,7 +318,10 @@ WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam) * value set, however we cannot simply map these in VKeytoScancode() or we will be * incorrectly handling the arrow keys on the number pad when NumLock is disabled * (which also generate VK_LEFT, VK_RIGHT, etc in that scenario). Instead, we'll only - * map them if none of the above special number pad mappings applied. */ + * map them if none of the above special number pad mappings applied. + * + * WIN+V (clipboard history feature) can also send Ctrl-V without a scancode value set. + */ if (code == SDL_SCANCODE_UNKNOWN) { code = VKeytoScancodeFallback(wParam); } @@ -266,20 +330,17 @@ WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam) } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -static SDL_bool -WIN_ShouldIgnoreFocusClick() +static SDL_bool WIN_ShouldIgnoreFocusClick(void) { return !SDL_GetHintBoolean(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, SDL_FALSE); } -static void -WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, Uint32 mouseFlags, SDL_bool bSwapButtons, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID) +static void WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, Uint32 mouseFlags, SDL_bool bSwapButtons, SDL_WindowData *data, Uint8 button, SDL_MouseID mouseID) { if (bSwapButtons) { if (button == SDL_BUTTON_LEFT) { button = SDL_BUTTON_RIGHT; - } - else if (button == SDL_BUTTON_RIGHT) { + } else if (button == SDL_BUTTON_RIGHT) { button = SDL_BUTTON_LEFT; } } @@ -303,11 +364,10 @@ WIN_CheckWParamMouseButton(SDL_bool bwParamMousePressed, Uint32 mouseFlags, SDL_ } /* -* Some windows systems fail to send a WM_LBUTTONDOWN sometimes, but each mouse move contains the current button state also -* so this function reconciles our view of the world with the current buttons reported by windows -*/ -static void -WIN_CheckWParamMouseButtons(WPARAM wParam, SDL_WindowData *data, SDL_MouseID mouseID) + * Some windows systems fail to send a WM_LBUTTONDOWN sometimes, but each mouse move contains the current button state also + * so this function reconciles our view of the world with the current buttons reported by windows + */ +static void WIN_CheckWParamMouseButtons(WPARAM wParam, SDL_WindowData *data, SDL_MouseID mouseID) { if (wParam != data->mouse_button_flags) { Uint32 mouseFlags = SDL_GetMouseState(NULL, NULL); @@ -323,8 +383,7 @@ WIN_CheckWParamMouseButtons(WPARAM wParam, SDL_WindowData *data, SDL_MouseID mou } } -static void -WIN_CheckRawMouseButtons(ULONG rawButtons, SDL_WindowData *data, SDL_MouseID mouseID) +static void WIN_CheckRawMouseButtons(HANDLE hDevice, ULONG rawButtons, SDL_WindowData *data, SDL_MouseID mouseID) { // Add a flag to distinguish raw mouse buttons from wParam above rawButtons |= 0x8000000; @@ -332,32 +391,45 @@ WIN_CheckRawMouseButtons(ULONG rawButtons, SDL_WindowData *data, SDL_MouseID mou if (rawButtons != data->mouse_button_flags) { Uint32 mouseFlags = SDL_GetMouseState(NULL, NULL); SDL_bool swapButtons = GetSystemMetrics(SM_SWAPBUTTON) != 0; - if ((rawButtons & RI_MOUSE_BUTTON_1_DOWN)) + if (swapButtons && hDevice == NULL) { + /* Touchpad, already has buttons swapped */ + swapButtons = SDL_FALSE; + } + if (rawButtons & RI_MOUSE_BUTTON_1_DOWN) { WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_1_DOWN), mouseFlags, swapButtons, data, SDL_BUTTON_LEFT, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_1_UP)) + } + if (rawButtons & RI_MOUSE_BUTTON_1_UP) { WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_1_UP), mouseFlags, swapButtons, data, SDL_BUTTON_LEFT, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_2_DOWN)) + } + if (rawButtons & RI_MOUSE_BUTTON_2_DOWN) { WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_2_DOWN), mouseFlags, swapButtons, data, SDL_BUTTON_RIGHT, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_2_UP)) + } + if (rawButtons & RI_MOUSE_BUTTON_2_UP) { WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_2_UP), mouseFlags, swapButtons, data, SDL_BUTTON_RIGHT, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_3_DOWN)) + } + if (rawButtons & RI_MOUSE_BUTTON_3_DOWN) { WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_3_DOWN), mouseFlags, swapButtons, data, SDL_BUTTON_MIDDLE, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_3_UP)) + } + if (rawButtons & RI_MOUSE_BUTTON_3_UP) { WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_3_UP), mouseFlags, swapButtons, data, SDL_BUTTON_MIDDLE, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_4_DOWN)) + } + if (rawButtons & RI_MOUSE_BUTTON_4_DOWN) { WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_4_DOWN), mouseFlags, swapButtons, data, SDL_BUTTON_X1, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_4_UP)) + } + if (rawButtons & RI_MOUSE_BUTTON_4_UP) { WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_4_UP), mouseFlags, swapButtons, data, SDL_BUTTON_X1, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_5_DOWN)) + } + if (rawButtons & RI_MOUSE_BUTTON_5_DOWN) { WIN_CheckWParamMouseButton((rawButtons & RI_MOUSE_BUTTON_5_DOWN), mouseFlags, swapButtons, data, SDL_BUTTON_X2, mouseID); - if ((rawButtons & RI_MOUSE_BUTTON_5_UP)) + } + if (rawButtons & RI_MOUSE_BUTTON_5_UP) { WIN_CheckWParamMouseButton(!(rawButtons & RI_MOUSE_BUTTON_5_UP), mouseFlags, swapButtons, data, SDL_BUTTON_X2, mouseID); + } data->mouse_button_flags = rawButtons; } } -static void -WIN_CheckAsyncMouseRelease(SDL_WindowData *data) +static void WIN_CheckAsyncMouseRelease(SDL_WindowData *data) { Uint32 mouseFlags; SHORT keyState; @@ -392,10 +464,9 @@ WIN_CheckAsyncMouseRelease(SDL_WindowData *data) data->mouse_button_flags = (WPARAM)-1; } -static void -WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus) +static void WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; SDL_bool had_focus = (SDL_GetKeyboardFocus() == window) ? SDL_TRUE : SDL_FALSE; SDL_bool has_focus = (GetForegroundWindow() == hwnd) ? SDL_TRUE : SDL_FALSE; @@ -445,9 +516,9 @@ WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus) */ WIN_CheckClipboardUpdate(data->videodata); - SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0); - SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0); - SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) != 0); + SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) ? SDL_TRUE : SDL_FALSE); WIN_UpdateWindowICCProfile(data->window, SDL_TRUE); } else { @@ -472,26 +543,25 @@ WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus) } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -static BOOL -WIN_ConvertUTF32toUTF8(UINT32 codepoint, char * text) +static BOOL WIN_ConvertUTF32toUTF8(UINT32 codepoint, char *text) { if (codepoint <= 0x7F) { - text[0] = (char) codepoint; + text[0] = (char)codepoint; text[1] = '\0'; } else if (codepoint <= 0x7FF) { - text[0] = 0xC0 | (char) ((codepoint >> 6) & 0x1F); - text[1] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xC0 | (char)((codepoint >> 6) & 0x1F); + text[1] = 0x80 | (char)(codepoint & 0x3F); text[2] = '\0'; } else if (codepoint <= 0xFFFF) { - text[0] = 0xE0 | (char) ((codepoint >> 12) & 0x0F); - text[1] = 0x80 | (char) ((codepoint >> 6) & 0x3F); - text[2] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xE0 | (char)((codepoint >> 12) & 0x0F); + text[1] = 0x80 | (char)((codepoint >> 6) & 0x3F); + text[2] = 0x80 | (char)(codepoint & 0x3F); text[3] = '\0'; } else if (codepoint <= 0x10FFFF) { - text[0] = 0xF0 | (char) ((codepoint >> 18) & 0x0F); - text[1] = 0x80 | (char) ((codepoint >> 12) & 0x3F); - text[2] = 0x80 | (char) ((codepoint >> 6) & 0x3F); - text[3] = 0x80 | (char) (codepoint & 0x3F); + text[0] = 0xF0 | (char)((codepoint >> 18) & 0x0F); + text[1] = 0x80 | (char)((codepoint >> 12) & 0x3F); + text[2] = 0x80 | (char)((codepoint >> 6) & 0x3F); + text[3] = 0x80 | (char)(codepoint & 0x3F); text[4] = '\0'; } else { return SDL_FALSE; @@ -499,25 +569,23 @@ WIN_ConvertUTF32toUTF8(UINT32 codepoint, char * text) return SDL_TRUE; } -static BOOL -WIN_ConvertUTF16toUTF8(UINT32 high_surrogate, UINT32 low_surrogate, char * text) +static BOOL WIN_ConvertUTF16toUTF8(UINT32 high_surrogate, UINT32 low_surrogate, char *text) { const UINT32 SURROGATE_OFFSET = 0x10000 - (0xD800 << 10) - 0xDC00; const UINT32 codepoint = (high_surrogate << 10) + low_surrogate + SURROGATE_OFFSET; return WIN_ConvertUTF32toUTF8(codepoint, text); } -static SDL_bool -ShouldGenerateWindowCloseOnAltF4(void) +static SDL_bool ShouldGenerateWindowCloseOnAltF4(void) { return !SDL_GetHintBoolean(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, SDL_FALSE); } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* We want to generate mouse events from mouse and pen, and touch events from touchscreens */ -#define MI_WP_SIGNATURE 0xFF515700 -#define MI_WP_SIGNATURE_MASK 0xFFFFFF00 -#define IsTouchEvent(dw) ((dw) & MI_WP_SIGNATURE_MASK) == MI_WP_SIGNATURE +#define MI_WP_SIGNATURE 0xFF515700 +#define MI_WP_SIGNATURE_MASK 0xFFFFFF00 +#define IsTouchEvent(dw) ((dw)&MI_WP_SIGNATURE_MASK) == MI_WP_SIGNATURE typedef enum { @@ -527,7 +595,7 @@ typedef enum SDL_MOUSE_EVENT_SOURCE_PEN, } SDL_MOUSE_EVENT_SOURCE; -static SDL_MOUSE_EVENT_SOURCE GetMouseMessageSource() +static SDL_MOUSE_EVENT_SOURCE GetMouseMessageSource(void) { LPARAM extrainfo = GetMessageExtraInfo(); /* Mouse data (ignoring synthetic mouse events generated for touchscreens) */ @@ -546,8 +614,7 @@ static SDL_MOUSE_EVENT_SOURCE GetMouseMessageSource() } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -static SDL_WindowData * -WIN_GetWindowDataFromHWND(HWND hwnd) +static SDL_WindowData *WIN_GetWindowDataFromHWND(HWND hwnd) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; @@ -567,14 +634,19 @@ WIN_GetWindowDataFromHWND(HWND hwnd) LRESULT CALLBACK WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) { - KBDLLHOOKSTRUCT* hookData = (KBDLLHOOKSTRUCT*)lParam; - SDL_VideoData* data = SDL_GetVideoDevice()->driverdata; + KBDLLHOOKSTRUCT *hookData = (KBDLLHOOKSTRUCT *)lParam; + SDL_VideoData *data = SDL_GetVideoDevice()->driverdata; SDL_Scancode scanCode; if (nCode < 0 || nCode != HC_ACTION) { return CallNextHookEx(NULL, nCode, wParam, lParam); } + if (hookData->scanCode == 0x21d) { + /* Skip fake LCtrl when RAlt is pressed */ + return 1; + } + switch (hookData->vkCode) { case VK_LWIN: scanCode = SDL_SCANCODE_LGUI; @@ -628,9 +700,44 @@ WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ + +/* Return SDL_TRUE if spurious LCtrl is pressed. LCtrl is sent when RAltGR is pressed. */ +static SDL_bool SkipAltGrLeftControl(WPARAM wParam, LPARAM lParam) +{ + MSG next_msg; + DWORD msg_time; + + if (wParam != VK_CONTROL) { + return SDL_FALSE; + } + + /* Is this an extended key (i.e. right key)? */ + if (lParam & 0x01000000) { + return SDL_FALSE; + } + +#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + /* Here is a trick: "Alt Gr" sends LCTRL, then RALT. We only + want the RALT message, so we try to see if the next message + is a RALT message. In that case, this is a false LCTRL! */ + msg_time = GetMessageTime(); + if (PeekMessage(&next_msg, NULL, 0, 0, PM_NOREMOVE)) { + if (next_msg.message == WM_KEYDOWN || + next_msg.message == WM_SYSKEYDOWN) { + if (next_msg.wParam == VK_MENU && (next_msg.lParam & 0x01000000) && next_msg.time == msg_time) { + /* Next message is a RALT down message, which means that this is NOT a proper LCTRL message! */ + return SDL_TRUE; + } + } + } +#endif // !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + return SDL_FALSE; +} + LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { + static SDL_bool s_ModalMoveResizeLoop; SDL_WindowData *data; LRESULT returnCode = -1; @@ -652,7 +759,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) if (!data) { /* Fallback */ - data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData")); + data = (SDL_WindowData *)GetProp(hwnd, TEXT("SDL_WindowData")); } #endif if (!data) { @@ -672,93 +779,88 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) #endif /* WMMSG_DEBUG */ #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata)) + if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata)) { return 0; + } #endif switch (msg) { case WM_SHOWWINDOW: - { - if (wParam) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0); - } else { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0); - } + { + if (wParam) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0); + } else { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0); } - break; + } break; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) case WM_NCACTIVATE: - { - /* Don't immediately clip the cursor in case we're clicking minimize/maximize buttons */ - data->skip_update_clipcursor = SDL_TRUE; + { + /* Don't immediately clip the cursor in case we're clicking minimize/maximize buttons */ + data->skip_update_clipcursor = SDL_TRUE; - /* Update the focus here, since it's possible to get WM_ACTIVATE and WM_SETFOCUS without - actually being the foreground window, but this appears to get called in all cases where - the global foreground window changes to and from this window. */ - WIN_UpdateFocus(data->window, !!wParam); - } - break; + /* Update the focus here, since it's possible to get WM_ACTIVATE and WM_SETFOCUS without + actually being the foreground window, but this appears to get called in all cases where + the global foreground window changes to and from this window. */ + WIN_UpdateFocus(data->window, !!wParam); + } break; case WM_ACTIVATE: - { - /* Update the focus in case we changed focus to a child window and then away from the application */ - WIN_UpdateFocus(data->window, !!LOWORD(wParam)); - } - break; + { + /* Update the focus in case we changed focus to a child window and then away from the application */ + WIN_UpdateFocus(data->window, !!LOWORD(wParam)); + } break; case WM_SETFOCUS: - { - /* Update the focus in case it's changing between top-level windows in the same application */ - WIN_UpdateFocus(data->window, SDL_TRUE); - } - break; + { + /* Update the focus in case it's changing between top-level windows in the same application */ + WIN_UpdateFocus(data->window, SDL_TRUE); + } break; case WM_KILLFOCUS: case WM_ENTERIDLE: - { - /* Update the focus in case it's changing between top-level windows in the same application */ - WIN_UpdateFocus(data->window, SDL_FALSE); - } - break; + { + /* Update the focus in case it's changing between top-level windows in the same application */ + WIN_UpdateFocus(data->window, SDL_FALSE); + } break; case WM_POINTERUPDATE: - { - data->last_pointer_update = lParam; - break; - } + { + data->last_pointer_update = lParam; + break; + } case WM_MOUSEMOVE: - { - SDL_Mouse *mouse = SDL_GetMouse(); + { + SDL_Mouse *mouse = SDL_GetMouse(); - if (!data->mouse_tracked) { - TRACKMOUSEEVENT trackMouseEvent; + if (!data->mouse_tracked) { + TRACKMOUSEEVENT trackMouseEvent; - trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); - trackMouseEvent.dwFlags = TME_LEAVE; - trackMouseEvent.hwndTrack = data->hwnd; + trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT); + trackMouseEvent.dwFlags = TME_LEAVE; + trackMouseEvent.hwndTrack = data->hwnd; - if (TrackMouseEvent(&trackMouseEvent)) { - data->mouse_tracked = SDL_TRUE; - } + if (TrackMouseEvent(&trackMouseEvent)) { + data->mouse_tracked = SDL_TRUE; } + } - if (!mouse->relative_mode || mouse->relative_mode_warp) { - /* Only generate mouse events for real mouse */ - if (GetMouseMessageSource() != SDL_MOUSE_EVENT_SOURCE_TOUCH && - lParam != data->last_pointer_update) { - int x = GET_X_LPARAM(lParam); - int y = GET_Y_LPARAM(lParam); + if (!mouse->relative_mode || mouse->relative_mode_warp) { + /* Only generate mouse events for real mouse */ + if (GetMouseMessageSource() != SDL_MOUSE_EVENT_SOURCE_TOUCH && + lParam != data->last_pointer_update) { + int x = GET_X_LPARAM(lParam); + int y = GET_Y_LPARAM(lParam); - WIN_ClientPointToSDL(data->window, &x, &y); + WIN_ClientPointToSDL(data->window, &x, &y); - SDL_SendMouseMotion(data->window, 0, 0, x, y); - } + SDL_SendMouseMotion(data->window, 0, 0, x, y); } } - break; + } break; case WM_LBUTTONUP: case WM_RBUTTONUP: @@ -772,141 +874,139 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MBUTTONDBLCLK: case WM_XBUTTONDOWN: case WM_XBUTTONDBLCLK: - { - SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse->relative_mode || mouse->relative_mode_warp) { - if (GetMouseMessageSource() != SDL_MOUSE_EVENT_SOURCE_TOUCH && - lParam != data->last_pointer_update) { - WIN_CheckWParamMouseButtons(wParam, data, 0); - } + { + SDL_Mouse *mouse = SDL_GetMouse(); + if (!mouse->relative_mode || mouse->relative_mode_warp) { + if (GetMouseMessageSource() != SDL_MOUSE_EVENT_SOURCE_TOUCH && + lParam != data->last_pointer_update) { + WIN_CheckWParamMouseButtons(wParam, data, 0); } } - break; + } break; case WM_INPUT: - { - SDL_Mouse *mouse = SDL_GetMouse(); - HRAWINPUT hRawInput = (HRAWINPUT)lParam; - RAWINPUT inp; - UINT size = sizeof(inp); + { + SDL_Mouse *mouse = SDL_GetMouse(); + HRAWINPUT hRawInput = (HRAWINPUT)lParam; + RAWINPUT inp; + UINT size = sizeof(inp); - /* We only use raw mouse input in relative mode */ - if (!mouse->relative_mode || mouse->relative_mode_warp) { - break; - } + /* We only use raw mouse input in relative mode */ + if (!mouse->relative_mode || mouse->relative_mode_warp) { + break; + } - /* Relative mouse motion is delivered to the window with keyboard focus */ - if (data->window != SDL_GetKeyboardFocus()) { - break; - } + /* Relative mouse motion is delivered to the window with keyboard focus */ + if (data->window != SDL_GetKeyboardFocus()) { + break; + } - GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER)); + GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER)); - /* Mouse data (ignoring synthetic mouse events generated for touchscreens) */ - if (inp.header.dwType == RIM_TYPEMOUSE) { - SDL_MouseID mouseID; - RAWMOUSE* rawmouse; - if (SDL_GetNumTouchDevices() > 0 && - (GetMouseMessageSource() == SDL_MOUSE_EVENT_SOURCE_TOUCH || (GetMessageExtraInfo() & 0x82) == 0x82)) { - break; + /* Mouse data (ignoring synthetic mouse events generated for touchscreens) */ + if (inp.header.dwType == RIM_TYPEMOUSE) { + SDL_MouseID mouseID; + RAWMOUSE *rawmouse; + if (SDL_GetNumTouchDevices() > 0 && + (GetMouseMessageSource() == SDL_MOUSE_EVENT_SOURCE_TOUCH || (GetMessageExtraInfo() & 0x80) == 0x80)) { + break; + } + /* We do all of our mouse state checking against mouse ID 0 + * We would only use the actual hDevice if we were tracking + * all mouse motion independently, and never using mouse ID 0. + */ + mouseID = 0; /* (SDL_MouseID)(uintptr_t)inp.header.hDevice; */ + rawmouse = &inp.data.mouse; + + if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) { + SDL_SendMouseMotion(data->window, mouseID, 1, (int)rawmouse->lLastX, (int)rawmouse->lLastY); + } else if (rawmouse->lLastX || rawmouse->lLastY) { + /* This is absolute motion, either using a tablet or mouse over RDP + + Notes on how RDP appears to work, as of Windows 10 2004: + - SetCursorPos() calls are cached, with multiple calls coalesced into a single call that's sent to the RDP client. If the last call to SetCursorPos() has the same value as the last one that was sent to the client, it appears to be ignored and not sent. This means that we need to jitter the SetCursorPos() position slightly in order for the recentering to work correctly. + - User mouse motion is coalesced with SetCursorPos(), so the WM_INPUT positions we see will not necessarily match the positon we requested with SetCursorPos(). + - SetCursorPos() outside of the bounds of the focus window appears not to do anything. + - SetCursorPos() while the cursor is NULL doesn't do anything + + We handle this by creating a safe area within the application window, and when the mouse leaves that safe area, we warp back to the opposite side. Any single motion > 50% of the safe area is assumed to be a warp and ignored. + */ + SDL_bool remote_desktop = GetSystemMetrics(SM_REMOTESESSION) ? SDL_TRUE : SDL_FALSE; + SDL_bool virtual_desktop = (rawmouse->usFlags & MOUSE_VIRTUAL_DESKTOP) ? SDL_TRUE : SDL_FALSE; + SDL_bool normalized_coordinates = !(rawmouse->usFlags & 0x40) ? SDL_TRUE : SDL_FALSE; + int w = GetSystemMetrics(virtual_desktop ? SM_CXVIRTUALSCREEN : SM_CXSCREEN); + int h = GetSystemMetrics(virtual_desktop ? SM_CYVIRTUALSCREEN : SM_CYSCREEN); + int x = normalized_coordinates ? (int)(((float)rawmouse->lLastX / 65535.0f) * w) : (int)rawmouse->lLastX; + int y = normalized_coordinates ? (int)(((float)rawmouse->lLastY / 65535.0f) * h) : (int)rawmouse->lLastY; + int relX, relY; + + /* Calculate relative motion */ + if (data->last_raw_mouse_position.x == 0 && data->last_raw_mouse_position.y == 0) { + data->last_raw_mouse_position.x = x; + data->last_raw_mouse_position.y = y; } - /* We do all of our mouse state checking against mouse ID 0 - * We would only use the actual hDevice if we were tracking - * all mouse motion independently, and never using mouse ID 0. - */ - mouseID = 0; /* (SDL_MouseID)(uintptr_t)inp.header.hDevice; */ - rawmouse = &inp.data.mouse; - - if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) { - SDL_SendMouseMotion(data->window, mouseID, 1, (int)rawmouse->lLastX, (int)rawmouse->lLastY); - } else if (rawmouse->lLastX || rawmouse->lLastY) { - /* This is absolute motion, either using a tablet or mouse over RDP - - Notes on how RDP appears to work, as of Windows 10 2004: - - SetCursorPos() calls are cached, with multiple calls coalesced into a single call that's sent to the RDP client. If the last call to SetCursorPos() has the same value as the last one that was sent to the client, it appears to be ignored and not sent. This means that we need to jitter the SetCursorPos() position slightly in order for the recentering to work correctly. - - User mouse motion is coalesced with SetCursorPos(), so the WM_INPUT positions we see will not necessarily match the positon we requested with SetCursorPos(). - - SetCursorPos() outside of the bounds of the focus window appears not to do anything. - - SetCursorPos() while the cursor is NULL doesn't do anything - - We handle this by creating a safe area within the application window, and when the mouse leaves that safe area, we warp back to the opposite side. Any single motion > 50% of the safe area is assumed to be a warp and ignored. - */ - SDL_bool remote_desktop = GetSystemMetrics(SM_REMOTESESSION) ? SDL_TRUE : SDL_FALSE; - SDL_bool virtual_desktop = (rawmouse->usFlags & MOUSE_VIRTUAL_DESKTOP) ? SDL_TRUE : SDL_FALSE; - SDL_bool normalized_coordinates = ((rawmouse->usFlags & 0x40) == 0) ? SDL_TRUE : SDL_FALSE; - int w = GetSystemMetrics(virtual_desktop ? SM_CXVIRTUALSCREEN : SM_CXSCREEN); - int h = GetSystemMetrics(virtual_desktop ? SM_CYVIRTUALSCREEN : SM_CYSCREEN); - int x = normalized_coordinates ? (int)(((float)rawmouse->lLastX / 65535.0f) * w) : (int)rawmouse->lLastX; - int y = normalized_coordinates ? (int)(((float)rawmouse->lLastY / 65535.0f) * h) : (int)rawmouse->lLastY; - int relX, relY; - - /* Calculate relative motion */ - if (data->last_raw_mouse_position.x == 0 && data->last_raw_mouse_position.y == 0) { - data->last_raw_mouse_position.x = x; - data->last_raw_mouse_position.y = y; - } - relX = (int)(x - data->last_raw_mouse_position.x); - relY = (int)(y - data->last_raw_mouse_position.y); - - if (remote_desktop) { - if (!data->in_title_click && !data->focus_click_pending) { - static int wobble; - float floatX = (float)x / w; - float floatY = (float)y / h; - - /* See if the mouse is at the edge of the screen, or in the RDP title bar area */ - if (floatX <= 0.01f || floatX >= 0.99f || floatY <= 0.01f || floatY >= 0.99f || y < 32) { - /* Wobble the cursor position so it's not ignored if the last warp didn't have any effect */ - RECT rect = data->cursor_clipped_rect; - int warpX = rect.left + ((rect.right - rect.left) / 2) + wobble; - int warpY = rect.top + ((rect.bottom - rect.top) / 2); - - WIN_SetCursorPos(warpX, warpY); - - ++wobble; - if (wobble > 1) { - wobble = -1; - } - } else { - /* Send relative motion if we didn't warp last frame (had good position data) - We also sometimes get large deltas due to coalesced mouse motion and warping, - so ignore those. - */ - const int MAX_RELATIVE_MOTION = (h / 6); - if (SDL_abs(relX) < MAX_RELATIVE_MOTION && - SDL_abs(relY) < MAX_RELATIVE_MOTION) { - SDL_SendMouseMotion(data->window, mouseID, 1, relX, relY); - } + relX = x - data->last_raw_mouse_position.x; + relY = y - data->last_raw_mouse_position.y; + + if (remote_desktop) { + if (!data->in_title_click && !data->focus_click_pending) { + static int wobble; + float floatX = (float)x / w; + float floatY = (float)y / h; + + /* See if the mouse is at the edge of the screen, or in the RDP title bar area */ + if (floatX <= 0.01f || floatX >= 0.99f || floatY <= 0.01f || floatY >= 0.99f || y < 32) { + /* Wobble the cursor position so it's not ignored if the last warp didn't have any effect */ + RECT rect = data->cursor_clipped_rect; + int warpX = rect.left + ((rect.right - rect.left) / 2) + wobble; + int warpY = rect.top + ((rect.bottom - rect.top) / 2); + + WIN_SetCursorPos(warpX, warpY); + + ++wobble; + if (wobble > 1) { + wobble = -1; } - } - } else { - const int MAXIMUM_TABLET_RELATIVE_MOTION = 32; - if (SDL_abs(relX) > MAXIMUM_TABLET_RELATIVE_MOTION || - SDL_abs(relY) > MAXIMUM_TABLET_RELATIVE_MOTION) { - /* Ignore this motion, probably a pen lift and drop */ } else { - SDL_SendMouseMotion(data->window, mouseID, 1, relX, relY); + /* Send relative motion if we didn't warp last frame (had good position data) + We also sometimes get large deltas due to coalesced mouse motion and warping, + so ignore those. + */ + const int MAX_RELATIVE_MOTION = (h / 6); + if (SDL_abs(relX) < MAX_RELATIVE_MOTION && + SDL_abs(relY) < MAX_RELATIVE_MOTION) { + SDL_SendMouseMotion(data->window, mouseID, 1, relX, relY); + } } } - - data->last_raw_mouse_position.x = x; - data->last_raw_mouse_position.y = y; + } else { + const int MAXIMUM_TABLET_RELATIVE_MOTION = 32; + if (SDL_abs(relX) > MAXIMUM_TABLET_RELATIVE_MOTION || + SDL_abs(relY) > MAXIMUM_TABLET_RELATIVE_MOTION) { + /* Ignore this motion, probably a pen lift and drop */ + } else { + SDL_SendMouseMotion(data->window, mouseID, 1, relX, relY); + } } - WIN_CheckRawMouseButtons(rawmouse->usButtonFlags, data, mouseID); + + data->last_raw_mouse_position.x = x; + data->last_raw_mouse_position.y = y; } + WIN_CheckRawMouseButtons(inp.header.hDevice, rawmouse->usButtonFlags, data, mouseID); } - break; + } break; case WM_MOUSEWHEEL: case WM_MOUSEHWHEEL: - { - short amount = GET_WHEEL_DELTA_WPARAM(wParam); - float fAmount = (float) amount / WHEEL_DELTA; - if (msg == WM_MOUSEWHEEL) - SDL_SendMouseWheel(data->window, 0, 0.0f, fAmount, SDL_MOUSEWHEEL_NORMAL); - else - SDL_SendMouseWheel(data->window, 0, fAmount, 0.0f, SDL_MOUSEWHEEL_NORMAL); + { + short amount = GET_WHEEL_DELTA_WPARAM(wParam); + float fAmount = (float)amount / WHEEL_DELTA; + if (msg == WM_MOUSEWHEEL) { + SDL_SendMouseWheel(data->window, 0, 0.0f, fAmount, SDL_MOUSEWHEEL_NORMAL); + } else { + SDL_SendMouseWheel(data->window, 0, fAmount, 0.0f, SDL_MOUSEWHEEL_NORMAL); } - break; + } break; case WM_MOUSELEAVE: if (!(data->window->flags & SDL_WINDOW_MOUSE_CAPTURE)) { @@ -922,14 +1022,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) mouse = SDL_GetMouse(); if (!mouse->was_touch_mouse_events) { /* we're not a touch handler causing a mouse leave? */ SDL_SendMouseMotion(data->window, 0, 0, point.x, point.y); - } else { /* touch handling? */ + } else { /* touch handling? */ mouse->was_touch_mouse_events = SDL_FALSE; /* not anymore */ - if (mouse->touch_mouse_events) { /* convert touch to mouse events */ + if (mouse->touch_mouse_events) { /* convert touch to mouse events */ SDL_SendMouseMotion(data->window, SDL_TOUCH_MOUSEID, 0, point.x, point.y); } else { /* normal handling */ SDL_SendMouseMotion(data->window, 0, 0, point.x, point.y); } - } + } } if (!SDL_GetMouse()->relative_mode) { @@ -947,40 +1047,50 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_KEYDOWN: case WM_SYSKEYDOWN: - { - SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); - const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - - /* Detect relevant keyboard shortcuts */ - if (keyboardState[SDL_SCANCODE_LALT] == SDL_PRESSED || keyboardState[SDL_SCANCODE_RALT] == SDL_PRESSED) { - /* ALT+F4: Close window */ - if (code == SDL_SCANCODE_F4 && ShouldGenerateWindowCloseOnAltF4()) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - } - } + { + SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); + const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - if (code != SDL_SCANCODE_UNKNOWN) { - SDL_SendKeyboardKey(SDL_PRESSED, code); + if (SkipAltGrLeftControl(wParam, lParam)) { + returnCode = 0; + break; + } + + /* Detect relevant keyboard shortcuts */ + if (keyboardState[SDL_SCANCODE_LALT] == SDL_PRESSED || keyboardState[SDL_SCANCODE_RALT] == SDL_PRESSED) { + /* ALT+F4: Close window */ + if (code == SDL_SCANCODE_F4 && ShouldGenerateWindowCloseOnAltF4()) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); } } + if (code != SDL_SCANCODE_UNKNOWN) { + SDL_SendKeyboardKey(SDL_PRESSED, code); + } + } + returnCode = 0; break; case WM_SYSKEYUP: case WM_KEYUP: - { - SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); - const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); + { + SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam); + const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - if (code != SDL_SCANCODE_UNKNOWN) { - if (code == SDL_SCANCODE_PRINTSCREEN && - keyboardState[code] == SDL_RELEASED) { - SDL_SendKeyboardKey(SDL_PRESSED, code); - } - SDL_SendKeyboardKey(SDL_RELEASED, code); + if (SkipAltGrLeftControl(wParam, lParam)) { + returnCode = 0; + break; + } + + if (code != SDL_SCANCODE_UNKNOWN) { + if (code == SDL_SCANCODE_PRINTSCREEN && + keyboardState[code] == SDL_RELEASED) { + SDL_SendKeyboardKey(SDL_PRESSED, code); } + SDL_SendKeyboardKey(SDL_RELEASED, code); } + } returnCode = 0; break; @@ -1028,133 +1138,131 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #ifdef WM_INPUTLANGCHANGE case WM_INPUTLANGCHANGE: - { - WIN_UpdateKeymap(SDL_TRUE); - } + { + WIN_UpdateKeymap(SDL_TRUE); + } returnCode = 1; break; #endif /* WM_INPUTLANGCHANGE */ case WM_NCLBUTTONDOWN: - { - data->in_title_click = SDL_TRUE; - } - break; + { + data->in_title_click = SDL_TRUE; + } break; case WM_CAPTURECHANGED: - { - data->in_title_click = SDL_FALSE; + { + data->in_title_click = SDL_FALSE; - /* The mouse may have been released during a modal loop */ - WIN_CheckAsyncMouseRelease(data); - } - break; + /* The mouse may have been released during a modal loop */ + WIN_CheckAsyncMouseRelease(data); + } break; #ifdef WM_GETMINMAXINFO case WM_GETMINMAXINFO: - { - MINMAXINFO *info; - RECT size; - int x, y; - int w, h; - int min_w, min_h; - int max_w, max_h; - BOOL constrain_max_size; + { + MINMAXINFO *info; + RECT size; + int x, y; + int w, h; + int min_w, min_h; + int max_w, max_h; + BOOL constrain_max_size; + + if (SDL_IsShapedWindow(data->window)) { + Win32_ResizeWindowShape(data->window); + } - if (SDL_IsShapedWindow(data->window)) { - Win32_ResizeWindowShape(data->window); - } + /* If this is an expected size change, allow it */ + if (data->expected_resize) { + break; + } - /* If this is an expected size change, allow it */ - if (data->expected_resize) { - break; - } + /* Get the current position of our window */ + GetWindowRect(hwnd, &size); + x = size.left; + y = size.top; + + /* Calculate current size of our window */ + SDL_GetWindowSize(data->window, &w, &h); + SDL_GetWindowMinimumSize(data->window, &min_w, &min_h); + SDL_GetWindowMaximumSize(data->window, &max_w, &max_h); + + /* Convert w, h, min_w, min_h, max_w, max_h from dpi-scaled points to pixels, + treating them as coordinates within the client area. */ + WIN_ClientPointFromSDL(data->window, &w, &h); + WIN_ClientPointFromSDL(data->window, &min_w, &min_h); + WIN_ClientPointFromSDL(data->window, &max_w, &max_h); + + /* Store in min_w and min_h difference between current size and minimal + size so we don't need to call AdjustWindowRectEx twice */ + min_w -= w; + min_h -= h; + if (max_w && max_h) { + max_w -= w; + max_h -= h; + constrain_max_size = TRUE; + } else { + constrain_max_size = FALSE; + } - /* Get the current position of our window */ - GetWindowRect(hwnd, &size); - x = size.left; - y = size.top; - - /* Calculate current size of our window */ - SDL_GetWindowSize(data->window, &w, &h); - SDL_GetWindowMinimumSize(data->window, &min_w, &min_h); - SDL_GetWindowMaximumSize(data->window, &max_w, &max_h); - - /* Convert w, h, min_w, min_h, max_w, max_h from dpi-scaled points to pixels, - treating them as coordinates within the client area. */ - WIN_ClientPointFromSDL(data->window, &w, &h); - WIN_ClientPointFromSDL(data->window, &min_w, &min_h); - WIN_ClientPointFromSDL(data->window, &max_w, &max_h); - - /* Store in min_w and min_h difference between current size and minimal - size so we don't need to call AdjustWindowRectEx twice */ - min_w -= w; - min_h -= h; - if (max_w && max_h) { - max_w -= w; - max_h -= h; - constrain_max_size = TRUE; + if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS)) { + LONG style = GetWindowLong(hwnd, GWL_STYLE); + /* DJM - according to the docs for GetMenu(), the + return value is undefined if hwnd is a child window. + Apparently it's too difficult for MS to check + inside their function, so I have to do it here. + */ + BOOL menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); + UINT dpi; + + dpi = 96; + size.top = 0; + size.left = 0; + size.bottom = h; + size.right = w; + + if (WIN_IsPerMonitorV2DPIAware(SDL_GetVideoDevice())) { + dpi = data->videodata->GetDpiForWindow(hwnd); + data->videodata->AdjustWindowRectExForDpi(&size, style, menu, 0, dpi); } else { - constrain_max_size = FALSE; + AdjustWindowRectEx(&size, style, menu, 0); } - - if (!(SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS)) { - LONG style = GetWindowLong(hwnd, GWL_STYLE); - /* DJM - according to the docs for GetMenu(), the - return value is undefined if hwnd is a child window. - Apparently it's too difficult for MS to check - inside their function, so I have to do it here. - */ - BOOL menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); - UINT dpi; - - dpi = 96; - size.top = 0; - size.left = 0; - size.bottom = h; - size.right = w; - - if (WIN_IsPerMonitorV2DPIAware(SDL_GetVideoDevice())) { - dpi = data->videodata->GetDpiForWindow(hwnd); - data->videodata->AdjustWindowRectExForDpi(&size, style, menu, 0, dpi); - } else { - AdjustWindowRectEx(&size, style, menu, 0); - } - w = size.right - size.left; - h = size.bottom - size.top; + w = size.right - size.left; + h = size.bottom - size.top; #ifdef HIGHDPI_DEBUG - SDL_Log("WM_GETMINMAXINFO: max window size: %dx%d using dpi: %u", w, h, dpi); + SDL_Log("WM_GETMINMAXINFO: max window size: %dx%d using dpi: %u", w, h, dpi); #endif - } + } - /* Fix our size to the current size */ - info = (MINMAXINFO *) lParam; - if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) { - if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) { - int screenW = GetSystemMetrics(SM_CXSCREEN); - int screenH = GetSystemMetrics(SM_CYSCREEN); - info->ptMaxSize.x = SDL_max(w, screenW); - info->ptMaxSize.y = SDL_max(h, screenH); - info->ptMaxPosition.x = SDL_min(0, ((screenW - w) / 2)); - info->ptMaxPosition.y = SDL_min(0, ((screenH - h) / 2)); - } - info->ptMinTrackSize.x = w + min_w; - info->ptMinTrackSize.y = h + min_h; - if (constrain_max_size) { - info->ptMaxTrackSize.x = w + max_w; - info->ptMaxTrackSize.y = h + max_h; - } - } else { - info->ptMaxSize.x = w; - info->ptMaxSize.y = h; - info->ptMaxPosition.x = x; - info->ptMaxPosition.y = y; - info->ptMinTrackSize.x = w; - info->ptMinTrackSize.y = h; - info->ptMaxTrackSize.x = w; - info->ptMaxTrackSize.y = h; + /* Fix our size to the current size */ + info = (MINMAXINFO *)lParam; + if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_RESIZABLE) { + if (SDL_GetWindowFlags(data->window) & SDL_WINDOW_BORDERLESS) { + int screenW = GetSystemMetrics(SM_CXSCREEN); + int screenH = GetSystemMetrics(SM_CYSCREEN); + info->ptMaxSize.x = SDL_max(w, screenW); + info->ptMaxSize.y = SDL_max(h, screenH); + info->ptMaxPosition.x = SDL_min(0, ((screenW - w) / 2)); + info->ptMaxPosition.y = SDL_min(0, ((screenH - h) / 2)); + } + info->ptMinTrackSize.x = (LONG)w + min_w; + info->ptMinTrackSize.y = (LONG)h + min_h; + if (constrain_max_size) { + info->ptMaxTrackSize.x = (LONG)w + max_w; + info->ptMaxTrackSize.y = (LONG)h + max_h; } + } else { + info->ptMaxSize.x = w; + info->ptMaxSize.y = h; + info->ptMaxPosition.x = x; + info->ptMaxPosition.y = y; + info->ptMinTrackSize.x = w; + info->ptMinTrackSize.y = h; + info->ptMaxTrackSize.x = w; + info->ptMaxTrackSize.y = h; } + } returnCode = 0; break; #endif /* WM_GETMINMAXINFO */ @@ -1167,112 +1275,128 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_WINDOWPOSCHANGED: - { - RECT rect; - int x, y; - int w, h; - int display_index = data->window->display_index; + { + RECT rect; + int x, y; + int w, h; + int display_index = data->window->display_index; - if (data->initializing || data->in_border_change) { - break; - } + if (data->initializing || data->in_border_change) { + break; + } - /* When the window is minimized it's resized to the dock icon size, ignore this */ - if (IsIconic(hwnd)) { - break; - } + /* When the window is minimized it's resized to the dock icon size, ignore this */ + if (IsIconic(hwnd)) { + break; + } - if (!GetClientRect(hwnd, &rect) || IsRectEmpty(&rect)) { - break; - } - ClientToScreen(hwnd, (LPPOINT) & rect); - ClientToScreen(hwnd, (LPPOINT) & rect + 1); + if (!GetClientRect(hwnd, &rect) || WIN_IsRectEmpty(&rect)) { + break; + } + ClientToScreen(hwnd, (LPPOINT)&rect); + ClientToScreen(hwnd, (LPPOINT)&rect + 1); - WIN_UpdateClipCursor(data->window); + WIN_UpdateClipCursor(data->window); - x = rect.left; - y = rect.top; - WIN_ScreenPointToSDL(&x, &y); + x = rect.left; + y = rect.top; + WIN_ScreenPointToSDL(&x, &y); - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, x, y); + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, x, y); - /* Convert client area width/height from pixels to dpi-scaled points */ - w = rect.right - rect.left; - h = rect.bottom - rect.top; - WIN_ClientPointToSDL(data->window, &w, &h); + /* Convert client area width/height from pixels to dpi-scaled points */ + w = rect.right - rect.left; + h = rect.bottom - rect.top; + WIN_ClientPointToSDL(data->window, &w, &h); - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, w, h); + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, w, h); #ifdef HIGHDPI_DEBUG - SDL_Log("WM_WINDOWPOSCHANGED: Windows client rect (pixels): (%d, %d) (%d x %d)\tSDL client rect (points): (%d, %d) (%d x %d) cached dpi %d, windows reported dpi %d", + SDL_Log("WM_WINDOWPOSCHANGED: Windows client rect (pixels): (%d, %d) (%d x %d)\tSDL client rect (points): (%d, %d) (%d x %d) cached dpi %d, windows reported dpi %d", rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, x, y, w, h, data->scaling_dpi, data->videodata->GetDpiForWindow ? data->videodata->GetDpiForWindow(data->hwnd) : 0); #endif - /* Forces a WM_PAINT event */ - InvalidateRect(hwnd, NULL, FALSE); + /* Forces a WM_PAINT event */ + InvalidateRect(hwnd, NULL, FALSE); - if (data->window->display_index != display_index) { - /* Display changed, check ICC profile */ - WIN_UpdateWindowICCProfile(data->window, SDL_TRUE); - } + if (data->window->display_index != display_index) { + /* Display changed, check ICC profile */ + WIN_UpdateWindowICCProfile(data->window, SDL_TRUE); } - break; + } break; + + case WM_ENTERSIZEMOVE: + case WM_ENTERMENULOOP: + { + SetTimer(hwnd, (UINT_PTR)&s_ModalMoveResizeLoop, USER_TIMER_MINIMUM, NULL); + } break; + + case WM_TIMER: + { + if (wParam == (UINT_PTR)&s_ModalMoveResizeLoop) { + SDL_OnWindowLiveResizeUpdate(data->window); + return 0; + } + } break; + + case WM_EXITSIZEMOVE: + case WM_EXITMENULOOP: + { + KillTimer(hwnd, (UINT_PTR)&s_ModalMoveResizeLoop); + } break; case WM_SIZE: - { - switch (wParam) { - case SIZE_MAXIMIZED: - SDL_SendWindowEvent(data->window, - SDL_WINDOWEVENT_RESTORED, 0, 0); - SDL_SendWindowEvent(data->window, - SDL_WINDOWEVENT_MAXIMIZED, 0, 0); - break; - case SIZE_MINIMIZED: - SDL_SendWindowEvent(data->window, - SDL_WINDOWEVENT_MINIMIZED, 0, 0); - break; - case SIZE_RESTORED: - SDL_SendWindowEvent(data->window, - SDL_WINDOWEVENT_RESTORED, 0, 0); - break; - default: - break; - } + { + switch (wParam) { + case SIZE_MAXIMIZED: + SDL_SendWindowEvent(data->window, + SDL_WINDOWEVENT_RESTORED, 0, 0); + SDL_SendWindowEvent(data->window, + SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + break; + case SIZE_MINIMIZED: + SDL_SendWindowEvent(data->window, + SDL_WINDOWEVENT_MINIMIZED, 0, 0); + break; + case SIZE_RESTORED: + SDL_SendWindowEvent(data->window, + SDL_WINDOWEVENT_RESTORED, 0, 0); + break; + default: + break; } - break; + } break; case WM_SETCURSOR: - { - Uint16 hittest; - - hittest = LOWORD(lParam); - if (hittest == HTCLIENT) { - SetCursor(SDL_cursor); - returnCode = TRUE; - } else if (!g_WindowFrameUsableWhileCursorHidden && !SDL_cursor) { - SetCursor(NULL); - returnCode = TRUE; - } + { + Uint16 hittest; + + hittest = LOWORD(lParam); + if (hittest == HTCLIENT) { + SetCursor(SDL_cursor); + returnCode = TRUE; + } else if (!g_WindowFrameUsableWhileCursorHidden && !SDL_cursor) { + SetCursor(NULL); + returnCode = TRUE; } - break; + } break; /* We were occluded, refresh our display */ case WM_PAINT: - { - RECT rect; - if (GetUpdateRect(hwnd, &rect, FALSE)) { - ValidateRect(hwnd, NULL); - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0); - } + { + RECT rect; + if (GetUpdateRect(hwnd, &rect, FALSE)) { + ValidateRect(hwnd, NULL); + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0); } + } returnCode = 0; break; /* We'll do our own drawing, prevent flicker */ case WM_ERASEBKGND: - if (!data->videodata->cleared) - { + if (!data->videodata->cleared) { RECT client_rect; HBRUSH brush; data->videodata->cleared = SDL_TRUE; @@ -1281,30 +1405,31 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) FillRect(GetDC(hwnd), &client_rect, brush); DeleteObject(brush); } - return (1); + return 1; case WM_SYSCOMMAND: - { + { + if (!g_WindowsEnableMenuMnemonics) { if ((wParam & 0xFFF0) == SC_KEYMENU) { - return (0); + return 0; } + } #if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER) - /* Don't start the screensaver or blank the monitor in fullscreen apps */ - if ((wParam & 0xFFF0) == SC_SCREENSAVE || - (wParam & 0xFFF0) == SC_MONITORPOWER) { - if (SDL_GetVideoDevice()->suspend_screensaver) { - return (0); - } + /* Don't start the screensaver or blank the monitor in fullscreen apps */ + if ((wParam & 0xFFF0) == SC_SCREENSAVE || + (wParam & 0xFFF0) == SC_MONITORPOWER) { + if (SDL_GetVideoDevice()->suspend_screensaver) { + return 0; } -#endif /* System has screensaver support */ } - break; +#endif /* System has screensaver support */ + } break; case WM_CLOSE: - { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - } + { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); + } returnCode = 0; break; @@ -1317,15 +1442,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) RECT rect; float x, y; - if (!GetClientRect(hwnd, &rect) || - (rect.right == rect.left && rect.bottom == rect.top)) { + if (!GetClientRect(hwnd, &rect) || WIN_IsRectEmpty(&rect)) { if (inputs) { SDL_small_free(inputs, isstack); } break; } - ClientToScreen(hwnd, (LPPOINT) & rect); - ClientToScreen(hwnd, (LPPOINT) & rect + 1); + ClientToScreen(hwnd, (LPPOINT)&rect); + ClientToScreen(hwnd, (LPPOINT)&rect + 1); rect.top *= 100; rect.left *= 100; rect.bottom *= 100; @@ -1339,13 +1463,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) /* TODO: Can we use GetRawInputDeviceInfo and HID info to determine if this is a direct or indirect touch device? */ - if (SDL_AddTouch(touchId, SDL_TOUCH_DEVICE_DIRECT, "") < 0) { + if (SDL_AddTouch(touchId, SDL_TOUCH_DEVICE_DIRECT, (input->dwFlags & TOUCHEVENTF_PEN) == TOUCHEVENTF_PEN ? "pen" : "touch") < 0) { continue; } /* Get the normalized coordinates for the window */ - x = (float)(input->x - rect.left)/(rect.right - rect.left); - y = (float)(input->y - rect.top)/(rect.bottom - rect.top); + x = (float)(input->x - rect.left) / (rect.right - rect.left); + y = (float)(input->y - rect.top) / (rect.bottom - rect.top); if (input->dwFlags & TOUCHEVENTF_DOWN) { SDL_SendTouch(touchId, input->dwID, data->window, SDL_TRUE, x, y, 1.0f); @@ -1365,113 +1489,118 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } break; -#if HAVE_TPCSHRD_H +#ifdef HAVE_TPCSHRD_H case WM_TABLET_QUERYSYSTEMGESTURESTATUS: /* See https://msdn.microsoft.com/en-us/library/windows/desktop/bb969148(v=vs.85).aspx . * If we're handling our own touches, we don't want any gestures. * Not all of these settings are documented. * The use of the undocumented ones was suggested by https://github.com/bjarkeck/GCGJ/blob/master/Monogame/Windows/WinFormsGameForm.cs . */ - return TABLET_DISABLE_PRESSANDHOLD | /* disables press and hold (right-click) gesture */ - TABLET_DISABLE_PENTAPFEEDBACK | /* disables UI feedback on pen up (waves) */ - TABLET_DISABLE_PENBARRELFEEDBACK | /* disables UI feedback on pen button down (circle) */ - TABLET_DISABLE_TOUCHUIFORCEON | - TABLET_DISABLE_TOUCHUIFORCEOFF | - TABLET_DISABLE_TOUCHSWITCH | - TABLET_DISABLE_FLICKS | /* disables pen flicks (back, forward, drag down, drag up) */ - TABLET_DISABLE_SMOOTHSCROLLING | - TABLET_DISABLE_FLICKFALLBACKKEYS; + return TABLET_DISABLE_PRESSANDHOLD | TABLET_DISABLE_PENTAPFEEDBACK | TABLET_DISABLE_PENBARRELFEEDBACK | TABLET_DISABLE_TOUCHUIFORCEON | TABLET_DISABLE_TOUCHUIFORCEOFF | TABLET_DISABLE_TOUCHSWITCH | TABLET_DISABLE_FLICKS | TABLET_DISABLE_SMOOTHSCROLLING | TABLET_DISABLE_FLICKFALLBACKKEYS; /* disables press and hold (right-click) gesture */ + /* disables UI feedback on pen up (waves) */ + /* disables UI feedback on pen button down (circle) */ + /* disables pen flicks (back, forward, drag down, drag up) */ #endif /* HAVE_TPCSHRD_H */ case WM_DROPFILES: - { - UINT i; - HDROP drop = (HDROP) wParam; - UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0); - for (i = 0; i < count; ++i) { - SDL_bool isstack; - UINT size = DragQueryFile(drop, i, NULL, 0) + 1; - LPTSTR buffer = SDL_small_alloc(TCHAR, size, &isstack); - if (buffer) { - if (DragQueryFile(drop, i, buffer, size)) { - char *file = WIN_StringToUTF8(buffer); - SDL_SendDropFile(data->window, file); - SDL_free(file); - } - SDL_small_free(buffer, isstack); + { + UINT i; + HDROP drop = (HDROP)wParam; + UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0); + for (i = 0; i < count; ++i) { + SDL_bool isstack; + UINT size = DragQueryFile(drop, i, NULL, 0) + 1; + LPTSTR buffer = SDL_small_alloc(TCHAR, size, &isstack); + if (buffer) { + if (DragQueryFile(drop, i, buffer, size)) { + char *file = WIN_StringToUTF8(buffer); + SDL_SendDropFile(data->window, file); + SDL_free(file); } + SDL_small_free(buffer, isstack); } - SDL_SendDropComplete(data->window); - DragFinish(drop); - return 0; } - break; + SDL_SendDropComplete(data->window); + DragFinish(drop); + return 0; + } break; case WM_DISPLAYCHANGE: - { - // Reacquire displays if any were added or removed - WIN_RefreshDisplays(SDL_GetVideoDevice()); - } - break; + { + // Reacquire displays if any were added or removed + WIN_RefreshDisplays(SDL_GetVideoDevice()); + } break; case WM_NCCALCSIZE: - { - Uint32 window_flags = SDL_GetWindowFlags(data->window); - if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) { - /* When borderless, need to tell windows that the size of the non-client area is 0 */ - if (!(window_flags & SDL_WINDOW_RESIZABLE)) { - int w, h; - NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam; - w = data->window->windowed.w; - h = data->window->windowed.h; - WIN_ClientPointFromSDL(data->window, &w, &h); - params->rgrc[0].right = params->rgrc[0].left + w; - params->rgrc[0].bottom = params->rgrc[0].top + h; - } - return 0; + { + Uint32 window_flags = SDL_GetWindowFlags(data->window); + if (wParam == TRUE && (window_flags & SDL_WINDOW_BORDERLESS) && !(window_flags & SDL_WINDOW_FULLSCREEN)) { + /* When borderless, need to tell windows that the size of the non-client area is 0 */ + if (!(window_flags & SDL_WINDOW_RESIZABLE)) { + int w, h; + NCCALCSIZE_PARAMS *params = (NCCALCSIZE_PARAMS *)lParam; + w = data->window->windowed.w; + h = data->window->windowed.h; + WIN_ClientPointFromSDL(data->window, &w, &h); + params->rgrc[0].right = params->rgrc[0].left + w; + params->rgrc[0].bottom = params->rgrc[0].top + h; } + return 0; } - break; + } break; case WM_NCHITTEST: - { - SDL_Window *window = data->window; - if (window->hit_test) { - POINT winpoint; - winpoint.x = GET_X_LPARAM(lParam); - winpoint.y = GET_Y_LPARAM(lParam); - if (ScreenToClient(hwnd, &winpoint)) { - SDL_Point point; - SDL_HitTestResult rc; - point.x = winpoint.x; - point.y = winpoint.y; - WIN_ClientPointToSDL(data->window, &point.x, &point.y); - rc = window->hit_test(window, &point, window->hit_test_data); - switch (rc) { - #define POST_HIT_TEST(ret) { SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIT_TEST, 0, 0); return ret; } - case SDL_HITTEST_DRAGGABLE: POST_HIT_TEST(HTCAPTION); - case SDL_HITTEST_RESIZE_TOPLEFT: POST_HIT_TEST(HTTOPLEFT); - case SDL_HITTEST_RESIZE_TOP: POST_HIT_TEST(HTTOP); - case SDL_HITTEST_RESIZE_TOPRIGHT: POST_HIT_TEST(HTTOPRIGHT); - case SDL_HITTEST_RESIZE_RIGHT: POST_HIT_TEST(HTRIGHT); - case SDL_HITTEST_RESIZE_BOTTOMRIGHT: POST_HIT_TEST(HTBOTTOMRIGHT); - case SDL_HITTEST_RESIZE_BOTTOM: POST_HIT_TEST(HTBOTTOM); - case SDL_HITTEST_RESIZE_BOTTOMLEFT: POST_HIT_TEST(HTBOTTOMLEFT); - case SDL_HITTEST_RESIZE_LEFT: POST_HIT_TEST(HTLEFT); - #undef POST_HIT_TEST - case SDL_HITTEST_NORMAL: return HTCLIENT; - } + { + SDL_Window *window = data->window; + if (window->hit_test) { + POINT winpoint; + winpoint.x = GET_X_LPARAM(lParam); + winpoint.y = GET_Y_LPARAM(lParam); + if (ScreenToClient(hwnd, &winpoint)) { + SDL_Point point; + SDL_HitTestResult rc; + point.x = winpoint.x; + point.y = winpoint.y; + WIN_ClientPointToSDL(data->window, &point.x, &point.y); + rc = window->hit_test(window, &point, window->hit_test_data); + switch (rc) { +#define POST_HIT_TEST(ret) \ + { \ + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIT_TEST, 0, 0); \ + return ret; \ + } + case SDL_HITTEST_DRAGGABLE: + POST_HIT_TEST(HTCAPTION); + case SDL_HITTEST_RESIZE_TOPLEFT: + POST_HIT_TEST(HTTOPLEFT); + case SDL_HITTEST_RESIZE_TOP: + POST_HIT_TEST(HTTOP); + case SDL_HITTEST_RESIZE_TOPRIGHT: + POST_HIT_TEST(HTTOPRIGHT); + case SDL_HITTEST_RESIZE_RIGHT: + POST_HIT_TEST(HTRIGHT); + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: + POST_HIT_TEST(HTBOTTOMRIGHT); + case SDL_HITTEST_RESIZE_BOTTOM: + POST_HIT_TEST(HTBOTTOM); + case SDL_HITTEST_RESIZE_BOTTOMLEFT: + POST_HIT_TEST(HTBOTTOMLEFT); + case SDL_HITTEST_RESIZE_LEFT: + POST_HIT_TEST(HTLEFT); +#undef POST_HIT_TEST + case SDL_HITTEST_NORMAL: + return HTCLIENT; } - /* If we didn't return, this will call DefWindowProc below. */ } + /* If we didn't return, this will call DefWindowProc below. */ } - break; + } break; case WM_GETDPISCALEDSIZE: /* Windows 10 Creators Update+ */ /* Documented as only being sent to windows that are per-monitor V2 DPI aware. - + Experimentation shows it's only sent during interactive dragging, not in response to SetWindowPos. */ if (data->videodata->GetDpiForWindow && data->videodata->AdjustWindowRectExForDpi) { @@ -1485,7 +1614,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) because Windows doesn't scale the non-client area (titlebar etc.) linearly. So, we need to handle this message to request custom scaling. */ - + const int nextDPI = (int)wParam; const int prevDPI = (int)data->videodata->GetDpiForWindow(hwnd); SIZE *sizeInOut = (SIZE *)lParam; @@ -1503,7 +1632,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) /* Subtract the window frame size that would have been used at prevDPI */ { - RECT rect = {0}; + RECT rect = { 0 }; if (!(data->window->flags & SDL_WINDOW_BORDERLESS)) { data->videodata->AdjustWindowRectExForDpi(&rect, style, menu, 0, prevDPI); @@ -1516,7 +1645,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) query_client_h_win = sizeInOut->cy - frame_h; } - /* Convert to new dpi if we are using scaling. + /* Convert to new dpi if we are using scaling. * Otherwise leave as pixels. */ if (data->videodata->dpi_scaling_enabled) { @@ -1526,7 +1655,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) /* Add the window frame size that would be used at nextDPI */ { - RECT rect = {0}; + RECT rect = { 0 }; rect.right = query_client_w_win; rect.bottom = query_client_h_win; @@ -1550,12 +1679,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) /* Windows 8.1+ */ { const int newDPI = HIWORD(wParam); - RECT* const suggestedRect = (RECT*)lParam; + RECT *const suggestedRect = (RECT *)lParam; int w, h; #ifdef HIGHDPI_DEBUG SDL_Log("WM_DPICHANGED: to %d\tsuggested rect: (%d, %d), (%dx%d)\n", newDPI, - suggestedRect->left, suggestedRect->top, suggestedRect->right - suggestedRect->left, suggestedRect->bottom - suggestedRect->top); + suggestedRect->left, suggestedRect->top, suggestedRect->right - suggestedRect->left, suggestedRect->bottom - suggestedRect->top); #endif if (data->expected_resize) { @@ -1602,7 +1731,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) const DWORD style = GetWindowLong(hwnd, GWL_STYLE); const BOOL menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); - RECT rect = {0}; + RECT rect = { 0 }; rect.right = data->window->w; rect.bottom = data->window->h; @@ -1619,21 +1748,21 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) w = rect.right - rect.left; h = rect.bottom - rect.top; } - + #ifdef HIGHDPI_DEBUG SDL_Log("WM_DPICHANGED: current SDL window size: (%dx%d)\tcalling SetWindowPos: (%d, %d), (%dx%d)\n", - data->window->w, data->window->h, - suggestedRect->left, suggestedRect->top, w, h); + data->window->w, data->window->h, + suggestedRect->left, suggestedRect->top, w, h); #endif data->expected_resize = SDL_TRUE; SetWindowPos(hwnd, - NULL, - suggestedRect->left, - suggestedRect->top, - w, - h, - SWP_NOZORDER | SWP_NOACTIVATE); + NULL, + suggestedRect->left, + suggestedRect->top, + w, + h, + SWP_NOZORDER | SWP_NOACTIVATE); data->expected_resize = SDL_FALSE; if (data->videodata->dpi_scaling_enabled) { @@ -1669,7 +1798,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -static void WIN_UpdateClipCursorForWindows() +static void WIN_UpdateClipCursorForWindows(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; @@ -1691,12 +1820,12 @@ static void WIN_UpdateClipCursorForWindows() } } -static void WIN_UpdateMouseCapture() +static void WIN_UpdateMouseCapture(void) { - SDL_Window* focusWindow = SDL_GetKeyboardFocus(); + SDL_Window *focusWindow = SDL_GetKeyboardFocus(); if (focusWindow && (focusWindow->flags & SDL_WINDOW_MOUSE_CAPTURE)) { - SDL_WindowData *data = (SDL_WindowData *) focusWindow->driverdata; + SDL_WindowData *data = (SDL_WindowData *)focusWindow->driverdata; if (!data->mouse_tracked) { POINT cursorPos; @@ -1731,11 +1860,21 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) g_WindowsMessageHookData = userdata; } -int -WIN_WaitEventTimeout(_THIS, int timeout) +int WIN_WaitEventTimeout(_THIS, int timeout) { - MSG msg; if (g_WindowsEnableMessageLoop) { +#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + DWORD dwMilliseconds, ret; + dwMilliseconds = timeout < 0 ? INFINITE : (DWORD)timeout; + ret = MsgWaitForMultipleObjects(0, NULL, FALSE, dwMilliseconds, QS_ALLINPUT); + if (ret == WAIT_OBJECT_0) { + return 1; + } else { + return 0; + } +#else + /* MsgWaitForMultipleObjects is desktop-only. */ + MSG msg; BOOL message_result; UINT_PTR timer_id = 0; if (timeout > 0) { @@ -1748,7 +1887,7 @@ WIN_WaitEventTimeout(_THIS, int timeout) message_result = GetMessage(&msg, 0, 0, 0); } if (message_result) { - if (msg.message == WM_TIMER && msg.hwnd == NULL && msg.wParam == timer_id) { + if (msg.message == WM_TIMER && !msg.hwnd && msg.wParam == timer_id) { return 0; } if (g_WindowsMessageHook) { @@ -1761,21 +1900,20 @@ WIN_WaitEventTimeout(_THIS, int timeout) } else { return 0; } +#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } else { /* Fail the wait so the caller falls back to polling */ return -1; } } -void -WIN_SendWakeupEvent(_THIS, SDL_Window *window) +void WIN_SendWakeupEvent(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; PostMessage(data->hwnd, data->videodata->_SDL_WAKEUP, 0, 0); } -void -WIN_PumpEvents(_THIS) +void WIN_PumpEvents(_THIS) { MSG msg; DWORD end_ticks = GetTickCount() + 1; @@ -1860,7 +1998,6 @@ WIN_PumpEvents(_THIS) #endif } - static int app_registered = 0; LPTSTR SDL_Appname = NULL; Uint32 SDL_Appstyle = 0; @@ -1869,29 +2006,45 @@ HINSTANCE SDL_Instance = NULL; static void WIN_CleanRegisterApp(WNDCLASSEX wcex) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - if (wcex.hIcon) DestroyIcon(wcex.hIcon); - if (wcex.hIconSm) DestroyIcon(wcex.hIconSm); + if (wcex.hIcon) { + DestroyIcon(wcex.hIcon); + } + if (wcex.hIconSm) { + DestroyIcon(wcex.hIconSm); + } #endif SDL_free(SDL_Appname); SDL_Appname = NULL; } +static BOOL CALLBACK WIN_ResourceNameCallback(HMODULE hModule, LPCTSTR lpType, LPTSTR lpName, LONG_PTR lParam) +{ + WNDCLASSEX *wcex = (WNDCLASSEX *)lParam; + + (void)lpType; /* We already know that the resource type is RT_GROUP_ICON. */ + + /* We leave hIconSm as NULL as it will allow Windows to automatically + choose the appropriate small icon size to suit the current DPI. */ + wcex->hIcon = LoadIcon(hModule, lpName); + + /* Do not bother enumerating any more. */ + return FALSE; +} + /* Register the class for this application */ -int -SDL_RegisterApp(const char *name, Uint32 style, void *hInst) +int SDL_RegisterApp(const char *name, Uint32 style, void *hInst) { WNDCLASSEX wcex; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) const char *hint; - TCHAR path[MAX_PATH]; #endif /* Only do this once... */ if (app_registered) { ++app_registered; - return (0); + return 0; } - SDL_assert(SDL_Appname == NULL); + SDL_assert(!SDL_Appname); if (!name) { name = "SDL_app"; #if defined(CS_BYTEALIGNCLIENT) || defined(CS_OWNDC) @@ -1903,18 +2056,12 @@ SDL_RegisterApp(const char *name, Uint32 style, void *hInst) SDL_Instance = hInst ? hInst : GetModuleHandle(NULL); /* Register the application class */ - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.hCursor = NULL; - wcex.hIcon = NULL; - wcex.hIconSm = NULL; - wcex.lpszMenuName = NULL; - wcex.lpszClassName = SDL_Appname; - wcex.style = SDL_Appstyle; - wcex.hbrBackground = NULL; - wcex.lpfnWndProc = WIN_WindowProc; - wcex.hInstance = SDL_Instance; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = 0; + SDL_zero(wcex); + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.lpszClassName = SDL_Appname; + wcex.style = SDL_Appstyle; + wcex.lpfnWndProc = DefWindowProc; + wcex.hInstance = SDL_Instance; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) hint = SDL_GetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON); @@ -1926,9 +2073,8 @@ SDL_RegisterApp(const char *name, Uint32 style, void *hInst) wcex.hIconSm = LoadIcon(SDL_Instance, MAKEINTRESOURCE(SDL_atoi(hint))); } } else { - /* Use the first icon as a default icon, like in the Explorer */ - GetModuleFileName(SDL_Instance, path, MAX_PATH); - ExtractIconEx(path, 0, &wcex.hIcon, &wcex.hIconSm, 1); + /* Use the first icon as a default icon, like in the Explorer. */ + EnumResourceNames(SDL_Instance, RT_GROUP_ICON, WIN_ResourceNameCallback, (LONG_PTR)&wcex); } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ @@ -1942,8 +2088,7 @@ SDL_RegisterApp(const char *name, Uint32 style, void *hInst) } /* Unregisters the windowclass registered in SDL_RegisterApp above. */ -void -SDL_UnregisterApp() +void SDL_UnregisterApp(void) { WNDCLASSEX wcex; diff --git a/src/video/windows/SDL_windowsevents.h b/src/video/windows/SDL_windowsevents.h index be7f21ff29cfa..7e1e5b1581d42 100644 --- a/src/video/windows/SDL_windowsevents.h +++ b/src/video/windows/SDL_windowsevents.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ extern LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); extern void WIN_PumpEvents(_THIS); extern void WIN_SendWakeupEvent(_THIS, SDL_Window *window); -extern int WIN_WaitEventTimeout(_THIS, int timeout); +extern int WIN_WaitEventTimeout(_THIS, int timeout); #endif /* SDL_windowsevents_h_ */ diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index 4076e6f52e0b5..8160e3e1d8546 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,17 +20,20 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" -int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch) +int WIN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_bool isstack; size_t size; LPBITMAPINFO info; HBITMAP hbm; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); /* Free the old framebuffer surface */ if (data->mdc) { @@ -41,7 +44,7 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi } /* Find out the format of the screen */ - size = sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD); + size = sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD); info = (LPBITMAPINFO)SDL_small_alloc(Uint8, size, &isstack); if (!info) { return SDL_OutOfMemory(); @@ -62,11 +65,10 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi Uint32 *masks; bpp = info->bmiHeader.biPlanes * info->bmiHeader.biBitCount; - masks = (Uint32*)((Uint8*)info + info->bmiHeader.biSize); + masks = (Uint32 *)((Uint8 *)info + info->bmiHeader.biSize); *format = SDL_MasksToPixelFormatEnum(bpp, masks[0], masks[1], masks[2], 0); } - if (*format == SDL_PIXELFORMAT_UNKNOWN) - { + if (*format == SDL_PIXELFORMAT_UNKNOWN) { /* We'll use RGB format for now */ *format = SDL_PIXELFORMAT_RGB888; @@ -79,10 +81,10 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi } /* Fill in the size information */ - *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); - info->bmiHeader.biWidth = window->w; - info->bmiHeader.biHeight = -window->h; /* negative for topdown bitmap */ - info->bmiHeader.biSizeImage = window->h * (*pitch); + *pitch = (((w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); + info->bmiHeader.biWidth = w; + info->bmiHeader.biHeight = -h; /* negative for topdown bitmap */ + info->bmiHeader.biSizeImage = (DWORD)h * (*pitch); data->mdc = CreateCompatibleDC(data->hdc); data->hbm = CreateDIBSection(data->hdc, info, DIB_RGB_COLORS, pixels, NULL, 0); @@ -96,9 +98,9 @@ int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, voi return 0; } -int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects) +int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; int i; for (i = 0; i < numrects; ++i) { @@ -108,9 +110,9 @@ int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rec return 0; } -void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (!data) { /* The window wasn't fully initialized */ diff --git a/src/video/windows/SDL_windowsframebuffer.h b/src/video/windows/SDL_windowsframebuffer.h index 04fc3d130249f..f48d97e878716 100644 --- a/src/video/windows/SDL_windowsframebuffer.h +++ b/src/video/windows/SDL_windowsframebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,8 @@ */ #include "../../SDL_internal.h" -extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); -extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); -extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int WIN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); +extern int WIN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); +extern void WIN_DestroyWindowFramebuffer(_THIS, SDL_Window *window); /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index a62ba071709b1..12f84a3aeba13 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" #include "SDL_hints.h" @@ -36,26 +36,24 @@ static void IME_Init(SDL_VideoData *videodata, HWND hwnd); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); static void IME_Quit(SDL_VideoData *videodata); -static void IME_ClearComposition(SDL_VideoData *videodata); -static SDL_bool IME_IsTextInputShown(SDL_VideoData* videodata); +static SDL_bool IME_IsTextInputShown(SDL_VideoData *videodata); #endif /* !SDL_DISABLE_WINDOWS_IME */ #ifndef MAPVK_VK_TO_VSC -#define MAPVK_VK_TO_VSC 0 +#define MAPVK_VK_TO_VSC 0 #endif #ifndef MAPVK_VSC_TO_VK -#define MAPVK_VSC_TO_VK 1 +#define MAPVK_VSC_TO_VK 1 #endif #ifndef MAPVK_VK_TO_CHAR -#define MAPVK_VK_TO_CHAR 2 +#define MAPVK_VK_TO_CHAR 2 #endif /* Alphabetic scancodes for PC keyboards */ -void -WIN_InitKeyboard(_THIS) +void WIN_InitKeyboard(_THIS) { #ifndef SDL_DISABLE_WINDOWS_IME - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; data->ime_com_initialized = SDL_FALSE; data->ime_threadmgr = 0; @@ -66,7 +64,7 @@ WIN_InitKeyboard(_THIS) data->ime_hwnd_current = 0; data->ime_himc = 0; data->ime_composition_length = 32 * sizeof(WCHAR); - data->ime_composition = (WCHAR*)SDL_malloc(data->ime_composition_length + sizeof(WCHAR)); + data->ime_composition = (WCHAR *)SDL_malloc(data->ime_composition_length + sizeof(WCHAR)); data->ime_composition[0] = 0; data->ime_readingstring[0] = 0; data->ime_cursor = 0; @@ -111,13 +109,12 @@ WIN_InitKeyboard(_THIS) SDL_SetScancodeName(SDL_SCANCODE_RGUI, "Right Windows"); /* Are system caps/num/scroll lock active? Set our state to match. */ - SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) != 0); - SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) != 0); - SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) != 0); + SDL_ToggleModState(KMOD_CAPS, (GetKeyState(VK_CAPITAL) & 0x0001) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_NUM, (GetKeyState(VK_NUMLOCK) & 0x0001) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_SCROLL, (GetKeyState(VK_SCROLL) & 0x0001) ? SDL_TRUE : SDL_FALSE); } -void -WIN_UpdateKeymap(SDL_bool send_event) +void WIN_UpdateKeymap(SDL_bool send_event) { int i; SDL_Scancode scancode; @@ -129,24 +126,22 @@ WIN_UpdateKeymap(SDL_bool send_event) int vk; /* Make sure this scancode is a valid character scancode */ scancode = windows_scancode_table[i]; - if (scancode == SDL_SCANCODE_UNKNOWN ) { + if (scancode == SDL_SCANCODE_UNKNOWN) { continue; } /* If this key is one of the non-mappable keys, ignore it */ - /* Not mapping numbers fixes the French layout, giving numeric keycodes for the number keys, which is the expected behavior */ - if ((keymap[scancode] & SDLK_SCANCODE_MASK) || - /* scancode == SDL_SCANCODE_GRAVE || */ /* Uncomment this line to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ - (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) ) { + /* Uncomment the second part re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ + if ((keymap[scancode] & SDLK_SCANCODE_MASK) /*|| scancode == SDL_SCANCODE_GRAVE*/) { continue; } - vk = MapVirtualKey(i, MAPVK_VSC_TO_VK); - if ( vk ) { - int ch = (MapVirtualKey( vk, MAPVK_VK_TO_CHAR ) & 0x7FFF); - if ( ch ) { - if ( ch >= 'A' && ch <= 'Z' ) { - keymap[scancode] = SDLK_a + ( ch - 'A' ); + vk = MapVirtualKey(i, MAPVK_VSC_TO_VK); + if (vk) { + int ch = (MapVirtualKey(vk, MAPVK_VK_TO_CHAR) & 0x7FFF); + if (ch) { + if (ch >= 'A' && ch <= 'Z') { + keymap[scancode] = SDLK_a + (ch - 'A'); } else { keymap[scancode] = ch; } @@ -157,10 +152,9 @@ WIN_UpdateKeymap(SDL_bool send_event) SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); } -void -WIN_QuitKeyboard(_THIS) +void WIN_QuitKeyboard(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; #ifndef SDL_DISABLE_WINDOWS_IME IME_Quit(data); @@ -172,11 +166,10 @@ WIN_QuitKeyboard(_THIS) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -void -WIN_ResetDeadKeys() +void WIN_ResetDeadKeys(void) { /* - if a deadkey has been typed, but not the next character (which the deadkey might modify), + if a deadkey has been typed, but not the next character (which the deadkey might modify), this tries to undo the effect pressing the deadkey. see: http://archives.miloush.net/michkap/archive/2006/09/10/748775.html */ @@ -202,8 +195,7 @@ WIN_ResetDeadKeys() } } -void -WIN_StartTextInput(_THIS) +void WIN_StartTextInput(_THIS) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_Window *window; @@ -214,7 +206,7 @@ WIN_StartTextInput(_THIS) #ifndef SDL_DISABLE_WINDOWS_IME window = SDL_GetKeyboardFocus(); if (window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_GetWindowSize(window, &videodata->ime_winwidth, &videodata->ime_winheight); IME_Init(videodata, hwnd); @@ -223,8 +215,7 @@ WIN_StartTextInput(_THIS) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -void -WIN_StopTextInput(_THIS) +void WIN_StopTextInput(_THIS) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_Window *window; @@ -235,7 +226,7 @@ WIN_StopTextInput(_THIS) #ifndef SDL_DISABLE_WINDOWS_IME window = SDL_GetKeyboardFocus(); if (window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; IME_Init(videodata, hwnd); IME_Disable(videodata, hwnd); @@ -243,8 +234,7 @@ WIN_StopTextInput(_THIS) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -void -WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) +void WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) { SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; HIMC himc = 0; @@ -258,8 +248,7 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) videodata->ime_rect = *rect; himc = ImmGetContext(videodata->ime_hwnd_current); - if (himc) - { + if (himc) { COMPOSITIONFORM cof; CANDIDATEFORM caf; @@ -267,9 +256,9 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) cof.ptCurrentPos.x = videodata->ime_rect.x; cof.ptCurrentPos.y = videodata->ime_rect.y; cof.rcArea.left = videodata->ime_rect.x; - cof.rcArea.right = videodata->ime_rect.x + videodata->ime_rect.w; + cof.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; cof.rcArea.top = videodata->ime_rect.y; - cof.rcArea.bottom = videodata->ime_rect.y + videodata->ime_rect.h; + cof.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; ImmSetCompositionWindow(himc, &cof); caf.dwIndex = 0; @@ -277,9 +266,9 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) caf.ptCurrentPos.x = videodata->ime_rect.x; caf.ptCurrentPos.y = videodata->ime_rect.y; caf.rcArea.left = videodata->ime_rect.x; - caf.rcArea.right = videodata->ime_rect.x + videodata->ime_rect.w; + caf.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; caf.rcArea.top = videodata->ime_rect.y; - caf.rcArea.bottom = videodata->ime_rect.y + videodata->ime_rect.h; + caf.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; ImmSetCandidateWindow(himc, &caf); ImmReleaseContext(videodata->ime_hwnd_current, himc); @@ -287,7 +276,6 @@ WIN_SetTextInputRect(_THIS, const SDL_Rect *rect) #endif /* !SDL_DISABLE_WINDOWS_IME */ } - #ifdef SDL_DISABLE_WINDOWS_IME void WIN_ClearComposition(_THIS) @@ -299,8 +287,7 @@ SDL_bool WIN_IsTextInputShown(_THIS) return SDL_FALSE; } -SDL_bool -IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { return SDL_FALSE; } @@ -318,58 +305,58 @@ void IME_Present(SDL_VideoData *videodata) #endif #ifdef USE_INIT_GUID #undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) static const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink, 0x71C6E74E,0x0F28,0x11D8,0xA8,0x2A,0x00,0x06,0x5B,0x84,0x43,0x5C); -DEFINE_GUID(IID_ITfUIElementSink, 0xEA1EA136,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C); -DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD, 0x34745C63,0xB2F0,0x4784,0x8B,0x67,0x5E,0x12,0xC8,0x70,0x1A,0x31); -DEFINE_GUID(IID_ITfSource, 0x4EA48A35,0x60AE,0x446F,0x8F,0xD6,0xE6,0xA8,0xD8,0x24,0x59,0xF7); -DEFINE_GUID(IID_ITfUIElementMgr, 0xEA1EA135,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C); -DEFINE_GUID(IID_ITfCandidateListUIElement, 0xEA1EA138,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C); -DEFINE_GUID(IID_ITfReadingInformationUIElement, 0xEA1EA139,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C); -DEFINE_GUID(IID_ITfThreadMgr, 0xAA80E801,0x2021,0x11D2,0x93,0xE0,0x00,0x60,0xB0,0x67,0xB8,0x6E); -DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529A9E6B,0x6587,0x4F23,0xAB,0x9E,0x9C,0x7D,0x68,0x3E,0x3C,0x50); -DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3,0x7594,0x4CB0,0xBB,0x58,0x69,0x62,0x8F,0x5F,0x45,0x8C); +#define DEFINE_GUID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) static const GUID n = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } +DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink, 0x71C6E74E, 0x0F28, 0x11D8, 0xA8, 0x2A, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); +DEFINE_GUID(IID_ITfUIElementSink, 0xEA1EA136, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); +DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD, 0x34745C63, 0xB2F0, 0x4784, 0x8B, 0x67, 0x5E, 0x12, 0xC8, 0x70, 0x1A, 0x31); +DEFINE_GUID(IID_ITfSource, 0x4EA48A35, 0x60AE, 0x446F, 0x8F, 0xD6, 0xE6, 0xA8, 0xD8, 0x24, 0x59, 0xF7); +DEFINE_GUID(IID_ITfUIElementMgr, 0xEA1EA135, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); +DEFINE_GUID(IID_ITfCandidateListUIElement, 0xEA1EA138, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); +DEFINE_GUID(IID_ITfReadingInformationUIElement, 0xEA1EA139, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); +DEFINE_GUID(IID_ITfThreadMgr, 0xAA80E801, 0x2021, 0x11D2, 0x93, 0xE0, 0x00, 0x60, 0xB0, 0x67, 0xB8, 0x6E); +DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529A9E6B, 0x6587, 0x4F23, 0xAB, 0x9E, 0x9C, 0x7D, 0x68, 0x3E, 0x3C, 0x50); +DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3, 0x7594, 0x4CB0, 0xBB, 0x58, 0x69, 0x62, 0x8F, 0x5F, 0x45, 0x8C); #endif #define LANG_CHT MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL) #define LANG_CHS MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED) -#define MAKEIMEVERSION(major,minor) ((DWORD) (((BYTE)(major) << 24) | ((BYTE)(minor) << 16) )) -#define IMEID_VER(id) ((id) & 0xffff0000) -#define IMEID_LANG(id) ((id) & 0x0000ffff) - -#define CHT_HKL_DAYI ((HKL)(UINT_PTR)0xE0060404) -#define CHT_HKL_NEW_PHONETIC ((HKL)(UINT_PTR)0xE0080404) -#define CHT_HKL_NEW_CHANG_JIE ((HKL)(UINT_PTR)0xE0090404) -#define CHT_HKL_NEW_QUICK ((HKL)(UINT_PTR)0xE00A0404) -#define CHT_HKL_HK_CANTONESE ((HKL)(UINT_PTR)0xE00B0404) -#define CHT_IMEFILENAME1 "TINTLGNT.IME" -#define CHT_IMEFILENAME2 "CINTLGNT.IME" -#define CHT_IMEFILENAME3 "MSTCIPHA.IME" -#define IMEID_CHT_VER42 (LANG_CHT | MAKEIMEVERSION(4, 2)) -#define IMEID_CHT_VER43 (LANG_CHT | MAKEIMEVERSION(4, 3)) -#define IMEID_CHT_VER44 (LANG_CHT | MAKEIMEVERSION(4, 4)) -#define IMEID_CHT_VER50 (LANG_CHT | MAKEIMEVERSION(5, 0)) -#define IMEID_CHT_VER51 (LANG_CHT | MAKEIMEVERSION(5, 1)) -#define IMEID_CHT_VER52 (LANG_CHT | MAKEIMEVERSION(5, 2)) -#define IMEID_CHT_VER60 (LANG_CHT | MAKEIMEVERSION(6, 0)) -#define IMEID_CHT_VER_VISTA (LANG_CHT | MAKEIMEVERSION(7, 0)) - -#define CHS_HKL ((HKL)(UINT_PTR)0xE00E0804) -#define CHS_IMEFILENAME1 "PINTLGNT.IME" -#define CHS_IMEFILENAME2 "MSSCIPYA.IME" -#define IMEID_CHS_VER41 (LANG_CHS | MAKEIMEVERSION(4, 1)) -#define IMEID_CHS_VER42 (LANG_CHS | MAKEIMEVERSION(4, 2)) -#define IMEID_CHS_VER53 (LANG_CHS | MAKEIMEVERSION(5, 3)) - -#define LANG() LOWORD((videodata->ime_hkl)) -#define PRIMLANG() ((WORD)PRIMARYLANGID(LANG())) -#define SUBLANG() SUBLANGID(LANG()) +#define MAKEIMEVERSION(major, minor) ((DWORD)(((BYTE)(major) << 24) | ((BYTE)(minor) << 16))) +#define IMEID_VER(id) ((id)&0xffff0000) +#define IMEID_LANG(id) ((id)&0x0000ffff) + +#define CHT_HKL_DAYI ((HKL)(UINT_PTR)0xE0060404) +#define CHT_HKL_NEW_PHONETIC ((HKL)(UINT_PTR)0xE0080404) +#define CHT_HKL_NEW_CHANG_JIE ((HKL)(UINT_PTR)0xE0090404) +#define CHT_HKL_NEW_QUICK ((HKL)(UINT_PTR)0xE00A0404) +#define CHT_HKL_HK_CANTONESE ((HKL)(UINT_PTR)0xE00B0404) +#define CHT_IMEFILENAME1 "TINTLGNT.IME" +#define CHT_IMEFILENAME2 "CINTLGNT.IME" +#define CHT_IMEFILENAME3 "MSTCIPHA.IME" +#define IMEID_CHT_VER42 (LANG_CHT | MAKEIMEVERSION(4, 2)) +#define IMEID_CHT_VER43 (LANG_CHT | MAKEIMEVERSION(4, 3)) +#define IMEID_CHT_VER44 (LANG_CHT | MAKEIMEVERSION(4, 4)) +#define IMEID_CHT_VER50 (LANG_CHT | MAKEIMEVERSION(5, 0)) +#define IMEID_CHT_VER51 (LANG_CHT | MAKEIMEVERSION(5, 1)) +#define IMEID_CHT_VER52 (LANG_CHT | MAKEIMEVERSION(5, 2)) +#define IMEID_CHT_VER60 (LANG_CHT | MAKEIMEVERSION(6, 0)) +#define IMEID_CHT_VER_VISTA (LANG_CHT | MAKEIMEVERSION(7, 0)) + +#define CHS_HKL ((HKL)(UINT_PTR)0xE00E0804) +#define CHS_IMEFILENAME1 "PINTLGNT.IME" +#define CHS_IMEFILENAME2 "MSSCIPYA.IME" +#define IMEID_CHS_VER41 (LANG_CHS | MAKEIMEVERSION(4, 1)) +#define IMEID_CHS_VER42 (LANG_CHS | MAKEIMEVERSION(4, 2)) +#define IMEID_CHS_VER53 (LANG_CHS | MAKEIMEVERSION(5, 3)) + +#define LANG() LOWORD((videodata->ime_hkl)) +#define PRIMLANG() ((WORD)PRIMARYLANGID(LANG())) +#define SUBLANG() SUBLANGID(LANG()) static void IME_UpdateInputLocale(SDL_VideoData *videodata); static int IME_ShowCandidateList(SDL_VideoData *videodata); static void IME_ClearComposition(SDL_VideoData *videodata); -static void IME_SetWindow(SDL_VideoData* videodata, HWND hwnd); +static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd); static void IME_SetupAPI(SDL_VideoData *videodata); static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); @@ -380,19 +367,18 @@ static void UILess_ReleaseSinks(SDL_VideoData *videodata); static void UILess_EnableUIUpdates(SDL_VideoData *videodata); static void UILess_DisableUIUpdates(SDL_VideoData *videodata); -static SDL_bool -WIN_ShouldShowNativeUI() +static SDL_bool WIN_ShouldShowNativeUI(void) { return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_FALSE); } -static void -IME_Init(SDL_VideoData *videodata, HWND hwnd) +static void IME_Init(SDL_VideoData *videodata, HWND hwnd) { HRESULT hResult = S_OK; - if (videodata->ime_initialized) + if (videodata->ime_initialized) { return; + } videodata->ime_hwnd_main = hwnd; if (SUCCEEDED(WIN_CoInitialize())) { @@ -411,10 +397,12 @@ IME_Init(SDL_VideoData *videodata, HWND hwnd) SDL_ClearError(); return; } + /* *INDENT-OFF* */ /* clang-format off */ videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC"); videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC"); videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC"); videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC"); + /* *INDENT-ON* */ /* clang-format on */ IME_SetWindow(videodata, hwnd); videodata->ime_himc = ImmGetContext(hwnd); @@ -427,55 +415,59 @@ IME_Init(SDL_VideoData *videodata, HWND hwnd) videodata->ime_available = SDL_TRUE; IME_UpdateInputLocale(videodata); IME_SetupAPI(videodata); - if (WIN_ShouldShowNativeUI()) + if (WIN_ShouldShowNativeUI()) { videodata->ime_uiless = SDL_FALSE; - else + } else { videodata->ime_uiless = UILess_SetupSinks(videodata); + } IME_UpdateInputLocale(videodata); IME_Disable(videodata, hwnd); } -static void -IME_Enable(SDL_VideoData *videodata, HWND hwnd) +static void IME_Enable(SDL_VideoData *videodata, HWND hwnd) { - if (!videodata->ime_initialized || !videodata->ime_hwnd_current) + if (!videodata->ime_initialized || !videodata->ime_hwnd_current) { return; + } if (!videodata->ime_available) { IME_Disable(videodata, hwnd); return; } - if (videodata->ime_hwnd_current == videodata->ime_hwnd_main) + if (videodata->ime_hwnd_current == videodata->ime_hwnd_main) { ImmAssociateContext(videodata->ime_hwnd_current, videodata->ime_himc); + } videodata->ime_enabled = SDL_TRUE; IME_UpdateInputLocale(videodata); UILess_EnableUIUpdates(videodata); } -static void -IME_Disable(SDL_VideoData *videodata, HWND hwnd) +static void IME_Disable(SDL_VideoData *videodata, HWND hwnd) { - if (!videodata->ime_initialized || !videodata->ime_hwnd_current) + if (!videodata->ime_initialized || !videodata->ime_hwnd_current) { return; + } IME_ClearComposition(videodata); - if (videodata->ime_hwnd_current == videodata->ime_hwnd_main) + if (videodata->ime_hwnd_current == videodata->ime_hwnd_main) { ImmAssociateContext(videodata->ime_hwnd_current, (HIMC)0); + } videodata->ime_enabled = SDL_FALSE; UILess_DisableUIUpdates(videodata); } -static void -IME_Quit(SDL_VideoData *videodata) +static void IME_Quit(SDL_VideoData *videodata) { - if (!videodata->ime_initialized) + if (!videodata->ime_initialized) { return; + } UILess_ReleaseSinks(videodata); - if (videodata->ime_hwnd_main) + if (videodata->ime_hwnd_main) { ImmAssociateContext(videodata->ime_hwnd_main, videodata->ime_himc); + } videodata->ime_hwnd_main = 0; videodata->ime_himc = 0; @@ -495,8 +487,7 @@ IME_Quit(SDL_VideoData *videodata) videodata->ime_initialized = SDL_FALSE; } -static void -IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) +static void IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) { DWORD id = 0; HIMC himc = 0; @@ -507,77 +498,83 @@ IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) BOOL vertical = FALSE; UINT maxuilen = 0; - if (videodata->ime_uiless) + if (videodata->ime_uiless) { return; + } videodata->ime_readingstring[0] = 0; - + id = IME_GetId(videodata, 0); - if (!id) + if (!id) { return; + } himc = ImmGetContext(hwnd); - if (!himc) + if (!himc) { return; + } if (videodata->GetReadingString) { len = videodata->GetReadingString(himc, 0, 0, &err, &vertical, &maxuilen); if (len) { - if (len > SDL_arraysize(buffer)) + if (len > SDL_arraysize(buffer)) { len = SDL_arraysize(buffer); + } len = videodata->GetReadingString(himc, len, s, &err, &vertical, &maxuilen); } SDL_wcslcpy(videodata->ime_readingstring, s, len); - } - else { + } else { LPINPUTCONTEXT2 lpimc = videodata->ImmLockIMC(himc); LPBYTE p = 0; s = 0; - switch (id) - { + switch (id) { case IMEID_CHT_VER42: case IMEID_CHT_VER43: case IMEID_CHT_VER44: p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 24); - if (!p) + if (!p) { break; + } - len = *(DWORD *)(p + 7*4 + 32*4); + len = *(DWORD *)(p + 7 * 4 + 32 * 4); s = (WCHAR *)(p + 56); break; case IMEID_CHT_VER51: case IMEID_CHT_VER52: case IMEID_CHS_VER53: p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 4); - if (!p) + if (!p) { break; + } - p = *(LPBYTE *)((LPBYTE)p + 1*4 + 5*4); - if (!p) + p = *(LPBYTE *)(p + 1 * 4 + 5 * 4); + if (!p) { break; + } - len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2); - s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4); + len = *(DWORD *)(p + 1 * 4 + (16 * 2 + 2 * 4) + 5 * 4 + 16 * 2); + s = (WCHAR *)(p + 1 * 4 + (16 * 2 + 2 * 4) + 5 * 4); break; case IMEID_CHS_VER41: - { - int offset = (IME_GetId(videodata, 1) >= 0x00000002) ? 8 : 7; - p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + offset * 4); - if (!p) - break; - - len = *(DWORD *)(p + 7*4 + 16*2*4); - s = (WCHAR *)(p + 6*4 + 16*2*1); + { + int offset = (IME_GetId(videodata, 1) >= 0x00000002) ? 8 : 7; + p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + offset * 4); + if (!p) { + break; } - break; + + len = *(DWORD *)(p + 7 * 4 + 16 * 2 * 4); + s = (WCHAR *)(p + 6 * 4 + 16 * 2 * 1); + } break; case IMEID_CHS_VER42: - p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1*4 + 1*4 + 6*4); - if (!p) + p = *(LPBYTE *)((LPBYTE)videodata->ImmLockIMCC(lpimc->hPrivate) + 1 * 4 + 1 * 4 + 6 * 4); + if (!p) { break; + } - len = *(DWORD *)(p + 1*4 + (16*2+2*4) + 5*4 + 16*2); - s = (WCHAR *)(p + 1*4 + (16*2+2*4) + 5*4); + len = *(DWORD *)(p + 1 * 4 + (16 * 2 + 2 * 4) + 5 * 4 + 16 * 2); + s = (WCHAR *)(p + 1 * 4 + (16 * 2 + 2 * 4) + 5 * 4); break; } if (s) { @@ -592,13 +589,13 @@ IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) IME_SendEditingEvent(videodata); } -static void -IME_InputLangChanged(SDL_VideoData *videodata) +static void IME_InputLangChanged(SDL_VideoData *videodata) { UINT lang = PRIMLANG(); IME_UpdateInputLocale(videodata); - if (!videodata->ime_uiless) + if (!videodata->ime_uiless) { videodata->ime_candlistindexbase = (videodata->ime_hkl == CHT_HKL_DAYI) ? 0 : 1; + } IME_SetupAPI(videodata); if (lang != PRIMLANG()) { @@ -606,11 +603,10 @@ IME_InputLangChanged(SDL_VideoData *videodata) } } -static DWORD -IME_GetId(SDL_VideoData *videodata, UINT uIndex) +static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex) { static HKL hklprev = 0; - static DWORD dwRet[2] = {0}; + static DWORD dwRet[2] = { 0 }; DWORD dwVerSize = 0; DWORD dwVerHandle = 0; LPVOID lpVerBuffer = 0; @@ -622,8 +618,9 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex) SDL_assert(uIndex < sizeof(dwRet) / sizeof(dwRet[0])); hkl = videodata->ime_hkl; - if (hklprev == hkl) + if (hklprev == hkl) { return dwRet[uIndex]; + } hklprev = hkl; SDL_assert(uIndex == 0); @@ -633,11 +630,7 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex) dwRet[1] = 0; return dwRet[0]; } - if (hkl != CHT_HKL_NEW_PHONETIC - && hkl != CHT_HKL_NEW_CHANG_JIE - && hkl != CHT_HKL_NEW_QUICK - && hkl != CHT_HKL_HK_CANTONESE - && hkl != CHS_HKL) { + if (hkl != CHT_HKL_NEW_PHONETIC && hkl != CHT_HKL_NEW_CHANG_JIE && hkl != CHT_HKL_NEW_QUICK && hkl != CHT_HKL_HK_CANTONESE && hkl != CHS_HKL) { dwRet[0] = dwRet[1] = 0; return dwRet[0]; } @@ -646,45 +639,38 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex) return dwRet[0]; } if (!videodata->GetReadingString) { - #define LCID_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) - if (CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME1, -1) != 2 - && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME2, -1) != 2 - && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME3, -1) != 2 - && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME1, -1) != 2 - && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME2, -1) != 2) { +#define LCID_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT) + if (CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME1, -1) != 2 && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME2, -1) != 2 && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHT_IMEFILENAME3, -1) != 2 && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME1, -1) != 2 && CompareStringA(LCID_INVARIANT, NORM_IGNORECASE, szTemp, -1, CHS_IMEFILENAME2, -1) != 2) { dwRet[0] = dwRet[1] = 0; return dwRet[0]; } - #undef LCID_INVARIANT +#undef LCID_INVARIANT dwVerSize = GetFileVersionInfoSizeA(szTemp, &dwVerHandle); if (dwVerSize) { lpVerBuffer = SDL_malloc(dwVerSize); if (lpVerBuffer) { if (GetFileVersionInfoA(szTemp, dwVerHandle, dwVerSize, lpVerBuffer)) { if (VerQueryValueA(lpVerBuffer, "\\", &lpVerData, &cbVerData)) { - #define pVerFixedInfo ((VS_FIXEDFILEINFO FAR*)lpVerData) +#define pVerFixedInfo ((VS_FIXEDFILEINFO FAR *)lpVerData) DWORD dwVer = pVerFixedInfo->dwFileVersionMS; dwVer = (dwVer & 0x00ff0000) << 8 | (dwVer & 0x000000ff) << 16; if ((videodata->GetReadingString) || - ((dwLang == LANG_CHT) && ( - dwVer == MAKEIMEVERSION(4, 2) || - dwVer == MAKEIMEVERSION(4, 3) || - dwVer == MAKEIMEVERSION(4, 4) || - dwVer == MAKEIMEVERSION(5, 0) || - dwVer == MAKEIMEVERSION(5, 1) || - dwVer == MAKEIMEVERSION(5, 2) || - dwVer == MAKEIMEVERSION(6, 0))) - || - ((dwLang == LANG_CHS) && ( - dwVer == MAKEIMEVERSION(4, 1) || - dwVer == MAKEIMEVERSION(4, 2) || - dwVer == MAKEIMEVERSION(5, 3)))) { + ((dwLang == LANG_CHT) && (dwVer == MAKEIMEVERSION(4, 2) || + dwVer == MAKEIMEVERSION(4, 3) || + dwVer == MAKEIMEVERSION(4, 4) || + dwVer == MAKEIMEVERSION(5, 0) || + dwVer == MAKEIMEVERSION(5, 1) || + dwVer == MAKEIMEVERSION(5, 2) || + dwVer == MAKEIMEVERSION(6, 0))) || + ((dwLang == LANG_CHS) && (dwVer == MAKEIMEVERSION(4, 1) || + dwVer == MAKEIMEVERSION(4, 2) || + dwVer == MAKEIMEVERSION(5, 3)))) { dwRet[0] = dwVer | dwLang; dwRet[1] = pVerFixedInfo->dwFileVersionLS; SDL_free(lpVerBuffer); return dwRet[0]; } - #undef pVerFixedInfo +#undef pVerFixedInfo } } } @@ -695,29 +681,33 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex) return dwRet[0]; } -static void -IME_SetupAPI(SDL_VideoData *videodata) +static void IME_SetupAPI(SDL_VideoData *videodata) { char ime_file[MAX_PATH + 1]; - void* hime = 0; + void *hime = 0; HKL hkl = 0; videodata->GetReadingString = 0; videodata->ShowReadingWindow = 0; - if (videodata->ime_uiless) + if (videodata->ime_uiless) { return; + } hkl = videodata->ime_hkl; - if (!ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1)) + if (!ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1)) { return; + } hime = SDL_LoadObject(ime_file); - if (!hime) + if (!hime) { return; + } + /* *INDENT-OFF* */ /* clang-format off */ videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT)) SDL_LoadFunction(hime, "GetReadingString"); videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL)) SDL_LoadFunction(hime, "ShowReadingWindow"); + /* *INDENT-ON* */ /* clang-format on */ if (videodata->ShowReadingWindow) { HIMC himc = ImmGetContext(videodata->ime_hwnd_current); @@ -728,72 +718,74 @@ IME_SetupAPI(SDL_VideoData *videodata) } } -static void -IME_SetWindow(SDL_VideoData* videodata, HWND hwnd) +static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd) { videodata->ime_hwnd_current = hwnd; if (videodata->ime_threadmgr) { struct ITfDocumentMgr *document_mgr = 0; if (SUCCEEDED(videodata->ime_threadmgr->lpVtbl->AssociateFocus(videodata->ime_threadmgr, hwnd, NULL, &document_mgr))) { - if (document_mgr) + if (document_mgr) { document_mgr->lpVtbl->Release(document_mgr); + } } } } -static void -IME_UpdateInputLocale(SDL_VideoData *videodata) +static void IME_UpdateInputLocale(SDL_VideoData *videodata) { HKL hklnext = GetKeyboardLayout(0); - if (hklnext == videodata->ime_hkl) + if (hklnext == videodata->ime_hkl) { return; + } videodata->ime_hkl = hklnext; videodata->ime_candvertical = (PRIMLANG() == LANG_KOREAN || LANG() == LANG_CHS) ? SDL_FALSE : SDL_TRUE; } -static void -IME_ClearComposition(SDL_VideoData *videodata) +static void IME_ClearComposition(SDL_VideoData *videodata) { HIMC himc = 0; - if (!videodata->ime_initialized) + if (!videodata->ime_initialized) { return; + } himc = ImmGetContext(videodata->ime_hwnd_current); - if (!himc) + if (!himc) { return; + } ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); - if (videodata->ime_uiless) + if (videodata->ime_uiless) { ImmSetCompositionString(himc, SCS_SETSTR, TEXT(""), sizeof(TCHAR), TEXT(""), sizeof(TCHAR)); + } ImmNotifyIME(himc, NI_CLOSECANDIDATE, 0, 0); ImmReleaseContext(videodata->ime_hwnd_current, himc); SDL_SendEditingText("", 0, 0); } -static SDL_bool -IME_IsTextInputShown(SDL_VideoData* videodata) +static SDL_bool IME_IsTextInputShown(SDL_VideoData *videodata) { - if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) + if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) { return SDL_FALSE; + } return videodata->ime_uicontext != 0 ? SDL_TRUE : SDL_FALSE; } -static void -IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) +static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) { LONG length; DWORD dwLang = ((DWORD_PTR)videodata->ime_hkl & 0xffff); length = ImmGetCompositionStringW(himc, string, NULL, 0); if (length > 0 && videodata->ime_composition_length < length) { - if (videodata->ime_composition != NULL) + if (videodata->ime_composition) { SDL_free(videodata->ime_composition); + } - videodata->ime_composition = (WCHAR*)SDL_malloc(length + sizeof(WCHAR)); + videodata->ime_composition = (WCHAR *)SDL_malloc(length + sizeof(WCHAR)); videodata->ime_composition_length = length; } @@ -801,11 +793,11 @@ IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) himc, string, videodata->ime_composition, - videodata->ime_composition_length - ); + videodata->ime_composition_length); - if (length < 0) + if (length < 0) { length = 0; + } length /= sizeof(WCHAR); videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); @@ -816,8 +808,9 @@ IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) // Traditional Chinese IMEs add a placeholder U+3000 // Simplified Chinese IMEs seem to add a placeholder U+0020 sometimes int i; - for (i = videodata->ime_cursor + 1; i < length; ++i) + for (i = videodata->ime_cursor + 1; i < length; ++i) { videodata->ime_composition[i - 1] = videodata->ime_composition[i]; + } --length; } @@ -831,19 +824,19 @@ IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) length = ImmGetCompositionStringW(himc, GCS_COMPATTR, NULL, 0); if (length > 0) { - Uint8* attributes = (Uint8*)SDL_malloc(length + sizeof(WCHAR)); + Uint8 *attributes = (Uint8 *)SDL_malloc(length + sizeof(WCHAR)); ImmGetCompositionString(himc, GCS_COMPATTR, attributes, length); for (start = 0; start < length; ++start) { - if (attributes[start] == ATTR_TARGET_CONVERTED || - attributes[start] == ATTR_TARGET_NOTCONVERTED) + if (attributes[start] == ATTR_TARGET_CONVERTED || attributes[start] == ATTR_TARGET_NOTCONVERTED) { break; + } } for (end = start; end < length; ++end) { - if (attributes[end] != ATTR_TARGET_CONVERTED && - attributes[end] != ATTR_TARGET_NOTCONVERTED) + if (attributes[end] != ATTR_TARGET_CONVERTED && attributes[end] != ATTR_TARGET_NOTCONVERTED) { break; + } } if (start == length) { @@ -858,8 +851,7 @@ IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) } } -static void -IME_SendInputEvent(SDL_VideoData *videodata) +static void IME_SendInputEvent(SDL_VideoData *videodata) { char *s = 0; s = WIN_StringToUTF8W(videodata->ime_composition); @@ -871,8 +863,7 @@ IME_SendInputEvent(SDL_VideoData *videodata) videodata->ime_cursor = 0; } -static void -IME_SendEditingEvent(SDL_VideoData *videodata) +static void IME_SendEditingEvent(SDL_VideoData *videodata) { char *s = NULL; WCHAR *buffer = NULL; @@ -881,15 +872,14 @@ IME_SendEditingEvent(SDL_VideoData *videodata) size_t len = SDL_min(SDL_wcslen(videodata->ime_composition), (size_t)videodata->ime_cursor); size += sizeof(videodata->ime_readingstring); - buffer = (WCHAR*)SDL_malloc(size + sizeof(WCHAR)); + buffer = (WCHAR *)SDL_malloc(size + sizeof(WCHAR)); buffer[0] = 0; SDL_wcslcpy(buffer, videodata->ime_composition, len + 1); SDL_wcslcat(buffer, videodata->ime_readingstring, size); SDL_wcslcat(buffer, &videodata->ime_composition[len], size); - } - else { - buffer = (WCHAR*)SDL_malloc(size + sizeof(WCHAR)); + } else { + buffer = (WCHAR *)SDL_malloc(size + sizeof(WCHAR)); buffer[0] = 0; SDL_wcslcpy(buffer, videodata->ime_composition, size); } @@ -900,34 +890,36 @@ IME_SendEditingEvent(SDL_VideoData *videodata) SDL_free(buffer); } -static void -IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate) +static void IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate) { LPWSTR dst = &videodata->ime_candidates[i * MAX_CANDLENGTH]; LPWSTR end = &dst[MAX_CANDLENGTH - 1]; SDL_COMPILE_TIME_ASSERT(IME_CANDIDATE_INDEXING_REQUIRES, MAX_CANDLIST == 10); *dst++ = (WCHAR)(TEXT('0') + ((i + videodata->ime_candlistindexbase) % 10)); - if (videodata->ime_candvertical) + if (videodata->ime_candvertical) { *dst++ = TEXT(' '); + } - while (*candidate && dst < end) + while (*candidate && dst < end) { *dst++ = *candidate++; + } *dst = (WCHAR)'\0'; } -static void -IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) +static void IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) { HIMC himc; DWORD size; LPCANDIDATELIST cand_list; - if (IME_ShowCandidateList(videodata) < 0) + if (IME_ShowCandidateList(videodata) < 0) { return; + } himc = ImmGetContext(hwnd); - if (!himc) + if (!himc) { return; + } size = ImmGetCandidateListW(himc, 0, 0, 0); if (size != 0) { cand_list = (LPCANDIDATELIST)SDL_malloc(size); @@ -946,13 +938,13 @@ IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) for (i = 0; i < videodata->ime_candcount; ++i) { size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1; if (len + cchars > maxcandchar) { - if (i > cand_list->dwSelection) + if (i > cand_list->dwSelection) { break; + } page_start = i; cchars = len; - } - else { + } else { cchars += len; } } @@ -966,9 +958,8 @@ IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) IME_AddCandidate(videodata, j, candidate); } // TODO: why was this necessary? check ime_candvertical instead? PRIMLANG() never equals LANG_CHT ! - //if (PRIMLANG() == LANG_KOREAN || (PRIMLANG() == LANG_CHT && !IME_GetId(videodata, 0))) + // if (PRIMLANG() == LANG_KOREAN || (PRIMLANG() == LANG_CHT && !IME_GetId(videodata, 0))) // videodata->ime_candsel = -1; - } SDL_free(cand_list); } @@ -976,18 +967,19 @@ IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) ImmReleaseContext(hwnd, himc); } -static int -IME_ShowCandidateList(SDL_VideoData *videodata) +static int IME_ShowCandidateList(SDL_VideoData *videodata) { void *candidates; videodata->ime_candcount = 0; candidates = SDL_realloc(videodata->ime_candidates, MAX_CANDSIZE); - if (candidates != NULL) + if (candidates) { videodata->ime_candidates = (WCHAR *)candidates; + } - if (videodata->ime_candidates == NULL) + if (!videodata->ime_candidates) { return -1; + } SDL_memset(videodata->ime_candidates, 0, MAX_CANDSIZE); @@ -998,8 +990,7 @@ IME_ShowCandidateList(SDL_VideoData *videodata) return 0; } -static void -IME_HideCandidateList(SDL_VideoData *videodata) +static void IME_HideCandidateList(SDL_VideoData *videodata) { videodata->ime_dirty = SDL_FALSE; videodata->ime_candlist = SDL_FALSE; @@ -1007,23 +998,22 @@ IME_HideCandidateList(SDL_VideoData *videodata) IME_SendEditingEvent(videodata); } -SDL_bool -IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { SDL_bool trap = SDL_FALSE; HIMC himc = 0; - if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) + if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) { return SDL_FALSE; + } switch (msg) { case WM_KEYDOWN: - if (wParam == VK_PROCESSKEY) - { + if (wParam == VK_PROCESSKEY) { videodata->ime_uicontext = 1; trap = SDL_TRUE; - } - else + } else { videodata->ime_uicontext = 0; + } break; case WM_INPUTLANGCHANGE: IME_InputLangChanged(videodata); @@ -1033,7 +1023,7 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD *lParam = 0; } break; - case WM_IME_STARTCOMPOSITION: + case WM_IME_STARTCOMPOSITION: videodata->ime_suppress_endcomposition_event = SDL_FALSE; trap = SDL_TRUE; break; @@ -1047,8 +1037,9 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD IME_SendInputEvent(videodata); } if (*lParam & GCS_COMPSTR) { - if (!videodata->ime_uiless) + if (!videodata->ime_uiless) { videodata->ime_readingstring[0] = 0; + } IME_GetCompositionString(videodata, himc, GCS_COMPSTR); IME_SendEditingEvent(videodata); @@ -1060,8 +1051,9 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD videodata->ime_composition[0] = 0; videodata->ime_readingstring[0] = 0; videodata->ime_cursor = 0; - if (videodata->ime_suppress_endcomposition_event == SDL_FALSE) + if (videodata->ime_suppress_endcomposition_event == SDL_FALSE) { SDL_SendEditingText("", 0, 0); + } videodata->ime_suppress_endcomposition_event = SDL_FALSE; break; case WM_IME_NOTIFY: @@ -1072,8 +1064,9 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD break; case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: - if (videodata->ime_uiless) + if (videodata->ime_uiless) { break; + } trap = SDL_TRUE; videodata->ime_uicontext = 1; @@ -1085,35 +1078,31 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD IME_HideCandidateList(videodata); break; case IMN_PRIVATE: - { - DWORD dwId = IME_GetId(videodata, 0); - IME_GetReadingString(videodata, hwnd); - switch (dwId) - { - case IMEID_CHT_VER42: - case IMEID_CHT_VER43: - case IMEID_CHT_VER44: - case IMEID_CHS_VER41: - case IMEID_CHS_VER42: - if (*lParam == 1 || *lParam == 2) - trap = SDL_TRUE; + { + DWORD dwId = IME_GetId(videodata, 0); + IME_GetReadingString(videodata, hwnd); + switch (dwId) { + case IMEID_CHT_VER42: + case IMEID_CHT_VER43: + case IMEID_CHT_VER44: + case IMEID_CHS_VER41: + case IMEID_CHS_VER42: + if (*lParam == 1 || *lParam == 2) { + trap = SDL_TRUE; + } - break; - case IMEID_CHT_VER50: - case IMEID_CHT_VER51: - case IMEID_CHT_VER52: - case IMEID_CHT_VER60: - case IMEID_CHS_VER53: - if (*lParam == 16 - || *lParam == 17 - || *lParam == 26 - || *lParam == 27 - || *lParam == 28) - trap = SDL_TRUE; - break; + break; + case IMEID_CHT_VER50: + case IMEID_CHT_VER51: + case IMEID_CHT_VER52: + case IMEID_CHT_VER60: + case IMEID_CHS_VER53: + if (*lParam == 16 || *lParam == 17 || *lParam == 26 || *lParam == 27 || *lParam == 28) { + trap = SDL_TRUE; } + break; } - break; + } break; default: trap = SDL_TRUE; break; @@ -1123,8 +1112,7 @@ IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoD return trap; } -static void -IME_CloseCandidateList(SDL_VideoData *videodata) +static void IME_CloseCandidateList(SDL_VideoData *videodata) { IME_HideCandidateList(videodata); videodata->ime_candcount = 0; @@ -1132,8 +1120,7 @@ IME_CloseCandidateList(SDL_VideoData *videodata) videodata->ime_candidates = NULL; } -static void -UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pcandlist) +static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pcandlist) { UINT selection = 0; UINT count = 0; @@ -1143,8 +1130,9 @@ UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pca DWORD pgsize = 0; UINT i, j; - if (IME_ShowCandidateList(videodata) < 0) + if (IME_ShowCandidateList(videodata) < 0) { return; + } pcandlist->lpVtbl->GetSelection(pcandlist, &selection); pcandlist->lpVtbl->GetCount(pcandlist, &count); @@ -1159,10 +1147,11 @@ UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pca if (idxlist) { pcandlist->lpVtbl->GetPageIndex(pcandlist, idxlist, pgcount, &pgcount); pgstart = idxlist[page]; - if (page < pgcount - 1) + if (page < pgcount - 1) { pgsize = SDL_min(count, idxlist[page + 1]) - pgstart; - else + } else { pgsize = count - pgstart; + } SDL_free(idxlist); } @@ -1179,16 +1168,18 @@ UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pca } } // TODO: why was this necessary? check ime_candvertical instead? - //if (PRIMLANG() == LANG_KOREAN) + // if (PRIMLANG() == LANG_KOREAN) // videodata->ime_candsel = -1; } -STDMETHODIMP_(ULONG) TSFSink_AddRef(TSFSink *sink) +STDMETHODIMP_(ULONG) +TSFSink_AddRef(TSFSink *sink) { return ++sink->refcount; } -STDMETHODIMP_(ULONG) TSFSink_Release(TSFSink *sink) +STDMETHODIMP_(ULONG) +TSFSink_Release(TSFSink *sink) { --sink->refcount; if (sink->refcount == 0) { @@ -1200,14 +1191,16 @@ STDMETHODIMP_(ULONG) TSFSink_Release(TSFSink *sink) STDMETHODIMP UIElementSink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv) { - if (!ppv) + if (!ppv) { return E_INVALIDARG; + } *ppv = 0; - if (WIN_IsEqualIID(riid, &IID_IUnknown)) + if (WIN_IsEqualIID(riid, &IID_IUnknown)) { *ppv = (IUnknown *)sink; - else if (WIN_IsEqualIID(riid, &IID_ITfUIElementSink)) + } else if (WIN_IsEqualIID(riid, &IID_ITfUIElementSink)) { *ppv = (ITfUIElementSink *)sink; + } if (*ppv) { TSFSink_AddRef(sink); @@ -1235,8 +1228,9 @@ STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BO ITfReadingInformationUIElement *preading = 0; ITfCandidateListUIElement *pcandlist = 0; SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) + if (!element) { return E_INVALIDARG; + } *pbShow = FALSE; if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { @@ -1245,8 +1239,7 @@ STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BO SysFreeString(bstr); } preading->lpVtbl->Release(preading); - } - else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { + } else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { videodata->ime_candref++; UILess_GetCandidateList(videodata, pcandlist); pcandlist->lpVtbl->Release(pcandlist); @@ -1260,8 +1253,9 @@ STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId) ITfReadingInformationUIElement *preading = 0; ITfCandidateListUIElement *pcandlist = 0; SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) + if (!element) { return E_INVALIDARG; + } if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { BSTR bstr; @@ -1272,8 +1266,7 @@ STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId) SysFreeString(bstr); } preading->lpVtbl->Release(preading); - } - else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { + } else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { UILess_GetCandidateList(videodata, pcandlist); pcandlist->lpVtbl->Release(pcandlist); } @@ -1286,8 +1279,9 @@ STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId) ITfReadingInformationUIElement *preading = 0; ITfCandidateListUIElement *pcandlist = 0; SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) + if (!element) { return E_INVALIDARG; + } if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { videodata->ime_readingstring[0] = 0; @@ -1296,8 +1290,9 @@ STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId) } if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { videodata->ime_candref--; - if (videodata->ime_candref == 0) + if (videodata->ime_candref == 0) { IME_CloseCandidateList(videodata); + } pcandlist->lpVtbl->Release(pcandlist); } @@ -1306,14 +1301,16 @@ STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId) STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv) { - if (!ppv) + if (!ppv) { return E_INVALIDARG; + } *ppv = 0; - if (WIN_IsEqualIID(riid, &IID_IUnknown)) + if (WIN_IsEqualIID(riid, &IID_IUnknown)) { *ppv = (IUnknown *)sink; - else if (WIN_IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink)) + } else if (WIN_IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink)) { *ppv = (ITfInputProcessorProfileActivationSink *)sink; + } if (*ppv) { TSFSink_AddRef(sink); @@ -1324,11 +1321,12 @@ STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv) STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags) { - static const GUID TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } }; + static const GUID SDL_TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } }; SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - videodata->ime_candlistindexbase = WIN_IsEqualGUID(&TF_PROFILE_DAYI, guidProfile) ? 0 : 1; - if (WIN_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE)) + videodata->ime_candlistindexbase = WIN_IsEqualGUID(&SDL_TF_PROFILE_DAYI, guidProfile) ? 0 : 1; + if (WIN_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE)) { IME_InputLangChanged((SDL_VideoData *)sink->data); + } IME_HideCandidateList(videodata); return S_OK; @@ -1350,12 +1348,12 @@ static void *vtIPPASink[] = { (void *)(IPPASink_OnActivated) }; -static void -UILess_EnableUIUpdates(SDL_VideoData *videodata) +static void UILess_EnableUIUpdates(SDL_VideoData *videodata) { ITfSource *source = 0; - if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie != TF_INVALID_COOKIE) + if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie != TF_INVALID_COOKIE) { return; + } if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie); @@ -1363,12 +1361,12 @@ UILess_EnableUIUpdates(SDL_VideoData *videodata) } } -static void -UILess_DisableUIUpdates(SDL_VideoData *videodata) +static void UILess_DisableUIUpdates(SDL_VideoData *videodata) { ITfSource *source = 0; - if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie == TF_INVALID_COOKIE) + if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie == TF_INVALID_COOKIE) { return; + } if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie); @@ -1377,17 +1375,18 @@ UILess_DisableUIUpdates(SDL_VideoData *videodata) } } -static SDL_bool -UILess_SetupSinks(SDL_VideoData *videodata) +static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata) { TfClientId clientid = 0; SDL_bool result = SDL_FALSE; ITfSource *source = 0; - if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&videodata->ime_threadmgrex))) + if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&videodata->ime_threadmgrex))) { return SDL_FALSE; + } - if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY))) + if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY))) { return SDL_FALSE; + } videodata->ime_uielemsink = SDL_malloc(sizeof(TSFSink)); videodata->ime_ippasink = SDL_malloc(sizeof(TSFSink)); @@ -1411,16 +1410,15 @@ UILess_SetupSinks(SDL_VideoData *videodata) return result; } -#define SAFE_RELEASE(p) \ -{ \ - if (p) { \ - (p)->lpVtbl->Release((p)); \ - (p) = 0; \ - } \ -} +#define SAFE_RELEASE(p) \ + { \ + if (p) { \ + (p)->lpVtbl->Release((p)); \ + (p) = 0; \ + } \ + } -static void -UILess_ReleaseSinks(SDL_VideoData *videodata) +static void UILess_ReleaseSinks(SDL_VideoData *videodata) { ITfSource *source = 0; if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { @@ -1436,8 +1434,7 @@ UILess_ReleaseSinks(SDL_VideoData *videodata) } } -static void * -StartDrawToBitmap(HDC hdc, HBITMAP *hhbm, int width, int height) +static void *StartDrawToBitmap(HDC hdc, HBITMAP *hhbm, int width, int height) { BITMAPINFO info; BITMAPINFOHEADER *infoHeader = &info.bmiHeader; @@ -1446,19 +1443,19 @@ StartDrawToBitmap(HDC hdc, HBITMAP *hhbm, int width, int height) SDL_zero(info); infoHeader->biSize = sizeof(BITMAPINFOHEADER); infoHeader->biWidth = width; - infoHeader->biHeight = -1 * SDL_abs(height); + infoHeader->biHeight = (LONG)-1 * SDL_abs(height); infoHeader->biPlanes = 1; infoHeader->biBitCount = 32; infoHeader->biCompression = BI_RGB; *hhbm = CreateDIBSection(hdc, &info, DIB_RGB_COLORS, (void **)&bits, 0, 0); - if (*hhbm) + if (*hhbm) { SelectObject(hdc, *hhbm); + } } return bits; } -static void -StopDrawToBitmap(HDC hdc, HBITMAP *hhbm) +static void StopDrawToBitmap(HDC hdc, HBITMAP *hhbm) { if (hhbm && *hhbm) { DeleteObject(*hhbm); @@ -1467,8 +1464,7 @@ StopDrawToBitmap(HDC hdc, HBITMAP *hhbm) } /* This draws only within the specified area and fills the entire region. */ -static void -DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) +static void DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) { /* The case of no pen (PenSize = 0) is automatically taken care of. */ const int penadjust = (int)SDL_floor(pensize / 2.0f - 0.5f); @@ -1479,19 +1475,18 @@ DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) Rectangle(hdc, left, top, right, bottom); } -static void -IME_DestroyTextures(SDL_VideoData *videodata) +static void IME_DestroyTextures(SDL_VideoData *videodata) { } -#define SDL_swap(a,b) { \ - int c = (a); \ - (a) = (b); \ - (b) = c; \ +#define SDL_swap(a, b) \ + { \ + int c = (a); \ + (a) = (b); \ + (b) = c; \ } -static void -IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) +static void IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) { int left, top, right, bottom; SDL_bool ok = SDL_FALSE; @@ -1507,8 +1502,9 @@ IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) left -= right - winw; right = winw; } - if (bottom < winh) + if (bottom < winh) { ok = SDL_TRUE; + } /* Top */ if (!ok) { @@ -1520,8 +1516,9 @@ IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) left -= right - winw; right = winw; } - if (top >= 0) + if (top >= 0) { ok = SDL_TRUE; + } } /* Right */ @@ -1530,8 +1527,9 @@ IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) top = 0; right = left + size.cx; bottom = size.cy; - if (right < winw) + if (right < winw) { ok = SDL_TRUE; + } } /* Left */ @@ -1540,8 +1538,9 @@ IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) top = 0; right = videodata->ime_rect.x; bottom = size.cy; - if (right >= 0) + if (right >= 0) { ok = SDL_TRUE; + } } /* Window too small, show at (0,0) */ @@ -1558,13 +1557,12 @@ IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) videodata->ime_candlistrect.h = bottom - top; } -static void -IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) +static void IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) { int i, j; - SIZE size = {0}; + SIZE size = { 0 }; SIZE candsizes[MAX_CANDLIST]; - SIZE maxcandsize = {0}; + SIZE maxcandsize = { 0 }; HBITMAP hbm = NULL; int candcount = SDL_min(SDL_min(MAX_CANDLIST, videodata->ime_candcount), videodata->ime_candpgsize); SDL_bool vertical = videodata->ime_candvertical; @@ -1606,7 +1604,6 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) GetTextExtentPoint32W(hdc, s, (int)SDL_wcslen(s), &candsizes[i]); maxcandsize.cx = SDL_max(maxcandsize.cx, candsizes[i].cx); maxcandsize.cy = SDL_max(maxcandsize.cy, candsizes[i].cy); - } if (vertical) { size.cx = @@ -1615,28 +1612,26 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) (candmargin * 2) + (candborder * 2) + (candpadding * 2) + - (maxcandsize.cx) - ; + (maxcandsize.cx); size.cy = (listborder * 2) + (listpadding * 2) + ((candcount + 1) * candmargin) + (candcount * candborder * 2) + (candcount * candpadding * 2) + - (candcount * maxcandsize.cy) - ; - } - else { + (candcount * maxcandsize.cy); + } else { size.cx = - (listborder * 2) + + (LONG)(listborder * 2) + (listpadding * 2) + ((candcount + 1) * candmargin) + (candcount * candborder * 2) + (candcount * candpadding * 2) + ((candcount - 1) * horzcandspacing); - for (i = 0; i < candcount; ++i) + for (i = 0; i < candcount; ++i) { size.cx += candsizes[i].cx; + } size.cy = (listborder * 2) + @@ -1644,8 +1639,7 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) (candmargin * 2) + (candborder * 2) + (candpadding * 2) + - (maxcandsize.cy) - ; + (maxcandsize.cy); } StartDrawToBitmap(hdc, &hbm, size.cx, size.cy); @@ -1668,12 +1662,12 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) top = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * maxcandsize.cy); right = size.cx - listborder - listpadding - candmargin; bottom = top + maxcandsize.cy + (candpadding * 2) + (candborder * 2); - } - else { + } else { left = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * horzcandspacing); - for (j = 0; j < i; ++j) + for (j = 0; j < i; ++j) { left += candsizes[j].cx; + } top = listborder + listpadding + candmargin; right = left + candsizes[i].cx + (candpadding * 2) + (candborder * 2); @@ -1684,8 +1678,7 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) SelectObject(hdc, selpen); SelectObject(hdc, selbrush); SetTextColor(hdc, seltextcolor); - } - else { + } else { SelectObject(hdc, candpen); SelectObject(hdc, candbrush); SetTextColor(hdc, candtextcolor); @@ -1707,13 +1700,13 @@ IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) IME_PositionCandidateList(videodata, size); } -static void -IME_Render(SDL_VideoData *videodata) +static void IME_Render(SDL_VideoData *videodata) { HDC hdc = CreateCompatibleDC(NULL); - if (videodata->ime_candlist) + if (videodata->ime_candlist) { IME_RenderCandidateList(videodata, hdc); + } DeleteDC(hdc); @@ -1722,15 +1715,16 @@ IME_Render(SDL_VideoData *videodata) void IME_Present(SDL_VideoData *videodata) { - if (videodata->ime_dirty) + if (videodata->ime_dirty) { IME_Render(videodata); + } /* FIXME: Need to show the IME bitmap */ } SDL_bool WIN_IsTextInputShown(_THIS) { - SDL_VideoData* videodata = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; return IME_IsTextInputShown(videodata); } diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h index c9b5e10a6f569..547169186b432 100644 --- a/src/video/windows/SDL_windowskeyboard.h +++ b/src/video/windows/SDL_windowskeyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c index 25d40a19a58cd..7f27022fe5172 100644 --- a/src/video/windows/SDL_windowsmessagebox.c +++ b/src/video/windows/SDL_windowsmessagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #ifdef HAVE_LIMITS_H #include @@ -34,7 +34,7 @@ #include "SDL_windowsvideo.h" #ifndef SS_EDITCONTROL -#define SS_EDITCONTROL 0x2000 +#define SS_EDITCONTROL 0x2000 #endif #ifndef IDOK @@ -46,11 +46,11 @@ #endif /* Custom dialog return codes */ -#define IDCLOSED 20 -#define IDINVALPTRINIT 50 -#define IDINVALPTRCOMMAND 51 +#define IDCLOSED 20 +#define IDINVALPTRINIT 50 +#define IDINVALPTRCOMMAND 51 #define IDINVALPTRSETFOCUS 52 -#define IDINVALPTRDLGITEM 53 +#define IDINVALPTRDLGITEM 53 /* First button ID */ #define IDBUTTONINDEX0 100 @@ -64,7 +64,6 @@ */ #define MAX_BUTTONS (0xffff - 100) - /* Display a Windows message box */ typedef HRESULT(CALLBACK *PFTASKDIALOGCALLBACK)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LONG_PTR lpRefData); @@ -87,45 +86,45 @@ enum _TASKDIALOG_FLAGS TDF_RTL_LAYOUT = 0x2000, TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000, TDF_CAN_BE_MINIMIZED = 0x8000, - //#if (NTDDI_VERSION >= NTDDI_WIN8) + // #if (NTDDI_VERSION >= NTDDI_WIN8) TDF_NO_SET_FOREGROUND = 0x00010000, // Don't call SetForegroundWindow() when activating the dialog - //#endif // (NTDDI_VERSION >= NTDDI_WIN8) - TDF_SIZE_TO_CONTENT = 0x01000000 // used by ShellMessageBox to emulate MessageBox sizing behavior + // #endif // (NTDDI_VERSION >= NTDDI_WIN8) + TDF_SIZE_TO_CONTENT = 0x01000000 // used by ShellMessageBox to emulate MessageBox sizing behavior }; -typedef int TASKDIALOG_FLAGS; // Note: _TASKDIALOG_FLAGS is an int +typedef int TASKDIALOG_FLAGS; // Note: _TASKDIALOG_FLAGS is an int typedef enum _TASKDIALOG_MESSAGES { TDM_NAVIGATE_PAGE = WM_USER + 101, - TDM_CLICK_BUTTON = WM_USER + 102, // wParam = Button ID - TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER + 103, // wParam = 0 (nonMarque) wParam != 0 (Marquee) - TDM_SET_PROGRESS_BAR_STATE = WM_USER + 104, // wParam = new progress state - TDM_SET_PROGRESS_BAR_RANGE = WM_USER + 105, // lParam = MAKELPARAM(nMinRange, nMaxRange) - TDM_SET_PROGRESS_BAR_POS = WM_USER + 106, // wParam = new position - TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER + 107, // wParam = 0 (stop marquee), wParam != 0 (start marquee), lparam = speed (milliseconds between repaints) - TDM_SET_ELEMENT_TEXT = WM_USER + 108, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) - TDM_CLICK_RADIO_BUTTON = WM_USER + 110, // wParam = Radio Button ID - TDM_ENABLE_BUTTON = WM_USER + 111, // lParam = 0 (disable), lParam != 0 (enable), wParam = Button ID - TDM_ENABLE_RADIO_BUTTON = WM_USER + 112, // lParam = 0 (disable), lParam != 0 (enable), wParam = Radio Button ID - TDM_CLICK_VERIFICATION = WM_USER + 113, // wParam = 0 (unchecked), 1 (checked), lParam = 1 (set key focus) - TDM_UPDATE_ELEMENT_TEXT = WM_USER + 114, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) + TDM_CLICK_BUTTON = WM_USER + 102, // wParam = Button ID + TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER + 103, // wParam = 0 (nonMarque) wParam != 0 (Marquee) + TDM_SET_PROGRESS_BAR_STATE = WM_USER + 104, // wParam = new progress state + TDM_SET_PROGRESS_BAR_RANGE = WM_USER + 105, // lParam = MAKELPARAM(nMinRange, nMaxRange) + TDM_SET_PROGRESS_BAR_POS = WM_USER + 106, // wParam = new position + TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER + 107, // wParam = 0 (stop marquee), wParam != 0 (start marquee), lparam = speed (milliseconds between repaints) + TDM_SET_ELEMENT_TEXT = WM_USER + 108, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) + TDM_CLICK_RADIO_BUTTON = WM_USER + 110, // wParam = Radio Button ID + TDM_ENABLE_BUTTON = WM_USER + 111, // lParam = 0 (disable), lParam != 0 (enable), wParam = Button ID + TDM_ENABLE_RADIO_BUTTON = WM_USER + 112, // lParam = 0 (disable), lParam != 0 (enable), wParam = Radio Button ID + TDM_CLICK_VERIFICATION = WM_USER + 113, // wParam = 0 (unchecked), 1 (checked), lParam = 1 (set key focus) + TDM_UPDATE_ELEMENT_TEXT = WM_USER + 114, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER + 115, // wParam = Button ID, lParam = 0 (elevation not required), lParam != 0 (elevation required) - TDM_UPDATE_ICON = WM_USER + 116 // wParam = icon element (TASKDIALOG_ICON_ELEMENTS), lParam = new icon (hIcon if TDF_USE_HICON_* was set, PCWSTR otherwise) + TDM_UPDATE_ICON = WM_USER + 116 // wParam = icon element (TASKDIALOG_ICON_ELEMENTS), lParam = new icon (hIcon if TDF_USE_HICON_* was set, PCWSTR otherwise) } TASKDIALOG_MESSAGES; typedef enum _TASKDIALOG_NOTIFICATIONS { TDN_CREATED = 0, TDN_NAVIGATED = 1, - TDN_BUTTON_CLICKED = 2, // wParam = Button ID - TDN_HYPERLINK_CLICKED = 3, // lParam = (LPCWSTR)pszHREF - TDN_TIMER = 4, // wParam = Milliseconds since dialog created or timer reset + TDN_BUTTON_CLICKED = 2, // wParam = Button ID + TDN_HYPERLINK_CLICKED = 3, // lParam = (LPCWSTR)pszHREF + TDN_TIMER = 4, // wParam = Milliseconds since dialog created or timer reset TDN_DESTROYED = 5, - TDN_RADIO_BUTTON_CLICKED = 6, // wParam = Radio Button ID + TDN_RADIO_BUTTON_CLICKED = 6, // wParam = Radio Button ID TDN_DIALOG_CONSTRUCTED = 7, - TDN_VERIFICATION_CLICKED = 8, // wParam = 1 if checkbox checked, 0 if not, lParam is unused and always 0 + TDN_VERIFICATION_CLICKED = 8, // wParam = 1 if checkbox checked, 0 if not, lParam is unused and always 0 TDN_HELP = 9, - TDN_EXPANDO_BUTTON_CLICKED = 10 // wParam = 0 (dialog is now collapsed), wParam != 0 (dialog is now expanded) + TDN_EXPANDO_BUTTON_CLICKED = 10 // wParam = 0 (dialog is now collapsed), wParam != 0 (dialog is now expanded) } TASKDIALOG_NOTIFICATIONS; typedef enum _TASKDIALOG_ELEMENTS @@ -142,64 +141,64 @@ typedef enum _TASKDIALOG_ICON_ELEMENTS TDIE_ICON_FOOTER } TASKDIALOG_ICON_ELEMENTS; -#define TD_WARNING_ICON MAKEINTRESOURCEW(-1) -#define TD_ERROR_ICON MAKEINTRESOURCEW(-2) -#define TD_INFORMATION_ICON MAKEINTRESOURCEW(-3) -#define TD_SHIELD_ICON MAKEINTRESOURCEW(-4) +#define TD_WARNING_ICON MAKEINTRESOURCEW(-1) +#define TD_ERROR_ICON MAKEINTRESOURCEW(-2) +#define TD_INFORMATION_ICON MAKEINTRESOURCEW(-3) +#define TD_SHIELD_ICON MAKEINTRESOURCEW(-4) enum _TASKDIALOG_COMMON_BUTTON_FLAGS { - TDCBF_OK_BUTTON = 0x0001, // selected control return value IDOK - TDCBF_YES_BUTTON = 0x0002, // selected control return value IDYES - TDCBF_NO_BUTTON = 0x0004, // selected control return value IDNO + TDCBF_OK_BUTTON = 0x0001, // selected control return value IDOK + TDCBF_YES_BUTTON = 0x0002, // selected control return value IDYES + TDCBF_NO_BUTTON = 0x0004, // selected control return value IDNO TDCBF_CANCEL_BUTTON = 0x0008, // selected control return value IDCANCEL - TDCBF_RETRY_BUTTON = 0x0010, // selected control return value IDRETRY - TDCBF_CLOSE_BUTTON = 0x0020 // selected control return value IDCLOSE + TDCBF_RETRY_BUTTON = 0x0010, // selected control return value IDRETRY + TDCBF_CLOSE_BUTTON = 0x0020 // selected control return value IDCLOSE }; -typedef int TASKDIALOG_COMMON_BUTTON_FLAGS; // Note: _TASKDIALOG_COMMON_BUTTON_FLAGS is an int +typedef int TASKDIALOG_COMMON_BUTTON_FLAGS; // Note: _TASKDIALOG_COMMON_BUTTON_FLAGS is an int #pragma pack(push, 1) typedef struct _TASKDIALOG_BUTTON { - int nButtonID; - PCWSTR pszButtonText; + int nButtonID; + PCWSTR pszButtonText; } TASKDIALOG_BUTTON; typedef struct _TASKDIALOGCONFIG { - UINT cbSize; - HWND hwndParent; // incorrectly named, this is the owner window, not a parent. - HINSTANCE hInstance; // used for MAKEINTRESOURCE() strings - TASKDIALOG_FLAGS dwFlags; // TASKDIALOG_FLAGS (TDF_XXX) flags - TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons; // TASKDIALOG_COMMON_BUTTON (TDCBF_XXX) flags - PCWSTR pszWindowTitle; // string or MAKEINTRESOURCE() + UINT cbSize; + HWND hwndParent; // incorrectly named, this is the owner window, not a parent. + HINSTANCE hInstance; // used for MAKEINTRESOURCE() strings + TASKDIALOG_FLAGS dwFlags; // TASKDIALOG_FLAGS (TDF_XXX) flags + TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons; // TASKDIALOG_COMMON_BUTTON (TDCBF_XXX) flags + PCWSTR pszWindowTitle; // string or MAKEINTRESOURCE() union { - HICON hMainIcon; - PCWSTR pszMainIcon; + HICON hMainIcon; + PCWSTR pszMainIcon; } /*DUMMYUNIONNAME*/; - PCWSTR pszMainInstruction; - PCWSTR pszContent; - UINT cButtons; - const TASKDIALOG_BUTTON *pButtons; - int nDefaultButton; - UINT cRadioButtons; - const TASKDIALOG_BUTTON *pRadioButtons; - int nDefaultRadioButton; - PCWSTR pszVerificationText; - PCWSTR pszExpandedInformation; - PCWSTR pszExpandedControlText; - PCWSTR pszCollapsedControlText; + PCWSTR pszMainInstruction; + PCWSTR pszContent; + UINT cButtons; + const TASKDIALOG_BUTTON *pButtons; + int nDefaultButton; + UINT cRadioButtons; + const TASKDIALOG_BUTTON *pRadioButtons; + int nDefaultRadioButton; + PCWSTR pszVerificationText; + PCWSTR pszExpandedInformation; + PCWSTR pszExpandedControlText; + PCWSTR pszCollapsedControlText; union { - HICON hFooterIcon; - PCWSTR pszFooterIcon; + HICON hFooterIcon; + PCWSTR pszFooterIcon; } /*DUMMYUNIONNAME2*/; - PCWSTR pszFooter; + PCWSTR pszFooter; PFTASKDIALOGCALLBACK pfCallback; - LONG_PTR lpCallbackData; - UINT cxWidth; // width of the Task Dialog's client area in DLU's. If 0, Task Dialog will calculate the ideal width. + LONG_PTR lpCallbackData; + UINT cxWidth; // width of the Task Dialog's client area in DLU's. If 0, Task Dialog will calculate the ideal width. } TASKDIALOGCONFIG; typedef struct @@ -232,7 +231,7 @@ typedef struct typedef struct { - DLGTEMPLATEEX* lpDialog; + DLGTEMPLATEEX *lpDialog; Uint8 *data; size_t size; size_t used; @@ -254,7 +253,7 @@ static INT_PTR CALLBACK MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wP const SDL_MessageBoxData *messageboxdata; size_t buttonindex; - switch ( iMessage ) { + switch (iMessage) { case WM_INITDIALOG: if (lParam == 0) { EndDialog(hDlg, IDINVALPTRINIT); @@ -266,7 +265,7 @@ static INT_PTR CALLBACK MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wP if (GetButtonIndex(messageboxdata, SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, &buttonindex)) { /* Focus on the first default return-key button */ HWND buttonctl = GetDlgItem(hDlg, (int)(IDBUTTONINDEX0 + buttonindex)); - if (buttonctl == NULL) { + if (!buttonctl) { EndDialog(hDlg, IDINVALPTRDLGITEM); } PostMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)buttonctl, TRUE); @@ -277,7 +276,7 @@ static INT_PTR CALLBACK MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wP return FALSE; case WM_SETFOCUS: messageboxdata = (const SDL_MessageBoxData *)GetWindowLongPtr(hDlg, GWLP_USERDATA); - if (messageboxdata == NULL) { + if (!messageboxdata) { EndDialog(hDlg, IDINVALPTRSETFOCUS); return TRUE; } @@ -289,7 +288,7 @@ static INT_PTR CALLBACK MessageBoxDialogProc(HWND hDlg, UINT iMessage, WPARAM wP return TRUE; case WM_COMMAND: messageboxdata = (const SDL_MessageBoxData *)GetWindowLongPtr(hDlg, GWLP_USERDATA); - if (messageboxdata == NULL) { + if (!messageboxdata) { EndDialog(hDlg, IDINVALPTRCOMMAND); return TRUE; } @@ -351,7 +350,7 @@ static SDL_bool ExpandDialogSpace(WIN_DialogData *dialog, size_t space) } dialog->data = data; dialog->size = size; - dialog->lpDialog = (DLGTEMPLATEEX*)dialog->data; + dialog->lpDialog = (DLGTEMPLATEEX *)dialog->data; } return SDL_TRUE; } @@ -375,7 +374,7 @@ static SDL_bool AddDialogData(WIN_DialogData *dialog, const void *data, size_t s return SDL_FALSE; } - SDL_memcpy(dialog->data+dialog->used, data, size); + SDL_memcpy(dialog->data + dialog->used, data, size); dialog->used += size; return SDL_TRUE; @@ -404,7 +403,7 @@ static SDL_bool AddDialogString(WIN_DialogData *dialog, const char *string) } ++count; - status = AddDialogData(dialog, wstring, count*sizeof(WCHAR)); + status = AddDialogData(dialog, wstring, count * sizeof(WCHAR)); SDL_free(wstring); return status; } @@ -419,7 +418,6 @@ static void Vec2ToDLU(short *x, short *y) *y = MulDiv(*y, 8, s_BaseUnitsY); } - static SDL_bool AddDialogControl(WIN_DialogData *dialog, WORD type, DWORD style, DWORD exStyle, int x, int y, int w, int h, int id, const char *caption, WORD ordinal) { DLGITEMTEMPLATEEX item; @@ -450,7 +448,7 @@ static SDL_bool AddDialogControl(WIN_DialogData *dialog, WORD type, DWORD style, if (!AddDialogData(dialog, &type, sizeof(type))) { return SDL_FALSE; } - if (type == DLGITEMTYPEBUTTON || (type == DLGITEMTYPESTATIC && caption != NULL)) { + if (type == DLGITEMTYPEBUTTON || (type == DLGITEMTYPESTATIC && caption)) { if (!AddDialogString(dialog, caption)) { return SDL_FALSE; } @@ -566,8 +564,10 @@ static WIN_DialogData *CreateDialogData(int w, int h, const char *caption) { HDC ScreenDC = GetDC(NULL); int LogicalPixelsY = GetDeviceCaps(ScreenDC, LOGPIXELSY); - if (!LogicalPixelsY) /* This can happen if the application runs out of GDI handles */ - LogicalPixelsY = 72; + if (!LogicalPixelsY) { + LogicalPixelsY = 72; /* This can happen if the application runs out of GDI handles */ + } + WordToPass = (WORD)(-72 * NCM.lfMessageFont.lfHeight / LogicalPixelsY); ReleaseDC(NULL, ScreenDC); } @@ -623,7 +623,7 @@ static const char *EscapeAmpersands(char **dst, size_t *dstlen, const char *src) size_t ampcount = 0; size_t srclen = 0; - if (src == NULL) { + if (!src) { return NULL; } @@ -642,7 +642,7 @@ static const char *EscapeAmpersands(char **dst, size_t *dstlen, const char *src) if (SIZE_MAX - srclen < ampcount) { return NULL; } - if (*dst == NULL || *dstlen < srclen + ampcount) { + if (!*dst || *dstlen < srclen + ampcount) { /* Allocating extra space in case the next strings are a bit longer. */ size_t extraspace = SIZE_MAX - (srclen + ampcount); if (extraspace > 512) { @@ -652,7 +652,7 @@ static const char *EscapeAmpersands(char **dst, size_t *dstlen, const char *src) SDL_free(*dst); *dst = NULL; newdst = SDL_malloc(*dstlen); - if (newdst == NULL) { + if (!newdst) { return NULL; } *dst = newdst; @@ -672,15 +672,14 @@ static const char *EscapeAmpersands(char **dst, size_t *dstlen, const char *src) } /* This function is called if a Task Dialog is unsupported. */ -static int -WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +static int WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { WIN_DialogData *dialog; int i, x, y, retval; HFONT DialogFont; SIZE Size; RECT TextSize; - wchar_t* wmessage; + wchar_t *wmessage; TEXTMETRIC TM; HDC FontDC; INT_PTR result; @@ -805,12 +804,13 @@ WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) } /* Ensure the size is wide enough for all of the buttons. */ - if (Size.cx < messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin) - Size.cx = messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin; + if (Size.cx < (LONG)messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin) { + Size.cx = (LONG)messageboxdata->numbuttons * (ButtonWidth + ButtonMargin) + ButtonMargin; + } /* Reset the height to the icon size if it is actually bigger than the text. */ - if (icon && Size.cy < IconMargin * 2 + IconHeight) { - Size.cy = IconMargin * 2 + IconHeight; + if (icon && Size.cy < (LONG)IconMargin * 2 + IconHeight) { + Size.cy = (LONG)IconMargin * 2 + IconHeight; } /* Add vertical space for the buttons and border. */ @@ -821,7 +821,7 @@ WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) return -1; } - if (icon && ! AddDialogStaticIcon(dialog, IconMargin, IconMargin, IconWidth, IconHeight, icon)) { + if (icon && !AddDialogStaticIcon(dialog, IconMargin, IconMargin, IconWidth, IconHeight, icon)) { FreeDialogData(dialog); return -1; } @@ -858,7 +858,7 @@ WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) buttontext = EscapeAmpersands(&escape, &escapesize, sdlButton->text); /* Make sure to provide the correct ID to keep buttons indexed in the * same order as how they are in messageboxdata. */ - if (buttontext == NULL || !AddDialogButton(dialog, x, y, ButtonWidth, ButtonHeight, buttontext, IDBUTTONINDEX0 + (int)(sdlButton - messageboxdata->buttons), isdefault)) { + if (!buttontext || !AddDialogButton(dialog, x, y, ButtonWidth, ButtonHeight, buttontext, IDBUTTONINDEX0 + (int)(sdlButton - messageboxdata->buttons), isdefault)) { FreeDialogData(dialog); SDL_free(ampescape); return -1; @@ -871,10 +871,10 @@ WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) /* If we have a parent window, get the Instance and HWND for them * so that our little dialog gets exclusive focus at all times. */ if (messageboxdata->window) { - ParentWindow = ((SDL_WindowData*)messageboxdata->window->driverdata)->hwnd; + ParentWindow = ((SDL_WindowData *)messageboxdata->window->driverdata)->hwnd; } - result = DialogBoxIndirectParam(NULL, (DLGTEMPLATE*)dialog->lpDialog, ParentWindow, MessageBoxDialogProc, (LPARAM)messageboxdata); + result = DialogBoxIndirectParam(NULL, (DLGTEMPLATE *)dialog->lpDialog, ParentWindow, MessageBoxDialogProc, (LPARAM)messageboxdata); if (result >= IDBUTTONINDEX0 && result - IDBUTTONINDEX0 < messageboxdata->numbuttons) { *buttonid = messageboxdata->buttons[result - IDBUTTONINDEX0].buttonid; retval = 0; @@ -905,10 +905,11 @@ WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) /* TaskDialogIndirect procedure * This is because SDL targets Windows XP (0x501), so this is not defined in the platform SDK. */ -typedef HRESULT(FAR WINAPI *TASKDIALOGINDIRECTPROC)(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton, int *pnRadioButton, BOOL *pfVerificationFlagChecked); +/* *INDENT-OFF* */ /* clang-format off */ +typedef HRESULT (FAR WINAPI *TASKDIALOGINDIRECTPROC)(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton, int *pnRadioButton, BOOL *pfVerificationFlagChecked); +/* *INDENT-ON* */ /* clang-format on */ -int -WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { HWND ParentWindow = NULL; wchar_t *wmessage; @@ -931,7 +932,7 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) /* If we cannot load comctl32.dll use the old messagebox! */ hComctl32 = LoadLibrary(TEXT("comctl32.dll")); - if (hComctl32 == NULL) { + if (!hComctl32) { return WIN_ShowOldMessageBox(messageboxdata, buttonid); } @@ -942,8 +943,8 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) If you don't want to bother with manifests, put this #pragma in your app's source code somewhere: pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") */ - pfnTaskDialogIndirect = (TASKDIALOGINDIRECTPROC) GetProcAddress(hComctl32, "TaskDialogIndirect"); - if (pfnTaskDialogIndirect == NULL) { + pfnTaskDialogIndirect = (TASKDIALOGINDIRECTPROC)GetProcAddress(hComctl32, "TaskDialogIndirect"); + if (!pfnTaskDialogIndirect) { FreeLibrary(hComctl32); return WIN_ShowOldMessageBox(messageboxdata, buttonid); } @@ -951,14 +952,14 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) /* If we have a parent window, get the Instance and HWND for them so that our little dialog gets exclusive focus at all times. */ if (messageboxdata->window) { - ParentWindow = ((SDL_WindowData *) messageboxdata->window->driverdata)->hwnd; + ParentWindow = ((SDL_WindowData *)messageboxdata->window->driverdata)->hwnd; } wmessage = WIN_UTF8ToStringW(messageboxdata->message); wtitle = WIN_UTF8ToStringW(messageboxdata->title); SDL_zero(TaskConfig); - TaskConfig.cbSize = sizeof (TASKDIALOGCONFIG); + TaskConfig.cbSize = sizeof(TASKDIALOGCONFIG); TaskConfig.hwndParent = ParentWindow; TaskConfig.dwFlags = TDF_SIZE_TO_CONTENT; TaskConfig.pszWindowTitle = wtitle; @@ -974,11 +975,10 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) TaskConfig.pszContent = wmessage; TaskConfig.cButtons = messageboxdata->numbuttons; - pButtons = SDL_malloc(sizeof (TASKDIALOG_BUTTON) * messageboxdata->numbuttons); + pButtons = SDL_malloc(sizeof(TASKDIALOG_BUTTON) * messageboxdata->numbuttons); TaskConfig.nDefaultButton = 0; nCancelButton = 0; - for (i = 0; i < messageboxdata->numbuttons; i++) - { + for (i = 0; i < messageboxdata->numbuttons; i++) { const char *buttontext; if (messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT) { pButton = &pButtons[i]; @@ -992,14 +992,14 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) pButton->nButtonID = IDBUTTONINDEX0 + i; } buttontext = EscapeAmpersands(&escape, &escapesize, messageboxdata->buttons[i].text); - if (buttontext == NULL) { + if (!buttontext) { int j; FreeLibrary(hComctl32); SDL_free(ampescape); SDL_free(wmessage); SDL_free(wtitle); for (j = 0; j < i; j++) { - SDL_free((wchar_t *) pButtons[j].pszButtonText); + SDL_free((wchar_t *)pButtons[j].pszButtonText); } SDL_free(pButtons); return -1; @@ -1020,7 +1020,7 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) SDL_free(wmessage); SDL_free(wtitle); for (i = 0; i < messageboxdata->numbuttons; i++) { - SDL_free((wchar_t *) pButtons[i].pszButtonText); + SDL_free((wchar_t *)pButtons[i].pszButtonText); } SDL_free(pButtons); diff --git a/src/video/windows/SDL_windowsmessagebox.h b/src/video/windows/SDL_windowsmessagebox.h index 1ffc506e4786f..fe0b16e4a21de 100644 --- a/src/video/windows/SDL_windowsmessagebox.h +++ b/src/video/windows/SDL_windowsmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS +#if defined(SDL_VIDEO_DRIVER_WINDOWS) extern int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 2e44140147ea1..adc3902ce41f0 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" #include "../../events/SDL_displayevents_c.h" @@ -33,23 +33,22 @@ /* #define DEBUG_MODES */ /* #define HIGHDPI_DEBUG_VERBOSE */ -static void -WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * mode) +static void WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode) { - SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata; + SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; HDC hdc; data->DeviceMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS); - if (index == ENUM_CURRENT_SETTINGS - && (hdc = CreateDC(deviceName, NULL, NULL, NULL)) != NULL) { + /* NOLINTNEXTLINE(bugprone-assignment-in-if-condition): No simple way to extract the assignment */ + if (index == ENUM_CURRENT_SETTINGS && (hdc = CreateDC(deviceName, NULL, NULL, NULL)) != NULL) { char bmi_data[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)]; LPBITMAPINFO bmi; HBITMAP hbm; - int logical_width = GetDeviceCaps( hdc, HORZRES ); - int logical_height = GetDeviceCaps( hdc, VERTRES ); + int logical_width = GetDeviceCaps(hdc, HORZRES); + int logical_height = GetDeviceCaps(hdc, VERTRES); /* High-DPI notes: @@ -62,9 +61,9 @@ WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * - GetDeviceCaps( hdc, HORZRES ) will return pixels, same as DeviceMode.dmPelsWidth */ mode->w = logical_width; mode->h = logical_height; - + SDL_zeroa(bmi_data); - bmi = (LPBITMAPINFO) bmi_data; + bmi = (LPBITMAPINFO)bmi_data; bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); hbm = CreateCompatibleBitmap(hdc, 1, 1); @@ -73,7 +72,7 @@ WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * DeleteObject(hbm); DeleteDC(hdc); if (bmi->bmiHeader.biCompression == BI_BITFIELDS) { - switch (*(Uint32 *) bmi->bmiColors) { + switch (*(Uint32 *)bmi->bmiColors) { case 0x00FF0000: mode->format = SDL_PIXELFORMAT_RGB888; break; @@ -119,8 +118,7 @@ WIN_UpdateDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * } } -static SDL_DisplayOrientation -WIN_GetDisplayOrientation(DEVMODE *mode) +static SDL_DisplayOrientation WIN_GetDisplayOrientation(DEVMODE *mode) { int width = mode->dmPelsWidth; int height = mode->dmPelsHeight; @@ -161,8 +159,7 @@ WIN_GetDisplayOrientation(DEVMODE *mode) } } -static SDL_bool -WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * mode, SDL_DisplayOrientation *orientation) +static SDL_bool WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *orientation) { SDL_DisplayModeData *data; DEVMODE devmode; @@ -173,7 +170,7 @@ WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * mod return SDL_FALSE; } - data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data)); + data = (SDL_DisplayModeData *)SDL_malloc(sizeof(*data)); if (!data) { return SDL_FALSE; } @@ -196,18 +193,8 @@ WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode * mod return SDL_TRUE; } -/* The win32 API calls in this function require Windows Vista or later. */ -typedef LONG (WINAPI *SDL_WIN32PROC_GetDisplayConfigBufferSizes)(UINT32 flags, UINT32* numPathArrayElements, UINT32* numModeInfoArrayElements); -typedef LONG (WINAPI *SDL_WIN32PROC_QueryDisplayConfig)(UINT32 flags, UINT32* numPathArrayElements, DISPLAYCONFIG_PATH_INFO* pathArray, UINT32* numModeInfoArrayElements, DISPLAYCONFIG_MODE_INFO* modeInfoArray, DISPLAYCONFIG_TOPOLOGY_ID* currentTopologyId); -typedef LONG (WINAPI *SDL_WIN32PROC_DisplayConfigGetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER* requestPacket); - -static char * -WIN_GetDisplayNameVista(const WCHAR *deviceName) +static char *WIN_GetDisplayNameVista(SDL_VideoData *videodata, const WCHAR *deviceName) { - void *dll; - SDL_WIN32PROC_GetDisplayConfigBufferSizes pGetDisplayConfigBufferSizes; - SDL_WIN32PROC_QueryDisplayConfig pQueryDisplayConfig; - SDL_WIN32PROC_DisplayConfigGetDeviceInfo pDisplayConfigGetDeviceInfo; DISPLAYCONFIG_PATH_INFO *paths = NULL; DISPLAYCONFIG_MODE_INFO *modes = NULL; char *retval = NULL; @@ -216,21 +203,12 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName) UINT32 i; LONG rc; - dll = SDL_LoadObject("USER32.DLL"); - if (!dll) { + if (!videodata->GetDisplayConfigBufferSizes || !videodata->QueryDisplayConfig || !videodata->DisplayConfigGetDeviceInfo) { return NULL; } - pGetDisplayConfigBufferSizes = (SDL_WIN32PROC_GetDisplayConfigBufferSizes) SDL_LoadFunction(dll, "GetDisplayConfigBufferSizes"); - pQueryDisplayConfig = (SDL_WIN32PROC_QueryDisplayConfig) SDL_LoadFunction(dll, "QueryDisplayConfig"); - pDisplayConfigGetDeviceInfo = (SDL_WIN32PROC_DisplayConfigGetDeviceInfo) SDL_LoadFunction(dll, "DisplayConfigGetDeviceInfo"); - - if (!pGetDisplayConfigBufferSizes || !pQueryDisplayConfig || !pDisplayConfigGetDeviceInfo) { - goto WIN_GetDisplayNameVista_failed; - } - do { - rc = pGetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &pathCount, &modeCount); + rc = videodata->GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &pathCount, &modeCount); if (rc != ERROR_SUCCESS) { goto WIN_GetDisplayNameVista_failed; } @@ -238,13 +216,13 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName) SDL_free(paths); SDL_free(modes); - paths = (DISPLAYCONFIG_PATH_INFO *) SDL_malloc(sizeof (DISPLAYCONFIG_PATH_INFO) * pathCount); - modes = (DISPLAYCONFIG_MODE_INFO *) SDL_malloc(sizeof (DISPLAYCONFIG_MODE_INFO) * modeCount); - if ((paths == NULL) || (modes == NULL)) { + paths = (DISPLAYCONFIG_PATH_INFO *)SDL_malloc(sizeof(DISPLAYCONFIG_PATH_INFO) * pathCount); + modes = (DISPLAYCONFIG_MODE_INFO *)SDL_malloc(sizeof(DISPLAYCONFIG_MODE_INFO) * modeCount); + if ((!paths) || (!modes)) { goto WIN_GetDisplayNameVista_failed; } - rc = pQueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &pathCount, paths, &modeCount, modes, 0); + rc = videodata->QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &pathCount, paths, &modeCount, modes, 0); } while (rc == ERROR_INSUFFICIENT_BUFFER); if (rc == ERROR_SUCCESS) { @@ -255,9 +233,9 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName) SDL_zero(sourceName); sourceName.header.adapterId = paths[i].targetInfo.adapterId; sourceName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME; - sourceName.header.size = sizeof (sourceName); + sourceName.header.size = sizeof(sourceName); sourceName.header.id = paths[i].sourceInfo.id; - rc = pDisplayConfigGetDeviceInfo(&sourceName.header); + rc = videodata->DisplayConfigGetDeviceInfo(&sourceName.header); if (rc != ERROR_SUCCESS) { break; } else if (SDL_wcscmp(deviceName, sourceName.viewGdiDeviceName) != 0) { @@ -268,8 +246,8 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName) targetName.header.adapterId = paths[i].targetInfo.adapterId; targetName.header.id = paths[i].targetInfo.id; targetName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME; - targetName.header.size = sizeof (targetName); - rc = pDisplayConfigGetDeviceInfo(&targetName.header); + targetName.header.size = sizeof(targetName); + rc = videodata->DisplayConfigGetDeviceInfo(&targetName.header); if (rc == ERROR_SUCCESS) { retval = WIN_StringToUTF8W(targetName.monitorFriendlyDeviceName); /* if we got an empty string, treat it as failure so we'll fallback @@ -285,21 +263,18 @@ WIN_GetDisplayNameVista(const WCHAR *deviceName) SDL_free(paths); SDL_free(modes); - SDL_UnloadObject(dll); return retval; WIN_GetDisplayNameVista_failed: SDL_free(retval); SDL_free(paths); SDL_free(modes); - SDL_UnloadObject(dll); return NULL; } -static SDL_bool -WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, SDL_bool send_event) +static void WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, int *display_index, SDL_bool send_event) { - int i; + int i, index = *display_index; SDL_VideoDisplay display; SDL_DisplayData *displaydata; SDL_DisplayMode mode; @@ -310,42 +285,64 @@ WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, SDL_bool se #endif if (!WIN_GetDisplayMode(_this, info->szDevice, ENUM_CURRENT_SETTINGS, &mode, &orientation)) { - return SDL_FALSE; + return; } // Prevent adding duplicate displays. Do this after we know the display is // ready to be added to allow any displays that we can't fully query to be // removed - for(i = 0; i < _this->num_displays; ++i) { + for (i = 0; i < _this->num_displays; ++i) { SDL_DisplayData *driverdata = (SDL_DisplayData *)_this->displays[i].driverdata; if (SDL_wcscmp(driverdata->DeviceName, info->szDevice) == 0) { + SDL_bool moved = (index != i); + + if (index >= _this->num_displays) { + return; + } + + if (moved) { + SDL_VideoDisplay tmp; + + SDL_memcpy(&tmp, &_this->displays[index], sizeof(tmp)); + SDL_memcpy(&_this->displays[index], &_this->displays[i], sizeof(tmp)); + SDL_memcpy(&_this->displays[i], &tmp, sizeof(tmp)); + i = index; + } + driverdata->MonitorHandle = hMonitor; driverdata->IsValid = SDL_TRUE; if (!_this->setting_display_mode) { + SDL_Rect bounds; + SDL_ResetDisplayModes(i); SDL_SetCurrentDisplayMode(&_this->displays[i], &mode); SDL_SetDesktopDisplayMode(&_this->displays[i], &mode); + if (WIN_GetDisplayBounds(_this, &_this->displays[i], &bounds) == 0) { + if (SDL_memcmp(&driverdata->bounds, &bounds, sizeof(bounds)) != 0 || moved) { + SDL_SendDisplayEvent(&_this->displays[i], SDL_DISPLAYEVENT_MOVED, 0); + } + } SDL_SendDisplayEvent(&_this->displays[i], SDL_DISPLAYEVENT_ORIENTATION, orientation); } - return SDL_FALSE; + goto done; } } - displaydata = (SDL_DisplayData *) SDL_calloc(1, sizeof(*displaydata)); + displaydata = (SDL_DisplayData *)SDL_calloc(1, sizeof(*displaydata)); if (!displaydata) { - return SDL_FALSE; + return; } SDL_memcpy(displaydata->DeviceName, info->szDevice, sizeof(displaydata->DeviceName)); displaydata->MonitorHandle = hMonitor; displaydata->IsValid = SDL_TRUE; SDL_zero(display); - display.name = WIN_GetDisplayNameVista(info->szDevice); - if (display.name == NULL) { + display.name = WIN_GetDisplayNameVista(_this->driverdata, info->szDevice); + if (!display.name) { DISPLAY_DEVICEW device; SDL_zero(device); - device.cb = sizeof (device); + device.cb = sizeof(device); if (EnumDisplayDevicesW(info->szDevice, 0, &device, 0)) { display.name = WIN_StringToUTF8W(device.DeviceString); } @@ -354,25 +351,30 @@ WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info, SDL_bool se display.desktop_mode = mode; display.current_mode = mode; display.orientation = orientation; + display.device = _this; display.driverdata = displaydata; - SDL_AddVideoDisplay(&display, send_event); + WIN_GetDisplayBounds(_this, &display, &displaydata->bounds); + index = SDL_AddVideoDisplay(&display, send_event); SDL_free(display.name); - return SDL_TRUE; + +done: + *display_index = index + 1; } -typedef struct _WIN_AddDisplaysData { +typedef struct _WIN_AddDisplaysData +{ SDL_VideoDevice *video_device; + int display_index; SDL_bool send_event; SDL_bool want_primary; } WIN_AddDisplaysData; -static BOOL CALLBACK -WIN_AddDisplaysCallback(HMONITOR hMonitor, - HDC hdcMonitor, - LPRECT lprcMonitor, - LPARAM dwData) +static BOOL CALLBACK WIN_AddDisplaysCallback(HMONITOR hMonitor, + HDC hdcMonitor, + LPRECT lprcMonitor, + LPARAM dwData) { - WIN_AddDisplaysData *data = (WIN_AddDisplaysData*)dwData; + WIN_AddDisplaysData *data = (WIN_AddDisplaysData *)dwData; MONITORINFOEXW info; SDL_zero(info); @@ -382,7 +384,7 @@ WIN_AddDisplaysCallback(HMONITOR hMonitor, const SDL_bool is_primary = ((info.dwFlags & MONITORINFOF_PRIMARY) == MONITORINFOF_PRIMARY); if (is_primary == data->want_primary) { - WIN_AddDisplay(data->video_device, hMonitor, &info, data->send_event); + WIN_AddDisplay(data->video_device, hMonitor, &info, &data->display_index, data->send_event); } } @@ -390,11 +392,11 @@ WIN_AddDisplaysCallback(HMONITOR hMonitor, return TRUE; } -static void -WIN_AddDisplays(_THIS, SDL_bool send_event) +static void WIN_AddDisplays(_THIS, SDL_bool send_event) { WIN_AddDisplaysData callback_data; callback_data.video_device = _this; + callback_data.display_index = 0; callback_data.send_event = send_event; callback_data.want_primary = SDL_TRUE; @@ -404,8 +406,7 @@ WIN_AddDisplays(_THIS, SDL_bool send_event) EnumDisplayMonitors(NULL, NULL, WIN_AddDisplaysCallback, (LPARAM)&callback_data); } -int -WIN_InitModes(_THIS) +int WIN_InitModes(_THIS) { WIN_AddDisplays(_this, SDL_FALSE); @@ -416,13 +417,12 @@ WIN_InitModes(_THIS) } /** - * Convert the monitor rect and work rect from pixels to the SDL coordinate system (monitor origins are in pixels, + * Convert the monitor rect and work rect from pixels to the SDL coordinate system (monitor origins are in pixels, * monitor size in DPI-scaled points). - * + * * No-op if DPI scaling is not enabled. */ -static void -WIN_MonitorInfoToSDL(const SDL_VideoData *videodata, HMONITOR monitor, MONITORINFO *info) +static void WIN_MonitorInfoToSDL(const SDL_VideoData *videodata, HMONITOR monitor, MONITORINFO *info) { UINT xdpi, ydpi; @@ -444,14 +444,13 @@ WIN_MonitorInfoToSDL(const SDL_VideoData *videodata, HMONITOR monitor, MONITORIN info->rcMonitor.bottom = info->rcMonitor.top + MulDiv(info->rcMonitor.bottom - info->rcMonitor.top, 96, ydpi); /* Convert monitor work rect to points */ - info->rcWork.left = info->rcMonitor.left + MulDiv(info->rcWork.left - info->rcMonitor.left, 96, xdpi); - info->rcWork.right = info->rcMonitor.left + MulDiv(info->rcWork.right - info->rcMonitor.left, 96, xdpi); - info->rcWork.top = info->rcMonitor.top + MulDiv(info->rcWork.top - info->rcMonitor.top, 96, ydpi); - info->rcWork.bottom = info->rcMonitor.top + MulDiv(info->rcWork.bottom - info->rcMonitor.top, 96, ydpi); + info->rcWork.left = info->rcMonitor.left + MulDiv(info->rcWork.left - info->rcMonitor.left, 96, xdpi); + info->rcWork.right = info->rcMonitor.left + MulDiv(info->rcWork.right - info->rcMonitor.left, 96, xdpi); + info->rcWork.top = info->rcMonitor.top + MulDiv(info->rcWork.top - info->rcMonitor.top, 96, ydpi); + info->rcWork.bottom = info->rcMonitor.top + MulDiv(info->rcWork.bottom - info->rcMonitor.top, 96, ydpi); } -int -WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { const SDL_DisplayData *data = (const SDL_DisplayData *)display->driverdata; const SDL_VideoData *videodata = (SDL_VideoData *)display->device->driverdata; @@ -475,13 +474,12 @@ WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) return 0; } -int -WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi_out, float * hdpi_out, float * vdpi_out) +int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi_out, float *hdpi_out, float *vdpi_out) { const SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; const SDL_VideoData *videodata = (SDL_VideoData *)display->device->driverdata; float hdpi = 0, vdpi = 0, ddpi = 0; - + if (videodata->GetDpiForMonitor) { UINT hdpi_uint, vdpi_uint; // Windows 8.1+ codepath @@ -500,7 +498,7 @@ WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi_out, float * h float hinches, vinches; hdc = GetDC(NULL); - if (hdc == NULL) { + if (!hdc) { return SDL_SetError("GetDC failed"); } hdpi_int = GetDeviceCaps(hdc, LOGPIXELSX); @@ -534,8 +532,7 @@ WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi_out, float * h return ddpi != 0.0f ? 0 : SDL_SetError("Couldn't get DPI"); } -int -WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) +int WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { const SDL_DisplayData *data = (const SDL_DisplayData *)display->driverdata; const SDL_VideoData *videodata = (SDL_VideoData *)display->device->driverdata; @@ -560,11 +557,11 @@ WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) } /** - * Convert a point from the SDL coordinate system (monitor origins are in pixels, + * Convert a point from the SDL coordinate system (monitor origins are in pixels, * offset within a monitor in DPI-scaled points) to Windows virtual screen coordinates (pixels). - * + * * No-op if DPI scaling is not enabled (returns 96 dpi). - * + * * Returns the DPI of the monitor that was closest to x, y and used for the conversion. */ void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut) @@ -576,8 +573,8 @@ void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut) float ddpi, hdpi, vdpi; int x_sdl, y_sdl; SDL_Point point; - point.x = *x; - point.y = *y; + point.x = *x; + point.y = *y; if (dpiOut) { *dpiOut = 96; @@ -599,13 +596,12 @@ void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut) return; } - if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 - || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) { + if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) { return; } if (dpiOut) { - *dpiOut = (int) ddpi; + *dpiOut = (int)ddpi; } /* Undo the DPI-scaling within the monitor bounds to convert back to pixels */ @@ -616,7 +612,7 @@ void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut) #ifdef HIGHDPI_DEBUG_VERBOSE SDL_Log("WIN_ScreenPointFromSDL: (%d, %d) points -> (%d x %d) pixels, using %d DPI monitor", - x_sdl, y_sdl, *x, *y, (int)ddpi); + x_sdl, y_sdl, *x, *y, (int)ddpi); #endif } @@ -645,7 +641,7 @@ void WIN_ScreenPointToSDL(int *x, int *y) if (!videodata->dpi_scaling_enabled) { return; } - + point.x = *x; point.y = *y; monitor = MonitorFromPoint(point, MONITOR_DEFAULTTONEAREST); @@ -663,8 +659,7 @@ void WIN_ScreenPointToSDL(int *x, int *y) } /* Get SDL display properties */ - if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 - || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) { + if (SDL_GetDisplayBounds(displayIndex, &bounds) < 0 || SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi) < 0) { return; } @@ -676,18 +671,17 @@ void WIN_ScreenPointToSDL(int *x, int *y) #ifdef HIGHDPI_DEBUG_VERBOSE SDL_Log("WIN_ScreenPointToSDL: (%d, %d) pixels -> (%d x %d) points, using %d DPI monitor", - x_pixels, y_pixels, *x, *y, (int)ddpi); + x_pixels, y_pixels, *x, *y, (int)ddpi); #endif } -void -WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) +void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { - SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)display->driverdata; DWORD i; SDL_DisplayMode mode; - for (i = 0; ; ++i) { + for (i = 0;; ++i) { if (!WIN_GetDisplayMode(_this, data->DeviceName, i, &mode, NULL)) { break; } @@ -707,8 +701,7 @@ WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display) } #ifdef DEBUG_MODES -static void -WIN_LogMonitor(_THIS, HMONITOR mon) +static void WIN_LogMonitor(_THIS, HMONITOR mon) { const SDL_VideoData *vid_data = (const SDL_VideoData *)_this->driverdata; MONITORINFOEX minfo; @@ -726,22 +719,21 @@ WIN_LogMonitor(_THIS, HMONITOR mon) name_utf8 = WIN_StringToUTF8(minfo.szDevice); SDL_Log("WIN_LogMonitor: monitor \"%s\": dpi: %d windows screen coordinates: %d, %d, %dx%d", - name_utf8, - xdpi, - minfo.rcMonitor.left, - minfo.rcMonitor.top, - minfo.rcMonitor.right - minfo.rcMonitor.left, - minfo.rcMonitor.bottom - minfo.rcMonitor.top); + name_utf8, + xdpi, + minfo.rcMonitor.left, + minfo.rcMonitor.top, + minfo.rcMonitor.right - minfo.rcMonitor.left, + minfo.rcMonitor.bottom - minfo.rcMonitor.top); SDL_free(name_utf8); } #endif -int -WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; - SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; LONG status; #ifdef DEBUG_MODES @@ -799,8 +791,7 @@ WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) return 0; } -void -WIN_RefreshDisplays(_THIS) +void WIN_RefreshDisplays(_THIS) { int i; @@ -825,8 +816,7 @@ WIN_RefreshDisplays(_THIS) } } -void -WIN_QuitModes(_THIS) +void WIN_QuitModes(_THIS) { /* All fullscreen windows should have restored modes by now */ } diff --git a/src/video/windows/SDL_windowsmodes.h b/src/video/windows/SDL_windowsmodes.h index 6bf62e58693ac..a0c7724160ce0 100644 --- a/src/video/windows/SDL_windowsmodes.h +++ b/src/video/windows/SDL_windowsmodes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,6 +28,7 @@ typedef struct WCHAR DeviceName[32]; HMONITOR MonitorHandle; SDL_bool IsValid; + SDL_Rect bounds; } SDL_DisplayData; typedef struct @@ -36,13 +37,13 @@ typedef struct } SDL_DisplayModeData; extern int WIN_InitModes(_THIS); -extern int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); -extern int WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); +extern int WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); +extern int WIN_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern void WIN_ScreenPointFromSDL(int *x, int *y, int *dpiOut); extern void WIN_ScreenPointToSDL(int *x, int *y); -extern int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi); -extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +extern int WIN_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); +extern void WIN_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +extern int WIN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern void WIN_RefreshDisplays(_THIS); extern void WIN_QuitModes(_THIS); diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 2ef0f14520b52..5d85978f2660d 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,36 +20,34 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" #include "../../events/SDL_mouse_c.h" - DWORD SDL_last_warp_time = 0; HCURSOR SDL_cursor = NULL; static SDL_Cursor *SDL_blank_cursor = NULL; static int rawInputEnableCount = 0; -static int -ToggleRawInput(SDL_bool enabled) +static int ToggleRawInput(SDL_bool enabled) { RAWINPUTDEVICE rawMouse = { 0x01, 0x02, 0, NULL }; /* Mouse: UsagePage = 1, Usage = 2 */ if (enabled) { rawInputEnableCount++; if (rawInputEnableCount > 1) { - return 0; /* already done. */ + return 0; /* already done. */ } } else { if (rawInputEnableCount == 0) { - return 0; /* already done. */ + return 0; /* already done. */ } rawInputEnableCount--; if (rawInputEnableCount > 0) { - return 0; /* not time to disable yet */ + return 0; /* not time to disable yet */ } } @@ -72,9 +70,7 @@ ToggleRawInput(SDL_bool enabled) return 0; } - -static SDL_Cursor * -WIN_CreateDefaultCursor() +static SDL_Cursor *WIN_CreateDefaultCursor() { SDL_Cursor *cursor; @@ -88,12 +84,11 @@ WIN_CreateDefaultCursor() return cursor; } -static SDL_Cursor * -WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *WIN_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { /* msdn says cursor mask has to be padded out to word alignment. Not sure if that means machine word or WORD, but this handles either case. */ - const size_t pad = (sizeof (size_t) * 8); /* 32 or 64, or whatever. */ + const size_t pad = (sizeof(size_t) * 8); /* 32 or 64, or whatever. */ SDL_Cursor *cursor; HICON hicon; HICON hcursor; @@ -113,13 +108,13 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) bmh.bV4BitCount = 32; bmh.bV4V4Compression = BI_BITFIELDS; bmh.bV4AlphaMask = 0xFF000000; - bmh.bV4RedMask = 0x00FF0000; + bmh.bV4RedMask = 0x00FF0000; bmh.bV4GreenMask = 0x0000FF00; - bmh.bV4BlueMask = 0x000000FF; + bmh.bV4BlueMask = 0x000000FF; maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h; maskbits = SDL_small_alloc(Uint8, maskbitslen, &isstack); - if (maskbits == NULL) { + if (!maskbits) { SDL_OutOfMemory(); return NULL; } @@ -132,14 +127,14 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) ii.fIcon = FALSE; ii.xHotspot = (DWORD)hot_x; ii.yHotspot = (DWORD)hot_y; - ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, DIB_RGB_COLORS, &pixels, NULL, 0); + ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *)&bmh, DIB_RGB_COLORS, &pixels, NULL, 0); ii.hbmMask = CreateBitmap(surface->w, surface->h, 1, 1, maskbits); ReleaseDC(NULL, hdc); SDL_small_free(maskbits, isstack); SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); - SDL_memcpy(pixels, surface->pixels, surface->h * surface->pitch); + SDL_memcpy(pixels, surface->pixels, (size_t)surface->h * surface->pitch); hicon = CreateIconIndirect(&ii); @@ -172,8 +167,7 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) return cursor; } -static SDL_Cursor * -WIN_CreateBlankCursor() +static SDL_Cursor *WIN_CreateBlankCursor() { SDL_Cursor *cursor = NULL; SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 32, 32, 32, SDL_PIXELFORMAT_ARGB8888); @@ -184,29 +178,51 @@ WIN_CreateBlankCursor() return cursor; } -static SDL_Cursor * -WIN_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *WIN_CreateSystemCursor(SDL_SystemCursor id) { SDL_Cursor *cursor; LPCTSTR name; - switch(id) - { + switch (id) { default: SDL_assert(0); return NULL; - case SDL_SYSTEM_CURSOR_ARROW: name = IDC_ARROW; break; - case SDL_SYSTEM_CURSOR_IBEAM: name = IDC_IBEAM; break; - case SDL_SYSTEM_CURSOR_WAIT: name = IDC_WAIT; break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: name = IDC_CROSS; break; - case SDL_SYSTEM_CURSOR_WAITARROW: name = IDC_WAIT; break; - case SDL_SYSTEM_CURSOR_SIZENWSE: name = IDC_SIZENWSE; break; - case SDL_SYSTEM_CURSOR_SIZENESW: name = IDC_SIZENESW; break; - case SDL_SYSTEM_CURSOR_SIZEWE: name = IDC_SIZEWE; break; - case SDL_SYSTEM_CURSOR_SIZENS: name = IDC_SIZENS; break; - case SDL_SYSTEM_CURSOR_SIZEALL: name = IDC_SIZEALL; break; - case SDL_SYSTEM_CURSOR_NO: name = IDC_NO; break; - case SDL_SYSTEM_CURSOR_HAND: name = IDC_HAND; break; + case SDL_SYSTEM_CURSOR_ARROW: + name = IDC_ARROW; + break; + case SDL_SYSTEM_CURSOR_IBEAM: + name = IDC_IBEAM; + break; + case SDL_SYSTEM_CURSOR_WAIT: + name = IDC_WAIT; + break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: + name = IDC_CROSS; + break; + case SDL_SYSTEM_CURSOR_WAITARROW: + name = IDC_WAIT; + break; + case SDL_SYSTEM_CURSOR_SIZENWSE: + name = IDC_SIZENWSE; + break; + case SDL_SYSTEM_CURSOR_SIZENESW: + name = IDC_SIZENESW; + break; + case SDL_SYSTEM_CURSOR_SIZEWE: + name = IDC_SIZEWE; + break; + case SDL_SYSTEM_CURSOR_SIZENS: + name = IDC_SIZENS; + break; + case SDL_SYSTEM_CURSOR_SIZEALL: + name = IDC_SIZEALL; + break; + case SDL_SYSTEM_CURSOR_NO: + name = IDC_NO; + break; + case SDL_SYSTEM_CURSOR_HAND: + name = IDC_HAND; + break; } cursor = SDL_calloc(1, sizeof(*cursor)); @@ -223,8 +239,7 @@ WIN_CreateSystemCursor(SDL_SystemCursor id) return cursor; } -static void -WIN_FreeCursor(SDL_Cursor * cursor) +static void WIN_FreeCursor(SDL_Cursor *cursor) { HICON hicon = (HICON)cursor->driverdata; @@ -232,11 +247,13 @@ WIN_FreeCursor(SDL_Cursor * cursor) SDL_free(cursor); } -static int -WIN_ShowCursor(SDL_Cursor * cursor) +static int WIN_ShowCursor(SDL_Cursor *cursor) { if (!cursor) { - cursor = SDL_blank_cursor; + if (GetSystemMetrics(SM_REMOTESESSION)) { + // Use a blank cursor so we continue to get relative motion over RDP + cursor = SDL_blank_cursor; + } } if (cursor) { SDL_cursor = (HCURSOR)cursor->driverdata; @@ -249,12 +266,11 @@ WIN_ShowCursor(SDL_Cursor * cursor) return 0; } -void -WIN_SetCursorPos(int x, int y) +void WIN_SetCursorPos(int x, int y) { /* We need to jitter the value because otherwise Windows will occasionally inexplicably ignore the SetCursorPos() or SendInput() */ SetCursorPos(x, y); - SetCursorPos(x+1, y); + SetCursorPos(x + 1, y); SetCursorPos(x, y); /* Flush any mouse motion prior to or associated with this warp */ @@ -264,29 +280,30 @@ WIN_SetCursorPos(int x, int y) } } -static void -WIN_WarpMouse(SDL_Window * window, int x, int y) +static void WIN_WarpMouse(SDL_Window *window, int x, int y) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; POINT pt; + int warp_x = x; + int warp_y = y; /* Don't warp the mouse while we're doing a modal interaction */ if (data->in_title_click || data->focus_click_pending) { return; } + WIN_ClientPointFromSDL(window, &x, &y); pt.x = x; pt.y = y; ClientToScreen(hwnd, &pt); WIN_SetCursorPos(pt.x, pt.y); /* Send the exact mouse motion associated with this warp */ - SDL_SendMouseMotion(window, SDL_GetMouse()->mouseID, 0, x, y); + SDL_SendMouseMotion(window, SDL_GetMouse()->mouseID, 0, warp_x, warp_y); } -static int -WIN_WarpMouseGlobal(int x, int y) +static int WIN_WarpMouseGlobal(int x, int y) { POINT pt; @@ -297,21 +314,19 @@ WIN_WarpMouseGlobal(int x, int y) return 0; } -static int -WIN_SetRelativeMouseMode(SDL_bool enabled) +static int WIN_SetRelativeMouseMode(SDL_bool enabled) { return ToggleRawInput(enabled); } -static int -WIN_CaptureMouse(SDL_Window *window) +static int WIN_CaptureMouse(SDL_Window *window) { if (window) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SetCapture(data->hwnd); } else { SDL_Window *focus_window = SDL_GetMouseFocus(); - + if (focus_window) { SDL_WindowData *data = (SDL_WindowData *)focus_window->driverdata; if (!data->mouse_tracked) { @@ -324,16 +339,15 @@ WIN_CaptureMouse(SDL_Window *window) return 0; } -static Uint32 -WIN_GetGlobalMouseState(int *x, int *y) +static Uint32 WIN_GetGlobalMouseState(int *x, int *y) { Uint32 retval = 0; POINT pt = { 0, 0 }; SDL_bool swapButtons = GetSystemMetrics(SM_SWAPBUTTON) != 0; GetCursorPos(&pt); - *x = (int) pt.x; - *y = (int) pt.y; + *x = (int)pt.x; + *y = (int)pt.y; WIN_ScreenPointToSDL(x, y); retval |= GetAsyncKeyState(!swapButtons ? VK_LBUTTON : VK_RBUTTON) & 0x8000 ? SDL_BUTTON_LMASK : 0; @@ -345,8 +359,7 @@ WIN_GetGlobalMouseState(int *x, int *y) return retval; } -void -WIN_InitMouse(_THIS) +void WIN_InitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -367,10 +380,9 @@ WIN_InitMouse(_THIS) WIN_UpdateMouseSystemScale(); } -void -WIN_QuitMouse(_THIS) +void WIN_QuitMouse(_THIS) { - if (rawInputEnableCount) { /* force RAWINPUT off here. */ + if (rawInputEnableCount) { /* force RAWINPUT off here. */ rawInputEnableCount = 1; ToggleRawInput(SDL_FALSE); } @@ -385,13 +397,12 @@ WIN_QuitMouse(_THIS) * https://superuser.com/questions/278362/windows-mouse-acceleration-curve-smoothmousexcurve-and-smoothmouseycurve * http://www.esreality.com/?a=post&id=1846538/ */ -static SDL_bool -LoadFiveFixedPointFloats(BYTE *bytes, float *values) +static SDL_bool LoadFiveFixedPointFloats(const BYTE *bytes, float *values) { int i; for (i = 0; i < 5; ++i) { - float fraction = (float)((Uint16) bytes[1] << 8 | bytes[0]) / 65535.0f; + float fraction = (float)((Uint16)bytes[1] << 8 | bytes[0]) / 65535.0f; float value = (float)(((Uint16)bytes[3] << 8) | bytes[2]) + fraction; *values++ = value; bytes += 8; @@ -399,10 +410,9 @@ LoadFiveFixedPointFloats(BYTE *bytes, float *values) return SDL_TRUE; } -static void -WIN_SetEnhancedMouseScale(int mouse_speed) +static void WIN_SetEnhancedMouseScale(int mouse_speed) { - float scale = (float) mouse_speed / 10.0f; + float scale = (float)mouse_speed / 10.0f; HKEY hKey; DWORD dwType = REG_BINARY; BYTE value[40]; @@ -414,7 +424,7 @@ WIN_SetEnhancedMouseScale(int mouse_speed) const int dpi = 96; // FIXME, how do we handle different monitors with different DPI? const float display_factor = 3.5f * (150.0f / dpi); - if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Mouse", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { + if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Mouse", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { if (RegQueryValueExW(hKey, L"SmoothMouseXCurve", 0, &dwType, value, &length) == ERROR_SUCCESS && LoadFiveFixedPointFloats(value, xpoints) && RegQueryValueExW(hKey, L"SmoothMouseYCurve", 0, &dwType, value, &length) == ERROR_SUCCESS && @@ -428,7 +438,7 @@ WIN_SetEnhancedMouseScale(int mouse_speed) } scale_points[i * 2] = xpoints[i]; scale_points[i * 2 + 1] = gain / display_factor; - //SDL_Log("Point %d = %f,%f\n", i, scale_points[i * 2], scale_points[i * 2 + 1]); + // SDL_Log("Point %d = %f,%f\n", i, scale_points[i * 2], scale_points[i * 2 + 1]); } SDL_SetMouseSystemScale(SDL_arraysize(scale_points), scale_points); } @@ -436,8 +446,7 @@ WIN_SetEnhancedMouseScale(int mouse_speed) } } -static void -WIN_SetLinearMouseScale(int mouse_speed) +static void WIN_SetLinearMouseScale(int mouse_speed) { static float mouse_speed_scale[] = { 0.0f, @@ -468,8 +477,7 @@ WIN_SetLinearMouseScale(int mouse_speed) } } -void -WIN_UpdateMouseSystemScale() +void WIN_UpdateMouseSystemScale(void) { int mouse_speed; int params[3] = { 0, 0, 0 }; diff --git a/src/video/windows/SDL_windowsmouse.h b/src/video/windows/SDL_windowsmouse.h index e67f706c92377..4fa51ff913968 100644 --- a/src/video/windows/SDL_windowsmouse.h +++ b/src/video/windows/SDL_windowsmouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index c1df7f6b98111..e16da4767434d 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#ifdef SDL_VIDEO_DRIVER_WINDOWS #include "SDL_loadso.h" #include "SDL_windowsvideo.h" @@ -29,19 +29,19 @@ /* WGL implementation of SDL OpenGL support */ -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL #include "SDL_opengl.h" #define DEFAULT_OPENGL "OPENGL32.DLL" #ifndef WGL_ARB_create_context #define WGL_ARB_create_context -#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 -#define WGL_CONTEXT_FLAGS_ARB 0x2094 -#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #ifndef WGL_ARB_create_context_profile #define WGL_ARB_create_context_profile @@ -52,53 +52,62 @@ #ifndef WGL_ARB_create_context_robustness #define WGL_ARB_create_context_robustness -#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 -#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #endif #endif #ifndef WGL_EXT_create_context_es2_profile #define WGL_EXT_create_context_es2_profile -#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 #endif #ifndef WGL_EXT_create_context_es_profile #define WGL_EXT_create_context_es_profile -#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 #endif #ifndef WGL_ARB_framebuffer_sRGB #define WGL_ARB_framebuffer_sRGB -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 #endif #ifndef WGL_ARB_pixel_format_float #define WGL_ARB_pixel_format_float -#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 #endif #ifndef WGL_ARB_context_flush_control #define WGL_ARB_context_flush_control -#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 #endif #ifndef WGL_ARB_create_context_no_error #define WGL_ARB_create_context_no_error -#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 #endif -typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, - HGLRC - hShareContext, - const int - *attribList); +typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC, + HGLRC + hShareContext, + const int + *attribList); + +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) +#define GetDC(hwnd) (HDC) hwnd +#define ReleaseDC(hwnd, hdc) 1 +#define SwapBuffers _this->gl_data->wglSwapBuffers +#define DescribePixelFormat _this->gl_data->wglDescribePixelFormat +#define ChoosePixelFormat _this->gl_data->wglChoosePixelFormat +#define GetPixelFormat _this->gl_data->wglGetPixelFormat +#define SetPixelFormat _this->gl_data->wglSetPixelFormat +#endif -int -WIN_GL_LoadLibrary(_THIS, const char *path) +int WIN_GL_LoadLibrary(_THIS, const char *path) { void *handle; @@ -116,28 +125,51 @@ WIN_GL_LoadLibrary(_THIS, const char *path) SDL_arraysize(_this->gl_config.driver_path)); /* Allocate OpenGL memory */ - _this->gl_data = (struct SDL_GLDriverData *) SDL_calloc(1, sizeof(struct SDL_GLDriverData)); + _this->gl_data = (struct SDL_GLDriverData *)SDL_calloc(1, sizeof(struct SDL_GLDriverData)); if (!_this->gl_data) { return SDL_OutOfMemory(); } /* Load function pointers */ handle = _this->gl_config.dll_handle; - _this->gl_data->wglGetProcAddress = (void *(WINAPI *) (const char *)) + /* *INDENT-OFF* */ /* clang-format off */ + _this->gl_data->wglGetProcAddress = (void *(WINAPI *)(const char *)) SDL_LoadFunction(handle, "wglGetProcAddress"); - _this->gl_data->wglCreateContext = (HGLRC(WINAPI *) (HDC)) + _this->gl_data->wglCreateContext = (HGLRC (WINAPI *)(HDC)) SDL_LoadFunction(handle, "wglCreateContext"); - _this->gl_data->wglDeleteContext = (BOOL(WINAPI *) (HGLRC)) + _this->gl_data->wglDeleteContext = (BOOL (WINAPI *)(HGLRC)) SDL_LoadFunction(handle, "wglDeleteContext"); - _this->gl_data->wglMakeCurrent = (BOOL(WINAPI *) (HDC, HGLRC)) + _this->gl_data->wglMakeCurrent = (BOOL (WINAPI *)(HDC, HGLRC)) SDL_LoadFunction(handle, "wglMakeCurrent"); - _this->gl_data->wglShareLists = (BOOL(WINAPI *) (HGLRC, HGLRC)) + _this->gl_data->wglShareLists = (BOOL (WINAPI *)(HGLRC, HGLRC)) SDL_LoadFunction(handle, "wglShareLists"); + /* *INDENT-ON* */ /* clang-format on */ + +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) + _this->gl_data->wglSwapBuffers = (BOOL(WINAPI *)(HDC)) + SDL_LoadFunction(handle, "wglSwapBuffers"); + _this->gl_data->wglDescribePixelFormat = (int(WINAPI *)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR)) + SDL_LoadFunction(handle, "wglDescribePixelFormat"); + _this->gl_data->wglChoosePixelFormat = (int(WINAPI *)(HDC, const PIXELFORMATDESCRIPTOR *)) + SDL_LoadFunction(handle, "wglChoosePixelFormat"); + _this->gl_data->wglSetPixelFormat = (BOOL(WINAPI *)(HDC, int, const PIXELFORMATDESCRIPTOR *)) + SDL_LoadFunction(handle, "wglSetPixelFormat"); + _this->gl_data->wglGetPixelFormat = (int(WINAPI *)(HDC hdc)) + SDL_LoadFunction(handle, "wglGetPixelFormat"); +#endif if (!_this->gl_data->wglGetProcAddress || !_this->gl_data->wglCreateContext || !_this->gl_data->wglDeleteContext || - !_this->gl_data->wglMakeCurrent) { + !_this->gl_data->wglMakeCurrent +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) + || !_this->gl_data->wglSwapBuffers || + !_this->gl_data->wglDescribePixelFormat || + !_this->gl_data->wglChoosePixelFormat || + !_this->gl_data->wglGetPixelFormat || + !_this->gl_data->wglSetPixelFormat +#endif + ) { return SDL_SetError("Could not retrieve OpenGL functions"); } @@ -182,8 +214,7 @@ WIN_GL_LoadLibrary(_THIS, const char *path) return 0; } -void * -WIN_GL_GetProcAddress(_THIS, const char *proc) +void *WIN_GL_GetProcAddress(_THIS, const char *proc) { void *func; @@ -196,8 +227,7 @@ WIN_GL_GetProcAddress(_THIS, const char *proc) return func; } -void -WIN_GL_UnloadLibrary(_THIS) +void WIN_GL_UnloadLibrary(_THIS) { SDL_UnloadObject(_this->gl_config.dll_handle); _this->gl_config.dll_handle = NULL; @@ -207,8 +237,7 @@ WIN_GL_UnloadLibrary(_THIS) _this->gl_data = NULL; } -static void -WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR * pfd) +static void WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR *pfd) { SDL_zerop(pfd); pfd->nSize = sizeof(*pfd); @@ -246,8 +275,7 @@ WIN_GL_SetupPixelFormat(_THIS, PIXELFORMATDESCRIPTOR * pfd) /* Choose the closest pixel format that meets or exceeds the target. FIXME: Should we weight any particular attribute over any other? */ -static int -WIN_GL_ChoosePixelFormat(HDC hdc, PIXELFORMATDESCRIPTOR * target) +static int WIN_GL_ChoosePixelFormat(_THIS, HDC hdc, PIXELFORMATDESCRIPTOR *target) { PIXELFORMATDESCRIPTOR pfd; int count, index, best = 0; @@ -344,19 +372,20 @@ WIN_GL_ChoosePixelFormat(HDC hdc, PIXELFORMATDESCRIPTOR * target) return best; } -static SDL_bool -HasExtension(const char *extension, const char *extensions) +static SDL_bool HasExtension(const char *extension, const char *extensions) { const char *start; const char *where, *terminator; /* Extension names should not have spaces. */ where = SDL_strchr(extension, ' '); - if (where || *extension == '\0') + if (where || *extension == '\0') { return SDL_FALSE; + } - if (!extensions) + if (!extensions) { return SDL_FALSE; + } /* It takes a bit of care to be fool-proof about parsing the * OpenGL extensions string. Don't be fooled by sub-strings, @@ -366,23 +395,27 @@ HasExtension(const char *extension, const char *extensions) for (;;) { where = SDL_strstr(start, extension); - if (!where) + if (!where) { break; + } terminator = where + SDL_strlen(extension); - if (where == start || *(where - 1) == ' ') - if (*terminator == ' ' || *terminator == '\0') + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { return SDL_TRUE; + } + } start = terminator; } return SDL_FALSE; } -void -WIN_GL_InitExtensions(_THIS) +void WIN_GL_InitExtensions(_THIS) { - const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0; + /* *INDENT-OFF* */ /* clang-format off */ + const char *(WINAPI * wglGetExtensionsStringARB)(HDC) = 0; + /* *INDENT-ON* */ /* clang-format on */ const char *extensions; HWND hwnd; HDC hdc; @@ -395,7 +428,7 @@ WIN_GL_InitExtensions(_THIS) hwnd = CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0, - 10, 10, NULL, NULL, SDL_Instance, NULL); + 10, 10, NULL, NULL, SDL_Instance, NULL); if (!hwnd) { return; } @@ -413,8 +446,10 @@ WIN_GL_InitExtensions(_THIS) } _this->gl_data->wglMakeCurrent(hdc, hglrc); - wglGetExtensionsStringARB = (const char *(WINAPI *) (HDC)) + /* *INDENT-OFF* */ /* clang-format off */ + wglGetExtensionsStringARB = (const char *(WINAPI *)(HDC)) _this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB"); + /* *INDENT-ON* */ /* clang-format on */ if (wglGetExtensionsStringARB) { extensions = wglGetExtensionsStringARB(hdc); } else { @@ -424,14 +459,14 @@ WIN_GL_InitExtensions(_THIS) /* Check for WGL_ARB_pixel_format */ _this->gl_data->HAS_WGL_ARB_pixel_format = SDL_FALSE; if (HasExtension("WGL_ARB_pixel_format", extensions)) { - _this->gl_data->wglChoosePixelFormatARB = (BOOL(WINAPI *) - (HDC, const int *, - const FLOAT *, UINT, - int *, UINT *)) + /* *INDENT-OFF* */ /* clang-format off */ + _this->gl_data->wglChoosePixelFormatARB = + (BOOL (WINAPI *)(HDC, const int *, const FLOAT *, UINT, int *, UINT *)) WIN_GL_GetProcAddress(_this, "wglChoosePixelFormatARB"); _this->gl_data->wglGetPixelFormatAttribivARB = - (BOOL(WINAPI *) (HDC, int, int, UINT, const int *, int *)) + (BOOL (WINAPI *)(HDC, int, int, UINT, const int *, int *)) WIN_GL_GetProcAddress(_this, "wglGetPixelFormatAttribivARB"); + /* *INDENT-ON* */ /* clang-format on */ if ((_this->gl_data->wglChoosePixelFormatARB != NULL) && (_this->gl_data->wglGetPixelFormatAttribivARB != NULL)) { @@ -458,8 +493,7 @@ WIN_GL_InitExtensions(_THIS) if (HasExtension("WGL_EXT_create_context_es2_profile", extensions)) { SDL_GL_DeduceMaxSupportedESProfile( &_this->gl_data->es_profile_max_supported_version.major, - &_this->gl_data->es_profile_max_supported_version.minor - ); + &_this->gl_data->es_profile_max_supported_version.minor); } /* Check for WGL_ARB_context_flush_control */ @@ -477,6 +511,10 @@ WIN_GL_InitExtensions(_THIS) _this->gl_data->HAS_WGL_ARB_create_context_no_error = SDL_TRUE; } + /* Check for WGL_ARB_pixel_format_float */ + _this->gl_data->HAS_WGL_ARB_pixel_format_float = + HasExtension("WGL_ARB_pixel_format_float", extensions); + _this->gl_data->wglMakeCurrent(hdc, NULL); _this->gl_data->wglDeleteContext(hglrc); ReleaseDC(hwnd, hdc); @@ -484,8 +522,7 @@ WIN_GL_InitExtensions(_THIS) WIN_PumpEvents(_this); } -static int -WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) +static int WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) { HWND hwnd; HDC hdc; @@ -494,6 +531,9 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) int pixel_format = 0; unsigned int matching; + int qAttrib = WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB; + int srgb = 0; + hwnd = CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0, 10, 10, NULL, NULL, SDL_Instance, NULL); @@ -513,6 +553,10 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) _this->gl_data->wglChoosePixelFormatARB(hdc, iAttribs, fAttribs, 1, &pixel_format, &matching); + + /* Check whether we actually got an SRGB capable buffer */ + _this->gl_data->wglGetPixelFormatAttribivARB(hdc, pixel_format, 0, 1, &qAttrib, &srgb); + _this->gl_config.framebuffer_srgb_capable = srgb; } _this->gl_data->wglMakeCurrent(hdc, NULL); @@ -526,10 +570,9 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) } /* actual work of WIN_GL_SetupWindow() happens here. */ -static int -WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window) +static int WIN_GL_SetupWindowInternal(_THIS, SDL_Window *window) { - HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc; + HDC hdc = ((SDL_WindowData *)window->driverdata)->hdc; PIXELFORMATDESCRIPTOR pfd; int pixel_format = 0; int iAttribs[64]; @@ -602,7 +645,8 @@ WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window) *iAttr++ = _this->gl_config.multisamplesamples; } - if (_this->gl_config.floatbuffers) { + if (_this->gl_data->HAS_WGL_ARB_pixel_format_float && _this->gl_config.floatbuffers) { + *iAttr++ = WGL_PIXEL_TYPE_ARB; *iAttr++ = WGL_TYPE_RGBA_FLOAT_ARB; } @@ -629,13 +673,13 @@ WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window) pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs); /* App said "don't care about accel" and FULL accel failed. Try NO. */ - if ( ( !pixel_format ) && ( _this->gl_config.accelerated < 0 ) ) { + if ((!pixel_format) && (_this->gl_config.accelerated < 0)) { *iAccelAttr = WGL_NO_ACCELERATION_ARB; pixel_format = WIN_GL_ChoosePixelFormatARB(_this, iAttribs, fAttribs); - *iAccelAttr = WGL_FULL_ACCELERATION_ARB; /* if we try again. */ + *iAccelAttr = WGL_FULL_ACCELERATION_ARB; /* if we try again. */ } if (!pixel_format) { - pixel_format = WIN_GL_ChoosePixelFormat(hdc, &pfd); + pixel_format = WIN_GL_ChoosePixelFormat(_this, hdc, &pfd); } if (!pixel_format) { return SDL_SetError("No matching GL pixel format available"); @@ -646,8 +690,7 @@ WIN_GL_SetupWindowInternal(_THIS, SDL_Window * window) return 0; } -int -WIN_GL_SetupWindow(_THIS, SDL_Window * window) +int WIN_GL_SetupWindow(_THIS, SDL_Window *window) { /* The current context is lost in here; save it and reset it. */ SDL_Window *current_win = SDL_GL_GetCurrentWindow(); @@ -657,27 +700,21 @@ WIN_GL_SetupWindow(_THIS, SDL_Window * window) return retval; } -SDL_bool -WIN_GL_UseEGL(_THIS) +SDL_bool WIN_GL_UseEGL(_THIS) { SDL_assert(_this->gl_data != NULL); SDL_assert(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES); - return (SDL_GetHintBoolean(SDL_HINT_OPENGL_ES_DRIVER, SDL_FALSE) - || _this->gl_config.major_version == 1 /* No WGL extension for OpenGL ES 1.x profiles. */ - || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major - || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major - && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor)); + return SDL_GetHintBoolean(SDL_HINT_OPENGL_ES_DRIVER, SDL_FALSE) || _this->gl_config.major_version == 1 || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor); /* No WGL extension for OpenGL ES 1.x profiles. */ } -SDL_GLContext -WIN_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window *window) { - HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc; + HDC hdc = ((SDL_WindowData *)window->driverdata)->hdc; HGLRC context, share_context; if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && WIN_GL_UseEGL(_this)) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Switch to EGL based functions */ WIN_GL_UnloadLibrary(_this); _this->GL_LoadLibrary = WIN_GLES_LoadLibrary; @@ -689,11 +726,11 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) _this->GL_GetSwapInterval = WIN_GLES_GetSwapInterval; _this->GL_SwapWindow = WIN_GLES_SwapWindow; _this->GL_DeleteContext = WIN_GLES_DeleteContext; - + if (WIN_GLES_LoadLibrary(_this, NULL) != 0) { return NULL; } - + return WIN_GLES_CreateContext(_this, window); #else SDL_SetError("SDL not configured with EGL support"); @@ -712,7 +749,7 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) _this->gl_config.flags == 0) { /* Create legacy context */ context = _this->gl_data->wglCreateContext(hdc); - if( share_context != 0 ) { + if (share_context != 0) { _this->gl_data->wglShareLists(share_context, context); } } else { @@ -730,13 +767,12 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) } wglCreateContextAttribsARB = - (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data-> - wglGetProcAddress("wglCreateContextAttribsARB"); + (PFNWGLCREATECONTEXTATTRIBSARBPROC)_this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB"); if (!wglCreateContextAttribsARB) { SDL_SetError("GL 3.x is not supported"); context = temp_context; } else { - int attribs[15]; /* max 14 attributes plus terminator */ + int attribs[15]; /* max 14 attributes plus terminator */ int iattr = 0; attribs[iattr++] = WGL_CONTEXT_MAJOR_VERSION_ARB; @@ -756,24 +792,20 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) attribs[iattr++] = _this->gl_config.flags; } - /* only set if wgl extension is available */ - if (_this->gl_data->HAS_WGL_ARB_context_flush_control) { + /* only set if wgl extension is available and not the default setting */ + if ((_this->gl_data->HAS_WGL_ARB_context_flush_control) && (_this->gl_config.release_behavior == 0)) { attribs[iattr++] = WGL_CONTEXT_RELEASE_BEHAVIOR_ARB; - attribs[iattr++] = _this->gl_config.release_behavior ? - WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : - WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; + attribs[iattr++] = _this->gl_config.release_behavior ? WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; } - /* only set if wgl extension is available */ - if (_this->gl_data->HAS_WGL_ARB_create_context_robustness) { + /* only set if wgl extension is available and not the default setting */ + if ((_this->gl_data->HAS_WGL_ARB_create_context_robustness) && (_this->gl_config.reset_notification != 0)) { attribs[iattr++] = WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB; - attribs[iattr++] = _this->gl_config.reset_notification ? - WGL_LOSE_CONTEXT_ON_RESET_ARB : - WGL_NO_RESET_NOTIFICATION_ARB; + attribs[iattr++] = _this->gl_config.reset_notification ? WGL_LOSE_CONTEXT_ON_RESET_ARB : WGL_NO_RESET_NOTIFICATION_ARB; } - /* only set if wgl extension is available */ - if (_this->gl_data->HAS_WGL_ARB_create_context_no_error) { + /* only set if wgl extension is available and not the default setting */ + if ((_this->gl_data->HAS_WGL_ARB_create_context_no_error) && (_this->gl_config.no_error != 0)) { attribs[iattr++] = WGL_CONTEXT_OPENGL_NO_ERROR_ARB; attribs[iattr++] = _this->gl_config.no_error; } @@ -797,11 +829,13 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) return NULL; } + _this->gl_config.HAS_GL_ARB_color_buffer_float = + SDL_GL_ExtensionSupported("GL_ARB_color_buffer_float"); + return context; } -int -WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int WIN_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { HDC hdc; @@ -810,7 +844,7 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) } /* sanity check that higher level handled this. */ - SDL_assert(window || (!window && !context)); + SDL_assert(window || (window == NULL && !context)); /* Some Windows drivers freak out if hdc is NULL, even when context is NULL, against spec. Since hdc is _supposed_ to be ignored if context @@ -820,19 +854,18 @@ WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) window = SDL_GL_GetCurrentWindow(); if (!window) { SDL_assert(SDL_GL_GetCurrentContext() == NULL); - return 0; /* already done. */ + return 0; /* already done. */ } } - hdc = ((SDL_WindowData *) window->driverdata)->hdc; - if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC) context)) { + hdc = ((SDL_WindowData *)window->driverdata)->hdc; + if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC)context)) { return WIN_SetError("wglMakeCurrent()"); } return 0; } -int -WIN_GL_SetSwapInterval(_THIS, int interval) +int WIN_GL_SetSwapInterval(_THIS, int interval) { if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) { return SDL_SetError("Negative swap interval unsupported in this GL"); @@ -846,8 +879,7 @@ WIN_GL_SetSwapInterval(_THIS, int interval) return 0; } -int -WIN_GL_GetSwapInterval(_THIS) +int WIN_GL_GetSwapInterval(_THIS) { int retval = 0; if (_this->gl_data->wglGetSwapIntervalEXT) { @@ -856,10 +888,9 @@ WIN_GL_GetSwapInterval(_THIS) return retval; } -int -WIN_GL_SwapWindow(_THIS, SDL_Window * window) +int WIN_GL_SwapWindow(_THIS, SDL_Window *window) { - HDC hdc = ((SDL_WindowData *) window->driverdata)->hdc; + HDC hdc = ((SDL_WindowData *)window->driverdata)->hdc; if (!SwapBuffers(hdc)) { return WIN_SetError("SwapBuffers()"); @@ -867,21 +898,18 @@ WIN_GL_SwapWindow(_THIS, SDL_Window * window) return 0; } -void -WIN_GL_DeleteContext(_THIS, SDL_GLContext context) +void WIN_GL_DeleteContext(_THIS, SDL_GLContext context) { if (!_this->gl_data) { return; } - _this->gl_data->wglDeleteContext((HGLRC) context); + _this->gl_data->wglDeleteContext((HGLRC)context); } - -SDL_bool -WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window * fromWindow, SDL_Window * toWindow) +SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window *fromWindow, SDL_Window *toWindow) { - HDC hfromdc = ((SDL_WindowData *) fromWindow->driverdata)->hdc; - HDC htodc = ((SDL_WindowData *) toWindow->driverdata)->hdc; + HDC hfromdc = ((SDL_WindowData *)fromWindow->driverdata)->hdc; + HDC htodc = ((SDL_WindowData *)toWindow->driverdata)->hdc; BOOL result; /* get the pixel format of the fromWindow */ diff --git a/src/video/windows/SDL_windowsopengl.h b/src/video/windows/SDL_windowsopengl.h index 2dec0023a425b..431e27468a31c 100644 --- a/src/video/windows/SDL_windowsopengl.h +++ b/src/video/windows/SDL_windowsopengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,39 @@ #ifndef SDL_windowsopengl_h_ #define SDL_windowsopengl_h_ -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL + +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) +typedef struct tagPIXELFORMATDESCRIPTOR +{ + WORD nSize; + WORD nVersion; + DWORD dwFlags; + BYTE iPixelType; + BYTE cColorBits; + BYTE cRedBits; + BYTE cRedShift; + BYTE cGreenBits; + BYTE cGreenShift; + BYTE cBlueBits; + BYTE cBlueShift; + BYTE cAlphaBits; + BYTE cAlphaShift; + BYTE cAccumBits; + BYTE cAccumRedBits; + BYTE cAccumGreenBits; + BYTE cAccumBlueBits; + BYTE cAccumAlphaBits; + BYTE cDepthBits; + BYTE cStencilBits; + BYTE cAuxBuffers; + BYTE iLayerType; + BYTE bReserved; + DWORD dwLayerMask; + DWORD dwVisibleMask; + DWORD dwDamageMask; +} PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; +#endif struct SDL_GLDriverData { @@ -32,34 +64,42 @@ struct SDL_GLDriverData SDL_bool HAS_WGL_ARB_context_flush_control; SDL_bool HAS_WGL_ARB_create_context_robustness; SDL_bool HAS_WGL_ARB_create_context_no_error; + SDL_bool HAS_WGL_ARB_pixel_format_float; /* Max version of OpenGL ES context that can be created if the implementation supports WGL_EXT_create_context_es2_profile. major = minor = 0 when unsupported. */ - struct { + struct + { int major; int minor; } es_profile_max_supported_version; - void *(WINAPI * wglGetProcAddress) (const char *proc); - HGLRC(WINAPI * wglCreateContext) (HDC hdc); - BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc); - BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc); - BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2); - BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc, - const int *piAttribIList, - const FLOAT * pfAttribFList, - UINT nMaxFormats, - int *piFormats, - UINT * nNumFormats); - BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat, - int iLayerPlane, - UINT nAttributes, - const int *piAttributes, - int *piValues); - BOOL (WINAPI * wglSwapIntervalEXT) (int interval); - int (WINAPI * wglGetSwapIntervalEXT) (void); + /* *INDENT-OFF* */ /* clang-format off */ + void *(WINAPI *wglGetProcAddress)(const char *proc); + HGLRC (WINAPI *wglCreateContext)(HDC hdc); + BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc); + BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc); + BOOL (WINAPI *wglShareLists)(HGLRC hglrc1, HGLRC hglrc2); + BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList, const FLOAT * pfAttribFList, UINT nMaxFormats, int *piFormats, UINT * nNumFormats); + BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); + BOOL (WINAPI *wglSwapIntervalEXT)(int interval); + int (WINAPI *wglGetSwapIntervalEXT)(void); +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) + BOOL (WINAPI *wglSwapBuffers)(HDC hdc); + int (WINAPI *wglDescribePixelFormat)(HDC hdc, + int iPixelFormat, + UINT nBytes, + LPPIXELFORMATDESCRIPTOR ppfd); + int (WINAPI *wglChoosePixelFormat)(HDC hdc, + const PIXELFORMATDESCRIPTOR *ppfd); + BOOL (WINAPI *wglSetPixelFormat)(HDC hdc, + int format, + const PIXELFORMATDESCRIPTOR *ppfd); + int (WINAPI *wglGetPixelFormat)(HDC hdc); +#endif + /* *INDENT-ON* */ /* clang-format on */ }; /* OpenGL functions */ @@ -67,72 +107,72 @@ extern int WIN_GL_LoadLibrary(_THIS, const char *path); extern void *WIN_GL_GetProcAddress(_THIS, const char *proc); extern void WIN_GL_UnloadLibrary(_THIS); extern SDL_bool WIN_GL_UseEGL(_THIS); -extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window); -extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window); -extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window, +extern int WIN_GL_SetupWindow(_THIS, SDL_Window *window); +extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window *window); +extern int WIN_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int WIN_GL_SetSwapInterval(_THIS, int interval); extern int WIN_GL_GetSwapInterval(_THIS); -extern int WIN_GL_SwapWindow(_THIS, SDL_Window * window); +extern int WIN_GL_SwapWindow(_THIS, SDL_Window *window); extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context); extern void WIN_GL_InitExtensions(_THIS); -extern SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window * fromWindow, SDL_Window * toWindow); +extern SDL_bool WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window *fromWindow, SDL_Window *toWindow); #ifndef WGL_ARB_pixel_format -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_DRAW_TO_BITMAP_ARB 0x2002 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_NEED_PALETTE_ARB 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_NUMBER_OVERLAYS_ARB 0x2008 -#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 -#define WGL_TRANSPARENT_ARB 0x200A -#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 -#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B -#define WGL_SHARE_DEPTH_ARB 0x200C -#define WGL_SHARE_STENCIL_ARB 0x200D -#define WGL_SHARE_ACCUM_ARB 0x200E -#define WGL_SUPPORT_GDI_ARB 0x200F -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_STEREO_ARB 0x2012 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_RED_SHIFT_ARB 0x2016 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_GREEN_SHIFT_ARB 0x2018 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_BLUE_SHIFT_ARB 0x201A -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_ALPHA_SHIFT_ARB 0x201C -#define WGL_ACCUM_BITS_ARB 0x201D -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_AUX_BUFFERS_ARB 0x2024 -#define WGL_NO_ACCELERATION_ARB 0x2025 -#define WGL_GENERIC_ACCELERATION_ARB 0x2026 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_SWAP_EXCHANGE_ARB 0x2028 -#define WGL_SWAP_COPY_ARB 0x2029 -#define WGL_SWAP_UNDEFINED_ARB 0x202A -#define WGL_TYPE_RGBA_ARB 0x202B -#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C #endif #ifndef WGL_ARB_multisample -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 #endif #endif /* SDL_VIDEO_OPENGL_WGL */ diff --git a/src/video/windows/SDL_windowsopengles.c b/src/video/windows/SDL_windowsopengles.c index 1e2a4f62079ba..50e63fd3af0e9 100644 --- a/src/video/windows/SDL_windowsopengles.c +++ b/src/video/windows/SDL_windowsopengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && SDL_VIDEO_OPENGL_EGL && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && defined(SDL_VIDEO_OPENGL_EGL) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsvideo.h" #include "SDL_windowsopengles.h" @@ -29,12 +29,12 @@ /* EGL implementation of SDL OpenGL support */ -int -WIN_GLES_LoadLibrary(_THIS, const char *path) { +int WIN_GLES_LoadLibrary(_THIS, const char *path) +{ /* If the profile requested is not GL ES, switch over to WIN_GL functions */ if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL WIN_GLES_UnloadLibrary(_this); _this->GL_LoadLibrary = WIN_GL_LoadLibrary; _this->GL_GetProcAddress = WIN_GL_GetProcAddress; @@ -50,21 +50,20 @@ WIN_GLES_LoadLibrary(_THIS, const char *path) { return SDL_SetError("SDL not configured with OpenGL/WGL support"); #endif } - - if (_this->egl_data == NULL) { + + if (!_this->egl_data) { return SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0); } return 0; } -SDL_GLContext -WIN_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window *window) { SDL_GLContext context; SDL_WindowData *data = (SDL_WindowData *)window->driverdata; -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { /* Switch to WGL based functions */ WIN_GLES_UnloadLibrary(_this); @@ -90,27 +89,26 @@ WIN_GLES_CreateContext(_THIS, SDL_Window * window) return context; } -void -WIN_GLES_DeleteContext(_THIS, SDL_GLContext context) +void WIN_GLES_DeleteContext(_THIS, SDL_GLContext context) { SDL_EGL_DeleteContext(_this, context); - WIN_GLES_UnloadLibrary(_this); } +/* *INDENT-OFF* */ /* clang-format off */ SDL_EGL_SwapWindow_impl(WIN) SDL_EGL_MakeCurrent_impl(WIN) +/* *INDENT-ON* */ /* clang-format on */ -int -WIN_GLES_SetupWindow(_THIS, SDL_Window * window) +int WIN_GLES_SetupWindow(_THIS, SDL_Window *window) { /* The current context is lost in here; save it and reset it. */ - SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata; SDL_Window *current_win = SDL_GL_GetCurrentWindow(); SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); - if (_this->egl_data == NULL) { - /* !!! FIXME: commenting out this assertion is (I think) incorrect; figure out why driver_loaded is wrong for ANGLE instead. --ryan. */ - #if 0 /* When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), _this->gl_config.driver_loaded can be 1, while the below lines function. */ + if (!_this->egl_data) { +/* !!! FIXME: commenting out this assertion is (I think) incorrect; figure out why driver_loaded is wrong for ANGLE instead. --ryan. */ +#if 0 /* When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), _this->gl_config.driver_loaded can be 1, while the below lines function. */ SDL_assert(!_this->gl_config.driver_loaded); #endif if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) { @@ -119,7 +117,7 @@ WIN_GLES_SetupWindow(_THIS, SDL_Window * window) } _this->gl_config.driver_loaded = 1; } - + /* Create the GLES window surface */ windowdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)windowdata->hwnd); @@ -127,7 +125,7 @@ WIN_GLES_SetupWindow(_THIS, SDL_Window * window) return SDL_SetError("Could not create GLES window surface"); } - return WIN_GLES_MakeCurrent(_this, current_win, current_ctx); + return WIN_GLES_MakeCurrent(_this, current_win, current_ctx); } #endif /* SDL_VIDEO_DRIVER_WINDOWS && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/windows/SDL_windowsopengles.h b/src/video/windows/SDL_windowsopengles.h index b21c56f4fedd0..fb85da6f0bb7a 100644 --- a/src/video/windows/SDL_windowsopengles.h +++ b/src/video/windows/SDL_windowsopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_winopengles_h_ #define SDL_winopengles_h_ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -36,9 +36,9 @@ #define WIN_GLES_SetSwapInterval SDL_EGL_SetSwapInterval extern int WIN_GLES_LoadLibrary(_THIS, const char *path); -extern SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window * window); -extern int WIN_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int WIN_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); +extern SDL_GLContext WIN_GLES_CreateContext(_THIS, SDL_Window *window); +extern int WIN_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int WIN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern void WIN_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int WIN_GLES_SetupWindow(_THIS, SDL_Window * window); diff --git a/src/video/windows/SDL_windowsshape.c b/src/video/windows/SDL_windowsshape.c index 484566dd30d7b..1c0bc4e69162e 100644 --- a/src/video/windows/SDL_windowsshape.c +++ b/src/video/windows/SDL_windowsshape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,15 +20,15 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowsshape.h" #include "SDL_windowsvideo.h" -SDL_WindowShaper* -Win32_CreateShaper(SDL_Window * window) { +SDL_WindowShaper *Win32_CreateShaper(SDL_Window *window) +{ int resized_properly; - SDL_WindowShaper* result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper)); + SDL_WindowShaper *result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper)); if (!result) { SDL_OutOfMemory(); return NULL; @@ -38,7 +38,7 @@ Win32_CreateShaper(SDL_Window * window) { result->mode.parameters.binarizationCutoff = 1; result->userx = result->usery = 0; result->hasshape = SDL_FALSE; - result->driverdata = (SDL_ShapeData*)SDL_calloc(1, sizeof(SDL_ShapeData)); + result->driverdata = (SDL_ShapeData *)SDL_calloc(1, sizeof(SDL_ShapeData)); if (!result->driverdata) { SDL_free(result); SDL_OutOfMemory(); @@ -57,40 +57,41 @@ Win32_CreateShaper(SDL_Window * window) { return result; } -static void -CombineRectRegions(SDL_ShapeTree* node,void* closure) { - HRGN mask_region = *((HRGN*)closure),temp_region = NULL; - if(node->kind == OpaqueShape) { +static void CombineRectRegions(SDL_ShapeTree *node, void *closure) +{ + HRGN mask_region = *((HRGN *)closure), temp_region = NULL; + if (node->kind == OpaqueShape) { /* Win32 API regions exclude their outline, so we widen the region by one pixel in each direction to include the real outline. */ - temp_region = CreateRectRgn(node->data.shape.x,node->data.shape.y,node->data.shape.x + node->data.shape.w + 1,node->data.shape.y + node->data.shape.h + 1); - if(mask_region != NULL) { - CombineRgn(mask_region,mask_region,temp_region,RGN_OR); + temp_region = CreateRectRgn(node->data.shape.x, node->data.shape.y, node->data.shape.x + node->data.shape.w + 1, node->data.shape.y + node->data.shape.h + 1); + if (mask_region != NULL) { + CombineRgn(mask_region, mask_region, temp_region, RGN_OR); DeleteObject(temp_region); + } else { + *((HRGN *)closure) = temp_region; } - else - *((HRGN*)closure) = temp_region; } } -int -Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { +int Win32_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) +{ SDL_ShapeData *data; HRGN mask_region = NULL; - if( (shaper == NULL) || - (shape == NULL) || + if ((!shaper) || + (!shape) || ((shape->format->Amask == 0) && (shape_mode->mode != ShapeModeColorKey)) || (shape->w != shaper->window->w) || - (shape->h != shaper->window->h) ) { + (shape->h != shaper->window->h)) { return SDL_INVALID_SHAPE_ARGUMENT; } - data = (SDL_ShapeData*)shaper->driverdata; - if(data->mask_tree != NULL) + data = (SDL_ShapeData *)shaper->driverdata; + if (data->mask_tree) { SDL_FreeShapeTree(&data->mask_tree); - data->mask_tree = SDL_CalculateShapeTree(*shape_mode,shape); + } + data->mask_tree = SDL_CalculateShapeTree(*shape_mode, shape); - SDL_TraverseShapeTree(data->mask_tree,&CombineRectRegions,&mask_region); + SDL_TraverseShapeTree(data->mask_tree, &CombineRectRegions, &mask_region); SDL_assert(mask_region != NULL); SetWindowRgn(((SDL_WindowData *)(shaper->window->driverdata))->hwnd, mask_region, TRUE); @@ -98,22 +99,25 @@ Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape return 0; } -int -Win32_ResizeWindowShape(SDL_Window *window) { - SDL_ShapeData* data; +int Win32_ResizeWindowShape(SDL_Window *window) +{ + SDL_ShapeData *data; - if (window == NULL) + if (!window) { return -1; + } data = (SDL_ShapeData *)window->shaper->driverdata; - if (data == NULL) + if (!data) { return -1; + } - if(data->mask_tree != NULL) + if (data->mask_tree) { SDL_FreeShapeTree(&data->mask_tree); - if(window->shaper->hasshape == SDL_TRUE) { + } + if (window->shaper->hasshape == SDL_TRUE) { window->shaper->userx = window->x; window->shaper->usery = window->y; - SDL_SetWindowPosition(window,-1000,-1000); + SDL_SetWindowPosition(window, -1000, -1000); } return 0; diff --git a/src/video/windows/SDL_windowsshape.h b/src/video/windows/SDL_windowsshape.h index 9828073574c36..3e5f300854ba6 100644 --- a/src/video/windows/SDL_windowsshape.h +++ b/src/video/windows/SDL_windowsshape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,12 +29,13 @@ #include "../SDL_sysvideo.h" #include "../SDL_shape_internals.h" -typedef struct { +typedef struct +{ SDL_ShapeTree *mask_tree; } SDL_ShapeData; -extern SDL_WindowShaper* Win32_CreateShaper(SDL_Window * window); -extern int Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); +extern SDL_WindowShaper *Win32_CreateShaper(SDL_Window *window); +extern int Win32_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode); extern int Win32_ResizeWindowShape(SDL_Window *window); #endif /* SDL_windowsshape_h_ */ diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 0dc107bdf240f..6c71bdcb60b40 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS #include "SDL_main.h" #include "SDL_video.h" @@ -29,11 +29,13 @@ #include "SDL_system.h" #include "../SDL_sysvideo.h" #include "../SDL_pixels_c.h" +#include "../../SDL_hints_c.h" #include "SDL_windowsvideo.h" #include "SDL_windowsframebuffer.h" #include "SDL_windowsshape.h" #include "SDL_windowsvulkan.h" +#include "SDL_windowsmessagebox.h" /* #define HIGHDPI_DEBUG */ @@ -43,26 +45,22 @@ static void WIN_VideoQuit(_THIS); /* Hints */ SDL_bool g_WindowsEnableMessageLoop = SDL_TRUE; +SDL_bool g_WindowsEnableMenuMnemonics = SDL_FALSE; SDL_bool g_WindowFrameUsableWhileCursorHidden = SDL_TRUE; -static void SDLCALL -UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue) +static void SDLCALL UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue) { - if (newValue && *newValue == '0') { - g_WindowsEnableMessageLoop = SDL_FALSE; - } else { - g_WindowsEnableMessageLoop = SDL_TRUE; - } + g_WindowsEnableMessageLoop = SDL_GetStringBoolean(newValue, SDL_TRUE); } -static void SDLCALL -UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue) +static void SDLCALL UpdateWindowsEnableMenuMnemonics(void *userdata, const char *name, const char *oldValue, const char *newValue) { - if (newValue && *newValue == '0') { - g_WindowFrameUsableWhileCursorHidden = SDL_FALSE; - } else { - g_WindowFrameUsableWhileCursorHidden = SDL_TRUE; - } + g_WindowsEnableMenuMnemonics = SDL_GetStringBoolean(newValue, SDL_FALSE); +} + +static void SDLCALL UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue) +{ + g_WindowFrameUsableWhileCursorHidden = SDL_GetStringBoolean(newValue, SDL_TRUE); } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) @@ -80,13 +78,11 @@ static void WIN_SuspendScreenSaver(_THIS) extern void D3D12_XBOX_GetResolution(Uint32 *width, Uint32 *height); #endif - /* Windows driver bootstrap functions */ -static void -WIN_DeleteDevice(SDL_VideoDevice * device) +static void WIN_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *data = (SDL_VideoData *) device->driverdata; + SDL_VideoData *data = (SDL_VideoData *)device->driverdata; SDL_UnregisterApp(); #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) @@ -97,15 +93,11 @@ WIN_DeleteDevice(SDL_VideoDevice * device) SDL_UnloadObject(data->shcoreDLL); } #endif - if (device->wakeup_lock) { - SDL_DestroyMutex(device->wakeup_lock); - } SDL_free(device->driverdata); SDL_free(device); } -static SDL_VideoDevice * -WIN_CreateDevice(void) +static SDL_VideoDevice *WIN_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *data; @@ -113,9 +105,9 @@ WIN_CreateDevice(void) SDL_RegisterApp(NULL, 0, NULL); /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (device) { - data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); + data = (struct SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); } else { data = NULL; } @@ -125,32 +117,38 @@ WIN_CreateDevice(void) return NULL; } device->driverdata = data; - device->wakeup_lock = SDL_CreateMutex(); #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) data->userDLL = SDL_LoadObject("USER32.DLL"); if (data->userDLL) { - data->CloseTouchInputHandle = (BOOL (WINAPI *)(HTOUCHINPUT)) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle"); + /* *INDENT-OFF* */ /* clang-format off */ + data->CloseTouchInputHandle = (BOOL (WINAPI *)(HTOUCHINPUT))SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle"); data->GetTouchInputInfo = (BOOL (WINAPI *)(HTOUCHINPUT, UINT, PTOUCHINPUT, int)) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo"); - data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG)) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); - data->SetProcessDPIAware = (BOOL (WINAPI *)(void)) SDL_LoadFunction(data->userDLL, "SetProcessDPIAware"); - data->SetProcessDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT)) SDL_LoadFunction(data->userDLL, "SetProcessDpiAwarenessContext"); - data->SetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(DPI_AWARENESS_CONTEXT)) SDL_LoadFunction(data->userDLL, "SetThreadDpiAwarenessContext"); - data->GetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(void)) SDL_LoadFunction(data->userDLL, "GetThreadDpiAwarenessContext"); - data->GetAwarenessFromDpiAwarenessContext = (DPI_AWARENESS (WINAPI *)(DPI_AWARENESS_CONTEXT)) SDL_LoadFunction(data->userDLL, "GetAwarenessFromDpiAwarenessContext"); - data->EnableNonClientDpiScaling = (BOOL (WINAPI *)(HWND)) SDL_LoadFunction(data->userDLL, "EnableNonClientDpiScaling"); - data->AdjustWindowRectExForDpi = (BOOL (WINAPI *)(LPRECT, DWORD, BOOL, DWORD, UINT)) SDL_LoadFunction(data->userDLL, "AdjustWindowRectExForDpi"); - data->GetDpiForWindow = (UINT (WINAPI *)(HWND)) SDL_LoadFunction(data->userDLL, "GetDpiForWindow"); - data->AreDpiAwarenessContextsEqual = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT)) SDL_LoadFunction(data->userDLL, "AreDpiAwarenessContextsEqual"); - data->IsValidDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT)) SDL_LoadFunction(data->userDLL, "IsValidDpiAwarenessContext"); + data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG))SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); + data->SetProcessDPIAware = (BOOL (WINAPI *)(void))SDL_LoadFunction(data->userDLL, "SetProcessDPIAware"); + data->SetProcessDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "SetProcessDpiAwarenessContext"); + data->SetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "SetThreadDpiAwarenessContext"); + data->GetThreadDpiAwarenessContext = (DPI_AWARENESS_CONTEXT (WINAPI *)(void))SDL_LoadFunction(data->userDLL, "GetThreadDpiAwarenessContext"); + data->GetAwarenessFromDpiAwarenessContext = (DPI_AWARENESS (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "GetAwarenessFromDpiAwarenessContext"); + data->EnableNonClientDpiScaling = (BOOL (WINAPI *)(HWND))SDL_LoadFunction(data->userDLL, "EnableNonClientDpiScaling"); + data->AdjustWindowRectExForDpi = (BOOL (WINAPI *)(LPRECT, DWORD, BOOL, DWORD, UINT))SDL_LoadFunction(data->userDLL, "AdjustWindowRectExForDpi"); + data->GetDpiForWindow = (UINT (WINAPI *)(HWND))SDL_LoadFunction(data->userDLL, "GetDpiForWindow"); + data->AreDpiAwarenessContextsEqual = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "AreDpiAwarenessContextsEqual"); + data->IsValidDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "IsValidDpiAwarenessContext"); + data->GetDisplayConfigBufferSizes = (LONG (WINAPI *)(UINT32,UINT32*,UINT32* ))SDL_LoadFunction(data->userDLL, "GetDisplayConfigBufferSizes"); + data->QueryDisplayConfig = (LONG (WINAPI *)(UINT32,UINT32*,DISPLAYCONFIG_PATH_INFO*,UINT32*,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*))SDL_LoadFunction(data->userDLL, "QueryDisplayConfig"); + data->DisplayConfigGetDeviceInfo = (LONG (WINAPI *)(DISPLAYCONFIG_DEVICE_INFO_HEADER*))SDL_LoadFunction(data->userDLL, "DisplayConfigGetDeviceInfo"); + /* *INDENT-ON* */ /* clang-format on */ } else { SDL_ClearError(); } data->shcoreDLL = SDL_LoadObject("SHCORE.DLL"); if (data->shcoreDLL) { - data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *)) SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor"); - data->SetProcessDpiAwareness = (HRESULT (WINAPI *)(PROCESS_DPI_AWARENESS)) SDL_LoadFunction(data->shcoreDLL, "SetProcessDpiAwareness"); + /* *INDENT-OFF* */ /* clang-format off */ + data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *))SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor"); + data->SetProcessDpiAwareness = (HRESULT (WINAPI *)(PROCESS_DPI_AWARENESS))SDL_LoadFunction(data->shcoreDLL, "SetProcessDpiAwareness"); + /* *INDENT-ON* */ /* clang-format on */ } else { SDL_ClearError(); } @@ -160,6 +158,7 @@ WIN_CreateDevice(void) device->VideoInit = WIN_VideoInit; device->VideoQuit = WIN_VideoQuit; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + device->RefreshDisplays = WIN_RefreshDisplays; device->GetDisplayBounds = WIN_GetDisplayBounds; device->GetDisplayUsableBounds = WIN_GetDisplayUsableBounds; device->GetDisplayDPI = WIN_GetDisplayDPI; @@ -216,7 +215,7 @@ WIN_CreateDevice(void) device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape; #endif -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL device->GL_LoadLibrary = WIN_GL_LoadLibrary; device->GL_GetProcAddress = WIN_GL_GetProcAddress; device->GL_UnloadLibrary = WIN_GL_UnloadLibrary; @@ -226,7 +225,7 @@ WIN_CreateDevice(void) device->GL_GetSwapInterval = WIN_GL_GetSwapInterval; device->GL_SwapWindow = WIN_GL_SwapWindow; device->GL_DeleteContext = WIN_GL_DeleteContext; -#elif SDL_VIDEO_OPENGL_EGL +#elif defined(SDL_VIDEO_OPENGL_EGL) /* Use EGL based functions */ device->GL_LoadLibrary = WIN_GLES_LoadLibrary; device->GL_GetProcAddress = WIN_GLES_GetProcAddress; @@ -238,7 +237,7 @@ WIN_CreateDevice(void) device->GL_SwapWindow = WIN_GLES_SwapWindow; device->GL_DeleteContext = WIN_GLES_DeleteContext; #endif -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = WIN_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = WIN_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = WIN_Vulkan_GetInstanceExtensions; @@ -262,16 +261,19 @@ WIN_CreateDevice(void) return device; } - VideoBootStrap WINDOWS_bootstrap = { - "windows", "SDL Windows video driver", WIN_CreateDevice + "windows", "SDL Windows video driver", WIN_CreateDevice, + #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + WIN_ShowMessageBox + #else + NULL + #endif }; -static BOOL -WIN_DeclareDPIAwareUnaware(_THIS) +static BOOL WIN_DeclareDPIAwareUnaware(_THIS) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - SDL_VideoData* data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (data->SetProcessDpiAwarenessContext) { return data->SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE); @@ -283,11 +285,10 @@ WIN_DeclareDPIAwareUnaware(_THIS) return FALSE; } -static BOOL -WIN_DeclareDPIAwareSystem(_THIS) +static BOOL WIN_DeclareDPIAwareSystem(_THIS) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - SDL_VideoData* data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (data->SetProcessDpiAwarenessContext) { /* Windows 10, version 1607 */ @@ -303,11 +304,10 @@ WIN_DeclareDPIAwareSystem(_THIS) return FALSE; } -static BOOL -WIN_DeclareDPIAwarePerMonitor(_THIS) +static BOOL WIN_DeclareDPIAwarePerMonitor(_THIS) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (data->SetProcessDpiAwarenessContext) { /* Windows 10, version 1607 */ @@ -323,13 +323,12 @@ WIN_DeclareDPIAwarePerMonitor(_THIS) return FALSE; } -static BOOL -WIN_DeclareDPIAwarePerMonitorV2(_THIS) +static BOOL WIN_DeclareDPIAwarePerMonitorV2(_THIS) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return FALSE; #else - SDL_VideoData* data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; /* Declare DPI aware (may have been done in external code or a manifest, as well) */ if (data->SetProcessDpiAwarenessContext) { @@ -339,7 +338,7 @@ WIN_DeclareDPIAwarePerMonitorV2(_THIS) end up still getting OS scaled. (tested on Windows 10 21H1 19043.1348, NVIDIA 496.49) NOTE: Enabling DPI awareness through Windows Explorer - (right click .exe -> Properties -> Compatibility -> High DPI Settings -> + (right click .exe -> Properties -> Compatibility -> High DPI Settings -> check "Override high DPI Scaling behaviour", select Application) gives a DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE context (at least on Windows 10 21H1), and setting DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 will fail. @@ -363,10 +362,9 @@ WIN_DeclareDPIAwarePerMonitorV2(_THIS) } #ifdef HIGHDPI_DEBUG -static const char* -WIN_GetDPIAwareness(_THIS) +static const char *WIN_GetDPIAwareness(_THIS) { - SDL_VideoData* data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (data->GetThreadDpiAwarenessContext && data->AreDpiAwarenessContextsEqual) { DPI_AWARENESS_CONTEXT context = data->GetThreadDpiAwarenessContext(); @@ -388,12 +386,11 @@ WIN_GetDPIAwareness(_THIS) } #endif -static void -WIN_InitDPIAwareness(_THIS) +static void WIN_InitDPIAwareness(_THIS) { - const char* hint = SDL_GetHint(SDL_HINT_WINDOWS_DPI_AWARENESS); + const char *hint = SDL_GetHint(SDL_HINT_WINDOWS_DPI_AWARENESS); - if (hint != NULL) { + if (hint) { if (SDL_strcmp(hint, "permonitorv2") == 0) { WIN_DeclareDPIAwarePerMonitorV2(_this); } else if (SDL_strcmp(hint, "permonitor") == 0) { @@ -406,10 +403,9 @@ WIN_InitDPIAwareness(_THIS) } } -static void -WIN_InitDPIScaling(_THIS) +static void WIN_InitDPIScaling(_THIS) { - SDL_VideoData* data = (SDL_VideoData*)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (SDL_GetHintBoolean(SDL_HINT_WINDOWS_DPI_SCALING, SDL_FALSE)) { WIN_DeclareDPIAwarePerMonitorV2(_this); @@ -418,10 +414,9 @@ WIN_InitDPIScaling(_THIS) } } -int -WIN_VideoInit(_THIS) +int WIN_VideoInit(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; WIN_InitDPIAwareness(_this); WIN_InitDPIScaling(_this); @@ -444,7 +439,7 @@ WIN_VideoInit(_THIS) SDL_zero(display); display.desktop_mode = current_mode; display.current_mode = current_mode; - + SDL_AddVideoDisplay(&display, SDL_FALSE); } #else /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ @@ -457,6 +452,7 @@ WIN_VideoInit(_THIS) #endif SDL_AddHintCallback(SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP, UpdateWindowsEnableMessageLoop, NULL); + SDL_AddHintCallback(SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS, UpdateWindowsEnableMenuMnemonics, NULL); SDL_AddHintCallback(SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN, UpdateWindowFrameUsableWhileCursorHidden, NULL); #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) @@ -466,8 +462,7 @@ WIN_VideoInit(_THIS) return 0; } -void -WIN_VideoQuit(_THIS) +void WIN_VideoQuit(_THIS) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) WIN_QuitModes(_this); @@ -476,7 +471,6 @@ WIN_VideoQuit(_THIS) #endif } - #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #define D3D_DEBUG_INFO #include @@ -497,25 +491,26 @@ WIN_VideoQuit(_THIS) #endif #endif -SDL_bool -D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) +SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) { *pD3DDLL = SDL_LoadObject("D3D9.DLL"); if (*pD3DDLL) { - typedef IDirect3D9 *(WINAPI *Direct3DCreate9_t) (UINT SDKVersion); + /* *INDENT-OFF* */ /* clang-format off */ + typedef IDirect3D9 *(WINAPI *Direct3DCreate9_t)(UINT SDKVersion); + typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex** ppD3D); + /* *INDENT-ON* */ /* clang-format on */ Direct3DCreate9_t Direct3DCreate9Func; if (SDL_GetHintBoolean(SDL_HINT_WINDOWS_USE_D3D9EX, SDL_FALSE)) { - typedef HRESULT(WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex** ppD3D); Direct3DCreate9Ex_t Direct3DCreate9ExFunc; Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex"); if (Direct3DCreate9ExFunc) { - IDirect3D9Ex* pDirect3D9ExInterface; + IDirect3D9Ex *pDirect3D9ExInterface; HRESULT hr = Direct3DCreate9ExFunc(D3D_SDK_VERSION, &pDirect3D9ExInterface); if (SUCCEEDED(hr)) { const GUID IDirect3D9_GUID = { 0x81bdcbca, 0x64d4, 0x426d, { 0xae, 0x8d, 0xad, 0x1, 0x47, 0xf4, 0x27, 0x5c } }; - hr = IDirect3D9Ex_QueryInterface(pDirect3D9ExInterface, &IDirect3D9_GUID, (void**)pDirect3D9Interface); + hr = IDirect3D9Ex_QueryInterface(pDirect3D9ExInterface, &IDirect3D9_GUID, (void **)pDirect3D9Interface); IDirect3D9Ex_Release(pDirect3D9ExInterface); if (SUCCEEDED(hr)) { return SDL_TRUE; @@ -539,9 +534,7 @@ D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) return SDL_FALSE; } - -int -SDL_Direct3D9GetAdapterIndex(int displayIndex) +int SDL_Direct3D9GetAdapterIndex(int displayIndex) { void *pD3DDLL; IDirect3D9 *pD3D; @@ -559,7 +552,7 @@ SDL_Direct3D9GetAdapterIndex(int displayIndex) char *displayName = WIN_StringToUTF8W(pData->DeviceName); unsigned int count = IDirect3D9_GetAdapterCount(pD3D); unsigned int i; - for (i=0; i -static SDL_bool -DXGI_LoadDLL(void **pDXGIDLL, IDXGIFactory **pDXGIFactory) +static SDL_bool DXGI_LoadDLL(void **pDXGIDLL, IDXGIFactory **pDXGIFactory) { *pDXGIDLL = SDL_LoadObject("DXGI.DLL"); if (*pDXGIDLL) { - HRESULT (WINAPI *CreateDXGI)(REFIID riid, void **ppFactory); + /* *INDENT-OFF* */ /* clang-format off */ + typedef HRESULT (WINAPI *CreateDXGI_t)(REFIID riid, void **ppFactory); + /* *INDENT-ON* */ /* clang-format on */ + CreateDXGI_t CreateDXGI; - CreateDXGI = - (HRESULT (WINAPI *) (REFIID, void**)) SDL_LoadFunction(*pDXGIDLL, - "CreateDXGIFactory"); + CreateDXGI = (CreateDXGI_t)SDL_LoadFunction(*pDXGIDLL, "CreateDXGIFactory"); if (CreateDXGI) { - GUID dxgiGUID = {0x7b7166ec,0x21c7,0x44ae,{0xb2,0x1a,0xc9,0xae,0x32,0x1a,0xe3,0x69}}; - if (!SUCCEEDED(CreateDXGI(&dxgiGUID, (void**)pDXGIFactory))) { + GUID dxgiGUID = { 0x7b7166ec, 0x21c7, 0x44ae, { 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69 } }; + if (!SUCCEEDED(CreateDXGI(&dxgiGUID, (void **)pDXGIFactory))) { *pDXGIFactory = NULL; } } @@ -615,13 +608,15 @@ DXGI_LoadDLL(void **pDXGIDLL, IDXGIFactory **pDXGIFactory) } #endif - -SDL_bool -SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) +SDL_bool SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) { #if !HAVE_DXGI_H - if (adapterIndex) *adapterIndex = -1; - if (outputIndex) *outputIndex = -1; + if (adapterIndex) { + *adapterIndex = -1; + } + if (outputIndex) { + *outputIndex = -1; + } SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header"); return SDL_FALSE; #else @@ -631,7 +626,7 @@ SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) int nAdapter, nOutput; IDXGIFactory *pDXGIFactory = NULL; IDXGIAdapter *pDXGIAdapter; - IDXGIOutput* pDXGIOutput; + IDXGIOutput *pDXGIOutput; if (!adapterIndex) { SDL_InvalidParamError("adapterIndex"); @@ -690,12 +685,11 @@ SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) #endif } -SDL_bool -WIN_IsPerMonitorV2DPIAware(_THIS) +SDL_bool WIN_IsPerMonitorV2DPIAware(_THIS) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - SDL_VideoData* data = (SDL_VideoData*) _this->driverdata; - + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + if (data->AreDpiAwarenessContextsEqual && data->GetThreadDpiAwarenessContext) { /* Windows 10, version 1607 */ return (SDL_bool)data->AreDpiAwarenessContextsEqual(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2, diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index cdebb4cfa918f..1818e79355a45 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,18 +35,18 @@ #include -#define MAX_CANDLIST 10 -#define MAX_CANDLENGTH 256 -#define MAX_CANDSIZE (sizeof(WCHAR) * MAX_CANDLIST * MAX_CANDLENGTH) +#define MAX_CANDLIST 10 +#define MAX_CANDLENGTH 256 +#define MAX_CANDSIZE (sizeof(WCHAR) * MAX_CANDLIST * MAX_CANDLENGTH) #include "SDL_windowsclipboard.h" #include "SDL_windowsevents.h" +#include "SDL_windowsopengl.h" #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) #include "SDL_windowskeyboard.h" #include "SDL_windowsmodes.h" #include "SDL_windowsmouse.h" -#include "SDL_windowsopengl.h" #include "SDL_windowsopengles.h" #endif @@ -54,11 +54,10 @@ #include "SDL_events.h" #include "SDL_loadso.h" - #if WINVER < 0x0601 /* Touch input definitions */ -#define TWF_FINETOUCH 1 -#define TWF_WANTPALM 2 +#define TWF_FINETOUCH 1 +#define TWF_WANTPALM 2 #define TOUCHEVENTF_MOVE 0x0001 #define TOUCHEVENTF_DOWN 0x0002 @@ -66,78 +65,78 @@ DECLARE_HANDLE(HTOUCHINPUT); -typedef struct _TOUCHINPUT { - LONG x; - LONG y; - HANDLE hSource; - DWORD dwID; - DWORD dwFlags; - DWORD dwMask; - DWORD dwTime; +typedef struct _TOUCHINPUT +{ + LONG x; + LONG y; + HANDLE hSource; + DWORD dwID; + DWORD dwFlags; + DWORD dwMask; + DWORD dwTime; ULONG_PTR dwExtraInfo; - DWORD cxContact; - DWORD cyContact; + DWORD cxContact; + DWORD cyContact; } TOUCHINPUT, *PTOUCHINPUT; - /* More-robust display information in Vista... */ /* This is a huge amount of data to be stuffing into three API calls. :( */ typedef struct DISPLAYCONFIG_PATH_SOURCE_INFO { - LUID adapterId; - UINT32 id; + LUID adapterId; + UINT32 id; union { UINT32 modeInfoIdx; struct { - UINT32 cloneGroupId : 16; - UINT32 sourceModeInfoIdx : 16; + UINT32 cloneGroupId : 16; + UINT32 sourceModeInfoIdx : 16; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; - UINT32 statusFlags; + UINT32 statusFlags; } DISPLAYCONFIG_PATH_SOURCE_INFO; typedef struct DISPLAYCONFIG_RATIONAL { - UINT32 Numerator; - UINT32 Denominator; + UINT32 Numerator; + UINT32 Denominator; } DISPLAYCONFIG_RATIONAL; typedef struct DISPLAYCONFIG_PATH_TARGET_INFO { - LUID adapterId; - UINT32 id; + LUID adapterId; + UINT32 id; union { - UINT32 modeInfoIdx; + UINT32 modeInfoIdx; struct { UINT32 desktopModeInfoIdx : 16; - UINT32 targetModeInfoIdx : 16; + UINT32 targetModeInfoIdx : 16; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; - UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; - UINT32 /*DISPLAYCONFIG_ROTATION*/ rotation; - UINT32 /*DISPLAYCONFIG_SCALING*/ scaling; - DISPLAYCONFIG_RATIONAL refreshRate; - UINT32 /*DISPLAYCONFIG_SCANLINE_ORDERING*/ scanLineOrdering; - BOOL targetAvailable; - UINT32 statusFlags; + UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; + UINT32 /*DISPLAYCONFIG_ROTATION*/ rotation; + UINT32 /*DISPLAYCONFIG_SCALING*/ scaling; + DISPLAYCONFIG_RATIONAL refreshRate; + UINT32 /*DISPLAYCONFIG_SCANLINE_ORDERING*/ scanLineOrdering; + BOOL targetAvailable; + UINT32 statusFlags; } DISPLAYCONFIG_PATH_TARGET_INFO; typedef struct DISPLAYCONFIG_PATH_INFO { - DISPLAYCONFIG_PATH_SOURCE_INFO sourceInfo; - DISPLAYCONFIG_PATH_TARGET_INFO targetInfo; - UINT32 flags; + DISPLAYCONFIG_PATH_SOURCE_INFO sourceInfo; + DISPLAYCONFIG_PATH_TARGET_INFO targetInfo; + UINT32 flags; } DISPLAYCONFIG_PATH_INFO; typedef enum { - DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE = 1, - DISPLAYCONFIG_MODE_INFO_TYPE_TARGET = 2, + DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE = 1, + DISPLAYCONFIG_MODE_INFO_TYPE_TARGET = 2, DISPLAYCONFIG_MODE_INFO_TYPE_DESKTOP_IMAGE = 3, DISPLAYCONFIG_MODE_INFO_TYPE_FORCE_UINT32 = 0xFFFFFFFF } DISPLAYCONFIG_MODE_INFO_TYPE; @@ -150,11 +149,11 @@ typedef struct DISPLAYCONFIG_2DREGION typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO { - UINT64 pixelRate; - DISPLAYCONFIG_RATIONAL hSyncFreq; - DISPLAYCONFIG_RATIONAL vSyncFreq; - DISPLAYCONFIG_2DREGION activeSize; - DISPLAYCONFIG_2DREGION totalSize; + UINT64 pixelRate; + DISPLAYCONFIG_RATIONAL hSyncFreq; + DISPLAYCONFIG_RATIONAL vSyncFreq; + DISPLAYCONFIG_2DREGION activeSize; + DISPLAYCONFIG_2DREGION totalSize; union { @@ -177,15 +176,15 @@ typedef struct DISPLAYCONFIG_VIDEO_SIGNAL_INFO typedef struct DISPLAYCONFIG_SOURCE_MODE { - UINT32 width; - UINT32 height; - UINT32 /*DISPLAYCONFIG_PIXELFORMAT*/ pixelFormat; - POINTL position; + UINT32 width; + UINT32 height; + UINT32 /*DISPLAYCONFIG_PIXELFORMAT*/ pixelFormat; + POINTL position; } DISPLAYCONFIG_SOURCE_MODE; typedef struct DISPLAYCONFIG_TARGET_MODE { - DISPLAYCONFIG_VIDEO_SIGNAL_INFO targetVideoSignalInfo; + DISPLAYCONFIG_VIDEO_SIGNAL_INFO targetVideoSignalInfo; } DISPLAYCONFIG_TARGET_MODE; typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO @@ -197,54 +196,54 @@ typedef struct DISPLAYCONFIG_DESKTOP_IMAGE_INFO typedef struct DISPLAYCONFIG_MODE_INFO { - DISPLAYCONFIG_MODE_INFO_TYPE infoType; - UINT32 id; - LUID adapterId; + DISPLAYCONFIG_MODE_INFO_TYPE infoType; + UINT32 id; + LUID adapterId; union { - DISPLAYCONFIG_TARGET_MODE targetMode; - DISPLAYCONFIG_SOURCE_MODE sourceMode; - DISPLAYCONFIG_DESKTOP_IMAGE_INFO desktopImageInfo; + DISPLAYCONFIG_TARGET_MODE targetMode; + DISPLAYCONFIG_SOURCE_MODE sourceMode; + DISPLAYCONFIG_DESKTOP_IMAGE_INFO desktopImageInfo; } DUMMYUNIONNAME; } DISPLAYCONFIG_MODE_INFO; typedef enum DISPLAYCONFIG_TOPOLOGY_ID { - DISPLAYCONFIG_TOPOLOGY_INTERNAL = 0x00000001, - DISPLAYCONFIG_TOPOLOGY_CLONE = 0x00000002, - DISPLAYCONFIG_TOPOLOGY_EXTEND = 0x00000004, - DISPLAYCONFIG_TOPOLOGY_EXTERNAL = 0x00000008, - DISPLAYCONFIG_TOPOLOGY_FORCE_UINT32 = 0xFFFFFFFF + DISPLAYCONFIG_TOPOLOGY_INTERNAL = 0x00000001, + DISPLAYCONFIG_TOPOLOGY_CLONE = 0x00000002, + DISPLAYCONFIG_TOPOLOGY_EXTEND = 0x00000004, + DISPLAYCONFIG_TOPOLOGY_EXTERNAL = 0x00000008, + DISPLAYCONFIG_TOPOLOGY_FORCE_UINT32 = 0xFFFFFFFF } DISPLAYCONFIG_TOPOLOGY_ID; typedef enum { - DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME = 1, - DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME = 2, - DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE = 3, - DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME = 4, - DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE = 5, - DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE = 6, - DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION = 7, - DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION = 8, - DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO = 9, - DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE = 10, - DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL = 11, - DISPLAYCONFIG_DEVICE_INFO_FORCE_UINT32 = 0xFFFFFFFF + DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME = 1, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME = 2, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE = 3, + DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME = 4, + DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE = 5, + DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE = 6, + DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION = 7, + DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION = 8, + DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO = 9, + DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE = 10, + DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL = 11, + DISPLAYCONFIG_DEVICE_INFO_FORCE_UINT32 = 0xFFFFFFFF } DISPLAYCONFIG_DEVICE_INFO_TYPE; typedef struct DISPLAYCONFIG_DEVICE_INFO_HEADER { - DISPLAYCONFIG_DEVICE_INFO_TYPE type; - UINT32 size; - LUID adapterId; - UINT32 id; + DISPLAYCONFIG_DEVICE_INFO_TYPE type; + UINT32 size; + LUID adapterId; + UINT32 id; } DISPLAYCONFIG_DEVICE_INFO_HEADER; typedef struct DISPLAYCONFIG_SOURCE_DEVICE_NAME { - DISPLAYCONFIG_DEVICE_INFO_HEADER header; - WCHAR viewGdiDeviceName[CCHDEVICENAME]; + DISPLAYCONFIG_DEVICE_INFO_HEADER header; + WCHAR viewGdiDeviceName[CCHDEVICENAME]; } DISPLAYCONFIG_SOURCE_DEVICE_NAME; typedef struct DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS @@ -253,41 +252,43 @@ typedef struct DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS { struct { - UINT32 friendlyNameFromEdid : 1; - UINT32 friendlyNameForced : 1; - UINT32 edidIdsValid : 1; - UINT32 reserved : 29; + UINT32 friendlyNameFromEdid : 1; + UINT32 friendlyNameForced : 1; + UINT32 edidIdsValid : 1; + UINT32 reserved : 29; } DUMMYSTRUCTNAME; - UINT32 value; + UINT32 value; } DUMMYUNIONNAME; } DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS; typedef struct DISPLAYCONFIG_TARGET_DEVICE_NAME { - DISPLAYCONFIG_DEVICE_INFO_HEADER header; - DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS flags; - UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; - UINT16 edidManufactureId; - UINT16 edidProductCodeId; - UINT32 connectorInstance; - WCHAR monitorFriendlyDeviceName[64]; - WCHAR monitorDevicePath[128]; + DISPLAYCONFIG_DEVICE_INFO_HEADER header; + DISPLAYCONFIG_TARGET_DEVICE_NAME_FLAGS flags; + UINT32 /*DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY*/ outputTechnology; + UINT16 edidManufactureId; + UINT16 edidProductCodeId; + UINT32 connectorInstance; + WCHAR monitorFriendlyDeviceName[64]; + WCHAR monitorDevicePath[128]; } DISPLAYCONFIG_TARGET_DEVICE_NAME; -#define QDC_ONLY_ACTIVE_PATHS 0x00000002 +#define QDC_ONLY_ACTIVE_PATHS 0x00000002 #endif /* WINVER < 0x0601 */ #ifndef HAVE_SHELLSCALINGAPI_H -typedef enum MONITOR_DPI_TYPE { +typedef enum MONITOR_DPI_TYPE +{ MDT_EFFECTIVE_DPI = 0, MDT_ANGULAR_DPI = 1, MDT_RAW_DPI = 2, MDT_DEFAULT = MDT_EFFECTIVE_DPI } MONITOR_DPI_TYPE; -typedef enum PROCESS_DPI_AWARENESS { +typedef enum PROCESS_DPI_AWARENESS +{ PROCESS_DPI_UNAWARE = 0, PROCESS_SYSTEM_DPI_AWARE = 1, PROCESS_PER_MONITOR_DPI_AWARE = 2 @@ -299,7 +300,8 @@ typedef enum PROCESS_DPI_AWARENESS { #ifndef _DPI_AWARENESS_CONTEXTS_ -typedef enum DPI_AWARENESS { +typedef enum DPI_AWARENESS +{ DPI_AWARENESS_INVALID = -1, DPI_AWARENESS_UNAWARE = 0, DPI_AWARENESS_SYSTEM_AWARE = 1, @@ -324,8 +326,8 @@ DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); #define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5) #endif /* NTDDI_VERSION < 0x0A000006 */ -typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); -typedef void (*PFCoordTransform)(SDL_Window*, POINT*); +typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); +typedef void (*PFCoordTransform)(SDL_Window *, POINT *); typedef struct { @@ -336,14 +338,16 @@ typedef struct #ifndef SDL_DISABLE_WINDOWS_IME /* Definition from Win98DDK version of IMM.H */ -typedef struct tagINPUTCONTEXT2 { +typedef struct tagINPUTCONTEXT2 +{ HWND hWnd; BOOL fOpen; POINT ptStatusWndPos; POINT ptSoftKbdPos; DWORD fdwConversion; DWORD fdwSentence; - union { + union + { LOGFONTA A; LOGFONTW W; } lfFont; @@ -370,7 +374,8 @@ typedef struct SDL_VideoData #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* Xbox doesn't support user32/shcore*/ /* Touch input functions */ - void* userDLL; + void *userDLL; + /* *INDENT-OFF* */ /* clang-format off */ BOOL (WINAPI *CloseTouchInputHandle)( HTOUCHINPUT ); BOOL (WINAPI *GetTouchInputInfo)( HTOUCHINPUT, UINT, PTOUCHINPUT, int ); BOOL (WINAPI *RegisterTouchWindow)( HWND, ULONG ); @@ -384,19 +389,26 @@ typedef struct SDL_VideoData UINT (WINAPI *GetDpiForWindow)( HWND ); BOOL (WINAPI *AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT); BOOL (WINAPI *IsValidDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); - - void* shcoreDLL; + /* DisplayConfig functions */ + LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32*, UINT32* ); + LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32*, DISPLAYCONFIG_PATH_INFO*, UINT32*, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*); + LONG (WINAPI *DisplayConfigGetDeviceInfo)( DISPLAYCONFIG_DEVICE_INFO_HEADER*); + /* *INDENT-ON* */ /* clang-format on */ + + void *shcoreDLL; + /* *INDENT-OFF* */ /* clang-format off */ HRESULT (WINAPI *GetDpiForMonitor)( HMONITOR hmonitor, MONITOR_DPI_TYPE dpiType, UINT *dpiX, UINT *dpiY ); HRESULT (WINAPI *SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS dpiAwareness); -#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ + /* *INDENT-ON* */ /* clang-format on */ +#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ SDL_bool dpi_scaling_enabled; SDL_bool cleared; - #ifndef SDL_DISABLE_WINDOWS_IME +#ifndef SDL_DISABLE_WINDOWS_IME SDL_bool ime_com_initialized; struct ITfThreadMgr *ime_threadmgr; SDL_bool ime_initialized; @@ -407,13 +419,13 @@ typedef struct SDL_VideoData SDL_bool ime_suppress_endcomposition_event; HIMC ime_himc; - WCHAR* ime_composition; + WCHAR *ime_composition; int ime_composition_length; WCHAR ime_readingstring[16]; int ime_cursor; SDL_bool ime_candlist; - WCHAR* ime_candidates; + WCHAR *ime_candidates; DWORD ime_candcount; DWORD ime_candref; DWORD ime_candsel; @@ -428,13 +440,15 @@ typedef struct SDL_VideoData int ime_winheight; HKL ime_hkl; - void* ime_himm32; + void *ime_himm32; + /* *INDENT-OFF* */ /* clang-format off */ UINT (WINAPI *GetReadingString)(HIMC himc, UINT uReadingBufLen, LPWSTR lpwReadingBuf, PINT pnErrorIndex, BOOL *pfIsVertical, PUINT puMaxReadingLen); BOOL (WINAPI *ShowReadingWindow)(HIMC himc, BOOL bShow); LPINPUTCONTEXT2 (WINAPI *ImmLockIMC)(HIMC himc); BOOL (WINAPI *ImmUnlockIMC)(HIMC himc); LPVOID (WINAPI *ImmLockIMCC)(HIMCC himcc); BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc); + /* *INDENT-ON* */ /* clang-format on */ SDL_bool ime_uiless; struct ITfThreadMgrEx *ime_threadmgrex; @@ -452,10 +466,11 @@ typedef struct SDL_VideoData } SDL_VideoData; extern SDL_bool g_WindowsEnableMessageLoop; +extern SDL_bool g_WindowsEnableMenuMnemonics; extern SDL_bool g_WindowFrameUsableWhileCursorHidden; typedef struct IDirect3D9 IDirect3D9; -extern SDL_bool D3D_LoadDLL( void **pD3DDLL, IDirect3D9 **pDirect3D9Interface ); +extern SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface); extern SDL_bool WIN_IsPerMonitorV2DPIAware(_THIS); diff --git a/src/video/windows/SDL_windowsvulkan.c b/src/video/windows/SDL_windowsvulkan.c index 2a66f43985c7c..9e985ca78d373 100644 --- a/src/video/windows/SDL_windowsvulkan.c +++ b/src/video/windows/SDL_windowsvulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,7 +26,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WINDOWS +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WINDOWS) #include "SDL_windowsvideo.h" #include "SDL_windowswindow.h" @@ -43,53 +43,55 @@ int WIN_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasSurfaceExtension = SDL_FALSE; SDL_bool hasWin32SurfaceExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan loader library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) + } + if (!path) { path = "vulkan-1.dll"; + } _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_WIN32_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasWin32SurfaceExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else if(!hasWin32SurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_WIN32_SURFACE_EXTENSION_NAME "extension"); + } else if (!hasWin32SurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_WIN32_SURFACE_EXTENSION_NAME "extension"); goto fail; } return 0; @@ -102,8 +104,7 @@ int WIN_Vulkan_LoadLibrary(_THIS, const char *path) void WIN_Vulkan_UnloadLibrary(_THIS) { - if(_this->vulkan_config.loader_handle) - { + if (_this->vulkan_config.loader_handle) { SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } @@ -117,14 +118,13 @@ SDL_bool WIN_Vulkan_GetInstanceExtensions(_THIS, static const char *const extensionsForWin32[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_EXTENSION_NAME }; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } return SDL_Vulkan_GetInstanceExtensions_Helper( - count, names, SDL_arraysize(extensionsForWin32), - extensionsForWin32); + count, names, SDL_arraysize(extensionsForWin32), + extensionsForWin32); } SDL_bool WIN_Vulkan_CreateSurface(_THIS, @@ -137,19 +137,17 @@ SDL_bool WIN_Vulkan_CreateSurface(_THIS, (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = (PFN_vkCreateWin32SurfaceKHR)vkGetInstanceProcAddr( - (VkInstance)instance, - "vkCreateWin32SurfaceKHR"); + instance, + "vkCreateWin32SurfaceKHR"); VkWin32SurfaceCreateInfoKHR createInfo; VkResult result; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } - if(!vkCreateWin32SurfaceKHR) - { + if (!vkCreateWin32SurfaceKHR) { SDL_SetError(VK_KHR_WIN32_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); return SDL_FALSE; @@ -160,9 +158,8 @@ SDL_bool WIN_Vulkan_CreateSurface(_THIS, createInfo.hinstance = windowData->hinstance; createInfo.hwnd = windowData->hwnd; result = vkCreateWin32SurfaceKHR(instance, &createInfo, - NULL, surface); - if(result != VK_SUCCESS) - { + NULL, surface); + if (result != VK_SUCCESS) { SDL_SetError("vkCreateWin32SurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); return SDL_FALSE; diff --git a/src/video/windows/SDL_windowsvulkan.h b/src/video/windows/SDL_windowsvulkan.h index eda37d362b3ba..1e0e41b820cf8 100644 --- a/src/video/windows/SDL_windowsvulkan.h +++ b/src/video/windows/SDL_windowsvulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ #include "../SDL_vulkan_internal.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_WINDOWS +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_WINDOWS) int WIN_Vulkan_LoadLibrary(_THIS, const char *path); void WIN_Vulkan_UnloadLibrary(_THIS); diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index d260f15c6001a..93470f34d8a63 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINDOWS +#ifdef SDL_VIDEO_DRIVER_WINDOWS #include "../../core/windows/SDL_windows.h" @@ -65,16 +65,15 @@ static ATOM SDL_HelperWindowClass = 0; This will also cause the task bar to overlap the window and other windowed behaviors, so only use this for windows that shouldn't appear to be fullscreen */ -#define STYLE_BASIC (WS_CLIPSIBLINGS | WS_CLIPCHILDREN) -#define STYLE_FULLSCREEN (WS_POPUP | WS_MINIMIZEBOX) -#define STYLE_BORDERLESS (WS_POPUP | WS_MINIMIZEBOX) +#define STYLE_BASIC (WS_CLIPSIBLINGS | WS_CLIPCHILDREN) +#define STYLE_FULLSCREEN (WS_POPUP | WS_MINIMIZEBOX) +#define STYLE_BORDERLESS (WS_POPUP | WS_MINIMIZEBOX) #define STYLE_BORDERLESS_WINDOWED (WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX) -#define STYLE_NORMAL (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX) -#define STYLE_RESIZABLE (WS_THICKFRAME | WS_MAXIMIZEBOX) -#define STYLE_MASK (STYLE_FULLSCREEN | STYLE_BORDERLESS | STYLE_NORMAL | STYLE_RESIZABLE) +#define STYLE_NORMAL (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX) +#define STYLE_RESIZABLE (WS_THICKFRAME | WS_MAXIMIZEBOX) +#define STYLE_MASK (STYLE_FULLSCREEN | STYLE_BORDERLESS | STYLE_NORMAL | STYLE_RESIZABLE) -static DWORD -GetWindowStyle(SDL_Window * window) +static DWORD GetWindowStyle(SDL_Window *window) { DWORD style = 0; @@ -122,10 +121,9 @@ GetWindowStyle(SDL_Window * window) * Returns arguments to pass to SetWindowPos - the window rect, including frame, in Windows coordinates. * Can be called before we have a HWND. */ -static void -WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x, int *y, int *width, int *height, SDL_bool use_current) +static void WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x, int *y, int *width, int *height, SDL_bool use_current) { - SDL_VideoData* videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->driverdata : NULL; + SDL_VideoData *videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->driverdata : NULL; RECT rect; int dpi = 96; #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) @@ -168,7 +166,7 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x AdjustWindowRectEx(&rect, style, menu, 0); #else if (WIN_IsPerMonitorV2DPIAware(SDL_GetVideoDevice())) { - /* With per-monitor v2, the window border/titlebar size depend on the DPI, so we need to call AdjustWindowRectExForDpi instead of + /* With per-monitor v2, the window border/titlebar size depend on the DPI, so we need to call AdjustWindowRectExForDpi instead of AdjustWindowRectEx. */ UINT unused; RECT screen_rect; @@ -176,20 +174,22 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x screen_rect.left = *x; screen_rect.top = *y; - screen_rect.right = *x + *width; - screen_rect.bottom = *y + *height; + screen_rect.right = (LONG)*x + *width; + screen_rect.bottom = (LONG)*y + *height; mon = MonitorFromRect(&screen_rect, MONITOR_DEFAULTTONEAREST); - /* GetDpiForMonitor docs promise to return the same hdpi / vdpi */ - if (videodata->GetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &frame_dpi, &unused) != S_OK) { - frame_dpi = 96; - } + if (videodata) { + /* GetDpiForMonitor docs promise to return the same hdpi / vdpi */ + if (videodata->GetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &frame_dpi, &unused) != S_OK) { + frame_dpi = 96; + } - videodata->AdjustWindowRectExForDpi(&rect, style, menu, 0, frame_dpi); + videodata->AdjustWindowRectExForDpi(&rect, style, menu, 0, frame_dpi); + } } else { AdjustWindowRectEx(&rect, style, menu, 0); - } + } #endif } @@ -200,17 +200,16 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x *height = (rect.bottom - rect.top); #ifdef HIGHDPI_DEBUG - SDL_Log("WIN_AdjustWindowRectWithStyle: in: %d, %d, %dx%d, returning: %d, %d, %dx%d, used dpi %d for frame calculation", - (use_current ? window->x : window->windowed.x), - (use_current ? window->y : window->windowed.y), - (use_current ? window->w : window->windowed.w), - (use_current ? window->h : window->windowed.h), - *x, *y, *width, *height, frame_dpi); + SDL_Log("WIN_AdjustWindowRectWithStyle: in: %d, %d, %dx%d, returning: %d, %d, %dx%d, used dpi %d for frame calculation", + (use_current ? window->x : window->windowed.x), + (use_current ? window->y : window->windowed.y), + (use_current ? window->w : window->windowed.w), + (use_current ? window->h : window->windowed.h), + *x, *y, *width, *height, frame_dpi); #endif } -static void -WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height, SDL_bool use_current) +static void WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height, SDL_bool use_current) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -226,8 +225,7 @@ WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height WIN_AdjustWindowRectWithStyle(window, style, menu, x, y, width, height, use_current); } -static void -WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags) +static void WIN_SetWindowPositionInternal(_THIS, SDL_Window *window, UINT flags) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -249,15 +247,13 @@ WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags) data->expected_resize = SDL_FALSE; } -static void SDLCALL -WIN_MouseRelativeModeCenterChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +static void SDLCALL WIN_MouseRelativeModeCenterChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_WindowData *data = (SDL_WindowData *)userdata; data->mouse_relative_mode_center = SDL_GetStringBoolean(hint, SDL_TRUE); } -static int -WIN_GetScalingDPIForHWND(const SDL_VideoData *videodata, HWND hwnd) +static int WIN_GetScalingDPIForHWND(const SDL_VideoData *videodata, HWND hwnd) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return 96; @@ -297,24 +293,25 @@ WIN_GetScalingDPIForHWND(const SDL_VideoData *videodata, HWND hwnd) #endif } -static int -SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool created) +static int SetupWindowData(_THIS, SDL_Window *window, HWND hwnd, HWND parent, SDL_bool created) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_WindowData *data; /* Allocate the window data */ - data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data)); + data = (SDL_WindowData *)SDL_calloc(1, sizeof(*data)); if (!data) { return SDL_OutOfMemory(); } data->window = window; data->hwnd = hwnd; data->parent = parent; -#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if defined(__XBOXONE__) || defined(__XBOXSERIES__) + data->hdc = (HDC) data->hwnd; +#else data->hdc = GetDC(hwnd); #endif - data->hinstance = (HINSTANCE) GetWindowLongPtr(hwnd, GWLP_HINSTANCE); + data->hinstance = (HINSTANCE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE); data->created = created; data->high_surrogate = 0; data->mouse_button_flags = (WPARAM)-1; @@ -331,7 +328,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre window->driverdata = data; -#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* Associate the data with the window */ if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) { ReleaseDC(hwnd, data->hdc); @@ -342,18 +339,18 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre /* Set up the window proc function */ #ifdef GWLP_WNDPROC - data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC); + data->wndproc = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_WNDPROC); if (data->wndproc == WIN_WindowProc) { data->wndproc = NULL; } else { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)WIN_WindowProc); } #else - data->wndproc = (WNDPROC) GetWindowLong(hwnd, GWL_WNDPROC); + data->wndproc = (WNDPROC)GetWindowLong(hwnd, GWL_WNDPROC); if (data->wndproc == WIN_WindowProc) { data->wndproc = NULL; } else { - SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) WIN_WindowProc); + SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR)WIN_WindowProc); } #endif @@ -379,7 +376,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre } } } -#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) +#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) { POINT point; point.x = 0; @@ -441,7 +438,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* Enable multi-touch */ if (videodata->RegisterTouchWindow) { - videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH|TWF_WANTPALM)); + videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH | TWF_WANTPALM)); } #endif @@ -456,9 +453,9 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, HWND parent, SDL_bool cre return 0; } -static void CleanupWindowData(_THIS, SDL_Window * window) +static void CleanupWindowData(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (data) { SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, WIN_MouseRelativeModeCenterChanged, data); @@ -480,13 +477,13 @@ static void CleanupWindowData(_THIS, SDL_Window * window) } } else { /* Restore any original event handler... */ - if (data->wndproc != NULL) { + if (data->wndproc) { #ifdef GWLP_WNDPROC SetWindowLongPtr(data->hwnd, GWLP_WNDPROC, - (LONG_PTR) data->wndproc); + (LONG_PTR)data->wndproc); #else SetWindowLong(data->hwnd, GWL_WNDPROC, - (LONG_PTR) data->wndproc); + (LONG_PTR)data->wndproc); #endif } } @@ -495,8 +492,7 @@ static void CleanupWindowData(_THIS, SDL_Window * window) window->driverdata = NULL; } -int -WIN_CreateWindow(_THIS, SDL_Window * window) +int WIN_CreateWindow(_THIS, SDL_Window *window) { HWND hwnd, parent = NULL; DWORD style = STYLE_BASIC; @@ -541,13 +537,13 @@ WIN_CreateWindow(_THIS, SDL_Window * window) } /* The rest of this macro mess is for OpenGL or OpenGL ES windows */ -#if SDL_VIDEO_OPENGL_ES2 +#ifdef SDL_VIDEO_OPENGL_ES2 if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL && (!_this->gl_data || WIN_GL_UseEGL(_this)) #endif /* SDL_VIDEO_OPENGL_WGL */ ) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (WIN_GLES_SetupWindow(_this, window) < 0) { WIN_DestroyWindow(_this, window); return -1; @@ -559,7 +555,7 @@ WIN_CreateWindow(_THIS, SDL_Window * window) } #endif /* SDL_VIDEO_OPENGL_ES2 */ -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL if (WIN_GL_SetupWindow(_this, window) < 0) { WIN_DestroyWindow(_this, window); return -1; @@ -571,13 +567,12 @@ WIN_CreateWindow(_THIS, SDL_Window * window) return 0; } -int -WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int WIN_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return -1; #else - HWND hwnd = (HWND) data; + HWND hwnd = (HWND)data; LPTSTR title; int titleLen; SDL_bool isstack; @@ -601,7 +596,7 @@ WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) return -1; } -#if SDL_VIDEO_OPENGL_WGL +#ifdef SDL_VIDEO_OPENGL_WGL { const char *hint = SDL_GetHint(SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT); if (hint) { @@ -609,10 +604,10 @@ WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) the window to share a pixel format with */ SDL_Window *otherWindow = NULL; - SDL_sscanf(hint, "%p", (void**)&otherWindow); + (void)SDL_sscanf(hint, "%p", (void **)&otherWindow); /* Do some error checking on the pointer */ - if (otherWindow != NULL && otherWindow->magic == &_this->window_magic) { + if (otherWindow && otherWindow->magic == &_this->window_magic) { /* If the otherWindow has SDL_WINDOW_OPENGL set, set it for the new window as well */ if (otherWindow->flags & SDL_WINDOW_OPENGL) { window->flags |= SDL_WINDOW_OPENGL; @@ -631,22 +626,20 @@ WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void -WIN_SetWindowTitle(_THIS, SDL_Window * window) +void WIN_SetWindowTitle(_THIS, SDL_Window *window) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; LPTSTR title = WIN_UTF8ToString(window->title); SetWindowText(hwnd, title); SDL_free(title); #endif } -void -WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void WIN_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; HICON hicon = NULL; BYTE *icon_bmp; int icon_len, mask_len, row_len, y; @@ -656,7 +649,7 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) /* Create temporary buffer for ICONIMAGE structure */ SDL_COMPILE_TIME_ASSERT(WIN_SetWindowIcon_uses_BITMAPINFOHEADER_to_prepare_an_ICONIMAGE, sizeof(BITMAPINFOHEADER) == 40); - mask_len = (icon->h * (icon->w + 7)/8); + mask_len = (icon->h * (icon->w + 7) / 8); icon_len = sizeof(BITMAPINFOHEADER) + icon->h * icon->w * sizeof(Uint32) + mask_len; icon_bmp = SDL_small_alloc(BYTE, icon_len, &isstack); @@ -680,7 +673,7 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) row_len = icon->w * sizeof(Uint32); y = icon->h; while (y--) { - Uint8 *src = (Uint8 *) icon->pixels + y * icon->pitch; + Uint8 *src = (Uint8 *)icon->pixels + y * icon->pitch; SDL_memcpy(dst, src, row_len); dst += row_len; } @@ -693,15 +686,14 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) SDL_small_free(icon_bmp, isstack); /* Set the icon for the window */ - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon); + SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hicon); /* Set the icon in the task manager (should we do this?) */ - SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon); + SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hicon); #endif } -void -WIN_SetWindowPosition(_THIS, SDL_Window * window) +void WIN_SetWindowPosition(_THIS, SDL_Window *window) { /* HighDPI support: removed SWP_NOSIZE. If the move results in a DPI change, we need to allow * the window to resize (e.g. AdjustWindowRectExForDpi frame sizes are different). @@ -709,17 +701,15 @@ WIN_SetWindowPosition(_THIS, SDL_Window * window) WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOACTIVATE); } -void -WIN_SetWindowSize(_THIS, SDL_Window * window) +void WIN_SetWindowSize(_THIS, SDL_Window *window) { WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOACTIVATE); } -int -WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *bottom, int *right) +int WIN_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; RECT rcClient; /* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left @@ -732,8 +722,8 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b *right = rcClient.right; return 0; -#else /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; +#else /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; RECT rcClient, rcWindow; POINT ptDiff; @@ -756,7 +746,7 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b return SDL_SetError("ScreenToClient() failed, error %08X", (unsigned int)GetLastError()); } - rcWindow.top = ptDiff.y; + rcWindow.top = ptDiff.y; rcWindow.left = ptDiff.x; /* convert the bottom/right values to make them relative to the window, @@ -769,7 +759,7 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b } rcWindow.bottom = ptDiff.y; - rcWindow.right = ptDiff.x; + rcWindow.right = ptDiff.x; /* Now that both the inner and outer rects use the same coordinate system we can substract them to get the border size. * Keep in mind that the top/left coordinates of rcWindow are negative because the border lies slightly before {0,0}, @@ -777,30 +767,28 @@ WIN_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b *top = rcClient.top - rcWindow.top; *left = rcClient.left - rcWindow.left; *bottom = rcWindow.bottom - rcClient.bottom; - *right = rcWindow.right - rcClient.right; + *right = rcWindow.right - rcClient.right; return 0; #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void -WIN_GetWindowSizeInPixels(_THIS, SDL_Window * window, int *w, int *h) +void WIN_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) { const SDL_WindowData *data = ((SDL_WindowData *)window->driverdata); HWND hwnd = data->hwnd; RECT rect; - if (GetClientRect(hwnd, &rect)) { + if (GetClientRect(hwnd, &rect) && !WIN_IsRectEmpty(&rect)) { *w = rect.right; *h = rect.bottom; } else { - *w = 0; - *h = 0; + *w = window->w; + *h = window->h; } } -void -WIN_ShowWindow(_THIS, SDL_Window * window) +void WIN_ShowWindow(_THIS, SDL_Window *window) { DWORD style; HWND hwnd; @@ -815,15 +803,13 @@ WIN_ShowWindow(_THIS, SDL_Window * window) ShowWindow(hwnd, nCmdShow); } -void -WIN_HideWindow(_THIS, SDL_Window * window) +void WIN_HideWindow(_THIS, SDL_Window *window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; ShowWindow(hwnd, SW_HIDE); } -void -WIN_RaiseWindow(_THIS, SDL_Window * window) +void WIN_RaiseWindow(_THIS, SDL_Window *window) { #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) /* If desired, raise the window more forcefully. @@ -840,9 +826,8 @@ WIN_RaiseWindow(_THIS, SDL_Window * window) DWORD dwMyID = 0u; DWORD dwCurID = 0u; - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - if(bForce) - { + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; + if (bForce) { hCurWnd = GetForegroundWindow(); dwMyID = GetCurrentThreadId(); dwCurID = GetWindowThreadProcessId(hCurWnd, NULL); @@ -852,8 +837,7 @@ WIN_RaiseWindow(_THIS, SDL_Window * window) SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } SetForegroundWindow(hwnd); - if (bForce) - { + if (bForce) { AttachThreadInput(dwCurID, dwMyID, FALSE); SetFocus(hwnd); SetActiveWindow(hwnd); @@ -861,25 +845,27 @@ WIN_RaiseWindow(_THIS, SDL_Window * window) #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ } -void -WIN_MaximizeWindow(_THIS, SDL_Window * window) +void WIN_MaximizeWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *)window->driverdata; - HWND hwnd = data->hwnd; - data->expected_resize = SDL_TRUE; - ShowWindow(hwnd, SW_MAXIMIZE); - data->expected_resize = SDL_FALSE; + /* Other platforms refuse to maximize a non-resizable window, and with win32, + the OS resizes the window weirdly (covering the taskbar) if you don't have + the STYLE_RESIZABLE flag set. So just forbid it for now. */ + if (window->flags & SDL_WINDOW_RESIZABLE) { + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + HWND hwnd = data->hwnd; + data->expected_resize = SDL_TRUE; + ShowWindow(hwnd, SW_MAXIMIZE); + data->expected_resize = SDL_FALSE; + } } -void -WIN_MinimizeWindow(_THIS, SDL_Window * window) +void WIN_MinimizeWindow(_THIS, SDL_Window *window) { - HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + HWND hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; ShowWindow(hwnd, SW_MINIMIZE); } -void -WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +void WIN_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -895,8 +881,7 @@ WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) data->in_border_change = SDL_FALSE; } -void -WIN_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) +void WIN_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -909,8 +894,7 @@ WIN_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) SetWindowLong(hwnd, GWL_STYLE, style); } -void -WIN_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) +void WIN_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -921,8 +905,7 @@ WIN_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) } } -void -WIN_RestoreWindow(_THIS, SDL_Window * window) +void WIN_RestoreWindow(_THIS, SDL_Window *window) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; @@ -934,12 +917,11 @@ WIN_RestoreWindow(_THIS, SDL_Window * window) /** * Reconfigures the window to fill the given display, if fullscreen is true, otherwise restores the window. */ -void -WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +void WIN_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { -#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) - SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; +#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; HWND hwnd = data->hwnd; MONITORINFO minfo; DWORD style; @@ -947,7 +929,7 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, int x, y; int w, h; - if (!fullscreen && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0) { + if (!fullscreen && (window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP))) { /* Resizing the window on hide causes problems restoring it in Wine, and it's unnecessary. * Also, Windows would preview the minimized window with the wrong size. */ @@ -1020,8 +1002,7 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -int -WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) +int WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; @@ -1039,12 +1020,11 @@ WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) return succeeded ? 0 : -1; } -void -WIN_UpdateWindowICCProfile(SDL_Window * window, SDL_bool send_event) +void WIN_UpdateWindowICCProfile(SDL_Window * window, SDL_bool send_event) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); - SDL_DisplayData *displaydata = display ? (SDL_DisplayData*)display->driverdata : NULL; + SDL_DisplayData *displaydata = display ? (SDL_DisplayData *)display->driverdata : NULL; if (displaydata) { HDC hdc = CreateDCW(displaydata->DeviceName, NULL, NULL, NULL); @@ -1069,10 +1049,9 @@ WIN_UpdateWindowICCProfile(SDL_Window * window, SDL_bool send_event) } } -void * -WIN_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) +void *WIN_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; char *filename_utf8; void *iccProfileData = NULL; @@ -1089,8 +1068,7 @@ WIN_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) return iccProfileData; } -int -WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) +int WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) { SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata; @@ -1152,20 +1130,17 @@ void WIN_UngrabKeyboard(SDL_Window *window) } } -void -WIN_SetWindowMouseRect(_THIS, SDL_Window * window) +void WIN_SetWindowMouseRect(_THIS, SDL_Window *window) { WIN_UpdateClipCursor(window); } -void -WIN_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void WIN_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { WIN_UpdateClipCursor(window); } -void -WIN_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void WIN_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { if (grabbed) { WIN_GrabKeyboard(window); @@ -1175,11 +1150,10 @@ WIN_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -void -WIN_DestroyWindow(_THIS, SDL_Window * window) +void WIN_DestroyWindow(_THIS, SDL_Window *window) { if (window->shaper) { - SDL_ShapeData *shapedata = (SDL_ShapeData *) window->shaper->driverdata; + SDL_ShapeData *shapedata = (SDL_ShapeData *)window->shaper->driverdata; if (shapedata) { if (shapedata->mask_tree) { SDL_FreeShapeTree(&shapedata->mask_tree); @@ -1193,8 +1167,7 @@ WIN_DestroyWindow(_THIS, SDL_Window * window) CleanupWindowData(_this, window); } -SDL_bool -WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata; if (info->version.major <= SDL_MAJOR_VERSION) { @@ -1222,8 +1195,7 @@ WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) /* * Creates a HelperWindow used for DirectInput. */ -int -SDL_HelperWindowCreate(void) +int SDL_HelperWindowCreate(void) { HINSTANCE hInstance = GetModuleHandle(NULL); WNDCLASS wce; @@ -1252,7 +1224,7 @@ SDL_HelperWindowCreate(void) CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_MESSAGE, NULL, hInstance, NULL); - if (SDL_HelperWindow == NULL) { + if (!SDL_HelperWindow) { UnregisterClass(SDL_HelperWindowClassName, hInstance); return WIN_SetError("Unable to create Helper Window"); } @@ -1260,12 +1232,10 @@ SDL_HelperWindowCreate(void) return 0; } - /* * Destroys the HelperWindow previously created with SDL_HelperWindowCreate. */ -void -SDL_HelperWindowDestroy(void) +void SDL_HelperWindowDestroy(void) { HINSTANCE hInstance = GetModuleHandle(NULL); @@ -1289,9 +1259,9 @@ SDL_HelperWindowDestroy(void) } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -void WIN_OnWindowEnter(_THIS, SDL_Window * window) +void WIN_OnWindowEnter(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (!data || !data->hwnd) { /* The window wasn't fully initialized */ @@ -1303,10 +1273,16 @@ void WIN_OnWindowEnter(_THIS, SDL_Window * window) } } -void -WIN_UpdateClipCursor(SDL_Window *window) +static BOOL GetClientScreenRect(HWND hwnd, RECT *rect) +{ + return GetClientRect(hwnd, rect) && /* RECT( left , top , right , bottom ) */ + ClientToScreen(hwnd, (LPPOINT)rect) && /* POINT( left , top ) */ + ClientToScreen(hwnd, (LPPOINT)rect + 1); /* POINT( right , bottom ) */ +} + +void WIN_UpdateClipCursor(SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_Mouse *mouse = SDL_GetMouse(); RECT rect, clipped_rect; @@ -1324,15 +1300,17 @@ WIN_UpdateClipCursor(SDL_Window *window) (window->mouse_rect.w > 0 && window->mouse_rect.h > 0)) && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { if (mouse->relative_mode && !mouse->relative_mode_warp && data->mouse_relative_mode_center) { - if (GetWindowRect(data->hwnd, &rect)) { + if (GetClientScreenRect(data->hwnd, &rect)) { + /* WIN_WarpCursor() jitters by +1, and remote desktop warp wobble is +/- 1 */ + LONG remote_desktop_adjustment = GetSystemMetrics(SM_REMOTESESSION) ? 2 : 0; LONG cx, cy; cx = (rect.left + rect.right) / 2; cy = (rect.top + rect.bottom) / 2; /* Make an absurdly small clip rect */ - rect.left = cx; - rect.right = cx + 1; + rect.left = cx - remote_desktop_adjustment; + rect.right = cx + 1 + remote_desktop_adjustment; rect.top = cy; rect.bottom = cy + 1; @@ -1343,9 +1321,7 @@ WIN_UpdateClipCursor(SDL_Window *window) } } } else { - if (GetClientRect(data->hwnd, &rect)) { - ClientToScreen(data->hwnd, (LPPOINT) & rect); - ClientToScreen(data->hwnd, (LPPOINT) & rect + 1); + if (GetClientScreenRect(data->hwnd, &rect)) { if (window->mouse_rect.w > 0 && window->mouse_rect.h > 0) { SDL_Rect mouse_rect_win_client; RECT mouse_rect, intersection; @@ -1362,14 +1338,14 @@ WIN_UpdateClipCursor(SDL_Window *window) mouse_rect.bottom = mouse_rect.top + mouse_rect_win_client.h; if (IntersectRect(&intersection, &rect, &mouse_rect)) { SDL_memcpy(&rect, &intersection, sizeof(rect)); - } else if ((window->flags & SDL_WINDOW_MOUSE_GRABBED) != 0) { + } else if (window->flags & SDL_WINDOW_MOUSE_GRABBED) { /* Mouse rect was invalid, just do the normal grab */ } else { SDL_zero(rect); } } if (SDL_memcmp(&rect, &clipped_rect, sizeof(rect)) != 0) { - if (!IsRectEmpty(&rect)) { + if (!WIN_IsRectEmpty(&rect)) { if (ClipCursor(&rect)) { data->cursor_clipped_rect = rect; } @@ -1396,21 +1372,19 @@ WIN_UpdateClipCursor(SDL_Window *window) data->last_updated_clipcursor = SDL_GetTicks(); } -int -WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) +int WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) { - return 0; /* just succeed, the real work is done elsewhere. */ + return 0; /* just succeed, the real work is done elsewhere. */ } #endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/ -int -WIN_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) +int WIN_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) { #if defined(__XBOXONE__) || defined(__XBOXSERIES__) return -1; #else - const SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - const HWND hwnd = data->hwnd; + const SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + HWND hwnd = data->hwnd; const LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); SDL_assert(style != 0); @@ -1423,9 +1397,9 @@ WIN_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) } } } else { - const BYTE alpha = (BYTE) ((int) (opacity * 255.0f)); + const BYTE alpha = (BYTE)((int)(opacity * 255.0f)); /* want it transparent, mark it layered if necessary. */ - if ((style & WS_EX_LAYERED) == 0) { + if (!(style & WS_EX_LAYERED)) { if (SetWindowLong(hwnd, GWL_EXSTYLE, style | WS_EX_LAYERED) == 0) { return WIN_SetError("SetWindowLong()"); } @@ -1442,17 +1416,17 @@ WIN_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) /** * Convert a point in the client area from pixels to DPI-scaled points. - * + * * No-op if DPI scaling is not enabled. */ -void -WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y) +void WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y) { const SDL_WindowData *data = ((SDL_WindowData *)window->driverdata); const SDL_VideoData *videodata = data->videodata; - if (!videodata->dpi_scaling_enabled) + if (!videodata->dpi_scaling_enabled) { return; + } *x = MulDiv(*x, 96, data->scaling_dpi); *y = MulDiv(*y, 96, data->scaling_dpi); @@ -1460,38 +1434,36 @@ WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y) /** * Convert a point in the client area from DPI-scaled points to pixels. - * + * * No-op if DPI scaling is not enabled. */ -void -WIN_ClientPointFromSDL(const SDL_Window *window, int *x, int *y) +void WIN_ClientPointFromSDL(const SDL_Window *window, int *x, int *y) { const SDL_WindowData *data = ((SDL_WindowData *)window->driverdata); const SDL_VideoData *videodata = data->videodata; - if (!videodata->dpi_scaling_enabled) + if (!videodata->dpi_scaling_enabled) { return; - + } + *x = MulDiv(*x, data->scaling_dpi, 96); *y = MulDiv(*y, data->scaling_dpi, 96); } #if !defined(__XBOXONE__) && !defined(__XBOXSERIES__) -void -WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept) +void WIN_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) { - const SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + const SDL_WindowData *data = (SDL_WindowData *)window->driverdata; DragAcceptFiles(data->hwnd, accept ? TRUE : FALSE); } -int -WIN_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation) +int WIN_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) { FLASHWINFO desc; SDL_zero(desc); desc.cbSize = sizeof(desc); - desc.hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + desc.hwnd = ((SDL_WindowData *)window->driverdata)->hwnd; switch (operation) { case SDL_FLASH_CANCEL: desc.dwFlags = FLASHW_STOP; diff --git a/src/video/windows/SDL_windowswindow.h b/src/video/windows/SDL_windowswindow.h index 6477530b9fcd3..0134adca81580 100644 --- a/src/video/windows/SDL_windowswindow.h +++ b/src/video/windows/SDL_windowswindow.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_windowswindow_h_ #define SDL_windowswindow_h_ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "../SDL_egl_c.h" #else #include "../SDL_sysvideo.h" @@ -64,7 +64,7 @@ typedef struct SDL_bool mouse_tracked; WCHAR *ICMFileName; struct SDL_VideoData *videodata; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif /** @@ -106,10 +106,10 @@ extern SDL_bool WIN_GetWindowWMInfo(_THIS, SDL_Window * window, extern void WIN_OnWindowEnter(_THIS, SDL_Window * window); extern void WIN_UpdateClipCursor(SDL_Window *window); extern int WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); -extern void WIN_ClientPointToSDL(const SDL_Window *window, int *w, int *h); -extern void WIN_ClientPointFromSDL(const SDL_Window *window, int *w, int *h); -extern void WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept); -extern int WIN_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation); +extern void WIN_ClientPointToSDL(const SDL_Window *window, int *x, int *y); +extern void WIN_ClientPointFromSDL(const SDL_Window *window, int *x, int *y); +extern void WIN_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); +extern int WIN_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/video/windows/wmmsg.h b/src/video/windows/wmmsg.h index 86cae1df9590c..24603bef4580b 100644 --- a/src/video/windows/wmmsg.h +++ b/src/video/windows/wmmsg.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,7 +19,7 @@ 3. This notice may not be removed or altered from any source distribution. */ -#define MAX_WMMSG (sizeof(wmtab)/sizeof(wmtab[0])) +#define MAX_WMMSG (sizeof(wmtab) / sizeof(wmtab[0])) const char *wmtab[] = { "WM_NULL", diff --git a/src/video/winrt/SDL_winrtevents.cpp b/src/video/winrt/SDL_winrtevents.cpp index 646bde773f647..6e72da3431f16 100644 --- a/src/video/winrt/SDL_winrtevents.cpp +++ b/src/video/winrt/SDL_winrtevents.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* * Windows includes: @@ -44,15 +44,12 @@ extern "C" { #include "../../events/SDL_events_c.h" } - /* Forward declarations */ static void WINRT_YieldXAMLThread(); - /* Global event management */ -void -WINRT_PumpEvents(_THIS) +void WINRT_PumpEvents(_THIS) { if (SDL_WinRTGlobalApp) { SDL_WinRTGlobalApp->PumpEvents(); @@ -61,7 +58,6 @@ WINRT_PumpEvents(_THIS) } } - /* XAML Thread management */ enum SDL_XAMLAppThreadState @@ -72,12 +68,11 @@ enum SDL_XAMLAppThreadState }; static SDL_XAMLAppThreadState _threadState = ThreadState_NotLaunched; -static SDL_Thread * _XAMLThread = nullptr; -static SDL_mutex * _mutex = nullptr; -static SDL_cond * _cond = nullptr; +static SDL_Thread *_XAMLThread = nullptr; +static SDL_mutex *_mutex = nullptr; +static SDL_cond *_cond = nullptr; -static void -WINRT_YieldXAMLThread() +static void WINRT_YieldXAMLThread() { SDL_LockMutex(_mutex); SDL_assert(_threadState == ThreadState_Running); @@ -93,8 +88,7 @@ WINRT_YieldXAMLThread() SDL_UnlockMutex(_mutex); } -static int -WINRT_XAMLThreadMain(void * userdata) +static int WINRT_XAMLThreadMain(void *userdata) { // TODO, WinRT: pass the C-style main() a reasonably realistic // representation of command line arguments. @@ -103,48 +97,47 @@ WINRT_XAMLThreadMain(void * userdata) return WINRT_SDLAppEntryPoint(argc, argv); } -void -WINRT_CycleXAMLThread(void) +void WINRT_CycleXAMLThread(void) { switch (_threadState) { - case ThreadState_NotLaunched: - { - _cond = SDL_CreateCond(); + case ThreadState_NotLaunched: + { + _cond = SDL_CreateCond(); - _mutex = SDL_CreateMutex(); - _threadState = ThreadState_Running; - _XAMLThread = SDL_CreateThreadInternal(WINRT_XAMLThreadMain, "SDL/XAML App Thread", 0, nullptr); + _mutex = SDL_CreateMutex(); + _threadState = ThreadState_Running; + _XAMLThread = SDL_CreateThreadInternal(WINRT_XAMLThreadMain, "SDL/XAML App Thread", 0, nullptr); - SDL_LockMutex(_mutex); - while (_threadState != ThreadState_Yielding) { - SDL_CondWait(_cond, _mutex); - } - SDL_UnlockMutex(_mutex); - - break; + SDL_LockMutex(_mutex); + while (_threadState != ThreadState_Yielding) { + SDL_CondWait(_cond, _mutex); } + SDL_UnlockMutex(_mutex); - case ThreadState_Running: - { - SDL_assert(false); - break; - } + break; + } + + case ThreadState_Running: + { + SDL_assert(false); + break; + } - case ThreadState_Yielding: - { - SDL_LockMutex(_mutex); - SDL_assert(_threadState == ThreadState_Yielding); - _threadState = ThreadState_Running; - SDL_UnlockMutex(_mutex); + case ThreadState_Yielding: + { + SDL_LockMutex(_mutex); + SDL_assert(_threadState == ThreadState_Yielding); + _threadState = ThreadState_Running; + SDL_UnlockMutex(_mutex); - SDL_CondSignal(_cond); + SDL_CondSignal(_cond); - SDL_LockMutex(_mutex); - while (_threadState != ThreadState_Yielding) { - SDL_CondWait(_cond, _mutex); - } - SDL_UnlockMutex(_mutex); + SDL_LockMutex(_mutex); + while (_threadState != ThreadState_Yielding) { + SDL_CondWait(_cond, _mutex); } + SDL_UnlockMutex(_mutex); + } } } diff --git a/src/video/winrt/SDL_winrtevents_c.h b/src/video/winrt/SDL_winrtevents_c.h index 67c18b86569aa..6030b92eb5901 100644 --- a/src/video/winrt/SDL_winrtevents_c.h +++ b/src/video/winrt/SDL_winrtevents_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -39,33 +39,33 @@ extern void WINRT_PumpEvents(_THIS); } #endif - /* * Internal-use, C++/CX functions: */ #ifdef __cplusplus_winrt /* Pointers (Mice, Touch, etc.) */ -typedef enum { +typedef enum +{ NormalizeZeroToOne, TransformToSDLWindowSize } WINRT_CursorNormalizationType; -extern Windows::Foundation::Point WINRT_TransformCursorPosition(SDL_Window * window, +extern Windows::Foundation::Point WINRT_TransformCursorPosition(SDL_Window *window, Windows::Foundation::Point rawPosition, WINRT_CursorNormalizationType normalization); -extern SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^pt, Uint8 *button, Uint8 *pressed); -extern void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint); -extern void WINRT_ProcessMouseMovedEvent(SDL_Window * window, Windows::Devices::Input::MouseEventArgs ^args); +extern SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed); +extern void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); +extern void WINRT_ProcessMouseMovedEvent(SDL_Window *window, Windows::Devices::Input::MouseEventArgs ^ args); /* Keyboard */ -extern void WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args); -extern void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args); -extern void WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args); +extern void WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^ args); +extern void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^ args); +extern void WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^ args); #if NTDDI_VERSION >= NTDDI_WIN10 extern void WINTRT_InitialiseInputPaneEvents(_THIS); @@ -73,7 +73,7 @@ extern SDL_bool WINRT_HasScreenKeyboardSupport(_THIS); extern void WINRT_ShowScreenKeyboard(_THIS, SDL_Window *window); extern void WINRT_HideScreenKeyboard(_THIS, SDL_Window *window); extern SDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window); -#endif // NTDDI_VERSION >= ... +#endif // NTDDI_VERSION >= ... /* XAML Thread Management */ extern void WINRT_CycleXAMLThread(void); diff --git a/src/video/winrt/SDL_winrtgamebar.cpp b/src/video/winrt/SDL_winrtgamebar.cpp index 2b12357215ea4..3cfc7e8129d40 100644 --- a/src/video/winrt/SDL_winrtgamebar.cpp +++ b/src/video/winrt/SDL_winrtgamebar.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,14 +20,13 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* Windows includes */ #include #include #include - /* SDL includes */ extern "C" { #include "SDL_mouse.h" @@ -35,13 +34,11 @@ extern "C" { } #include "SDL_winrtvideo_cpp.h" - /* Game Bar events can come in off the main thread. Use the following WinRT CoreDispatcher to deal with them on SDL's thread. */ static Platform::WeakReference WINRT_MainThreadDispatcher; - /* Win10's initial SDK (the 10.0.10240.0 release) does not include references to Game Bar APIs, as the Game Bar was released via Win10 10.0.10586.0. @@ -51,26 +48,26 @@ static Platform::WeakReference WINRT_MainThreadDispatcher; MIDL_INTERFACE("1DB9A292-CC78-4173-BE45-B61E67283EA7") IGameBarStatics_ : public IInspectable { -public: - virtual HRESULT STDMETHODCALLTYPE add_VisibilityChanged( - __FIEventHandler_1_IInspectable *handler, - Windows::Foundation::EventRegistrationToken *token) = 0; - - virtual HRESULT STDMETHODCALLTYPE remove_VisibilityChanged( + public: + virtual HRESULT STDMETHODCALLTYPE add_VisibilityChanged( + __FIEventHandler_1_IInspectable * handler, + Windows::Foundation::EventRegistrationToken * token) = 0; + + virtual HRESULT STDMETHODCALLTYPE remove_VisibilityChanged( Windows::Foundation::EventRegistrationToken token) = 0; - - virtual HRESULT STDMETHODCALLTYPE add_IsInputRedirectedChanged( - __FIEventHandler_1_IInspectable *handler, - Windows::Foundation::EventRegistrationToken *token) = 0; - - virtual HRESULT STDMETHODCALLTYPE remove_IsInputRedirectedChanged( + + virtual HRESULT STDMETHODCALLTYPE add_IsInputRedirectedChanged( + __FIEventHandler_1_IInspectable * handler, + Windows::Foundation::EventRegistrationToken * token) = 0; + + virtual HRESULT STDMETHODCALLTYPE remove_IsInputRedirectedChanged( Windows::Foundation::EventRegistrationToken token) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Visible( - boolean *value) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_IsInputRedirected( - boolean *value) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_Visible( + boolean * value) = 0; + + virtual HRESULT STDMETHODCALLTYPE get_IsInputRedirected( + boolean * value) = 0; }; /* Declare the game bar's COM GUID */ @@ -80,8 +77,7 @@ static GUID IID_IGameBarStatics_ = { MAKELONG(0xA292, 0x1DB9), 0xCC78, 0x4173, { If a pointer is returned, it's ->Release() method must be called after the caller has finished using it. */ -static IGameBarStatics_ * -WINRT_GetGameBar() +static IGameBarStatics_ *WINRT_GetGameBar() { wchar_t *wClassName = L"Windows.Gaming.UI.GameBar"; HSTRING hClassName; @@ -99,7 +95,7 @@ WINRT_GetGameBar() goto done; } - pActivationFactory->QueryInterface(IID_IGameBarStatics_, (void **) &pGameBar); + pActivationFactory->QueryInterface(IID_IGameBarStatics_, (void **)&pGameBar); done: if (pActivationFactory) { @@ -111,8 +107,7 @@ WINRT_GetGameBar() return pGameBar; } -static void -WINRT_HandleGameBarIsInputRedirected_MainThread() +static void WINRT_HandleGameBarIsInputRedirected_MainThread() { IGameBarStatics_ *gameBar; boolean isInputRedirected = 0; @@ -126,7 +121,7 @@ WINRT_HandleGameBarIsInputRedirected_MainThread() return; } if (SUCCEEDED(gameBar->get_IsInputRedirected(&isInputRedirected))) { - if ( ! isInputRedirected) { + if (!isInputRedirected) { /* Input-control is now back to the SDL app. Restore the cursor, in case Windows does not (it does not in either Win10 10.0.10240.0 or 10.0.10586.0, maybe later version(s) too. @@ -138,10 +133,9 @@ WINRT_HandleGameBarIsInputRedirected_MainThread() gameBar->Release(); } -static void -WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object ^ o1, Platform::Object ^o2) +static void WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object ^ o1, Platform::Object ^ o2) { - Windows::UI::Core::CoreDispatcher ^dispatcher = WINRT_MainThreadDispatcher.Resolve(); + Windows::UI::Core::CoreDispatcher ^ dispatcher = WINRT_MainThreadDispatcher.Resolve(); if (dispatcher) { dispatcher->RunAsync( Windows::UI::Core::CoreDispatcherPriority::Normal, @@ -149,8 +143,7 @@ WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object ^ o1, Platfo } } -void -WINRT_InitGameBar(_THIS) +void WINRT_InitGameBar(_THIS) { SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; IGameBarStatics_ *gameBar = WINRT_GetGameBar(); @@ -162,16 +155,15 @@ WINRT_InitGameBar(_THIS) SDL thread. */ WINRT_MainThreadDispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher; - Windows::Foundation::EventHandler ^handler = \ + Windows::Foundation::EventHandler ^ handler = ref new Windows::Foundation::EventHandler(&WINRT_HandleGameBarIsInputRedirected_NonMainThread); - __FIEventHandler_1_IInspectable * pHandler = reinterpret_cast<__FIEventHandler_1_IInspectable *>(handler); + __FIEventHandler_1_IInspectable *pHandler = reinterpret_cast<__FIEventHandler_1_IInspectable *>(handler); gameBar->add_IsInputRedirectedChanged(pHandler, &driverdata->gameBarIsInputRedirectedToken); gameBar->Release(); } } -void -WINRT_QuitGameBar(_THIS) +void WINRT_QuitGameBar(_THIS) { SDL_VideoData *driverdata; IGameBarStatics_ *gameBar; diff --git a/src/video/winrt/SDL_winrtgamebar_cpp.h b/src/video/winrt/SDL_winrtgamebar_cpp.h index a77758791a136..43a9bf31e9c82 100644 --- a/src/video/winrt/SDL_winrtgamebar_cpp.h +++ b/src/video/winrt/SDL_winrtgamebar_cpp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index f6ff0a409b463..da2d09df9c08d 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,13 +20,12 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* Windows-specific includes */ #include #include - /* SDL-specific includes */ #include "SDL.h" #include "SDL_winrtevents_c.h" @@ -36,223 +35,241 @@ extern "C" { #include "../../events/SDL_keyboard_c.h" } - static SDL_Scancode WinRT_Official_Keycodes[] = { - SDL_SCANCODE_UNKNOWN, /* VirtualKey.None -- 0 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftButton -- 1 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightButton -- 2 */ - SDL_SCANCODE_CANCEL, /* VirtualKey.Cancel -- 3 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.MiddleButton -- 4 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton1 -- 5 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton2 -- 6 */ - SDL_SCANCODE_UNKNOWN, /* -- 7 */ - SDL_SCANCODE_BACKSPACE, /* VirtualKey.Back -- 8 */ - SDL_SCANCODE_TAB, /* VirtualKey.Tab -- 9 */ - SDL_SCANCODE_UNKNOWN, /* -- 10 */ - SDL_SCANCODE_UNKNOWN, /* -- 11 */ - SDL_SCANCODE_CLEAR, /* VirtualKey.Clear -- 12 */ - SDL_SCANCODE_RETURN, /* VirtualKey.Enter -- 13 */ - SDL_SCANCODE_UNKNOWN, /* -- 14 */ - SDL_SCANCODE_UNKNOWN, /* -- 15 */ - SDL_SCANCODE_LSHIFT, /* VirtualKey.Shift -- 16 */ - SDL_SCANCODE_LCTRL, /* VirtualKey.Control -- 17 */ - SDL_SCANCODE_MENU, /* VirtualKey.Menu -- 18 */ - SDL_SCANCODE_PAUSE, /* VirtualKey.Pause -- 19 */ - SDL_SCANCODE_CAPSLOCK, /* VirtualKey.CapitalLock -- 20 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Kana or VirtualKey.Hangul -- 21 */ - SDL_SCANCODE_UNKNOWN, /* -- 22 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Junja -- 23 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Final -- 24 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Hanja or VirtualKey.Kanji -- 25 */ - SDL_SCANCODE_UNKNOWN, /* -- 26 */ - SDL_SCANCODE_ESCAPE, /* VirtualKey.Escape -- 27 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Convert -- 28 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.NonConvert -- 29 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Accept -- 30 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.ModeChange -- 31 (maybe SDL_SCANCODE_MODE ?) */ - SDL_SCANCODE_SPACE, /* VirtualKey.Space -- 32 */ - SDL_SCANCODE_PAGEUP, /* VirtualKey.PageUp -- 33 */ - SDL_SCANCODE_PAGEDOWN, /* VirtualKey.PageDown -- 34 */ - SDL_SCANCODE_END, /* VirtualKey.End -- 35 */ - SDL_SCANCODE_HOME, /* VirtualKey.Home -- 36 */ - SDL_SCANCODE_LEFT, /* VirtualKey.Left -- 37 */ - SDL_SCANCODE_UP, /* VirtualKey.Up -- 38 */ - SDL_SCANCODE_RIGHT, /* VirtualKey.Right -- 39 */ - SDL_SCANCODE_DOWN, /* VirtualKey.Down -- 40 */ - SDL_SCANCODE_SELECT, /* VirtualKey.Select -- 41 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Print -- 42 (maybe SDL_SCANCODE_PRINTSCREEN ?) */ - SDL_SCANCODE_EXECUTE, /* VirtualKey.Execute -- 43 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Snapshot -- 44 */ - SDL_SCANCODE_INSERT, /* VirtualKey.Insert -- 45 */ - SDL_SCANCODE_DELETE, /* VirtualKey.Delete -- 46 */ - SDL_SCANCODE_HELP, /* VirtualKey.Help -- 47 */ - SDL_SCANCODE_0, /* VirtualKey.Number0 -- 48 */ - SDL_SCANCODE_1, /* VirtualKey.Number1 -- 49 */ - SDL_SCANCODE_2, /* VirtualKey.Number2 -- 50 */ - SDL_SCANCODE_3, /* VirtualKey.Number3 -- 51 */ - SDL_SCANCODE_4, /* VirtualKey.Number4 -- 52 */ - SDL_SCANCODE_5, /* VirtualKey.Number5 -- 53 */ - SDL_SCANCODE_6, /* VirtualKey.Number6 -- 54 */ - SDL_SCANCODE_7, /* VirtualKey.Number7 -- 55 */ - SDL_SCANCODE_8, /* VirtualKey.Number8 -- 56 */ - SDL_SCANCODE_9, /* VirtualKey.Number9 -- 57 */ - SDL_SCANCODE_UNKNOWN, /* -- 58 */ - SDL_SCANCODE_UNKNOWN, /* -- 59 */ - SDL_SCANCODE_UNKNOWN, /* -- 60 */ - SDL_SCANCODE_UNKNOWN, /* -- 61 */ - SDL_SCANCODE_UNKNOWN, /* -- 62 */ - SDL_SCANCODE_UNKNOWN, /* -- 63 */ - SDL_SCANCODE_UNKNOWN, /* -- 64 */ - SDL_SCANCODE_A, /* VirtualKey.A -- 65 */ - SDL_SCANCODE_B, /* VirtualKey.B -- 66 */ - SDL_SCANCODE_C, /* VirtualKey.C -- 67 */ - SDL_SCANCODE_D, /* VirtualKey.D -- 68 */ - SDL_SCANCODE_E, /* VirtualKey.E -- 69 */ - SDL_SCANCODE_F, /* VirtualKey.F -- 70 */ - SDL_SCANCODE_G, /* VirtualKey.G -- 71 */ - SDL_SCANCODE_H, /* VirtualKey.H -- 72 */ - SDL_SCANCODE_I, /* VirtualKey.I -- 73 */ - SDL_SCANCODE_J, /* VirtualKey.J -- 74 */ - SDL_SCANCODE_K, /* VirtualKey.K -- 75 */ - SDL_SCANCODE_L, /* VirtualKey.L -- 76 */ - SDL_SCANCODE_M, /* VirtualKey.M -- 77 */ - SDL_SCANCODE_N, /* VirtualKey.N -- 78 */ - SDL_SCANCODE_O, /* VirtualKey.O -- 79 */ - SDL_SCANCODE_P, /* VirtualKey.P -- 80 */ - SDL_SCANCODE_Q, /* VirtualKey.Q -- 81 */ - SDL_SCANCODE_R, /* VirtualKey.R -- 82 */ - SDL_SCANCODE_S, /* VirtualKey.S -- 83 */ - SDL_SCANCODE_T, /* VirtualKey.T -- 84 */ - SDL_SCANCODE_U, /* VirtualKey.U -- 85 */ - SDL_SCANCODE_V, /* VirtualKey.V -- 86 */ - SDL_SCANCODE_W, /* VirtualKey.W -- 87 */ - SDL_SCANCODE_X, /* VirtualKey.X -- 88 */ - SDL_SCANCODE_Y, /* VirtualKey.Y -- 89 */ - SDL_SCANCODE_Z, /* VirtualKey.Z -- 90 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftWindows -- 91 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightWindows -- 92 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) */ - SDL_SCANCODE_APPLICATION, /* VirtualKey.Application -- 93 */ - SDL_SCANCODE_UNKNOWN, /* -- 94 */ - SDL_SCANCODE_SLEEP, /* VirtualKey.Sleep -- 95 */ - SDL_SCANCODE_KP_0, /* VirtualKey.NumberPad0 -- 96 */ - SDL_SCANCODE_KP_1, /* VirtualKey.NumberPad1 -- 97 */ - SDL_SCANCODE_KP_2, /* VirtualKey.NumberPad2 -- 98 */ - SDL_SCANCODE_KP_3, /* VirtualKey.NumberPad3 -- 99 */ - SDL_SCANCODE_KP_4, /* VirtualKey.NumberPad4 -- 100 */ - SDL_SCANCODE_KP_5, /* VirtualKey.NumberPad5 -- 101 */ - SDL_SCANCODE_KP_6, /* VirtualKey.NumberPad6 -- 102 */ - SDL_SCANCODE_KP_7, /* VirtualKey.NumberPad7 -- 103 */ - SDL_SCANCODE_KP_8, /* VirtualKey.NumberPad8 -- 104 */ - SDL_SCANCODE_KP_9, /* VirtualKey.NumberPad9 -- 105 */ - SDL_SCANCODE_KP_MULTIPLY, /* VirtualKey.Multiply -- 106 */ - SDL_SCANCODE_KP_PLUS, /* VirtualKey.Add -- 107 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Separator -- 108 */ - SDL_SCANCODE_KP_MINUS, /* VirtualKey.Subtract -- 109 */ - SDL_SCANCODE_UNKNOWN, /* VirtualKey.Decimal -- 110 (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) */ - SDL_SCANCODE_KP_DIVIDE, /* VirtualKey.Divide -- 111 */ - SDL_SCANCODE_F1, /* VirtualKey.F1 -- 112 */ - SDL_SCANCODE_F2, /* VirtualKey.F2 -- 113 */ - SDL_SCANCODE_F3, /* VirtualKey.F3 -- 114 */ - SDL_SCANCODE_F4, /* VirtualKey.F4 -- 115 */ - SDL_SCANCODE_F5, /* VirtualKey.F5 -- 116 */ - SDL_SCANCODE_F6, /* VirtualKey.F6 -- 117 */ - SDL_SCANCODE_F7, /* VirtualKey.F7 -- 118 */ - SDL_SCANCODE_F8, /* VirtualKey.F8 -- 119 */ - SDL_SCANCODE_F9, /* VirtualKey.F9 -- 120 */ - SDL_SCANCODE_F10, /* VirtualKey.F10 -- 121 */ - SDL_SCANCODE_F11, /* VirtualKey.F11 -- 122 */ - SDL_SCANCODE_F12, /* VirtualKey.F12 -- 123 */ - SDL_SCANCODE_F13, /* VirtualKey.F13 -- 124 */ - SDL_SCANCODE_F14, /* VirtualKey.F14 -- 125 */ - SDL_SCANCODE_F15, /* VirtualKey.F15 -- 126 */ - SDL_SCANCODE_F16, /* VirtualKey.F16 -- 127 */ - SDL_SCANCODE_F17, /* VirtualKey.F17 -- 128 */ - SDL_SCANCODE_F18, /* VirtualKey.F18 -- 129 */ - SDL_SCANCODE_F19, /* VirtualKey.F19 -- 130 */ - SDL_SCANCODE_F20, /* VirtualKey.F20 -- 131 */ - SDL_SCANCODE_F21, /* VirtualKey.F21 -- 132 */ - SDL_SCANCODE_F22, /* VirtualKey.F22 -- 133 */ - SDL_SCANCODE_F23, /* VirtualKey.F23 -- 134 */ - SDL_SCANCODE_F24, /* VirtualKey.F24 -- 135 */ - SDL_SCANCODE_UNKNOWN, /* -- 136 */ - SDL_SCANCODE_UNKNOWN, /* -- 137 */ - SDL_SCANCODE_UNKNOWN, /* -- 138 */ - SDL_SCANCODE_UNKNOWN, /* -- 139 */ - SDL_SCANCODE_UNKNOWN, /* -- 140 */ - SDL_SCANCODE_UNKNOWN, /* -- 141 */ - SDL_SCANCODE_UNKNOWN, /* -- 142 */ - SDL_SCANCODE_UNKNOWN, /* -- 143 */ - SDL_SCANCODE_NUMLOCKCLEAR, /* VirtualKey.NumberKeyLock -- 144 */ - SDL_SCANCODE_SCROLLLOCK, /* VirtualKey.Scroll -- 145 */ - SDL_SCANCODE_UNKNOWN, /* -- 146 */ - SDL_SCANCODE_UNKNOWN, /* -- 147 */ - SDL_SCANCODE_UNKNOWN, /* -- 148 */ - SDL_SCANCODE_UNKNOWN, /* -- 149 */ - SDL_SCANCODE_UNKNOWN, /* -- 150 */ - SDL_SCANCODE_UNKNOWN, /* -- 151 */ - SDL_SCANCODE_UNKNOWN, /* -- 152 */ - SDL_SCANCODE_UNKNOWN, /* -- 153 */ - SDL_SCANCODE_UNKNOWN, /* -- 154 */ - SDL_SCANCODE_UNKNOWN, /* -- 155 */ - SDL_SCANCODE_UNKNOWN, /* -- 156 */ - SDL_SCANCODE_UNKNOWN, /* -- 157 */ - SDL_SCANCODE_UNKNOWN, /* -- 158 */ - SDL_SCANCODE_UNKNOWN, /* -- 159 */ - SDL_SCANCODE_LSHIFT, /* VirtualKey.LeftShift -- 160 */ - SDL_SCANCODE_RSHIFT, /* VirtualKey.RightShift -- 161 */ - SDL_SCANCODE_LCTRL, /* VirtualKey.LeftControl -- 162 */ - SDL_SCANCODE_RCTRL, /* VirtualKey.RightControl -- 163 */ - SDL_SCANCODE_MENU, /* VirtualKey.LeftMenu -- 164 */ - SDL_SCANCODE_MENU, /* VirtualKey.RightMenu -- 165 */ - SDL_SCANCODE_AC_BACK, /* VirtualKey.GoBack -- 166 : The go back key. */ - SDL_SCANCODE_AC_FORWARD, /* VirtualKey.GoForward -- 167 : The go forward key. */ - SDL_SCANCODE_AC_REFRESH, /* VirtualKey.Refresh -- 168 : The refresh key. */ - SDL_SCANCODE_AC_STOP, /* VirtualKey.Stop -- 169 : The stop key. */ - SDL_SCANCODE_AC_SEARCH, /* VirtualKey.Search -- 170 : The search key. */ - SDL_SCANCODE_AC_BOOKMARKS, /* VirtualKey.Favorites -- 171 : The favorites key. */ - SDL_SCANCODE_AC_HOME /* VirtualKey.GoHome -- 172 : The go home key. */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.None -- 0 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftButton -- 1 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightButton -- 2 */ + SDL_SCANCODE_CANCEL, /* VirtualKey.Cancel -- 3 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.MiddleButton -- 4 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton1 -- 5 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.XButton2 -- 6 */ + SDL_SCANCODE_UNKNOWN, /* -- 7 */ + SDL_SCANCODE_BACKSPACE, /* VirtualKey.Back -- 8 */ + SDL_SCANCODE_TAB, /* VirtualKey.Tab -- 9 */ + SDL_SCANCODE_UNKNOWN, /* -- 10 */ + SDL_SCANCODE_UNKNOWN, /* -- 11 */ + SDL_SCANCODE_CLEAR, /* VirtualKey.Clear -- 12 */ + SDL_SCANCODE_RETURN, /* VirtualKey.Enter -- 13 */ + SDL_SCANCODE_UNKNOWN, /* -- 14 */ + SDL_SCANCODE_UNKNOWN, /* -- 15 */ + SDL_SCANCODE_LSHIFT, /* VirtualKey.Shift -- 16 */ + SDL_SCANCODE_LCTRL, /* VirtualKey.Control -- 17 */ + SDL_SCANCODE_MENU, /* VirtualKey.Menu -- 18 */ + SDL_SCANCODE_PAUSE, /* VirtualKey.Pause -- 19 */ + SDL_SCANCODE_CAPSLOCK, /* VirtualKey.CapitalLock -- 20 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Kana or VirtualKey.Hangul -- 21 */ + SDL_SCANCODE_UNKNOWN, /* -- 22 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Junja -- 23 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Final -- 24 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Hanja or VirtualKey.Kanji -- 25 */ + SDL_SCANCODE_UNKNOWN, /* -- 26 */ + SDL_SCANCODE_ESCAPE, /* VirtualKey.Escape -- 27 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Convert -- 28 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.NonConvert -- 29 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Accept -- 30 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.ModeChange -- 31 (maybe SDL_SCANCODE_MODE ?) */ + SDL_SCANCODE_SPACE, /* VirtualKey.Space -- 32 */ + SDL_SCANCODE_PAGEUP, /* VirtualKey.PageUp -- 33 */ + SDL_SCANCODE_PAGEDOWN, /* VirtualKey.PageDown -- 34 */ + SDL_SCANCODE_END, /* VirtualKey.End -- 35 */ + SDL_SCANCODE_HOME, /* VirtualKey.Home -- 36 */ + SDL_SCANCODE_LEFT, /* VirtualKey.Left -- 37 */ + SDL_SCANCODE_UP, /* VirtualKey.Up -- 38 */ + SDL_SCANCODE_RIGHT, /* VirtualKey.Right -- 39 */ + SDL_SCANCODE_DOWN, /* VirtualKey.Down -- 40 */ + SDL_SCANCODE_SELECT, /* VirtualKey.Select -- 41 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Print -- 42 (maybe SDL_SCANCODE_PRINTSCREEN ?) */ + SDL_SCANCODE_EXECUTE, /* VirtualKey.Execute -- 43 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Snapshot -- 44 */ + SDL_SCANCODE_INSERT, /* VirtualKey.Insert -- 45 */ + SDL_SCANCODE_DELETE, /* VirtualKey.Delete -- 46 */ + SDL_SCANCODE_HELP, /* VirtualKey.Help -- 47 */ + SDL_SCANCODE_0, /* VirtualKey.Number0 -- 48 */ + SDL_SCANCODE_1, /* VirtualKey.Number1 -- 49 */ + SDL_SCANCODE_2, /* VirtualKey.Number2 -- 50 */ + SDL_SCANCODE_3, /* VirtualKey.Number3 -- 51 */ + SDL_SCANCODE_4, /* VirtualKey.Number4 -- 52 */ + SDL_SCANCODE_5, /* VirtualKey.Number5 -- 53 */ + SDL_SCANCODE_6, /* VirtualKey.Number6 -- 54 */ + SDL_SCANCODE_7, /* VirtualKey.Number7 -- 55 */ + SDL_SCANCODE_8, /* VirtualKey.Number8 -- 56 */ + SDL_SCANCODE_9, /* VirtualKey.Number9 -- 57 */ + SDL_SCANCODE_UNKNOWN, /* -- 58 */ + SDL_SCANCODE_UNKNOWN, /* -- 59 */ + SDL_SCANCODE_UNKNOWN, /* -- 60 */ + SDL_SCANCODE_UNKNOWN, /* -- 61 */ + SDL_SCANCODE_UNKNOWN, /* -- 62 */ + SDL_SCANCODE_UNKNOWN, /* -- 63 */ + SDL_SCANCODE_UNKNOWN, /* -- 64 */ + SDL_SCANCODE_A, /* VirtualKey.A -- 65 */ + SDL_SCANCODE_B, /* VirtualKey.B -- 66 */ + SDL_SCANCODE_C, /* VirtualKey.C -- 67 */ + SDL_SCANCODE_D, /* VirtualKey.D -- 68 */ + SDL_SCANCODE_E, /* VirtualKey.E -- 69 */ + SDL_SCANCODE_F, /* VirtualKey.F -- 70 */ + SDL_SCANCODE_G, /* VirtualKey.G -- 71 */ + SDL_SCANCODE_H, /* VirtualKey.H -- 72 */ + SDL_SCANCODE_I, /* VirtualKey.I -- 73 */ + SDL_SCANCODE_J, /* VirtualKey.J -- 74 */ + SDL_SCANCODE_K, /* VirtualKey.K -- 75 */ + SDL_SCANCODE_L, /* VirtualKey.L -- 76 */ + SDL_SCANCODE_M, /* VirtualKey.M -- 77 */ + SDL_SCANCODE_N, /* VirtualKey.N -- 78 */ + SDL_SCANCODE_O, /* VirtualKey.O -- 79 */ + SDL_SCANCODE_P, /* VirtualKey.P -- 80 */ + SDL_SCANCODE_Q, /* VirtualKey.Q -- 81 */ + SDL_SCANCODE_R, /* VirtualKey.R -- 82 */ + SDL_SCANCODE_S, /* VirtualKey.S -- 83 */ + SDL_SCANCODE_T, /* VirtualKey.T -- 84 */ + SDL_SCANCODE_U, /* VirtualKey.U -- 85 */ + SDL_SCANCODE_V, /* VirtualKey.V -- 86 */ + SDL_SCANCODE_W, /* VirtualKey.W -- 87 */ + SDL_SCANCODE_X, /* VirtualKey.X -- 88 */ + SDL_SCANCODE_Y, /* VirtualKey.Y -- 89 */ + SDL_SCANCODE_Z, /* VirtualKey.Z -- 90 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.LeftWindows -- 91 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_LGUI ?) */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.RightWindows -- 92 (maybe SDL_SCANCODE_APPLICATION or SDL_SCANCODE_RGUI ?) */ + SDL_SCANCODE_APPLICATION, /* VirtualKey.Application -- 93 */ + SDL_SCANCODE_UNKNOWN, /* -- 94 */ + SDL_SCANCODE_SLEEP, /* VirtualKey.Sleep -- 95 */ + SDL_SCANCODE_KP_0, /* VirtualKey.NumberPad0 -- 96 */ + SDL_SCANCODE_KP_1, /* VirtualKey.NumberPad1 -- 97 */ + SDL_SCANCODE_KP_2, /* VirtualKey.NumberPad2 -- 98 */ + SDL_SCANCODE_KP_3, /* VirtualKey.NumberPad3 -- 99 */ + SDL_SCANCODE_KP_4, /* VirtualKey.NumberPad4 -- 100 */ + SDL_SCANCODE_KP_5, /* VirtualKey.NumberPad5 -- 101 */ + SDL_SCANCODE_KP_6, /* VirtualKey.NumberPad6 -- 102 */ + SDL_SCANCODE_KP_7, /* VirtualKey.NumberPad7 -- 103 */ + SDL_SCANCODE_KP_8, /* VirtualKey.NumberPad8 -- 104 */ + SDL_SCANCODE_KP_9, /* VirtualKey.NumberPad9 -- 105 */ + SDL_SCANCODE_KP_MULTIPLY, /* VirtualKey.Multiply -- 106 */ + SDL_SCANCODE_KP_PLUS, /* VirtualKey.Add -- 107 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Separator -- 108 */ + SDL_SCANCODE_KP_MINUS, /* VirtualKey.Subtract -- 109 */ + SDL_SCANCODE_UNKNOWN, /* VirtualKey.Decimal -- 110 (maybe SDL_SCANCODE_DECIMALSEPARATOR, SDL_SCANCODE_KP_DECIMAL, or SDL_SCANCODE_KP_PERIOD ?) */ + SDL_SCANCODE_KP_DIVIDE, /* VirtualKey.Divide -- 111 */ + SDL_SCANCODE_F1, /* VirtualKey.F1 -- 112 */ + SDL_SCANCODE_F2, /* VirtualKey.F2 -- 113 */ + SDL_SCANCODE_F3, /* VirtualKey.F3 -- 114 */ + SDL_SCANCODE_F4, /* VirtualKey.F4 -- 115 */ + SDL_SCANCODE_F5, /* VirtualKey.F5 -- 116 */ + SDL_SCANCODE_F6, /* VirtualKey.F6 -- 117 */ + SDL_SCANCODE_F7, /* VirtualKey.F7 -- 118 */ + SDL_SCANCODE_F8, /* VirtualKey.F8 -- 119 */ + SDL_SCANCODE_F9, /* VirtualKey.F9 -- 120 */ + SDL_SCANCODE_F10, /* VirtualKey.F10 -- 121 */ + SDL_SCANCODE_F11, /* VirtualKey.F11 -- 122 */ + SDL_SCANCODE_F12, /* VirtualKey.F12 -- 123 */ + SDL_SCANCODE_F13, /* VirtualKey.F13 -- 124 */ + SDL_SCANCODE_F14, /* VirtualKey.F14 -- 125 */ + SDL_SCANCODE_F15, /* VirtualKey.F15 -- 126 */ + SDL_SCANCODE_F16, /* VirtualKey.F16 -- 127 */ + SDL_SCANCODE_F17, /* VirtualKey.F17 -- 128 */ + SDL_SCANCODE_F18, /* VirtualKey.F18 -- 129 */ + SDL_SCANCODE_F19, /* VirtualKey.F19 -- 130 */ + SDL_SCANCODE_F20, /* VirtualKey.F20 -- 131 */ + SDL_SCANCODE_F21, /* VirtualKey.F21 -- 132 */ + SDL_SCANCODE_F22, /* VirtualKey.F22 -- 133 */ + SDL_SCANCODE_F23, /* VirtualKey.F23 -- 134 */ + SDL_SCANCODE_F24, /* VirtualKey.F24 -- 135 */ + SDL_SCANCODE_UNKNOWN, /* -- 136 */ + SDL_SCANCODE_UNKNOWN, /* -- 137 */ + SDL_SCANCODE_UNKNOWN, /* -- 138 */ + SDL_SCANCODE_UNKNOWN, /* -- 139 */ + SDL_SCANCODE_UNKNOWN, /* -- 140 */ + SDL_SCANCODE_UNKNOWN, /* -- 141 */ + SDL_SCANCODE_UNKNOWN, /* -- 142 */ + SDL_SCANCODE_UNKNOWN, /* -- 143 */ + SDL_SCANCODE_NUMLOCKCLEAR, /* VirtualKey.NumberKeyLock -- 144 */ + SDL_SCANCODE_SCROLLLOCK, /* VirtualKey.Scroll -- 145 */ + SDL_SCANCODE_UNKNOWN, /* -- 146 */ + SDL_SCANCODE_UNKNOWN, /* -- 147 */ + SDL_SCANCODE_UNKNOWN, /* -- 148 */ + SDL_SCANCODE_UNKNOWN, /* -- 149 */ + SDL_SCANCODE_UNKNOWN, /* -- 150 */ + SDL_SCANCODE_UNKNOWN, /* -- 151 */ + SDL_SCANCODE_UNKNOWN, /* -- 152 */ + SDL_SCANCODE_UNKNOWN, /* -- 153 */ + SDL_SCANCODE_UNKNOWN, /* -- 154 */ + SDL_SCANCODE_UNKNOWN, /* -- 155 */ + SDL_SCANCODE_UNKNOWN, /* -- 156 */ + SDL_SCANCODE_UNKNOWN, /* -- 157 */ + SDL_SCANCODE_UNKNOWN, /* -- 158 */ + SDL_SCANCODE_UNKNOWN, /* -- 159 */ + SDL_SCANCODE_LSHIFT, /* VirtualKey.LeftShift -- 160 */ + SDL_SCANCODE_RSHIFT, /* VirtualKey.RightShift -- 161 */ + SDL_SCANCODE_LCTRL, /* VirtualKey.LeftControl -- 162 */ + SDL_SCANCODE_RCTRL, /* VirtualKey.RightControl -- 163 */ + SDL_SCANCODE_MENU, /* VirtualKey.LeftMenu -- 164 */ + SDL_SCANCODE_MENU, /* VirtualKey.RightMenu -- 165 */ + SDL_SCANCODE_AC_BACK, /* VirtualKey.GoBack -- 166 : The go back key. */ + SDL_SCANCODE_AC_FORWARD, /* VirtualKey.GoForward -- 167 : The go forward key. */ + SDL_SCANCODE_AC_REFRESH, /* VirtualKey.Refresh -- 168 : The refresh key. */ + SDL_SCANCODE_AC_STOP, /* VirtualKey.Stop -- 169 : The stop key. */ + SDL_SCANCODE_AC_SEARCH, /* VirtualKey.Search -- 170 : The search key. */ + SDL_SCANCODE_AC_BOOKMARKS, /* VirtualKey.Favorites -- 171 : The favorites key. */ + SDL_SCANCODE_AC_HOME /* VirtualKey.GoHome -- 172 : The go home key. */ }; /* Attempt to translate a keycode that isn't listed in WinRT's VirtualKey enum. */ -static SDL_Scancode -WINRT_TranslateUnofficialKeycode(int keycode) +static SDL_Scancode WINRT_TranslateUnofficialKeycode(int keycode) { switch (keycode) { - case 173: return SDL_SCANCODE_MUTE; /* VK_VOLUME_MUTE */ - case 174: return SDL_SCANCODE_VOLUMEDOWN; /* VK_VOLUME_DOWN */ - case 175: return SDL_SCANCODE_VOLUMEUP; /* VK_VOLUME_UP */ - case 176: return SDL_SCANCODE_AUDIONEXT; /* VK_MEDIA_NEXT_TRACK */ - case 177: return SDL_SCANCODE_AUDIOPREV; /* VK_MEDIA_PREV_TRACK */ - // case 178: return ; /* VK_MEDIA_STOP */ - case 179: return SDL_SCANCODE_AUDIOPLAY; /* VK_MEDIA_PLAY_PAUSE */ - case 180: return SDL_SCANCODE_MAIL; /* VK_LAUNCH_MAIL */ - case 181: return SDL_SCANCODE_MEDIASELECT; /* VK_LAUNCH_MEDIA_SELECT */ - // case 182: return ; /* VK_LAUNCH_APP1 */ - case 183: return SDL_SCANCODE_CALCULATOR; /* VK_LAUNCH_APP2 */ - // case 184: return ; /* ... reserved ... */ - // case 185: return ; /* ... reserved ... */ - case 186: return SDL_SCANCODE_SEMICOLON; /* VK_OEM_1, ';:' key on US standard keyboards */ - case 187: return SDL_SCANCODE_EQUALS; /* VK_OEM_PLUS */ - case 188: return SDL_SCANCODE_COMMA; /* VK_OEM_COMMA */ - case 189: return SDL_SCANCODE_MINUS; /* VK_OEM_MINUS */ - case 190: return SDL_SCANCODE_PERIOD; /* VK_OEM_PERIOD */ - case 191: return SDL_SCANCODE_SLASH; /* VK_OEM_2, '/?' key on US standard keyboards */ - case 192: return SDL_SCANCODE_GRAVE; /* VK_OEM_3, '`~' key on US standard keyboards */ - // ? - // ... reserved or unassigned ... - // ? - case 219: return SDL_SCANCODE_LEFTBRACKET; /* VK_OEM_4, '[{' key on US standard keyboards */ - case 220: return SDL_SCANCODE_BACKSLASH; /* VK_OEM_5, '\|' key on US standard keyboards */ - case 221: return SDL_SCANCODE_RIGHTBRACKET; /* VK_OEM_6, ']}' key on US standard keyboards */ - case 222: return SDL_SCANCODE_APOSTROPHE; /* VK_OEM_7, 'single/double quote' on US standard keyboards */ - default: break; + case 173: + return SDL_SCANCODE_MUTE; /* VK_VOLUME_MUTE */ + case 174: + return SDL_SCANCODE_VOLUMEDOWN; /* VK_VOLUME_DOWN */ + case 175: + return SDL_SCANCODE_VOLUMEUP; /* VK_VOLUME_UP */ + case 176: + return SDL_SCANCODE_AUDIONEXT; /* VK_MEDIA_NEXT_TRACK */ + case 177: + return SDL_SCANCODE_AUDIOPREV; /* VK_MEDIA_PREV_TRACK */ + // case 178: return ; /* VK_MEDIA_STOP */ + case 179: + return SDL_SCANCODE_AUDIOPLAY; /* VK_MEDIA_PLAY_PAUSE */ + case 180: + return SDL_SCANCODE_MAIL; /* VK_LAUNCH_MAIL */ + case 181: + return SDL_SCANCODE_MEDIASELECT; /* VK_LAUNCH_MEDIA_SELECT */ + // case 182: return ; /* VK_LAUNCH_APP1 */ + case 183: + return SDL_SCANCODE_CALCULATOR; /* VK_LAUNCH_APP2 */ + // case 184: return ; /* ... reserved ... */ + // case 185: return ; /* ... reserved ... */ + case 186: + return SDL_SCANCODE_SEMICOLON; /* VK_OEM_1, ';:' key on US standard keyboards */ + case 187: + return SDL_SCANCODE_EQUALS; /* VK_OEM_PLUS */ + case 188: + return SDL_SCANCODE_COMMA; /* VK_OEM_COMMA */ + case 189: + return SDL_SCANCODE_MINUS; /* VK_OEM_MINUS */ + case 190: + return SDL_SCANCODE_PERIOD; /* VK_OEM_PERIOD */ + case 191: + return SDL_SCANCODE_SLASH; /* VK_OEM_2, '/?' key on US standard keyboards */ + case 192: + return SDL_SCANCODE_GRAVE; /* VK_OEM_3, '`~' key on US standard keyboards */ + // ? + // ... reserved or unassigned ... + // ? + case 219: + return SDL_SCANCODE_LEFTBRACKET; /* VK_OEM_4, '[{' key on US standard keyboards */ + case 220: + return SDL_SCANCODE_BACKSLASH; /* VK_OEM_5, '\|' key on US standard keyboards */ + case 221: + return SDL_SCANCODE_RIGHTBRACKET; /* VK_OEM_6, ']}' key on US standard keyboards */ + case 222: + return SDL_SCANCODE_APOSTROPHE; /* VK_OEM_7, 'single/double quote' on US standard keyboards */ + default: + break; } return SDL_SCANCODE_UNKNOWN; } -static SDL_Scancode -WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode) +static SDL_Scancode WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode) { // TODO, WinRT: try filling out the WinRT keycode table as much as possible, using the Win32 table for interpretation hints @@ -271,21 +288,21 @@ WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode) */ if (nativeScancode < SDL_arraysize(windows_scancode_table)) { switch (keycode) { - case 16: // VirtualKey.Shift - switch (windows_scancode_table[nativeScancode]) { - case SDL_SCANCODE_LSHIFT: - case SDL_SCANCODE_RSHIFT: - return windows_scancode_table[nativeScancode]; - } - break; - + case 16: // VirtualKey.Shift + switch (windows_scancode_table[nativeScancode]) { + case SDL_SCANCODE_LSHIFT: + case SDL_SCANCODE_RSHIFT: + return windows_scancode_table[nativeScancode]; + } + break; + // Add others, as necessary. // // Unfortunately, this hack doesn't seem to work in determining // handedness with Control keys. - default: - break; + default: + break; } } @@ -313,8 +330,7 @@ WINRT_TranslateKeycode(int keycode, unsigned int nativeScancode) return scancode; } -void -WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args) +void WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^ args) { SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode); #if 0 @@ -339,8 +355,7 @@ WINRT_ProcessKeyDownEvent(Windows::UI::Core::KeyEventArgs ^args) SDL_SendKeyboardKey(SDL_PRESSED, sdlScancode); } -void -WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args) +void WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^ args) { SDL_Scancode sdlScancode = WINRT_TranslateKeycode((int)args->VirtualKey, args->KeyStatus.ScanCode); #if 0 @@ -365,8 +380,7 @@ WINRT_ProcessKeyUpEvent(Windows::UI::Core::KeyEventArgs ^args) SDL_SendKeyboardKey(SDL_RELEASED, sdlScancode); } -void -WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^args) +void WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArgs ^ args) { wchar_t src_ucs2[2]; char dest_utf8[16]; @@ -383,7 +397,6 @@ WINRT_ProcessCharacterReceivedEvent(Windows::UI::Core::CharacterReceivedEventArg } } - #if NTDDI_VERSION >= NTDDI_WIN10 static bool WINRT_InputPaneVisible = false; @@ -403,10 +416,10 @@ void WINTRT_InitialiseInputPaneEvents(_THIS) using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); if (inputPane) { - inputPane->Showing += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneShowing); - inputPane->Hiding += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneHiding); + inputPane->Showing += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneShowing); + inputPane->Hiding += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneHiding); } } @@ -440,17 +453,17 @@ SDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window) if (inputPane) { switch (SDL_WinRTGetDeviceFamily()) { case SDL_WINRT_DEVICEFAMILY_XBOX: - //Documentation recommends using inputPane->Visible - //https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 - //This does not seem to work on latest UWP/Xbox. - //Workaround: Listen to Showing/Hiding events + // Documentation recommends using inputPane->Visible + // https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 + // This does not seem to work on latest UWP/Xbox. + // Workaround: Listen to Showing/Hiding events if (WINRT_InputPaneVisible) { return SDL_TRUE; } break; default: - //OccludedRect is recommend on universal apps per docs - //https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 + // OccludedRect is recommend on universal apps per docs + // https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 Windows::Foundation::Rect rect = inputPane->OccludedRect; if (rect.Width > 0 && rect.Height > 0) { return SDL_TRUE; @@ -461,6 +474,6 @@ SDL_bool WINRT_IsScreenKeyboardShown(_THIS, SDL_Window *window) return SDL_FALSE; } -#endif // NTDDI_VERSION >= ... +#endif // NTDDI_VERSION >= ... -#endif // SDL_VIDEO_DRIVER_WINRT \ No newline at end of file +#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmessagebox.cpp b/src/video/winrt/SDL_winrtmessagebox.cpp index f74a7f4839933..b8469a7227c7e 100644 --- a/src/video/winrt/SDL_winrtmessagebox.cpp +++ b/src/video/winrt/SDL_winrtmessagebox.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT extern "C" { #include "SDL_messagebox.h" @@ -34,23 +34,20 @@ using namespace Platform; using namespace Windows::Foundation; using namespace Windows::UI::Popups; -static String ^ -WINRT_UTF8ToPlatformString(const char * str) -{ - wchar_t * wstr = WIN_UTF8ToString(str); +static String ^ WINRT_UTF8ToPlatformString(const char *str) { + wchar_t *wstr = WIN_UTF8ToStringW(str); String ^ rtstr = ref new String(wstr); SDL_free(wstr); return rtstr; } -extern "C" int -WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +extern "C" int WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION == NTDDI_WIN8) +#if SDL_WINAPI_FAMILY_PHONE && (NTDDI_VERSION == NTDDI_WIN8) /* Sadly, Windows Phone 8 doesn't include the MessageDialog class that * Windows 8.x/RT does, even though MSDN's reference documentation for * Windows Phone 8 mentions it. - * + * * The .NET runtime on Windows Phone 8 does, however, include a * MessageBox class. Perhaps this could be called, somehow? */ @@ -58,17 +55,17 @@ WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) #else SDL_VideoDevice *_this = SDL_GetVideoDevice(); -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE const int maxbuttons = 2; - const char * platform = "Windows Phone 8.1+"; + const char *platform = "Windows Phone 8.1+"; #else const int maxbuttons = 3; - const char * platform = "Windows 8.x"; + const char *platform = "Windows 8.x"; #endif if (messageboxdata->numbuttons > maxbuttons) { return SDL_SetError("WinRT's MessageDialog only supports %d buttons, at most, on %s. %d were requested.", - maxbuttons, platform, messageboxdata->numbuttons); + maxbuttons, platform, messageboxdata->numbuttons); } /* Build a MessageDialog object and its buttons */ @@ -109,10 +106,9 @@ WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) *buttonid = messageboxdata->buttons[clicked_index].buttonid; } return 0; -#endif /* if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP / else */ +#endif /* if SDL_WINAPI_FAMILY_PHONE / else */ } #endif /* SDL_VIDEO_DRIVER_WINRT */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/winrt/SDL_winrtmessagebox.h b/src/video/winrt/SDL_winrtmessagebox.h index 7d1429dbc7e61..6ff3d3f76dcc4 100644 --- a/src/video/winrt/SDL_winrtmessagebox.h +++ b/src/video/winrt/SDL_winrtmessagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT extern int WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp index 8c32e5fcf3a0b..49da5319627fb 100644 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ b/src/video/winrt/SDL_winrtmouse.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* * Windows includes: @@ -44,45 +44,65 @@ extern "C" { #include "SDL_winrtvideo_cpp.h" #include "SDL_winrtmouse_c.h" - extern "C" SDL_bool WINRT_UsingRelativeMouseMode = SDL_FALSE; - -static SDL_Cursor * -WINRT_CreateSystemCursor(SDL_SystemCursor id) +static SDL_Cursor *WINRT_CreateSystemCursor(SDL_SystemCursor id) { SDL_Cursor *cursor; CoreCursorType cursorType = CoreCursorType::Arrow; - switch(id) - { + switch (id) { default: SDL_assert(0); return NULL; - case SDL_SYSTEM_CURSOR_ARROW: cursorType = CoreCursorType::Arrow; break; - case SDL_SYSTEM_CURSOR_IBEAM: cursorType = CoreCursorType::IBeam; break; - case SDL_SYSTEM_CURSOR_WAIT: cursorType = CoreCursorType::Wait; break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: cursorType = CoreCursorType::Cross; break; - case SDL_SYSTEM_CURSOR_WAITARROW: cursorType = CoreCursorType::Wait; break; - case SDL_SYSTEM_CURSOR_SIZENWSE: cursorType = CoreCursorType::SizeNorthwestSoutheast; break; - case SDL_SYSTEM_CURSOR_SIZENESW: cursorType = CoreCursorType::SizeNortheastSouthwest; break; - case SDL_SYSTEM_CURSOR_SIZEWE: cursorType = CoreCursorType::SizeWestEast; break; - case SDL_SYSTEM_CURSOR_SIZENS: cursorType = CoreCursorType::SizeNorthSouth; break; - case SDL_SYSTEM_CURSOR_SIZEALL: cursorType = CoreCursorType::SizeAll; break; - case SDL_SYSTEM_CURSOR_NO: cursorType = CoreCursorType::UniversalNo; break; - case SDL_SYSTEM_CURSOR_HAND: cursorType = CoreCursorType::Hand; break; + case SDL_SYSTEM_CURSOR_ARROW: + cursorType = CoreCursorType::Arrow; + break; + case SDL_SYSTEM_CURSOR_IBEAM: + cursorType = CoreCursorType::IBeam; + break; + case SDL_SYSTEM_CURSOR_WAIT: + cursorType = CoreCursorType::Wait; + break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: + cursorType = CoreCursorType::Cross; + break; + case SDL_SYSTEM_CURSOR_WAITARROW: + cursorType = CoreCursorType::Wait; + break; + case SDL_SYSTEM_CURSOR_SIZENWSE: + cursorType = CoreCursorType::SizeNorthwestSoutheast; + break; + case SDL_SYSTEM_CURSOR_SIZENESW: + cursorType = CoreCursorType::SizeNortheastSouthwest; + break; + case SDL_SYSTEM_CURSOR_SIZEWE: + cursorType = CoreCursorType::SizeWestEast; + break; + case SDL_SYSTEM_CURSOR_SIZENS: + cursorType = CoreCursorType::SizeNorthSouth; + break; + case SDL_SYSTEM_CURSOR_SIZEALL: + cursorType = CoreCursorType::SizeAll; + break; + case SDL_SYSTEM_CURSOR_NO: + cursorType = CoreCursorType::UniversalNo; + break; + case SDL_SYSTEM_CURSOR_HAND: + cursorType = CoreCursorType::Hand; + break; } - cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); + cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* Create a pointer to a COM reference to a cursor. The extra pointer is used (on top of the COM reference) to allow the cursor to be referenced by the SDL_cursor's driverdata field, which is a void pointer. */ - CoreCursor ^* theCursor = new CoreCursor^(nullptr); + CoreCursor ^ *theCursor = new CoreCursor ^ (nullptr); *theCursor = ref new CoreCursor(cursorType, 0); - cursor->driverdata = (void *) theCursor; + cursor->driverdata = (void *)theCursor; } else { SDL_OutOfMemory(); } @@ -90,34 +110,31 @@ WINRT_CreateSystemCursor(SDL_SystemCursor id) return cursor; } -static SDL_Cursor * -WINRT_CreateDefaultCursor() +static SDL_Cursor *WINRT_CreateDefaultCursor() { return WINRT_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW); } -static void -WINRT_FreeCursor(SDL_Cursor * cursor) +static void WINRT_FreeCursor(SDL_Cursor *cursor) { if (cursor->driverdata) { - CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata; - *theCursor = nullptr; // Release the COM reference to the CoreCursor - delete theCursor; // Delete the pointer to the COM reference + CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->driverdata; + *theCursor = nullptr; // Release the COM reference to the CoreCursor + delete theCursor; // Delete the pointer to the COM reference } SDL_free(cursor); } -static int -WINRT_ShowCursor(SDL_Cursor * cursor) +static int WINRT_ShowCursor(SDL_Cursor *cursor) { // TODO, WinRT, XAML: make WINRT_ShowCursor work when XAML support is enabled. - if ( ! CoreWindow::GetForCurrentThread()) { + if (!CoreWindow::GetForCurrentThread()) { return 0; } CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); if (cursor) { - CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata; + CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->driverdata; coreWindow->PointerCursor = *theCursor; } else { // HACK ALERT: TL;DR - Hiding the cursor in WinRT/UWP apps is weird, and @@ -164,13 +181,13 @@ WINRT_ShowCursor(SDL_Cursor * cursor) // - src/main/winrt/SDL2-WinRTResources.rc -- declares the cursor resource, and its ID (of 5000) // - const unsigned int win32CursorResourceID = 5000; + const unsigned int win32CursorResourceID = 5000; CoreCursor ^ blankCursor = ref new CoreCursor(CoreCursorType::Custom, win32CursorResourceID); // Set 'PointerCursor' to 'blankCursor' in a way that shouldn't throw // an exception if the app hasn't loaded that resource. - ABI::Windows::UI::Core::ICoreCursor * iblankCursor = reinterpret_cast(blankCursor); - ABI::Windows::UI::Core::ICoreWindow * icoreWindow = reinterpret_cast(coreWindow); + ABI::Windows::UI::Core::ICoreCursor *iblankCursor = reinterpret_cast(blankCursor); + ABI::Windows::UI::Core::ICoreWindow *icoreWindow = reinterpret_cast(coreWindow); HRESULT hr = icoreWindow->put_PointerCursor(iblankCursor); if (FAILED(hr)) { // The app doesn't contain the cursor resource, or some other error @@ -182,15 +199,13 @@ WINRT_ShowCursor(SDL_Cursor * cursor) return 0; } -static int -WINRT_SetRelativeMouseMode(SDL_bool enabled) +static int WINRT_SetRelativeMouseMode(SDL_bool enabled) { WINRT_UsingRelativeMouseMode = enabled; return 0; } -void -WINRT_InitMouse(_THIS) +void WINRT_InitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -200,20 +215,19 @@ WINRT_InitMouse(_THIS) - programmatically moveable cursors */ -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP - //mouse->CreateCursor = WINRT_CreateCursor; +#if !SDL_WINAPI_FAMILY_PHONE + // mouse->CreateCursor = WINRT_CreateCursor; mouse->CreateSystemCursor = WINRT_CreateSystemCursor; mouse->ShowCursor = WINRT_ShowCursor; mouse->FreeCursor = WINRT_FreeCursor; - //mouse->WarpMouse = WINRT_WarpMouse; + // mouse->WarpMouse = WINRT_WarpMouse; mouse->SetRelativeMouseMode = WINRT_SetRelativeMouseMode; SDL_SetDefaultCursor(WINRT_CreateDefaultCursor()); #endif } -void -WINRT_QuitMouse(_THIS) +void WINRT_QuitMouse(_THIS) { } diff --git a/src/video/winrt/SDL_winrtmouse_c.h b/src/video/winrt/SDL_winrtmouse_c.h index f5008962add18..cdeb578874f4e 100644 --- a/src/video/winrt/SDL_winrtmouse_c.h +++ b/src/video/winrt/SDL_winrtmouse_c.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp index d5301006ef6dc..5fa15c47750ed 100644 --- a/src/video/winrt/SDL_winrtopengles.cpp +++ b/src/video/winrt/SDL_winrtopengles.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL) /* EGL implementation of SDL OpenGL support */ @@ -37,17 +37,16 @@ using namespace Windows::UI::Core; /* ANGLE/WinRT constants */ static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; -#define EGL_PLATFORM_ANGLE_ANGLE 0x3202 -#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 -#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B -#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F - -#define EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER 0x320B +#define EGL_PLATFORM_ANGLE_ANGLE 0x3202 +#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203 +#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 +#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 +#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B +#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F +#define EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER 0x320B /* * SDL/EGL top-level implementation @@ -63,7 +62,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) } /* Load ANGLE/WinRT-specific functions */ - CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function) SDL_LoadFunction(_this->egl_data->opengl_dll_handle, "CreateWinrtEglWindow"); + CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function)SDL_LoadFunction(_this->egl_data->opengl_dll_handle, "CreateWinrtEglWindow"); if (CreateWinrtEglWindow) { /* 'CreateWinrtEglWindow' was found, which means that an an older * version of ANGLE/WinRT is being used. Continue setting up EGL, @@ -98,30 +97,39 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) /* Declare some ANGLE/EGL initialization property-sets, as suggested by * MSOpenTech's ANGLE-for-WinRT template apps: */ - const EGLint defaultDisplayAttributes[] = - { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + const EGLint defaultDisplayAttributes[] = { + EGL_PLATFORM_ANGLE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, + EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, + EGL_TRUE, EGL_NONE, }; - const EGLint fl9_3DisplayAttributes[] = - { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9, - EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + const EGLint fl9_3DisplayAttributes[] = { + EGL_PLATFORM_ANGLE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, + 9, + EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, + 3, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, + EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, + EGL_TRUE, EGL_NONE, }; - const EGLint warpDisplayAttributes[] = - { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE, + const EGLint warpDisplayAttributes[] = { + EGL_PLATFORM_ANGLE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, + EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, + EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, + EGL_TRUE, + EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, + EGL_TRUE, EGL_NONE, }; @@ -136,7 +144,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path) return SDL_EGL_SetError("Could not retrieve ANGLE/WinRT display function(s)", "eglGetProcAddress"); } -#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) +#if !SDL_WINAPI_FAMILY_PHONE /* Try initializing EGL at D3D11 Feature Level 10_0+ (which is not * supported on WinPhone 8.x. */ @@ -193,11 +201,10 @@ WINRT_GLES_UnloadLibrary(_THIS) extern "C" { SDL_EGL_CreateContext_impl(WINRT) -SDL_EGL_SwapWindow_impl(WINRT) -SDL_EGL_MakeCurrent_impl(WINRT) + SDL_EGL_SwapWindow_impl(WINRT) + SDL_EGL_MakeCurrent_impl(WINRT) } #endif /* SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL */ /* vi: set ts=4 sw=4 expandtab: */ - diff --git a/src/video/winrt/SDL_winrtopengles.h b/src/video/winrt/SDL_winrtopengles.h index c702c8b69d14c..29b919b3f8f3a 100644 --- a/src/video/winrt/SDL_winrtopengles.h +++ b/src/video/winrt/SDL_winrtopengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,7 +23,7 @@ #ifndef SDL_winrtopengles_h_ #define SDL_winrtopengles_h_ -#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL) #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" @@ -33,14 +33,13 @@ #define WINRT_GLES_GetProcAddress SDL_EGL_GetProcAddress #define WINRT_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define WINRT_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define WINRT_GLES_DeleteContext SDL_EGL_DeleteContext +#define WINRT_GLES_DeleteContext SDL_EGL_DeleteContext extern int WINRT_GLES_LoadLibrary(_THIS, const char *path); extern void WINRT_GLES_UnloadLibrary(_THIS); -extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window * window); -extern int WINRT_GLES_SwapWindow(_THIS, SDL_Window * window); -extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context); - +extern SDL_GLContext WINRT_GLES_CreateContext(_THIS, SDL_Window *window); +extern int WINRT_GLES_SwapWindow(_THIS, SDL_Window *window); +extern int WINRT_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); #ifdef __cplusplus @@ -52,16 +51,16 @@ typedef Microsoft::WRL::ComPtr WINRT_EGLNativeWindowType_Old; /* Function pointer typedefs for 'old' ANGLE/WinRT's functions, which may * require that C++ objects be passed in: */ -typedef EGLDisplay (EGLAPIENTRY *eglGetDisplay_Old_Function)(WINRT_EGLNativeWindowType_Old); -typedef EGLSurface (EGLAPIENTRY *eglCreateWindowSurface_Old_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType_Old, const EGLint *); -typedef HRESULT (EGLAPIENTRY *CreateWinrtEglWindow_Old_Function)(Microsoft::WRL::ComPtr, int, IUnknown ** result); +typedef EGLDisplay(EGLAPIENTRY *eglGetDisplay_Old_Function)(WINRT_EGLNativeWindowType_Old); +typedef EGLSurface(EGLAPIENTRY *eglCreateWindowSurface_Old_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType_Old, const EGLint *); +typedef HRESULT(EGLAPIENTRY *CreateWinrtEglWindow_Old_Function)(Microsoft::WRL::ComPtr, int, IUnknown **result); #endif /* __cplusplus */ /* Function pointer typedefs for 'new' ANGLE/WinRT functions, which, unlike * the old functions, do not require C++ support and work with plain C. */ -typedef EGLDisplay (EGLAPIENTRY *eglGetPlatformDisplayEXT_Function)(EGLenum, void *, const EGLint *); +typedef EGLDisplay(EGLAPIENTRY *eglGetPlatformDisplayEXT_Function)(EGLenum, void *, const EGLint *); #endif /* SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp index 51cc93727342f..8f1264cc4c876 100644 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/src/video/winrt/SDL_winrtpointerinput.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* SDL includes */ #include "SDL_winrtevents_c.h" @@ -38,19 +38,16 @@ extern "C" { /* File-specific globals: */ static SDL_TouchID WINRT_TouchID = 1; - -void -WINRT_InitTouch(_THIS) +void WINRT_InitTouch(_THIS) { SDL_AddTouch(WINRT_TouchID, SDL_TOUCH_DEVICE_DIRECT, ""); } - // // Applies necessary geometric transformations to raw cursor positions: // Windows::Foundation::Point -WINRT_TransformCursorPosition(SDL_Window * window, +WINRT_TransformCursorPosition(SDL_Window *window, Windows::Foundation::Point rawPosition, WINRT_CursorNormalizationType normalization) { @@ -61,7 +58,7 @@ WINRT_TransformCursorPosition(SDL_Window * window, return rawPosition; } - SDL_WindowData * windowData = (SDL_WindowData *) window->driverdata; + SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata; if (windowData->coreWindow == nullptr) { // For some reason, the window isn't associated with a CoreWindow. // This might end up being the case as XAML support is extended. @@ -81,84 +78,81 @@ WINRT_TransformCursorPosition(SDL_Window * window, // Compute coordinates normalized from 0..1. // If the coordinates need to be sized to the SDL window, // we'll do that after. -#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) +#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION > NTDDI_WIN8) outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width; outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height; #else - switch (WINRT_DISPLAY_PROPERTY(CurrentOrientation)) - { - case DisplayOrientations::Portrait: - outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width; - outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height; - break; - case DisplayOrientations::PortraitFlipped: - outputPosition.X = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); - outputPosition.Y = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); - break; - case DisplayOrientations::Landscape: - outputPosition.X = rawPosition.Y / nativeWindow->Bounds.Height; - outputPosition.Y = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); - break; - case DisplayOrientations::LandscapeFlipped: - outputPosition.X = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); - outputPosition.Y = rawPosition.X / nativeWindow->Bounds.Width; - break; - default: - break; + switch (WINRT_DISPLAY_PROPERTY(CurrentOrientation)) { + case DisplayOrientations::Portrait: + outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width; + outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height; + break; + case DisplayOrientations::PortraitFlipped: + outputPosition.X = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); + outputPosition.Y = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); + break; + case DisplayOrientations::Landscape: + outputPosition.X = rawPosition.Y / nativeWindow->Bounds.Height; + outputPosition.Y = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); + break; + case DisplayOrientations::LandscapeFlipped: + outputPosition.X = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); + outputPosition.Y = rawPosition.X / nativeWindow->Bounds.Width; + break; + default: + break; } #endif if (normalization == TransformToSDLWindowSize) { - outputPosition.X *= ((float32) window->w); - outputPosition.Y *= ((float32) window->h); + outputPosition.X *= ((float32)window->w); + outputPosition.Y *= ((float32)window->h); } return outputPosition; } -SDL_bool -WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^pt, Uint8 *button, Uint8 *pressed) +SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed) { using namespace Windows::UI::Input; -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE *button = SDL_BUTTON_LEFT; return SDL_TRUE; #else - switch (pt->Properties->PointerUpdateKind) - { - case PointerUpdateKind::LeftButtonPressed: - case PointerUpdateKind::LeftButtonReleased: - *button = SDL_BUTTON_LEFT; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::LeftButtonPressed); - return SDL_TRUE; - - case PointerUpdateKind::RightButtonPressed: - case PointerUpdateKind::RightButtonReleased: - *button = SDL_BUTTON_RIGHT; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::RightButtonPressed); - return SDL_TRUE; - - case PointerUpdateKind::MiddleButtonPressed: - case PointerUpdateKind::MiddleButtonReleased: - *button = SDL_BUTTON_MIDDLE; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::MiddleButtonPressed); - return SDL_TRUE; - - case PointerUpdateKind::XButton1Pressed: - case PointerUpdateKind::XButton1Released: - *button = SDL_BUTTON_X1; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton1Pressed); - return SDL_TRUE; - - case PointerUpdateKind::XButton2Pressed: - case PointerUpdateKind::XButton2Released: - *button = SDL_BUTTON_X2; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton2Pressed); - return SDL_TRUE; - - default: - break; + switch (pt->Properties->PointerUpdateKind) { + case PointerUpdateKind::LeftButtonPressed: + case PointerUpdateKind::LeftButtonReleased: + *button = SDL_BUTTON_LEFT; + *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::LeftButtonPressed); + return SDL_TRUE; + + case PointerUpdateKind::RightButtonPressed: + case PointerUpdateKind::RightButtonReleased: + *button = SDL_BUTTON_RIGHT; + *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::RightButtonPressed); + return SDL_TRUE; + + case PointerUpdateKind::MiddleButtonPressed: + case PointerUpdateKind::MiddleButtonReleased: + *button = SDL_BUTTON_MIDDLE; + *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::MiddleButtonPressed); + return SDL_TRUE; + + case PointerUpdateKind::XButton1Pressed: + case PointerUpdateKind::XButton1Released: + *button = SDL_BUTTON_X1; + *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton1Pressed); + return SDL_TRUE; + + case PointerUpdateKind::XButton2Pressed: + case PointerUpdateKind::XButton2Released: + *button = SDL_BUTTON_X2; + *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton2Pressed); + return SDL_TRUE; + + default: + break; } #endif @@ -167,64 +161,63 @@ WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^pt, Uint8 *b return SDL_FALSE; } -//const char * -//WINRT_ConvertPointerUpdateKindToString(Windows::UI::Input::PointerUpdateKind kind) +// const char * +// WINRT_ConvertPointerUpdateKindToString(Windows::UI::Input::PointerUpdateKind kind) //{ -// using namespace Windows::UI::Input; +// using namespace Windows::UI::Input; // -// switch (kind) -// { -// case PointerUpdateKind::Other: -// return "Other"; -// case PointerUpdateKind::LeftButtonPressed: -// return "LeftButtonPressed"; -// case PointerUpdateKind::LeftButtonReleased: -// return "LeftButtonReleased"; -// case PointerUpdateKind::RightButtonPressed: -// return "RightButtonPressed"; -// case PointerUpdateKind::RightButtonReleased: -// return "RightButtonReleased"; -// case PointerUpdateKind::MiddleButtonPressed: -// return "MiddleButtonPressed"; -// case PointerUpdateKind::MiddleButtonReleased: -// return "MiddleButtonReleased"; -// case PointerUpdateKind::XButton1Pressed: -// return "XButton1Pressed"; -// case PointerUpdateKind::XButton1Released: -// return "XButton1Released"; -// case PointerUpdateKind::XButton2Pressed: -// return "XButton2Pressed"; -// case PointerUpdateKind::XButton2Released: -// return "XButton2Released"; -// } +// switch (kind) +// { +// case PointerUpdateKind::Other: +// return "Other"; +// case PointerUpdateKind::LeftButtonPressed: +// return "LeftButtonPressed"; +// case PointerUpdateKind::LeftButtonReleased: +// return "LeftButtonReleased"; +// case PointerUpdateKind::RightButtonPressed: +// return "RightButtonPressed"; +// case PointerUpdateKind::RightButtonReleased: +// return "RightButtonReleased"; +// case PointerUpdateKind::MiddleButtonPressed: +// return "MiddleButtonPressed"; +// case PointerUpdateKind::MiddleButtonReleased: +// return "MiddleButtonReleased"; +// case PointerUpdateKind::XButton1Pressed: +// return "XButton1Pressed"; +// case PointerUpdateKind::XButton1Released: +// return "XButton1Released"; +// case PointerUpdateKind::XButton2Pressed: +// return "XButton2Pressed"; +// case PointerUpdateKind::XButton2Released: +// return "XButton2Released"; +// } // -// return ""; -//} +// return ""; +// } -static bool -WINRT_IsTouchEvent(Windows::UI::Input::PointerPoint ^pointerPoint) +static bool WINRT_IsTouchEvent(Windows::UI::Input::PointerPoint ^ pointerPoint) { -#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP +#if SDL_WINAPI_FAMILY_PHONE return true; #else using namespace Windows::Devices::Input; switch (pointerPoint->PointerDevice->PointerDeviceType) { - case PointerDeviceType::Touch: - case PointerDeviceType::Pen: - return true; - default: - return false; + case PointerDeviceType::Touch: + case PointerDeviceType::Pen: + return true; + default: + return false; } #endif } -void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window) { return; } - if ( ! WINRT_IsTouchEvent(pointerPoint)) { + if (!WINRT_IsTouchEvent(pointerPoint)) { Uint8 button, pressed; WINRT_GetSDLButtonForPointerPoint(pointerPoint, &button, &pressed); SDL_assert(pressed == 1); @@ -235,7 +228,7 @@ void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::Po SDL_SendTouch( WINRT_TouchID, - (SDL_FingerID) pointerPoint->PointerId, + (SDL_FingerID)pointerPoint->PointerId, window, SDL_TRUE, normalizedPoint.X, @@ -244,8 +237,7 @@ void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::Po } } -void -WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window || WINRT_UsingRelativeMouseMode) { return; @@ -254,7 +246,7 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne); Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize); - if ( ! WINRT_IsTouchEvent(pointerPoint)) { + if (!WINRT_IsTouchEvent(pointerPoint)) { /* For some odd reason Moved events are used for multiple mouse buttons */ Uint8 button, pressed; if (WINRT_GetSDLButtonForPointerPoint(pointerPoint, &button, &pressed)) { @@ -265,7 +257,7 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo } else { SDL_SendTouchMotion( WINRT_TouchID, - (SDL_FingerID) pointerPoint->PointerId, + (SDL_FingerID)pointerPoint->PointerId, window, normalizedPoint.X, normalizedPoint.Y, @@ -273,7 +265,7 @@ WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPo } } -void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window) { return; @@ -289,7 +281,7 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P SDL_SendTouch( WINRT_TouchID, - (SDL_FingerID) pointerPoint->PointerId, + (SDL_FingerID)pointerPoint->PointerId, window, SDL_FALSE, normalizedPoint.X, @@ -298,7 +290,7 @@ void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::P } } -void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window) { return; @@ -309,7 +301,7 @@ void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::Po } } -void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window) { return; @@ -320,19 +312,17 @@ void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::Poi } } -void -WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint) +void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) { if (!window) { return; } - float motion = (float) pointerPoint->Properties->MouseWheelDelta / WHEEL_DELTA; - SDL_SendMouseWheel(window, 0, 0, (float) motion, SDL_MOUSEWHEEL_NORMAL); + float motion = (float)pointerPoint->Properties->MouseWheelDelta / WHEEL_DELTA; + SDL_SendMouseWheel(window, 0, 0, (float)motion, SDL_MOUSEWHEEL_NORMAL); } -void -WINRT_ProcessMouseMovedEvent(SDL_Window * window, Windows::Devices::Input::MouseEventArgs ^args) +void WINRT_ProcessMouseMovedEvent(SDL_Window *window, Windows::Devices::Input::MouseEventArgs ^ args) { if (!window || !WINRT_UsingRelativeMouseMode) { return; diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 7511aa5310366..3edf770caf55d 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_WINRT +#ifdef SDL_VIDEO_DRIVER_WINRT /* WinRT SDL video driver implementation @@ -29,10 +29,8 @@ */ /* Standard C++11 includes */ -#include -#include #include -using namespace std; +#include /* Windows includes */ #include @@ -46,11 +44,9 @@ using namespace Windows::Graphics::Display; using namespace Windows::UI::Core; using namespace Windows::UI::ViewManagement; - /* [re]declare Windows GUIDs locally, to limit the amount of external lib(s) SDL has to link to */ -static const GUID SDL_IID_IDisplayRequest = { 0xe5732044, 0xf49f, 0x4b60, { 0x8d, 0xd4, 0x5e, 0x7e, 0x3a, 0x63, 0x2a, 0xc0 } }; -static const GUID SDL_IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48, { 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; - +static const GUID SDL_IID_IDisplayRequest = { 0xe5732044, 0xf49f, 0x4b60, { 0x8d, 0xd4, 0x5e, 0x7e, 0x3a, 0x63, 0x2a, 0xc0 } }; +static const GUID SDL_IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48, { 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; /* SDL includes */ extern "C" { @@ -63,6 +59,7 @@ extern "C" { #include "SDL_syswm.h" #include "SDL_winrtopengles.h" #include "../../core/windows/SDL_windows.h" +#include "SDL_winrtmessagebox.h" } #include "../../core/winrt/SDL_winrtapp_direct3d.h" @@ -75,14 +72,12 @@ extern "C" { #include "SDL_system.h" #include "SDL_hints.h" - /* Initialization/Query functions */ static int WINRT_VideoInit(_THIS); static int WINRT_InitModes(_THIS); -static int WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +static int WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static void WINRT_VideoQuit(_THIS); - /* Window functions */ static int WINRT_CreateWindow(_THIS, SDL_Window * window); static void WINRT_SetWindowSize(_THIS, SDL_Window * window); @@ -92,21 +87,18 @@ static SDL_bool WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo /* Misc functions */ -static ABI::Windows::System::Display::IDisplayRequest * WINRT_CreateDisplayRequest(_THIS); +static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(_THIS); extern void WINRT_SuspendScreenSaver(_THIS); - /* SDL-internal globals: */ -SDL_Window * WINRT_GlobalSDLWindow = NULL; - +SDL_Window *WINRT_GlobalSDLWindow = NULL; /* WinRT driver bootstrap functions */ -static void -WINRT_DeleteDevice(SDL_VideoDevice * device) +static void WINRT_DeleteDevice(SDL_VideoDevice *device) { if (device->driverdata) { - SDL_VideoData * video_data = (SDL_VideoData *)device->driverdata; + SDL_VideoData *video_data = (SDL_VideoData *)device->driverdata; if (video_data->winrtEglWindow) { video_data->winrtEglWindow->Release(); } @@ -116,24 +108,23 @@ WINRT_DeleteDevice(SDL_VideoDevice * device) SDL_free(device); } -static SDL_VideoDevice * -WINRT_CreateDevice(void) +static SDL_VideoDevice *WINRT_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *data; /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); - return (0); + return 0; } - data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); + data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!data) { SDL_OutOfMemory(); SDL_free(device); - return (0); + return 0; } device->driverdata = data; @@ -174,14 +165,13 @@ WINRT_CreateDevice(void) return device; } -#define WINRTVID_DRIVER_NAME "winrt" VideoBootStrap WINRT_bootstrap = { - WINRTVID_DRIVER_NAME, "SDL WinRT video driver", - WINRT_CreateDevice + "winrt", "SDL WinRT video driver", + WINRT_CreateDevice, + WINRT_ShowMessageBox }; -static void SDLCALL -WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const char *oldValue, const char *newValue) +static void SDLCALL WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const char *oldValue, const char *newValue) { SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0); @@ -191,7 +181,7 @@ WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const c * * TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'. */ - if ((oldValue == NULL) && (newValue == NULL)) { + if ((!oldValue) && (!newValue)) { return; } @@ -204,13 +194,13 @@ WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const c std::string orientationName; std::getline(tokenizer, orientationName, ' '); if (orientationName == "LandscapeLeft") { - orientationFlags |= (unsigned int) DisplayOrientations::LandscapeFlipped; + orientationFlags |= (unsigned int)DisplayOrientations::LandscapeFlipped; } else if (orientationName == "LandscapeRight") { - orientationFlags |= (unsigned int) DisplayOrientations::Landscape; + orientationFlags |= (unsigned int)DisplayOrientations::Landscape; } else if (orientationName == "Portrait") { - orientationFlags |= (unsigned int) DisplayOrientations::Portrait; + orientationFlags |= (unsigned int)DisplayOrientations::Portrait; } else if (orientationName == "PortraitUpsideDown") { - orientationFlags |= (unsigned int) DisplayOrientations::PortraitFlipped; + orientationFlags |= (unsigned int)DisplayOrientations::PortraitFlipped; } } } @@ -218,11 +208,10 @@ WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const c // If no valid orientation flags were specified, use a reasonable set of defaults: if (!orientationFlags) { // TODO, WinRT: consider seeing if an app's default orientation flags can be found out via some API call(s). - orientationFlags = (unsigned int) ( \ - DisplayOrientations::Landscape | - DisplayOrientations::LandscapeFlipped | - DisplayOrientations::Portrait | - DisplayOrientations::PortraitFlipped); + orientationFlags = (unsigned int)(DisplayOrientations::Landscape | + DisplayOrientations::LandscapeFlipped | + DisplayOrientations::Portrait | + DisplayOrientations::PortraitFlipped); } // Set the orientation/rotation preferences. Please note that this does @@ -239,13 +228,12 @@ WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const c // for details. Microsoft's "Display orientation sample" also gives an // outline of how Windows treats device rotation // (http://code.msdn.microsoft.com/Display-Orientation-Sample-19a58e93). - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences) = (DisplayOrientations) orientationFlags; + WINRT_DISPLAY_PROPERTY(AutoRotationPreferences) = (DisplayOrientations)orientationFlags; } -int -WINRT_VideoInit(_THIS) +int WINRT_VideoInit(_THIS) { - SDL_VideoData * driverdata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; if (WINRT_InitModes(_this) < 0) { return -1; } @@ -264,11 +252,9 @@ WINRT_VideoInit(_THIS) return 0; } -extern "C" -Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); +extern "C" Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); -static void -WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC * dxgiMode, SDL_DisplayMode * sdlMode) +static void WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC *dxgiMode, SDL_DisplayMode *sdlMode) { SDL_zerop(sdlMode); sdlMode->w = dxgiMode->Width; @@ -277,17 +263,16 @@ WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC * dxgiMode, SDL_DisplayMode sdlMode->format = D3D11_DXGIFormatToSDLPixelFormat(dxgiMode->Format); } -static int -WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex) +static int WINRT_AddDisplaysForOutput(_THIS, IDXGIAdapter1 *dxgiAdapter1, int outputIndex) { HRESULT hr; - IDXGIOutput * dxgiOutput = NULL; + IDXGIOutput *dxgiOutput = NULL; DXGI_OUTPUT_DESC dxgiOutputDesc; SDL_VideoDisplay display; - char * displayName = NULL; + char *displayName = NULL; UINT numModes; - DXGI_MODE_DESC * dxgiModes = NULL; - int functionResult = -1; /* -1 for failure, 0 for success */ + DXGI_MODE_DESC *dxgiModes = NULL; + int functionResult = -1; /* -1 for failure, 0 for success */ DXGI_MODE_DESC modeToMatch, closestMatch; SDL_zero(display); @@ -326,17 +311,17 @@ WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex mode.w = (dxgiOutputDesc.DesktopCoordinates.right - dxgiOutputDesc.DesktopCoordinates.left); mode.h = (dxgiOutputDesc.DesktopCoordinates.bottom - dxgiOutputDesc.DesktopCoordinates.top); mode.format = DXGI_FORMAT_B8G8R8A8_UNORM; - mode.refresh_rate = 0; /* Display mode is unknown, so just fill in zero, as specified by SDL's header files */ + mode.refresh_rate = 0; /* Display mode is unknown, so just fill in zero, as specified by SDL's header files */ display.desktop_mode = mode; display.current_mode = mode; - if ( ! SDL_AddDisplayMode(&display, &mode)) { + if (!SDL_AddDisplayMode(&display, &mode)) { goto done; } } else if (FAILED(hr)) { WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::FindClosestMatchingMode failed", hr); goto done; } else { - displayName = WIN_StringToUTF8(dxgiOutputDesc.DeviceName); + displayName = WIN_StringToUTF8W(dxgiOutputDesc.DeviceName); display.name = displayName; WINRT_DXGIModeToSDLDisplayMode(&closestMatch, &display.desktop_mode); display.current_mode = display.desktop_mode; @@ -351,7 +336,7 @@ WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex } dxgiModes = (DXGI_MODE_DESC *)SDL_calloc(numModes, sizeof(DXGI_MODE_DESC)); - if ( ! dxgiModes) { + if (!dxgiModes) { SDL_OutOfMemory(); goto done; } @@ -373,7 +358,7 @@ WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex goto done; } - functionResult = 0; /* 0 for Success! */ + functionResult = 0; /* 0 for Success! */ done: if (dxgiModes) { SDL_free(dxgiModes); @@ -387,11 +372,10 @@ WINRT_AddDisplaysForOutput (_THIS, IDXGIAdapter1 * dxgiAdapter1, int outputIndex return functionResult; } -static int -WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterIndex) +static int WINRT_AddDisplaysForAdapter(_THIS, IDXGIFactory2 *dxgiFactory2, int adapterIndex) { HRESULT hr; - IDXGIAdapter1 * dxgiAdapter1; + IDXGIAdapter1 *dxgiAdapter1; hr = dxgiFactory2->EnumAdapters1(adapterIndex, &dxgiAdapter1); if (FAILED(hr)) { @@ -401,7 +385,7 @@ WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterInd return -1; } - for (int outputIndex = 0; ; ++outputIndex) { + for (int outputIndex = 0;; ++outputIndex) { if (WINRT_AddDisplaysForOutput(_this, dxgiAdapter1, outputIndex) < 0) { /* HACK: The Windows App Certification Kit 10.0 can fail, when running the Store Apps' test, "Direct3D Feature Test". The @@ -421,7 +405,7 @@ WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterInd if (adapterIndex == 0 && outputIndex == 0) { SDL_VideoDisplay display; SDL_DisplayMode mode; -#if SDL_WINRT_USE_APPLICATIONVIEW +#ifdef SDL_WINRT_USE_APPLICATIONVIEW ApplicationView ^ appView = ApplicationView::GetForCurrentView(); #endif CoreWindow ^ coreWin = CoreWindow::GetForCurrentThread(); @@ -436,7 +420,7 @@ WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterInd failing test), whereas CoreWindow might not. -- DavidL */ -#if (NTDDI_VERSION >= NTDDI_WIN10) || (SDL_WINRT_USE_APPLICATIONVIEW && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) +#if (NTDDI_VERSION >= NTDDI_WIN10) || (defined(SDL_WINRT_USE_APPLICATIONVIEW) && SDL_WINAPI_FAMILY_PHONE) mode.w = WINRT_DIPS_TO_PHYSICAL_PIXELS(appView->VisibleBounds.Width); mode.h = WINRT_DIPS_TO_PHYSICAL_PIXELS(appView->VisibleBounds.Height); #else @@ -448,12 +432,11 @@ WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterInd #endif mode.format = DXGI_FORMAT_B8G8R8A8_UNORM; - mode.refresh_rate = 0; /* Display mode is unknown, so just fill in zero, as specified by SDL's header files */ + mode.refresh_rate = 0; /* Display mode is unknown, so just fill in zero, as specified by SDL's header files */ display.desktop_mode = mode; display.current_mode = mode; if ((SDL_AddDisplayMode(&display, &mode) < 0) || - (SDL_AddVideoDisplay(&display, SDL_FALSE) < 0)) - { + (SDL_AddVideoDisplay(&display, SDL_FALSE) < 0)) { return SDL_SetError("Failed to apply DXGI Display-detection workaround"); } } @@ -466,8 +449,7 @@ WINRT_AddDisplaysForAdapter (_THIS, IDXGIFactory2 * dxgiFactory2, int adapterInd return 0; } -int -WINRT_InitModes(_THIS) +int WINRT_InitModes(_THIS) { /* HACK: Initialize a single display, for whatever screen the app's CoreApplicationView is on. @@ -476,14 +458,14 @@ WINRT_InitModes(_THIS) */ HRESULT hr; - IDXGIFactory2 * dxgiFactory2 = NULL; + IDXGIFactory2 *dxgiFactory2 = NULL; hr = CreateDXGIFactory1(SDL_IID_IDXGIFactory2, (void **)&dxgiFactory2); if (FAILED(hr)) { return WIN_SetErrorFromHRESULT(__FUNCTION__ ", CreateDXGIFactory1() failed", hr); } - for (int adapterIndex = 0; ; ++adapterIndex) { + for (int adapterIndex = 0;; ++adapterIndex) { if (WINRT_AddDisplaysForAdapter(_this, dxgiFactory2, adapterIndex) < 0) { break; } @@ -492,16 +474,14 @@ WINRT_InitModes(_THIS) return 0; } -static int -WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode) +static int WINRT_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { return 0; } -void -WINRT_VideoQuit(_THIS) +void WINRT_VideoQuit(_THIS) { - SDL_VideoData * driverdata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; if (driverdata && driverdata->displayRequest) { driverdata->displayRequest->Release(); driverdata->displayRequest = NULL; @@ -510,52 +490,47 @@ WINRT_VideoQuit(_THIS) WINRT_QuitMouse(_this); } -static const Uint32 WINRT_DetectableFlags = - SDL_WINDOW_MAXIMIZED | - SDL_WINDOW_FULLSCREEN_DESKTOP | - SDL_WINDOW_SHOWN | - SDL_WINDOW_HIDDEN | - SDL_WINDOW_MOUSE_FOCUS; +static const Uint32 WINRT_DetectableFlags = SDL_WINDOW_MAXIMIZED | SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_SHOWN | SDL_WINDOW_HIDDEN | SDL_WINDOW_MOUSE_FOCUS; extern "C" Uint32 -WINRT_DetectWindowFlags(SDL_Window * window) +WINRT_DetectWindowFlags(SDL_Window *window) { Uint32 latestFlags = 0; - SDL_WindowData * data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; bool is_fullscreen = false; -#if SDL_WINRT_USE_APPLICATIONVIEW +#ifdef SDL_WINRT_USE_APPLICATIONVIEW if (data->appView) { is_fullscreen = data->appView->IsFullScreenMode; } -#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION == NTDDI_WIN8) +#elif SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION == NTDDI_WIN8) is_fullscreen = true; #endif if (data->coreWindow.Get()) { if (is_fullscreen) { - SDL_VideoDisplay * display = SDL_GetDisplayForWindow(window); + SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window); int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); -#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8) +#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION > NTDDI_WIN8) // On all WinRT platforms, except for WinPhone 8.0, rotate the // window size. This is needed to properly calculate // fullscreen vs. maximized. const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); switch (currentOrientation) { -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: +#if SDL_WINAPI_FAMILY_PHONE + case DisplayOrientations::Landscape: + case DisplayOrientations::LandscapeFlipped: #else - case DisplayOrientations::Portrait: - case DisplayOrientations::PortraitFlipped: + case DisplayOrientations::Portrait: + case DisplayOrientations::PortraitFlipped: #endif - { - int tmp = w; - w = h; - h = tmp; - } break; + { + int tmp = w; + w = h; + h = tmp; + } break; } #endif @@ -572,7 +547,7 @@ WINRT_DetectWindowFlags(SDL_Window * window) latestFlags |= SDL_WINDOW_HIDDEN; } -#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION < NTDDI_WINBLUE) +#if SDL_WINAPI_FAMILY_PHONE && (NTDDI_VERSION < NTDDI_WINBLUE) // data->coreWindow->PointerPosition is not supported on WinPhone 8.0 latestFlags |= SDL_WINDOW_MOUSE_FOCUS; #else @@ -586,47 +561,44 @@ WINRT_DetectWindowFlags(SDL_Window * window) } // TODO, WinRT: consider removing WINRT_UpdateWindowFlags, and just calling WINRT_DetectWindowFlags as-appropriate (with appropriate calls to SDL_SendWindowEvent) -void -WINRT_UpdateWindowFlags(SDL_Window * window, Uint32 mask) +void WINRT_UpdateWindowFlags(SDL_Window *window, Uint32 mask) { mask &= WINRT_DetectableFlags; if (window) { Uint32 apply = WINRT_DetectWindowFlags(window); if ((apply & mask) & SDL_WINDOW_FULLSCREEN) { - window->last_fullscreen_flags = window->flags; // seems necessary to programmatically un-fullscreen, via SDL APIs + window->last_fullscreen_flags = window->flags; // seems necessary to programmatically un-fullscreen, via SDL APIs } window->flags = (window->flags & ~mask) | (apply & mask); } } -static bool -WINRT_IsCoreWindowActive(CoreWindow ^ coreWindow) +static bool WINRT_IsCoreWindowActive(CoreWindow ^ coreWindow) { /* WinRT does not appear to offer API(s) to determine window-activation state, at least not that I am aware of in Win8 - Win10. As such, SDL tracks this itself, via window-activation events. - + If there *is* an API to track this, it should probably get used instead of the following hack (that uses "SDLHelperWindowActivationState"). -- DavidL. */ if (coreWindow->CustomProperties->HasKey("SDLHelperWindowActivationState")) { - CoreWindowActivationState activationState = \ + CoreWindowActivationState activationState = safe_cast(coreWindow->CustomProperties->Lookup("SDLHelperWindowActivationState")); - return (activationState != CoreWindowActivationState::Deactivated); + return activationState != CoreWindowActivationState::Deactivated; } /* Assume that non-SDL tracked windows are active, although this should probably be avoided, if possible. - + This might not even be possible, in normal SDL use, at least as of this writing (Dec 22, 2015; via latest hg.libsdl.org/SDL clone) -- DavidL */ return true; } -int -WINRT_CreateWindow(_THIS, SDL_Window * window) +int WINRT_CreateWindow(_THIS, SDL_Window *window) { // Make sure that only one window gets created, at least until multimonitor // support is added. @@ -634,7 +606,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) return SDL_SetError("WinRT only supports one window"); } - SDL_WindowData *data = new SDL_WindowData; /* use 'new' here as SDL_WindowData may use WinRT/C++ types */ + SDL_WindowData *data = new SDL_WindowData; /* use 'new' here as SDL_WindowData may use WinRT/C++ types */ if (!data) { return SDL_OutOfMemory(); } @@ -649,7 +621,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) */ if (!WINRT_XAMLWasEnabled) { data->coreWindow = CoreWindow::GetForCurrentThread(); -#if SDL_WINRT_USE_APPLICATIONVIEW +#ifdef SDL_WINRT_USE_APPLICATIONVIEW data->appView = ApplicationView::GetForCurrentView(); #endif } @@ -657,14 +629,14 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) /* Make note of the requested window flags, before they start getting changed. */ const Uint32 requestedFlags = window->flags; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL /* Setup the EGL surface, but only if OpenGL ES 2 was requested. */ if (!(window->flags & SDL_WINDOW_OPENGL)) { /* OpenGL ES 2 wasn't requested. Don't set up an EGL surface. */ data->egl_surface = EGL_NO_SURFACE; } else { /* OpenGL ES 2 was reuqested. Set up an EGL surface. */ - SDL_VideoData * video_data = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *video_data = (SDL_VideoData *)_this->driverdata; /* Call SDL_EGL_ChooseConfig and eglCreateWindowSurface directly, * rather than via SDL_EGL_CreateSurface, as older versions of @@ -673,10 +645,10 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) */ if (SDL_EGL_ChooseConfig(_this) != 0) { /* SDL_EGL_ChooseConfig failed, SDL_GetError() should have info */ - return -1; + return -1; } - if (video_data->winrtEglWindow) { /* ... is the 'old' version of ANGLE/WinRT being used? */ + if (video_data->winrtEglWindow) { /* ... is the 'old' version of ANGLE/WinRT being used? */ /* Attempt to create a window surface using older versions of * ANGLE/WinRT: */ @@ -692,7 +664,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) /* Attempt to create a window surface using newer versions of * ANGLE/WinRT: */ - IInspectable * coreWindowAsIInspectable = reinterpret_cast(data->coreWindow.Get()); + IInspectable *coreWindowAsIInspectable = reinterpret_cast(data->coreWindow.Get()); data->egl_surface = _this->egl_data->eglCreateWindowSurface( _this->egl_data->egl_display, _this->egl_data->egl_config, @@ -712,7 +684,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface) { window->flags |= SDL_WINDOW_OPENGL; } @@ -723,8 +695,8 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) window->x = 0; window->y = 0; window->flags |= SDL_WINDOW_SHOWN; - SDL_SetMouseFocus(NULL); // TODO: detect this - SDL_SetKeyboardFocus(NULL); // TODO: detect this + SDL_SetMouseFocus(NULL); // TODO: detect this + SDL_SetKeyboardFocus(NULL); // TODO: detect this } else { /* WinRT 8.x apps seem to live in an environment where the OS controls the app's window size, with some apps being fullscreen, depending on @@ -758,7 +730,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) WINRT_UpdateWindowFlags( window, - 0xffffffff /* Update any window flag(s) that WINRT_UpdateWindow can handle */ + 0xffffffff /* Update any window flag(s) that WINRT_UpdateWindow can handle */ ); /* Try detecting if the window is active */ @@ -767,7 +739,7 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) SDL_SetKeyboardFocus(window); } } - + /* Make sure the WinRT app's IFramworkView can post events on behalf of SDL: */ @@ -777,27 +749,25 @@ WINRT_CreateWindow(_THIS, SDL_Window * window) return 0; } -void -WINRT_SetWindowSize(_THIS, SDL_Window * window) +void WINRT_SetWindowSize(_THIS, SDL_Window *window) { #if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; const Windows::Foundation::Size size(WINRT_PHYSICAL_PIXELS_TO_DIPS(window->w), WINRT_PHYSICAL_PIXELS_TO_DIPS(window->h)); data->appView->TryResizeView(size); // TODO, WinRT: return failure (to caller?) from TryResizeView() #endif } -void -WINRT_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen) +void WINRT_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) { #if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData * data = (SDL_WindowData *)window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; bool isWindowActive = WINRT_IsCoreWindowActive(data->coreWindow.Get()); if (isWindowActive) { if (fullscreen) { if (!data->appView->IsFullScreenMode) { - data->appView->TryEnterFullScreenMode(); // TODO, WinRT: return failure (to caller?) from TryEnterFullScreenMode() + data->appView->TryEnterFullScreenMode(); // TODO, WinRT: return failure (to caller?) from TryEnterFullScreenMode() } } else { if (data->appView->IsFullScreenMode) { @@ -808,11 +778,9 @@ WINRT_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display #endif } - -void -WINRT_DestroyWindow(_THIS, SDL_Window * window) +void WINRT_DestroyWindow(_THIS, SDL_Window *window) { - SDL_WindowData * data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (WINRT_GlobalSDLWindow == window) { WINRT_GlobalSDLWindow = NULL; @@ -826,8 +794,7 @@ WINRT_DestroyWindow(_THIS, SDL_Window * window) } } -SDL_bool -WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { SDL_WindowData * data = (SDL_WindowData *) window->driverdata; @@ -843,15 +810,14 @@ WINRT_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) return SDL_FALSE; } -static ABI::Windows::System::Display::IDisplayRequest * -WINRT_CreateDisplayRequest(_THIS) +static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(_THIS) { /* Setup a WinRT DisplayRequest object, usable for enabling/disabling screensaver requests */ wchar_t *wClassName = L"Windows.System.Display.DisplayRequest"; HSTRING hClassName; IActivationFactory *pActivationFactory = NULL; - IInspectable * pDisplayRequestRaw = nullptr; - ABI::Windows::System::Display::IDisplayRequest * pDisplayRequest = nullptr; + IInspectable *pDisplayRequestRaw = nullptr; + ABI::Windows::System::Display::IDisplayRequest *pDisplayRequest = nullptr; HRESULT hr; hr = ::WindowsCreateString(wClassName, (UINT32)SDL_wcslen(wClassName), &hClassName); @@ -869,7 +835,7 @@ WINRT_CreateDisplayRequest(_THIS) goto done; } - hr = pDisplayRequestRaw->QueryInterface(SDL_IID_IDisplayRequest, (void **) &pDisplayRequest); + hr = pDisplayRequestRaw->QueryInterface(SDL_IID_IDisplayRequest, (void **)&pDisplayRequest); if (FAILED(hr)) { goto done; } @@ -888,12 +854,11 @@ WINRT_CreateDisplayRequest(_THIS) return pDisplayRequest; } -void -WINRT_SuspendScreenSaver(_THIS) +void WINRT_SuspendScreenSaver(_THIS) { SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; if (driverdata && driverdata->displayRequest) { - ABI::Windows::System::Display::IDisplayRequest * displayRequest = (ABI::Windows::System::Display::IDisplayRequest *) driverdata->displayRequest; + ABI::Windows::System::Display::IDisplayRequest *displayRequest = (ABI::Windows::System::Display::IDisplayRequest *)driverdata->displayRequest; if (_this->suspend_screensaver) { displayRequest->RequestActive(); } else { diff --git a/src/video/winrt/SDL_winrtvideo_cpp.h b/src/video/winrt/SDL_winrtvideo_cpp.h index 8e6d63bdcb566..2928ee882a416 100644 --- a/src/video/winrt/SDL_winrtvideo_cpp.h +++ b/src/video/winrt/SDL_winrtvideo_cpp.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,9 +29,9 @@ #include "SDL_video.h" #include "SDL_events.h" -#if NTDDI_VERSION >= NTDDI_WINBLUE /* ApplicationView's functionality only becomes - useful for SDL in Win[Phone] 8.1 and up. - Plus, it is not available at all in WinPhone 8.0. */ +#if NTDDI_VERSION >= NTDDI_WINBLUE /* ApplicationView's functionality only becomes \ + useful for SDL in Win[Phone] 8.1 and up. \ + Plus, it is not available at all in WinPhone 8.0. */ #define SDL_WINRT_USE_APPLICATIONVIEW 1 #endif @@ -41,7 +41,8 @@ extern "C" { } /* Private display data */ -typedef struct SDL_VideoData { +typedef struct SDL_VideoData +{ /* An object created by ANGLE/WinRT (OpenGL ES 2 for WinRT) that gets * passed to eglGetDisplay and eglCreateWindowSurface: */ @@ -55,7 +56,7 @@ typedef struct SDL_VideoData { /* A WinRT DisplayRequest, used for implementing SDL_*ScreenSaver() functions. * This is really a pointer to a 'ABI::Windows::System::Display::IDisplayRequest *', * It's casted to 'IUnknown *', to help with building SDL. - */ + */ IUnknown *displayRequest; } SDL_VideoData; @@ -63,19 +64,19 @@ typedef struct SDL_VideoData { For now, SDL/WinRT only supports one window (due to platform limitations of WinRT. */ -extern SDL_Window * WINRT_GlobalSDLWindow; +extern SDL_Window *WINRT_GlobalSDLWindow; /* Updates one or more SDL_Window flags, by querying the OS' native windowing APIs. SDL_Window flags that can be updated should be specified in 'mask'. */ -extern void WINRT_UpdateWindowFlags(SDL_Window * window, Uint32 mask); -extern "C" Uint32 WINRT_DetectWindowFlags(SDL_Window * window); /* detects flags w/o applying them */ +extern void WINRT_UpdateWindowFlags(SDL_Window *window, Uint32 mask); +extern "C" Uint32 WINRT_DetectWindowFlags(SDL_Window *window); /* detects flags w/o applying them */ /* Display mode internals */ -//typedef struct +// typedef struct //{ -// Windows::Graphics::Display::DisplayOrientations currentOrientation; -//} SDL_DisplayModeData; +// Windows::Graphics::Display::DisplayOrientations currentOrientation; +// } SDL_DisplayModeData; #ifdef __cplusplus_winrt @@ -87,8 +88,8 @@ extern "C" Uint32 WINRT_DetectWindowFlags(SDL_Window * window); /* detects flag #endif /* Converts DIPS to/from physical pixels */ -#define WINRT_DIPS_TO_PHYSICAL_PIXELS(DIPS) ((int)(0.5f + (((float)(DIPS) * (float)WINRT_DISPLAY_PROPERTY(LogicalDpi)) / 96.f))) -#define WINRT_PHYSICAL_PIXELS_TO_DIPS(PHYSPIX) (((float)(PHYSPIX) * 96.f)/WINRT_DISPLAY_PROPERTY(LogicalDpi)) +#define WINRT_DIPS_TO_PHYSICAL_PIXELS(DIPS) ((int)(0.5f + (((float)(DIPS) * (float)WINRT_DISPLAY_PROPERTY(LogicalDpi)) / 96.f))) +#define WINRT_PHYSICAL_PIXELS_TO_DIPS(PHYSPIX) (((float)(PHYSPIX)*96.f) / WINRT_DISPLAY_PROPERTY(LogicalDpi)) /* Internal window data */ struct SDL_WindowData @@ -98,7 +99,7 @@ struct SDL_WindowData #ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif -#if SDL_WINRT_USE_APPLICATIONVIEW +#ifdef SDL_WINRT_USE_APPLICATIONVIEW Windows::UI::ViewManagement::ApplicationView ^ appView; #endif }; diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index fd198bd2057c2..f9c0a431ac7f3 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include /* For INT_MAX */ @@ -30,10 +30,9 @@ #include "SDL_x11clipboard.h" /* Get any application owned window handle for clipboard association */ -static Window -GetWindow(_THIS) +static Window GetWindow(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; /* We create an unmapped window that exists just to manage the clipboard, since X11 selection data is tied to a specific window and dies with it. @@ -54,76 +53,71 @@ GetWindow(_THIS) /* We use our own cut-buffer for intermediate storage instead of XA_CUT_BUFFER0 because their use isn't really defined for holding UTF8. */ -Atom -X11_GetSDLCutBufferClipboardType(Display *display, enum ESDLX11ClipboardMimeType mime_type, - Atom selection_type) +Atom X11_GetSDLCutBufferClipboardType(Display *display, enum ESDLX11ClipboardMimeType mime_type, + Atom selection_type) { switch (mime_type) { - case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: - #ifdef X_HAVE_UTF8_STRING - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: - #endif - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: - return X11_XInternAtom(display, selection_type == XA_PRIMARY ? - "SDL_CUTBUFFER_PRIMARY_SELECTION" : "SDL_CUTBUFFER", - False); - default: - SDL_SetError("Can't find mime_type."); - return XA_STRING; + case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: +#ifdef X_HAVE_UTF8_STRING + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: +#endif + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: + return X11_XInternAtom(display, selection_type == XA_PRIMARY ? "SDL_CUTBUFFER_PRIMARY_SELECTION" : "SDL_CUTBUFFER", + False); + default: + SDL_SetError("Can't find mime_type."); + return XA_STRING; } } -Atom -X11_GetSDLCutBufferClipboardExternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type) +Atom X11_GetSDLCutBufferClipboardExternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type) { switch (mime_type) { - case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: - /* If you don't support UTF-8, you might use XA_STRING here */ - #ifdef X_HAVE_UTF8_STRING - return X11_XInternAtom(display, "UTF8_STRING", False); - #else - return XA_STRING; - #endif - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: - return X11_XInternAtom(display, "text/plain", False); - #ifdef X_HAVE_UTF8_STRING - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: - return X11_XInternAtom(display, "text/plain;charset=utf-8", False); - #endif - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: - return X11_XInternAtom(display, "TEXT", False); - default: - SDL_SetError("Can't find mime_type."); - return XA_STRING; + case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: +/* If you don't support UTF-8, you might use XA_STRING here */ +#ifdef X_HAVE_UTF8_STRING + return X11_XInternAtom(display, "UTF8_STRING", False); +#else + return XA_STRING; +#endif + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: + return X11_XInternAtom(display, "text/plain", False); +#ifdef X_HAVE_UTF8_STRING + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: + return X11_XInternAtom(display, "text/plain;charset=utf-8", False); +#endif + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: + return X11_XInternAtom(display, "TEXT", False); + default: + SDL_SetError("Can't find mime_type."); + return XA_STRING; } } -Atom -X11_GetSDLCutBufferClipboardInternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type) +Atom X11_GetSDLCutBufferClipboardInternalFormat(Display *display, enum ESDLX11ClipboardMimeType mime_type) { switch (mime_type) { - case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: - #ifdef X_HAVE_UTF8_STRING - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: - #endif - case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: - /* If you don't support UTF-8, you might use XA_STRING here */ - #ifdef X_HAVE_UTF8_STRING - return X11_XInternAtom(display, "UTF8_STRING", False); - #else - return XA_STRING; - #endif - default: - SDL_SetError("Can't find mime_type."); - return XA_STRING; + case SDL_X11_CLIPBOARD_MIME_TYPE_STRING: + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN: +#ifdef X_HAVE_UTF8_STRING + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8: +#endif + case SDL_X11_CLIPBOARD_MIME_TYPE_TEXT: +/* If you don't support UTF-8, you might use XA_STRING here */ +#ifdef X_HAVE_UTF8_STRING + return X11_XInternAtom(display, "UTF8_STRING", False); +#else + return XA_STRING; +#endif + default: + SDL_SetError("Can't find mime_type."); + return XA_STRING; } } -static int -SetSelectionText(_THIS, const char *text, Atom selection_type) +static int SetSelectionText(_THIS, const char *text, Atom selection_type) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; Window window; /* Get the SDL window that will own the selection */ @@ -134,21 +128,17 @@ SetSelectionText(_THIS, const char *text, Atom selection_type) /* Save the selection on the root window */ X11_XChangeProperty(display, DefaultRootWindow(display), - X11_GetSDLCutBufferClipboardType(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING, selection_type), - X11_GetSDLCutBufferClipboardInternalFormat(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING), 8, PropModeReplace, - (const unsigned char *)text, SDL_strlen(text)); - - if (X11_XGetSelectionOwner(display, selection_type) != window) { - X11_XSetSelectionOwner(display, selection_type, window, CurrentTime); - } + X11_GetSDLCutBufferClipboardType(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING, selection_type), + X11_GetSDLCutBufferClipboardInternalFormat(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING), 8, PropModeReplace, + (const unsigned char *)text, SDL_strlen(text)); + X11_XSetSelectionOwner(display, selection_type, window, CurrentTime); return 0; } -static char * -GetSlectionText(_THIS, Atom selection_type) +static char *GetSlectionText(_THIS, Atom selection_type) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display = videodata->display; Atom format; Window window; @@ -182,7 +172,7 @@ GetSlectionText(_THIS, Atom selection_type) owner = window; selection = X11_XInternAtom(display, "SDL_SELECTION", False); X11_XConvertSelection(display, selection_type, format, selection, owner, - CurrentTime); + CurrentTime); /* When using synergy on Linux and when data has been put in the clipboard on the remote (Windows anyway) machine then selection_waiting may never @@ -204,11 +194,10 @@ GetSlectionText(_THIS, Atom selection_type) } } - if (X11_XGetWindowProperty(display, owner, selection, 0, INT_MAX/4, False, - format, &seln_type, &seln_format, &nbytes, &overflow, &src) - == Success) { + if (X11_XGetWindowProperty(display, owner, selection, 0, INT_MAX / 4, False, + format, &seln_type, &seln_format, &nbytes, &overflow, &src) == Success) { if (seln_type == format) { - text = (char *)SDL_malloc(nbytes+1); + text = (char *)SDL_malloc(nbytes + 1); if (text) { SDL_memcpy(text, src, nbytes); text[nbytes] = '\0'; @@ -224,10 +213,9 @@ GetSlectionText(_THIS, Atom selection_type) return text; } -int -X11_SetClipboardText(_THIS, const char *text) +int X11_SetClipboardText(_THIS, const char *text) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); if (XA_CLIPBOARD == None) { return SDL_SetError("Couldn't access X clipboard"); @@ -235,16 +223,14 @@ X11_SetClipboardText(_THIS, const char *text) return SetSelectionText(_this, text, XA_CLIPBOARD); } -int -X11_SetPrimarySelectionText(_THIS, const char *text) +int X11_SetPrimarySelectionText(_THIS, const char *text) { return SetSelectionText(_this, text, XA_PRIMARY); } -char * -X11_GetClipboardText(_THIS) +char *X11_GetClipboardText(_THIS) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); if (XA_CLIPBOARD == None) { SDL_SetError("Couldn't access X clipboard"); @@ -253,14 +239,12 @@ X11_GetClipboardText(_THIS) return GetSlectionText(_this, XA_CLIPBOARD); } -char * -X11_GetPrimarySelectionText(_THIS) +char *X11_GetPrimarySelectionText(_THIS) { return GetSlectionText(_this, XA_PRIMARY); } -SDL_bool -X11_HasClipboardText(_THIS) +SDL_bool X11_HasClipboardText(_THIS) { SDL_bool result = SDL_FALSE; char *text = X11_GetClipboardText(_this); @@ -271,8 +255,7 @@ X11_HasClipboardText(_THIS) return result; } -SDL_bool -X11_HasPrimarySelectionText(_THIS) +SDL_bool X11_HasPrimarySelectionText(_THIS) { SDL_bool result = SDL_FALSE; char *text = X11_GetPrimarySelectionText(_this); diff --git a/src/video/x11/SDL_x11clipboard.h b/src/video/x11/SDL_x11clipboard.h index ddeb016e861ab..cb010a34cb2a6 100644 --- a/src/video/x11/SDL_x11clipboard.h +++ b/src/video/x11/SDL_x11clipboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,12 +23,13 @@ #ifndef SDL_x11clipboard_h_ #define SDL_x11clipboard_h_ -enum ESDLX11ClipboardMimeType { +enum ESDLX11ClipboardMimeType +{ SDL_X11_CLIPBOARD_MIME_TYPE_STRING, SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN, - #ifdef X_HAVE_UTF8_STRING +#ifdef X_HAVE_UTF8_STRING SDL_X11_CLIPBOARD_MIME_TYPE_TEXT_PLAIN_UTF8, - #endif +#endif SDL_X11_CLIPBOARD_MIME_TYPE_TEXT, SDL_X11_CLIPBOARD_MIME_TYPE_MAX }; diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c index 3c6474a074cd3..a940bea8e4680 100644 --- a/src/video/x11/SDL_x11dyn.c +++ b/src/video/x11/SDL_x11dyn.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #define DEBUG_DYNAMIC_X11 0 @@ -61,37 +61,38 @@ typedef struct #endif static x11dynlib x11libs[] = { - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR}, - {NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS} + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR }, + { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS } }; -static void * -X11_GetSym(const char *fnname, int *pHasModule) +static void *X11_GetSym(const char *fnname, int *pHasModule) { int i; void *fn = NULL; for (i = 0; i < SDL_TABLESIZE(x11libs); i++) { - if (x11libs[i].lib != NULL) { + if (x11libs[i].lib) { fn = SDL_LoadFunction(x11libs[i].lib, fnname); - if (fn != NULL) + if (fn) { break; + } } } #if DEBUG_DYNAMIC_X11 - if (fn != NULL) + if (fn) printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, fn); else printf("X11: Symbol '%s' NOT FOUND!\n", fnname); #endif - if (fn == NULL) - *pHasModule = 0; /* kill this module. */ + if (!fn) { + *pHasModule = 0; /* kill this module. */ + } return fn; } @@ -99,7 +100,7 @@ X11_GetSym(const char *fnname, int *pHasModule) #endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */ /* Define all the function pointers and wrappers... */ -#define SDL_X11_SYM(rc,fn,params,args,ret) SDL_DYNX11FN_##fn X11_##fn = NULL; +#define SDL_X11_SYM(rc, fn, params, args, ret) SDL_DYNX11FN_##fn X11_##fn = NULL; #include "SDL_x11sym.h" /* Annoying varargs entry point... */ @@ -114,8 +115,7 @@ SDL_DYNX11FN_XGetICValues X11_XGetICValues = NULL; static int x11_load_refcount = 0; -void -SDL_X11_UnloadSymbols(void) +void SDL_X11_UnloadSymbols(void) { /* Don't actually unload if more than one module is using the libs... */ if (x11_load_refcount > 0) { @@ -125,8 +125,8 @@ SDL_X11_UnloadSymbols(void) #endif /* set all the function pointers to NULL. */ -#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 0; -#define SDL_X11_SYM(rc,fn,params,args,ret) X11_##fn = NULL; +#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 0; +#define SDL_X11_SYM(rc, fn, params, args, ret) X11_##fn = NULL; #include "SDL_x11sym.h" #ifdef X_HAVE_UTF8_STRING @@ -136,7 +136,7 @@ SDL_X11_UnloadSymbols(void) #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC for (i = 0; i < SDL_TABLESIZE(x11libs); i++) { - if (x11libs[i].lib != NULL) { + if (x11libs[i].lib) { SDL_UnloadObject(x11libs[i].lib); x11libs[i].lib = NULL; } @@ -147,10 +147,9 @@ SDL_X11_UnloadSymbols(void) } /* returns non-zero if all needed symbols were loaded. */ -int -SDL_X11_LoadSymbols(void) +int SDL_X11_LoadSymbols(void) { - int rc = 1; /* always succeed if not using Dynamic X11 stuff. */ + int rc = 1; /* always succeed if not using Dynamic X11 stuff. */ /* deal with multiple modules (dga, x11, etc) needing these symbols... */ if (x11_load_refcount++ == 0) { @@ -158,7 +157,7 @@ SDL_X11_LoadSymbols(void) int i; int *thismod = NULL; for (i = 0; i < SDL_TABLESIZE(x11libs); i++) { - if (x11libs[i].libname != NULL) { + if (x11libs[i].libname) { x11libs[i].lib = SDL_LoadObject(x11libs[i].libname); } } @@ -166,15 +165,15 @@ SDL_X11_LoadSymbols(void) #define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */ #include "SDL_x11sym.h" -#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname; -#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) X11_GetSym(#fn,thismod); +#define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname; +#define SDL_X11_SYM(a, fn, x, y, z) X11_##fn = (SDL_DYNX11FN_##fn)X11_GetSym(#fn, thismod); #include "SDL_x11sym.h" #ifdef X_HAVE_UTF8_STRING X11_XCreateIC = (SDL_DYNX11FN_XCreateIC) - X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8); + X11_GetSym("XCreateIC", &SDL_X11_HAVE_UTF8); X11_XGetICValues = (SDL_DYNX11FN_XGetICValues) - X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8); + X11_GetSym("XGetICValues", &SDL_X11_HAVE_UTF8); #endif if (SDL_X11_HAVE_BASEXLIB) { @@ -186,10 +185,10 @@ SDL_X11_LoadSymbols(void) rc = 0; } -#else /* no dynamic X11 */ +#else /* no dynamic X11 */ -#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */ -#define SDL_X11_SYM(a,fn,x,y,z) X11_##fn = (SDL_DYNX11FN_##fn) fn; +#define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1; /* default yes */ +#define SDL_X11_SYM(a, fn, x, y, z) X11_##fn = (SDL_DYNX11FN_##fn)fn; #include "SDL_x11sym.h" #ifdef X_HAVE_UTF8_STRING diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index feac35fa941a0..34a0a90c7095a 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ #include #include -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM #include #endif @@ -46,51 +46,50 @@ #include #endif -#if SDL_VIDEO_DRIVER_X11_XCURSOR +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR #include #endif -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE #include #endif -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#if defined(SDL_VIDEO_DRIVER_X11_XINPUT2) || defined(SDL_VIDEO_DRIVER_X11_XFIXES) #include #endif -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES #include #endif -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR #include #endif -#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER #include #endif -#if SDL_VIDEO_DRIVER_X11_XSHAPE +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE #include #endif #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif /* evil function signatures... */ -typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *, xEvent *); -typedef int (*SDL_X11_XSynchronizeRetType) (Display *); -typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *, xEvent *); +typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display *, XEvent *, xEvent *); +typedef int (*SDL_X11_XSynchronizeRetType)(Display *); +typedef Status (*SDL_X11_XESetEventToWireRetType)(Display *, XEvent *, xEvent *); int SDL_X11_LoadSymbols(void); void SDL_X11_UnloadSymbols(void); /* Declare all the function pointers and wrappers... */ -#define SDL_X11_SYM(rc,fn,params,args,ret) \ - typedef rc (*SDL_DYNX11FN_##fn) params; \ +#define SDL_X11_SYM(rc, fn, params, args, ret) \ + typedef rc(*SDL_DYNX11FN_##fn) params; \ extern SDL_DYNX11FN_##fn X11_##fn; #include "SDL_x11sym.h" /* Annoying varargs entry point... */ #ifdef X_HAVE_UTF8_STRING -typedef XIC(*SDL_DYNX11FN_XCreateIC) (XIM,...); -typedef char *(*SDL_DYNX11FN_XGetICValues) (XIC, ...); +typedef XIC (*SDL_DYNX11FN_XCreateIC)(XIM, ...); +typedef char *(*SDL_DYNX11FN_XGetICValues)(XIC, ...); extern SDL_DYNX11FN_XCreateIC X11_XCreateIC; extern SDL_DYNX11FN_XGetICValues X11_XGetICValues; #endif @@ -103,5 +102,5 @@ extern SDL_DYNX11FN_XGetICValues X11_XGetICValues; } #endif -#endif /* !defined SDL_x11dyn_h_ */ +#endif /* !defined SDL_x11dyn_h_ */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 6b6b834b40ed0..60c87a288cd0a 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include #include @@ -36,6 +36,7 @@ #include "../../events/SDL_events_c.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" +#include "../../SDL_utils_c.h" #include "SDL_hints.h" #include "SDL_timer.h" @@ -46,42 +47,43 @@ /*#define DEBUG_XEVENTS*/ #ifndef _NET_WM_MOVERESIZE_SIZE_TOPLEFT -#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 +#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_TOP -#define _NET_WM_MOVERESIZE_SIZE_TOP 1 +#define _NET_WM_MOVERESIZE_SIZE_TOP 1 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_TOPRIGHT -#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 +#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_RIGHT -#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 +#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT -#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOM -#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT -#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 +#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 #endif #ifndef _NET_WM_MOVERESIZE_SIZE_LEFT -#define _NET_WM_MOVERESIZE_SIZE_LEFT 7 +#define _NET_WM_MOVERESIZE_SIZE_LEFT 7 #endif #ifndef _NET_WM_MOVERESIZE_MOVE -#define _NET_WM_MOVERESIZE_MOVE 8 +#define _NET_WM_MOVERESIZE_MOVE 8 #endif -typedef struct { +typedef struct +{ unsigned char *data; int format, count; Atom type; @@ -92,7 +94,7 @@ typedef struct { */ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) { - unsigned char *ret=NULL; + unsigned char *ret = NULL; Atom type; int fmt; unsigned long count; @@ -100,15 +102,17 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) int bytes_fetch = 0; do { - if (ret != NULL) X11_XFree(ret); + if (ret) { + X11_XFree(ret); + } X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret); bytes_fetch += bytes_left; } while (bytes_left != 0); - p->data=ret; - p->format=fmt; - p->count=count; - p->type=type; + p->data = ret; + p->format = fmt; + p->count = count; + p->type = type; } /* Find text-uri-list in a list of targets and return it's atom @@ -118,10 +122,10 @@ static Atom X11_PickTarget(Display *disp, Atom list[], int list_count) Atom request = None; char *name; int i; - for (i=0; i < list_count && request == None; i++) { + for (i = 0; i < list_count && request == None; i++) { name = X11_XGetAtomName(disp, list[i]); if ((SDL_strcmp("text/uri-list", name) == 0) || (SDL_strcmp("text/plain", name) == 0)) { - request = list[i]; + request = list[i]; } X11_XFree(name); } @@ -132,11 +136,17 @@ static Atom X11_PickTarget(Display *disp, Atom list[], int list_count) case in the Xdnd protocol */ static Atom X11_PickTargetFromAtoms(Display *disp, Atom a0, Atom a1, Atom a2) { - int count=0; + int count = 0; Atom atom[3]; - if (a0 != None) atom[count++] = a0; - if (a1 != None) atom[count++] = a1; - if (a2 != None) atom[count++] = a2; + if (a0 != None) { + atom[count++] = a0; + } + if (a1 != None) { + atom[count++] = a1; + } + if (a2 != None) { + atom[count++] = a2; + } return X11_PickTarget(disp, atom, count); } @@ -147,13 +157,12 @@ struct KeyRepeatCheckData }; static Bool X11_KeyRepeatCheckIfEvent(Display *display, XEvent *chkev, - XPointer arg) + XPointer arg) { - struct KeyRepeatCheckData *d = (struct KeyRepeatCheckData *) arg; - if (chkev->type == KeyPress && - chkev->xkey.keycode == d->event->xkey.keycode && - chkev->xkey.time - d->event->xkey.time < 2) + struct KeyRepeatCheckData *d = (struct KeyRepeatCheckData *)arg; + if (chkev->type == KeyPress && chkev->xkey.keycode == d->event->xkey.keycode && chkev->xkey.time - d->event->xkey.time < 2) { d->found = SDL_TRUE; + } return False; } @@ -166,14 +175,13 @@ static SDL_bool X11_KeyRepeat(Display *display, XEvent *event) struct KeyRepeatCheckData d; d.event = event; d.found = SDL_FALSE; - if (X11_XPending(display)) - X11_XCheckIfEvent(display, &dummyev, X11_KeyRepeatCheckIfEvent, - (XPointer) &d); + if (X11_XPending(display)) { + X11_XCheckIfEvent(display, &dummyev, X11_KeyRepeatCheckIfEvent, (XPointer)&d); + } return d.found; } -static SDL_bool -X11_IsWheelEvent(Display * display,XEvent * event,int * xticks,int * yticks) +static SDL_bool X11_IsWheelEvent(Display *display, XEvent *event, int *xticks, int *yticks) { /* according to the xlib docs, no specific mouse wheel events exist. However, the defacto standard is that the vertical wheel is X buttons @@ -181,11 +189,20 @@ X11_IsWheelEvent(Display * display,XEvent * event,int * xticks,int * yticks) /* Xlib defines "Button1" through 5, so we just use literals here. */ switch (event->xbutton.button) { - case 4: *yticks = 1; return SDL_TRUE; - case 5: *yticks = -1; return SDL_TRUE; - case 6: *xticks = 1; return SDL_TRUE; - case 7: *xticks = -1; return SDL_TRUE; - default: break; + case 4: + *yticks = 1; + return SDL_TRUE; + case 5: + *yticks = -1; + return SDL_TRUE; + case 6: + *xticks = 1; + return SDL_TRUE; + case 7: + *xticks = -1; + return SDL_TRUE; + default: + break; } return SDL_FALSE; } @@ -203,10 +220,11 @@ X11_IsWheelEvent(Display * display,XEvent * event,int * xticks,int * yticks) On error, -1 is returned. */ -static int X11_URIDecode(char *buf, int len) { +static int X11_URIDecode(char *buf, int len) +{ int ri, wi, di; char decode = '\0'; - if (buf == NULL || len < 0) { + if (!buf || len < 0) { errno = EINVAL; return -1; } @@ -266,43 +284,47 @@ static int X11_URIDecode(char *buf, int len) { /* Convert URI to local filename return filename if possible, else NULL */ -static char* X11_URIToLocal(char* uri) { +static char *X11_URIToLocal(char *uri) +{ char *file = NULL; SDL_bool local; - if (SDL_memcmp(uri,"file:/",6) == 0) uri += 6; /* local file? */ - else if (SDL_strstr(uri,":/") != NULL) return file; /* wrong scheme */ + if (SDL_memcmp(uri, "file:/", 6) == 0) { + uri += 6; /* local file? */ + } else if (SDL_strstr(uri, ":/") != NULL) { + return file; /* wrong scheme */ + } local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); /* got a hostname? */ if (!local && uri[0] == '/' && uri[2] != '/') { - char* hostname_end = SDL_strchr(uri+1, '/'); - if (hostname_end != NULL) { - char hostname[ 257 ]; - if (gethostname(hostname, 255) == 0) { - hostname[ 256 ] = '\0'; - if (SDL_memcmp(uri+1, hostname, hostname_end - (uri+1)) == 0) { - uri = hostname_end + 1; - local = SDL_TRUE; + char *hostname_end = SDL_strchr(uri + 1, '/'); + if (hostname_end) { + char hostname[257]; + if (gethostname(hostname, 255) == 0) { + hostname[256] = '\0'; + if (SDL_memcmp(uri + 1, hostname, hostname_end - (uri + 1)) == 0) { + uri = hostname_end + 1; + local = SDL_TRUE; + } } - } - } + } } if (local) { - file = uri; - /* Convert URI escape sequences to real characters */ - X11_URIDecode(file, 0); - if (uri[1] == '/') { - file++; - } else { - file--; - } + file = uri; + /* Convert URI escape sequences to real characters */ + X11_URIDecode(file, 0); + if (uri[1] == '/') { + file++; + } else { + file--; + } } return file; } -#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#ifdef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS static void X11_HandleGenericEvent(SDL_VideoData *videodata, XEvent *xev) { /* event is a union, so cookie == &event, but this is type safe. */ @@ -328,10 +350,9 @@ static void X11_HandleGenericEvent(SDL_VideoData *videodata, XEvent *xev) } #endif /* SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS */ -static unsigned -X11_GetNumLockModifierMask(_THIS) +static unsigned X11_GetNumLockModifierMask(_THIS) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; Display *display = viddata->display; unsigned num_mask = 0; int i, j; @@ -340,8 +361,8 @@ X11_GetNumLockModifierMask(_THIS) xmods = X11_XGetModifierMapping(display); n = xmods->max_keypermod; - for(i = 3; i < 8; i++) { - for(j = 0; j < n; j++) { + for (i = 3; i < 8; i++) { + for (j = 0; j < n; j++) { KeyCode kc = xmods->modifiermap[i * n + j]; if (viddata->key_layout[kc] == SDL_SCANCODE_NUMLOCKCLEAR) { num_mask = 1 << i; @@ -354,10 +375,9 @@ X11_GetNumLockModifierMask(_THIS) return num_mask; } -static unsigned -X11_GetScrollLockModifierMask(_THIS) +static unsigned X11_GetScrollLockModifierMask(_THIS) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; Display *display = viddata->display; unsigned num_mask = 0; int i, j; @@ -366,8 +386,8 @@ X11_GetScrollLockModifierMask(_THIS) xmods = X11_XGetModifierMapping(display); n = xmods->max_keypermod; - for(i = 3; i < 8; i++) { - for(j = 0; j < n; j++) { + for (i = 3; i < 8; i++) { + for (j = 0; j < n; j++) { KeyCode kc = xmods->modifiermap[i * n + j]; if (viddata->key_layout[kc] == SDL_SCANCODE_SCROLLLOCK) { num_mask = 1 << i; @@ -380,10 +400,9 @@ X11_GetScrollLockModifierMask(_THIS) return num_mask; } -void -X11_ReconcileKeyboardState(_THIS) +void X11_ReconcileKeyboardState(_THIS) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; Display *display = viddata->display; char keys[32]; int keycode; @@ -396,9 +415,9 @@ X11_ReconcileKeyboardState(_THIS) /* Sync up the keyboard modifier state */ if (X11_XQueryPointer(display, DefaultRootWindow(display), &junk_window, &junk_window, &x, &y, &x, &y, &mask)) { - SDL_ToggleModState(KMOD_CAPS, (mask & LockMask) != 0); - SDL_ToggleModState(KMOD_NUM, (mask & X11_GetNumLockModifierMask(_this)) != 0); - SDL_ToggleModState(KMOD_SCROLL, (mask & X11_GetScrollLockModifierMask(_this)) != 0); + SDL_ToggleModState(KMOD_CAPS, (mask & LockMask) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_NUM, (mask & X11_GetNumLockModifierMask(_this)) ? SDL_TRUE : SDL_FALSE); + SDL_ToggleModState(KMOD_SCROLL, (mask & X11_GetScrollLockModifierMask(_this)) ? SDL_TRUE : SDL_FALSE); } keyboardState = SDL_GetKeyboardState(0); @@ -430,9 +449,7 @@ X11_ReconcileKeyboardState(_THIS) } } - -static void -X11_DispatchFocusIn(_THIS, SDL_WindowData *data) +static void X11_DispatchFocusIn(_THIS, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusIn\n", data); @@ -452,8 +469,7 @@ X11_DispatchFocusIn(_THIS, SDL_WindowData *data) } } -static void -X11_DispatchFocusOut(_THIS, SDL_WindowData *data) +static void X11_DispatchFocusOut(_THIS, SDL_WindowData *data) { #ifdef DEBUG_XEVENTS printf("window %p: Dispatching FocusOut\n", data); @@ -475,8 +491,7 @@ X11_DispatchFocusOut(_THIS, SDL_WindowData *data) #endif } -static void -X11_DispatchMapNotify(SDL_WindowData *data) +static void X11_DispatchMapNotify(SDL_WindowData *data) { SDL_Window *window = data->window; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); @@ -486,18 +501,16 @@ X11_DispatchMapNotify(SDL_WindowData *data) } } -static void -X11_DispatchUnmapNotify(SDL_WindowData *data) +static void X11_DispatchUnmapNotify(SDL_WindowData *data) { SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIDDEN, 0, 0); SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MINIMIZED, 0, 0); } -static void -InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Point *point) +static void InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Point *point) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; - SDL_Window* window = data->window; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; + SDL_Window *window = data->window; Display *display = viddata->display; XEvent evt; @@ -509,8 +522,8 @@ InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Point *point) evt.xclient.window = data->xwindow; evt.xclient.message_type = X11_XInternAtom(display, "_NET_WM_MOVERESIZE", True); evt.xclient.format = 32; - evt.xclient.data.l[0] = window->x + point->x; - evt.xclient.data.l[1] = window->y + point->y; + evt.xclient.data.l[0] = (size_t)window->x + point->x; + evt.xclient.data.l[1] = (size_t)window->y + point->y; evt.xclient.data.l[2] = _NET_WM_MOVERESIZE_MOVE; evt.xclient.data.l[3] = Button1; evt.xclient.data.l[4] = 0; @@ -519,16 +532,16 @@ InitiateWindowMove(_THIS, const SDL_WindowData *data, const SDL_Point *point) X11_XSync(display, 0); } -static void -InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Point *point, int direction) +static void InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Point *point, int direction) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; - SDL_Window* window = data->window; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; + SDL_Window *window = data->window; Display *display = viddata->display; XEvent evt; - if (direction < _NET_WM_MOVERESIZE_SIZE_TOPLEFT || direction > _NET_WM_MOVERESIZE_SIZE_LEFT) + if (direction < _NET_WM_MOVERESIZE_SIZE_TOPLEFT || direction > _NET_WM_MOVERESIZE_SIZE_LEFT) { return; + } /* !!! FIXME: we need to regrab this if necessary when the drag is done. */ X11_XUngrabPointer(display, 0L); @@ -538,8 +551,8 @@ InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Point *point, evt.xclient.window = data->xwindow; evt.xclient.message_type = X11_XInternAtom(display, "_NET_WM_MOVERESIZE", True); evt.xclient.format = 32; - evt.xclient.data.l[0] = window->x + point->x; - evt.xclient.data.l[1] = window->y + point->y; + evt.xclient.data.l[0] = (size_t)window->x + point->x; + evt.xclient.data.l[1] = (size_t)window->y + point->y; evt.xclient.data.l[2] = direction; evt.xclient.data.l[3] = Button1; evt.xclient.data.l[4] = 0; @@ -548,8 +561,7 @@ InitiateWindowResize(_THIS, const SDL_WindowData *data, const SDL_Point *point, X11_XSync(display, 0); } -static SDL_bool -ProcessHitTest(_THIS, const SDL_WindowData *data, const XEvent *xev) +static SDL_bool ProcessHitTest(_THIS, const SDL_WindowData *data, const XEvent *xev) { SDL_Window *window = data->window; @@ -564,37 +576,37 @@ ProcessHitTest(_THIS, const SDL_WindowData *data, const XEvent *xev) }; switch (rc) { - case SDL_HITTEST_DRAGGABLE: - InitiateWindowMove(_this, data, &point); - return SDL_TRUE; - - case SDL_HITTEST_RESIZE_TOPLEFT: - case SDL_HITTEST_RESIZE_TOP: - case SDL_HITTEST_RESIZE_TOPRIGHT: - case SDL_HITTEST_RESIZE_RIGHT: - case SDL_HITTEST_RESIZE_BOTTOMRIGHT: - case SDL_HITTEST_RESIZE_BOTTOM: - case SDL_HITTEST_RESIZE_BOTTOMLEFT: - case SDL_HITTEST_RESIZE_LEFT: - InitiateWindowResize(_this, data, &point, directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); - return SDL_TRUE; - - default: return SDL_FALSE; + case SDL_HITTEST_DRAGGABLE: + InitiateWindowMove(_this, data, &point); + return SDL_TRUE; + + case SDL_HITTEST_RESIZE_TOPLEFT: + case SDL_HITTEST_RESIZE_TOP: + case SDL_HITTEST_RESIZE_TOPRIGHT: + case SDL_HITTEST_RESIZE_RIGHT: + case SDL_HITTEST_RESIZE_BOTTOMRIGHT: + case SDL_HITTEST_RESIZE_BOTTOM: + case SDL_HITTEST_RESIZE_BOTTOMLEFT: + case SDL_HITTEST_RESIZE_LEFT: + InitiateWindowResize(_this, data, &point, directions[rc - SDL_HITTEST_RESIZE_TOPLEFT]); + return SDL_TRUE; + + default: + return SDL_FALSE; } } return SDL_FALSE; } -static void -X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest) +static void X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest) { if (latest && (latest != data->user_time)) { SDL_VideoData *videodata = data->videodata; Display *display = videodata->display; X11_XChangeProperty(display, data->xwindow, videodata->_NET_WM_USER_TIME, XA_CARDINAL, 32, PropModeReplace, - (const unsigned char *) &latest, 1); + (const unsigned char *)&latest, 1); #ifdef DEBUG_XEVENTS printf("window %p: updating _NET_WM_USER_TIME to %lu\n", data, latest); #endif @@ -602,139 +614,150 @@ X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest) } } -static void -X11_HandleClipboardEvent(_THIS, const XEvent *xevent) +static void X11_HandleClipboardEvent(_THIS, const XEvent *xevent) { int i; - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display = videodata->display; SDL_assert(videodata->clipboard_window != None); SDL_assert(xevent->xany.window == videodata->clipboard_window); switch (xevent->type) { - /* Copy the selection from our own CUTBUFFER to the requested property */ - case SelectionRequest: { - const XSelectionRequestEvent *req = &xevent->xselectionrequest; - XEvent sevent; - int seln_format, mime_formats; - unsigned long nbytes; - unsigned long overflow; - unsigned char *seln_data; - Atom supportedFormats[SDL_X11_CLIPBOARD_MIME_TYPE_MAX+1]; - Atom XA_TARGETS = X11_XInternAtom(display, "TARGETS", 0); + /* Copy the selection from our own CUTBUFFER to the requested property */ + case SelectionRequest: + { + const XSelectionRequestEvent *req = &xevent->xselectionrequest; + XEvent sevent; + int seln_format, mime_formats; + unsigned long nbytes; + unsigned long overflow; + unsigned char *seln_data; + Atom supportedFormats[SDL_X11_CLIPBOARD_MIME_TYPE_MAX + 1]; + Atom XA_TARGETS = X11_XInternAtom(display, "TARGETS", 0); #ifdef DEBUG_XEVENTS - printf("window CLIPBOARD: SelectionRequest (requestor = %ld, target = %ld)\n", - req->requestor, req->target); + printf("window CLIPBOARD: SelectionRequest (requestor = %ld, target = %ld)\n", + req->requestor, req->target); #endif - SDL_zero(sevent); - sevent.xany.type = SelectionNotify; - sevent.xselection.selection = req->selection; - sevent.xselection.target = None; - sevent.xselection.property = None; /* tell them no by default */ - sevent.xselection.requestor = req->requestor; - sevent.xselection.time = req->time; - - /* !!! FIXME: We were probably storing this on the root window - because an SDL window might go away...? but we don't have to do - this now (or ever, really). */ - - if (req->target == XA_TARGETS) { - supportedFormats[0] = XA_TARGETS; - mime_formats = 1; - for (i = 0; i < SDL_X11_CLIPBOARD_MIME_TYPE_MAX; ++i) - supportedFormats[mime_formats++] = X11_GetSDLCutBufferClipboardExternalFormat(display, i); - X11_XChangeProperty(display, req->requestor, req->property, - XA_ATOM, 32, PropModeReplace, - (unsigned char*)supportedFormats, - mime_formats); - sevent.xselection.property = req->property; - sevent.xselection.target = XA_TARGETS; - } else { - for (i = 0; i < SDL_X11_CLIPBOARD_MIME_TYPE_MAX; ++i) { - if (X11_GetSDLCutBufferClipboardExternalFormat(display, i) != req->target) - continue; - if (X11_XGetWindowProperty(display, DefaultRootWindow(display), - X11_GetSDLCutBufferClipboardType(display, i, req->selection), 0, INT_MAX/4, False, X11_GetSDLCutBufferClipboardInternalFormat(display, i), - &sevent.xselection.target, &seln_format, &nbytes, - &overflow, &seln_data) == Success) { - if (seln_format != None) { - X11_XChangeProperty(display, req->requestor, req->property, - sevent.xselection.target, seln_format, PropModeReplace, - seln_data, nbytes); - sevent.xselection.property = req->property; - X11_XFree(seln_data); - break; - } else { - X11_XFree(seln_data); - } + SDL_zero(sevent); + sevent.xany.type = SelectionNotify; + sevent.xselection.selection = req->selection; + sevent.xselection.target = None; + sevent.xselection.property = None; /* tell them no by default */ + sevent.xselection.requestor = req->requestor; + sevent.xselection.time = req->time; + + /* !!! FIXME: We were probably storing this on the root window + because an SDL window might go away...? but we don't have to do + this now (or ever, really). */ + + if (req->target == XA_TARGETS) { + supportedFormats[0] = XA_TARGETS; + mime_formats = 1; + for (i = 0; i < SDL_X11_CLIPBOARD_MIME_TYPE_MAX; ++i) { + supportedFormats[mime_formats++] = X11_GetSDLCutBufferClipboardExternalFormat(display, i); + } + X11_XChangeProperty(display, req->requestor, req->property, + XA_ATOM, 32, PropModeReplace, + (unsigned char *)supportedFormats, + mime_formats); + sevent.xselection.property = req->property; + sevent.xselection.target = XA_TARGETS; + } else { + for (i = 0; i < SDL_X11_CLIPBOARD_MIME_TYPE_MAX; ++i) { + if (X11_GetSDLCutBufferClipboardExternalFormat(display, i) != req->target) { + continue; + } + if (X11_XGetWindowProperty(display, DefaultRootWindow(display), + X11_GetSDLCutBufferClipboardType(display, i, req->selection), 0, INT_MAX / 4, False, X11_GetSDLCutBufferClipboardInternalFormat(display, i), + &sevent.xselection.target, &seln_format, &nbytes, + &overflow, &seln_data) == Success) { + if (seln_format != None) { + X11_XChangeProperty(display, req->requestor, req->property, + req->target, 8, PropModeReplace, + seln_data, nbytes); + sevent.xselection.property = req->property; + sevent.xselection.target = req->target; + X11_XFree(seln_data); + break; + } else { + X11_XFree(seln_data); } } } - X11_XSendEvent(display, req->requestor, False, 0, &sevent); - X11_XSync(display, False); } - break; + X11_XSendEvent(display, req->requestor, False, 0, &sevent); + X11_XSync(display, False); + } break; - case SelectionNotify: { + case SelectionNotify: + { #ifdef DEBUG_XEVENTS - printf("window CLIPBOARD: SelectionNotify (requestor = %ld, target = %ld)\n", - xevent->xselection.requestor, xevent->xselection.target); + printf("window CLIPBOARD: SelectionNotify (requestor = %ld, target = %ld)\n", + xevent->xselection.requestor, xevent->xselection.target); #endif - videodata->selection_waiting = SDL_FALSE; - } - break; + videodata->selection_waiting = SDL_FALSE; + } break; - case SelectionClear: { - /* !!! FIXME: cache atoms */ - Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0); + case SelectionClear: + { + /* !!! FIXME: cache atoms */ + Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0); #ifdef DEBUG_XEVENTS - printf("window CLIPBOARD: SelectionClear (requestor = %ld, target = %ld)\n", - xevent->xselection.requestor, xevent->xselection.target); + printf("window CLIPBOARD: SelectionClear (requestor = %ld, target = %ld)\n", + xevent->xselection.requestor, xevent->xselection.target); #endif - if (xevent->xselectionclear.selection == XA_PRIMARY || - (XA_CLIPBOARD != None && xevent->xselectionclear.selection == XA_CLIPBOARD)) { - SDL_SendClipboardUpdate(); - } + if (xevent->xselectionclear.selection == XA_PRIMARY || + (XA_CLIPBOARD != None && xevent->xselectionclear.selection == XA_CLIPBOARD)) { + SDL_SendClipboardUpdate(); } - break; + } break; } } -static Bool -isMapNotify(Display *display, XEvent *ev, XPointer arg) +static Bool isMapNotify(Display *display, XEvent *ev, XPointer arg) { XUnmapEvent *unmap; - unmap = (XUnmapEvent*) arg; + unmap = (XUnmapEvent *)arg; return ev->type == MapNotify && - ev->xmap.window == unmap->window && - ev->xmap.serial == unmap->serial; + ev->xmap.window == unmap->window && + ev->xmap.serial == unmap->serial; } -static Bool -isReparentNotify(Display *display, XEvent *ev, XPointer arg) +static Bool isReparentNotify(Display *display, XEvent *ev, XPointer arg) { XUnmapEvent *unmap; - unmap = (XUnmapEvent*) arg; + unmap = (XUnmapEvent *)arg; return ev->type == ReparentNotify && - ev->xreparent.window == unmap->window && - ev->xreparent.serial == unmap->serial; + ev->xreparent.window == unmap->window && + ev->xreparent.serial == unmap->serial; +} + +static SDL_bool IsHighLatin1(const char *string, int length) +{ + while (length-- > 0) { + Uint8 ch = (Uint8)*string; + if (ch >= 0x80) { + return SDL_TRUE; + } + ++string; + } + return SDL_FALSE; } -static int -XLookupStringAsUTF8(XKeyEvent *event_struct, char *buffer_return, int bytes_buffer, KeySym *keysym_return, XComposeStatus *status_in_out) +static int XLookupStringAsUTF8(XKeyEvent *event_struct, char *buffer_return, int bytes_buffer, KeySym *keysym_return, XComposeStatus *status_in_out) { int result = X11_XLookupString(event_struct, buffer_return, bytes_buffer, keysym_return, status_in_out); - if (result > 0) { - char *utf8_text = SDL_iconv_string("UTF-8", "ISO-8859-1", buffer_return, result); + if (IsHighLatin1(buffer_return, result)) { + char *utf8_text = SDL_iconv_string("UTF-8", "ISO-8859-1", buffer_return, result + 1); if (utf8_text) { SDL_strlcpy(buffer_return, utf8_text, bytes_buffer); SDL_free(utf8_text); @@ -746,10 +769,34 @@ XLookupStringAsUTF8(XKeyEvent *event_struct, char *buffer_return, int bytes_buff return result; } -static void -X11_DispatchEvent(_THIS, XEvent *xevent) +void X11_GetBorderValues(void /* SDL_WindowData */ *data_) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_WindowData *data = (SDL_WindowData *)data_; + SDL_VideoData *videodata = data->videodata; + Display *display = videodata->display; + + Atom type; + int format; + unsigned long nitems, bytes_after; + unsigned char *property; + if (X11_XGetWindowProperty(display, data->xwindow, videodata->_NET_FRAME_EXTENTS, 0, 16, 0, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &property) == Success) { + if (type != None && nitems == 4) { + data->border_left = (int)((long *)property)[0]; + data->border_right = (int)((long *)property)[1]; + data->border_top = (int)((long *)property)[2]; + data->border_bottom = (int)((long *)property)[3]; + } + X11_XFree(property); + +#ifdef DEBUG_XEVENTS + printf("New _NET_FRAME_EXTENTS: left=%d right=%d, top=%d, bottom=%d\n", data->border_left, data->border_right, data->border_top, data->border_bottom); +#endif + } +} + +static void X11_DispatchEvent(_THIS, XEvent *xevent) +{ + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display; SDL_WindowData *data; int orig_event_type; @@ -795,14 +842,14 @@ X11_DispatchEvent(_THIS, XEvent *xevent) return; } -#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS - if(xevent->type == GenericEvent) { +#ifdef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS + if (xevent->type == GenericEvent) { X11_HandleGenericEvent(videodata, xevent); return; } #endif -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR if (videodata->xrandr_event_base && (xevent->type == (videodata->xrandr_event_base + RRNotify))) { X11_HandleXRandREvent(_this, xevent); } @@ -823,6 +870,27 @@ X11_DispatchEvent(_THIS, XEvent *xevent) xevent->type, xevent->xany.display, xevent->xany.window); #endif +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES + if (SDL_X11_HAVE_XFIXES && + xevent->type == X11_GetXFixesSelectionNotifyEvent()) { + XFixesSelectionNotifyEvent *ev = (XFixesSelectionNotifyEvent *) xevent; + + /* !!! FIXME: cache atoms */ + Atom XA_CLIPBOARD = X11_XInternAtom(display, "CLIPBOARD", 0); + +#ifdef DEBUG_XEVENTS + printf("window CLIPBOARD: XFixesSelectionNotify (selection = %s)\n", + X11_XGetAtomName(display, ev->selection)); +#endif + + if (ev->selection == XA_PRIMARY || + (XA_CLIPBOARD != None && ev->selection == XA_CLIPBOARD)) { + SDL_SendClipboardUpdate(); + return; + } + } +#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ + if ((videodata->clipboard_window != None) && (videodata->clipboard_window == xevent->xany.window)) { X11_HandleClipboardEvent(_this, xevent); @@ -861,7 +929,7 @@ X11_DispatchEvent(_THIS, XEvent *xevent) X11_UpdateKeymap(_this, SDL_TRUE); } else if (xevent->type == PropertyNotify && videodata && videodata->windowlist) { - char* name_of_atom = X11_XGetAtomName(display, xevent->xproperty.atom); + char *name_of_atom = X11_XGetAtomName(display, xevent->xproperty.atom); if (SDL_strncmp(name_of_atom, "_ICC_PROFILE", sizeof("_ICC_PROFILE") - 1) == 0) { XWindowAttributes attrib; @@ -884,7 +952,9 @@ X11_DispatchEvent(_THIS, XEvent *xevent) } } - if (name_of_atom) X11_XFree(name_of_atom); + if (name_of_atom) { + X11_XFree(name_of_atom); + } } return; } @@ -892,685 +962,660 @@ X11_DispatchEvent(_THIS, XEvent *xevent) switch (xevent->type) { /* Gaining mouse coverage? */ - case EnterNotify:{ - SDL_Mouse *mouse = SDL_GetMouse(); + case EnterNotify: + { + SDL_Mouse *mouse = SDL_GetMouse(); #ifdef DEBUG_XEVENTS - printf("window %p: EnterNotify! (%d,%d,%d)\n", data, - xevent->xcrossing.x, - xevent->xcrossing.y, - xevent->xcrossing.mode); - if (xevent->xcrossing.mode == NotifyGrab) - printf("Mode: NotifyGrab\n"); - if (xevent->xcrossing.mode == NotifyUngrab) - printf("Mode: NotifyUngrab\n"); + printf("window %p: EnterNotify! (%d,%d,%d)\n", data, + xevent->xcrossing.x, + xevent->xcrossing.y, + xevent->xcrossing.mode); + if (xevent->xcrossing.mode == NotifyGrab) { + printf("Mode: NotifyGrab\n"); + } + if (xevent->xcrossing.mode == NotifyUngrab) { + printf("Mode: NotifyUngrab\n"); + } #endif - SDL_SetMouseFocus(data->window); + SDL_SetMouseFocus(data->window); - mouse->last_x = xevent->xcrossing.x; - mouse->last_y = xevent->xcrossing.y; + mouse->last_x = xevent->xcrossing.x; + mouse->last_y = xevent->xcrossing.y; -#if SDL_VIDEO_DRIVER_X11_XFIXES - { - /* Only create the barriers if we have input focus */ - SDL_WindowData* windowdata = (SDL_WindowData *) data->window->driverdata; - if ((data->pointer_barrier_active == SDL_TRUE) && windowdata->window->flags & SDL_WINDOW_INPUT_FOCUS) { - X11_ConfineCursorWithFlags(_this, windowdata->window, &windowdata->barrier_rect, X11_BARRIER_HANDLED_BY_EVENT); - } +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES + { + /* Only create the barriers if we have input focus */ + SDL_WindowData *windowdata = (SDL_WindowData *)data->window->driverdata; + if ((data->pointer_barrier_active == SDL_TRUE) && windowdata->window->flags & SDL_WINDOW_INPUT_FOCUS) { + X11_ConfineCursorWithFlags(_this, windowdata->window, &windowdata->barrier_rect, X11_BARRIER_HANDLED_BY_EVENT); } + } #endif - if (!mouse->relative_mode) { - SDL_SendMouseMotion(data->window, 0, 0, xevent->xcrossing.x, xevent->xcrossing.y); - } - - /* We ungrab in LeaveNotify, so we may need to grab again here */ - SDL_UpdateWindowGrab(data->window); + if (!mouse->relative_mode) { + SDL_SendMouseMotion(data->window, 0, 0, xevent->xcrossing.x, xevent->xcrossing.y); } - break; + + /* We ungrab in LeaveNotify, so we may need to grab again here */ + SDL_UpdateWindowGrab(data->window); + } break; /* Losing mouse coverage? */ - case LeaveNotify:{ + case LeaveNotify: + { #ifdef DEBUG_XEVENTS - printf("window %p: LeaveNotify! (%d,%d,%d)\n", data, - xevent->xcrossing.x, - xevent->xcrossing.y, - xevent->xcrossing.mode); - if (xevent->xcrossing.mode == NotifyGrab) - printf("Mode: NotifyGrab\n"); - if (xevent->xcrossing.mode == NotifyUngrab) - printf("Mode: NotifyUngrab\n"); + printf("window %p: LeaveNotify! (%d,%d,%d)\n", data, + xevent->xcrossing.x, + xevent->xcrossing.y, + xevent->xcrossing.mode); + if (xevent->xcrossing.mode == NotifyGrab) { + printf("Mode: NotifyGrab\n"); + } + if (xevent->xcrossing.mode == NotifyUngrab) { + printf("Mode: NotifyUngrab\n"); + } #endif - if (!SDL_GetMouse()->relative_mode) { - SDL_SendMouseMotion(data->window, 0, 0, xevent->xcrossing.x, xevent->xcrossing.y); - } + if (!SDL_GetMouse()->relative_mode) { + SDL_SendMouseMotion(data->window, 0, 0, xevent->xcrossing.x, xevent->xcrossing.y); + } - if (xevent->xcrossing.mode != NotifyGrab && - xevent->xcrossing.mode != NotifyUngrab && - xevent->xcrossing.detail != NotifyInferior) { + if (xevent->xcrossing.mode != NotifyGrab && + xevent->xcrossing.mode != NotifyUngrab && + xevent->xcrossing.detail != NotifyInferior) { - /* In order for interaction with the window decorations and menu to work properly - on Mutter, we need to ungrab the keyboard when the the mouse leaves. */ - if (!(data->window->flags & SDL_WINDOW_FULLSCREEN)) { - X11_SetWindowKeyboardGrab(_this, data->window, SDL_FALSE); - } - - SDL_SetMouseFocus(NULL); + /* In order for interaction with the window decorations and menu to work properly + on Mutter, we need to ungrab the keyboard when the the mouse leaves. */ + if (!(data->window->flags & SDL_WINDOW_FULLSCREEN)) { + X11_SetWindowKeyboardGrab(_this, data->window, SDL_FALSE); } + + SDL_SetMouseFocus(NULL); } - break; + } break; /* Gaining input focus? */ - case FocusIn:{ - if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) { - /* Someone is handling a global hotkey, ignore it */ + case FocusIn: + { + if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) { + /* Someone is handling a global hotkey, ignore it */ #ifdef DEBUG_XEVENTS - printf("window %p: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", data); + printf("window %p: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", data); #endif - break; - } + break; + } - if (xevent->xfocus.detail == NotifyInferior || xevent->xfocus.detail == NotifyPointer) { + if (xevent->xfocus.detail == NotifyInferior || xevent->xfocus.detail == NotifyPointer) { #ifdef DEBUG_XEVENTS - printf("window %p: FocusIn (NotifyInferior/NotifyPointer, ignoring)\n", data); + printf("window %p: FocusIn (NotifyInferior/NotifyPointer, ignoring)\n", data); #endif - break; - } + break; + } #ifdef DEBUG_XEVENTS - printf("window %p: FocusIn!\n", data); + printf("window %p: FocusIn!\n", data); #endif - if (!videodata->last_mode_change_deadline) /* no recent mode changes */ - { - data->pending_focus = PENDING_FOCUS_NONE; - data->pending_focus_time = 0; - X11_DispatchFocusIn(_this, data); - } - else - { - data->pending_focus = PENDING_FOCUS_IN; - data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; - } - data->last_focus_event_time = SDL_GetTicks(); + if (!videodata->last_mode_change_deadline) /* no recent mode changes */ { + data->pending_focus = PENDING_FOCUS_NONE; + data->pending_focus_time = 0; + X11_DispatchFocusIn(_this, data); + } else { + data->pending_focus = PENDING_FOCUS_IN; + data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; } - break; + data->last_focus_event_time = SDL_GetTicks(); + } break; /* Losing input focus? */ - case FocusOut:{ - if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) { - /* Someone is handling a global hotkey, ignore it */ + case FocusOut: + { + if (xevent->xfocus.mode == NotifyGrab || xevent->xfocus.mode == NotifyUngrab) { + /* Someone is handling a global hotkey, ignore it */ #ifdef DEBUG_XEVENTS - printf("window %p: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", data); + printf("window %p: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", data); #endif - break; - } - if (xevent->xfocus.detail == NotifyInferior || xevent->xfocus.detail == NotifyPointer) { - /* We still have focus if a child gets focus. We also don't - care about the position of the pointer when the keyboard - focus changed. */ + break; + } + if (xevent->xfocus.detail == NotifyInferior || xevent->xfocus.detail == NotifyPointer) { + /* We still have focus if a child gets focus. We also don't + care about the position of the pointer when the keyboard + focus changed. */ #ifdef DEBUG_XEVENTS - printf("window %p: FocusOut (NotifyInferior/NotifyPointer, ignoring)\n", data); + printf("window %p: FocusOut (NotifyInferior/NotifyPointer, ignoring)\n", data); #endif - break; - } + break; + } #ifdef DEBUG_XEVENTS - printf("window %p: FocusOut!\n", data); + printf("window %p: FocusOut!\n", data); #endif - if (!videodata->last_mode_change_deadline) /* no recent mode changes */ - { - data->pending_focus = PENDING_FOCUS_NONE; - data->pending_focus_time = 0; - X11_DispatchFocusOut(_this, data); - } - else - { - data->pending_focus = PENDING_FOCUS_OUT; - data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; - } + if (!videodata->last_mode_change_deadline) /* no recent mode changes */ { + data->pending_focus = PENDING_FOCUS_NONE; + data->pending_focus_time = 0; + X11_DispatchFocusOut(_this, data); + } else { + data->pending_focus = PENDING_FOCUS_OUT; + data->pending_focus_time = SDL_GetTicks() + PENDING_FOCUS_TIME; + } -#if SDL_VIDEO_DRIVER_X11_XFIXES - /* Disable confinement if it is activated. */ - if (data->pointer_barrier_active == SDL_TRUE) { - X11_ConfineCursorWithFlags(_this, data->window, NULL, X11_BARRIER_HANDLED_BY_EVENT); - } -#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES + /* Disable confinement if it is activated. */ + if (data->pointer_barrier_active == SDL_TRUE) { + X11_ConfineCursorWithFlags(_this, data->window, NULL, X11_BARRIER_HANDLED_BY_EVENT); } - break; +#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ + } break; /* Key press/release? */ case KeyPress: - case KeyRelease: { - KeyCode keycode = xevent->xkey.keycode; - KeySym keysym = NoSymbol; - char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; - Status status = 0; - SDL_bool handled_by_ime = SDL_FALSE; + case KeyRelease: + { + KeyCode keycode = xevent->xkey.keycode; + KeySym keysym = NoSymbol; + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; + Status status = 0; + SDL_bool handled_by_ime = SDL_FALSE; #ifdef DEBUG_XEVENTS - printf("window %p: %s (X11 keycode = 0x%X)\n", data, (xevent->type == KeyPress ? "KeyPress" : "KeyRelease"), xevent->xkey.keycode); + printf("window %p: %s (X11 keycode = 0x%X)\n", data, (xevent->type == KeyPress ? "KeyPress" : "KeyRelease"), xevent->xkey.keycode); #endif #ifdef DEBUG_SCANCODES - if (videodata->key_layout[keycode] == SDL_SCANCODE_UNKNOWN && keycode) { - int min_keycode, max_keycode; - X11_XDisplayKeycodes(display, &min_keycode, &max_keycode); - keysym = X11_KeyCodeToSym(_this, keycode, xevent->xkey.state >> 13); - SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n", - keycode, keycode - min_keycode, keysym, - X11_XKeysymToString(keysym)); - } + if (videodata->key_layout[keycode] == SDL_SCANCODE_UNKNOWN && keycode) { + int min_keycode, max_keycode; + X11_XDisplayKeycodes(display, &min_keycode, &max_keycode); + keysym = X11_KeyCodeToSym(_this, keycode, xevent->xkey.state >> 13); + SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n", + keycode, keycode - min_keycode, keysym, + X11_XKeysymToString(keysym)); + } #endif /* DEBUG SCANCODES */ - SDL_zeroa(text); + SDL_zeroa(text); #ifdef X_HAVE_UTF8_STRING - if (data->ic && xevent->type == KeyPress) { - X11_Xutf8LookupString(data->ic, &xevent->xkey, text, sizeof(text), + if (data->ic && xevent->type == KeyPress) { + X11_Xutf8LookupString(data->ic, &xevent->xkey, text, sizeof(text), &keysym, &status); - } else { - XLookupStringAsUTF8(&xevent->xkey, text, sizeof(text), &keysym, NULL); - } -#else + } else { XLookupStringAsUTF8(&xevent->xkey, text, sizeof(text), &keysym, NULL); + } +#else + XLookupStringAsUTF8(&xevent->xkey, text, sizeof(text), &keysym, NULL); #endif #ifdef SDL_USE_IME - if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ - handled_by_ime = SDL_IME_ProcessKeyEvent(keysym, keycode, (xevent->type == KeyPress ? SDL_PRESSED : SDL_RELEASED)); - } + if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { + handled_by_ime = SDL_IME_ProcessKeyEvent(keysym, keycode, (xevent->type == KeyPress ? SDL_PRESSED : SDL_RELEASED)); + } #endif - if (!handled_by_ime) { - if (xevent->type == KeyPress) { - /* Don't send the key if it looks like a duplicate of a filtered key sent by an IME */ - if (xevent->xkey.keycode != videodata->filter_code || xevent->xkey.time != videodata->filter_time) { - SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); - } - if (*text) { - SDL_SendKeyboardText(text); - } - } else { - if (X11_KeyRepeat(display, xevent)) { - /* We're about to get a repeated key down, ignore the key up */ - break; - } - SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]); + if (!handled_by_ime) { + if (xevent->type == KeyPress) { + /* Don't send the key if it looks like a duplicate of a filtered key sent by an IME */ + if (xevent->xkey.keycode != videodata->filter_code || xevent->xkey.time != videodata->filter_time) { + SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); + } + if (*text) { + SDL_SendKeyboardText(text); + } + } else { + if (X11_KeyRepeat(display, xevent)) { + /* We're about to get a repeated key down, ignore the key up */ + break; } + SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]); } + } - if (xevent->type == KeyPress) { - X11_UpdateUserTime(data, xevent->xkey.time); - } + if (xevent->type == KeyPress) { + X11_UpdateUserTime(data, xevent->xkey.time); } - break; + } break; /* Have we been iconified? */ - case UnmapNotify:{ - XEvent ev; + case UnmapNotify: + { + XEvent ev; #ifdef DEBUG_XEVENTS - printf("window %p: UnmapNotify!\n", data); + printf("window %p: UnmapNotify!\n", data); #endif - if (X11_XCheckIfEvent(display, &ev, &isReparentNotify, (XPointer)&xevent->xunmap)) { - X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&xevent->xunmap); - } else { - X11_DispatchUnmapNotify(data); - } + if (X11_XCheckIfEvent(display, &ev, &isReparentNotify, (XPointer)&xevent->xunmap)) { + X11_XCheckIfEvent(display, &ev, &isMapNotify, (XPointer)&xevent->xunmap); + } else { + X11_DispatchUnmapNotify(data); + } -#if SDL_VIDEO_DRIVER_X11_XFIXES - /* Disable confinement if the window gets hidden. */ - if (data->pointer_barrier_active == SDL_TRUE) { - X11_ConfineCursorWithFlags(_this, data->window, NULL, X11_BARRIER_HANDLED_BY_EVENT); - } -#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES + /* Disable confinement if the window gets hidden. */ + if (data->pointer_barrier_active == SDL_TRUE) { + X11_ConfineCursorWithFlags(_this, data->window, NULL, X11_BARRIER_HANDLED_BY_EVENT); } - break; +#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ + } break; /* Have we been restored? */ - case MapNotify:{ + case MapNotify: + { #ifdef DEBUG_XEVENTS - printf("window %p: MapNotify!\n", data); + printf("window %p: MapNotify!\n", data); #endif - X11_DispatchMapNotify(data); + X11_DispatchMapNotify(data); -#if SDL_VIDEO_DRIVER_X11_XFIXES - /* Enable confinement if it was activated. */ - if (data->pointer_barrier_active == SDL_TRUE) { - X11_ConfineCursorWithFlags(_this, data->window, &data->barrier_rect, X11_BARRIER_HANDLED_BY_EVENT); - } -#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES + /* Enable confinement if it was activated. */ + if (data->pointer_barrier_active == SDL_TRUE) { + X11_ConfineCursorWithFlags(_this, data->window, &data->barrier_rect, X11_BARRIER_HANDLED_BY_EVENT); } - break; +#endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ + } break; /* Have we been resized or moved? */ - case ConfigureNotify:{ + case ConfigureNotify: + { #ifdef DEBUG_XEVENTS - printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data, - xevent->xconfigure.x, xevent->xconfigure.y, - xevent->xconfigure.width, xevent->xconfigure.height); + printf("window %p: ConfigureNotify! (position: %d,%d, size: %dx%d)\n", data, + xevent->xconfigure.x, xevent->xconfigure.y, + xevent->xconfigure.width, xevent->xconfigure.height); #endif - /* Real configure notify events are relative to the parent, synthetic events are absolute. */ - if (!xevent->xconfigure.send_event) { - unsigned int NumChildren; - Window ChildReturn, Root, Parent; - Window * Children; - /* Translate these coodinates back to relative to root */ - X11_XQueryTree(data->videodata->display, xevent->xconfigure.window, &Root, &Parent, &Children, &NumChildren); - X11_XTranslateCoordinates(xevent->xconfigure.display, - Parent, DefaultRootWindow(xevent->xconfigure.display), - xevent->xconfigure.x, xevent->xconfigure.y, - &xevent->xconfigure.x, &xevent->xconfigure.y, - &ChildReturn); - } + /* Real configure notify events are relative to the parent, synthetic events are absolute. */ + if (!xevent->xconfigure.send_event) { + unsigned int NumChildren; + Window ChildReturn, Root, Parent; + Window *Children; + /* Translate these coodinates back to relative to root */ + X11_XQueryTree(data->videodata->display, xevent->xconfigure.window, &Root, &Parent, &Children, &NumChildren); + X11_XTranslateCoordinates(xevent->xconfigure.display, + Parent, DefaultRootWindow(xevent->xconfigure.display), + xevent->xconfigure.x, xevent->xconfigure.y, + &xevent->xconfigure.x, &xevent->xconfigure.y, + &ChildReturn); + } - if (xevent->xconfigure.x != data->last_xconfigure.x || - xevent->xconfigure.y != data->last_xconfigure.y) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, - xevent->xconfigure.x, xevent->xconfigure.y); + if (xevent->xconfigure.x != data->last_xconfigure.x || + xevent->xconfigure.y != data->last_xconfigure.y) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, + xevent->xconfigure.x, xevent->xconfigure.y); #ifdef SDL_USE_IME - if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ - /* Update IME candidate list position */ - SDL_IME_UpdateTextRect(NULL); - } -#endif - } - if (xevent->xconfigure.width != data->last_xconfigure.width || - xevent->xconfigure.height != data->last_xconfigure.height) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, - xevent->xconfigure.width, - xevent->xconfigure.height); + if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { + /* Update IME candidate list position */ + SDL_IME_UpdateTextRect(NULL); } - data->last_xconfigure = xevent->xconfigure; +#endif } - break; + if (xevent->xconfigure.width != data->last_xconfigure.width || + xevent->xconfigure.height != data->last_xconfigure.height) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, + xevent->xconfigure.width, + xevent->xconfigure.height); + } + data->last_xconfigure = xevent->xconfigure; + } break; /* Have we been requested to quit (or another client message?) */ - case ClientMessage:{ + case ClientMessage: + { - static int xdnd_version=0; + static int xdnd_version = 0; - if (xevent->xclient.message_type == videodata->XdndEnter) { + if (xevent->xclient.message_type == videodata->XdndEnter) { - SDL_bool use_list = xevent->xclient.data.l[1] & 1; - data->xdnd_source = xevent->xclient.data.l[0]; - xdnd_version = (xevent->xclient.data.l[1] >> 24); + SDL_bool use_list = xevent->xclient.data.l[1] & 1; + data->xdnd_source = xevent->xclient.data.l[0]; + xdnd_version = (xevent->xclient.data.l[1] >> 24); #ifdef DEBUG_XEVENTS - printf("XID of source window : %ld\n", data->xdnd_source); - printf("Protocol version to use : %d\n", xdnd_version); - printf("More then 3 data types : %d\n", (int) use_list); + printf("XID of source window : %ld\n", data->xdnd_source); + printf("Protocol version to use : %d\n", xdnd_version); + printf("More then 3 data types : %d\n", (int)use_list); #endif - if (use_list) { - /* fetch conversion targets */ - SDL_x11Prop p; - X11_ReadProperty(&p, display, data->xdnd_source, videodata->XdndTypeList); - /* pick one */ - data->xdnd_req = X11_PickTarget(display, (Atom*)p.data, p.count); - X11_XFree(p.data); - } else { - /* pick from list of three */ - data->xdnd_req = X11_PickTargetFromAtoms(display, xevent->xclient.data.l[2], xevent->xclient.data.l[3], xevent->xclient.data.l[4]); - } + if (use_list) { + /* fetch conversion targets */ + SDL_x11Prop p; + X11_ReadProperty(&p, display, data->xdnd_source, videodata->XdndTypeList); + /* pick one */ + data->xdnd_req = X11_PickTarget(display, (Atom *)p.data, p.count); + X11_XFree(p.data); + } else { + /* pick from list of three */ + data->xdnd_req = X11_PickTargetFromAtoms(display, xevent->xclient.data.l[2], xevent->xclient.data.l[3], xevent->xclient.data.l[4]); } - else if (xevent->xclient.message_type == videodata->XdndPosition) { + } else if (xevent->xclient.message_type == videodata->XdndPosition) { #ifdef DEBUG_XEVENTS - Atom act= videodata->XdndActionCopy; - if(xdnd_version >= 2) { - act = xevent->xclient.data.l[4]; - } - printf("Action requested by user is : %s\n", X11_XGetAtomName(display , act)); + Atom act = videodata->XdndActionCopy; + if (xdnd_version >= 2) { + act = xevent->xclient.data.l[4]; + } + printf("Action requested by user is : %s\n", X11_XGetAtomName(display, act)); #endif - - /* reply with status */ + /* reply with status */ + SDL_memset(&m, 0, sizeof(XClientMessageEvent)); + m.type = ClientMessage; + m.display = xevent->xclient.display; + m.window = xevent->xclient.data.l[0]; + m.message_type = videodata->XdndStatus; + m.format = 32; + m.data.l[0] = data->xwindow; + m.data.l[1] = (data->xdnd_req != None); + m.data.l[2] = 0; /* specify an empty rectangle */ + m.data.l[3] = 0; + m.data.l[4] = videodata->XdndActionCopy; /* we only accept copying anyway */ + + X11_XSendEvent(display, xevent->xclient.data.l[0], False, NoEventMask, (XEvent *)&m); + X11_XFlush(display); + } else if (xevent->xclient.message_type == videodata->XdndDrop) { + if (data->xdnd_req == None) { + /* say again - not interested! */ SDL_memset(&m, 0, sizeof(XClientMessageEvent)); m.type = ClientMessage; m.display = xevent->xclient.display; m.window = xevent->xclient.data.l[0]; - m.message_type = videodata->XdndStatus; - m.format=32; + m.message_type = videodata->XdndFinished; + m.format = 32; m.data.l[0] = data->xwindow; - m.data.l[1] = (data->xdnd_req != None); - m.data.l[2] = 0; /* specify an empty rectangle */ - m.data.l[3] = 0; - m.data.l[4] = videodata->XdndActionCopy; /* we only accept copying anyway */ - - X11_XSendEvent(display, xevent->xclient.data.l[0], False, NoEventMask, (XEvent*)&m); - X11_XFlush(display); - } - else if(xevent->xclient.message_type == videodata->XdndDrop) { - if (data->xdnd_req == None) { - /* say again - not interested! */ - SDL_memset(&m, 0, sizeof(XClientMessageEvent)); - m.type = ClientMessage; - m.display = xevent->xclient.display; - m.window = xevent->xclient.data.l[0]; - m.message_type = videodata->XdndFinished; - m.format=32; - m.data.l[0] = data->xwindow; - m.data.l[1] = 0; - m.data.l[2] = None; /* fail! */ - X11_XSendEvent(display, xevent->xclient.data.l[0], False, NoEventMask, (XEvent*)&m); + m.data.l[1] = 0; + m.data.l[2] = None; /* fail! */ + X11_XSendEvent(display, xevent->xclient.data.l[0], False, NoEventMask, (XEvent *)&m); + } else { + /* convert */ + if (xdnd_version >= 1) { + X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, xevent->xclient.data.l[2]); } else { - /* convert */ - if(xdnd_version >= 1) { - X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, xevent->xclient.data.l[2]); - } else { - X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, CurrentTime); - } + X11_XConvertSelection(display, videodata->XdndSelection, data->xdnd_req, videodata->PRIMARY, data->xwindow, CurrentTime); } } - else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && - (xevent->xclient.format == 32) && - (xevent->xclient.data.l[0] == videodata->_NET_WM_PING)) { - Window root = DefaultRootWindow(display); + } else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && + (xevent->xclient.format == 32) && + (xevent->xclient.data.l[0] == videodata->_NET_WM_PING)) { + Window root = DefaultRootWindow(display); #ifdef DEBUG_XEVENTS - printf("window %p: _NET_WM_PING\n", data); + printf("window %p: _NET_WM_PING\n", data); #endif - xevent->xclient.window = root; - X11_XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, xevent); - break; - } + xevent->xclient.window = root; + X11_XSendEvent(display, root, False, SubstructureRedirectMask | SubstructureNotifyMask, xevent); + break; + } - else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && - (xevent->xclient.format == 32) && - (xevent->xclient.data.l[0] == videodata->WM_DELETE_WINDOW)) { + else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && + (xevent->xclient.format == 32) && + (xevent->xclient.data.l[0] == videodata->WM_DELETE_WINDOW)) { #ifdef DEBUG_XEVENTS - printf("window %p: WM_DELETE_WINDOW\n", data); + printf("window %p: WM_DELETE_WINDOW\n", data); #endif - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); - break; - } - else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && - (xevent->xclient.format == 32) && - (xevent->xclient.data.l[0] == videodata->WM_TAKE_FOCUS)) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); + break; + } else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && + (xevent->xclient.format == 32) && + (xevent->xclient.data.l[0] == videodata->WM_TAKE_FOCUS)) { #ifdef DEBUG_XEVENTS - printf("window %p: WM_TAKE_FOCUS\n", data); + printf("window %p: WM_TAKE_FOCUS\n", data); #endif - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_TAKE_FOCUS, 0, 0); - break; - } + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_TAKE_FOCUS, 0, 0); + break; } - break; + } break; /* Do we need to refresh ourselves? */ - case Expose:{ + case Expose: + { #ifdef DEBUG_XEVENTS - printf("window %p: Expose (count = %d)\n", data, xevent->xexpose.count); + printf("window %p: Expose (count = %d)\n", data, xevent->xexpose.count); #endif - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0); - } - break; + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_EXPOSED, 0, 0); + } break; - case MotionNotify:{ - SDL_Mouse *mouse = SDL_GetMouse(); - if(!mouse->relative_mode || mouse->relative_mode_warp) { + case MotionNotify: + { + SDL_Mouse *mouse = SDL_GetMouse(); + if (!mouse->relative_mode || mouse->relative_mode_warp) { #ifdef DEBUG_MOTION - printf("window %p: X11 motion: %d,%d\n", data, xevent->xmotion.x, xevent->xmotion.y); + printf("window %p: X11 motion: %d,%d\n", data, xevent->xmotion.x, xevent->xmotion.y); #endif - SDL_SendMouseMotion(data->window, 0, 0, xevent->xmotion.x, xevent->xmotion.y); - } + SDL_SendMouseMotion(data->window, 0, 0, xevent->xmotion.x, xevent->xmotion.y); } - break; + } break; - case ButtonPress:{ - int xticks = 0, yticks = 0; + case ButtonPress: + { + int xticks = 0, yticks = 0; #ifdef DEBUG_XEVENTS - printf("window %p: ButtonPress (X11 button = %d)\n", data, xevent->xbutton.button); + printf("window %p: ButtonPress (X11 button = %d)\n", data, xevent->xbutton.button); #endif - if (X11_IsWheelEvent(display,xevent,&xticks, &yticks)) { - SDL_SendMouseWheel(data->window, 0, (float) -xticks, (float) yticks, SDL_MOUSEWHEEL_NORMAL); - } else { - SDL_bool ignore_click = SDL_FALSE; - int button = xevent->xbutton.button; - if(button == Button1) { - if (ProcessHitTest(_this, data, xevent)) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIT_TEST, 0, 0); - break; /* don't pass this event on to app. */ - } - } - else if(button > 7) { - /* X button values 4-7 are used for scrolling, so X1 is 8, X2 is 9, ... - => subtract (8-SDL_BUTTON_X1) to get value SDL expects */ - button -= (8-SDL_BUTTON_X1); - } - if (data->last_focus_event_time) { - const int X11_FOCUS_CLICK_TIMEOUT = 10; - if (!SDL_TICKS_PASSED(SDL_GetTicks(), data->last_focus_event_time + X11_FOCUS_CLICK_TIMEOUT)) { - ignore_click = !SDL_GetHintBoolean(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, SDL_FALSE); - } - data->last_focus_event_time = 0; + if (X11_IsWheelEvent(display, xevent, &xticks, &yticks)) { + SDL_SendMouseWheel(data->window, 0, (float)-xticks, (float)yticks, SDL_MOUSEWHEEL_NORMAL); + } else { + SDL_bool ignore_click = SDL_FALSE; + int button = xevent->xbutton.button; + if (button == Button1) { + if (ProcessHitTest(_this, data, xevent)) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_HIT_TEST, 0, 0); + break; /* don't pass this event on to app. */ } - if (!ignore_click) { - SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); + } else if (button > 7) { + /* X button values 4-7 are used for scrolling, so X1 is 8, X2 is 9, ... + => subtract (8-SDL_BUTTON_X1) to get value SDL expects */ + button -= (8 - SDL_BUTTON_X1); + } + if (data->last_focus_event_time) { + const int X11_FOCUS_CLICK_TIMEOUT = 10; + if (!SDL_TICKS_PASSED(SDL_GetTicks(), data->last_focus_event_time + X11_FOCUS_CLICK_TIMEOUT)) { + ignore_click = !SDL_GetHintBoolean(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, SDL_FALSE); } + data->last_focus_event_time = 0; + } + if (!ignore_click) { + SDL_SendMouseButton(data->window, 0, SDL_PRESSED, button); } - X11_UpdateUserTime(data, xevent->xbutton.time); } - break; - - case ButtonRelease:{ - int button = xevent->xbutton.button; - /* The X server sends a Release event for each Press for wheels. Ignore them. */ - int xticks = 0, yticks = 0; + X11_UpdateUserTime(data, xevent->xbutton.time); + } break; + + case ButtonRelease: + { + int button = xevent->xbutton.button; + /* The X server sends a Release event for each Press for wheels. Ignore them. */ + int xticks = 0, yticks = 0; #ifdef DEBUG_XEVENTS - printf("window %p: ButtonRelease (X11 button = %d)\n", data, xevent->xbutton.button); + printf("window %p: ButtonRelease (X11 button = %d)\n", data, xevent->xbutton.button); #endif - if (!X11_IsWheelEvent(display, xevent, &xticks, &yticks)) { - if (button > 7) { - /* see explanation at case ButtonPress */ - button -= (8-SDL_BUTTON_X1); - } - SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); + if (!X11_IsWheelEvent(display, xevent, &xticks, &yticks)) { + if (button > 7) { + /* see explanation at case ButtonPress */ + button -= (8 - SDL_BUTTON_X1); } + SDL_SendMouseButton(data->window, 0, SDL_RELEASED, button); } - break; + } break; - case PropertyNotify:{ + case PropertyNotify: + { #ifdef DEBUG_XEVENTS - unsigned char *propdata; - int status, real_format; - Atom real_type; - unsigned long items_read, items_left; - - char *name = X11_XGetAtomName(display, xevent->xproperty.atom); - if (name) { - printf("window %p: PropertyNotify: %s %s time=%lu\n", data, name, (xevent->xproperty.state == PropertyDelete) ? "deleted" : "changed", xevent->xproperty.time); - X11_XFree(name); - } + unsigned char *propdata; + int status, real_format; + Atom real_type; + unsigned long items_read, items_left; + + char *name = X11_XGetAtomName(display, xevent->xproperty.atom); + if (name) { + printf("window %p: PropertyNotify: %s %s time=%lu\n", data, name, (xevent->xproperty.state == PropertyDelete) ? "deleted" : "changed", xevent->xproperty.time); + X11_XFree(name); + } + + status = X11_XGetWindowProperty(display, data->xwindow, xevent->xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata); + if (status == Success && items_read > 0) { + if (real_type == XA_INTEGER) { + int *values = (int *)propdata; - status = X11_XGetWindowProperty(display, data->xwindow, xevent->xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata); - if (status == Success && items_read > 0) { - if (real_type == XA_INTEGER) { - int *values = (int *)propdata; + printf("{"); + for (i = 0; i < items_read; i++) { + printf(" %d", values[i]); + } + printf(" }\n"); + } else if (real_type == XA_CARDINAL) { + if (real_format == 32) { + Uint32 *values = (Uint32 *)propdata; printf("{"); for (i = 0; i < items_read; i++) { printf(" %d", values[i]); } printf(" }\n"); - } else if (real_type == XA_CARDINAL) { - if (real_format == 32) { - Uint32 *values = (Uint32 *)propdata; - - printf("{"); - for (i = 0; i < items_read; i++) { - printf(" %d", values[i]); - } - printf(" }\n"); - } else if (real_format == 16) { - Uint16 *values = (Uint16 *)propdata; - - printf("{"); - for (i = 0; i < items_read; i++) { - printf(" %d", values[i]); - } - printf(" }\n"); - } else if (real_format == 8) { - Uint8 *values = (Uint8 *)propdata; + } else if (real_format == 16) { + Uint16 *values = (Uint16 *)propdata; - printf("{"); - for (i = 0; i < items_read; i++) { - printf(" %d", values[i]); - } - printf(" }\n"); + printf("{"); + for (i = 0; i < items_read; i++) { + printf(" %d", values[i]); } - } else if (real_type == XA_STRING || - real_type == videodata->UTF8_STRING) { - printf("{ \"%s\" }\n", propdata); - } else if (real_type == XA_ATOM) { - Atom *atoms = (Atom *)propdata; + printf(" }\n"); + } else if (real_format == 8) { + Uint8 *values = (Uint8 *)propdata; printf("{"); for (i = 0; i < items_read; i++) { - char *atomname = X11_XGetAtomName(display, atoms[i]); - if (atomname) { - printf(" %s", atomname); - X11_XFree(atomname); - } + printf(" %d", values[i]); } printf(" }\n"); - } else { - char *atomname = X11_XGetAtomName(display, real_type); - printf("Unknown type: %ld (%s)\n", real_type, atomname ? atomname : "UNKNOWN"); + } + } else if (real_type == XA_STRING || + real_type == videodata->UTF8_STRING) { + printf("{ \"%s\" }\n", propdata); + } else if (real_type == XA_ATOM) { + Atom *atoms = (Atom *)propdata; + + printf("{"); + for (i = 0; i < items_read; i++) { + char *atomname = X11_XGetAtomName(display, atoms[i]); if (atomname) { + printf(" %s", atomname); X11_XFree(atomname); } } + printf(" }\n"); + } else { + char *atomname = X11_XGetAtomName(display, real_type); + printf("Unknown type: %ld (%s)\n", real_type, atomname ? atomname : "UNKNOWN"); + if (atomname) { + X11_XFree(atomname); + } } - if (status == Success) { - X11_XFree(propdata); - } + } + if (status == Success) { + X11_XFree(propdata); + } #endif /* DEBUG_XEVENTS */ - /* Take advantage of this moment to make sure user_time has a - valid timestamp from the X server, so if we later try to - raise/restore this window, _NET_ACTIVE_WINDOW can have a - non-zero timestamp, even if there's never been a mouse or - key press to this window so far. Note that we don't try to - set _NET_WM_USER_TIME here, though. That's only for legit - user interaction with the window. */ - if (!data->user_time) { - data->user_time = xevent->xproperty.time; - } - - if (xevent->xproperty.atom == data->videodata->_NET_WM_STATE) { - /* Get the new state from the window manager. - Compositing window managers can alter visibility of windows - without ever mapping / unmapping them, so we handle that here, - because they use the NETWM protocol to notify us of changes. - */ - const Uint32 flags = X11_GetNetWMState(_this, data->window, xevent->xproperty.window); - const Uint32 changed = flags ^ data->window->flags; - - if ((changed & SDL_WINDOW_HIDDEN) || (changed & SDL_WINDOW_FULLSCREEN)) { - if (flags & SDL_WINDOW_HIDDEN) { - X11_DispatchUnmapNotify(data); - } else { - X11_DispatchMapNotify(data); - } - } + /* Take advantage of this moment to make sure user_time has a + valid timestamp from the X server, so if we later try to + raise/restore this window, _NET_ACTIVE_WINDOW can have a + non-zero timestamp, even if there's never been a mouse or + key press to this window so far. Note that we don't try to + set _NET_WM_USER_TIME here, though. That's only for legit + user interaction with the window. */ + if (!data->user_time) { + data->user_time = xevent->xproperty.time; + } - if (changed & SDL_WINDOW_MAXIMIZED) { - if (flags & SDL_WINDOW_MAXIMIZED) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); - } else { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); - } + if (xevent->xproperty.atom == data->videodata->_NET_WM_STATE) { + /* Get the new state from the window manager. + Compositing window managers can alter visibility of windows + without ever mapping / unmapping them, so we handle that here, + because they use the NETWM protocol to notify us of changes. + */ + const Uint32 flags = X11_GetNetWMState(_this, data->window, xevent->xproperty.window); + const Uint32 changed = flags ^ data->window->flags; + + if ((changed & SDL_WINDOW_HIDDEN) || (changed & SDL_WINDOW_FULLSCREEN)) { + if (flags & SDL_WINDOW_HIDDEN) { + X11_DispatchUnmapNotify(data); + } else { + X11_DispatchMapNotify(data); } - } else if (xevent->xproperty.atom == videodata->XKLAVIER_STATE) { - /* Hack for Ubuntu 12.04 (etc) that doesn't send MappingNotify - events when the keyboard layout changes (for example, - changing from English to French on the menubar's keyboard - icon). Since it changes the XKLAVIER_STATE property, we - notice and reinit our keymap here. This might not be the - right approach, but it seems to work. */ - X11_UpdateKeymap(_this, SDL_TRUE); - } else if (xevent->xproperty.atom == videodata->_NET_FRAME_EXTENTS) { - Atom type; - int format; - unsigned long nitems, bytes_after; - unsigned char *property; - if (X11_XGetWindowProperty(display, data->xwindow, videodata->_NET_FRAME_EXTENTS, 0, 16, 0, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &property) == Success) { - if (type != None && nitems == 4) { - data->border_left = (int) ((long*)property)[0]; - data->border_right = (int) ((long*)property)[1]; - data->border_top = (int) ((long*)property)[2]; - data->border_bottom = (int) ((long*)property)[3]; - } - X11_XFree(property); + } - #ifdef DEBUG_XEVENTS - printf("New _NET_FRAME_EXTENTS: left=%d right=%d, top=%d, bottom=%d\n", data->border_left, data->border_right, data->border_top, data->border_bottom); - #endif + if (changed & SDL_WINDOW_MAXIMIZED) { + if (flags & SDL_WINDOW_MAXIMIZED) { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + } else { + SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); } } + } else if (xevent->xproperty.atom == videodata->XKLAVIER_STATE) { + /* Hack for Ubuntu 12.04 (etc) that doesn't send MappingNotify + events when the keyboard layout changes (for example, + changing from English to French on the menubar's keyboard + icon). Since it changes the XKLAVIER_STATE property, we + notice and reinit our keymap here. This might not be the + right approach, but it seems to work. */ + X11_UpdateKeymap(_this, SDL_TRUE); + } else if (xevent->xproperty.atom == videodata->_NET_FRAME_EXTENTS) { + X11_GetBorderValues(data); } - break; + } break; - case SelectionNotify: { - Atom target = xevent->xselection.target; + case SelectionNotify: + { + Atom target = xevent->xselection.target; #ifdef DEBUG_XEVENTS - printf("window %p: SelectionNotify (requestor = %ld, target = %ld)\n", data, - xevent->xselection.requestor, xevent->xselection.target); + printf("window %p: SelectionNotify (requestor = %ld, target = %ld)\n", data, + xevent->xselection.requestor, xevent->xselection.target); #endif - if (target == data->xdnd_req) { - /* read data */ - SDL_x11Prop p; - X11_ReadProperty(&p, display, data->xwindow, videodata->PRIMARY); - - if (p.format == 8) { - char *saveptr = NULL; - char *name = X11_XGetAtomName(display, target); - if (name) { - char *token = SDL_strtokr((char *) p.data, "\r\n", &saveptr); - while (token != NULL) { - if (SDL_strcmp("text/plain", name) == 0) { - SDL_SendDropText(data->window, token); - } else if (SDL_strcmp("text/uri-list", name) == 0) { - char *fn = X11_URIToLocal(token); - if (fn) { - SDL_SendDropFile(data->window, fn); - } + if (target == data->xdnd_req) { + /* read data */ + SDL_x11Prop p; + X11_ReadProperty(&p, display, data->xwindow, videodata->PRIMARY); + + if (p.format == 8) { + char *saveptr = NULL; + char *name = X11_XGetAtomName(display, target); + if (name) { + char *token = SDL_strtokr((char *)p.data, "\r\n", &saveptr); + while (token) { + if (SDL_strcmp("text/plain", name) == 0) { + SDL_SendDropText(data->window, token); + } else if (SDL_strcmp("text/uri-list", name) == 0) { + char *fn = X11_URIToLocal(token); + if (fn) { + SDL_SendDropFile(data->window, fn); } - token = SDL_strtokr(NULL, "\r\n", &saveptr); } - X11_XFree(name); + token = SDL_strtokr(NULL, "\r\n", &saveptr); } - SDL_SendDropComplete(data->window); + X11_XFree(name); } - X11_XFree(p.data); - - /* send reply */ - SDL_memset(&m, 0, sizeof(XClientMessageEvent)); - m.type = ClientMessage; - m.display = display; - m.window = data->xdnd_source; - m.message_type = videodata->XdndFinished; - m.format = 32; - m.data.l[0] = data->xwindow; - m.data.l[1] = 1; - m.data.l[2] = videodata->XdndActionCopy; - X11_XSendEvent(display, data->xdnd_source, False, NoEventMask, (XEvent*)&m); - - X11_XSync(display, False); + SDL_SendDropComplete(data->window); } + X11_XFree(p.data); + + /* send reply */ + SDL_memset(&m, 0, sizeof(XClientMessageEvent)); + m.type = ClientMessage; + m.display = display; + m.window = data->xdnd_source; + m.message_type = videodata->XdndFinished; + m.format = 32; + m.data.l[0] = data->xwindow; + m.data.l[1] = 1; + m.data.l[2] = videodata->XdndActionCopy; + X11_XSendEvent(display, data->xdnd_source, False, NoEventMask, (XEvent *)&m); + + X11_XSync(display, False); } - break; + } break; - default:{ + default: + { #ifdef DEBUG_XEVENTS - printf("window %p: Unhandled event %d\n", data, xevent->type); + printf("window %p: Unhandled event %d\n", data, xevent->type); #endif - } - break; + } break; } } -static void -X11_HandleFocusChanges(_THIS) +static void X11_HandleFocusChanges(_THIS) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; int i; if (videodata && videodata->windowlist) { @@ -1591,14 +1636,12 @@ X11_HandleFocusChanges(_THIS) } } -static Bool -isAnyEvent(Display *display, XEvent *ev, XPointer arg) +static Bool isAnyEvent(Display *display, XEvent *ev, XPointer arg) { return True; } -static SDL_bool -X11_PollEvent(Display *display, XEvent *event) +static SDL_bool X11_PollEvent(Display *display, XEvent *event) { if (!X11_XCheckIfEvent(display, event, isAnyEvent, NULL)) { return SDL_FALSE; @@ -1607,12 +1650,11 @@ X11_PollEvent(Display *display, XEvent *event) return SDL_TRUE; } -void -X11_SendWakeupEvent(_THIS, SDL_Window *window) +void X11_SendWakeupEvent(_THIS, SDL_Window *window) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *req_display = data->request_display; - Window xwindow = ((SDL_WindowData *) window->driverdata)->xwindow; + Window xwindow = ((SDL_WindowData *)window->driverdata)->xwindow; XClientMessageEvent event; SDL_memset(&event, 0, sizeof(XClientMessageEvent)); @@ -1622,16 +1664,15 @@ X11_SendWakeupEvent(_THIS, SDL_Window *window) event.message_type = data->_SDL_WAKEUP; event.format = 8; - X11_XSendEvent(req_display, xwindow, False, NoEventMask, (XEvent *) &event); + X11_XSendEvent(req_display, xwindow, False, NoEventMask, (XEvent *)&event); /* XSendEvent returns a status and it could be BadValue or BadWindow. If an error happens it is an SDL's internal error and there is nothing we can do here. */ X11_XFlush(req_display); } -int -X11_WaitEventTimeout(_THIS, int timeout) +int X11_WaitEventTimeout(_THIS, int timeout) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display; XEvent xevent; display = videodata->display; @@ -1672,23 +1713,22 @@ X11_WaitEventTimeout(_THIS, int timeout) X11_DispatchEvent(_this, &xevent); #ifdef SDL_USE_IME - if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ + if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { SDL_IME_PumpEvents(); } #endif return 1; } -void -X11_PumpEvents(_THIS) +void X11_PumpEvents(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; XEvent xevent; int i; if (data->last_mode_change_deadline) { if (SDL_TICKS_PASSED(SDL_GetTicks(), data->last_mode_change_deadline)) { - data->last_mode_change_deadline = 0; /* assume we're done. */ + data->last_mode_change_deadline = 0; /* assume we're done. */ } } @@ -1699,7 +1739,7 @@ X11_PumpEvents(_THIS) SDL_TICKS_PASSED(now, data->screensaver_activity + 30000)) { X11_XResetScreenSaver(data->display); -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS SDL_DBus_ScreensaverTickle(); #endif @@ -1715,7 +1755,7 @@ X11_PumpEvents(_THIS) } #ifdef SDL_USE_IME - if(SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE){ + if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { SDL_IME_PumpEvents(); } #endif @@ -1733,17 +1773,15 @@ X11_PumpEvents(_THIS) } } - -void -X11_SuspendScreenSaver(_THIS) +void X11_SuspendScreenSaver(_THIS) { -#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; +#ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int dummy; int major_version, minor_version; #endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ -#if SDL_USE_LIBDBUS +#ifdef SDL_USE_LIBDBUS if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) { return; } @@ -1753,12 +1791,12 @@ X11_SuspendScreenSaver(_THIS) } #endif -#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER if (SDL_X11_HAVE_XSS) { /* X11_XScreenSaverSuspend was introduced in MIT-SCREEN-SAVER 1.1 */ if (!X11_XScreenSaverQueryExtension(data->display, &dummy, &dummy) || !X11_XScreenSaverQueryVersion(data->display, - &major_version, &minor_version) || + &major_version, &minor_version) || major_version < 1 || (major_version == 1 && minor_version < 1)) { return; } diff --git a/src/video/x11/SDL_x11events.h b/src/video/x11/SDL_x11events.h index de89110d00124..c9534f15e367b 100644 --- a/src/video/x11/SDL_x11events.h +++ b/src/video/x11/SDL_x11events.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,10 +24,11 @@ #define SDL_x11events_h_ extern void X11_PumpEvents(_THIS); -extern int X11_WaitEventTimeout(_THIS, int timeout); +extern int X11_WaitEventTimeout(_THIS, int timeout); extern void X11_SendWakeupEvent(_THIS, SDL_Window *window); extern void X11_SuspendScreenSaver(_THIS); extern void X11_ReconcileKeyboardState(_THIS); +extern void X11_GetBorderValues(void /*SDL_WindowData*/ *data); #endif /* SDL_x11events_h_ */ diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 123ad8ffbe871..2bfdc74acac4d 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,12 +20,11 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_x11video.h" #include "SDL_x11framebuffer.h" - #ifndef NO_SHARED_MEMORY /* Shared memory error handler routine */ @@ -33,11 +32,11 @@ static int shm_error; static int (*X_handler)(Display *, XErrorEvent *) = NULL; static int shm_errhandler(Display *d, XErrorEvent *e) { - if ( e->error_code == BadAccess ) { - shm_error = True; - return(0); - } else - return(X_handler(d,e)); + if (e->error_code == BadAccess) { + shm_error = True; + return 0; + } + return X_handler(d, e); } static SDL_bool have_mitshm(Display *dpy) @@ -48,14 +47,16 @@ static SDL_bool have_mitshm(Display *dpy) #endif /* !NO_SHARED_MEMORY */ -int -X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, - void ** pixels, int *pitch) +int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, + void **pixels, int *pitch) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XGCValues gcv; XVisualInfo vinfo; + int w, h; + + SDL_GetWindowSizeInPixels(window, &w, &h); /* Free the old framebuffer surface */ X11_DestroyWindowFramebuffer(_this, window); @@ -78,25 +79,26 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } /* Calculate pitch */ - *pitch = (((window->w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); + *pitch = (((w * SDL_BYTESPERPIXEL(*format)) + 3) & ~3); /* Create the actual image */ #ifndef NO_SHARED_MEMORY if (have_mitshm(display)) { XShmSegmentInfo *shminfo = &data->shminfo; - shminfo->shmid = shmget(IPC_PRIVATE, window->h*(*pitch), IPC_CREAT | 0777); - if ( shminfo->shmid >= 0 ) { + shminfo->shmid = shmget(IPC_PRIVATE, (size_t)h * (*pitch), IPC_CREAT | 0777); + if (shminfo->shmid >= 0) { shminfo->shmaddr = (char *)shmat(shminfo->shmid, 0, 0); shminfo->readOnly = False; - if ( shminfo->shmaddr != (char *)-1 ) { + if (shminfo->shmaddr != (char *)-1) { shm_error = False; X_handler = X11_XSetErrorHandler(shm_errhandler); X11_XShmAttach(display, shminfo); X11_XSync(display, False); X11_XSetErrorHandler(X_handler); - if ( shm_error ) + if (shm_error) { shmdt(shminfo->shmaddr); + } } else { shm_error = True; } @@ -106,9 +108,9 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } if (!shm_error) { data->ximage = X11_XShmCreateImage(display, data->visual, - vinfo.depth, ZPixmap, - shminfo->shmaddr, shminfo, - window->w, window->h); + vinfo.depth, ZPixmap, + shminfo->shmaddr, shminfo, + w, h); if (!data->ximage) { X11_XShmDetach(display, shminfo); X11_XSync(display, False); @@ -124,14 +126,14 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, } #endif /* not NO_SHARED_MEMORY */ - *pixels = SDL_malloc(window->h*(*pitch)); - if (*pixels == NULL) { + *pixels = SDL_malloc((size_t)h * (*pitch)); + if (!*pixels) { return SDL_OutOfMemory(); } data->ximage = X11_XCreateImage(display, data->visual, - vinfo.depth, ZPixmap, 0, (char *)(*pixels), - window->w, window->h, 32, 0); + vinfo.depth, ZPixmap, 0, (char *)(*pixels), + w, h, 32, 0); if (!data->ximage) { SDL_free(*pixels); return SDL_SetError("Couldn't create XImage"); @@ -140,14 +142,17 @@ X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, return 0; } -int -X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, - int numrects) +int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, + int numrects) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; int i; - int x, y, w ,h; + int x, y, w, h; + int window_w, window_h; + + SDL_GetWindowSizeInPixels(window, &window_w, &window_h); + #ifndef NO_SHARED_MEMORY if (data->use_mitshm) { for (i = 0; i < numrects; ++i) { @@ -160,26 +165,25 @@ X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, /* Clipped? */ continue; } - if (x < 0) - { + if (x < 0) { x += w; w += rects[i].x; } - if (y < 0) - { + if (y < 0) { y += h; h += rects[i].y; } - if (x + w > window->w) - w = window->w - x; - if (y + h > window->h) - h = window->h - y; + if (x + w > window_w) { + w = window_w - x; + } + if (y + h > window_h) { + h = window_h - y; + } X11_XShmPutImage(display, data->xwindow, data->gc, data->ximage, - x, y, x, y, w, h, False); + x, y, x, y, w, h, False); } - } - else + } else #endif /* !NO_SHARED_MEMORY */ { for (i = 0; i < numrects; ++i) { @@ -192,23 +196,23 @@ X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, /* Clipped? */ continue; } - if (x < 0) - { + if (x < 0) { x += w; w += rects[i].x; } - if (y < 0) - { + if (y < 0) { y += h; h += rects[i].y; } - if (x + w > window->w) - w = window->w - x; - if (y + h > window->h) - h = window->h - y; + if (x + w > window_w) { + w = window_w - x; + } + if (y + h > window_h) { + h = window_h - y; + } X11_XPutImage(display, data->xwindow, data->gc, data->ximage, - x, y, x, y, w, h); + x, y, x, y, w, h); } } @@ -217,10 +221,9 @@ X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, return 0; } -void -X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window) +void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display; if (!data) { diff --git a/src/video/x11/SDL_x11framebuffer.h b/src/video/x11/SDL_x11framebuffer.h index 63e73604aea30..d6fb21fc36876 100644 --- a/src/video/x11/SDL_x11framebuffer.h +++ b/src/video/x11/SDL_x11framebuffer.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,13 +24,12 @@ #include "../../SDL_internal.h" - -extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window * window, - Uint32 * format, - void ** pixels, int *pitch); -extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window * window, - const SDL_Rect * rects, int numrects); -extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window * window); +extern int X11_CreateWindowFramebuffer(_THIS, SDL_Window *window, + Uint32 *format, + void **pixels, int *pitch); +extern int X11_UpdateWindowFramebuffer(_THIS, SDL_Window *window, + const SDL_Rect *rects, int numrects); +extern void X11_DestroyWindowFramebuffer(_THIS, SDL_Window *window); #endif /* SDL_x11framebuffer_h_ */ diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index bad2029646c8a..7073e134128bf 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_hints.h" #include "SDL_misc.h" @@ -46,9 +46,33 @@ static SDL_ScancodeTable scancode_set[] = { SDL_SCANCODE_TABLE_XVNC, }; +static SDL_bool X11_ScancodeIsRemappable(SDL_Scancode scancode) +{ + /* + * XKB remappings can assign different keysyms for these scancodes, but + * as these keys are in fixed positions, the scancodes themselves shouldn't + * be switched. Mark them as not being remappable. + */ + switch (scancode) { + case SDL_SCANCODE_ESCAPE: + case SDL_SCANCODE_CAPSLOCK: + case SDL_SCANCODE_NUMLOCKCLEAR: + case SDL_SCANCODE_LSHIFT: + case SDL_SCANCODE_RSHIFT: + case SDL_SCANCODE_LCTRL: + case SDL_SCANCODE_RCTRL: + case SDL_SCANCODE_LALT: + case SDL_SCANCODE_RALT: + case SDL_SCANCODE_LGUI: + case SDL_SCANCODE_RGUI: + return SDL_FALSE; + default: + return SDL_TRUE; + } +} + /* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ -static SDL_Scancode -X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) +static SDL_Scancode X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) { const KeySym keysym = X11_KeyCodeToSym(_this, keycode, 0); @@ -59,8 +83,7 @@ X11_KeyCodeToSDLScancode(_THIS, KeyCode keycode) return SDL_GetScancodeFromKeySym(keysym, keycode); } -static Uint32 -X11_KeyCodeToUcs4(_THIS, KeyCode keycode, unsigned char group) +static Uint32 X11_KeyCodeToUcs4(_THIS, KeyCode keycode, unsigned char group) { KeySym keysym = X11_KeyCodeToSym(_this, keycode, group); @@ -74,20 +97,21 @@ X11_KeyCodeToUcs4(_THIS, KeyCode keycode, unsigned char group) KeySym X11_KeyCodeToSym(_THIS, KeyCode keycode, unsigned char group) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; KeySym keysym; -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM if (data->xkb) { - int num_groups = XkbKeyNumGroups(data->xkb, keycode); + int num_groups = XkbKeyNumGroups(data->xkb, keycode); unsigned char info = XkbKeyGroupInfo(data->xkb, keycode); - + if (num_groups && group >= num_groups) { - + int action = XkbOutOfRangeGroupAction(info); - + if (action == XkbRedirectIntoRange) { - if ((group = XkbOutOfRangeGroupNumber(info)) >= num_groups) { + group = XkbOutOfRangeGroupNumber(info); + if (group >= num_groups) { group = 0; } } else if (action == XkbClampIntoRange) { @@ -107,14 +131,14 @@ X11_KeyCodeToSym(_THIS, KeyCode keycode, unsigned char group) return keysym; } -int -X11_InitKeyboard(_THIS) +int X11_InitKeyboard(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int i = 0; int j = 0; int min_keycode, max_keycode; - struct { + struct + { SDL_Scancode scancode; KeySym keysym; int value; @@ -131,7 +155,7 @@ X11_InitKeyboard(_THIS) int distance; Bool xkb_repeat = 0; -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM { int xkb_major = XkbMajorVersion; int xkb_minor = XkbMinorVersion; @@ -144,14 +168,14 @@ X11_InitKeyboard(_THIS) X11_XkbSetDetectableAutoRepeat(data->display, True, &xkb_repeat); } #endif - + /* Open a connection to the X input manager */ #ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { - /* Set the locale, and call XSetLocaleModifiers before XOpenIM so that + /* Set the locale, and call XSetLocaleModifiers before XOpenIM so that Compose keys will work correctly. */ char *prev_locale = setlocale(LC_ALL, NULL); - char *prev_xmods = X11_XSetLocaleModifiers(NULL); + char *prev_xmods = X11_XSetLocaleModifiers(NULL); const char *new_xmods = ""; const char *env_xmods = SDL_getenv("XMODIFIERS"); SDL_bool has_dbus_ime_support = SDL_FALSE; @@ -166,7 +190,7 @@ X11_InitKeyboard(_THIS) /* IBus resends some key events that were filtered by XFilterEvents when it is used via XIM which causes issues. Prevent this by forcing - @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via + @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via the DBus implementation, which also has support for pre-editing. */ if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) { has_dbus_ime_support = SDL_TRUE; @@ -178,14 +202,14 @@ X11_InitKeyboard(_THIS) new_xmods = "@im=none"; } - setlocale(LC_ALL, ""); + (void)setlocale(LC_ALL, ""); X11_XSetLocaleModifiers(new_xmods); data->im = X11_XOpenIM(data->display, NULL, data->classname, data->classname); /* Reset the locale + X locale modifiers back to how they were, locale first because the X locale modifiers depend on it. */ - setlocale(LC_ALL, prev_locale); + (void)setlocale(LC_ALL, prev_locale); X11_XSetLocaleModifiers(prev_xmods); if (prev_locale) { @@ -261,14 +285,14 @@ X11_InitKeyboard(_THIS) KeySym sym; sym = X11_KeyCodeToSym(_this, (KeyCode)i, 0); SDL_Log("code = %d, sym = 0x%X (%s) ", i - min_keycode, - (unsigned int)sym, sym == NoSymbol ? "NoSymbol" : X11_XKeysymToString(sym)); + (unsigned int)sym, sym == NoSymbol ? "NoSymbol" : X11_XKeysymToString(sym)); } #endif if (scancode == data->key_layout[i]) { continue; } - if (default_keymap[scancode] >= SDLK_SCANCODE_MASK) { - /* Not a character key, safe to remap */ + if (default_keymap[scancode] >= SDLK_SCANCODE_MASK && X11_ScancodeIsRemappable(scancode)) { + /* Not a character key and the scancode is safe to remap */ #ifdef DEBUG_KEYBOARD SDL_Log("Changing scancode, was %d (%s), now %d (%s)\n", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode)); #endif @@ -288,7 +312,7 @@ X11_InitKeyboard(_THIS) KeySym sym; sym = X11_KeyCodeToSym(_this, (KeyCode)i, 0); SDL_Log("code = %d, sym = 0x%X (%s) ", i - min_keycode, - (unsigned int)sym, sym == NoSymbol ? "NoSymbol" : X11_XKeysymToString(sym)); + (unsigned int)sym, sym == NoSymbol ? "NoSymbol" : X11_XKeysymToString(sym)); } if (scancode == SDL_SCANCODE_UNKNOWN) { SDL_Log("scancode not found\n"); @@ -313,10 +337,9 @@ X11_InitKeyboard(_THIS) return 0; } -void -X11_UpdateKeymap(_THIS, SDL_bool send_event) +void X11_UpdateKeymap(_THIS, SDL_bool send_event) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int i; SDL_Scancode scancode; SDL_Keycode keymap[SDL_NUM_SCANCODES]; @@ -324,7 +347,7 @@ X11_UpdateKeymap(_THIS, SDL_bool send_event) SDL_GetDefaultKeymap(keymap); -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM if (data->xkb) { XkbStateRec state; X11_XkbGetUpdatedMap(data->display, XkbAllClientInfoMask, data->xkb); @@ -335,7 +358,6 @@ X11_UpdateKeymap(_THIS, SDL_bool send_event) } #endif - for (i = 0; i < SDL_arraysize(data->key_layout); i++) { Uint32 key; @@ -353,36 +375,35 @@ X11_UpdateKeymap(_THIS, SDL_bool send_event) SDL_Scancode keyScancode = X11_KeyCodeToSDLScancode(_this, (KeyCode)i); switch (keyScancode) { - case SDL_SCANCODE_RETURN: - keymap[scancode] = SDLK_RETURN; - break; - case SDL_SCANCODE_ESCAPE: - keymap[scancode] = SDLK_ESCAPE; - break; - case SDL_SCANCODE_BACKSPACE: - keymap[scancode] = SDLK_BACKSPACE; - break; - case SDL_SCANCODE_TAB: - keymap[scancode] = SDLK_TAB; - break; - case SDL_SCANCODE_DELETE: - keymap[scancode] = SDLK_DELETE; - break; - default: - keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(keyScancode); - break; + case SDL_SCANCODE_RETURN: + keymap[scancode] = SDLK_RETURN; + break; + case SDL_SCANCODE_ESCAPE: + keymap[scancode] = SDLK_ESCAPE; + break; + case SDL_SCANCODE_BACKSPACE: + keymap[scancode] = SDLK_BACKSPACE; + break; + case SDL_SCANCODE_TAB: + keymap[scancode] = SDLK_TAB; + break; + case SDL_SCANCODE_DELETE: + keymap[scancode] = SDLK_DELETE; + break; + default: + keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(keyScancode); + break; } } } SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); } -void -X11_QuitKeyboard(_THIS) +void X11_QuitKeyboard(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM if (data->xkb) { X11_XkbFreeKeyboard(data->xkb, 0, True); data->xkb = NULL; @@ -394,11 +415,10 @@ X11_QuitKeyboard(_THIS) #endif } -static void -X11_ResetXIM(_THIS) +static void X11_ResetXIM(_THIS) { #ifdef X_HAVE_UTF8_STRING - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; int i; if (videodata && videodata->windowlist) { @@ -416,14 +436,12 @@ X11_ResetXIM(_THIS) #endif } -void -X11_StartTextInput(_THIS) +void X11_StartTextInput(_THIS) { X11_ResetXIM(_this); } -void -X11_StopTextInput(_THIS) +void X11_StopTextInput(_THIS) { X11_ResetXIM(_this); #ifdef SDL_USE_IME @@ -431,48 +449,44 @@ X11_StopTextInput(_THIS) #endif } -void -X11_SetTextInputRect(_THIS, const SDL_Rect *rect) +void X11_SetTextInputRect(_THIS, const SDL_Rect *rect) { if (!rect) { SDL_InvalidParamError("rect"); return; } - + #ifdef SDL_USE_IME SDL_IME_UpdateTextRect(rect); #endif } -SDL_bool -X11_HasScreenKeyboardSupport(_THIS) +SDL_bool X11_HasScreenKeyboardSupport(_THIS) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; return videodata->is_steam_deck; } -void -X11_ShowScreenKeyboard(_THIS, SDL_Window *window) +void X11_ShowScreenKeyboard(_THIS, SDL_Window *window) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; if (videodata->is_steam_deck) { /* For more documentation of the URL parameters, see: * https://partner.steamgames.com/doc/api/ISteamUtils#ShowFloatingGamepadTextInput */ char deeplink[128]; - SDL_snprintf(deeplink, sizeof(deeplink), - "steam://open/keyboard?XPosition=0&YPosition=0&Width=0&Height=0&Mode=%d", - SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE) ? 0 : 1); + (void)SDL_snprintf(deeplink, sizeof(deeplink), + "steam://open/keyboard?XPosition=0&YPosition=0&Width=0&Height=0&Mode=%d", + SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE) ? 0 : 1); SDL_OpenURL(deeplink); videodata->steam_keyboard_open = SDL_TRUE; } } -void -X11_HideScreenKeyboard(_THIS, SDL_Window *window) +void X11_HideScreenKeyboard(_THIS, SDL_Window *window) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; if (videodata->is_steam_deck) { SDL_OpenURL("steam://close/keyboard"); @@ -480,10 +494,9 @@ X11_HideScreenKeyboard(_THIS, SDL_Window *window) } } -SDL_bool -X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) +SDL_bool X11_IsScreenKeyboardShown(_THIS, SDL_Window *window) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; return videodata->steam_keyboard_open; } diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 645e7ba415a63..389119c76c142 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index 9bc9702c0a55b..9dd2887a865e7 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL.h" #include "SDL_x11video.h" @@ -31,7 +31,6 @@ #include #include - #define SDL_FORK_MESSAGEBOX 1 #define SDL_SET_LOCALE 1 @@ -42,40 +41,42 @@ #include #endif -#define MAX_BUTTONS 8 /* Maximum number of buttons supported */ -#define MIN_BUTTON_WIDTH 64 /* Minimum button width */ -#define MIN_DIALOG_WIDTH 200 /* Minimum dialog width */ -#define MIN_DIALOG_HEIGHT 100 /* Minimum dialog height */ +#define MAX_BUTTONS 8 /* Maximum number of buttons supported */ +#define MIN_BUTTON_WIDTH 64 /* Minimum button width */ +#define MIN_DIALOG_WIDTH 200 /* Minimum dialog width */ +#define MIN_DIALOG_HEIGHT 100 /* Minimum dialog height */ static const char g_MessageBoxFontLatin1[] = "-*-*-medium-r-normal--0-120-*-*-p-0-iso8859-1"; static const char g_MessageBoxFont[] = "-*-*-medium-r-normal--*-120-*-*-*-*-*-*"; -static const SDL_MessageBoxColor g_default_colors[ SDL_MESSAGEBOX_COLOR_MAX ] = { - { 56, 54, 53 }, /* SDL_MESSAGEBOX_COLOR_BACKGROUND, */ +static const SDL_MessageBoxColor g_default_colors[SDL_MESSAGEBOX_COLOR_MAX] = { + { 56, 54, 53 }, /* SDL_MESSAGEBOX_COLOR_BACKGROUND, */ { 209, 207, 205 }, /* SDL_MESSAGEBOX_COLOR_TEXT, */ { 140, 135, 129 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, */ - { 105, 102, 99 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, */ - { 205, 202, 53 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, */ + { 105, 102, 99 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, */ + { 205, 202, 53 }, /* SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, */ }; -#define SDL_MAKE_RGB( _r, _g, _b ) ( ( ( Uint32 )( _r ) << 16 ) | \ - ( ( Uint32 )( _g ) << 8 ) | \ - ( ( Uint32 )( _b ) ) ) +#define SDL_MAKE_RGB(_r, _g, _b) (((Uint32)(_r) << 16) | \ + ((Uint32)(_g) << 8) | \ + ((Uint32)(_b))) -typedef struct SDL_MessageBoxButtonDataX11 { - int x, y; /* Text position */ - int length; /* Text length */ - int text_width; /* Text width */ +typedef struct SDL_MessageBoxButtonDataX11 +{ + int x, y; /* Text position */ + int length; /* Text length */ + int text_width; /* Text width */ - SDL_Rect rect; /* Rectangle for entire button */ + SDL_Rect rect; /* Rectangle for entire button */ - const SDL_MessageBoxButtonData *buttondata; /* Button data from caller */ + const SDL_MessageBoxButtonData *buttondata; /* Button data from caller */ } SDL_MessageBoxButtonDataX11; -typedef struct TextLineData { - int width; /* Width of this text line */ - int length; /* String length of this text line */ - const char *text; /* Text for this line */ +typedef struct TextLineData +{ + int width; /* Width of this text line */ + int length; /* String length of this text line */ + const char *text; /* Text for this line */ } TextLineData; typedef struct SDL_MessageBoxDataX11 @@ -83,80 +84,80 @@ typedef struct SDL_MessageBoxDataX11 Display *display; int screen; Window window; -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE XdbeBackBuffer buf; - SDL_bool xdbe; /* Whether Xdbe is present or not */ + SDL_bool xdbe; /* Whether Xdbe is present or not */ #endif long event_mask; Atom wm_protocols; Atom wm_delete_message; - int dialog_width; /* Dialog box width. */ - int dialog_height; /* Dialog box height. */ + int dialog_width; /* Dialog box width. */ + int dialog_height; /* Dialog box height. */ - XFontSet font_set; /* for UTF-8 systems */ - XFontStruct *font_struct; /* Latin1 (ASCII) fallback. */ - int xtext, ytext; /* Text position to start drawing at. */ - int numlines; /* Count of Text lines. */ - int text_height; /* Height for text lines. */ + XFontSet font_set; /* for UTF-8 systems */ + XFontStruct *font_struct; /* Latin1 (ASCII) fallback. */ + int xtext, ytext; /* Text position to start drawing at. */ + int numlines; /* Count of Text lines. */ + int text_height; /* Height for text lines. */ TextLineData *linedata; - int *pbuttonid; /* Pointer to user return buttonid value. */ + int *pbuttonid; /* Pointer to user return buttonid value. */ - int button_press_index; /* Index into buttondata/buttonpos for button which is pressed (or -1). */ - int mouse_over_index; /* Index into buttondata/buttonpos for button mouse is over (or -1). */ + int button_press_index; /* Index into buttondata/buttonpos for button which is pressed (or -1). */ + int mouse_over_index; /* Index into buttondata/buttonpos for button mouse is over (or -1). */ - int numbuttons; /* Count of buttons. */ + int numbuttons; /* Count of buttons. */ const SDL_MessageBoxButtonData *buttondata; - SDL_MessageBoxButtonDataX11 buttonpos[ MAX_BUTTONS ]; + SDL_MessageBoxButtonDataX11 buttonpos[MAX_BUTTONS]; - Uint32 color[ SDL_MESSAGEBOX_COLOR_MAX ]; + Uint32 color[SDL_MESSAGEBOX_COLOR_MAX]; const SDL_MessageBoxData *messageboxdata; } SDL_MessageBoxDataX11; /* Maximum helper for ints. */ -static SDL_INLINE int -IntMax( int a, int b ) +static SDL_INLINE int IntMax(int a, int b) { - return ( a > b ) ? a : b; + return (a > b) ? a : b; } /* Return width and height for a string. */ -static void -GetTextWidthHeight( SDL_MessageBoxDataX11 *data, const char *str, int nbytes, int *pwidth, int *pheight ) +static void GetTextWidthHeight(SDL_MessageBoxDataX11 *data, const char *str, int nbytes, int *pwidth, int *pheight) { +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { XRectangle overall_ink, overall_logical; X11_Xutf8TextExtents(data->font_set, str, nbytes, &overall_ink, &overall_logical); *pwidth = overall_logical.width; *pheight = overall_logical.height; - } else { + } else +#endif + { XCharStruct text_structure; int font_direction, font_ascent, font_descent; - X11_XTextExtents( data->font_struct, str, nbytes, - &font_direction, &font_ascent, &font_descent, - &text_structure ); + X11_XTextExtents(data->font_struct, str, nbytes, + &font_direction, &font_ascent, &font_descent, + &text_structure); *pwidth = text_structure.width; *pheight = text_structure.ascent + text_structure.descent; } } /* Return index of button if position x,y is contained therein. */ -static int -GetHitButtonIndex( SDL_MessageBoxDataX11 *data, int x, int y ) +static int GetHitButtonIndex(SDL_MessageBoxDataX11 *data, int x, int y) { int i; int numbuttons = data->numbuttons; SDL_MessageBoxButtonDataX11 *buttonpos = data->buttonpos; - for ( i = 0; i < numbuttons; i++ ) { - SDL_Rect *rect = &buttonpos[ i ].rect; + for (i = 0; i < numbuttons; i++) { + SDL_Rect *rect = &buttonpos[i].rect; - if ( ( x >= rect->x ) && - ( x <= ( rect->x + rect->w ) ) && - ( y >= rect->y ) && - ( y <= ( rect->y + rect->h ) ) ) { + if ((x >= rect->x) && + (x <= (rect->x + rect->w)) && + (y >= rect->y) && + (y <= (rect->y + rect->h))) { return i; } } @@ -165,15 +166,14 @@ GetHitButtonIndex( SDL_MessageBoxDataX11 *data, int x, int y ) } /* Initialize SDL_MessageBoxData structure and Display, etc. */ -static int -X11_MessageBoxInit( SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData * messageboxdata, int * pbuttonid ) +static int X11_MessageBoxInit(SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData *messageboxdata, int *pbuttonid) { int i; int numbuttons = messageboxdata->numbuttons; const SDL_MessageBoxButtonData *buttondata = messageboxdata->buttons; const SDL_MessageBoxColor *colorhints; - if ( numbuttons > MAX_BUTTONS ) { + if (numbuttons > MAX_BUTTONS) { return SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS); } @@ -184,58 +184,59 @@ X11_MessageBoxInit( SDL_MessageBoxDataX11 *data, const SDL_MessageBoxData * mess data->numbuttons = numbuttons; data->pbuttonid = pbuttonid; - data->display = X11_XOpenDisplay( NULL ); - if ( !data->display ) { + data->display = X11_XOpenDisplay(NULL); + if (!data->display) { return SDL_SetError("Couldn't open X11 display"); } +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { char **missing = NULL; int num_missing = 0; data->font_set = X11_XCreateFontSet(data->display, g_MessageBoxFont, - &missing, &num_missing, NULL); - if ( missing != NULL ) { + &missing, &num_missing, NULL); + if (missing) { X11_XFreeStringList(missing); } - if ( data->font_set == NULL ) { + if (!data->font_set) { return SDL_SetError("Couldn't load font %s", g_MessageBoxFont); } - } else { - data->font_struct = X11_XLoadQueryFont( data->display, g_MessageBoxFontLatin1 ); - if ( data->font_struct == NULL ) { + } else +#endif + { + data->font_struct = X11_XLoadQueryFont(data->display, g_MessageBoxFontLatin1); + if (!data->font_struct) { return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1); } } - if ( messageboxdata->colorScheme ) { + if (messageboxdata->colorScheme) { colorhints = messageboxdata->colorScheme->colors; } else { colorhints = g_default_colors; } /* Convert our SDL_MessageBoxColor r,g,b values to packed RGB format. */ - for ( i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; i++ ) { - data->color[ i ] = SDL_MAKE_RGB( colorhints[ i ].r, colorhints[ i ].g, colorhints[ i ].b ); + for (i = 0; i < SDL_MESSAGEBOX_COLOR_MAX; i++) { + data->color[i] = SDL_MAKE_RGB(colorhints[i].r, colorhints[i].g, colorhints[i].b); } return 0; } -static int -CountLinesOfText(const char *text) +static int CountLinesOfText(const char *text) { int retval = 0; while (text && *text) { const char *lf = SDL_strchr(text, '\n'); - retval++; /* even without an endline, this counts as a line. */ + retval++; /* even without an endline, this counts as a line. */ text = lf ? lf + 1 : NULL; } return retval; } /* Calculate and initialize text and button locations. */ -static int -X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) +static int X11_MessageBoxInitPositions(SDL_MessageBoxDataX11 *data) { int i; int ybuttons; @@ -245,10 +246,10 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) const SDL_MessageBoxData *messageboxdata = data->messageboxdata; /* Go over text and break linefeeds into separate lines. */ - if ( messageboxdata->message[0] ) { + if (messageboxdata && messageboxdata->message[0]) { const char *text = messageboxdata->message; const int linecount = CountLinesOfText(text); - TextLineData *plinedata = (TextLineData *) SDL_malloc(sizeof (TextLineData) * linecount); + TextLineData *plinedata = (TextLineData *)SDL_malloc(sizeof(TextLineData) * linecount); if (!plinedata) { return SDL_OutOfMemory(); @@ -257,18 +258,18 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) data->linedata = plinedata; data->numlines = linecount; - for ( i = 0; i < linecount; i++, plinedata++ ) { - const char *lf = SDL_strchr( text, '\n' ); - const int length = lf ? ( lf - text ) : SDL_strlen( text ); + for (i = 0; i < linecount; i++, plinedata++) { + const char *lf = SDL_strchr(text, '\n'); + const int length = lf ? (lf - text) : SDL_strlen(text); int height; plinedata->text = text; - GetTextWidthHeight( data, text, length, &plinedata->width, &height ); + GetTextWidthHeight(data, text, length, &plinedata->width, &height); /* Text and widths are the largest we've ever seen. */ - data->text_height = IntMax( data->text_height, height ); - text_width_max = IntMax( text_width_max, plinedata->width ); + data->text_height = IntMax(data->text_height, height); + text_width_max = IntMax(text_width_max, plinedata->width); plinedata->length = length; if (lf && (lf > text) && (lf[-1] == '\r')) { @@ -278,8 +279,9 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) text += length + 1; /* Break if there are no more linefeeds. */ - if ( !lf ) + if (!lf) { break; + } } /* Bump up the text height slightly. */ @@ -287,36 +289,36 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) } /* Loop through all buttons and calculate the button widths and height. */ - for ( i = 0; i < data->numbuttons; i++ ) { + for (i = 0; i < data->numbuttons; i++) { int height; - data->buttonpos[ i ].buttondata = &data->buttondata[ i ]; - data->buttonpos[ i ].length = SDL_strlen( data->buttondata[ i ].text ); + data->buttonpos[i].buttondata = &data->buttondata[i]; + data->buttonpos[i].length = SDL_strlen(data->buttondata[i].text); - GetTextWidthHeight( data, data->buttondata[ i ].text, SDL_strlen( data->buttondata[ i ].text ), - &data->buttonpos[ i ].text_width, &height ); + GetTextWidthHeight(data, data->buttondata[i].text, SDL_strlen(data->buttondata[i].text), + &data->buttonpos[i].text_width, &height); - button_width = IntMax( button_width, data->buttonpos[ i ].text_width ); - button_text_height = IntMax( button_text_height, height ); + button_width = IntMax(button_width, data->buttonpos[i].text_width); + button_text_height = IntMax(button_text_height, height); } - if ( data->numlines ) { + if (data->numlines) { /* x,y for this line of text. */ data->xtext = data->text_height; data->ytext = data->text_height + data->text_height; /* Bump button y down to bottom of text. */ - ybuttons = 3 * data->ytext / 2 + ( data->numlines - 1 ) * data->text_height; + ybuttons = 3 * data->ytext / 2 + (data->numlines - 1) * data->text_height; /* Bump the dialog box width and height up if needed. */ - data->dialog_width = IntMax( data->dialog_width, 2 * data->xtext + text_width_max ); - data->dialog_height = IntMax( data->dialog_height, ybuttons ); + data->dialog_width = IntMax(data->dialog_width, 2 * data->xtext + text_width_max); + data->dialog_height = IntMax(data->dialog_height, ybuttons); } else { /* Button y starts at height of button text. */ ybuttons = button_text_height; } - if ( data->numbuttons ) { + if (data->numbuttons) { int x, y; int width_of_buttons; int button_spacing = button_text_height; @@ -326,33 +328,33 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) button_width += button_text_height; /* Get width of all buttons lined up. */ - width_of_buttons = data->numbuttons * button_width + ( data->numbuttons - 1 ) * button_spacing; + width_of_buttons = data->numbuttons * button_width + (data->numbuttons - 1) * button_spacing; /* Bump up dialog width and height if buttons are wider than text. */ - data->dialog_width = IntMax( data->dialog_width, width_of_buttons + 2 * button_spacing ); - data->dialog_height = IntMax( data->dialog_height, ybuttons + 2 * button_height ); + data->dialog_width = IntMax(data->dialog_width, width_of_buttons + 2 * button_spacing); + data->dialog_height = IntMax(data->dialog_height, ybuttons + 2 * button_height); /* Location for first button. */ - if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) { - x = data->dialog_width - ( data->dialog_width - width_of_buttons ) / 2 - ( button_width + button_spacing ); + if (messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT) { + x = data->dialog_width - (data->dialog_width - width_of_buttons) / 2 - (button_width + button_spacing); } else { - x = ( data->dialog_width - width_of_buttons ) / 2; + x = (data->dialog_width - width_of_buttons) / 2; } - y = ybuttons + ( data->dialog_height - ybuttons - button_height ) / 2; + y = ybuttons + (data->dialog_height - ybuttons - button_height) / 2; - for ( i = 0; i < data->numbuttons; i++ ) { + for (i = 0; i < data->numbuttons; i++) { /* Button coordinates. */ - data->buttonpos[ i ].rect.x = x; - data->buttonpos[ i ].rect.y = y; - data->buttonpos[ i ].rect.w = button_width; - data->buttonpos[ i ].rect.h = button_height; + data->buttonpos[i].rect.x = x; + data->buttonpos[i].rect.y = y; + data->buttonpos[i].rect.w = button_width; + data->buttonpos[i].rect.h = button_height; /* Button text coordinates. */ - data->buttonpos[ i ].x = x + ( button_width - data->buttonpos[ i ].text_width ) / 2; - data->buttonpos[ i ].y = y + ( button_height - button_text_height - 1 ) / 2 + button_text_height; + data->buttonpos[i].x = x + (button_width - data->buttonpos[i].text_width) / 2; + data->buttonpos[i].y = y + (button_height - button_text_height - 1) / 2 + button_text_height; /* Scoot over for next button. */ - if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) { + if (messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT) { x -= button_width + button_spacing; } else { x += button_width + button_spacing; @@ -364,33 +366,32 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data ) } /* Free SDL_MessageBoxData data. */ -static void -X11_MessageBoxShutdown( SDL_MessageBoxDataX11 *data ) +static void X11_MessageBoxShutdown(SDL_MessageBoxDataX11 *data) { - if ( data->font_set != NULL ) { - X11_XFreeFontSet( data->display, data->font_set ); + if (data->font_set) { + X11_XFreeFontSet(data->display, data->font_set); data->font_set = NULL; } - if ( data->font_struct != NULL ) { - X11_XFreeFont( data->display, data->font_struct ); + if (data->font_struct) { + X11_XFreeFont(data->display, data->font_struct); data->font_struct = NULL; } -#if SDL_VIDEO_DRIVER_X11_XDBE - if ( SDL_X11_HAVE_XDBE && data->xdbe ) { +#ifdef SDL_VIDEO_DRIVER_X11_XDBE + if (SDL_X11_HAVE_XDBE && data->xdbe) { X11_XdbeDeallocateBackBufferName(data->display, data->buf); } #endif - if ( data->display ) { - if ( data->window != None ) { - X11_XWithdrawWindow( data->display, data->window, data->screen ); - X11_XDestroyWindow( data->display, data->window ); + if (data->display) { + if (data->window != None) { + X11_XWithdrawWindow(data->display, data->window, data->screen); + X11_XDestroyWindow(data->display, data->window); data->window = None; } - X11_XCloseDisplay( data->display ); + X11_XCloseDisplay(data->display); data->display = NULL; } @@ -398,8 +399,7 @@ X11_MessageBoxShutdown( SDL_MessageBoxDataX11 *data ) } /* Create and set up our X11 dialog box indow. */ -static int -X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) +static int X11_MessageBoxCreateWindow(SDL_MessageBoxDataX11 *data) { int x, y; XSizeHints *sizehints; @@ -409,13 +409,13 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) SDL_WindowData *windowdata = NULL; const SDL_MessageBoxData *messageboxdata = data->messageboxdata; - if ( messageboxdata->window ) { + if (messageboxdata->window) { SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(messageboxdata->window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(messageboxdata->window)->driverdata; windowdata = (SDL_WindowData *)messageboxdata->window->driverdata; data->screen = displaydata->screen; } else { - data->screen = DefaultScreen( display ); + data->screen = DefaultScreen(display); } data->event_mask = ExposureMask | @@ -424,16 +424,16 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) wnd_attr.event_mask = data->event_mask; data->window = X11_XCreateWindow( - display, RootWindow(display, data->screen), - 0, 0, - data->dialog_width, data->dialog_height, - 0, CopyFromParent, InputOutput, CopyFromParent, - CWEventMask, &wnd_attr ); - if ( data->window == None ) { + display, RootWindow(display, data->screen), + 0, 0, + data->dialog_width, data->dialog_height, + 0, CopyFromParent, InputOutput, CopyFromParent, + CWEventMask, &wnd_attr); + if (data->window == None) { return SDL_SetError("Couldn't create X window"); } - if ( windowdata ) { + if (windowdata) { Atom _NET_WM_STATE = X11_XInternAtom(display, "_NET_WM_STATE", False); Atom stateatoms[16]; size_t statecount = 0; @@ -448,47 +448,47 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) PropModeReplace, (unsigned char *)stateatoms, statecount); /* http://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR */ - X11_XSetTransientForHint( display, data->window, windowdata->xwindow ); + X11_XSetTransientForHint(display, data->window, windowdata->xwindow); } - SDL_X11_SetWindowTitle(display, data->window, (char*)messageboxdata->title); + SDL_X11_SetWindowTitle(display, data->window, (char *)messageboxdata->title); /* Let the window manager know this is a dialog box */ _NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); _NET_WM_WINDOW_TYPE_DIALOG = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False); X11_XChangeProperty(display, data->window, _NET_WM_WINDOW_TYPE, XA_ATOM, 32, - PropModeReplace, - (unsigned char *)&_NET_WM_WINDOW_TYPE_DIALOG, 1); + PropModeReplace, + (unsigned char *)&_NET_WM_WINDOW_TYPE_DIALOG, 1); /* Allow the window to be deleted by the window manager */ - data->wm_protocols = X11_XInternAtom( display, "WM_PROTOCOLS", False ); - data->wm_delete_message = X11_XInternAtom( display, "WM_DELETE_WINDOW", False ); - X11_XSetWMProtocols( display, data->window, &data->wm_delete_message, 1 ); + data->wm_protocols = X11_XInternAtom(display, "WM_PROTOCOLS", False); + data->wm_delete_message = X11_XInternAtom(display, "WM_DELETE_WINDOW", False); + X11_XSetWMProtocols(display, data->window, &data->wm_delete_message, 1); - if ( windowdata ) { + if (windowdata) { XWindowAttributes attrib; Window dummy; X11_XGetWindowAttributes(display, windowdata->xwindow, &attrib); - x = attrib.x + ( attrib.width - data->dialog_width ) / 2; - y = attrib.y + ( attrib.height - data->dialog_height ) / 3 ; + x = attrib.x + (attrib.width - data->dialog_width) / 2; + y = attrib.y + (attrib.height - data->dialog_height) / 3; X11_XTranslateCoordinates(display, windowdata->xwindow, RootWindow(display, data->screen), x, y, &x, &y, &dummy); } else { const SDL_VideoDevice *dev = SDL_GetVideoDevice(); if ((dev) && (dev->displays) && (dev->num_displays > 0)) { const SDL_VideoDisplay *dpy = &dev->displays[0]; - const SDL_DisplayData *dpydata = (SDL_DisplayData *) dpy->driverdata; - x = dpydata->x + (( dpy->current_mode.w - data->dialog_width ) / 2); - y = dpydata->y + (( dpy->current_mode.h - data->dialog_height ) / 3); - } else { /* oh well. This will misposition on a multi-head setup. Init first next time. */ - x = ( DisplayWidth( display, data->screen ) - data->dialog_width ) / 2; - y = ( DisplayHeight( display, data->screen ) - data->dialog_height ) / 3 ; + const SDL_DisplayData *dpydata = (SDL_DisplayData *)dpy->driverdata; + x = dpydata->x + ((dpy->current_mode.w - data->dialog_width) / 2); + y = dpydata->y + ((dpy->current_mode.h - data->dialog_height) / 3); + } else { /* oh well. This will misposition on a multi-head setup. Init first next time. */ + x = (DisplayWidth(display, data->screen) - data->dialog_width) / 2; + y = (DisplayHeight(display, data->screen) - data->dialog_height) / 3; } } - X11_XMoveWindow( display, data->window, x, y ); + X11_XMoveWindow(display, data->window, x, y); sizehints = X11_XAllocSizeHints(); - if ( sizehints ) { + if (sizehints) { sizehints->flags = USPosition | USSize | PMaxSize | PMinSize; sizehints->x = x; sizehints->y = y; @@ -498,14 +498,14 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) sizehints->min_width = sizehints->max_width = data->dialog_width; sizehints->min_height = sizehints->max_height = data->dialog_height; - X11_XSetWMNormalHints( display, data->window, sizehints ); + X11_XSetWMNormalHints(display, data->window, sizehints); - X11_XFree( sizehints ); + X11_XFree(sizehints); } - X11_XMapRaised( display, data->window ); + X11_XMapRaised(display, data->window); -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE /* Initialise a back buffer for double buffering */ if (SDL_X11_HAVE_XDBE) { int xdbe_major, xdbe_minor; @@ -522,71 +522,74 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) } /* Draw our message box. */ -static void -X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx ) +static void X11_MessageBoxDraw(SDL_MessageBoxDataX11 *data, GC ctx) { int i; Drawable window = data->window; Display *display = data->display; -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE if (SDL_X11_HAVE_XDBE && data->xdbe) { window = data->buf; X11_XdbeBeginIdiom(data->display); } #endif - X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ] ); - X11_XFillRectangle( display, window, ctx, 0, 0, data->dialog_width, data->dialog_height ); + X11_XSetForeground(display, ctx, data->color[SDL_MESSAGEBOX_COLOR_BACKGROUND]); + X11_XFillRectangle(display, window, ctx, 0, 0, data->dialog_width, data->dialog_height); - X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] ); - for ( i = 0; i < data->numlines; i++ ) { - TextLineData *plinedata = &data->linedata[ i ]; + X11_XSetForeground(display, ctx, data->color[SDL_MESSAGEBOX_COLOR_TEXT]); + for (i = 0; i < data->numlines; i++) { + TextLineData *plinedata = &data->linedata[i]; +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { - X11_Xutf8DrawString( display, window, data->font_set, ctx, - data->xtext, data->ytext + i * data->text_height, - plinedata->text, plinedata->length ); - } else { - X11_XDrawString( display, window, ctx, - data->xtext, data->ytext + i * data->text_height, - plinedata->text, plinedata->length ); + X11_Xutf8DrawString(display, window, data->font_set, ctx, + data->xtext, data->ytext + i * data->text_height, + plinedata->text, plinedata->length); + } else +#endif + { + X11_XDrawString(display, window, ctx, + data->xtext, data->ytext + i * data->text_height, + plinedata->text, plinedata->length); } } - for ( i = 0; i < data->numbuttons; i++ ) { - SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ i ]; + for (i = 0; i < data->numbuttons; i++) { + SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[i]; const SDL_MessageBoxButtonData *buttondata = buttondatax11->buttondata; - int border = ( buttondata->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT ) ? 2 : 0; - int offset = ( ( data->mouse_over_index == i ) && ( data->button_press_index == data->mouse_over_index ) ) ? 1 : 0; + int border = (buttondata->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) ? 2 : 0; + int offset = ((data->mouse_over_index == i) && (data->button_press_index == data->mouse_over_index)) ? 1 : 0; - X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND ] ); - X11_XFillRectangle( display, window, ctx, - buttondatax11->rect.x - border, buttondatax11->rect.y - border, - buttondatax11->rect.w + 2 * border, buttondatax11->rect.h + 2 * border ); + X11_XSetForeground(display, ctx, data->color[SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND]); + X11_XFillRectangle(display, window, ctx, + buttondatax11->rect.x - border, buttondatax11->rect.y - border, + buttondatax11->rect.w + 2 * border, buttondatax11->rect.h + 2 * border); - X11_XSetForeground( display, ctx, data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_BORDER ] ); - X11_XDrawRectangle( display, window, ctx, - buttondatax11->rect.x, buttondatax11->rect.y, - buttondatax11->rect.w, buttondatax11->rect.h ); + X11_XSetForeground(display, ctx, data->color[SDL_MESSAGEBOX_COLOR_BUTTON_BORDER]); + X11_XDrawRectangle(display, window, ctx, + buttondatax11->rect.x, buttondatax11->rect.y, + buttondatax11->rect.w, buttondatax11->rect.h); - X11_XSetForeground( display, ctx, ( data->mouse_over_index == i ) ? - data->color[ SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED ] : - data->color[ SDL_MESSAGEBOX_COLOR_TEXT ] ); + X11_XSetForeground(display, ctx, (data->mouse_over_index == i) ? data->color[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED] : data->color[SDL_MESSAGEBOX_COLOR_TEXT]); +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { - X11_Xutf8DrawString( display, window, data->font_set, ctx, - buttondatax11->x + offset, - buttondatax11->y + offset, - buttondata->text, buttondatax11->length ); - } else { - X11_XDrawString( display, window, ctx, - buttondatax11->x + offset, buttondatax11->y + offset, - buttondata->text, buttondatax11->length ); + X11_Xutf8DrawString(display, window, data->font_set, ctx, + buttondatax11->x + offset, + buttondatax11->y + offset, + buttondata->text, buttondatax11->length); + } else +#endif + { + X11_XDrawString(display, window, ctx, + buttondatax11->x + offset, buttondatax11->y + offset, + buttondata->text, buttondatax11->length); } } -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE if (SDL_X11_HAVE_XDBE && data->xdbe) { XdbeSwapInfo swap_info; swap_info.swap_window = data->window; @@ -597,16 +600,15 @@ X11_MessageBoxDraw( SDL_MessageBoxDataX11 *data, GC ctx ) #endif } -static Bool -X11_MessageBoxEventTest(Display *display, XEvent *event, XPointer arg) +/* NOLINTNEXTLINE(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ +static Bool X11_MessageBoxEventTest(Display *display, XEvent *event, XPointer arg) { - const SDL_MessageBoxDataX11 *data = (const SDL_MessageBoxDataX11 *) arg; + const SDL_MessageBoxDataX11 *data = (const SDL_MessageBoxDataX11 *)arg; return ((event->xany.display == data->display) && (event->xany.window == data->window)) ? True : False; } /* Loop and handle message box event messages until something kills it. */ -static int -X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) +static int X11_MessageBoxLoop(SDL_MessageBoxDataX11 *data) { GC ctx; XGCValues ctx_vals; @@ -614,40 +616,46 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) SDL_bool has_focus = SDL_TRUE; KeySym last_key_pressed = XK_VoidSymbol; unsigned long gcflags = GCForeground | GCBackground; +#ifdef X_HAVE_UTF8_STRING + const int have_utf8 = SDL_X11_HAVE_UTF8; +#else + const int have_utf8 = 0; +#endif SDL_zero(ctx_vals); - ctx_vals.foreground = data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ]; - ctx_vals.background = data->color[ SDL_MESSAGEBOX_COLOR_BACKGROUND ]; + ctx_vals.foreground = data->color[SDL_MESSAGEBOX_COLOR_BACKGROUND]; + ctx_vals.background = data->color[SDL_MESSAGEBOX_COLOR_BACKGROUND]; - if (!SDL_X11_HAVE_UTF8) { + if (!have_utf8) { gcflags |= GCFont; ctx_vals.font = data->font_struct->fid; } - ctx = X11_XCreateGC( data->display, data->window, gcflags, &ctx_vals ); - if ( ctx == None ) { + ctx = X11_XCreateGC(data->display, data->window, gcflags, &ctx_vals); + if (ctx == None) { return SDL_SetError("Couldn't create graphics context"); } - data->button_press_index = -1; /* Reset what button is currently depressed. */ - data->mouse_over_index = -1; /* Reset what button the mouse is over. */ + data->button_press_index = -1; /* Reset what button is currently depressed. */ + data->mouse_over_index = -1; /* Reset what button the mouse is over. */ - while( !close_dialog ) { + while (!close_dialog) { XEvent e; SDL_bool draw = SDL_TRUE; /* can't use XWindowEvent() because it can't handle ClientMessage events. */ /* can't use XNextEvent() because we only want events for this window. */ - X11_XIfEvent( data->display, &e, X11_MessageBoxEventTest, (XPointer) data ); + X11_XIfEvent(data->display, &e, X11_MessageBoxEventTest, (XPointer)data); /* If X11_XFilterEvent returns True, then some input method has filtered the event, and the client should discard the event. */ - if ( ( e.type != Expose ) && X11_XFilterEvent( &e, None ) ) + if ((e.type != Expose) && X11_XFilterEvent(&e, None)) { continue; + } - switch( e.type ) { + switch (e.type) { case Expose: - if ( e.xexpose.count > 0 ) { + if (e.xexpose.count > 0) { draw = SDL_FALSE; } break; @@ -665,10 +673,10 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) break; case MotionNotify: - if ( has_focus ) { + if (has_focus) { /* Mouse moved... */ const int previndex = data->mouse_over_index; - data->mouse_over_index = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y ); + data->mouse_over_index = GetHitButtonIndex(data, e.xbutton.x, e.xbutton.y); if (data->mouse_over_index == previndex) { draw = SDL_FALSE; } @@ -676,39 +684,42 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) break; case ClientMessage: - if ( e.xclient.message_type == data->wm_protocols && - e.xclient.format == 32 && - e.xclient.data.l[ 0 ] == data->wm_delete_message ) { + if (e.xclient.message_type == data->wm_protocols && + e.xclient.format == 32 && + e.xclient.data.l[0] == data->wm_delete_message) { close_dialog = SDL_TRUE; } break; case KeyPress: /* Store key press - we make sure in key release that we got both. */ - last_key_pressed = X11_XLookupKeysym( &e.xkey, 0 ); + last_key_pressed = X11_XLookupKeysym(&e.xkey, 0); break; - case KeyRelease: { + case KeyRelease: + { Uint32 mask = 0; - KeySym key = X11_XLookupKeysym( &e.xkey, 0 ); + KeySym key = X11_XLookupKeysym(&e.xkey, 0); /* If this is a key release for something we didn't get the key down for, then bail. */ - if ( key != last_key_pressed ) + if (key != last_key_pressed) { break; + } - if ( key == XK_Escape ) + if (key == XK_Escape) { mask = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT; - else if ( ( key == XK_Return ) || ( key == XK_KP_Enter ) ) + } else if ((key == XK_Return) || (key == XK_KP_Enter)) { mask = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT; + } - if ( mask ) { + if (mask) { int i; /* Look for first button with this mask set, and return it if found. */ - for ( i = 0; i < data->numbuttons; i++ ) { - SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ i ]; + for (i = 0; i < data->numbuttons; i++) { + SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[i]; - if ( buttondatax11->buttondata->flags & mask ) { + if (buttondatax11->buttondata->flags & mask) { *data->pbuttonid = buttondatax11->buttondata->buttonid; close_dialog = SDL_TRUE; break; @@ -720,19 +731,19 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) case ButtonPress: data->button_press_index = -1; - if ( e.xbutton.button == Button1 ) { + if (e.xbutton.button == Button1) { /* Find index of button they clicked on. */ - data->button_press_index = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y ); + data->button_press_index = GetHitButtonIndex(data, e.xbutton.x, e.xbutton.y); } break; case ButtonRelease: /* If button is released over the same button that was clicked down on, then return it. */ - if ( ( e.xbutton.button == Button1 ) && ( data->button_press_index >= 0 ) ) { - int button = GetHitButtonIndex( data, e.xbutton.x, e.xbutton.y ); + if ((e.xbutton.button == Button1) && (data->button_press_index >= 0)) { + int button = GetHitButtonIndex(data, e.xbutton.x, e.xbutton.y); - if ( data->button_press_index == button ) { - SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[ button ]; + if (data->button_press_index == button) { + SDL_MessageBoxButtonDataX11 *buttondatax11 = &data->buttonpos[button]; *data->pbuttonid = buttondatax11->buttondata->buttonid; close_dialog = SDL_TRUE; @@ -742,18 +753,17 @@ X11_MessageBoxLoop( SDL_MessageBoxDataX11 *data ) break; } - if ( draw ) { + if (draw) { /* Draw our dialog box. */ - X11_MessageBoxDraw( data, ctx ); + X11_MessageBoxDraw(data, ctx); } } - X11_XFreeGC( data->display, ctx ); + X11_XFreeGC(data->display, ctx); return 0; } -static int -X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid) +static int X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid) { int ret; SDL_MessageBoxDataX11 data; @@ -763,17 +773,18 @@ X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid) SDL_zero(data); - if ( !SDL_X11_LoadSymbols() ) + if (!SDL_X11_LoadSymbols()) { return -1; + } #if SDL_SET_LOCALE origlocale = setlocale(LC_ALL, NULL); - if (origlocale != NULL) { + if (origlocale) { origlocale = SDL_strdup(origlocale); - if (origlocale == NULL) { + if (!origlocale) { return SDL_OutOfMemory(); } - setlocale(LC_ALL, ""); + (void)setlocale(LC_ALL, ""); } #endif @@ -784,22 +795,22 @@ X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid) *buttonid = -1; /* Init and display the message box. */ - ret = X11_MessageBoxInit( &data, messageboxdata, buttonid ); - if ( ret != -1 ) { - ret = X11_MessageBoxInitPositions( &data ); - if ( ret != -1 ) { - ret = X11_MessageBoxCreateWindow( &data ); - if ( ret != -1 ) { - ret = X11_MessageBoxLoop( &data ); + ret = X11_MessageBoxInit(&data, messageboxdata, buttonid); + if (ret != -1) { + ret = X11_MessageBoxInitPositions(&data); + if (ret != -1) { + ret = X11_MessageBoxCreateWindow(&data); + if (ret != -1) { + ret = X11_MessageBoxLoop(&data); } } } - X11_MessageBoxShutdown( &data ); + X11_MessageBoxShutdown(&data); #if SDL_SET_LOCALE if (origlocale) { - setlocale(LC_ALL, origlocale); + (void)setlocale(LC_ALL, origlocale); SDL_free(origlocale); } #endif @@ -808,8 +819,7 @@ X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid) } /* Display an x11 message box. */ -int -X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) +int X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) { #if SDL_FORK_MESSAGEBOX /* Use a child process to protect against setlocale(). Annoying. */ @@ -822,34 +832,34 @@ X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) } pid = fork(); - if (pid == -1) { /* failed */ + if (pid == -1) { /* failed */ close(fds[0]); close(fds[1]); return X11_ShowMessageBoxImpl(messageboxdata, buttonid); /* oh well. */ - } else if (pid == 0) { /* we're the child */ + } else if (pid == 0) { /* we're the child */ int exitcode = 0; close(fds[0]); status = X11_ShowMessageBoxImpl(messageboxdata, buttonid); - if (write(fds[1], &status, sizeof (int)) != sizeof (int)) { + if (write(fds[1], &status, sizeof(int)) != sizeof(int)) { exitcode = 1; - } else if (write(fds[1], buttonid, sizeof (int)) != sizeof (int)) { + } else if (write(fds[1], buttonid, sizeof(int)) != sizeof(int)) { exitcode = 1; } close(fds[1]); - _exit(exitcode); /* don't run atexit() stuff, static destructors, etc. */ - } else { /* we're the parent */ + _exit(exitcode); /* don't run atexit() stuff, static destructors, etc. */ + } else { /* we're the parent */ pid_t rc; close(fds[1]); do { rc = waitpid(pid, &status, 0); } while ((rc == -1) && (errno == EINTR)); - SDL_assert(rc == pid); /* not sure what to do if this fails. */ + SDL_assert(rc == pid); /* not sure what to do if this fails. */ if ((rc == -1) || (!WIFEXITED(status)) || (WEXITSTATUS(status) != 0)) { status = SDL_SetError("msgbox child process failed"); - } else if ( (read(fds[0], &status, sizeof (int)) != sizeof (int)) || - (read(fds[0], buttonid, sizeof (int)) != sizeof (int)) ) { + } else if ((read(fds[0], &status, sizeof(int)) != sizeof(int)) || + (read(fds[0], buttonid, sizeof(int)) != sizeof(int))) { status = SDL_SetError("read from msgbox child process failed"); *buttonid = 0; } diff --git a/src/video/x11/SDL_x11messagebox.h b/src/video/x11/SDL_x11messagebox.h index bb85a65254583..6232b350b0517 100644 --- a/src/video/x11/SDL_x11messagebox.h +++ b/src/video/x11/SDL_x11messagebox.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,7 @@ #ifndef SDL_x11messagebox_h_ #define SDL_x11messagebox_h_ -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 extern int X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index da63afdcbf8b6..842836ca56248 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_hints.h" #include "SDL_x11video.h" @@ -38,12 +38,10 @@ * fullscreen state hint but be decorated and windowed. * * However, many people swear by it, so let them swear at it. :) -*/ + */ /* #define XRANDR_DISABLED_BY_DEFAULT */ - -static int -get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) +static int get_visualinfo(Display *display, int screen, XVisualInfo *vinfo) { const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID"); int depth; @@ -74,8 +72,7 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) return -1; } -int -X11_GetVisualInfoFromVisual(Display * display, Visual * visual, XVisualInfo * vinfo) +int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, XVisualInfo *vinfo) { XVisualInfo *vi; int nvis; @@ -90,8 +87,7 @@ X11_GetVisualInfoFromVisual(Display * display, Visual * visual, XVisualInfo * vi return -1; } -Uint32 -X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo) +Uint32 X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo) { if (vinfo->class == DirectColor || vinfo->class == TrueColor) { int bpp; @@ -148,9 +144,8 @@ X11_GetPixelFormatFromVisualInfo(Display * display, XVisualInfo * vinfo) return SDL_PIXELFORMAT_UNKNOWN; } -#if SDL_VIDEO_DRIVER_X11_XRANDR -static SDL_bool -CheckXRandR(Display * display, int *major, int *minor) +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR +static SDL_bool CheckXRandR(Display *display, int *major, int *minor) { /* Default the extension not available */ *major = *minor = 0; @@ -180,7 +175,8 @@ CheckXRandR(Display * display, int *major, int *minor) } /* Query the extension version */ - *major = 1; *minor = 3; /* we want 1.3 */ + *major = 1; + *minor = 3; /* we want 1.3 */ if (!X11_XRRQueryVersion(display, major, minor)) { #ifdef X11MODES_DEBUG printf("XRandR not active on the display\n"); @@ -194,19 +190,16 @@ CheckXRandR(Display * display, int *major, int *minor) return SDL_TRUE; } -#define XRANDR_ROTATION_LEFT (1 << 1) -#define XRANDR_ROTATION_RIGHT (1 << 3) +#define XRANDR_ROTATION_LEFT (1 << 1) +#define XRANDR_ROTATION_RIGHT (1 << 3) -static int -CalculateXRandRRefreshRate(const XRRModeInfo *info) +static int CalculateXRandRRefreshRate(const XRRModeInfo *info) { - return (info->hTotal && info->vTotal) ? - SDL_round(((double)info->dotClock / (double)(info->hTotal * info->vTotal))) : 0; + return (info->hTotal && info->vTotal) ? SDL_round(((double)info->dotClock / (double)(info->hTotal * info->vTotal))) : 0; } -static SDL_bool -SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, - RRMode modeID, SDL_DisplayMode *mode) +static SDL_bool SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, + RRMode modeID, SDL_DisplayMode *mode) { int i; for (i = 0; i < res->nmode; ++i) { @@ -221,7 +214,7 @@ SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, X11_XRRFreeCrtcInfo(crtcinfo); } - if (rotation & (XRANDR_ROTATION_LEFT|XRANDR_ROTATION_RIGHT)) { + if (rotation & (XRANDR_ROTATION_LEFT | XRANDR_ROTATION_RIGHT)) { mode->w = info->height; mode->h = info->width; } else { @@ -229,9 +222,9 @@ SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, mode->h = info->height; } mode->refresh_rate = CalculateXRandRRefreshRate(info); - ((SDL_DisplayModeData*)mode->driverdata)->xrandr_mode = modeID; + ((SDL_DisplayModeData *)mode->driverdata)->xrandr_mode = modeID; #ifdef X11MODES_DEBUG - printf("XRandR mode %d: %dx%d@%dHz\n", (int) modeID, mode->w, mode->h, mode->refresh_rate); + printf("XRandR mode %d: %dx%d@%dHz\n", (int)modeID, mode->w, mode->h, mode->refresh_rate); #endif return SDL_TRUE; } @@ -239,8 +232,7 @@ SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, return SDL_FALSE; } -static void -SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, RROutput output, const unsigned long widthmm, const unsigned long heightmm) +static void SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, RROutput output, const unsigned long widthmm, const unsigned long heightmm) { /* See if we can get the EDID data for the real monitor name */ int inches; @@ -281,7 +273,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, inches = (int)((SDL_sqrtf(widthmm * widthmm + heightmm * heightmm) / 25.4f) + 0.5f); if (*name && inches) { const size_t len = SDL_strlen(name); - SDL_snprintf(&name[len], namelen-len, " %d\"", inches); + (void)SDL_snprintf(&name[len], namelen - len, " %d\"", inches); } #ifdef X11MODES_DEBUG @@ -289,9 +281,7 @@ SetXRandRDisplayName(Display *dpy, Atom EDID, char *name, const size_t namelen, #endif } - -static int -X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScreenResources *res, SDL_bool send_event) +static int X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScreenResources *res, SDL_bool send_event) { Atom EDID = X11_XInternAtom(dpy, "EDID", False); XRROutputInfo *output_info; @@ -312,12 +302,12 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre int i, n; if (get_visualinfo(dpy, screen, &vinfo) < 0) { - return 0; /* uh, skip this screen? */ + return 0; /* uh, skip this screen? */ } pixelformat = X11_GetPixelFormatFromVisualInfo(dpy, &vinfo); if (SDL_ISPIXELFORMAT_INDEXED(pixelformat)) { - return 0; /* Palettized video modes are no longer supported, ignore this one. */ + return 0; /* Palettized video modes are no longer supported, ignore this one. */ } scanline_pad = SDL_BYTESPERPIXEL(pixelformat) * 8; @@ -335,7 +325,7 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre output_info = X11_XRRGetOutputInfo(dpy, res, outputid); if (!output_info || !output_info->crtc || output_info->connection == RR_Disconnected) { X11_XRRFreeOutputInfo(output_info); - return 0; /* ignore this one. */ + return 0; /* ignore this one. */ } SDL_strlcpy(display_name, output_info->name, sizeof(display_name)); @@ -346,7 +336,7 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre crtc = X11_XRRGetCrtcInfo(dpy, res, output_crtc); if (!crtc) { - return 0; /* oh well, ignore it. */ + return 0; /* oh well, ignore it. */ } SDL_zero(mode); @@ -360,12 +350,12 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre X11_XRRFreeCrtcInfo(crtc); - displaydata = (SDL_DisplayData *) SDL_calloc(1, sizeof(*displaydata)); + displaydata = (SDL_DisplayData *)SDL_calloc(1, sizeof(*displaydata)); if (!displaydata) { return SDL_OutOfMemory(); } - modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + modedata = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData)); if (!modedata) { SDL_free(displaydata); return SDL_OutOfMemory(); @@ -377,9 +367,9 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre displaydata->screen = screen; displaydata->visual = vinfo.visual; displaydata->depth = vinfo.depth; - displaydata->hdpi = display_mm_width ? (((float) mode.w) * 25.4f / display_mm_width) : 0.0f; - displaydata->vdpi = display_mm_height ? (((float) mode.h) * 25.4f / display_mm_height) : 0.0f; - displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f); + displaydata->hdpi = display_mm_width ? (((float)mode.w) * 25.4f / display_mm_width) : 0.0f; + displaydata->vdpi = display_mm_height ? (((float)mode.h) * 25.4f / display_mm_height) : 0.0f; + displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float)display_mm_width) / 25.4f, ((float)display_mm_height) / 25.4f); displaydata->scanline_pad = scanline_pad; displaydata->x = display_x; displaydata->y = display_y; @@ -387,7 +377,7 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre displaydata->xrandr_output = outputid; SetXRandRModeInfo(dpy, res, output_crtc, modeID, &mode); - SetXRandRDisplayName(dpy, EDID, display_name, sizeof (display_name), outputid, display_mm_width, display_mm_height); + SetXRandRDisplayName(dpy, EDID, display_name, sizeof(display_name), outputid, display_mm_width, display_mm_height); SDL_zero(display); if (*display_name) { @@ -399,21 +389,20 @@ X11_AddXRandRDisplay(_THIS, Display *dpy, int screen, RROutput outputid, XRRScre return SDL_AddVideoDisplay(&display, send_event); } -static void -X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent *ev) +static void X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent *ev) { const int num_displays = SDL_GetNumVideoDisplays(); SDL_VideoDisplay *display = NULL; int displayidx = -1; int i; - #if 0 +#if 0 printf("XRROutputChangeNotifyEvent! [output=%u, crtc=%u, mode=%u, rotation=%u, connection=%u]", (unsigned int) ev->output, (unsigned int) ev->crtc, (unsigned int) ev->mode, (unsigned int) ev->rotation, (unsigned int) ev->connection); - #endif +#endif for (i = 0; i < num_displays; i++) { SDL_VideoDisplay *thisdisplay = SDL_GetDisplay(i); - const SDL_DisplayData *displaydata = (const SDL_DisplayData *) thisdisplay->driverdata; + const SDL_DisplayData *displaydata = (const SDL_DisplayData *)thisdisplay->driverdata; if (displaydata->xrandr_output == ev->output) { display = thisdisplay; displayidx = i; @@ -423,12 +412,12 @@ X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent *ev) SDL_assert((displayidx == -1) == (display == NULL)); - if (ev->connection == RR_Disconnected) { /* output is going away */ - if (display != NULL) { + if (ev->connection == RR_Disconnected) { /* output is going away */ + if (display) { SDL_DelVideoDisplay(displayidx); } - } else if (ev->connection == RR_Connected) { /* output is coming online */ - if (display != NULL) { + } else if (ev->connection == RR_Connected) { /* output is coming online */ + if (display) { /* !!! FIXME: update rotation or current mode of existing display? */ } else { Display *dpy = ev->display; @@ -452,26 +441,23 @@ X11_HandleXRandROutputChange(_THIS, const XRROutputChangeNotifyEvent *ev) } } -void -X11_HandleXRandREvent(_THIS, const XEvent *xevent) +void X11_HandleXRandREvent(_THIS, const XEvent *xevent) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_assert(xevent->type == (videodata->xrandr_event_base + RRNotify)); - switch (((const XRRNotifyEvent *) xevent)->subtype) { - case RRNotify_OutputChange: - X11_HandleXRandROutputChange(_this, (const XRROutputChangeNotifyEvent *) xevent); - break; - default: - break; + switch (((const XRRNotifyEvent *)xevent)->subtype) { + case RRNotify_OutputChange: + X11_HandleXRandROutputChange(_this, (const XRROutputChangeNotifyEvent *)xevent); + break; + default: + break; } } - -static int -X11_InitModes_XRandR(_THIS) +static int X11_InitModes_XRandR(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *dpy = data->display; const int screencount = ScreenCount(dpy); const int default_screen = DefaultScreen(dpy); @@ -532,15 +518,14 @@ X11_InitModes_XRandR(_THIS) } #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ -static int -GetXftDPI(Display* dpy) +static int GetXftDPI(Display *dpy) { - char* xdefault_resource; + char *xdefault_resource; int xft_dpi, err; xdefault_resource = X11_XGetDefault(dpy, "Xft", "dpi"); - if(!xdefault_resource) { + if (!xdefault_resource) { return 0; } @@ -562,7 +547,7 @@ GetXftDPI(Display* dpy) static int X11_InitModes_StdXlib(_THIS) { /* !!! FIXME: a lot of copy/paste from X11_InitModes_XRandR in this function. */ - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *dpy = data->display; const int default_screen = DefaultScreen(dpy); Screen *screen = ScreenOfDisplay(dpy, default_screen); @@ -590,14 +575,14 @@ static int X11_InitModes_StdXlib(_THIS) mode.w = WidthOfScreen(screen); mode.h = HeightOfScreen(screen); mode.format = pixelformat; - mode.refresh_rate = 0; /* don't know it, sorry. */ + mode.refresh_rate = 0; /* don't know it, sorry. */ - displaydata = (SDL_DisplayData *) SDL_calloc(1, sizeof(*displaydata)); + displaydata = (SDL_DisplayData *)SDL_calloc(1, sizeof(*displaydata)); if (!displaydata) { return SDL_OutOfMemory(); } - modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + modedata = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData)); if (!modedata) { SDL_free(displaydata); return SDL_OutOfMemory(); @@ -610,12 +595,12 @@ static int X11_InitModes_StdXlib(_THIS) displaydata->screen = default_screen; displaydata->visual = vinfo.visual; displaydata->depth = vinfo.depth; - displaydata->hdpi = display_mm_width ? (((float) mode.w) * 25.4f / display_mm_width) : 0.0f; - displaydata->vdpi = display_mm_height ? (((float) mode.h) * 25.4f / display_mm_height) : 0.0f; - displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float) display_mm_width) / 25.4f,((float) display_mm_height) / 25.4f); + displaydata->hdpi = display_mm_width ? (((float)mode.w) * 25.4f / display_mm_width) : 0.0f; + displaydata->vdpi = display_mm_height ? (((float)mode.h) * 25.4f / display_mm_height) : 0.0f; + displaydata->ddpi = SDL_ComputeDiagonalDPI(mode.w, mode.h, ((float)display_mm_width) / 25.4f, ((float)display_mm_height) / 25.4f); xft_dpi = GetXftDPI(dpy); - if(xft_dpi > 0) { + if (xft_dpi > 0) { displaydata->hdpi = (float)xft_dpi; displaydata->vdpi = (float)xft_dpi; } @@ -638,7 +623,7 @@ static int X11_InitModes_StdXlib(_THIS) displaydata->use_xrandr = SDL_FALSE; SDL_zero(display); - display.name = (char *) "Generic X11 Display"; /* this is just copied and thrown away, it's safe to cast to char* here. */ + display.name = (char *)"Generic X11 Display"; /* this is just copied and thrown away, it's safe to cast to char* here. */ display.desktop_mode = mode; display.current_mode = mode; display.driverdata = displaydata; @@ -647,21 +632,20 @@ static int X11_InitModes_StdXlib(_THIS) return 0; } - -int -X11_InitModes(_THIS) +int X11_InitModes(_THIS) { /* XRandR is the One True Modern Way to do this on X11. If this fails, we just won't report any display modes except the current desktop size. */ -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int xrandr_major, xrandr_minor; /* require at least XRandR v1.3 */ if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) && - (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3))) { - return X11_InitModes_XRandR(_this); + (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3)) && + X11_InitModes_XRandR(_this) == 0) { + return 0; } } #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */ @@ -670,10 +654,9 @@ X11_InitModes(_THIS) return X11_InitModes_StdXlib(_this); } -void -X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) +void X11_GetDisplayModes(_THIS, SDL_VideoDisplay *sdl_display) { - SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata; SDL_DisplayMode mode; /* Unfortunately X11 requires the window to be created with the correct @@ -685,12 +668,12 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) mode.format = sdl_display->current_mode.format; mode.driverdata = NULL; -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR if (data->use_xrandr) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; XRRScreenResources *res; - res = X11_XRRGetScreenResources (display, RootWindow(display, data->screen)); + res = X11_XRRGetScreenResources(display, RootWindow(display, data->screen)); if (res) { SDL_DisplayModeData *modedata; XRROutputInfo *output_info; @@ -699,7 +682,7 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) output_info = X11_XRRGetOutputInfo(display, res, data->xrandr_output); if (output_info && output_info->connection != RR_Disconnected) { for (i = 0; i < output_info->nmode; ++i) { - modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + modedata = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData)); if (!modedata) { continue; } @@ -722,7 +705,7 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) SDL_DisplayModeData *modedata; /* Add the desktop mode */ mode = sdl_display->desktop_mode; - modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData)); + modedata = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData)); if (modedata) { *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata; } @@ -733,12 +716,11 @@ X11_GetDisplayModes(_THIS, SDL_VideoDisplay * sdl_display) } } -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR /* This catches an error from XRRSetScreenSize, as a workaround for now. */ /* !!! FIXME: remove this later when we have a better solution. */ static int (*PreXRRSetScreenSizeErrorHandler)(Display *, XErrorEvent *) = NULL; -static int -SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) +static int SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) { /* BadMatch: https://github.com/libsdl-org/SDL/issues/4561 */ /* BadValue: https://github.com/libsdl-org/SDL/issues/4840 */ @@ -750,15 +732,14 @@ SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) } #endif -int -X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode) +int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *sdl_display, SDL_DisplayMode *mode) { - SDL_VideoData *viddata = (SDL_VideoData *) _this->driverdata; - SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; + SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata; viddata->last_mode_change_deadline = SDL_GetTicks() + (PENDING_FOCUS_TIME * 2); -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR if (data->use_xrandr) { Display *display = viddata->display; SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; @@ -768,7 +749,7 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode XRRCrtcInfo *crtc; Status status; - res = X11_XRRGetScreenResources (display, RootWindow(display, data->screen)); + res = X11_XRRGetScreenResources(display, RootWindow(display, data->screen)); if (!res) { return SDL_SetError("Couldn't get XRandR screen resources"); } @@ -797,7 +778,7 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode X11_XGrabServer(display); status = X11_XRRSetCrtcConfig(display, res, output_info->crtc, CurrentTime, - 0, 0, None, crtc->rotation, NULL, 0); + 0, 0, None, crtc->rotation, NULL, 0); if (status != Success) { goto ungrabServer; } @@ -818,13 +799,13 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode X11_XSync(display, False); X11_XSetErrorHandler(PreXRRSetScreenSizeErrorHandler); - status = X11_XRRSetCrtcConfig (display, res, output_info->crtc, CurrentTime, - crtc->x, crtc->y, modedata->xrandr_mode, crtc->rotation, - &data->xrandr_output, 1); + status = X11_XRRSetCrtcConfig(display, res, output_info->crtc, CurrentTime, + crtc->x, crtc->y, modedata->xrandr_mode, crtc->rotation, + &data->xrandr_output, 1); -ungrabServer: + ungrabServer: X11_XUngrabServer(display); -freeInfo: + freeInfo: X11_XRRFreeCrtcInfo(crtc); X11_XRRFreeOutputInfo(output_info); X11_XRRFreeScreenResources(res); @@ -840,15 +821,13 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode return 0; } -void -X11_QuitModes(_THIS) +void X11_QuitModes(_THIS) { } -int -X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) +int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { - SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata; rect->x = data->x; rect->y = data->y; @@ -858,10 +837,9 @@ X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) return 0; } -int -X11_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi) +int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi) { - SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)sdl_display->driverdata; if (ddpi) { *ddpi = data->ddpi; @@ -876,10 +854,9 @@ X11_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * h return data->ddpi != 0.0f ? 0 : SDL_SetError("Couldn't get DPI"); } -int -X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect) +int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *display = data->display; Atom _NET_WORKAREA; int status, real_format; @@ -898,7 +875,7 @@ X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rec &real_type, &real_format, &items_read, &items_left, &propdata); if ((status == Success) && (items_read >= 4)) { - const long *p = (long*) propdata; + const long *p = (long *)propdata; const SDL_Rect usable = { (int)p[0], (int)p[1], (int)p[2], (int)p[3] }; retval = 0; if (!SDL_IntersectRect(rect, &usable, rect)) { diff --git a/src/video/x11/SDL_x11modes.h b/src/video/x11/SDL_x11modes.h index 9a4257e430cde..31dec38cdaab1 100644 --- a/src/video/x11/SDL_x11modes.h +++ b/src/video/x11/SDL_x11modes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,35 +37,35 @@ typedef struct SDL_bool use_xrandr; -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR RROutput xrandr_output; #endif } SDL_DisplayData; typedef struct { -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR RRMode xrandr_mode; #else - int unused; /* just so struct isn't empty. */ + int unused; /* just so struct isn't empty. */ #endif } SDL_DisplayModeData; extern int X11_InitModes(_THIS); -extern void X11_GetDisplayModes(_THIS, SDL_VideoDisplay * display); -extern int X11_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); +extern void X11_GetDisplayModes(_THIS, SDL_VideoDisplay *display); +extern int X11_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern void X11_QuitModes(_THIS); /* Some utility functions for working with visuals */ -extern int X11_GetVisualInfoFromVisual(Display * display, Visual * visual, - XVisualInfo * vinfo); -extern Uint32 X11_GetPixelFormatFromVisualInfo(Display * display, - XVisualInfo * vinfo); -extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect); -extern int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect); -extern int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay * sdl_display, float * ddpi, float * hdpi, float * vdpi); +extern int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, + XVisualInfo *vinfo); +extern Uint32 X11_GetPixelFormatFromVisualInfo(Display *display, + XVisualInfo *vinfo); +extern int X11_GetDisplayBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); +extern int X11_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); +extern int X11_GetDisplayDPI(_THIS, SDL_VideoDisplay *sdl_display, float *ddpi, float *hdpi, float *vdpi); -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR extern void X11_HandleXRandREvent(_THIS, const XEvent *xevent); #endif diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 96a25a2b9ecce..df5f968d63820 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include #include "SDL_x11video.h" @@ -28,18 +28,16 @@ #include "SDL_x11xinput2.h" #include "../../events/SDL_mouse_c.h" - /* FIXME: Find a better place to put this... */ static Cursor x11_empty_cursor = None; +static SDL_bool x11_cursor_visible = SDL_TRUE; -static Display * -GetDisplay(void) +static Display *GetDisplay(void) { return ((SDL_VideoData *)SDL_GetVideoDevice()->driverdata)->display; } -static Cursor -X11_CreateEmptyCursor() +static Cursor X11_CreateEmptyCursor() { if (x11_empty_cursor == None) { Display *display = GetDisplay(); @@ -50,18 +48,17 @@ X11_CreateEmptyCursor() SDL_zeroa(data); color.red = color.green = color.blue = 0; pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display), - data, 1, 1); + data, 1, 1); if (pixmap) { x11_empty_cursor = X11_XCreatePixmapCursor(display, pixmap, pixmap, - &color, &color, 0, 0); + &color, &color, 0, 0); X11_XFreePixmap(display, pixmap); } } return x11_empty_cursor; } -static void -X11_DestroyEmptyCursor(void) +static void X11_DestroyEmptyCursor(void) { if (x11_empty_cursor != None) { X11_XFreeCursor(GetDisplay(), x11_empty_cursor); @@ -69,15 +66,14 @@ X11_DestroyEmptyCursor(void) } } -static SDL_Cursor * -X11_CreateDefaultCursor() +static SDL_Cursor *X11_CreateDefaultCursor() { SDL_Cursor *cursor; cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* None is used to indicate the default cursor */ - cursor->driverdata = (void*)(uintptr_t)None; + cursor->driverdata = (void *)(uintptr_t)None; } else { SDL_OutOfMemory(); } @@ -85,9 +81,8 @@ X11_CreateDefaultCursor() return cursor; } -#if SDL_VIDEO_DRIVER_X11_XCURSOR -static Cursor -X11_CreateXCursorCursor(SDL_Surface * surface, int hot_x, int hot_y) +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR +static Cursor X11_CreateXCursorCursor(SDL_Surface *surface, int hot_x, int hot_y) { Display *display = GetDisplay(); Cursor cursor = None; @@ -104,7 +99,7 @@ X11_CreateXCursorCursor(SDL_Surface * surface, int hot_x, int hot_y) SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); - SDL_memcpy(image->pixels, surface->pixels, surface->h * surface->pitch); + SDL_memcpy(image->pixels, surface->pixels, (size_t)surface->h * surface->pitch); cursor = X11_XcursorImageLoadCursor(display, image); @@ -114,8 +109,7 @@ X11_CreateXCursorCursor(SDL_Surface * surface, int hot_x, int hot_y) } #endif /* SDL_VIDEO_DRIVER_X11_XCURSOR */ -static Cursor -X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) +static Cursor X11_CreatePixmapCursor(SDL_Surface *surface, int hot_x, int hot_y) { Display *display = GetDisplay(); XColor fg, bg; @@ -125,7 +119,7 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) Pixmap data_pixmap, mask_pixmap; int x, y; unsigned int rfg, gfg, bfg, rbg, gbg, bbg, fgBits, bgBits; - unsigned int width_bytes = ((surface->w + 7) & ~7) / 8; + size_t width_bytes = ((surface->w + 7) & ~((size_t)7)) / 8; data_bits = SDL_calloc(1, surface->h * width_bytes); if (!data_bits) { @@ -148,9 +142,9 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) ptr = (Uint32 *)((Uint8 *)surface->pixels + y * surface->pitch); for (x = 0; x < surface->w; ++x) { int alpha = (*ptr >> 24) & 0xff; - int red = (*ptr >> 16) & 0xff; + int red = (*ptr >> 16) & 0xff; int green = (*ptr >> 8) & 0xff; - int blue = (*ptr >> 0) & 0xff; + int blue = (*ptr >> 0) & 0xff; if (alpha > 25) { mask_bits[y * width_bytes + x / 8] |= (0x01 << (x % 8)); @@ -172,27 +166,29 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) } if (fgBits) { - fg.red = rfg * 257 / fgBits; + fg.red = rfg * 257 / fgBits; fg.green = gfg * 257 / fgBits; - fg.blue = bfg * 257 / fgBits; + fg.blue = bfg * 257 / fgBits; + } else { + fg.red = fg.green = fg.blue = 0; } - else fg.red = fg.green = fg.blue = 0; if (bgBits) { - bg.red = rbg * 257 / bgBits; + bg.red = rbg * 257 / bgBits; bg.green = gbg * 257 / bgBits; - bg.blue = bbg * 257 / bgBits; + bg.blue = bbg * 257 / bgBits; + } else { + bg.red = bg.green = bg.blue = 0; } - else bg.red = bg.green = bg.blue = 0; data_pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display), - (char*)data_bits, - surface->w, surface->h); + (char *)data_bits, + surface->w, surface->h); mask_pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display), - (char*)mask_bits, - surface->w, surface->h); + (char *)mask_bits, + surface->w, surface->h); cursor = X11_XCreatePixmapCursor(display, data_pixmap, mask_pixmap, - &fg, &bg, hot_x, hot_y); + &fg, &bg, hot_x, hot_y); X11_XFreePixmap(display, data_pixmap); X11_XFreePixmap(display, mask_pixmap); SDL_free(data_bits); @@ -201,8 +197,7 @@ X11_CreatePixmapCursor(SDL_Surface * surface, int hot_x, int hot_y) return cursor; } -static SDL_Cursor * -X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) +static SDL_Cursor *X11_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) { SDL_Cursor *cursor; @@ -210,7 +205,7 @@ X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) if (cursor) { Cursor x11_cursor = None; -#if SDL_VIDEO_DRIVER_X11_XCURSOR +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR if (SDL_X11_HAVE_XCURSOR) { x11_cursor = X11_CreateXCursorCursor(surface, hot_x, hot_y); } @@ -218,7 +213,7 @@ X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) if (x11_cursor == None) { x11_cursor = X11_CreatePixmapCursor(surface, hot_x, hot_y); } - cursor->driverdata = (void*)(uintptr_t)x11_cursor; + cursor->driverdata = (void *)(uintptr_t)x11_cursor; } else { SDL_OutOfMemory(); } @@ -226,49 +221,59 @@ X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) return cursor; } -static SDL_Cursor * -X11_CreateSystemCursor(SDL_SystemCursor id) +static unsigned int GetLegacySystemCursorShape(SDL_SystemCursor id) { - SDL_Cursor *cursor; - unsigned int shape; - - switch(id) - { - default: - SDL_assert(0); - return NULL; - /* X Font Cursors reference: */ - /* http://tronche.com/gui/x/xlib/appendix/b/ */ - case SDL_SYSTEM_CURSOR_ARROW: shape = XC_left_ptr; break; - case SDL_SYSTEM_CURSOR_IBEAM: shape = XC_xterm; break; - case SDL_SYSTEM_CURSOR_WAIT: shape = XC_watch; break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: shape = XC_tcross; break; - case SDL_SYSTEM_CURSOR_WAITARROW: shape = XC_watch; break; - case SDL_SYSTEM_CURSOR_SIZENWSE: shape = XC_top_left_corner; break; - case SDL_SYSTEM_CURSOR_SIZENESW: shape = XC_top_right_corner; break; - case SDL_SYSTEM_CURSOR_SIZEWE: shape = XC_sb_h_double_arrow; break; - case SDL_SYSTEM_CURSOR_SIZENS: shape = XC_sb_v_double_arrow; break; - case SDL_SYSTEM_CURSOR_SIZEALL: shape = XC_fleur; break; - case SDL_SYSTEM_CURSOR_NO: shape = XC_pirate; break; - case SDL_SYSTEM_CURSOR_HAND: shape = XC_hand2; break; + switch (id) { + /* X Font Cursors reference: */ + /* http://tronche.com/gui/x/xlib/appendix/b/ */ + case SDL_SYSTEM_CURSOR_ARROW: return XC_left_ptr; + case SDL_SYSTEM_CURSOR_IBEAM: return XC_xterm; + case SDL_SYSTEM_CURSOR_WAIT: return XC_watch; + case SDL_SYSTEM_CURSOR_CROSSHAIR: return XC_tcross; + case SDL_SYSTEM_CURSOR_WAITARROW: return XC_watch; + case SDL_SYSTEM_CURSOR_SIZENWSE: return XC_top_left_corner; + case SDL_SYSTEM_CURSOR_SIZENESW: return XC_top_right_corner; + case SDL_SYSTEM_CURSOR_SIZEWE: return XC_sb_h_double_arrow; + case SDL_SYSTEM_CURSOR_SIZENS: return XC_sb_v_double_arrow; + case SDL_SYSTEM_CURSOR_SIZEALL: return XC_fleur; + case SDL_SYSTEM_CURSOR_NO: return XC_pirate; + case SDL_SYSTEM_CURSOR_HAND: return XC_hand2; + case SDL_NUM_SYSTEM_CURSORS: break; /* so the compiler might notice if an enum value is missing here. */ } - cursor = SDL_calloc(1, sizeof(*cursor)); - if (cursor) { - Cursor x11_cursor; + SDL_assert(0); + return 0; +} - x11_cursor = X11_XCreateFontCursor(GetDisplay(), shape); +static SDL_Cursor *X11_CreateSystemCursor(SDL_SystemCursor id) +{ + SDL_Cursor *cursor = NULL; + Display *dpy = GetDisplay(); + Cursor x11_cursor = None; - cursor->driverdata = (void*)(uintptr_t)x11_cursor; - } else { - SDL_OutOfMemory(); +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR + if (SDL_X11_HAVE_XCURSOR) { + x11_cursor = X11_XcursorLibraryLoadCursor(dpy, SDL_GetCSSCursorName(id, NULL)); + } +#endif + + if (x11_cursor == None) { + x11_cursor = X11_XCreateFontCursor(dpy, GetLegacySystemCursorShape(id)); + } + + if (x11_cursor != None) { + cursor = SDL_calloc(1, sizeof(*cursor)); + if (!cursor) { + SDL_OutOfMemory(); + } else { + cursor->driverdata = (void *)(uintptr_t)x11_cursor; + } } return cursor; } -static void -X11_FreeCursor(SDL_Cursor * cursor) +static void X11_FreeCursor(SDL_Cursor *cursor) { Cursor x11_cursor = (Cursor)cursor->driverdata; @@ -278,8 +283,7 @@ X11_FreeCursor(SDL_Cursor * cursor) SDL_free(cursor); } -static int -X11_ShowCursor(SDL_Cursor * cursor) +static int X11_ShowCursor(SDL_Cursor *cursor) { Cursor x11_cursor = 0; @@ -295,6 +299,8 @@ X11_ShowCursor(SDL_Cursor * cursor) Display *display = GetDisplay(); SDL_Window *window; + x11_cursor_visible = !!cursor; + for (window = video->windows; window; window = window->next) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (data) { @@ -310,36 +316,53 @@ X11_ShowCursor(SDL_Cursor * cursor) return 0; } -static void -WarpMouseInternal(Window xwindow, const int x, const int y) +static void WarpMouseInternal(Window xwindow, const int x, const int y) { - SDL_VideoData *videodata = (SDL_VideoData *) SDL_GetVideoDevice()->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)SDL_GetVideoDevice()->driverdata; Display *display = videodata->display; -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 int deviceid = 0; - /* It seems XIWarpPointer() doesn't work correctly on multi-head setups: - * https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea - */ - if (ScreenCount(display) == 1) { - X11_XIGetClientPointer(display, None, &deviceid); +#endif + SDL_bool warp_hack = SDL_FALSE; + + /* XWayland will only warp the cursor if it is hidden, so this workaround is required. */ + if (videodata->is_xwayland && x11_cursor_visible) { + warp_hack = SDL_TRUE; + } + + if (warp_hack) { + X11_ShowCursor(NULL); + } +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 + if (X11_Xinput2IsInitialized()) { + /* It seems XIWarpPointer() doesn't work correctly on multi-head setups: + * https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea + */ + if (ScreenCount(display) == 1) { + X11_XIGetClientPointer(display, None, &deviceid); + } } if (deviceid != 0) { + SDL_assert(SDL_X11_HAVE_XINPUT2); X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y); } else #endif { X11_XWarpPointer(display, None, xwindow, 0, 0, 0, 0, x, y); } + + if (warp_hack) { + X11_ShowCursor(SDL_GetCursor()); + } X11_XSync(display, False); videodata->global_mouse_changed = SDL_TRUE; } -static void -X11_WarpMouse(SDL_Window * window, int x, int y) +static void X11_WarpMouse(SDL_Window *window, int x, int y) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES /* If we have no barrier, we need to warp */ if (data->pointer_barrier_active == SDL_FALSE) { WarpMouseInternal(data->xwindow, x, y); @@ -349,33 +372,24 @@ X11_WarpMouse(SDL_Window * window, int x, int y) #endif } -static int -X11_WarpMouseGlobal(int x, int y) +static int X11_WarpMouseGlobal(int x, int y) { WarpMouseInternal(DefaultRootWindow(GetDisplay()), x, y); return 0; } -static int -X11_SetRelativeMouseMode(SDL_bool enabled) +static int X11_SetRelativeMouseMode(SDL_bool enabled) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2 - if(X11_Xinput2IsInitialized()) - return 0; -#else - SDL_Unsupported(); -#endif - return -1; + return X11_Xinput2IsInitialized() ? 0 : SDL_Unsupported(); } -static int -X11_CaptureMouse(SDL_Window *window) +static int X11_CaptureMouse(SDL_Window *window) { Display *display = GetDisplay(); SDL_Window *mouse_focus = SDL_GetMouseFocus(); if (window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask; Window confined = (data->mouse_grabbed ? data->xwindow : None); const int rc = X11_XGrabPointer(display, data->xwindow, False, @@ -395,26 +409,25 @@ X11_CaptureMouse(SDL_Window *window) return 0; } -static Uint32 -X11_GetGlobalMouseState(int *x, int *y) +static Uint32 X11_GetGlobalMouseState(int *x, int *y) { - SDL_VideoData *videodata = (SDL_VideoData *) SDL_GetVideoDevice()->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)SDL_GetVideoDevice()->driverdata; Display *display = GetDisplay(); const int num_screens = SDL_GetNumVideoDisplays(); int i; /* !!! FIXME: should we XSync() here first? */ -#if !SDL_VIDEO_DRIVER_X11_XINPUT2 - videodata->global_mouse_changed = SDL_TRUE; -#endif + if (!X11_Xinput2IsInitialized()) { + videodata->global_mouse_changed = SDL_TRUE; + } /* check if we have this cached since XInput last saw the mouse move. */ /* !!! FIXME: can we just calculate this from XInput's events? */ if (videodata->global_mouse_changed) { for (i = 0; i < num_screens; i++) { - SDL_DisplayData *data = (SDL_DisplayData *) SDL_GetDisplayDriverData(i); - if (data != NULL) { + SDL_DisplayData *data = (SDL_DisplayData *)SDL_GetDisplayDriverData(i); + if (data) { Window root, child; int rootx, rooty, winx, winy; unsigned int mask; @@ -425,7 +438,7 @@ X11_GetGlobalMouseState(int *x, int *y) buttons |= (mask & Button2Mask) ? SDL_BUTTON_MMASK : 0; buttons |= (mask & Button3Mask) ? SDL_BUTTON_RMASK : 0; /* Use the SDL state for the extended buttons - it's better than nothing */ - buttons |= (SDL_GetMouseState(NULL, NULL) & (SDL_BUTTON_X1MASK|SDL_BUTTON_X2MASK)); + buttons |= (SDL_GetMouseState(NULL, NULL) & (SDL_BUTTON_X1MASK | SDL_BUTTON_X2MASK)); /* SDL_DisplayData->x,y point to screen origin, and adding them to mouse coordinates relative to root window doesn't do the right thing * (observed on dual monitor setup with primary display being the rightmost one - mouse was offset to the right). * @@ -441,16 +454,14 @@ X11_GetGlobalMouseState(int *x, int *y) } } - SDL_assert(!videodata->global_mouse_changed); /* The pointer wasn't on any X11 screen?! */ + SDL_assert(!videodata->global_mouse_changed); /* The pointer wasn't on any X11 screen?! */ *x = videodata->global_mouse_position.x; *y = videodata->global_mouse_position.y; return videodata->global_mouse_buttons; } - -void -X11_InitMouse(_THIS) +void X11_InitMouse(_THIS) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -467,14 +478,13 @@ X11_InitMouse(_THIS) SDL_SetDefaultCursor(X11_CreateDefaultCursor()); } -void -X11_QuitMouse(_THIS) +void X11_QuitMouse(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; SDL_XInput2DeviceInfo *i; SDL_XInput2DeviceInfo *next; - for (i = data->mouse_device_info; i != NULL; i = next) { + for (i = data->mouse_device_info; i; i = next) { next = i->next; SDL_free(i); } @@ -484,5 +494,3 @@ X11_QuitMouse(_THIS) } #endif /* SDL_VIDEO_DRIVER_X11 */ - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11mouse.h b/src/video/x11/SDL_x11mouse.h index da28f7bca210c..eb9153ec45ba0 100644 --- a/src/video/x11/SDL_x11mouse.h +++ b/src/video/x11/SDL_x11mouse.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,7 +30,6 @@ typedef struct SDL_XInput2DeviceInfo double minval[2]; double maxval[2]; double prev_coords[2]; - Time prev_time; struct SDL_XInput2DeviceInfo *next; } SDL_XInput2DeviceInfo; diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 60b2203cdf68e..a597f4e7f20b9 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2021 NVIDIA Corporation This software is provided 'as-is', without any express or implied @@ -21,14 +21,14 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_x11video.h" #include "SDL_hints.h" /* GLX implementation of SDL OpenGL support */ -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_GLX #include "SDL_loadso.h" #include "SDL_x11opengles.h" @@ -44,100 +44,100 @@ #elif defined(__QNXNTO__) #define DEFAULT_OPENGL "libGL.so.3" #else -#define DEFAULT_OPENGL "libGL.so.1" +#define DEFAULT_OPENGL "libGL.so.1" #endif #ifndef GLX_NONE_EXT -#define GLX_NONE_EXT 0x8000 +#define GLX_NONE_EXT 0x8000 #endif #ifndef GLX_ARB_multisample #define GLX_ARB_multisample -#define GLX_SAMPLE_BUFFERS_ARB 100000 -#define GLX_SAMPLES_ARB 100001 +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 #endif #ifndef GLX_EXT_visual_rating #define GLX_EXT_visual_rating -#define GLX_VISUAL_CAVEAT_EXT 0x20 -#define GLX_NONE_EXT 0x8000 -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_NONE_EXT 0x8000 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D #endif #ifndef GLX_EXT_visual_info #define GLX_EXT_visual_info -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_DIRECT_COLOR_EXT 0x8003 #endif #ifndef GLX_ARB_create_context #define GLX_ARB_create_context -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define GLX_CONTEXT_FLAGS_ARB 0x2094 -#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 /* Typedef for the GL 3.0 context creation function */ -typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, +typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display *dpy, GLXFBConfig config, GLXContext - share_context, + share_context, Bool direct, const int - *attrib_list); + *attrib_list); #endif #ifndef GLX_ARB_create_context_profile #define GLX_ARB_create_context_profile -#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 -#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 #define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 #endif #ifndef GLX_ARB_create_context_robustness #define GLX_ARB_create_context_robustness -#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 -#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #endif #ifndef GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile #ifndef GLX_CONTEXT_ES2_PROFILE_BIT_EXT -#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000002 +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000002 #endif #endif #ifndef GLX_ARB_framebuffer_sRGB #define GLX_ARB_framebuffer_sRGB #ifndef GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 #endif #endif #ifndef GLX_ARB_fbconfig_float #define GLX_ARB_fbconfig_float #ifndef GLX_RGBA_FLOAT_TYPE_ARB -#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 +#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 #endif #ifndef GLX_RGBA_FLOAT_BIT_ARB -#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 +#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 #endif #endif #ifndef GLX_ARB_create_context_no_error #define GLX_ARB_create_context_no_error #ifndef GLX_CONTEXT_OPENGL_NO_ERROR_ARB -#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 +#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3 #endif #endif #ifndef GLX_EXT_swap_control -#define GLX_SWAP_INTERVAL_EXT 0x20F1 -#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 #endif #ifndef GLX_EXT_swap_control_tear @@ -146,17 +146,17 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, #ifndef GLX_ARB_context_flush_control #define GLX_ARB_context_flush_control -#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 #endif #define OPENGL_REQUIRES_DLOPEN #if defined(OPENGL_REQUIRES_DLOPEN) && defined(HAVE_DLOPEN) #include -#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL)) -#define GL_LoadFunction dlsym -#define GL_UnloadObject dlclose +#define GL_LoadObject(X) dlopen(X, (RTLD_NOW | RTLD_GLOBAL)) +#define GL_LoadFunction dlsym +#define GL_UnloadObject dlclose #else #define GL_LoadObject SDL_LoadObject #define GL_LoadFunction SDL_LoadFunction @@ -165,8 +165,7 @@ typedef GLXContext(*PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display * dpy, static void X11_GL_InitExtensions(_THIS); -int -X11_GL_LoadLibrary(_THIS, const char *path) +int X11_GL_LoadLibrary(_THIS, const char *path) { Display *display; void *handle; @@ -194,9 +193,9 @@ X11_GL_LoadLibrary(_THIS, const char *path) /* Allocate OpenGL memory */ _this->gl_data = - (struct SDL_GLDriverData *) SDL_calloc(1, - sizeof(struct - SDL_GLDriverData)); + (struct SDL_GLDriverData *)SDL_calloc(1, + sizeof(struct + SDL_GLDriverData)); if (!_this->gl_data) { return SDL_OutOfMemory(); } @@ -204,7 +203,7 @@ X11_GL_LoadLibrary(_THIS, const char *path) /* Load function pointers */ handle = _this->gl_config.dll_handle; _this->gl_data->glXQueryExtension = - (Bool (*)(Display *, int *, int *)) + (Bool(*)(Display *, int *, int *)) GL_LoadFunction(handle, "glXQueryExtension"); _this->gl_data->glXGetProcAddress = (void *(*)(const GLubyte *)) @@ -225,7 +224,7 @@ X11_GL_LoadLibrary(_THIS, const char *path) (void (*)(Display *, GLXDrawable)) X11_GL_GetProcAddress(_this, "glXSwapBuffers"); _this->gl_data->glXQueryDrawable = - (void (*)(Display*,GLXDrawable,int,unsigned int*)) + (void (*)(Display *, GLXDrawable, int, unsigned int *)) X11_GL_GetProcAddress(_this, "glXQueryDrawable"); if (!_this->gl_data->glXQueryExtension || @@ -237,25 +236,27 @@ X11_GL_LoadLibrary(_THIS, const char *path) return SDL_SetError("Could not retrieve OpenGL functions"); } - display = ((SDL_VideoData *) _this->driverdata)->display; + display = ((SDL_VideoData *)_this->driverdata)->display; if (!_this->gl_data->glXQueryExtension(display, &_this->gl_data->errorBase, &_this->gl_data->eventBase)) { return SDL_SetError("GLX is not supported"); } + _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_UNTESTED; + /* Initialize extensions */ - /* See lengthy comment about the inc/dec in + /* See lengthy comment about the inc/dec in ../windows/SDL_windowsopengl.c. */ ++_this->gl_config.driver_loaded; X11_GL_InitExtensions(_this); --_this->gl_config.driver_loaded; - - /* If we need a GL ES context and there's no - * GLX_EXT_create_context_es2_profile extension, switch over to X11_GLES functions + + /* If we need a GL ES context and there's no + * GLX_EXT_create_context_es2_profile extension, switch over to X11_GLES functions */ if (((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) || SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) && X11_GL_UseEGL(_this) ) { -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL X11_GL_UnloadLibrary(_this); _this->GL_LoadLibrary = X11_GLES_LoadLibrary; _this->GL_GetProcAddress = X11_GLES_GetProcAddress; @@ -275,17 +276,15 @@ X11_GL_LoadLibrary(_THIS, const char *path) return 0; } -void * -X11_GL_GetProcAddress(_THIS, const char *proc) +void *X11_GL_GetProcAddress(_THIS, const char *proc) { if (_this->gl_data->glXGetProcAddress) { - return _this->gl_data->glXGetProcAddress((const GLubyte *) proc); + return _this->gl_data->glXGetProcAddress((const GLubyte *)proc); } return GL_LoadFunction(_this->gl_config.dll_handle, proc); } -void -X11_GL_UnloadLibrary(_THIS) +void X11_GL_UnloadLibrary(_THIS) { /* Don't actually unload the library, since it may have registered * X11 shutdown hooks, per the notes at: @@ -301,19 +300,20 @@ X11_GL_UnloadLibrary(_THIS) _this->gl_data = NULL; } -static SDL_bool -HasExtension(const char *extension, const char *extensions) +static SDL_bool HasExtension(const char *extension, const char *extensions) { const char *start; const char *where, *terminator; - if (!extensions) + if (!extensions) { return SDL_FALSE; + } /* Extension names should not have spaces. */ where = SDL_strchr(extension, ' '); - if (where || *extension == '\0') + if (where || *extension == '\0') { return SDL_FALSE; + } /* It takes a bit of care to be fool-proof about parsing the * OpenGL extensions string. Don't be fooled by sub-strings, @@ -323,39 +323,41 @@ HasExtension(const char *extension, const char *extensions) for (;;) { where = SDL_strstr(start, extension); - if (!where) + if (!where) { break; + } terminator = where + SDL_strlen(extension); - if (where == start || *(where - 1) == ' ') - if (*terminator == ' ' || *terminator == '\0') + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { return SDL_TRUE; + } + } start = terminator; } return SDL_FALSE; } -static void -X11_GL_InitExtensions(_THIS) +static void X11_GL_InitExtensions(_THIS) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; const int screen = DefaultScreen(display); XVisualInfo *vinfo = NULL; Window w = 0; GLXContext prev_ctx = 0; GLXDrawable prev_drawable = 0; GLXContext context = 0; - const char *(*glXQueryExtensionsStringFunc) (Display *, int); + const char *(*glXQueryExtensionsStringFunc)(Display *, int); const char *extensions; vinfo = X11_GL_GetVisual(_this, display, screen); if (vinfo) { - GLXContext (*glXGetCurrentContextFunc) (void) = + GLXContext (*glXGetCurrentContextFunc)(void) = (GLXContext(*)(void)) X11_GL_GetProcAddress(_this, "glXGetCurrentContext"); - GLXDrawable (*glXGetCurrentDrawableFunc) (void) = + GLXDrawable (*glXGetCurrentDrawableFunc)(void) = (GLXDrawable(*)(void)) X11_GL_GetProcAddress(_this, "glXGetCurrentDrawable"); @@ -370,11 +372,11 @@ X11_GL_InitExtensions(_THIS) X11_XCreateColormap(display, RootWindow(display, screen), vinfo->visual, AllocNone); w = X11_XCreateWindow(display, RootWindow(display, screen), 0, 0, - 32, 32, 0, vinfo->depth, InputOutput, vinfo->visual, - (CWBackPixel | CWBorderPixel | CWColormap), &xattr); + 32, 32, 0, vinfo->depth, InputOutput, vinfo->visual, + (CWBackPixel | CWBorderPixel | CWColormap), &xattr); context = _this->gl_data->glXCreateContext(display, vinfo, - NULL, True); + NULL, True); if (context) { _this->gl_data->glXMakeCurrent(display, w, context); } @@ -384,8 +386,8 @@ X11_GL_InitExtensions(_THIS) } glXQueryExtensionsStringFunc = - (const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this, - "glXQueryExtensionsString"); + (const char *(*)(Display *, int))X11_GL_GetProcAddress(_this, + "glXQueryExtensionsString"); if (glXQueryExtensionsStringFunc) { extensions = glXQueryExtensionsStringFunc(display, screen); } else { @@ -396,7 +398,7 @@ X11_GL_InitExtensions(_THIS) _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_FALSE; if (HasExtension("GLX_EXT_swap_control", extensions)) { _this->gl_data->glXSwapIntervalEXT = - (void (*)(Display*,GLXDrawable,int)) + (void (*)(Display *, GLXDrawable, int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalEXT"); if (HasExtension("GLX_EXT_swap_control_tear", extensions)) { _this->gl_data->HAS_GLX_EXT_swap_control_tear = SDL_TRUE; @@ -406,28 +408,28 @@ X11_GL_InitExtensions(_THIS) /* Check for GLX_MESA_swap_control */ if (HasExtension("GLX_MESA_swap_control", extensions)) { _this->gl_data->glXSwapIntervalMESA = - (int(*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA"); + (int (*)(int))X11_GL_GetProcAddress(_this, "glXSwapIntervalMESA"); _this->gl_data->glXGetSwapIntervalMESA = - (int(*)(void)) X11_GL_GetProcAddress(_this, - "glXGetSwapIntervalMESA"); + (int (*)(void))X11_GL_GetProcAddress(_this, + "glXGetSwapIntervalMESA"); } /* Check for GLX_SGI_swap_control */ if (HasExtension("GLX_SGI_swap_control", extensions)) { _this->gl_data->glXSwapIntervalSGI = - (int (*)(int)) X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI"); + (int (*)(int))X11_GL_GetProcAddress(_this, "glXSwapIntervalSGI"); } /* Check for GLX_ARB_create_context */ if (HasExtension("GLX_ARB_create_context", extensions)) { _this->gl_data->glXCreateContextAttribsARB = - (GLXContext (*)(Display*,GLXFBConfig,GLXContext,Bool,const int *)) + (GLXContext(*)(Display *, GLXFBConfig, GLXContext, Bool, const int *)) X11_GL_GetProcAddress(_this, "glXCreateContextAttribsARB"); _this->gl_data->glXChooseFBConfig = - (GLXFBConfig *(*)(Display *, int, const int *, int *)) + (GLXFBConfig * (*)(Display *, int, const int *, int *)) X11_GL_GetProcAddress(_this, "glXChooseFBConfig"); _this->gl_data->glXGetVisualFromFBConfig = - (XVisualInfo *(*)(Display *, GLXFBConfig)) + (XVisualInfo * (*)(Display *, GLXFBConfig)) X11_GL_GetProcAddress(_this, "glXGetVisualFromFBConfig"); } @@ -440,7 +442,7 @@ X11_GL_InitExtensions(_THIS) if (HasExtension("GLX_EXT_visual_info", extensions)) { _this->gl_data->HAS_GLX_EXT_visual_info = SDL_TRUE; } - + /* Check for GLX_EXT_create_context_es2_profile */ if (HasExtension("GLX_EXT_create_context_es2_profile", extensions)) { /* this wants to call glGetString(), so it needs a context. */ @@ -448,8 +450,7 @@ X11_GL_InitExtensions(_THIS) if (context) { SDL_GL_DeduceMaxSupportedESProfile( &_this->gl_data->es_profile_max_supported_version.major, - &_this->gl_data->es_profile_max_supported_version.minor - ); + &_this->gl_data->es_profile_max_supported_version.minor); } } @@ -489,8 +490,7 @@ X11_GL_InitExtensions(_THIS) * In case of failure, if that pointer is not NULL, set that pointer to None * and try again. */ -static int -X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int size, Bool for_FBConfig, int **_pvistypeattr) +static int X11_GL_GetAttributes(_THIS, Display *display, int screen, int *attribs, int size, Bool for_FBConfig, int **_pvistypeattr) { int i = 0; const int MAX_ATTRIBUTES = 64; @@ -500,7 +500,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si SDL_assert(size >= MAX_ATTRIBUTES); /* Setup our GLX attributes according to the gl_config. */ - if( for_FBConfig ) { + if (for_FBConfig) { attribs[i++] = GLX_RENDER_TYPE; if (_this->gl_config.floatbuffers) { attribs[i++] = GLX_RGBA_FLOAT_BIT_ARB; @@ -524,7 +524,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si if (_this->gl_config.double_buffer) { attribs[i++] = GLX_DOUBLEBUFFER; - if( for_FBConfig ) { + if (for_FBConfig) { attribs[i++] = True; } } @@ -559,7 +559,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si if (_this->gl_config.stereo) { attribs[i++] = GLX_STEREO; - if( for_FBConfig ) { + if (for_FBConfig) { attribs[i++] = True; } } @@ -575,19 +575,19 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si } if (_this->gl_config.floatbuffers) { + attribs[i++] = GLX_RENDER_TYPE; attribs[i++] = GLX_RGBA_FLOAT_TYPE_ARB; } if (_this->gl_config.framebuffer_srgb_capable) { attribs[i++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB; - attribs[i++] = True; /* always needed, for_FBConfig or not! */ + attribs[i++] = True; /* always needed, for_FBConfig or not! */ } if (_this->gl_config.accelerated >= 0 && _this->gl_data->HAS_GLX_EXT_visual_rating) { attribs[i++] = GLX_VISUAL_CAVEAT_EXT; - attribs[i++] = _this->gl_config.accelerated ? GLX_NONE_EXT : - GLX_SLOW_VISUAL_EXT; + attribs[i++] = _this->gl_config.accelerated ? GLX_NONE_EXT : GLX_SLOW_VISUAL_EXT; } /* If we're supposed to use DirectColor visuals, and we've got the @@ -610,8 +610,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si return i; } -XVisualInfo * -X11_GL_GetVisual(_THIS, Display * display, int screen) +XVisualInfo *X11_GL_GetVisual(_THIS, Display *display, int screen) { /* 64 seems nice. */ int attribs[64]; @@ -658,37 +657,31 @@ X11_GL_GetVisual(_THIS, Display * display, int screen) return vinfo; } -static int (*handler) (Display *, XErrorEvent *) = NULL; +static int (*handler)(Display *, XErrorEvent *) = NULL; static const char *errorHandlerOperation = NULL; static int errorBase = 0; static int errorCode = 0; -static int -X11_GL_ErrorHandler(Display * d, XErrorEvent * e) +static int X11_GL_ErrorHandler(Display *d, XErrorEvent *e) { char *x11_error = NULL; char x11_error_locale[256]; errorCode = e->error_code; - if (X11_XGetErrorText(d, errorCode, x11_error_locale, sizeof(x11_error_locale)) == Success) - { - x11_error = SDL_iconv_string("UTF-8", "", x11_error_locale, SDL_strlen(x11_error_locale)+1); + if (X11_XGetErrorText(d, errorCode, x11_error_locale, sizeof(x11_error_locale)) == Success) { + x11_error = SDL_iconv_string("UTF-8", "", x11_error_locale, SDL_strlen(x11_error_locale) + 1); } - if (x11_error) - { + if (x11_error) { SDL_SetError("Could not %s: %s", errorHandlerOperation, x11_error); SDL_free(x11_error); - } - else - { + } else { SDL_SetError("Could not %s: %i (Base %i)", errorHandlerOperation, errorCode, errorBase); } return (0); } -SDL_bool -X11_GL_UseEGL(_THIS) +SDL_bool X11_GL_UseEGL(_THIS) { SDL_assert(_this->gl_data != NULL); if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) @@ -698,20 +691,16 @@ X11_GL_UseEGL(_THIS) } SDL_assert(_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES); - return (SDL_GetHintBoolean(SDL_HINT_OPENGL_ES_DRIVER, SDL_FALSE) - || _this->gl_config.major_version == 1 /* No GLX extension for OpenGL ES 1.x profiles. */ - || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major - || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major - && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor)); + return (SDL_GetHintBoolean(SDL_HINT_OPENGL_ES_DRIVER, SDL_FALSE) || _this->gl_config.major_version == 1 /* No GLX extension for OpenGL ES 1.x profiles. */ + || _this->gl_config.major_version > _this->gl_data->es_profile_max_supported_version.major || (_this->gl_config.major_version == _this->gl_data->es_profile_max_supported_version.major && _this->gl_config.minor_version > _this->gl_data->es_profile_max_supported_version.minor)); } -SDL_GLContext -X11_GL_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; int screen = - ((SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata)->screen; + ((SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata)->screen; XWindowAttributes xattr; XVisualInfo v, *vinfo; int n; @@ -752,37 +741,33 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) int iattr = 4; /* SDL profile bits match GLX profile bits */ - if( _this->gl_config.profile_mask != 0 ) { + if (_this->gl_config.profile_mask != 0) { attribs[iattr++] = GLX_CONTEXT_PROFILE_MASK_ARB; attribs[iattr++] = _this->gl_config.profile_mask; } /* SDL flags match GLX flags */ - if( _this->gl_config.flags != 0 ) { + if (_this->gl_config.flags != 0) { attribs[iattr++] = GLX_CONTEXT_FLAGS_ARB; attribs[iattr++] = _this->gl_config.flags; } - /* only set if glx extension is available */ - if( _this->gl_data->HAS_GLX_ARB_context_flush_control ) { + /* only set if glx extension is available and not the default setting */ + if ((_this->gl_data->HAS_GLX_ARB_context_flush_control) && (_this->gl_config.release_behavior == 0)) { attribs[iattr++] = GLX_CONTEXT_RELEASE_BEHAVIOR_ARB; - attribs[iattr++] = - _this->gl_config.release_behavior ? - GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : - GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; + attribs[iattr++] = + _this->gl_config.release_behavior ? GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB; } - /* only set if glx extension is available */ - if( _this->gl_data->HAS_GLX_ARB_create_context_robustness ) { + /* only set if glx extension is available and not the default setting */ + if ((_this->gl_data->HAS_GLX_ARB_create_context_robustness) && (_this->gl_config.reset_notification != 0)) { attribs[iattr++] = GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB; attribs[iattr++] = - _this->gl_config.reset_notification ? - GLX_LOSE_CONTEXT_ON_RESET_ARB : - GLX_NO_RESET_NOTIFICATION_ARB; + _this->gl_config.reset_notification ? GLX_LOSE_CONTEXT_ON_RESET_ARB : GLX_NO_RESET_NOTIFICATION_ARB; } - /* only set if glx extension is available */ - if( _this->gl_data->HAS_GLX_ARB_create_context_no_error ) { + /* only set if glx extension is available and not the default setting */ + if ((_this->gl_data->HAS_GLX_ARB_create_context_no_error) && (_this->gl_config.no_error != 0)) { attribs[iattr++] = GLX_CONTEXT_OPENGL_NO_ERROR_ARB; attribs[iattr++] = _this->gl_config.no_error; } @@ -800,24 +785,24 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) int fbcount = 0; int *pvistypeattr = NULL; - X11_GL_GetAttributes(_this,display,screen,glxAttribs,64,SDL_TRUE,&pvistypeattr); + X11_GL_GetAttributes(_this, display, screen, glxAttribs, 64, SDL_TRUE, &pvistypeattr); if (_this->gl_data->glXChooseFBConfig) { framebuffer_config = _this->gl_data->glXChooseFBConfig(display, - DefaultScreen(display), glxAttribs, - &fbcount); + DefaultScreen(display), glxAttribs, + &fbcount); if (!framebuffer_config && (pvistypeattr != NULL)) { *pvistypeattr = None; framebuffer_config = _this->gl_data->glXChooseFBConfig(display, - DefaultScreen(display), glxAttribs, - &fbcount); + DefaultScreen(display), glxAttribs, + &fbcount); } - + if (framebuffer_config) { context = _this->gl_data->glXCreateContextAttribsARB(display, - framebuffer_config[0], - share_context, True, attribs); + framebuffer_config[0], + share_context, True, attribs); X11_XFree(framebuffer_config); } } @@ -843,13 +828,12 @@ X11_GL_CreateContext(_THIS, SDL_Window * window) return context; } -int -X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) +int X11_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; Window drawable = - (context ? ((SDL_WindowData *) window->driverdata)->xwindow : None); - GLXContext glx_context = (GLXContext) context; + (context ? ((SDL_WindowData *)window->driverdata)->xwindow : None); + GLXContext glx_context = (GLXContext)context; int rc; if (!_this->gl_data) { @@ -865,9 +849,9 @@ X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) rc = _this->gl_data->glXMakeCurrent(display, drawable, glx_context); X11_XSetErrorHandler(handler); - if (errorCode != Success) { /* uhoh, an X error was thrown! */ - return -1; /* the error handler called SDL_SetError() already. */ - } else if (!rc) { /* glXMakeCurrent() failed without throwing an X error */ + if (errorCode != Success) { /* uhoh, an X error was thrown! */ + return -1; /* the error handler called SDL_SetError() already. */ + } else if (!rc) { /* glXMakeCurrent() failed without throwing an X error */ return SDL_SetError("Unable to make GL context current"); } @@ -883,17 +867,17 @@ X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) */ static int swapinterval = 0; -int -X11_GL_SetSwapInterval(_THIS, int interval) +int X11_GL_SetSwapInterval(_THIS, int interval) { int status = -1; if ((interval < 0) && (!_this->gl_data->HAS_GLX_EXT_swap_control_tear)) { SDL_SetError("Negative swap interval unsupported in this GL"); } else if (_this->gl_data->glXSwapIntervalEXT) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; const SDL_WindowData *windowdata = (SDL_WindowData *) - SDL_GL_GetCurrentWindow()->driverdata; + SDL_GL_GetCurrentWindow() + ->driverdata; Window drawable = windowdata->xwindow; @@ -908,7 +892,6 @@ X11_GL_SetSwapInterval(_THIS, int interval) int currentInterval = X11_GL_GetSwapInterval(_this); _this->gl_data->glXSwapIntervalEXT(display, drawable, currentInterval); _this->gl_data->glXSwapIntervalEXT(display, drawable, interval); - status = 0; swapinterval = interval; } else if (_this->gl_data->glXSwapIntervalMESA) { @@ -931,31 +914,87 @@ X11_GL_SetSwapInterval(_THIS, int interval) return status; } -int -X11_GL_GetSwapInterval(_THIS) +static SDL_GLSwapIntervalTearBehavior CheckSwapIntervalTearBehavior(SDL_VideoDevice *_this, Window drawable, unsigned int current_val, unsigned int current_allow_late) +{ + /* Mesa and Nvidia interpret GLX_EXT_swap_control_tear differently, as of this writing, so + figure out which behavior we have. + Technical details: https://github.com/libsdl-org/SDL/issues/8004#issuecomment-1819603282 */ + if (_this->gl_data->swap_interval_tear_behavior == SDL_SWAPINTERVALTEAR_UNTESTED) { + if (!_this->gl_data->HAS_GLX_EXT_swap_control_tear) { + _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_UNKNOWN; + } else { + Display *display = ((SDL_VideoData *)_this->driverdata)->display; + unsigned int allow_late_swap_tearing = 22; + int original_val = (int) current_val; + + /* + * This is a workaround for a bug in NVIDIA drivers. Bug has been reported + * and will be fixed in a future release (probably 319.xx). + * + * There's a bug where glXSetSwapIntervalEXT ignores updates because + * it has the wrong value cached. To work around it, we just run a no-op + * update to the current value. + */ + _this->gl_data->glXSwapIntervalEXT(display, drawable, current_val); + + /* set it to no swap interval and see how it affects GLX_LATE_SWAPS_TEAR_EXT... */ + _this->gl_data->glXSwapIntervalEXT(display, drawable, 0); + _this->gl_data->glXQueryDrawable(display, drawable, GLX_LATE_SWAPS_TEAR_EXT, &allow_late_swap_tearing); + + if (allow_late_swap_tearing == 0) { /* GLX_LATE_SWAPS_TEAR_EXT says whether late swapping is currently in use */ + _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_NVIDIA; + if (current_allow_late) { + original_val = -original_val; + } + } else if (allow_late_swap_tearing == 1) { /* GLX_LATE_SWAPS_TEAR_EXT says whether the Drawable can use late swapping at all */ + _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_MESA; + } else { /* unexpected outcome! */ + _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_UNKNOWN; + } + + /* set us back to what it was originally... */ + _this->gl_data->glXSwapIntervalEXT(display, drawable, original_val); + } + } + + return _this->gl_data->swap_interval_tear_behavior; +} + + +int X11_GL_GetSwapInterval(_THIS) { if (_this->gl_data->glXSwapIntervalEXT) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; const SDL_WindowData *windowdata = (SDL_WindowData *) - SDL_GL_GetCurrentWindow()->driverdata; + SDL_GL_GetCurrentWindow() + ->driverdata; Window drawable = windowdata->xwindow; unsigned int allow_late_swap_tearing = 0; unsigned int interval = 0; if (_this->gl_data->HAS_GLX_EXT_swap_control_tear) { + allow_late_swap_tearing = 22; /* set this to nonsense. */ _this->gl_data->glXQueryDrawable(display, drawable, - GLX_LATE_SWAPS_TEAR_EXT, - &allow_late_swap_tearing); + GLX_LATE_SWAPS_TEAR_EXT, + &allow_late_swap_tearing); } _this->gl_data->glXQueryDrawable(display, drawable, GLX_SWAP_INTERVAL_EXT, &interval); - if ((allow_late_swap_tearing) && (interval > 0)) { - return -((int) interval); + switch (CheckSwapIntervalTearBehavior(_this, drawable, interval, allow_late_swap_tearing)) { + case SDL_SWAPINTERVALTEAR_MESA: + return (int)interval; /* unsigned int cast to signed that generates negative value if necessary. */ + + case SDL_SWAPINTERVALTEAR_NVIDIA: + default: + if ((allow_late_swap_tearing) && (interval > 0)) { + return -((int)interval); + } + return (int)interval; } - return (int) interval; + return (int)interval; /* shouldn't hit this, but just in case. */ } else if (_this->gl_data->glXGetSwapIntervalMESA) { return _this->gl_data->glXGetSwapIntervalMESA(); } else { @@ -963,21 +1002,19 @@ X11_GL_GetSwapInterval(_THIS) } } -int -X11_GL_SwapWindow(_THIS, SDL_Window * window) +int X11_GL_SwapWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; _this->gl_data->glXSwapBuffers(display, data->xwindow); return 0; } -void -X11_GL_DeleteContext(_THIS, SDL_GLContext context) +void X11_GL_DeleteContext(_THIS, SDL_GLContext context) { - Display *display = ((SDL_VideoData *) _this->driverdata)->display; - GLXContext glx_context = (GLXContext) context; + Display *display = ((SDL_VideoData *)_this->driverdata)->display; + GLXContext glx_context = (GLXContext)context; if (!_this->gl_data) { return; diff --git a/src/video/x11/SDL_x11opengl.h b/src/video/x11/SDL_x11opengl.h index 71e03c0c97027..6d7f3c8409bfb 100644 --- a/src/video/x11/SDL_x11opengl.h +++ b/src/video/x11/SDL_x11opengl.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,10 +23,18 @@ #ifndef SDL_x11opengl_h_ #define SDL_x11opengl_h_ -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_GLX #include "SDL_opengl.h" #include +typedef enum SDL_GLSwapIntervalTearBehavior +{ + SDL_SWAPINTERVALTEAR_UNTESTED, + SDL_SWAPINTERVALTEAR_UNKNOWN, + SDL_SWAPINTERVALTEAR_MESA, + SDL_SWAPINTERVALTEAR_NVIDIA +} SDL_GLSwapIntervalTearBehavior; + struct SDL_GLDriverData { int errorBase, eventBase; @@ -42,26 +50,29 @@ struct SDL_GLDriverData implementation supports GLX_EXT_create_context_es2_profile. major = minor = 0 when unsupported. */ - struct { + struct + { int major; int minor; } es_profile_max_supported_version; - Bool (*glXQueryExtension) (Display*,int*,int*); - void *(*glXGetProcAddress) (const GLubyte*); - XVisualInfo *(*glXChooseVisual) (Display*,int,int*); - GLXContext (*glXCreateContext) (Display*,XVisualInfo*,GLXContext,Bool); - GLXContext (*glXCreateContextAttribsARB) (Display*,GLXFBConfig,GLXContext,Bool,const int *); - GLXFBConfig *(*glXChooseFBConfig) (Display*,int,const int *,int *); - XVisualInfo *(*glXGetVisualFromFBConfig) (Display*,GLXFBConfig); - void (*glXDestroyContext) (Display*, GLXContext); - Bool(*glXMakeCurrent) (Display*,GLXDrawable,GLXContext); - void (*glXSwapBuffers) (Display*, GLXDrawable); - void (*glXQueryDrawable) (Display*,GLXDrawable,int,unsigned int*); - void (*glXSwapIntervalEXT) (Display*,GLXDrawable,int); - int (*glXSwapIntervalSGI) (int); - int (*glXSwapIntervalMESA) (int); - int (*glXGetSwapIntervalMESA) (void); + SDL_GLSwapIntervalTearBehavior swap_interval_tear_behavior; + + Bool (*glXQueryExtension)(Display *, int *, int *); + void *(*glXGetProcAddress)(const GLubyte *); + XVisualInfo *(*glXChooseVisual)(Display *, int, int *); + GLXContext (*glXCreateContext)(Display *, XVisualInfo *, GLXContext, Bool); + GLXContext (*glXCreateContextAttribsARB)(Display *, GLXFBConfig, GLXContext, Bool, const int *); + GLXFBConfig *(*glXChooseFBConfig)(Display *, int, const int *, int *); + XVisualInfo *(*glXGetVisualFromFBConfig)(Display *, GLXFBConfig); + void (*glXDestroyContext)(Display *, GLXContext); + Bool (*glXMakeCurrent)(Display *, GLXDrawable, GLXContext); + void (*glXSwapBuffers)(Display *, GLXDrawable); + void (*glXQueryDrawable)(Display *, GLXDrawable, int, unsigned int *); + void (*glXSwapIntervalEXT)(Display *, GLXDrawable, int); + int (*glXSwapIntervalSGI)(int); + int (*glXSwapIntervalMESA)(int); + int (*glXGetSwapIntervalMESA)(void); }; /* OpenGL functions */ @@ -69,13 +80,13 @@ extern int X11_GL_LoadLibrary(_THIS, const char *path); extern void *X11_GL_GetProcAddress(_THIS, const char *proc); extern void X11_GL_UnloadLibrary(_THIS); extern SDL_bool X11_GL_UseEGL(_THIS); -extern XVisualInfo *X11_GL_GetVisual(_THIS, Display * display, int screen); -extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window * window); -extern int X11_GL_MakeCurrent(_THIS, SDL_Window * window, +extern XVisualInfo *X11_GL_GetVisual(_THIS, Display *display, int screen); +extern SDL_GLContext X11_GL_CreateContext(_THIS, SDL_Window *window); +extern int X11_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int X11_GL_SetSwapInterval(_THIS, int interval); extern int X11_GL_GetSwapInterval(_THIS); -extern int X11_GL_SwapWindow(_THIS, SDL_Window * window); +extern int X11_GL_SwapWindow(_THIS, SDL_Window *window); extern void X11_GL_DeleteContext(_THIS, SDL_GLContext context); #endif /* SDL_VIDEO_OPENGL_GLX */ diff --git a/src/video/x11/SDL_x11opengles.c b/src/video/x11/SDL_x11opengles.c index e1ec4e4d2a264..09733c33fdca9 100644 --- a/src/video/x11/SDL_x11opengles.c +++ b/src/video/x11/SDL_x11opengles.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_DRIVER_X11) && defined(SDL_VIDEO_OPENGL_EGL) #include "SDL_hints.h" #include "SDL_x11video.h" @@ -29,15 +29,14 @@ /* EGL implementation of SDL OpenGL support */ -int -X11_GLES_LoadLibrary(_THIS, const char *path) +int X11_GLES_LoadLibrary(_THIS, const char *path) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; /* If the profile requested is not GL ES, switch over to X11_GL functions */ if ((_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) && !SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) { - #if SDL_VIDEO_OPENGL_GLX + #ifdef SDL_VIDEO_OPENGL_GLX X11_GLES_UnloadLibrary(_this); _this->GL_LoadLibrary = X11_GL_LoadLibrary; _this->GL_GetProcAddress = X11_GL_GetProcAddress; @@ -49,18 +48,17 @@ X11_GLES_LoadLibrary(_THIS, const char *path) _this->GL_SwapWindow = X11_GL_SwapWindow; _this->GL_DeleteContext = X11_GL_DeleteContext; return X11_GL_LoadLibrary(_this, path); - #else +#else return SDL_SetError("SDL not configured with OpenGL/GLX support"); - #endif +#endif } - + return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, 0); } -XVisualInfo * -X11_GLES_GetVisual(_THIS, Display * display, int screen) +XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen) { - + XVisualInfo *egl_visualinfo = NULL; EGLint visual_id; XVisualInfo vi_in; @@ -74,12 +72,13 @@ X11_GLES_GetVisual(_THIS, Display * display, int screen) if (_this->egl_data->eglGetConfigAttrib(_this->egl_data->egl_display, _this->egl_data->egl_config, EGL_NATIVE_VISUAL_ID, - &visual_id) == EGL_FALSE || !visual_id) { + &visual_id) == EGL_FALSE || + !visual_id) { /* Use the default visual when all else fails */ vi_in.screen = screen; egl_visualinfo = X11_XGetVisualInfo(display, - VisualScreenMask, - &vi_in, &out_count); + VisualScreenMask, + &vi_in, &out_count); } else { vi_in.screen = screen; vi_in.visualid = visual_id; @@ -89,11 +88,10 @@ X11_GLES_GetVisual(_THIS, Display * display, int screen) return egl_visualinfo; } -SDL_GLContext -X11_GLES_CreateContext(_THIS, SDL_Window * window) +SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window *window) { SDL_GLContext context; - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; X11_XSync(display, False); @@ -104,8 +102,8 @@ X11_GLES_CreateContext(_THIS, SDL_Window * window) } SDL_EGL_SwapWindow_impl(X11) -SDL_EGL_MakeCurrent_impl(X11) + SDL_EGL_MakeCurrent_impl(X11) #endif /* SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_OPENGL_EGL */ -/* vi: set ts=4 sw=4 expandtab: */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11opengles.h b/src/video/x11/SDL_x11opengles.h index 5219553ca9699..f9409680730a6 100644 --- a/src/video/x11/SDL_x11opengles.h +++ b/src/video/x11/SDL_x11opengles.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,16 +23,16 @@ #ifndef SDL_x11opengles_h_ #define SDL_x11opengles_h_ -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "../SDL_sysvideo.h" #include "../SDL_egl_c.h" typedef struct SDL_PrivateGLESData { - /* 1401 If the struct-declaration-list contains no named members, the behavior is undefined. */ - /* warning: empty struct has size 0 in C, size 1 in C++ [-Wc++-compat] */ - int dummy; + /* 1401 If the struct-declaration-list contains no named members, the behavior is undefined. */ + /* warning: empty struct has size 0 in C, size 1 in C++ [-Wc++-compat] */ + int dummy; } SDL_PrivateGLESData; /* OpenGLES functions */ @@ -41,7 +41,7 @@ typedef struct SDL_PrivateGLESData #define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary #define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define X11_GLES_DeleteContext SDL_EGL_DeleteContext +#define X11_GLES_DeleteContext SDL_EGL_DeleteContext extern int X11_GLES_LoadLibrary(_THIS, const char *path); extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen); diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index 7d4e32c22e912..88ff052a75df9 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,20 +20,20 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_x11video.h" #include "SDL_x11shape.h" #include "SDL_x11window.h" #include "../SDL_shape_internals.h" -SDL_WindowShaper* -X11_CreateShaper(SDL_Window* window) { - SDL_WindowShaper* result = NULL; - SDL_ShapeData* data = NULL; +SDL_WindowShaper *X11_CreateShaper(SDL_Window *window) +{ + SDL_WindowShaper *result = NULL; -#if SDL_VIDEO_DRIVER_X11_XSHAPE - if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */ +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE + SDL_ShapeData *data = NULL; + if (SDL_X11_HAVE_XSHAPE) { /* Make sure X server supports it. */ result = SDL_malloc(sizeof(SDL_WindowShaper)); if (!result) { SDL_OutOfMemory(); @@ -65,58 +65,64 @@ X11_CreateShaper(SDL_Window* window) { return result; } -int -X11_ResizeWindowShape(SDL_Window* window) { - SDL_ShapeData* data = window->shaper->driverdata; +int X11_ResizeWindowShape(SDL_Window *window) +{ + SDL_ShapeData *data = window->shaper->driverdata; unsigned int bitmapsize = window->w / 8; SDL_assert(data != NULL); - if(window->w % 8 > 0) + if (window->w % 8 > 0) { bitmapsize += 1; + } bitmapsize *= window->h; - if(data->bitmapsize != bitmapsize || data->bitmap == NULL) { + if (data->bitmapsize != bitmapsize || !data->bitmap) { data->bitmapsize = bitmapsize; SDL_free(data->bitmap); data->bitmap = SDL_malloc(data->bitmapsize); - if(data->bitmap == NULL) { + if (!data->bitmap) { return SDL_OutOfMemory(); } } - SDL_memset(data->bitmap,0,data->bitmapsize); + SDL_memset(data->bitmap, 0, data->bitmapsize); window->shaper->userx = window->x; window->shaper->usery = window->y; - SDL_SetWindowPosition(window,-1000,-1000); + SDL_SetWindowPosition(window, -1000, -1000); return 0; } -int -X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) { +int X11_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode) +{ +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE SDL_ShapeData *data = NULL; SDL_WindowData *windowdata = NULL; Pixmap shapemask; - - if(shaper == NULL || shape == NULL || shaper->driverdata == NULL) +#endif + + if (!shaper || !shape || !shaper->driverdata) { return -1; + } -#if SDL_VIDEO_DRIVER_X11_XSHAPE - if(shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode)) +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE + if (shape->format->Amask == 0 && SDL_SHAPEMODEALPHA(shape_mode->mode)) { return -2; - if(shape->w != shaper->window->w || shape->h != shaper->window->h) + } + if (shape->w != shaper->window->w || shape->h != shaper->window->h) { return -3; + } data = shaper->driverdata; /* Assume that shaper->alphacutoff already has a value, because SDL_SetWindowShape() should have given it one. */ - SDL_CalculateShapeBitmap(shaper->mode,shape,data->bitmap,8); + SDL_CalculateShapeBitmap(shaper->mode, shape, data->bitmap, 8); - windowdata = (SDL_WindowData*)(shaper->window->driverdata); - shapemask = X11_XCreateBitmapFromData(windowdata->videodata->display,windowdata->xwindow,data->bitmap,shaper->window->w,shaper->window->h); + windowdata = (SDL_WindowData *)(shaper->window->driverdata); + shapemask = X11_XCreateBitmapFromData(windowdata->videodata->display, windowdata->xwindow, data->bitmap, shaper->window->w, shaper->window->h); - X11_XShapeCombineMask(windowdata->videodata->display,windowdata->xwindow, ShapeBounding, 0, 0,shapemask, ShapeSet); - X11_XSync(windowdata->videodata->display,False); + X11_XShapeCombineMask(windowdata->videodata->display, windowdata->xwindow, ShapeBounding, 0, 0, shapemask, ShapeSet); + X11_XSync(windowdata->videodata->display, False); - X11_XFreePixmap(windowdata->videodata->display,shapemask); + X11_XFreePixmap(windowdata->videodata->display, shapemask); #endif return 0; diff --git a/src/video/x11/SDL_x11shape.h b/src/video/x11/SDL_x11shape.h index 4d54fb1684877..79f99bc35ada6 100644 --- a/src/video/x11/SDL_x11shape.h +++ b/src/video/x11/SDL_x11shape.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,13 +27,14 @@ #include "SDL_shape.h" #include "../SDL_sysvideo.h" -typedef struct { - void* bitmap; +typedef struct +{ + void *bitmap; Uint32 bitmapsize; } SDL_ShapeData; -extern SDL_WindowShaper* X11_CreateShaper(SDL_Window* window); -extern int X11_ResizeWindowShape(SDL_Window* window); -extern int X11_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shapeMode); +extern SDL_WindowShaper *X11_CreateShaper(SDL_Window *window); +extern int X11_ResizeWindowShape(SDL_Window *window); +extern int X11_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode); #endif /* SDL_x11shape_h_ */ diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 9af2320bf92e1..2fc12ceefa15e 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -99,7 +99,7 @@ SDL_X11_SYM(Status,XInitThreads,(void),(),return) SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return) SDL_X11_SYM(int,XPending,(Display* a),(a),return) SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return) -SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return) +SDL_X11_SYM(int,XQueryKeymap,(Display* a,char b[32]),(a,b),return) SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return) @@ -156,20 +156,21 @@ SDL_X11_SYM(int,XQueryTree,(Display* a,Window b,Window* c,Window* d,Window** e,u SDL_X11_SYM(Bool,XSupportsLocale,(void),(),return) SDL_X11_SYM(Status,XmbTextListToTextProperty,(Display* a,char** b,int c,XICCEncodingStyle d,XTextProperty* e),(a,b,c,d,e),return) -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES SDL_X11_MODULE(XFIXES) SDL_X11_SYM(PointerBarrier, XFixesCreatePointerBarrier, (Display* a, Window b, int c, int d, int e, int f, int g, int h, int *i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(void, XFixesDestroyPointerBarrier, (Display* a, PointerBarrier b), (a,b),) SDL_X11_SYM(int, XIBarrierReleasePointer,(Display* a, int b, PointerBarrier c, BarrierEventID d), (a,b,c,d), return) /* this is actually Xinput2 */ SDL_X11_SYM(Status, XFixesQueryVersion,(Display* a, int* b, int* c), (a,b,c), return) +SDL_X11_SYM(Status, XFixesSelectSelectionInput, (Display* a, Window b, Atom c, unsigned long d), (a,b,c,d), return) #endif -#if SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#ifdef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS SDL_X11_SYM(Bool,XGetEventData,(Display* a,XGenericEventCookie* b),(a,b),return) SDL_X11_SYM(void,XFreeEventData,(Display* a,XGenericEventCookie* b),(a,b),) #endif -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM SDL_X11_SYM(Bool,XkbQueryExtension,(Display* a,int * b,int * c,int * d,int * e, int *f),(a,b,c,d,e,f),return) #if NeedWidePrototypes SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,unsigned int b,int c,int d),(a,b,c,d),return) @@ -184,11 +185,19 @@ SDL_X11_SYM(void,XkbFreeKeyboard,(XkbDescPtr a,unsigned int b, Bool c),(a,b,c),) SDL_X11_SYM(Bool,XkbSetDetectableAutoRepeat,(Display* a, Bool b, Bool* c),(a,b,c),return) #endif +/* XKeycodeToKeysym is a deprecated function */ +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #if NeedWidePrototypes SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return) #else SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return) #endif +#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined(__clang__) +#pragma GCC diagnostic pop +#endif #ifdef X_HAVE_UTF8_STRING SDL_X11_MODULE(UTF8) @@ -239,15 +248,16 @@ SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a,IPCard b),(a,b),return) #endif /* XCursor support */ -#if SDL_VIDEO_DRIVER_X11_XCURSOR +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR SDL_X11_MODULE(XCURSOR) SDL_X11_SYM(XcursorImage*,XcursorImageCreate,(int a,int b),(a,b),return) SDL_X11_SYM(void,XcursorImageDestroy,(XcursorImage *a),(a),) SDL_X11_SYM(Cursor,XcursorImageLoadCursor,(Display *a,const XcursorImage *b),(a,b),return) +SDL_X11_SYM(Cursor,XcursorLibraryLoadCursor,(Display *a, const char *b),(a,b),return) #endif /* Xdbe support */ -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE SDL_X11_MODULE(XDBE) SDL_X11_SYM(Status,XdbeQueryExtension,(Display *dpy,int *major_version_return,int *minor_version_return),(dpy,major_version_return,minor_version_return),return) SDL_X11_SYM(XdbeBackBuffer,XdbeAllocateBackBufferName,(Display *dpy,Window window,XdbeSwapAction swap_action),(dpy,window,swap_action),return) @@ -261,7 +271,7 @@ SDL_X11_SYM(XdbeBackBufferAttributes*,XdbeGetBackBufferAttributes,(Display *dpy, #endif /* XInput2 support for multiple mice, tablets, etc. */ -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 SDL_X11_MODULE(XINPUT2) SDL_X11_SYM(XIDeviceInfo*,XIQueryDevice,(Display *a,int b,int *c),(a,b,c),return) SDL_X11_SYM(void,XIFreeDeviceInfo,(XIDeviceInfo *a),(a),) @@ -275,7 +285,7 @@ SDL_X11_SYM(Bool,XIWarpPointer,(Display *a,int b,Window c,Window d,double e,doub #endif /* XRandR support */ -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR SDL_X11_MODULE(XRANDR) SDL_X11_SYM(Status,XRRQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return) SDL_X11_SYM(Bool,XRRQueryExtension,(Display *dpy,int *event_base_return,int *error_base_return),(dpy,event_base_return,error_base_return),return); @@ -304,14 +314,14 @@ SDL_X11_SYM(void,XRRSelectInput,(Display *dpy, Window window, int mask),(dpy,win #endif /* MIT-SCREEN-SAVER support */ -#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER SDL_X11_MODULE(XSS) SDL_X11_SYM(Bool,XScreenSaverQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return) SDL_X11_SYM(Status,XScreenSaverQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return) SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),return) #endif -#if SDL_VIDEO_DRIVER_X11_XSHAPE +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE SDL_X11_MODULE(XSHAPE) SDL_X11_SYM(void,XShapeCombineMask,(Display *dpy,Window dest,int dest_kind,int x_off,int y_off,Pixmap src,int op),(dpy,dest,dest_kind,x_off,y_off,src,op),) #endif diff --git a/src/video/x11/SDL_x11touch.c b/src/video/x11/SDL_x11touch.c index c608cf24d1dbf..414d8e8051566 100644 --- a/src/video/x11/SDL_x11touch.c +++ b/src/video/x11/SDL_x11touch.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,28 +20,24 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_x11video.h" #include "SDL_x11touch.h" #include "SDL_x11xinput2.h" #include "../../events/SDL_touch_c.h" - -void -X11_InitTouch(_THIS) +void X11_InitTouch(_THIS) { X11_InitXinput2Multitouch(_this); } -void -X11_QuitTouch(_THIS) +void X11_QuitTouch(_THIS) { SDL_TouchQuit(); } -void -X11_ResetTouch(_THIS) +void X11_ResetTouch(_THIS) { X11_QuitTouch(_this); X11_InitTouch(_this); diff --git a/src/video/x11/SDL_x11touch.h b/src/video/x11/SDL_x11touch.h index 61b61a34ef7d7..3ff0e9a58246a 100644 --- a/src/video/x11/SDL_x11touch.h +++ b/src/video/x11/SDL_x11touch.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 49f5c5b9bc491..b43da511681dd 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include /* For getpid() and readlink() */ @@ -37,8 +37,9 @@ #include "SDL_x11touch.h" #include "SDL_x11xinput2.h" #include "SDL_x11xfixes.h" +#include "SDL_x11messagebox.h" -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "SDL_x11opengles.h" #endif @@ -49,8 +50,7 @@ static int X11_VideoInit(_THIS); static void X11_VideoQuit(_THIS); /* Find out what class name we should use */ -static char * -get_classname() +static char *get_classname(void) { char *spot; #if defined(__LINUX__) || defined(__FREEBSD__) @@ -68,10 +68,9 @@ get_classname() /* Next look at the application's executable name */ #if defined(__LINUX__) || defined(__FREEBSD__) #if defined(__LINUX__) - SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); + (void)SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid()); #elif defined(__FREEBSD__) - SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", - getpid()); + (void)SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid()); #else #error Where can we find the executable name? #endif @@ -93,12 +92,11 @@ get_classname() /* X11 driver bootstrap functions */ -static int (*orig_x11_errhandler) (Display *, XErrorEvent *) = NULL; +static int (*orig_x11_errhandler)(Display *, XErrorEvent *) = NULL; -static void -X11_DeleteDevice(SDL_VideoDevice * device) +static void X11_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *data = (SDL_VideoData *) device->driverdata; + SDL_VideoData *data = (SDL_VideoData *)device->driverdata; if (device->vulkan_config.loader_handle) { device->Vulkan_UnloadLibrary(device); } @@ -110,9 +108,6 @@ X11_DeleteDevice(SDL_VideoDevice * device) X11_XCloseDisplay(data->request_display); } SDL_free(data->windowlist); - if (device->wakeup_lock) { - SDL_DestroyMutex(device->wakeup_lock); - } SDL_free(device->driverdata); SDL_free(device); @@ -121,35 +116,39 @@ X11_DeleteDevice(SDL_VideoDevice * device) /* An error handler to reset the vidmode and then call the default handler. */ static SDL_bool safety_net_triggered = SDL_FALSE; -static int -X11_SafetyNetErrHandler(Display * d, XErrorEvent * e) +static int X11_SafetyNetErrHandler(Display *d, XErrorEvent *e) { SDL_VideoDevice *device = NULL; /* if we trigger an error in our error handler, don't try again. */ if (!safety_net_triggered) { safety_net_triggered = SDL_TRUE; device = SDL_GetVideoDevice(); - if (device != NULL) { + if (device) { int i; for (i = 0; i < device->num_displays; i++) { SDL_VideoDisplay *display = &device->displays[i]; if (SDL_memcmp(&display->current_mode, &display->desktop_mode, - sizeof (SDL_DisplayMode)) != 0) { + sizeof(SDL_DisplayMode)) != 0) { X11_SetDisplayMode(device, display, &display->desktop_mode); } } } } - if (orig_x11_errhandler != NULL) { - return orig_x11_errhandler(d, e); /* probably terminate. */ + if (orig_x11_errhandler) { + return orig_x11_errhandler(d, e); /* probably terminate. */ } return 0; } -static SDL_VideoDevice * -X11_CreateDevice(void) +static SDL_bool X11_IsXWayland(Display *d) +{ + int opcode, event, error; + return X11_XQueryExtension(d, "XWAYLAND", &opcode, &event, &error) == True; +} + +static SDL_VideoDevice *X11_CreateDevice(void) { SDL_VideoDevice *device; SDL_VideoData *data; @@ -173,12 +172,12 @@ X11_CreateDevice(void) } /* Initialize all variables that we clean on shutdown */ - device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); + device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { SDL_OutOfMemory(); return NULL; } - data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); + data = (struct SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!data) { SDL_free(device); SDL_OutOfMemory(); @@ -188,13 +187,13 @@ X11_CreateDevice(void) data->global_mouse_changed = SDL_TRUE; -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES data->active_cursor_confined_window = NULL; #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ data->display = x11_display; data->request_display = X11_XOpenDisplay(display); - if (data->request_display == NULL) { + if (!data->request_display) { X11_XCloseDisplay(data->display); SDL_free(device->driverdata); SDL_free(device); @@ -202,8 +201,6 @@ X11_CreateDevice(void) return NULL; } - device->wakeup_lock = SDL_CreateMutex(); - #ifdef X11_DEBUG X11_XSynchronize(data->display, True); #endif @@ -266,7 +263,7 @@ X11_CreateDevice(void) device->AcceptDragAndDrop = X11_AcceptDragAndDrop; device->FlashWindow = X11_FlashWindow; -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES device->SetWindowMouseRect = X11_SetWindowMouseRect; #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ @@ -274,7 +271,7 @@ X11_CreateDevice(void) device->shape_driver.SetWindowShape = X11_SetWindowShape; device->shape_driver.ResizeWindowShape = X11_ResizeWindowShape; -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_GLX device->GL_LoadLibrary = X11_GL_LoadLibrary; device->GL_GetProcAddress = X11_GL_GetProcAddress; device->GL_UnloadLibrary = X11_GL_UnloadLibrary; @@ -285,8 +282,8 @@ X11_CreateDevice(void) device->GL_SwapWindow = X11_GL_SwapWindow; device->GL_DeleteContext = X11_GL_DeleteContext; #endif -#if SDL_VIDEO_OPENGL_EGL -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_GLX if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) { #endif device->GL_LoadLibrary = X11_GLES_LoadLibrary; @@ -298,7 +295,7 @@ X11_CreateDevice(void) device->GL_GetSwapInterval = X11_GLES_GetSwapInterval; device->GL_SwapWindow = X11_GLES_SwapWindow; device->GL_DeleteContext = X11_GLES_DeleteContext; -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_GLX } #endif #endif @@ -319,36 +316,37 @@ X11_CreateDevice(void) device->free = X11_DeleteDevice; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = X11_Vulkan_LoadLibrary; device->Vulkan_UnloadLibrary = X11_Vulkan_UnloadLibrary; device->Vulkan_GetInstanceExtensions = X11_Vulkan_GetInstanceExtensions; device->Vulkan_CreateSurface = X11_Vulkan_CreateSurface; #endif + data->is_xwayland = X11_IsXWayland(x11_display); + return device; } VideoBootStrap X11_bootstrap = { "x11", "SDL X11 video driver", - X11_CreateDevice + X11_CreateDevice, + X11_ShowMessageBox }; -static int (*handler) (Display *, XErrorEvent *) = NULL; -static int -X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e) +static int (*handler)(Display *, XErrorEvent *) = NULL; +static int X11_CheckWindowManagerErrorHandler(Display *d, XErrorEvent *e) { if (e->error_code == BadWindow) { - return (0); + return 0; } else { - return (handler(d, e)); + return handler(d, e); } } -static void -X11_CheckWindowManager(_THIS) +static void X11_CheckWindowManager(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *display = data->display; Atom _NET_SUPPORTING_WM_CHECK; int status, real_format; @@ -368,7 +366,7 @@ X11_CheckWindowManager(_THIS) status = X11_XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata); if (status == Success) { if (items_read) { - wm_window = ((Window*)propdata)[0]; + wm_window = ((Window *)propdata)[0]; } if (propdata) { X11_XFree(propdata); @@ -378,7 +376,7 @@ X11_CheckWindowManager(_THIS) if (wm_window) { status = X11_XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata); - if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) { + if (status != Success || !items_read || wm_window != ((Window *)propdata)[0]) { wm_window = None; } if (status == Success && propdata) { @@ -406,11 +404,9 @@ X11_CheckWindowManager(_THIS) #endif } - -int -X11_VideoInit(_THIS) +int X11_VideoInit(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; /* Get the window class name, usually the name of the application */ data->classname = get_classname(); @@ -419,7 +415,7 @@ X11_VideoInit(_THIS) data->pid = getpid(); /* I have no idea how random this actually is, or has to be. */ - data->window_group = (XID) (((size_t) data->pid) ^ ((size_t) _this)); + data->window_group = (XID)(((size_t)data->pid) ^ ((size_t)_this)); /* Look up some useful Atoms */ #define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False) @@ -486,10 +482,9 @@ X11_VideoInit(_THIS) return 0; } -void -X11_VideoQuit(_THIS) +void X11_VideoQuit(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (data->clipboard_window) { X11_XDestroyWindow(data->display, data->clipboard_window); @@ -508,8 +503,7 @@ X11_VideoQuit(_THIS) X11_QuitTouch(_this); } -SDL_bool -X11_UseDirectColorVisuals(void) +SDL_bool X11_UseDirectColorVisuals(void) { return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE; } diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 511ed365c9c38..274233d4d493a 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,22 +31,22 @@ #include #include -#if SDL_VIDEO_DRIVER_X11_XCURSOR +#ifdef SDL_VIDEO_DRIVER_X11_XCURSOR #include #endif -#if SDL_VIDEO_DRIVER_X11_XDBE +#ifdef SDL_VIDEO_DRIVER_X11_XDBE #include #endif -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 #include #endif -#if SDL_VIDEO_DRIVER_X11_XRANDR +#ifdef SDL_VIDEO_DRIVER_X11_XRANDR #include #endif -#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER #include #endif -#if SDL_VIDEO_DRIVER_X11_XSHAPE +#ifdef SDL_VIDEO_DRIVER_X11_XSHAPE #include #endif @@ -79,7 +79,7 @@ typedef struct SDL_VideoData int windowlistlength; XID window_group; Window clipboard_window; -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES SDL_Window *active_cursor_confined_window; #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ @@ -126,7 +126,7 @@ typedef struct SDL_VideoData SDL_Scancode key_layout[256]; SDL_bool selection_waiting; - SDL_bool broken_pointer_grab; /* true if XGrabPointer seems unreliable. */ + SDL_bool broken_pointer_grab; /* true if XGrabPointer seems unreliable. */ Uint32 last_mode_change_deadline; @@ -138,15 +138,15 @@ typedef struct SDL_VideoData int xrandr_event_base; -#if SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM XkbDescPtr xkb; #endif int xkb_event; KeyCode filter_code; - Time filter_time; + Time filter_time; -#if SDL_VIDEO_VULKAN +#ifdef SDL_VIDEO_VULKAN /* Vulkan variables only valid if _this->vulkan_config.loader_handle is not NULL */ void *vulkan_xlib_xcb_library; PFN_XGetXCBConnection vulkan_XGetXCBConnection; @@ -156,6 +156,8 @@ typedef struct SDL_VideoData SDL_bool is_steam_deck; SDL_bool steam_keyboard_open; + SDL_bool is_xwayland; + } SDL_VideoData; extern SDL_bool X11_UseDirectColorVisuals(void); diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index b9eb34b88519b..a2fe5ae32d45c 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_X11 +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_X11) #include "SDL_x11video.h" @@ -31,9 +31,11 @@ /*#include */ #if defined(__OpenBSD__) -#define DEFAULT_VULKAN "libvulkan.so" +#define DEFAULT_VULKAN "libvulkan.so" +#define DEFAULT_X11_XCB "libX11-xcb.so" #else -#define DEFAULT_VULKAN "libvulkan.so.1" +#define DEFAULT_VULKAN "libvulkan.so.1" +#define DEFAULT_X11_XCB "libX11-xcb.so.1" #endif /* @@ -51,73 +53,72 @@ int X11_Vulkan_LoadLibrary(_THIS, const char *path) SDL_bool hasXCBSurfaceExtension = SDL_FALSE; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; Uint32 i; - if(_this->vulkan_config.loader_handle) + if (_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan already loaded"); + } /* Load the Vulkan loader library */ - if(!path) + if (!path) { path = SDL_getenv("SDL_VULKAN_LIBRARY"); - if(!path) + } + if (!path) { path = DEFAULT_VULKAN; + } _this->vulkan_config.loader_handle = SDL_LoadObject(path); - if(!_this->vulkan_config.loader_handle) + if (!_this->vulkan_config.loader_handle) { return -1; + } SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_arraysize(_this->vulkan_config.loader_path)); vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); - if(!vkGetInstanceProcAddr) + if (!vkGetInstanceProcAddr) { goto fail; + } _this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkEnumerateInstanceExtensionProperties = (void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); - if(!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) + if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { goto fail; + } extensions = SDL_Vulkan_CreateInstanceExtensionsList( (PFN_vkEnumerateInstanceExtensionProperties) _this->vulkan_config.vkEnumerateInstanceExtensionProperties, &extensionCount); - if(!extensions) + if (!extensions) { goto fail; - for(i = 0; i < extensionCount; i++) - { - if(SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } + for (i = 0; i < extensionCount; i++) { + if (SDL_strcmp(VK_KHR_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_XCB_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasXCBSurfaceExtension = SDL_TRUE; - else if(SDL_strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) + } else if (SDL_strcmp(VK_KHR_XLIB_SURFACE_EXTENSION_NAME, extensions[i].extensionName) == 0) { hasXlibSurfaceExtension = SDL_TRUE; + } } SDL_free(extensions); - if(!hasSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement the " - VK_KHR_SURFACE_EXTENSION_NAME " extension"); + if (!hasSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement the " VK_KHR_SURFACE_EXTENSION_NAME " extension"); goto fail; } - if(hasXlibSurfaceExtension) - { + if (hasXlibSurfaceExtension) { videoData->vulkan_xlib_xcb_library = NULL; - } - else if(!hasXCBSurfaceExtension) - { - SDL_SetError("Installed Vulkan doesn't implement either the " - VK_KHR_XCB_SURFACE_EXTENSION_NAME "extension or the " - VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension"); + } else if (!hasXCBSurfaceExtension) { + SDL_SetError("Installed Vulkan doesn't implement either the " VK_KHR_XCB_SURFACE_EXTENSION_NAME "extension or the " VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension"); goto fail; - } - else - { + } else { const char *libX11XCBLibraryName = SDL_getenv("SDL_X11_XCB_LIBRARY"); - if(!libX11XCBLibraryName) - libX11XCBLibraryName = "libX11-xcb.so"; + if (!libX11XCBLibraryName) { + libX11XCBLibraryName = DEFAULT_X11_XCB; + } videoData->vulkan_xlib_xcb_library = SDL_LoadObject(libX11XCBLibraryName); - if(!videoData->vulkan_xlib_xcb_library) + if (!videoData->vulkan_xlib_xcb_library) { goto fail; + } videoData->vulkan_XGetXCBConnection = SDL_LoadFunction(videoData->vulkan_xlib_xcb_library, "XGetXCBConnection"); - if(!videoData->vulkan_XGetXCBConnection) - { + if (!videoData->vulkan_XGetXCBConnection) { SDL_UnloadObject(videoData->vulkan_xlib_xcb_library); goto fail; } @@ -133,10 +134,10 @@ int X11_Vulkan_LoadLibrary(_THIS, const char *path) void X11_Vulkan_UnloadLibrary(_THIS) { SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; - if(_this->vulkan_config.loader_handle) - { - if(videoData->vulkan_xlib_xcb_library) + if (_this->vulkan_config.loader_handle) { + if (videoData->vulkan_xlib_xcb_library) { SDL_UnloadObject(videoData->vulkan_xlib_xcb_library); + } SDL_UnloadObject(_this->vulkan_config.loader_handle); _this->vulkan_config.loader_handle = NULL; } @@ -148,23 +149,21 @@ SDL_bool X11_Vulkan_GetInstanceExtensions(_THIS, const char **names) { SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } - if(videoData->vulkan_xlib_xcb_library) - { + if (videoData->vulkan_xlib_xcb_library) { static const char *const extensionsForXCB[] = { - VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_XCB_SURFACE_EXTENSION_NAME, + VK_KHR_SURFACE_EXTENSION_NAME, + VK_KHR_XCB_SURFACE_EXTENSION_NAME, }; return SDL_Vulkan_GetInstanceExtensions_Helper( count, names, SDL_arraysize(extensionsForXCB), extensionsForXCB); - } - else - { + } else { static const char *const extensionsForXlib[] = { - VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_XLIB_SURFACE_EXTENSION_NAME, + VK_KHR_SURFACE_EXTENSION_NAME, + VK_KHR_XLIB_SURFACE_EXTENSION_NAME, }; return SDL_Vulkan_GetInstanceExtensions_Helper( count, names, SDL_arraysize(extensionsForXlib), extensionsForXlib); @@ -179,21 +178,18 @@ SDL_bool X11_Vulkan_CreateSurface(_THIS, SDL_VideoData *videoData = (SDL_VideoData *)_this->driverdata; SDL_WindowData *windowData = (SDL_WindowData *)window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; - if(!_this->vulkan_config.loader_handle) - { + if (!_this->vulkan_config.loader_handle) { SDL_SetError("Vulkan is not loaded"); return SDL_FALSE; } vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; - if(videoData->vulkan_xlib_xcb_library) - { + if (videoData->vulkan_xlib_xcb_library) { PFN_vkCreateXcbSurfaceKHR vkCreateXcbSurfaceKHR = (PFN_vkCreateXcbSurfaceKHR)vkGetInstanceProcAddr(instance, "vkCreateXcbSurfaceKHR"); VkXcbSurfaceCreateInfoKHR createInfo; VkResult result; - if(!vkCreateXcbSurfaceKHR) - { + if (!vkCreateXcbSurfaceKHR) { SDL_SetError(VK_KHR_XCB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); return SDL_FALSE; @@ -201,30 +197,25 @@ SDL_bool X11_Vulkan_CreateSurface(_THIS, SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; createInfo.connection = videoData->vulkan_XGetXCBConnection(videoData->display); - if(!createInfo.connection) - { + if (!createInfo.connection) { SDL_SetError("XGetXCBConnection failed"); return SDL_FALSE; } createInfo.window = (xcb_window_t)windowData->xwindow; result = vkCreateXcbSurfaceKHR(instance, &createInfo, NULL, surface); - if(result != VK_SUCCESS) - { + if (result != VK_SUCCESS) { SDL_SetError("vkCreateXcbSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); return SDL_FALSE; } return SDL_TRUE; - } - else - { + } else { PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR = (PFN_vkCreateXlibSurfaceKHR)vkGetInstanceProcAddr(instance, "vkCreateXlibSurfaceKHR"); VkXlibSurfaceCreateInfoKHR createInfo; VkResult result; - if(!vkCreateXlibSurfaceKHR) - { + if (!vkCreateXlibSurfaceKHR) { SDL_SetError(VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); return SDL_FALSE; @@ -235,8 +226,7 @@ SDL_bool X11_Vulkan_CreateSurface(_THIS, createInfo.window = (xcb_window_t)windowData->xwindow; result = vkCreateXlibSurfaceKHR(instance, &createInfo, NULL, surface); - if(result != VK_SUCCESS) - { + if (result != VK_SUCCESS) { SDL_SetError("vkCreateXlibSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); return SDL_FALSE; } diff --git a/src/video/x11/SDL_x11vulkan.h b/src/video/x11/SDL_x11vulkan.h index e9e422b0dc48e..480c5aa6edc99 100644 --- a/src/video/x11/SDL_x11vulkan.h +++ b/src/video/x11/SDL_x11vulkan.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,7 +25,7 @@ #include "../SDL_vulkan_internal.h" -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_X11 +#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_X11) /*typedef struct xcb_connection_t xcb_connection_t;*/ typedef xcb_connection_t *(*PFN_XGetXCBConnection)(Display *dpy); diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 6d4e53f20de96..cde53c4a3abfc 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_hints.h" #include "../SDL_sysvideo.h" @@ -35,23 +35,23 @@ #include "SDL_x11xinput2.h" #include "SDL_x11xfixes.h" -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include "SDL_x11opengles.h" #endif #include "SDL_timer.h" #include "SDL_syswm.h" -#define _NET_WM_STATE_REMOVE 0l -#define _NET_WM_STATE_ADD 1l +#define _NET_WM_STATE_REMOVE 0l +#define _NET_WM_STATE_ADD 1l -static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win) +static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ { - return ev->type == MapNotify && ev->xmap.window == *((Window*)win); + return ev->type == MapNotify && ev->xmap.window == *((Window *)win); } -static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) +static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */ { - return ev->type == UnmapNotify && ev->xunmap.window == *((Window*)win); + return ev->type == UnmapNotify && ev->xunmap.window == *((Window *)win); } /* @@ -59,8 +59,7 @@ static Bool isConfigureNotify(Display *dpy, XEvent *ev, XPointer win) { return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window*)win); } -static Bool -X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS) +static Bool X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS) { Uint32 start = SDL_GetTicks(); @@ -73,11 +72,10 @@ X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), } */ -static SDL_bool -X11_IsWindowMapped(_THIS, SDL_Window * window) +static SDL_bool X11_IsWindowMapped(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; XWindowAttributes attr; X11_XGetWindowAttributes(videodata->display, data->xwindow, &attr); @@ -89,8 +87,7 @@ X11_IsWindowMapped(_THIS, SDL_Window * window) } #if 0 -static SDL_bool -X11_IsActionAllowed(SDL_Window *window, Atom action) +static SDL_bool X11_IsActionAllowed(SDL_Window *window, Atom action) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Atom _NET_WM_ALLOWED_ACTIONS = data->videodata->_NET_WM_ALLOWED_ACTIONS; @@ -102,10 +99,8 @@ X11_IsActionAllowed(SDL_Window *window, Atom action) Atom *list; SDL_bool ret = SDL_FALSE; - if (X11_XGetWindowProperty(display, data->xwindow, _NET_WM_ALLOWED_ACTIONS, 0, 1024, False, XA_ATOM, &type, &form, &len, &remain, (unsigned char **)&list) == Success) - { - for (i=0; ixwindow, _NET_WM_ALLOWED_ACTIONS, 0, 1024, False, XA_ATOM, &type, &form, &len, &remain, (unsigned char **)&list) == Success) { + for (i=0; idriverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display = videodata->display; /* !!! FIXME: just dereference videodata below instead of copying to locals. */ Atom _NET_WM_STATE = videodata->_NET_WM_STATE; @@ -166,16 +160,15 @@ X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags) if (count > 0) { X11_XChangeProperty(display, xwindow, _NET_WM_STATE, XA_ATOM, 32, - PropModeReplace, (unsigned char *)atoms, count); + PropModeReplace, (unsigned char *)atoms, count); } else { X11_XDeleteProperty(display, xwindow, _NET_WM_STATE); } } -Uint32 -X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) +Uint32 X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; Display *display = videodata->display; Atom _NET_WM_STATE = videodata->_NET_WM_STATE; Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN; @@ -191,10 +184,10 @@ X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) Uint32 flags = 0; if (X11_XGetWindowProperty(display, xwindow, _NET_WM_STATE, - 0l, maxLength, False, XA_ATOM, &actualType, - &actualFormat, &numItems, &bytesAfter, - &propertyValue) == Success) { - Atom *atoms = (Atom *) propertyValue; + 0l, maxLength, False, XA_ATOM, &actualType, + &actualFormat, &numItems, &bytesAfter, + &propertyValue) == Success) { + Atom *atoms = (Atom *)propertyValue; int maximized = 0; int fullscreen = 0; @@ -207,7 +200,7 @@ X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) maximized |= 1; } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) { maximized |= 2; - } else if ( atoms[i] == _NET_WM_STATE_FULLSCREEN) { + } else if (atoms[i] == _NET_WM_STATE_FULLSCREEN) { fullscreen = 1; } } @@ -232,14 +225,13 @@ X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) } } - /* If the window is unmapped, numItems will be zero and _NET_WM_STATE_HIDDEN * will not be set. Do an additional check to see if the window is unmapped * and mark it as SDL_WINDOW_HIDDEN if it is. */ { XWindowAttributes attr; - SDL_memset(&attr,0,sizeof(attr)); + SDL_memset(&attr, 0, sizeof(attr)); X11_XGetWindowAttributes(videodata->display, xwindow, &attr); if (attr.map_state == IsUnmapped) { flags |= SDL_WINDOW_HIDDEN; @@ -254,17 +246,16 @@ X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow) return flags; } -static int -SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) +static int SetupWindowData(_THIS, SDL_Window *window, Window w, BOOL created) { - SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; SDL_WindowData *data; int numwindows = videodata->numwindows; int windowlistlength = videodata->windowlistlength; SDL_WindowData **windowlist = videodata->windowlist; /* Allocate the window data */ - data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data)); + data = (SDL_WindowData *)SDL_calloc(1, sizeof(*data)); if (!data) { return SDL_OutOfMemory(); } @@ -275,8 +266,8 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) if (SDL_X11_HAVE_UTF8 && videodata->im) { data->ic = X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w, - XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - NULL); + XNInputStyle, XIMPreeditNothing | XIMStatusNothing, + NULL); } #endif data->created = created; @@ -289,12 +280,13 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) videodata->numwindows++; } else { windowlist = - (SDL_WindowData **) SDL_realloc(windowlist, - (numwindows + - 1) * sizeof(*windowlist)); + (SDL_WindowData **)SDL_realloc(windowlist, + (numwindows + + 1) * + sizeof(*windowlist)); if (!windowlist) { - SDL_free(data); - return SDL_OutOfMemory(); + SDL_OutOfMemory(); + goto error_cleanup; } windowlist[numwindows] = data; videodata->numwindows++; @@ -324,10 +316,9 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) { Window FocalWindow; - int RevertTo=0; + int RevertTo = 0; X11_XGetInputFocus(data->videodata->display, &FocalWindow, &RevertTo); - if (FocalWindow==w) - { + if (FocalWindow == w) { window->flags |= SDL_WINDOW_INPUT_FOCUS; } @@ -340,13 +331,48 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) } } +#if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2) || defined(SDL_VIDEO_OPENGL_EGL) + if ((window->flags & SDL_WINDOW_OPENGL) && + ((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) || + SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) +#ifdef SDL_VIDEO_OPENGL_GLX + && (!_this->gl_data || X11_GL_UseEGL(_this) ) +#endif + ) { +#ifdef SDL_VIDEO_OPENGL_EGL + if (!_this->egl_data) { + goto error_cleanup; + } + + /* Create the GLES window surface */ + data->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType)w); + + if (data->egl_surface == EGL_NO_SURFACE) { + SDL_SetError("Could not create GLES window surface"); + goto error_cleanup; + } +#else + SDL_SetError("Could not create GLES window surface (EGL support not configured)"); + goto error_cleanup; +#endif /* SDL_VIDEO_OPENGL_EGL */ + } +#endif + /* All done! */ window->driverdata = data; return 0; + +error_cleanup: +#ifdef X_HAVE_UTF8_STRING + if (data->ic) { + X11_XDestroyIC(data->ic); + } +#endif + SDL_free(data); + return -1; } -static void -SetWindowBordered(Display *display, int screen, Window window, SDL_bool border) +static void SetWindowBordered(Display *display, int screen, Window window, SDL_bool border) { /* * this code used to check for KWM_WIN_DECORATION, but KDE hasn't @@ -369,19 +395,18 @@ SetWindowBordered(Display *display, int screen, Window window, SDL_bool border) }; X11_XChangeProperty(display, window, WM_HINTS, WM_HINTS, 32, - PropModeReplace, (unsigned char *) &MWMHints, - sizeof(MWMHints) / sizeof(long)); - } else { /* set the transient hints instead, if necessary */ + PropModeReplace, (unsigned char *)&MWMHints, + sizeof(MWMHints) / sizeof(long)); + } else { /* set the transient hints instead, if necessary */ X11_XSetTransientForHint(display, window, RootWindow(display, screen)); } } -int -X11_CreateWindow(_THIS, SDL_Window * window) +int X11_CreateWindow(_THIS, SDL_Window *window) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; const SDL_bool force_override_redirect = SDL_GetHintBoolean(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, SDL_FALSE); SDL_WindowData *windowdata; Display *display = data->display; @@ -402,11 +427,10 @@ X11_CreateWindow(_THIS, SDL_Window * window) long fevent = 0; const char *hint = NULL; -#if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_EGL +#if defined(SDL_VIDEO_OPENGL_GLX) || defined(SDL_VIDEO_OPENGL_EGL) const char *forced_visual_id = SDL_GetHint(SDL_HINT_VIDEO_X11_WINDOW_VISUALID); - if (forced_visual_id != NULL && forced_visual_id[0] != '\0') - { + if (forced_visual_id && forced_visual_id[0] != '\0') { XVisualInfo *vi, template; int nvis; @@ -417,28 +441,25 @@ X11_CreateWindow(_THIS, SDL_Window * window) visual = vi->visual; depth = vi->depth; X11_XFree(vi); - } - else - { + } else { return -1; } - } - else if ((window->flags & SDL_WINDOW_OPENGL) && - !SDL_getenv("SDL_VIDEO_X11_VISUALID")) { + } else if ((window->flags & SDL_WINDOW_OPENGL) && + !SDL_getenv("SDL_VIDEO_X11_VISUALID")) { XVisualInfo *vinfo = NULL; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL if (((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) || SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) -#if SDL_VIDEO_OPENGL_GLX - && ( !_this->gl_data || X11_GL_UseEGL(_this) ) +#ifdef SDL_VIDEO_OPENGL_GLX + && (!_this->gl_data || X11_GL_UseEGL(_this) ) #endif ) { vinfo = X11_GLES_GetVisual(_this, display, screen); } else #endif { -#if SDL_VIDEO_OPENGL_GLX +#ifdef SDL_VIDEO_OPENGL_GLX vinfo = X11_GL_GetVisual(_this, display, screen); #endif } @@ -471,7 +492,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) xattr.colormap = X11_XCreateColormap(display, RootWindow(display, screen), - visual, AllocAll); + visual, AllocAll); /* If we can't create a colormap, then we must die */ if (!xattr.colormap) { @@ -537,7 +558,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) } else { xattr.colormap = X11_XCreateColormap(display, RootWindow(display, screen), - visual, AllocNone); + visual, AllocNone); } /* Always create this with the window->windowed.* fields; if we're @@ -547,10 +568,11 @@ X11_CreateWindow(_THIS, SDL_Window * window) migration to fullscreen after CreateSDLWindow returns, which will put all the SDL_Window fields and system state as expected. */ w = X11_XCreateWindow(display, RootWindow(display, screen), - window->windowed.x, window->windowed.y, window->windowed.w, window->windowed.h, - 0, depth, InputOutput, visual, - (CWOverrideRedirect | CWBackPixmap | CWBorderPixel | - CWBackingStore | CWColormap), &xattr); + window->windowed.x, window->windowed.y, window->windowed.w, window->windowed.h, + 0, depth, InputOutput, visual, + (CWOverrideRedirect | CWBackPixmap | CWBorderPixel | + CWBackingStore | CWColormap), + &xattr); if (!w) { return SDL_SetError("Couldn't create window"); } @@ -589,40 +611,40 @@ X11_CreateWindow(_THIS, SDL_Window * window) X11_XFree(classhints); /* Set the PID related to the window for the given hostname, if possible */ if (data->pid > 0) { - long pid = (long) data->pid; + long pid = (long)data->pid; _NET_WM_PID = X11_XInternAtom(display, "_NET_WM_PID", False); X11_XChangeProperty(display, w, _NET_WM_PID, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *) &pid, 1); + (unsigned char *)&pid, 1); } /* Set the window manager state */ X11_SetNetWMState(_this, w, window->flags); - compositor = 2; /* don't disable compositing except for "normal" windows */ - + compositor = 2; /* don't disable compositing except for "normal" windows */ + hint = SDL_GetHint(SDL_HINT_X11_WINDOW_TYPE); if (window->flags & SDL_WINDOW_UTILITY) { wintype_name = "_NET_WM_WINDOW_TYPE_UTILITY"; } else if (window->flags & SDL_WINDOW_TOOLTIP) { wintype_name = "_NET_WM_WINDOW_TYPE_TOOLTIP"; } else if (window->flags & SDL_WINDOW_POPUP_MENU) { wintype_name = "_NET_WM_WINDOW_TYPE_POPUP_MENU"; - } else if ( ((hint = SDL_GetHint(SDL_HINT_X11_WINDOW_TYPE)) != NULL) && *hint ) { + } else if (hint && *hint) { wintype_name = hint; } else { wintype_name = "_NET_WM_WINDOW_TYPE_NORMAL"; - compositor = 1; /* disable compositing for "normal" windows */ + compositor = 1; /* disable compositing for "normal" windows */ } /* Let the window manager know what type of window we are. */ _NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); wintype = X11_XInternAtom(display, wintype_name, False); X11_XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32, - PropModeReplace, (unsigned char *)&wintype, 1); + PropModeReplace, (unsigned char *)&wintype, 1); if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, SDL_TRUE)) { _NET_WM_BYPASS_COMPOSITOR = X11_XInternAtom(display, "_NET_WM_BYPASS_COMPOSITOR", False); X11_XChangeProperty(display, w, _NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32, - PropModeReplace, - (unsigned char *)&compositor, 1); + PropModeReplace, + (unsigned char *)&compositor, 1); } { @@ -630,7 +652,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) int proto_count = 0; protocols[proto_count++] = data->WM_DELETE_WINDOW; /* Allow window to be deleted by the WM */ - protocols[proto_count++] = data->WM_TAKE_FOCUS; /* Since we will want to set input focus explicitly */ + protocols[proto_count++] = data->WM_TAKE_FOCUS; /* Since we will want to set input focus explicitly */ /* Default to using ping if there is no hint */ if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_NET_WM_PING, SDL_TRUE)) { @@ -646,33 +668,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) X11_XDestroyWindow(display, w); return -1; } - windowdata = (SDL_WindowData *) window->driverdata; - -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 || SDL_VIDEO_OPENGL_EGL - if ((window->flags & SDL_WINDOW_OPENGL) && - ((_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES) || - SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_FORCE_EGL, SDL_FALSE)) -#if SDL_VIDEO_OPENGL_GLX - && ( !_this->gl_data || X11_GL_UseEGL(_this) ) -#endif - ) { -#if SDL_VIDEO_OPENGL_EGL - if (!_this->egl_data) { - return -1; - } - - /* Create the GLES window surface */ - windowdata->egl_surface = SDL_EGL_CreateSurface(_this, (NativeWindowType) w); - - if (windowdata->egl_surface == EGL_NO_SURFACE) { - return SDL_SetError("Could not create GLES window surface"); - } -#else - return SDL_SetError("Could not create GLES window surface (EGL support not configured)"); -#endif /* SDL_VIDEO_OPENGL_EGL */ - } -#endif - + windowdata = (SDL_WindowData *)window->driverdata; #ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8 && windowdata->ic) { @@ -683,11 +679,11 @@ X11_CreateWindow(_THIS, SDL_Window * window) X11_Xinput2SelectTouch(_this, window); X11_XSelectInput(display, w, - (FocusChangeMask | EnterWindowMask | LeaveWindowMask | - ExposureMask | ButtonPressMask | ButtonReleaseMask | - PointerMotionMask | KeyPressMask | KeyReleaseMask | - PropertyChangeMask | StructureNotifyMask | - KeymapStateMask | fevent)); + (FocusChangeMask | EnterWindowMask | LeaveWindowMask | + ExposureMask | ButtonPressMask | ButtonReleaseMask | + PointerMotionMask | KeyPressMask | KeyReleaseMask | + PropertyChangeMask | StructureNotifyMask | + KeymapStateMask | fevent)); /* For _ICC_PROFILE. */ X11_XSelectInput(display, RootWindow(display, screen), PropertyChangeMask); @@ -697,10 +693,9 @@ X11_CreateWindow(_THIS, SDL_Window * window) return 0; } -int -X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) +int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) { - Window w = (Window) data; + Window w = (Window)data; window->title = X11_GetWindowTitle(_this, w); @@ -710,10 +705,9 @@ X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) return 0; } -char * -X11_GetWindowTitle(_THIS, Window xwindow) +char *X11_GetWindowTitle(_THIS, Window xwindow) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; Display *display = data->display; int status, real_format; Atom real_type; @@ -722,17 +716,17 @@ X11_GetWindowTitle(_THIS, Window xwindow) char *title = NULL; status = X11_XGetWindowProperty(display, xwindow, data->_NET_WM_NAME, - 0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format, - &items_read, &items_left, &propdata); + 0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format, + &items_read, &items_left, &propdata); if (status == Success && propdata) { - title = SDL_strdup(SDL_static_cast(char*, propdata)); + title = SDL_strdup(SDL_static_cast(char *, propdata)); X11_XFree(propdata); } else { status = X11_XGetWindowProperty(display, xwindow, XA_WM_NAME, - 0L, 8192L, False, XA_STRING, &real_type, &real_format, - &items_read, &items_left, &propdata); + 0L, 8192L, False, XA_STRING, &real_type, &real_format, + &items_read, &items_left, &propdata); if (status == Success && propdata) { - title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1); + title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char *, propdata), items_read + 1); SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Failed to convert WM_NAME title expecting UTF8! Title: %s", title); X11_XFree(propdata); } else { @@ -743,10 +737,9 @@ X11_GetWindowTitle(_THIS, Window xwindow) return title; } -void -X11_SetWindowTitle(_THIS, SDL_Window * window) +void X11_SetWindowTitle(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Window xwindow = data->xwindow; Display *display = data->videodata->display; char *title = window->title ? window->title : ""; @@ -754,10 +747,9 @@ X11_SetWindowTitle(_THIS, SDL_Window * window) SDL_X11_SetWindowTitle(display, xwindow, title); } -void -X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) +void X11_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON; @@ -778,14 +770,14 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) propdata[1] = icon->h; dst = &propdata[2]; for (y = 0; y < icon->h; ++y) { - src = (Uint32*)((Uint8*)icon->pixels + y * icon->pitch); + src = (Uint32 *)((Uint8 *)icon->pixels + y * icon->pitch); for (x = 0; x < icon->w; ++x) { *dst++ = *src++; } } X11_XChangeProperty(display, data->xwindow, _NET_WM_ICON, XA_CARDINAL, - 32, PropModeReplace, (unsigned char *) propdata, - propsize); + 32, PropModeReplace, (unsigned char *)propdata, + propsize); } SDL_free(propdata); } else { @@ -795,8 +787,7 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) } static SDL_bool caught_x11_error = SDL_FALSE; -static int -X11_CatchAnyError(Display * d, XErrorEvent * e) +static int X11_CatchAnyError(Display *d, XErrorEvent *e) { /* this may happen during tumultuous times when we are polling anyhow, so just note we had an error and return control. */ @@ -804,16 +795,16 @@ X11_CatchAnyError(Display * d, XErrorEvent * e) return 0; } -void -X11_SetWindowPosition(_THIS, SDL_Window * window) +void X11_SetWindowPosition(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; - int (*prev_handler) (Display *, XErrorEvent *) = NULL; + int (*prev_handler)(Display *, XErrorEvent *) = NULL; unsigned int childCount; Window childReturn, root, parent; - Window* children; + Window *children; XWindowAttributes attrs; + int x, y; int orig_x, orig_y; Uint32 timeout; @@ -833,8 +824,6 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) timeout = SDL_GetTicks() + 100; while (SDL_TRUE) { - int x, y; - caught_x11_error = SDL_FALSE; X11_XSync(display, False); X11_XGetWindowAttributes(display, data->xwindow, &attrs); @@ -843,11 +832,9 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) if (!caught_x11_error) { if ((x != orig_x) || (y != orig_y)) { - window->x = x; - window->y = y; - break; /* window moved, time to go. */ + break; /* window moved, time to go. */ } else if ((x == window->x) && (y == window->y)) { - break; /* we're at the place we wanted to be anyhow, drop out. */ + break; /* we're at the place we wanted to be anyhow, drop out. */ } } @@ -858,74 +845,66 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) SDL_Delay(10); } + if (!caught_x11_error) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, attrs.width, attrs.height); + } + X11_XSetErrorHandler(prev_handler); caught_x11_error = SDL_FALSE; } -void -X11_SetWindowMinimumSize(_THIS, SDL_Window * window) +void X11_SetWindowMinimumSize(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; if (window->flags & SDL_WINDOW_RESIZABLE) { - XSizeHints *sizehints = X11_XAllocSizeHints(); - long userhints; - - X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); + XSizeHints *sizehints = X11_XAllocSizeHints(); + long userhints; - sizehints->min_width = window->min_w; - sizehints->min_height = window->min_h; - sizehints->flags |= PMinSize; + X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); - X11_XSetWMNormalHints(display, data->xwindow, sizehints); + sizehints->min_width = window->min_w; + sizehints->min_height = window->min_h; + sizehints->flags |= PMinSize; - X11_XFree(sizehints); + X11_XSetWMNormalHints(display, data->xwindow, sizehints); - /* See comment in X11_SetWindowSize. */ - X11_XResizeWindow(display, data->xwindow, window->w, window->h); - X11_XMoveWindow(display, data->xwindow, window->x - data->border_left, window->y - data->border_top); - X11_XRaiseWindow(display, data->xwindow); + X11_XFree(sizehints); } X11_XFlush(display); } -void -X11_SetWindowMaximumSize(_THIS, SDL_Window * window) +void X11_SetWindowMaximumSize(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; if (window->flags & SDL_WINDOW_RESIZABLE) { - XSizeHints *sizehints = X11_XAllocSizeHints(); - long userhints; - - X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); + XSizeHints *sizehints = X11_XAllocSizeHints(); + long userhints; - sizehints->max_width = window->max_w; - sizehints->max_height = window->max_h; - sizehints->flags |= PMaxSize; + X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); - X11_XSetWMNormalHints(display, data->xwindow, sizehints); + sizehints->max_width = window->max_w; + sizehints->max_height = window->max_h; + sizehints->flags |= PMaxSize; - X11_XFree(sizehints); + X11_XSetWMNormalHints(display, data->xwindow, sizehints); - /* See comment in X11_SetWindowSize. */ - X11_XResizeWindow(display, data->xwindow, window->w, window->h); - X11_XMoveWindow(display, data->xwindow, window->x - data->border_left, window->y - data->border_top); - X11_XRaiseWindow(display, data->xwindow); + X11_XFree(sizehints); } X11_XFlush(display); } -void -X11_SetWindowSize(_THIS, SDL_Window * window) +void X11_SetWindowSize(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; - int (*prev_handler) (Display *, XErrorEvent *) = NULL; + int (*prev_handler)(Display *, XErrorEvent *) = NULL; XWindowAttributes attrs; int orig_w, orig_h; Uint32 timeout; @@ -939,20 +918,20 @@ X11_SetWindowSize(_THIS, SDL_Window * window) X11_ResizeWindowShape(window); } if (!(window->flags & SDL_WINDOW_RESIZABLE)) { - /* Apparently, if the X11 Window is set to a 'non-resizable' window, you cannot resize it using the X11_XResizeWindow, thus - we must set the size hints to adjust the window size. */ - XSizeHints *sizehints = X11_XAllocSizeHints(); - long userhints; + /* Apparently, if the X11 Window is set to a 'non-resizable' window, you cannot resize it using the X11_XResizeWindow, thus + we must set the size hints to adjust the window size. */ + XSizeHints *sizehints = X11_XAllocSizeHints(); + long userhints; - X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); + X11_XGetWMNormalHints(display, data->xwindow, sizehints, &userhints); - sizehints->min_width = sizehints->max_width = window->w; - sizehints->min_height = sizehints->max_height = window->h; - sizehints->flags |= PMinSize | PMaxSize; + sizehints->min_width = sizehints->max_width = window->w; + sizehints->min_height = sizehints->max_height = window->h; + sizehints->flags |= PMinSize | PMaxSize; - X11_XSetWMNormalHints(display, data->xwindow, sizehints); + X11_XSetWMNormalHints(display, data->xwindow, sizehints); - X11_XFree(sizehints); + X11_XFree(sizehints); /* From Pierre-Loup: WMs each have their little quirks with that. When you change the @@ -990,27 +969,37 @@ X11_SetWindowSize(_THIS, SDL_Window * window) if (!caught_x11_error) { if ((attrs.width != orig_w) || (attrs.height != orig_h)) { - window->w = attrs.width; - window->h = attrs.height; - break; /* window changed, time to go. */ + break; /* window changed, time to go. */ } else if ((attrs.width == window->w) && (attrs.height == window->h)) { - break; /* we're at the place we wanted to be anyhow, drop out. */ + break; /* we're at the place we wanted to be anyhow, drop out. */ } } if (SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + /* Timeout occurred and window size didn't change + * window manager likely denied the resize, + * or the new size is the same as the existing: + * - current width: is 'full width'. + * - try to set new width at 'full width + 1', which get truncated to 'full width'. + * - new width is/remains 'full width' + * So, even if we break here as a timeout, we can send an event, since the requested size isn't the same + * as the final size. (even if final size is same as original size). + */ break; } SDL_Delay(10); } + if (!caught_x11_error) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, attrs.width, attrs.height); + } + X11_XSetErrorHandler(prev_handler); caught_x11_error = SDL_FALSE; } -int -X11_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *bottom, int *right) +int X11_GetWindowBordersSize(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right) { SDL_WindowData *data = (SDL_WindowData *)window->driverdata; @@ -1022,40 +1011,38 @@ X11_GetWindowBordersSize(_THIS, SDL_Window * window, int *top, int *left, int *b return 0; } -int -X11_SetWindowOpacity(_THIS, SDL_Window * window, float opacity) +int X11_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; Atom _NET_WM_WINDOW_OPACITY = data->videodata->_NET_WM_WINDOW_OPACITY; if (opacity == 1.0f) { X11_XDeleteProperty(display, data->xwindow, _NET_WM_WINDOW_OPACITY); - } else { + } else { const Uint32 FullyOpaque = 0xFFFFFFFF; - const long alpha = (long) ((double)opacity * (double)FullyOpaque); + const long alpha = (long)((double)opacity * (double)FullyOpaque); X11_XChangeProperty(display, data->xwindow, _NET_WM_WINDOW_OPACITY, XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)&alpha, 1); + PropModeReplace, (unsigned char *)&alpha, 1); } return 0; } -int -X11_SetWindowModalFor(_THIS, SDL_Window * modal_window, SDL_Window * parent_window) { - SDL_WindowData *data = (SDL_WindowData *) modal_window->driverdata; - SDL_WindowData *parent_data = (SDL_WindowData *) parent_window->driverdata; +int X11_SetWindowModalFor(_THIS, SDL_Window *modal_window, SDL_Window *parent_window) +{ + SDL_WindowData *data = (SDL_WindowData *)modal_window->driverdata; + SDL_WindowData *parent_data = (SDL_WindowData *)parent_window->driverdata; Display *display = data->videodata->display; X11_XSetTransientForHint(display, data->xwindow, parent_data->xwindow); return 0; } -int -X11_SetWindowInputFocus(_THIS, SDL_Window * window) +int X11_SetWindowInputFocus(_THIS, SDL_Window *window) { if (X11_IsWindowMapped(_this, window)) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime); X11_XFlush(display); @@ -1064,14 +1051,14 @@ X11_SetWindowInputFocus(_THIS, SDL_Window * window) return -1; } -void -X11_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) +void X11_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) { - const SDL_bool focused = ((window->flags & SDL_WINDOW_INPUT_FOCUS) != 0); - const SDL_bool visible = ((window->flags & SDL_WINDOW_HIDDEN) == 0); - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + const SDL_bool focused = (window->flags & SDL_WINDOW_INPUT_FOCUS) ? SDL_TRUE : SDL_FALSE; + const SDL_bool visible = (!(window->flags & SDL_WINDOW_HIDDEN)) ? SDL_TRUE : SDL_FALSE; + + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; XEvent event; @@ -1100,10 +1087,9 @@ X11_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) X11_XSync(display, False); } -void -X11_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) +void X11_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XSizeHints *sizehints = X11_XAllocSizeHints(); @@ -1138,11 +1124,10 @@ X11_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) X11_XFlush(display); } -void -X11_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) +void X11_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; Atom _NET_WM_STATE_ABOVE = data->videodata->_NET_WM_STATE_ABOVE; @@ -1161,17 +1146,16 @@ X11_SetWindowAlwaysOnTop(_THIS, SDL_Window * window, SDL_bool on_top) e.xclient.data.l[3] = 0l; X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + SubstructureNotifyMask | SubstructureRedirectMask, &e); } else { X11_SetNetWMState(_this, data->xwindow, window->flags); } X11_XFlush(display); } -void -X11_ShowWindow(_THIS, SDL_Window * window) +void X11_ShowWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XEvent event; @@ -1180,8 +1164,9 @@ X11_ShowWindow(_THIS, SDL_Window * window) /* Blocking wait for "MapNotify" event. * We use X11_XIfEvent because pXWindowEvent takes a mask rather than a type, * and XCheckTypedWindowEvent doesn't block */ - if(!(window->flags & SDL_WINDOW_FOREIGN)) + if (!(window->flags & SDL_WINDOW_FOREIGN)) { X11_XIfEvent(display, &event, &isMapNotify, (XPointer)&data->xwindow); + } X11_XFlush(display); } @@ -1191,31 +1176,35 @@ X11_ShowWindow(_THIS, SDL_Window * window) X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime); X11_XFlush(display); } + + /* Get some valid border values, if we haven't them yet */ + if (data->border_left == 0 && data->border_right == 0 && data->border_top == 0 && data->border_bottom == 0) { + X11_GetBorderValues(data); + } } -void -X11_HideWindow(_THIS, SDL_Window * window) +void X11_HideWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; XEvent event; if (X11_IsWindowMapped(_this, window)) { X11_XWithdrawWindow(display, data->xwindow, displaydata->screen); /* Blocking wait for "UnmapNotify" event */ - if(!(window->flags & SDL_WINDOW_FOREIGN)) + if (!(window->flags & SDL_WINDOW_FOREIGN)) { X11_XIfEvent(display, &event, &isUnmapNotify, (XPointer)&data->xwindow); + } X11_XFlush(display); } } -static void -SetWindowActive(_THIS, SDL_Window * window) +static void SetWindowActive(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; Atom _NET_ACTIVE_WINDOW = data->videodata->_NET_ACTIVE_WINDOW; @@ -1229,21 +1218,20 @@ SetWindowActive(_THIS, SDL_Window * window) e.xclient.message_type = _NET_ACTIVE_WINDOW; e.xclient.format = 32; e.xclient.window = data->xwindow; - e.xclient.data.l[0] = 1; /* source indication. 1 = application */ + e.xclient.data.l[0] = 1; /* source indication. 1 = application */ e.xclient.data.l[1] = data->user_time; e.xclient.data.l[2] = 0; X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + SubstructureNotifyMask | SubstructureRedirectMask, &e); X11_XFlush(display); } } -void -X11_RaiseWindow(_THIS, SDL_Window * window) +void X11_RaiseWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; X11_XRaiseWindow(display, data->xwindow); @@ -1251,12 +1239,11 @@ X11_RaiseWindow(_THIS, SDL_Window * window) X11_XFlush(display); } -static void -SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) +static void SetWindowMaximized(_THIS, SDL_Window *window, SDL_bool maximized) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; @@ -1267,7 +1254,7 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) } else { window->flags &= ~SDL_WINDOW_MAXIMIZED; - if ((window->flags & SDL_WINDOW_FULLSCREEN) != 0) { + if (window->flags & SDL_WINDOW_FULLSCREEN) { /* Fullscreen windows are maximized on some window managers, and this is functional behavior, so don't remove that state now, we'll take care of it when we leave fullscreen mode. @@ -1277,8 +1264,25 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) } if (X11_IsWindowMapped(_this, window)) { + /* !!! FIXME: most of this waiting code is copy/pasted from elsewhere. */ + int (*prev_handler)(Display *, XErrorEvent *) = NULL; + XWindowAttributes attrs; + Window childReturn, root, parent; + Window *children; + unsigned int childCount; + int orig_w, orig_h, orig_x, orig_y; + int x, y; + Uint64 timeout; XEvent e; + X11_XSync(display, False); + X11_XQueryTree(display, data->xwindow, &root, &parent, &children, &childCount); + X11_XGetWindowAttributes(display, data->xwindow, &attrs); + X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display), + attrs.x, attrs.y, &orig_x, &orig_y, &childReturn); + orig_w = attrs.width; + orig_h = attrs.height; + SDL_zero(e); e.xany.type = ClientMessage; e.xclient.message_type = _NET_WM_STATE; @@ -1291,33 +1295,64 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) e.xclient.data.l[3] = 0l; X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + SubstructureNotifyMask | SubstructureRedirectMask, &e); + + /* Wait a brief time to see if the window manager decided to let this happen. + If the window changes at all, even to an unexpected value, we break out. */ + X11_XSync(display, False); + prev_handler = X11_XSetErrorHandler(X11_CatchAnyError); + + timeout = SDL_GetTicks64() + 100; + while (SDL_TRUE) { + caught_x11_error = SDL_FALSE; + X11_XSync(display, False); + X11_XGetWindowAttributes(display, data->xwindow, &attrs); + X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display), + attrs.x, attrs.y, &x, &y, &childReturn); + + if (!caught_x11_error) { + if ((x != orig_x) || (y != orig_y) || (attrs.width != orig_w) || (attrs.height != orig_h)) { + break; /* window changed, time to go. */ + } + } + + if (SDL_GetTicks64() >= timeout) { + break; + } + + SDL_Delay(10); + } + + if (!caught_x11_error) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, attrs.width, attrs.height); + } + + X11_XSetErrorHandler(prev_handler); + caught_x11_error = SDL_FALSE; } else { X11_SetNetWMState(_this, data->xwindow, window->flags); } X11_XFlush(display); } -void -X11_MaximizeWindow(_THIS, SDL_Window * window) +void X11_MaximizeWindow(_THIS, SDL_Window *window) { SetWindowMaximized(_this, window, SDL_TRUE); } -void -X11_MinimizeWindow(_THIS, SDL_Window * window) +void X11_MinimizeWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; SDL_DisplayData *displaydata = - (SDL_DisplayData *) SDL_GetDisplayForWindow(window)->driverdata; + (SDL_DisplayData *)SDL_GetDisplayForWindow(window)->driverdata; Display *display = data->videodata->display; X11_XIconifyWindow(display, data->xwindow, displaydata->screen); X11_XFlush(display); } -void -X11_RestoreWindow(_THIS, SDL_Window * window) +void X11_RestoreWindow(_THIS, SDL_Window *window) { SetWindowMaximized(_this, window, SDL_FALSE); X11_ShowWindow(_this, window); @@ -1325,23 +1360,25 @@ X11_RestoreWindow(_THIS, SDL_Window * window) } /* This asks the Window Manager to handle fullscreen for us. This is the modern way. */ -static void -X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _display, SDL_bool fullscreen) +static void X11_SetWindowFullscreenViaWM(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_DisplayData *displaydata = (SDL_DisplayData *) _display->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)_display->driverdata; Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN; + SDL_bool window_size_changed = SDL_FALSE; + int window_position_changed = 0; if (X11_IsWindowMapped(_this, window)) { XEvent e; /* !!! FIXME: most of this waiting code is copy/pasted from elsewhere. */ - int (*prev_handler) (Display *, XErrorEvent *) = NULL; + int (*prev_handler)(Display *, XErrorEvent *) = NULL; unsigned int childCount; Window childReturn, root, parent; - Window* children; + Window *children; XWindowAttributes attrs; + int x, y; int orig_w, orig_h, orig_x, orig_y; Uint64 timeout; @@ -1384,7 +1421,7 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis e.xclient.data.l[3] = 0l; X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + SubstructureNotifyMask | SubstructureRedirectMask, &e); /* Fullscreen windows sometimes end up being marked maximized by window managers. Force it back to how we expect it to be. */ @@ -1394,7 +1431,7 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis e.xclient.message_type = _NET_WM_STATE; e.xclient.format = 32; e.xclient.window = data->xwindow; - if ((window->flags & SDL_WINDOW_MAXIMIZED) != 0) { + if (window->flags & SDL_WINDOW_MAXIMIZED) { e.xclient.data.l[0] = _NET_WM_STATE_ADD; } else { e.xclient.data.l[0] = _NET_WM_STATE_REMOVE; @@ -1403,9 +1440,19 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis e.xclient.data.l[2] = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; e.xclient.data.l[3] = 0l; X11_XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + SubstructureNotifyMask | SubstructureRedirectMask, &e); } + if (!fullscreen) { + int dest_x = 0, dest_y = 0; + dest_x = window->windowed.x - data->border_left; + dest_y = window->windowed.y - data->border_top; + + /* Attempt to move the window */ + X11_XMoveWindow(display, data->xwindow, dest_x, dest_y); + } + + /* Wait a brief time to see if the window manager decided to let this happen. If the window changes at all, even to an unexpected value, we break out. */ X11_XSync(display, False); @@ -1413,7 +1460,6 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis timeout = SDL_GetTicks64() + 100; while (SDL_TRUE) { - int x, y; caught_x11_error = SDL_FALSE; X11_XSync(display, False); @@ -1422,19 +1468,21 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis attrs.x, attrs.y, &x, &y, &childReturn); if (!caught_x11_error) { - SDL_bool window_changed = SDL_FALSE; if ((x != orig_x) || (y != orig_y)) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_MOVED, x, y); - window_changed = SDL_TRUE; + orig_x = x; + orig_y = y; + window_position_changed += 1; } if ((attrs.width != orig_w) || (attrs.height != orig_h)) { - SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESIZED, attrs.width, attrs.height); - window_changed = SDL_TRUE; + orig_w = attrs.width; + orig_h = attrs.height; + window_size_changed = SDL_TRUE; } - if (window_changed) { - break; /* window changed, time to go. */ + /* Wait for at least 2 moves + 1 size changed to have valid values */ + if (window_position_changed >= 2 && window_size_changed) { + break; /* window changed, time to go. */ } } @@ -1445,6 +1493,11 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis SDL_Delay(10); } + if (!caught_x11_error) { + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, attrs.width, attrs.height); + } + X11_XSetErrorHandler(prev_handler); caught_x11_error = SDL_FALSE; } else { @@ -1460,7 +1513,7 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis } if (data->visual->class == DirectColor) { - if ( fullscreen ) { + if (fullscreen) { X11_XInstallColormap(display, data->colormap); } else { X11_XUninstallColormap(display, data->colormap); @@ -1470,14 +1523,12 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis X11_XFlush(display); } -void -X11_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * _display, SDL_bool fullscreen) +void X11_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen) { X11_SetWindowFullscreenViaWM(_this, window, _display, fullscreen); } -int -X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) +int X11_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; @@ -1554,7 +1605,7 @@ typedef struct { */ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) { - unsigned char *ret=NULL; + unsigned char *ret = NULL; Atom type; int fmt; unsigned long count; @@ -1562,34 +1613,35 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) int bytes_fetch = 0; do { - if (ret != NULL) X11_XFree(ret); + if (ret) { + X11_XFree(ret); + } X11_XGetWindowProperty(disp, w, prop, 0, bytes_fetch, False, AnyPropertyType, &type, &fmt, &count, &bytes_left, &ret); bytes_fetch += bytes_left; } while (bytes_left != 0); - p->data=ret; - p->format=fmt; - p->count=count; - p->type=type; + p->data = ret; + p->format = fmt; + p->count = count; + p->type = type; } -void* -X11_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) +void *X11_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XWindowAttributes attributes; Atom icc_profile_atom; char icc_atom_string[sizeof("_ICC_PROFILE_") + 12]; - void* ret_icc_profile_data = NULL; - CARD8* icc_profile_data; + void *ret_icc_profile_data = NULL; + CARD8 *icc_profile_data; int real_format; unsigned long real_nitems; SDL_x11Prop atomProp; X11_XGetWindowAttributes(display, data->xwindow, &attributes); if (X11_XScreenNumberOfScreen(attributes.screen) > 0) { - SDL_snprintf(icc_atom_string, sizeof("_ICC_PROFILE_") + 12, "%s%d", "_ICC_PROFILE_", X11_XScreenNumberOfScreen(attributes.screen)); + (void)SDL_snprintf(icc_atom_string, sizeof("_ICC_PROFILE_") + 12, "%s%d", "_ICC_PROFILE_", X11_XScreenNumberOfScreen(attributes.screen)); } else { SDL_strlcpy(icc_atom_string, "_ICC_PROFILE", sizeof("_ICC_PROFILE")); } @@ -1619,17 +1671,16 @@ X11_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size) SDL_memcpy(ret_icc_profile_data, icc_profile_data, real_nitems); *size = real_nitems; X11_XFree(icc_profile_data); - + return ret_icc_profile_data; } -void -X11_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void X11_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display; - if (data == NULL) { + if (!data) { return; } data->mouse_grabbed = SDL_FALSE; @@ -1652,8 +1703,8 @@ X11_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) /* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */ for (attempts = 0; attempts < 100; attempts++) { - result = X11_XGrabPointer(display, data->xwindow, True, mask, GrabModeAsync, - GrabModeAsync, data->xwindow, None, CurrentTime); + result = X11_XGrabPointer(display, data->xwindow, False, mask, GrabModeAsync, + GrabModeAsync, data->xwindow, None, CurrentTime); if (result == GrabSuccess) { data->mouse_grabbed = SDL_TRUE; break; @@ -1663,7 +1714,7 @@ X11_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) if (result != GrabSuccess) { SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "The X server refused to let us grab the mouse. You might experience input bugs."); - data->videodata->broken_pointer_grab = SDL_TRUE; /* don't try again. */ + data->videodata->broken_pointer_grab = SDL_TRUE; /* don't try again. */ } } @@ -1679,13 +1730,12 @@ X11_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) X11_XSync(display, False); } -void -X11_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) +void X11_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display; - if (data == NULL) { + if (!data) { return; } @@ -1707,13 +1757,12 @@ X11_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed) X11_XSync(display, False); } -void -X11_DestroyWindow(_THIS, SDL_Window * window) +void X11_DestroyWindow(_THIS, SDL_Window *window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; if (window->shaper) { - SDL_ShapeData *shapedata = (SDL_ShapeData *) window->shaper->driverdata; + SDL_ShapeData *shapedata = (SDL_ShapeData *)window->shaper->driverdata; if (shapedata) { SDL_free(shapedata->bitmap); SDL_free(shapedata); @@ -1723,7 +1772,7 @@ X11_DestroyWindow(_THIS, SDL_Window * window) } if (data) { - SDL_VideoData *videodata = (SDL_VideoData *) data->videodata; + SDL_VideoData *videodata = (SDL_VideoData *)data->videodata; Display *display = videodata->display; int numwindows = videodata->numwindows; SDL_WindowData **windowlist = videodata->windowlist; @@ -1750,7 +1799,7 @@ X11_DestroyWindow(_THIS, SDL_Window * window) } SDL_free(data); -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES /* If the pointer barriers are active for this, deactivate it.*/ if (videodata->active_cursor_confined_window == window) { X11_DestroyPointerBarrier(_this, window); @@ -1760,8 +1809,7 @@ X11_DestroyWindow(_THIS, SDL_Window * window) window->driverdata = NULL; } -SDL_bool -X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) +SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display; @@ -1786,32 +1834,29 @@ X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) } } -int -X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) +int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) { - return 0; /* just succeed, the real work is done elsewhere. */ + return 0; /* just succeed, the real work is done elsewhere. */ } -void -X11_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept) +void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; Atom XdndAware = X11_XInternAtom(display, "XdndAware", False); if (accept) { Atom xdnd_version = 5; X11_XChangeProperty(display, data->xwindow, XdndAware, XA_ATOM, 32, - PropModeReplace, (unsigned char*)&xdnd_version, 1); + PropModeReplace, (unsigned char *)&xdnd_version, 1); } else { X11_XDeleteProperty(display, data->xwindow, XdndAware); } } -int -X11_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation) +int X11_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XWMHints *wmhints; @@ -1854,10 +1899,11 @@ X11_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation) return 0; } -int SDL_X11_SetWindowTitle(Display* display, Window xwindow, char* title) { +int SDL_X11_SetWindowTitle(Display *display, Window xwindow, char *title) +{ Atom _NET_WM_NAME = X11_XInternAtom(display, "_NET_WM_NAME", False); XTextProperty titleprop; - int conv = X11_XmbTextListToTextProperty(display, (char**) &title, 1, XTextStyle, &titleprop); + int conv = X11_XmbTextListToTextProperty(display, &title, 1, XTextStyle, &titleprop); Status status; if (X11_XSupportsLocale() != True) { @@ -1867,7 +1913,7 @@ int SDL_X11_SetWindowTitle(Display* display, Window xwindow, char* title) { if (conv == 0) { X11_XSetTextProperty(display, xwindow, &titleprop, XA_WM_NAME); X11_XFree(titleprop.value); - /* we know this can't be a locale error as we checked X locale validity */ + /* we know this can't be a locale error as we checked X locale validity */ } else if (conv < 0) { return SDL_OutOfMemory(); } else { /* conv > 0 */ @@ -1876,7 +1922,7 @@ int SDL_X11_SetWindowTitle(Display* display, Window xwindow, char* title) { } #ifdef X_HAVE_UTF8_STRING - status = X11_Xutf8TextListToTextProperty(display, (char **) &title, 1, XUTF8StringStyle, &titleprop); + status = X11_Xutf8TextListToTextProperty(display, &title, 1, XUTF8StringStyle, &titleprop); if (status == Success) { X11_XSetTextProperty(display, xwindow, &titleprop, _NET_WM_NAME); X11_XFree(titleprop.value); diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index 5298decc4c364..cc8511f44ed23 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,9 +27,9 @@ video mode changes and we can respond to them by triggering more mode changes. */ -#define PENDING_FOCUS_TIME 200 +#define PENDING_FOCUS_TIME 200 -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL #include #endif @@ -70,10 +70,10 @@ typedef struct Window xdnd_source; SDL_bool flashing_window; Uint32 flash_cancel_time; -#if SDL_VIDEO_OPENGL_EGL +#ifdef SDL_VIDEO_OPENGL_EGL EGLSurface egl_surface; #endif -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES SDL_bool pointer_barrier_active; PointerBarrier barrier[4]; SDL_Rect barrier_rect; @@ -83,8 +83,8 @@ typedef struct extern void X11_SetNetWMState(_THIS, Window xwindow, Uint32 flags); extern Uint32 X11_GetNetWMState(_THIS, SDL_Window *window, Window xwindow); -extern int X11_CreateWindow(_THIS, SDL_Window * window); -extern int X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); +extern int X11_CreateWindow(_THIS, SDL_Window *window); +extern int X11_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); extern char *X11_GetWindowTitle(_THIS, Window xwindow); extern void X11_SetWindowTitle(_THIS, SDL_Window * window); extern void X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); @@ -114,10 +114,10 @@ extern void X11_DestroyWindow(_THIS, SDL_Window * window); extern SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info); extern int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); -extern void X11_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept); -extern int X11_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation); +extern void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); +extern int X11_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); -int SDL_X11_SetWindowTitle(Display* display, Window xwindow, char* string); +int SDL_X11_SetWindowTitle(Display *display, Window xwindow, char *title); #endif /* SDL_x11window_h_ */ diff --git a/src/video/x11/SDL_x11xfixes.c b/src/video/x11/SDL_x11xfixes.c index 95027d46b2664..3fb000dde5543 100644 --- a/src/video/x11/SDL_x11xfixes.c +++ b/src/video/x11/SDL_x11xfixes.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 && SDL_VIDEO_DRIVER_X11_XFIXES +#if defined(SDL_VIDEO_DRIVER_X11) && defined(SDL_VIDEO_DRIVER_X11_XFIXES) #include "SDL_x11video.h" #include "SDL_x11xfixes.h" @@ -29,35 +29,42 @@ #include "../../events/SDL_touch_c.h" static int xfixes_initialized = 0; +static int xfixes_selection_notify_event = 0; -static int -query_xfixes_version(Display *display, int major, int minor) +static int query_xfixes_version(Display *display, int major, int minor) { /* We don't care if this fails, so long as it sets major/minor on it's way out the door. */ X11_XFixesQueryVersion(display, &major, &minor); - return ((major * 1000) + minor); + return (major * 1000) + minor; } -static SDL_bool -xfixes_version_atleast(const int version, const int wantmajor, const int wantminor) +static SDL_bool xfixes_version_atleast(const int version, const int wantmajor, const int wantminor) { - return (version >= ((wantmajor * 1000) + wantminor)); + return version >= ((wantmajor * 1000) + wantminor); } -void -X11_InitXfixes(_THIS) +void X11_InitXfixes(_THIS) { - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int version = 0; int event, error; int fixes_opcode; + Atom XA_CLIPBOARD = X11_XInternAtom(data->display, "CLIPBOARD", 0); + if (!SDL_X11_HAVE_XFIXES || !X11_XQueryExtension(data->display, "XFIXES", &fixes_opcode, &event, &error)) { return; } + /* Selection tracking is available in all versions of XFixes */ + xfixes_selection_notify_event = event + XFixesSelectionNotify; + X11_XFixesSelectSelectionInput(data->display, DefaultRootWindow(data->display), + XA_CLIPBOARD, XFixesSetSelectionOwnerNotifyMask); + X11_XFixesSelectSelectionInput(data->display, DefaultRootWindow(data->display), + XA_PRIMARY, XFixesSetSelectionOwnerNotifyMask); + /* We need at least 5.0 for barriers. */ version = query_xfixes_version(data->display, 5, 0); if (!xfixes_version_atleast(version, 5, 0)) { @@ -67,14 +74,17 @@ X11_InitXfixes(_THIS) xfixes_initialized = 1; } -int -X11_XfixesIsInitialized() +int X11_XfixesIsInitialized(void) { return xfixes_initialized; } -void -X11_SetWindowMouseRect(_THIS, SDL_Window * window) +int X11_GetXFixesSelectionNotifyEvent(void) +{ + return xfixes_selection_notify_event; +} + +void X11_SetWindowMouseRect(_THIS, SDL_Window *window) { if (SDL_RectEmpty(&window->mouse_rect)) { X11_ConfineCursorWithFlags(_this, window, NULL, 0); @@ -83,7 +93,7 @@ X11_SetWindowMouseRect(_THIS, SDL_Window * window) X11_ConfineCursorWithFlags(_this, window, &window->mouse_rect, 0); } else { /* Save the state for when we get focus again */ - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata; SDL_memcpy(&wdata->barrier_rect, &window->mouse_rect, sizeof(wdata->barrier_rect)); @@ -92,14 +102,13 @@ X11_SetWindowMouseRect(_THIS, SDL_Window * window) } } -int -X11_ConfineCursorWithFlags(_THIS, SDL_Window * window, const SDL_Rect * rect, int flags) +int X11_ConfineCursorWithFlags(_THIS, SDL_Window *window, const SDL_Rect *rect, int flags) { /* Yaakuro: For some reason Xfixes when confining inside a rect where the * edges exactly match, a rectangle the cursor 'slips' out of the barrier. * To prevent that the lines for the barriers will span the whole screen. */ - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; SDL_WindowData *wdata; if (!X11_XfixesIsInitialized()) { @@ -108,11 +117,11 @@ X11_ConfineCursorWithFlags(_THIS, SDL_Window * window, const SDL_Rect * rect, in /* If there is already a set of barriers active, disable them. */ if (data->active_cursor_confined_window) { - X11_DestroyPointerBarrier(_this, data->active_cursor_confined_window); + X11_DestroyPointerBarrier(_this, data->active_cursor_confined_window); } SDL_assert(window != NULL); - wdata = (SDL_WindowData *) window->driverdata; + wdata = (SDL_WindowData *)window->driverdata; /* If user did not specify an area to confine, destroy the barrier that was/is assigned to * this window it was assigned */ @@ -140,28 +149,28 @@ X11_ConfineCursorWithFlags(_THIS, SDL_Window * window, const SDL_Rect * rect, in /** Create the left barrier */ wdata->barrier[0] = X11_XFixesCreatePointerBarrier(data->display, wdata->xwindow, - x1, bounds.y, - x1, bounds.y + bounds.h, - BarrierPositiveX, - 0, NULL); + x1, bounds.y, + x1, bounds.y + bounds.h, + BarrierPositiveX, + 0, NULL); /** Create the right barrier */ wdata->barrier[1] = X11_XFixesCreatePointerBarrier(data->display, wdata->xwindow, - x2, bounds.y, - x2, bounds.y + bounds.h, - BarrierNegativeX, - 0, NULL); + x2, bounds.y, + x2, bounds.y + bounds.h, + BarrierNegativeX, + 0, NULL); /** Create the top barrier */ wdata->barrier[2] = X11_XFixesCreatePointerBarrier(data->display, wdata->xwindow, - bounds.x, y1, - bounds.x + bounds.w, y1, - BarrierPositiveY, - 0, NULL); + bounds.x, y1, + bounds.x + bounds.w, y1, + BarrierPositiveY, + 0, NULL); /** Create the bottom barrier */ wdata->barrier[3] = X11_XFixesCreatePointerBarrier(data->display, wdata->xwindow, - bounds.x, y2, - bounds.x + bounds.w, y2, - BarrierNegativeY, - 0, NULL); + bounds.x, y2, + bounds.x + bounds.w, y2, + BarrierNegativeY, + 0, NULL); X11_XFlush(data->display); @@ -182,13 +191,12 @@ X11_ConfineCursorWithFlags(_THIS, SDL_Window * window, const SDL_Rect * rect, in return 0; } -void -X11_DestroyPointerBarrier(_THIS, SDL_Window * window) +void X11_DestroyPointerBarrier(_THIS, SDL_Window *window) { int i; - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; if (window) { - SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata; + SDL_WindowData *wdata = (SDL_WindowData *)window->driverdata; for (i = 0; i < 4; i++) { if (wdata->barrier[i] > 0) { diff --git a/src/video/x11/SDL_x11xfixes.h b/src/video/x11/SDL_x11xfixes.h index 7239d3fd275f7..8c72b19de4cdd 100644 --- a/src/video/x11/SDL_x11xfixes.h +++ b/src/video/x11/SDL_x11xfixes.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,16 +24,16 @@ #ifndef SDL_x11xfixes_h_ #define SDL_x11xfixes_h_ -#if SDL_VIDEO_DRIVER_X11_XFIXES +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES #define X11_BARRIER_HANDLED_BY_EVENT 1 extern void X11_InitXfixes(_THIS); extern int X11_XfixesIsInitialized(void); -extern void X11_SetWindowMouseRect(_THIS, SDL_Window * window); -extern int X11_ConfineCursorWithFlags(_THIS, SDL_Window * window, const SDL_Rect * rect, int flags); -extern void X11_DestroyPointerBarrier(_THIS, SDL_Window * window); - +extern void X11_SetWindowMouseRect(_THIS, SDL_Window *window); +extern int X11_ConfineCursorWithFlags(_THIS, SDL_Window *window, const SDL_Rect *rect, int flags); +extern void X11_DestroyPointerBarrier(_THIS, SDL_Window *window); +extern int X11_GetXFixesSelectionNotifyEvent(void); #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ #endif /* SDL_x11xfixes_h_ */ diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index db3187b01948b..65ed9b6dfdc00 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,7 +20,7 @@ */ #include "../../SDL_internal.h" -#if SDL_VIDEO_DRIVER_X11 +#ifdef SDL_VIDEO_DRIVER_X11 #include "SDL_x11video.h" #include "SDL_x11xinput2.h" @@ -29,10 +29,10 @@ #define MAX_AXIS 16 -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 static int xinput2_initialized = 0; -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH static int xinput2_multitouch_supported = 0; #endif @@ -42,17 +42,19 @@ static int xinput2_multitouch_supported = 0; * this extension */ static int xinput2_opcode; -static void parse_valuators(const double *input_values, const unsigned char *mask,int mask_len, - double *output_values,int output_values_len) { - int i = 0,z = 0; +static void parse_valuators(const double *input_values, const unsigned char *mask, int mask_len, + double *output_values, int output_values_len) +{ + int i = 0, z = 0; int top = mask_len * 8; - if (top > MAX_AXIS) + if (top > MAX_AXIS) { top = MAX_AXIS; + } - SDL_memset(output_values,0,output_values_len * sizeof(double)); + SDL_memset(output_values, 0, output_values_len * sizeof(double)); for (; i < top && z < output_values_len; i++) { if (XIMaskIsSet(mask, i)) { - const int value = (int) *input_values; + const int value = (int)*input_values; output_values[z] = value; input_values++; } @@ -60,23 +62,20 @@ static void parse_valuators(const double *input_values, const unsigned char *mas } } -static int -query_xinput2_version(Display *display, int major, int minor) +static int query_xinput2_version(Display *display, int major, int minor) { /* We don't care if this fails, so long as it sets major/minor on it's way out the door. */ X11_XIQueryVersion(display, &major, &minor); - return ((major * 1000) + minor); + return (major * 1000) + minor; } -static SDL_bool -xinput2_version_atleast(const int version, const int wantmajor, const int wantminor) +static SDL_bool xinput2_version_atleast(const int version, const int wantmajor, const int wantminor) { - return ( version >= ((wantmajor * 1000) + wantminor) ); + return version >= ((wantmajor * 1000) + wantminor); } -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH -static SDL_Window * -xinput2_get_sdlwindow(SDL_VideoData *videodata, Window window) +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +static SDL_Window *xinput2_get_sdlwindow(SDL_VideoData *videodata, Window window) { int i; for (i = 0; i < videodata->numwindows; i++) { @@ -88,8 +87,7 @@ xinput2_get_sdlwindow(SDL_VideoData *videodata, Window window) return NULL; } -static void -xinput2_normalize_touch_coordinates(SDL_Window *window, double in_x, double in_y, float *out_x, float *out_y) +static void xinput2_normalize_touch_coordinates(SDL_Window *window, double in_x, double in_y, float *out_x, float *out_y) { if (window) { if (window->w == 1) { @@ -112,11 +110,10 @@ xinput2_normalize_touch_coordinates(SDL_Window *window, double in_x, double in_y #endif /* SDL_VIDEO_DRIVER_X11_XINPUT2 */ -void -X11_InitXinput2(_THIS) +void X11_InitXinput2(_THIS) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2 - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; int version = 0; XIEventMask eventmask; @@ -124,14 +121,14 @@ X11_InitXinput2(_THIS) int event, err; /* - * Initialize XInput 2 - * According to http://who-t.blogspot.com/2009/05/xi2-recipes-part-1.html its better - * to inform Xserver what version of Xinput we support.The server will store the version we support. - * "As XI2 progresses it becomes important that you use this call as the server may treat the client - * differently depending on the supported version". - * - * FIXME:event and err are not needed but if not passed X11_XQueryExtension returns SegmentationFault - */ + * Initialize XInput 2 + * According to http://who-t.blogspot.com/2009/05/xi2-recipes-part-1.html its better + * to inform Xserver what version of Xinput we support.The server will store the version we support. + * "As XI2 progresses it becomes important that you use this call as the server may treat the client + * differently depending on the supported version". + * + * FIXME:event and err are not needed but if not passed X11_XQueryExtension returns SegmentationFault + */ if (!SDL_X11_HAVE_XINPUT2 || !X11_XQueryExtension(data->display, "XInputExtension", &xinput2_opcode, &event, &err)) { return; /* X server does not have XInput at all */ @@ -145,7 +142,7 @@ X11_InitXinput2(_THIS) xinput2_initialized = 1; -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH /* Multitouch needs XInput 2.2 */ +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH /* Multitouch needs XInput 2.2 */ xinput2_multitouch_supported = xinput2_version_atleast(version, 2, 2); #endif @@ -158,7 +155,7 @@ X11_InitXinput2(_THIS) XISetMask(mask, XI_RawButtonPress); XISetMask(mask, XI_RawButtonRelease); -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH /* Enable raw touch events if supported */ if (X11_Xinput2IsMultitouchSupported()) { XISetMask(mask, XI_RawTouchBegin); @@ -184,17 +181,17 @@ X11_InitXinput2(_THIS) #endif } +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 /* xi2 device went away? take it out of the list. */ -static void -xinput2_remove_device_info(SDL_VideoData *videodata, const int device_id) +static void xinput2_remove_device_info(SDL_VideoData *videodata, const int device_id) { SDL_XInput2DeviceInfo *prev = NULL; SDL_XInput2DeviceInfo *devinfo; - for (devinfo = videodata->mouse_device_info; devinfo != NULL; devinfo = devinfo->next) { + for (devinfo = videodata->mouse_device_info; devinfo; devinfo = devinfo->next) { if (devinfo->device_id == device_id) { SDL_assert((devinfo == videodata->mouse_device_info) == (prev == NULL)); - if (prev == NULL) { + if (!prev) { videodata->mouse_device_info = devinfo->next; } else { prev->next = devinfo->next; @@ -206,9 +203,7 @@ xinput2_remove_device_info(SDL_VideoData *videodata, const int device_id) } } -#if SDL_VIDEO_DRIVER_X11_XINPUT2 -static SDL_XInput2DeviceInfo * -xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) +static SDL_XInput2DeviceInfo *xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) { /* cache device info as we see new devices. */ SDL_XInput2DeviceInfo *prev = NULL; @@ -217,10 +212,10 @@ xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) int axis = 0; int i; - for (devinfo = videodata->mouse_device_info; devinfo != NULL; devinfo = devinfo->next) { + for (devinfo = videodata->mouse_device_info; devinfo; devinfo = devinfo->next) { if (devinfo->device_id == device_id) { SDL_assert((devinfo == videodata->mouse_device_info) == (prev == NULL)); - if (prev != NULL) { /* move this to the front of the list, assuming we'll get more from this one. */ + if (prev) { /* move this to the front of the list, assuming we'll get more from this one. */ prev->next = devinfo->next; devinfo->next = videodata->mouse_device_info; videodata->mouse_device_info = devinfo; @@ -231,7 +226,7 @@ xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) } /* don't know about this device yet, query and cache it. */ - devinfo = (SDL_XInput2DeviceInfo *) SDL_calloc(1, sizeof (SDL_XInput2DeviceInfo)); + devinfo = (SDL_XInput2DeviceInfo *)SDL_calloc(1, sizeof(SDL_XInput2DeviceInfo)); if (!devinfo) { SDL_OutOfMemory(); return NULL; @@ -249,7 +244,7 @@ xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) !!! FIXME: axis could be relative or absolute, and they might not even be the X and Y axes! !!! FIXME: But we go on, for now. Maybe we need a more robust mouse API in SDL3... */ for (i = 0; i < xidevinfo->num_classes; i++) { - const XIValuatorClassInfo *v = (const XIValuatorClassInfo *) xidevinfo->classes[i]; + const XIValuatorClassInfo *v = (const XIValuatorClassInfo *)xidevinfo->classes[i]; if (v->type == XIValuatorClass) { devinfo->relative[axis] = (v->mode == XIModeRelative) ? SDL_TRUE : SDL_FALSE; devinfo->minval[axis] = v->min; @@ -269,124 +264,120 @@ xinput2_get_device_info(SDL_VideoData *videodata, const int device_id) } #endif -int -X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie) +int X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 if (cookie->extension != xinput2_opcode) { return 0; } - switch(cookie->evtype) { - case XI_RawMotion: { - const XIRawEvent *rawev = (const XIRawEvent*)cookie->data; - SDL_Mouse *mouse = SDL_GetMouse(); - SDL_XInput2DeviceInfo *devinfo; - double coords[2]; - double processed_coords[2]; - int i; - - videodata->global_mouse_changed = SDL_TRUE; - - if (!mouse->relative_mode || mouse->relative_mode_warp) { - return 0; - } - - devinfo = xinput2_get_device_info(videodata, rawev->deviceid); - if (!devinfo) { - return 0; /* oh well. */ - } + switch (cookie->evtype) { + case XI_RawMotion: + { + const XIRawEvent *rawev = (const XIRawEvent *)cookie->data; + SDL_Mouse *mouse = SDL_GetMouse(); + SDL_XInput2DeviceInfo *devinfo; + double coords[2]; + double processed_coords[2]; + int i; + + videodata->global_mouse_changed = SDL_TRUE; + + if (!mouse->relative_mode || mouse->relative_mode_warp) { + return 0; + } - parse_valuators(rawev->raw_values,rawev->valuators.mask, - rawev->valuators.mask_len,coords,2); + devinfo = xinput2_get_device_info(videodata, rawev->deviceid); + if (!devinfo) { + return 0; /* oh well. */ + } - if ((rawev->time == devinfo->prev_time) && (coords[0] == devinfo->prev_coords[0]) && (coords[1] == devinfo->prev_coords[1])) { - return 0; /* duplicate event, drop it. */ - } + parse_valuators(rawev->raw_values, rawev->valuators.mask, + rawev->valuators.mask_len, coords, 2); - for (i = 0; i < 2; i++) { - if (devinfo->relative[i]) { - processed_coords[i] = coords[i]; - } else { - processed_coords[i] = devinfo->prev_coords[i] - coords[i]; /* convert absolute to relative */ - } + for (i = 0; i < 2; i++) { + if (devinfo->relative[i]) { + processed_coords[i] = coords[i]; + } else { + processed_coords[i] = devinfo->prev_coords[i] - coords[i]; /* convert absolute to relative */ } - - SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, (int) processed_coords[0], (int) processed_coords[1]); - devinfo->prev_coords[0] = coords[0]; - devinfo->prev_coords[1] = coords[1]; - devinfo->prev_time = rawev->time; - return 1; } - break; - case XI_HierarchyChanged: { - const XIHierarchyEvent *hierev = (const XIHierarchyEvent *) cookie->data; - int i; - for (i = 0; i < hierev->num_info; i++) { - if (hierev->info[i].flags & XISlaveRemoved) { - xinput2_remove_device_info(videodata, hierev->info[i].deviceid); - } + SDL_SendMouseMotion(mouse->focus, mouse->mouseID, 1, (int)processed_coords[0], (int)processed_coords[1]); + devinfo->prev_coords[0] = coords[0]; + devinfo->prev_coords[1] = coords[1]; + return 1; + } break; + + case XI_HierarchyChanged: + { + const XIHierarchyEvent *hierev = (const XIHierarchyEvent *)cookie->data; + int i; + for (i = 0; i < hierev->num_info; i++) { + if (hierev->info[i].flags & XISlaveRemoved) { + xinput2_remove_device_info(videodata, hierev->info[i].deviceid); } } + } break; + + case XI_RawButtonPress: + case XI_RawButtonRelease: +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH + case XI_RawTouchBegin: + case XI_RawTouchUpdate: + case XI_RawTouchEnd: +#endif + videodata->global_mouse_changed = SDL_TRUE; break; - case XI_RawButtonPress: - case XI_RawButtonRelease: -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - case XI_RawTouchBegin: - case XI_RawTouchUpdate: - case XI_RawTouchEnd: -#endif - videodata->global_mouse_changed = SDL_TRUE; - break; - -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - /* With multitouch, register to receive XI_Motion (which desctivates MotionNotify), - * so that we can distinguish real mouse motions from synthetic one. */ - case XI_Motion: { - const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data; - int pointer_emulated = (xev->flags & XIPointerEmulated); - - if (! pointer_emulated) { - SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse->relative_mode || mouse->relative_mode_warp) { - SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); - if (window) { - SDL_SendMouseMotion(window, 0, 0, xev->event_x, xev->event_y); - } +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH + /* With multitouch, register to receive XI_Motion (which desctivates MotionNotify), + * so that we can distinguish real mouse motions from synthetic one. */ + case XI_Motion: + { + const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data; + int pointer_emulated = (xev->flags & XIPointerEmulated); + + videodata->global_mouse_changed = SDL_TRUE; + + if (!pointer_emulated) { + SDL_Mouse *mouse = SDL_GetMouse(); + if (!mouse->relative_mode || mouse->relative_mode_warp) { + SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); + if (window) { + SDL_SendMouseMotion(window, 0, 0, xev->event_x, xev->event_y); } } - return 1; - } - break; - - case XI_TouchBegin: { - const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data; - float x, y; - SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); - xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); - SDL_SendTouch(xev->sourceid, xev->detail, window, SDL_TRUE, x, y, 1.0); - return 1; - } - break; - case XI_TouchEnd: { - const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data; - float x, y; - SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); - xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); - SDL_SendTouch(xev->sourceid, xev->detail, window, SDL_FALSE, x, y, 1.0); - return 1; - } - break; - case XI_TouchUpdate: { - const XIDeviceEvent *xev = (const XIDeviceEvent *) cookie->data; - float x, y; - SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); - xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); - SDL_SendTouchMotion(xev->sourceid, xev->detail, window, x, y, 1.0); - return 1; } - break; + return 1; + } break; + + case XI_TouchBegin: + { + const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data; + float x, y; + SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); + xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); + SDL_SendTouch(xev->sourceid, xev->detail, window, SDL_TRUE, x, y, 1.0); + return 1; + } break; + case XI_TouchEnd: + { + const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data; + float x, y; + SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); + xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); + SDL_SendTouch(xev->sourceid, xev->detail, window, SDL_FALSE, x, y, 1.0); + return 1; + } break; + case XI_TouchUpdate: + { + const XIDeviceEvent *xev = (const XIDeviceEvent *)cookie->data; + float x, y; + SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); + xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y); + SDL_SendTouchMotion(xev->sourceid, xev->detail, window, x, y, 1.0); + return 1; + } break; #endif } @@ -394,13 +385,12 @@ X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie) return 0; } -void -X11_InitXinput2Multitouch(_THIS) +void X11_InitXinput2Multitouch(_THIS) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH + SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; XIDeviceInfo *info; - int ndevices,i,j; + int ndevices, i, j; if (!X11_Xinput2IsMultitouchSupported()) { return; @@ -414,11 +404,12 @@ X11_InitXinput2Multitouch(_THIS) SDL_TouchID touchId; SDL_TouchDeviceType touchType; XIAnyClassInfo *class = dev->classes[j]; - XITouchClassInfo *t = (XITouchClassInfo*)class; + XITouchClassInfo *t = (XITouchClassInfo *)class; /* Only touch devices */ - if (class->type != XITouchClass) + if (class->type != XITouchClass) { continue; + } if (t->mode == XIDependentTouch) { touchType = SDL_TOUCH_DEVICE_INDIRECT_RELATIVE; @@ -434,10 +425,9 @@ X11_InitXinput2Multitouch(_THIS) #endif } -void -X11_Xinput2SelectTouch(_THIS, SDL_Window *window) +void X11_Xinput2SelectTouch(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH SDL_VideoData *data = NULL; XIEventMask eventmask; unsigned char mask[4] = { 0, 0, 0, 0 }; @@ -447,8 +437,8 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) return; } - data = (SDL_VideoData *) _this->driverdata; - window_data = (SDL_WindowData*)window->driverdata; + data = (SDL_VideoData *)_this->driverdata; + window_data = (SDL_WindowData *)window->driverdata; eventmask.deviceid = XIAllMasterDevices; eventmask.mask_len = sizeof(mask); @@ -459,36 +449,32 @@ X11_Xinput2SelectTouch(_THIS, SDL_Window *window) XISetMask(mask, XI_TouchEnd); XISetMask(mask, XI_Motion); - X11_XISelectEvents(data->display,window_data->xwindow,&eventmask,1); + X11_XISelectEvents(data->display, window_data->xwindow, &eventmask, 1); #endif } - -int -X11_Xinput2IsInitialized() +int X11_Xinput2IsInitialized(void) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2 +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 return xinput2_initialized; #else return 0; #endif } -int -X11_Xinput2IsMultitouchSupported() +int X11_Xinput2IsMultitouchSupported(void) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH return xinput2_initialized && xinput2_multitouch_supported; #else return 0; #endif } -void -X11_Xinput2GrabTouch(_THIS, SDL_Window *window) +void X11_Xinput2GrabTouch(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; unsigned char mask[4] = { 0, 0, 0, 0 }; @@ -515,11 +501,10 @@ X11_Xinput2GrabTouch(_THIS, SDL_Window *window) #endif } -void -X11_Xinput2UngrabTouch(_THIS, SDL_Window *window) +void X11_Xinput2UngrabTouch(_THIS, SDL_Window *window) { -#if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; +#ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH + SDL_WindowData *data = (SDL_WindowData *)window->driverdata; Display *display = data->videodata->display; XIGrabModifiers mods; diff --git a/src/video/x11/SDL_x11xinput2.h b/src/video/x11/SDL_x11xinput2.h index 679beb97bb838..174033bfcacdf 100644 --- a/src/video/x11/SDL_x11xinput2.h +++ b/src/video/x11/SDL_x11xinput2.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,7 +32,7 @@ typedef struct XGenericEventCookie XGenericEventCookie; extern void X11_InitXinput2(_THIS); extern void X11_InitXinput2Multitouch(_THIS); -extern int X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie); +extern int X11_HandleXinput2Event(SDL_VideoData *videodata, XGenericEventCookie *cookie); extern int X11_Xinput2IsInitialized(void); extern int X11_Xinput2IsMultitouchSupported(void); extern void X11_Xinput2SelectTouch(_THIS, SDL_Window *window); diff --git a/src/video/x11/edid.h b/src/video/x11/edid.h index cb9f0e87e743f..37abbec631042 100644 --- a/src/video/x11/edid.h +++ b/src/video/x11/edid.h @@ -41,127 +41,127 @@ struct Timing struct DetailedTiming { - int pixel_clock; - int h_addr; - int h_blank; - int h_sync; - int h_front_porch; - int v_addr; - int v_blank; - int v_sync; - int v_front_porch; - int width_mm; - int height_mm; - int right_border; - int top_border; - int interlaced; - StereoType stereo; - - int digital_sync; + int pixel_clock; + int h_addr; + int h_blank; + int h_sync; + int h_front_porch; + int v_addr; + int v_blank; + int v_sync; + int v_front_porch; + int width_mm; + int height_mm; + int right_border; + int top_border; + int interlaced; + StereoType stereo; + + int digital_sync; union { - struct - { - int bipolar; - int serrations; - int sync_on_green; - } analog; - - struct - { - int composite; - int serrations; - int negative_vsync; - int negative_hsync; - } digital; + struct + { + int bipolar; + int serrations; + int sync_on_green; + } analog; + + struct + { + int composite; + int serrations; + int negative_vsync; + int negative_hsync; + } digital; } ad; }; struct MonitorInfo { - int checksum; - char manufacturer_code[4]; - int product_code; - unsigned int serial_number; - - int production_week; /* -1 if not specified */ - int production_year; /* -1 if not specified */ - int model_year; /* -1 if not specified */ - - int major_version; - int minor_version; - - int is_digital; - + int checksum; + char manufacturer_code[4]; + int product_code; + unsigned int serial_number; + + int production_week; /* -1 if not specified */ + int production_year; /* -1 if not specified */ + int model_year; /* -1 if not specified */ + + int major_version; + int minor_version; + + int is_digital; + union { - struct - { - int bits_per_primary; - Interface interface; - int rgb444; - int ycrcb444; - int ycrcb422; - } digital; - - struct - { - double video_signal_level; - double sync_signal_level; - double total_signal_level; - - int blank_to_black; - - int separate_hv_sync; - int composite_sync_on_h; - int composite_sync_on_green; - int serration_on_vsync; - ColorType color_type; - } analog; + struct + { + int bits_per_primary; + Interface interface; + int rgb444; + int ycrcb444; + int ycrcb422; + } digital; + + struct + { + double video_signal_level; + double sync_signal_level; + double total_signal_level; + + int blank_to_black; + + int separate_hv_sync; + int composite_sync_on_h; + int composite_sync_on_green; + int serration_on_vsync; + ColorType color_type; + } analog; } ad; - int width_mm; /* -1 if not specified */ - int height_mm; /* -1 if not specified */ - double aspect_ratio; /* -1.0 if not specififed */ - - double gamma; /* -1.0 if not specified */ - - int standby; - int suspend; - int active_off; - - int srgb_is_standard; - int preferred_timing_includes_native; - int continuous_frequency; - - double red_x; - double red_y; - double green_x; - double green_y; - double blue_x; - double blue_y; - double white_x; - double white_y; - - Timing established[24]; /* Terminated by 0x0x0 */ - Timing standard[8]; - - int n_detailed_timings; - DetailedTiming detailed_timings[4]; /* If monitor has a preferred - * mode, it is the first one - * (whether it has, is - * determined by the - * preferred_timing_includes - * bit. - */ + int width_mm; /* -1 if not specified */ + int height_mm; /* -1 if not specified */ + double aspect_ratio; /* -1.0 if not specififed */ + + double gamma; /* -1.0 if not specified */ + + int standby; + int suspend; + int active_off; + + int srgb_is_standard; + int preferred_timing_includes_native; + int continuous_frequency; + + double red_x; + double red_y; + double green_x; + double green_y; + double blue_x; + double blue_y; + double white_x; + double white_y; + + Timing established[24]; /* Terminated by 0x0x0 */ + Timing standard[8]; + + int n_detailed_timings; + DetailedTiming detailed_timings[4]; /* If monitor has a preferred + * mode, it is the first one + * (whether it has, is + * determined by the + * preferred_timing_includes + * bit. + */ /* Optional product description */ - char dsc_serial_number[14]; - char dsc_product_name[14]; - char dsc_string[14]; /* Unspecified ASCII data */ + char dsc_serial_number[14]; + char dsc_product_name[14]; + char dsc_string[14]; /* Unspecified ASCII data */ }; -MonitorInfo *decode_edid (const uchar *data); -void dump_monitor_info (MonitorInfo *info); -char * make_display_name (const char *output_name, - const MonitorInfo *info); +MonitorInfo *decode_edid(const uchar *data); +void dump_monitor_info(MonitorInfo *info); +char *make_display_name(const char *output_name, + const MonitorInfo *info); diff --git a/src/video/yuv2rgb/yuv_rgb.h b/src/video/yuv2rgb/yuv_rgb.h index 5668c0fc419dc..c3593168f8483 100644 --- a/src/video/yuv2rgb/yuv_rgb.h +++ b/src/video/yuv2rgb/yuv_rgb.h @@ -1,412 +1,33 @@ +#ifndef YUV_RGB_H_ +#define YUV_RGB_H_ + // Copyright 2016 Adrien Descamps // Distributed under BSD 3-Clause License // Provide optimized functions to convert images from 8bits yuv420 to rgb24 format -// There are a few slightly different variations of the YCbCr color space with different parameters that +// There are a few slightly different variations of the YCbCr color space with different parameters that // change the conversion matrix. // The three most common YCbCr color space, defined by BT.601, BT.709 and JPEG standard are implemented here. // See the respective standards for details // The matrix values used are derived from http://www.equasys.de/colorconversion.html // YUV420 is stored as three separate channels, with U and V (Cb and Cr) subsampled by a 2 factor -// For conversion from yuv to rgb, no interpolation is done, and the same UV value are used for 4 rgb pixels. This +// For conversion from yuv to rgb, no interpolation is done, and the same UV value are used for 4 rgb pixels. This // is suboptimal for image quality, but by far the fastest method. // For all methods, width and height should be even, if not, the last row/column of the result image won't be affected. // For sse methods, if the width if not divisable by 32, the last (width%32) pixels of each line won't be affected. -#include "SDL_stdinc.h" /*#include */ -typedef enum -{ - YCBCR_JPEG, - YCBCR_601, - YCBCR_709 -} YCbCrType; - // yuv to rgb, standard c implementation -void yuv420_rgb565_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgb24_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgba_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_bgra_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_argb_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_abgr_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb565_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb24_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgba_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_bgra_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_argb_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_abgr_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb565_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb24_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgba_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_bgra_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_argb_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_abgr_std( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -// yuv to rgb, sse implementation -// pointers must be 16 byte aligned, and strides must be divisable by 16 -void yuv420_rgb565_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgb24_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgba_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_bgra_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_argb_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_abgr_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb565_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb24_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgba_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_bgra_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_argb_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_abgr_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb565_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb24_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgba_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_bgra_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_argb_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_abgr_sse( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -// yuv to rgb, sse implementation -// pointers do not need to be 16 byte aligned -void yuv420_rgb565_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgb24_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgba_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_bgra_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_argb_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_abgr_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb565_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgb24_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_rgba_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_bgra_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_argb_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv422_abgr_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb565_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgb24_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_rgba_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_bgra_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_argb_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuvnv12_abgr_sseu( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - - -// rgb to yuv, standard c implementation -void rgb24_yuv420_std( - uint32_t width, uint32_t height, - const uint8_t *rgb, uint32_t rgb_stride, - uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - YCbCrType yuv_type); - -// rgb to yuv, sse implementation -// pointers must be 16 byte aligned, and strides must be divisible by 16 -void rgb24_yuv420_sse( - uint32_t width, uint32_t height, - const uint8_t *rgb, uint32_t rgb_stride, - uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - YCbCrType yuv_type); - -// rgb to yuv, sse implementation -// pointers do not need to be 16 byte aligned -void rgb24_yuv420_sseu( - uint32_t width, uint32_t height, - const uint8_t *rgb, uint32_t rgb_stride, - uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - YCbCrType yuv_type); - - -//yuv420 to bgra, lsx implementation -void yuv420_rgb24_lsx( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); - -void yuv420_rgba_lsx( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); +#include "yuv_rgb_std.h" -void yuv420_bgra_lsx( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); +// yuv to rgb, sse2 implementation +#include "yuv_rgb_sse.h" -void yuv420_argb_lsx( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); +// yuv to rgb, lsx implementation +#include "yuv_rgb_lsx.h" -void yuv420_abgr_lsx( - uint32_t width, uint32_t height, - const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, - uint8_t *rgb, uint32_t rgb_stride, - YCbCrType yuv_type); +#endif /* YUV_RGB_H_ */ diff --git a/src/video/yuv2rgb/yuv_rgb_common.h b/src/video/yuv2rgb/yuv_rgb_common.h new file mode 100644 index 0000000000000..ae787ed5f27a6 --- /dev/null +++ b/src/video/yuv2rgb/yuv_rgb_common.h @@ -0,0 +1,13 @@ +#ifndef YUV_RGB_COMMON_H_ +#define YUV_RGB_COMMON_H_ +// Copyright 2016 Adrien Descamps +// Distributed under BSD 3-Clause License + +typedef enum +{ + YCBCR_JPEG, + YCBCR_601, + YCBCR_709 +} YCbCrType; + +#endif /* YUV_RGB_COMMON_H_ */ diff --git a/src/video/yuv2rgb/yuv_rgb_internal.h b/src/video/yuv2rgb/yuv_rgb_internal.h new file mode 100644 index 0000000000000..cad978b5facee --- /dev/null +++ b/src/video/yuv2rgb/yuv_rgb_internal.h @@ -0,0 +1,74 @@ +// Copyright 2016 Adrien Descamps +// Distributed under BSD 3-Clause License + +#define PRECISION 6 +#define PRECISION_FACTOR (1<[0-255]) +// for ITU-R BT.709-6 values are derived from equations in sections 3.2-3.4, assuming RGB is encoded using full range ([0-1]<->[0-255]) +// all values are rounded to the fourth decimal + +static const YUV2RGBParam YUV2RGB[3] = { + // ITU-T T.871 (JPEG) + {/*.y_shift=*/ 0, /*.y_factor=*/ V(1.0), /*.v_r_factor=*/ V(1.402), /*.u_g_factor=*/ -V(0.3441), /*.v_g_factor=*/ -V(0.7141), /*.u_b_factor=*/ V(1.772)}, + // ITU-R BT.601-7 + {/*.y_shift=*/ 16, /*.y_factor=*/ V(1.1644), /*.v_r_factor=*/ V(1.596), /*.u_g_factor=*/ -V(0.3918), /*.v_g_factor=*/ -V(0.813), /*.u_b_factor=*/ V(2.0172)}, + // ITU-R BT.709-6 + {/*.y_shift=*/ 16, /*.y_factor=*/ V(1.1644), /*.v_r_factor=*/ V(1.7927), /*.u_g_factor=*/ -V(0.2132), /*.v_g_factor=*/ -V(0.5329), /*.u_b_factor=*/ V(2.1124)} +}; + +static const RGB2YUVParam RGB2YUV[3] = { + // ITU-T T.871 (JPEG) + {/*.y_shift=*/ 0, /*.matrix=*/ {{V(0.299), V(0.587), V(0.114)}, {-V(0.1687), -V(0.3313), V(0.5)}, {V(0.5), -V(0.4187), -V(0.0813)}}}, + // ITU-R BT.601-7 + {/*.y_shift=*/ 16, /*.matrix=*/ {{V(0.2568), V(0.5041), V(0.0979)}, {-V(0.1482), -V(0.291), V(0.4392)}, {V(0.4392), -V(0.3678), -V(0.0714)}}}, + // ITU-R BT.709-6 + {/*.y_shift=*/ 16, /*.matrix=*/ {{V(0.1826), V(0.6142), V(0.062)}, {-V(0.1006), -V(0.3386), V(0.4392)}, {V(0.4392), -V(0.3989), -V(0.0403)}}} +}; + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +/* The various layouts of YUV data we support */ +#define YUV_FORMAT_420 1 +#define YUV_FORMAT_422 2 +#define YUV_FORMAT_NV12 3 + +/* The various formats of RGB pixel that we support */ +#define RGB_FORMAT_RGB565 1 +#define RGB_FORMAT_RGB24 2 +#define RGB_FORMAT_RGBA 3 +#define RGB_FORMAT_BGRA 4 +#define RGB_FORMAT_ARGB 5 +#define RGB_FORMAT_ABGR 6 diff --git a/src/video/yuv2rgb/yuv_rgb_lsx.c b/src/video/yuv2rgb/yuv_rgb_lsx.c new file mode 100644 index 0000000000000..f24a05276d203 --- /dev/null +++ b/src/video/yuv2rgb/yuv_rgb_lsx.c @@ -0,0 +1,44 @@ +// Copyright 2016 Adrien Descamps +// Distributed under BSD 3-Clause License +#include "../../SDL_internal.h" + +#if SDL_HAVE_YUV +#include "yuv_rgb.h" +#include "yuv_rgb_internal.h" +#include "SDL_cpuinfo.h" + +#ifdef __loongarch_sx + +#define LSX_FUNCTION_NAME yuv420_rgb24_lsx +#define STD_FUNCTION_NAME yuv420_rgb24_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_RGB24 +#include "yuv_rgb_lsx_func.h" + +#define LSX_FUNCTION_NAME yuv420_rgba_lsx +#define STD_FUNCTION_NAME yuv420_rgba_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_RGBA +#include "yuv_rgb_lsx_func.h" + +#define LSX_FUNCTION_NAME yuv420_bgra_lsx +#define STD_FUNCTION_NAME yuv420_bgra_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_BGRA +#include "yuv_rgb_lsx_func.h" + +#define LSX_FUNCTION_NAME yuv420_argb_lsx +#define STD_FUNCTION_NAME yuv420_argb_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_ARGB +#include "yuv_rgb_lsx_func.h" + +#define LSX_FUNCTION_NAME yuv420_abgr_lsx +#define STD_FUNCTION_NAME yuv420_abgr_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_ABGR +#include "yuv_rgb_lsx_func.h" + +#endif //__loongarch_sx + +#endif /* SDL_HAVE_YUV */ diff --git a/src/video/yuv2rgb/yuv_rgb_lsx.h b/src/video/yuv2rgb/yuv_rgb_lsx.h new file mode 100644 index 0000000000000..bcffd95c6ea94 --- /dev/null +++ b/src/video/yuv2rgb/yuv_rgb_lsx.h @@ -0,0 +1,407 @@ +// Copyright 2016 Adrien Descamps +// Distributed under BSD 3-Clause License + +// Provide optimized functions to convert images from 8bits yuv420 to rgb24 format + +// There are a few slightly different variations of the YCbCr color space with different parameters that +// change the conversion matrix. +// The three most common YCbCr color space, defined by BT.601, BT.709 and JPEG standard are implemented here. +// See the respective standards for details +// The matrix values used are derived from http://www.equasys.de/colorconversion.html + +// YUV420 is stored as three separate channels, with U and V (Cb and Cr) subsampled by a 2 factor +// For conversion from yuv to rgb, no interpolation is done, and the same UV value are used for 4 rgb pixels. This +// is suboptimal for image quality, but by far the fastest method. + +// For all methods, width and height should be even, if not, the last row/column of the result image won't be affected. +// For sse methods, if the width if not divisable by 32, the last (width%32) pixels of each line won't be affected. + +/*#include */ +#include "yuv_rgb_common.h" + +#include "SDL_stdinc.h" + +// yuv to rgb, standard c implementation +void yuv420_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +// yuv to rgb, sse implementation +// pointers must be 16 byte aligned, and strides must be divisable by 16 +void yuv420_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +// yuv to rgb, sse implementation +// pointers do not need to be 16 byte aligned +void yuv420_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + + +// rgb to yuv, standard c implementation +void rgb24_yuv420_std( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); + +// rgb to yuv, sse implementation +// pointers must be 16 byte aligned, and strides must be divisible by 16 +void rgb24_yuv420_sse( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); + +// rgb to yuv, sse implementation +// pointers do not need to be 16 byte aligned +void rgb24_yuv420_sseu( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); + + +//yuv420 to bgra, lsx implementation +void yuv420_rgb24_lsx( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_lsx( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_lsx( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_lsx( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_lsx( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *v, const uint8_t *u, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); diff --git a/src/video/yuv2rgb/yuv_rgb.c b/src/video/yuv2rgb/yuv_rgb_sse.c similarity index 52% rename from src/video/yuv2rgb/yuv_rgb.c rename to src/video/yuv2rgb/yuv_rgb_sse.c index c7415aa721351..b22a89fa4e5d9 100644 --- a/src/video/yuv2rgb/yuv_rgb.c +++ b/src/video/yuv2rgb/yuv_rgb_sse.c @@ -3,253 +3,141 @@ #include "../../SDL_internal.h" #if SDL_HAVE_YUV - #include "yuv_rgb.h" +#include "yuv_rgb_internal.h" #include "SDL_cpuinfo.h" /*#include */ -#define PRECISION 6 -#define PRECISION_FACTOR (1<[0-255]) -// for ITU-R BT.709-6 values are derived from equations in sections 3.2-3.4, assuming RGB is encoded using full range ([0-1]<->[0-255]) -// all values are rounded to the fourth decimal - -static const YUV2RGBParam YUV2RGB[3] = { - // ITU-T T.871 (JPEG) - {/*.y_shift=*/ 0, /*.y_factor=*/ V(1.0), /*.v_r_factor=*/ V(1.402), /*.u_g_factor=*/ -V(0.3441), /*.v_g_factor=*/ -V(0.7141), /*.u_b_factor=*/ V(1.772)}, - // ITU-R BT.601-7 - {/*.y_shift=*/ 16, /*.y_factor=*/ V(1.1644), /*.v_r_factor=*/ V(1.596), /*.u_g_factor=*/ -V(0.3918), /*.v_g_factor=*/ -V(0.813), /*.u_b_factor=*/ V(2.0172)}, - // ITU-R BT.709-6 - {/*.y_shift=*/ 16, /*.y_factor=*/ V(1.1644), /*.v_r_factor=*/ V(1.7927), /*.u_g_factor=*/ -V(0.2132), /*.v_g_factor=*/ -V(0.5329), /*.u_b_factor=*/ V(2.1124)} -}; - -static const RGB2YUVParam RGB2YUV[3] = { - // ITU-T T.871 (JPEG) - {/*.y_shift=*/ 0, /*.matrix=*/ {{V(0.299), V(0.587), V(0.114)}, {-V(0.1687), -V(0.3313), V(0.5)}, {V(0.5), -V(0.4187), -V(0.0813)}}}, - // ITU-R BT.601-7 - {/*.y_shift=*/ 16, /*.matrix=*/ {{V(0.2568), V(0.5041), V(0.0979)}, {-V(0.1482), -V(0.291), V(0.4392)}, {V(0.4392), -V(0.3678), -V(0.0714)}}}, - // ITU-R BT.709-6 - {/*.y_shift=*/ 16, /*.matrix=*/ {{V(0.1826), V(0.6142), V(0.062)}, {-V(0.1006), -V(0.3386), V(0.4392)}, {V(0.4392), -V(0.3989), -V(0.0403)}}} -}; - -/* The various layouts of YUV data we support */ -#define YUV_FORMAT_420 1 -#define YUV_FORMAT_422 2 -#define YUV_FORMAT_NV12 3 - -/* The various formats of RGB pixel that we support */ -#define RGB_FORMAT_RGB565 1 -#define RGB_FORMAT_RGB24 2 -#define RGB_FORMAT_RGBA 3 -#define RGB_FORMAT_BGRA 4 -#define RGB_FORMAT_ARGB 5 -#define RGB_FORMAT_ABGR 6 - -// divide by PRECISION_FACTOR and clamp to [0:255] interval -// input must be in the [-128*PRECISION_FACTOR:384*PRECISION_FACTOR] range -static uint8_t clampU8(int32_t v) -{ - static const uint8_t lut[512] = - {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, - 47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90, - 91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125, - 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158, - 159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, - 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, - 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 - }; - return lut[((v+128*PRECISION_FACTOR)>>PRECISION)&511]; -} - +#ifdef __SSE2__ +/* SDL doesn't use these atm and compiling them adds seconds onto the build. --ryan. +#define SSE_FUNCTION_NAME yuv420_rgb565_sse #define STD_FUNCTION_NAME yuv420_rgb565_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_RGB565 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv420_rgb24_sse #define STD_FUNCTION_NAME yuv420_rgb24_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_RGB24 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv420_rgba_sse #define STD_FUNCTION_NAME yuv420_rgba_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_RGBA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv420_bgra_sse #define STD_FUNCTION_NAME yuv420_bgra_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_BGRA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv420_argb_sse #define STD_FUNCTION_NAME yuv420_argb_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_ARGB -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv420_abgr_sse #define STD_FUNCTION_NAME yuv420_abgr_std #define YUV_FORMAT YUV_FORMAT_420 #define RGB_FORMAT RGB_FORMAT_ABGR -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_rgb565_sse #define STD_FUNCTION_NAME yuv422_rgb565_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_RGB565 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_rgb24_sse #define STD_FUNCTION_NAME yuv422_rgb24_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_RGB24 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_rgba_sse #define STD_FUNCTION_NAME yuv422_rgba_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_RGBA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_bgra_sse #define STD_FUNCTION_NAME yuv422_bgra_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_BGRA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_argb_sse #define STD_FUNCTION_NAME yuv422_argb_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_ARGB -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuv422_abgr_sse #define STD_FUNCTION_NAME yuv422_abgr_std #define YUV_FORMAT YUV_FORMAT_422 #define RGB_FORMAT RGB_FORMAT_ABGR -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_rgb565_sse #define STD_FUNCTION_NAME yuvnv12_rgb565_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_RGB565 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_rgb24_sse #define STD_FUNCTION_NAME yuvnv12_rgb24_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_RGB24 -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_rgba_sse #define STD_FUNCTION_NAME yuvnv12_rgba_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_RGBA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_bgra_sse #define STD_FUNCTION_NAME yuvnv12_bgra_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_BGRA -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_argb_sse #define STD_FUNCTION_NAME yuvnv12_argb_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_ARGB -#include "yuv_rgb_std_func.h" +#define SSE_ALIGNED +#include "yuv_rgb_sse_func.h" +#define SSE_FUNCTION_NAME yuvnv12_abgr_sse #define STD_FUNCTION_NAME yuvnv12_abgr_std #define YUV_FORMAT YUV_FORMAT_NV12 #define RGB_FORMAT RGB_FORMAT_ABGR -#include "yuv_rgb_std_func.h" - -void rgb24_yuv420_std( - uint32_t width, uint32_t height, - const uint8_t *RGB, uint32_t RGB_stride, - uint8_t *Y, uint8_t *U, uint8_t *V, uint32_t Y_stride, uint32_t UV_stride, - YCbCrType yuv_type) -{ - const RGB2YUVParam *const param = &(RGB2YUV[yuv_type]); - - uint32_t x, y; - for(y=0; y<(height-1); y+=2) - { - const uint8_t *rgb_ptr1=RGB+y*RGB_stride, - *rgb_ptr2=RGB+(y+1)*RGB_stride; - - uint8_t *y_ptr1=Y+y*Y_stride, - *y_ptr2=Y+(y+1)*Y_stride, - *u_ptr=U+(y/2)*UV_stride, - *v_ptr=V+(y/2)*UV_stride; - - for(x=0; x<(width-1); x+=2) - { - // compute yuv for the four pixels, u and v values are summed - int32_t y_tmp, u_tmp, v_tmp; - - y_tmp = param->matrix[0][0]*rgb_ptr1[0] + param->matrix[0][1]*rgb_ptr1[1] + param->matrix[0][2]*rgb_ptr1[2]; - u_tmp = param->matrix[1][0]*rgb_ptr1[0] + param->matrix[1][1]*rgb_ptr1[1] + param->matrix[1][2]*rgb_ptr1[2]; - v_tmp = param->matrix[2][0]*rgb_ptr1[0] + param->matrix[2][1]*rgb_ptr1[1] + param->matrix[2][2]*rgb_ptr1[2]; - y_ptr1[0]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr1[3] + param->matrix[0][1]*rgb_ptr1[4] + param->matrix[0][2]*rgb_ptr1[5]; - u_tmp += param->matrix[1][0]*rgb_ptr1[3] + param->matrix[1][1]*rgb_ptr1[4] + param->matrix[1][2]*rgb_ptr1[5]; - v_tmp += param->matrix[2][0]*rgb_ptr1[3] + param->matrix[2][1]*rgb_ptr1[4] + param->matrix[2][2]*rgb_ptr1[5]; - y_ptr1[1]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr2[0] + param->matrix[0][1]*rgb_ptr2[1] + param->matrix[0][2]*rgb_ptr2[2]; - u_tmp += param->matrix[1][0]*rgb_ptr2[0] + param->matrix[1][1]*rgb_ptr2[1] + param->matrix[1][2]*rgb_ptr2[2]; - v_tmp += param->matrix[2][0]*rgb_ptr2[0] + param->matrix[2][1]*rgb_ptr2[1] + param->matrix[2][2]*rgb_ptr2[2]; - y_ptr2[0]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr2[3] + param->matrix[0][1]*rgb_ptr2[4] + param->matrix[0][2]*rgb_ptr2[5]; - u_tmp += param->matrix[1][0]*rgb_ptr2[3] + param->matrix[1][1]*rgb_ptr2[4] + param->matrix[1][2]*rgb_ptr2[5]; - v_tmp += param->matrix[2][0]*rgb_ptr2[3] + param->matrix[2][1]*rgb_ptr2[4] + param->matrix[2][2]*rgb_ptr2[5]; - y_ptr2[1]=clampU8(y_tmp+((param->y_shift)<matrix[0][0])), \ - _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[0][1]))); \ + _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[0][1]))); \ Y = _mm_add_epi16(Y, _mm_mullo_epi16(B, _mm_set1_epi16(param->matrix[0][2]))); \ Y = _mm_add_epi16(Y, _mm_set1_epi16((param->y_shift)<matrix[1][0])), \ - _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[1][1]))); \ + _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[1][1]))); \ U = _mm_add_epi16(U, _mm_mullo_epi16(B, _mm_set1_epi16(param->matrix[1][2]))); \ U = _mm_add_epi16(U, _mm_set1_epi16(128<matrix[2][0])), \ - _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[2][1]))); \ + _mm_mullo_epi16(G, _mm_set1_epi16(param->matrix[2][1]))); \ V = _mm_add_epi16(V, _mm_mullo_epi16(B, _mm_set1_epi16(param->matrix[2][2]))); \ V = _mm_add_epi16(V, _mm_set1_epi16(128<*/ +#include "yuv_rgb_common.h" + +#include "SDL_stdinc.h" + +// yuv to rgb, sse implementation +// pointers must be 16 byte aligned, and strides must be divisable by 16 +void yuv420_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_sse( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +// yuv to rgb, sse implementation +// pointers do not need to be 16 byte aligned +void yuv420_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_sseu( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + + +// rgb to yuv, standard c implementation +void rgb24_yuv420_std( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); + +// rgb to yuv, sse implementation +// pointers must be 16 byte aligned, and strides must be divisible by 16 +void rgb24_yuv420_sse( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); + +// rgb to yuv, sse implementation +// pointers do not need to be 16 byte aligned +void rgb24_yuv420_sseu( + uint32_t width, uint32_t height, + const uint8_t *rgb, uint32_t rgb_stride, + uint8_t *y, uint8_t *u, uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + YCbCrType yuv_type); diff --git a/src/video/yuv2rgb/yuv_rgb_sse_func.h b/src/video/yuv2rgb/yuv_rgb_sse_func.h index f541017a402b6..295749a872e70 100644 --- a/src/video/yuv2rgb/yuv_rgb_sse_func.h +++ b/src/video/yuv2rgb/yuv_rgb_sse_func.h @@ -52,7 +52,7 @@ { \ __m128i red_mask, tmp1, tmp2, tmp3, tmp4; \ \ - red_mask = _mm_set1_epi16((short)0xF800); \ + red_mask = _mm_set1_epi16((unsigned short)0xF800); \ RGB1 = _mm_and_si128(_mm_unpacklo_epi8(_mm_setzero_si128(), R1), red_mask); \ RGB2 = _mm_and_si128(_mm_unpackhi_epi8(_mm_setzero_si128(), R1), red_mask); \ RGB3 = _mm_and_si128(_mm_unpacklo_epi8(_mm_setzero_si128(), R2), red_mask); \ @@ -145,7 +145,7 @@ PACK_RGB24_32_STEP1(R1, R2, G1, G2, B1, B2, RGB1, RGB2, RGB3, RGB4, RGB5, RGB6) #define PACK_PIXEL \ __m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \ __m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \ - __m128i a = _mm_set1_epi8((char)0xFF); \ + __m128i a = _mm_set1_epi8((unsigned char)0xFF); \ \ PACK_RGBA_32(r_8_11, r_8_12, g_8_11, g_8_12, b_8_11, b_8_12, a, a, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \ \ @@ -156,7 +156,7 @@ PACK_RGB24_32_STEP1(R1, R2, G1, G2, B1, B2, RGB1, RGB2, RGB3, RGB4, RGB5, RGB6) #define PACK_PIXEL \ __m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \ __m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \ - __m128i a = _mm_set1_epi8((char)0xFF); \ + __m128i a = _mm_set1_epi8((unsigned char)0xFF); \ \ PACK_RGBA_32(b_8_11, b_8_12, g_8_11, g_8_12, r_8_11, r_8_12, a, a, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \ \ @@ -167,7 +167,7 @@ PACK_RGB24_32_STEP1(R1, R2, G1, G2, B1, B2, RGB1, RGB2, RGB3, RGB4, RGB5, RGB6) #define PACK_PIXEL \ __m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \ __m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \ - __m128i a = _mm_set1_epi8((char)0xFF); \ + __m128i a = _mm_set1_epi8((unsigned char)0xFF); \ \ PACK_RGBA_32(a, a, r_8_11, r_8_12, g_8_11, g_8_12, b_8_11, b_8_12, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \ \ @@ -178,7 +178,7 @@ PACK_RGB24_32_STEP1(R1, R2, G1, G2, B1, B2, RGB1, RGB2, RGB3, RGB4, RGB5, RGB6) #define PACK_PIXEL \ __m128i rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8; \ __m128i rgb_9, rgb_10, rgb_11, rgb_12, rgb_13, rgb_14, rgb_15, rgb_16; \ - __m128i a = _mm_set1_epi8((char)0xFF); \ + __m128i a = _mm_set1_epi8((unsigned char)0xFF); \ \ PACK_RGBA_32(a, a, b_8_11, b_8_12, g_8_11, g_8_12, r_8_11, r_8_12, rgb_1, rgb_2, rgb_3, rgb_4, rgb_5, rgb_6, rgb_7, rgb_8) \ \ @@ -491,7 +491,7 @@ void SSE_FUNCTION_NAME(uint32_t width, uint32_t height, /* Catch the right column, if needed */ { - int converted = (width & ~31); + uint32_t converted = (width & ~31); if (fix_read_nv12) { converted -= 32; } diff --git a/src/video/yuv2rgb/yuv_rgb_std.c b/src/video/yuv2rgb/yuv_rgb_std.c new file mode 100644 index 0000000000000..a222a3abb6d0e --- /dev/null +++ b/src/video/yuv2rgb/yuv_rgb_std.c @@ -0,0 +1,179 @@ +// Copyright 2016 Adrien Descamps +// Distributed under BSD 3-Clause License +#include "../../SDL_internal.h" + +#if SDL_HAVE_YUV +#include "yuv_rgb.h" +#include "yuv_rgb_internal.h" + +// divide by PRECISION_FACTOR and clamp to [0:255] interval +// input must be in the [-128*PRECISION_FACTOR:384*PRECISION_FACTOR] range +static uint8_t clampU8(int32_t v) +{ + static const uint8_t lut[512] = + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46, + 47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90, + 91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125, + 126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158, + 159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224, + 225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, + 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 + }; + return lut[((v+128*PRECISION_FACTOR)>>PRECISION)&511]; +} + + +#define STD_FUNCTION_NAME yuv420_rgb565_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_RGB565 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv420_rgb24_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_RGB24 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv420_rgba_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_RGBA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv420_bgra_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_BGRA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv420_argb_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_ARGB +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv420_abgr_std +#define YUV_FORMAT YUV_FORMAT_420 +#define RGB_FORMAT RGB_FORMAT_ABGR +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_rgb565_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_RGB565 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_rgb24_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_RGB24 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_rgba_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_RGBA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_bgra_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_BGRA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_argb_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_ARGB +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuv422_abgr_std +#define YUV_FORMAT YUV_FORMAT_422 +#define RGB_FORMAT RGB_FORMAT_ABGR +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_rgb565_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_RGB565 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_rgb24_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_RGB24 +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_rgba_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_RGBA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_bgra_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_BGRA +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_argb_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_ARGB +#include "yuv_rgb_std_func.h" + +#define STD_FUNCTION_NAME yuvnv12_abgr_std +#define YUV_FORMAT YUV_FORMAT_NV12 +#define RGB_FORMAT RGB_FORMAT_ABGR +#include "yuv_rgb_std_func.h" + +void rgb24_yuv420_std( + uint32_t width, uint32_t height, + const uint8_t *RGB, uint32_t RGB_stride, + uint8_t *Y, uint8_t *U, uint8_t *V, uint32_t Y_stride, uint32_t UV_stride, + YCbCrType yuv_type) +{ + const RGB2YUVParam *const param = &(RGB2YUV[yuv_type]); + + uint32_t x, y; + for(y=0; y<(height-1); y+=2) + { + const uint8_t *rgb_ptr1=RGB+y*RGB_stride, + *rgb_ptr2=RGB+(y+1)*RGB_stride; + + uint8_t *y_ptr1=Y+y*Y_stride, + *y_ptr2=Y+(y+1)*Y_stride, + *u_ptr=U+(y/2)*UV_stride, + *v_ptr=V+(y/2)*UV_stride; + + for(x=0; x<(width-1); x+=2) + { + // compute yuv for the four pixels, u and v values are summed + int32_t y_tmp, u_tmp, v_tmp; + + y_tmp = param->matrix[0][0]*rgb_ptr1[0] + param->matrix[0][1]*rgb_ptr1[1] + param->matrix[0][2]*rgb_ptr1[2]; + u_tmp = param->matrix[1][0]*rgb_ptr1[0] + param->matrix[1][1]*rgb_ptr1[1] + param->matrix[1][2]*rgb_ptr1[2]; + v_tmp = param->matrix[2][0]*rgb_ptr1[0] + param->matrix[2][1]*rgb_ptr1[1] + param->matrix[2][2]*rgb_ptr1[2]; + y_ptr1[0]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr1[3] + param->matrix[0][1]*rgb_ptr1[4] + param->matrix[0][2]*rgb_ptr1[5]; + u_tmp += param->matrix[1][0]*rgb_ptr1[3] + param->matrix[1][1]*rgb_ptr1[4] + param->matrix[1][2]*rgb_ptr1[5]; + v_tmp += param->matrix[2][0]*rgb_ptr1[3] + param->matrix[2][1]*rgb_ptr1[4] + param->matrix[2][2]*rgb_ptr1[5]; + y_ptr1[1]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr2[0] + param->matrix[0][1]*rgb_ptr2[1] + param->matrix[0][2]*rgb_ptr2[2]; + u_tmp += param->matrix[1][0]*rgb_ptr2[0] + param->matrix[1][1]*rgb_ptr2[1] + param->matrix[1][2]*rgb_ptr2[2]; + v_tmp += param->matrix[2][0]*rgb_ptr2[0] + param->matrix[2][1]*rgb_ptr2[1] + param->matrix[2][2]*rgb_ptr2[2]; + y_ptr2[0]=clampU8(y_tmp+((param->y_shift)<matrix[0][0]*rgb_ptr2[3] + param->matrix[0][1]*rgb_ptr2[4] + param->matrix[0][2]*rgb_ptr2[5]; + u_tmp += param->matrix[1][0]*rgb_ptr2[3] + param->matrix[1][1]*rgb_ptr2[4] + param->matrix[1][2]*rgb_ptr2[5]; + v_tmp += param->matrix[2][0]*rgb_ptr2[3] + param->matrix[2][1]*rgb_ptr2[4] + param->matrix[2][2]*rgb_ptr2[5]; + y_ptr2[1]=clampU8(y_tmp+((param->y_shift)<*/ +#include "yuv_rgb_common.h" + +#include "SDL_stdinc.h" + +// yuv to rgb, standard c implementation +void yuv420_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv420_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuv422_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb565_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgb24_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_rgba_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_bgra_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_argb_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); + +void yuvnv12_abgr_std( + uint32_t width, uint32_t height, + const uint8_t *y, const uint8_t *u, const uint8_t *v, uint32_t y_stride, uint32_t uv_stride, + uint8_t *rgb, uint32_t rgb_stride, + YCbCrType yuv_type); diff --git a/src/video/yuv2rgb/yuv_rgb_std_func.h b/src/video/yuv2rgb/yuv_rgb_std_func.h index 94872ec9f56cb..f359abae8b444 100644 --- a/src/video/yuv2rgb/yuv_rgb_std_func.h +++ b/src/video/yuv2rgb/yuv_rgb_std_func.h @@ -69,10 +69,15 @@ #endif +#ifdef _MSC_VER /* Visual Studio analyzer can't tell that we're building this with different constants */ +#pragma warning(push) +#pragma warning(disable : 6239) +#endif + void STD_FUNCTION_NAME( - uint32_t width, uint32_t height, - const uint8_t *Y, const uint8_t *U, const uint8_t *V, uint32_t Y_stride, uint32_t UV_stride, - uint8_t *RGB, uint32_t RGB_stride, + uint32_t width, uint32_t height, + const uint8_t *Y, const uint8_t *U, const uint8_t *V, uint32_t Y_stride, uint32_t UV_stride, + uint8_t *RGB, uint32_t RGB_stride, YCbCrType yuv_type) { const YUV2RGBParam *const param = &(YUV2RGB[yuv_type]); @@ -113,26 +118,26 @@ void STD_FUNCTION_NAME( for(x=0; x<(width-(uv_x_sample_interval-1)); x+=uv_x_sample_interval) { // Compute U and V contributions, common to the four pixels - + int32_t u_tmp = ((*u_ptr)-128); int32_t v_tmp = ((*v_ptr)-128); - + int32_t r_tmp = (v_tmp*param->v_r_factor); int32_t g_tmp = (u_tmp*param->u_g_factor + v_tmp*param->v_g_factor); int32_t b_tmp = (u_tmp*param->u_b_factor); - + // Compute the Y contribution for each pixel - + int32_t y_tmp = ((y_ptr1[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); - + y_tmp = ((y_ptr1[y_pixel_stride]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); - + #if uv_y_sample_interval > 1 y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr2); - + y_tmp = ((y_ptr2[y_pixel_stride]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr2); #endif @@ -149,19 +154,19 @@ void STD_FUNCTION_NAME( if (uv_x_sample_interval == 2 && x == (width-1)) { // Compute U and V contributions, common to the four pixels - + int32_t u_tmp = ((*u_ptr)-128); int32_t v_tmp = ((*v_ptr)-128); - + int32_t r_tmp = (v_tmp*param->v_r_factor); int32_t g_tmp = (u_tmp*param->u_g_factor + v_tmp*param->v_g_factor); int32_t b_tmp = (u_tmp*param->u_b_factor); - + // Compute the Y contribution for each pixel - + int32_t y_tmp = ((y_ptr1[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); - + #if uv_y_sample_interval > 1 y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr2); @@ -175,28 +180,28 @@ void STD_FUNCTION_NAME( const uint8_t *y_ptr1=Y+y*Y_stride, *u_ptr=U+(y/uv_y_sample_interval)*UV_stride, *v_ptr=V+(y/uv_y_sample_interval)*UV_stride; - + uint8_t *rgb_ptr1=RGB+y*RGB_stride; - + for(x=0; x<(width-(uv_x_sample_interval-1)); x+=uv_x_sample_interval) { // Compute U and V contributions, common to the four pixels - + int32_t u_tmp = ((*u_ptr)-128); int32_t v_tmp = ((*v_ptr)-128); - + int32_t r_tmp = (v_tmp*param->v_r_factor); int32_t g_tmp = (u_tmp*param->u_g_factor + v_tmp*param->v_g_factor); int32_t b_tmp = (u_tmp*param->u_b_factor); - + // Compute the Y contribution for each pixel - + int32_t y_tmp = ((y_ptr1[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); - + y_tmp = ((y_ptr1[y_pixel_stride]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); - + y_ptr1+=2*y_pixel_stride; u_ptr+=2*uv_pixel_stride/uv_x_sample_interval; v_ptr+=2*uv_pixel_stride/uv_x_sample_interval; @@ -206,16 +211,16 @@ void STD_FUNCTION_NAME( if (uv_x_sample_interval == 2 && x == (width-1)) { // Compute U and V contributions, common to the four pixels - + int32_t u_tmp = ((*u_ptr)-128); int32_t v_tmp = ((*v_ptr)-128); - + int32_t r_tmp = (v_tmp*param->v_r_factor); int32_t g_tmp = (u_tmp*param->u_g_factor + v_tmp*param->v_g_factor); int32_t b_tmp = (u_tmp*param->u_b_factor); - + // Compute the Y contribution for each pixel - + int32_t y_tmp = ((y_ptr1[0]-param->y_shift)*param->y_factor); PACK_PIXEL(rgb_ptr1); } @@ -227,6 +232,10 @@ void STD_FUNCTION_NAME( #undef uv_y_sample_interval } +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #undef STD_FUNCTION_NAME #undef YUV_FORMAT #undef RGB_FORMAT diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 676a8e791962e..7cabbc3603892 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.0) -project(SDL2_test) +cmake_minimum_required(VERSION 3.0...3.10) +project(SDL2_test C) include(CheckCCompilerFlag) include(CMakeParseArguments) @@ -7,18 +7,83 @@ include(CMakePushCheckState) set(SDL_TEST_EXECUTABLES) set(SDL_TESTS_NONINTERACTIVE) -set(SDL_TESTS_NEEDS_ESOURCES) +set(SDL_TESTS_NEEDS_RESOURCES) + +option(SDLTEST_TRACKMEM "Run tests with --trackmem" OFF) + +if(WIN32 AND NOT WINDOWS_STORE) + option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF) + add_executable(sdlprocdump win32/sdlprocdump.c) + if(SDLTEST_PROCDUMP) + set(CMAKE_TEST_LAUNCHER "$;--") + else() + set_property(TARGET sdlprocdump PROPERTY EXCLUDE_FROM_ALL "1") + endif() +endif() + +set(SDLTEST_TARGETS ) + +macro(sdltest_link_librararies) + foreach(TARGET ${SDLTEST_TARGETS}) + target_link_libraries(${TARGET} PRIVATE ${ARGN}) + endforeach() +endmacro() + +macro(sdltest_add_definitions) + foreach(TARGET ${SDLTEST_TARGETS}) + target_compile_definitions(${TARGET} PRIVATE ${ARGN}) + endforeach() +endmacro() macro(add_sdl_test_executable TARGET) - cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES" "" "" ${ARGN}) - add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS}) + cmake_parse_arguments(AST "NONINTERACTIVE;NEEDS_RESOURCES;NOTRACKMEM" "" "" ${ARGN}) + list(APPEND SDLTEST_TARGETS ${TARGET}) + if(ANDROID) + add_library(${TARGET} SHARED ${AST_UNPARSED_ARGUMENTS}) + else() + add_executable(${TARGET} ${AST_UNPARSED_ARGUMENTS}) + endif() list(APPEND SDL_TEST_EXECUTABLES ${TARGET}) + set_property(TARGET ${TARGET} PROPERTY SDL_NOTRACKMEM ${AST_NOTRACKMEM}) if(AST_NONINTERACTIVE) list(APPEND SDL_TESTS_NONINTERACTIVE ${TARGET}) endif() if(AST_NEEDS_RESOURCES) - list(APPEND SDL_TESTS_NEEDS_ESOURCES ${TARGET}) + list(APPEND SDL_TESTS_NEEDS_RESOURCES ${TARGET}) + endif() + + if(HAVE_GCC_WDOCUMENTATION) + target_compile_options(${TARGET} PRIVATE "-Wdocumentation") + if(HAVE_GCC_WERROR_DOCUMENTATION) + target_compile_options(${TARGET} PRIVATE "-Werror=documentation") + endif() + endif() + + if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND) + if(SDL_WERROR) + if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND) + target_compile_options(${TARGET} PRIVATE "-Werror=documentation-unknown-command") + endif() + endif() + target_compile_options(${TARGET} PRIVATE "-Wdocumentation-unknown-command") + endif() + + if(HAVE_GCC_COMMENT_BLOCK_COMMANDS) + target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=threadsafety") + target_compile_options(${TARGET} PRIVATE "-fcomment-block-commands=deprecated") + else() + if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS) + target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=threadsafety") + target_compile_options(${TARGET} PRIVATE "/clang:-fcomment-block-commands=deprecated") + endif() + endif() + + if(USE_GCC OR USE_CLANG) + check_c_compiler_flag(-fno-fast-math HAVE_GCC_FNO_FAST_MATH) + if(HAVE_GCC_FNO_FAST_MATH) + target_compile_options(${TARGET} PRIVATE -fno-fast-math) + endif() endif() endmacro() @@ -32,57 +97,6 @@ if(SDL_INSTALL_TESTS) include(GNUInstallDirs) endif() -if(N3DS) - link_libraries(SDL2::SDL2main) -endif() - -if(PSP) - link_libraries( - SDL2::SDL2main - SDL2::SDL2test - SDL2::SDL2-static - GL - pspvram - pspvfpu - pspdisplay - pspgu - pspge - pspaudio - pspctrl - psphprm - psppower - ) -elseif(PS2) -link_libraries( - SDL2main - SDL2_test - SDL2-static - patches - gskit - dmakit - ps2_drivers -) -else() - link_libraries(SDL2::SDL2test SDL2::SDL2-static) -endif() - -if(WINDOWS) - # mingw32 must come before SDL2main to link successfully - if(MINGW OR CYGWIN) - link_libraries(mingw32) - endif() - - # CET support was added in VS 16.7 - if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64") - link_libraries(-CETCOMPAT) - endif() - - # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin, - # but we need them for VS as well. - link_libraries(SDL2main) - add_definitions(-Dmain=SDL_main) -endif() - # CMake incorrectly detects opengl32.lib being present on MSVC ARM64 if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") # Prefer GLVND, if present @@ -91,7 +105,7 @@ if(NOT MSVC OR NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") endif() if (OPENGL_FOUND) -add_definitions(-DHAVE_OPENGL) + add_definitions(-DHAVE_OPENGL) endif() add_sdl_test_executable(checkkeys checkkeys.c) @@ -103,7 +117,7 @@ add_sdl_test_executable(testresample NEEDS_RESOURCES testresample.c) add_sdl_test_executable(testaudioinfo testaudioinfo.c) file(GLOB TESTAUTOMATION_SOURCE_FILES testautomation*.c) -add_sdl_test_executable(testautomation NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES}) +add_sdl_test_executable(testautomation NONINTERACTIVE NEEDS_RESOURCES ${TESTAUTOMATION_SOURCE_FILES}) add_sdl_test_executable(testmultiaudio NEEDS_RESOURCES testmultiaudio.c testutils.c) add_sdl_test_executable(testaudiohotplug NEEDS_RESOURCES testaudiohotplug.c testutils.c) add_sdl_test_executable(testaudiocapture testaudiocapture.c) @@ -117,7 +131,7 @@ add_sdl_test_executable(testdropfile testdropfile.c) add_sdl_test_executable(testerror NONINTERACTIVE testerror.c) if(LINUX) - add_sdl_test_executable(testevdev NONINTERACTIVE testevdev.c) + add_sdl_test_executable(testevdev NOTRACKMEM NONINTERACTIVE testevdev.c) endif() add_sdl_test_executable(testfile testfile.c) @@ -127,6 +141,10 @@ add_sdl_test_executable(testgesture testgesture.c) add_sdl_test_executable(testgl2 testgl2.c) add_sdl_test_executable(testgles testgles.c) add_sdl_test_executable(testgles2 testgles2.c) +add_sdl_test_executable(testgles2_sdf NEEDS_RESOURCES testgles2_sdf.c testutils.c) +if(APPLE) + set_property(TARGET testgles testgles2 testgles2_sdf APPEND PROPERTY COMPILE_DEFINITIONS "GLES_SILENCE_DEPRECATION") +endif() add_sdl_test_executable(testhaptic testhaptic.c) add_sdl_test_executable(testhotplug testhotplug.c) add_sdl_test_executable(testrumble testrumble.c) @@ -158,13 +176,18 @@ elseif(WINDOWS) add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativew32.c testutils.c) elseif(HAVE_X11) add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativex11.c testutils.c) - target_link_libraries(testnative X11) + target_link_libraries(testnative PRIVATE X11) +elseif(OS2) + add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativeos2.c testutils.c) endif() add_sdl_test_executable(testoverlay2 NEEDS_RESOURCES testoverlay2.c testyuv_cvt.c testutils.c) add_sdl_test_executable(testplatform NONINTERACTIVE testplatform.c) add_sdl_test_executable(testpower NONINTERACTIVE testpower.c) add_sdl_test_executable(testfilesystem NONINTERACTIVE testfilesystem.c) +if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + add_sdl_test_executable(testfilesystem_pre NONINTERACTIVE testfilesystem_pre.c) +endif() add_sdl_test_executable(testrendertarget NEEDS_RESOURCES testrendertarget.c testutils.c) add_sdl_test_executable(testscale NEEDS_RESOURCES testscale.c testutils.c) add_sdl_test_executable(testsem testsem.c) @@ -191,6 +214,59 @@ add_sdl_test_executable(controllermap NEEDS_RESOURCES controllermap.c testutils. add_sdl_test_executable(testvulkan testvulkan.c) add_sdl_test_executable(testoffscreen testoffscreen.c) +if(N3DS) + sdltest_link_librararies(SDL2::SDL2main) +endif() + +if(PSP) + sdltest_link_librararies( + SDL2::SDL2main + SDL2::SDL2test + SDL2::SDL2-static + GL + pspvram + pspvfpu + pspdisplay + pspgu + pspge + pspaudio + pspctrl + psphprm + psppower + ) +elseif(PS2) + sdltest_link_librararies( + SDL2main + SDL2_test + SDL2-static + patches + gskit + dmakit + ps2_drivers + ) +elseif(IOS OR TVOS) + sdltest_link_librararies(SDL2::SDL2main SDL2::SDL2test SDL2::SDL2-static) +else() + sdltest_link_librararies(SDL2::SDL2test SDL2::SDL2-static) +endif() + +if(WINDOWS) + # mingw32 must come before SDL2main to link successfully + if(MINGW OR CYGWIN) + sdltest_link_librararies(mingw32) + endif() + + # CET support was added in VS 16.7 + if(MSVC_VERSION GREATER 1926 AND CMAKE_GENERATOR_PLATFORM MATCHES "Win32|x64") + sdltest_link_librararies(-CETCOMPAT) + endif() + + # FIXME: Parent directory CMakeLists.txt only sets these for mingw/cygwin, + # but we need them for VS as well. + sdltest_link_librararies(SDL2main) + sdltest_add_definitions(-Dmain=SDL_main) +endif() + cmake_push_check_state(RESET) check_c_compiler_flag(-Wformat-overflow HAVE_WFORMAT_OVERFLOW) @@ -211,35 +287,35 @@ endif() cmake_pop_check_state() if(SDL_DUMMYAUDIO) - list(APPEND SDL_TESTS_NONINTERACTIVE - testaudioinfo - testsurround - ) + list(APPEND SDL_TESTS_NONINTERACTIVE + testaudioinfo + testsurround + ) endif() if(SDL_DUMMYVIDEO) - list(APPEND SDL_TESTS_NONINTERACTIVE - testkeys - testbounds - testdisplayinfo - ) + list(APPEND SDL_TESTS_NONINTERACTIVE + testkeys + testbounds + testdisplayinfo + ) endif() if(OPENGL_FOUND) if(TARGET OpenGL::GL) - target_link_libraries(testshader OpenGL::GL) - target_link_libraries(testgl2 OpenGL::GL) + target_link_libraries(testshader PRIVATE OpenGL::GL) + target_link_libraries(testgl2 PRIVATE OpenGL::GL) else() if(EMSCRIPTEN AND OPENGL_gl_LIBRARY STREQUAL "nul") set(OPENGL_gl_LIBRARY GL) endif() # emscripten's FindOpenGL.cmake does not create OpenGL::GL - target_link_libraries(testshader ${OPENGL_gl_LIBRARY}) - target_link_libraries(testgl2 ${OPENGL_gl_LIBRARY}) + target_link_libraries(testshader PRIVATE ${OPENGL_gl_LIBRARY}) + target_link_libraries(testgl2 PRIVATE ${OPENGL_gl_LIBRARY}) endif() endif() if(EMSCRIPTEN) - target_link_libraries(testshader -sLEGACY_GL_EMULATION) + target_link_libraries(testshader PRIVATE -sLEGACY_GL_EMULATION) endif() file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) @@ -248,7 +324,7 @@ file(COPY ${RESOURCE_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) if(PSP) # Build EBOOT files if building for PSP set(BUILD_EBOOT - ${SDL_TESTS_NEEDS_ESOURCES} + ${SDL_TESTS_NEEDS_RESOURCES} testatomic testaudiocapture testaudioinfo @@ -288,48 +364,18 @@ if(PSP) ICON_PATH NULL BACKGROUND_PATH NULL PREVIEW_PATH NULL - ) - add_custom_command( - TARGET ${APP} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory - $/sdl-${APP} - ) - add_custom_command( - TARGET ${APP} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E rename - $/EBOOT.PBP - $/sdl-${APP}/EBOOT.PBP - ) - if(${BUILD_PRX}) - add_custom_command( - TARGET ${APP} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - $/${APP} - $/sdl-${APP}/${APP} - ) - add_custom_command( - TARGET ${APP} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E rename - $/${APP}.prx - $/sdl-${APP}/${APP}.prx - ) - endif() - add_custom_command( - TARGET ${APP} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E remove - $/PARAM.SFO + OUTPUT_DIR $/sdl-${APP} ) endforeach() endif() if(N3DS) - set(ROMFS_DIR "${CMAKE_CURRENT_BINARY_DIR}/romfs") - file(COPY ${RESOURCE_FILES} DESTINATION "${ROMFS_DIR}") - foreach(APP IN LISTS SDL_TEST_EXECUTABLES) get_target_property(TARGET_BINARY_DIR ${APP} BINARY_DIR) + set(ROMFS_DIR "${TARGET_BINARY_DIR}/sdl-${APP}") set(SMDH_FILE "${TARGET_BINARY_DIR}/${APP}.smdh") - ctr_generate_smdh("${SMDH_FILE}" + file(MAKE_DIRECTORY ${ROMFS_DIR}) + ctr_generate_smdh("${SMDH_FILE}" NAME "SDL-${APP}" DESCRIPTION "SDL2 Test suite" AUTHOR "SDL2 Contributors" @@ -357,16 +403,43 @@ if(RISCOS) endforeach() endif() +if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(test_bin_dir "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + if(NOT IS_ABSOLUTE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + endif() +else() + set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}") +endif() +if(NOT CMAKE_VERSION VERSION_LESS 3.20) + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + set(test_bin_dir "${test_bin_dir}$<$:/$>") +endif() + +set(RESOURCE_FILES_BINDIR) +foreach(resource_file IN LISTS RESOURCE_FILES) + get_filename_component(res_file_name ${resource_file} NAME) + set(resource_file_bindir "${test_bin_dir}/${res_file_name}") + add_custom_command(OUTPUT "${resource_file_bindir}" + COMMAND "${CMAKE_COMMAND}" -E copy "${resource_file}" "${resource_file_bindir}" + DEPENDS "${resource_file}" + ) + list(APPEND RESOURCE_FILES_BINDIR "${resource_file_bindir}") +endforeach() +add_custom_target(copy-sdl-test-resources + DEPENDS "${RESOURCE_FILES_BINDIR}" +) + foreach(APP IN LISTS SDL_TESTS_NEEDS_RESOURCES) - foreach(RESOURCE_FILE ${RESOURCE_FILES}) - if(PSP OR PS2) + if(PSP OR PS2 OR N3DS) + foreach(RESOURCE_FILE ${RESOURCE_FILES}) add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $/sdl-${APP}) - else() - add_custom_command(TARGET ${APP} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $) - endif() - endforeach(RESOURCE_FILE) + endforeach() + else() + add_dependencies(${APP} copy-sdl-test-resources) + endif() if(APPLE) - # Make sure resource files get installed into macOS/iOS .app bundles. + # Make sure resource files get installed into macOS/iOS .app bundles. target_sources(${APP} PRIVATE "${RESOURCE_FILES}") set_target_properties(${APP} PROPERTIES RESOURCE "${RESOURCE_FILES}") endif() @@ -400,9 +473,16 @@ set(TESTS_ENVIRONMENT ) foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) + set(command ${TESTCASE}) + if(SDLTEST_TRACKMEM) + get_property(notrackmem TARGET ${TESTCASE} PROPERTY SDL_NOTRACKMEM) + if(NOT notrackmem) + list(APPEND command --trackmem) + endif() + endif() add_test( NAME ${TESTCASE} - COMMAND ${TESTCASE} + COMMAND ${command} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) set_tests_properties(${TESTCASE} @@ -410,6 +490,9 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) ENVIRONMENT "${TESTS_ENVIRONMENT}" TIMEOUT 10 ) + if(NOT notrackmem) + set_property(TEST ${TESTCASE} PROPERTY FAIL_REGULAR_EXPRESSION "Total: [0-9]+\\.[0-9]+ Kb in [1-9][0-9]* allocations") + endif() if(SDL_INSTALL_TESTS) set(exe ${TESTCASE}) set(installedtestsdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/installed-tests/SDL2") @@ -421,8 +504,13 @@ foreach(TESTCASE ${SDL_TESTS_NONINTERACTIVE}) endif() endforeach() +set_tests_properties(testautomation PROPERTIES TIMEOUT 120) set_tests_properties(testthread PROPERTIES TIMEOUT 40) set_tests_properties(testtimer PROPERTIES TIMEOUT 60) +if(TARGET testfilesystem_pre) + set_property(TEST testfilesystem_pre PROPERTY TIMEOUT 60) + set_property(TEST testfilesystem APPEND PROPERTY DEPENDS testfilesystem_pre) +endif() if(SDL_INSTALL_TESTS) if(RISCOS) @@ -436,6 +524,11 @@ if(SDL_INSTALL_TESTS) DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 ) endif() + if(MSVC) + foreach(test ${SDL_TEST_EXECUTABLES}) + SDL_install_pdb(${test} "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2") + endforeach() + endif() install( FILES ${RESOURCE_FILES} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2 diff --git a/test/Makefile.in b/test/Makefile.in index 93df6360e847c..76331d67fdd50 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -95,7 +95,7 @@ installedtestsmetadir = $(datadir)/installed-tests/SDL2 generatetestmeta: rm -f *.test - set -e; for exe in $(noninteractive) $(needs_audio) $(needs_display); do \ + set -e; for exe in $(TESTS); do \ sed \ -e 's#@installedtestsdir@#$(installedtestsdir)#g' \ -e "s#@exe@#$$exe#g" \ @@ -141,6 +141,7 @@ testautomation$(EXE): $(srcdir)/testautomation.c \ $(srcdir)/testautomation_hints.c \ $(srcdir)/testautomation_joystick.c \ $(srcdir)/testautomation_keyboard.c \ + $(srcdir)/testautomation_log.c \ $(srcdir)/testautomation_main.c \ $(srcdir)/testautomation_math.c \ $(srcdir)/testautomation_mouse.c \ @@ -151,6 +152,7 @@ testautomation$(EXE): $(srcdir)/testautomation.c \ $(srcdir)/testautomation_rwops.c \ $(srcdir)/testautomation_sdltest.c \ $(srcdir)/testautomation_stdlib.c \ + $(srcdir)/testautomation_subsystems.c \ $(srcdir)/testautomation_surface.c \ $(srcdir)/testautomation_syswm.c \ $(srcdir)/testautomation_timer.c \ @@ -385,8 +387,12 @@ distclean: clean rm -f config.status config.cache config.log rm -rf $(srcdir)/autom4te* -noninteractive = \ +TESTS = \ testatomic$(EXE) \ + testaudioinfo$(EXE) \ + testautomation$(EXE) \ + testbounds$(EXE) \ + testdisplayinfo$(EXE) \ testerror$(EXE) \ testevdev$(EXE) \ testfilesystem$(EXE) \ @@ -395,23 +401,12 @@ noninteractive = \ testplatform$(EXE) \ testpower$(EXE) \ testqsort$(EXE) \ + testsurround$(EXE) \ testthread$(EXE) \ testtimer$(EXE) \ testver$(EXE) \ $(NULL) -needs_audio = \ - testaudioinfo$(EXE) \ - testsurround$(EXE) \ - $(NULL) - -needs_display = \ - testbounds$(EXE) \ - testdisplayinfo$(EXE) \ - $(NULL) - -TESTS = $(noninteractive) $(needs_audio) $(needs_display) - check: @set -e; \ status=0; \ diff --git a/test/Makefile.os2 b/test/Makefile.os2 index ee66409b0c153..0d5198eb55619 100644 --- a/test/Makefile.os2 +++ b/test/Makefile.os2 @@ -9,6 +9,7 @@ INCPATH = -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h" CFLAGS = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oteanbmier -ei CFLAGS+= -wx -wcd=303 +CFLAGS+= -DHAVE_SIGNAL_H !ifeq ENABLE_WERROR 1 CFLAGS+= -we !endif diff --git a/test/Makefile.w32 b/test/Makefile.w32 index 02e68e865f359..63613e290356a 100644 --- a/test/Makefile.w32 +++ b/test/Makefile.w32 @@ -13,7 +13,7 @@ CFLAGS+= -wx -wcd=303 CFLAGS+= -we !endif CFLAGS+= -DSDL_MAIN_HANDLED -CFLAGS+= -DHAVE_OPENGL +CFLAGS+= -DHAVE_OPENGL -DHAVE_SIGNAL_H GLLIBS = opengl32.lib TNSRCS = testnative.c testnativew32.c diff --git a/test/acinclude.m4 b/test/acinclude.m4 index 0fdf353ea29a5..ebee8238ab63e 100644 --- a/test/acinclude.m4 +++ b/test/acinclude.m4 @@ -5,8 +5,6 @@ # stolen from Manish Singh # Shamelessly stolen from Owen Taylor -# serial 2 - dnl AM_PATH_SDL2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl @@ -45,7 +43,7 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL2_CONFIG="$PKG_CONFIG sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/test/checkkeys.c b/test/checkkeys.c index 9167c5c0a3467..984ff237be691 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -49,8 +49,8 @@ print_string(char **text, size_t *maxlen, const char *fmt, ...) len = SDL_vsnprintf(*text, *maxlen, fmt, ap); if (len > 0) { *text += len; - if ( ((size_t) len) < *maxlen ) { - *maxlen -= (size_t) len; + if (((size_t)len) < *maxlen) { + *maxlen -= (size_t)len; } else { *maxlen = 0; } @@ -68,34 +68,46 @@ print_modifiers(char **text, size_t *maxlen) print_string(text, maxlen, " (none)"); return; } - if (mod & KMOD_LSHIFT) + if (mod & KMOD_LSHIFT) { print_string(text, maxlen, " LSHIFT"); - if (mod & KMOD_RSHIFT) + } + if (mod & KMOD_RSHIFT) { print_string(text, maxlen, " RSHIFT"); - if (mod & KMOD_LCTRL) + } + if (mod & KMOD_LCTRL) { print_string(text, maxlen, " LCTRL"); - if (mod & KMOD_RCTRL) + } + if (mod & KMOD_RCTRL) { print_string(text, maxlen, " RCTRL"); - if (mod & KMOD_LALT) + } + if (mod & KMOD_LALT) { print_string(text, maxlen, " LALT"); - if (mod & KMOD_RALT) + } + if (mod & KMOD_RALT) { print_string(text, maxlen, " RALT"); - if (mod & KMOD_LGUI) + } + if (mod & KMOD_LGUI) { print_string(text, maxlen, " LGUI"); - if (mod & KMOD_RGUI) + } + if (mod & KMOD_RGUI) { print_string(text, maxlen, " RGUI"); - if (mod & KMOD_NUM) + } + if (mod & KMOD_NUM) { print_string(text, maxlen, " NUM"); - if (mod & KMOD_CAPS) + } + if (mod & KMOD_CAPS) { print_string(text, maxlen, " CAPS"); - if (mod & KMOD_MODE) + } + if (mod & KMOD_MODE) { print_string(text, maxlen, " MODE"); - if (mod & KMOD_SCROLL) + } + if (mod & KMOD_SCROLL) { print_string(text, maxlen, " SCROLL"); + } } static void -PrintModifierState() +PrintModifierState(void) { char message[512]; char *spot; @@ -109,7 +121,7 @@ PrintModifierState() } static void -PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) +PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) { char message[512]; char *spot; @@ -121,17 +133,17 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) /* Print the keycode, name and state */ if (sym->sym) { print_string(&spot, &left, - "Key %s: scancode %d = %s, keycode 0x%08X = %s ", - pressed ? "pressed " : "released", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - sym->sym, SDL_GetKeyName(sym->sym)); + "Key %s: scancode %d = %s, keycode 0x%08X = %s ", + pressed ? "pressed " : "released", + sym->scancode, + SDL_GetScancodeName(sym->scancode), + sym->sym, SDL_GetKeyName(sym->sym)); } else { print_string(&spot, &left, - "Unknown Key (scancode %d = %s) %s ", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - pressed ? "pressed " : "released"); + "Unknown Key (scancode %d = %s) %s ", + sym->scancode, + SDL_GetScancodeName(sym->scancode), + pressed ? "pressed " : "released"); } print_modifiers(&spot, &left); if (repeat) { @@ -147,16 +159,14 @@ PrintText(const char *eventtype, const char *text) char expanded[1024]; expanded[0] = '\0'; - for ( spot = text; *spot; ++spot ) - { + for (spot = text; *spot; ++spot) { size_t length = SDL_strlen(expanded); - SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); + (void)SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); } SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); } -void -loop() +void loop(void) { SDL_Event event; /* Check for events */ @@ -238,8 +248,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -253,7 +262,7 @@ main(int argc, char *argv[]) /* Initialize SDL */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } /* Set 640x480 video mode */ @@ -262,20 +271,20 @@ main(int argc, char *argv[]) 640, 480, 0); if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n", - SDL_GetError()); + SDL_GetError()); quit(2); } renderer = SDL_CreateRenderer(window, -1, 0); if (!renderer) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", - SDL_GetError()); + SDL_GetError()); quit(2); } textwin = SDLTest_TextWindowCreate(0, 0, 640, 480); -#if __IPHONEOS__ +#ifdef __IPHONEOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif @@ -298,7 +307,7 @@ main(int argc, char *argv[]) #endif SDL_Quit(); - return (0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index 0716d0f7c01e1..959231dd0ade8 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -45,8 +45,8 @@ print_string(char **text, size_t *maxlen, const char *fmt, ...) len = SDL_vsnprintf(*text, *maxlen, fmt, ap); if (len > 0) { *text += len; - if ( ((size_t) len) < *maxlen ) { - *maxlen -= (size_t) len; + if (((size_t)len) < *maxlen) { + *maxlen -= (size_t)len; } else { *maxlen = 0; } @@ -64,34 +64,46 @@ print_modifiers(char **text, size_t *maxlen) print_string(text, maxlen, " (none)"); return; } - if (mod & KMOD_LSHIFT) + if (mod & KMOD_LSHIFT) { print_string(text, maxlen, " LSHIFT"); - if (mod & KMOD_RSHIFT) + } + if (mod & KMOD_RSHIFT) { print_string(text, maxlen, " RSHIFT"); - if (mod & KMOD_LCTRL) + } + if (mod & KMOD_LCTRL) { print_string(text, maxlen, " LCTRL"); - if (mod & KMOD_RCTRL) + } + if (mod & KMOD_RCTRL) { print_string(text, maxlen, " RCTRL"); - if (mod & KMOD_LALT) + } + if (mod & KMOD_LALT) { print_string(text, maxlen, " LALT"); - if (mod & KMOD_RALT) + } + if (mod & KMOD_RALT) { print_string(text, maxlen, " RALT"); - if (mod & KMOD_LGUI) + } + if (mod & KMOD_LGUI) { print_string(text, maxlen, " LGUI"); - if (mod & KMOD_RGUI) + } + if (mod & KMOD_RGUI) { print_string(text, maxlen, " RGUI"); - if (mod & KMOD_NUM) + } + if (mod & KMOD_NUM) { print_string(text, maxlen, " NUM"); - if (mod & KMOD_CAPS) + } + if (mod & KMOD_CAPS) { print_string(text, maxlen, " CAPS"); - if (mod & KMOD_MODE) + } + if (mod & KMOD_MODE) { print_string(text, maxlen, " MODE"); - if (mod & KMOD_SCROLL) + } + if (mod & KMOD_SCROLL) { print_string(text, maxlen, " SCROLL"); + } } static void -PrintModifierState() +PrintModifierState(void) { char message[512]; char *spot; @@ -105,7 +117,7 @@ PrintModifierState() } static void -PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) +PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) { char message[512]; char *spot; @@ -117,24 +129,23 @@ PrintKey(SDL_Keysym * sym, SDL_bool pressed, SDL_bool repeat) /* Print the keycode, name and state */ if (sym->sym) { print_string(&spot, &left, - "Key %s: scancode %d = %s, keycode 0x%08X = %s ", - pressed ? "pressed " : "released", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - sym->sym, SDL_GetKeyName(sym->sym)); + "Key %s: scancode %d = %s, keycode 0x%08X = %s ", + pressed ? "pressed " : "released", + sym->scancode, + SDL_GetScancodeName(sym->scancode), + sym->sym, SDL_GetKeyName(sym->sym)); } else { print_string(&spot, &left, - "Unknown Key (scancode %d = %s) %s ", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - pressed ? "pressed " : "released"); + "Unknown Key (scancode %d = %s) %s ", + sym->scancode, + SDL_GetScancodeName(sym->scancode), + pressed ? "pressed " : "released"); } print_modifiers(&spot, &left); if (repeat) { print_string(&spot, &left, " (repeat)"); } SDL_Log("%s\n", message); - fflush(stderr); } static void @@ -144,26 +155,24 @@ PrintText(const char *eventtype, const char *text) char expanded[1024]; expanded[0] = '\0'; - for ( spot = text; *spot; ++spot ) - { + for (spot = text; *spot; ++spot) { size_t length = SDL_strlen(expanded); - SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); + (void)SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); } SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); } -void -loop() +void loop(void) { SDL_Event event; /* Check for events */ /*SDL_WaitEvent(&event); emscripten does not like waiting*/ - fprintf(stderr, "starting loop\n"); fflush(stderr); + (void)fprintf(stderr, "starting loop\n"); + (void)fflush(stderr); // while (SDL_PollEvent(&event)) { while (!done && SDL_WaitEvent(&event)) { - fprintf(stderr, "got event type: %" SDL_PRIu32 "\n", event.type); - fflush(stderr); + SDL_Log("Got event type: %" SDL_PRIu32 "\n", event.type); switch (event.type) { case SDL_KEYDOWN: case SDL_KEYUP: @@ -177,7 +186,8 @@ loop() break; case SDL_MOUSEBUTTONDOWN: /* Left button quits the app, other buttons toggles text input */ - fprintf(stderr, "mouse button down button: %d (LEFT=%d)\n", event.button.button, SDL_BUTTON_LEFT); fflush(stderr); + (void)fprintf(stderr, "mouse button down button: %d (LEFT=%d)\n", event.button.button, SDL_BUTTON_LEFT); + (void)fflush(stderr); if (event.button.button == SDL_BUTTON_LEFT) { done = 1; } else { @@ -196,9 +206,11 @@ loop() default: break; } - fprintf(stderr, "waiting new event\n"); fflush(stderr); + (void)fprintf(stderr, "waiting new event\n"); + (void)fflush(stderr); } - fprintf(stderr, "exiting event loop\n"); fflush(stderr); + (void)fprintf(stderr, "exiting event loop\n"); + (void)fflush(stderr); #ifdef __EMSCRIPTEN__ if (done) { emscripten_cancel_main_loop(); @@ -211,9 +223,10 @@ static int SDLCALL ping_thread(void *ptr) { int cnt; SDL_Event sdlevent; - SDL_memset(&sdlevent, 0 , sizeof(SDL_Event)); + SDL_memset(&sdlevent, 0, sizeof(SDL_Event)); for (cnt = 0; cnt < 10; ++cnt) { - fprintf(stderr, "sending event (%d/%d) from thread.\n", cnt + 1, 10); fflush(stderr); + (void)fprintf(stderr, "sending event (%d/%d) from thread.\n", cnt + 1, 10); + (void)fflush(stderr); sdlevent.type = SDL_KEYDOWN; sdlevent.key.keysym.sym = SDLK_1; SDL_PushEvent(&sdlevent); @@ -222,8 +235,7 @@ static int SDLCALL ping_thread(void *ptr) return cnt; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Window *window; SDL_Renderer *renderer; @@ -235,7 +247,7 @@ main(int argc, char *argv[]) /* Initialize SDL */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } /* Set 640x480 video mode */ @@ -244,7 +256,7 @@ main(int argc, char *argv[]) 640, 480, 0); if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n", - SDL_GetError()); + SDL_GetError()); quit(2); } @@ -254,7 +266,7 @@ main(int argc, char *argv[]) renderer = SDL_CreateRenderer(window, -1, 0); SDL_RenderPresent(renderer); -#if __IPHONEOS__ +#ifdef __IPHONEOS__ /* Creating the context creates the view, which we need to show keyboard */ SDL_GL_CreateContext(window); #endif @@ -268,7 +280,7 @@ main(int argc, char *argv[]) /* Watch keystrokes */ done = 0; - thread = SDL_CreateThread(ping_thread, "PingThread", (void *)NULL); + thread = SDL_CreateThread(ping_thread, "PingThread", NULL); #ifdef __EMSCRIPTEN__ emscripten_set_main_loop(loop, 0, 1); @@ -280,7 +292,7 @@ main(int argc, char *argv[]) SDL_WaitThread(thread, NULL); SDL_Quit(); - return (0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/configure b/test/configure index c71abe48977ff..8ea80bc27ea2d 100755 --- a/test/configure +++ b/test/configure @@ -3966,7 +3966,7 @@ fi if test "x$sdl_pc" = xyes ; then no_sdl="" - SDL2_CONFIG="pkg-config sdl2" + SDL2_CONFIG="$PKG_CONFIG sdl2" else as_save_PATH="$PATH" if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then diff --git a/test/controllermap.c b/test/controllermap.c index 22ab19e37bc57..aedaa14d5c9f7 100644 --- a/test/controllermap.c +++ b/test/controllermap.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,10 +25,11 @@ /* Define this for verbose output while mapping controllers */ #define DEBUG_CONTROLLERMAP -#define SCREEN_WIDTH 512 -#define SCREEN_HEIGHT 320 +#define SCREEN_WIDTH 512 +#define SCREEN_HEIGHT 320 -enum marker_type { +enum marker_type +{ MARKER_BUTTON, MARKER_AXIS, }; @@ -64,10 +65,10 @@ static struct { 174, 132, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_BACK */ { 232, 128, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_GUIDE */ { 289, 132, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_START */ - { 75, 154, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_LEFTSTICK */ + { 75, 154, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_LEFTSTICK */ { 305, 230, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_RIGHTSTICK */ - { 77, 40, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ - { 396, 36, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ + { 77, 40, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ + { 396, 36, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ { 154, 188, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_DPAD_UP */ { 154, 249, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_DPAD_DOWN */ { 116, 217, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_DPAD_LEFT */ @@ -77,16 +78,16 @@ static struct { 330, 135, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_PADDLE2 */ { 132, 175, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_PADDLE3 */ { 330, 175, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_PADDLE4 */ - { 0, 0, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_TOUCHPAD */ - { 74, 153, 270.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTX_NEGATIVE */ - { 74, 153, 90.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTX_POSITIVE */ - { 74, 153, 0.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTY_NEGATIVE */ - { 74, 153, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTY_POSITIVE */ + { 0, 0, 0.0, MARKER_BUTTON }, /* SDL_CONTROLLER_BUTTON_TOUCHPAD */ + { 74, 153, 270.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTX_NEGATIVE */ + { 74, 153, 90.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTX_POSITIVE */ + { 74, 153, 0.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTY_NEGATIVE */ + { 74, 153, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_LEFTY_POSITIVE */ { 306, 231, 270.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTX_NEGATIVE */ - { 306, 231, 90.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTX_POSITIVE */ - { 306, 231, 0.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTY_NEGATIVE */ + { 306, 231, 90.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTX_POSITIVE */ + { 306, 231, 0.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTY_NEGATIVE */ { 306, 231, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_RIGHTY_POSITIVE */ - { 91, -20, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_TRIGGERLEFT */ + { 91, -20, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_TRIGGERLEFT */ { 375, -20, 180.0, MARKER_AXIS }, /* SDL_CONTROLLER_BINDING_AXIS_TRIGGERRIGHT */ }; SDL_COMPILE_TIME_ASSERT(s_arrBindingDisplay, SDL_arraysize(s_arrBindingDisplay) == BINDING_COUNT); @@ -133,13 +134,15 @@ typedef struct { int button; - struct { + struct + { int axis; int axis_min; int axis_max; } axis; - struct { + struct + { int hat; int hat_mask; } hat; @@ -162,7 +165,7 @@ typedef struct static int s_nNumAxes; static AxisState *s_arrAxisState; - + static int s_iCurrentBinding; static Uint32 s_unPendingAdvanceTime; static SDL_bool s_bBindingComplete; @@ -175,9 +178,9 @@ static SDL_bool bind_touchpad = SDL_FALSE; static int StandardizeAxisValue(int nValue) { - if (nValue > SDL_JOYSTICK_AXIS_MAX/2) { + if (nValue > SDL_JOYSTICK_AXIS_MAX / 2) { return SDL_JOYSTICK_AXIS_MAX; - } else if (nValue < SDL_JOYSTICK_AXIS_MIN/2) { + } else if (nValue < SDL_JOYSTICK_AXIS_MIN / 2) { return SDL_JOYSTICK_AXIS_MIN; } else { return 0; @@ -199,15 +202,13 @@ SetCurrentBinding(int iBinding) return; } - if (s_arrBindingOrder[iBinding] == -1) - { + if (s_arrBindingOrder[iBinding] == -1) { SetCurrentBinding(iBinding + 1); return; } if (s_arrBindingOrder[iBinding] == SDL_CONTROLLER_BUTTON_TOUCHPAD && - !bind_touchpad) - { + !bind_touchpad) { SetCurrentBinding(iBinding + 1); return; } @@ -227,12 +228,10 @@ SetCurrentBinding(int iBinding) static SDL_bool BBindingContainsBinding(const SDL_GameControllerExtendedBind *pBindingA, const SDL_GameControllerExtendedBind *pBindingB) { - if (pBindingA->bindType != pBindingB->bindType) - { + if (pBindingA->bindType != pBindingB->bindType) { return SDL_FALSE; } - switch (pBindingA->bindType) - { + switch (pBindingA->bindType) { case SDL_CONTROLLER_BINDTYPE_AXIS: if (pBindingA->value.axis.axis != pBindingB->value.axis.axis) { return SDL_FALSE; @@ -245,7 +244,7 @@ BBindingContainsBinding(const SDL_GameControllerExtendedBind *pBindingA, const S int maxA = SDL_max(pBindingA->value.axis.axis_min, pBindingA->value.axis.axis_max); int minB = SDL_min(pBindingB->value.axis.axis_min, pBindingB->value.axis.axis_max); int maxB = SDL_max(pBindingB->value.axis.axis_min, pBindingB->value.axis.axis_max); - return (minA <= minB && maxA >= maxB); + return minA <= minB && maxA >= maxB; } /* Not reached */ default: @@ -282,19 +281,19 @@ ConfigureBinding(const SDL_GameControllerExtendedBind *pBinding) } #ifdef DEBUG_CONTROLLERMAP - switch ( pBinding->bindType ) - { + switch (pBinding->bindType) { case SDL_CONTROLLER_BINDTYPE_NONE: - break; + break; case SDL_CONTROLLER_BINDTYPE_BUTTON: - SDL_Log("Configuring button binding for button %d\n", pBinding->value.button); - break; + SDL_Log("Configuring button binding for button %d\n", pBinding->value.button); + break; case SDL_CONTROLLER_BINDTYPE_AXIS: - SDL_Log("Configuring axis binding for axis %d %d/%d committed = %s\n", pBinding->value.axis.axis, pBinding->value.axis.axis_min, pBinding->value.axis.axis_max, pBinding->committed ? "true" : "false"); - break; + SDL_Log("Configuring axis binding for axis %d %d/%d committed = %s\n", pBinding->value.axis.axis, pBinding->value.axis.axis_min, pBinding->value.axis.axis_max, + pBinding->committed ? "true" : "false"); + break; case SDL_CONTROLLER_BINDTYPE_HAT: - SDL_Log("Configuring hat binding for hat %d %d\n", pBinding->value.hat.hat, pBinding->value.hat.hat_mask); - break; + SDL_Log("Configuring hat binding for hat %d %d\n", pBinding->value.hat.hat, pBinding->value.hat.hat_mask); + break; } #endif /* DEBUG_CONTROLLERMAP */ @@ -303,7 +302,7 @@ ConfigureBinding(const SDL_GameControllerExtendedBind *pBinding) if (pCurrent->bindType != SDL_CONTROLLER_BINDTYPE_NONE) { SDL_bool bNativeDPad, bCurrentDPad; SDL_bool bNativeAxis, bCurrentAxis; - + bNativeDPad = (iCurrentElement == SDL_CONTROLLER_BUTTON_DPAD_UP || iCurrentElement == SDL_CONTROLLER_BUTTON_DPAD_DOWN || iCurrentElement == SDL_CONTROLLER_BUTTON_DPAD_LEFT || @@ -337,7 +336,7 @@ static SDL_bool BMergeAxisBindings(int iIndex) { SDL_GameControllerExtendedBind *pBindingA = &s_arrBindings[iIndex]; - SDL_GameControllerExtendedBind *pBindingB = &s_arrBindings[iIndex+1]; + SDL_GameControllerExtendedBind *pBindingB = &s_arrBindings[iIndex + 1]; if (pBindingA->bindType == SDL_CONTROLLER_BINDTYPE_AXIS && pBindingB->bindType == SDL_CONTROLLER_BINDTYPE_AXIS && pBindingA->value.axis.axis == pBindingB->value.axis.axis) { @@ -352,13 +351,13 @@ BMergeAxisBindings(int iIndex) } static void -WatchJoystick(SDL_Joystick * joystick) +WatchJoystick(SDL_Joystick *joystick) { - SDL_Texture *background_front, *background_back, *button, *axis, *marker=NULL; + SDL_Texture *background_front, *background_back, *button, *axis, *marker = NULL; const char *name = NULL; SDL_Event event; SDL_Rect dst; - Uint8 alpha=200, alpha_step = -1; + Uint8 alpha = 200, alpha_step = -1; Uint32 alpha_ticks = 0; SDL_JoystickID nJoystickID; @@ -376,9 +375,9 @@ WatchJoystick(SDL_Joystick * joystick) SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_JoystickInstanceID(joystick), name ? name : "Unknown Joystick"); SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n", - SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), - SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick)); - + SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick), + SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick)); + SDL_Log("\n\n\ ====================================================================================\n\ Press the buttons on your controller when indicated\n\ @@ -395,7 +394,6 @@ WatchJoystick(SDL_Joystick * joystick) /* Skip any spurious events at start */ while (SDL_PollEvent(&event) > 0) { - continue; } /* Loop, getting joystick events! */ @@ -403,14 +401,14 @@ WatchJoystick(SDL_Joystick * joystick) int iElement = s_arrBindingOrder[s_iCurrentBinding]; switch (s_arrBindingDisplay[iElement].marker) { - case MARKER_AXIS: - marker = axis; - break; - case MARKER_BUTTON: - marker = button; - break; + case MARKER_AXIS: + marker = axis; + break; + case MARKER_BUTTON: + marker = button; + break; } - + dst.x = s_arrBindingDisplay[iElement].x; dst.y = s_arrBindingDisplay[iElement].y; SDL_QueryTexture(marker, NULL, NULL, &dst.w, &dst.h); @@ -438,7 +436,7 @@ WatchJoystick(SDL_Joystick * joystick) SDL_SetTextureColorMod(marker, 10, 255, 21); SDL_RenderCopyEx(screen, marker, NULL, &dst, s_arrBindingDisplay[iElement].angle, NULL, SDL_FLIP_NONE); SDL_RenderPresent(screen); - + while (SDL_PollEvent(&event) > 0) { switch (event.type) { case SDL_JOYDEVICEREMOVED: @@ -448,7 +446,7 @@ WatchJoystick(SDL_Joystick * joystick) break; case SDL_JOYAXISMOTION: if (event.jaxis.which == nJoystickID) { - const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */ + const int MAX_ALLOWED_JITTER = SDL_JOYSTICK_AXIS_MAX / 80; /* ShanWan PS3 controller needed 96 */ AxisState *pAxisState = &s_arrAxisState[event.jaxis.axis]; int nValue = event.jaxis.value; int nCurrentDistance, nFarthestDistance; @@ -504,9 +502,7 @@ WatchJoystick(SDL_Joystick * joystick) } } break; - case SDL_JOYBALLMOTION: - break; - case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: if (event.jbutton.which == nJoystickID) { SDL_GameControllerExtendedBind binding; @@ -535,7 +531,7 @@ WatchJoystick(SDL_Joystick * joystick) break; } - if ((event.key.keysym.sym != SDLK_ESCAPE)) { + if (event.key.keysym.sym != SDLK_ESCAPE) { break; } SDL_FALLTHROUGH; @@ -549,10 +545,10 @@ WatchJoystick(SDL_Joystick * joystick) SDL_Delay(15); - /* Wait 100 ms for joystick events to stop coming in, + /* Wait 30 ms for joystick events to stop coming in, in case a controller sends multiple events for a single control (e.g. axis and button for trigger) */ - if (s_unPendingAdvanceTime && SDL_GetTicks() - s_unPendingAdvanceTime >= 100) { + if (s_unPendingAdvanceTime && SDL_GetTicks() - s_unPendingAdvanceTime >= 30) { SetCurrentBinding(s_iCurrentBinding + 1); } } @@ -596,7 +592,7 @@ WatchJoystick(SDL_Joystick * joystick) char crc_string[5]; SDL_strlcat(mapping, "crc:", SDL_arraysize(mapping)); - SDL_snprintf(crc_string, sizeof(crc_string), "%.4x", crc); + (void)SDL_snprintf(crc_string, sizeof(crc_string), "%.4x", crc); SDL_strlcat(mapping, crc_string, SDL_arraysize(mapping)); SDL_strlcat(mapping, ",", SDL_arraysize(mapping)); } @@ -669,17 +665,17 @@ WatchJoystick(SDL_Joystick * joystick) pszElement[0] = '\0'; switch (pBinding->bindType) { case SDL_CONTROLLER_BINDTYPE_BUTTON: - SDL_snprintf(pszElement, sizeof(pszElement), "b%d", pBinding->value.button); + (void)SDL_snprintf(pszElement, sizeof(pszElement), "b%d", pBinding->value.button); break; case SDL_CONTROLLER_BINDTYPE_AXIS: if (pBinding->value.axis.axis_min == 0 && pBinding->value.axis.axis_max == SDL_JOYSTICK_AXIS_MIN) { /* The negative half axis */ - SDL_snprintf(pszElement, sizeof(pszElement), "-a%d", pBinding->value.axis.axis); + (void)SDL_snprintf(pszElement, sizeof(pszElement), "-a%d", pBinding->value.axis.axis); } else if (pBinding->value.axis.axis_min == 0 && pBinding->value.axis.axis_max == SDL_JOYSTICK_AXIS_MAX) { /* The positive half axis */ - SDL_snprintf(pszElement, sizeof(pszElement), "+a%d", pBinding->value.axis.axis); + (void)SDL_snprintf(pszElement, sizeof(pszElement), "+a%d", pBinding->value.axis.axis); } else { - SDL_snprintf(pszElement, sizeof(pszElement), "a%d", pBinding->value.axis.axis); + (void)SDL_snprintf(pszElement, sizeof(pszElement), "a%d", pBinding->value.axis.axis); if (pBinding->value.axis.axis_min > pBinding->value.axis.axis_max) { /* Invert the axis */ SDL_strlcat(pszElement, "~", SDL_arraysize(pszElement)); @@ -687,7 +683,7 @@ WatchJoystick(SDL_Joystick * joystick) } break; case SDL_CONTROLLER_BINDTYPE_HAT: - SDL_snprintf(pszElement, sizeof(pszElement), "h%d.%d", pBinding->value.hat.hat, pBinding->value.hat.hat_mask); + (void)SDL_snprintf(pszElement, sizeof(pszElement), "h%d.%d", pBinding->value.hat.hat, pBinding->value.hat.hat_mask); break; default: SDL_assert(!"Unknown bind type"); @@ -704,12 +700,11 @@ WatchJoystick(SDL_Joystick * joystick) SDL_free(s_arrAxisState); s_arrAxisState = NULL; - + SDL_DestroyRenderer(screen); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { const char *name; int i; @@ -735,13 +730,13 @@ main(int argc, char *argv[]) window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (window == NULL) { + if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return 2; } screen = SDL_CreateRenderer(window, -1, 0); - if (screen == NULL) { + if (!screen) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); return 2; } @@ -752,7 +747,7 @@ main(int argc, char *argv[]) while (SDL_PollEvent(&event) > 0) { switch (event.type) { case SDL_KEYDOWN: - if ((event.key.keysym.sym != SDLK_ESCAPE)) { + if (event.key.keysym.sym != SDLK_ESCAPE) { break; } SDL_FALLTHROUGH; @@ -772,13 +767,13 @@ main(int argc, char *argv[]) name = SDL_JoystickNameForIndex(i); SDL_Log("Joystick %d: %s\n", i, name ? name : "Unknown Joystick"); joystick = SDL_JoystickOpen(i); - if (joystick == NULL) { + if (!joystick) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_JoystickOpen(%d) failed: %s\n", i, - SDL_GetError()); + SDL_GetError()); } else { char guid[64]; SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), - guid, sizeof (guid)); + guid, sizeof(guid)); SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick)); SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joystick)); SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick)); @@ -798,7 +793,7 @@ main(int argc, char *argv[]) } } joystick = SDL_JoystickOpen(joystick_index); - if (joystick == NULL) { + if (!joystick) { SDL_Log("Couldn't open joystick %d: %s\n", joystick_index, SDL_GetError()); } else { WatchJoystick(joystick); diff --git a/test/loopwave.c b/test/loopwave.c index 1b5fa95f0e6bd..a2898129a4fc0 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,9 +30,9 @@ static struct { SDL_AudioSpec spec; - Uint8 *sound; /* Pointer to wave data */ - Uint32 soundlen; /* Length of wave data */ - int soundpos; /* Current play position */ + Uint8 *sound; /* Pointer to wave data */ + Uint32 soundlen; /* Length of wave data */ + int soundpos; /* Current play position */ } wave; static SDL_AudioDeviceID device; @@ -46,7 +46,7 @@ quit(int rc) } static void -close_audio() +close_audio(void) { if (device != 0) { SDL_CloseAudioDevice(device); @@ -55,7 +55,7 @@ close_audio() } static void -open_audio() +open_audio(void) { /* Initialize fillerup() variables */ device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0); @@ -65,13 +65,12 @@ open_audio() quit(2); } - /* Let the audio run */ SDL_PauseAudioDevice(device, SDL_FALSE); } #ifndef __EMSCRIPTEN__ -static void reopen_audio() +static void reopen_audio(void) { close_audio(); open_audio(); @@ -79,7 +78,7 @@ static void reopen_audio() #endif void SDLCALL -fillerup(void *unused, Uint8 * stream, int len) +fillerup(void *unused, Uint8 *stream, int len) { Uint8 *waveptr; int waveleft; @@ -104,16 +103,15 @@ fillerup(void *unused, Uint8 * stream, int len) static int done = 0; #ifdef __EMSCRIPTEN__ -void -loop() +void loop(void) { - if(done || (SDL_GetAudioDeviceStatus(device) != SDL_AUDIO_PLAYING)) + if (done || (SDL_GetAudioDeviceStatus(device) != SDL_AUDIO_PLAYING)) { emscripten_cancel_main_loop(); + } } #endif -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; char *filename = NULL; @@ -122,14 +120,14 @@ main(int argc, char *argv[]) SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Load the SDL library */ - if (SDL_Init(SDL_INIT_AUDIO|SDL_INIT_EVENTS) < 0) { + if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_EVENTS) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } @@ -178,7 +176,7 @@ main(int argc, char *argv[]) SDL_FreeWAV(wave.sound); SDL_free(filename); SDL_Quit(); - return (0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/loopwavequeue.c b/test/loopwavequeue.c index 1996d784a5d63..411791592d78d 100644 --- a/test/loopwavequeue.c +++ b/test/loopwavequeue.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,7 +21,7 @@ #include "SDL.h" -#if HAVE_SIGNAL_H +#ifdef HAVE_SIGNAL_H #include #endif @@ -30,11 +30,10 @@ static struct { SDL_AudioSpec spec; - Uint8 *sound; /* Pointer to wave data */ - Uint32 soundlen; /* Length of wave data */ + Uint8 *sound; /* Pointer to wave data */ + Uint32 soundlen; /* Length of wave data */ } wave; - /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) @@ -44,37 +43,33 @@ quit(int rc) } static int done = 0; -void -poked(int sig) +void poked(int sig) { done = 1; } -void -loop() +void loop(void) { #ifdef __EMSCRIPTEN__ if (done || (SDL_GetAudioStatus() != SDL_AUDIO_PLAYING)) { emscripten_cancel_main_loop(); - } - else + } else #endif { /* The device from SDL_OpenAudio() is always device #1. */ const Uint32 queued = SDL_GetQueuedAudioSize(1); - SDL_Log("Device has %u bytes queued.\n", (unsigned int) queued); - if (queued <= 8192) { /* time to requeue the whole thing? */ + SDL_Log("Device has %u bytes queued.\n", (unsigned int)queued); + if (queued <= 8192) { /* time to requeue the whole thing? */ if (SDL_QueueAudio(1, wave.sound, wave.soundlen) == 0) { - SDL_Log("Device queued %u more bytes.\n", (unsigned int) wave.soundlen); + SDL_Log("Device queued %u more bytes.\n", (unsigned int)wave.soundlen); } else { - SDL_Log("Device FAILED to queue %u more bytes: %s\n", (unsigned int) wave.soundlen, SDL_GetError()); + SDL_Log("Device FAILED to queue %u more bytes: %s\n", (unsigned int)wave.soundlen, SDL_GetError()); } } } } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { char *filename = NULL; @@ -84,12 +79,12 @@ main(int argc, char *argv[]) /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } @@ -100,18 +95,18 @@ main(int argc, char *argv[]) quit(1); } - wave.spec.callback = NULL; /* we'll push audio. */ + wave.spec.callback = NULL; /* we'll push audio. */ -#if HAVE_SIGNAL_H +#ifdef HAVE_SIGNAL_H /* Set the signals */ #ifdef SIGHUP - signal(SIGHUP, poked); + (void)signal(SIGHUP, poked); #endif - signal(SIGINT, poked); + (void)signal(SIGINT, poked); #ifdef SIGQUIT - signal(SIGQUIT, poked); + (void)signal(SIGQUIT, poked); #endif - signal(SIGTERM, poked); + (void)signal(SIGTERM, poked); #endif /* HAVE_SIGNAL_H */ /* Initialize fillerup() variables */ @@ -131,15 +126,14 @@ main(int argc, char *argv[]) /* Note that we stuff the entire audio buffer into the queue in one shot. Most apps would want to feed it a little at a time, as it plays, but we're going for simplicity here. */ - + #ifdef __EMSCRIPTEN__ emscripten_set_main_loop(loop, 0, 1); #else - while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING)) - { + while (!done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING)) { loop(); - SDL_Delay(100); /* let it play for awhile. */ + SDL_Delay(100); /* let it play for awhile. */ } #endif diff --git a/test/testatomic.c b/test/testatomic.c index 9efbb29c069dd..fd80fd6ef01fe 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,29 +12,27 @@ #include #include "SDL.h" +#include "SDL_test.h" /* Absolutely basic tests just to see if we get the expected value after calling each function. */ -static -const char * +static const char * tf(SDL_bool _tf) { static const char *t = "TRUE"; static const char *f = "FALSE"; - if (_tf) - { - return t; + if (_tf) { + return t; } return f; } -static -void RunBasicTest() +static void RunBasicTest(void) { int value; SDL_SpinLock lock = 0; @@ -96,15 +94,16 @@ void RunBasicTest() /* Number of concurrent incrementers */ #define NThreads 2 #define CountInc 100 -#define VALBITS (sizeof(atomicValue)*8) +#define VALBITS (sizeof(atomicValue) * 8) #define atomicValue int -#define CountTo ((atomicValue)((unsigned int)(1<<(VALBITS-1))-1)) -#define NInter (CountTo/CountInc/NThreads) -#define Expect (CountTo-NInter*CountInc*NThreads) +#define CountTo ((atomicValue)((unsigned int)(1 << (VALBITS - 1)) - 1)) +#define NInter (CountTo / CountInc / NThreads) +#define Expect (CountTo - NInter * CountInc * NThreads) -enum { - CountTo_GreaterThanZero = CountTo > 0, +enum +{ + CountTo_GreaterThanZero = CountTo > 0, }; SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */ @@ -116,25 +115,24 @@ static SDL_atomic_t threadsRunning; static SDL_sem *threadDone; -static -int SDLCALL adder(void* junk) +static int SDLCALL adder(void *junk) { - unsigned long N=NInter; - SDL_Log("Thread subtracting %d %lu times\n",CountInc,N); + unsigned long N = NInter; + SDL_Log("Thread subtracting %d %lu times\n", CountInc, N); while (N--) { SDL_AtomicAdd(&good, -CountInc); - bad-=CountInc; + bad -= CountInc; } SDL_AtomicAdd(&threadsRunning, -1); SDL_SemPost(threadDone); return 0; } -static -void runAdder(void) +static void runAdder(void) { Uint32 start, end; - int T=NThreads; + int i; + SDL_Thread *threads[NThreads]; start = SDL_GetTicks(); @@ -142,11 +140,17 @@ void runAdder(void) SDL_AtomicSet(&threadsRunning, NThreads); - while (T--) - SDL_CreateThread(adder, "Adder", NULL); + for (i = 0; i < NThreads; i++) { + threads[i] = SDL_CreateThread(adder, "Adder", NULL); + } - while (SDL_AtomicGet(&threadsRunning) > 0) + while (SDL_AtomicGet(&threadsRunning) > 0) { SDL_SemWait(threadDone); + } + + for (i = 0; i < NThreads; i++) { + SDL_WaitThread(threads[i], NULL); + } SDL_DestroySemaphore(threadDone); @@ -155,8 +159,7 @@ void runAdder(void) SDL_Log("Finished in %f sec\n", (end - start) / 1000.f); } -static -void RunEpicTest() +static void RunEpicTest(void) { int b; atomicValue v; @@ -164,80 +167,81 @@ void RunEpicTest() SDL_Log("\nepic test---------------------------------------\n\n"); SDL_Log("Size asserted to be >= 32-bit\n"); - SDL_assert(sizeof(atomicValue)>=4); + SDL_assert(sizeof(atomicValue) >= 4); SDL_Log("Check static initializer\n"); - v=SDL_AtomicGet(&good); - SDL_assert(v==42); + v = SDL_AtomicGet(&good); + SDL_assert(v == 42); - SDL_assert(bad==42); + SDL_assert(bad == 42); SDL_Log("Test negative values\n"); SDL_AtomicSet(&good, -5); - v=SDL_AtomicGet(&good); - SDL_assert(v==-5); + v = SDL_AtomicGet(&good); + SDL_assert(v == -5); SDL_Log("Verify maximum value\n"); SDL_AtomicSet(&good, CountTo); - v=SDL_AtomicGet(&good); - SDL_assert(v==CountTo); + v = SDL_AtomicGet(&good); + SDL_assert(v == CountTo); SDL_Log("Test compare and exchange\n"); - b=SDL_AtomicCAS(&good, 500, 43); + b = SDL_AtomicCAS(&good, 500, 43); SDL_assert(!b); /* no swap since CountTo!=500 */ - v=SDL_AtomicGet(&good); - SDL_assert(v==CountTo); /* ensure no swap */ + v = SDL_AtomicGet(&good); + SDL_assert(v == CountTo); /* ensure no swap */ - b=SDL_AtomicCAS(&good, CountTo, 44); + b = SDL_AtomicCAS(&good, CountTo, 44); SDL_assert(!!b); /* will swap */ - v=SDL_AtomicGet(&good); - SDL_assert(v==44); + v = SDL_AtomicGet(&good); + SDL_assert(v == 44); SDL_Log("Test Add\n"); - v=SDL_AtomicAdd(&good, 1); - SDL_assert(v==44); - v=SDL_AtomicGet(&good); - SDL_assert(v==45); + v = SDL_AtomicAdd(&good, 1); + SDL_assert(v == 44); + v = SDL_AtomicGet(&good); + SDL_assert(v == 45); - v=SDL_AtomicAdd(&good, 10); - SDL_assert(v==45); - v=SDL_AtomicGet(&good); - SDL_assert(v==55); + v = SDL_AtomicAdd(&good, 10); + SDL_assert(v == 45); + v = SDL_AtomicGet(&good); + SDL_assert(v == 55); SDL_Log("Test Add (Negative values)\n"); - v=SDL_AtomicAdd(&good, -20); - SDL_assert(v==55); - v=SDL_AtomicGet(&good); - SDL_assert(v==35); + v = SDL_AtomicAdd(&good, -20); + SDL_assert(v == 55); + v = SDL_AtomicGet(&good); + SDL_assert(v == 35); - v=SDL_AtomicAdd(&good, -50); /* crossing zero down */ - SDL_assert(v==35); - v=SDL_AtomicGet(&good); - SDL_assert(v==-15); + v = SDL_AtomicAdd(&good, -50); /* crossing zero down */ + SDL_assert(v == 35); + v = SDL_AtomicGet(&good); + SDL_assert(v == -15); - v=SDL_AtomicAdd(&good, 30); /* crossing zero up */ - SDL_assert(v==-15); - v=SDL_AtomicGet(&good); - SDL_assert(v==15); + v = SDL_AtomicAdd(&good, 30); /* crossing zero up */ + SDL_assert(v == -15); + v = SDL_AtomicGet(&good); + SDL_assert(v == 15); SDL_Log("Reset before count down test\n"); SDL_AtomicSet(&good, CountTo); - v=SDL_AtomicGet(&good); - SDL_assert(v==CountTo); + v = SDL_AtomicGet(&good); + SDL_assert(v == CountTo); - bad=CountTo; - SDL_assert(bad==CountTo); + bad = CountTo; + SDL_assert(bad == CountTo); - SDL_Log("Counting down from %d, Expect %d remaining\n",CountTo,Expect); + SDL_Log("Counting down from %d, Expect %d remaining\n", CountTo, Expect); runAdder(); - v=SDL_AtomicGet(&good); - SDL_Log("Atomic %d Non-Atomic %d\n",v,bad); - SDL_assert(v==Expect); - SDL_assert(bad!=Expect); + v = SDL_AtomicGet(&good); + SDL_Log("Atomic %d Non-Atomic %d\n", v, bad); + SDL_assert(v == Expect); + /* We can't guarantee that bad != Expect, this would happen on a single core system, for example. */ + /*SDL_assert(bad != Expect);*/ } /* End atomic operation test */ @@ -251,13 +255,13 @@ void RunEpicTest() */ #define TEST_SPINLOCK_FIFO -#define NUM_READERS 4 -#define NUM_WRITERS 4 -#define EVENTS_PER_WRITER 1000000 +#define NUM_READERS 4 +#define NUM_WRITERS 4 +#define EVENTS_PER_WRITER 1000000 /* The number of entries must be a power of 2 */ #define MAX_ENTRIES 256 -#define WRAP_MASK (MAX_ENTRIES-1) +#define WRAP_MASK (MAX_ENTRIES - 1) typedef struct { @@ -269,22 +273,22 @@ typedef struct { SDL_EventQueueEntry entries[MAX_ENTRIES]; - char cache_pad1[SDL_CACHELINE_SIZE-((sizeof(SDL_EventQueueEntry)*MAX_ENTRIES)%SDL_CACHELINE_SIZE)]; + char cache_pad1[SDL_CACHELINE_SIZE - ((sizeof(SDL_EventQueueEntry) * MAX_ENTRIES) % SDL_CACHELINE_SIZE)]; SDL_atomic_t enqueue_pos; - char cache_pad2[SDL_CACHELINE_SIZE-sizeof(SDL_atomic_t)]; + char cache_pad2[SDL_CACHELINE_SIZE - sizeof(SDL_atomic_t)]; SDL_atomic_t dequeue_pos; - char cache_pad3[SDL_CACHELINE_SIZE-sizeof(SDL_atomic_t)]; + char cache_pad3[SDL_CACHELINE_SIZE - sizeof(SDL_atomic_t)]; #ifdef TEST_SPINLOCK_FIFO SDL_SpinLock lock; SDL_atomic_t rwcount; SDL_atomic_t watcher; - char cache_pad4[SDL_CACHELINE_SIZE-sizeof(SDL_SpinLock)-2*sizeof(SDL_atomic_t)]; + char cache_pad4[SDL_CACHELINE_SIZE - sizeof(SDL_SpinLock) - 2 * sizeof(SDL_atomic_t)]; #endif SDL_atomic_t active; @@ -328,14 +332,14 @@ static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *ev #endif queue_pos = (unsigned)SDL_AtomicGet(&queue->enqueue_pos); - for ( ; ; ) { + for (;;) { entry = &queue->entries[queue_pos & WRAP_MASK]; entry_seq = (unsigned)SDL_AtomicGet(&entry->sequence); delta = (int)(entry_seq - queue_pos); if (delta == 0) { /* The entry and the queue position match, try to increment the queue position */ - if (SDL_AtomicCAS(&queue->enqueue_pos, (int)queue_pos, (int)(queue_pos+1))) { + if (SDL_AtomicCAS(&queue->enqueue_pos, (int)queue_pos, (int)(queue_pos + 1))) { /* We own the object, fill it! */ entry->event = *event; SDL_AtomicSet(&entry->sequence, (int)(queue_pos + 1)); @@ -353,7 +357,7 @@ static SDL_bool EnqueueEvent_LockFree(SDL_EventQueue *queue, const SDL_Event *ev } #ifdef TEST_SPINLOCK_FIFO - (void) SDL_AtomicDecRef(&queue->rwcount); + (void)SDL_AtomicDecRef(&queue->rwcount); #endif return status; } @@ -375,17 +379,17 @@ static SDL_bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) #endif queue_pos = (unsigned)SDL_AtomicGet(&queue->dequeue_pos); - for ( ; ; ) { + for (;;) { entry = &queue->entries[queue_pos & WRAP_MASK]; entry_seq = (unsigned)SDL_AtomicGet(&entry->sequence); delta = (int)(entry_seq - (queue_pos + 1)); if (delta == 0) { /* The entry and the queue position match, try to increment the queue position */ - if (SDL_AtomicCAS(&queue->dequeue_pos, (int)queue_pos, (int)(queue_pos+1))) { + if (SDL_AtomicCAS(&queue->dequeue_pos, (int)queue_pos, (int)(queue_pos + 1))) { /* We own the object, fill it! */ *event = entry->event; - SDL_AtomicSet(&entry->sequence, (int)(queue_pos+MAX_ENTRIES)); + SDL_AtomicSet(&entry->sequence, (int)(queue_pos + MAX_ENTRIES)); status = SDL_TRUE; break; } @@ -400,7 +404,7 @@ static SDL_bool DequeueEvent_LockFree(SDL_EventQueue *queue, SDL_Event *event) } #ifdef TEST_SPINLOCK_FIFO - (void) SDL_AtomicDecRef(&queue->rwcount); + (void)SDL_AtomicDecRef(&queue->rwcount); #endif return status; } @@ -475,10 +479,10 @@ typedef struct { SDL_EventQueue *queue; int index; - char padding1[SDL_CACHELINE_SIZE-(sizeof(SDL_EventQueue*)+sizeof(int))%SDL_CACHELINE_SIZE]; + char padding1[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int)) % SDL_CACHELINE_SIZE]; int waits; SDL_bool lock_free; - char padding2[SDL_CACHELINE_SIZE-sizeof(int)-sizeof(SDL_bool)]; + char padding2[SDL_CACHELINE_SIZE - sizeof(int) - sizeof(SDL_bool)]; SDL_Thread *thread; } WriterData; @@ -488,11 +492,11 @@ typedef struct int counters[NUM_WRITERS]; int waits; SDL_bool lock_free; - char padding[SDL_CACHELINE_SIZE-(sizeof(SDL_EventQueue*)+sizeof(int)*NUM_WRITERS+sizeof(int)+sizeof(SDL_bool))%SDL_CACHELINE_SIZE]; + char padding[SDL_CACHELINE_SIZE - (sizeof(SDL_EventQueue *) + sizeof(int) * NUM_WRITERS + sizeof(int) + sizeof(SDL_bool)) % SDL_CACHELINE_SIZE]; SDL_Thread *thread; } ReaderData; -static int SDLCALL FIFO_Writer(void* _data) +static int SDLCALL FIFO_Writer(void *_data) { WriterData *data = (WriterData *)_data; SDL_EventQueue *queue = data->queue; @@ -525,16 +529,16 @@ static int SDLCALL FIFO_Writer(void* _data) return 0; } -static int SDLCALL FIFO_Reader(void* _data) +static int SDLCALL FIFO_Reader(void *_data) { ReaderData *data = (ReaderData *)_data; SDL_EventQueue *queue = data->queue; SDL_Event event; if (data->lock_free) { - for ( ; ; ) { + for (;;) { if (DequeueEvent_LockFree(queue, &event)) { - WriterData *writer = (WriterData*)event.user.data1; + WriterData *writer = (WriterData *)event.user.data1; ++data->counters[writer->index]; } else if (SDL_AtomicGet(&queue->active)) { ++data->waits; @@ -545,9 +549,9 @@ static int SDLCALL FIFO_Reader(void* _data) } } } else { - for ( ; ; ) { + for (;;) { if (DequeueEvent_Mutex(queue, &event)) { - WriterData *writer = (WriterData*)event.user.data1; + WriterData *writer = (WriterData *)event.user.data1; ++data->counters[writer->index]; } else if (SDL_AtomicGet(&queue->active)) { ++data->waits; @@ -563,7 +567,7 @@ static int SDLCALL FIFO_Reader(void* _data) #ifdef TEST_SPINLOCK_FIFO /* This thread periodically locks the queue for no particular reason */ -static int SDLCALL FIFO_Watcher(void* _data) +static int SDLCALL FIFO_Watcher(void *_data) { SDL_EventQueue *queue = (SDL_EventQueue *)_data; @@ -574,7 +578,7 @@ static int SDLCALL FIFO_Watcher(void* _data) SDL_Delay(0); } /* Do queue manipulation here... */ - (void) SDL_AtomicDecRef(&queue->watcher); + (void)SDL_AtomicDecRef(&queue->watcher); SDL_AtomicUnlock(&queue->lock); /* Wait a bit... */ @@ -620,7 +624,7 @@ static void RunFIFOTest(SDL_bool lock_free) SDL_zeroa(readerData); for (i = 0; i < NUM_READERS; ++i) { char name[64]; - SDL_snprintf(name, sizeof (name), "FIFOReader%d", i); + (void)SDL_snprintf(name, sizeof(name), "FIFOReader%d", i); readerData[i].queue = &queue; readerData[i].lock_free = lock_free; readerData[i].thread = SDL_CreateThread(FIFO_Reader, name, &readerData[i]); @@ -631,7 +635,7 @@ static void RunFIFOTest(SDL_bool lock_free) SDL_zeroa(writerData); for (i = 0; i < NUM_WRITERS; ++i) { char name[64]; - SDL_snprintf(name, sizeof (name), "FIFOWriter%d", i); + (void)SDL_snprintf(name, sizeof(name), "FIFOWriter%d", i); writerData[i].queue = &queue; writerData[i].index = i; writerData[i].lock_free = lock_free; @@ -668,7 +672,7 @@ static void RunFIFOTest(SDL_bool lock_free) for (i = 0; i < NUM_WRITERS; ++i) { SDL_Log("Writer %d wrote %d events, had %d waits\n", i, EVENTS_PER_WRITER, writerData[i].waits); } - SDL_Log("Writers wrote %d total events\n", NUM_WRITERS*EVENTS_PER_WRITER); + SDL_Log("Writers wrote %d total events\n", NUM_WRITERS * EVENTS_PER_WRITER); /* Print a breakdown of which readers read messages from which writer */ SDL_Log("\n"); @@ -680,17 +684,17 @@ static void RunFIFOTest(SDL_bool lock_free) } grand_total += total; SDL_Log("Reader %d read %d events, had %d waits\n", i, total, readerData[i].waits); - SDL_snprintf(textBuffer, sizeof(textBuffer), " { "); + (void)SDL_snprintf(textBuffer, sizeof(textBuffer), " { "); for (j = 0; j < NUM_WRITERS; ++j) { if (j > 0) { len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); } len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", readerData[i].counters[j]); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", readerData[i].counters[j]); } len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); SDL_Log("%s", textBuffer); } SDL_Log("Readers read %d total events\n", grand_total); @@ -699,12 +703,28 @@ static void RunFIFOTest(SDL_bool lock_free) /* End FIFO test */ /**************************************************************************/ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + RunBasicTest(); if (SDL_getenv("SDL_TESTS_QUICK") != NULL) { @@ -718,6 +738,8 @@ main(int argc, char *argv[]) RunFIFOTest(SDL_FALSE); #endif RunFIFOTest(SDL_TRUE); + SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testaudiocapture.c b/test/testaudiocapture.c index 03d373273a823..b07d5630567d0 100644 --- a/test/testaudiocapture.c +++ b/test/testaudiocapture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,7 @@ static SDL_AudioDeviceID devid_in = 0; static SDL_AudioDeviceID devid_out = 0; static void -loop() +loop(void) { SDL_bool please_quit = SDL_FALSE; SDL_Event e; @@ -67,9 +67,9 @@ loop() SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); - #ifdef __EMSCRIPTEN__ +#ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); - #endif +#endif exit(0); } @@ -78,16 +78,15 @@ loop() trying to test the API, so we use SDL_DequeueAudio() here. */ while (SDL_TRUE) { Uint8 buf[1024]; - const Uint32 br = SDL_DequeueAudio(devid_in, buf, sizeof (buf)); + const Uint32 br = SDL_DequeueAudio(devid_in, buf, sizeof(buf)); SDL_QueueAudio(devid_out, buf, br); - if (br < sizeof (buf)) { + if (br < sizeof(buf)) { break; } } } -int -main(int argc, char **argv) +int main(int argc, char **argv) { /* (argv[1] == NULL means "open default device.") */ const char *devname = argv[1]; @@ -101,7 +100,7 @@ main(int argc, char **argv) /* Load the SDL library */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } window = SDL_CreateWindow("testaudiocapture", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0); @@ -157,7 +156,10 @@ main(int argc, char **argv) #ifdef __EMSCRIPTEN__ emscripten_set_main_loop(loop, 0, 1); #else - while (1) { loop(); SDL_Delay(16); } + while (1) { + loop(); + SDL_Delay(16); + } #endif return 0; diff --git a/test/testaudiohotplug.c b/test/testaudiohotplug.c index dc84a782fed3e..cfa3e1b3f399a 100644 --- a/test/testaudiohotplug.c +++ b/test/testaudiohotplug.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -17,7 +17,7 @@ #include #include -#if HAVE_SIGNAL_H +#ifdef HAVE_SIGNAL_H #include #endif @@ -29,8 +29,8 @@ #include "testutils.h" static SDL_AudioSpec spec; -static Uint8 *sound = NULL; /* Pointer to wave data */ -static Uint32 soundlen = 0; /* Length of wave data */ +static Uint8 *sound = NULL; /* Pointer to wave data */ +static Uint32 soundlen = 0; /* Length of wave data */ static int posindex = 0; static Uint32 positions[64]; @@ -44,9 +44,9 @@ quit(int rc) } void SDLCALL -fillerup(void *_pos, Uint8 * stream, int len) +fillerup(void *_pos, Uint8 *stream, int len) { - Uint32 pos = *((Uint32 *) _pos); + Uint32 pos = *((Uint32 *)_pos); Uint8 *waveptr; int waveleft; @@ -65,24 +65,23 @@ fillerup(void *_pos, Uint8 * stream, int len) } SDL_memcpy(stream, waveptr, len); pos += len; - *((Uint32 *) _pos) = pos; + *((Uint32 *)_pos) = pos; } static int done = 0; -void -poked(int sig) +void poked(int sig) { done = 1; } -static const char* +static const char * devtypestr(int iscapture) { return iscapture ? "capture" : "output"; } static void -iteration() +iteration(void) { SDL_Event e; SDL_AudioDeviceID dev; @@ -90,17 +89,18 @@ iteration() if (e.type == SDL_QUIT) { done = 1; } else if (e.type == SDL_KEYUP) { - if (e.key.keysym.sym == SDLK_ESCAPE) + if (e.key.keysym.sym == SDLK_ESCAPE) { done = 1; + } } else if (e.type == SDL_AUDIODEVICEADDED) { int index = e.adevice.which; int iscapture = e.adevice.iscapture; const char *name = SDL_GetAudioDeviceName(index, iscapture); - if (name != NULL) - SDL_Log("New %s audio device at index %u: %s\n", devtypestr(iscapture), (unsigned int) index, name); - else { + if (name) { + SDL_Log("New %s audio device at index %u: %s\n", devtypestr(iscapture), (unsigned int)index, name); + } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Got new %s device at index %u, but failed to get the name: %s\n", - devtypestr(iscapture), (unsigned int) index, SDL_GetError()); + devtypestr(iscapture), (unsigned int)index, SDL_GetError()); continue; } if (!iscapture) { @@ -111,31 +111,29 @@ iteration() if (!dev) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open '%s': %s\n", name, SDL_GetError()); } else { - SDL_Log("Opened '%s' as %u\n", name, (unsigned int) dev); + SDL_Log("Opened '%s' as %u\n", name, (unsigned int)dev); SDL_PauseAudioDevice(dev, 0); } } } else if (e.type == SDL_AUDIODEVICEREMOVED) { - dev = (SDL_AudioDeviceID) e.adevice.which; - SDL_Log("%s device %u removed.\n", devtypestr(e.adevice.iscapture), (unsigned int) dev); + dev = (SDL_AudioDeviceID)e.adevice.which; + SDL_Log("%s device %u removed.\n", devtypestr(e.adevice.iscapture), (unsigned int)dev); SDL_CloseAudioDevice(dev); } } } #ifdef __EMSCRIPTEN__ -void -loop() +void loop(void) { - if(done) + if (done) emscripten_cancel_main_loop(); else iteration(); } #endif -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; char *filename = NULL; @@ -146,7 +144,7 @@ main(int argc, char *argv[]) /* Load the SDL library */ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } /* Some targets (Mac CoreAudio) need an event queue for audio hotplug, so make and immediately hide a window. */ @@ -154,7 +152,7 @@ main(int argc, char *argv[]) filename = GetResourceFilename(argc > 1 ? argv[1] : NULL, "sample.wav"); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); quit(1); } @@ -165,16 +163,16 @@ main(int argc, char *argv[]) quit(1); } -#if HAVE_SIGNAL_H +#ifdef HAVE_SIGNAL_H /* Set the signals */ #ifdef SIGHUP - signal(SIGHUP, poked); + (void)signal(SIGHUP, poked); #endif - signal(SIGINT, poked); + (void)signal(SIGINT, poked); #ifdef SIGQUIT - signal(SIGQUIT, poked); + (void)signal(SIGQUIT, poked); #endif - signal(SIGTERM, poked); + (void)signal(SIGTERM, poked); #endif /* HAVE_SIGNAL_H */ /* Show the list of available drivers */ @@ -201,7 +199,7 @@ main(int argc, char *argv[]) SDL_FreeWAV(sound); SDL_free(filename); SDL_Quit(); - return (0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index 9e3bfcdf703a7..2f087f2b53c12 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,6 +11,7 @@ */ #include #include "SDL.h" +#include "SDL_test.h" static void print_devices(int iscapture) @@ -21,18 +22,19 @@ print_devices(int iscapture) SDL_Log("Found %d %s device%s:\n", n, typestr, n != 1 ? "s" : ""); - if (n == -1) + if (n == -1) { SDL_Log(" Driver can't detect specific %s devices.\n\n", typestr); - else if (n == 0) + } else if (n == 0) { SDL_Log(" No %s devices found.\n\n", typestr); - else { + } else { int i; for (i = 0; i < n; i++) { const char *name = SDL_GetAudioDeviceName(i, iscapture); - if (name != NULL) + if (name) { SDL_Log(" %d: %s\n", i, name); - else + } else { SDL_Log(" %d Error: %s\n", i, SDL_GetError()); + } if (SDL_GetAudioDeviceSpec(i, iscapture, &spec) == 0) { SDL_Log(" Sample Rate: %d\n", spec.freq); @@ -44,20 +46,29 @@ print_devices(int iscapture) } } -int -main(int argc, char **argv) +int main(int argc, char **argv) { char *deviceName = NULL; SDL_AudioSpec spec; int n; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, SDL_INIT_AUDIO); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Load the SDL library */ - if (SDL_Init(SDL_INIT_AUDIO) < 0) { + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } /* Print available audio drivers */ @@ -81,7 +92,7 @@ main(int argc, char **argv) if (SDL_GetDefaultAudioInfo(&deviceName, &spec, 0) < 0) { SDL_Log("Error when calling SDL_GetDefaultAudioInfo: %s\n", SDL_GetError()); } else { - SDL_Log("Default Output Name: %s\n", deviceName != NULL ? deviceName : "unknown"); + SDL_Log("Default Output Name: %s\n", deviceName ? deviceName : "unknown"); SDL_free(deviceName); SDL_Log("Sample Rate: %d\n", spec.freq); SDL_Log("Channels: %d\n", spec.channels); @@ -91,14 +102,13 @@ main(int argc, char **argv) if (SDL_GetDefaultAudioInfo(&deviceName, &spec, 1) < 0) { SDL_Log("Error when calling SDL_GetDefaultAudioInfo: %s\n", SDL_GetError()); } else { - SDL_Log("Default Capture Name: %s\n", deviceName != NULL ? deviceName : "unknown"); + SDL_Log("Default Capture Name: %s\n", deviceName ? deviceName : "unknown"); SDL_free(deviceName); SDL_Log("Sample Rate: %d\n", spec.freq); SDL_Log("Channels: %d\n", spec.channels); SDL_Log("SDL_AudioFormat: %X\n", spec.format); } - - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testautomation.c b/test/testautomation.c index 5f469db2bff54..b0b6b004189a3 100644 --- a/test/testautomation.c +++ b/test/testautomation.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,7 @@ quit(int rc) exit(rc); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int result; int testIterations = 1; @@ -46,6 +45,9 @@ main(int argc, char *argv[]) return 1; } + /* No need of windows (or update testautomation_mouse.c:mouse_getMouseFocus() */ + state->num_windows = 0; + /* Parse commandline */ for (i = 1; i < argc;) { int consumed; @@ -56,23 +58,22 @@ main(int argc, char *argv[]) if (SDL_strcasecmp(argv[i], "--iterations") == 0) { if (argv[i + 1]) { testIterations = SDL_atoi(argv[i + 1]); - if (testIterations < 1) testIterations = 1; + if (testIterations < 1) { + testIterations = 1; + } consumed = 2; } - } - else if (SDL_strcasecmp(argv[i], "--execKey") == 0) { + } else if (SDL_strcasecmp(argv[i], "--execKey") == 0) { if (argv[i + 1]) { - SDL_sscanf(argv[i + 1], "%"SDL_PRIu64, &userExecKey); + (void)SDL_sscanf(argv[i + 1], "%" SDL_PRIu64, &userExecKey); consumed = 2; } - } - else if (SDL_strcasecmp(argv[i], "--seed") == 0) { + } else if (SDL_strcasecmp(argv[i], "--seed") == 0) { if (argv[i + 1]) { userRunSeed = SDL_strdup(argv[i + 1]); consumed = 2; } - } - else if (SDL_strcasecmp(argv[i], "--filter") == 0) { + } else if (SDL_strcasecmp(argv[i], "--filter") == 0) { if (argv[i + 1]) { filter = SDL_strdup(argv[i + 1]); consumed = 2; @@ -105,11 +106,11 @@ main(int argc, char *argv[]) /* Empty event queue */ done = 0; - for (i=0; i<100; i++) { - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - } - SDL_Delay(10); + for (i = 0; i < 100; i++) { + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + } + SDL_Delay(10); } /* Clean up */ @@ -118,7 +119,7 @@ main(int argc, char *argv[]) /* Shutdown everything */ quit(result); - return(result); + return result; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index e6127b5730010..af73cc2b6ed01 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -5,9 +5,10 @@ /* quiet windows compiler warnings */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -# define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS #endif +#include #include #include @@ -18,43 +19,77 @@ /* Fixture */ -void -_audioSetUp(void *arg) +void _audioSetUp(void *arg) { /* Start SDL audio subsystem */ - int ret = SDL_InitSubSystem( SDL_INIT_AUDIO ); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); - SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); + int ret = SDL_InitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); + SDLTest_AssertCheck(ret == 0, "Check result from SDL_InitSubSystem(SDL_INIT_AUDIO)"); if (ret != 0) { - SDLTest_LogError("%s", SDL_GetError()); - } + SDLTest_LogError("%s", SDL_GetError()); + } } -void -_audioTearDown(void *arg) +void _audioTearDown(void *arg) { /* Remove a possibly created file from SDL disk writer audio driver; ignore errors */ - remove("sdlaudio.raw"); + (void)remove("sdlaudio.raw"); SDLTest_AssertPass("Cleanup of test files completed"); } - /* Global counter for callback invocation */ int _audio_testCallbackCounter; /* Global accumulator for total callback length */ int _audio_testCallbackLength; - /* Test callback function */ void SDLCALL _audio_testCallback(void *userdata, Uint8 *stream, int len) { - /* track that callback was called */ - _audio_testCallbackCounter++; - _audio_testCallbackLength += len; + /* track that callback was called */ + _audio_testCallbackCounter++; + _audio_testCallbackLength += len; } +#if defined(__linux__) +/* Linux builds can include many audio drivers, but some are very + * obscure and typically unsupported on modern systems. They will + * be skipped in tests that run against all included drivers, as + * they are basically guaranteed to fail. + */ +static SDL_bool DriverIsProblematic(const char *driver) +{ + static const char *driverList[] = { + /* Omnipresent in Linux builds, but deprecated since 2002, + * very rarely used on Linux nowadays, and is almost certainly + * guaranteed to fail. + */ + "dsp", + + /* Jack isn't always configured properly on end user systems */ + "jack", + + /* OpenBSD sound API. Can be used on Linux, but very rare. */ + "sndio", + + /* Always fails on initialization and/or opening a device. + * Does anyone or anything actually use this? + */ + "nas" + }; + + int i; + + for (i = 0; i < SDL_arraysize(driverList); ++i) { + if (SDL_strcmp(driver, driverList[i]) == 0) { + return SDL_TRUE; + } + } + + return SDL_FALSE; +} +#endif /* Test case functions */ @@ -64,14 +99,14 @@ void SDLCALL _audio_testCallback(void *userdata, Uint8 *stream, int len) * \sa https://wiki.libsdl.org/SDL_QuitSubSystem * \sa https://wiki.libsdl.org/SDL_InitSubSystem */ -int audio_quitInitAudioSubSystem() +int audio_quitInitAudioSubSystem(void) { /* Stop SDL audio subsystem */ - SDL_QuitSubSystem( SDL_INIT_AUDIO ); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); - /* Restart audio again */ - _audioSetUp(NULL); + /* Restart audio again */ + _audioSetUp(NULL); return TEST_COMPLETED; } @@ -82,34 +117,59 @@ int audio_quitInitAudioSubSystem() * \sa https://wiki.libsdl.org/SDL_InitAudio * \sa https://wiki.libsdl.org/SDL_QuitAudio */ -int audio_initQuitAudio() +int audio_initQuitAudio(void) { - int result; + int result; int i, iMax; - const char* audioDriver; + const char *audioDriver; + const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ - SDL_QuitSubSystem( SDL_INIT_AUDIO ); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Was a specific driver requested? */ + audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); + if (audioDriver == NULL) { /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - for (i = 0; i < iMax; i++) { + } else { + /* A specific driver was requested for testing */ + iMax = 1; + } + for (i = 0; i < iMax; i++) { + if (audioDriver == NULL) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ + +#if defined(__linux__) + if (DriverIsProblematic(audioDriver)) { + SDLTest_Log("Audio driver '%s' flagged as problematic: skipping init/quit test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); + audioDriver = NULL; + continue; + } +#endif + } - /* Call Init */ - result = SDL_AudioInit(audioDriver); - SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); - SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + if (hint && SDL_strcmp(audioDriver, hint) != 0) { + continue; + } - /* Call Quit */ - SDL_AudioQuit(); - SDLTest_AssertPass("Call to SDL_AudioQuit()"); + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Call Quit */ + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + + audioDriver = NULL; } /* NULL driver specification */ @@ -124,8 +184,8 @@ int audio_initQuitAudio() SDL_AudioQuit(); SDLTest_AssertPass("Call to SDL_AudioQuit()"); - /* Restart audio again */ - _audioSetUp(NULL); + /* Restart audio again */ + _audioSetUp(NULL); return TEST_COMPLETED; } @@ -138,83 +198,120 @@ int audio_initQuitAudio() * \sa https://wiki.libsdl.org/SDL_CloseAudio * \sa https://wiki.libsdl.org/SDL_QuitAudio */ -int audio_initOpenCloseQuitAudio() +int audio_initOpenCloseQuitAudio(void) { int result, expectedResult; int i, iMax, j, k; - const char* audioDriver; + const char *audioDriver; SDL_AudioSpec desired; + const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ - SDL_QuitSubSystem( SDL_INIT_AUDIO ); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + + /* Was a specific driver requested? */ + audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); + if (audioDriver == NULL) { /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - for (i = 0; i < iMax; i++) { + } else { + /* A specific driver was requested for testing */ + iMax = 1; + } + for (i = 0; i < iMax; i++) { + if (audioDriver == NULL) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); - - /* Change specs */ - for (j = 0; j < 2; j++) { - - /* Call Init */ - result = SDL_AudioInit(audioDriver); - SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); - SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); - - /* Set spec */ - SDL_memset(&desired, 0, sizeof(desired)); - switch (j) { - case 0: - /* Set standard desired spec */ - desired.freq = 22050; - desired.format = AUDIO_S16SYS; - desired.channels = 2; - desired.samples = 4096; - desired.callback = _audio_testCallback; - desired.userdata = NULL; - - case 1: - /* Set custom desired spec */ - desired.freq = 48000; - desired.format = AUDIO_F32SYS; - desired.channels = 2; - desired.samples = 2048; - desired.callback = _audio_testCallback; - desired.userdata = NULL; - break; + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ + +#if defined(__linux__) + if (DriverIsProblematic(audioDriver)) { + SDLTest_Log("Audio driver '%s' flagged as problematic: skipping device open/close test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); + audioDriver = NULL; + continue; + } +#endif + } + + if (hint && SDL_strcmp(audioDriver, hint) != 0) { + continue; + } + + /* Change specs */ + for (j = 0; j < 2; j++) { + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + /* Check for output devices */ + result = SDL_GetNumAudioDevices(SDL_FALSE); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(SDL_FALSE)"); + SDLTest_AssertCheck(result >= 0, "Validate result value; expected: >=0 got: %d", result); + if (result <= 0) { + SDLTest_Log("No output devices for '%s': skipping device open/close test", audioDriver); + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + break; + } + + /* Set spec */ + SDL_memset(&desired, 0, sizeof(desired)); + switch (j) { + case 0: + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; + case 1: + /* Set custom desired spec */ + desired.freq = 48000; + desired.format = AUDIO_F32SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; } /* Call Open (maybe multiple times) */ - for (k=0; k <= j; k++) { + for (k = 0; k <= j; k++) { result = SDL_OpenAudio(&desired, NULL); - SDLTest_AssertPass("Call to SDL_OpenAudio(desired_spec_%d, NULL), call %d", j, k+1); - expectedResult = (k==0) ? 0 : -1; + SDLTest_AssertPass("Call to SDL_OpenAudio(desired_spec_%d, NULL), call %d", j, k + 1); + expectedResult = (k == 0) ? 0 : -1; SDLTest_AssertCheck(result == expectedResult, "Verify return value; expected: %d, got: %d", expectedResult, result); } /* Call Close (maybe multiple times) */ - for (k=0; k <= j; k++) { + for (k = 0; k <= j; k++) { SDL_CloseAudio(); - SDLTest_AssertPass("Call to SDL_CloseAudio(), call %d", k+1); + SDLTest_AssertPass("Call to SDL_CloseAudio(), call %d", k + 1); } /* Call Quit (maybe multiple times) */ - for (k=0; k <= j; k++) { + for (k = 0; k <= j; k++) { SDL_AudioQuit(); - SDLTest_AssertPass("Call to SDL_AudioQuit(), call %d", k+1); + SDLTest_AssertPass("Call to SDL_AudioQuit(), call %d", k + 1); } } /* spec loop */ + + audioDriver = NULL; + } /* driver loop */ - /* Restart audio again */ - _audioSetUp(NULL); + /* Restart audio again */ + _audioSetUp(NULL); return TEST_COMPLETED; } @@ -224,59 +321,92 @@ int audio_initOpenCloseQuitAudio() * * \sa https://wiki.libsdl.org/SDL_PauseAudio */ -int audio_pauseUnpauseAudio() +int audio_pauseUnpauseAudio(void) { int result; int i, iMax, j, k, l; int totalDelay; int pause_on; int originalCounter; - const char* audioDriver; + const char *audioDriver; SDL_AudioSpec desired; + const char *hint = SDL_GetHint(SDL_HINT_AUDIODRIVER); /* Stop SDL audio subsystem */ - SDL_QuitSubSystem( SDL_INIT_AUDIO ); - SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + /* Was a specific driver requested? */ + audioDriver = SDL_GetHint(SDL_HINT_AUDIODRIVER); + + if (audioDriver == NULL) { /* Loop over all available audio drivers */ iMax = SDL_GetNumAudioDrivers(); SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax); - for (i = 0; i < iMax; i++) { + } else { + /* A specific driver was requested for testing */ + iMax = 1; + } + for (i = 0; i < iMax; i++) { + if (audioDriver == NULL) { audioDriver = SDL_GetAudioDriver(i); SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i); - SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL"); - SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); - - /* Change specs */ - for (j = 0; j < 2; j++) { - - /* Call Init */ - result = SDL_AudioInit(audioDriver); - SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); - SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); - - /* Set spec */ - SDL_memset(&desired, 0, sizeof(desired)); - switch (j) { - case 0: - /* Set standard desired spec */ - desired.freq = 22050; - desired.format = AUDIO_S16SYS; - desired.channels = 2; - desired.samples = 4096; - desired.callback = _audio_testCallback; - desired.userdata = NULL; - - case 1: - /* Set custom desired spec */ - desired.freq = 48000; - desired.format = AUDIO_F32SYS; - desired.channels = 2; - desired.samples = 2048; - desired.callback = _audio_testCallback; - desired.userdata = NULL; - break; + SDLTest_Assert(audioDriver != NULL, "Audio driver name is not NULL"); + SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver); /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ + +#if defined(__linux__) + if (DriverIsProblematic(audioDriver)) { + SDLTest_Log("Audio driver '%s' flagged as problematic: skipping pause/unpause test (set SDL_AUDIODRIVER=%s to force)", audioDriver, audioDriver); + audioDriver = NULL; + continue; + } +#endif + } + + if (hint && SDL_strcmp(audioDriver, hint) != 0) { + continue; + } + + /* Change specs */ + for (j = 0; j < 2; j++) { + + /* Call Init */ + result = SDL_AudioInit(audioDriver); + SDLTest_AssertPass("Call to SDL_AudioInit('%s')", audioDriver); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); + + result = SDL_GetNumAudioDevices(SDL_FALSE); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(SDL_FALSE)"); + SDLTest_AssertCheck(result >= 0, "Validate result value; expected: >=0 got: %d", result); + if (result <= 0) { + SDLTest_Log("No output devices for '%s': skipping pause/unpause test", audioDriver); + SDL_AudioQuit(); + SDLTest_AssertPass("Call to SDL_AudioQuit()"); + break; + } + + /* Set spec */ + SDL_memset(&desired, 0, sizeof(desired)); + switch (j) { + case 0: + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; + case 1: + /* Set custom desired spec */ + desired.freq = 48000; + desired.format = AUDIO_F32SYS; + desired.channels = 2; + desired.samples = 2048; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + break; } /* Call Open */ @@ -285,37 +415,36 @@ int audio_pauseUnpauseAudio() SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0 got: %d", result); /* Start and stop audio multiple times */ - for (l=0; l<3; l++) { - SDLTest_Log("Pause/Unpause iteration: %d", l+1); - + for (l = 0; l < 3; l++) { + SDLTest_Log("Pause/Unpause iteration: %d", l + 1); + /* Reset callback counters */ _audio_testCallbackCounter = 0; _audio_testCallbackLength = 0; /* Un-pause audio to start playing (maybe multiple times) */ pause_on = 0; - for (k=0; k <= j; k++) { + for (k = 0; k <= j; k++) { SDL_PauseAudio(pause_on); - SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k+1); + SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k + 1); } - + /* Wait for callback */ totalDelay = 0; do { SDL_Delay(10); totalDelay += 10; - } - while (_audio_testCallbackCounter == 0 && totalDelay < 1000); + } while (_audio_testCallbackCounter == 0 && totalDelay < 1000); SDLTest_AssertCheck(_audio_testCallbackCounter > 0, "Verify callback counter; expected: >0 got: %d", _audio_testCallbackCounter); SDLTest_AssertCheck(_audio_testCallbackLength > 0, "Verify callback length; expected: >0 got: %d", _audio_testCallbackLength); /* Pause audio to stop playing (maybe multiple times) */ - for (k=0; k <= j; k++) { - pause_on = (k==0) ? 1 : SDLTest_RandomIntegerInRange(99, 9999); + for (k = 0; k <= j; k++) { + pause_on = (k == 0) ? 1 : SDLTest_RandomIntegerInRange(99, 9999); SDL_PauseAudio(pause_on); - SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k+1); + SDLTest_AssertPass("Call to SDL_PauseAudio(%d), call %d", pause_on, k + 1); } - + /* Ensure callback is not called again */ originalCounter = _audio_testCallbackCounter; SDL_Delay(totalDelay + 10); @@ -331,6 +460,9 @@ int audio_pauseUnpauseAudio() SDLTest_AssertPass("Call to SDL_AudioQuit()"); } /* spec loop */ + + audioDriver = NULL; + } /* driver loop */ /* Restart audio again */ @@ -345,56 +477,56 @@ int audio_pauseUnpauseAudio() * \sa https://wiki.libsdl.org/SDL_GetNumAudioDevices * \sa https://wiki.libsdl.org/SDL_GetAudioDeviceName */ -int audio_enumerateAndNameAudioDevices() +int audio_enumerateAndNameAudioDevices(void) { - int t, tt; - int i, n, nn; - const char *name, *nameAgain; - - /* Iterate over types: t=0 output device, t=1 input/capture device */ - for (t=0; t<2; t++) { - - /* Get number of devices. */ - n = SDL_GetNumAudioDevices(t); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(%i)", t); - SDLTest_Log("Number of %s devices < 0, reported as %i", (t) ? "capture" : "output", n); - SDLTest_AssertCheck(n >= 0, "Validate result is >= 0, got: %i", n); - - /* Variation of non-zero type */ - if (t==1) { - tt = t + SDLTest_RandomIntegerInRange(1,10); - nn = SDL_GetNumAudioDevices(tt); - SDLTest_AssertCheck(n==nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", tt, n, nn); - nn = SDL_GetNumAudioDevices(-tt); - SDLTest_AssertCheck(n==nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", -tt, n, nn); - } - - /* List devices. */ - if (n>0) { - for (i=0; i= 0, "Validate result is >= 0, got: %i", n); + + /* Variation of non-zero type */ + if (t == 1) { + tt = t + SDLTest_RandomIntegerInRange(1, 10); + nn = SDL_GetNumAudioDevices(tt); + SDLTest_AssertCheck(n == nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", tt, n, nn); + nn = SDL_GetNumAudioDevices(-tt); + SDLTest_AssertCheck(n == nn, "Verify result from SDL_GetNumAudioDevices(%i), expected same number of audio devices %i, got %i", -tt, n, nn); + } + + /* List devices. */ + if (n > 0) { + for (i = 0; i < n; i++) { + name = SDL_GetAudioDeviceName(i, t); + SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); + SDLTest_AssertCheck(name != NULL, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not NULL", i, t); + if (name != NULL) { + SDLTest_AssertCheck(name[0] != '\0', "verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, t, name); + if (t == 1) { + /* Also try non-zero type */ + tt = t + SDLTest_RandomIntegerInRange(1, 10); + nameAgain = SDL_GetAudioDeviceName(i, tt); + SDLTest_AssertCheck(nameAgain != NULL, "Verify result from SDL_GetAudioDeviceName(%i, %i) is not NULL", i, tt); + if (nameAgain != NULL) { + SDLTest_AssertCheck(nameAgain[0] != '\0', "Verify result from SDL_GetAudioDeviceName(%i, %i) is not empty, got: '%s'", i, tt, nameAgain); + SDLTest_AssertCheck(SDL_strcmp(name, nameAgain) == 0, + "Verify SDL_GetAudioDeviceName(%i, %i) and SDL_GetAudioDeviceName(%i %i) return the same string", + i, t, i, tt); + } + } + } } - } - } - } + } + } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -403,46 +535,45 @@ int audio_enumerateAndNameAudioDevices() * \sa https://wiki.libsdl.org/SDL_GetNumAudioDevices * \sa https://wiki.libsdl.org/SDL_GetAudioDeviceName */ -int audio_enumerateAndNameAudioDevicesNegativeTests() +int audio_enumerateAndNameAudioDevicesNegativeTests(void) { - int t; - int i, j, no, nc; - const char *name; - - /* Get number of devices. */ - no = SDL_GetNumAudioDevices(0); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); - nc = SDL_GetNumAudioDevices(1); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(1)"); - - /* Invalid device index when getting name */ - for (t=0; t<2; t++) { - /* Negative device index */ - i = SDLTest_RandomIntegerInRange(-10,-1); - name = SDL_GetAudioDeviceName(i, t); - SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); - SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result NULL, expected NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); - - /* Device index past range */ - for (j=0; j<3; j++) { - i = (t) ? nc+j : no+j; - name = SDL_GetAudioDeviceName(i, t); - SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); - SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result, expected: NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); - } - - /* Capture index past capture range but within output range */ - if ((no>0) && (no>nc) && (t==1)) { - i = no-1; - name = SDL_GetAudioDeviceName(i, t); - SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); - SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result, expected: NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); - } - } - - return TEST_COMPLETED; -} + int t; + int i, j, no, nc; + const char *name; + + /* Get number of devices. */ + no = SDL_GetNumAudioDevices(0); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); + nc = SDL_GetNumAudioDevices(1); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(1)"); + + /* Invalid device index when getting name */ + for (t = 0; t < 2; t++) { + /* Negative device index */ + i = SDLTest_RandomIntegerInRange(-10, -1); + name = SDL_GetAudioDeviceName(i, t); + SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); + SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result NULL, expected NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); + + /* Device index past range */ + for (j = 0; j < 3; j++) { + i = (t) ? nc + j : no + j; + name = SDL_GetAudioDeviceName(i, t); + SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); + SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result, expected: NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); + } + + /* Capture index past capture range but within output range */ + if ((no > 0) && (no > nc) && (t == 1)) { + i = no - 1; + name = SDL_GetAudioDeviceName(i, t); + SDLTest_AssertPass("Call to SDL_GetAudioDeviceName(%i, %i)", i, t); + SDLTest_AssertCheck(name == NULL, "Check SDL_GetAudioDeviceName(%i, %i) result, expected: NULL, got: %s", i, t, (name == NULL) ? "NULL" : name); + } + } + return TEST_COMPLETED; +} /** * \brief Checks available audio driver names. @@ -450,127 +581,124 @@ int audio_enumerateAndNameAudioDevicesNegativeTests() * \sa https://wiki.libsdl.org/SDL_GetNumAudioDrivers * \sa https://wiki.libsdl.org/SDL_GetAudioDriver */ -int audio_printAudioDrivers() +int audio_printAudioDrivers(void) { - int i, n; - const char *name; - - /* Get number of drivers */ - n = SDL_GetNumAudioDrivers(); - SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()"); - SDLTest_AssertCheck(n>=0, "Verify number of audio drivers >= 0, got: %i", n); - - /* List drivers. */ - if (n>0) - { - for (i=0; i= 0, "Verify number of audio drivers >= 0, got: %i", n); + + /* List drivers. */ + if (n > 0) { + for (i = 0; i < n; i++) { + name = SDL_GetAudioDriver(i); + SDLTest_AssertPass("Call to SDL_GetAudioDriver(%i)", i); + SDLTest_AssertCheck(name != NULL, "Verify returned name is not NULL"); + if (name != NULL) { + SDLTest_AssertCheck(name[0] != '\0', "Verify returned name is not empty, got: '%s'", name); + } + } + } + return TEST_COMPLETED; +} /** * \brief Checks current audio driver name with initialized audio. * * \sa https://wiki.libsdl.org/SDL_GetCurrentAudioDriver */ -int audio_printCurrentAudioDriver() +int audio_printCurrentAudioDriver(void) { - /* Check current audio driver */ - const char *name = SDL_GetCurrentAudioDriver(); - SDLTest_AssertPass("Call to SDL_GetCurrentAudioDriver()"); - SDLTest_AssertCheck(name != NULL, "Verify returned name is not NULL"); - if (name != NULL) { - SDLTest_AssertCheck(name[0] != '\0', "Verify returned name is not empty, got: '%s'", name); - } - - return TEST_COMPLETED; + /* Check current audio driver */ + const char *name = SDL_GetCurrentAudioDriver(); + SDLTest_AssertPass("Call to SDL_GetCurrentAudioDriver()"); + SDLTest_AssertCheck(name != NULL, "Verify returned name is not NULL"); + if (name != NULL) { + SDLTest_AssertCheck(name[0] != '\0', "Verify returned name is not empty, got: '%s'", name); + } + + return TEST_COMPLETED; } /* Definition of all formats, channels, and frequencies used to test audio conversions */ const int _numAudioFormats = 18; SDL_AudioFormat _audioFormats[] = { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S16SYS, AUDIO_S16, AUDIO_U16LSB, - AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, - AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_F32SYS, AUDIO_F32 }; + AUDIO_U16MSB, AUDIO_U16SYS, AUDIO_U16, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_S32SYS, AUDIO_S32, + AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_F32SYS, AUDIO_F32 }; const char *_audioFormatsVerbose[] = { "AUDIO_S8", "AUDIO_U8", "AUDIO_S16LSB", "AUDIO_S16MSB", "AUDIO_S16SYS", "AUDIO_S16", "AUDIO_U16LSB", - "AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", - "AUDIO_F32LSB", "AUDIO_F32MSB", "AUDIO_F32SYS", "AUDIO_F32" }; + "AUDIO_U16MSB", "AUDIO_U16SYS", "AUDIO_U16", "AUDIO_S32LSB", "AUDIO_S32MSB", "AUDIO_S32SYS", "AUDIO_S32", + "AUDIO_F32LSB", "AUDIO_F32MSB", "AUDIO_F32SYS", "AUDIO_F32" }; const int _numAudioChannels = 4; Uint8 _audioChannels[] = { 1, 2, 4, 6 }; const int _numAudioFrequencies = 4; int _audioFrequencies[] = { 11025, 22050, 44100, 48000 }; - /** * \brief Builds various audio conversion structures * * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT */ -int audio_buildAudioCVT() +int audio_buildAudioCVT(void) { - int result; - SDL_AudioCVT cvt; - SDL_AudioSpec spec1; - SDL_AudioSpec spec2; - int i, ii, j, jj, k, kk; - - /* No conversion needed */ - spec1.format = AUDIO_S16LSB; - spec1.channels = 2; - spec1.freq = 22050; - result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, - spec1.format, spec1.channels, spec1.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec1)"); - SDLTest_AssertCheck(result == 0, "Verify result value; expected: 0, got: %i", result); - - /* Typical conversion */ - spec1.format = AUDIO_S8; - spec1.channels = 1; - spec1.freq = 22050; - spec2.format = AUDIO_S16LSB; - spec2.channels = 2; - spec2.freq = 44100; - result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, - spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); - SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); - - /* All source conversions with random conversion targets, allow 'null' conversions */ - for (i = 0; i < _numAudioFormats; i++) { - for (j = 0; j < _numAudioChannels; j++) { - for (k = 0; k < _numAudioFrequencies; k++) { - spec1.format = _audioFormats[i]; - spec1.channels = _audioChannels[j]; - spec1.freq = _audioFrequencies[k]; - ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); - jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); - kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); - spec2.format = _audioFormats[ii]; - spec2.channels = _audioChannels[jj]; - spec2.freq = _audioFrequencies[kk]; - result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, - spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", - i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); - SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result); - if (result<0) { - SDLTest_LogError("%s", SDL_GetError()); - } else { - SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); + int result; + SDL_AudioCVT cvt; + SDL_AudioSpec spec1; + SDL_AudioSpec spec2; + int i, ii, j, jj, k, kk; + + /* No conversion needed */ + spec1.format = AUDIO_S16LSB; + spec1.channels = 2; + spec1.freq = 22050; + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, + spec1.format, spec1.channels, spec1.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec1)"); + SDLTest_AssertCheck(result == 0, "Verify result value; expected: 0, got: %i", result); + + /* Typical conversion */ + spec1.format = AUDIO_S8; + spec1.channels = 1; + spec1.freq = 22050; + spec2.format = AUDIO_S16LSB; + spec2.channels = 2; + spec2.freq = 44100; + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, + spec2.format, spec2.channels, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); + SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); + + /* All source conversions with random conversion targets, allow 'null' conversions */ + for (i = 0; i < _numAudioFormats; i++) { + for (j = 0; j < _numAudioChannels; j++) { + for (k = 0; k < _numAudioFrequencies; k++) { + spec1.format = _audioFormats[i]; + spec1.channels = _audioChannels[j]; + spec1.freq = _audioFrequencies[k]; + ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); + jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); + kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); + spec2.format = _audioFormats[ii]; + spec2.channels = _audioChannels[jj]; + spec2.freq = _audioFrequencies[kk]; + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, + spec2.format, spec2.channels, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", + i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); + SDLTest_AssertCheck(result == 0 || result == 1, "Verify result value; expected: 0 or 1, got: %i", result); + if (result < 0) { + SDLTest_LogError("%s", SDL_GetError()); + } else { + SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); + } + } } - } } - } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -578,44 +706,18 @@ int audio_buildAudioCVT() * * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT */ -int audio_buildAudioCVTNegative() +int audio_buildAudioCVTNegative(void) { - const char *expectedError = "Parameter 'cvt' is invalid"; - const char *error; - int result; - SDL_AudioCVT cvt; - SDL_AudioSpec spec1; - SDL_AudioSpec spec2; - int i; - char message[256]; - - /* Valid format */ - spec1.format = AUDIO_S8; - spec1.channels = 1; - spec1.freq = 22050; - spec2.format = AUDIO_S16LSB; - spec2.channels = 2; - spec2.freq = 44100; - - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - /* NULL input for CVT buffer */ - result = SDL_BuildAudioCVT((SDL_AudioCVT *)NULL, spec1.format, spec1.channels, spec1.freq, - spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(NULL,...)"); - SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - } + const char *expectedError = "Parameter 'cvt' is invalid"; + const char *error; + int result; + SDL_AudioCVT cvt; + SDL_AudioSpec spec1; + SDL_AudioSpec spec2; + int i; + char message[256]; - /* Invalid conversions */ - for (i = 1; i < 64; i++) { - /* Valid format to start with */ + /* Valid format */ spec1.format = AUDIO_S8; spec1.channels = 1; spec1.freq = 22050; @@ -626,46 +728,72 @@ int audio_buildAudioCVTNegative() SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); - /* Set various invalid format inputs */ - SDL_strlcpy(message, "Invalid: ", 256); - if (i & 1) { - SDL_strlcat(message, " spec1.format", 256); - spec1.format = 0; - } - if (i & 2) { - SDL_strlcat(message, " spec1.channels", 256); - spec1.channels = 0; - } - if (i & 4) { - SDL_strlcat(message, " spec1.freq", 256); - spec1.freq = 0; - } - if (i & 8) { - SDL_strlcat(message, " spec2.format", 256); - spec2.format = 0; - } - if (i & 16) { - SDL_strlcat(message, " spec2.channels", 256); - spec2.channels = 0; - } - if (i & 32) { - SDL_strlcat(message, " spec2.freq", 256); - spec2.freq = 0; - } - SDLTest_Log("%s", message); - result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, - spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); + /* NULL input for CVT buffer */ + result = SDL_BuildAudioCVT((SDL_AudioCVT *)NULL, spec1.format, spec1.channels, spec1.freq, + spec2.format, spec2.channels, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(NULL,...)"); SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL && error[0] != '\0', "Validate that error message was not NULL or empty"); - } + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + } + + /* Invalid conversions */ + for (i = 1; i < 64; i++) { + /* Valid format to start with */ + spec1.format = AUDIO_S8; + spec1.channels = 1; + spec1.freq = 22050; + spec2.format = AUDIO_S16LSB; + spec2.channels = 2; + spec2.freq = 44100; + + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Set various invalid format inputs */ + SDL_strlcpy(message, "Invalid: ", 256); + if (i & 1) { + SDL_strlcat(message, " spec1.format", 256); + spec1.format = 0; + } + if (i & 2) { + SDL_strlcat(message, " spec1.channels", 256); + spec1.channels = 0; + } + if (i & 4) { + SDL_strlcat(message, " spec1.freq", 256); + spec1.freq = 0; + } + if (i & 8) { + SDL_strlcat(message, " spec2.format", 256); + spec2.format = 0; + } + if (i & 16) { + SDL_strlcat(message, " spec2.channels", 256); + spec2.channels = 0; + } + if (i & 32) { + SDL_strlcat(message, " spec2.freq", 256); + spec2.freq = 0; + } + SDLTest_Log("%s", message); + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, + spec2.format, spec2.channels, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(spec1 ==> spec2)"); + SDLTest_AssertCheck(result == -1, "Verify result value; expected: -1, got: %i", result); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL && error[0] != '\0', "Validate that error message was not NULL or empty"); + } - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -673,78 +801,78 @@ int audio_buildAudioCVTNegative() * * \sa https://wiki.libsdl.org/SDL_GetAudioStatus */ -int audio_getAudioStatus() +int audio_getAudioStatus(void) { - SDL_AudioStatus result; + SDL_AudioStatus result; - /* Check current audio status */ - result = SDL_GetAudioStatus(); - SDLTest_AssertPass("Call to SDL_GetAudioStatus()"); - SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, - "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", - SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); + /* Check current audio status */ + result = SDL_GetAudioStatus(); + SDLTest_AssertPass("Call to SDL_GetAudioStatus()"); + SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, + "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", + SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); - return TEST_COMPLETED; + return TEST_COMPLETED; } - - /** * \brief Opens, checks current audio status, and closes a device. * * \sa https://wiki.libsdl.org/SDL_GetAudioStatus */ -int audio_openCloseAndGetAudioStatus() +int audio_openCloseAndGetAudioStatus(void) { - SDL_AudioStatus result; - int i; - int count; - const char *device; - SDL_AudioDeviceID id; - SDL_AudioSpec desired, obtained; - - /* Get number of devices. */ - count = SDL_GetNumAudioDevices(0); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); - if (count > 0) { - for (i = 0; i < count; i++) { - /* Get device name */ - device = SDL_GetAudioDeviceName(i, 0); - SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); - SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); - if (device == NULL) return TEST_ABORTED; - - /* Set standard desired spec */ - desired.freq=22050; - desired.format=AUDIO_S16SYS; - desired.channels=2; - desired.samples=4096; - desired.callback=_audio_testCallback; - desired.userdata=NULL; - - /* Open device */ - id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); - SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); - SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id); - if (id > 1) { - - /* Check device audio status */ - result = SDL_GetAudioDeviceStatus(id); - SDLTest_AssertPass("Call to SDL_GetAudioDeviceStatus()"); - SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, - "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", - SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); - - /* Close device again */ - SDL_CloseAudioDevice(id); - SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); - } - } - } else { - SDLTest_Log("No devices to test with"); - } - - return TEST_COMPLETED; + SDL_AudioStatus result; + int i; + int count; + const char *device; + SDL_AudioDeviceID id; + SDL_AudioSpec desired, obtained; + + /* Get number of devices. */ + count = SDL_GetNumAudioDevices(0); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); + if (count > 0) { + for (i = 0; i < count; i++) { + /* Get device name */ + device = SDL_GetAudioDeviceName(i, 0); + SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); + SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); + if (device == NULL) { + return TEST_ABORTED; + } + + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + + /* Open device */ + id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); + SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); + SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id); + if (id > 1) { + + /* Check device audio status */ + result = SDL_GetAudioDeviceStatus(id); + SDLTest_AssertPass("Call to SDL_GetAudioDeviceStatus()"); + SDLTest_AssertCheck(result == SDL_AUDIO_STOPPED || result == SDL_AUDIO_PLAYING || result == SDL_AUDIO_PAUSED, + "Verify returned value; expected: STOPPED (%i) | PLAYING (%i) | PAUSED (%i), got: %i", + SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED, result); + + /* Close device again */ + SDL_CloseAudioDevice(id); + SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); + } + } + } else { + SDLTest_Log("No devices to test with"); + } + + return TEST_COMPLETED; } /** @@ -753,62 +881,63 @@ int audio_openCloseAndGetAudioStatus() * \sa https://wiki.libsdl.org/SDL_LockAudioDevice * \sa https://wiki.libsdl.org/SDL_UnlockAudioDevice */ -int audio_lockUnlockOpenAudioDevice() +int audio_lockUnlockOpenAudioDevice(void) { - int i; - int count; - const char *device; - SDL_AudioDeviceID id; - SDL_AudioSpec desired, obtained; - - /* Get number of devices. */ - count = SDL_GetNumAudioDevices(0); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); - if (count > 0) { - for (i = 0; i < count; i++) { - /* Get device name */ - device = SDL_GetAudioDeviceName(i, 0); - SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); - SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); - if (device == NULL) return TEST_ABORTED; - - /* Set standard desired spec */ - desired.freq=22050; - desired.format=AUDIO_S16SYS; - desired.channels=2; - desired.samples=4096; - desired.callback=_audio_testCallback; - desired.userdata=NULL; - - /* Open device */ - id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); - SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); - SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id); - if (id > 1) { - /* Lock to protect callback */ - SDL_LockAudioDevice(id); - SDLTest_AssertPass("SDL_LockAudioDevice(%" SDL_PRIu32 ")", id); - - /* Simulate callback processing */ - SDL_Delay(10); - SDLTest_Log("Simulate callback processing - delay"); - - /* Unlock again */ - SDL_UnlockAudioDevice(id); - SDLTest_AssertPass("SDL_UnlockAudioDevice(%" SDL_PRIu32 ")", id); - - /* Close device again */ - SDL_CloseAudioDevice(id); - SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); - } - } - } else { - SDLTest_Log("No devices to test with"); - } - - return TEST_COMPLETED; -} + int i; + int count; + const char *device; + SDL_AudioDeviceID id; + SDL_AudioSpec desired, obtained; + + /* Get number of devices. */ + count = SDL_GetNumAudioDevices(0); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); + if (count > 0) { + for (i = 0; i < count; i++) { + /* Get device name */ + device = SDL_GetAudioDeviceName(i, 0); + SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); + SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); + if (device == NULL) { + return TEST_ABORTED; + } + + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + + /* Open device */ + id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); + SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); + SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id); + if (id > 1) { + /* Lock to protect callback */ + SDL_LockAudioDevice(id); + SDLTest_AssertPass("SDL_LockAudioDevice(%" SDL_PRIu32 ")", id); + + /* Simulate callback processing */ + SDL_Delay(10); + SDLTest_Log("Simulate callback processing - delay"); + + /* Unlock again */ + SDL_UnlockAudioDevice(id); + SDLTest_AssertPass("SDL_UnlockAudioDevice(%" SDL_PRIu32 ")", id); + + /* Close device again */ + SDL_CloseAudioDevice(id); + SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); + } + } + } else { + SDLTest_Log("No devices to test with"); + } + return TEST_COMPLETED; +} /** * \brief Convert audio using various conversion structures @@ -816,219 +945,354 @@ int audio_lockUnlockOpenAudioDevice() * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT * \sa https://wiki.libsdl.org/SDL_ConvertAudio */ -int audio_convertAudio() +int audio_convertAudio(void) { - int result; - SDL_AudioCVT cvt; - SDL_AudioSpec spec1; - SDL_AudioSpec spec2; - int c; - char message[128]; - int i, ii, j, jj, k, kk, l, ll; - - /* Iterate over bitmask that determines which parameters are modified in the conversion */ - for (c = 1; c < 8; c++) { - SDL_strlcpy(message, "Changing:", 128); - if (c & 1) { - SDL_strlcat(message, " Format", 128); - } - if (c & 2) { - SDL_strlcat(message, " Channels", 128); - } - if (c & 4) { - SDL_strlcat(message, " Frequencies", 128); - } - SDLTest_Log("%s", message); - /* All source conversions with random conversion targets */ - for (i = 0; i < _numAudioFormats; i++) { - for (j = 0; j < _numAudioChannels; j++) { - for (k = 0; k < _numAudioFrequencies; k++) { - spec1.format = _audioFormats[i]; - spec1.channels = _audioChannels[j]; - spec1.freq = _audioFrequencies[k]; - - /* Ensure we have a different target format */ - do { - if (c & 1) { - ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); - } else { - ii = 1; - } - if (c & 2) { - jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); - } else { - jj= j; - } - if (c & 4) { - kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); - } else { - kk = k; + int result; + SDL_AudioCVT cvt; + SDL_AudioSpec spec1; + SDL_AudioSpec spec2; + int c; + char message[128]; + int i, ii, j, jj, k, kk, l, ll; + + /* Iterate over bitmask that determines which parameters are modified in the conversion */ + for (c = 1; c < 8; c++) { + SDL_strlcpy(message, "Changing:", 128); + if (c & 1) { + SDL_strlcat(message, " Format", 128); + } + if (c & 2) { + SDL_strlcat(message, " Channels", 128); + } + if (c & 4) { + SDL_strlcat(message, " Frequencies", 128); + } + SDLTest_Log("%s", message); + /* All source conversions with random conversion targets */ + for (i = 0; i < _numAudioFormats; i++) { + for (j = 0; j < _numAudioChannels; j++) { + for (k = 0; k < _numAudioFrequencies; k++) { + spec1.format = _audioFormats[i]; + spec1.channels = _audioChannels[j]; + spec1.freq = _audioFrequencies[k]; + + /* Ensure we have a different target format */ + do { + if (c & 1) { + ii = SDLTest_RandomIntegerInRange(0, _numAudioFormats - 1); + } else { + ii = 1; + } + if (c & 2) { + jj = SDLTest_RandomIntegerInRange(0, _numAudioChannels - 1); + } else { + jj = j; + } + if (c & 4) { + kk = SDLTest_RandomIntegerInRange(0, _numAudioFrequencies - 1); + } else { + kk = k; + } + } while ((i == ii) && (j == jj) && (k == kk)); + spec2.format = _audioFormats[ii]; + spec2.channels = _audioChannels[jj]; + spec2.freq = _audioFrequencies[kk]; + + result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, + spec2.format, spec2.channels, spec2.freq); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", + i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); + SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); + if (result != 1) { + SDLTest_LogError("%s", SDL_GetError()); + } else { + SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); + if (cvt.len_mult < 1) { + return TEST_ABORTED; + } + + /* Create some random data to convert */ + l = 64; + ll = l * cvt.len_mult; + SDLTest_Log("Creating dummy sample buffer of %i length (%i bytes)", l, ll); + cvt.len = l; + cvt.buf = (Uint8 *)SDL_malloc(ll); + SDLTest_AssertCheck(cvt.buf != NULL, "Check data buffer to convert is not NULL"); + if (cvt.buf == NULL) { + return TEST_ABORTED; + } + + /* Convert the data */ + result = SDL_ConvertAudio(&cvt); + SDLTest_AssertPass("Call to SDL_ConvertAudio()"); + SDLTest_AssertCheck(result == 0, "Verify result value; expected: 0; got: %i", result); + SDLTest_AssertCheck(cvt.buf != NULL, "Verify conversion buffer is not NULL"); + SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio); + + /* Free converted buffer */ + SDL_free(cvt.buf); + cvt.buf = NULL; + } + } } - } while ((i == ii) && (j == jj) && (k == kk)); - spec2.format = _audioFormats[ii]; - spec2.channels = _audioChannels[jj]; - spec2.freq = _audioFrequencies[kk]; - - result = SDL_BuildAudioCVT(&cvt, spec1.format, spec1.channels, spec1.freq, - spec2.format, spec2.channels, spec2.freq); - SDLTest_AssertPass("Call to SDL_BuildAudioCVT(format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i ==> format[%i]=%s(%i),channels[%i]=%i,freq[%i]=%i)", - i, _audioFormatsVerbose[i], spec1.format, j, spec1.channels, k, spec1.freq, ii, _audioFormatsVerbose[ii], spec2.format, jj, spec2.channels, kk, spec2.freq); - SDLTest_AssertCheck(result == 1, "Verify result value; expected: 1, got: %i", result); - if (result != 1) { - SDLTest_LogError("%s", SDL_GetError()); - } else { - SDLTest_AssertCheck(cvt.len_mult > 0, "Verify that cvt.len_mult value; expected: >0, got: %i", cvt.len_mult); - if (cvt.len_mult < 1) return TEST_ABORTED; - - /* Create some random data to convert */ - l = 64; - ll = l * cvt.len_mult; - SDLTest_Log("Creating dummy sample buffer of %i length (%i bytes)", l, ll); - cvt.len = l; - cvt.buf = (Uint8 *)SDL_malloc(ll); - SDLTest_AssertCheck(cvt.buf != NULL, "Check data buffer to convert is not NULL"); - if (cvt.buf == NULL) return TEST_ABORTED; - - /* Convert the data */ - result = SDL_ConvertAudio(&cvt); - SDLTest_AssertPass("Call to SDL_ConvertAudio()"); - SDLTest_AssertCheck(result == 0, "Verify result value; expected: 0; got: %i", result); - SDLTest_AssertCheck(cvt.buf != NULL, "Verify conversion buffer is not NULL"); - SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio); - - /* Free converted buffer */ - SDL_free(cvt.buf); - cvt.buf = NULL; - } } - } } - } - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * \brief Opens, checks current connected status, and closes a device. * * \sa https://wiki.libsdl.org/SDL_AudioDeviceConnected */ -int audio_openCloseAudioDeviceConnected() +int audio_openCloseAudioDeviceConnected(void) { - int result = -1; - int i; - int count; - const char *device; - SDL_AudioDeviceID id; - SDL_AudioSpec desired, obtained; - - /* Get number of devices. */ - count = SDL_GetNumAudioDevices(0); - SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); - if (count > 0) { - for (i = 0; i < count; i++) { - /* Get device name */ - device = SDL_GetAudioDeviceName(i, 0); - SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); - SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); - if (device == NULL) return TEST_ABORTED; - - /* Set standard desired spec */ - desired.freq=22050; - desired.format=AUDIO_S16SYS; - desired.channels=2; - desired.samples=4096; - desired.callback=_audio_testCallback; - desired.userdata=NULL; - - /* Open device */ - id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); - SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); - SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %" SDL_PRIu32, id); - if (id > 1) { + int result = -1; + int i; + int count; + const char *device; + SDL_AudioDeviceID id; + SDL_AudioSpec desired, obtained; + + /* Get number of devices. */ + count = SDL_GetNumAudioDevices(0); + SDLTest_AssertPass("Call to SDL_GetNumAudioDevices(0)"); + if (count > 0) { + for (i = 0; i < count; i++) { + /* Get device name */ + device = SDL_GetAudioDeviceName(i, 0); + SDLTest_AssertPass("SDL_GetAudioDeviceName(%i,0)", i); + SDLTest_AssertCheck(device != NULL, "Validate device name is not NULL; got: %s", (device != NULL) ? device : "NULL"); + if (device == NULL) { + return TEST_ABORTED; + } + + /* Set standard desired spec */ + desired.freq = 22050; + desired.format = AUDIO_S16SYS; + desired.channels = 2; + desired.samples = 4096; + desired.callback = _audio_testCallback; + desired.userdata = NULL; + + /* Open device */ + id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); + SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device); + SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %" SDL_PRIu32, id); + if (id > 1) { /* TODO: enable test code when function is available in SDL2 */ #ifdef AUDIODEVICECONNECTED_DEFINED - /* Get connected status */ - result = SDL_AudioDeviceConnected(id); - SDLTest_AssertPass("Call to SDL_AudioDeviceConnected()"); + /* Get connected status */ + result = SDL_AudioDeviceConnected(id); + SDLTest_AssertPass("Call to SDL_AudioDeviceConnected()"); #endif - SDLTest_AssertCheck(result == 1, "Verify returned value; expected: 1; got: %i", result); - - /* Close device again */ - SDL_CloseAudioDevice(id); - SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); - } - } - } else { - SDLTest_Log("No devices to test with"); - } - - return TEST_COMPLETED; + SDLTest_AssertCheck(result == 1, "Verify returned value; expected: 1; got: %i", result); + + /* Close device again */ + SDL_CloseAudioDevice(id); + SDLTest_AssertPass("Call to SDL_CloseAudioDevice()"); + } + } + } else { + SDLTest_Log("No devices to test with"); + } + + return TEST_COMPLETED; +} + +static double sine_wave_sample(const Sint64 idx, const Sint64 rate, const Sint64 freq, const double phase) +{ + /* Using integer modulo to avoid precision loss caused by large floating + * point numbers. Sint64 is needed for the large integer multiplication. + * The integers are assumed to be non-negative so that modulo is always + * non-negative. + * sin(i / rate * freq * 2 * M_PI + phase) + * = sin(mod(i / rate * freq, 1) * 2 * M_PI + phase) + * = sin(mod(i * freq, rate) / rate * 2 * M_PI + phase) */ + return SDL_sin(((double) (idx * freq % rate)) / ((double) rate) * (M_PI * 2) + phase); } +/** + * \brief Check signal-to-noise ratio and maximum error of audio resampling. + * + * \sa https://wiki.libsdl.org/SDL_BuildAudioCVT + * \sa https://wiki.libsdl.org/SDL_ConvertAudio + */ +int audio_resampleLoss(void) +{ + /* Note: always test long input time (>= 5s from experience) in some test + * cases because an improper implementation may suffer from low resampling + * precision with long input due to e.g. doing subtraction with large floats. */ + struct test_spec_t { + int time; + int freq; + double phase; + int rate_in; + int rate_out; + double signal_to_noise; + double max_error; + } test_specs[] = { + { 50, 440, 0, 44100, 48000, 60, 0.0025 }, + { 50, 5000, M_PI / 2, 20000, 10000, 65, 0.0010 }, + { 0 } + }; + + int spec_idx = 0; + + for (spec_idx = 0; test_specs[spec_idx].time > 0; ++spec_idx) { + const struct test_spec_t *spec = &test_specs[spec_idx]; + const int frames_in = spec->time * spec->rate_in; + const int frames_target = spec->time * spec->rate_out; + const int len_in = frames_in * (int)sizeof(float); + const int len_target = frames_target * (int)sizeof(float); + + Uint64 tick_beg = 0; + Uint64 tick_end = 0; + SDL_AudioCVT cvt; + int i = 0; + int ret = 0; + double max_error = 0; + double sum_squared_error = 0; + double sum_squared_value = 0; + double signal_to_noise = 0; + + SDLTest_AssertPass("Test resampling of %i s %i Hz %f phase sine wave from sampling rate of %i Hz to %i Hz", + spec->time, spec->freq, spec->phase, spec->rate_in, spec->rate_out); + + ret = SDL_BuildAudioCVT(&cvt, AUDIO_F32SYS, 1, spec->rate_in, AUDIO_F32SYS, 1, spec->rate_out); + SDLTest_AssertPass("Call to SDL_BuildAudioCVT(&cvt, AUDIO_F32SYS, 1, %i, AUDIO_F32SYS, 1, %i)", spec->rate_in, spec->rate_out); + SDLTest_AssertCheck(ret == 1, "Expected SDL_BuildAudioCVT to succeed and conversion to be needed."); + if (ret != 1) { + return TEST_ABORTED; + } + + cvt.buf = (Uint8 *)SDL_malloc(len_in * cvt.len_mult); + SDLTest_AssertCheck(cvt.buf != NULL, "Expected input buffer to be created."); + if (cvt.buf == NULL) { + return TEST_ABORTED; + } + cvt.len = len_in; + for (i = 0; i < frames_in; ++i) { + *(((float *) cvt.buf) + i) = (float)sine_wave_sample(i, spec->rate_in, spec->freq, spec->phase); + } + + tick_beg = SDL_GetPerformanceCounter(); + ret = SDL_ConvertAudio(&cvt); + tick_end = SDL_GetPerformanceCounter(); + SDLTest_AssertPass("Call to SDL_ConvertAudio(&cvt)"); + SDLTest_AssertCheck(ret == 0, "Expected SDL_ConvertAudio to succeed."); + SDLTest_AssertCheck(cvt.len_cvt == len_target, "Expected output length %i, got %i.", len_target, cvt.len_cvt); + if (ret != 0 || cvt.len_cvt != len_target) { + SDL_free(cvt.buf); + return TEST_ABORTED; + } + SDLTest_Log("Resampling used %f seconds.", ((double) (tick_end - tick_beg)) / SDL_GetPerformanceFrequency()); + + for (i = 0; i < frames_target; ++i) { + const float output = *(((float *) cvt.buf) + i); + const double target = sine_wave_sample(i, spec->rate_out, spec->freq, spec->phase); + const double error = SDL_fabs(target - output); + max_error = SDL_max(max_error, error); + sum_squared_error += error * error; + sum_squared_value += target * target; + } + SDL_free(cvt.buf); + signal_to_noise = 10 * SDL_log10(sum_squared_value / sum_squared_error); /* decibel */ + SDLTest_AssertCheck(isfinite(sum_squared_value), "Sum of squared target should be finite."); + SDLTest_AssertCheck(isfinite(sum_squared_error), "Sum of squared error should be finite."); + /* Infinity is theoretically possible when there is very little to no noise */ + SDLTest_AssertCheck(!isnan(signal_to_noise), "Signal-to-noise ratio should not be NaN."); + SDLTest_AssertCheck(isfinite(max_error), "Maximum conversion error should be finite."); + SDLTest_AssertCheck(signal_to_noise >= spec->signal_to_noise, "Conversion signal-to-noise ratio %f dB should be no less than %f dB.", + signal_to_noise, spec->signal_to_noise); + SDLTest_AssertCheck(max_error <= spec->max_error, "Maximum conversion error %f should be no more than %f.", + max_error, spec->max_error); + } + + return TEST_COMPLETED; +} /* ================= Test Case References ================== */ /* Audio test cases */ -static const SDLTest_TestCaseReference audioTest1 = - { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevices, "audio_enumerateAndNameAudioDevices", "Enumerate and name available audio devices (output and capture)", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest1 = { + (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevices, "audio_enumerateAndNameAudioDevices", "Enumerate and name available audio devices (output and capture)", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest2 = - { (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevicesNegativeTests, "audio_enumerateAndNameAudioDevicesNegativeTests", "Negative tests around enumeration and naming of audio devices.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest2 = { + (SDLTest_TestCaseFp)audio_enumerateAndNameAudioDevicesNegativeTests, "audio_enumerateAndNameAudioDevicesNegativeTests", "Negative tests around enumeration and naming of audio devices.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest3 = - { (SDLTest_TestCaseFp)audio_printAudioDrivers, "audio_printAudioDrivers", "Checks available audio driver names.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest3 = { + (SDLTest_TestCaseFp)audio_printAudioDrivers, "audio_printAudioDrivers", "Checks available audio driver names.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest4 = - { (SDLTest_TestCaseFp)audio_printCurrentAudioDriver, "audio_printCurrentAudioDriver", "Checks current audio driver name with initialized audio.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest4 = { + (SDLTest_TestCaseFp)audio_printCurrentAudioDriver, "audio_printCurrentAudioDriver", "Checks current audio driver name with initialized audio.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest5 = - { (SDLTest_TestCaseFp)audio_buildAudioCVT, "audio_buildAudioCVT", "Builds various audio conversion structures.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest5 = { + (SDLTest_TestCaseFp)audio_buildAudioCVT, "audio_buildAudioCVT", "Builds various audio conversion structures.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest6 = - { (SDLTest_TestCaseFp)audio_buildAudioCVTNegative, "audio_buildAudioCVTNegative", "Checks calls with invalid input to SDL_BuildAudioCVT", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest6 = { + (SDLTest_TestCaseFp)audio_buildAudioCVTNegative, "audio_buildAudioCVTNegative", "Checks calls with invalid input to SDL_BuildAudioCVT", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest7 = - { (SDLTest_TestCaseFp)audio_getAudioStatus, "audio_getAudioStatus", "Checks current audio status.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest7 = { + (SDLTest_TestCaseFp)audio_getAudioStatus, "audio_getAudioStatus", "Checks current audio status.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest8 = - { (SDLTest_TestCaseFp)audio_openCloseAndGetAudioStatus, "audio_openCloseAndGetAudioStatus", "Opens and closes audio device and get audio status.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest8 = { + (SDLTest_TestCaseFp)audio_openCloseAndGetAudioStatus, "audio_openCloseAndGetAudioStatus", "Opens and closes audio device and get audio status.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest9 = - { (SDLTest_TestCaseFp)audio_lockUnlockOpenAudioDevice, "audio_lockUnlockOpenAudioDevice", "Locks and unlocks an open audio device.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest9 = { + (SDLTest_TestCaseFp)audio_lockUnlockOpenAudioDevice, "audio_lockUnlockOpenAudioDevice", "Locks and unlocks an open audio device.", TEST_ENABLED +}; /* TODO: enable test when SDL_ConvertAudio segfaults on cygwin have been fixed. */ /* For debugging, test case can be run manually using --filter audio_convertAudio */ -static const SDLTest_TestCaseReference audioTest10 = - { (SDLTest_TestCaseFp)audio_convertAudio, "audio_convertAudio", "Convert audio using available formats.", TEST_DISABLED }; +static const SDLTest_TestCaseReference audioTest10 = { + (SDLTest_TestCaseFp)audio_convertAudio, "audio_convertAudio", "Convert audio using available formats.", TEST_DISABLED +}; /* TODO: enable test when SDL_AudioDeviceConnected has been implemented. */ -static const SDLTest_TestCaseReference audioTest11 = - { (SDLTest_TestCaseFp)audio_openCloseAudioDeviceConnected, "audio_openCloseAudioDeviceConnected", "Opens and closes audio device and get connected status.", TEST_DISABLED }; +static const SDLTest_TestCaseReference audioTest11 = { + (SDLTest_TestCaseFp)audio_openCloseAudioDeviceConnected, "audio_openCloseAudioDeviceConnected", "Opens and closes audio device and get connected status.", TEST_DISABLED +}; -static const SDLTest_TestCaseReference audioTest12 = - { (SDLTest_TestCaseFp)audio_quitInitAudioSubSystem, "audio_quitInitAudioSubSystem", "Quit and re-init audio subsystem.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest12 = { + (SDLTest_TestCaseFp)audio_quitInitAudioSubSystem, "audio_quitInitAudioSubSystem", "Quit and re-init audio subsystem.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest13 = - { (SDLTest_TestCaseFp)audio_initQuitAudio, "audio_initQuitAudio", "Init and quit audio drivers directly.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest13 = { + (SDLTest_TestCaseFp)audio_initQuitAudio, "audio_initQuitAudio", "Init and quit audio drivers directly.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest14 = - { (SDLTest_TestCaseFp)audio_initOpenCloseQuitAudio, "audio_initOpenCloseQuitAudio", "Cycle through init, open, close and quit with various audio specs.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest14 = { + (SDLTest_TestCaseFp)audio_initOpenCloseQuitAudio, "audio_initOpenCloseQuitAudio", "Cycle through init, open, close and quit with various audio specs.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference audioTest15 = - { (SDLTest_TestCaseFp)audio_pauseUnpauseAudio, "audio_pauseUnpauseAudio", "Pause and Unpause audio for various audio specs while testing callback.", TEST_ENABLED }; +static const SDLTest_TestCaseReference audioTest15 = { + (SDLTest_TestCaseFp)audio_pauseUnpauseAudio, "audio_pauseUnpauseAudio", "Pause and Unpause audio for various audio specs while testing callback.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference audioTest16 = { + (SDLTest_TestCaseFp)audio_resampleLoss, "audio_resampleLoss", "Check signal-to-noise ratio and maximum error of audio resampling.", TEST_ENABLED +}; /* Sequence of Audio test cases */ -static const SDLTest_TestCaseReference *audioTests[] = { +static const SDLTest_TestCaseReference *audioTests[] = { &audioTest1, &audioTest2, &audioTest3, &audioTest4, &audioTest5, &audioTest6, &audioTest7, &audioTest8, &audioTest9, &audioTest10, &audioTest11, - &audioTest12, &audioTest13, &audioTest14, &audioTest15, NULL + &audioTest12, &audioTest13, &audioTest14, &audioTest15, &audioTest16, NULL }; /* Audio test suite (global) */ diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 76090d1ea8b7f..ce8ea1bd3da8b 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -18,8 +18,7 @@ * \sa * http://wiki.libsdl.org/SDL_HasClipboardText */ -int -clipboard_testHasClipboardText(void *arg) +int clipboard_testHasClipboardText(void *arg) { SDL_HasClipboardText(); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); @@ -33,8 +32,7 @@ clipboard_testHasClipboardText(void *arg) * \sa * http://wiki.libsdl.org/SDL_HasPrimarySelectionText */ -int -clipboard_testHasPrimarySelectionText(void *arg) +int clipboard_testHasPrimarySelectionText(void *arg) { SDL_HasPrimarySelectionText(); SDLTest_AssertPass("Call to SDL_HasPrimarySelectionText succeeded"); @@ -48,8 +46,7 @@ clipboard_testHasPrimarySelectionText(void *arg) * \sa * http://wiki.libsdl.org/SDL_GetClipboardText */ -int -clipboard_testGetClipboardText(void *arg) +int clipboard_testGetClipboardText(void *arg) { char *charResult; charResult = SDL_GetClipboardText(); @@ -66,8 +63,7 @@ clipboard_testGetClipboardText(void *arg) * \sa * http://wiki.libsdl.org/SDL_GetPrimarySelectionText */ -int -clipboard_testGetPrimarySelectionText(void *arg) +int clipboard_testGetPrimarySelectionText(void *arg) { char *charResult; charResult = SDL_GetPrimarySelectionText(); @@ -83,13 +79,12 @@ clipboard_testGetPrimarySelectionText(void *arg) * \sa * http://wiki.libsdl.org/SDL_SetClipboardText */ -int -clipboard_testSetClipboardText(void *arg) +int clipboard_testSetClipboardText(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); int result; - result = SDL_SetClipboardText((const char *)text); + result = SDL_SetClipboardText(text); SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); SDLTest_AssertCheck( result == 0, @@ -112,13 +107,12 @@ clipboard_testSetClipboardText(void *arg) * \sa * http://wiki.libsdl.org/SDL_SetPrimarySelectionText */ -int -clipboard_testSetPrimarySelectionText(void *arg) +int clipboard_testSetPrimarySelectionText(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); int result; - result = SDL_SetPrimarySelectionText((const char *)text); + result = SDL_SetPrimarySelectionText(text); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText succeeded"); SDLTest_AssertCheck( result == 0, @@ -143,8 +137,7 @@ clipboard_testSetPrimarySelectionText(void *arg) * http://wiki.libsdl.org/SDL_GetClipboardText * http://wiki.libsdl.org/SDL_SetClipboardText */ -int -clipboard_testClipboardTextFunctions(void *arg) +int clipboard_testClipboardTextFunctions(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); @@ -156,7 +149,7 @@ clipboard_testClipboardTextFunctions(void *arg) boolResult = SDL_HasClipboardText(); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); if (boolResult == SDL_TRUE) { - intResult = SDL_SetClipboardText((const char *)NULL); + intResult = SDL_SetClipboardText(NULL); SDLTest_AssertPass("Call to SDL_SetClipboardText(NULL) succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -176,14 +169,14 @@ clipboard_testClipboardTextFunctions(void *arg) /* Empty clipboard */ charResult = SDL_GetClipboardText(); SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded"); - SDLTest_AssertCheck( + SDLTest_Assert( charResult != NULL, "Verify SDL_GetClipboardText did not return NULL"); SDLTest_AssertCheck( - charResult[0] == '\0', + charResult[0] == '\0', /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ "Verify SDL_GetClipboardText returned string with length 0, got length %i", - (int) SDL_strlen(charResult)); - intResult = SDL_SetClipboardText((const char *)text); + (int)SDL_strlen(charResult)); + intResult = SDL_SetClipboardText(text); SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -222,8 +215,7 @@ clipboard_testClipboardTextFunctions(void *arg) * http://wiki.libsdl.org/SDL_GetPrimarySelectionText * http://wiki.libsdl.org/SDL_SetPrimarySelectionText */ -int -clipboard_testPrimarySelectionTextFunctions(void *arg) +int clipboard_testPrimarySelectionTextFunctions(void *arg) { char *textRef = SDLTest_RandomAsciiString(); char *text = SDL_strdup(textRef); @@ -235,7 +227,7 @@ clipboard_testPrimarySelectionTextFunctions(void *arg) boolResult = SDL_HasPrimarySelectionText(); SDLTest_AssertPass("Call to SDL_HasPrimarySelectionText succeeded"); if (boolResult == SDL_TRUE) { - intResult = SDL_SetPrimarySelectionText((const char *)NULL); + intResult = SDL_SetPrimarySelectionText(NULL); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText(NULL) succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -255,14 +247,14 @@ clipboard_testPrimarySelectionTextFunctions(void *arg) /* Empty primary selection */ charResult = SDL_GetPrimarySelectionText(); SDLTest_AssertPass("Call to SDL_GetPrimarySelectionText succeeded"); - SDLTest_AssertCheck( + SDLTest_Assert( charResult != NULL, "Verify SDL_GetPrimarySelectionText did not return NULL"); SDLTest_AssertCheck( - charResult[0] == '\0', + charResult[0] == '\0', /* NOLINT(clang-analyzer-core.NullDereference): Checked for NULL above */ "Verify SDL_GetPrimarySelectionText returned string with length 0, got length %i", - (int) SDL_strlen(charResult)); - intResult = SDL_SetPrimarySelectionText((const char *)text); + (int)SDL_strlen(charResult)); + intResult = SDL_SetPrimarySelectionText(text); SDLTest_AssertPass("Call to SDL_SetPrimarySelectionText succeeded"); SDLTest_AssertCheck( intResult == 0, @@ -294,36 +286,43 @@ clipboard_testPrimarySelectionTextFunctions(void *arg) return TEST_COMPLETED; } - /* ================= Test References ================== */ /* Clipboard test cases */ -static const SDLTest_TestCaseReference clipboardTest1 = - { (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest1 = { + (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest2 = - { (SDLTest_TestCaseFp)clipboard_testHasPrimarySelectionText, "clipboard_testHasPrimarySelectionText", "Check call to SDL_HasPrimarySelectionText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest2 = { + (SDLTest_TestCaseFp)clipboard_testHasPrimarySelectionText, "clipboard_testHasPrimarySelectionText", "Check call to SDL_HasPrimarySelectionText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest3 = - { (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest3 = { + (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest4 = - { (SDLTest_TestCaseFp)clipboard_testGetPrimarySelectionText, "clipboard_testGetPrimarySelectionText", "Check call to SDL_GetPrimarySelectionText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest4 = { + (SDLTest_TestCaseFp)clipboard_testGetPrimarySelectionText, "clipboard_testGetPrimarySelectionText", "Check call to SDL_GetPrimarySelectionText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest5 = - { (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest5 = { + (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest6 = - { (SDLTest_TestCaseFp)clipboard_testSetPrimarySelectionText, "clipboard_testSetPrimarySelectionText", "Check call to SDL_SetPrimarySelectionText", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest6 = { + (SDLTest_TestCaseFp)clipboard_testSetPrimarySelectionText, "clipboard_testSetPrimarySelectionText", "Check call to SDL_SetPrimarySelectionText", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest7 = - { (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest7 = { + (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED +}; -static const SDLTest_TestCaseReference clipboardTest8 = - { (SDLTest_TestCaseFp)clipboard_testPrimarySelectionTextFunctions, "clipboard_testPrimarySelectionTextFunctions", "End-to-end test of SDL_xyzPrimarySelectionText functions", TEST_ENABLED }; +static const SDLTest_TestCaseReference clipboardTest8 = { + (SDLTest_TestCaseFp)clipboard_testPrimarySelectionTextFunctions, "clipboard_testPrimarySelectionTextFunctions", "End-to-end test of SDL_xyzPrimarySelectionText functions", TEST_ENABLED +}; /* Sequence of Clipboard test cases */ -static const SDLTest_TestCaseReference *clipboardTests[] = { +static const SDLTest_TestCaseReference *clipboardTests[] = { &clipboardTest1, &clipboardTest2, &clipboardTest3, &clipboardTest4, &clipboardTest5, &clipboardTest6, &clipboardTest7, &clipboardTest8, NULL }; diff --git a/test/testautomation_events.c b/test/testautomation_events.c index 20f2ea5e4ee78..d4babdafcefee 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -27,16 +27,16 @@ int _userdataValue2 = 2; /* Event filter that sets some flags and optionally checks userdata */ int SDLCALL _events_sampleNullEventFilter(void *userdata, SDL_Event *event) { - _eventFilterCalled = 1; + _eventFilterCalled = 1; - if (_userdataCheck != 0) { - SDLTest_AssertCheck(userdata != NULL, "Check userdata pointer, expected: non-NULL, got: %s", (userdata != NULL) ? "non-NULL" : "NULL"); - if (userdata != NULL) { - SDLTest_AssertCheck(*(int *)userdata == _userdataValue, "Check userdata value, expected: %i, got: %i", _userdataValue, *(int *)userdata); - } - } + if (_userdataCheck != 0) { + SDLTest_AssertCheck(userdata != NULL, "Check userdata pointer, expected: non-NULL, got: %s", (userdata != NULL) ? "non-NULL" : "NULL"); + if (userdata != NULL) { + SDLTest_AssertCheck(*(int *)userdata == _userdataValue, "Check userdata value, expected: %i, got: %i", _userdataValue, *(int *)userdata); + } + } - return 0; + return 0; } /** @@ -45,34 +45,36 @@ int SDLCALL _events_sampleNullEventFilter(void *userdata, SDL_Event *event) * @sa http://wiki.libsdl.org/SDL_PumpEvents * @sa http://wiki.libsdl.org/SDL_PollEvent */ -int -events_pushPumpAndPollUserevent(void *arg) +int events_pushPumpAndPollUserevent(void *arg) { - SDL_Event event1; - SDL_Event event2; - int result; - - /* Create user event */ - event1.type = SDL_USEREVENT; - event1.user.code = SDLTest_RandomSint32(); - event1.user.data1 = (void *)&_userdataValue1; - event1.user.data2 = (void *)&_userdataValue2; - - /* Push a user event onto the queue and force queue update */ - SDL_PushEvent(&event1); - SDLTest_AssertPass("Call to SDL_PushEvent()"); - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - - /* Poll for user event */ - result = SDL_PollEvent(&event2); - SDLTest_AssertPass("Call to SDL_PollEvent()"); - SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result); - - return TEST_COMPLETED; + SDL_Event event1; + SDL_Event event2; + int result; + + /* Create user event */ + event1.type = SDL_USEREVENT; + event1.user.code = SDLTest_RandomSint32(); + event1.user.data1 = (void *)&_userdataValue1; + event1.user.data2 = (void *)&_userdataValue2; + + /* Push a user event onto the queue and force queue update */ + SDL_PushEvent(&event1); + SDLTest_AssertPass("Call to SDL_PushEvent()"); + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + + /* Poll for user event */ + result = SDL_PollEvent(&event2); + SDLTest_AssertPass("Call to SDL_PollEvent()"); + SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result); + + /* Need to finish getting all events and sentinel, otherwise other tests that rely on event are in bad state */ + while (SDL_PollEvent(&event2)) { + } + + return TEST_COMPLETED; } - /** * @brief Adds and deletes an event watch function with NULL userdata * @@ -80,47 +82,46 @@ events_pushPumpAndPollUserevent(void *arg) * @sa http://wiki.libsdl.org/SDL_DelEventWatch * */ -int -events_addDelEventWatch(void *arg) +int events_addDelEventWatch(void *arg) { - SDL_Event event; - - /* Create user event */ - event.type = SDL_USEREVENT; - event.user.code = SDLTest_RandomSint32(); - event.user.data1 = (void *)&_userdataValue1; - event.user.data2 = (void *)&_userdataValue2; - - /* Disable userdata check */ - _userdataCheck = 0; - - /* Reset event filter call tracker */ - _eventFilterCalled = 0; - - /* Add watch */ - SDL_AddEventWatch(_events_sampleNullEventFilter, NULL); - SDLTest_AssertPass("Call to SDL_AddEventWatch()"); - - /* Push a user event onto the queue and force queue update */ - SDL_PushEvent(&event); - SDLTest_AssertPass("Call to SDL_PushEvent()"); - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called"); - - /* Delete watch */ - SDL_DelEventWatch(_events_sampleNullEventFilter, NULL); - SDLTest_AssertPass("Call to SDL_DelEventWatch()"); - - /* Push a user event onto the queue and force queue update */ - _eventFilterCalled = 0; - SDL_PushEvent(&event); - SDLTest_AssertPass("Call to SDL_PushEvent()"); - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called"); - - return TEST_COMPLETED; + SDL_Event event; + + /* Create user event */ + event.type = SDL_USEREVENT; + event.user.code = SDLTest_RandomSint32(); + event.user.data1 = (void *)&_userdataValue1; + event.user.data2 = (void *)&_userdataValue2; + + /* Disable userdata check */ + _userdataCheck = 0; + + /* Reset event filter call tracker */ + _eventFilterCalled = 0; + + /* Add watch */ + SDL_AddEventWatch(_events_sampleNullEventFilter, NULL); + SDLTest_AssertPass("Call to SDL_AddEventWatch()"); + + /* Push a user event onto the queue and force queue update */ + SDL_PushEvent(&event); + SDLTest_AssertPass("Call to SDL_PushEvent()"); + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called"); + + /* Delete watch */ + SDL_DelEventWatch(_events_sampleNullEventFilter, NULL); + SDLTest_AssertPass("Call to SDL_DelEventWatch()"); + + /* Push a user event onto the queue and force queue update */ + _eventFilterCalled = 0; + SDL_PushEvent(&event); + SDLTest_AssertPass("Call to SDL_PushEvent()"); + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called"); + + return TEST_COMPLETED; } /** @@ -130,65 +131,66 @@ events_addDelEventWatch(void *arg) * @sa http://wiki.libsdl.org/SDL_DelEventWatch * */ -int -events_addDelEventWatchWithUserdata(void *arg) +int events_addDelEventWatchWithUserdata(void *arg) { - SDL_Event event; - - /* Create user event */ - event.type = SDL_USEREVENT; - event.user.code = SDLTest_RandomSint32(); - event.user.data1 = (void *)&_userdataValue1; - event.user.data2 = (void *)&_userdataValue2; - - /* Enable userdata check and set a value to check */ - _userdataCheck = 1; - _userdataValue = SDLTest_RandomIntegerInRange(-1024, 1024); - - /* Reset event filter call tracker */ - _eventFilterCalled = 0; - - /* Add watch */ - SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); - SDLTest_AssertPass("Call to SDL_AddEventWatch()"); - - /* Push a user event onto the queue and force queue update */ - SDL_PushEvent(&event); - SDLTest_AssertPass("Call to SDL_PushEvent()"); - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called"); - - /* Delete watch */ - SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); - SDLTest_AssertPass("Call to SDL_DelEventWatch()"); - - /* Push a user event onto the queue and force queue update */ - _eventFilterCalled = 0; - SDL_PushEvent(&event); - SDLTest_AssertPass("Call to SDL_PushEvent()"); - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called"); - - return TEST_COMPLETED; + SDL_Event event; + + /* Create user event */ + event.type = SDL_USEREVENT; + event.user.code = SDLTest_RandomSint32(); + event.user.data1 = (void *)&_userdataValue1; + event.user.data2 = (void *)&_userdataValue2; + + /* Enable userdata check and set a value to check */ + _userdataCheck = 1; + _userdataValue = SDLTest_RandomIntegerInRange(-1024, 1024); + + /* Reset event filter call tracker */ + _eventFilterCalled = 0; + + /* Add watch */ + SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); + SDLTest_AssertPass("Call to SDL_AddEventWatch()"); + + /* Push a user event onto the queue and force queue update */ + SDL_PushEvent(&event); + SDLTest_AssertPass("Call to SDL_PushEvent()"); + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called"); + + /* Delete watch */ + SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue); + SDLTest_AssertPass("Call to SDL_DelEventWatch()"); + + /* Push a user event onto the queue and force queue update */ + _eventFilterCalled = 0; + SDL_PushEvent(&event); + SDLTest_AssertPass("Call to SDL_PushEvent()"); + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called"); + + return TEST_COMPLETED; } - /* ================= Test References ================== */ /* Events test cases */ -static const SDLTest_TestCaseReference eventsTest1 = - { (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED }; +static const SDLTest_TestCaseReference eventsTest1 = { + (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED +}; -static const SDLTest_TestCaseReference eventsTest2 = - { (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED }; +static const SDLTest_TestCaseReference eventsTest2 = { + (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED +}; -static const SDLTest_TestCaseReference eventsTest3 = - { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED }; +static const SDLTest_TestCaseReference eventsTest3 = { + (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED +}; /* Sequence of Events test cases */ -static const SDLTest_TestCaseReference *eventsTests[] = { +static const SDLTest_TestCaseReference *eventsTests[] = { &eventsTest1, &eventsTest2, &eventsTest3, NULL }; diff --git a/test/testautomation_guid.c b/test/testautomation_guid.c index bab2b9fd54379..81e60e8f4ba9f 100644 --- a/test/testautomation_guid.c +++ b/test/testautomation_guid.c @@ -5,36 +5,56 @@ #include "SDL.h" #include "SDL_test.h" +#ifdef HAVE_STDINT_H +#include +#endif + /* ================= Test Case Implementation ================== */ /* Helper functions */ #define NUM_TEST_GUIDS 5 -static struct { +#ifndef UINT64_C +#ifdef _MSC_VER +#define UINT64_C(x) x##ui64 +#elif defined(_LP64) +#define UINT64_C(x) x##UL +#else +#define UINT64_C(x) x##ULL +#endif +#endif + +static struct +{ char *str; Uint64 upper, lower; } test_guids[NUM_TEST_GUIDS] = { - { "0000000000000000" "ffffffffffffffff", - 0x0000000000000000, 0xfffffffffffffffflu }, - { "0011223344556677" "8091a2b3c4d5e6f0", - 0x0011223344556677lu, 0x8091a2b3c4d5e6f0lu }, - { "a011223344556677" "8091a2b3c4d5e6f0", - 0xa011223344556677lu, 0x8091a2b3c4d5e6f0lu }, - { "a011223344556677" "8091a2b3c4d5e6f1", - 0xa011223344556677lu, 0x8091a2b3c4d5e6f1lu }, - { "a011223344556677" "8191a2b3c4d5e6f0", - 0xa011223344556677lu, 0x8191a2b3c4d5e6f0lu }, + { "0000000000000000" + "ffffffffffffffff", + UINT64_C(0x0000000000000000), UINT64_C(0xffffffffffffffff) }, + { "0011223344556677" + "8091a2b3c4d5e6f0", + UINT64_C(0x0011223344556677), UINT64_C(0x8091a2b3c4d5e6f0) }, + { "a011223344556677" + "8091a2b3c4d5e6f0", + UINT64_C(0xa011223344556677), UINT64_C(0x8091a2b3c4d5e6f0) }, + { "a011223344556677" + "8091a2b3c4d5e6f1", + UINT64_C(0xa011223344556677), UINT64_C(0x8091a2b3c4d5e6f1) }, + { "a011223344556677" + "8191a2b3c4d5e6f0", + UINT64_C(0xa011223344556677), UINT64_C(0x8191a2b3c4d5e6f0) }, }; static void -upper_lower_to_bytestring(Uint8* out, Uint64 upper, Uint64 lower) +upper_lower_to_bytestring(Uint8 *out, Uint64 upper, Uint64 lower) { Uint64 values[2]; int i, k; values[0] = upper; - values [1] = lower; + values[1] = lower; for (i = 0; i < 2; ++i) { Uint64 v = values[i]; @@ -46,7 +66,6 @@ upper_lower_to_bytestring(Uint8* out, Uint64 upper, Uint64 lower) } } - /* Test case functions */ /** @@ -106,7 +125,7 @@ TestGuidToString(void *arg) SDL_GUIDToString(guid, guid_str, size); /* Check bytes before guid_str_buf */ - expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (fill_char << 24); + expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (((Uint32)fill_char) << 24); SDL_memcpy(&actual_prefix, guid_str_buf, 4); SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size); @@ -128,14 +147,16 @@ TestGuidToString(void *arg) /* ================= Test References ================== */ /* GUID routine test cases */ -static const SDLTest_TestCaseReference guidTest1 = - { (SDLTest_TestCaseFp)TestGuidFromString, "TestGuidFromString", "Call to SDL_GUIDFromString", TEST_ENABLED }; +static const SDLTest_TestCaseReference guidTest1 = { + (SDLTest_TestCaseFp)TestGuidFromString, "TestGuidFromString", "Call to SDL_GUIDFromString", TEST_ENABLED +}; -static const SDLTest_TestCaseReference guidTest2 = - { (SDLTest_TestCaseFp)TestGuidToString, "TestGuidToString", "Call to SDL_GUIDToString", TEST_ENABLED }; +static const SDLTest_TestCaseReference guidTest2 = { + (SDLTest_TestCaseFp)TestGuidToString, "TestGuidToString", "Call to SDL_GUIDToString", TEST_ENABLED +}; /* Sequence of GUID routine test cases */ -static const SDLTest_TestCaseReference *guidTests[] = { +static const SDLTest_TestCaseReference *guidTests[] = { &guidTest1, &guidTest2, NULL diff --git a/test/testautomation_hints.c b/test/testautomation_hints.c index c3f5ddfaa9969..a3888e4c1ec0d 100644 --- a/test/testautomation_hints.c +++ b/test/testautomation_hints.c @@ -7,9 +7,7 @@ #include "SDL.h" #include "SDL_test.h" - -const char* _HintsEnum[] = - { +const char *_HintsEnum[] = { SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_HINT_FRAMEBUFFER_ACCELERATION, SDL_HINT_GAMECONTROLLERCONFIG, @@ -33,9 +31,8 @@ const char* _HintsEnum[] = SDL_HINT_VIDEO_WIN_D3DCOMPILER, SDL_HINT_VIDEO_X11_XRANDR, SDL_HINT_XINPUT_ENABLED, - }; -const char* _HintsVerbose[] = - { +}; +const char *_HintsVerbose[] = { "SDL_ACCELEROMETER_AS_JOYSTICK", "SDL_FRAMEBUFFER_ACCELERATION", "SDL_GAMECONTROLLERCONFIG", @@ -59,7 +56,7 @@ const char* _HintsVerbose[] = "SDL_VIDEO_WIN_D3DCOMPILER", "SDL_VIDEO_X11_XRANDR", "SDL_XINPUT_ENABLED" - }; +}; SDL_COMPILE_TIME_ASSERT(HintsEnum, SDL_arraysize(_HintsEnum) == SDL_arraysize(_HintsVerbose)); @@ -70,193 +67,243 @@ const int _numHintsEnum = SDL_arraysize(_HintsEnum); /** * @brief Call to SDL_GetHint */ -int -hints_getHint(void *arg) +int hints_getHint(void *arg) { - const char *result1; - const char *result2; - int i; - - for (i=0; i<_numHintsEnum; i++) { - result1 = SDL_GetHint(_HintsEnum[i]); - SDLTest_AssertPass("Call to SDL_GetHint(%s) - using define definition", (char*)_HintsEnum[i]); - result2 = SDL_GetHint(_HintsVerbose[i]); - SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]); - SDLTest_AssertCheck( - (result1 == NULL && result2 == NULL) || (SDL_strcmp(result1, result2) == 0), - "Verify returned values are equal; got: result1='%s' result2='%s", - (result1 == NULL) ? "null" : result1, - (result2 == NULL) ? "null" : result2); - } + const char *result1; + const char *result2; + int i; + + for (i = 0; i < _numHintsEnum; i++) { + result1 = SDL_GetHint(_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using define definition", (char *)_HintsEnum[i]); + result2 = SDL_GetHint(_HintsVerbose[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char *)_HintsVerbose[i]); + SDLTest_AssertCheck( + (result1 == NULL && result2 == NULL) || (SDL_strcmp(result1, result2) == 0), + "Verify returned values are equal; got: result1='%s' result2='%s", + (result1 == NULL) ? "null" : result1, + (result2 == NULL) ? "null" : result2); + } - return TEST_COMPLETED; + return TEST_COMPLETED; } +typedef struct { + char *name; + char *value; + char *oldValue; +} HintCallbackContext; + static void SDLCALL hints_testHintChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { - *(char **)userdata = hint ? SDL_strdup(hint) : NULL; + HintCallbackContext *context = userdata; + + context->name = name ? SDL_strdup(name) : NULL; + context->value = hint ? SDL_strdup(hint) : NULL; + context->oldValue = oldValue ? SDL_strdup(oldValue) : NULL; } /** * @brief Call to SDL_SetHint */ -int -hints_setHint(void *arg) +int hints_setHint(void *arg) { - const char *testHint = "SDL_AUTOMATED_TEST_HINT"; - const char *originalValue; - char *value; - const char *testValue; - char *callbackValue; - SDL_bool result; - int i, j; - - /* Create random values to set */ - value = SDLTest_RandomAsciiStringOfSize(10); - - for (i=0; i<_numHintsEnum; i++) { - /* Capture current value */ - originalValue = SDL_GetHint(_HintsEnum[i]); - SDLTest_AssertPass("Call to SDL_GetHint(%s)", _HintsEnum[i]); - - /* Copy the original value, since it will be freed when we set it again */ - originalValue = originalValue ? SDL_strdup(originalValue) : NULL; - - /* Set value (twice) */ - for (j=1; j<=2; j++) { - result = SDL_SetHint(_HintsEnum[i], value); - SDLTest_AssertPass("Call to SDL_SetHint(%s, %s) (iteration %i)", _HintsEnum[i], value, j); - SDLTest_AssertCheck( - result == SDL_TRUE || result == SDL_FALSE, - "Verify valid result was returned, got: %i", - (int)result); - testValue = SDL_GetHint(_HintsEnum[i]); - SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", _HintsVerbose[i]); - SDLTest_AssertCheck( - (SDL_strcmp(value, testValue) == 0), - "Verify returned value equals set value; got: testValue='%s' value='%s", - (testValue == NULL) ? "null" : testValue, - value); + const char *testHint = "SDL_AUTOMATED_TEST_HINT"; + const char *originalValue; + char *value; + const char *testValue; + HintCallbackContext callback_data; + SDL_bool result; + int i, j; + + /* Create random values to set */ + value = SDLTest_RandomAsciiStringOfSize(10); + + for (i = 0; i < _numHintsEnum; i++) { + /* Capture current value */ + originalValue = SDL_GetHint(_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s)", _HintsEnum[i]); + + /* Copy the original value, since it will be freed when we set it again */ + originalValue = originalValue ? SDL_strdup(originalValue) : NULL; + + /* Set value (twice) */ + for (j = 1; j <= 2; j++) { + result = SDL_SetHint(_HintsEnum[i], value); + SDLTest_AssertPass("Call to SDL_SetHint(%s, %s) (iteration %i)", _HintsEnum[i], value, j); + SDLTest_AssertCheck( + result == SDL_TRUE || result == SDL_FALSE, + "Verify valid result was returned, got: %i", + (int)result); + testValue = SDL_GetHint(_HintsEnum[i]); + SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", _HintsVerbose[i]); + SDLTest_AssertCheck( + (SDL_strcmp(value, testValue) == 0), + "Verify returned value equals set value; got: testValue='%s' value='%s", + (testValue == NULL) ? "null" : testValue, + value); + } + + /* Reset original value */ + result = SDL_SetHint(_HintsEnum[i], originalValue); + SDLTest_AssertPass("Call to SDL_SetHint(%s, originalValue)", _HintsEnum[i]); + SDLTest_AssertCheck( + result == SDL_TRUE || result == SDL_FALSE, + "Verify valid result was returned, got: %i", + (int)result); + SDL_free((void *)originalValue); } - /* Reset original value */ - result = SDL_SetHint(_HintsEnum[i], originalValue); - SDLTest_AssertPass("Call to SDL_SetHint(%s, originalValue)", _HintsEnum[i]); + SDL_free(value); + + /* Set default value in environment */ + SDL_setenv(testHint, "original", 1); + + SDLTest_AssertPass("Call to SDL_GetHint() after saving and restoring hint"); + originalValue = SDL_GetHint(testHint); + value = (originalValue == NULL) ? NULL : SDL_strdup(originalValue); + result = SDL_SetHint(testHint, "temp"); + SDLTest_AssertCheck(!result, "SDL_SetHint(\"%s\", \"temp\") should return false", testHint); + result = SDL_SetHint(testHint, value); + SDLTest_AssertCheck(!result, "SDL_SetHint(\"%s\", \"%s\" should return false", testHint, value); + SDL_free(value); + testValue = SDL_GetHint(testHint); + SDLTest_AssertCheck( + testValue && SDL_strcmp(testValue, "original") == 0, + "testValue = %s, expected \"original\"", + testValue); + + SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_DEFAULT)"); + result = SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_DEFAULT); + SDLTest_AssertCheck(!result, "SDL_SetHintWithPriority(\"%s\", NULL, SDL_HINT_DEFAULT) should return false", testHint); + testValue = SDL_GetHint(testHint); + SDLTest_AssertCheck( + testValue && SDL_strcmp(testValue, "original") == 0, + "testValue = %s, expected \"original\"", + testValue); + + SDLTest_AssertPass("Call to SDL_SetHint(\"\", \"data\")"); + result = SDL_SetHint("", "data"); + SDLTest_AssertCheck(result, "SDL_SetHint(\"\", \"data\") should return true"); + testValue = SDL_GetHint(""); + SDLTest_AssertCheck( + testValue && SDL_strcmp(testValue, "data") == 0, + "testValue = %s, expected \"data\"", + testValue); + + SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE)"); + result = SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE); + SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint); + testValue = SDL_GetHint(testHint); + SDLTest_AssertCheck( + testValue && SDL_strcmp(testValue, "temp") == 0, + "testValue = %s, expected \"temp\"", + testValue); + + SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_OVERRIDE)"); + result = SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_OVERRIDE); + SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", NULL, SDL_HINT_OVERRIDE) should return true", testHint); + testValue = SDL_GetHint(testHint); + SDLTest_AssertCheck( + testValue == NULL, + "testValue = %s, expected NULL", + testValue); + + SDLTest_AssertPass("Call to SDL_ResetHint()"); + SDL_ResetHint(testHint); + testValue = SDL_GetHint(testHint); + SDLTest_AssertCheck( + testValue && SDL_strcmp(testValue, "original") == 0, + "testValue = %s, expected \"original\"", + testValue); + + /* Make sure callback functionality works past a reset */ + SDL_zero(callback_data); + SDLTest_AssertPass("Call to SDL_AddHintCallback()"); + SDL_AddHintCallback(testHint, hints_testHintChanged, &callback_data); + SDLTest_AssertCheck( + callback_data.name && SDL_strcmp(callback_data.name, testHint) == 0, + "callback_data.name = \"%s\", expected \"%s\"", + callback_data.name, testHint); + SDLTest_AssertCheck( + callback_data.value && SDL_strcmp(callback_data.value, "original") == 0, + "callback_data.value = \"%s\", expected \"%s\"", + callback_data.value, "original"); + SDL_free(callback_data.name); + SDL_free(callback_data.value); + SDL_free(callback_data.oldValue); + + SDLTest_AssertPass("Call to SDL_ResetHint(), using callback"); + SDL_zero(callback_data); + SDL_ResetHint(testHint); SDLTest_AssertCheck( - result == SDL_TRUE || result == SDL_FALSE, - "Verify valid result was returned, got: %i", - (int)result); - SDL_free((void *)originalValue); - } - - SDL_free(value); - - /* Set default value in environment */ - SDL_setenv(testHint, "original", 1); - - SDLTest_AssertPass("Call to SDL_GetHint() after saving and restoring hint"); - originalValue = SDL_GetHint(testHint); - value = (originalValue == NULL) ? NULL : SDL_strdup(originalValue); - SDL_SetHint(testHint, "temp"); - SDL_SetHint(testHint, value); - SDL_free(value); - testValue = SDL_GetHint(testHint); - SDLTest_AssertCheck( - testValue && SDL_strcmp(testValue, "original") == 0, - "testValue = %s, expected \"original\"", - testValue); - - SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_DEFAULT)"); - SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_DEFAULT); - testValue = SDL_GetHint(testHint); - SDLTest_AssertCheck( - testValue && SDL_strcmp(testValue, "original") == 0, - "testValue = %s, expected \"original\"", - testValue); - - SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE)"); - SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE); - testValue = SDL_GetHint(testHint); - SDLTest_AssertCheck( - testValue && SDL_strcmp(testValue, "temp") == 0, - "testValue = %s, expected \"temp\"", - testValue); - - SDLTest_AssertPass("Call to SDL_SetHintWithPriority(NULL, SDL_HINT_OVERRIDE)"); - SDL_SetHintWithPriority(testHint, NULL, SDL_HINT_OVERRIDE); - testValue = SDL_GetHint(testHint); - SDLTest_AssertCheck( - testValue == NULL, - "testValue = %s, expected NULL", - testValue); - - SDLTest_AssertPass("Call to SDL_ResetHint()"); - SDL_ResetHint(testHint); - testValue = SDL_GetHint(testHint); - SDLTest_AssertCheck( - testValue && SDL_strcmp(testValue, "original") == 0, - "testValue = %s, expected \"original\"", - testValue); - - /* Make sure callback functionality works past a reset */ - SDLTest_AssertPass("Call to SDL_AddHintCallback()"); - callbackValue = NULL; - SDL_AddHintCallback(testHint, hints_testHintChanged, &callbackValue); - SDLTest_AssertCheck( - callbackValue && SDL_strcmp(callbackValue, "original") == 0, - "callbackValue = %s, expected \"original\"", - callbackValue); - SDL_free(callbackValue); - - SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback"); - callbackValue = NULL; - SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE); - SDLTest_AssertCheck( - callbackValue && SDL_strcmp(callbackValue, "temp") == 0, - "callbackValue = %s, expected \"temp\"", - callbackValue); - SDL_free(callbackValue); - - SDLTest_AssertPass("Call to SDL_ResetHint(), using callback"); - callbackValue = NULL; - SDL_ResetHint(testHint); - SDLTest_AssertCheck( - callbackValue && SDL_strcmp(callbackValue, "original") == 0, - "callbackValue = %s, expected \"original\"", - callbackValue); - - SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback after reset"); - callbackValue = NULL; - SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE); - SDLTest_AssertCheck( - callbackValue && SDL_strcmp(callbackValue, "temp") == 0, - "callbackValue = %s, expected \"temp\"", - callbackValue); - SDL_free(callbackValue); - - SDLTest_AssertPass("Call to SDL_ResetHint(), after clearing callback"); - callbackValue = NULL; - SDL_DelHintCallback(testHint, hints_testHintChanged, &callbackValue); - SDL_ResetHint(testHint); - SDLTest_AssertCheck( - callbackValue == NULL, - "callbackValue = %s, expected \"(null)\"", - callbackValue); - - return TEST_COMPLETED; + callback_data.value && SDL_strcmp(callback_data.value, "original") == 0, + "callbackValue = %s, expected \"original\"", + callback_data.value); + SDL_free(callback_data.name); + SDL_free(callback_data.value); + SDL_free(callback_data.oldValue); + + SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback after reset"); + SDL_zero(callback_data); + result = SDL_SetHintWithPriority(testHint, "temp", SDL_HINT_OVERRIDE); + SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint); + SDLTest_AssertCheck( + callback_data.value && SDL_strcmp(callback_data.value, "temp") == 0, + "callbackValue = %s, expected \"temp\"", + callback_data.value); + SDL_free(callback_data.name); + SDL_free(callback_data.value); + SDL_free(callback_data.oldValue); + + SDLTest_AssertPass("Call to SDL_ResetHint(), after clearing callback"); + SDL_zero(callback_data); + SDL_DelHintCallback(testHint, hints_testHintChanged, &callback_data); + SDL_ResetHint(testHint); + SDLTest_AssertCheck( + !callback_data.value, + "callbackValue = %s, expected \"(null)\"", + callback_data.value); + SDL_free(callback_data.name); + SDL_free(callback_data.value); + SDL_free(callback_data.oldValue); + + /* Make sure callback functionality work with hint renamed in sdl3 */ + SDLTest_AssertPass("Call to SDL_AddHintCallback()"); + SDL_AddHintCallback(SDL_HINT_ALLOW_TOPMOST, hints_testHintChanged, &callback_data); + SDLTest_AssertPass("Call to SDL_SetHintWithPriority(\"temp\", SDL_HINT_OVERRIDE), using callback"); + SDL_zero(callback_data); + result = SDL_SetHintWithPriority(SDL_HINT_ALLOW_TOPMOST, "temp", SDL_HINT_OVERRIDE); + SDLTest_AssertCheck(result, "SDL_SetHintWithPriority(\"%s\", \"temp\", SDL_HINT_OVERRIDE) should return true", testHint); + SDLTest_AssertCheck( + callback_data.name && SDL_strcmp(callback_data.name, SDL_HINT_ALLOW_TOPMOST) == 0, + "callback_data.name = \"%s\", expected \"%s\"", + callback_data.name, SDL_HINT_ALLOW_TOPMOST); + SDLTest_AssertCheck( + callback_data.value && SDL_strcmp(callback_data.value, "temp") == 0, + "callback_data.value = \"%s\", expected \"%s\"", + callback_data.value, "temp"); + SDL_free(callback_data.name); + SDL_free(callback_data.value); + SDL_free(callback_data.oldValue); + SDL_ResetHint(testHint); + + return TEST_COMPLETED; } /* ================= Test References ================== */ /* Hints test cases */ -static const SDLTest_TestCaseReference hintsTest1 = - { (SDLTest_TestCaseFp)hints_getHint, "hints_getHint", "Call to SDL_GetHint", TEST_ENABLED }; +static const SDLTest_TestCaseReference hintsTest1 = { + (SDLTest_TestCaseFp)hints_getHint, "hints_getHint", "Call to SDL_GetHint", TEST_ENABLED +}; -static const SDLTest_TestCaseReference hintsTest2 = - { (SDLTest_TestCaseFp)hints_setHint, "hints_setHint", "Call to SDL_SetHint", TEST_ENABLED }; +static const SDLTest_TestCaseReference hintsTest2 = { + (SDLTest_TestCaseFp)hints_setHint, "hints_setHint", "Call to SDL_SetHint", TEST_ENABLED +}; /* Sequence of Hints test cases */ -static const SDLTest_TestCaseReference *hintsTests[] = { +static const SDLTest_TestCaseReference *hintsTests[] = { &hintsTest1, &hintsTest2, NULL }; diff --git a/test/testautomation_joystick.c b/test/testautomation_joystick.c index 3baa4ee58566a..8104c65066b95 100644 --- a/test/testautomation_joystick.c +++ b/test/testautomation_joystick.c @@ -72,11 +72,12 @@ TestVirtualJoystick(void *arg) /* ================= Test References ================== */ /* Joystick routine test cases */ -static const SDLTest_TestCaseReference joystickTest1 = - { (SDLTest_TestCaseFp)TestVirtualJoystick, "TestVirtualJoystick", "Test virtual joystick functionality", TEST_ENABLED }; +static const SDLTest_TestCaseReference joystickTest1 = { + (SDLTest_TestCaseFp)TestVirtualJoystick, "TestVirtualJoystick", "Test virtual joystick functionality", TEST_ENABLED +}; /* Sequence of Joystick routine test cases */ -static const SDLTest_TestCaseReference *joystickTests[] = { +static const SDLTest_TestCaseReference *joystickTests[] = { &joystickTest1, NULL }; diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index a83f536dda11a..bbbe4e7c7aa55 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -18,25 +18,24 @@ * * @sa http://wiki.libsdl.org/SDL_GetKeyboardState */ -int -keyboard_getKeyboardState(void *arg) +int keyboard_getKeyboardState(void *arg) { - int numkeys; - Uint8 *state; - - /* Case where numkeys pointer is NULL */ - state = (Uint8 *)SDL_GetKeyboardState(NULL); - SDLTest_AssertPass("Call to SDL_GetKeyboardState(NULL)"); - SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); - - /* Case where numkeys pointer is not NULL */ - numkeys = -1; - state = (Uint8 *)SDL_GetKeyboardState(&numkeys); - SDLTest_AssertPass("Call to SDL_GetKeyboardState(&numkeys)"); - SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); - SDLTest_AssertCheck(numkeys >= 0, "Validate that value of numkeys is >= 0, got: %i", numkeys); - - return TEST_COMPLETED; + int numkeys; + Uint8 *state; + + /* Case where numkeys pointer is NULL */ + state = (Uint8 *)SDL_GetKeyboardState(NULL); + SDLTest_AssertPass("Call to SDL_GetKeyboardState(NULL)"); + SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); + + /* Case where numkeys pointer is not NULL */ + numkeys = -1; + state = (Uint8 *)SDL_GetKeyboardState(&numkeys); + SDLTest_AssertPass("Call to SDL_GetKeyboardState(&numkeys)"); + SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL"); + SDLTest_AssertCheck(numkeys >= 0, "Validate that value of numkeys is >= 0, got: %i", numkeys); + + return TEST_COMPLETED; } /** @@ -44,14 +43,13 @@ keyboard_getKeyboardState(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetKeyboardFocus */ -int -keyboard_getKeyboardFocus(void *arg) +int keyboard_getKeyboardFocus(void *arg) { - /* Call, but ignore return value */ - SDL_GetKeyboardFocus(); - SDLTest_AssertPass("Call to SDL_GetKeyboardFocus()"); + /* Call, but ignore return value */ + SDL_GetKeyboardFocus(); + SDLTest_AssertPass("Call to SDL_GetKeyboardFocus()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -59,66 +57,64 @@ keyboard_getKeyboardFocus(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetKeyFromName */ -int -keyboard_getKeyFromName(void *arg) +int keyboard_getKeyFromName(void *arg) { - SDL_Keycode result; - - /* Case where Key is known, 1 character input */ - result = SDL_GetKeyFromName("A"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result); - - /* Case where Key is known, 2 character input */ - result = SDL_GetKeyFromName("F1"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/double)"); - SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_F1, result); - - /* Case where Key is known, 3 character input */ - result = SDL_GetKeyFromName("End"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/triple)"); - SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_END, result); - - /* Case where Key is known, 4 character input */ - result = SDL_GetKeyFromName("Find"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/quad)"); - SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_FIND, result); - - /* Case where Key is known, multiple character input */ - result = SDL_GetKeyFromName("AudioStop"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)"); - SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_AUDIOSTOP, result); - - /* Case where Key is unknown */ - result = SDL_GetKeyFromName("NotThere"); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(unknown)"); - SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); - - /* Case where input is NULL/invalid */ - result = SDL_GetKeyFromName(NULL); - SDLTest_AssertPass("Call to SDL_GetKeyFromName(NULL)"); - SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); - - return TEST_COMPLETED; + SDL_Keycode result; + + /* Case where Key is known, 1 character input */ + result = SDL_GetKeyFromName("A"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)"); + SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result); + + /* Case where Key is known, 2 character input */ + result = SDL_GetKeyFromName("F1"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/double)"); + SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_F1, result); + + /* Case where Key is known, 3 character input */ + result = SDL_GetKeyFromName("End"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/triple)"); + SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_END, result); + + /* Case where Key is known, 4 character input */ + result = SDL_GetKeyFromName("Find"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/quad)"); + SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_FIND, result); + + /* Case where Key is known, multiple character input */ + result = SDL_GetKeyFromName("AudioStop"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)"); + SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_AUDIOSTOP, result); + + /* Case where Key is unknown */ + result = SDL_GetKeyFromName("NotThere"); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(unknown)"); + SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); + + /* Case where input is NULL/invalid */ + result = SDL_GetKeyFromName(NULL); + SDLTest_AssertPass("Call to SDL_GetKeyFromName(NULL)"); + SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); + + return TEST_COMPLETED; } /* * Local helper to check for the invalid scancode error message */ -void -_checkInvalidScancodeError() +void _checkInvalidScancodeError(void) { - const char *expectedError = "Parameter 'scancode' is invalid"; - const char *error; - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - } + const char *expectedError = "Parameter 'scancode' is invalid"; + const char *error; + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + } } /** @@ -126,38 +122,37 @@ _checkInvalidScancodeError() * * @sa http://wiki.libsdl.org/SDL_GetKeyFromScancode */ -int -keyboard_getKeyFromScancode(void *arg) +int keyboard_getKeyFromScancode(void *arg) { - SDL_Keycode result; - - /* Case where input is valid */ - result = SDL_GetKeyFromScancode(SDL_SCANCODE_A); - SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result); - - /* Case where input is zero */ - result = SDL_GetKeyFromScancode(0); - SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)"); - SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); - - /* Clear error message */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - /* Case where input is invalid (too small) */ - result = SDL_GetKeyFromScancode(-999); - SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)"); - SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); - _checkInvalidScancodeError(); - - /* Case where input is invalid (too big) */ - result = SDL_GetKeyFromScancode(999); - SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)"); - SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); - _checkInvalidScancodeError(); - - return TEST_COMPLETED; + SDL_Keycode result; + + /* Case where input is valid */ + result = SDL_GetKeyFromScancode(SDL_SCANCODE_SPACE); + SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); + SDLTest_AssertCheck(result == SDLK_SPACE, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_SPACE, result); + + /* Case where input is zero */ + result = SDL_GetKeyFromScancode(0); + SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)"); + SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); + + /* Clear error message */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Case where input is invalid (too small) */ + result = SDL_GetKeyFromScancode(-999); + SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)"); + SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); + _checkInvalidScancodeError(); + + /* Case where input is invalid (too big) */ + result = SDL_GetKeyFromScancode(999); + SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)"); + SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); + _checkInvalidScancodeError(); + + return TEST_COMPLETED; } /** @@ -165,55 +160,54 @@ keyboard_getKeyFromScancode(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetKeyName */ -int -keyboard_getKeyName(void *arg) +int keyboard_getKeyName(void *arg) { - const char *result; - const char *expected; - - /* Case where key has a 1 character name */ - expected = "3"; - result = (char *)SDL_GetKeyName(SDLK_3); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - /* Case where key has a 2 character name */ - expected = "F1"; - result = (char *)SDL_GetKeyName(SDLK_F1); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - /* Case where key has a 3 character name */ - expected = "Cut"; - result = (char *)SDL_GetKeyName(SDLK_CUT); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - /* Case where key has a 4 character name */ - expected = "Down"; - result = (char *)SDL_GetKeyName(SDLK_DOWN); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - /* Case where key has a N character name */ - expected = "BrightnessUp"; - result = (char *)SDL_GetKeyName(SDLK_BRIGHTNESSUP); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - /* Case where key has a N character name with space */ - expected = "Keypad MemStore"; - result = (char *)SDL_GetKeyName(SDLK_KP_MEMSTORE); - SDLTest_AssertPass("Call to SDL_GetKeyName()"); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); - - return TEST_COMPLETED; + const char *result; + const char *expected; + + /* Case where key has a 1 character name */ + expected = "3"; + result = (char *)SDL_GetKeyName(SDLK_3); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + /* Case where key has a 2 character name */ + expected = "F1"; + result = (char *)SDL_GetKeyName(SDLK_F1); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + /* Case where key has a 3 character name */ + expected = "Cut"; + result = (char *)SDL_GetKeyName(SDLK_CUT); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + /* Case where key has a 4 character name */ + expected = "Down"; + result = (char *)SDL_GetKeyName(SDLK_DOWN); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + /* Case where key has a N character name */ + expected = "BrightnessUp"; + result = (char *)SDL_GetKeyName(SDLK_BRIGHTNESSUP); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + /* Case where key has a N character name with space */ + expected = "Keypad MemStore"; + result = (char *)SDL_GetKeyName(SDLK_KP_MEMSTORE); + SDLTest_AssertPass("Call to SDL_GetKeyName()"); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); + + return TEST_COMPLETED; } /** @@ -221,26 +215,25 @@ keyboard_getKeyName(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetScancodeName */ -int -keyboard_getScancodeNameNegative(void *arg) +int keyboard_getScancodeNameNegative(void *arg) { - SDL_Scancode scancode; - const char *result; - const char *expected = ""; - - /* Clear error message */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - /* Out-of-bounds scancode */ - scancode = (SDL_Scancode)SDL_NUM_SCANCODES; - result = (char *)SDL_GetScancodeName(scancode); - SDLTest_AssertPass("Call to SDL_GetScancodeName(%d/large)", scancode); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); - _checkInvalidScancodeError(); - - return TEST_COMPLETED; + SDL_Scancode scancode; + const char *result; + const char *expected = ""; + + /* Clear error message */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Out-of-bounds scancode */ + scancode = (SDL_Scancode)SDL_NUM_SCANCODES; + result = (char *)SDL_GetScancodeName(scancode); + SDLTest_AssertPass("Call to SDL_GetScancodeName(%d/large)", scancode); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); + _checkInvalidScancodeError(); + + return TEST_COMPLETED; } /** @@ -248,36 +241,35 @@ keyboard_getScancodeNameNegative(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetKeyName */ -int -keyboard_getKeyNameNegative(void *arg) +int keyboard_getKeyNameNegative(void *arg) { - SDL_Keycode keycode; - const char *result; - const char *expected = ""; - - /* Unknown keycode */ - keycode = SDLK_UNKNOWN; - result = (char *)SDL_GetKeyName(keycode); - SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/unknown)", keycode); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); - - /* Clear error message */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - /* Negative keycode */ - keycode = (SDL_Keycode)SDLTest_RandomIntegerInRange(-255, -1); - result = (char *)SDL_GetKeyName(keycode); - SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/negative)", keycode); - SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); - SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); - _checkInvalidScancodeError(); - - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - return TEST_COMPLETED; + SDL_Keycode keycode; + const char *result; + const char *expected = ""; + + /* Unknown keycode */ + keycode = SDLK_UNKNOWN; + result = (char *)SDL_GetKeyName(keycode); + SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/unknown)", keycode); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); + + /* Clear error message */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Negative keycode */ + keycode = (SDL_Keycode)SDLTest_RandomIntegerInRange(-255, -1); + result = (char *)SDL_GetKeyName(keycode); + SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/negative)", keycode); + SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); + SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result); + _checkInvalidScancodeError(); + + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + return TEST_COMPLETED; } /** @@ -286,106 +278,103 @@ keyboard_getKeyNameNegative(void *arg) * @sa http://wiki.libsdl.org/SDL_GetModState * @sa http://wiki.libsdl.org/SDL_SetModState */ -int -keyboard_getSetModState(void *arg) +int keyboard_getSetModState(void *arg) { - SDL_Keymod result; - SDL_Keymod currentState; - SDL_Keymod newState; - SDL_Keymod allStates = - KMOD_NONE | - KMOD_LSHIFT | - KMOD_RSHIFT | - KMOD_LCTRL | - KMOD_RCTRL | - KMOD_LALT | - KMOD_RALT | - KMOD_LGUI | - KMOD_RGUI | - KMOD_NUM | - KMOD_CAPS | - KMOD_MODE | - KMOD_SCROLL; - - /* Get state, cache for later reset */ - result = SDL_GetModState(); - SDLTest_AssertPass("Call to SDL_GetModState()"); - SDLTest_AssertCheck(/*result >= 0 &&*/ result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result); - currentState = result; - - /* Set random state */ - newState = SDLTest_RandomIntegerInRange(0, allStates); - SDL_SetModState(newState); - SDLTest_AssertPass("Call to SDL_SetModState(%i)", newState); - result = SDL_GetModState(); - SDLTest_AssertPass("Call to SDL_GetModState()"); - SDLTest_AssertCheck(result == newState, "Verify result from call is valid, expected: %i, got: %i", newState, result); - - /* Set zero state */ - SDL_SetModState(0); - SDLTest_AssertPass("Call to SDL_SetModState(0)"); - result = SDL_GetModState(); - SDLTest_AssertPass("Call to SDL_GetModState()"); - SDLTest_AssertCheck(result == 0, "Verify result from call is valid, expected: 0, got: %i", result); - - /* Revert back to cached current state if needed */ - if (currentState != 0) { - SDL_SetModState(currentState); - SDLTest_AssertPass("Call to SDL_SetModState(%i)", currentState); - result = SDL_GetModState(); - SDLTest_AssertPass("Call to SDL_GetModState()"); - SDLTest_AssertCheck(result == currentState, "Verify result from call is valid, expected: %i, got: %i", currentState, result); - } - - return TEST_COMPLETED; + SDL_Keymod result; + SDL_Keymod currentState; + SDL_Keymod newState; + SDL_Keymod allStates = + KMOD_NONE | + KMOD_LSHIFT | + KMOD_RSHIFT | + KMOD_LCTRL | + KMOD_RCTRL | + KMOD_LALT | + KMOD_RALT | + KMOD_LGUI | + KMOD_RGUI | + KMOD_NUM | + KMOD_CAPS | + KMOD_MODE | + KMOD_SCROLL; + + /* Get state, cache for later reset */ + result = SDL_GetModState(); + SDLTest_AssertPass("Call to SDL_GetModState()"); + SDLTest_AssertCheck(/*result >= 0 &&*/ result <= allStates, "Verify result from call is valid, expected: 0 <= result <= %i, got: %i", allStates, result); + currentState = result; + + /* Set random state */ + newState = SDLTest_RandomIntegerInRange(0, allStates); + SDL_SetModState(newState); + SDLTest_AssertPass("Call to SDL_SetModState(%i)", newState); + result = SDL_GetModState(); + SDLTest_AssertPass("Call to SDL_GetModState()"); + SDLTest_AssertCheck(result == newState, "Verify result from call is valid, expected: %i, got: %i", newState, result); + + /* Set zero state */ + SDL_SetModState(0); + SDLTest_AssertPass("Call to SDL_SetModState(0)"); + result = SDL_GetModState(); + SDLTest_AssertPass("Call to SDL_GetModState()"); + SDLTest_AssertCheck(result == 0, "Verify result from call is valid, expected: 0, got: %i", result); + + /* Revert back to cached current state if needed */ + if (currentState != 0) { + SDL_SetModState(currentState); + SDLTest_AssertPass("Call to SDL_SetModState(%i)", currentState); + result = SDL_GetModState(); + SDLTest_AssertPass("Call to SDL_GetModState()"); + SDLTest_AssertCheck(result == currentState, "Verify result from call is valid, expected: %i, got: %i", currentState, result); + } + + return TEST_COMPLETED; } - /** * @brief Check call to SDL_StartTextInput and SDL_StopTextInput * * @sa http://wiki.libsdl.org/SDL_StartTextInput * @sa http://wiki.libsdl.org/SDL_StopTextInput */ -int -keyboard_startStopTextInput(void *arg) +int keyboard_startStopTextInput(void *arg) { - /* Start-Stop */ - SDL_StartTextInput(); - SDLTest_AssertPass("Call to SDL_StartTextInput()"); - SDL_StopTextInput(); - SDLTest_AssertPass("Call to SDL_StopTextInput()"); - - /* Stop-Start */ - SDL_StartTextInput(); - SDLTest_AssertPass("Call to SDL_StartTextInput()"); - - /* Start-Start */ - SDL_StartTextInput(); - SDLTest_AssertPass("Call to SDL_StartTextInput()"); - - /* Stop-Stop */ - SDL_StopTextInput(); - SDLTest_AssertPass("Call to SDL_StopTextInput()"); - SDL_StopTextInput(); - SDLTest_AssertPass("Call to SDL_StopTextInput()"); - - return TEST_COMPLETED; + /* Start-Stop */ + SDL_StartTextInput(); + SDLTest_AssertPass("Call to SDL_StartTextInput()"); + SDL_StopTextInput(); + SDLTest_AssertPass("Call to SDL_StopTextInput()"); + + /* Stop-Start */ + SDL_StartTextInput(); + SDLTest_AssertPass("Call to SDL_StartTextInput()"); + + /* Start-Start */ + SDL_StartTextInput(); + SDLTest_AssertPass("Call to SDL_StartTextInput()"); + + /* Stop-Stop */ + SDL_StopTextInput(); + SDLTest_AssertPass("Call to SDL_StopTextInput()"); + SDL_StopTextInput(); + SDLTest_AssertPass("Call to SDL_StopTextInput()"); + + return TEST_COMPLETED; } /* Internal function to test SDL_SetTextInputRect */ void _testSetTextInputRect(SDL_Rect refRect) { - SDL_Rect testRect; - - testRect = refRect; - SDL_SetTextInputRect(&testRect); - SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%i,y:%i,w:%i,h:%i)", refRect.x, refRect.y, refRect.w, refRect.h); - SDLTest_AssertCheck( - (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), - "Check that input data was not modified, expected: x:%i,y:%i,w:%i,h:%i, got: x:%i,y:%i,w:%i,h:%i", - refRect.x, refRect.y, refRect.w, refRect.h, - testRect.x, testRect.y, testRect.w, testRect.h); + SDL_Rect testRect; + + testRect = refRect; + SDL_SetTextInputRect(&testRect); + SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%i,y:%i,w:%i,h:%i)", refRect.x, refRect.y, refRect.w, refRect.h); + SDLTest_AssertCheck( + (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), + "Check that input data was not modified, expected: x:%i,y:%i,w:%i,h:%i, got: x:%i,y:%i,w:%i,h:%i", + refRect.x, refRect.y, refRect.w, refRect.h, + testRect.x, testRect.y, testRect.w, testRect.h); } /** @@ -393,79 +382,78 @@ void _testSetTextInputRect(SDL_Rect refRect) * * @sa http://wiki.libsdl.org/SDL_SetTextInputRect */ -int -keyboard_setTextInputRect(void *arg) +int keyboard_setTextInputRect(void *arg) { - SDL_Rect refRect; - - /* Normal visible refRect, origin inside */ - refRect.x = SDLTest_RandomIntegerInRange(1, 50); - refRect.y = SDLTest_RandomIntegerInRange(1, 50); - refRect.w = SDLTest_RandomIntegerInRange(10, 50); - refRect.h = SDLTest_RandomIntegerInRange(10, 50); - _testSetTextInputRect(refRect); - - /* Normal visible refRect, origin 0,0 */ - refRect.x = 0; - refRect.y = 0; - refRect.w = SDLTest_RandomIntegerInRange(10, 50); - refRect.h = SDLTest_RandomIntegerInRange(10, 50); - _testSetTextInputRect(refRect); - - /* 1Pixel refRect */ - refRect.x = SDLTest_RandomIntegerInRange(10, 50); - refRect.y = SDLTest_RandomIntegerInRange(10, 50); - refRect.w = 1; - refRect.h = 1; - _testSetTextInputRect(refRect); - - /* 0pixel refRect */ - refRect.x = 1; - refRect.y = 1; - refRect.w = 1; - refRect.h = 0; - _testSetTextInputRect(refRect); - - /* 0pixel refRect */ - refRect.x = 1; - refRect.y = 1; - refRect.w = 0; - refRect.h = 1; - _testSetTextInputRect(refRect); - - /* 0pixel refRect */ - refRect.x = 1; - refRect.y = 1; - refRect.w = 0; - refRect.h = 0; - _testSetTextInputRect(refRect); - - /* 0pixel refRect */ - refRect.x = 0; - refRect.y = 0; - refRect.w = 0; - refRect.h = 0; - _testSetTextInputRect(refRect); - - /* negative refRect */ - refRect.x = SDLTest_RandomIntegerInRange(-200, -100); - refRect.y = SDLTest_RandomIntegerInRange(-200, -100); - refRect.w = 50; - refRect.h = 50; - _testSetTextInputRect(refRect); - - /* oversized refRect */ - refRect.x = SDLTest_RandomIntegerInRange(1, 50); - refRect.y = SDLTest_RandomIntegerInRange(1, 50); - refRect.w = 5000; - refRect.h = 5000; - _testSetTextInputRect(refRect); - - /* NULL refRect */ - SDL_SetTextInputRect(NULL); - SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); - - return TEST_COMPLETED; + SDL_Rect refRect; + + /* Normal visible refRect, origin inside */ + refRect.x = SDLTest_RandomIntegerInRange(1, 50); + refRect.y = SDLTest_RandomIntegerInRange(1, 50); + refRect.w = SDLTest_RandomIntegerInRange(10, 50); + refRect.h = SDLTest_RandomIntegerInRange(10, 50); + _testSetTextInputRect(refRect); + + /* Normal visible refRect, origin 0,0 */ + refRect.x = 0; + refRect.y = 0; + refRect.w = SDLTest_RandomIntegerInRange(10, 50); + refRect.h = SDLTest_RandomIntegerInRange(10, 50); + _testSetTextInputRect(refRect); + + /* 1Pixel refRect */ + refRect.x = SDLTest_RandomIntegerInRange(10, 50); + refRect.y = SDLTest_RandomIntegerInRange(10, 50); + refRect.w = 1; + refRect.h = 1; + _testSetTextInputRect(refRect); + + /* 0pixel refRect */ + refRect.x = 1; + refRect.y = 1; + refRect.w = 1; + refRect.h = 0; + _testSetTextInputRect(refRect); + + /* 0pixel refRect */ + refRect.x = 1; + refRect.y = 1; + refRect.w = 0; + refRect.h = 1; + _testSetTextInputRect(refRect); + + /* 0pixel refRect */ + refRect.x = 1; + refRect.y = 1; + refRect.w = 0; + refRect.h = 0; + _testSetTextInputRect(refRect); + + /* 0pixel refRect */ + refRect.x = 0; + refRect.y = 0; + refRect.w = 0; + refRect.h = 0; + _testSetTextInputRect(refRect); + + /* negative refRect */ + refRect.x = SDLTest_RandomIntegerInRange(-200, -100); + refRect.y = SDLTest_RandomIntegerInRange(-200, -100); + refRect.w = 50; + refRect.h = 50; + _testSetTextInputRect(refRect); + + /* oversized refRect */ + refRect.x = SDLTest_RandomIntegerInRange(1, 50); + refRect.y = SDLTest_RandomIntegerInRange(1, 50); + refRect.w = 5000; + refRect.h = 5000; + _testSetTextInputRect(refRect); + + /* NULL refRect */ + SDL_SetTextInputRect(NULL); + SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); + + return TEST_COMPLETED; } /** @@ -473,37 +461,38 @@ keyboard_setTextInputRect(void *arg) * * @sa http://wiki.libsdl.org/SDL_SetTextInputRect */ -int -keyboard_setTextInputRectNegative(void *arg) +int keyboard_setTextInputRectNegative(void *arg) { - /* Some platforms set also an error message; prepare for checking it */ -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA - const char *expectedError = "Parameter 'rect' is invalid"; - const char *error; - - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); -#endif - - /* NULL refRect */ - SDL_SetTextInputRect(NULL); - SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); - - /* Some platforms set also an error message; so check it */ -#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - } - - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); -#endif - - return TEST_COMPLETED; + int platform_sets_error_message = SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 || + SDL_strcmp(SDL_GetCurrentVideoDriver(), "android") == 0 || + SDL_strcmp(SDL_GetCurrentVideoDriver(), "cococa") == 0; + /* Some platforms set also an error message; prepare for checking it */ + const char *expectedError = "Parameter 'rect' is invalid"; + const char *error; + + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* NULL refRect */ + SDL_SetTextInputRect(NULL); + SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); + + /* Some platforms set also an error message; so check it */ + + if (platform_sets_error_message) { + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + } + } + + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + return TEST_COMPLETED; } /** @@ -512,22 +501,21 @@ keyboard_setTextInputRectNegative(void *arg) * @sa http://wiki.libsdl.org/SDL_GetScancodeFromKey * @sa http://wiki.libsdl.org/SDL_Keycode */ -int -keyboard_getScancodeFromKey(void *arg) +int keyboard_getScancodeFromKey(void *arg) { - SDL_Scancode scancode; + SDL_Scancode scancode; - /* Regular key */ - scancode = SDL_GetScancodeFromKey(SDLK_4); - SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_4)"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %i, got: %i", SDL_SCANCODE_4, scancode); + /* Regular key */ + scancode = SDL_GetScancodeFromKey(SDLK_4); + SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_4)"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %i, got: %i", SDL_SCANCODE_4, scancode); - /* Virtual key */ - scancode = SDL_GetScancodeFromKey(SDLK_PLUS); - SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_PLUS)"); - SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode); + /* Virtual key */ + scancode = SDL_GetScancodeFromKey(SDLK_PLUS); + SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_PLUS)"); + SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %i", scancode); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -536,71 +524,69 @@ keyboard_getScancodeFromKey(void *arg) * @sa http://wiki.libsdl.org/SDL_GetScancodeFromName * @sa http://wiki.libsdl.org/SDL_Keycode */ -int -keyboard_getScancodeFromName(void *arg) +int keyboard_getScancodeFromName(void *arg) { - SDL_Scancode scancode; - - /* Regular key, 1 character, first name in list */ - scancode = SDL_GetScancodeFromName("A"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('A')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_A, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_A, scancode); - - /* Regular key, 1 character */ - scancode = SDL_GetScancodeFromName("4"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('4')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_4, scancode); - - /* Regular key, 2 characters */ - scancode = SDL_GetScancodeFromName("F1"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('F1')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_F1, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_F1, scancode); - - /* Regular key, 3 characters */ - scancode = SDL_GetScancodeFromName("End"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('End')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_END, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_END, scancode); - - /* Regular key, 4 characters */ - scancode = SDL_GetScancodeFromName("Find"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Find')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_FIND, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_FIND, scancode); - - /* Regular key, several characters */ - scancode = SDL_GetScancodeFromName("Backspace"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Backspace')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_BACKSPACE, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_BACKSPACE, scancode); - - /* Regular key, several characters with space */ - scancode = SDL_GetScancodeFromName("Keypad Enter"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Keypad Enter')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_KP_ENTER, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_KP_ENTER, scancode); - - /* Regular key, last name in list */ - scancode = SDL_GetScancodeFromName("Sleep"); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Sleep')"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_SLEEP, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_SLEEP, scancode); - - return TEST_COMPLETED; + SDL_Scancode scancode; + + /* Regular key, 1 character, first name in list */ + scancode = SDL_GetScancodeFromName("A"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('A')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_A, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_A, scancode); + + /* Regular key, 1 character */ + scancode = SDL_GetScancodeFromName("4"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('4')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_4, scancode); + + /* Regular key, 2 characters */ + scancode = SDL_GetScancodeFromName("F1"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('F1')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_F1, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_F1, scancode); + + /* Regular key, 3 characters */ + scancode = SDL_GetScancodeFromName("End"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('End')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_END, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_END, scancode); + + /* Regular key, 4 characters */ + scancode = SDL_GetScancodeFromName("Find"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Find')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_FIND, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_FIND, scancode); + + /* Regular key, several characters */ + scancode = SDL_GetScancodeFromName("Backspace"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Backspace')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_BACKSPACE, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_BACKSPACE, scancode); + + /* Regular key, several characters with space */ + scancode = SDL_GetScancodeFromName("Keypad Enter"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Keypad Enter')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_KP_ENTER, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_KP_ENTER, scancode); + + /* Regular key, last name in list */ + scancode = SDL_GetScancodeFromName("Sleep"); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('Sleep')"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_SLEEP, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_SLEEP, scancode); + + return TEST_COMPLETED; } /* * Local helper to check for the invalid scancode error message */ -void -_checkInvalidNameError() +void _checkInvalidNameError(void) { - const char *expectedError = "Parameter 'name' is invalid"; - const char *error; - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - } + const char *expectedError = "Parameter 'name' is invalid"; + const char *error; + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError, error); + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + } } /** @@ -609,94 +595,105 @@ _checkInvalidNameError() * @sa http://wiki.libsdl.org/SDL_GetScancodeFromName * @sa http://wiki.libsdl.org/SDL_Keycode */ -int -keyboard_getScancodeFromNameNegative(void *arg) +int keyboard_getScancodeFromNameNegative(void *arg) { - const char *name; - SDL_Scancode scancode; - - /* Clear error message */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - - /* Random string input */ - name = SDLTest_RandomAsciiStringOfSize(32); - SDLTest_Assert(name != NULL, "Check that random name is not NULL"); - if (name == NULL) { - return TEST_ABORTED; - } - scancode = SDL_GetScancodeFromName(name); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName('%s')", name); - SDL_free((void *)name); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); - _checkInvalidNameError(); - - /* Zero length string input */ - name = ""; - scancode = SDL_GetScancodeFromName((const char *)name); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); - _checkInvalidNameError(); - - /* NULL input */ - name = NULL; - scancode = SDL_GetScancodeFromName((const char *)name); - SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); - _checkInvalidNameError(); - - return TEST_COMPLETED; + const char *name; + SDL_Scancode scancode; + + /* Clear error message */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Random string input */ + name = SDLTest_RandomAsciiStringOfSize(32); + SDLTest_Assert(name != NULL, "Check that random name is not NULL"); + if (name == NULL) { + return TEST_ABORTED; + } + scancode = SDL_GetScancodeFromName(name); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName('%s')", name); + SDL_free((void *)name); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); + _checkInvalidNameError(); + + /* Zero length string input */ + name = ""; + scancode = SDL_GetScancodeFromName(name); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); + _checkInvalidNameError(); + + /* NULL input */ + name = NULL; + scancode = SDL_GetScancodeFromName(name); + SDLTest_AssertPass("Call to SDL_GetScancodeFromName(NULL)"); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_UNKNOWN, "Validate return value from SDL_GetScancodeFromName, expected: %i, got: %i", SDL_SCANCODE_UNKNOWN, scancode); + _checkInvalidNameError(); + + return TEST_COMPLETED; } - - /* ================= Test References ================== */ /* Keyboard test cases */ -static const SDLTest_TestCaseReference keyboardTest1 = - { (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState with and without numkeys reference", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest1 = { + (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState with and without numkeys reference", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest2 = - { (SDLTest_TestCaseFp)keyboard_getKeyboardFocus, "keyboard_getKeyboardFocus", "Check call to SDL_GetKeyboardFocus", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest2 = { + (SDLTest_TestCaseFp)keyboard_getKeyboardFocus, "keyboard_getKeyboardFocus", "Check call to SDL_GetKeyboardFocus", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest3 = - { (SDLTest_TestCaseFp)keyboard_getKeyFromName, "keyboard_getKeyFromName", "Check call to SDL_GetKeyFromName for known, unknown and invalid name", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest3 = { + (SDLTest_TestCaseFp)keyboard_getKeyFromName, "keyboard_getKeyFromName", "Check call to SDL_GetKeyFromName for known, unknown and invalid name", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest4 = - { (SDLTest_TestCaseFp)keyboard_getKeyFromScancode, "keyboard_getKeyFromScancode", "Check call to SDL_GetKeyFromScancode", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest4 = { + (SDLTest_TestCaseFp)keyboard_getKeyFromScancode, "keyboard_getKeyFromScancode", "Check call to SDL_GetKeyFromScancode", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest5 = - { (SDLTest_TestCaseFp)keyboard_getKeyName, "keyboard_getKeyName", "Check call to SDL_GetKeyName", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest5 = { + (SDLTest_TestCaseFp)keyboard_getKeyName, "keyboard_getKeyName", "Check call to SDL_GetKeyName", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest6 = - { (SDLTest_TestCaseFp)keyboard_getSetModState, "keyboard_getSetModState", "Check call to SDL_GetModState and SDL_SetModState", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest6 = { + (SDLTest_TestCaseFp)keyboard_getSetModState, "keyboard_getSetModState", "Check call to SDL_GetModState and SDL_SetModState", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest7 = - { (SDLTest_TestCaseFp)keyboard_startStopTextInput, "keyboard_startStopTextInput", "Check call to SDL_StartTextInput and SDL_StopTextInput", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest7 = { + (SDLTest_TestCaseFp)keyboard_startStopTextInput, "keyboard_startStopTextInput", "Check call to SDL_StartTextInput and SDL_StopTextInput", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest8 = - { (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest8 = { + (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest9 = - { (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest9 = { + (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest10 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromKey, "keyboard_getScancodeFromKey", "Check call to SDL_GetScancodeFromKey", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest10 = { + (SDLTest_TestCaseFp)keyboard_getScancodeFromKey, "keyboard_getScancodeFromKey", "Check call to SDL_GetScancodeFromKey", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest11 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromName, "keyboard_getScancodeFromName", "Check call to SDL_GetScancodeFromName", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest11 = { + (SDLTest_TestCaseFp)keyboard_getScancodeFromName, "keyboard_getScancodeFromName", "Check call to SDL_GetScancodeFromName", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest12 = - { (SDLTest_TestCaseFp)keyboard_getScancodeFromNameNegative, "keyboard_getScancodeFromNameNegative", "Check call to SDL_GetScancodeFromName with invalid data", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest12 = { + (SDLTest_TestCaseFp)keyboard_getScancodeFromNameNegative, "keyboard_getScancodeFromNameNegative", "Check call to SDL_GetScancodeFromName with invalid data", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest13 = - { (SDLTest_TestCaseFp)keyboard_getKeyNameNegative, "keyboard_getKeyNameNegative", "Check call to SDL_GetKeyName with invalid data", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest13 = { + (SDLTest_TestCaseFp)keyboard_getKeyNameNegative, "keyboard_getKeyNameNegative", "Check call to SDL_GetKeyName with invalid data", TEST_ENABLED +}; -static const SDLTest_TestCaseReference keyboardTest14 = - { (SDLTest_TestCaseFp)keyboard_getScancodeNameNegative, "keyboard_getScancodeNameNegative", "Check call to SDL_GetScancodeName with invalid data", TEST_ENABLED }; +static const SDLTest_TestCaseReference keyboardTest14 = { + (SDLTest_TestCaseFp)keyboard_getScancodeNameNegative, "keyboard_getScancodeNameNegative", "Check call to SDL_GetScancodeName with invalid data", TEST_ENABLED +}; /* Sequence of Keyboard test cases */ -static const SDLTest_TestCaseReference *keyboardTests[] = { +static const SDLTest_TestCaseReference *keyboardTests[] = { &keyboardTest1, &keyboardTest2, &keyboardTest3, &keyboardTest4, &keyboardTest5, &keyboardTest6, &keyboardTest7, &keyboardTest8, &keyboardTest9, &keyboardTest10, &keyboardTest11, &keyboardTest12, &keyboardTest13, &keyboardTest14, NULL diff --git a/test/testautomation_log.c b/test/testautomation_log.c new file mode 100644 index 0000000000000..1ad1894e6d393 --- /dev/null +++ b/test/testautomation_log.c @@ -0,0 +1,209 @@ +/** + * Log test suite + */ +#include "SDL.h" +#include "SDL_test.h" + + +static SDL_LogOutputFunction original_function; +static void *original_userdata; + +static void SDLCALL TestLogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message) +{ + int *message_count = (int *)userdata; + ++(*message_count); +} + +static void EnableTestLog(int *message_count) +{ + *message_count = 0; + SDL_LogGetOutputFunction(&original_function, &original_userdata); + SDL_LogSetOutputFunction(TestLogOutput, message_count); +} + +static void DisableTestLog(void) +{ + SDL_LogSetOutputFunction(original_function, original_userdata); +} + +/* Fixture */ + +/* Test case functions */ + +/** + * Check SDL_HINT_LOGGING functionality + */ +static int log_testHint(void *arg) +{ + int count; + + SDL_SetHint(SDL_HINT_LOGGING, NULL); + SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, NULL)"); + { + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + } + + SDL_SetHint(SDL_HINT_LOGGING, "debug"); + SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"debug\")"); + { + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + } + + SDL_SetHint(SDL_HINT_LOGGING, "system=debug"); + SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"system=debug\")"); + { + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + } + + SDL_SetHint(SDL_HINT_LOGGING, "app=warn,system=debug,assert=quiet,*=info"); + SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"app=warn,system=debug,assert=quiet,*=info\")"); + { + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + } + + SDL_SetHint(SDL_HINT_LOGGING, "0=4,3=2,2=0,*=3"); + SDLTest_AssertPass("SDL_SetHint(SDL_HINT_LOGGING, \"0=4,3=2,2=0,*=3\")"); + { + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_ASSERT, SDL_LOG_PRIORITY_CRITICAL, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_INFO, \"test\")"); + SDLTest_AssertCheck(count == 1, "Check result value, expected: 1, got: %d", count); + + EnableTestLog(&count); + SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, "test"); + DisableTestLog(); + SDLTest_AssertPass("SDL_LogMessage(SDL_LOG_CATEGORY_CUSTOM, SDL_LOG_PRIORITY_DEBUG, \"test\")"); + SDLTest_AssertCheck(count == 0, "Check result value, expected: 0, got: %d", count); + + } + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Log test cases */ +static const SDLTest_TestCaseReference logTestHint = { + (SDLTest_TestCaseFp)log_testHint, "log_testHint", "Check SDL_HINT_LOGGING functionality", TEST_ENABLED +}; + +/* Sequence of Log test cases */ +static const SDLTest_TestCaseReference *logTests[] = { + &logTestHint, NULL +}; + +/* Timer test suite (global) */ +SDLTest_TestSuiteReference logTestSuite = { + "Log", + NULL, + logTests, + NULL +}; diff --git a/test/testautomation_main.c b/test/testautomation_main.c index 97d2352318293..78572d1a432c8 100644 --- a/test/testautomation_main.c +++ b/test/testautomation_main.c @@ -9,42 +9,13 @@ #include "SDL.h" #include "SDL_test.h" - -/* ! - * \brief Tests SDL_Init() and SDL_Quit() of Joystick and Haptic subsystems - * \sa - * http://wiki.libsdl.org/SDL_Init - * http://wiki.libsdl.org/SDL_Quit - */ -static int main_testInitQuitJoystickHaptic (void *arg) -{ -#if defined SDL_JOYSTICK_DISABLED || defined SDL_HAPTIC_DISABLED - return TEST_SKIPPED; -#else - int enabled_subsystems; - int initialized_subsystems = SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC; - - SDLTest_AssertCheck( SDL_Init(initialized_subsystems) == 0, "SDL_Init multiple systems." ); - - enabled_subsystems = SDL_WasInit(initialized_subsystems); - SDLTest_AssertCheck( enabled_subsystems == initialized_subsystems, "SDL_WasInit(SDL_INIT_EVERYTHING) contains all systems (%i)", enabled_subsystems ); - - SDL_Quit(); - - enabled_subsystems = SDL_WasInit(initialized_subsystems); - SDLTest_AssertCheck( enabled_subsystems == 0, "SDL_Quit should shut down everything (%i)", enabled_subsystems ); - - return TEST_COMPLETED; -#endif -} - /* ! * \brief Tests SDL_InitSubSystem() and SDL_QuitSubSystem() * \sa * http://wiki.libsdl.org/SDL_Init * http://wiki.libsdl.org/SDL_Quit */ -static int main_testInitQuitSubSystem (void *arg) +static int main_testInitQuitSubSystem(void *arg) { #if defined SDL_JOYSTICK_DISABLED || defined SDL_HAPTIC_DISABLED || defined SDL_GAMECONTROLLER_DISABLED return TEST_SKIPPED; @@ -56,15 +27,15 @@ static int main_testInitQuitSubSystem (void *arg) int initialized_system; int subsystem = subsystems[i]; - SDLTest_AssertCheck( (SDL_WasInit(subsystem) & subsystem) == 0, "SDL_WasInit(%x) before init should be false", subsystem ); - SDLTest_AssertCheck( SDL_InitSubSystem(subsystem) == 0, "SDL_InitSubSystem(%x)", subsystem ); + SDLTest_AssertCheck((SDL_WasInit(subsystem) & subsystem) == 0, "SDL_WasInit(%x) before init should be false", subsystem); + SDLTest_AssertCheck(SDL_InitSubSystem(subsystem) == 0, "SDL_InitSubSystem(%x)", subsystem); initialized_system = SDL_WasInit(subsystem); - SDLTest_AssertCheck( (initialized_system & subsystem) != 0, "SDL_WasInit(%x) should be true (%x)", subsystem, initialized_system ); + SDLTest_AssertCheck((initialized_system & subsystem) != 0, "SDL_WasInit(%x) should be true (%x)", subsystem, initialized_system); SDL_QuitSubSystem(subsystem); - SDLTest_AssertCheck( (SDL_WasInit(subsystem) & subsystem) == 0, "SDL_WasInit(%x) after shutdown should be false", subsystem ); + SDLTest_AssertCheck((SDL_WasInit(subsystem) & subsystem) == 0, "SDL_WasInit(%x) after shutdown should be false", subsystem); } return TEST_COMPLETED; @@ -72,7 +43,7 @@ static int main_testInitQuitSubSystem (void *arg) } const int joy_and_controller = SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER; -static int main_testImpliedJoystickInit (void *arg) +static int main_testImpliedJoystickInit(void *arg) { #if defined SDL_JOYSTICK_DISABLED || defined SDL_GAMECONTROLLER_DISABLED return TEST_SKIPPED; @@ -80,24 +51,24 @@ static int main_testImpliedJoystickInit (void *arg) int initialized_system; /* First initialize the controller */ - SDLTest_AssertCheck( (SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller" ); - SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)" ); + SDLTest_AssertCheck((SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller"); + SDLTest_AssertCheck(SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)"); /* Then make sure this implicitly initialized the joystick subsystem */ initialized_system = SDL_WasInit(joy_and_controller); - SDLTest_AssertCheck( (initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system ); + SDLTest_AssertCheck((initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system); /* Then quit the controller, and make sure that implicitly also quits the */ /* joystick subsystem */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); initialized_system = SDL_WasInit(joy_and_controller); - SDLTest_AssertCheck( (initialized_system & joy_and_controller) == 0, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system ); + SDLTest_AssertCheck((initialized_system & joy_and_controller) == 0, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system); return TEST_COMPLETED; #endif } -static int main_testImpliedJoystickQuit (void *arg) +static int main_testImpliedJoystickQuit(void *arg) { #if defined SDL_JOYSTICK_DISABLED || defined SDL_GAMECONTROLLER_DISABLED return TEST_SKIPPED; @@ -105,19 +76,19 @@ static int main_testImpliedJoystickQuit (void *arg) int initialized_system; /* First initialize the controller and the joystick (explicitly) */ - SDLTest_AssertCheck( (SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller" ); - SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0, "SDL_InitSubSystem(SDL_INIT_JOYSTICK)" ); - SDLTest_AssertCheck( SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)" ); + SDLTest_AssertCheck((SDL_WasInit(joy_and_controller) & joy_and_controller) == 0, "SDL_WasInit() before init should be false for joystick & controller"); + SDLTest_AssertCheck(SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0, "SDL_InitSubSystem(SDL_INIT_JOYSTICK)"); + SDLTest_AssertCheck(SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == 0, "SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER)"); /* Then make sure they're both initialized properly */ initialized_system = SDL_WasInit(joy_and_controller); - SDLTest_AssertCheck( (initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system ); + SDLTest_AssertCheck((initialized_system & joy_and_controller) == joy_and_controller, "SDL_WasInit() should be true for joystick & controller (%x)", initialized_system); /* Then quit the controller, and make sure that it does NOT quit the */ /* explicitly initialized joystick subsystem. */ SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER); initialized_system = SDL_WasInit(joy_and_controller); - SDLTest_AssertCheck( (initialized_system & joy_and_controller) == SDL_INIT_JOYSTICK, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system ); + SDLTest_AssertCheck((initialized_system & joy_and_controller) == SDL_INIT_JOYSTICK, "SDL_WasInit() should be false for joystick & controller (%x)", initialized_system); SDL_QuitSubSystem(SDL_INIT_JOYSTICK); @@ -140,7 +111,7 @@ main_testSetError(void *arg) SDL_SetError(""); SDLTest_AssertCheck(SDL_strcmp(error, SDL_GetError()) == 0, "SDL_SetError(\"\")"); - for (i = 0; i < (sizeof(error)-1); ++i) { + for (i = 0; i < (sizeof(error) - 1); ++i) { error[i] = 'a' + (i % 26); } error[i] = '\0'; @@ -154,28 +125,28 @@ main_testSetError(void *arg) #pragma GCC diagnostic pop #endif -static const SDLTest_TestCaseReference mainTest1 = - { (SDLTest_TestCaseFp)main_testInitQuitJoystickHaptic, "main_testInitQuitJoystickHaptic", "Tests SDL_Init/Quit of Joystick and Haptic subsystem", TEST_ENABLED}; - -static const SDLTest_TestCaseReference mainTest2 = - { (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED}; +static const SDLTest_TestCaseReference mainTest1 = { + (SDLTest_TestCaseFp)main_testInitQuitSubSystem, "main_testInitQuitSubSystem", "Tests SDL_InitSubSystem/QuitSubSystem", TEST_ENABLED +}; -static const SDLTest_TestCaseReference mainTest3 = - { (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED}; +static const SDLTest_TestCaseReference mainTest2 = { + (SDLTest_TestCaseFp)main_testImpliedJoystickInit, "main_testImpliedJoystickInit", "Tests that init for gamecontroller properly implies joystick", TEST_ENABLED +}; -static const SDLTest_TestCaseReference mainTest4 = - { (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED}; +static const SDLTest_TestCaseReference mainTest3 = { + (SDLTest_TestCaseFp)main_testImpliedJoystickQuit, "main_testImpliedJoystickQuit", "Tests that quit for gamecontroller doesn't quit joystick if you inited it explicitly", TEST_ENABLED +}; -static const SDLTest_TestCaseReference mainTest5 = - { (SDLTest_TestCaseFp)main_testSetError, "main_testSetError", "Tests that SDL_SetError() handles arbitrarily large strings", TEST_ENABLED}; +static const SDLTest_TestCaseReference mainTest4 = { + (SDLTest_TestCaseFp)main_testSetError, "main_testSetError", "Tests that SDL_SetError() handles arbitrarily large strings", TEST_ENABLED +}; /* Sequence of Main test cases */ -static const SDLTest_TestCaseReference *mainTests[] = { +static const SDLTest_TestCaseReference *mainTests[] = { &mainTest1, &mainTest2, &mainTest3, &mainTest4, - &mainTest5, NULL }; @@ -186,5 +157,3 @@ SDLTest_TestSuiteReference mainTestSuite = { mainTests, NULL }; - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testautomation_math.c b/test/testautomation_math.c index bdf5703a293ae..314d8ba7fd1d3 100644 --- a/test/testautomation_math.c +++ b/test/testautomation_math.c @@ -12,7 +12,7 @@ /* Range tests parameters */ #define RANGE_TEST_ITERATIONS 10000000 -#define RANGE_TEST_STEP SDL_MAX_UINT32 / RANGE_TEST_ITERATIONS +#define RANGE_TEST_STEP ((Uint32)(SDL_MAX_UINT32 / RANGE_TEST_ITERATIONS)) /* Margin of error for imprecise tests */ #define EPSILON 1.0E-10 @@ -24,6 +24,8 @@ #define EULER M_E #endif +#define IS_INFINITY(V) fpclassify(V) == FP_INFINITE + /* Square root of 3 (used in atan2) */ #define SQRT3 1.7320508075688771931766041234368458390235900878906250 @@ -47,6 +49,12 @@ typedef struct double expected; } dd_to_d; +#define DD_TO_D_CASE(IDX, X, Y, E) do { \ + cases[IDX].x_input = (X); \ + cases[IDX].y_input = (Y); \ + cases[IDX].expected = (E); \ + } while (0) + /* NB: You cannot create an array of these structures containing INFINITY or NAN. On platforms such as OS/2, they are defined as 'extern const double' making them @@ -62,10 +70,10 @@ typedef double(SDLCALL *dd_to_d_func)(double, double); * \brief Runs all the cases on a given function with a signature double -> double. * The result is expected to be exact. * - * \param func_name, a printable name for the tested function. - * \param func, the function to call. - * \param cases, an array of all the cases. - * \param cases_size, the size of the cases array. + * \param func_name a printable name for the tested function. + * \param func the function to call. + * \param cases an array of all the cases. + * \param cases_size the size of the cases array. */ static int helper_dtod(const char *func_name, d_to_d_func func, @@ -74,7 +82,7 @@ helper_dtod(const char *func_name, d_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].input); - SDLTest_AssertCheck(result == cases[i].expected, + SDLTest_AssertCheck(SDL_fabs(result - cases[i].expected) < FLT_EPSILON, "%s(%f), expected %f, got %f", func_name, cases[i].input, @@ -88,10 +96,10 @@ helper_dtod(const char *func_name, d_to_d_func func, * \brief Runs all the cases on a given function with a signature double -> double. * Checks if the result between expected +/- EPSILON. * - * \param func_name, a printable name for the tested function. - * \param func, the function to call. - * \param cases, an array of all the cases. - * \param cases_size, the size of the cases array. + * \param func_name a printable name for the tested function. + * \param func the function to call. + * \param cases an array of all the cases. + * \param cases_size the size of the cases array. */ static int helper_dtod_inexact(const char *func_name, d_to_d_func func, @@ -100,13 +108,19 @@ helper_dtod_inexact(const char *func_name, d_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].input); - SDLTest_AssertCheck(result >= cases[i].expected - EPSILON && - result <= cases[i].expected + EPSILON, - "%s(%f), expected [%f,%f], got %f", + double diff = result - cases[i].expected; + double max_err = (cases[i].expected + 1.) * EPSILON; + if (diff < 0) { + diff = -diff; + } + if (max_err < 0) { + max_err = -max_err; + } + SDLTest_AssertCheck(diff <= max_err, + "%s(%f), expected %f +/- %g, got %f", func_name, cases[i].input, - cases[i].expected - EPSILON, - cases[i].expected + EPSILON, + cases[i].expected, max_err, result); } @@ -117,10 +131,10 @@ helper_dtod_inexact(const char *func_name, d_to_d_func func, * \brief Runs all the cases on a given function with a signature * (double, double) -> double. The result is expected to be exact. * - * \param func_name, a printable name for the tested function. - * \param func, the function to call. - * \param cases, an array of all the cases. - * \param cases_size, the size of the cases array. + * \param func_name a printable name for the tested function. + * \param func the function to call. + * \param cases an array of all the cases. + * \param cases_size the size of the cases array. */ static int helper_ddtod(const char *func_name, dd_to_d_func func, @@ -129,6 +143,8 @@ helper_ddtod(const char *func_name, dd_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].x_input, cases[i].y_input); + /* By using the result as input, the compiler is less likely to use higher precision floating point number */ + (void)SDL_sin(result); SDLTest_AssertCheck(result == cases[i].expected, "%s(%f,%f), expected %f, got %f", func_name, @@ -143,10 +159,10 @@ helper_ddtod(const char *func_name, dd_to_d_func func, * \brief Runs all the cases on a given function with a signature * (double, double) -> double. Checks if the result between expected +/- EPSILON. * - * \param func_name, a printable name for the tested function. - * \param func, the function to call. - * \param cases, an array of all the cases. - * \param cases_size, the size of the cases array. + * \param func_name a printable name for the tested function. + * \param func the function to call. + * \param cases an array of all the cases. + * \param cases_size the size of the cases array. */ static int helper_ddtod_inexact(const char *func_name, dd_to_d_func func, @@ -155,13 +171,20 @@ helper_ddtod_inexact(const char *func_name, dd_to_d_func func, Uint32 i; for (i = 0; i < cases_size; i++) { const double result = func(cases[i].x_input, cases[i].y_input); - SDLTest_AssertCheck(result >= cases[i].expected - EPSILON && - result <= cases[i].expected + EPSILON, - "%s(%f,%f), expected [%f,%f], got %f", + double diff = result - cases[i].expected; + double max_err = (cases[i].expected + 1.) * EPSILON; + if (diff < 0) { + diff = -diff; + } + if (max_err < 0) { + max_err = -max_err; + } + + SDLTest_AssertCheck(diff <= max_err, + "%s(%f,%f), expected %f +/- %g, got %f", func_name, cases[i].x_input, cases[i].y_input, - cases[i].expected - EPSILON, - cases[i].expected + EPSILON, + cases[i].expected, max_err, result); } @@ -174,8 +197,8 @@ helper_ddtod_inexact(const char *func_name, dd_to_d_func func, * This function is only meant to test functions that returns the input value if it is * integral: f(x) -> x for x in N. * - * \param func_name, a printable name for the tested function. - * \param func, the function to call. + * \param func_name a printable name for the tested function. + * \param func the function to call. */ static int helper_range(const char *func_name, d_to_d_func func) @@ -222,12 +245,12 @@ floor_infCases(void *args) double result; result = SDL_floor(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Floor(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_floor(-INFINITY); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Floor(%f), expected %f, got %f", -INFINITY, -INFINITY, result); @@ -326,12 +349,12 @@ ceil_infCases(void *args) double result; result = SDL_ceil(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Ceil(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_ceil(-INFINITY); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Ceil(%f), expected %f, got %f", -INFINITY, -INFINITY, result); @@ -430,12 +453,12 @@ trunc_infCases(void *args) double result; result = SDL_trunc(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Trunc(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_trunc(-INFINITY); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Trunc(%f), expected %f, got %f", -INFINITY, -INFINITY, result); @@ -534,12 +557,12 @@ round_infCases(void *args) double result; result = SDL_round(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Round(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_round(-INFINITY); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Round(%f), expected %f, got %f", -INFINITY, -INFINITY, result); @@ -638,12 +661,12 @@ fabs_infCases(void *args) double result; result = SDL_fabs(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Fabs(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_fabs(-INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Fabs(%f), expected %f, got %f", -INFINITY, INFINITY, result); @@ -700,22 +723,22 @@ copysign_infCases(void *args) double result; result = SDL_copysign(INFINITY, -1.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Copysign(%f,%.1f), expected %f, got %f", INFINITY, -1.0, -INFINITY, result); result = SDL_copysign(INFINITY, 1.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Copysign(%f,%.1f), expected %f, got %f", INFINITY, 1.0, INFINITY, result); result = SDL_copysign(-INFINITY, -1.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Copysign(%f,%.1f), expected %f, got %f", -INFINITY, -1.0, -INFINITY, result); result = SDL_copysign(-INFINITY, 1.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Copysign(%f,%.1f), expected %f, got %f", -INFINITY, 1.0, INFINITY, result); @@ -1008,7 +1031,7 @@ exp_infCases(void *args) double result; result = SDL_exp(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Exp(%f), expected %f, got %f", INFINITY, INFINITY, result); @@ -1089,7 +1112,7 @@ exp_regularCases(void *args) { 112.89, 10653788283588960962604279261058893737879589093376.0 }, { 539.483, 1970107755334319939701129934673541628417235942656909222826926175622435588279443011110464355295725187195188154768877850257012251677751742837992843520967922303961718983154427294786640886286983037548604937796221048661733679844353544028160.0 }, }; - return helper_dtod("Exp", SDL_exp, regular_cases, SDL_arraysize(regular_cases)); + return helper_dtod_inexact("Exp", SDL_exp, regular_cases, SDL_arraysize(regular_cases)); } /* SDL_log tests functions */ @@ -1104,17 +1127,17 @@ log_limitCases(void *args) double result; result = SDL_log(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Log(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_log(0.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Log(%f), expected %f, got %f", 0.0, -INFINITY, result); result = SDL_log(-0.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Log(%f), expected %f, got %f", -0.0, -INFINITY, result); @@ -1136,7 +1159,7 @@ log_baseCases(void *args) 1.0, 0.0, result); result = SDL_log(EULER); - SDLTest_AssertCheck(1.0 == result, + SDLTest_AssertCheck(SDL_fabs(result - 1.) < FLT_EPSILON, "Log(%f), expected %f, got %f", EULER, 1.0, result); @@ -1194,17 +1217,17 @@ log10_limitCases(void *args) double result; result = SDL_log10(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Log10(%f), expected %f, got %f", INFINITY, INFINITY, result); result = SDL_log10(0.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Log10(%f), expected %f, got %f", 0.0, -INFINITY, result); result = SDL_log10(-0.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Log10(%f), expected %f, got %f", -0.0, -INFINITY, result); @@ -1307,12 +1330,12 @@ pow_baseZeroExpNInfCases(void *args) double result; result = SDL_pow(0.0, -INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 0.0, -INFINITY, INFINITY, result); result = SDL_pow(-0.0, -INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", -0.0, -INFINITY, INFINITY, result); @@ -1334,12 +1357,12 @@ pow_expInfCases(void *args) 0.5, INFINITY, 0.0, result); result = SDL_pow(1.5, INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 1.5, INFINITY, INFINITY, result); result = SDL_pow(0.5, -INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 0.5, INFINITY, INFINITY, result); @@ -1368,7 +1391,7 @@ pow_basePInfCases(void *args) INFINITY, -3.0, 0.0, result); result = SDL_pow(INFINITY, 2.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", INFINITY, 2.0, INFINITY, result); @@ -1378,7 +1401,7 @@ pow_basePInfCases(void *args) INFINITY, -2.12345, 0.0, result); result = SDL_pow(INFINITY, 3.1345); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", INFINITY, 3.12345, INFINITY, result); @@ -1414,17 +1437,17 @@ pow_baseNInfCases(void *args) -INFINITY, -5.5, 0.0, result); result = SDL_pow(-INFINITY, 3.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Pow(%f,%f), expected %f, got %f", -INFINITY, 3.0, -INFINITY, result); result = SDL_pow(-INFINITY, 2.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", -INFINITY, 2.0, INFINITY, result); result = SDL_pow(-INFINITY, 5.5); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", -INFINITY, 5.5, INFINITY, result); @@ -1526,7 +1549,7 @@ pow_baseNZeroExpOddCases(void *args) double result; result = SDL_pow(-0.0, -3.0); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Pow(%f,%f), expected %f, got %f", -0.0, -3.0, -INFINITY, result); @@ -1550,7 +1573,7 @@ pow_basePZeroExpOddCases(void *args) double result; result = SDL_pow(0.0, -5.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 0.0, -5.0, INFINITY, result); @@ -1576,12 +1599,12 @@ pow_baseNZeroCases(void *args) double result; result = SDL_pow(-0.0, -3.5); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", -0.0, -3.5, INFINITY, result); result = SDL_pow(-0.0, -4.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", -0.0, -4.0, INFINITY, result); @@ -1612,12 +1635,12 @@ pow_basePZeroCases(void *args) double result; result = SDL_pow(0.0, -3.5); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 0.0, -3.5, INFINITY, result); result = SDL_pow(0.0, -4.0); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Pow(%f,%f), expected %f, got %f", 0.0, -4.0, INFINITY, result); @@ -1644,14 +1667,16 @@ static int pow_regularCases(void *args) { const dd_to_d regular_cases[] = { +#if 0 /* These tests fail when using the Mingw C runtime, we'll disable them for now */ { -391.25, -2.0, 0.00000653267870448815438463212659780943170062528224661946296691894531250 }, { -72.3, 12.0, 20401381050275984310272.0 }, +#endif { -5.0, 3.0, -125.0 }, { 3.0, 2.5, 15.58845726811989607085706666111946105957031250 }, { 39.23, -1.5, 0.0040697950366865498147972424192175822099670767784118652343750 }, { 478.972, 12.125, 315326359630449587856007411793920.0 } }; - return helper_ddtod("Pow", SDL_pow, regular_cases, SDL_arraysize(regular_cases)); + return helper_ddtod_inexact("Pow", SDL_pow, regular_cases, SDL_arraysize(regular_cases)); } /** @@ -1725,7 +1750,7 @@ static int sqrt_infCase(void *args) { const double result = SDL_sqrt(INFINITY); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Sqrt(%f), expected %f, got %f", INFINITY, INFINITY, result); return TEST_COMPLETED; @@ -1818,12 +1843,12 @@ scalbn_infCases(void *args) double result; result = SDL_scalbn(INFINITY, 1); - SDLTest_AssertCheck(INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result > 0, "Scalbn(%f,%d), expected %f, got %f", INFINITY, 1, INFINITY, result); result = SDL_scalbn(-INFINITY, 1); - SDLTest_AssertCheck(-INFINITY == result, + SDLTest_AssertCheck(IS_INFINITY(result) && result < 0, "Scalbn(%f,%d), expected %f, got %f", -INFINITY, 1, -INFINITY, result); @@ -1979,24 +2004,24 @@ static int cos_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 10.0, 0.9510565162 }, - { M_PI * 2.0 / 10.0, 0.8090169943 }, - { M_PI * 3.0 / 10.0, 0.5877852522 }, - { M_PI * 4.0 / 10.0, 0.3090169943 }, + { M_PI * 1.0 / 10.0, 0.9510565162951535 }, + { M_PI * 2.0 / 10.0, 0.8090169943749475 }, + { M_PI * 3.0 / 10.0, 0.5877852522924731 }, + { M_PI * 4.0 / 10.0, 0.30901699437494745 }, { M_PI * 5.0 / 10.0, 0.0 }, - { M_PI * 6.0 / 10.0, -0.3090169943 }, - { M_PI * 7.0 / 10.0, -0.5877852522 }, - { M_PI * 8.0 / 10.0, -0.8090169943 }, - { M_PI * 9.0 / 10.0, -0.9510565162 }, - { M_PI * -1.0 / 10.0, 0.9510565162 }, - { M_PI * -2.0 / 10.0, 0.8090169943 }, - { M_PI * -3.0 / 10.0, 0.5877852522 }, - { M_PI * -4.0 / 10.0, 0.3090169943 }, + { M_PI * 6.0 / 10.0, -0.30901699437494734 }, + { M_PI * 7.0 / 10.0, -0.587785252292473 }, + { M_PI * 8.0 / 10.0, -0.8090169943749473 }, + { M_PI * 9.0 / 10.0, -0.9510565162951535 }, + { M_PI * -1.0 / 10.0, 0.9510565162951535 }, + { M_PI * -2.0 / 10.0, 0.8090169943749475 }, + { M_PI * -3.0 / 10.0, 0.5877852522924731 }, + { M_PI * -4.0 / 10.0, 0.30901699437494745 }, { M_PI * -5.0 / 10.0, 0.0 }, - { M_PI * -6.0 / 10.0, -0.3090169943 }, - { M_PI * -7.0 / 10.0, -0.5877852522 }, - { M_PI * -8.0 / 10.0, -0.8090169943 }, - { M_PI * -9.0 / 10.0, -0.9510565162 } + { M_PI * -6.0 / 10.0, -0.30901699437494734 }, + { M_PI * -7.0 / 10.0, -0.587785252292473 }, + { M_PI * -8.0 / 10.0, -0.8090169943749473 }, + { M_PI * -9.0 / 10.0, -0.9510565162951535 } }; return helper_dtod_inexact("Cos", SDL_cos, precision_cases, SDL_arraysize(precision_cases)); } @@ -2097,23 +2122,23 @@ static int sin_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 10.0, 0.3090169943 }, - { M_PI * 2.0 / 10.0, 0.5877852522 }, - { M_PI * 3.0 / 10.0, 0.8090169943 }, - { M_PI * 4.0 / 10.0, 0.9510565162 }, - { M_PI * 6.0 / 10.0, 0.9510565162 }, - { M_PI * 7.0 / 10.0, 0.8090169943 }, - { M_PI * 8.0 / 10.0, 0.5877852522 }, - { M_PI * 9.0 / 10.0, 0.3090169943 }, + { M_PI * 1.0 / 10.0, 0.3090169943749474 }, + { M_PI * 2.0 / 10.0, 0.5877852522924731 }, + { M_PI * 3.0 / 10.0, 0.8090169943749475 }, + { M_PI * 4.0 / 10.0, 0.9510565162951535 }, + { M_PI * 6.0 / 10.0, 0.9510565162951536 }, + { M_PI * 7.0 / 10.0, 0.8090169943749475 }, + { M_PI * 8.0 / 10.0, 0.5877852522924732 }, + { M_PI * 9.0 / 10.0, 0.3090169943749475 }, { M_PI, 0.0 }, - { M_PI * -1.0 / 10.0, -0.3090169943 }, - { M_PI * -2.0 / 10.0, -0.5877852522 }, - { M_PI * -3.0 / 10.0, -0.8090169943 }, - { M_PI * -4.0 / 10.0, -0.9510565162 }, - { M_PI * -6.0 / 10.0, -0.9510565162 }, - { M_PI * -7.0 / 10.0, -0.8090169943 }, - { M_PI * -8.0 / 10.0, -0.5877852522 }, - { M_PI * -9.0 / 10.0, -0.3090169943 }, + { M_PI * -1.0 / 10.0, -0.3090169943749474 }, + { M_PI * -2.0 / 10.0, -0.5877852522924731 }, + { M_PI * -3.0 / 10.0, -0.8090169943749475 }, + { M_PI * -4.0 / 10.0, -0.9510565162951535 }, + { M_PI * -6.0 / 10.0, -0.9510565162951536 }, + { M_PI * -7.0 / 10.0, -0.8090169943749475 }, + { M_PI * -8.0 / 10.0, -0.5877852522924732 }, + { M_PI * -9.0 / 10.0, -0.3090169943749475 }, { -M_PI, 0.0 }, }; return helper_dtod_inexact("Sin", SDL_sin, precision_cases, SDL_arraysize(precision_cases)); @@ -2213,26 +2238,26 @@ static int tan_precisionTest(void *args) { const d_to_d precision_cases[] = { - { M_PI * 1.0 / 11.0, 0.2936264929 }, - { M_PI * 2.0 / 11.0, 0.6426609771 }, - { M_PI * 3.0 / 11.0, 1.1540615205 }, - { M_PI * 4.0 / 11.0, 2.1896945629 }, - { M_PI * 5.0 / 11.0, 6.9551527717 }, - { M_PI * 6.0 / 11.0, -6.9551527717 }, - { M_PI * 7.0 / 11.0, -2.1896945629 }, - { M_PI * 8.0 / 11.0, -1.1540615205 }, - { M_PI * 9.0 / 11.0, -0.6426609771 }, - { M_PI * 10.0 / 11.0, -0.2936264929 }, - { M_PI * -1.0 / 11.0, -0.2936264929 }, - { M_PI * -2.0 / 11.0, -0.6426609771 }, - { M_PI * -3.0 / 11.0, -1.1540615205 }, - { M_PI * -4.0 / 11.0, -2.1896945629 }, - { M_PI * -5.0 / 11.0, -6.9551527717 }, - { M_PI * -6.0 / 11.0, 6.9551527717 }, - { M_PI * -7.0 / 11.0, 2.1896945629 }, - { M_PI * -8.0 / 11.0, 1.1540615205 }, - { M_PI * -9.0 / 11.0, 0.6426609771 }, - { M_PI * -10.0 / 11.0, 0.2936264929 } + { M_PI * 1.0 / 11.0, 0.29362649293836673 }, + { M_PI * 2.0 / 11.0, 0.642660977168331 }, + { M_PI * 3.0 / 11.0, 1.1540615205330094 }, + { M_PI * 4.0 / 11.0, 2.189694562989681 }, + { M_PI * 5.0 / 11.0, 6.9551527717734745 }, + { M_PI * 6.0 / 11.0, -6.955152771773481 }, + { M_PI * 7.0 / 11.0, -2.189694562989682 }, + { M_PI * 8.0 / 11.0, -1.1540615205330096 }, + { M_PI * 9.0 / 11.0, -0.6426609771683314 }, + { M_PI * 10.0 / 11.0, -0.2936264929383667 }, + { M_PI * -1.0 / 11.0, -0.29362649293836673 }, + { M_PI * -2.0 / 11.0, -0.642660977168331 }, + { M_PI * -3.0 / 11.0, -1.1540615205330094 }, + { M_PI * -4.0 / 11.0, -2.189694562989681 }, + { M_PI * -5.0 / 11.0, -6.9551527717734745 }, + { M_PI * -6.0 / 11.0, 6.955152771773481 }, + { M_PI * -7.0 / 11.0, 2.189694562989682 }, + { M_PI * -8.0 / 11.0, 1.1540615205330096 }, + { M_PI * -9.0 / 11.0, 0.6426609771683314 }, + { M_PI * -10.0 / 11.0, 0.2936264929383667 } }; return helper_dtod_inexact("Tan", SDL_tan, precision_cases, SDL_arraysize(precision_cases)); } @@ -2254,7 +2279,7 @@ acos_limitCases(void *args) 1.0, 0.0, result); result = SDL_acos(-1.0); - SDLTest_AssertCheck(M_PI == result, + SDLTest_AssertCheck(SDL_fabs(M_PI - result) <= EPSILON, "Acos(%f), expected %f, got %f", -1.0, M_PI, result); @@ -2341,12 +2366,12 @@ asin_limitCases(void *args) double result; result = SDL_asin(1.0); - SDLTest_AssertCheck(M_PI / 2.0 == result, + SDLTest_AssertCheck(SDL_fabs(M_PI / 2.0 - result) <= EPSILON, "Asin(%f), expected %f, got %f", 1.0, M_PI / 2.0, result); result = SDL_asin(-1.0); - SDLTest_AssertCheck(-M_PI / 2.0 == result, + SDLTest_AssertCheck(SDL_fabs(-M_PI / 2.0 - result) <= EPSILON, "Asin(%f), expected %f, got %f", -1.0, -M_PI / 2.0, result); @@ -2397,26 +2422,26 @@ static int asin_precisionTest(void *args) { const d_to_d precision_cases[] = { - { 0.9, 1.1197695149 }, - { 0.8, 0.9272952180 }, - { 0.7, 0.7753974966 }, - { 0.6, 0.6435011087 }, - { 0.5, 0.5235987755 }, - { 0.4, 0.4115168460 }, - { 0.3, 0.3046926540 }, - { 0.2, 0.2013579207 }, - { 0.1, 0.1001674211 }, + { 0.9, 1.1197695149986342 }, + { 0.8, 0.9272952180016123 }, + { 0.7, 0.775397496610753 }, + { 0.6, 0.6435011087932844 }, + { 0.5, 0.5235987755982989 }, + { 0.4, 0.41151684606748806 }, + { 0.3, 0.3046926540153976 }, + { 0.2, 0.20135792079033074 }, + { 0.1, 0.10016742116155977 }, { 0.0, 0.0 }, { -0.0, -0.0 }, - { -0.1, -0.1001674211 }, - { -0.2, -0.2013579207 }, - { -0.3, -0.3046926540 }, - { -0.4, -0.4115168460 }, - { -0.5, -0.5235987755 }, - { -0.6, -0.6435011087 }, - { -0.7, -0.7753974966 }, - { -0.8, -0.9272952180 }, - { -0.9, -1.1197695149 } + { -0.1, -0.10016742116155977 }, + { -0.2, -0.20135792079033074 }, + { -0.3, -0.3046926540153976 }, + { -0.4, -0.41151684606748806 }, + { -0.5, -0.5235987755982989 }, + { -0.6, -0.6435011087932844 }, + { -0.7, -0.775397496610753 }, + { -0.8, -0.9272952180016123 }, + { -0.9, -1.1197695149986342 } }; return helper_dtod_inexact("Asin", SDL_asin, precision_cases, SDL_arraysize(precision_cases)); } @@ -2491,24 +2516,24 @@ static int atan_precisionTest(void *args) { const d_to_d precision_cases[] = { - { 6.313751514675041, 1.4137166941 }, - { 3.0776835371752527, 1.2566370614 }, - { 1.9626105055051504, 1.0995574287 }, - { 1.3763819204711734, 0.9424777960 }, - { 1.0, 0.7853981633 }, - { 0.7265425280053609, 0.6283185307 }, - { 0.5095254494944288, 0.4712388980 }, - { 0.3249196962329063, 0.3141592653 }, - { 0.15838444032453627, 0.1570796326 }, - { -0.15838444032453627, -0.1570796326 }, - { -0.3249196962329063, -0.3141592653 }, - { -0.5095254494944288, -0.4712388980 }, - { -0.7265425280053609, -0.6283185307 }, - { -1.0, -0.7853981633 }, - { -1.3763819204711734, -0.9424777960 }, - { -1.9626105055051504, -1.0995574287 }, - { -3.0776835371752527, -1.2566370614 }, - { -6.313751514675041, -1.4137166941 }, + { 6.313751514675041, 1.413716694115407 }, + { 3.0776835371752527, 1.2566370614359172 }, + { 1.9626105055051504, 1.0995574287564276 }, + { 1.3763819204711734, 0.9424777960769379 }, + { 1.0, 0.7853981633974483 }, + { 0.7265425280053609, 0.6283185307179586 }, + { 0.5095254494944288, 0.47123889803846897 }, + { 0.3249196962329063, 0.3141592653589793 }, + { 0.15838444032453627, 0.15707963267948966 }, + { -0.15838444032453627, -0.15707963267948966 }, + { -0.3249196962329063, -0.3141592653589793 }, + { -0.5095254494944288, -0.47123889803846897 }, + { -0.7265425280053609, -0.6283185307179586 }, + { -1.0, -0.7853981633974483 }, + { -1.3763819204711734, -0.9424777960769379 }, + { -1.9626105055051504, -1.0995574287564276 }, + { -3.0776835371752527, -1.2566370614359172 }, + { -6.313751514675041, -1.413716694115407 }, }; return helper_dtod_inexact("Atan", SDL_atan, precision_cases, SDL_arraysize(precision_cases)); } @@ -2533,7 +2558,7 @@ atan2_bothZeroCases(void *args) { 0.0, -0.0, M_PI }, { -0.0, -0.0, -M_PI }, }; - return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2552,7 +2577,7 @@ atan2_yZeroCases(void *args) { -0.0, 1.0, -0.0 }, { -0.0, -1.0, -M_PI } }; - return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2568,7 +2593,7 @@ atan2_xZeroCases(void *args) { 1.0, -0.0, M_PI / 2.0 }, { -1.0, -0.0, -M_PI / 2.0 } }; - return helper_ddtod("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); + return helper_ddtod_inexact("SDL_atan2", SDL_atan2, cases, SDL_arraysize(cases)); } /* Infinity cases */ @@ -2584,29 +2609,12 @@ atan2_xZeroCases(void *args) static int atan2_bothInfCases(void *args) { - double result; - - result = SDL_atan2(INFINITY, INFINITY); - SDLTest_AssertCheck(M_PI / 4.0 == result, - "Atan2(%f,%f), expected %f, got %f", - INFINITY, INFINITY, M_PI / 4.0, result); - - result = SDL_atan2(INFINITY, -INFINITY); - SDLTest_AssertCheck(3.0 * M_PI / 4.0 == result, - "Atan2(%f,%f), expected %f, got %f", - INFINITY, -INFINITY, 3.0 * M_PI / 4.0, result); - - result = SDL_atan2(-INFINITY, INFINITY); - SDLTest_AssertCheck(-M_PI / 4.0 == result, - "Atan2(%f,%f), expected %f, got %f", - -INFINITY, INFINITY, -M_PI / 4.0, result); - - result = SDL_atan2(-INFINITY, -INFINITY); - SDLTest_AssertCheck(-3.0 * M_PI / 4.0 == result, - "Atan2(%f,%f), expected %f, got %f", - -INFINITY, -INFINITY, -3.0 * M_PI / 4.0, result); - - return TEST_COMPLETED; + dd_to_d cases[4]; + DD_TO_D_CASE(0, INFINITY, INFINITY, 1.0 * M_PI / 4.0); + DD_TO_D_CASE(1, INFINITY, -INFINITY, 3.0 * M_PI / 4.0); + DD_TO_D_CASE(2, -INFINITY, INFINITY, -1.0 * M_PI / 4.0); + DD_TO_D_CASE(3, -INFINITY, -INFINITY, -3.0 * M_PI / 4.0); + return helper_ddtod("SDL_atan2(bothInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2616,29 +2624,12 @@ atan2_bothInfCases(void *args) static int atan2_yInfCases(void *args) { - double result; - - result = SDL_atan2(INFINITY, 1.0); - SDLTest_AssertCheck(M_PI / 2.0 == result, - "Atan2(%f,%f), expected %f, got %f", - INFINITY, 1.0, M_PI / 2.0, result); - - result = SDL_atan2(INFINITY, -1.0); - SDLTest_AssertCheck(M_PI / 2.0 == result, - "Atan2(%f,%f), expected %f, got %f", - INFINITY, -1.0, M_PI / 2.0, result); - - result = SDL_atan2(-INFINITY, 1.0); - SDLTest_AssertCheck(-M_PI / 2.0 == result, - "Atan2(%f,%f), expected %f, got %f", - -INFINITY, 1.0, -M_PI / 2.0, result); - - result = SDL_atan2(-INFINITY, -1.0); - SDLTest_AssertCheck(-M_PI / 2.0 == result, - "Atan2(%f,%f), expected %f, got %f", - -INFINITY, -1.0, -M_PI / 2.0, result); - - return TEST_COMPLETED; + dd_to_d cases[4]; + DD_TO_D_CASE(0, INFINITY, 1.0, 1.0 * M_PI / 2.0); + DD_TO_D_CASE(1, INFINITY, -1.0, 1.0 * M_PI / 2.0); + DD_TO_D_CASE(2, -INFINITY, 1.0, -1.0 * M_PI / 2.0); + DD_TO_D_CASE(3, -INFINITY, -1.0, -1.0 * M_PI / 2.0); + return helper_ddtod("SDL_atan2(atan2_yInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); } /** @@ -2650,29 +2641,12 @@ atan2_yInfCases(void *args) static int atan2_xInfCases(void *args) { - double result; - - result = SDL_atan2(1.0, INFINITY); - SDLTest_AssertCheck(0.0 == result, - "Atan2(%f,%f), expected %f, got %f", - 1.0, INFINITY, 0.0, result); - - result = SDL_atan2(-1.0, INFINITY); - SDLTest_AssertCheck(-0.0 == result, - "Atan2(%f,%f), expected %f, got %f", - -1.0, INFINITY, -0.0, result); - - result = SDL_atan2(1.0, -INFINITY); - SDLTest_AssertCheck(M_PI == result, - "Atan2(%f,%f), expected %f, got %f", - 1.0, -INFINITY, M_PI, result); - - result = SDL_atan2(-1.0, -INFINITY); - SDLTest_AssertCheck(-M_PI == result, - "Atan2(%f,%f), expected %f, got %f", - -1.0, -INFINITY, -M_PI, result); - - return TEST_COMPLETED; + dd_to_d cases[4]; + DD_TO_D_CASE(0, 1.0, INFINITY, 0.0); + DD_TO_D_CASE(1, -1.0, INFINITY, -0.0); + DD_TO_D_CASE(2, 1.0, -INFINITY, M_PI); + DD_TO_D_CASE(3, -1.0, -INFINITY, -M_PI); + return helper_ddtod("atan2_xInfCases(atan2_yInfCases)", SDL_atan2, cases, SDL_arraysize(cases)); } /* Miscelanious cases */ @@ -2769,520 +2743,520 @@ atan2_bottomLeftQuadrantTest(void *args) /* SDL_floor test cases */ static const SDLTest_TestCaseReference floorTestInf = { - (SDLTest_TestCaseFp) floor_infCases, "floor_infCases", + (SDLTest_TestCaseFp)floor_infCases, "floor_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference floorTestZero = { - (SDLTest_TestCaseFp) floor_zeroCases, "floor_zeroCases", + (SDLTest_TestCaseFp)floor_zeroCases, "floor_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference floorTestNan = { - (SDLTest_TestCaseFp) floor_nanCase, "floor_nanCase", + (SDLTest_TestCaseFp)floor_nanCase, "floor_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference floorTestRound = { - (SDLTest_TestCaseFp) floor_roundNumbersCases, "floor_roundNumberCases", + (SDLTest_TestCaseFp)floor_roundNumbersCases, "floor_roundNumberCases", "Checks a set of integral values", TEST_ENABLED }; static const SDLTest_TestCaseReference floorTestFraction = { - (SDLTest_TestCaseFp) floor_fractionCases, "floor_fractionCases", + (SDLTest_TestCaseFp)floor_fractionCases, "floor_fractionCases", "Checks a set of fractions", TEST_ENABLED }; static const SDLTest_TestCaseReference floorTestRange = { - (SDLTest_TestCaseFp) floor_rangeTest, "floor_rangeTest", + (SDLTest_TestCaseFp)floor_rangeTest, "floor_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_ceil test cases */ static const SDLTest_TestCaseReference ceilTestInf = { - (SDLTest_TestCaseFp) ceil_infCases, "ceil_infCases", + (SDLTest_TestCaseFp)ceil_infCases, "ceil_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference ceilTestZero = { - (SDLTest_TestCaseFp) ceil_zeroCases, "ceil_zeroCases", + (SDLTest_TestCaseFp)ceil_zeroCases, "ceil_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference ceilTestNan = { - (SDLTest_TestCaseFp) ceil_nanCase, "ceil_nanCase", + (SDLTest_TestCaseFp)ceil_nanCase, "ceil_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference ceilTestRound = { - (SDLTest_TestCaseFp) ceil_roundNumbersCases, "ceil_roundNumberCases", + (SDLTest_TestCaseFp)ceil_roundNumbersCases, "ceil_roundNumberCases", "Checks a set of integral values", TEST_ENABLED }; static const SDLTest_TestCaseReference ceilTestFraction = { - (SDLTest_TestCaseFp) ceil_fractionCases, "ceil_fractionCases", + (SDLTest_TestCaseFp)ceil_fractionCases, "ceil_fractionCases", "Checks a set of fractions", TEST_ENABLED }; static const SDLTest_TestCaseReference ceilTestRange = { - (SDLTest_TestCaseFp) ceil_rangeTest, "ceil_rangeTest", + (SDLTest_TestCaseFp)ceil_rangeTest, "ceil_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_trunc test cases */ static const SDLTest_TestCaseReference truncTestInf = { - (SDLTest_TestCaseFp) trunc_infCases, "trunc_infCases", + (SDLTest_TestCaseFp)trunc_infCases, "trunc_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference truncTestZero = { - (SDLTest_TestCaseFp) trunc_zeroCases, "trunc_zeroCases", + (SDLTest_TestCaseFp)trunc_zeroCases, "trunc_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference truncTestNan = { - (SDLTest_TestCaseFp) trunc_nanCase, "trunc_nanCase", + (SDLTest_TestCaseFp)trunc_nanCase, "trunc_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference truncTestRound = { - (SDLTest_TestCaseFp) trunc_roundNumbersCases, "trunc_roundNumberCases", + (SDLTest_TestCaseFp)trunc_roundNumbersCases, "trunc_roundNumberCases", "Checks a set of integral values", TEST_ENABLED }; static const SDLTest_TestCaseReference truncTestFraction = { - (SDLTest_TestCaseFp) trunc_fractionCases, "trunc_fractionCases", + (SDLTest_TestCaseFp)trunc_fractionCases, "trunc_fractionCases", "Checks a set of fractions", TEST_ENABLED }; static const SDLTest_TestCaseReference truncTestRange = { - (SDLTest_TestCaseFp) trunc_rangeTest, "trunc_rangeTest", + (SDLTest_TestCaseFp)trunc_rangeTest, "trunc_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_round test cases */ static const SDLTest_TestCaseReference roundTestInf = { - (SDLTest_TestCaseFp) round_infCases, "round_infCases", + (SDLTest_TestCaseFp)round_infCases, "round_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference roundTestZero = { - (SDLTest_TestCaseFp) round_zeroCases, "round_zeroCases", + (SDLTest_TestCaseFp)round_zeroCases, "round_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference roundTestNan = { - (SDLTest_TestCaseFp) round_nanCase, "round_nanCase", + (SDLTest_TestCaseFp)round_nanCase, "round_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference roundTestRound = { - (SDLTest_TestCaseFp) round_roundNumbersCases, "round_roundNumberCases", + (SDLTest_TestCaseFp)round_roundNumbersCases, "round_roundNumberCases", "Checks a set of integral values", TEST_ENABLED }; static const SDLTest_TestCaseReference roundTestFraction = { - (SDLTest_TestCaseFp) round_fractionCases, "round_fractionCases", + (SDLTest_TestCaseFp)round_fractionCases, "round_fractionCases", "Checks a set of fractions", TEST_ENABLED }; static const SDLTest_TestCaseReference roundTestRange = { - (SDLTest_TestCaseFp) round_rangeTest, "round_rangeTest", + (SDLTest_TestCaseFp)round_rangeTest, "round_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_fabs test cases */ static const SDLTest_TestCaseReference fabsTestInf = { - (SDLTest_TestCaseFp) fabs_infCases, "fabs_infCases", + (SDLTest_TestCaseFp)fabs_infCases, "fabs_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference fabsTestZero = { - (SDLTest_TestCaseFp) fabs_zeroCases, "fabs_zeroCases", + (SDLTest_TestCaseFp)fabs_zeroCases, "fabs_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference fabsTestNan = { - (SDLTest_TestCaseFp) fabs_nanCase, "fabs_nanCase", + (SDLTest_TestCaseFp)fabs_nanCase, "fabs_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference fabsTestRange = { - (SDLTest_TestCaseFp) fabs_rangeTest, "fabs_rangeTest", + (SDLTest_TestCaseFp)fabs_rangeTest, "fabs_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_copysign test cases */ static const SDLTest_TestCaseReference copysignTestInf = { - (SDLTest_TestCaseFp) copysign_infCases, "copysign_infCases", + (SDLTest_TestCaseFp)copysign_infCases, "copysign_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference copysignTestZero = { - (SDLTest_TestCaseFp) copysign_zeroCases, "copysign_zeroCases", + (SDLTest_TestCaseFp)copysign_zeroCases, "copysign_zeroCases", "Checks positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference copysignTestNan = { - (SDLTest_TestCaseFp) copysign_nanCases, "copysign_nanCases", + (SDLTest_TestCaseFp)copysign_nanCases, "copysign_nanCases", "Checks NANs", TEST_ENABLED }; static const SDLTest_TestCaseReference copysignTestRange = { - (SDLTest_TestCaseFp) copysign_rangeTest, "copysign_rangeTest", + (SDLTest_TestCaseFp)copysign_rangeTest, "copysign_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_fmod test cases */ static const SDLTest_TestCaseReference fmodTestDivOfInf = { - (SDLTest_TestCaseFp) fmod_divOfInfCases, "fmod_divOfInfCases", + (SDLTest_TestCaseFp)fmod_divOfInfCases, "fmod_divOfInfCases", "Checks division of positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestDivByInf = { - (SDLTest_TestCaseFp) fmod_divByInfCases, "fmod_divByInfCases", + (SDLTest_TestCaseFp)fmod_divByInfCases, "fmod_divByInfCases", "Checks division by positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestDivOfZero = { - (SDLTest_TestCaseFp) fmod_divOfZeroCases, "fmod_divOfZeroCases", + (SDLTest_TestCaseFp)fmod_divOfZeroCases, "fmod_divOfZeroCases", "Checks division of positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestDivByZero = { - (SDLTest_TestCaseFp) fmod_divByZeroCases, "fmod_divByZeroCases", + (SDLTest_TestCaseFp)fmod_divByZeroCases, "fmod_divByZeroCases", "Checks division by positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestNan = { - (SDLTest_TestCaseFp) fmod_nanCases, "fmod_nanCases", + (SDLTest_TestCaseFp)fmod_nanCases, "fmod_nanCases", "Checks NANs", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestRegular = { - (SDLTest_TestCaseFp) fmod_regularCases, "fmod_regularCases", + (SDLTest_TestCaseFp)fmod_regularCases, "fmod_regularCases", "Checks a set of regular values", TEST_ENABLED }; static const SDLTest_TestCaseReference fmodTestRange = { - (SDLTest_TestCaseFp) fmod_rangeTest, "fmod_rangeTest", + (SDLTest_TestCaseFp)fmod_rangeTest, "fmod_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_exp test cases */ static const SDLTest_TestCaseReference expTestInf = { - (SDLTest_TestCaseFp) exp_infCases, "exp_infCases", + (SDLTest_TestCaseFp)exp_infCases, "exp_infCases", "Checks positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference expTestZero = { - (SDLTest_TestCaseFp) exp_zeroCases, "exp_zeroCases", + (SDLTest_TestCaseFp)exp_zeroCases, "exp_zeroCases", "Checks for positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference expTestOverflow = { - (SDLTest_TestCaseFp) exp_overflowCase, "exp_overflowCase", + (SDLTest_TestCaseFp)exp_overflowCase, "exp_overflowCase", "Checks for overflow", TEST_ENABLED }; static const SDLTest_TestCaseReference expTestBase = { - (SDLTest_TestCaseFp) exp_baseCase, "exp_baseCase", + (SDLTest_TestCaseFp)exp_baseCase, "exp_baseCase", "Checks the base case", TEST_ENABLED }; static const SDLTest_TestCaseReference expTestRegular = { - (SDLTest_TestCaseFp) exp_regularCases, "exp_regularCases", + (SDLTest_TestCaseFp)exp_regularCases, "exp_regularCases", "Checks a set of regular values", TEST_ENABLED }; /* SDL_log test cases */ static const SDLTest_TestCaseReference logTestLimit = { - (SDLTest_TestCaseFp) log_limitCases, "log_limitCases", + (SDLTest_TestCaseFp)log_limitCases, "log_limitCases", "Checks the domain limits", TEST_ENABLED }; static const SDLTest_TestCaseReference logTestNan = { - (SDLTest_TestCaseFp) log_nanCases, "log_nanCases", + (SDLTest_TestCaseFp)log_nanCases, "log_nanCases", "Checks NAN and negative values", TEST_ENABLED }; static const SDLTest_TestCaseReference logTestBase = { - (SDLTest_TestCaseFp) log_baseCases, "log_baseCases", + (SDLTest_TestCaseFp)log_baseCases, "log_baseCases", "Checks the base cases", TEST_ENABLED }; static const SDLTest_TestCaseReference logTestRegular = { - (SDLTest_TestCaseFp) log_regularCases, "log_regularCases", + (SDLTest_TestCaseFp)log_regularCases, "log_regularCases", "Checks a set of regular values", TEST_ENABLED }; /* SDL_log10 test cases */ static const SDLTest_TestCaseReference log10TestLimit = { - (SDLTest_TestCaseFp) log10_limitCases, "log10_limitCases", + (SDLTest_TestCaseFp)log10_limitCases, "log10_limitCases", "Checks the domain limits", TEST_ENABLED }; static const SDLTest_TestCaseReference log10TestNan = { - (SDLTest_TestCaseFp) log10_nanCases, "log10_nanCases", + (SDLTest_TestCaseFp)log10_nanCases, "log10_nanCases", "Checks NAN and negative values", TEST_ENABLED }; static const SDLTest_TestCaseReference log10TestBase = { - (SDLTest_TestCaseFp) log10_baseCases, "log10_baseCases", + (SDLTest_TestCaseFp)log10_baseCases, "log10_baseCases", "Checks the base cases", TEST_ENABLED }; static const SDLTest_TestCaseReference log10TestRegular = { - (SDLTest_TestCaseFp) log10_regularCases, "log10_regularCases", + (SDLTest_TestCaseFp)log10_regularCases, "log10_regularCases", "Checks a set of regular values", TEST_ENABLED }; /* SDL_pow test cases */ static const SDLTest_TestCaseReference powTestExpInf1 = { - (SDLTest_TestCaseFp) pow_baseNOneExpInfCases, "pow_baseNOneExpInfCases", + (SDLTest_TestCaseFp)pow_baseNOneExpInfCases, "pow_baseNOneExpInfCases", "Checks for pow(-1, +/-inf)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestExpInf2 = { - (SDLTest_TestCaseFp) pow_baseZeroExpNInfCases, "pow_baseZeroExpNInfCases", + (SDLTest_TestCaseFp)pow_baseZeroExpNInfCases, "pow_baseZeroExpNInfCases", "Checks for pow(+/-0, -inf)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestExpInf3 = { - (SDLTest_TestCaseFp) pow_expInfCases, "pow_expInfCases", + (SDLTest_TestCaseFp)pow_expInfCases, "pow_expInfCases", "Checks for pow(x, +/-inf)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestBaseInf1 = { - (SDLTest_TestCaseFp) pow_basePInfCases, "pow_basePInfCases", + (SDLTest_TestCaseFp)pow_basePInfCases, "pow_basePInfCases", "Checks for pow(inf, x)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestBaseInf2 = { - (SDLTest_TestCaseFp) pow_baseNInfCases, "pow_baseNInfCases", + (SDLTest_TestCaseFp)pow_baseNInfCases, "pow_baseNInfCases", "Checks for pow(-inf, x)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestNan1 = { - (SDLTest_TestCaseFp) pow_badOperationCase, "pow_badOperationCase", + (SDLTest_TestCaseFp)pow_badOperationCase, "pow_badOperationCase", "Checks for negative finite base and non-integer finite exponent", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestNan2 = { - (SDLTest_TestCaseFp) pow_base1ExpNanCase, "pow_base1ExpNanCase", + (SDLTest_TestCaseFp)pow_base1ExpNanCase, "pow_base1ExpNanCase", "Checks for pow(1.0, NAN)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestNan3 = { - (SDLTest_TestCaseFp) pow_baseNanExp0Cases, "pow_baseNanExp0Cases", + (SDLTest_TestCaseFp)pow_baseNanExp0Cases, "pow_baseNanExp0Cases", "Checks for pow(NAN, +/-0)", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestNan4 = { - (SDLTest_TestCaseFp) pow_nanArgsCases, "pow_nanArgsCases", + (SDLTest_TestCaseFp)pow_nanArgsCases, "pow_nanArgsCases", "Checks for pow(x, y) with either x or y being NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestZero1 = { - (SDLTest_TestCaseFp) pow_baseNZeroExpOddCases, "pow_baseNZeroExpOddCases", + (SDLTest_TestCaseFp)pow_baseNZeroExpOddCases, "pow_baseNZeroExpOddCases", "Checks for pow(-0.0, y), with y an odd integer.", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestZero2 = { - (SDLTest_TestCaseFp) pow_basePZeroExpOddCases, "pow_basePZeroExpOddCases", + (SDLTest_TestCaseFp)pow_basePZeroExpOddCases, "pow_basePZeroExpOddCases", "Checks for pow(0.0, y), with y an odd integer.", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestZero3 = { - (SDLTest_TestCaseFp) pow_baseNZeroCases, "pow_baseNZeroCases", + (SDLTest_TestCaseFp)pow_baseNZeroCases, "pow_baseNZeroCases", "Checks for pow(-0.0, y), with y finite and even or non-integer number", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestZero4 = { - (SDLTest_TestCaseFp) pow_basePZeroCases, "pow_basePZeroCases", + (SDLTest_TestCaseFp)pow_basePZeroCases, "pow_basePZeroCases", "Checks for pow(0.0, y), with y finite and even or non-integer number", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestRegular = { - (SDLTest_TestCaseFp) pow_regularCases, "pow_regularCases", + (SDLTest_TestCaseFp)pow_regularCases, "pow_regularCases", "Checks a set of regular values", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestPowOf2 = { - (SDLTest_TestCaseFp) pow_powerOfTwo, "pow_powerOfTwo", + (SDLTest_TestCaseFp)pow_powerOfTwo, "pow_powerOfTwo", "Checks the powers of two from 1 to 8", TEST_ENABLED }; static const SDLTest_TestCaseReference powTestRange = { - (SDLTest_TestCaseFp) pow_rangeTest, "pow_rangeTest", + (SDLTest_TestCaseFp)pow_rangeTest, "pow_rangeTest", "Checks a range of positive integer to the power of 0", TEST_ENABLED }; /* SDL_sqrt test cases */ static const SDLTest_TestCaseReference sqrtTestInf = { - (SDLTest_TestCaseFp) sqrt_infCase, "sqrt_infCase", + (SDLTest_TestCaseFp)sqrt_infCase, "sqrt_infCase", "Checks positive infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference sqrtTestNan = { - (SDLTest_TestCaseFp) sqrt_nanCase, "sqrt_nanCase", + (SDLTest_TestCaseFp)sqrt_nanCase, "sqrt_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference sqrtTestDomain = { - (SDLTest_TestCaseFp) sqrt_outOfDomainCases, "sqrt_outOfDomainCases", + (SDLTest_TestCaseFp)sqrt_outOfDomainCases, "sqrt_outOfDomainCases", "Checks for values out of the domain", TEST_ENABLED }; static const SDLTest_TestCaseReference sqrtTestBase = { - (SDLTest_TestCaseFp) sqrt_baseCases, "sqrt_baseCases", + (SDLTest_TestCaseFp)sqrt_baseCases, "sqrt_baseCases", "Checks the base cases", TEST_ENABLED }; static const SDLTest_TestCaseReference sqrtTestRegular = { - (SDLTest_TestCaseFp) sqrt_regularCases, "sqrt_regularCases", + (SDLTest_TestCaseFp)sqrt_regularCases, "sqrt_regularCases", "Checks a set of regular values", TEST_ENABLED }; /* SDL_scalbn test cases */ static const SDLTest_TestCaseReference scalbnTestInf = { - (SDLTest_TestCaseFp) scalbn_infCases, "scalbn_infCases", + (SDLTest_TestCaseFp)scalbn_infCases, "scalbn_infCases", "Checks positive and negative infinity arg", TEST_ENABLED }; static const SDLTest_TestCaseReference scalbnTestBaseZero = { - (SDLTest_TestCaseFp) scalbn_baseZeroCases, "scalbn_baseZeroCases", + (SDLTest_TestCaseFp)scalbn_baseZeroCases, "scalbn_baseZeroCases", "Checks for positive and negative zero arg", TEST_ENABLED }; static const SDLTest_TestCaseReference scalbnTestExpZero = { - (SDLTest_TestCaseFp) scalbn_expZeroCase, "scalbn_expZeroCase", + (SDLTest_TestCaseFp)scalbn_expZeroCase, "scalbn_expZeroCase", "Checks for zero exp", TEST_ENABLED }; static const SDLTest_TestCaseReference scalbnTestNan = { - (SDLTest_TestCaseFp) scalbn_nanCase, "scalbn_nanCase", + (SDLTest_TestCaseFp)scalbn_nanCase, "scalbn_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference scalbnTestRegular = { - (SDLTest_TestCaseFp) scalbn_regularCases, "scalbn_regularCases", + (SDLTest_TestCaseFp)scalbn_regularCases, "scalbn_regularCases", "Checks a set of regular cases", TEST_ENABLED }; /* SDL_cos test cases */ static const SDLTest_TestCaseReference cosTestInf = { - (SDLTest_TestCaseFp) cos_infCases, "cos_infCases", + (SDLTest_TestCaseFp)cos_infCases, "cos_infCases", "Checks for positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference cosTestNan = { - (SDLTest_TestCaseFp) cos_nanCase, "cos_nanCase", + (SDLTest_TestCaseFp)cos_nanCase, "cos_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference cosTestRegular = { - (SDLTest_TestCaseFp) cos_regularCases, "cos_regularCases", + (SDLTest_TestCaseFp)cos_regularCases, "cos_regularCases", "Checks a set of regular cases", TEST_ENABLED }; static const SDLTest_TestCaseReference cosTestPrecision = { - (SDLTest_TestCaseFp) cos_precisionTest, "cos_precisionTest", + (SDLTest_TestCaseFp)cos_precisionTest, "cos_precisionTest", "Checks cosine precision", TEST_ENABLED }; static const SDLTest_TestCaseReference cosTestRange = { - (SDLTest_TestCaseFp) cos_rangeTest, "cos_rangeTest", + (SDLTest_TestCaseFp)cos_rangeTest, "cos_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_sin test cases */ static const SDLTest_TestCaseReference sinTestInf = { - (SDLTest_TestCaseFp) sin_infCases, "sin_infCases", + (SDLTest_TestCaseFp)sin_infCases, "sin_infCases", "Checks for positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference sinTestNan = { - (SDLTest_TestCaseFp) sin_nanCase, "sin_nanCase", + (SDLTest_TestCaseFp)sin_nanCase, "sin_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference sinTestRegular = { - (SDLTest_TestCaseFp) sin_regularCases, "sin_regularCases", + (SDLTest_TestCaseFp)sin_regularCases, "sin_regularCases", "Checks a set of regular cases", TEST_ENABLED }; static const SDLTest_TestCaseReference sinTestPrecision = { - (SDLTest_TestCaseFp) sin_precisionTest, "sin_precisionTest", + (SDLTest_TestCaseFp)sin_precisionTest, "sin_precisionTest", "Checks sine precision", TEST_ENABLED }; static const SDLTest_TestCaseReference sinTestRange = { - (SDLTest_TestCaseFp) sin_rangeTest, "sin_rangeTest", + (SDLTest_TestCaseFp)sin_rangeTest, "sin_rangeTest", "Checks a range of positive integer", TEST_ENABLED }; /* SDL_tan test cases */ static const SDLTest_TestCaseReference tanTestInf = { - (SDLTest_TestCaseFp) tan_infCases, "tan_infCases", + (SDLTest_TestCaseFp)tan_infCases, "tan_infCases", "Checks for positive and negative infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference tanTestNan = { - (SDLTest_TestCaseFp) tan_nanCase, "tan_nanCase", + (SDLTest_TestCaseFp)tan_nanCase, "tan_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference tanTestZero = { - (SDLTest_TestCaseFp) tan_zeroCases, "tan_zeroCases", + (SDLTest_TestCaseFp)tan_zeroCases, "tan_zeroCases", "Checks a set of regular cases", TEST_ENABLED }; static const SDLTest_TestCaseReference tanTestPrecision = { - (SDLTest_TestCaseFp) tan_precisionTest, "tan_precisionTest", + (SDLTest_TestCaseFp)tan_precisionTest, "tan_precisionTest", "Checks tangent precision", TEST_ENABLED }; /* SDL_acos test cases */ static const SDLTest_TestCaseReference acosTestLimit = { - (SDLTest_TestCaseFp) acos_limitCases, "acos_limitCases", + (SDLTest_TestCaseFp)acos_limitCases, "acos_limitCases", "Checks the edge of the domain (+/-1)", TEST_ENABLED }; static const SDLTest_TestCaseReference acosTestOutOfDomain = { - (SDLTest_TestCaseFp) acos_outOfDomainCases, "acos_outOfDomainCases", + (SDLTest_TestCaseFp)acos_outOfDomainCases, "acos_outOfDomainCases", "Checks values outside the domain", TEST_ENABLED }; static const SDLTest_TestCaseReference acosTestNan = { - (SDLTest_TestCaseFp) acos_nanCase, "acos_nanCase", + (SDLTest_TestCaseFp)acos_nanCase, "acos_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference acosTestPrecision = { - (SDLTest_TestCaseFp) acos_precisionTest, "acos_precisionTest", + (SDLTest_TestCaseFp)acos_precisionTest, "acos_precisionTest", "Checks acos precision", TEST_ENABLED }; /* SDL_asin test cases */ static const SDLTest_TestCaseReference asinTestLimit = { - (SDLTest_TestCaseFp) asin_limitCases, "asin_limitCases", + (SDLTest_TestCaseFp)asin_limitCases, "asin_limitCases", "Checks the edge of the domain (+/-1)", TEST_ENABLED }; static const SDLTest_TestCaseReference asinTestOutOfDomain = { - (SDLTest_TestCaseFp) asin_outOfDomainCases, "asin_outOfDomainCases", + (SDLTest_TestCaseFp)asin_outOfDomainCases, "asin_outOfDomainCases", "Checks values outside the domain", TEST_ENABLED }; static const SDLTest_TestCaseReference asinTestNan = { - (SDLTest_TestCaseFp) asin_nanCase, "asin_nanCase", + (SDLTest_TestCaseFp)asin_nanCase, "asin_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference asinTestPrecision = { - (SDLTest_TestCaseFp) asin_precisionTest, "asin_precisionTest", + (SDLTest_TestCaseFp)asin_precisionTest, "asin_precisionTest", "Checks asin precision", TEST_ENABLED }; /* SDL_atan test cases */ static const SDLTest_TestCaseReference atanTestLimit = { - (SDLTest_TestCaseFp) atan_limitCases, "atan_limitCases", + (SDLTest_TestCaseFp)atan_limitCases, "atan_limitCases", "Checks the edge of the domain (+/-Infinity)", TEST_ENABLED }; static const SDLTest_TestCaseReference atanTestZero = { - (SDLTest_TestCaseFp) atan_zeroCases, "atan_zeroCases", + (SDLTest_TestCaseFp)atan_zeroCases, "atan_zeroCases", "Checks for positive and negative zero", TEST_ENABLED }; static const SDLTest_TestCaseReference atanTestNan = { - (SDLTest_TestCaseFp) atan_nanCase, "atan_nanCase", + (SDLTest_TestCaseFp)atan_nanCase, "atan_nanCase", "Checks NAN", TEST_ENABLED }; static const SDLTest_TestCaseReference atanTestPrecision = { - (SDLTest_TestCaseFp) atan_precisionTest, "atan_precisionTest", + (SDLTest_TestCaseFp)atan_precisionTest, "atan_precisionTest", "Checks atan precision", TEST_ENABLED }; /* SDL_atan2 test cases */ static const SDLTest_TestCaseReference atan2TestZero1 = { - (SDLTest_TestCaseFp) atan2_bothZeroCases, "atan2_bothZeroCases", + (SDLTest_TestCaseFp)atan2_bothZeroCases, "atan2_bothZeroCases", "Checks for both arguments being zero", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestZero2 = { - (SDLTest_TestCaseFp) atan2_yZeroCases, "atan2_yZeroCases", + (SDLTest_TestCaseFp)atan2_yZeroCases, "atan2_yZeroCases", "Checks for y=0", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestZero3 = { - (SDLTest_TestCaseFp) atan2_xZeroCases, "atan2_xZeroCases", + (SDLTest_TestCaseFp)atan2_xZeroCases, "atan2_xZeroCases", "Checks for x=0", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestInf1 = { - (SDLTest_TestCaseFp) atan2_bothInfCases, "atan2_bothInfCases", + (SDLTest_TestCaseFp)atan2_bothInfCases, "atan2_bothInfCases", "Checks for both arguments being infinity", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestInf2 = { - (SDLTest_TestCaseFp) atan2_yInfCases, "atan2_yInfCases", + (SDLTest_TestCaseFp)atan2_yInfCases, "atan2_yInfCases", "Checks for y=0", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestInf3 = { - (SDLTest_TestCaseFp) atan2_xInfCases, "atan2_xInfCases", + (SDLTest_TestCaseFp)atan2_xInfCases, "atan2_xInfCases", "Checks for x=0", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestNan = { - (SDLTest_TestCaseFp) atan2_nanCases, "atan2_nanCases", + (SDLTest_TestCaseFp)atan2_nanCases, "atan2_nanCases", "Checks NANs", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestQuadrantTopRight = { - (SDLTest_TestCaseFp) atan2_topRightQuadrantTest, "atan2_topRightQuadrantTest", + (SDLTest_TestCaseFp)atan2_topRightQuadrantTest, "atan2_topRightQuadrantTest", "Checks values in the top right quadrant", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestQuadrantTopLeft = { - (SDLTest_TestCaseFp) atan2_topLeftQuadrantTest, "atan2_topLeftQuadrantTest", + (SDLTest_TestCaseFp)atan2_topLeftQuadrantTest, "atan2_topLeftQuadrantTest", "Checks values in the top left quadrant", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestQuadrantBottomRight = { - (SDLTest_TestCaseFp) atan2_bottomRightQuadrantTest, "atan2_bottomRightQuadrantTest", + (SDLTest_TestCaseFp)atan2_bottomRightQuadrantTest, "atan2_bottomRightQuadrantTest", "Checks values in the bottom right quadrant", TEST_ENABLED }; static const SDLTest_TestCaseReference atan2TestQuadrantBottomLeft = { - (SDLTest_TestCaseFp) atan2_bottomLeftQuadrantTest, "atan2_bottomLeftQuadrantTest", + (SDLTest_TestCaseFp)atan2_bottomLeftQuadrantTest, "atan2_bottomLeftQuadrantTest", "Checks values in the bottom left quadrant", TEST_ENABLED }; diff --git a/test/testautomation_mouse.c b/test/testautomation_mouse.c index f8334803ea218..19b1a9f58ca74 100644 --- a/test/testautomation_mouse.c +++ b/test/testautomation_mouse.c @@ -15,178 +15,175 @@ /* Helper to evaluate state returned from SDL_GetMouseState */ int _mouseStateCheck(Uint32 state) { - return (state == 0) || - (state == SDL_BUTTON(SDL_BUTTON_LEFT)) || - (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) || - (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) || - (state == SDL_BUTTON(SDL_BUTTON_X1)) || - (state == SDL_BUTTON(SDL_BUTTON_X2)); + return (state == 0) || + (state == SDL_BUTTON(SDL_BUTTON_LEFT)) || + (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) || + (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) || + (state == SDL_BUTTON(SDL_BUTTON_X1)) || + (state == SDL_BUTTON(SDL_BUTTON_X2)); } /** * @brief Check call to SDL_GetMouseState * */ -int -mouse_getMouseState(void *arg) +int mouse_getMouseState(void *arg) { - int x; - int y; - Uint32 state; - - /* Pump some events to update mouse state */ - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - - /* Case where x, y pointer is NULL */ - state = SDL_GetMouseState(NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)"); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where x pointer is not NULL */ - x = INT_MIN; - state = SDL_GetMouseState(&x, NULL); - SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)"); - SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where y pointer is not NULL */ - y = INT_MIN; - state = SDL_GetMouseState(NULL, &y); - SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)"); - SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where x and y pointer is not NULL */ - x = INT_MIN; - y = INT_MIN; - state = SDL_GetMouseState(&x, &y); - SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)"); - SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); - SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - return TEST_COMPLETED; + int x; + int y; + Uint32 state; + + /* Pump some events to update mouse state */ + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + + /* Case where x, y pointer is NULL */ + state = SDL_GetMouseState(NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)"); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where x pointer is not NULL */ + x = INT_MIN; + state = SDL_GetMouseState(&x, NULL); + SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)"); + SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where y pointer is not NULL */ + y = INT_MIN; + state = SDL_GetMouseState(NULL, &y); + SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)"); + SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where x and y pointer is not NULL */ + x = INT_MIN; + y = INT_MIN; + state = SDL_GetMouseState(&x, &y); + SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)"); + SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); + SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + return TEST_COMPLETED; } /** * @brief Check call to SDL_GetRelativeMouseState * */ -int -mouse_getRelativeMouseState(void *arg) +int mouse_getRelativeMouseState(void *arg) { - int x; - int y; - Uint32 state; - - /* Pump some events to update mouse state */ - SDL_PumpEvents(); - SDLTest_AssertPass("Call to SDL_PumpEvents()"); - - /* Case where x, y pointer is NULL */ - state = SDL_GetRelativeMouseState(NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)"); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where x pointer is not NULL */ - x = INT_MIN; - state = SDL_GetRelativeMouseState(&x, NULL); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)"); - SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where y pointer is not NULL */ - y = INT_MIN; - state = SDL_GetRelativeMouseState(NULL, &y); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)"); - SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - /* Case where x and y pointer is not NULL */ - x = INT_MIN; - y = INT_MIN; - state = SDL_GetRelativeMouseState(&x, &y); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)"); - SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); - SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); - SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); - - return TEST_COMPLETED; -} + int x; + int y; + Uint32 state; + /* Pump some events to update mouse state */ + SDL_PumpEvents(); + SDLTest_AssertPass("Call to SDL_PumpEvents()"); + + /* Case where x, y pointer is NULL */ + state = SDL_GetRelativeMouseState(NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)"); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where x pointer is not NULL */ + x = INT_MIN; + state = SDL_GetRelativeMouseState(&x, NULL); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)"); + SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where y pointer is not NULL */ + y = INT_MIN; + state = SDL_GetRelativeMouseState(NULL, &y); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)"); + SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + /* Case where x and y pointer is not NULL */ + x = INT_MIN; + y = INT_MIN; + state = SDL_GetRelativeMouseState(&x, &y); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)"); + SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x); + SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y); + SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state); + + return TEST_COMPLETED; +} /* XPM definition of mouse Cursor */ static const char *_mouseArrowData[] = { - /* pixels */ - "X ", - "XX ", - "X.X ", - "X..X ", - "X...X ", - "X....X ", - "X.....X ", - "X......X ", - "X.......X ", - "X........X ", - "X.....XXXXX ", - "X..X..X ", - "X.X X..X ", - "XX X..X ", - "X X..X ", - " X..X ", - " X..X ", - " X..X ", - " XX ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " " + /* pixels */ + "X ", + "XX ", + "X.X ", + "X..X ", + "X...X ", + "X....X ", + "X.....X ", + "X......X ", + "X.......X ", + "X........X ", + "X.....XXXXX ", + "X..X..X ", + "X.X X..X ", + "XX X..X ", + "X X..X ", + " X..X ", + " X..X ", + " X..X ", + " XX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " }; /* Helper that creates a new mouse cursor from an XPM */ static SDL_Cursor *_initArrowCursor(const char *image[]) { - SDL_Cursor *cursor; - int i, row, col; - Uint8 data[4*32]; - Uint8 mask[4*32]; - - i = -1; - for ( row=0; row<32; ++row ) { - for ( col=0; col<32; ++col ) { - if ( col % 8 ) { - data[i] <<= 1; - mask[i] <<= 1; - } else { - ++i; - data[i] = mask[i] = 0; - } - switch (image[row][col]) { - case 'X': - data[i] |= 0x01; - mask[i] |= 0x01; - break; - case '.': - mask[i] |= 0x01; - break; - case ' ': - break; - } + SDL_Cursor *cursor; + int i, row, col; + Uint8 data[4 * 32]; + Uint8 mask[4 * 32]; + + i = -1; + for (row = 0; row < 32; ++row) { + for (col = 0; col < 32; ++col) { + if (col % 8) { + data[i] <<= 1; + mask[i] <<= 1; + } else { + ++i; + data[i] = mask[i] = 0; + } + switch (image[row][col]) { + case 'X': + data[i] |= 0x01; + mask[i] |= 0x01; + break; + case '.': + mask[i] |= 0x01; + break; + case ' ': + break; + } + } } - } - cursor = SDL_CreateCursor(data, mask, 32, 32, 0, 0); - return cursor; + cursor = SDL_CreateCursor(data, mask, 32, 32, 0, 0); + return cursor; } /** @@ -195,15 +192,14 @@ static SDL_Cursor *_initArrowCursor(const char *image[]) * @sa http://wiki.libsdl.org/SDL_CreateCursor * @sa http://wiki.libsdl.org/SDL_FreeCursor */ -int -mouse_createFreeCursor(void *arg) +int mouse_createFreeCursor(void *arg) { SDL_Cursor *cursor; /* Create a cursor */ cursor = _initArrowCursor(_mouseArrowData); - SDLTest_AssertPass("Call to SDL_CreateCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); + SDLTest_AssertPass("Call to SDL_CreateCursor()"); + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); if (cursor == NULL) { return TEST_ABORTED; } @@ -221,8 +217,7 @@ mouse_createFreeCursor(void *arg) * @sa http://wiki.libsdl.org/SDL_CreateColorCursor * @sa http://wiki.libsdl.org/SDL_FreeCursor */ -int -mouse_createFreeColorCursor(void *arg) +int mouse_createFreeColorCursor(void *arg) { SDL_Surface *face; SDL_Cursor *cursor; @@ -230,12 +225,14 @@ mouse_createFreeColorCursor(void *arg) /* Get sample surface */ face = SDLTest_ImageFace(); SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL"); - if (face == NULL) return TEST_ABORTED; + if (face == NULL) { + return TEST_ABORTED; + } /* Create a color cursor from surface */ cursor = SDL_CreateColorCursor(face, 0, 0); - SDLTest_AssertPass("Call to SDL_CreateColorCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL"); + SDLTest_AssertPass("Call to SDL_CreateColorCursor()"); + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL"); if (cursor == NULL) { SDL_FreeSurface(face); return TEST_ABORTED; @@ -258,18 +255,18 @@ void _changeCursorVisibility(int state) int newState; int result; - oldState = SDL_ShowCursor(SDL_QUERY); + oldState = SDL_ShowCursor(SDL_QUERY); SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); - result = SDL_ShowCursor(state); + result = SDL_ShowCursor(state); SDLTest_AssertPass("Call to SDL_ShowCursor(%s)", (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE"); SDLTest_AssertCheck(result == oldState, "Validate result from SDL_ShowCursor(%s), expected: %i, got: %i", - (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result); + (state == SDL_ENABLE) ? "SDL_ENABLE" : "SDL_DISABLE", oldState, result); newState = SDL_ShowCursor(SDL_QUERY); SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); SDLTest_AssertCheck(state == newState, "Validate new state, expected: %i, got: %i", - state, newState); + state, newState); } /** @@ -277,8 +274,7 @@ void _changeCursorVisibility(int state) * * @sa http://wiki.libsdl.org/SDL_ShowCursor */ -int -mouse_showCursor(void *arg) +int mouse_showCursor(void *arg) { int currentState; @@ -286,7 +282,7 @@ mouse_showCursor(void *arg) currentState = SDL_ShowCursor(SDL_QUERY); SDLTest_AssertPass("Call to SDL_ShowCursor(SDL_QUERY)"); SDLTest_AssertCheck(currentState == SDL_DISABLE || currentState == SDL_ENABLE, - "Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState); + "Validate result is %i or %i, got: %i", SDL_DISABLE, SDL_ENABLE, currentState); if (currentState == SDL_DISABLE) { /* Show the cursor, then hide it again */ _changeCursorVisibility(SDL_ENABLE); @@ -307,15 +303,14 @@ mouse_showCursor(void *arg) * * @sa http://wiki.libsdl.org/SDL_SetCursor */ -int -mouse_setCursor(void *arg) +int mouse_setCursor(void *arg) { SDL_Cursor *cursor; /* Create a cursor */ cursor = _initArrowCursor(_mouseArrowData); - SDLTest_AssertPass("Call to SDL_CreateCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); + SDLTest_AssertPass("Call to SDL_CreateCursor()"); + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateCursor() is not NULL"); if (cursor == NULL) { return TEST_ABORTED; } @@ -340,15 +335,14 @@ mouse_setCursor(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetCursor */ -int -mouse_getCursor(void *arg) +int mouse_getCursor(void *arg) { SDL_Cursor *cursor; /* Get current cursor */ cursor = SDL_GetCursor(); - SDLTest_AssertPass("Call to SDL_GetCursor()"); - SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL"); + SDLTest_AssertPass("Call to SDL_GetCursor()"); + SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL"); return TEST_COMPLETED; } @@ -359,52 +353,51 @@ mouse_getCursor(void *arg) * @sa http://wiki.libsdl.org/SDL_GetRelativeMouseMode * @sa http://wiki.libsdl.org/SDL_SetRelativeMouseMode */ -int -mouse_getSetRelativeMouseMode(void *arg) +int mouse_getSetRelativeMouseMode(void *arg) { int result; - int i; + int i; SDL_bool initialState; SDL_bool currentState; /* Capture original state so we can revert back to it later */ initialState = SDL_GetRelativeMouseMode(); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); - /* Repeat twice to check D->D transition */ - for (i=0; i<2; i++) { - /* Disable - should always be supported */ - result = SDL_SetRelativeMouseMode(SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); - SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); - currentState = SDL_GetRelativeMouseMode(); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); - SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); - } + /* Repeat twice to check D->D transition */ + for (i = 0; i < 2; i++) { + /* Disable - should always be supported */ + result = SDL_SetRelativeMouseMode(SDL_FALSE); + SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); + SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); + currentState = SDL_GetRelativeMouseMode(); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); + SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); + } - /* Repeat twice to check D->E->E transition */ - for (i=0; i<2; i++) { - /* Enable - may not be supported */ - result = SDL_SetRelativeMouseMode(SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)"); - if (result != -1) { + /* Repeat twice to check D->E->E transition */ + for (i = 0; i < 2; i++) { + /* Enable - may not be supported */ + result = SDL_SetRelativeMouseMode(SDL_TRUE); + SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)"); + if (result != -1) { SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); - currentState = SDL_GetRelativeMouseMode(); + currentState = SDL_GetRelativeMouseMode(); SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState); - } } + } /* Disable to check E->D transition */ - result = SDL_SetRelativeMouseMode(SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); - SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); + result = SDL_SetRelativeMouseMode(SDL_FALSE); + SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)"); + SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result); currentState = SDL_GetRelativeMouseMode(); - SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); - SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); + SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()"); + SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState); - /* Revert to original state - ignore result */ - result = SDL_SetRelativeMouseMode(initialState); + /* Revert to original state - ignore result */ + result = SDL_SetRelativeMouseMode(initialState); return TEST_COMPLETED; } @@ -417,12 +410,12 @@ mouse_getSetRelativeMouseMode(void *arg) */ SDL_Window *_createMouseSuiteTestWindow() { - int posX = 100, posY = 100, width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT; - SDL_Window *window; - window = SDL_CreateWindow("mouse_createMouseSuiteTestWindow", posX, posY, width, height, 0); - SDLTest_AssertPass("SDL_CreateWindow()"); - SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result"); - return window; + int posX = 100, posY = 100, width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT; + SDL_Window *window; + window = SDL_CreateWindow("mouse_createMouseSuiteTestWindow", posX, posY, width, height, 0); + SDLTest_AssertPass("SDL_CreateWindow()"); + SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result"); + return window; } /* @@ -430,11 +423,11 @@ SDL_Window *_createMouseSuiteTestWindow() */ void _destroyMouseSuiteTestWindow(SDL_Window *window) { - if (window != NULL) { - SDL_DestroyWindow(window); - window = NULL; - SDLTest_AssertPass("SDL_DestroyWindow()"); - } + if (window) { + SDL_DestroyWindow(window); + window = NULL; + SDLTest_AssertPass("SDL_DestroyWindow()"); + } } /** @@ -442,8 +435,7 @@ void _destroyMouseSuiteTestWindow(SDL_Window *window) * * @sa http://wiki.libsdl.org/SDL_WarpMouseInWindow */ -int -mouse_warpMouseInWindow(void *arg) +int mouse_warpMouseInWindow(void *arg) { const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT; int numPositions = 6; @@ -455,45 +447,46 @@ mouse_warpMouseInWindow(void *arg) xPositions[0] = -1; xPositions[1] = 0; xPositions[2] = 1; - xPositions[3] = w-1; + xPositions[3] = w - 1; xPositions[4] = w; - xPositions[5] = w+1; + xPositions[5] = w + 1; yPositions[0] = -1; yPositions[1] = 0; yPositions[2] = 1; - yPositions[3] = h-1; + yPositions[3] = h - 1; yPositions[4] = h; - yPositions[5] = h+1; + yPositions[5] = h + 1; /* Create test window */ window = _createMouseSuiteTestWindow(); - if (window == NULL) return TEST_ABORTED; + if (!window) { + return TEST_ABORTED; + } /* Mouse to random position inside window */ - x = SDLTest_RandomIntegerInRange(1, w-1); - y = SDLTest_RandomIntegerInRange(1, h-1); + x = SDLTest_RandomIntegerInRange(1, w - 1); + y = SDLTest_RandomIntegerInRange(1, h - 1); SDL_WarpMouseInWindow(window, x, y); SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); - /* Same position again */ + /* Same position again */ SDL_WarpMouseInWindow(window, x, y); SDLTest_AssertPass("SDL_WarpMouseInWindow(...,%i,%i)", x, y); /* Mouse to various boundary positions */ - for (i=0; iformat == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format); - SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel); - SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel); - masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; - SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks); - - /* Deallocate again */ - SDL_FreeFormat(result); - SDLTest_AssertPass("Call to SDL_FreeFormat()"); - } + const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; + const char *error; + int i; + Uint32 format; + Uint32 masks; + SDL_PixelFormat *result; - /* RGB formats */ - for (i = 0; i < _numRGBPixelFormats; i++) { - format = _RGBPixelFormats[i]; - SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format); + /* Blank/unknown format */ + format = 0; + SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format); /* Allocate format */ result = SDL_AllocFormat(format); SDLTest_AssertPass("Call to SDL_AllocFormat()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format); - SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel); - SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel); - if (result->palette != NULL) { - masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; - SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks); - } - - /* Deallocate again */ - SDL_FreeFormat(result); - SDLTest_AssertPass("Call to SDL_FreeFormat()"); + SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format); + SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel); + SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel); + masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; + SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks); + + /* Deallocate again */ + SDL_FreeFormat(result); + SDLTest_AssertPass("Call to SDL_FreeFormat()"); } - } - - /* Non-RGB formats */ - for (i = 0; i < _numNonRGBPixelFormats; i++) { - format = _nonRGBPixelFormats[i]; - SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format); - /* Try to allocate format */ - result = SDL_AllocFormat(format); - SDLTest_AssertPass("Call to SDL_AllocFormat()"); - SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); - } + /* RGB formats */ + for (i = 0; i < _numRGBPixelFormats; i++) { + format = _RGBPixelFormats[i]; + SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format); + + /* Allocate format */ + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format); + SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel); + SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel); + if (result->palette != NULL) { + masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; + SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks); + } + + /* Deallocate again */ + SDL_FreeFormat(result); + SDLTest_AssertPass("Call to SDL_FreeFormat()"); + } + } - /* Negative cases */ +#if 0 /* This succeeds for SDL3, but we don't expect SDL2 applications to call SDL_AllocFormat() for FOURCC formats directly */ + /* Non-RGB formats */ + for (i = 0; i < _numNonRGBPixelFormats; i++) { + format = _nonRGBPixelFormats[i]; + SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format); - /* Invalid Formats */ - for (i = 0; i < _numInvalidPixelFormats; i++) { - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - format = _invalidPixelFormats[i]; - result = SDL_AllocFormat(format); - SDLTest_AssertPass("Call to SDL_AllocFormat(%" SDL_PRIu32 ")", format); - SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); + /* Try to allocate format */ + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat()"); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + } +#endif + + /* Negative cases */ + + /* Invalid Formats */ + for (i = 0; i < _numInvalidPixelFormats; i++) { + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + format = _invalidPixelFormats[i]; + result = SDL_AllocFormat(format); + SDLTest_AssertPass("Call to SDL_AllocFormat(%" SDL_PRIu32 ")", format); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); } - } - - /* Invalid free pointer */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_FreeFormat(NULL); - SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)"); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError, error); - } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -230,83 +211,82 @@ pixels_allocFreeFormat(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetPixelFormatName */ -int -pixels_getPixelFormatName(void *arg) +int pixels_getPixelFormatName(void *arg) { - const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; - const char *error; - int i; - Uint32 format; - const char *result; - - /* Blank/undefined format */ - format = 0; - SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format); - - /* Get name of format */ - result = SDL_GetPixelFormatName(format); - SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); - SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); - if (result != NULL) { - SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); - SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0, - "Verify result text; expected: %s, got %s", unknownFormat, result); - } + const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; + const char *error; + int i; + Uint32 format; + const char *result; - /* RGB formats */ - for (i = 0; i < _numRGBPixelFormats; i++) { - format = _RGBPixelFormats[i]; - SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format); + /* Blank/undefined format */ + format = 0; + SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format); /* Get name of format */ result = SDL_GetPixelFormatName(format); SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { - SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); - SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0, - "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result); + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0, + "Verify result text; expected: %s, got %s", unknownFormat, result); } - } - /* Non-RGB formats */ - for (i = 0; i < _numNonRGBPixelFormats; i++) { - format = _nonRGBPixelFormats[i]; - SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format); + /* RGB formats */ + for (i = 0; i < _numRGBPixelFormats; i++) { + format = _RGBPixelFormats[i]; + SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format); + + /* Get name of format */ + result = SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0, + "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result); + } + } - /* Get name of format */ - result = SDL_GetPixelFormatName(format); - SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); - SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); - if (result != NULL) { - SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); - SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0, - "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result); + /* Non-RGB formats */ + for (i = 0; i < _numNonRGBPixelFormats; i++) { + format = _nonRGBPixelFormats[i]; + SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format); + + /* Get name of format */ + result = SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName()"); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty"); + SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0, + "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result); + } } - } - /* Negative cases */ + /* Negative cases */ - /* Invalid Formats */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - for (i = 0; i < _numInvalidPixelFormats; i++) { - format = _invalidPixelFormats[i]; - result = SDL_GetPixelFormatName(format); - SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", format); - SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); - if (result != NULL) { - SDLTest_AssertCheck(result[0] != '\0', - "Verify result is non-empty; got: %s", result); - SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0, - "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result); + /* Invalid Formats */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + for (i = 0; i < _numInvalidPixelFormats; i++) { + format = _invalidPixelFormats[i]; + result = SDL_GetPixelFormatName(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", format); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result[0] != '\0', + "Verify result is non-empty; got: %s", result); + SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0, + "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result); + } + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty"); } - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty"); - } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -315,89 +295,74 @@ pixels_getPixelFormatName(void *arg) * @sa http://wiki.libsdl.org/SDL_AllocPalette * @sa http://wiki.libsdl.org/SDL_FreePalette */ -int -pixels_allocFreePalette(void *arg) +int pixels_allocFreePalette(void *arg) { - const char *expectedError1 = "Parameter 'ncolors' is invalid"; - const char *expectedError2 = "Parameter 'palette' is invalid"; - const char *error; - int variation; - int i; - int ncolors; - SDL_Palette* result; - - /* Allocate palette */ - for (variation = 1; variation <= 3; variation++) { - switch (variation) { - /* Just one color */ - default: - case 1: - ncolors = 1; - break; - /* Two colors */ - case 2: - ncolors = 2; - break; - /* More than two colors */ - case 3: - ncolors = SDLTest_RandomIntegerInRange(8, 16); - break; + const char *expectedError1 = "Parameter 'ncolors' is invalid"; + const char *error; + int variation; + int i; + int ncolors; + SDL_Palette *result; + + /* Allocate palette */ + for (variation = 1; variation <= 3; variation++) { + switch (variation) { + /* Just one color */ + default: + case 1: + ncolors = 1; + break; + /* Two colors */ + case 2: + ncolors = 2; + break; + /* More than two colors */ + case 3: + ncolors = SDLTest_RandomIntegerInRange(8, 16); + break; + } + + result = SDL_AllocPalette(ncolors); + SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); + SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); + if (result != NULL) { + SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors); + if (result->ncolors > 0) { + SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL"); + if (result->colors != NULL) { + for (i = 0; i < result->ncolors; i++) { + SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r); + SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g); + SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b); + } + } + } + + /* Deallocate again */ + SDL_FreePalette(result); + SDLTest_AssertPass("Call to SDL_FreePalette()"); + } } - result = SDL_AllocPalette(ncolors); - SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); - SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); - if (result != NULL) { - SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors); - if (result->ncolors > 0) { - SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL"); - if (result->colors != NULL) { - for(i = 0; i < result->ncolors; i++) { - SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r); - SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g); - SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b); - } - } - } - - /* Deallocate again */ - SDL_FreePalette(result); - SDLTest_AssertPass("Call to SDL_FreePalette()"); + /* Negative cases */ + + /* Invalid number of colors */ + for (ncolors = 0; ncolors > -3; ncolors--) { + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + result = SDL_AllocPalette(ncolors); + SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + error = SDL_GetError(); + SDLTest_AssertPass("Call to SDL_GetError()"); + SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); + if (error != NULL) { + SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0, + "Validate error message, expected: '%s', got: '%s'", expectedError1, error); + } } - } - /* Negative cases */ - - /* Invalid number of colors */ - for (ncolors = 0; ncolors > -3; ncolors--) { - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - result = SDL_AllocPalette(ncolors); - SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors); - SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError1, error); - } - } - - /* Invalid free pointer */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_FreePalette(NULL); - SDLTest_AssertPass("Call to SDL_FreePalette(NULL)"); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL"); - if (error != NULL) { - SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0, - "Validate error message, expected: '%s', got: '%s'", expectedError2, error); - } - - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -507,11 +472,13 @@ pixels_calcGammaRamp(void *arg) /* ================= Test References ================== */ /* Pixels test cases */ -static const SDLTest_TestCaseReference pixelsTest1 = - { (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED }; +static const SDLTest_TestCaseReference pixelsTest1 = { + (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED +}; -static const SDLTest_TestCaseReference pixelsTest2 = - { (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED }; +static const SDLTest_TestCaseReference pixelsTest2 = { + (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED +}; static const SDLTest_TestCaseReference pixelsTest3 = { (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED }; diff --git a/test/testautomation_platform.c b/test/testautomation_platform.c index e8661488481ab..bd2aabed68eab 100644 --- a/test/testautomation_platform.c +++ b/test/testautomation_platform.c @@ -19,7 +19,7 @@ * compare them directly, so we push it through a function to keep the * compiler quiet. --ryan. */ -static int _compareSizeOfType( size_t sizeoftype, size_t hardcodetype ) +static int _compareSizeOfType(size_t sizeoftype, size_t hardcodetype) { return sizeoftype != hardcodetype; } @@ -31,21 +31,21 @@ static int _compareSizeOfType( size_t sizeoftype, size_t hardcodetype ) */ int platform_testTypes(void *arg) { - int ret; + int ret; - ret = _compareSizeOfType( sizeof(Uint8), 1 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", (unsigned long)sizeof(Uint8) ); + ret = _compareSizeOfType(sizeof(Uint8), 1); + SDLTest_AssertCheck(ret == 0, "sizeof(Uint8) = %u, expected 1", (unsigned int)sizeof(Uint8)); - ret = _compareSizeOfType( sizeof(Uint16), 2 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", (unsigned long)sizeof(Uint16) ); + ret = _compareSizeOfType(sizeof(Uint16), 2); + SDLTest_AssertCheck(ret == 0, "sizeof(Uint16) = %u, expected 2", (unsigned int)sizeof(Uint16)); - ret = _compareSizeOfType( sizeof(Uint32), 4 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", (unsigned long)sizeof(Uint32) ); + ret = _compareSizeOfType(sizeof(Uint32), 4); + SDLTest_AssertCheck(ret == 0, "sizeof(Uint32) = %u, expected 4", (unsigned int)sizeof(Uint32)); - ret = _compareSizeOfType( sizeof(Uint64), 8 ); - SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", (unsigned long)sizeof(Uint64) ); + ret = _compareSizeOfType(sizeof(Uint64), 8); + SDLTest_AssertCheck(ret == 0, "sizeof(Uint64) = %u, expected 8", (unsigned int)sizeof(Uint64)); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -61,9 +61,10 @@ int platform_testEndianessAndSwap(void *arg) Uint32 value32 = 0xEFBEADDE; Uint32 swapped32 = 0xDEADBEEF; - union { - double d; - Uint32 ui32[2]; + union + { + double d; + Uint32 ui32[2]; } value_double; Uint64 value64, swapped64; @@ -75,17 +76,17 @@ int platform_testEndianessAndSwap(void *arg) swapped64 |= 0xDEADBEEF; value_double.d = 3.141593; - if ((*((char *) &value) >> 4) == 0x1) { + if ((*((char *)&value) >> 4) == 0x1) { real_byteorder = SDL_BIG_ENDIAN; } else { real_byteorder = SDL_LIL_ENDIAN; } /* Test endianness. */ - SDLTest_AssertCheck( real_byteorder == SDL_BYTEORDER, - "Machine detected as %s endian, appears to be %s endian.", - (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big", - (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big" ); + SDLTest_AssertCheck(real_byteorder == SDL_BYTEORDER, + "Machine detected as %s endian, appears to be %s endian.", + (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big", + (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big"); if (value_double.ui32[0] == 0x82c2bd7f && value_double.ui32[1] == 0x400921fb) { real_floatwordorder = SDL_LIL_ENDIAN; @@ -94,27 +95,28 @@ int platform_testEndianessAndSwap(void *arg) } /* Test endianness. */ - SDLTest_AssertCheck( real_floatwordorder == SDL_FLOATWORDORDER, - "Machine detected as having %s endian float word order, appears to be %s endian.", - (SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big", - (real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big" : "unknown" ); + SDLTest_AssertCheck(real_floatwordorder == SDL_FLOATWORDORDER, + "Machine detected as having %s endian float word order, appears to be %s endian.", + (SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big", + (real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big" + : "unknown"); /* Test 16 swap. */ - SDLTest_AssertCheck( SDL_Swap16(value16) == swapped16, - "SDL_Swap16(): 16 bit swapped: 0x%X => 0x%X", - value16, SDL_Swap16(value16) ); + SDLTest_AssertCheck(SDL_Swap16(value16) == swapped16, + "SDL_Swap16(): 16 bit swapped: 0x%X => 0x%X", + value16, SDL_Swap16(value16)); /* Test 32 swap. */ - SDLTest_AssertCheck( SDL_Swap32(value32) == swapped32, - "SDL_Swap32(): 32 bit swapped: 0x%" SDL_PRIX32 " => 0x%" SDL_PRIX32, - value32, SDL_Swap32(value32) ); + SDLTest_AssertCheck(SDL_Swap32(value32) == swapped32, + "SDL_Swap32(): 32 bit swapped: 0x%" SDL_PRIX32 " => 0x%" SDL_PRIX32, + value32, SDL_Swap32(value32)); /* Test 64 swap. */ - SDLTest_AssertCheck( SDL_Swap64(value64) == swapped64, - "SDL_Swap64(): 64 bit swapped: 0x%"SDL_PRIX64" => 0x%"SDL_PRIX64, - value64, SDL_Swap64(value64) ); + SDLTest_AssertCheck(SDL_Swap64(value64) == swapped64, + "SDL_Swap64(): 64 bit swapped: 0x%" SDL_PRIX64 " => 0x%" SDL_PRIX64, + value64, SDL_Swap64(value64)); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ! @@ -126,41 +128,41 @@ int platform_testEndianessAndSwap(void *arg) * http://wiki.libsdl.org/SDL_GetRevision * http://wiki.libsdl.org/SDL_GetRevisionNumber */ -int platform_testGetFunctions (void *arg) +int platform_testGetFunctions(void *arg) { - char *platform; - char *revision; - int ret; - size_t len; - - platform = (char *)SDL_GetPlatform(); - SDLTest_AssertPass("SDL_GetPlatform()"); - SDLTest_AssertCheck(platform != NULL, "SDL_GetPlatform() != NULL"); - if (platform != NULL) { - len = SDL_strlen(platform); - SDLTest_AssertCheck(len > 0, - "SDL_GetPlatform(): expected non-empty platform, was platform: '%s', len: %i", - platform, - (int) len); - } - - ret = SDL_GetCPUCount(); - SDLTest_AssertPass("SDL_GetCPUCount()"); - SDLTest_AssertCheck(ret > 0, - "SDL_GetCPUCount(): expected count > 0, was: %i", - ret); - - ret = SDL_GetCPUCacheLineSize(); - SDLTest_AssertPass("SDL_GetCPUCacheLineSize()"); - SDLTest_AssertCheck(ret >= 0, - "SDL_GetCPUCacheLineSize(): expected size >= 0, was: %i", - ret); - - revision = (char *)SDL_GetRevision(); - SDLTest_AssertPass("SDL_GetRevision()"); - SDLTest_AssertCheck(revision != NULL, "SDL_GetRevision() != NULL"); - - return TEST_COMPLETED; + char *platform; + char *revision; + int ret; + size_t len; + + platform = (char *)SDL_GetPlatform(); + SDLTest_AssertPass("SDL_GetPlatform()"); + SDLTest_AssertCheck(platform != NULL, "SDL_GetPlatform() != NULL"); + if (platform != NULL) { + len = SDL_strlen(platform); + SDLTest_AssertCheck(len > 0, + "SDL_GetPlatform(): expected non-empty platform, was platform: '%s', len: %i", + platform, + (int)len); + } + + ret = SDL_GetCPUCount(); + SDLTest_AssertPass("SDL_GetCPUCount()"); + SDLTest_AssertCheck(ret > 0, + "SDL_GetCPUCount(): expected count > 0, was: %i", + ret); + + ret = SDL_GetCPUCacheLineSize(); + SDLTest_AssertPass("SDL_GetCPUCacheLineSize()"); + SDLTest_AssertCheck(ret >= 0, + "SDL_GetCPUCacheLineSize(): expected size >= 0, was: %i", + ret); + + revision = (char *)SDL_GetRevision(); + SDLTest_AssertPass("SDL_GetRevision()"); + SDLTest_AssertCheck(revision != NULL, "SDL_GetRevision() != NULL"); + + return TEST_COMPLETED; } /* ! @@ -177,41 +179,41 @@ int platform_testGetFunctions (void *arg) * http://wiki.libsdl.org/SDL_HasSSE42 * http://wiki.libsdl.org/SDL_HasAVX */ -int platform_testHasFunctions (void *arg) +int platform_testHasFunctions(void *arg) { - /* TODO: independently determine and compare values as well */ + /* TODO: independently determine and compare values as well */ - SDL_HasRDTSC(); - SDLTest_AssertPass("SDL_HasRDTSC()"); + SDL_HasRDTSC(); + SDLTest_AssertPass("SDL_HasRDTSC()"); - SDL_HasAltiVec(); - SDLTest_AssertPass("SDL_HasAltiVec()"); + SDL_HasAltiVec(); + SDLTest_AssertPass("SDL_HasAltiVec()"); - SDL_HasMMX(); - SDLTest_AssertPass("SDL_HasMMX()"); + SDL_HasMMX(); + SDLTest_AssertPass("SDL_HasMMX()"); - SDL_Has3DNow(); - SDLTest_AssertPass("SDL_Has3DNow()"); + SDL_Has3DNow(); + SDLTest_AssertPass("SDL_Has3DNow()"); - SDL_HasSSE(); - SDLTest_AssertPass("SDL_HasSSE()"); + SDL_HasSSE(); + SDLTest_AssertPass("SDL_HasSSE()"); - SDL_HasSSE2(); - SDLTest_AssertPass("SDL_HasSSE2()"); + SDL_HasSSE2(); + SDLTest_AssertPass("SDL_HasSSE2()"); - SDL_HasSSE3(); - SDLTest_AssertPass("SDL_HasSSE3()"); + SDL_HasSSE3(); + SDLTest_AssertPass("SDL_HasSSE3()"); - SDL_HasSSE41(); - SDLTest_AssertPass("SDL_HasSSE41()"); + SDL_HasSSE41(); + SDLTest_AssertPass("SDL_HasSSE41()"); - SDL_HasSSE42(); - SDLTest_AssertPass("SDL_HasSSE42()"); + SDL_HasSSE42(); + SDLTest_AssertPass("SDL_HasSSE42()"); - SDL_HasAVX(); - SDLTest_AssertPass("SDL_HasAVX()"); + SDL_HasAVX(); + SDLTest_AssertPass("SDL_HasAVX()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ! @@ -221,67 +223,65 @@ int platform_testHasFunctions (void *arg) */ int platform_testGetVersion(void *arg) { - SDL_version linked; - int major = SDL_MAJOR_VERSION; - int minor = SDL_MINOR_VERSION; - - SDL_GetVersion(&linked); - SDLTest_AssertCheck( linked.major >= major, - "SDL_GetVersion(): returned major %i (>= %i)", - linked.major, - major); - SDLTest_AssertCheck( linked.minor >= minor, - "SDL_GetVersion(): returned minor %i (>= %i)", - linked.minor, - minor); - - return TEST_COMPLETED; + SDL_version linked; + int major = SDL_MAJOR_VERSION; + int minor = SDL_MINOR_VERSION; + + SDL_GetVersion(&linked); + SDLTest_AssertCheck(linked.major >= major, + "SDL_GetVersion(): returned major %i (>= %i)", + linked.major, + major); + SDLTest_AssertCheck(linked.minor >= minor, + "SDL_GetVersion(): returned minor %i (>= %i)", + linked.minor, + minor); + + return TEST_COMPLETED; } - /* ! * \brief Tests SDL_VERSION macro */ int platform_testSDLVersion(void *arg) { - SDL_version compiled; - int major = SDL_MAJOR_VERSION; - int minor = SDL_MINOR_VERSION; - - SDL_VERSION(&compiled); - SDLTest_AssertCheck( compiled.major >= major, - "SDL_VERSION() returned major %i (>= %i)", - compiled.major, - major); - SDLTest_AssertCheck( compiled.minor >= minor, - "SDL_VERSION() returned minor %i (>= %i)", - compiled.minor, - minor); - - return TEST_COMPLETED; + SDL_version compiled; + int major = SDL_MAJOR_VERSION; + int minor = SDL_MINOR_VERSION; + + SDL_VERSION(&compiled); + SDLTest_AssertCheck(compiled.major >= major, + "SDL_VERSION() returned major %i (>= %i)", + compiled.major, + major); + SDLTest_AssertCheck(compiled.minor >= minor, + "SDL_VERSION() returned minor %i (>= %i)", + compiled.minor, + minor); + + return TEST_COMPLETED; } - /* ! * \brief Tests default SDL_Init */ int platform_testDefaultInit(void *arg) { - int ret; - int subsystem; + int ret; + int subsystem; - subsystem = SDL_WasInit(SDL_INIT_EVERYTHING); - SDLTest_AssertCheck( subsystem != 0, - "SDL_WasInit(0): returned %i, expected != 0", - subsystem); + subsystem = SDL_WasInit(SDL_INIT_EVERYTHING); + SDLTest_AssertCheck(subsystem != 0, + "SDL_WasInit(0): returned %i, expected != 0", + subsystem); - ret = SDL_Init(SDL_WasInit(SDL_INIT_EVERYTHING)); - SDLTest_AssertCheck( ret == 0, - "SDL_Init(0): returned %i, expected 0, error: %s", - ret, - SDL_GetError()); + ret = SDL_Init(SDL_WasInit(SDL_INIT_EVERYTHING)); + SDLTest_AssertCheck(ret == 0, + "SDL_Init(0): returned %i, expected 0, error: %s", + ret, + SDL_GetError()); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ! @@ -293,49 +293,47 @@ int platform_testDefaultInit(void *arg) */ int platform_testGetSetClearError(void *arg) { - int result; - const char *testError = "Testing"; - char *lastError; - size_t len; - - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == 0, - "SDL_GetError(): no message expected, len: %i", (int) len); - } - - result = SDL_SetError("%s", testError); - SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == SDL_strlen(testError), - "SDL_GetError(): expected message len %i, was len: %i", - (int) SDL_strlen(testError), - (int) len); - SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0, - "SDL_GetError(): expected message %s, was message: %s", - testError, - lastError); - } - - /* Clean up */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + int result; + const char *testError = "Testing"; + char *lastError; + size_t len; + + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == 0, + "SDL_GetError(): no message expected, len: %i", (int)len); + } + + result = SDL_SetError("%s", testError); + SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == SDL_strlen(testError), + "SDL_GetError(): expected message len %i, was len: %i", + (int)SDL_strlen(testError), + (int)len); + SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0, + "SDL_GetError(): expected message %s, was message: %s", + testError, + lastError); + } + + /* Clean up */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* ! @@ -345,35 +343,34 @@ int platform_testGetSetClearError(void *arg) */ int platform_testSetErrorEmptyInput(void *arg) { - int result; - const char *testError = ""; - char *lastError; - size_t len; - - result = SDL_SetError("%s", testError); - SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == SDL_strlen(testError), - "SDL_GetError(): expected message len %i, was len: %i", - (int) SDL_strlen(testError), - (int) len); - SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - testError, - lastError); - } - - /* Clean up */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + int result; + const char *testError = ""; + char *lastError; + size_t len; + + result = SDL_SetError("%s", testError); + SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == SDL_strlen(testError), + "SDL_GetError(): expected message len %i, was len: %i", + (int)SDL_strlen(testError), + (int)len); + SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + testError, + lastError); + } + + /* Clean up */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } #if defined(HAVE_WFORMAT_OVERFLOW) @@ -388,80 +385,77 @@ int platform_testSetErrorEmptyInput(void *arg) */ int platform_testSetErrorInvalidInput(void *arg) { - int result; - const char *invalidError = NULL; - const char *probeError = "Testing"; - char *lastError; - size_t len; - - /* Reset */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* Check for no-op */ - result = SDL_SetError("%s", invalidError); - SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0, - "SDL_GetError(): expected message len 0, was len: %i", - (int) len); - } - - /* Set */ - result = SDL_SetError("%s", probeError); - SDLTest_AssertPass("SDL_SetError('%s')", probeError); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - - /* Check for no-op */ - result = SDL_SetError("%s", invalidError); - SDLTest_AssertPass("SDL_SetError(NULL)"); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == 0 || SDL_strcmp( lastError, "(null)" ) == 0, - "SDL_GetError(): expected message len 0, was len: %i", - (int) len); - } - - /* Reset */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* Set and check */ - result = SDL_SetError("%s", probeError); - SDLTest_AssertPass("SDL_SetError()"); - SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertCheck(lastError != NULL, - "SDL_GetError() != NULL"); - if (lastError != NULL) - { - len = SDL_strlen(lastError); - SDLTest_AssertCheck(len == SDL_strlen(probeError), - "SDL_GetError(): expected message len %i, was len: %i", - (int) SDL_strlen(probeError), - (int) len); - SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - probeError, - lastError); - } - - /* Clean up */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + int result; + const char *invalidError = ""; + const char *probeError = "Testing"; + char *lastError; + size_t len; + + /* Reset */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* Check for no-op */ + result = SDL_SetError("%s", invalidError); + SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0, + "SDL_GetError(): expected message len 0, was len: %i", + (int)len); + } + + /* Set */ + result = SDL_SetError("%s", probeError); + SDLTest_AssertPass("SDL_SetError('%s')", probeError); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + + /* Check for no-op */ + result = SDL_SetError("%s", invalidError); + SDLTest_AssertPass("SDL_SetError(NULL)"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0, + "SDL_GetError(): expected message len 0, was len: %i", + (int)len); + } + + /* Reset */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* Set and check */ + result = SDL_SetError("%s", probeError); + SDLTest_AssertPass("SDL_SetError()"); + SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertCheck(lastError != NULL, + "SDL_GetError() != NULL"); + if (lastError != NULL) { + len = SDL_strlen(lastError); + SDLTest_AssertCheck(len == SDL_strlen(probeError), + "SDL_GetError(): expected message len %i, was len: %i", + (int)SDL_strlen(probeError), + (int)len); + SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + probeError, + lastError); + } + + /* Clean up */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } #if defined(HAVE_WFORMAT_OVERFLOW) @@ -475,115 +469,124 @@ int platform_testSetErrorInvalidInput(void *arg) */ int platform_testGetPowerInfo(void *arg) { - SDL_PowerState state; - SDL_PowerState stateAgain; - int secs; - int secsAgain; - int pct; - int pctAgain; - - state = SDL_GetPowerInfo(&secs, &pct); - SDLTest_AssertPass("SDL_GetPowerInfo()"); - SDLTest_AssertCheck( - state==SDL_POWERSTATE_UNKNOWN || - state==SDL_POWERSTATE_ON_BATTERY || - state==SDL_POWERSTATE_NO_BATTERY || - state==SDL_POWERSTATE_CHARGING || - state==SDL_POWERSTATE_CHARGED, - "SDL_GetPowerInfo(): state %i is one of the expected values", - (int)state); - - if (state==SDL_POWERSTATE_ON_BATTERY) - { - SDLTest_AssertCheck( - secs >= 0, - "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i", - secs); - SDLTest_AssertCheck( - (pct >= 0) && (pct <= 100), - "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i", - pct); - } - - if (state==SDL_POWERSTATE_UNKNOWN || - state==SDL_POWERSTATE_NO_BATTERY) - { - SDLTest_AssertCheck( - secs == -1, - "SDL_GetPowerInfo(): no battery, secs == -1, was: %i", - secs); - SDLTest_AssertCheck( - pct == -1, - "SDL_GetPowerInfo(): no battery, pct == -1, was: %i", - pct); - } - - /* Partial return value variations */ - stateAgain = SDL_GetPowerInfo(&secsAgain, NULL); - SDLTest_AssertCheck( - state==stateAgain, + SDL_PowerState state; + SDL_PowerState stateAgain; + int secs; + int secsAgain; + int pct; + int pctAgain; + + state = SDL_GetPowerInfo(&secs, &pct); + SDLTest_AssertPass("SDL_GetPowerInfo()"); + SDLTest_AssertCheck( + state == SDL_POWERSTATE_UNKNOWN || + state == SDL_POWERSTATE_ON_BATTERY || + state == SDL_POWERSTATE_NO_BATTERY || + state == SDL_POWERSTATE_CHARGING || + state == SDL_POWERSTATE_CHARGED, + "SDL_GetPowerInfo(): state %i is one of the expected values", + (int)state); + + if (state == SDL_POWERSTATE_ON_BATTERY) { + SDLTest_AssertCheck( + secs >= 0, + "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i", + secs); + SDLTest_AssertCheck( + (pct >= 0) && (pct <= 100), + "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i", + pct); + } + + if (state == SDL_POWERSTATE_UNKNOWN || + state == SDL_POWERSTATE_NO_BATTERY) { + SDLTest_AssertCheck( + secs == -1, + "SDL_GetPowerInfo(): no battery, secs == -1, was: %i", + secs); + SDLTest_AssertCheck( + pct == -1, + "SDL_GetPowerInfo(): no battery, pct == -1, was: %i", + pct); + } + + /* Partial return value variations */ + stateAgain = SDL_GetPowerInfo(&secsAgain, NULL); + SDLTest_AssertCheck( + state == stateAgain, "State %i returned when only 'secs' requested", stateAgain); - SDLTest_AssertCheck( - secs==secsAgain, + SDLTest_AssertCheck( + secs == secsAgain, "Value %i matches when only 'secs' requested", secsAgain); - stateAgain = SDL_GetPowerInfo(NULL, &pctAgain); - SDLTest_AssertCheck( - state==stateAgain, + stateAgain = SDL_GetPowerInfo(NULL, &pctAgain); + SDLTest_AssertCheck( + state == stateAgain, "State %i returned when only 'pct' requested", stateAgain); - SDLTest_AssertCheck( - pct==pctAgain, + SDLTest_AssertCheck( + pct == pctAgain, "Value %i matches when only 'pct' requested", pctAgain); - stateAgain = SDL_GetPowerInfo(NULL, NULL); - SDLTest_AssertCheck( - state==stateAgain, + stateAgain = SDL_GetPowerInfo(NULL, NULL); + SDLTest_AssertCheck( + state == stateAgain, "State %i returned when no value requested", stateAgain); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ================= Test References ================== */ /* Platform test cases */ -static const SDLTest_TestCaseReference platformTest1 = - { (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest1 = { + (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest2 = - { (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest2 = { + (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest3 = - { (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest3 = { + (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest4 = - { (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest4 = { + (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest5 = - { (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest5 = { + (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest6 = - { (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest6 = { + (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest7 = - { (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest7 = { + (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest8 = - { (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest8 = { + (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest9 = - { (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest9 = { + (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest10 = - { (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED}; +static const SDLTest_TestCaseReference platformTest10 = { + (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED +}; -static const SDLTest_TestCaseReference platformTest11 = - { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED }; +static const SDLTest_TestCaseReference platformTest11 = { + (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED +}; /* Sequence of Platform test cases */ -static const SDLTest_TestCaseReference *platformTests[] = { +static const SDLTest_TestCaseReference *platformTests[] = { &platformTest1, &platformTest2, &platformTest3, diff --git a/test/testautomation_rect.c b/test/testautomation_rect.c index 729ff29d756ac..f269dcb1ca71d 100644 --- a/test/testautomation_rect.c +++ b/test/testautomation_rect.c @@ -12,29 +12,61 @@ /* Helper functions */ +/* ! + * \brief Private helper to check SDL_FRect equality + */ +static SDL_bool IsFRectEqual(const SDL_FRect *r1, const SDL_FRect *r2) { + static const float MAX_DELTA = 1e-5f; + SDL_FRect delta; + delta.x = r1->x - r2->x; + delta.y = r1->y - r2->y; + delta.w = r1->w - r2->w; + delta.h = r1->h - r2->h; + + return -MAX_DELTA <= delta.x && delta.x <= MAX_DELTA + && -MAX_DELTA <= delta.y && delta.y <= MAX_DELTA + && -MAX_DELTA <= delta.w && delta.w <= MAX_DELTA + && -MAX_DELTA <= delta.w && delta.h <= MAX_DELTA; +} + +/* ! + * \brief Private helper to check SDL_FPoint equality + */ +static SDL_bool IsFPointEqual(const SDL_FPoint *p1, const SDL_FPoint *p2) { + static const float MAX_DELTA = 1e-5f; + SDL_FPoint delta; + delta.x = p1->x - p2->x; + delta.y = p1->y - p2->y; + + return -MAX_DELTA <= delta.x && delta.x <= MAX_DELTA + && -MAX_DELTA <= delta.y && delta.y <= MAX_DELTA; +} + +/* Helper functions */ + /* ! * \brief Private helper to check SDL_IntersectRectAndLine results */ void _validateIntersectRectAndLineResults( SDL_bool intersection, SDL_bool expectedIntersection, - SDL_Rect *rect, SDL_Rect * refRect, + SDL_Rect *rect, SDL_Rect *refRect, int x1, int y1, int x2, int y2, int x1Ref, int y1Ref, int x2Ref, int y2Ref) { SDLTest_AssertCheck(intersection == expectedIntersection, - "Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - refRect->x, refRect->y, refRect->w, refRect->h, - x1Ref, y1Ref, x2Ref, y2Ref); + "Check for correct intersection result: expected %s, got %s intersecting rect (%d,%d,%d,%d) with line (%d,%d - %d,%d)", + (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + refRect->x, refRect->y, refRect->w, refRect->h, + x1Ref, y1Ref, x2Ref, y2Ref); SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, - "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rect->x, rect->y, rect->w, rect->h, - refRect->x, refRect->y, refRect->w, refRect->h); + "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rect->x, rect->y, rect->w, rect->h, + refRect->x, refRect->y, refRect->w, refRect->h); SDLTest_AssertCheck(x1 == x1Ref && y1 == y1Ref && x2 == x2Ref && y2 == y2Ref, - "Check if line was incorrectly clipped or modified: got (%d,%d - %d,%d) expected (%d,%d - %d,%d)", - x1, y1, x2, y2, - x1Ref, y1Ref, x2Ref, y2Ref); + "Check if line was incorrectly clipped or modified: got (%d,%d - %d,%d) expected (%d,%d - %d,%d)", + x1, y1, x2, y2, + x1Ref, y1Ref, x2Ref, y2Ref); } /* Test case functions */ @@ -45,8 +77,7 @@ void _validateIntersectRectAndLineResults( * \sa * http://wiki.libsdl.org/SDL_IntersectRectAndLine */ -int -rect_testIntersectRectAndLine (void *arg) +int rect_testIntersectRectAndLine(void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect rect; @@ -77,14 +108,14 @@ rect_testIntersectRectAndLine (void *arg) x1 = -refRect.w; y1 = -refRect.h; - x2 = 2*refRect.w; - y2 = 2*refRect.h; + x2 = 2 * refRect.w; + y2 = 2 * refRect.h; rect = refRect; intersected = SDL_IntersectRectAndLine(&rect, &x1, &y1, &x2, &y2); - _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31); + _validateIntersectRectAndLineResults(intersected, SDL_TRUE, &rect, &refRect, x1, y1, x2, y2, 0, 0, 31, 31); - x1 = 2*refRect.w; - y1 = 2*refRect.h; + x1 = 2 * refRect.w; + y1 = 2 * refRect.h; x2 = -refRect.w; y2 = -refRect.h; rect = refRect; @@ -116,8 +147,7 @@ rect_testIntersectRectAndLine (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRectAndLine */ -int -rect_testIntersectRectAndLineInside (void *arg) +int rect_testIntersectRectAndLineInside(void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect rect; @@ -183,8 +213,7 @@ rect_testIntersectRectAndLineInside (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRectAndLine */ -int -rect_testIntersectRectAndLineOutside (void *arg) +int rect_testIntersectRectAndLineOutside(void *arg) { SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect rect; @@ -238,8 +267,7 @@ rect_testIntersectRectAndLineOutside (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRectAndLine */ -int -rect_testIntersectRectAndLineEmpty (void *arg) +int rect_testIntersectRectAndLineEmpty(void *arg) { SDL_Rect refRect; SDL_Rect rect; @@ -273,8 +301,7 @@ rect_testIntersectRectAndLineEmpty (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRectAndLine */ -int -rect_testIntersectRectAndLineParam (void *arg) +int rect_testIntersectRectAndLineParam(void *arg) { SDL_Rect rect = { 0, 0, 32, 32 }; int x1 = rect.w / 2; @@ -310,19 +337,19 @@ void _validateHasIntersectionResults( SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { SDLTest_AssertCheck(intersection == expectedIntersection, - "Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)", - (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h); + "Check intersection result: expected %s, got %s intersecting A (%d,%d,%d,%d) with B (%d,%d,%d,%d)", + (expectedIntersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (intersection == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + rectA->x, rectA->y, rectA->w, rectA->h, + rectB->x, rectB->y, rectB->w, rectB->h); SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); + "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectA->x, rectA->y, rectA->w, rectA->h, + refRectA->x, refRectA->y, refRectA->w, refRectA->h); SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); + "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectB->x, rectB->y, rectB->w, rectB->h, + refRectB->x, refRectB->y, refRectB->w, refRectB->h); } /* ! @@ -336,11 +363,11 @@ void _validateIntersectRectResults( _validateHasIntersectionResults(intersection, expectedIntersection, rectA, rectB, refRectA, refRectB); if (result && expectedResult) { SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, - "Check that intersection of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h, - result->x, result->y, result->w, result->h, - expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); + "Check that intersection of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectA->x, rectA->y, rectA->w, rectA->h, + rectB->x, rectB->y, rectB->w, rectB->h, + result->x, result->y, result->w, result->h, + expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); } } @@ -352,19 +379,19 @@ void _validateUnionRectResults( SDL_Rect *result, SDL_Rect *expectedResult) { SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); + "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectA->x, rectA->y, rectA->w, rectA->h, + refRectA->x, refRectA->y, refRectA->w, refRectA->h); SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); + "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectB->x, rectB->y, rectB->w, rectB->h, + refRectB->x, refRectB->y, refRectB->w, refRectB->h); SDLTest_AssertCheck(result->x == expectedResult->x && result->y == expectedResult->y && result->w == expectedResult->w && result->h == expectedResult->h, - "Check that union of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h, - result->x, result->y, result->w, result->h, - expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); + "Check that union of rectangles A (%d,%d,%d,%d) and B (%d,%d,%d,%d) was correctly calculated, got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectA->x, rectA->y, rectA->w, rectA->h, + rectB->x, rectB->y, rectB->w, rectB->h, + result->x, result->y, result->w, result->h, + expectedResult->x, expectedResult->y, expectedResult->w, expectedResult->h); } /* ! @@ -375,14 +402,14 @@ void _validateRectEmptyResults( SDL_Rect *rect, SDL_Rect *refRect) { SDLTest_AssertCheck(empty == expectedEmpty, - "Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)", - (expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - rect->x, rect->y, rect->w, rect->h); + "Check for correct empty result: expected %s, got %s testing (%d,%d,%d,%d)", + (expectedEmpty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + rect->x, rect->y, rect->w, rect->h); SDLTest_AssertCheck(rect->x == refRect->x && rect->y == refRect->y && rect->w == refRect->w && rect->h == refRect->h, - "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rect->x, rect->y, rect->w, rect->h, - refRect->x, refRect->y, refRect->w, refRect->h); + "Check that source rectangle was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rect->x, rect->y, rect->w, rect->h, + refRect->x, refRect->y, refRect->w, refRect->h); } /* ! @@ -393,19 +420,19 @@ void _validateRectEqualsResults( SDL_Rect *rectA, SDL_Rect *rectB, SDL_Rect *refRectA, SDL_Rect *refRectB) { SDLTest_AssertCheck(equals == expectedEquals, - "Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)", - (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h); + "Check for correct equals result: expected %s, got %s testing (%d,%d,%d,%d) and (%d,%d,%d,%d)", + (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + rectA->x, rectA->y, rectA->w, rectA->h, + rectB->x, rectB->y, rectB->w, rectB->h); SDLTest_AssertCheck(rectA->x == refRectA->x && rectA->y == refRectA->y && rectA->w == refRectA->w && rectA->h == refRectA->h, - "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); + "Check that source rectangle A was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectA->x, rectA->y, rectA->w, rectA->h, + refRectA->x, refRectA->y, refRectA->w, refRectA->h); SDLTest_AssertCheck(rectB->x == refRectB->x && rectB->y == refRectB->y && rectB->w == refRectB->w && rectB->h == refRectB->h, - "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); + "Check that source rectangle B was not modified: got (%d,%d,%d,%d) expected (%d,%d,%d,%d)", + rectB->x, rectB->y, rectB->w, rectB->h, + refRectB->x, refRectB->y, refRectB->w, refRectB->h); } /* ! @@ -417,21 +444,21 @@ void _validateFRectEqualsResults( { int cmpRes; SDLTest_AssertCheck(equals == expectedEquals, - "Check for correct equals result: expected %s, got %s testing (%f,%f,%f,%f) and (%f,%f,%f,%f)", - (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - rectA->x, rectA->y, rectA->w, rectA->h, - rectB->x, rectB->y, rectB->w, rectB->h); + "Check for correct equals result: expected %s, got %s testing (%f,%f,%f,%f) and (%f,%f,%f,%f)", + (expectedEquals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + (equals == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", + rectA->x, rectA->y, rectA->w, rectA->h, + rectB->x, rectB->y, rectB->w, rectB->h); cmpRes = SDL_memcmp(rectA, refRectA, sizeof(*rectA)); SDLTest_AssertCheck(cmpRes == 0, - "Check that source rectangle A was not modified: got (%f,%f,%f,%f) expected (%f,%f,%f,%f)", - rectA->x, rectA->y, rectA->w, rectA->h, - refRectA->x, refRectA->y, refRectA->w, refRectA->h); + "Check that source rectangle A was not modified: got (%f,%f,%f,%f) expected (%f,%f,%f,%f)", + rectA->x, rectA->y, rectA->w, rectA->h, + refRectA->x, refRectA->y, refRectA->w, refRectA->h); cmpRes = SDL_memcmp(rectB, refRectB, sizeof(*rectB)); SDLTest_AssertCheck(cmpRes == 0, - "Check that source rectangle B was not modified: got (%f,%f,%f,%f) expected (%f,%f,%f,%f)", - rectB->x, rectB->y, rectB->w, rectB->h, - refRectB->x, refRectB->y, refRectB->w, refRectB->h); + "Check that source rectangle B was not modified: got (%f,%f,%f,%f) expected (%f,%f,%f,%f)", + rectB->x, rectB->y, rectB->w, rectB->h, + refRectB->x, refRectB->y, refRectB->w, refRectB->h); } /* ! @@ -440,7 +467,7 @@ void _validateFRectEqualsResults( * \sa * http://wiki.libsdl.org/SDL_IntersectRect */ -int rect_testIntersectRectInside (void *arg) +int rect_testIntersectRectInside(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -468,7 +495,7 @@ int rect_testIntersectRectInside (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRect */ -int rect_testIntersectRectOutside (void *arg) +int rect_testIntersectRectOutside(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -496,7 +523,7 @@ int rect_testIntersectRectOutside (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRect */ -int rect_testIntersectRectPartial (void *arg) +int rect_testIntersectRectPartial(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -585,7 +612,7 @@ int rect_testIntersectRectPartial (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRect */ -int rect_testIntersectRectPoint (void *arg) +int rect_testIntersectRectPoint(void *arg) { SDL_Rect refRectA = { 0, 0, 1, 1 }; SDL_Rect refRectB = { 0, 0, 1, 1 }; @@ -632,7 +659,7 @@ int rect_testIntersectRectPoint (void *arg) * \sa * http://wiki.libsdl.org/SDL_IntersectRect */ -int rect_testIntersectRectEmpty (void *arg) +int rect_testIntersectRectEmpty(void *arg) { SDL_Rect refRectA; SDL_Rect refRectB; @@ -656,7 +683,7 @@ int rect_testIntersectRectEmpty (void *arg) rectB = refRectB; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - empty = (SDL_bool)SDL_RectEmpty(&result); + empty = SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); /* Rect B empty */ @@ -673,7 +700,7 @@ int rect_testIntersectRectEmpty (void *arg) rectB = refRectB; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - empty = (SDL_bool)SDL_RectEmpty(&result); + empty = SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); /* Rect A and B empty */ @@ -692,7 +719,7 @@ int rect_testIntersectRectEmpty (void *arg) rectB = refRectB; intersection = SDL_IntersectRect(&rectA, &rectB, &result); _validateIntersectRectResults(intersection, SDL_FALSE, &rectA, &rectB, &refRectA, &refRectB, (SDL_Rect *)NULL, (SDL_Rect *)NULL); - empty = (SDL_bool)SDL_RectEmpty(&result); + empty = SDL_RectEmpty(&result); SDLTest_AssertCheck(empty == SDL_TRUE, "Validate result is empty Rect; got: %s", (empty == SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); return TEST_COMPLETED; @@ -706,8 +733,8 @@ int rect_testIntersectRectEmpty (void *arg) */ int rect_testIntersectRectParam(void *arg) { - SDL_Rect rectA; - SDL_Rect rectB = {0}; + const SDL_Rect rectA = { 0, 0, 32, 32 }; + const SDL_Rect rectB = { 0, 0, 32, 32 }; SDL_Rect result; SDL_bool intersection; @@ -734,7 +761,7 @@ int rect_testIntersectRectParam(void *arg) * \sa * http://wiki.libsdl.org/SDL_HasIntersection */ -int rect_testHasIntersectionInside (void *arg) +int rect_testHasIntersectionInside(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -761,7 +788,7 @@ int rect_testHasIntersectionInside (void *arg) * \sa * http://wiki.libsdl.org/SDL_HasIntersection */ -int rect_testHasIntersectionOutside (void *arg) +int rect_testHasIntersectionOutside(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -788,7 +815,7 @@ int rect_testHasIntersectionOutside (void *arg) * \sa * http://wiki.libsdl.org/SDL_HasIntersection */ -int rect_testHasIntersectionPartial (void *arg) +int rect_testHasIntersectionPartial(void *arg) { SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectB; @@ -855,7 +882,7 @@ int rect_testHasIntersectionPartial (void *arg) * \sa * http://wiki.libsdl.org/SDL_HasIntersection */ -int rect_testHasIntersectionPoint (void *arg) +int rect_testHasIntersectionPoint(void *arg) { SDL_Rect refRectA = { 0, 0, 1, 1 }; SDL_Rect refRectB = { 0, 0, 1, 1 }; @@ -901,7 +928,7 @@ int rect_testHasIntersectionPoint (void *arg) * \sa * http://wiki.libsdl.org/SDL_HasIntersection */ -int rect_testHasIntersectionEmpty (void *arg) +int rect_testHasIntersectionEmpty(void *arg) { SDL_Rect refRectA; SDL_Rect refRectB; @@ -961,8 +988,8 @@ int rect_testHasIntersectionEmpty (void *arg) */ int rect_testHasIntersectionParam(void *arg) { - SDL_Rect rectA; - SDL_Rect rectB = {0}; + const SDL_Rect rectA = { 0, 0, 32, 32 }; + const SDL_Rect rectB = { 0, 0, 32, 32 }; SDL_bool intersection; /* invalid parameter combinations */ @@ -996,52 +1023,60 @@ int rect_testEnclosePoints(void *arg) int i; /* Create input data, tracking result */ - for (i=0; i maxx) maxx = newx; - if (newy < miny) miny = newy; - if (newy > maxy) maxy = newy; + if (newx < minx) { + minx = newx; + } + if (newx > maxx) { + maxx = newx; + } + if (newy < miny) { + miny = newy; + } + if (newy > maxy) { + maxy = newy; + } } } /* Call function and validate - special case: no result requested */ anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult, - "Check expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - for (i=0; i maxx) maxx = newx; - if (newy < miny) miny = newy; - if (newy > maxy) maxy = newy; + if (newx < minx) { + minx = newx; + } + if (newx > maxx) { + maxx = newx; + } + if (newy < miny) { + miny = newy; + } + if (newy > maxy) { + maxy = newy; + } } } /* Call function and validate - special case: no result requested */ anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)NULL, (SDL_Rect *)NULL); - SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult, - "Check return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - for (i=0; i=refClip.x) && (newx<(refClip.x + refClip.w)) && - (newy>=refClip.y) && (newy<(refClip.y + refClip.h))) { - if (expectedEnclosed==SDL_FALSE) { + if ((newx >= refClip.x) && (newx < (refClip.x + refClip.w)) && + (newy >= refClip.y) && (newy < (refClip.y + refClip.h))) { + if (expectedEnclosed == SDL_FALSE) { minx = newx; maxx = newx; miny = newy; maxy = newy; } else { - if (newx < minx) minx = newx; - if (newx > maxx) maxx = newx; - if (newy < miny) miny = newy; - if (newy > maxy) maxy = newy; + if (newx < minx) { + minx = newx; + } + if (newx > maxx) { + maxx = newx; + } + if (newy < miny) { + miny = newy; + } + if (newy > maxy) { + maxy = newy; + } } expectedEnclosed = SDL_TRUE; } @@ -1177,35 +1228,35 @@ int rect_testEnclosePointsWithClipping(void *arg) /* Call function and validate - special case: no result requested */ clip = refClip; anyEnclosedNoResult = SDL_EnclosePoints((const SDL_Point *)points, numPoints, (const SDL_Rect *)&clip, (SDL_Rect *)NULL); - SDLTest_AssertCheck(expectedEnclosed==anyEnclosedNoResult, - "Expected return value %s, got %s", - (expectedEnclosed==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE", - (anyEnclosedNoResult==SDL_TRUE) ? "SDL_TRUE" : "SDL_FALSE"); - for (i=0; irefRectB.x) ? refRectA.x : refRectB.x; - miny = (refRectA.yrefRectB.y) ? refRectA.y : refRectB.y; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = 1; + refRectA.h = 1; + refRectB.x = SDLTest_RandomIntegerInRange(-1024, 1024) + dx * 2048; + refRectB.y = SDLTest_RandomIntegerInRange(-1024, 1024) + dx * 2048; + refRectB.w = 1; + refRectB.h = 1; + minx = (refRectA.x < refRectB.x) ? refRectA.x : refRectB.x; + maxx = (refRectA.x > refRectB.x) ? refRectA.x : refRectB.x; + miny = (refRectA.y < refRectB.y) ? refRectA.y : refRectB.y; + maxy = (refRectA.y > refRectB.y) ? refRectA.y : refRectB.y; expectedResult.x = minx; expectedResult.y = miny; expectedResult.w = maxx - minx + 1; @@ -1296,19 +1347,27 @@ int rect_testUnionRectOutside(void *arg) for (dx = -1; dx < 2; dx++) { for (dy = -1; dy < 2; dy++) { if ((dx != 0) || (dy != 0)) { - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=SDLTest_RandomIntegerInRange(256, 512); - refRectA.h=SDLTest_RandomIntegerInRange(256, 512); - refRectB.x=refRectA.x + 1 + dx*2; - refRectB.y=refRectA.y + 1 + dy*2; - refRectB.w=refRectA.w - 2; - refRectB.h=refRectA.h - 2; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = SDLTest_RandomIntegerInRange(256, 512); + refRectA.h = SDLTest_RandomIntegerInRange(256, 512); + refRectB.x = refRectA.x + 1 + dx * 2; + refRectB.y = refRectA.y + 1 + dy * 2; + refRectB.w = refRectA.w - 2; + refRectB.h = refRectA.h - 2; expectedResult = refRectA; - if (dx == -1) expectedResult.x--; - if (dy == -1) expectedResult.y--; - if ((dx == 1) || (dx == -1)) expectedResult.w++; - if ((dy == 1) || (dy == -1)) expectedResult.h++; + if (dx == -1) { + expectedResult.x--; + } + if (dy == -1) { + expectedResult.y--; + } + if ((dx == 1) || (dx == -1)) { + expectedResult.w++; + } + if ((dy == 1) || (dy == -1)) { + expectedResult.h++; + } rectA = refRectA; rectB = refRectB; SDL_UnionRect(&rectA, &rectB, &result); @@ -1334,14 +1393,14 @@ int rect_testUnionRectEmpty(void *arg) SDL_Rect result; /* A empty */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=0; - refRectA.h=0; - refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.w=SDLTest_RandomIntegerInRange(1, 1024); - refRectB.h=SDLTest_RandomIntegerInRange(1, 1024); + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = 0; + refRectA.h = 0; + refRectB.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.w = SDLTest_RandomIntegerInRange(1, 1024); + refRectB.h = SDLTest_RandomIntegerInRange(1, 1024); expectedResult = refRectB; rectA = refRectA; rectB = refRectB; @@ -1349,14 +1408,14 @@ int rect_testUnionRectEmpty(void *arg) _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* B empty */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=SDLTest_RandomIntegerInRange(1, 1024); - refRectA.h=SDLTest_RandomIntegerInRange(1, 1024); - refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.w=0; - refRectB.h=0; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = SDLTest_RandomIntegerInRange(1, 1024); + refRectA.h = SDLTest_RandomIntegerInRange(1, 1024); + refRectB.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.w = 0; + refRectB.h = 0; expectedResult = refRectA; rectA = refRectA; rectB = refRectB; @@ -1364,18 +1423,18 @@ int rect_testUnionRectEmpty(void *arg) _validateUnionRectResults(&rectA, &rectB, &refRectA, &refRectB, &result, &expectedResult); /* A and B empty */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=0; - refRectA.h=0; - refRectB.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectB.w=0; - refRectB.h=0; - result.x=0; - result.y=0; - result.w=0; - result.h=0; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = 0; + refRectA.h = 0; + refRectB.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectB.w = 0; + refRectB.h = 0; + result.x = 0; + result.y = 0; + result.w = 0; + result.h = 0; expectedResult = result; rectA = refRectA; rectB = refRectB; @@ -1400,24 +1459,24 @@ int rect_testUnionRectInside(void *arg) int dx, dy; /* Union 1x1 with itself */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=1; - refRectA.h=1; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = 1; + refRectA.h = 1; expectedResult = refRectA; rectA = refRectA; SDL_UnionRect(&rectA, &rectA, &result); _validateUnionRectResults(&rectA, &rectA, &refRectA, &refRectA, &result, &expectedResult); /* Union 1x1 somewhere inside */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=SDLTest_RandomIntegerInRange(256, 1024); - refRectA.h=SDLTest_RandomIntegerInRange(256, 1024); - refRectB.x=refRectA.x + 1 + SDLTest_RandomIntegerInRange(1, refRectA.w - 2); - refRectB.y=refRectA.y + 1 + SDLTest_RandomIntegerInRange(1, refRectA.h - 2); - refRectB.w=1; - refRectB.h=1; + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = SDLTest_RandomIntegerInRange(256, 1024); + refRectA.h = SDLTest_RandomIntegerInRange(256, 1024); + refRectB.x = refRectA.x + 1 + SDLTest_RandomIntegerInRange(1, refRectA.w - 2); + refRectB.y = refRectA.y + 1 + SDLTest_RandomIntegerInRange(1, refRectA.h - 2); + refRectB.w = 1; + refRectB.h = 1; expectedResult = refRectA; rectA = refRectA; rectB = refRectB; @@ -1428,15 +1487,23 @@ int rect_testUnionRectInside(void *arg) for (dx = -1; dx < 2; dx++) { for (dy = -1; dy < 2; dy++) { if ((dx != 0) || (dy != 0)) { - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=SDLTest_RandomIntegerInRange(256, 1024); - refRectA.h=SDLTest_RandomIntegerInRange(256, 1024); + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = SDLTest_RandomIntegerInRange(256, 1024); + refRectA.h = SDLTest_RandomIntegerInRange(256, 1024); refRectB = refRectA; - if (dx == -1) refRectB.x++; - if ((dx == 1) || (dx == -1)) refRectB.w--; - if (dy == -1) refRectB.y++; - if ((dy == 1) || (dy == -1)) refRectB.h--; + if (dx == -1) { + refRectB.x++; + } + if ((dx == 1) || (dx == -1)) { + refRectB.w--; + } + if (dy == -1) { + refRectB.y++; + } + if ((dy == 1) || (dy == -1)) { + refRectB.h--; + } expectedResult = refRectA; rectA = refRectA; rectB = refRectB; @@ -1457,7 +1524,8 @@ int rect_testUnionRectInside(void *arg) */ int rect_testUnionRectParam(void *arg) { - SDL_Rect rectA, rectB = { 0 }; + const SDL_Rect rectA = { 0, 0, 32, 32 }; + const SDL_Rect rectB = { 0, 0, 32, 32 }; SDL_Rect result; /* invalid parameter combinations */ @@ -1492,26 +1560,26 @@ int rect_testRectEmpty(void *arg) int w, h; /* Non-empty case */ - refRect.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRect.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRect.w=SDLTest_RandomIntegerInRange(256, 1024); - refRect.h=SDLTest_RandomIntegerInRange(256, 1024); + refRect.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRect.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRect.w = SDLTest_RandomIntegerInRange(256, 1024); + refRect.h = SDLTest_RandomIntegerInRange(256, 1024); expectedResult = SDL_FALSE; rect = refRect; - result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect); + result = SDL_RectEmpty(&rect); _validateRectEmptyResults(result, expectedResult, &rect, &refRect); /* Empty case */ - for (w=-1; w<2; w++) { - for (h=-1; h<2; h++) { + for (w = -1; w < 2; w++) { + for (h = -1; h < 2; h++) { if ((w != 1) || (h != 1)) { - refRect.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRect.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRect.w=w; - refRect.h=h; + refRect.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRect.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRect.w = w; + refRect.h = h; expectedResult = SDL_TRUE; rect = refRect; - result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)&rect); + result = SDL_RectEmpty(&rect); _validateRectEmptyResults(result, expectedResult, &rect, &refRect); } } @@ -1531,7 +1599,7 @@ int rect_testRectEmptyParam(void *arg) SDL_bool result; /* invalid parameter combinations */ - result = (SDL_bool)SDL_RectEmpty((const SDL_Rect *)NULL); + result = SDL_RectEmpty(NULL); SDLTest_AssertCheck(result == SDL_TRUE, "Check that function returns TRUE when 1st parameter is NULL"); return TEST_COMPLETED; @@ -1553,15 +1621,15 @@ int rect_testRectEquals(void *arg) SDL_bool result; /* Equals */ - refRectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=SDLTest_RandomIntegerInRange(1, 1024); - refRectA.h=SDLTest_RandomIntegerInRange(1, 1024); + refRectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = SDLTest_RandomIntegerInRange(1, 1024); + refRectA.h = SDLTest_RandomIntegerInRange(1, 1024); refRectB = refRectA; expectedResult = SDL_TRUE; rectA = refRectA; rectB = refRectB; - result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)&rectB); + result = SDL_RectEquals(&rectA, &rectB); _validateRectEqualsResults(result, expectedResult, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; @@ -1580,21 +1648,21 @@ int rect_testRectEqualsParam(void *arg) SDL_bool result; /* data setup */ - rectA.x=SDLTest_RandomIntegerInRange(-1024, 1024); - rectA.y=SDLTest_RandomIntegerInRange(-1024, 1024); - rectA.w=SDLTest_RandomIntegerInRange(1, 1024); - rectA.h=SDLTest_RandomIntegerInRange(1, 1024); - rectB.x=SDLTest_RandomIntegerInRange(-1024, 1024); - rectB.y=SDLTest_RandomIntegerInRange(-1024, 1024); - rectB.w=SDLTest_RandomIntegerInRange(1, 1024); - rectB.h=SDLTest_RandomIntegerInRange(1, 1024); + rectA.x = SDLTest_RandomIntegerInRange(-1024, 1024); + rectA.y = SDLTest_RandomIntegerInRange(-1024, 1024); + rectA.w = SDLTest_RandomIntegerInRange(1, 1024); + rectA.h = SDLTest_RandomIntegerInRange(1, 1024); + rectB.x = SDLTest_RandomIntegerInRange(-1024, 1024); + rectB.y = SDLTest_RandomIntegerInRange(-1024, 1024); + rectB.w = SDLTest_RandomIntegerInRange(1, 1024); + rectB.h = SDLTest_RandomIntegerInRange(1, 1024); /* invalid parameter combinations */ - result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)&rectB); + result = SDL_RectEquals(NULL, &rectB); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); - result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)&rectA, (const SDL_Rect *)NULL); + result = SDL_RectEquals(&rectA, NULL); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); - result = (SDL_bool)SDL_RectEquals((const SDL_Rect *)NULL, (const SDL_Rect *)NULL); + result = SDL_RectEquals(NULL, NULL); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); return TEST_COMPLETED; @@ -1616,15 +1684,15 @@ int rect_testFRectEquals(void *arg) SDL_bool result; /* Equals */ - refRectA.x=(float)SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.y=(float)SDLTest_RandomIntegerInRange(-1024, 1024); - refRectA.w=(float)SDLTest_RandomIntegerInRange(1, 1024); - refRectA.h=(float)SDLTest_RandomIntegerInRange(1, 1024); + refRectA.x = (float)SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.y = (float)SDLTest_RandomIntegerInRange(-1024, 1024); + refRectA.w = (float)SDLTest_RandomIntegerInRange(1, 1024); + refRectA.h = (float)SDLTest_RandomIntegerInRange(1, 1024); refRectB = refRectA; expectedResult = SDL_TRUE; rectA = refRectA; rectB = refRectB; - result = (SDL_bool)SDL_FRectEquals((const SDL_FRect *)&rectA, (const SDL_FRect *)&rectB); + result = SDL_FRectEquals(&rectA, &rectB); _validateFRectEqualsResults(result, expectedResult, &rectA, &rectB, &refRectA, &refRectB); return TEST_COMPLETED; @@ -1643,132 +1711,403 @@ int rect_testFRectEqualsParam(void *arg) SDL_bool result; /* data setup -- For the purpose of this test, the values don't matter. */ - rectA.x=SDLTest_RandomFloat(); - rectA.y=SDLTest_RandomFloat(); - rectA.w=SDLTest_RandomFloat(); - rectA.h=SDLTest_RandomFloat(); - rectB.x=SDLTest_RandomFloat(); - rectB.y=SDLTest_RandomFloat(); - rectB.w=SDLTest_RandomFloat(); - rectB.h=SDLTest_RandomFloat(); + rectA.x = SDLTest_RandomFloat(); + rectA.y = SDLTest_RandomFloat(); + rectA.w = SDLTest_RandomFloat(); + rectA.h = SDLTest_RandomFloat(); + rectB.x = SDLTest_RandomFloat(); + rectB.y = SDLTest_RandomFloat(); + rectB.w = SDLTest_RandomFloat(); + rectB.h = SDLTest_RandomFloat(); /* invalid parameter combinations */ - result = (SDL_bool)SDL_FRectEquals((const SDL_FRect *)NULL, (const SDL_FRect *)&rectB); + result = SDL_FRectEquals(NULL, &rectB); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st parameter is NULL"); - result = (SDL_bool)SDL_FRectEquals((const SDL_FRect *)&rectA, (const SDL_FRect *)NULL); + result = SDL_FRectEquals(&rectA, NULL); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 2nd parameter is NULL"); - result = (SDL_bool)SDL_FRectEquals((const SDL_FRect *)NULL, (const SDL_FRect *)NULL); + result = SDL_FRectEquals(NULL, NULL); SDLTest_AssertCheck(result == SDL_FALSE, "Check that function returns SDL_FALSE when 1st and 2nd parameter are NULL"); return TEST_COMPLETED; } +/* ! + * \brief Test SDL_HasIntersectionF + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_HasIntersectionF + */ +int rect_testHasIntersectionF(void *arg) +{ + const struct { + SDL_FRect r1; + SDL_FRect r2; + SDL_bool expected; + } cases[] = { + { { 0, 0, 0, 0 }, {0, 0, 0, 0}, SDL_FALSE }, + { { 0, 0, -200, 200 }, {0, 0, -200, 200}, SDL_FALSE }, + { { 0, 0, 10, 10 }, {-5, 5, 10, 2}, SDL_TRUE }, + { { 0, 0, 10, 10 }, {-5, -5, 10, 2}, SDL_FALSE }, + { { 0, 0, 10, 10 }, {-5, -5, 2, 10}, SDL_FALSE }, + { { 0, 0, 10, 10 }, {-5, -5, 5, 5}, SDL_FALSE }, + { { 0, 0, 10, 10 }, {-5, -5, 5.1f, 5.1f}, SDL_TRUE }, + { { 0, 0, 10, 10 }, {-4.99f, -4.99f, 5, 5}, SDL_TRUE }, + }; + size_t i; + + for (i = 0; i < SDL_arraysize(cases); i++) { + SDL_bool result; + SDLTest_AssertPass("About to call SDL_HasIntersectionF(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })", + cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h, + cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h + ); + result = SDL_HasIntersectionF(&cases[i].r1, &cases[i].r2); + SDLTest_AssertCheck(result == cases[i].expected, "Got %d, expected %d", result, cases[i].expected); + } + return TEST_COMPLETED; +} + +/* ! + * \brief Test SDL_IntersectFRect + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_IntersectFRect + */ +int rect_testIntersectFRect(void *arg) +{ + const struct { + SDL_FRect r1; + SDL_FRect r2; + SDL_bool result; + SDL_FRect intersect; + } cases[] = { + { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, SDL_FALSE }, + { { 0, 0, -200, 200 }, { 0, 0, -200, 200 }, SDL_FALSE }, + { { 0, 0, 10, 10 }, { -5, 5, 9.9f, 2 }, SDL_TRUE, { 0, 5, 4.9f, 2 } }, + { { 0, 0, 10, 10 }, { -5, -5, 10, 2 }, SDL_FALSE}, + { { 0, 0, 10, 10 }, { -5, -5, 2, 10 }, SDL_FALSE}, + { { 0, 0, 10, 10 }, { -5, -5, 5, 5 }, SDL_FALSE}, + { { 0, 0, 10, 10 }, { -5, -5, 5.5f, 6 }, SDL_TRUE, { 0, 0, 0.5f, 1 } } + }; + size_t i; + + for (i = 0; i < SDL_arraysize(cases); i++) { + SDL_bool result; + SDL_FRect intersect; + SDLTest_AssertPass("About to call SDL_IntersectFRect(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })", + cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h, + cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h + ); + result = SDL_IntersectFRect(&cases[i].r1, &cases[i].r2, &intersect); + SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result); + if (cases[i].result) { + SDLTest_AssertCheck(IsFRectEqual(&intersect, &cases[i].intersect), + "Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }", + intersect.x, intersect.y, intersect.w, intersect.h, + cases[i].intersect.x, cases[i].intersect.y, cases[i].intersect.w, cases[i].intersect.h); + } + } + return TEST_COMPLETED; +} + +/* ! + * \brief Test SDL_UnionFRect + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_UnionFRect + */ +int rect_testUnionFRect(void *arg) +{ + const struct { + SDL_FRect r1; + SDL_FRect r2; + SDL_FRect expected; + } cases[] = { + { { 0, 0, 10, 10 }, { 19.9f, 20, 10, 10 }, { 0, 0, 29.9f, 30 } }, + { { 0, 0, 0, 0 }, { 20, 20.1f, 10.1f, 10 }, { 20, 20.1f, 10.1f, 10 } }, + { { -200, -4.5f, 450, 33 }, { 20, 20, 10, 10 }, { -200, -4.5f, 450, 34.5f } }, + { { 0, 0, 15, 16.5f }, { 20, 20, 0, 0 }, { 0, 0, 15, 16.5f } } + }; + size_t i; + + for (i = 0; i < SDL_arraysize(cases); i++) { + SDL_FRect result; + SDLTest_AssertPass("About to call SDL_UnionFRect(&{ %g, %g, %g, %g }, &{ %g, %g, %g, %g })", + cases[i].r1.x, cases[i].r1.y, cases[i].r1.w, cases[i].r1.h, + cases[i].r2.x, cases[i].r2.y, cases[i].r2.w, cases[i].r2.h + ); + SDL_UnionFRect(&cases[i].r1, &cases[i].r2, &result); + SDLTest_AssertCheck(IsFRectEqual(&result, &cases[i].expected), + "Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }", + result.x, result.y, result.w, result.h, + cases[i].expected.x, cases[i].expected.y, cases[i].expected.w, cases[i].expected.h); + } + return TEST_COMPLETED; +} + +/* ! + * \brief Test SDL_EncloseFPointsUnionFRect + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_EncloseFPoints + */ +int rect_testEncloseFPoints(void *arg) +{ + const struct { + SDL_bool with_clip; + SDL_FRect clip; + SDL_bool result; + SDL_FRect enclosing; + } cases[] = { + { SDL_TRUE, { 0, 0, 10, 10 }, SDL_TRUE, { 0.5f, 0.1f, 6, 8 }}, + { SDL_TRUE, { 1.2f, 1, 10, 10 }, SDL_TRUE, { 1.5f, 1.1f, 5, 7 }}, + { SDL_TRUE, { -10, -10, 3, 3 }, SDL_FALSE }, + { SDL_FALSE, { 0 }, SDL_TRUE, { 0.5, 0.1f, 6, 8 }} + }; + const SDL_FPoint points[] = { + { 0.5f, 0.1f }, + { 5.5f, 7.1f }, + { 1.5f, 1.1f } + }; + char points_str[256]; + size_t i; + + SDL_strlcpy(points_str, "{", sizeof(points_str)); + for (i = 0; i < SDL_arraysize(points); i++) { + char point_str[32]; + SDL_snprintf(point_str, sizeof(point_str), "{ %g, %g }, ", points[i].x, points[i].y); + SDL_strlcat(points_str, point_str, sizeof(points_str)); + } + SDL_strlcat(points_str, "}", sizeof(points_str)); + for (i = 0; i < SDL_arraysize(cases); i++) { + char clip_str[64]; + SDL_bool result; + SDL_FRect enclosing; + const SDL_FRect* clip_ptr = NULL; + if (cases[i].with_clip) { + SDL_snprintf(clip_str, sizeof(clip_str), "&{ %g, %g, %g, %g }", + cases[i].clip.x, cases[i].clip.y, cases[i].clip.w, cases[i].clip.h); + clip_ptr = &cases[i].clip; + } else { + SDL_strlcpy(clip_str, "NULL", sizeof(clip_str)); + } + SDLTest_AssertPass("About to call SDL_EncloseFPoints(&%s, %d, %s)", points_str, (int)SDL_arraysize(points), clip_str); + result = SDL_EncloseFPoints(points, SDL_arraysize(points), clip_ptr, &enclosing); + SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result); + if (cases[i].result) { + SDLTest_AssertCheck(IsFRectEqual(&enclosing, &cases[i].enclosing), + "Got { %g, %g, %g, %g }, expected { %g, %g, %g, %g }", + enclosing.x, enclosing.y, enclosing.w, enclosing.h, + cases[i].enclosing.x, cases[i].enclosing.y, cases[i].enclosing.w, cases[i].enclosing.h); + } + } + return TEST_COMPLETED; +} + +/* ! + * \brief Test SDL_IntersectFRectAndLine + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_IntersectFRectAndLine + */ +int rect_testIntersectFRectAndLine(void *arg) +{ + const struct { + SDL_FRect rect; + SDL_FPoint p1; + SDL_FPoint p2; + SDL_bool result; + SDL_FPoint expected1; + SDL_FPoint expected2; + } cases[] = { + { { 0, 0, 0, 0 }, { -4.8f, -4.8f }, { 5.2f, 5.2f }, SDL_FALSE }, + { { 0, 0, 2, 2 }, { -1, -1 }, { 3.5f, 3.5f }, SDL_TRUE, { 0, 0 }, { 1, 1 } }, + { { -4, -4, 14, 14 }, { 8, 22 }, { 8, 33}, SDL_FALSE } + + }; + size_t i; + + for (i = 0; i < SDL_arraysize(cases); i++) { + SDL_bool result; + SDL_FPoint p1 = cases[i].p1; + SDL_FPoint p2 = cases[i].p2; + + SDLTest_AssertPass("About to call SDL_IntersectFRectAndLine(&{%g, %g, %g, %g}, &%g, &%g, &%g, &%g)", + cases[i].rect.x, cases[i].rect.y, cases[i].rect.w, cases[i].rect.h, + p1.x, p1.y, p2.x, p2.y); + result = SDL_IntersectFRectAndLine(&cases[i].rect, &p1.x, &p1.y, &p2.x, &p2.y); + SDLTest_AssertCheck(result == cases[i].result, "Got %d, expected %d", result, cases[i].result); + if (cases[i].result) { + SDLTest_AssertCheck(IsFPointEqual(&p1, &cases[i].expected1), + "Got p1={ %g, %g }, expected p1={ %g, %g }", + p1.x, p1.y, + cases[i].expected1.x, cases[i].expected1.y); + SDLTest_AssertCheck(IsFPointEqual(&p2, &cases[i].expected2), + "Got p2={ %g, %g }, expected p2={ %g, %g }", + p2.x, p2.y, + cases[i].expected2.x, cases[i].expected2.y); + } + } + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Rect test cases */ /* SDL_IntersectRectAndLine */ -static const SDLTest_TestCaseReference rectTest1 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLine,"rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest1 = { + (SDLTest_TestCaseFp)rect_testIntersectRectAndLine, "rect_testIntersectRectAndLine", "Tests SDL_IntersectRectAndLine clipping cases", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest2 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineInside, "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest2 = { + (SDLTest_TestCaseFp)rect_testIntersectRectAndLineInside, "rect_testIntersectRectAndLineInside", "Tests SDL_IntersectRectAndLine with line fully contained in rect", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest3 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineOutside, "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest3 = { + (SDLTest_TestCaseFp)rect_testIntersectRectAndLineOutside, "rect_testIntersectRectAndLineOutside", "Tests SDL_IntersectRectAndLine with line fully outside of rect", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest4 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineEmpty, "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest4 = { + (SDLTest_TestCaseFp)rect_testIntersectRectAndLineEmpty, "rect_testIntersectRectAndLineEmpty", "Tests SDL_IntersectRectAndLine with empty rectangle ", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest5 = - { (SDLTest_TestCaseFp)rect_testIntersectRectAndLineParam, "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest5 = { + (SDLTest_TestCaseFp)rect_testIntersectRectAndLineParam, "rect_testIntersectRectAndLineParam", "Negative tests against SDL_IntersectRectAndLine with invalid parameters", TEST_ENABLED +}; /* SDL_IntersectRect */ -static const SDLTest_TestCaseReference rectTest6 = - { (SDLTest_TestCaseFp)rect_testIntersectRectInside, "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest6 = { + (SDLTest_TestCaseFp)rect_testIntersectRectInside, "rect_testIntersectRectInside", "Tests SDL_IntersectRect with B fully contained in A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest7 = - { (SDLTest_TestCaseFp)rect_testIntersectRectOutside, "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest7 = { + (SDLTest_TestCaseFp)rect_testIntersectRectOutside, "rect_testIntersectRectOutside", "Tests SDL_IntersectRect with B fully outside of A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest8 = - { (SDLTest_TestCaseFp)rect_testIntersectRectPartial, "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest8 = { + (SDLTest_TestCaseFp)rect_testIntersectRectPartial, "rect_testIntersectRectPartial", "Tests SDL_IntersectRect with B partially intersecting A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest9 = - { (SDLTest_TestCaseFp)rect_testIntersectRectPoint, "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest9 = { + (SDLTest_TestCaseFp)rect_testIntersectRectPoint, "rect_testIntersectRectPoint", "Tests SDL_IntersectRect with 1x1 sized rectangles", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest10 = - { (SDLTest_TestCaseFp)rect_testIntersectRectEmpty, "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest10 = { + (SDLTest_TestCaseFp)rect_testIntersectRectEmpty, "rect_testIntersectRectEmpty", "Tests SDL_IntersectRect with empty rectangles", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest11 = - { (SDLTest_TestCaseFp)rect_testIntersectRectParam, "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest11 = { + (SDLTest_TestCaseFp)rect_testIntersectRectParam, "rect_testIntersectRectParam", "Negative tests against SDL_IntersectRect with invalid parameters", TEST_ENABLED +}; /* SDL_HasIntersection */ -static const SDLTest_TestCaseReference rectTest12 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionInside, "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest12 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionInside, "rect_testHasIntersectionInside", "Tests SDL_HasIntersection with B fully contained in A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest13 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionOutside, "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest13 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionOutside, "rect_testHasIntersectionOutside", "Tests SDL_HasIntersection with B fully outside of A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest14 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionPartial,"rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest14 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionPartial, "rect_testHasIntersectionPartial", "Tests SDL_HasIntersection with B partially intersecting A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest15 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionPoint, "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest15 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionPoint, "rect_testHasIntersectionPoint", "Tests SDL_HasIntersection with 1x1 sized rectangles", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest16 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionEmpty, "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest16 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionEmpty, "rect_testHasIntersectionEmpty", "Tests SDL_HasIntersection with empty rectangles", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest17 = - { (SDLTest_TestCaseFp)rect_testHasIntersectionParam, "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest17 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionParam, "rect_testHasIntersectionParam", "Negative tests against SDL_HasIntersection with invalid parameters", TEST_ENABLED +}; /* SDL_EnclosePoints */ -static const SDLTest_TestCaseReference rectTest18 = - { (SDLTest_TestCaseFp)rect_testEnclosePoints, "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest18 = { + (SDLTest_TestCaseFp)rect_testEnclosePoints, "rect_testEnclosePoints", "Tests SDL_EnclosePoints without clipping", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest19 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsWithClipping, "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest19 = { + (SDLTest_TestCaseFp)rect_testEnclosePointsWithClipping, "rect_testEnclosePointsWithClipping", "Tests SDL_EnclosePoints with clipping", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest20 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsRepeatedInput, "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest20 = { + (SDLTest_TestCaseFp)rect_testEnclosePointsRepeatedInput, "rect_testEnclosePointsRepeatedInput", "Tests SDL_EnclosePoints with repeated input", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest21 = - { (SDLTest_TestCaseFp)rect_testEnclosePointsParam, "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest21 = { + (SDLTest_TestCaseFp)rect_testEnclosePointsParam, "rect_testEnclosePointsParam", "Negative tests against SDL_EnclosePoints with invalid parameters", TEST_ENABLED +}; /* SDL_UnionRect */ -static const SDLTest_TestCaseReference rectTest22 = - { (SDLTest_TestCaseFp)rect_testUnionRectInside, "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest22 = { + (SDLTest_TestCaseFp)rect_testUnionRectInside, "rect_testUnionRectInside", "Tests SDL_UnionRect where rect B is inside rect A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest23 = - { (SDLTest_TestCaseFp)rect_testUnionRectOutside, "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest23 = { + (SDLTest_TestCaseFp)rect_testUnionRectOutside, "rect_testUnionRectOutside", "Tests SDL_UnionRect where rect B is outside rect A", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest24 = - { (SDLTest_TestCaseFp)rect_testUnionRectEmpty, "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest24 = { + (SDLTest_TestCaseFp)rect_testUnionRectEmpty, "rect_testUnionRectEmpty", "Tests SDL_UnionRect where rect A or rect B are empty", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest25 = - { (SDLTest_TestCaseFp)rect_testUnionRectParam, "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest25 = { + (SDLTest_TestCaseFp)rect_testUnionRectParam, "rect_testUnionRectParam", "Negative tests against SDL_UnionRect with invalid parameters", TEST_ENABLED +}; /* SDL_RectEmpty */ -static const SDLTest_TestCaseReference rectTest26 = - { (SDLTest_TestCaseFp)rect_testRectEmpty, "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest26 = { + (SDLTest_TestCaseFp)rect_testRectEmpty, "rect_testRectEmpty", "Tests SDL_RectEmpty with various inputs", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest27 = - { (SDLTest_TestCaseFp)rect_testRectEmptyParam, "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest27 = { + (SDLTest_TestCaseFp)rect_testRectEmptyParam, "rect_testRectEmptyParam", "Negative tests against SDL_RectEmpty with invalid parameters", TEST_ENABLED +}; /* SDL_RectEquals */ -static const SDLTest_TestCaseReference rectTest28 = - { (SDLTest_TestCaseFp)rect_testRectEquals, "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest28 = { + (SDLTest_TestCaseFp)rect_testRectEquals, "rect_testRectEquals", "Tests SDL_RectEquals with various inputs", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest29 = - { (SDLTest_TestCaseFp)rect_testRectEqualsParam, "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest29 = { + (SDLTest_TestCaseFp)rect_testRectEqualsParam, "rect_testRectEqualsParam", "Negative tests against SDL_RectEquals with invalid parameters", TEST_ENABLED +}; /* SDL_FRectEquals */ -static const SDLTest_TestCaseReference rectTest30 = - { (SDLTest_TestCaseFp)rect_testFRectEquals, "rect_testFRectEquals", "Tests SDL_FRectEquals with various inputs", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest30 = { + (SDLTest_TestCaseFp)rect_testFRectEquals, "rect_testFRectEquals", "Tests SDL_FRectEquals with various inputs", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference rectTest31 = { + (SDLTest_TestCaseFp)rect_testFRectEqualsParam, "rect_testFRectEqualsParam", "Negative tests against SDL_FRectEquals with invalid parameters", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference rectTest32 = { + (SDLTest_TestCaseFp)rect_testHasIntersectionF, "rect_testHasIntersectionF", "Tests SDL_HasIntersectionF", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference rectTest33 = { + (SDLTest_TestCaseFp)rect_testIntersectFRect, "rect_testIntersectFRect", "Tests SDL_IntersectFRect", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference rectTest34 = { + (SDLTest_TestCaseFp)rect_testUnionFRect, "rect_testUnionFRect", "Tests SDL_UnionFRect", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference rectTest35 = { + (SDLTest_TestCaseFp)rect_testEncloseFPoints, "rect_testEncloseFPoints", "Tests SDL_EncloseFPoints", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rectTest31 = - { (SDLTest_TestCaseFp)rect_testFRectEqualsParam, "rect_testFRectEqualsParam", "Negative tests against SDL_FRectEquals with invalid parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rectTest36 = { + (SDLTest_TestCaseFp)rect_testIntersectFRectAndLine, "rect_testIntersectFRectAndLine", "Tests SDL_IntersectFRectAndLine", TEST_ENABLED +}; /* ! * \brief Sequence of Rect test cases; functions that handle simple rectangles including overlaps and merges. @@ -1776,13 +2115,12 @@ static const SDLTest_TestCaseReference rectTest31 = * \sa * http://wiki.libsdl.org/CategoryRect */ -static const SDLTest_TestCaseReference *rectTests[] = { +static const SDLTest_TestCaseReference *rectTests[] = { &rectTest1, &rectTest2, &rectTest3, &rectTest4, &rectTest5, &rectTest6, &rectTest7, &rectTest8, &rectTest9, &rectTest10, &rectTest11, &rectTest12, &rectTest13, &rectTest14, &rectTest15, &rectTest16, &rectTest17, &rectTest18, &rectTest19, &rectTest20, &rectTest21, &rectTest22, &rectTest23, &rectTest24, &rectTest25, &rectTest26, &rectTest27, - &rectTest28, &rectTest29, &rectTest30, &rectTest31, NULL + &rectTest28, &rectTest29, &rectTest30, &rectTest31, &rectTest32, &rectTest33, &rectTest34, &rectTest35, &rectTest36, NULL }; - /* Rect test suite (global) */ SDLTest_TestSuiteReference rectTestSuite = { "Rect", diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 52da1bfe1e877..62e62f17e59a6 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -10,14 +10,14 @@ /* ================= Test Case Implementation ================== */ -#define TESTRENDER_SCREEN_W 80 -#define TESTRENDER_SCREEN_H 60 +#define TESTRENDER_SCREEN_W 80 +#define TESTRENDER_SCREEN_H 60 -#define RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888 -#define RENDER_COMPARE_AMASK 0xff000000 /**< Alpha bit mask. */ -#define RENDER_COMPARE_RMASK 0x00ff0000 /**< Red bit mask. */ -#define RENDER_COMPARE_GMASK 0x0000ff00 /**< Green bit mask. */ -#define RENDER_COMPARE_BMASK 0x000000ff /**< Blue bit mask. */ +#define RENDER_COMPARE_FORMAT SDL_PIXELFORMAT_ARGB8888 +#define RENDER_COMPARE_AMASK 0xff000000 /**< Alpha bit mask. */ +#define RENDER_COMPARE_RMASK 0x00ff0000 /**< Red bit mask. */ +#define RENDER_COMPARE_GMASK 0x0000ff00 /**< Green bit mask. */ +#define RENDER_COMPARE_BMASK 0x000000ff /**< Blue bit mask. */ #define ALLOWABLE_ERROR_OPAQUE 0 #define ALLOWABLE_ERROR_BLENDED 64 @@ -28,7 +28,7 @@ SDL_Renderer *renderer = NULL; /* Prototypes for helper functions */ -static int _clearScreen (void); +static int _clearScreen(void); static void _compare(SDL_Surface *reference, int allowable_error); static int _hasTexAlpha(void); static int _hasTexColor(void); @@ -42,22 +42,27 @@ static int _isSupported(int code); */ void InitCreateRenderer(void *arg) { - int posX = 100, posY = 100, width = 320, height = 240; - renderer = NULL; - window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0); - SDLTest_AssertPass("SDL_CreateWindow()"); - SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result"); - if (window == NULL) { - return; - } - - renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); - SDLTest_AssertPass("SDL_CreateRenderer()"); - SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result"); - if (renderer == NULL) { - SDL_DestroyWindow(window); - return; - } + int posX = 100, posY = 100, width = 320, height = 240; + int renderer_flags = SDL_RENDERER_ACCELERATED; + renderer = NULL; + window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0); + SDLTest_AssertPass("SDL_CreateWindow()"); + SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result"); + if (window == NULL) { + return; + } + + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) { + renderer_flags = 0; + } + + renderer = SDL_CreateRenderer(window, -1, renderer_flags); + SDLTest_AssertPass("SDL_CreateRenderer()"); + SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result"); + if (renderer == NULL) { + SDL_DestroyWindow(window); + return; + } } /* @@ -65,36 +70,33 @@ void InitCreateRenderer(void *arg) */ void CleanupDestroyRenderer(void *arg) { - if (renderer != NULL) { - SDL_DestroyRenderer(renderer); - renderer = NULL; - SDLTest_AssertPass("SDL_DestroyRenderer()"); - } - - if (window != NULL) { - SDL_DestroyWindow(window); - window = NULL; - SDLTest_AssertPass("SDL_DestroyWindow"); - } + if (renderer) { + SDL_DestroyRenderer(renderer); + renderer = NULL; + SDLTest_AssertPass("SDL_DestroyRenderer()"); + } + + if (window) { + SDL_DestroyWindow(window); + window = NULL; + SDLTest_AssertPass("SDL_DestroyWindow"); + } } - /** * @brief Tests call to SDL_GetNumRenderDrivers * * \sa * http://wiki.libsdl.org/SDL_GetNumRenderDrivers */ -int -render_testGetNumRenderDrivers(void *arg) +int render_testGetNumRenderDrivers(void *arg) { - int n; - n = SDL_GetNumRenderDrivers(); - SDLTest_AssertCheck(n >= 1, "Number of renderers >= 1, reported as %i", n); - return TEST_COMPLETED; + int n; + n = SDL_GetNumRenderDrivers(); + SDLTest_AssertCheck(n >= 1, "Number of renderers >= 1, reported as %i", n); + return TEST_COMPLETED; } - /** * @brief Tests the SDL primitives for rendering. * @@ -104,102 +106,106 @@ render_testGetNumRenderDrivers(void *arg) * http://wiki.libsdl.org/SDL_RenderDrawLine * */ -int render_testPrimitives (void *arg) +int render_testPrimitives(void *arg) { - int ret; - int x, y; - SDL_Rect rect; - SDL_Surface *referenceSurface = NULL; - int checkFailCount1; - int checkFailCount2; - - /* Clear surface. */ - _clearScreen(); - - /* Need drawcolor or just skip test. */ - SDLTest_AssertCheck(_hasDrawColor(), "_hasDrawColor"); - - /* Draw a rectangle. */ - rect.x = 40; - rect.y = 0; - rect.w = 40; - rect.h = 80; - - ret = SDL_SetRenderDrawColor(renderer, 13, 73, 200, SDL_ALPHA_OPAQUE ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); - - ret = SDL_RenderFillRect(renderer, &rect ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret); - - /* Draw a rectangle. */ - rect.x = 10; - rect.y = 10; - rect.w = 60; - rect.h = 40; - ret = SDL_SetRenderDrawColor(renderer, 200, 0, 100, SDL_ALPHA_OPAQUE ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); - - ret = SDL_RenderFillRect(renderer, &rect ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderFillRect, expected: 0, got: %i", ret); - - /* Draw some points like so: - * X.X.X.X.. - * .X.X.X.X. - * X.X.X.X.. */ - checkFailCount1 = 0; - checkFailCount2 = 0; - for (y=0; y<3; y++) { - for (x = y % 2; x= surface->w || y >= surface->h) { + SDLTest_AssertCheck(x < surface->w, "x (%d) < surface->w (%d)", x, surface->w); + SDLTest_AssertCheck(y < surface->h, "y (%d) < surface->h (%d)", y, surface->h); + result = 0xdeadbabe; + } else { + SDL_memcpy(&result, (Uint8 *)surface->pixels + surface->pitch * y + surface->format->BytesPerPixel * x, sizeof(Uint32)); + } + return result; } +static int render_testRGBSurfaceNoAlpha(void* arg) +{ + SDL_Surface *surface; + SDL_Renderer *software_renderer; + SDL_Surface *surface2; + SDL_Texture *texture2; + int result; + SDL_Rect dest_rect; + SDL_Point point; + Uint32 pixel; + + SDLTest_AssertPass("About to call SDL_CreateRGBSurface(0, 128, 128, 32, 0xff0000, 0xff00, 0xff, 0)"); + surface = SDL_CreateRGBSurface(0, 128, 128, 32, 0xff0000, 0xff00, 0xff, 0); + SDLTest_AssertCheck(surface != NULL, "Returned surface must be not NULL"); + + SDLTest_AssertCheck(surface->format->BitsPerPixel == 32, "surface->format->BitsPerPixel should be 32, actual value is %d", surface->format->BitsPerPixel); + SDLTest_AssertCheck(surface->format->BytesPerPixel == 4, "surface->format->BytesPerPixels should be 4, actual value is %d", surface->format->BytesPerPixel); + + SDLTest_AssertPass("About to call SDL_CreateSoftwareRenderer(surface)"); + software_renderer = SDL_CreateSoftwareRenderer(surface); + SDLTest_AssertCheck(software_renderer != NULL, "Returned renderer must be not NULL"); + + SDLTest_AssertPass("About to call SDL_CreateRGBSurface(0, 16, 16, 32, 0xff0000, 0xff00, 0xff, 0)"); + surface2 = SDL_CreateRGBSurface(0, 16, 16, 32, 0xff0000, 0xff00, 0xff, 0); + SDLTest_AssertCheck(surface2 != NULL, "Returned surface must be not NULL"); + + SDLTest_AssertPass("About to call SDL_FillRect(surface2, NULL, 0)"); + result = SDL_FillRect(surface2, NULL, SDL_MapRGB(surface2->format, 0, 0, 0)); + SDLTest_AssertCheck(result == 0, "Result should be 0, actual value is %d", result); + + SDLTest_AssertPass("About to call SDL_CreateTextureFromSurface(software_renderer, surface2)"); + texture2 = SDL_CreateTextureFromSurface(software_renderer, surface2); + SDLTest_AssertCheck(texture2 != NULL, "Returned texture is not NULL"); + + SDLTest_AssertPass("About to call SDL_SetRenderDrawColor(renderer, 0xaa, 0xbb, 0xcc, 0x0)"); + result = SDL_SetRenderDrawColor(software_renderer, 0xaa, 0xbb, 0xcc, 0x0); + + SDLTest_AssertPass("About to call SDL_RenderClear(renderer)"); + result = SDL_RenderClear(software_renderer); + SDLTest_AssertCheck(result == 0, "Result should be 0, actual value is %d", result); + + SDLTest_AssertPass("About to call SDL_SetRenderDrawColor(renderer, 0x0, 0x0, 0x0, 0x0)"); + result = SDL_SetRenderDrawColor(software_renderer, 0x0, 0x0, 0x0, 0x0); + SDLTest_AssertCheck(result == 0, "Result should be 0, actual value is %d", result); + + dest_rect.x = 32; + dest_rect.y = 32; + dest_rect.w = surface2->w; + dest_rect.h = surface2->h; + point.x = 0; + point.y = 0; + SDLTest_AssertPass("About to call SDL_RenderCopy(software_renderer, texture, NULL, &{%d, %d, %d, %d})", + dest_rect.x, dest_rect.h, dest_rect.w, dest_rect.h); + result = SDL_RenderCopyEx(software_renderer, texture2, NULL, &dest_rect, 180, &point, SDL_FLIP_NONE); + SDLTest_AssertCheck(result == 0, "Result should be 0, actual value is %d", result); + + SDLTest_AssertPass("About to call SDL_RenderPresent(software_renderer)"); + SDL_RenderPresent(software_renderer); + + pixel = read_surface_pixel32(surface, 0, 0); + SDLTest_AssertCheck(pixel == 0xAABBCCu, "Pixel at (0, 0) should be 0x%08x, actual value is 0x%08" SDL_PRIx32, 0xAABBCCu, pixel); + pixel = read_surface_pixel32(surface, 15, 15); + SDLTest_AssertCheck(pixel == 0xAABBCCu, "Pixel at (15, 15) should be 0x%08x, actual value is 0x%08" SDL_PRIx32, 0xAABBCCu, pixel); + pixel = read_surface_pixel32(surface, 16, 16); + SDLTest_AssertCheck(pixel == 0xFF000000u, "Pixel at (16, 16) should be 0x%08x, actual value is 0x%08" SDL_PRIx32, 0xFF000000u, pixel); + pixel = read_surface_pixel32(surface, 31, 31); + SDLTest_AssertCheck(pixel == 0xFF000000u, "Pixel at (31, 31) should be 0x%08x, actual value is 0x%08" SDL_PRIx32, 0xFF000000u, pixel); + pixel = read_surface_pixel32(surface, 32, 32); + SDLTest_AssertCheck(pixel == 0xAABBCCu, "Pixel at (32, 32) should be 0x%08x, actual value is 0x%08" SDL_PRIx32, 0xAABBCCu, pixel); + + SDL_DestroyTexture(texture2); + SDL_FreeSurface(surface2); + SDL_DestroyRenderer(software_renderer); + SDL_FreeSurface(surface); + return TEST_COMPLETED; +} + +/** + * @brief Tests setting and getting texture scale mode. + * + * \sa + * http://wiki.libsdl.org/SDL2/SDL_SetTextureScaleMode + * http://wiki.libsdl.org/SDL2/SDL_GetTextureScaleMode + */ +int render_testGetSetTextureScaleMode(void *arg) +{ + const struct { + const char *name; + SDL_ScaleMode mode; + } modes[] = { + { "SDL_ScaleModeNearest", SDL_ScaleModeNearest }, + { "SDL_ScaleModeLinear", SDL_ScaleModeLinear }, + { "SDL_ScaleModeBest", SDL_ScaleModeBest } + }; + size_t i; + + for (i = 0; i < SDL_arraysize(modes); i++) { + SDL_Texture *texture; + int result; + SDL_ScaleMode actual_mode = SDL_ScaleModeNearest; + + SDL_ClearError(); + SDLTest_AssertPass("About to call SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 16, 16)"); + texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, 16, 16); + SDLTest_AssertCheck(texture != NULL, "SDL_CreateTexture must return a non-NULL texture"); + SDLTest_AssertPass("About to call SDL_SetTextureScaleMode(texture, %s)", modes[i].name); + result = SDL_SetTextureScaleMode(texture, modes[i].mode); + SDLTest_AssertCheck(result == 0, "SDL_SetTextureScaleMode must return 0, actual %d", result); + SDLTest_AssertPass("About to call SDL_GetTextureScaleMode(texture)"); + result = SDL_GetTextureScaleMode(texture, &actual_mode); + SDLTest_AssertCheck(result == 0, "SDL_SetTextureScaleMode must return 0, actual %d", result); + SDLTest_AssertCheck(actual_mode == modes[i].mode, "SDL_GetTextureScaleMode must return %s (%d), actual=%d", + modes[i].name, modes[i].mode, actual_mode); + } + return TEST_COMPLETED; +} /** * @brief Checks to see if functionality is supported. Helper function. */ static int -_isSupported( int code ) +_isSupported(int code) { - return (code == 0); + return code == 0; } /** @@ -788,34 +958,38 @@ _isSupported( int code ) * http://wiki.libsdl.org/SDL_GetRenderDrawColor */ static int -_hasDrawColor (void) +_hasDrawColor(void) { - int ret, fail; - Uint8 r, g, b, a; - - fail = 0; - - /* Set color. */ - ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100 ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a ); - if (!_isSupported(ret)) - fail = 1; - - /* Restore natural. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); - if (!_isSupported(ret)) - fail = 1; - - /* Something failed, consider not available. */ - if (fail) - return 0; - - /* Not set properly, consider failed. */ - else if ((r != 100) || (g != 100) || (b != 100) || (a != 100)) - return 0; - return 1; + int ret, fail; + Uint8 r, g, b, a; + + fail = 0; + + /* Set color. */ + ret = SDL_SetRenderDrawColor(renderer, 100, 100, 100, 100); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a); + if (!_isSupported(ret)) { + fail = 1; + } + + /* Restore natural. */ + ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); + if (!_isSupported(ret)) { + fail = 1; + } + + /* Something failed, consider not available. */ + if (fail) { + return 0; + } + /* Not set properly, consider failed. */ + else if ((r != 100) || (g != 100) || (b != 100) || (a != 100)) { + return 0; + } + return 1; } /** @@ -826,55 +1000,66 @@ _hasDrawColor (void) * http://wiki.libsdl.org/SDL_GetRenderDrawBlendMode */ static int -_hasBlendModes (void) +_hasBlendModes(void) { - int fail; - int ret; - SDL_BlendMode mode; - - fail = 0; - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_BLEND); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_ADD); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_MOD); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!_isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_NONE); - if (!_isSupported(ret)) - fail = 1; - - return !fail; + int fail; + int ret; + SDL_BlendMode mode; + + fail = 0; + + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawBlendMode(renderer, &mode); + if (!_isSupported(ret)) { + fail = 1; + } + ret = (mode != SDL_BLENDMODE_BLEND); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawBlendMode(renderer, &mode); + if (!_isSupported(ret)) { + fail = 1; + } + ret = (mode != SDL_BLENDMODE_ADD); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawBlendMode(renderer, &mode); + if (!_isSupported(ret)) { + fail = 1; + } + ret = (mode != SDL_BLENDMODE_MOD); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawBlendMode(renderer, &mode); + if (!_isSupported(ret)) { + fail = 1; + } + ret = (mode != SDL_BLENDMODE_NONE); + if (!_isSupported(ret)) { + fail = 1; + } + + return !fail; } - /** * @brief Loads the test image 'Face' as texture. Helper function. * @@ -884,25 +1069,24 @@ _hasBlendModes (void) static SDL_Texture * _loadTestFace(void) { - SDL_Surface *face; - SDL_Texture *tface; + SDL_Surface *face; + SDL_Texture *tface; - face = SDLTest_ImageFace(); - if (face == NULL) { - return NULL; - } + face = SDLTest_ImageFace(); + if (!face) { + return NULL; + } - tface = SDL_CreateTextureFromSurface(renderer, face); - if (tface == NULL) { - SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError()); - } + tface = SDL_CreateTextureFromSurface(renderer, face); + if (!tface) { + SDLTest_LogError("SDL_CreateTextureFromSurface() failed with error: %s", SDL_GetError()); + } - SDL_FreeSurface(face); + SDL_FreeSurface(face); - return tface; + return tface; } - /** * @brief Test to see if can set texture color mode. Helper function. * @@ -912,35 +1096,39 @@ _loadTestFace(void) * http://wiki.libsdl.org/SDL_DestroyTexture */ static int -_hasTexColor (void) +_hasTexColor(void) { - int fail; - int ret; - SDL_Texture *tface; - Uint8 r, g, b; - - /* Get test face. */ - tface = _loadTestFace(); - if (tface == NULL) - return 0; - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureColorMod( tface, 100, 100, 100 ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetTextureColorMod( tface, &r, &g, &b ); - if (!_isSupported(ret)) - fail = 1; - - /* Clean up. */ - SDL_DestroyTexture( tface ); - - if (fail) - return 0; - else if ((r != 100) || (g != 100) || (b != 100)) - return 0; - return 1; + int fail; + int ret; + SDL_Texture *tface; + Uint8 r, g, b; + + /* Get test face. */ + tface = _loadTestFace(); + if (!tface) { + return 0; + } + + /* See if supported. */ + fail = 0; + ret = SDL_SetTextureColorMod(tface, 100, 100, 100); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetTextureColorMod(tface, &r, &g, &b); + if (!_isSupported(ret)) { + fail = 1; + } + + /* Clean up. */ + SDL_DestroyTexture(tface); + + if (fail) { + return 0; + } else if ((r != 100) || (g != 100) || (b != 100)) { + return 0; + } + return 1; } /** @@ -954,39 +1142,43 @@ _hasTexColor (void) static int _hasTexAlpha(void) { - int fail; - int ret; - SDL_Texture *tface; - Uint8 a; - - /* Get test face. */ - tface = _loadTestFace(); - if (tface == NULL) - return 0; - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureAlphaMod( tface, 100 ); - if (!_isSupported(ret)) - fail = 1; - ret = SDL_GetTextureAlphaMod( tface, &a ); - if (!_isSupported(ret)) - fail = 1; - - /* Clean up. */ - SDL_DestroyTexture( tface ); - - if (fail) - return 0; - else if (a != 100) - return 0; - return 1; + int fail; + int ret; + SDL_Texture *tface; + Uint8 a; + + /* Get test face. */ + tface = _loadTestFace(); + if (!tface) { + return 0; + } + + /* See if supported. */ + fail = 0; + ret = SDL_SetTextureAlphaMod(tface, 100); + if (!_isSupported(ret)) { + fail = 1; + } + ret = SDL_GetTextureAlphaMod(tface, &a); + if (!_isSupported(ret)) { + fail = 1; + } + + /* Clean up. */ + SDL_DestroyTexture(tface); + + if (fail) { + return 0; + } else if (a != 100) { + return 0; + } + return 1; } /** * @brief Compares screen pixels with image pixels. Helper function. * - * @param s Image to compare against. + * @param referenceSurface Image to compare against. * * \sa * http://wiki.libsdl.org/SDL_RenderReadPixels @@ -996,36 +1188,38 @@ _hasTexAlpha(void) static void _compare(SDL_Surface *referenceSurface, int allowable_error) { - int result; - SDL_Rect rect; - Uint8 *pixels; - SDL_Surface *testSurface; - - /* Read pixels. */ - pixels = (Uint8 *)SDL_malloc(4*TESTRENDER_SCREEN_W*TESTRENDER_SCREEN_H); - SDLTest_AssertCheck(pixels != NULL, "Validate allocated temp pixel buffer"); - if (pixels == NULL) return; - - /* Explicitly specify the rect in case the window isn't the expected size... */ - rect.x = 0; - rect.y = 0; - rect.w = TESTRENDER_SCREEN_W; - rect.h = TESTRENDER_SCREEN_H; - result = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pixels, 80*4 ); - SDLTest_AssertCheck(result == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", result); - - /* Create surface. */ - testSurface = SDL_CreateRGBSurfaceFrom(pixels, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W*4, - RENDER_COMPARE_RMASK, RENDER_COMPARE_GMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_AMASK); - SDLTest_AssertCheck(testSurface != NULL, "Verify result from SDL_CreateRGBSurfaceFrom is not NULL"); - - /* Compare surface. */ - result = SDLTest_CompareSurfaces( testSurface, referenceSurface, allowable_error ); - SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result); - - /* Clean up. */ - SDL_free(pixels); - SDL_FreeSurface(testSurface); + int result; + SDL_Rect rect; + Uint8 *pixels; + SDL_Surface *testSurface; + + /* Read pixels. */ + pixels = (Uint8 *)SDL_malloc(4 * TESTRENDER_SCREEN_W * TESTRENDER_SCREEN_H); + SDLTest_AssertCheck(pixels != NULL, "Validate allocated temp pixel buffer"); + if (pixels == NULL) { + return; + } + + /* Explicitly specify the rect in case the window isn't the expected size... */ + rect.x = 0; + rect.y = 0; + rect.w = TESTRENDER_SCREEN_W; + rect.h = TESTRENDER_SCREEN_H; + result = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pixels, 80 * 4); + SDLTest_AssertCheck(result == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", result); + + /* Create surface. */ + testSurface = SDL_CreateRGBSurfaceFrom(pixels, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W * 4, + RENDER_COMPARE_RMASK, RENDER_COMPARE_GMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_AMASK); + SDLTest_AssertCheck(testSurface != NULL, "Verify result from SDL_CreateRGBSurfaceFrom is not NULL"); + + /* Compare surface. */ + result = SDLTest_CompareSurfaces(testSurface, referenceSurface, allowable_error); + SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result); + + /* Clean up. */ + SDL_free(pixels); + SDL_FreeSurface(testSurface); } /** @@ -1040,59 +1234,74 @@ _compare(SDL_Surface *referenceSurface, int allowable_error) static int _clearScreen(void) { - int ret; + int ret; - /* Set color. */ - ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); + /* Set color. */ + ret = SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); + SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); - /* Clear screen. */ - ret = SDL_RenderClear(renderer); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderClear, expected: 0, got: %i", ret); + /* Clear screen. */ + ret = SDL_RenderClear(renderer); + SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderClear, expected: 0, got: %i", ret); - /* Make current */ - SDL_RenderPresent(renderer); + /* Make current */ + SDL_RenderPresent(renderer); - /* Set defaults. */ - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret); + /* Set defaults. */ + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawBlendMode, expected: 0, got: %i", ret); - ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); + ret = SDL_SetRenderDrawColor(renderer, 255, 255, 255, SDL_ALPHA_OPAQUE); + SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret); - return 0; + return 0; } /* ================= Test References ================== */ /* Render test cases */ -static const SDLTest_TestCaseReference renderTest1 = - { (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED }; +static const SDLTest_TestCaseReference renderTest1 = { + (SDLTest_TestCaseFp)render_testGetNumRenderDrivers, "render_testGetNumRenderDrivers", "Tests call to SDL_GetNumRenderDrivers", TEST_ENABLED +}; -static const SDLTest_TestCaseReference renderTest2 = - { (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED }; +static const SDLTest_TestCaseReference renderTest2 = { + (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference renderTest3 = - { (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_DISABLED }; +static const SDLTest_TestCaseReference renderTest3 = { + (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_DISABLED +}; -static const SDLTest_TestCaseReference renderTest4 = - { (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED }; +static const SDLTest_TestCaseReference renderTest4 = { + (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED +}; -static const SDLTest_TestCaseReference renderTest5 = - { (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED }; +static const SDLTest_TestCaseReference renderTest5 = { + (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference renderTest6 = - { (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_DISABLED }; +static const SDLTest_TestCaseReference renderTest6 = { + (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_DISABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference renderTest7 = - { (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_DISABLED }; +static const SDLTest_TestCaseReference renderTest7 = { + (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_DISABLED +}; + +static const SDLTest_TestCaseReference renderTest8 = { + (SDLTest_TestCaseFp)render_testGetSetTextureScaleMode, "render_testGetSetTextureScaleMode", "Tests setting/getting texture scale mode", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference renderTest9 = { + (SDLTest_TestCaseFp)render_testRGBSurfaceNoAlpha, "render_testRGBSurfaceNoAlpha", "Tests RGB surface with no alpha using software renderer", TEST_ENABLED +}; /* Sequence of Render test cases */ -static const SDLTest_TestCaseReference *renderTests[] = { - &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL +static const SDLTest_TestCaseReference *renderTests[] = { + &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, &renderTest8, &renderTest9, NULL }; /* Render test suite (global) */ diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c index 687ff75de8cb5..441ba73b3ddda 100644 --- a/test/testautomation_rwops.c +++ b/test/testautomation_rwops.c @@ -11,7 +11,7 @@ /* quiet windows compiler warnings */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -# define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS #endif #include @@ -21,9 +21,9 @@ /* ================= Test Case Implementation ================== */ -const char* RWopsReadTestFilename = "rwops_read"; -const char* RWopsWriteTestFilename = "rwops_write"; -const char* RWopsAlphabetFilename = "rwops_alphabet"; +const char *RWopsReadTestFilename = "rwops_read"; +const char *RWopsWriteTestFilename = "rwops_write"; +const char *RWopsAlphabetFilename = "rwops_alphabet"; static const char RWopsHelloWorldTestString[] = "Hello World!"; static const char RWopsHelloWorldCompString[] = "Hello World!"; @@ -31,8 +31,7 @@ static const char RWopsAlphabetString[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; /* Fixture */ -void -RWopsSetUp(void *arg) +void RWopsSetUp(void *arg) { size_t fileLen; FILE *handle; @@ -40,46 +39,49 @@ RWopsSetUp(void *arg) int result; /* Clean up from previous runs (if any); ignore errors */ - remove(RWopsReadTestFilename); - remove(RWopsWriteTestFilename); - remove(RWopsAlphabetFilename); + (void)remove(RWopsReadTestFilename); + (void)remove(RWopsWriteTestFilename); + (void)remove(RWopsAlphabetFilename); /* Create a test file */ handle = fopen(RWopsReadTestFilename, "w"); SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsReadTestFilename); - if (handle == NULL) return; + if (handle == NULL) { + return; + } /* Write some known text into it */ fileLen = SDL_strlen(RWopsHelloWorldTestString); writtenLen = fwrite(RWopsHelloWorldTestString, 1, fileLen, handle); - SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", (int) fileLen, (int) writtenLen); + SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", (int)fileLen, (int)writtenLen); result = fclose(handle); SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); /* Create a second test file */ handle = fopen(RWopsAlphabetFilename, "w"); SDLTest_AssertCheck(handle != NULL, "Verify creation of file '%s' returned non NULL handle", RWopsAlphabetFilename); - if (handle == NULL) return; + if (handle == NULL) { + return; + } /* Write alphabet text into it */ fileLen = SDL_strlen(RWopsAlphabetString); writtenLen = fwrite(RWopsAlphabetString, 1, fileLen, handle); - SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", (int) fileLen, (int) writtenLen); + SDLTest_AssertCheck(fileLen == writtenLen, "Verify number of written bytes, expected %i, got %i", (int)fileLen, (int)writtenLen); result = fclose(handle); SDLTest_AssertCheck(result == 0, "Verify result from fclose, expected 0, got %i", result); SDLTest_AssertPass("Creation of test file completed"); } -void -RWopsTearDown(void *arg) +void RWopsTearDown(void *arg) { int result; /* Remove the created files to clean up; ignore errors for write filename */ result = remove(RWopsReadTestFilename); SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsReadTestFilename, result); - remove(RWopsWriteTestFilename); + (void)remove(RWopsWriteTestFilename); result = remove(RWopsAlphabetFilename); SDLTest_AssertCheck(result == 0, "Verify result from remove(%s), expected 0, got %i", RWopsAlphabetFilename, result); @@ -93,78 +95,76 @@ RWopsTearDown(void *arg) * http://wiki.libsdl.org/SDL_RWseek * http://wiki.libsdl.org/SDL_RWread */ -void -_testGenericRWopsValidations(SDL_RWops *rw, int write) +void _testGenericRWopsValidations(SDL_RWops *rw, int write) { - char buf[sizeof(RWopsHelloWorldTestString)]; - Sint64 i; - size_t s; - int seekPos = SDLTest_RandomIntegerInRange(4, 8); - - /* Clear buffer */ - SDL_zeroa(buf); - - /* Set to start. */ - i = SDL_RWseek(rw, 0, RW_SEEK_SET ); - SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %"SDL_PRIs64, i); - - /* Test write. */ - s = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1); - SDLTest_AssertPass("Call to SDL_RWwrite succeeded"); - if (write) { - SDLTest_AssertCheck(s == (size_t)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", (int) s); - } - else { - SDLTest_AssertCheck(s == (size_t)0, "Verify result of writing with SDL_RWwrite, expected: 0, got %i", (int) s); - } - - /* Test seek to random position */ - i = SDL_RWseek( rw, seekPos, RW_SEEK_SET ); - SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %"SDL_PRIs64, seekPos, seekPos, i); - - /* Test seek back to start */ - i = SDL_RWseek(rw, 0, RW_SEEK_SET ); - SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %"SDL_PRIs64, i); - - /* Test read */ - s = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 ); - SDLTest_AssertPass("Call to SDL_RWread succeeded"); - SDLTest_AssertCheck( - s == (size_t)(sizeof(RWopsHelloWorldTestString)-1), - "Verify result from SDL_RWread, expected %i, got %i", - (int) (sizeof(RWopsHelloWorldTestString)-1), - (int) s); - SDLTest_AssertCheck( - SDL_memcmp(buf, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1 ) == 0, - "Verify read bytes match expected string, expected '%s', got '%s'", RWopsHelloWorldTestString, buf); - - /* More seek tests. */ - i = SDL_RWseek( rw, -4, RW_SEEK_CUR ); - SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded"); - SDLTest_AssertCheck( - i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), - "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i", - (int) (sizeof(RWopsHelloWorldTestString)-5), - (int) i); - - i = SDL_RWseek( rw, -1, RW_SEEK_END ); - SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded"); - SDLTest_AssertCheck( - i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), - "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i", - (int) (sizeof(RWopsHelloWorldTestString)-2), - (int) i); - - /* Invalid whence seek */ - i = SDL_RWseek( rw, 0, 999 ); - SDLTest_AssertPass("Call to SDL_RWseek(...,0,invalid_whence) succeeded"); - SDLTest_AssertCheck( - i == (Sint64)(-1), - "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %i", - (int) i); + char buf[sizeof(RWopsHelloWorldTestString)]; + Sint64 i; + size_t s; + int seekPos = SDLTest_RandomIntegerInRange(4, 8); + + /* Clear buffer */ + SDL_zeroa(buf); + + /* Set to start. */ + i = SDL_RWseek(rw, 0, RW_SEEK_SET); + SDLTest_AssertPass("Call to SDL_RWseek succeeded"); + SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %" SDL_PRIs64, i); + + /* Test write. */ + s = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString) - 1, 1); + SDLTest_AssertPass("Call to SDL_RWwrite succeeded"); + if (write) { + SDLTest_AssertCheck(s == (size_t)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", (int)s); + } else { + SDLTest_AssertCheck(s == (size_t)0, "Verify result of writing with SDL_RWwrite, expected: 0, got %i", (int)s); + } + + /* Test seek to random position */ + i = SDL_RWseek(rw, seekPos, RW_SEEK_SET); + SDLTest_AssertPass("Call to SDL_RWseek succeeded"); + SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %" SDL_PRIs64, seekPos, seekPos, i); + + /* Test seek back to start */ + i = SDL_RWseek(rw, 0, RW_SEEK_SET); + SDLTest_AssertPass("Call to SDL_RWseek succeeded"); + SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %" SDL_PRIs64, i); + + /* Test read */ + s = SDL_RWread(rw, buf, 1, sizeof(RWopsHelloWorldTestString) - 1); + SDLTest_AssertPass("Call to SDL_RWread succeeded"); + SDLTest_AssertCheck( + s == (size_t)(sizeof(RWopsHelloWorldTestString) - 1), + "Verify result from SDL_RWread, expected %i, got %i", + (int)(sizeof(RWopsHelloWorldTestString) - 1), + (int)s); + SDLTest_AssertCheck( + SDL_memcmp(buf, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString) - 1) == 0, + "Verify read bytes match expected string, expected '%s', got '%s'", RWopsHelloWorldTestString, buf); + + /* More seek tests. */ + i = SDL_RWseek(rw, -4, RW_SEEK_CUR); + SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded"); + SDLTest_AssertCheck( + i == (Sint64)(sizeof(RWopsHelloWorldTestString) - 5), + "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i", + (int)(sizeof(RWopsHelloWorldTestString) - 5), + (int)i); + + i = SDL_RWseek(rw, -1, RW_SEEK_END); + SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded"); + SDLTest_AssertCheck( + i == (Sint64)(sizeof(RWopsHelloWorldTestString) - 2), + "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i", + (int)(sizeof(RWopsHelloWorldTestString) - 2), + (int)i); + + /* Invalid whence seek */ + i = SDL_RWseek(rw, 0, 999); + SDLTest_AssertPass("Call to SDL_RWseek(...,0,invalid_whence) succeeded"); + SDLTest_AssertCheck( + i == (Sint64)(-1), + "Verify seek with SDL_RWseek (invalid_whence); expected: -1, got %i", + (int)i); } /* ! @@ -173,45 +173,44 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write) * \sa http://wiki.libsdl.org/SDL_RWFromFile * */ -int -rwops_testParamNegative (void) +int rwops_testParamNegative(void) { - SDL_RWops *rwops; + SDL_RWops *rwops; - /* These should all fail. */ - rwops = SDL_RWFromFile(NULL, NULL); - SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, NULL) succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, NULL) returns NULL"); + /* These should all fail. */ + rwops = SDL_RWFromFile(NULL, NULL); + SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, NULL) succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, NULL) returns NULL"); - rwops = SDL_RWFromFile(NULL, "ab+"); - SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, \"ab+\") succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, \"ab+\") returns NULL"); + rwops = SDL_RWFromFile(NULL, "ab+"); + SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, \"ab+\") succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, \"ab+\") returns NULL"); - rwops = SDL_RWFromFile(NULL, "sldfkjsldkfj"); - SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, \"sldfkjsldkfj\") succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, \"sldfkjsldkfj\") returns NULL"); + rwops = SDL_RWFromFile(NULL, "sldfkjsldkfj"); + SDLTest_AssertPass("Call to SDL_RWFromFile(NULL, \"sldfkjsldkfj\") succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(NULL, \"sldfkjsldkfj\") returns NULL"); - rwops = SDL_RWFromFile("something", ""); - SDLTest_AssertPass("Call to SDL_RWFromFile(\"something\", \"\") succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(\"something\", \"\") returns NULL"); + rwops = SDL_RWFromFile("something", ""); + SDLTest_AssertPass("Call to SDL_RWFromFile(\"something\", \"\") succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(\"something\", \"\") returns NULL"); - rwops = SDL_RWFromFile("something", NULL); - SDLTest_AssertPass("Call to SDL_RWFromFile(\"something\", NULL) succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(\"something\", NULL) returns NULL"); + rwops = SDL_RWFromFile("something", NULL); + SDLTest_AssertPass("Call to SDL_RWFromFile(\"something\", NULL) succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromFile(\"something\", NULL) returns NULL"); - rwops = SDL_RWFromMem((void *)NULL, 10); - SDLTest_AssertPass("Call to SDL_RWFromMem(NULL, 10) succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromMem(NULL, 10) returns NULL"); + rwops = SDL_RWFromMem(NULL, 10); + SDLTest_AssertPass("Call to SDL_RWFromMem(NULL, 10) succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromMem(NULL, 10) returns NULL"); - rwops = SDL_RWFromMem((void *)RWopsAlphabetString, 0); - SDLTest_AssertPass("Call to SDL_RWFromMem(data, 0) succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromMem(data, 0) returns NULL"); + rwops = SDL_RWFromMem((void *)RWopsAlphabetString, 0); + SDLTest_AssertPass("Call to SDL_RWFromMem(data, 0) succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromMem(data, 0) returns NULL"); - rwops = SDL_RWFromConstMem((const void *)RWopsAlphabetString, 0); - SDLTest_AssertPass("Call to SDL_RWFromConstMem(data, 0) succeeded"); - SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromConstMem(data, 0) returns NULL"); + rwops = SDL_RWFromConstMem((const void *)RWopsAlphabetString, 0); + SDLTest_AssertPass("Call to SDL_RWFromConstMem(data, 0) succeeded"); + SDLTest_AssertCheck(rwops == NULL, "Verify SDL_RWFromConstMem(data, 0) returns NULL"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -220,39 +219,39 @@ rwops_testParamNegative (void) * \sa http://wiki.libsdl.org/SDL_RWFromMem * \sa http://wiki.libsdl.org/SDL_RWClose */ -int -rwops_testMem (void) +int rwops_testMem(void) { - char mem[sizeof(RWopsHelloWorldTestString)]; - SDL_RWops *rw; - int result; + char mem[sizeof(RWopsHelloWorldTestString)]; + SDL_RWops *rw; + int result; - /* Clear buffer */ - SDL_zeroa(mem); + /* Clear buffer */ + SDL_zeroa(mem); - /* Open */ - rw = SDL_RWFromMem(mem, sizeof(RWopsHelloWorldTestString)-1); - SDLTest_AssertPass("Call to SDL_RWFromMem() succeeded"); - SDLTest_AssertCheck(rw != NULL, "Verify opening memory with SDL_RWFromMem does not return NULL"); + /* Open */ + rw = SDL_RWFromMem(mem, sizeof(RWopsHelloWorldTestString) - 1); + SDLTest_AssertPass("Call to SDL_RWFromMem() succeeded"); + SDLTest_AssertCheck(rw != NULL, "Verify opening memory with SDL_RWFromMem does not return NULL"); - /* Bail out if NULL */ - if (rw == NULL) return TEST_ABORTED; + /* Bail out if NULL */ + if (rw == NULL) { + return TEST_ABORTED; + } - /* Check type */ - SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY, rw->type); + /* Check type */ + SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY, rw->type); - /* Run generic tests */ - _testGenericRWopsValidations(rw, 1); + /* Run generic tests */ + _testGenericRWopsValidations(rw, 1); - /* Close */ - result = SDL_RWclose(rw); - SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + /* Close */ + result = SDL_RWclose(rw); + SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests opening from memory. * @@ -260,35 +259,35 @@ rwops_testMem (void) * http://wiki.libsdl.org/SDL_RWFromConstMem * http://wiki.libsdl.org/SDL_RWClose */ -int -rwops_testConstMem (void) +int rwops_testConstMem(void) { - SDL_RWops *rw; - int result; + SDL_RWops *rw; + int result; - /* Open handle */ - rw = SDL_RWFromConstMem( RWopsHelloWorldCompString, sizeof(RWopsHelloWorldCompString)-1 ); - SDLTest_AssertPass("Call to SDL_RWFromConstMem() succeeded"); - SDLTest_AssertCheck(rw != NULL, "Verify opening memory with SDL_RWFromConstMem does not return NULL"); + /* Open handle */ + rw = SDL_RWFromConstMem(RWopsHelloWorldCompString, sizeof(RWopsHelloWorldCompString) - 1); + SDLTest_AssertPass("Call to SDL_RWFromConstMem() succeeded"); + SDLTest_AssertCheck(rw != NULL, "Verify opening memory with SDL_RWFromConstMem does not return NULL"); - /* Bail out if NULL */ - if (rw == NULL) return TEST_ABORTED; + /* Bail out if NULL */ + if (rw == NULL) { + return TEST_ABORTED; + } - /* Check type */ - SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY_RO, rw->type); + /* Check type */ + SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY_RO, rw->type); - /* Run generic tests */ - _testGenericRWopsValidations( rw, 0 ); + /* Run generic tests */ + _testGenericRWopsValidations(rw, 0); - /* Close handle */ - result = SDL_RWclose(rw); - SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + /* Close handle */ + result = SDL_RWclose(rw); + SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests reading from file. * @@ -296,44 +295,45 @@ rwops_testConstMem (void) * http://wiki.libsdl.org/SDL_RWFromFile * http://wiki.libsdl.org/SDL_RWClose */ -int -rwops_testFileRead(void) +int rwops_testFileRead(void) { - SDL_RWops *rw; - int result; + SDL_RWops *rw; + int result; - /* Read test. */ - rw = SDL_RWFromFile(RWopsReadTestFilename, "r"); - SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"r\") succeeded"); - SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in read mode does not return NULL"); + /* Read test. */ + rw = SDL_RWFromFile(RWopsReadTestFilename, "r"); + SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"r\") succeeded"); + SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in read mode does not return NULL"); - /* Bail out if NULL */ - if (rw == NULL) return TEST_ABORTED; + /* Bail out if NULL */ + if (rw == NULL) { + return TEST_ABORTED; + } - /* Check type */ + /* Check type */ #if defined(__ANDROID__) - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, - "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, + "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); #elif defined(__WIN32__) - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_WINFILE, - "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_WINFILE, + "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); #else - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, - "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_STDFILE, + "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type); #endif - /* Run generic tests */ - _testGenericRWopsValidations( rw, 0 ); + /* Run generic tests */ + _testGenericRWopsValidations(rw, 0); - /* Close handle */ - result = SDL_RWclose(rw); - SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + /* Close handle */ + result = SDL_RWclose(rw); + SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -343,47 +343,47 @@ rwops_testFileRead(void) * http://wiki.libsdl.org/SDL_RWFromFile * http://wiki.libsdl.org/SDL_RWClose */ -int -rwops_testFileWrite(void) +int rwops_testFileWrite(void) { - SDL_RWops *rw; - int result; + SDL_RWops *rw; + int result; - /* Write test. */ - rw = SDL_RWFromFile(RWopsWriteTestFilename, "w+"); - SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\") succeeded"); - SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); + /* Write test. */ + rw = SDL_RWFromFile(RWopsWriteTestFilename, "w+"); + SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\") succeeded"); + SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); - /* Bail out if NULL */ - if (rw == NULL) return TEST_ABORTED; + /* Bail out if NULL */ + if (rw == NULL) { + return TEST_ABORTED; + } - /* Check type */ + /* Check type */ #if defined(__ANDROID__) - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, - "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, + "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); #elif defined(__WIN32__) - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_WINFILE, - "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_WINFILE, + "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type); #else - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_STDFILE, - "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type); + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_STDFILE, + "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type); #endif - /* Run generic tests */ - _testGenericRWopsValidations( rw, 1 ); + /* Run generic tests */ + _testGenericRWopsValidations(rw, 1); - /* Close handle */ - result = SDL_RWclose(rw); - SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + /* Close handle */ + result = SDL_RWclose(rw); + SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests reading from file handle * @@ -495,25 +495,26 @@ rwops_testFPWrite(void) * \sa http://wiki.libsdl.org/SDL_AllocRW * \sa http://wiki.libsdl.org/SDL_FreeRW */ -int -rwops_testAllocFree (void) +int rwops_testAllocFree(void) { - /* Allocate context */ - SDL_RWops *rw = SDL_AllocRW(); - SDLTest_AssertPass("Call to SDL_AllocRW() succeeded"); - SDLTest_AssertCheck(rw != NULL, "Validate result from SDL_AllocRW() is not NULL"); - if (rw==NULL) return TEST_ABORTED; - - /* Check type */ - SDLTest_AssertCheck( - rw->type == SDL_RWOPS_UNKNOWN, - "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_UNKNOWN, rw->type); - - /* Free context again */ - SDL_FreeRW(rw); - SDLTest_AssertPass("Call to SDL_FreeRW() succeeded"); - - return TEST_COMPLETED; + /* Allocate context */ + SDL_RWops *rw = SDL_AllocRW(); + SDLTest_AssertPass("Call to SDL_AllocRW() succeeded"); + SDLTest_AssertCheck(rw != NULL, "Validate result from SDL_AllocRW() is not NULL"); + if (rw == NULL) { + return TEST_ABORTED; + } + + /* Check type */ + SDLTest_AssertCheck( + rw->type == SDL_RWOPS_UNKNOWN, + "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_UNKNOWN, rw->type); + + /* Free context again */ + SDL_FreeRW(rw); + SDLTest_AssertPass("Call to SDL_FreeRW() succeeded"); + + return TEST_COMPLETED; } /** @@ -522,64 +523,61 @@ rwops_testAllocFree (void) * \sa http://wiki.libsdl.org/SDL_RWFromMem * \sa http://wiki.libsdl.org/SDL_RWFromFile */ -int -rwops_testCompareRWFromMemWithRWFromFile(void) +int rwops_testCompareRWFromMemWithRWFromFile(void) { - int slen = 26; - char buffer_file[27]; - char buffer_mem[27]; - size_t rv_file; - size_t rv_mem; - Uint64 sv_file; - Uint64 sv_mem; - SDL_RWops* rwops_file; - SDL_RWops* rwops_mem; - int size; - int result; - - - for (size=5; size<10; size++) - { - /* Terminate buffer */ - buffer_file[slen] = 0; - buffer_mem[slen] = 0; - - /* Read/seek from memory */ - rwops_mem = SDL_RWFromMem((void *)RWopsAlphabetString, slen); - SDLTest_AssertPass("Call to SDL_RWFromMem()"); - rv_mem = SDL_RWread(rwops_mem, buffer_mem, size, 6); - SDLTest_AssertPass("Call to SDL_RWread(mem, size=%d)", size); - sv_mem = SDL_RWseek(rwops_mem, 0, SEEK_END); - SDLTest_AssertPass("Call to SDL_RWseek(mem,SEEK_END)"); - result = SDL_RWclose(rwops_mem); - SDLTest_AssertPass("Call to SDL_RWclose(mem)"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - - /* Read/see from file */ - rwops_file = SDL_RWFromFile(RWopsAlphabetFilename, "r"); - SDLTest_AssertPass("Call to SDL_RWFromFile()"); - rv_file = SDL_RWread(rwops_file, buffer_file, size, 6); - SDLTest_AssertPass("Call to SDL_RWread(file, size=%d)", size); - sv_file = SDL_RWseek(rwops_file, 0, SEEK_END); - SDLTest_AssertPass("Call to SDL_RWseek(file,SEEK_END)"); - result = SDL_RWclose(rwops_file); - SDLTest_AssertPass("Call to SDL_RWclose(file)"); - SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); - - /* Compare */ - SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", (int) rv_mem, (int) rv_file); - SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%d sv_file=%d", (int) sv_mem, (int) sv_file); - SDLTest_AssertCheck(buffer_mem[slen] == 0, "Verify mem buffer termination; expected: 0, got: %d", buffer_mem[slen]); - SDLTest_AssertCheck(buffer_file[slen] == 0, "Verify file buffer termination; expected: 0, got: %d", buffer_file[slen]); - SDLTest_AssertCheck( - SDL_strncmp(buffer_mem, RWopsAlphabetString, slen) == 0, - "Verify mem buffer contain alphabet string; expected: %s, got: %s", RWopsAlphabetString, buffer_mem); - SDLTest_AssertCheck( - SDL_strncmp(buffer_file, RWopsAlphabetString, slen) == 0, - "Verify file buffer contain alphabet string; expected: %s, got: %s", RWopsAlphabetString, buffer_file); - } + int slen = 26; + char buffer_file[27]; + char buffer_mem[27]; + size_t rv_file; + size_t rv_mem; + Uint64 sv_file; + Uint64 sv_mem; + SDL_RWops *rwops_file; + SDL_RWops *rwops_mem; + int size; + int result; - return TEST_COMPLETED; + for (size = 5; size < 10; size++) { + /* Terminate buffer */ + buffer_file[slen] = 0; + buffer_mem[slen] = 0; + + /* Read/seek from memory */ + rwops_mem = SDL_RWFromMem((void *)RWopsAlphabetString, slen); + SDLTest_AssertPass("Call to SDL_RWFromMem()"); + rv_mem = SDL_RWread(rwops_mem, buffer_mem, size, 6); + SDLTest_AssertPass("Call to SDL_RWread(mem, size=%d)", size); + sv_mem = SDL_RWseek(rwops_mem, 0, SEEK_END); + SDLTest_AssertPass("Call to SDL_RWseek(mem,SEEK_END)"); + result = SDL_RWclose(rwops_mem); + SDLTest_AssertPass("Call to SDL_RWclose(mem)"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + + /* Read/see from file */ + rwops_file = SDL_RWFromFile(RWopsAlphabetFilename, "r"); + SDLTest_AssertPass("Call to SDL_RWFromFile()"); + rv_file = SDL_RWread(rwops_file, buffer_file, size, 6); + SDLTest_AssertPass("Call to SDL_RWread(file, size=%d)", size); + sv_file = SDL_RWseek(rwops_file, 0, SEEK_END); + SDLTest_AssertPass("Call to SDL_RWseek(file,SEEK_END)"); + result = SDL_RWclose(rwops_file); + SDLTest_AssertPass("Call to SDL_RWclose(file)"); + SDLTest_AssertCheck(result == 0, "Verify result value is 0; got: %d", result); + + /* Compare */ + SDLTest_AssertCheck(rv_mem == rv_file, "Verify returned read blocks matches for mem and file reads; got: rv_mem=%d rv_file=%d", (int)rv_mem, (int)rv_file); + SDLTest_AssertCheck(sv_mem == sv_file, "Verify SEEK_END position matches for mem and file seeks; got: sv_mem=%d sv_file=%d", (int)sv_mem, (int)sv_file); + SDLTest_AssertCheck(buffer_mem[slen] == 0, "Verify mem buffer termination; expected: 0, got: %d", buffer_mem[slen]); + SDLTest_AssertCheck(buffer_file[slen] == 0, "Verify file buffer termination; expected: 0, got: %d", buffer_file[slen]); + SDLTest_AssertCheck( + SDL_strncmp(buffer_mem, RWopsAlphabetString, slen) == 0, + "Verify mem buffer contain alphabet string; expected: %s, got: %s", RWopsAlphabetString, buffer_mem); + SDLTest_AssertCheck( + SDL_strncmp(buffer_file, RWopsAlphabetString, slen) == 0, + "Verify file buffer contain alphabet string; expected: %s, got: %s", RWopsAlphabetString, buffer_file); + } + + return TEST_COMPLETED; } /** @@ -591,141 +589,146 @@ rwops_testCompareRWFromMemWithRWFromFile(void) * http://wiki.libsdl.org/SDL_ReadBE16 * http://wiki.libsdl.org/SDL_WriteBE16 */ -int -rwops_testFileWriteReadEndian(void) +int rwops_testFileWriteReadEndian(void) { - SDL_RWops *rw; - Sint64 result; - int mode; - size_t objectsWritten; - Uint16 BE16value; - Uint32 BE32value; - Uint64 BE64value; - Uint16 LE16value; - Uint32 LE32value; - Uint64 LE64value; - Uint16 BE16test; - Uint32 BE32test; - Uint64 BE64test; - Uint16 LE16test; - Uint32 LE32test; - Uint64 LE64test; - int cresult; - - for (mode = 0; mode < 3; mode++) { - - /* Create test data */ - switch (mode) { - default: - case 0: - SDLTest_Log("All 0 values"); - BE16value = 0; - BE32value = 0; - BE64value = 0; - LE16value = 0; - LE32value = 0; - LE64value = 0; - break; - case 1: - SDLTest_Log("All 1 values"); - BE16value = 1; - BE32value = 1; - BE64value = 1; - LE16value = 1; - LE32value = 1; - LE64value = 1; - break; - case 2: - SDLTest_Log("Random values"); - BE16value = SDLTest_RandomUint16(); - BE32value = SDLTest_RandomUint32(); - BE64value = SDLTest_RandomUint64(); - LE16value = SDLTest_RandomUint16(); - LE32value = SDLTest_RandomUint32(); - LE64value = SDLTest_RandomUint64(); - break; - } - - /* Write test. */ - rw = SDL_RWFromFile(RWopsWriteTestFilename, "w+"); - SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\")"); - SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); - - /* Bail out if NULL */ - if (rw == NULL) return TEST_ABORTED; - - /* Write test data */ - objectsWritten = SDL_WriteBE16(rw, BE16value); - SDLTest_AssertPass("Call to SDL_WriteBE16()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - objectsWritten = SDL_WriteBE32(rw, BE32value); - SDLTest_AssertPass("Call to SDL_WriteBE32()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - objectsWritten = SDL_WriteBE64(rw, BE64value); - SDLTest_AssertPass("Call to SDL_WriteBE64()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - objectsWritten = SDL_WriteLE16(rw, LE16value); - SDLTest_AssertPass("Call to SDL_WriteLE16()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - objectsWritten = SDL_WriteLE32(rw, LE32value); - SDLTest_AssertPass("Call to SDL_WriteLE32()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - objectsWritten = SDL_WriteLE64(rw, LE64value); - SDLTest_AssertPass("Call to SDL_WriteLE64()"); - SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int) objectsWritten); - - /* Test seek to start */ - result = SDL_RWseek( rw, 0, RW_SEEK_SET ); - SDLTest_AssertPass("Call to SDL_RWseek succeeded"); - SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %i", (int) result); - - /* Read test data */ - BE16test = SDL_ReadBE16(rw); - SDLTest_AssertPass("Call to SDL_ReadBE16()"); - SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test); - BE32test = SDL_ReadBE32(rw); - SDLTest_AssertPass("Call to SDL_ReadBE32()"); - SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, BE32value, BE32test); - BE64test = SDL_ReadBE64(rw); - SDLTest_AssertPass("Call to SDL_ReadBE64()"); - SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, BE64value, BE64test); - LE16test = SDL_ReadLE16(rw); - SDLTest_AssertPass("Call to SDL_ReadLE16()"); - SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test); - LE32test = SDL_ReadLE32(rw); - SDLTest_AssertPass("Call to SDL_ReadLE32()"); - SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, LE32value, LE32test); - LE64test = SDL_ReadLE64(rw); - SDLTest_AssertPass("Call to SDL_ReadLE64()"); - SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, LE64value, LE64test); - - /* Close handle */ - cresult = SDL_RWclose(rw); - SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); - SDLTest_AssertCheck(cresult == 0, "Verify result value is 0; got: %d", cresult); - } - - return TEST_COMPLETED; + SDL_RWops *rw; + Sint64 result; + int mode; + size_t objectsWritten; + Uint16 BE16value; + Uint32 BE32value; + Uint64 BE64value; + Uint16 LE16value; + Uint32 LE32value; + Uint64 LE64value; + Uint16 BE16test; + Uint32 BE32test; + Uint64 BE64test; + Uint16 LE16test; + Uint32 LE32test; + Uint64 LE64test; + int cresult; + + for (mode = 0; mode < 3; mode++) { + + /* Create test data */ + switch (mode) { + default: + case 0: + SDLTest_Log("All 0 values"); + BE16value = 0; + BE32value = 0; + BE64value = 0; + LE16value = 0; + LE32value = 0; + LE64value = 0; + break; + case 1: + SDLTest_Log("All 1 values"); + BE16value = 1; + BE32value = 1; + BE64value = 1; + LE16value = 1; + LE32value = 1; + LE64value = 1; + break; + case 2: + SDLTest_Log("Random values"); + BE16value = SDLTest_RandomUint16(); + BE32value = SDLTest_RandomUint32(); + BE64value = SDLTest_RandomUint64(); + LE16value = SDLTest_RandomUint16(); + LE32value = SDLTest_RandomUint32(); + LE64value = SDLTest_RandomUint64(); + break; + } + + /* Write test. */ + rw = SDL_RWFromFile(RWopsWriteTestFilename, "w+"); + SDLTest_AssertPass("Call to SDL_RWFromFile(..,\"w+\")"); + SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFile in write mode does not return NULL"); + + /* Bail out if NULL */ + if (rw == NULL) { + return TEST_ABORTED; + } + + /* Write test data */ + objectsWritten = SDL_WriteBE16(rw, BE16value); + SDLTest_AssertPass("Call to SDL_WriteBE16()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + objectsWritten = SDL_WriteBE32(rw, BE32value); + SDLTest_AssertPass("Call to SDL_WriteBE32()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + objectsWritten = SDL_WriteBE64(rw, BE64value); + SDLTest_AssertPass("Call to SDL_WriteBE64()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + objectsWritten = SDL_WriteLE16(rw, LE16value); + SDLTest_AssertPass("Call to SDL_WriteLE16()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + objectsWritten = SDL_WriteLE32(rw, LE32value); + SDLTest_AssertPass("Call to SDL_WriteLE32()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + objectsWritten = SDL_WriteLE64(rw, LE64value); + SDLTest_AssertPass("Call to SDL_WriteLE64()"); + SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", (int)objectsWritten); + + /* Test seek to start */ + result = SDL_RWseek(rw, 0, RW_SEEK_SET); + SDLTest_AssertPass("Call to SDL_RWseek succeeded"); + SDLTest_AssertCheck(result == 0, "Verify result from position 0 with SDL_RWseek, expected 0, got %i", (int)result); + + /* Read test data */ + BE16test = SDL_ReadBE16(rw); + SDLTest_AssertPass("Call to SDL_ReadBE16()"); + SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test); + BE32test = SDL_ReadBE32(rw); + SDLTest_AssertPass("Call to SDL_ReadBE32()"); + SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, BE32value, BE32test); + BE64test = SDL_ReadBE64(rw); + SDLTest_AssertPass("Call to SDL_ReadBE64()"); + SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %" SDL_PRIu64 ", got: %" SDL_PRIu64, BE64value, BE64test); + LE16test = SDL_ReadLE16(rw); + SDLTest_AssertPass("Call to SDL_ReadLE16()"); + SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test); + LE32test = SDL_ReadLE32(rw); + SDLTest_AssertPass("Call to SDL_ReadLE32()"); + SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, LE32value, LE32test); + LE64test = SDL_ReadLE64(rw); + SDLTest_AssertPass("Call to SDL_ReadLE64()"); + SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %" SDL_PRIu64 ", got: %" SDL_PRIu64, LE64value, LE64test); + + /* Close handle */ + cresult = SDL_RWclose(rw); + SDLTest_AssertPass("Call to SDL_RWclose() succeeded"); + SDLTest_AssertCheck(cresult == 0, "Verify result value is 0; got: %d", cresult); + } + + return TEST_COMPLETED; } - /* ================= Test References ================== */ /* RWops test cases */ -static const SDLTest_TestCaseReference rwopsTest1 = - { (SDLTest_TestCaseFp)rwops_testParamNegative, "rwops_testParamNegative", "Negative test for SDL_RWFromFile parameters", TEST_ENABLED }; +static const SDLTest_TestCaseReference rwopsTest1 = { + (SDLTest_TestCaseFp)rwops_testParamNegative, "rwops_testParamNegative", "Negative test for SDL_RWFromFile parameters", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rwopsTest2 = - { (SDLTest_TestCaseFp)rwops_testMem, "rwops_testMem", "Tests opening from memory", TEST_ENABLED }; +static const SDLTest_TestCaseReference rwopsTest2 = { + (SDLTest_TestCaseFp)rwops_testMem, "rwops_testMem", "Tests opening from memory", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rwopsTest3 = - { (SDLTest_TestCaseFp)rwops_testConstMem, "rwops_testConstMem", "Tests opening from (const) memory", TEST_ENABLED }; +static const SDLTest_TestCaseReference rwopsTest3 = { + (SDLTest_TestCaseFp)rwops_testConstMem, "rwops_testConstMem", "Tests opening from (const) memory", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rwopsTest4 = - { (SDLTest_TestCaseFp)rwops_testFileRead, "rwops_testFileRead", "Tests reading from a file", TEST_ENABLED }; +static const SDLTest_TestCaseReference rwopsTest4 = { + (SDLTest_TestCaseFp)rwops_testFileRead, "rwops_testFileRead", "Tests reading from a file", TEST_ENABLED +}; -static const SDLTest_TestCaseReference rwopsTest5 = - { (SDLTest_TestCaseFp)rwops_testFileWrite, "rwops_testFileWrite", "Test writing to a file", TEST_ENABLED }; +static const SDLTest_TestCaseReference rwopsTest5 = { + (SDLTest_TestCaseFp)rwops_testFileWrite, "rwops_testFileWrite", "Test writing to a file", TEST_ENABLED +}; static const SDLTest_TestCaseReference rwopsTest6 = { (SDLTest_TestCaseFp)rwops_testFPRead, "rwops_testFPRead", "Test reading from file pointer", TEST_ENABLED }; @@ -743,7 +746,7 @@ static const SDLTest_TestCaseReference rwopsTest10 = { (SDLTest_TestCaseFp)rwops_testCompareRWFromMemWithRWFromFile, "rwops_testCompareRWFromMemWithRWFromFile", "Compare RWFromMem and RWFromFile RWops for read and seek", TEST_ENABLED }; /* Sequence of RWops test cases */ -static const SDLTest_TestCaseReference *rwopsTests[] = { +static const SDLTest_TestCaseReference *rwopsTests[] = { &rwopsTest1, &rwopsTest2, &rwopsTest3, &rwopsTest4, &rwopsTest5, &rwopsTest6, &rwopsTest7, &rwopsTest8, &rwopsTest9, &rwopsTest10, NULL }; diff --git a/test/testautomation_sdltest.c b/test/testautomation_sdltest.c index 9c97e60137b11..23ef7df9fb0d4 100644 --- a/test/testautomation_sdltest.c +++ b/test/testautomation_sdltest.c @@ -24,1286 +24,1280 @@ /* Test case functions */ -/* Forward declarations for internal harness functions */ -extern char *SDLTest_GenerateRunSeed(const int length); - /** * @brief Calls to SDLTest_GenerateRunSeed() */ -int -sdltest_generateRunSeed(void *arg) +int sdltest_generateRunSeed(void *arg) { - char* result; - size_t i, l; - int j; - - for (i = 1; i <= 10; i += 3) { - result = SDLTest_GenerateRunSeed((const int)i); - SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); - SDLTest_AssertCheck(result != NULL, "Verify returned value is not NULL"); - if (result != NULL) { - l = SDL_strlen(result); - SDLTest_AssertCheck(l == i, "Verify length of returned value is %d, got: %d", (int) i, (int) l); - SDL_free(result); - } - } - - /* Negative cases */ - for (j = -2; j <= 0; j++) { - result = SDLTest_GenerateRunSeed((const int)j); - SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); - SDLTest_AssertCheck(result == NULL, "Verify returned value is not NULL"); - } - - return TEST_COMPLETED; + char *result; + size_t i, l; + int j; + + for (i = 1; i <= 10; i += 3) { + result = SDLTest_GenerateRunSeed((int)i); + SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); + SDLTest_AssertCheck(result != NULL, "Verify returned value is not NULL"); + if (result != NULL) { + l = SDL_strlen(result); + SDLTest_AssertCheck(l == i, "Verify length of returned value is %d, got: %d", (int)i, (int)l); + SDL_free(result); + } + } + + /* Negative cases */ + for (j = -2; j <= 0; j++) { + result = SDLTest_GenerateRunSeed(j); + SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()"); + SDLTest_AssertCheck(result == NULL, "Verify returned value is not NULL"); + } + + return TEST_COMPLETED; } /** * @brief Calls to SDLTest_GetFuzzerInvocationCount() */ -int -sdltest_getFuzzerInvocationCount(void *arg) +int sdltest_getFuzzerInvocationCount(void *arg) { - Uint8 result; - int fuzzerCount1, fuzzerCount2; + Uint8 result; + int fuzzerCount1, fuzzerCount2; - fuzzerCount1 = SDLTest_GetFuzzerInvocationCount(); - SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); - SDLTest_AssertCheck(fuzzerCount1 >= 0, "Verify returned value, expected: >=0, got: %d", fuzzerCount1); + fuzzerCount1 = SDLTest_GetFuzzerInvocationCount(); + SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); + SDLTest_AssertCheck(fuzzerCount1 >= 0, "Verify returned value, expected: >=0, got: %d", fuzzerCount1); - result = SDLTest_RandomUint8(); - SDLTest_AssertPass("Call to SDLTest_RandomUint8(), returned %d", result); + result = SDLTest_RandomUint8(); + SDLTest_AssertPass("Call to SDLTest_RandomUint8(), returned %d", result); - fuzzerCount2 = SDLTest_GetFuzzerInvocationCount(); - SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); - SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1, "Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2); + fuzzerCount2 = SDLTest_GetFuzzerInvocationCount(); + SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); + SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1, "Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Calls to random number generators */ -int -sdltest_randomNumber(void *arg) +int sdltest_randomNumber(void *arg) { - Sint64 result; - double dresult; - Uint64 umax; - Sint64 min, max; - - result = (Sint64)SDLTest_RandomUint8(); - umax = (1 << 8) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomUint8"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); - - result = (Sint64)SDLTest_RandomSint8(); - min = 0 - (1 << 7); - max = (1 << 7) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomSint8"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); - - result = (Sint64)SDLTest_RandomUint16(); - umax = (1 << 16) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomUint16"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); - - result = (Sint64)SDLTest_RandomSint16(); - min = 0 - (1 << 15); - max = (1 << 15) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomSint16"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); - - result = (Sint64)SDLTest_RandomUint32(); - umax = ((Uint64)1 << 32) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomUint32"); - SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result); - - result = (Sint64)SDLTest_RandomSint32(); - min = 0 - ((Sint64)1 << 31); - max = ((Sint64)1 << 31) - 1; - SDLTest_AssertPass("Call to SDLTest_RandomSint32"); - SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result); - - SDLTest_RandomUint64(); - SDLTest_AssertPass("Call to SDLTest_RandomUint64"); - - result = SDLTest_RandomSint64(); - SDLTest_AssertPass("Call to SDLTest_RandomSint64"); - - dresult = (double)SDLTest_RandomUnitFloat(); - SDLTest_AssertPass("Call to SDLTest_RandomUnitFloat"); - SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); - - dresult = (double)SDLTest_RandomFloat(); - SDLTest_AssertPass("Call to SDLTest_RandomFloat"); - SDLTest_AssertCheck(dresult >= (double)(-FLT_MAX) && dresult <= (double)FLT_MAX, "Verify result value, expected: [%e,%e], got: %e", (double)(-FLT_MAX), (double)FLT_MAX, dresult); - - dresult = (double)SDLTest_RandomUnitDouble(); - SDLTest_AssertPass("Call to SDLTest_RandomUnitDouble"); - SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); - - dresult = SDLTest_RandomDouble(); - SDLTest_AssertPass("Call to SDLTest_RandomDouble"); - - return TEST_COMPLETED; + Sint64 result; + double dresult; + Uint64 umax; + Sint64 min, max; + + result = (Sint64)SDLTest_RandomUint8(); + umax = (1 << 8) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomUint8"); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); + + result = (Sint64)SDLTest_RandomSint8(); + min = 0 - (1 << 7); + max = (1 << 7) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomSint8"); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); + + result = (Sint64)SDLTest_RandomUint16(); + umax = (1 << 16) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomUint16"); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); + + result = (Sint64)SDLTest_RandomSint16(); + min = 0 - (1 << 15); + max = (1 << 15) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomSint16"); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); + + result = (Sint64)SDLTest_RandomUint32(); + umax = ((Uint64)1 << 32) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomUint32"); + SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); + + result = (Sint64)SDLTest_RandomSint32(); + min = 0 - ((Sint64)1 << 31); + max = ((Sint64)1 << 31) - 1; + SDLTest_AssertPass("Call to SDLTest_RandomSint32"); + SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); + + SDLTest_RandomUint64(); + SDLTest_AssertPass("Call to SDLTest_RandomUint64"); + + result = SDLTest_RandomSint64(); + SDLTest_AssertPass("Call to SDLTest_RandomSint64"); + + dresult = (double)SDLTest_RandomUnitFloat(); + SDLTest_AssertPass("Call to SDLTest_RandomUnitFloat"); + SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); + + dresult = (double)SDLTest_RandomFloat(); + SDLTest_AssertPass("Call to SDLTest_RandomFloat"); + SDLTest_AssertCheck(dresult >= (double)(-FLT_MAX) && dresult <= (double)FLT_MAX, "Verify result value, expected: [%e,%e], got: %e", (double)(-FLT_MAX), (double)FLT_MAX, dresult); + + dresult = SDLTest_RandomUnitDouble(); + SDLTest_AssertPass("Call to SDLTest_RandomUnitDouble"); + SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); + + dresult = SDLTest_RandomDouble(); + SDLTest_AssertPass("Call to SDLTest_RandomDouble"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Uint8 */ -int -sdltest_randomBoundaryNumberUint8(void *arg) +int sdltest_randomBoundaryNumberUint8(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Uint64 uresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0xff, - "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Uint64 uresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0 || uresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 100, + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0xff, + "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Uint16 */ -int -sdltest_randomBoundaryNumberUint16(void *arg) +int sdltest_randomBoundaryNumberUint16(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Uint64 uresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0xffff, - "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Uint64 uresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0 || uresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 100, + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0xffff, + "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Uint32 */ -int -sdltest_randomBoundaryNumberUint32(void *arg) +int sdltest_randomBoundaryNumberUint32(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Uint64 uresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0xffffffff, - "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Uint64 uresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0 || uresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 100, + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0xffffffff, + "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */ + uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Uint64 */ -int -sdltest_randomBoundaryNumberUint64(void *arg) +int sdltest_randomBoundaryNumberUint64(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Uint64 uresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0 || uresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 100, - "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult); - - /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xfffffffffffffffeULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == (Uint64)0xffffffffffffffffULL, - "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */ - uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xffffffffffffffffULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); - SDLTest_AssertCheck( - uresult == 0, - "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Uint64 uresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + uresult = SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + uresult = SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0 || uresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 100, + "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); + + /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ + uresult = SDLTest_RandomUint64BoundaryValue(1, 0xffffffffffffffffULL, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 0xfffffffffffffffeULL, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0xffffffffffffffffULL, + "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */ + uresult = SDLTest_RandomUint64BoundaryValue(0, 0xffffffffffffffffULL, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); + SDLTest_AssertCheck( + uresult == 0, + "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Sint8 */ -int -sdltest_randomBoundaryNumberSint8(void *arg) +int sdltest_randomBoundaryNumberSint8(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Sint64 sresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == 100, - "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == SCHAR_MIN, - "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX -1, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == SCHAR_MAX, - "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */ - sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); - SDLTest_AssertCheck( - sresult == SCHAR_MIN, - "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Sint64 sresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 0 || sresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == 100, + "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == SCHAR_MIN, + "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == SCHAR_MAX, + "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MAX, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */ + sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); + SDLTest_AssertCheck( + sresult == SCHAR_MIN, + "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Sint16 */ -int -sdltest_randomBoundaryNumberSint16(void *arg) +int sdltest_randomBoundaryNumberSint16(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Sint64 sresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == 100, - "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == SHRT_MIN, - "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == SHRT_MAX, - "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); - SDLTest_AssertCheck( - sresult == SHRT_MIN, - "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Sint64 sresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 0 || sresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == 100, + "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == SHRT_MIN, + "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == SHRT_MAX, + "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MAX, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE) returns 0 (sets error) */ + sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); + SDLTest_AssertCheck( + sresult == SHRT_MIN, + "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Sint32 */ -int -sdltest_randomBoundaryNumberSint32(void *arg) +int sdltest_randomBoundaryNumberSint32(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Sint64 sresult; + const char *expectedError = "That operation is not supported"; + char *lastError; + Sint64 sresult; #if ((ULONG_MAX) == (UINT_MAX)) - Sint32 long_min = LONG_MIN; - Sint32 long_max = LONG_MAX; + Sint32 long_min = LONG_MIN; + Sint32 long_max = LONG_MAX; #else - Sint32 long_min = INT_MIN; - Sint32 long_max = INT_MAX; + Sint32 long_min = INT_MIN; + Sint32 long_max = INT_MAX; #endif - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == 100, - "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == long_min, - "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == long_max, - "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); - SDLTest_AssertCheck( - sresult == long_min, - "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 0 || sresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == 100, + "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == long_min, + "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == long_max, + "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ + sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); + SDLTest_AssertCheck( + sresult == long_min, + "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /* * @brief Calls to random boundary number generators for Sint64 */ -int -sdltest_randomBoundaryNumberSint64(void *arg) +int sdltest_randomBoundaryNumberSint64(void *arg) { - const char *expectedError = "That operation is not supported"; - char *lastError; - Sint64 sresult; - - /* Clean error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10, - "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11, - "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12, - "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, - "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, - "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 0 || sresult == 21, - "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(INT64_MIN, 99, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == 100, - "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult); - - /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(INT64_MIN + 1, INT64_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == INT64_MIN, - "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX - 1, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == INT64_MAX, - "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MAX, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); - - /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */ - sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX, SDL_FALSE); - SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); - SDLTest_AssertCheck( - sresult == INT64_MIN, - "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MIN, sresult); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - - /* Clear error messages */ - SDL_ClearError(); - SDLTest_AssertPass("SDL_ClearError()"); - - return TEST_COMPLETED; + const char *expectedError = "That operation is not supported"; + char *lastError; + Sint64 sresult; + + /* Clean error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10, + "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11, + "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12, + "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, + "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ + sresult = SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, + "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ + sresult = SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 0 || sresult == 21, + "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, 99, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == 100, + "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); + + /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN + 1, INT64_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == INT64_MIN, + "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX - 1, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == INT64_MAX, + "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MAX, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); + + /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */ + sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX, SDL_FALSE); + SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); + SDLTest_AssertCheck( + sresult == INT64_MIN, + "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /** * @brief Calls to SDLTest_RandomIntegerInRange */ -int -sdltest_randomIntegerInRange(void *arg) +int sdltest_randomIntegerInRange(void *arg) { - Sint32 min, max; - Sint32 result; + Sint32 min, max; + Sint32 result; #if ((ULONG_MAX) == (UINT_MAX)) - Sint32 long_min = LONG_MIN; - Sint32 long_max = LONG_MAX; + Sint32 long_min = LONG_MIN; + Sint32 long_max = LONG_MAX; #else - Sint32 long_min = INT_MIN; - Sint32 long_max = INT_MAX; + Sint32 long_min = INT_MIN; + Sint32 long_max = INT_MAX; #endif - /* Standard range */ - min = (Sint32)SDLTest_RandomSint16(); - max = min + (Sint32)SDLTest_RandomUint8() + 2; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,max)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - /* One Range */ - min = (Sint32)SDLTest_RandomSint16(); - max = min + 1; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min+1)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - /* Zero range */ - min = (Sint32)SDLTest_RandomSint16(); - max = min; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min)"); - SDLTest_AssertCheck(min == result, "Validated returned value; expected: %" SDL_PRIs32 ", got: %" SDL_PRIs32, min, result); - - /* Zero range at zero */ - min = 0; - max = 0; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)"); - SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %" SDL_PRIs32, result); - - /* Swapped min-max */ - min = (Sint32)SDLTest_RandomSint16(); - max = min + (Sint32)SDLTest_RandomUint8() + 2; - result = SDLTest_RandomIntegerInRange(max, min); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - /* Range with min at integer limit */ - min = long_min; - max = long_max + (Sint32)SDLTest_RandomSint16(); - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - /* Range with max at integer limit */ - min = long_min - (Sint32)SDLTest_RandomSint16(); - max = long_max; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - /* Full integer range */ - min = long_min; - max = long_max; - result = SDLTest_RandomIntegerInRange(min, max); - SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)"); - SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); - - return TEST_COMPLETED; + /* Standard range */ + min = (Sint32)SDLTest_RandomSint16(); + max = min + (Sint32)SDLTest_RandomUint8() + 2; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,max)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + /* One Range */ + min = (Sint32)SDLTest_RandomSint16(); + max = min + 1; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min+1)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + /* Zero range */ + min = (Sint32)SDLTest_RandomSint16(); + max = min; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min)"); + SDLTest_AssertCheck(min == result, "Validated returned value; expected: %" SDL_PRIs32 ", got: %" SDL_PRIs32, min, result); + + /* Zero range at zero */ + min = 0; + max = 0; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)"); + SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %" SDL_PRIs32, result); + + /* Swapped min-max */ + min = (Sint32)SDLTest_RandomSint16(); + max = min + (Sint32)SDLTest_RandomUint8() + 2; + result = SDLTest_RandomIntegerInRange(max, min); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + /* Range with min at integer limit */ + min = long_min; + max = long_min + (Sint32)SDLTest_RandomUint16(); + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + /* Range with max at integer limit */ + min = long_max - (Sint32)SDLTest_RandomUint16(); + max = long_max; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + /* Full integer range */ + min = long_min; + max = long_max; + result = SDLTest_RandomIntegerInRange(min, max); + SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)"); + SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); + + return TEST_COMPLETED; } /** * @brief Calls to SDLTest_RandomAsciiString */ -int -sdltest_randomAsciiString(void *arg) +int sdltest_randomAsciiString(void *arg) { - char* result; - size_t len; - int nonAsciiCharacters; - size_t i; - - result = SDLTest_RandomAsciiString(); - SDLTest_AssertPass("Call to SDLTest_RandomAsciiString()"); - SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); - if (result != NULL) { - len = SDL_strlen(result); - SDLTest_AssertCheck(len >= 1 && len <= 255, "Validate that result length; expected: len=[1,255], got: %d", (int) len); - nonAsciiCharacters = 0; - for (i=0; i= 1 && len <= 255, "Validate that result length; expected: len=[1,255], got: %d", (int)len); + nonAsciiCharacters = 0; + for (i = 0; i < len; i++) { + if (SDL_iscntrl(result[i])) { + nonAsciiCharacters++; + } + } + SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); + if (nonAsciiCharacters) { + SDLTest_LogError("Invalid result from generator: '%s'", result); + } + SDL_free(result); + } + + return TEST_COMPLETED; } - /** * @brief Calls to SDLTest_RandomAsciiStringWithMaximumLength */ -int -sdltest_randomAsciiStringWithMaximumLength(void *arg) +int sdltest_randomAsciiStringWithMaximumLength(void *arg) { - const char* expectedError = "Parameter 'maxLength' is invalid"; - char* lastError; - char* result; - size_t targetLen; - size_t len; - int nonAsciiCharacters; - size_t i; - - targetLen = 16 + SDLTest_RandomUint8(); - result = SDLTest_RandomAsciiStringWithMaximumLength((int) targetLen); - SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int) targetLen); - SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); - if (result != NULL) { - len = SDL_strlen(result); - SDLTest_AssertCheck(len >= 1 && len <= targetLen, "Validate that result length; expected: len=[1,%d], got: %d", (int) targetLen, (int) len); - nonAsciiCharacters = 0; - for (i=0; i= 1 && len <= targetLen, "Validate that result length; expected: len=[1,%d], got: %d", (int)targetLen, (int)len); + nonAsciiCharacters = 0; + for (i = 0; i < len; i++) { + if (SDL_iscntrl(result[i])) { + nonAsciiCharacters++; + } + } + SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); + if (nonAsciiCharacters) { + SDLTest_LogError("Invalid result from generator: '%s'", result); + } + SDL_free(result); + } + + /* Negative test */ + targetLen = 0; + result = SDLTest_RandomAsciiStringWithMaximumLength((int)targetLen); + SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int)targetLen); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + + /* Clear error messages */ + SDL_ClearError(); + SDLTest_AssertPass("SDL_ClearError()"); + + return TEST_COMPLETED; } /** * @brief Calls to SDLTest_RandomAsciiStringOfSize */ -int -sdltest_randomAsciiStringOfSize(void *arg) +int sdltest_randomAsciiStringOfSize(void *arg) { - const char* expectedError = "Parameter 'size' is invalid"; - char* lastError; - char* result; - size_t targetLen; - size_t len; - int nonAsciiCharacters; - size_t i; - - /* Positive test */ - targetLen = 16 + SDLTest_RandomUint8(); - result = SDLTest_RandomAsciiStringOfSize((int) targetLen); - SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", (int) targetLen); - SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); - if (result != NULL) { - len = SDL_strlen(result); - SDLTest_AssertCheck(len == targetLen, "Validate that result length; expected: len=%d, got: %d", (int) targetLen, (int) len); - nonAsciiCharacters = 0; - for (i=0; i= 8) { + result = SDL_snprintf(text, sizeof(text), "%p", (void *)0x1ba07bddf60L); + expected = "0x1ba07bddf60"; + expected2 = "000001BA07BDDF60"; + expected3 = "000001ba07bddf60"; + SDLTest_AssertPass("Call to SDL_snprintf(text, sizeof(text), \"%%p\", 0x1ba07bddf60)"); + SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0 || + SDL_strcmp(text, expected2) == 0 || + SDL_strcmp(text, expected3) == 0, + "Check text, expected: '%s', got: '%s'", expected, text); + SDLTest_AssertCheck(result == SDL_strlen(expected) || + result == SDL_strlen(expected2) || + result == SDL_strlen(expected3), + "Check result value, expected: %d, got: %d", (int)SDL_strlen(expected), result); + } + return TEST_COMPLETED; } #if defined(HAVE_WFORMAT) || defined(HAVE_WFORMAT_EXTRA_ARGS) @@ -175,135 +252,134 @@ stdlib_snprintf(void *arg) /** * @brief Call to SDL_getenv and SDL_setenv */ -int -stdlib_getsetenv(void *arg) +int stdlib_getsetenv(void *arg) { - const int nameLen = 16; - char name[17]; - int counter; - int result; - char * value1; - char * value2; - char * expected; - int overwrite; - char * text; - - /* Create a random name. This tests SDL_getenv, since we need to */ - /* make sure the variable is not set yet (it shouldn't). */ - do { - for(counter = 0; counter < nameLen; counter++) { - name[counter] = (char)SDLTest_RandomIntegerInRange(65, 90); + const int nameLen = 16; + char name[17]; + int counter; + int result; + char *value1; + char *value2; + char *expected; + int overwrite; + char *text; + + /* Create a random name. This tests SDL_getenv, since we need to */ + /* make sure the variable is not set yet (it shouldn't). */ + do { + for (counter = 0; counter < nameLen; counter++) { + name[counter] = (char)SDLTest_RandomIntegerInRange(65, 90); + } + name[nameLen] = '\0'; + + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + if (text) { + SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, (int)SDL_strlen(text)); + } + } while (text); + + /* Create random values to set */ + value1 = SDLTest_RandomAsciiStringOfSize(10); + value2 = SDLTest_RandomAsciiStringOfSize(10); + + /* Set value 1 without overwrite */ + overwrite = 0; + expected = value1; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); } - name[nameLen] = '\0'; - + + /* Set value 2 with overwrite */ + overwrite = 1; + expected = value2; + result = SDL_setenv(name, value2, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value2, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Set value 1 without overwrite */ + overwrite = 0; + expected = value2; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ text = SDL_getenv(name); SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); if (text != NULL) { - SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, (int) SDL_strlen(text)); + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); } - } while (text != NULL); - - /* Create random values to set */ - value1 = SDLTest_RandomAsciiStringOfSize(10); - value2 = SDLTest_RandomAsciiStringOfSize(10); - - /* Set value 1 without overwrite */ - overwrite = 0; - expected = value1; - result = SDL_setenv(name, value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); - - /* Check value */ - text = SDL_getenv(name); - SDLTest_AssertPass("Call to SDL_getenv('%s')", name); - SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); - if (text != NULL) { - SDLTest_AssertCheck( - SDL_strcmp(text, expected) == 0, - "Verify returned text, expected: %s, got: %s", - expected, - text); - } - - /* Set value 2 with overwrite */ - overwrite = 1; - expected = value2; - result = SDL_setenv(name, value2, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value2, overwrite); - SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); - - /* Check value */ - text = SDL_getenv(name); - SDLTest_AssertPass("Call to SDL_getenv('%s')", name); - SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); - if (text != NULL) { - SDLTest_AssertCheck( - SDL_strcmp(text, expected) == 0, - "Verify returned text, expected: %s, got: %s", - expected, - text); - } - - /* Set value 1 without overwrite */ - overwrite = 0; - expected = value2; - result = SDL_setenv(name, value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); - - /* Check value */ - text = SDL_getenv(name); - SDLTest_AssertPass("Call to SDL_getenv('%s')", name); - SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); - if (text != NULL) { - SDLTest_AssertCheck( - SDL_strcmp(text, expected) == 0, - "Verify returned text, expected: %s, got: %s", - expected, - text); - } - - /* Set value 1 without overwrite */ - overwrite = 1; - expected = value1; - result = SDL_setenv(name, value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); - SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); - - /* Check value */ - text = SDL_getenv(name); - SDLTest_AssertPass("Call to SDL_getenv('%s')", name); - SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); - if (text != NULL) { - SDLTest_AssertCheck( - SDL_strcmp(text, expected) == 0, - "Verify returned text, expected: %s, got: %s", - expected, - text); - } - - /* Negative cases */ - for (overwrite=0; overwrite <= 1; overwrite++) { - result = SDL_setenv(NULL, value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv(NULL,'%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); - result = SDL_setenv("", value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('','%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); - result = SDL_setenv("=", value1, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('=','%s', %i)", value1, overwrite); - SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); - result = SDL_setenv(name, NULL, overwrite); - SDLTest_AssertPass("Call to SDL_setenv('%s', NULL, %i)", name, overwrite); - SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); - } - - /* Clean up */ - SDL_free(value1); - SDL_free(value2); - - return TEST_COMPLETED; + + /* Set value 1 without overwrite */ + overwrite = 1; + expected = value1; + result = SDL_setenv(name, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite); + SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result); + + /* Check value */ + text = SDL_getenv(name); + SDLTest_AssertPass("Call to SDL_getenv('%s')", name); + SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL"); + if (text != NULL) { + SDLTest_AssertCheck( + SDL_strcmp(text, expected) == 0, + "Verify returned text, expected: %s, got: %s", + expected, + text); + } + + /* Negative cases */ + for (overwrite = 0; overwrite <= 1; overwrite++) { + result = SDL_setenv(NULL, value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv(NULL,'%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv("", value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('','%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv("=", value1, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('=','%s', %i)", value1, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + result = SDL_setenv(name, NULL, overwrite); + SDLTest_AssertPass("Call to SDL_setenv('%s', NULL, %i)", name, overwrite); + SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result); + } + + /* Clean up */ + SDL_free(value1); + SDL_free(value2); + + return TEST_COMPLETED; } #if defined(HAVE_WFORMAT) || defined(HAVE_WFORMAT_EXTRA_ARGS) @@ -316,86 +392,186 @@ stdlib_getsetenv(void *arg) #endif #endif +#define FMT_PRILLd "%lld" +#define FMT_PRILLdn "%lld%lln" +#define FMT_PRILLu "%llu" + /** * @brief Call to SDL_sscanf */ #undef SDL_sscanf -int -stdlib_sscanf(void *arg) +int stdlib_sscanf(void *arg) { - int output; - int result; - int expected_output; - int expected_result; - short short_output, expected_short_output; - long long_output, expected_long_output; - long long long_long_output, expected_long_long_output; - size_t size_output, expected_size_output; - char text[128]; - - expected_output = output = 123; - expected_result = -1; - result = SDL_sscanf("", "%i", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"\", \"%%i\", &output)"); - SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); - - expected_output = output = 123; - expected_result = 0; - result = SDL_sscanf("a", "%i", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"a\", \"%%i\", &output)"); - SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); - - output = 123; - expected_output = 2; - expected_result = 1; - result = SDL_sscanf("2", "%i", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"2\", \"%%i\", &output)"); - SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); - - output = 123; - expected_output = 0xa; - expected_result = 1; - result = SDL_sscanf("aa", "%1x", &output); - SDLTest_AssertPass("Call to SDL_sscanf(\"aa\", \"%%1x\", &output)"); - SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); - -#define SIZED_TEST_CASE(type, var, format_specifier) \ - var##_output = 123; \ - expected_##var##_output = (type)(((unsigned type)(~0)) >> 1); \ - expected_result = 1; \ - result = SDL_snprintf(text, sizeof(text), format_specifier, expected_##var##_output); \ - result = SDL_sscanf(text, format_specifier, &var##_output); \ - SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%s\", &output)", text, #format_specifier); \ - SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " format_specifier ", got: " format_specifier, expected_##var##_output, var##_output); \ - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ - \ - var##_output = 123; \ - expected_##var##_output = ~(type)(((unsigned type)(~0)) >> 1); \ - expected_result = 1; \ - result = SDL_snprintf(text, sizeof(text), format_specifier, expected_##var##_output); \ - result = SDL_sscanf(text, format_specifier, &var##_output); \ - SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%s\", &output)", text, #format_specifier); \ - SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " format_specifier ", got: " format_specifier, expected_##var##_output, var##_output); \ - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ - - SIZED_TEST_CASE(short, short, "%hd") - SIZED_TEST_CASE(long, long, "%ld") - SIZED_TEST_CASE(long long, long_long, "%lld") - - size_output = 123; - expected_size_output = (size_t)~0; - expected_result = 1; - result = SDL_snprintf(text, sizeof(text), "%zu", expected_size_output); - result = SDL_sscanf(text, "%zu", &size_output); - SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%%zu\", &output)", text); - SDLTest_AssertCheck(expected_size_output == size_output, "Check output, expected: %zu, got: %zu", expected_size_output, size_output); - SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); - - return TEST_COMPLETED; + int output; + int result; + int length; + int expected_output; + int expected_result; + short short_output, expected_short_output, short_length; + long long_output, expected_long_output, long_length; + long long long_long_output, expected_long_long_output, long_long_length; + size_t size_output, expected_size_output; + char text[128], text2[128]; + unsigned int r = 0, g = 0, b = 0; + + expected_output = output = 123; + expected_result = -1; + result = SDL_sscanf("", "%i", &output); + SDLTest_AssertPass("Call to SDL_sscanf(\"\", \"%%i\", &output)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_output = output = 123; + expected_result = 0; + result = SDL_sscanf("a", "%i", &output); + SDLTest_AssertPass("Call to SDL_sscanf(\"a\", \"%%i\", &output)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + output = 123; + length = 0; + expected_output = 2; + expected_result = 1; + result = SDL_sscanf("2", "%i%n", &output, &length); + SDLTest_AssertPass("Call to SDL_sscanf(\"2\", \"%%i%%n\", &output, &length)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + SDLTest_AssertCheck(length == 1, "Check length, expected: 1, got: %i", length); + + output = 123; + length = 0; + expected_output = 0xa; + expected_result = 1; + result = SDL_sscanf("aa", "%1x%n", &output, &length); + SDLTest_AssertPass("Call to SDL_sscanf(\"aa\", \"%%1x%%n\", &output, &length)"); + SDLTest_AssertCheck(expected_output == output, "Check output, expected: %i, got: %i", expected_output, output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + SDLTest_AssertCheck(length == 1, "Check length, expected: 1, got: %i", length); + + expected_result = 3; + result = SDL_sscanf("#026", "#%1x%1x%1x", &r, &g, &b); + SDLTest_AssertPass("Call to SDL_sscanf(\"#026\", \"#%%1x%%1x%%1x\", &r, &g, &b)"); + expected_output = 0; + SDLTest_AssertCheck(r == expected_output, "Check output for r, expected: %i, got: %i", expected_output, r); + expected_output = 2; + SDLTest_AssertCheck(g == expected_output, "Check output for g, expected: %i, got: %i", expected_output, g); + expected_output = 6; + SDLTest_AssertCheck(b == expected_output, "Check output for b, expected: %i, got: %i", expected_output, b); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + +#define SIZED_TEST_CASE(type, var, printf_specifier, scanf_specifier) \ + var##_output = 123; \ + var##_length = 0; \ + expected_##var##_output = (type)(((unsigned type)(~0)) >> 1); \ + expected_result = 1; \ + result = SDL_snprintf(text, sizeof(text), printf_specifier, expected_##var##_output); \ + result = SDL_sscanf(text, scanf_specifier, &var##_output, &var##_length); \ + SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", %s, &output, &length)", text, #scanf_specifier); \ + SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " printf_specifier ", got: " printf_specifier, expected_##var##_output, var##_output); \ + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ + SDLTest_AssertCheck(var##_length == (type)SDL_strlen(text), "Check length, expected: %i, got: %i", (int)SDL_strlen(text), (int)var##_length); \ + \ + var##_output = 123; \ + var##_length = 0; \ + expected_##var##_output = ~(type)(((unsigned type)(~0)) >> 1); \ + expected_result = 1; \ + result = SDL_snprintf(text, sizeof(text), printf_specifier, expected_##var##_output); \ + result = SDL_sscanf(text, scanf_specifier, &var##_output, &var##_length); \ + SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", %s, &output, &length)", text, #scanf_specifier); \ + SDLTest_AssertCheck(expected_##var##_output == var##_output, "Check output, expected: " printf_specifier ", got: " printf_specifier, expected_##var##_output, var##_output); \ + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); \ + SDLTest_AssertCheck(var##_length == (type)SDL_strlen(text), "Check length, expected: %i, got: %i", (int)SDL_strlen(text), (int)var##_length); \ + + SIZED_TEST_CASE(short, short, "%hd", "%hd%hn") + SIZED_TEST_CASE(long, long, "%ld", "%ld%ln") + SIZED_TEST_CASE(long long, long_long, FMT_PRILLd, FMT_PRILLdn) + + size_output = 123; + expected_size_output = ~((size_t)0); + expected_result = 1; + result = SDL_snprintf(text, sizeof(text), "%zu", expected_size_output); + result = SDL_sscanf(text, "%zu", &size_output); + SDLTest_AssertPass("Call to SDL_sscanf(\"%s\", \"%%zu\", &output)", text); + SDLTest_AssertCheck(expected_size_output == size_output, "Check output, expected: %zu, got: %zu", expected_size_output, size_output); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc def", "%s", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc def\", \"%%s\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc,def", "%s", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%s\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc,def") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc,def", "%[cba]", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[cba]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc,def", "%[a-z]", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[z-a]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc,def", "%[^,]", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[^,]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 0; + text[0] = '\0'; + result = SDL_sscanf("abc,def", "%[A-Z]", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[A-Z]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "") == 0, "Check output, expected: \"\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 2; + text[0] = '\0'; + text2[0] = '\0'; + result = SDL_sscanf("abc,def", "%[abc],%[def]", text, text2); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[abc],%%[def]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 2; + text[0] = '\0'; + text2[0] = '\0'; + result = SDL_sscanf("abc,def", "%[abc]%*[,]%[def]", text, text2); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[abc]%%*[,]%%[def]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 2; + text[0] = '\0'; + text2[0] = '\0'; + result = SDL_sscanf("abc def", "%[abc] %[def]", text, text2); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc def\", \"%%[abc] %%[def]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text); + SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + expected_result = 1; + text[0] = '\0'; + result = SDL_sscanf("abc123XYZ", "%[a-zA-Z0-9]", text); + SDLTest_AssertPass("Call to SDL_sscanf(\"abc123XYZ\", \"%%[a-zA-Z0-9]\", text)"); + SDLTest_AssertCheck(SDL_strcmp(text, "abc123XYZ") == 0, "Check output, expected: \"abc123XYZ\", got: \"%s\"", text); + SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result); + + return TEST_COMPLETED; } #if defined(HAVE_WFORMAT) || defined(HAVE_WFORMAT_EXTRA_ARGS) @@ -403,11 +579,11 @@ stdlib_sscanf(void *arg) #endif #if defined(_WIN64) -# define SIZE_FORMAT "I64u" +#define SIZE_FORMAT "I64u" #elif defined(__WIN32__) -# define SIZE_FORMAT "I32u" +#define SIZE_FORMAT "I32u" #else -# define SIZE_FORMAT "zu" +#define SIZE_FORMAT "zu" #endif typedef struct @@ -418,8 +594,7 @@ typedef struct int status; } overflow_test; -static const overflow_test multiplications[] = -{ +static const overflow_test multiplications[] = { { 1, 1, 1, 0 }, { 0, 0, 0, 0 }, { SDL_SIZE_MAX, 0, 0, 0 }, @@ -432,8 +607,7 @@ static const overflow_test multiplications[] = { SDL_SIZE_MAX, SDL_SIZE_MAX, 0, -1 }, }; -static const overflow_test additions[] = -{ +static const overflow_test additions[] = { { 1, 1, 2, 0 }, { 0, 0, 0, 0 }, { SDL_SIZE_MAX, 0, SDL_SIZE_MAX, 0 }, @@ -448,147 +622,268 @@ static const overflow_test additions[] = static int stdlib_overflow(void *arg) { - size_t i; - size_t useBuiltin; - - for (useBuiltin = 0; useBuiltin < 2; useBuiltin++) { - if (useBuiltin) { - SDLTest_Log("Using gcc/clang builtins if possible"); - } else { - SDLTest_Log("Not using gcc/clang builtins"); - } - - for (i = 0; i < SDL_arraysize(multiplications); i++) { - const overflow_test *t = &multiplications[i]; - int status; - size_t result = ~t->result; - - if (useBuiltin) { - status = SDL_size_mul_overflow(t->a, t->b, &result); - } else { - /* This disables the macro that tries to use a gcc/clang - * builtin, so we test the fallback implementation instead. */ - status = (SDL_size_mul_overflow)(t->a, t->b, &result); - } - - if (t->status == 0) { - SDLTest_AssertCheck(status == 0, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should succeed", - t->a, t->b); - SDLTest_AssertCheck(result == t->result, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, - t->a, t->b, t->result, result); - } else { - SDLTest_AssertCheck(status == -1, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should fail", - t->a, t->b); - } - - if (t->a == t->b) { - continue; - } - - result = ~t->result; - - if (useBuiltin) { - status = SDL_size_mul_overflow(t->b, t->a, &result); - } else { - status = (SDL_size_mul_overflow)(t->b, t->a, &result); - } - - if (t->status == 0) { - SDLTest_AssertCheck(status == 0, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should succeed", - t->b, t->a); - SDLTest_AssertCheck(result == t->result, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, - t->b, t->a, t->result, result); - } else { - SDLTest_AssertCheck(status == -1, - "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should fail", - t->b, t->a); - } - } - - for (i = 0; i < SDL_arraysize(additions); i++) { - const overflow_test *t = &additions[i]; - int status; - size_t result = ~t->result; - - if (useBuiltin) { - status = SDL_size_add_overflow(t->a, t->b, &result); - } else { - status = (SDL_size_add_overflow)(t->a, t->b, &result); - } - - if (t->status == 0) { - SDLTest_AssertCheck(status == 0, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should succeed", - t->a, t->b); - SDLTest_AssertCheck(result == t->result, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, - t->a, t->b, t->result, result); - } else { - SDLTest_AssertCheck(status == -1, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should fail", - t->a, t->b); - } - - if (t->a == t->b) { - continue; - } - - result = ~t->result; - - if (useBuiltin) { - status = SDL_size_add_overflow(t->b, t->a, &result); - } else { - status = (SDL_size_add_overflow)(t->b, t->a, &result); - } - - if (t->status == 0) { - SDLTest_AssertCheck(status == 0, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should succeed", - t->b, t->a); - SDLTest_AssertCheck(result == t->result, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, - t->b, t->a, t->result, result); - } else { - SDLTest_AssertCheck(status == -1, - "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should fail", - t->b, t->a); - } - } - } - - return TEST_COMPLETED; + size_t i; + size_t useBuiltin; + + for (useBuiltin = 0; useBuiltin < 2; useBuiltin++) { + if (useBuiltin) { + SDLTest_Log("Using gcc/clang builtins if possible"); + } else { + SDLTest_Log("Not using gcc/clang builtins"); + } + + for (i = 0; i < SDL_arraysize(multiplications); i++) { + const overflow_test *t = &multiplications[i]; + int status; + size_t result = ~t->result; + + if (useBuiltin) { + status = SDL_size_mul_overflow(t->a, t->b, &result); + } else { + /* This disables the macro that tries to use a gcc/clang + * builtin, so we test the fallback implementation instead. */ + status = (SDL_size_mul_overflow)(t->a, t->b, &result); + } + + if (t->status == 0) { + SDLTest_AssertCheck(status == 0, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should succeed", + t->a, t->b); + SDLTest_AssertCheck(result == t->result, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, + t->a, t->b, t->result, result); + } else { + SDLTest_AssertCheck(status == -1, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should fail", + t->a, t->b); + } + + if (t->a == t->b) { + continue; + } + + result = ~t->result; + + if (useBuiltin) { + status = SDL_size_mul_overflow(t->b, t->a, &result); + } else { + status = (SDL_size_mul_overflow)(t->b, t->a, &result); + } + + if (t->status == 0) { + SDLTest_AssertCheck(status == 0, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should succeed", + t->b, t->a); + SDLTest_AssertCheck(result == t->result, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, + t->b, t->a, t->result, result); + } else { + SDLTest_AssertCheck(status == -1, + "(%" SIZE_FORMAT " * %" SIZE_FORMAT ") should fail", + t->b, t->a); + } + } + + for (i = 0; i < SDL_arraysize(additions); i++) { + const overflow_test *t = &additions[i]; + int status; + size_t result = ~t->result; + + if (useBuiltin) { + status = SDL_size_add_overflow(t->a, t->b, &result); + } else { + status = (SDL_size_add_overflow)(t->a, t->b, &result); + } + + if (t->status == 0) { + SDLTest_AssertCheck(status == 0, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should succeed", + t->a, t->b); + SDLTest_AssertCheck(result == t->result, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, + t->a, t->b, t->result, result); + } else { + SDLTest_AssertCheck(status == -1, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should fail", + t->a, t->b); + } + + if (t->a == t->b) { + continue; + } + + result = ~t->result; + + if (useBuiltin) { + status = SDL_size_add_overflow(t->b, t->a, &result); + } else { + status = (SDL_size_add_overflow)(t->b, t->a, &result); + } + + if (t->status == 0) { + SDLTest_AssertCheck(status == 0, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should succeed", + t->b, t->a); + SDLTest_AssertCheck(result == t->result, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT "): expected %" SIZE_FORMAT ", got %" SIZE_FORMAT, + t->b, t->a, t->result, result); + } else { + SDLTest_AssertCheck(status == -1, + "(%" SIZE_FORMAT " + %" SIZE_FORMAT ") should fail", + t->b, t->a); + } + } + } + + return TEST_COMPLETED; +} + +static int +stdlib_strtox(void *arg) +{ + const unsigned long long ullong_max = ~0ULL; + +#define STRTOX_TEST_CASE(func_name, type, format_spec, str, base, expected_result, expected_endp_offset) do { \ + const char *s = str; \ + type r, expected_r = expected_result; \ + char *ep, *expected_ep = (char *)s + expected_endp_offset; \ + r = func_name(s, &ep, base); \ + SDLTest_AssertPass("Call to " #func_name "(" #str ", &endp, " #base ")"); \ + SDLTest_AssertCheck(r == expected_r, "Check result value, expected: " format_spec ", got: " format_spec, expected_r, r); \ + SDLTest_AssertCheck(ep == expected_ep, "Check endp value, expected: %p, got: %p", expected_ep, ep); \ + } while (0) + + // infer decimal + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "\t 123abcxyz", 0, 123, 6); // skip leading space + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "+123abcxyz", 0, 123, 4); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "+123abcxyz", 0, 123, 4); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-123abcxyz", 0, -123, 4); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "9999999999999999999999999999999999999999abcxyz", 0, ullong_max, 40); + + // infer hexadecimal + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0x123abcxyz", 0, 0x123abc, 8); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0X123ABCXYZ", 0, 0x123abc, 8); // uppercase X + + // infer octal + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0123abcxyz", 0, 0123, 4); + + // arbitrary bases + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "00110011", 2, 51, 8); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-uvwxyz", 32, -991, 3); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "ZzZzZzZzZzZzZzZzZzZzZzZzZ", 36, ullong_max, 25); + + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0", 0, 0, 1); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "0", 10, 0, 1); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-0", 0, 0, 2); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, "-0", 10, 0, 2); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLu, " - 1", 0, 0, 0); // invalid input + + // We know that SDL_strtol, SDL_strtoul and SDL_strtoll share the same code path as SDL_strtoull under the hood, + // so the most interesting test cases are those close to the bounds of the integer type. + + // For simplicity, we only run long/long long tests when they are 32-bit/64-bit, respectively. + // Suppressing warnings would be difficult otherwise. + // Since the CI runs the tests against a variety of targets, this should be fine in practice. + + if (sizeof(long) == 4) { + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "0", 0, 0, 1); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "0", 10, 0, 1); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-0", 0, 0, 2); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-0", 10, 0, 2); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "2147483647", 10, 2147483647, 10); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "2147483648", 10, 2147483647, 10); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-2147483648", 10, -2147483647L - 1, 11); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-2147483649", 10, -2147483647L - 1, 11); + STRTOX_TEST_CASE(SDL_strtol, long, "%ld", "-9999999999999999999999999999999999999999", 10, -2147483647L - 1, 41); + + STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967295", 10, 4294967295UL, 10); + STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "4294967296", 10, 4294967295UL, 10); + STRTOX_TEST_CASE(SDL_strtoul, unsigned long, "%lu", "-4294967295", 10, 1, 11); + } + + if (sizeof(long long) == 8) { + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "0", 0, 0LL, 1); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "0", 10, 0LL, 1); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-0", 0, 0LL, 2); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-0", 10, 0LL, 2); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "9223372036854775807", 10, 9223372036854775807LL, 19); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "9223372036854775808", 10, 9223372036854775807LL, 19); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9223372036854775808", 10, -9223372036854775807LL - 1, 20); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9223372036854775809", 10, -9223372036854775807LL - 1, 20); + STRTOX_TEST_CASE(SDL_strtoll, long long, FMT_PRILLd, "-9999999999999999999999999999999999999999", 10, -9223372036854775807LL - 1, 41); + + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "18446744073709551615", 10, 18446744073709551615ULL, 20); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "18446744073709551616", 10, 18446744073709551615ULL, 20); + STRTOX_TEST_CASE(SDL_strtoull, unsigned long long, FMT_PRILLd, "-18446744073709551615", 10, 1, 21); + } + +#undef STRTOX_TEST_CASE + + return TEST_COMPLETED; +} + +static int +stdlib_strtod(void *arg) +{ +#define STRTOD_TEST_CASE(str, expected_result, expected_endp_offset) do { \ + const char *s = str; \ + double r, expected_r = expected_result; \ + char *ep, *expected_ep = (char *)s + expected_endp_offset; \ + r = SDL_strtod(s, &ep); \ + SDLTest_AssertPass("Call to SDL_strtod(" #str ", &endp)"); \ + SDLTest_AssertCheck(r == expected_r, "Check result value, expected: %f, got: %f", expected_r, r); \ + SDLTest_AssertCheck(ep == expected_ep, "Check endp value, expected: %p, got: %p", expected_ep, ep); \ + } while (0) + + STRTOD_TEST_CASE("\t 123.75abcxyz", 123.75, 9); // skip leading space + STRTOD_TEST_CASE("+999.555", 999.555, 8); + STRTOD_TEST_CASE("-999.555", -999.555, 8); + +#undef STRTOD_TEST_CASE + + return TEST_COMPLETED; } /* ================= Test References ================== */ /* Standard C routine test cases */ -static const SDLTest_TestCaseReference stdlibTest1 = - { (SDLTest_TestCaseFp)stdlib_strlcpy, "stdlib_strlcpy", "Call to SDL_strlcpy", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTest1 = { + (SDLTest_TestCaseFp)stdlib_strlcpy, "stdlib_strlcpy", "Call to SDL_strlcpy", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference stdlibTest2 = { + (SDLTest_TestCaseFp)stdlib_snprintf, "stdlib_snprintf", "Call to SDL_snprintf", TEST_ENABLED +}; -static const SDLTest_TestCaseReference stdlibTest2 = - { (SDLTest_TestCaseFp)stdlib_snprintf, "stdlib_snprintf", "Call to SDL_snprintf", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTest3 = { + (SDLTest_TestCaseFp)stdlib_getsetenv, "stdlib_getsetenv", "Call to SDL_getenv and SDL_setenv", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference stdlibTest4 = { + (SDLTest_TestCaseFp)stdlib_sscanf, "stdlib_sscanf", "Call to SDL_sscanf", TEST_ENABLED +}; -static const SDLTest_TestCaseReference stdlibTest3 = - { (SDLTest_TestCaseFp)stdlib_getsetenv, "stdlib_getsetenv", "Call to SDL_getenv and SDL_setenv", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTestOverflow = { + stdlib_overflow, "stdlib_overflow", "Overflow detection", TEST_ENABLED +}; -static const SDLTest_TestCaseReference stdlibTest4 = - { (SDLTest_TestCaseFp)stdlib_sscanf, "stdlib_sscanf", "Call to SDL_sscanf", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTest_strtox = { + stdlib_strtox, "stdlib_strtox", "Calls to SDL_strtol, SDL_strtoul, SDL_strtoll and SDL_strtoull", TEST_ENABLED +}; -static const SDLTest_TestCaseReference stdlibTestOverflow = - { stdlib_overflow, "stdlib_overflow", "Overflow detection", TEST_ENABLED }; +static const SDLTest_TestCaseReference stdlibTest_strtod = { + stdlib_strtod, "stdlib_strtod", "Calls to SDL_strtod", TEST_ENABLED +}; /* Sequence of Standard C routine test cases */ -static const SDLTest_TestCaseReference *stdlibTests[] = { +static const SDLTest_TestCaseReference *stdlibTests[] = { &stdlibTest1, &stdlibTest2, &stdlibTest3, &stdlibTest4, &stdlibTestOverflow, + &stdlibTest_strtox, + &stdlibTest_strtod, NULL }; diff --git a/test/testautomation_subsystems.c b/test/testautomation_subsystems.c new file mode 100644 index 0000000000000..dc08f1d388ef1 --- /dev/null +++ b/test/testautomation_subsystems.c @@ -0,0 +1,281 @@ +/** + * Subsystem test suite + */ + +#include "SDL.h" +#include "SDL_test.h" + +/* ================= Test Case Implementation ================== */ + +/* Fixture */ + +static void subsystemsSetUp(void *arg) +{ + /* Reset each one of the SDL subsystems */ + /* CHECKME: can we use SDL_Quit here, or this will break the flow of tests? */ + SDL_Quit(); + /* Alternate variant without SDL_Quit: + while (SDL_WasInit(SDL_INIT_EVERYTHING) != 0) { + SDL_QuitSubSystem(SDL_INIT_EVERYTHING); + } + */ + SDLTest_AssertPass("Reset all subsystems before subsystems test"); + SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_EVERYTHING) == 0, "Check result from SDL_WasInit(SDL_INIT_EVERYTHING)"); +} + +static void subsystemsTearDown(void *arg) +{ + /* Reset each one of the SDL subsystems */ + SDL_Quit(); + + SDLTest_AssertPass("Cleanup of subsystems test completed"); +} + +/* Test case functions */ + +/** + * \brief Inits and Quits particular subsystem, checking its Init status. + * + * \sa SDL_InitSubSystem + * \sa SDL_QuitSubSystem + * + */ +static int subsystems_referenceCount(void) +{ + const int system = SDL_INIT_VIDEO; + int result; + /* Ensure that we start with a non-initialized subsystem. */ + SDLTest_AssertCheck(SDL_WasInit(system) == 0, "Check result from SDL_WasInit(0x%x)", system); + + /* Init subsystem once, and quit once */ + SDL_InitSubSystem(system); + SDLTest_AssertPass("Call to SDL_InitSubSystem(0x%x)", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); + + SDL_QuitSubSystem(system); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x)", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(0x%x), expected: 0, got: 0x%x", system, result); + + /* Init subsystem number of times, then decrement reference count until it's disposed of. */ + SDL_InitSubSystem(system); + SDL_InitSubSystem(system); + SDL_InitSubSystem(system); + SDLTest_AssertPass("Call to SDL_InitSubSystem(0x%x) x3 times", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); + + SDL_QuitSubSystem(system); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x1", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); + SDL_QuitSubSystem(system); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x2", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == system, "Check result from SDL_WasInit(0x%x), expected: 0x%x, got: 0x%x", system, system, result); + SDL_QuitSubSystem(system); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(0x%x) x3", system); + result = SDL_WasInit(system); + SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(0x%x), expected: 0, got: 0x%x", system, result); + + return TEST_COMPLETED; +} + +/** + * \brief Inits and Quits subsystems that have another as dependency; + * check that the dependency is not removed before the last of its dependents. + * + * \sa SDL_InitSubSystem + * \sa SDL_QuitSubSystem + * + */ +static int subsystems_dependRefCountInitAllQuitByOne(void) +{ + int result; + /* Ensure that we start with reset subsystems. */ + SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, + "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); + + /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ + SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)"); + result = SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); + SDLTest_AssertCheck(result == (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), expected: 0x%x, got: 0x%x", (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), result); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + + /* Quit systems one by one. */ + SDL_QuitSubSystem(SDL_INIT_VIDEO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_JOYSTICK)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); + + return TEST_COMPLETED; +} + +/** + * \brief Inits and Quits subsystems that have another as dependency; + * check that the dependency is not removed before the last of its dependents. + * + * \sa SDL_InitSubSystem + * \sa SDL_QuitSubSystem + * + */ +static int subsystems_dependRefCountInitByOneQuitAll(void) +{ + int result; + /* Ensure that we start with reset subsystems. */ + SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, + "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); + + /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ + SDL_InitSubSystem(SDL_INIT_VIDEO); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + SDL_InitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); + SDL_InitSubSystem(SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_JOYSTICK)"); + + /* Quit systems all at once. */ + SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); + + return TEST_COMPLETED; +} + +/** + * \brief Inits and Quits subsystems that have another as dependency, + * but also inits that dependency explicitly, giving it extra ref count. + * Check that the dependency is not removed before the last reference is gone. + * + * \sa SDL_InitSubSystem + * \sa SDL_QuitSubSystem + * + */ +static int subsystems_dependRefCountWithExtraInit(void) +{ + int result; + /* Ensure that we start with reset subsystems. */ + SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, + "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); + + /* Init EVENTS explicitly, +1 ref count. */ + SDL_InitSubSystem(SDL_INIT_EVENTS); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_EVENTS)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + /* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */ + SDL_InitSubSystem(SDL_INIT_VIDEO); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO)"); + SDL_InitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO)"); + SDL_InitSubSystem(SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_JOYSTICK)"); + + /* Quit EVENTS explicitly, -1 ref count. */ + SDL_QuitSubSystem(SDL_INIT_EVENTS); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_EVENTS)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + + /* Quit systems one by one. */ + SDL_QuitSubSystem(SDL_INIT_VIDEO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_VIDEO)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + SDL_QuitSubSystem(SDL_INIT_AUDIO); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result); + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); + SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_JOYSTICK)"); + result = SDL_WasInit(SDL_INIT_EVENTS); + SDLTest_AssertCheck(result == 0, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0, got: 0x%x", result); + + return TEST_COMPLETED; +} + + +/** + * \brief Inits and Quits timers subsystem, which cannot be explicitly initialized in SDL3 + * + * \sa SDL_InitSubSystem + * \sa SDL_QuitSubSystem + * + */ +static int subsystems_timersSubsystem(void) +{ + int result; + /* Ensure that we start with reset subsystems. */ + SDLTest_AssertCheck(SDL_WasInit(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS) == 0, + "Check result from SDL_WasInit(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS)"); + + SDLTest_AssertPass("About to call SDL_WasInit(0)"); + result = SDL_WasInit(0); + SDLTest_AssertCheck(result == 0, "SDL_WasInit(0) should return 0, actual 0x%x", result); + + SDLTest_AssertPass("About to call SDL_InitSubSystem(SDL_INIT_TIMER)"); + result = SDL_InitSubSystem(SDL_INIT_TIMER); + SDLTest_AssertCheck(result == 0, "Must return 0, actually %d", result); + SDLTest_AssertPass("About to call SDL_WasInit(SDL_INIT_TIMER)"); + result = SDL_WasInit(SDL_INIT_TIMER); + SDLTest_AssertCheck(result == SDL_INIT_TIMER, "Must return SDL_INIT_TIMER (=%d), actually %d", SDL_INIT_TIMER, result); + SDLTest_AssertPass("About to call SDL_WasInit(0)"); + result = SDL_WasInit(0); + SDLTest_AssertCheck(result == SDL_INIT_TIMER, "SDL_WasInit(0) should return SDL_INIT_TIMER, actual 0x%x", result); + + SDLTest_AssertPass("About to call SDL_QuitSubSystem(SDL_INIT_TIMER)"); + SDL_QuitSubSystem(SDL_INIT_TIMER); + SDLTest_AssertPass("SDL_QuitSubSystem finished"); + + return TEST_COMPLETED; +} + +/* ================= Test References ================== */ + +/* Subsystems test cases */ +static const SDLTest_TestCaseReference subsystemsTest1 = { + (SDLTest_TestCaseFp)subsystems_referenceCount, "subsystems_referenceCount", "Makes sure that subsystem stays until number of quits matches inits.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference subsystemsTest2 = { + (SDLTest_TestCaseFp)subsystems_dependRefCountInitAllQuitByOne, "subsystems_dependRefCountInitAllQuitByOne", "Check reference count of subsystem dependencies.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference subsystemsTest3 = { + (SDLTest_TestCaseFp)subsystems_dependRefCountInitByOneQuitAll, "subsystems_dependRefCountInitByOneQuitAll", "Check reference count of subsystem dependencies.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference subsystemsTest4 = { + (SDLTest_TestCaseFp)subsystems_dependRefCountWithExtraInit, "subsystems_dependRefCountWithExtraInit", "Check reference count of subsystem dependencies.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference subsystemsTest5 = { + (SDLTest_TestCaseFp)subsystems_timersSubsystem, "subsystems_timersSubsystem", "Check timer subsystem, removed in SDL3.", TEST_ENABLED +}; + +/* Sequence of Events test cases */ +static const SDLTest_TestCaseReference *subsystemsTests[] = { + &subsystemsTest1, &subsystemsTest2, &subsystemsTest3, &subsystemsTest4, &subsystemsTest5, NULL +}; + +/* Events test suite (global) */ +SDLTest_TestSuiteReference subsystemsTestSuite = { + "Subsystems", + subsystemsSetUp, + subsystemsTests, + subsystemsTearDown +}; diff --git a/test/testautomation_suites.h b/test/testautomation_suites.h index 7fcce1b1ce461..95528f271fbeb 100644 --- a/test/testautomation_suites.h +++ b/test/testautomation_suites.h @@ -16,6 +16,7 @@ extern SDLTest_TestSuiteReference guidTestSuite; extern SDLTest_TestSuiteReference hintsTestSuite; extern SDLTest_TestSuiteReference joystickTestSuite; extern SDLTest_TestSuiteReference keyboardTestSuite; +extern SDLTest_TestSuiteReference logTestSuite; extern SDLTest_TestSuiteReference mainTestSuite; extern SDLTest_TestSuiteReference mathTestSuite; extern SDLTest_TestSuiteReference mouseTestSuite; @@ -26,13 +27,14 @@ extern SDLTest_TestSuiteReference renderTestSuite; extern SDLTest_TestSuiteReference rwopsTestSuite; extern SDLTest_TestSuiteReference sdltestTestSuite; extern SDLTest_TestSuiteReference stdlibTestSuite; +extern SDLTest_TestSuiteReference subsystemsTestSuite; extern SDLTest_TestSuiteReference surfaceTestSuite; extern SDLTest_TestSuiteReference syswmTestSuite; extern SDLTest_TestSuiteReference timerTestSuite; extern SDLTest_TestSuiteReference videoTestSuite; /* All test suites */ -SDLTest_TestSuiteReference *testSuites[] = { +SDLTest_TestSuiteReference *testSuites[] = { &audioTestSuite, &clipboardTestSuite, &eventsTestSuite, @@ -40,6 +42,7 @@ SDLTest_TestSuiteReference *testSuites[] = { &hintsTestSuite, &joystickTestSuite, &keyboardTestSuite, + &logTestSuite, &mainTestSuite, &mathTestSuite, &mouseTestSuite, @@ -54,6 +57,7 @@ SDLTest_TestSuiteReference *testSuites[] = { &syswmTestSuite, &timerTestSuite, &videoTestSuite, + &subsystemsTestSuite, /* run last, not interfere with other test enviroment */ NULL }; diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 9b38066ef9e6f..64a7e7034d4b3 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -4,8 +4,12 @@ */ /* Supress C4996 VS compiler warnings for unlink() */ +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) #define _CRT_SECURE_NO_DEPRECATE +#endif +#if defined(_MSC_VER) && !defined(_CRT_NONSTDC_NO_DEPRECATE) #define _CRT_NONSTDC_NO_DEPRECATE +#endif #include #ifndef _MSC_VER @@ -29,14 +33,13 @@ static SDL_Surface *testSurface = NULL; /* Helper functions for the test cases */ -#define TEST_SURFACE_WIDTH testSurface->w +#define TEST_SURFACE_WIDTH testSurface->w #define TEST_SURFACE_HEIGHT testSurface->h /* Fixture */ /* Create a 32-bit writable surface for blitting tests */ -void -_surfaceSetUp(void *arg) +void _surfaceSetUp(void *arg) { int result; SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; @@ -58,17 +61,16 @@ _surfaceSetUp(void *arg) testSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, referenceSurface->w, referenceSurface->h, 32, rmask, gmask, bmask, amask); SDLTest_AssertCheck(testSurface != NULL, "Check that testSurface is not NULL"); if (testSurface != NULL) { - /* Disable blend mode for target surface */ - result = SDL_SetSurfaceBlendMode(testSurface, blendMode); - SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result); - result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); - SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result); - SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode); + /* Disable blend mode for target surface */ + result = SDL_SetSurfaceBlendMode(testSurface, blendMode); + SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result); + result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); + SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result); + SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode); } } -void -_surfaceTearDown(void *arg) +void _surfaceTearDown(void *arg) { SDL_FreeSurface(referenceSurface); referenceSurface = NULL; @@ -79,15 +81,15 @@ _surfaceTearDown(void *arg) /** * Helper that clears the test surface */ -void _clearTestSurface() +void _clearTestSurface(void) { int ret; Uint32 color; /* Clear surface. */ - color = SDL_MapRGBA( testSurface->format, 0, 0, 0, 0); + color = SDL_MapRGBA(testSurface->format, 0, 0, 0, 0); SDLTest_AssertPass("Call to SDL_MapRGBA()"); - ret = SDL_FillRect( testSurface, NULL, color); + ret = SDL_FillRect(testSurface, NULL, color); SDLTest_AssertPass("Call to SDL_FillRect()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret); } @@ -110,30 +112,34 @@ void _testBlitBlendMode(int mode) /* Check test surface */ SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL"); - if (testSurface == NULL) return; + if (testSurface == NULL) { + return; + } /* Create sample surface */ face = SDLTest_ImageFace(); SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) return; + if (face == NULL) { + return; + } - /* Reset alpha modulation */ + /* Reset alpha modulation */ ret = SDL_SetSurfaceAlphaMod(face, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret); - /* Reset color modulation */ + /* Reset color modulation */ ret = SDL_SetSurfaceColorMod(face, 255, 255, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret); - /* Reset color key */ + /* Reset color key */ ret = SDL_SetColorKey(face, SDL_FALSE, 0); SDLTest_AssertPass("Call to SDL_SetColorKey()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret); /* Clear the test surface */ - _clearTestSurface(); + _clearTestSurface(); /* Target rect size */ rect.w = face->w; @@ -145,7 +151,7 @@ void _testBlitBlendMode(int mode) /* Optionally set blend mode. */ if (mode >= 0) { - ret = SDL_SetSurfaceBlendMode( face, (SDL_BlendMode)mode ); + ret = SDL_SetSurfaceBlendMode(face, (SDL_BlendMode)mode); SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret); } @@ -155,44 +161,50 @@ void _testBlitBlendMode(int mode) checkFailCount2 = 0; checkFailCount3 = 0; checkFailCount4 = 0; - for (j=0; j <= nj; j+=4) { - for (i=0; i <= ni; i+=4) { - if (mode == -2) { - /* Set color mod. */ - ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j ); - if (ret != 0) checkFailCount2++; - } - else if (mode == -3) { - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i ); - if (ret != 0) checkFailCount3++; - } - else if (mode == -4) { - /* Crazy blending mode magic. */ - nmode = (i/4*j/4) % 4; - if (nmode==0) { - bmode = SDL_BLENDMODE_NONE; - } else if (nmode==1) { - bmode = SDL_BLENDMODE_BLEND; - } else if (nmode==2) { - bmode = SDL_BLENDMODE_ADD; - } else if (nmode==3) { - bmode = SDL_BLENDMODE_MOD; - } else { - /* Should be impossible, but some static checkers are too imprecise and will complain */ - SDLTest_LogError("Invalid: nmode=%d", nmode); - return; + for (j = 0; j <= nj; j += 4) { + for (i = 0; i <= ni; i += 4) { + if (mode == -2) { + /* Set color mod. */ + ret = SDL_SetSurfaceColorMod(face, (255 / nj) * j, (255 / ni) * i, (255 / nj) * j); + if (ret != 0) { + checkFailCount2++; + } + } else if (mode == -3) { + /* Set alpha mod. */ + ret = SDL_SetSurfaceAlphaMod(face, (255 / ni) * i); + if (ret != 0) { + checkFailCount3++; + } + } else if (mode == -4) { + /* Crazy blending mode magic. */ + nmode = (i / 4 * j / 4) % 4; + if (nmode == 0) { + bmode = SDL_BLENDMODE_NONE; + } else if (nmode == 1) { + bmode = SDL_BLENDMODE_BLEND; + } else if (nmode == 2) { + bmode = SDL_BLENDMODE_ADD; + } else if (nmode == 3) { + bmode = SDL_BLENDMODE_MOD; + } else { + /* Should be impossible, but some static checkers are too imprecise and will complain */ + SDLTest_LogError("Invalid: nmode=%d", nmode); + return; + } + ret = SDL_SetSurfaceBlendMode(face, bmode); + if (ret != 0) { + checkFailCount4++; + } } - ret = SDL_SetSurfaceBlendMode( face, bmode ); - if (ret != 0) checkFailCount4++; - } - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface( face, NULL, testSurface, &rect ); - if (ret != 0) checkFailCount1++; - } + /* Blitting. */ + rect.x = i; + rect.y = j; + ret = SDL_BlitSurface(face, NULL, testSurface, &rect); + if (ret != 0) { + checkFailCount1++; + } + } } SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2); @@ -205,8 +217,7 @@ void _testBlitBlendMode(int mode) } /* Helper to check that a file exists */ -void -_AssertFileExist(const char *filename) +void _AssertFileExist(const char *filename) { struct stat st; int ret = stat(filename, &st); @@ -214,14 +225,12 @@ _AssertFileExist(const char *filename) SDLTest_AssertCheck(ret == 0, "Verify file '%s' exists", filename); } - /* Test case functions */ /** * @brief Tests sprite saving and loading */ -int -surface_testSaveLoadBitmap(void *arg) +int surface_testSaveLoadBitmap(void *arg) { int ret; const char *sampleFilename = "testSaveLoadBitmap.bmp"; @@ -231,7 +240,9 @@ surface_testSaveLoadBitmap(void *arg) /* Create sample surface */ face = SDLTest_ImageFace(); SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) return TEST_ABORTED; + if (face == NULL) { + return TEST_ABORTED; + } /* Delete test file; ignore errors */ unlink(sampleFilename); @@ -266,8 +277,7 @@ surface_testSaveLoadBitmap(void *arg) /* ! * Tests surface conversion. */ -int -surface_testSurfaceConversion(void *arg) +int surface_testSurfaceConversion(void *arg) { SDL_Surface *rface = NULL, *face = NULL; int ret = 0; @@ -275,14 +285,15 @@ surface_testSurfaceConversion(void *arg) /* Create sample surface */ face = SDLTest_ImageFace(); SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) + if (face == NULL) { return TEST_ABORTED; + } /* Set transparent pixel as the pixel at (0,0) */ if (face->format->palette) { - ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); - SDLTest_AssertPass("Call to SDL_SetColorKey()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); + ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *)face->pixels); + SDLTest_AssertPass("Call to SDL_SetColorKey()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); } /* Convert to 32 bit to compare. */ @@ -291,7 +302,7 @@ surface_testSurfaceConversion(void *arg) SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL"); /* Compare surface. */ - ret = SDLTest_CompareSurfaces( rface, face, 0 ); + ret = SDLTest_CompareSurfaces(rface, face, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); /* Clean up. */ @@ -303,12 +314,10 @@ surface_testSurfaceConversion(void *arg) return TEST_COMPLETED; } - /* ! * Tests surface conversion across all pixel formats. */ -int -surface_testCompleteSurfaceConversion(void *arg) +int surface_testCompleteSurfaceConversion(void *arg) { Uint32 pixel_formats[] = { SDL_PIXELFORMAT_INDEX8, @@ -337,7 +346,9 @@ surface_testCompleteSurfaceConversion(void *arg) SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGRA8888, +#if 0 /* We aren't testing HDR10 colorspace conversion */ SDL_PIXELFORMAT_ARGB2101010, +#endif }; SDL_Surface *face = NULL, *cvt1, *cvt2, *final; SDL_PixelFormat *fmt1, *fmt2; @@ -346,18 +357,19 @@ surface_testCompleteSurfaceConversion(void *arg) /* Create sample surface */ face = SDLTest_ImageFace(); SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) + if (face == NULL) { return TEST_ABORTED; + } /* Set transparent pixel as the pixel at (0,0) */ if (face->format->palette) { - ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels); - SDLTest_AssertPass("Call to SDL_SetColorKey()"); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); + ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *)face->pixels); + SDLTest_AssertPass("Call to SDL_SetColorKey()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret); } - for ( i = 0; i < SDL_arraysize(pixel_formats); ++i ) { - for ( j = 0; j < SDL_arraysize(pixel_formats); ++j ) { + for (i = 0; i < SDL_arraysize(pixel_formats); ++i) { + for (j = 0; j < SDL_arraysize(pixel_formats); ++j) { fmt1 = SDL_AllocFormat(pixel_formats[i]); SDL_assert(fmt1 != NULL); cvt1 = SDL_ConvertSurface(face, fmt1, 0); @@ -376,7 +388,7 @@ surface_testCompleteSurfaceConversion(void *arg) SDL_assert(final != NULL); /* Compare surface. */ - ret = SDLTest_CompareSurfaces( face, final, 0 ); + ret = SDLTest_CompareSurfaces(face, final, 0); SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); SDL_FreeSurface(final); } @@ -389,17 +401,15 @@ surface_testCompleteSurfaceConversion(void *arg) } /* Clean up. */ - SDL_FreeSurface( face ); + SDL_FreeSurface(face); return TEST_COMPLETED; } - /** * @brief Tests sprite loading. A failure case. */ -int -surface_testLoadFailure(void *arg) +int surface_testLoadFailure(void *arg) { SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp"); SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp"); @@ -410,191 +420,181 @@ surface_testLoadFailure(void *arg) /** * @brief Tests some blitting routines. */ -int -surface_testBlit(void *arg) +int surface_testBlit(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Basic blitting */ - _testBlitBlendMode(-1); + /* Basic blitting */ + _testBlitBlendMode(-1); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlit(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlit(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some blitting routines with color mod */ -int -surface_testBlitColorMod(void *arg) +int surface_testBlitColorMod(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Basic blitting with color mod */ - _testBlitBlendMode(-2); + /* Basic blitting with color mod */ + _testBlitBlendMode(-2); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitColor(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitColor(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some blitting routines with alpha mod */ -int -surface_testBlitAlphaMod(void *arg) +int surface_testBlitAlphaMod(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Basic blitting with alpha mod */ - _testBlitBlendMode(-3); + /* Basic blitting with alpha mod */ + _testBlitBlendMode(-3); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitAlpha(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitAlpha(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests some more blitting routines. */ -int -surface_testBlitBlendNone(void *arg) +int surface_testBlitBlendNone(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Basic blitting */ - _testBlitBlendMode(SDL_BLENDMODE_NONE); + /* Basic blitting */ + _testBlitBlendMode(SDL_BLENDMODE_NONE); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendNone(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendNone(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some more blitting routines. */ -int -surface_testBlitBlendBlend(void *arg) +int surface_testBlitBlendBlend(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Blend blitting */ - _testBlitBlendMode(SDL_BLENDMODE_BLEND); + /* Blend blitting */ + _testBlitBlendMode(SDL_BLENDMODE_BLEND); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlend(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlend(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some more blitting routines. */ -int -surface_testBlitBlendAdd(void *arg) +int surface_testBlitBlendAdd(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Add blitting */ - _testBlitBlendMode(SDL_BLENDMODE_ADD); + /* Add blitting */ + _testBlitBlendMode(SDL_BLENDMODE_ADD); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendAdd(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendAdd(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some more blitting routines. */ -int -surface_testBlitBlendMod(void *arg) +int surface_testBlitBlendMod(void *arg) { - int ret; - SDL_Surface *compareSurface; + int ret; + SDL_Surface *compareSurface; - /* Mod blitting */ - _testBlitBlendMode(SDL_BLENDMODE_MOD); + /* Mod blitting */ + _testBlitBlendMode(SDL_BLENDMODE_MOD); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendMod(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendMod(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Clean up. */ + SDL_FreeSurface(compareSurface); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests some more blitting routines with loop */ -int -surface_testBlitBlendLoop(void *arg) { - - int ret; - SDL_Surface *compareSurface; +int surface_testBlitBlendLoop(void *arg) +{ - /* All blitting modes */ - _testBlitBlendMode(-4); + int ret; + SDL_Surface *compareSurface; - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendAll(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + /* All blitting modes */ + _testBlitBlendMode(-4); - /* Clean up. */ - SDL_FreeSurface(compareSurface); + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendAll(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - return TEST_COMPLETED; + /* Clean up. */ + SDL_FreeSurface(compareSurface); + return TEST_COMPLETED; } -int -surface_testOverflow(void *arg) +int surface_testOverflow(void *arg) { char buf[1024]; const char *expectedError; @@ -670,6 +670,34 @@ surface_testOverflow(void *arg) surface != NULL ? "(success)" : SDL_GetError()); SDL_FreeSurface(surface); + /* SDL_PIXELFORMAT_INDEX2* needs 1 byte per 4 pixels. */ + surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 12, 1, 2, 3, SDL_PIXELFORMAT_INDEX2LSB); + SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", + surface != NULL ? "(success)" : SDL_GetError()); + SDL_FreeSurface(surface); + surface = SDL_CreateRGBSurfaceFrom(buf, 12, 1, 2, 3, 0, 0, 0, 0); + SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", + surface != NULL ? "(success)" : SDL_GetError()); + SDL_FreeSurface(surface); + + surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 13, 1, 2, 3, SDL_PIXELFORMAT_INDEX2LSB); + SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp (%d)", surface ? surface->pitch : 0); + SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, + "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); + surface = SDL_CreateRGBSurfaceFrom(buf, 13, 1, 2, 3, 0, 0, 0, 0); + SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); + SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, + "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); + + surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 13, 1, 2, 4, SDL_PIXELFORMAT_INDEX2LSB); + SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", + surface != NULL ? "(success)" : SDL_GetError()); + SDL_FreeSurface(surface); + surface = SDL_CreateRGBSurfaceFrom(buf, 13, 1, 2, 4, 0, 0, 0, 0); + SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", + surface != NULL ? "(success)" : SDL_GetError()); + SDL_FreeSurface(surface); + /* SDL_PIXELFORMAT_INDEX1* needs 1 byte per 8 pixels. */ surface = SDL_CreateRGBSurfaceWithFormatFrom(buf, 16, 1, 1, 2, SDL_PIXELFORMAT_INDEX1LSB); SDLTest_AssertCheck(surface != NULL, "16px * 1 bit per px fits in 2 bytes: %s", @@ -738,82 +766,157 @@ surface_testOverflow(void *arg) SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - if (sizeof (size_t) == 4 && sizeof (int) >= 4) { + if (sizeof(size_t) == 4 && sizeof(int) >= 4) { + SDL_ClearError(); expectedError = "Out of memory"; - surface = SDL_CreateRGBSurfaceWithFormat(0, SDL_MAX_SINT32, 1, 8, SDL_PIXELFORMAT_INDEX8); + /* 0x5555'5555 * 3bpp = 0xffff'ffff which fits in size_t, but adding + * alignment padding makes it overflow */ + surface = SDL_CreateRGBSurfaceWithFormat(0, 0x55555555, 1, 24, SDL_PIXELFORMAT_RGB24); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width + alignment"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateRGBSurfaceWithFormat(0, SDL_MAX_SINT32 / 2, 1, 32, SDL_PIXELFORMAT_ARGB8888); + SDL_ClearError(); + /* 0x4000'0000 * 4bpp = 0x1'0000'0000 which (just) overflows */ + surface = SDL_CreateRGBSurfaceWithFormat(0, 0x40000000, 1, 32, SDL_PIXELFORMAT_ARGB8888); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * bytes per pixel"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); + SDL_ClearError(); surface = SDL_CreateRGBSurfaceWithFormat(0, (1 << 29) - 1, (1 << 29) - 1, 8, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * height"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); + SDL_ClearError(); surface = SDL_CreateRGBSurfaceWithFormat(0, (1 << 15) + 1, (1 << 15) + 1, 32, SDL_PIXELFORMAT_ARGB8888); SDLTest_AssertCheck(surface == NULL, "Should detect overflow in width * height * bytes per pixel"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - } - else { + } else { SDLTest_Log("Can't easily overflow size_t on this platform"); } return TEST_COMPLETED; } +static int surface_testSetGetClipRect(void *args) +{ + const struct { + SDL_Rect r; + SDL_bool clipsetval; + SDL_bool cmpval; + } rect_list[] = { + { { 0, 0, 0, 0}, SDL_FALSE, SDL_TRUE}, + { { 2, 2, 0, 0}, SDL_FALSE, SDL_TRUE}, + { { 2, 2, 5, 1}, SDL_TRUE, SDL_TRUE}, + { { 6, 5, 10, 3}, SDL_TRUE, SDL_FALSE}, + { { 0, 0, 10, 10}, SDL_TRUE, SDL_TRUE}, + { { 0, 0, -10, 10}, SDL_FALSE, SDL_TRUE}, + { { 0, 0, -10, -10}, SDL_FALSE, SDL_TRUE}, + { { -10, -10, 10, 10}, SDL_FALSE, SDL_FALSE}, + { { 10, -10, 10, 10}, SDL_FALSE, SDL_FALSE}, + { { 10, 10, 10, 10}, SDL_TRUE, SDL_FALSE} + }; + SDL_Surface *s; + SDL_Rect r; + int i; + + SDLTest_AssertPass("About to call SDL_CreateRGBSurface(0, 15, 15, 32, 0, 0, 0, 0)"); + s = SDL_CreateRGBSurface(0, 15, 15, 32, 0, 0, 0, 0); + SDLTest_AssertCheck(s != NULL, "SDL_CreateRGBSurface returned non-null surface"); + SDL_zero(r); + SDL_GetClipRect(s, &r); + SDLTest_AssertCheck(r.x == 0 && r.y == 0 && r.w == 15 && r.h == 15, + "SDL_GetClipRect of just-created surface. Got {%d, %d, %d, %d}. (Expected {%d, %d, %d, %d})", + r.x, r.y, r.w, r.h, 0, 0, 15, 15); + + for (i = 0; i < SDL_arraysize(rect_list); i++) { + SDL_bool b; + const SDL_Rect *r_in = &rect_list[i].r; + SDL_Rect r_out; + + SDLTest_AssertPass("About to do SDL_SetClipRect({%d, %d, %d, %d})", r_in->x, r_in->y, r_in->w, r_in->h); + b = SDL_SetClipRect(s, r_in); + SDLTest_AssertCheck(b == rect_list[i].clipsetval, "SDL_SetClipRect returned %d (expected %d)", b, rect_list[i].clipsetval); + SDL_zero(r_out); + SDL_GetClipRect(s, &r_out); + SDLTest_AssertPass("SDL_GetClipRect returned {%d, %d, %d, %d}", r_out.x, r_out.y, r_out.w, r_out.h); + b = r_out.x == r_in->x && r_out.y == r_in->y && r_out.w == r_in->w && r_out.h == r_in->h; + SDLTest_AssertCheck(b == rect_list[i].cmpval, "Current clipping rect is identical to input clipping rect: %d (expected %d)", + b, rect_list[i].cmpval); + } + SDL_FreeSurface(s); + return TEST_COMPLETED; +}; + /* ================= Test References ================== */ /* Surface test cases */ -static const SDLTest_TestCaseReference surfaceTest1 = - { (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest1 = { + (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest2 = - { (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest2 = { + (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest3 = - { (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest3 = { + (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest4 = - { (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest4 = { + (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest5 = - { (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest5 = { + (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest6 = - { (SDLTest_TestCaseFp)surface_testCompleteSurfaceConversion, "surface_testCompleteSurfaceConversion", "Tests surface conversion across all pixel formats", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest6 = { + (SDLTest_TestCaseFp)surface_testCompleteSurfaceConversion, "surface_testCompleteSurfaceConversion", "Tests surface conversion across all pixel formats", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest7 = - { (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest7 = { + (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTest8 = - { (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest8 = { + (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference surfaceTest9 = - { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blitting routines with various blending modes", TEST_DISABLED}; +static const SDLTest_TestCaseReference surfaceTest9 = { + (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blitting routines with various blending modes", TEST_DISABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference surfaceTest10 = - { (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED}; +static const SDLTest_TestCaseReference surfaceTest10 = { + (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED +}; /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference surfaceTest11 = - { (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED}; +static const SDLTest_TestCaseReference surfaceTest11 = { + (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED +}; -static const SDLTest_TestCaseReference surfaceTest12 = - { (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTest12 = { + (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED +}; -static const SDLTest_TestCaseReference surfaceTestOverflow = - { surface_testOverflow, "surface_testOverflow", "Test overflow detection.", TEST_ENABLED}; +static const SDLTest_TestCaseReference surfaceTestOverflow = { + surface_testOverflow, "surface_testOverflow", "Test overflow detection.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference surfaceTestSetGetClipRect = { + surface_testSetGetClipRect, "surface_testSetGetClipRect", "Test SDL_(Set|Get)ClipRect.", TEST_ENABLED +}; /* Sequence of Surface test cases */ -static const SDLTest_TestCaseReference *surfaceTests[] = { +static const SDLTest_TestCaseReference *surfaceTests[] = { &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, - &surfaceTest11, &surfaceTest12, &surfaceTestOverflow, NULL + &surfaceTest11, &surfaceTest12, &surfaceTestOverflow, + &surfaceTestSetGetClipRect, + NULL }; /* Surface test suite (global) */ diff --git a/test/testautomation_syswm.c b/test/testautomation_syswm.c index d9fd982b37a88..f636e15185217 100644 --- a/test/testautomation_syswm.c +++ b/test/testautomation_syswm.c @@ -13,19 +13,18 @@ /** * @brief Call to SDL_GetWindowWMInfo */ -int -syswm_getWindowWMInfo(void *arg) +int syswm_getWindowWMInfo(void *arg) { SDL_bool result; SDL_Window *window; SDL_SysWMinfo info; - window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN); - SDLTest_AssertPass("Call to SDL_CreateWindow()"); - SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL"); - if (window == NULL) { - return TEST_ABORTED; - } + window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN); + SDLTest_AssertPass("Call to SDL_CreateWindow()"); + SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL"); + if (window == NULL) { + return TEST_ABORTED; + } /* Initialize info structure with SDL version info */ SDL_VERSION(&info.version); @@ -35,20 +34,21 @@ syswm_getWindowWMInfo(void *arg) SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()"); SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information"); - SDL_DestroyWindow(window); - SDLTest_AssertPass("Call to SDL_DestroyWindow()"); + SDL_DestroyWindow(window); + SDLTest_AssertPass("Call to SDL_DestroyWindow()"); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* ================= Test References ================== */ /* SysWM test cases */ -static const SDLTest_TestCaseReference syswmTest1 = - { (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED }; +static const SDLTest_TestCaseReference syswmTest1 = { + (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED +}; /* Sequence of SysWM test cases */ -static const SDLTest_TestCaseReference *syswmTests[] = { +static const SDLTest_TestCaseReference *syswmTests[] = { &syswmTest1, NULL }; diff --git a/test/testautomation_timer.c b/test/testautomation_timer.c index 3cb160ae140ed..a7160e76c05e7 100644 --- a/test/testautomation_timer.c +++ b/test/testautomation_timer.c @@ -18,16 +18,15 @@ int _timerCallbackCalled = 0; /* Fixture */ -void -_timerSetUp(void *arg) +void _timerSetUp(void *arg) { /* Start SDL timer subsystem */ - int ret = SDL_InitSubSystem( SDL_INIT_TIMER ); - SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_TIMER)"); - SDLTest_AssertCheck(ret==0, "Check result from SDL_InitSubSystem(SDL_INIT_TIMER)"); + int ret = SDL_InitSubSystem(SDL_INIT_TIMER); + SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_TIMER)"); + SDLTest_AssertCheck(ret == 0, "Check result from SDL_InitSubSystem(SDL_INIT_TIMER)"); if (ret != 0) { - SDLTest_LogError("%s", SDL_GetError()); - } + SDLTest_LogError("%s", SDL_GetError()); + } } /* Test case functions */ @@ -35,160 +34,163 @@ _timerSetUp(void *arg) /** * @brief Call to SDL_GetPerformanceCounter */ -int -timer_getPerformanceCounter(void *arg) +int timer_getPerformanceCounter(void *arg) { - Uint64 result; + Uint64 result; - result = SDL_GetPerformanceCounter(); - SDLTest_AssertPass("Call to SDL_GetPerformanceCounter()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); + result = SDL_GetPerformanceCounter(); + SDLTest_AssertPass("Call to SDL_GetPerformanceCounter()"); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Call to SDL_GetPerformanceFrequency */ -int -timer_getPerformanceFrequency(void *arg) +int timer_getPerformanceFrequency(void *arg) { - Uint64 result; + Uint64 result; - result = SDL_GetPerformanceFrequency(); - SDLTest_AssertPass("Call to SDL_GetPerformanceFrequency()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %"SDL_PRIu64, result); + result = SDL_GetPerformanceFrequency(); + SDLTest_AssertPass("Call to SDL_GetPerformanceFrequency()"); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Call to SDL_Delay and SDL_GetTicks */ -int -timer_delayAndGetTicks(void *arg) +int timer_delayAndGetTicks(void *arg) { - const Uint32 testDelay = 100; - const Uint32 marginOfError = 25; - Uint32 result; - Uint32 result2; - Uint32 difference; - - /* Zero delay */ - SDL_Delay(0); - SDLTest_AssertPass("Call to SDL_Delay(0)"); - - /* Non-zero delay */ - SDL_Delay(1); - SDLTest_AssertPass("Call to SDL_Delay(1)"); - - SDL_Delay(SDLTest_RandomIntegerInRange(5, 15)); - SDLTest_AssertPass("Call to SDL_Delay()"); - - /* Get ticks count - should be non-zero by now */ - result = SDL_GetTicks(); - SDLTest_AssertPass("Call to SDL_GetTicks()"); - SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result); - - /* Delay a bit longer and measure ticks and verify difference */ - SDL_Delay(testDelay); - SDLTest_AssertPass("Call to SDL_Delay(%" SDL_PRIu32 ")", testDelay); - result2 = SDL_GetTicks(); - SDLTest_AssertPass("Call to SDL_GetTicks()"); - SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result2); - difference = result2 - result; - SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay - marginOfError, difference); - SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay + marginOfError, difference); - - return TEST_COMPLETED; + const Uint32 testDelay = 100; + const Uint32 marginOfError = 25; + Uint32 result; + Uint32 result2; + Uint32 difference; + + /* Zero delay */ + SDL_Delay(0); + SDLTest_AssertPass("Call to SDL_Delay(0)"); + + /* Non-zero delay */ + SDL_Delay(1); + SDLTest_AssertPass("Call to SDL_Delay(1)"); + + SDL_Delay(SDLTest_RandomIntegerInRange(5, 15)); + SDLTest_AssertPass("Call to SDL_Delay()"); + + /* Get ticks count - should be non-zero by now */ + result = SDL_GetTicks(); + SDLTest_AssertPass("Call to SDL_GetTicks()"); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result); + + /* Delay a bit longer and measure ticks and verify difference */ + SDL_Delay(testDelay); + SDLTest_AssertPass("Call to SDL_Delay(%" SDL_PRIu32 ")", testDelay); + result2 = SDL_GetTicks(); + SDLTest_AssertPass("Call to SDL_GetTicks()"); + SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu32, result2); + difference = result2 - result; + SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay - marginOfError, difference); +#if 0 + /* Disabled because this might fail on non-interactive systems. Moved to testtimer. */ + SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%" SDL_PRIu32 ", got: %" SDL_PRIu32, testDelay + marginOfError, difference); +#endif + + return TEST_COMPLETED; } /* Test callback */ Uint32 SDLCALL _timerTestCallback(Uint32 interval, void *param) { - _timerCallbackCalled = 1; + _timerCallbackCalled = 1; - if (_paramCheck != 0) { - SDLTest_AssertCheck(param != NULL, "Check param pointer, expected: non-NULL, got: %s", (param != NULL) ? "non-NULL" : "NULL"); - if (param != NULL) { - SDLTest_AssertCheck(*(int *)param == _paramValue, "Check param value, expected: %i, got: %i", _paramValue, *(int *)param); - } - } + if (_paramCheck != 0) { + SDLTest_AssertCheck(param != NULL, "Check param pointer, expected: non-NULL, got: %s", (param != NULL) ? "non-NULL" : "NULL"); + if (param != NULL) { + SDLTest_AssertCheck(*(int *)param == _paramValue, "Check param value, expected: %i, got: %i", _paramValue, *(int *)param); + } + } - return 0; + return 0; } /** * @brief Call to SDL_AddTimer and SDL_RemoveTimer */ -int -timer_addRemoveTimer(void *arg) +int timer_addRemoveTimer(void *arg) { - SDL_TimerID id; - SDL_bool result; - int param; - - /* Reset state */ - _paramCheck = 0; - _timerCallbackCalled = 0; - - /* Set timer with a long delay */ - id = SDL_AddTimer(10000, _timerTestCallback, NULL); - SDLTest_AssertPass("Call to SDL_AddTimer(10000,...)"); - SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); - - /* Remove timer again and check that callback was not called */ - result = SDL_RemoveTimer(id); - SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected: %i, got: %i", SDL_TRUE, result); - SDLTest_AssertCheck(_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", _timerCallbackCalled); - - /* Try to remove timer again (should be a NOOP) */ - result = SDL_RemoveTimer(id); - SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); - - /* Reset state */ - param = SDLTest_RandomIntegerInRange(-1024, 1024); - _paramCheck = 1; - _paramValue = param; - _timerCallbackCalled = 0; - - /* Set timer with a short delay */ - id = SDL_AddTimer(10, _timerTestCallback, (void *)¶m); - SDLTest_AssertPass("Call to SDL_AddTimer(10, param)"); - SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); - - /* Wait to let timer trigger callback */ - SDL_Delay(100); - SDLTest_AssertPass("Call to SDL_Delay(100)"); - - /* Remove timer again and check that callback was called */ - result = SDL_RemoveTimer(id); - SDLTest_AssertPass("Call to SDL_RemoveTimer()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); - SDLTest_AssertCheck(_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", _timerCallbackCalled); - - return TEST_COMPLETED; + SDL_TimerID id; + SDL_bool result; + int param; + + /* Reset state */ + _paramCheck = 0; + _timerCallbackCalled = 0; + + /* Set timer with a long delay */ + id = SDL_AddTimer(10000, _timerTestCallback, NULL); + SDLTest_AssertPass("Call to SDL_AddTimer(10000,...)"); + SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); + + /* Remove timer again and check that callback was not called */ + result = SDL_RemoveTimer(id); + SDLTest_AssertPass("Call to SDL_RemoveTimer()"); + SDLTest_AssertCheck(result == SDL_TRUE, "Check result value, expected: %i, got: %i", SDL_TRUE, result); + SDLTest_AssertCheck(_timerCallbackCalled == 0, "Check callback WAS NOT called, expected: 0, got: %i", _timerCallbackCalled); + + /* Try to remove timer again (should be a NOOP) */ + result = SDL_RemoveTimer(id); + SDLTest_AssertPass("Call to SDL_RemoveTimer()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); + + /* Reset state */ + param = SDLTest_RandomIntegerInRange(-1024, 1024); + _paramCheck = 1; + _paramValue = param; + _timerCallbackCalled = 0; + + /* Set timer with a short delay */ + id = SDL_AddTimer(10, _timerTestCallback, (void *)¶m); + SDLTest_AssertPass("Call to SDL_AddTimer(10, param)"); + SDLTest_AssertCheck(id > 0, "Check result value, expected: >0, got: %d", id); + + /* Wait to let timer trigger callback */ + SDL_Delay(100); + SDLTest_AssertPass("Call to SDL_Delay(100)"); + + /* Remove timer again and check that callback was called */ + result = SDL_RemoveTimer(id); + SDLTest_AssertPass("Call to SDL_RemoveTimer()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Check result value, expected: %i, got: %i", SDL_FALSE, result); + SDLTest_AssertCheck(_timerCallbackCalled == 1, "Check callback WAS called, expected: 1, got: %i", _timerCallbackCalled); + + return TEST_COMPLETED; } /* ================= Test References ================== */ /* Timer test cases */ -static const SDLTest_TestCaseReference timerTest1 = - { (SDLTest_TestCaseFp)timer_getPerformanceCounter, "timer_getPerformanceCounter", "Call to SDL_GetPerformanceCounter", TEST_ENABLED }; +static const SDLTest_TestCaseReference timerTest1 = { + (SDLTest_TestCaseFp)timer_getPerformanceCounter, "timer_getPerformanceCounter", "Call to SDL_GetPerformanceCounter", TEST_ENABLED +}; -static const SDLTest_TestCaseReference timerTest2 = - { (SDLTest_TestCaseFp)timer_getPerformanceFrequency, "timer_getPerformanceFrequency", "Call to SDL_GetPerformanceFrequency", TEST_ENABLED }; +static const SDLTest_TestCaseReference timerTest2 = { + (SDLTest_TestCaseFp)timer_getPerformanceFrequency, "timer_getPerformanceFrequency", "Call to SDL_GetPerformanceFrequency", TEST_ENABLED +}; -static const SDLTest_TestCaseReference timerTest3 = - { (SDLTest_TestCaseFp)timer_delayAndGetTicks, "timer_delayAndGetTicks", "Call to SDL_Delay and SDL_GetTicks", TEST_ENABLED }; +static const SDLTest_TestCaseReference timerTest3 = { + (SDLTest_TestCaseFp)timer_delayAndGetTicks, "timer_delayAndGetTicks", "Call to SDL_Delay and SDL_GetTicks", TEST_ENABLED +}; -static const SDLTest_TestCaseReference timerTest4 = - { (SDLTest_TestCaseFp)timer_addRemoveTimer, "timer_addRemoveTimer", "Call to SDL_AddTimer and SDL_RemoveTimer", TEST_ENABLED }; +static const SDLTest_TestCaseReference timerTest4 = { + (SDLTest_TestCaseFp)timer_addRemoveTimer, "timer_addRemoveTimer", "Call to SDL_AddTimer and SDL_RemoveTimer", TEST_ENABLED +}; /* Sequence of Timer test cases */ -static const SDLTest_TestCaseReference *timerTests[] = { +static const SDLTest_TestCaseReference *timerTests[] = { &timerTest1, &timerTest2, &timerTest3, &timerTest4, NULL }; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 8d248bf8f88ab..421ed8485f71b 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -25,22 +25,52 @@ */ SDL_Window *_createVideoSuiteTestWindow(const char *title) { - SDL_Window* window; - int x, y, w, h; - SDL_WindowFlags flags; + SDL_Window *window; + int x, y, w, h; + SDL_WindowFlags flags; + SDL_bool needs_renderer = SDL_FALSE; + + /* Standard window */ + x = SDLTest_RandomIntegerInRange(1, 100); + y = SDLTest_RandomIntegerInRange(1, 100); + w = SDLTest_RandomIntegerInRange(320, 1024); + h = SDLTest_RandomIntegerInRange(320, 768); + flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS; + + window = SDL_CreateWindow(title, x, y, w, h, flags); + SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); + SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Standard window */ - x = SDLTest_RandomIntegerInRange(1, 100); - y = SDLTest_RandomIntegerInRange(1, 100); - w = SDLTest_RandomIntegerInRange(320, 1024); - h = SDLTest_RandomIntegerInRange(320, 768); - flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS; + /* Wayland and XWayland windows require that a frame be presented before they are fully mapped and visible onscreen. + * This is required for the mouse/keyboard grab tests to pass. + */ + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { + needs_renderer = SDL_TRUE; + } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { + /* Try to detect if the x11 driver is running under XWayland */ + const char *session_type = SDL_getenv("XDG_SESSION_TYPE"); + if (session_type && SDL_strcasecmp(session_type, "wayland") == 0) { + needs_renderer = SDL_TRUE; + } + } - window = SDL_CreateWindow(title, x, y, w, h, flags); - SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + if (needs_renderer) { + SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); + if (renderer) { + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + + /* Some desktops don't display the window immediately after presentation, + * so delay to give the window time to actually appear on the desktop. + */ + SDL_Delay(100); + } else { + SDLTest_Log("Unable to create a renderer, some tests may fail on Wayland/XWayland"); + } + } - return window; + return window; } /* @@ -48,11 +78,11 @@ SDL_Window *_createVideoSuiteTestWindow(const char *title) */ void _destroyVideoSuiteTestWindow(SDL_Window *window) { - if (window != NULL) { - SDL_DestroyWindow(window); - window = NULL; - SDLTest_AssertPass("Call to SDL_DestroyWindow()"); - } + if (window) { + SDL_DestroyWindow(window); + window = NULL; + SDLTest_AssertPass("Call to SDL_DestroyWindow()"); + } } /* Test case functions */ @@ -60,8 +90,7 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window) /** * @brief Enable and disable screensaver while checking state */ -int -video_enableDisableScreensaver(void *arg) +int video_enableDisableScreensaver(void *arg) { SDL_bool initialResult; SDL_bool result; @@ -71,39 +100,39 @@ video_enableDisableScreensaver(void *arg) SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); if (initialResult == SDL_TRUE) { - /* Currently enabled: disable first, then enable again */ + /* Currently enabled: disable first, then enable again */ - /* Disable screensaver and check */ - SDL_DisableScreenSaver(); - SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); + /* Disable screensaver and check */ + SDL_DisableScreenSaver(); + SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); - /* Enable screensaver and check */ - SDL_EnableScreenSaver(); - SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + /* Enable screensaver and check */ + SDL_EnableScreenSaver(); + SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); } else { - /* Currently disabled: enable first, then disable again */ - - /* Enable screensaver and check */ - SDL_EnableScreenSaver(); - SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); - - /* Disable screensaver and check */ - SDL_DisableScreenSaver(); - SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); - result = SDL_IsScreenSaverEnabled(); - SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); - SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); + /* Currently disabled: enable first, then disable again */ + + /* Enable screensaver and check */ + SDL_EnableScreenSaver(); + SDLTest_AssertPass("Call to SDL_EnableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result); + + /* Disable screensaver and check */ + SDL_DisableScreenSaver(); + SDLTest_AssertPass("Call to SDL_DisableScreenSaver()"); + result = SDL_IsScreenSaverEnabled(); + SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()"); + SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result); } return TEST_COMPLETED; @@ -112,402 +141,397 @@ video_enableDisableScreensaver(void *arg) /** * @brief Tests the functionality of the SDL_CreateWindow function using different positions */ -int -video_createWindowVariousPositions(void *arg) +int video_createWindowVariousPositions(void *arg) { - SDL_Window* window; - const char* title = "video_createWindowVariousPositions Test Window"; - int x, y, w, h; - int xVariation, yVariation; - - for (xVariation = 0; xVariation < 6; xVariation++) { - for (yVariation = 0; yVariation < 6; yVariation++) { - switch(xVariation) { - default: - case 0: - /* Zero X Position */ - x = 0; - break; - case 1: - /* Random X position inside screen */ - x = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Random X position outside screen (positive) */ - x = SDLTest_RandomIntegerInRange(10000, 11000); - break; - case 3: - /* Random X position outside screen (negative) */ - x = SDLTest_RandomIntegerInRange(-1000, -100); - break; - case 4: - /* Centered X position */ - x = SDL_WINDOWPOS_CENTERED; - break; - case 5: - /* Undefined X position */ - x = SDL_WINDOWPOS_UNDEFINED; - break; - } - - switch(yVariation) { - default: - case 0: - /* Zero X Position */ - y = 0; - break; - case 1: - /* Random X position inside screen */ - y = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Random X position outside screen (positive) */ - y = SDLTest_RandomIntegerInRange(10000, 11000); - break; - case 3: - /* Random Y position outside screen (negative) */ - y = SDLTest_RandomIntegerInRange(-1000, -100); - break; - case 4: - /* Centered Y position */ - y = SDL_WINDOWPOS_CENTERED; - break; - case 5: - /* Undefined Y position */ - y = SDL_WINDOWPOS_UNDEFINED; - break; - } + SDL_Window *window; + const char *title = "video_createWindowVariousPositions Test Window"; + int x, y, w, h; + int xVariation, yVariation; - w = SDLTest_RandomIntegerInRange(32, 96); - h = SDLTest_RandomIntegerInRange(32, 96); - window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); - SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + for (xVariation = 0; xVariation < 6; xVariation++) { + for (yVariation = 0; yVariation < 6; yVariation++) { + switch (xVariation) { + default: + case 0: + /* Zero X Position */ + x = 0; + break; + case 1: + /* Random X position inside screen */ + x = SDLTest_RandomIntegerInRange(1, 100); + break; + case 2: + /* Random X position outside screen (positive) */ + x = SDLTest_RandomIntegerInRange(10000, 11000); + break; + case 3: + /* Random X position outside screen (negative) */ + x = SDLTest_RandomIntegerInRange(-1000, -100); + break; + case 4: + /* Centered X position */ + x = SDL_WINDOWPOS_CENTERED; + break; + case 5: + /* Undefined X position */ + x = SDL_WINDOWPOS_UNDEFINED; + break; + } + + switch (yVariation) { + default: + case 0: + /* Zero X Position */ + y = 0; + break; + case 1: + /* Random X position inside screen */ + y = SDLTest_RandomIntegerInRange(1, 100); + break; + case 2: + /* Random X position outside screen (positive) */ + y = SDLTest_RandomIntegerInRange(10000, 11000); + break; + case 3: + /* Random Y position outside screen (negative) */ + y = SDLTest_RandomIntegerInRange(-1000, -100); + break; + case 4: + /* Centered Y position */ + y = SDL_WINDOWPOS_CENTERED; + break; + case 5: + /* Undefined Y position */ + y = SDL_WINDOWPOS_UNDEFINED; + break; + } + + w = SDLTest_RandomIntegerInRange(32, 96); + h = SDLTest_RandomIntegerInRange(32, 96); + window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); + SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); + SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); - } - } + /* Clean up */ + _destroyVideoSuiteTestWindow(window); + } + } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests the functionality of the SDL_CreateWindow function using different sizes */ -int -video_createWindowVariousSizes(void *arg) +int video_createWindowVariousSizes(void *arg) { - SDL_Window* window; - const char* title = "video_createWindowVariousSizes Test Window"; - int x, y, w, h; - int wVariation, hVariation; - - x = SDLTest_RandomIntegerInRange(1, 100); - y = SDLTest_RandomIntegerInRange(1, 100); - for (wVariation = 0; wVariation < 3; wVariation++) { - for (hVariation = 0; hVariation < 3; hVariation++) { - switch(wVariation) { - case 0: - /* Width of 1 */ - w = 1; - break; - case 1: - /* Random "normal" width */ - w = SDLTest_RandomIntegerInRange(320, 1920); - break; - case 2: - /* Random "large" width */ - w = SDLTest_RandomIntegerInRange(2048, 4095); - break; - } - - switch(hVariation) { - case 0: - /* Height of 1 */ - h = 1; - break; - case 1: - /* Random "normal" height */ - h = SDLTest_RandomIntegerInRange(320, 1080); - break; - case 2: - /* Random "large" height */ - h = SDLTest_RandomIntegerInRange(2048, 4095); - break; - } - - window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); - SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + SDL_Window *window; + const char *title = "video_createWindowVariousSizes Test Window"; + int x, y, w, h; + int wVariation, hVariation; + + x = SDLTest_RandomIntegerInRange(1, 100); + y = SDLTest_RandomIntegerInRange(1, 100); + for (wVariation = 0; wVariation < 3; wVariation++) { + for (hVariation = 0; hVariation < 3; hVariation++) { + switch (wVariation) { + case 0: + /* Width of 1 */ + w = 1; + break; + case 1: + /* Random "normal" width */ + w = SDLTest_RandomIntegerInRange(320, 1920); + break; + case 2: + /* Random "large" width */ + w = SDLTest_RandomIntegerInRange(2048, 4095); + break; + } + + switch (hVariation) { + case 0: + /* Height of 1 */ + h = 1; + break; + case 1: + /* Random "normal" height */ + h = SDLTest_RandomIntegerInRange(320, 1080); + break; + case 2: + /* Random "large" height */ + h = SDLTest_RandomIntegerInRange(2048, 4095); + break; + } + + window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN); + SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); + SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); - } - } + /* Clean up */ + _destroyVideoSuiteTestWindow(window); + } + } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests the functionality of the SDL_CreateWindow function using different flags */ -int -video_createWindowVariousFlags(void *arg) +int video_createWindowVariousFlags(void *arg) { - SDL_Window* window; - const char* title = "video_createWindowVariousFlags Test Window"; - int x, y, w, h; - int fVariation; - SDL_WindowFlags flags; - - /* Standard window */ - x = SDLTest_RandomIntegerInRange(1, 100); - y = SDLTest_RandomIntegerInRange(1, 100); - w = SDLTest_RandomIntegerInRange(320, 1024); - h = SDLTest_RandomIntegerInRange(320, 768); - - for (fVariation = 0; fVariation < 14; fVariation++) { - switch(fVariation) { - default: - case 0: - flags = SDL_WINDOW_FULLSCREEN; - /* Skip - blanks screen; comment out next line to run test */ - continue; - break; - case 1: - flags = SDL_WINDOW_FULLSCREEN_DESKTOP; - /* Skip - blanks screen; comment out next line to run test */ - continue; - break; - case 2: - flags = SDL_WINDOW_OPENGL; - break; - case 3: - flags = SDL_WINDOW_SHOWN; - break; - case 4: - flags = SDL_WINDOW_HIDDEN; - break; - case 5: - flags = SDL_WINDOW_BORDERLESS; - break; - case 6: - flags = SDL_WINDOW_RESIZABLE; - break; - case 7: - flags = SDL_WINDOW_MINIMIZED; - break; - case 8: - flags = SDL_WINDOW_MAXIMIZED; - break; - case 9: - flags = SDL_WINDOW_MOUSE_GRABBED; - break; - case 10: - flags = SDL_WINDOW_INPUT_FOCUS; - break; - case 11: - flags = SDL_WINDOW_MOUSE_FOCUS; - break; - case 12: - flags = SDL_WINDOW_FOREIGN; - break; - case 13: - flags = SDL_WINDOW_KEYBOARD_GRABBED; - break; - } + SDL_Window *window; + const char *title = "video_createWindowVariousFlags Test Window"; + int x, y, w, h; + int fVariation; + SDL_WindowFlags flags; + + /* Standard window */ + x = SDLTest_RandomIntegerInRange(1, 100); + y = SDLTest_RandomIntegerInRange(1, 100); + w = SDLTest_RandomIntegerInRange(320, 1024); + h = SDLTest_RandomIntegerInRange(320, 768); + + for (fVariation = 0; fVariation < 14; fVariation++) { + switch (fVariation) { + default: + case 0: + flags = SDL_WINDOW_FULLSCREEN; + /* Skip - blanks screen; comment out next line to run test */ + continue; + break; + case 1: + flags = SDL_WINDOW_FULLSCREEN_DESKTOP; + /* Skip - blanks screen; comment out next line to run test */ + continue; + break; + case 2: + flags = SDL_WINDOW_OPENGL; + /* Skip - not every video driver supports OpenGL; comment out next line to run test */ + continue; + break; + case 3: + flags = SDL_WINDOW_SHOWN; + break; + case 4: + flags = SDL_WINDOW_HIDDEN; + break; + case 5: + flags = SDL_WINDOW_BORDERLESS; + break; + case 6: + flags = SDL_WINDOW_RESIZABLE; + break; + case 7: + flags = SDL_WINDOW_MINIMIZED; + break; + case 8: + flags = SDL_WINDOW_MAXIMIZED; + break; + case 9: + flags = SDL_WINDOW_MOUSE_GRABBED; + break; + case 10: + flags = SDL_WINDOW_INPUT_FOCUS; + break; + case 11: + flags = SDL_WINDOW_MOUSE_FOCUS; + break; + case 12: + flags = SDL_WINDOW_FOREIGN; + break; + case 13: + flags = SDL_WINDOW_KEYBOARD_GRABBED; + break; + } - window = SDL_CreateWindow(title, x, y, w, h, flags); - SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + window = SDL_CreateWindow(title, x, y, w, h, flags); + SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags); + SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); - } + /* Clean up */ + _destroyVideoSuiteTestWindow(window); + } - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests the functionality of the SDL_GetWindowFlags function */ -int -video_getWindowFlags(void *arg) +int video_getWindowFlags(void *arg) { - SDL_Window* window; - const char* title = "video_getWindowFlags Test Window"; - SDL_WindowFlags flags; - Uint32 actualFlags; - - /* Reliable flag set always set in test window */ - flags = SDL_WINDOW_SHOWN; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window != NULL) { - actualFlags = SDL_GetWindowFlags(window); - SDLTest_AssertPass("Call to SDL_GetWindowFlags()"); - SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %" SDL_PRIu32, flags, actualFlags); - } + SDL_Window *window; + const char *title = "video_getWindowFlags Test Window"; + SDL_WindowFlags flags; + Uint32 actualFlags; + + /* Reliable flag set always set in test window */ + flags = SDL_WINDOW_SHOWN; + + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (window != NULL) { + actualFlags = SDL_GetWindowFlags(window); + SDLTest_AssertPass("Call to SDL_GetWindowFlags()"); + SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %" SDL_PRIu32, flags, actualFlags); + } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests the functionality of the SDL_GetNumDisplayModes function */ -int -video_getNumDisplayModes(void *arg) +int video_getNumDisplayModes(void *arg) { - int result; - int displayNum; - int i; - - /* Get number of displays */ - displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); - - /* Make call for each display */ - for (i=0; i= 1, "Validate returned value from function; expected: >=1; got: %d", result); - } + int result; + int displayNum; + int i; - return TEST_COMPLETED; + /* Get number of displays */ + displayNum = SDL_GetNumVideoDisplays(); + SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); + + /* Make call for each display */ + for (i = 0; i < displayNum; i++) { + result = SDL_GetNumDisplayModes(i); + SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d)", i); + SDLTest_AssertCheck(result >= 1, "Validate returned value from function; expected: >=1; got: %d", result); + } + + return TEST_COMPLETED; } /** * @brief Tests negative call to SDL_GetNumDisplayModes function */ -int -video_getNumDisplayModesNegative(void *arg) +int video_getNumDisplayModesNegative(void *arg) { - int result; - int displayNum; - int displayIndex; - - /* Get number of displays */ - displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); - - /* Invalid boundary values */ - displayIndex = SDLTest_RandomSint32BoundaryValue(0, displayNum, SDL_FALSE); - result = SDL_GetNumDisplayModes(displayIndex); - SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/boundary)", displayIndex); - SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); - - /* Large (out-of-bounds) display index */ - displayIndex = SDLTest_RandomIntegerInRange(-2000, -1000); - result = SDL_GetNumDisplayModes(displayIndex); - SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/large negative)", displayIndex); - SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); - - displayIndex = SDLTest_RandomIntegerInRange(1000, 2000); - result = SDL_GetNumDisplayModes(displayIndex); - SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/large positive)", displayIndex); - SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); + int result; + int displayNum; + int displayIndex; - return TEST_COMPLETED; + /* Get number of displays */ + displayNum = SDL_GetNumVideoDisplays(); + SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); + + /* Invalid boundary values */ + displayIndex = SDLTest_RandomSint32BoundaryValue(0, displayNum, SDL_FALSE); + result = SDL_GetNumDisplayModes(displayIndex); + SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/boundary)", displayIndex); + SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); + + /* Large (out-of-bounds) display index */ + displayIndex = SDLTest_RandomIntegerInRange(-2000, -1000); + result = SDL_GetNumDisplayModes(displayIndex); + SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/large negative)", displayIndex); + SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); + + displayIndex = SDLTest_RandomIntegerInRange(1000, 2000); + result = SDL_GetNumDisplayModes(displayIndex); + SDLTest_AssertPass("Call to SDL_GetNumDisplayModes(%d=out-of-bounds/large positive)", displayIndex); + SDLTest_AssertCheck(result < 0, "Validate returned value from function; expected: <0; got: %d", result); + + return TEST_COMPLETED; } /** * @brief Tests the functionality of the SDL_GetClosestDisplayMode function against current resolution */ -int -video_getClosestDisplayModeCurrentResolution(void *arg) +int video_getClosestDisplayModeCurrentResolution(void *arg) { - int result; - SDL_DisplayMode current; - SDL_DisplayMode target; - SDL_DisplayMode closest; - SDL_DisplayMode* dResult; - int displayNum; - int i; - int variation; - - /* Get number of displays */ - displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); - - /* Make calls for each display */ - for (i=0; iw, "Verify return value matches assigned value; expected: %d, got: %d", closest.w, dResult->w); - SDLTest_AssertCheck(closest.h == dResult->h, "Verify return value matches assigned value; expected: %d, got: %d", closest.h, dResult->h); + /* Set the desired resolution equals to current resolution */ + target.w = current.w; + target.h = current.h; + for (variation = 0; variation < 8; variation++) { + /* Vary constraints on other query parameters */ + target.format = (variation & 1) ? current.format : 0; + target.refresh_rate = (variation & 2) ? current.refresh_rate : 0; + target.driverdata = (variation & 4) ? current.driverdata : 0; + + /* Make call */ + dResult = SDL_GetClosestDisplayMode(i, &target, &closest); + SDLTest_AssertPass("Call to SDL_GetClosestDisplayMode(target=current/variation%d)", variation); + SDLTest_Assert(dResult != NULL, "Verify returned value is not NULL"); + + /* Check that one gets the current resolution back again */ + SDLTest_AssertCheck(closest.w == current.w, "Verify returned width matches current width; expected: %d, got: %d", current.w, closest.w); + SDLTest_AssertCheck(closest.h == current.h, "Verify returned height matches current height; expected: %d, got: %d", current.h, closest.h); + /* NOLINTBEGIN(clang-analyzer-core.NullDereference): Checked earlier for NULL */ + SDLTest_AssertCheck(closest.w == dResult->w, "Verify return value matches assigned value; expected: %d, got: %d", closest.w, dResult->w); + SDLTest_AssertCheck(closest.h == dResult->h, "Verify return value matches assigned value; expected: %d, got: %d", closest.h, dResult->h); + /* NOLINTEND(clang-analyzer-core.NullDereference) */ + } } - } - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests the functionality of the SDL_GetClosestDisplayMode function against random resolution */ -int -video_getClosestDisplayModeRandomResolution(void *arg) +int video_getClosestDisplayModeRandomResolution(void *arg) { - SDL_DisplayMode target; - SDL_DisplayMode closest; - int displayNum; - int i; - int variation; - - /* Get number of displays */ - displayNum = SDL_GetNumVideoDisplays(); - SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()"); - - /* Make calls for each display */ - for (i=0; i 0, "Validate mode.w content; expected: >0, got: %d", mode.w); - SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h); - SDLTest_AssertCheck(mode.refresh_rate > 0, "Validate mode.refresh_rate content; expected: >0, got: %d", mode.refresh_rate); - } + /* Invalidate part of the mode content so we can check values later */ + mode.w = -1; + mode.h = -1; + mode.refresh_rate = -1; + + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (window) { + result = SDL_GetWindowDisplayMode(window, &mode); + SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode()"); + SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result); + SDLTest_AssertCheck(mode.w > 0, "Validate mode.w content; expected: >0, got: %d", mode.w); + SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h); + SDLTest_AssertCheck(mode.refresh_rate > 0, "Validate mode.refresh_rate content; expected: >0, got: %d", mode.refresh_rate); + } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - return TEST_COMPLETED; + return TEST_COMPLETED; } /* Helper function that checks for an 'Invalid window' error */ -void _checkInvalidWindowError() +void _checkInvalidWindowError(void) { - const char *invalidWindowError = "Invalid window"; - char *lastError; - - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); - if (lastError != NULL) { - SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - invalidWindowError, - lastError); - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - } + const char *invalidWindowError = "Invalid window"; + char *lastError; + + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); + if (lastError != NULL) { + SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + invalidWindowError, + lastError); + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + } } /** @@ -624,43 +647,42 @@ void _checkInvalidWindowError() * * @sa http://wiki.libsdl.org/SDL_GetWindowDisplayMode */ -int -video_getWindowDisplayModeNegative(void *arg) +int video_getWindowDisplayModeNegative(void *arg) { - const char *expectedError = "Parameter 'mode' is invalid"; - char *lastError; - SDL_Window* window; - const char* title = "video_getWindowDisplayModeNegative Test Window"; - SDL_DisplayMode mode; - int result; + const char *expectedError = "Parameter 'mode' is invalid"; + char *lastError; + SDL_Window *window; + const char *title = "video_getWindowDisplayModeNegative Test Window"; + SDL_DisplayMode mode; + int result; - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window != NULL) { - result = SDL_GetWindowDisplayMode(window, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(...,mode=NULL)"); - SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %d", result); - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); - if (lastError != NULL) { - SDLTest_AssertCheck(SDL_strcmp(lastError, expectedError) == 0, - "SDL_GetError(): expected message '%s', was message: '%s'", - expectedError, - lastError); - } - } + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (window != NULL) { + result = SDL_GetWindowDisplayMode(window, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(...,mode=NULL)"); + SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %d", result); + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); + if (lastError != NULL) { + SDLTest_AssertCheck(SDL_strcmp(lastError, expectedError) == 0, + "SDL_GetError(): expected message '%s', was message: '%s'", + expectedError, + lastError); + } + } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Call against invalid window */ - result = SDL_GetWindowDisplayMode(NULL, &mode); - SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(window=NULL,...)"); - SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %d", result); - _checkInvalidWindowError(); + /* Call against invalid window */ + result = SDL_GetWindowDisplayMode(NULL, &mode); + SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(window=NULL,...)"); + SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %d", result); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -680,7 +702,7 @@ video_getWindowGammaRamp(void *arg) /* Call against new test window */ window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; + if (!window) return TEST_ABORTED; /* Retrieve no channel */ result = SDL_GetWindowGammaRamp(window, NULL, NULL, NULL); @@ -750,75 +772,73 @@ video_getWindowGammaRampNegative(void *arg) } /* Helper for setting and checking the window mouse grab state */ -void -_setAndCheckWindowMouseGrabState(SDL_Window* window, SDL_bool desiredState) +void _setAndCheckWindowMouseGrabState(SDL_Window *window, SDL_bool desiredState) { - SDL_bool currentState; - - /* Set state */ - SDL_SetWindowMouseGrab(window, desiredState); - SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); - - /* Get and check state */ - currentState = SDL_GetWindowMouseGrab(window); - SDLTest_AssertPass("Call to SDL_GetWindowMouseGrab()"); - SDLTest_AssertCheck( - currentState == desiredState, - "Validate returned state; expected: %s, got: %s", - (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", - (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); - - if (desiredState) { - SDLTest_AssertCheck( - SDL_GetGrabbedWindow() == window, - "Grabbed window should be to our window"); - SDLTest_AssertCheck( - SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - SDLTest_AssertCheck( - SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_GRABBED, - "SDL_WINDOW_MOUSE_GRABBED should be set"); - } else { + SDL_bool currentState; + + /* Set state */ + SDL_SetWindowMouseGrab(window, desiredState); + SDLTest_AssertPass("Call to SDL_SetWindowMouseGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + + /* Get and check state */ + currentState = SDL_GetWindowMouseGrab(window); + SDLTest_AssertPass("Call to SDL_GetWindowMouseGrab()"); SDLTest_AssertCheck( - !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_GRABBED), - "SDL_WINDOW_MOUSE_GRABBED should be unset"); - } + currentState == desiredState, + "Validate returned state; expected: %s, got: %s", + (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", + (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + + if (desiredState) { + SDLTest_AssertCheck( + SDL_GetGrabbedWindow() == window, + "Grabbed window should be to our window"); + SDLTest_AssertCheck( + SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + SDLTest_AssertCheck( + SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_GRABBED, + "SDL_WINDOW_MOUSE_GRABBED should be set"); + } else { + SDLTest_AssertCheck( + !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_GRABBED), + "SDL_WINDOW_MOUSE_GRABBED should be unset"); + } } /* Helper for setting and checking the window keyboard grab state */ -void -_setAndCheckWindowKeyboardGrabState(SDL_Window* window, SDL_bool desiredState) +void _setAndCheckWindowKeyboardGrabState(SDL_Window *window, SDL_bool desiredState) { - SDL_bool currentState; - - /* Set state */ - SDL_SetWindowKeyboardGrab(window, desiredState); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); - - /* Get and check state */ - currentState = SDL_GetWindowKeyboardGrab(window); - SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab()"); - SDLTest_AssertCheck( - currentState == desiredState, - "Validate returned state; expected: %s, got: %s", - (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", - (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); - - if (desiredState) { - SDLTest_AssertCheck( - SDL_GetGrabbedWindow() == window, - "Grabbed window should be set to our window"); - SDLTest_AssertCheck( - SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - SDLTest_AssertCheck( - SDL_GetWindowFlags(window) & SDL_WINDOW_KEYBOARD_GRABBED, - "SDL_WINDOW_KEYBOARD_GRABBED should be set"); - } else { + SDL_bool currentState; + + /* Set state */ + SDL_SetWindowKeyboardGrab(window, desiredState); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(%s)", (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + + /* Get and check state */ + currentState = SDL_GetWindowKeyboardGrab(window); + SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab()"); SDLTest_AssertCheck( - !(SDL_GetWindowFlags(window) & SDL_WINDOW_KEYBOARD_GRABBED), - "SDL_WINDOW_KEYBOARD_GRABBED should be unset"); - } + currentState == desiredState, + "Validate returned state; expected: %s, got: %s", + (desiredState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE", + (currentState == SDL_FALSE) ? "SDL_FALSE" : "SDL_TRUE"); + + if (desiredState) { + SDLTest_AssertCheck( + SDL_GetGrabbedWindow() == window, + "Grabbed window should be set to our window"); + SDLTest_AssertCheck( + SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + SDLTest_AssertCheck( + SDL_GetWindowFlags(window) & SDL_WINDOW_KEYBOARD_GRABBED, + "SDL_WINDOW_KEYBOARD_GRABBED should be set"); + } else { + SDLTest_AssertCheck( + !(SDL_GetWindowFlags(window) & SDL_WINDOW_KEYBOARD_GRABBED), + "SDL_WINDOW_KEYBOARD_GRABBED should be unset"); + } } /** @@ -827,197 +847,218 @@ _setAndCheckWindowKeyboardGrabState(SDL_Window* window, SDL_bool desiredState) * @sa http://wiki.libsdl.org/SDL_GetWindowGrab * @sa http://wiki.libsdl.org/SDL_SetWindowGrab */ -int -video_getSetWindowGrab(void *arg) +int video_getSetWindowGrab(void *arg) { - const char* title = "video_getSetWindowGrab Test Window"; - SDL_Window* window; - SDL_bool originalMouseState, originalKeyboardState; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - - /* Get state */ - originalMouseState = SDL_GetWindowMouseGrab(window); - SDLTest_AssertPass("Call to SDL_GetWindowMouseGrab()"); - originalKeyboardState = SDL_GetWindowKeyboardGrab(window); - SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab()"); - - /* F */ - _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); - _setAndCheckWindowMouseGrabState(window, SDL_FALSE); - SDLTest_AssertCheck(!SDL_GetWindowGrab(window), - "SDL_GetWindowGrab should return SDL_FALSE"); - SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, - "Expected NULL grabbed window"); - - /* F --> F */ - _setAndCheckWindowMouseGrabState(window, SDL_FALSE); - _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); - SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, - "Expected NULL grabbed window"); - - /* F --> T */ - _setAndCheckWindowMouseGrabState(window, SDL_TRUE); - _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - - /* T --> T */ - _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); - _setAndCheckWindowMouseGrabState(window, SDL_TRUE); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - - /* M: T --> F */ - /* K: T --> T */ - _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); - _setAndCheckWindowMouseGrabState(window, SDL_FALSE); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - - /* M: F --> T */ - /* K: T --> F */ - _setAndCheckWindowMouseGrabState(window, SDL_TRUE); - _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - - /* M: T --> F */ - /* K: F --> F */ - _setAndCheckWindowMouseGrabState(window, SDL_FALSE); - _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); - SDLTest_AssertCheck(!SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_FALSE"); - SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, - "Expected NULL grabbed window"); - - /* Using the older SDL_SetWindowGrab API should only grab mouse by default */ - SDL_SetWindowGrab(window, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowGrab(SDL_TRUE)"); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - SDLTest_AssertCheck(SDL_GetWindowMouseGrab(window), - "SDL_GetWindowMouseGrab() should return SDL_TRUE"); - SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), - "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); - SDL_SetWindowGrab(window, SDL_FALSE); - SDLTest_AssertCheck(!SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_FALSE"); - SDLTest_AssertCheck(!SDL_GetWindowMouseGrab(window), - "SDL_GetWindowMouseGrab() should return SDL_FALSE"); - SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), - "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); - - /* Now test with SDL_HINT_GRAB_KEYBOARD set. We should get keyboard grab now. */ - SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1"); - SDL_SetWindowGrab(window, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowGrab(SDL_TRUE)"); - SDLTest_AssertCheck(SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_TRUE"); - SDLTest_AssertCheck(SDL_GetWindowMouseGrab(window), - "SDL_GetWindowMouseGrab() should return SDL_TRUE"); - SDLTest_AssertCheck(SDL_GetWindowKeyboardGrab(window), - "SDL_GetWindowKeyboardGrab() should return SDL_TRUE"); - SDL_SetWindowGrab(window, SDL_FALSE); - SDLTest_AssertCheck(!SDL_GetWindowGrab(window), - "SDL_GetWindowGrab() should return SDL_FALSE"); - SDLTest_AssertCheck(!SDL_GetWindowMouseGrab(window), - "SDL_GetWindowMouseGrab() should return SDL_FALSE"); - SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), - "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); - - /* Negative tests */ - SDL_GetWindowGrab(NULL); - SDLTest_AssertPass("Call to SDL_GetWindowGrab(window=NULL)"); - _checkInvalidWindowError(); - - SDL_GetWindowKeyboardGrab(NULL); - SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab(window=NULL)"); - _checkInvalidWindowError(); - - SDL_SetWindowGrab(NULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_FALSE)"); - _checkInvalidWindowError(); - - SDL_SetWindowKeyboardGrab(NULL, SDL_FALSE); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_FALSE)"); - _checkInvalidWindowError(); + const char *title = "video_getSetWindowGrab Test Window"; + SDL_Window *window; + SDL_bool originalMouseState, originalKeyboardState; + SDL_bool hasFocusGained = SDL_FALSE; - SDL_SetWindowGrab(NULL, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_TRUE)"); - _checkInvalidWindowError(); + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; + } - SDL_SetWindowKeyboardGrab(NULL, SDL_TRUE); - SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_TRUE)"); - _checkInvalidWindowError(); + /* Need to raise the window to have and SDL_EVENT_WINDOW_FOCUS_GAINED, + * so that the window gets the flags SDL_WINDOW_INPUT_FOCUS, + * so that it can be "grabbed" */ + SDL_RaiseWindow(window); + + { + SDL_Event evt; + SDL_zero(evt); + while (SDL_PollEvent(&evt)) { + if (evt.type == SDL_WINDOWEVENT) { + if (evt.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { + hasFocusGained = SDL_TRUE; + } + } + } + } - /* Restore state */ - _setAndCheckWindowMouseGrabState(window, originalMouseState); - _setAndCheckWindowKeyboardGrabState(window, originalKeyboardState); + SDLTest_AssertCheck(hasFocusGained == SDL_TRUE, "Expected window with focus"); + + /* Get state */ + originalMouseState = SDL_GetWindowMouseGrab(window); + SDLTest_AssertPass("Call to SDL_GetWindowMouseGrab()"); + originalKeyboardState = SDL_GetWindowKeyboardGrab(window); + SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab()"); + + /* F */ + _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + _setAndCheckWindowMouseGrabState(window, SDL_FALSE); + SDLTest_AssertCheck(!SDL_GetWindowGrab(window), + "SDL_GetWindowGrab should return SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, + "Expected NULL grabbed window"); + + /* F --> F */ + _setAndCheckWindowMouseGrabState(window, SDL_FALSE); + _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, + "Expected NULL grabbed window"); + + /* F --> T */ + _setAndCheckWindowMouseGrabState(window, SDL_TRUE); + _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + + /* T --> T */ + _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); + _setAndCheckWindowMouseGrabState(window, SDL_TRUE); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + + /* M: T --> F */ + /* K: T --> T */ + _setAndCheckWindowKeyboardGrabState(window, SDL_TRUE); + _setAndCheckWindowMouseGrabState(window, SDL_FALSE); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + + /* M: F --> T */ + /* K: T --> F */ + _setAndCheckWindowMouseGrabState(window, SDL_TRUE); + _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + + /* M: T --> F */ + /* K: F --> F */ + _setAndCheckWindowMouseGrabState(window, SDL_FALSE); + _setAndCheckWindowKeyboardGrabState(window, SDL_FALSE); + SDLTest_AssertCheck(!SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_FALSE"); + SDLTest_AssertCheck(SDL_GetGrabbedWindow() == NULL, + "Expected NULL grabbed window"); + + /* Using the older SDL_SetWindowGrab API should only grab mouse by default */ + SDL_SetWindowGrab(window, SDL_TRUE); + SDLTest_AssertPass("Call to SDL_SetWindowGrab(SDL_TRUE)"); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetWindowMouseGrab(window), + "SDL_GetWindowMouseGrab() should return SDL_TRUE"); + SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), + "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); + SDL_SetWindowGrab(window, SDL_FALSE); + SDLTest_AssertCheck(!SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_FALSE"); + SDLTest_AssertCheck(!SDL_GetWindowMouseGrab(window), + "SDL_GetWindowMouseGrab() should return SDL_FALSE"); + SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), + "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); + + /* Now test with SDL_HINT_GRAB_KEYBOARD set. We should get keyboard grab now. */ + SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1"); + SDL_SetWindowGrab(window, SDL_TRUE); + SDLTest_AssertPass("Call to SDL_SetWindowGrab(SDL_TRUE)"); + SDLTest_AssertCheck(SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetWindowMouseGrab(window), + "SDL_GetWindowMouseGrab() should return SDL_TRUE"); + SDLTest_AssertCheck(SDL_GetWindowKeyboardGrab(window), + "SDL_GetWindowKeyboardGrab() should return SDL_TRUE"); + SDL_SetWindowGrab(window, SDL_FALSE); + SDLTest_AssertCheck(!SDL_GetWindowGrab(window), + "SDL_GetWindowGrab() should return SDL_FALSE"); + SDLTest_AssertCheck(!SDL_GetWindowMouseGrab(window), + "SDL_GetWindowMouseGrab() should return SDL_FALSE"); + SDLTest_AssertCheck(!SDL_GetWindowKeyboardGrab(window), + "SDL_GetWindowKeyboardGrab() should return SDL_FALSE"); + + /* Negative tests */ + SDL_GetWindowGrab(NULL); + SDLTest_AssertPass("Call to SDL_GetWindowGrab(window=NULL)"); + _checkInvalidWindowError(); + + SDL_GetWindowKeyboardGrab(NULL); + SDLTest_AssertPass("Call to SDL_GetWindowKeyboardGrab(window=NULL)"); + _checkInvalidWindowError(); + + SDL_SetWindowGrab(NULL, SDL_FALSE); + SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_FALSE)"); + _checkInvalidWindowError(); + + SDL_SetWindowKeyboardGrab(NULL, SDL_FALSE); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_FALSE)"); + _checkInvalidWindowError(); + + SDL_SetWindowGrab(NULL, SDL_TRUE); + SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_TRUE)"); + _checkInvalidWindowError(); + + SDL_SetWindowKeyboardGrab(NULL, SDL_TRUE); + SDLTest_AssertPass("Call to SDL_SetWindowKeyboardGrab(window=NULL,SDL_TRUE)"); + _checkInvalidWindowError(); + + /* Restore state */ + _setAndCheckWindowMouseGrabState(window, originalMouseState); + _setAndCheckWindowKeyboardGrabState(window, originalKeyboardState); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests call to SDL_GetWindowID and SDL_GetWindowFromID * * @sa http://wiki.libsdl.org/SDL_GetWindowID * @sa http://wiki.libsdl.org/SDL_SetWindowFromID */ -int -video_getWindowId(void *arg) +int video_getWindowId(void *arg) { - const char* title = "video_getWindowId Test Window"; - SDL_Window* window; - SDL_Window* result; - Uint32 id, randomId; + const char *title = "video_getWindowId Test Window"; + SDL_Window *window; + SDL_Window *result; + Uint32 id, randomId; - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; + } - /* Get ID */ - id = SDL_GetWindowID(window); - SDLTest_AssertPass("Call to SDL_GetWindowID()"); + /* Get ID */ + id = SDL_GetWindowID(window); + SDLTest_AssertPass("Call to SDL_GetWindowID()"); - /* Get window from ID */ - result = SDL_GetWindowFromID(id); - SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 ")", id); - SDLTest_AssertCheck(result == window, "Verify result matches window pointer"); + /* Get window from ID */ + result = SDL_GetWindowFromID(id); + SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 ")", id); + SDLTest_AssertCheck(result == window, "Verify result matches window pointer"); - /* Get window from random large ID, no result check */ - randomId = SDLTest_RandomIntegerInRange(UINT8_MAX,UINT16_MAX); - result = SDL_GetWindowFromID(randomId); - SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/random_large)", randomId); + /* Get window from random large ID, no result check */ + randomId = SDLTest_RandomIntegerInRange(UINT8_MAX, UINT16_MAX); + result = SDL_GetWindowFromID(randomId); + SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/random_large)", randomId); - /* Get window from 0 and Uint32 max ID, no result check */ - result = SDL_GetWindowFromID(0); - SDLTest_AssertPass("Call to SDL_GetWindowID(0)"); - result = SDL_GetWindowFromID(UINT32_MAX); - SDLTest_AssertPass("Call to SDL_GetWindowID(UINT32_MAX)"); + /* Get window from 0 and Uint32 max ID, no result check */ + result = SDL_GetWindowFromID(0); + SDLTest_AssertPass("Call to SDL_GetWindowID(0)"); + result = SDL_GetWindowFromID(UINT32_MAX); + SDLTest_AssertPass("Call to SDL_GetWindowID(UINT32_MAX)"); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Get window from ID for closed window */ - result = SDL_GetWindowFromID(id); - SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/closed_window)", id); - SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); + /* Get window from ID for closed window */ + result = SDL_GetWindowFromID(id); + SDLTest_AssertPass("Call to SDL_GetWindowID(%" SDL_PRIu32 "/closed_window)", id); + SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); - /* Negative test */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - id = SDL_GetWindowID(NULL); - SDLTest_AssertPass("Call to SDL_GetWindowID(window=NULL)"); - _checkInvalidWindowError(); + /* Negative test */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + id = SDL_GetWindowID(NULL); + SDLTest_AssertPass("Call to SDL_GetWindowID(window=NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** @@ -1025,33 +1066,65 @@ video_getWindowId(void *arg) * * @sa http://wiki.libsdl.org/SDL_GetWindowPixelFormat */ -int -video_getWindowPixelFormat(void *arg) +int video_getWindowPixelFormat(void *arg) { - const char* title = "video_getWindowPixelFormat Test Window"; - SDL_Window* window; - Uint32 format; + const char *title = "video_getWindowPixelFormat Test Window"; + SDL_Window *window; + Uint32 format; - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; + } - /* Get format */ - format = SDL_GetWindowPixelFormat(window); - SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat()"); - SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %" SDL_PRIu32, SDL_PIXELFORMAT_UNKNOWN, format); + /* Get format */ + format = SDL_GetWindowPixelFormat(window); + SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat()"); + SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %" SDL_PRIu32, SDL_PIXELFORMAT_UNKNOWN, format); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Negative test */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - format = SDL_GetWindowPixelFormat(NULL); - SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat(window=NULL)"); - _checkInvalidWindowError(); + /* Negative test */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + format = SDL_GetWindowPixelFormat(NULL); + SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat(window=NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; +} + + +static SDL_bool getPositionFromEvent(int *x, int *y) +{ + SDL_bool ret = SDL_FALSE; + SDL_Event evt; + SDL_zero(evt); + while (SDL_PollEvent(&evt)) { + if (evt.type == SDL_WINDOWEVENT && evt.window.event == SDL_WINDOWEVENT_MOVED) { + *x = evt.window.data1; + *y = evt.window.data2; + ret = SDL_TRUE; + } + } + return ret; +} + +static SDL_bool getSizeFromEvent(int *w, int *h) +{ + SDL_bool ret = SDL_FALSE; + SDL_Event evt; + SDL_zero(evt); + while (SDL_PollEvent(&evt)) { + if (evt.type == SDL_WINDOWEVENT && evt.window.event == SDL_WINDOWEVENT_RESIZED) { + *w = evt.window.data1; + *h = evt.window.data2; + ret = SDL_TRUE; + } + } + return ret; } /** @@ -1060,143 +1133,189 @@ video_getWindowPixelFormat(void *arg) * @sa http://wiki.libsdl.org/SDL_GetWindowPosition * @sa http://wiki.libsdl.org/SDL_SetWindowPosition */ -int -video_getSetWindowPosition(void *arg) +int video_getSetWindowPosition(void *arg) { - const char* title = "video_getSetWindowPosition Test Window"; - SDL_Window* window; - int xVariation, yVariation; - int referenceX, referenceY; - int currentX, currentY; - int desiredX, desiredY; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - - for (xVariation = 0; xVariation < 4; xVariation++) { - for (yVariation = 0; yVariation < 4; yVariation++) { - switch(xVariation) { - default: - case 0: - /* Zero X Position */ - desiredX = 0; - break; - case 1: - /* Random X position inside screen */ - desiredX = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Random X position outside screen (positive) */ - desiredX = SDLTest_RandomIntegerInRange(10000, 11000); - break; - case 3: - /* Random X position outside screen (negative) */ - desiredX = SDLTest_RandomIntegerInRange(-1000, -100); - break; + const char *title = "video_getSetWindowPosition Test Window"; + SDL_Window *window; + int maxxVariation, maxyVariation; + int xVariation, yVariation; + int referenceX, referenceY; + int currentX, currentY; + int desiredX, desiredY; + SDL_Rect display_bounds; + + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { + SDLTest_Log("Skipping test: wayland does not support window positioning"); + return TEST_SKIPPED; } - switch(yVariation) { - default: - case 0: - /* Zero X Position */ - desiredY = 0; - break; - case 1: - /* Random X position inside screen */ - desiredY = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Random X position outside screen (positive) */ - desiredY = SDLTest_RandomIntegerInRange(10000, 11000); - break; - case 3: - /* Random Y position outside screen (negative) */ - desiredY = SDLTest_RandomIntegerInRange(-1000, -100); - break; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; } - /* Set position */ - SDL_SetWindowPosition(window, desiredX, desiredY); - SDLTest_AssertPass("Call to SDL_SetWindowPosition(...,%d,%d)", desiredX, desiredY); - - /* Get position */ - currentX = desiredX + 1; - currentY = desiredY + 1; - SDL_GetWindowPosition(window, ¤tX, ¤tY); - SDLTest_AssertPass("Call to SDL_GetWindowPosition()"); - SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); - SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); - - /* Get position X */ - currentX = desiredX + 1; - SDL_GetWindowPosition(window, ¤tX, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowPosition(&y=NULL)"); - SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); - - /* Get position Y */ - currentY = desiredY + 1; - SDL_GetWindowPosition(window, NULL, ¤tY); - SDLTest_AssertPass("Call to SDL_GetWindowPosition(&x=NULL)"); - SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); - } - } + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { + /* The X11 server allows arbitrary window placement, but compositing + * window managers such as GNOME and KDE force windows to be within + * desktop bounds. + */ + maxxVariation = 2; + maxyVariation = 2; + + SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); + } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "cocoa") == 0) { + /* Platform doesn't allow windows with negative Y desktop bounds */ + maxxVariation = 4; + maxyVariation = 3; + + SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); + } else { + /* Platform allows windows to be placed out of bounds */ + maxxVariation = 4; + maxyVariation = 4; - /* Dummy call with both pointers NULL */ - SDL_GetWindowPosition(window, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowPosition(&x=NULL,&y=NULL)"); + SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(window), &display_bounds); + } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + for (xVariation = 0; xVariation < maxxVariation; xVariation++) { + for (yVariation = 0; yVariation < maxyVariation; yVariation++) { + switch (xVariation) { + default: + case 0: + /* Zero X Position */ + desiredX = display_bounds.x > 0 ? display_bounds.x : 0; + break; + case 1: + /* Random X position inside screen */ + desiredX = SDLTest_RandomIntegerInRange(display_bounds.x + 1, display_bounds.x + 100); + break; + case 2: + /* Random X position outside screen (positive) */ + desiredX = SDLTest_RandomIntegerInRange(10000, 11000); + break; + case 3: + /* Random X position outside screen (negative) */ + desiredX = SDLTest_RandomIntegerInRange(-1000, -100); + break; + } + + switch (yVariation) { + default: + case 0: + /* Zero Y Position */ + desiredY = display_bounds.y > 0 ? display_bounds.y : 0; + break; + case 1: + /* Random Y position inside screen */ + desiredY = SDLTest_RandomIntegerInRange(display_bounds.y + 1, display_bounds.y + 100); + break; + case 2: + /* Random Y position outside screen (positive) */ + desiredY = SDLTest_RandomIntegerInRange(10000, 11000); + break; + case 3: + /* Random Y position outside screen (negative) */ + desiredY = SDLTest_RandomIntegerInRange(-1000, -100); + break; + } + + /* Set position */ + SDL_SetWindowPosition(window, desiredX, desiredY); + SDLTest_AssertPass("Call to SDL_SetWindowPosition(...,%d,%d)", desiredX, desiredY); + + /* Get position */ + currentX = desiredX + 1; + currentY = desiredY + 1; + SDL_GetWindowPosition(window, ¤tX, ¤tY); + SDLTest_AssertPass("Call to SDL_GetWindowPosition()"); + + if (desiredX == currentX && desiredY == currentY) { + SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); + SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); + } else { + SDL_bool hasEvent; + /* SDL_SetWindowPosition() and SDL_SetWindowSize() will make requests of the window manager and set the internal position and size, + * and then we get events signaling what actually happened, and they get passed on to the application if they're not what we expect. */ + desiredX = currentX + 1; + desiredY = currentY + 1; + hasEvent = getPositionFromEvent(&desiredX, &desiredY); + SDLTest_AssertCheck(hasEvent == SDL_TRUE, "Changing position was not honored by WM, checking present of SDL_WINDOWEVENT_MOVED"); + if (hasEvent) { + SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position is the position from SDL event; expected: %d, got: %d", desiredX, currentX); + SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position is the position from SDL event; expected: %d, got: %d", desiredY, currentY); + } + } + + /* Get position X */ + currentX = desiredX + 1; + SDL_GetWindowPosition(window, ¤tX, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowPosition(&y=NULL)"); + SDLTest_AssertCheck(desiredX == currentX, "Verify returned X position; expected: %d, got: %d", desiredX, currentX); + + /* Get position Y */ + currentY = desiredY + 1; + SDL_GetWindowPosition(window, NULL, ¤tY); + SDLTest_AssertPass("Call to SDL_GetWindowPosition(&x=NULL)"); + SDLTest_AssertCheck(desiredY == currentY, "Verify returned Y position; expected: %d, got: %d", desiredY, currentY); + } + } - /* Set some 'magic' value for later check that nothing was changed */ - referenceX = SDLTest_RandomSint32(); - referenceY = SDLTest_RandomSint32(); - currentX = referenceX; - currentY = referenceY; - desiredX = SDLTest_RandomSint32(); - desiredY = SDLTest_RandomSint32(); + /* Dummy call with both pointers NULL */ + SDL_GetWindowPosition(window, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowPosition(&x=NULL,&y=NULL)"); - /* Negative tests */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_GetWindowPosition(NULL, ¤tX, ¤tY); - SDLTest_AssertPass("Call to SDL_GetWindowPosition(window=NULL)"); - SDLTest_AssertCheck( - currentX == referenceX && currentY == referenceY, - "Verify that content of X and Y pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceX, referenceY, - currentX, currentY); - _checkInvalidWindowError(); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - SDL_GetWindowPosition(NULL, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowPosition(NULL, NULL, NULL)"); - _checkInvalidWindowError(); + /* Set some 'magic' value for later check that nothing was changed */ + referenceX = SDLTest_RandomSint32(); + referenceY = SDLTest_RandomSint32(); + currentX = referenceX; + currentY = referenceY; + desiredX = SDLTest_RandomSint32(); + desiredY = SDLTest_RandomSint32(); + + /* Negative tests */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_GetWindowPosition(NULL, ¤tX, ¤tY); + SDLTest_AssertPass("Call to SDL_GetWindowPosition(window=NULL)"); + SDLTest_AssertCheck( + currentX == referenceX && currentY == referenceY, + "Verify that content of X and Y pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceX, referenceY, + currentX, currentY); + _checkInvalidWindowError(); - SDL_SetWindowPosition(NULL, desiredX, desiredY); - SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)"); - _checkInvalidWindowError(); + SDL_GetWindowPosition(NULL, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowPosition(NULL, NULL, NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + SDL_SetWindowPosition(NULL, desiredX, desiredY); + SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)"); + _checkInvalidWindowError(); + + return TEST_COMPLETED; } /* Helper function that checks for an 'Invalid parameter' error */ -void _checkInvalidParameterError() +void _checkInvalidParameterError(void) { - const char *invalidParameterError = "Parameter"; - char *lastError; - - lastError = (char *)SDL_GetError(); - SDLTest_AssertPass("SDL_GetError()"); - SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); - if (lastError != NULL) { - SDLTest_AssertCheck(SDL_strncmp(lastError, invalidParameterError, SDL_strlen(invalidParameterError)) == 0, - "SDL_GetError(): expected message starts with '%s', was message: '%s'", - invalidParameterError, - lastError); - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - } + const char *invalidParameterError = "Parameter"; + char *lastError; + + lastError = (char *)SDL_GetError(); + SDLTest_AssertPass("SDL_GetError()"); + SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL"); + if (lastError != NULL) { + SDLTest_AssertCheck(SDL_strncmp(lastError, invalidParameterError, SDL_strlen(invalidParameterError)) == 0, + "SDL_GetError(): expected message starts with '%s', was message: '%s'", + invalidParameterError, + lastError); + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + } } /** @@ -1205,665 +1324,689 @@ void _checkInvalidParameterError() * @sa http://wiki.libsdl.org/SDL_GetWindowSize * @sa http://wiki.libsdl.org/SDL_SetWindowSize */ -int -video_getSetWindowSize(void *arg) +int video_getSetWindowSize(void *arg) { - const char* title = "video_getSetWindowSize Test Window"; - SDL_Window* window; - int result; - SDL_Rect display; - int maxwVariation, maxhVariation; - int wVariation, hVariation; - int referenceW, referenceH; - int currentW, currentH; - int desiredW, desiredH; - - /* Get display bounds for size range */ - result = SDL_GetDisplayBounds(0, &display); - SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); - if (result != 0) return TEST_ABORTED; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - -#ifdef __WIN32__ - /* Platform clips window size to screen size */ - maxwVariation = 4; - maxhVariation = 4; -#else - /* Platform allows window size >= screen size */ - maxwVariation = 5; - maxhVariation = 5; -#endif - - for (wVariation = 0; wVariation < maxwVariation; wVariation++) { - for (hVariation = 0; hVariation < maxhVariation; hVariation++) { - switch(wVariation) { - default: - case 0: - /* 1 Pixel Wide */ - desiredW = 1; - break; - case 1: - /* Random width inside screen */ - desiredW = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Width 1 pixel smaller than screen */ - desiredW = display.w - 1; - break; - case 3: - /* Width at screen size */ - desiredW = display.w; - break; - case 4: - /* Width 1 pixel larger than screen */ - desiredW = display.w + 1; - break; + const char *title = "video_getSetWindowSize Test Window"; + SDL_Window *window; + int result; + SDL_Rect display; + int maxwVariation, maxhVariation; + int wVariation, hVariation; + int referenceW, referenceH; + int currentW, currentH; + int desiredW, desiredH; + + /* Get display bounds for size range */ + result = SDL_GetDisplayUsableBounds(0, &display); + SDLTest_AssertPass("SDL_GetDisplayBounds()"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + if (result != 0) { + return TEST_ABORTED; } - switch(hVariation) { - default: - case 0: - /* 1 Pixel High */ - desiredH = 1; - break; - case 1: - /* Random height inside screen */ - desiredH = SDLTest_RandomIntegerInRange(1, 100); - break; - case 2: - /* Height 1 pixel smaller than screen */ - desiredH = display.h - 1; - break; - case 3: - /* Height at screen size */ - desiredH = display.h; - break; - case 4: - /* Height 1 pixel larger than screen */ - desiredH = display.h + 1; - break; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; } - /* Set size */ - SDL_SetWindowSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); - - /* Get size */ - currentW = desiredW + 1; - currentH = desiredH + 1; - SDL_GetWindowSize(window, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowSize()"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); - - /* Get just width */ - currentW = desiredW + 1; - SDL_GetWindowSize(window, ¤tW, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); - - /* Get just height */ - currentH = desiredH + 1; - SDL_GetWindowSize(window, NULL, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)"); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); - } - } - - /* Dummy call with both pointers NULL */ - SDL_GetWindowSize(window, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL,&h=NULL)"); + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "windows") == 0 || + SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { + /* Platform clips window size to screen size */ + maxwVariation = 4; + maxhVariation = 4; + } else { + /* Platform allows window size >= screen size */ + maxwVariation = 5; + maxhVariation = 5; + } - /* Negative tests for parameter input */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - for (desiredH = -2; desiredH < 2; desiredH++) { - for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { - SDL_SetWindowSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); - _checkInvalidParameterError(); - } + for (wVariation = 0; wVariation < maxwVariation; wVariation++) { + for (hVariation = 0; hVariation < maxhVariation; hVariation++) { + switch (wVariation) { + default: + case 0: + /* 1 Pixel Wide */ + desiredW = 1; + break; + case 1: + /* Random width inside screen */ + desiredW = SDLTest_RandomIntegerInRange(1, 100); + break; + case 2: + /* Width 1 pixel smaller than screen */ + desiredW = display.w - 1; + break; + case 3: + /* Width at screen size */ + desiredW = display.w; + break; + case 4: + /* Width 1 pixel larger than screen */ + desiredW = display.w + 1; + break; + } + + switch (hVariation) { + default: + case 0: + /* 1 Pixel High */ + desiredH = 1; + break; + case 1: + /* Random height inside screen */ + desiredH = SDLTest_RandomIntegerInRange(1, 100); + break; + case 2: + /* Height 1 pixel smaller than screen */ + desiredH = display.h - 1; + break; + case 3: + /* Height at screen size */ + desiredH = display.h; + break; + case 4: + /* Height 1 pixel larger than screen */ + desiredH = display.h + 1; + break; + } + + /* Set size */ + SDL_SetWindowSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); + + /* Get size */ + currentW = desiredW + 1; + currentH = desiredH + 1; + SDL_GetWindowSize(window, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowSize()"); + + if (desiredW == currentW && desiredH == currentH) { + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); + } else { + SDL_bool hasEvent; + /* SDL_SetWindowPosition() and SDL_SetWindowSize() will make requests of the window manager and set the internal position and size, + * and then we get events signaling what actually happened, and they get passed on to the application if they're not what we expect. */ + desiredW = currentW + 1; + desiredH = currentH + 1; + hasEvent = getSizeFromEvent(&desiredW, &desiredH); + SDLTest_AssertCheck(hasEvent == SDL_TRUE, "Changing size was not honored by WM, checking presence of SDL_WINDOWEVENT_RESIZED"); + if (hasEvent) { + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width is the one from SDL event; expected: %d, got: %d", desiredW, currentW); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height is the one from SDL event; expected: %d, got: %d", desiredH, currentH); + } + } + + /* Get just width */ + currentW = desiredW + 1; + SDL_GetWindowSize(window, ¤tW, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)"); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); + + /* Get just height */ + currentH = desiredH + 1; + SDL_GetWindowSize(window, NULL, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)"); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); + } } - } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Dummy call with both pointers NULL */ + SDL_GetWindowSize(window, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL,&h=NULL)"); + + /* Negative tests for parameter input */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + for (desiredH = -2; desiredH < 2; desiredH++) { + for (desiredW = -2; desiredW < 2; desiredW++) { + if (desiredW <= 0 || desiredH <= 0) { + SDL_SetWindowSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH); + _checkInvalidParameterError(); + } + } + } - /* Set some 'magic' value for later check that nothing was changed */ - referenceW = SDLTest_RandomSint32(); - referenceH = SDLTest_RandomSint32(); - currentW = referenceW; - currentH = referenceH; - desiredW = SDLTest_RandomSint32(); - desiredH = SDLTest_RandomSint32(); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Negative tests for window input */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_GetWindowSize(NULL, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowSize(window=NULL)"); - SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); - _checkInvalidWindowError(); + /* Set some 'magic' value for later check that nothing was changed */ + referenceW = SDLTest_RandomSint32(); + referenceH = SDLTest_RandomSint32(); + currentW = referenceW; + currentH = referenceH; + desiredW = SDLTest_RandomSint32(); + desiredH = SDLTest_RandomSint32(); + + /* Negative tests for window input */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_GetWindowSize(NULL, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowSize(window=NULL)"); + SDLTest_AssertCheck( + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); + _checkInvalidWindowError(); - SDL_GetWindowSize(NULL, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowSize(NULL, NULL, NULL)"); - _checkInvalidWindowError(); + SDL_GetWindowSize(NULL, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowSize(NULL, NULL, NULL)"); + _checkInvalidWindowError(); - SDL_SetWindowSize(NULL, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowSize(window=NULL)"); - _checkInvalidWindowError(); + SDL_SetWindowSize(NULL, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowSize(window=NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests call to SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize * */ -int -video_getSetWindowMinimumSize(void *arg) +int video_getSetWindowMinimumSize(void *arg) { - const char* title = "video_getSetWindowMinimumSize Test Window"; - SDL_Window* window; - int result; - SDL_Rect display; - int wVariation, hVariation; - int referenceW, referenceH; - int currentW, currentH; - int desiredW = 1; - int desiredH = 1; - - /* Get display bounds for size range */ - result = SDL_GetDisplayBounds(0, &display); - SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); - if (result != 0) return TEST_ABORTED; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - - for (wVariation = 0; wVariation < 5; wVariation++) { - for (hVariation = 0; hVariation < 5; hVariation++) { - switch(wVariation) { - case 0: - /* 1 Pixel Wide */ - desiredW = 1; - break; - case 1: - /* Random width inside screen */ - desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); - break; - case 2: - /* Width at screen size */ - desiredW = display.w; - break; + const char *title = "video_getSetWindowMinimumSize Test Window"; + SDL_Window *window; + int result; + SDL_Rect display; + int wVariation, hVariation; + int referenceW, referenceH; + int currentW, currentH; + int desiredW = 1; + int desiredH = 1; + + /* Get display bounds for size range */ + result = SDL_GetDisplayBounds(0, &display); + SDLTest_AssertPass("SDL_GetDisplayBounds()"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + if (result != 0) { + return TEST_ABORTED; } - switch(hVariation) { - case 0: - /* 1 Pixel High */ - desiredH = 1; - break; - case 1: - /* Random height inside screen */ - desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); - break; - case 2: - /* Height at screen size */ - desiredH = display.h; - break; - case 4: - /* Height 1 pixel larger than screen */ - desiredH = display.h + 1; - break; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; } - /* Set size */ - SDL_SetWindowMinimumSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); - - /* Get size */ - currentW = desiredW + 1; - currentH = desiredH + 1; - SDL_GetWindowMinimumSize(window, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize()"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); - - /* Get just width */ - currentW = desiredW + 1; - SDL_GetWindowMinimumSize(window, ¤tW, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&h=NULL)"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); - - /* Get just height */ - currentH = desiredH + 1; - SDL_GetWindowMinimumSize(window, NULL, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL)"); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH); - } - } - - /* Dummy call with both pointers NULL */ - SDL_GetWindowMinimumSize(window, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL,&h=NULL)"); - - /* Negative tests for parameter input */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - for (desiredH = -2; desiredH < 2; desiredH++) { - for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { - SDL_SetWindowMinimumSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); - _checkInvalidParameterError(); - } + for (wVariation = 0; wVariation < 5; wVariation++) { + for (hVariation = 0; hVariation < 5; hVariation++) { + switch (wVariation) { + case 0: + /* 1 Pixel Wide */ + desiredW = 1; + break; + case 1: + /* Random width inside screen */ + desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); + break; + case 2: + /* Width at screen size */ + desiredW = display.w; + break; + } + + switch (hVariation) { + case 0: + /* 1 Pixel High */ + desiredH = 1; + break; + case 1: + /* Random height inside screen */ + desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); + break; + case 2: + /* Height at screen size */ + desiredH = display.h; + break; + case 4: + /* Height 1 pixel larger than screen */ + desiredH = display.h + 1; + break; + } + + /* Set size */ + SDL_SetWindowMinimumSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); + + /* Get size */ + currentW = desiredW + 1; + currentH = desiredH + 1; + SDL_GetWindowMinimumSize(window, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize()"); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); + + /* Get just width */ + currentW = desiredW + 1; + SDL_GetWindowMinimumSize(window, ¤tW, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&h=NULL)"); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); + + /* Get just height */ + currentH = desiredH + 1; + SDL_GetWindowMinimumSize(window, NULL, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL)"); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH); + } } - } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Dummy call with both pointers NULL */ + SDL_GetWindowMinimumSize(window, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL,&h=NULL)"); + + /* Negative tests for parameter input */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + for (desiredH = -2; desiredH < 2; desiredH++) { + for (desiredW = -2; desiredW < 2; desiredW++) { + if (desiredW <= 0 || desiredH <= 0) { + SDL_SetWindowMinimumSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH); + _checkInvalidParameterError(); + } + } + } - /* Set some 'magic' value for later check that nothing was changed */ - referenceW = SDLTest_RandomSint32(); - referenceH = SDLTest_RandomSint32(); - currentW = referenceW; - currentH = referenceH; - desiredW = SDLTest_RandomSint32(); - desiredH = SDLTest_RandomSint32(); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Negative tests for window input */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_GetWindowMinimumSize(NULL, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(window=NULL)"); - SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); - _checkInvalidWindowError(); + /* Set some 'magic' value for later check that nothing was changed */ + referenceW = SDLTest_RandomSint32(); + referenceH = SDLTest_RandomSint32(); + currentW = referenceW; + currentH = referenceH; + desiredW = SDLTest_RandomSint32(); + desiredH = SDLTest_RandomSint32(); + + /* Negative tests for window input */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_GetWindowMinimumSize(NULL, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(window=NULL)"); + SDLTest_AssertCheck( + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); + _checkInvalidWindowError(); - SDL_GetWindowMinimumSize(NULL, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(NULL, NULL, NULL)"); - _checkInvalidWindowError(); + SDL_GetWindowMinimumSize(NULL, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(NULL, NULL, NULL)"); + _checkInvalidWindowError(); - SDL_SetWindowMinimumSize(NULL, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(window=NULL)"); - _checkInvalidWindowError(); + SDL_SetWindowMinimumSize(NULL, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(window=NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; } /** * @brief Tests call to SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize * */ -int -video_getSetWindowMaximumSize(void *arg) +int video_getSetWindowMaximumSize(void *arg) { - const char* title = "video_getSetWindowMaximumSize Test Window"; - SDL_Window* window; - int result; - SDL_Rect display; - int wVariation, hVariation; - int referenceW, referenceH; - int currentW, currentH; - int desiredW, desiredH; - - /* Get display bounds for size range */ - result = SDL_GetDisplayBounds(0, &display); - SDLTest_AssertPass("SDL_GetDisplayBounds()"); - SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); - if (result != 0) return TEST_ABORTED; - - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - - for (wVariation = 0; wVariation < 3; wVariation++) { - for (hVariation = 0; hVariation < 3; hVariation++) { - switch(wVariation) { - case 0: - /* 1 Pixel Wide */ - desiredW = 1; - break; - case 1: - /* Random width inside screen */ - desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); - break; - case 2: - /* Width at screen size */ - desiredW = display.w; - break; + const char *title = "video_getSetWindowMaximumSize Test Window"; + SDL_Window *window; + int result; + SDL_Rect display; + int wVariation, hVariation; + int referenceW, referenceH; + int currentW, currentH; + int desiredW, desiredH; + + /* Get display bounds for size range */ + result = SDL_GetDisplayBounds(0, &display); + SDLTest_AssertPass("SDL_GetDisplayBounds()"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + if (result != 0) { + return TEST_ABORTED; } - switch(hVariation) { - case 0: - /* 1 Pixel High */ - desiredH = 1; - break; - case 1: - /* Random height inside screen */ - desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); - break; - case 2: - /* Height at screen size */ - desiredH = display.h; - break; + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; } - /* Set size */ - SDL_SetWindowMaximumSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); - - /* Get size */ - currentW = desiredW + 1; - currentH = desiredH + 1; - SDL_GetWindowMaximumSize(window, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize()"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); - - /* Get just width */ - currentW = desiredW + 1; - SDL_GetWindowMaximumSize(window, ¤tW, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&h=NULL)"); - SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); - - /* Get just height */ - currentH = desiredH + 1; - SDL_GetWindowMaximumSize(window, NULL, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL)"); - SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH); - } - } - - /* Dummy call with both pointers NULL */ - SDL_GetWindowMaximumSize(window, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL,&h=NULL)"); - - /* Negative tests for parameter input */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - for (desiredH = -2; desiredH < 2; desiredH++) { - for (desiredW = -2; desiredW < 2; desiredW++) { - if (desiredW <= 0 || desiredH <= 0) { - SDL_SetWindowMaximumSize(window, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); - _checkInvalidParameterError(); - } + for (wVariation = 0; wVariation < 3; wVariation++) { + for (hVariation = 0; hVariation < 3; hVariation++) { + switch (wVariation) { + case 0: + /* 1 Pixel Wide */ + desiredW = 1; + break; + case 1: + /* Random width inside screen */ + desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1); + break; + case 2: + /* Width at screen size */ + desiredW = display.w; + break; + } + + switch (hVariation) { + case 0: + /* 1 Pixel High */ + desiredH = 1; + break; + case 1: + /* Random height inside screen */ + desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1); + break; + case 2: + /* Height at screen size */ + desiredH = display.h; + break; + } + + /* Set size */ + SDL_SetWindowMaximumSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); + + /* Get size */ + currentW = desiredW + 1; + currentH = desiredH + 1; + SDL_GetWindowMaximumSize(window, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize()"); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH); + + /* Get just width */ + currentW = desiredW + 1; + SDL_GetWindowMaximumSize(window, ¤tW, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&h=NULL)"); + SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH); + + /* Get just height */ + currentH = desiredH + 1; + SDL_GetWindowMaximumSize(window, NULL, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL)"); + SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH); + } } - } - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Dummy call with both pointers NULL */ + SDL_GetWindowMaximumSize(window, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL,&h=NULL)"); + + /* Negative tests for parameter input */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + for (desiredH = -2; desiredH < 2; desiredH++) { + for (desiredW = -2; desiredW < 2; desiredW++) { + if (desiredW <= 0 || desiredH <= 0) { + SDL_SetWindowMaximumSize(window, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH); + _checkInvalidParameterError(); + } + } + } - /* Set some 'magic' value for later check that nothing was changed */ - referenceW = SDLTest_RandomSint32(); - referenceH = SDLTest_RandomSint32(); - currentW = referenceW; - currentH = referenceH; - desiredW = SDLTest_RandomSint32(); - desiredH = SDLTest_RandomSint32(); + /* Clean up */ + _destroyVideoSuiteTestWindow(window); - /* Negative tests */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_GetWindowMaximumSize(NULL, ¤tW, ¤tH); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(window=NULL)"); - SDLTest_AssertCheck( - currentW == referenceW && currentH == referenceH, - "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", - referenceW, referenceH, - currentW, currentH); - _checkInvalidWindowError(); + /* Set some 'magic' value for later check that nothing was changed */ + referenceW = SDLTest_RandomSint32(); + referenceH = SDLTest_RandomSint32(); + currentW = referenceW; + currentH = referenceH; + desiredW = SDLTest_RandomSint32(); + desiredH = SDLTest_RandomSint32(); + + /* Negative tests */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + SDL_GetWindowMaximumSize(NULL, ¤tW, ¤tH); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(window=NULL)"); + SDLTest_AssertCheck( + currentW == referenceW && currentH == referenceH, + "Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d", + referenceW, referenceH, + currentW, currentH); + _checkInvalidWindowError(); - SDL_GetWindowMaximumSize(NULL, NULL, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(NULL, NULL, NULL)"); - _checkInvalidWindowError(); + SDL_GetWindowMaximumSize(NULL, NULL, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(NULL, NULL, NULL)"); + _checkInvalidWindowError(); - SDL_SetWindowMaximumSize(NULL, desiredW, desiredH); - SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(window=NULL)"); - _checkInvalidWindowError(); + SDL_SetWindowMaximumSize(NULL, desiredW, desiredH); + SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(window=NULL)"); + _checkInvalidWindowError(); - return TEST_COMPLETED; + return TEST_COMPLETED; } - /** * @brief Tests call to SDL_SetWindowData and SDL_GetWindowData * * @sa http://wiki.libsdl.org/SDL_SetWindowData * @sa http://wiki.libsdl.org/SDL_GetWindowData */ -int -video_getSetWindowData(void *arg) +int video_getSetWindowData(void *arg) { - int returnValue = TEST_COMPLETED; - const char* title = "video_setGetWindowData Test Window"; - SDL_Window* window; - const char *referenceName = "TestName"; - const char *name = "TestName"; - const char *referenceName2 = "TestName2"; - const char *name2 = "TestName2"; - int datasize; - char *referenceUserdata = NULL; - char *userdata = NULL; - char *referenceUserdata2 = NULL; - char *userdata2 = NULL; - char *result; - int iteration; + int returnValue = TEST_COMPLETED; + const char *title = "video_setGetWindowData Test Window"; + SDL_Window *window; + const char *referenceName = "TestName"; + const char *name = "TestName"; + const char *referenceName2 = "TestName2"; + const char *name2 = "TestName2"; + int datasize; + char *referenceUserdata = NULL; + char *userdata = NULL; + char *referenceUserdata2 = NULL; + char *userdata2 = NULL; + char *result; + int iteration; + + /* Call against new test window */ + window = _createVideoSuiteTestWindow(title); + if (!window) { + return TEST_ABORTED; + } - /* Call against new test window */ - window = _createVideoSuiteTestWindow(title); - if (window == NULL) return TEST_ABORTED; - - /* Create testdata */ - datasize = SDLTest_RandomIntegerInRange(1, 32); - referenceUserdata = SDLTest_RandomAsciiStringOfSize(datasize); - if (referenceUserdata == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; - } - userdata = SDL_strdup(referenceUserdata); - if (userdata == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; - } - datasize = SDLTest_RandomIntegerInRange(1, 32); - referenceUserdata2 = SDLTest_RandomAsciiStringOfSize(datasize); - if (referenceUserdata2 == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; - } - userdata2 = (char *)SDL_strdup(referenceUserdata2); - if (userdata2 == NULL) { - returnValue = TEST_ABORTED; - goto cleanup; - } + /* Create testdata */ + datasize = SDLTest_RandomIntegerInRange(1, 32); + referenceUserdata = SDLTest_RandomAsciiStringOfSize(datasize); + if (!referenceUserdata) { + returnValue = TEST_ABORTED; + goto cleanup; + } + userdata = SDL_strdup(referenceUserdata); + if (!userdata) { + returnValue = TEST_ABORTED; + goto cleanup; + } + datasize = SDLTest_RandomIntegerInRange(1, 32); + referenceUserdata2 = SDLTest_RandomAsciiStringOfSize(datasize); + if (!referenceUserdata2) { + returnValue = TEST_ABORTED; + goto cleanup; + } + userdata2 = SDL_strdup(referenceUserdata2); + if (!userdata2) { + returnValue = TEST_ABORTED; + goto cleanup; + } - /* Get non-existent data */ - result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - - /* Set data */ - result = (char *)SDL_SetWindowData(window, name, userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - - /* Get data (twice) */ - for (iteration = 1; iteration <= 2; iteration++) { + /* Get non-existent data */ result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [iteration %d]", name, iteration); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - } - /* Set data again twice */ - for (iteration = 1; iteration <= 2; iteration++) { + /* Set data */ result = (char *)SDL_SetWindowData(window, name, userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + + /* Get data (twice) */ + for (iteration = 1; iteration <= 2; iteration++) { + result = (char *)SDL_GetWindowData(window, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [iteration %d]", name, iteration); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + } + + /* Set data again twice */ + for (iteration = 1; iteration <= 2; iteration++) { + result = (char *)SDL_SetWindowData(window, name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + } + + /* Get data again */ + result = (char *)SDL_GetWindowData(window, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + + /* Set data with new data */ + result = (char *)SDL_SetWindowData(window, name, userdata2); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - } + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - /* Get data again */ - result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - - /* Set data with new data */ - result = (char *)SDL_SetWindowData(window, name, userdata2); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - - /* Set data with new data again */ - result = (char *)SDL_SetWindowData(window, name, userdata2); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - - /* Get new data */ - result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - - /* Set data with NULL to clear */ - result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - - /* Set data with NULL to clear again */ - result = (char *)SDL_SetWindowData(window, name, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - - /* Get non-existent data */ - result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - - /* Get non-existent data new name */ - result = (char *)SDL_GetWindowData(window, name2); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name2); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2); - - /* Set data (again) */ - result = (char *)SDL_SetWindowData(window, name, userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); - - /* Get data (again) */ - result = (char *)SDL_GetWindowData(window, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name); - SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); - SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - - /* Negative test */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); + /* Set data with new data again */ + result = (char *)SDL_SetWindowData(window, name, userdata2); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - /* Set with invalid window */ - result = (char *)SDL_SetWindowData(NULL, name, userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(window=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidWindowError(); + /* Get new data */ + result = (char *)SDL_GetWindowData(window, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - /* Set data with NULL name, valid userdata */ - result = (char *)SDL_SetWindowData(window, NULL, userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); - - /* Set data with empty name, valid userdata */ - result = (char *)SDL_SetWindowData(window, "", userdata); - SDLTest_AssertPass("Call to SDL_SetWindowData(name='')"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); - - /* Set data with NULL name, NULL userdata */ - result = (char *)SDL_SetWindowData(window, NULL, NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); - - /* Set data with empty name, NULL userdata */ - result = (char *)SDL_SetWindowData(window, "", NULL); - SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); - - /* Get with invalid window */ - result = (char *)SDL_GetWindowData(NULL, name); - SDLTest_AssertPass("Call to SDL_GetWindowData(window=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidWindowError(); + /* Set data with NULL to clear */ + result = (char *)SDL_SetWindowData(window, name, NULL); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - /* Get data with NULL name */ - result = (char *)SDL_GetWindowData(window, NULL); - SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); + /* Set data with NULL to clear again */ + result = (char *)SDL_SetWindowData(window, name, NULL); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); - /* Get data with empty name */ - result = (char *)SDL_GetWindowData(window, ""); - SDLTest_AssertPass("Call to SDL_GetWindowData(name='')"); - SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); - _checkInvalidParameterError(); + /* Get non-existent data */ + result = (char *)SDL_GetWindowData(window, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - /* Clean up */ - _destroyVideoSuiteTestWindow(window); + /* Get non-existent data new name */ + result = (char *)SDL_GetWindowData(window, name2); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name2); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2); + + /* Set data (again) */ + result = (char *)SDL_SetWindowData(window, name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); + + /* Get data (again) */ + result = (char *)SDL_GetWindowData(window, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name); + SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); + SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); - cleanup: - SDL_free(referenceUserdata); - SDL_free(referenceUserdata2); - SDL_free(userdata); - SDL_free(userdata2); + /* Negative test */ + SDL_ClearError(); + SDLTest_AssertPass("Call to SDL_ClearError()"); + + /* Set with invalid window */ + result = (char *)SDL_SetWindowData(NULL, name, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(window=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidWindowError(); + + /* Set data with NULL name, valid userdata */ + result = (char *)SDL_SetWindowData(window, NULL, userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); + + /* Set data with empty name, valid userdata */ + result = (char *)SDL_SetWindowData(window, "", userdata); + SDLTest_AssertPass("Call to SDL_SetWindowData(name='')"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); + + /* Set data with NULL name, NULL userdata */ + result = (char *)SDL_SetWindowData(window, NULL, NULL); + SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); + + /* Set data with empty name, NULL userdata */ + result = (char *)SDL_SetWindowData(window, "", NULL); + SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); + + /* Get with invalid window */ + result = (char *)SDL_GetWindowData(NULL, name); + SDLTest_AssertPass("Call to SDL_GetWindowData(window=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidWindowError(); + + /* Get data with NULL name */ + result = (char *)SDL_GetWindowData(window, NULL); + SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); + + /* Get data with empty name */ + result = (char *)SDL_GetWindowData(window, ""); + SDLTest_AssertPass("Call to SDL_GetWindowData(name='')"); + SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); + _checkInvalidParameterError(); - return returnValue; + /* Clean up */ + _destroyVideoSuiteTestWindow(window); + +cleanup: + SDL_free(referenceUserdata); + SDL_free(referenceUserdata2); + SDL_free(userdata); + SDL_free(userdata2); + + return returnValue; } /** -* @brief Tests the functionality of the SDL_WINDOWPOS_CENTERED_DISPLAY along with SDL_WINDOW_FULLSCREEN_DESKTOP. -* -* Espeically useful when run on a multi-monitor system with different DPI scales per monitor, -* to test that the window size is maintained when moving between monitors. -*/ -int -video_setWindowCenteredOnDisplay(void *arg) + * @brief Tests the functionality of the SDL_WINDOWPOS_CENTERED_DISPLAY along with SDL_WINDOW_FULLSCREEN_DESKTOP. + * + * Espeically useful when run on a multi-monitor system with different DPI scales per monitor, + * to test that the window size is maintained when moving between monitors. + */ +int video_setWindowCenteredOnDisplay(void *arg) { SDL_Window *window; const char *title = "video_setWindowCenteredOnDisplay Test Window"; @@ -1874,19 +2017,26 @@ video_setWindowCenteredOnDisplay(void *arg) SDL_Rect display0, display1; displayNum = SDL_GetNumVideoDisplays(); + SDLTest_AssertPass("SDL_GetNumVideoDisplays()"); + SDLTest_AssertCheck(displayNum >= 1, "Validate result (current: %d, expected >= 1)", displayNum); + if (displayNum <= 0) { + return TEST_ABORTED; + } /* Get display bounds */ result = SDL_GetDisplayBounds(0 % displayNum, &display0); SDLTest_AssertPass("SDL_GetDisplayBounds()"); SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); - if (result != 0) + if (result != 0) { return TEST_ABORTED; + } result = SDL_GetDisplayBounds(1 % displayNum, &display1); SDLTest_AssertPass("SDL_GetDisplayBounds()"); SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); - if (result != 0) + if (result != 0) { return TEST_ABORTED; + } for (xVariation = 0; xVariation < 2; xVariation++) { for (yVariation = 0; yVariation < 2; yVariation++) { @@ -1896,6 +2046,7 @@ video_setWindowCenteredOnDisplay(void *arg) int currentDisplay; int expectedDisplay; SDL_Rect expectedDisplayRect; + SDL_bool video_driver_is_wayland = SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0; /* xVariation is the display we start on */ expectedDisplay = xVariation % displayNum; @@ -1907,20 +2058,46 @@ video_setWindowCenteredOnDisplay(void *arg) expectedX = (expectedDisplayRect.x + ((expectedDisplayRect.w - w) / 2)); expectedY = (expectedDisplayRect.y + ((expectedDisplayRect.h - h) / 2)); - window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI); + window = SDL_CreateWindow(title, x, y, w, h, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_BORDERLESS); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + /* Wayland windows require that a frame be presented before they are fully mapped and visible onscreen. */ + if (video_driver_is_wayland) { + SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); + + if (renderer) { + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); + + /* Some desktops don't display the window immediately after presentation, + * so delay to give the window time to actually appear on the desktop. + */ + SDL_Delay(100); + } else { + SDLTest_Log("Unable to create a renderer, tests may fail under Wayland"); + } + } + /* Check the window is centered on the requested display */ currentDisplay = SDL_GetWindowDisplayIndex(window); SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + } else { + SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); + } SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + } else { + SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); + } /* Enter fullscreen desktop */ result = SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); @@ -1931,11 +2108,19 @@ video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + } else { + SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); + } SDLTest_AssertCheck(currentW == expectedDisplayRect.w, "Validate width (current: %d, expected: %d)", currentW, expectedDisplayRect.w); SDLTest_AssertCheck(currentH == expectedDisplayRect.h, "Validate height (current: %d, expected: %d)", currentH, expectedDisplayRect.h); - SDLTest_AssertCheck(currentX == expectedDisplayRect.x, "Validate x (current: %d, expected: %d)", currentX, expectedDisplayRect.x); - SDLTest_AssertCheck(currentY == expectedDisplayRect.y, "Validate y (current: %d, expected: %d)", currentY, expectedDisplayRect.y); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentX == expectedDisplayRect.x, "Validate x (current: %d, expected: %d)", currentX, expectedDisplayRect.x); + SDLTest_AssertCheck(currentY == expectedDisplayRect.y, "Validate y (current: %d, expected: %d)", currentY, expectedDisplayRect.y); + } else { + SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); + } /* Leave fullscreen desktop */ result = SDL_SetWindowFullscreen(window, 0); @@ -1946,11 +2131,19 @@ video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + } else { + SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); + } SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + } else { + SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); + } /* Center on display yVariation, and check window properties */ @@ -1966,11 +2159,19 @@ video_setWindowCenteredOnDisplay(void *arg) SDL_GetWindowSize(window, ¤tW, ¤tH); SDL_GetWindowPosition(window, ¤tX, ¤tY); - SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentDisplay == expectedDisplay, "Validate display index (current: %d, expected: %d)", currentDisplay, expectedDisplay); + } else { + SDLTest_Log("Skipping display index validation: Wayland driver does not support window positioning"); + } SDLTest_AssertCheck(currentW == w, "Validate width (current: %d, expected: %d)", currentW, w); SDLTest_AssertCheck(currentH == h, "Validate height (current: %d, expected: %d)", currentH, h); - SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); - SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + if (!video_driver_is_wayland) { + SDLTest_AssertCheck(currentX == expectedX, "Validate x (current: %d, expected: %d)", currentX, expectedX); + SDLTest_AssertCheck(currentY == expectedY, "Validate y (current: %d, expected: %d)", currentY, expectedY); + } else { + SDLTest_Log("Skipping window position validation: Wayland driver does not support window positioning"); + } /* Clean up */ _destroyVideoSuiteTestWindow(window); @@ -1980,35 +2181,141 @@ video_setWindowCenteredOnDisplay(void *arg) return TEST_COMPLETED; } +/** + * Tests window surface functionality + */ +static int video_getWindowSurface(void *arg) +{ + const char *title = "video_getWindowSurface Test Window"; + SDL_Window *window; + SDL_Surface *surface; + SDL_Renderer *renderer; + Uint32 renderer_flags = SDL_RENDERER_ACCELERATED; + int result; + + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) { + renderer_flags = SDL_RENDERER_SOFTWARE; + } + + /* Make sure we're testing interaction with an accelerated renderer */ + SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION, "1"); + + window = SDL_CreateWindow(title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 320, 0); + SDLTest_AssertPass("Call to SDL_CreateWindow('%s', SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 320, 0)", title); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); + + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface != NULL, "Validate that returned surface is not NULL"); + SDLTest_AssertCheck(SDL_HasWindowSurface(window), "Validate that window has a surface"); + + result = SDL_UpdateWindowSurface(window); + SDLTest_AssertPass("Call to SDL_UpdateWindowSurface(window)"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + + /* We shouldn't be able to create a renderer on a window with a surface */ + renderer = SDL_CreateRenderer(window, -1, renderer_flags); + SDLTest_AssertPass("Call to SDL_CreateRenderer(window)"); + SDLTest_AssertCheck(renderer == NULL, "Validate that returned renderer is NULL"); + + result = SDL_DestroyWindowSurface(window); + SDLTest_AssertPass("Call to SDL_DestroyWindowSurface(window)"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + SDLTest_AssertCheck(!SDL_HasWindowSurface(window), "Validate that window does not have a surface"); + + /* We should be able to create a renderer on the window now */ + renderer = SDL_CreateRenderer(window, -1, renderer_flags); + SDLTest_AssertPass("Call to SDL_CreateRenderer(window)"); + SDLTest_AssertCheck(renderer != NULL, "Validate that returned renderer is not NULL"); + + /* We should not be able to create a window surface now, unless it was created by the renderer */ + if (!SDL_HasWindowSurface(window)) { + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface == NULL, "Validate that returned surface is NULL"); + } + + SDL_DestroyRenderer(renderer); + SDLTest_AssertPass("Call to SDL_DestroyRenderer(renderer)"); + SDLTest_AssertCheck(!SDL_HasWindowSurface(window), "Validate that window does not have a surface"); + + /* We should be able to create a window surface again */ + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface != NULL, "Validate that returned surface is not NULL"); + SDLTest_AssertCheck(SDL_HasWindowSurface(window), "Validate that window has a surface"); + + /* Clean up */ + SDL_DestroyWindow(window); + + return TEST_COMPLETED; +} + +/** + * Tests SDL_SetWindowInputFocus + */ +static int video_setWindowInputFocus(void *arg) +{ + int result; + SDL_Window *window; + + SDLTest_AssertPass("SDL_SetWindowInputFocus is not supported on dummy and SDL2 wayland driver"); + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0 || SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { + return TEST_SKIPPED; + } + + window = _createVideoSuiteTestWindow("video_setWindowInputFocus"); + if (!window) { + return TEST_ABORTED; + } + + SDLTest_AssertPass("About to call SDL_SetWindowInputFocus(window)"); + result = SDL_SetWindowInputFocus(window); + SDLTest_AssertCheck(result == 0, "Result is %d, expected 0", result); + + _destroyVideoSuiteTestWindow(window); + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Video test cases */ -static const SDLTest_TestCaseReference videoTest1 = - { (SDLTest_TestCaseFp)video_enableDisableScreensaver, "video_enableDisableScreensaver", "Enable and disable screenaver while checking state", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest1 = { + (SDLTest_TestCaseFp)video_enableDisableScreensaver, "video_enableDisableScreensaver", "Enable and disable screenaver while checking state", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest2 = - { (SDLTest_TestCaseFp)video_createWindowVariousPositions, "video_createWindowVariousPositions", "Create windows at various locations", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest2 = { + (SDLTest_TestCaseFp)video_createWindowVariousPositions, "video_createWindowVariousPositions", "Create windows at various locations", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest3 = - { (SDLTest_TestCaseFp)video_createWindowVariousSizes, "video_createWindowVariousSizes", "Create windows with various sizes", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest3 = { + (SDLTest_TestCaseFp)video_createWindowVariousSizes, "video_createWindowVariousSizes", "Create windows with various sizes", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest4 = - { (SDLTest_TestCaseFp)video_createWindowVariousFlags, "video_createWindowVariousFlags", "Create windows using various flags", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest4 = { + (SDLTest_TestCaseFp)video_createWindowVariousFlags, "video_createWindowVariousFlags", "Create windows using various flags", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest5 = - { (SDLTest_TestCaseFp)video_getWindowFlags, "video_getWindowFlags", "Get window flags set during SDL_CreateWindow", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest5 = { + (SDLTest_TestCaseFp)video_getWindowFlags, "video_getWindowFlags", "Get window flags set during SDL_CreateWindow", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest6 = - { (SDLTest_TestCaseFp)video_getNumDisplayModes, "video_getNumDisplayModes", "Use SDL_GetNumDisplayModes function to get number of display modes", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest6 = { + (SDLTest_TestCaseFp)video_getNumDisplayModes, "video_getNumDisplayModes", "Use SDL_GetNumDisplayModes function to get number of display modes", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest7 = - { (SDLTest_TestCaseFp)video_getNumDisplayModesNegative, "video_getNumDisplayModesNegative", "Negative tests for SDL_GetNumDisplayModes", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest7 = { + (SDLTest_TestCaseFp)video_getNumDisplayModesNegative, "video_getNumDisplayModesNegative", "Negative tests for SDL_GetNumDisplayModes", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest8 = - { (SDLTest_TestCaseFp)video_getClosestDisplayModeCurrentResolution, "video_getClosestDisplayModeCurrentResolution", "Use function to get closes match to requested display mode for current resolution", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest8 = { + (SDLTest_TestCaseFp)video_getClosestDisplayModeCurrentResolution, "video_getClosestDisplayModeCurrentResolution", "Use function to get closes match to requested display mode for current resolution", TEST_ENABLED +}; -static const SDLTest_TestCaseReference videoTest9 = - { (SDLTest_TestCaseFp)video_getClosestDisplayModeRandomResolution, "video_getClosestDisplayModeRandomResolution", "Use function to get closes match to requested display mode for random resolution", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest9 = { + (SDLTest_TestCaseFp)video_getClosestDisplayModeRandomResolution, "video_getClosestDisplayModeRandomResolution", "Use function to get closes match to requested display mode for random resolution", TEST_ENABLED +}; static const SDLTest_TestCaseReference videoTest10 = { (SDLTest_TestCaseFp)video_getWindowBrightness, "video_getWindowBrightness", "Get window brightness", TEST_ENABLED }; @@ -2055,13 +2362,20 @@ static const SDLTest_TestCaseReference videoTest23 = static const SDLTest_TestCaseReference videoTest24 = { (SDLTest_TestCaseFp) video_setWindowCenteredOnDisplay, "video_setWindowCenteredOnDisplay", "Checks using SDL_WINDOWPOS_CENTERED_DISPLAY centers the window on a display", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest25 = { + (SDLTest_TestCaseFp)video_getWindowSurface, "video_getWindowSurface", "Checks window surface functionality", TEST_ENABLED +}; +static const SDLTest_TestCaseReference videoTest26 = { + (SDLTest_TestCaseFp)video_setWindowInputFocus, "video_setWindowInputFocus", "Checks window input focus", TEST_ENABLED +}; + /* Sequence of Video test cases */ -static const SDLTest_TestCaseReference *videoTests[] = { +static const SDLTest_TestCaseReference *videoTests[] = { &videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, &videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, &videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, &videoTest18, &videoTest19, &videoTest20, &videoTest21, &videoTest22, - &videoTest23, &videoTest24, NULL + &videoTest23, &videoTest24, &videoTest25, &videoTest26, NULL }; /* Video test suite (global) */ diff --git a/test/testbounds.c b/test/testbounds.c index 23f9817774d20..cfe9d968cb8b8 100644 --- a/test/testbounds.c +++ b/test/testbounds.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,19 +11,34 @@ */ #include "SDL.h" +#include "SDL_test.h" int main(int argc, char **argv) { int total, i; + SDLTest_CommonState *state; - if (SDL_Init(SDL_INIT_VIDEO) < 0) { + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError()); return 1; } total = SDL_GetNumVideoDisplays(); for (i = 0; i < total; i++) { - SDL_Rect bounds = { -1,-1,-1,-1 }, usable = { -1,-1,-1,-1 }; + SDL_Rect bounds = { -1, -1, -1, -1 }, usable = { -1, -1, -1, -1 }; SDL_GetDisplayBounds(i, &bounds); SDL_GetDisplayUsableBounds(i, &usable); SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}", @@ -32,7 +47,7 @@ int main(int argc, char **argv) usable.x, usable.y, usable.w, usable.h); } - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c index b3ffdbc423f57..2d13fd505e768 100644 --- a/test/testcustomcursor.c +++ b/test/testcustomcursor.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,59 +22,58 @@ /* Stolen from the mailing list */ /* Creates a new mouse cursor from an XPM */ - /* XPM */ static const char *arrow[] = { - /* width height num_colors chars_per_pixel */ - " 32 32 3 1", - /* colors */ - "X c #000000", - ". c #ffffff", - " c None", - /* pixels */ - "X ", - "XX ", - "X.X ", - "X..X ", - "X...X ", - "X....X ", - "X.....X ", - "X......X ", - "X.......X ", - "X........X ", - "X.....XXXXX ", - "X..X..X ", - "X.X X..X ", - "XX X..X ", - "X X..X ", - " X..X ", - " X..X ", - " X..X ", - " XX ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - "0,0" -}; - -static SDL_Cursor* + /* width height num_colors chars_per_pixel */ + " 32 32 3 1", + /* colors */ + "X c #000000", + ". c #ffffff", + " c None", + /* pixels */ + "X ", + "XX ", + "X.X ", + "X..X ", + "X...X ", + "X....X ", + "X.....X ", + "X......X ", + "X.......X ", + "X........X ", + "X.....XXXXX ", + "X..X..X ", + "X.X X..X ", + "XX X..X ", + "X X..X ", + " X..X ", + " X..X ", + " X..X ", + " XX ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + "0,0" +}; + +static SDL_Cursor * init_color_cursor(const char *file) { SDL_Cursor *cursor = NULL; SDL_Surface *surface = SDL_LoadBMP(file); if (surface) { if (surface->format->palette) { - SDL_SetColorKey(surface, 1, *(Uint8 *) surface->pixels); + SDL_SetColorKey(surface, 1, *(Uint8 *)surface->pixels); } else { switch (surface->format->BitsPerPixel) { case 15: @@ -97,45 +96,46 @@ init_color_cursor(const char *file) return cursor; } -static SDL_Cursor* +static SDL_Cursor * init_system_cursor(const char *image[]) { - int i, row, col; - Uint8 data[4*32]; - Uint8 mask[4*32]; - int hot_x, hot_y; - - i = -1; - for (row=0; row<32; ++row) { - for (col=0; col<32; ++col) { - if (col % 8) { - data[i] <<= 1; - mask[i] <<= 1; - } else { - ++i; - data[i] = mask[i] = 0; - } - switch (image[4+row][col]) { - case 'X': - data[i] |= 0x01; - mask[i] |= 0x01; - break; - case '.': - mask[i] |= 0x01; - break; - case ' ': - break; - } + int i, row, col; + Uint8 data[4 * 32]; + Uint8 mask[4 * 32]; + int hot_x = 0; + int hot_y = 0; + + i = -1; + for (row = 0; row < 32; ++row) { + for (col = 0; col < 32; ++col) { + if (col % 8) { + data[i] <<= 1; + mask[i] <<= 1; + } else { + ++i; + data[i] = mask[i] = 0; + } + switch (image[4 + row][col]) { + case 'X': + data[i] |= 0x01; + mask[i] |= 0x01; + break; + case '.': + mask[i] |= 0x01; + break; + case ' ': + break; + } + } } - } - SDL_sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); - return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); + (void)SDL_sscanf(image[4 + row], "%d,%d", &hot_x, &hot_y); + return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); } static SDLTest_CommonState *state; int done; -static SDL_Cursor *cursors[1+SDL_NUM_SYSTEM_CURSORS]; -static SDL_SystemCursor cursor_types[1+SDL_NUM_SYSTEM_CURSORS]; +static SDL_Cursor *cursors[1 + SDL_NUM_SYSTEM_CURSORS]; +static SDL_SystemCursor cursor_types[1 + SDL_NUM_SYSTEM_CURSORS]; static int num_cursors; static int current_cursor; static int show_cursor; @@ -148,8 +148,7 @@ quit(int rc) exit(rc); } -void -loop() +void loop(void) { int i; SDL_Event event; @@ -170,20 +169,48 @@ loop() SDL_SetCursor(cursors[current_cursor]); switch ((int)cursor_types[current_cursor]) { - case (SDL_SystemCursor)-1: SDL_Log("Custom cursor"); break; - case SDL_SYSTEM_CURSOR_ARROW: SDL_Log("Arrow"); break; - case SDL_SYSTEM_CURSOR_IBEAM: SDL_Log("I-beam"); break; - case SDL_SYSTEM_CURSOR_WAIT: SDL_Log("Wait"); break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: SDL_Log("Crosshair"); break; - case SDL_SYSTEM_CURSOR_WAITARROW: SDL_Log("Small wait cursor (or Wait if not available)"); break; - case SDL_SYSTEM_CURSOR_SIZENWSE: SDL_Log("Double arrow pointing northwest and southeast"); break; - case SDL_SYSTEM_CURSOR_SIZENESW: SDL_Log("Double arrow pointing northeast and southwest"); break; - case SDL_SYSTEM_CURSOR_SIZEWE: SDL_Log("Double arrow pointing west and east"); break; - case SDL_SYSTEM_CURSOR_SIZENS: SDL_Log("Double arrow pointing north and south"); break; - case SDL_SYSTEM_CURSOR_SIZEALL: SDL_Log("Four pointed arrow pointing north, south, east, and west"); break; - case SDL_SYSTEM_CURSOR_NO: SDL_Log("Slashed circle or crossbones"); break; - case SDL_SYSTEM_CURSOR_HAND: SDL_Log("Hand"); break; - default: SDL_Log("UNKNOWN CURSOR TYPE, FIX THIS PROGRAM."); break; + case (SDL_SystemCursor)-1: + SDL_Log("Custom cursor"); + break; + case SDL_SYSTEM_CURSOR_ARROW: + SDL_Log("Arrow"); + break; + case SDL_SYSTEM_CURSOR_IBEAM: + SDL_Log("I-beam"); + break; + case SDL_SYSTEM_CURSOR_WAIT: + SDL_Log("Wait"); + break; + case SDL_SYSTEM_CURSOR_CROSSHAIR: + SDL_Log("Crosshair"); + break; + case SDL_SYSTEM_CURSOR_WAITARROW: + SDL_Log("Small wait cursor (or Wait if not available)"); + break; + case SDL_SYSTEM_CURSOR_SIZENWSE: + SDL_Log("Double arrow pointing northwest and southeast"); + break; + case SDL_SYSTEM_CURSOR_SIZENESW: + SDL_Log("Double arrow pointing northeast and southwest"); + break; + case SDL_SYSTEM_CURSOR_SIZEWE: + SDL_Log("Double arrow pointing west and east"); + break; + case SDL_SYSTEM_CURSOR_SIZENS: + SDL_Log("Double arrow pointing north and south"); + break; + case SDL_SYSTEM_CURSOR_SIZEALL: + SDL_Log("Four pointed arrow pointing north, south, east, and west"); + break; + case SDL_SYSTEM_CURSOR_NO: + SDL_Log("Slashed circle or crossbones"); + break; + case SDL_SYSTEM_CURSOR_HAND: + SDL_Log("Hand"); + break; + default: + SDL_Log("UNKNOWN CURSOR TYPE, FIX THIS PROGRAM."); + break; } } else { @@ -192,7 +219,7 @@ loop() } } } - + for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; SDL_RenderClear(renderer); @@ -205,8 +232,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; const char *color_cursor = NULL; @@ -293,7 +319,7 @@ main(int argc, char *argv[]) quit(0); /* keep the compiler happy ... */ - return(0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c index 297632c04d38a..783e4891ae5d1 100644 --- a/test/testdisplayinfo.c +++ b/test/testdisplayinfo.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,6 +13,7 @@ /* Program to test querying of display info */ #include "SDL.h" +#include "SDL_test.h" #include #include @@ -20,25 +21,35 @@ static void print_mode(const char *prefix, const SDL_DisplayMode *mode) { - if (!mode) + if (!mode) { return; + } SDL_Log("%s: fmt=%s w=%d h=%d refresh=%d\n", prefix, SDL_GetPixelFormatName(mode->format), mode->w, mode->h, mode->refresh_rate); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_DisplayMode mode; int num_displays, dpy; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Load the SDL library */ - if (SDL_Init(SDL_INIT_VIDEO) < 0) { + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; } @@ -80,7 +91,7 @@ main(int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, " MODE %d: failed to query (%s)\n", m, SDL_GetError()); } else { char prefix[64]; - SDL_snprintf(prefix, sizeof (prefix), " MODE %d", m); + (void)SDL_snprintf(prefix, sizeof(prefix), " MODE %d", m); print_mode(prefix, &mode); } } @@ -88,7 +99,7 @@ main(int argc, char *argv[]) SDL_Log("\n"); } - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testdraw2.c b/test/testdraw2.c index 0df5ba3ed587f..4e8c5a29b7d6e 100644 --- a/test/testdraw2.c +++ b/test/testdraw2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,8 +37,7 @@ static const Uint32 fps_check_delay = 5000; int done; -void -DrawPoints(SDL_Renderer * renderer) +void DrawPoints(SDL_Renderer *renderer) { int i; int x, y; @@ -71,8 +70,8 @@ DrawPoints(SDL_Renderer * renderer) cycle_direction = -cycle_direction; } } - SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, - (Uint8) current_color, (Uint8) current_alpha); + SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, + (Uint8)current_color, (Uint8)current_alpha); x = rand() % viewport.w; y = rand() % viewport.h; @@ -80,8 +79,7 @@ DrawPoints(SDL_Renderer * renderer) } } -void -DrawLines(SDL_Renderer * renderer) +void DrawLines(SDL_Renderer *renderer) { int i; int x1, y1, x2, y2; @@ -114,8 +112,8 @@ DrawLines(SDL_Renderer * renderer) cycle_direction = -cycle_direction; } } - SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, - (Uint8) current_color, (Uint8) current_alpha); + SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, + (Uint8)current_color, (Uint8)current_alpha); if (i == 0) { SDL_RenderDrawLine(renderer, 0, 0, viewport.w - 1, viewport.h - 1); @@ -123,17 +121,16 @@ DrawLines(SDL_Renderer * renderer) SDL_RenderDrawLine(renderer, 0, viewport.h / 2, viewport.w - 1, viewport.h / 2); SDL_RenderDrawLine(renderer, viewport.w / 2, 0, viewport.w / 2, viewport.h - 1); } else { - x1 = (rand() % (viewport.w*2)) - viewport.w; - x2 = (rand() % (viewport.w*2)) - viewport.w; - y1 = (rand() % (viewport.h*2)) - viewport.h; - y2 = (rand() % (viewport.h*2)) - viewport.h; + x1 = (rand() % (viewport.w * 2)) - viewport.w; + x2 = (rand() % (viewport.w * 2)) - viewport.w; + y1 = (rand() % (viewport.h * 2)) - viewport.h; + y2 = (rand() % (viewport.h * 2)) - viewport.h; SDL_RenderDrawLine(renderer, x1, y1, x2, y2); } } } -void -DrawRects(SDL_Renderer * renderer) +void DrawRects(SDL_Renderer *renderer) { int i; SDL_Rect rect; @@ -166,19 +163,18 @@ DrawRects(SDL_Renderer * renderer) cycle_direction = -cycle_direction; } } - SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, - (Uint8) current_color, (Uint8) current_alpha); + SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, + (Uint8)current_color, (Uint8)current_alpha); rect.w = rand() % (viewport.h / 2); rect.h = rand() % (viewport.h / 2); - rect.x = (rand() % (viewport.w*2) - viewport.w) - (rect.w / 2); - rect.y = (rand() % (viewport.h*2) - viewport.h) - (rect.h / 2); + rect.x = (rand() % (viewport.w * 2) - viewport.w) - (rect.w / 2); + rect.y = (rand() % (viewport.h * 2) - viewport.h) - (rect.h / 2); SDL_RenderFillRect(renderer, &rect); } } -void -loop() +void loop(void) { Uint32 now; int i; @@ -190,8 +186,9 @@ loop() } for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); @@ -211,16 +208,14 @@ loop() if (SDL_TICKS_PASSED(now, next_fps_check)) { /* Print out some timing information */ const Uint32 then = next_fps_check - fps_check_delay; - const double fps = ((double) frames * 1000) / (now - then); + const double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); next_fps_check = now + fps_check_delay; frames = 0; } - } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; @@ -269,12 +264,13 @@ main(int argc, char *argv[]) } } if (consumed < 0) { - static const char *options[] = { - "[--blend none|blend|add|mod]", + static const char *options[] = { + "[--blend none|blend|add|mod]", "[--cyclecolor]", "[--cyclealpha]", "[num_objects]", - NULL }; + NULL + }; SDLTest_CommonLogUsage(state, argv[0], options); return 1; } @@ -307,7 +303,6 @@ main(int argc, char *argv[]) } #endif - SDLTest_CommonQuit(state); return 0; diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c index f3636f38928e7..db9da41c9dea7 100644 --- a/test/testdrawchessboard.c +++ b/test/testdrawchessboard.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,7 +12,10 @@ This file is created by : Nitin Jain (nitin.j4@samsung.com) */ -/* Sample program: Draw a Chess Board by using SDL_CreateSoftwareRenderer API */ +/* Sample program: Draw a Chess Board by using the SDL render API */ + +/* This allows testing SDL_CreateSoftwareRenderer with the window surface API. Undefine it to use the accelerated renderer instead. */ +#define USE_SOFTWARE_RENDERER #include #include @@ -25,28 +28,28 @@ SDL_Window *window; SDL_Renderer *renderer; -SDL_Surface *surface; int done; -void -DrawChessBoard() +#ifdef USE_SOFTWARE_RENDERER +SDL_Surface *surface; +#endif + +void DrawChessBoard(void) { - int row = 0,column = 0,x = 0; + int row = 0, column = 0, x = 0; SDL_Rect rect, darea; /* Get the Size of drawing surface */ SDL_RenderGetViewport(renderer, &darea); - for( ; row < 8; row++) - { - column = row%2; + for (; row < 8; row++) { + column = row % 2; x = column; - for( ; column < 4+(row%2); column++) - { + for (; column < 4 + (row % 2); column++) { SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF); - rect.w = darea.w/8; - rect.h = darea.h/8; + rect.w = darea.w / 8; + rect.h = darea.h / 8; rect.x = x * rect.w; rect.y = row * rect.h; x = x + 2; @@ -55,25 +58,26 @@ DrawChessBoard() } } -void -loop() +void loop(void) { SDL_Event e; while (SDL_PollEvent(&e)) { - - /* Re-create when window has been resized */ - if ((e.type == SDL_WINDOWEVENT) && (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)) { - SDL_DestroyRenderer(renderer); +#ifdef USE_SOFTWARE_RENDERER + /* Re-create when window has been resized */ + if ((e.type == SDL_WINDOWEVENT) && (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)) { - surface = SDL_GetWindowSurface(window); - renderer = SDL_CreateSoftwareRenderer(surface); - /* Clear the rendering surface with the specified color */ - SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); - SDL_RenderClear(renderer); - } + SDL_DestroyRenderer(renderer); - if (e.type == SDL_QUIT) { + surface = SDL_GetWindowSurface(window); + renderer = SDL_CreateSoftwareRenderer(surface); + /* Clear the rendering surface with the specified color */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_RenderClear(renderer); + } +#endif + + if (e.type == SDL_QUIT) { done = 1; #ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); @@ -90,47 +94,49 @@ loop() } } + /* Clear the rendering surface with the specified color */ + SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); + SDL_RenderClear(renderer); + DrawChessBoard(); + SDL_RenderPresent(renderer); + +#ifdef USE_SOFTWARE_RENDERER /* Got everything on rendering surface, now Update the drawing image on window screen */ SDL_UpdateWindowSurface(window); +#endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL */ - if(SDL_Init(SDL_INIT_VIDEO) != 0) - { + if (SDL_Init(SDL_INIT_VIDEO) != 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init fail : %s\n", SDL_GetError()); return 1; } - /* Create window and renderer for given surface */ window = SDL_CreateWindow("Chess Board", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_RESIZABLE); - if(!window) - { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n",SDL_GetError()); + if (!window) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Window creation fail : %s\n", SDL_GetError()); return 1; } +#ifdef USE_SOFTWARE_RENDERER surface = SDL_GetWindowSurface(window); renderer = SDL_CreateSoftwareRenderer(surface); - if(!renderer) - { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n",SDL_GetError()); +#else + renderer = SDL_CreateRenderer(window, -1, 0); +#endif + if (!renderer) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Render creation for surface fail : %s\n", SDL_GetError()); return 1; } - /* Clear the rendering surface with the specified color */ - SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); - SDL_RenderClear(renderer); - - /* Draw the Image on rendering surface */ done = 0; #ifdef __EMSCRIPTEN__ diff --git a/test/testdropfile.c b/test/testdropfile.c index 95212472a5e9f..80fcd4a121232 100644 --- a/test/testdropfile.c +++ b/test/testdropfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,8 +25,7 @@ quit(int rc) exit(rc); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, done; SDL_Event event; @@ -76,13 +75,13 @@ main(int argc, char *argv[]) /* Check for events */ while (SDL_PollEvent(&event)) { if (event.type == SDL_DROPBEGIN) { - SDL_Log("Drop beginning on window %u", (unsigned int) event.drop.windowID); + SDL_Log("Drop beginning on window %u", (unsigned int)event.drop.windowID); } else if (event.type == SDL_DROPCOMPLETE) { - SDL_Log("Drop complete on window %u", (unsigned int) event.drop.windowID); + SDL_Log("Drop complete on window %u", (unsigned int)event.drop.windowID); } else if ((event.type == SDL_DROPFILE) || (event.type == SDL_DROPTEXT)) { const char *typestr = (event.type == SDL_DROPFILE) ? "File" : "Text"; char *dropped_filedir = event.drop.file; - SDL_Log("%s dropped on window %u: %s", typestr, (unsigned int) event.drop.windowID, dropped_filedir); + SDL_Log("%s dropped on window %u: %s", typestr, (unsigned int)event.drop.windowID, dropped_filedir); /* Normally you'd have to do this, but this is freed in SDLTest_CommonEvent() */ /*SDL_free(dropped_filedir);*/ } @@ -93,7 +92,7 @@ main(int argc, char *argv[]) quit(0); /* keep the compiler happy ... */ - return(0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testerror.c b/test/testerror.c index c118abdee7298..83df188e20537 100644 --- a/test/testerror.c +++ b/test/testerror.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -16,6 +16,7 @@ #include #include "SDL.h" +#include "SDL_test.h" static int alive = 0; @@ -32,27 +33,36 @@ ThreadFunc(void *data) { /* Set the child thread error string */ SDL_SetError("Thread %s (%lu) had a problem: %s", - (char *) data, SDL_ThreadID(), "nevermind"); + (char *)data, SDL_ThreadID(), "nevermind"); while (alive) { - SDL_Log("Thread '%s' is alive!\n", (char *) data); + SDL_Log("Thread '%s' is alive!\n", (char *)data); SDL_Delay(1 * 1000); } SDL_Log("Child thread error string: %s\n", SDL_GetError()); - return (0); + return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Thread *thread; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Load the SDL library */ - if (SDL_Init(0) < 0) { + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } /* Set the error value for the main thread */ @@ -66,7 +76,7 @@ main(int argc, char *argv[]) alive = 1; thread = SDL_CreateThread(ThreadFunc, NULL, "#1"); - if (thread == NULL) { + if (!thread) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } @@ -77,6 +87,6 @@ main(int argc, char *argv[]) SDL_Log("Main thread error string: %s\n", SDL_GetError()); - SDL_Quit(); - return (0); + SDLTest_CommonQuit(state); + return 0; } diff --git a/test/testevdev.c b/test/testevdev.c index 22465ff81647c..07e85c521cb18 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga Copyright (C) 2020-2022 Collabora Ltd. This software is provided 'as-is', without any express or implied @@ -18,7 +18,7 @@ static int run_test(void); -#if HAVE_LIBUDEV_H || defined(SDL_JOYSTICK_LINUX) +#if defined(HAVE_LIBUDEV_H) || defined(SDL_JOYSTICK_LINUX) #include @@ -31,10 +31,11 @@ static const struct { int code; const char *name; -} device_classes[] = -{ -#define CLS(x) \ - { SDL_UDEV_DEVICE_ ## x, #x } +} device_classes[] = { +#define CLS(x) \ + { \ + SDL_UDEV_DEVICE_##x, #x \ + } CLS(MOUSE), CLS(KEYBOARD), CLS(JOYSTICK), @@ -48,18 +49,18 @@ static const struct typedef struct { - const char *name; - uint16_t bus_type; - uint16_t vendor_id; - uint16_t product_id; - uint16_t version; - uint8_t ev[(EV_MAX + 1) / 8]; - uint8_t keys[(KEY_MAX + 1) / 8]; - uint8_t abs[(ABS_MAX + 1) / 8]; - uint8_t rel[(REL_MAX + 1) / 8]; - uint8_t ff[(FF_MAX + 1) / 8]; - uint8_t props[INPUT_PROP_MAX / 8]; - int expected; + const char *name; + uint16_t bus_type; + uint16_t vendor_id; + uint16_t product_id; + uint16_t version; + uint8_t ev[(EV_MAX + 1) / 8]; + uint8_t keys[(KEY_MAX + 1) / 8]; + uint8_t abs[(ABS_MAX + 1) / 8]; + uint8_t rel[(REL_MAX + 1) / 8]; + uint8_t ff[(FF_MAX + 1) / 8]; + uint8_t props[INPUT_PROP_MAX / 8]; + int expected; } GuessTest; /* @@ -73,10 +74,11 @@ typedef struct */ #define ZEROx4 0, 0, 0, 0 #define ZEROx8 ZEROx4, ZEROx4 -#define FFx4 0xff, 0xff, 0xff, 0xff -#define FFx8 FFx4, FFx4 +#define FFx4 0xff, 0xff, 0xff, 0xff +#define FFx8 FFx4, FFx4 /* Test-cases derived from real devices or from Linux kernel source */ +/* *INDENT-OFF* */ /* clang-format off */ static const GuessTest guess_tests[] = { { @@ -934,6 +936,7 @@ static const GuessTest guess_tests[] = .expected = SDL_UDEV_DEVICE_UNKNOWN, } }; +/* *INDENT-ON* */ /* clang-format on */ /* The Linux kernel provides capability info in EVIOCGBIT and in /sys * as an array of unsigned long in native byte order, rather than an array @@ -950,7 +953,7 @@ static const GuessTest guess_tests[] = * an appropriate byteswapping function for the architecture's word size. */ SDL_COMPILE_TIME_ASSERT(sizeof_long, sizeof(unsigned long) == 4 || sizeof(unsigned long) == 8); #define SwapLongLE(X) \ - ((sizeof(unsigned long) == 4) ? SDL_SwapLE32(X) : SDL_SwapLE64(X)) + ((sizeof(unsigned long) == 4) ? SDL_SwapLE32(X) : SDL_SwapLE64(X)) static int run_test(void) @@ -962,7 +965,8 @@ run_test(void) const GuessTest *t = &guess_tests[i]; size_t j; int actual; - struct { + struct + { unsigned long ev[NBITS(EV_MAX)]; unsigned long abs[NBITS(ABS_MAX)]; unsigned long keys[NBITS(KEY_MAX)]; @@ -998,8 +1002,7 @@ run_test(void) if (actual == t->expected) { printf("\tOK\n"); - } - else { + } else { printf("\tExpected 0x%08x\n", t->expected); for (j = 0; device_classes[j].code != 0; j++) { @@ -1034,8 +1037,7 @@ run_test(void) #endif -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { return run_test() ? 0 : 1; } diff --git a/test/testfile.c b/test/testfile.c index 25a3092016c18..67ef4ae3b4942 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,27 +13,26 @@ /* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */ /* quiet windows compiler warnings */ +#if defined(_MSC_VER) && !defined(_CRT_NONSTDC_NO_WARNINGS) #define _CRT_NONSTDC_NO_WARNINGS +#endif +#include #include - #ifndef _MSC_VER #include #endif #include "SDL.h" - -#include - /* WARNING ! those 2 files will be destroyed by this test program */ #ifdef __IPHONEOS__ #define FBASENAME1 "../Documents/sdldata1" /* this file will be created during tests */ #define FBASENAME2 "../Documents/sdldata2" /* this file should not exist before starting test */ #else -#define FBASENAME1 "sdldata1" /* this file will be created during tests */ -#define FBASENAME2 "sdldata2" /* this file should not exist before starting test */ +#define FBASENAME1 "sdldata1" /* this file will be created during tests */ +#define FBASENAME2 "sdldata2" /* this file should not exist before starting test */ #endif #ifndef NULL @@ -48,22 +47,19 @@ cleanup(void) } static void -rwops_error_quit(unsigned line, SDL_RWops * rwops) +rwops_error_quit(unsigned line, SDL_RWops *rwops) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "testfile.c(%d): failed\n", line); if (rwops) { - rwops->close(rwops); /* This calls SDL_FreeRW(rwops); */ + rwops->close(rwops); /* This calls SDL_FreeRW(rwops); */ } cleanup(); - exit(1); /* quit with rwops error (test failed) */ + exit(1); /* quit with rwops error (test failed) */ } -#define RWOP_ERR_QUIT(x) rwops_error_quit( __LINE__, (x) ) +#define RWOP_ERR_QUIT(x) rwops_error_quit(__LINE__, (x)) - - -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_RWops *rwops = NULL; char test_buf[30]; @@ -73,211 +69,289 @@ main(int argc, char *argv[]) cleanup(); -/* test 1 : basic argument test: all those calls to SDL_RWFromFile should fail */ + /* test 1 : basic argument test: all those calls to SDL_RWFromFile should fail */ rwops = SDL_RWFromFile(NULL, NULL); - if (rwops) + if (rwops) { RWOP_ERR_QUIT(rwops); + } rwops = SDL_RWFromFile(NULL, "ab+"); - if (rwops) + if (rwops) { RWOP_ERR_QUIT(rwops); + } rwops = SDL_RWFromFile(NULL, "sldfkjsldkfj"); - if (rwops) + if (rwops) { RWOP_ERR_QUIT(rwops); + } rwops = SDL_RWFromFile("something", ""); - if (rwops) + if (rwops) { RWOP_ERR_QUIT(rwops); + } rwops = SDL_RWFromFile("something", NULL); - if (rwops) + if (rwops) { RWOP_ERR_QUIT(rwops); + } SDL_Log("test1 OK\n"); -/* test 2 : check that inexistent file is not successfully opened/created when required */ -/* modes : r, r+ imply that file MUST exist - modes : a, a+, w, w+ checks that it succeeds (file may not exists) + /* test 2 : check that inexistent file is not successfully opened/created when required */ + /* modes : r, r+ imply that file MUST exist + modes : a, a+, w, w+ checks that it succeeds (file may not exists) - */ - rwops = SDL_RWFromFile(FBASENAME2, "rb"); /* this file doesn't exist that call must fail */ - if (rwops) + */ + rwops = SDL_RWFromFile(FBASENAME2, "rb"); /* this file doesn't exist that call must fail */ + if (rwops) { RWOP_ERR_QUIT(rwops); - rwops = SDL_RWFromFile(FBASENAME2, "rb+"); /* this file doesn't exist that call must fail */ - if (rwops) + } + rwops = SDL_RWFromFile(FBASENAME2, "rb+"); /* this file doesn't exist that call must fail */ + if (rwops) { RWOP_ERR_QUIT(rwops); + } rwops = SDL_RWFromFile(FBASENAME2, "wb"); - if (!rwops) + if (!rwops) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "wb+"); - if (!rwops) + if (!rwops) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "ab"); - if (!rwops) + if (!rwops) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); unlink(FBASENAME2); rwops = SDL_RWFromFile(FBASENAME2, "ab+"); - if (!rwops) + if (!rwops) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); unlink(FBASENAME2); SDL_Log("test2 OK\n"); -/* test 3 : creation, writing , reading, seeking, - test : w mode, r mode, w+ mode - */ - rwops = SDL_RWFromFile(FBASENAME1, "wb"); /* write only */ - if (!rwops) + /* test 3 : creation, writing , reading, seeking, + test : w mode, r mode, w+ mode + */ + rwops = SDL_RWFromFile(FBASENAME1, "wb"); /* write only */ + if (!rwops) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->write(rwops, "1234567890", 10, 1)) + } + if (1 != rwops->write(rwops, "1234567890", 10, 1)) { RWOP_ERR_QUIT(rwops); - if (10 != rwops->write(rwops, "1234567890", 1, 10)) + } + if (10 != rwops->write(rwops, "1234567890", 1, 10)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->write(rwops, "1234567", 1, 7)) + } + if (7 != rwops->write(rwops, "1234567", 1, 7)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 1, 1)) - RWOP_ERR_QUIT(rwops); /* we are in write only mode */ + } + if (0 != rwops->read(rwops, test_buf, 1, 1)) { + RWOP_ERR_QUIT(rwops); /* we are in write only mode */ + } + rwops->close(rwops); - rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exists */ - if (!rwops) + rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exists */ + if (!rwops) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) + } + if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->read(rwops, test_buf, 1, 7)) + } + if (7 != rwops->read(rwops, test_buf, 1, 7)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "1234567", 7)) + } + if (SDL_memcmp(test_buf, "1234567", 7) != 0) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 1, 1)) + } + if (0 != rwops->read(rwops, test_buf, 1, 1)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 10, 100)) + } + if (0 != rwops->read(rwops, test_buf, 10, 100)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) + } + if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); - if (2 != rwops->read(rwops, test_buf, 10, 3)) + } + if (2 != rwops->read(rwops, test_buf, 10, 3)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "12345678901234567890", 20)) + } + if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->write(rwops, test_buf, 1, 1)) - RWOP_ERR_QUIT(rwops); /* readonly mode */ + } + if (0 != rwops->write(rwops, test_buf, 1, 1)) { + RWOP_ERR_QUIT(rwops); /* readonly mode */ + } + rwops->close(rwops); -/* test 3: same with w+ mode */ - rwops = SDL_RWFromFile(FBASENAME1, "wb+"); /* write + read + truncation */ - if (!rwops) + /* test 3: same with w+ mode */ + rwops = SDL_RWFromFile(FBASENAME1, "wb+"); /* write + read + truncation */ + if (!rwops) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->write(rwops, "1234567890", 10, 1)) + } + if (1 != rwops->write(rwops, "1234567890", 10, 1)) { RWOP_ERR_QUIT(rwops); - if (10 != rwops->write(rwops, "1234567890", 1, 10)) + } + if (10 != rwops->write(rwops, "1234567890", 1, 10)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->write(rwops, "1234567", 1, 7)) + } + if (7 != rwops->write(rwops, "1234567", 1, 7)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->read(rwops, test_buf, 1, 1)) - RWOP_ERR_QUIT(rwops); /* we are in read/write mode */ - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (1 != rwops->read(rwops, test_buf, 1, 1)) { + RWOP_ERR_QUIT(rwops); /* we are in read/write mode */ + } + + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) + } + if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->read(rwops, test_buf, 1, 7)) + } + if (7 != rwops->read(rwops, test_buf, 1, 7)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "1234567", 7)) + } + if (SDL_memcmp(test_buf, "1234567", 7) != 0) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 1, 1)) + } + if (0 != rwops->read(rwops, test_buf, 1, 1)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 10, 100)) + } + if (0 != rwops->read(rwops, test_buf, 10, 100)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) + } + if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); - if (2 != rwops->read(rwops, test_buf, 10, 3)) + } + if (2 != rwops->read(rwops, test_buf, 10, 3)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "12345678901234567890", 20)) + } + if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); SDL_Log("test3 OK\n"); -/* test 4: same in r+ mode */ - rwops = SDL_RWFromFile(FBASENAME1, "rb+"); /* write + read + file must exists, no truncation */ - if (!rwops) + /* test 4: same in r+ mode */ + rwops = SDL_RWFromFile(FBASENAME1, "rb+"); /* write + read + file must exists, no truncation */ + if (!rwops) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->write(rwops, "1234567890", 10, 1)) + } + if (1 != rwops->write(rwops, "1234567890", 10, 1)) { RWOP_ERR_QUIT(rwops); - if (10 != rwops->write(rwops, "1234567890", 1, 10)) + } + if (10 != rwops->write(rwops, "1234567890", 1, 10)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->write(rwops, "1234567", 1, 7)) + } + if (7 != rwops->write(rwops, "1234567", 1, 7)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->read(rwops, test_buf, 1, 1)) - RWOP_ERR_QUIT(rwops); /* we are in read/write mode */ - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (1 != rwops->read(rwops, test_buf, 1, 1)) { + RWOP_ERR_QUIT(rwops); /* we are in read/write mode */ + } + + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) + } + if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->read(rwops, test_buf, 1, 7)) + } + if (7 != rwops->read(rwops, test_buf, 1, 7)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "1234567", 7)) + } + if (SDL_memcmp(test_buf, "1234567", 7) != 0) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 1, 1)) + } + if (0 != rwops->read(rwops, test_buf, 1, 1)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 10, 100)) + } + if (0 != rwops->read(rwops, test_buf, 10, 100)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) + } + if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); - if (2 != rwops->read(rwops, test_buf, 10, 3)) + } + if (2 != rwops->read(rwops, test_buf, 10, 3)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "12345678901234567890", 20)) + } + if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); SDL_Log("test4 OK\n"); -/* test5 : append mode */ - rwops = SDL_RWFromFile(FBASENAME1, "ab+"); /* write + read + append */ - if (!rwops) + /* test5 : append mode */ + rwops = SDL_RWFromFile(FBASENAME1, "ab+"); /* write + read + append */ + if (!rwops) { RWOP_ERR_QUIT(rwops); - if (1 != rwops->write(rwops, "1234567890", 10, 1)) + } + if (1 != rwops->write(rwops, "1234567890", 10, 1)) { RWOP_ERR_QUIT(rwops); - if (10 != rwops->write(rwops, "1234567890", 1, 10)) + } + if (10 != rwops->write(rwops, "1234567890", 1, 10)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->write(rwops, "1234567", 1, 7)) + } + if (7 != rwops->write(rwops, "1234567", 1, 7)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); + } - if (1 != rwops->read(rwops, test_buf, 1, 1)) + if (1 != rwops->read(rwops, test_buf, 1, 1)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + } + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); + } - if (20 + 27 != rwops->seek(rwops, -7, RW_SEEK_END)) + if (20 + 27 != rwops->seek(rwops, -7, RW_SEEK_END)) { RWOP_ERR_QUIT(rwops); - if (7 != rwops->read(rwops, test_buf, 1, 7)) + } + if (7 != rwops->read(rwops, test_buf, 1, 7)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "1234567", 7)) + } + if (SDL_memcmp(test_buf, "1234567", 7) != 0) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 1, 1)) + } + if (0 != rwops->read(rwops, test_buf, 1, 1)) { RWOP_ERR_QUIT(rwops); - if (0 != rwops->read(rwops, test_buf, 10, 100)) + } + if (0 != rwops->read(rwops, test_buf, 10, 100)) { RWOP_ERR_QUIT(rwops); + } - if (27 != rwops->seek(rwops, -27, RW_SEEK_CUR)) + if (27 != rwops->seek(rwops, -27, RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); + } - if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) + if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); - if (3 != rwops->read(rwops, test_buf, 10, 3)) + } + if (3 != rwops->read(rwops, test_buf, 10, 3)) { RWOP_ERR_QUIT(rwops); - if (SDL_memcmp(test_buf, "123456789012345678901234567123", 30)) + } + if (SDL_memcmp(test_buf, "123456789012345678901234567123", 30) != 0) { RWOP_ERR_QUIT(rwops); + } rwops->close(rwops); SDL_Log("test5 OK\n"); cleanup(); - return 0; /* all ok */ + return 0; /* all ok */ } diff --git a/test/testfilesystem.c b/test/testfilesystem.c index d60308d0fd71d..f73336f01f66a 100644 --- a/test/testfilesystem.c +++ b/test/testfilesystem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,48 +13,59 @@ #include #include "SDL.h" +#include "SDL_test.h" -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { char *base_path; char *pref_path; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if (SDL_Init(0) == -1) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init() failed: %s\n", SDL_GetError()); + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; } base_path = SDL_GetBasePath(); - if(base_path == NULL){ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", - SDL_GetError()); + if (!base_path) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n", + SDL_GetError()); } else { SDL_Log("base path: '%s'\n", base_path); SDL_free(base_path); } pref_path = SDL_GetPrefPath("libsdl", "test_filesystem"); - if(pref_path == NULL){ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", - SDL_GetError()); + if (!pref_path) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n", + SDL_GetError()); } else { SDL_Log("pref path: '%s'\n", pref_path); SDL_free(pref_path); } pref_path = SDL_GetPrefPath(NULL, "test_filesystem"); - if(pref_path == NULL){ - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path without organization: %s\n", - SDL_GetError()); + if (!pref_path) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path without organization: %s\n", + SDL_GetError()); } else { SDL_Log("pref path: '%s'\n", pref_path); SDL_free(pref_path); } - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testfilesystem_pre.c b/test/testfilesystem_pre.c new file mode 100644 index 0000000000000..632a9907e071c --- /dev/null +++ b/test/testfilesystem_pre.c @@ -0,0 +1,51 @@ +/* + Copyright (C) 1997-2025 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Call SDL_GetPrefPath to warm the SHGetFolderPathW cache */ + +/** + * We noticed frequent ci timeouts running testfilesystem on 32-bit Windows. + * Internally, this functions calls Shell32.SHGetFolderPathW. + */ + +#include "SDL.h" +#include "SDL_test.h" + +int main(int argc, char *argv[]) +{ + SDLTest_CommonState *state; + Uint64 start; + char *path; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + start = SDL_GetTicks(); + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + path = SDL_GetPrefPath("libsdl", "test_filesystem"); + SDL_free(path); + SDL_Log("SDL_GetPrefPath took %" SDL_PRIu64 "ms", SDL_GetTicks() - start); + SDLTest_CommonQuit(state); + return 0; +} diff --git a/test/testgamecontroller.c b/test/testgamecontroller.c index 053bea023dd6f..fa9b2408bac23 100644 --- a/test/testgamecontroller.c +++ b/test/testgamecontroller.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,46 +31,57 @@ #define BUTTON_SIZE 50 #define AXIS_SIZE 50 +#define BUTTON_SIZE 50 +#define AXIS_SIZE 50 /* This is indexed by SDL_GameControllerButton. */ -static const struct { int x; int y; } button_positions[] = { - {387, 167}, /* SDL_CONTROLLER_BUTTON_A */ - {431, 132}, /* SDL_CONTROLLER_BUTTON_B */ - {342, 132}, /* SDL_CONTROLLER_BUTTON_X */ - {389, 101}, /* SDL_CONTROLLER_BUTTON_Y */ - {174, 132}, /* SDL_CONTROLLER_BUTTON_BACK */ - {232, 128}, /* SDL_CONTROLLER_BUTTON_GUIDE */ - {289, 132}, /* SDL_CONTROLLER_BUTTON_START */ - {75, 154}, /* SDL_CONTROLLER_BUTTON_LEFTSTICK */ - {305, 230}, /* SDL_CONTROLLER_BUTTON_RIGHTSTICK */ - {77, 40}, /* SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ - {396, 36}, /* SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ - {154, 188}, /* SDL_CONTROLLER_BUTTON_DPAD_UP */ - {154, 249}, /* SDL_CONTROLLER_BUTTON_DPAD_DOWN */ - {116, 217}, /* SDL_CONTROLLER_BUTTON_DPAD_LEFT */ - {186, 217}, /* SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ - {232, 174}, /* SDL_CONTROLLER_BUTTON_MISC1 */ - {132, 135}, /* SDL_CONTROLLER_BUTTON_PADDLE1 */ - {330, 135}, /* SDL_CONTROLLER_BUTTON_PADDLE2 */ - {132, 175}, /* SDL_CONTROLLER_BUTTON_PADDLE3 */ - {330, 175}, /* SDL_CONTROLLER_BUTTON_PADDLE4 */ - {0, 0}, /* SDL_CONTROLLER_BUTTON_TOUCHPAD */ +static const struct +{ + int x; + int y; +} button_positions[] = { + { 387, 167 }, /* SDL_CONTROLLER_BUTTON_A */ + { 431, 132 }, /* SDL_CONTROLLER_BUTTON_B */ + { 342, 132 }, /* SDL_CONTROLLER_BUTTON_X */ + { 389, 101 }, /* SDL_CONTROLLER_BUTTON_Y */ + { 174, 132 }, /* SDL_CONTROLLER_BUTTON_BACK */ + { 232, 128 }, /* SDL_CONTROLLER_BUTTON_GUIDE */ + { 289, 132 }, /* SDL_CONTROLLER_BUTTON_START */ + { 75, 154 }, /* SDL_CONTROLLER_BUTTON_LEFTSTICK */ + { 305, 230 }, /* SDL_CONTROLLER_BUTTON_RIGHTSTICK */ + { 77, 40 }, /* SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ + { 396, 36 }, /* SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ + { 154, 188 }, /* SDL_CONTROLLER_BUTTON_DPAD_UP */ + { 154, 249 }, /* SDL_CONTROLLER_BUTTON_DPAD_DOWN */ + { 116, 217 }, /* SDL_CONTROLLER_BUTTON_DPAD_LEFT */ + { 186, 217 }, /* SDL_CONTROLLER_BUTTON_DPAD_RIGHT */ + { 232, 174 }, /* SDL_CONTROLLER_BUTTON_MISC1 */ + { 132, 135 }, /* SDL_CONTROLLER_BUTTON_PADDLE1 */ + { 330, 135 }, /* SDL_CONTROLLER_BUTTON_PADDLE2 */ + { 132, 175 }, /* SDL_CONTROLLER_BUTTON_PADDLE3 */ + { 330, 175 }, /* SDL_CONTROLLER_BUTTON_PADDLE4 */ + { 0, 0 }, /* SDL_CONTROLLER_BUTTON_TOUCHPAD */ }; SDL_COMPILE_TIME_ASSERT(button_positions, SDL_arraysize(button_positions) == SDL_CONTROLLER_BUTTON_MAX); /* This is indexed by SDL_GameControllerAxis. */ -static const struct { int x; int y; double angle; } axis_positions[] = { - {74, 153, 270.0}, /* LEFTX */ - {74, 153, 0.0}, /* LEFTY */ - {306, 231, 270.0}, /* RIGHTX */ - {306, 231, 0.0}, /* RIGHTY */ - {91, -20, 0.0}, /* TRIGGERLEFT */ - {375, -20, 0.0}, /* TRIGGERRIGHT */ +static const struct +{ + int x; + int y; + double angle; +} axis_positions[] = { + { 74, 153, 270.0 }, /* LEFTX */ + { 74, 153, 0.0 }, /* LEFTY */ + { 306, 231, 270.0 }, /* RIGHTX */ + { 306, 231, 0.0 }, /* RIGHTY */ + { 91, -20, 0.0 }, /* TRIGGERLEFT */ + { 375, -20, 0.0 }, /* TRIGGERRIGHT */ }; SDL_COMPILE_TIME_ASSERT(axis_positions, SDL_arraysize(axis_positions) == SDL_CONTROLLER_AXIS_MAX); /* This is indexed by SDL_JoystickPowerLevel + 1. */ -static const char* power_level_strings[] = { +static const char *power_level_strings[] = { "unknown", /* SDL_JOYSTICK_POWER_UNKNOWN */ "empty", /* SDL_JOYSTICK_POWER_EMPTY */ "low", /* SDL_JOYSTICK_POWER_LOW */ @@ -96,7 +107,7 @@ static int virtual_axis_start_x; static int virtual_axis_start_y; static SDL_GameControllerButton virtual_button_active = SDL_CONTROLLER_BUTTON_INVALID; -static void UpdateWindowTitle() +static void UpdateWindowTitle(void) { if (!window) { return; @@ -210,6 +221,7 @@ static void AddController(int device_index, SDL_bool verbose) const char *name = SDL_GameControllerName(gamecontroller); const char *path = SDL_GameControllerPath(gamecontroller); SDL_Log("Opened game controller %s%s%s\n", name, path ? ", " : "", path ? path : ""); + SDL_Log("Mapping: %s\n", SDL_GameControllerMapping(gamecontroller)); } firmware_version = SDL_GameControllerGetFirmwareVersion(gamecontroller); @@ -267,7 +279,7 @@ static void DelController(SDL_JoystickID controller) --num_controllers; if (i < num_controllers) { - SDL_memcpy(&gamecontrollers[i], &gamecontrollers[i+1], (num_controllers - i) * sizeof(*gamecontrollers)); + SDL_memcpy(&gamecontrollers[i], &gamecontrollers[i + 1], (num_controllers - i) * sizeof(*gamecontrollers)); } if (num_controllers > 0) { @@ -294,35 +306,34 @@ static Uint16 ConvertAxisToRumble(Sint16 axisval) */ typedef struct { - Uint8 ucEnableBits1; /* 0 */ - Uint8 ucEnableBits2; /* 1 */ - Uint8 ucRumbleRight; /* 2 */ - Uint8 ucRumbleLeft; /* 3 */ - Uint8 ucHeadphoneVolume; /* 4 */ - Uint8 ucSpeakerVolume; /* 5 */ - Uint8 ucMicrophoneVolume; /* 6 */ - Uint8 ucAudioEnableBits; /* 7 */ - Uint8 ucMicLightMode; /* 8 */ - Uint8 ucAudioMuteBits; /* 9 */ - Uint8 rgucRightTriggerEffect[11]; /* 10 */ - Uint8 rgucLeftTriggerEffect[11]; /* 21 */ - Uint8 rgucUnknown1[6]; /* 32 */ - Uint8 ucLedFlags; /* 38 */ - Uint8 rgucUnknown2[2]; /* 39 */ - Uint8 ucLedAnim; /* 41 */ - Uint8 ucLedBrightness; /* 42 */ - Uint8 ucPadLights; /* 43 */ - Uint8 ucLedRed; /* 44 */ - Uint8 ucLedGreen; /* 45 */ - Uint8 ucLedBlue; /* 46 */ + Uint8 ucEnableBits1; /* 0 */ + Uint8 ucEnableBits2; /* 1 */ + Uint8 ucRumbleRight; /* 2 */ + Uint8 ucRumbleLeft; /* 3 */ + Uint8 ucHeadphoneVolume; /* 4 */ + Uint8 ucSpeakerVolume; /* 5 */ + Uint8 ucMicrophoneVolume; /* 6 */ + Uint8 ucAudioEnableBits; /* 7 */ + Uint8 ucMicLightMode; /* 8 */ + Uint8 ucAudioMuteBits; /* 9 */ + Uint8 rgucRightTriggerEffect[11]; /* 10 */ + Uint8 rgucLeftTriggerEffect[11]; /* 21 */ + Uint8 rgucUnknown1[6]; /* 32 */ + Uint8 ucLedFlags; /* 38 */ + Uint8 rgucUnknown2[2]; /* 39 */ + Uint8 ucLedAnim; /* 41 */ + Uint8 ucLedBrightness; /* 42 */ + Uint8 ucPadLights; /* 43 */ + Uint8 ucLedRed; /* 44 */ + Uint8 ucLedGreen; /* 45 */ + Uint8 ucLedBlue; /* 46 */ } DS5EffectsState_t; -static void CyclePS5TriggerEffect() +static void CyclePS5TriggerEffect(void) { DS5EffectsState_t state; - Uint8 effects[3][11] = - { + Uint8 effects[3][11] = { /* Clear trigger effect */ { 0x05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Constant resistance across entire trigger pull */ @@ -340,7 +351,7 @@ static void CyclePS5TriggerEffect() SDL_GameControllerSendEffect(gamecontroller, &state, sizeof(state)); } -static SDL_bool ShowingFront() +static SDL_bool ShowingFront(void) { SDL_bool showing_front = SDL_TRUE; int i; @@ -383,7 +394,7 @@ static int SDLCALL VirtualControllerSetLED(void *userdata, Uint8 red, Uint8 gree return 0; } -static void OpenVirtualController() +static void OpenVirtualController(void) { SDL_VirtualJoystickDesc desc; int virtual_index; @@ -409,11 +420,11 @@ static void OpenVirtualController() } } -static void CloseVirtualController() +static void CloseVirtualController(void) { int i; - for (i = SDL_NumJoysticks(); i--; ) { + for (i = SDL_NumJoysticks(); i--;) { if (SDL_JoystickIsVirtual(i)) { SDL_JoystickDetachVirtual(i); } @@ -508,7 +519,7 @@ static void VirtualControllerMouseMotion(int x, int y) valueY = (Sint16)(distanceY * -SDL_JOYSTICK_AXIS_MIN); } SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, valueX); - SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active+1, valueY); + SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, valueY); } } } @@ -545,14 +556,13 @@ static void VirtualControllerMouseUp(int x, int y) SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, SDL_JOYSTICK_AXIS_MIN); } else { SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active, 0); - SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active+1, 0); + SDL_JoystickSetVirtualAxis(virtual_joystick, virtual_axis_active + 1, 0); } virtual_axis_active = SDL_CONTROLLER_AXIS_INVALID; } } -void -loop(void *arg) +void loop(void *arg) { SDL_Event event; int i; @@ -565,12 +575,12 @@ loop(void *arg) while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) == 1) { switch (event.type) { case SDL_CONTROLLERDEVICEADDED: - SDL_Log("Game controller device %d added.\n", (int) SDL_JoystickGetDeviceInstanceID(event.cdevice.which)); + SDL_Log("Game controller device %d added.\n", (int)SDL_JoystickGetDeviceInstanceID(event.cdevice.which)); AddController(event.cdevice.which, SDL_TRUE); break; case SDL_CONTROLLERDEVICEREMOVED: - SDL_Log("Game controller device %d removed.\n", (int) event.cdevice.which); + SDL_Log("Game controller device %d removed.\n", (int)event.cdevice.which); DelController(event.cdevice.which); break; @@ -592,7 +602,7 @@ loop(void *arg) case SDL_CONTROLLERSENSORUPDATE: SDL_Log("Controller %" SDL_PRIs32 " sensor %s: %.2f, %.2f, %.2f (%" SDL_PRIu64 ")\n", event.csensor.which, - GetSensorName((SDL_SensorType) event.csensor.sensor), + GetSensorName((SDL_SensorType)event.csensor.sensor), event.csensor.data[0], event.csensor.data[1], event.csensor.data[2], @@ -606,7 +616,7 @@ loop(void *arg) if (event.caxis.value <= (-SDL_JOYSTICK_AXIS_MAX / 2) || event.caxis.value >= (SDL_JOYSTICK_AXIS_MAX / 2)) { SetController(event.caxis.which); } - SDL_Log("Controller %" SDL_PRIs32 " axis %s changed to %d\n", event.caxis.which, SDL_GameControllerGetStringForAxis((SDL_GameControllerAxis) event.caxis.axis), event.caxis.value); + SDL_Log("Controller %" SDL_PRIs32 " axis %s changed to %d\n", event.caxis.which, SDL_GameControllerGetStringForAxis((SDL_GameControllerAxis)event.caxis.axis), event.caxis.value); break; #endif /* VERBOSE_AXES */ @@ -615,7 +625,8 @@ loop(void *arg) if (event.type == SDL_CONTROLLERBUTTONDOWN) { SetController(event.cbutton.which); } - SDL_Log("Controller %" SDL_PRIs32 " button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton) event.cbutton.button), event.cbutton.state ? "pressed" : "released"); + SDL_Log("Controller %" SDL_PRIs32 " button %s %s\n", event.cbutton.which, SDL_GameControllerGetStringForButton((SDL_GameControllerButton)event.cbutton.button), + event.cbutton.state ? "pressed" : "released"); /* Cycle PS5 trigger effects when the microphone button is pressed */ if (event.type == SDL_CONTROLLERBUTTONDOWN && @@ -701,7 +712,7 @@ loop(void *arg) if (showing_front) { for (i = 0; i < SDL_CONTROLLER_AXIS_MAX; ++i) { - const Sint16 deadzone = 8000; /* !!! FIXME: real deadzone */ + const Sint16 deadzone = 8000; /* !!! FIXME: real deadzone */ const Sint16 value = SDL_GameControllerGetAxis(gamecontroller, (SDL_GameControllerAxis)(i)); if (value < -deadzone) { const double angle = axis_positions[i].angle; @@ -735,14 +746,14 @@ loop(void *arg) Uint8 r, g, b; if (x < 0) { - r = (Uint8)(((int)(~x) * 255) / 32767); + r = (Uint8)(((~x) * 255) / 32767); b = 0; } else { r = 0; - b = (Uint8)(((int)(x) * 255) / 32767); + b = (Uint8)(((int)(x)*255) / 32767); } if (y > 0) { - g = (Uint8)(((int)(y) * 255) / 32767); + g = (Uint8)(((int)(y)*255) / 32767); } else { g = 0; } @@ -782,8 +793,7 @@ loop(void *arg) #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; int controller_count = 0; @@ -802,7 +812,7 @@ main(int argc, char *argv[]) SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL (Note: video is required to start event loop) */ - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER ) < 0) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; } @@ -829,7 +839,7 @@ main(int argc, char *argv[]) const char *description; SDL_JoystickGetGUIDString(SDL_JoystickGetDeviceGUID(i), - guid, sizeof (guid)); + guid, sizeof(guid)); if (SDL_IsGameController(i)) { controller_count++; @@ -879,8 +889,8 @@ main(int argc, char *argv[]) description = "Joystick"; } SDL_Log("%s %d: %s%s%s (guid %s, VID 0x%.4x, PID 0x%.4x, player index = %d)\n", - description, i, name ? name : "Unknown", path ? ", " : "", path ? path : "", guid, - SDL_JoystickGetDeviceVendor(i), SDL_JoystickGetDeviceProduct(i), SDL_JoystickGetDevicePlayerIndex(i)); + description, i, name ? name : "Unknown", path ? ", " : "", path ? path : "", guid, + SDL_JoystickGetDeviceVendor(i), SDL_JoystickGetDeviceProduct(i), SDL_JoystickGetDevicePlayerIndex(i)); } SDL_Log("There are %d game controller(s) attached (%d joystick(s))\n", controller_count, SDL_NumJoysticks()); @@ -888,13 +898,13 @@ main(int argc, char *argv[]) window = SDL_CreateWindow("Game Controller Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (window == NULL) { + if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return 2; } screen = SDL_CreateRenderer(window, -1, 0); - if (screen == NULL) { + if (!screen) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return 2; diff --git a/test/testgeometry.c b/test/testgeometry.c index fa8de75427b8f..f6377e277c574 100644 --- a/test/testgeometry.c +++ b/test/testgeometry.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -41,8 +41,7 @@ quit(int rc) exit(rc); } -int -LoadSprite(const char *file) +int LoadSprite(const char *file) { int i; @@ -50,22 +49,20 @@ LoadSprite(const char *file) /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h); if (!sprites[i]) { - return (-1); + return -1; } if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError()); SDL_DestroyTexture(sprites[i]); - return (-1); + return -1; } } /* We're ready to roll. :) */ - return (0); + return 0; } - -void -loop() +void loop(void) { int i; SDL_Event event; @@ -99,8 +96,9 @@ loop() for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); @@ -163,8 +161,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; const char *icon = "icon.bmp"; @@ -218,7 +215,7 @@ main(int argc, char *argv[]) /* Create the windows, initialize the renderers, and load the textures */ sprites = - (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites)); + (SDL_Texture **)SDL_malloc(state->num_windows * sizeof(*sprites)); if (!sprites) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); @@ -237,7 +234,6 @@ main(int argc, char *argv[]) } } - srand((unsigned int)time(NULL)); /* Main render loop */ @@ -251,16 +247,16 @@ main(int argc, char *argv[]) while (!done) { ++frames; loop(); - } + } #endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } - + quit(0); return 0; diff --git a/test/testgesture.c b/test/testgesture.c index 856fd6a2d02af..1a5d72d96d357 100644 --- a/test/testgesture.c +++ b/test/testgesture.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,9 +26,9 @@ #include "SDL_test.h" #include "SDL_test_common.h" -#define WIDTH 640 +#define WIDTH 640 #define HEIGHT 480 -#define BPP 4 +#define BPP 4 /* MUST BE A POWER OF 2! */ #define EVENT_BUF_SIZE 256 @@ -38,7 +38,7 @@ static SDLTest_CommonState *state; static SDL_Event events[EVENT_BUF_SIZE]; static int eventWrite; -static int colors[7] = {0xFF,0xFF00,0xFF0000,0xFFFF00,0x00FFFF,0xFF00FF,0xFFFFFF}; +static int colors[7] = { 0xFF, 0xFF00, 0xFF0000, 0xFFFF00, 0x00FFFF, 0xFF00FF, 0xFFFFFF }; static int quitting = 0; typedef struct @@ -54,7 +54,6 @@ typedef struct static Knob knob = { 0.0f, 0.1f, { 0.0f, 0.0f } }; - static void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) { @@ -65,26 +64,26 @@ setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) const int y = (int)_y; float a; - if ( (x < 0) || (x >= screen->w) || (y < 0) || (y >= screen->h) ) { + if ((x < 0) || (x >= screen->w) || (y < 0) || (y >= screen->h)) { return; } - pixmem32 = (Uint32 *) screen->pixels + y * screen->pitch / BPP + x; + pixmem32 = (Uint32 *)screen->pixels + y * screen->pitch / BPP + x; SDL_memcpy(&colour, pixmem32, screen->format->BytesPerPixel); - SDL_GetRGB(colour,screen->format,&r,&g,&b); + SDL_GetRGB(colour, screen->format, &r, &g, &b); /* r = 0;g = 0; b = 0; */ - a = (float) ((col >> 24) & 0xFF); + a = (float)((col >> 24) & 0xFF); if (a == 0) { a = 0xFF; /* Hack, to make things easier. */ } a = (a == 0.0f) ? 1 : (a / 255.0f); - r = (Uint8) (r * (1 - a) + ((col >> 16) & 0xFF) * a); - g = (Uint8) (g * (1 - a) + ((col >> 8) & 0xFF) * a); - b = (Uint8) (b * (1 - a) + ((col >> 0) & 0xFF) * a); + r = (Uint8)(r * (1 - a) + ((col >> 16) & 0xFF) * a); + g = (Uint8)(g * (1 - a) + ((col >> 8) & 0xFF) * a); + b = (Uint8)(b * (1 - a) + ((col >> 0) & 0xFF) * a); colour = SDL_MapRGB(screen->format, r, g, b); *pixmem32 = colour; @@ -104,11 +103,11 @@ drawLine(SDL_Surface *screen, float x0, float y0, float x1, float y1, unsigned i static void drawCircle(SDL_Surface *screen, float x, float y, float r, unsigned int c) { - float tx,ty, xr; - for (ty = (float) -SDL_fabs(r); ty <= (float) SDL_fabs((int) r); ty++) { - xr = (float) SDL_sqrt(r * r - ty * ty); + float tx, ty, xr; + for (ty = (float)-SDL_fabs(r); ty <= (float)SDL_fabs((int)r); ty++) { + xr = (float)SDL_sqrt(r * r - ty * ty); if (r > 0) { /* r > 0 ==> filled circle */ - for(tx = -xr + 0.5f; tx <= xr - 0.5f; tx++) { + for (tx = -xr + 0.5f; tx <= xr - 0.5f; tx++) { setpix(screen, x + tx, y + ty, c); } } else { @@ -145,15 +144,15 @@ DrawScreen(SDL_Window *window) float x, y; unsigned int c, col; - if ( (event->type == SDL_FINGERMOTION) || - (event->type == SDL_FINGERDOWN) || - (event->type == SDL_FINGERUP) ) { + if ((event->type == SDL_FINGERMOTION) || + (event->type == SDL_FINGERDOWN) || + (event->type == SDL_FINGERUP)) { x = event->tfinger.x; y = event->tfinger.y; /* draw the touch: */ c = colors[event->tfinger.fingerId % 7]; - col = ((unsigned int) (c * (0.1f + 0.85f))) | (unsigned int) (0xFF * age) << 24; + col = ((unsigned int)(c * (0.1f + 0.85f))) | (unsigned int)(0xFF * age) << 24; if (event->type == SDL_FINGERMOTION) { drawCircle(screen, x * screen->w, y * screen->h, 5, col); @@ -181,78 +180,79 @@ loop(void) SDLTest_CommonEvent(state, &event, &quitting); /* Record _all_ events */ - events[eventWrite & (EVENT_BUF_SIZE-1)] = event; + events[eventWrite & (EVENT_BUF_SIZE - 1)] = event; eventWrite++; switch (event.type) { - case SDL_KEYDOWN: - switch (event.key.keysym.sym) { - case SDLK_i: { - for (i = 0; i < SDL_GetNumTouchDevices(); ++i) { - const SDL_TouchID id = SDL_GetTouchDevice(i); - const char *name = SDL_GetTouchName(i); - SDL_Log("Fingers Down on device %"SDL_PRIs64" (%s): %d", id, name, SDL_GetNumTouchFingers(id)); - } - break; - } - - case SDLK_SPACE: - SDL_RecordGesture(-1); - break; - - case SDLK_s: - stream = SDL_RWFromFile("gestureSave", "w"); - SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream)); - SDL_RWclose(stream); - break; - - case SDLK_l: - stream = SDL_RWFromFile("gestureSave", "r"); - SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream)); - SDL_RWclose(stream); - break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case SDLK_i: + { + for (i = 0; i < SDL_GetNumTouchDevices(); ++i) { + const SDL_TouchID id = SDL_GetTouchDevice(i); + const char *name = SDL_GetTouchName(i); + SDL_Log("Fingers Down on device %" SDL_PRIs64 " (%s): %d", id, name, SDL_GetNumTouchFingers(id)); } break; + } -#if VERBOSE - case SDL_FINGERMOTION: - SDL_Log("Finger: %"SDL_PRIs64", x: %f, y: %f",event.tfinger.fingerId, - event.tfinger.x,event.tfinger.y); + case SDLK_SPACE: + SDL_RecordGesture(-1); break; - case SDL_FINGERDOWN: - SDL_Log("Finger: %"SDL_PRIs64" down - x: %f, y: %f", - event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); + case SDLK_s: + stream = SDL_RWFromFile("gestureSave", "w"); + SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream)); + SDL_RWclose(stream); break; - case SDL_FINGERUP: - SDL_Log("Finger: %"SDL_PRIs64" up - x: %f, y: %f", - event.tfinger.fingerId,event.tfinger.x,event.tfinger.y); + case SDLK_l: + stream = SDL_RWFromFile("gestureSave", "r"); + SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream)); + SDL_RWclose(stream); break; + } + break; + +#if VERBOSE + case SDL_FINGERMOTION: + SDL_Log("Finger: %" SDL_PRIs64 ", x: %f, y: %f", event.tfinger.fingerId, + event.tfinger.x, event.tfinger.y); + break; + + case SDL_FINGERDOWN: + SDL_Log("Finger: %" SDL_PRIs64 " down - x: %f, y: %f", + event.tfinger.fingerId, event.tfinger.x, event.tfinger.y); + break; + + case SDL_FINGERUP: + SDL_Log("Finger: %" SDL_PRIs64 " up - x: %f, y: %f", + event.tfinger.fingerId, event.tfinger.x, event.tfinger.y); + break; #endif - case SDL_MULTIGESTURE: + case SDL_MULTIGESTURE: #if VERBOSE - SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f", - event.mgesture.x, event.mgesture.y, - event.mgesture.dTheta, event.mgesture.dDist); - SDL_Log("MG: numDownTouch = %i",event.mgesture.numFingers); + SDL_Log("Multi Gesture: x = %f, y = %f, dAng = %f, dR = %f", + event.mgesture.x, event.mgesture.y, + event.mgesture.dTheta, event.mgesture.dDist); + SDL_Log("MG: numDownTouch = %i", event.mgesture.numFingers); #endif - knob.p.x = event.mgesture.x; - knob.p.y = event.mgesture.y; - knob.ang += event.mgesture.dTheta; - knob.r += event.mgesture.dDist; - break; + knob.p.x = event.mgesture.x; + knob.p.y = event.mgesture.y; + knob.ang += event.mgesture.dTheta; + knob.r += event.mgesture.dDist; + break; - case SDL_DOLLARGESTURE: - SDL_Log("Gesture %"SDL_PRIs64" performed, error: %f", - event.dgesture.gestureId, event.dgesture.error); - break; + case SDL_DOLLARGESTURE: + SDL_Log("Gesture %" SDL_PRIs64 " performed, error: %f", + event.dgesture.gestureId, event.dgesture.error); + break; - case SDL_DOLLARRECORD: - SDL_Log("Recorded gesture: %"SDL_PRIs64"",event.dgesture.gestureId); - break; + case SDL_DOLLARRECORD: + SDL_Log("Recorded gesture: %" SDL_PRIs64, event.dgesture.gestureId); + break; } } @@ -269,7 +269,7 @@ loop(void) #endif } -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { diff --git a/test/testgl2.c b/test/testgl2.c index f259ddc93be56..1c283c84fdb8b 100644 --- a/test/testgl2.c +++ b/test/testgl2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -26,12 +26,11 @@ typedef struct GL_Context { -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; #include "../src/render/opengl/SDL_glfuncs.h" #undef SDL_PROC } GL_Context; - /* Undefine this if you want a flat cube instead of a rainbow cube */ #define SHADED_CUBE @@ -39,26 +38,26 @@ static SDLTest_CommonState *state; static SDL_GLContext context; static GL_Context ctx; -static int LoadContext(GL_Context * data) +static int LoadContext(GL_Context *data) { -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_ANDROID +#elif defined(SDL_VIDEO_DRIVER_ANDROID) #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA +#elif defined(SDL_VIDEO_DRIVER_PANDORA) #define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; #else -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ return SDL_SetError("Couldn't load GL function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); + } \ + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "../src/render/opengl/SDL_glfuncs.h" @@ -66,13 +65,12 @@ static int LoadContext(GL_Context * data) return 0; } - /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) { if (context) { - /* SDL_GL_MakeCurrent(0, NULL); *//* doesn't do anything */ + /* SDL_GL_MakeCurrent(0, NULL); */ /* doesn't do anything */ SDL_GL_DeleteContext(context); } SDLTest_CommonQuit(state); @@ -80,27 +78,27 @@ quit(int rc) } static void -Render() +Render(void) { static float color[8][3] = { - {1.0, 1.0, 0.0}, - {1.0, 0.0, 0.0}, - {0.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {0.0, 1.0, 1.0}, - {1.0, 1.0, 1.0}, - {1.0, 0.0, 1.0}, - {0.0, 0.0, 1.0} + { 1.0, 1.0, 0.0 }, + { 1.0, 0.0, 0.0 }, + { 0.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 1.0, 1.0 }, + { 1.0, 1.0, 1.0 }, + { 1.0, 0.0, 1.0 }, + { 0.0, 0.0, 1.0 } }; static float cube[8][3] = { - {0.5, 0.5, -0.5}, - {0.5, -0.5, -0.5}, - {-0.5, -0.5, -0.5}, - {-0.5, 0.5, -0.5}, - {-0.5, 0.5, 0.5}, - {0.5, 0.5, 0.5}, - {0.5, -0.5, 0.5}, - {-0.5, -0.5, 0.5} + { 0.5, 0.5, -0.5 }, + { 0.5, -0.5, -0.5 }, + { -0.5, -0.5, -0.5 }, + { -0.5, 0.5, -0.5 }, + { -0.5, 0.5, 0.5 }, + { 0.5, 0.5, 0.5 }, + { 0.5, -0.5, 0.5 }, + { -0.5, -0.5, 0.5 } }; /* Do our drawing, too. */ @@ -163,7 +161,7 @@ Render() ctx.glVertex3fv(cube[2]); ctx.glColor3fv(color[7]); ctx.glVertex3fv(cube[7]); -#else /* flat cube */ +#else /* flat cube */ ctx.glColor3f(1.0, 0.0, 0.0); ctx.glVertex3fv(cube[0]); ctx.glVertex3fv(cube[1]); @@ -207,8 +205,12 @@ Render() ctx.glRotatef(5.0, 1.0, 1.0, 1.0); } -int -main(int argc, char *argv[]) +static void LogSwapInterval(void) +{ + SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval()); +} + +int main(int argc, char *argv[]) { int fsaa, accel; int value; @@ -237,11 +239,11 @@ main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (consumed == 0) { - if (SDL_strcasecmp(argv[i], "--fsaa") == 0 && i+1 < argc) { - fsaa = SDL_atoi(argv[i+1]); + if (SDL_strcasecmp(argv[i], "--fsaa") == 0 && i + 1 < argc) { + fsaa = SDL_atoi(argv[i + 1]); consumed = 2; - } else if (SDL_strcasecmp(argv[i], "--accel") == 0 && i+1 < argc) { - accel = SDL_atoi(argv[i+1]); + } else if (SDL_strcasecmp(argv[i], "--accel") == 0 && i + 1 < argc) { + accel = SDL_atoi(argv[i + 1]); consumed = 2; } else { consumed = -1; @@ -280,7 +282,7 @@ main(int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_GL_CreateContext(): %s\n", SDL_GetError()); quit(2); } - + /* Important: call this *after* creating the context */ if (LoadContext(&ctx) < 0) { SDL_Log("Could not load GL functions\n"); @@ -297,13 +299,15 @@ main(int argc, char *argv[]) swap_interval = 1; } } else { - SDL_GL_SetSwapInterval(0); /* disable vsync. */ + SDL_GL_SetSwapInterval(0); /* disable vsync. */ swap_interval = 0; } SDL_GetCurrentDisplayMode(0, &mode); SDL_Log("Screen BPP : %" SDL_PRIu32 "\n", SDL_BITSPERPIXEL(mode.format)); - SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval()); + + LogSwapInterval(); + SDL_GetWindowSize(state->windows[0], &dw, &dh); SDL_Log("Window Size : %d,%d\n", dw, dh); SDL_GL_GetDrawableSize(state->windows[0], &dw, &dh); @@ -345,25 +349,25 @@ main(int argc, char *argv[]) SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", - SDL_GetError()); + SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); if (!status) { SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, - value); + value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", - SDL_GetError()); + SDL_GetError()); } } if (accel >= 0) { status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value); if (!status) { SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", accel, - value); + value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", - SDL_GetError()); + SDL_GetError()); } } @@ -376,7 +380,7 @@ main(int argc, char *argv[]) ctx.glEnable(GL_DEPTH_TEST); ctx.glDepthFunc(GL_LESS); ctx.glShadeModel(GL_SMOOTH); - + /* Main render loop */ frames = 0; then = SDL_GetTicks(); @@ -405,11 +409,13 @@ main(int argc, char *argv[]) for (i = 0; i < state->num_windows; ++i) { int w, h; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_GL_MakeCurrent(state->windows[i], context); if (update_swap_interval) { SDL_GL_SetSwapInterval(swap_interval); + LogSwapInterval(); } SDL_GL_GetDrawableSize(state->windows[i], &w, &h); ctx.glViewport(0, 0, w, h); @@ -422,7 +428,7 @@ main(int argc, char *argv[]) now = SDL_GetTicks(); if (now > then) { SDL_Log("%2.2f frames per second\n", - ((double) frames * 1000) / (now - then)); + ((double)frames * 1000) / (now - then)); } quit(0); return 0; @@ -430,8 +436,7 @@ main(int argc, char *argv[]) #else /* HAVE_OPENGL */ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system\n"); return 1; diff --git a/test/testgles.c b/test/testgles.c index 745cf8919e91e..f092075bb9846 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,7 +34,7 @@ quit(int rc) { int i; - if (context != NULL) { + if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -49,40 +49,36 @@ quit(int rc) } static void -Render() +Render(void) { - static GLubyte color[8][4] = { {255, 0, 0, 0}, - {255, 0, 0, 255}, - {0, 255, 0, 255}, - {0, 255, 0, 255}, - {0, 255, 0, 255}, - {255, 255, 255, 255}, - {255, 0, 255, 255}, - {0, 0, 255, 255} - }; - static GLfloat cube[8][3] = { {0.5, 0.5, -0.5}, - {0.5f, -0.5f, -0.5f}, - {-0.5f, -0.5f, -0.5f}, - {-0.5f, 0.5f, -0.5f}, - {-0.5f, 0.5f, 0.5f}, - {0.5f, 0.5f, 0.5f}, - {0.5f, -0.5f, 0.5f}, - {-0.5f, -0.5f, 0.5f} - }; + static GLubyte color[8][4] = { { 255, 0, 0, 0 }, + { 255, 0, 0, 255 }, + { 0, 255, 0, 255 }, + { 0, 255, 0, 255 }, + { 0, 255, 0, 255 }, + { 255, 255, 255, 255 }, + { 255, 0, 255, 255 }, + { 0, 0, 255, 255 } }; + static GLfloat cube[8][3] = { { 0.5, 0.5, -0.5 }, + { 0.5f, -0.5f, -0.5f }, + { -0.5f, -0.5f, -0.5f }, + { -0.5f, 0.5f, -0.5f }, + { -0.5f, 0.5f, 0.5f }, + { 0.5f, 0.5f, 0.5f }, + { 0.5f, -0.5f, 0.5f }, + { -0.5f, -0.5f, 0.5f } }; static GLubyte indices[36] = { 0, 3, 4, - 4, 5, 0, - 0, 5, 6, - 6, 1, 0, - 6, 7, 2, - 2, 1, 6, - 7, 4, 3, - 3, 2, 7, - 5, 4, 7, - 7, 6, 5, - 2, 3, 1, - 3, 0, 1 - }; - + 4, 5, 0, + 0, 5, 6, + 6, 1, 0, + 6, 7, 2, + 2, 1, 6, + 7, 4, 3, + 3, 2, 7, + 5, 4, 7, + 7, 6, 5, + 2, 3, 1, + 3, 0, 1 }; /* Do our drawing, too. */ glClearColor(0.0, 0.0, 0.0, 1.0); @@ -99,8 +95,7 @@ Render() glRotatef(5.0, 1.0, 1.0, 1.0); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int fsaa, accel; int value; @@ -163,18 +158,18 @@ main(int argc, char *argv[]) state->gl_minor_version = 1; state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES; if (fsaa) { - state->gl_multisamplebuffers=1; - state->gl_multisamplesamples=fsaa; + state->gl_multisamplebuffers = 1; + state->gl_multisamplesamples = fsaa; } if (accel) { - state->gl_accelerated=1; + state->gl_accelerated = 1; } if (!SDLTest_CommonInit(state)) { quit(2); } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (context == NULL) { + if (!context) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); } @@ -208,28 +203,28 @@ main(int argc, char *argv[]) SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_RED_SIZE: %s\n", - SDL_GetError()); + SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); if (!status) { SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_GREEN_SIZE: %s\n", - SDL_GetError()); + SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); if (!status) { SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_BLUE_SIZE: %s\n", - SDL_GetError()); + SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); if (!status) { SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_DEPTH_SIZE: %s\n", - SDL_GetError()); + SDL_GetError()); } if (fsaa) { status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value); @@ -237,15 +232,15 @@ main(int argc, char *argv[]) SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", - SDL_GetError()); + SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); if (!status) { SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, - value); + value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", - SDL_GetError()); + SDL_GetError()); } } if (accel) { @@ -254,7 +249,7 @@ main(int argc, char *argv[]) SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", - SDL_GetError()); + SDL_GetError()); } } @@ -293,30 +288,31 @@ main(int argc, char *argv[]) switch (event.type) { case SDL_WINDOWEVENT: switch (event.window.event) { - case SDL_WINDOWEVENT_RESIZED: - for (i = 0; i < state->num_windows; ++i) { - if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { - status = SDL_GL_MakeCurrent(state->windows[i], context[i]); - if (status) { - SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); - break; - } - /* Change view port to the new window dimensions */ - glViewport(0, 0, event.window.data1, event.window.data2); - /* Update window content */ - Render(); - SDL_GL_SwapWindow(state->windows[i]); + case SDL_WINDOWEVENT_RESIZED: + for (i = 0; i < state->num_windows; ++i) { + if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); break; } + /* Change view port to the new window dimensions */ + glViewport(0, 0, event.window.data1, event.window.data2); + /* Update window content */ + Render(); + SDL_GL_SwapWindow(state->windows[i]); + break; } - break; + } + break; } } SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } status = SDL_GL_MakeCurrent(state->windows[i], context[i]); if (status) { SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); @@ -333,18 +329,17 @@ main(int argc, char *argv[]) now = SDL_GetTicks(); if (now > then) { SDL_Log("%2.2f frames per second\n", - ((double) frames * 1000) / (now - then)); + ((double)frames * 1000) / (now - then)); } #if !defined(__ANDROID__) quit(0); -#endif +#endif return 0; } #else /* HAVE_OPENGLES */ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL ES support on this system\n"); return 1; diff --git a/test/testgles2.c b/test/testgles2.c index 903f7a82272e6..78bc18a25df28 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -33,7 +33,7 @@ typedef struct GLES2_Context { -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; #include "../src/render/opengles2/SDL_gles2funcs.h" #undef SDL_PROC } GLES2_Context; @@ -63,26 +63,26 @@ static SDL_GLContext *context = NULL; static int depth = 16; static GLES2_Context ctx; -static int LoadContext(GLES2_Context * data) +static int LoadContext(GLES2_Context *data) { -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_ANDROID +#elif defined(SDL_VIDEO_DRIVER_ANDROID) #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA +#elif defined(SDL_VIDEO_DRIVER_PANDORA) #define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; #else -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); + } \ + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "../src/render/opengles2/SDL_gles2funcs.h" @@ -96,7 +96,7 @@ quit(int rc) { int i; - if (context != NULL) { + if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -110,19 +110,19 @@ quit(int rc) exit(rc); } -#define GL_CHECK(x) \ - x; \ - { \ - GLenum glError = ctx.glGetError(); \ - if(glError != GL_NO_ERROR) { \ +#define GL_CHECK(x) \ + x; \ + { \ + GLenum glError = ctx.glGetError(); \ + if (glError != GL_NO_ERROR) { \ SDL_Log("glGetError() = %i (0x%.8x) at line %i\n", glError, glError, __LINE__); \ - quit(1); \ - } \ - } + quit(1); \ + } \ + } -/* - * Simulates desktop's glRotatef. The matrix is returned in column-major - * order. +/* + * Simulates desktop's glRotatef. The matrix is returned in column-major + * order. */ static void rotate_matrix(float angle, float x, float y, float z, float *r) @@ -161,16 +161,16 @@ rotate_matrix(float angle, float x, float y, float z, float *r) } } -/* - * Simulates gluPerspectiveMatrix +/* + * Simulates gluPerspectiveMatrix */ -static void +static void perspective_matrix(float fovy, float aspect, float znear, float zfar, float *r) { int i; float f; - f = 1.0f/SDL_tanf(fovy * 0.5f); + f = 1.0f / SDL_tanf(fovy * 0.5f); for (i = 0; i < 16; i++) { r[i] = 0.0; @@ -184,12 +184,12 @@ perspective_matrix(float fovy, float aspect, float znear, float zfar, float *r) r[15] = 0.0f; } -/* +/* * Multiplies lhs by rhs and writes out to r. All matrices are 4x4 and column * major. In-place multiplication is supported. */ static void -multiply_matrix(float *lhs, float *rhs, float *r) +multiply_matrix(const float *lhs, const float *rhs, float *r) { int i, j, k; float tmp[16]; @@ -209,7 +209,7 @@ multiply_matrix(float *lhs, float *rhs, float *r) } } -/* +/* * Create shader, load in source, compile, dump debug as necessary. * * shader: Pointer to return created shader ID. @@ -217,7 +217,7 @@ multiply_matrix(float *lhs, float *rhs, float *r) * shader_type: Passed to GL, e.g. GL_VERTEX_SHADER. */ static void -process_shader(GLuint *shader, const char * source, GLint shader_type) +process_shader(GLuint *shader, const char *source, GLint shader_type) { GLint status = GL_FALSE; const char *shaders[1] = { NULL }; @@ -239,7 +239,7 @@ process_shader(GLuint *shader, const char * source, GLint shader_type) GL_CHECK(ctx.glGetShaderiv(*shader, GL_COMPILE_STATUS, &status)); /* Dump debug info (source and log) if compilation failed. */ - if(status != GL_TRUE) { + if (status != GL_TRUE) { ctx.glGetShaderInfoLog(*shader, sizeof(buffer), &length, &buffer[0]); buffer[length] = '\0'; SDL_Log("Shader compilation failed: %s", buffer); @@ -260,7 +260,7 @@ link_program(struct shader_data *data) GL_CHECK(ctx.glLinkProgram(data->shader_program)); GL_CHECK(ctx.glGetProgramiv(data->shader_program, GL_LINK_STATUS, &status)); - if(status != GL_TRUE) { + if (status != GL_TRUE) { ctx.glGetProgramInfoLog(data->shader_program, sizeof(buffer), &length, &buffer[0]); buffer[length] = '\0'; SDL_Log("Program linking failed: %s", buffer); @@ -270,67 +270,137 @@ link_program(struct shader_data *data) } /* 3D data. Vertex range -0.5..0.5 in all axes. -* Z -0.5 is near, 0.5 is far. */ -const float _vertices[] = -{ + * Z -0.5 is near, 0.5 is far. */ +const float _vertices[] = { /* Front face. */ /* Bottom left */ - -0.5, 0.5, -0.5, - 0.5, -0.5, -0.5, - -0.5, -0.5, -0.5, + -0.5, + 0.5, + -0.5, + 0.5, + -0.5, + -0.5, + -0.5, + -0.5, + -0.5, /* Top right */ - -0.5, 0.5, -0.5, - 0.5, 0.5, -0.5, - 0.5, -0.5, -0.5, + -0.5, + 0.5, + -0.5, + 0.5, + 0.5, + -0.5, + 0.5, + -0.5, + -0.5, /* Left face */ /* Bottom left */ - -0.5, 0.5, 0.5, - -0.5, -0.5, -0.5, - -0.5, -0.5, 0.5, + -0.5, + 0.5, + 0.5, + -0.5, + -0.5, + -0.5, + -0.5, + -0.5, + 0.5, /* Top right */ - -0.5, 0.5, 0.5, - -0.5, 0.5, -0.5, - -0.5, -0.5, -0.5, + -0.5, + 0.5, + 0.5, + -0.5, + 0.5, + -0.5, + -0.5, + -0.5, + -0.5, /* Top face */ /* Bottom left */ - -0.5, 0.5, 0.5, - 0.5, 0.5, -0.5, - -0.5, 0.5, -0.5, + -0.5, + 0.5, + 0.5, + 0.5, + 0.5, + -0.5, + -0.5, + 0.5, + -0.5, /* Top right */ - -0.5, 0.5, 0.5, - 0.5, 0.5, 0.5, - 0.5, 0.5, -0.5, + -0.5, + 0.5, + 0.5, + 0.5, + 0.5, + 0.5, + 0.5, + 0.5, + -0.5, /* Right face */ /* Bottom left */ - 0.5, 0.5, -0.5, - 0.5, -0.5, 0.5, - 0.5, -0.5, -0.5, + 0.5, + 0.5, + -0.5, + 0.5, + -0.5, + 0.5, + 0.5, + -0.5, + -0.5, /* Top right */ - 0.5, 0.5, -0.5, - 0.5, 0.5, 0.5, - 0.5, -0.5, 0.5, + 0.5, + 0.5, + -0.5, + 0.5, + 0.5, + 0.5, + 0.5, + -0.5, + 0.5, /* Back face */ /* Bottom left */ - 0.5, 0.5, 0.5, - -0.5, -0.5, 0.5, - 0.5, -0.5, 0.5, + 0.5, + 0.5, + 0.5, + -0.5, + -0.5, + 0.5, + 0.5, + -0.5, + 0.5, /* Top right */ - 0.5, 0.5, 0.5, - -0.5, 0.5, 0.5, - -0.5, -0.5, 0.5, + 0.5, + 0.5, + 0.5, + -0.5, + 0.5, + 0.5, + -0.5, + -0.5, + 0.5, /* Bottom face */ /* Bottom left */ - -0.5, -0.5, -0.5, - 0.5, -0.5, 0.5, - -0.5, -0.5, 0.5, + -0.5, + -0.5, + -0.5, + 0.5, + -0.5, + 0.5, + -0.5, + -0.5, + 0.5, /* Top right */ - -0.5, -0.5, -0.5, - 0.5, -0.5, -0.5, - 0.5, -0.5, 0.5, + -0.5, + -0.5, + -0.5, + 0.5, + -0.5, + -0.5, + 0.5, + -0.5, + 0.5, }; -const float _colors[] = -{ +const float _colors[] = { /* Front face */ /* Bottom left */ 1.0, 0.0, 0.0, /* red */ @@ -387,32 +457,32 @@ const float _colors[] = 1.0, 0.0, 1.0, /* magenta */ }; -const char* _shader_vert_src = -" attribute vec4 av4position; " -" attribute vec3 av3color; " -" uniform mat4 mvp; " -" varying vec3 vv3color; " -" void main() { " -" vv3color = av3color; " -" gl_Position = mvp * av4position; " -" } "; - -const char* _shader_frag_src = -" precision lowp float; " -" varying vec3 vv3color; " -" void main() { " -" gl_FragColor = vec4(vv3color, 1.0); " -" } "; +const char *_shader_vert_src = + " attribute vec4 av4position; " + " attribute vec3 av3color; " + " uniform mat4 mvp; " + " varying vec3 vv3color; " + " void main() { " + " vv3color = av3color; " + " gl_Position = mvp * av4position; " + " } "; + +const char *_shader_frag_src = + " precision lowp float; " + " varying vec3 vv3color; " + " void main() { " + " gl_FragColor = vec4(vv3color, 1.0); " + " } "; static void -Render(unsigned int width, unsigned int height, shader_data* data) +Render(unsigned int width, unsigned int height, shader_data *data) { float matrix_rotate[16], matrix_modelview[16], matrix_perspective[16], matrix_mvp[16]; - /* - * Do some rotation with Euler angles. It is not a fixed axis as - * quaterions would be, but the effect is cool. - */ + /* + * Do some rotation with Euler angles. It is not a fixed axis as + * quaterions would be, but the effect is cool. + */ rotate_matrix((float)data->angle_x, 1.0f, 0.0f, 0.0f, matrix_modelview); rotate_matrix((float)data->angle_y, 0.0f, 1.0f, 0.0f, matrix_rotate); @@ -425,7 +495,7 @@ Render(unsigned int width, unsigned int height, shader_data* data) /* Pull the camera back from the cube */ matrix_modelview[14] -= 2.5; - perspective_matrix(45.0f, (float)width/height, 0.01f, 100.0f, matrix_perspective); + perspective_matrix(45.0f, (float)width / height, 0.01f, 100.0f, matrix_perspective); multiply_matrix(matrix_perspective, matrix_modelview, matrix_mvp); GL_CHECK(ctx.glUniformMatrix4fv(data->attr_mvp, 1, GL_FALSE, matrix_mvp)); @@ -434,12 +504,24 @@ Render(unsigned int width, unsigned int height, shader_data* data) data->angle_y += 2; data->angle_z += 1; - if(data->angle_x >= 360) data->angle_x -= 360; - if(data->angle_x < 0) data->angle_x += 360; - if(data->angle_y >= 360) data->angle_y -= 360; - if(data->angle_y < 0) data->angle_y += 360; - if(data->angle_z >= 360) data->angle_z -= 360; - if(data->angle_z < 0) data->angle_z += 360; + if (data->angle_x >= 360) { + data->angle_x -= 360; + } + if (data->angle_x < 0) { + data->angle_x += 360; + } + if (data->angle_y >= 360) { + data->angle_y -= 360; + } + if (data->angle_y < 0) { + data->angle_y += 360; + } + if (data->angle_z >= 360) { + data->angle_z -= 360; + } + if (data->angle_z < 0) { + data->angle_z += 360; + } GL_CHECK(ctx.glViewport(0, 0, width, height)); GL_CHECK(ctx.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)); @@ -474,7 +556,7 @@ render_window(int index) #ifndef __EMSCRIPTEN__ static int SDLCALL -render_thread_fn(void* render_ctx) +render_thread_fn(void *render_ctx) { thread_data *thread = render_ctx; @@ -487,7 +569,7 @@ render_thread_fn(void* render_ctx) } static void -loop_threaded() +loop_threaded(void) { SDL_Event event; int i; @@ -516,7 +598,7 @@ loop_threaded() #endif static void -loop() +loop(void) { SDL_Event event; int i; @@ -537,8 +619,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int fsaa, accel, threaded; int value; @@ -603,11 +684,11 @@ main(int argc, char *argv[]) state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES; if (fsaa) { - state->gl_multisamplebuffers=1; - state->gl_multisamplesamples=fsaa; + state->gl_multisamplebuffers = 1; + state->gl_multisamplesamples = fsaa; } if (accel) { - state->gl_accelerated=1; + state->gl_accelerated = 1; } if (!SDLTest_CommonInit(state)) { quit(2); @@ -615,11 +696,11 @@ main(int argc, char *argv[]) } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (context == NULL) { + if (!context) { SDL_Log("Out of memory!\n"); quit(2); } - + /* Create OpenGL ES contexts */ for (i = 0; i < state->num_windows; i++) { context[i] = SDL_GL_CreateContext(state->windows[i]); @@ -636,8 +717,6 @@ main(int argc, char *argv[]) return 0; } - - if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { SDL_GL_SetSwapInterval(1); } else { @@ -658,28 +737,28 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_RED_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); if (!status) { SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_GREEN_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); if (!status) { SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_BLUE_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); if (!status) { SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); } else { - SDL_Log( "Failed to get SDL_GL_DEPTH_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError()); } if (fsaa) { @@ -687,15 +766,15 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); } else { - SDL_Log( "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", + SDL_Log("Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); if (!status) { SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, - value); + value); } else { - SDL_Log( "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", + SDL_Log("Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", SDL_GetError()); } } @@ -704,7 +783,7 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); } else { - SDL_Log( "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_Log("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError()); } } @@ -726,7 +805,9 @@ main(int argc, char *argv[]) ctx.glViewport(0, 0, w, h); data = &datas[i]; - data->angle_x = 0; data->angle_y = 0; data->angle_z = 0; + data->angle_x = 0; + data->angle_y = 0; + data->angle_z = 0; /* Shader Initialization */ process_shader(&data->shader_vert, _shader_vert_src, GL_VERTEX_SHADER); @@ -780,7 +861,7 @@ main(int argc, char *argv[]) emscripten_set_main_loop(loop, 0, 1); #else if (threaded) { - threads = (thread_data*)SDL_calloc(state->num_windows, sizeof(thread_data)); + threads = (thread_data *)SDL_calloc(state->num_windows, sizeof(thread_data)); /* Start a render thread for each window */ for (i = 0; i < state->num_windows; ++i) { @@ -810,18 +891,17 @@ main(int argc, char *argv[]) now = SDL_GetTicks(); if (now > then) { SDL_Log("%2.2f frames per second\n", - ((double) frames * 1000) / (now - then)); + ((double)frames * 1000) / (now - then)); } -#if !defined(__ANDROID__) && !defined(__NACL__) +#if !defined(__ANDROID__) && !defined(__NACL__) quit(0); -#endif +#endif return 0; } #else /* HAVE_OPENGLES2 */ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Log("No OpenGL ES support on this system\n"); return 1; diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index e9e79d6e62fc8..2d6427bf45c23 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -10,15 +10,13 @@ freely. */ #include -#include -#include -#include #ifdef __EMSCRIPTEN__ #include #endif #include "SDL_test_common.h" +#include "testutils.h" #if defined(__IPHONEOS__) || defined(__ANDROID__) || defined(__EMSCRIPTEN__) || defined(__NACL__) \ || defined(__WINDOWS__) || defined(__LINUX__) @@ -31,12 +29,11 @@ typedef struct GLES2_Context { -#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params; +#define SDL_PROC(ret, func, params) ret (APIENTRY *func) params; #include "../src/render/opengles2/SDL_gles2funcs.h" #undef SDL_PROC } GLES2_Context; - static SDL_Surface *g_surf_sdf = NULL; GLenum g_texture; GLenum g_texture_type = GL_TEXTURE_2D; @@ -57,35 +54,33 @@ typedef enum } GLES2_Uniform; -GLuint g_uniform_locations[16]; - - +GLint g_uniform_locations[16]; static SDLTest_CommonState *state; static SDL_GLContext *context = NULL; static int depth = 16; static GLES2_Context ctx; -static int LoadContext(GLES2_Context * data) +static int LoadContext(GLES2_Context *data) { -#if SDL_VIDEO_DRIVER_UIKIT +#ifdef SDL_VIDEO_DRIVER_UIKIT #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_ANDROID +#elif defined(SDL_VIDEO_DRIVER_ANDROID) #define __SDL_NOGETPROCADDR__ -#elif SDL_VIDEO_DRIVER_PANDORA +#elif defined(SDL_VIDEO_DRIVER_PANDORA) #define __SDL_NOGETPROCADDR__ #endif #if defined __SDL_NOGETPROCADDR__ -#define SDL_PROC(ret,func,params) data->func=func; +#define SDL_PROC(ret, func, params) data->func = func; #else -#define SDL_PROC(ret,func,params) \ - do { \ - data->func = SDL_GL_GetProcAddress(#func); \ - if ( ! data->func ) { \ +#define SDL_PROC(ret, func, params) \ + do { \ + data->func = SDL_GL_GetProcAddress(#func); \ + if (!data->func) { \ return SDL_SetError("Couldn't load GLES2 function %s: %s", #func, SDL_GetError()); \ - } \ - } while ( 0 ); + } \ + } while (0); #endif /* __SDL_NOGETPROCADDR__ */ #include "../src/render/opengles2/SDL_gles2funcs.h" @@ -99,7 +94,7 @@ quit(int rc) { int i; - if (context != NULL) { + if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { SDL_GL_DeleteContext(context[i]); @@ -113,26 +108,25 @@ quit(int rc) exit(rc); } -#define GL_CHECK(x) \ - x; \ - { \ - GLenum glError = ctx.glGetError(); \ - if(glError != GL_NO_ERROR) { \ +#define GL_CHECK(x) \ + x; \ + { \ + GLenum glError = ctx.glGetError(); \ + if (glError != GL_NO_ERROR) { \ SDL_Log("glGetError() = %i (0x%.8x) at line %i\n", glError, glError, __LINE__); \ - quit(1); \ - } \ - } - + quit(1); \ + } \ + } -/* +/* * Create shader, load in source, compile, dump debug as necessary. * * shader: Pointer to return created shader ID. * source: Passed-in shader source code. * shader_type: Passed to GL, e.g. GL_VERTEX_SHADER. */ -void -process_shader(GLuint *shader, const char * source, GLint shader_type) +void +process_shader(GLenum *shader, const char *source, GLenum shader_type) { GLint status = GL_FALSE; const char *shaders[1] = { NULL }; @@ -154,10 +148,10 @@ process_shader(GLuint *shader, const char * source, GLint shader_type) GL_CHECK(ctx.glGetShaderiv(*shader, GL_COMPILE_STATUS, &status)); /* Dump debug info (source and log) if compilation failed. */ - if(status != GL_TRUE) { - ctx.glGetProgramInfoLog(*shader, sizeof(buffer), &length, &buffer[0]); + if (status != GL_TRUE) { + ctx.glGetShaderInfoLog(*shader, sizeof(buffer), &length, &buffer[0]); buffer[length] = '\0'; - SDL_Log("Shader compilation failed: %s", buffer);fflush(stderr); + SDL_Log("Shader compilation failed: %s", buffer); quit(-1); } } @@ -167,7 +161,7 @@ process_shader(GLuint *shader, const char * source, GLint shader_type) * To get correct rotation for most cases when a_angle is disabled cosine * value is decremented by 1.0 to get proper output with 0.0 which is default value */ -static const Uint8 GLES2_VertexSrc_Default_[] = " \ +static const char GLES2_VertexSrc_Default_[] = " \ uniform mat4 u_projection; \ attribute vec2 a_position; \ attribute vec2 a_texCoord; \ @@ -187,7 +181,7 @@ static const Uint8 GLES2_VertexSrc_Default_[] = " \ } \ "; -static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \ +static const char GLES2_FragmentSrc_TextureABGRSrc_[] = " \ precision mediump float; \ uniform sampler2D u_texture; \ uniform vec4 u_color; \ @@ -201,7 +195,7 @@ static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_[] = " \ "; /* RGB to ABGR conversion */ -static const Uint8 GLES2_FragmentSrc_TextureABGRSrc_SDF[] = " \ +static const char GLES2_FragmentSrc_TextureABGRSrc_SDF[] = " \ #extension GL_OES_standard_derivatives : enable\n\ \ precision mediump float; \ @@ -242,19 +236,16 @@ static const char *GLES2_FragmentSrc_TextureABGRSrc_SDF_dbg = " \ } \ "; - static float g_val = 1.0f; -static int g_use_SDF = 1; -static int g_use_SDF_debug = 0; +static int g_use_SDF = 1; +static int g_use_SDF_debug = 0; static float g_angle = 0.0f; static float matrix_mvp[4][4]; - - - typedef struct shader_data { - GLuint shader_program, shader_frag, shader_vert; + GLint shader_program; + GLenum shader_frag, shader_vert; GLint attr_position; GLint attr_color, attr_mvp; @@ -262,7 +253,7 @@ typedef struct shader_data } shader_data; static void -Render(unsigned int width, unsigned int height, shader_data* data) +Render(int width, int height, shader_data* data) { float *verts = g_verts; ctx.glViewport(0, 0, 640, 480); @@ -272,17 +263,16 @@ Render(unsigned int width, unsigned int height, shader_data* data) GL_CHECK(ctx.glUniformMatrix4fv(g_uniform_locations[GLES2_UNIFORM_PROJECTION], 1, GL_FALSE, (const float *)matrix_mvp)); GL_CHECK(ctx.glUniform4f(g_uniform_locations[GLES2_UNIFORM_COLOR], 1.0f, 1.0f, 1.0f, 1.0f)); - GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (verts + 16))); - GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (verts + 8))); - GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) verts)); + GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(verts + 16))); + GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)(verts + 8))); + GL_CHECK(ctx.glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *)verts)); GL_CHECK(ctx.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); } - -void renderCopy_angle(float degree_angle) +void renderCopy_angle(float degree_angle) { - const float radian_angle = (float)(3.141592 * degree_angle) / 180.0; + const float radian_angle = (float)(3.141592 * degree_angle) / 180.0f; const GLfloat s = (GLfloat) SDL_sin(radian_angle); const GLfloat c = (GLfloat) SDL_cos(radian_angle) - 1.0f; GLfloat *verts = g_verts + 16; @@ -296,22 +286,21 @@ void renderCopy_angle(float degree_angle) *(verts++) = c; } - -void renderCopy_position(SDL_Rect *srcrect, SDL_Rect *dstrect) +void renderCopy_position(SDL_Rect *srcrect, SDL_Rect *dstrect) { GLfloat minx, miny, maxx, maxy; GLfloat minu, maxu, minv, maxv; GLfloat *verts = g_verts; - minx = dstrect->x; - miny = dstrect->y; - maxx = dstrect->x + dstrect->w; - maxy = dstrect->y + dstrect->h; + minx = (GLfloat)dstrect->x; + miny = (GLfloat)dstrect->y; + maxx = (GLfloat)(dstrect->x + dstrect->w); + maxy = (GLfloat)(dstrect->y + dstrect->h); - minu = (GLfloat) srcrect->x / g_surf_sdf->w; - maxu = (GLfloat) (srcrect->x + srcrect->w) / g_surf_sdf->w; - minv = (GLfloat) srcrect->y / g_surf_sdf->h; - maxv = (GLfloat) (srcrect->y + srcrect->h) / g_surf_sdf->h; + minu = (GLfloat) srcrect->x / (GLfloat)g_surf_sdf->w; + maxu = (GLfloat) (srcrect->x + srcrect->w) / (GLfloat)g_surf_sdf->w; + minv = (GLfloat) srcrect->y / (GLfloat)g_surf_sdf->h; + maxv = (GLfloat) (srcrect->y + srcrect->h) / (GLfloat)g_surf_sdf->h; *(verts++) = minx; *(verts++) = miny; @@ -336,7 +325,7 @@ int done; Uint32 frames; shader_data *datas; -void loop() +void loop(void) { SDL_Event event; int i; @@ -347,71 +336,63 @@ void loop() while (SDL_PollEvent(&event) && !done) { switch (event.type) { case SDL_KEYDOWN: - { - const int sym = event.key.keysym.sym; - - if (sym == SDLK_TAB) { - SDL_Log("Tab"); - - - } - + { + const int sym = event.key.keysym.sym; - if (sym == SDLK_LEFT) g_val -= 0.05; - if (sym == SDLK_RIGHT) g_val += 0.05; - if (sym == SDLK_UP) g_angle -= 1; - if (sym == SDLK_DOWN) g_angle += 1; - + if (sym == SDLK_TAB) { + SDL_Log("Tab"); + } - break; + if (sym == SDLK_LEFT) { + g_val -= 0.05f; + } + if (sym == SDLK_RIGHT) { + g_val += 0.05f; } + if (sym == SDLK_UP) { + g_angle -= 1.0f; + } + if (sym == SDLK_DOWN) { + g_angle += 1.0f; + } + + break; + } case SDL_WINDOWEVENT: switch (event.window.event) { - case SDL_WINDOWEVENT_RESIZED: - for (i = 0; i < state->num_windows; ++i) { - if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { - int w, h; - status = SDL_GL_MakeCurrent(state->windows[i], context[i]); - if (status) { - SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); - break; - } - /* Change view port to the new window dimensions */ - SDL_GL_GetDrawableSize(state->windows[i], &w, &h); - ctx.glViewport(0, 0, w, h); - state->window_w = event.window.data1; - state->window_h = event.window.data2; - /* Update window content */ - Render(event.window.data1, event.window.data2, &datas[i]); - SDL_GL_SwapWindow(state->windows[i]); + case SDL_WINDOWEVENT_RESIZED: + for (i = 0; i < state->num_windows; ++i) { + if (event.window.windowID == SDL_GetWindowID(state->windows[i])) { + int w, h; + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); break; } + /* Change view port to the new window dimensions */ + SDL_GL_GetDrawableSize(state->windows[i], &w, &h); + ctx.glViewport(0, 0, w, h); + state->window_w = event.window.data1; + state->window_h = event.window.data2; + /* Update window content */ + Render(event.window.data1, event.window.data2, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + break; } - break; + } + break; } } SDLTest_CommonEvent(state, &event, &done); } - matrix_mvp[3][0] = -1.0f; matrix_mvp[3][3] = 1.0f; - matrix_mvp[0][0] = 2.0f / 640.0; - matrix_mvp[1][1] = -2.0f / 480.0; + matrix_mvp[0][0] = 2.0f / 640.0f; + matrix_mvp[1][1] = -2.0f / 480.0f; matrix_mvp[3][1] = 1.0f; - - if (0) - { - float *f = (float *) matrix_mvp; - SDL_Log("-----------------------------------"); - SDL_Log("[ %f, %f, %f, %f ]", *f++, *f++, *f++, *f++); - SDL_Log("[ %f, %f, %f, %f ]", *f++, *f++, *f++, *f++); - SDL_Log("[ %f, %f, %f, %f ]", *f++, *f++, *f++, *f++); - SDL_Log("[ %f, %f, %f, %f ]", *f++, *f++, *f++, *f++); - SDL_Log("-----------------------------------"); - } renderCopy_angle(g_angle); @@ -422,24 +403,23 @@ void loop() SDL_GL_GetDrawableSize(state->windows[0], &w, &h); rs.x = 0; rs.y = 0; rs.w = g_surf_sdf->w; rs.h = g_surf_sdf->h; - rd.w = g_surf_sdf->w * g_val; rd.h = g_surf_sdf->h * g_val; + rd.w = (int)((float)g_surf_sdf->w * g_val); rd.h = (int)((float)g_surf_sdf->h * g_val); rd.x = (w - rd.w) / 2; rd.y = (h - rd.h) / 2; renderCopy_position(&rs, &rd); } - if (!done) { - for (i = 0; i < state->num_windows; ++i) { - status = SDL_GL_MakeCurrent(state->windows[i], context[i]); - if (status) { - SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); - - /* Continue for next window */ - continue; - } - Render(state->window_w, state->window_h, &datas[i]); - SDL_GL_SwapWindow(state->windows[i]); - } + for (i = 0; i < state->num_windows; ++i) { + status = SDL_GL_MakeCurrent(state->windows[i], context[i]); + if (status) { + SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError()); + + /* Continue for next window */ + continue; + } + Render(state->window_w, state->window_h, &datas[i]); + SDL_GL_SwapWindow(state->windows[i]); + } } #ifdef __EMSCRIPTEN__ else { @@ -448,8 +428,7 @@ void loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int fsaa, accel; int value; @@ -511,11 +490,11 @@ main(int argc, char *argv[]) state->gl_profile_mask = SDL_GL_CONTEXT_PROFILE_ES; if (fsaa) { - state->gl_multisamplebuffers=1; - state->gl_multisamplesamples=fsaa; + state->gl_multisamplebuffers = 1; + state->gl_multisamplesamples = fsaa; } if (accel) { - state->gl_accelerated=1; + state->gl_accelerated = 1; } if (!SDLTest_CommonInit(state)) { quit(2); @@ -523,11 +502,11 @@ main(int argc, char *argv[]) } context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(*context)); - if (context == NULL) { + if (!context) { SDL_Log("Out of memory!\n"); quit(2); } - + /* Create OpenGL ES contexts */ for (i = 0; i < state->num_windows; i++) { context[i] = SDL_GL_CreateContext(state->windows[i]); @@ -544,8 +523,8 @@ main(int argc, char *argv[]) return 0; } - SDL_memset(matrix_mvp, 0, sizeof (matrix_mvp)); - + SDL_memset(matrix_mvp, 0, sizeof(matrix_mvp)); + { SDL_Surface *tmp; char *f; @@ -557,23 +536,24 @@ main(int argc, char *argv[]) } else { f = "testgles2_sdf_img_normal.bmp"; } - + SDL_Log("SDF is %s", g_use_SDF ? "enabled" : "disabled"); /* Load SDF BMP image */ #if 1 path = GetNearbyFilename(f); - if (path == NULL) + if (!path) { path = SDL_strdup(f); + } - if (path == NULL) { + if (!path) { SDL_Log("out of memory\n"); exit(-1); } tmp = SDL_LoadBMP(path); - if (tmp == NULL) { + if (!tmp) { SDL_Log("missing image file: %s", path); exit(-1); } else { @@ -584,10 +564,10 @@ main(int argc, char *argv[]) #else /* Generate SDF image using SDL_ttf */ - #include "SDL_ttf.h" +#include "SDL_ttf.h" char *font_file = "./font/DroidSansFallback.ttf"; char *str = "Abcde"; - SDL_Color color = { 0, 0,0, 255}; + SDL_Color color = { 0, 0, 0, 255 }; TTF_Init(); TTF_Font *font = TTF_OpenFont(font_file, 72); @@ -615,7 +595,6 @@ main(int argc, char *argv[]) SDL_SetSurfaceBlendMode(g_surf_sdf, SDL_BLENDMODE_BLEND); } - if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) { SDL_GL_SetSwapInterval(1); } else { @@ -635,28 +614,28 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_RED_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value); if (!status) { SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_GREEN_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value); if (!status) { SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value); } else { - SDL_Log( "Failed to get SDL_GL_BLUE_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value); if (!status) { SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value); } else { - SDL_Log( "Failed to get SDL_GL_DEPTH_SIZE: %s\n", + SDL_Log("Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError()); } if (fsaa) { @@ -664,15 +643,15 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value); } else { - SDL_Log( "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", + SDL_Log("Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n", SDL_GetError()); } status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value); if (!status) { SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, - value); + value); } else { - SDL_Log( "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", + SDL_Log("Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n", SDL_GetError()); } } @@ -681,7 +660,7 @@ main(int argc, char *argv[]) if (!status) { SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value); } else { - SDL_Log( "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", + SDL_Log("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n", SDL_GetError()); } } @@ -720,7 +699,6 @@ main(int argc, char *argv[]) GL_CHECK(ctx.glTexSubImage2D(g_texture_type, 0, 0 /* xoffset */, 0 /* yoffset */, g_surf_sdf->w, g_surf_sdf->h, format, type, g_surf_sdf->pixels)); } - SDL_GL_GetDrawableSize(state->windows[i], &w, &h); ctx.glViewport(0, 0, w, h); @@ -759,23 +737,20 @@ main(int argc, char *argv[]) GL_CHECK(ctx.glUseProgram(data->shader_program)); - ctx.glEnableVertexAttribArray((GLenum) GLES2_ATTRIBUTE_ANGLE); - ctx.glDisableVertexAttribArray((GLenum) GLES2_ATTRIBUTE_CENTER); + ctx.glEnableVertexAttribArray((GLenum)GLES2_ATTRIBUTE_ANGLE); + ctx.glDisableVertexAttribArray((GLenum)GLES2_ATTRIBUTE_CENTER); ctx.glEnableVertexAttribArray(GLES2_ATTRIBUTE_POSITION); - ctx.glEnableVertexAttribArray((GLenum) GLES2_ATTRIBUTE_TEXCOORD); - - - ctx.glUniform1i(g_uniform_locations[GLES2_UNIFORM_TEXTURE], 0); /* always texture unit 0. */ - ctx.glActiveTexture(GL_TEXTURE0); - ctx.glBindTexture(g_texture_type, g_texture); - GL_CHECK(ctx.glClearColor(1, 1, 1, 1)); - - // SDL_BLENDMODE_BLEND - GL_CHECK(ctx.glEnable(GL_BLEND)); - ctx.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - ctx.glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); + ctx.glEnableVertexAttribArray((GLenum)GLES2_ATTRIBUTE_TEXCOORD); + ctx.glUniform1i(g_uniform_locations[GLES2_UNIFORM_TEXTURE], 0); /* always texture unit 0. */ + ctx.glActiveTexture(GL_TEXTURE0); + ctx.glBindTexture(g_texture_type, g_texture); + GL_CHECK(ctx.glClearColor(1, 1, 1, 1)); + // SDL_BLENDMODE_BLEND + GL_CHECK(ctx.glEnable(GL_BLEND)); + ctx.glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + ctx.glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); } /* Main render loop */ @@ -795,18 +770,17 @@ main(int argc, char *argv[]) now = SDL_GetTicks(); if (now > then) { SDL_Log("%2.2f frames per second\n", - ((double) frames * 1000) / (now - then)); + ((double)frames * 1000) / (now - then)); } -#if !defined(__ANDROID__) && !defined(__NACL__) +#if !defined(__ANDROID__) && !defined(__NACL__) quit(0); -#endif +#endif return 0; } #else /* HAVE_OPENGLES2 */ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Log("No OpenGL ES support on this system\n"); return 1; diff --git a/test/testhaptic.c b/test/testhaptic.c index 8e92da347d842..56602cafb43d8 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -16,25 +16,24 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */ #include "SDL.h" +#include + #ifndef SDL_HAPTIC_DISABLED static SDL_Haptic *haptic; - /* * prototypes */ static void abort_execution(void); static void HapticPrintSupported(SDL_Haptic *); - /** * @brief The entry point of this force feedback demo. * @param[in] argc Number of arguments. * @param[in] argv Array of argc arguments. */ -int -main(int argc, char **argv) +int main(int argc, char **argv) { int i; char *name; @@ -53,9 +52,9 @@ main(int argc, char **argv) name = argv[1]; if ((SDL_strcmp(name, "--help") == 0) || (SDL_strcmp(name, "-h") == 0)) { SDL_Log("USAGE: %s [device]\n" - "If device is a two-digit number it'll use it as an index, otherwise\n" - "it'll use it as if it were part of the device's name.\n", - argv[0]); + "If device is a two-digit number it'll use it as an index, otherwise\n" + "it'll use it as if it were part of the device's name.\n", + argv[0]); return 0; } @@ -72,27 +71,28 @@ main(int argc, char **argv) SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); if (SDL_NumHaptics() > 0) { /* We'll just use index or the first force feedback device found */ - if (name == NULL) { + if (!name) { i = (index != -1) ? index : 0; } /* Try to find matching device */ else { for (i = 0; i < SDL_NumHaptics(); i++) { - if (SDL_strstr(SDL_HapticName(i), name) != NULL) + if (SDL_strstr(SDL_HapticName(i), name) != NULL) { break; + } } if (i >= SDL_NumHaptics()) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", - name); + name); return 1; } } haptic = SDL_HapticOpen(i); - if (haptic == NULL) { + if (!haptic) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", - SDL_GetError()); + SDL_GetError()); return 1; } SDL_Log("Device: %s\n", SDL_HapticName(i)); @@ -116,8 +116,8 @@ main(int argc, char **argv) SDL_Log(" effect %d: Sine Wave\n", nefx); efx[nefx].type = SDL_HAPTIC_SINE; efx[nefx].periodic.period = 1000; - efx[nefx].periodic.magnitude = -0x2000; /* Negative magnitude and ... */ - efx[nefx].periodic.phase = 18000; /* ... 180 degrees phase shift => cancel eachother */ + efx[nefx].periodic.magnitude = -0x2000; /* Negative magnitude and ... */ + efx[nefx].periodic.phase = 18000; /* ... 180 degrees phase shift => cancel eachother */ efx[nefx].periodic.length = 5000; efx[nefx].periodic.attack_length = 1000; efx[nefx].periodic.fade_length = 1000; @@ -144,13 +144,13 @@ main(int argc, char **argv) } nefx++; } - + /* Now the classical constant effect. */ if (supported & SDL_HAPTIC_CONSTANT) { SDL_Log(" effect %d: Constant Force\n", nefx); efx[nefx].type = SDL_HAPTIC_CONSTANT; efx[nefx].constant.direction.type = SDL_HAPTIC_POLAR; - efx[nefx].constant.direction.dir[0] = 20000; /* Force comes from the south-west. */ + efx[nefx].constant.direction.dir[0] = 20000; /* Force comes from the south-west. */ efx[nefx].constant.length = 5000; efx[nefx].constant.level = 0x6000; efx[nefx].constant.attack_length = 1000; @@ -162,7 +162,7 @@ main(int argc, char **argv) } nefx++; } - + /* The cute spring effect. */ if (supported & SDL_HAPTIC_SPRING) { SDL_Log(" effect %d: Condition Spring\n", nefx); @@ -173,7 +173,7 @@ main(int argc, char **argv) efx[nefx].condition.left_sat[i] = 0xFFFF; efx[nefx].condition.right_coeff[i] = 0x2000; efx[nefx].condition.left_coeff[i] = 0x2000; - efx[nefx].condition.center[i] = 0x1000; /* Displace the center for it to move. */ + efx[nefx].condition.center[i] = 0x1000; /* Displace the center for it to move. */ } id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); if (id[nefx] < 0) { @@ -210,7 +210,7 @@ main(int argc, char **argv) efx[nefx].condition.left_sat[i] = 0xFFFF; efx[nefx].condition.right_coeff[i] = 0x2000; efx[nefx].condition.left_coeff[i] = 0x2000; - efx[nefx].condition.deadband[i] = 0x1000; /* 1/16th of axis-range around the center is 'dead'. */ + efx[nefx].condition.deadband[i] = 0x1000; /* 1/16th of axis-range around the center is 'dead'. */ } id[nefx] = SDL_HapticNewEffect(haptic, &efx[nefx]); if (id[nefx] < 0) { @@ -237,14 +237,14 @@ main(int argc, char **argv) } nefx++; } - + /* Now we'll try a ramp effect */ if (supported & SDL_HAPTIC_RAMP) { SDL_Log(" effect %d: Ramp\n", nefx); efx[nefx].type = SDL_HAPTIC_RAMP; efx[nefx].ramp.direction.type = SDL_HAPTIC_CARTESIAN; - efx[nefx].ramp.direction.dir[0] = 1; /* Force comes from */ - efx[nefx].ramp.direction.dir[1] = -1; /* the north-east. */ + efx[nefx].ramp.direction.dir[0] = 1; /* Force comes from */ + efx[nefx].ramp.direction.dir[1] = -1; /* the north-east. */ efx[nefx].ramp.length = 5000; efx[nefx].ramp.start = 0x4000; efx[nefx].ramp.end = -0x4000; @@ -273,24 +273,22 @@ main(int argc, char **argv) nefx++; } - - SDL_Log - ("\nNow playing effects for 5 seconds each with 1 second delay between\n"); + SDL_Log("\nNow playing effects for 5 seconds each with 1 second delay between\n"); for (i = 0; i < nefx; i++) { SDL_Log(" Playing effect %d\n", i); SDL_HapticRunEffect(haptic, id[i], 1); - SDL_Delay(6000); /* Effects only have length 5000 */ + SDL_Delay(6000); /* Effects only have length 5000 */ } /* Quit */ - if (haptic != NULL) + if (haptic) { SDL_HapticClose(haptic); + } SDL_Quit(); return 0; } - /* * Cleans up a bit. */ @@ -305,52 +303,66 @@ abort_execution(void) exit(1); } - /* * Displays information about the haptic device. */ static void -HapticPrintSupported(SDL_Haptic * ptr) +HapticPrintSupported(SDL_Haptic *ptr) { unsigned int supported; supported = SDL_HapticQuery(ptr); SDL_Log(" Supported effects [%d effects, %d playing]:\n", - SDL_HapticNumEffects(ptr), SDL_HapticNumEffectsPlaying(ptr)); - if (supported & SDL_HAPTIC_CONSTANT) + SDL_HapticNumEffects(ptr), SDL_HapticNumEffectsPlaying(ptr)); + if (supported & SDL_HAPTIC_CONSTANT) { SDL_Log(" constant\n"); - if (supported & SDL_HAPTIC_SINE) + } + if (supported & SDL_HAPTIC_SINE) { SDL_Log(" sine\n"); + } /* !!! FIXME: put this back when we have more bits in 2.1 */ /* if (supported & SDL_HAPTIC_SQUARE) SDL_Log(" square\n"); */ - if (supported & SDL_HAPTIC_TRIANGLE) + if (supported & SDL_HAPTIC_TRIANGLE) { SDL_Log(" triangle\n"); - if (supported & SDL_HAPTIC_SAWTOOTHUP) + } + if (supported & SDL_HAPTIC_SAWTOOTHUP) { SDL_Log(" sawtoothup\n"); - if (supported & SDL_HAPTIC_SAWTOOTHDOWN) + } + if (supported & SDL_HAPTIC_SAWTOOTHDOWN) { SDL_Log(" sawtoothdown\n"); - if (supported & SDL_HAPTIC_RAMP) + } + if (supported & SDL_HAPTIC_RAMP) { SDL_Log(" ramp\n"); - if (supported & SDL_HAPTIC_FRICTION) + } + if (supported & SDL_HAPTIC_FRICTION) { SDL_Log(" friction\n"); - if (supported & SDL_HAPTIC_SPRING) + } + if (supported & SDL_HAPTIC_SPRING) { SDL_Log(" spring\n"); - if (supported & SDL_HAPTIC_DAMPER) + } + if (supported & SDL_HAPTIC_DAMPER) { SDL_Log(" damper\n"); - if (supported & SDL_HAPTIC_INERTIA) + } + if (supported & SDL_HAPTIC_INERTIA) { SDL_Log(" inertia\n"); - if (supported & SDL_HAPTIC_CUSTOM) + } + if (supported & SDL_HAPTIC_CUSTOM) { SDL_Log(" custom\n"); - if (supported & SDL_HAPTIC_LEFTRIGHT) + } + if (supported & SDL_HAPTIC_LEFTRIGHT) { SDL_Log(" left/right\n"); + } SDL_Log(" Supported capabilities:\n"); - if (supported & SDL_HAPTIC_GAIN) + if (supported & SDL_HAPTIC_GAIN) { SDL_Log(" gain\n"); - if (supported & SDL_HAPTIC_AUTOCENTER) + } + if (supported & SDL_HAPTIC_AUTOCENTER) { SDL_Log(" autocenter\n"); - if (supported & SDL_HAPTIC_STATUS) + } + if (supported & SDL_HAPTIC_STATUS) { SDL_Log(" status\n"); + } } #else diff --git a/test/testhittesting.c b/test/testhittesting.c index c5223a9839528..94c5ea9aea4b3 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -29,9 +29,10 @@ hitTest(SDL_Window *window, const SDL_Point *pt, void *data) SDL_GetWindowSize(window, &w, &h); - #define REPORT_RESIZE_HIT(name) { \ +#define REPORT_RESIZE_HIT(name) \ + { \ SDL_Log("HIT-TEST: RESIZE_" #name "\n"); \ - return SDL_HITTEST_RESIZE_##name; \ + return SDL_HITTEST_RESIZE_##name; \ } if (pt->x < RESIZE_BORDER && pt->y < RESIZE_BORDER) { @@ -56,7 +57,6 @@ hitTest(SDL_Window *window, const SDL_Point *pt, void *data) return SDL_HITTEST_NORMAL; } - int main(int argc, char **argv) { int done = 0; @@ -74,8 +74,7 @@ int main(int argc, char **argv) return 1; } - while (!done) - { + while (!done) { SDL_Event e; int nothing_to_do = 1; @@ -88,39 +87,38 @@ int main(int argc, char **argv) while (SDL_PollEvent(&e)) { nothing_to_do = 0; - switch (e.type) - { - case SDL_MOUSEBUTTONDOWN: - SDL_Log("button down!\n"); - break; + switch (e.type) { + case SDL_MOUSEBUTTONDOWN: + SDL_Log("button down!\n"); + break; - case SDL_MOUSEBUTTONUP: - SDL_Log("button up!\n"); - break; + case SDL_MOUSEBUTTONUP: + SDL_Log("button up!\n"); + break; - case SDL_WINDOWEVENT: - if (e.window.event == SDL_WINDOWEVENT_MOVED) { - SDL_Log("Window event moved to (%d, %d)!\n", (int) e.window.data1, (int) e.window.data2); - } - break; - - case SDL_KEYDOWN: - if (e.key.keysym.sym == SDLK_ESCAPE) { - done = 1; - } else if (e.key.keysym.sym == SDLK_x) { - if (!areas) { - areas = drag_areas; - numareas = SDL_arraysize(drag_areas); - } else { - areas = NULL; - numareas = 0; - } - } - break; + case SDL_WINDOWEVENT: + if (e.window.event == SDL_WINDOWEVENT_MOVED) { + SDL_Log("Window event moved to (%d, %d)!\n", (int)e.window.data1, (int)e.window.data2); + } + break; - case SDL_QUIT: + case SDL_KEYDOWN: + if (e.key.keysym.sym == SDLK_ESCAPE) { done = 1; - break; + } else if (e.key.keysym.sym == SDLK_x) { + if (!areas) { + areas = drag_areas; + numareas = SDL_arraysize(drag_areas); + } else { + areas = NULL; + numareas = 0; + } + } + break; + + case SDL_QUIT: + done = 1; + break; } } diff --git a/test/testhotplug.c b/test/testhotplug.c index a2fb37b55608a..57706a755c8bb 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,7 @@ #if !defined SDL_JOYSTICK_DISABLED && !defined SDL_HAPTIC_DISABLED -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Joystick *joystick = NULL; SDL_Haptic *haptic = NULL; @@ -30,17 +29,17 @@ main(int argc, char *argv[]) int i; SDL_bool enable_haptic = SDL_TRUE; Uint32 init_subsystems = SDL_INIT_VIDEO | SDL_INIT_JOYSTICK; - + for (i = 1; i < argc; ++i) { if (SDL_strcasecmp(argv[i], "--nohaptic") == 0) { enable_haptic = SDL_FALSE; } } - if(enable_haptic) { + if (enable_haptic) { init_subsystems |= SDL_INIT_HAPTIC; } - + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -57,91 +56,78 @@ main(int argc, char *argv[]) */ SDL_Log("There are %d joysticks at startup\n", SDL_NumJoysticks()); - if (enable_haptic) + if (enable_haptic) { SDL_Log("There are %d haptic devices at startup\n", SDL_NumHaptics()); + } - while(keepGoing) - { + while (keepGoing) { SDL_Event event; - while(SDL_PollEvent(&event)) - { - switch(event.type) - { - case SDL_QUIT: - keepGoing = SDL_FALSE; - break; - case SDL_JOYDEVICEADDED: - if (joystick != NULL) - { - SDL_Log("Only one joystick supported by this test\n"); - } - else - { - joystick = SDL_JoystickOpen(event.jdevice.which); - instance = SDL_JoystickInstanceID(joystick); - SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_JoystickName(joystick)); - if (enable_haptic) - { - if (SDL_JoystickIsHaptic(joystick)) - { - haptic = SDL_HapticOpenFromJoystick(joystick); - if (haptic) - { - SDL_Log("Joy Haptic Opened\n"); - if (SDL_HapticRumbleInit( haptic ) != 0) - { - SDL_Log("Could not init Rumble!: %s\n", SDL_GetError()); - SDL_HapticClose(haptic); - haptic = NULL; - } - } else { - SDL_Log("Joy haptic open FAILED!: %s\n", SDL_GetError()); + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_QUIT: + keepGoing = SDL_FALSE; + break; + case SDL_JOYDEVICEADDED: + if (joystick) { + SDL_Log("Only one joystick supported by this test\n"); + } else { + joystick = SDL_JoystickOpen(event.jdevice.which); + instance = SDL_JoystickInstanceID(joystick); + SDL_Log("Joy Added : %" SDL_PRIs32 " : %s\n", event.jdevice.which, SDL_JoystickName(joystick)); + if (enable_haptic) { + if (SDL_JoystickIsHaptic(joystick)) { + haptic = SDL_HapticOpenFromJoystick(joystick); + if (haptic) { + SDL_Log("Joy Haptic Opened\n"); + if (SDL_HapticRumbleInit(haptic) != 0) { + SDL_Log("Could not init Rumble!: %s\n", SDL_GetError()); + SDL_HapticClose(haptic); + haptic = NULL; } + } else { + SDL_Log("Joy haptic open FAILED!: %s\n", SDL_GetError()); } - else - { - SDL_Log("No haptic found\n"); - } + } else { + SDL_Log("No haptic found\n"); } } - break; - case SDL_JOYDEVICEREMOVED: - if (instance == event.jdevice.which) - { - SDL_Log("Joy Removed: %" SDL_PRIs32 "\n", event.jdevice.which); - instance = -1; - if(enable_haptic && haptic) - { - SDL_HapticClose(haptic); - haptic = NULL; - } - SDL_JoystickClose(joystick); - joystick = NULL; - } else { - SDL_Log("Unknown joystick diconnected\n"); + } + break; + case SDL_JOYDEVICEREMOVED: + if (instance == event.jdevice.which) { + SDL_Log("Joy Removed: %" SDL_PRIs32 "\n", event.jdevice.which); + instance = -1; + if (enable_haptic && haptic) { + SDL_HapticClose(haptic); + haptic = NULL; } - break; - case SDL_JOYAXISMOTION: -/* -// SDL_Log("Axis Move: %d\n", event.jaxis.axis); -*/ - if (enable_haptic) - SDL_HapticRumblePlay(haptic, 0.25, 250); - break; - case SDL_JOYBUTTONDOWN: - SDL_Log("Button Press: %d\n", event.jbutton.button); - if(enable_haptic && haptic) - { - SDL_HapticRumblePlay(haptic, 0.25, 250); - } - if (event.jbutton.button == 0) { - SDL_Log("Exiting due to button press of button 0\n"); - keepGoing = SDL_FALSE; - } - break; - case SDL_JOYBUTTONUP: - SDL_Log("Button Release: %d\n", event.jbutton.button); - break; + SDL_JoystickClose(joystick); + joystick = NULL; + } else { + SDL_Log("Unknown joystick diconnected\n"); + } + break; + case SDL_JOYAXISMOTION: + /* + // SDL_Log("Axis Move: %d\n", event.jaxis.axis); + */ + if (enable_haptic) { + SDL_HapticRumblePlay(haptic, 0.25, 250); + } + break; + case SDL_JOYBUTTONDOWN: + SDL_Log("Button Press: %d\n", event.jbutton.button); + if (enable_haptic && haptic) { + SDL_HapticRumblePlay(haptic, 0.25, 250); + } + if (event.jbutton.button == 0) { + SDL_Log("Exiting due to button press of button 0\n"); + keepGoing = SDL_FALSE; + } + break; + case SDL_JOYBUTTONUP: + SDL_Log("Button Release: %d\n", event.jbutton.button); + break; } } } diff --git a/test/testiconv.c b/test/testiconv.c index fc080661895b7..7c27d58c04c94 100644 --- a/test/testiconv.c +++ b/test/testiconv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,7 +12,7 @@ /* quiet windows compiler warnings */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -# define _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS #endif #include @@ -24,15 +24,14 @@ static size_t widelen(char *data) { size_t len = 0; - Uint32 *p = (Uint32 *) data; + Uint32 *p = (Uint32 *)data; while (*p++) { ++len; } return len; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { const char *formats[] = { "UTF8", @@ -49,7 +48,7 @@ main(int argc, char *argv[]) "UCS-4", }; - char * fname; + char *fname; char buffer[BUFSIZ]; char *ucs4; char *test[2]; @@ -64,7 +63,7 @@ main(int argc, char *argv[]) file = fopen(fname, "rb"); if (!file) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", fname); - return (1); + return 1; } SDL_free(fname); @@ -87,11 +86,11 @@ main(int argc, char *argv[]) } test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len); SDL_free(ucs4); - fputs(test[0], stdout); + (void)fputs(test[0], stdout); SDL_free(test[0]); } - fclose(file); + (void)fclose(file); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Total errors: %d\n", errors); - return (errors ? errors + 1 : 0); + return errors ? errors + 1 : 0; } diff --git a/test/testime.c b/test/testime.c index 9a0b5259ec628..8dcd6bb661e5a 100644 --- a/test/testime.c +++ b/test/testime.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,7 +29,7 @@ #ifdef HAVE_SDL_TTF #ifdef __MACOSX__ #define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf" -#elif __WIN32__ +#elif defined(__WIN32__) /* Some japanese font present on at least Windows 8.1. */ #define DEFAULT_FONT "C:\\Windows\\Fonts\\yugothic.ttf" #else @@ -42,41 +42,43 @@ static SDLTest_CommonState *state; static SDL_Rect textRect, markedRect; -static SDL_Color lineColor = {0,0,0,255}; -static SDL_Color backColor = {255,255,255,255}; -static SDL_Color textColor = {0,0,0,255}; +static SDL_Color lineColor = { 0, 0, 0, 255 }; +static SDL_Color backColor = { 255, 255, 255, 255 }; +static SDL_Color textColor = { 0, 0, 0, 255 }; static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; static int cursor = 0; #ifdef HAVE_SDL_TTF static TTF_Font *font; #else -#define UNIFONT_MAX_CODEPOINT 0x1ffff -#define UNIFONT_NUM_GLYPHS 0x20000 +#define UNIFONT_MAX_CODEPOINT 0x1ffff +#define UNIFONT_NUM_GLYPHS 0x20000 /* Using 512x512 textures that are supported everywhere. */ -#define UNIFONT_TEXTURE_WIDTH 512 -#define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / 16) +#define UNIFONT_TEXTURE_WIDTH 512 +#define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / 16) #define UNIFONT_GLYPHS_IN_TEXTURE (UNIFONT_GLYPHS_IN_ROW * UNIFONT_GLYPHS_IN_ROW) -#define UNIFONT_NUM_TEXTURES ((UNIFONT_NUM_GLYPHS + UNIFONT_GLYPHS_IN_TEXTURE - 1) / UNIFONT_GLYPHS_IN_TEXTURE) -#define UNIFONT_TEXTURE_SIZE (UNIFONT_TEXTURE_WIDTH * UNIFONT_TEXTURE_WIDTH * 4) -#define UNIFONT_TEXTURE_PITCH (UNIFONT_TEXTURE_WIDTH * 4) -#define UNIFONT_DRAW_SCALE 2 -struct UnifontGlyph { +#define UNIFONT_NUM_TEXTURES ((UNIFONT_NUM_GLYPHS + UNIFONT_GLYPHS_IN_TEXTURE - 1) / UNIFONT_GLYPHS_IN_TEXTURE) +#define UNIFONT_TEXTURE_SIZE (UNIFONT_TEXTURE_WIDTH * UNIFONT_TEXTURE_WIDTH * 4) +#define UNIFONT_TEXTURE_PITCH (UNIFONT_TEXTURE_WIDTH * 4) +#define UNIFONT_DRAW_SCALE 2 +struct UnifontGlyph +{ Uint8 width; Uint8 data[32]; -} *unifontGlyph; +} * unifontGlyph; static SDL_Texture **unifontTexture; -static Uint8 unifontTextureLoaded[UNIFONT_NUM_TEXTURES] = {0}; +static Uint8 unifontTextureLoaded[UNIFONT_NUM_TEXTURES] = { 0 }; /* Unifont loading code start */ static Uint8 dehex(char c) { - if (c >= '0' && c <= '9') + if (c >= '0' && c <= '9') { return c - '0'; - else if (c >= 'a' && c <= 'f') + } else if (c >= 'a' && c <= 'f') { return c - 'a' + 10; - else if (c >= 'A' && c <= 'F') + } else if (c >= 'A' && c <= 'F') { return c - 'A' + 10; + } return 255; } @@ -88,15 +90,16 @@ static Uint8 dehex2(char c1, char c2) static Uint8 validate_hex(const char *cp, size_t len, Uint32 *np) { Uint32 n = 0; - for (; len > 0; cp++, len--) - { + for (; len > 0; cp++, len--) { Uint8 c = dehex(*cp); - if (c == 255) + if (c == 255) { return 0; + } n = (n << 4) | c; } - if (np != NULL) + if (np) { *np = n; + } return 1; } @@ -113,8 +116,7 @@ static int unifont_init(const char *fontname) /* Allocate memory for the glyph data so the file can be closed after initialization. */ unifontGlyph = (struct UnifontGlyph *)SDL_malloc(unifontGlyphSize); - if (unifontGlyph == NULL) - { + if (!unifontGlyph) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for glyph data.\n", (int)(unifontGlyphSize + 1023) / 1024); return -1; } @@ -122,22 +124,20 @@ static int unifont_init(const char *fontname) /* Allocate memory for texture pointers for all renderers. */ unifontTexture = (SDL_Texture **)SDL_malloc(unifontTextureSize); - if (unifontTexture == NULL) - { + if (!unifontTexture) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for texture pointer data.\n", (int)(unifontTextureSize + 1023) / 1024); return -1; } SDL_memset(unifontTexture, 0, unifontTextureSize); filename = GetResourceFilename(NULL, fontname); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); return -1; } hexFile = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (hexFile == NULL) - { + if (!hexFile) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to open font file: %s\n", fontname); return -1; } @@ -150,76 +150,71 @@ static int unifont_init(const char *fontname) Uint32 codepoint; bytesRead = SDL_RWread(hexFile, hexBuffer, 1, 9); - if (numGlyphs > 0 && bytesRead == 0) + if (numGlyphs > 0 && bytesRead == 0) { break; /* EOF */ - if ((numGlyphs == 0 && bytesRead == 0) || (numGlyphs > 0 && bytesRead < 9)) - { + } + if ((numGlyphs == 0 && bytesRead == 0) || (numGlyphs > 0 && bytesRead < 9)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); return -1; } /* Looking for the colon that separates the codepoint and glyph data at position 2, 4, 6 and 8. */ - if (hexBuffer[2] == ':') + if (hexBuffer[2] == ':') { codepointHexSize = 2; - else if (hexBuffer[4] == ':') + } else if (hexBuffer[4] == ':') { codepointHexSize = 4; - else if (hexBuffer[6] == ':') + } else if (hexBuffer[6] == ':') { codepointHexSize = 6; - else if (hexBuffer[8] == ':') + } else if (hexBuffer[8] == ':') { codepointHexSize = 8; - else - { + } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Could not find codepoint and glyph data separator symbol in hex file on line %d.\n", lineNumber); return -1; } - if (!validate_hex((const char *)hexBuffer, codepointHexSize, &codepoint)) - { + if (!validate_hex((const char *)hexBuffer, codepointHexSize, &codepoint)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Malformed hexadecimal number in hex file on line %d.\n", lineNumber); return -1; } - if (codepoint > UNIFONT_MAX_CODEPOINT) + if (codepoint > UNIFONT_MAX_CODEPOINT) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Codepoint on line %d exceeded limit of 0x%x.\n", lineNumber, UNIFONT_MAX_CODEPOINT); + } /* If there was glyph data read in the last file read, move it to the front of the buffer. */ bytesOverread = 8 - codepointHexSize; - if (codepointHexSize < 8) + if (codepointHexSize < 8) { SDL_memmove(hexBuffer, hexBuffer + codepointHexSize + 1, bytesOverread); + } bytesRead = SDL_RWread(hexFile, hexBuffer + bytesOverread, 1, 33 - bytesOverread); - if (bytesRead < (33 - bytesOverread)) - { + if (bytesRead < (33 - bytesOverread)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); return -1; } - if (hexBuffer[32] == '\n') + if (hexBuffer[32] == '\n') { glyphWidth = 8; - else - { + } else { glyphWidth = 16; bytesRead = SDL_RWread(hexFile, hexBuffer + 33, 1, 32); - if (bytesRead < 32) - { + if (bytesRead < 32) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Unexpected end of hex file.\n"); return -1; } } - if (!validate_hex((const char *)hexBuffer, glyphWidth * 4, NULL)) - { + if (!validate_hex((const char *)hexBuffer, glyphWidth * 4, NULL)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Malformed hexadecimal glyph data in hex file on line %d.\n", lineNumber); return -1; } - if (codepoint <= UNIFONT_MAX_CODEPOINT) - { - if (unifontGlyph[codepoint].width > 0) + if (codepoint <= UNIFONT_MAX_CODEPOINT) { + if (unifontGlyph[codepoint].width > 0) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "unifont: Ignoring duplicate codepoint 0x%08" SDL_PRIx32 " in hex file on line %d.\n", codepoint, lineNumber); - else - { + } else { unifontGlyph[codepoint].width = glyphWidth; /* Pack the hex data into a more compact form. */ - for (i = 0; i < glyphWidth * 2; i++) + for (i = 0; i < glyphWidth * 2; i++) { unifontGlyph[codepoint].data[i] = dehex2(hexBuffer[i * 2], hexBuffer[i * 2 + 1]); + } numGlyphs++; } } @@ -232,25 +227,21 @@ static int unifont_init(const char *fontname) return 0; } -static void unifont_make_rgba(Uint8 *src, Uint8 *dst, Uint8 width) +static void +unifont_make_rgba(const Uint8 *src, Uint8 *dst, Uint8 width) { int i, j; Uint8 *row = dst; - for (i = 0; i < width * 2; i++) - { + for (i = 0; i < width * 2; i++) { Uint8 data = src[i]; - for (j = 0; j < 8; j++) - { - if (data & 0x80) - { + for (j = 0; j < 8; j++) { + if (data & 0x80) { row[0] = textColor.r; row[1] = textColor.g; row[2] = textColor.b; row[3] = textColor.a; - } - else - { + } else { row[0] = 0; row[1] = 0; row[2] = 0; @@ -260,8 +251,7 @@ static void unifont_make_rgba(Uint8 *src, Uint8 *dst, Uint8 width) row += 4; } - if (width == 8 || (width == 16 && i % 2 == 1)) - { + if (width == 8 || (width == 16 && i % 2 == 1)) { dst += UNIFONT_TEXTURE_PITCH; row = dst; } @@ -271,51 +261,45 @@ static void unifont_make_rgba(Uint8 *src, Uint8 *dst, Uint8 width) static int unifont_load_texture(Uint32 textureID) { int i; - Uint8 * textureRGBA; + Uint8 *textureRGBA; - if (textureID >= UNIFONT_NUM_TEXTURES) - { + if (textureID >= UNIFONT_NUM_TEXTURES) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Tried to load out of range texture %" SDL_PRIu32 "\n", textureID); return -1; } textureRGBA = (Uint8 *)SDL_malloc(UNIFONT_TEXTURE_SIZE); - if (textureRGBA == NULL) - { + if (!textureRGBA) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d MiB for a texture.\n", UNIFONT_TEXTURE_SIZE / 1024 / 1024); return -1; } SDL_memset(textureRGBA, 0, UNIFONT_TEXTURE_SIZE); /* Copy the glyphs into memory in RGBA format. */ - for (i = 0; i < UNIFONT_GLYPHS_IN_TEXTURE; i++) - { + for (i = 0; i < UNIFONT_GLYPHS_IN_TEXTURE; i++) { Uint32 codepoint = UNIFONT_GLYPHS_IN_TEXTURE * textureID + i; - if (unifontGlyph[codepoint].width > 0) - { + if (unifontGlyph[codepoint].width > 0) { const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; - const size_t offset = (cInTex / UNIFONT_GLYPHS_IN_ROW) * UNIFONT_TEXTURE_PITCH * 16 + (cInTex % UNIFONT_GLYPHS_IN_ROW) * 16 * 4; + const size_t offset = ((size_t)cInTex / UNIFONT_GLYPHS_IN_ROW) * UNIFONT_TEXTURE_PITCH * 16 + (cInTex % UNIFONT_GLYPHS_IN_ROW) * 16 * 4; unifont_make_rgba(unifontGlyph[codepoint].data, textureRGBA + offset, unifontGlyph[codepoint].width); } } /* Create textures and upload the RGBA data from above. */ - for (i = 0; i < state->num_windows; ++i) - { + for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; SDL_Texture *tex = unifontTexture[UNIFONT_NUM_TEXTURES * i + textureID]; - if (state->windows[i] == NULL || renderer == NULL || tex != NULL) + if (state->windows[i] == NULL || renderer == NULL || tex != NULL) { continue; + } tex = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, UNIFONT_TEXTURE_WIDTH, UNIFONT_TEXTURE_WIDTH); - if (tex == NULL) - { + if (tex == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to create texture %" SDL_PRIu32 " for renderer %d.\n", textureID, i); return -1; } unifontTexture[UNIFONT_NUM_TEXTURES * i + textureID] = tex; SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND); - if (SDL_UpdateTexture(tex, NULL, textureRGBA, UNIFONT_TEXTURE_PITCH) != 0) - { + if (SDL_UpdateTexture(tex, NULL, textureRGBA, UNIFONT_TEXTURE_PITCH) != 0) { SDL_Log("unifont error: Failed to update texture %" SDL_PRIu32 " data for renderer %d.\n", textureID, i); } } @@ -340,8 +324,7 @@ static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_Rect *dst } } texture = unifontTexture[UNIFONT_NUM_TEXTURES * rendererID + textureID]; - if (texture != NULL) - { + if (texture) { const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; srcrect.x = cInTex % UNIFONT_GLYPHS_IN_ROW * 16; srcrect.y = cInTex / UNIFONT_GLYPHS_IN_ROW * 16; @@ -350,24 +333,25 @@ static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_Rect *dst return unifontGlyph[codepoint].width; } -static void unifont_cleanup() +static void unifont_cleanup(void) { int i, j; - for (i = 0; i < state->num_windows; ++i) - { + for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL || renderer == NULL) + if (state->windows[i] == NULL || !renderer) { continue; - for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) - { + } + for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) { SDL_Texture *tex = unifontTexture[UNIFONT_NUM_TEXTURES * i + j]; - if (tex != NULL) + if (tex) { SDL_DestroyTexture(tex); + } } } - for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) - unifontTextureLoaded[j] = 0; + for (j = 0; j < UNIFONT_NUM_TEXTURES; j++) { + unifontTextureLoaded[j] = 0; + } SDL_free(unifontTexture); SDL_free(unifontGlyph); @@ -379,30 +363,31 @@ static void unifont_cleanup() size_t utf8_length(unsigned char c) { c = (unsigned char)(0xff & c); - if (c < 0x80) + if (c < 0x80) { return 1; - else if ((c >> 5) ==0x6) + } else if ((c >> 5) == 0x6) { return 2; - else if ((c >> 4) == 0xe) + } else if ((c >> 4) == 0xe) { return 3; - else if ((c >> 3) == 0x1e) + } else if ((c >> 3) == 0x1e) { return 4; - else - return 0; + } + return 0; } char *utf8_next(char *p) { size_t len = utf8_length(*p); size_t i = 0; - if (!len) + if (!len) { return 0; + } - for (; i < len; ++i) - { + for (; i < len; ++i) { ++p; - if (!*p) + if (!*p) { return 0; + } } return p; } @@ -410,8 +395,7 @@ char *utf8_next(char *p) char *utf8_advance(char *p, size_t distance) { size_t i = 0; - for (; i < distance && p; ++i) - { + for (; i < distance && p; ++i) { p = utf8_next(p); } return p; @@ -421,32 +405,32 @@ Uint32 utf8_decode(char *p, size_t len) { Uint32 codepoint = 0; size_t i = 0; - if (!len) + if (!len) { return 0; + } - for (; i < len; ++i) - { - if (i == 0) + for (; i < len; ++i) { + if (i == 0) { codepoint = (0xff >> len) & *p; - else - { + } else { codepoint <<= 6; codepoint |= 0x3f & *p; } - if (!*p) + if (!*p) { return 0; + } p++; } return codepoint; } -void usage() +void usage(void) { SDL_Log("usage: testime [--font fontfile]\n"); } -void InitInput() +void InitInput(void) { /* Prepare a rect for text input */ textRect.x = textRect.y = 100; @@ -460,7 +444,7 @@ void InitInput() SDL_StartTextInput(); } -void CleanupVideo() +void CleanupVideo(void) { SDL_StopTextInput(); #ifdef HAVE_SDL_TTF @@ -473,16 +457,15 @@ void CleanupVideo() void _Redraw(int rendererID) { - SDL_Renderer * renderer = state->renderers[rendererID]; + SDL_Renderer *renderer = state->renderers[rendererID]; SDL_Rect drawnTextRect, cursorRect, underlineRect; drawnTextRect = textRect; drawnTextRect.w = 0; SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); - SDL_RenderFillRect(renderer,&textRect); + SDL_RenderFillRect(renderer, &textRect); - if (*text) - { + if (*text) { #ifdef HAVE_SDL_TTF SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, textColor); SDL_Texture *texture; @@ -492,10 +475,10 @@ void _Redraw(int rendererID) drawnTextRect.w = textSur->w; drawnTextRect.h = textSur->h; - texture = SDL_CreateTextureFromSurface(renderer,textSur); + texture = SDL_CreateTextureFromSurface(renderer, textSur); SDL_FreeSurface(textSur); - SDL_RenderCopy(renderer,texture,NULL,&drawnTextRect); + SDL_RenderCopy(renderer, texture, NULL, &drawnTextRect); SDL_DestroyTexture(texture); #else char *utext = text; @@ -510,8 +493,7 @@ void _Redraw(int rendererID) drawnTextRect.y = dstrect.y; drawnTextRect.h = dstrect.h; - while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) - { + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) { Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; dstrect.x += advance; drawnTextRect.w += advance; @@ -522,14 +504,11 @@ void _Redraw(int rendererID) markedRect.x = textRect.x + drawnTextRect.w; markedRect.w = textRect.w - drawnTextRect.w; - if (markedRect.w < 0) - { + if (markedRect.w < 0) { /* Stop text input because we cannot hold any more characters */ SDL_StopTextInput(); return; - } - else - { + } else { SDL_StartTextInput(); } @@ -542,19 +521,18 @@ void _Redraw(int rendererID) drawnTextRect.w = 0; SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); - SDL_RenderFillRect(renderer,&markedRect); + SDL_RenderFillRect(renderer, &markedRect); - if (markedText[0]) - { + if (markedText[0]) { #ifdef HAVE_SDL_TTF SDL_Surface *textSur; SDL_Texture *texture; - if (cursor) - { + if (cursor) { char *p = utf8_advance(markedText, cursor); char c = 0; - if (!p) + if (!p) { p = &markedText[SDL_strlen(markedText)]; + } c = *p; *p = 0; @@ -568,10 +546,10 @@ void _Redraw(int rendererID) drawnTextRect.w = textSur->w; drawnTextRect.h = textSur->h; - texture = SDL_CreateTextureFromSurface(renderer,textSur); + texture = SDL_CreateTextureFromSurface(renderer, textSur); SDL_FreeSurface(textSur); - SDL_RenderCopy(renderer,texture,NULL,&drawnTextRect); + SDL_RenderCopy(renderer, texture, NULL, &drawnTextRect); SDL_DestroyTexture(texture); #else int i = 0; @@ -587,20 +565,19 @@ void _Redraw(int rendererID) drawnTextRect.y = dstrect.y; drawnTextRect.h = dstrect.h; - while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) - { + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) { Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; dstrect.x += advance; drawnTextRect.w += advance; - if (i < cursor) + if (i < cursor) { cursorRect.x += advance; + } i++; utext += len; } #endif - if (cursor > 0) - { + if (cursor > 0) { cursorRect.y = drawnTextRect.y; cursorRect.h = drawnTextRect.h; } @@ -615,18 +592,19 @@ void _Redraw(int rendererID) } SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); - SDL_RenderFillRect(renderer,&cursorRect); + SDL_RenderFillRect(renderer, &cursorRect); SDL_SetTextInputRect(&markedRect); } -void Redraw() +void Redraw(void) { int i; for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); SDL_RenderClear(renderer); @@ -651,24 +629,22 @@ int main(int argc, char *argv[]) if (!state) { return 1; } - for (i = 1; i < argc;i++) { + for (i = 1; i < argc; i++) { SDLTest_CommonArg(state, i); } - for (argc--, argv++; argc > 0; argc--, argv++) - { + for (argc--, argv++; argc > 0; argc--, argv++) { if (SDL_strcmp(argv[0], "--help") == 0) { usage(); return 0; } - else if (SDL_strcmp(argv[0], "--font") == 0) - { + else if (SDL_strcmp(argv[0], "--font") == 0) { argc--; argv++; - if (argc > 0) + if (argc > 0) { fontname = argv[0]; - else { + } else { usage(); return 0; } @@ -679,14 +655,12 @@ int main(int argc, char *argv[]) return 2; } - #ifdef HAVE_SDL_TTF /* Initialize fonts */ TTF_Init(); font = TTF_OpenFont(fontname, DEFAULT_PTSIZE); - if (! font) - { + if (!font) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to find font: %s\n", TTF_GetError()); return -1; } @@ -713,91 +687,82 @@ int main(int argc, char *argv[]) /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); - switch(event.type) { - case SDL_KEYDOWN: { - switch (event.key.keysym.sym) - { - case SDLK_RETURN: - text[0]=0x00; - Redraw(); - break; - case SDLK_BACKSPACE: - /* Only delete text if not in editing mode. */ - if (!markedText[0]) - { - size_t textlen = SDL_strlen(text); - - do { - if (textlen==0) - { - break; - } - if ((text[textlen-1] & 0x80) == 0x00) - { - /* One byte */ - text[textlen-1]=0x00; - break; - } - if ((text[textlen-1] & 0xC0) == 0x80) - { - /* Byte from the multibyte sequence */ - text[textlen-1]=0x00; - textlen--; - } - if ((text[textlen-1] & 0xC0) == 0xC0) - { - /* First byte of multibyte sequence */ - text[textlen-1]=0x00; - break; - } - } while(1); - - Redraw(); - } - break; - } - - if (done) - { - break; + switch (event.type) { + case SDL_KEYDOWN: + switch (event.key.keysym.sym) { + case SDLK_RETURN: + text[0] = 0x00; + Redraw(); + break; + case SDLK_BACKSPACE: + /* Only delete text if not in editing mode. */ + if (!markedText[0]) { + size_t textlen = SDL_strlen(text); + + do { + if (textlen == 0) { + break; + } + if (!(text[textlen - 1] & 0x80)) { + /* One byte */ + text[textlen - 1] = 0x00; + break; + } + if ((text[textlen - 1] & 0xC0) == 0x80) { + /* Byte from the multibyte sequence */ + text[textlen - 1] = 0x00; + textlen--; + } + if ((text[textlen - 1] & 0xC0) == 0xC0) { + /* First byte of multibyte sequence */ + text[textlen - 1] = 0x00; + break; + } + } while (1); + + Redraw(); } - - SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s\n", - event.key.keysym.scancode, - SDL_GetScancodeName(event.key.keysym.scancode), - SDL_static_cast(Uint32, event.key.keysym.sym), - SDL_GetKeyName(event.key.keysym.sym)); break; + } - case SDL_TEXTINPUT: - if (event.text.text[0] == '\0' || event.text.text[0] == '\n' || - markedRect.w < 0) - break; - - SDL_Log("Keyboard: text input \"%s\"\n", event.text.text); - - if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text)) - SDL_strlcat(text, event.text.text, sizeof(text)); + if (done) { + break; + } - SDL_Log("text inputed: %s\n", text); + SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s\n", + event.key.keysym.scancode, + SDL_GetScancodeName(event.key.keysym.scancode), + SDL_static_cast(Uint32, event.key.keysym.sym), + SDL_GetKeyName(event.key.keysym.sym)); + break; - /* After text inputed, we can clear up markedText because it */ - /* is committed */ - markedText[0] = 0; - Redraw(); + case SDL_TEXTINPUT: + if (event.text.text[0] == '\0' || event.text.text[0] == '\n' || markedRect.w < 0) { break; + } - case SDL_TEXTEDITING: - SDL_Log("text editing \"%s\", selected range (%" SDL_PRIs32 ", %" SDL_PRIs32 ")\n", - event.edit.text, event.edit.start, event.edit.length); + SDL_Log("Keyboard: text input \"%s\"\n", event.text.text); - SDL_strlcpy(markedText, event.edit.text, SDL_TEXTEDITINGEVENT_TEXT_SIZE); - cursor = event.edit.start; - Redraw(); - break; + if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text)) { + SDL_strlcat(text, event.text.text, sizeof(text)); } + + SDL_Log("text inputed: %s\n", text); + + /* After text inputed, we can clear up markedText because it */ + /* is committed */ + markedText[0] = 0; + Redraw(); break; + case SDL_TEXTEDITING: + SDL_Log("text editing \"%s\", selected range (%" SDL_PRIs32 ", %" SDL_PRIs32 ")\n", + event.edit.text, event.edit.start, event.edit.length); + + SDL_strlcpy(markedText, event.edit.text, SDL_TEXTEDITINGEVENT_TEXT_SIZE); + cursor = event.edit.start; + Redraw(); + break; } } } diff --git a/test/testintersections.c b/test/testintersections.c index 29af8e21f6969..b3a91f70bb650 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,7 +22,12 @@ #include "SDL_test_common.h" -#define SWAP(typ,a,b) do{typ t=a;a=b;b=t;}while(0) +#define SWAP(typ, a, b) \ + do { \ + typ t = a; \ + a = b; \ + b = t; \ + } while (0) #define NUM_OBJECTS 100 static SDLTest_CommonState *state; @@ -37,8 +42,7 @@ static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; int mouse_begin_x = -1, mouse_begin_y = -1; int done; -void -DrawPoints(SDL_Renderer * renderer) +void DrawPoints(SDL_Renderer *renderer) { int i; int x, y; @@ -71,8 +75,8 @@ DrawPoints(SDL_Renderer * renderer) cycle_direction = -cycle_direction; } } - SDL_SetRenderDrawColor(renderer, 255, (Uint8) current_color, - (Uint8) current_color, (Uint8) current_alpha); + SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, + (Uint8)current_color, (Uint8)current_alpha); x = rand() % viewport.w; y = rand() % viewport.h; @@ -86,10 +90,12 @@ SDL_Rect lines[MAX_LINES]; static int add_line(int x1, int y1, int x2, int y2) { - if (num_lines >= MAX_LINES) + if (num_lines >= MAX_LINES) { return 0; - if ((x1 == x2) && (y1 == y2)) + } + if ((x1 == x2) && (y1 == y2)) { return 0; + } SDL_Log("adding line (%d, %d), (%d, %d)\n", x1, y1, x2, y2); lines[num_lines].x = x1; @@ -100,9 +106,7 @@ add_line(int x1, int y1, int x2, int y2) return ++num_lines; } - -void -DrawLines(SDL_Renderer * renderer) +void DrawLines(SDL_Renderer *renderer) { int i; SDL_Rect viewport; @@ -130,18 +134,22 @@ SDL_Rect rects[MAX_RECTS]; static int add_rect(int x1, int y1, int x2, int y2) { - if (num_rects >= MAX_RECTS) + if (num_rects >= MAX_RECTS) { return 0; - if ((x1 == x2) || (y1 == y2)) + } + if ((x1 == x2) || (y1 == y2)) { return 0; + } - if (x1 > x2) + if (x1 > x2) { SWAP(int, x1, x2); - if (y1 > y2) + } + if (y1 > y2) { SWAP(int, y1, y2); + } SDL_Log("adding rect (%d, %d), (%d, %d) [%dx%d]\n", x1, y1, x2, y2, - x2 - x1, y2 - y1); + x2 - x1, y2 - y1); rects[num_rects].x = x1; rects[num_rects].y = y1; @@ -152,20 +160,20 @@ add_rect(int x1, int y1, int x2, int y2) } static void -DrawRects(SDL_Renderer * renderer) +DrawRects(SDL_Renderer *renderer) { SDL_SetRenderDrawColor(renderer, 255, 127, 0, 255); SDL_RenderFillRects(renderer, rects, num_rects); } static void -DrawRectLineIntersections(SDL_Renderer * renderer) +DrawRectLineIntersections(SDL_Renderer *renderer) { int i, j; SDL_SetRenderDrawColor(renderer, 0, 255, 55, 255); - for (i = 0; i < num_rects; i++) + for (i = 0; i < num_rects; i++) { for (j = 0; j < num_lines; j++) { int x1, y1, x2, y2; SDL_Rect r; @@ -180,26 +188,27 @@ DrawRectLineIntersections(SDL_Renderer * renderer) SDL_RenderDrawLine(renderer, x1, y1, x2, y2); } } + } } static void -DrawRectRectIntersections(SDL_Renderer * renderer) +DrawRectRectIntersections(SDL_Renderer *renderer) { int i, j; SDL_SetRenderDrawColor(renderer, 255, 200, 0, 255); - for (i = 0; i < num_rects; i++) + for (i = 0; i < num_rects; i++) { for (j = i + 1; j < num_rects; j++) { SDL_Rect r; if (SDL_IntersectRect(&rects[i], &rects[j], &r)) { SDL_RenderFillRect(renderer, &r); } } + } } -void -loop() +void loop(void) { int i; SDL_Event event; @@ -213,28 +222,30 @@ loop() mouse_begin_y = event.button.y; break; case SDL_MOUSEBUTTONUP: - if (event.button.button == 3) - add_line(mouse_begin_x, mouse_begin_y, event.button.x, - event.button.y); - if (event.button.button == 1) - add_rect(mouse_begin_x, mouse_begin_y, event.button.x, - event.button.y); + if (event.button.button == 3) { + add_line(mouse_begin_x, mouse_begin_y, event.button.x, event.button.y); + } + if (event.button.button == 1) { + add_rect(mouse_begin_x, mouse_begin_y, event.button.x, event.button.y); + } break; case SDL_KEYDOWN: switch (event.key.keysym.sym) { case 'l': - if (event.key.keysym.mod & KMOD_SHIFT) + if (event.key.keysym.mod & KMOD_SHIFT) { num_lines = 0; - else + } else { add_line(rand() % 640, rand() % 480, rand() % 640, rand() % 480); + } break; case 'r': - if (event.key.keysym.mod & KMOD_SHIFT) + if (event.key.keysym.mod & KMOD_SHIFT) { num_rects = 0; - else + } else { add_rect(rand() % 640, rand() % 480, rand() % 640, rand() % 480); + } break; } break; @@ -244,8 +255,9 @@ loop() } for (i = 0; i < state->num_windows; ++i) { SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); @@ -264,8 +276,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; Uint32 then, now, frames; @@ -354,7 +365,7 @@ main(int argc, char *argv[]) /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } return 0; diff --git a/test/testjoystick.c b/test/testjoystick.c index f058979dd912f..f9d445d09d2bd 100644 --- a/test/testjoystick.c +++ b/test/testjoystick.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,8 +28,8 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 480 #else -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 +#define SCREEN_WIDTH 640 +#define SCREEN_HEIGHT 480 #endif static SDL_Window *window = NULL; @@ -44,7 +44,7 @@ PrintJoystick(SDL_Joystick *joy) char guid[64]; SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joy)) == joy); - SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, sizeof (guid)); + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, sizeof(guid)); switch (SDL_JoystickGetType(joy)) { case SDL_JOYSTICK_TYPE_GAMECONTROLLER: type = "Game Controller"; @@ -103,8 +103,7 @@ DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h) SDL_RenderFillRect(r, &area); } -void -loop(void *arg) +void loop(void *arg) { SDL_Event event; int i; @@ -117,7 +116,7 @@ loop(void *arg) switch (event.type) { case SDL_JOYDEVICEADDED: - SDL_Log("Joystick device %d added.\n", (int) event.jdevice.which); + SDL_Log("Joystick device %d added.\n", (int)event.jdevice.which); if (!joystick) { joystick = SDL_JoystickOpen(event.jdevice.which); if (joystick) { @@ -129,7 +128,7 @@ loop(void *arg) break; case SDL_JOYDEVICEREMOVED: - SDL_Log("Joystick device %d removed.\n", (int) event.jdevice.which); + SDL_Log("Joystick device %d removed.\n", (int)event.jdevice.which); if (event.jdevice.which == SDL_JoystickInstanceID(joystick)) { SDL_JoystickClose(joystick); joystick = SDL_JoystickOpen(0); @@ -144,16 +143,21 @@ loop(void *arg) case SDL_JOYHATMOTION: SDL_Log("Joystick %" SDL_PRIs32 " hat %d value:", event.jhat.which, event.jhat.hat); - if (event.jhat.value == SDL_HAT_CENTERED) + if (event.jhat.value == SDL_HAT_CENTERED) { SDL_Log(" centered"); - if (event.jhat.value & SDL_HAT_UP) + } + if (event.jhat.value & SDL_HAT_UP) { SDL_Log(" up"); - if (event.jhat.value & SDL_HAT_RIGHT) + } + if (event.jhat.value & SDL_HAT_RIGHT) { SDL_Log(" right"); - if (event.jhat.value & SDL_HAT_DOWN) + } + if (event.jhat.value & SDL_HAT_DOWN) { SDL_Log(" down"); - if (event.jhat.value & SDL_HAT_LEFT) + } + if (event.jhat.value & SDL_HAT_LEFT) { SDL_Log(" left"); + } SDL_Log("\n"); break; case SDL_JOYBALLMOTION: @@ -217,7 +221,7 @@ loop(void *arg) SDL_SetRenderDrawColor(screen, 0xFF, 0x00, 0x00, SDL_ALPHA_OPAQUE); for (i = 0; i < SDL_JoystickNumAxes(joystick); ++i) { /* Draw the X/Y axis */ - x = (((int) SDL_JoystickGetAxis(joystick, i)) + 32768); + x = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768); x *= SCREEN_WIDTH; x /= 65535; if (x < 0) { @@ -227,7 +231,7 @@ loop(void *arg) } ++i; if (i < SDL_JoystickNumAxes(joystick)) { - y = (((int) SDL_JoystickGetAxis(joystick, i)) + 32768); + y = (((int)SDL_JoystickGetAxis(joystick, i)) + 32768); } else { y = 32768; } @@ -246,19 +250,19 @@ loop(void *arg) for (i = 0; i < SDL_JoystickNumHats(joystick); ++i) { /* Derive the new position */ const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i); - x = SCREEN_WIDTH/2; - y = SCREEN_HEIGHT/2; + x = SCREEN_WIDTH / 2; + y = SCREEN_HEIGHT / 2; if (hat_pos & SDL_HAT_UP) { y = 0; } else if (hat_pos & SDL_HAT_DOWN) { - y = SCREEN_HEIGHT-8; + y = SCREEN_HEIGHT - 8; } if (hat_pos & SDL_HAT_LEFT) { x = 0; } else if (hat_pos & SDL_HAT_RIGHT) { - x = SCREEN_WIDTH-8; + x = SCREEN_WIDTH - 8; } DrawRect(screen, x, y, 8, 8); @@ -275,8 +279,7 @@ loop(void *arg) #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); @@ -293,13 +296,13 @@ main(int argc, char *argv[]) window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, SCREEN_HEIGHT, 0); - if (window == NULL) { + if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } screen = SDL_CreateRenderer(window, -1, 0); - if (screen == NULL) { + if (!screen) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return SDL_FALSE; diff --git a/test/testkeys.c b/test/testkeys.c index 7561eb041bb40..a3daf5cc119d7 100644 --- a/test/testkeys.c +++ b/test/testkeys.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,23 +18,39 @@ #include #include "SDL.h" +#include "SDL_test.h" -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { + SDLTest_CommonState *state; SDL_Scancode scancode; + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + if (SDL_Init(SDL_INIT_VIDEO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); exit(1); } for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { SDL_Log("Scancode #%d, \"%s\"\n", scancode, - SDL_GetScancodeName(scancode)); + SDL_GetScancodeName(scancode)); } - SDL_Quit(); - return (0); + SDLTest_CommonQuit(state); + return 0; } diff --git a/test/testloadso.c b/test/testloadso.c index 8303525581f63..a7d197051f3a7 100644 --- a/test/testloadso.c +++ b/test/testloadso.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,7 +11,7 @@ */ /* Test program to test dynamic loading with the loadso subsystem. -*/ + */ #include #include @@ -19,10 +19,9 @@ #include "SDL.h" -typedef int (*fntype) (const char *); +typedef int (*fntype)(const char *); -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int retval = 0; int hello = 0; @@ -54,25 +53,23 @@ main(int argc, char *argv[]) } lib = SDL_LoadObject(libname); - if (lib == NULL) { + if (!lib) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadObject('%s') failed: %s\n", - libname, SDL_GetError()); + libname, SDL_GetError()); retval = 3; } else { - fn = (fntype) SDL_LoadFunction(lib, symname); - if (fn == NULL) { + fn = (fntype)SDL_LoadFunction(lib, symname); + if (!fn) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_LoadFunction('%s') failed: %s\n", - symname, SDL_GetError()); + symname, SDL_GetError()); retval = 4; } else { SDL_Log("Found %s in %s at %p\n", symname, libname, fn); if (hello) { SDL_Log("Calling function...\n"); - fflush(stdout); fn(" HELLO, WORLD!\n"); SDL_Log("...apparently, we survived. :)\n"); SDL_Log("Unloading library...\n"); - fflush(stdout); } } SDL_UnloadObject(lib); diff --git a/test/testlocale.c b/test/testlocale.c index 3a4a6f0411fcc..863c1839704c9 100644 --- a/test/testlocale.c +++ b/test/testlocale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,13 +11,14 @@ */ #include #include "SDL.h" +#include "SDL_test.h" /* !!! FIXME: move this to the test framework */ static void log_locales(void) { SDL_Locale *locales = SDL_GetPreferredLocales(); - if (locales == NULL) { + if (!locales) { SDL_Log("Couldn't determine locales: %s", SDL_GetError()); } else { SDL_Locale *l; @@ -35,33 +36,65 @@ static void log_locales(void) int main(int argc, char **argv) { + SDLTest_CommonState *state; + SDL_bool listen = SDL_FALSE; + int i = 1; + + state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + /* Parse commandline */ + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (!consumed) { + if (SDL_strcmp("--listen", argv[i]) == 0) { + listen = SDL_TRUE; + consumed = 1; + } + } + if (consumed <= 0) { + static const char *options[] = { "[--listen]", NULL }; + SDLTest_CommonLogUsage(state, argv[0], options); + return 1; + } + + i += consumed; + } + + if (!SDLTest_CommonInit(state)) { + return 1; + } + /* Print locales and languages */ - if (SDL_Init(SDL_INIT_VIDEO) != -1) { - log_locales(); - - if ((argc == 2) && (SDL_strcmp(argv[1], "--listen") == 0)) { - SDL_bool keep_going = SDL_TRUE; - while (keep_going) { - SDL_Event e; - while (SDL_PollEvent(&e)) { - if (e.type == SDL_QUIT) { - keep_going = SDL_FALSE; - } else if (e.type == SDL_LOCALECHANGED) { - SDL_Log("Saw SDL_LOCALECHANGED event!"); - log_locales(); - } + log_locales(); + + if (listen) { + SDL_bool keep_going = SDL_TRUE; + while (keep_going) { + SDL_Event e; + while (SDL_PollEvent(&e)) { + if (e.type == SDL_QUIT) { + keep_going = SDL_FALSE; + } else if (e.type == SDL_LOCALECHANGED) { + SDL_Log("Saw SDL_LOCALECHANGED event!"); + log_locales(); } - SDL_Delay(10); } + SDL_Delay(10); } - - SDL_Quit(); } - return 0; + SDLTest_CommonQuit(state); + + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testlock.c b/test/testlock.c index 121059608810e..1a3c2e9f6bd2a 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -27,7 +27,7 @@ static SDL_atomic_t doterminate; /* * SDL_Quit() shouldn't be used with atexit() directly because - * calling conventions may differ... + * calling conventions may differ... */ static void SDL_Quit_Wrapper(void) @@ -35,28 +35,26 @@ SDL_Quit_Wrapper(void) SDL_Quit(); } -void -printid(void) +void printid(void) { SDL_Log("Process %lu: exiting\n", SDL_ThreadID()); } -void -terminate(int sig) +void terminate(int sig) { - signal(SIGINT, terminate); + (void)signal(SIGINT, terminate); SDL_AtomicSet(&doterminate, 1); } -void -closemutex(int sig) +void closemutex(int sig) { SDL_threadID id = SDL_ThreadID(); int i; SDL_Log("Process %lu: Cleaning up...\n", id == mainthread ? 0 : id); SDL_AtomicSet(&doterminate, 1); - for (i = 0; i < 6; ++i) + for (i = 0; i < 6; ++i) { SDL_WaitThread(threads[i], NULL); + } SDL_DestroyMutex(mutex); exit(sig); } @@ -64,8 +62,9 @@ closemutex(int sig) int SDLCALL Run(void *data) { - if (SDL_ThreadID() == mainthread) - signal(SIGTERM, closemutex); + if (SDL_ThreadID() == mainthread) { + (void)signal(SIGTERM, closemutex); + } while (!SDL_AtomicGet(&doterminate)) { SDL_Log("Process %lu ready to work\n", SDL_ThreadID()); if (SDL_LockMutex(mutex) < 0) { @@ -84,13 +83,12 @@ Run(void *data) } if (SDL_ThreadID() == mainthread && SDL_AtomicGet(&doterminate)) { SDL_Log("Process %lu: raising SIGTERM\n", SDL_ThreadID()); - raise(SIGTERM); + (void)raise(SIGTERM); } - return (0); + return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; int maxproc = 6; @@ -103,26 +101,29 @@ main(int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s\n", SDL_GetError()); exit(1); } - atexit(SDL_Quit_Wrapper); + (void)atexit(SDL_Quit_Wrapper); SDL_AtomicSet(&doterminate, 0); - if ((mutex = SDL_CreateMutex()) == NULL) { + mutex = SDL_CreateMutex(); + if (!mutex) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create mutex: %s\n", SDL_GetError()); exit(1); } mainthread = SDL_ThreadID(); SDL_Log("Main thread: %lu\n", mainthread); - atexit(printid); + (void)atexit(printid); for (i = 0; i < maxproc; ++i) { char name[64]; - SDL_snprintf(name, sizeof (name), "Worker%d", i); - if ((threads[i] = SDL_CreateThread(Run, name, NULL)) == NULL) + (void)SDL_snprintf(name, sizeof(name), "Worker%d", i); + threads[i] = SDL_CreateThread(Run, name, NULL); + if (threads[i] == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread!\n"); + } } - signal(SIGINT, terminate); + (void)signal(SIGINT, terminate); Run(NULL); - return (0); /* Never reached */ + return 0; /* Never reached */ } diff --git a/test/testmessage.c b/test/testmessage.c index c30c18df46e10..2bf9009299330 100644 --- a/test/testmessage.c +++ b/test/testmessage.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,15 +29,12 @@ static int SDLCALL button_messagebox(void *eventNumber) { const SDL_MessageBoxButtonData buttons[] = { - { - SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, - 0, - "OK" - },{ - SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, - 1, - "Cancel" - }, + { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, + 0, + "OK" }, + { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, + 1, + "Cancel" }, }; SDL_MessageBoxData data = { @@ -46,8 +43,8 @@ button_messagebox(void *eventNumber) "Custom MessageBox", "This is a custom messagebox", 2, - NULL,/* buttons */ - NULL /* Default color scheme */ + NULL, /* buttons */ + NULL /* Default color scheme */ }; int button = -1; @@ -69,7 +66,8 @@ button_messagebox(void *eventNumber) quit(2); } } - SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK"); + SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" + : "OK"); if (eventNumber) { SDL_Event event; @@ -80,8 +78,7 @@ button_messagebox(void *eventNumber) return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int success; @@ -89,36 +86,36 @@ main(int argc, char *argv[]) SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "Simple MessageBox", - "This is a simple error MessageBox", - NULL); + "Simple MessageBox", + "This is a simple error MessageBox", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); } success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "Simple MessageBox", - "This is a simple MessageBox with a newline:\r\nHello world!", - NULL); + "Simple MessageBox", + "This is a simple MessageBox with a newline:\r\nHello world!", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); } success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - NULL, - "NULL Title", - NULL); + NULL, + "NULL Title", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); } success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "NULL Message", - NULL, - NULL); + "NULL Message", + NULL, + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); @@ -126,9 +123,9 @@ main(int argc, char *argv[]) /* Google says this is Traditional Chinese for "beef with broccoli" */ success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "UTF-8 Simple MessageBox", - "Unicode text: '牛肉西蘭花' ...", - NULL); + "UTF-8 Simple MessageBox", + "Unicode text: '牛肉西蘭花' ...", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); @@ -136,9 +133,9 @@ main(int argc, char *argv[]) /* Google says this is Traditional Chinese for "beef with broccoli" */ success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "UTF-8 Simple MessageBox", - "Unicode text and newline:\r\n'牛肉西蘭花'\n'牛肉西蘭花'", - NULL); + "UTF-8 Simple MessageBox", + "Unicode text and newline:\r\n'牛肉西蘭花'\n'牛肉西蘭花'", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); @@ -146,9 +143,9 @@ main(int argc, char *argv[]) /* Google says this is Traditional Chinese for "beef with broccoli" */ success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "牛肉西蘭花", - "Unicode text in the title.", - NULL); + "牛肉西蘭花", + "Unicode text in the title.", + NULL); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); @@ -164,16 +161,15 @@ main(int argc, char *argv[]) */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError()); - return (1); + return 1; } { int status = 0; SDL_Event event; intptr_t eventNumber = SDL_RegisterEvents(1); - SDL_Thread* thread = SDL_CreateThread(&button_messagebox, "MessageBox", (void*)eventNumber); + SDL_Thread *thread = SDL_CreateThread(&button_messagebox, "MessageBox", (void *)eventNumber); - while (SDL_WaitEvent(&event)) - { + while (SDL_WaitEvent(&event)) { if (event.type == eventNumber) { break; } @@ -196,16 +192,15 @@ main(int argc, char *argv[]) SDL_RenderPresent(renderer); success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "Simple MessageBox", - "This is a simple error MessageBox with a parent window. Press a key or close the window after dismissing this messagebox.", - window); + "Simple MessageBox", + "This is a simple error MessageBox with a parent window. Press a key or close the window after dismissing this messagebox.", + window); if (success == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError()); quit(1); } - while (SDL_WaitEvent(&event)) - { + while (SDL_WaitEvent(&event)) { if (event.type == SDL_QUIT || event.type == SDL_KEYUP) { break; } @@ -213,5 +208,5 @@ main(int argc, char *argv[]) } SDL_Quit(); - return (0); + return 0; } diff --git a/test/testmouse.c b/test/testmouse.c index b8fc440b97b0a..a7096b65d7269 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,17 +18,31 @@ #include /* exit() */ -#ifdef __IPHONEOS__ +#ifdef __3DS__ +/* For mouse-based tests, we want to have the window on the touch screen */ +#define SCREEN_X 40 +#define SCREEN_Y 240 +#define SCREEN_WIDTH 320 +#define SCREEN_HEIGHT 240 +#elif defined(__IPHONEOS__) #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 480 #else -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 +#define SCREEN_WIDTH 640 +#define SCREEN_HEIGHT 480 +#endif + +#ifndef SCREEN_X +#define SCREEN_X SDL_WINDOWPOS_CENTERED +#endif +#ifndef SCREEN_Y +#define SCREEN_Y SDL_WINDOWPOS_CENTERED #endif static SDL_Window *window; -typedef struct _Object { +typedef struct _Object +{ struct _Object *next; int x1, y1, x2, y2; @@ -49,8 +63,7 @@ static float wheel_y = SCREEN_HEIGHT * 0.5f; static SDL_bool done = SDL_FALSE; -void -DrawObject(SDL_Renderer * renderer, Object * object) +void DrawObject(SDL_Renderer *renderer, Object *object) { SDL_SetRenderDrawColor(renderer, object->r, object->g, object->b, 255); @@ -80,22 +93,20 @@ DrawObject(SDL_Renderer * renderer, Object * object) } } -void -DrawObjects(SDL_Renderer * renderer) +void DrawObjects(SDL_Renderer *renderer) { Object *next = objects; - while (next != NULL) { + while (next) { DrawObject(renderer, next); next = next->next; } } -void -AppendObject(Object *object) +void AppendObject(Object *object) { if (objects) { Object *next = objects; - while (next->next != NULL) { + while (next->next) { next = next->next; } next->next = object; @@ -104,8 +115,7 @@ AppendObject(Object *object) } } -void -loop(void *arg) +void loop(void *arg) { SDL_Renderer *renderer = (SDL_Renderer *)arg; SDL_Event event; @@ -114,27 +124,28 @@ loop(void *arg) while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_MOUSEWHEEL: - if (event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) { - event.wheel.preciseX *= -1.0f; - event.wheel.preciseY *= -1.0f; - event.wheel.x *= -1; - event.wheel.y *= -1; - } - if (event.wheel.preciseX != 0.0f) { - wheel_x_active = SDL_TRUE; - /* "positive to the right and negative to the left" */ - wheel_x += event.wheel.preciseX * 10.0f; - } - if (event.wheel.preciseY != 0.0f) { - wheel_y_active = SDL_TRUE; - /* "positive away from the user and negative towards the user" */ - wheel_y -= event.wheel.preciseY * 10.0f; - } - break; + if (event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) { + event.wheel.preciseX *= -1.0f; + event.wheel.preciseY *= -1.0f; + event.wheel.x *= -1; + event.wheel.y *= -1; + } + if (event.wheel.preciseX != 0.0f) { + wheel_x_active = SDL_TRUE; + /* "positive to the right and negative to the left" */ + wheel_x += event.wheel.preciseX * 10.0f; + } + if (event.wheel.preciseY != 0.0f) { + wheel_y_active = SDL_TRUE; + /* "positive away from the user and negative towards the user" */ + wheel_y -= event.wheel.preciseY * 10.0f; + } + break; case SDL_MOUSEMOTION: - if (!active) + if (!active) { break; + } active->x2 = event.motion.x; active->y2 = event.motion.y; @@ -149,24 +160,52 @@ loop(void *arg) } switch (event.button.button) { - case SDL_BUTTON_LEFT: active->r = 255; buttons |= SDL_BUTTON_LMASK; break; - case SDL_BUTTON_MIDDLE: active->g = 255; buttons |= SDL_BUTTON_MMASK; break; - case SDL_BUTTON_RIGHT: active->b = 255; buttons |= SDL_BUTTON_RMASK; break; - case SDL_BUTTON_X1: active->r = 255; active->b = 255; buttons |= SDL_BUTTON_X1MASK; break; - case SDL_BUTTON_X2: active->g = 255; active->b = 255; buttons |= SDL_BUTTON_X2MASK; break; + case SDL_BUTTON_LEFT: + active->r = 255; + buttons |= SDL_BUTTON_LMASK; + break; + case SDL_BUTTON_MIDDLE: + active->g = 255; + buttons |= SDL_BUTTON_MMASK; + break; + case SDL_BUTTON_RIGHT: + active->b = 255; + buttons |= SDL_BUTTON_RMASK; + break; + case SDL_BUTTON_X1: + active->r = 255; + active->b = 255; + buttons |= SDL_BUTTON_X1MASK; + break; + case SDL_BUTTON_X2: + active->g = 255; + active->b = 255; + buttons |= SDL_BUTTON_X2MASK; + break; } break; case SDL_MOUSEBUTTONUP: - if (!active) + if (!active) { break; + } switch (event.button.button) { - case SDL_BUTTON_LEFT: buttons &= ~SDL_BUTTON_LMASK; break; - case SDL_BUTTON_MIDDLE: buttons &= ~SDL_BUTTON_MMASK; break; - case SDL_BUTTON_RIGHT: buttons &= ~SDL_BUTTON_RMASK; break; - case SDL_BUTTON_X1: buttons &= ~SDL_BUTTON_X1MASK; break; - case SDL_BUTTON_X2: buttons &= ~SDL_BUTTON_X2MASK; break; + case SDL_BUTTON_LEFT: + buttons &= ~SDL_BUTTON_LMASK; + break; + case SDL_BUTTON_MIDDLE: + buttons &= ~SDL_BUTTON_MMASK; + break; + case SDL_BUTTON_RIGHT: + buttons &= ~SDL_BUTTON_RMASK; + break; + case SDL_BUTTON_X1: + buttons &= ~SDL_BUTTON_X1MASK; + break; + case SDL_BUTTON_X2: + buttons &= ~SDL_BUTTON_X2MASK; + break; } if (buttons == 0) { @@ -210,8 +249,9 @@ loop(void *arg) /* Objects from mouse clicks */ DrawObjects(renderer); - if (active) + if (active) { DrawObject(renderer, active); + } SDL_RenderPresent(renderer); @@ -222,8 +262,7 @@ loop(void *arg) #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Renderer *renderer; @@ -237,16 +276,14 @@ main(int argc, char *argv[]) } /* Create a window to display joystick axis position */ - window = SDL_CreateWindow("Mouse Test", SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH, - SCREEN_HEIGHT, 0); - if (window == NULL) { + window = SDL_CreateWindow("Mouse Test", SCREEN_X, SCREEN_Y, SCREEN_WIDTH, SCREEN_HEIGHT, 0); + if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } renderer = SDL_CreateRenderer(window, -1, 0); - if (renderer == NULL) { + if (!renderer) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create renderer: %s\n", SDL_GetError()); SDL_DestroyWindow(window); return SDL_FALSE; diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c index 1154b83afd403..1b09d9534bb9e 100644 --- a/test/testmultiaudio.c +++ b/test/testmultiaudio.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -20,8 +20,8 @@ #include "testutils.h" static SDL_AudioSpec spec; -static Uint8 *sound = NULL; /* Pointer to wave data */ -static Uint32 soundlen = 0; /* Length of wave data */ +static Uint8 *sound = NULL; /* Pointer to wave data */ +static Uint32 soundlen = 0; /* Length of wave data */ typedef struct { @@ -33,14 +33,15 @@ typedef struct callback_data cbd[64]; void SDLCALL -play_through_once(void *arg, Uint8 * stream, int len) +play_through_once(void *arg, Uint8 *stream, int len) { - callback_data *cbdata = (callback_data *) arg; + callback_data *cbdata = (callback_data *)arg; Uint8 *waveptr = sound + cbdata->soundpos; int waveleft = soundlen - cbdata->soundpos; int cpy = len; - if (cpy > waveleft) + if (cpy > waveleft) { cpy = waveleft; + } SDL_memcpy(stream, waveptr, cpy); len -= cpy; @@ -52,8 +53,7 @@ play_through_once(void *arg, Uint8 * stream, int len) } } -void -loop() +void loop(void) { if (SDL_AtomicGet(&cbd[0].done)) { #ifdef __EMSCRIPTEN__ @@ -71,17 +71,17 @@ test_multi_audio(int devcount) { int keep_going = 1; int i; - -#ifdef __ANDROID__ + +#ifdef __ANDROID__ SDL_Event event; - + /* Create a Window to get fully initialized event processing for testing pause on Android. */ SDL_CreateWindow("testmultiaudio", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 320, 240, 0); #endif if (devcount > 64) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Too many devices (%d), clamping to 64...\n", - devcount); + devcount); devcount = 64; } @@ -90,7 +90,6 @@ test_multi_audio(int devcount) for (i = 0; i < devcount; i++) { const char *devname = SDL_GetAudioDeviceName(i, 0); SDL_Log("playing on device #%d: ('%s')...", i, devname); - fflush(stdout); SDL_memset(&cbd[0], '\0', sizeof(callback_data)); spec.userdata = &cbd[0]; @@ -103,10 +102,11 @@ test_multi_audio(int devcount) emscripten_set_main_loop(loop, 0, 1); #else while (!SDL_AtomicGet(&cbd[0].done)) { - #ifdef __ANDROID__ +#ifdef __ANDROID__ /* Empty queue, some application events would prevent pause. */ - while (SDL_PollEvent(&event)){} - #endif + while (SDL_PollEvent(&event)) { + } +#endif SDL_Delay(100); } SDL_PauseAudioDevice(cbd[0].dev, 1); @@ -141,10 +141,11 @@ test_multi_audio(int devcount) keep_going = 1; } } - #ifdef __ANDROID__ +#ifdef __ANDROID__ /* Empty queue, some application events would prevent pause. */ - while (SDL_PollEvent(&event)){} - #endif + while (SDL_PollEvent(&event)) { + } +#endif SDL_Delay(100); } @@ -161,9 +162,7 @@ test_multi_audio(int devcount) #endif } - -int -main(int argc, char **argv) +int main(int argc, char **argv) { int devcount = 0; @@ -173,11 +172,11 @@ main(int argc, char **argv) /* Load the SDL library */ if (SDL_Init(SDL_INIT_AUDIO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); - + devcount = SDL_GetNumAudioDevices(0); if (devcount < 1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Don't see any specific audio devices!\n"); @@ -187,7 +186,7 @@ main(int argc, char **argv) /* Load the wave file into memory */ if (SDL_LoadWAV(file, &spec, &sound, &soundlen) == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", file, - SDL_GetError()); + SDL_GetError()); } else { test_multi_audio(devcount); SDL_FreeWAV(sound); diff --git a/test/testnative.c b/test/testnative.c index e115089d5d4f0..64abd4a07b8f3 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,7 +13,7 @@ #include #include /* for srand() */ -#include /* for time() */ +#include /* for time() */ #include "testnative.h" #include "testutils.h" @@ -47,14 +47,13 @@ static void quit(int rc) { SDL_VideoQuit(); - if (native_window) { + if (native_window && factory) { factory->DestroyNativeWindow(native_window); } exit(rc); } -void -MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) +void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) { int sprite_w, sprite_h; int i; @@ -92,8 +91,7 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i, done; const char *driver; @@ -109,7 +107,7 @@ main(int argc, char *argv[]) if (SDL_VideoInit(NULL) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video: %s\n", - SDL_GetError()); + SDL_GetError()); exit(1); } driver = SDL_GetCurrentVideoDriver(); @@ -123,7 +121,7 @@ main(int argc, char *argv[]) } if (!factory) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find native window code for %s driver\n", - driver); + driver); quit(2); } SDL_Log("Creating native window for %s driver\n", driver); @@ -158,8 +156,8 @@ main(int argc, char *argv[]) /* Allocate memory for the sprite info */ SDL_GetWindowSize(window, &window_w, &window_h); SDL_QueryTexture(sprite, NULL, NULL, &sprite_w, &sprite_h); - positions = (SDL_Rect *) SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); - velocities = (SDL_Rect *) SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); + positions = (SDL_Rect *)SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); + velocities = (SDL_Rect *)SDL_malloc(NUM_SPRITES * sizeof(SDL_Rect)); if (!positions || !velocities) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); diff --git a/test/testnative.h b/test/testnative.h index 694f46ec8d4c4..516c8359280b4 100644 --- a/test/testnative.h +++ b/test/testnative.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,8 +22,8 @@ typedef struct { const char *tag; - void *(*CreateNativeWindow) (int w, int h); - void (*DestroyNativeWindow) (void *window); + void *(*CreateNativeWindow)(int w, int h); + void (*DestroyNativeWindow)(void *window); } NativeWindowFactory; #ifdef SDL_VIDEO_DRIVER_WINDOWS diff --git a/test/testnativecocoa.m b/test/testnativecocoa.m index 030607d66541c..e8950723fea57 100644 --- a/test/testnativecocoa.m +++ b/test/testnativecocoa.m @@ -3,8 +3,15 @@ #ifdef TEST_NATIVE_COCOA +#include #include +#ifndef MAC_OS_X_VERSION_10_12 +static const unsigned int NSWindowStyleMaskTitled = NSTitledWindowMask; +static const unsigned int NSWindowStyleMaskMiniaturizable = NSMiniaturizableWindowMask; +static const unsigned int NSWindowStyleMaskClosable = NSClosableWindowMask; +#endif + static void *CreateWindowCocoa(int w, int h); static void DestroyWindowCocoa(void *window); @@ -29,7 +36,7 @@ rect.size.height = h; rect.origin.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - rect.origin.y - rect.size.height; - style = (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask); + style = (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable); nswindow = [[NSWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:FALSE]; [nswindow makeKeyAndOrderFront:nil]; diff --git a/test/testnativeos2.c b/test/testnativeos2.c index 6998fa614d960..cf3629108da7a 100644 --- a/test/testnativeos2.c +++ b/test/testnativeos2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testnativew32.c b/test/testnativew32.c index a9bf2c779bc6d..83ffd9a67d011 100644 --- a/test/testnativew32.c +++ b/test/testnativew32.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -52,7 +52,7 @@ CreateWindowNative(int w, int h) wc.hInstance = GetModuleHandle(NULL); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1); + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wc.lpszMenuName = NULL; wc.lpszClassName = "SDL Test"; @@ -66,7 +66,7 @@ CreateWindowNative(int w, int h) CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL), NULL); - if (hwnd == NULL) { + if (!hwnd) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; @@ -80,7 +80,7 @@ CreateWindowNative(int w, int h) static void DestroyWindowNative(void *window) { - DestroyWindow((HWND) window); + DestroyWindow((HWND)window); } #endif diff --git a/test/testnativex11.c b/test/testnativex11.c index f6bd0c0e43d4a..086ce63c1319c 100644 --- a/test/testnativex11.c +++ b/test/testnativex11.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -38,14 +38,14 @@ CreateWindowX11(int w, int h) XMapRaised(dpy, window); XSync(dpy, False); } - return (void *) window; + return (void *)window; } static void DestroyWindowX11(void *window) { if (dpy) { - XDestroyWindow(dpy, (Window) window); + XDestroyWindow(dpy, (Window)window); XCloseDisplay(dpy); } } diff --git a/test/testoffscreen.c b/test/testoffscreen.c index e2a8f4b68bced..059a26771a325 100644 --- a/test/testoffscreen.c +++ b/test/testoffscreen.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -32,8 +32,7 @@ static int width = 640; static int height = 480; static unsigned int max_frames = 200; -void -draw() +void draw(void) { SDL_Rect Rect; @@ -51,10 +50,9 @@ draw() SDL_RenderPresent(renderer); } -void -save_surface_to_bmp() +void save_surface_to_bmp(void) { - SDL_Surface* surface; + SDL_Surface *surface; Uint32 r_mask, g_mask, b_mask, a_mask; Uint32 pixel_format; char file[128]; @@ -73,15 +71,14 @@ save_surface_to_bmp() SDL_FreeSurface(surface); } -void -loop() +void loop(void) { SDL_Event event; /* Check for events */ while (SDL_PollEvent(&event)) { switch (event.type) { - case SDL_QUIT: + case SDL_QUIT: done = SDL_TRUE; break; } @@ -97,8 +94,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { #ifndef __EMSCRIPTEN__ Uint32 then, now, frames; @@ -110,18 +106,17 @@ main(int argc, char *argv[]) /* Force the offscreen renderer, if it cannot be created then fail out */ if (SDL_VideoInit("offscreen") < 0) { SDL_Log("Couldn't initialize the offscreen video driver: %s\n", - SDL_GetError()); + SDL_GetError()); return SDL_FALSE; } - /* If OPENGL fails to init it will fallback to using a framebuffer for rendering */ + /* If OPENGL fails to init it will fallback to using a framebuffer for rendering */ window = SDL_CreateWindow("Offscreen Test", - SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - width, height, 0); + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + width, height, 0); if (!window) { - SDL_Log("Couldn't create window: %s\n", - SDL_GetError()); + SDL_Log("Couldn't create window: %s\n", SDL_GetError()); return SDL_FALSE; } @@ -129,7 +124,7 @@ main(int argc, char *argv[]) if (!renderer) { SDL_Log("Couldn't create renderer: %s\n", - SDL_GetError()); + SDL_GetError()); return SDL_FALSE; } @@ -157,7 +152,7 @@ main(int argc, char *argv[]) if (frames % (max_frames / 10) == 0) { now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("Frames remaining: %" SDL_PRIu32 " rendering at %2.2f frames per second\n", max_frames - frames, fps); } } diff --git a/test/testoverlay2.c b/test/testoverlay2.c index ab0fd82db2e76..d8d2e50c6a2d2 100644 --- a/test/testoverlay2.c +++ b/test/testoverlay2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -30,9 +30,10 @@ #define MOOSEPIC_W 64 #define MOOSEPIC_H 88 -#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) +#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) #define MOOSEFRAMES_COUNT 10 +/* *INDENT-OFF* */ /* clang-format off */ SDL_Color MooseColors[84] = { {49, 49, 49, SDL_ALPHA_OPAQUE} , {66, 24, 0, SDL_ALPHA_OPAQUE} @@ -139,8 +140,9 @@ SDL_Color MooseColors[84] = { , {231, 231, 231, SDL_ALPHA_OPAQUE} , {239, 206, 173, SDL_ALPHA_OPAQUE} }; +/* *INDENT-ON* */ /* clang-format on */ -Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE*2]; +Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE * 2]; SDL_Texture *MooseTexture; SDL_Rect displayrect; int window_w; @@ -176,8 +178,7 @@ PrintUsage(char *argv0) SDL_Log("\n"); } -void -loop() +void loop(void) { SDL_Event event; @@ -208,6 +209,7 @@ loop() if (event.key.keysym.sym != SDLK_ESCAPE) { break; } + SDL_FALLTHROUGH; case SDL_QUIT: done = SDL_TRUE; break; @@ -234,8 +236,7 @@ loop() #endif } -int -main(int argc, char **argv) +int main(int argc, char **argv) { Uint8 *RawMooseData; SDL_RWops *handle; @@ -260,19 +261,19 @@ main(int argc, char **argv) fps = SDL_atoi(argv[2]); if (fps == 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); quit(10); } if ((fps < 0) || (fps > 1000)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -fps option must be in range from 1 to 1000, default is 12.\n"); + "The -fps option must be in range from 1 to 1000, default is 12.\n"); quit(10); } argv += 2; argc -= 2; } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); quit(10); } } else if (SDL_strcmp(argv[1], "-nodelay") == 0) { @@ -284,23 +285,22 @@ main(int argc, char **argv) scale = SDL_atoi(argv[2]); if (scale == 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -scale option requires an argument [from 1 to 50], default is 5.\n"); + "The -scale option requires an argument [from 1 to 50], default is 5.\n"); quit(10); } if ((scale < 0) || (scale > 50)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -scale option must be in range from 1 to 50, default is 5.\n"); + "The -scale option must be in range from 1 to 50, default is 5.\n"); quit(10); } argv += 2; argc -= 2; } else { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, - "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); + "The -fps option requires an argument [from 1 to 1000], default is 12.\n"); quit(10); } - } else if ((SDL_strcmp(argv[1], "-help") == 0) - || (SDL_strcmp(argv[1], "-h") == 0)) { + } else if ((SDL_strcmp(argv[1], "-help") == 0) || (SDL_strcmp(argv[1], "-h") == 0)) { PrintUsage(argv[0]); quit(0); } else { @@ -310,21 +310,22 @@ main(int argc, char **argv) break; } - RawMooseData = (Uint8 *) SDL_malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT); - if (RawMooseData == NULL) { + RawMooseData = (Uint8 *)SDL_malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT); + if (!RawMooseData) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't allocate memory for movie !\n"); quit(1); } /* load the trojan moose images */ filename = GetResourceFilename(NULL, "moose.dat"); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); + SDL_free(RawMooseData); return -1; } handle = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (handle == NULL) { + if (!handle) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); SDL_free(RawMooseData); quit(2); @@ -365,7 +366,7 @@ main(int argc, char **argv) /* SDL_SetTextureColorMod(MooseTexture, 0xff, 0x80, 0x80); */ for (i = 0; i < MOOSEFRAMES_COUNT; i++) { - Uint8 MooseFrameRGB[MOOSEFRAME_SIZE*3]; + Uint8 MooseFrameRGB[MOOSEFRAME_SIZE * 3]; Uint8 *rgb; Uint8 *frame; @@ -377,9 +378,9 @@ main(int argc, char **argv) rgb[2] = MooseColors[frame[j]].b; rgb += 3; } - ConvertRGBtoYUV(SDL_PIXELFORMAT_YV12, MooseFrameRGB, MOOSEPIC_W*3, MooseFrame[i], MOOSEPIC_W, MOOSEPIC_H, - SDL_GetYUVConversionModeForResolution(MOOSEPIC_W, MOOSEPIC_H), - 0, 100); + ConvertRGBtoYUV(SDL_PIXELFORMAT_YV12, MooseFrameRGB, MOOSEPIC_W * 3, MooseFrame[i], MOOSEPIC_W, MOOSEPIC_H, + SDL_GetYUVConversionModeForResolution(MOOSEPIC_W, MOOSEPIC_H), + 0, 100); } SDL_free(RawMooseData); @@ -406,7 +407,7 @@ main(int argc, char **argv) #else while (!done) { loop(); - } + } #endif SDL_DestroyRenderer(renderer); diff --git a/test/testplatform.c b/test/testplatform.c index 5eec9f9d10c08..656d0e57a2a86 100644 --- a/test/testplatform.c +++ b/test/testplatform.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,6 +13,7 @@ #include #include "SDL.h" +#include "SDL_test.h" /* * Watcom C flags these as Warning 201: "Unreachable code" if you just @@ -45,43 +46,42 @@ SDL_COMPILE_TIME_ASSERT(SDL_MIN_SINT64, SDL_MIN_SINT64 == ~0x7fffffffffffffffll) SDL_COMPILE_TIME_ASSERT(SDL_MAX_UINT64, SDL_MAX_UINT64 == 18446744073709551615ull); SDL_COMPILE_TIME_ASSERT(SDL_MIN_UINT64, SDL_MIN_UINT64 == 0); -int -TestTypes(SDL_bool verbose) +int TestTypes(SDL_bool verbose) { int error = 0; if (badsize(sizeof(Uint8), 1)) { - if (verbose) - SDL_Log("sizeof(Uint8) != 1, instead = %u\n", - (unsigned int)sizeof(Uint8)); + if (verbose) { + SDL_Log("sizeof(Uint8) != 1, instead = %u\n", (unsigned int)sizeof(Uint8)); + } ++error; } if (badsize(sizeof(Uint16), 2)) { - if (verbose) - SDL_Log("sizeof(Uint16) != 2, instead = %u\n", - (unsigned int)sizeof(Uint16)); + if (verbose) { + SDL_Log("sizeof(Uint16) != 2, instead = %u\n", (unsigned int)sizeof(Uint16)); + } ++error; } if (badsize(sizeof(Uint32), 4)) { - if (verbose) - SDL_Log("sizeof(Uint32) != 4, instead = %u\n", - (unsigned int)sizeof(Uint32)); + if (verbose) { + SDL_Log("sizeof(Uint32) != 4, instead = %u\n", (unsigned int)sizeof(Uint32)); + } ++error; } if (badsize(sizeof(Uint64), 8)) { - if (verbose) - SDL_Log("sizeof(Uint64) != 8, instead = %u\n", - (unsigned int)sizeof(Uint64)); + if (verbose) { + SDL_Log("sizeof(Uint64) != 8, instead = %u\n", (unsigned int)sizeof(Uint64)); + } ++error; } - if (verbose && !error) + if (verbose && !error) { SDL_Log("All data types are the expected size.\n"); + } - return (error ? 1 : 0); + return error ? 1 : 0; } -int -TestEndian(SDL_bool verbose) +int TestEndian(SDL_bool verbose) { int error = 0; Uint16 value = 0x1234; @@ -93,9 +93,10 @@ TestEndian(SDL_bool verbose) Uint32 swapped32 = 0xDEADBEEF; Uint64 value64, swapped64; - union { - double d; - Uint32 ui32[2]; + union + { + double d; + Uint32 ui32[2]; } value_double; value64 = 0xEFBEADDE; @@ -108,9 +109,9 @@ TestEndian(SDL_bool verbose) if (verbose) { SDL_Log("Detected a %s endian machine.\n", - (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big"); + (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big"); } - if ((*((char *) &value) >> 4) == 0x1) { + if ((*((char *)&value) >> 4) == 0x1) { real_byteorder = SDL_BIG_ENDIAN; } else { real_byteorder = SDL_LIL_ENDIAN; @@ -118,13 +119,13 @@ TestEndian(SDL_bool verbose) if (real_byteorder != SDL_BYTEORDER) { if (verbose) { SDL_Log("Actually a %s endian machine!\n", - (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big"); + (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big"); } ++error; } if (verbose) { SDL_Log("Detected a %s endian float word order machine.\n", - (SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big"); + (SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big"); } if (value_double.ui32[0] == 0x82c2bd7f && value_double.ui32[1] == 0x400921fb) { real_floatwordorder = SDL_LIL_ENDIAN; @@ -134,13 +135,14 @@ TestEndian(SDL_bool verbose) if (real_floatwordorder != SDL_FLOATWORDORDER) { if (verbose) { SDL_Log("Actually a %s endian float word order machine!\n", - (real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big" : "unknown" ); + (real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big" + : "unknown"); } ++error; } if (verbose) { SDL_Log("Value 16 = 0x%X, swapped = 0x%X\n", value16, - SDL_Swap16(value16)); + SDL_Swap16(value16)); } if (SDL_Swap16(value16) != swapped16) { if (verbose) { @@ -160,8 +162,8 @@ TestEndian(SDL_bool verbose) ++error; } if (verbose) { - SDL_Log("Value 64 = 0x%"SDL_PRIX64", swapped = 0x%"SDL_PRIX64"\n", value64, - SDL_Swap64(value64)); + SDL_Log("Value 64 = 0x%" SDL_PRIX64 ", swapped = 0x%" SDL_PRIX64 "\n", value64, + SDL_Swap64(value64)); } if (SDL_Swap64(value64) != swapped64) { if (verbose) { @@ -169,67 +171,67 @@ TestEndian(SDL_bool verbose) } ++error; } - return (error ? 1 : 0); + return error ? 1 : 0; } -static int TST_allmul (void *a, void *b, int arg, void *result, void *expected) +static int TST_allmul(void *a, void *b, int arg, void *result, void *expected) { (*(long long *)result) = ((*(long long *)a) * (*(long long *)b)); return (*(long long *)result) == (*(long long *)expected); } -static int TST_alldiv (void *a, void *b, int arg, void *result, void *expected) +static int TST_alldiv(void *a, void *b, int arg, void *result, void *expected) { (*(long long *)result) = ((*(long long *)a) / (*(long long *)b)); return (*(long long *)result) == (*(long long *)expected); } -static int TST_allrem (void *a, void *b, int arg, void *result, void *expected) +static int TST_allrem(void *a, void *b, int arg, void *result, void *expected) { (*(long long *)result) = ((*(long long *)a) % (*(long long *)b)); return (*(long long *)result) == (*(long long *)expected); } -static int TST_ualldiv (void *a, void *b, int arg, void *result, void *expected) +static int TST_ualldiv(void *a, void *b, int arg, void *result, void *expected) { (*(unsigned long long *)result) = ((*(unsigned long long *)a) / (*(unsigned long long *)b)); return (*(unsigned long long *)result) == (*(unsigned long long *)expected); } -static int TST_uallrem (void *a, void *b, int arg, void *result, void *expected) +static int TST_uallrem(void *a, void *b, int arg, void *result, void *expected) { (*(unsigned long long *)result) = ((*(unsigned long long *)a) % (*(unsigned long long *)b)); return (*(unsigned long long *)result) == (*(unsigned long long *)expected); } -static int TST_allshl (void *a, void *b, int arg, void *result, void *expected) +static int TST_allshl(void *a, void *b, int arg, void *result, void *expected) { (*(long long *)result) = (*(long long *)a) << arg; return (*(long long *)result) == (*(long long *)expected); } -static int TST_aullshl (void *a, void *b, int arg, void *result, void *expected) +static int TST_aullshl(void *a, void *b, int arg, void *result, void *expected) { (*(unsigned long long *)result) = (*(unsigned long long *)a) << arg; return (*(unsigned long long *)result) == (*(unsigned long long *)expected); } -static int TST_allshr (void *a, void *b, int arg, void *result, void *expected) +static int TST_allshr(void *a, void *b, int arg, void *result, void *expected) { (*(long long *)result) = (*(long long *)a) >> arg; return (*(long long *)result) == (*(long long *)expected); } -static int TST_aullshr (void *a, void *b, int arg, void *result, void *expected) +static int TST_aullshr(void *a, void *b, int arg, void *result, void *expected) { (*(unsigned long long *)result) = (*(unsigned long long *)a) >> arg; return (*(unsigned long long *)result) == (*(unsigned long long *)expected); } - typedef int (*LL_Intrinsic)(void *a, void *b, int arg, void *result, void *expected); -typedef struct { +typedef struct +{ const char *operation; LL_Intrinsic routine; unsigned long long a, b; @@ -237,138 +239,135 @@ typedef struct { unsigned long long expected_result; } LL_Test; -static LL_Test LL_Tests[] = -{ +static LL_Test LL_Tests[] = { /* UNDEFINED {"_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 65, 0x0000000000000000ll}, */ - {"_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFEll}, - {"_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFF00000000ll}, - {"_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFE00000000ll}, - {"_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll}, + { "_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFEll }, + { "_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFF00000000ll }, + { "_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFE00000000ll }, + { "_allshl", &TST_allshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll }, - {"_allshr", &TST_allshr, 0xAAAAAAAA55555555ll, 0ll, 63, 0xFFFFFFFFFFFFFFFFll}, + { "_allshr", &TST_allshr, 0xAAAAAAAA55555555ll, 0ll, 63, 0xFFFFFFFFFFFFFFFFll }, /* UNDEFINED {"_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 65, 0xFFFFFFFFFFFFFFFFll}, */ - {"_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFFll}, - {"_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFFFFFFFFFFll}, - {"_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFFFFFFFFFFll}, - {"_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll}, + { "_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFFll }, + { "_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFFFFFFFFFFll }, + { "_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFFFFFFFFFFll }, + { "_allshr", &TST_allshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll }, /* UNDEFINED {"_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 65, 0x0000000000000000ll}, */ - {"_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 1, 0x2FAFAFAFAFAFAFAFll}, - {"_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 32, 0x000000005F5F5F5Fll}, - {"_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 33, 0x000000002FAFAFAFll}, + { "_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 1, 0x2FAFAFAFAFAFAFAFll }, + { "_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 32, 0x000000005F5F5F5Fll }, + { "_allshr", &TST_allshr, 0x5F5F5F5F5F5F5F5Fll, 0ll, 33, 0x000000002FAFAFAFll }, /* UNDEFINED {"_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 65, 0x0000000000000000ll}, */ - {"_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFEll}, - {"_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFF00000000ll}, - {"_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFE00000000ll}, - {"_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll}, + { "_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0xFFFFFFFFFFFFFFFEll }, + { "_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0xFFFFFFFF00000000ll }, + { "_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0xFFFFFFFE00000000ll }, + { "_aullshl", &TST_aullshl, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll }, /* UNDEFINED {"_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 65, 0x0000000000000000ll}, */ - {"_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0x7FFFFFFFFFFFFFFFll}, - {"_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0x00000000FFFFFFFFll}, - {"_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0x000000007FFFFFFFll}, - {"_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll}, - - {"_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000000ll, 0, 0x0000000000000000ll}, - {"_allmul", &TST_allmul, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll}, - {"_allmul", &TST_allmul, 0x0000000000000001ll, 0x000000000FFFFFFFll, 0, 0x000000000FFFFFFFll}, - {"_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFF0ll}, - {"_allmul", &TST_allmul, 0x0000000000000010ll, 0x000000000FFFFFFFll, 0, 0x00000000FFFFFFF0ll}, - {"_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000100ll, 0, 0x0000000FFFFFFF00ll}, - {"_allmul", &TST_allmul, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000FFFFFFF00ll}, - {"_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000010000000ll, 0, 0x00FFFFFFF0000000ll}, - {"_allmul", &TST_allmul, 0x0000000010000000ll, 0x000000000FFFFFFFll, 0, 0x00FFFFFFF0000000ll}, - {"_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000080000000ll, 0, 0x07FFFFFF80000000ll}, - {"_allmul", &TST_allmul, 0x0000000080000000ll, 0x000000000FFFFFFFll, 0, 0x07FFFFFF80000000ll}, - {"_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0xFFFFFFFF00000000ll}, - {"_allmul", &TST_allmul, 0x0000000080000000ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFF00000000ll}, - {"_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000008ll, 0, 0xFFFFFFFEFFFFFFF0ll}, - {"_allmul", &TST_allmul, 0x0000000080000008ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFEFFFFFFF0ll}, - {"_allmul", &TST_allmul, 0x00000000FFFFFFFFll, 0x00000000FFFFFFFFll, 0, 0xFFFFFFFE00000001ll}, - - {"_alldiv", &TST_alldiv, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_alldiv", &TST_alldiv, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_alldiv", &TST_alldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0xFFFFFFFFFFFFFFFFll}, - {"_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0xFFFFFFFFFFFFFFFFll}, - {"_alldiv", &TST_alldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0xFFFFFFFFFFFFFFFFll}, - {"_alldiv", &TST_alldiv, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000001ll}, - {"_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll}, - {"_alldiv", &TST_alldiv, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll}, - {"_alldiv", &TST_alldiv, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFFFll}, - {"_alldiv", &TST_alldiv, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000000ll}, - {"_alldiv", &TST_alldiv, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x000000000FFFFFFFll}, - {"_alldiv", &TST_alldiv, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x000000000FFFFFFFll}, - {"_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x0000000000000000ll}, - {"_alldiv", &TST_alldiv, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000080000008ll}, - {"_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xC000000080000008ll}, - {"_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000000000007FFFll}, - {"_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000001ll}, - - {"_allrem", &TST_allrem, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x000000000000000Fll}, - {"_allrem", &TST_allrem, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000100ll}, - {"_allrem", &TST_allrem, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0xFFFFFFFFFFFFFFFEll}, - {"_allrem", &TST_allrem, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll}, - {"_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll}, - {"_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll}, - - - {"_ualldiv", &TST_ualldiv, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0xFFFFFFFFFFFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000001ll}, - {"_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll}, - {"_ualldiv", &TST_ualldiv, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x000000000FFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x000000000FFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x00000001FFFFFFFFll}, - {"_ualldiv", &TST_ualldiv, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll}, - {"_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000000000007FFFll}, - {"_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000001ll}, - - {"_uallrem", &TST_uallrem, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll}, - {"_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll}, - {"_uallrem", &TST_uallrem, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x000000000000000Fll}, - {"_uallrem", &TST_uallrem, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000100ll}, - {"_uallrem", &TST_uallrem, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x0000000000000000ll}, - {"_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x000000007FFFFFFEll}, - {"_uallrem", &TST_uallrem, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFEFFFFFFF0ll}, - {"_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x7FFFFFFEFFFFFFF0ll}, - {"_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll}, - {"_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll}, - - {NULL} + { "_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 1, 0x7FFFFFFFFFFFFFFFll }, + { "_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 32, 0x00000000FFFFFFFFll }, + { "_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 33, 0x000000007FFFFFFFll }, + { "_aullshr", &TST_aullshr, 0xFFFFFFFFFFFFFFFFll, 0ll, 0, 0xFFFFFFFFFFFFFFFFll }, + + { "_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000000ll, 0, 0x0000000000000000ll }, + { "_allmul", &TST_allmul, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll }, + { "_allmul", &TST_allmul, 0x0000000000000001ll, 0x000000000FFFFFFFll, 0, 0x000000000FFFFFFFll }, + { "_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFF0ll }, + { "_allmul", &TST_allmul, 0x0000000000000010ll, 0x000000000FFFFFFFll, 0, 0x00000000FFFFFFF0ll }, + { "_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000000000100ll, 0, 0x0000000FFFFFFF00ll }, + { "_allmul", &TST_allmul, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000FFFFFFF00ll }, + { "_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000010000000ll, 0, 0x00FFFFFFF0000000ll }, + { "_allmul", &TST_allmul, 0x0000000010000000ll, 0x000000000FFFFFFFll, 0, 0x00FFFFFFF0000000ll }, + { "_allmul", &TST_allmul, 0x000000000FFFFFFFll, 0x0000000080000000ll, 0, 0x07FFFFFF80000000ll }, + { "_allmul", &TST_allmul, 0x0000000080000000ll, 0x000000000FFFFFFFll, 0, 0x07FFFFFF80000000ll }, + { "_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0xFFFFFFFF00000000ll }, + { "_allmul", &TST_allmul, 0x0000000080000000ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFF00000000ll }, + { "_allmul", &TST_allmul, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000008ll, 0, 0xFFFFFFFEFFFFFFF0ll }, + { "_allmul", &TST_allmul, 0x0000000080000008ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFEFFFFFFF0ll }, + /* UNDEFINED { "_allmul", &TST_allmul, 0x00000000FFFFFFFFll, 0x00000000FFFFFFFFll, 0, 0xFFFFFFFE00000001ll }, */ + + { "_alldiv", &TST_alldiv, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_alldiv", &TST_alldiv, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_alldiv", &TST_alldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0xFFFFFFFFFFFFFFFFll }, + { "_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0xFFFFFFFFFFFFFFFFll }, + { "_alldiv", &TST_alldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0xFFFFFFFFFFFFFFFFll }, + { "_alldiv", &TST_alldiv, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000001ll }, + { "_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll }, + { "_alldiv", &TST_alldiv, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll }, + { "_alldiv", &TST_alldiv, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFFFll }, + { "_alldiv", &TST_alldiv, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000000ll }, + { "_alldiv", &TST_alldiv, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x000000000FFFFFFFll }, + { "_alldiv", &TST_alldiv, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x000000000FFFFFFFll }, + { "_alldiv", &TST_alldiv, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x0000000000000000ll }, + { "_alldiv", &TST_alldiv, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000080000008ll }, + { "_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xC000000080000008ll }, + { "_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000000000007FFFll }, + { "_alldiv", &TST_alldiv, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000001ll }, + + { "_allrem", &TST_allrem, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x000000000000000Fll }, + { "_allrem", &TST_allrem, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000100ll }, + { "_allrem", &TST_allrem, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0xFFFFFFFFFFFFFFFEll }, + { "_allrem", &TST_allrem, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll }, + { "_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll }, + { "_allrem", &TST_allrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll }, + + { "_ualldiv", &TST_ualldiv, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0xFFFFFFFFFFFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000001ll }, + { "_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll }, + { "_ualldiv", &TST_ualldiv, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x000000000FFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x00000000FFFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x000000000FFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x000000000FFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x00000001FFFFFFFFll }, + { "_ualldiv", &TST_ualldiv, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x0000000000000000ll }, + { "_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000000000007FFFll }, + { "_ualldiv", &TST_ualldiv, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000001ll }, + + { "_uallrem", &TST_uallrem, 0x0000000000000000ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x0000000000000000ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll }, + { "_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x0000000000000001ll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000001ll }, + { "_uallrem", &TST_uallrem, 0x0000000000000001ll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x000000000FFFFFFFll, 0x0000000000000001ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x0000000FFFFFFFFFll, 0x0000000000000010ll, 0, 0x000000000000000Fll }, + { "_uallrem", &TST_uallrem, 0x0000000000000100ll, 0x000000000FFFFFFFll, 0, 0x0000000000000100ll }, + { "_uallrem", &TST_uallrem, 0x00FFFFFFF0000000ll, 0x0000000010000000ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0x07FFFFFF80000000ll, 0x0000000080000000ll, 0, 0x0000000000000000ll }, + { "_uallrem", &TST_uallrem, 0xFFFFFFFFFFFFFFFEll, 0x0000000080000000ll, 0, 0x000000007FFFFFFEll }, + { "_uallrem", &TST_uallrem, 0xFFFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0xFFFFFFFEFFFFFFF0ll }, + { "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0xFFFFFFFFFFFFFFFEll, 0, 0x7FFFFFFEFFFFFFF0ll }, + { "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll }, + { "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll }, + + { NULL } }; -int -Test64Bit (SDL_bool verbose) +int Test64Bit(SDL_bool verbose) { LL_Test *t; int failed = 0; - for (t = LL_Tests; t->routine != NULL; t++) { + for (t = LL_Tests; t->routine; t++) { unsigned long long result = 0; unsigned int *al = (unsigned int *)&t->a; unsigned int *bl = (unsigned int *)&t->b; @@ -376,46 +375,46 @@ Test64Bit (SDL_bool verbose) unsigned int *rl = (unsigned int *)&result; if (!t->routine(&t->a, &t->b, t->arg, &result, &t->expected_result)) { - if (verbose) - SDL_Log("%s(0x%08X%08X, 0x%08X%08X, %3d, produced: 0x%08X%08X, expected: 0x%08X%08X\n", - t->operation, al[1], al[0], bl[1], bl[0], t->arg, rl[1], rl[0], el[1], el[0]); + if (verbose) { + SDL_Log("%s(0x%08X%08X, 0x%08X%08X, %3d, produced: 0x%08X%08X, expected: 0x%08X%08X\n", t->operation, al[1], al[0], bl[1], bl[0], + t->arg, rl[1], rl[0], el[1], el[0]); + } ++failed; } } - if (verbose && (failed == 0)) + if (verbose && (failed == 0)) { SDL_Log("All 64bit instrinsic tests passed\n"); - return (failed ? 1 : 0); + } + return failed ? 1 : 0; } -int -TestCPUInfo(SDL_bool verbose) +int TestCPUInfo(SDL_bool verbose) { if (verbose) { SDL_Log("CPU count: %d\n", SDL_GetCPUCount()); SDL_Log("CPU cache line size: %d\n", SDL_GetCPUCacheLineSize()); - SDL_Log("RDTSC %s\n", SDL_HasRDTSC()? "detected" : "not detected"); - SDL_Log("AltiVec %s\n", SDL_HasAltiVec()? "detected" : "not detected"); - SDL_Log("MMX %s\n", SDL_HasMMX()? "detected" : "not detected"); - SDL_Log("3DNow! %s\n", SDL_Has3DNow()? "detected" : "not detected"); - SDL_Log("SSE %s\n", SDL_HasSSE()? "detected" : "not detected"); - SDL_Log("SSE2 %s\n", SDL_HasSSE2()? "detected" : "not detected"); - SDL_Log("SSE3 %s\n", SDL_HasSSE3()? "detected" : "not detected"); - SDL_Log("SSE4.1 %s\n", SDL_HasSSE41()? "detected" : "not detected"); - SDL_Log("SSE4.2 %s\n", SDL_HasSSE42()? "detected" : "not detected"); - SDL_Log("AVX %s\n", SDL_HasAVX()? "detected" : "not detected"); - SDL_Log("AVX2 %s\n", SDL_HasAVX2()? "detected" : "not detected"); - SDL_Log("AVX-512F %s\n", SDL_HasAVX512F()? "detected" : "not detected"); - SDL_Log("ARM SIMD %s\n", SDL_HasARMSIMD()? "detected" : "not detected"); - SDL_Log("NEON %s\n", SDL_HasNEON()? "detected" : "not detected"); - SDL_Log("LSX %s\n", SDL_HasLSX()? "detected" : "not detected"); - SDL_Log("LASX %s\n", SDL_HasLASX()? "detected" : "not detected"); + SDL_Log("RDTSC %s\n", SDL_HasRDTSC() ? "detected" : "not detected"); + SDL_Log("AltiVec %s\n", SDL_HasAltiVec() ? "detected" : "not detected"); + SDL_Log("MMX %s\n", SDL_HasMMX() ? "detected" : "not detected"); + SDL_Log("3DNow! %s\n", SDL_Has3DNow() ? "detected" : "not detected"); + SDL_Log("SSE %s\n", SDL_HasSSE() ? "detected" : "not detected"); + SDL_Log("SSE2 %s\n", SDL_HasSSE2() ? "detected" : "not detected"); + SDL_Log("SSE3 %s\n", SDL_HasSSE3() ? "detected" : "not detected"); + SDL_Log("SSE4.1 %s\n", SDL_HasSSE41() ? "detected" : "not detected"); + SDL_Log("SSE4.2 %s\n", SDL_HasSSE42() ? "detected" : "not detected"); + SDL_Log("AVX %s\n", SDL_HasAVX() ? "detected" : "not detected"); + SDL_Log("AVX2 %s\n", SDL_HasAVX2() ? "detected" : "not detected"); + SDL_Log("AVX-512F %s\n", SDL_HasAVX512F() ? "detected" : "not detected"); + SDL_Log("ARM SIMD %s\n", SDL_HasARMSIMD() ? "detected" : "not detected"); + SDL_Log("NEON %s\n", SDL_HasNEON() ? "detected" : "not detected"); + SDL_Log("LSX %s\n", SDL_HasLSX() ? "detected" : "not detected"); + SDL_Log("LASX %s\n", SDL_HasLASX() ? "detected" : "not detected"); SDL_Log("System RAM %d MB\n", SDL_GetSystemRAM()); } - return (0); + return 0; } -int -TestAssertions(SDL_bool verbose) +int TestAssertions(SDL_bool verbose) { SDL_assert(1); SDL_assert_release(1); @@ -424,7 +423,7 @@ TestAssertions(SDL_bool verbose) SDL_assert_release(0 || 1); SDL_assert_paranoid(0 || 1); -#if 0 /* enable this to test assertion failures. */ +#if 0 /* enable this to test assertion failures. */ SDL_assert_release(1 == 2); SDL_assert_release(5 < 4); SDL_assert_release(0 && "This is a test"); @@ -434,27 +433,55 @@ TestAssertions(SDL_bool verbose) const SDL_AssertData *item = SDL_GetAssertionReport(); while (item) { SDL_Log("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", - item->condition, item->function, item->filename, - item->linenum, item->trigger_count, - item->always_ignore ? "yes" : "no"); + item->condition, item->function, item->filename, + item->linenum, item->trigger_count, + item->always_ignore ? "yes" : "no"); item = item->next; } } - return (0); + return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_bool verbose = SDL_TRUE; int status = 0; + int i; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if (argv[1] && (SDL_strcmp(argv[1], "-q") == 0)) { - verbose = SDL_FALSE; + /* Parse commandline */ + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (!consumed) { + if (SDL_strcmp("-q", argv[i]) == 0) { + verbose = SDL_FALSE; + consumed = 1; + } + } + if (consumed <= 0) { + static const char *options[] = { "[-q]", NULL }; + SDLTest_CommonLogUsage(state, argv[0], options); + return 1; + } + + i += consumed; } + + if (!SDLTest_CommonInit(state)) { + return 1; + } + if (verbose) { SDL_Log("This system is running %s\n", SDL_GetPlatform()); } @@ -465,5 +492,6 @@ main(int argc, char *argv[]) status += TestCPUInfo(verbose); status += TestAssertions(verbose); + SDLTest_CommonQuit(state); return status; } diff --git a/test/testpower.c b/test/testpower.c index 27b05ee214a0c..79c0d69ff3042 100644 --- a/test/testpower.c +++ b/test/testpower.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -13,6 +13,7 @@ #include #include "SDL.h" +#include "SDL_test.h" static void report_power(void) @@ -54,26 +55,35 @@ report_power(void) if (seconds == -1) { SDL_Log("Time left: unknown\n"); } else { - SDL_Log("Time left: %d minutes, %d seconds\n", (int) (seconds / 60), - (int) (seconds % 60)); + SDL_Log("Time left: %d minutes, %d seconds\n", seconds / 60, seconds % 60); } } - -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if (SDL_Init(0) == -1) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Init() failed: %s\n", SDL_GetError()); + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; } report_power(); - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testqsort.c b/test/testqsort.c index 29ea056275bc5..e35e2a066ccd0 100644 --- a/test/testqsort.c +++ b/test/testqsort.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,8 +15,8 @@ static int SDLCALL num_compare(const void *_a, const void *_b) { - const int a = *((const int *) _a); - const int b = *((const int *) _b); + const int a = *((const int *)_a); + const int b = *((const int *)_b); return (a < b) ? -1 : ((a > b) ? 1 : 0); } @@ -28,7 +28,7 @@ test_sort(const char *desc, int *nums, const int arraylen) SDL_Log("test: %s arraylen=%d", desc, arraylen); - SDL_qsort(nums, arraylen, sizeof (nums[0]), num_compare); + SDL_qsort(nums, arraylen, sizeof(nums[0]), num_compare); prev = nums[0]; for (i = 1; i < arraylen; i++) { @@ -41,41 +41,75 @@ test_sort(const char *desc, int *nums, const int arraylen) } } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { + SDLTest_CommonState *state; static int nums[1024 * 100]; static const int itervals[] = { SDL_arraysize(nums), 12 }; int iteration; + int i; + SDL_bool custom_seed = SDL_FALSE; + Uint64 seed; SDLTest_RandomContext rndctx; - if (argc > 1) - { - int success; - Uint64 seed = 0; - if (argv[1][0] == '0' && argv[1][1] == 'x') - success = SDL_sscanf(argv[1] + 2, "%"SDL_PRIx64, &seed); - else - success = SDL_sscanf(argv[1], "%"SDL_PRIu64, &seed); - if (!success) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid seed. Use a decimal or hexadecimal number.\n"); - return 1; + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } + + /* Enable standard application logging */ + SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + /* Parse commandline */ + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (!consumed) { + if (!custom_seed) { + int success; + + if (argv[i][0] == '0' && argv[i][1] == 'x') { + success = SDL_sscanf(argv[i] + 2, "%" SDL_PRIx64, &seed); + } else { + success = SDL_sscanf(argv[i], "%" SDL_PRIu64, &seed); + } + if (!success) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid seed. Use a decimal or hexadecimal number.\n"); + return 1; + } + if (seed <= ((Uint64)0xffffffff)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Seed must be equal or greater than 0x100000000.\n"); + return 1; + } + custom_seed = SDL_TRUE; + consumed = 1; + } } - if (seed <= ((Uint64)0xffffffff)) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Seed must be equal or greater than 0x100000000.\n"); + + if (consumed <= 0) { + static const char *options[] = { "[SEED]", NULL }; + SDLTest_CommonLogUsage(state, argv[0], options); return 1; } - SDLTest_RandomInit(&rndctx, (unsigned int)(seed >> 32), (unsigned int)(seed & 0xffffffff)); + + i += consumed; } - else - { + + if (custom_seed) { + SDLTest_RandomInit(&rndctx, (unsigned int)(seed >> 32), (unsigned int)(seed & 0xffffffff)); + } else { SDLTest_RandomInitTime(&rndctx); } SDL_Log("Using random seed 0x%08x%08x\n", rndctx.x, rndctx.c); + if (!SDLTest_CommonInit(state)) { + return 1; + } + for (iteration = 0; iteration < SDL_arraysize(itervals); iteration++) { const int arraylen = itervals[iteration]; - int i; for (i = 0; i < arraylen; i++) { nums[i] = i; @@ -85,11 +119,11 @@ main(int argc, char *argv[]) for (i = 0; i < arraylen; i++) { nums[i] = i; } - nums[arraylen-1] = -1; + nums[arraylen - 1] = -1; test_sort("already sorted except last element", nums, arraylen); for (i = 0; i < arraylen; i++) { - nums[i] = (arraylen-1) - i; + nums[i] = (arraylen - 1) - i; } test_sort("reverse sorted", nums, arraylen); @@ -99,6 +133,8 @@ main(int argc, char *argv[]) test_sort("random sorted", nums, arraylen); } + SDLTest_CommonQuit(state); + return 0; } diff --git a/test/testrelative.c b/test/testrelative.c index 40c670bc941dd..c0c7099ee9546 100644 --- a/test/testrelative.c +++ b/test/testrelative.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,40 +28,49 @@ SDL_Rect rect; SDL_Event event; static void -DrawRects(SDL_Renderer * renderer) +DrawRects(SDL_Renderer *renderer) { SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); SDL_RenderFillRect(renderer, &rect); } static void -loop(){ +loop(void) +{ /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); - switch(event.type) { + switch (event.type) { case SDL_MOUSEMOTION: - { - rect.x += event.motion.xrel; - rect.y += event.motion.yrel; - } - break; + { + rect.x += event.motion.xrel; + rect.y += event.motion.yrel; + } break; } } for (i = 0; i < state->num_windows; ++i) { SDL_Rect viewport; SDL_Renderer *renderer = state->renderers[i]; - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); SDL_RenderClear(renderer); /* Wrap the cursor rectangle at the screen edges to keep it visible */ SDL_RenderGetViewport(renderer, &viewport); - if (rect.x < viewport.x) rect.x += viewport.w; - if (rect.y < viewport.y) rect.y += viewport.h; - if (rect.x > viewport.x + viewport.w) rect.x -= viewport.w; - if (rect.y > viewport.y + viewport.h) rect.y -= viewport.h; + if (rect.x < viewport.x) { + rect.x += viewport.w; + } + if (rect.y < viewport.y) { + rect.y += viewport.h; + } + if (rect.x > viewport.x + viewport.w) { + rect.x -= viewport.w; + } + if (rect.y > viewport.y + viewport.h) { + rect.y -= viewport.h; + } DrawRects(renderer); @@ -74,8 +83,7 @@ loop(){ #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* Enable standard application logging */ @@ -102,7 +110,7 @@ main(int argc, char *argv[]) } srand((unsigned int)time(NULL)); - if(SDL_SetRelativeMouseMode(SDL_TRUE) < 0) { + if (SDL_SetRelativeMouseMode(SDL_TRUE) < 0) { return 3; } @@ -117,7 +125,7 @@ main(int argc, char *argv[]) #else while (!done) { loop(); - } + } #endif SDLTest_CommonQuit(state); return 0; diff --git a/test/testrendercopyex.c b/test/testrendercopyex.c index b954499e324c7..6ecc31e22ff01 100644 --- a/test/testrendercopyex.c +++ b/test/testrendercopyex.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,8 @@ static SDLTest_CommonState *state; -typedef struct { +typedef struct +{ SDL_Window *window; SDL_Renderer *renderer; SDL_Texture *background; @@ -44,13 +45,12 @@ quit(int rc) exit(rc); } -void -Draw(DrawState *s) +void Draw(DrawState *s) { SDL_Rect viewport; SDL_Texture *target; - SDL_Point *center=NULL; - SDL_Point origin = {0,0}; + SDL_Point *center = NULL; + SDL_Point origin = { 0, 0 }; SDL_RenderGetViewport(s->renderer, &viewport); @@ -87,7 +87,7 @@ Draw(DrawState *s) /* SDL_Delay(10); */ } -void loop() +void loop(void) { int i; SDL_Event event; @@ -98,8 +98,9 @@ void loop() SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } Draw(&drawstates[i]); } #ifdef __EMSCRIPTEN__ @@ -109,8 +110,7 @@ void loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; int frames; @@ -157,12 +157,12 @@ main(int argc, char *argv[]) while (!done) { ++frames; loop(); - } + } #endif /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } diff --git a/test/testrendertarget.c b/test/testrendertarget.c index 0848beb36f7f3..7e62b5ba5eba3 100644 --- a/test/testrendertarget.c +++ b/test/testrendertarget.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,7 +24,8 @@ static SDLTest_CommonState *state; -typedef struct { +typedef struct +{ SDL_Window *window; SDL_Renderer *renderer; SDL_Texture *background; @@ -172,8 +173,7 @@ Draw(DrawState *s) return SDL_TRUE; } -void -loop() +void loop(void) { int i; SDL_Event event; @@ -183,12 +183,17 @@ loop() SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } if (test_composite) { - if (!DrawComposite(&drawstates[i])) done = 1; + if (!DrawComposite(&drawstates[i])) { + done = 1; + } } else { - if (!Draw(&drawstates[i])) done = 1; + if (!Draw(&drawstates[i])) { + done = 1; + } } } #ifdef __EMSCRIPTEN__ @@ -198,8 +203,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; int frames; @@ -272,7 +276,7 @@ main(int argc, char *argv[]) /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } diff --git a/test/testresample.c b/test/testresample.c index 6f03aabd49a8a..e1608a319f5f7 100644 --- a/test/testresample.c +++ b/test/testresample.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -12,8 +12,7 @@ #include "SDL.h" -int -main(int argc, char **argv) +int main(int argc, char **argv) { SDL_AudioSpec spec; SDL_AudioCVT cvt; @@ -57,8 +56,8 @@ main(int argc, char **argv) } cvt.len = len; - cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult); - if (cvt.buf == NULL) { + cvt.buf = (Uint8 *)SDL_malloc((size_t)len * cvt.len_mult); + if (!cvt.buf) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory.\n"); SDL_FreeWAV(data); SDL_Quit(); @@ -76,7 +75,7 @@ main(int argc, char **argv) /* write out a WAV header... */ io = SDL_RWFromFile(argv[2], "wb"); - if (io == NULL) { + if (!io) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "fopen('%s') failed: %s\n", argv[2], SDL_GetError()); SDL_free(cvt.buf); SDL_FreeWAV(data); @@ -88,19 +87,19 @@ main(int argc, char **argv) blockalign = (bitsize / 8) * cvtchans; avgbytes = cvtfreq * blockalign; - SDL_WriteLE32(io, 0x46464952); /* RIFF */ + SDL_WriteLE32(io, 0x46464952); /* RIFF */ SDL_WriteLE32(io, cvt.len_cvt + 36); - SDL_WriteLE32(io, 0x45564157); /* WAVE */ - SDL_WriteLE32(io, 0x20746D66); /* fmt */ - SDL_WriteLE32(io, 16); /* chunk size */ - SDL_WriteLE16(io, SDL_AUDIO_ISFLOAT(spec.format) ? 3 : 1); /* uncompressed */ - SDL_WriteLE16(io, cvtchans); /* channels */ - SDL_WriteLE32(io, cvtfreq); /* sample rate */ - SDL_WriteLE32(io, avgbytes); /* average bytes per second */ - SDL_WriteLE16(io, blockalign); /* block align */ - SDL_WriteLE16(io, bitsize); /* significant bits per sample */ - SDL_WriteLE32(io, 0x61746164); /* data */ - SDL_WriteLE32(io, cvt.len_cvt); /* size */ + SDL_WriteLE32(io, 0x45564157); /* WAVE */ + SDL_WriteLE32(io, 0x20746D66); /* fmt */ + SDL_WriteLE32(io, 16); /* chunk size */ + SDL_WriteLE16(io, SDL_AUDIO_ISFLOAT(spec.format) ? 3 : 1); /* uncompressed */ + SDL_WriteLE16(io, cvtchans); /* channels */ + SDL_WriteLE32(io, cvtfreq); /* sample rate */ + SDL_WriteLE32(io, avgbytes); /* average bytes per second */ + SDL_WriteLE16(io, blockalign); /* block align */ + SDL_WriteLE16(io, bitsize); /* significant bits per sample */ + SDL_WriteLE32(io, 0x61746164); /* data */ + SDL_WriteLE32(io, cvt.len_cvt); /* size */ SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1); if (SDL_RWclose(io) == -1) { @@ -109,12 +108,12 @@ main(int argc, char **argv) SDL_FreeWAV(data); SDL_Quit(); return 8; - } /* if */ + } /* if */ SDL_free(cvt.buf); SDL_FreeWAV(data); SDL_Quit(); return 0; -} /* main */ +} /* main */ /* end of testresample.c ... */ diff --git a/test/testrumble.c b/test/testrumble.c index 07fc89c58b777..29c0ae29c538e 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -31,14 +31,12 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND static SDL_Haptic *haptic; - /** * @brief The entry point of this force feedback demo. * @param[in] argc Number of arguments. * @param[in] argv Array of argc arguments. */ -int -main(int argc, char **argv) +int main(int argc, char **argv) { int i; char *name; @@ -54,9 +52,9 @@ main(int argc, char **argv) name = argv[1]; if ((SDL_strcmp(name, "--help") == 0) || (SDL_strcmp(name, "-h") == 0)) { SDL_Log("USAGE: %s [device]\n" - "If device is a two-digit number it'll use it as an index, otherwise\n" - "it'll use it as if it were part of the device's name.\n", - argv[0]); + "If device is a two-digit number it'll use it as an index, otherwise\n" + "it'll use it as if it were part of the device's name.\n", + argv[0]); return 0; } @@ -73,27 +71,28 @@ main(int argc, char **argv) SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics()); if (SDL_NumHaptics() > 0) { /* We'll just use index or the first force feedback device found */ - if (name == NULL) { + if (!name) { i = (index != -1) ? index : 0; } /* Try to find matching device */ else { for (i = 0; i < SDL_NumHaptics(); i++) { - if (SDL_strstr(SDL_HapticName(i), name) != NULL) + if (SDL_strstr(SDL_HapticName(i), name) != NULL) { break; + } } if (i >= SDL_NumHaptics()) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", - name); + name); return 1; } } haptic = SDL_HapticOpen(i); - if (haptic == NULL) { + if (!haptic) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", - SDL_GetError()); + SDL_GetError()); return 1; } SDL_Log("Device: %s\n", SDL_HapticName(i)); @@ -115,8 +114,8 @@ main(int argc, char **argv) } SDL_Log("Playing 2 second rumble at 0.5 magnitude.\n"); if (SDL_HapticRumblePlay(haptic, 0.5, 5000) != 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError() ); - return 1; + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError()); + return 1; } SDL_Delay(2000); SDL_Log("Stopping rumble.\n"); @@ -124,14 +123,15 @@ main(int argc, char **argv) SDL_Delay(2000); SDL_Log("Playing 2 second rumble at 0.3 magnitude.\n"); if (SDL_HapticRumblePlay(haptic, 0.3f, 5000) != 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError() ); - return 1; + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to play rumble: %s\n", SDL_GetError()); + return 1; } SDL_Delay(2000); /* Quit */ - if (haptic != NULL) + if (haptic) { SDL_HapticClose(haptic); + } SDL_Quit(); return 0; diff --git a/test/testscale.c b/test/testscale.c index 0f1d21bfe93e4..f98d4d9c6130d 100644 --- a/test/testscale.c +++ b/test/testscale.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,12 +22,13 @@ #include "SDL_test_common.h" #include "testutils.h" -#define WINDOW_WIDTH 640 -#define WINDOW_HEIGHT 480 +#define WINDOW_WIDTH 640 +#define WINDOW_HEIGHT 480 static SDLTest_CommonState *state; -typedef struct { +typedef struct +{ SDL_Window *window; SDL_Renderer *renderer; SDL_Texture *background; @@ -47,8 +48,7 @@ quit(int rc) exit(rc); } -void -Draw(DrawState *s) +void Draw(DrawState *s) { SDL_Rect viewport; @@ -78,8 +78,7 @@ Draw(DrawState *s) SDL_RenderPresent(s->renderer); } -void -loop() +void loop(void) { int i; SDL_Event event; @@ -89,8 +88,9 @@ loop() SDLTest_CommonEvent(state, &event, &done); } for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } Draw(&drawstates[i]); } #ifdef __EMSCRIPTEN__ @@ -100,8 +100,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; int frames; @@ -154,7 +153,7 @@ main(int argc, char *argv[]) /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } diff --git a/test/testsem.c b/test/testsem.c index bac51279d1f4a..5afa79cf6c238 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -21,14 +21,15 @@ #define NUM_THREADS 10 /* This value should be smaller than the maximum count of the */ /* semaphore implementation: */ -#define NUM_OVERHEAD_OPS 10000 +#define NUM_OVERHEAD_OPS 10000 #define NUM_OVERHEAD_OPS_MULT 10 static SDL_sem *sem; int alive; -typedef struct Thread_State { - SDL_Thread * thread; +typedef struct Thread_State +{ + SDL_Thread *thread; int number; SDL_bool flag; int loop_count; @@ -44,7 +45,7 @@ killed(int sig) static int SDLCALL ThreadFuncRealWorld(void *data) { - Thread_State *state = (Thread_State *) data; + Thread_State *state = (Thread_State *)data; while (alive) { SDL_SemWait(sem); SDL_Log("Thread number %d has got the semaphore (value = %" SDL_PRIu32 ")!\n", @@ -54,29 +55,30 @@ ThreadFuncRealWorld(void *data) SDL_Log("Thread number %d has released the semaphore (value = %" SDL_PRIu32 ")!\n", state->number, SDL_SemValue(sem)); ++state->loop_count; - SDL_Delay(1); /* For the scheduler */ + SDL_Delay(1); /* For the scheduler */ } SDL_Log("Thread number %d exiting.\n", state->number); return 0; } static void -TestRealWorld(int init_sem) { - Thread_State thread_states[NUM_THREADS] = { {0} }; +TestRealWorld(int init_sem) +{ + Thread_State thread_states[NUM_THREADS] = { { 0 } }; int i; int loop_count; sem = SDL_CreateSemaphore(init_sem); SDL_Log("Running %d threads, semaphore value = %d\n", NUM_THREADS, - init_sem); + init_sem); alive = 1; /* Create all the threads */ for (i = 0; i < NUM_THREADS; ++i) { char name[64]; - SDL_snprintf(name, sizeof (name), "Thread%u", (unsigned int) i); + (void)SDL_snprintf(name, sizeof(name), "Thread%u", (unsigned int)i); thread_states[i].number = i; - thread_states[i].thread = SDL_CreateThread(ThreadFuncRealWorld, name, (void *) &thread_states[i]); + thread_states[i].thread = SDL_CreateThread(ThreadFuncRealWorld, name, (void *)&thread_states[i]); } /* Wait 10 seconds */ @@ -117,8 +119,9 @@ TestWaitTimeout(void) SDL_Log("Wait took %" SDL_PRIu32 " milliseconds\n\n", duration); /* Check to make sure the return value indicates timed out */ - if (retval != SDL_MUTEX_TIMEDOUT) + if (retval != SDL_MUTEX_TIMEDOUT) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_SemWaitTimeout returned: %d; expected: %d\n\n", retval, SDL_MUTEX_TIMEDOUT); + } SDL_DestroySemaphore(sem); } @@ -135,7 +138,7 @@ TestOverheadUncontended(void) SDL_Log("Doing %d uncontended Post/Wait operations on semaphore\n", NUM_OVERHEAD_OPS * NUM_OVERHEAD_OPS_MULT); start_ticks = SDL_GetTicks(); - for (i = 0; i < NUM_OVERHEAD_OPS_MULT; i++){ + for (i = 0; i < NUM_OVERHEAD_OPS_MULT; i++) { for (j = 0; j < NUM_OVERHEAD_OPS; j++) { SDL_SemPost(sem); } @@ -154,17 +157,17 @@ TestOverheadUncontended(void) static int SDLCALL ThreadFuncOverheadContended(void *data) { - Thread_State *state = (Thread_State *) data; + Thread_State *state = (Thread_State *)data; if (state->flag) { - while(alive) { + while (alive) { if (SDL_SemTryWait(sem) == SDL_MUTEX_TIMEDOUT) { ++state->content_count; } ++state->loop_count; } } else { - while(alive) { + while (alive) { /* Timeout needed to allow check on alive flag */ if (SDL_SemWaitTimeout(sem, 50) == SDL_MUTEX_TIMEDOUT) { ++state->content_count; @@ -181,7 +184,7 @@ TestOverheadContended(SDL_bool try_wait) Uint32 start_ticks; Uint32 end_ticks; Uint32 duration; - Thread_State thread_states[NUM_THREADS] = { {0} }; + Thread_State thread_states[NUM_THREADS] = { { 0 } }; char textBuffer[1024]; int loop_count; int content_count; @@ -195,9 +198,9 @@ TestOverheadContended(SDL_bool try_wait) /* Create multiple threads to starve the semaphore and cause contention */ for (i = 0; i < NUM_THREADS; ++i) { char name[64]; - SDL_snprintf(name, sizeof (name), "Thread%u", (unsigned int) i); + (void)SDL_snprintf(name, sizeof(name), "Thread%u", (unsigned int)i); thread_states[i].flag = try_wait; - thread_states[i].thread = SDL_CreateThread(ThreadFuncOverheadContended, name, (void *) &thread_states[i]); + thread_states[i].thread = SDL_CreateThread(ThreadFuncOverheadContended, name, (void *)&thread_states[i]); } start_ticks = SDL_GetTicks(); @@ -206,7 +209,10 @@ TestOverheadContended(SDL_bool try_wait) SDL_SemPost(sem); } /* Make sure threads consumed everything */ - while (SDL_SemValue(sem)) { } + while (SDL_SemValue(sem)) { + /* Friendlier with cooperative threading models */ + SDL_Delay(1); + } } end_ticks = SDL_GetTicks(); @@ -223,26 +229,25 @@ TestOverheadContended(SDL_bool try_wait) duration = end_ticks - start_ticks; SDL_Log("Took %" SDL_PRIu32 " milliseconds, threads %s %d out of %d times in total (%.2f%%)\n", duration, try_wait ? "where contended" : "timed out", content_count, - loop_count, ((float) content_count * 100) / loop_count); + loop_count, ((float)content_count * 100) / loop_count); /* Print how many semaphores where consumed per thread */ - SDL_snprintf(textBuffer, sizeof(textBuffer), "{ "); + (void)SDL_snprintf(textBuffer, sizeof(textBuffer), "{ "); for (i = 0; i < NUM_THREADS; ++i) { if (i > 0) { len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, ", "); } len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", thread_states[i].loop_count - thread_states[i].content_count); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, "%d", thread_states[i].loop_count - thread_states[i].content_count); } len = SDL_strlen(textBuffer); - SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); + (void)SDL_snprintf(textBuffer + len, sizeof(textBuffer) - len, " }\n"); SDL_Log("%s\n", textBuffer); SDL_DestroySemaphore(sem); } -int -main(int argc, char **argv) +int main(int argc, char **argv) { int init_sem; @@ -251,16 +256,16 @@ main(int argc, char **argv) if (argc < 2) { SDL_Log("Usage: %s init_value\n", argv[0]); - return (1); + return 1; } /* Load the SDL library */ if (SDL_Init(0) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } - signal(SIGTERM, killed); - signal(SIGINT, killed); + (void)signal(SIGTERM, killed); + (void)signal(SIGINT, killed); init_sem = SDL_atoi(argv[1]); if (init_sem > 0) { @@ -276,5 +281,5 @@ main(int argc, char **argv) TestOverheadContended(SDL_TRUE); SDL_Quit(); - return (0); + return 0; } diff --git a/test/testsensor.c b/test/testsensor.c index 73dd317f908d4..d3523d8b2520e 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,8 +18,7 @@ static const char *GetSensorTypeString(SDL_SensorType type) { static char unknown_type[64]; - switch (type) - { + switch (type) { case SDL_SENSOR_INVALID: return "SDL_SENSOR_INVALID"; case SDL_SENSOR_UNKNOWN: @@ -29,7 +28,7 @@ static const char *GetSensorTypeString(SDL_SensorType type) case SDL_SENSOR_GYRO: return "SDL_SENSOR_GYRO"; default: - SDL_snprintf(unknown_type, sizeof(unknown_type), "UNKNOWN (%d)", type); + (void)SDL_snprintf(unknown_type, sizeof(unknown_type), "UNKNOWN (%d)", type); return unknown_type; } } @@ -55,8 +54,7 @@ static void HandleSensorEvent(SDL_SensorEvent *event) } } -int -main(int argc, char **argv) +int main(int argc, char **argv) { int i; int num_sensors, num_opened; @@ -64,7 +62,7 @@ main(int argc, char **argv) /* Load the SDL library */ if (SDL_Init(SDL_INIT_SENSOR) < 0) { SDL_Log("Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } num_sensors = SDL_NumSensors(); @@ -80,7 +78,7 @@ main(int argc, char **argv) if (SDL_SensorGetDeviceType(i) != SDL_SENSOR_UNKNOWN) { SDL_Sensor *sensor = SDL_SensorOpen(i); - if (sensor == NULL) { + if (!sensor) { SDL_Log("Couldn't open sensor %" SDL_PRIs32 ": %s\n", SDL_SensorGetDeviceInstanceID(i), SDL_GetError()); } else { ++num_opened; @@ -117,5 +115,5 @@ main(int argc, char **argv) } SDL_Quit(); - return (0); + return 0; } diff --git a/test/testshader.c b/test/testshader.c index 3c2da590f9b1e..f930071c92737 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -11,24 +11,26 @@ */ /* This is a simple example of using GLSL shaders with SDL */ +#include #include "SDL.h" #ifdef HAVE_OPENGL #include "SDL_opengl.h" - static SDL_bool shaders_supported; -static int current_shader = 0; +static int current_shader = 0; -enum { +enum +{ SHADER_COLOR, SHADER_TEXTURE, SHADER_TEXCOORDS, NUM_SHADERS }; -typedef struct { +typedef struct +{ GLhandleARB program; GLhandleARB vert_shader; GLhandleARB frag_shader; @@ -40,107 +42,104 @@ static ShaderData shaders[NUM_SHADERS] = { /* SHADER_COLOR */ { 0, 0, 0, - /* vertex shader */ -"varying vec4 v_color;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" -" v_color = gl_Color;\n" -"}", - /* fragment shader */ -"varying vec4 v_color;\n" -"\n" -"void main()\n" -"{\n" -" gl_FragColor = v_color;\n" -"}" - }, + /* vertex shader */ + "varying vec4 v_color;\n" + "\n" + "void main()\n" + "{\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " v_color = gl_Color;\n" + "}", + /* fragment shader */ + "varying vec4 v_color;\n" + "\n" + "void main()\n" + "{\n" + " gl_FragColor = v_color;\n" + "}" }, /* SHADER_TEXTURE */ { 0, 0, 0, - /* vertex shader */ -"varying vec4 v_color;\n" -"varying vec2 v_texCoord;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" -" v_color = gl_Color;\n" -" v_texCoord = vec2(gl_MultiTexCoord0);\n" -"}", - /* fragment shader */ -"varying vec4 v_color;\n" -"varying vec2 v_texCoord;\n" -"uniform sampler2D tex0;\n" -"\n" -"void main()\n" -"{\n" -" gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n" -"}" - }, + /* vertex shader */ + "varying vec4 v_color;\n" + "varying vec2 v_texCoord;\n" + "\n" + "void main()\n" + "{\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " v_color = gl_Color;\n" + " v_texCoord = vec2(gl_MultiTexCoord0);\n" + "}", + /* fragment shader */ + "varying vec4 v_color;\n" + "varying vec2 v_texCoord;\n" + "uniform sampler2D tex0;\n" + "\n" + "void main()\n" + "{\n" + " gl_FragColor = texture2D(tex0, v_texCoord) * v_color;\n" + "}" }, /* SHADER_TEXCOORDS */ { 0, 0, 0, - /* vertex shader */ -"varying vec2 v_texCoord;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" -" v_texCoord = vec2(gl_MultiTexCoord0);\n" -"}", - /* fragment shader */ -"varying vec2 v_texCoord;\n" -"\n" -"void main()\n" -"{\n" -" vec4 color;\n" -" vec2 delta;\n" -" float dist;\n" -"\n" -" delta = vec2(0.5, 0.5) - v_texCoord;\n" -" dist = dot(delta, delta);\n" -"\n" -" color.r = v_texCoord.x;\n" -" color.g = v_texCoord.x * v_texCoord.y;\n" -" color.b = v_texCoord.y;\n" -" color.a = 1.0 - (dist * 4.0);\n" -" gl_FragColor = color;\n" -"}" - }, + /* vertex shader */ + "varying vec2 v_texCoord;\n" + "\n" + "void main()\n" + "{\n" + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" + " v_texCoord = vec2(gl_MultiTexCoord0);\n" + "}", + /* fragment shader */ + "varying vec2 v_texCoord;\n" + "\n" + "void main()\n" + "{\n" + " vec4 color;\n" + " vec2 delta;\n" + " float dist;\n" + "\n" + " delta = vec2(0.5, 0.5) - v_texCoord;\n" + " dist = dot(delta, delta);\n" + "\n" + " color.r = v_texCoord.x;\n" + " color.g = v_texCoord.x * v_texCoord.y;\n" + " color.b = v_texCoord.y;\n" + " color.a = 1.0 - (dist * 4.0);\n" + " gl_FragColor = color;\n" + "}" }, }; -static PFNGLATTACHOBJECTARBPROC glAttachObjectARB; -static PFNGLCOMPILESHADERARBPROC glCompileShaderARB; -static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB; -static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB; -static PFNGLDELETEOBJECTARBPROC glDeleteObjectARB; -static PFNGLGETINFOLOGARBPROC glGetInfoLogARB; -static PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB; -static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB; -static PFNGLLINKPROGRAMARBPROC glLinkProgramARB; -static PFNGLSHADERSOURCEARBPROC glShaderSourceARB; -static PFNGLUNIFORM1IARBPROC glUniform1iARB; -static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB; +static PFNGLATTACHOBJECTARBPROC pglAttachObjectARB; +static PFNGLCOMPILESHADERARBPROC pglCompileShaderARB; +static PFNGLCREATEPROGRAMOBJECTARBPROC pglCreateProgramObjectARB; +static PFNGLCREATESHADEROBJECTARBPROC pglCreateShaderObjectARB; +static PFNGLDELETEOBJECTARBPROC pglDeleteObjectARB; +static PFNGLGETINFOLOGARBPROC pglGetInfoLogARB; +static PFNGLGETOBJECTPARAMETERIVARBPROC pglGetObjectParameterivARB; +static PFNGLGETUNIFORMLOCATIONARBPROC pglGetUniformLocationARB; +static PFNGLLINKPROGRAMARBPROC pglLinkProgramARB; +static PFNGLSHADERSOURCEARBPROC pglShaderSourceARB; +static PFNGLUNIFORM1IARBPROC pglUniform1iARB; +static PFNGLUSEPROGRAMOBJECTARBPROC pglUseProgramObjectARB; static SDL_bool CompileShader(GLhandleARB shader, const char *source) { GLint status = 0; - glShaderSourceARB(shader, 1, &source, NULL); - glCompileShaderARB(shader); - glGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); + pglShaderSourceARB(shader, 1, &source, NULL); + pglCompileShaderARB(shader); + pglGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); if (status == 0) { GLint length = 0; char *info; - glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); - info = (char *) SDL_malloc(length + 1); + pglGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + info = (char *)SDL_malloc((size_t)length + 1); if (!info) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); } else { - glGetInfoLogARB(shader, length, NULL, info); + pglGetInfoLogARB(shader, length, NULL, info); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to compile shader:\n%s\n%s", source, info); SDL_free(info); } @@ -154,21 +153,21 @@ static SDL_bool LinkProgram(ShaderData *data) { GLint status = 0; - glAttachObjectARB(data->program, data->vert_shader); - glAttachObjectARB(data->program, data->frag_shader); - glLinkProgramARB(data->program); + pglAttachObjectARB(data->program, data->vert_shader); + pglAttachObjectARB(data->program, data->frag_shader); + pglLinkProgramARB(data->program); - glGetObjectParameterivARB(data->program, GL_OBJECT_LINK_STATUS_ARB, &status); + pglGetObjectParameterivARB(data->program, GL_OBJECT_LINK_STATUS_ARB, &status); if (status == 0) { GLint length = 0; char *info; - glGetObjectParameterivARB(data->program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); - info = (char *) SDL_malloc(length + 1); + pglGetObjectParameterivARB(data->program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); + info = (char *)SDL_malloc((size_t)length + 1); if (!info) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); } else { - glGetInfoLogARB(data->program, length, NULL, info); + pglGetInfoLogARB(data->program, length, NULL, info); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to link program:\n%s", info); SDL_free(info); } @@ -187,16 +186,16 @@ static SDL_bool CompileShaderProgram(ShaderData *data) glGetError(); /* Create one program object to rule them all */ - data->program = glCreateProgramObjectARB(); + data->program = pglCreateProgramObjectARB(); /* Create the vertex shader */ - data->vert_shader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); + data->vert_shader = pglCreateShaderObjectARB(GL_VERTEX_SHADER_ARB); if (!CompileShader(data->vert_shader, data->vert_source)) { return SDL_FALSE; } /* Create the fragment shader */ - data->frag_shader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); + data->frag_shader = pglCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); if (!CompileShader(data->frag_shader, data->frag_source)) { return SDL_FALSE; } @@ -207,16 +206,16 @@ static SDL_bool CompileShaderProgram(ShaderData *data) } /* Set up some uniform variables */ - glUseProgramObjectARB(data->program); + pglUseProgramObjectARB(data->program); for (i = 0; i < num_tmus_bound; ++i) { char tex_name[5]; - SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); - location = glGetUniformLocationARB(data->program, tex_name); + (void)SDL_snprintf(tex_name, SDL_arraysize(tex_name), "tex%d", i); + location = pglGetUniformLocationARB(data->program, tex_name); if (location >= 0) { - glUniform1iARB(location, i); + pglUniform1iARB(location, i); } } - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); return (glGetError() == GL_NO_ERROR) ? SDL_TRUE : SDL_FALSE; } @@ -224,13 +223,13 @@ static SDL_bool CompileShaderProgram(ShaderData *data) static void DestroyShaderProgram(ShaderData *data) { if (shaders_supported) { - glDeleteObjectARB(data->vert_shader); - glDeleteObjectARB(data->frag_shader); - glDeleteObjectARB(data->program); + pglDeleteObjectARB(data->vert_shader); + pglDeleteObjectARB(data->frag_shader); + pglDeleteObjectARB(data->program); } } -static SDL_bool InitShaders() +static SDL_bool InitShaders(void) { int i; @@ -240,30 +239,30 @@ static SDL_bool InitShaders() SDL_GL_ExtensionSupported("GL_ARB_shading_language_100") && SDL_GL_ExtensionSupported("GL_ARB_vertex_shader") && SDL_GL_ExtensionSupported("GL_ARB_fragment_shader")) { - glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) SDL_GL_GetProcAddress("glAttachObjectARB"); - glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) SDL_GL_GetProcAddress("glCompileShaderARB"); - glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glCreateProgramObjectARB"); - glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) SDL_GL_GetProcAddress("glCreateShaderObjectARB"); - glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC) SDL_GL_GetProcAddress("glDeleteObjectARB"); - glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC) SDL_GL_GetProcAddress("glGetInfoLogARB"); - glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC) SDL_GL_GetProcAddress("glGetObjectParameterivARB"); - glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) SDL_GL_GetProcAddress("glGetUniformLocationARB"); - glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) SDL_GL_GetProcAddress("glLinkProgramARB"); - glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) SDL_GL_GetProcAddress("glShaderSourceARB"); - glUniform1iARB = (PFNGLUNIFORM1IARBPROC) SDL_GL_GetProcAddress("glUniform1iARB"); - glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) SDL_GL_GetProcAddress("glUseProgramObjectARB"); - if (glAttachObjectARB && - glCompileShaderARB && - glCreateProgramObjectARB && - glCreateShaderObjectARB && - glDeleteObjectARB && - glGetInfoLogARB && - glGetObjectParameterivARB && - glGetUniformLocationARB && - glLinkProgramARB && - glShaderSourceARB && - glUniform1iARB && - glUseProgramObjectARB) { + pglAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)SDL_GL_GetProcAddress("glAttachObjectARB"); + pglCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)SDL_GL_GetProcAddress("glCompileShaderARB"); + pglCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glCreateProgramObjectARB"); + pglCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)SDL_GL_GetProcAddress("glCreateShaderObjectARB"); + pglDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)SDL_GL_GetProcAddress("glDeleteObjectARB"); + pglGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)SDL_GL_GetProcAddress("glGetInfoLogARB"); + pglGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)SDL_GL_GetProcAddress("glGetObjectParameterivARB"); + pglGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)SDL_GL_GetProcAddress("glGetUniformLocationARB"); + pglLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)SDL_GL_GetProcAddress("glLinkProgramARB"); + pglShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)SDL_GL_GetProcAddress("glShaderSourceARB"); + pglUniform1iARB = (PFNGLUNIFORM1IARBPROC)SDL_GL_GetProcAddress("glUniform1iARB"); + pglUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)SDL_GL_GetProcAddress("glUseProgramObjectARB"); + if (pglAttachObjectARB && + pglCompileShaderARB && + pglCreateProgramObjectARB && + pglCreateShaderObjectARB && + pglDeleteObjectARB && + pglGetInfoLogARB && + pglGetObjectParameterivARB && + pglGetUniformLocationARB && + pglLinkProgramARB && + pglShaderSourceARB && + pglUniform1iARB && + pglUseProgramObjectARB) { shaders_supported = SDL_TRUE; } } @@ -284,7 +283,7 @@ static SDL_bool InitShaders() return SDL_TRUE; } -static void QuitShaders() +static void QuitShaders(void) { int i; @@ -306,7 +305,7 @@ power_of_two(int input) } GLuint -SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) +SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) { GLuint texture; int w, h; @@ -317,10 +316,10 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) /* Use the surface width and height expanded to powers of 2 */ w = power_of_two(surface->w); h = power_of_two(surface->h); - texcoord[0] = 0.0f; /* Min X */ - texcoord[1] = 0.0f; /* Min Y */ - texcoord[2] = (GLfloat) surface->w / w; /* Max X */ - texcoord[3] = (GLfloat) surface->h / h; /* Max Y */ + texcoord[0] = 0.0f; /* Min X */ + texcoord[1] = 0.0f; /* Min Y */ + texcoord[2] = (GLfloat)surface->w / w; /* Max X */ + texcoord[3] = (GLfloat)surface->h / h; /* Max Y */ image = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */ @@ -330,8 +329,8 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF #endif - ); - if (image == NULL) { + ); + if (!image) { return 0; } @@ -357,25 +356,25 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image->pixels); - SDL_FreeSurface(image); /* No longer needed */ + SDL_FreeSurface(image); /* No longer needed */ return texture; } /* A general OpenGL initialization function. Sets all of the initial parameters. */ -void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */ +void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */ { GLdouble aspect; glViewport(0, 0, Width, Height); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /* This Will Clear The Background Color To Black */ - glClearDepth(1.0); /* Enables Clearing Of The Depth Buffer */ - glDepthFunc(GL_LESS); /* The Type Of Depth Test To Do */ - glEnable(GL_DEPTH_TEST); /* Enables Depth Testing */ - glShadeModel(GL_SMOOTH); /* Enables Smooth Color Shading */ + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /* This Will Clear The Background Color To Black */ + glClearDepth(1.0); /* Enables Clearing Of The Depth Buffer */ + glDepthFunc(GL_LESS); /* The Type Of Depth Test To Do */ + glEnable(GL_DEPTH_TEST); /* Enables Depth Testing */ + glShadeModel(GL_SMOOTH); /* Enables Smooth Color Shading */ glMatrixMode(GL_PROJECTION); - glLoadIdentity(); /* Reset The Projection Matrix */ + glLoadIdentity(); /* Reset The Projection Matrix */ aspect = (GLdouble)Width / Height; glOrtho(-3.0, 3.0, -3.0 / aspect, 3.0 / aspect, 0.0, 1.0); @@ -384,32 +383,33 @@ void InitGL(int Width, int Height) /* We call this right afte } /* The main drawing function. */ -void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord) +void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat *texcoord) { /* Texture coordinate lookup, to make it simple */ - enum { + enum + { MINX, MINY, MAXX, MAXY }; - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Clear The Screen And The Depth Buffer */ - glLoadIdentity(); /* Reset The View */ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Clear The Screen And The Depth Buffer */ + glLoadIdentity(); /* Reset The View */ - glTranslatef(-1.5f,0.0f,0.0f); /* Move Left 1.5 Units */ + glTranslatef(-1.5f, 0.0f, 0.0f); /* Move Left 1.5 Units */ /* draw a triangle (in smooth coloring mode) */ - glBegin(GL_POLYGON); /* start drawing a polygon */ - glColor3f(1.0f,0.0f,0.0f); /* Set The Color To Red */ - glVertex3f( 0.0f, 1.0f, 0.0f); /* Top */ - glColor3f(0.0f,1.0f,0.0f); /* Set The Color To Green */ - glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */ - glColor3f(0.0f,0.0f,1.0f); /* Set The Color To Blue */ - glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */ - glEnd(); /* we're done with the polygon (smooth color interpolation) */ + glBegin(GL_POLYGON); /* start drawing a polygon */ + glColor3f(1.0f, 0.0f, 0.0f); /* Set The Color To Red */ + glVertex3f(0.0f, 1.0f, 0.0f); /* Top */ + glColor3f(0.0f, 1.0f, 0.0f); /* Set The Color To Green */ + glVertex3f(1.0f, -1.0f, 0.0f); /* Bottom Right */ + glColor3f(0.0f, 0.0f, 1.0f); /* Set The Color To Blue */ + glVertex3f(-1.0f, -1.0f, 0.0f); /* Bottom Left */ + glEnd(); /* we're done with the polygon (smooth color interpolation) */ - glTranslatef(3.0f,0.0f,0.0f); /* Move Right 3 Units */ + glTranslatef(3.0f, 0.0f, 0.0f); /* Move Right 3 Units */ /* Enable blending */ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -419,24 +419,24 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord) /* draw a textured square (quadrilateral) */ glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture); - glColor3f(1.0f,1.0f,1.0f); + glColor3f(1.0f, 1.0f, 1.0f); if (shaders_supported) { - glUseProgramObjectARB(shaders[current_shader].program); + pglUseProgramObjectARB(shaders[current_shader].program); } - glBegin(GL_QUADS); /* start drawing a polygon (4 sided) */ + glBegin(GL_QUADS); /* start drawing a polygon (4 sided) */ glTexCoord2f(texcoord[MINX], texcoord[MINY]); - glVertex3f(-1.0f, 1.0f, 0.0f); /* Top Left */ + glVertex3f(-1.0f, 1.0f, 0.0f); /* Top Left */ glTexCoord2f(texcoord[MAXX], texcoord[MINY]); - glVertex3f( 1.0f, 1.0f, 0.0f); /* Top Right */ + glVertex3f(1.0f, 1.0f, 0.0f); /* Top Right */ glTexCoord2f(texcoord[MAXX], texcoord[MAXY]); - glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */ + glVertex3f(1.0f, -1.0f, 0.0f); /* Bottom Right */ glTexCoord2f(texcoord[MINX], texcoord[MAXY]); - glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */ - glEnd(); /* done with the polygon */ + glVertex3f(-1.0f, -1.0f, 0.0f); /* Bottom Left */ + glEnd(); /* done with the polygon */ if (shaders_supported) { - glUseProgramObjectARB(0); + pglUseProgramObjectARB(0); } glDisable(GL_TEXTURE_2D); @@ -456,27 +456,27 @@ int main(int argc, char **argv) SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); /* Initialize SDL for video output */ - if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { + if (SDL_Init(SDL_INIT_VIDEO) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to initialize SDL: %s\n", SDL_GetError()); exit(1); } /* Create a 640x480 OpenGL screen */ - window = SDL_CreateWindow( "Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL ); - if ( !window ) { + window = SDL_CreateWindow("Shader Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL); + if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL window: %s\n", SDL_GetError()); SDL_Quit(); exit(2); } - if ( !SDL_GL_CreateContext(window)) { + if (!SDL_GL_CreateContext(window)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create OpenGL context: %s\n", SDL_GetError()); SDL_Quit(); exit(2); } surface = SDL_LoadBMP("icon.bmp"); - if ( ! surface ) { + if (!surface) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load icon.bmp: %s\n", SDL_GetError()); SDL_Quit(); exit(3); @@ -492,20 +492,21 @@ int main(int argc, char **argv) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Shaders not supported!\n"); } done = 0; - while ( ! done ) { + while (!done) { DrawGLScene(window, texture, texcoords); /* This could go in a separate function */ - { SDL_Event event; - while ( SDL_PollEvent(&event) ) { - if ( event.type == SDL_QUIT ) { + { + SDL_Event event; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_QUIT) { done = 1; } - if ( event.type == SDL_KEYDOWN ) { - if ( event.key.keysym.sym == SDLK_SPACE ) { + if (event.type == SDL_KEYDOWN) { + if (event.key.keysym.sym == SDLK_SPACE) { current_shader = (current_shader + 1) % NUM_SHADERS; } - if ( event.key.keysym.sym == SDLK_ESCAPE ) { + if (event.key.keysym.sym == SDLK_ESCAPE) { done = 1; } } @@ -519,8 +520,7 @@ int main(int argc, char **argv) #else /* HAVE_OPENGL */ -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system\n"); return 1; diff --git a/test/testshape.c b/test/testshape.c index 1497528a976ab..3a84d2188e6c3 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -15,38 +15,39 @@ #include "SDL.h" #include "SDL_shape.h" -#define SHAPED_WINDOW_X 150 -#define SHAPED_WINDOW_Y 150 +#define SHAPED_WINDOW_X 150 +#define SHAPED_WINDOW_Y 150 #define SHAPED_WINDOW_DIMENSION 640 -typedef struct LoadedPicture { +typedef struct LoadedPicture +{ SDL_Surface *surface; SDL_Texture *texture; SDL_WindowShapeMode mode; - const char* name; + const char *name; } LoadedPicture; -void render(SDL_Renderer *renderer,SDL_Texture *texture,SDL_Rect texture_dimensions) +void render(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect texture_dimensions) { /* Clear render-target to blue. */ - SDL_SetRenderDrawColor(renderer,0x00,0x00,0xff,0xff); + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0xff, 0xff); SDL_RenderClear(renderer); /* Render the texture. */ - SDL_RenderCopy(renderer,texture,&texture_dimensions,&texture_dimensions); + SDL_RenderCopy(renderer, texture, &texture_dimensions, &texture_dimensions); SDL_RenderPresent(renderer); } -int main(int argc,char** argv) +int main(int argc, char **argv) { Uint8 num_pictures; - LoadedPicture* pictures; + LoadedPicture *pictures; int i, j; - SDL_PixelFormat* format = NULL; + SDL_PixelFormat *format = NULL; SDL_Window *window; SDL_Renderer *renderer; - SDL_Color black = {0,0,0,0xff}; + SDL_Color black = { 0, 0, 0, 0xff }; SDL_Event event; int should_exit = 0; unsigned int current_picture; @@ -58,81 +59,88 @@ int main(int argc,char** argv) /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if(argc < 2) { + if (argc < 2) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Shape requires at least one bitmap file as argument."); exit(-1); } - if(SDL_VideoInit(NULL) == -1) { + if (SDL_VideoInit(NULL) == -1) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not initialize SDL video."); exit(-2); } num_pictures = argc - 1; - pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture)*num_pictures); + pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture) * num_pictures); if (!pictures) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not allocate memory."); exit(1); } - for(i=0;iformat; - if(SDL_ISPIXELFORMAT_ALPHA(format->format)) { + if (SDL_ISPIXELFORMAT_ALPHA(format->format)) { pictures[i].mode.mode = ShapeModeBinarizeAlpha; pictures[i].mode.parameters.binarizationCutoff = 255; - } - else { + } else { pictures[i].mode.mode = ShapeModeColorKey; pictures[i].mode.parameters.colorKey = black; } } window = SDL_CreateShapedWindow("SDL_Shape test", - SHAPED_WINDOW_X, SHAPED_WINDOW_Y, - SHAPED_WINDOW_DIMENSION,SHAPED_WINDOW_DIMENSION, - 0); + SHAPED_WINDOW_X, SHAPED_WINDOW_Y, + SHAPED_WINDOW_DIMENSION, SHAPED_WINDOW_DIMENSION, + 0); SDL_SetWindowPosition(window, SHAPED_WINDOW_X, SHAPED_WINDOW_Y); - if(window == NULL) { - for(i=0;i= num_pictures) + if (current_picture >= num_pictures) { current_picture = 0; + } SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Changing to shaped bmp: %s", pictures[current_picture].name); - SDL_QueryTexture(pictures[current_picture].texture,(Uint32 *)&pixelFormat,(int *)&access,&texture_dimensions.w,&texture_dimensions.h); - SDL_SetWindowSize(window,texture_dimensions.w,texture_dimensions.h); - SDL_SetWindowShape(window,pictures[current_picture].surface,&pictures[current_picture].mode); + SDL_QueryTexture(pictures[current_picture].texture, &pixelFormat, &access, &texture_dimensions.w, &texture_dimensions.h); + SDL_SetWindowSize(window, texture_dimensions.w, texture_dimensions.h); + SDL_SetWindowShape(window, pictures[current_picture].surface, &pictures[current_picture].mode); } if (event.type == SDL_QUIT) { should_exit = 1; break; } } - render(renderer,pictures[current_picture].texture,texture_dimensions); + render(renderer, pictures[current_picture].texture, texture_dimensions); SDL_Delay(10); } /* Free the textures. */ - for(i=0;i + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,8 +23,8 @@ #include "SDL_test_common.h" #include "testutils.h" -#define NUM_SPRITES 100 -#define MAX_SPEED 1 +#define NUM_SPRITES 100 +#define MAX_SPEED 1 static SDLTest_CommonState *state; static int num_sprites; @@ -64,8 +64,7 @@ quit(int rc) } } -int -LoadSprite(const char *file) +int LoadSprite(const char *file) { int i; @@ -73,21 +72,20 @@ LoadSprite(const char *file) /* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */ sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h); if (!sprites[i]) { - return (-1); + return -1; } if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError()); SDL_DestroyTexture(sprites[i]); - return (-1); + return -1; } } /* We're ready to roll. :) */ - return (0); + return 0; } -void -MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) +void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) { int i; SDL_Rect viewport, temp; @@ -107,8 +105,8 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) current_color = 255; cycle_direction = -cycle_direction; } - SDL_SetTextureColorMod(sprite, 255, (Uint8) current_color, - (Uint8) current_color); + SDL_SetTextureColorMod(sprite, 255, (Uint8)current_color, + (Uint8)current_color); } if (cycle_alpha) { current_alpha += cycle_direction; @@ -120,7 +118,7 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) current_alpha = 255; cycle_direction = -cycle_direction; } - SDL_SetTextureAlphaMod(sprite, (Uint8) current_alpha); + SDL_SetTextureAlphaMod(sprite, (Uint8)current_alpha); } /* Draw a gray background */ @@ -130,16 +128,16 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) /* Test points */ SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0x00, 0xFF); SDL_RenderDrawPoint(renderer, 0, 0); - SDL_RenderDrawPoint(renderer, viewport.w-1, 0); - SDL_RenderDrawPoint(renderer, 0, viewport.h-1); - SDL_RenderDrawPoint(renderer, viewport.w-1, viewport.h-1); + SDL_RenderDrawPoint(renderer, viewport.w - 1, 0); + SDL_RenderDrawPoint(renderer, 0, viewport.h - 1); + SDL_RenderDrawPoint(renderer, viewport.w - 1, viewport.h - 1); /* Test horizontal and vertical lines */ SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF); - SDL_RenderDrawLine(renderer, 1, 0, viewport.w-2, 0); - SDL_RenderDrawLine(renderer, 1, viewport.h-1, viewport.w-2, viewport.h-1); - SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h-2); - SDL_RenderDrawLine(renderer, viewport.w-1, 1, viewport.w-1, viewport.h-2); + SDL_RenderDrawLine(renderer, 1, 0, viewport.w - 2, 0); + SDL_RenderDrawLine(renderer, 1, viewport.h - 1, viewport.w - 2, viewport.h - 1); + SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h - 2); + SDL_RenderDrawLine(renderer, viewport.w - 1, 1, viewport.w - 1, viewport.h - 2); /* Test fill and copy */ SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF); @@ -180,20 +178,20 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderGeometry(renderer, NULL, verts, 3, NULL, 0); } SDL_RenderCopy(renderer, sprite, NULL, &temp); - temp.x = viewport.w-sprite_w-1; + temp.x = viewport.w - sprite_w - 1; temp.y = 1; temp.w = sprite_w; temp.h = sprite_h; SDL_RenderFillRect(renderer, &temp); SDL_RenderCopy(renderer, sprite, NULL, &temp); temp.x = 1; - temp.y = viewport.h-sprite_h-1; + temp.y = viewport.h - sprite_h - 1; temp.w = sprite_w; temp.h = sprite_h; SDL_RenderFillRect(renderer, &temp); SDL_RenderCopy(renderer, sprite, NULL, &temp); - temp.x = viewport.w-sprite_w-1; - temp.y = viewport.h-sprite_h-1; + temp.x = viewport.w - sprite_w - 1; + temp.y = viewport.h - sprite_h - 1; temp.w = sprite_w; temp.h = sprite_h; SDL_RenderFillRect(renderer, &temp); @@ -202,9 +200,9 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) /* Test diagonal lines */ SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF); SDL_RenderDrawLine(renderer, sprite_w, sprite_h, - viewport.w-sprite_w-2, viewport.h-sprite_h-2); - SDL_RenderDrawLine(renderer, viewport.w-sprite_w-2, sprite_h, - sprite_w, viewport.h-sprite_h-2); + viewport.w - sprite_w - 2, viewport.h - sprite_h - 2); + SDL_RenderDrawLine(renderer, viewport.w - sprite_w - 2, sprite_h, + sprite_w, viewport.h - sprite_h - 2); /* Conditionally move the sprites, bounce at the wall */ if (iterations == -1 || iterations > 0) { @@ -221,7 +219,6 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) velocity->y = -velocity->y; position->y += velocity->y; } - } /* Countdown sprite-move iterations and disable color changes at iteration end - used for visual tests. */ @@ -251,7 +248,7 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) * * Draw sprite2 as triangles that can be recombined as rect by software renderer */ - SDL_Vertex *verts = (SDL_Vertex *) SDL_malloc(num_sprites * sizeof (SDL_Vertex) * 6); + SDL_Vertex *verts = (SDL_Vertex *)SDL_malloc(num_sprites * sizeof(SDL_Vertex) * 6); SDL_Vertex *verts2 = verts; if (verts) { SDL_Color color; @@ -319,9 +316,9 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) * Draw sprite2 as triangles that can *not* be recombined as rect by software renderer * Use an 'indices' array */ - SDL_Vertex *verts = (SDL_Vertex *) SDL_malloc(num_sprites * sizeof (SDL_Vertex) * 5); + SDL_Vertex *verts = (SDL_Vertex *)SDL_malloc(num_sprites * sizeof(SDL_Vertex) * 5); SDL_Vertex *verts2 = verts; - int *indices = (int *) SDL_malloc(num_sprites * sizeof (int) * 4 * 3); + int *indices = (int *)SDL_malloc(num_sprites * sizeof(int) * 4 * 3); int *indices2 = indices; if (verts && indices) { int pos = 0; @@ -395,22 +392,30 @@ MoveSprites(SDL_Renderer * renderer, SDL_Texture * sprite) SDL_RenderPresent(renderer); } -void -loop() +static void MoveAllSprites(void) { - Uint32 now; int i; + + for (i = 0; i < state->num_windows; ++i) { + if (state->windows[i] == NULL) { + continue; + } + MoveSprites(state->renderers[i], sprites[i]); + } +} + +void loop(void) +{ + Uint32 now; SDL_Event event; /* Check for events */ while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); } - for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) - continue; - MoveSprites(state->renderers[i], sprites[i]); - } + + MoveAllSprites(); + #ifdef __EMSCRIPTEN__ if (done) { emscripten_cancel_main_loop(); @@ -422,16 +427,22 @@ loop() if (SDL_TICKS_PASSED(now, next_fps_check)) { /* Print out some timing information */ const Uint32 then = next_fps_check - fps_check_delay; - const double fps = ((double) frames * 1000) / (now - then); + const double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); next_fps_check = now + fps_check_delay; frames = 0; } +} +static int SDLCALL ExposeEventWatcher(void *userdata, SDL_Event *event) +{ + if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_EXPOSED) { + MoveAllSprites(); + } + return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; Uint64 seed; @@ -474,7 +485,9 @@ main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i], "--iterations") == 0) { if (argv[i + 1]) { iterations = SDL_atoi(argv[i + 1]); - if (iterations < -1) iterations = -1; + if (iterations < -1) { + iterations = -1; + } consumed = 2; } } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { @@ -514,7 +527,8 @@ main(int argc, char *argv[]) "[--use-rendergeometry mode1|mode2]", "[num_sprites]", "[icon.bmp]", - NULL }; + NULL + }; SDLTest_CommonLogUsage(state, argv[0], options); quit(1); } @@ -526,7 +540,7 @@ main(int argc, char *argv[]) /* Create the windows, initialize the renderers, and load the textures */ sprites = - (SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites)); + (SDL_Texture **)SDL_malloc(state->num_windows * sizeof(*sprites)); if (!sprites) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); @@ -541,8 +555,8 @@ main(int argc, char *argv[]) } /* Allocate memory for the sprite info */ - positions = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect)); - velocities = (SDL_Rect *) SDL_malloc(num_sprites * sizeof(SDL_Rect)); + positions = (SDL_Rect *)SDL_malloc(num_sprites * sizeof(SDL_Rect)); + velocities = (SDL_Rect *)SDL_malloc(num_sprites * sizeof(SDL_Rect)); if (!positions || !velocities) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n"); quit(2); @@ -570,6 +584,9 @@ main(int argc, char *argv[]) } } + /* Add an event watcher to redraw from within modal window resize/move loops */ + SDL_AddEventWatch(ExposeEventWatcher, NULL); + /* Main render loop */ frames = 0; next_fps_check = SDL_GetTicks() + fps_check_delay; diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index 6be99fd4a887f..faa2dc83d58da 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -22,10 +22,10 @@ #include "SDL.h" #include "testutils.h" -#define WINDOW_WIDTH 640 -#define WINDOW_HEIGHT 480 -#define NUM_SPRITES 100 -#define MAX_SPEED 1 +#define WINDOW_WIDTH 640 +#define WINDOW_HEIGHT 480 +#define NUM_SPRITES 100 +#define MAX_SPEED 1 static SDL_Texture *sprite; static SDL_Rect positions[NUM_SPRITES]; @@ -43,8 +43,7 @@ quit(int rc) exit(rc); } -void -MoveSprites() +void MoveSprites(void) { int i; int window_w = WINDOW_WIDTH; @@ -78,7 +77,7 @@ MoveSprites() SDL_RenderPresent(renderer); } -void loop() +void loop(void) { SDL_Event event; @@ -96,13 +95,11 @@ void loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Window *window; int i; - /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); @@ -112,7 +109,7 @@ main(int argc, char *argv[]) sprite = LoadTexture(renderer, "icon.bmp", SDL_TRUE, &sprite_w, &sprite_h); - if (sprite == NULL) { + if (!sprite) { quit(2); } diff --git a/test/teststreaming.c b/test/teststreaming.c index dc3ae61d63519..65686c9de550e 100644 --- a/test/teststreaming.c +++ b/test/teststreaming.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -28,9 +28,10 @@ #define MOOSEPIC_W 64 #define MOOSEPIC_H 88 -#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) +#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H) #define MOOSEFRAMES_COUNT 10 +/* *INDENT-OFF* */ /* clang-format off */ SDL_Color MooseColors[84] = { {49, 49, 49, 255}, {66, 24, 0, 255}, {66, 33, 0, 255}, {66, 66, 66, 255}, {66, 115, 49, 255}, {74, 33, 0, 255}, {74, 41, 16, 255}, {82, 33, 8, 255}, @@ -54,6 +55,7 @@ SDL_Color MooseColors[84] = { {214, 173, 140, 255}, {222, 181, 148, 255}, {222, 189, 132, 255}, {222, 189, 156, 255}, {222, 222, 222, 255}, {231, 198, 165, 255}, {231, 231, 231, 255}, {239, 206, 173, 255} }; +/* *INDENT-ON* */ /* clang-format on */ Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE]; @@ -83,17 +85,16 @@ void UpdateTexture(SDL_Texture *texture) } src = MooseFrames[frame]; for (row = 0; row < MOOSEPIC_H; ++row) { - dst = (Uint32*)((Uint8*)pixels + row * pitch); + dst = (Uint32 *)((Uint8 *)pixels + row * pitch); for (col = 0; col < MOOSEPIC_W; ++col) { color = &MooseColors[*src++]; - *dst++ = (0xFF000000|(color->r<<16)|(color->g<<8)|color->b); + *dst++ = (0xFF000000 | (color->r << 16) | (color->g << 8) | color->b); } } SDL_UnlockTexture(texture); } -void -loop() +void loop(void) { SDL_Event event; @@ -124,8 +125,7 @@ loop() #endif } -int -main(int argc, char **argv) +int main(int argc, char **argv) { SDL_Window *window; SDL_RWops *handle; @@ -141,25 +141,24 @@ main(int argc, char **argv) /* load the moose images */ filename = GetResourceFilename(NULL, "moose.dat"); - if (filename == NULL) { + if (!filename) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory\n"); return -1; } handle = SDL_RWFromFile(filename, "rb"); SDL_free(filename); - if (handle == NULL) { + if (!handle) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Can't find the file moose.dat !\n"); quit(2); } SDL_RWread(handle, MooseFrames, MOOSEFRAME_SIZE, MOOSEFRAMES_COUNT); SDL_RWclose(handle); - /* Create the window and renderer */ window = SDL_CreateWindow("Happy Moose", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - MOOSEPIC_W*4, MOOSEPIC_H*4, + MOOSEPIC_W * 4, MOOSEPIC_H * 4, SDL_WINDOW_RESIZABLE); if (!window) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set create window: %s\n", SDL_GetError()); @@ -186,7 +185,7 @@ main(int argc, char **argv) #else while (!done) { loop(); - } + } #endif SDL_DestroyRenderer(renderer); diff --git a/test/testsurround.c b/test/testsurround.c index 1537b35fe2230..8a118f79e3659 100644 --- a/test/testsurround.c +++ b/test/testsurround.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -14,20 +14,21 @@ #include "SDL_config.h" #include "SDL.h" +#include "SDL_test.h" static int total_channels; static int active_channel; -#define SAMPLE_RATE_HZ 48000 -#define QUICK_TEST_TIME_MSEC 100 +#define SAMPLE_RATE_HZ 48000 +#define QUICK_TEST_TIME_MSEC 100 #define CHANNEL_TEST_TIME_SEC 5 -#define MAX_AMPLITUDE SDL_MAX_SINT16 +#define MAX_AMPLITUDE SDL_MAX_SINT16 -#define SINE_FREQ_HZ 500 +#define SINE_FREQ_HZ 500 #define LFE_SINE_FREQ_HZ 50 /* The channel layout is defined in SDL_audio.h */ -const char* +const char * get_channel_name(int channel_index, int channel_count) { switch (channel_index) { @@ -38,6 +39,7 @@ get_channel_name(int channel_index, int channel_count) case 2: switch (channel_count) { case 3: + case 5: return "Low Frequency Effects"; case 4: return "Back Left"; @@ -57,27 +59,32 @@ get_channel_name(int channel_index, int channel_count) switch (channel_count) { case 5: return "Back Right"; + case 6: + return "Side Left"; case 7: return "Back Center"; - case 6: case 8: return "Back Left"; } + SDL_assert(0); case 5: switch (channel_count) { - case 7: - return "Back Left"; case 6: + return "Side Right"; + case 7: + return "Side Left"; case 8: return "Back Right"; } + SDL_assert(0); case 6: switch (channel_count) { case 7: - return "Back Right"; + return "Side Right"; case 8: return "Side Left"; } + SDL_assert(0); case 7: return "Side Right"; } @@ -92,9 +99,9 @@ is_lfe_channel(int channel_index, int channel_count) } void SDLCALL -fill_buffer(void* unused, Uint8* stream, int len) +fill_buffer(void *unused, Uint8 *stream, int len) { - Sint16* buffer = (Sint16*)stream; + Sint16 *buffer = (Sint16 *)stream; int samples = len / sizeof(Sint16); static int total_samples = 0; int i; @@ -132,15 +139,25 @@ fill_buffer(void* unused, Uint8* stream, int len) } } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, SDL_INIT_AUDIO); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if (SDL_Init(SDL_INIT_AUDIO) < 0) { + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); return 1; } @@ -199,7 +216,7 @@ main(int argc, char *argv[]) SDL_CloseAudioDevice(dev); } - SDL_Quit(); + SDLTest_CommonQuit(state); return 0; } diff --git a/test/testthread.c b/test/testthread.c index ea94dfb2e6ad2..b099ae25a2ebd 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -17,15 +17,19 @@ #include #include "SDL.h" +#include "SDL_test.h" static SDL_TLSID tls; -static int alive = 0; +static SDL_Thread *thread = NULL; +static SDL_atomic_t alive; static int testprio = 0; +static SDLTest_CommonState *state; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void quit(int rc) { + SDLTest_CommonQuit(state); SDL_Quit(); exit(rc); } @@ -33,12 +37,15 @@ quit(int rc) static const char * getprioritystr(SDL_ThreadPriority priority) { - switch(priority) - { - case SDL_THREAD_PRIORITY_LOW: return "SDL_THREAD_PRIORITY_LOW"; - case SDL_THREAD_PRIORITY_NORMAL: return "SDL_THREAD_PRIORITY_NORMAL"; - case SDL_THREAD_PRIORITY_HIGH: return "SDL_THREAD_PRIORITY_HIGH"; - case SDL_THREAD_PRIORITY_TIME_CRITICAL: return "SDL_THREAD_PRIORITY_TIME_CRITICAL"; + switch (priority) { + case SDL_THREAD_PRIORITY_LOW: + return "SDL_THREAD_PRIORITY_LOW"; + case SDL_THREAD_PRIORITY_NORMAL: + return "SDL_THREAD_PRIORITY_NORMAL"; + case SDL_THREAD_PRIORITY_HIGH: + return "SDL_THREAD_PRIORITY_HIGH"; + case SDL_THREAD_PRIORITY_TIME_CRITICAL: + return "SDL_THREAD_PRIORITY_TIME_CRITICAL"; } return "???"; @@ -51,20 +58,21 @@ ThreadFunc(void *data) SDL_TLSSet(tls, "baby thread", NULL); SDL_Log("Started thread %s: My thread id is %lu, thread data = %s\n", - (char *) data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls)); - while (alive) { - SDL_Log("Thread '%s' is alive!\n", (char *) data); + (char *)data, SDL_ThreadID(), (const char *)SDL_TLSGet(tls)); + while (SDL_AtomicGet(&alive)) { + SDL_Log("Thread '%s' is alive!\n", (char *)data); if (testprio) { SDL_Log("SDL_SetThreadPriority(%s):%d\n", getprioritystr(prio), SDL_SetThreadPriority(prio)); - if (++prio > SDL_THREAD_PRIORITY_TIME_CRITICAL) + if (++prio > SDL_THREAD_PRIORITY_TIME_CRITICAL) { prio = SDL_THREAD_PRIORITY_LOW; + } } SDL_Delay(1 * 1000); } - SDL_Log("Thread '%s' exiting!\n", (char *) data); - return (0); + SDL_Log("Thread '%s' exiting!\n", (char *)data); + return 0; } static void @@ -72,23 +80,47 @@ killed(int sig) { SDL_Log("Killed with SIGTERM, waiting 5 seconds to exit\n"); SDL_Delay(5 * 1000); - alive = 0; + SDL_AtomicSet(&alive, 0); + SDL_WaitThread(thread, NULL); quit(0); } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { - int arg = 1; - SDL_Thread *thread; + int i; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - /* Load the SDL library */ - if (SDL_Init(0) < 0) { + /* Parse commandline */ + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (!consumed) { + if (SDL_strcmp("--prio", argv[i]) == 0) { + testprio = 1; + consumed = 1; + } + } + if (consumed <= 0) { + static const char *options[] = { "[--prio]", NULL }; + SDLTest_CommonLogUsage(state, argv[0], options); + exit(1); + } + + i += consumed; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } if (SDL_getenv("SDL_TESTS_QUICK") != NULL) { @@ -97,40 +129,33 @@ main(int argc, char *argv[]) return 0; } - while (argv[arg] && *argv[arg] == '-') { - if (SDL_strcmp(argv[arg], "--prio") == 0) { - testprio = 1; - } - ++arg; - } - tls = SDL_TLSCreate(); SDL_assert(tls); SDL_TLSSet(tls, "main thread", NULL); SDL_Log("Main thread data initially: %s\n", (const char *)SDL_TLSGet(tls)); - alive = 1; + SDL_AtomicSet(&alive, 1); thread = SDL_CreateThread(ThreadFunc, "One", "#1"); - if (thread == NULL) { + if (!thread) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } SDL_Delay(5 * 1000); SDL_Log("Waiting for thread #1\n"); - alive = 0; + SDL_AtomicSet(&alive, 0); SDL_WaitThread(thread, NULL); SDL_Log("Main thread data finally: %s\n", (const char *)SDL_TLSGet(tls)); - alive = 1; - signal(SIGTERM, killed); + SDL_AtomicSet(&alive, 1); + (void)signal(SIGTERM, killed); thread = SDL_CreateThread(ThreadFunc, "Two", "#2"); - if (thread == NULL) { + if (!thread) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); quit(1); } - raise(SIGTERM); + (void)raise(SIGTERM); - SDL_Quit(); /* Never reached */ - return (0); /* Never reached */ + SDLTest_CommonQuit(state); /* Never reached */ + return 0; /* Never reached */ } diff --git a/test/testtimer.c b/test/testtimer.c index 126ba3be2ce92..05219227c4414 100644 --- a/test/testtimer.c +++ b/test/testtimer.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -18,8 +18,37 @@ #include #include "SDL.h" - -#define DEFAULT_RESOLUTION 1 +#include "SDL_test.h" + +#define DEFAULT_RESOLUTION 1 + +static int test_sdl_delay_within_bounds(void) { + const int testDelay = 100; + const int marginOfError = 25; + Uint64 result; + Uint64 result2; + Sint64 difference; + + SDLTest_ResetAssertSummary(); + + /* Get ticks count - should be non-zero by now */ + result = SDL_GetTicks(); + SDLTest_AssertPass("Call to SDL_GetTicks()"); + SDLTest_AssertCheck(result > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result); + + /* Delay a bit longer and measure ticks and verify difference */ + SDL_Delay(testDelay); + SDLTest_AssertPass("Call to SDL_Delay(%d)", testDelay); + result2 = SDL_GetTicks(); + SDLTest_AssertPass("Call to SDL_GetTicks()"); + SDLTest_AssertCheck(result2 > 0, "Check result value, expected: >0, got: %" SDL_PRIu64, result2); + difference = result2 - result; + SDLTest_AssertCheck(difference > (testDelay - marginOfError), "Check difference, expected: >%d, got: %" SDL_PRIu64, testDelay - marginOfError, difference); + /* Disabled because this might fail on non-interactive systems. */ + SDLTest_AssertCheck(difference < (testDelay + marginOfError), "Check difference, expected: <%d, got: %" SDL_PRIu64, testDelay + marginOfError, difference); + + return SDLTest_AssertSummaryToTestResult() == TEST_RESULT_PASSED ? 0 : 1; +} static int ticks = 0; @@ -27,31 +56,69 @@ static Uint32 SDLCALL ticktock(Uint32 interval, void *param) { ++ticks; - return (interval); + return interval; } static Uint32 SDLCALL callback(Uint32 interval, void *param) { - SDL_Log("Timer %" SDL_PRIu32 " : param = %d\n", interval, (int) (uintptr_t) param); + int value = (int)(uintptr_t)param; + SDL_assert( value == 1 || value == 2 || value == 3 ); + SDL_Log("Timer %" SDL_PRIu32 " : param = %d\n", interval, value); return interval; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { - int i, desired; + int i; + int desired = -1; SDL_TimerID t1, t2, t3; Uint64 start64, now64; Uint32 start32, now32; Uint64 start, now; + SDL_bool run_interactive_tests = SDL_FALSE; + int return_code = 0; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, SDL_INIT_TIMER); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - if (SDL_Init(SDL_INIT_TIMER) < 0) { + /* Parse commandline */ + for (i = 1; i < argc;) { + int consumed; + + consumed = SDLTest_CommonArg(state, i); + if (!consumed) { + if (SDL_strcmp("--interactive", argv[i]) == 0) { + run_interactive_tests = SDL_TRUE; + consumed = 1; + } else if (desired < 0) { + char *endptr; + + desired = SDL_strtoul(argv[i], &endptr, 0); + if (desired != 0 && endptr != argv[i] && *endptr == '\0') { + consumed = 1; + } + } + } + if (consumed <= 0) { + static const char *options[] = { "[--interactive]", "[interval]", NULL }; + SDLTest_CommonLogUsage(state, argv[0], options); + exit(1); + } + + i += consumed; + } + + if (!SDLTest_CommonInit(state)) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } if (SDL_getenv("SDL_TESTS_QUICK") != NULL) { @@ -75,14 +142,11 @@ main(int argc, char *argv[]) } } - /* Start the timer */ - desired = 0; - if (argv[1]) { - desired = SDL_atoi(argv[1]); - } - if (desired == 0) { + if (desired < 0) { desired = DEFAULT_RESOLUTION; } + + /* Start the timer */ t1 = SDL_AddTimer(desired, ticktock, NULL); /* Wait 10 seconds */ @@ -95,20 +159,26 @@ main(int argc, char *argv[]) /* Print the results */ if (ticks) { SDL_Log("Timer resolution: desired = %d ms, actual = %f ms\n", - desired, (double) (10 * 1000) / ticks); + desired, (double)(10 * 1000) / ticks); } /* Test multiple timers */ SDL_Log("Testing multiple timers...\n"); - t1 = SDL_AddTimer(100, callback, (void *) 1); - if (!t1) - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 1: %s\n", SDL_GetError()); - t2 = SDL_AddTimer(50, callback, (void *) 2); - if (!t2) - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 2: %s\n", SDL_GetError()); - t3 = SDL_AddTimer(233, callback, (void *) 3); - if (!t3) - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,"Could not create timer 3: %s\n", SDL_GetError()); + t1 = SDL_AddTimer(100, callback, (void *)1); + if (!t1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 1: %s\n", SDL_GetError()); + return_code = 1; + } + t2 = SDL_AddTimer(50, callback, (void *)2); + if (!t2) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 2: %s\n", SDL_GetError()); + return_code = 1; + } + t3 = SDL_AddTimer(233, callback, (void *)3); + if (!t3) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not create timer 3: %s\n", SDL_GetError()); + return_code = 1; + } /* Wait 10 seconds */ SDL_Log("Waiting 10 seconds\n"); @@ -127,9 +197,9 @@ main(int argc, char *argv[]) ticktock(0, NULL); } now = SDL_GetPerformanceCounter(); - SDL_Log("1 million iterations of ticktock took %f ms\n", (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + SDL_Log("1 million iterations of ticktock took %f ms\n", (double)((now - start) * 1000) / SDL_GetPerformanceFrequency()); - SDL_Log("Performance counter frequency: %"SDL_PRIu64"\n", SDL_GetPerformanceFrequency()); + SDL_Log("Performance counter frequency: %" SDL_PRIu64 "\n", SDL_GetPerformanceFrequency()); start64 = SDL_GetTicks64(); start32 = SDL_GetTicks(); start = SDL_GetPerformanceCounter(); @@ -137,10 +207,13 @@ main(int argc, char *argv[]) now = SDL_GetPerformanceCounter(); now64 = SDL_GetTicks64(); now32 = SDL_GetTicks(); - SDL_Log("Delay 1 second = %d ms in ticks, %d ms in ticks64, %f ms according to performance counter\n", (int) (now32-start32), (int) (now64-start64), (double)((now - start)*1000) / SDL_GetPerformanceFrequency()); + SDL_Log("Delay 1 second = %d ms in ticks, %d ms in ticks64, %f ms according to performance counter\n", (int)(now32 - start32), (int)(now64 - start64), (double)((now - start) * 1000) / SDL_GetPerformanceFrequency()); - SDL_Quit(); - return (0); + if (run_interactive_tests) { + return_code |= test_sdl_delay_within_bounds(); + } + SDLTest_CommonQuit(state); + return return_code; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testurl.c b/test/testurl.c index 390976e1eed87..6791557aeb7d1 100644 --- a/test/testurl.c +++ b/test/testurl.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/testutils.c b/test/testutils.c index a93afc1ad314d..ed8b7d7949ace 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -1,7 +1,14 @@ /* -Copyright 1997-2022 Sam Lantinga -Copyright 2022 Collabora Ltd. -SPDX-License-Identifier: Zlib + Copyright (C) 1997-2025 Sam Lantinga + Copyright 2022 Collabora Ltd. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. */ #include "testutils.h" @@ -21,19 +28,19 @@ GetNearbyFilename(const char *file) base = SDL_GetBasePath(); - if (base != NULL) { + if (base) { SDL_RWops *rw; size_t len = SDL_strlen(base) + SDL_strlen(file) + 1; path = SDL_malloc(len); - if (path == NULL) { + if (!path) { SDL_free(base); SDL_OutOfMemory(); return NULL; } - SDL_snprintf(path, len, "%s%s", base, file); + (void)SDL_snprintf(path, len, "%s%s", base, file); SDL_free(base); rw = SDL_RWFromFile(path, "rb"); @@ -47,7 +54,7 @@ GetNearbyFilename(const char *file) } path = SDL_strdup(file); - if (path == NULL) { + if (!path) { SDL_OutOfMemory(); } return path; @@ -65,10 +72,10 @@ GetNearbyFilename(const char *file) char * GetResourceFilename(const char *user_specified, const char *def) { - if (user_specified != NULL) { + if (user_specified) { char *ret = SDL_strdup(user_specified); - if (ret == NULL) { + if (!ret) { SDL_OutOfMemory(); } @@ -98,12 +105,12 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, path = GetNearbyFilename(file); - if (path != NULL) { + if (path) { file = path; } temp = SDL_LoadBMP(file); - if (temp == NULL) { + if (!temp) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s", file, SDL_GetError()); } else { /* Set transparent pixel as the pixel at (0,0) */ @@ -114,27 +121,27 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, switch (temp->format->BitsPerPixel) { case 15: SDL_SetColorKey(temp, SDL_TRUE, - (*(Uint16 *) temp->pixels) & 0x00007FFF); + (*(Uint16 *)temp->pixels) & 0x00007FFF); break; case 16: - SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *) temp->pixels); + SDL_SetColorKey(temp, SDL_TRUE, *(Uint16 *)temp->pixels); break; case 24: SDL_SetColorKey(temp, SDL_TRUE, - (*(Uint32 *) temp->pixels) & 0x00FFFFFF); + (*(Uint32 *)temp->pixels) & 0x00FFFFFF); break; case 32: - SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *) temp->pixels); + SDL_SetColorKey(temp, SDL_TRUE, *(Uint32 *)temp->pixels); break; } } } - if (width_out != NULL) { + if (width_out) { *width_out = temp->w; } - if (height_out != NULL) { + if (height_out) { *height_out = temp->h; } diff --git a/test/testutils.h b/test/testutils.h index cf24ca0437a49..ee32b0bb228ae 100644 --- a/test/testutils.h +++ b/test/testutils.h @@ -1,7 +1,14 @@ /* -Copyright 1997-2022 Sam Lantinga -Copyright 2022 Collabora Ltd. -SPDX-License-Identifier: Zlib + Copyright (C) 1997-2025 Sam Lantinga + Copyright 2022 Collabora Ltd. + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. */ #ifndef TESTUTILS_H diff --git a/test/testver.c b/test/testver.c index cbbba7ec6d340..b51a32c5af705 100644 --- a/test/testver.c +++ b/test/testver.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -19,16 +19,32 @@ #include "SDL.h" #include "SDL_revision.h" +#include "SDL_test.h" -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_version compiled; SDL_version linked; + SDLTest_CommonState *state; + + state = SDLTest_CommonCreateState(argv, 0); + if (!state) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLTest_CommonCreateState failed: %s\n", SDL_GetError()); + return 1; + } /* Enable standard application logging */ SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { + return 1; + } + + if (!SDLTest_CommonInit(state)) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); + return 1; + } + #if SDL_VERSION_ATLEAST(2, 0, 0) SDL_Log("Compiled with SDL 2.0 or newer\n"); #else @@ -36,12 +52,13 @@ main(int argc, char *argv[]) #endif SDL_VERSION(&compiled); SDL_Log("Compiled version: %d.%d.%d (%s)\n", - compiled.major, compiled.minor, compiled.patch, - SDL_REVISION); + compiled.major, compiled.minor, compiled.patch, + SDL_REVISION); SDL_GetVersion(&linked); SDL_Log("Linked version: %d.%d.%d (%s)\n", - linked.major, linked.minor, linked.patch, - SDL_GetRevision()); - SDL_Quit(); - return (0); + linked.major, linked.minor, linked.patch, + SDL_GetRevision()); + + SDLTest_CommonQuit(state); + return 0; } diff --git a/test/testviewport.c b/test/testviewport.c index ad5faf77a7f9b..83fa2b0963e38 100644 --- a/test/testviewport.c +++ b/test/testviewport.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -42,43 +42,42 @@ quit(int rc) exit(rc); } -void -DrawOnViewport(SDL_Renderer * renderer) -{ +void DrawOnViewport(SDL_Renderer *renderer) +{ SDL_Rect rect; /* Set the viewport */ SDL_RenderSetViewport(renderer, &viewport); - + /* Draw a gray background */ SDL_SetRenderDrawColor(renderer, 0x80, 0x80, 0x80, 0xFF); SDL_RenderClear(renderer); /* Test inside points */ SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0x00, 0xFF); - SDL_RenderDrawPoint(renderer, viewport.h/2 + 20, viewport.w/2); - SDL_RenderDrawPoint(renderer, viewport.h/2 - 20, viewport.w/2); - SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 - 20); - SDL_RenderDrawPoint(renderer, viewport.h/2 , viewport.w/2 + 20); + SDL_RenderDrawPoint(renderer, viewport.h / 2 + 20, viewport.w / 2); + SDL_RenderDrawPoint(renderer, viewport.h / 2 - 20, viewport.w / 2); + SDL_RenderDrawPoint(renderer, viewport.h / 2, viewport.w / 2 - 20); + SDL_RenderDrawPoint(renderer, viewport.h / 2, viewport.w / 2 + 20); /* Test horizontal and vertical lines */ SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF); - SDL_RenderDrawLine(renderer, 1, 0, viewport.w-2, 0); - SDL_RenderDrawLine(renderer, 1, viewport.h-1, viewport.w-2, viewport.h-1); - SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h-2); - SDL_RenderDrawLine(renderer, viewport.w-1, 1, viewport.w-1, viewport.h-2); + SDL_RenderDrawLine(renderer, 1, 0, viewport.w - 2, 0); + SDL_RenderDrawLine(renderer, 1, viewport.h - 1, viewport.w - 2, viewport.h - 1); + SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h - 2); + SDL_RenderDrawLine(renderer, viewport.w - 1, 1, viewport.w - 1, viewport.h - 2); /* Test diagonal lines */ SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0xFF, 0xFF); - SDL_RenderDrawLine(renderer, 0, 0, viewport.w-1, viewport.h-1); - SDL_RenderDrawLine(renderer, viewport.w-1, 0, 0, viewport.h-1); + SDL_RenderDrawLine(renderer, 0, 0, viewport.w - 1, viewport.h - 1); + SDL_RenderDrawLine(renderer, viewport.w - 1, 0, 0, viewport.h - 1); /* Test outside points */ SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0x00, 0xFF); - SDL_RenderDrawPoint(renderer, viewport.h/2 + viewport.h, viewport.w/2); - SDL_RenderDrawPoint(renderer, viewport.h/2 - viewport.h, viewport.w/2); - SDL_RenderDrawPoint(renderer, viewport.h/2, viewport.w/2 - viewport.w); - SDL_RenderDrawPoint(renderer, viewport.h/2, viewport.w/2 + viewport.w); + SDL_RenderDrawPoint(renderer, viewport.h / 2 + viewport.h, viewport.w / 2); + SDL_RenderDrawPoint(renderer, viewport.h / 2 - viewport.h, viewport.w / 2); + SDL_RenderDrawPoint(renderer, viewport.h / 2, viewport.w / 2 - viewport.w); + SDL_RenderDrawPoint(renderer, viewport.h / 2, viewport.w / 2 + viewport.w); /* Add a box at the top */ rect.w = 8; @@ -96,15 +95,15 @@ DrawOnViewport(SDL_Renderer * renderer) SDL_RenderSetClipRect(renderer, NULL); } -void -loop() +void loop(void) { SDL_Event event; int i; #ifdef __EMSCRIPTEN__ /* Avoid using delays */ - if(SDL_GetTicks() - wait_start < 1000) + if (SDL_GetTicks() - wait_start < 1000) { return; + } wait_start = SDL_GetTicks(); #endif /* Check for events */ @@ -121,8 +120,9 @@ loop() SDL_Log("Current Viewport x=%i y=%i w=%i h=%i", viewport.x, viewport.y, viewport.w, viewport.h); for (i = 0; i < state->num_windows; ++i) { - if (state->windows[i] == NULL) + if (state->windows[i] == NULL) { continue; + } /* Draw using viewport */ DrawOnViewport(state->renderers[i]); @@ -145,8 +145,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; Uint32 then, now, frames; @@ -157,7 +156,6 @@ main(int argc, char *argv[]) return 1; } - for (i = 1; i < argc;) { int consumed; @@ -182,7 +180,7 @@ main(int argc, char *argv[]) sprite = LoadTexture(state->renderers[0], "icon.bmp", SDL_TRUE, &sprite_w, &sprite_h); - if (sprite == NULL) { + if (!sprite) { quit(2); } @@ -222,7 +220,7 @@ main(int argc, char *argv[]) /* Print out some timing information */ now = SDL_GetTicks(); if (now > then) { - double fps = ((double) frames * 1000) / (now - then); + double fps = ((double)frames * 1000) / (now - then); SDL_Log("%2.2f frames per second\n", fps); } quit(0); diff --git a/test/testvulkan.c b/test/testvulkan.c index 4b65179c138d2..ad09f82cd5a32 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -84,8 +84,8 @@ int main(int argc, char *argv[]) VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfacePresentModesKHR) \ VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceSupportKHR) -#define VULKAN_DEVICE_FUNCTION(name) static PFN_##name name = NULL; -#define VULKAN_GLOBAL_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_DEVICE_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_GLOBAL_FUNCTION(name) static PFN_##name name = NULL; #define VULKAN_INSTANCE_FUNCTION(name) static PFN_##name name = NULL; VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION @@ -103,16 +103,18 @@ enum }; #endif #if VK_HEADER_VERSION < 38 -enum { +enum +{ VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000 }; #endif static const char *getVulkanResultString(VkResult result) { - switch((int) result) - { - #define RESULT_CASE(x) case x: return #x + switch ((int)result) { +#define RESULT_CASE(x) \ + case x: \ + return #x RESULT_CASE(VK_SUCCESS); RESULT_CASE(VK_NOT_READY); RESULT_CASE(VK_TIMEOUT); @@ -139,8 +141,9 @@ static const char *getVulkanResultString(VkResult result) RESULT_CASE(VK_ERROR_VALIDATION_FAILED_EXT); RESULT_CASE(VK_ERROR_OUT_OF_POOL_MEMORY_KHR); RESULT_CASE(VK_ERROR_INVALID_SHADER_NV); - #undef RESULT_CASE - default: break; +#undef RESULT_CASE + default: + break; } return (result < 0) ? "VK_ERROR_" : "VK_"; } @@ -176,7 +179,7 @@ typedef struct VulkanContext } VulkanContext; static SDLTest_CommonState *state; -static VulkanContext *vulkanContexts = NULL; // an array of state->num_windows items +static VulkanContext *vulkanContexts = NULL; // an array of state->num_windows items static VulkanContext *vulkanContext = NULL; // for the currently-rendering window static void shutdownVulkan(SDL_bool doDestroySwapchain); @@ -216,8 +219,8 @@ static void loadGlobalFunctions(void) static void createInstance(void) { - VkApplicationInfo appInfo = {0}; - VkInstanceCreateInfo instanceCreateInfo = {0}; + VkApplicationInfo appInfo = { 0 }; + VkInstanceCreateInfo instanceCreateInfo = { 0 }; const char **extensions = NULL; unsigned extensionCount = 0; VkResult result; @@ -232,13 +235,13 @@ static void createInstance(void) SDL_GetError()); quit(2); } - extensions = (const char **) SDL_malloc(sizeof(const char *) * extensionCount); + extensions = (const char **)SDL_malloc(sizeof(const char *) * extensionCount); if (!extensions) { SDL_OutOfMemory(); quit(2); } if (!SDL_Vulkan_GetInstanceExtensions(NULL, &extensionCount, extensions)) { - SDL_free((void*)extensions); + SDL_free((void *)extensions); SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Vulkan_GetInstanceExtensions(): %s\n", SDL_GetError()); @@ -247,7 +250,7 @@ static void createInstance(void) instanceCreateInfo.enabledExtensionCount = extensionCount; instanceCreateInfo.ppEnabledExtensionNames = extensions; result = vkCreateInstance(&instanceCreateInfo, NULL, &vulkanContext->instance); - SDL_free((void*)extensions); + SDL_free((void *)extensions); if (result != VK_SUCCESS) { vulkanContext->instance = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, @@ -277,8 +280,8 @@ static void loadInstanceFunctions(void) static void createSurface(void) { if (!SDL_Vulkan_CreateSurface(vulkanContext->window, - vulkanContext->instance, - &vulkanContext->surface)) { + vulkanContext->instance, + &vulkanContext->surface)) { vulkanContext->surface = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Vulkan_CreateSurface(): %s\n", SDL_GetError()); quit(2); @@ -308,7 +311,7 @@ static void findPhysicalDevice(void) "vkEnumeratePhysicalDevices(): no physical devices\n"); quit(2); } - physicalDevices = (VkPhysicalDevice *) SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount); + physicalDevices = (VkPhysicalDevice *)SDL_malloc(sizeof(VkPhysicalDevice) * physicalDeviceCount); if (!physicalDevices) { SDL_OutOfMemory(); quit(2); @@ -331,7 +334,7 @@ static void findPhysicalDevice(void) VkPhysicalDevice physicalDevice = physicalDevices[physicalDeviceIndex]; vkGetPhysicalDeviceProperties(physicalDevice, &vulkanContext->physicalDeviceProperties); - if(VK_VERSION_MAJOR(vulkanContext->physicalDeviceProperties.apiVersion) < 1) { + if (VK_VERSION_MAJOR(vulkanContext->physicalDeviceProperties.apiVersion) < 1) { continue; } vkGetPhysicalDeviceFeatures(physicalDevice, &vulkanContext->physicalDeviceFeatures); @@ -342,7 +345,7 @@ static void findPhysicalDevice(void) if (queueFamiliesPropertiesAllocatedSize < queueFamiliesCount) { SDL_free(queueFamiliesProperties); queueFamiliesPropertiesAllocatedSize = queueFamiliesCount; - queueFamiliesProperties = (VkQueueFamilyProperties *) SDL_malloc(sizeof(VkQueueFamilyProperties) * queueFamiliesPropertiesAllocatedSize); + queueFamiliesProperties = (VkQueueFamilyProperties *)SDL_malloc(sizeof(VkQueueFamilyProperties) * queueFamiliesPropertiesAllocatedSize); if (!queueFamiliesProperties) { SDL_free(physicalDevices); SDL_free(deviceExtensions); @@ -382,15 +385,14 @@ static void findPhysicalDevice(void) } } - if (vulkanContext->graphicsQueueFamilyIndex == queueFamiliesCount) { // no good queues found + if (vulkanContext->graphicsQueueFamilyIndex == queueFamiliesCount) { // no good queues found continue; } - if (vulkanContext->presentQueueFamilyIndex == queueFamiliesCount) { // no good queues found + if (vulkanContext->presentQueueFamilyIndex == queueFamiliesCount) { // no good queues found continue; } result = vkEnumerateDeviceExtensionProperties(physicalDevice, NULL, &deviceExtensionCount, NULL); - if (result != VK_SUCCESS) - { + if (result != VK_SUCCESS) { SDL_free(physicalDevices); SDL_free(queueFamiliesProperties); SDL_free(deviceExtensions); @@ -424,7 +426,7 @@ static void findPhysicalDevice(void) quit(2); } for (i = 0; i < deviceExtensionCount; i++) { - if(SDL_strcmp(deviceExtensions[i].extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { + if (SDL_strcmp(deviceExtensions[i].extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0) { hasSwapchainExtension = SDL_TRUE; break; } @@ -446,9 +448,9 @@ static void findPhysicalDevice(void) static void createDevice(void) { - VkDeviceQueueCreateInfo deviceQueueCreateInfo[1] = { {0} }; - static const float queuePriority[] = {1.0f}; - VkDeviceCreateInfo deviceCreateInfo = {0}; + VkDeviceQueueCreateInfo deviceQueueCreateInfo[1] = { { 0 } }; + static const float queuePriority[] = { 1.0f }; + VkDeviceCreateInfo deviceCreateInfo = { 0 }; static const char *const deviceExtensionNames[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME, }; @@ -512,7 +514,7 @@ static void createSemaphore(VkSemaphore *semaphore) { VkResult result; - VkSemaphoreCreateInfo createInfo = {0}; + VkSemaphoreCreateInfo createInfo = { 0 }; createInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; result = vkCreateSemaphore(vulkanContext->device, &createInfo, NULL, semaphore); if (result != VK_SUCCESS) { @@ -564,7 +566,7 @@ static void getSurfaceFormats(void) if (vulkanContext->surfaceFormatsCount > vulkanContext->surfaceFormatsAllocatedCount) { vulkanContext->surfaceFormatsAllocatedCount = vulkanContext->surfaceFormatsCount; SDL_free(vulkanContext->surfaceFormats); - vulkanContext->surfaceFormats = (VkSurfaceFormatKHR *) SDL_malloc(sizeof(VkSurfaceFormatKHR) * vulkanContext->surfaceFormatsAllocatedCount); + vulkanContext->surfaceFormats = (VkSurfaceFormatKHR *)SDL_malloc(sizeof(VkSurfaceFormatKHR) * vulkanContext->surfaceFormatsAllocatedCount); if (!vulkanContext->surfaceFormats) { vulkanContext->surfaceFormatsCount = 0; SDL_OutOfMemory(); @@ -622,26 +624,26 @@ static SDL_bool createSwapchain(void) { uint32_t i; int w, h; - VkSwapchainCreateInfoKHR createInfo = {0}; + VkSwapchainCreateInfoKHR createInfo = { 0 }; VkResult result; // pick an image count vulkanContext->swapchainDesiredImageCount = vulkanContext->surfaceCapabilities.minImageCount + 1; - if ( (vulkanContext->swapchainDesiredImageCount > vulkanContext->surfaceCapabilities.maxImageCount) && - (vulkanContext->surfaceCapabilities.maxImageCount > 0) ) { + if ((vulkanContext->swapchainDesiredImageCount > vulkanContext->surfaceCapabilities.maxImageCount) && + (vulkanContext->surfaceCapabilities.maxImageCount > 0)) { vulkanContext->swapchainDesiredImageCount = vulkanContext->surfaceCapabilities.maxImageCount; } // pick a format - if ( (vulkanContext->surfaceFormatsCount == 1) && - (vulkanContext->surfaceFormats[0].format == VK_FORMAT_UNDEFINED) ) { + if ((vulkanContext->surfaceFormatsCount == 1) && + (vulkanContext->surfaceFormats[0].format == VK_FORMAT_UNDEFINED)) { // aren't any preferred formats, so we pick vulkanContext->surfaceFormat.colorSpace = VK_COLORSPACE_SRGB_NONLINEAR_KHR; vulkanContext->surfaceFormat.format = VK_FORMAT_R8G8B8A8_UNORM; } else { vulkanContext->surfaceFormat = vulkanContext->surfaceFormats[0]; for (i = 0; i < vulkanContext->surfaceFormatsCount; i++) { - if(vulkanContext->surfaceFormats[i].format == VK_FORMAT_R8G8B8A8_UNORM) { + if (vulkanContext->surfaceFormats[i].format == VK_FORMAT_R8G8B8A8_UNORM) { vulkanContext->surfaceFormat = vulkanContext->surfaceFormats[i]; break; } @@ -653,13 +655,13 @@ static SDL_bool createSwapchain(void) // Clamp the size to the allowable image extent. // SDL_Vulkan_GetDrawableSize()'s result it not always in this range (bug #3287) - vulkanContext->swapchainSize.width = SDL_clamp((uint32_t) w, - vulkanContext->surfaceCapabilities.minImageExtent.width, - vulkanContext->surfaceCapabilities.maxImageExtent.width); + vulkanContext->swapchainSize.width = SDL_clamp((uint32_t)w, + vulkanContext->surfaceCapabilities.minImageExtent.width, + vulkanContext->surfaceCapabilities.maxImageExtent.width); - vulkanContext->swapchainSize.height = SDL_clamp((uint32_t) h, - vulkanContext->surfaceCapabilities.minImageExtent.height, - vulkanContext->surfaceCapabilities.maxImageExtent.height); + vulkanContext->swapchainSize.height = SDL_clamp((uint32_t)h, + vulkanContext->surfaceCapabilities.minImageExtent.height, + vulkanContext->surfaceCapabilities.maxImageExtent.height); if (w == 0 || h == 0) { return SDL_FALSE; @@ -687,7 +689,7 @@ static SDL_bool createSwapchain(void) vkDestroySwapchainKHR(vulkanContext->device, createInfo.oldSwapchain, NULL); } - if(result != VK_SUCCESS) { + if (result != VK_SUCCESS) { vulkanContext->swapchain = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "vkCreateSwapchainKHR(): %s\n", @@ -732,7 +734,7 @@ static void destroyCommandPool(void) static void createCommandPool(void) { VkResult result; - VkCommandPoolCreateInfo createInfo = {0}; + VkCommandPoolCreateInfo createInfo = { 0 }; createInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; createInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT; createInfo.queueFamilyIndex = vulkanContext->graphicsQueueFamilyIndex; @@ -749,14 +751,14 @@ static void createCommandPool(void) static void createCommandBuffers(void) { VkResult result; - VkCommandBufferAllocateInfo allocateInfo = {0}; + VkCommandBufferAllocateInfo allocateInfo = { 0 }; allocateInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO; allocateInfo.commandPool = vulkanContext->commandPool; allocateInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; allocateInfo.commandBufferCount = vulkanContext->swapchainImageCount; - vulkanContext->commandBuffers = (VkCommandBuffer *) SDL_malloc(sizeof(VkCommandBuffer) * vulkanContext->swapchainImageCount); + vulkanContext->commandBuffers = (VkCommandBuffer *)SDL_malloc(sizeof(VkCommandBuffer) * vulkanContext->swapchainImageCount); result = vkAllocateCommandBuffers(vulkanContext->device, &allocateInfo, vulkanContext->commandBuffers); - if(result != VK_SUCCESS) { + if (result != VK_SUCCESS) { SDL_free(vulkanContext->commandBuffers); vulkanContext->commandBuffers = NULL; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, @@ -777,12 +779,12 @@ static void createFences(void) } for (i = 0; i < vulkanContext->swapchainImageCount; i++) { VkResult result; - VkFenceCreateInfo createInfo = {0}; + VkFenceCreateInfo createInfo = { 0 }; createInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO; createInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT; result = vkCreateFence(vulkanContext->device, &createInfo, NULL, &vulkanContext->fences[i]); - if(result != VK_SUCCESS) { - for(; i > 0; i--) { + if (result != VK_SUCCESS) { + for (; i > 0; i--) { vkDestroyFence(vulkanContext->device, vulkanContext->fences[i - 1], NULL); } SDL_free(vulkanContext->fences); @@ -817,7 +819,7 @@ static void recordPipelineImageBarrier(VkCommandBuffer commandBuffer, VkImageLayout destLayout, VkImage image) { - VkImageMemoryBarrier barrier = {0}; + VkImageMemoryBarrier barrier = { 0 }; barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; barrier.srcAccessMask = sourceAccessMask; barrier.dstAccessMask = destAccessMask; @@ -847,11 +849,11 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * { VkCommandBuffer commandBuffer = vulkanContext->commandBuffers[frameIndex]; VkImage image = vulkanContext->swapchainImages[frameIndex]; - VkCommandBufferBeginInfo beginInfo = {0}; - VkImageSubresourceRange clearRange = {0}; + VkCommandBufferBeginInfo beginInfo = { 0 }; + VkImageSubresourceRange clearRange = { 0 }; VkResult result = vkResetCommandBuffer(commandBuffer, 0); - if(result != VK_SUCCESS) { + if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "vkResetCommandBuffer(): %s\n", getVulkanResultString(result)); @@ -895,7 +897,9 @@ static void rerecordCommandBuffer(uint32_t frameIndex, const VkClearColorValue * static void destroySwapchainAndSwapchainSpecificStuff(SDL_bool doDestroySwapchain) { - vkDeviceWaitIdle(vulkanContext->device); + if (vkDeviceWaitIdle != NULL) { + vkDeviceWaitIdle(vulkanContext->device); + } destroyFences(); destroyCommandBuffers(); destroyCommandPool(); @@ -909,7 +913,7 @@ static SDL_bool createNewSwapchainAndSwapchainSpecificStuff(void) destroySwapchainAndSwapchainSpecificStuff(SDL_FALSE); getSurfaceCaps(); getSurfaceFormats(); - if(!createSwapchain()) { + if (!createSwapchain()) { return SDL_FALSE; } createCommandPool(); @@ -924,7 +928,7 @@ static void initVulkan(void) SDL_Vulkan_LoadLibrary(NULL); - vulkanContexts = (VulkanContext *) SDL_calloc(state->num_windows, sizeof (VulkanContext)); + vulkanContexts = (VulkanContext *)SDL_calloc(state->num_windows, sizeof(VulkanContext)); if (!vulkanContexts) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); quit(2); @@ -992,24 +996,25 @@ static SDL_bool render(void) uint32_t frameIndex; VkResult result; double currentTime; - VkClearColorValue clearColor = { {0} }; + VkClearColorValue clearColor = { { 0 } }; VkPipelineStageFlags waitDestStageMask = VK_PIPELINE_STAGE_TRANSFER_BIT; - VkSubmitInfo submitInfo = {0}; - VkPresentInfoKHR presentInfo = {0}; + VkSubmitInfo submitInfo = { 0 }; + VkPresentInfoKHR presentInfo = { 0 }; int w, h; if (!vulkanContext->swapchain) { SDL_bool retval = createNewSwapchainAndSwapchainSpecificStuff(); - if(!retval) + if (!retval) { SDL_Delay(100); + } return retval; } result = vkAcquireNextImageKHR(vulkanContext->device, - vulkanContext->swapchain, - UINT64_MAX, - vulkanContext->imageAvailableSemaphore, - VK_NULL_HANDLE, - &frameIndex); + vulkanContext->swapchain, + UINT64_MAX, + vulkanContext->imageAvailableSemaphore, + VK_NULL_HANDLE, + &frameIndex); if (result == VK_ERROR_OUT_OF_DATE_KHR) { return createNewSwapchainAndSwapchainSpecificStuff(); } @@ -1068,7 +1073,7 @@ static SDL_bool render(void) quit(2); } SDL_Vulkan_GetDrawableSize(vulkanContext->window, &w, &h); - if(w != (int)vulkanContext->swapchainSize.width || h != (int)vulkanContext->swapchainSize.height) { + if (w != (int)vulkanContext->swapchainSize.width || h != (int)vulkanContext->swapchainSize.height) { return createNewSwapchainAndSwapchainSpecificStuff(); } return SDL_TRUE; @@ -1087,7 +1092,7 @@ int main(int argc, char **argv) /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); - if(!state) { + if (!state) { return 1; } @@ -1117,7 +1122,7 @@ int main(int argc, char **argv) while (!done) { /* Check for events */ frames++; - while(SDL_PollEvent(&event)) { + while (SDL_PollEvent(&event)) { /* Need to destroy the swapchain before the window created * by SDL. */ diff --git a/test/testwm2.c b/test/testwm2.c index eeb8d8e51fb4e..faa97a3cfa83b 100644 --- a/test/testwm2.c +++ b/test/testwm2.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -24,18 +24,18 @@ static SDLTest_CommonState *state; int done; static const char *cursorNames[] = { - "arrow", - "ibeam", - "wait", - "crosshair", - "waitarrow", - "sizeNWSE", - "sizeNESW", - "sizeWE", - "sizeNS", - "sizeALL", - "NO", - "hand", + "arrow", + "ibeam", + "wait", + "crosshair", + "waitarrow", + "sizeNWSE", + "sizeNESW", + "sizeWE", + "sizeNS", + "sizeALL", + "NO", + "hand", }; int system_cursor = -1; SDL_Cursor *cursor = NULL; @@ -83,12 +83,12 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_Rect viewport) y += lineHeight; - SDL_snprintf(text, sizeof(text), "Click on a mode to set it with SDL_SetWindowDisplayMode"); + SDL_strlcpy(text, "Click on a mode to set it with SDL_SetWindowDisplayMode", sizeof(text)); SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); SDLTest_DrawString(renderer, x, y, text); y += lineHeight; - SDL_snprintf(text, sizeof(text), "Press Ctrl+Enter to toggle SDL_WINDOW_FULLSCREEN"); + SDL_strlcpy(text, "Press Ctrl+Enter to toggle SDL_WINDOW_FULLSCREEN", sizeof(text)); SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); SDLTest_DrawString(renderer, x, y, text); y += lineHeight; @@ -107,14 +107,14 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_Rect viewport) return; } - SDL_snprintf(text, sizeof(text), "%d: %dx%d@%dHz", - i, mode.w, mode.h, mode.refresh_rate); + (void)SDL_snprintf(text, sizeof(text), "%d: %dx%d@%dHz", + i, mode.w, mode.h, mode.refresh_rate); /* Update column width */ text_length = (int)SDL_strlen(text); column_chars = SDL_max(column_chars, text_length); - /* Check if under mouse */ + /* Check if under mouse */ cell_rect.x = x; cell_rect.y = y; cell_rect.w = text_length * FONT_CHARACTER_SIZE; @@ -143,108 +143,107 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_Rect viewport) } } -void -loop() +void loop(void) { int i; SDL_Event event; - /* Check for events */ - while (SDL_PollEvent(&event)) { - SDLTest_CommonEvent(state, &event, &done); - - if (event.type == SDL_WINDOWEVENT) { - if (event.window.event == SDL_WINDOWEVENT_RESIZED) { - SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); - if (window) { - SDL_Log("Window %" SDL_PRIu32 " resized to %" SDL_PRIs32 "x%" SDL_PRIs32 "\n", - event.window.windowID, - event.window.data1, - event.window.data2); - } + /* Check for events */ + while (SDL_PollEvent(&event)) { + SDLTest_CommonEvent(state, &event, &done); + + if (event.type == SDL_WINDOWEVENT) { + if (event.window.event == SDL_WINDOWEVENT_RESIZED) { + SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); + if (window) { + SDL_Log("Window %" SDL_PRIu32 " resized to %" SDL_PRIs32 "x%" SDL_PRIs32 "\n", + event.window.windowID, + event.window.data1, + event.window.data2); } - if (event.window.event == SDL_WINDOWEVENT_MOVED) { - SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); - if (window) { - SDL_Log("Window %" SDL_PRIu32 " moved to %" SDL_PRIs32 ",%" SDL_PRIs32 " (display %s)\n", - event.window.windowID, - event.window.data1, - event.window.data2, - SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window))); - } + } + if (event.window.event == SDL_WINDOWEVENT_MOVED) { + SDL_Window *window = SDL_GetWindowFromID(event.window.windowID); + if (window) { + SDL_Log("Window %" SDL_PRIu32 " moved to %" SDL_PRIs32 ",%" SDL_PRIs32 " (display %s)\n", + event.window.windowID, + event.window.data1, + event.window.data2, + SDL_GetDisplayName(SDL_GetWindowDisplayIndex(window))); } - if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) { - relative_mode = SDL_GetRelativeMouseMode(); - if (relative_mode) { - SDL_SetRelativeMouseMode(SDL_FALSE); - } + } + if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) { + relative_mode = SDL_GetRelativeMouseMode(); + if (relative_mode) { + SDL_SetRelativeMouseMode(SDL_FALSE); } - if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { - if (relative_mode) { - SDL_SetRelativeMouseMode(SDL_TRUE); - } + } + if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED) { + if (relative_mode) { + SDL_SetRelativeMouseMode(SDL_TRUE); } } - if (event.type == SDL_KEYUP) { - SDL_bool updateCursor = SDL_FALSE; - - if (event.key.keysym.sym == SDLK_LEFT) { - --system_cursor; - if (system_cursor < 0) { - system_cursor = SDL_NUM_SYSTEM_CURSORS - 1; - } - updateCursor = SDL_TRUE; - } else if (event.key.keysym.sym == SDLK_RIGHT) { - ++system_cursor; - if (system_cursor >= SDL_NUM_SYSTEM_CURSORS) { - system_cursor = 0; - } - updateCursor = SDL_TRUE; + } + if (event.type == SDL_KEYUP) { + SDL_bool updateCursor = SDL_FALSE; + + if (event.key.keysym.sym == SDLK_LEFT) { + --system_cursor; + if (system_cursor < 0) { + system_cursor = SDL_NUM_SYSTEM_CURSORS - 1; } - if (updateCursor) { - SDL_Log("Changing cursor to \"%s\"", cursorNames[system_cursor]); - SDL_FreeCursor(cursor); - cursor = SDL_CreateSystemCursor((SDL_SystemCursor)system_cursor); - SDL_SetCursor(cursor); + updateCursor = SDL_TRUE; + } else if (event.key.keysym.sym == SDLK_RIGHT) { + ++system_cursor; + if (system_cursor >= SDL_NUM_SYSTEM_CURSORS) { + system_cursor = 0; } + updateCursor = SDL_TRUE; + } + if (updateCursor) { + SDL_Log("Changing cursor to \"%s\"", cursorNames[system_cursor]); + SDL_FreeCursor(cursor); + cursor = SDL_CreateSystemCursor((SDL_SystemCursor)system_cursor); + SDL_SetCursor(cursor); } - if (event.type == SDL_MOUSEBUTTONUP) { - SDL_Window* window = SDL_GetMouseFocus(); - if (highlighted_mode != -1 && window != NULL) { - const int display_index = SDL_GetWindowDisplayIndex(window); - SDL_DisplayMode mode; - if (0 != SDL_GetDisplayMode(display_index, highlighted_mode, &mode)) { - SDL_Log("Couldn't get display mode"); - } else { - SDL_SetWindowDisplayMode(window, &mode); - } + } + if (event.type == SDL_MOUSEBUTTONUP) { + SDL_Window *window = SDL_GetMouseFocus(); + if (highlighted_mode != -1 && window) { + const int display_index = SDL_GetWindowDisplayIndex(window); + SDL_DisplayMode mode; + if (0 != SDL_GetDisplayMode(display_index, highlighted_mode, &mode)) { + SDL_Log("Couldn't get display mode"); + } else { + SDL_SetWindowDisplayMode(window, &mode); } } } + } - for (i = 0; i < state->num_windows; ++i) { - SDL_Window* window = state->windows[i]; - SDL_Renderer *renderer = state->renderers[i]; - if (window != NULL && renderer != NULL) { - int y = 0; - SDL_Rect viewport, menurect; + for (i = 0; i < state->num_windows; ++i) { + SDL_Window *window = state->windows[i]; + SDL_Renderer *renderer = state->renderers[i]; + if (window && renderer) { + int y = 0; + SDL_Rect viewport, menurect; - SDL_RenderGetViewport(renderer, &viewport); + SDL_RenderGetViewport(renderer, &viewport); - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); - SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); - SDLTest_CommonDrawWindowInfo(renderer, state->windows[i], &y); + SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); + SDLTest_CommonDrawWindowInfo(renderer, state->windows[i], &y); - menurect.x = 0; - menurect.y = y; - menurect.w = viewport.w; - menurect.h = viewport.h - y; - draw_modes_menu(window, renderer, menurect); + menurect.x = 0; + menurect.y = y; + menurect.w = viewport.w; + menurect.h = viewport.h - y; + draw_modes_menu(window, renderer, menurect); - SDL_RenderPresent(renderer); - } + SDL_RenderPresent(renderer); } + } #ifdef __EMSCRIPTEN__ if (done) { emscripten_cancel_main_loop(); @@ -252,8 +251,7 @@ loop() #endif } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int i; @@ -281,7 +279,7 @@ main(int argc, char *argv[]) SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); } - + /* Main render loop */ done = 0; #ifdef __EMSCRIPTEN__ @@ -295,7 +293,7 @@ main(int argc, char *argv[]) quit(0); /* keep the compiler happy ... */ - return(0); + return 0; } /* vi: set ts=4 sw=4 expandtab: */ diff --git a/test/testyuv.c b/test/testyuv.c index df0d94381107d..20708de8fb8aa 100644 --- a/test/testyuv.c +++ b/test/testyuv.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -17,17 +17,13 @@ #include "SDL_test_font.h" #include "testyuv_cvt.h" - /* 422 (YUY2, etc) formats are the largest */ -#define MAX_YUV_SURFACE_SIZE(W, H, P) (H*4*(W+P+1)/2) - +#define MAX_YUV_SURFACE_SIZE(W, H, P) (H * 4 * (W + P + 1) / 2) /* Return true if the YUV format is packed pixels */ static SDL_bool is_packed_yuv_format(Uint32 format) { - return (format == SDL_PIXELFORMAT_YUY2 || - format == SDL_PIXELFORMAT_UYVY || - format == SDL_PIXELFORMAT_YVYU); + return format == SDL_PIXELFORMAT_YUY2 || format == SDL_PIXELFORMAT_UYVY || format == SDL_PIXELFORMAT_YVYU; } /* Create a surface with a good pattern for verifying YUV conversion */ @@ -38,12 +34,12 @@ static SDL_Surface *generate_test_pattern(int pattern_size) if (pattern) { int i, x, y; Uint8 *p, c; - const int thickness = 2; /* Important so 2x2 blocks of color are the same, to avoid Cr/Cb interpolation over pixels */ + const int thickness = 2; /* Important so 2x2 blocks of color are the same, to avoid Cr/Cb interpolation over pixels */ /* R, G, B in alternating horizontal bands */ for (y = 0; y < pattern->h; y += thickness) { for (i = 0; i < thickness; ++i) { - p = (Uint8 *)pattern->pixels + (y + i) * pattern->pitch + ((y/thickness) % 3); + p = (Uint8 *)pattern->pixels + (y + i) * pattern->pitch + ((y / thickness) % 3); for (x = 0; x < pattern->w; ++x) { *p = 0xFF; p += 3; @@ -53,9 +49,9 @@ static SDL_Surface *generate_test_pattern(int pattern_size) /* Black and white in alternating vertical bands */ c = 0xFF; - for (x = 1*thickness; x < pattern->w; x += 2*thickness) { + for (x = 1 * thickness; x < pattern->w; x += 2 * thickness) { for (i = 0; i < thickness; ++i) { - p = (Uint8 *)pattern->pixels + (x + i)*3; + p = (Uint8 *)pattern->pixels + (x + i) * 3; for (y = 0; y < pattern->h; ++y) { SDL_memset(p, c, 3); p += pattern->pitch; @@ -129,7 +125,7 @@ static int run_automated_tests(int pattern_size, int extra_pitch) Uint8 *yuv2 = (Uint8 *)SDL_malloc(yuv_len); int yuv1_pitch, yuv2_pitch; int result = -1; - + if (!pattern || !yuv1 || !yuv2) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't allocate test surfaces"); goto done; @@ -206,7 +202,6 @@ static int run_automated_tests(int pattern_size, int extra_pitch) } } - result = 0; done: @@ -216,10 +211,10 @@ static int run_automated_tests(int pattern_size, int extra_pitch) return result; } -int -main(int argc, char **argv) +int main(int argc, char **argv) { - struct { + struct + { SDL_bool enable_intrinsics; int pattern_size; int extra_pitch; @@ -315,10 +310,10 @@ main(int argc, char **argv) /* Run automated tests */ if (should_run_automated_tests) { for (i = 0; i < SDL_arraysize(automated_test_params); ++i) { - SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Running automated test, pattern size %d, extra pitch %d, intrinsics %s\n", - automated_test_params[i].pattern_size, - automated_test_params[i].extra_pitch, - automated_test_params[i].enable_intrinsics ? "enabled" : "disabled"); + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Running automated test, pattern size %d, extra pitch %d, intrinsics %s\n", + automated_test_params[i].pattern_size, + automated_test_params[i].extra_pitch, + automated_test_params[i].enable_intrinsics ? "enabled" : "disabled"); if (run_automated_tests(automated_test_params[i].pattern_size, automated_test_params[i].extra_pitch) < 0) { return 2; } @@ -339,8 +334,8 @@ main(int argc, char **argv) raw_yuv = SDL_calloc(1, MAX_YUV_SURFACE_SIZE(original->w, original->h, 0)); ConvertRGBtoYUV(yuv_format, original->pixels, original->pitch, raw_yuv, original->w, original->h, - SDL_GetYUVConversionModeForResolution(original->w, original->h), - 0, 100); + SDL_GetYUVConversionModeForResolution(original->w, original->h), + 0, 100); pitch = CalculateYUVPitch(yuv_format, original->w); converted = SDL_CreateRGBSurfaceWithFormat(0, original->w, original->h, 0, rgb_format); @@ -350,11 +345,11 @@ main(int argc, char **argv) } then = SDL_GetTicks(); - for ( i = 0; i < iterations; ++i ) { + for (i = 0; i < iterations; ++i) { SDL_ConvertPixels(original->w, original->h, yuv_format, raw_yuv, pitch, rgb_format, converted->pixels, converted->pitch); } now = SDL_GetTicks(); - SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%" SDL_PRIu32 " iterations in %" SDL_PRIu32 " ms, %.2fms each\n", iterations, (now - then), (float) (now - then) / iterations); + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%" SDL_PRIu32 " iterations in %" SDL_PRIu32 " ms, %.2fms each\n", iterations, (now - then), (float)(now - then) / iterations); window = SDL_CreateWindow("YUV test", SDL_WINDOWPOS_UNDEFINED, @@ -380,7 +375,7 @@ main(int argc, char **argv) return 5; } SDL_UpdateTexture(output[2], NULL, raw_yuv, pitch); - + yuv_name = SDL_GetPixelFormatName(yuv_format); if (SDL_strncmp(yuv_name, "SDL_PIXELFORMAT_", 16) == 0) { yuv_name += 16; @@ -401,9 +396,9 @@ main(int argc, char **argv) break; } - { int done = 0; - while ( !done ) - { + { + int done = 0; + while (!done) { SDL_Event event; while (SDL_PollEvent(&event) > 0) { if (event.type == SDL_QUIT) { @@ -419,7 +414,7 @@ main(int argc, char **argv) } } if (event.type == SDL_MOUSEBUTTONDOWN) { - if (event.button.x < (original->w/2)) { + if (event.button.x < (original->w / 2)) { --current; } else { ++current; @@ -441,7 +436,7 @@ main(int argc, char **argv) if (current == 0) { SDLTest_DrawString(renderer, 4, 4, titles[current]); } else { - SDL_snprintf(title, sizeof(title), "%s %s %s", titles[current], yuv_name, yuv_mode); + (void)SDL_snprintf(title, sizeof(title), "%s %s %s", titles[current], yuv_name, yuv_mode); SDLTest_DrawString(renderer, 4, 4, title); } SDL_RenderPresent(renderer); diff --git a/test/testyuv_cvt.c b/test/testyuv_cvt.c index ed354d8aca657..985762735878b 100644 --- a/test/testyuv_cvt.c +++ b/test/testyuv_cvt.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -14,13 +14,12 @@ #include "testyuv_cvt.h" - static float clip3(float x, float y, float z) { - return ((z < x) ? x : ((z > y) ? y : z)); + return (z < x) ? x : ((z > y) ? y : z); } -static void RGBtoYUV(Uint8 * rgb, int *yuv, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance) +static void RGBtoYUV(const Uint8 *rgb, int *yuv, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance) { if (mode == SDL_YUV_CONVERSION_JPEG) { /* Full range YUV */ @@ -52,9 +51,9 @@ static void RGBtoYUV(Uint8 * rgb, int *yuv, SDL_YUV_CONVERSION_MODE mode, int mo G = rgb[1]; B = rgb[2]; L = Kr * R + Kb * B + (1 - Kr - Kb) * G; - Y = (Uint8)SDL_floorf((219*(L-Z)/S + 16) + 0.5f); - U = (Uint8)clip3(0, 255, SDL_floorf((112.0f*(B-L) / ((1.0f-Kb)*S) + 128) + 0.5f)); - V = (Uint8)clip3(0, 255, SDL_floorf((112.0f*(R-L) / ((1.0f-Kr)*S) + 128) + 0.5f)); + Y = (Uint8)SDL_floorf((219 * (L - Z) / S + 16) + 0.5f); + U = (Uint8)clip3(0, 255, SDL_floorf((112.0f * (B - L) / ((1.0f - Kb) * S) + 128) + 0.5f)); + V = (Uint8)clip3(0, 255, SDL_floorf((112.0f * (R - L) / ((1.0f - Kr) * S) + 128) + 0.5f)); yuv[0] = (Uint8)Y; yuv[1] = (Uint8)U; @@ -68,8 +67,9 @@ static void RGBtoYUV(Uint8 * rgb, int *yuv, SDL_YUV_CONVERSION_MODE mode, int mo if (luminance != 100) { yuv[0] = yuv[0] * luminance / 100; - if (yuv[0] > 255) + if (yuv[0] > 255) { yuv[0] = 255; + } } } @@ -79,7 +79,7 @@ static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *o int yuv[4][3]; Uint8 *Y1, *Y2, *U, *V; Uint8 *rgb1, *rgb2; - int rgb_row_advance = (pitch - w*3) + pitch; + int rgb_row_advance = (pitch - w * 3) + pitch; int UV_advance; rgb1 = src; @@ -90,12 +90,12 @@ static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *o switch (format) { case SDL_PIXELFORMAT_YV12: V = (Y1 + h * w); - U = V + ((h + 1)/2)*((w + 1)/2); + U = V + ((h + 1) / 2) * ((w + 1) / 2); UV_advance = 1; break; case SDL_PIXELFORMAT_IYUV: U = (Y1 + h * w); - V = U + ((h + 1)/2)*((w + 1)/2); + V = U + ((h + 1) / 2) * ((w + 1) / 2); UV_advance = 1; break; case SDL_PIXELFORMAT_NV12: @@ -131,10 +131,10 @@ static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *o rgb2 += 3; *Y2++ = (Uint8)yuv[3][0]; - *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1] + yuv[2][1] + yuv[3][1])/4.0f + 0.5f); + *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1] + yuv[2][1] + yuv[3][1]) / 4.0f + 0.5f); U += UV_advance; - *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2] + yuv[2][2] + yuv[3][2])/4.0f + 0.5f); + *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2] + yuv[2][2] + yuv[3][2]) / 4.0f + 0.5f); V += UV_advance; } /* Last column */ @@ -147,10 +147,10 @@ static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *o rgb2 += 3; *Y2++ = (Uint8)yuv[2][0]; - *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[2][1])/2.0f + 0.5f); + *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[2][1]) / 2.0f + 0.5f); U += UV_advance; - *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[2][2])/2.0f + 0.5f); + *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[2][2]) / 2.0f + 0.5f); V += UV_advance; } Y1 += w; @@ -169,10 +169,10 @@ static void ConvertRGBtoPlanar2x2(Uint32 format, Uint8 *src, int pitch, Uint8 *o rgb1 += 3; *Y1++ = (Uint8)yuv[1][0]; - *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1])/2.0f + 0.5f); + *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1]) / 2.0f + 0.5f); U += UV_advance; - *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2])/2.0f + 0.5f); + *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2]) / 2.0f + 0.5f); V += UV_advance; } /* Last column */ @@ -195,28 +195,28 @@ static void ConvertRGBtoPacked4(Uint32 format, Uint8 *src, int pitch, Uint8 *out int yuv[2][3]; Uint8 *Y1, *Y2, *U, *V; Uint8 *rgb; - int rgb_row_advance = (pitch - w*3); + int rgb_row_advance = (pitch - w * 3); rgb = src; switch (format) { case SDL_PIXELFORMAT_YUY2: Y1 = out; - U = out+1; - Y2 = out+2; - V = out+3; + U = out + 1; + Y2 = out + 2; + V = out + 3; break; case SDL_PIXELFORMAT_UYVY: U = out; - Y1 = out+1; - V = out+2; - Y2 = out+3; + Y1 = out + 1; + V = out + 2; + Y2 = out + 3; break; case SDL_PIXELFORMAT_YVYU: Y1 = out; - V = out+1; - Y2 = out+2; - U = out+3; + V = out + 1; + Y2 = out + 2; + U = out + 3; break; default: SDL_assert(!"Unsupported packed YUV format"); @@ -235,10 +235,10 @@ static void ConvertRGBtoPacked4(Uint32 format, Uint8 *src, int pitch, Uint8 *out *Y2 = (Uint8)yuv[1][0]; Y2 += 4; - *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1])/2.0f + 0.5f); + *U = (Uint8)SDL_floorf((yuv[0][1] + yuv[1][1]) / 2.0f + 0.5f); U += 4; - *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2])/2.0f + 0.5f); + *V = (Uint8)SDL_floorf((yuv[0][2] + yuv[1][2]) / 2.0f + 0.5f); V += 4; } /* Last column */ @@ -261,8 +261,7 @@ static void ConvertRGBtoPacked4(Uint32 format, Uint8 *src, int pitch, Uint8 *out SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance) { - switch (format) - { + switch (format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: case SDL_PIXELFORMAT_NV12: @@ -281,8 +280,7 @@ SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w int CalculateYUVPitch(Uint32 format, int width) { - switch (format) - { + switch (format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: case SDL_PIXELFORMAT_NV12: @@ -291,7 +289,7 @@ int CalculateYUVPitch(Uint32 format, int width) case SDL_PIXELFORMAT_YUY2: case SDL_PIXELFORMAT_UYVY: case SDL_PIXELFORMAT_YVYU: - return 4*((width + 1)/2); + return 4 * ((width + 1) / 2); default: return 0; } diff --git a/test/testyuv_cvt.h b/test/testyuv_cvt.h index 57ddb76485ede..6565e52e0a173 100644 --- a/test/testyuv_cvt.h +++ b/test/testyuv_cvt.h @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/test/torturethread.c b/test/torturethread.c index d76f07755f0af..3b0737c3aa061 100644 --- a/test/torturethread.c +++ b/test/torturethread.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1997-2022 Sam Lantinga + Copyright (C) 1997-2025 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -34,8 +34,9 @@ quit(int rc) int SDLCALL SubThreadFunc(void *data) { - while (!*(int volatile *) data) { - ; /* SDL_Delay(10); *//* do nothing */ + SDL_atomic_t *flag = (SDL_atomic_t *)data; + while (!SDL_AtomicGet(flag)) { + SDL_Delay(10); } return 0; } @@ -44,27 +45,27 @@ int SDLCALL ThreadFunc(void *data) { SDL_Thread *sub_threads[NUMTHREADS]; - int flags[NUMTHREADS]; + SDL_atomic_t flags[NUMTHREADS]; int i; - int tid = (int) (uintptr_t) data; + int tid = (int)(uintptr_t)data; SDL_Log("Creating Thread %d\n", tid); for (i = 0; i < NUMTHREADS; i++) { char name[64]; - SDL_snprintf(name, sizeof (name), "Child%d_%d", tid, i); - flags[i] = 0; + (void)SDL_snprintf(name, sizeof(name), "Child%d_%d", tid, i); + SDL_AtomicSet(&flags[i], 0); sub_threads[i] = SDL_CreateThread(SubThreadFunc, name, &flags[i]); } SDL_Log("Thread '%d' waiting for signal\n", tid); while (SDL_AtomicGet(&time_for_threads_to_die[tid]) != 1) { - ; /* do nothing */ + ; /* do nothing */ } SDL_Log("Thread '%d' sending signals to subthreads\n", tid); for (i = 0; i < NUMTHREADS; i++) { - flags[i] = 1; + SDL_AtomicSet(&flags[i], 1); SDL_WaitThread(sub_threads[i], NULL); } @@ -73,8 +74,7 @@ ThreadFunc(void *data) return 0; } -int -main(int argc, char *argv[]) +int main(int argc, char *argv[]) { SDL_Thread *threads[NUMTHREADS]; int i; @@ -85,15 +85,15 @@ main(int argc, char *argv[]) /* Load the SDL library */ if (SDL_Init(0) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return (1); + return 1; } - signal(SIGSEGV, SIG_DFL); + (void)signal(SIGSEGV, SIG_DFL); for (i = 0; i < NUMTHREADS; i++) { char name[64]; - SDL_snprintf(name, sizeof (name), "Parent%d", i); + (void)SDL_snprintf(name, sizeof(name), "Parent%d", i); SDL_AtomicSet(&time_for_threads_to_die[i], 0); - threads[i] = SDL_CreateThread(ThreadFunc, name, (void*) (uintptr_t) i); + threads[i] = SDL_CreateThread(ThreadFunc, name, (void *)(uintptr_t)i); if (threads[i] == NULL) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create thread: %s\n", SDL_GetError()); @@ -109,5 +109,5 @@ main(int argc, char *argv[]) SDL_WaitThread(threads[i], NULL); } SDL_Quit(); - return (0); + return 0; } diff --git a/test/watcom.mif b/test/watcom.mif index 2189fd49c2760..aa15f6695463f 100644 --- a/test/watcom.mif +++ b/test/watcom.mif @@ -53,12 +53,13 @@ TASRCS = testautomation.c & testautomation_audio.c testautomation_clipboard.c & testautomation_events.c testautomation_guid.c & testautomation_hints.c testautomation_joystick.c & - testautomation_keyboard.c testautomation_main.c & - testautomation_math.c testautomation_mouse.c & - testautomation_pixels.c testautomation_platform.c & - testautomation_rect.c testautomation_render.c & - testautomation_rwops.c testautomation_sdltest.c & - testautomation_stdlib.c testautomation_surface.c & + testautomation_keyboard.c testautomation_log.c & + testautomation_main.c testautomation_math.c & + testautomation_mouse.c testautomation_pixels.c & + testautomation_platform.c testautomation_rect.c & + testautomation_render.c testautomation_rwops.c & + testautomation_sdltest.c testautomation_stdlib.c & + testautomation_subsystems.c testautomation_surface.c & testautomation_syswm.c testautomation_timer.c & testautomation_video.c @@ -69,8 +70,6 @@ TNOBJS = $(TNSRCS:.c=.obj) all: testutils.lib $(TARGETS) -.c: ../src/test - .obj.exe: wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ @@ -82,6 +81,9 @@ testvulkan.obj: testvulkan.c # new vulkan headers result in lots of W202 warnings wcc386 $(CFLAGS) -wcd=202 -fo=$^@ $< +testautomation_stdlib.obj: testautomation_stdlib.c + wcc386 $(CFLAGS) -wcd=201 -fo=$^@ $< + testautomation.exe: $(TAOBJS) wlink SYS $(SYSTEM) libpath $(LIBPATH) lib {$(LIBS)} op q op el file {$<} name $@ @@ -106,14 +108,14 @@ testutils.lib: testutils.obj check: .SYMBOLIC $(TESTS) @set SDL_AUDIODRIVER=dummy @set SDL_VIDEODRIVER=dummy - @copy "../SDL2.dll" . + @copy ..\SDL2.dll . @for %exe in ($(TESTS)) do %exe check-quick: .SYMBOLIC $(TESTS) @set SDL_TESTS_QUICK=1 @set SDL_AUDIODRIVER=dummy @set SDL_VIDEODRIVER=dummy - @copy "../SDL2.dll" . + @copy ..\SDL2.dll . @for %exe in ($(TESTS)) do %exe clean: .SYMBOLIC diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c new file mode 100644 index 0000000000000..13259af5faade --- /dev/null +++ b/test/win32/sdlprocdump.c @@ -0,0 +1,683 @@ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include +#include + +#include +#include +#include +#include +#include + +#define DUMP_FOLDER "minidumps" +#define APPNAME "SDLPROCDUMP" + +#define PRODCUMP_MIN(A,B) (((A) < (B)) ? (A) : (B)) + +#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86) +#define SDLPROCDUMP_CPU_X86 1 +#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) +#define SDLPROCDUMP_CPU_X64 1 +#elif defined(__aarch64__) || defined(_M_ARM64) +#define SDLPROCDUMP_CPU_ARM64 1 +#elif defined(__arm__) || defined(_M_ARM) +#define SDLPROCDUMP_CPU_ARM32 1 +#endif + +#if defined(SDLPROCDUMP_CPU_X86) || defined(SDLPROCDUMP_CPU_X64) || defined(SDLPROCDUMP_CPU_ARM32) || defined(SDLPROCDUMP_CPU_ARM64) +#define SDLPROCDUMP_PRINTSTACK +#else +#pragma message("Unsupported architecture: don't know how to StackWalk") +#endif + +#ifndef EXCEPTION_SOFTWARE_ORIGINATE +#define EXCEPTION_SOFTWARE_ORIGINATE 0x80 +#endif + +static void printf_message(const char *format, ...) { + va_list ap; + fprintf(stderr, "[" APPNAME "] "); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void printf_windows_message(const char *format, ...) { + va_list ap; + char win_msg[512]; + size_t win_msg_len; + + FormatMessageA( + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + win_msg, sizeof(win_msg)/sizeof(*win_msg), + NULL); + win_msg_len = strlen(win_msg); + while (win_msg[win_msg_len-1] == '\r' || win_msg[win_msg_len-1] == '\n' || win_msg[win_msg_len-1] == ' ') { + win_msg[win_msg_len-1] = '\0'; + win_msg_len--; + } + fprintf(stderr, "[" APPNAME "] "); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + fprintf(stderr, " (%s)\n", win_msg); +} + +struct { + HMODULE module; + BOOL (WINAPI *pSymInitialize)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess); + BOOL (WINAPI *pSymCleanup)(HANDLE hProcess); + BOOL (WINAPI *pMiniDumpWriteDump)( + HANDLE hProcess, + DWORD ProcessId, + HANDLE hFile, + MINIDUMP_TYPE DumpType, + PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, + PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, + PMINIDUMP_CALLBACK_INFORMATION CallbackParam); + BOOL (WINAPI *pSymFromAddr)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol); + BOOL (WINAPI *pSymGetLineFromAddr64)(HANDLE hProcess, DWORD64 qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line); + BOOL (WINAPI *pStackWalk64)(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME64 StackFrame, + PVOID ContextRecord, PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, + PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, + PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress); + PVOID (WINAPI *pSymFunctionTableAccess64)(HANDLE hProcess, DWORD64 AddrBase); + DWORD64 (WINAPI *pSymGetModuleBase64)(HANDLE hProcess, DWORD64 qwAddr); + BOOL (WINAPI *pSymGetModuleInfo64)(HANDLE hProcess, DWORD64 qwAddr, PIMAGEHLP_MODULE64 ModuleInfo); + BOOL (WINAPI *pSymRefreshModuleList)(HANDLE hProcess); +} dyn_dbghelp; + +static void load_dbghelp(void) { + if (dyn_dbghelp.module) { + return; + } + dyn_dbghelp.module = LoadLibraryA("dbghelp.dll"); + if (!dyn_dbghelp.module) { + printf_message("Failed to load dbghelp.dll"); + goto failed; + } + dyn_dbghelp.pSymInitialize = (void *)GetProcAddress(dyn_dbghelp.module, "SymInitialize"); + dyn_dbghelp.pSymCleanup = (void *)GetProcAddress(dyn_dbghelp.module, "SymCleanup"); + dyn_dbghelp.pMiniDumpWriteDump = (void *)GetProcAddress(dyn_dbghelp.module, "MiniDumpWriteDump"); + dyn_dbghelp.pSymFromAddr = (void *)GetProcAddress(dyn_dbghelp.module, "SymFromAddr"); + dyn_dbghelp.pStackWalk64 = (void *)GetProcAddress(dyn_dbghelp.module, "StackWalk64"); + dyn_dbghelp.pSymGetLineFromAddr64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetLineFromAddr64"); + dyn_dbghelp.pSymFunctionTableAccess64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymFunctionTableAccess64"); + dyn_dbghelp.pSymGetModuleBase64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetModuleBase64"); + dyn_dbghelp.pSymGetModuleInfo64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetModuleInfo64"); + dyn_dbghelp.pSymRefreshModuleList = (void *)GetProcAddress(dyn_dbghelp.module, "SymRefreshModuleList"); + return; +failed: + if (dyn_dbghelp.module) { + FreeLibrary(dyn_dbghelp.module); + dyn_dbghelp.module = NULL; + } +} + +static void unload_dbghelp(void) { + if (!dyn_dbghelp.module) { + return; + } + FreeLibrary(dyn_dbghelp.module); + memset(&dyn_dbghelp, 0, sizeof(dyn_dbghelp)); +} + +#define FOREACH_EXCEPTION_CODES(X) \ + X(EXCEPTION_ACCESS_VIOLATION) \ + X(EXCEPTION_DATATYPE_MISALIGNMENT) \ + X(EXCEPTION_BREAKPOINT) \ + X(EXCEPTION_SINGLE_STEP) \ + X(EXCEPTION_ARRAY_BOUNDS_EXCEEDED) \ + X(EXCEPTION_FLT_DENORMAL_OPERAND) \ + X(EXCEPTION_FLT_DIVIDE_BY_ZERO) \ + X(EXCEPTION_FLT_INEXACT_RESULT) \ + X(EXCEPTION_FLT_INVALID_OPERATION) \ + X(EXCEPTION_FLT_OVERFLOW) \ + X(EXCEPTION_FLT_STACK_CHECK) \ + X(EXCEPTION_FLT_UNDERFLOW) \ + X(EXCEPTION_INT_DIVIDE_BY_ZERO) \ + X(EXCEPTION_INT_OVERFLOW) \ + X(EXCEPTION_PRIV_INSTRUCTION) \ + X(EXCEPTION_IN_PAGE_ERROR) \ + X(EXCEPTION_ILLEGAL_INSTRUCTION) \ + X(EXCEPTION_NONCONTINUABLE_EXCEPTION) \ + X(EXCEPTION_STACK_OVERFLOW) \ + X(EXCEPTION_INVALID_DISPOSITION) \ + X(EXCEPTION_GUARD_PAGE) \ + X(EXCEPTION_INVALID_HANDLE) \ + X(STATUS_HEAP_CORRUPTION) + +#define FOREACH_EXCEPTION_FLAGS(X) \ + X(EXCEPTION_NONCONTINUABLE) \ + X(EXCEPTION_UNWINDING) \ + X(EXCEPTION_EXIT_UNWIND) \ + X(EXCEPTION_STACK_INVALID) \ + X(EXCEPTION_NESTED_CALL) \ + X(EXCEPTION_TARGET_UNWIND) \ + X(EXCEPTION_COLLIDED_UNWIND) \ + X(EXCEPTION_SOFTWARE_ORIGINATE) + +static const char *exceptionCode_to_string(DWORD dwCode) { +#define SWITCH_CODE_STR(V) case V: return #V; + switch (dwCode) { + case 0xe06d7363: return "MS Visual C++ Exception"; + FOREACH_EXCEPTION_CODES(SWITCH_CODE_STR) + default: { + return "unknown"; + } + } +#undef SWITCH_CODE_STR +} + +static const char *exceptionFlags_to_string(DWORD dwFlags, char *buffer, size_t buffer_length) { + buffer[0] = '\0'; + +#define APPEND_OR_STR(CODE) \ + if (dwFlags & (CODE)) { \ + if (buffer[0]) { \ + strcat_s(buffer, buffer_length, "|"); \ + } \ + strcat_s(buffer, buffer_length, #CODE); \ + } + + FOREACH_EXCEPTION_FLAGS(APPEND_OR_STR) +#undef APPEND_OR_STR + return buffer; +} + +static BOOL IsCXXException(DWORD dwCode) { + /* https://devblogs.microsoft.com/oldnewthing/20100730-00/?p=13273 */ + return dwCode == 0xe06d7363; /* FOURCC(0xe0, 'm', 's', 'c') */ +} + +static BOOL IsFatalExceptionCode(DWORD dwCode) { + switch (dwCode) { + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_INT_DIVIDE_BY_ZERO: + case EXCEPTION_STACK_OVERFLOW: + case STATUS_HEAP_CORRUPTION: + case STATUS_STACK_BUFFER_OVERRUN: + case EXCEPTION_GUARD_PAGE: + case EXCEPTION_INVALID_HANDLE: + return TRUE; + default: + return FALSE; + } +} + +static const char *get_simple_basename(const char *path) { + const char *pos = strrchr(path, '\\'); + if (pos) { + return pos + 1; + } + pos = strrchr(path, '/'); + if (pos) { + return pos + 1; + } + return path; +} + +static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMATION process_information, DWORD dwThreadId, PEXCEPTION_RECORD exception_record, PCONTEXT context) { + BOOL success; + char dump_file_path[MAX_PATH]; + char child_file_name[64]; + EXCEPTION_POINTERS exception_pointers; + HANDLE hFile = INVALID_HANDLE_VALUE; + MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information; + SYSTEMTIME system_time; + + if (!dyn_dbghelp.pMiniDumpWriteDump) { + printf_message("Cannot find pMiniDumpWriteDump in dbghelp.dll: no minidump"); + return; + } + + success = CreateDirectoryA(DUMP_FOLDER, NULL); + if (!success && GetLastError() != ERROR_ALREADY_EXISTS) { + printf_windows_message("Failed to create minidump directory"); + goto post_dump; + } + _splitpath_s(child_file_path, NULL, 0, NULL, 0, child_file_name, sizeof(child_file_name), NULL, 0); + GetLocalTime(&system_time); + + snprintf(dump_file_path, sizeof(dump_file_path), "minidumps/%s_%04d-%02d-%02d_%02d-%02d-%02d.dmp", + child_file_name, + system_time.wYear, system_time.wMonth, system_time.wDay, + system_time.wHour, system_time.wMinute, system_time.wSecond); + printf_message(""); + printf_message("Writing minidump to \"%s\"", dump_file_path); + hFile = CreateFileA( + dump_file_path, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + if (hFile == INVALID_HANDLE_VALUE) { + printf_windows_message("Failed to open file for minidump"); + goto post_dump; + } + memset(&exception_pointers, 0, sizeof(exception_pointers)); + exception_pointers.ContextRecord = context; + exception_pointers.ExceptionRecord = exception_record; + minidump_exception_information.ClientPointers = FALSE; + minidump_exception_information.ExceptionPointers = &exception_pointers; + minidump_exception_information.ThreadId = dwThreadId; + success = dyn_dbghelp.pMiniDumpWriteDump( + process_information->hProcess, /* HANDLE hProcess */ + process_information->dwProcessId, /* DWORD ProcessId */ + hFile, /* HANDLE hFile */ + MiniDumpWithFullMemory, /* MINIDUMP_TYPE DumpType */ + &minidump_exception_information, /* PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam */ + NULL, /* PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam */ + NULL); /* PMINIDUMP_CALLBACK_INFORMATION CallbackParam */ + if (!success) { + printf_windows_message("Failed to write minidump"); + } +post_dump: + if (hFile != INVALID_HANDLE_VALUE) { + CloseHandle(hFile); + } +} + +static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LPVOID address, PCONTEXT context) { + STACKFRAME64 stack_frame; + DWORD machine_type; + + if (!context) { + printf_message("Cannot create a stacktrace without a context"); + return; + } + if (!dyn_dbghelp.pStackWalk64) { + printf_message("Cannot find StackWalk64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymFunctionTableAccess64) { + printf_message("Cannot find SymFunctionTableAccess64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetModuleBase64) { + printf_message("Cannot find SymGetModuleBase64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymFromAddr) { + printf_message("Cannot find pSymFromAddr in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetLineFromAddr64) { + printf_message("Cannot find SymGetLineFromAddr64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetModuleInfo64) { + printf_message("Cannot find SymGetModuleInfo64 in dbghelp.dll: no stacktrace"); + return; + } + + if (!dyn_dbghelp.pSymRefreshModuleList || !dyn_dbghelp.pSymRefreshModuleList(process_information->hProcess)) { + printf_windows_message("SymRefreshModuleList failed: maybe no stacktrace"); + } + + memset(&stack_frame, 0, sizeof(stack_frame)); + + stack_frame.AddrPC.Mode = AddrModeFlat; + stack_frame.AddrFrame.Mode = AddrModeFlat; + stack_frame.AddrStack.Mode = AddrModeFlat; + +#if defined(SDLPROCDUMP_CPU_X86) + machine_type = IMAGE_FILE_MACHINE_I386; + stack_frame.AddrFrame.Offset = context->Ebp; + stack_frame.AddrStack.Offset = context->Esp; + stack_frame.AddrPC.Offset = context->Eip; +#elif defined(SDLPROCDUMP_CPU_X64) + machine_type = IMAGE_FILE_MACHINE_AMD64; + stack_frame.AddrFrame.Offset = context->Rbp; + stack_frame.AddrStack.Offset = context->Rsp; + stack_frame.AddrPC.Offset = context->Rip; +#elif defined(SDLPROCDUMP_CPU_ARM32) + machine_type = IMAGE_FILE_MACHINE_ARM; + stack_frame.AddrFrame.Offset = context->Lr; + stack_frame.AddrStack.Offset = context->Sp; + stack_frame.AddrPC.Offset = context->Pc; +#elif defined(SDLPROCDUMP_CPU_ARM64) + machine_type = IMAGE_FILE_MACHINE_ARM64; + stack_frame.AddrFrame.Offset = context->Fp; + stack_frame.AddrStack.Offset = context->Sp; + stack_frame.AddrPC.Offset = context->Pc; +#endif + while (dyn_dbghelp.pStackWalk64(machine_type, /* DWORD MachineType */ + process_information->hProcess, /* HANDLE hProcess */ + process_information->hThread, /* HANDLE hThread */ + &stack_frame, /* LPSTACKFRAME64 StackFrame */ + context, /* PVOID ContextRecord */ + NULL, /* PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine */ + dyn_dbghelp.pSymFunctionTableAccess64, /* PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine */ + dyn_dbghelp.pSymGetModuleBase64, /* PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine */ + NULL)) { /* PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress */ + IMAGEHLP_MODULE64 module_info; + union { + char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)]; + SYMBOL_INFO symbol_info; + } symbol; + DWORD64 dwDisplacement; + DWORD lineColumn = 0; + IMAGEHLP_LINE64 line; + const char *image_file_name; + const char *symbol_name; + const char *file_name; + char line_number[16]; + + if (stack_frame.AddrPC.Offset == stack_frame.AddrReturn.Offset) { + printf_message("PC == Return Address => Possible endless callstack"); + break; + } + + memset(&module_info, 0, sizeof(module_info)); + module_info.SizeOfStruct = sizeof(module_info); + if (!dyn_dbghelp.pSymGetModuleInfo64(process_information->hProcess, stack_frame.AddrPC.Offset, &module_info)) { + image_file_name = "?"; + } else { + image_file_name = get_simple_basename(module_info.ImageName); + } + + memset(&symbol, 0, sizeof(symbol)); + symbol.symbol_info.SizeOfStruct = sizeof(symbol.symbol_info); + symbol.symbol_info.MaxNameLen = MAX_SYM_NAME; + if (!dyn_dbghelp.pSymFromAddr(process_information->hProcess, (DWORD64)(uintptr_t)stack_frame.AddrPC.Offset, &dwDisplacement, &symbol.symbol_info)) { + symbol_name = "???"; + dwDisplacement = 0; + } else { + symbol_name = symbol.symbol_info.Name; + } + + line.SizeOfStruct = sizeof(line); + if (!dyn_dbghelp.pSymGetLineFromAddr64(process_information->hProcess, (DWORD64)(uintptr_t)stack_frame.AddrPC.Offset, &lineColumn, &line)) { + file_name = ""; + line_number[0] = '\0'; + } else { + file_name = line.FileName; + snprintf(line_number, sizeof(line_number), "Line %u", (unsigned int)line.LineNumber); + } + printf_message("%s!%s+0x%x %s %s", image_file_name, symbol_name, dwDisplacement, file_name, line_number); + } +} + +static PCONTEXT FillInThreadContext(LPPROCESS_INFORMATION process_information, PCONTEXT context_buffer) { + HANDLE thread_handle = NULL; + + thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, process_information->dwThreadId); + if (!thread_handle) { + printf_windows_message("OpenThread failed: no stacktrace"); + return NULL; + } + + memset(context_buffer, 0, sizeof(*context_buffer)); + context_buffer->ContextFlags = CONTEXT_ALL; + if (!GetThreadContext(thread_handle, context_buffer)) { + printf_windows_message("GetThreadContext failed: no stacktrace"); + CloseHandle(thread_handle); + return NULL; + } + CloseHandle(thread_handle); + return context_buffer; +} + +static void GetMSCExceptionName(HANDLE hProcess, ULONG_PTR *parameters, DWORD count_parameters, char *buffer, size_t buffer_size) { + +#define FIXUP_DWORD_POINTER(ADDR) ((sizeof(void *) == 8) ? (parameters[3] + (ADDR)) : (ADDR)) +#define CHECKED_ReadProcessMemory(PROCESS, ADDRESS, BUFFER, COUNT, WHAT) \ + do { \ + SIZE_T actual_count; \ + BOOL res = ReadProcessMemory((PROCESS), (ADDRESS), (BUFFER), (COUNT), &actual_count); \ + if (!res) { \ + printf_windows_message(WHAT ": ReadProcessMemory failed"); \ + strncpy_s(buffer, buffer_size, "", buffer_size); \ + return; \ + } \ + if ((COUNT) != (actual_count)) { \ + printf_message(WHAT ": ReadProcessMemory did not read enough data actual=%lu expected=%lu", \ + (unsigned long) (actual_count), (unsigned long) (COUNT)); \ + strncpy_s(buffer, buffer_size, "", buffer_size); \ + return; \ + } \ + } while (0) + + DWORD depth0; + char *ptr_depth0; + DWORD depth1; + char *ptr_depth1; + DWORD depth2; + char *ptr_depth2; + + CHECKED_ReadProcessMemory(hProcess, (void *)(parameters[2] + 3 * sizeof(DWORD)), &depth0, sizeof(depth0), "depth 0"); + ptr_depth0 = (char *)FIXUP_DWORD_POINTER(depth0); + CHECKED_ReadProcessMemory(hProcess, ptr_depth0 + 1 * sizeof(DWORD), &depth1, sizeof(depth1), "depth 1"); + ptr_depth1 = (char *)FIXUP_DWORD_POINTER(depth1); + CHECKED_ReadProcessMemory(hProcess, ptr_depth1 + 1 * sizeof(DWORD), &depth2, sizeof(depth2), "depth 2"); + ptr_depth2 = (char *)FIXUP_DWORD_POINTER(depth2); + CHECKED_ReadProcessMemory(hProcess, ptr_depth2 + 2 * sizeof(void*), buffer, buffer_size, "data"); + buffer[buffer_size - 1] = '\0'; + +#undef FIXUP_DWORD_POINTER +#undef CHECKED_ReadProcessMemory +} + +static void log_usage(const char *argv0) { + fprintf(stderr, "Usage: %s [--help] [--debug-stream] [--] PROGRAM [ARG1 [ARG2 [ARG3 ... ]]]\n", argv0); +} + +int main(int argc, char *argv[]) { + int i; + int cmd_start; + size_t command_line_len = 0; + char *command_line; + STARTUPINFOA startup_info; + PROCESS_INFORMATION process_information; + BOOL success; + BOOL debugger_present; + DWORD exit_code; + DWORD creation_flags; + BOOL log_debug_stream = FALSE; + + cmd_start = -1; + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--") == 0) { + cmd_start = i + 1; + break; + } else if (strcmp(argv[i], "--debug-stream") == 0) { + log_debug_stream = TRUE; + continue; + } else if (strcmp(argv[i], "--help") == 0) { + log_usage(argv[0]); + return 0; + } else { + cmd_start = i; + break; + } + } + if (cmd_start < 0 || cmd_start >= argc) { + log_usage(argv[0]); + return 1; + } + + for (i = cmd_start; i < argc; i++) { + command_line_len += strlen(argv[i]) + 1; + } + command_line = malloc(command_line_len + 1); + if (!command_line) { + printf_message("Failed to allocate memory for command line"); + return 1; + } + command_line[0] = '\0'; + for (i = cmd_start; i < argc; i++) { + strcat_s(command_line, command_line_len, argv[i]); + if (i != argc - 1) { + strcat_s(command_line, command_line_len, " "); + } + } + + memset(&startup_info, 0, sizeof(startup_info)); + startup_info.cb = sizeof(startup_info); + + debugger_present = IsDebuggerPresent(); + creation_flags = NORMAL_PRIORITY_CLASS; + if (!debugger_present) { + creation_flags |= DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS; + } + success = CreateProcessA( + argv[cmd_start], /* LPCSTR lpApplicationName, */ + command_line, /* LPSTR lpCommandLine, */ + NULL, /* LPSECURITY_ATTRIBUTES lpProcessAttributes, */ + NULL, /* LPSECURITY_ATTRIBUTES lpThreadAttributes, */ + TRUE, /* BOOL bInheritHandles, */ + creation_flags, /* DWORD dwCreationFlags, */ + NULL, /* LPVOID lpEnvironment, */ + NULL, /* LPCSTR lpCurrentDirectory, */ + &startup_info, /* LPSTARTUPINFOA lpStartupInfo, */ + &process_information); /* LPPROCESS_INFORMATION lpProcessInformation */ + + if (!success) { + printf_windows_message("Failed to start application \"%s\"", argv[cmd_start]); + return 1; + } + + if (debugger_present) { + WaitForSingleObject(process_information.hProcess, INFINITE); + } else { + int process_alive = 1; + DEBUG_EVENT event; + while (process_alive) { + DWORD continue_status = DBG_CONTINUE; + success = WaitForDebugEvent(&event, INFINITE); + if (!success) { + printf_windows_message("Failed to get a debug event"); + return 1; + } + switch (event.dwDebugEventCode) { + case OUTPUT_DEBUG_STRING_EVENT: + { + if (log_debug_stream) { + SIZE_T bytes_read = 0; + union { + char char_buffer[512]; + WCHAR wchar_buffer[256]; + } buffer; + if (ReadProcessMemory(process_information.hProcess, event.u.DebugString.lpDebugStringData, buffer.char_buffer, PRODCUMP_MIN(sizeof(buffer), event.u.DebugString.nDebugStringLength), &bytes_read) && bytes_read) { + if (event.u.DebugString.fUnicode) { + size_t len = bytes_read / 2; + buffer.wchar_buffer[255] = '\0'; + while (len > 0 && (buffer.wchar_buffer[len - 1] == '\0' || buffer.wchar_buffer[len - 1] == '\n' || buffer.wchar_buffer[len - 1] == '\r')) { + buffer.wchar_buffer[len - 1] = '\0'; + len -= 1; + } + if (len > 0) { + printf("[" APPNAME "] (debug) %S\n", buffer.wchar_buffer); + } + } else { + size_t len = bytes_read; + buffer.char_buffer[511] = '\0'; + while (len > 0 && (buffer.char_buffer[len - 1] == '\0' || buffer.char_buffer[len - 1] == '\n' || buffer.char_buffer[len - 1] == '\r')) { + buffer.char_buffer[len - 1] = '\0'; + len -= 1; + } + if (len > 0) { + printf("[" APPNAME "] (debug) %s\n", buffer.char_buffer); + } + } + } + } + break; + } + case EXCEPTION_DEBUG_EVENT: + { + const BOOL cxx_exception = IsCXXException(event.u.Exception.ExceptionRecord.ExceptionCode); + const BOOL is_fatal = !cxx_exception && (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)); + if (cxx_exception || is_fatal) { + char flag_buffer[256]; + printf_message("EXCEPTION_DEBUG_EVENT"); + printf_message(" ExceptionCode: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionCode, + exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); + printf_message(" ExceptionFlags: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionFlags, + exceptionFlags_to_string(event.u.Exception.ExceptionRecord.ExceptionFlags, flag_buffer, sizeof(flag_buffer))); + + printf_message(" FirstChance: %ld", event.u.Exception.dwFirstChance); + printf_message(" ExceptionAddress: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionAddress); + } + if (cxx_exception) { + char exception_name[256]; + GetMSCExceptionName(process_information.hProcess, event.u.Exception.ExceptionRecord.ExceptionInformation, event.u.Exception.ExceptionRecord.NumberParameters, + exception_name, sizeof(exception_name)); + printf_message(" Exception name: %s", exception_name); + } else if (is_fatal) { + CONTEXT context_buffer; + PCONTEXT context; + + printf_message(" (Non-continuable exception debug event)"); + context = FillInThreadContext(&process_information, &context_buffer); + write_minidump(argv[cmd_start], &process_information, event.dwThreadId, &event.u.Exception.ExceptionRecord, context); + printf_message(""); +#ifdef SDLPROCDUMP_PRINTSTACK + print_stacktrace(&process_information, event.u.Exception.ExceptionRecord.ExceptionAddress, context); +#else + printf_message("No support for printing stacktrack for current architecture"); +#endif + DebugActiveProcessStop(event.dwProcessId); + process_alive = FALSE; + } + continue_status = DBG_EXCEPTION_NOT_HANDLED; + break; + } + case CREATE_PROCESS_DEBUG_EVENT: + load_dbghelp(); + if (!dyn_dbghelp.pSymInitialize) { + printf_message("Cannot find pSymInitialize in dbghelp.dll: no stacktrace"); + break; + } + /* Don't invade process on CI: downloading symbols will cause test timeouts */ + if (!dyn_dbghelp.pSymInitialize(process_information.hProcess, NULL, FALSE)) { + printf_windows_message("SymInitialize failed: no stacktrace"); + break; + } + break; + case EXIT_PROCESS_DEBUG_EVENT: + if (event.dwProcessId == process_information.dwProcessId) { + process_alive = 0; + DebugActiveProcessStop(event.dwProcessId); + } + break; + } + success = ContinueDebugEvent(event.dwProcessId, event.dwThreadId, continue_status); + if (!process_alive) { + DebugActiveProcessStop(event.dwProcessId); + } + } + } + if (dyn_dbghelp.pSymCleanup) { + dyn_dbghelp.pSymCleanup(process_information.hProcess); + } + unload_dbghelp(); + + exit_code = 1; + success = GetExitCodeProcess(process_information.hProcess, &exit_code); + + if (!success) { + printf_message("Failed to get process exit code"); + return 1; + } + + CloseHandle(process_information.hThread); + CloseHandle(process_information.hProcess); + + return exit_code; +} diff --git a/wayland-protocols/cursor-shape-v1.xml b/wayland-protocols/cursor-shape-v1.xml new file mode 100644 index 0000000000000..56f6a1a65bf9f --- /dev/null +++ b/wayland-protocols/cursor-shape-v1.xml @@ -0,0 +1,147 @@ + + + + Copyright 2018 The Chromium Authors + Copyright 2023 Simon Ser + + 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 (including the next + paragraph) 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. + + + + + This global offers an alternative, optional way to set cursor images. This + new way uses enumerated cursors instead of a wl_surface like + wl_pointer.set_cursor does. + + Warning! The protocol described in this file is currently in the testing + phase. Backward compatible changes may be added together with the + corresponding interface version bump. Backward incompatible changes can + only be done by creating a new major version of the extension. + + + + + Destroy the cursor shape manager. + + + + + + Obtain a wp_cursor_shape_device_v1 for a wl_pointer object. + + + + + + + + Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object. + + + + + + + + + This interface advertises the list of supported cursor shapes for a + device, and allows clients to set the cursor shape. + + + + + This enum describes cursor shapes. + + The names are taken from the CSS W3C specification: + https://w3c.github.io/csswg-drafts/css-ui/#cursor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Destroy the cursor shape device. + + The device cursor shape remains unchanged. + + + + + + Sets the device cursor to the specified shape. The compositor will + change the cursor image based on the specified shape. + + The cursor actually changes only if the input device focus is one of + the requesting client's surfaces. If any, the previous cursor image + (surface or shape) is replaced. + + The "shape" argument must be a valid enum entry, otherwise the + invalid_shape protocol error is raised. + + This is similar to the wl_pointer.set_cursor and + zwp_tablet_tool_v2.set_cursor requests, but this request accepts a + shape instead of contents in the form of a surface. Clients can mix + set_cursor and set_shape requests. + + The serial parameter must match the latest wl_pointer.enter or + zwp_tablet_tool_v2.proximity_in serial number sent to the client. + Otherwise the request will be ignored. + + + + + + diff --git a/wayland-protocols/fractional-scale-v1.xml b/wayland-protocols/fractional-scale-v1.xml new file mode 100644 index 0000000000000..350bfc01eafa0 --- /dev/null +++ b/wayland-protocols/fractional-scale-v1.xml @@ -0,0 +1,102 @@ + + + + Copyright © 2022 Kenny Levinsen + + 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 (including the next + paragraph) 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. + + + + This protocol allows a compositor to suggest for surfaces to render at + fractional scales. + + A client can submit scaled content by utilizing wp_viewport. This is done by + creating a wp_viewport object for the surface and setting the destination + rectangle to the surface size before the scale factor is applied. + + The buffer size is calculated by multiplying the surface size by the + intended scale. + + The wl_surface buffer scale should remain set to 1. + + If a surface has a surface-local size of 100 px by 50 px and wishes to + submit buffers with a scale of 1.5, then a buffer of 150px by 75 px should + be used and the wp_viewport destination rectangle should be 100 px by 50 px. + + For toplevel surfaces, the size is rounded halfway away from zero. The + rounding algorithm for subsurface position and size is not defined. + + + + + A global interface for requesting surfaces to use fractional scales. + + + + + Informs the server that the client will not be using this protocol + object anymore. This does not affect any other objects, + wp_fractional_scale_v1 objects included. + + + + + + + + + + Create an add-on object for the the wl_surface to let the compositor + request fractional scales. If the given wl_surface already has a + wp_fractional_scale_v1 object associated, the fractional_scale_exists + protocol error is raised. + + + + + + + + + An additional interface to a wl_surface object which allows the compositor + to inform the client of the preferred scale. + + + + + Destroy the fractional scale object. When this object is destroyed, + preferred_scale events will no longer be sent. + + + + + + Notification of a new preferred scale for this surface that the + compositor suggests that the client should use. + + The sent scale is the numerator of a fraction with a denominator of 120. + + + + + diff --git a/wayland-protocols/xdg-shell.xml b/wayland-protocols/xdg-shell.xml index be64354da05b1..1caf6f10016e4 100644 --- a/wayland-protocols/xdg-shell.xml +++ b/wayland-protocols/xdg-shell.xml @@ -29,7 +29,7 @@ DEALINGS IN THE SOFTWARE. - + The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It @@ -50,6 +50,8 @@ summary="the client provided an invalid surface state"/> + @@ -58,7 +60,7 @@ Destroying a bound xdg_wm_base object while there are surfaces still alive created by this xdg_wm_base object instance is illegal - and will result in a protocol error. + and will result in a defunct_surfaces error. @@ -75,7 +77,9 @@ This creates an xdg_surface for the given surface. While xdg_surface itself is not a role, the corresponding surface may only be assigned - a role extending xdg_surface, such as xdg_toplevel or xdg_popup. + a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is + illegal to create an xdg_surface for a wl_surface which already has an + assigned role and this will result in a role error. This creates an xdg_surface for the given surface. An xdg_surface is used as basis to define a role to a given surface, such as xdg_toplevel @@ -92,7 +96,8 @@ A client must respond to a ping event with a pong request or - the client may be deemed unresponsive. See xdg_wm_base.ping. + the client may be deemed unresponsive. See xdg_wm_base.ping + and xdg_wm_base.error.unresponsive. @@ -106,7 +111,9 @@ Compositors can use this to determine if the client is still alive. It's unspecified what will happen if the client doesn't respond to the ping request, or in what timeframe. Clients should - try to respond in a reasonable amount of time. + try to respond in a reasonable amount of time. The “unresponsive” + error is provided for compositors that wish to disconnect unresponsive + clients. A compositor is free to ping in any way it wants, but a client must always respond to any xdg_wm_base object it created. @@ -115,7 +122,7 @@ - + The xdg_positioner provides a collection of rules for the placement of a child surface relative to a parent surface. Rules can be defined to ensure @@ -135,7 +142,7 @@ For an xdg_positioner object to be considered complete, it must have a non-zero size set by set_size, and a non-zero anchor rectangle set by set_anchor_rect. Passing an incomplete xdg_positioner object when - positioning a surface raises an error. + positioning a surface raises an invalid_positioner error. @@ -223,7 +230,8 @@ specified (e.g. 'bottom_right' or 'top_left'), then the child surface will be placed towards the specified gravity; otherwise, the child surface will be centered over the anchor point on any axis that had no - gravity specified. + gravity specified. If the gravity is not in the ‘gravity’ enum, an + invalid_input error is raised. @@ -336,7 +344,7 @@ The default adjustment is none. - @@ -389,7 +397,7 @@ - Set the serial of a xdg_surface.configure event this positioner will be + Set the serial of an xdg_surface.configure event this positioner will be used in response to. The compositor may use this information together with set_parent_size to determine what future state the popup should be constrained using. @@ -399,7 +407,7 @@ - + An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface. @@ -426,6 +434,14 @@ manipulate a buffer prior to the first xdg_surface.configure call must also be treated as errors. + After creating a role-specific object and setting it up (e.g. by sending + the title, app ID, size constraints, parent, etc), the client must + perform an initial commit without any buffer attached. The compositor + will reply with initial wl_surface state such as + wl_surface.preferred_buffer_scale followed by an xdg_surface.configure + event. The client must acknowledge it and is then allowed to attach a + buffer to map the surface. + Mapping an xdg_surface-based role surface is defined as making it possible for the surface to be shown by the compositor. Note that a mapped surface is not guaranteed to be visible once it is mapped. @@ -439,19 +455,30 @@ A newly-unmapped surface is considered to have met condition (1) out of the 3 required conditions for mapping a surface if its role surface - has not been destroyed. + has not been destroyed, i.e. the client must perform the initial commit + again before attaching a buffer. - - - + + + + + + Destroy the xdg_surface object. An xdg_surface must only be destroyed - after its role object has been destroyed. + after its role object has been destroyed, otherwise + a defunct_role_object error is raised. @@ -489,8 +516,7 @@ portions like drop-shadows which should be ignored for the purposes of aligning, placing and constraining windows. - The window geometry is double buffered, and will be applied at the - time wl_surface.commit of the corresponding wl_surface is called. + The window geometry is double-buffered state, see wl_surface.commit. When maintaining a position, the compositor should treat the (x, y) coordinate of the window geometry as the top left corner of the window. @@ -506,13 +532,22 @@ commit. This unset is meant for extremely simple clients. The arguments are given in the surface-local coordinate space of - the wl_surface associated with this xdg_surface. + the wl_surface associated with this xdg_surface, and may extend outside + of the wl_surface itself to mark parts of the subsurface tree as part of + the window geometry. - The width and height must be greater than zero. Setting an invalid size - will raise an error. When applied, the effective window geometry will be - the set window geometry clamped to the bounding rectangle of the - combined geometry of the surface of the xdg_surface and the associated + When applied, the effective window geometry will be the set window + geometry clamped to the bounding rectangle of the combined + geometry of the surface of the xdg_surface and the associated subsurfaces. + + The effective geometry will not be recalculated unless a new call to + set_window_geometry is done and the new pending surface state is + subsequently applied. + + The width and height of the effective window geometry must be + greater than zero. Setting an invalid size will raise an + invalid_size error. @@ -533,6 +568,8 @@ If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event. + Acking a configure event that was never sent raises an invalid_serial + error. A client is not required to commit immediately after sending an ack_configure request - it may even ack_configure several times @@ -541,6 +578,17 @@ A client may send multiple ack_configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to. + + Sending an ack_configure request consumes the serial number sent with + the request, as well as serial numbers sent by all configure events + sent on this xdg_surface prior to the configure event referenced by + the committed serial. + + It is an error to issue multiple ack_configure requests referencing a + serial from the same configure event, or to issue an ack_configure + request referencing a serial from a configure event issued before the + event identified by the last ack_configure request for the same + xdg_surface. Doing so will raise an invalid_serial error. @@ -569,7 +617,7 @@ - + This interface defines an xdg_surface role which allows a surface to, among other things, set window-like properties such as maximize, @@ -577,11 +625,19 @@ id, and well as trigger user interactive operations such as interactive resize and move. + A xdg_toplevel by default is responsible for providing the full intended + visual representation of the toplevel, which depending on the window + state, may mean things like a title bar, window controls and drop shadow. + Unmapping an xdg_toplevel means that the surface cannot be shown by the compositor until it is explicitly mapped again. All active operations (e.g., move, resize) are canceled and all attributes (e.g. title, state, stacking, ...) are discarded for - an xdg_toplevel surface when it is unmapped. + an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to + the state it had right after xdg_surface.get_toplevel. The client + can re-map the toplevel by performing a commit without any buffer + attached, waiting for a configure event and handling it as usual (see + xdg_surface description). Attaching a null buffer to a toplevel unmaps the surface. @@ -593,24 +649,37 @@ + + + + + + Set the "parent" of this surface. This surface should be stacked above the parent surface and all other ancestor surfaces. - Parent windows should be set on dialogs, toolboxes, or other + Parent surfaces should be set on dialogs, toolboxes, or other "auxiliary" surfaces, so that the parent is raised when the dialog is raised. - Setting a null parent for a child window removes any parent-child - relationship for the child. Setting a null parent for a window which - currently has no parent is a no-op. + Setting a null parent for a child surface unsets its parent. Setting + a null parent for a surface which currently has no parent is a no-op. - If the parent is unmapped then its children are managed as - though the parent of the now-unmapped parent has become the - parent of this surface. If no parent exists for the now-unmapped - parent then the children are managed as though they have no - parent surface. + Only mapped surfaces can have child surfaces. Setting a parent which + is not mapped is equivalent to setting a null parent. If a surface + becomes unmapped, its children's parent is set to the parent of + the now-unmapped surface. If the now-unmapped surface has no parent, + its children's parent is unset. If the now-unmapped surface becomes + mapped again, its parent-child relationship is not restored. + + The parent toplevel must not be one of the child toplevel's + descendants, and the parent must be different from the child toplevel, + otherwise the invalid_parent protocol error is raised. @@ -652,7 +721,7 @@ application identifiers and how they relate to well-known D-Bus names and .desktop files. - [0] http://standards.freedesktop.org/desktop-entry-spec/ + [0] https://standards.freedesktop.org/desktop-entry-spec/ @@ -666,7 +735,8 @@ This request asks the compositor to pop up such a window menu at the given position, relative to the local surface coordinates of the parent surface. There are no guarantees as to what menu items - the window menu contains. + the window menu contains, or even if a window menu will be drawn + at all. This request must be used in response to some sort of user action like a button press, key press, or touch down event. @@ -742,12 +812,13 @@ guarantee that the device focus will return when the resize is completed. - The edges parameter specifies how the surface should be resized, - and is one of the values of the resize_edge enum. The compositor - may use this information to update the surface position for - example when dragging the top left corner. The compositor may also - use this information to adapt its behavior, e.g. choose an - appropriate cursor image. + The edges parameter specifies how the surface should be resized, and + is one of the values of the resize_edge enum. Values not matching + a variant of the enum will cause the invalid_resize_edge protocol error. + The compositor may use this information to update the surface position + for example when dragging the top left corner. The compositor may also + use this information to adapt its behavior, e.g. choose an appropriate + cursor image. @@ -761,13 +832,13 @@ configure event to ensure that both the client and the compositor setting the state can be synchronized. - States set in this way are double-buffered. They will get applied on - the next commit. + States set in this way are double-buffered, see wl_surface.commit. The surface is maximized. The window geometry specified in the configure - event must be obeyed by the client. + event must be obeyed by the client, or the xdg_wm_base.invalid_surface_state + error is raised. The client should draw without shadow or other decoration outside of the window geometry. @@ -798,27 +869,46 @@ - + The window is currently in a tiled layout and the left edge is considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the left edge. - + The window is currently in a tiled layout and the right edge is considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the right edge. - + The window is currently in a tiled layout and the top edge is considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the top edge. - + The window is currently in a tiled layout and the bottom edge is considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the bottom edge. + + + + + The surface is currently not ordinarily being repainted; for + example because its content is occluded by another window, or its + outputs are switched off due to screen locking. @@ -833,8 +923,7 @@ The width and height arguments are in window geometry coordinates. See xdg_surface.set_window_geometry. - Values set in this way are double-buffered. They will get applied - on the next commit. + Values set in this way are double-buffered, see wl_surface.commit. The compositor can use this information to allow or disallow different states like maximize or fullscreen and draw accurate @@ -854,11 +943,11 @@ request. Requesting a maximum size to be smaller than the minimum size of - a surface is illegal and will result in a protocol error. + a surface is illegal and will result in an invalid_size error. The width and height must be greater than or equal to zero. Using - strictly negative values for width and height will result in a - protocol error. + strictly negative values for width or height will result in a + invalid_size error. @@ -874,8 +963,7 @@ The width and height arguments are in window geometry coordinates. See xdg_surface.set_window_geometry. - Values set in this way are double-buffered. They will get applied - on the next commit. + Values set in this way are double-buffered, see wl_surface.commit. The compositor can use this information to allow or disallow different states like maximize or fullscreen and draw accurate @@ -895,11 +983,11 @@ request. Requesting a minimum size to be larger than the maximum size of - a surface is illegal and will result in a protocol error. + a surface is illegal and will result in an invalid_size error. The width and height must be greater than or equal to zero. Using strictly negative values for width and height will result in a - protocol error. + invalid_size error. @@ -1058,9 +1146,68 @@ a dialog to ask the user to save their data, etc. + + + + + + The configure_bounds event may be sent prior to a xdg_toplevel.configure + event to communicate the bounds a window geometry size is recommended + to constrain to. + + The passed width and height are in surface coordinate space. If width + and height are 0, it means bounds is unknown and equivalent to as if no + configure_bounds event was ever sent for this surface. + + The bounds can for example correspond to the size of a monitor excluding + any panels or other shell components, so that a surface isn't created in + a way that it cannot fit. + + The bounds may change at any point, and in such a case, a new + xdg_toplevel.configure_bounds will be sent, followed by + xdg_toplevel.configure and xdg_surface.configure. + + + + + + + + + + + + + + + + + This event advertises the capabilities supported by the compositor. If + a capability isn't supported, clients should hide or disable the UI + elements that expose this functionality. For instance, if the + compositor doesn't advertise support for minimized toplevels, a button + triggering the set_minimized request should not be displayed. + + The compositor will ignore requests it doesn't support. For instance, + a compositor which doesn't advertise support for minimized will ignore + set_minimized requests. + + Compositors must send this event once before the first + xdg_surface.configure event. When the capabilities change, compositors + must send this event again and then send an xdg_surface.configure + event. + + The configured state should not be applied immediately. See + xdg_surface.configure for details. + + The capabilities are sent as an array of 32-bit unsigned integers in + native endianness. + + + - + A popup surface is a short-lived, temporary surface. It can be used to implement for example menus, popovers, tooltips and other similar user @@ -1098,8 +1245,8 @@ This destroys the popup. Explicitly destroying the xdg_popup object will also dismiss the popup, and unmap the surface. - If this xdg_popup is not the "topmost" popup, a protocol error - will be sent. + If this xdg_popup is not the "topmost" popup, the + xdg_wm_base.not_the_topmost_popup protocol error will be sent. @@ -1131,10 +1278,6 @@ nested grabbing popup as well. When a compositor dismisses popups, it will follow the same dismissing order as required from the client. - The parent of a grabbing popup must either be another xdg_popup with an - active explicit grab, or an xdg_popup or xdg_toplevel, if there are no - explicit grabs already taken. - If the topmost grabbing popup is destroyed, the grab will be returned to the parent of the popup, if that parent previously had an explicit grab. @@ -1204,12 +1347,12 @@ If the popup is repositioned in response to a configure event for its parent, the client should send an xdg_positioner.set_parent_configure - and possibly a xdg_positioner.set_parent_size request to allow the + and possibly an xdg_positioner.set_parent_size request to allow the compositor to properly constrain the popup. If the popup is repositioned together with a parent that is being resized, but not in response to a configure event, the client should - send a xdg_positioner.set_parent_size request. + send an xdg_positioner.set_parent_size request. diff --git a/wayland-protocols/xdg-toplevel-icon-v1.xml b/wayland-protocols/xdg-toplevel-icon-v1.xml new file mode 100644 index 0000000000000..fc409fef7c67e --- /dev/null +++ b/wayland-protocols/xdg-toplevel-icon-v1.xml @@ -0,0 +1,205 @@ + + + + + Copyright © 2023-2024 Matthias Klumpp + Copyright © 2024 David Edmundson + + 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 (including the next + paragraph) 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. + + + + This protocol allows clients to set icons for their toplevel surfaces + either via the XDG icon stock (using an icon name), or from pixel data. + + A toplevel icon represents the individual toplevel (unlike the application + or launcher icon, which represents the application as a whole), and may be + shown in window switchers, window overviews and taskbars that list + individual windows. + + This document adheres to RFC 2119 when using words like "must", + "should", "may", etc. + + Warning! The protocol described in this file is currently in the testing + phase. Backward compatible changes may be added together with the + corresponding interface version bump. Backward incompatible changes can + only be done by creating a new major version of the extension. + + + + + This interface allows clients to create toplevel window icons and set + them on toplevel windows to be displayed to the user. + + + + + Destroy the toplevel icon manager. + This does not destroy objects created with the manager. + + + + + + Creates a new icon object. This icon can then be attached to a + xdg_toplevel via the 'set_icon' request. + + + + + + + This request assigns the icon 'icon' to 'toplevel', or clears the + toplevel icon if 'icon' was null. + This state is double-buffered and is applied on the next + wl_surface.commit of the toplevel. + + After making this call, the xdg_toplevel_icon_v1 provided as 'icon' + can be destroyed by the client without 'toplevel' losing its icon. + The xdg_toplevel_icon_v1 is immutable from this point, and any + future attempts to change it must raise the + 'xdg_toplevel_icon_v1.immutable' protocol error. + + The compositor must set the toplevel icon from either the pixel data + the icon provides, or by loading a stock icon using the icon name. + See the description of 'xdg_toplevel_icon_v1' for details. + + If 'icon' is set to null, the icon of the respective toplevel is reset + to its default icon (usually the icon of the application, derived from + its desktop-entry file, or a placeholder icon). + If this request is passed an icon with no pixel buffers or icon name + assigned, the icon must be reset just like if 'icon' was null. + + + + + + + + This event indicates an icon size the compositor prefers to be + available if the client has scalable icons and can render to any size. + + When the 'xdg_toplevel_icon_manager_v1' object is created, the + compositor may send one or more 'icon_size' events to describe the list + of preferred icon sizes. If the compositor has no size preference, it + may not send any 'icon_size' event, and it is up to the client to + decide a suitable icon size. + + A sequence of 'icon_size' events must be finished with a 'done' event. + If the compositor has no size preferences, it must still send the + 'done' event, without any preceding 'icon_size' events. + + + + + + + This event is sent after all 'icon_size' events have been sent. + + + + + + + This interface defines a toplevel icon. + An icon can have a name, and multiple buffers. + In order to be applied, the icon must have either a name, or at least + one buffer assigned. Applying an empty icon (with no buffer or name) to + a toplevel should reset its icon to the default icon. + + It is up to compositor policy whether to prefer using a buffer or loading + an icon via its name. See 'set_name' and 'add_buffer' for details. + + + + + + + + + + + Destroys the 'xdg_toplevel_icon_v1' object. + The icon must still remain set on every toplevel it was assigned to, + until the toplevel icon is reset explicitly. + + + + + + This request assigns an icon name to this icon. + Any previously set name is overridden. + + The compositor must resolve 'icon_name' according to the lookup rules + described in the XDG icon theme specification[1] using the + environment's current icon theme. + + If the compositor does not support icon names or cannot resolve + 'icon_name' according to the XDG icon theme specification it must + fall back to using pixel buffer data instead. + + If this request is made after the icon has been assigned to a toplevel + via 'set_icon', a 'immutable' error must be raised. + + [1]: https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html + + + + + + + This request adds pixel data supplied as wl_buffer to the icon. + + The client should add pixel data for all icon sizes and scales that + it can provide, or which are explicitly requested by the compositor + via 'icon_size' events on xdg_toplevel_icon_manager_v1. + + The wl_buffer supplying pixel data as 'buffer' must be backed by wl_shm + and must be a square (width and height being equal). + If any of these buffer requirements are not fulfilled, a 'invalid_buffer' + error must be raised. + + If this icon instance already has a buffer of the same size and scale + from a previous 'add_buffer' request, data from the last request + overrides the preexisting pixel data. + + The wl_buffer must be kept alive for as long as the xdg_toplevel_icon + it is associated with is not destroyed, otherwise a 'no_buffer' error + is raised. The buffer contents must not be modified after it was + assigned to the icon. As a result, the region of the wl_shm_pool's + backing storage used for the wl_buffer must not be modified after this + request is sent. The wl_buffer.release event is unused. + + If this request is made after the icon has been assigned to a toplevel + via 'set_icon', a 'immutable' error must be raised. + + + + + +